From xen-devel-bounces@lists.xenproject.org Thu Aug 01 00:39:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 00:39:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769220.1180104 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZJqz-0000cZ-0M; Thu, 01 Aug 2024 00:39:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769220.1180104; Thu, 01 Aug 2024 00:39:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZJqy-0000cS-Tk; Thu, 01 Aug 2024 00:39:36 +0000
Received: by outflank-mailman (input) for mailman id 769220;
 Thu, 01 Aug 2024 00:39:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZJqx-0000cI-5w; Thu, 01 Aug 2024 00:39:35 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZJqx-0000WH-0V; Thu, 01 Aug 2024 00:39:35 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZJqw-0001YM-N4; Thu, 01 Aug 2024 00:39:34 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZJqw-00022K-Md; Thu, 01 Aug 2024 00:39:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=e+hgl/F5nOhuhALpdUibUIWIzf6lF1+WmfJ8wNFrjPo=; b=SEp6+tRYQiZFAj5f8SDcPuNklG
	Vi8X0Ov4WKFMiwXMxlqbTzI7HrZ4Q5fyyGLASmRMEmTChfCGCMHKeYafqvQVBlCUnrd8SNBMWXzgA
	PfdYpttTDdE0NmZEvuAu8tjXFFTmRBT+lBv5bEWfKhP95ToKK4q6ghhf2Hy94jHIB8C4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187093-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187093: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=eed43245dfdd6d616f7a7d72ba4ca52de3d59584
X-Osstest-Versions-That:
    ovmf=a9158fe9a670cebbb9d361a1b7fc3075fdf33393
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 00:39:34 +0000

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

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

Last test of basis   187090  2024-07-31 20:15:41 Z    0 days
Testing same since   187093  2024-07-31 23:11:29 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Michael Kubacki <michael.kubacki@microsoft.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   a9158fe9a6..eed43245df  eed43245dfdd6d616f7a7d72ba4ca52de3d59584 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 00:51:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 00:51:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769233.1180114 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZK2I-0003Pg-3y; Thu, 01 Aug 2024 00:51:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769233.1180114; Thu, 01 Aug 2024 00:51:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZK2I-0003PZ-0y; Thu, 01 Aug 2024 00:51:18 +0000
Received: by outflank-mailman (input) for mailman id 769233;
 Thu, 01 Aug 2024 00:51:16 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZK2G-0003PO-MY; Thu, 01 Aug 2024 00:51:16 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZK2G-0000kP-F9; Thu, 01 Aug 2024 00:51:16 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZK2G-0001xx-2Q; Thu, 01 Aug 2024 00:51:16 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZK2G-0006SS-1w; Thu, 01 Aug 2024 00:51:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=X2RosKM0+K+qecn+jBP+NHC9m751SatRn1UxPGjhhOk=; b=L/NfAkwj7ELS0jMM9qp5sQOLbC
	lOZN9C9iTmu4b+3TjTXmi/9qvjy7q6DdNkiCM7oXWNjlr8vd6RRs9/3XcrlYv7sjPNuIfLtj2Exmm
	bu3suvP918zarO4IifwUlHFMqxAJewmFdzbEElSfG1USwKP6IOheUNnx0T9uvGyl1jdU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187092-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187092: regressions - FAIL
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-xl-qemuu-debianhvm-amd64:xen-boot:fail:regression
    xen-unstable-smoke:test-amd64-amd64-libvirt:xen-boot:fail:regression
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    xen-unstable-smoke:test-armhf-armhf-xl:xen-boot:fail:regression
X-Osstest-Versions-This:
    xen=e05e3cedb6dbe50e43b1d6a647c16a47219fde1d
X-Osstest-Versions-That:
    xen=6979e17b3f8a18d2ba5dbd4f0623c4061dae0dfc
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 00:51:16 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-debianhvm-amd64  8 xen-boot    fail REGR. vs. 187068
 test-amd64-amd64-libvirt      8 xen-boot                 fail REGR. vs. 187068
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 187068
 test-armhf-armhf-xl           8 xen-boot                 fail REGR. vs. 187068

version targeted for testing:
 xen                  e05e3cedb6dbe50e43b1d6a647c16a47219fde1d
baseline version:
 xen                  6979e17b3f8a18d2ba5dbd4f0623c4061dae0dfc

Last test of basis   187068  2024-07-31 02:02:09 Z    0 days
Failing since        187075  2024-07-31 11:02:13 Z    0 days    3 attempts
Testing same since   187088  2024-07-31 17:00:43 Z    0 days    2 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Federico Serafini <federico.serafini@bugseng.com>
  Fouad Hilly <fouad.hilly@cloud.com>
  Jan Beulich <jbeulich@suse.com>
  Juergen Gross <jgross@suse.com>
  Julien Grall <jgrall@amazon.com>
  Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>
  Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Roger Pau Monné <roger.pau@citrix.com>
  Simone Ballarin  <simone.ballarin@bugseng.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-arm64-arm64-xl-xsm                                      fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-libvirt                                     fail    


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 01:18:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 01:18:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769243.1180124 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZKSs-0001WF-71; Thu, 01 Aug 2024 01:18:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769243.1180124; Thu, 01 Aug 2024 01:18:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZKSs-0001W8-4O; Thu, 01 Aug 2024 01:18:46 +0000
Received: by outflank-mailman (input) for mailman id 769243;
 Thu, 01 Aug 2024 01:18:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZKSq-0001Vy-RR; Thu, 01 Aug 2024 01:18:44 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZKSq-00042w-LZ; Thu, 01 Aug 2024 01:18:44 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZKSp-0002Zl-Uj; Thu, 01 Aug 2024 01:18:44 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZKSp-0007xk-UH; Thu, 01 Aug 2024 01:18:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=CUfczbCdtmSDZ9XIVAdSLYrl/6q8G4EaYloNtdLdqY8=; b=zx62bowSmvLHdEKIgpZMP9mdTn
	X2mEva89d3g7mhEOCUyjQxthSERIOwcFi93v1BWl1e5i5cxOH7gXvyAOkQssFNcPQZ5dgsiBONLF5
	9RX/AGy1jcWRn749dtXhJPAbmcV34+rRQMqTjJHW/4/aDlqZR7a3H5Ut5M/Rd9g+2B+k=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187073-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.19-testing test] 187073: regressions - FAIL
X-Osstest-Failures:
    xen-4.19-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:regression
    xen-4.19-testing:test-armhf-armhf-xl-rtds:xen-boot:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=026c9fa29716b0ff0f8b7c687908e71ba29cf239
X-Osstest-Versions-That:
    xen=fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 01:18:43 +0000

flight 187073 xen-4.19-testing real [real]
flight 187094 xen-4.19-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187073/
http://logs.test-lab.xenproject.org/osstest/logs/187094/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop       fail REGR. vs. 187044

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

version targeted for testing:
 xen                  026c9fa29716b0ff0f8b7c687908e71ba29cf239
baseline version:
 xen                  fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e

Last test of basis   187044  2024-07-29 16:07:22 Z    2 days
Testing same since   187048  2024-07-30 01:41:30 Z    1 days    3 attempts

------------------------------------------------------------
People who touched revisions under test:
  Julien Grall <jgrall@amazon.com>

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


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

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

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

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


Not pushing.

------------------------------------------------------------
commit 026c9fa29716b0ff0f8b7c687908e71ba29cf239
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:45 2024 +0100

    Set 4.19 version
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit df9b8a649f0424e0a949c0f9a7961724bbe8ea70
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:08 2024 +0100

    README: make heading say 4.19
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit b2d2878ab2686b92fcdd7bbca4ff4c312a42bc11
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:18:01 2024 +0100

    Config.mk: Bump tags to 4.19.0 final
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 04:01:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 04:01:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769269.1180141 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZN0L-0005fL-DI; Thu, 01 Aug 2024 04:01:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769269.1180141; Thu, 01 Aug 2024 04:01:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZN0L-0005fE-AQ; Thu, 01 Aug 2024 04:01:29 +0000
Received: by outflank-mailman (input) for mailman id 769269;
 Thu, 01 Aug 2024 04:01:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZN0J-0005f0-QL; Thu, 01 Aug 2024 04:01:27 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZN0J-0003fz-IM; Thu, 01 Aug 2024 04:01:27 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZN0J-0000SG-7h; Thu, 01 Aug 2024 04:01:27 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZN0J-0006Bj-7K; Thu, 01 Aug 2024 04:01:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=bnRWOkFc6oj5LnsR/yQzyzrmU1lsdkZB6VLICV6Z+oQ=; b=NX3I20ug06nEyb6hu1yj1iuGw/
	GBdjhLYIHN5WI+oMYu+eBd0cr4rezASwbf4jvt3pyLpg1kV2oFe4e3k1EuwzYqphtsNHX1D52c4//
	O5onq9EyMSQ6zQAE/8n20zyO1udNj3eabnHbxrWaCensjDpI2s0KwG088nNav+1Zm6jg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187096-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187096: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=36f75d39b38d94a0d17119a4178c08de994ead23
X-Osstest-Versions-That:
    xen=6979e17b3f8a18d2ba5dbd4f0623c4061dae0dfc
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 04:01:27 +0000

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

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  36f75d39b38d94a0d17119a4178c08de994ead23
baseline version:
 xen                  6979e17b3f8a18d2ba5dbd4f0623c4061dae0dfc

Last test of basis   187068  2024-07-31 02:02:09 Z    1 days
Failing since        187075  2024-07-31 11:02:13 Z    0 days    4 attempts
Testing same since   187096  2024-08-01 01:00:22 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Federico Serafini <federico.serafini@bugseng.com>
  Fouad Hilly <fouad.hilly@cloud.com>
  Jan Beulich <jbeulich@suse.com>
  Juergen Gross <jgross@suse.com>
  Julien Grall <jgrall@amazon.com>
  Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>
  Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Roger Pau Monné <roger.pau@citrix.com>
  Simone Ballarin  <simone.ballarin@bugseng.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   6979e17b3f..36f75d39b3  36f75d39b38d94a0d17119a4178c08de994ead23 -> smoke


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 05:56:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 05:56:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769287.1180158 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZOnp-0003yk-Lm; Thu, 01 Aug 2024 05:56:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769287.1180158; Thu, 01 Aug 2024 05:56:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZOnp-0003yd-IB; Thu, 01 Aug 2024 05:56:41 +0000
Received: by outflank-mailman (input) for mailman id 769287;
 Thu, 01 Aug 2024 05:56:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=xSmm=PA=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sZOnn-0003wm-U7
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 05:56:39 +0000
Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com
 [2a00:1450:4864:20::12c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d123e207-4fca-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 07:56:38 +0200 (CEST)
Received: by mail-lf1-x12c.google.com with SMTP id
 2adb3069b0e04-52f04150796so10860308e87.3
 for <xen-devel@lists.xenproject.org>; Wed, 31 Jul 2024 22:56:38 -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
 4fb4d7f45d1cf-5ac631b038asm9570234a12.14.2024.07.31.22.56.37
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 31 Jul 2024 22:56:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d123e207-4fca-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722491798; x=1723096598; 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=2tEnuP/UL4tXxHZWH01vp9h0c1uyXvZsZkgf8LziZQs=;
        b=DXD0Y5pmfzD/Eo7Gm+cWSUXfbJkGf3hNU99DN/2Ax6gLgokjsL2hdkfyWVnlPXSls7
         QRXS2J83bY/V0nE/Iz+fR6cOwIB0ZzQgmBX/cgMwpEJCX4VCE2SLAOQMEAaVJPFZSyiY
         HUHuH3e2ctkz+zOy/emj4U9ozcUZnNSt1A6s+sOj/oPInYSHoLw9995lAO4VMU5FB6FF
         XoWrOIw9trJtBnYcfhE9dvOatMN1kd6kb9AXvV1NeRdCl4htIWPm7/g1/Rl9Gt6/lx7q
         HFdeb7C2gyL68w+dTm59Jd4hpjNp0cafHoNTqmuUmlcQgCGd9d3ri58XzesvRCFyfNIE
         xZng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722491798; x=1723096598;
        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=2tEnuP/UL4tXxHZWH01vp9h0c1uyXvZsZkgf8LziZQs=;
        b=voOUjc5vUCa59AO9JvpHIS071/UsrWX4B5NTSzWlEkvTS2+ORxIJTMo/Rka2ceyN46
         +VLjWRwohap5JD+yK95OGX0fhL2kDnTw6LfimK3PlRIH7vGu2/u1KLG95wSrCvWqKAUu
         GdjNaXKPATMx0y2HWYhDZCQpnbjb4R4vrCCJzsQqW6tQCXPtOVJInOBWubuALJ1yzSBV
         z8/OkU8wtlO8IlgMoU5fWMDP1T/tNW3elh6V7b4GTLp7Yny+TgaHzyTmf91PB2FYij6f
         0GNJVEDha6VQd5AHBilFDOB2sZj+mqAJ5GXmp7ZNnneyjdHu2YRN/uV4PX0m9IhsqaAN
         D6+g==
X-Forwarded-Encrypted: i=1; AJvYcCWAdmqk8pF253zxTpvaYNDLU13XNtNq4Cu51HwREIrBVzk8sb56CqDSOvwinOviy4wkPS+g7vgLl/hvJdqSUWeTq5Sl+ZEXA0l90lFnHek=
X-Gm-Message-State: AOJu0YzynFFoRDvQ3Of2L19lArpaGNn5Ib/59o6ajNwjAd83/d6Z6BHZ
	BCviVOD4JnsTvbS+UiYN7jIznN4iKgLMSR/Fl8APfPuij4zY4W8SbmHH+Z/2Ydsn3rK7q5dbyyz
	s
X-Google-Smtp-Source: AGHT+IHCsd4f1Vqscyy4MNsvfeakSMScTCWtggjocQ8t3UXWgk6i+/pi+BdfpwDEC/vxDl6Ak6Dpag==
X-Received: by 2002:a05:6512:4851:b0:52e:9b68:d2d4 with SMTP id 2adb3069b0e04-530b6211441mr534845e87.56.1722491797556;
        Wed, 31 Jul 2024 22:56:37 -0700 (PDT)
Message-ID: <8fef9511-c5d0-49a9-a800-6087f03b3199@suse.com>
Date: Thu, 1 Aug 2024 07:56:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/3] mini-os: mm: switch need_pgt() to use walk_pt()
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
 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>
 <20240731212752.zd5njpd7kgoc433d@begin>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <20240731212752.zd5njpd7kgoc433d@begin>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 31.07.24 23:27, Samuel Thibault wrote:
> 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)?

No. I want to bail out if the PTE does not require a page table to be
added to it. This is the case if the PTE is valid or if it is at the
lowest page table level already.

An invalid PTE with PSE set is still invalid, so the PSE bit has no
real meaning.


Juergen


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 05:58:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 05:58:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769299.1180172 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZOpL-0004eL-3K; Thu, 01 Aug 2024 05:58:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769299.1180172; Thu, 01 Aug 2024 05:58:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZOpL-0004eE-07; Thu, 01 Aug 2024 05:58:15 +0000
Received: by outflank-mailman (input) for mailman id 769299;
 Thu, 01 Aug 2024 05:58:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=xSmm=PA=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sZOpJ-0004Wu-Cu
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 05:58:13 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 08eef0ea-4fcb-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 07:58:12 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-a7a843bef98so690618366b.2
 for <xen-devel@lists.xenproject.org>; Wed, 31 Jul 2024 22:58:12 -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-a7acad41462sm832456166b.119.2024.07.31.22.58.10
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 31 Jul 2024 22:58:10 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 08eef0ea-4fcb-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722491891; x=1723096691; 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=PrzXj9hBjHLBbAPVtBe7OuM7CtNeowl5zK25rnUfrqo=;
        b=QBf+a7ZE59iX0mqhLMbFxkZmWMqQsQCDviDjsTtYBR6XVMQJw5UV9py722Cz8vilj2
         rFdmrxVj7kOaz06g1ygRZZhIM61Ya3jn98r7GznPBMBet5q0TX6N2cnG/Dqw/iQ67Suw
         cisbtir4WFB5bWfCZk49kEkjemt1fAGRZAq3OTe8hJL14yTbmE74MN8p4rLIkVfSnOqh
         8fkKKldrh4TyvVQjPACzg9yFMKhvyyf+5bNtsAH6TNu7/ohQzqXHO7cwHi4ZabVc00iI
         FwbRgyCtej3fHMbPBLBO2C4pcKDxc0wpdS9uztfwHZHeyUSOMWbyaB7v5IrGpvQ/IlLT
         hCRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722491891; x=1723096691;
        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=PrzXj9hBjHLBbAPVtBe7OuM7CtNeowl5zK25rnUfrqo=;
        b=QZrxjSV3rw87k7g7mqTdZfI5U6SpDSLOCT50u08VS94A9Sd0a5xtRBJjy9WCBK/Cqr
         /s/Ylpx2/WJc+YqVFjlqCRvX7Tps0WOv/Tpvc0GaBKb4q2Mz9jw8ho76lUL5pC4BcZ3V
         x1S9X6t1W8xT/WemRaMfTIyn3dU3W3ck/pW4aRFlOT8WdKrJltQBgyVrjuMtlnKjMCtl
         61v6Y872nSZf8Y96RY6yx5CSoMGY6i5VGyiF5nBTooV3f6KeFayjFuhmqLkhayE5e003
         cAy2BhBIKgyEE2DscDDnydT9+3MM9iOn+vZ9+8GtiOuRBLTFrxTRqxda6waV1qshn0cS
         ePbw==
X-Forwarded-Encrypted: i=1; AJvYcCV6kyH+vsKhfIDBre0SpSR1x68viZFtBUXOLO3O/IolNP+K2PFDHN5selXSLnxlCDlX+RE4ZDSuhK4=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yww6pn+jjJAuM7lCQc+BJbkOBJecfUJcEqtbND3kxwf7OxFdlnW
	p/9VogmooFi62EJk5eD+/89cFY3A/dOd85iSp3dUf0P4ChEfBu7JDWqL+PP/Tl4=
X-Google-Smtp-Source: AGHT+IEdxR2PF49t/h+j3Ngv/qCjOIRoXd8vL5KzVadxEPd3A7uUAOZ4ec5zEiP0fanRdbUZ2q4XXw==
X-Received: by 2002:a17:907:7ba8:b0:a77:e7cb:2982 with SMTP id a640c23a62f3a-a7daf9ddda6mr86982866b.26.1722491891199;
        Wed, 31 Jul 2024 22:58:11 -0700 (PDT)
Message-ID: <3e678546-282b-461c-9a3e-363799f24e80@suse.com>
Date: Thu, 1 Aug 2024 07:58:10 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/3] mini-os: mm: introduce generic page table walk
 function
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
 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>
 <20240731213312.7qztj2qwv7g4if5e@begin>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <20240731213312.7qztj2qwv7g4if5e@begin>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 31.07.24 23:33, Samuel Thibault wrote:
> 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.

Agreed.


Juergen



From xen-devel-bounces@lists.xenproject.org Thu Aug 01 06:00:51 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 06:00:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769309.1180185 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZOrq-0006G7-H0; Thu, 01 Aug 2024 06:00:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769309.1180185; Thu, 01 Aug 2024 06:00:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZOrq-0006G0-EE; Thu, 01 Aug 2024 06:00:50 +0000
Received: by outflank-mailman (input) for mailman id 769309;
 Thu, 01 Aug 2024 06:00: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=xSmm=PA=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sZOro-0006Dt-LN
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 06:00:48 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 64a2343f-4fcb-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 08:00:46 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5af51684d52so7271767a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 31 Jul 2024 23:00:45 -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
 4fb4d7f45d1cf-5ac60918cb4sm9636299a12.0.2024.07.31.23.00.44
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 31 Jul 2024 23:00:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 64a2343f-4fcb-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722492045; x=1723096845; 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=vvTX8VhEq4feevTSvTB8g//YBud7BwtG5v2vu7g40Io=;
        b=GtIAbDJQKdhh0sahz9ub5ad5KX+SIfBW9G4Kpy5DMlgVyYzfMPqNZqnOpwUVdlqzQ/
         NeE6namTKLnwo6CH2Q/5XjHoc5tbDo88YrrOU8zGqVWjR5L5GazCuYeIvSMRUdiksVLV
         cXgVPktNbNXZAHBaTbl3CmuigYjthfnUfi4rcLw9RfsZI51MFiVuUpBcj9Xuifo4Kyn9
         p3SeR9q5hQgMv04bK/ql+ORnCf3YfVYI4cakXQFZklYiUTOs23PuZj3TEoLotaIEj/zg
         YsWBB1VgoMpanRVB9xnOOT+vM9jp4jOqYVYsKuHwnsgZ19NvvX/7LZkk0NnP39fZvP+f
         iiHQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722492045; x=1723096845;
        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=vvTX8VhEq4feevTSvTB8g//YBud7BwtG5v2vu7g40Io=;
        b=vVzAy95fRZJ6iTD3EwkEVQ27PgbJAfmuaZd3M+6mUn0QlYbxsTA+KAUB5sv0kTaHBd
         zEdhsNBUS6C8m0uFyN7lhmDMUNwR8dt2lG8mcW7vXtOqmfNsSt7Q80EfOzAHo1RmpWM6
         Cxjz+HRDqDIyhoYFF1HuKfeuOok+rlBGCvBc10Hpm2ssn7TNbwIWK3i9yf9YlqYV57JJ
         JqkPlM0JZLVNldmKP21Rflwwa4gNsv7/tDqRjfNq+vutpHUNKo+ltmEudBF65jWjux1s
         NJzhBy9EYBjsMvUFdGkgiCpvBEb4CMACP5cwtpQW+BiEVAzlWVt171T0pgtId3uIoDIy
         YIFw==
X-Forwarded-Encrypted: i=1; AJvYcCVJ6A2b1IlJBhe/6ne1kev8YkssLPk99CS7RbPazfNn3wTUhlwkMZbzfqP3UUfRxYsHaXAq0QbtvN/SNuBuKd5ukv9WYCVrmyIptqVNw3Q=
X-Gm-Message-State: AOJu0Yw25JdL2YeLTyt4cUC/DdBp9M4nH7jHcAPTXdsGYmBttzLObGAr
	aokrBk3M/wndB+9YYvnva4SPJso+dchwENCA6JaHeoVTK7hRd/PISAe5GRjsTR464sZBf4LO13+
	3
X-Google-Smtp-Source: AGHT+IFBvByQIrctF48vEyZvzdM+5pDXUsKXcjTd/gZ9ux65PZ4OHAQjLcEoqN6TJswW0q+lJe47hg==
X-Received: by 2002:a05:6402:5147:b0:59e:6b89:fdad with SMTP id 4fb4d7f45d1cf-5b6fe72135amr726306a12.3.1722492045054;
        Wed, 31 Jul 2024 23:00:45 -0700 (PDT)
Message-ID: <3f353d9d-2306-4a62-9a6f-8aa787bf33aa@suse.com>
Date: Thu, 1 Aug 2024 08:00:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/3] mini-os: mm: convert set_readonly() to use walk_pt()
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
 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>
 <20240731213753.hduimhyf56bf7yr4@begin>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <20240731213753.hduimhyf56bf7yr4@begin>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 31.07.24 23:37, Samuel Thibault wrote:
> 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?

Oh, indeed. Thanks for catching this.

> 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)

I think you are right. I'll do that.


Juergen


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 06:30:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 06:30:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769331.1180196 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZPKj-0002zI-OL; Thu, 01 Aug 2024 06:30:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769331.1180196; Thu, 01 Aug 2024 06:30:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZPKj-0002zB-LX; Thu, 01 Aug 2024 06:30:41 +0000
Received: by outflank-mailman (input) for mailman id 769331;
 Thu, 01 Aug 2024 06:30:40 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZPKi-0002z5-4t
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 06:30:40 +0000
Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com
 [2a00:1450:4864:20::52c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 90e8b2da-4fcf-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 08:30:38 +0200 (CEST)
Received: by mail-ed1-x52c.google.com with SMTP id
 4fb4d7f45d1cf-5af6a1afa63so7202065a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 31 Jul 2024 23:30:38 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7acad9068esm849347066b.153.2024.07.31.23.30.36
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 31 Jul 2024 23:30:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 90e8b2da-4fcf-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722493837; x=1723098637; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=y8PLSN17dNTu2v/AhOJNpOiMDIjtTKM6n2a/vLiKui0=;
        b=D5i+7aAkTCv8TYNT60JrJIQIRmCkFKNP1qxvrSEgTI0kKqUDRT2qFhDCluAg4thl6W
         CXUkrnkFe/urchmdr2hXe3jqTiUxTROTaUl0fWQpKNSjo539uKKbIhP025z1HY2/6jkU
         kL+y6PEjodJ3Eaa//gew0QkDrvngFSMzBlwMhsOG4ZUy1R1TYlS5uDunCXXLPwNN+I60
         LRGmsIcQxyfM0NsDzjblSyPLK0vxAtgYf4QXlynpQBNc9L0zYIZWDj4xQmPYC3aDFXU+
         i7tdByIEnhN0QPirgPKCmVrwNuQoouLGB8nV4T8a+9eQs/3iP9SDHIuqBTNrC6q5bvTJ
         c7Qw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722493837; x=1723098637;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=y8PLSN17dNTu2v/AhOJNpOiMDIjtTKM6n2a/vLiKui0=;
        b=UadTYAk3wgb7STOLcqnNZ/eVV++vi6ptY1lxRJAHGeSY1vE9A41OZXzygChPqOdYlB
         52r0mqS9jHox0vCyaE4f5GN6IIdorh4QfzmAknemfhr/WNWFXuYIaCdQpdthSHbBT73C
         ogvhQNEKnolJLI0PJ6VJT6r6SKV5SSDE27GmjxA89CZWcah9th9dvxlpP7WpbK5M1+E9
         C91M6sJg4dv9Daqhv0iLIok40WH0KSakFI/PoaRK+SFm9zsWGmQj0FQLaBm0+GVE8Ru7
         tYUO+CUfHjPGoFQH8O525sUNUNI72TEaospkEtY2bzhf5tQrTUm6bNH/S+v96WZXiAI/
         e2tg==
X-Gm-Message-State: AOJu0YwiUGNlBvvHcwjvZENZp6Kc75sEhHHjHYjqiZtpIiDz45ooxvB+
	LeEp3efXsPPLYDW6dd8mrJiT982r34jWREy/marsdPQqmRUKH2n0l1KlfK4Qao/1rFtOlrhzUPg
	=
X-Google-Smtp-Source: AGHT+IHzISJOmgEw1mU9HHDIs+MegPj3f0EGytFAej0JqlX5q3DDKGtOO74Xbp7Vz47Q1whfJcqbVw==
X-Received: by 2002:a17:907:980d:b0:a6f:6126:18aa with SMTP id a640c23a62f3a-a7daf64d740mr91562966b.67.1722493837319;
        Wed, 31 Jul 2024 23:30:37 -0700 (PDT)
Message-ID: <300f7bb3-3ab6-44ec-9663-b9934c3e123c@suse.com>
Date: Thu, 1 Aug 2024 08:30:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v4] mm: introduce xvmalloc() et al and use for grant table
 allocations
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

All of the array allocations in grant_table_init() can exceed a page's
worth of memory, which xmalloc()-based interfaces aren't really suitable
for after boot. We also don't need any of these allocations to be
physically contiguous. Introduce interfaces dynamically switching
between xmalloc() et al and vmalloc() et al, based on requested size,
and use them instead.

All the wrappers in the new header are cloned mostly verbatim from
xmalloc.h, with the sole adjustment to switch unsigned long to size_t
for sizes and to unsigned int for alignments, and with the cloning of
x[mz]alloc_bytes() avoided. The exception is xvmemdup(), where the
const related comment on xmemdup() is actually addressed and hence
dropped.

While adjusting grant_table_destroy() also move ahead the clearing of
the struct domain field.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v4: Add note to xmalloc.h and update the corresponding comment in
    xvmalloc.h. Add xvmemdup(). Drop "extern". Drop xv[mz]alloc_bytes().
    Adjust header guard name. Fully switch over grant_table.c. Re-base.
v2: Actually edit a copy-and-pasted comment in xvmalloc.h which was
    meant to be edited from the beginning.

--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -39,7 +39,7 @@
 #include <xen/paging.h>
 #include <xen/keyhandler.h>
 #include <xen/radix-tree.h>
-#include <xen/vmap.h>
+#include <xen/xvmalloc.h>
 #include <xen/nospec.h>
 #include <xsm/xsm.h>
 #include <asm/flushtlb.h>
@@ -1995,7 +1995,7 @@ int grant_table_init(struct domain *d, i
         return -EINVAL;
     }
 
-    if ( (gt = xzalloc(struct grant_table)) == NULL )
+    if ( (gt = xvzalloc(struct grant_table)) == NULL )
         return -ENOMEM;
 
     /* Simple stuff. */
@@ -2012,15 +2012,16 @@ int grant_table_init(struct domain *d, i
     d->grant_table = gt;
 
     /* Active grant table. */
-    gt->active = xzalloc_array(struct active_grant_entry *,
-                               max_nr_active_grant_frames(gt));
+    gt->active = xvzalloc_array(struct active_grant_entry *,
+                                max_nr_active_grant_frames(gt));
     if ( gt->active == NULL )
         goto out;
 
     /* Tracking of mapped foreign frames table */
     if ( gt->max_maptrack_frames )
     {
-        gt->maptrack = vzalloc(gt->max_maptrack_frames * sizeof(*gt->maptrack));
+        gt->maptrack = xvzalloc_array(struct grant_mapping *,
+                                      gt->max_maptrack_frames);
         if ( gt->maptrack == NULL )
             goto out;
 
@@ -2028,13 +2029,13 @@ int grant_table_init(struct domain *d, i
     }
 
     /* Shared grant table. */
-    gt->shared_raw = xzalloc_array(void *, gt->max_grant_frames);
+    gt->shared_raw = xvzalloc_array(void *, gt->max_grant_frames);
     if ( gt->shared_raw == NULL )
         goto out;
 
     /* Status pages for grant table - for version 2 */
-    gt->status = xzalloc_array(grant_status_t *,
-                               grant_to_status_frames(gt->max_grant_frames));
+    gt->status = xvzalloc_array(grant_status_t *,
+                                grant_to_status_frames(gt->max_grant_frames));
     if ( gt->status == NULL )
         goto out;
 
@@ -4010,23 +4011,24 @@ grant_table_destroy(
     if ( t == NULL )
         return;
 
+    d->grant_table = NULL;
+
     for ( i = 0; i < nr_grant_frames(t); i++ )
         free_xenheap_page(t->shared_raw[i]);
-    xfree(t->shared_raw);
+    xvfree(t->shared_raw);
 
     ASSERT(!t->maptrack_limit);
-    vfree(t->maptrack);
+    xvfree(t->maptrack);
 
     for ( i = 0; i < nr_active_grant_frames(t); i++ )
         free_xenheap_page(t->active[i]);
-    xfree(t->active);
+    xvfree(t->active);
 
     for ( i = 0; i < nr_status_frames(t); i++ )
         free_xenheap_page(t->status[i]);
-    xfree(t->status);
+    xvfree(t->status);
 
-    xfree(t);
-    d->grant_table = NULL;
+    xvfree(t);
 }
 
 void grant_table_init_vcpu(struct vcpu *v)
--- a/xen/common/vmap.c
+++ b/xen/common/vmap.c
@@ -7,6 +7,7 @@
 #include <xen/spinlock.h>
 #include <xen/types.h>
 #include <xen/vmap.h>
+#include <xen/xvmalloc.h>
 #include <asm/page.h>
 
 static DEFINE_SPINLOCK(vm_lock);
@@ -335,28 +336,95 @@ void *vzalloc(size_t size)
     return p;
 }
 
-void vfree(void *va)
+static void _vfree(const void *va, unsigned int pages)
 {
-    unsigned int i, pages;
+    unsigned int i;
     struct page_info *pg;
     PAGE_LIST_HEAD(pg_list);
 
-    if ( !va )
-        return;
-
-    pages = vmap_size(va);
     ASSERT(pages);
 
     for ( i = 0; i < pages; i++ )
     {
-        struct page_info *page = vmap_to_page(va + i * PAGE_SIZE);
-
-        ASSERT(page);
-        page_list_add(page, &pg_list);
+        pg = vmap_to_page(va + i * PAGE_SIZE);
+        ASSERT(pg);
+        page_list_add(pg, &pg_list);
     }
     vunmap(va);
 
     while ( (pg = page_list_remove_head(&pg_list)) != NULL )
         free_domheap_page(pg);
 }
+
+void vfree(void *va)
+{
+    if ( !va )
+        return;
+
+    _vfree(va, vmap_size(va));
+}
+
+void xvfree(void *va)
+{
+    unsigned int pages = vm_size(va, VMAP_DEFAULT);
+
+    if ( pages )
+        _vfree(va, pages);
+    else
+        xfree(va);
+}
+
+void *_xvmalloc(size_t size, unsigned int align)
+{
+    ASSERT(align <= PAGE_SIZE);
+    return size <= PAGE_SIZE ? _xmalloc(size, align) : vmalloc(size);
+}
+
+void *_xvzalloc(size_t size, unsigned int align)
+{
+    ASSERT(align <= PAGE_SIZE);
+    return size <= PAGE_SIZE ? _xzalloc(size, align) : vzalloc(size);
+}
+
+void *_xvrealloc(void *va, size_t size, unsigned int align)
+{
+    size_t pages = vm_size(va, VMAP_DEFAULT);
+    void *ptr;
+
+    ASSERT(align <= PAGE_SIZE);
+
+    if ( !pages )
+    {
+        if ( size <= PAGE_SIZE )
+            return _xrealloc(va, size, align);
+
+        ptr = vmalloc(size);
+        if ( ptr && va && va != ZERO_BLOCK_PTR )
+        {
+            /*
+             * xmalloc-based allocations up to PAGE_SIZE don't cross page
+             * boundaries. Therefore, without needing to know the exact
+             * prior allocation size, simply copy the entire tail of the
+             * page containing the earlier allocation.
+             */
+            memcpy(ptr, va, PAGE_SIZE - PAGE_OFFSET(va));
+            xfree(va);
+        }
+    }
+    else if ( pages == PFN_UP(size) )
+        ptr = va;
+    else
+    {
+        ptr = _xvmalloc(size, align);
+        if ( ptr )
+        {
+            memcpy(ptr, va, min(size, pages << PAGE_SHIFT));
+            vfree(va);
+        }
+        else if ( pages > PFN_UP(size) )
+            ptr = va;
+    }
+
+    return ptr;
+}
 #endif
--- a/xen/include/xen/xmalloc.h
+++ b/xen/include/xen/xmalloc.h
@@ -7,6 +7,9 @@
 
 /*
  * Xen malloc/free-style interface.
+ *
+ * NOTE: Unless physically contiguous memory space is required, the interfaces
+ *       in xvmalloc.h are to be used in preference to the ones here.
  */
 
 /* Allocate space for typed object. */
--- /dev/null
+++ b/xen/include/xen/xvmalloc.h
@@ -0,0 +1,75 @@
+#ifndef XEN__XVMALLOC_H
+#define XEN__XVMALLOC_H
+
+#include <xen/types.h>
+
+/*
+ * Xen malloc/free-style interface, as long as there's no need to have
+ * physically contiguous memory allocated.  These should be used in preference
+ * to xmalloc() et al.
+ */
+
+/* Allocate space for typed object. */
+#define xvmalloc(_type) ((_type *)_xvmalloc(sizeof(_type), __alignof__(_type)))
+#define xvzalloc(_type) ((_type *)_xvzalloc(sizeof(_type), __alignof__(_type)))
+
+/* Allocate space for a typed object and copy an existing instance. */
+#define xvmemdup(ptr)                                          \
+({                                                             \
+    void *p_ = _xvmalloc(sizeof(*(ptr)), __alignof__(*(ptr))); \
+    if ( p_ )                                                  \
+        memcpy(p_, ptr, sizeof(*(ptr)));                       \
+    (typeof(*(ptr)) *)p_;                                      \
+})
+
+/* Allocate space for array of typed objects. */
+#define xvmalloc_array(_type, _num) \
+    ((_type *)_xvmalloc_array(sizeof(_type), __alignof__(_type), _num))
+#define xvzalloc_array(_type, _num) \
+    ((_type *)_xvzalloc_array(sizeof(_type), __alignof__(_type), _num))
+
+/* Allocate space for a structure with a flexible array of typed objects. */
+#define xvzalloc_flex_struct(type, field, nr) \
+    ((type *)_xvzalloc(offsetof(type, field[nr]), __alignof__(type)))
+
+#define xvmalloc_flex_struct(type, field, nr) \
+    ((type *)_xvmalloc(offsetof(type, field[nr]), __alignof__(type)))
+
+/* Re-allocate space for a structure with a flexible array of typed objects. */
+#define xvrealloc_flex_struct(ptr, field, nr)                          \
+    ((typeof(ptr))_xvrealloc(ptr, offsetof(typeof(*(ptr)), field[nr]), \
+                             __alignof__(typeof(*(ptr)))))
+
+/* Free any of the above. */
+void xvfree(void *);
+
+/* Free an allocation, and zero the pointer to it. */
+#define XVFREE(p) do { \
+    xvfree(p);         \
+    (p) = NULL;        \
+} while ( false )
+
+/* Underlying functions */
+void *_xvmalloc(size_t size, unsigned int align);
+void *_xvzalloc(size_t size, unsigned int align);
+void *_xvrealloc(void *ptr, size_t size, unsigned int align);
+
+static inline void *_xvmalloc_array(
+    size_t size, unsigned int align, unsigned long num)
+{
+    /* Check for overflow. */
+    if ( size && num > UINT_MAX / size )
+        return NULL;
+    return _xvmalloc(size * num, align);
+}
+
+static inline void *_xvzalloc_array(
+    size_t size, unsigned int align, unsigned long num)
+{
+    /* Check for overflow. */
+    if ( size && num > UINT_MAX / size )
+        return NULL;
+    return _xvzalloc(size * num, align);
+}
+
+#endif /* XEN__XVMALLOC_H */


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 06:42:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 06:42:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769340.1180206 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZPWO-0005AO-P0; Thu, 01 Aug 2024 06:42:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769340.1180206; Thu, 01 Aug 2024 06:42:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZPWO-0005AH-MD; Thu, 01 Aug 2024 06:42:44 +0000
Received: by outflank-mailman (input) for mailman id 769340;
 Thu, 01 Aug 2024 06:42: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=B8jq=PA=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1sZPWN-0005AB-G3
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 06:42:43 +0000
Received: from EUR02-DB5-obe.outbound.protection.outlook.com
 (mail-db5eur02on20601.outbound.protection.outlook.com
 [2a01:111:f403:2608::601])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 403cc7bb-4fd1-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 08:42:42 +0200 (CEST)
Received: from DB8PR03CA0009.eurprd03.prod.outlook.com (2603:10a6:10:be::22)
 by GV1PR08MB10837.eurprd08.prod.outlook.com (2603:10a6:150:163::12) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21; Thu, 1 Aug
 2024 06:42:37 +0000
Received: from DU2PEPF00028CFD.eurprd03.prod.outlook.com
 (2603:10a6:10:be:cafe::c) by DB8PR03CA0009.outlook.office365.com
 (2603:10a6:10:be::22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.35 via Frontend
 Transport; Thu, 1 Aug 2024 06:42:37 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DU2PEPF00028CFD.mail.protection.outlook.com (10.167.242.181) with
 Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7828.19
 via Frontend Transport; Thu, 1 Aug 2024 06:42:37 +0000
Received: ("Tessian outbound 4bc87b8a8d84:v365");
 Thu, 01 Aug 2024 06:42:36 +0000
Received: from Lb8b97da2985c.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 511D26D6-078B-4A01-BFA2-6F50428150A4.1; 
 Thu, 01 Aug 2024 06:42:31 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id
 Lb8b97da2985c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 01 Aug 2024 06:42:31 +0000
Received: from AM8PR08MB6578.eurprd08.prod.outlook.com (2603:10a6:20b:36a::15)
 by AS8PR08MB9838.eurprd08.prod.outlook.com (2603:10a6:20b:615::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21; Thu, 1 Aug
 2024 06:42:29 +0000
Received: from AM8PR08MB6578.eurprd08.prod.outlook.com
 ([fe80::bb1a:3ac6:3110:e2d5]) by AM8PR08MB6578.eurprd08.prod.outlook.com
 ([fe80::bb1a:3ac6:3110:e2d5%5]) with mapi id 15.20.7828.021; Thu, 1 Aug 2024
 06:42:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 403cc7bb-4fd1-11ef-bc02-fd08da9f4363
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=TVwYjaxZma7qwIK0Uu21uE460uop13NKeRbAOEtSFeeOf20Nov19Qvmh4Pxet02+xrWb78ldzGUjplChU7GCsDyng2dh9Q/qgijdSWxW3sX4UONKr5rU7XZ7mMCg/WTzV4SM51dhUdbrWfTREFpSaDeckz4rGDxLCdWeuXhDST44JC3KAEMpOuIogQ8MmT6Epp1chDVQdCIZX5FjGtTIXK/jtXJgXic+xs6hazogXt1w1Tm0YpSR5AQbekDIvKSx5S2XnQvCBassHJEh/Er4iXbTcQe+2F+NCiQEpJx4BCcckDB6ymFNvC3gWnj3ChS9e+YlZTAJaG8v6qklTr+WNA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=sQoN8Ud7rJqiPdNkMiI1l2tpuMfqJQQm+TnR3AAqSgE=;
 b=hMujSMkP/PifH/FY6WBM7/HmBDyP8BCIMNfrm+4I/lYJgor8h+xYU5J7t2/jjsIHJtMZfJkhJO7GQZW5tSQuXdGKOEo+dWYITOoaqk+Hqy5U2zzhtKLSQ1M6aOHJWZXezMH+q2NQBHvagplslvzIs2+hAxZzldagE11Khhd60BCLZ6Rp2av0fB/m/5tXx9312NrgWoSeZYkaWc6NEsZVuIVp9MqiEZ5bblhshyHasX8lLnhN7QyYSjjYWcwK35+cNzwKEvgHNHDri/kcF4Gz7ORT8NBvzJYUT6hd85mwCTtRA0Oy7La9QJ35wS4q7RjLPmle8UjGJxdBgu/OgdXvrg==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com;
 dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com;
 dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=sQoN8Ud7rJqiPdNkMiI1l2tpuMfqJQQm+TnR3AAqSgE=;
 b=YVFm9NqSjpFc5lRj4LGaj5myREL6TDhEhc0t1u2t5vr7qVdqlJv0Gj2aohVWlwjGi8NgdME7/1mCeBZLlL0SSmHKe9J8BgFrinBSoWTGIMn6J0jM7W+23AP0WYfX7Z7lXTZFkInMSe0y21uahHusj2AYpTed/f/lLiVN3auY/18=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: cff413debb1eee5a
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=PJm742jzN0393MwFPA//2yqBuhPRj+t3iqQlb00foGVGJ/sX20XSDtWIaNRA+S1h44LZHmyA0HYY1g5g38RMx9lWOfraqTng8y4lwKyHGGu4LTo3me1a4ov8nzdFsDmoAwG+mPIMG1h6VcgI6OOCNk2xmXRTWUgS119y7IHi2Fs8EsS0s4VmFWYQa8M3VSNbSgS0rlA5lypTQK/KZWpqrup11uM/aoMoaJ5HIPXN8ILCy414RHBm9HC3TLsOJo13htAEfN3Ou7IHxO2VYIhTKpetGa7auxnW8fW/7ryC/Z4KIgBTYlAF2lyLv6irZYX5GWT1PEQ7m9WrRDMZQauYkw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=sQoN8Ud7rJqiPdNkMiI1l2tpuMfqJQQm+TnR3AAqSgE=;
 b=Y09+GMLu6f1EUzUSKuNEn+JJK19W+u0FDNID2t+60DEV7aQXuVlnjipd8cnBwRgc9ggEdbSOekzo9S/UlR/K0ku9qqb8Yt65V1D9+UwXCqawSZGmcU4hF/oK/HD+OXq1CCzkSDIgLuK4BtYxb7BAXBc2qqSb7t9jcCNn+PbpN5F4z5IwndqrS45J8sF48p3puEfdm1+d5yFQd/1ORbtbuAd/oTmBWvr4brj8/n6mJCB1T16LNMkqRAnaT5xW6XpB8OmVm3omqy+tRz1LCn2SQ2c9wmxTERymtKJY7mKSZBRWmpcWbCsCtHHS7nxCzH5fmQC6kvq0uC+QrzvkyhE1Ew==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=sQoN8Ud7rJqiPdNkMiI1l2tpuMfqJQQm+TnR3AAqSgE=;
 b=YVFm9NqSjpFc5lRj4LGaj5myREL6TDhEhc0t1u2t5vr7qVdqlJv0Gj2aohVWlwjGi8NgdME7/1mCeBZLlL0SSmHKe9J8BgFrinBSoWTGIMn6J0jM7W+23AP0WYfX7Z7lXTZFkInMSe0y21uahHusj2AYpTed/f/lLiVN3auY/18=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Stefano Stabellini <sstabellini@kernel.org>
CC: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, =?iso-8859-1?Q?Roger_Pau_Monn=E9?=
	<roger.pau@citrix.com>, Julien Grall <julien@xen.org>, Xen-devel
	<xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] docs/misra: add R13.2 and R18.2 to rules.rst
Thread-Topic: [PATCH] docs/misra: add R13.2 and R18.2 to rules.rst
Thread-Index: AQHa4th7a04MjZhS7kqv2Ue56V1pDLIQXpSAgAEkjwCAAHMTAA==
Date: Thu, 1 Aug 2024 06:42:28 +0000
Message-ID: <83ABB601-629D-4D95-B124-E50896EB12B0@arm.com>
References:
 <alpine.DEB.2.22.394.2407301626460.4857@ubuntu-linux-20-04-desktop>
 <6575beb5-645a-470a-89a1-8485adeace60@suse.com>
 <alpine.DEB.2.22.394.2407311647170.4857@ubuntu-linux-20-04-desktop>
In-Reply-To:
 <alpine.DEB.2.22.394.2407311647170.4857@ubuntu-linux-20-04-desktop>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3774.600.62)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	AM8PR08MB6578:EE_|AS8PR08MB9838:EE_|DU2PEPF00028CFD:EE_|GV1PR08MB10837:EE_
X-MS-Office365-Filtering-Correlation-Id: 941860b2-631a-4975-8ba1-08dcb1f521c3
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|1800799024|376014|366016|38070700018;
X-Microsoft-Antispam-Message-Info-Original:
 =?iso-8859-1?Q?RnnQMn9xVkjHeN8U2+NMmuG7uVRnCR3rUt98OStzLoTFLcbejTFi10/UOk?=
 =?iso-8859-1?Q?BwVb/Pb2XChDNw5ynuYB6ll3SHkqsg/HD0tkuUCk5lYZuSJmcBbvM8BHax?=
 =?iso-8859-1?Q?sN5X30Ovq/I34HkLs6rKyR2SRgqa2V39DoOzR+aIFkPBFj1L1NEEnxvmXx?=
 =?iso-8859-1?Q?FbRshhc3QjGl3xEjEmYv3QgaJLHpIpED6mlupCpp93kvV3IFeGdnJ71Hgk?=
 =?iso-8859-1?Q?XPf7Q8F2IDLhQyKDAbNrZt7Wovp1Vl4Qvvron/x3sihdB3oEtF1BTKMdL3?=
 =?iso-8859-1?Q?gIw6ox+ccHYe7yKUEAM1ZV3T/lIBYb7w1OL0moiPhma/ofPVSmb7qMAlJL?=
 =?iso-8859-1?Q?Xo21Zsq50D87rjcOexp2r7f0vCUPhMH66dWDcu2+vEOh88UFEGYu15LuL6?=
 =?iso-8859-1?Q?6G8wB8vh95/4x8yKipmld48EIjLE2vvDcjQzy1CqsIRFqPpE3DVpTepSpn?=
 =?iso-8859-1?Q?da8HNCj6y3x9F+0uFNwSPayPeGfdJcArBDrX5mTCAF3NjUfnk7pzf5UDgl?=
 =?iso-8859-1?Q?5czIboMVXdQg624PirtgpupE8qIl1xrVKq+BuGVJTe7IXVKUfIKpRPsx7w?=
 =?iso-8859-1?Q?srd+mBHaPsvOT2/7AHABzU46cgvru8eEm3RL6RHsLTTsmc+EnEROwqj7Ky?=
 =?iso-8859-1?Q?19n2IyQfPy41oM6qNajQNbRl43EiAOGHTW3x3yjzHOI6DrYX2h31K2Vb98?=
 =?iso-8859-1?Q?KGFzowBAGu/8h4LE4of7P0mZuC6TRtJ6PazUyqr3ADxZczUzlzCvQUOOtX?=
 =?iso-8859-1?Q?4aqgF+HerEvqhQGGV/cGZ+rVOW3PuWgb/i/kqFjVgY8ZlGZxL5hGOHaw26?=
 =?iso-8859-1?Q?Rgx3mtWzFCV3bGbMszVxK+GPxHQh7Yj6uZGRJbmr3hh29vInX06fy2U652?=
 =?iso-8859-1?Q?DFA6p9o3hfCm3v77Wy72rlhCYqW3tOd2+N7Db4+pqiZjjPWqt7fkF/CTUG?=
 =?iso-8859-1?Q?uo+hjyPUqfScA1AXSsvSKLmotcaCG7/WnoNE7pwdGdjhBiZDO/GjyDqN4K?=
 =?iso-8859-1?Q?wqZyxzkHee8zBR5yivMIqz+q0LkhyIBWnIC26LPk7TJDpfyuxm45FXFGJb?=
 =?iso-8859-1?Q?4+5WX4Oiq2Ewh2k5s/bffRyjV8DptWjPdi/ZdfZsVUgBZycKjzdKHc88mK?=
 =?iso-8859-1?Q?FK3W+0S/NGcF6tH/hmFIXftTTYNokgTAUdy7zOxvRFw30orujvR8dQzgSY?=
 =?iso-8859-1?Q?j0IGCucycMyD1QKet0ZcXH+pav+7KYR5TjwCXlmLLjMCOzoOMF4O6rhRmO?=
 =?iso-8859-1?Q?kvAxxzimaOEvz+RG9FkRgW5NxPIuSuC8Ex8mdbIXA6Sl25PCldgASqsqgS?=
 =?iso-8859-1?Q?EVpdXn7YuNwPhBRVt1H8oXRZ7w/99H/EOo177gv1sDrKc2n6VTlJKQPzn7?=
 =?iso-8859-1?Q?QzA7v14sGlu3as9lgEpkWLY72qdRhngNVGEF23aftwFQOQa9Qq0TE=3D?=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM8PR08MB6578.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(38070700018);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="iso-8859-1"
Content-ID: <C4AECF08B4B715428647E5B85E7E51A4@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB9838
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-SkipListedInternetSender:
 ip=[2603:10a6:20b:36a::15];domain=AM8PR08MB6578.eurprd08.prod.outlook.com
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DU2PEPF00028CFD.eurprd03.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	3c8d2339-ec19-4cf8-7412-08dcb1f51ced
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700013|1800799024|35042699022|376014;
X-Microsoft-Antispam-Message-Info:
	=?iso-8859-1?Q?2CjTufVNqXnnsp2m9pnZpW4du39U2V5IIOTr0to7+0zcn+TwRLGvKdW8EU?=
 =?iso-8859-1?Q?C1tIeN4XU+mUOv7CtTvQ1dbAop+lwjgE2DypFCAPBJwqlVdZnM2+Debtt1?=
 =?iso-8859-1?Q?6MbICKYOkIiTRUbJW7Ul2PDS9TJu18pq+a55JW1K/wyy8sdBP5naqOk4Jy?=
 =?iso-8859-1?Q?/EHqFWEgrhji+ljy5H5GbTNuQf4FFTbcvsagVQZvu9g0k//Ka6sxTJ0G10?=
 =?iso-8859-1?Q?FGGnY0eHtPozHFnbvPxdtJMIoV9u2sHIAHbk6GYVz9gD77FpypG5bJVzcX?=
 =?iso-8859-1?Q?0rFO/NZPxBNTR6mg2Es5RHek5B/vy69qH8kQRZ2lv+mWuwVWRQDO8DW9GY?=
 =?iso-8859-1?Q?tWao1aIADl6mjRDTIariTDer/mRb/ngu9as5D/W8VQ+f/sJF5dw83zsRVN?=
 =?iso-8859-1?Q?Zp6BTpdSut9xWkTYMEKMNjk+KPv95yeSZ03KAHlVRRiRFyYs2J+giNLGy5?=
 =?iso-8859-1?Q?pSkwNpBPT6fahBFvLen+RcyOJdJF1A66gJoVLPHRQS2SR+52gt9keWLr3q?=
 =?iso-8859-1?Q?TMHgFuFUYhIOWMg2W9hbwXwtB7yczSk956gUGCVzM/hULOgHUU2dgBwltW?=
 =?iso-8859-1?Q?6fQfs/mviIhOwr0mKa8P65aKaishfNHIupwS3iRLDLhRoIBHwy3awSADGQ?=
 =?iso-8859-1?Q?wSQyMoxqvnPRxeYJ1HNozt6/z7xBd5DhkP78gy7aL2dtJArWcqt0zroodN?=
 =?iso-8859-1?Q?H/c9RncBz8KBq3CQz/7VSo+m34KmRUq+9I8+6dGPYlRVDDbaerda0t39kH?=
 =?iso-8859-1?Q?iY3f+3apZZtvIzoHCL7y/eMZnWZMaAKqYQHfDQKos7Afj/XZXgcTclGG0l?=
 =?iso-8859-1?Q?qUlfX7YUIHX/x/IIbbxuWCOh/kE17+vHe51d0QHT948RnCAqKVR+i12OH+?=
 =?iso-8859-1?Q?HFUuyZzkKCWYkPrgarF9g21GrXeTdmL26iLNpuU4WVzLnw32TctUV6IMoL?=
 =?iso-8859-1?Q?1DjdXalwOvXsy+r7ckYGpKjLK6+sH/sttd9b9RFmyo22BYvILueaGBrQhi?=
 =?iso-8859-1?Q?U4gSA72IJQ+TNPYiMUzqjfo5Ty1kntAdA6+zMqlcTownv9pDj9E98vgyQI?=
 =?iso-8859-1?Q?DhjSjCzBKLpHdyLvKBuFSKD2BxzzrKj3TthGiDbc+cBsvPiGlA9n8ahExH?=
 =?iso-8859-1?Q?x12fpAHzDseVmKTusN2eK3JXE4+QUZy8T7GhfvGthVXLjd4OgXO3ylx1zI?=
 =?iso-8859-1?Q?4dQKZ0+VrT/PKV1ta2EnwFCVsNuCDGt4zYaJO3cxYXrwJxJS8CcM3fCVEQ?=
 =?iso-8859-1?Q?nii1y7pqnaOl8mkBAwSVVWLd14Igvd63FT6ufKDGhSQ3LTIS82OIJM8pfb?=
 =?iso-8859-1?Q?LCu0CppJ5KAaoif2PpaoLfSl3Pz2Y5jO7F79+09Bekwh6ylk9IIudB1qXl?=
 =?iso-8859-1?Q?3PokoanBR4eG3LTFAtqd6cLnxxYJeWQztzDA0s785WW29n12ASc9T99LMF?=
 =?iso-8859-1?Q?oeiyd8pGnSgzaeivzyDyKk+IWrrulA9T4nUGtA=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(1800799024)(35042699022)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 06:42:37.1178
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 941860b2-631a-4975-8ba1-08dcb1f521c3
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DU2PEPF00028CFD.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB10837

Hi Stefano,

> On 1 Aug 2024, at 01:50, Stefano Stabellini <sstabellini@kernel.org> wrot=
e:
>=20
> On Wed, 31 Jul 2024, Jan Beulich wrote:
>> On 31.07.2024 01:30, Stefano Stabellini wrote:
>>> --- a/docs/misra/rules.rst
>>> +++ b/docs/misra/rules.rst
>>> @@ -462,6 +462,15 @@ maintainers if you want to suggest a change.
>>>      - Initializer lists shall not contain persistent side effects
>>>      -
>>>=20
>>> +   * - `Rule 13.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Examp=
le-Suite/-/blob/master/R_13_02.c>`_
>>> +     - Required
>>> +     - The value of an expression and its persistent side-effects shal=
l
>>> +       be the same under all permitted evaluation orders
>>> +     - Be aware that the static analysis tool Eclair might report
>>> +       several findings for Rule 13.2 of type "caution". These are
>>> +       instances where Eclair is unable to verify that the code is val=
id
>>> +       in regard to Rule 13.2. Caution reports are not violations.
>>=20
>> Which doesn't make clear what our take is towards new code people may
>> submit.
>=20
> Good point, see my comment below
>=20
>=20
>>> @@ -583,6 +592,15 @@ maintainers if you want to suggest a change.
>>>        submitting new patches please try to decrease the number of
>>>        violations when possible.
>>>=20
>>> +   * - `Rule 18.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Examp=
le-Suite/-/blob/master/R_18_02.c>`_
>>> +     - Required
>>> +     - Subtraction between pointers shall only be applied to pointers
>>> +       that address elements of the same array
>>> +     - Be aware that the static analysis tool Eclair might report
>>> +       several findings for Rule 18.2 of type "caution". These are
>>> +       instances where Eclair is unable to verify that the code is val=
id
>>> +       in regard to Rule 18.2. Caution reports are not violations.
>>=20
>> And while the same wording is used here, I think it is pretty clear for
>> this that we'd reject changes where bad subtractions are used. IOW even
>> more so important to clarify the (possibly different) positions on what
>> is going to be added into the code base.
>=20
> In both of these cases, we would reject code that doesn't follow R13.2
> and R18.2. I'll change it to the following:
>=20
>=20
> Be aware that the static analysis tool Eclair might report several
> findings for Rule 18.2 of type "caution". These are instances where
> Eclair is unable to verify that the code is valid in regard to Rule
> 18.2. Caution reports are not violations. Regardless, new code is
> expected to follow this rule.

I think that in both cases it is wrong to state that "cautions reported are
not violations" where those are cases where the tool is not sure so they
might be or not violations.
So I would change the sentence to "cautions might not be violations. The
rule should be followed in any case in new code submitted".

Cheers
Bertrand




From xen-devel-bounces@lists.xenproject.org Thu Aug 01 06:49:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 06:49:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769350.1180216 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZPd9-0006Pr-He; Thu, 01 Aug 2024 06:49:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769350.1180216; Thu, 01 Aug 2024 06:49:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZPd9-0006Pk-EM; Thu, 01 Aug 2024 06:49:43 +0000
Received: by outflank-mailman (input) for mailman id 769350;
 Thu, 01 Aug 2024 06:49:42 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZPd8-0006Pb-4i
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 06:49:42 +0000
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com
 [2a00:1450:4864:20::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 396be7cb-4fd2-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 08:49:40 +0200 (CEST)
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a6265d3ba8fso621656266b.0
 for <xen-devel@lists.xenproject.org>; Wed, 31 Jul 2024 23:49: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-a7acab4f7aesm854926366b.53.2024.07.31.23.49.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 31 Jul 2024 23:49:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 396be7cb-4fd2-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722494979; x=1723099779; 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=YjTq209aYTlC9q8ZTS+JkrpnIxI9RuX/H0fIKvIvHUE=;
        b=LirezZndcnJWPGqJLoYuyEji6a9MIQcGIMbvJ1TVCG9JvbN4JHN/5sjNLMgRcuEfZk
         H+99e6LQzBn3KVByuCCq5PiKsDfdi0YNkO/GvhTcph0jkEIfH4vozm0fjosGJm25N5YV
         kvGKDsGwEFk1na0tMNwq2TmORJhuHzMa3OP9O4n0jf1JCTOiqsDp4NbQeaaS6ah3Jh4D
         tiCLzx0I7wD4RSLcBoE93ZzBMZG4tCCx/MOCLwuvGUrj/yohXv2iHhi6V2ONs+5T5Fl9
         uwfAiT8VMbBKC1NarKXV3EfDMdSMQQmfZ63mGl9bafLNUcPE5hit60kspCXHIdH0ffsK
         +fTg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722494979; x=1723099779;
        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=YjTq209aYTlC9q8ZTS+JkrpnIxI9RuX/H0fIKvIvHUE=;
        b=me+Z9N160aj4fICBHmj7YpbtVAZMwFczot/bJgQsZtaPR44rebqABHHdHNBxdZzZ02
         BL/63Sz3fg80TO91hm2qEFgFnFTw+ogErHRc4xfq+OlFb+3RGXz886tIazJuufgik1bR
         pbGJW7uufDC1mOKRvgoxfgwtFmBc5Nnq3oGqmr0C891AH1JqR9fpfKlBRGcMOK+oEaxs
         XSV+bzHKzqFVXBUSFJN7JGxR1GA93W615VqlcNe0qeixVDnRYA5Ra4esq5PIvnGt513Y
         oBkftGJBpz5EreM7OblDwDyW//9IvMxwk/inTvI5ytpv0oDWED60xXNZToqbijIJhxDp
         U5Hg==
X-Gm-Message-State: AOJu0Yz/YprQX5xE64ziUqGWw/dRFYolXsCsyq78W/TLsI8bENiy07Uz
	IZcOBx79e85OSy9YGGssC/pxdenAKwfs2p7GCuyjz8DrtZaLRLDcuBSrj4nlDA==
X-Google-Smtp-Source: AGHT+IE6BtnZgylyUonDzOmg6Wfz+1mTtuYNEHaxll+YVyUlSYaaYMpZwzTJqhScf+hhez4LgBO+gA==
X-Received: by 2002:a17:907:7249:b0:a72:41e7:fef4 with SMTP id a640c23a62f3a-a7daf65954bmr90631266b.68.1722494979167;
        Wed, 31 Jul 2024 23:49:39 -0700 (PDT)
Message-ID: <1a35b90d-969c-4ef2-8dd1-4dc36f56fa30@suse.com>
Date: Thu, 1 Aug 2024 08:49:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v12 1/7] xen/pci: Add hypercall to support reset of
 pcidev
To: Jiqian Chen <Jiqian.Chen@amd.com>
Cc: xen-devel@lists.xenproject.org, Andrew Cooper
 <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>, Juergen Gross <jgross@suse.com>,
 "Daniel P . Smith" <dpsmith@apertussolutions.com>,
 Stewart Hildebrand <Stewart.Hildebrand@amd.com>,
 Huang Rui <ray.huang@amd.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-2-Jiqian.Chen@amd.com> <ZqpeiWhuqPXiTeRZ@macbook>
 <23730906-f6c7-4a9a-bb2f-2969625c741e@suse.com> <ZqpiulPi3FbdpDoF@macbook>
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: <ZqpiulPi3FbdpDoF@macbook>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 31.07.2024 18:13, Roger Pau Monné wrote:
> On Wed, Jul 31, 2024 at 05:58:54PM +0200, Jan Beulich wrote:
>> On 31.07.2024 17:55, Roger Pau Monné wrote:
>>> On Mon, Jul 08, 2024 at 07:41:18PM +0800, Jiqian Chen wrote:
>>>> --- a/xen/drivers/vpci/vpci.c
>>>> +++ b/xen/drivers/vpci/vpci.c
>>>> @@ -172,6 +172,16 @@ int vpci_assign_device(struct pci_dev *pdev)
>>>>  
>>>>      return rc;
>>>>  }
>>>> +
>>>> +int vpci_reset_device_state(struct pci_dev *pdev,
>>>> +                            uint32_t reset_type)
>>>
>>> There's probably no use in passing reset_type to
>>> vpci_reset_device_state() if it's ignored?
>>
>> I consider this forward-looking. It seems rather unlikely that in the
>> longer run the reset type doesn't matter.
> 
> I'm fine with having it in the hypercall interface, but passing it to
> vpci_reset_device_state() can be done once there's a purpose for it,
> and it won't change any public facing interface.

Jiqian, just to clarify: I'm okay either way.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 06:51:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 06:51:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769357.1180226 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZPex-0007pG-S4; Thu, 01 Aug 2024 06:51:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769357.1180226; Thu, 01 Aug 2024 06:51:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZPex-0007p9-Ot; Thu, 01 Aug 2024 06:51:35 +0000
Received: by outflank-mailman (input) for mailman id 769357;
 Thu, 01 Aug 2024 06:51:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZPew-0007p3-Gy
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 06:51:34 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7d2e5c13-4fd2-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 08:51:33 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-58f9874aeb4so8571876a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 31 Jul 2024 23:51:33 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5afb9422c41sm8040494a12.82.2024.07.31.23.51.32
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 31 Jul 2024 23:51:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7d2e5c13-4fd2-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722495093; x=1723099893; 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=Iw0FdXvWopMmtv3WWqa1QquEiClC7ojuYfpH3nCtSu8=;
        b=XFn0OSPf+mP1rwQ7ZJzrJUjfNkPiY7M63ETwLNv4k5CdZn9lrJt50YPKhnze8klB+/
         As3+cylIUiM8F9gMFS1gvHb59P9YtZA0Povwp/N4E1XOkvPrvpy6fOtyQ2inCLWczaq8
         J44/3LYhyZSSGecshw1Gh5c7VYpu6eqloUQzyo9IxAB3q0oA6nzlmz6R2kxc/6FeNd+l
         ZB4OD4lTtbpa0uPRM7A27WLLPuz5x602lDrbJiFLkzpSuFspRK2atGrXwvVoslvmz5iB
         FAHJAjGSXRrxgticcPrk09Egs0ixZSTAmMJtg5a8+kDjKKweYOd2tg2Om70p3gtT7x7Z
         zkVQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722495093; x=1723099893;
        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=Iw0FdXvWopMmtv3WWqa1QquEiClC7ojuYfpH3nCtSu8=;
        b=OoC6Obuln6lghVKtjML+c2XhOfXGgOsM6kG0BjnDXholYz7G3BjU9KtvE+5eU9DBMo
         j4c9Ye40+r2U/EOLmPCBccOesAX0fR2jF1IfUqqUxD8fdRIR1fPVtjzts9qI98gGiaKR
         sJnGgBCBFfuGsFoFbVygMtFMhi06MuxkP3eOCtAzPFeeQIcn6viA8bSrH73TMlxPOhGs
         HxXATOmdVz+NG3NcR4X1oIzZhtLzcQcZnetM8IZ754Uvl+wk4faYgHXOZJcObbFR/5i+
         WlIyVyh8Y2p5RgraGss2rvySOfsSFEH5j0FJYbhBZdU5BlqTZcXPIS8Wx078AHFxLQHh
         HyQA==
X-Forwarded-Encrypted: i=1; AJvYcCXAOCuw8qPH/zLNWwHOUzby6GKgVDUyI6qt9BS5K3P3yQLF+gQPEBicaqxxmxhdN6MSmErrEjJxei10e9sMVoYCsgJIWHihnuwZJjpqln4=
X-Gm-Message-State: AOJu0Yxvc9QLRk8w+e7Up4cE8g0iFKvQVIElNOr00aQZOxPdWtbGoELh
	nj7jpjtzGDmfiney4MbDV+oP63yZuOy0INHDiwao07dkcui5U7FEGlKnE/NLdg==
X-Google-Smtp-Source: AGHT+IGStOgKG5VZt2/0+mARofYj18crXrMEszghFl4JFvrrWAMuJQliT4EM0e1occCPUBb6Ay9PgQ==
X-Received: by 2002:aa7:d602:0:b0:5a1:b9c0:7758 with SMTP id 4fb4d7f45d1cf-5b7008ad19cmr806980a12.33.1722495092719;
        Wed, 31 Jul 2024 23:51:32 -0700 (PDT)
Message-ID: <dd463c03-71ca-4333-ac3f-629241b0f9bc@suse.com>
Date: Thu, 1 Aug 2024 08:51:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] docs/misra: add R13.2 and R18.2 to rules.rst
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>, Julien Grall <julien@xen.org>,
 xen-devel@lists.xenproject.org
References: <alpine.DEB.2.22.394.2407301626460.4857@ubuntu-linux-20-04-desktop>
 <6575beb5-645a-470a-89a1-8485adeace60@suse.com>
 <alpine.DEB.2.22.394.2407311647170.4857@ubuntu-linux-20-04-desktop>
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: <alpine.DEB.2.22.394.2407311647170.4857@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 01.08.2024 01:50, Stefano Stabellini wrote:
> On Wed, 31 Jul 2024, Jan Beulich wrote:
>> On 31.07.2024 01:30, Stefano Stabellini wrote:
>>> --- a/docs/misra/rules.rst
>>> +++ b/docs/misra/rules.rst
>>> @@ -462,6 +462,15 @@ maintainers if you want to suggest a change.
>>>       - Initializer lists shall not contain persistent side effects
>>>       -
>>>  
>>> +   * - `Rule 13.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_13_02.c>`_
>>> +     - Required
>>> +     - The value of an expression and its persistent side-effects shall
>>> +       be the same under all permitted evaluation orders
>>> +     - Be aware that the static analysis tool Eclair might report
>>> +       several findings for Rule 13.2 of type "caution". These are
>>> +       instances where Eclair is unable to verify that the code is valid
>>> +       in regard to Rule 13.2. Caution reports are not violations.
>>
>> Which doesn't make clear what our take is towards new code people may
>> submit.
> 
> Good point, see my comment below
> 
> 
>>> @@ -583,6 +592,15 @@ maintainers if you want to suggest a change.
>>>         submitting new patches please try to decrease the number of
>>>         violations when possible.
>>>  
>>> +   * - `Rule 18.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_18_02.c>`_
>>> +     - Required
>>> +     - Subtraction between pointers shall only be applied to pointers
>>> +       that address elements of the same array
>>> +     - Be aware that the static analysis tool Eclair might report
>>> +       several findings for Rule 18.2 of type "caution". These are
>>> +       instances where Eclair is unable to verify that the code is valid
>>> +       in regard to Rule 18.2. Caution reports are not violations.
>>
>> And while the same wording is used here, I think it is pretty clear for
>> this that we'd reject changes where bad subtractions are used. IOW even
>> more so important to clarify the (possibly different) positions on what
>> is going to be added into the code base.
> 
> In both of these cases, we would reject code that doesn't follow R13.2
> and R18.2.

But we shouldn't (unconditionally) do so for for 13.2, should we?

> I'll change it to the following:
> 
> 
> Be aware that the static analysis tool Eclair might report several
> findings for Rule 18.2 of type "caution". These are instances where
> Eclair is unable to verify that the code is valid in regard to Rule
> 18.2. Caution reports are not violations. Regardless, new code is
> expected to follow this rule.

I'm fine with this for 18.2, but not so much for 13.2.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 06:59:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 06:59:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769366.1180236 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZPmb-0000db-KX; Thu, 01 Aug 2024 06:59:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769366.1180236; Thu, 01 Aug 2024 06:59:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZPmb-0000dU-Gm; Thu, 01 Aug 2024 06:59:29 +0000
Received: by outflank-mailman (input) for mailman id 769366;
 Thu, 01 Aug 2024 06:59:28 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZPma-0000dK-F6; Thu, 01 Aug 2024 06:59:28 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZPma-0007C2-Ag; Thu, 01 Aug 2024 06:59:28 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZPmZ-0006Vq-RW; Thu, 01 Aug 2024 06:59:27 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZPmZ-0001D4-R7; Thu, 01 Aug 2024 06:59:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=9BTR1gwWUP7M2+e5gzvymifDhbuyNPjKgbhPP6NAH94=; b=DENwjRSM2A/7aaAdj78M3eHmFc
	X890SxNcjJRchbqsXMpMGFYrGkHwn7sK5rUa4XhSzImA2ew+btMebuNflr4pAwMgnkmoi3WmKHIqA
	5tC7bJFbtpmTdHWrX1BwtJgIvjbekUoosHmytNjN/2MWaKijz2BzfyDVeJTmg/zeVAoI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187100-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187100: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=7e5a5ae154cb4c1e5c3d148a2ba21cc2764e96e6
X-Osstest-Versions-That:
    ovmf=eed43245dfdd6d616f7a7d72ba4ca52de3d59584
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 06:59:27 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 7e5a5ae154cb4c1e5c3d148a2ba21cc2764e96e6
baseline version:
 ovmf                 eed43245dfdd6d616f7a7d72ba4ca52de3d59584

Last test of basis   187093  2024-07-31 23:11:29 Z    0 days
Testing same since   187100  2024-08-01 05:13:19 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Michael Kubacki <michael.kubacki@microsoft.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   eed43245df..7e5a5ae154  7e5a5ae154cb4c1e5c3d148a2ba21cc2764e96e6 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 07:12:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 07:12:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769377.1180246 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZPzN-0003kd-Og; Thu, 01 Aug 2024 07:12:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769377.1180246; Thu, 01 Aug 2024 07:12:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZPzN-0003kW-Kz; Thu, 01 Aug 2024 07:12:41 +0000
Received: by outflank-mailman (input) for mailman id 769377;
 Thu, 01 Aug 2024 07:12:40 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZPzM-0003kQ-Si
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 07:12:40 +0000
Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com
 [2a00:1450:4864:20::52c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6f63440a-4fd5-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 09:12:38 +0200 (CEST)
Received: by mail-ed1-x52c.google.com with SMTP id
 4fb4d7f45d1cf-5b391c8abd7so5279253a12.2
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 00:12:38 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b64c074f9fsm1415119a12.97.2024.08.01.00.12.37
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 00:12:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6f63440a-4fd5-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722496358; x=1723101158; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=JCvBVunI7k6bNFY/+1qRSnA/qiHEmcNRmmy34+GfdY0=;
        b=CbRr21RRyHPqJU8b+CEiurQzt/Bn4Ya6ywcJI6O5aFdBoMuIW95sX9YO1GVYsk1J4F
         hxPgPheznnHNjJ8JvJYzJzA1eoaUkf9ZrD0TkQ3rQ0dfMnkqlVQFuoyoXXniIRusxWKF
         aKzoVtuGaeQKst66r5chQSu1jLXwLAjdFziUuREvrJ8DI8XWzDpa+IAPka7Z2qRoevqC
         +zTwh+OtOD9DJXdYLv/QYARBTAfy+1P/SY3WkjlI9JMqxJepztbUmE+UlnltsWBizaeH
         TmEpS2feJE1wd9NewvKlDMHR+OuLhyfHGWGUfVGI0mof1W8I0RDRdVY//VbM0pK2MgZ0
         xyeQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722496358; x=1723101158;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :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=JCvBVunI7k6bNFY/+1qRSnA/qiHEmcNRmmy34+GfdY0=;
        b=frS2+OZKL2wKSTLGh5kmvfouW16LTLeXNUzOmPXoNosLmUrTUaXSd54oeUH/6yQtxI
         PQHReCIQ8VAqWA4lNcuvxfJH8UBvJWQvPy0m3EMCISJURXT3JPmUtGW5adcdAL7FonL7
         Ai6PHZYaUy9AjGw4NOKNax+/9AN+tI38FC825i+ulwtAgteFW/rESkcMBsoJquesugPU
         l08IFkuoN8bwjLdpm/D/Yq50XnlqOx0h3OfPFku3RgTGdgLWR9CRpaOKQ9n93Ng3zfe7
         a/vB46oYCMq7+AMUwmVDoZf63YvVtnysp5nU/bVOoHN/WVLIbBClU8JIl77scgXHEc59
         LXFQ==
X-Forwarded-Encrypted: i=1; AJvYcCXMqhBsgXkk4g13FZoyHM5I0Lp3FhASJ+Up6MTUSe7ZEgmgjTnLqRvxno7Aw9R4pe7bURqkZE7rizRD2pUR5eZyuYYDtpAuLTSQkjDkXbA=
X-Gm-Message-State: AOJu0YxzkujGGI7xwSkRSqBWMH83NtXY3A8eCQ3SlSrrV/maBkzUus+J
	Gl5z9vuTn6dVYCT45UFNHraStqITSVK8gQuyPyPMUEJsMlatqIrPjolm9ZFGjQ==
X-Google-Smtp-Source: AGHT+IFyPYTM556tBxEUe9ieQR8UiaO/hHkAeTOpdZjR8RslOjzrgVggrPijjYvHnFKJV/BeKuE+FQ==
X-Received: by 2002:a05:6402:742:b0:57c:d237:4fd with SMTP id 4fb4d7f45d1cf-5b6fe530a8amr904664a12.4.1722496358031;
        Thu, 01 Aug 2024 00:12:38 -0700 (PDT)
Message-ID: <9c0a102a-9031-4536-8a36-ab62812bc2c4@suse.com>
Date: Thu, 1 Aug 2024 09:12:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/2] x86/dom0: only disable SMAP for the PV dom0 build
To: Andrew Cooper <andrew.cooper3@citrix.com>
References: <20240730152855.48745-1-roger.pau@citrix.com>
 <20240730152855.48745-3-roger.pau@citrix.com>
 <e560b170-b00f-415c-9e45-3c287ffd3b3b@citrix.com>
Content-Language: en-US
Cc: Roger Pau Monne <roger.pau@citrix.com>, xen-devel@lists.xenproject.org
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+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: <e560b170-b00f-415c-9e45-3c287ffd3b3b@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 31.07.2024 18:47, Andrew Cooper wrote:
> On 30/07/2024 4:28 pm, Roger Pau Monne wrote:
>> The PVH dom0 builder doesn't switch page tables and has no need to run with
>> SMAP disabled.
>>
>> Use stac() and clac(), as that's safe to use even if events would hit in the
>> middle of the region with SMAP disabled.  Nesting stac() and clac() calls is
>> not safe, so the stac() call is done strictly after elf_load_binary() because
>> that uses raw_{copy_to,clear}_guest() accessors which toggle SMAP.
>>
>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> Summarising a discussion on Matrix.
> 
> There are 3 options.
> 
> 1) Simply reposition the write_cr4()/cr4_pv32_mask adjustments.
> 2) This form (use stac/clac instead of playing with cr4).
> 3) Delay the original set_in_cr4(SMAP).
> 
> As proved by the confusion thus far, cr4_pv32_mask adjustments are
> fragile and can go unnoticed in the general case (need a lucky watchdog
> NMI hit to trigger).  Hence I'd prefer to remove the adjustments.
> 
> Using stac()/clac() is much easier.  It is fragile because of nesting
> (no AC save/restore infrastructure), but any mistake here will be picked
> up reliably in Gitlab CI because both adl-* and zen3p-* support SMAP.
> 
> Personally I think option 2 is better than 1, hence why I suggested it. 
> It's got a fragile corner case but will be spotted reliably.

... when code paths in question are always taken. Any such operation on
a rarely taken code path quite likely won't be spotted by mere testing.

Jan

> However, it occurs to me that option 3 exists as well... just delay
> setting SMAP until after dom0 is made.  We have form now with only
> activating CET-SS on the way out of __start_xen().
> 
> Furthermore, option 3 would allow us to move the cr4_pv32_mask
> adjustment into set_in_cr4() and never need to opencode it.
> 
> (Although this is a bit tricky given the current code layout. 
> cr4_pv32_mask also wants to be __ro_after_init and non-existent in a
> !PV32 build.)
> 
> ~Andrew



From xen-devel-bounces@lists.xenproject.org Thu Aug 01 07:19:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 07:19:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769385.1180256 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZQ5X-0004v0-D0; Thu, 01 Aug 2024 07:19:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769385.1180256; Thu, 01 Aug 2024 07:19:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZQ5X-0004ut-9C; Thu, 01 Aug 2024 07:19:03 +0000
Received: by outflank-mailman (input) for mailman id 769385;
 Thu, 01 Aug 2024 07:19:02 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZQ5W-0004un-Hy
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 07:19:02 +0000
Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com
 [2a00:1450:4864:20::635])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 52f22bb3-4fd6-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 09:19:00 +0200 (CEST)
Received: by mail-ej1-x635.google.com with SMTP id
 a640c23a62f3a-a7d89bb07e7so359865266b.3
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 00:19:00 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7acadb8072sm853418866b.196.2024.08.01.00.18.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 00:18:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 52f22bb3-4fd6-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722496740; x=1723101540; 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=cXWYNbgdry2va3J1g0/Mel9z+qK9Zc6esLgfAqzyg34=;
        b=KGO81fV+N/1ymHU1X3w8CzNPO0JcWXTPBueJ1vFOFXw6D/7cHKEcALy52spwt/dXdP
         8OGTTs3bwh2mTN0yuppVMEl58gXIunI1DV9+DTFOOSdF39+fuK9mpIeoHL//s39s1XaK
         u1DIeNQkXQcTjn6zRuIHDUcx5pFg7HN3aRD/6+/yIyMP8Y4l7WcJdQTk2IleuhXr97yf
         fAU/C+CGMN7B2qYQstlNcHbjJyiX6n9noPeH3zzXyKx17+riuwrMOgEDHEU0FW13LQRG
         zYxCVtPVIib6NeB/1cG0KgCZDbSpMPl+Lkok7czD0J47Q/+kDDPynE+f6haKYdsH0JrG
         ePnA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722496740; x=1723101540;
        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=cXWYNbgdry2va3J1g0/Mel9z+qK9Zc6esLgfAqzyg34=;
        b=LEcBNvZKzmoWyA5SPDU1ThlhcsaA9c2TZdyP6ibXJh5kXWCbFudhexkIIDqpDjyF3i
         9G4bAl9tmhA4T8I44xUueFjPn9Z/AsVrbUIZ3zLFokFwkXatYkmdjeY9qb6wqxzZq2TY
         bASw35NvvfgMaROSggFLfXW4CAGBxy3FNyLkPpZpaInrQZ/Ii+SWK0xupJrJ3PLKUqVI
         RRVzqbvelO7c8knbk7dtwQQwI/1txV4tV6BL71b0ZnEE0JHXHc2gnZab7fi0IFAf0Dqp
         6XxwmdQW9MFr5UPdxzFU5lprucBIpLtPL/VdkWvpHIrk7Nd8PQNSDmerJn/81K96OBmM
         QKDg==
X-Gm-Message-State: AOJu0YwtWn2zomTCIakwWlc91L9yU1PEC5FPOyQZbKXaO/QvTXh1FCB+
	jgcbvR/+afQRdwnTjWkeBN7FBDS1aAFTbqndaQi8Y5GouA+A792g8x/OD0aQQj7m+49vU9agWvs
	=
X-Google-Smtp-Source: AGHT+IEeH4qvuSfymUkt7FgY/yK/7+Y8yXczxVdaV3xcRBY1/QmYdlHold1mh5O82SQkgrkDBqMlJQ==
X-Received: by 2002:a17:907:9688:b0:a7a:b9dd:775a with SMTP id a640c23a62f3a-a7daf79561cmr98251966b.67.1722496739900;
        Thu, 01 Aug 2024 00:18:59 -0700 (PDT)
Message-ID: <fb9589e3-a4d4-4278-b8e2-65ae7c3c02b9@suse.com>
Date: Thu, 1 Aug 2024 09:18:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/2] docs: fusa : reqs: Added a sample of requirements
 [DO_NOT_MERGE]
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, artem_mygaiev@epam.com,
 julien@xen.org
References: <20240731163614.616162-1-ayan.kumar.halder@amd.com>
 <20240731163614.616162-3-ayan.kumar.halder@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240731163614.616162-3-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 31.07.2024 18:36, Ayan Kumar Halder wrote:
> Added a sample of market, product and design requirements. This is to
> help explain how we are writing the requirements and understand the
> context of the first patch.
> We will be sending these requirements for review in the subsequent
> patches.
> 
> Please do not merge this patch.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
>  .../reqs/design_reqs/arm64/emulated_uart.rst  | 240 ++++++++++++++++++
>  .../reqs/design_reqs/arm64/generic_timer.rst  | 146 +++++++++++
>  docs/fusa/reqs/design_reqs/xen_version.rst    | 207 +++++++++++++++
>  docs/fusa/reqs/market_reqs/reqs.rst           |  77 ++++++
>  docs/fusa/reqs/product_reqs/reqs.rst          |  64 +++++
>  5 files changed, 734 insertions(+)
>  create mode 100644 docs/fusa/reqs/design_reqs/arm64/emulated_uart.rst
>  create mode 100644 docs/fusa/reqs/design_reqs/arm64/generic_timer.rst
>  create mode 100644 docs/fusa/reqs/design_reqs/xen_version.rst

Just one formal comment here: New files want to prefer - over _ in
their names, unless specific reasons exist why - cannot be used.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 07:39:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 07:39:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769396.1180267 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZQPJ-0000FP-3p; Thu, 01 Aug 2024 07:39:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769396.1180267; Thu, 01 Aug 2024 07:39:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZQPI-0000FI-VN; Thu, 01 Aug 2024 07:39:28 +0000
Received: by outflank-mailman (input) for mailman id 769396;
 Thu, 01 Aug 2024 07:39:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=5eeJ=PA=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sZQPH-0000F7-99
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 07:39:27 +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 2c3f7a7c-4fd9-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 09:39:26 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id DE61BA0374;
 Thu,  1 Aug 2024 09:39:23 +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 y4vuD59QVvSF; Thu,  1 Aug 2024 09:39:23 +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 B59B5A0371;
 Thu,  1 Aug 2024 09:39:23 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sZQPD-00000000XVx-1JbL; Thu, 01 Aug 2024 09:39:23 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2c3f7a7c-4fd9-11ef-bc02-fd08da9f4363
Date: Thu, 1 Aug 2024 09:39:23 +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 2/3] mini-os: mm: switch need_pgt() to use walk_pt()
Message-ID: <20240801073923.32s6i4enoq6qafa5@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: <20240731130026.8467-1-jgross@suse.com>
 <20240731130026.8467-3-jgross@suse.com>
 <20240731212752.zd5njpd7kgoc433d@begin>
 <8fef9511-c5d0-49a9-a800-6087f03b3199@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <8fef9511-c5d0-49a9-a800-6087f03b3199@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Jürgen Groß, le jeu. 01 août 2024 07:56:36 +0200, a ecrit:
> On 31.07.24 23:27, Samuel Thibault wrote:
> > 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)?
> 
> No.

I don't understand: it doesn't map what I know of need_pgt and what the
existing code is doing.

AIKI, the point of need_pgt is to make sure there is a L1 page table
entry for a VA, and return it, so the caller can put in it at pte for a
mfn or such. In the case a PSE is met, we don't go further, and it's up
to the caller to decide what it wants to do (most often it's actually
unexpected and asserted out). In both cases, the PRESENT bit of the
pte whose address is returned does not matter, most often it's the
caller which will set it.

The existing code for need_pgt thus always adds page table entries down
to level1 (except if _PAGE_PSE is met, i.e. a large page was already set
up): the termination was:

[... walk down to level 2]
-    if ( tab[offset] & _PAGE_PSE )
-        return &tab[offset];
[... walk down to level 1]
-    return &tab[offset];

i.e. we always return either a PSE L2 entry, or an L1 entry, and never
above (while keeping sure that the entries above are present).

> I want to bail out if the PTE does not require a page table to be
> added to it. This is the case if the PTE is valid

There being an entry at e.g. level 3 (without PSE) does not mean that
we have an entry at level 1 for the VA, so we have to continue adding
levels for the VA in the sparse page table tree.

> An invalid PTE with PSE set is still invalid, so the PSE bit has no
> real meaning.

Mmm, I don't think we ever create entries with PSE but not PRESENT (i.e.
we don't "plan" to have PSE entries), but even if we did, if we "plan"
to have PSE entries, we should return that entry, and it's up to the
caller to fill it (and make it PRESENT)

Samuel


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 08:08:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 08:08:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769428.1180316 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZQrA-00060m-Q0; Thu, 01 Aug 2024 08:08:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769428.1180316; Thu, 01 Aug 2024 08:08:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZQrA-00060f-MY; Thu, 01 Aug 2024 08:08:16 +0000
Received: by outflank-mailman (input) for mailman id 769428;
 Thu, 01 Aug 2024 08:08:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZQr9-00060V-87; Thu, 01 Aug 2024 08:08:15 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZQr8-0000bP-UN; Thu, 01 Aug 2024 08:08:14 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZQr8-0008CE-Cc; Thu, 01 Aug 2024 08:08:14 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZQr8-0001oS-C3; Thu, 01 Aug 2024 08:08:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=+ijKCJTP76FUyC10KvrWONfods8RpwRNsuzTlci7O2o=; b=UFgAjxCeKDMIO933KLbcdxCa90
	rCjuOpVqXmQN+ToAujfNSuMSGzlZ/GTl30PgiZtRrI6jXmIhP+9Q39AXKeVuiqVW3U2Ns1AhtQqQK
	c9vTI0cz8IgnNh/snSSUnc1aPDODpmlH72cadN0OvQVANMhzrQjvkszngvfpqPqZ/bgU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187080-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187080: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    xen-unstable:test-armhf-armhf-xl:host-ping-check-xen:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=6979e17b3f8a18d2ba5dbd4f0623c4061dae0dfc
X-Osstest-Versions-That:
    xen=a18b50614d97ecb488479829dcd5ad963bf691e3
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 08:08:14 +0000

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

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 187101-retest
 test-armhf-armhf-xl          10 host-ping-check-xen fail pass in 187101-retest

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

version targeted for testing:
 xen                  6979e17b3f8a18d2ba5dbd4f0623c4061dae0dfc
baseline version:
 xen                  a18b50614d97ecb488479829dcd5ad963bf691e3

Last test of basis   187067  2024-07-30 22:39:01 Z    1 days
Testing same since   187080  2024-07-31 13:04:32 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Bertrand Marquis <bertrand.marquis@arm.com>
  Jan Beulich <jbeulich@suse.com>
  Stefano Stabellini <sstabellini@kernel.org>
  Stefano Stabellini <stefano.stabellini@amd.com>
  Victor Lira <victorm.lira@amd.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   a18b50614d..6979e17b3f  6979e17b3f8a18d2ba5dbd4f0623c4061dae0dfc -> master


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 08:13:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 08:13:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769446.1180350 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZQvw-0007ij-My; Thu, 01 Aug 2024 08:13:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769446.1180350; Thu, 01 Aug 2024 08:13:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZQvw-0007iU-I2; Thu, 01 Aug 2024 08:13:12 +0000
Received: by outflank-mailman (input) for mailman id 769446;
 Thu, 01 Aug 2024 08:13:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=xSmm=PA=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sZQvv-0007i5-Fr
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 08:13:11 +0000
Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com
 [2a00:1450:4864:20::52c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e347fa00-4fdd-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 10:13:09 +0200 (CEST)
Received: by mail-ed1-x52c.google.com with SMTP id
 4fb4d7f45d1cf-5af326eddb2so3199489a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 01:13:09 -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
 4fb4d7f45d1cf-5ac63590d81sm9883008a12.23.2024.08.01.01.13.08
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 01:13:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e347fa00-4fdd-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722499989; x=1723104789; 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=M/mJS9h82p54uLSSBVmHoxv9n2rzlaKYIk+BGzaOG8U=;
        b=O5OiwSf6pS1HybruCvDf76slJ4FAKm+9iUv0r+wxPP9eOEL6P7yhy8ESsMfTIhcugD
         7mcqPTSXu6A1/L9x0eq2GWpzSBXbe3MfQyO+qSBxNFMo8QfSHvLC2QskMBHrsTkzgtSB
         8gcV9llIun1v1Ry0d+BOi+q0CQUmf4JHVTgaOC70CeTuoGpi8KqMAgeqp9bPHyBfFpPV
         Vh6xdonID4cRcOYqfLL5FR/e5oIaBoSo2Fi2r8JH+1aeysIkhquBX1wci0+XBQnEQSQc
         zXaXu6+ztYQAdml3cgDTktSdBQMy6Tvj7P9EkjhnleltyVnKg9396/NAJv+M/YnP+M6W
         R3eA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722499989; x=1723104789;
        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=M/mJS9h82p54uLSSBVmHoxv9n2rzlaKYIk+BGzaOG8U=;
        b=lnYxToX5xx8UT5CvETM56DKgkJhK/sVH+OFD0j9Ca+X/uS9UwA3kQmhS5LZHFtKbRH
         +4GlIvYtSNp52b1rxabK+rQXSqLdX5zMxauuATZXJZTgst1iWKk69yEpP9AaxRdDQ1nx
         xcuUi6lM/j9FU9KA0EeE6yIqWsOA0L5j14I5tRapfaC/eVWc2KAWvmoXf8VOIk5ibUpJ
         HrfMRtG7yY/d+2i+RFMtqBnLcfqtzjGgojHHCfudbE6xf3kueIgJlvYjDLOngDXH6ZJi
         mQcPL45MvlluDy0OsnyWhiHdHT5cYxoXIkKbcQrwGRgYoitereYTPPb57L0AC7O6t0/r
         pF8w==
X-Forwarded-Encrypted: i=1; AJvYcCUV5cObR0Rr7py9EPJUeSJBKciqy2txb0TZ8xgLO+3/HO9Uvx5E7GkqYO8RlTygQcqTHs7GlTUpBUSJ2QWNDNLuvLcZfidrgLj/qHgCCFY=
X-Gm-Message-State: AOJu0Yx+Pj1DHfR4rcOrq7Qv8VdbBZfWltBqKc9df9tVk/lQScGlPjYR
	C5k105GNWB+m48UYheb93L8jD+yls6HcoYXrVF4eyNKomZusNUMdpiB6pYv4NVavSWbvEbfrlzT
	S
X-Google-Smtp-Source: AGHT+IHMYcpXa4CVg65aTj1rbaNI790f2Sz+h8yluHqRP/gwsIrXc/ADGOrHP0eFajzRrNOSNpLSCA==
X-Received: by 2002:a05:6402:74b:b0:57d:3e48:165d with SMTP id 4fb4d7f45d1cf-5b77bd9cbf7mr472457a12.4.1722499988447;
        Thu, 01 Aug 2024 01:13:08 -0700 (PDT)
Message-ID: <7fa3bca4-1ef4-4c95-bf92-de87c7c8fc96@suse.com>
Date: Thu, 1 Aug 2024 10:13:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/3] mini-os: mm: switch need_pgt() to use walk_pt()
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
 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>
 <20240731212752.zd5njpd7kgoc433d@begin>
 <8fef9511-c5d0-49a9-a800-6087f03b3199@suse.com>
 <20240801073923.32s6i4enoq6qafa5@begin>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <20240801073923.32s6i4enoq6qafa5@begin>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 01.08.24 09:39, Samuel Thibault wrote:
> Jürgen Groß, le jeu. 01 août 2024 07:56:36 +0200, a ecrit:
>> On 31.07.24 23:27, Samuel Thibault wrote:
>>> 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)?
>>
>> No.
> 
> I don't understand: it doesn't map what I know of need_pgt and what the
> existing code is doing.
> 
> AIKI, the point of need_pgt is to make sure there is a L1 page table
> entry for a VA, and return it, so the caller can put in it at pte for a
> mfn or such. In the case a PSE is met, we don't go further, and it's up
> to the caller to decide what it wants to do (most often it's actually
> unexpected and asserted out). In both cases, the PRESENT bit of the
> pte whose address is returned does not matter, most often it's the
> caller which will set it.
> 
> The existing code for need_pgt thus always adds page table entries down
> to level1 (except if _PAGE_PSE is met, i.e. a large page was already set
> up): the termination was:
> 
> [... walk down to level 2]

You have omitted:

        ASSERT(tab[offset] & _PAGE_PRESENT);

> -    if ( tab[offset] & _PAGE_PSE )
> -        return &tab[offset];
> [... walk down to level 1]
> -    return &tab[offset];


Juergen


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 08:45:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 08:45:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769459.1180360 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZRQu-0003xE-0j; Thu, 01 Aug 2024 08:45:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769459.1180360; Thu, 01 Aug 2024 08:45:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZRQt-0003x7-U0; Thu, 01 Aug 2024 08:45:11 +0000
Received: by outflank-mailman (input) for mailman id 769459;
 Thu, 01 Aug 2024 08:45:10 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=TSRy=PA=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1sZRQs-0003x1-Bk
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 08:45:10 +0000
Received: from pb-smtp20.pobox.com (pb-smtp20.pobox.com [173.228.157.52])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 57e7f6bf-4fe2-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 10:45:04 +0200 (CEST)
Received: from pb-smtp20.pobox.com (unknown [127.0.0.1])
 by pb-smtp20.pobox.com (Postfix) with ESMTP id CD72124E3D;
 Thu,  1 Aug 2024 04:45:01 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1])
 by pb-smtp20.pobox.com (Postfix) with ESMTP id C5BB424E3C;
 Thu,  1 Aug 2024 04:45:01 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [185.130.54.90])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp20.pobox.com (Postfix) with ESMTPSA id B277F24E39;
 Thu,  1 Aug 2024 04:44:57 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 57e7f6bf-4fe2-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:mime-version:content-transfer-encoding;
	 s=sasl; bh=bMdXEGT4h8JNUNXs31Rh14RXwymMIlKEwtSqxFCgeJk=; b=nUqr
	M9UY96JxXP3lE7kF9DsUM3gUfM5D6vLU3B158cEn/tOtvhEvdoc5ddN4gzozzsxr
	LvdCkW1BBxkAoiWuYZK5XYe5us8szMO9DRzirXitJhh90LSDRyd82L6ZNbyua58B
	cYUNYlSfO9sQWsBM0h8P6rZdmxnC+v4rLzVQCvA=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [XEN PATCH v2] x86/intel: optional build of PSR support
Date: Thu,  1 Aug 2024 11:44:53 +0300
Message-Id: <20240801084453.1163506-1-Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
X-Pobox-Relay-ID:
 54E823C2-4FE2-11EF-9A39-92D9AF168FA5-90055647!pb-smtp20.pobox.com
Content-Transfer-Encoding: quoted-printable

Platform Shared Resource feature is available for certain Intel's CPUs on=
ly,
hence can be put under CONFIG_INTEL build option.

When !INTEL then PSR-related sysctls XEN_SYSCTL_psr_cmt_op &
XEN_SYSCTL_psr_alloc are off as well.

Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
CC: Jan Beulich <jbeulich@suse.com>
---
v1 patch here:
https://lore.kernel.org/xen-devel/20240606083908.2510396-1-Sergiy_Kibrik@=
epam.com/

changes in v2:
 - split outer switch cases for {XEN_SYSCTL,XEN_DOMCTL}_psr_cmt_op and
   {XEN_SYSCTL,XEN_DOMCTL}_psr_alloc so that return codes in default swit=
ch
   cases are not mangled (as Jan suggested)
---
 xen/arch/x86/Makefile          |  2 +-
 xen/arch/x86/domctl.c          |  8 ++++++++
 xen/arch/x86/include/asm/psr.h |  9 +++++++++
 xen/arch/x86/sysctl.c          | 12 +++++++++++-
 4 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index d902fb7acc..02218d32c5 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -57,7 +57,7 @@ obj-y +=3D pci.o
 obj-y +=3D percpu.o
 obj-y +=3D physdev.o
 obj-$(CONFIG_COMPAT) +=3D x86_64/physdev.o
-obj-y +=3D psr.o
+obj-$(CONFIG_INTEL) +=3D psr.o
 obj-y +=3D setup.o
 obj-y +=3D shutdown.o
 obj-y +=3D smp.o
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 68b5b46d1a..bccd3852a7 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1162,6 +1162,7 @@ long arch_do_domctl(
     }
=20
     case XEN_DOMCTL_psr_cmt_op:
+#ifdef CONFIG_INTEL
         if ( !psr_cmt_enabled() )
         {
             ret =3D -ENODEV;
@@ -1190,11 +1191,16 @@ long arch_do_domctl(
             ret =3D -ENOSYS;
             break;
         }
+
+#else /* CONFIG_INTEL */
+        ret =3D -ENOSYS;
+#endif
         break;
=20
     case XEN_DOMCTL_psr_alloc:
         switch ( domctl->u.psr_alloc.cmd )
         {
+#ifdef CONFIG_INTEL
         case XEN_DOMCTL_PSR_SET_L3_CBM:
             ret =3D psr_set_val(d, domctl->u.psr_alloc.target,
                               domctl->u.psr_alloc.data,
@@ -1257,6 +1263,8 @@ long arch_do_domctl(
=20
 #undef domctl_psr_get_val
=20
+#endif /* CONFIG_INTEL */
+
         default:
             ret =3D -EOPNOTSUPP;
             break;
diff --git a/xen/arch/x86/include/asm/psr.h b/xen/arch/x86/include/asm/ps=
r.h
index 51df78794c..8a8c2b13d0 100644
--- a/xen/arch/x86/include/asm/psr.h
+++ b/xen/arch/x86/include/asm/psr.h
@@ -72,6 +72,8 @@ static inline bool psr_cmt_enabled(void)
     return !!psr_cmt;
 }
=20
+#ifdef CONFIG_INTEL
+
 int psr_alloc_rmid(struct domain *d);
 void psr_free_rmid(struct domain *d);
 void psr_ctxt_switch_to(struct domain *d);
@@ -86,6 +88,13 @@ int psr_set_val(struct domain *d, unsigned int socket,
 void psr_domain_init(struct domain *d);
 void psr_domain_free(struct domain *d);
=20
+#else
+
+static inline void psr_ctxt_switch_to(struct domain *d) {}
+static inline void psr_domain_init(struct domain *d) {}
+static inline void psr_domain_free(struct domain *d) {}
+#endif /* CONFIG_INTEL */
+
 #endif /* __ASM_PSR_H__ */
=20
 /*
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 1d40d82c5a..b39b7f68de 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -32,6 +32,7 @@
 #include <asm/psr.h>
 #include <asm/cpu-policy.h>
=20
+#ifdef CONFIG_INTEL
 struct l3_cache_info {
     int ret;
     unsigned long size;
@@ -46,6 +47,7 @@ static void cf_check l3_cache_get(void *arg)
     if ( !l3_info->ret )
         l3_info->size =3D info.size / 1024; /* in KB unit */
 }
+#endif
=20
 static long cf_check smt_up_down_helper(void *data)
 {
@@ -170,6 +172,7 @@ long arch_do_sysctl(
     break;
=20
     case XEN_SYSCTL_psr_cmt_op:
+#ifdef CONFIG_INTEL
         if ( !psr_cmt_enabled() )
             return -ENODEV;
=20
@@ -218,6 +221,11 @@ long arch_do_sysctl(
             break;
         }
=20
+#else /* CONFIG_INTEL*/
+        sysctl->u.psr_cmt_op.u.data =3D 0;
+        ret =3D -ENOSYS;
+#endif
+
         if ( __copy_to_guest(u_sysctl, sysctl, 1) )
             ret =3D -EFAULT;
=20
@@ -225,10 +233,11 @@ long arch_do_sysctl(
=20
     case XEN_SYSCTL_psr_alloc:
     {
-        uint32_t data[PSR_INFO_ARRAY_SIZE] =3D { };
+        uint32_t __maybe_unused data[PSR_INFO_ARRAY_SIZE] =3D { };
=20
         switch ( sysctl->u.psr_alloc.cmd )
         {
+#ifdef CONFIG_INTEL
         case XEN_SYSCTL_PSR_get_l3_info:
             ret =3D psr_get_info(sysctl->u.psr_alloc.target,
                                PSR_TYPE_L3_CBM, data, ARRAY_SIZE(data));
@@ -279,6 +288,7 @@ long arch_do_sysctl(
             if ( __copy_field_to_guest(u_sysctl, sysctl, u.psr_alloc) )
                 ret =3D -EFAULT;
             break;
+#endif /* CONFIG_INTEL */
=20
         default:
             ret =3D -EOPNOTSUPP;
--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 01 09:15:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 09:15:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769476.1180374 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZRuQ-0000Cl-Ce; Thu, 01 Aug 2024 09:15:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769476.1180374; Thu, 01 Aug 2024 09:15:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZRuQ-0000Ce-A4; Thu, 01 Aug 2024 09:15:42 +0000
Received: by outflank-mailman (input) for mailman id 769476;
 Thu, 01 Aug 2024 09:15:40 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=5eeJ=PA=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sZRuO-0000Al-T6
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 09:15:40 +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 9d0b7acb-4fe6-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 11:15:37 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 83326A0374;
 Thu,  1 Aug 2024 11:15: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 pi5kvC2AKg08; Thu,  1 Aug 2024 11:15:36 +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 4AB52A0371;
 Thu,  1 Aug 2024 11:15:36 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sZRuJ-00000000bzH-46Ly; Thu, 01 Aug 2024 11:15:35 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9d0b7acb-4fe6-11ef-8776-851b0ebba9a2
Date: Thu, 1 Aug 2024 11:15:35 +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 2/3] mini-os: mm: switch need_pgt() to use walk_pt()
Message-ID: <20240801091535.rpspqy2k73tjy6ms@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: <20240731130026.8467-1-jgross@suse.com>
 <20240731130026.8467-3-jgross@suse.com>
 <20240731212752.zd5njpd7kgoc433d@begin>
 <8fef9511-c5d0-49a9-a800-6087f03b3199@suse.com>
 <20240801073923.32s6i4enoq6qafa5@begin>
 <7fa3bca4-1ef4-4c95-bf92-de87c7c8fc96@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <7fa3bca4-1ef4-4c95-bf92-de87c7c8fc96@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Jürgen Groß, le jeu. 01 août 2024 10:13:07 +0200, a ecrit:
> On 01.08.24 09:39, Samuel Thibault wrote:
> > Jürgen Groß, le jeu. 01 août 2024 07:56:36 +0200, a ecrit:
> > > On 31.07.24 23:27, Samuel Thibault wrote:
> > > > 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)?
> > > 
> > > No.
> > 
> > I don't understand: it doesn't map what I know of need_pgt and what the
> > existing code is doing.
> > 
> > AIKI, the point of need_pgt is to make sure there is a L1 page table
> > entry for a VA, and return it, so the caller can put in it at pte for a
> > mfn or such. In the case a PSE is met, we don't go further, and it's up
> > to the caller to decide what it wants to do (most often it's actually
> > unexpected and asserted out). In both cases, the PRESENT bit of the
> > pte whose address is returned does not matter, most often it's the
> > caller which will set it.
> > 
> > The existing code for need_pgt thus always adds page table entries down
> > to level1 (except if _PAGE_PSE is met, i.e. a large page was already set
> > up): the termination was:
> > 
> > [... walk down to level 2]
> 
> You have omitted:
> 
>        ASSERT(tab[offset] & _PAGE_PRESENT);

Right, that confirms that we never set PSE without PRESENT. We probably
want to keep that assertion in the PSE case.

But we still want to continue walking down to level1 (or pse) even when
L4/L3/L2 have PRESENT.

> > -    if ( tab[offset] & _PAGE_PSE )
> > -        return &tab[offset];
> > [... walk down to level 1]
> > -    return &tab[offset];

Samuel


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 09:25:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 09:25:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769488.1180384 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZS40-00025y-7T; Thu, 01 Aug 2024 09:25:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769488.1180384; Thu, 01 Aug 2024 09:25:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZS40-00025r-3M; Thu, 01 Aug 2024 09:25:36 +0000
Received: by outflank-mailman (input) for mailman id 769488;
 Thu, 01 Aug 2024 09:25:34 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=xSmm=PA=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sZS3y-00025g-P6
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 09:25:34 +0000
Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com
 [2a00:1450:4864:20::52b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 00324649-4fe8-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 11:25:32 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5b3fff87e6bso3918820a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 02:25:32 -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
 4fb4d7f45d1cf-5ac631b038asm9838902a12.14.2024.08.01.02.25.31
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 02:25:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 00324649-4fe8-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722504332; x=1723109132; 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=EcrReH1FzMPVP1OEyOxTBff3mux3+NXaWR11lyworsw=;
        b=SgKFhJZDEyH97t0FlMOCxoDPJmYZOlDiryYDpSoPOLeHxN8r/gjiCvinwMgthgD4MA
         Rp2x4Yv3O/MqPGoScmTDP5//A/QNwIsLVG21IQpnkPtAUIAOogUSwD3iXnHYvlvsRKet
         uMAn5kMQDLHYTLa65zbjUEybpCLOseQOLUrmG4hsVi/pPE1tPzC/FjbRnn8hGrBAXhMo
         6fTdk5D13DupBEebr+Bu7u5GoqBzqA/t45frBB2NjRSLJoDT2jz05gfmwX0xtzhrh4Tn
         gj+jHy6CvW5y/2xPPTemJSt5g7Jggt3eY28fRGkQdtFZXi7/8kz2ndOPsRVFhVX+43w1
         T8PQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722504332; x=1723109132;
        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=EcrReH1FzMPVP1OEyOxTBff3mux3+NXaWR11lyworsw=;
        b=Mui3dm0+Cw2oP0evJfEurw6f6lKKWT07cWFXPwZbwbgPKtj6IdM2Ru2E56NsWc7UiZ
         uJtan2sP4m95XCIiL73dtS3hZqsNM3pLQsGHSw7e1qJsXF/dqpXLimTupR/hVFuCbZXy
         74Ro4Q4LkvSbbJHUTwjB8RTVplv2hiQJ9io7mgDiZBWafp7rivMGJXs84fYrN80aRExh
         TZZz9e25FY2AsgZlmxA7cxr+FTXcLIC/dC/+WC8/Q9ZJOsW8Url3uEgVn89Omvrc/a98
         Fl91/AHK8eRvFTjWafzbcRGHJABLN65+TlUUhFW/RMsZRl00fKjEH9Rvj2c+8PuVFhb0
         ZX1w==
X-Forwarded-Encrypted: i=1; AJvYcCWX7sMec9wHmG9nKa7DICZthqw++zgUWlMU/vrQeVNLpUt49ZwHQ7UAT0jP3vNvjI4FP4ufoML1r2RW9xtHJCdhuQCoqg/pqSJnVKJRV+o=
X-Gm-Message-State: AOJu0YzDH7yGOx9uCE7b7DlIWmnZErDqpC887+XTQ0pNQUsm8yQjfdXM
	2fC5X6ZWoUdqaqUwQ0sYYEOuL0BRtMpie5uzhgnH3GPx2/m+sRMdesoenGRCDPOU+3ZhylZWnIK
	R
X-Google-Smtp-Source: AGHT+IG+YYfS2UmGdG+qZR+I4YRxLkbvj1Mkbz0EqVdD9uO5cbpfLBXerCcmbxy1mbvUJS4WuONJ4g==
X-Received: by 2002:aa7:d44f:0:b0:5a1:61a7:56ce with SMTP id 4fb4d7f45d1cf-5b7008ac013mr949766a12.35.1722504332045;
        Thu, 01 Aug 2024 02:25:32 -0700 (PDT)
Message-ID: <894c9552-ef2b-4255-b429-ad3df4f5c0cc@suse.com>
Date: Thu, 1 Aug 2024 11:25:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/3] mini-os: mm: switch need_pgt() to use walk_pt()
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
 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>
 <20240731212752.zd5njpd7kgoc433d@begin>
 <8fef9511-c5d0-49a9-a800-6087f03b3199@suse.com>
 <20240801073923.32s6i4enoq6qafa5@begin>
 <7fa3bca4-1ef4-4c95-bf92-de87c7c8fc96@suse.com>
 <20240801091535.rpspqy2k73tjy6ms@begin>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <20240801091535.rpspqy2k73tjy6ms@begin>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 01.08.24 11:15, Samuel Thibault wrote:
> Jürgen Groß, le jeu. 01 août 2024 10:13:07 +0200, a ecrit:
>> On 01.08.24 09:39, Samuel Thibault wrote:
>>> Jürgen Groß, le jeu. 01 août 2024 07:56:36 +0200, a ecrit:
>>>> On 31.07.24 23:27, Samuel Thibault wrote:
>>>>> 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)?
>>>>
>>>> No.
>>>
>>> I don't understand: it doesn't map what I know of need_pgt and what the
>>> existing code is doing.
>>>
>>> AIKI, the point of need_pgt is to make sure there is a L1 page table
>>> entry for a VA, and return it, so the caller can put in it at pte for a
>>> mfn or such. In the case a PSE is met, we don't go further, and it's up
>>> to the caller to decide what it wants to do (most often it's actually
>>> unexpected and asserted out). In both cases, the PRESENT bit of the
>>> pte whose address is returned does not matter, most often it's the
>>> caller which will set it.
>>>
>>> The existing code for need_pgt thus always adds page table entries down
>>> to level1 (except if _PAGE_PSE is met, i.e. a large page was already set
>>> up): the termination was:
>>>
>>> [... walk down to level 2]
>>
>> You have omitted:
>>
>>         ASSERT(tab[offset] & _PAGE_PRESENT);
> 
> Right, that confirms that we never set PSE without PRESENT. We probably
> want to keep that assertion in the PSE case.

Hmm, I'm not sure.

The hardware allows to have any bit set in the PTE when PRESENT isn't set.
It will never look at any other bit in this case. Why should the software
require something different here?

> But we still want to continue walking down to level1 (or pse) even when
> L4/L3/L2 have PRESENT.

We do that. In this case the is_leaf flag won't be set and need_pgt_func()
will return early with the return value 0, meaning that the walk will be
continued.


Juergen


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 09:33:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 09:33:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769501.1180398 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZSBU-0003zd-VY; Thu, 01 Aug 2024 09:33:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769501.1180398; Thu, 01 Aug 2024 09:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZSBU-0003zW-Sk; Thu, 01 Aug 2024 09:33:20 +0000
Received: by outflank-mailman (input) for mailman id 769501;
 Thu, 01 Aug 2024 09:33:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dsN4=PA=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sZSBT-0003zA-DE
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 09:33:19 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1591ffc4-4fe9-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 11:33:18 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-52efe4c7c16so9876522e87.0
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 02:33:18 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-52fd5c19f89sm2531876e87.216.2024.08.01.02.33.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 01 Aug 2024 02:33:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1591ffc4-4fe9-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722504797; x=1723109597; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=YeVgNBZLjCe/tGZULNDaZspPiz31oXhQD/UPu5rTYXM=;
        b=l1Qwsx/m+ion5vDj6G9g1SJwwI8ZYzB1bZIqRwvXoLfFfSruIOrgxyTdQGB8XaJ/ax
         Wv2nnmrF4EmgJ+Muedk+h+tsWA6q/OabDpMIo3ABFaYVnzxJdNtzOojY/b2Xs753jHPm
         h5aUSfS/LPhSP2laXBjU7CpzBS5kNRQ2Om800Zr2ho6PjnfR4RuKk1jxRz+hLkKGzOMH
         pP32Ykq5/a0M783T2nxGMlEOfkBAgbPmuna52yAMEf6j6x4Bb7IPvQTi36Uebk6HfiH1
         hbbPeFD8Pd8E9oMG4vXXQiEdEWHpBGX1l7eEtzFY9olXbFma3ZkqCNRTXNFubO5qQ5Bi
         KLNg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722504797; x=1723109597;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=YeVgNBZLjCe/tGZULNDaZspPiz31oXhQD/UPu5rTYXM=;
        b=RTnIfE2hN0C08hgw5jx52ztJRhmUBsmDCqHc2Ds2mMQFyQEQlJcQyc//jlPKoCL4lL
         zkTIZ1tUin0njGaTvvk66V2O5wiBhA2U4Vdo3nHT+lvbgaSny2y+Ji3sNQ2vkqNv466A
         NPkrYFNhcukeR0bDy9Cu16e9oJM2hZaqajXrYh2SQPmA+QmrWR/rQ4AQAUY3C19uOQB+
         3B4yk0jjbYq6U6mylGEWGMhQNbNBrBd5c8JLI0O94bw4P9SZd1RlBS1jhn1V7TgVqq70
         nWhVVbryx+2Iq4cXOnhgDSnHCnqxYiVQQLD/Nku20fCHzad8iQMHthHhwNQLQRxGsYQe
         OSVA==
X-Forwarded-Encrypted: i=1; AJvYcCXKVZSz3VBmB+jSXS+37g36XyhTKMxwcfYoNukBMoAIWBYUX3QbD+1Hy2DOp0B9eQTb1zLibi3eoFq+xIRLn0LuTvmZMhsxNPiAVeZUN4A=
X-Gm-Message-State: AOJu0YyMYDlBKrvkf4csSPvu+HiWcWQrh7GB9or4G2aSRYGlRcQO+3kx
	c/kNw5qNY8DGt8CChShNLRCFr3NIl+DcfTjAT1mmyefBxDqQINgm
X-Google-Smtp-Source: AGHT+IFY+kW8+6QuybUGYPTBU0AR0G+SzVA7qwSi3F0TOuR3xb8oUlTmEULGLXjgmxB/BQsrzM0aOQ==
X-Received: by 2002:a05:6512:250e:b0:52e:9fe0:bee4 with SMTP id 2adb3069b0e04-530b61a5cc7mr1467742e87.9.1722504796812;
        Thu, 01 Aug 2024 02:33:16 -0700 (PDT)
Message-ID: <04b40498494cbbd0d78744d87a2310e211f26b85.camel@gmail.com>
Subject: Re: [PATCH v3 8/9] xen/riscv: page table handling
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Thu, 01 Aug 2024 11:33:15 +0200
In-Reply-To: <c2496115-5c42-4cbb-8dde-686a97259609@suse.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
	 <595c7b6736d6f718bafc7a677fb13881584ce4dc.1721834549.git.oleksii.kurochko@gmail.com>
	 <c2496115-5c42-4cbb-8dde-686a97259609@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Tue, 2024-07-30 at 16:22 +0200, Jan Beulich wrote:
> On 24.07.2024 17:31, Oleksii Kurochko wrote:
> > Introduces an implementation of map_pages_to_xen() which requires
> > multiple
> > functions to work with page tables/entries:
> > - xen_pt_update()
> > - xen_pt_mapping_level()
> > - xen_pt_update_entry()
> > - xen_pt_next_level()
> > - xen_pt_check_entry()
>=20
> I question the need for xen_ prefixes here.
xen_ prefixes could be dropped, there is no big meaning in them.

>=20
> > --- a/xen/arch/riscv/Kconfig
> > +++ b/xen/arch/riscv/Kconfig
> > @@ -2,6 +2,7 @@ config RISCV
> > =C2=A0 def_bool y
> > =C2=A0 select FUNCTION_ALIGNMENT_16B
> > =C2=A0 select GENERIC_BUG_FRAME
> > + select GENERIC_PT
> > =C2=A0 select HAS_DEVICE_TREE
> > =C2=A0 select HAS_PMAP
>=20
> Stray leftover?
Missed to drop after I tried to make these changes as a part of common
code. Thanks.

> >=20
>=20
> > --- a/xen/arch/riscv/include/asm/page-bits.h
> > +++ b/xen/arch/riscv/include/asm/page-bits.h
> > @@ -3,6 +3,42 @@
> > =C2=A0#ifndef __RISCV_PAGE_BITS_H__
> > =C2=A0#define __RISCV_PAGE_BITS_H__
> > =C2=A0
> > +/*
> > + * PTE format:
> > + * | XLEN-1=C2=A0 10 | 9=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0
> > + *=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PFN=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 reserved for SW=C2=A0=C2=A0 D=C2=A0=C2=A0 A=C2=A0=C2=A0 G=C2=A0=C2=A0 U=
=C2=A0=C2=A0 X=C2=A0=C2=A0 W=C2=A0=C2=A0 R=C2=A0=C2=A0 V
> > + */
> > +
> > +#define _PAGE_PRESENT=C2=A0=C2=A0 BIT(0, UL)
>=20
> The acronym being V, would _PAGE_VALID maybe be a better name? Just
> like it's PTE_VALID? Speaking of which: Why do you need both PTE_*
> and _PAGE_*? How will one determine which one to use where? Plus imo
> page-bits.h is the wrong header to put these in. In fact I notice
> abuse of this header has already proliferated: Both PPC and RISC-V
> include this header explicitly, when it was introduced for just
> xen/page-size.h to include directly (and the definitions to put there
> are solely ones related to what xen/page-size.h needs / provides).
> The underlying idea what to simplify header dependencies. With what
> PPC and RISC-V do, that's being undermined.
I introduced them to be aligned with ARM code as I tried to use it as a
common code but after 'page table handling' was reworked to be arch-
specific _PAGE_* defintions could be dropped and only PTE_* ones could
be used.

>=20
> > +#define _PAGE_READ=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BIT(1, UL)=C2=A0=C2=
=A0=C2=A0 /* Readable */
> > +#define _PAGE_WRITE=C2=A0=C2=A0=C2=A0=C2=A0 BIT(2, UL)=C2=A0=C2=A0=C2=
=A0 /* Writable */
> > +#define _PAGE_EXEC=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BIT(3, UL)=C2=A0=C2=
=A0=C2=A0 /* Executable */
> > +#define _PAGE_USER=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BIT(4, UL)=C2=A0=C2=
=A0=C2=A0 /* User */
> > +#define _PAGE_GLOBAL=C2=A0=C2=A0=C2=A0 BIT(5, UL)=C2=A0=C2=A0=C2=A0 /*=
 Global */
> > +#define _PAGE_ACCESSED=C2=A0 BIT(6, UL)=C2=A0=C2=A0=C2=A0 /* Set by ha=
rdware on any
> > access */
> > +#define _PAGE_DIRTY=C2=A0=C2=A0=C2=A0=C2=A0 BIT(7, UL)=C2=A0=C2=A0=C2=
=A0 /* Set by hardware on any
> > write */
> > +#define _PAGE_SOFT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BIT(8, UL)=C2=A0=C2=
=A0=C2=A0 /* Reserved for software */
>=20
> The diagram says that's two bits.
I meant here as a start bit index for _PAGE_SOFT.

>=20
> > +/*
> > + * There is no such bits in PTE format for RISC-V.
> > + *
> > + * _PAGE_BLOCK was introduced to have ability to tell that
> > superpage
> > + * should be allocated.
> > + */
> > +#define _PAGE_BLOCK=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BI=
T(9, UL)
>=20
> Imo, like on x86, super-page mappings should be the default whenever
> possible.
> Callers _not_ wanting such can request so - see x86'es
> MAP_SMALL_PAGES.
>=20
> > +#define _PAGE_W_BIT=C2=A0=C2=A0=C2=A0=C2=A0 2
> > +#define _PAGE_XN_BIT=C2=A0=C2=A0=C2=A0 3
> > +#define _PAGE_RO_BIT=C2=A0=C2=A0=C2=A0 1
> > +
> > +/* TODO: move to somewhere generic part/header ? */
> > +#define _PAGE_XN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (1U << _PAG=
E_XN_BIT)
> > +#define _PAGE_RO=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (1U << _PAG=
E_RO_BIT)
> > +#define _PAGE_W=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (1U <<=
 _PAGE_W_BIT)
> > +#define PAGE_XN_MASK(x) (((x) >> _PAGE_XN_BIT) & 0x1U)
> > +#define PAGE_RO_MASK(x) (((x) >> _PAGE_RO_BIT) & 0x1U)
> > +#define PAGE_W_MASK(x)=C2=A0 (((x) >> _PAGE_W_BIT) & 0x1U)
>=20
> What are all of these about? Why PAGE_XN when you have a positive X
> bit in the
> PTEs? And why 0x1U when plain 1 would do? All the PAGE_*_MASK ones
> are also
> badly named. Constructs of that name should extract the bit in its
> position
> (i.e. not shifted to bit 0), or be the name of a constant to use to
> do so.
The same reason as above initially I tried to have generic code with
ARM but it at the end it was a bad idea. So just need to provide proper
names. Thanks.


>=20
> > --- a/xen/arch/riscv/include/asm/page.h
> > +++ b/xen/arch/riscv/include/asm/page.h
> > @@ -34,6 +34,7 @@
> > =C2=A0#define PTE_LEAF_DEFAULT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 (PTE_VALID | PTE_READABLE |
> > PTE_WRITABLE)
> > =C2=A0#define PTE_TABLE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (PTE_VALID)
> > =C2=A0
> > +#define PAGE_HYPERVISOR_RO=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 (PTE_VALID | PTE_READABLE)
> > =C2=A0#define PAGE_HYPERVISOR_RW=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 (PTE_VALID | PTE_READABLE |
> > PTE_WRITABLE)
>=20
> No PAGE_HYPERVISOR_RX?
I haven't used it at the moment, so I haven't provided it.

>=20
> > @@ -43,13 +44,68 @@
> > =C2=A0
> > =C2=A0#define pt_index(lvl, va) (pt_linear_offset((lvl), (va)) &
> > VPN_MASK)
> > =C2=A0
> > -/* Page Table entry */
> > +#define FIRST_SIZE (XEN_PT_LEVEL_SIZE(2))
> > +
> > +#define TABLE_OFFSET(offs) (_AT(unsigned int, offs) & ((_AC(1, U)
> > << PAGETABLE_ORDER) - 1))
> > +
> > +#if RV_STAGE1_MODE > SATP_MODE_SV48
> > +#error "need to to update DECLARE_OFFSETS macros"
> > +#else
> > +
> > +#define l0_table_offset(va) TABLE_OFFSET(pt_linear_offset(0, va))
> > +#define l1_table_offset(va) TABLE_OFFSET(pt_linear_offset(1, va))
> > +#define l2_table_offset(va) TABLE_OFFSET(pt_linear_offset(2, va))
> > +#define l3_table_offset(va) TABLE_OFFSET(pt_linear_offset(3, va))
> > +
> > +/* Generate an array @var containing the offset for each level
> > from @addr */
> > +#define DECLARE_OFFSETS(var, addr)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 \
> > +=C2=A0=C2=A0=C2=A0 const unsigned int var[4] =3D {=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 \
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 l0_table_offset(addr),=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 \
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 l1_table_offset(addr),=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 \
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 l2_table_offset(addr),=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 \
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 l3_table_offset(addr)=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 \
> > +=C2=A0=C2=A0=C2=A0 }
>=20
> Why would this need to have 4 entries in SV39 mode?
I don't need for Sv39. I just wasn't sure with the better way to have
universal DECLARE_OFFSETS() definition. I will add #ifdef Sv48 around
l3_table_offset and drop 4 in const unsigned int var[4].

>=20
> > +#endif
> > +
> > =C2=A0typedef struct {
> > +=C2=A0=C2=A0=C2=A0 unsigned long v:1;
> > +=C2=A0=C2=A0=C2=A0 unsigned long r:1;
> > +=C2=A0=C2=A0=C2=A0 unsigned long w:1;
> > +=C2=A0=C2=A0=C2=A0 unsigned long x:1;
> > +=C2=A0=C2=A0=C2=A0 unsigned long u:1;
> > +=C2=A0=C2=A0=C2=A0 unsigned long g:1;
> > +=C2=A0=C2=A0=C2=A0 unsigned long a:1;
> > +=C2=A0=C2=A0=C2=A0 unsigned long d:1;
>=20
> bool for all of these?
>=20
> > +=C2=A0=C2=A0=C2=A0 unsigned long rsw:2;
> > +#if RV_STAGE1_MODE =3D=3D SATP_MODE_SV39
> > +=C2=A0=C2=A0=C2=A0 unsigned long ppn0:9;
> > +=C2=A0=C2=A0=C2=A0 unsigned long ppn1:9;
> > +=C2=A0=C2=A0=C2=A0 unsigned long ppn2:26;
> > +=C2=A0=C2=A0=C2=A0 unsigned long rsw2:7;
>=20
> "rsw" above appear to mean "reserved for software use". What does
> "rsw" here
> mean? Should this field be "rsv"?
rsw2 means:
   Bits 60=E2=80=9354 are reserved for future standard
   use and, until their use is defined by some standard extension, must be
   zeroed by software for
   forward compatibility. If any of these bits are set, a page-fault
   exception is raised.
It would be better to use "rsv" Thanks.

>=20
> > +=C2=A0=C2=A0=C2=A0 unsigned long pbmt:2;
> > +=C2=A0=C2=A0=C2=A0 unsigned long n:1;
> > +#elif RV_STAGE1_MODE =3D=3D SATP_MODE_SV48
> > +=C2=A0=C2=A0=C2=A0 unsigned long ppn0:9;
> > +=C2=A0=C2=A0=C2=A0 unsigned long ppn1:9;
> > +=C2=A0=C2=A0=C2=A0 unsigned long ppn2:9;
> > +=C2=A0=C2=A0=C2=A0 unsigned long ppn3:17;
> > +=C2=A0=C2=A0=C2=A0 unsigned long rsw2:7;
> > +=C2=A0=C2=A0=C2=A0 unsigned long pbmt:2;
> > +=C2=A0=C2=A0=C2=A0 unsigned long n:1;
> > +#else
> > +#error "Add proper bits for SATP_MODE"
> > +#endif
> > +} pt_t;
>=20
> I can't spot a use anywhere of e.g. ppn0. Would be nice to understand
> in
> what contexts these bitfields are going to be used. I notice you
> specifically
> don't use them in e.g. pte_is_table().
I don't use them at the moment. I just introduced them for the possible
future using. I can re-check what of them I am using in my private
branches and come up here only with that one which are really used.

>=20
>=20
> > +}
> > +
> > +static inline bool pte_is_mapping(const pte_t pte, unsigned int
> > level)
> > +{
> > +=C2=A0=C2=A0=C2=A0 return !pte_is_table(pte, level);
> > +}
>=20
> Don't you mean V=3D1 and (R=3D1 or X=3D1) here?
Agree, (R=3D1 or X=3D1) should be checked here too.

>=20
> > +/* Sanity check of the entry */
> > +static bool xen_pt_check_entry(pte_t entry, mfn_t mfn, unsigned
> > int level,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned int flags)
>=20
> The comment wants extending to indicate what the parameters mean wrt
> what
> is going to be checked. For example, ...
>=20
> > +{
> > +=C2=A0=C2=A0=C2=A0 /* Sanity check when modifying an entry. */
> > +=C2=A0=C2=A0=C2=A0 if ( mfn_eq(mfn, INVALID_MFN) )
>=20
> ... it's unclear to me why incoming INVALID_MFN would indicate
> modification
> of an entry, whereas further down _PAGE_PRESENT supposedly indicates
> insertion.
The statement inside if isn't correct. It should be:
   if ( (flags & _PAGE_PRESENT) && mfn_eq(mfn, INVALID_MFN) )

INVALID_MFN indicates modification because of how xen_pt_update() is
used:
   int map_pages_to_xen(unsigned long virt,
                        mfn_t mfn,
                        unsigned long nr_mfns,
                        unsigned int flags)
   {
       return xen_pt_update(virt, mfn, nr_mfns, flags);
   }
  =20
   int __init populate_pt_range(unsigned long virt, unsigned long nr_mfns)
   {
       return xen_pt_update(virt, INVALID_MFN, nr_mfns, _PAGE_PRESENT);
   }
  =20
   int destroy_xen_mappings(unsigned long s, unsigned long e)
   {
       ASSERT(IS_ALIGNED(s, PAGE_SIZE));
       ASSERT(IS_ALIGNED(e, PAGE_SIZE));
       ASSERT(s <=3D e);
       return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, 0);
   }
  =20
   int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int
   nf)
   {
       ASSERT(IS_ALIGNED(s, PAGE_SIZE));
       ASSERT(IS_ALIGNED(e, PAGE_SIZE));
       ASSERT(s <=3D e);
       return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, nf);
   }

The idea is the following:
  the MFN is not valid and we are not populating page table. This means
we either modify entry or remove an entry.

>=20
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* We don't allow modifying=
 an invalid entry. */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( !pte_is_valid(entry) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pri=
ntk("Modifying invalid entry is not allowed.\n");
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret=
urn false;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* We don't allow modifying=
 a table entry */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( !pte_is_mapping(entry,=
 level) )
>=20
> With what the comment say, why not pte_is_table()?

It should be pte_is_table(). I will double check, thanks.

>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pri=
ntk("Modifying a table entry is not allowed.\n");
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret=
urn false;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > +=C2=A0=C2=A0=C2=A0 }
> > +=C2=A0=C2=A0=C2=A0 /* Sanity check when inserting a mapping */
> > +=C2=A0=C2=A0=C2=A0 else if ( flags & _PAGE_PRESENT )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* We should be here with a=
 valid MFN. */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ASSERT(!mfn_eq(mfn, INVALID=
_MFN));
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * We don't allow repl=
acing any valid entry.
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * Note that the funct=
ion xen_pt_update() relies on this
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * assumption and will=
 skip the TLB flush. The function
> > will need
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * to be updated if th=
e check is relaxed.
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( pte_is_valid(entry) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if =
( pte_is_mapping(entry, level) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 printk("Changing MFN for a valid entry is not
> > allowed (%#"PRI_mfn" -> %#"PRI_mfn").\n",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 mfn_x(pte_get_mfn(entry)), mfn_x(mfn));
>=20
> Nit: Indentation. (I'm once again worried by all of these printk()s
> anyway.)
>=20
> > +#define XEN_TABLE_MAP_FAILED 0
> > +#define XEN_TABLE_SUPER_PAGE 1
> > +#define XEN_TABLE_NORMAL_PAGE 2
> > +
> > +/*
> > + * Take the currently mapped table, find the corresponding entry,
> > + * and map the next table, if available.
> > + *
> > + * The read_only parameters indicates whether intermediate tables
> > should
> > + * be allocated when not present.
>=20
> "read_only" would have a different meaning to me. Maybe use inverted
> sense
> with a name like "alloc"?
Sure, alloc_only would be better correspond to the comment.

>=20
> > + * Return values:
> > + *=C2=A0 XEN_TABLE_MAP_FAILED: Either read_only was set and the entry
> > + *=C2=A0 was empty, or allocating a new page failed.
> > + *=C2=A0 XEN_TABLE_NORMAL_PAGE: next level mapped normally
> > + *=C2=A0 XEN_TABLE_SUPER_PAGE: The next entry points to a superpage.
> > + */
> > +static int xen_pt_next_level(bool read_only, unsigned int level,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 pte_t **table, unsigned int offset)
> > +{
> > +=C2=A0=C2=A0=C2=A0 pte_t *entry;
> > +=C2=A0=C2=A0=C2=A0 int ret;
> > +=C2=A0=C2=A0=C2=A0 mfn_t mfn;
> > +
> > +=C2=A0=C2=A0=C2=A0 entry =3D *table + offset;
> > +
> > +=C2=A0=C2=A0=C2=A0 if ( !pte_is_valid(*entry) )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( read_only )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret=
urn XEN_TABLE_MAP_FAILED;
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret =3D create_xen_table(en=
try);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( ret )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret=
urn XEN_TABLE_MAP_FAILED;
> > +=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0 if ( pte_is_mapping(*entry, level) )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return XEN_TABLE_SUPER_PAGE=
;
> > +=C2=A0=C2=A0=C2=A0 }
>=20
> Please be consistent with braces around single statements.
>=20
> > +=C2=A0=C2=A0=C2=A0 mfn =3D pte_get_mfn(*entry);
> > +
> > +=C2=A0=C2=A0=C2=A0 xen_unmap_table(*table);
> > +=C2=A0=C2=A0=C2=A0 *table =3D xen_map_table(mfn);
> > +
> > +=C2=A0=C2=A0=C2=A0 return XEN_TABLE_NORMAL_PAGE;
> > +}
>=20
> Normal page? Not normal table?
It just mean that this points not to super_page so potenially the in
the next one table will have an entry that would be normal page.

>=20
> > +/* Update an entry at the level @target. */
> > +static int xen_pt_update_entry(mfn_t root, unsigned long virt,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mfn_t mfn, unsigned int
> > arch_target,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned int flags)
> > +{
> > +=C2=A0=C2=A0=C2=A0 int rc;
> > +=C2=A0=C2=A0=C2=A0 unsigned int level =3D HYP_PT_ROOT_LEVEL;
> > +=C2=A0=C2=A0=C2=A0 unsigned int arch_level =3D level;
>=20
> Why two level variables?
It is not needed anymore, I will drop it.

>=20
> > +=C2=A0=C2=A0=C2=A0 unsigned int target =3D arch_target;
> > +=C2=A0=C2=A0=C2=A0 pte_t *table;
> > +=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * The intermediate page tables are read-only =
when the MFN is
> > not valid
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * This means we either modify permissions or =
remove an entry.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0 bool read_only =3D mfn_eq(mfn, INVALID_MFN);
>=20
> I'm afraid I can't make a connection between the incoming MFN being
> INVALID_MFN and intermediate tables being intended to remain
> unaltered.

It is becuase of xen_pt_update() is used:
   int __init populate_pt_range(unsigned long virt, unsigned long
   nr_mfns)
   {
       return xen_pt_update(virt, INVALID_MFN, nr_mfns, _PAGE_PRESENT);
   }
So if pt is only populated then they are read_only and so they shouldn't
be allocated what means ptes are only or being removed or modified.

> > +
> > +static int xen_pt_update(unsigned long virt,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 mfn_t mfn,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 /* const on purpose as it is used for TLB
> > flush */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 const unsigned long nr_mfns,
>=20
> I'm afraid I don't see what the comment is actually trying to tell
> me.
> If this is about you wanting to make sure the function arguments
> aren't
> altered prematurely, then why would the same not apply to virt, mfn,
> and flags (all of which matter at the time the TLB flush is
> initiated)?
>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 unsigned int flags)
> > +{
> > +=C2=A0=C2=A0=C2=A0 int rc =3D 0;
> > +=C2=A0=C2=A0=C2=A0 unsigned long vfn =3D virt >> PAGE_SHIFT;
> > +=C2=A0=C2=A0=C2=A0 unsigned long left =3D nr_mfns;
> > +
> > +=C2=A0=C2=A0=C2=A0 const mfn_t root =3D get_root_page();
> > +
> > +=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * It is bad idea to have mapping both writeab=
le and
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * executable.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * When modifying/creating mapping (i.e _PAGE_=
PRESENT is set),
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * prevent any update if this happen.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0 if ( (flags & _PAGE_PRESENT) && !PAGE_RO_MASK(flags=
) &&
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 !PAGE_XN_MASK(flags) =
)
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printk("Mappings should not=
 be both Writeable and
> > Executable.\n");
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EINVAL;
> > +=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0 if ( !IS_ALIGNED(virt, PAGE_SIZE) )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printk("The virtual address=
 is not aligned to the page-
> > size.\n");
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EINVAL;
> > +=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0 spin_lock(&xen_pt_lock);
> > +
> > +=C2=A0=C2=A0=C2=A0 while ( left )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned int order, level;
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 level =3D xen_pt_mapping_le=
vel(vfn, mfn, left, flags);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 order =3D XEN_PT_LEVEL_ORDE=
R(level);
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ASSERT(left >=3D BIT(order,=
 UL));
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rc =3D xen_pt_update_entry(=
root, vfn << PAGE_SHIFT, mfn,
> > level,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 flags);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( rc )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bre=
ak;
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 vfn +=3D 1U << order;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( !mfn_eq(mfn, INVALID_M=
FN) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mfn=
 =3D mfn_add(mfn, 1U << order);
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 left -=3D (1U << order);
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( rc )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bre=
ak;
> > +=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * The TLBs flush can be safely skipped when a=
 mapping is
> > inserted
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * as we don't allow mapping replacement (see
> > xen_pt_check_entry()).
> > +=C2=A0=C2=A0=C2=A0=C2=A0 *
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * For all the other cases, the TLBs will be f=
lushed
> > unconditionally
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * even if the mapping has failed. This is bec=
ause we may have
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * partially modified the PT. This will preven=
t any unexpected
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * behavior afterwards.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0 if ( !((flags & _PAGE_PRESENT) && !mfn_eq(mfn, INVA=
LID_MFN)) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 flush_xen_tlb_range_va(virt=
, PAGE_SIZE * nr_mfns);
>=20
> See my comments elsewhere towards TLB behavior on RISC-V. The
> indicated
> skipping of a flush is safe only if not-present entries cannot be put
> in the TLB.
>=20
> > +=C2=A0=C2=A0=C2=A0 spin_unlock(&xen_pt_lock);
> > +
> > +=C2=A0=C2=A0=C2=A0 return rc;
> > +}
> > +
> > +int map_pages_to_xen(unsigned long virt,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mfn_t mfn,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long nr_mfns,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned int flags)
> > +{
> > +=C2=A0=C2=A0=C2=A0 return xen_pt_update(virt, mfn, nr_mfns, flags);
> > +}
>=20
> Why this wrapping of two functions taking identical arguments?
map_pages_to_xen() sounds more clear regarding the way how it should be
used.

xen_pt_update() will be also used inside other functions. Look at the
example above.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 09:52:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 09:52:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769511.1180407 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZSTo-0007Oy-Ir; Thu, 01 Aug 2024 09:52:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769511.1180407; Thu, 01 Aug 2024 09:52:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZSTo-0007Or-GJ; Thu, 01 Aug 2024 09:52:16 +0000
Received: by outflank-mailman (input) for mailman id 769511;
 Thu, 01 Aug 2024 09:52: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=8r7L=PA=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZSTm-0007Ok-Kj
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 09:52:14 +0000
Received: from mail-vk1-xa34.google.com (mail-vk1-xa34.google.com
 [2607:f8b0:4864:20::a34])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b9d38029-4feb-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 11:52:13 +0200 (CEST)
Received: by mail-vk1-xa34.google.com with SMTP id
 71dfb90a1353d-4ef33a09a3aso1903529e0c.2
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 02:52:13 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a1f89bf270sm364034485a.92.2024.08.01.02.52.10
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 01 Aug 2024 02:52:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b9d38029-4feb-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722505931; x=1723110731; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=vv24Nkq+CALwNaNI0CiPnEvsAwhncXufp7Aqqd0cSX0=;
        b=SfP0VuEtms+JyyMj4rvFFrD9mX0MONyeercp2vj53uM6Ac2fRjv4P4C6DIC4pqyNtV
         1Xx+9JJs5r7L+wjdO87EguvQR6S/7YhyAOcfPjdGjDnCHaI+Hx0bRKNgzgEsu/7KmoWL
         xLOnlwNrLFugEoPYKCgOYEC0O3uF+338ptSsI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722505931; x=1723110731;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=vv24Nkq+CALwNaNI0CiPnEvsAwhncXufp7Aqqd0cSX0=;
        b=qzPCw7Z88LOngrQksvlWyWbZWzaiACyohkN6BEPuxXE3NkHyiM290OioopTVrUKbQ9
         +R/iiKO8TlJeBieqPxFz6msfd7g5dQzC/bjfuV/KdSVuIUtn6+A+99doqEiXmG3une0v
         r9BEbwJjjR0bu/ZFylfWIki7DW0jpx1+ttTox2o7Zc+QWYo3go7nvV5EdCefza00Fpp2
         Q4n9hawSYhpZGfs0zO32vRrXBpJp/pUiFLCfOToDNt+igDtfSmPq+oeWgATi6glIO/1U
         oKs71sxuBLyc4kBM6sS4aFeSfhejdnXwzKQBfYehyFPOf6FjsJufDcSb1vG4Nm3NsQZn
         j5Yw==
X-Gm-Message-State: AOJu0YzWlRTS6qM7JBIqIsrLr9j9muqJ41mB1DYO55fdXVjkzFdSVv9v
	Ckd6SxO6t8uq5/r5e9kbjqZggYT6ue0WqLcqhbViz44M/8uDnxVqck+Xrj0WRWr0yG+c89nVDTg
	a
X-Google-Smtp-Source: AGHT+IHXI+mEjXXBuGLLrbcpkku3LlHnHtNWcXP1kh0pZb4qC5TXgctR+aeEYo0vztgtpegj0VLVvw==
X-Received: by 2002:a05:6102:1629:b0:48f:db56:f038 with SMTP id ada2fe7eead31-494506d279amr2427846137.7.1722505931423;
        Thu, 01 Aug 2024 02:52:11 -0700 (PDT)
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v3] x86/dom0: delay setting SMAP after dom0 build is done
Date: Thu,  1 Aug 2024 11:52:01 +0200
Message-ID: <20240801095201.91180-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Delay setting X86_CR4_SMAP on the BSP until the domain building is done, so
that there's no need to disable SMAP.  Note however that SMAP is enabled for
the APs on bringup, as domain builder code strictly run on the BSP.  Delaying
the setting for the APs would mean having to do a callfunc IPI later in order
to set it on all the APs.

The fixes tag is to account for the wrong usage of cpu_has_smap in
create_dom0(), it should instead have used
boot_cpu_has(X86_FEATURE_XEN_SMAP).

While there also make cr4_pv32_mask __ro_after_init.

Fixes: 493ab190e5b1 ('xen/sm{e, a}p: allow disabling sm{e, a}p for Xen itself')
Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v2:
 - Change approach.
 - Add fixes tag.
---
 xen/arch/x86/setup.c | 46 ++++++++++++++++++++++++--------------------
 1 file changed, 25 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index eee20bb1753c..3f792a7a8f39 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -80,7 +80,7 @@ int8_t __initdata opt_probe_port_aliases = -1;
 boolean_param("probe-port-aliases", opt_probe_port_aliases);
 
 /* Only used in asm code and within this source file */
-unsigned long asmlinkage __read_mostly cr4_pv32_mask;
+unsigned long asmlinkage __ro_after_init cr4_pv32_mask;
 
 /* **** Linux config option: propagated to domain0. */
 /* "acpi=off":    Sisables both ACPI table parsing and interpreter. */
@@ -955,26 +955,9 @@ static struct domain *__init create_dom0(const module_t *image,
         }
     }
 
-    /*
-     * Temporarily clear SMAP in CR4 to allow user-accesses in construct_dom0().
-     * This saves a large number of corner cases interactions with
-     * copy_from_user().
-     */
-    if ( cpu_has_smap )
-    {
-        cr4_pv32_mask &= ~X86_CR4_SMAP;
-        write_cr4(read_cr4() & ~X86_CR4_SMAP);
-    }
-
     if ( construct_dom0(d, image, headroom, initrd, cmdline) != 0 )
         panic("Could not construct domain 0\n");
 
-    if ( cpu_has_smap )
-    {
-        write_cr4(read_cr4() | X86_CR4_SMAP);
-        cr4_pv32_mask |= X86_CR4_SMAP;
-    }
-
     return d;
 }
 
@@ -1907,16 +1890,25 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     if ( cpu_has_smep && opt_smep != SMEP_HVM_ONLY )
         setup_force_cpu_cap(X86_FEATURE_XEN_SMEP);
     if ( boot_cpu_has(X86_FEATURE_XEN_SMEP) )
+    {
         set_in_cr4(X86_CR4_SMEP);
+        cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;
+    }
 
     if ( !opt_smap )
         setup_clear_cpu_cap(X86_FEATURE_SMAP);
     if ( cpu_has_smap && opt_smap != SMAP_HVM_ONLY )
         setup_force_cpu_cap(X86_FEATURE_XEN_SMAP);
     if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
-        set_in_cr4(X86_CR4_SMAP);
-
-    cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;
+        /*
+         * Set SMAP on the %cr4 mask so that it's set for APs on bringup, but
+         * don't set for the BSP until domain building is done.
+         *
+         * Don't set it in cr4_pv32_mask either, until it's also set on the
+         * BSP.  Otherwise the BUG in cr4_pv32_restore would trigger for events
+         * received on the BSP.
+         */
+        mmu_cr4_features |= X86_CR4_SMAP;
 
     if ( boot_cpu_has(X86_FEATURE_FSGSBASE) )
         set_in_cr4(X86_CR4_FSGSBASE);
@@ -2048,6 +2040,18 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     if ( !dom0 )
         panic("Could not set up DOM0 guest OS\n");
 
+    /*
+     * Enable SMAP only after being done with the domain building phase, as the
+     * PV builder switches to the domain page-tables and must be run with SMAP
+     * disabled.
+     */
+    if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
+    {
+        ASSERT(mmu_cr4_features & X86_CR4_SMAP);
+        write_cr4(read_cr4() | X86_CR4_SMAP);
+        cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;
+    }
+
     heap_init_late();
 
     init_trace_bufs();
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 01 10:12:39 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 10:12:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769521.1180423 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZSnR-0002PJ-B3; Thu, 01 Aug 2024 10:12:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769521.1180423; Thu, 01 Aug 2024 10:12:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZSnR-0002P4-4F; Thu, 01 Aug 2024 10:12:33 +0000
Received: by outflank-mailman (input) for mailman id 769521;
 Thu, 01 Aug 2024 10:12:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=5eeJ=PA=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sZSnQ-0002Oc-H0
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 10:12:32 +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 8f9d9f25-4fee-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 12:12:30 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 003CBA037E;
 Thu,  1 Aug 2024 12:12:30 +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 WJolNPPUTo0l; Thu,  1 Aug 2024 12:12:29 +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 C05F4A0379;
 Thu,  1 Aug 2024 12:12:29 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sZSnN-00000001izo-0gSX; Thu, 01 Aug 2024 12:12:29 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8f9d9f25-4fee-11ef-bc02-fd08da9f4363
Date: Thu, 1 Aug 2024 12:12:29 +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 2/3] mini-os: mm: switch need_pgt() to use walk_pt()
Message-ID: <20240801101229.5htyrethv55xmh3x@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: <20240731130026.8467-1-jgross@suse.com>
 <20240731130026.8467-3-jgross@suse.com>
 <20240731212752.zd5njpd7kgoc433d@begin>
 <8fef9511-c5d0-49a9-a800-6087f03b3199@suse.com>
 <20240801073923.32s6i4enoq6qafa5@begin>
 <7fa3bca4-1ef4-4c95-bf92-de87c7c8fc96@suse.com>
 <20240801091535.rpspqy2k73tjy6ms@begin>
 <894c9552-ef2b-4255-b429-ad3df4f5c0cc@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <894c9552-ef2b-4255-b429-ad3df4f5c0cc@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Jürgen Groß, le jeu. 01 août 2024 11:25:31 +0200, a ecrit:
> On 01.08.24 11:15, Samuel Thibault wrote:
> > Jürgen Groß, le jeu. 01 août 2024 10:13:07 +0200, a ecrit:
> > > On 01.08.24 09:39, Samuel Thibault wrote:
> > > > Jürgen Groß, le jeu. 01 août 2024 07:56:36 +0200, a ecrit:
> > > > > On 31.07.24 23:27, Samuel Thibault wrote:
> > > > > > 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)?
> > > > > 
> > > > > No.
> > > > 
> > > > I don't understand: it doesn't map what I know of need_pgt and what the
> > > > existing code is doing.
> > > > 
> > > > AIKI, the point of need_pgt is to make sure there is a L1 page table
> > > > entry for a VA, and return it, so the caller can put in it at pte for a
> > > > mfn or such. In the case a PSE is met, we don't go further, and it's up
> > > > to the caller to decide what it wants to do (most often it's actually
> > > > unexpected and asserted out). In both cases, the PRESENT bit of the
> > > > pte whose address is returned does not matter, most often it's the
> > > > caller which will set it.
> > > > 
> > > > The existing code for need_pgt thus always adds page table entries down
> > > > to level1 (except if _PAGE_PSE is met, i.e. a large page was already set
> > > > up): the termination was:
> > > > 
> > > > [... walk down to level 2]
> > > 
> > > You have omitted:
> > > 
> > >         ASSERT(tab[offset] & _PAGE_PRESENT);
> > 
> > Right, that confirms that we never set PSE without PRESENT. We probably
> > want to keep that assertion in the PSE case.
> 
> Hmm, I'm not sure.
> 
> The hardware allows to have any bit set in the PTE when PRESENT isn't set.
> It will never look at any other bit in this case. Why should the software
> require something different here?

To document&check what we expect to be producing.

> > But we still want to continue walking down to level1 (or pse) even when
> > L4/L3/L2 have PRESENT.
> 
> We do that. In this case the is_leaf flag won't be set and need_pgt_func()
> will return early with the return value 0, meaning that the walk will be
> continued.

Ah, I missed that indeed, I had not integrated that is_leaf is 1 also in
the case of missing level>1 page. It'd probably be useful to emphasize
in patch 1:

+ * is_leaf: true if PTE doesn't address another page table

it should explicitly say (L1 PTE, or PSE, or not present yet)

The *pte & _PAGE_PRESENT test alone still looks surprising to the
reader, though: we don't return because the page is present, but because
we reached the last possible level that we could fill, which is either
L1, or an existing PSE. It is true that when is_leaf is 1, if it's not
L1 but present, it's necessarily a PSE, but it's clearer to the reader
to write what we meant: L1 or PSE, so something like:

if ( lvl == L1_FRAME || (*pte & _PAGE_PRESENT) ) {
    assert ( lvl == L1_FRAME || (*pte & _PAGE_PSE) ); // we are at last possible level
    [...]
}

Samuel


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 10:28:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 10:28:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769542.1180432 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZT2x-0004mD-Gj; Thu, 01 Aug 2024 10:28:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769542.1180432; Thu, 01 Aug 2024 10:28:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZT2x-0004m6-Dv; Thu, 01 Aug 2024 10:28:35 +0000
Received: by outflank-mailman (input) for mailman id 769542;
 Thu, 01 Aug 2024 10:28:34 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZT2w-0004m0-7w
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 10:28:34 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ccf2c4f2-4ff0-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 12:28:32 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5b01af9b0c9so5845379a12.3
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 03:28:32 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b6e1ab07dasm1037129a12.63.2024.08.01.03.28.07
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 03:28:07 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ccf2c4f2-4ff0-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722508112; x=1723112912; 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=0AVnc1WK7lO1o0tpjFVWEbgzYm93TD3A4f2NoYNit5I=;
        b=CuqPvICeBa1X1W8SgJT4WS9qKRskxRyaG+m5i8k1Ht+rtrjxeau5CNuLPj3kAqLqMh
         uY520AbT3VmMOTMQ+Xku7FE0olg1HexHA8FDoipHkRqyqgC4Bfv5BgIGeyf/oalcBpyq
         47LijYVDHMD/oksVPiAgeQocTO26x7CgCYS+oZkT194llmioF5/LQyTENSfolwnELEHd
         21kDnbRt3sZX2mtLsvmJgVTdUo+nGgMMAX6Y3OrGEGXM8+hTZYDobfghLmqqJ5AceLob
         bthdLCKhtbBPLYy9hmDFAPn3hmzf0Qz8u23mXtV7dRcShH0NykArxt3X0BM9txD2Mnf8
         W0oQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722508112; x=1723112912;
        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=0AVnc1WK7lO1o0tpjFVWEbgzYm93TD3A4f2NoYNit5I=;
        b=b+jlIyCloKJkJgbXd0e+ZgmZEXh5GgSFRBcn07iYZgi9ZIHOMcj/Vl65zf1bB+fGkW
         JyZRvp7pQXAE1UlAxDelxBsh1Ggiz/ClbLhwh/FNtiZbl25KwhYgJZ7ftBUzKP3J5aR1
         +sgFdP1VZXhH6iNeixkrWRe0mjwkPlWF7QEQRhCnaFpMFABiiqMwFq1USL6C6e7TBry2
         QKlvSfDEymaedjtBoQhoxd5fibylRAVAdHeaL3M1IQm5Un2hf+xtItWJQ7B11SpX4o7y
         YYiO/peCjGedzvuRTiGEB8eJqp8QQs+HHl4Ev6PAPqzm1jBmosmQ0pF187sW8tbh16Nj
         IFlQ==
X-Forwarded-Encrypted: i=1; AJvYcCXh3p57tgLJ2cWo6r4lbo5XIkpXYjJEWADNBW4Uq6B47a1jK9c911kWALHtJDgkLtaPkvxqYKB0ct5ZbGwPL3ufeDFmoEudN9uQ5Ste8Jk=
X-Gm-Message-State: AOJu0YxXe4B1EyeBHeb7YaTTi2P3v3/QhN9DTWLKZl+MwZj7cEbnwZk4
	NsUc88CJBx/gBB4m/O2FR89qPMppaC2V0IVYwUrTf4oNQOufdaSkdP5cza7Uqw==
X-Google-Smtp-Source: AGHT+IHRjQo+RGRLGWi6m7uyNkPJwzf+Co+rIIBmT+5iedQ/k/iNANEQnp/RkwXdJ/Id900TF4FQVg==
X-Received: by 2002:aa7:c690:0:b0:57c:6d1c:3cee with SMTP id 4fb4d7f45d1cf-5b6fed0b757mr1497875a12.14.1722508087592;
        Thu, 01 Aug 2024 03:28:07 -0700 (PDT)
Message-ID: <988147f4-3de2-4aae-99cc-7d0ba48b158f@suse.com>
Date: Thu, 1 Aug 2024 12:28:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/dom0: delay setting SMAP after dom0 build is done
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <20240801095201.91180-1-roger.pau@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240801095201.91180-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 01.08.2024 11:52, Roger Pau Monne wrote:
> @@ -1907,16 +1890,25 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
>      if ( cpu_has_smep && opt_smep != SMEP_HVM_ONLY )
>          setup_force_cpu_cap(X86_FEATURE_XEN_SMEP);
>      if ( boot_cpu_has(X86_FEATURE_XEN_SMEP) )
> +    {
>          set_in_cr4(X86_CR4_SMEP);
> +        cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;

Could be just "cr4_pv32_mask = X86_CR4_SMEP" now?

> +    }
>  
>      if ( !opt_smap )
>          setup_clear_cpu_cap(X86_FEATURE_SMAP);
>      if ( cpu_has_smap && opt_smap != SMAP_HVM_ONLY )
>          setup_force_cpu_cap(X86_FEATURE_XEN_SMAP);
>      if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> -        set_in_cr4(X86_CR4_SMAP);
> -
> -    cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;
> +        /*
> +         * Set SMAP on the %cr4 mask so that it's set for APs on bringup, but
> +         * don't set for the BSP until domain building is done.
> +         *
> +         * Don't set it in cr4_pv32_mask either, until it's also set on the
> +         * BSP.  Otherwise the BUG in cr4_pv32_restore would trigger for events
> +         * received on the BSP.
> +         */
> +        mmu_cr4_features |= X86_CR4_SMAP;

Don't you put APs at risk this way of triggering the BUG in cr4_pv32_restore()?
They'll have the bit set in %cr4, but the bit remains clear in cr4_pv32_mask
until much later.

> @@ -2048,6 +2040,18 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
>      if ( !dom0 )
>          panic("Could not set up DOM0 guest OS\n");
>  
> +    /*
> +     * Enable SMAP only after being done with the domain building phase, as the
> +     * PV builder switches to the domain page-tables and must be run with SMAP
> +     * disabled.
> +     */
> +    if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> +    {
> +        ASSERT(mmu_cr4_features & X86_CR4_SMAP);
> +        write_cr4(read_cr4() | X86_CR4_SMAP);
> +        cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;
> +    }

Similarly for the BSP here: If we take an NMI between setting CR4.SMAP and
setting the bit in cr4_pv32_mask, cr4_pv32_restore() would hit the BUG
there if I'm not mistaken. I further fear that switching things around won't
help either. The code you remove from create_dom0() looks to have the same
issue. The only NMI-safe sequence looks to be: Clear both bits from %cr4,
update cr4_pv32_mask as wanted, and then write %cr4 with the bits from
cr4_pv32_mask ORed in.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 10:43:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 10:43:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769552.1180441 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZTH6-0007ft-Mp; Thu, 01 Aug 2024 10:43:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769552.1180441; Thu, 01 Aug 2024 10:43:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZTH6-0007fm-Jr; Thu, 01 Aug 2024 10:43:12 +0000
Received: by outflank-mailman (input) for mailman id 769552;
 Thu, 01 Aug 2024 10:43:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZTH5-0007fg-5V
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 10:43:11 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d80b849d-4ff2-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 12:43:09 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-5a2ffc34431so5248485a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 03:43:09 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b10e20dbb8sm7148137a12.49.2024.08.01.03.43.08
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 03:43:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d80b849d-4ff2-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722508989; x=1723113789; 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=BfIK8WZ+cDVccf0b2369vE80PaWqGzpN+WawDVlfbqI=;
        b=W2aIZVvBEGvCiSgU0pLcbzSsX849RnGJ6AzGCWPpJytiLTa+PR987xoKYEl/X8ZKzk
         r73APx+yf2Wi7fDYiH5JW/C3pI4NeG1xoVvdI8JY0FW+qCTqH5P/D7NeuQ5xPNQXk5VB
         VqlQAhRhBztrWMJU/N7HLAbxeMD753tutyBVEZru9EZYY0ESLKTRAWbBnCDOdYrMWGpK
         +3Ho4vNKqHDPhuQaC1whHJkEUlvXvcnhZjdwv7Ev2SaIAt4B9qoElTtOuBXrfRT4Rg4R
         vUu/LRQUZcYFZMpd6BKdq8RRt1hwxSesWzAbJly816mp/fo3MUTmL2SJQ+4bZg+27NXG
         3ufg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722508989; x=1723113789;
        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=BfIK8WZ+cDVccf0b2369vE80PaWqGzpN+WawDVlfbqI=;
        b=hiUIAHLB2a/T16vhwKWZUCYax2HbshTDdrjO8pyY5lIsWGTZV9Rre8uYV7pZr0EAqX
         ZU/jwDb4puKD24K/j32URoB4xOgFCmOZfNeScosSH1VGT+YthmRtT9tH7rJisPLbNc4p
         7tLHlMMhoD5DPeQD3UhKcQlJ2EJs0N/PoHTrT3OJIeRckUP9WM2kwSkjmLek6yJi74z8
         YdA4aMweaKCc0URDmPZ1NU1BGIPU/YZShxpMkJiQDzWsPAPlUT4U6V31utqzsmd2ead+
         GYiO0iQ+WmvwIrI3QH2JSSYIB1fIlV/g2NaYDNxCcMXFhni6KMSJpwKoCEmQPCWoQLys
         eBXg==
X-Forwarded-Encrypted: i=1; AJvYcCUyf4xxkUCsgob0mgNaDeN3qnSfRbrI15RHtYADz9rhD2KsPqsbDqWkvWI8o2mN66GCOl40aMXbOL0fMX8G4TZEEKIsvop2IZs5qVtMTfg=
X-Gm-Message-State: AOJu0YzRQuWbmctr/aG5PdZ7Dw/Y1TtkD0RX2hqpD0MIFK5ohwueR9nh
	o9JtD6RSVFP7mmMtwL9gYjue5O/c2WIOPIq7Rpp5C1PGKBlJFnno/58MEsUwAA==
X-Google-Smtp-Source: AGHT+IFHkyTgdZ9V+YUDegOLN/ZBwZPbFxSrjXMDBRCbl89aZUbkbiMu/GpwCKWEgj6jndpzuLZs1A==
X-Received: by 2002:aa7:c04a:0:b0:5a7:464a:abf with SMTP id 4fb4d7f45d1cf-5b7008ae7d3mr1756875a12.24.1722508989067;
        Thu, 01 Aug 2024 03:43:09 -0700 (PDT)
Message-ID: <afc24e73-78e8-4088-9292-33560e599cbe@suse.com>
Date: Thu, 1 Aug 2024 12:43:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 8/9] xen/riscv: page table handling
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
 <595c7b6736d6f718bafc7a677fb13881584ce4dc.1721834549.git.oleksii.kurochko@gmail.com>
 <c2496115-5c42-4cbb-8dde-686a97259609@suse.com>
 <04b40498494cbbd0d78744d87a2310e211f26b85.camel@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: <04b40498494cbbd0d78744d87a2310e211f26b85.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 01.08.2024 11:33, oleksii.kurochko@gmail.com wrote:
> On Tue, 2024-07-30 at 16:22 +0200, Jan Beulich wrote:
>> On 24.07.2024 17:31, Oleksii Kurochko wrote:
>>> --- a/xen/arch/riscv/include/asm/page.h
>>> +++ b/xen/arch/riscv/include/asm/page.h
>>> @@ -34,6 +34,7 @@
>>>  #define PTE_LEAF_DEFAULT            (PTE_VALID | PTE_READABLE |
>>> PTE_WRITABLE)
>>>  #define PTE_TABLE                   (PTE_VALID)
>>>  
>>> +#define PAGE_HYPERVISOR_RO          (PTE_VALID | PTE_READABLE)
>>>  #define PAGE_HYPERVISOR_RW          (PTE_VALID | PTE_READABLE |
>>> PTE_WRITABLE)
>>
>> No PAGE_HYPERVISOR_RX?
> I haven't used it at the moment, so I haven't provided it.

I'm inclined to suggest to put it there right away. You will need it
rather sooner than later.

>>> +    unsigned long pbmt:2;
>>> +    unsigned long n:1;
>>> +#elif RV_STAGE1_MODE == SATP_MODE_SV48
>>> +    unsigned long ppn0:9;
>>> +    unsigned long ppn1:9;
>>> +    unsigned long ppn2:9;
>>> +    unsigned long ppn3:17;
>>> +    unsigned long rsw2:7;
>>> +    unsigned long pbmt:2;
>>> +    unsigned long n:1;
>>> +#else
>>> +#error "Add proper bits for SATP_MODE"
>>> +#endif
>>> +} pt_t;
>>
>> I can't spot a use anywhere of e.g. ppn0. Would be nice to understand
>> in
>> what contexts these bitfields are going to be used. I notice you
>> specifically
>> don't use them in e.g. pte_is_table().
> I don't use them at the moment. I just introduced them for the possible
> future using. I can re-check what of them I am using in my private
> branches and come up here only with that one which are really used.

Just to clarify: If you need any of the bitfields, then of course you
want to introduce all of them, properly named. Yet with the PTE_*
constants I'm wondering whether really you need them in addition.

>>> +/* Sanity check of the entry */
>>> +static bool xen_pt_check_entry(pte_t entry, mfn_t mfn, unsigned
>>> int level,
>>> +                               unsigned int flags)
>>
>> The comment wants extending to indicate what the parameters mean wrt
>> what
>> is going to be checked. For example, ...
>>
>>> +{
>>> +    /* Sanity check when modifying an entry. */
>>> +    if ( mfn_eq(mfn, INVALID_MFN) )
>>
>> ... it's unclear to me why incoming INVALID_MFN would indicate
>> modification
>> of an entry, whereas further down _PAGE_PRESENT supposedly indicates
>> insertion.
> The statement inside if isn't correct. It should be:
>    if ( (flags & _PAGE_PRESENT) && mfn_eq(mfn, INVALID_MFN) )
> 
> INVALID_MFN indicates modification because of how xen_pt_update() is
> used:
>    int map_pages_to_xen(unsigned long virt,
>                         mfn_t mfn,
>                         unsigned long nr_mfns,
>                         unsigned int flags)
>    {
>        return xen_pt_update(virt, mfn, nr_mfns, flags);
>    }
>    
>    int __init populate_pt_range(unsigned long virt, unsigned long nr_mfns)
>    {
>        return xen_pt_update(virt, INVALID_MFN, nr_mfns, _PAGE_PRESENT);
>    }
>    
>    int destroy_xen_mappings(unsigned long s, unsigned long e)
>    {
>        ASSERT(IS_ALIGNED(s, PAGE_SIZE));
>        ASSERT(IS_ALIGNED(e, PAGE_SIZE));
>        ASSERT(s <= e);
>        return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, 0);
>    }
>    
>    int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int
>    nf)
>    {
>        ASSERT(IS_ALIGNED(s, PAGE_SIZE));
>        ASSERT(IS_ALIGNED(e, PAGE_SIZE));
>        ASSERT(s <= e);
>        return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, nf);
>    }
> 
> The idea is the following:
>   the MFN is not valid and we are not populating page table. This means
> we either modify entry or remove an entry.

Right. My request stands though: The comment ahead of the function wants
extending to state how it is to be used correctly.

>>> +    mfn = pte_get_mfn(*entry);
>>> +
>>> +    xen_unmap_table(*table);
>>> +    *table = xen_map_table(mfn);
>>> +
>>> +    return XEN_TABLE_NORMAL_PAGE;
>>> +}
>>
>> Normal page? Not normal table?
> It just mean that this points not to super_page so potenially the in
> the next one table will have an entry that would be normal page.

Or a normal page table, if you haven't reached leaf level yet. IOW maybe
better XEN_TABLE_NORMAL, covering both cases?

>>> +    unsigned int target = arch_target;
>>> +    pte_t *table;
>>> +    /*
>>> +     * The intermediate page tables are read-only when the MFN is
>>> not valid
>>> +     * This means we either modify permissions or remove an entry.
>>> +     */
>>> +    bool read_only = mfn_eq(mfn, INVALID_MFN);
>>
>> I'm afraid I can't make a connection between the incoming MFN being
>> INVALID_MFN and intermediate tables being intended to remain
>> unaltered.
> 
> It is becuase of xen_pt_update() is used:
>    int __init populate_pt_range(unsigned long virt, unsigned long
>    nr_mfns)
>    {
>        return xen_pt_update(virt, INVALID_MFN, nr_mfns, _PAGE_PRESENT);
>    }
> So if pt is only populated then they are read_only and so they shouldn't
> be allocated what means ptes are only or being removed or modified.

Like above, such special assumptions would better be put in a comment.

>>> +int map_pages_to_xen(unsigned long virt,
>>> +                     mfn_t mfn,
>>> +                     unsigned long nr_mfns,
>>> +                     unsigned int flags)
>>> +{
>>> +    return xen_pt_update(virt, mfn, nr_mfns, flags);
>>> +}
>>
>> Why this wrapping of two functions taking identical arguments?
> map_pages_to_xen() sounds more clear regarding the way how it should be
> used.
> 
> xen_pt_update() will be also used inside other functions. Look at the
> example above.

They could as well use map_pages_to_xen() then? Or else the wrapper may
want to check (assert) that it is _not_ called with one of the special
case arguments that xen_pt_update() knows how to deal with?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 10:46:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 10:46:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769561.1180451 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZTKI-0008W0-75; Thu, 01 Aug 2024 10:46:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769561.1180451; Thu, 01 Aug 2024 10:46:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZTKI-0008Vt-4G; Thu, 01 Aug 2024 10:46:30 +0000
Received: by outflank-mailman (input) for mailman id 769561;
 Thu, 01 Aug 2024 10:46: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=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZTKG-0008Vn-Ot
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 10:46:28 +0000
Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com
 [2a00:1450:4864:20::634])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4e0e1dbd-4ff3-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 12:46:27 +0200 (CEST)
Received: by mail-ej1-x634.google.com with SMTP id
 a640c23a62f3a-a7b2dbd81e3so890472066b.1
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 03:46:27 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7d9fbe215bsm179485966b.59.2024.08.01.03.46.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 03:46:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4e0e1dbd-4ff3-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722509187; x=1723113987; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=Yfnf2cbvTIxo8WfSAHirmqemjHa941ZgfAsY0pOgQ0M=;
        b=WznavFH54llMCxVduu1EoRoNnfEWqsQxoM1XLeG2NzZJfNaHiVvAKuBjsZH06bHSGv
         A44j3U5ZyS2KuDWX/pcquef5xrnyyTg4k0uw63cFiaAo9ocx4ZFrKH+p85QARur6q0rM
         G6kEyRwuprnqFEugT+9dktbP/2+z8hrASmthcqlT4o+VxAIW4Q3RUFhDnj1wskL6M5ed
         YKFuqDSF9Xv55Rdl8SR0rHmnjR+H6eyGsAAWkJ24SbnNdbxNu20e3C0uJ1wpI5ycWqjZ
         olKTzKtuMkkZgmmXD6MqKSL8s+15+DIA3Pj2qEfcfmf5gPmh5+qG2tX5ascP5+N5TEnJ
         /KoQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722509187; x=1723113987;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=Yfnf2cbvTIxo8WfSAHirmqemjHa941ZgfAsY0pOgQ0M=;
        b=mvcnL2d2KngJOCFnj/H3nZrFj/Y/J5gvUAl59GVgCLotoBlxXTP08BJJz81fABQUKB
         DCU2hgLA+gdBm4GqLwD8dWikCIVvlHZv5tNxhJvSW6/YsDCdjm5NL3aMZctw7JnNjonQ
         aoudDZo+37oaTijUiujFPFirV0ce6vgaFWAGsdCvg3NO7g0qj4CB5I4c6WJmaZzjvAaF
         Pi1SaTIgS3iMtaPvDJ/NqJoMR7ENX175UW9NeAjqQ1BnEfqdj/TRL2x/MWS/O0FJJGcc
         kYMKqy6E45Du8dR5Xd4apNFXc/YGVDbbinDrDEFRtWdPGMgE9XBfmbEFSbR4J/O+JjCk
         PGTQ==
X-Forwarded-Encrypted: i=1; AJvYcCVDUUvOkO5XYU1/lGm5sOAe5v9QEXJL0Fzyau92tqQ5p++26yudAyi2LAiEFLhpJfqpMam/cHTWIAyBi1YQyo9I5tT6JWob23sHne1uVUA=
X-Gm-Message-State: AOJu0Ywkfj1YCP0+CGMvp6nS4dvEB4p04Wp4/Jjy0Q47+Htqz4cWw4vu
	59RhZQqeFQqYWAmePDBu2K9YWHraCqYZjrI/Nx9GAKoykvLfK3YRSE+qcqxlDw==
X-Google-Smtp-Source: AGHT+IHrrHSawVa7dVnq8LayCBA0Ed7Dg84j/KqgoGLgAFS7IGeCtIX8RDA+ORXwqW9PTGsK3+U6zA==
X-Received: by 2002:a17:907:a701:b0:a7a:a763:8438 with SMTP id a640c23a62f3a-a7daf617297mr114104766b.55.1722509187173;
        Thu, 01 Aug 2024 03:46:27 -0700 (PDT)
Message-ID: <f530ce42-a98f-4742-ab3d-a866fc9efdb9@suse.com>
Date: Thu, 1 Aug 2024 12:46:25 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/dom0: delay setting SMAP after dom0 build is done
From: Jan Beulich <jbeulich@suse.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <20240801095201.91180-1-roger.pau@citrix.com>
 <988147f4-3de2-4aae-99cc-7d0ba48b158f@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <988147f4-3de2-4aae-99cc-7d0ba48b158f@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 01.08.2024 12:28, Jan Beulich wrote:
> On 01.08.2024 11:52, Roger Pau Monne wrote:
>> @@ -2048,6 +2040,18 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
>>      if ( !dom0 )
>>          panic("Could not set up DOM0 guest OS\n");
>>  
>> +    /*
>> +     * Enable SMAP only after being done with the domain building phase, as the
>> +     * PV builder switches to the domain page-tables and must be run with SMAP
>> +     * disabled.
>> +     */
>> +    if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
>> +    {
>> +        ASSERT(mmu_cr4_features & X86_CR4_SMAP);
>> +        write_cr4(read_cr4() | X86_CR4_SMAP);
>> +        cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;
>> +    }
> 
> Similarly for the BSP here: If we take an NMI between setting CR4.SMAP and
> setting the bit in cr4_pv32_mask, cr4_pv32_restore() would hit the BUG
> there if I'm not mistaken. I further fear that switching things around won't
> help either. The code you remove from create_dom0() looks to have the same
> issue. The only NMI-safe sequence looks to be: Clear both bits from %cr4,
> update cr4_pv32_mask as wanted, and then write %cr4 with the bits from
> cr4_pv32_mask ORed in.

Argh - and that would need doing simultaneously on all CPUs, as it seems.
Getting a little too complicated, I guess.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 10:53:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 10:53:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769574.1180462 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZTQy-0001sD-Th; Thu, 01 Aug 2024 10:53:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769574.1180462; Thu, 01 Aug 2024 10:53:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZTQy-0001s6-Py; Thu, 01 Aug 2024 10:53:24 +0000
Received: by outflank-mailman (input) for mailman id 769574;
 Thu, 01 Aug 2024 10:53:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZTQw-0001rw-PQ; Thu, 01 Aug 2024 10:53:22 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZTQw-0003QU-FA; Thu, 01 Aug 2024 10:53:22 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZTQw-0005E0-4X; Thu, 01 Aug 2024 10:53:22 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZTQw-00034V-3p; Thu, 01 Aug 2024 10:53:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=G95YRpDuxXzsjWSUWqsZ2zr4MINh6thF2oqePYOzvQ0=; b=skbjLO2npvVteIwJhbFQhtauMk
	99JuB1pqhHp3NZcYNEcrwBCDbDMUT3sujU5IVipmsBOcozUniD7KyVHXR5bSAr02HV1AtSEEdI6Dh
	io4D1JNy3xVzMTc7xB3VQ+5rIE05JH9KipJFxn5vXD4e4ih3mfW744lIgQE5wGJbp8ok=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187102-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187102: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=f2dc25686b6c90fc631525e4b9e6537154ee4b0b
X-Osstest-Versions-That:
    xen=36f75d39b38d94a0d17119a4178c08de994ead23
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 10:53:22 +0000

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

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  f2dc25686b6c90fc631525e4b9e6537154ee4b0b
baseline version:
 xen                  36f75d39b38d94a0d17119a4178c08de994ead23

Last test of basis   187096  2024-08-01 01:00:22 Z    0 days
Testing same since   187102  2024-08-01 08:02:06 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alejandro Vallejo <alejandro.vallejo@cloud.com>
  Alistair Francis <alistair.francis@wdc.com>
  Christian Lindig <christian.lindig@cloud.com>
  Jan Beulich <jbeulich@suse.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Petr Beneš <w1benny@gmail.com>
  Sergiy Kibrik <Sergiy_Kibrik@epam.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   36f75d39b3..f2dc25686b  f2dc25686b6c90fc631525e4b9e6537154ee4b0b -> smoke


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 11:06:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 11:06:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769584.1180472 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZTdy-0004KX-1K; Thu, 01 Aug 2024 11:06:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769584.1180472; Thu, 01 Aug 2024 11:06:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZTdx-0004KQ-UA; Thu, 01 Aug 2024 11:06:49 +0000
Received: by outflank-mailman (input) for mailman id 769584;
 Thu, 01 Aug 2024 11:06:49 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8r7L=PA=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZTdx-0004El-9Z
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 11:06:49 +0000
Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com
 [2607:f8b0:4864:20::82d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 246989f5-4ff6-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 13:06:47 +0200 (CEST)
Received: by mail-qt1-x82d.google.com with SMTP id
 d75a77b69052e-44fe106616eso36952511cf.1
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 04:06:46 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 d75a77b69052e-44fe8413194sm67802861cf.86.2024.08.01.04.06.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 01 Aug 2024 04:06:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 246989f5-4ff6-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722510406; x=1723115206; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=Kgzb+TZ9Po27HM+BnMzUWmZDEDD/y3UpKctRfE6X46E=;
        b=rDzl0IBXBX9YdeYRtoyZOXQn7LYNb5JySoE2TRQlldHEoy4Ogqhk4iSvXkOBpQ4gPt
         7IVncs3IY8PceYJjfCT+hDVzWT8TlRrMYMmOHP9jSfWZLTvFjhnG34RnfrftKZRtXq/W
         Wdy5DEVunNnE4el0qdUfWwV+aBHekLQwR7MWs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722510406; x=1723115206;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Kgzb+TZ9Po27HM+BnMzUWmZDEDD/y3UpKctRfE6X46E=;
        b=IvouzHRjKe7MH/14iR4u6dvnR+l35bSX0q7U+3hXf03pORpa3HzfBZ4Bo4ieN5knoy
         CBzTf4R1fZsbNYJmVUx5gOS9Yg+RFaBlOnOgoxfTeMjhZNIKb9qsoXYk/ngXE4qILxp6
         0sWxKPl2smOazqpZvvafx/3Ipak7tmDYgJe5EelhnOXmj1xdNlJD4yLH77hWJXZIDWm4
         ezv8jHCu5VO0JkTpuE8c5d3S0uvdvaiMI2yAdMmuWCi8kKlUE4dva7666OUOcJMBvhOl
         BDNrpewL0xVibzlQ7duZ8aaGpYgw2TeHuu7XvvHzUj3ykuB46TQcjXr0aumOjOqagjPi
         s8aA==
X-Gm-Message-State: AOJu0YwvnUsOET1JaG0Mca2w8L+3x/wl3c36weaNej9SMRiMlPsW5BkJ
	4UUH7e4ZbJzBL7Tc4pU8sr0gxG9BUJS4+9eTq3BLQpqYJTiAMY2rErXmH0cKBIU=
X-Google-Smtp-Source: AGHT+IH85pGQTbTArrDdVy66lv03MA+OqIanZkWK7tzAg9o4v6DqNGczKOi/yaPDY8CCcvhJs1+8YQ==
X-Received: by 2002:ac8:7d47:0:b0:44f:f7be:4d3e with SMTP id d75a77b69052e-4514f9bd62bmr23416611cf.5.1722510405543;
        Thu, 01 Aug 2024 04:06:45 -0700 (PDT)
Date: Thu, 1 Aug 2024 13:06:43 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jiqian Chen <Jiqian.Chen@amd.com>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	Juergen Gross <jgross@suse.com>,
	"Daniel P . Smith" <dpsmith@apertussolutions.com>,
	Stewart Hildebrand <Stewart.Hildebrand@amd.com>,
	Huang Rui <ray.huang@amd.com>
Subject: Re: [XEN PATCH v12 4/7] x86/domctl: Add hypercall to set the access
 of x86 gsi
Message-ID: <ZqtsQwZNyFzflDQt@macbook>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-5-Jiqian.Chen@amd.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20240708114124.407797-5-Jiqian.Chen@amd.com>

On Mon, Jul 08, 2024 at 07:41:21PM +0800, Jiqian Chen wrote:
> Some type of domains don't have PIRQs, like PVH, it doesn't do
> PHYSDEVOP_map_pirq for each gsi. When passthrough a device
> to guest base on PVH dom0, callstack
> pci_add_dm_done->XEN_DOMCTL_irq_permission will fail at function
> domain_pirq_to_irq, because PVH has no mapping of gsi, pirq and
> irq on Xen side.
> What's more, current hypercall XEN_DOMCTL_irq_permission requires
> passing in pirq to set the access of irq, it is not suitable for
> dom0 that doesn't have PIRQs.
> 
> So, add a new hypercall XEN_DOMCTL_gsi_permission to grant/deny
> the permission of irq(translate from x86 gsi) to dumU when dom0
                       ^ missing space, and s/translate/translated/

> has no PIRQs.
> 
> Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
> Signed-off-by: Huang Rui <ray.huang@amd.com>
> Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
> ---
> CC: Daniel P . Smith <dpsmith@apertussolutions.com>
> Remaining comment @Daniel P . Smith:
> +        ret = -EPERM;
> +        if ( !irq_access_permitted(currd, irq) ||
> +             xsm_irq_permission(XSM_HOOK, d, irq, access_flag) )
> +            goto gsi_permission_out;
> Is it okay to issue the XSM check using the translated value, 
> not the one that was originally passed into the hypercall?

FWIW, I don't see the GSI -> IRQ translation much different from the
pIRQ -> IRQ translation done by pirq_access_permitted(), which is also
ahead of the xsm check.

> ---
>  xen/arch/x86/domctl.c              | 32 ++++++++++++++++++++++++++++++
>  xen/arch/x86/include/asm/io_apic.h |  2 ++
>  xen/arch/x86/io_apic.c             | 17 ++++++++++++++++
>  xen/arch/x86/mpparse.c             |  5 ++---
>  xen/include/public/domctl.h        |  9 +++++++++
>  xen/xsm/flask/hooks.c              |  1 +
>  6 files changed, 63 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
> index 9190e11faaa3..4e9e4c4cfed3 100644
> --- a/xen/arch/x86/domctl.c
> +++ b/xen/arch/x86/domctl.c
> @@ -36,6 +36,7 @@
>  #include <asm/xstate.h>
>  #include <asm/psr.h>
>  #include <asm/cpu-policy.h>
> +#include <asm/io_apic.h>
>  
>  static int update_domain_cpu_policy(struct domain *d,
>                                      xen_domctl_cpu_policy_t *xdpc)
> @@ -237,6 +238,37 @@ long arch_do_domctl(
>          break;
>      }
>  
> +    case XEN_DOMCTL_gsi_permission:
> +    {
> +        int irq;
> +        unsigned int gsi = domctl->u.gsi_permission.gsi;
> +        uint8_t access_flag = domctl->u.gsi_permission.access_flag;
> +
> +        /* Check all bits and pads are zero except lowest bit */
> +        ret = -EINVAL;
> +        if ( access_flag & ( ~XEN_DOMCTL_GSI_PERMISSION_MASK ) )
                              ^ unneeded parentheses and spaces.
> +            goto gsi_permission_out;
> +        for ( i = 0; i < ARRAY_SIZE(domctl->u.gsi_permission.pad); ++i )
> +            if ( domctl->u.gsi_permission.pad[i] )
> +                goto gsi_permission_out;
> +
> +        if ( gsi > highest_gsi() || (irq = gsi_2_irq(gsi)) <= 0 )

FWIW, I would place the gsi > highest_gsi() check inside gsi_2_irq().
There's no reason to open-code it here, and it could help other
users of gsi_2_irq().  The error code could also be ERANGE here
instead of EINVAL IMO.

> +            goto gsi_permission_out;
> +
> +        ret = -EPERM;
> +        if ( !irq_access_permitted(currd, irq) ||
> +             xsm_irq_permission(XSM_HOOK, d, irq, access_flag) )
> +            goto gsi_permission_out;
> +
> +        if ( access_flag )
> +            ret = irq_permit_access(d, irq);
> +        else
> +            ret = irq_deny_access(d, irq);
> +
> +    gsi_permission_out:
> +        break;

Why do you need a label when it just contains a break?  Instead of the
goto gsi_permission_out just use break directly.

> +    }
> +
>      case XEN_DOMCTL_getpageframeinfo3:
>      {
>          unsigned int num = domctl->u.getpageframeinfo3.num;
> diff --git a/xen/arch/x86/include/asm/io_apic.h b/xen/arch/x86/include/asm/io_apic.h
> index 78268ea8f666..7e86d8337758 100644
> --- a/xen/arch/x86/include/asm/io_apic.h
> +++ b/xen/arch/x86/include/asm/io_apic.h
> @@ -213,5 +213,7 @@ unsigned highest_gsi(void);
>  
>  int ioapic_guest_read( unsigned long physbase, unsigned int reg, u32 *pval);
>  int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val);
> +int mp_find_ioapic(int gsi);
> +int gsi_2_irq(int gsi);
>  
>  #endif
> diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
> index d2a313c4ac72..5968c8055671 100644
> --- a/xen/arch/x86/io_apic.c
> +++ b/xen/arch/x86/io_apic.c
> @@ -955,6 +955,23 @@ static int pin_2_irq(int idx, int apic, int pin)
>      return irq;
>  }
>  
> +int gsi_2_irq(int gsi)

unsigned int for gsi.

> +{
> +    int ioapic, pin, irq;

pin would better be unsigned int also.

> +
> +    ioapic = mp_find_ioapic(gsi);
> +    if ( ioapic < 0 )
> +        return -EINVAL;
> +
> +    pin = gsi - io_apic_gsi_base(ioapic);
> +
> +    irq = apic_pin_2_gsi_irq(ioapic, pin);
> +    if ( irq <= 0 )
> +        return -EINVAL;
> +
> +    return irq;
> +}
> +
>  static inline int IO_APIC_irq_trigger(int irq)
>  {
>      int apic, idx, pin;
> diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c
> index d8ccab2449c6..7786a3337760 100644
> --- a/xen/arch/x86/mpparse.c
> +++ b/xen/arch/x86/mpparse.c
> @@ -841,8 +841,7 @@ static struct mp_ioapic_routing {
>  } mp_ioapic_routing[MAX_IO_APICS];
>  
>  
> -static int mp_find_ioapic (
> -	int			gsi)
> +int mp_find_ioapic(int gsi)

If you are changing this, you might as well make the gsi parameter
unsigned int.

>  {
>  	unsigned int		i;
>  
> @@ -914,7 +913,7 @@ void __init mp_register_ioapic (
>  	return;
>  }
>  
> -unsigned __init highest_gsi(void)
> +unsigned highest_gsi(void)
>  {
>  	unsigned x, res = 0;
>  	for (x = 0; x < nr_ioapics; x++)
> diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
> index 2a49fe46ce25..877e35ab1376 100644
> --- a/xen/include/public/domctl.h
> +++ b/xen/include/public/domctl.h
> @@ -464,6 +464,13 @@ struct xen_domctl_irq_permission {
>      uint8_t pad[3];
>  };
>  
> +/* XEN_DOMCTL_gsi_permission */
> +struct xen_domctl_gsi_permission {
> +    uint32_t gsi;
> +#define XEN_DOMCTL_GSI_PERMISSION_MASK 1

IMO this would be better named GRANT or similar, maybe something like:

/* Low bit used to signal grant/revoke action. */
#define XEN_DOMCTL_GSI_REVOKE 0
#define XEN_DOMCTL_GSI_GRANT  1

> +    uint8_t access_flag;    /* flag to specify enable/disable of x86 gsi access */
> +    uint8_t pad[3];

We might as well declare the flags field as uint32_t and avoid the
padding field.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 11:28:39 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 11:28:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769596.1180482 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZTyy-0007m4-MB; Thu, 01 Aug 2024 11:28:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769596.1180482; Thu, 01 Aug 2024 11:28:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZTyy-0007lx-JU; Thu, 01 Aug 2024 11:28:32 +0000
Received: by outflank-mailman (input) for mailman id 769596;
 Thu, 01 Aug 2024 11:28:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZTyx-0007ln-3u; Thu, 01 Aug 2024 11:28:31 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZTyw-00041F-Rm; Thu, 01 Aug 2024 11:28:30 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZTyw-0007Qk-If; Thu, 01 Aug 2024 11:28:30 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZTyw-0007fh-IB; Thu, 01 Aug 2024 11:28:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=0S1ktA9qqVOiEc34yGks0xTDtE3ufY/wb+cJAEc/llE=; b=I8L4m37sVhZTDf9+PcKyds3qR0
	VvFMBy+V23PKvE2hCJJCNjdg22FMBorOtS0t+/xuqptjQxWTbJxvA51iInxyFaPnD3C4Dj5YlCjee
	KUqOeq6qlCFNdc+K9JfEqqr804z/H3f9F4aCfhA7FIF0Ql1ynqF8lXspohd6k4KZJSNY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187104-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187104: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=85fad9912c860927aec3953e213662ea1f397c23
X-Osstest-Versions-That:
    ovmf=7e5a5ae154cb4c1e5c3d148a2ba21cc2764e96e6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 11:28:30 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 85fad9912c860927aec3953e213662ea1f397c23
baseline version:
 ovmf                 7e5a5ae154cb4c1e5c3d148a2ba21cc2764e96e6

Last test of basis   187100  2024-08-01 05:13:19 Z    0 days
Testing same since   187104  2024-08-01 08:43:23 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Sachin Ganesh <sachinganesh@ami.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   7e5a5ae154..85fad9912c  85fad9912c860927aec3953e213662ea1f397c23 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 11:36:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 11:36:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769608.1180491 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZU6X-00012P-EF; Thu, 01 Aug 2024 11:36:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769608.1180491; Thu, 01 Aug 2024 11:36:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZU6X-00012I-BH; Thu, 01 Aug 2024 11:36:21 +0000
Received: by outflank-mailman (input) for mailman id 769608;
 Thu, 01 Aug 2024 11:36:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZU6V-00011t-OW
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 11:36:19 +0000
Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com
 [2a00:1450:4864:20::62d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 44bafc1d-4ffa-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 13:36:18 +0200 (CEST)
Received: by mail-ej1-x62d.google.com with SMTP id
 a640c23a62f3a-a7ab63a388bso510317966b.1
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 04:36:18 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5ac60918cb4sm10069685a12.0.2024.08.01.04.36.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 04:36:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 44bafc1d-4ffa-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722512178; x=1723116978; 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=iawzlA4G7XRT8YTrL3OcBNppLD/qXnwZmoNYDWYsy80=;
        b=M9QhCF/0aM33t4CSaGPLHIe9oT1riUH0PfFbZ4icKDwC3tEIJ7Fm91Q/r02ptRRfLc
         XMr0g4ANBqhZfpFx152mdqdxvrcGado2QhBahfyGpap85443XNUDBSftHffMavRQ/lzP
         W0svDLy5O+wNXodEa2JD4oP0GLEI39oSEg7aDoe263ylB4t+3NYJZVzww3XAgTlstxME
         gng3bSJmflPj5lWBseItoKD8KiUUNt2yvRjFg5clbxPRuxb1eGCKjbtGiVp8mcenqTjJ
         aUnYsvbxdA0unVfWrzV1TcNPHFFKD+KMLFOhuKvh1XZOiLeuKJ/2KYH2QZYD4eMNbqp5
         5VEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722512178; x=1723116978;
        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=iawzlA4G7XRT8YTrL3OcBNppLD/qXnwZmoNYDWYsy80=;
        b=Xi6o+rdYVn/YXdvpG7fvXstIc1+nxmvOEa6QGgsM4Fdgho6/RKNeWn1PDlV3iisMsr
         6WOuPSvV231Do1O0A8CkYwT0rgN6e793mQXDZsMp3OQd3YPvArRxwygaF1uQOBHZbOp4
         BFEEW896zRy5AmUPon1x3AA/hJKbX+VFqnr+XuYLQb+kfo8+vNzRiAOnxACtRjL60jy4
         2s7dy6m/xnjOspt/0tdHfWmjD3FxrlErLVZ2J/W4J97cJjW14jU4jlX9MY68lYxhrRqT
         gV14Wc9RKz+/7oHWbDrwXSueI535kYQZq5P4akcah/Vz2Ru5zLqO49dzNjC3gQkDAZ7X
         qu5w==
X-Gm-Message-State: AOJu0YwFqwhw4BGixDTXqOMNuAmgt7MqCGduyuJuNkI22bwVN2VIESRF
	Jds7VBYjGSCBuuGhafuh8DR8lk8x13NWlJaO5jijr0cozIEnq7v91Z6AvN49rw==
X-Google-Smtp-Source: AGHT+IHPWO9bAMp5hBjL+QJejIqFeeHuJXTI9RAtV6gi6E8vckSUqYVigfTLCxXZnpxoYve5GNQ4eQ==
X-Received: by 2002:a05:6402:148a:b0:5af:758a:693b with SMTP id 4fb4d7f45d1cf-5b6fe92514amr1772177a12.4.1722512177926;
        Thu, 01 Aug 2024 04:36:17 -0700 (PDT)
Message-ID: <ec95b413-519d-46a4-be41-ebb6a375612a@suse.com>
Date: Thu, 1 Aug 2024 13:36:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v12 4/7] x86/domctl: Add hypercall to set the access
 of x86 gsi
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "Daniel P . Smith" <dpsmith@apertussolutions.com>
Cc: xen-devel@lists.xenproject.org, Andrew Cooper
 <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>, Juergen Gross <jgross@suse.com>,
 Stewart Hildebrand <Stewart.Hildebrand@amd.com>,
 Huang Rui <ray.huang@amd.com>, Jiqian Chen <Jiqian.Chen@amd.com>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-5-Jiqian.Chen@amd.com> <ZqtsQwZNyFzflDQt@macbook>
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: <ZqtsQwZNyFzflDQt@macbook>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 01.08.2024 13:06, Roger Pau Monné wrote:
> On Mon, Jul 08, 2024 at 07:41:21PM +0800, Jiqian Chen wrote:
>> Remaining comment @Daniel P . Smith:
>> +        ret = -EPERM;
>> +        if ( !irq_access_permitted(currd, irq) ||
>> +             xsm_irq_permission(XSM_HOOK, d, irq, access_flag) )
>> +            goto gsi_permission_out;
>> Is it okay to issue the XSM check using the translated value, 
>> not the one that was originally passed into the hypercall?
> 
> FWIW, I don't see the GSI -> IRQ translation much different from the
> pIRQ -> IRQ translation done by pirq_access_permitted(), which is also
> ahead of the xsm check.

The question (which I raised originally) isn't an ordering one, but an
auditing one: Is it okay to pass the XSM hook a value that isn't what
was passed into the hypercall?

And Daniel, please, can you finally take a moment to help here, in your
role as XSM maintainer? Elsewhere you complained you weren't Cc-ed or
asked; now that you were asked, you haven't responded for weeks if not
months.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 11:39:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 11:39:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769619.1180502 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZU9G-0001pd-Ul; Thu, 01 Aug 2024 11:39:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769619.1180502; Thu, 01 Aug 2024 11:39:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZU9G-0001pW-Rx; Thu, 01 Aug 2024 11:39:10 +0000
Received: by outflank-mailman (input) for mailman id 769619;
 Thu, 01 Aug 2024 11:39: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=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZU9F-0001pQ-Aw
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 11:39:09 +0000
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com
 [2a00:1450:4864:20::132])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a947ca2f-4ffa-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 13:39:07 +0200 (CEST)
Received: by mail-lf1-x132.google.com with SMTP id
 2adb3069b0e04-52f008aa351so9941080e87.0
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 04:39:07 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5ac64eb3aacsm10013068a12.64.2024.08.01.04.39.06
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 04:39:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a947ca2f-4ffa-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722512347; x=1723117147; 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=M05uZ0koUYcpV7q+n1GeR7wzIafZ+gDMPMR1VwSr0rY=;
        b=NMKKyt1Q51xtgiIGqWgx1r+HcdUOZDuRAacbfBJWL5WoSdEOzBJZV/blXXOPAfud8E
         zGWWaGmsFd9e4Gr9rSkGmdhc5UC/RyHWEinf9zwr7Xru77tk4YkdByOu4DfmwQXOPSQm
         hc8DU3KswgcVpFRWn+FMiKyehk56zUsiH/naZ7rEFU3nuF6GmjLLT+Qc7us8hnPhCwLo
         lvXy95OL68rS8F8U6osQZpAnqwlgZ1pjO3bQbOEZtgKRqKS6CIR0tkrOPhJOzPCkHyEz
         fJbMEp7/l/zabMDFoOkpwsje9pV09him1OIXpNsFADchr6PeDAhvuQISiPPQyDe5CUWJ
         3wZA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722512347; x=1723117147;
        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=M05uZ0koUYcpV7q+n1GeR7wzIafZ+gDMPMR1VwSr0rY=;
        b=A/dbs0rmNi23cJtczH6gLn9dTiNuyhCQlTpbRu24OJUDxHHHCBnbVhQ+btFLtaGa+u
         lb78YOOAeVscy7p/Xl43ksFamQuVZ2L/W4jH1W8KWYcFrHsIlcHBJnb5UzMgtNT2WvY3
         BhqBWUG2HTm6aVbj5bN5IHooD3L5UHNTQ9HqHRKbhWpY4nE2PSDbjGR9tjjqYAgo7ZSo
         45hPFnxt/E1KNOYPnAw2MqkeO/2YEVIDOwHpeo0fdztdqctvHP66ymR/sJJQLHZXGkBQ
         y2qqsPPXVXOk1z8kQM00sKHOSKnGO2BI9eJpFfIi48kJWYnKHamhuOm5Y1GCEe7am3Xz
         WplA==
X-Forwarded-Encrypted: i=1; AJvYcCXrToHoyqM/RYJTk2eLlS236RYrHeIUCV4jUsAxFsUuzguD0SV42efs75Cx5FxFIhMbJWrIcwpSeyyrG35JFU5jrufFs9nT3ZSYVQTWxWQ=
X-Gm-Message-State: AOJu0YwNQxRqUJdjNVrPJ53VP1tngggM78maUR7NB4gK6MFWwZKxXa8E
	vYTJ7ZinGl7kb7bFqpEMxH7RdlvmsY0ujqT+cQRSZzQFIQ4YoMcmE0baQqpTug==
X-Google-Smtp-Source: AGHT+IGk6g3SKmz43QaJz4xZBlqonYejxLu8OjGD0P9YlAiIhfZPO6LMqceEgoyTR6CO+QO/OekXbA==
X-Received: by 2002:a05:6512:1c9:b0:52c:e030:144e with SMTP id 2adb3069b0e04-530b61f5572mr1137420e87.47.1722512346583;
        Thu, 01 Aug 2024 04:39:06 -0700 (PDT)
Message-ID: <b9356c61-d927-45cf-857d-e9c80e9587eb@suse.com>
Date: Thu, 1 Aug 2024 13:39:05 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v5 13/13] x86/hvm: make AMD-V and Intel VT-x support
 configurable
To: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Cc: Xenia Ragiadakou <burzalodowa@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>, xen-devel@lists.xenproject.org
References: <cover.1722333634.git.Sergiy_Kibrik@epam.com>
 <827008e4af26814e4cd4bf6abbb92c77fc136aa8.1722333634.git.Sergiy_Kibrik@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <827008e4af26814e4cd4bf6abbb92c77fc136aa8.1722333634.git.Sergiy_Kibrik@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 30.07.2024 12:41, Sergiy Kibrik wrote:
> --- a/xen/arch/x86/Kconfig
> +++ b/xen/arch/x86/Kconfig
> @@ -123,11 +123,25 @@ config HVM
>  	  If unsure, say Y.
>  
>  config AMD_SVM
> -	def_bool HVM
> +	bool "AMD-V" if EXPERT
> +	depends on HVM
> +	default HVM
> +	help
> +	  Enables virtual machine extensions on platforms that implement the
> +	  AMD Virtualization Technology (AMD-V).
> +	  If your system includes a processor with AMD-V support, say Y.
> +	  If in doubt, say Y.
>  
>  config INTEL_VMX
> -	def_bool HVM
> +	bool "Intel VT-x" if EXPERT
> +	depends on HVM
> +	default HVM
>  	select ARCH_IOREQ_COMPLETION
> +	help
> +	  Enables virtual machine extensions on platforms that implement the
> +	  Intel Virtualization Technology (Intel VT-x).
> +	  If your system includes a processor with Intel VT-x support, say Y.
> +	  If in doubt, say Y.

Despite my earlier ack: It appears to make little sense to use "default HVM"
when there's also "depends on HVM". "default y" would be more clear imo, even
if just slightly.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 11:44:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 11:44:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769630.1180512 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZUEd-0003Ji-HZ; Thu, 01 Aug 2024 11:44:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769630.1180512; Thu, 01 Aug 2024 11:44:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZUEd-0003Jb-Eg; Thu, 01 Aug 2024 11:44:43 +0000
Received: by outflank-mailman (input) for mailman id 769630;
 Thu, 01 Aug 2024 11:44:42 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZUEc-0003JS-AV
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 11:44:42 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6fd05351-4ffb-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 13:44:40 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-52f04c29588so11845412e87.3
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 04:44: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
 4fb4d7f45d1cf-5ac63590d1esm10074637a12.27.2024.08.01.04.44.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 04:44:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6fd05351-4ffb-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722512680; x=1723117480; 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=00QZRtr/T91jStgL82WKO7QSvTC88plVV4PvbeL6ISI=;
        b=UVXSDzSbkp84+M8Nk/WwJaPu9GDPKbsM31RTCfTLuMVSFk34q4ocXTanya/K+0vOV+
         WYNFYWaAP8M70tOmW8+ru1KCig0E5tvo7TbRxZ2n5b7DXN4/v1jck7lZXfly5rdIeooV
         LQMzHzsoct9zryFYR/H3hRYFUrvXtIKagMrvpLrLK51anutu9vRlpUp4g3gVLq11o/uQ
         9G/vterPJcxo6fa6Y82oC5Z5AWO7Awwt7c5f1ue3VRu81O2PQEB9+Kzx7YSiloZOHgk/
         sp5CxSNIPNQsXlNAYcHU/OphPWNFwlutr4mpFx8Vp1Uh0efTVO1eO7vrF1fF0hOAFu/D
         aXdg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722512680; x=1723117480;
        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=00QZRtr/T91jStgL82WKO7QSvTC88plVV4PvbeL6ISI=;
        b=rfBt48Doj2xYZdZ9s5c7Fpbc8f0MhsMaasl9BhcYNyyTW8iijDCZmA4PEf1Z7jYCby
         CMyaErfgkG1FONtK68uzqi8gxwFumcC58trl2vXHjNfHlVATV93uuGkQBF31jWPf8dR1
         sjbEiGt/QN/sSdgNKscz/fTAZhvqIEP84IEUHOIXglDRec59rkRCAnqTheCJLff4u+yz
         sZQW6pOIxJJGLWnEwWUnToTNFfJmizS6JgF9H0Yx4KvytFs4IuyEgU/VpAzk2Nk9FmaV
         yhWj9yuECiTIxS2ENptSr1WaB3A6pi++oBhD7+3tA5oIRRN32AX2GYG3qB03JrduQ0km
         j0aw==
X-Forwarded-Encrypted: i=1; AJvYcCVjS0x+bcot+Vr73cD+NXY4xfmZ5XuI8fikTX0RBUrumb2HoMJ5ZTQHH8gKdUM68eivMXv7oSTNWACkSoZw7/TPw4bQAUwC3JXrzBlfY+g=
X-Gm-Message-State: AOJu0YzY27rNS5OYaoUcnfM+upNHLSlCQt4Phb/ZMXs3BtDskTo06vsB
	nvAeWzuJcW+uqucFXuy/Ahntf69ADC+sV3NuHQTICoFQDUmS1Q1aAkucovoCRA==
X-Google-Smtp-Source: AGHT+IEh6rj0J6YsMcRD+BGlscpjPy3NvQd9edMfBR+7WITAcEoy79ycio2HVZ3SkN9YtGKztLH96Q==
X-Received: by 2002:ac2:5ec1:0:b0:52d:b150:b9b3 with SMTP id 2adb3069b0e04-530b61bca34mr1161200e87.32.1722512679579;
        Thu, 01 Aug 2024 04:44:39 -0700 (PDT)
Message-ID: <a2ad6557-8162-4f06-84c6-b79c049cb326@suse.com>
Date: Thu, 1 Aug 2024 13:44:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v11 2/5] xen/riscv: introduce decode_cause() stuff
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
 xen-devel@lists.xenproject.org
References: <cover.1721731887.git.oleksii.kurochko@gmail.com>
 <335b0b49720b3524b6c89c5ce62d3377a4bb1fb8.1721731887.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <335b0b49720b3524b6c89c5ce62d3377a4bb1fb8.1721731887.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 24.07.2024 17:31, Oleksii Kurochko wrote:
> The patch introduces stuff needed to decode a reason of an
> exception.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> Acked-by: Alistair Francis <alistair.francis@wdc.com>
> Acked-by: Jan Beulich <jbeulich@suse.com>
> ---
> Changes in V11:
>  - Nothing changed. Only rebase.
> ---
> Changes in V10:
>  - add Acked-by: Jan Beulich <jbeulich@suse.com>
> ---
> Changes in V9:
>  - This patch was reverted as breaks both release and randconfig builds.
>    I don't see the failures now. ( probably it was because of printk usage
>    which was not ready at that moment ).
>  - drop inclusion of <asm/csr.h> and <asm/early_printk.h>
>  - add <asm/riscv_encoding.h> for CAUSE_* in decode_trap_cause().
> ---
> Changes in V8:
>   - fix typo in return string from decode_reserved_interrupt_cause
>   - add Acked-by: Alistair Francis <alistair.francis@wdc.com>
> ---
> Changes in V7:
>  - Nothing changed. Only rebase.
> ---
> Changes in V6:
>  - Remove usage of LINK_TO_LOAD() due to the MMU being enabled first.
>  - Change early_printk() to printk()
> ---
> Changes in V5:
>   - Remove <xen/error.h> from riscv/traps/c as nothing would require
>     inclusion.
>   - decode_reserved_interrupt_cause(), decode_interrupt_cause(), decode_cause, do_unexpected_trap()
>     were made as static they are expected to be used only in traps.c
>   - use LINK_TO_LOAD() for addresses which can be linker time relative.
> ---
> Changes in V4:
>   - fix string in decode_reserved_interrupt_cause()
> ---
> Changes in V3:
>   - Nothing changed
> ---
> Changes in V2:
>   - Make decode_trap_cause() more optimization friendly.
>   - Merge the pathc which introduces do_unexpected_trap() to the current one.
> ---
>  xen/arch/riscv/traps.c | 80 +++++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 79 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
> index 5415cf8d90..37cec40dfa 100644
> --- a/xen/arch/riscv/traps.c
> +++ b/xen/arch/riscv/traps.c
> @@ -9,13 +9,91 @@
>  #include <xen/sched.h>
>  
>  #include <asm/processor.h>
> +#include <asm/riscv_encoding.h>
>  #include <asm/traps.h>
>  
> -void do_trap(struct cpu_user_regs *cpu_regs)
> +static const char *decode_trap_cause(unsigned long cause)
> +{
> +    static const char *const trap_causes[] = {
> +        [CAUSE_MISALIGNED_FETCH] = "Instruction Address Misaligned",
> +        [CAUSE_FETCH_ACCESS] = "Instruction Access Fault",
> +        [CAUSE_ILLEGAL_INSTRUCTION] = "Illegal Instruction",
> +        [CAUSE_BREAKPOINT] = "Breakpoint",
> +        [CAUSE_MISALIGNED_LOAD] = "Load Address Misaligned",
> +        [CAUSE_LOAD_ACCESS] = "Load Access Fault",
> +        [CAUSE_MISALIGNED_STORE] = "Store/AMO Address Misaligned",
> +        [CAUSE_STORE_ACCESS] = "Store/AMO Access Fault",
> +        [CAUSE_USER_ECALL] = "Environment Call from U-Mode",
> +        [CAUSE_SUPERVISOR_ECALL] = "Environment Call from S-Mode",
> +        [CAUSE_MACHINE_ECALL] = "Environment Call from M-Mode",
> +        [CAUSE_FETCH_PAGE_FAULT] = "Instruction Page Fault",
> +        [CAUSE_LOAD_PAGE_FAULT] = "Load Page Fault",
> +        [CAUSE_STORE_PAGE_FAULT] = "Store/AMO Page Fault",
> +        [CAUSE_FETCH_GUEST_PAGE_FAULT] = "Instruction Guest Page Fault",
> +        [CAUSE_LOAD_GUEST_PAGE_FAULT] = "Load Guest Page Fault",
> +        [CAUSE_VIRTUAL_INST_FAULT] = "Virtualized Instruction Fault",
> +        [CAUSE_STORE_GUEST_PAGE_FAULT] = "Guest Store/AMO Page Fault",
> +    };
> +
> +    if ( cause < ARRAY_SIZE(trap_causes) && trap_causes[cause] )
> +        return trap_causes[cause];
> +    return "UNKNOWN";
> +}

While I committed this as-is, two more points: First, as soon any any
such array access becomes potentially reachable because of guest
activity, it wants to use array_access_nospec() or alike. Second, and
somewhat related, it may be desirable to avoid such double accesses.
Hopefully the compiler will do that for you. But

    const char *res = cause < ARRAY_SIZE(trap_causes) ? trap_causes[cause]
                                                      : NULL;

    return res ?: "UNKNOWN";

might be worthwhile anyway.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 11:55:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 11:55:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769639.1180522 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZUOk-0005Qg-HV; Thu, 01 Aug 2024 11:55:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769639.1180522; Thu, 01 Aug 2024 11:55:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZUOk-0005QZ-Ci; Thu, 01 Aug 2024 11:55:10 +0000
Received: by outflank-mailman (input) for mailman id 769639;
 Thu, 01 Aug 2024 11:55:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dsN4=PA=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sZUOi-0005QT-UK
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 11:55:09 +0000
Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com
 [2a00:1450:4864:20::231])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e5f22581-4ffc-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 13:55:08 +0200 (CEST)
Received: by mail-lj1-x231.google.com with SMTP id
 38308e7fff4ca-2ef23d04541so81534011fa.2
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 04:55:08 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f03cf4f790sm22831661fa.55.2024.08.01.04.55.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 01 Aug 2024 04:55:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e5f22581-4ffc-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722513307; x=1723118107; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=aoP6Mp+aXlnwOtK5jvVI7V9PqcxLBUWIZ6NNA5dKuLw=;
        b=CpJxg2IJ0DWf6kzRdphuXF2FRTIs+Uybq/RgvlHk7iiJsjxjUdJBDeRzRrUWogWRg1
         jMpK5gXkotNGs1U+urbWLiJnRBoizaoXTyiXBHOsmqyo7E2gtjRwv0Kd1EO/8KxavkoW
         AF6Xk88TYkh1kRy4hJd8o/JiqjXsyGP+mJRxMwyG+VTEzWAi+7b+EgzFVDNJuurCb4Yi
         kwJsRJw3VwFdyqh7CMKnKs/phB4nCJ6epKQufs0I1Oh5djHtc537EdH3rVUTcHhS5y7+
         m/4dhNwwxP10ZT448MUSyutQMz0N2hLKCAAQ1PAO0W+W3gInj0cbSqOm2tZ/esduJxQS
         odsA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722513307; x=1723118107;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=aoP6Mp+aXlnwOtK5jvVI7V9PqcxLBUWIZ6NNA5dKuLw=;
        b=Aeu/rdc5wwv4eOZ1kodg/Tr9YYpwXaK0VsNuLEgh5xz4RZrApRNLRcpDA/y2NS1ShH
         eRz9Rq7ECZNtjT8AZhEp8S5QMdMkAJ1RSYsbMzdwMbNqVghmkJFdMNVeMhG4HPbFYmkC
         tI2/d9VSzinAph32dbC+6D9RPGBjXizVWrF3fQ5QGuXflO9YFSqES5AbFYaXrSCAKCef
         UFtkzHGFTxDjO4sxqovChRCaeL4DFsniGsNxMOQl4+1/xFhC9VgIcQUrrBtP0CTNaRIo
         JYRjie7zP9qoZQGcen9kielRF3e154XJlKne7p0+fckOnNvVX0rzHjUntSbMFU7sciRo
         zfPw==
X-Forwarded-Encrypted: i=1; AJvYcCUxcMWJTfVcp1v/lHvWaI/6RBWpX9+nw8hHR7LQCK87C6bH/rmAfFNPM/ta79phRi7B3nF2TFzLUWno9GezEv261rYN12A6Scv0s7diByc=
X-Gm-Message-State: AOJu0Yzv1FLstr+C/03tgzMOF2wbQcC0TQYvj0Knh5jjGaCAXx71MXsd
	ca/YNvE39xe4x34coENf+lKzOE65q8qGhejJt6KyyZVVi0i79hnT
X-Google-Smtp-Source: AGHT+IGqnM0wd4pc47hl0ljZYsK2T8iOuOLqXSe2vXD8R2tZvbklo5RT/nHR2KvgtufHIaI3sMjY3g==
X-Received: by 2002:a05:651c:22d:b0:2ef:23ec:9356 with SMTP id 38308e7fff4ca-2f1530df004mr15370081fa.8.1722513306994;
        Thu, 01 Aug 2024 04:55:06 -0700 (PDT)
Message-ID: <d816816c0cb37279f45fad46553b1fa267b0febc.camel@gmail.com>
Subject: Re: [PATCH v3 8/9] xen/riscv: page table handling
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Thu, 01 Aug 2024 13:55:05 +0200
In-Reply-To: <afc24e73-78e8-4088-9292-33560e599cbe@suse.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
	 <595c7b6736d6f718bafc7a677fb13881584ce4dc.1721834549.git.oleksii.kurochko@gmail.com>
	 <c2496115-5c42-4cbb-8dde-686a97259609@suse.com>
	 <04b40498494cbbd0d78744d87a2310e211f26b85.camel@gmail.com>
	 <afc24e73-78e8-4088-9292-33560e599cbe@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Thu, 2024-08-01 at 12:43 +0200, Jan Beulich wrote:
>=20
>=20
> > > > +=C2=A0=C2=A0=C2=A0 mfn =3D pte_get_mfn(*entry);
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 xen_unmap_table(*table);
> > > > +=C2=A0=C2=A0=C2=A0 *table =3D xen_map_table(mfn);
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 return XEN_TABLE_NORMAL_PAGE;
> > > > +}
> > >=20
> > > Normal page? Not normal table?
> > It just mean that this points not to super_page so potenially the
> > in
> > the next one table will have an entry that would be normal page.
>=20
> Or a normal page table, if you haven't reached leaf level yet. IOW
> maybe
> better XEN_TABLE_NORMAL, covering both cases?
It would be better. Thanks.

>=20
> > > > +int map_pages_to_xen(unsigned long virt,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mfn_t mfn,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long nr_mfn=
s,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned int flags)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 return xen_pt_update(virt, mfn, nr_mfns, flags)=
;
> > > > +}
> > >=20
> > > Why this wrapping of two functions taking identical arguments?
> > map_pages_to_xen() sounds more clear regarding the way how it
> > should be
> > used.
> >=20
> > xen_pt_update() will be also used inside other functions. Look at
> > the
> > example above.
>=20
> They could as well use map_pages_to_xen() then? Or else the wrapper
> may
> want to check (assert) that it is _not_ called with one of the
> special
> case arguments that xen_pt_update() knows how to deal with?
Yes, map_pages_to_xen() will be used in other functions/wrappers.
At the momemnt, I don't see what should be checked additionally in
map_pages_to_xen(). It seems to me that xen_pt_update() covers all the
checks at the start it needs for now. ( i will double-check that ).

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 11:59:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 11:59:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769648.1180531 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZUTI-0006gG-06; Thu, 01 Aug 2024 11:59:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769648.1180531; Thu, 01 Aug 2024 11:59:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZUTH-0006g9-Tn; Thu, 01 Aug 2024 11:59:51 +0000
Received: by outflank-mailman (input) for mailman id 769648;
 Thu, 01 Aug 2024 11:59:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZUTG-0006g3-Ej
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 11:59:50 +0000
Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com
 [2a00:1450:4864:20::233])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8daef14c-4ffd-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 13:59:49 +0200 (CEST)
Received: by mail-lj1-x233.google.com with SMTP id
 38308e7fff4ca-2eecd2c6432so102956471fa.3
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 04:59:49 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7acad91010sm895199066b.172.2024.08.01.04.59.48
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 04:59:48 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8daef14c-4ffd-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722513589; x=1723118389; 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=fcVcK1zGJ9Bi5IET0nl3Cef0XxJfM3QerBIsPmvZYho=;
        b=Tgo/tZxTZ7jQNt0HEnoqL8nn9JFSF8o330qBwienWXokJdv2vV8iRFcMiu0nDExDow
         oDxIU8qigIiiazy1e/H7DzIujms/7tn/YZ77C4vZpuELci5pBVJGbtxroyzYjTnV0f7E
         xCNT3Bj1O9RuN/aK91aX8wA5n4A8nh5ChsDYIdx5aknwJIlHWNNjWmYtWhd20az7qDJV
         D6Y0uV2xBTtvQPqchiWAZkGWRj9VtGqy/tRQqY41bBAC0rL6gNPD8rPJTEuEIGpnsgF/
         UvVKVzYd8fDn1a5kMFVQGApfWgIkzYgUonXz6RhiQsRXNnRc/q04ZWV8QWwiKuohj+i4
         YCOw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722513589; x=1723118389;
        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=fcVcK1zGJ9Bi5IET0nl3Cef0XxJfM3QerBIsPmvZYho=;
        b=VsrMdo9vVjnGXmY+gkoAOoNBNkgDnGy9rheaiulz9tR5CAKJdP+Sy2hrXYIZlfzdby
         LynujiPNYBhzu2l9MzhAOB2BSQeytdlKegPkVrJ+TGJR9y9KYE9oJfjjWc8rAEYBClbV
         AJPZfA4q+acQqu0hYtnl+qhyzXc//govZHgrPhqITulEo/slklK2V1WAqvIlHTu1NljQ
         3BPWa8BH3dUFBKwdsMu/1xRpYj7cICPVODl+HJXII6vBuveWb/l7rC9EFJge3XFjyqhy
         T3MeEqfPmCsGZG9Nc0sI63PVl7/iA4Omidr3Yh7IEnuzZho/b1QEDhY7R3SlWIfk4ZKY
         81dw==
X-Forwarded-Encrypted: i=1; AJvYcCX3e1SQHMiAgxfYhrGsMXdvp9IUm/pxTxldAlZ6Akqqs5WgVg7Prt6ySiW670TezYOt7s6BRkd/ujiAIyobkfSiCZjTgmiAB5rXWhfJ7Is=
X-Gm-Message-State: AOJu0YzOVXiR422wa5x5HqEZQY6A3y7h3nCuSh7RZQxscfJ2xjX1/Q4N
	jMwE1MsGodLto8+nFPWMyvCq6dquavf++wc4B7iYHety7rFC1E97cgHc9U73JQ==
X-Google-Smtp-Source: AGHT+IE76/DUj1LcZVyXJ3A5/v6f8wROB/hV/CUzmXCF/HuiC5ltqrmKnF9C8J6X3bcYM0+D6HEyqw==
X-Received: by 2002:a2e:b90a:0:b0:2ef:2490:46f1 with SMTP id 38308e7fff4ca-2f153102cebmr19186981fa.23.1722513588838;
        Thu, 01 Aug 2024 04:59:48 -0700 (PDT)
Message-ID: <76e81ce0-f251-4c4b-a4c9-fbe06e7a6a84@suse.com>
Date: Thu, 1 Aug 2024 13:59:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 8/9] xen/riscv: page table handling
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
 <595c7b6736d6f718bafc7a677fb13881584ce4dc.1721834549.git.oleksii.kurochko@gmail.com>
 <c2496115-5c42-4cbb-8dde-686a97259609@suse.com>
 <04b40498494cbbd0d78744d87a2310e211f26b85.camel@gmail.com>
 <afc24e73-78e8-4088-9292-33560e599cbe@suse.com>
 <d816816c0cb37279f45fad46553b1fa267b0febc.camel@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: <d816816c0cb37279f45fad46553b1fa267b0febc.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 01.08.2024 13:55, oleksii.kurochko@gmail.com wrote:
> On Thu, 2024-08-01 at 12:43 +0200, Jan Beulich wrote:
>>>>> +int map_pages_to_xen(unsigned long virt,
>>>>> +                     mfn_t mfn,
>>>>> +                     unsigned long nr_mfns,
>>>>> +                     unsigned int flags)
>>>>> +{
>>>>> +    return xen_pt_update(virt, mfn, nr_mfns, flags);
>>>>> +}
>>>>
>>>> Why this wrapping of two functions taking identical arguments?
>>> map_pages_to_xen() sounds more clear regarding the way how it
>>> should be
>>> used.
>>>
>>> xen_pt_update() will be also used inside other functions. Look at
>>> the
>>> example above.
>>
>> They could as well use map_pages_to_xen() then? Or else the wrapper
>> may
>> want to check (assert) that it is _not_ called with one of the
>> special
>> case arguments that xen_pt_update() knows how to deal with?
> Yes, map_pages_to_xen() will be used in other functions/wrappers.
> At the momemnt, I don't see what should be checked additionally in
> map_pages_to_xen(). It seems to me that xen_pt_update() covers all the
> checks at the start it needs for now. ( i will double-check that ).

I was referring to cases that xen_pt_update() can handle, but that
map_pages_to_xen() isn't supposed to be handling (if already you
want to separate both).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 12:41:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 12:41:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769683.1180577 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZV7P-0006Wt-QU; Thu, 01 Aug 2024 12:41:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769683.1180577; Thu, 01 Aug 2024 12:41:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZV7P-0006Wm-O0; Thu, 01 Aug 2024 12:41:19 +0000
Received: by outflank-mailman (input) for mailman id 769683;
 Thu, 01 Aug 2024 12:41:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8r7L=PA=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZV7O-0006Wf-RG
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 12:41:18 +0000
Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com
 [2a00:1450:4864:20::331])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 582fffa9-5003-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 14:41:16 +0200 (CEST)
Received: by mail-wm1-x331.google.com with SMTP id
 5b1f17b1804b1-42122ac2f38so12546245e9.1
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 05:41:16 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-4282b8addd6sm56459325e9.20.2024.08.01.05.41.15
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 01 Aug 2024 05:41:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 582fffa9-5003-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722516076; x=1723120876; darn=lists.xenproject.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=c0KA4laWBsCxag7t4EtP7W7Ugka2Ljaoh+/g4/ICyt8=;
        b=TAhSlhH9fgQlNY2D6F3ZLyEXc7ZzR+BVUsxoqbFoEZ+MMYjeC3n0T/EvmunOyycO7k
         1Hy45fXDZJ7y1ZL9EAJGc3K4WS/vi2KmY0rIGTbziuOMqAFR4nvqU4VYyx2kksv0FRuC
         bOD7ilpZ4xH5RTjNZfToA9Iz7iHij8eiNieis=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722516076; x=1723120876;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=c0KA4laWBsCxag7t4EtP7W7Ugka2Ljaoh+/g4/ICyt8=;
        b=tKRbu4uBwRBobwhxNKzs7s/O0Yid16n0ivMvb/0DAIbT0oPcQSkrwe3Cm2SfZ//r6i
         4UFBeS5XBSyUNKHVM54FpkHWbGb1COCyCq5Vzzsa30pRbUf1FfKqOgEkqkG2lF6dycnM
         rfSfUHpvoc4X9T7Ip/Ex9htMnAWTfgVMuBA5IYL/Zmns5ZanWf2IFNxsu0hedV7LDGlA
         DCMikW3zbrLEZfHDQAD+bRfcewWak5cFYtOYTbL22icixkv5nKbP5dmrrdgOKLoluRfb
         1r1HopjQTbJ0WoSlYoWVLYkMwUk+JJS1orOBMqxWyEa2TJTghBFEDQjolS0Q1/VLicWD
         5Gxg==
X-Forwarded-Encrypted: i=1; AJvYcCVI3+aosx+6iEnyXpsyckpxuuVHPOvm+ZQsXDXNyqNOehxSluQ91MeQQOPYgDaK7RTPDsLVBbRH/cdzhUK/iK2ei9Gn8UDLXPYQ07XeKT0=
X-Gm-Message-State: AOJu0YzCyCUgbTlDeO0JV+mnPiKMKHs1FIkDNgnWNd2XB94OqFW4+Bs6
	gqwz8ERz6+0V+IcPPgambmRojHBKo3tJaHKTYvIVqqy6/bLl3I1KuWmP0casrF4=
X-Google-Smtp-Source: AGHT+IHATgLBjKMEVMlwRZV7uf0w44ZjAsE4Ckk/sFDp44O4gIVsZH6Dk379b/mL+SiIlkpJRQyUWw==
X-Received: by 2002:a05:600c:35d5:b0:426:5c36:f57a with SMTP id 5b1f17b1804b1-428e474bb69mr12839135e9.14.1722516075712;
        Thu, 01 Aug 2024 05:41:15 -0700 (PDT)
Date: Thu, 1 Aug 2024 14:41:14 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Daniel P . Smith" <dpsmith@apertussolutions.com>,
	xen-devel@lists.xenproject.org,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	Juergen Gross <jgross@suse.com>,
	Stewart Hildebrand <Stewart.Hildebrand@amd.com>,
	Huang Rui <ray.huang@amd.com>, Jiqian Chen <Jiqian.Chen@amd.com>
Subject: Re: [XEN PATCH v12 4/7] x86/domctl: Add hypercall to set the access
 of x86 gsi
Message-ID: <ZquCatoi50cNI3qR@macbook>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-5-Jiqian.Chen@amd.com>
 <ZqtsQwZNyFzflDQt@macbook>
 <ec95b413-519d-46a4-be41-ebb6a375612a@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ec95b413-519d-46a4-be41-ebb6a375612a@suse.com>

On Thu, Aug 01, 2024 at 01:36:16PM +0200, Jan Beulich wrote:
> On 01.08.2024 13:06, Roger Pau Monné wrote:
> > On Mon, Jul 08, 2024 at 07:41:21PM +0800, Jiqian Chen wrote:
> >> Remaining comment @Daniel P . Smith:
> >> +        ret = -EPERM;
> >> +        if ( !irq_access_permitted(currd, irq) ||
> >> +             xsm_irq_permission(XSM_HOOK, d, irq, access_flag) )
> >> +            goto gsi_permission_out;
> >> Is it okay to issue the XSM check using the translated value, 
> >> not the one that was originally passed into the hypercall?
> > 
> > FWIW, I don't see the GSI -> IRQ translation much different from the
> > pIRQ -> IRQ translation done by pirq_access_permitted(), which is also
> > ahead of the xsm check.
> 
> The question (which I raised originally) isn't an ordering one, but an
> auditing one: Is it okay to pass the XSM hook a value that isn't what
> was passed into the hypercall?

But that's also the case with the current XEN_DOMCTL_irq_permission
implementation?  As the hypercall parameter is a pIRQ, and the XSM
check is done against the translated IRQ obtained from the pIRQ
parameter.

Not saying you question is not relevant, but we already have at least
one very similar instance of doing the XSM check against a value
derived from an hypercall parameter.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 12:47:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 12:47:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769694.1180588 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZVDB-0007AV-Eq; Thu, 01 Aug 2024 12:47:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769694.1180588; Thu, 01 Aug 2024 12:47:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZVDB-0007AO-BD; Thu, 01 Aug 2024 12:47:17 +0000
Received: by outflank-mailman (input) for mailman id 769694;
 Thu, 01 Aug 2024 12:47: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=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZVDA-00079X-0e
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 12:47:16 +0000
Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com
 [2a00:1450:4864:20::52a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2d0756c6-5004-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 14:47:13 +0200 (CEST)
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-5a3b866ebc9so9724108a12.3
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 05:47:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7acab52d51sm896014066b.79.2024.08.01.05.47.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 05:47:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2d0756c6-5004-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722516433; x=1723121233; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=A8evH0/3g8bv9N/9tlqM2d85ER+N4y++tkzpYWUzUVA=;
        b=DcUAuoRSFIvU/8LzeQWtV3T4dzu7Q6yPMTYIYJ9XhvtCKeO5axPZez4HZpbF4pyO84
         26CixC5bOhYAW9nmG50U/jH/EBeuvns2P9W6YGV77oO9ezY/AeFfCEYwuA5t2Ll40gH2
         0EV6SvON4EvLJW0UbR2w+dc+uY/cXNY9AxC7IlfRKkUbvHs7FC6qm2c8FYX39bYNUbT5
         LOJ1162IhTg7b3bWfEvFtYR8WUp9Jfzx/6sdWLzLC7zqJXRLNfQ1JmWo0SeCaCQYV7af
         emjDGv+ypReYGWt59RQySTbdpYeAHAFTnPuF/V7KzG2/RHJdVpsMj4wcua39eM8aVfVq
         8S8Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722516433; x=1723121233;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=A8evH0/3g8bv9N/9tlqM2d85ER+N4y++tkzpYWUzUVA=;
        b=dju+Es0o37ZGSInTDiFplocvV+MW7rV+mlAautz+RjlavG0NohWr9jlNrgfhQCy9ZO
         MuJXp+Up+tj1r9a+9wQWj+4YaTFQ4l44EUVL0fTygn/K48BOhKOXhRa3jS0wubch+R8B
         DQEB1n0pVVr5Vq+JtqlJyZOOU6ydpAlZTYATtTT1bwhFMr8HKSlvTMedjn3xkiqbgQXo
         jyJAmRwS8lQm1nEes/Hl26VQ09Z98xsWZuXIio5UBJMmtzr9ZNuQllOvK+LNru04oOi7
         wlTc988wm8CZ8ukvWHeJ+wZ6uyVnCLfBu5LDcO9xFjxs29cjJG3MmjndyRIdcApo+MCp
         8Zuw==
X-Gm-Message-State: AOJu0YxiaEAqZaZSR0+OastpwfGLph857KaGNQAPjEfgzPlv+devYABX
	A7MyMzj05j7NrOKwRmWtgoUjQgt7sKajqPRDy4Tu24n/AodgqSdFjW3otImop2b0MBFlq5/BdSo
	=
X-Google-Smtp-Source: AGHT+IGmRPIm6Jf6lBR3vFK+MD5qMx+YJMdosH+DaC4T1EkfWUstxR+ahc3uuuoaWfW3mQEDOQLu+A==
X-Received: by 2002:a17:907:2d11:b0:a7a:a30b:7b93 with SMTP id a640c23a62f3a-a7dc4dbf253mr4232266b.2.1722516433108;
        Thu, 01 Aug 2024 05:47:13 -0700 (PDT)
Message-ID: <29b28ab7-a642-429c-80aa-d09d422ba6cc@suse.com>
Date: Thu, 1 Aug 2024 14:47:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Juergen Gross <jgross@suse.com>,
 Anthony PERARD <anthony.perard@vates.tech>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] 9pfsd: fix release build with old gcc
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Being able to recognize that "par" is reliably initialized on the 1st
loop iteration requires not overly old compilers.

Fixes: 7809132b1a1d ("tools/xen-9pfsd: add 9pfs response generation support")
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/tools/9pfsd/io.c
+++ b/tools/9pfsd/io.c
@@ -196,7 +196,7 @@ static void fill_buffer_at(void **data,
 static void vfill_buffer_at(void **data, const char *fmt, va_list ap)
 {
     const char *f;
-    const void *par;
+    const void *par = NULL; /* old gcc */
     const char *str_val;
     const struct p9_qid *qid;
     const struct p9_stat *stat;


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 12:54:39 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 12:54:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769703.1180598 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZVKE-0000fT-4q; Thu, 01 Aug 2024 12:54:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769703.1180598; Thu, 01 Aug 2024 12:54:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZVKE-0000fM-1Z; Thu, 01 Aug 2024 12:54:34 +0000
Received: by outflank-mailman (input) for mailman id 769703;
 Thu, 01 Aug 2024 12:54:32 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=xSmm=PA=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sZVKB-0000fG-V3
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 12:54:31 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 30d75d3a-5005-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 14:54:29 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-5a2ffc34431so5335391a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 05:54:29 -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
 4fb4d7f45d1cf-5ac631b052bsm10047324a12.15.2024.08.01.05.54.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 05:54:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 30d75d3a-5005-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722516869; x=1723121669; 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=Mh8A47PsI4VQmNtBW2mJEQqASpxD2OfMpLLHDUb6OHc=;
        b=fMej53EdujlLDX2x+IIv7Rj5e6n4Dv8LpmqY3HDOcuCtlR+0D+y1jiubY05IpWoAnQ
         pUuCRX439baQ8HAHA5JdPdL/6TU0rujrbnoiSMe7GcM0SMxMMLST6NYRLwZPckEM2BxT
         mj0W1B97LQ7cDsNh1ZimHf7bNPFhHW9/darjfNyC30tKaRh53VS5cHpKa8omAOSXrd4+
         B3wS5CLtTggF94SxwREUjtS9qEB56R20BkNg2lMinXflq98MqBR2WHvKB4Di+Tt/KsoT
         HYXheZtR/yFCIM9jGQfOO1//i7xEBsIFGZJ4y6m37b6+PIKcC/04dZ0bCVZJhbWO+TUW
         5nxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722516869; x=1723121669;
        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=Mh8A47PsI4VQmNtBW2mJEQqASpxD2OfMpLLHDUb6OHc=;
        b=ZncbTp+Qk1Pm1dycdvgJcrdADbqX1hMr3WEFeawhzuQxR6A9MdZJ/En8uzR1mH4z+c
         5uCoksvDUGMCv3mKVtqJe73cgIuatEEfuYYu9v3T48Q0ivYb+787xJBVfhSlt4OcmVwt
         20BFA23HzcaE8Xkl97fW1qYtlTxT6kgkF/U5K43CqH5DIv9iYb8Z9G2+pTsg3nSpdGf/
         abAtWoZYyePZUM/Tr1MqaBRyfrn9ROM94dwfjPcvWWyd/wINICQKyjtqizLhyAr+4z5+
         H0hxe6+me5UlTBRd1dWWRR8JfrxMrlf0sz86yHDi5BG2XQaseteOpPBrmQHjL8a+N1hl
         IiBA==
X-Forwarded-Encrypted: i=1; AJvYcCWxVh11cT7NNxbceweJq1t7lGjw5bb0qh9ToZ3s/Ug4ShfDqFrvoEV0ZyfUBbjuAio7ggR8MvewQRxY1yyJWV91e7USAejhZpUp4OIh0To=
X-Gm-Message-State: AOJu0YzHUS7Sx+8oqxFvQwWQtQ930TnV34OOBLn4q52ZmIv3pT2fSgk+
	JCwZe8BSHWLINFlvGX61ZUMMgfXiuygzSv/jH5IFLMeF2AP6lMy8WjxSW5sKtx8=
X-Google-Smtp-Source: AGHT+IHZaAB374oAPyz1CEp6XdY3yh7ysO4fEU+puI2Ieja3pSFIzdsGRU3iJaMAiG/ztVcwwm9dRw==
X-Received: by 2002:a05:6402:549:b0:5a2:2b56:e06e with SMTP id 4fb4d7f45d1cf-5b7f56fc8bbmr105681a12.36.1722516864142;
        Thu, 01 Aug 2024 05:54:24 -0700 (PDT)
Message-ID: <5b9486b0-9af9-4032-b117-b345781da9a0@suse.com>
Date: Thu, 1 Aug 2024 14:54:23 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] 9pfsd: fix release build with old gcc
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Anthony PERARD <anthony.perard@vates.tech>
References: <29b28ab7-a642-429c-80aa-d09d422ba6cc@suse.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <29b28ab7-a642-429c-80aa-d09d422ba6cc@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 01.08.24 14:47, Jan Beulich wrote:
> Being able to recognize that "par" is reliably initialized on the 1st
> loop iteration requires not overly old compilers.
> 
> Fixes: 7809132b1a1d ("tools/xen-9pfsd: add 9pfs response generation support")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen



From xen-devel-bounces@lists.xenproject.org Thu Aug 01 12:55:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 12:55:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769711.1180607 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZVKo-00019v-Dn; Thu, 01 Aug 2024 12:55:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769711.1180607; Thu, 01 Aug 2024 12:55:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZVKo-00019o-B6; Thu, 01 Aug 2024 12:55:10 +0000
Received: by outflank-mailman (input) for mailman id 769711;
 Thu, 01 Aug 2024 12:55:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8r7L=PA=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZVKn-0000yr-2m
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 12:55:09 +0000
Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com
 [2607:f8b0:4864:20::f2f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 479d3b81-5005-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 14:55:08 +0200 (CEST)
Received: by mail-qv1-xf2f.google.com with SMTP id
 6a1803df08f44-6b7a0ef0e75so39737336d6.1
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 05:55:08 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6bb3f8d8505sm84576846d6.7.2024.08.01.05.55.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 01 Aug 2024 05:55:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 479d3b81-5005-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722516907; x=1723121707; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=034bLDCBYZdpmv6TZ9fSLZ9UYJjcNSKGwvE0ZYUk1w0=;
        b=okYkxb5EVNo1DESqSkmR+gm7BNwoUwsFwCB9HtJT6GAOhallM1MWmT/Xr+qoNhskuO
         kr5bYBWjwIdNwdZS4hBLrFe+eY0o4a7l/4qqS2ErD78BgjpjTI8dI0lo16kExMUWY6Dj
         jxsszSMuoZsxya2HXXq1jzQbrHTB+x8GGDzSc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722516907; x=1723121707;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=034bLDCBYZdpmv6TZ9fSLZ9UYJjcNSKGwvE0ZYUk1w0=;
        b=fBUcsuqgBBBr4vbCsBNt9PlHnA50TH6yb8Anw3HKAaxQc+gFy1HrimaFwPUx48R03Y
         Nx8W1JyhsEiTUgivLIIi+tHavb2qRICdSPQN2FwbaTxEPErw9WId9W2dPnHwIQxAytUg
         /rC3DndEXk+54xOMFBRB0fByDt4M4ViJFgT421K/t6H4F2K9sHG32ei7lidV2ZfOImCa
         dmfdbH4RavYdaocoJVTBq/llnkB320EBY/qKAPrDk8CO1a+N4iWCEoT/uBBbhOH6rp8t
         VOeCn+qy87yG0ES9gWkVe/ZFwYNazYyUi+368ff0yDLbQ3fhF4+mZCex1uwLZcUA25B7
         bohg==
X-Forwarded-Encrypted: i=1; AJvYcCUI/QwpXjxisluH+pPLESxl4NXqCU4xeYlSk6ZxwioTAnZ8+LZxKLWy3wNBFkuzuOpzblM0CUBIP7lhISnzVY/6mRgJmudlX02OLOtVc8I=
X-Gm-Message-State: AOJu0YwobQHb5/TBTNNZacTF+zjXvFDU7/akxBElSlt7R33EC2kpJ3WA
	aVX2V1LI1WxdhRo5R2EHECWjmwoGi4/1GSZwrzVqEbA4KzYBOgLB1GPLpOUJvVo=
X-Google-Smtp-Source: AGHT+IHitI3kQPF7ecjiRJVP1VyO8ntqhOGEAU30XZ2R9feIyByhzvAbM2JHoAo8EwV2Z25V85HirA==
X-Received: by 2002:a05:6214:469e:b0:6b5:a945:ec51 with SMTP id 6a1803df08f44-6bb8d85fc5dmr4606486d6.51.1722516907079;
        Thu, 01 Aug 2024 05:55:07 -0700 (PDT)
Date: Thu, 1 Aug 2024 14:55:04 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Jiqian Chen <Jiqian.Chen@amd.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	Juergen Gross <jgross@suse.com>,
	"Daniel P . Smith" <dpsmith@apertussolutions.com>,
	Stewart Hildebrand <Stewart.Hildebrand@amd.com>,
	Huang Rui <ray.huang@amd.com>, xen-devel@lists.xenproject.org,
	Marek Marczykowski <marmarek@invisiblethingslab.com>
Subject: Re: [XEN PATCH v12 5/7] tools/libxc: Allow gsi be mapped into a free
 pirq
Message-ID: <ZquFqIfrironhEej@macbook>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-6-Jiqian.Chen@amd.com>
 <ef611901-03bf-4aa9-9de7-ac6d4fd82d05@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <ef611901-03bf-4aa9-9de7-ac6d4fd82d05@suse.com>

On Tue, Jul 09, 2024 at 03:26:31PM +0200, Jan Beulich wrote:
> On 08.07.2024 13:41, Jiqian Chen wrote:
> > Hypercall PHYSDEVOP_map_pirq support to map a gsi into a specific
> > pirq or a free pirq, it depends on the parameter pirq(>0 or <0).
> > But in current xc_physdev_map_pirq, it set *pirq=index when
> > parameter pirq is <0, it causes to force all cases to be mapped
> > to a specific pirq. That has some problems, one is caller can't
> > get a free pirq value, another is that once the pecific pirq was
> > already mapped to other gsi, then it will fail.
> > 
> > So, change xc_physdev_map_pirq to allow to pass negative parameter
> > in and then get a free pirq.
> > 
> > There are four caller of xc_physdev_map_pirq in original codes, so
> > clarify the affect below(just need to clarify the pirq<0 case):
> > 
> > First, pci_add_dm_done->xc_physdev_map_pirq, it pass irq to pirq
> > parameter, if pirq<0 means irq<0, then it will fail at check
> > "index < 0" in allocate_and_map_gsi_pirq and get EINVAL, logic is
> > the same as original code.
> 
> There we have
> 
>     int pirq = XEN_PT_UNASSIGNED_PIRQ;
> 
> (with XEN_PT_UNASSIGNED_PIRQ being -1) and then
> 
>     rc = xc_physdev_map_pirq(xen_xc, xen_domid, machine_irq, &pirq);
> 
> Therefore ...
> 
> > --- a/tools/libs/ctrl/xc_physdev.c
> > +++ b/tools/libs/ctrl/xc_physdev.c
> > @@ -50,7 +50,7 @@ int xc_physdev_map_pirq(xc_interface *xch,
> >      map.domid = domid;
> >      map.type = MAP_PIRQ_TYPE_GSI;
> >      map.index = index;
> > -    map.pirq = *pirq < 0 ? index : *pirq;
> > +    map.pirq = *pirq;
> >  
> >      rc = do_physdev_op(xch, PHYSDEVOP_map_pirq, &map, sizeof(map));
> 
> ... this very much looks like a change in behavior to me: *pirq is
> negative, and hence index would have been put in map.pirq instead. While
> with your change we'd then pass -1, i.e. requesting to obtain a new
> pIRQ.
> 
> I also consider it questionable to go by in-tree users. I think proof of
> no functional change needs to also consider possible out-of-tree users,
> not the least seeing the Python binding below (even if right there you
> indeed attempt to retain prior behavior). The one aspect in your favor
> is that libxc isn't considered to have a stable ABI.

FWIW, it seems this forced identity mapping was introduced to overcome
a regression in xend as a result of an XSA:

934a5253d932 fix XSA-46 regression with xend/xm

Not sure however if other tools have since then come to rely on this
behavior.

> Overall I see little room to avoid introducing a new function with this
> improved behavior (maybe xc_physdev_map_pirq_gsi()). Ideally existing
> callers would then be switched, to eventually allow removing the old
> function (thus cleanly and noticeably breaking any out-of-tree users
> that there may be, indicating to their developers that they need to
> adjust their code).

I'm fine with the naming.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 13:02:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 13:02:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769723.1180618 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZVRM-0003Pe-4x; Thu, 01 Aug 2024 13:01:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769723.1180618; Thu, 01 Aug 2024 13:01:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZVRM-0003PX-1D; Thu, 01 Aug 2024 13:01:56 +0000
Received: by outflank-mailman (input) for mailman id 769723;
 Thu, 01 Aug 2024 13:01:54 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8r7L=PA=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZVRK-0003PH-Jd
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 13:01:54 +0000
Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com
 [2607:f8b0:4864:20::f30])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 389f8358-5006-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 15:01:52 +0200 (CEST)
Received: by mail-qv1-xf30.google.com with SMTP id
 6a1803df08f44-6b797fb1c4aso46999676d6.2
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 06:01:52 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6bb79e5600bsm27063906d6.33.2024.08.01.06.01.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 01 Aug 2024 06:01:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 389f8358-5006-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722517311; x=1723122111; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=Au+57fpcyFGJDnYuwgFlo6w8InT1GALMqmisZDjrkXQ=;
        b=k8jmb80I9NqTC0o79TNqL2Hof/f+8KP6zv3uELCrJW4BPga5qTw2hpchLOYIXbqRv+
         ohzFeu8l/3GsyEvw9SOb+gEeEm8oqw0Ba8NzpoBWZeIxrtKsM1MPceKrIplxK2nXkrkU
         o5wXg+4cXXaz95DuzB8Yq/i+I5s+bR3/UsOgU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722517311; x=1723122111;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Au+57fpcyFGJDnYuwgFlo6w8InT1GALMqmisZDjrkXQ=;
        b=aTyE4DZ3oTQ1YQcj8Da6HJgZpeeiMhxC93/ezeuAI9ILOSNhRcEYc/Ohn5M2aWS0Cx
         FRgi+X0fMAFJ7KIDy3omrnl3GfvgZohR6QTzYpfJJsApQwNpoyuKOZ+UjIVQSTS44lVP
         L58uczvVuS5j3WWqA66FUACnF10wgzWYsF3sPeDdyYCLU6i4kYLaQMJ/9s9eFNIMhvTY
         eIGTnnaYXlDzwSuEp0FMaQe3MMmc0358A/d0D/UyGNv+bAo+xuBPHySJd8Rf0QBlAq4A
         5qSDNgFjbtRZQTlPCROjUc34J1qbwJ1KB4tWOXY9FfeQAh4NrB76B7XL4ggUqVhzA2/+
         dw+A==
X-Gm-Message-State: AOJu0YxkZD14eDE8jQGyPMgaMHIMfFte8E8JonEfPJ2aJlrcAFGupdCO
	L0XqhuXyMqsBl3Wmx5hb96d1Hg2LirVgSHFMi0vMOYtn5+f6XP0MRdftWtEAZ94=
X-Google-Smtp-Source: AGHT+IGJyBCskeQfAZU9MbzIRlHg5HY7Kq3D+91RyYQvg7ibc2kK1jj4Goe3NR+fPqn3Zdn6Kk18iA==
X-Received: by 2002:a05:6214:5988:b0:6b7:4319:ad6f with SMTP id 6a1803df08f44-6bb8d795792mr4514346d6.36.1722517311329;
        Thu, 01 Aug 2024 06:01:51 -0700 (PDT)
Date: Thu, 1 Aug 2024 15:01:41 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jiqian Chen <Jiqian.Chen@amd.com>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	Juergen Gross <jgross@suse.com>,
	"Daniel P . Smith" <dpsmith@apertussolutions.com>,
	Stewart Hildebrand <Stewart.Hildebrand@amd.com>,
	Huang Rui <ray.huang@amd.com>
Subject: Re: [RFC XEN PATCH v12 6/7] tools: Add new function to get gsi from
 dev
Message-ID: <ZquHNURGoADdCy6y@macbook>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-7-Jiqian.Chen@amd.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20240708114124.407797-7-Jiqian.Chen@amd.com>

On Mon, Jul 08, 2024 at 07:41:23PM +0800, Jiqian Chen wrote:
> When passthrough a device to domU, QEMU and xl tools use its gsi
> number to do pirq mapping, see QEMU code
> xen_pt_realize->xc_physdev_map_pirq, and xl code
> pci_add_dm_done->xc_physdev_map_pirq, but the gsi number is got
> from file /sys/bus/pci/devices/<sbdf>/irq, that is wrong, because
> irq is not equal with gsi, they are in different spaces, so pirq
> mapping fails.
> 
> And in current codes, there is no method to get gsi for userspace.
> For above purpose, add new function to get gsi, and the
> corresponding ioctl is implemented on linux kernel side.
> 
> Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
> Signed-off-by: Huang Rui <ray.huang@amd.com>
> Signed-off-by: Chen Jiqian <Jiqian.Chen@amd.com>
> ---
> RFC: it needs to wait for the corresponding third patch on linux kernel side to be merged.
> https://lore.kernel.org/xen-devel/20240607075109.126277-4-Jiqian.Chen@amd.com/
> This patch must be merged after the patch on linux kernel side
> 
> CC: Anthony PERARD <anthony@xenproject.org>
> Remaining comment @Anthony PERARD:
> Do I need to make " opening of /dev/xen/privcmd " as a single function, then use it in this
> patch and other libraries?
> ---
>  tools/include/xen-sys/Linux/privcmd.h |  7 ++++++
>  tools/include/xenctrl.h               |  2 ++
>  tools/libs/ctrl/xc_physdev.c          | 35 +++++++++++++++++++++++++++
>  3 files changed, 44 insertions(+)
> 
> diff --git a/tools/include/xen-sys/Linux/privcmd.h b/tools/include/xen-sys/Linux/privcmd.h
> index bc60e8fd55eb..4cf719102116 100644
> --- a/tools/include/xen-sys/Linux/privcmd.h
> +++ b/tools/include/xen-sys/Linux/privcmd.h
> @@ -95,6 +95,11 @@ typedef struct privcmd_mmap_resource {
>  	__u64 addr;
>  } privcmd_mmap_resource_t;
>  
> +typedef struct privcmd_gsi_from_pcidev {
> +	__u32 sbdf;
> +	__u32 gsi;
> +} privcmd_gsi_from_pcidev_t;
> +
>  /*
>   * @cmd: IOCTL_PRIVCMD_HYPERCALL
>   * @arg: &privcmd_hypercall_t
> @@ -114,6 +119,8 @@ typedef struct privcmd_mmap_resource {
>  	_IOC(_IOC_NONE, 'P', 6, sizeof(domid_t))
>  #define IOCTL_PRIVCMD_MMAP_RESOURCE				\
>  	_IOC(_IOC_NONE, 'P', 7, sizeof(privcmd_mmap_resource_t))
> +#define IOCTL_PRIVCMD_GSI_FROM_PCIDEV				\
> +	_IOC(_IOC_NONE, 'P', 10, sizeof(privcmd_gsi_from_pcidev_t))
>  #define IOCTL_PRIVCMD_UNIMPLEMENTED				\
>  	_IOC(_IOC_NONE, 'P', 0xFF, 0)
>  
> diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
> index 9ceca0cffc2f..3720e22b399a 100644
> --- a/tools/include/xenctrl.h
> +++ b/tools/include/xenctrl.h
> @@ -1641,6 +1641,8 @@ int xc_physdev_unmap_pirq(xc_interface *xch,
>                            uint32_t domid,
>                            int pirq);
>  
> +int xc_physdev_gsi_from_pcidev(xc_interface *xch, uint32_t sbdf);
> +
>  /*
>   *  LOGGING AND ERROR REPORTING
>   */
> diff --git a/tools/libs/ctrl/xc_physdev.c b/tools/libs/ctrl/xc_physdev.c
> index e9fcd755fa62..54edb0f3c0dc 100644
> --- a/tools/libs/ctrl/xc_physdev.c
> +++ b/tools/libs/ctrl/xc_physdev.c
> @@ -111,3 +111,38 @@ int xc_physdev_unmap_pirq(xc_interface *xch,
>      return rc;
>  }
>  
> +int xc_physdev_gsi_from_pcidev(xc_interface *xch, uint32_t sbdf)

FWIW, I'm not sure it's fine to use the xc_physdev prefix here, as
this is not a PHYSDEVOP hypercall.

As Anthony suggested, it would be better placed in xc_linux.c, and
possibly named xc_pcidev_get_gsi() or similar, to avoid polluting the
xc_physdev namespace.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 13:11:39 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 13:11:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769736.1180627 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZVag-0005Nw-2x; Thu, 01 Aug 2024 13:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769736.1180627; Thu, 01 Aug 2024 13:11:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZVag-0005Np-0J; Thu, 01 Aug 2024 13:11:34 +0000
Received: by outflank-mailman (input) for mailman id 769736;
 Thu, 01 Aug 2024 13:11:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZVae-0005Nh-Se
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 13:11:32 +0000
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com
 [2a00:1450:4864:20::12e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 920dd306-5007-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 15:11:31 +0200 (CEST)
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-52f01993090so10330401e87.2
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 06:11:31 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5ac64eb3a95sm10056078a12.61.2024.08.01.06.11.30
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 06:11:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 920dd306-5007-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722517891; x=1723122691; 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=tPaGhsM7MflGvFGh6jb6p9SngIPeCMIN8hRaBgZRVEg=;
        b=KUcHXlep12RhqnJFQXaNoMC0UP4/jHeb9eWGVKbjBSe7B/udiTK7Kf0DSqIbgtixWW
         W+BjzN8fEpLHil2Ih6whksEjX4f03UQsk5W8SeE3FuS/znH1JP2AweB77Az9OT4lbxY8
         dgDgs56Mumo29NwUDj/PuP0JBYQRXfZAvLwZrEFbuiFh28O5IFgVnLRVa3UclOAcvYLQ
         RZvTyaEdstBlLD950bBvH7lm4KJWvbpccM1OWBYsXU/znEALND3FD+gw2mugqp/9+iIA
         z5X7QXQObAO3uG9DjMEF3TUQE9WbbpUDg+Cap40tin0Wb16fzh6HcSGdtsqnV/VrLpYk
         fs0g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722517891; x=1723122691;
        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=tPaGhsM7MflGvFGh6jb6p9SngIPeCMIN8hRaBgZRVEg=;
        b=ZPS+JlURozAjItFW33HrN8w5q5850DbHpiLvFamY0tv+lUsP8vqCAq/IZTeCyyxaN7
         vzyX/VXskEexwuPE3yJ21BeavhA50QId+F0lgEMEvJ0k5pcAZcECgrisFyBFCX8ALAJw
         YwaGWkaoUzEgRjw9oVcCCOpl1EBVKBDF/rAFG7q2rHZQ59m0wzOqviwb8arzvJ4DX9P5
         PSNQLVv4eCHQEiQyReO4thAzhkNUBE/TDaYRQNplsiDXSRqhPBWeDgDuXFLp9Y2nGTRv
         Yja2Zs682uVrFHEs7JHdEYArQN0LGyiayZ8jol9v2q6FlkW06YR9x1hzpxEw4BFSnpTy
         +UNw==
X-Forwarded-Encrypted: i=1; AJvYcCXjZCZveRp1BXgGSIHuHs03KwGoWE2T8Gpe278m6vkF5aBzK0DXevUagMTDCOpeSBWFnQe9jZoMi7u0v9KNzzySbqUeSVTUGrMFqBojobI=
X-Gm-Message-State: AOJu0YxS+99Bbiq3J/6EylRILF+oT4ErdTQdcniI9AeX14Lah3BnhV5v
	kmGYsuiAB0syfwuh/cdoZcEkMe4Qc7gK+sqSaqVlrmWZh/gpquNDHmbLy1adEQ==
X-Google-Smtp-Source: AGHT+IGki6ui5oE42OlBASHVAr0OyYh9s+++s79F/9t6E68LjnUvPzAaNhR3wvTRTnzsLW9RGKA1Qw==
X-Received: by 2002:ac2:434f:0:b0:52e:f77b:bb58 with SMTP id 2adb3069b0e04-530b61c8df8mr1509318e87.36.1722517891026;
        Thu, 01 Aug 2024 06:11:31 -0700 (PDT)
Message-ID: <d2b95ad1-fc61-4c86-b0d7-530720e1e483@suse.com>
Date: Thu, 1 Aug 2024 15:11:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v12 4/7] x86/domctl: Add hypercall to set the access
 of x86 gsi
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Cc: "Daniel P . Smith" <dpsmith@apertussolutions.com>,
 xen-devel@lists.xenproject.org, Andrew Cooper <andrew.cooper3@citrix.com>,
 Wei Liu <wl@xen.org>, George Dunlap <gwd@xenproject.org>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>, Juergen Gross <jgross@suse.com>,
 Stewart Hildebrand <Stewart.Hildebrand@amd.com>,
 Huang Rui <ray.huang@amd.com>, Jiqian Chen <Jiqian.Chen@amd.com>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-5-Jiqian.Chen@amd.com> <ZqtsQwZNyFzflDQt@macbook>
 <ec95b413-519d-46a4-be41-ebb6a375612a@suse.com> <ZquCatoi50cNI3qR@macbook>
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: <ZquCatoi50cNI3qR@macbook>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 01.08.2024 14:41, Roger Pau Monné wrote:
> On Thu, Aug 01, 2024 at 01:36:16PM +0200, Jan Beulich wrote:
>> On 01.08.2024 13:06, Roger Pau Monné wrote:
>>> On Mon, Jul 08, 2024 at 07:41:21PM +0800, Jiqian Chen wrote:
>>>> Remaining comment @Daniel P . Smith:
>>>> +        ret = -EPERM;
>>>> +        if ( !irq_access_permitted(currd, irq) ||
>>>> +             xsm_irq_permission(XSM_HOOK, d, irq, access_flag) )
>>>> +            goto gsi_permission_out;
>>>> Is it okay to issue the XSM check using the translated value, 
>>>> not the one that was originally passed into the hypercall?
>>>
>>> FWIW, I don't see the GSI -> IRQ translation much different from the
>>> pIRQ -> IRQ translation done by pirq_access_permitted(), which is also
>>> ahead of the xsm check.
>>
>> The question (which I raised originally) isn't an ordering one, but an
>> auditing one: Is it okay to pass the XSM hook a value that isn't what
>> was passed into the hypercall?
> 
> But that's also the case with the current XEN_DOMCTL_irq_permission
> implementation?  As the hypercall parameter is a pIRQ, and the XSM
> check is done against the translated IRQ obtained from the pIRQ
> parameter.

In a way you're right, but in a way there's also a meaningful difference:
There we translate between internal numbering spaces. Here we first
translate a quantity in a numbering space superimposed onto us to an
internal representation. Flask, otoh, in such a situation may prefer to
see the external representation of the resource.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 13:16:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 13:16:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769746.1180638 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZVf9-0006JL-Ke; Thu, 01 Aug 2024 13:16:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769746.1180638; Thu, 01 Aug 2024 13:16:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZVf9-0006JE-HN; Thu, 01 Aug 2024 13:16:11 +0000
Received: by outflank-mailman (input) for mailman id 769746;
 Thu, 01 Aug 2024 13:16:09 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZVf7-0006J8-LH
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 13:16:09 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 368046c1-5008-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 15:16:07 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-a7ab5fc975dso628301466b.1
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 06:16:07 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7acadb021asm896516466b.188.2024.08.01.06.16.06
 for <xen-devel@lists.xenproject.org>
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 06:16:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 368046c1-5008-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722518167; x=1723122967; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=KIlJt0Dm6+MO9ZJxLHt8WiA1qer2aN0kK9w3KAfqEpk=;
        b=Y+gO9LLluD2Q50Pny6XOhPx6Wkkl3n7hut/FbykOiOjQ607NxTlOHdEEF03QaLtZ9s
         XcwifU4TP6sc5Iiiy0VPa/EPuOhBLo+JUbYUKyseV8pZoQ5HxbIT3lqa2XCjzSBxYv7m
         +nMKAWMceq8KWEgvzkQ+/eocZ1HiZf6vyHBVZ1gNZa0u04hOziOp6ywweIv+3+7bwK78
         rSs0bFUBrPmNi1bocDcomjCmCOWMHXQ+p+kfJtazBsLiHCzkDoJQNx+gEAPevnP8ASYX
         oc74SqX1Wk3l8ni+oK7pTWs+7d8W2gCYcys2BlHSArsTm+eeuPCd5C9TPY6xVwWerEs6
         FBbg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722518167; x=1723122967;
        h=content-transfer-encoding:in-reply-to:autocrypt: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=KIlJt0Dm6+MO9ZJxLHt8WiA1qer2aN0kK9w3KAfqEpk=;
        b=txC8rorJ+LtYb6NsWgb79X4nEjkoi4nX7R93TlAlJNYVrKaxOG8CCcJS/RfyRVUX5v
         6Xamfb3+2tHEDdji9/se0bCMQGwniXIxH86YFqjEE77oiGXUyJnfHrMmyTYcvrjRGWxW
         jK4HA0ulaZ9zJEuAK53j/erG/iF6Vv9sDzHAXt+N8IFXz18jsY0c3ZSMImWuTBksBn3W
         /Sn+VZQo4UisKIDbL/mJ34wQPek/dLaRis0rUeVfFYRSn88O8KuXAlFr7aEC2hg194tb
         kRixoVrKYYft9LXFSOOBPT9XYU/NDRd7Fbt3OIy48YfB7nk6gRdMPDOg504vuCXHoBqD
         kGmA==
X-Gm-Message-State: AOJu0YwFCh237UxWW2WwKyRk/A4P46PPD/ujFrlXjSHnzTImD+N2IZdl
	ToRn1ETa+RzohlhZAjLtoMFikQJ+PpPVb1wkBrb1ntRrr8tUACtRVAA+H1EISVO5lLlh6EsZF4E
	=
X-Google-Smtp-Source: AGHT+IGu6I6Tp0BlbFIv6OsMUavM6tOhZnCT4h/iPRBsz9QU9UCC6GRpOm+sDhKgSFXTEN0KvSu54g==
X-Received: by 2002:a17:907:7fa1:b0:a77:da14:8403 with SMTP id a640c23a62f3a-a7dc4da9bb4mr11244766b.2.1722518166898;
        Thu, 01 Aug 2024 06:16:06 -0700 (PDT)
Message-ID: <a074fa7e-1c8c-4631-b560-b9f3d392d32a@suse.com>
Date: Thu, 1 Aug 2024 15:16:04 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: xen | Failed pipeline for staging | 1c4fb9bb
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <66ab862e37ff4_2e28037507127b@gitlab-sidekiq-catchall-v2-6785bcc687-745p7.mail>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <66ab862e37ff4_2e28037507127b@gitlab-sidekiq-catchall-v2-6785bcc687-745p7.mail>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 01.08.2024 14:57, GitLab wrote:
> 
> 
> Pipeline #1396969716 has failed!
> 
> Project: xen ( https://gitlab.com/xen-project/hardware/xen )
> Branch: staging ( https://gitlab.com/xen-project/hardware/xen/-/commits/staging )
> 
> Commit: 1c4fb9bb ( https://gitlab.com/xen-project/hardware/xen/-/commit/1c4fb9bb49b7babbcaa0b62384841ba4acb49356 )
> Commit Message: x86/vmx: replace CONFIG_HVM with CONFIG_INTEL_V...
> Commit Author: Sergiy Kibrik
> Committed by: Jan Beulich ( https://gitlab.com/jbeulich )
> 
> 
> Pipeline #1396969716 ( https://gitlab.com/xen-project/hardware/xen/-/pipelines/1396969716 ) triggered by Jan Beulich ( https://gitlab.com/jbeulich )
> had 1 failed job.
> 
> Job #7482814581 ( https://gitlab.com/xen-project/hardware/xen/-/jobs/7482814581/raw )
> 
> Stage: test
> Name: adl-pci-hvm-x86-64-gcc-debug

The only anomaly (not Xen-related) I can spot in the log is

** read zero bytes from stdin **

Terminating...
Thanks for using picocom

How to explain that I have no clue.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 13:21:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 13:21:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769757.1180651 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZVkZ-0008SF-7B; Thu, 01 Aug 2024 13:21:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769757.1180651; Thu, 01 Aug 2024 13:21:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZVkZ-0008S8-4X; Thu, 01 Aug 2024 13:21:47 +0000
Received: by outflank-mailman (input) for mailman id 769757;
 Thu, 01 Aug 2024 13:21:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZVkX-0008Ry-TJ; Thu, 01 Aug 2024 13:21:45 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZVkX-0005xK-S1; Thu, 01 Aug 2024 13:21:45 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZVkX-0002tk-Ct; Thu, 01 Aug 2024 13:21:45 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZVkX-0004S4-CF; Thu, 01 Aug 2024 13:21:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=mrGUQDnQdGh0k+EAW+PVh0zaIMoZUvxVCsHHyZLFfNI=; b=oSrU45WF4pxSQwYs4Cg3JOkuHi
	IkRZ3M0frkMme0YYm3HJvph4q9FyrL7HrHYaCQklPzRQVrC1xkwbPlH3qvH+AHSrPUg8xN7FLMfxt
	0xkG/S0mrGbTh4tXr5G+pwrXfiF+eoTtFwGrlXBOi2/9fSFNhqVzaKE6yDyBfDT9ep5g=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187105-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187105: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=71b9bda1ace32a479d471f26b0e516d0618053bc
X-Osstest-Versions-That:
    ovmf=85fad9912c860927aec3953e213662ea1f397c23
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 13:21:45 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 71b9bda1ace32a479d471f26b0e516d0618053bc
baseline version:
 ovmf                 85fad9912c860927aec3953e213662ea1f397c23

Last test of basis   187104  2024-08-01 08:43:23 Z    0 days
Testing same since   187105  2024-08-01 11:45:02 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Aaron Pop <aaronpop@microsoft.com>
  Antaeus Kleinert-Strand <59579659+antklein@users.noreply.github.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   85fad9912c..71b9bda1ac  71b9bda1ace32a479d471f26b0e516d0618053bc -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 15:23:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 15:23:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769790.1180661 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZXdl-0000Kg-Jr; Thu, 01 Aug 2024 15:22:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769790.1180661; Thu, 01 Aug 2024 15:22:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZXdl-0000KZ-HG; Thu, 01 Aug 2024 15:22:53 +0000
Received: by outflank-mailman (input) for mailman id 769790;
 Thu, 01 Aug 2024 15:22:53 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=lMHA=PA=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1sZXdl-0000KS-3P
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 15:22:53 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e9376b6e-5019-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 17:22:50 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.18.1/8.17.1) with ESMTPS id 471FMd1I039561
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Thu, 1 Aug 2024 11:22:45 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.18.1/8.15.2/Submit) id 471FMblE039560;
 Thu, 1 Aug 2024 08:22:37 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e9376b6e-5019-11ef-8776-851b0ebba9a2
Date: Thu, 1 Aug 2024 08:22:37 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: xen-devel@lists.xenproject.org
Cc: Andrei Semenov <andrei.semenov@vates.tech>, xen-devel@lists.xenproject.org,
        Andrew Cooper <andrew.cooper3@citrix.com>,
        Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
        jgross@suse.com, Wei Liu <wl@xen.org>,
        Kelly Choi <kelly.choi@cloud.com>
Subject: Re: AMD EPYC virtual network performances
Message-ID: <ZquoPSDZ40bSG9k+@mattapan.m5p.com>
References: <959bbf84-24da-4da3-a059-dc1aa32b27ef@vates.tech>
 <Zo7euOa87jCNvjV8@mattapan.m5p.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <Zo7euOa87jCNvjV8@mattapan.m5p.com>

On Wed, Jul 10, 2024 at 12:19:20PM -0700, Elliott Mitchell wrote:
> On Tue, Jul 09, 2024 at 08:36:18AM +0000, Andrei Semenov wrote:
> > 
> > Does anybody notice this behavior on his side? Can we do something 
> > about it?
> 
> I hadn't previously noticed this manifestation, but now that I know where
> to look seems I'm also seeing the issue.
> 
> It also effects PVH domains, but may not have as much impact.
> 
> It also effects virtual block devices.
> 
> 
> Right now I consider this highly speculative, but I am now wondering
> whether the software RAID1 issue is related to this.

Having considered what I'm observing a bit more, this is pure
speculation; however, there is a rather severe situation to consider.

I now suspect most/all of the lines showing up in `xl dmesg` due to
iommu=debug are likely associated with the spurious interrupt issue, not
the RAID1 issue.  The result is iommu=debug is useless for attempting to
debug anything other than the spurious interrupt issue.  The messages
associated with the spurious interrupts are generating too much noise.

The spurious interrupt issue seems to be pretty severe.

In other news, appears iommu=no-intremap does not address the
software-RAID1 issue.  Could be it reduces performance sufficiently
to somewhat mitigate the issue though.

I am also looking attempting to track down one other issue which might
also mitigate this.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Thu Aug 01 15:27:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 15:27:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769798.1180670 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZXhm-00018w-2V; Thu, 01 Aug 2024 15:27:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769798.1180670; Thu, 01 Aug 2024 15:27:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZXhl-00018p-WB; Thu, 01 Aug 2024 15:27:01 +0000
Received: by outflank-mailman (input) for mailman id 769798;
 Thu, 01 Aug 2024 15:27:00 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZXhk-00018f-U0; Thu, 01 Aug 2024 15:27:00 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZXhk-00088G-N9; Thu, 01 Aug 2024 15:27:00 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZXhk-00065x-Cd; Thu, 01 Aug 2024 15:27:00 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZXhk-0006RS-C9; Thu, 01 Aug 2024 15:27:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Blho4DY+pD/VDHUnJ3TQVeMRBZ1dhOip08sp/0cFITA=; b=RwY4sdHyrH+XQAg2Ma9ZmXS8OK
	YP80nKMN/1kZoIQ0qGT+0q+ZU+fyUMExvl+zBU0Zb957N8S6zEyvaL38niH2K+aN8XLt1d2h6FoRM
	FrL8vqZkPMNs9YG/FjATmoMaleNSR4YfeKdWxZJCmH+9JOksP+FKlFmONcpFiFJtiBps=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187108-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187108: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=a679ceca974e94a659f9b6b9e7a7900644220ef9
X-Osstest-Versions-That:
    ovmf=71b9bda1ace32a479d471f26b0e516d0618053bc
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 15:27:00 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 a679ceca974e94a659f9b6b9e7a7900644220ef9
baseline version:
 ovmf                 71b9bda1ace32a479d471f26b0e516d0618053bc

Last test of basis   187105  2024-08-01 11:45:02 Z    0 days
Testing same since   187108  2024-08-01 13:45:09 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Pierre Gondois <Pierre.Gondois@arm.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   71b9bda1ac..a679ceca97  a679ceca974e94a659f9b6b9e7a7900644220ef9 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 15:36:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 15:36:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769810.1180682 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZXqi-0002yA-0Z; Thu, 01 Aug 2024 15:36:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769810.1180682; Thu, 01 Aug 2024 15:36:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZXqh-0002y3-Rp; Thu, 01 Aug 2024 15:36:15 +0000
Received: by outflank-mailman (input) for mailman id 769810;
 Thu, 01 Aug 2024 15:36:14 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8r7L=PA=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZXqg-0002xx-EX
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 15:36:14 +0000
Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com
 [2607:f8b0:4864:20::1133])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c74c7552-501b-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 17:36:11 +0200 (CEST)
Received: by mail-yw1-x1133.google.com with SMTP id
 00721157ae682-6659e81bc68so63245167b3.0
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 08:36:11 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6bb3f942676sm85193016d6.72.2024.08.01.08.36.09
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 01 Aug 2024 08:36:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c74c7552-501b-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722526570; x=1723131370; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=mCpU/JGv0oEoOiI6W+LpiCFVOtkG6WC1VLSv5IR9jYo=;
        b=hMUlUW+LkDLMN0/D49xPVUS+M/E6EzX1HoBuuQaEmyGB3fwDdCYtx7EWmAEg65mcBI
         +2CHzHxEC4MSObxPRbaLSlkK98QqUUz7dGYG8/Q7wprTvLQ6qDhMF7c05WrxnPvhI8n2
         KiFlSwWeYZo9+Ug4TNsx0Hupo+zxpxxw7dO0A=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722526570; x=1723131370;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=mCpU/JGv0oEoOiI6W+LpiCFVOtkG6WC1VLSv5IR9jYo=;
        b=JgN8TgqPsuihU6Y2YD/2jELNkdT2ddy9uKLLqQjVuRbqHpFbYUTm5wMn7MLZcXUDlB
         MVHKsJoFjd5V+CdDcHSM/QnNXqboW/VRK+kPrpDmLf3qBfYLbXoZKgSnSnQdAXRWo+cx
         o3YY3TBovqsDDkqa4oWawf8JzMqVvBczSjqIJ/qPp3mHjNhvGrBg6Ygp0nvvF8WKf+w3
         unYp572UoBr743snCjFIQS6LIc30EbmgD3mLpAWRSJbMxYvCTqTumsVJJ4qz3dJL9Hvs
         Y9kNITUD9DCqJIbloFRZCpVG9FrbbrZjAI1rQW++Ty+779nb1Uo/CNwIQHqzTCVIv9rE
         ME8g==
X-Forwarded-Encrypted: i=1; AJvYcCWW1EDzS5qrHBf15ll589KKdwCxnQUYIB55ZuV3urCly5KlL1KzdTvljDzRzj74IYhXOHqdrfkZ5LC7FGGz2Zlh2nasuO8oAehoBnjxtN4=
X-Gm-Message-State: AOJu0YymQ/I/7U760RJCgcFc5NfAU+6R5MRh0WVRCK08xce1BqTyPy95
	CmxI/T2OKLwRTjrinxvDxPYG0G1/hCDm0nMC1qEaEw/PURRN4RQMCbhgWnKrVgI=
X-Google-Smtp-Source: AGHT+IHGPnp0LjOBrBDfqUK8LBv59Mjo5Z5EkPXC6oEEMOOJuk0iHTTUBA0IqSa8ONcGNxyZ2gsvTg==
X-Received: by 2002:a0d:c147:0:b0:649:8f00:5254 with SMTP id 00721157ae682-6895f609d78mr4293367b3.1.1722526570241;
        Thu, 01 Aug 2024 08:36:10 -0700 (PDT)
Date: Thu, 1 Aug 2024 17:36:08 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3] x86/dom0: delay setting SMAP after dom0 build is done
Message-ID: <ZquraLjpMe9fToZd@macbook>
References: <20240801095201.91180-1-roger.pau@citrix.com>
 <988147f4-3de2-4aae-99cc-7d0ba48b158f@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <988147f4-3de2-4aae-99cc-7d0ba48b158f@suse.com>

On Thu, Aug 01, 2024 at 12:28:06PM +0200, Jan Beulich wrote:
> On 01.08.2024 11:52, Roger Pau Monne wrote:
> > @@ -1907,16 +1890,25 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
> >      if ( cpu_has_smep && opt_smep != SMEP_HVM_ONLY )
> >          setup_force_cpu_cap(X86_FEATURE_XEN_SMEP);
> >      if ( boot_cpu_has(X86_FEATURE_XEN_SMEP) )
> > +    {
> >          set_in_cr4(X86_CR4_SMEP);
> > +        cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;
> 
> Could be just "cr4_pv32_mask = X86_CR4_SMEP" now?

Yes, indeed, same below then.

> > +    }
> >  
> >      if ( !opt_smap )
> >          setup_clear_cpu_cap(X86_FEATURE_SMAP);
> >      if ( cpu_has_smap && opt_smap != SMAP_HVM_ONLY )
> >          setup_force_cpu_cap(X86_FEATURE_XEN_SMAP);
> >      if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> > -        set_in_cr4(X86_CR4_SMAP);
> > -
> > -    cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;
> > +        /*
> > +         * Set SMAP on the %cr4 mask so that it's set for APs on bringup, but
> > +         * don't set for the BSP until domain building is done.
> > +         *
> > +         * Don't set it in cr4_pv32_mask either, until it's also set on the
> > +         * BSP.  Otherwise the BUG in cr4_pv32_restore would trigger for events
> > +         * received on the BSP.
> > +         */
> > +        mmu_cr4_features |= X86_CR4_SMAP;
> 
> Don't you put APs at risk this way of triggering the BUG in cr4_pv32_restore()?
> They'll have the bit set in %cr4, but the bit remains clear in cr4_pv32_mask
> until much later.

As long as the bit is set in %cr4, but not in cr4_pv32_mask the BUG in
cr4_pv32_restore won't hit.

> > @@ -2048,6 +2040,18 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
> >      if ( !dom0 )
> >          panic("Could not set up DOM0 guest OS\n");
> >  
> > +    /*
> > +     * Enable SMAP only after being done with the domain building phase, as the
> > +     * PV builder switches to the domain page-tables and must be run with SMAP
> > +     * disabled.
> > +     */
> > +    if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> > +    {
> > +        ASSERT(mmu_cr4_features & X86_CR4_SMAP);
> > +        write_cr4(read_cr4() | X86_CR4_SMAP);
> > +        cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;
> > +    }
> 
> Similarly for the BSP here: If we take an NMI between setting CR4.SMAP and
> setting the bit in cr4_pv32_mask, cr4_pv32_restore() would hit the BUG
> there if I'm not mistaken.

No, having extra bits set in %cr4 not present in cr4_pv32_mask won't
trigger the BUG.  It's the other way around, having bits set in
cr4_pv32_mask but not in %cr4.  As long as %cr4 is always updated
ahead of setting the bit in cr4_pv32_mask that's fine.

See the logic in cr4_pv32_restore:

        /* Check that _all_ of the bits intended to be set actually are. */
        mov   %cr4, %rax
        and   cr4_pv32_mask(%rip), %rax
        cmp   cr4_pv32_mask(%rip), %rax
	je    1j
	[...]
	BUG

Otherwise none of this would be safe, as it's impossible to set %cr4
and cr4_pv32_mask atomically in a single instruction.

> I further fear that switching things around won't
> help either. The code you remove from create_dom0() looks to have the same
> issue. The only NMI-safe sequence looks to be: Clear both bits from %cr4,
> update cr4_pv32_mask as wanted, and then write %cr4 with the bits from
> cr4_pv32_mask ORed in.

No, that won't be safe, as cr4_pv32_mask would contain bits not set in
%cr4 and cr4_pv32_restore would hit the BUG.  The update order is the
%other way around, first set in %cr4, then in cr4_pv32_mask.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 15:46:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 15:46:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769820.1180695 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZY0q-0004wV-1a; Thu, 01 Aug 2024 15:46:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769820.1180695; Thu, 01 Aug 2024 15:46:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZY0p-0004wO-Tn; Thu, 01 Aug 2024 15:46:43 +0000
Received: by outflank-mailman (input) for mailman id 769820;
 Thu, 01 Aug 2024 15:46:42 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZY0n-0004wI-Ug
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 15:46:41 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3df69f1f-501d-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 17:46:39 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a7d89bb07e7so430464966b.3
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 08:46:39 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7acac63795sm922091966b.95.2024.08.01.08.46.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 08:46:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3df69f1f-501d-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722527199; x=1723131999; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=G0AdGzIYtGy1+3Ykuc13cBM0Lq0WYYcBrKl57sNtIJM=;
        b=IAqw5APk8mkh2zJdQWEjj0ZUsHn3ctZmzpMEqDAC7nk56WdfQinavBg8dTO6mtSiNB
         Zjp5XWLUPOYiNMiGwY3TArrOgEvWbVu0R/JfSIn4nmpi3Y6obfxKEq65rFm/ACC2/YdD
         gFdmULkuZQ1To9uPnPJenItZeeLUDFgc3wwWMa6czzbTJHxPBA95OXqYtENyXQ3I460v
         q9kFkdBI8QCWbLVwrLKHdGfHSrYMRQWWXLOSOy4Mqxiu6O6kqSGeupTNqgY20CuV+sg4
         qX81IcoxOepHHxUedS0usS10V351DvCWW6kgI0Efa3+PVI7gOjzgGlWhAY4xPDsRZQ3L
         KV0w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722527199; x=1723131999;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=G0AdGzIYtGy1+3Ykuc13cBM0Lq0WYYcBrKl57sNtIJM=;
        b=rD3t7Ot5wmPd88CQ7PYcDDqDW2fm0j4HlIqcazP1a7nngY4XzAZqd4Ft0rTnrtEp7e
         FujDUx2epw0LVmymUXn/PF8MQ/1v8QFkZeD5+J17y6W/475eGvUKQCf5wORHxkg4/5in
         scaBQSQcrQ8Lt+ImqMhGivRAnlCr6EeFR4+a8p07JcRsktPR3SUpdg9U+IwjXQWRY4Vd
         MuSbmfah39DwV0KFvyyS5U2aNTGs3fxZNh6mFi9id3R4uyiAB4Phcf1SXhSeOGj/6cLF
         o4sxA6I/lOHIZ6arQlu1SNbTgnCfDqMqbO96tiA+AmmYzzMwc5iS+bPD1LTohXarIUzK
         6KdQ==
X-Gm-Message-State: AOJu0YzKesyy4sF6mH/A/ppD2rFb2YCREXFR82WChvryDHY0xT4xr379
	L5JbVBxxYhpX35NksammVe451ANoTXmpWW1FYj92ayFRaZQWWo1wUGncTpUHjev6Y8I5JERufU8
	=
X-Google-Smtp-Source: AGHT+IGn6Fq3QUlyr+OIzWQOkig+HIvNeN5H53n5nCQwhu676hKRt5d7Pyk+TrvHdZUr/EPEQD3j+A==
X-Received: by 2002:a17:906:6a11:b0:a7a:b43e:86e4 with SMTP id a640c23a62f3a-a7dc4e68c0fmr55620166b.27.1722527198874;
        Thu, 01 Aug 2024 08:46:38 -0700 (PDT)
Message-ID: <cf280800-d0d6-4493-933f-f83f418dd91d@suse.com>
Date: Thu, 1 Aug 2024 17:46:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony Perard <anthony@xenproject.org>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] mktarball: only archive Xen
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

As was basically decided already a while ago, remove - in the simplest
possible way - the archiving of both qemu-s and mini-os from tarball
generation.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
This is the simplistic approach; I'm sure this could now be done quite a
bit more efficiently. I also expect there's no longer a need to run
./configure ahead of the invocation of this script, but since I have no
idea why it was needed earlier on, I'm not removing that here from the
doc. I further expect that the subtree-force-update-all prereq could
also be dropped from the two involved Makefile goals. As that
intermediate goal isn't used for any other purpose, the question there
would be whether there's any reason to retain it. IOW all cleanup that's
probably better done separately, by someone actually using all of that
machinery.

--- a/tools/misc/mktarball
+++ b/tools/misc/mktarball
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# mktarball: Make a release tarball (including xen, qemu, and qemu-traditional)
+# mktarball: Make a release tarball (including just xen)
 #
 # Takes 2 arguments, the path to the dist directory and the version
 set -ex
@@ -29,26 +29,6 @@ mkdir -p $tdir
 
 git_archive_into $xen_root $tdir/xen-$desc
 
-# We can't use git_archive_into with qemu upstream because it uses
-# git-submodules.  git-submodules are an inherently broken git feature
-# which should never be used in any circumstance.  Unfortunately, qemu
-# upstream uses them.  Relevantly for us, git archive does not work
-# properly when there are submodules.
-(
-    cd $xen_root/tools/qemu-xen-dir-remote
-    # if it's not clean, the qemu script will call `git stash' !
-    git --no-pager diff --stat HEAD
-    scripts/archive-source.sh $tdir/xen-$desc/tools/qemu-xen.tar
-    cd $tdir/xen-$desc/tools
-    mkdir qemu-xen
-    tar <qemu-xen.tar Cxf qemu-xen -
-    rm qemu-xen.tar
-)
-
-git_archive_into $xen_root/tools/qemu-xen-traditional-dir-remote $tdir/xen-$desc/tools/qemu-xen-traditional
-
-git_archive_into $xen_root/extras/mini-os-remote $tdir/xen-$desc/extras/mini-os
-
 GZIP=-9v tar cz -f $xen_root/dist/xen-$desc.tar.gz -C $tdir xen-$desc
 
 echo "Source tarball in $xen_root/dist/xen-$desc.tar.gz"


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 15:51:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 15:51:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769830.1180704 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZY5r-0006SE-I9; Thu, 01 Aug 2024 15:51:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769830.1180704; Thu, 01 Aug 2024 15:51:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZY5r-0006S7-Ex; Thu, 01 Aug 2024 15:51:55 +0000
Received: by outflank-mailman (input) for mailman id 769830;
 Thu, 01 Aug 2024 15:51: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=8r7L=PA=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZY5p-0006S1-CA
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 15:51:53 +0000
Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com
 [2607:f8b0:4864:20::f2b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f80fed00-501d-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 17:51:52 +0200 (CEST)
Received: by mail-qv1-xf2b.google.com with SMTP id
 6a1803df08f44-6bb5a4668faso36447616d6.2
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 08:51:52 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6bb3f8d83e1sm86010026d6.5.2024.08.01.08.51.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 01 Aug 2024 08:51:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f80fed00-501d-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722527511; x=1723132311; darn=lists.xenproject.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=JDQZ8WqSBI4W95dOyPXKx4pNF6iHdRh2AldArtD2L7c=;
        b=JUlbcWvhNAuOYrEYPd3UK8V2BeqWij1jA3nl+1neCrllzUwtxX/mkB68vcZwvsfs5M
         Q3AMjtjUWYoCd2mrB6OJXt6OGrWcSHWSdCkfoetlbAgEwaGq1jJtgXXiAmoW4uiS2PIb
         5e0kEfTJodki4Qp9R60i5jAritcrdht4QsFeA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722527511; x=1723132311;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=JDQZ8WqSBI4W95dOyPXKx4pNF6iHdRh2AldArtD2L7c=;
        b=twAOvs7ORErUMqBFPftkiCG9d0kS4aqvCzI7+f3sZE4b3lzB/GuNlD5KG4LDjEjeTF
         XjkOA9JKSbOEM94qhhIBxr0Vmj0nZUeDqy/mtWuJ8A4ytbxBYKYKZ4na175/KreSHgxU
         qukN5MRw6Wwp2U2iWtIJBNe8y+Vt+bX4evg/bV4h7jbCIX0Phve9VvZ0gSoLYYpEb5GQ
         4/fOm5/bqbww15XeIatCJ6hRheWxORIzsWRmSwjbRA5n/r1dwGoJI12ha7mQAM88V5/g
         znyX9eU1HT8ix8Qes/XIfSErTOb+5AffYjGUXHIUo0MErRQyMHXE5jcuwfEhtzrh23ld
         qyfQ==
X-Gm-Message-State: AOJu0YzfqeM60tr+iwuMMuQysxooNxhmyPbz8qlN6t8BpWYLT4dYkUl4
	fmVLHlnh/GGZO0R3POfIs3k6yvFjEjaWrg5B1TwMuDt4taxrfYSqWMt3H94KieQ=
X-Google-Smtp-Source: AGHT+IFFOt4HNiVabyoR1/B3ujy2ZqsSVM91Cco8Pyik4br4E8ycHhvH7yB6BDl1YYlLgbV+wEHthw==
X-Received: by 2002:a05:6214:390a:b0:6b5:683:df5e with SMTP id 6a1803df08f44-6bb9839e050mr5670406d6.32.1722527511190;
        Thu, 01 Aug 2024 08:51:51 -0700 (PDT)
Date: Thu, 1 Aug 2024 17:51:49 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	"community.manager@xenproject.org" <community.manager@xenproject.org>
Subject: Re: [PATCH] x86: drop Xeon Phi support
Message-ID: <ZquvFfd0kr0oL1eW@macbook>
References: <44147507-65a4-4f21-aada-fa647f53ffd0@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <44147507-65a4-4f21-aada-fa647f53ffd0@suse.com>

On Tue, Jul 30, 2024 at 01:07:03PM +0200, Jan Beulich wrote:
> Do as was decided in Lisbon. Reportedly Xen hasn't been working very
> well on those processors anyway.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Roger Pau Monné <roger.pau@citrix.com>

Is there any chance of the Xeon Phi AVX512 extensions returning on
other processors?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 15:58:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 15:58:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769838.1180714 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZYCR-0007X8-8U; Thu, 01 Aug 2024 15:58:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769838.1180714; Thu, 01 Aug 2024 15:58:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZYCR-0007X1-5D; Thu, 01 Aug 2024 15:58:43 +0000
Received: by outflank-mailman (input) for mailman id 769838;
 Thu, 01 Aug 2024 15:58:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZYCQ-0007Wv-22
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 15:58:42 +0000
Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com
 [2a00:1450:4864:20::531])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ebeabc85-501e-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 17:58:41 +0200 (CEST)
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5a2ffc34722so4189671a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 08:58:41 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5ac63590592sm10316884a12.25.2024.08.01.08.58.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 08:58:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ebeabc85-501e-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722527920; x=1723132720; 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=uvlb3zd0Ja1LCtzWABlbmHpD5P5UU/odjZEXmbn6kps=;
        b=Ek75FNk6h3vBb9xDGmSJbqIsxB7Sxe2dAbPQDM0YBYvVINaYsYNPJZkLL05Gme9eNu
         CRuw/E51UQShzWKvo3bIMQtrBSSklDDb0nyRY+NqrMPQrOuNIqpsxrDSWkLmD1gxo9um
         JGrSt4RZX7/yQpNzfc8iQ9qny4zAY/umefOQE0DydtmBE2xMkEqxoPtwZAoGQMy1NL92
         VxqyuDEIopTXT5IrUZtDnsNg3CnVQ0AAt2fG0JICtkyN5HVMajN23Q7/Yi+e+Emy/EtN
         atwcta9JpaGR4O8AsfArn+sDgIJO+j3KLEzyTdjgSpDI9chSdY/vAQTaOkG36mKEZJeu
         psUg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722527920; x=1723132720;
        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=uvlb3zd0Ja1LCtzWABlbmHpD5P5UU/odjZEXmbn6kps=;
        b=UISdzQaI31KCBRT6xYbk6x67AuMSPb8Lann7kXfHTkBLQjLTH7ucpyfobuq6olGLb9
         cfQGRWqo2vfPoHF0w2eO3smUv4fwN9+tO/j+Zx6JgW6jXimwH7tUzGCdWKxkBFRuCuha
         0UoZljxwHI4MQyVWdBPA3XZwtZoZx9VJcJmleSNHHhPi9UwmdlA4jgtzP6vrdXhXSB7q
         /nZGlO46hYJTANUQLQzIyv+v1d3/A9bgWaDCn//I0ekMVnKw6VcSYKNJZZT+NsutA2Ul
         Ltp/CNI1ZaRUXON5FGC/DWAavRNx1H3lTZUoM/2gEAEFlt+1XCSV2Mg56a5YkhrRkG/6
         YEpA==
X-Forwarded-Encrypted: i=1; AJvYcCX7osBpEeZ7C5SstFBCr47n6alixdD4ySpODsK1QhBap2yrffaGYYsFbU4t6sCHOAH09uS0HE79/2HRciVTTQVdxWr83Zdh80M9pJKeLkg=
X-Gm-Message-State: AOJu0YwG/VSx35KHK62bO3+QCafjQiOt1DwbusIQpqViNSrg9rXbPXwo
	xuad0TqWc19NiqQv+SxhKgNRQCiObIcaKOSNytkwomFFC+6peEoPsYD35Y7XnA==
X-Google-Smtp-Source: AGHT+IFJG1Q32Sh2aULfHAtGv1KpzPzPdNBCixhtIdbr6WYKQYw4oD0nrnSkfAEcJ2D73Af1rIYyUw==
X-Received: by 2002:a05:6402:5253:b0:57d:455:d395 with SMTP id 4fb4d7f45d1cf-5b77c28ed64mr1696721a12.7.1722527920383;
        Thu, 01 Aug 2024 08:58:40 -0700 (PDT)
Message-ID: <f3aedd33-f3ac-4a75-82db-5da827a6fc5e@suse.com>
Date: Thu, 1 Aug 2024 17:58:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/dom0: delay setting SMAP after dom0 build is done
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <20240801095201.91180-1-roger.pau@citrix.com>
 <988147f4-3de2-4aae-99cc-7d0ba48b158f@suse.com> <ZquraLjpMe9fToZd@macbook>
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: <ZquraLjpMe9fToZd@macbook>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 01.08.2024 17:36, Roger Pau Monné wrote:
> On Thu, Aug 01, 2024 at 12:28:06PM +0200, Jan Beulich wrote:
>> On 01.08.2024 11:52, Roger Pau Monne wrote:
>>> @@ -1907,16 +1890,25 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
>>>      if ( cpu_has_smep && opt_smep != SMEP_HVM_ONLY )
>>>          setup_force_cpu_cap(X86_FEATURE_XEN_SMEP);
>>>      if ( boot_cpu_has(X86_FEATURE_XEN_SMEP) )
>>> +    {
>>>          set_in_cr4(X86_CR4_SMEP);
>>> +        cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;
>>
>> Could be just "cr4_pv32_mask = X86_CR4_SMEP" now?
> 
> Yes, indeed, same below then.
> 
>>> +    }
>>>  
>>>      if ( !opt_smap )
>>>          setup_clear_cpu_cap(X86_FEATURE_SMAP);
>>>      if ( cpu_has_smap && opt_smap != SMAP_HVM_ONLY )
>>>          setup_force_cpu_cap(X86_FEATURE_XEN_SMAP);
>>>      if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
>>> -        set_in_cr4(X86_CR4_SMAP);
>>> -
>>> -    cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;
>>> +        /*
>>> +         * Set SMAP on the %cr4 mask so that it's set for APs on bringup, but
>>> +         * don't set for the BSP until domain building is done.
>>> +         *
>>> +         * Don't set it in cr4_pv32_mask either, until it's also set on the
>>> +         * BSP.  Otherwise the BUG in cr4_pv32_restore would trigger for events
>>> +         * received on the BSP.
>>> +         */
>>> +        mmu_cr4_features |= X86_CR4_SMAP;
>>
>> Don't you put APs at risk this way of triggering the BUG in cr4_pv32_restore()?
>> They'll have the bit set in %cr4, but the bit remains clear in cr4_pv32_mask
>> until much later.
> 
> As long as the bit is set in %cr4, but not in cr4_pv32_mask the BUG in
> cr4_pv32_restore won't hit.

Hmm, you're right. Despite staring at that for quite some time, I got
it wrong. Feel free to add
Reviewed-by: Jan Beulich <jbeulich@suse.com>
then, preferably with said minor adjustment (left in context above).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 16:00:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 16:00:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769845.1180724 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZYEB-00013l-JB; Thu, 01 Aug 2024 16:00:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769845.1180724; Thu, 01 Aug 2024 16:00:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZYEB-00013e-Fv; Thu, 01 Aug 2024 16:00:31 +0000
Received: by outflank-mailman (input) for mailman id 769845;
 Thu, 01 Aug 2024 16:00:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=WaX7=PA=bounce.vates.tech=bounce-md_30504962.66abb11b.v1-dbd45be96c39428d9f318541a8674454@srs-se1.protection.inumbo.net>)
 id 1sZYEA-00013Y-CQ
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 16:00:30 +0000
Received: from mail186-9.suw21.mandrillapp.com
 (mail186-9.suw21.mandrillapp.com [198.2.186.9])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2bbb76c8-501f-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 18:00:29 +0200 (CEST)
Received: from pmta10.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail186-9.suw21.mandrillapp.com (Mailchimp) with ESMTP id 4WZYZz1zTqzK5x1YM
 for <xen-devel@lists.xenproject.org>; Thu,  1 Aug 2024 16:00:27 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 dbd45be96c39428d9f318541a8674454; Thu, 01 Aug 2024 16:00:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2bbb76c8-501f-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1722528027; x=1722788527;
	bh=TFxzfvgw/uxxsVRwFTYa9keFpJOQlhgX0hgRntzEWCc=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=v/FVzIdDTwMwlwtgKFqUGvXtiM0WixaPxcWGGrTrOCOtSQOT81BGPdeq7/apNZoau
	 cboSeeIwdTjb4GzYf6zOSyAAk/RIPgajkAftSJjTuyb0WEd0FBQAGIap+pjC76nzJx
	 UPxcSsjwwKaR8YXHZ+O4Tk0jNqb8D6BaXR7jnFJo4XfMz9lBxG+b3ERjtGjtxsNe6A
	 +FMDbGDaWyOpIYxYP0KH8tshyCvoiUZMFZTLmbvNozc9qkt6jjpcHKoO2+OAv29hVc
	 vC2EhKYkmOq+Hos/sls/my+Gno11ZZITNiM9wulu9Lqd9FQ8USSG6PZdEOOJ7LcD6s
	 6Hbtnrj531hpQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1722528027; x=1722788527; i=anthony.perard@vates.tech;
	bh=TFxzfvgw/uxxsVRwFTYa9keFpJOQlhgX0hgRntzEWCc=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=iJjIbBuc8F1/v0tpo/7yyI9ZO+jDaOOLfVtwh3AmA/MyaDXOZUvHlfTSYike2kTKF
	 DkZEwRnlrDBrjz3mZoONFLpP1JZxZLAkDO9jf95+P/FUYQQ6ja3r1++Vf3caHhlt1v
	 bg8TzJMHpdue3jUTKgx7v4zMX23gY0hEyHke+Qcu9A4jHGUGPxOXrajUgVaA05bGbK
	 fR5qTpTUnalHKt0/3MCNS2mCAljZwC6OIx44+sJDGO1LSdi+KCPZ7OUipxXKavXOVC
	 YrZKS9g3roSJXUqz1V28peswH7S4VMY3wW33m1laGe2T6hQjbkXblPJIUfkJi2GWzi
	 fnZ23F07dWQYQ==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[XEN=20PATCH=20v7]=20tools/lsevtchn:=20Use=20errno=20macro=20to=20handle=20hypercall=20error=20cases?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1722528026043
To: Matthew Barnes <matthew.barnes@cloud.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
Message-Id: <ZquxGS2USjSsI9/i@l14>
References: <1240a14dea2f75d2e5b8d8e8bb685fac956629c6.1722442563.git.matthew.barnes@cloud.com>
In-Reply-To: <1240a14dea2f75d2e5b8d8e8bb685fac956629c6.1722442563.git.matthew.barnes@cloud.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.dbd45be96c39428d9f318541a8674454?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240801:md
Date: Thu, 01 Aug 2024 16:00:27 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Wed, Jul 31, 2024 at 05:18:44PM +0100, Matthew Barnes wrote:
> Currently, lsevtchn aborts its event channel enumeration when it hits
> an event channel that is owned by Xen.
> 
> lsevtchn does not distinguish between different hypercall errors, which
> results in lsevtchn missing potential relevant event channels with
> higher port numbers.
> 
> Use the errno macro to distinguish between hypercall errors, and
> continue event channel enumeration if the hypercall error is not
> critical to enumeration.
> 
> Signed-off-by: Matthew Barnes <matthew.barnes@cloud.com>

Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 16:00:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 16:00:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769849.1180734 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZYEc-0001UB-Q3; Thu, 01 Aug 2024 16:00:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769849.1180734; Thu, 01 Aug 2024 16:00:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZYEc-0001U4-Mw; Thu, 01 Aug 2024 16:00:58 +0000
Received: by outflank-mailman (input) for mailman id 769849;
 Thu, 01 Aug 2024 16:00: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=/4YK=PA=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZYEb-00013Y-CG
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 16:00:57 +0000
Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com
 [2a00:1450:4864:20::62d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3cccf999-501f-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 18:00:56 +0200 (CEST)
Received: by mail-ej1-x62d.google.com with SMTP id
 a640c23a62f3a-a7ab76558a9so397544466b.1
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 09:00:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7d9fbe215bsm213134866b.59.2024.08.01.09.00.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 09:00:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3cccf999-501f-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722528056; x=1723132856; 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=F56/nP6583iavNjwlSLSEy9oYVSjQF+kE2RihoWT7Kk=;
        b=UP0NR2JQAurXS1T56ZGzQOxViHQVaQNOk1cjTTw8CiuSmwYaa+Ab6jQB8iNkzXmwsC
         43eBzdJnEeQIeS4uh/VaR4D2PH3EeHCVQcaV5jbOdCwv2YS69ySK+8O7q19du+Zq2Je5
         fFhONOmjHaAIxrTupvNMQPeAA43BXzvDIS2t3/tUSQkzgOqZCxdP7A/9qh3UWqFcW2LX
         rkO2Hci26t7cdCv/dLK1uiwx6OS+O3ToDgCAOspylLp3GDvcIJ/sfcaFThb6BdHH4CIU
         w/cQV5wk76ctwIdBCCvuoVr4mzdRClopYgg1mYm1Xo8MtdqeJkL5A5jSHOHjCRRRb+3e
         J4AQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722528056; x=1723132856;
        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=F56/nP6583iavNjwlSLSEy9oYVSjQF+kE2RihoWT7Kk=;
        b=kmirlCmA4AdB+TPP+VO99b9jLJMa94IifW4DfPMT/MXCtqmQMih/G8WpOd0/mWSrh6
         zrMbLeKbDa3s8B4z3Lp8hs8RYHc8eWv01vaiU65Ljr4q/MzrcgVEItM75tHTdFsnQPf+
         16Vg8s1c7f/PFZnB4qr45Or5xgGxIsAuUsED6FFySkCCYOIDPwixE8+Em1K4pTGILFfC
         D5gK8hMQX6Lz/7GptyoOjl8Q7yFNYYFcsGyQGKj1wbbumhiPAOkAZRslVCH7rXqwrFVC
         ZEdfcbZ7NgomM4QYSmeSfkuEDu5O5r7ylzI9DcZyi8I4Z7uCkFmbDMIKaul28otFqCYc
         Fstw==
X-Gm-Message-State: AOJu0Yzl8JWpnfJVHvrwqY+w8LVqRgHhJu1qqq9kDMd4kG0CXYMGe1Y9
	Bit/5QM7GxglQXUu9CTYfZ6x4KR304ieTza06PCF+5uWtoyef2zruW7YD0e1Pw==
X-Google-Smtp-Source: AGHT+IHeAAgupyzY+QKnPhmh4mSzjRwESB4x/ZwIjohR05+/LdzMhb0VOYSXlTlqgA8BVc3PktqOFQ==
X-Received: by 2002:a17:906:6a1f:b0:a77:ab9e:9202 with SMTP id a640c23a62f3a-a7dbcb903e9mr175256766b.4.1722528055979;
        Thu, 01 Aug 2024 09:00:55 -0700 (PDT)
Message-ID: <b8fe7b32-9561-4e0d-b703-8ddc29408e0c@suse.com>
Date: Thu, 1 Aug 2024 18:00:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86: drop Xeon Phi support
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 "community.manager@xenproject.org" <community.manager@xenproject.org>
References: <44147507-65a4-4f21-aada-fa647f53ffd0@suse.com>
 <ZquvFfd0kr0oL1eW@macbook>
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: <ZquvFfd0kr0oL1eW@macbook>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 01.08.2024 17:51, Roger Pau Monné wrote:
> On Tue, Jul 30, 2024 at 01:07:03PM +0200, Jan Beulich wrote:
>> Do as was decided in Lisbon. Reportedly Xen hasn't been working very
>> well on those processors anyway.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Acked-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks.

> Is there any chance of the Xeon Phi AVX512 extensions returning on
> other processors?

Seems unlikely. They also never were AVX512VL-enabled. If they would
re-appear, we could undo some of this change then.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 16:02:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 16:02:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769862.1180744 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZYGL-0002Dz-A1; Thu, 01 Aug 2024 16:02:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769862.1180744; Thu, 01 Aug 2024 16:02:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZYGL-0002Ds-6B; Thu, 01 Aug 2024 16:02:45 +0000
Received: by outflank-mailman (input) for mailman id 769862;
 Thu, 01 Aug 2024 16:02:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8r7L=PA=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZYGJ-0002Di-GQ
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 16:02:43 +0000
Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com
 [2607:f8b0:4864:20::735])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7b101750-501f-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 18:02:41 +0200 (CEST)
Received: by mail-qk1-x735.google.com with SMTP id
 af79cd13be357-7a1d6f47112so450991585a.0
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 09:02:41 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a34f6e9dd2sm2499485a.39.2024.08.01.09.02.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 01 Aug 2024 09:02:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7b101750-501f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722528160; x=1723132960; darn=lists.xenproject.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=9nZVoL1BNgRXsYNGRKYQkK2x9+fw9cbTiX2OS2v2Elc=;
        b=EodysOKdhYJ39qbzTExZ+Et9uf+YwneoYjp/JuQ/9MUZmXxg0kvwt79lBQhKsrRR9a
         em9m1Kpq0OfRXhKBEputMN8ilhz78USdk38a53e1MQWlxbYCy8Japvf2YFt5E0k0yz44
         TaJAit5fJas+Fmze1/OeDUTn1cH8VxKnEJ+u0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722528160; x=1723132960;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=9nZVoL1BNgRXsYNGRKYQkK2x9+fw9cbTiX2OS2v2Elc=;
        b=bFnqoR46G08LZMBWw0j39p/F098nYQPRBOV0mhEPR7gSgroBzVI8+b1ZaigqG87VNR
         bxO7kv5Koop+q8sDSJ53PrAlJ+XsJfQMjYkfUlt4U1mF07J2WpwWLzr8CKJrcsSo8AB8
         aqwM2qbRwtwi2Ydui/8yPJm011YvdJfHmM9YvRVTFBxdPmIO6mSFbhVJx+SShN4IBBa6
         i7W2MaZm3C8GxDEmjbLwetZOxx5HOBXUQfiRGvoVkiVmiRl4gyTAvXSUsMEa7i3m4Pht
         zOr5mmTcjrYqBBXOHRa1O4hFDkgbbYb+StfT87PD1Vbe+JEKvm+Uis1Go1fwR+4WyEHp
         A24w==
X-Forwarded-Encrypted: i=1; AJvYcCW9RF1Op6EKtxm/7UqwbD+Yta01/W68Dg7dn176gPUarS3+0zfVh6xH5RJEp4zB17A11Y6dG/vLy4RdYOz/FsXr81V2d91cr2N9B4vbOYw=
X-Gm-Message-State: AOJu0YyR2tRFCs1sFhbdZQfQ60LZnTUXWVr17knjaWCk+GYXqhilcHGA
	uxuZiV51QWE8PdmgphU7wBbVjeIGFEFvh0tlL+amOVtGN1jEFFkpUa/gSnMNHaI=
X-Google-Smtp-Source: AGHT+IHn/R8Zlt4tHdGqBJ9GpCVX8cFYlzIdm5tSAX+H1UjMAWKygtF/fe7YtbzSVOxZWB++bsKWLw==
X-Received: by 2002:a05:620a:440e:b0:79d:5503:a925 with SMTP id af79cd13be357-7a34ef456b7mr49189385a.35.1722528160349;
        Thu, 01 Aug 2024 09:02:40 -0700 (PDT)
Date: Thu, 1 Aug 2024 18:02:34 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v3] x86/dom0: delay setting SMAP after dom0 build is done
Message-ID: <ZquxmnpCKFohGdo9@macbook>
References: <20240801095201.91180-1-roger.pau@citrix.com>
 <988147f4-3de2-4aae-99cc-7d0ba48b158f@suse.com>
 <ZquraLjpMe9fToZd@macbook>
 <f3aedd33-f3ac-4a75-82db-5da827a6fc5e@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <f3aedd33-f3ac-4a75-82db-5da827a6fc5e@suse.com>

On Thu, Aug 01, 2024 at 05:58:38PM +0200, Jan Beulich wrote:
> On 01.08.2024 17:36, Roger Pau Monné wrote:
> > On Thu, Aug 01, 2024 at 12:28:06PM +0200, Jan Beulich wrote:
> >> On 01.08.2024 11:52, Roger Pau Monne wrote:
> >>> @@ -1907,16 +1890,25 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
> >>>      if ( cpu_has_smep && opt_smep != SMEP_HVM_ONLY )
> >>>          setup_force_cpu_cap(X86_FEATURE_XEN_SMEP);
> >>>      if ( boot_cpu_has(X86_FEATURE_XEN_SMEP) )
> >>> +    {
> >>>          set_in_cr4(X86_CR4_SMEP);
> >>> +        cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;
> >>
> >> Could be just "cr4_pv32_mask = X86_CR4_SMEP" now?
> > 
> > Yes, indeed, same below then.
> > 
> >>> +    }
> >>>  
> >>>      if ( !opt_smap )
> >>>          setup_clear_cpu_cap(X86_FEATURE_SMAP);
> >>>      if ( cpu_has_smap && opt_smap != SMAP_HVM_ONLY )
> >>>          setup_force_cpu_cap(X86_FEATURE_XEN_SMAP);
> >>>      if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> >>> -        set_in_cr4(X86_CR4_SMAP);
> >>> -
> >>> -    cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;
> >>> +        /*
> >>> +         * Set SMAP on the %cr4 mask so that it's set for APs on bringup, but
> >>> +         * don't set for the BSP until domain building is done.
> >>> +         *
> >>> +         * Don't set it in cr4_pv32_mask either, until it's also set on the
> >>> +         * BSP.  Otherwise the BUG in cr4_pv32_restore would trigger for events
> >>> +         * received on the BSP.
> >>> +         */
> >>> +        mmu_cr4_features |= X86_CR4_SMAP;
> >>
> >> Don't you put APs at risk this way of triggering the BUG in cr4_pv32_restore()?
> >> They'll have the bit set in %cr4, but the bit remains clear in cr4_pv32_mask
> >> until much later.
> > 
> > As long as the bit is set in %cr4, but not in cr4_pv32_mask the BUG in
> > cr4_pv32_restore won't hit.
> 
> Hmm, you're right. Despite staring at that for quite some time, I got
> it wrong. Feel free to add
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> then, preferably with said minor adjustment (left in context above).

Sure, thanks!

Will adjust and send v4.


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 16:18:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 16:18:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769874.1180755 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZYVC-0004do-Jr; Thu, 01 Aug 2024 16:18:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769874.1180755; Thu, 01 Aug 2024 16:18:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZYVC-0004de-EV; Thu, 01 Aug 2024 16:18:06 +0000
Received: by outflank-mailman (input) for mailman id 769874;
 Thu, 01 Aug 2024 16:18:05 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8r7L=PA=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZYVA-0004dY-VB
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 16:18:04 +0000
Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com
 [2607:f8b0:4864:20::f2d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a001faa3-5021-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 18:18:02 +0200 (CEST)
Received: by mail-qv1-xf2d.google.com with SMTP id
 6a1803df08f44-6bb5a4668faso36647956d6.2
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 09:18:02 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6bb99b5d0b0sm32846d6.124.2024.08.01.09.18.00
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 01 Aug 2024 09:18:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a001faa3-5021-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722529081; x=1723133881; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=3/ARuhRsNaiuIPRwu1nLQkVqTSbqQTI1K6+W0XQ7am4=;
        b=tHHG/6wlvU8zuLkxJ4/FLd8EhCfK2mb13mYkKDuUXgzzUp8LlkvPfKq361SYOiPk1w
         KaHPZQpudDnsgSmYRZ41NsexWD6SVM9PoI1RpDeDrCrAPBVWH+VsfJM6FDFHIEkq6YoW
         ycrusMXjVLfm+LfhrQzXVrg/Pd20oTTgpDpcI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722529081; x=1723133881;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=3/ARuhRsNaiuIPRwu1nLQkVqTSbqQTI1K6+W0XQ7am4=;
        b=lSzLR/ugQYXFHlkcn8ue9KCk0IEfaAS7bz8YbA/h6xcxtkPaivbrIOneLJNcc0bqoK
         XA24n3SKF5LEmTimlY2sCU1kgeaxSckiOX5KWoxZwsdHF6EV1vWdAApbQZ2xelwlNIJa
         FN2B+AbePiszTftF6163oD4MU7fAUefeSNicNu+sqDveG6m4R4ysbHVaygi5mlN8gfFW
         +J3asvNBWH8HbfsLdc29BtJC5v1NUc5kvKszcRWPlVT4QyPMze9/0MrZCSNrJ+GtoAbn
         FgjXAdSAwmpeuwhaprwtDkK1gLPuszap9HrbamNn88vdqGLdfoq5iyufLMxYtFSRYQGZ
         lNxg==
X-Gm-Message-State: AOJu0YxtNUD493XBGpiaMXAWKxyAxaFn3Zpc9P6IHuEaGJcYajXhHGfa
	pd77SIPn2i48awtpI6AYlaDwLXw3KgJwlkXBeBfQZRTAl/OFfl0V13zCaY/VRIDqfJwiFS0od2E
	S
X-Google-Smtp-Source: AGHT+IFO/rWeumFqH0B5iLXR8PFwzwGoJfb59JcIhxPp7M3Ne17LK97renedcpnge+DVS6DbvZWHkw==
X-Received: by 2002:a05:6214:5bc2:b0:6b5:e202:bd78 with SMTP id 6a1803df08f44-6bb98417517mr6761646d6.44.1722529080891;
        Thu, 01 Aug 2024 09:18:00 -0700 (PDT)
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH v3] x86/shutdown: change default reboot method preference
Date: Thu,  1 Aug 2024 18:17:53 +0200
Message-ID: <20240801161753.94399-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The current logic to chose the preferred reboot method is based on the mode Xen
has been booted into, so if the box is booted from UEFI, the preferred reboot
method will be to use the ResetSystem() run time service call.

However, that method seems to be widely untested, and quite often leads to a
result similar to:

Hardware Dom0 shutdown: rebooting machine
----[ Xen-4.18-unstable  x86_64  debug=y  Tainted:   C    ]----
CPU:    0
RIP:    e008:[<0000000000000017>] 0000000000000017
RFLAGS: 0000000000010202   CONTEXT: hypervisor
[...]
Xen call trace:
   [<0000000000000017>] R 0000000000000017
   [<ffff83207eff7b50>] S ffff83207eff7b50
   [<ffff82d0403525aa>] F machine_restart+0x1da/0x261
   [<ffff82d04035263c>] F apic_wait_icr_idle+0/0x37
   [<ffff82d040233689>] F smp_call_function_interrupt+0xc7/0xcb
   [<ffff82d040352f05>] F call_function_interrupt+0x20/0x34
   [<ffff82d04033b0d5>] F do_IRQ+0x150/0x6f3
   [<ffff82d0402018c2>] F common_interrupt+0x132/0x140
   [<ffff82d040283d33>] F arch/x86/acpi/cpu_idle.c#acpi_idle_do_entry+0x113/0x129
   [<ffff82d04028436c>] F arch/x86/acpi/cpu_idle.c#acpi_processor_idle+0x3eb/0x5f7
   [<ffff82d04032a549>] F arch/x86/domain.c#idle_loop+0xec/0xee

****************************************
Panic on CPU 0:
FATAL TRAP: vector = 6 (invalid opcode)
****************************************

Which in most cases does lead to a reboot, however that's unreliable.

Change the default reboot preference to prefer ACPI over UEFI if available and
not in reduced hardware mode.

This is in line to what Linux does, so it's unlikely to cause issues on current
and future hardware, since there's a much higher chance of vendors testing
hardware with Linux rather than Xen.

Add a special case for one Acer model that does require being rebooted using
ResetSystem().  See Linux commit 0082517fa4bce for rationale.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
Changes since v2:
 - Rebase and remove incorrect paragraph from the commit message.

Changes since v1:
 - Add special case for Acer model to use UEFI reboot.
 - Adjust commit message.
---
 xen/arch/x86/shutdown.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c
index acceec2a385d..fa60d1638d58 100644
--- a/xen/arch/x86/shutdown.c
+++ b/xen/arch/x86/shutdown.c
@@ -150,19 +150,20 @@ static void default_reboot_type(void)
 
     if ( xen_guest )
         reboot_type = BOOT_XEN;
+    else if ( !acpi_disabled && !acpi_gbl_reduced_hardware )
+        reboot_type = BOOT_ACPI;
     else if ( efi_enabled(EFI_RS) )
         reboot_type = BOOT_EFI;
-    else if ( acpi_disabled )
-        reboot_type = BOOT_KBD;
     else
-        reboot_type = BOOT_ACPI;
+        reboot_type = BOOT_KBD;
 }
 
 static int __init cf_check override_reboot(const struct dmi_system_id *d)
 {
     enum reboot_type type = (long)d->driver_data;
 
-    if ( type == BOOT_ACPI && acpi_disabled )
+    if ( (type == BOOT_ACPI && acpi_disabled) ||
+         (type == BOOT_EFI && !efi_enabled(EFI_RS)) )
         type = BOOT_KBD;
 
     if ( reboot_type != type )
@@ -172,6 +173,7 @@ static int __init cf_check override_reboot(const struct dmi_system_id *d)
             [BOOT_KBD]  = "keyboard controller",
             [BOOT_ACPI] = "ACPI",
             [BOOT_CF9]  = "PCI",
+            [BOOT_EFI]  = "UEFI",
         };
 
         reboot_type = type;
@@ -492,6 +494,15 @@ static const struct dmi_system_id __initconstrel reboot_dmi_table[] = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R740")),
     },
+    {    /* Handle problems with rebooting on Acer TravelMate X514-51T. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_EFI,
+        .ident = "Acer TravelMate X514-51T",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate X514-51T"),
+        },
+    },
     { }
 };
 
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 01 16:25:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 16:25:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769882.1180764 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZYc4-0006Zl-6l; Thu, 01 Aug 2024 16:25:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769882.1180764; Thu, 01 Aug 2024 16:25:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZYc4-0006Ze-3w; Thu, 01 Aug 2024 16:25:12 +0000
Received: by outflank-mailman (input) for mailman id 769882;
 Thu, 01 Aug 2024 16:25:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZYc3-0006ZU-M6; Thu, 01 Aug 2024 16:25:11 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZYc3-0001BP-GL; Thu, 01 Aug 2024 16:25:11 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZYc3-0007ST-6f; Thu, 01 Aug 2024 16:25:11 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZYc3-00086a-65; Thu, 01 Aug 2024 16:25:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=zvpIJwbrRWVkViSDH1KpTwvc4t7qS4yXtVX2mI6cG/s=; b=XODNJOTm0ZRA2yQuCb42xVZKpY
	+p0Uxb+/Hri8ygPyk/lrYCV4LzLrL9haPz0bV/2GO3KpetPr6z17yywJIURrwQfn4nvI6bUFWIVfC
	8sKfYzLJrDghGMomfI9+9TzQGd4SSq/XrlamEAFEB0ZRDngBSF4GQNYQKl1Rwcv2P0jk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187106-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187106: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=1c4fb9bb49b7babbcaa0b62384841ba4acb49356
X-Osstest-Versions-That:
    xen=f2dc25686b6c90fc631525e4b9e6537154ee4b0b
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 16:25:11 +0000

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

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  1c4fb9bb49b7babbcaa0b62384841ba4acb49356
baseline version:
 xen                  f2dc25686b6c90fc631525e4b9e6537154ee4b0b

Last test of basis   187102  2024-08-01 08:02:06 Z    0 days
Testing same since   187106  2024-08-01 12:00:23 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Sergiy Kibrik <Sergiy_Kibrik@epam.com>
  Tamas K Lengyel <tamas@tklengyel.com>
  Xenia Ragiadakou <burzalodowa@gmail.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   f2dc25686b..1c4fb9bb49  1c4fb9bb49b7babbcaa0b62384841ba4acb49356 -> smoke


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 16:59:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 16:59:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769901.1180775 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZZ8t-0003ie-QI; Thu, 01 Aug 2024 16:59:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769901.1180775; Thu, 01 Aug 2024 16:59:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZZ8t-0003iX-Ll; Thu, 01 Aug 2024 16:59:07 +0000
Received: by outflank-mailman (input) for mailman id 769901;
 Thu, 01 Aug 2024 16:59:07 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZZ8s-0003iN-V9; Thu, 01 Aug 2024 16:59:06 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZZ8s-00022a-JU; Thu, 01 Aug 2024 16:59:06 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZZ8s-0008IB-6C; Thu, 01 Aug 2024 16:59:06 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZZ8s-0002XG-5h; Thu, 01 Aug 2024 16:59:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=fnwzHwEjSNTNyRv8zOIJ6ACumfAO6HHBqRWu0xl5kqI=; b=PyeBDUZyCIzY0uu8gqM2lR4wDt
	GXiURWaH68DP6VFwXkaM/kz6E3o7FLaINK5r9wNf+UDDsVQB8zYuxcAoeObCIBl4QhU0htf8hvbTG
	YTxuV3LcyTB1JTp4i1j2e3VrltDYvQ3D1gTBdPTDoEgg71ix/HIWxZiM0lIosLOLqe18=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187109-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187109: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=2d5390053ff934ec1e94b84f5bb67400b3b75841
X-Osstest-Versions-That:
    ovmf=a679ceca974e94a659f9b6b9e7a7900644220ef9
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 16:59:06 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 2d5390053ff934ec1e94b84f5bb67400b3b75841
baseline version:
 ovmf                 a679ceca974e94a659f9b6b9e7a7900644220ef9

Last test of basis   187108  2024-08-01 13:45:09 Z    0 days
Testing same since   187109  2024-08-01 15:41:27 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Ard Biesheuvel <ardb@kernel.org>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   a679ceca97..2d5390053f  2d5390053ff934ec1e94b84f5bb67400b3b75841 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 18:00:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 18:00:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769917.1180784 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZa5j-0003yw-S9; Thu, 01 Aug 2024 17:59:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769917.1180784; Thu, 01 Aug 2024 17:59:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZa5j-0003yp-P0; Thu, 01 Aug 2024 17:59:55 +0000
Received: by outflank-mailman (input) for mailman id 769917;
 Thu, 01 Aug 2024 17:59:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=SIAI=PA=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sZa5j-0003yj-6H
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 17:59:55 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d9788a9b-502f-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 19:59:52 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 0D05D6293D;
 Thu,  1 Aug 2024 17:59:51 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCB7BC32786;
 Thu,  1 Aug 2024 17:59:49 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d9788a9b-502f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1722535190;
	bh=AaV8E08fJOUeaK01SwQIJR9LSOTp2AxvAyxxtcAjlmU=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=hNX7p5V6DGQLE6lU8fSjgWi3B9x8OGYMaYudshTwSaQTQdXIEOTanjfTVIdVOVDZI
	 tdF/gbH9NpYXyj6JSNhblNRo5RlFd9WzJEIi6+oJWZpvyVpsHTW30QmTqSAQmsHDOf
	 tndQvlvhAwM+MSt7AySWra3HMA+JdwsOWAXXANC4uO8NV3nRdbVVqWN0/w3veMXg4x
	 4RN4mOE/ic1JNj0ZDY9xSLlcjX1n9tSgIlZZ8zhjB4aagENq51gQUUU90jxb71RysZ
	 3kDqSCFOg+Euu16rtg0FX9jbB1O1u2psc2+FTCOw3KATXBFuIaSyVQ82L7Mdc+U0dI
	 1kDFjL9IBCSBA==
Date: Thu, 1 Aug 2024 10:59:46 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, Julien Grall <julien@xen.org>, 
    xen-devel@lists.xenproject.org
Subject: Re: [PATCH] docs/misra: add R13.2 and R18.2 to rules.rst
In-Reply-To: <dd463c03-71ca-4333-ac3f-629241b0f9bc@suse.com>
Message-ID: <alpine.DEB.2.22.394.2408011044320.4857@ubuntu-linux-20-04-desktop>
References: <alpine.DEB.2.22.394.2407301626460.4857@ubuntu-linux-20-04-desktop> <6575beb5-645a-470a-89a1-8485adeace60@suse.com> <alpine.DEB.2.22.394.2407311647170.4857@ubuntu-linux-20-04-desktop> <dd463c03-71ca-4333-ac3f-629241b0f9bc@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 1 Aug 2024, Jan Beulich wrote:
> On 01.08.2024 01:50, Stefano Stabellini wrote:
> > On Wed, 31 Jul 2024, Jan Beulich wrote:
> >> On 31.07.2024 01:30, Stefano Stabellini wrote:
> >>> --- a/docs/misra/rules.rst
> >>> +++ b/docs/misra/rules.rst
> >>> @@ -462,6 +462,15 @@ maintainers if you want to suggest a change.
> >>>       - Initializer lists shall not contain persistent side effects
> >>>       -
> >>>  
> >>> +   * - `Rule 13.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_13_02.c>`_
> >>> +     - Required
> >>> +     - The value of an expression and its persistent side-effects shall
> >>> +       be the same under all permitted evaluation orders
> >>> +     - Be aware that the static analysis tool Eclair might report
> >>> +       several findings for Rule 13.2 of type "caution". These are
> >>> +       instances where Eclair is unable to verify that the code is valid
> >>> +       in regard to Rule 13.2. Caution reports are not violations.
> >>
> >> Which doesn't make clear what our take is towards new code people may
> >> submit.
> > 
> > Good point, see my comment below
> > 
> > 
> >>> @@ -583,6 +592,15 @@ maintainers if you want to suggest a change.
> >>>         submitting new patches please try to decrease the number of
> >>>         violations when possible.
> >>>  
> >>> +   * - `Rule 18.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_18_02.c>`_
> >>> +     - Required
> >>> +     - Subtraction between pointers shall only be applied to pointers
> >>> +       that address elements of the same array
> >>> +     - Be aware that the static analysis tool Eclair might report
> >>> +       several findings for Rule 18.2 of type "caution". These are
> >>> +       instances where Eclair is unable to verify that the code is valid
> >>> +       in regard to Rule 18.2. Caution reports are not violations.
> >>
> >> And while the same wording is used here, I think it is pretty clear for
> >> this that we'd reject changes where bad subtractions are used. IOW even
> >> more so important to clarify the (possibly different) positions on what
> >> is going to be added into the code base.
> > 
> > In both of these cases, we would reject code that doesn't follow R13.2
> > and R18.2.
> 
> But we shouldn't (unconditionally) do so for for 13.2, should we?
> 
> > I'll change it to the following:
> > 
> > 
> > Be aware that the static analysis tool Eclair might report several
> > findings for Rule 18.2 of type "caution". These are instances where
> > Eclair is unable to verify that the code is valid in regard to Rule
> > 18.2. Caution reports are not violations. Regardless, new code is
> > expected to follow this rule.
> 
> I'm fine with this for 18.2, but not so much for 13.2.

Let me clarify something about R13.2. I expect we are aligned on this.

Rule 13.2 only expects that "the value of an expression and its persistent
side-effects shall be the same under all permitted evaluation orders"
and nothing more.

It is an outstanding limitation of static analyzers such as ECLAIR
that they cannot be certain that "the value of an expression and its
persistent side-effects shall be the same under all permitted evaluation
orders". So one way to make ECLAIR happy is to change this code:

1)
func1(param1, func2(a), func3(b);

into this code:

2)
param2 = func2(a);
param3 = func3(b);
func1(param1, param2, param3);

Rule 13.2 is not asking us to change 1) into 2). 1) is acceptable. It is
just that ECLAIR cannot help us ensure that 1) is compliant with Rule
13.2. It is totally fine to accept new code written in the form 1), of
course only if "the value of an expression and its persistent
side-effects shall be the same under all permitted evaluation orders".
It would likely increase the number of ECLAIR cautions, but it is not
necessarily a problem, and the ECLAIR Gitlab job will not fail.

If one of the reviewers discovers that 1) doesn't comply with Rule 13.2
due to manual review, then they should ask the contributor to change the
code. That is a good idea because we wouldn't want the value of an
expression to be dependant on the evaluation order which GCC cannot
guarantee.


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 18:00:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 18:00:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769918.1180794 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZa5w-0005FU-6F; Thu, 01 Aug 2024 18:00:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769918.1180794; Thu, 01 Aug 2024 18:00:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZa5w-0005F1-2s; Thu, 01 Aug 2024 18:00:08 +0000
Received: by outflank-mailman (input) for mailman id 769918;
 Thu, 01 Aug 2024 18:00: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=SIAI=PA=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sZa5u-0003yj-QB
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 18:00:06 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e10c8e31-502f-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 20:00:05 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id C4BF4628B2;
 Thu,  1 Aug 2024 18:00:03 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52ECFC32786;
 Thu,  1 Aug 2024 18:00:02 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e10c8e31-502f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1722535203;
	bh=9vXy1lbBgI84RpBNbMnqBJhbGyNY0ZEyIqugp0pKwUA=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=u1hMsOAOMjETrDcYHbRtpzgnwrS0cjKnvdTtAAzVl2bGFi5NlQA9YNZeBTCSlDwXM
	 B7UqrY2uSu4hG6L1WgdCujT3tF74OC9VKv6i0+ftSJkGeBqYvKXbrMhQYKI1dGEJKh
	 qiqdYYIVCj5pT4Nz6lFrr7YcmlSVn/xiVGFj2GWLEfv9xcld0jtSNL8VGHgfaaOUSU
	 Mt8IdC9OLt1ajVhqFJkG1vaQ/2t0zw+IKe4kCu2ojHwyhZYdA6k6ntKba2vxALY1Ft
	 ClwRQI1dwGU4nDcj32+28TAHFMAVSXWHpTCuMc/oX/nSe3FyOddjKUeX4Qx7Qduywh
	 KJHZZuoegPkiA==
Date: Thu, 1 Aug 2024 11:00:01 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Julien Grall <julien@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] docs/misra: add R13.2 and R18.2 to rules.rst
In-Reply-To: <83ABB601-629D-4D95-B124-E50896EB12B0@arm.com>
Message-ID: <alpine.DEB.2.22.394.2408011044050.4857@ubuntu-linux-20-04-desktop>
References: <alpine.DEB.2.22.394.2407301626460.4857@ubuntu-linux-20-04-desktop> <6575beb5-645a-470a-89a1-8485adeace60@suse.com> <alpine.DEB.2.22.394.2407311647170.4857@ubuntu-linux-20-04-desktop> <83ABB601-629D-4D95-B124-E50896EB12B0@arm.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 1 Aug 2024, Bertrand Marquis wrote:
> Hi Stefano,
> 
> > On 1 Aug 2024, at 01:50, Stefano Stabellini <sstabellini@kernel.org> wrote:
> > 
> > On Wed, 31 Jul 2024, Jan Beulich wrote:
> >> On 31.07.2024 01:30, Stefano Stabellini wrote:
> >>> --- a/docs/misra/rules.rst
> >>> +++ b/docs/misra/rules.rst
> >>> @@ -462,6 +462,15 @@ maintainers if you want to suggest a change.
> >>>      - Initializer lists shall not contain persistent side effects
> >>>      -
> >>> 
> >>> +   * - `Rule 13.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_13_02.c>`_
> >>> +     - Required
> >>> +     - The value of an expression and its persistent side-effects shall
> >>> +       be the same under all permitted evaluation orders
> >>> +     - Be aware that the static analysis tool Eclair might report
> >>> +       several findings for Rule 13.2 of type "caution". These are
> >>> +       instances where Eclair is unable to verify that the code is valid
> >>> +       in regard to Rule 13.2. Caution reports are not violations.
> >> 
> >> Which doesn't make clear what our take is towards new code people may
> >> submit.
> > 
> > Good point, see my comment below
> > 
> > 
> >>> @@ -583,6 +592,15 @@ maintainers if you want to suggest a change.
> >>>        submitting new patches please try to decrease the number of
> >>>        violations when possible.
> >>> 
> >>> +   * - `Rule 18.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_18_02.c>`_
> >>> +     - Required
> >>> +     - Subtraction between pointers shall only be applied to pointers
> >>> +       that address elements of the same array
> >>> +     - Be aware that the static analysis tool Eclair might report
> >>> +       several findings for Rule 18.2 of type "caution". These are
> >>> +       instances where Eclair is unable to verify that the code is valid
> >>> +       in regard to Rule 18.2. Caution reports are not violations.
> >> 
> >> And while the same wording is used here, I think it is pretty clear for
> >> this that we'd reject changes where bad subtractions are used. IOW even
> >> more so important to clarify the (possibly different) positions on what
> >> is going to be added into the code base.
> > 
> > In both of these cases, we would reject code that doesn't follow R13.2
> > and R18.2. I'll change it to the following:
> > 
> > 
> > Be aware that the static analysis tool Eclair might report several
> > findings for Rule 18.2 of type "caution". These are instances where
> > Eclair is unable to verify that the code is valid in regard to Rule
> > 18.2. Caution reports are not violations. Regardless, new code is
> > expected to follow this rule.
> 
> I think that in both cases it is wrong to state that "cautions reported are
> not violations" where those are cases where the tool is not sure so they
> might be or not violations.
> So I would change the sentence to "cautions might not be violations. The
> rule should be followed in any case in new code submitted".

I am happy with your wording, I'll make the change


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 18:10:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 18:10:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769934.1180803 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZaFu-0007YZ-3F; Thu, 01 Aug 2024 18:10:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769934.1180803; Thu, 01 Aug 2024 18:10:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZaFu-0007YS-0f; Thu, 01 Aug 2024 18:10:26 +0000
Received: by outflank-mailman (input) for mailman id 769934;
 Thu, 01 Aug 2024 18:10:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZaFs-0007Xz-W4; Thu, 01 Aug 2024 18:10:25 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZaFs-0003NY-OX; Thu, 01 Aug 2024 18:10:24 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZaFs-0001Tn-8X; Thu, 01 Aug 2024 18:10:24 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZaFs-0005RU-83; Thu, 01 Aug 2024 18:10:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=YnOqI7NPgY2PliGyoLPpKEJrit9UjXAgo0/LskZZYVs=; b=tTafBN915lSjbm35yHawLf1yiM
	EUmQKZ1ymfp9aC2dMf2w/DwQfvTGCKY01wbXxuRexYCGrO9f2kaqT2YAlcjMWNS0cN4QINRKKrJnh
	0lVEWeKGyu2yCB/7GsG6Yz1xuTVHTuX3/srVef0ri7LhcT0OZO/kOKARr7UDRHr27fU8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187089-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187089: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=21b136cc63d2a9ddd60d4699552b69c214b32964
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 18:10:24 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827

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

version targeted for testing:
 linux                21b136cc63d2a9ddd60d4699552b69c214b32964
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   15 days
Failing since        186925  2024-07-20 09:44:52 Z   12 days   27 attempts
Testing same since   187089  2024-07-31 17:43:12 Z    1 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 19:20:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 19:20:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769951.1180813 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZbLK-0000Zi-25; Thu, 01 Aug 2024 19:20:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769951.1180813; Thu, 01 Aug 2024 19:20:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZbLJ-0000ZA-V9; Thu, 01 Aug 2024 19:20:05 +0000
Received: by outflank-mailman (input) for mailman id 769951;
 Thu, 01 Aug 2024 19:20:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=SIAI=PA=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sZbLI-0000LO-Mp
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 19:20:04 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0c283965-503b-11ef-8776-851b0ebba9a2;
 Thu, 01 Aug 2024 21:20:02 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 4043662951;
 Thu,  1 Aug 2024 19:20:00 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id F4228C32786;
 Thu,  1 Aug 2024 19:19:58 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0c283965-503b-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1722539999;
	bh=QVhnscDB2j1iOQPQoj+waVit8XwxzRSwaEgt7pQ6LCs=;
	h=Date:From:To:cc:Subject:From;
	b=Lr/F4YVkdMRJSquPFMYimGoNFkFjnwQGg78+GEuXYG2m1aSGy8IVcAIIgQi13WnHV
	 WFLQXaI+uBYEZtxuJjRMNAbNb8AWBQXSzdaDRiOOjEXZzVFqvri1Ruvdi7V2ZYdT9k
	 UNE0fIw4w9aDiCrlxNNSV7zo44VeAWVo8R6NJEGdcABSh1hSzA3H3w8puKil8RLniv
	 A9xUr4pwWaH4L8xj/kr2sczUh/YfBW19O3Q6Vp1/7d7mPegR9UFTARQnXgfzobGNHu
	 9+dP/8HvzC+Jp0NiP59v9wNRgbN74G5J1jV40p9jX0pPj6+19Wg5yeXjzLXZh7bqZn
	 nPcSpeyKqmVTA==
Date: Thu, 1 Aug 2024 12:19:58 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: xen-devel@lists.xenproject.org
cc: sstabellini@kernel.org, Jan Beulich <jbeulich@suse.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, Julien Grall <julien@xen.org>
Subject: [PATCH v3] docs/misra: add R13.2 and R18.2 to rules.rst
Message-ID: <alpine.DEB.2.22.394.2408011218250.114241@ubuntu-linux-20-04-desktop>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

Add MISRA C rules 13.2 and 18.2 to rules.rst. Both rules have zero
violations reported by Eclair but they have some cautions. We accept
both rules and for now we'll enable scanning for them in Eclair but only
violations will cause the Gitlab CI job to fail (cautions will not.)

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
Changes in v3:
- improve notes
Changes in v2:
- clarify that new code is expected to follow the rule
---
 docs/misra/rules.rst | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index 7b366edb07..e99cb81089 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -462,6 +462,16 @@ maintainers if you want to suggest a change.
      - Initializer lists shall not contain persistent side effects
      -
 
+   * - `Rule 13.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_13_02.c>`_
+     - Required
+     - The value of an expression and its persistent side-effects shall
+       be the same under all permitted evaluation orders
+     - Be aware that the static analysis tool Eclair might report
+       several findings for Rule 13.2 of type "caution". These are
+       instances where Eclair is unable to verify that the code is valid
+       in regard to Rule 13.2. Caution reports might not be violations.
+       The rule should be followed in any case in new code submitted.
+
    * - `Rule 13.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_13_06.c>`_
      - Required
      - The operand of the sizeof operator shall not contain any
@@ -583,6 +593,16 @@ maintainers if you want to suggest a change.
        submitting new patches please try to decrease the number of
        violations when possible.
 
+   * - `Rule 18.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_18_02.c>`_
+     - Required
+     - Subtraction between pointers shall only be applied to pointers
+       that address elements of the same array
+     - Be aware that the static analysis tool Eclair might report
+       several findings for Rule 18.2 of type "caution". These are
+       instances where Eclair is unable to verify that the code is valid
+       in regard to Rule 18.2. Caution reports might not be violations.
+       The rule should be followed in any case in new code submitted.
+
    * - `Rule 18.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_18_03.c>`_
      - Required
      - The relational operators > >= < and <= shall not be applied to objects of pointer type except where they point into the same object
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 01 19:26:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 19:26:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769959.1180823 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZbRZ-0001jO-MR; Thu, 01 Aug 2024 19:26:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769959.1180823; Thu, 01 Aug 2024 19:26:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZbRZ-0001jH-Jj; Thu, 01 Aug 2024 19:26:33 +0000
Received: by outflank-mailman (input) for mailman id 769959;
 Thu, 01 Aug 2024 19:26:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZbRY-0001j7-Ty; Thu, 01 Aug 2024 19:26:32 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZbRY-0004gB-M1; Thu, 01 Aug 2024 19:26:32 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZbRY-0003JF-Dk; Thu, 01 Aug 2024 19:26:32 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZbRY-0004rr-DG; Thu, 01 Aug 2024 19:26:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ReokPkcRe8S1+JqFLoAcJpZMeSZCNnjVw50ZbhWTj2o=; b=ekVyNw2fwnRpJHbwwbPhzQUw09
	3PfoBHbeMcZzVouTSN4ql9j/ILEUx/59tTyChl9EENrufI1m+hCON4u5tpZAiFukDHdyzUtcg8UK0
	BFbcPJPOG6BoxlW3yfT2AMgY9BoiDUllPlyiqgyzoZNPc2jZ8cjPGQa/H67WQlt9tF+E=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187110-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187110: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=5c9b889b81f9ad22c7442887be72abef054998b9
X-Osstest-Versions-That:
    ovmf=2d5390053ff934ec1e94b84f5bb67400b3b75841
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 19:26:32 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 5c9b889b81f9ad22c7442887be72abef054998b9
baseline version:
 ovmf                 2d5390053ff934ec1e94b84f5bb67400b3b75841

Last test of basis   187109  2024-08-01 15:41:27 Z    0 days
Testing same since   187110  2024-08-01 17:13:18 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Zhihao Li <zhihao.li@intel.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   2d5390053f..5c9b889b81  5c9b889b81f9ad22c7442887be72abef054998b9 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 20:05:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 20:05:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769972.1180833 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZc2r-0007Rd-LG; Thu, 01 Aug 2024 20:05:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769972.1180833; Thu, 01 Aug 2024 20:05:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZc2r-0007RW-IZ; Thu, 01 Aug 2024 20:05:05 +0000
Received: by outflank-mailman (input) for mailman id 769972;
 Thu, 01 Aug 2024 20:05:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dsN4=PA=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sZc2q-0007RQ-Jc
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 20:05:04 +0000
Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com
 [2a00:1450:4864:20::12b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 56fc9b15-5041-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 22:05:03 +0200 (CEST)
Received: by mail-lf1-x12b.google.com with SMTP id
 2adb3069b0e04-52f04150796so12073232e87.3
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 13:05:03 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530bba3cf41sm40204e87.273.2024.08.01.13.05.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 01 Aug 2024 13:05:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 56fc9b15-5041-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722542703; x=1723147503; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=Yk2/GIZCwX7qe2mUxKHcAH5HcO+UJV5KC/QZwaX/E7c=;
        b=DBeNa0b16xa0i3LZNEdrvm121Pr2pAidtgsiARKtYtrAhpX9LS6F8vX6Mz5FzEj+/3
         PjhIFs8c+0M8n6yXlKym1wnMmSxZ3M1D2K0j5mM66xDeQ19Vdq2o2B1uRe8oFGp7qgHS
         Vqk7tSTZVJYHCp9eXZcsmapbvGC0agAzXL/eGNgLXF5aVbcC3v0h5PqEPknS9HFD4wQq
         87UpL4GMjHbUaKrTH+wacxAN5707lXCtfkbu/83p9c46VriXZrHOqK99lQOlmbwKaPbQ
         cIgOzzVZKOEpifO1fk6jB4G8r6U1DRIv1ssO3GKEPbM2Ctr8OU8Uf+S3t+KpxP1WEvd9
         SBTw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722542703; x=1723147503;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=Yk2/GIZCwX7qe2mUxKHcAH5HcO+UJV5KC/QZwaX/E7c=;
        b=KIrQc9k3BDVgivIPko5KOtKOvZ12ggZlUTKQhJa5Ndu4y1vWg+gL73OZBE6zO6MJan
         V1d1pzm+slE7Nv1LG1LHu4Mrw+Gnw/fpnuK236EYhDUe2VZQUwrsyQ7DGljLw0y+3LUJ
         Z9hw4DtQdzMshYgbGkPFfL7LbYTMMsNjItBb0UVYcgA+pC4ORTfWsP1F/4+90LHRTJYU
         W8SL0Ivr+R8dWUfBScFqpqpGnoYYcyId9zJTxTE+JsZNO6nPLI1XMEHJwokLWInZDi4M
         EI8CUqDQm0BKIlqUYayuNOB4cJ8Ywl/LzTgbNbabntbFkaiAi0OiQNAtiafxyihXknSt
         3JFg==
X-Forwarded-Encrypted: i=1; AJvYcCXTBDu0wE5SY0+rVPiviD2rNDCMbyiyZNTPOc1a8xFINcVwYNo9QJM+Z/rg4pcIpL3mR5BNKVi69Us9JbdkuDroMygTIlZdQzKvFvm1nTo=
X-Gm-Message-State: AOJu0YzfBWzlOkNKJUXhMQiJTs6giyvk8iwmpRAzWw90CVGVhYtxp7UI
	THyqhYditqidxXLuNkgBRbY0k7BkOsKusuyuMQKRiMM8BVUzofkL
X-Google-Smtp-Source: AGHT+IHqfp49U1/oHmyDDBw0EJX7GPzN+gcPaHRXlFCCJ7k0cHPpzdXy0U1iMdj0bS6EHBlzdB4o/w==
X-Received: by 2002:a05:6512:3da6:b0:52c:9725:b32b with SMTP id 2adb3069b0e04-530bb36f8ddmr701399e87.17.1722542702545;
        Thu, 01 Aug 2024 13:05:02 -0700 (PDT)
Message-ID: <44b01293f3e318b6f4d1c3aff3f1b38349676bc0.camel@gmail.com>
Subject: Re: [PATCH v11 2/5] xen/riscv: introduce decode_cause() stuff
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, 
	xen-devel@lists.xenproject.org
Date: Thu, 01 Aug 2024 22:05:01 +0200
In-Reply-To: <a2ad6557-8162-4f06-84c6-b79c049cb326@suse.com>
References: <cover.1721731887.git.oleksii.kurochko@gmail.com>
	 <335b0b49720b3524b6c89c5ce62d3377a4bb1fb8.1721731887.git.oleksii.kurochko@gmail.com>
	 <a2ad6557-8162-4f06-84c6-b79c049cb326@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Thu, 2024-08-01 at 13:44 +0200, Jan Beulich wrote:
> On 24.07.2024 17:31, Oleksii Kurochko wrote:
> > The patch introduces stuff needed to decode a reason of an
> > exception.
> >=20
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > Acked-by: Alistair Francis <alistair.francis@wdc.com>
> > Acked-by: Jan Beulich <jbeulich@suse.com>
> > ---
> > Changes in V11:
> > =C2=A0- Nothing changed. Only rebase.
> > ---
> > Changes in V10:
> > =C2=A0- add Acked-by: Jan Beulich <jbeulich@suse.com>
> > ---
> > Changes in V9:
> > =C2=A0- This patch was reverted as breaks both release and randconfig
> > builds.
> > =C2=A0=C2=A0 I don't see the failures now. ( probably it was because of
> > printk usage
> > =C2=A0=C2=A0 which was not ready at that moment ).
> > =C2=A0- drop inclusion of <asm/csr.h> and <asm/early_printk.h>
> > =C2=A0- add <asm/riscv_encoding.h> for CAUSE_* in decode_trap_cause().
> > ---
> > Changes in V8:
> > =C2=A0 - fix typo in return string from decode_reserved_interrupt_cause
> > =C2=A0 - add Acked-by: Alistair Francis <alistair.francis@wdc.com>
> > ---
> > Changes in V7:
> > =C2=A0- Nothing changed. Only rebase.
> > ---
> > Changes in V6:
> > =C2=A0- Remove usage of LINK_TO_LOAD() due to the MMU being enabled
> > first.
> > =C2=A0- Change early_printk() to printk()
> > ---
> > Changes in V5:
> > =C2=A0 - Remove <xen/error.h> from riscv/traps/c as nothing would
> > require
> > =C2=A0=C2=A0=C2=A0 inclusion.
> > =C2=A0 - decode_reserved_interrupt_cause(), decode_interrupt_cause(),
> > decode_cause, do_unexpected_trap()
> > =C2=A0=C2=A0=C2=A0 were made as static they are expected to be used onl=
y in
> > traps.c
> > =C2=A0 - use LINK_TO_LOAD() for addresses which can be linker time
> > relative.
> > ---
> > Changes in V4:
> > =C2=A0 - fix string in decode_reserved_interrupt_cause()
> > ---
> > Changes in V3:
> > =C2=A0 - Nothing changed
> > ---
> > Changes in V2:
> > =C2=A0 - Make decode_trap_cause() more optimization friendly.
> > =C2=A0 - Merge the pathc which introduces do_unexpected_trap() to the
> > current one.
> > ---
> > =C2=A0xen/arch/riscv/traps.c | 80
> > +++++++++++++++++++++++++++++++++++++++++-
> > =C2=A01 file changed, 79 insertions(+), 1 deletion(-)
> >=20
> > diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
> > index 5415cf8d90..37cec40dfa 100644
> > --- a/xen/arch/riscv/traps.c
> > +++ b/xen/arch/riscv/traps.c
> > @@ -9,13 +9,91 @@
> > =C2=A0#include <xen/sched.h>
> > =C2=A0
> > =C2=A0#include <asm/processor.h>
> > +#include <asm/riscv_encoding.h>
> > =C2=A0#include <asm/traps.h>
> > =C2=A0
> > -void do_trap(struct cpu_user_regs *cpu_regs)
> > +static const char *decode_trap_cause(unsigned long cause)
> > +{
> > +=C2=A0=C2=A0=C2=A0 static const char *const trap_causes[] =3D {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_MISALIGNED_FETCH] =
=3D "Instruction Address
> > Misaligned",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_FETCH_ACCESS] =3D "I=
nstruction Access Fault",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_ILLEGAL_INSTRUCTION]=
 =3D "Illegal Instruction",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_BREAKPOINT] =3D "Bre=
akpoint",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_MISALIGNED_LOAD] =3D=
 "Load Address Misaligned",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_LOAD_ACCESS] =3D "Lo=
ad Access Fault",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_MISALIGNED_STORE] =
=3D "Store/AMO Address Misaligned",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_STORE_ACCESS] =3D "S=
tore/AMO Access Fault",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_USER_ECALL] =3D "Env=
ironment Call from U-Mode",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_SUPERVISOR_ECALL] =
=3D "Environment Call from S-Mode",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_MACHINE_ECALL] =3D "=
Environment Call from M-Mode",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_FETCH_PAGE_FAULT] =
=3D "Instruction Page Fault",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_LOAD_PAGE_FAULT] =3D=
 "Load Page Fault",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_STORE_PAGE_FAULT] =
=3D "Store/AMO Page Fault",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_FETCH_GUEST_PAGE_FAU=
LT] =3D "Instruction Guest Page
> > Fault",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_LOAD_GUEST_PAGE_FAUL=
T] =3D "Load Guest Page Fault",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_VIRTUAL_INST_FAULT] =
=3D "Virtualized Instruction
> > Fault",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [CAUSE_STORE_GUEST_PAGE_FAU=
LT] =3D "Guest Store/AMO Page
> > Fault",
> > +=C2=A0=C2=A0=C2=A0 };
> > +
> > +=C2=A0=C2=A0=C2=A0 if ( cause < ARRAY_SIZE(trap_causes) && trap_causes=
[cause] )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return trap_causes[cause];
> > +=C2=A0=C2=A0=C2=A0 return "UNKNOWN";
> > +}
>=20
> While I committed this as-is, two more points: First, as soon any any
> such array access becomes potentially reachable because of guest
> activity, it wants to use array_access_nospec() or alike.
Could you please explain why ( specifically ) guest activity affects if
array access becomes potentially reachable?=20

>  Second, and
> somewhat related, it may be desirable to avoid such double accesses.
> Hopefully the compiler will do that for you. But
>=20
> =C2=A0=C2=A0=C2=A0 const char *res =3D cause < ARRAY_SIZE(trap_causes) ?
> trap_causes[cause]
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 : NULL;
>=20
> =C2=A0=C2=A0=C2=A0 return res ?: "UNKNOWN";
>=20
> might be worthwhile anyway.

Thanks.
I will apply this suggestion in the next version of this patch series.



~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 21:22:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 21:22:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769981.1180844 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZdFn-0001u9-4v; Thu, 01 Aug 2024 21:22:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769981.1180844; Thu, 01 Aug 2024 21:22:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZdFn-0001u2-26; Thu, 01 Aug 2024 21:22:31 +0000
Received: by outflank-mailman (input) for mailman id 769981;
 Thu, 01 Aug 2024 21:22:29 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZdFl-0001ts-53; Thu, 01 Aug 2024 21:22:29 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZdFk-00075c-W6; Thu, 01 Aug 2024 21:22:28 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZdFk-0006h0-H3; Thu, 01 Aug 2024 21:22:28 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZdFk-0005hr-Gj; Thu, 01 Aug 2024 21:22:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=KyXNbbUtMVaO2xg0Kjb3O3PSFnmHqMIsyMjdXz4C4zI=; b=6i0qefq/TCOjhWMsBuTzH4A6ie
	I25MRW9Kvo0f+oyBMFrocAtbdwaMbU7s7PVgsRFN5W4ZvprEMrHkAr4SuRszP7dMlrXWmEkWdJc3S
	3PmG6ATYFNwgEjEXHhrfo34HwxTp1VjTaFMdjaMKwgHFyZ9QHYUSG5D5JxTSkL+SiwHQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187111-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187111: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=b0e7a75a4959a481cc6b857d6e6a9607d14523bf
X-Osstest-Versions-That:
    ovmf=5c9b889b81f9ad22c7442887be72abef054998b9
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 21:22:28 +0000

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

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

Last test of basis   187110  2024-08-01 17:13:18 Z    0 days
Testing same since   187111  2024-08-01 19:45:07 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Liming Gao <gaoliming@byosoft.com.cn>
  Rohit Mathew <rohit.mathew@arm.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   5c9b889b81..b0e7a75a49  b0e7a75a4959a481cc6b857d6e6a9607d14523bf -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 21:38:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 21:38:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769992.1180854 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZdVV-00044c-Ff; Thu, 01 Aug 2024 21:38:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769992.1180854; Thu, 01 Aug 2024 21:38:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZdVV-00044V-Cv; Thu, 01 Aug 2024 21:38:45 +0000
Received: by outflank-mailman (input) for mailman id 769992;
 Thu, 01 Aug 2024 21:38:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZdVU-00044L-KC; Thu, 01 Aug 2024 21:38:44 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZdVU-0007Kr-BH; Thu, 01 Aug 2024 21:38:44 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZdVT-00072N-RM; Thu, 01 Aug 2024 21:38:43 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZdVT-000827-Qz; Thu, 01 Aug 2024 21:38:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=pCFBhFnM4yV2g93NQ8X1JP39Bo8KJ+dDHJrzeOTk6mI=; b=DtSes3c5i4dFvZ7MJocLyvwBYH
	NlHjRkXRXIvKpVQs3fD8BhBomVh4OQz0sypc+W/2K+scpCCF7nMfXanXxiP0cAC/uKMtwg91sYS1m
	5FqXQ/i0j9b7i0WzRQo7HqzmkkPSybCv/2qv3ZUYhFOP4Hr3ZzcXg1jE5qduEtSC1h7o=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187097-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.19-testing test] 187097: regressions - FAIL
X-Osstest-Failures:
    xen-4.19-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:regression
    xen-4.19-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=026c9fa29716b0ff0f8b7c687908e71ba29cf239
X-Osstest-Versions-That:
    xen=fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 21:38:43 +0000

flight 187097 xen-4.19-testing real [real]
flight 187112 xen-4.19-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187097/
http://logs.test-lab.xenproject.org/osstest/logs/187112/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop       fail REGR. vs. 187044

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

version targeted for testing:
 xen                  026c9fa29716b0ff0f8b7c687908e71ba29cf239
baseline version:
 xen                  fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e

Last test of basis   187044  2024-07-29 16:07:22 Z    3 days
Testing same since   187048  2024-07-30 01:41:30 Z    2 days    4 attempts

------------------------------------------------------------
People who touched revisions under test:
  Julien Grall <jgrall@amazon.com>

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


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

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

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

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


Not pushing.

------------------------------------------------------------
commit 026c9fa29716b0ff0f8b7c687908e71ba29cf239
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:45 2024 +0100

    Set 4.19 version
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit df9b8a649f0424e0a949c0f9a7961724bbe8ea70
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:08 2024 +0100

    README: make heading say 4.19
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit b2d2878ab2686b92fcdd7bbca4ff4c312a42bc11
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:18:01 2024 +0100

    Config.mk: Bump tags to 4.19.0 final
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 22:06:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 22:06:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770005.1180863 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZdwh-0000J2-Mo; Thu, 01 Aug 2024 22:06:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770005.1180863; Thu, 01 Aug 2024 22:06:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZdwh-0000Iv-K0; Thu, 01 Aug 2024 22:06:51 +0000
Received: by outflank-mailman (input) for mailman id 770005;
 Thu, 01 Aug 2024 22:06: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=SIAI=PA=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sZdwg-0000In-Ga
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 22:06:50 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 578d8436-5052-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 00:06:46 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 22AC662954;
 Thu,  1 Aug 2024 22:06:45 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1593FC32786;
 Thu,  1 Aug 2024 22:06:43 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 578d8436-5052-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1722550004;
	bh=zTut31+nWOafgfKglJDPziM5pXREb4+C4my9z6BgDiM=;
	h=Date:From:To:cc:Subject:From;
	b=GDwZzxlVMdj8epj04tDTwUMxPJi45mJ0Ttxi2wVqG6vmM62ut/fYyVP6JxoQE+9DX
	 GJSHy+gEDWIT8UFISgiN4vuFAyK9o0Wz1JkINOtEV6ifhk2hod0OgXhT1HZRpPahaO
	 SQycZcPP2G7y/52/heZ5v6lqElLMufr8F3JS8mFKFaufVErJlvPJx5CoR/c3Df+dY/
	 9xRxbEIKj+PGkGY+cUCeAYo7VVZgaP9cLVO7F3nWnmnP5rhH5bhglcouTSnyvwmqvh
	 7CyKLYibiOSL4cDpNrXigvx2u2KpGTR4LZx+lqelMo63vd2Qn2zU8XTySp3RdjeFEJ
	 1ERQbi1h5Ju3Q==
Date: Thu, 1 Aug 2024 15:06:43 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: xen-devel@lists.xenproject.org
cc: Simone Ballarin <simone.ballarin@bugseng.com>, nicola.vetrini@bugseng.com, 
    consulting@bugseng.com, sstabellini@kernel.org
Subject: [PATCH] automation: fix eclair scanning for merge requests
Message-ID: <alpine.DEB.2.22.394.2408011500280.114241@ubuntu-linux-20-04-desktop>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

The ECLAIR jobs part of the Gitlab CI pipeline fail reliably when the
pipeline is started from a merge request. This is the error:

Unexpected event pull_request

The error is a consequence of action.settings setting event=pull_request
for merge_request_event. Given that we don't need any special behavior
from ECLAIR for merge requests, just run the regular scan, change
action.settings to set event=push for merge_request_event (same as for
pipeline triggered by git push).

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>

---
Example of a failure:
https://gitlab.com/xen-project/hardware/xen/-/jobs/7486162928

Example of a success with this patch applies:
https://gitlab.com/xen-project/people/sstabellini/xen/-/pipelines/1397672866

diff --git a/automation/eclair_analysis/ECLAIR/action.settings b/automation/eclair_analysis/ECLAIR/action.settings
index 1577368b61..1bfb22b1c1 100644
--- a/automation/eclair_analysis/ECLAIR/action.settings
+++ b/automation/eclair_analysis/ECLAIR/action.settings
@@ -64,14 +64,11 @@ gitlab)
 
     case "${CI_PIPELINE_SOURCE}" in
     merge_request_event)
-        event=pull_request
-        pullRequestId="${CI_MERGE_REQUEST_IID}"
-        pullRequestHeadRef="${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
-        pullRequestHeadRepo="${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}"
-        pullRequestBaseRef="${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}"
-        pullRequestUser="${GITLAB_USER_LOGIN}"
+        event=push
+        ref_kind=branch
+        ref="${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
         headCommitId="${CI_COMMIT_SHA}"
-        baseCommitId="${CI_MERGE_REQUEST_DIFF_BASE_SHA}"
+        pushUser="${GITLAB_USER_NAME}"
         ;;
     push | pipeline | web | schedule)
         event=push


From xen-devel-bounces@lists.xenproject.org Thu Aug 01 22:13:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Aug 2024 22:13:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770013.1180873 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZe3L-0001pE-Bn; Thu, 01 Aug 2024 22:13:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770013.1180873; Thu, 01 Aug 2024 22:13:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZe3L-0001p7-9H; Thu, 01 Aug 2024 22:13:43 +0000
Received: by outflank-mailman (input) for mailman id 770013;
 Thu, 01 Aug 2024 22:13:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZe3K-0001ox-BP; Thu, 01 Aug 2024 22:13:42 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZe3J-0007v2-VY; Thu, 01 Aug 2024 22:13:41 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZe3J-0007r8-Gj; Thu, 01 Aug 2024 22:13:41 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZe3J-0001Gt-GT; Thu, 01 Aug 2024 22:13:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=+acq94xTBz51JkZ3DEOKYvZMZwwC/856M2Zp5XVwjhE=; b=UtHn3jv/Ufl51fMO+2GnTkZVtV
	IU3SbROc8P19LEHeAcMWxhIyuUio0lI+Ro88QNFIXthzWoiFkly1hDMWqa1WEC1FOqpMOkaXRgt5a
	b+Q5ILrtLduQluXXGXEMT4Qbc5xICG4+mACfbozXN4eLmm4YZtjMDs+ELCjQ2F+NcJr4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187099-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187099: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=ac0b669c562574b3b5c94ce6f922819bb0a21bf1
X-Osstest-Versions-That:
    libvirt=3033a9380fa67754c9be050949ebf09a0cdee6d6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 01 Aug 2024 22:13:41 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 libvirt              ac0b669c562574b3b5c94ce6f922819bb0a21bf1
baseline version:
 libvirt              3033a9380fa67754c9be050949ebf09a0cdee6d6

Last test of basis   187071  2024-07-31 04:18:50 Z    1 days
Testing same since   187099  2024-08-01 04:19:04 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Michal Privoznik <mprivozn@redhat.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   3033a9380f..ac0b669c56  ac0b669c562574b3b5c94ce6f922819bb0a21bf1 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 00:37:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 00:37:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770031.1180884 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZgHt-00051U-3Z; Fri, 02 Aug 2024 00:36:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770031.1180884; Fri, 02 Aug 2024 00:36:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZgHt-00051N-0O; Fri, 02 Aug 2024 00:36:53 +0000
Received: by outflank-mailman (input) for mailman id 770031;
 Fri, 02 Aug 2024 00:36:51 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZgHr-00051D-P2; Fri, 02 Aug 2024 00:36:51 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZgHr-0002Q9-CL; Fri, 02 Aug 2024 00:36:51 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZgHq-00061Y-RK; Fri, 02 Aug 2024 00:36:50 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZgHq-0000CU-Qn; Fri, 02 Aug 2024 00:36:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=I57gTzq18IBgXP2u4PMx0g93frw1WHbAJNMHL8Da+0Y=; b=pu718di1N8kKKOi1RK11ccs5Pr
	dmufQCbHzgstcxXEuBhMu5CrLcO4Vft+pK2+prcXVROmZr6D6zyqkaktcJgyAnTHN9Awx8RAfc2ML
	t/E5YKhJTHpWOO/zZBTRZ0/EejM2zv8JYDCReb7LfrsJDuE+nKMXq2prqFvHjJEoAHgM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187114-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187114: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=bbee1cc852fa8676ed0b530b1c67c92f32f4f740
X-Osstest-Versions-That:
    ovmf=b0e7a75a4959a481cc6b857d6e6a9607d14523bf
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 02 Aug 2024 00:36:50 +0000

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

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

Last test of basis   187111  2024-08-01 19:45:07 Z    0 days
Testing same since   187114  2024-08-01 21:42:13 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Rebecca Cran <rebecca@bsdio.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   b0e7a75a49..bbee1cc852  bbee1cc852fa8676ed0b530b1c67c92f32f4f740 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 02:37:51 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 02:37:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770047.1180893 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZiAi-0001Ss-FR; Fri, 02 Aug 2024 02:37:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770047.1180893; Fri, 02 Aug 2024 02:37:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZiAi-0001Sl-Cq; Fri, 02 Aug 2024 02:37:36 +0000
Received: by outflank-mailman (input) for mailman id 770047;
 Fri, 02 Aug 2024 02:37:35 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=uPwv=PB=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1sZiAg-0001Sf-Tc
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 02:37:35 +0000
Received: from NAM02-DM3-obe.outbound.protection.outlook.com
 (mail-dm3nam02on20600.outbound.protection.outlook.com
 [2a01:111:f403:2405::600])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 29e5bdad-5078-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 04:37:31 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by PH7PR12MB8178.namprd12.prod.outlook.com (2603:10b6:510:2b3::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Fri, 2 Aug
 2024 02:37:24 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285%3]) with mapi id 15.20.7828.021; Fri, 2 Aug 2024
 02:37:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 29e5bdad-5078-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=vzaAcs+Xfny8lZDk/4ocCF0f3rsVJYsH6/Eo4smHsq5iaJHFAVttIvOA7ck0ZYPBTdmVOQC3SI1cnv8Dm8QADl7vvFprcmWrdsgY3xkzUUIEvrLVYhqtglIEspuyJEs4gTSzNut+pmkL6gMNSXrD69v5ZydtJ5qIjzL62aIwttR5i34R5AYwWeYv2xlSfwsjema0jmPUZIWW5ubFu1QZhbxKPcWob+DpYLwL+rQ138Mr46Ei2w0vtLrBPuiXv8cVxKxXF7mBYdwQ5WSQgl6NtAHuy+p/AomwMnXd5fs6FmNMEPA2fqyqI3eFBA3pvuBYLswy4OHnvMOUGj/kRdCzkQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Eh1FYrO+8XedR9ax4UMoUCZggEJujSgs1wf1T2Avt7A=;
 b=cd7Tz64I9KuXVTQ3UWLoi1WSzbafXcV4nq1K32jXbQR+e05bLH2rudum2YU9EhTp7YYdz+ezsYfBN0/WJXVbgd2LaSVGF3NKdlBcFUjyKdzYw0OewrPBwmE7juetUwDWaHh/PRoI+DgMCcIHJFVC8ZqzO5GB3fQHpP5bN+lV+Y+pgTKWSBh9MsoeckEm5Kv1jp2aAl5XkcGDVXplaemqeYIbXkIxFXhMDxnorAC0RycnyAyA6lHMwObTj5VuVe0hZ2d/kxs3hKIdxu6QgUOOBr+aKoiCIFqFtz57QxO9i1qXy1vJcarvIQQ/hf1fqukKBsLKL0P042AEzwx+ypUiCw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Eh1FYrO+8XedR9ax4UMoUCZggEJujSgs1wf1T2Avt7A=;
 b=l+qbYDSfKTzWBHN70SEl7ynhf1IlnYKfjAuqawsvjJeiTXgnaxn+6kLuGwwwpkIFanxAoxpEHQPe1i8cxP45qlJyaBZ3wzv/ibsVoL0kktb347dfDY7lQ0ekM5R1IBktkUAa05z2QqiMOzMRtebLwdu8pHeKzAhbyUHXPNqEhRA=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>, Jan Beulich
	<jbeulich@suse.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>, George Dunlap
	<gwd@xenproject.org>, Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, Juergen
 Gross <jgross@suse.com>, "Daniel P . Smith" <dpsmith@apertussolutions.com>,
	"Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>, "Huang, Ray"
	<Ray.Huang@amd.com>, "Chen, Jiqian" <Jiqian.Chen@amd.com>
Subject: Re: [XEN PATCH v12 2/7] x86/pvh: Allow (un)map_pirq when dom0 is PVH
Thread-Topic: [XEN PATCH v12 2/7] x86/pvh: Allow (un)map_pirq when dom0 is PVH
Thread-Index:
 AQHa0SvUYCKIEvNO4Ei/mjm7Qit34LIQmkQAgAACPwCAAAdkgIAABG0AgAADDACAAALkgIAACfqAgAAE/oCAABpKgIAAAsoAgAAXhYCAAvm8AA==
Date: Fri, 2 Aug 2024 02:37:24 +0000
Message-ID:
 <BL1PR12MB584914D078416A5F0ECA0AE0E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <Zqnswi7ihOhMxPsi@macbook>
 <0aa0982a-30b3-43cd-9a9e-4542d7cb583f@suse.com> <Zqn014wCEfWhyo1-@macbook>
 <8ff685a6-0cbd-45cd-a818-4535a040c478@suse.com> <Zqn7HEuooChgRCuf@macbook>
 <d65ae152-22ee-4a57-8ff4-43ef0c234f5f@suse.com> <ZqoF55yapMxGN_WM@macbook>
 <fa33fbf8-32b6-48dc-a30c-dd76b021a76d@suse.com> <ZqogJVHV36ytYVP1@macbook>
 <ff922c7a-aa66-4b23-8b9f-63b0b403ff14@suse.com> <Zqo2N7CDshL7ZoMK@macbook>
In-Reply-To: <Zqo2N7CDshL7ZoMK@macbook>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: BL1PR12MB5849.namprd12.prod.outlook.com
 (15.20.7828.000)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|PH7PR12MB8178:EE_
x-ms-office365-filtering-correlation-id: b089425e-8944-4b8c-2a4e-08dcb29c0af4
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|7416014|1800799024|366016|376014|38070700018;
x-microsoft-antispam-message-info:
 =?utf-8?B?N1ZOU0o1TVR2dzFCTE9JdTJDQnJKeTZHR0VNY2FLMmFNWVdmNVYzSDdwOHc5?=
 =?utf-8?B?OVhUT09QalJndUZuZzYxY2pwK2ZnWTdyN3lYbTM2NnR2RE56WGJLemp2UjZs?=
 =?utf-8?B?S1gzR1pZNHEzemg1UlU5TWQxdkNOVVkvN1YwdkF1VFRGbzhzWE9HZlFNZTdk?=
 =?utf-8?B?SUtiUWxzdGM4dno3WGcvbW5FbFQ1aXBqSUk0NUxWelpnSm9xZmlBUWlaU0Fx?=
 =?utf-8?B?d2ZnYkJUSmdIZTNRRVViUUtVVlJJRjFiQnJTMUM2ZFc4M1c5NDdZK2g3NE9I?=
 =?utf-8?B?WkNVcFdZQzV0ZjZBNUZaSUxFREZseGdXSHhwWHdldnhiUEszd0FnUHJoay94?=
 =?utf-8?B?VEFrR081d3A3OU9hQ2tIcHg2ZzRxa0ZIdkVMaGprZXpVdWhibGFiVkRZQmFN?=
 =?utf-8?B?SXQvaGUxRXdORmNtZ3hoK1NrNlJFV0FLZTUwR1BxS2xWbVJWRGN5L0JNVnhH?=
 =?utf-8?B?M3BhU2NEYWd4M0NhdzNVT3o5TGtYZVdKRGxvek55MzNQSURwNmtzMGNjTDJ2?=
 =?utf-8?B?anNMQTNhY2Q2bzQxd3VPQVE2SmdlVUtqdHlZMFRlYmExQzA5REh6MXF2R2dU?=
 =?utf-8?B?UXNYMTRjcWRQRDUyZHVsbjdWLzV1b2xXdGpHeEtvSmE3YnB4NVkvRUp1ZUdn?=
 =?utf-8?B?eCtqdCsvck1SU2tqdk9oWmpUbE0xNUlZZHRpay9WbG51SXFvNWNxZjk5SWpZ?=
 =?utf-8?B?aU1STmp5N1h4L2ZBL05pc2ZmUEhRanM1RE5yVkpoUHBsejlIZlNJSlhDeTlW?=
 =?utf-8?B?R3FDQ2ZUVENhbTZ0R01mS1BKY2dSU2x6SlgyK01GOTJLWDgzWFR6RVc4dGo3?=
 =?utf-8?B?cjkvTk9GSkovSnVNQllmMVcxOVhvazJoZjM3bm9PMTdXTW5MTW54clFmVTJQ?=
 =?utf-8?B?OFBOcGMxelpaYkVqWGpQVjFRU2xmZ2dBSVVsTk9FMmhMVkF6WGttVm5rVjJL?=
 =?utf-8?B?bUZ4Q093NE5VTmxaRk9BaFJnSDBWWG5taUlIMVd5YWZRcW5kSnh2ZFAvMFFF?=
 =?utf-8?B?UU9vMkluR1R2YTdhb1I5dDcrZHFmVW5VTElZTVVXS01zY2YxUjRUZ2lla0J5?=
 =?utf-8?B?ZG8wcHczWnJiU0NqSWxmZGJEOTZPQjVDeGpUM0JBVFFsVElFSmM3UC9LNmVz?=
 =?utf-8?B?MWUrOUFZMzlDRTQvaERMVzk4Q0VPWUtUTittMlB3YUxaWXJyVjMrTGc4R3hk?=
 =?utf-8?B?SlFkUUNmZkR3YzAxaE9xN3l2cG1LWnF0U0c3cmZXeWxLekxIMEFCVEJhekdM?=
 =?utf-8?B?Z0Uya1lnQmpqeDBnVnlVV0JsRExGRFd1Wmd1NE13VHpPMFBaLzZSb25NZWtD?=
 =?utf-8?B?a0gvZlBMTmQ0U0VWL01TT2g5VHk0c2FWWTJHYWVjQTI2eG00c0FhdE92N09x?=
 =?utf-8?B?cHEyRUs0a3BJRnQzd3pDSlJ5ek1Pd0ZSaWRyMTFHdHVtOTdOajZwVVk4Q2VE?=
 =?utf-8?B?aVpBRWlqakZSdlE2SktKNWg2VFFYRXVLWGhmYVFNdXdhVjVKVTRXWUl4bkx2?=
 =?utf-8?B?OXY2WGRvbkNCUmJhcDlncHVmc2l0bUZDU1U3Qy9Rek9LZjNiNHhwait1NkFD?=
 =?utf-8?B?YmJhYnFzZ3JHMDh0S3c5anNLMCtBcG5WODFyamgvTk5jN2hVNzVsN0t6RHFn?=
 =?utf-8?B?L2xEMVYvcW95WUlmeXpobHY3czlYRHVLZGxWNmxBZWttUGRjRE9MR3VNS3B3?=
 =?utf-8?B?S1ZzRFYydDh1MVl3KzZHMDdEWnNNNS9ER3JDTVBUMEc2T3pIYzBpTVlyWDIw?=
 =?utf-8?B?blpWZmliYVFrNy82aW1OUUl3WmZJbjZ2TXRrbWJKZ0JBdUtpOFZMYWJvRU5p?=
 =?utf-8?B?eURSK1dSVklzQVZJN0pqTmJ1bEsxZ1BjanJWRnV0S2VDZ1dNdHpyZVNOMHY1?=
 =?utf-8?B?VU1wSUdjK2ptWXVVYVFOVUhRS3pxZkdSb0VKaTFTb2J2cXc9PQ==?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(1800799024)(366016)(376014)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?cmkvWlVTRkpZTEsrdkQzMnpkemgxTWhtRzhVZ01HZDdjd0hzMExYYmw3VzJU?=
 =?utf-8?B?RUsxc3Z1cGdxdWtNQ0tlM3puL3d1Mk94U052dUZtd3BRdkNOUG9wTTlYWnZU?=
 =?utf-8?B?MWg0NnEyWnVTV1dTM2x6ODVabktROU1vQlAxOGFqT29WeWZNOVNBdGxHakxP?=
 =?utf-8?B?UWswbnRxTzdhazdHMnlUVTZKczhGN3M1Mk1vTmM4NmxRbm9wckhuZUZzcno2?=
 =?utf-8?B?RzQ1MUh2ZEkreHl5aHBrYjduWnVHS213VDJSQTRBYjJNWmcvN3AzUjZITkIx?=
 =?utf-8?B?WjN1TlNmd0RrMkFoaVlBZnB3MWNVVG41L3RnNnVLNDJnUmtGWGRORmdsZENK?=
 =?utf-8?B?a0FyQmdLK256bFY0MEh4VHl1Vld3cHJ5K05lZnl6a1NPRi9FN08zMTRITm1F?=
 =?utf-8?B?K0ZicTQza3pxSlhZb1NjMkhnUGRoRXRyNWJSMFA4V1Zva1JrbjlmOUV1cjd0?=
 =?utf-8?B?VHBMZTFqbkZFWHRiQU9HdnB2aWFnWDhVZ2s1WE95WnoyRitsZ1RxRHhXdGZL?=
 =?utf-8?B?dGpWOTY3eFBiRE44ZG9VR1lQRnRnWGZNSjgvOUhnN3lORHhzRjcvaG9NTUVv?=
 =?utf-8?B?ZG9NYnUwbUJlT0R3NElvUjNmNnFaOVZwUWVCaDVrdGZxNCsxdm9LWWVBR1dr?=
 =?utf-8?B?RHpUd2dXRkwyd1FBZEhneDFHMVVtL2FrWlUxTG1BbnA0MVlsYzRqRlQ3U2tl?=
 =?utf-8?B?alhtck1EY1ZhanJPSnFaNWREYStJQUhYUWhkR0g1eklWNGkwOWxMTjgzemJ3?=
 =?utf-8?B?d0xHUmVkNmx3LzAxZ3FHbDA5bWhxSERHMmM2d09JWlVMZVFrTTlIOEo2WmFE?=
 =?utf-8?B?YmlzS3M3aVVYM05rT2pFVmhvTkMwc2ZVNHQvOHdxeVlQblkrd0V6ckdaNWxl?=
 =?utf-8?B?NVo0UXBsVlIyKzJyQmJPZmZValNyYVo3MnZuZEZmSGx3aHBGRWgxdG9ra3ZM?=
 =?utf-8?B?WjlnZEtSYlJPMCtCUUNCU2g4Q2lYdFlZL3NXbHExRUVDVlRIZTBZZm1jMitz?=
 =?utf-8?B?Q0FMTDdqazgvWnhFNFZGN0syRFpCUENsajR2SXRyMHg1OGZRbkZZczl4VUJB?=
 =?utf-8?B?SExXMVNWc0lBOXVidmZKN1J4L0NYM1E0S1VZaVF4SDQ5UGVPOTlUZkRTNGJY?=
 =?utf-8?B?RnZHVGllYmo4UGtjZmRnWXdyMHY5NjV6UXB3NERlRmNXT1BBZTRYR3VuZytz?=
 =?utf-8?B?SVdMdWlTaW5lSG4yR0N5aWlmR0hJc3V5em0zTDF4MnBpbHJVa3M4Y1RqM0pi?=
 =?utf-8?B?d3NBdk44RzAwUVBZQ2pwVnl1azQ1eDA5R1ZoNkJPK2NXZmhBU0xvUTV0UUVr?=
 =?utf-8?B?TGd2aDNWK2VLL0k2RDJsYTIwQTVNK0hidjRaa0ovVXE2TElCbHRXb1B4dGor?=
 =?utf-8?B?c0p3NU5lZWlxUzRJd3lnMDBnWThBbU9sME5IRUp4NzQrb1RsaG5NTklmR0tI?=
 =?utf-8?B?QSttL0pDRzQvWm9JV3ZhRHRTN0g1dktoekpiQkVkQmhFenMySG5TMmdUMUlZ?=
 =?utf-8?B?a3lGaElMN3RMa1VZLytHWC9RbzRad3praVh3Z3pkcEN5L0RNOEdWZnZyY3Np?=
 =?utf-8?B?V3ZMcS80RFQ3ZmVCT0tMVytsL2trcEZYNnJDUGFHdEFRUnF0UWl2WW5qMC82?=
 =?utf-8?B?d2g5T2dSa3kzVkZSVW5NNVdSMkNjM3JRcEtIcERXYUhwZHV5RWhMZDZNa0Fx?=
 =?utf-8?B?RlluQWZFNzh4S0p2RURISHZTeGVPUzd4c3BZZ3BKdWtITmErakw4UXhHalkx?=
 =?utf-8?B?Q25uN0hscnZpTXFhTW9aYTZEb2tXMklUVkwzMEtlYjVkbUR5YlRhcEFmUFB5?=
 =?utf-8?B?ZkE3T3BLdmFNVmIvNWhGR3pCbTZBMmY3VU00MVFWK2V5a3dwNXF1dnRqd1o5?=
 =?utf-8?B?bVY1S0FuemlVT2JaZm01OHVERFIxVE9FNHN2anpVakNaMWlGUzZVZFdMLzhQ?=
 =?utf-8?B?ODBvUDArT0QwQ29nUmhhSStFS05vZDlmbnNjeVdEcHcyZFBrN3M3VzQ3OFVF?=
 =?utf-8?B?K1Nwd3RIK0Y0R1Y0bSs0Qnk2d0NiMFNQUExLU3lteGNuazU1K3dJREZKdFVD?=
 =?utf-8?B?Tk9FSEZXdEorbWRGT25JbGx1bGhJQmRlS3hNNG80ZW4zWjNpNXd6YmlDSC9Q?=
 =?utf-8?Q?0qPk=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <1C4604973203C242A56CB919931403BD@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b089425e-8944-4b8c-2a4e-08dcb29c0af4
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2024 02:37:24.7624
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: OJHF9RR+g4QfV7Ig1lqIfv1OqWZ2RfUzi9T9tewOc4J/4MRpCtNgL9vByN4eegfxTue2jO1Y2T0S7pH1mrF1Fg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8178

T24gMjAyNC83LzMxIDIxOjAzLCBSb2dlciBQYXUgTW9ubsOpIHdyb3RlOg0KPiBPbiBXZWQsIEp1
bCAzMSwgMjAyNCBhdCAwMTozOTo0MFBNICswMjAwLCBKYW4gQmV1bGljaCB3cm90ZToNCj4+IE9u
IDMxLjA3LjIwMjQgMTM6MjksIFJvZ2VyIFBhdSBNb25uw6kgd3JvdGU6DQo+Pj4gT24gV2VkLCBK
dWwgMzEsIDIwMjQgYXQgMTE6NTU6MzVBTSArMDIwMCwgSmFuIEJldWxpY2ggd3JvdGU6DQo+Pj4+
IE9uIDMxLjA3LjIwMjQgMTE6MzcsIFJvZ2VyIFBhdSBNb25uw6kgd3JvdGU6DQo+Pj4+PiBPbiBX
ZWQsIEp1bCAzMSwgMjAyNCBhdCAxMTowMjowMUFNICswMjAwLCBKYW4gQmV1bGljaCB3cm90ZToN
Cj4+Pj4+PiBPbiAzMS4wNy4yMDI0IDEwOjUxLCBSb2dlciBQYXUgTW9ubsOpIHdyb3RlOg0KPj4+
Pj4+PiBJIGFncmVlIHdpdGggKGEpLCBidXQgSSBkb24ndCB0aGluayBlbmFibGluZyBQVkggZG9t
MCB1c2FnZSBvZiB0aGUNCj4+Pj4+Pj4gaHlwZXJjYWxscyBzaG91bGQgYmUgZ2F0ZWQgb24gdGhp
cy4gIEFzIHNhaWQgYSBQViBkb20wIGlzIGFscmVhZHkNCj4+Pj4+Pj4gY2FwYWJsZSBvZiBpc3N1
aW5nIFBIWVNERVZPUF97LHVufW1hcF9waXJxIG9wZXJhdGlvbnMgYWdhaW5zdCBhIFBWSA0KPj4+
Pj4+PiBkb21VLg0KPj4+Pj4+DQo+Pj4+Pj4gT2theSwgSSBjYW4gYWNjZXB0IHRoYXQgYXMgYW4g
aW50ZXJtZWRpYXRlIHBvc2l0aW9uLiBXZSBvdWdodCB0byBkZW55DQo+Pj4+Pj4gc3VjaCByZXF1
ZXN0cyBhdCBzb21lIHBvaW50IHRob3VnaCBmb3IgUFZIIGRvbWFpbnMsIHRoZSBsYXRlc3QgaW4g
dGhlDQo+Pj4+Pj4gY291cnNlIG9mIG1ha2luZyB2UENJIHdvcmsgdGhlcmUuDQo+Pj4+Pg0KPj4+
Pj4gSG0sIG9uY2UgcGh5c2Rldl9tYXBfcGlycSgpIHdvcmtzIGFzIGludGVuZGVkIGFnYWluc3Qg
UFZIIGRvbWFpbnMsIEkNCj4+Pj4+IGRvbid0IHNlZSB3aHkgd2Ugd291bGQgcHJldmVudCB0aGUg
dXNhZ2Ugb2YgUEhZU0RFVk9QX3ssdW59bWFwX3BpcnENCj4+Pj4+IGFnYWluc3Qgc3VjaCBkb21h
aW5zLg0KPj4+Pg0KPj4+PiBXZWxsLiBJZiBpdCBjYW4gYmUgbWFkZSB3b3JrIGFzIGludGVuZGVk
LCB0aGVuIEkgY2VydGFpbmx5IGFncmVlLiBIb3dldmVyLA0KPj4+PiB3aXRob3V0IGV2ZW4gdGhl
IGNvbmNlcHQgb2YgcElSUSBpbiBQVkggSSdtIGhhdmluZyBhIGhhcmQgdGltZSBzZWVpbmcgaG93
DQo+Pj4+IGl0IGNhbiBiZSBtYWRlIHdvcmsuIElpcmMgeW91IHdlcmUgYWR2b2NhdGluZyBmb3Ig
dXMgdG8gbm90IGludHJvZHVjZSBwSVJRDQo+Pj4+IGludG8gUFZILg0KPj4+DQo+Pj4gRnJvbSB3
aGF0IEknbSBzZWVpbmcgaGVyZSB0aGUgaW50ZW50aW9uIGlzIHRvIGV4cG9zZQ0KPj4+IFBIWVNE
RVZPUF97LHVufW1hcF9waXJxIHRvIFBWSCBkb20wLCBzbyB0aGVyZSBtdXN0IGJlIHNvbWUgbm90
aW9uIG9mDQo+Pj4gcElSUXMgb3IgYWtpbiBpbiBhIFBWSCBkb20wPyAgRXZlbiBpZiBvbmx5IGZv
ciBwYXNzdGhyb3VnaCBuZWVkcy4NCj4+DQo+PiBPbmx5IGluIHNvIGZhciBhcyBpdCBpcyBhbiBh
YnN0cmFjdCwgaGFuZGxlLWxpa2UgdmFsdWUgcGVydGFpbmluZyBzb2xlbHkNCj4+IHRvIHRoZSB0
YXJnZXQgZG9tYWluLg0KPj4NCj4+Pj4gTWF5YmUgeW91J3JlIHRoaW5raW5nIG9mIHJlLXVzaW5n
IHRoZSBzdWItb3BzLCByZXF1aXJpbmcgUFZIIGRvbWFpbnMgdG8NCj4+Pj4gcGFzcyBpbiBHU0lz
Pw0KPj4+DQo+Pj4gSSB0aGluayB0aGF0IHdhcyBvbmUgbXkgcHJvcG9zYWxzLCB0byBlaXRoZXIg
aW50cm9kdWNlIGEgbmV3DQo+Pj4gaHlwZXJjYWxsIHRoYXQgdGFrZXMgYSBHU0ksIG9yIHRvIG1v
ZGlmeSB0aGUgUEhZU0RFVk9QX3ssdW59bWFwX3BpcnENCj4+PiBpbiBhbiBBQkkgY29tcGF0aWJs
ZSB3YXkgc28gdGhhdCBzZW1hbnRpY2FsbHkgdGhlIGZpZWxkIGNvdWxkIGJlIGEgR1NJDQo+Pj4g
cmF0aGVyIHRoYW4gYSBwSVJRLiAgV2UgaG93ZXZlciB3b3VsZCBhbHNvIG5lZWQgYSB3YXkgdG8g
cmVmZXJlbmNlIGFuDQo+Pj4gTVNJIGVudHJ5Lg0KPj4NCj4+IE9mIGNvdXJzZS4NCj4+DQo+Pj4g
TXkgbWFpbiBjb25jZXJuIGlzIG5vdCB3aXRoIHBJUlFzIGJ5IGl0c2VsZiwgcElSUXMgYXJlIGp1
c3QgYW4NCj4+PiBhYnN0cmFjdCB3YXkgdG8gcmVmZXJlbmNlIGludGVycnVwdHMsIG15IGNvbmNl
cm4gYW5kIHdoYXQgSSB3YW50ZWQgdG8NCj4+PiBhdm9pZCBvbiBQVkggaXMgYmVpbmcgYWJsZSB0
byByb3V0ZSBwSVJRcyBvdmVyIGV2ZW50IGNoYW5uZWxzLiAgSU9XOg0KPj4+IGhhdmUgaW50ZXJy
dXB0cyBmcm9tIHBoeXNpY2FsIGRldmljZXMgZGVsaXZlcmVkIG92ZXIgZXZlbnQgY2hhbm5lbHMu
DQo+Pg0KPj4gT2gsIEkgbWlnaHQgaGF2ZSBzbGlnaHRseSBtaXN1bmRlcnN0b29kIHlvdXIgaW50
ZW50aW9ucyB0aGVuLg0KPiANCj4gTXkgaW50ZW50aW9uIHdvdWxkIGJlIHRvIG5vdCBldmVuIHVz
ZSBwSVJRcyBhdCBhbGwsIGluIG9yZGVyIHRvIGF2b2lkDQo+IHRoZSB0ZW1wdGF0aW9uIG9mIHRo
ZSBndWVzdCBpdHNlbGYgbWFuYWdpbmcgaW50ZXJydXB0cyB1c2luZw0KPiBoeXBlcmNhbGxzLCBo
ZW5jZSBJIHdvdWxkIGhhdmUgcHJlZmVycmVkIHRoYXQgYWJzdHJhY3QgaW50ZXJmYWNlIHRvIGJl
DQo+IHNvbWV0aGluZyBlbHNlLg0KPiANCj4gTWF5YmUgd2UgY291bGQgZXZlbiBleHBvc2UgdGhl
IFhlbiBJUlEgc3BhY2UgZGlyZWN0bHksIGFuZCBqdXN0IHVzZQ0KPiB0aGF0IGFzIGludGVycnVw
dCBoYW5kbGVzLCBidXQgc2luY2UgSSdtIG5vdCB0aGUgb25lIGRvaW5nIHRoZSB3b3JrDQo+IEkn
bSBub3Qgc3VyZSBpdCdzIGZhaXIgdG8gYXNrIGZvciBzb21ldGhpbmcgdGhhdCB3b3VsZCByZXF1
aXJlIG1vcmUNCj4gY2hhbmdlcyBpbnRlcm5hbGx5IHRvIFhlbi4NCj4gDQo+Pj4+IEkgdGhpbmsg
SSBzdWdnZXN0ZWQgc29tZXRoaW5nIGFsb25nIHRoZXNlIGxpbmVzIGFsc28gdG8NCj4+Pj4gSmlx
aWFuLCB5ZXQgd2l0aCB0aGUgbm93IGludGVuZGVkIGV4cG9zdXJlIHRvICFoYXNfcGlycSgpIGRv
bWFpbnMgSSdtDQo+Pj4+IG5vdCBzdXJlIHRoaXMgY291bGQgYmUgbWFkZSB3b3JrIHJlbGlhYmx5
Lg0KPj4+DQo+Pj4gSSdtIGFmcmFpZCBJJ3ZlIGJlZW4gbGFja2luZyBiZWhpbmQgb24gcmV2aWV3
aW5nIHRob3NlIHNlcmllcy4NCj4+Pg0KPj4+PiBXaGljaCByZW1pbmRzIG1lIG9mIGFub3RoZXIg
cXVlc3Rpb24gSSBoYWQ6IFdoYXQgbWVhbmluZyBkb2VzIHRoZSBwaXJxDQo+Pj4+IGZpZWxkIGhh
dmUgcmlnaHQgbm93LCBpZiBEb20wIHdvdWxkIGlzc3VlIHRoZSByZXF1ZXN0IGFnYWluc3QgYSBQ
VkggRG9tVT8NCj4+Pj4gV2hhdCBtZWFuaW5nIHdpbGwgaXQgaGF2ZSBmb3IgYSAhaGFzX3BpcnEo
KSBIVk0gZG9tYWluPw0KPj4+DQo+Pj4gVGhlIHBpcnEgZmllbGQgY291bGQgYmUgYSB3YXkgdG8g
cmVmZXJlbmNlIGFuIGludGVycnVwdC4gIEl0IGRvZXNuJ3QNCj4+PiBuZWVkIHRvIGJlIGV4cG9z
ZWQgdG8gdGhlIFBWSCBkb21VIGF0IGFsbCwgYnV0IGl0J3MgYSB3YXkgZm9yIHRoZQ0KPj4+IGRl
dmljZSBtb2RlbCB0byBpZGVudGlmeSB3aGljaCBpbnRlcnJ1cHQgc2hvdWxkIGJlIG1hcHBlZCB0
byB3aGljaA0KPj4+IGRvbWFpbi4NCj4+DQo+PiBTaW5jZSBwSVJRLXMgYXJlIHBlci1kb21haW4s
IF90aGF0XyBraW5kIG9mIGFzc29jaWF0aW9uIHdvbid0IGJlDQo+PiBoZWxwZWQuIEJ1dCB5ZXMs
IGFzIHBlciBhYm92ZSBpdCBjb3VsZCBzZXJ2ZSBhcyBhbiBhYnN0cmFjdCBoYW5kbGUtDQo+PiBs
aWtlIHZhbHVlLg0KPiANCj4gSSB3b3VsZCBiZSBmaW5lIHdpdGggZG9pbmcgdGhlIGludGVycnVw
dCBiaW5kaW5ncyBiYXNlZCBvbiBJUlFzDQo+IGluc3RlYWQgb2YgcElSUXMsIGJ1dCBJJ20gYWZy
YWlkIHRoYXQgd291bGQgcmVxdWlyZSBtb3JlIGNoYW5nZXMgdG8NCj4gaHlwZXJjYWxscyBhbmQg
WGVuIGludGVybmFscy4NCj4gDQo+IEF0IHNvbWUgcG9pbnQgSSBuZWVkIHRvIHdvcmsgb24gYSBu
ZXcgaW50ZXJmYWNlIHRvIGRvIHBhc3N0aHJvdWdoLCBzbw0KPiB0aGF0IHdlIGNhbiByZW1vdmUg
dGhlIHVzYWdlIG9mIGRvbWN0bHMgZnJvbSBRRU1VLiAgVGhhdCBtaWdodCBiZSBhDQo+IGdvb2Qg
b3Bwb3J0dW5pdHkgdG8gc3dpdGNoIGZyb20gdXNpbmcgcElSUXMuDQoNClRoYW5rcyBmb3IgeW91
ciBpbnB1dCwgYnV0IEkgbWF5IGJlIGEgYml0IGJlaGluZCB5b3Ugd2l0aCBteSBrbm93bGVkZ2Ug
YW5kIGNhbid0IGZ1bGx5IHVuZGVyc3RhbmQgdGhlIGRpc2N1c3Npb24uDQpIb3cgc2hvdWxkIEkg
bW9kaWZ5IHRoaXMgcXVlc3Rpb24gbGF0ZXI/DQpTaG91bGQgSSBhZGQgYSBuZXcgaHlwZXJjYWxs
IHNwZWNpZmljYWxseSBmb3IgcGFzc3Rocm91Z2g/DQpPciBpZiBpdCBpcyB0byBwcmV2ZW50IHRo
ZSAodW4pbWFwIGZyb20gYmVpbmcgdXNlZCBmb3IgUFZIIGd1ZXN0cywgY2FuIEkganVzdCBhZGQg
YSBuZXcgZnVuY3Rpb24gdG8gY2hlY2sgaWYgdGhlIHN1YmplY3QgZG9tYWluIGlzIGEgUFZIIHR5
cGU/IExpa2UgaXNfcHZoX2RvbWFpbigpLg0KDQo+IA0KPiBUaGFua3MsIFJvZ2VyLg0KDQotLSAN
CkJlc3QgcmVnYXJkcywNCkppcWlhbiBDaGVuLg0K


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 02:55:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 02:55:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770056.1180904 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZiSK-0004Q2-2L; Fri, 02 Aug 2024 02:55:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770056.1180904; Fri, 02 Aug 2024 02:55:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZiSJ-0004Pv-Uh; Fri, 02 Aug 2024 02:55:47 +0000
Received: by outflank-mailman (input) for mailman id 770056;
 Fri, 02 Aug 2024 02:55:47 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=uPwv=PB=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1sZiSJ-0004Pp-0q
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 02:55:47 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on2061b.outbound.protection.outlook.com
 [2a01:111:f403:2412::61b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b62150b6-507a-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 04:55:44 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by CH2PR12MB4101.namprd12.prod.outlook.com (2603:10b6:610:a8::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23; Fri, 2 Aug
 2024 02:55:38 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285%3]) with mapi id 15.20.7828.021; Fri, 2 Aug 2024
 02:55:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b62150b6-507a-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=BNYVL+HzFnqcfe0NfETpMaX1Qec4X+V3Kcewp8427Lc/X5mCJlr07ctw5gI4gMyr0Ie9WzfZALZW2xq/dI7WpOtIQnaVEP7Pc3h0lLBvP0IOXCxPRJFod4Gba146irvFjArXm6+7KleE9Adnkr+VGs4G41YXhWMECmjdrQ1tiZ6VM6SojcdIQqaZsPJ7rpZGLHt30AenE9Y0pDVs+6UuJQnAhC+yr9p6ZtcL7huSqVpXzp7GZB29dTG6wBM6+I8FKMWvObEo7m3bM/xO3f6j6Q/DwHn6g4KVcLYwf5LPWuqeFmVWPaPeAlXYh7WNgUPEycr9uq/ifdeZ/vSEx76HPg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=vYRNTbzWArIwnV1KHPuyR+zJFHV65ajubXa11N29Zsk=;
 b=s4+9bMd2hIXz7QLZM/CT2iHJiLZEien7VKfCgGhVF2kNBUuTVQ9xDaL9GkY3Rweuz21lz725nuq0rzoHvNbXRfMENfLo2AhIFTi/Xoqdz/ryM+I0sJdKMBka4mY3Odmn9F/3J1SlDsU6c+KqXypMZifLH2wZm8nFMJTsw/3MWHfuQ9eoRnWpBPtNUJHlP7rl0ZCzBJM3R3Y2rzuUxx2ba8JZV89JWW7ma7hks/WXgoWnQCZV5kofDQ4M7jvX5LXCO6wc7ly/NlDDHTdPuA0LaDZitOvkmwwLCimO7W9+9pWzstXPoOgWAqxZ1+FN5POlZc8z0S5EudmOjPqPUYJ/fQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=vYRNTbzWArIwnV1KHPuyR+zJFHV65ajubXa11N29Zsk=;
 b=TysMCZZkl83eae+2Xev3NoybXu3kZq+hz6rYhOGMtp0fFjjgGHR2f4z2szHGechILAz7jK3zORRkzrfEDiuUUOsEMlBOJAPpdt5H2NEGtO8z1tztygXG8PoEe2B25WxXL2cUPh/UG+IcFSThUciwlyJzIdNaxewEaWMzTojb628=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Jan
 Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, Wei
 Liu <wl@xen.org>, George Dunlap <gwd@xenproject.org>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD
	<anthony@xenproject.org>, Juergen Gross <jgross@suse.com>, "Daniel P . Smith"
	<dpsmith@apertussolutions.com>, "Hildebrand, Stewart"
	<Stewart.Hildebrand@amd.com>, "Huang, Ray" <Ray.Huang@amd.com>, "Chen,
 Jiqian" <Jiqian.Chen@amd.com>
Subject: Re: [XEN PATCH v12 1/7] xen/pci: Add hypercall to support reset of
 pcidev
Thread-Topic: [XEN PATCH v12 1/7] xen/pci: Add hypercall to support reset of
 pcidev
Thread-Index: AQHa0SvTLcqHcyv10kCa3wxjMJYih7IRIeaAgALMIQA=
Date: Fri, 2 Aug 2024 02:55:38 +0000
Message-ID:
 <BL1PR12MB5849CFC87F0DB92864B54BE4E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-2-Jiqian.Chen@amd.com> <ZqpeiWhuqPXiTeRZ@macbook>
In-Reply-To: <ZqpeiWhuqPXiTeRZ@macbook>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: BL1PR12MB5849.namprd12.prod.outlook.com
 (15.20.7828.000)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|CH2PR12MB4101:EE_
x-ms-office365-filtering-correlation-id: 86aedd1a-8e6d-497f-646c-08dcb29e96ea
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|7416014|366016|376014|1800799024|38070700018;
x-microsoft-antispam-message-info:
 =?utf-8?B?WUJCM3pWUUMwR1FvWmdSSEduTk1XSEg5YUhHL1h5cEhWWUR3RnNVLzBjZGw3?=
 =?utf-8?B?NXZoZkZ3OU1od2Z3VGxJRkg5T3dqdU4rR2h5V05xRHNHV3J5RVBZNmJNMS9N?=
 =?utf-8?B?ZnRCVHFjN1R2TVNSbW1xanQ0SU5qQ2xXMDZ4T2ZKZVdubEc5U3d6SXlyS2cr?=
 =?utf-8?B?eEppb3hzM2VoQVhTOEpBdVJQZ3d1RFNmRHhVbXppSmlPN05wU1V0NCtPMFFM?=
 =?utf-8?B?MEhzcklVWjNEaWs2RCtSdjVQR0dIWnRaN09KcWEyQVg3bXZWZUIyeFh3WWxX?=
 =?utf-8?B?WkV4b05mNldScHVhOGhrbUdLUjJTclE4T2VvdUkxamh4MW8xQmxycHlnV2NV?=
 =?utf-8?B?Sm12U2JpQldiRHNJeHc3Q2tiVXpqNzk0c2dmU21yeCs1ek9INjd2NGJOcWpa?=
 =?utf-8?B?ZEtYU2ZzZVlhQVc1RENRNWhNVWVrek5LUnFaM2tEYVV0Yk81NDA3c2xmNlYz?=
 =?utf-8?B?c3FPYy91SUpzeXNsM0l0N01Hdy9pSlZ4dXJNUnJESWFEeW9BOEFjaWEvUmRn?=
 =?utf-8?B?M29EZ1hodzFEYjRsYzBWd1RMaEk4dlpkTHRjaUozOXhoNWRXZUhtZ1d5emNh?=
 =?utf-8?B?VlBmMnhDY1pxUTR6V1RVck56V0N5OG12dmczR1FTdTVIcGVuSkFaTTlTMng2?=
 =?utf-8?B?WWFRYUdZdjFLckVvaUdKQ2ZNUkE0eVc3RmVzVVdOc0dibUpSd0ZzdUYvNlJJ?=
 =?utf-8?B?ZFlYeVlZVnlqbmZBVmtTOStEMTR3VmFzalNlTWlpTzVrUnVkVENCdW0wdTNM?=
 =?utf-8?B?L2R2S2hoL2FCVjlyVEhCZFJSQ1p0Wm01RFB4RXp5VE1NVHFYK0pZVDNkbEZq?=
 =?utf-8?B?ZEdGQjFVOFF0NFlHMU8vbzRQUVZ2OUU4ZnZNdzJ0SURzcUNKVTRIZWVEU3Iw?=
 =?utf-8?B?bCtiUWFZQlB6SkFQT3RjNnQvR1VCKy92SlhQbXNsYUxqcjAycmVJS25iekJJ?=
 =?utf-8?B?cEp1NmdWbGdiVXJiTVlnV0N4MmNCcVlyWC96Z2gwbFNxRVF2QnI5SmhNWFI3?=
 =?utf-8?B?dWhRQWVJS3ZYN3QwNXFpR1NTUmdBSC92enhzcVdZQmw1UW93dFJlNTRtaU1j?=
 =?utf-8?B?eGxGRlZyS2ZZa2RKeGpmYzNHQi84a2w0RXZMMXBsWUIvTUVFczNqVkVqcHR4?=
 =?utf-8?B?RlNObXlVU1lPRm0zSStIZTZIVlRPaGNkWFRVVXlKQktKSzJmcXlqaVVNY25N?=
 =?utf-8?B?Ym5VZGdFeHBoWHc1ZUtLeW9GMHFVWXhmbnFaMVRNemh0cCt1M1BhRVhVWHRG?=
 =?utf-8?B?YmRtb2JydXNDNmVwTkx4S3g1OTZlWTBPREZ4Zi9xM2h3RVozUmdoQjdrKytO?=
 =?utf-8?B?YjRsaTd5YzRNUEZWNitqVHJ6eEtaenFmRjdnWHJoWjdqcGxLN2taWkhCanJP?=
 =?utf-8?B?UUdpRjdyTjFQZlp3NWdkOEV1VTNUSDMvVmVyZDRKVWk2QmRMbk1QelA1TU41?=
 =?utf-8?B?dlZRa0FtMmljcnNtd2xoZ21IVTdlVGhXQlFPbUFuWkgzVU1CeVg4YUIySUFv?=
 =?utf-8?B?NTFpMkNZYms5ektETnpkLzF5alNIV05IdE0ycFVVSkRONllCOFVZSXR3L25N?=
 =?utf-8?B?ZXFaWUljSFJOS0ZHOEF1SndZS0dmeFRESXZhVk85akZraWpmN29ROEpMNXJq?=
 =?utf-8?B?NE1vVERvRTlKTmtraGFnUlpzdkxmTm5NT29DdU4vbThyZnpqQWJwZFdBV2w4?=
 =?utf-8?B?Sjc5M0w4dDBIWW5BMFIweitUZ1lnNkV0cUp4SFMwOTduMjVHcVRSRVhhQmkr?=
 =?utf-8?B?SFpYZmFtZjVockkyL1l2b2RPVG93dVduSGNYcUhIazdFbDBzeTIxMElpWXgw?=
 =?utf-8?B?UUkzbi93Q3NZNUh5WTY1LzA0bFZuckR6MmFkNVJ1SUV5UEFGVktoY3ZoVmd3?=
 =?utf-8?B?SHhsRGRmWmZoTG8wblNLWlJLT3BMSVJ2RkFFM0NBWmVycHc9PQ==?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(366016)(376014)(1800799024)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?cWZtaHg4VWRKWjRWZTBnSzY0Rm9ZLzBack1sN0xBb0pGY0dhZmlvanU1VW1H?=
 =?utf-8?B?a29qQVJ6Y0pWRHhhcWk5d0RvcEF5WDRUSUd0VTF3Smw0NUFnbkdvVWZaaDM1?=
 =?utf-8?B?bUNFb0hHMGZtSzcvbGNQTzVrdjNzYzArcEFvbjAweGgwSlRvR1BSS0RuVTIr?=
 =?utf-8?B?REp3RXVMMmFZckNmdmhmMUdhYmJiOEF3QytQRHVWVHFwM3AvR1VJcEUzS2sz?=
 =?utf-8?B?TDgvMnRYZ3Z5aldrZzBqQ1N4ZUFWUnJ1M250alhvVld3eURIeVhXV3dhQllH?=
 =?utf-8?B?dWFuRTc2WHgrQ2xSZmtURk1INFFQai9HVHcwVlBGbVptMzc3ek41WHJCTDJr?=
 =?utf-8?B?QjBsWUh4bEYvNERaOXVDSmFjYk9wWlh3VmF6NExqb0JkSGxMZUNMc01DYWNn?=
 =?utf-8?B?UUI4Q09iVUpBRTdrR3FUNHRlVmhkZE1tQ1ErSnhDZWhUbytIRUhLSm1KK21y?=
 =?utf-8?B?Q0dNYTBTTkJNTTgzZFhqK05DbFNicktRYVY5N1lFRDhmQkd3bWtOby9sSWx1?=
 =?utf-8?B?cGFabnN0enJoVmJtN1VWOXc4RmNoNXl3WEVuR01sRnNFV0Mrd1VpVkVqaW5r?=
 =?utf-8?B?VzBqTDFmeFY5Y1NCVVlKY2tFaWtyWGZTcGJBODcvQzRZTEFyMEZQYzF5bmdw?=
 =?utf-8?B?NnBjVGs2VzVYd1B2YUcwZ3NWZ3pvWmd1TDNBZDRuSWcwc0oyZDJqZ0QxWmVO?=
 =?utf-8?B?SGs1aHVZZjd5N3VxbklMdnp4SHdHYTFHdFNoenAwTzFZaXRmVFhBZHhBcm50?=
 =?utf-8?B?Z0pVRFpkRWQvTGd4bkNuMklxeVpyT250alJnWjRKbTcvMTlBaWJhVjZLd3Js?=
 =?utf-8?B?NEZnMDAyalc4WjhUVzh4dldpdkZoRTg2eHpYWVQwMkN6QUZQbmNWekpuenE1?=
 =?utf-8?B?MmFoT2x5UVB5eHpyNC82Y29OU1lhMmt2YkhHcEtHR1VQNEZIL2tEeGhuTyt2?=
 =?utf-8?B?R3k0dzB6UDFENkVRMndLWmVvRHJwRnZMRlpXUW5ncXhDUTEraVNCWGV4ck5V?=
 =?utf-8?B?ajVVR05rU0pZRnRDUnlxeGxjRngrVE9YN3o4Zm9TQ2NLQ2QrazRBWHFpb2Rp?=
 =?utf-8?B?cVAwaXJVdExLYm1xL3BEcnZLcXJRZ1pyVEl5WWc5ZVkrMlNpSDJQV0Zqa3h4?=
 =?utf-8?B?RXJQQW9obnUzeTIxQmdpRklPczM5ZkxzakppSVhDaEtJSmRFR2xoN0tyRWRD?=
 =?utf-8?B?cU5SQmEyZXI4Q3lSQ3VPbmhtZ09JNWh0M3ZBYmVDYWx4SUlsdmpvM2tQa09F?=
 =?utf-8?B?YmlmRk9uVHRPT1VmWSt0VmU0bEprRDgyQ01yNGVVeU5VZDl6TkZYN0dhOWRq?=
 =?utf-8?B?Z2E5SlFwWXZMK0pDaXdYczcxTWlCWDB1d3ZQeklaUVg0N1JTYjlYOXZMamQz?=
 =?utf-8?B?Q1JtaGZId1FKWkl5eG9zVTl1QlJlVlA4UHpNaXM0RUxSTEVSZ05rVEJsNml5?=
 =?utf-8?B?MTR0Wm03dzFtVHRSTWp6KytpVGtTdUh0SVFRdENXdWJXVzJJUjVRRzJqQlNw?=
 =?utf-8?B?RHFOOVlzK3NVUnBHNjZoZzhvYVRaTDh5cXlCU2ZVWjYvRG5QL016eGJ3YnZZ?=
 =?utf-8?B?eTExOUJSbXc4NFlENDBzVEtLSHRuNEtxWitUb1gxYUt2T3Y4djV0YXJGaXIw?=
 =?utf-8?B?bThuMlZXcWtQZ2xrVmkyeGJxekRlSTJET1JKU0NvYVE1R2M0Nm0rVmdMbmJz?=
 =?utf-8?B?UE50SzhHL0JqOGEzNTJLN1B0RjhlTlZ1YkpnWjgweUJBUTlPZWZaY2JwNjIv?=
 =?utf-8?B?bXhuOU5paGlzMlhsVFZEMkI3WmZxUEVpNHVVdDk3RkhxYlFCMyt1d2grZGdX?=
 =?utf-8?B?QTliZHlCWEdTaUlzSnNnV2EyWDRVRGJLRlMrNkt1NGJSdmNMZWVEWHgrZzhZ?=
 =?utf-8?B?K3c5RDBhRzZPWjJuZzhiT1lnRUFKUmthZkdwV3JUNlRSU3h3MnBBd3BTUzYv?=
 =?utf-8?B?ZTNBYUFxUWNpV2xzS2R2TEI2ZHplT0EzNWs1S0RhZzlTUE9aek5KcSsyMGVm?=
 =?utf-8?B?NFpsQ0ttQ2ZVRnRud0JWU0hKTk5rd09uZkc4cXNNdFo3TmQxM3hxaHNqZ2xR?=
 =?utf-8?B?MGE2WmhtWmd0OTlROFY3ZUZqd3RMeFBJUk40TVJWMkFzeVltNDAvRmUvSVpM?=
 =?utf-8?Q?yIBI=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <7D699C3126ECCE4DB1DC7508D4BBBDDF@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 86aedd1a-8e6d-497f-646c-08dcb29e96ea
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2024 02:55:38.6210
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: ddR9BbpZKgk8vDvEszx/ENVl4F/sfTYygnqAzqOxc4qt+/+p/97XX/NAgACd38rR7S96zh3pFZR86XS3uStzCA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4101

T24gMjAyNC83LzMxIDIzOjU1LCBSb2dlciBQYXUgTW9ubsOpIHdyb3RlOg0KPiBPbiBNb24sIEp1
bCAwOCwgMjAyNCBhdCAwNzo0MToxOFBNICswODAwLCBKaXFpYW4gQ2hlbiB3cm90ZToNCj4+IFdo
ZW4gYSBkZXZpY2UgaGFzIGJlZW4gcmVzZXQgb24gZG9tMCBzaWRlLCB0aGUgWGVuIGh5cGVydmlz
b3INCj4+IGRvZXNuJ3QgZ2V0IG5vdGlmaWNhdGlvbiwgc28gdGhlIGNhY2hlZCBzdGF0ZSBpbiB2
cGNpIGlzIGFsbA0KPj4gb3V0IG9mIGRhdGUgY29tcGFyZSB3aXRoIHRoZSByZWFsIGRldmljZSBz
dGF0ZS4NCj4+DQo+PiBUbyBzb2x2ZSB0aGF0IHByb2JsZW0sIGFkZCBhIG5ldyBoeXBlcmNhbGwg
dG8gc3VwcG9ydCB0aGUgcmVzZXQNCj4+IG9mIHBjaWRldiBhbmQgY2xlYXIgdGhlIHZwY2kgc3Rh
dGUgb2YgZGV2aWNlLiBTbyB0aGF0IG9uY2UgdGhlDQo+PiBzdGF0ZSBvZiBkZXZpY2UgaXMgcmVz
ZXQgb24gZG9tMCBzaWRlLCBkb20wIGNhbiBjYWxsIHRoaXMNCj4+IGh5cGVyY2FsbCB0byBub3Rp
ZnkgaHlwZXJ2aXNvci4NCj4+DQo+PiBTaWduZWQtb2ZmLWJ5OiBKaXFpYW4gQ2hlbiA8SmlxaWFu
LkNoZW5AYW1kLmNvbT4NCj4+IFNpZ25lZC1vZmYtYnk6IEh1YW5nIFJ1aSA8cmF5Lmh1YW5nQGFt
ZC5jb20+DQo+PiBTaWduZWQtb2ZmLWJ5OiBKaXFpYW4gQ2hlbiA8SmlxaWFuLkNoZW5AYW1kLmNv
bT4NCj4+IFJldmlld2VkLWJ5OiBTdGV3YXJ0IEhpbGRlYnJhbmQgPHN0ZXdhcnQuaGlsZGVicmFu
ZEBhbWQuY29tPg0KPj4gUmV2aWV3ZWQtYnk6IFN0ZWZhbm8gU3RhYmVsbGluaSA8c3N0YWJlbGxp
bmlAa2VybmVsLm9yZz4NCj4gDQo+IFRoYW5rcywganVzdCBhIGNvdXBsZSBvZiBuaXRzLg0KPiAN
Cj4gVGhpcyBpcyBtaXNzaW5nIGEgY2hhbmdlbG9nIGJldHdlZW4gdmVyc2lvbnMsIGFuZCBJIGhh
dmVuJ3QgYmVlbg0KPiBmb2xsb3dpbmcgYWxsIHRoZSB2ZXJzaW9ucywgc28gc29tZSBvZiBteSBx
dWVzdGlvbnMgbWlnaHQgaGF2ZSBiZWVuDQo+IGFuc3dlcmVkIGluIHByZXZpb3VzIHJldmlzaW9u
cy4NClNvcnJ5LCBJIHdpbGwgYWRkIGNoYW5nZWxvZ3MgaGVyZSBpbiBuZXh0IHZlcnNpb24uDQoN
Cj4gDQo+PiAtLS0NCj4+ICB4ZW4vYXJjaC94ODYvaHZtL2h5cGVyY2FsbC5jIHwgIDEgKw0KPj4g
IHhlbi9kcml2ZXJzL3BjaS9waHlzZGV2LmMgICAgfCA1MiArKysrKysrKysrKysrKysrKysrKysr
KysrKysrKysrKysrKysNCj4+ICB4ZW4vZHJpdmVycy92cGNpL3ZwY2kuYyAgICAgIHwgMTAgKysr
KysrKw0KPj4gIHhlbi9pbmNsdWRlL3B1YmxpYy9waHlzZGV2LmggfCAxNiArKysrKysrKysrKw0K
Pj4gIHhlbi9pbmNsdWRlL3hlbi92cGNpLmggICAgICAgfCAgOCArKysrKysNCj4+ICA1IGZpbGVz
IGNoYW5nZWQsIDg3IGluc2VydGlvbnMoKykNCj4+DQo+PiBkaWZmIC0tZ2l0IGEveGVuL2FyY2gv
eDg2L2h2bS9oeXBlcmNhbGwuYyBiL3hlbi9hcmNoL3g4Ni9odm0vaHlwZXJjYWxsLmMNCj4+IGlu
ZGV4IDdmYjMxMzZmMGM3Yy4uMGZhYjY3MGE0ODcxIDEwMDY0NA0KPj4gLS0tIGEveGVuL2FyY2gv
eDg2L2h2bS9oeXBlcmNhbGwuYw0KPj4gKysrIGIveGVuL2FyY2gveDg2L2h2bS9oeXBlcmNhbGwu
Yw0KPj4gQEAgLTgzLDYgKzgzLDcgQEAgbG9uZyBodm1fcGh5c2Rldl9vcChpbnQgY21kLCBYRU5f
R1VFU1RfSEFORExFX1BBUkFNKHZvaWQpIGFyZykNCj4+ICAgICAgY2FzZSBQSFlTREVWT1BfcGNp
X21tY2ZnX3Jlc2VydmVkOg0KPj4gICAgICBjYXNlIFBIWVNERVZPUF9wY2lfZGV2aWNlX2FkZDoN
Cj4+ICAgICAgY2FzZSBQSFlTREVWT1BfcGNpX2RldmljZV9yZW1vdmU6DQo+PiArICAgIGNhc2Ug
UEhZU0RFVk9QX3BjaV9kZXZpY2Vfc3RhdGVfcmVzZXQ6DQo+PiAgICAgIGNhc2UgUEhZU0RFVk9Q
X2RiZ3Bfb3A6DQo+PiAgICAgICAgICBpZiAoICFpc19oYXJkd2FyZV9kb21haW4oY3VycmQpICkN
Cj4+ICAgICAgICAgICAgICByZXR1cm4gLUVOT1NZUzsNCj4+IGRpZmYgLS1naXQgYS94ZW4vZHJp
dmVycy9wY2kvcGh5c2Rldi5jIGIveGVuL2RyaXZlcnMvcGNpL3BoeXNkZXYuYw0KPj4gaW5kZXgg
NDJkYjNlNmQxMzNjLi5jMGY0Nzk0NWQ5NTUgMTAwNjQ0DQo+PiAtLS0gYS94ZW4vZHJpdmVycy9w
Y2kvcGh5c2Rldi5jDQo+PiArKysgYi94ZW4vZHJpdmVycy9wY2kvcGh5c2Rldi5jDQo+PiBAQCAt
Miw2ICsyLDcgQEANCj4+ICAjaW5jbHVkZSA8eGVuL2d1ZXN0X2FjY2Vzcy5oPg0KPj4gICNpbmNs
dWRlIDx4ZW4vaHlwZXJjYWxsLmg+DQo+PiAgI2luY2x1ZGUgPHhlbi9pbml0Lmg+DQo+PiArI2lu
Y2x1ZGUgPHhlbi92cGNpLmg+DQo+PiAgDQo+PiAgI2lmbmRlZiBDT01QQVQNCj4+ICB0eXBlZGVm
IGxvbmcgcmV0X3Q7DQo+PiBAQCAtNjcsNiArNjgsNTcgQEAgcmV0X3QgcGNpX3BoeXNkZXZfb3Ao
aW50IGNtZCwgWEVOX0dVRVNUX0hBTkRMRV9QQVJBTSh2b2lkKSBhcmcpDQo+PiAgICAgICAgICBi
cmVhazsNCj4+ICAgICAgfQ0KPj4gIA0KPj4gKyAgICBjYXNlIFBIWVNERVZPUF9wY2lfZGV2aWNl
X3N0YXRlX3Jlc2V0Og0KPj4gKyAgICB7DQo+PiArICAgICAgICBzdHJ1Y3QgcGNpX2RldmljZV9z
dGF0ZV9yZXNldCBkZXZfcmVzZXQ7DQo+PiArICAgICAgICBzdHJ1Y3QgcGNpX2RldiAqcGRldjsN
Cj4+ICsgICAgICAgIHBjaV9zYmRmX3Qgc2JkZjsNCj4+ICsNCj4+ICsgICAgICAgIHJldCA9IC1F
T1BOT1RTVVBQOw0KPj4gKyAgICAgICAgaWYgKCAhaXNfcGNpX3Bhc3N0aHJvdWdoX2VuYWJsZWQo
KSApDQo+PiArICAgICAgICAgICAgYnJlYWs7DQo+PiArDQo+PiArICAgICAgICByZXQgPSAtRUZB
VUxUOw0KPj4gKyAgICAgICAgaWYgKCBjb3B5X2Zyb21fZ3Vlc3QoJmRldl9yZXNldCwgYXJnLCAx
KSAhPSAwICkNCj4+ICsgICAgICAgICAgICBicmVhazsNCj4+ICsNCj4+ICsgICAgICAgIHNiZGYg
PSBQQ0lfU0JERihkZXZfcmVzZXQuZGV2LnNlZywNCj4+ICsgICAgICAgICAgICAgICAgICAgICAg
ICBkZXZfcmVzZXQuZGV2LmJ1cywNCj4+ICsgICAgICAgICAgICAgICAgICAgICAgICBkZXZfcmVz
ZXQuZGV2LmRldmZuKTsNCj4+ICsNCj4+ICsgICAgICAgIHJldCA9IHhzbV9yZXNvdXJjZV9zZXR1
cF9wY2koWFNNX1BSSVYsIHNiZGYuc2JkZik7DQo+PiArICAgICAgICBpZiAoIHJldCApDQo+PiAr
ICAgICAgICAgICAgYnJlYWs7DQo+PiArDQo+PiArICAgICAgICBwY2lkZXZzX2xvY2soKTsNCj4+
ICsgICAgICAgIHBkZXYgPSBwY2lfZ2V0X3BkZXYoTlVMTCwgc2JkZik7DQo+PiArICAgICAgICBp
ZiAoICFwZGV2ICkNCj4+ICsgICAgICAgIHsNCj4+ICsgICAgICAgICAgICBwY2lkZXZzX3VubG9j
aygpOw0KPj4gKyAgICAgICAgICAgIHJldCA9IC1FTk9ERVY7DQo+PiArICAgICAgICAgICAgYnJl
YWs7DQo+PiArICAgICAgICB9DQo+PiArDQo+PiArICAgICAgICB3cml0ZV9sb2NrKCZwZGV2LT5k
b21haW4tPnBjaV9sb2NrKTsNCj4+ICsgICAgICAgIHBjaWRldnNfdW5sb2NrKCk7DQo+PiArICAg
ICAgICBzd2l0Y2ggKCBkZXZfcmVzZXQucmVzZXRfdHlwZSApDQo+PiArICAgICAgICB7DQo+PiAr
ICAgICAgICBjYXNlIFBDSV9ERVZJQ0VfU1RBVEVfUkVTRVRfQ09MRDoNCj4+ICsgICAgICAgIGNh
c2UgUENJX0RFVklDRV9TVEFURV9SRVNFVF9XQVJNOg0KPj4gKyAgICAgICAgY2FzZSBQQ0lfREVW
SUNFX1NUQVRFX1JFU0VUX0hPVDoNCj4+ICsgICAgICAgIGNhc2UgUENJX0RFVklDRV9TVEFURV9S
RVNFVF9GTFI6DQo+PiArICAgICAgICAgICAgcmV0ID0gdnBjaV9yZXNldF9kZXZpY2Vfc3RhdGUo
cGRldiwgZGV2X3Jlc2V0LnJlc2V0X3R5cGUpOw0KPj4gKyAgICAgICAgICAgIGJyZWFrOw0KPj4g
Kw0KPj4gKyAgICAgICAgZGVmYXVsdDoNCj4+ICsgICAgICAgICAgICByZXQgPSAtRU9QTk9UU1VQ
UDsNCj4+ICsgICAgICAgICAgICBicmVhazsNCj4+ICsgICAgICAgIH0NCj4+ICsgICAgICAgIHdy
aXRlX3VubG9jaygmcGRldi0+ZG9tYWluLT5wY2lfbG9jayk7DQo+PiArDQo+PiArICAgICAgICBi
cmVhazsNCj4+ICsgICAgfQ0KPj4gKw0KPj4gICAgICBkZWZhdWx0Og0KPj4gICAgICAgICAgcmV0
ID0gLUVOT1NZUzsNCj4+ICAgICAgICAgIGJyZWFrOw0KPj4gZGlmZiAtLWdpdCBhL3hlbi9kcml2
ZXJzL3ZwY2kvdnBjaS5jIGIveGVuL2RyaXZlcnMvdnBjaS92cGNpLmMNCj4+IGluZGV4IDFlNmFh
NWQ3OTliOS4uN2U5MTRkMWVmZjlmIDEwMDY0NA0KPj4gLS0tIGEveGVuL2RyaXZlcnMvdnBjaS92
cGNpLmMNCj4+ICsrKyBiL3hlbi9kcml2ZXJzL3ZwY2kvdnBjaS5jDQo+PiBAQCAtMTcyLDYgKzE3
MiwxNiBAQCBpbnQgdnBjaV9hc3NpZ25fZGV2aWNlKHN0cnVjdCBwY2lfZGV2ICpwZGV2KQ0KPj4g
IA0KPj4gICAgICByZXR1cm4gcmM7DQo+PiAgfQ0KPj4gKw0KPj4gK2ludCB2cGNpX3Jlc2V0X2Rl
dmljZV9zdGF0ZShzdHJ1Y3QgcGNpX2RldiAqcGRldiwNCj4+ICsgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgdWludDMyX3QgcmVzZXRfdHlwZSkNCj4gDQo+IFRoZXJlJ3MgcHJvYmFibHkgbm8g
dXNlIGluIHBhc3NpbmcgcmVzZXRfdHlwZSB0bw0KPiB2cGNpX3Jlc2V0X2RldmljZV9zdGF0ZSgp
IGlmIGl0J3MgaWdub3JlZD8NCj4gDQo+PiArew0KPj4gKyAgICBBU1NFUlQocndfaXNfd3JpdGVf
bG9ja2VkKCZwZGV2LT5kb21haW4tPnBjaV9sb2NrKSk7DQo+PiArDQo+PiArICAgIHZwY2lfZGVh
c3NpZ25fZGV2aWNlKHBkZXYpOw0KPj4gKyAgICByZXR1cm4gdnBjaV9hc3NpZ25fZGV2aWNlKHBk
ZXYpOw0KPj4gK30NCj4+ICsNCj4+ICAjZW5kaWYgLyogX19YRU5fXyAqLw0KPj4gIA0KPj4gIHN0
YXRpYyBpbnQgdnBjaV9yZWdpc3Rlcl9jbXAoY29uc3Qgc3RydWN0IHZwY2lfcmVnaXN0ZXIgKnIx
LA0KPj4gZGlmZiAtLWdpdCBhL3hlbi9pbmNsdWRlL3B1YmxpYy9waHlzZGV2LmggYi94ZW4vaW5j
bHVkZS9wdWJsaWMvcGh5c2Rldi5oDQo+PiBpbmRleCBmMGMwZDQ3MjdjMGIuLjNjZmRlM2ZkMjM4
OSAxMDA2NDQNCj4+IC0tLSBhL3hlbi9pbmNsdWRlL3B1YmxpYy9waHlzZGV2LmgNCj4+ICsrKyBi
L3hlbi9pbmNsdWRlL3B1YmxpYy9waHlzZGV2LmgNCj4+IEBAIC0yOTYsNiArMjk2LDEzIEBAIERF
RklORV9YRU5fR1VFU1RfSEFORExFKHBoeXNkZXZfcGNpX2RldmljZV9hZGRfdCk7DQo+PiAgICov
DQo+PiAgI2RlZmluZSBQSFlTREVWT1BfcHJlcGFyZV9tc2l4ICAgICAgICAgIDMwDQo+PiAgI2Rl
ZmluZSBQSFlTREVWT1BfcmVsZWFzZV9tc2l4ICAgICAgICAgIDMxDQo+PiArLyoNCj4+ICsgKiBO
b3RpZnkgdGhlIGh5cGVydmlzb3IgdGhhdCBhIFBDSSBkZXZpY2UgaGFzIGJlZW4gcmVzZXQsIHNv
IHRoYXQgYW55DQo+PiArICogaW50ZXJuYWxseSBjYWNoZWQgc3RhdGUgaXMgcmVnZW5lcmF0ZWQu
ICBTaG91bGQgYmUgY2FsbGVkIGFmdGVyIGFueQ0KPj4gKyAqIGRldmljZSByZXNldCBwZXJmb3Jt
ZWQgYnkgdGhlIGhhcmR3YXJlIGRvbWFpbi4NCj4+ICsgKi8NCj4+ICsjZGVmaW5lIFBIWVNERVZP
UF9wY2lfZGV2aWNlX3N0YXRlX3Jlc2V0IDMyDQo+PiArDQo+PiAgc3RydWN0IHBoeXNkZXZfcGNp
X2RldmljZSB7DQo+PiAgICAgIC8qIElOICovDQo+PiAgICAgIHVpbnQxNl90IHNlZzsNCj4+IEBA
IC0zMDUsNiArMzEyLDE1IEBAIHN0cnVjdCBwaHlzZGV2X3BjaV9kZXZpY2Ugew0KPj4gIHR5cGVk
ZWYgc3RydWN0IHBoeXNkZXZfcGNpX2RldmljZSBwaHlzZGV2X3BjaV9kZXZpY2VfdDsNCj4+ICBE
RUZJTkVfWEVOX0dVRVNUX0hBTkRMRShwaHlzZGV2X3BjaV9kZXZpY2VfdCk7DQo+PiAgDQo+PiAr
c3RydWN0IHBjaV9kZXZpY2Vfc3RhdGVfcmVzZXQgew0KPj4gKyAgICBwaHlzZGV2X3BjaV9kZXZp
Y2VfdCBkZXY7DQo+PiArI2RlZmluZSBQQ0lfREVWSUNFX1NUQVRFX1JFU0VUX0NPTEQgMA0KPj4g
KyNkZWZpbmUgUENJX0RFVklDRV9TVEFURV9SRVNFVF9XQVJNIDENCj4+ICsjZGVmaW5lIFBDSV9E
RVZJQ0VfU1RBVEVfUkVTRVRfSE9UICAyDQo+PiArI2RlZmluZSBQQ0lfREVWSUNFX1NUQVRFX1JF
U0VUX0ZMUiAgMw0KPj4gKyAgICB1aW50MzJfdCByZXNldF90eXBlOw0KPiANCj4gVGhpcyBtaWdo
dCB3YW50IHRvIGJlIGEgZmxhZ3MgZmllbGQsIHdpdGggdGhlIGxvdyAyIGJpdHMgKG9yIG1heWJl
IDMNCj4gYml0cyB0byBjb3BlIGlmIG1vcmUgcmVzdCBtb2RlcyBhcmUgYWRkZWQgaW4gdGhlIGZ1
dHVyZSkgYmVpbmcgdXNlZCB0bw0KPiBzaWduYWwgdGhlIHJlc2V0IHR5cGUuICBXZSBjYW4gYWx3
YXlzIGRvIHRoYXQgbGF0ZXIgaWYgZmxhZ3MgbmVlZCB0bw0KPiBiZSBhZGRlZC4NCkRvIHlvdSBt
ZWFuIHRoaXM/DQorc3RydWN0IHBjaV9kZXZpY2Vfc3RhdGVfcmVzZXQgew0KKyAgICBwaHlzZGV2
X3BjaV9kZXZpY2VfdCBkZXY7DQorI2RlZmluZSBfUENJX0RFVklDRV9TVEFURV9SRVNFVF9DT0xE
IDANCisjZGVmaW5lIFBDSV9ERVZJQ0VfU1RBVEVfUkVTRVRfQ09MRCAgKDFVPDxfUENJX0RFVklD
RV9TVEFURV9SRVNFVF9DT0xEKQ0KKyNkZWZpbmUgX1BDSV9ERVZJQ0VfU1RBVEVfUkVTRVRfV0FS
TSAxDQorI2RlZmluZSBQQ0lfREVWSUNFX1NUQVRFX1JFU0VUX1dBUk0gICgxVTw8X1BDSV9ERVZJ
Q0VfU1RBVEVfUkVTRVRfV0FSTSkNCisjZGVmaW5lIF9QQ0lfREVWSUNFX1NUQVRFX1JFU0VUX0hP
VCAgMg0KKyNkZWZpbmUgUENJX0RFVklDRV9TVEFURV9SRVNFVF9IT1QgICAoMVU8PF9QQ0lfREVW
SUNFX1NUQVRFX1JFU0VUX0hPVCkNCisjZGVmaW5lIF9QQ0lfREVWSUNFX1NUQVRFX1JFU0VUX0ZM
UiAgMw0KKyNkZWZpbmUgUENJX0RFVklDRV9TVEFURV9SRVNFVF9GTFIgICAoMVU8PF9QQ0lfREVW
SUNFX1NUQVRFX1JFU0VUX0ZMUikNCisgICAgdWludDMyX3QgcmVzZXRfdHlwZTsNCit9Ow0KDQo+
IA0KPiBTZWVpbmcgYXMgcmVzZXRfdHlwZSBoYXMgbm8gaW1wYWN0IG9uIHRoZSBoeXBlcmNhbGws
IEkgd291bGQgbGlrZSB0bw0KPiBhc2sgZm9yIHNvbWUgcmVhc29uaW5nIGZvciBpdCdzIHByZXNl
bmNlIHRvIGJlIGFkZGVkIHRvIHRoZSBjb21taXQNCj4gbWVzc2FnZSwgb3RoZXJ3aXNlIGl0IGZl
ZWxzIGxpa2UgcG9pbnRsZXNzIGNvZGUgY2h1cm4uDQpPSywgd2lsbCBhZGQgc29tZSBjb21taXQg
bWVzc2FnZXMgdG8gaWxsdXN0cmF0ZSB0aGF0IHRoaXMgaXMgZm9yIHRoZSBmb3J3YXJkLWxvb2tp
bmcgaW1wbGVtZW50YXRpb24gb2YgZGlmZmVyZW50IHJlc2V0IHR5cGVzIG9mIHByb2Nlc3Npbmcg
c2l0dWF0aW9ucyBpbiB0aGUgZnV0dXJlLg0KDQo+IA0KPj4gK307DQo+PiArDQo+PiAgI2RlZmlu
ZSBQSFlTREVWT1BfREJHUF9SRVNFVF9QUkVQQVJFICAgIDENCj4+ICAjZGVmaW5lIFBIWVNERVZP
UF9EQkdQX1JFU0VUX0RPTkUgICAgICAgMg0KPj4gIA0KPj4gZGlmZiAtLWdpdCBhL3hlbi9pbmNs
dWRlL3hlbi92cGNpLmggYi94ZW4vaW5jbHVkZS94ZW4vdnBjaS5oDQo+PiBpbmRleCBkYThkMGY0
MWU2ZjQuLjZiZTgxMmRiYzA0YSAxMDA2NDQNCj4+IC0tLSBhL3hlbi9pbmNsdWRlL3hlbi92cGNp
LmgNCj4+ICsrKyBiL3hlbi9pbmNsdWRlL3hlbi92cGNpLmgNCj4+IEBAIC0zOCw2ICszOCw4IEBA
IGludCBfX211c3RfY2hlY2sgdnBjaV9hc3NpZ25fZGV2aWNlKHN0cnVjdCBwY2lfZGV2ICpwZGV2
KTsNCj4+ICANCj4+ICAvKiBSZW1vdmUgYWxsIGhhbmRsZXJzIGFuZCBmcmVlIHZwY2kgcmVsYXRl
ZCBzdHJ1Y3R1cmVzLiAqLw0KPj4gIHZvaWQgdnBjaV9kZWFzc2lnbl9kZXZpY2Uoc3RydWN0IHBj
aV9kZXYgKnBkZXYpOw0KPj4gK2ludCBfX211c3RfY2hlY2sgdnBjaV9yZXNldF9kZXZpY2Vfc3Rh
dGUoc3RydWN0IHBjaV9kZXYgKnBkZXYsDQo+PiArICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICB1aW50MzJfdCByZXNldF90eXBlKTsNCj4+ICANCj4+ICAvKiBBZGQvcmVt
b3ZlIGEgcmVnaXN0ZXIgaGFuZGxlci4gKi8NCj4+ICBpbnQgX19tdXN0X2NoZWNrIHZwY2lfYWRk
X3JlZ2lzdGVyX21hc2soc3RydWN0IHZwY2kgKnZwY2ksDQo+PiBAQCAtMjgyLDYgKzI4NCwxMiBA
QCBzdGF0aWMgaW5saW5lIGludCB2cGNpX2Fzc2lnbl9kZXZpY2Uoc3RydWN0IHBjaV9kZXYgKnBk
ZXYpDQo+PiAgDQo+PiAgc3RhdGljIGlubGluZSB2b2lkIHZwY2lfZGVhc3NpZ25fZGV2aWNlKHN0
cnVjdCBwY2lfZGV2ICpwZGV2KSB7IH0NCj4+ICANCj4+ICtzdGF0aWMgaW5saW5lIGludCBfX211
c3RfY2hlY2sgdnBjaV9yZXNldF9kZXZpY2Vfc3RhdGUoc3RydWN0IHBjaV9kZXYgKnBkZXYsDQo+
PiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
IHVpbnQzMl90IHJlc2V0X3R5cGUpDQo+PiArew0KPj4gKyAgICByZXR1cm4gMDsNCj4+ICt9DQo+
PiArDQo+IA0KPiBNYXliZSBpdCB0dXJucyBvdXQgdG8gYmUgbW9yZSBjb21wbGljYXRlZCB0aGFu
IHRoZSBjdXJyZW50IGFwcHJvYWNoLA0KPiBidXQgdnBjaV9yZXNldF9kZXZpY2Vfc3RhdGUoKSBj
b3VsZCBiZSBhbiBzdGF0aWMgaW5saW5lIGZ1bmN0aW9uIGluDQo+IHZwY2kuaCBkZWZpbmVkIHJl
Z2FyZGxlc3Mgb2Ygd2hldGhlciBDT05GSUdfSEFTX1ZQQ0kgaXMgc2VsZWN0ZWQgb3INCj4gbm90
LCBhcyB0aGUgdW5kZXJseWluZyBmdW5jdGlvbnMgdnBjaV97ZGV9YXNzaWduX2RldmljZSgpIGFy
ZSBhbHdheXMNCj4gZGVmaW5lZC4NCk9LLCB3aWxsIGNoYW5nZSB0byB0aGlzIGluIG5leHQgdmVy
c2lvbi4NCitzdGF0aWMgaW5saW5lIGludCBfX211c3RfY2hlY2sgdnBjaV9yZXNldF9kZXZpY2Vf
c3RhdGUoc3RydWN0IHBjaV9kZXYgKnBkZXYpDQorew0KKyAgICBBU1NFUlQocndfaXNfd3JpdGVf
bG9ja2VkKCZwZGV2LT5kb21haW4tPnBjaV9sb2NrKSk7DQorDQorICAgIHZwY2lfZGVhc3NpZ25f
ZGV2aWNlKHBkZXYpOw0KKyAgICByZXR1cm4gdnBjaV9hc3NpZ25fZGV2aWNlKHBkZXYpOw0KK30N
Cg0KPiANCj4gVGhhbmtzLCBSb2dlci4NCg0KLS0gDQpCZXN0IHJlZ2FyZHMsDQpKaXFpYW4gQ2hl
bi4NCg==


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 02:57:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 02:57:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770064.1180915 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZiTT-0005GY-Cs; Fri, 02 Aug 2024 02:56:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770064.1180915; Fri, 02 Aug 2024 02:56:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZiTT-0005GR-7l; Fri, 02 Aug 2024 02:56:59 +0000
Received: by outflank-mailman (input) for mailman id 770064;
 Fri, 02 Aug 2024 02:56: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=uPwv=PB=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1sZiTR-0005GJ-Qk
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 02:56:57 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on20600.outbound.protection.outlook.com
 [2a01:111:f403:2415::600])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dfdce348-507a-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 04:56:55 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by CH2PR12MB4101.namprd12.prod.outlook.com (2603:10b6:610:a8::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23; Fri, 2 Aug
 2024 02:56:50 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285%3]) with mapi id 15.20.7828.021; Fri, 2 Aug 2024
 02:56:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dfdce348-507a-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=LlB+b6Ca11NXPflWO3OFpRBl+C5A0t1rL08QHMNbIszdiwQ0h+c/1kUqyIw+ff31NGwELKOo7fifoUPL/DADBmzDCzWHZktktexoMbkdpnBSTZ/o2tBEJp6GPEaz43z1GZ3FdVyZcsXPdlLkFQ/f06eBBctubIM27BIDgwGCm1SpQPPGDqT2myzuDlFlssTxo4Tk+eQmlVmQsjUqZW08z5aEKdmZbW0lDlFE0eax1UTVUa7Zf0O2FfiVawSxmtanLHlE8Mhfd1SpflTcP0J1Lr5H0NVVtntc4hgOvtfYeQr//7tEXAmixqd9t+lAv3DsWoZd5vZS0mAdGZLFx0YvIg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=25+9rBOnUI33mmwEw2JICV7RQqjmPOEKfpuXev6iRKU=;
 b=JSl7JUpo64LLpp2FL/UylEDhSgF2PG/1eWdgKcSQtOLkl3m6Ip1eGW2pGfj6MAsB0Tzh4r7TV8mg0n9lRd9+JHMaiGQfS8yJursH6AANa8Qguq1mi3EyWZmdBabNDKG7kHxdqjKpKpmEEKkHPGGBumdTleNsVJRa5ijVUB9i914GJ5m0v2jCJxAHsBxeUX8UU72qUtwargxLX3Z4h1WUYkPxYWt0fOSjLE9zoE9SRrBWSJ+tZy1sB4yFn3UKkkU+dJUtUKn5nAPUoPCIIiqoVauqEBIAjccxFBuwtxn1TVC5UqJTcz9VR/ebX2TgQcupQqCeY2weqcH3GqRQ3l+PCQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=25+9rBOnUI33mmwEw2JICV7RQqjmPOEKfpuXev6iRKU=;
 b=Z/TU7aHoK8rjxUM9HElHSwW0EjOHJyk69lQ4gh6QIx0G6yd8dQ4ID3AzEuONJuj161MfC9YDKPkso0xAHwNm+b5xA0dcM0M/k+e84XtPx/ve4cbpyKkN2SXJWu41ZWwVantPtpPkzm7dofcg3KNahylIIHwhz6kOrTrNkW2W9Mo=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: Jan Beulich <jbeulich@suse.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>, George Dunlap
	<gwd@xenproject.org>, Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, Juergen
 Gross <jgross@suse.com>, "Daniel P . Smith" <dpsmith@apertussolutions.com>,
	"Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>, "Huang, Ray"
	<Ray.Huang@amd.com>, =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?=
	<roger.pau@citrix.com>, "Chen, Jiqian" <Jiqian.Chen@amd.com>
Subject: Re: [XEN PATCH v12 1/7] xen/pci: Add hypercall to support reset of
 pcidev
Thread-Topic: [XEN PATCH v12 1/7] xen/pci: Add hypercall to support reset of
 pcidev
Thread-Index: AQHa0SvTLcqHcyv10kCa3wxjMJYih7IRIeaAgAAA2ACAAAQnAIAA9LaAgAHSh4A=
Date: Fri, 2 Aug 2024 02:56:50 +0000
Message-ID:
 <BL1PR12MB58492B43AEA9874CF55455CEE7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-2-Jiqian.Chen@amd.com> <ZqpeiWhuqPXiTeRZ@macbook>
 <23730906-f6c7-4a9a-bb2f-2969625c741e@suse.com> <ZqpiulPi3FbdpDoF@macbook>
 <1a35b90d-969c-4ef2-8dd1-4dc36f56fa30@suse.com>
In-Reply-To: <1a35b90d-969c-4ef2-8dd1-4dc36f56fa30@suse.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: BL1PR12MB5849.namprd12.prod.outlook.com
 (15.20.7828.000)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|CH2PR12MB4101:EE_
x-ms-office365-filtering-correlation-id: 22c8241c-9180-41d4-e519-08dcb29ec196
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|7416014|366016|376014|1800799024|38070700018;
x-microsoft-antispam-message-info:
 =?utf-8?B?QTQwWXl6TURuVDJYRGdQUE9xNmIyaXBpSmtnazI1TjRUMldQaUg2LzhWaWpo?=
 =?utf-8?B?SHpIOXJkb08xUFBuUGJLaWIrSU4yVWdNWjhGL1ExOE00MEQybnVHM0FvY1lK?=
 =?utf-8?B?eHh5cVRUYmFQZ09NSkkzeHZKY1VCMEY0QTBRQnRRaGt4REZWWVVMRWIwU2cv?=
 =?utf-8?B?RDV1S1kzSUZ2WGhMMDRJSTZlNEpSRHVNRVlObkVxclFLdURVVDVlcWZGSGZo?=
 =?utf-8?B?UFdjWlQ2QVdLcGZobkwwTTFhQjl6Ty9qdVNqQ285VkpVbEEya0lFeFhmZS9v?=
 =?utf-8?B?Vmc1YTNoT0JuQWczaEl1c1RtcjF6cGlhVFU5K2lIbmkyR2Z6Qm0rY1BQVnph?=
 =?utf-8?B?QVNGeVpjSzZlN0hVTXVmcXhXOGFRdnRMWDRjdGY3OEViRVRjTmdIeW12TTd2?=
 =?utf-8?B?LzdNNUJPUnJWSjl0RmtadWlCeWx3TSt3UHROU1k4NVd0Wng1Zy92NWpVcStx?=
 =?utf-8?B?MFR6SytVSHg4Mmo3Y2xuTUlWdE5vL2VTY08vYlJ4Uys4aHJDdVZwYWdmN1JE?=
 =?utf-8?B?UTM4cXp5SzBqRURNL3ZSaVJSYmdyc0VSSXkrcjJIWWhJZmt3SUp6K3ArYUdQ?=
 =?utf-8?B?ME5EdEQ3MngweWNRVkdiZ1NZeUxHQXl0RUNONU53NFdtZi9HS1k5Q1FpM1Vz?=
 =?utf-8?B?czRzbHlHWFYzRXFqV1Y3RFV1dmphdzBVeFpTTmRVakh1OU9FWUhNdENvV25W?=
 =?utf-8?B?Q2QyaVVoTWVrb1FUZzAyTUdaUkVaMUZRb0VyQk5KM3ErVkpYbHdkRlBJQ2dK?=
 =?utf-8?B?MTU3aHh6VGZ5ZXh6WkZxQ0kwTG5DSEdEZkVwTDJOV0kxL2dENmxlaFNrUDdE?=
 =?utf-8?B?OCtsTHhkTlhsTlNlUUh2RnpnRmdFRGhBb0xBU1RBTEZPUkJwWFlWYWxnSFlG?=
 =?utf-8?B?KzUvQUZoOXNXeEREM1paZ21hSzRPMHI5K0VBSkhmTkYvKzJ0em5uUEw4TUwy?=
 =?utf-8?B?eGlwcGVsa1lhSXduY21WNkl1WEN6WGdTRGZaeTJTUXhSZktna29kbFhWMkhO?=
 =?utf-8?B?NFpzZTJsRFAyYlJ0Z3JzeVFDemxkYkVOUnFtQmtrcmFKcnhKNXgzWkJjYmpz?=
 =?utf-8?B?SGlDVGxENXlRZTdxRVU0Q0p0ekdvanJQL0VXakZ0Y0VpTXFFQTQraFBRYmw4?=
 =?utf-8?B?dzIyMmpROXJmWlRBVFE5ZlV3eWhTSFVNQjhLcm9pUVNRdEJBZUwwcVI4cWFw?=
 =?utf-8?B?azl0VlVFZlozOUZDYlBRdDJQNkloOGJjc3B4OUNDNzZxQ2xUam9zZm52Z1N3?=
 =?utf-8?B?cEtRNXRZOGtZMkVscGFLQWhYTFp6endxNUFyNjA1dDZ2QzhDRGE4aGlLRUZJ?=
 =?utf-8?B?cERicHhrL3AxS2FrM0RmYzVEMjBUZVJoRitvZkJsa0pkRlJ2aFY2M0Y4Ry9D?=
 =?utf-8?B?M2NyQU1MTzgwUFdEZ2l6M0E5a2JuL0U2ckxwK1VDYjN5bjhUcDlyb3NjeWRW?=
 =?utf-8?B?MmFYUzdoMm9tKzBWbzB3WGZnWGNRcGtIODFaZEFuYytUSEZTUXhWd2EzcDNK?=
 =?utf-8?B?aCtTU2gxeGs2cWNZcitzUEl3WUhDOC9DcFAzcXZKUzJxbUhsRzh0eFBwaTFD?=
 =?utf-8?B?VlRmS1RtU3FHL3N0OTB0NTJvN0Z4UnRGWlozZ0tjTEdtOGtNOFFGaVpUWkIr?=
 =?utf-8?B?WlZrd3ZXMzJmcXRaSmJOazBSZVpaNE81OCt4ZWFMQ0xESjJlRnl6RncrQTlr?=
 =?utf-8?B?NkFBcGE3M3duRFlKd3REREpVVjJ3ejV4dUllYmc2bU5WQ2NhdVZsZGlKM0dJ?=
 =?utf-8?B?eEQ5ejBrZm5kWThaRFpoRURVN01FVnNrM1FxRXY0OXdsSS9EOUNKRG5aS3Rw?=
 =?utf-8?B?dExMVWJMeTdQcXE4ZnhKVXNEWmJxK05TS3d3SEd3VTJvZjJNV3lEaGliUkZY?=
 =?utf-8?B?S1l0RmxWWjBDdWpPNHU2eHlkUlQ5QmFka1ErdjdVc0lySlE9PQ==?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(366016)(376014)(1800799024)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?aTBZWlpIc3NLeGhNWkh0YlRlMlh0d3pBc2pUSy95TnFOakZ1Rk15ZkE2K1c3?=
 =?utf-8?B?ZENhVUwvRWRXU3QxaUVONGM3ZVZxY01sNy94VTIyNWJza2Uyb2VSei95Ry95?=
 =?utf-8?B?MVIwT0pQY0MvLzFycjlKQkZaVzhuam1YVFF4WjZzOGRXU0VOc0hIT2ZIYmgy?=
 =?utf-8?B?VnA3MTNtVk91Y1JsTGpYeVhLNVQ4cks0bDhHUDdFUngyS2ZwaFRrZVR2YjJk?=
 =?utf-8?B?L2tOcFNMMm9wTmNsdjZXcTFIdTNHSVgwbWxOWFM4Kyt6SmJhUVhKYnJ0T2d4?=
 =?utf-8?B?SVVUWVgrS3hYVU83NmlDTlByVldXVjRVTmgzS2VZOFQvaU1URUIrL3NZMklC?=
 =?utf-8?B?Wk9jMElacndRalpWbm1uVi9mSzhaTTNPbUxNTE9DRDJibWU0aFJoQ1hyOE9X?=
 =?utf-8?B?RWZmVUgybTg5VE4yKzRQWUVzQ2pNMkJ4TU5YQ21JWjZUbGVWSFNTRVlvZTY1?=
 =?utf-8?B?RmtEY0VOWWtOVk01aDlzL0owb0o5NFRkaHF3RFc2NGViOS9zWXUvSERYMkFZ?=
 =?utf-8?B?dUpyUnpqblN3NmNWWUNCQkVkb3B1L1VVK1FxR2hSY2dMS0lTUXdHNS9GSmsv?=
 =?utf-8?B?aHFnTmtGQlhWV1c0eVNpcUdPRkc2VEpoZTlBSjdvNTk4ejB1SXI4U3ZVNXNC?=
 =?utf-8?B?c1ZLV3NEelc1YXNVem9SZ2M1Z0hqaUhEaFNubzZjWjlEblkwUHZCckc4THNx?=
 =?utf-8?B?STNDMjFaREw1TWV0ajFUeGFYWlBySG9rdGpMR0YySEJuOXJOem5JREszNHNE?=
 =?utf-8?B?OUsvNHJWVkpNVWp0MzNqck1tSmhoeWZtQ2VZMmEvSjQwM3BoUXVEdzNWck10?=
 =?utf-8?B?RXdyb1RHYnpISVRiRUx3cmZocGJNYlJRL1ljTVFlOUZTWHdsSGN5ZGJ2RWQ1?=
 =?utf-8?B?MDhzb0JLRHBEZUFUSlVENzlmNkExMTJoeWJnNVZVa3liZVE5Y201ck8xVGJ5?=
 =?utf-8?B?aEZDdzFNR2xwUDdxT1VjQXBXdXJxaCt2S1VTb01rUXJEd2NjcVlUaEJBTjl5?=
 =?utf-8?B?QkJFVWJVOEwySG04YmV6SDdSK2xYRWNIYUFZZDdzK21pakRtUE90TXNHOUtQ?=
 =?utf-8?B?VXZQYnFMblJxSzdyMzBKVGdrT05hc2txcHpsdjMyZmUvQ1EvOHhxRDhLdGw4?=
 =?utf-8?B?L1YyVnFDNXppWS95emJMVVlmRW8xQ2cyUnZsS0wwdGYwamd0NCtTd3dSMytG?=
 =?utf-8?B?c0tlaDd1NlZ4SFJiQWxsaGZxY1pQREpmM3ZDempRdFg3SVdobmFkMmxZU3VF?=
 =?utf-8?B?RjE0U1B4NlVFQXZkcUIxN3psbjNNV2VDMENxdjBJZGsxY0cwcTNZRHhsSnpt?=
 =?utf-8?B?cWd1OXB0cTFRakpmeTFlaFQycTBORDVETDREYXhlN0IvSndUN2dDbXB3SU9D?=
 =?utf-8?B?UUxUU2NwS2s4QllTakJaOS9tZmo3cEJTMk5CTnBnUWhYRk9iaWpZQUxzY0xK?=
 =?utf-8?B?VWVLVm9MVzZRTmIyZlAzWDFBYUtUTjFMbitkUEV2dFV3MDZ4Sm15WVZ2dEI4?=
 =?utf-8?B?WlBjYXRZcFlYL1NlN3V4M0h6czFUcWl1eVp2RUhTeXo4VGVEb25Ea0gyQ055?=
 =?utf-8?B?N2c2Y0V6Sk9MS1BROStMdGsvSVptOXc3WVdhdWRJUXNWRllPK1doOXlZbGc5?=
 =?utf-8?B?KzQxenBnY0JyQ2RHSlFiVU42aEEwVUM0Tm1tUDFKWnRDTWZESXNvK0hGbnRh?=
 =?utf-8?B?aENUc3NLV082RDFWMWxlVjZrWlFLelo2NFpMc0RWSWNZN1BlVGs5b0k0eWdT?=
 =?utf-8?B?c0Zjc1pIZ2htNU5zQlk4RzhmU1o0QXBUWXdSM2pyLzBnUUdnMnFYN0d3NWxX?=
 =?utf-8?B?NDRmMkxHRnQ5dVpJaGFEMEgyWUF4cVZ6eFQ1cTg3dmhaYTVqd05BSTdmZnN3?=
 =?utf-8?B?Y25UUlpLYjk1WVJwaDdncUpGNFd4REdNZnhsZEI3NytkTlZUaXVyMFBkSHRF?=
 =?utf-8?B?djc3RWY1S0FrM0RidUVOUUNqbTc3K092dVFXa29hOHg2dTJZMHd5cHNsLzVn?=
 =?utf-8?B?QWNOWW9HWGN5REJjdUI3ZkUzUmVDSDdORHR2Z21XdjVZWGt2UkRkT2c4TEZ4?=
 =?utf-8?B?REJPTWlUS2ExN2drZVhCVnRYYSswMFcrelZRT1NYZ2p0YWRZSFlOMHM0Nkh2?=
 =?utf-8?Q?DHzM=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <DB7EA33509F7884CBDC22D54A775DC93@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 22c8241c-9180-41d4-e519-08dcb29ec196
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2024 02:56:50.2204
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: QgblGnT5xlSt84tYaqEcNNZC4Y6PH8s7LBd8tZL745m4n1j+R0VZDWqV54ZvZJPTDDyD0eUN4xMN1mKVrB+ozg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4101

T24gMjAyNC84LzEgMTQ6NDksIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAzMS4wNy4yMDI0IDE4
OjEzLCBSb2dlciBQYXUgTW9ubsOpIHdyb3RlOg0KPj4gT24gV2VkLCBKdWwgMzEsIDIwMjQgYXQg
MDU6NTg6NTRQTSArMDIwMCwgSmFuIEJldWxpY2ggd3JvdGU6DQo+Pj4gT24gMzEuMDcuMjAyNCAx
Nzo1NSwgUm9nZXIgUGF1IE1vbm7DqSB3cm90ZToNCj4+Pj4gT24gTW9uLCBKdWwgMDgsIDIwMjQg
YXQgMDc6NDE6MThQTSArMDgwMCwgSmlxaWFuIENoZW4gd3JvdGU6DQo+Pj4+PiAtLS0gYS94ZW4v
ZHJpdmVycy92cGNpL3ZwY2kuYw0KPj4+Pj4gKysrIGIveGVuL2RyaXZlcnMvdnBjaS92cGNpLmMN
Cj4+Pj4+IEBAIC0xNzIsNiArMTcyLDE2IEBAIGludCB2cGNpX2Fzc2lnbl9kZXZpY2Uoc3RydWN0
IHBjaV9kZXYgKnBkZXYpDQo+Pj4+PiAgDQo+Pj4+PiAgICAgIHJldHVybiByYzsNCj4+Pj4+ICB9
DQo+Pj4+PiArDQo+Pj4+PiAraW50IHZwY2lfcmVzZXRfZGV2aWNlX3N0YXRlKHN0cnVjdCBwY2lf
ZGV2ICpwZGV2LA0KPj4+Pj4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBy
ZXNldF90eXBlKQ0KPj4+Pg0KPj4+PiBUaGVyZSdzIHByb2JhYmx5IG5vIHVzZSBpbiBwYXNzaW5n
IHJlc2V0X3R5cGUgdG8NCj4+Pj4gdnBjaV9yZXNldF9kZXZpY2Vfc3RhdGUoKSBpZiBpdCdzIGln
bm9yZWQ/DQo+Pj4NCj4+PiBJIGNvbnNpZGVyIHRoaXMgZm9yd2FyZC1sb29raW5nLiBJdCBzZWVt
cyByYXRoZXIgdW5saWtlbHkgdGhhdCBpbiB0aGUNCj4+PiBsb25nZXIgcnVuIHRoZSByZXNldCB0
eXBlIGRvZXNuJ3QgbWF0dGVyLg0KPj4NCj4+IEknbSBmaW5lIHdpdGggaGF2aW5nIGl0IGluIHRo
ZSBoeXBlcmNhbGwgaW50ZXJmYWNlLCBidXQgcGFzc2luZyBpdCB0bw0KPj4gdnBjaV9yZXNldF9k
ZXZpY2Vfc3RhdGUoKSBjYW4gYmUgZG9uZSBvbmNlIHRoZXJlJ3MgYSBwdXJwb3NlIGZvciBpdCwN
Cj4+IGFuZCBpdCB3b24ndCBjaGFuZ2UgYW55IHB1YmxpYyBmYWNpbmcgaW50ZXJmYWNlLg0KPiAN
Cj4gSmlxaWFuLCBqdXN0IHRvIGNsYXJpZnk6IEknbSBva2F5IGVpdGhlciB3YXkuDQpUaGFuayB5
b3UgdmVyeSBtdWNoISBZb3UgZGlzcGVsbGVkIG15IGNvbmNlcm5zLg0KSSB3aWxsIHJlbW92ZSBy
ZXNldF90eXBlIGluIG5leHQgdmVyc2lvbi4NCg0KPiANCj4gSmFuDQoNCi0tIA0KQmVzdCByZWdh
cmRzLA0KSmlxaWFuIENoZW4uDQo=


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 03:10:39 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 03:10:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770072.1180925 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZigb-0008IO-Kk; Fri, 02 Aug 2024 03:10:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770072.1180925; Fri, 02 Aug 2024 03:10:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZigb-0008IH-GX; Fri, 02 Aug 2024 03:10:33 +0000
Received: by outflank-mailman (input) for mailman id 770072;
 Fri, 02 Aug 2024 03:10:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=uPwv=PB=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1sZiga-0008IB-RN
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 03:10:32 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on20600.outbound.protection.outlook.com
 [2a01:111:f403:2417::600])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c697b911-507c-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 05:10:31 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by SN7PR12MB8026.namprd12.prod.outlook.com (2603:10b6:806:34b::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Fri, 2 Aug
 2024 03:10:27 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285%3]) with mapi id 15.20.7828.021; Fri, 2 Aug 2024
 03:10:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c697b911-507c-11ef-bc03-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Sin2slZgl7la9FUYFy/2478H5PKVZduxmSTJXGF1qbVF9eMhUIlTePWo/LRxfmrbGFOMB7YohqHRr9N127VZvCIyp1jBLnIGQCTmnNZTVvOGMHRkSyW+8cNcbqK0vNCqde27JC8VgM1jGtV3svh6eLUppBIG5joqRll7/iC/HBtaoD1o6bxg4RX4E9hDVninlEqBImXD8yFxhu5S1JmrISHt7nVVZs6atldj0/VP5quPui9CujMZyYD/DUwushoB4dceDSRGbBKcjyqoTCEd80f3fy/UPjQ/8wlsTTRD+4B16c2QpmWxPXRggcFvTBRBIRuJ3+7YT48aUcDUt++A9w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=pqel10zEWLS7z0A5ZepGsKakczPNFeoQZAGotMe0GLo=;
 b=u/irJNnmwOK8wrq5Cb2F9qr1yJ3BipWUyRLmAml8CCmQMBqLRtKAarnrea6gFWrAfBsADPxsGsAdOESgrEhv9TKWsXmt+ljVZUQlJB1BTS6OmQZQxU2JYSOUZ5a4BuZNDWM9zFwxgb2khv9h4XeIkdmGxVfC5as553Cm2FLb45nKzORr/dGnxsehGRxgdIIs8ZXCb5GK92qFfysX2u2sNF+XVNXjwnXUQ15hEy0hIQjibG6AFY21xsHZyop9w710p8fSN1g9ZTT+tB/Pni14ZfGrawx6NJBHEde4c6ofH2xK/Sz5oUepUwse6Cd6i+VBnKMyZ1zRGceEY7wQ01H2lw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=pqel10zEWLS7z0A5ZepGsKakczPNFeoQZAGotMe0GLo=;
 b=YQE0ff5AohgiVFpjagHlmXFr1dQbUkRR/xajwFwlLDDgen6GAN2v+Z19+irFAzc3X94qpSvZjdTSXQ8qKomBY4gt10qGkg5uKk2HIxjqZs6RJqdBxBDHZ+WTbQviazoA3kJaDBzNZqVsw5vrgG7QP6zFYxGsLhtvNGqX/9s67to=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Jan
 Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, Wei
 Liu <wl@xen.org>, George Dunlap <gwd@xenproject.org>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD
	<anthony@xenproject.org>, Juergen Gross <jgross@suse.com>, "Daniel P . Smith"
	<dpsmith@apertussolutions.com>, "Hildebrand, Stewart"
	<Stewart.Hildebrand@amd.com>, "Huang, Ray" <Ray.Huang@amd.com>, "Chen,
 Jiqian" <Jiqian.Chen@amd.com>
Subject: Re: [XEN PATCH v12 4/7] x86/domctl: Add hypercall to set the access
 of x86 gsi
Thread-Topic: [XEN PATCH v12 4/7] x86/domctl: Add hypercall to set the access
 of x86 gsi
Thread-Index: AQHa0SvYL4tONjoIyEuzfSK6fk2TK7ISY3CAgAGQQYA=
Date: Fri, 2 Aug 2024 03:10:27 +0000
Message-ID:
 <BL1PR12MB58490598FF7FEAE291DCDAABE7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-5-Jiqian.Chen@amd.com> <ZqtsQwZNyFzflDQt@macbook>
In-Reply-To: <ZqtsQwZNyFzflDQt@macbook>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: BL1PR12MB5849.namprd12.prod.outlook.com
 (15.20.7828.000)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|SN7PR12MB8026:EE_
x-ms-office365-filtering-correlation-id: a7143719-a158-4481-e77f-08dcb2a0a8b8
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|1800799024|376014|7416014|38070700018;
x-microsoft-antispam-message-info:
 =?utf-8?B?eVV0MlhZY2JMM2NPSlNmbnJMVXMyZE9Ub1Fra2UzaXJLNWI4TStOODdsZWZJ?=
 =?utf-8?B?TXdpaklYcWxHdEpoaEdNYUFyRlg0VmhpcUF6alFWME5qMndVYTNDSkpUTVNp?=
 =?utf-8?B?ZHV0OVNNeXplb0I3YVFzWlNIMlNnOE1vT0RNL1BISEF6bFltT1VMNTluVXVm?=
 =?utf-8?B?b2x4b2duR3JmL1VicXVIUzVkQThiK2lqOWlJTUdjdkxqNk1sVHowRWRWM1hw?=
 =?utf-8?B?V0VvTURkMmxuaDE5NlBqWmlBMXlib0VYY2owZjVJQlBLMkhNaEVVd0lmVzFy?=
 =?utf-8?B?TFJidk0wS1BBb0ljRWs4TzV6ajJGWUpoV1VMRnNRdWJmelNiajYyY1ZldENL?=
 =?utf-8?B?MW9mV2ZEWnhsSWExSFBaTUpDNzlNMVJKck1JSjk3K1h5cE1Md29EY3BjZGNH?=
 =?utf-8?B?TFVlOUE1ZlhXZTRCQmNqeG9ncWgyVkNTcDIwR25OS0wrczVxUVFqZENFbHhx?=
 =?utf-8?B?dzFyM2p1L2dhUTFDcGIxVWhBSDJCaUd1Tm5SYVFCenp4dTA5QkJMNThxaFMz?=
 =?utf-8?B?cFhBZlN2MnhRK2I0YXlTYjdvUUxOZ3FMNFJlTThoUHBoWU95SUNJdG15a041?=
 =?utf-8?B?SFBINGptTXNqZkRZRDVLNmxkUThuVlJzRTNXeVpzQzVHbXhkNEZxMkhGNksx?=
 =?utf-8?B?RXY5aWZIYkVYUHF5Um5RSHVwdEZtMFpIWWRIOHROZHhldFpOOEVHcHcwdjY0?=
 =?utf-8?B?a1VpQnRNNjJxNkdWNmc1TWtBRWhpWnh4T1JJMUd5UXk0UzlMQXVHMGprTEhB?=
 =?utf-8?B?a09pSWZ2VkpTdnE5cndCMlZac280bTZNTEJZb0JJTVhWc3QrV05BNnJ5YkJp?=
 =?utf-8?B?MDNGd1Bud3lNWFpVUXFNUkpxRkdOV0tKaGx2ZVdPOUVmd1hEWWhRUUxISk94?=
 =?utf-8?B?YXhGcmRWZTY3OVVvekFDN3lmOGtNUTVjRHBsRGU2cVl4dURzbkhRcnRCcGtM?=
 =?utf-8?B?cnYzU1hNZHYzMVNzK05Eb1dNVFF0U2FRbzVJWFdwTkJadGNnWHlqdnNkS2xF?=
 =?utf-8?B?UTB5V3pXOHRQeXpJOG42b3IzeFBVbkJWQmdOL3ZRNW9QSEQ5VXJrc2ZpUzVY?=
 =?utf-8?B?N2g1THdQYStzNUpPVWw1Smo4T2Z5cTMxM05SQ2pqS3NzU0R4SEVnMStzWW05?=
 =?utf-8?B?VUYwSFZMNGNTa0xZQ3JRT2RqVXVoTjJSWWwzeXdpNVVqOEdFcHovRjVHd2FZ?=
 =?utf-8?B?MnRmenA5cm45K0h1VmZOek9uQ2R6a0NsOE9MK2taQllWK0w1ZUtyclpHOUhm?=
 =?utf-8?B?R3NrcHR1aFJralJvTWVoTEh5VDFmNk5OWHR6VzhiUWNCOUNhV1ZYS3ltY2Nz?=
 =?utf-8?B?d3lLbHNhWHNBOGVOMEdybm5lR3pNS0tYM2lEaUw0TWJZUkZkZzJ6SFFxcnRQ?=
 =?utf-8?B?VmJveWFvYXdGUHdXdmlqN1hHcC9aYUNpN212SlpHNi8xR2VaUkUvNFJKdlkz?=
 =?utf-8?B?ZjJtL2ZadXZFVmZEU0FQZkNSM1JmTzJUWndZVXJ1cWtCVVJxekZRbStqQnRt?=
 =?utf-8?B?MXh6S1ZFaXRhblFsUm5XK1JGUERhMG5lYXVTeVZvUFF3Tnd0VmVXQWlMMUxN?=
 =?utf-8?B?TmVQNkEzYVloNnA3OEtGR0lpd2traDY0blJ3UUdmTWZrT3BTd2gzNjdpMmRZ?=
 =?utf-8?B?cjRBbGZNMTdKTFRFZ2FNemdpRVgzQm8vcU4zUnQ0Z3FLcXA5NndWc29aYmo4?=
 =?utf-8?B?bngrQk51SjIvdmhXK3NleDlXeXNoTFptTmF1SlFaQXN3eEhoL1lMSlhXU3JO?=
 =?utf-8?B?NWp3L1czc2hoT01OYWQ1UzFqTFlobXlKbjJacnlHUnlvUktmNC9rc0hsbVdF?=
 =?utf-8?B?MFQrZUE4OVU0WHBrbUVIR1JRREhaWFB0eHJ1bEFGVEZ0am5LYUV1bjlWVnRR?=
 =?utf-8?B?ajZrZlJFQmwyQUJQVGNNTXlDbEVCK0VHZVJBQURiZVZIeXc9PQ==?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?RE1IeGZCQ2Z4bHJvV3NqOUFQc3c1bklSQzdzeVVIT1JSbm54WWxpTTh2WWF6?=
 =?utf-8?B?SDl0Q25GS0swZGg0OVdXZVQrL2owdmFCdnZmbURFWXNTMEtjeXBrWTZuMEkw?=
 =?utf-8?B?ZFdadzlaTkFCUFAzV1pyblBaakpiNUZOMnk1UUFqT0s3SkNhTWRrQ0hLckNZ?=
 =?utf-8?B?VlVBUko4OEFBRWhWZU55L2tWTVFxVGhZb1dpOHo3Zmt3ZjArUWlpVDBSN2ZQ?=
 =?utf-8?B?VEJxMDVxcmtDTnZTZkQ2REh3b3hsMGphemJHMjIySHFqSUtaZVliMnJVYjNh?=
 =?utf-8?B?U3l3OWlNUUNSbWd1Slg2Qk5wSkQ3RnZuM1psbk1PbnMwYnU0ZmgwNXlUaGpB?=
 =?utf-8?B?eHZRZzVPMk1qY29PMXRodEpUWmZYSk9BVnU4b0dPVStYcEFpdGVtZi85c3Y1?=
 =?utf-8?B?bXZHSHh4Ri83MWFwY25YeTZZUUhodHY4bVR3UWtXSk9lem0wSlhDOHRtQkJs?=
 =?utf-8?B?NThUWVlEd3hVNW1USnhwV3pMbEM0S2JxcUdTbWcrOFZER2wrdm11ZTdSQnhn?=
 =?utf-8?B?akE1SzJyL1BBVjE0RXhEOXNiN2NrN2hSVktWRUhkeTN4TFdNQzk4dytzaTlX?=
 =?utf-8?B?Y3NXY3lFZ1poaXFQSWpFS3JhdFM2SVVqMDRFcS9xL0wxbGQwQnVzWHBPRlp5?=
 =?utf-8?B?WVNkNHBUU21SVm1JQ0NXcDN6NHQ0cG5KV3k5c1dhUUdGd2ZxckJSa2NQam0w?=
 =?utf-8?B?ajk1djlROVBTMnk3bGpmaU9QQ0Y5MDhhMjgrMVUvdHNBaDd4WVprdm9adm9J?=
 =?utf-8?B?VUpQcGZ0MENDbzZTMlZnekcwTVk5NE1VbGNKbzM3RktWY2lEdTc4Z3dtNVVX?=
 =?utf-8?B?ampBbk9jWjcyMmpBOGxsdlhFNVNQMXZYN2dNL1NEY2lmUUR1WnRtWWNEd0V6?=
 =?utf-8?B?VnJKSmNvUTNHRGpZSUFOTUV5SFQ3dzZIMEw1cFVIRFMvRkJTUGpadVRIcEs2?=
 =?utf-8?B?bWFjZ3FiVlZQZW02SWRyQzdZc0tNVzRjdkFCRWVXZ2xBdjBwSzUwdGJnNHlF?=
 =?utf-8?B?aVZUM3gyQ0dYREprT3VKR0dxaFVCbDgwOHE0Z2hjbW1WWHFMWWNla3hoS2Ey?=
 =?utf-8?B?eThMb0hXZlAzeTRwK0NPL0VqNVdHb05CcTg4Q044Zmx5d0tNSE9taDloZmp4?=
 =?utf-8?B?aU4zZlRSTnhwdHpCMkVkVEc3TkY1eCs1QjkwTktNWkEzcitHZ1JzUFdRK2wv?=
 =?utf-8?B?aVpnNFRlUkI2QlJSM1pUNkxMS0lqeDdXbS9EZWtRUkh6V2svR29YbmdGSEtM?=
 =?utf-8?B?WEFZUmViT3VrNWZ1MFhaeldtMUVMb0NVNllqQ0VIMTZPOTMza3NzVHpPWlNX?=
 =?utf-8?B?YXQxREk1eHVFbGJyeHpSVWRBZ3dMMWl5ZUs1eWZMOEt3WjA2RWF1bmh4NDRo?=
 =?utf-8?B?cTNPQktiUjRrdS9yV0RRbUszTElUbEZnZ0JlOEdXdHNIdm50elRDK1d4cGFm?=
 =?utf-8?B?YTZhRFRLa09ybUJJcmtrTDhjb2Q0N0dJakpnVll5eDc2UGZLcGN4ZlhwUGN5?=
 =?utf-8?B?QlNWNzd4N2pMK1hsWG03TkZtazJMZEtNRVUzRzhZcnZ0NkZDMzhuUGJ3cnNl?=
 =?utf-8?B?MldUaVJaNnlmRXZkWUVKdWtsYnFVbXhsbTExbGx2VDh2bC9oR0wxVld4QVUr?=
 =?utf-8?B?RTRCdlI4RjNVVjUycURpVXQ5NEVxTWJ2N0dJaGVQYjc5YmJkRlJoeGJwTEsv?=
 =?utf-8?B?VUVBaFJ4RUorRlh4WXV6cDFDdGVVMmpKdWp5TnlmdUlXS0c3QWxITTVKV29S?=
 =?utf-8?B?UXVuTi9NeE1OSW55dWFrRzF1a3NaRFkwR1N2TDd6bW4yMCtFMkhTMnNVNk5N?=
 =?utf-8?B?Z0NnSXdwL2RKZ3RsV3doN3VQdjBuQnZMSEJyNlpJNlMxamJERnNTMlh2eThn?=
 =?utf-8?B?UGJhdy9MVjcvZXRiQmVkN1pYOWM0eVFJbWJNM2lPdVNMTlFobUw3b2VEVkFG?=
 =?utf-8?B?WWFVN3VIWmozSTc5dnhkT2xscWN5L2J0MXRXQlU4L3kreUwyaklCbTJrelN0?=
 =?utf-8?B?TzZqc3hMUm1KMnBJcG1IMjhPVFVab3BzSUlLMlBnc0NTWXpKTE15ZGFtVUVD?=
 =?utf-8?B?TVhjSnllSjRoaE12U1VuZkMxeXVnRHJGNVJPNXAveG1Wa1JKcFU4SlNtTFhx?=
 =?utf-8?Q?ACCo=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <4CD2F62FF1081E4C8B4A97ED33A484A4@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a7143719-a158-4481-e77f-08dcb2a0a8b8
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2024 03:10:27.4945
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: /ueSGrqksabpEAODNrAngCUcLdZ/KJVZcFo6uKtQUCesb2jnX7IoNC213WUJCOGuRWFe82iiDiLkcslJp2xUUw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8026

T24gMjAyNC84LzEgMTk6MDYsIFJvZ2VyIFBhdSBNb25uw6kgd3JvdGU6DQo+IE9uIE1vbiwgSnVs
IDA4LCAyMDI0IGF0IDA3OjQxOjIxUE0gKzA4MDAsIEppcWlhbiBDaGVuIHdyb3RlOg0KPj4gU29t
ZSB0eXBlIG9mIGRvbWFpbnMgZG9uJ3QgaGF2ZSBQSVJRcywgbGlrZSBQVkgsIGl0IGRvZXNuJ3Qg
ZG8NCj4+IFBIWVNERVZPUF9tYXBfcGlycSBmb3IgZWFjaCBnc2kuIFdoZW4gcGFzc3Rocm91Z2gg
YSBkZXZpY2UNCj4+IHRvIGd1ZXN0IGJhc2Ugb24gUFZIIGRvbTAsIGNhbGxzdGFjaw0KPj4gcGNp
X2FkZF9kbV9kb25lLT5YRU5fRE9NQ1RMX2lycV9wZXJtaXNzaW9uIHdpbGwgZmFpbCBhdCBmdW5j
dGlvbg0KPj4gZG9tYWluX3BpcnFfdG9faXJxLCBiZWNhdXNlIFBWSCBoYXMgbm8gbWFwcGluZyBv
ZiBnc2ksIHBpcnEgYW5kDQo+PiBpcnEgb24gWGVuIHNpZGUuDQo+PiBXaGF0J3MgbW9yZSwgY3Vy
cmVudCBoeXBlcmNhbGwgWEVOX0RPTUNUTF9pcnFfcGVybWlzc2lvbiByZXF1aXJlcw0KPj4gcGFz
c2luZyBpbiBwaXJxIHRvIHNldCB0aGUgYWNjZXNzIG9mIGlycSwgaXQgaXMgbm90IHN1aXRhYmxl
IGZvcg0KPj4gZG9tMCB0aGF0IGRvZXNuJ3QgaGF2ZSBQSVJRcy4NCj4+DQo+PiBTbywgYWRkIGEg
bmV3IGh5cGVyY2FsbCBYRU5fRE9NQ1RMX2dzaV9wZXJtaXNzaW9uIHRvIGdyYW50L2RlbnkNCj4+
IHRoZSBwZXJtaXNzaW9uIG9mIGlycSh0cmFuc2xhdGUgZnJvbSB4ODYgZ3NpKSB0byBkdW1VIHdo
ZW4gZG9tMA0KPiAgICAgICAgICAgICAgICAgICAgICAgIF4gbWlzc2luZyBzcGFjZSwgYW5kIHMv
dHJhbnNsYXRlL3RyYW5zbGF0ZWQvDQo+IA0KPj4gaGFzIG5vIFBJUlFzLg0KPj4NCj4+IFNpZ25l
ZC1vZmYtYnk6IEppcWlhbiBDaGVuIDxKaXFpYW4uQ2hlbkBhbWQuY29tPg0KPj4gU2lnbmVkLW9m
Zi1ieTogSHVhbmcgUnVpIDxyYXkuaHVhbmdAYW1kLmNvbT4NCj4+IFNpZ25lZC1vZmYtYnk6IEpp
cWlhbiBDaGVuIDxKaXFpYW4uQ2hlbkBhbWQuY29tPg0KPj4gLS0tDQo+PiBDQzogRGFuaWVsIFAg
LiBTbWl0aCA8ZHBzbWl0aEBhcGVydHVzc29sdXRpb25zLmNvbT4NCj4+IFJlbWFpbmluZyBjb21t
ZW50IEBEYW5pZWwgUCAuIFNtaXRoOg0KPj4gKyAgICAgICAgcmV0ID0gLUVQRVJNOw0KPj4gKyAg
ICAgICAgaWYgKCAhaXJxX2FjY2Vzc19wZXJtaXR0ZWQoY3VycmQsIGlycSkgfHwNCj4+ICsgICAg
ICAgICAgICAgeHNtX2lycV9wZXJtaXNzaW9uKFhTTV9IT09LLCBkLCBpcnEsIGFjY2Vzc19mbGFn
KSApDQo+PiArICAgICAgICAgICAgZ290byBnc2lfcGVybWlzc2lvbl9vdXQ7DQo+PiBJcyBpdCBv
a2F5IHRvIGlzc3VlIHRoZSBYU00gY2hlY2sgdXNpbmcgdGhlIHRyYW5zbGF0ZWQgdmFsdWUsIA0K
Pj4gbm90IHRoZSBvbmUgdGhhdCB3YXMgb3JpZ2luYWxseSBwYXNzZWQgaW50byB0aGUgaHlwZXJj
YWxsPw0KPiANCj4gRldJVywgSSBkb24ndCBzZWUgdGhlIEdTSSAtPiBJUlEgdHJhbnNsYXRpb24g
bXVjaCBkaWZmZXJlbnQgZnJvbSB0aGUNCj4gcElSUSAtPiBJUlEgdHJhbnNsYXRpb24gZG9uZSBi
eSBwaXJxX2FjY2Vzc19wZXJtaXR0ZWQoKSwgd2hpY2ggaXMgYWxzbw0KPiBhaGVhZCBvZiB0aGUg
eHNtIGNoZWNrLg0KPiANCj4+IC0tLQ0KPj4gIHhlbi9hcmNoL3g4Ni9kb21jdGwuYyAgICAgICAg
ICAgICAgfCAzMiArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysNCj4+ICB4ZW4vYXJjaC94
ODYvaW5jbHVkZS9hc20vaW9fYXBpYy5oIHwgIDIgKysNCj4+ICB4ZW4vYXJjaC94ODYvaW9fYXBp
Yy5jICAgICAgICAgICAgIHwgMTcgKysrKysrKysrKysrKysrKw0KPj4gIHhlbi9hcmNoL3g4Ni9t
cHBhcnNlLmMgICAgICAgICAgICAgfCAgNSArKy0tLQ0KPj4gIHhlbi9pbmNsdWRlL3B1YmxpYy9k
b21jdGwuaCAgICAgICAgfCAgOSArKysrKysrKysNCj4+ICB4ZW4veHNtL2ZsYXNrL2hvb2tzLmMg
ICAgICAgICAgICAgIHwgIDEgKw0KPj4gIDYgZmlsZXMgY2hhbmdlZCwgNjMgaW5zZXJ0aW9ucygr
KSwgMyBkZWxldGlvbnMoLSkNCj4+DQo+PiBkaWZmIC0tZ2l0IGEveGVuL2FyY2gveDg2L2RvbWN0
bC5jIGIveGVuL2FyY2gveDg2L2RvbWN0bC5jDQo+PiBpbmRleCA5MTkwZTExZmFhYTMuLjRlOWU0
YzRjZmVkMyAxMDA2NDQNCj4+IC0tLSBhL3hlbi9hcmNoL3g4Ni9kb21jdGwuYw0KPj4gKysrIGIv
eGVuL2FyY2gveDg2L2RvbWN0bC5jDQo+PiBAQCAtMzYsNiArMzYsNyBAQA0KPj4gICNpbmNsdWRl
IDxhc20veHN0YXRlLmg+DQo+PiAgI2luY2x1ZGUgPGFzbS9wc3IuaD4NCj4+ICAjaW5jbHVkZSA8
YXNtL2NwdS1wb2xpY3kuaD4NCj4+ICsjaW5jbHVkZSA8YXNtL2lvX2FwaWMuaD4NCj4+ICANCj4+
ICBzdGF0aWMgaW50IHVwZGF0ZV9kb21haW5fY3B1X3BvbGljeShzdHJ1Y3QgZG9tYWluICpkLA0K
Pj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhlbl9kb21jdGxfY3B1X3Bv
bGljeV90ICp4ZHBjKQ0KPj4gQEAgLTIzNyw2ICsyMzgsMzcgQEAgbG9uZyBhcmNoX2RvX2RvbWN0
bCgNCj4+ICAgICAgICAgIGJyZWFrOw0KPj4gICAgICB9DQo+PiAgDQo+PiArICAgIGNhc2UgWEVO
X0RPTUNUTF9nc2lfcGVybWlzc2lvbjoNCj4+ICsgICAgew0KPj4gKyAgICAgICAgaW50IGlycTsN
Cj4+ICsgICAgICAgIHVuc2lnbmVkIGludCBnc2kgPSBkb21jdGwtPnUuZ3NpX3Blcm1pc3Npb24u
Z3NpOw0KPj4gKyAgICAgICAgdWludDhfdCBhY2Nlc3NfZmxhZyA9IGRvbWN0bC0+dS5nc2lfcGVy
bWlzc2lvbi5hY2Nlc3NfZmxhZzsNCj4+ICsNCj4+ICsgICAgICAgIC8qIENoZWNrIGFsbCBiaXRz
IGFuZCBwYWRzIGFyZSB6ZXJvIGV4Y2VwdCBsb3dlc3QgYml0ICovDQo+PiArICAgICAgICByZXQg
PSAtRUlOVkFMOw0KPj4gKyAgICAgICAgaWYgKCBhY2Nlc3NfZmxhZyAmICggflhFTl9ET01DVExf
R1NJX1BFUk1JU1NJT05fTUFTSyApICkNCj4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
XiB1bm5lZWRlZCBwYXJlbnRoZXNlcyBhbmQgc3BhY2VzLg0KPj4gKyAgICAgICAgICAgIGdvdG8g
Z3NpX3Blcm1pc3Npb25fb3V0Ow0KPj4gKyAgICAgICAgZm9yICggaSA9IDA7IGkgPCBBUlJBWV9T
SVpFKGRvbWN0bC0+dS5nc2lfcGVybWlzc2lvbi5wYWQpOyArK2kgKQ0KPj4gKyAgICAgICAgICAg
IGlmICggZG9tY3RsLT51LmdzaV9wZXJtaXNzaW9uLnBhZFtpXSApDQo+PiArICAgICAgICAgICAg
ICAgIGdvdG8gZ3NpX3Blcm1pc3Npb25fb3V0Ow0KPj4gKw0KPj4gKyAgICAgICAgaWYgKCBnc2kg
PiBoaWdoZXN0X2dzaSgpIHx8IChpcnEgPSBnc2lfMl9pcnEoZ3NpKSkgPD0gMCApDQo+IA0KPiBG
V0lXLCBJIHdvdWxkIHBsYWNlIHRoZSBnc2kgPiBoaWdoZXN0X2dzaSgpIGNoZWNrIGluc2lkZSBn
c2lfMl9pcnEoKS4NCj4gVGhlcmUncyBubyByZWFzb24gdG8gb3Blbi1jb2RlIGl0IGhlcmUsIGFu
ZCBpdCBjb3VsZCBoZWxwIG90aGVyDQo+IHVzZXJzIG9mIGdzaV8yX2lycSgpLiAgVGhlIGVycm9y
IGNvZGUgY291bGQgYWxzbyBiZSBFUkFOR0UgaGVyZQ0KPiBpbnN0ZWFkIG9mIEVJTlZBTCBJTU8u
DQo+IA0KPj4gKyAgICAgICAgICAgIGdvdG8gZ3NpX3Blcm1pc3Npb25fb3V0Ow0KPj4gKw0KPj4g
KyAgICAgICAgcmV0ID0gLUVQRVJNOw0KPj4gKyAgICAgICAgaWYgKCAhaXJxX2FjY2Vzc19wZXJt
aXR0ZWQoY3VycmQsIGlycSkgfHwNCj4+ICsgICAgICAgICAgICAgeHNtX2lycV9wZXJtaXNzaW9u
KFhTTV9IT09LLCBkLCBpcnEsIGFjY2Vzc19mbGFnKSApDQo+PiArICAgICAgICAgICAgZ290byBn
c2lfcGVybWlzc2lvbl9vdXQ7DQo+PiArDQo+PiArICAgICAgICBpZiAoIGFjY2Vzc19mbGFnICkN
Cj4+ICsgICAgICAgICAgICByZXQgPSBpcnFfcGVybWl0X2FjY2VzcyhkLCBpcnEpOw0KPj4gKyAg
ICAgICAgZWxzZQ0KPj4gKyAgICAgICAgICAgIHJldCA9IGlycV9kZW55X2FjY2VzcyhkLCBpcnEp
Ow0KPj4gKw0KPj4gKyAgICBnc2lfcGVybWlzc2lvbl9vdXQ6DQo+PiArICAgICAgICBicmVhazsN
Cj4gDQo+IFdoeSBkbyB5b3UgbmVlZCBhIGxhYmVsIHdoZW4gaXQganVzdCBjb250YWlucyBhIGJy
ZWFrPyAgSW5zdGVhZCBvZiB0aGUNCj4gZ290byBnc2lfcGVybWlzc2lvbl9vdXQganVzdCB1c2Ug
YnJlYWsgZGlyZWN0bHkuDQo+IA0KPj4gKyAgICB9DQo+PiArDQo+PiAgICAgIGNhc2UgWEVOX0RP
TUNUTF9nZXRwYWdlZnJhbWVpbmZvMzoNCj4+ICAgICAgew0KPj4gICAgICAgICAgdW5zaWduZWQg
aW50IG51bSA9IGRvbWN0bC0+dS5nZXRwYWdlZnJhbWVpbmZvMy5udW07DQo+PiBkaWZmIC0tZ2l0
IGEveGVuL2FyY2gveDg2L2luY2x1ZGUvYXNtL2lvX2FwaWMuaCBiL3hlbi9hcmNoL3g4Ni9pbmNs
dWRlL2FzbS9pb19hcGljLmgNCj4+IGluZGV4IDc4MjY4ZWE4ZjY2Ni4uN2U4NmQ4MzM3NzU4IDEw
MDY0NA0KPj4gLS0tIGEveGVuL2FyY2gveDg2L2luY2x1ZGUvYXNtL2lvX2FwaWMuaA0KPj4gKysr
IGIveGVuL2FyY2gveDg2L2luY2x1ZGUvYXNtL2lvX2FwaWMuaA0KPj4gQEAgLTIxMyw1ICsyMTMs
NyBAQCB1bnNpZ25lZCBoaWdoZXN0X2dzaSh2b2lkKTsNCj4+ICANCj4+ICBpbnQgaW9hcGljX2d1
ZXN0X3JlYWQoIHVuc2lnbmVkIGxvbmcgcGh5c2Jhc2UsIHVuc2lnbmVkIGludCByZWcsIHUzMiAq
cHZhbCk7DQo+PiAgaW50IGlvYXBpY19ndWVzdF93cml0ZSh1bnNpZ25lZCBsb25nIHBoeXNiYXNl
LCB1bnNpZ25lZCBpbnQgcmVnLCB1MzIgdmFsKTsNCj4+ICtpbnQgbXBfZmluZF9pb2FwaWMoaW50
IGdzaSk7DQo+PiAraW50IGdzaV8yX2lycShpbnQgZ3NpKTsNCj4+ICANCj4+ICAjZW5kaWYNCj4+
IGRpZmYgLS1naXQgYS94ZW4vYXJjaC94ODYvaW9fYXBpYy5jIGIveGVuL2FyY2gveDg2L2lvX2Fw
aWMuYw0KPj4gaW5kZXggZDJhMzEzYzRhYzcyLi41OTY4YzgwNTU2NzEgMTAwNjQ0DQo+PiAtLS0g
YS94ZW4vYXJjaC94ODYvaW9fYXBpYy5jDQo+PiArKysgYi94ZW4vYXJjaC94ODYvaW9fYXBpYy5j
DQo+PiBAQCAtOTU1LDYgKzk1NSwyMyBAQCBzdGF0aWMgaW50IHBpbl8yX2lycShpbnQgaWR4LCBp
bnQgYXBpYywgaW50IHBpbikNCj4+ICAgICAgcmV0dXJuIGlycTsNCj4+ICB9DQo+PiAgDQo+PiAr
aW50IGdzaV8yX2lycShpbnQgZ3NpKQ0KPiANCj4gdW5zaWduZWQgaW50IGZvciBnc2kuDQo+IA0K
Pj4gK3sNCj4+ICsgICAgaW50IGlvYXBpYywgcGluLCBpcnE7DQo+IA0KPiBwaW4gd291bGQgYmV0
dGVyIGJlIHVuc2lnbmVkIGludCBhbHNvLg0KPiANCj4+ICsNCj4+ICsgICAgaW9hcGljID0gbXBf
ZmluZF9pb2FwaWMoZ3NpKTsNCj4+ICsgICAgaWYgKCBpb2FwaWMgPCAwICkNCj4+ICsgICAgICAg
IHJldHVybiAtRUlOVkFMOw0KPj4gKw0KPj4gKyAgICBwaW4gPSBnc2kgLSBpb19hcGljX2dzaV9i
YXNlKGlvYXBpYyk7DQo+PiArDQo+PiArICAgIGlycSA9IGFwaWNfcGluXzJfZ3NpX2lycShpb2Fw
aWMsIHBpbik7DQo+PiArICAgIGlmICggaXJxIDw9IDAgKQ0KPj4gKyAgICAgICAgcmV0dXJuIC1F
SU5WQUw7DQo+PiArDQo+PiArICAgIHJldHVybiBpcnE7DQo+PiArfQ0KPj4gKw0KPj4gIHN0YXRp
YyBpbmxpbmUgaW50IElPX0FQSUNfaXJxX3RyaWdnZXIoaW50IGlycSkNCj4+ICB7DQo+PiAgICAg
IGludCBhcGljLCBpZHgsIHBpbjsNCj4+IGRpZmYgLS1naXQgYS94ZW4vYXJjaC94ODYvbXBwYXJz
ZS5jIGIveGVuL2FyY2gveDg2L21wcGFyc2UuYw0KPj4gaW5kZXggZDhjY2FiMjQ0OWM2Li43Nzg2
YTMzMzc3NjAgMTAwNjQ0DQo+PiAtLS0gYS94ZW4vYXJjaC94ODYvbXBwYXJzZS5jDQo+PiArKysg
Yi94ZW4vYXJjaC94ODYvbXBwYXJzZS5jDQo+PiBAQCAtODQxLDggKzg0MSw3IEBAIHN0YXRpYyBz
dHJ1Y3QgbXBfaW9hcGljX3JvdXRpbmcgew0KPj4gIH0gbXBfaW9hcGljX3JvdXRpbmdbTUFYX0lP
X0FQSUNTXTsNCj4+ICANCj4+ICANCj4+IC1zdGF0aWMgaW50IG1wX2ZpbmRfaW9hcGljICgNCj4+
IC0JaW50CQkJZ3NpKQ0KPj4gK2ludCBtcF9maW5kX2lvYXBpYyhpbnQgZ3NpKQ0KPiANCj4gSWYg
eW91IGFyZSBjaGFuZ2luZyB0aGlzLCB5b3UgbWlnaHQgYXMgd2VsbCBtYWtlIHRoZSBnc2kgcGFy
YW1ldGVyDQo+IHVuc2lnbmVkIGludC4NCg0KVGhhbmtzLCBJIHdpbGwgY2hhbmdlIGNvZGVzIGFj
Y29yZGluZyBhYm92ZSBjb21tZW50cyBpbiBuZXh0IHZlcnNpb24uDQoNCj4gDQo+PiAgew0KPj4g
IAl1bnNpZ25lZCBpbnQJCWk7DQo+PiAgDQo+PiBAQCAtOTE0LDcgKzkxMyw3IEBAIHZvaWQgX19p
bml0IG1wX3JlZ2lzdGVyX2lvYXBpYyAoDQo+PiAgCXJldHVybjsNCj4+ICB9DQo+PiAgDQo+PiAt
dW5zaWduZWQgX19pbml0IGhpZ2hlc3RfZ3NpKHZvaWQpDQo+PiArdW5zaWduZWQgaGlnaGVzdF9n
c2kodm9pZCkNCj4+ICB7DQo+PiAgCXVuc2lnbmVkIHgsIHJlcyA9IDA7DQo+PiAgCWZvciAoeCA9
IDA7IHggPCBucl9pb2FwaWNzOyB4KyspDQo+PiBkaWZmIC0tZ2l0IGEveGVuL2luY2x1ZGUvcHVi
bGljL2RvbWN0bC5oIGIveGVuL2luY2x1ZGUvcHVibGljL2RvbWN0bC5oDQo+PiBpbmRleCAyYTQ5
ZmU0NmNlMjUuLjg3N2UzNWFiMTM3NiAxMDA2NDQNCj4+IC0tLSBhL3hlbi9pbmNsdWRlL3B1Ymxp
Yy9kb21jdGwuaA0KPj4gKysrIGIveGVuL2luY2x1ZGUvcHVibGljL2RvbWN0bC5oDQo+PiBAQCAt
NDY0LDYgKzQ2NCwxMyBAQCBzdHJ1Y3QgeGVuX2RvbWN0bF9pcnFfcGVybWlzc2lvbiB7DQo+PiAg
ICAgIHVpbnQ4X3QgcGFkWzNdOw0KPj4gIH07DQo+PiAgDQo+PiArLyogWEVOX0RPTUNUTF9nc2lf
cGVybWlzc2lvbiAqLw0KPj4gK3N0cnVjdCB4ZW5fZG9tY3RsX2dzaV9wZXJtaXNzaW9uIHsNCj4+
ICsgICAgdWludDMyX3QgZ3NpOw0KPj4gKyNkZWZpbmUgWEVOX0RPTUNUTF9HU0lfUEVSTUlTU0lP
Tl9NQVNLIDENCj4gDQo+IElNTyB0aGlzIHdvdWxkIGJlIGJldHRlciBuYW1lZCBHUkFOVCBvciBz
aW1pbGFyLCBtYXliZSBzb21ldGhpbmcgbGlrZToNCj4gDQo+IC8qIExvdyBiaXQgdXNlZCB0byBz
aWduYWwgZ3JhbnQvcmV2b2tlIGFjdGlvbi4gKi8NCj4gI2RlZmluZSBYRU5fRE9NQ1RMX0dTSV9S
RVZPS0UgMA0KPiAjZGVmaW5lIFhFTl9ET01DVExfR1NJX0dSQU5UICAxDQo+IA0KPj4gKyAgICB1
aW50OF90IGFjY2Vzc19mbGFnOyAgICAvKiBmbGFnIHRvIHNwZWNpZnkgZW5hYmxlL2Rpc2FibGUg
b2YgeDg2IGdzaSBhY2Nlc3MgKi8NCj4+ICsgICAgdWludDhfdCBwYWRbM107DQo+IA0KPiBXZSBt
aWdodCBhcyB3ZWxsIGRlY2xhcmUgdGhlIGZsYWdzIGZpZWxkIGFzIHVpbnQzMl90IGFuZCBhdm9p
ZCB0aGUNCj4gcGFkZGluZyBmaWVsZC4NClNvLCBzaG91bGQgdGhpcyBzdHJ1Y3QgYmUgbGlrZSBi
ZWxvdz8gVGhlbiBJIGp1c3QgbmVlZCB0byBjaGVjayB3aGV0aGVyIGV2ZXJ5dGhpbmcgZXhjZXB0
IHRoZSBsb3dlc3QgYml0IGlzIDAuDQpzdHJ1Y3QgeGVuX2RvbWN0bF9nc2lfcGVybWlzc2lvbiB7
DQogICAgdWludDMyX3QgZ3NpOw0KLyogTG93ZXN0IGJpdCB1c2VkIHRvIHNpZ25hbCBncmFudC9y
ZXZva2UgYWN0aW9uLiAqLw0KI2RlZmluZSBYRU5fRE9NQ1RMX0dTSV9SRVZPS0UgMA0KI2RlZmlu
ZSBYRU5fRE9NQ1RMX0dTSV9HUkFOVCAgMQ0KI2RlZmluZSBYRU5fRE9NQ1RMX0dTSV9QRVJNSVNT
SU9OX01BU0sgMQ0KICAgIHVpbnQzMl90IGFjY2Vzc19mbGFnOyAgICAvKiBmbGFnIHRvIHNwZWNp
ZnkgZW5hYmxlL2Rpc2FibGUgb2YgeDg2IGdzaSBhY2Nlc3MgKi8NCn07DQoNCj4gDQo+IFRoYW5r
cywgUm9nZXIuDQoNCi0tIA0KQmVzdCByZWdhcmRzLA0KSmlxaWFuIENoZW4uDQo=


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 03:13:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 03:13:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770080.1180934 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZijR-0000R4-10; Fri, 02 Aug 2024 03:13:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770080.1180934; Fri, 02 Aug 2024 03:13:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZijQ-0000Qx-U9; Fri, 02 Aug 2024 03:13:28 +0000
Received: by outflank-mailman (input) for mailman id 770080;
 Fri, 02 Aug 2024 03:13: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=uPwv=PB=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1sZijQ-0000Qm-9r
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 03:13:28 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on20601.outbound.protection.outlook.com
 [2a01:111:f403:2415::601])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2f9c1c83-507d-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 05:13:27 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by SN7PR12MB8026.namprd12.prod.outlook.com (2603:10b6:806:34b::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Fri, 2 Aug
 2024 03:13:23 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285%3]) with mapi id 15.20.7828.021; Fri, 2 Aug 2024
 03:13:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2f9c1c83-507d-11ef-bc03-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=n2bgCVDAgg9HNpd5EKv5Je3sT5TnEe4oRg+EqKfi8NZXWQs2sC+LtjuyBIBVk9erWX0gVuRH2BG8bGPL1pnE/kHV9PcAuXsYBmJhZgdWY1uVyZn3B4ShNYKs2sTCy0GzTyy6wxw3jZ1n8NPhBHJiGX4ugKa5G0JWqBvP8OqgnBAfxRWqdC6ns8qWZ1jCwvtUbCnNH0Jdu1B8aycWOMEM6RkkKg30vAq4zBA8MvxCMfjEcOzO+QgwqIUdEf9IM11qr5P9UEL7p807EaC3TLhlKIHQC5TkY5pgRqhzz1IvqNsgjIfAUoclm1lDRsnt/+OGAcACe1YP5nk1CyTmrYT4qQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=jne1c/LYamYf3uMOAVOzbLaBG3g3ebmLok4WQEHYkB0=;
 b=QmKtgxg0GQtCeybW3zEKAAflbdt/TpmFltoI7Fz83pWsYW5OR86JDzhpkoh7xx3PborZaOXKdKbx/ZmHvBgSDZdGfq6KJT2S24c5gVQfBZv+fOIxsl8+4p3umkft8HOEFgZku/Wa0JlfCVpbA8+Uf3EdF8i3w1oaY1vH2T0OvFOP7YFCLbCxcSFbPUGfJel8fjIOflJPNmDgrNPUlQiHgHD8Xokkv63T4365gX0xPPdgzTGi8Ir6FtlsqYf75K/ioy+Q8F2KF/Wlr42JGuQJNjilc22bfTyG+o/jINoCKkVLWwMxmXUbyzQJGyiUA7eHsxMCpUosgOTCs+nYx5L9Rg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=jne1c/LYamYf3uMOAVOzbLaBG3g3ebmLok4WQEHYkB0=;
 b=uMcCUlKtDxhw1iLteT9levdE2THXtJnN7dxpjI97GIJyLWkW59e3b7fQmEyPT3QbfnGPNl+YuW/RKE1vnxPDgqXkV1KF/0F2/U07CefROqlGRNHDZke9iyhi3E/2CuAD57TjwpTRuOnD4n6kr84zBJlgprSb0zSn3QLYC/9HH1A=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Jan
 Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, Wei
 Liu <wl@xen.org>, George Dunlap <gwd@xenproject.org>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD
	<anthony@xenproject.org>, Juergen Gross <jgross@suse.com>, "Daniel P . Smith"
	<dpsmith@apertussolutions.com>, "Hildebrand, Stewart"
	<Stewart.Hildebrand@amd.com>, "Chen, Jiqian" <Jiqian.Chen@amd.com>, "Huang,
 Ray" <Ray.Huang@amd.com>
Subject: Re: [RFC XEN PATCH v12 6/7] tools: Add new function to get gsi from
 dev
Thread-Topic: [RFC XEN PATCH v12 6/7] tools: Add new function to get gsi from
 dev
Thread-Index: AQHa0Svedv1p7hOYckC70HcmNEElN7ISg4+AgAFzygA=
Date: Fri, 2 Aug 2024 03:13:23 +0000
Message-ID:
 <BL1PR12MB584985B5FE36F37141CF3EB3E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-7-Jiqian.Chen@amd.com> <ZquHNURGoADdCy6y@macbook>
In-Reply-To: <ZquHNURGoADdCy6y@macbook>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: BL1PR12MB5849.namprd12.prod.outlook.com
 (15.20.7828.000)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|SN7PR12MB8026:EE_
x-ms-office365-filtering-correlation-id: b8111c52-6ee2-413f-e866-08dcb2a111ae
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|1800799024|376014|7416014|38070700018;
x-microsoft-antispam-message-info:
 =?utf-8?B?ZGE0dWZIeE5yVjNOL0dveHo0L1hmTzBqMWgwM2RqZFMraWhYczFKajN4YlNv?=
 =?utf-8?B?emc1VnBERUc0VXQzR1dZU09zemswbHhKR0dVOUs4SG1uU0prM3VsZjFLR2FS?=
 =?utf-8?B?bXBtTjVjdXlLdDM0ejhBZkNhMUVNbUxBNzJPbjJoSUI2QUp5eUxnTEZLcURm?=
 =?utf-8?B?dDBiQk5hblByNTNiaFI0bHlZaTh2K1hGazVoUUE0L01KVmFjbnNsSG01Y25B?=
 =?utf-8?B?ZW85a1YrZmJiYllFcW1ZVEpHSERaVHdMeGFKS0VUTDdEUkxmclcweFJaVVcx?=
 =?utf-8?B?T1ZEQjIwVmhtVWpqQ2ZhNVRmMVVManh4NGdYcjNtUFRoYkVuVmhWcG5KUWVZ?=
 =?utf-8?B?a1UrNnV1ejVSTS9UYTJjcGR1VXNMOEd1aFVNZFp5eGlVRW1HdmtLZUI3WUw4?=
 =?utf-8?B?ZGRPY3BUMmZkVTYwRVdwRG1BN1dVR3RkV0lpYmJIMFFoZDJJUnlKaCtET1R1?=
 =?utf-8?B?amZBYlpVUURpRnZuemMrbExWL1FYZ0RjRGVUZkVIaS9Cd2l3V3dZcE0vbXIx?=
 =?utf-8?B?QTdqTFJieE0ranZwcjBrMllsUWN3Nk45SThUUmg4M0VHYVBTdmMrNWxtQnhW?=
 =?utf-8?B?OUV4dzZlSks5dFp0WWdzbCtwTTEydzVVZnRKRnB6QisrdXBhdmhIeWtFNENh?=
 =?utf-8?B?YlNqUVllcWYxNWhMa1pReEoyZldrY2N5cDZsNDlVUmpEdkdpdE9ZVHpGWDlu?=
 =?utf-8?B?d2VIUWFCZEY2NWlpS0FsajBVbG5iQkdFWm54UXl1UUJHOEt1SzBHa0R4cStP?=
 =?utf-8?B?ZTB2YTR1eG1RSVdXay9EOS8zQTdqei9MbUhOWWtyWjhoTUFaOVltb1lERUpx?=
 =?utf-8?B?RlN4cU9aTzR3SUlLRWo2RnF6ZjNKelJDc1ltZmg3cjc2bitpdUZKczMyNHJM?=
 =?utf-8?B?aXR3T2Q1ei9jT3NvR1doMk14WjBkWGtacitKUE4rRy9FR3YzNWZUL3dTUXRw?=
 =?utf-8?B?cG1qR3JraE80Y0NtVWNhV24zZFp0ckplWkN6Z3FOTG90UjJpU2lLblFzYzho?=
 =?utf-8?B?aWFTeVJTODJqaWZCUXlxTjZwQWFMVTl2VVZLbm9UeWMyaDVwVnY5ako1YU83?=
 =?utf-8?B?cDc0c3V6eStXbW5hNk0zUmhQbk1JeUp1Tk4wQm1BL0tEWmEvbDExYWpKT1pn?=
 =?utf-8?B?dHpOMkpoZVNSd1BwVzdrMzAzdnIyRXQyb3JveHZ2UlNJek8xUjNYNmJvbjFU?=
 =?utf-8?B?THZxUVJjZnNtbjZ6QzlmdUVOdDNyVWpsWjlnUDhqUjlJMzhRVzl0M3NPRkFD?=
 =?utf-8?B?cFlia2VKNUVZK1hUN1dJcnpSSWJyZ3VacVAyNVhUbEljU3FUemdneEtKeXZU?=
 =?utf-8?B?OFRLNFQ1aThGNFRiaU1pVWNIeC9zOC8wUGcxQVMrWmpYbWNqdFZFZDRnTFlS?=
 =?utf-8?B?VzMxK0xaWG5temN5UklscS8wTDVjR2drRGRCSVJLVmw5U0ZVQW5mZzFwb01W?=
 =?utf-8?B?UXEzMGI2cXBPQS9MaERRc2ViSHJrZVhKY28yV0swU052RWRlTWlEdGdiVk9o?=
 =?utf-8?B?T3FOMkpXMURyYUNZbUl4VTdMaG14SmZjdVhwdXFqcjJzY2hLZU8rZnhsc1BM?=
 =?utf-8?B?ZHFYWUV0TXlJRjVuQVRkKzBhUHFqQk4xVyswWHJ2Q3NSR3NCYWt4SkVLa0ps?=
 =?utf-8?B?TWJ5TS9TTmlTWW1YbXlnRUVLeHB1ZGluRFc5dkxzQ1p4THBPdzRtRjFHcURq?=
 =?utf-8?B?TEhDNHZwRVJYT2tPSTRLZjBDSnNZOHhWbGJPYVhNNW1Kc2IvMWN1ZlVSaGJy?=
 =?utf-8?B?WlBCYWlQYjJXYnJXbThyR3liNWplU3hzZEd2dkpCb095TU1wdjhqaUpkd1Y1?=
 =?utf-8?Q?B4EVNxDUvfsS+shR9RW+u2jURliArXFLRHD18=3D?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?ZDNndXJmRFMzc3h6SmZHSTVjWHp0MUFFVXhRUzRxdkdpOWVyU3EvM2lsTjBP?=
 =?utf-8?B?TjN1Ym1UOTN0d2phZ0hzc2YwV05iS004TzlBazYrc0NrejRBTXZNaHpmR0F1?=
 =?utf-8?B?WndyUXBwS1h3SlRaa0FuMEtPKzErMWZnVGR1R1hXMHNBcFE3emNSUXNjQncv?=
 =?utf-8?B?Z1JFdTdKQTlmcU1mdEhEbGZRWXloRUF3elFpK1F0cXVSUXA1VUQ3cUlSbXBJ?=
 =?utf-8?B?Mjd0ZU9Bay9JM3pMOG93TkdEK3U4NmkvL29uazV0ODk2RzdIRUJSWlU3UzJw?=
 =?utf-8?B?MWpOcUs0anNrMEdkSE1MSnZwTkowTWUyaXNBekdvTTFkbllFanFsdkhkMk9q?=
 =?utf-8?B?MUVYWEVSbWRvSVVmS2pIcXNsWU5HbmlKQ1ladzd6TzFFMVd4VlFnYVBDZ1Ex?=
 =?utf-8?B?RlZlSmphSUI4b2duU0h3SzdlNzZ6RXFFU0pFR0xmVU45T0d0L2JZRXBVRWFh?=
 =?utf-8?B?d3U5UHdMbG5razJtaFMxa0djQTZvclVKSi84ZXJKZEN4YzN1UHpjZmZVb28w?=
 =?utf-8?B?bWpVVG1OdHdEeXFDY2JtbXprTWZPd05ORDRiWC84ZEpITnFYZDVNOHJUd3lu?=
 =?utf-8?B?ZENKcFhKZmR4YlJGZFBHTTVlREFpYlNlRkhISXMzbE9BeW1FWURaN3dFZDBI?=
 =?utf-8?B?L2lEY3drR0dhaFducnU0VFl6YTNIRnpRYnhqNElOSTdjR0k3bXpoS0pCczBT?=
 =?utf-8?B?UkFHN3pNZ3BmeTZQRTN6Z0ZHWDN1K3M1M1drNXhZWjhRREtKcWV6cjJ5OEVC?=
 =?utf-8?B?cC9FcEpKaUh2aHE4bWZ3TGk4VTNMQURJSDJqa1ROamhWSmRoNXZRd1MxYzhW?=
 =?utf-8?B?MnJ6eWdlaWJER1Vld2NtbXFUQmVLbzFWR0t1d0RBYXpUN1JhQlVhb09CUkd0?=
 =?utf-8?B?UU9CMnlsSUVDV1dXZ1ZlYlEzNXlxc2JRMmRpT2NlekhwUXA0N0MrT2c1QWdI?=
 =?utf-8?B?NUlzQmNqWnptSHhGQ0NlRGlLeDUrcHc5Nyt4bXRRVEFWUDI3bGVzazVUOVpO?=
 =?utf-8?B?VjkzNTZEWmlNZnF2L25VN3FNZ1I2UTBGcTdEWkYvNDdWR0U0Uzh6NHlyMDE5?=
 =?utf-8?B?c3IwbUpONlRnYktoa2tqR09IUUNqTFVpNW9XSkthTnQ2NitFRHFyaEhRcXcw?=
 =?utf-8?B?ZTJweVMxYXJ0L3c2VXhUL1lPL205OVZ1QUtvUmJpRjN5bEY4MHcwMnlBc0Js?=
 =?utf-8?B?V3hYVEpUbXNEVmx4NnRFUy9lWE43aXkwOE1vdnJqelNXS3h3dDFoMGdVQXVw?=
 =?utf-8?B?cEthSEk3QUZmd01IY0N4QUd4aUJIOVRCMkdhQW1mWld5Z0tHZ0h1UG95dUtM?=
 =?utf-8?B?cndhWXhaUTM0RnRiRndtVytjbVZUZ2xOVXdoVWxZZXVkdGx5d25nREZZamJz?=
 =?utf-8?B?VHpwREY2ak5pVUVFQ1l0aTZTdTQrYndkaXVORWdPbVMzVllKM3htR213TFpy?=
 =?utf-8?B?V2RSaVVEV0dHNk5kRDBzTDdCRkJPd2ExRHo3VXYyMlVYZi9tZkZkSS9jdVV0?=
 =?utf-8?B?TVgwMkYycmljSS9oL05BbHJZb2JPRnhGMlFaNXhUbEI1RFM5c0VvS0hibUZG?=
 =?utf-8?B?Zy9HZURUc0FvMjNnUW42c21IZkhGV2NKVGF0Q3B3YkV0bzBKc0lFU2lpeUV3?=
 =?utf-8?B?L2ZaWXhmR25Yb2JQdExSWVZiRmFLZHg3M3RNR2NqVW1IVHJFazR2bk9zejBU?=
 =?utf-8?B?WWZHTXJnblQ4RVBzRHJRdUZjczdTbEIvVEZHMUMrQTRzaCtHUDQ4eE9FbFZt?=
 =?utf-8?B?S2NVVjQxVDZZbHpHTE9RTTBZelh6ZzdVd0dvbjh4TTZtYit4SllBc1lDdG8z?=
 =?utf-8?B?dVhDQ3lHM0RHcy9xYm9IWXY2RGpmSkgwa1MxdTF1eDV1OHlMTklxc0E1TTYx?=
 =?utf-8?B?UHFRZUhuSkc0b2RrWlYzS1gxUDFkN2d2ZWErcFl4emdzMUh1MklRZmgzaHU1?=
 =?utf-8?B?L2dTVW90Z1ZLSlFLSXNtS1FERjZBbW8xb2hCOW1PY0p3WHQ0N0ZDeE1rZlEz?=
 =?utf-8?B?ZmNzc0pvU0ozNytmZ0VvYU9FSjBkVXU4ZEdBV0Q4WW52cmhOTVRqb1hweURC?=
 =?utf-8?B?Y3RaK1AyeSt6TGdKNDBFbXJVTmNLWXNpNlZZemdMOFJLWVloKzVCNy81SjE2?=
 =?utf-8?Q?TGUM=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <E2358FFA8B9B58498359C8DD2C2EC9B5@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: b8111c52-6ee2-413f-e866-08dcb2a111ae
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2024 03:13:23.5590
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: PET6+1WNmXTUEmdDVKF7tHLv1gr/TPeEQSI4ebctyEDeyCHgRUOeeL35sNorM2MSCO2BTs/ja88ZG034AZqiTw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8026

T24gMjAyNC84LzEgMjE6MDEsIFJvZ2VyIFBhdSBNb25uw6kgd3JvdGU6DQo+IE9uIE1vbiwgSnVs
IDA4LCAyMDI0IGF0IDA3OjQxOjIzUE0gKzA4MDAsIEppcWlhbiBDaGVuIHdyb3RlOg0KPj4gV2hl
biBwYXNzdGhyb3VnaCBhIGRldmljZSB0byBkb21VLCBRRU1VIGFuZCB4bCB0b29scyB1c2UgaXRz
IGdzaQ0KPj4gbnVtYmVyIHRvIGRvIHBpcnEgbWFwcGluZywgc2VlIFFFTVUgY29kZQ0KPj4geGVu
X3B0X3JlYWxpemUtPnhjX3BoeXNkZXZfbWFwX3BpcnEsIGFuZCB4bCBjb2RlDQo+PiBwY2lfYWRk
X2RtX2RvbmUtPnhjX3BoeXNkZXZfbWFwX3BpcnEsIGJ1dCB0aGUgZ3NpIG51bWJlciBpcyBnb3QN
Cj4+IGZyb20gZmlsZSAvc3lzL2J1cy9wY2kvZGV2aWNlcy88c2JkZj4vaXJxLCB0aGF0IGlzIHdy
b25nLCBiZWNhdXNlDQo+PiBpcnEgaXMgbm90IGVxdWFsIHdpdGggZ3NpLCB0aGV5IGFyZSBpbiBk
aWZmZXJlbnQgc3BhY2VzLCBzbyBwaXJxDQo+PiBtYXBwaW5nIGZhaWxzLg0KPj4NCj4+IEFuZCBp
biBjdXJyZW50IGNvZGVzLCB0aGVyZSBpcyBubyBtZXRob2QgdG8gZ2V0IGdzaSBmb3IgdXNlcnNw
YWNlLg0KPj4gRm9yIGFib3ZlIHB1cnBvc2UsIGFkZCBuZXcgZnVuY3Rpb24gdG8gZ2V0IGdzaSwg
YW5kIHRoZQ0KPj4gY29ycmVzcG9uZGluZyBpb2N0bCBpcyBpbXBsZW1lbnRlZCBvbiBsaW51eCBr
ZXJuZWwgc2lkZS4NCj4+DQo+PiBTaWduZWQtb2ZmLWJ5OiBKaXFpYW4gQ2hlbiA8SmlxaWFuLkNo
ZW5AYW1kLmNvbT4NCj4+IFNpZ25lZC1vZmYtYnk6IEh1YW5nIFJ1aSA8cmF5Lmh1YW5nQGFtZC5j
b20+DQo+PiBTaWduZWQtb2ZmLWJ5OiBDaGVuIEppcWlhbiA8SmlxaWFuLkNoZW5AYW1kLmNvbT4N
Cj4+IC0tLQ0KPj4gUkZDOiBpdCBuZWVkcyB0byB3YWl0IGZvciB0aGUgY29ycmVzcG9uZGluZyB0
aGlyZCBwYXRjaCBvbiBsaW51eCBrZXJuZWwgc2lkZSB0byBiZSBtZXJnZWQuDQo+PiBodHRwczov
L2xvcmUua2VybmVsLm9yZy94ZW4tZGV2ZWwvMjAyNDA2MDcwNzUxMDkuMTI2Mjc3LTQtSmlxaWFu
LkNoZW5AYW1kLmNvbS8NCj4+IFRoaXMgcGF0Y2ggbXVzdCBiZSBtZXJnZWQgYWZ0ZXIgdGhlIHBh
dGNoIG9uIGxpbnV4IGtlcm5lbCBzaWRlDQo+Pg0KPj4gQ0M6IEFudGhvbnkgUEVSQVJEIDxhbnRo
b255QHhlbnByb2plY3Qub3JnPg0KPj4gUmVtYWluaW5nIGNvbW1lbnQgQEFudGhvbnkgUEVSQVJE
Og0KPj4gRG8gSSBuZWVkIHRvIG1ha2UgIiBvcGVuaW5nIG9mIC9kZXYveGVuL3ByaXZjbWQgIiBh
cyBhIHNpbmdsZSBmdW5jdGlvbiwgdGhlbiB1c2UgaXQgaW4gdGhpcw0KPj4gcGF0Y2ggYW5kIG90
aGVyIGxpYnJhcmllcz8NCj4+IC0tLQ0KPj4gIHRvb2xzL2luY2x1ZGUveGVuLXN5cy9MaW51eC9w
cml2Y21kLmggfCAgNyArKysrKysNCj4+ICB0b29scy9pbmNsdWRlL3hlbmN0cmwuaCAgICAgICAg
ICAgICAgIHwgIDIgKysNCj4+ICB0b29scy9saWJzL2N0cmwveGNfcGh5c2Rldi5jICAgICAgICAg
IHwgMzUgKysrKysrKysrKysrKysrKysrKysrKysrKysrDQo+PiAgMyBmaWxlcyBjaGFuZ2VkLCA0
NCBpbnNlcnRpb25zKCspDQo+Pg0KPj4gZGlmZiAtLWdpdCBhL3Rvb2xzL2luY2x1ZGUveGVuLXN5
cy9MaW51eC9wcml2Y21kLmggYi90b29scy9pbmNsdWRlL3hlbi1zeXMvTGludXgvcHJpdmNtZC5o
DQo+PiBpbmRleCBiYzYwZThmZDU1ZWIuLjRjZjcxOTEwMjExNiAxMDA2NDQNCj4+IC0tLSBhL3Rv
b2xzL2luY2x1ZGUveGVuLXN5cy9MaW51eC9wcml2Y21kLmgNCj4+ICsrKyBiL3Rvb2xzL2luY2x1
ZGUveGVuLXN5cy9MaW51eC9wcml2Y21kLmgNCj4+IEBAIC05NSw2ICs5NSwxMSBAQCB0eXBlZGVm
IHN0cnVjdCBwcml2Y21kX21tYXBfcmVzb3VyY2Ugew0KPj4gIAlfX3U2NCBhZGRyOw0KPj4gIH0g
cHJpdmNtZF9tbWFwX3Jlc291cmNlX3Q7DQo+PiAgDQo+PiArdHlwZWRlZiBzdHJ1Y3QgcHJpdmNt
ZF9nc2lfZnJvbV9wY2lkZXYgew0KPj4gKwlfX3UzMiBzYmRmOw0KPj4gKwlfX3UzMiBnc2k7DQo+
PiArfSBwcml2Y21kX2dzaV9mcm9tX3BjaWRldl90Ow0KPj4gKw0KPj4gIC8qDQo+PiAgICogQGNt
ZDogSU9DVExfUFJJVkNNRF9IWVBFUkNBTEwNCj4+ICAgKiBAYXJnOiAmcHJpdmNtZF9oeXBlcmNh
bGxfdA0KPj4gQEAgLTExNCw2ICsxMTksOCBAQCB0eXBlZGVmIHN0cnVjdCBwcml2Y21kX21tYXBf
cmVzb3VyY2Ugew0KPj4gIAlfSU9DKF9JT0NfTk9ORSwgJ1AnLCA2LCBzaXplb2YoZG9taWRfdCkp
DQo+PiAgI2RlZmluZSBJT0NUTF9QUklWQ01EX01NQVBfUkVTT1VSQ0UJCQkJXA0KPj4gIAlfSU9D
KF9JT0NfTk9ORSwgJ1AnLCA3LCBzaXplb2YocHJpdmNtZF9tbWFwX3Jlc291cmNlX3QpKQ0KPj4g
KyNkZWZpbmUgSU9DVExfUFJJVkNNRF9HU0lfRlJPTV9QQ0lERVYJCQkJXA0KPj4gKwlfSU9DKF9J
T0NfTk9ORSwgJ1AnLCAxMCwgc2l6ZW9mKHByaXZjbWRfZ3NpX2Zyb21fcGNpZGV2X3QpKQ0KPj4g
ICNkZWZpbmUgSU9DVExfUFJJVkNNRF9VTklNUExFTUVOVEVECQkJCVwNCj4+ICAJX0lPQyhfSU9D
X05PTkUsICdQJywgMHhGRiwgMCkNCj4+ICANCj4+IGRpZmYgLS1naXQgYS90b29scy9pbmNsdWRl
L3hlbmN0cmwuaCBiL3Rvb2xzL2luY2x1ZGUveGVuY3RybC5oDQo+PiBpbmRleCA5Y2VjYTBjZmZj
MmYuLjM3MjBlMjJiMzk5YSAxMDA2NDQNCj4+IC0tLSBhL3Rvb2xzL2luY2x1ZGUveGVuY3RybC5o
DQo+PiArKysgYi90b29scy9pbmNsdWRlL3hlbmN0cmwuaA0KPj4gQEAgLTE2NDEsNiArMTY0MSw4
IEBAIGludCB4Y19waHlzZGV2X3VubWFwX3BpcnEoeGNfaW50ZXJmYWNlICp4Y2gsDQo+PiAgICAg
ICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBkb21pZCwNCj4+ICAgICAgICAgICAgICAg
ICAgICAgICAgICAgIGludCBwaXJxKTsNCj4+ICANCj4+ICtpbnQgeGNfcGh5c2Rldl9nc2lfZnJv
bV9wY2lkZXYoeGNfaW50ZXJmYWNlICp4Y2gsIHVpbnQzMl90IHNiZGYpOw0KPj4gKw0KPj4gIC8q
DQo+PiAgICogIExPR0dJTkcgQU5EIEVSUk9SIFJFUE9SVElORw0KPj4gICAqLw0KPj4gZGlmZiAt
LWdpdCBhL3Rvb2xzL2xpYnMvY3RybC94Y19waHlzZGV2LmMgYi90b29scy9saWJzL2N0cmwveGNf
cGh5c2Rldi5jDQo+PiBpbmRleCBlOWZjZDc1NWZhNjIuLjU0ZWRiMGYzYzBkYyAxMDA2NDQNCj4+
IC0tLSBhL3Rvb2xzL2xpYnMvY3RybC94Y19waHlzZGV2LmMNCj4+ICsrKyBiL3Rvb2xzL2xpYnMv
Y3RybC94Y19waHlzZGV2LmMNCj4+IEBAIC0xMTEsMyArMTExLDM4IEBAIGludCB4Y19waHlzZGV2
X3VubWFwX3BpcnEoeGNfaW50ZXJmYWNlICp4Y2gsDQo+PiAgICAgIHJldHVybiByYzsNCj4+ICB9
DQo+PiAgDQo+PiAraW50IHhjX3BoeXNkZXZfZ3NpX2Zyb21fcGNpZGV2KHhjX2ludGVyZmFjZSAq
eGNoLCB1aW50MzJfdCBzYmRmKQ0KPiANCj4gRldJVywgSSdtIG5vdCBzdXJlIGl0J3MgZmluZSB0
byB1c2UgdGhlIHhjX3BoeXNkZXYgcHJlZml4IGhlcmUsIGFzDQo+IHRoaXMgaXMgbm90IGEgUEhZ
U0RFVk9QIGh5cGVyY2FsbC4NCj4gDQo+IEFzIEFudGhvbnkgc3VnZ2VzdGVkLCBpdCB3b3VsZCBi
ZSBiZXR0ZXIgcGxhY2VkIGluIHhjX2xpbnV4LmMsIGFuZA0KPiBwb3NzaWJseSBuYW1lZCB4Y19w
Y2lkZXZfZ2V0X2dzaSgpIG9yIHNpbWlsYXIsIHRvIGF2b2lkIHBvbGx1dGluZyB0aGUNCj4geGNf
cGh5c2RldiBuYW1lc3BhY2UuDQpUaGFua3MsIHdpbGwgY2hhbmdlIGluIG5leHQgdmVyc2lvbi4N
Cg0KPiANCj4gVGhhbmtzLCBSb2dlci4NCg0KLS0gDQpCZXN0IHJlZ2FyZHMsDQpKaXFpYW4gQ2hl
bi4NCg==


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 03:56:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 03:56:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770100.1180984 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZjPD-0007HC-OS; Fri, 02 Aug 2024 03:56:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770100.1180984; Fri, 02 Aug 2024 03:56:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZjPD-0007H2-L2; Fri, 02 Aug 2024 03:56:39 +0000
Received: by outflank-mailman (input) for mailman id 770100;
 Fri, 02 Aug 2024 03:56:38 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZjPC-0007Gb-Lz; Fri, 02 Aug 2024 03:56:38 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZjPC-0002v6-KF; Fri, 02 Aug 2024 03:56:38 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZjPC-0004zr-52; Fri, 02 Aug 2024 03:56:38 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZjPC-0006W6-3t; Fri, 02 Aug 2024 03:56:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Y85RG1Rx9s81m7FRnhjCoFllTFlkhsu73nihzuLiJdg=; b=YfyC0mEqUnnWksI67BM+X8cyby
	C9vXwtl6FqcTbZnl4b7m7jOfWbi+TJ0m/Y0N544+/ewCkd8Eqo6qlOY/oXkmHBCqMTYz5kfwcrPy6
	vkC8CO84s5yOdl5u1NzL1SDkk+hFVpWRzLxUgvVLOB+r4SYtNDROC3gsdkgX0HafNqLc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187103-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187103: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=36f75d39b38d94a0d17119a4178c08de994ead23
X-Osstest-Versions-That:
    xen=6979e17b3f8a18d2ba5dbd4f0623c4061dae0dfc
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 02 Aug 2024 03:56:38 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 xen                  36f75d39b38d94a0d17119a4178c08de994ead23
baseline version:
 xen                  6979e17b3f8a18d2ba5dbd4f0623c4061dae0dfc

Last test of basis   187080  2024-07-31 13:04:32 Z    1 days
Testing same since   187103  2024-08-01 08:10:58 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alessandro Zucchelli <alessandro.zucchelli@bugseng.com>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Federico Serafini <federico.serafini@bugseng.com>
  Fouad Hilly <fouad.hilly@cloud.com>
  Jan Beulich <jbeulich@suse.com>
  Juergen Gross <jgross@suse.com>
  Julien Grall <jgrall@amazon.com>
  Maria Celeste Cesario  <maria.celeste.cesario@bugseng.com>
  Maria Celeste Cesario <maria.celeste.cesario@bugseng.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Roger Pau Monné <roger.pau@citrix.com>
  Simone Ballarin  <simone.ballarin@bugseng.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   6979e17b3f..36f75d39b3  36f75d39b38d94a0d17119a4178c08de994ead23 -> master


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 05:41:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 05:41:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.769949.1181050 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZl2P-0006VQ-Ka; Fri, 02 Aug 2024 05:41:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 769949.1181050; Fri, 02 Aug 2024 05:41:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZl2P-0006VJ-Ga; Fri, 02 Aug 2024 05:41:13 +0000
Received: by outflank-mailman (input) for mailman id 769949;
 Thu, 01 Aug 2024 19:17: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=jc0v=PA=gmail.com=adobriyan@srs-se1.protection.inumbo.net>)
 id 1sZbIM-0008Aq-72
 for xen-devel@lists.xenproject.org; Thu, 01 Aug 2024 19:17:02 +0000
Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com
 [2a00:1450:4864:20::634])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a06e5463-503a-11ef-bc02-fd08da9f4363;
 Thu, 01 Aug 2024 21:17:00 +0200 (CEST)
Received: by mail-ej1-x634.google.com with SMTP id
 a640c23a62f3a-a7ab5fc975dso671559066b.1
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 12:17:00 -0700 (PDT)
Received: from p183 ([46.53.253.212]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ecad25sm12474266b.221.2024.08.01.12.16.58
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 01 Aug 2024 12:16:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a06e5463-503a-11ef-bc02-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722539820; x=1723144620; darn=lists.xenproject.org;
        h=content-disposition:mime-version:message-id:subject:cc:to:from:date
         :from:to:cc:subject:date:message-id:reply-to;
        bh=2lJyLZbucIe5opdiO3kpiQWjoU7HWScAFHcY/FoPqQM=;
        b=WIw7PYVklet8dIh2ULbImhKmZ/dQx3kIq5QC+UgWEbEseyUceXYdUf0pew3A3eWjXW
         KQi8jyu31xB+jOQd1paC9/3pGNZEGstMfiPa1P+Fa53Th/fK5WOp+04hhfhJQc1Kqo0+
         8/pXhuXQy1PXRvmFL2xDPJi7pCec3ma1XoIYgTWsIbfnIBNya0raZUyOSQEXvErMLhbJ
         dlkiSpDRMMQaMcSNnmQbNUum6Cd7gcRzGJKVT79FOiKjjDezifVKZzeP+nMrwiicbyA5
         lEmOFMccJFXfJD/uYFLGLPnuaaEMY9lH+2/DjlQ5RAur2nN/bVNGxmOyKWce8cY0iSY0
         o7Ug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722539820; x=1723144620;
        h=content-disposition:mime-version:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=2lJyLZbucIe5opdiO3kpiQWjoU7HWScAFHcY/FoPqQM=;
        b=vy6dsenOJtiX6Vf9Gkb1KOHoC/GuEMO4zk2U4aOr/pbvgVYNo/c0n2WmjRvtfs46Sx
         1IViaMJr5IsTVD+g+VLlc8iRX/usbF68HrvR0Us4x66mpZeRqXOZBmLd6QiN5skDxsS3
         Ho+Y5l9vGHdKkpiYWlUH4PLIR3fi//TZ0/GaGzjdgj201Wy7uRdVc/vJQGoavlsRBjdT
         jCd0bXtitZrcyXoazOiqTaZdc5IxmzU7tNWJjCrfzkeho/dgkyl+FrjePny/mcgXhncL
         QYnUROXZP/3CgXGnmlKRnSeCSKMCCr8BIXxNWzwKvpsXLyvMu0pzQXmNczH5grGby2iq
         dOkQ==
X-Gm-Message-State: AOJu0YzbJz21xguJ4uypsnDArR2u5YfMPPWzCDn+zF+UYmpkSgkBh4g2
	NwEDEHj4Owt5JXoySUAlLRmyvkCUSiUKbOuEQ610/1azuDaTBcY=
X-Google-Smtp-Source: AGHT+IExQa6e27hKb7qI6K5zAXQAkD9NjlnCkP6LIDB8EFr35Vr02bglzhOFdAcC662NfTnh88Mv6g==
X-Received: by 2002:a17:907:7f94:b0:a7a:84f8:eaef with SMTP id a640c23a62f3a-a7dc4e8c3f0mr99005866b.35.1722539819259;
        Thu, 01 Aug 2024 12:16:59 -0700 (PDT)
Date: Thu, 1 Aug 2024 22:16:56 +0300
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] xen, pvh: fix unbootable VMs (PVH + KASAN)
Message-ID: <a9f505a6-fd31-4cfa-a193-d21638bb14f1@p183>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline

Uninstrument arch/x86/platform/pvh/enlighten.c: KASAN is not setup
_this_ early in the boot process.

Steps to reproduce:

	make allnoconfig
	make sure CONFIG_AMD_MEM_ENCRYPT is disabled
		AMD_MEM_ENCRYPT independently uninstruments lib/string.o
		so PVH boot code calls into uninstrumented memset() and
		memcmp() which can make the bug disappear depending on
		the compiler.
	enable CONFIG_PVH
	enable CONFIG_KASAN
	enable serial console
		this is fun exercise if you never done it from nothing :^)

	make

	qemu-system-x86_64	\
		-enable-kvm	\
		-cpu host	\
		-smp cpus=1	\
		-m 4096		\
		-serial stdio	\
		-kernel vmlinux \
		-append 'console=ttyS0 ignore_loglevel'

Messages on serial console will easily tell OK kernel from unbootable
kernel. In bad case qemu hangs in an infinite loop stroboscoping
"SeaBIOS" message.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 arch/x86/platform/pvh/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/platform/pvh/Makefile b/arch/x86/platform/pvh/Makefile
index 5dec5067c9fb..c43fb7964dc4 100644
--- a/arch/x86/platform/pvh/Makefile
+++ b/arch/x86/platform/pvh/Makefile
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 OBJECT_FILES_NON_STANDARD_head.o := y
+KASAN_SANITIZE := n
 
 obj-$(CONFIG_PVH) += enlighten.o
 obj-$(CONFIG_PVH) += head.o


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 05:44:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 05:44:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770136.1181059 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZl5M-00076T-06; Fri, 02 Aug 2024 05:44:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770136.1181059; Fri, 02 Aug 2024 05:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZl5L-00076M-Tl; Fri, 02 Aug 2024 05:44:15 +0000
Received: by outflank-mailman (input) for mailman id 770136;
 Fri, 02 Aug 2024 05:44:15 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=quvz=PB=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sZl5L-00076E-0w
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 05:44:15 +0000
Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com
 [2a00:1450:4864:20::336])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3f36eeec-5092-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 07:44:12 +0200 (CEST)
Received: by mail-wm1-x336.google.com with SMTP id
 5b1f17b1804b1-4281faefea9so39700205e9.2
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 22:44:12 -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-428e6e9cd14sm18773995e9.45.2024.08.01.22.44.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 22:44:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3f36eeec-5092-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722577452; x=1723182252; 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=/suS5E/THPwitL/0CNux/d6Wr8slSFy728FjLfghXwk=;
        b=C3oMOHHkgZN7bHbQhd36s2vA2bZ/4vds5ytA5i7aGt5oibXsyyP3TvhaXqJ7FZxrKw
         NmT0uTDraE1494heFM1pUWIokAjBQYyusDtw08/Ad/+r9HvBSrnT03tmBv6jwIKaxqzK
         7y0o6z1pzxj5KDL8gU4TVpghwD26Vj9GIZCzYpwgTow8V+oNxiPRmOq8hs9cfnoCGgGc
         CKJgkbLM0jycTzP8wpoH8bO6CxxYMOcH8n2dTTlucxHbBVCA7SWbCq5tlaBZ/9TCiyir
         NtkegIcOemYiewxKD9Q7wbyAvexPttr8XMok7/6F+tEv3Osoy3nQ8WGDlnDiI6+sEIjQ
         mxuQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722577452; x=1723182252;
        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=/suS5E/THPwitL/0CNux/d6Wr8slSFy728FjLfghXwk=;
        b=fBQ6BM56+TcEz3hGeapaMciP70SuLHUKUZ5EFt1+Xq7Ws/PKNL3ohEB8uq/y5L8bYF
         LV20mNKhuY3dcaERu0R5yaQR4+Ho6gma3aLCi2bM2UpiRASi9GwchgViThwDnQKhZxdZ
         y+FRWTu4AGJXX8IT65JG+SBy8wW3FmbtZ3KCiBwad02j9Lz6USv+/KIzcz1BpgEki06u
         Il7spKnCa6OC8/3z83S+/mtLqAaAmnW6m1MkgEmnZivQoDaE4y1fOxSvoGo2g0m3TV1D
         KPZblrrNR0MRIkc+UKpzuer5x4BLtEIslgF+csNVeDFJOEtY7Q4YVmt9xDBH+jkZNuUj
         lwWQ==
X-Gm-Message-State: AOJu0YyG2JjJgHinqvMm7BuGgsmEeyXhQCoWgVwM7MTQEG43t15KcK+7
	yg/OVlIqSOV8H5Cmi05er4cO6Ahc867RI56kMTGYCYKDWCl9K/LCmhfJdhIbMRo=
X-Google-Smtp-Source: AGHT+IEbwsdCFVcpSof1lHH3nO0h4oFeOaJ4dZlzRZY2FFW9Nakdpxej2wm/Gce4TH5H4U+e9jvGag==
X-Received: by 2002:a05:600c:4f92:b0:426:6e8b:3dc5 with SMTP id 5b1f17b1804b1-428e6b92636mr15226395e9.32.1722577452042;
        Thu, 01 Aug 2024 22:44:12 -0700 (PDT)
Message-ID: <242b327a-9244-411c-8d3e-7b860464f8f6@suse.com>
Date: Fri, 2 Aug 2024 07:44:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/3] xen, pvh: fix unbootable VMs (PVH + KASAN)
To: Alexey Dobriyan <adobriyan@gmail.com>,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
References: <a9f505a6-fd31-4cfa-a193-d21638bb14f1@p183>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <a9f505a6-fd31-4cfa-a193-d21638bb14f1@p183>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 01.08.24 21:16, Alexey Dobriyan wrote:
> Uninstrument arch/x86/platform/pvh/enlighten.c: KASAN is not setup
> _this_ early in the boot process.
> 
> Steps to reproduce:
> 
> 	make allnoconfig
> 	make sure CONFIG_AMD_MEM_ENCRYPT is disabled
> 		AMD_MEM_ENCRYPT independently uninstruments lib/string.o
> 		so PVH boot code calls into uninstrumented memset() and
> 		memcmp() which can make the bug disappear depending on
> 		the compiler.
> 	enable CONFIG_PVH
> 	enable CONFIG_KASAN
> 	enable serial console
> 		this is fun exercise if you never done it from nothing :^)
> 
> 	make
> 
> 	qemu-system-x86_64	\
> 		-enable-kvm	\
> 		-cpu host	\
> 		-smp cpus=1	\
> 		-m 4096		\
> 		-serial stdio	\
> 		-kernel vmlinux \
> 		-append 'console=ttyS0 ignore_loglevel'
> 
> Messages on serial console will easily tell OK kernel from unbootable
> kernel. In bad case qemu hangs in an infinite loop stroboscoping
> "SeaBIOS" message.
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

Acked-by: Juergen Gross <jgross@suse.com>


Juergen



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 06:05:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 06:05:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770146.1181069 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZlPO-00024s-Kg; Fri, 02 Aug 2024 06:04:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770146.1181069; Fri, 02 Aug 2024 06:04:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZlPO-00024l-HU; Fri, 02 Aug 2024 06:04:58 +0000
Received: by outflank-mailman (input) for mailman id 770146;
 Fri, 02 Aug 2024 06:04: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=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZlPN-00024f-OP
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 06:04:57 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 249f4f61-5095-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 08:04:56 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a7aa212c1c9so978343066b.2
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 23:04:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ec727esm57001266b.197.2024.08.01.23.04.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 23:04:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 249f4f61-5095-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722578696; x=1723183496; 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=BJdR8UlgH022Xk2viPR1cQw/vL8as1dX7BdU+jDvN6o=;
        b=S5qWMsoHzvzhUz5dJO+709sR++5zomAtfNZa7xsxB93t1g650iZmCy7lSq2p+rH0lT
         0YV0mlnSl6IEeDBpEqT4qTFXEJXGM1M7k/qJ9WJj1wbgIo+jaKStTlk40nWr+4I58bjG
         9VMGl5tGLo+Dx+6idZdWAPU72GIXorBnaf2fqenwHw6OWPNYizSlvCfFH+Z2TeZnX/mc
         8VqEbFvo6taAhw+8VFD8SjOqk+pVUvejT0CQf7YtLK1SR8Glk0uCf1z5+1Fa7x8K3CUa
         K0rorysJqMaUNwbEBF8z+6FUv+d87m9crR//O/ljVoJkrbkTBwraNcu1NUGWCqo+CvQO
         ZTqQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722578696; x=1723183496;
        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=BJdR8UlgH022Xk2viPR1cQw/vL8as1dX7BdU+jDvN6o=;
        b=TIVnhIWjEqkkxQ2nDRTzQWJ4jz0FZWlzTOZThRXKz65lh4mH5rIO+Ny6zMfl9cchmm
         SpJjEuv0HpysMV5By0F4VTNWiuprJplYaWLBI0iOnl3CJrYG9nDLDE703lwJXBPrvLQU
         Fnc3ed5m5kuhSBWbxjtwqFcxP2YQc7gIdLJgUBl6vdUnHJXktoo1N3p7wuaF+j47I/l7
         j6j9A5rLi2ADlB6UuICTb27bsL/DPnS9kP7VvyoKqpYJq8vc/8mr2q1vQ/H90Uw9kL7k
         Y74NM3t+A6qQUOiFiK2PEezTMvfKT8Fj/4HGdmT4DcFUc0nTJzUXopomiLNS7H9q/i92
         SJRA==
X-Forwarded-Encrypted: i=1; AJvYcCUMW0/Bl1FOI9vvxWM9LqvzCKL5ejtevnsdFnGiqbWDUuku4RuKxvtNeNy18/Av+Eme7dsKXQlPliX4Ff6ukJNz0HLlyLdmnjIahJ/HHD0=
X-Gm-Message-State: AOJu0Yw8b7LJzfqmPj3/t6hwumvQUQVLWeyCY/kR1KAOefLB3vSDQw3m
	AST8axn3adrJkHnuoTtsQLqgKhJkx82MNTGA5t6v4ICttWdiuERBli4FVp2akmxl1s6dS9ISbI0
	=
X-Google-Smtp-Source: AGHT+IEHnZfkUden+bNOzCnmuX4gokZ7N0CaV9pjDhrFWAjINaAoTOSHqXiu3AO2xC8vgYeFj6zC5Q==
X-Received: by 2002:a17:906:bc0f:b0:a7a:c812:36c5 with SMTP id a640c23a62f3a-a7dc509f924mr180718066b.46.1722578696021;
        Thu, 01 Aug 2024 23:04:56 -0700 (PDT)
Message-ID: <d9cbddc0-cb5c-4ce9-9bda-be0b97719799@suse.com>
Date: Fri, 2 Aug 2024 08:04:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v11 2/5] xen/riscv: introduce decode_cause() stuff
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 xen-devel@lists.xenproject.org
References: <cover.1721731887.git.oleksii.kurochko@gmail.com>
 <335b0b49720b3524b6c89c5ce62d3377a4bb1fb8.1721731887.git.oleksii.kurochko@gmail.com>
 <a2ad6557-8162-4f06-84c6-b79c049cb326@suse.com>
 <44b01293f3e318b6f4d1c3aff3f1b38349676bc0.camel@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: <44b01293f3e318b6f4d1c3aff3f1b38349676bc0.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 01.08.2024 22:05, oleksii.kurochko@gmail.com wrote:
> On Thu, 2024-08-01 at 13:44 +0200, Jan Beulich wrote:
>> On 24.07.2024 17:31, Oleksii Kurochko wrote:
>>> The patch introduces stuff needed to decode a reason of an
>>> exception.
>>>
>>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>>> Acked-by: Alistair Francis <alistair.francis@wdc.com>
>>> Acked-by: Jan Beulich <jbeulich@suse.com>
>>> ---
>>> Changes in V11:
>>>  - Nothing changed. Only rebase.
>>> ---
>>> Changes in V10:
>>>  - add Acked-by: Jan Beulich <jbeulich@suse.com>
>>> ---
>>> Changes in V9:
>>>  - This patch was reverted as breaks both release and randconfig
>>> builds.
>>>    I don't see the failures now. ( probably it was because of
>>> printk usage
>>>    which was not ready at that moment ).
>>>  - drop inclusion of <asm/csr.h> and <asm/early_printk.h>
>>>  - add <asm/riscv_encoding.h> for CAUSE_* in decode_trap_cause().
>>> ---
>>> Changes in V8:
>>>   - fix typo in return string from decode_reserved_interrupt_cause
>>>   - add Acked-by: Alistair Francis <alistair.francis@wdc.com>
>>> ---
>>> Changes in V7:
>>>  - Nothing changed. Only rebase.
>>> ---
>>> Changes in V6:
>>>  - Remove usage of LINK_TO_LOAD() due to the MMU being enabled
>>> first.
>>>  - Change early_printk() to printk()
>>> ---
>>> Changes in V5:
>>>   - Remove <xen/error.h> from riscv/traps/c as nothing would
>>> require
>>>     inclusion.
>>>   - decode_reserved_interrupt_cause(), decode_interrupt_cause(),
>>> decode_cause, do_unexpected_trap()
>>>     were made as static they are expected to be used only in
>>> traps.c
>>>   - use LINK_TO_LOAD() for addresses which can be linker time
>>> relative.
>>> ---
>>> Changes in V4:
>>>   - fix string in decode_reserved_interrupt_cause()
>>> ---
>>> Changes in V3:
>>>   - Nothing changed
>>> ---
>>> Changes in V2:
>>>   - Make decode_trap_cause() more optimization friendly.
>>>   - Merge the pathc which introduces do_unexpected_trap() to the
>>> current one.
>>> ---
>>>  xen/arch/riscv/traps.c | 80
>>> +++++++++++++++++++++++++++++++++++++++++-
>>>  1 file changed, 79 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
>>> index 5415cf8d90..37cec40dfa 100644
>>> --- a/xen/arch/riscv/traps.c
>>> +++ b/xen/arch/riscv/traps.c
>>> @@ -9,13 +9,91 @@
>>>  #include <xen/sched.h>
>>>  
>>>  #include <asm/processor.h>
>>> +#include <asm/riscv_encoding.h>
>>>  #include <asm/traps.h>
>>>  
>>> -void do_trap(struct cpu_user_regs *cpu_regs)
>>> +static const char *decode_trap_cause(unsigned long cause)
>>> +{
>>> +    static const char *const trap_causes[] = {
>>> +        [CAUSE_MISALIGNED_FETCH] = "Instruction Address
>>> Misaligned",
>>> +        [CAUSE_FETCH_ACCESS] = "Instruction Access Fault",
>>> +        [CAUSE_ILLEGAL_INSTRUCTION] = "Illegal Instruction",
>>> +        [CAUSE_BREAKPOINT] = "Breakpoint",
>>> +        [CAUSE_MISALIGNED_LOAD] = "Load Address Misaligned",
>>> +        [CAUSE_LOAD_ACCESS] = "Load Access Fault",
>>> +        [CAUSE_MISALIGNED_STORE] = "Store/AMO Address Misaligned",
>>> +        [CAUSE_STORE_ACCESS] = "Store/AMO Access Fault",
>>> +        [CAUSE_USER_ECALL] = "Environment Call from U-Mode",
>>> +        [CAUSE_SUPERVISOR_ECALL] = "Environment Call from S-Mode",
>>> +        [CAUSE_MACHINE_ECALL] = "Environment Call from M-Mode",
>>> +        [CAUSE_FETCH_PAGE_FAULT] = "Instruction Page Fault",
>>> +        [CAUSE_LOAD_PAGE_FAULT] = "Load Page Fault",
>>> +        [CAUSE_STORE_PAGE_FAULT] = "Store/AMO Page Fault",
>>> +        [CAUSE_FETCH_GUEST_PAGE_FAULT] = "Instruction Guest Page
>>> Fault",
>>> +        [CAUSE_LOAD_GUEST_PAGE_FAULT] = "Load Guest Page Fault",
>>> +        [CAUSE_VIRTUAL_INST_FAULT] = "Virtualized Instruction
>>> Fault",
>>> +        [CAUSE_STORE_GUEST_PAGE_FAULT] = "Guest Store/AMO Page
>>> Fault",
>>> +    };
>>> +
>>> +    if ( cause < ARRAY_SIZE(trap_causes) && trap_causes[cause] )
>>> +        return trap_causes[cause];
>>> +    return "UNKNOWN";
>>> +}
>>
>> While I committed this as-is, two more points: First, as soon any any
>> such array access becomes potentially reachable because of guest
>> activity, it wants to use array_access_nospec() or alike.
> Could you please explain why ( specifically ) guest activity affects if
> array access becomes potentially reachable? 

Anything the guest can affect wants to be as immune as possible towards
the guest trying to drive speculation the wrong way, and thus be able
to infer information from resulting internal state of the CPU. I'm sure
you're aware of at least the fact that there was a multitude of such
issues over the last several years.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 06:06:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 06:06:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770155.1181079 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZlRE-00037T-2W; Fri, 02 Aug 2024 06:06:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770155.1181079; Fri, 02 Aug 2024 06:06:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZlRD-00037M-WE; Fri, 02 Aug 2024 06:06:52 +0000
Received: by outflank-mailman (input) for mailman id 770155;
 Fri, 02 Aug 2024 06:06:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZlRC-00037E-Rf
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 06:06:50 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6810abed-5095-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 08:06:50 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-a7a8e73b29cso643761866b.3
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 23:06:50 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9bc3ca6sm57989266b.20.2024.08.01.23.06.48
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 23:06:48 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6810abed-5095-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722578809; x=1723183609; 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=RoH/DL+nQ38hS1GDHQNCm2eEyYeGyiIBgf7i+VwjW7M=;
        b=BjZb+KGwsh339d6BpUAumRwrara2Db3ZGArPqK4yQDFovvogXVmuODqxX/FDdjh/sp
         ee9nOzMxKjMgsvONI0UqUs/82RgCJMXHsvP7nLifrfFaatZXY2YhY8kaYdPjsOg/oLiq
         mplmqB5uca/wJGtoI1BY2z7S7RkT/yd2aztrDpVYePFvt706m3fddZiXXYEdMkHnJEK1
         gb9gNQAqwPliw79oN882c4g13nSLUprdVHpVOso7r1n5SQ7gL1R4yFbi/AyKgW7Sl3R8
         0KSuWrmuNs6LNBMrvEmmJFfz2n+atwQoAEHvErE5crEQmYINzduXV3jWUUmdlFfmAB1h
         tgIA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722578809; x=1723183609;
        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=RoH/DL+nQ38hS1GDHQNCm2eEyYeGyiIBgf7i+VwjW7M=;
        b=b2AUKDsYYQwWvIbBjJ57A6dhprUvclBFpIPvcHMyGfX2YrQ7DND2l6qEz53/6rXX7L
         Q4f3FsQBMgexGT52d6iRm4TEXXX33+tjlJsXq+XqDFgJiYPQCJVuSwswyRbfyBfOycHZ
         oKwnwl71pZCztkNSNEhIL9AqrIW956Mv4Inw8w2hQhBHi/YqD9q9C6gmNT59ezBq5ufM
         2clRpoC0QrqLSY1oFBKY5H8cu/z0UKoWyIIL36X0KmS9pSBCUFQm5JmgsTwSrw2m2RWM
         d2M5XlSoL0qDHUKovcNOR8teHKPd1S5LHa2tTYRIvrcNT0AKtvlQYF8npG8l16AbJBbj
         r17w==
X-Forwarded-Encrypted: i=1; AJvYcCUKElNVB6tSCMFg8ESWZF75VYloi2hVZ4G2bQhH1URY2JDxjeHOPZOvPPP7Z0XSafVan3qLkYvn+BZLbA2sl5Urh32nsUUwLlyVbY62WoY=
X-Gm-Message-State: AOJu0Yz2UYITBq8xJ0thBmnnf8G8LMITGSMUiUKqIAYm2NPr3+inqSHZ
	DCBp9B1CR7BvOVZgTnfCo6qMNgQdP84J66vmG5Js22+CcJ2nPz0Xx0i2Y4IaIQ==
X-Google-Smtp-Source: AGHT+IFhiJAkQLqWivOZjJB30J5mZa4hCf9qqLPJjaMlOJhhFxipESrBccTcO86s7BC5ew0UUkmGSw==
X-Received: by 2002:a17:907:7e9e:b0:a6f:e47d:a965 with SMTP id a640c23a62f3a-a7dc502e77amr168761066b.41.1722578809179;
        Thu, 01 Aug 2024 23:06:49 -0700 (PDT)
Message-ID: <8e110bfd-d6c6-4a24-8062-f728a4cf0a20@suse.com>
Date: Fri, 2 Aug 2024 08:06:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] docs/misra: add R13.2 and R18.2 to rules.rst
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>, Julien Grall <julien@xen.org>,
 xen-devel@lists.xenproject.org
References: <alpine.DEB.2.22.394.2407301626460.4857@ubuntu-linux-20-04-desktop>
 <6575beb5-645a-470a-89a1-8485adeace60@suse.com>
 <alpine.DEB.2.22.394.2407311647170.4857@ubuntu-linux-20-04-desktop>
 <dd463c03-71ca-4333-ac3f-629241b0f9bc@suse.com>
 <alpine.DEB.2.22.394.2408011044320.4857@ubuntu-linux-20-04-desktop>
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: <alpine.DEB.2.22.394.2408011044320.4857@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 01.08.2024 19:59, Stefano Stabellini wrote:
> On Thu, 1 Aug 2024, Jan Beulich wrote:
>> On 01.08.2024 01:50, Stefano Stabellini wrote:
>>> On Wed, 31 Jul 2024, Jan Beulich wrote:
>>>> On 31.07.2024 01:30, Stefano Stabellini wrote:
>>>>> --- a/docs/misra/rules.rst
>>>>> +++ b/docs/misra/rules.rst
>>>>> @@ -462,6 +462,15 @@ maintainers if you want to suggest a change.
>>>>>       - Initializer lists shall not contain persistent side effects
>>>>>       -
>>>>>  
>>>>> +   * - `Rule 13.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_13_02.c>`_
>>>>> +     - Required
>>>>> +     - The value of an expression and its persistent side-effects shall
>>>>> +       be the same under all permitted evaluation orders
>>>>> +     - Be aware that the static analysis tool Eclair might report
>>>>> +       several findings for Rule 13.2 of type "caution". These are
>>>>> +       instances where Eclair is unable to verify that the code is valid
>>>>> +       in regard to Rule 13.2. Caution reports are not violations.
>>>>
>>>> Which doesn't make clear what our take is towards new code people may
>>>> submit.
>>>
>>> Good point, see my comment below
>>>
>>>
>>>>> @@ -583,6 +592,15 @@ maintainers if you want to suggest a change.
>>>>>         submitting new patches please try to decrease the number of
>>>>>         violations when possible.
>>>>>  
>>>>> +   * - `Rule 18.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_18_02.c>`_
>>>>> +     - Required
>>>>> +     - Subtraction between pointers shall only be applied to pointers
>>>>> +       that address elements of the same array
>>>>> +     - Be aware that the static analysis tool Eclair might report
>>>>> +       several findings for Rule 18.2 of type "caution". These are
>>>>> +       instances where Eclair is unable to verify that the code is valid
>>>>> +       in regard to Rule 18.2. Caution reports are not violations.
>>>>
>>>> And while the same wording is used here, I think it is pretty clear for
>>>> this that we'd reject changes where bad subtractions are used. IOW even
>>>> more so important to clarify the (possibly different) positions on what
>>>> is going to be added into the code base.
>>>
>>> In both of these cases, we would reject code that doesn't follow R13.2
>>> and R18.2.
>>
>> But we shouldn't (unconditionally) do so for for 13.2, should we?
>>
>>> I'll change it to the following:
>>>
>>>
>>> Be aware that the static analysis tool Eclair might report several
>>> findings for Rule 18.2 of type "caution". These are instances where
>>> Eclair is unable to verify that the code is valid in regard to Rule
>>> 18.2. Caution reports are not violations. Regardless, new code is
>>> expected to follow this rule.
>>
>> I'm fine with this for 18.2, but not so much for 13.2.
> 
> Let me clarify something about R13.2. I expect we are aligned on this.
> 
> Rule 13.2 only expects that "the value of an expression and its persistent
> side-effects shall be the same under all permitted evaluation orders"
> and nothing more.
> 
> It is an outstanding limitation of static analyzers such as ECLAIR
> that they cannot be certain that "the value of an expression and its
> persistent side-effects shall be the same under all permitted evaluation
> orders". So one way to make ECLAIR happy is to change this code:
> 
> 1)
> func1(param1, func2(a), func3(b);
> 
> into this code:
> 
> 2)
> param2 = func2(a);
> param3 = func3(b);
> func1(param1, param2, param3);
> 
> Rule 13.2 is not asking us to change 1) into 2). 1) is acceptable. It is
> just that ECLAIR cannot help us ensure that 1) is compliant with Rule
> 13.2. It is totally fine to accept new code written in the form 1), of
> course only if "the value of an expression and its persistent
> side-effects shall be the same under all permitted evaluation orders".
> It would likely increase the number of ECLAIR cautions, but it is not
> necessarily a problem, and the ECLAIR Gitlab job will not fail.
> 
> If one of the reviewers discovers that 1) doesn't comply with Rule 13.2
> due to manual review, then they should ask the contributor to change the
> code. That is a good idea because we wouldn't want the value of an
> expression to be dependant on the evaluation order which GCC cannot
> guarantee.

Okay, if that is our interpretation of the rule for practical purposes,
then I'm no longer concerned.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 06:26:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 06:26:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770164.1181090 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZljt-0006Cq-I3; Fri, 02 Aug 2024 06:26:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770164.1181090; Fri, 02 Aug 2024 06:26:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZljt-0006Cj-FK; Fri, 02 Aug 2024 06:26:09 +0000
Received: by outflank-mailman (input) for mailman id 770164;
 Fri, 02 Aug 2024 06:26:07 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZljr-0006Cc-TA
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 06:26:07 +0000
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com
 [2a00:1450:4864:20::529])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 16124299-5098-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 08:26:00 +0200 (CEST)
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5b8c2a61386so192376a12.2
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 23:26:00 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b839c24028sm662030a12.24.2024.08.01.23.25.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 23:25:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 16124299-5098-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722579960; x=1723184760; 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=/6w5IC0hG7P1bvM4QbYSus+uSbfzNBa0D9VYlpjDn70=;
        b=EfSlP5TlmrytaWenrhe0SsKT4KSp86fHvmjdOBV4iZfGF1judTK7WSWW+7SmtsOaEN
         RZn0CRfj3k5pc5p1fy134WsFp1Xa+kMP5QkHCA9FH29m4LMLMCTnrPx8l7jYkgFbGywC
         pbkmFiWHLFXvUO+EbNvaDbv812lTNgTrWbx8mR1uByoKWzyjl0F65qkuo7WX4hwRxZeP
         UVLwKz7TGNgN9UlrbSyp7WzCY1tjoJvXgY98Fwz2fRnR7imW07bIlLrasJPi4wYcN5Ro
         pI//NDFq+kdFYIHqa84my6p5EaO/kkA7aguG4DttzoxcMTo90G1pSXiZ07Iy74zlZ9IL
         Jsng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722579960; x=1723184760;
        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=/6w5IC0hG7P1bvM4QbYSus+uSbfzNBa0D9VYlpjDn70=;
        b=d/G74OQt2jkZMJ6jGFscXS44ekulgk+nu7erCyMr9N19Esb+H1vg5dsuUAoVvvD7/Y
         iSjy4s1vIu6e52Zlv3zIV+yiO0cqsLkzCnqfdEj2uLQ6vdILkmbx/KlXIHUIztX3oIg5
         oznNC4yC19n1cWnCQ+pCVCpIYtddlnoe9eyuSLsK7RkZbjl8JnwzrpOAPWm/rX9YX70O
         s1GPHveP2RqkYdEmVfhUigDt5EWoK1uJQPHi6PeZosWtVytxBQ1oTqwhpQ7Djw6ponOS
         4dsmxZZHHHOCSMZAYJ5w7FSncUOtFvGUCp97t9cQXfta4ac7EV9U4SEDYEkd+0sxZRVU
         ZVkQ==
X-Gm-Message-State: AOJu0YyRfb59WL+eYiaQ21Vj2MeFHt+7swp3N+07OItsmW1CKOEkPfUJ
	u1NKnoKpl08kwcH/d8pGdXEid0bsHVkHA7avmri61rM6MSINqcR+T4IGtZNh4Q==
X-Google-Smtp-Source: AGHT+IGxYGd/auS/yvvMMaqc2PX2u7poX6C50D1piigp3bZowSJq/VeH46a4v1d6by2h81lXGex+Pw==
X-Received: by 2002:a50:e602:0:b0:5a1:f74d:2d58 with SMTP id 4fb4d7f45d1cf-5b7f541365cmr1699282a12.24.1722579960092;
        Thu, 01 Aug 2024 23:26:00 -0700 (PDT)
Message-ID: <1ca7e6a2-698d-4548-9959-fd88126c25e1@suse.com>
Date: Fri, 2 Aug 2024 08:25:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v12 1/7] xen/pci: Add hypercall to support reset of
 pcidev
To: "Chen, Jiqian" <Jiqian.Chen@amd.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>, Juergen Gross <jgross@suse.com>,
 "Daniel P . Smith" <dpsmith@apertussolutions.com>,
 "Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>,
 "Huang, Ray" <Ray.Huang@amd.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-2-Jiqian.Chen@amd.com> <ZqpeiWhuqPXiTeRZ@macbook>
 <BL1PR12MB5849CFC87F0DB92864B54BE4E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <BL1PR12MB5849CFC87F0DB92864B54BE4E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 02.08.2024 04:55, Chen, Jiqian wrote:
> On 2024/7/31 23:55, Roger Pau Monné wrote:
>> On Mon, Jul 08, 2024 at 07:41:18PM +0800, Jiqian Chen wrote:
>>> When a device has been reset on dom0 side, the Xen hypervisor
>>> doesn't get notification, so the cached state in vpci is all
>>> out of date compare with the real device state.
>>>
>>> To solve that problem, add a new hypercall to support the reset
>>> of pcidev and clear the vpci state of device. So that once the
>>> state of device is reset on dom0 side, dom0 can call this
>>> hypercall to notify hypervisor.
>>>
>>> Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
>>> Signed-off-by: Huang Rui <ray.huang@amd.com>
>>> Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
>>> Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
>>> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
>>
>> Thanks, just a couple of nits.
>>
>> This is missing a changelog between versions, and I haven't been
>> following all the versions, so some of my questions might have been
>> answered in previous revisions.
> Sorry, I will add changelogs here in next version.
> 
>>
>>> ---
>>>  xen/arch/x86/hvm/hypercall.c |  1 +
>>>  xen/drivers/pci/physdev.c    | 52 ++++++++++++++++++++++++++++++++++++
>>>  xen/drivers/vpci/vpci.c      | 10 +++++++
>>>  xen/include/public/physdev.h | 16 +++++++++++
>>>  xen/include/xen/vpci.h       |  8 ++++++
>>>  5 files changed, 87 insertions(+)
>>>
>>> diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
>>> index 7fb3136f0c7c..0fab670a4871 100644
>>> --- a/xen/arch/x86/hvm/hypercall.c
>>> +++ b/xen/arch/x86/hvm/hypercall.c
>>> @@ -83,6 +83,7 @@ long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>>>      case PHYSDEVOP_pci_mmcfg_reserved:
>>>      case PHYSDEVOP_pci_device_add:
>>>      case PHYSDEVOP_pci_device_remove:
>>> +    case PHYSDEVOP_pci_device_state_reset:
>>>      case PHYSDEVOP_dbgp_op:
>>>          if ( !is_hardware_domain(currd) )
>>>              return -ENOSYS;
>>> diff --git a/xen/drivers/pci/physdev.c b/xen/drivers/pci/physdev.c
>>> index 42db3e6d133c..c0f47945d955 100644
>>> --- a/xen/drivers/pci/physdev.c
>>> +++ b/xen/drivers/pci/physdev.c
>>> @@ -2,6 +2,7 @@
>>>  #include <xen/guest_access.h>
>>>  #include <xen/hypercall.h>
>>>  #include <xen/init.h>
>>> +#include <xen/vpci.h>
>>>  
>>>  #ifndef COMPAT
>>>  typedef long ret_t;
>>> @@ -67,6 +68,57 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>>>          break;
>>>      }
>>>  
>>> +    case PHYSDEVOP_pci_device_state_reset:
>>> +    {
>>> +        struct pci_device_state_reset dev_reset;
>>> +        struct pci_dev *pdev;
>>> +        pci_sbdf_t sbdf;
>>> +
>>> +        ret = -EOPNOTSUPP;
>>> +        if ( !is_pci_passthrough_enabled() )
>>> +            break;
>>> +
>>> +        ret = -EFAULT;
>>> +        if ( copy_from_guest(&dev_reset, arg, 1) != 0 )
>>> +            break;
>>> +
>>> +        sbdf = PCI_SBDF(dev_reset.dev.seg,
>>> +                        dev_reset.dev.bus,
>>> +                        dev_reset.dev.devfn);
>>> +
>>> +        ret = xsm_resource_setup_pci(XSM_PRIV, sbdf.sbdf);
>>> +        if ( ret )
>>> +            break;
>>> +
>>> +        pcidevs_lock();
>>> +        pdev = pci_get_pdev(NULL, sbdf);
>>> +        if ( !pdev )
>>> +        {
>>> +            pcidevs_unlock();
>>> +            ret = -ENODEV;
>>> +            break;
>>> +        }
>>> +
>>> +        write_lock(&pdev->domain->pci_lock);
>>> +        pcidevs_unlock();
>>> +        switch ( dev_reset.reset_type )
>>> +        {
>>> +        case PCI_DEVICE_STATE_RESET_COLD:
>>> +        case PCI_DEVICE_STATE_RESET_WARM:
>>> +        case PCI_DEVICE_STATE_RESET_HOT:
>>> +        case PCI_DEVICE_STATE_RESET_FLR:
>>> +            ret = vpci_reset_device_state(pdev, dev_reset.reset_type);
>>> +            break;
>>> +
>>> +        default:
>>> +            ret = -EOPNOTSUPP;
>>> +            break;
>>> +        }
>>> +        write_unlock(&pdev->domain->pci_lock);
>>> +
>>> +        break;
>>> +    }
>>> +
>>>      default:
>>>          ret = -ENOSYS;
>>>          break;
>>> diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
>>> index 1e6aa5d799b9..7e914d1eff9f 100644
>>> --- a/xen/drivers/vpci/vpci.c
>>> +++ b/xen/drivers/vpci/vpci.c
>>> @@ -172,6 +172,16 @@ int vpci_assign_device(struct pci_dev *pdev)
>>>  
>>>      return rc;
>>>  }
>>> +
>>> +int vpci_reset_device_state(struct pci_dev *pdev,
>>> +                            uint32_t reset_type)
>>
>> There's probably no use in passing reset_type to
>> vpci_reset_device_state() if it's ignored?
>>
>>> +{
>>> +    ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));
>>> +
>>> +    vpci_deassign_device(pdev);
>>> +    return vpci_assign_device(pdev);
>>> +}
>>> +
>>>  #endif /* __XEN__ */
>>>  
>>>  static int vpci_register_cmp(const struct vpci_register *r1,
>>> diff --git a/xen/include/public/physdev.h b/xen/include/public/physdev.h
>>> index f0c0d4727c0b..3cfde3fd2389 100644
>>> --- a/xen/include/public/physdev.h
>>> +++ b/xen/include/public/physdev.h
>>> @@ -296,6 +296,13 @@ DEFINE_XEN_GUEST_HANDLE(physdev_pci_device_add_t);
>>>   */
>>>  #define PHYSDEVOP_prepare_msix          30
>>>  #define PHYSDEVOP_release_msix          31
>>> +/*
>>> + * Notify the hypervisor that a PCI device has been reset, so that any
>>> + * internally cached state is regenerated.  Should be called after any
>>> + * device reset performed by the hardware domain.
>>> + */
>>> +#define PHYSDEVOP_pci_device_state_reset 32
>>> +
>>>  struct physdev_pci_device {
>>>      /* IN */
>>>      uint16_t seg;
>>> @@ -305,6 +312,15 @@ struct physdev_pci_device {
>>>  typedef struct physdev_pci_device physdev_pci_device_t;
>>>  DEFINE_XEN_GUEST_HANDLE(physdev_pci_device_t);
>>>  
>>> +struct pci_device_state_reset {
>>> +    physdev_pci_device_t dev;
>>> +#define PCI_DEVICE_STATE_RESET_COLD 0
>>> +#define PCI_DEVICE_STATE_RESET_WARM 1
>>> +#define PCI_DEVICE_STATE_RESET_HOT  2
>>> +#define PCI_DEVICE_STATE_RESET_FLR  3
>>> +    uint32_t reset_type;
>>
>> This might want to be a flags field, with the low 2 bits (or maybe 3
>> bits to cope if more rest modes are added in the future) being used to
>> signal the reset type.  We can always do that later if flags need to
>> be added.
> Do you mean this?
> +struct pci_device_state_reset {
> +    physdev_pci_device_t dev;
> +#define _PCI_DEVICE_STATE_RESET_COLD 0
> +#define PCI_DEVICE_STATE_RESET_COLD  (1U<<_PCI_DEVICE_STATE_RESET_COLD)
> +#define _PCI_DEVICE_STATE_RESET_WARM 1
> +#define PCI_DEVICE_STATE_RESET_WARM  (1U<<_PCI_DEVICE_STATE_RESET_WARM)
> +#define _PCI_DEVICE_STATE_RESET_HOT  2
> +#define PCI_DEVICE_STATE_RESET_HOT   (1U<<_PCI_DEVICE_STATE_RESET_HOT)
> +#define _PCI_DEVICE_STATE_RESET_FLR  3
> +#define PCI_DEVICE_STATE_RESET_FLR   (1U<<_PCI_DEVICE_STATE_RESET_FLR)
> +    uint32_t reset_type;
> +};

That's four bits, not two. I'm pretty sure Roger meant to keep the enum-
like #define-s, but additionally define a 2-bit mask constant (0x3). I
don't think it needs to be three bits right away - we can decide what to
do there when any of the higher bits are to be assigned a meaning.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 06:27:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 06:27:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770170.1181100 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZllQ-0007Fs-Tg; Fri, 02 Aug 2024 06:27:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770170.1181100; Fri, 02 Aug 2024 06:27:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZllQ-0007Fl-P5; Fri, 02 Aug 2024 06:27:44 +0000
Received: by outflank-mailman (input) for mailman id 770170;
 Fri, 02 Aug 2024 06:27:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZllP-0007Fd-2c
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 06:27:43 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 519452d1-5098-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 08:27:41 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-a728f74c23dso1010598466b.1
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 23:27:41 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9bc3d84sm59998066b.6.2024.08.01.23.27.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 23:27:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 519452d1-5098-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722580060; x=1723184860; 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=MMulInYZDUHLX2pCK42N94BJlYfJ/m5rIU1GCEr+IZ8=;
        b=d4zSQsXoNavZLUimaKjuTxeF0PrXd8ltmWH3+lBxNU5QTB29zrVffXIpJf8kaopPlK
         w9cvlYortdqXLZlIr8IF1Wp/v0L8T5dvQtxDr+aE9twf5sMLT9bmH5IUNs3IeXYq+QMN
         o6tpbsAxgCQWExHc1CUVnRR+MiXdR6KTkY9RXt3ele/hjLr+5u5RlBLZKMFEBcUZobDK
         /l8tvYCWrXobNeYxn7eCwp78P/Mj6o5GsrJh86iQ1G8k1FWJUbWm2udBOpreTFKjNByb
         FsuubCMhHDZaYoRffAzp6uPo0YK6m9jb40V41UK/QqSzlss54rIMs1cuEIYPl+bWZLhg
         fLcw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722580060; x=1723184860;
        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=MMulInYZDUHLX2pCK42N94BJlYfJ/m5rIU1GCEr+IZ8=;
        b=ZhNh//cxotV44eWQA7G0d3H/zyyNutxZ7Trej6ebaUvG+IwQq6ZUA/5c8jhkoWLq4T
         KHxfAXJOvT1PyjTJKERli6iGXI0BOU/BA9UeY1jduYd4KAAEz0UfNDXLdVtgssZ5FeIp
         znz+GXNN/HpM6wA7zumI8Wg9R5nAhZy3af0E610/D98DkGHgC4d9jqhCI6ZSKVgEbX8H
         itYyu0IZ0Mo2AEFugGKOpwsa2rkjPEwqTHofUE+aws+qF05dsEhVqJVWGPhVrnvbdOkE
         x0BQNNlYuPV0zj0W2JBxwDHKrqsrNplZUzLm0IvDCWb0MaN5t8tNb6FKyBt21QHHunq+
         y05Q==
X-Gm-Message-State: AOJu0Yx6mpeBVFX3Xfmxn7Ncxho5VRvONes9YRFL1QyLQw2lxJEbXzCA
	du+FCyAz6uKYg3iFcCsK0RtrC+8IGtBWHqtwpFcvav6QTXck0OpmXQKWNid5wg==
X-Google-Smtp-Source: AGHT+IHrs9poE0lUj0qPr3GyL+ePpnPZa13Is2jzxYq5NjcgtztGNePe36rjDbY4Nd+q0c0jtxS3oA==
X-Received: by 2002:a17:907:7f29:b0:a77:cd4f:e4f5 with SMTP id a640c23a62f3a-a7dc50feb0cmr193969366b.68.1722580059940;
        Thu, 01 Aug 2024 23:27:39 -0700 (PDT)
Message-ID: <bd03a532-e404-483f-a04b-b19c3d6fa993@suse.com>
Date: Fri, 2 Aug 2024 08:27:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v12 4/7] x86/domctl: Add hypercall to set the access
 of x86 gsi
To: "Chen, Jiqian" <Jiqian.Chen@amd.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>, Juergen Gross <jgross@suse.com>,
 "Daniel P . Smith" <dpsmith@apertussolutions.com>,
 "Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>,
 "Huang, Ray" <Ray.Huang@amd.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-5-Jiqian.Chen@amd.com> <ZqtsQwZNyFzflDQt@macbook>
 <BL1PR12MB58490598FF7FEAE291DCDAABE7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <BL1PR12MB58490598FF7FEAE291DCDAABE7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 02.08.2024 05:10, Chen, Jiqian wrote:
> On 2024/8/1 19:06, Roger Pau Monné wrote:
>> On Mon, Jul 08, 2024 at 07:41:21PM +0800, Jiqian Chen wrote:
>>> --- a/xen/include/public/domctl.h
>>> +++ b/xen/include/public/domctl.h
>>> @@ -464,6 +464,13 @@ struct xen_domctl_irq_permission {
>>>      uint8_t pad[3];
>>>  };
>>>  
>>> +/* XEN_DOMCTL_gsi_permission */
>>> +struct xen_domctl_gsi_permission {
>>> +    uint32_t gsi;
>>> +#define XEN_DOMCTL_GSI_PERMISSION_MASK 1
>>
>> IMO this would be better named GRANT or similar, maybe something like:
>>
>> /* Low bit used to signal grant/revoke action. */
>> #define XEN_DOMCTL_GSI_REVOKE 0
>> #define XEN_DOMCTL_GSI_GRANT  1
>>
>>> +    uint8_t access_flag;    /* flag to specify enable/disable of x86 gsi access */
>>> +    uint8_t pad[3];
>>
>> We might as well declare the flags field as uint32_t and avoid the
>> padding field.
> So, should this struct be like below? Then I just need to check whether everything except the lowest bit is 0.
> struct xen_domctl_gsi_permission {
>     uint32_t gsi;
> /* Lowest bit used to signal grant/revoke action. */
> #define XEN_DOMCTL_GSI_REVOKE 0
> #define XEN_DOMCTL_GSI_GRANT  1
> #define XEN_DOMCTL_GSI_PERMISSION_MASK 1
>     uint32_t access_flag;    /* flag to specify enable/disable of x86 gsi access */
> };

Yet then why "access_flags"? You can't foresee what meaning the other bits may
gain. That meaning may (and likely will) not be access related at all.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 06:30:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 06:30:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770179.1181109 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZloD-0000KV-CU; Fri, 02 Aug 2024 06:30:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770179.1181109; Fri, 02 Aug 2024 06:30:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZloD-0000KO-9P; Fri, 02 Aug 2024 06:30:37 +0000
Received: by outflank-mailman (input) for mailman id 770179;
 Fri, 02 Aug 2024 06:30:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZloC-0000KH-I3
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 06:30:36 +0000
Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com
 [2a00:1450:4864:20::236])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ba02c628-5098-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 08:30:35 +0200 (CEST)
Received: by mail-lj1-x236.google.com with SMTP id
 38308e7fff4ca-2ef248ab2aeso112702621fa.0
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 23:30:35 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ec7311sm58953366b.195.2024.08.01.23.30.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 23:30:34 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ba02c628-5098-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722580235; x=1723185035; 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=y2RdBw5XcQjQNw+V4TlDKBwnZ94TfWoC+/ovto3/93I=;
        b=DeKuAtazszIBlOexzgdU94tRDHNZ/b83EvgqOSJoFo63xGRBt3a5+nL4fVNeEtQ1Ar
         EKD1AaAjvNUglfPmFM20xp0To5PXQk0Y/Z/JM6Pz67c4NUONXDaNr4y7d29dvRoZGJBQ
         EvvZGYA8IBwhf1vnDJ1uMebIALMHnNNPc9foNOQ0NLssKcgGzmDTTv0LY69NMg8NBE/y
         vPN/A02sRx617qWYaDekgtfd9CuHHZd+cSQ7ExyFm/JYdLgybXTrsQwKSuMhP/xhjlsU
         xcMMveJPwQSSz092UPFWIi0XPWSQto7SVve5tRVyoGHlCX9hz2d3yngkdfL+vC8ViHac
         CJYA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722580235; x=1723185035;
        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=y2RdBw5XcQjQNw+V4TlDKBwnZ94TfWoC+/ovto3/93I=;
        b=YNGIfQuWzl1ZuxXx/y9zL9fiN3zId52hDcNf2AQGsRNhshKBn1Hh6XI4MipF/VwJBk
         yBB9TS3crK/tpOMQpOB2SfuOqOBN1n+affRF1UrI1kY/OSulMBO7RsZQ+8yrNRGoO5Wx
         FtUTDRr3nCYs0krrRgeyjngwYtiDTyJ/twyLN2ixUkn/+e6ScbgyvgjmPBpGiyZIRSxN
         +NQjPwKFuIT2ELXZG9tdfOFeUx81eqXo/TWrRdjv2TeAXKuf3JwoL1E5FdbvtdJi/h/4
         xNYGt8U+shodDW2QCHOg/+Ll4B7PLlZSEXowVEscuh5A13mLIyen5uMcoDn1mgPDEhN4
         e83Q==
X-Forwarded-Encrypted: i=1; AJvYcCVdqao7cCaJp+Bjp5E+aWBNub3Im3LYAQoOBoljkHe889+e2wdWRKCA4qOP7ODHLl6ICL18tqcusNFyzh+raBZy0t1IMelFmgvMoWzlFoU=
X-Gm-Message-State: AOJu0Yy5ywnt0QrLSE4sjT0VoGBWo0HhusI4XEeSicsor/7lNmtZlQCe
	Z5fc43gM8F9Wl2jocERgR+MDRAI9aXUKL4rlrrIRT/mK2FNGnulnfGt0mkPu1A==
X-Google-Smtp-Source: AGHT+IE3QyrK+rRbvpSIRyDiSSwHvO6nGZjE4g37JRSoj5PuSXRsY1JWsosbYRJU1oWggQUyN+JhPw==
X-Received: by 2002:a2e:320b:0:b0:2ef:28ed:1ff2 with SMTP id 38308e7fff4ca-2f15aa88cb7mr20661931fa.9.1722580235134;
        Thu, 01 Aug 2024 23:30:35 -0700 (PDT)
Message-ID: <8a2e672c-151d-4081-aeb9-db87c568b1a6@suse.com>
Date: Fri, 2 Aug 2024 08:30:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/shutdown: change default reboot method preference
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <20240801161753.94399-1-roger.pau@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240801161753.94399-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 01.08.2024 18:17, Roger Pau Monne wrote:
> Change the default reboot preference to prefer ACPI over UEFI if available and
> not in reduced hardware mode.

Imo such a change in default behavior wants to come with a CHANGELOG.md entry.

Jan



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 06:33:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 06:33:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770188.1181119 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZlqj-0000ts-Ol; Fri, 02 Aug 2024 06:33:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770188.1181119; Fri, 02 Aug 2024 06:33:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZlqj-0000tl-Ls; Fri, 02 Aug 2024 06:33:13 +0000
Received: by outflank-mailman (input) for mailman id 770188;
 Fri, 02 Aug 2024 06:33:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZlqi-0000te-Cx
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 06:33:12 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 16b5e820-5099-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 08:33:11 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-59f9f59b827so11336485a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 01 Aug 2024 23:33:11 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b83c22db71sm658241a12.94.2024.08.01.23.33.10
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 01 Aug 2024 23:33:10 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 16b5e820-5099-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722580391; x=1723185191; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=cCH0OmhfowYSiBOTZGUEyukD5vkf0pEdf7IQQQvXU5A=;
        b=RGORpsqV+3t8/O87vu2R0vAnYs4Vlbuqgw7lKKNRzySUAqODRJZ6nRaBN1cqWN/BIU
         dpyJlZ2SGNmuiR6BzPndc4XAP4IW0qcTA+R4p55W03pbhYHCI77UCU1BrUuZLSwsYzB9
         28DXp2LuH07EKynMibz6MUbErxksc5CQBXXsXQbmJQWDpvgkItS+2Id4G8nSFWebbPvx
         ubj2begQOFAO7MPaQomMXQtwdzrBvzoeLLkW2LhfljkF30OqWml+JejIJ+/5WeLeXJgJ
         f9xxsyuDGk4TWZWhHfUoAzDE/4Z6+1pCi7PAszh7P+XjPxtZJ6AWHCZAWiBG8b6gtiVh
         wXLw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722580391; x=1723185191;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :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=cCH0OmhfowYSiBOTZGUEyukD5vkf0pEdf7IQQQvXU5A=;
        b=NgDEVFPnztqXbbvHyKarGmqErVtZYRsg3l2mgacH8+giU4Q+Xmwk8+oOtrjoVcIb+f
         psiCyy1b9qJwVdAfJm38PTFS/VV6sPXuBCT8wAGxyEwnGIm0zPK06d8+5ohbg9mSPSK1
         D5mJfV7TOW1erfKmu3Ivs/gX3zphPWHm+ljX2dtiLKIstJyt9tLLsgSBziZJ/xlg3mib
         +Jzhi9QQ3mXJwayBuG63Mn2Im92CYc/iT1B05YIZXGMchIwPItcEXJLGIxNl+uProHK7
         zfuckE6vcFMC/Z/YX9xLQyBKbb+sC9OGkoYGFW34bDiFmf+LYsHpvOKY+bYy8x9sOZ7N
         E2Mg==
X-Gm-Message-State: AOJu0YyrimH60mUTTq/OXna1ZFO2+aThkBOgWtPDWE8G0R4ZEer0TsSn
	8f35n4kMDBb+UaGSoz++A4SiDqT8gxqlueGeCuHSJTC2fmaWtx03X80arubfkkBtgb9zihE1c3o
	=
X-Google-Smtp-Source: AGHT+IGaPOZNWP8vTiJrW8RFlr39QlqHjv5TQ6x2kujomI7n/sdBTXQ30XK1YU2AEnrglB72JLFupQ==
X-Received: by 2002:a05:6402:a50:b0:578:60a6:7c69 with SMTP id 4fb4d7f45d1cf-5b7f5413b46mr1607861a12.30.1722580390719;
        Thu, 01 Aug 2024 23:33:10 -0700 (PDT)
Message-ID: <73902a85-2750-4684-b6f5-33dd67c72172@suse.com>
Date: Fri, 2 Aug 2024 08:33:09 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [xen-4.19-testing test] 187097: regressions - FAIL
To: xen-devel@lists.xenproject.org
References: <osstest-187097-mainreport@xen.org>
Content-Language: en-US
Cc: osstest service owner <osstest-admin@xenproject.org>
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+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: <osstest-187097-mainreport@xen.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 01.08.2024 23:38, osstest service owner wrote:
> flight 187097 xen-4.19-testing real [real]
> flight 187112 xen-4.19-testing real-retest [real]
> http://logs.test-lab.xenproject.org/osstest/logs/187097/
> http://logs.test-lab.xenproject.org/osstest/logs/187112/
> 
> Regressions :-(
> 
> Tests which did not succeed and are blocking,
> including tests which could not be run:
>  test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop       fail REGR. vs. 187044

Hmm, this is now pretty persistent in failing. Yet none of the changes
under test should have affected behavior in any way. Ideas, anyone?

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 06:48:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 06:48:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770197.1181130 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZm4p-0003pj-UP; Fri, 02 Aug 2024 06:47:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770197.1181130; Fri, 02 Aug 2024 06:47:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZm4p-0003pc-R1; Fri, 02 Aug 2024 06:47:47 +0000
Received: by outflank-mailman (input) for mailman id 770197;
 Fri, 02 Aug 2024 06:47:46 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0M7b=PB=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1sZm4o-0003pW-Cc
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 06:47:46 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur05on20601.outbound.protection.outlook.com
 [2a01:111:f403:2613::601])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1e855b2d-509b-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 08:47:43 +0200 (CEST)
Received: from DU2PR04CA0039.eurprd04.prod.outlook.com (2603:10a6:10:234::14)
 by GVXPR08MB10988.eurprd08.prod.outlook.com (2603:10a6:150:1fa::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Fri, 2 Aug
 2024 06:47:40 +0000
Received: from DU2PEPF0001E9C0.eurprd03.prod.outlook.com
 (2603:10a6:10:234:cafe::37) by DU2PR04CA0039.outlook.office365.com
 (2603:10a6:10:234::14) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend
 Transport; Fri, 2 Aug 2024 06:47:39 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DU2PEPF0001E9C0.mail.protection.outlook.com (10.167.8.69) with
 Microsoft SMTP
 Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7828.19 via
 Frontend Transport; Fri, 2 Aug 2024 06:47:38 +0000
Received: ("Tessian outbound de9676d3a70f:v365");
 Fri, 02 Aug 2024 06:47:38 +0000
Received: from L481dc2ce6fad.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 22D877DF-4CFE-43F7-B415-A5CB21DE47A9.1; 
 Fri, 02 Aug 2024 06:47:32 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id
 L481dc2ce6fad.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 02 Aug 2024 06:47:32 +0000
Received: from DB9PR08MB6588.eurprd08.prod.outlook.com (2603:10a6:10:25a::24)
 by DU4PR08MB11150.eurprd08.prod.outlook.com (2603:10a6:10:577::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23; Fri, 2 Aug
 2024 06:47:29 +0000
Received: from DB9PR08MB6588.eurprd08.prod.outlook.com
 ([fe80::a8fc:ea0d:baf1:23a]) by DB9PR08MB6588.eurprd08.prod.outlook.com
 ([fe80::a8fc:ea0d:baf1:23a%3]) with mapi id 15.20.7828.023; Fri, 2 Aug 2024
 06:47:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1e855b2d-509b-11ef-8776-851b0ebba9a2
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=XZV904lRY2afThric93gF4TVRxD2/Vf2dJTdzACXZkXCsNmJYwDuVo+WpzeoncK9ubtxqKdaH6giTksPVE/1ZlFcsl7VRctgSWLRHPKrTw4fHBYzoJm4q5AD1VkQ+PSHVEsyb0aYgLPVrdoGy6XF4ZunG1JNCu1smqq9BvZkT55eodvZFwoKt3t0ufNAjukz5O+poKISVXXA1cctUgOSwycxCJuEtg+GrnX+xDJ8PdSqsR5pJatNTwie0cLNfui1U0hYClyqvXJWCHRbPagSKGlJx/DapJ0KT+OJZwgqSF6Qi4wrbndN0Mnjkhtvy8WyWs4jD1HgGuQmwnxrntTIoA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=uBjOL499370Q3laRLvdGLAYxWnUBhC68FAW97vUgoF0=;
 b=tLzmceOA5ewZi0mbcL3t2lWdliUFh4s7nvYKXpLLL0Ls+CErRqQMJb0BHewafWzgfH9LIF9zT8BVz2jrPQqHY++zXe2H9E1z9f6E1v93hKJmO4pxrvpEjAPC/izYupviKyka2tbxR5Ni23a//cRqWFX8bBRzuDBSrAb6V+8ZoN8FN5VJ9iCruVgL5q31RoTLM/PwUFMmDLPEuK7jHuLXWGEl0bFhWSK2vqT4EVkoquH4dU+7h8Lr77lv2faJPI27Dp+RX8f75OrWXxtYLaELQTI1m0k0/7nEyeU9wnoS+zViRRseWyMvhcZicBxoYqenX2/ZBcMWuO9ySm+DBHhGww==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com;
 dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com;
 dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=uBjOL499370Q3laRLvdGLAYxWnUBhC68FAW97vUgoF0=;
 b=U8O9zWeBOkTyXcjUmncR6B4fmEb35VzbFmeOV2kVScQGLumkWbz/MVtyBEoqn3/zxCKGMqCo6eoOIAvjOo44zDEI5eQnhLIFeezex92yz5QzeOrmiOn+dHlmcfE6ECNAaDd7mFtYPIpDfPPqmyDCv4P7/1hGk8P1P1A5aSaDD/s=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: c78e87f6e9df32d2
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=UsUpiziTFr8R+Jf1qwLs030ZK54Dys12Ax1AYiRhOdwM5q1MaSdzfbLtKMxM9pBcKf2F8+hNqED79tv4sob50JxbjF/0MYV9llLFWKtmU3TC9WnXhlzOaQXpHrdpWjhSVUnrW1AyrJxJjoNx7DYtPdE/nv62+uxNl5WoVTn0Q7Tc5ZeY8cq0JmhAfjimDNWqMZEWgaZLyxfSb1CECmxcrC9tRazwsJoRZhMjU6TvYCmWuMJNmcpB0bruFDXYI2hmNvq/nsrc3szWAO+RVWsZcJkM16pP4oP79QIAyZ9BfxZPt0sbGEMBaADNUxu/UaDKnmHU72UeYN1htB46uwHbSA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=uBjOL499370Q3laRLvdGLAYxWnUBhC68FAW97vUgoF0=;
 b=lROzZNcULHTqVVtcstW7V7N9aTuwFXHxqh07GlP0dtSuetWpOYtJjdhj4p8A/Lk4szDQ1w5zKPIf5bNS5gk5Q4IPmZVMwGFgD04tvKnjLCSA2Tczmnq0b8I6vIv0SWG7YKV9EabFxCD1hOOwJUm7juT2vuWbmPMXOdGOkheiddRsvml4/cA8Y5ehJESNZMFvejdvPfWON4atICW08NwqISOua7yKw/pomgFFxAvSIdmrWs4ZuNWVeL3zCpdixtGjJDZfIEr1zokQr88qF5X2y47wlW//m2eWllfq9eaiezlUmNTePfZ1KeFGtE8lfJXnIU/zQs+E8DmupifjhawVfQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=uBjOL499370Q3laRLvdGLAYxWnUBhC68FAW97vUgoF0=;
 b=U8O9zWeBOkTyXcjUmncR6B4fmEb35VzbFmeOV2kVScQGLumkWbz/MVtyBEoqn3/zxCKGMqCo6eoOIAvjOo44zDEI5eQnhLIFeezex92yz5QzeOrmiOn+dHlmcfE6ECNAaDd7mFtYPIpDfPPqmyDCv4P7/1hGk8P1P1A5aSaDD/s=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Stefano Stabellini <sstabellini@kernel.org>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Jan Beulich
	<jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
	=?iso-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>, Julien Grall
	<julien@xen.org>
Subject: Re: [PATCH v3] docs/misra: add R13.2 and R18.2 to rules.rst
Thread-Topic: [PATCH v3] docs/misra: add R13.2 and R18.2 to rules.rst
Thread-Index: AQHa5EfVsHAUXHnoukyrQTWk1ek7dbIThxOA
Date: Fri, 2 Aug 2024 06:47:29 +0000
Message-ID: <00459643-095B-40C8-8AD1-48D8DA35962D@arm.com>
References:
 <alpine.DEB.2.22.394.2408011218250.114241@ubuntu-linux-20-04-desktop>
In-Reply-To:
 <alpine.DEB.2.22.394.2408011218250.114241@ubuntu-linux-20-04-desktop>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3774.600.62)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	DB9PR08MB6588:EE_|DU4PR08MB11150:EE_|DU2PEPF0001E9C0:EE_|GVXPR08MB10988:EE_
X-MS-Office365-Filtering-Correlation-Id: 0f16f0a0-77e6-45da-9391-08dcb2bf0013
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|1800799024|366016|376014|38070700018;
X-Microsoft-Antispam-Message-Info-Original:
 =?iso-8859-1?Q?PDpGGbNtbF1lvtN8cowRiyNUAWxiqKZR/fzZQlzehiyb1CYpYvjgbt5dKs?=
 =?iso-8859-1?Q?dliRHlWjLz3rPG+/G8m8j02jJ5rAH51WxsID7BswGwrDZtV1RzRkfOAkcZ?=
 =?iso-8859-1?Q?Npm0XE5r7eZ3yenaqrOOEX72IBL8lVZZgdjFzMh/1422NqEWvnmQ1SvmXj?=
 =?iso-8859-1?Q?WzgbstfKdADGu+J+jGvzFGZXe01fIucQ+Ab1XwTFURW5VnjvnjT2NTRAxg?=
 =?iso-8859-1?Q?98LOWULvPl1Oo416EKXsV5xZ1mkwIuQDIW1XG2jNtW7Q0ZRxUGmqtruoOA?=
 =?iso-8859-1?Q?Rz3Z7SSBHjI/dUCd2zkzrGWeGZ8jIUuK8jdULuXD9lguCcWxA2/baHHsqq?=
 =?iso-8859-1?Q?fhMqmJFMd6GYhGK7ltMC7OHUBB3BmBb2WnINTgB3qh+Otaq7iulop7lZZx?=
 =?iso-8859-1?Q?AnfQf/4dVuu5LTA//Et1cR22ViaUC1fuSwVZa8/WAkc5Y3oIAizie3PFwF?=
 =?iso-8859-1?Q?pXODu3yhlztRchaHSz+jfUMpCse/UYPvjScBZFMISKVW9zpHfBNNJu9wdu?=
 =?iso-8859-1?Q?A6zgefhGfsucV/Jk//SyTBE+2dhGwPJejVzuqBKJR7TrdJBMFTW3jXcDqB?=
 =?iso-8859-1?Q?bWSpKHefNxJB18Stk9cUM29Q6HUwgATBRXGi++QckkTlHgWjdlH6WBNhWB?=
 =?iso-8859-1?Q?URZUsL7e6g0MWzA7KZfqzr/SwZ3lc+RSNosFvFMDo8DP4k6W9rzrXreY5S?=
 =?iso-8859-1?Q?TrM/xMZTxXOkN6sPnbcmRxKy8u0/KQsfn7QAZVi8brdF+LK8aF7EIkp684?=
 =?iso-8859-1?Q?FdkRS4WOxF5LqNEgjiV3RCgseCKwAyzrJW6gD/9MW24GAQ6/H6O+aA2Rfy?=
 =?iso-8859-1?Q?cYyvMgvbNrO6gpb/dBuQpctGVQA45Muc0wK9qvtOQYD2JleMv+oQO6F712?=
 =?iso-8859-1?Q?ipWZM2uXHxP+NAv67reWm4gPvLZ/RQCgG192gFEg5RFJl76XMrb8MYTPfp?=
 =?iso-8859-1?Q?vDe4qOsWqk4F1XeYj7zVHe9F4JkyNTd4lpTJ0fDC//2sCnoZqcwOZE7O+q?=
 =?iso-8859-1?Q?TqqeH27qe5GKvIRnmwXaBgmIdOjPq3JxnAWTHv6P5u3RFi2o1HjJvIN0rK?=
 =?iso-8859-1?Q?coo3/Ft8roBfHry9D0AKcdwAyjXhAQZ+WOmQkyj8+YqXjQ0ocOP9BrMPvh?=
 =?iso-8859-1?Q?QrewTqB125JDEPj7MYTO8d9G0N5wmpCs5rwpWc361yYKwSfz+Bxjg3ncSw?=
 =?iso-8859-1?Q?2/SfFkdyWvvCy/Cwkah+VUCcuWiu7iVPEvZZ9a6k24PGLTrfRL2UaBLM51?=
 =?iso-8859-1?Q?H6UJba/GAH1b1KHAA9AVzpjvg+4kPE3Us/37+S60e8GpkbGlWuiNsq3cdm?=
 =?iso-8859-1?Q?x32mmJAtsVVjEx+TfYPZ1x9iR1qtbcVlXxRA2rkuvv9HA8nrLsfO25Zm7J?=
 =?iso-8859-1?Q?6nsVobUG/Xdir8+pvhjbSkfZvFczpWzRu8lwtoArKswF8xaSWC9TM=3D?=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR08MB6588.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(38070700018);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="iso-8859-1"
Content-ID: <A7525115D3DC3D4F9B61BD52405CCA6F@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR08MB11150
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-SkipListedInternetSender:
 ip=[2603:10a6:10:25a::24];domain=DB9PR08MB6588.eurprd08.prod.outlook.com
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DU2PEPF0001E9C0.eurprd03.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	992630af-7059-47bf-7461-08dcb2befa83
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|35042699022|82310400026|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?iso-8859-1?Q?VTW0t7YOp312SRDuIUdeJUWhGCdNRRGJi/eRhsKENTBhFrmRNbzKn8Kzxd?=
 =?iso-8859-1?Q?a/KBvEuBU4Ovg3NZvn0cRY5W9107CFx3LUhR83D/xa/5jlYsKsFPxofMZ0?=
 =?iso-8859-1?Q?sd9cXRDtm6WSMQ3T+XoHlEE8waEF/fl863lbF1+xFHLpYww0iUJKt2+j5+?=
 =?iso-8859-1?Q?B4UDAhtnpBG72X4BT9/CO/UwiLy/SP3ExvG90X775EyNpMQ7NkywRMw0gh?=
 =?iso-8859-1?Q?Z9fxoNXoAGQGFuw6QlJLyoBRbYecY0NBddvFJOtIVsCibdEncUFeGlbLvc?=
 =?iso-8859-1?Q?N/MbsWqFy07OmCAbFn0a4lHfWVtGWqjFD4HGkWuoxZ1TaCllcm7rLFDR0i?=
 =?iso-8859-1?Q?GfsEi1kdZllSf4eujsjrwIQa5cIvCKHwixiP/sKNV+tOSafkDyX5GyvAyA?=
 =?iso-8859-1?Q?AeN9usNXjQQMhbzjzUtVEd3F07lC9H3QrTKwdH8iemDhShbNXo7J1/Rfgk?=
 =?iso-8859-1?Q?Xlbq7adw5MIOo1LgpvNBzmuzHsGeBjcF9xdnyBC/Rcb4w9qoSClW/wHuRl?=
 =?iso-8859-1?Q?KTL4i5CZEJ9N5d87tZQ74LQg8dikB/ZXEtW+92VTzVB/B/aPP+vGNTjrTh?=
 =?iso-8859-1?Q?tgu/l17rmJwI8BDPuVqJ5O8BuvzjP5q44IxOEwVnQCObpJ3CiStv+T3yts?=
 =?iso-8859-1?Q?51WKCFD3dSsekaKY0/GSUpzg3n5t7sUj15qr8DJy736KlL7/AMbtQlcz/b?=
 =?iso-8859-1?Q?/+RWMSkIAZYalXQWJDmZ2RC5R8Y5GQ05lhzEEDvlUm2JqQJFUSP7kFOa59?=
 =?iso-8859-1?Q?w/Q+3wqi3Z94U0eendOTU8SPTg0WsvADY5MhKF1NMGgljkSeiaIQWorwvA?=
 =?iso-8859-1?Q?4wXr7Q/DuwRDceu6xs0zK8DJs7xW+9brcaJNHRcLFBv1YT/+OlGqhiGtCX?=
 =?iso-8859-1?Q?uOlk8FLbTOwkE8AiYAcRnBgC/5r+b+m9xhIoQsPIt+MMl+f57V+fLGzGEe?=
 =?iso-8859-1?Q?Wlu2znLOIiboBllyaCNR5ku1idvub8AE27Ej5TZKOu9w1zPEHkfOR8Zm+3?=
 =?iso-8859-1?Q?HKoahewY3EZWdeHe4tDzai5tEnJmrdcU+oX4hPTZL3Nn3A9vaWrTAMEQCP?=
 =?iso-8859-1?Q?d3Bygrmq0AM9SJpZx+awwZHWhjyTaZuppH1XI7L1+0SuIYBM1iAUo56MC3?=
 =?iso-8859-1?Q?+StDPV6cplNnpuVCr+qLT9HfZ5XfPrf86feIIZsjyWbS0ek/0DK2m3S8Az?=
 =?iso-8859-1?Q?k2Ebz1dR4IVhKWWnyjAQwGDqqEsaHk2/mv206e+CEpmgJqA8n4uw/tJFsU?=
 =?iso-8859-1?Q?Alx7ZEZvLcWEJudxDCAAykl8cIo5fg9QoYOcOK6tWvVMpm6EHalr9uiT39?=
 =?iso-8859-1?Q?RZG0YaIHQbvc1ZdpenHy+QH/apK+P/xZQ47bnO/jsUC7f80J5le4/CPOxe?=
 =?iso-8859-1?Q?Zm/kYCu+YZ+7KQKDn+E2KHhth6DkF0G+cYXhXHPhSiUwDUxsSXm2SyB3BK?=
 =?iso-8859-1?Q?IGDt2u6XmFOwxmWOwp0isQQEa35YRE0vMOyX8Q=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230040)(36860700013)(35042699022)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 06:47:38.9548
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 0f16f0a0-77e6-45da-9391-08dcb2bf0013
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DU2PEPF0001E9C0.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB10988

Hi Stefano,

> On 1 Aug 2024, at 21:19, Stefano Stabellini <sstabellini@kernel.org> wrot=
e:
>=20
> Add MISRA C rules 13.2 and 18.2 to rules.rst. Both rules have zero
> violations reported by Eclair but they have some cautions. We accept
> both rules and for now we'll enable scanning for them in Eclair but only
> violations will cause the Gitlab CI job to fail (cautions will not.)
>=20
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand


> ---
> Changes in v3:
> - improve notes
> Changes in v2:
> - clarify that new code is expected to follow the rule
> ---
> docs/misra/rules.rst | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>=20
> diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
> index 7b366edb07..e99cb81089 100644
> --- a/docs/misra/rules.rst
> +++ b/docs/misra/rules.rst
> @@ -462,6 +462,16 @@ maintainers if you want to suggest a change.
>      - Initializer lists shall not contain persistent side effects
>      -
>=20
> +   * - `Rule 13.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example=
-Suite/-/blob/master/R_13_02.c>`_
> +     - Required
> +     - The value of an expression and its persistent side-effects shall
> +       be the same under all permitted evaluation orders
> +     - Be aware that the static analysis tool Eclair might report
> +       several findings for Rule 13.2 of type "caution". These are
> +       instances where Eclair is unable to verify that the code is valid
> +       in regard to Rule 13.2. Caution reports might not be violations.
> +       The rule should be followed in any case in new code submitted.
> +
>    * - `Rule 13.6 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-=
Suite/-/blob/master/R_13_06.c>`_
>      - Required
>      - The operand of the sizeof operator shall not contain any
> @@ -583,6 +593,16 @@ maintainers if you want to suggest a change.
>        submitting new patches please try to decrease the number of
>        violations when possible.
>=20
> +   * - `Rule 18.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example=
-Suite/-/blob/master/R_18_02.c>`_
> +     - Required
> +     - Subtraction between pointers shall only be applied to pointers
> +       that address elements of the same array
> +     - Be aware that the static analysis tool Eclair might report
> +       several findings for Rule 18.2 of type "caution". These are
> +       instances where Eclair is unable to verify that the code is valid
> +       in regard to Rule 18.2. Caution reports might not be violations.
> +       The rule should be followed in any case in new code submitted.
> +
>    * - `Rule 18.3 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-=
Suite/-/blob/master/R_18_03.c>`_
>      - Required
>      - The relational operators > >=3D < and <=3D shall not be applied to=
 objects of pointer type except where they point into the same object
> --=20
> 2.25.1
>=20



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 06:50:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 06:50:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770204.1181140 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZm7K-0005FM-BW; Fri, 02 Aug 2024 06:50:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770204.1181140; Fri, 02 Aug 2024 06:50:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZm7K-0005FF-8H; Fri, 02 Aug 2024 06:50:22 +0000
Received: by outflank-mailman (input) for mailman id 770204;
 Fri, 02 Aug 2024 06:50:21 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0M7b=PB=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1sZm7J-0005F8-3p
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 06:50:21 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 (mail-dbaeur03on20600.outbound.protection.outlook.com
 [2a01:111:f403:260d::600])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7b2554ac-509b-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 08:50:19 +0200 (CEST)
Received: from AM9P250CA0006.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:21c::11)
 by GV2PR08MB8123.eurprd08.prod.outlook.com (2603:10a6:150:78::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23; Fri, 2 Aug
 2024 06:50:16 +0000
Received: from AMS0EPF00000192.eurprd05.prod.outlook.com
 (2603:10a6:20b:21c:cafe::e9) by AM9P250CA0006.outlook.office365.com
 (2603:10a6:20b:21c::11) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend
 Transport; Fri, 2 Aug 2024 06:50:15 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AMS0EPF00000192.mail.protection.outlook.com (10.167.16.218) with
 Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7828.19
 via Frontend Transport; Fri, 2 Aug 2024 06:50:15 +0000
Received: ("Tessian outbound ca8e5f27f95f:v365");
 Fri, 02 Aug 2024 06:50:14 +0000
Received: from L54c7aa3e0c7c.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 F169BDBE-0E18-446D-AC6C-10C6D8EC219E.1; 
 Fri, 02 Aug 2024 06:50:08 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id
 L54c7aa3e0c7c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 02 Aug 2024 06:50:08 +0000
Received: from DB9PR08MB6588.eurprd08.prod.outlook.com (2603:10a6:10:25a::24)
 by AS8PR08MB7918.eurprd08.prod.outlook.com (2603:10a6:20b:539::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Fri, 2 Aug
 2024 06:50:06 +0000
Received: from DB9PR08MB6588.eurprd08.prod.outlook.com
 ([fe80::a8fc:ea0d:baf1:23a]) by DB9PR08MB6588.eurprd08.prod.outlook.com
 ([fe80::a8fc:ea0d:baf1:23a%3]) with mapi id 15.20.7828.023; Fri, 2 Aug 2024
 06:50:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7b2554ac-509b-11ef-8776-851b0ebba9a2
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=xP+8sAaX/1tOJIxmCZNsh5YOsNanOWBvSCwkqfxya5+YoF3J4Lz0wh02LUj3OIZQz5iaKE5TtOct06RJEro/5aHcATSC2pgrBo/HMCt7Jjl8LMSJcvRJhQCEWhmDl42L+ENcImuax55VfC6ezlkNEPMHeLel2JRaGCUq66NeWj7HMmDArVn6DOsxVjQPz0QDqq8qds4A8ZvFf49tzpdrLCEOVCJ7rZbl/1l+5PEIvceFacO+UC3OtvqWGmcbbMXVAe+JdPO5M1peLZZ6bPKD1ginHjdqFej1rWN7nhtyHwo5C2uFNaKehjXgLoidE7g+wT09hp3SeNRDxXK4sqMPVA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=W974462qlr+13/yGCFc1g0TBYCavo5uct3zZg86InZk=;
 b=ttthh5JWsAT8P2iUzMfpFIUJUdcXG7Oi42ZRtZBjbMfw2XpLze0bUV2wAhPQzy9Fa+z5FUSXTQkBEoPnBaRegae4zY1msbs2Z8GM8yjPLQr3rV+9+TyxjTmw+rzKC7AKG1XcLsG+9eoMbjj5LSgZIKOwyrIrkgZSPK0BTbZyJrjuCfaALjR1Lk8tZhk9e/PGTaYDDOClyeYRl9ipyGbc7h/VpbrZWN6iDPmSi/7jrQW6axAzdlqnjPTpB/3psTbxC/CljIww+1kvMYSgMwd6a+ZLRgF606gr3pgtVmzd+OwaHtisg7rA3zQdA/3Z4J7Wrx99rEJ2nuDTTaQRxiZYbg==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com;
 dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com;
 dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=W974462qlr+13/yGCFc1g0TBYCavo5uct3zZg86InZk=;
 b=R+FEYKoUS8aQRty1/NGJI0vOdvKaOt+MYOPn2ktvseGgddUcM57WMXdl4s+oq8jblrJu5PglqGDpPAG2zw4+E8LvXf0H5hmacOEzqk7cA730m9a1j78r0loxrADo1/EsH1mnXeNlze0olwYt1BcCHjkKtar+rABMWT/pyq/aJyc=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: cae9b2a675ca3886
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=WNYwoqS+rSiv/82DkAjCjo91Hwp3/cZLgvh4dXS6vuhVRAbRMRIprD2VRhEz6VwdS5xgl88eWPB4GJpvy/ETpUv/Pl39XrkomXKlfEKbQ+EfzPM7hdmUTpKU+Xbjq9vILb2VSBA8mzeHZha3vy9VsZq73ORJeclTNatieqXm1jk5ZAgpPFjPzvnw2Qm14FKnRstz+U3XidEyH/UtPZHG0EX7LT7Ri2DJdyxdy6aHe28ueqZJBjxlyJp05mSpuGW8GXgmbyW/bJFzN4d201A+ze6huKQfLnhTSEUyvZeNNu7uR2mlSOl6JMm/GkJc9Yi1fdiwskmovqpPeNWVT6OhkQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=W974462qlr+13/yGCFc1g0TBYCavo5uct3zZg86InZk=;
 b=iZgLKTTwIK3MIG8V232cncEMqXuwSLXZeFe6nmCsgtJu+70Go05SVoSaAq0/5Hca+QLb6HUHhsRq+4lwPmklNsYUbAkU73wq8SVeHFph+FlaDbu+lKp893B079TtPko0unZclazSdYV5s1JOm9eIZg/TP60IuPvqKp1iLkvya9nx8AmI/+L2lUE30095yw4gWcvelz+sIlkXuv1CZpTjOZidWkl33sZL+8efrp8EQRhg9mWU19XVjTvemrBQr4sRmFp/RA74iQAL8HvdadMrIcClsvBTky4jCVVWLTLv7lIbY20LF4JN/WEgdUjmwZJd9m2lallbg/JDYmvF6yb5Uw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=W974462qlr+13/yGCFc1g0TBYCavo5uct3zZg86InZk=;
 b=R+FEYKoUS8aQRty1/NGJI0vOdvKaOt+MYOPn2ktvseGgddUcM57WMXdl4s+oq8jblrJu5PglqGDpPAG2zw4+E8LvXf0H5hmacOEzqk7cA730m9a1j78r0loxrADo1/EsH1mnXeNlze0olwYt1BcCHjkKtar+rABMWT/pyq/aJyc=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Stefano Stabellini <sstabellini@kernel.org>
CC: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, Michal Orzel
	<michal.orzel@amd.com>, "artem_mygaiev@epam.com" <artem_mygaiev@epam.com>,
	Julien Grall <julien@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH 1/2] docs: Introduce Fusa Requirement and define
 maintainers
Thread-Topic: [PATCH 1/2] docs: Introduce Fusa Requirement and define
 maintainers
Thread-Index: AQHa42fbGCmFAEygKEmXqoJI7sDdCrIRgPiAgAIIlYA=
Date: Fri, 2 Aug 2024 06:50:06 +0000
Message-ID: <3BD6C548-242D-4DF3-92B0-9B02019A2830@arm.com>
References: <20240731163614.616162-1-ayan.kumar.halder@amd.com>
 <20240731163614.616162-2-ayan.kumar.halder@amd.com>
 <alpine.DEB.2.22.394.2407311517480.4857@ubuntu-linux-20-04-desktop>
In-Reply-To:
 <alpine.DEB.2.22.394.2407311517480.4857@ubuntu-linux-20-04-desktop>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3774.600.62)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	DB9PR08MB6588:EE_|AS8PR08MB7918:EE_|AMS0EPF00000192:EE_|GV2PR08MB8123:EE_
X-MS-Office365-Filtering-Correlation-Id: eb7f4409-e969-460c-b4e6-08dcb2bf5d56
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|376014|366016|1800799024|38070700018;
X-Microsoft-Antispam-Message-Info-Original:
 =?us-ascii?Q?LUbOHw9dDRWo6Sg7tm7nTKX3hX0FGSpj5IOfq8uScruev97ZY0fZcu+6yuL+?=
 =?us-ascii?Q?F4SThSE/davn7PtgyYhRJaHhb5S4Mgihzg0yX9rLHAGlMudmwQo6GoKwZooN?=
 =?us-ascii?Q?iuPHneH9X6rXLw1Vf9l6/KOzTm//ifDvMD0yfLxzmQiRGk6rsnAuGwHP3CG9?=
 =?us-ascii?Q?PPVNy6YocPXuQT1+ejdIXBWBq5n5xpQuAusb6lcjEekpZnD4aKYJ3kFa+TXS?=
 =?us-ascii?Q?2pJTqfax6yiS3++y+2HRmiv2foqzHTFT+9LQkmSl1tytDo62Q54uc+7asjq+?=
 =?us-ascii?Q?fTNqjfgckKZMGakJSTv+HXXmjDNRYjMjJbLCTkSPtxtz4COrkB7Hy+vMcljw?=
 =?us-ascii?Q?dA5iIFTvE1Em7KCuAWxR8rAM94peh+7smng0n/QvppvN0g1io3Gnj3aqXgg6?=
 =?us-ascii?Q?3h72Hx6Rro3XzszrsqydlMswRs1QSzQOn7r30XUu1od+xDua/tdJXHg7vlRq?=
 =?us-ascii?Q?mQ4BPupZ6OOgsWQI9c3Sh/JGov2PZ6NS0aP2zh441XHha+NNyM3jIv81SFDY?=
 =?us-ascii?Q?cAPoVLpiBJixdKgcAhs1L3PYSYcTskoiVwzA4o0BogbMh2yQ60XPB2cMdzaS?=
 =?us-ascii?Q?FiiIhnfly0pZ0+X/fheo3MaDsf+5FHkDrHLFP0k3cRqwS9N3Hyr6NY5Vz6yu?=
 =?us-ascii?Q?QBJNV0SRtSt5iG6kai4yNGzPGqDExu1YyRfjV6c7UVNB+tdklUZraFqMi14I?=
 =?us-ascii?Q?2uibIOS+X44jzwhQxBMgQ29X+PSyg7P1uvmr1eF9aX6NtGhXEyUA+K0SUH7z?=
 =?us-ascii?Q?Bu2gG9D6KCeNKHSCxRHEf/8gc4Mr/D8VdIDw2y/r85TkCJhWxvqTFZBJ84kw?=
 =?us-ascii?Q?PCYJ13/Vu6WDN3Y4Wkc1UidLhTFe+9U2hLF19fX7R3M/x3WN5YICI7pQ4++J?=
 =?us-ascii?Q?cBiFzgq5Y01xCoFzQtU4w/MEnJ8OPSuXLxjFungcePfsEdcQQ2fM2LGh1fxt?=
 =?us-ascii?Q?BkKSPZs23l22YpQcxsdqT6i7CXUf77bAWj9A3AfCkV1+IuGRStCw7XTXjonW?=
 =?us-ascii?Q?5bZWMtSc1EvqKaRooTeBg1lgwIRmW9M6eFVbR1//HhLVWHffsF1SE1mRV87T?=
 =?us-ascii?Q?KsMyfZ19pv7AUBfieSgO0+JOfViN7hbATQBoTx397EeVArTrQiI/RFOQBN49?=
 =?us-ascii?Q?FgMK8/mJbt/W0RJDnOqsbPxQnFedfGJFzD3koEvNlVlANBcyJ+p+tzetIm4H?=
 =?us-ascii?Q?7ljNLqYgbiUBdXxbShWjthjzZJU8b90DPF/pzKoeR4HRlJZM7Iyjw4PpLvqq?=
 =?us-ascii?Q?t8fxPmZa8B7UcJVqbeJqvG0l6b3+Elf/GXXpuiFI3rQbk3lJAPCIUWjE5rrE?=
 =?us-ascii?Q?jp/9+sv3d4dsnpNeA0akRoDAVmaWZGc3uF0Npqui99ECy/OxkU7L5o2f+8NY?=
 =?us-ascii?Q?5pHGZRGziqT/D1DO16jui4M29zWs7sJtN8RNNR6zQZHimCQIJA=3D=3D?=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR08MB6588.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(38070700018);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <9125E7D5C079E94683C122EB4BF8CA16@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7918
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-SkipListedInternetSender:
 ip=[2603:10a6:10:25a::24];domain=DB9PR08MB6588.eurprd08.prod.outlook.com
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AMS0EPF00000192.eurprd05.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	b2212d8b-70fa-4c82-f825-08dcb2bf57d2
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024|35042699022;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?8PHWsVO5++8aK8m1JHZO22eObt/pLvNLvjtAvHe2Cn74IuJrImHzOhE4NC7l?=
 =?us-ascii?Q?pe1Ia7ZnqFm8l0+ewkpufbg2L+vEejL/aISatv4+1poT9hI2aEaxrjubL+gS?=
 =?us-ascii?Q?fS2hP3V4+acr5o141SgKyWYfkw7oG1Kn9Vd3wz3t8btziZHwDkRZT5m6EgYS?=
 =?us-ascii?Q?Na6I7IvLTWgpi3wa7PY7YyixklM0CNk+Fw/D68UF6yeMmaNynAj4+b8VDCpb?=
 =?us-ascii?Q?QgivzaFz1R+u4WmI1ssgNjkp02uvuaoHTSXqvgDdh7Bvay3nodkrY1GRTWWy?=
 =?us-ascii?Q?hAnjnH56cln3fhK8Pid+p0RJ5PwmOVrXPkWPyBHPSCOE3rWhtkZ35s9A8z7M?=
 =?us-ascii?Q?pgW8q2Ic7Sip9QRRtzbv3UJNAlsTVGxCuIDU5IdSNAkufJVmRvFev/en1zFu?=
 =?us-ascii?Q?ychWZD48zoPMqb7SHvHaeTJOGACvUvAiVhu4rG6M4nqlA/MrgrXUMJYhPcjJ?=
 =?us-ascii?Q?ZVQEdKT6Z7PgmmZxTHAKwU0U1cdJxTs77p0c1lnGQEudvp1HPYmIuwTQyaFp?=
 =?us-ascii?Q?u7zzAiOVFh5qRYO9paE0gTh54Jb9oUDlCle3ELUKEJ4+mKewizuH4arFK1Ya?=
 =?us-ascii?Q?Ggh1+i2yFwcFXYMbOO9bAxno0m4idPkWnODAUNi3ROwK+Fo/UzgEGhnM4n2q?=
 =?us-ascii?Q?DiameRduRdBUpQtbsQSVjbge7e8+WbPi8Bcn3slLoopUA1b4nOKDENq3M/FI?=
 =?us-ascii?Q?X6zr8xiOAZ0WnUqtLUIqZVDH/TzvNdgVFCOuwqRA77EkL7xE6n5Ar7DBSKSR?=
 =?us-ascii?Q?cak+w7ZTMkraVquTLAPodswYQtrMZz7V/0Y8S20WycZ8iGoUrphpLYO/HMC9?=
 =?us-ascii?Q?3HnyR7lDXfdH+bKKXxn77nC38BKJuTYe9FCtOITqrpLZfk+HRIo8yv43dcbr?=
 =?us-ascii?Q?WV61G4C8kUmIt1zLTtHhVOT99JvCJrzhprjfHQp7xcv1u/1z8bdhCXHDK6ok?=
 =?us-ascii?Q?EOrswj+k9Z+VAxN2zV45Meubb8yJzbtkU9Qwq0yGVQVZMKOLDhNFo7YUc+AE?=
 =?us-ascii?Q?QZveGTGG/Nw1s1uGc9b1aeu4/ZePwwroYF32Xiqt9AC0lm0stpBWV9+hk2pf?=
 =?us-ascii?Q?/temRGSLEyCrFiDuTAuprYLpO0Bp9o+3/1QQtg56khGkULShrcFqS17KTKF5?=
 =?us-ascii?Q?LM2monu4oSNd51pqrrfDosEdnGox/EH1GXsTnOptZvxcqI39g/iunXNlsZ4a?=
 =?us-ascii?Q?B60d6rKpSX+0i1hVXJoNgUBLQJipIh2zumrpv6gxzhhvJHgq/XPiSXK9ayQP?=
 =?us-ascii?Q?nSCd4LxPNDyjTgp6w8UwqeETFcy0dcSzDYvLZzkl1I7j9l9rlntu291uqeaC?=
 =?us-ascii?Q?+hQkLN3lzgR8aLim/ehWZz2OZMOXMwNyEZ9w3aW7owd09H8Cwov+D3/SKqJF?=
 =?us-ascii?Q?TSk4qnqdZTF9nAWIAQHlf82IBE5dZ2gn2Vv2eTq1G9rYa36YEXIRpzgaCX07?=
 =?us-ascii?Q?lqnWAphwGZlDTCQCFtvLPY/ftIwByz2i?=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024)(35042699022);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 06:50:15.2822
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: eb7f4409-e969-460c-b4e6-08dcb2bf5d56
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AMS0EPF00000192.eurprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8123

Hi Ayan,


> On 1 Aug 2024, at 01:46, Stefano Stabellini <sstabellini@kernel.org> wrot=
e:
>=20
> On Wed, 31 Jul 2024, Ayan Kumar Halder wrote:
>> The FUSA folder is expected to contain requirements and other documents
>> to enable safety certification of Xen hypervisor.
>> Added a README to explain how the requirements are categorized, written
>> and their supported status.
>>=20
>> Added maintainers for the same.

I think this is a good start and we will revisit the details along the way.

>>=20
>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>

With the comment from Stefano handled:
Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 07:26:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 07:26:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770219.1181166 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZmgZ-000394-AA; Fri, 02 Aug 2024 07:26:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770219.1181166; Fri, 02 Aug 2024 07:26:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZmgZ-00038x-7U; Fri, 02 Aug 2024 07:26:47 +0000
Received: by outflank-mailman (input) for mailman id 770219;
 Fri, 02 Aug 2024 07:26:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZmgY-00038n-NW; Fri, 02 Aug 2024 07:26:46 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZmgY-00079r-Ik; Fri, 02 Aug 2024 07:26:46 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZmgY-00074c-6D; Fri, 02 Aug 2024 07:26:46 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZmgY-0001j6-5n; Fri, 02 Aug 2024 07:26:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=OwyzZFW2Paq2UVE7OyM/LqC+iv2FKS9XXAjPtr3Kk9M=; b=UF7Wxk5toLysmqYU1a7aCHDPcz
	TJN5oRZOjCaUejMyz6o8OiiX2Nw1U/wvhJN1TVao26cvUIYycshb8idxWXQ9etTemakZZOAi0XPF+
	yeNLr52OOWLvMRDsTAmWOOxORRHkhYbVT4SpZYp82qJxncYDfM7CUIHuhvviGeTgq90I=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187117-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187117: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=87d3a6272ca8637787813256c1a2435e89e326e2
X-Osstest-Versions-That:
    ovmf=bbee1cc852fa8676ed0b530b1c67c92f32f4f740
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 02 Aug 2024 07:26:46 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 87d3a6272ca8637787813256c1a2435e89e326e2
baseline version:
 ovmf                 bbee1cc852fa8676ed0b530b1c67c92f32f4f740

Last test of basis   187114  2024-08-01 21:42:13 Z    0 days
Testing same since   187117  2024-08-02 05:43:32 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jiaxin Wu <jiaxin.wu@intel.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   bbee1cc852..87d3a6272c  87d3a6272ca8637787813256c1a2435e89e326e2 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 07:29:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 07:29:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770227.1181175 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZmj9-0003iP-Ny; Fri, 02 Aug 2024 07:29:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770227.1181175; Fri, 02 Aug 2024 07:29:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZmj9-0003iI-LH; Fri, 02 Aug 2024 07:29:27 +0000
Received: by outflank-mailman (input) for mailman id 770227;
 Fri, 02 Aug 2024 07:29:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4koO=PB=yahoo.com=avikalpa@srs-se1.protection.inumbo.net>)
 id 1sZmj7-0003iA-Qo
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 07:29:26 +0000
Received: from sonic302-19.consmr.mail.sg3.yahoo.com
 (sonic302-19.consmr.mail.sg3.yahoo.com [106.10.242.139])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ee1a556d-50a0-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 09:29:24 +0200 (CEST)
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic302.consmr.mail.sg3.yahoo.com with HTTP; Fri, 2 Aug 2024 07:29:16 +0000
Received: by hermes--production-bf1-774ddfff8-46ck7 (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID 22e68a62375d431a6c60c9207cc618d3; 
 Fri, 02 Aug 2024 07:29:11 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ee1a556d-50a0-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1722583756; bh=eMvvhr2emu9Yi2Wwmr5B0PnMbjsUolUEcbRDdgYkuQg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=jjCLNffA8LuoDc9KzT+j+j9CVg54X9Koc8T+CukjMEnOsVPruCxJnn7Hu7dAAJeT+Sxbw+BjbmpDnJnu72ff/ocrKdKkzY+6qeFxcw+jEsfmSoL1fzScZn+Tc7oLizraPGnUMEPaKwzLPONap1XFz5af6KGuiLsZllZ2odVr8khWNFXHJImVz7hDpcbjVecUm0tRN7BYoFPdkQSZH4A9mTh/S1lCCMGyqbCu8X+lFGFS9Xr0VIMy2pDGUZfHCcPYFqOH/wGPjbG0O5dqm94D2CtrwOzexA1yrhT/3NTwy0R1imUp1DEv4EtN3Ny5gBGES1qwbYPgMrzNM8LCMZAL4g==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1722583756; bh=pzE2CCxU5D+pPlP4vAc/N7qGFOrF+HOqIyN9LdX6bdD=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=h6M7ivYMB3vIpPMotnLUefDvjVty9d43PWA7U6ZwIUwoHVLadStiaVMKDwiHFaDbnBO7m0s4ljg4Z9YLANBjlrOUzvbkH0YFYjaF1Y6GieY/cZSuvAlA4k5sBvYWXLwiDucH/WEE+3AAq0VqUEf3GRcXLqpiv7qekfitlA698obSce8O/T4YYolKX2mOjaTal5ItBxDsixyxDHevUcMXIY7FDe5nicgVgSISwnGCUBp4wFqgqr0uusxnfKSd6Jp2oN2noqdXfzr1BIU0s/0+JwygbjcI1N1mHQIMW8dwJqmuSnEUfSbWPufGv8RbFHLPUGXhPuQBbZNOBNBwt3JPPg==
X-YMail-OSG: GNqsGbgVM1lrTBY45WvWWrGr.ZkaUcUMygavkHdDkBa9ss1FoYLso63gqjP81gg
 5ngMlNJ5AYjg5gY6RD6DtKvHkfs.2Rcb_lIy2s9gL9nL.MWOoCMjL45vsWPyjZXh7LT9xHmhdl5K
 xf5_goepg5zLlmgMjZnXI4fFolWeyMOaQyRo_hSSG3pbAcnm.uzff0XoXGo2dbgQx0_Z0rvD.YvC
 GVlHiyjc95VHVTxMBc4xE0xSa6rABXehEs6xwIsKGxUwiUthy3qAK_NL1A19ctvr0QreomKnrvoJ
 x8s1ViT9TRC0JErdc9UvsgDhtfTVkjjpxp5GCLw6kaGveIBQEywDt8h3oBG0m8u4Y72d3p5smvOb
 nW8SQB2acdxMvmELXPvw.55SmfJVWXK8JlKsIP_cLoThDdiQAWy8lko7QfVlZ_wVQkmnNsiTfZ1e
 44EY0dMT4ggW5Q2g3CDJaPcMIui5b1b1F0eC8CUzsmTv.h5eJn5NMatnuh9LpD7GTFcWrkzPeTDl
 s1in0IKSaEY4jd0ZwqUoUGNBv5RgJEARacog6LEyzFHzw7B513UGlWOwa4VCPceW4OGMnI4SJeAe
 Wx2D5SiDtj62KNCwoBc5taH0N4c05YB9VUmo5S.LLwUsvIi4QtRkrF7mHSO_cvPwLgU_1IE4W8e0
 RVn9f0WPOY.5XaMf_29kzrQjNQ2kEWtAiKqFS4x8a3NExX5T9cFqIPtnGvvWkgZKb_MJyHLhR6z9
 PVkt5NUg9AJaVyE6D29t3znLTp0_oJJzdCquWpNflqLJqg5ZF3DpFKPd0.zbYzNQvMzJRVQTvrt5
 _qVSXgajUBy.47TZmNwTkFxkg1lF3y4pL1rBNYVKJaOCR5X8.Mjoqg5b1pFhw4Kv8h_EfKTBOC7i
 0WLpAliEL14l.Panx3mSeiGNLXch3Gk7hV7cZSLv9au9xD1sxzFrPKt3MnASzGvKVy9uQT.t9wil
 GTB0Rp58qX8xSkbqGdL0tWbK6a6wAkb1LgNDtC2.rK105B5YSu8JlS6BT0NRMeMJ1Y_WVQS5d6a4
 10kawxudl9YH5Y2.1O8xTJ_Ipyy0jLs3MW5D4z_tllwoTqN3jqdK172N__ae0sQO8QPfcV7BJWQe
 arTVozGq1UL9Q2.iYjWGkn_kZcRoLWwA4qLKKtE3oczXkryZb3Bera3vXuq3sMssD0GAF8v39i4I
 5VfwoHcPeu5YPMpAXOrXlRSAZpl7BnPvafnncdGtejuXEIVgP5p3DqX5JYxT5KSLrAnHaoRIUSDM
 eicGG2Qgd1KEnc2nNIlwfmhMuGun_dzaffJi4RDKOvw6ijiOOrTTS0ig2jZpOkvR20dVwPrpBE9c
 iUw8SlS5KRbiVuTy3ICLw0.arRGtAfo2Lfx9Yg1pRpfiNd9Ji7HDzmD7XTlIpthHGeVJqm7.JirH
 3aJnAef8eLlu8htF5y9jMTTL0Knt1C8Tzf4C2PYIoGs4nE2jaIEmU.mSTXo2_zYVLQWOulC.hxbW
 DN36gNzvbSanKL99Jz3zPBOXFGU8h4yzSM2VAL0NJoj22JaULJ8LlyLtAva7lGIJl1vrO5zWZJpq
 DrUJy6xY2oNfSMhVZiCZEhJeQKiUkN8RKokuTi1bKaOqp_tWVX7NGhJCJftdYiFQHuyTJqo0vfLH
 1Cy_3BmxyxheDU1aL9Ak_kAeWVXHpHYihflYmkYySYfmPGr5YVc1nUzxbHW9FNDvnuOr1FSI6LIw
 6JvzeuC0oaNn6U9Gw7bPpgWFpue62k.0bhdx6UBFnAaqAxux0DP5SWK6eqoFwbOpv3ETMiziVbmB
 oZAzhUujdXC67uF3rf35cpf4MEcmkJvX6M.8jNa.2PkP90s.Z6et2WKbdM7qo9XH2d1xa6.hIqYd
 GxlNqknVZ_fED0bGwIvakSk2aj13EeR35N_GEyf8HPV0lJO3GLjNH0bwr4PDGrulXl8R2U0lJ6C3
 RUViADy.3_3h.BnFt0NEVj9Hj8LMKl4dUwxPKTqEnW_rwTKOA1o3m.txbZ6JftgmAmlPD8ZwBYXf
 nZBa9p5rx_2c0ghbhFudsbZU7V4o_Pv2NfkmvVRAdntV0m1Gwg_ZxcUDMuMPiNUW0jDDSB_SVktV
 iEk1KHKicSyabK0IoiDHGp52c7nvbZobHnZNATTsX6DtaNlsjvxIK_1JpQq0w7eUD1ULuzXT9Gno
 l3yh_R02IO8mmqauc0lGCLeQxeBgOYDqBApkgsanlHT_ce_3j6clhFuon6PhMisWq8_6usXw-
X-Sonic-MF: <avikalpa@yahoo.com>
X-Sonic-ID: 0d0771c0-fd8a-4579-a947-07309565edcd
Message-ID: <abaceb99-4b80-49d7-ab7f-b190f73e858d@yahoo.com>
Date: Fri, 2 Aug 2024 12:58:51 +0530
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: kexec failure with Xen 4.19-rc4 and 4.20-dev on linux host
To: Baoquan He <bhe@redhat.com>
Cc: kexec@lists.infradead.org, horms@verge.net.au,
 xen-devel@lists.xenproject.org
References: <05395ed2-3bf3-4926-8e24-c2e7ff37ed26@yahoo.com>
 <cebc7800-df78-4f90-9f8e-82e3f9120b6e@yahoo.com>
 <ZqxUMgcEHakeFPaU@MiWiFi-R3L-srv>
Content-Language: en-US
From: A Kundu <avikalpa@yahoo.com>
In-Reply-To: <ZqxUMgcEHakeFPaU@MiWiFi-R3L-srv>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Mailer: WebService/1.1.22544 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 2155

Done.


On 8/2/24 09:06, Baoquan He wrote:
> On 07/31/24 at 06:34pm, A Kundu wrote:
>> I am experiencing issues using kexec to load Xen 4.17(debian's apt version),
>> Xen 4.19-rc4 (compiled from source) and 4.20-dev (compiled from source) on a
>> debian host.
> You should CC this to XEN dev list so that XEN dev knows this and may
> provide help. Not everyone is interested in and knows XEN.
>
>> System information:
>> $ uname -a
>> Linux host 6.9.10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.9.10-1 (2024-07-19)
>> x86_64 GNU/Linux
>>
>> $ kexec --version # compiled from source tarball with ./configure --with-xen
>> kexec-tools 2.0.29
>>
>> Steps to reproduce:
>>
>> 1. Set variables:
>>
>> XEN_HYPERVISOR="/boot/xen.gz"
>> XEN_CMD="dom0_mem=6G dom0_max_vcpus=6 dom0_vcpus_pin cpufreq=xen"
>>
>> 2. Attempt to load Xen 4.19-rc4:
>>
>> # kexec -l "$XEN_HYPERVISOR" --command-line="$XEN_CMD"
>> Could not find a free area of memory of 0x3b6001 bytes...
>> elf_exec_build_load_relocatable: ELF exec load failed
>>
>> 3. Attempt to load Xen 4.20-dev:
>>
>> # kexec -l "$XEN_HYPERVISOR" --command-line="$XEN_CMD"
>> Could not find a free area of memory of 0x3f8001 bytes...
>> elf_exec_build_load_relocatable: ELF exec load failed
>>
>> 4. Attempt to load Xen 4.17 (from debian rrepositories):
>> # kexec -l /boot/xen-4.17-amd64.gz --command-line="$XEN_CMD"
>> Could not find a free area of memory of 0x3b4001 bytes...
>> elf_exec_build_load_relocatable: ELF exec load failed
>>
>> If you need any further information to investigate this problem,
>> please let me know.
>>
>> PS: If I used apt's pacakged version (which might be compiled
>> --without-xen),
>> it shows,
>>
>> # kexec -l "$XEN_HYPERVISOR" --command-line="$XEN_CMD"
>> Cannot determine the file type of /boot/xen-4.17-amd64.gz
>>
>> # kexec -l "$XEN_HYPERVISOR" --command-line="$XEN_CMD" --type=bzImage
>> Cannot determine the file type of /boot/xen-4.17-amd64.gz
>>
>>
>> Thank you for your attention to this matter.
>>
>> A Kundu
>>
>> _______________________________________________
>> kexec mailing list
>> kexec@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/kexec
>>


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 07:41:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 07:41:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770237.1181186 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZmuz-0006eG-QH; Fri, 02 Aug 2024 07:41:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770237.1181186; Fri, 02 Aug 2024 07:41:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZmuz-0006e9-ND; Fri, 02 Aug 2024 07:41:41 +0000
Received: by outflank-mailman (input) for mailman id 770237;
 Fri, 02 Aug 2024 07:41:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=uPwv=PB=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1sZmuy-0006e3-3Z
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 07:41:40 +0000
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on20610.outbound.protection.outlook.com
 [2a01:111:f400:7e88::610])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a5bcc48a-50a2-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 09:41:38 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by DS0PR12MB9398.namprd12.prod.outlook.com (2603:10b6:8:1b3::19) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21; Fri, 2 Aug
 2024 07:41:34 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285%3]) with mapi id 15.20.7828.021; Fri, 2 Aug 2024
 07:41:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a5bcc48a-50a2-11ef-bc03-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ybHqIo17bqX4FGMXw1/DV2sEAtsvMS30+yP7WS+SBYHG/NgKm/8rosEkFAYZBz1lZ0B+XosvOHWp0DXed6ze87YA/hupiHIrIB4ZsUpX0Kx/QxicdxHfGq+LYr++IDWHWUn06mmLKa4zixJFrTqv4TgukiPrbfmrC0AAGLNIOnWhe8UjNnm0WcvOtdQTx/gm6fr6u3kE96P0oFrJ+zLAwQYrg4/PRSsKQXsQpSGcV7kiFR6W0BF4b213hX4a5qyVYB5wbAPcBZCZw5G7l5UCo37yqwnPEWRnlEOL36Q+/oGoEkZhqrJ0J5FqABLfZsXbVGF8x9gvMpI4pNznRaYBXQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7fH+k3BwtF+xYtPMPC2aM8D/eHY94ssqbSslGrN+Keg=;
 b=sOUvU9J1FWRDMvSbKif1d3z6qnnLdJdIOEuM/d3eEWVHdgmzyZy2cSLVlQPcVJGLdmYif5xUljud8T+2B1Srj0OmhrZOJJiRcssbcNTOI0sgjS5rGS0d70/WaHo1LWprNAX+b9G2xUTOznL7FqissjGnMfDbFWmun/88NHA5I1Vo5fOdj+/AbS4r51wLSReryddPhYSJ1HWSo5FITS33pHFcu7CPmRBx9vUB8LpSbm2v7O7WjbHREOTg1LjtSqCdeB/V73X+pj4gTQ8eLQU9z5uyc2K399QNvb8oRM3ED0xs6FWlYGqsaW0vaLZzoClsjudWugnOdj0RY+QVyhdHtw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7fH+k3BwtF+xYtPMPC2aM8D/eHY94ssqbSslGrN+Keg=;
 b=JxE2LLn08QOaQQt95dpjiPKbmiJqSj1PUMiTEgMk5S1ykbPM/3p8lvYBG6Q9kReaJCYvrJdBRguji5/GEKxmPqH4KXRCj1ciMn4xzg0MpX68TLSdr2unPhDUNDkkBL4qFILAgnwsbEluKK32x8HwwBKjACPRb1ODId+JY1V0/WA=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: Jan Beulich <jbeulich@suse.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>, George Dunlap
	<gwd@xenproject.org>, Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, Juergen
 Gross <jgross@suse.com>, "Daniel P . Smith" <dpsmith@apertussolutions.com>,
	"Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>, "Huang, Ray"
	<Ray.Huang@amd.com>, =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?=
	<roger.pau@citrix.com>, "Chen, Jiqian" <Jiqian.Chen@amd.com>
Subject: Re: [XEN PATCH v12 1/7] xen/pci: Add hypercall to support reset of
 pcidev
Thread-Topic: [XEN PATCH v12 1/7] xen/pci: Add hypercall to support reset of
 pcidev
Thread-Index: AQHa0SvTLcqHcyv10kCa3wxjMJYih7IRIeaAgALMIQD//7lNAIAAmdOA
Date: Fri, 2 Aug 2024 07:41:34 +0000
Message-ID:
 <BL1PR12MB5849038C59C54C9FC8FD8048E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-2-Jiqian.Chen@amd.com> <ZqpeiWhuqPXiTeRZ@macbook>
 <BL1PR12MB5849CFC87F0DB92864B54BE4E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
 <1ca7e6a2-698d-4548-9959-fd88126c25e1@suse.com>
In-Reply-To: <1ca7e6a2-698d-4548-9959-fd88126c25e1@suse.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: BL1PR12MB5849.namprd12.prod.outlook.com
 (15.20.7828.000)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|DS0PR12MB9398:EE_
x-ms-office365-filtering-correlation-id: 3760aa4b-233d-472e-f2e6-08dcb2c6887b
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|7416014|376014|1800799024|366016|38070700018;
x-microsoft-antispam-message-info:
 =?utf-8?B?K1FrVERnWDhTVlQvWHRsWlBENCtTZFZnRG1JQnJHR0phQncvdU42TW9mVXlp?=
 =?utf-8?B?UWFwczRxd3dPRnFEOXVtSUhSSkk3NGtnSW1PdXIxSlVUTXI4YUk5bGxTK0Yw?=
 =?utf-8?B?TVllZHhSdDZveUIxM0Z0blJxRW5SWmtESUZpVTVLRlc5WE56cy9OamJLaGhE?=
 =?utf-8?B?SEtUUmgxTVl2RlE5SlVWeHZyd3h5bnFTVWQ5NDVLUGpNclkvMmdLNUxDbWZQ?=
 =?utf-8?B?QXpOd3JZQW9BNUdsNyt6dEh5cTZmMExjeEJJMGNCdHZsak9sQWZSL2h2QnZV?=
 =?utf-8?B?TzdYMlNiRzlKcTRxMkg4ZVhER2p4aFYyRjFaS2d6N2pEaUNmbnlPcHdLajdi?=
 =?utf-8?B?TEhWMkFlbEZ6RDVyczFaSkhrdDVKTVhYdmdKZEJBWlh1OW9MUGNIOU13R1lr?=
 =?utf-8?B?Z2VJU2l6TCtIWWNYY3czV2tOWFZhRDBLSWlPN2RYODBUOEZpMkN2b1hlbHdi?=
 =?utf-8?B?cmxXK2NnREdXQTdlSnVmcXlRZXBqY2g1K0x5Y1Mzc2FRTWRpK1VFdGkybkZH?=
 =?utf-8?B?bWlXWmdmY0k5VVo4MDhxNWZoWkw0a2F2SERzTitWbXFHSWs3eTFsWmNhR0p3?=
 =?utf-8?B?dDRpUFdvZzdQVEZ4MDB6ZDRjZlRPRWdRWm1TQWtqMVgwOU85YTExdlB1dkRu?=
 =?utf-8?B?TEQ4SzRxbkJzRFZIVWdNQkRhbWVmMnpsdkdVbHF4YmZuOGlKVjArRWhiWXRD?=
 =?utf-8?B?aXgzUG81dkNQVXMya3ZQMDFBeVNtMkVFSnY1V1JJcmQ2aDg2ZDV3a3NZOTVG?=
 =?utf-8?B?ZjRlZGxpMXJ1cEgrVWYrcVBEc05EaGJKaUJTaldJamJYNE50cVVTSlVhVVpr?=
 =?utf-8?B?cC9RQzVtVGZZYnFMWnRwRTlYTEFqZGpPV05rakZ5OXJIMGp1TlBGaklySjN2?=
 =?utf-8?B?c0RQRVVIZ2d5ckRzVkV1WExWMTJvcVRxTUVjeWhxK2lyZmo0T09wMS9BVmhv?=
 =?utf-8?B?R05kd21tM3lST2JaUFNUakp3bXdoVXg4RERZL1o1aDZXcStTMVJQcFd3VGZH?=
 =?utf-8?B?aGF4VHA4ZjBHKzgxM2JJaGpZT0hIaWxwM0dXYjdyQ0ZXbCtIbXY2dlU2OUFE?=
 =?utf-8?B?VCtPWndncHVhQzBKRXFsVFVCUTZqcnVxOEp5MlRQWVZuWmxXT0d0UTRlQXpE?=
 =?utf-8?B?TFpNRWVWcFhXbGJMdjE5R21VNTFmdUhTVGM0RHBLR2V4YnJtN1I5b3hzckM0?=
 =?utf-8?B?K1JyU2J5MFhRZzBXSGk5MkJOS1M0VkNTMTNNSkpZN3B3bDZVV2VJRTdBUnBD?=
 =?utf-8?B?REM1MXl1V1hEbVZiZ0VZTkl6KzNUNDg4eUMrYkNlVTNxcFo4VjRNMlJ4L2Ir?=
 =?utf-8?B?RFJidmV0cXlVb2NtM1MrT2ZJS0J6bHYrVFRXQU84ZGVhazRJMzhyUHcxYUo2?=
 =?utf-8?B?OGxCMzFlSHhCcnlSWEZtcjcrZi9USEpuNUo2bUt4blBjTUQ5aDNPT3pMczhz?=
 =?utf-8?B?aTVERnlwbEhaeDkyME5HSjJRYW55WFFFWEJGcVovK29ZNng2ZG1sN0ZWSjRy?=
 =?utf-8?B?amEycnJhUzhCMG0xdkhCdkRheks1K0xqZVpxdHJ3d0NOU0ZXY1RFSDdJUXBY?=
 =?utf-8?B?UWRoOElNWW12WVFIMTVNeVI3dDY4YVNzaDArNFlMN2xOQldtcENmLzNERjc4?=
 =?utf-8?B?alVqSkhuU05UVmFkcTBlV29TVzVGN3pDSjhNU2tiMHhVSWZvL0I3bGlQSWNw?=
 =?utf-8?B?cUkvUVUxcDBTaVdkSE9WZW5jWnU5ZEgxRUZVdVJGbngwQndCNlRqeHhPN1pT?=
 =?utf-8?B?RjRxMU5XYllSajNrWDd1NERDK3RSK2p1dGp0Q3pwTmN1RjNNemVqS2Vzd1h1?=
 =?utf-8?B?NjVGeWJiWGc5SFBXZ1M2QXZ2WXRHWTgyczFLOGVIaFk0am5YMVNaQk1KdEta?=
 =?utf-8?B?Qm9vc241em93MzZ2dGtydk14bng3R081MmhucStMNW1KVEE9PQ==?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?VHA3REZVaGJtUzExSTI2VUt1TlFidjlzOVpza0pudzY4MzFkYlZzQ2dSTWow?=
 =?utf-8?B?MWRkSDBrQWRwVE9xT2JLN3BGZGlrNFlQcEpBTEtkek5Wd0pMY3J3WDZ3azd3?=
 =?utf-8?B?R0g5RlFjdzZkYXdaNG5ZWmRLZGRXNTYxMUVha20weHQwUE1tTTNZMk9lN1NL?=
 =?utf-8?B?bkgvRXhjN0NWOHNMMlhKU2pMQ1BINWdFeDduZjUwM3hvcWprUWdLRXhjN2Jv?=
 =?utf-8?B?OE9FSHBoSkwyUXJLK3Ztd0RpdzI2cm1FN1N5bVMwTDVqenpUeUpHS1hlNXVE?=
 =?utf-8?B?bzB5OVFNaEkrUTA5czU5UWpLdGxRNk9rOVg0dnZZS2dKRDROSFAvUlRKQ3ll?=
 =?utf-8?B?cjE3WHZSb09LY3JqK3FTVExnb0kySjcwcThiWXpLaytMd1E0RnlPNExOa2o2?=
 =?utf-8?B?Rm9BaTJ0SDE1SGNEMU9SY24wbi93R3hvWEwrL0RsZG12MCtDNkpJMGZ1dEZN?=
 =?utf-8?B?N0djNFpVekt5NDIzSW9ncVI0S0xlaUNUWTk1M083S0NxSnJVRk5HemMrTkJy?=
 =?utf-8?B?SG1zVk9jL1pEbExaL2RxYklBYkU4K1UvMi9OWUNtVmVWZk14UCt1Z1NQenU4?=
 =?utf-8?B?OW1pS0lZMmlRTFY2YU94SHRZSEpMMW56SGkrQ256bjRvWXBveVlFclBsODZi?=
 =?utf-8?B?S2FvNGJRVVAyZk5HQVNRVGFqNzRSUDMrOEIyeFphSStsRHdod1MrQjFDY2JD?=
 =?utf-8?B?NkpRenN3QUU4UEd1QjR0WGR5SGhYeTNrOHJlNDNoR1ZBVWRVdExxZFZ3Uzdt?=
 =?utf-8?B?ZVArb3ZVQ2VhSmh3SkJHMWc3OFJVczgrRjB4V0hUQTNWcEJlMHVjeHE0bURj?=
 =?utf-8?B?REVoa1d3R2Nsa1V6UVh5Vll5cUFDbFRLdVZKV1YzSTlNQXpydEJsdjIvelJD?=
 =?utf-8?B?RzhjSEhGLzBQVVNkb3JaWjVOMFBNQkpXQmEwUXl0OURaWkR1TjZIRk5BSVJY?=
 =?utf-8?B?dFFEZXJTSmQ0blNwYnNoRXF6SXp3NjhxUnU2WW5vckUvTUZCUEg2Z0FqOEZS?=
 =?utf-8?B?cG5zaFNSWm9CamRIMzJXdlRIc0pEREpHMVNEWkI3am5WRGJpVjFxSHJRKzVw?=
 =?utf-8?B?TlBSb0NNUE1PZEZQQzFSZGJhMGdWMjRVWGVDd05NNGxIV3drU01tNGNXeEo0?=
 =?utf-8?B?TXpBYlFTdHBhaFlrZEcrZHNVMGF1Vy8vNWh1cEVoZWZzMW94Vlh3U1lwdktz?=
 =?utf-8?B?Z1lwYm1kL0lGUUlBRWhtbzRZQUlZd1hNNTJtZ0NHRGVxMllsRnY0aUkxK1NQ?=
 =?utf-8?B?ajVhZHdvWVRacmg3QmdheW9JRVd3OVhMM1RrM0JCanhNaGZUYnAzNEdKaGh3?=
 =?utf-8?B?UHRjbHN6a1o4SFozNHN4elJqcmhSSVpDMmFvTERoYSttZnl1N0tGSlk1dWJC?=
 =?utf-8?B?b0FSd1g0eUNwTUUyMTk1SEp3c3drTTRhN3pyMmFSQ2dPT0FFMWdZMmQwbmJ4?=
 =?utf-8?B?TjRQenhRK3phTlcralgrVDhFaitGc1ZnUUlPYmpTc3hRTVorVC9zWnNueVhr?=
 =?utf-8?B?b1B0eWQwcnE0dWIwOG5XVUVGM0Z1L0Jud3k3aDBzcVI2bm4vMUFJcFYvNklB?=
 =?utf-8?B?YmwraGp1ZjFOT2pzeWhkWmFPNEdiR093YzhrSGx2ekNQZXhRcElTZVFDdVZp?=
 =?utf-8?B?S0RQSW5PUTdQZHU5MXpXWnJxSTVzSk5adWZpdllPb2wxS2RyZ2xRcFhKYUlq?=
 =?utf-8?B?bTVhZGR0QXdEeDlWb24yUUVJODVjZGlibm44Rm0yWFBWS2FSbmEyRWJiWnla?=
 =?utf-8?B?b28xNUlrMkJmTTVXM3Z2MS9yZE5nbTNWUEtoTWF0R0JBY2xCS2g1RXdoMkdG?=
 =?utf-8?B?ZXBCUmowQXdXN1F2MGhFZHc3VXNxN2tRaTNZQVQwYjFBaW5JNmVYZ0VNdE9D?=
 =?utf-8?B?Z3lLenpaei9QRG52VklBQXptMUFSM2gvdi9qMkxGRG43bEZGKzVZZEtMWU12?=
 =?utf-8?B?YTlOL1pKeTBqWDZPMWU1S1pCZ0J0eU1vZXI4c3daT2lKcXdCU0dkeG9zTkJS?=
 =?utf-8?B?ZE9IZkRURnJjdlZ2REpTT053SDVlZ0RYcy9ZOU5QTjJjZDh1bTFpblNMbEpk?=
 =?utf-8?B?ZlJIRjZnd1Y1czhMNlVEOUp0eXVFMFZYejAyYnk0cFFzQWlzeXdVRGNtV01C?=
 =?utf-8?Q?qwxo=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <CB50FFE7182C144F91F753FACDAF212B@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3760aa4b-233d-472e-f2e6-08dcb2c6887b
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2024 07:41:34.2615
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: G3a2RqYmXAqM8tWTw3U5OZToGQ+w3Kr21AESOXU2gGfOJMn0yiLbLRjKmCUMg3G2scNlFSUzShcLm4wx2dkXcQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9398

T24gMjAyNC84LzIgMTQ6MjUsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAwMi4wOC4yMDI0IDA0
OjU1LCBDaGVuLCBKaXFpYW4gd3JvdGU6DQo+PiBPbiAyMDI0LzcvMzEgMjM6NTUsIFJvZ2VyIFBh
dSBNb25uw6kgd3JvdGU6DQo+Pj4gT24gTW9uLCBKdWwgMDgsIDIwMjQgYXQgMDc6NDE6MThQTSAr
MDgwMCwgSmlxaWFuIENoZW4gd3JvdGU6DQo+Pj4+IFdoZW4gYSBkZXZpY2UgaGFzIGJlZW4gcmVz
ZXQgb24gZG9tMCBzaWRlLCB0aGUgWGVuIGh5cGVydmlzb3INCj4+Pj4gZG9lc24ndCBnZXQgbm90
aWZpY2F0aW9uLCBzbyB0aGUgY2FjaGVkIHN0YXRlIGluIHZwY2kgaXMgYWxsDQo+Pj4+IG91dCBv
ZiBkYXRlIGNvbXBhcmUgd2l0aCB0aGUgcmVhbCBkZXZpY2Ugc3RhdGUuDQo+Pj4+DQo+Pj4+IFRv
IHNvbHZlIHRoYXQgcHJvYmxlbSwgYWRkIGEgbmV3IGh5cGVyY2FsbCB0byBzdXBwb3J0IHRoZSBy
ZXNldA0KPj4+PiBvZiBwY2lkZXYgYW5kIGNsZWFyIHRoZSB2cGNpIHN0YXRlIG9mIGRldmljZS4g
U28gdGhhdCBvbmNlIHRoZQ0KPj4+PiBzdGF0ZSBvZiBkZXZpY2UgaXMgcmVzZXQgb24gZG9tMCBz
aWRlLCBkb20wIGNhbiBjYWxsIHRoaXMNCj4+Pj4gaHlwZXJjYWxsIHRvIG5vdGlmeSBoeXBlcnZp
c29yLg0KPj4+Pg0KPj4+PiBTaWduZWQtb2ZmLWJ5OiBKaXFpYW4gQ2hlbiA8SmlxaWFuLkNoZW5A
YW1kLmNvbT4NCj4+Pj4gU2lnbmVkLW9mZi1ieTogSHVhbmcgUnVpIDxyYXkuaHVhbmdAYW1kLmNv
bT4NCj4+Pj4gU2lnbmVkLW9mZi1ieTogSmlxaWFuIENoZW4gPEppcWlhbi5DaGVuQGFtZC5jb20+
DQo+Pj4+IFJldmlld2VkLWJ5OiBTdGV3YXJ0IEhpbGRlYnJhbmQgPHN0ZXdhcnQuaGlsZGVicmFu
ZEBhbWQuY29tPg0KPj4+PiBSZXZpZXdlZC1ieTogU3RlZmFubyBTdGFiZWxsaW5pIDxzc3RhYmVs
bGluaUBrZXJuZWwub3JnPg0KPj4+DQo+Pj4gVGhhbmtzLCBqdXN0IGEgY291cGxlIG9mIG5pdHMu
DQo+Pj4NCj4+PiBUaGlzIGlzIG1pc3NpbmcgYSBjaGFuZ2Vsb2cgYmV0d2VlbiB2ZXJzaW9ucywg
YW5kIEkgaGF2ZW4ndCBiZWVuDQo+Pj4gZm9sbG93aW5nIGFsbCB0aGUgdmVyc2lvbnMsIHNvIHNv
bWUgb2YgbXkgcXVlc3Rpb25zIG1pZ2h0IGhhdmUgYmVlbg0KPj4+IGFuc3dlcmVkIGluIHByZXZp
b3VzIHJldmlzaW9ucy4NCj4+IFNvcnJ5LCBJIHdpbGwgYWRkIGNoYW5nZWxvZ3MgaGVyZSBpbiBu
ZXh0IHZlcnNpb24uDQo+Pg0KPj4+DQo+Pj4+IC0tLQ0KPj4+PiAgeGVuL2FyY2gveDg2L2h2bS9o
eXBlcmNhbGwuYyB8ICAxICsNCj4+Pj4gIHhlbi9kcml2ZXJzL3BjaS9waHlzZGV2LmMgICAgfCA1
MiArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysNCj4+Pj4gIHhlbi9kcml2ZXJz
L3ZwY2kvdnBjaS5jICAgICAgfCAxMCArKysrKysrDQo+Pj4+ICB4ZW4vaW5jbHVkZS9wdWJsaWMv
cGh5c2Rldi5oIHwgMTYgKysrKysrKysrKysNCj4+Pj4gIHhlbi9pbmNsdWRlL3hlbi92cGNpLmgg
ICAgICAgfCAgOCArKysrKysNCj4+Pj4gIDUgZmlsZXMgY2hhbmdlZCwgODcgaW5zZXJ0aW9ucygr
KQ0KPj4+Pg0KPj4+PiBkaWZmIC0tZ2l0IGEveGVuL2FyY2gveDg2L2h2bS9oeXBlcmNhbGwuYyBi
L3hlbi9hcmNoL3g4Ni9odm0vaHlwZXJjYWxsLmMNCj4+Pj4gaW5kZXggN2ZiMzEzNmYwYzdjLi4w
ZmFiNjcwYTQ4NzEgMTAwNjQ0DQo+Pj4+IC0tLSBhL3hlbi9hcmNoL3g4Ni9odm0vaHlwZXJjYWxs
LmMNCj4+Pj4gKysrIGIveGVuL2FyY2gveDg2L2h2bS9oeXBlcmNhbGwuYw0KPj4+PiBAQCAtODMs
NiArODMsNyBAQCBsb25nIGh2bV9waHlzZGV2X29wKGludCBjbWQsIFhFTl9HVUVTVF9IQU5ETEVf
UEFSQU0odm9pZCkgYXJnKQ0KPj4+PiAgICAgIGNhc2UgUEhZU0RFVk9QX3BjaV9tbWNmZ19yZXNl
cnZlZDoNCj4+Pj4gICAgICBjYXNlIFBIWVNERVZPUF9wY2lfZGV2aWNlX2FkZDoNCj4+Pj4gICAg
ICBjYXNlIFBIWVNERVZPUF9wY2lfZGV2aWNlX3JlbW92ZToNCj4+Pj4gKyAgICBjYXNlIFBIWVNE
RVZPUF9wY2lfZGV2aWNlX3N0YXRlX3Jlc2V0Og0KPj4+PiAgICAgIGNhc2UgUEhZU0RFVk9QX2Ri
Z3Bfb3A6DQo+Pj4+ICAgICAgICAgIGlmICggIWlzX2hhcmR3YXJlX2RvbWFpbihjdXJyZCkgKQ0K
Pj4+PiAgICAgICAgICAgICAgcmV0dXJuIC1FTk9TWVM7DQo+Pj4+IGRpZmYgLS1naXQgYS94ZW4v
ZHJpdmVycy9wY2kvcGh5c2Rldi5jIGIveGVuL2RyaXZlcnMvcGNpL3BoeXNkZXYuYw0KPj4+PiBp
bmRleCA0MmRiM2U2ZDEzM2MuLmMwZjQ3OTQ1ZDk1NSAxMDA2NDQNCj4+Pj4gLS0tIGEveGVuL2Ry
aXZlcnMvcGNpL3BoeXNkZXYuYw0KPj4+PiArKysgYi94ZW4vZHJpdmVycy9wY2kvcGh5c2Rldi5j
DQo+Pj4+IEBAIC0yLDYgKzIsNyBAQA0KPj4+PiAgI2luY2x1ZGUgPHhlbi9ndWVzdF9hY2Nlc3Mu
aD4NCj4+Pj4gICNpbmNsdWRlIDx4ZW4vaHlwZXJjYWxsLmg+DQo+Pj4+ICAjaW5jbHVkZSA8eGVu
L2luaXQuaD4NCj4+Pj4gKyNpbmNsdWRlIDx4ZW4vdnBjaS5oPg0KPj4+PiAgDQo+Pj4+ICAjaWZu
ZGVmIENPTVBBVA0KPj4+PiAgdHlwZWRlZiBsb25nIHJldF90Ow0KPj4+PiBAQCAtNjcsNiArNjgs
NTcgQEAgcmV0X3QgcGNpX3BoeXNkZXZfb3AoaW50IGNtZCwgWEVOX0dVRVNUX0hBTkRMRV9QQVJB
TSh2b2lkKSBhcmcpDQo+Pj4+ICAgICAgICAgIGJyZWFrOw0KPj4+PiAgICAgIH0NCj4+Pj4gIA0K
Pj4+PiArICAgIGNhc2UgUEhZU0RFVk9QX3BjaV9kZXZpY2Vfc3RhdGVfcmVzZXQ6DQo+Pj4+ICsg
ICAgew0KPj4+PiArICAgICAgICBzdHJ1Y3QgcGNpX2RldmljZV9zdGF0ZV9yZXNldCBkZXZfcmVz
ZXQ7DQo+Pj4+ICsgICAgICAgIHN0cnVjdCBwY2lfZGV2ICpwZGV2Ow0KPj4+PiArICAgICAgICBw
Y2lfc2JkZl90IHNiZGY7DQo+Pj4+ICsNCj4+Pj4gKyAgICAgICAgcmV0ID0gLUVPUE5PVFNVUFA7
DQo+Pj4+ICsgICAgICAgIGlmICggIWlzX3BjaV9wYXNzdGhyb3VnaF9lbmFibGVkKCkgKQ0KPj4+
PiArICAgICAgICAgICAgYnJlYWs7DQo+Pj4+ICsNCj4+Pj4gKyAgICAgICAgcmV0ID0gLUVGQVVM
VDsNCj4+Pj4gKyAgICAgICAgaWYgKCBjb3B5X2Zyb21fZ3Vlc3QoJmRldl9yZXNldCwgYXJnLCAx
KSAhPSAwICkNCj4+Pj4gKyAgICAgICAgICAgIGJyZWFrOw0KPj4+PiArDQo+Pj4+ICsgICAgICAg
IHNiZGYgPSBQQ0lfU0JERihkZXZfcmVzZXQuZGV2LnNlZywNCj4+Pj4gKyAgICAgICAgICAgICAg
ICAgICAgICAgIGRldl9yZXNldC5kZXYuYnVzLA0KPj4+PiArICAgICAgICAgICAgICAgICAgICAg
ICAgZGV2X3Jlc2V0LmRldi5kZXZmbik7DQo+Pj4+ICsNCj4+Pj4gKyAgICAgICAgcmV0ID0geHNt
X3Jlc291cmNlX3NldHVwX3BjaShYU01fUFJJViwgc2JkZi5zYmRmKTsNCj4+Pj4gKyAgICAgICAg
aWYgKCByZXQgKQ0KPj4+PiArICAgICAgICAgICAgYnJlYWs7DQo+Pj4+ICsNCj4+Pj4gKyAgICAg
ICAgcGNpZGV2c19sb2NrKCk7DQo+Pj4+ICsgICAgICAgIHBkZXYgPSBwY2lfZ2V0X3BkZXYoTlVM
TCwgc2JkZik7DQo+Pj4+ICsgICAgICAgIGlmICggIXBkZXYgKQ0KPj4+PiArICAgICAgICB7DQo+
Pj4+ICsgICAgICAgICAgICBwY2lkZXZzX3VubG9jaygpOw0KPj4+PiArICAgICAgICAgICAgcmV0
ID0gLUVOT0RFVjsNCj4+Pj4gKyAgICAgICAgICAgIGJyZWFrOw0KPj4+PiArICAgICAgICB9DQo+
Pj4+ICsNCj4+Pj4gKyAgICAgICAgd3JpdGVfbG9jaygmcGRldi0+ZG9tYWluLT5wY2lfbG9jayk7
DQo+Pj4+ICsgICAgICAgIHBjaWRldnNfdW5sb2NrKCk7DQo+Pj4+ICsgICAgICAgIHN3aXRjaCAo
IGRldl9yZXNldC5yZXNldF90eXBlICkNCj4+Pj4gKyAgICAgICAgew0KPj4+PiArICAgICAgICBj
YXNlIFBDSV9ERVZJQ0VfU1RBVEVfUkVTRVRfQ09MRDoNCj4+Pj4gKyAgICAgICAgY2FzZSBQQ0lf
REVWSUNFX1NUQVRFX1JFU0VUX1dBUk06DQo+Pj4+ICsgICAgICAgIGNhc2UgUENJX0RFVklDRV9T
VEFURV9SRVNFVF9IT1Q6DQo+Pj4+ICsgICAgICAgIGNhc2UgUENJX0RFVklDRV9TVEFURV9SRVNF
VF9GTFI6DQo+Pj4+ICsgICAgICAgICAgICByZXQgPSB2cGNpX3Jlc2V0X2RldmljZV9zdGF0ZShw
ZGV2LCBkZXZfcmVzZXQucmVzZXRfdHlwZSk7DQo+Pj4+ICsgICAgICAgICAgICBicmVhazsNCj4+
Pj4gKw0KPj4+PiArICAgICAgICBkZWZhdWx0Og0KPj4+PiArICAgICAgICAgICAgcmV0ID0gLUVP
UE5PVFNVUFA7DQo+Pj4+ICsgICAgICAgICAgICBicmVhazsNCj4+Pj4gKyAgICAgICAgfQ0KPj4+
PiArICAgICAgICB3cml0ZV91bmxvY2soJnBkZXYtPmRvbWFpbi0+cGNpX2xvY2spOw0KPj4+PiAr
DQo+Pj4+ICsgICAgICAgIGJyZWFrOw0KPj4+PiArICAgIH0NCj4+Pj4gKw0KPj4+PiAgICAgIGRl
ZmF1bHQ6DQo+Pj4+ICAgICAgICAgIHJldCA9IC1FTk9TWVM7DQo+Pj4+ICAgICAgICAgIGJyZWFr
Ow0KPj4+PiBkaWZmIC0tZ2l0IGEveGVuL2RyaXZlcnMvdnBjaS92cGNpLmMgYi94ZW4vZHJpdmVy
cy92cGNpL3ZwY2kuYw0KPj4+PiBpbmRleCAxZTZhYTVkNzk5YjkuLjdlOTE0ZDFlZmY5ZiAxMDA2
NDQNCj4+Pj4gLS0tIGEveGVuL2RyaXZlcnMvdnBjaS92cGNpLmMNCj4+Pj4gKysrIGIveGVuL2Ry
aXZlcnMvdnBjaS92cGNpLmMNCj4+Pj4gQEAgLTE3Miw2ICsxNzIsMTYgQEAgaW50IHZwY2lfYXNz
aWduX2RldmljZShzdHJ1Y3QgcGNpX2RldiAqcGRldikNCj4+Pj4gIA0KPj4+PiAgICAgIHJldHVy
biByYzsNCj4+Pj4gIH0NCj4+Pj4gKw0KPj4+PiAraW50IHZwY2lfcmVzZXRfZGV2aWNlX3N0YXRl
KHN0cnVjdCBwY2lfZGV2ICpwZGV2LA0KPj4+PiArICAgICAgICAgICAgICAgICAgICAgICAgICAg
IHVpbnQzMl90IHJlc2V0X3R5cGUpDQo+Pj4NCj4+PiBUaGVyZSdzIHByb2JhYmx5IG5vIHVzZSBp
biBwYXNzaW5nIHJlc2V0X3R5cGUgdG8NCj4+PiB2cGNpX3Jlc2V0X2RldmljZV9zdGF0ZSgpIGlm
IGl0J3MgaWdub3JlZD8NCj4+Pg0KPj4+PiArew0KPj4+PiArICAgIEFTU0VSVChyd19pc193cml0
ZV9sb2NrZWQoJnBkZXYtPmRvbWFpbi0+cGNpX2xvY2spKTsNCj4+Pj4gKw0KPj4+PiArICAgIHZw
Y2lfZGVhc3NpZ25fZGV2aWNlKHBkZXYpOw0KPj4+PiArICAgIHJldHVybiB2cGNpX2Fzc2lnbl9k
ZXZpY2UocGRldik7DQo+Pj4+ICt9DQo+Pj4+ICsNCj4+Pj4gICNlbmRpZiAvKiBfX1hFTl9fICov
DQo+Pj4+ICANCj4+Pj4gIHN0YXRpYyBpbnQgdnBjaV9yZWdpc3Rlcl9jbXAoY29uc3Qgc3RydWN0
IHZwY2lfcmVnaXN0ZXIgKnIxLA0KPj4+PiBkaWZmIC0tZ2l0IGEveGVuL2luY2x1ZGUvcHVibGlj
L3BoeXNkZXYuaCBiL3hlbi9pbmNsdWRlL3B1YmxpYy9waHlzZGV2LmgNCj4+Pj4gaW5kZXggZjBj
MGQ0NzI3YzBiLi4zY2ZkZTNmZDIzODkgMTAwNjQ0DQo+Pj4+IC0tLSBhL3hlbi9pbmNsdWRlL3B1
YmxpYy9waHlzZGV2LmgNCj4+Pj4gKysrIGIveGVuL2luY2x1ZGUvcHVibGljL3BoeXNkZXYuaA0K
Pj4+PiBAQCAtMjk2LDYgKzI5NiwxMyBAQCBERUZJTkVfWEVOX0dVRVNUX0hBTkRMRShwaHlzZGV2
X3BjaV9kZXZpY2VfYWRkX3QpOw0KPj4+PiAgICovDQo+Pj4+ICAjZGVmaW5lIFBIWVNERVZPUF9w
cmVwYXJlX21zaXggICAgICAgICAgMzANCj4+Pj4gICNkZWZpbmUgUEhZU0RFVk9QX3JlbGVhc2Vf
bXNpeCAgICAgICAgICAzMQ0KPj4+PiArLyoNCj4+Pj4gKyAqIE5vdGlmeSB0aGUgaHlwZXJ2aXNv
ciB0aGF0IGEgUENJIGRldmljZSBoYXMgYmVlbiByZXNldCwgc28gdGhhdCBhbnkNCj4+Pj4gKyAq
IGludGVybmFsbHkgY2FjaGVkIHN0YXRlIGlzIHJlZ2VuZXJhdGVkLiAgU2hvdWxkIGJlIGNhbGxl
ZCBhZnRlciBhbnkNCj4+Pj4gKyAqIGRldmljZSByZXNldCBwZXJmb3JtZWQgYnkgdGhlIGhhcmR3
YXJlIGRvbWFpbi4NCj4+Pj4gKyAqLw0KPj4+PiArI2RlZmluZSBQSFlTREVWT1BfcGNpX2Rldmlj
ZV9zdGF0ZV9yZXNldCAzMg0KPj4+PiArDQo+Pj4+ICBzdHJ1Y3QgcGh5c2Rldl9wY2lfZGV2aWNl
IHsNCj4+Pj4gICAgICAvKiBJTiAqLw0KPj4+PiAgICAgIHVpbnQxNl90IHNlZzsNCj4+Pj4gQEAg
LTMwNSw2ICszMTIsMTUgQEAgc3RydWN0IHBoeXNkZXZfcGNpX2RldmljZSB7DQo+Pj4+ICB0eXBl
ZGVmIHN0cnVjdCBwaHlzZGV2X3BjaV9kZXZpY2UgcGh5c2Rldl9wY2lfZGV2aWNlX3Q7DQo+Pj4+
ICBERUZJTkVfWEVOX0dVRVNUX0hBTkRMRShwaHlzZGV2X3BjaV9kZXZpY2VfdCk7DQo+Pj4+ICAN
Cj4+Pj4gK3N0cnVjdCBwY2lfZGV2aWNlX3N0YXRlX3Jlc2V0IHsNCj4+Pj4gKyAgICBwaHlzZGV2
X3BjaV9kZXZpY2VfdCBkZXY7DQo+Pj4+ICsjZGVmaW5lIFBDSV9ERVZJQ0VfU1RBVEVfUkVTRVRf
Q09MRCAwDQo+Pj4+ICsjZGVmaW5lIFBDSV9ERVZJQ0VfU1RBVEVfUkVTRVRfV0FSTSAxDQo+Pj4+
ICsjZGVmaW5lIFBDSV9ERVZJQ0VfU1RBVEVfUkVTRVRfSE9UICAyDQo+Pj4+ICsjZGVmaW5lIFBD
SV9ERVZJQ0VfU1RBVEVfUkVTRVRfRkxSICAzDQo+Pj4+ICsgICAgdWludDMyX3QgcmVzZXRfdHlw
ZTsNCj4+Pg0KPj4+IFRoaXMgbWlnaHQgd2FudCB0byBiZSBhIGZsYWdzIGZpZWxkLCB3aXRoIHRo
ZSBsb3cgMiBiaXRzIChvciBtYXliZSAzDQo+Pj4gYml0cyB0byBjb3BlIGlmIG1vcmUgcmVzdCBt
b2RlcyBhcmUgYWRkZWQgaW4gdGhlIGZ1dHVyZSkgYmVpbmcgdXNlZCB0bw0KPj4+IHNpZ25hbCB0
aGUgcmVzZXQgdHlwZS4gIFdlIGNhbiBhbHdheXMgZG8gdGhhdCBsYXRlciBpZiBmbGFncyBuZWVk
IHRvDQo+Pj4gYmUgYWRkZWQuDQo+PiBEbyB5b3UgbWVhbiB0aGlzPw0KPj4gK3N0cnVjdCBwY2lf
ZGV2aWNlX3N0YXRlX3Jlc2V0IHsNCj4+ICsgICAgcGh5c2Rldl9wY2lfZGV2aWNlX3QgZGV2Ow0K
Pj4gKyNkZWZpbmUgX1BDSV9ERVZJQ0VfU1RBVEVfUkVTRVRfQ09MRCAwDQo+PiArI2RlZmluZSBQ
Q0lfREVWSUNFX1NUQVRFX1JFU0VUX0NPTEQgICgxVTw8X1BDSV9ERVZJQ0VfU1RBVEVfUkVTRVRf
Q09MRCkNCj4+ICsjZGVmaW5lIF9QQ0lfREVWSUNFX1NUQVRFX1JFU0VUX1dBUk0gMQ0KPj4gKyNk
ZWZpbmUgUENJX0RFVklDRV9TVEFURV9SRVNFVF9XQVJNICAoMVU8PF9QQ0lfREVWSUNFX1NUQVRF
X1JFU0VUX1dBUk0pDQo+PiArI2RlZmluZSBfUENJX0RFVklDRV9TVEFURV9SRVNFVF9IT1QgIDIN
Cj4+ICsjZGVmaW5lIFBDSV9ERVZJQ0VfU1RBVEVfUkVTRVRfSE9UICAgKDFVPDxfUENJX0RFVklD
RV9TVEFURV9SRVNFVF9IT1QpDQo+PiArI2RlZmluZSBfUENJX0RFVklDRV9TVEFURV9SRVNFVF9G
TFIgIDMNCj4+ICsjZGVmaW5lIFBDSV9ERVZJQ0VfU1RBVEVfUkVTRVRfRkxSICAgKDFVPDxfUENJ
X0RFVklDRV9TVEFURV9SRVNFVF9GTFIpDQo+PiArICAgIHVpbnQzMl90IHJlc2V0X3R5cGU7DQo+
PiArfTsNCj4gDQo+IFRoYXQncyBmb3VyIGJpdHMsIG5vdCB0d28uIEknbSBwcmV0dHkgc3VyZSBS
b2dlciBtZWFudCB0byBrZWVwIHRoZSBlbnVtLQ0KPiBsaWtlICNkZWZpbmUtcywgYnV0IGFkZGl0
aW9uYWxseSBkZWZpbmUgYSAyLWJpdCBtYXNrIGNvbnN0YW50ICgweDMpLiBJDQo+IGRvbid0IHRo
aW5rIGl0IG5lZWRzIHRvIGJlIHRocmVlIGJpdHMgcmlnaHQgYXdheSAtIHdlIGNhbiBkZWNpZGUg
d2hhdCB0bw0KPiBkbyB0aGVyZSB3aGVuIGFueSBvZiB0aGUgaGlnaGVyIGJpdHMgYXJlIHRvIGJl
IGFzc2lnbmVkIGEgbWVhbmluZy4NCkxpa2UgdGhpcz8NCnN0cnVjdCBwY2lfZGV2aWNlX3N0YXRl
X3Jlc2V0IHsNCiAgICBwaHlzZGV2X3BjaV9kZXZpY2VfdCBkZXY7DQojZGVmaW5lIFBDSV9ERVZJ
Q0VfU1RBVEVfUkVTRVRfQ09MRCAweDANCiNkZWZpbmUgUENJX0RFVklDRV9TVEFURV9SRVNFVF9X
QVJNIDB4MQ0KI2RlZmluZSBQQ0lfREVWSUNFX1NUQVRFX1JFU0VUX0hPVCAgMHgyDQojZGVmaW5l
IFBDSV9ERVZJQ0VfU1RBVEVfUkVTRVRfRkxSICAweDMNCiNkZWZpbmUgUENJX0RFVklDRV9TVEFU
RV9SRVNFVF9NQVNLICAweDMNCiAgICB1aW50MzJfdCBmbGFnczsNCn07DQoNCj4gDQo+IEphbg0K
DQotLSANCkJlc3QgcmVnYXJkcywNCkppcWlhbiBDaGVuLg0K


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 07:43:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 07:43:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770250.1181196 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZmx8-0007Hs-9y; Fri, 02 Aug 2024 07:43:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770250.1181196; Fri, 02 Aug 2024 07:43:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZmx8-0007Hl-6N; Fri, 02 Aug 2024 07:43:54 +0000
Received: by outflank-mailman (input) for mailman id 770250;
 Fri, 02 Aug 2024 07:43:52 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZmx6-0007Ha-Pp
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 07:43:52 +0000
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com
 [2a00:1450:4864:20::529])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f595a8af-50a2-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 09:43:50 +0200 (CEST)
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5a156556fb4so11426880a12.3
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 00:43:50 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9bcadbesm66721066b.21.2024.08.02.00.43.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 02 Aug 2024 00:43:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f595a8af-50a2-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722584630; x=1723189430; 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=+Vog9qZ6jd1ViTJ3mezsf00ZNC8hEM4KIDFT8Bn5TJc=;
        b=DmCq+ULx/XPfSbItq7bxkDtxaKFXB7f0jmC6YtZ39awZXwhr+FP5dUtV+uFfFlu/Wr
         B/KaMe06SbHWfznDdQ2DXd7HCo+FAsvsvvnyKjHUnleaEUicZUhSSU22BdOU3rJGWtrF
         fN590bCMJa+3F1Qt36uAxncAqfjBO0lYswB7IFQojc+aS9+SA+Da5Iqt8wkQT1r9BmmI
         SB/XdZquHrsAlUsYRX9LhJ175Wqi8oO3hxfZ8lSGH++chfNyCDzxiw+0x+c0kS0Q1W2W
         yroiXrnCf+zIEV7nlkIRRvbaMWJCnPP4l3DUM59B5iLpB8BAWG1jIq+O+dO68TpZgYoC
         OuOg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722584630; x=1723189430;
        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=+Vog9qZ6jd1ViTJ3mezsf00ZNC8hEM4KIDFT8Bn5TJc=;
        b=UOV3U8agIX2tKWP6tXo2p3DqqpojAgOCOtPuK+/NGXHWX19qna9T7W3/pwqgpEKdF9
         wH3xjnmqT8zRDvn5CQ5Zbt/0mebWcld1Dg6sBmJy8q1ftg0yoQTag8ltGOCzb5scpMHc
         PMg1QiMx3+TTWeBP+HGb2Hitn/C/pAv8d7NouvRVJodEgMTVcBaeYc8Rym9jPIMwJLEo
         KxdVWPAOFVl7E8Fq7Z8H4VxUgNp4WuXazUs+oga1PwVw9Vcu35dAmj2FL2SX7sIg2KUr
         xXokT0sibjEN8cyQxlEmCe/6D9umuZ92dADSzUknhaSbWLwpsTIS/y2ArcYgqvJRwfST
         l+/w==
X-Gm-Message-State: AOJu0YwF5qeawzEInV3cb8oLqcB6NNCpLJgO0Bq0xiNTqUdMISDE2pMh
	4NHwDU9ZfxyK1UF+k3pzk/rMXIaVJDdxiz5/t/S00MlY5CMAFCUFZMnGAHowpw==
X-Google-Smtp-Source: AGHT+IGJ0S+aXBmpnhEylOEuPtPZezRqqCZFw5CMXk+zAQKRDMXdEF20xXuyz+Pop+PXwKkRUf5lxQ==
X-Received: by 2002:a17:907:94c4:b0:a7a:a3db:c7b3 with SMTP id a640c23a62f3a-a7dc4e47551mr176354466b.19.1722584619904;
        Fri, 02 Aug 2024 00:43:39 -0700 (PDT)
Message-ID: <7911fd44-d4a0-4a2e-8b1c-feaa163790df@suse.com>
Date: Fri, 2 Aug 2024 09:43:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v12 1/7] xen/pci: Add hypercall to support reset of
 pcidev
To: "Chen, Jiqian" <Jiqian.Chen@amd.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>, Juergen Gross <jgross@suse.com>,
 "Daniel P . Smith" <dpsmith@apertussolutions.com>,
 "Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>,
 "Huang, Ray" <Ray.Huang@amd.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-2-Jiqian.Chen@amd.com> <ZqpeiWhuqPXiTeRZ@macbook>
 <BL1PR12MB5849CFC87F0DB92864B54BE4E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
 <1ca7e6a2-698d-4548-9959-fd88126c25e1@suse.com>
 <BL1PR12MB5849038C59C54C9FC8FD8048E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <BL1PR12MB5849038C59C54C9FC8FD8048E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 02.08.2024 09:41, Chen, Jiqian wrote:
> On 2024/8/2 14:25, Jan Beulich wrote:
>> On 02.08.2024 04:55, Chen, Jiqian wrote:
>>> On 2024/7/31 23:55, Roger Pau Monné wrote:
>>>> On Mon, Jul 08, 2024 at 07:41:18PM +0800, Jiqian Chen wrote:
>>>>> @@ -305,6 +312,15 @@ struct physdev_pci_device {
>>>>>  typedef struct physdev_pci_device physdev_pci_device_t;
>>>>>  DEFINE_XEN_GUEST_HANDLE(physdev_pci_device_t);
>>>>>  
>>>>> +struct pci_device_state_reset {
>>>>> +    physdev_pci_device_t dev;
>>>>> +#define PCI_DEVICE_STATE_RESET_COLD 0
>>>>> +#define PCI_DEVICE_STATE_RESET_WARM 1
>>>>> +#define PCI_DEVICE_STATE_RESET_HOT  2
>>>>> +#define PCI_DEVICE_STATE_RESET_FLR  3
>>>>> +    uint32_t reset_type;
>>>>
>>>> This might want to be a flags field, with the low 2 bits (or maybe 3
>>>> bits to cope if more rest modes are added in the future) being used to
>>>> signal the reset type.  We can always do that later if flags need to
>>>> be added.
>>> Do you mean this?
>>> +struct pci_device_state_reset {
>>> +    physdev_pci_device_t dev;
>>> +#define _PCI_DEVICE_STATE_RESET_COLD 0
>>> +#define PCI_DEVICE_STATE_RESET_COLD  (1U<<_PCI_DEVICE_STATE_RESET_COLD)
>>> +#define _PCI_DEVICE_STATE_RESET_WARM 1
>>> +#define PCI_DEVICE_STATE_RESET_WARM  (1U<<_PCI_DEVICE_STATE_RESET_WARM)
>>> +#define _PCI_DEVICE_STATE_RESET_HOT  2
>>> +#define PCI_DEVICE_STATE_RESET_HOT   (1U<<_PCI_DEVICE_STATE_RESET_HOT)
>>> +#define _PCI_DEVICE_STATE_RESET_FLR  3
>>> +#define PCI_DEVICE_STATE_RESET_FLR   (1U<<_PCI_DEVICE_STATE_RESET_FLR)
>>> +    uint32_t reset_type;
>>> +};
>>
>> That's four bits, not two. I'm pretty sure Roger meant to keep the enum-
>> like #define-s, but additionally define a 2-bit mask constant (0x3). I
>> don't think it needs to be three bits right away - we can decide what to
>> do there when any of the higher bits are to be assigned a meaning.
> Like this?
> struct pci_device_state_reset {
>     physdev_pci_device_t dev;
> #define PCI_DEVICE_STATE_RESET_COLD 0x0
> #define PCI_DEVICE_STATE_RESET_WARM 0x1
> #define PCI_DEVICE_STATE_RESET_HOT  0x2
> #define PCI_DEVICE_STATE_RESET_FLR  0x3
> #define PCI_DEVICE_STATE_RESET_MASK  0x3
>     uint32_t flags;
> };

Yes, with the last #define adjusted such that columns align.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 07:44:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 07:44:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770251.1181206 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZmxL-0007aR-Hi; Fri, 02 Aug 2024 07:44:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770251.1181206; Fri, 02 Aug 2024 07:44:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZmxL-0007aK-Ee; Fri, 02 Aug 2024 07:44:07 +0000
Received: by outflank-mailman (input) for mailman id 770251;
 Fri, 02 Aug 2024 07:44: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=uPwv=PB=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1sZmxK-0007Ha-BY
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 07:44:06 +0000
Received: from NAM12-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam12on20621.outbound.protection.outlook.com
 [2a01:111:f403:200a::621])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fd0eb4ed-50a2-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 09:44:04 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by IA1PR12MB6041.namprd12.prod.outlook.com (2603:10b6:208:3d7::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23; Fri, 2 Aug
 2024 07:44:01 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285%3]) with mapi id 15.20.7828.021; Fri, 2 Aug 2024
 07:44:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fd0eb4ed-50a2-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=YXsosKmaQDfo9SbN4MxzR8NSwVVFZlm/0mhhgXbmjpyIqU25R91i47QEoG+0PPbKhe6Gmqkj7Kd9X83/eIuAMmnUQ+zGIU/hm8sF72okXZLhL00xgv/4V6NZEl6tF45+KPCf7UZMDT1f0Ty4Uq/eHz7h4liq4Lb5xwVXOLpW+5OGb5ACf8XZmD8I89Z1gAL66CGEFWvxM1D5y1FkgCswrCbh6jdGw1MRkMFsfvuflgUA7AOSbVcAqAiea5JikOoFT2ux6gVmpSG5eK+4Gv6K+wklou2ReKW1i7SJCRKpa3AGn65PZtE4GPsid/RynD1n7RyeHhTSz5Xjbo8eznEa3Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=mz89nq9nGOP651vIzz0KZP5WlvOdOJYzzugb8MVDcRU=;
 b=PdfAzXZIAvM/h8IYBezKhUcq89UjIULq7C5pymK+utD1W1SCgik9GiKSFJC4OLNksl1YPCg+Dr6fvq92h581Q20ZUnReqDccGBFw5v7NRs5cga5sOe72RFSQpY5beQlLc07dNmiwQMVNnZfliK+MMNcCqIQNmZ+l5RBGPA7OqvKb/TC6DF9glhUcshE65sRqsSdeLG6HUemY9m5V0jKDEmzvrixeL8+zn8vjlJ49RHRaQ5iEqSdPV3ewQsUrk9EhQKD+DitzgPF3bEqngP6T+SIE2tWbVSzHjUlReIcsy8/cCAC48nCnLLXtOmPi01CUHZOxAVZqAGls9p77dNMXxA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mz89nq9nGOP651vIzz0KZP5WlvOdOJYzzugb8MVDcRU=;
 b=LIGdSHgQICnT2UjC+oLYzWa2vyAPnoeiV10+6YXDhA07zloIK48gPVcFfRnKG5UVpxDQq/+EbL3rr5MqbOCBJZLbvKVxvITZObkpEN8k7Egj+wsoLtsMrkafLFWM+GtK3mtGm+kK3ED+TyY+LNNIUByc/DJXZRI+PrNCG+NdG7o=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: Jan Beulich <jbeulich@suse.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>, George Dunlap
	<gwd@xenproject.org>, Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, Juergen
 Gross <jgross@suse.com>, "Daniel P . Smith" <dpsmith@apertussolutions.com>,
	"Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>, "Huang, Ray"
	<Ray.Huang@amd.com>, =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?=
	<roger.pau@citrix.com>, "Chen, Jiqian" <Jiqian.Chen@amd.com>
Subject: Re: [XEN PATCH v12 4/7] x86/domctl: Add hypercall to set the access
 of x86 gsi
Thread-Topic: [XEN PATCH v12 4/7] x86/domctl: Add hypercall to set the access
 of x86 gsi
Thread-Index: AQHa0SvYL4tONjoIyEuzfSK6fk2TK7ISY3CAgAGQQYD//7QaAIAAmwuA
Date: Fri, 2 Aug 2024 07:44:00 +0000
Message-ID:
 <BL1PR12MB5849EFA5CDDA7FC4648FCF99E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-5-Jiqian.Chen@amd.com> <ZqtsQwZNyFzflDQt@macbook>
 <BL1PR12MB58490598FF7FEAE291DCDAABE7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
 <bd03a532-e404-483f-a04b-b19c3d6fa993@suse.com>
In-Reply-To: <bd03a532-e404-483f-a04b-b19c3d6fa993@suse.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: BL1PR12MB5849.namprd12.prod.outlook.com
 (15.20.7828.000)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|IA1PR12MB6041:EE_
x-ms-office365-filtering-correlation-id: a312fc8f-c3a2-4228-2e8a-08dcb2c6dfe6
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|366016|376014|7416014|38070700018;
x-microsoft-antispam-message-info:
 =?utf-8?B?UDYzZUduS2R1UUxoenhtb1NVSEV2VG8yZDdsMUpNbE8yOFJYbnc1VTRmM0hy?=
 =?utf-8?B?bDFORG91SVFaQnd2bHI3elpTLzVuOS9Jam9YYXJ2NGtBNVJkWmh5UmtpTzhN?=
 =?utf-8?B?WFU5TjBzYWhaeGFLNDZJcDNqOHNGakp3T0JkWWtSVzVzby8xRVc4dlZUdHJM?=
 =?utf-8?B?d1ZnS1h0YmNEWjNvaVF5T2RKR1RxWUJwVXMwMUZ3Y1c4VElUd0dxcWJuNkhi?=
 =?utf-8?B?RzlRT0diaE9LMUtSZlpDWDNoOFNrKzQ4dXF3Q000bGt1eFlEbGRpcGhObWpr?=
 =?utf-8?B?OG5sMlNmUzZidmlRNFVaNkZhdDhTdFhpblRhbUZYODZRbmI3OXl1ZGFOTlh3?=
 =?utf-8?B?K2lDb2dPWTdCaVY4ZXM4N3NZMzR6eDJJZDRiZ3AxMGZJUm9XcUYxczluamFh?=
 =?utf-8?B?K2lLbURFZXdKdlNYSFZVQ0xpZmRrVjJ6S2tEQ3AwL2t0SkFadzB3b25Zenpu?=
 =?utf-8?B?S29sYisrbnU5c0pxY1U0QWZaRXczcXFuQ2E2dGtnenpjWms5OVBKUDRrQmhS?=
 =?utf-8?B?SDIzKzBzK2owcytRQmo2MnlBQ2gxbFNtblRVK2xXYUNHb3JLUDhINnpIQ0RR?=
 =?utf-8?B?MUozbzZZSFMyUDhzUmdHVC9EM1VKZlVXVHJSamNJME1NTXp0R0l3bjRxU0xI?=
 =?utf-8?B?aHdURXdYNWtHNzg3NGt4ajJvNkVJQTRYQUR1NGYrVkpoOXA0VS9zd1g3dk9k?=
 =?utf-8?B?UFJndWgyNnczTGt5cnh1UXJ3WDZ1b2RhTDhvM1g1dERoS2pEc1Q0bDBLQ2tO?=
 =?utf-8?B?eStEVEhHbzRPYkpKRGxhZHZFb3AzbDBuYXA4UFBBaU9HMVI0a1c0Y0ZXSWFT?=
 =?utf-8?B?V3RrL0o5Y2txSDRQU1RtSkg5VGhxa2tPVUVNZEFXdDNkNkJjOVFaVzd6MmhQ?=
 =?utf-8?B?Vk41SHg5cktjczFFdi9DQnhScjVkUVl2Y2xqa1MramlrcnlmWlpPT3pZTDhR?=
 =?utf-8?B?T2Zpc2ZIaGxKWUQzaEQxRVcvK3ZscWczTTg0WVF5cWlHNGMxNDZBMjh6S1pP?=
 =?utf-8?B?SzVWVS9CcGJGZHlFLzFXUzRmUTRSRi94alcyYzY1UnQ1UnoxcFYwcWdTWVpm?=
 =?utf-8?B?WFRmdjVmdGNVRzVJMC9xczZpc2c2WVVXdEJ2ODhnMGlLSUlSbGdDZ3VXVEdE?=
 =?utf-8?B?cXpqU3FqM3ZWUjVGTXZTWTl4c0tlVUdsbEtFVU0rVzZHTVA5ZjhtOGZFbzlV?=
 =?utf-8?B?d0RDOW5oL0x3UG1pR2FpcjM4ZGNpZHIxZ3dteHlPbXJ2MnBzNzJFSy9oN1hU?=
 =?utf-8?B?bng4OVNJQ1pibVRvdEozdGIrVTlHdkxTRWkvSTREV1ovS3dCNWozQ1Irc2JD?=
 =?utf-8?B?QkFGc29IeXl0U21SZEhoZFE3NHVJV1AyaXdheXg0bjdQREU3aXNGdWhHdThk?=
 =?utf-8?B?cmVmSFdiZG96cm5qV0hCUCtLYTJVMHFBZ1hsak1oZW5CTDNPSzloMy9JVkRJ?=
 =?utf-8?B?czZxOXpSWXhIS1AxV3F6UllwUUJINjNOQnFiMDFXUTcwamVBQVZGejF4eHZt?=
 =?utf-8?B?Z0JFZ0FmbW1QanhmOEh6NmpNOGxPK1VrR0Z5bUtjYy9uVW90czhnOEZqaDVy?=
 =?utf-8?B?dDg1SXJoNm5HTmxXbVh0VFFGMTd0TnFTdWJoQzRxNlJLbnpJNE5QZFUxTnps?=
 =?utf-8?B?empxUnFGelVjcndlTG8xVEdBN084SFBKUWdnb1FUc0RoYm1zbWVTUE1oc1pQ?=
 =?utf-8?B?UTk3SmtSNE1qY2g5azMwaUJjc2RjaXQ1MWlWa2VTeXRDd1ZTU2NoSWpvaDg0?=
 =?utf-8?B?Q1RWOWg1cS9lbTlSMllNNU1uenpULzdGRTRZN0dQaDB2U3N2YW1rUGtZdGVx?=
 =?utf-8?B?Syt0bWhUNjNVMzRuSWZtK3Fsck5jMnJJNDBtWlVrdUR6a2JjTlRMLzY0UlJl?=
 =?utf-8?B?ZDU2MU9zZ0g1MzF6bEZ4K3VEVGlTRXZyckZYTHhhNWlwUlE9PQ==?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?VGY4bzc0ZkdvMUtvWUZsUzVDVUIxTWc0MXp3UWZ4VnBod2xORXh2V0YrVThZ?=
 =?utf-8?B?UmtNUFZuQ2ZOMFRZR3Nhd0RYZkxMUGl4ZzdlS0sxZGxxRHdmUG45M0RhRnpp?=
 =?utf-8?B?M2VnQXlsVWN6UDhHZGwvc3UrZGtsSlplMjFONFhybHlndit4RG5pR2JWWWJi?=
 =?utf-8?B?NHp5d1VGQ0tRalZMTmdQOVVKSVI1OXlyNkRGZ0pVRmZDWmkrR29lS1c1S2hn?=
 =?utf-8?B?eWU4UWlwTU9peFprNGUyNVVhZHEzbS85QmtQOHZBWGtZdE1rbzBSbzNDa1Fs?=
 =?utf-8?B?K0tBMHJ2ZlYzU3ZZSzBTWkNlelJiWmRYdkJmaG04U0p4K0doUDZ3RXJlbXR0?=
 =?utf-8?B?RVYwbFl3d2ZGcDRnYUZyVDdNRFBuTVc5RHA0RUVraGpxeUV2Sjl3aTZRd2o1?=
 =?utf-8?B?M210VWJYSGlpaGROR0U2c3RTT1ppTzhJYUY5cG1ZcGRqbTFGMzJhV21PNHNE?=
 =?utf-8?B?TlVoTVVUc0hvQW1mem5rRStITkVQTG9rUWgxUDJoQlhGMGI1QnVrTnFZUlp2?=
 =?utf-8?B?NWZTOWdwS0pkVFVDSC9KQlA1eFpBZng5ZkN4NlY0a3FGTW9tRzJGMy9iTi84?=
 =?utf-8?B?VTY3MmZXTXpCS2NhMHZUVVRKT0RvWkxKZmxZUWIweUVrTWNTQjZiZ1JaZ1o3?=
 =?utf-8?B?SXBYRllLNU9odFNyN0xpb3pKNks3R3ozdkovTTljeGdwVHN3Ni96djE4ZnV6?=
 =?utf-8?B?ZGVBZkZUVW5zc3RPM0UyR0dETHFTMmM0WWpDUEZyV0pZV1Vsd1VoUVNvZnJW?=
 =?utf-8?B?b2t0QW96dmtlTlowM0Rmam1JQWlWNHNWdEcxMTI0aFg4TmFYK21kd3ZOT0Nw?=
 =?utf-8?B?eUtKRFpmUk82UjRwU0UrVnp2UU5sQTdUTFFYVVR1a3NkV0tmQVVQVkNZZjM1?=
 =?utf-8?B?SFdHY3QvNEt5VTIyNTVMZmovbVovY2FvQUlCcHBHR25JMkpta0xSenR1WGNr?=
 =?utf-8?B?OWoxZkRYajdXU0F1RDdzNFkrUmpJbkliZ0hlbkNWZHRJZ1FoRXN1WlMyV3ZV?=
 =?utf-8?B?eTNyMmhLTDZMQS8vd0JsVzJUWEw1dHlLdEF4Q2t2bHFwVFR1WVJMbnZZdjJ3?=
 =?utf-8?B?QjZiV2twUnlKU2NnTmlMUVN6Y1d2NG8zUTJ6cEVEaGdNRFNTWkU3UjN5STV0?=
 =?utf-8?B?RG1jWEh6MzAxb0RMaXBjT0lMMGJUY1F2N1YvNGtHbFpvaEFaVGVFQkY0Y2ls?=
 =?utf-8?B?MXZLTGx0ZTE1ZVd0U1YzUTNKSis4U25pbnc2OWVWOHo3U3M1MXlVeWVZS3JW?=
 =?utf-8?B?N3VuRTc4NDl2aWZDNGFUUTZsM3BoUXZLUTN1TzZuTTJLY3Q2RXE1V2UyT2FY?=
 =?utf-8?B?NnBRYWRDL3FrRjhDMVoxNlFGTzZkcVpodFpPSkFENlgwR3QvcHQ0SnlzYm0w?=
 =?utf-8?B?cFUvKzBRV1d0amxEM2xRbDcraDJNa2hyVE5QRlR1SGtZNkxRbVBRMjVkVDlC?=
 =?utf-8?B?eFZFbksxbEhPSXhrakh6ZGg1UGZYaDlobjhSRXUxRk5yTVQ0bkdkcEs1NTls?=
 =?utf-8?B?Tml4aWFsTk9nWXhpdUJLK2lCVnd2UnJybGJkRmxlc0ZELzNqQTRGY1lDa3pJ?=
 =?utf-8?B?RVp1SnpZVnJuWnVpejczbmVpL05CYmtNNEYxd0hzVzFFV1h4TjRiMjdtZm9k?=
 =?utf-8?B?T1FjQ1pjZnh4aHMyVEh1ZkVidXVFSC9heVNyNnA1ZDB3RTlrUnZ2ZjV5Y2Nj?=
 =?utf-8?B?WTM5VTVGSHd1YjhZS0srQnRTeUZuUG83UGs3ZVJWNjlFbnVQY29PbVZBRzl4?=
 =?utf-8?B?VjFwMjgrVHhCR2JwSDlQOHFEekpFQ3ZkTXlkWHJObnBkSDFyaUZOVEpTSTZr?=
 =?utf-8?B?cFV3a0h6Vk9QdmE5MmE1WlE3MHNLTHJFUDRSbm1SdDJxakNhRmdmTWZwUUlW?=
 =?utf-8?B?dkNydkdIeVF4QWxxTUEvdTVzdWtMbFZnRUlXMCtndE81RFU3YkVGeElQcktr?=
 =?utf-8?B?UHJnUEpQOU50OHZvOHZaclRUL2dDQXRXeGlSUlVjVjkrYW1rVU5NU056WkpV?=
 =?utf-8?B?OHVMdDFqalZPSjV2SHFVcGlaYVM0cmF4cHlkdDdodE02SlJCYmdwM2lqeW5w?=
 =?utf-8?B?UWFQdnc0NVJLVVFyV25EQitJMi9xWEg5SFFSSzBRMDF4SVBKR2NuZkQ4TUQ1?=
 =?utf-8?Q?1l1M=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <2D5330335215E749AB8FF541BDB65416@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a312fc8f-c3a2-4228-2e8a-08dcb2c6dfe6
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2024 07:44:00.9401
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: DLVeaPtTIh8WoarQhY3WsdhcZFRF2X3Bs3iieHKHaR1tILd7Hcg8O8SnCIZjxsuO4QaCUbrr++P9693VaaCGWg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6041

T24gMjAyNC84LzIgMTQ6MjcsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAwMi4wOC4yMDI0IDA1
OjEwLCBDaGVuLCBKaXFpYW4gd3JvdGU6DQo+PiBPbiAyMDI0LzgvMSAxOTowNiwgUm9nZXIgUGF1
IE1vbm7DqSB3cm90ZToNCj4+PiBPbiBNb24sIEp1bCAwOCwgMjAyNCBhdCAwNzo0MToyMVBNICsw
ODAwLCBKaXFpYW4gQ2hlbiB3cm90ZToNCj4+Pj4gLS0tIGEveGVuL2luY2x1ZGUvcHVibGljL2Rv
bWN0bC5oDQo+Pj4+ICsrKyBiL3hlbi9pbmNsdWRlL3B1YmxpYy9kb21jdGwuaA0KPj4+PiBAQCAt
NDY0LDYgKzQ2NCwxMyBAQCBzdHJ1Y3QgeGVuX2RvbWN0bF9pcnFfcGVybWlzc2lvbiB7DQo+Pj4+
ICAgICAgdWludDhfdCBwYWRbM107DQo+Pj4+ICB9Ow0KPj4+PiAgDQo+Pj4+ICsvKiBYRU5fRE9N
Q1RMX2dzaV9wZXJtaXNzaW9uICovDQo+Pj4+ICtzdHJ1Y3QgeGVuX2RvbWN0bF9nc2lfcGVybWlz
c2lvbiB7DQo+Pj4+ICsgICAgdWludDMyX3QgZ3NpOw0KPj4+PiArI2RlZmluZSBYRU5fRE9NQ1RM
X0dTSV9QRVJNSVNTSU9OX01BU0sgMQ0KPj4+DQo+Pj4gSU1PIHRoaXMgd291bGQgYmUgYmV0dGVy
IG5hbWVkIEdSQU5UIG9yIHNpbWlsYXIsIG1heWJlIHNvbWV0aGluZyBsaWtlOg0KPj4+DQo+Pj4g
LyogTG93IGJpdCB1c2VkIHRvIHNpZ25hbCBncmFudC9yZXZva2UgYWN0aW9uLiAqLw0KPj4+ICNk
ZWZpbmUgWEVOX0RPTUNUTF9HU0lfUkVWT0tFIDANCj4+PiAjZGVmaW5lIFhFTl9ET01DVExfR1NJ
X0dSQU5UICAxDQo+Pj4NCj4+Pj4gKyAgICB1aW50OF90IGFjY2Vzc19mbGFnOyAgICAvKiBmbGFn
IHRvIHNwZWNpZnkgZW5hYmxlL2Rpc2FibGUgb2YgeDg2IGdzaSBhY2Nlc3MgKi8NCj4+Pj4gKyAg
ICB1aW50OF90IHBhZFszXTsNCj4+Pg0KPj4+IFdlIG1pZ2h0IGFzIHdlbGwgZGVjbGFyZSB0aGUg
ZmxhZ3MgZmllbGQgYXMgdWludDMyX3QgYW5kIGF2b2lkIHRoZQ0KPj4+IHBhZGRpbmcgZmllbGQu
DQo+PiBTbywgc2hvdWxkIHRoaXMgc3RydWN0IGJlIGxpa2UgYmVsb3c/IFRoZW4gSSBqdXN0IG5l
ZWQgdG8gY2hlY2sgd2hldGhlciBldmVyeXRoaW5nIGV4Y2VwdCB0aGUgbG93ZXN0IGJpdCBpcyAw
Lg0KPj4gc3RydWN0IHhlbl9kb21jdGxfZ3NpX3Blcm1pc3Npb24gew0KPj4gICAgIHVpbnQzMl90
IGdzaTsNCj4+IC8qIExvd2VzdCBiaXQgdXNlZCB0byBzaWduYWwgZ3JhbnQvcmV2b2tlIGFjdGlv
bi4gKi8NCj4+ICNkZWZpbmUgWEVOX0RPTUNUTF9HU0lfUkVWT0tFIDANCj4+ICNkZWZpbmUgWEVO
X0RPTUNUTF9HU0lfR1JBTlQgIDENCj4+ICNkZWZpbmUgWEVOX0RPTUNUTF9HU0lfUEVSTUlTU0lP
Tl9NQVNLIDENCj4+ICAgICB1aW50MzJfdCBhY2Nlc3NfZmxhZzsgICAgLyogZmxhZyB0byBzcGVj
aWZ5IGVuYWJsZS9kaXNhYmxlIG9mIHg4NiBnc2kgYWNjZXNzICovDQo+PiB9Ow0KPiANCj4gWWV0
IHRoZW4gd2h5ICJhY2Nlc3NfZmxhZ3MiPyBZb3UgY2FuJ3QgZm9yZXNlZSB3aGF0IG1lYW5pbmcg
dGhlIG90aGVyIGJpdHMgbWF5DQo+IGdhaW4uIFRoYXQgbWVhbmluZyBtYXkgKGFuZCBsaWtlbHkg
d2lsbCkgbm90IGJlIGFjY2VzcyByZWxhdGVkIGF0IGFsbC4NCg0KT0ssIGp1c3QgInVpbnQzMl90
IGZsYWdzIi4NCg0KPiANCj4gSmFuDQoNCi0tIA0KQmVzdCByZWdhcmRzLA0KSmlxaWFuIENoZW4u
DQo=


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 07:44:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 07:44:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770255.1181216 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZmxU-0007zy-Pt; Fri, 02 Aug 2024 07:44:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770255.1181216; Fri, 02 Aug 2024 07:44:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZmxU-0007zm-Mp; Fri, 02 Aug 2024 07:44:16 +0000
Received: by outflank-mailman (input) for mailman id 770255;
 Fri, 02 Aug 2024 07:44:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AAnW=PB=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZmxT-0007vh-Ds
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 07:44:15 +0000
Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com
 [2607:f8b0:4864:20::f2d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 032169f7-50a3-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 09:44:14 +0200 (CEST)
Received: by mail-qv1-xf2d.google.com with SMTP id
 6a1803df08f44-6b7b28442f9so88737566d6.3
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 00:44:14 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6bb9c76f8ccsm4657496d6.4.2024.08.02.00.44.11
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 00:44:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 032169f7-50a3-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722584653; x=1723189453; darn=lists.xenproject.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=G/o79dhHmUDQP4JhXdg4okU5Bb30/RuXPb1uzrA/KSY=;
        b=CCUUIIgKPa7GMUdCSJqeAt57sZpODWsEgM4510Xd28E6PCQ8hSiW/VLmeby5JTbR/w
         fwcBHESEZLnqaC82eYaxp9jmAIYKkiHDWWm5FESxLSm3cPlOv2BxhIMr3cErrD5JIpcp
         hVi3KoWOpSBrVO+pUQ6D4r4EsRbZ5+2ORHYzM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722584653; x=1723189453;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=G/o79dhHmUDQP4JhXdg4okU5Bb30/RuXPb1uzrA/KSY=;
        b=li3EElJNZSdC1XtMxfCY/w9+2kD2AVEzQbvS8hZVEx2EowXCMOSxl6NnB/JAkNCzOc
         Xxri399J/duV84fgVbu6LzGOIYswYw1Bzf8nOhSUhchXFy5tEM6+6/sAWoH20yIGx6nr
         KxxDHGeUFka+cU08f8s9OU/YBtpi0LguumbeCGBTxIlYwhQ0WeCyKqX6Owfd5if/PSx9
         mjTurlNj4fbDm5MgdxR6IValiIVryoH7PVk6XTl/ziJHb6wm9D+q2Mq3PKd3OI1VleNl
         AeA0tPRZTsYwBUb2entlJpc892YrYO+VxYL6u4LlCu8NMqTOwcCpJ8XSafk2W5+IqeDL
         vw4w==
X-Forwarded-Encrypted: i=1; AJvYcCWiNTRtqvEna/K8UHguozaRXw8y0F4w8uGaBanlqdxoo5f3Chp2x9/1nmm+pLPw6JknKkBFkqtivZdOCrXOO1tSDFlhr9Iw8AYPhmlZfDY=
X-Gm-Message-State: AOJu0YxcG+EipgPLFcvEG02fbe7L/33rWEICdOfzTzDBIzvpQ3F3c2FK
	ggbnwT6LGfpJv5SlDoFCet/3hgsHVMwN88r0nsZhipsJ+0+HZONX5Z7U7wsVCQk=
X-Google-Smtp-Source: AGHT+IFEz8hYNic0veNXMHp1QXe+XAoszO1Kh290U390CkluvyPtHh9/8fViIK+0K/nuCRUaBIaY2w==
X-Received: by 2002:a05:6214:2e47:b0:6b7:97b8:95ff with SMTP id 6a1803df08f44-6bb984677d0mr25827366d6.54.1722584652656;
        Fri, 02 Aug 2024 00:44:12 -0700 (PDT)
Date: Fri, 2 Aug 2024 09:44:10 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Chen, Jiqian" <Jiqian.Chen@amd.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	Juergen Gross <jgross@suse.com>,
	"Daniel P . Smith" <dpsmith@apertussolutions.com>,
	"Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>,
	"Huang, Ray" <Ray.Huang@amd.com>
Subject: Re: [XEN PATCH v12 1/7] xen/pci: Add hypercall to support reset of
 pcidev
Message-ID: <ZqyOSrx8aHXh1OKn@macbook>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-2-Jiqian.Chen@amd.com>
 <ZqpeiWhuqPXiTeRZ@macbook>
 <BL1PR12MB5849CFC87F0DB92864B54BE4E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
 <1ca7e6a2-698d-4548-9959-fd88126c25e1@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <1ca7e6a2-698d-4548-9959-fd88126c25e1@suse.com>

On Fri, Aug 02, 2024 at 08:25:58AM +0200, Jan Beulich wrote:
> On 02.08.2024 04:55, Chen, Jiqian wrote:
> > On 2024/7/31 23:55, Roger Pau Monné wrote:
> >> On Mon, Jul 08, 2024 at 07:41:18PM +0800, Jiqian Chen wrote:
> >>> When a device has been reset on dom0 side, the Xen hypervisor
> >>> doesn't get notification, so the cached state in vpci is all
> >>> out of date compare with the real device state.
> >>>
> >>> To solve that problem, add a new hypercall to support the reset
> >>> of pcidev and clear the vpci state of device. So that once the
> >>> state of device is reset on dom0 side, dom0 can call this
> >>> hypercall to notify hypervisor.
> >>>
> >>> Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
> >>> Signed-off-by: Huang Rui <ray.huang@amd.com>
> >>> Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
> >>> Reviewed-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> >>> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> >>
> >> Thanks, just a couple of nits.
> >>
> >> This is missing a changelog between versions, and I haven't been
> >> following all the versions, so some of my questions might have been
> >> answered in previous revisions.
> > Sorry, I will add changelogs here in next version.
> > 
> >>
> >>> ---
> >>>  xen/arch/x86/hvm/hypercall.c |  1 +
> >>>  xen/drivers/pci/physdev.c    | 52 ++++++++++++++++++++++++++++++++++++
> >>>  xen/drivers/vpci/vpci.c      | 10 +++++++
> >>>  xen/include/public/physdev.h | 16 +++++++++++
> >>>  xen/include/xen/vpci.h       |  8 ++++++
> >>>  5 files changed, 87 insertions(+)
> >>>
> >>> diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
> >>> index 7fb3136f0c7c..0fab670a4871 100644
> >>> --- a/xen/arch/x86/hvm/hypercall.c
> >>> +++ b/xen/arch/x86/hvm/hypercall.c
> >>> @@ -83,6 +83,7 @@ long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
> >>>      case PHYSDEVOP_pci_mmcfg_reserved:
> >>>      case PHYSDEVOP_pci_device_add:
> >>>      case PHYSDEVOP_pci_device_remove:
> >>> +    case PHYSDEVOP_pci_device_state_reset:
> >>>      case PHYSDEVOP_dbgp_op:
> >>>          if ( !is_hardware_domain(currd) )
> >>>              return -ENOSYS;
> >>> diff --git a/xen/drivers/pci/physdev.c b/xen/drivers/pci/physdev.c
> >>> index 42db3e6d133c..c0f47945d955 100644
> >>> --- a/xen/drivers/pci/physdev.c
> >>> +++ b/xen/drivers/pci/physdev.c
> >>> @@ -2,6 +2,7 @@
> >>>  #include <xen/guest_access.h>
> >>>  #include <xen/hypercall.h>
> >>>  #include <xen/init.h>
> >>> +#include <xen/vpci.h>
> >>>  
> >>>  #ifndef COMPAT
> >>>  typedef long ret_t;
> >>> @@ -67,6 +68,57 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
> >>>          break;
> >>>      }
> >>>  
> >>> +    case PHYSDEVOP_pci_device_state_reset:
> >>> +    {
> >>> +        struct pci_device_state_reset dev_reset;
> >>> +        struct pci_dev *pdev;
> >>> +        pci_sbdf_t sbdf;
> >>> +
> >>> +        ret = -EOPNOTSUPP;
> >>> +        if ( !is_pci_passthrough_enabled() )
> >>> +            break;
> >>> +
> >>> +        ret = -EFAULT;
> >>> +        if ( copy_from_guest(&dev_reset, arg, 1) != 0 )
> >>> +            break;
> >>> +
> >>> +        sbdf = PCI_SBDF(dev_reset.dev.seg,
> >>> +                        dev_reset.dev.bus,
> >>> +                        dev_reset.dev.devfn);
> >>> +
> >>> +        ret = xsm_resource_setup_pci(XSM_PRIV, sbdf.sbdf);
> >>> +        if ( ret )
> >>> +            break;
> >>> +
> >>> +        pcidevs_lock();
> >>> +        pdev = pci_get_pdev(NULL, sbdf);
> >>> +        if ( !pdev )
> >>> +        {
> >>> +            pcidevs_unlock();
> >>> +            ret = -ENODEV;
> >>> +            break;
> >>> +        }
> >>> +
> >>> +        write_lock(&pdev->domain->pci_lock);
> >>> +        pcidevs_unlock();
> >>> +        switch ( dev_reset.reset_type )
> >>> +        {
> >>> +        case PCI_DEVICE_STATE_RESET_COLD:
> >>> +        case PCI_DEVICE_STATE_RESET_WARM:
> >>> +        case PCI_DEVICE_STATE_RESET_HOT:
> >>> +        case PCI_DEVICE_STATE_RESET_FLR:
> >>> +            ret = vpci_reset_device_state(pdev, dev_reset.reset_type);
> >>> +            break;
> >>> +
> >>> +        default:
> >>> +            ret = -EOPNOTSUPP;
> >>> +            break;
> >>> +        }
> >>> +        write_unlock(&pdev->domain->pci_lock);
> >>> +
> >>> +        break;
> >>> +    }
> >>> +
> >>>      default:
> >>>          ret = -ENOSYS;
> >>>          break;
> >>> diff --git a/xen/drivers/vpci/vpci.c b/xen/drivers/vpci/vpci.c
> >>> index 1e6aa5d799b9..7e914d1eff9f 100644
> >>> --- a/xen/drivers/vpci/vpci.c
> >>> +++ b/xen/drivers/vpci/vpci.c
> >>> @@ -172,6 +172,16 @@ int vpci_assign_device(struct pci_dev *pdev)
> >>>  
> >>>      return rc;
> >>>  }
> >>> +
> >>> +int vpci_reset_device_state(struct pci_dev *pdev,
> >>> +                            uint32_t reset_type)
> >>
> >> There's probably no use in passing reset_type to
> >> vpci_reset_device_state() if it's ignored?
> >>
> >>> +{
> >>> +    ASSERT(rw_is_write_locked(&pdev->domain->pci_lock));
> >>> +
> >>> +    vpci_deassign_device(pdev);
> >>> +    return vpci_assign_device(pdev);
> >>> +}
> >>> +
> >>>  #endif /* __XEN__ */
> >>>  
> >>>  static int vpci_register_cmp(const struct vpci_register *r1,
> >>> diff --git a/xen/include/public/physdev.h b/xen/include/public/physdev.h
> >>> index f0c0d4727c0b..3cfde3fd2389 100644
> >>> --- a/xen/include/public/physdev.h
> >>> +++ b/xen/include/public/physdev.h
> >>> @@ -296,6 +296,13 @@ DEFINE_XEN_GUEST_HANDLE(physdev_pci_device_add_t);
> >>>   */
> >>>  #define PHYSDEVOP_prepare_msix          30
> >>>  #define PHYSDEVOP_release_msix          31
> >>> +/*
> >>> + * Notify the hypervisor that a PCI device has been reset, so that any
> >>> + * internally cached state is regenerated.  Should be called after any
> >>> + * device reset performed by the hardware domain.
> >>> + */
> >>> +#define PHYSDEVOP_pci_device_state_reset 32
> >>> +
> >>>  struct physdev_pci_device {
> >>>      /* IN */
> >>>      uint16_t seg;
> >>> @@ -305,6 +312,15 @@ struct physdev_pci_device {
> >>>  typedef struct physdev_pci_device physdev_pci_device_t;
> >>>  DEFINE_XEN_GUEST_HANDLE(physdev_pci_device_t);
> >>>  
> >>> +struct pci_device_state_reset {
> >>> +    physdev_pci_device_t dev;
> >>> +#define PCI_DEVICE_STATE_RESET_COLD 0
> >>> +#define PCI_DEVICE_STATE_RESET_WARM 1
> >>> +#define PCI_DEVICE_STATE_RESET_HOT  2
> >>> +#define PCI_DEVICE_STATE_RESET_FLR  3
> >>> +    uint32_t reset_type;
> >>
> >> This might want to be a flags field, with the low 2 bits (or maybe 3
> >> bits to cope if more rest modes are added in the future) being used to
> >> signal the reset type.  We can always do that later if flags need to
> >> be added.
> > Do you mean this?
> > +struct pci_device_state_reset {
> > +    physdev_pci_device_t dev;
> > +#define _PCI_DEVICE_STATE_RESET_COLD 0
> > +#define PCI_DEVICE_STATE_RESET_COLD  (1U<<_PCI_DEVICE_STATE_RESET_COLD)
> > +#define _PCI_DEVICE_STATE_RESET_WARM 1
> > +#define PCI_DEVICE_STATE_RESET_WARM  (1U<<_PCI_DEVICE_STATE_RESET_WARM)
> > +#define _PCI_DEVICE_STATE_RESET_HOT  2
> > +#define PCI_DEVICE_STATE_RESET_HOT   (1U<<_PCI_DEVICE_STATE_RESET_HOT)
> > +#define _PCI_DEVICE_STATE_RESET_FLR  3
> > +#define PCI_DEVICE_STATE_RESET_FLR   (1U<<_PCI_DEVICE_STATE_RESET_FLR)
> > +    uint32_t reset_type;
> > +};
> 
> That's four bits, not two. I'm pretty sure Roger meant to keep the enum-
> like #define-s, but additionally define a 2-bit mask constant (0x3). I
> don't think it needs to be three bits right away - we can decide what to
> do there when any of the higher bits are to be assigned a meaning.

Indeed, what I was requesting is just a cosmetic change, it doesn't
result in the values on the enum changing at all.

The field however should be better named "flags" or something more
generic so in the future it can accommodate other flags not related to
the reset type.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 07:55:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 07:55:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770280.1181226 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZn8M-0002EH-So; Fri, 02 Aug 2024 07:55:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770280.1181226; Fri, 02 Aug 2024 07:55:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZn8M-0002EA-P1; Fri, 02 Aug 2024 07:55:30 +0000
Received: by outflank-mailman (input) for mailman id 770280;
 Fri, 02 Aug 2024 07:55:29 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZn8L-0002E4-Tf
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 07:55:29 +0000
Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com
 [2a00:1450:4864:20::536])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 94ef3c37-50a4-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 09:55:27 +0200 (CEST)
Received: by mail-ed1-x536.google.com with SMTP id
 4fb4d7f45d1cf-5a15692b6f6so11633174a12.0
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 00:55:27 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b83960f308sm769528a12.4.2024.08.02.00.55.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 02 Aug 2024 00:55:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 94ef3c37-50a4-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722585327; x=1723190127; 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=iiLa95PkjLGr8EZW8pWxLPDawc+bvhxIuWW8rxxnntM=;
        b=HPzom/RFXK1skYrwXZuIJ4BoXe6MoouOHdHxXXA4hhr7mbbxge2Lhp/1nI0mVjw13i
         6coSQxw8AjxePKva1SeeS2s43lbjrJt4Ts4rKo20CxBJwlOzynjyM0+e8QyY3L39CuHH
         Gn/WsXyZiKeV9pRb7LkdbUmR9uswLit/EYEg46dy+1xV5TNC9DoUVCfP6Hsh7N+Z8Rb6
         RXd6HJoq9ieV2KSoq7VoTljhEgSS8gifEGGHw303zwY1Ql5p9fVTWZm/ajhGYRRwvhqT
         b5AJ+Krmx21kFw6dE6LD1TTRfFiqhriJBh1zpgsPIUfKx9a9AGwKnKQ886V+H4TPLuXA
         w/+Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722585327; x=1723190127;
        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=iiLa95PkjLGr8EZW8pWxLPDawc+bvhxIuWW8rxxnntM=;
        b=TenRbboEsrAJvgh3i30EOmjcyuDH0h/t0wjlMsJ+Ty52qECGh5WPcFcS+rx6De5kZY
         fTloqkVWTHY1RVay4THG9qBetP3xJxHWrbPVTbLIVQcc9akVX/kkS8pkwSS+RhqFf9uk
         9/M31EyADfTpkfCAoRZSaTXtxEAzFD4D23RdGetX1nE6V5IdQSS/4NiiGbGKTshTpEEP
         pawhAdLbjaPd90DsJWD0iDhSHwO9SMwZPUpMEujMT0wBGGB2hsy86psHSB81UxnCu6Ei
         jBjHLJ3/PL2kD+prlXLubeTIChUG3gRlOGIUPZrb+5UwTKlghDyGgsPB0HiAyoaYFNSb
         GK9w==
X-Forwarded-Encrypted: i=1; AJvYcCU57fvKnXE9soiP43Q53sfuFWd9bpT65SabHYHaUYrjdnHpu/GMDaDJP5IcZQZBpqcE64VegXNew/r1rqcpX7IUmBRPClHe6KansHnzoAc=
X-Gm-Message-State: AOJu0YxcdF8I4EMUdBDFWNZ9Sgt4YrsqZAVGRGcTD+BC3IUin7ThQyPL
	pYBFdvjwtrkM/ffeReUZZPIwvaSR5KBVXfiMaLU9+MNm8084YlsDRwIvY6XmAQ==
X-Google-Smtp-Source: AGHT+IErj1BTA7Zf5HTsmj2a2xYL6sNOpfrm5LD7weo/NvZUOwCyxwCGdR9FFwJ/S72/wyxivZAkXQ==
X-Received: by 2002:a05:6402:40c:b0:5a0:c709:aa0b with SMTP id 4fb4d7f45d1cf-5b7f56fd439mr2051010a12.24.1722585326916;
        Fri, 02 Aug 2024 00:55:26 -0700 (PDT)
Message-ID: <ac57dec1-68a3-471d-8f4c-c87fd9dca619@suse.com>
Date: Fri, 2 Aug 2024 09:55:25 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: kexec failure with Xen 4.19-rc4 and 4.20-dev on linux host
To: A Kundu <avikalpa@yahoo.com>
Cc: kexec@lists.infradead.org, horms@verge.net.au,
 xen-devel@lists.xenproject.org, Baoquan He <bhe@redhat.com>
References: <05395ed2-3bf3-4926-8e24-c2e7ff37ed26@yahoo.com>
 <cebc7800-df78-4f90-9f8e-82e3f9120b6e@yahoo.com>
 <ZqxUMgcEHakeFPaU@MiWiFi-R3L-srv>
 <abaceb99-4b80-49d7-ab7f-b190f73e858d@yahoo.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: <abaceb99-4b80-49d7-ab7f-b190f73e858d@yahoo.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 02.08.2024 09:28, A Kundu wrote:
> On 8/2/24 09:06, Baoquan He wrote:
>> On 07/31/24 at 06:34pm, A Kundu wrote:
>>> I am experiencing issues using kexec to load Xen 4.17(debian's apt version),
>>> Xen 4.19-rc4 (compiled from source) and 4.20-dev (compiled from source) on a
>>> debian host.
>> You should CC this to XEN dev list so that XEN dev knows this and may
>> provide help. Not everyone is interested in and knows XEN.
>>
>>> System information:
>>> $ uname -a
>>> Linux host 6.9.10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.9.10-1 (2024-07-19)
>>> x86_64 GNU/Linux
>>>
>>> $ kexec --version # compiled from source tarball with ./configure --with-xen
>>> kexec-tools 2.0.29
>>>
>>> Steps to reproduce:
>>>
>>> 1. Set variables:
>>>
>>> XEN_HYPERVISOR="/boot/xen.gz"
>>> XEN_CMD="dom0_mem=6G dom0_max_vcpus=6 dom0_vcpus_pin cpufreq=xen"
>>>
>>> 2. Attempt to load Xen 4.19-rc4:
>>>
>>> # kexec -l "$XEN_HYPERVISOR" --command-line="$XEN_CMD"
>>> Could not find a free area of memory of 0x3b6001 bytes...
>>> elf_exec_build_load_relocatable: ELF exec load failed
>>>
>>> 3. Attempt to load Xen 4.20-dev:
>>>
>>> # kexec -l "$XEN_HYPERVISOR" --command-line="$XEN_CMD"
>>> Could not find a free area of memory of 0x3f8001 bytes...
>>> elf_exec_build_load_relocatable: ELF exec load failed
>>>
>>> 4. Attempt to load Xen 4.17 (from debian rrepositories):
>>> # kexec -l /boot/xen-4.17-amd64.gz --command-line="$XEN_CMD"
>>> Could not find a free area of memory of 0x3b4001 bytes...
>>> elf_exec_build_load_relocatable: ELF exec load failed

And with all of them saying effectively the same, did you verify you
actually have a sufficiently large area reserved? The obvious
place for you to look at is Xen's boot log (obtained via serial
console or "xl dmesg" immediately after booting the system). If you
find everything as expected there, ...

>>> If you need any further information to investigate this problem,
>>> please let me know.

... please provide that boot log.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 07:55:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 07:55:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770282.1181236 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZn8l-0002Zp-2n; Fri, 02 Aug 2024 07:55:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770282.1181236; Fri, 02 Aug 2024 07:55:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZn8l-0002Zg-0B; Fri, 02 Aug 2024 07:55:55 +0000
Received: by outflank-mailman (input) for mailman id 770282;
 Fri, 02 Aug 2024 07:55:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <anthony@xenproject.org>) id 1sZn8j-0002Z3-Ml
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 07:55:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <anthony@xenproject.org>)
 id 1sZn8h-0007ii-Qw; Fri, 02 Aug 2024 07:55:51 +0000
Received: from [82.67.99.167] (helo=l14) by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92)
 (envelope-from <anthony@xenproject.org>)
 id 1sZn8h-0006fL-GB; Fri, 02 Aug 2024 07:55:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=In-Reply-To:Content-Type:MIME-Version:
	References:Message-ID:Subject:Cc:To:From:Date;
	bh=tDYpX8OhgU2vDn6+kaLICvGCmzz7oNc/vpEca54/QPg=; b=n7GNzGiJXGytPspkEb/geFsItm
	IcbohDc3YQhclt9femLcYQHoB/ksU5ZbZzEVd9OnrcoKOzfPlXY73jMN1jyT7AXJhu2AYiIL9xc9z
	u/YhU9E8l/12l3CuBBV08TANF6kKfIPKsqahOu4MfJ5gErJB1Hy8t9SfIRiUEFvN5dUI=;
Date: Fri, 2 Aug 2024 09:55:49 +0200
From: Anthony PERARD <anthony@xenproject.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org,
	osstest service owner <osstest-admin@xenproject.org>
Subject: Re: [xen-4.19-testing test] 187097: regressions - FAIL
Message-ID: <ZqyRBbeY8KAzdjXV@l14>
References: <osstest-187097-mainreport@xen.org>
 <73902a85-2750-4684-b6f5-33dd67c72172@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <73902a85-2750-4684-b6f5-33dd67c72172@suse.com>

On Fri, Aug 02, 2024 at 08:33:09AM +0200, Jan Beulich wrote:
> On 01.08.2024 23:38, osstest service owner wrote:
> > flight 187097 xen-4.19-testing real [real]
> > flight 187112 xen-4.19-testing real-retest [real]
> > http://logs.test-lab.xenproject.org/osstest/logs/187097/
> > http://logs.test-lab.xenproject.org/osstest/logs/187112/
> > 
> > Regressions :-(
> > 
> > Tests which did not succeed and are blocking,
> > including tests which could not be run:
> >  test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop       fail REGR. vs. 187044
> 
> Hmm, this is now pretty persistent in failing. Yet none of the changes
> under test should have affected behavior in any way. Ideas, anyone?

This test passed only a single time, across all branches in the last
year. And that happen to be on the new stable branch.

http://logs.test-lab.xenproject.org/osstest/results/history/test-amd64-amd64-xl-qemut-ws16-amd64/ALL.html

The success rate is incredebly low.

force-push ?

Cheers,

-- 
Anthony PERARD


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 07:59:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 07:59:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770296.1181246 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnBt-00043b-Gx; Fri, 02 Aug 2024 07:59:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770296.1181246; Fri, 02 Aug 2024 07:59:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnBt-00043U-Dg; Fri, 02 Aug 2024 07:59:09 +0000
Received: by outflank-mailman (input) for mailman id 770296;
 Fri, 02 Aug 2024 07:59:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=jwYV=PB=ti.com=a-singh21@srs-se1.protection.inumbo.net>)
 id 1sZnBr-00043L-Ie
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 07:59:07 +0000
Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 15fdf6cc-50a5-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 09:59:05 +0200 (CEST)
Received: from lelv0265.itg.ti.com ([10.180.67.224])
 by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 4727x3uc062631
 for <xen-devel@lists.xenproject.org>; Fri, 2 Aug 2024 02:59:03 -0500
Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23])
 by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 4727x3Mj001183
 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL)
 for <xen-devel@lists.xenproject.org>; Fri, 2 Aug 2024 02:59:03 -0500
Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE112.ent.ti.com
 (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 2
 Aug 2024 02:59:03 -0500
Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE113.ent.ti.com
 (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via
 Frontend Transport; Fri, 2 Aug 2024 02:59:03 -0500
Received: from localhost (nightbug.dhcp.ti.com [172.24.227.225])
 by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 4727x2Vd095063;
 Fri, 2 Aug 2024 02:59:03 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 15fdf6cc-50a5-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com;
	s=ti-com-17Q1; t=1722585543;
	bh=gZkjzNK7QXC6oq7e03E4AvztlDUFXDZuTdvb6Y0z2xw=;
	h=From:To:CC:Subject:Date;
	b=usv4kR9R8ilG0VL1uN6sqpusOGLNHoavPu3v2LfQsOc97UZ54jNk7GYK0OJFhLz+n
	 nFkFyMFXZ6xATI2ckNq80as1xpLzRRSmd5gEILEC+hq7nVxVLi6g0Yv1b+F0hxcxVP
	 NVMHyKm6haWxVFiFOu67RcMr3Mvx62DMGZidr++0=
From: Amneesh Singh <a-singh21@ti.com>
To: <xen-devel@lists.xenproject.org>
CC: Amneesh Singh <a-singh21@ti.com>
Subject: [PATCH] tools/helpers/init-dom0less: fix vcpu availability
Date: Fri, 2 Aug 2024 13:28:25 +0530
Message-ID: <20240802075823.116920-1-a-singh21@ti.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180

Currently, writing at cpu/<cpu>/availability in xenstore fails for a
couple of reasons: a trailing slash in the path and the fact that
cpupool isn't a bitmap but the cpupool id. This patch fixes this by
just getting libxl_vcpuinfo for each dom0less domain.

Signed-off-by: Amneesh Singh <a-singh21@ti.com>
---
 tools/helpers/init-dom0less.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c
index fee9345..a8cdc6d 100644
--- a/tools/helpers/init-dom0less.c
+++ b/tools/helpers/init-dom0less.c
@@ -99,8 +99,8 @@ static bool do_xs_write_vm(struct xs_handle *xsh, xs_transaction_t t,
  * domain started by xl/libxl.
  */
 static int create_xenstore(struct xs_handle *xsh,
-                           libxl_dominfo *info, libxl_uuid uuid,
-                           evtchn_port_t xenstore_port)
+                           libxl_dominfo *info, libxl_vcpuinfo *vcpuinfo,
+                           libxl_uuid uuid, evtchn_port_t xenstore_port)
 {
     domid_t domid;
     unsigned int i;
@@ -168,13 +168,13 @@ retry_transaction:
     if (!do_xs_write_dom(xsh, t, domid, "vm", vm_val_str)) goto err;
     if (!do_xs_write_dom(xsh, t, domid, "name", dom_name_str)) goto err;
     if (!do_xs_write_dom(xsh, t, domid, "cpu", "")) goto err;
-    for (i = 0; i < info->vcpu_max_id; i++) {
-        rc = snprintf(cpu_str, STR_MAX_LENGTH, "cpu/%u/availability/", i);
+    for (i = 0; i <= info->vcpu_max_id; i++) {
+        rc = snprintf(cpu_str, STR_MAX_LENGTH, "cpu/%u/availability", i);
         if (rc < 0 || rc >= STR_MAX_LENGTH)
             goto err;
         rc = -EIO;
         if (!do_xs_write_dom(xsh, t, domid, cpu_str,
-                             (info->cpupool & (1 << i)) ? "online" : "offline"))
+                             vcpuinfo[i].online ? "online" : "offline"))
             goto err;
     }
 
@@ -225,7 +225,8 @@ err:
 static int init_domain(struct xs_handle *xsh,
                        struct xc_interface_core *xch,
                        xenforeignmemory_handle *xfh,
-                       libxl_dominfo *info)
+                       libxl_dominfo *info,
+                       libxl_vcpuinfo *vcpuinfo)
 {
     libxl_uuid uuid;
     uint64_t xenstore_evtchn, xenstore_pfn;
@@ -278,7 +279,7 @@ static int init_domain(struct xs_handle *xsh,
     if (rc < 0)
         return rc;
 
-    rc = create_xenstore(xsh, info, uuid, xenstore_evtchn);
+    rc = create_xenstore(xsh, info, vcpuinfo, uuid, xenstore_evtchn);
     if (rc)
         err(1, "writing to xenstore");
 
@@ -300,7 +301,7 @@ int main(int argc, char **argv)
 {
     libxl_dominfo *info = NULL;
     libxl_ctx *ctx;
-    int nb_vm = 0, rc = 0, i;
+    int nb_vm = 0, nb_vcpu = 0, nr_cpus = 0, rc = 0, i;
     struct xs_handle *xsh = NULL;
     struct xc_interface_core *xch = NULL;
     xenforeignmemory_handle *xfh = NULL;
@@ -330,14 +331,17 @@ int main(int argc, char **argv)
 
     for (i = 0; i < nb_vm; i++) {
         domid_t domid = info[i].domid;
+        libxl_vcpuinfo *vcpuinfo;
 
         /* Don't need to check for Dom0 */
         if (!domid)
             continue;
 
+        vcpuinfo = libxl_list_vcpu(ctx, domid, &nb_vcpu, &nr_cpus);
+
         printf("Checking domid: %u\n", domid);
         if (!domain_exists(xsh, domid)) {
-            rc = init_domain(xsh, xch, xfh, &info[i]);
+            rc = init_domain(xsh, xch, xfh, &info[i], vcpuinfo);
             if (rc < 0) {
                 fprintf(stderr, "init_domain failed.\n");
                 goto out;
@@ -345,6 +349,8 @@ int main(int argc, char **argv)
         } else {
             printf("Domain %u has already been initialized\n", domid);
         }
+
+        libxl_vcpuinfo_list_free(vcpuinfo, nb_vcpu);
     }
 out:
     libxl_dominfo_list_free(info, nb_vm);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 07:59:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 07:59:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770298.1181257 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnCA-0004Rs-P8; Fri, 02 Aug 2024 07:59:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770298.1181257; Fri, 02 Aug 2024 07:59:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnCA-0004Rl-Ki; Fri, 02 Aug 2024 07:59:26 +0000
Received: by outflank-mailman (input) for mailman id 770298;
 Fri, 02 Aug 2024 07:59:25 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AAnW=PB=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZnC9-0004Nv-JY
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 07:59:25 +0000
Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com
 [2607:f8b0:4864:20::733])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 215722ef-50a5-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 09:59:23 +0200 (CEST)
Received: by mail-qk1-x733.google.com with SMTP id
 af79cd13be357-7a1d0ad7113so530042885a.2
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 00:59:23 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a34f6eaa32sm65494285a.41.2024.08.02.00.59.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 00:59:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 215722ef-50a5-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722585562; x=1723190362; darn=lists.xenproject.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=Nk5chRwyGMNH4RApFfMxbG71pBrT7O72w2Y9RG0+qgk=;
        b=kIBL7fnb+BwaoC5uRhGbPjQgbJWeuRVKjigjYtVEUB3A/RkQMA/ybexqDCAvrUNdz8
         8B/2uiUagL3QXTljwjsWzYEBlPhkBVh+jLVWvC1mcytyUNUCmNxV4ugec96nF6MkOH0u
         S75Ld5nUTmcxiCMmkyaoLj4090wgy7B0NkqV4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722585562; x=1723190362;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=Nk5chRwyGMNH4RApFfMxbG71pBrT7O72w2Y9RG0+qgk=;
        b=CPfNjFU/tGvpcPkcdgLC10LF3QjYWaR5f6/WEXH70ABNmkzTEx27zhLObUFJ4f+61u
         jjlXVKZm1kNUfEleTSkhwCpL6E+gcBaXWCLLtf6owoN/EKU/tTqbl0UyG04bnDKw/Mms
         tQQx8mNcpQBQGNrSQRuYs9pic/M3Psv2HYaEqHdrWeaZyrQ7q0DQ7wZJN/fn2DCV7IP1
         LZJZA8rNLayiaLP0h30NH7z6ioUhdIvZ6bFa+fHyx7wpAeIi8eZ2EtGMDsbc5HK81GM9
         nfJsUGLxGlaoBn6YIrZAH3WNQOmRINWJsm6v+kVIpWBHrrOIyEalwVoAKkHrYdIEMpck
         eTKA==
X-Gm-Message-State: AOJu0YwIGmUaxFkYeCYOF6j/DM5jeyjJMLtcGf8ygC2aiMrUmpfJhONS
	++N7Qpk4J7A1DcneGdEt4r6iW0Q8Zmr0RKnzSwtBdA1yxJ1hwyTVhWowUpKugNbV4hV1x5IJnuM
	o
X-Google-Smtp-Source: AGHT+IFjmTsYkFoLwK8EMDNhaHWFP2GJbCf0gVCnLpIVOvsVSjflh7dnOo5WP6XoJwfZPUXwyxdrgA==
X-Received: by 2002:a05:620a:2988:b0:79d:6dd7:5da0 with SMTP id af79cd13be357-7a34efc1241mr307126185a.47.1722585562444;
        Fri, 02 Aug 2024 00:59:22 -0700 (PDT)
Date: Fri, 2 Aug 2024 09:59:20 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: "Chen, Jiqian" <Jiqian.Chen@amd.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	Juergen Gross <jgross@suse.com>,
	"Daniel P . Smith" <dpsmith@apertussolutions.com>,
	"Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>,
	"Huang, Ray" <Ray.Huang@amd.com>
Subject: Re: [XEN PATCH v12 4/7] x86/domctl: Add hypercall to set the access
 of x86 gsi
Message-ID: <ZqyR2Pdh1fte8kdi@macbook>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-5-Jiqian.Chen@amd.com>
 <ZqtsQwZNyFzflDQt@macbook>
 <BL1PR12MB58490598FF7FEAE291DCDAABE7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <BL1PR12MB58490598FF7FEAE291DCDAABE7B32@BL1PR12MB5849.namprd12.prod.outlook.com>

On Fri, Aug 02, 2024 at 03:10:27AM +0000, Chen, Jiqian wrote:
> On 2024/8/1 19:06, Roger Pau Monné wrote:
> > We might as well declare the flags field as uint32_t and avoid the
> > padding field.
> So, should this struct be like below? Then I just need to check whether everything except the lowest bit is 0.
> struct xen_domctl_gsi_permission {
>     uint32_t gsi;
> /* Lowest bit used to signal grant/revoke action. */
> #define XEN_DOMCTL_GSI_REVOKE 0
> #define XEN_DOMCTL_GSI_GRANT  1
> #define XEN_DOMCTL_GSI_PERMISSION_MASK 1

Maybe ACTION_MASK rather than PERMISSION_MASK?

>     uint32_t access_flag;    /* flag to specify enable/disable of x86 gsi access */

I would again be fine naming this just flags and the comment is likely
to go stale quite soon if we add more flags.  However given the
simplicity of this hypercall I'm unsure whether any new flags could
appear.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 08:16:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 08:16:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770365.1181266 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnSW-0008TI-5x; Fri, 02 Aug 2024 08:16:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770365.1181266; Fri, 02 Aug 2024 08:16:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnSW-0008TB-2Z; Fri, 02 Aug 2024 08:16:20 +0000
Received: by outflank-mailman (input) for mailman id 770365;
 Fri, 02 Aug 2024 08:16:19 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AAnW=PB=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZnKl-0006cp-6U
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 08:08:19 +0000
Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com
 [2607:f8b0:4864:20::f2a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5f81108e-50a6-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 10:08:17 +0200 (CEST)
Received: by mail-qv1-xf2a.google.com with SMTP id
 6a1803df08f44-6b79c27dd01so44089106d6.3
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 01:08:17 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6bb9c79c147sm4759046d6.51.2024.08.02.01.08.15
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 01:08:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5f81108e-50a6-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722586096; x=1723190896; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=6nQqqL5en1b240ZJA1HISwDrCWaKk6/SK8XO6tb2Q+4=;
        b=VZxzq6BnDnsB9a849mhrgncHwljlvWknQr5yQZniZFS9z77rFfAsYB5CcYnxLrhcK2
         gDZrhiHLXbr5pQ1APWjcoXOawn3ARg1IxVRKDuaMIUKAY5JUApEdXHXdg/647jnUnxM+
         SxfAWNCP/DO9oCAWUZVI73d6k33S7+tlVnh00=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722586096; x=1723190896;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=6nQqqL5en1b240ZJA1HISwDrCWaKk6/SK8XO6tb2Q+4=;
        b=IUbKT1UJLoom4hFVznHxc9yHpK2k03yhv7uiQqjH88QgBiaH7HEhFCiUuV0kWwUB1S
         uAJIuu7wMF18jyQhXorRuJ/o3nmkfrYrHe4RAzXMuGgKpmWw/qMLX1Jprh7Tn0sOs4qb
         OahBx5FuMrPwtIkCegqy8Rb0Nl5XQRg38HAWUMpE6ZZmI4chN+BQHh4xwlm8elqKcJcE
         OE7+/8qNbRXNZF0KjhRz9/Is+r9EMKay8i2GTbvN5WyKMZgab83aatuS1aJfkHrtcZPD
         sN1cCY8m05v1fZngXKuPfLKBtk6S+i/s94y2vWLAShEckw8YuD75k4kCck7APve7L+II
         8ISg==
X-Gm-Message-State: AOJu0Yw0roflhlcDsAoshj/hlDZp5m/xvN8ruljk7Ck/mPbG3ljrkl2i
	6Hikn3zzFNg1Qt0SG+BMXASWTsH6xdpGGoKGo93DCZzUD0QT71DqclljA32eCyw=
X-Google-Smtp-Source: AGHT+IGx4dAd7/EMrUoSggR9VL0inspdakRiSuh9sMigQhFJRPpe9n9F4/E2zauUZW1oudqtueZqvQ==
X-Received: by 2002:a05:6214:4a02:b0:6b7:9fe3:b2be with SMTP id 6a1803df08f44-6bb984351a0mr38460596d6.53.1722586096257;
        Fri, 02 Aug 2024 01:08:16 -0700 (PDT)
Date: Fri, 2 Aug 2024 10:08:14 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jiqian Chen <Jiqian.Chen@amd.com>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	Juergen Gross <jgross@suse.com>,
	"Daniel P . Smith" <dpsmith@apertussolutions.com>,
	Stewart Hildebrand <Stewart.Hildebrand@amd.com>,
	Huang Rui <ray.huang@amd.com>
Subject: Re: [XEN PATCH v12 4/7] x86/domctl: Add hypercall to set the access
 of x86 gsi
Message-ID: <ZqyT7ocbP6AZEb_S@macbook>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-5-Jiqian.Chen@amd.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20240708114124.407797-5-Jiqian.Chen@amd.com>

On Mon, Jul 08, 2024 at 07:41:21PM +0800, Jiqian Chen wrote:
> Some type of domains don't have PIRQs, like PVH, it doesn't do
> PHYSDEVOP_map_pirq for each gsi. When passthrough a device
> to guest base on PVH dom0, callstack
> pci_add_dm_done->XEN_DOMCTL_irq_permission will fail at function
> domain_pirq_to_irq, because PVH has no mapping of gsi, pirq and
> irq on Xen side.
> What's more, current hypercall XEN_DOMCTL_irq_permission requires
> passing in pirq to set the access of irq, it is not suitable for
> dom0 that doesn't have PIRQs.
> 
> So, add a new hypercall XEN_DOMCTL_gsi_permission to grant/deny
> the permission of irq(translate from x86 gsi) to dumU when dom0
> has no PIRQs.

I've been wondering about this, and if the hypercall is strictly to
resolve GSIs into IRQs, isn't that the case that Xen identity maps GSI
into the IRQ space, and hence no translation is required?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 08:16:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 08:16:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770412.1181276 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnSo-0000c6-Be; Fri, 02 Aug 2024 08:16:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770412.1181276; Fri, 02 Aug 2024 08:16:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnSo-0000bz-8s; Fri, 02 Aug 2024 08:16:38 +0000
Received: by outflank-mailman (input) for mailman id 770412;
 Fri, 02 Aug 2024 08:16: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=AAnW=PB=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZnOF-0007QK-BQ
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 08:11:55 +0000
Received: from mail-qt1-x831.google.com (mail-qt1-x831.google.com
 [2607:f8b0:4864:20::831])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e10daa8b-50a6-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 10:11:54 +0200 (CEST)
Received: by mail-qt1-x831.google.com with SMTP id
 d75a77b69052e-44fe188d25cso28026311cf.3
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 01:11:54 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 d75a77b69052e-4518a781303sm5483091cf.95.2024.08.02.01.11.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 01:11:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e10daa8b-50a6-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722586314; x=1723191114; darn=lists.xenproject.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=MK/jxrHQUVsD+3Bwa975sGauqK671Qx9bmsQqfiytsc=;
        b=KvxcTpskG363Hhro6W9acmAnwbcl8CnyC7+UClXgJ3XOZCS9omc0oyvjGlUy0NLolM
         Yste/EVWcaF8Rm/kPVgfCaPmtOyRz8cWDRboKQdo+GfrnVBo4gl03q3Kb6aswg5r6Jcr
         tLcJjKfI3W6XPnYsMlvD5eHjaaQB1nRJxwwyA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722586314; x=1723191114;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=MK/jxrHQUVsD+3Bwa975sGauqK671Qx9bmsQqfiytsc=;
        b=hDnA6AHmMocUuutzivaVfzkUjxB7RJm6Nf3A3JXPjQEIeZ5nWxJuRG6NmPvbp7WPLU
         3qciH5+qcIwARjSvlsb4dWCMTGXPdS3c8KqkxbF0OyitoOumoj08N+7IyVTg/A3YbZEe
         HIcutL6wklgQ0QIx4MOCLLrWHjEEKgK72EWvKbvy8YQayA+LXZYHzw5NY5dzXCUuWxz5
         2NB6mrQSvSiy8C0NslHGMDTil8xdVslWAN4hOr5mEtcbdwKgtbRWJoFVV+L+ehV5NfqD
         ReCt+lBhB9favRJ57CYnHIA1eHKVnTByLFcQSU8E5vIbbFwJG9XbqczDATyUmzqDU838
         WrUA==
X-Forwarded-Encrypted: i=1; AJvYcCXOYQlDEIFpp5Oz2kZQK+UQ3eesyTvE+qjUvQSxxWlub3uhyZTcomTu6MVwZdj5vZtxG6RXW4EN0gWiMLlVHQLleBYf6oyV9SzOHCtVd+w=
X-Gm-Message-State: AOJu0Yykv+s7cQGpna7OqDSd9kHQiKpOrJdqJJah7LvuZzqNVg1/sB5f
	yIz77dmsYgBayeU3V7TQGUQQ4/QP4NB8BL9mdk5jLoxdI3au19xljY4r8Ujvpu8=
X-Google-Smtp-Source: AGHT+IFMtxPVf08HwzGe0JlysWGGzK4mdZZlLGybpBybhG1SD1ohdSF+QJQ9tLhj7J1q67m8VdA56A==
X-Received: by 2002:ac8:578b:0:b0:447:f0cc:abe1 with SMTP id d75a77b69052e-451892048d6mr30956881cf.1.1722586313368;
        Fri, 02 Aug 2024 01:11:53 -0700 (PDT)
Date: Fri, 2 Aug 2024 10:11:50 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: "Chen, Jiqian" <Jiqian.Chen@amd.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	Juergen Gross <jgross@suse.com>,
	"Daniel P . Smith" <dpsmith@apertussolutions.com>,
	"Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>,
	"Huang, Ray" <Ray.Huang@amd.com>
Subject: Re: [XEN PATCH v12 2/7] x86/pvh: Allow (un)map_pirq when dom0 is PVH
Message-ID: <ZqyUxv7UcaRcksCG@macbook>
References: <Zqn014wCEfWhyo1-@macbook>
 <8ff685a6-0cbd-45cd-a818-4535a040c478@suse.com>
 <Zqn7HEuooChgRCuf@macbook>
 <d65ae152-22ee-4a57-8ff4-43ef0c234f5f@suse.com>
 <ZqoF55yapMxGN_WM@macbook>
 <fa33fbf8-32b6-48dc-a30c-dd76b021a76d@suse.com>
 <ZqogJVHV36ytYVP1@macbook>
 <ff922c7a-aa66-4b23-8b9f-63b0b403ff14@suse.com>
 <Zqo2N7CDshL7ZoMK@macbook>
 <BL1PR12MB584914D078416A5F0ECA0AE0E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <BL1PR12MB584914D078416A5F0ECA0AE0E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>

On Fri, Aug 02, 2024 at 02:37:24AM +0000, Chen, Jiqian wrote:
> On 2024/7/31 21:03, Roger Pau Monné wrote:
> > On Wed, Jul 31, 2024 at 01:39:40PM +0200, Jan Beulich wrote:
> >> On 31.07.2024 13:29, Roger Pau Monné wrote:
> >>> On Wed, Jul 31, 2024 at 11:55:35AM +0200, Jan Beulich wrote:
> >>>> On 31.07.2024 11:37, Roger Pau Monné wrote:
> >>>>> On Wed, Jul 31, 2024 at 11:02:01AM +0200, Jan Beulich wrote:
> >>>>>> On 31.07.2024 10:51, Roger Pau Monné wrote:
> >>>>>>> I agree with (a), but I don't think enabling PVH dom0 usage of the
> >>>>>>> hypercalls should be gated on this.  As said a PV dom0 is already
> >>>>>>> capable of issuing PHYSDEVOP_{,un}map_pirq operations against a PVH
> >>>>>>> domU.
> >>>>>>
> >>>>>> Okay, I can accept that as an intermediate position. We ought to deny
> >>>>>> such requests at some point though for PVH domains, the latest in the
> >>>>>> course of making vPCI work there.
> >>>>>
> >>>>> Hm, once physdev_map_pirq() works as intended against PVH domains, I
> >>>>> don't see why we would prevent the usage of PHYSDEVOP_{,un}map_pirq
> >>>>> against such domains.
> >>>>
> >>>> Well. If it can be made work as intended, then I certainly agree. However,
> >>>> without even the concept of pIRQ in PVH I'm having a hard time seeing how
> >>>> it can be made work. Iirc you were advocating for us to not introduce pIRQ
> >>>> into PVH.
> >>>
> >>> From what I'm seeing here the intention is to expose
> >>> PHYSDEVOP_{,un}map_pirq to PVH dom0, so there must be some notion of
> >>> pIRQs or akin in a PVH dom0?  Even if only for passthrough needs.
> >>
> >> Only in so far as it is an abstract, handle-like value pertaining solely
> >> to the target domain.
> >>
> >>>> Maybe you're thinking of re-using the sub-ops, requiring PVH domains to
> >>>> pass in GSIs?
> >>>
> >>> I think that was one my proposals, to either introduce a new
> >>> hypercall that takes a GSI, or to modify the PHYSDEVOP_{,un}map_pirq
> >>> in an ABI compatible way so that semantically the field could be a GSI
> >>> rather than a pIRQ.  We however would also need a way to reference an
> >>> MSI entry.
> >>
> >> Of course.
> >>
> >>> My main concern is not with pIRQs by itself, pIRQs are just an
> >>> abstract way to reference interrupts, my concern and what I wanted to
> >>> avoid on PVH is being able to route pIRQs over event channels.  IOW:
> >>> have interrupts from physical devices delivered over event channels.
> >>
> >> Oh, I might have slightly misunderstood your intentions then.
> > 
> > My intention would be to not even use pIRQs at all, in order to avoid
> > the temptation of the guest itself managing interrupts using
> > hypercalls, hence I would have preferred that abstract interface to be
> > something else.
> > 
> > Maybe we could even expose the Xen IRQ space directly, and just use
> > that as interrupt handles, but since I'm not the one doing the work
> > I'm not sure it's fair to ask for something that would require more
> > changes internally to Xen.
> > 
> >>>> I think I suggested something along these lines also to
> >>>> Jiqian, yet with the now intended exposure to !has_pirq() domains I'm
> >>>> not sure this could be made work reliably.
> >>>
> >>> I'm afraid I've been lacking behind on reviewing those series.
> >>>
> >>>> Which reminds me of another question I had: What meaning does the pirq
> >>>> field have right now, if Dom0 would issue the request against a PVH DomU?
> >>>> What meaning will it have for a !has_pirq() HVM domain?
> >>>
> >>> The pirq field could be a way to reference an interrupt.  It doesn't
> >>> need to be exposed to the PVH domU at all, but it's a way for the
> >>> device model to identify which interrupt should be mapped to which
> >>> domain.
> >>
> >> Since pIRQ-s are per-domain, _that_ kind of association won't be
> >> helped. But yes, as per above it could serve as an abstract handle-
> >> like value.
> > 
> > I would be fine with doing the interrupt bindings based on IRQs
> > instead of pIRQs, but I'm afraid that would require more changes to
> > hypercalls and Xen internals.
> > 
> > At some point I need to work on a new interface to do passthrough, so
> > that we can remove the usage of domctls from QEMU.  That might be a
> > good opportunity to switch from using pIRQs.
> 
> Thanks for your input, but I may be a bit behind you with my knowledge and can't fully understand the discussion.
> How should I modify this question later?
> Should I add a new hypercall specifically for passthrough?
> Or if it is to prevent the (un)map from being used for PVH guests, can I just add a new function to check if the subject domain is a PVH type? Like is_pvh_domain().

I think that would be part of a new interface, as said before I don't
think it would be fair to force you to do all this work.  I won't
oppose with the approach to attempt to re-use the existing interfaces
as much as possible.

I think this patch needs to be adjusted to drop the change to
xen/arch/x86/physdev.c, as just allowing PHYSDEVOP_{,un}map_pirq
without any change to do_physdev_op() should result in the correct
behavior.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 08:23:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 08:23:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770522.1181285 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnZm-0002o8-4Y; Fri, 02 Aug 2024 08:23:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770522.1181285; Fri, 02 Aug 2024 08:23:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnZm-0002o1-1g; Fri, 02 Aug 2024 08:23:50 +0000
Received: by outflank-mailman (input) for mailman id 770522;
 Fri, 02 Aug 2024 08:23: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=uPwv=PB=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1sZnZl-0002nv-5P
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 08:23:49 +0000
Received: from NAM12-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam12on2060d.outbound.protection.outlook.com
 [2a01:111:f403:200a::60d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 89a0bf5f-50a8-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 10:23:48 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by PH8PR12MB7111.namprd12.prod.outlook.com (2603:10b6:510:22d::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.19; Fri, 2 Aug
 2024 08:23:43 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285%3]) with mapi id 15.20.7828.021; Fri, 2 Aug 2024
 08:23:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 89a0bf5f-50a8-11ef-bc03-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=NC9+UDxbOEA+nJ3pHEYrGoU0aboPMo+MOdMdnnNKRm/XufO8MVhNBaML4p9ma24NBz+nds5vhrfCwVvLOXnt/XTx85Ltil8fKqg4tTHtAbhwliiwnXX0lDJIH5QHpPS4lWmRv/d4eJUY+4Dtv1f2YSQP2B/93GwpPNOtnAJdDz1KOSjqu67KAElJ6n8uZaN1XTXh+mGqggC+3LZmbKJa8gylGSpgJHPxpx0igYWGCZhuk+FN1C20v2i22KYZ0jV7QbVbo89z0cqDAy9CEw6X+zfUnUPiGb5MuCNro/xt0n9k18jmbsIZwx8MScdXnxXNgs/W2kXeTc/sSyj28tdTLg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=i187gn9CPcijMwA5t3I7vtgJ6MsrVrT4NuyA0N6lhTM=;
 b=DYKGJCQWf0SvAdW3iRgvAN7lFBpvKKMYipyh/3zLsB2ljWICAnEItHDkSKGrQvPhVXfUEcTMk/8g5/FrL151MYz4Iy+YvXRsyD8rm1ro6MptpsyuW9tmgFTxD2XHHPut8wwVHpBlZdGnjeqyJU75aUpiIr3rjArrTKMpCJkDPgbLoBoCd79hceJiGu84EKaTgki9uNqkUewrppGlbNLymryzK8avO3Aa1ZYLRbRaLjMppJpbo2SsR3qJ66zBxdvJaoDfgv24BjbttihDJX3hGDWJjG3Mi5Rkb8+jji+Ir5zrAy4Rrqptkl8j75pkfM0JZnEcI7caincSV3gh9feJag==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=i187gn9CPcijMwA5t3I7vtgJ6MsrVrT4NuyA0N6lhTM=;
 b=M7vDAkmZAOELHCavN+GLgtJfTDIiFyxDJuTs4q9z+OzLZ5WLNG0Co9NVEI/VaEpYCkF9yuYGFDPUvpRvD0gRbmtnsMsxDNExKjlo6evVVcd6MyvvpyuOt4TpMNFmZp8dJczyQOFJ3XN/nMktyN4IPJj0kgNTNuOfe0SZJ60TdqY=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
CC: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Jan
 Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, Wei
 Liu <wl@xen.org>, George Dunlap <gwd@xenproject.org>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD
	<anthony@xenproject.org>, Juergen Gross <jgross@suse.com>, "Daniel P . Smith"
	<dpsmith@apertussolutions.com>, "Hildebrand, Stewart"
	<Stewart.Hildebrand@amd.com>, "Huang, Ray" <Ray.Huang@amd.com>, "Chen,
 Jiqian" <Jiqian.Chen@amd.com>
Subject: Re: [XEN PATCH v12 4/7] x86/domctl: Add hypercall to set the access
 of x86 gsi
Thread-Topic: [XEN PATCH v12 4/7] x86/domctl: Add hypercall to set the access
 of x86 gsi
Thread-Index: AQHa0SvYL4tONjoIyEuzfSK6fk2TK7ITw+cAgACJIwA=
Date: Fri, 2 Aug 2024 08:23:43 +0000
Message-ID:
 <BL1PR12MB5849D2461AEFEF735A1A2F17E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-5-Jiqian.Chen@amd.com> <ZqyT7ocbP6AZEb_S@macbook>
In-Reply-To: <ZqyT7ocbP6AZEb_S@macbook>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: BL1PR12MB5849.namprd12.prod.outlook.com
 (15.20.7828.000)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|PH8PR12MB7111:EE_
x-ms-office365-filtering-correlation-id: 20e8429e-8e6a-4b3d-5fa9-08dcb2cc6bf5
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|376014|366016|7416014|38070700018;
x-microsoft-antispam-message-info:
 =?utf-8?B?L1QzU0lLYVpUcVMzeWNOUFNjSm15RmFDRUk3ZG45am9PZG4xZ1NnVFZNcFFu?=
 =?utf-8?B?WUViMmx1ZG9ZRExRTkJzbHlmeG5iclEzTXVreDBUQlM1ODAwelBvWnJzdjgy?=
 =?utf-8?B?ZE9LUm5xRk95dXFHSWVpSEd5UHZ3N0hSdHcwMlU3M21kbVIzaTZBRzN2VFNI?=
 =?utf-8?B?bVFHRjYxNFpYSHBab0x4bGRIeXZ6TnpGUzlrMENIYzNLQVJBUWxjcHlQTFFn?=
 =?utf-8?B?ZEY2b2ZYZGMxanJBajhOMENEcitvSGVPK0kzV293OHZMRU0raDNsOWpPYXFN?=
 =?utf-8?B?WDhSalBwcjJDbFpSbFJtSEMwcUtrR3BFaEh0YjF2RVQrbmovNFdRSWkxS2JL?=
 =?utf-8?B?ZkRydWRWU0xhbWVSZGEybVlZU1hRS1hDdU1FbEdSZ0JYT2ZuY3lDM3FHSDdm?=
 =?utf-8?B?eUxFRnVKUVFGbnZoaTRZTU55d0hmN1hqSm83ckQ3UU4yYTJnOEtXUHFycXJx?=
 =?utf-8?B?NjdBWVpDejhPWWNmR3JUM0NyUldVajdmRTVLUThlZTR1ejRHdGZZY1M4YUdJ?=
 =?utf-8?B?dlFLcEFPVC9YenRGKy8zVFFDQU1OU2VSTjJINWcwTUl2Q0tVK1VYb1RJdVhu?=
 =?utf-8?B?V2x4VEJRUDd5UThYRXh0NFNCNThteThWRkFJRit3VTFzbExiVHBybGR0TDlX?=
 =?utf-8?B?NUJaQjV3bDgwRVVRM0VGaDJobStUMjdUM3JtTGI0RWhSVnlKRi9VUitBR3hl?=
 =?utf-8?B?cVdwSTVOeFY1MDIzUENOMHI4NklzdElJS0w4Um93NDBWZnBpeUl3Tkd5U2VB?=
 =?utf-8?B?ZmdaZzVNLzJrU3hVTkhYTUs4R0NtWklpSlloTWdTZW9HeDZFM0ZxdGpvNzBv?=
 =?utf-8?B?RnVTWG5IbkEzS0IvSnhQYjYvLzNEdUlyMUo3K1BHNVdZaFBhZ05USlZ3b2Vp?=
 =?utf-8?B?VlBxY29LTU1ncnJzSDg5TFJNTG9ickpLbHhiSFdYSFpVdVZZakJXcXQ4Skh5?=
 =?utf-8?B?aGNLV0EyL3JtRFBrc0xGNTR3V011Y3FPOUFzNnRWcm1PdXNzV1JwczZhNzZu?=
 =?utf-8?B?ODZ3dXZzSnRxaWVzbW5xdzVDT2QzVGZOOGtsV20zbzdHTjU2S1NGdTQ3aFFG?=
 =?utf-8?B?cEtqUlQxNC9KWUxxWjkzNWJKQmhjR3VGbnJtSmprdmVkY3h3aDVnbWN1Tjgr?=
 =?utf-8?B?OG1DWjBiejdYSXRycEJEeEhqL2dKV0RhTG9yOXN0Rm5SRm9pd3E4eWR2U3BU?=
 =?utf-8?B?SDBYUGtnTUtpbXFYRmVGaU9EN0VHMEptSm9PYmtRUHVqa2JxcUhKQ0lCdGp6?=
 =?utf-8?B?YmFjMVU5eStNN0lZTVVwRGRtL29xZUI4S0c4VVRUME9GZnpsbnUvTDJpZzl1?=
 =?utf-8?B?MUQ0dUNmVEZrVytqbGdkSkRVa2lRczFkMXZkVTNJVkt4OFhRNWZacXRPU1BT?=
 =?utf-8?B?NzRjZmsxWS9TaVhSQVZ4VW52VmhpUlVFMVlnMXQ5UmxwbTFKdFEwdDBnSkYx?=
 =?utf-8?B?WUNadUQ4YlZ2K244R0pEL0RCeEhCcVJpWkR1V1N1UVZlbG53L2FGVHJxdGVr?=
 =?utf-8?B?a0lseXl3eDVVZHNYNUxoZW5YMEQ1SDNTSy8zSXZiNzN4am1xRjFWOElCTTZY?=
 =?utf-8?B?OW05bEhyblVKbjJNV2k0c29GYnh4cFBwTWIwdnBFVk12SjB1dTZ3cFJBY1hS?=
 =?utf-8?B?YkxGcWdGRTlHZmlMQ3c3aFRWY21idTM1ZHluMFBxeFhMNlg5UktlVUFrZVE3?=
 =?utf-8?B?L05HWVVLVlRSVXFGQS9qUVlGQzdSamxGRDcyN0dIUVA4MVcrblZHcGUwOGth?=
 =?utf-8?B?MEVtY0Vjd0dWTXFuRWZwYzcyVWs4djBmWHFTV0htL2JBZXJORlkzdk85a0NQ?=
 =?utf-8?B?K05wUVI4UXhQcFFrSmEzVGxDSzZ6bDQ2MlBIbTh3am1ITGpkd2JDaHpleENw?=
 =?utf-8?B?anhjZW1hYVRVNExHQ3hYWlZmSS9aODliY2pENnJJaGQvaHc9PQ==?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(7416014)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?Z0tVdXhjeUZWUkdub2RtaFNLa2lmOHBaVnlwaUpmN0RIclFWT0xCV01HeC9G?=
 =?utf-8?B?QXkrUEZ0cTJhUVMyYkcybFprVk5pV2dLYzZmZjVKNmZjbEQvVVNKVUZVNm1S?=
 =?utf-8?B?MHZSZ0ozb0U3d29rQlh2QWNpckR2d1M2empKZVZxclJhbWIvRkU5T1FpNUd6?=
 =?utf-8?B?TGN1NjQ4Tm50MTk2NjZBZXV6SnZtaUNkT0lJbE9XTkRmMGhGR2Jud21Cd3Az?=
 =?utf-8?B?Y2t6S0VZOGJCZm5MRVBYUDJYaGxIYkNYbnZGcUVkRXhNa1BGa1Q2WWFiaFdi?=
 =?utf-8?B?S1grbkZLTzlvS2dVSEh2U3dIK1RwSHBKWFNYMlBNcGVmMndLNDAwY3RGNU4r?=
 =?utf-8?B?ZTVRSVYyWXNhbzdXMXAwNXNSSTF0WWRIMmxuR3dkQ21HakVLODJ6ZG0xSmM3?=
 =?utf-8?B?QkM1c0dTN0FVd0RvVFpiWk5PbGI4MXdzK0U3V0dzRGZlOG9teWhsKzFlcFpk?=
 =?utf-8?B?bW5QQW91cTZ0UUFVYjVGdWhqQ0FiQW8yRGRVUlBHNmZVZmMyNjZxOHR0OXpH?=
 =?utf-8?B?R2VEUXVpY1hYSTB2eHNvdDQxQlkrclRxZTNXNytCc2RYQ05JcXdRYlVyRGVx?=
 =?utf-8?B?bjNXYnB6dmZtVjhlT3ZkSzhkODEyMEYwZ2xWeUsxSjdMTzI2VUtqRUdjMGJT?=
 =?utf-8?B?VU1RVlhKcFpVQnNkb3pRZmwyZVQxOXljYjFLYXhIbkJQWkthd0QrQnJVMUMy?=
 =?utf-8?B?cnVVTS8xQktmVVhYY3d0Nno5Uy9ZSUNEZzgvZHZabVdKRW9wQW9CaHhJWGxx?=
 =?utf-8?B?eFBMKzg2S0k0RnF0QW1KSjFwMHZJL3Z1ckNEMlkrVHJiMERSMFFISi9iMy9z?=
 =?utf-8?B?d2JaYzgxM0pmek1TRWpVTEdYVmxsMEpXdUNQTUh2TlBVa0VSVGg3VUVuM24v?=
 =?utf-8?B?N28zWDVzMUlGUXo1a1F0QWJ6RTVFRXVnTHJDZXFxeWhkVTlFOEtrK09IaitP?=
 =?utf-8?B?NnVOVkRPYis4Tm1lVkhDc1kxWDdZNG53NmxSenRUQkRFYVpod2VybkRiMTc1?=
 =?utf-8?B?M1lYOHNVOVBtbHhiZGJkZ0w1T3dNZDRpR0NBaXlDVlBINmN0VUFzU3RJTDYw?=
 =?utf-8?B?a1FzVVJKY2s2WFM4aTNVdFdVb3V6aWo2QU9GQXN2Z0UrUXl6RFExTFh0SjVZ?=
 =?utf-8?B?dnQ1RlEyaC90clNOaVNtdS9XMzJ4bGdKN3JLY2Z6L3JYcFllY1FrV1JaTXg3?=
 =?utf-8?B?WmxzT0F2VVFQamZxRG1TUkdLTnEyc3padXVtVjNOQlluaWtMenh5TlJxQzM0?=
 =?utf-8?B?YjkwdURMZTNoeERuMTJkaUNCZFdvOW5wKzBrWkJHKzFWeGVTcFdWeEZJdWEv?=
 =?utf-8?B?bGxhektzNUZEL0lhUE5KWm90K3BrcWFNaHJvVXA0OWN3WlFpVnZHWEtFRjlx?=
 =?utf-8?B?VkRXTit3cGtWOTVNbE5GdGtncDlkeHF6Vm9aK2pFUzhKc1NjVTZrQU5xYVRz?=
 =?utf-8?B?d2xyZFYzZ2xjbkx3ZWpPeHFYbU9NVm83d2RIQzUwQkNBelluVE8zMVNDRmk0?=
 =?utf-8?B?K0F4bUQ2MkNJbmczR2tFL1RrZFE2aTl6RW1mUGtrelBlaTRCNm5QTUFRZ1R1?=
 =?utf-8?B?MTJQVGZucmxqelkzMXRMNnNqVVBoMmh2c1NLQnBtaEtRd0x4a0RzS3hMOFlZ?=
 =?utf-8?B?RlhCYWg2MUJOZStYYTFOTEJiVFl4anBZU0tZOVZla2hRUVEveUREcnIzMHhK?=
 =?utf-8?B?VmRJT2tnd2g3czVhUHRuVlpnbHl6emdvTWRZZVhYQi9hWFFnekhZNDFzLzYv?=
 =?utf-8?B?QjhkWEM3VVIzaDY3cHp3ZDVVTmFwMXVMRjB6SFQvR3VSaHVCY0IxbXZYQ1Z6?=
 =?utf-8?B?RXJTbnhVZ1JoRVV3V2wxQThFYkMyL29JQytQR0VJRDVXRk9tUnIxeHpCY0JJ?=
 =?utf-8?B?QXpvenU0RzdBa25JTjJwcTBuOFlwRXA5Q3lDcnFpR1M2cmhWVmovczR2MXdo?=
 =?utf-8?B?UkpuVi9JMlZwb3k2eWlCcUR3YVpPRG9venA5MDcveTAyUHN2eHZVcVVYSTVr?=
 =?utf-8?B?bmJjaWNMbUxtN01WVXVpOTJ5UE9qV0xEczZqZU94NzJ5SFo0c1BBWEh4dWhI?=
 =?utf-8?B?UHJOWFpGN2FVR3doWUdtTmNUMTdvVlQyUkVLOS8zUmpkOWJ3VWVqQlExU3dY?=
 =?utf-8?Q?+A9g=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <9295BB0216942D4E8C38E1B11B8AC931@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 20e8429e-8e6a-4b3d-5fa9-08dcb2cc6bf5
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2024 08:23:43.3663
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: M/EInlKYvuyJiC0ARrSyTedC4RLChJ56snTS5NOeGsn6FC/p2ySiNTw0oB5kuqf64DMJ/Bt5nCxSUE4qaQZhLA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7111

T24gMjAyNC84LzIgMTY6MDgsIFJvZ2VyIFBhdSBNb25uw6kgd3JvdGU6DQo+IE9uIE1vbiwgSnVs
IDA4LCAyMDI0IGF0IDA3OjQxOjIxUE0gKzA4MDAsIEppcWlhbiBDaGVuIHdyb3RlOg0KPj4gU29t
ZSB0eXBlIG9mIGRvbWFpbnMgZG9uJ3QgaGF2ZSBQSVJRcywgbGlrZSBQVkgsIGl0IGRvZXNuJ3Qg
ZG8NCj4+IFBIWVNERVZPUF9tYXBfcGlycSBmb3IgZWFjaCBnc2kuIFdoZW4gcGFzc3Rocm91Z2gg
YSBkZXZpY2UNCj4+IHRvIGd1ZXN0IGJhc2Ugb24gUFZIIGRvbTAsIGNhbGxzdGFjaw0KPj4gcGNp
X2FkZF9kbV9kb25lLT5YRU5fRE9NQ1RMX2lycV9wZXJtaXNzaW9uIHdpbGwgZmFpbCBhdCBmdW5j
dGlvbg0KPj4gZG9tYWluX3BpcnFfdG9faXJxLCBiZWNhdXNlIFBWSCBoYXMgbm8gbWFwcGluZyBv
ZiBnc2ksIHBpcnEgYW5kDQo+PiBpcnEgb24gWGVuIHNpZGUuDQo+PiBXaGF0J3MgbW9yZSwgY3Vy
cmVudCBoeXBlcmNhbGwgWEVOX0RPTUNUTF9pcnFfcGVybWlzc2lvbiByZXF1aXJlcw0KPj4gcGFz
c2luZyBpbiBwaXJxIHRvIHNldCB0aGUgYWNjZXNzIG9mIGlycSwgaXQgaXMgbm90IHN1aXRhYmxl
IGZvcg0KPj4gZG9tMCB0aGF0IGRvZXNuJ3QgaGF2ZSBQSVJRcy4NCj4+DQo+PiBTbywgYWRkIGEg
bmV3IGh5cGVyY2FsbCBYRU5fRE9NQ1RMX2dzaV9wZXJtaXNzaW9uIHRvIGdyYW50L2RlbnkNCj4+
IHRoZSBwZXJtaXNzaW9uIG9mIGlycSh0cmFuc2xhdGUgZnJvbSB4ODYgZ3NpKSB0byBkdW1VIHdo
ZW4gZG9tMA0KPj4gaGFzIG5vIFBJUlFzLg0KPiANCj4gSSd2ZSBiZWVuIHdvbmRlcmluZyBhYm91
dCB0aGlzLCBhbmQgaWYgdGhlIGh5cGVyY2FsbCBpcyBzdHJpY3RseSB0bw0KPiByZXNvbHZlIEdT
SXMgaW50byBJUlFzLCBpc24ndCB0aGF0IHRoZSBjYXNlIHRoYXQgWGVuIGlkZW50aXR5IG1hcHMg
R1NJDQo+IGludG8gdGhlIElSUSBzcGFjZSwgYW5kIGhlbmNlIG5vIHRyYW5zbGF0aW9uIGlzIHJl
cXVpcmVkPw0KWWVzLCBmb3IgZ3NpcyB0aGF0IGhhcyBubyBlbnRyaWVzIGluIG1wX2lycXMsIHhl
biBkbyB0aGUgaWRlbnRpdHkgbWFwcy4NCkkgd2lsbCBkZWxldGUgdGhlIHdvcmRzICJ0cmFuc2xh
dGUgLi4iDQoNCj4gDQo+IFRoYW5rcywgUm9nZXIuDQoNCi0tIA0KQmVzdCByZWdhcmRzLA0KSmlx
aWFuIENoZW4uDQo=


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 08:27:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 08:27:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770614.1181296 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZncu-0003xp-J3; Fri, 02 Aug 2024 08:27:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770614.1181296; Fri, 02 Aug 2024 08:27:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZncu-0003xi-F4; Fri, 02 Aug 2024 08:27:04 +0000
Received: by outflank-mailman (input) for mailman id 770614;
 Fri, 02 Aug 2024 08:27:03 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=uPwv=PB=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1sZnTV-0008NN-Vr
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 08:17:22 +0000
Received: from NAM04-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam04on20600.outbound.protection.outlook.com
 [2a01:111:f403:2409::600])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a302cf9a-50a7-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 10:17:19 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by PH8PR12MB7111.namprd12.prod.outlook.com (2603:10b6:510:22d::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.19; Fri, 2 Aug
 2024 08:17:15 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285%3]) with mapi id 15.20.7828.021; Fri, 2 Aug 2024
 08:17:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a302cf9a-50a7-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=hW6pO0Et/+OVcLjuqYxssjhBUWMnDMW1Sf5TNe+QYS343qQGkYnJROfwWIYLI/mOqsFlmBJ5HuLzN1vpoE+nua/bJiBsFc06JIv5Bn84zjchw44ILvWGbSNeI2nGfiMV7dwfV3BWSQpNVbGoNV+/GolZxg777P90myQ65Jo58HH5mcDNktVKNifcxBm2h9X5aErtMS1rpGxAnc7BIBo/sCEm+R0Bch9N6GZ3VqHrJLtMQXn0VFrNZFMEGym+D4VVggIEcD4P1Fc1sdS4x/BAQGtAyFC6HHFb3TGCUWVq8PlAqNXkxxIXzjjgCJ4eQhs+UqDA0aFfWreeQOHtAoi05Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5/Xdn0c6GSwx/UBo0/+K3FdxF6Lu5JfgjRT/youEiSw=;
 b=YdlU0NhMQKE79xB+2RYXPruElIWPsQouURNAqY/RB1L8f3cfcFf2QhrefrqGmfUE1jVfNlUIsyGyUT+tO3D4ECkKVsptIiYKdfw9jzr/0zDioyfBi2yvZ1Jr0E+PZ3EO1JQF9F08fH7CEyA8lb2VNTnFpjRmzzbDWiYDNDFfKa3/E5EU0gXBMH5spr10mHUoxGxwINS3ldBp3bCBAmJPm3cUdix1Er006aXKWycfmn6wN3s2t/XJ+ID+ylZJ0IyZUqAKUyiCYttEOQrCap/PQEIzZ22TEwznLftp/lep0GdL+WvM8lhs7VI7CSWNqqoV1cOtAjkEeneoX7vd30R+GQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5/Xdn0c6GSwx/UBo0/+K3FdxF6Lu5JfgjRT/youEiSw=;
 b=JWo2ga9kmX0KG6azBd5velk0zN/P0rgrxweVRjn/p9XGlYAv4RQ4dMmZL1ULWCBTdLdHNi1oSEN08wx4sPX+qKnRtfvOjXtOtwSW5TrT8cD1xdyZ6OSNrbc8OofxdLauEoKIsxgHvGcLkNHndFydSB7/Rcsv4xIKdbasfjPKBi0=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
CC: Jan Beulich <jbeulich@suse.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>, Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wl@xen.org>, George Dunlap <gwd@xenproject.org>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD
	<anthony@xenproject.org>, Juergen Gross <jgross@suse.com>, "Daniel P . Smith"
	<dpsmith@apertussolutions.com>, "Hildebrand, Stewart"
	<Stewart.Hildebrand@amd.com>, "Huang, Ray" <Ray.Huang@amd.com>, "Chen,
 Jiqian" <Jiqian.Chen@amd.com>
Subject: Re: [XEN PATCH v12 2/7] x86/pvh: Allow (un)map_pirq when dom0 is PVH
Thread-Topic: [XEN PATCH v12 2/7] x86/pvh: Allow (un)map_pirq when dom0 is PVH
Thread-Index:
 AQHa0SvUYCKIEvNO4Ei/mjm7Qit34LIQmkQAgAACPwCAAAdkgIAABG0AgAADDACAAALkgIAACfqAgAAE/oCAABpKgIAAAsoAgAAXhYCAAvm8AP//2VcAgACHGIA=
Date: Fri, 2 Aug 2024 08:17:15 +0000
Message-ID:
 <BL1PR12MB584967C87F8EBC9B753C7B10E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <Zqn014wCEfWhyo1-@macbook>
 <8ff685a6-0cbd-45cd-a818-4535a040c478@suse.com> <Zqn7HEuooChgRCuf@macbook>
 <d65ae152-22ee-4a57-8ff4-43ef0c234f5f@suse.com> <ZqoF55yapMxGN_WM@macbook>
 <fa33fbf8-32b6-48dc-a30c-dd76b021a76d@suse.com> <ZqogJVHV36ytYVP1@macbook>
 <ff922c7a-aa66-4b23-8b9f-63b0b403ff14@suse.com> <Zqo2N7CDshL7ZoMK@macbook>
 <BL1PR12MB584914D078416A5F0ECA0AE0E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
 <ZqyUxv7UcaRcksCG@macbook>
In-Reply-To: <ZqyUxv7UcaRcksCG@macbook>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: BL1PR12MB5849.namprd12.prod.outlook.com
 (15.20.7828.000)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|PH8PR12MB7111:EE_
x-ms-office365-filtering-correlation-id: 8f06b300-3ce7-456d-63ef-08dcb2cb84a2
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|376014|366016|7416014|38070700018;
x-microsoft-antispam-message-info:
 =?utf-8?B?YmxNY0pZdjlRVWtuNEt2UHJhVTdINTBUYnU2a3FqeXM5Tkd4YWtyTmdwbCsw?=
 =?utf-8?B?eXJWbnNSSWFnMGx6b0lGRjhFRnkvZWx1bm5JR0Y2cUdXVnZyUnV3WndzU0Fs?=
 =?utf-8?B?TDU3UytmeFBnYkFqaXBDUmJ6blBCSFZaVjNGUzBJb1kxcFQ5N2JGSGFoTEVt?=
 =?utf-8?B?VjFNeUYxSm16RGFEY1BrTnVqY05Ba3FFTlJyYlg4OEY1RUpxRDIreDJCTGNL?=
 =?utf-8?B?TzlZN0VjUTY0NlRkQkJ5bElobEY3c2dVdXlJQjU0eE5ibnE1ZUxKUzZyQTBa?=
 =?utf-8?B?YVU4blFtN3R3ZTJ0Z0J6YllBQnRiemhDaVdUdWFBaE5iSkgvREpLc2w5Mnl6?=
 =?utf-8?B?dGllQ21rdkZaZUhrMDFmZE1QMDUwb3hqdXlpZlBRdEVPeUoxZ1Z1aVJHYXZq?=
 =?utf-8?B?SDR5bzhqQTM2TTQweVBhMVZYeUUyVVNaaHBIYUlQdzdLRWJvRTJUZTN3NUlR?=
 =?utf-8?B?Nmw1VmJkUUk2R3JDK252OVp4MzFzd0NvZitxVmpRSWsxK0NmS0RvcWt2THZa?=
 =?utf-8?B?Lzc2SVk3VE5LRFFPZitTVzZzaEVVS2hmOFNqREErcGQ1OVA5VlpXR0g0UWJP?=
 =?utf-8?B?cCszTVk4RmZnT3J2VHQzSnZNWU1mc3hIU0c5bklDbUw1ZW1yVVhTMndNditX?=
 =?utf-8?B?K1FnWHZQRm1xOHdlblJQQUR4TCs4US85ZldZRFJ2UkE1SjA0RUtJWUhvcnlh?=
 =?utf-8?B?T05oWmRaNndLWE1ZcU5sRGlsb2k0bnBZeEZ5VFRDRHZmL2Z2NUlVRko5NHVh?=
 =?utf-8?B?RVVzdFVXd0FjWXVoQnlWaE4wYlAzZEo0a3czU3Q1SHZsSXBzR091aXZkalFQ?=
 =?utf-8?B?WWVzN2lHL0t4ZE1FNFMwdzluQWpTTTdQb1BwL1U0WGhXdFZpbXVMdU1BL1BV?=
 =?utf-8?B?TFF6bmNHRVFMeUZSNXJ3S3hqM1MrWVMybFBYQk8ydWN1NXhxeXNVanBORytl?=
 =?utf-8?B?cHArb3d3V0FsM0d1a2VCOGVteVJYaHIvWndSMWJJc2xucjhpdzhWSkxjQjBz?=
 =?utf-8?B?SS9nZERCZUltWFZKY0lZWS81SDNRZUczMk01cW1QVXhDeXBCcE5zNytQU0RN?=
 =?utf-8?B?dU00WDhodFJUeTdqdFJJdlhMayt6RzlmeVZJdUVnZWJOditVU1psTzlwaXdt?=
 =?utf-8?B?OWt1SWJFQ3ZIY01YS0hYeWc5MXBmWWw0ZjZOZDdRaE9zejdTUkpXeDdkaWsy?=
 =?utf-8?B?TWY2R2dKYnJEUjlVRXFLOU1OZmJoV3c3ZVJlMDlMQmE1WGhjN2pua01sRE40?=
 =?utf-8?B?MWRKYjd5Wkc0TGNVUUVkZDJhOFZGZWh1WU05RlY5eWg3U2F2MFB1SDdnQXNo?=
 =?utf-8?B?OWkyY1AxeXIzS3IzN0w2djhFSk1WSGRSNWlwNkplamRDYmtjY0tDK2RaZXlN?=
 =?utf-8?B?UklEbWZObFRxaXRmeGJobDlvQm85YVFQUzUreE9HZllrUUI4MEkrbkZjVlBH?=
 =?utf-8?B?TGNLS2tCVmVhMGlmUTZmTmVDaXVhSUw0Q1hnRnRKODJxMFNjYXBFUHZJMGNB?=
 =?utf-8?B?YjRkWFlEZ2RjRmFXSkpndHNxd0I1L2JwdzlJbzdtWGpJQVBJQjZ6djdDOGpT?=
 =?utf-8?B?LzRvMjZzaDFoQzMrclZ0bG03T1U1RWo0RXRUYTRkcnZqK3doMWF2cWFDSWgv?=
 =?utf-8?B?bEFMQmxEaDBLUCtUeEVOVERCUEdXbUdVUmQwVjJSMU1ianV5ekVWTnpQRTlV?=
 =?utf-8?B?M0ZON3lHVkQ4cTFEMW0rSWdPeXdZR2dpWjdSaFM5NTNXRmdneVJ1aU9xOXdr?=
 =?utf-8?B?QktnTGJ2L0lEOWVuSHdmMHV5VEZqL0tqUjFrVUxKZlNsWHhlRHlNUm9CMGJj?=
 =?utf-8?B?aWQ3RUpKRzdyRm90KzZRZzhtYjNvL1lTTS9NdnBQdmVZam9VWStJd3g5S010?=
 =?utf-8?B?MG5NMzBVeTdnY3V5YzFLZmI3bDlSdXJhcE5SSm5VcHBFblE9PQ==?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(7416014)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?aE13a2psMjFob21tWC9ZdVJSU3duMWF3dHRETS9qdlBWQm5YZnU0clZaZ3ZX?=
 =?utf-8?B?UnkvNnh0MFUvRjJtL1lhc3ZPVXJGOUFHVkZBZXhKMytoQUxvaHFPRTZ4QmRU?=
 =?utf-8?B?aldPcDN1Z2xKNUxyYlp4VW54SUxsbEp6NnI5cmY4NFdOZGpXZTAvT1VvTDYv?=
 =?utf-8?B?T0QrcVdnWWJOVTUwbUt2ZnAva0ZGbW5ubG4vd2FYUENua0dTUWlhcDVxN3dj?=
 =?utf-8?B?cUtqQ1FOeHpaeXBDRTJCMVVhbDlCY2RCVlc4Q1FPbkRIbk5kR01ubkpReGgy?=
 =?utf-8?B?cVBnSGxZbGRRanRiWDhsalBMM05UOU9zaGg3SzRtd0ZNSElEZTFnTXhiZ3Y1?=
 =?utf-8?B?Ymt0NFY4djBKY3JiQXVueHpXTCs3OGJiQUNUcUNYbkkwSnJBbFdnQnMwVkJE?=
 =?utf-8?B?ZjYwOGs4Q3ZxT1Z1TmhjanZPYzUrako2TmZSQVQzUU5HdnBaMWJDNnFSQzh4?=
 =?utf-8?B?NHZzeUZUUUlRb0l1RmJGL3FvQ2hWa2JFekRxWG1JckdkUDlXdmY5dE9hSTR3?=
 =?utf-8?B?YUZoYVE1SUl3MXF1Z2IvRE51dlA2UGdwUEtHeWJEeno3L2RxQU9obS9uUFRh?=
 =?utf-8?B?M0N6a0ZTd3dlMmhycy8vam1OTjBEWXNNRlh6VnpBTTluQ0hROUJqZU85bHUz?=
 =?utf-8?B?cjFzUyt3TjYxamI4KytiQlExR2kycUtRcmRLME1XTFV3Z0E5WXQ3eklma1J0?=
 =?utf-8?B?MFFIT2sxRno0UFdaRDlCWFNkaHIwRXdKSkhaZ2xPN1hnekR5WE1INjY0UERB?=
 =?utf-8?B?dGY1YXVWODFsRUFzRm1temxFNXU2ZGZvdm45MXE3OW1FaXFiblZyTFduTVJP?=
 =?utf-8?B?LzkrQ1B4cnRaTXl3cVlYMkw3MytIZXkxTlo5a1N5REtLV2JHNjArTmJtVnZi?=
 =?utf-8?B?V2ZySUZBUGlqeGhoTldKRjU1UTIxM3V3YXh4TTVNNlZkdzZiQURGOHQ4MSs2?=
 =?utf-8?B?NzVpdlNObE8yQm1XeHlZZ1E4ZlpNLzRnb1VLcGpHK1hnNko4eGg2WjdiU2xr?=
 =?utf-8?B?LzR5SlMrZ05FVWlOV2xUdkhxLzJKaWh4bWNxWHdVcFZ2a21raWppQW0xOFVO?=
 =?utf-8?B?QVhlOEs1a01pY244UXN5eUFBOTRWdHIvUEJFUjFQckxmRkVWWWQ5MmZ1NmJz?=
 =?utf-8?B?eE9lNlRZTnJqck16NUpLM2F1T2pKWVJyYXlQUzM2aUlSZWxTbVlBT1B3bXZa?=
 =?utf-8?B?bmlvcWN1RnkrZHIxNi9UWnJta3phTlR4WjB3VGtMdWZYdlpUOG40OXBhdGUw?=
 =?utf-8?B?VVF5bFJQZXdGcUtHMjdjbklPWXc3RTQvZENFeUZuNGxCMEw3TzNnS3E4aTQr?=
 =?utf-8?B?d2NQblNnRnZqMlpTNW9aTmMzR3diamRyNytPMGtPaCtCSWREMndXa1VWUHJJ?=
 =?utf-8?B?RnlaNklqTDJJNTYvdTc5aUVKVEhGVDV4RGxJRUwveXR6SEhHZ3lpZVpTQkdj?=
 =?utf-8?B?UnZWOGR0QWNrQUxmSVV0UWladER3OUhnQ2pldlkzNWlULzFMK1dmYS9VTFFC?=
 =?utf-8?B?MTg5VUgxUjJRaU55VW1sb0pjTFhaWi9XMG1WTS82T3lLUlJ5MWgyMW9aeWo2?=
 =?utf-8?B?a01Oa0R1eGUzcDNrVVJPZWxQM3hmV1B6cWdobjVHMWVRRGtHZEh6L3BldkV1?=
 =?utf-8?B?dEJwSGlTMWdrMXlWbC9PdW1VcEdQT1VGYnlnNHVEakZYT21ocmhmdHl0ZzFF?=
 =?utf-8?B?eGhZZzJEM0N4aXFDUFdocFpwc25Yd0piNk9yaTRUb3dCNjRQcDg4NnlhOHp2?=
 =?utf-8?B?UEs3NXpWQ1lZNXlBeDFtbnlOVktvbDJsVGcxbVU1KzNGZnFyY1FDbVVDeiti?=
 =?utf-8?B?VEdCODFwa3VOZ1FUempLcDhWVHc5UVkvSCtGN09HN1d1d1Jub2NOZEFNaW1C?=
 =?utf-8?B?MVg2WXBPcEovSVI1NVl6VGF0RnlhQmxkNUtLU21scGxScVlKRTlaVERIaWZz?=
 =?utf-8?B?RVcxbFBDc01VUldJWjFGdGE1OXphdDF0cmVhY1ZJOTJWZ0RNc2xCTjRycERu?=
 =?utf-8?B?amw3TUxXdXdGckNMbW10N1B6UkRhVHF1NTJjcDhjdVJXaFdXTmNNUVJ2ekgy?=
 =?utf-8?B?bE1PZmdSSWt6Qi8rSHVFVlZZZjlnV0ZFUG1rRi9SYWRXNnJzN1RqRXRCZUpj?=
 =?utf-8?Q?TSE8=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <B90A1A7DB16E724183E59EC977C15DB5@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8f06b300-3ce7-456d-63ef-08dcb2cb84a2
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2024 08:17:15.2687
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: cmtwphKaDIBwK6AUZTE+cm6m18BR8zL3/Z/xecAus+JQ7iYwJy3wz78wi2rw6MvJNqKLPPlOgLVp3RWQs/cKkQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7111

T24gMjAyNC84LzIgMTY6MTEsIFJvZ2VyIFBhdSBNb25uw6kgd3JvdGU6DQo+IE9uIEZyaSwgQXVn
IDAyLCAyMDI0IGF0IDAyOjM3OjI0QU0gKzAwMDAsIENoZW4sIEppcWlhbiB3cm90ZToNCj4+IE9u
IDIwMjQvNy8zMSAyMTowMywgUm9nZXIgUGF1IE1vbm7DqSB3cm90ZToNCj4+PiBPbiBXZWQsIEp1
bCAzMSwgMjAyNCBhdCAwMTozOTo0MFBNICswMjAwLCBKYW4gQmV1bGljaCB3cm90ZToNCj4+Pj4g
T24gMzEuMDcuMjAyNCAxMzoyOSwgUm9nZXIgUGF1IE1vbm7DqSB3cm90ZToNCj4+Pj4+IE9uIFdl
ZCwgSnVsIDMxLCAyMDI0IGF0IDExOjU1OjM1QU0gKzAyMDAsIEphbiBCZXVsaWNoIHdyb3RlOg0K
Pj4+Pj4+IE9uIDMxLjA3LjIwMjQgMTE6MzcsIFJvZ2VyIFBhdSBNb25uw6kgd3JvdGU6DQo+Pj4+
Pj4+IE9uIFdlZCwgSnVsIDMxLCAyMDI0IGF0IDExOjAyOjAxQU0gKzAyMDAsIEphbiBCZXVsaWNo
IHdyb3RlOg0KPj4+Pj4+Pj4gT24gMzEuMDcuMjAyNCAxMDo1MSwgUm9nZXIgUGF1IE1vbm7DqSB3
cm90ZToNCj4+Pj4+Pj4+PiBJIGFncmVlIHdpdGggKGEpLCBidXQgSSBkb24ndCB0aGluayBlbmFi
bGluZyBQVkggZG9tMCB1c2FnZSBvZiB0aGUNCj4+Pj4+Pj4+PiBoeXBlcmNhbGxzIHNob3VsZCBi
ZSBnYXRlZCBvbiB0aGlzLiAgQXMgc2FpZCBhIFBWIGRvbTAgaXMgYWxyZWFkeQ0KPj4+Pj4+Pj4+
IGNhcGFibGUgb2YgaXNzdWluZyBQSFlTREVWT1Bfeyx1bn1tYXBfcGlycSBvcGVyYXRpb25zIGFn
YWluc3QgYSBQVkgNCj4+Pj4+Pj4+PiBkb21VLg0KPj4+Pj4+Pj4NCj4+Pj4+Pj4+IE9rYXksIEkg
Y2FuIGFjY2VwdCB0aGF0IGFzIGFuIGludGVybWVkaWF0ZSBwb3NpdGlvbi4gV2Ugb3VnaHQgdG8g
ZGVueQ0KPj4+Pj4+Pj4gc3VjaCByZXF1ZXN0cyBhdCBzb21lIHBvaW50IHRob3VnaCBmb3IgUFZI
IGRvbWFpbnMsIHRoZSBsYXRlc3QgaW4gdGhlDQo+Pj4+Pj4+PiBjb3Vyc2Ugb2YgbWFraW5nIHZQ
Q0kgd29yayB0aGVyZS4NCj4+Pj4+Pj4NCj4+Pj4+Pj4gSG0sIG9uY2UgcGh5c2Rldl9tYXBfcGly
cSgpIHdvcmtzIGFzIGludGVuZGVkIGFnYWluc3QgUFZIIGRvbWFpbnMsIEkNCj4+Pj4+Pj4gZG9u
J3Qgc2VlIHdoeSB3ZSB3b3VsZCBwcmV2ZW50IHRoZSB1c2FnZSBvZiBQSFlTREVWT1Bfeyx1bn1t
YXBfcGlycQ0KPj4+Pj4+PiBhZ2FpbnN0IHN1Y2ggZG9tYWlucy4NCj4+Pj4+Pg0KPj4+Pj4+IFdl
bGwuIElmIGl0IGNhbiBiZSBtYWRlIHdvcmsgYXMgaW50ZW5kZWQsIHRoZW4gSSBjZXJ0YWlubHkg
YWdyZWUuIEhvd2V2ZXIsDQo+Pj4+Pj4gd2l0aG91dCBldmVuIHRoZSBjb25jZXB0IG9mIHBJUlEg
aW4gUFZIIEknbSBoYXZpbmcgYSBoYXJkIHRpbWUgc2VlaW5nIGhvdw0KPj4+Pj4+IGl0IGNhbiBi
ZSBtYWRlIHdvcmsuIElpcmMgeW91IHdlcmUgYWR2b2NhdGluZyBmb3IgdXMgdG8gbm90IGludHJv
ZHVjZSBwSVJRDQo+Pj4+Pj4gaW50byBQVkguDQo+Pj4+Pg0KPj4+Pj4gRnJvbSB3aGF0IEknbSBz
ZWVpbmcgaGVyZSB0aGUgaW50ZW50aW9uIGlzIHRvIGV4cG9zZQ0KPj4+Pj4gUEhZU0RFVk9QX3ss
dW59bWFwX3BpcnEgdG8gUFZIIGRvbTAsIHNvIHRoZXJlIG11c3QgYmUgc29tZSBub3Rpb24gb2YN
Cj4+Pj4+IHBJUlFzIG9yIGFraW4gaW4gYSBQVkggZG9tMD8gIEV2ZW4gaWYgb25seSBmb3IgcGFz
c3Rocm91Z2ggbmVlZHMuDQo+Pj4+DQo+Pj4+IE9ubHkgaW4gc28gZmFyIGFzIGl0IGlzIGFuIGFi
c3RyYWN0LCBoYW5kbGUtbGlrZSB2YWx1ZSBwZXJ0YWluaW5nIHNvbGVseQ0KPj4+PiB0byB0aGUg
dGFyZ2V0IGRvbWFpbi4NCj4+Pj4NCj4+Pj4+PiBNYXliZSB5b3UncmUgdGhpbmtpbmcgb2YgcmUt
dXNpbmcgdGhlIHN1Yi1vcHMsIHJlcXVpcmluZyBQVkggZG9tYWlucyB0bw0KPj4+Pj4+IHBhc3Mg
aW4gR1NJcz8NCj4+Pj4+DQo+Pj4+PiBJIHRoaW5rIHRoYXQgd2FzIG9uZSBteSBwcm9wb3NhbHMs
IHRvIGVpdGhlciBpbnRyb2R1Y2UgYSBuZXcNCj4+Pj4+IGh5cGVyY2FsbCB0aGF0IHRha2VzIGEg
R1NJLCBvciB0byBtb2RpZnkgdGhlIFBIWVNERVZPUF97LHVufW1hcF9waXJxDQo+Pj4+PiBpbiBh
biBBQkkgY29tcGF0aWJsZSB3YXkgc28gdGhhdCBzZW1hbnRpY2FsbHkgdGhlIGZpZWxkIGNvdWxk
IGJlIGEgR1NJDQo+Pj4+PiByYXRoZXIgdGhhbiBhIHBJUlEuICBXZSBob3dldmVyIHdvdWxkIGFs
c28gbmVlZCBhIHdheSB0byByZWZlcmVuY2UgYW4NCj4+Pj4+IE1TSSBlbnRyeS4NCj4+Pj4NCj4+
Pj4gT2YgY291cnNlLg0KPj4+Pg0KPj4+Pj4gTXkgbWFpbiBjb25jZXJuIGlzIG5vdCB3aXRoIHBJ
UlFzIGJ5IGl0c2VsZiwgcElSUXMgYXJlIGp1c3QgYW4NCj4+Pj4+IGFic3RyYWN0IHdheSB0byBy
ZWZlcmVuY2UgaW50ZXJydXB0cywgbXkgY29uY2VybiBhbmQgd2hhdCBJIHdhbnRlZCB0bw0KPj4+
Pj4gYXZvaWQgb24gUFZIIGlzIGJlaW5nIGFibGUgdG8gcm91dGUgcElSUXMgb3ZlciBldmVudCBj
aGFubmVscy4gIElPVzoNCj4+Pj4+IGhhdmUgaW50ZXJydXB0cyBmcm9tIHBoeXNpY2FsIGRldmlj
ZXMgZGVsaXZlcmVkIG92ZXIgZXZlbnQgY2hhbm5lbHMuDQo+Pj4+DQo+Pj4+IE9oLCBJIG1pZ2h0
IGhhdmUgc2xpZ2h0bHkgbWlzdW5kZXJzdG9vZCB5b3VyIGludGVudGlvbnMgdGhlbi4NCj4+Pg0K
Pj4+IE15IGludGVudGlvbiB3b3VsZCBiZSB0byBub3QgZXZlbiB1c2UgcElSUXMgYXQgYWxsLCBp
biBvcmRlciB0byBhdm9pZA0KPj4+IHRoZSB0ZW1wdGF0aW9uIG9mIHRoZSBndWVzdCBpdHNlbGYg
bWFuYWdpbmcgaW50ZXJydXB0cyB1c2luZw0KPj4+IGh5cGVyY2FsbHMsIGhlbmNlIEkgd291bGQg
aGF2ZSBwcmVmZXJyZWQgdGhhdCBhYnN0cmFjdCBpbnRlcmZhY2UgdG8gYmUNCj4+PiBzb21ldGhp
bmcgZWxzZS4NCj4+Pg0KPj4+IE1heWJlIHdlIGNvdWxkIGV2ZW4gZXhwb3NlIHRoZSBYZW4gSVJR
IHNwYWNlIGRpcmVjdGx5LCBhbmQganVzdCB1c2UNCj4+PiB0aGF0IGFzIGludGVycnVwdCBoYW5k
bGVzLCBidXQgc2luY2UgSSdtIG5vdCB0aGUgb25lIGRvaW5nIHRoZSB3b3JrDQo+Pj4gSSdtIG5v
dCBzdXJlIGl0J3MgZmFpciB0byBhc2sgZm9yIHNvbWV0aGluZyB0aGF0IHdvdWxkIHJlcXVpcmUg
bW9yZQ0KPj4+IGNoYW5nZXMgaW50ZXJuYWxseSB0byBYZW4uDQo+Pj4NCj4+Pj4+PiBJIHRoaW5r
IEkgc3VnZ2VzdGVkIHNvbWV0aGluZyBhbG9uZyB0aGVzZSBsaW5lcyBhbHNvIHRvDQo+Pj4+Pj4g
SmlxaWFuLCB5ZXQgd2l0aCB0aGUgbm93IGludGVuZGVkIGV4cG9zdXJlIHRvICFoYXNfcGlycSgp
IGRvbWFpbnMgSSdtDQo+Pj4+Pj4gbm90IHN1cmUgdGhpcyBjb3VsZCBiZSBtYWRlIHdvcmsgcmVs
aWFibHkuDQo+Pj4+Pg0KPj4+Pj4gSSdtIGFmcmFpZCBJJ3ZlIGJlZW4gbGFja2luZyBiZWhpbmQg
b24gcmV2aWV3aW5nIHRob3NlIHNlcmllcy4NCj4+Pj4+DQo+Pj4+Pj4gV2hpY2ggcmVtaW5kcyBt
ZSBvZiBhbm90aGVyIHF1ZXN0aW9uIEkgaGFkOiBXaGF0IG1lYW5pbmcgZG9lcyB0aGUgcGlycQ0K
Pj4+Pj4+IGZpZWxkIGhhdmUgcmlnaHQgbm93LCBpZiBEb20wIHdvdWxkIGlzc3VlIHRoZSByZXF1
ZXN0IGFnYWluc3QgYSBQVkggRG9tVT8NCj4+Pj4+PiBXaGF0IG1lYW5pbmcgd2lsbCBpdCBoYXZl
IGZvciBhICFoYXNfcGlycSgpIEhWTSBkb21haW4/DQo+Pj4+Pg0KPj4+Pj4gVGhlIHBpcnEgZmll
bGQgY291bGQgYmUgYSB3YXkgdG8gcmVmZXJlbmNlIGFuIGludGVycnVwdC4gIEl0IGRvZXNuJ3QN
Cj4+Pj4+IG5lZWQgdG8gYmUgZXhwb3NlZCB0byB0aGUgUFZIIGRvbVUgYXQgYWxsLCBidXQgaXQn
cyBhIHdheSBmb3IgdGhlDQo+Pj4+PiBkZXZpY2UgbW9kZWwgdG8gaWRlbnRpZnkgd2hpY2ggaW50
ZXJydXB0IHNob3VsZCBiZSBtYXBwZWQgdG8gd2hpY2gNCj4+Pj4+IGRvbWFpbi4NCj4+Pj4NCj4+
Pj4gU2luY2UgcElSUS1zIGFyZSBwZXItZG9tYWluLCBfdGhhdF8ga2luZCBvZiBhc3NvY2lhdGlv
biB3b24ndCBiZQ0KPj4+PiBoZWxwZWQuIEJ1dCB5ZXMsIGFzIHBlciBhYm92ZSBpdCBjb3VsZCBz
ZXJ2ZSBhcyBhbiBhYnN0cmFjdCBoYW5kbGUtDQo+Pj4+IGxpa2UgdmFsdWUuDQo+Pj4NCj4+PiBJ
IHdvdWxkIGJlIGZpbmUgd2l0aCBkb2luZyB0aGUgaW50ZXJydXB0IGJpbmRpbmdzIGJhc2VkIG9u
IElSUXMNCj4+PiBpbnN0ZWFkIG9mIHBJUlFzLCBidXQgSSdtIGFmcmFpZCB0aGF0IHdvdWxkIHJl
cXVpcmUgbW9yZSBjaGFuZ2VzIHRvDQo+Pj4gaHlwZXJjYWxscyBhbmQgWGVuIGludGVybmFscy4N
Cj4+Pg0KPj4+IEF0IHNvbWUgcG9pbnQgSSBuZWVkIHRvIHdvcmsgb24gYSBuZXcgaW50ZXJmYWNl
IHRvIGRvIHBhc3N0aHJvdWdoLCBzbw0KPj4+IHRoYXQgd2UgY2FuIHJlbW92ZSB0aGUgdXNhZ2Ug
b2YgZG9tY3RscyBmcm9tIFFFTVUuICBUaGF0IG1pZ2h0IGJlIGENCj4+PiBnb29kIG9wcG9ydHVu
aXR5IHRvIHN3aXRjaCBmcm9tIHVzaW5nIHBJUlFzLg0KPj4NCj4+IFRoYW5rcyBmb3IgeW91ciBp
bnB1dCwgYnV0IEkgbWF5IGJlIGEgYml0IGJlaGluZCB5b3Ugd2l0aCBteSBrbm93bGVkZ2UgYW5k
IGNhbid0IGZ1bGx5IHVuZGVyc3RhbmQgdGhlIGRpc2N1c3Npb24uDQo+PiBIb3cgc2hvdWxkIEkg
bW9kaWZ5IHRoaXMgcXVlc3Rpb24gbGF0ZXI/DQo+PiBTaG91bGQgSSBhZGQgYSBuZXcgaHlwZXJj
YWxsIHNwZWNpZmljYWxseSBmb3IgcGFzc3Rocm91Z2g/DQo+PiBPciBpZiBpdCBpcyB0byBwcmV2
ZW50IHRoZSAodW4pbWFwIGZyb20gYmVpbmcgdXNlZCBmb3IgUFZIIGd1ZXN0cywgY2FuIEkganVz
dCBhZGQgYSBuZXcgZnVuY3Rpb24gdG8gY2hlY2sgaWYgdGhlIHN1YmplY3QgZG9tYWluIGlzIGEg
UFZIIHR5cGU/IExpa2UgaXNfcHZoX2RvbWFpbigpLg0KPiANCj4gSSB0aGluayB0aGF0IHdvdWxk
IGJlIHBhcnQgb2YgYSBuZXcgaW50ZXJmYWNlLCBhcyBzYWlkIGJlZm9yZSBJIGRvbid0DQo+IHRo
aW5rIGl0IHdvdWxkIGJlIGZhaXIgdG8gZm9yY2UgeW91IHRvIGRvIGFsbCB0aGlzIHdvcmsuICBJ
IHdvbid0DQo+IG9wcG9zZSB3aXRoIHRoZSBhcHByb2FjaCB0byBhdHRlbXB0IHRvIHJlLXVzZSB0
aGUgZXhpc3RpbmcgaW50ZXJmYWNlcw0KPiBhcyBtdWNoIGFzIHBvc3NpYmxlLg0KVGhhbmtzLg0K
DQo+IA0KPiBJIHRoaW5rIHRoaXMgcGF0Y2ggbmVlZHMgdG8gYmUgYWRqdXN0ZWQgdG8gZHJvcCB0
aGUgY2hhbmdlIHRvDQo+IHhlbi9hcmNoL3g4Ni9waHlzZGV2LmMsIGFzIGp1c3QgYWxsb3dpbmcg
UEhZU0RFVk9QX3ssdW59bWFwX3BpcnENCj4gd2l0aG91dCBhbnkgY2hhbmdlIHRvIGRvX3BoeXNk
ZXZfb3AoKSBzaG91bGQgcmVzdWx0IGluIHRoZSBjb3JyZWN0DQo+IGJlaGF2aW9yLg0KRG8geW91
IG1lYW4gdGhhdCBJIGRvbid0IG5lZWQgdG8gYWRkIGFueSBmdXJ0aGVyIHJlc3RyaWN0aW9ucyBp
biBkb19waHlzZGV2X29wKCksIGp1c3Qgc2ltcGx5IGFsbG93IFBIWVNERVZPUF97LHVufW1hcF9w
aXJxIGluIGh2bV9waHlzZGV2X29wKCkgPw0KDQo+IA0KPiBUaGFua3MsIFJvZ2VyLg0KDQotLSAN
CkJlc3QgcmVnYXJkcywNCkppcWlhbiBDaGVuLg0K


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 08:36:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 08:36:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770675.1181307 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnlK-0005pU-IT; Fri, 02 Aug 2024 08:35:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770675.1181307; Fri, 02 Aug 2024 08:35:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnlK-0005pN-EL; Fri, 02 Aug 2024 08:35:46 +0000
Received: by outflank-mailman (input) for mailman id 770675;
 Fri, 02 Aug 2024 08:35:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AAnW=PB=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZnlJ-0005pH-4n
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 08:35:45 +0000
Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com
 [2607:f8b0:4864:20::72a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 350c6f1b-50aa-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 10:35:44 +0200 (CEST)
Received: by mail-qk1-x72a.google.com with SMTP id
 af79cd13be357-7a1dcc7bc05so482924885a.0
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 01:35:44 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a34f6dcf20sm67904185a.20.2024.08.02.01.35.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 01:35:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 350c6f1b-50aa-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722587743; x=1723192543; darn=lists.xenproject.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=IsXXsBEw2nBwJhLPq7U38pcK5WWigxV/U3pzN3u3zSQ=;
        b=ozidcaftSp0n0SangJDa5fGDCQlDVLGeIaLB/yreW9B3fyhqrMALK6UaNncuXvlDlk
         6wmpvX1C5HEJLwW7LFyaD7dRTVwJsIUNrMmZpE8Cm0ylVbueeyzrAalsj6gPdXg75oWz
         8g0vTOOP3ihG1eQb9Yee0moK2J8BGJiTJjw/w=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722587743; x=1723192543;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=IsXXsBEw2nBwJhLPq7U38pcK5WWigxV/U3pzN3u3zSQ=;
        b=AEjm0wx91sCZJMI65CdWQxWcEvY8NomlEzheWcRVndCdP0m9oM8NIK0wpBiMuYBE4h
         EjtsR69T+jL7OHWYAUNDAJ3cULtSnoCCzqbbUw95vicrbi/7yQ6JEEG8ZIYEl6O4blqX
         0KCvliH/aehhMcAbc5ZLgpQyFepru3zp/hhI2Pj5efMlOUuyPW/TAxFOIcpNQb/j5B3P
         jw+LnoKKnfufm/bKyaU2bbugJr5rhtd6KC15BejG9nBMXbOsWOPy7vOH/Li2djLx3/xA
         VZt2VJaZjBzNwinINygDWx2mdOUdPz83gTXVPmR9vpiJGrAOO1QnGe/hyVKz+MFHLYbf
         1+1g==
X-Forwarded-Encrypted: i=1; AJvYcCU3HJlllAUx6t8l6GLVWY3bD4tYYLVVOq7SZAvTpV/xEtWoicejHPxO3dUdJLYro7mSUS/SM1g1KgyXaLWnp4wFQuAA9F5Cn4diEs8DztQ=
X-Gm-Message-State: AOJu0Yx26M2M0yHPrCJrNWFLoLjzSR0QeZbsloJ5lbMGrgvKs5V1Nh+q
	DZMsJpAQtBLAqxECTZ+7rO90+srZ7I+SpRcP0TEgDr4GYq2U/O78bAOOSfsMC3o=
X-Google-Smtp-Source: AGHT+IHiKaeEvd4bGvpv/xB1+MymkpTpsSWgHAAWv0J+wyGosWTW+yFAqXGk8qWRkXt7vxyCiK2AMw==
X-Received: by 2002:a05:620a:17a2:b0:79f:12e9:1e71 with SMTP id af79cd13be357-7a34edb4c89mr361540685a.0.1722587742072;
        Fri, 02 Aug 2024 01:35:42 -0700 (PDT)
Date: Fri, 2 Aug 2024 10:35:38 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: "Chen, Jiqian" <Jiqian.Chen@amd.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	Juergen Gross <jgross@suse.com>,
	"Daniel P . Smith" <dpsmith@apertussolutions.com>,
	"Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>,
	"Huang, Ray" <Ray.Huang@amd.com>
Subject: Re: [XEN PATCH v12 2/7] x86/pvh: Allow (un)map_pirq when dom0 is PVH
Message-ID: <ZqyaWryc_42KSnK_@macbook>
References: <Zqn7HEuooChgRCuf@macbook>
 <d65ae152-22ee-4a57-8ff4-43ef0c234f5f@suse.com>
 <ZqoF55yapMxGN_WM@macbook>
 <fa33fbf8-32b6-48dc-a30c-dd76b021a76d@suse.com>
 <ZqogJVHV36ytYVP1@macbook>
 <ff922c7a-aa66-4b23-8b9f-63b0b403ff14@suse.com>
 <Zqo2N7CDshL7ZoMK@macbook>
 <BL1PR12MB584914D078416A5F0ECA0AE0E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
 <ZqyUxv7UcaRcksCG@macbook>
 <BL1PR12MB584967C87F8EBC9B753C7B10E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <BL1PR12MB584967C87F8EBC9B753C7B10E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>

On Fri, Aug 02, 2024 at 08:17:15AM +0000, Chen, Jiqian wrote:
> On 2024/8/2 16:11, Roger Pau Monné wrote:
> > On Fri, Aug 02, 2024 at 02:37:24AM +0000, Chen, Jiqian wrote:
> >> On 2024/7/31 21:03, Roger Pau Monné wrote:
> >>> On Wed, Jul 31, 2024 at 01:39:40PM +0200, Jan Beulich wrote:
> >>>> On 31.07.2024 13:29, Roger Pau Monné wrote:
> >>>>> On Wed, Jul 31, 2024 at 11:55:35AM +0200, Jan Beulich wrote:
> >>>>>> On 31.07.2024 11:37, Roger Pau Monné wrote:
> >>>>>>> On Wed, Jul 31, 2024 at 11:02:01AM +0200, Jan Beulich wrote:
> >>>>>>>> On 31.07.2024 10:51, Roger Pau Monné wrote:
> >>>>>>>>> I agree with (a), but I don't think enabling PVH dom0 usage of the
> >>>>>>>>> hypercalls should be gated on this.  As said a PV dom0 is already
> >>>>>>>>> capable of issuing PHYSDEVOP_{,un}map_pirq operations against a PVH
> >>>>>>>>> domU.
> >>>>>>>>
> >>>>>>>> Okay, I can accept that as an intermediate position. We ought to deny
> >>>>>>>> such requests at some point though for PVH domains, the latest in the
> >>>>>>>> course of making vPCI work there.
> >>>>>>>
> >>>>>>> Hm, once physdev_map_pirq() works as intended against PVH domains, I
> >>>>>>> don't see why we would prevent the usage of PHYSDEVOP_{,un}map_pirq
> >>>>>>> against such domains.
> >>>>>>
> >>>>>> Well. If it can be made work as intended, then I certainly agree. However,
> >>>>>> without even the concept of pIRQ in PVH I'm having a hard time seeing how
> >>>>>> it can be made work. Iirc you were advocating for us to not introduce pIRQ
> >>>>>> into PVH.
> >>>>>
> >>>>> From what I'm seeing here the intention is to expose
> >>>>> PHYSDEVOP_{,un}map_pirq to PVH dom0, so there must be some notion of
> >>>>> pIRQs or akin in a PVH dom0?  Even if only for passthrough needs.
> >>>>
> >>>> Only in so far as it is an abstract, handle-like value pertaining solely
> >>>> to the target domain.
> >>>>
> >>>>>> Maybe you're thinking of re-using the sub-ops, requiring PVH domains to
> >>>>>> pass in GSIs?
> >>>>>
> >>>>> I think that was one my proposals, to either introduce a new
> >>>>> hypercall that takes a GSI, or to modify the PHYSDEVOP_{,un}map_pirq
> >>>>> in an ABI compatible way so that semantically the field could be a GSI
> >>>>> rather than a pIRQ.  We however would also need a way to reference an
> >>>>> MSI entry.
> >>>>
> >>>> Of course.
> >>>>
> >>>>> My main concern is not with pIRQs by itself, pIRQs are just an
> >>>>> abstract way to reference interrupts, my concern and what I wanted to
> >>>>> avoid on PVH is being able to route pIRQs over event channels.  IOW:
> >>>>> have interrupts from physical devices delivered over event channels.
> >>>>
> >>>> Oh, I might have slightly misunderstood your intentions then.
> >>>
> >>> My intention would be to not even use pIRQs at all, in order to avoid
> >>> the temptation of the guest itself managing interrupts using
> >>> hypercalls, hence I would have preferred that abstract interface to be
> >>> something else.
> >>>
> >>> Maybe we could even expose the Xen IRQ space directly, and just use
> >>> that as interrupt handles, but since I'm not the one doing the work
> >>> I'm not sure it's fair to ask for something that would require more
> >>> changes internally to Xen.
> >>>
> >>>>>> I think I suggested something along these lines also to
> >>>>>> Jiqian, yet with the now intended exposure to !has_pirq() domains I'm
> >>>>>> not sure this could be made work reliably.
> >>>>>
> >>>>> I'm afraid I've been lacking behind on reviewing those series.
> >>>>>
> >>>>>> Which reminds me of another question I had: What meaning does the pirq
> >>>>>> field have right now, if Dom0 would issue the request against a PVH DomU?
> >>>>>> What meaning will it have for a !has_pirq() HVM domain?
> >>>>>
> >>>>> The pirq field could be a way to reference an interrupt.  It doesn't
> >>>>> need to be exposed to the PVH domU at all, but it's a way for the
> >>>>> device model to identify which interrupt should be mapped to which
> >>>>> domain.
> >>>>
> >>>> Since pIRQ-s are per-domain, _that_ kind of association won't be
> >>>> helped. But yes, as per above it could serve as an abstract handle-
> >>>> like value.
> >>>
> >>> I would be fine with doing the interrupt bindings based on IRQs
> >>> instead of pIRQs, but I'm afraid that would require more changes to
> >>> hypercalls and Xen internals.
> >>>
> >>> At some point I need to work on a new interface to do passthrough, so
> >>> that we can remove the usage of domctls from QEMU.  That might be a
> >>> good opportunity to switch from using pIRQs.
> >>
> >> Thanks for your input, but I may be a bit behind you with my knowledge and can't fully understand the discussion.
> >> How should I modify this question later?
> >> Should I add a new hypercall specifically for passthrough?
> >> Or if it is to prevent the (un)map from being used for PVH guests, can I just add a new function to check if the subject domain is a PVH type? Like is_pvh_domain().
> > 
> > I think that would be part of a new interface, as said before I don't
> > think it would be fair to force you to do all this work.  I won't
> > oppose with the approach to attempt to re-use the existing interfaces
> > as much as possible.
> Thanks.
> 
> > 
> > I think this patch needs to be adjusted to drop the change to
> > xen/arch/x86/physdev.c, as just allowing PHYSDEVOP_{,un}map_pirq
> > without any change to do_physdev_op() should result in the correct
> > behavior.
> Do you mean that I don't need to add any further restrictions in do_physdev_op(), just simply allow PHYSDEVOP_{,un}map_pirq in hvm_physdev_op() ?

That's my understanding, yes, no further restrictions should be added.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 08:40:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 08:40:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770731.1181317 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnqH-00089D-5I; Fri, 02 Aug 2024 08:40:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770731.1181317; Fri, 02 Aug 2024 08:40:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnqH-000896-0n; Fri, 02 Aug 2024 08:40:53 +0000
Received: by outflank-mailman (input) for mailman id 770731;
 Fri, 02 Aug 2024 08:40:52 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=uPwv=PB=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1sZnqG-00088y-3K
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 08:40:52 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on2060e.outbound.protection.outlook.com
 [2a01:111:f403:2412::60e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eab3dc43-50aa-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 10:40:50 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by DM4PR12MB6277.namprd12.prod.outlook.com (2603:10b6:8:a5::20) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.19; Fri, 2 Aug
 2024 08:40:44 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285%3]) with mapi id 15.20.7828.021; Fri, 2 Aug 2024
 08:40:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eab3dc43-50aa-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=akNqHTok9XBiffGp2b6JdsGupLGfVfr8Zny3+jaLa58s6e7JiQ0yqr9UTuuGfyRMOXadcn6FMh6Bk3HVMAZkTK7n1ClQW4z9UWESm9Dvja4m9UCmQ+1iQj6R45hwNdkll98Lv6HUAamH912ZyyKvr7DJhwGPR5WPqHvswo/sg5WgwHuuZxBGqVG8Hc+UMroNFgEHFiGFFGX9MTUInd7gYLhHPP1YGWWbthAKXag5LXB4VR8DB94145JykBjhku+rHhZW9t2ZdmOp2BougZOJzWCWGN0vGoXVv+VmMJwSoyuMS+YIiKmwEELb2yNsH89BkKewOYoae7zPDb3/pelTng==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BjrNARLvipjCR1fPnQxj2Z7bIsxRSpcV1oyuhGIdT0w=;
 b=ujnbB2ePqvd2Dy1IRsSlOM+XIyvtijnoTTMSYVGs/vHI40/jLSO2G4uphca7k1IK2GBWyhacyV2ZBvmL5MXdV/TnkHqwpjVlFd+7tEqPzpx7Ee6uiEbG5YqYCeJ9Lh/gheai7tvYzJjmjVzvSgTic/otmz6zv2lOIh68nbaPPEYwj84ZxaImAnyQI7JBYTazzsWfzoFWdS1pQjfrao2efv90s6fKEFvDJwNgEgpSMdcVQzRrnRQ1SAhcnI2Ivx+s8EZAVzSZpCHX3XOUQJcerva1s4p2SNDwunSvxKfu7kz5af0220HZis9hG76/s8h7Rk4TtdTO/RseyIAu8nP6sQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BjrNARLvipjCR1fPnQxj2Z7bIsxRSpcV1oyuhGIdT0w=;
 b=wo0gLP+p86cMKc6pfv7y68KfUqYg+bSODrBYc2rb5czs6eqD/trBUcWzMktkJLxX5dEP9e2/RWUbZfkKpBIETycjXWn3MDW5fRf+Ue9f/b8xc2hPwyW/r0jHPveKLOS9KUJA5qGROfh0dPMeUcJYnWSHxPeTTx1Qm07jp5uZQDg=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: Jan Beulich <jbeulich@suse.com>
CC: =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>, George Dunlap
	<gwd@xenproject.org>, Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, Juergen
 Gross <jgross@suse.com>, "Daniel P . Smith" <dpsmith@apertussolutions.com>,
	"Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>, "Huang, Ray"
	<Ray.Huang@amd.com>, "Chen, Jiqian" <Jiqian.Chen@amd.com>
Subject: Re: [XEN PATCH v12 2/7] x86/pvh: Allow (un)map_pirq when dom0 is PVH
Thread-Topic: [XEN PATCH v12 2/7] x86/pvh: Allow (un)map_pirq when dom0 is PVH
Thread-Index:
 AQHa0SvUYCKIEvNO4Ei/mjm7Qit34LIQmkQAgAACPwCAAAdkgIAABG0AgAADDACAAALkgIAACfqAgAAE/oCAABpKgIAAAsoAgAAXhYCAAvm8AP//2VcAgACHGID//3+PAIAAhswA
Date: Fri, 2 Aug 2024 08:40:43 +0000
Message-ID:
 <BL1PR12MB58493838F5F7A13AC3DC80E5E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <Zqn7HEuooChgRCuf@macbook>
 <d65ae152-22ee-4a57-8ff4-43ef0c234f5f@suse.com> <ZqoF55yapMxGN_WM@macbook>
 <fa33fbf8-32b6-48dc-a30c-dd76b021a76d@suse.com> <ZqogJVHV36ytYVP1@macbook>
 <ff922c7a-aa66-4b23-8b9f-63b0b403ff14@suse.com> <Zqo2N7CDshL7ZoMK@macbook>
 <BL1PR12MB584914D078416A5F0ECA0AE0E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
 <ZqyUxv7UcaRcksCG@macbook>
 <BL1PR12MB584967C87F8EBC9B753C7B10E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
 <ZqyaWryc_42KSnK_@macbook>
In-Reply-To: <ZqyaWryc_42KSnK_@macbook>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: BL1PR12MB5849.namprd12.prod.outlook.com
 (15.20.7828.000)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|DM4PR12MB6277:EE_
x-ms-office365-filtering-correlation-id: f2c85960-b815-4ec5-8232-08dcb2cecbd2
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|366016|376014|7416014|38070700018;
x-microsoft-antispam-message-info:
 =?utf-8?B?ZTd1VVh1cUJRYnJsQWp4UUk1b0Y4b3FRV250Wlk0QjBJWmhYWFpMaFRUbWdw?=
 =?utf-8?B?aTFuZzFzbDNHU0pkZEc1ODg2MDFOUzgveXVSVlE5YXorZ2FSamI1YlBOMTg1?=
 =?utf-8?B?VVUxeHowcVhtcGZHemdGSDdkMXBXaDVxa0tjZytzdXVNZEVRbGtEUzYxT1hF?=
 =?utf-8?B?WWRmb0R1TWZMTEJvdWRwTzNsRmV4WUhXT21yeDhTeHMvUEs3a2M5cHBWVlY5?=
 =?utf-8?B?M3VLM0xrcS9jcklvRnlDYXhicUZNM1p3VnBwSGdJVDAzNnp0MWZ4d29TSmdV?=
 =?utf-8?B?MFRpc3dXaVlMVzMyTURPWTFacmJMczZNRG5HajhKTG1xWHU1Kzl5RktCMjJn?=
 =?utf-8?B?OFZFUmMwV0ExL1I5dnhqYXc5djVwdlQybXNDcDlsbXY5bUtWcGJ5R2hTVmk3?=
 =?utf-8?B?WFQwQkVyalFpQkhDKzk5NUdEWFZBSU5lUVM0ZWZaRERERFRZUVJTMzh2SlhN?=
 =?utf-8?B?ZW9VbG5EWDNuQ1l3UWRkaHlYVHpRSGhzdUwxaFBHVnpsbDlYRXRxcXRoM25i?=
 =?utf-8?B?MVkyQUdXUGdpNTdhZ2tpa3UrMkoxdW9CMWw1clc5ZHlJRnk2NXRNaDFiZEZ6?=
 =?utf-8?B?MjJUUUFuUUczQWFuNnBJMTU1Q0ZQQ0g2RHVmZnc2VlBtcEV6YzJHWGM3WWFr?=
 =?utf-8?B?Vkc3UzMraUF5RHgwd2lMVVljQ0hwVlZocVZ4Y1o5SFR6VHpkcTJRZmoxclhw?=
 =?utf-8?B?U1RTYzR6bVpKWThLdnc4T3RISnFJRk9OTDQvVm5zbjAzOG5acUtYODYwK0Nj?=
 =?utf-8?B?Rk1mQzNFeVl3QVJZSlZKWjI1bC93WXlFK1R3eHMxR05ldmVjQ2RGREFKS0Y0?=
 =?utf-8?B?Zmg2cXpTeHpyMWdhV05wWVNsZFRSSUE1Z0x6VStFTk9lSHhRYVFORHQ2VGpK?=
 =?utf-8?B?TEk1aHczTlF0L3k2RzFiTVRVcnN1c3Y3YXEreU9FUU1UK2JuNk92bEVGVXNi?=
 =?utf-8?B?aS8yR3JIOUxQd0s5V1lQcU5LWWEzb1A1L0ZjWGRKdXIxMkxUQUNaMHFKcmJs?=
 =?utf-8?B?T1RNZFRPV3o1eExURmhvN0NnT25pVE9Ib1JGc1JKY2JFM3BQRzNMUUZFeTQ4?=
 =?utf-8?B?S1hsbVdyNmczcVp5L2ZDb0xhVXJIYUkydEhXdG1RczRDc09RUzlGa2RjWklK?=
 =?utf-8?B?ekpjWkc1T3MvcGp0THBrUlY2RjhjMXZRSmlLeUVZM0NmMjYwakhBaVJ1azB6?=
 =?utf-8?B?eEtZbXhUNzBURTg5dnpDR2NzRkVJUEhscjV3dzBVTUptTXN2SlpMUmhKQXhD?=
 =?utf-8?B?dUZ5Z21HNmxGUTIxSDNxVWVROWNJbUM3amRURXVBd1dFa0xISHJvc1BWTmNz?=
 =?utf-8?B?RHFpaTByNTlXdFZ1Z0VXOTRPNFlJSUIzdmxOcGQvK2U2dUxoVkRIWC9CMm41?=
 =?utf-8?B?VXkwUjhmQjE4QzRwOGlpcWRPazNvVXBPaGtGakplazZuRG4ybjNQNjVNMDZN?=
 =?utf-8?B?a21Ta2RTc1JaTm9MTk9BanNzbDI2ZWJ1cXBrVzJ1aWgvbGpuZHRTcHhiQ2lO?=
 =?utf-8?B?OHNtYWZiek1ZcHJ6MmhEWUluUmtjSllsTkpQNWtzR3FrTENEa2Vzb3pocFd5?=
 =?utf-8?B?b2diUUQzcWgxUFRFeVdOTmZhVXI5bVFYYlRpWW9UZmRweGNNZzh4RWgxYUFj?=
 =?utf-8?B?cXErUDJRNWtkZ3BsVHBaMzduNWU2cnJNNXNGNWk2WlpvLzlZOVFmb2d3RDZW?=
 =?utf-8?B?NDFlMEtsQVViVGtuNFlnL2t4NjBZd2ovUWJNRnFNZmZ4QWd4Y1UyZVFENGhj?=
 =?utf-8?B?bExxODlwNXY1cXRpQVIydHlKNmZWVWRPK1E0eGlwY3d4cHorYk95REdZOGJN?=
 =?utf-8?B?K2dvZit2aksxZFljcmdObzZWK3AwdGhENkVFLytBV21YTURFUkx6Mjhucm1L?=
 =?utf-8?B?RlRVWFl5ekRVbEZlVzhUcWRnWSs1UXpXRkEwUGdpRDZ1b0E9PQ==?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?c2FDVXp0ejNjN0JRbDNmTnBiM3V3R04ycHcrcGc0SHdvbURPWFdHTGZTdGRh?=
 =?utf-8?B?QmNyOWNsQ01CZ3J6RElFODZHa25HK2t6bStUYWZwM3NPelhQOEJYRFQ1eXBx?=
 =?utf-8?B?ZG45NDFGOHNYd0l6RTE2Y3RVN1h0TUIvT2p1N2pCNmovb0NRVEFuazc2dUtF?=
 =?utf-8?B?VHN5RmxNRWdsdzZyejIyNmE4V255SURNS25xaGtpYkMxdUtYN0lkUVRRUUI3?=
 =?utf-8?B?di85NVBUSDhkOUt1MDc5R1BucHhHKy9TMURFejBtTDM0Z3A5bGZqWkhZMnJo?=
 =?utf-8?B?d3Z2UFJudEVhNGVkOUhmdmR1YjlWOEo5RWJZOXdUL01LTXU1UThRNFJrY2N3?=
 =?utf-8?B?VkxZYkdSSllmSURxRlh5WGZJbXhnQlJHekxyK2wrdXBZR2h0SXE1SCthcjlJ?=
 =?utf-8?B?ZmtlLzlKS3lWU29wMEVKVGh3dytWRnBzMzVxUnBEYVpiSW1BRXpuRzNYSWlz?=
 =?utf-8?B?dUljYTFqY2haNlcwWWppeHhuMUtTaE1lRWttakZMQVU0d2xkbk5EVVlyTEVP?=
 =?utf-8?B?cUxtZGVNZ2pPZWNpN21PNWpubVV3TnVQY0hPRFAzcldxSDRuN3lYTy8xSFcx?=
 =?utf-8?B?TTZaK240T0x3VlhoRDlTU01rS1Zyb2l6REpGby9SQTJzUnVCQzQ5TDJJMHZF?=
 =?utf-8?B?Mi9uV09BUXpRSWh2UFZlbFh4MzVYajJoZ0pONVlueFlLN3UreURRMzZDMnR1?=
 =?utf-8?B?bTJLMW9VaEVXbVZNTlpLS3JOQ0JFdHBtUDlzOG1UdE1VU3BOdEtCTE1kVlFB?=
 =?utf-8?B?WThCbGN1Q2YyUFk2QmF3NmtOZmxFb29HUk1LY1Y0QXBFR0FySGt2b25lQ0JN?=
 =?utf-8?B?d014YXY5MFJERGlxdFNwZXNHSVNKU3doRkhCVDJGK0piekxxLytuUmxEWmp2?=
 =?utf-8?B?eW1lTjJkQWFZTnVUY2VMazEyN01FOFplMk5KRmU1clpJSDhLcnc2SDd1Qm5I?=
 =?utf-8?B?RENqUUZNZWVLTVVLK3VkSGhRSHZRMlVMUDR5djkyOWxYSnhUTFFIN1lSRXBY?=
 =?utf-8?B?cWMzM3dJOHAzT2hjQS9OVHJjZzRxRkg2V1h2OFYzREwzVm0xUjhMaWpQeTdx?=
 =?utf-8?B?TlphVmhzYWVrVnFkZEhHa3kwK1MzTE9na0lISEdrZCt5RmZtbmQ5d3R4MEhW?=
 =?utf-8?B?UU80TG5wd0w4TTlYOXhOR0NGWVlGR2N4UG5zRVhkTUl5dmh3SVFZNENHdVNQ?=
 =?utf-8?B?elRSOXR6WU43bXlZbWJvbndHMStLYUhRc2JTZHc2U1U5TjdMMmNnYy8vNHdG?=
 =?utf-8?B?d0hHeEZ5OEExaFoxRmtMb2tuOXhlSklPOG9wdDdMaXAzOFNuaTkwbThrTWlo?=
 =?utf-8?B?UEFkY0VIVG5FQWJDb3l6WGxXeHFaU3B1YnAxb3pyK0xFM0JxMGQ0bHpGYldL?=
 =?utf-8?B?bDJQcVluOGRqQXdhZ04rUklFSFN1SjZzbUEzcnlEc3ZSNnQ2NTNndjZlUDhP?=
 =?utf-8?B?TDlaNmI2S1FPVWRLZjhCaEEwRjVQWi9ERTJiOG5HSFpwZUFSVmZnL2owMkxH?=
 =?utf-8?B?SGpvNzN3RXFpalZGZklNcDFSbXhzRGgwUnpzT1QvNTA0NXhqNlc5dFBoWUJ0?=
 =?utf-8?B?ZU96TjNXaEo0ejdMNWxXZVYycW9Ja0pYbGlzUFFQZnhURW5LU1JIWFNjV1lh?=
 =?utf-8?B?RTZlME5WWTkrbWQrZlUrQTJKNm1QUGs1WnJrVDlRS20reDNkbnVxZ2cxSElG?=
 =?utf-8?B?ZWV5c1d3ZG9LQlBuUXp2dVRMZWdDblY1a2ZIekVBUnVibFA5ZWRJYnhCY1No?=
 =?utf-8?B?YnhRbDF1RFlJcG9IS1BZSFNLa055YWNGdEJpbmtKU2w4ckt3bkg0eGxLWUFh?=
 =?utf-8?B?V3VMSThnRGU4SUtxcmtXbFp1RVlsNVFRL0FSdTMrM1ErUkxsTzhNVE0vZjFl?=
 =?utf-8?B?cmd5TTdxQzJGWk5vdmpQSzJkVUg4NW9CSzFmeERUZmZwWHhoU1h1NGp4azU1?=
 =?utf-8?B?OS9iR0hSWnIyZC8zeHlJWjlxaHh6S2JhaFZaampRc1FHL3VFdHcxMk1LN0gz?=
 =?utf-8?B?V3ZPeWVLUVB5R2IwcXNSbTh0QXZFNGF5QVZoRnRDS1ppS2dBanFDTm02N0hU?=
 =?utf-8?B?dGliVEM0SXRGZE9NZm45V3FERTB0d2hkWlRuM1NGdFBkOWpJbU5RTkJyUE95?=
 =?utf-8?Q?Buzw=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <B0AE57069F6D0A479DB0927B240A7B68@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f2c85960-b815-4ec5-8232-08dcb2cecbd2
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Aug 2024 08:40:43.1756
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: lKTE1+4k38njYf/tpHRL9MhfMzQvmOTnCwCsaUsGQY07VIwqcq8xl34MzOOZNeB6GOcLgvkSso8fCYawNrvI5A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6277

SGkgSmFuLA0KDQpPbiAyMDI0LzgvMiAxNjozNSwgUm9nZXIgUGF1IE1vbm7DqSB3cm90ZToNCj4g
T24gRnJpLCBBdWcgMDIsIDIwMjQgYXQgMDg6MTc6MTVBTSArMDAwMCwgQ2hlbiwgSmlxaWFuIHdy
b3RlOg0KPj4gT24gMjAyNC84LzIgMTY6MTEsIFJvZ2VyIFBhdSBNb25uw6kgd3JvdGU6DQo+Pj4g
SSB0aGluayB0aGlzIHBhdGNoIG5lZWRzIHRvIGJlIGFkanVzdGVkIHRvIGRyb3AgdGhlIGNoYW5n
ZSB0bw0KPj4+IHhlbi9hcmNoL3g4Ni9waHlzZGV2LmMsIGFzIGp1c3QgYWxsb3dpbmcgUEhZU0RF
Vk9QX3ssdW59bWFwX3BpcnENCj4+PiB3aXRob3V0IGFueSBjaGFuZ2UgdG8gZG9fcGh5c2Rldl9v
cCgpIHNob3VsZCByZXN1bHQgaW4gdGhlIGNvcnJlY3QNCj4+PiBiZWhhdmlvci4NCj4+IERvIHlv
dSBtZWFuIHRoYXQgSSBkb24ndCBuZWVkIHRvIGFkZCBhbnkgZnVydGhlciByZXN0cmljdGlvbnMg
aW4gZG9fcGh5c2Rldl9vcCgpLCBqdXN0IHNpbXBseSBhbGxvdyBQSFlTREVWT1Bfeyx1bn1tYXBf
cGlycSBpbiBodm1fcGh5c2Rldl9vcCgpID8NCj4gDQo+IFRoYXQncyBteSB1bmRlcnN0YW5kaW5n
LCB5ZXMsIG5vIGZ1cnRoZXIgcmVzdHJpY3Rpb25zIHNob3VsZCBiZSBhZGRlZC4NCg0KQXJlIHlv
dSBva2V5IHdpdGggdGhpcz8NCg0KPiANCj4gVGhhbmtzLCBSb2dlci4NCg0KLS0gDQpCZXN0IHJl
Z2FyZHMsDQpKaXFpYW4gQ2hlbi4NCg==


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 08:50:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 08:50:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770742.1181326 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnzv-00020k-WD; Fri, 02 Aug 2024 08:50:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770742.1181326; Fri, 02 Aug 2024 08:50:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnzv-00020d-So; Fri, 02 Aug 2024 08:50:51 +0000
Received: by outflank-mailman (input) for mailman id 770742;
 Fri, 02 Aug 2024 08:50:50 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZnzu-00020T-Hy; Fri, 02 Aug 2024 08:50:50 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZnzu-0000qa-9e; Fri, 02 Aug 2024 08:50:50 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZnzt-0001Uf-SJ; Fri, 02 Aug 2024 08:50:49 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZnzt-0007ZY-Ry; Fri, 02 Aug 2024 08:50:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=0kHRQ80nI+vZhntBjbmpSV3q8qwehl3LXGpq+UC0Qk0=; b=VCq/CnXXAglPrecKH2OpbSvYrC
	VwfI7VX2k8OBEU6ewFKO48AIf5xP7I2Fw8muq7Iz/AJh4BkPgiW99J4AvNh9zm5CMd5s3iYSvj1yJ
	e/3bqoV7jDvjSSFVuaCYL48pbFDcQRc61XtvjR7lNRkviwm6Vr7gpwF3ZXu0dzlPZzjs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187113-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.19-testing test] 187113: regressions - FAIL
X-Osstest-Failures:
    xen-4.19-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:regression
    xen-4.19-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=026c9fa29716b0ff0f8b7c687908e71ba29cf239
X-Osstest-Versions-That:
    xen=fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 02 Aug 2024 08:50:49 +0000

flight 187113 xen-4.19-testing real [real]
flight 187119 xen-4.19-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187113/
http://logs.test-lab.xenproject.org/osstest/logs/187119/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop       fail REGR. vs. 187044

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

version targeted for testing:
 xen                  026c9fa29716b0ff0f8b7c687908e71ba29cf239
baseline version:
 xen                  fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e

Last test of basis   187044  2024-07-29 16:07:22 Z    3 days
Testing same since   187048  2024-07-30 01:41:30 Z    3 days    5 attempts

------------------------------------------------------------
People who touched revisions under test:
  Julien Grall <jgrall@amazon.com>

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


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

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

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

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


Not pushing.

------------------------------------------------------------
commit 026c9fa29716b0ff0f8b7c687908e71ba29cf239
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:45 2024 +0100

    Set 4.19 version
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit df9b8a649f0424e0a949c0f9a7961724bbe8ea70
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:08 2024 +0100

    README: make heading say 4.19
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit b2d2878ab2686b92fcdd7bbca4ff4c312a42bc11
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:18:01 2024 +0100

    Config.mk: Bump tags to 4.19.0 final
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 08:50:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 08:50:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770745.1181335 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnzz-0002G7-An; Fri, 02 Aug 2024 08:50:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770745.1181335; Fri, 02 Aug 2024 08:50:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZnzz-0002G0-8L; Fri, 02 Aug 2024 08:50:55 +0000
Received: by outflank-mailman (input) for mailman id 770745;
 Fri, 02 Aug 2024 08:50: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=GvaU=PB=gmail.com=adobriyan@srs-se1.protection.inumbo.net>)
 id 1sZnzx-0002FB-Pi
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 08:50:53 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5303527f-50ac-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 10:50:53 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a7aa212c1c9so998299266b.2
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 01:50:53 -0700 (PDT)
Received: from p183 ([46.53.254.37]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9bc3c7asm75265566b.14.2024.08.02.01.50.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 01:50:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5303527f-50ac-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722588652; x=1723193452; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=AYmXBmScurZjis0yN5U9wEBN6bdZcv2HfflbnZA48t8=;
        b=htia0v2UEJwW4O5UHGMViuHsKTroOrrhAMvRq1GlxnDCmvgqgIjtwoUeudLV0BtLi6
         Xewt/RkchXlWu2cs2733UmGJUxPtorOUALbH+2JkwGhIH2AQ+OdKhddiwFK47JAiXXpk
         7FfTYvgAPiZC/2xC4EfA6a5iGsqSJd+BZdrAEy6yi3lGEV8obweKvP8uiMdeTh8Klt5u
         qei+Jpw/pUhYv4PWntzngd0ZGyzTijkDSY3s7PPZDNz5jAab/K3UxyF1QAVqXpjY3sd6
         XL9fZXPComI9lP1r5HzDS1Ht2p6/NO2dDpZ430jGx37pJZyKGsCCjOj+1BMbBXRbpCDS
         1G0Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722588652; x=1723193452;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=AYmXBmScurZjis0yN5U9wEBN6bdZcv2HfflbnZA48t8=;
        b=J37IqX7y5W2/0FyP2lDQ5hEWXlxQLxdUbJ8YmN0ChcdWG/hqRniX5UQvYvC+aAHWvK
         hl0+PwQJjac7jiSVpoBkHK55k4QFVE1APT/Uzpj0LqmMInfkUX8RtE3p9hy4YeIJB35I
         QDkIok7lisJW0Qn+ouSzUngH0e8WTvlybdMvK7eRDXbGcJ9HWIDGCHwbHC0kfcDTH9Ww
         3IKXI02+yAGa3QLCRNgJMzRWT2kZy2G1fTbHmke4MhHroxtdxUnraWRI3R7h5MEN+TWZ
         R0H/xn1jXaghNP+jfhwHh6a0BkXErD+a9ghdQmSR/vOPFhyTPIixyt0ZTgovU08EozTq
         Y6KQ==
X-Gm-Message-State: AOJu0YxI15RmnmzYthn+L5QfFX/IqAZIUd0exYyV1jKlkDnEJKsLNaLt
	FZ2mJvyRZAtt0Guh1RtzhSFEItrGm/iWH/9YeUEzOoW8gsJsnnU=
X-Google-Smtp-Source: AGHT+IFvK4orbI6LNsELu/xB64uvyazNJRbDa2ZxQyhuby6J4ozn+wdc3m9XD6dtz9mA9DlnIRxaMQ==
X-Received: by 2002:a17:907:94c5:b0:a77:f2c5:84b3 with SMTP id a640c23a62f3a-a7dc4e5a4edmr205120666b.22.1722588652017;
        Fri, 02 Aug 2024 01:50:52 -0700 (PDT)
Date: Fri, 2 Aug 2024 11:50:49 +0300
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: [PATCH 2/3] x86/cpu: fix unbootable VMs by inlining memcmp in
 hypervisor_cpuid_base
Message-ID: <304592cf-e4a7-4ba1-baa6-4941c60f0e3c@p183>
References: <a9f505a6-fd31-4cfa-a193-d21638bb14f1@p183>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <a9f505a6-fd31-4cfa-a193-d21638bb14f1@p183>

If this memcmp() is not inlined then PVH early boot code can call
into KASAN-instrumented memcmp() which results in unbootable VMs:

	pvh_start_xen
	xen_prepare_pvh
	xen_cpuid_base
	hypervisor_cpuid_base
	memcmp

Ubuntu's gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04) inlines
memcmp with patch and the bug is partially fixed.

Leave FIXME just in case someone cares enough to compare 3 pairs of
integers like 3 pairs of integers.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 arch/x86/include/asm/cpuid.h | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/cpuid.h b/arch/x86/include/asm/cpuid.h
index 6b122a31da06..3eca7824430e 100644
--- a/arch/x86/include/asm/cpuid.h
+++ b/arch/x86/include/asm/cpuid.h
@@ -196,7 +196,20 @@ static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves)
 	for_each_possible_hypervisor_cpuid_base(base) {
 		cpuid(base, &eax, &signature[0], &signature[1], &signature[2]);
 
-		if (!memcmp(sig, signature, 12) &&
+		/*
+		 * FIXME rewrite cpuid comparators to accept uint32_t[3].
+		 *
+		 * This memcmp()
+		 * a) is called from PVH early boot code
+		 *    before instrumentation is set up,
+		 * b) may be compiled to "call memcmp" (not inlined),
+		 * c) memcmp() itself may be instrumented.
+		 *
+		 * Any combination of 2 is fine, but all 3 aren't.
+		 *
+		 * Force inline this function call.
+		 */
+		if (!__builtin_memcmp(sig, signature, 12) &&
 		    (leaves == 0 || ((eax - base) >= leaves)))
 			return base;
 	}


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 08:53:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 08:53:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770763.1181346 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZo25-0003Ae-Mg; Fri, 02 Aug 2024 08:53:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770763.1181346; Fri, 02 Aug 2024 08:53:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZo25-0003AV-JV; Fri, 02 Aug 2024 08:53:05 +0000
Received: by outflank-mailman (input) for mailman id 770763;
 Fri, 02 Aug 2024 08:53:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=GvaU=PB=gmail.com=adobriyan@srs-se1.protection.inumbo.net>)
 id 1sZo24-0003AP-Mx
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 08:53:04 +0000
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [2a00:1450:4864:20::534])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a0d9aa11-50ac-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 10:53:03 +0200 (CEST)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-58ef19aa69dso8418763a12.3
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 01:53:03 -0700 (PDT)
Received: from p183 ([46.53.254.37]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b839610c77sm833557a12.9.2024.08.02.01.53.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 01:53:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a0d9aa11-50ac-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722588783; x=1723193583; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=8XFkRTNOAvo/6n1TkCxI0Nq/GhsBWYAifvh3B1avP60=;
        b=nSehq0EN3JsxhBiMShlIzM95uMBuI43KNTQE5uLMuCK6j9WQqoETY+AbVO3inkeXd7
         VZ3SjX7ugkb3qcaiVbAVlzAB+LxLtSULQMOFl3GYR3KVnsH9sAArghtdLGfdxDwkXeEH
         Pvh4aoC9RfJekytUb82syQG0aqx1hJouygIaxsVO2fIF+wr2vHnSI2eQ8YjOiqnY3CYf
         6rRWEl90KYmCihV8ml9GtF8MvsG/QurdilBP+Ty4lb2fOGzWG4zA/W77QY88Xzw9csPH
         SHCadmakjLT9bs0ws0G94nFuQegIgm9kGXatps1fkArKKcup+TvUFO21NyHrPNUPl8XT
         jphw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722588783; x=1723193583;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=8XFkRTNOAvo/6n1TkCxI0Nq/GhsBWYAifvh3B1avP60=;
        b=eKie2t0r4PyZQhQMlIECyIGOeulOfp44yVY+YYmBzDu9hoioZvKGXiuHU2mfCrZUWA
         ejYiBTaPCLbuPh5qKZ6bNsDmCBkbvj3zNaw9oBhpPp88ek0nqizqdghLKqhsUnCiVTpR
         MNG9lGUvdwn5p/oPuBORLenn71E2YPtsEMrXPK1z2XfLAilOsNAZKczBDKtQ1ZpvmmM9
         nmPMLU20/GA6F5Idlu9Z/aT8QN1/GmQDgWRY6j/znV/WdiSJT07prQ3B1VG6tfS7JOh7
         HiQ00OJ4gaj7msN8HHxMSoAITxZzfZcpzyPMfewHvk8+Y+mzkgjjP8xiq1BqIUGztl7J
         no2A==
X-Gm-Message-State: AOJu0Yzw25S2Q/wztnEf+9BcPplSXg2z9T1UlTSH9QLUqBHdhfjx9eI9
	lsfBtlaGiIffoY1OgAi7b2jppsrnNau/s7m9rUcwi3OxJATEiVA=
X-Google-Smtp-Source: AGHT+IFJwhpUx7VoS206VbLfNRc/AmbO26vvXS6AcphopWKlowMmiS2F7rsx3JjoggcT9/JHDYDaLg==
X-Received: by 2002:a05:6402:22d7:b0:5b8:34a9:7fe0 with SMTP id 4fb4d7f45d1cf-5b834a98116mr1232930a12.6.1722588782707;
        Fri, 02 Aug 2024 01:53:02 -0700 (PDT)
Date: Fri, 2 Aug 2024 11:53:00 +0300
From: Alexey Dobriyan <adobriyan@gmail.com>
To: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] xen, pvh: fix unbootable VMs by inlining memset in
 xen_prepare_pvh
Message-ID: <3fe4502f-020e-46de-976a-b32a76de478a@p183>
References: <a9f505a6-fd31-4cfa-a193-d21638bb14f1@p183>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <a9f505a6-fd31-4cfa-a193-d21638bb14f1@p183>

If this memset() is not inlined than PVH early boot code can call
into KASAN-instrumented memset() which results in unbootable VMs.

Ubuntu's 22.04.4 LTS gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
doesn't inline this memset but inlines __builtin_memset.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 arch/x86/platform/pvh/enlighten.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/platform/pvh/enlighten.c b/arch/x86/platform/pvh/enlighten.c
index 8c2d4b8de25d..c2f6e202217c 100644
--- a/arch/x86/platform/pvh/enlighten.c
+++ b/arch/x86/platform/pvh/enlighten.c
@@ -133,7 +133,8 @@ void __init xen_prepare_pvh(void)
 		BUG();
 	}
 
-	memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
+	/* This can compile to "call memset" and memset() can be instrumented. */
+	__builtin_memset(&pvh_bootparams, 0, sizeof(pvh_bootparams));
 
 	hypervisor_specific_init(xen_guest);
 


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 09:15:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 09:15:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770773.1181355 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZoNH-00078K-Ay; Fri, 02 Aug 2024 09:14:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770773.1181355; Fri, 02 Aug 2024 09:14:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZoNH-00078D-8T; Fri, 02 Aug 2024 09:14:59 +0000
Received: by outflank-mailman (input) for mailman id 770773;
 Fri, 02 Aug 2024 09:14:58 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=14L3=PB=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sZoNG-000787-5a
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 09:14:58 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id afd51aa6-50af-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 11:14:57 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2f0dfdc9e16so98541781fa.2
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 02:14:57 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f15e1864f6sm1134361fa.22.2024.08.02.02.14.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 02:14:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: afd51aa6-50af-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722590097; x=1723194897; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=ljm33iZj4asxQNhsPJUQpanGdqbvXy3PgAV3WUbFnbs=;
        b=JX8w3YHKjE2kZ6XGBk8uJ5gQaPsZZtbblvwI5/hxCnc3lcDK7TpYFP6/TELImtCRtL
         3g2n9KmXHD5imFsJEjqKm26CEWTY+b720R7jGBzVbDcA3iC0o0W9iOcnJgYdTfuzszr/
         kO3SO4FrbjOiOzPz8Xops+sMxGgrQF4E1tIzdUzQqzU1/b6DT8RbTLNktwQ8z5qbd35C
         ait0m8zeokxDjcQMhmIiHZyG/NUY8dbvjb/dWQRqJHUWMBsw73F8tpvIxvnaPj032IKq
         WjUcQ1sCc5GP28SCnAj+iOPY2PCWfPCFP0FTfm43OXF+LnX9ml4UoFAZxnhlGytCd89L
         bILw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722590097; x=1723194897;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=ljm33iZj4asxQNhsPJUQpanGdqbvXy3PgAV3WUbFnbs=;
        b=PDz19rwfD/Ka59CPeTEKNDNK/9TDH3N4dbxpgBceJPySE2vuF9wcBIkJRBGsgBOoO/
         X702ahRjkMvP7o4XA+7bXF+zyWIz3sccaWeLcaUGbhDKI/H+KOf/p5dJjP1Or1JP6Xd5
         WOfd9Z0fBmpBUugvkeq6FasPJracr2VHd8p8sPlfPqW5KTLz/SOedUsFG9ofQP01usgU
         7P4Yew1gvrLXWNtYo6SqJI/4kutfBA+QQ93NryRVSAL+xNzPP4XVjUDfz19x1zJiXmxE
         +w3TogbiA3QoTTKSRSTCa340y5PmYC2mpc8coT44sdvCyuRYJoM6n1GBBopgPS4ZgAJg
         EEhw==
X-Gm-Message-State: AOJu0Yz+BiKXsMk/BEs6kjl+R2w83BwP2dB7+U53CxxOsnV/OVfm6wtz
	4YvrgRHCwS54WhzHnDfPz6dNhO7pzlJ7P0KWPGZe8ytapwK+MEGnHzoX/Q==
X-Google-Smtp-Source: AGHT+IEOxvYvWD+gYATIl4GqGo7DDl0z+FWLWmN2qe96vi8NBYj8ci6JqEDTg00NUu8vDg13kDIISQ==
X-Received: by 2002:a05:651c:148:b0:2ef:20ae:d113 with SMTP id 38308e7fff4ca-2f15ab1a88fmr19698661fa.40.1722590096165;
        Fri, 02 Aug 2024 02:14:56 -0700 (PDT)
Message-ID: <6c379c6a0ac3e046c67647fa63d085a341906224.camel@gmail.com>
Subject: Re: [PATCH v11 4/5] xen/riscv: enable GENERIC_BUG_FRAME
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org
Date: Fri, 02 Aug 2024 11:14:55 +0200
In-Reply-To: <7c03ed78-7c80-45bf-acf3-a916b7abb7d5@suse.com>
References: <cover.1721731887.git.oleksii.kurochko@gmail.com>
	 <b79bcfb9031564fc8d275af66fa94c1e82e54de2.1721731887.git.oleksii.kurochko@gmail.com>
	 <7c03ed78-7c80-45bf-acf3-a916b7abb7d5@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Mon, 2024-07-29 at 15:00 +0200, Jan Beulich wrote:
> > To have working BUG(), WARN(), ASSERT, run_in_exception_handler()
> > it is needed to enable GENERIC_BUG_FRAME.
> >=20
> > ebreak is used as BUG_insn so when macros from <xen/bug.h> are
> > used, an exception with BREAKPOINT cause will be generated.
> >=20
> > ebreak triggers a debug trap, which starts in debug mode and is
> > then filtered by every mode. A debugger will first handle the
> > debug trap and check if ebreak was set by it or not. If not,
> > CAUSE_BREAKPOINT will be generated for the mode where the ebreak
> > instruction was executed.
>=20
> Here and in the similar code comment you talk about an external
> debugger, requiring debug mode, which is an optional feature. In
> my earlier comments what I was referring to was pure software
> debugging. I continue to fail to see how properly distinguishing
> ebreak uses for breakpoints from ebreak uses for e.g. BUG() and
> WARN() is going to be feasible.
GDB keeps track of what addresses it has breakpoints at.

And if QEMU is being used, GDB isn't actually inserting ebreak
instructions because QEMU has an infinite amount of "hardware"
breakpoints.

If it answers your original question I could add this to commit
message/code in the next patch version.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 09:17:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 09:17:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770782.1181365 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZoPD-0008B6-NR; Fri, 02 Aug 2024 09:16:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770782.1181365; Fri, 02 Aug 2024 09: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 <xen-devel-bounces@lists.xenproject.org>)
	id 1sZoPD-0008Az-Kw; Fri, 02 Aug 2024 09:16:59 +0000
Received: by outflank-mailman (input) for mailman id 770782;
 Fri, 02 Aug 2024 09:16: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=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZoPC-0008Ar-Pl
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 09:16:58 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f7aec022-50af-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 11:16:57 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-52efaae7edfso8032028e87.2
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 02:16:57 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b839610c77sm857100a12.9.2024.08.02.02.16.56
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 02 Aug 2024 02:16:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f7aec022-50af-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722590217; x=1723195017; 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=ldbi6SSx2WfjmQDZURnzPjhUzF/sNPYST4E6keKp9Lc=;
        b=RQGXAVZ0Htl3UU9WRUdScWcm3qWyvcY0uXLEoVyWdDNDJAa/wdbYkecC9Vwnf0S1Hi
         OIsLurwyuv7SsyTvQVFdRkOhhXBzpNPBhuFhtjfet+hheUTzE2J+1jU2dPPdXBUz+eXi
         DtROQGeeT6D3gTUZRKaywKVwkaEPUdm+Ov9jFwcLpzyG4Ew5SnWqEZgbU6vzqdTVxvYn
         NblXdLscptwI6lrUD8xhR1JzY9g5OmfeuWzzXmOCqEz8sppORijMz4nCp2MvmBkAbL7t
         Mk41L6TOnWJgopaFxiagpA5esCOPkshv7QrRZzPK9vhtsXxAmfS+qOAr8X/CzsJiJ/4A
         EVGQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722590217; x=1723195017;
        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=ldbi6SSx2WfjmQDZURnzPjhUzF/sNPYST4E6keKp9Lc=;
        b=btrdiebjeKC2RfWuXT3+ToTwEI01vYKc+7aToD2p+h0kE5wvzh0z06dzj7dUApKOYf
         mGQRl2bjNbVjp5qGRYJB1td0VEqnZeAOKylNXHAzbIsJ8zIMLu6AsiheWnvIQ9hNC9BN
         lLQBNbKxFItYiuRQgxr0T1E++fsOGy8t3ZlecalivfPoGWJAOArgWHhbD7FwuHT6m8LM
         TwigFtCZt9wYsB8RiNT3e2cGQqOFSj2DgausYtGOgx0aK2pxzpyq68hkQpIQPaEy26BK
         AdobKh3t2zAfxOzCoc1e6+4umHvq9q/JFXqivgbxddvd1CECQ39qBQ7NXYegTTd8k5Pt
         MAoQ==
X-Gm-Message-State: AOJu0Yz1CxPHea1vH+j0+JF/WE5JfN7ZXyJUUP/Dz43R5IUUZzgvvdAT
	g1jmSCLefZa+7sZwsdcqmdk+2Z8dkEl0d4PGNHMNvbe2c25wr2ofXAbu4kqK2MrVtRMNah4PTCA
	=
X-Google-Smtp-Source: AGHT+IErRr3g3Mt4PXf7WAiOaZNq6Ic/dbjKvEaLKnvQNyJQF4TpPMR5qBc53J+0UolN8Kbjv7+EIQ==
X-Received: by 2002:a05:6512:104f:b0:52e:9b92:49ad with SMTP id 2adb3069b0e04-530bb354fe8mr1664114e87.0.1722590217060;
        Fri, 02 Aug 2024 02:16:57 -0700 (PDT)
Message-ID: <72931086-36d7-4761-be55-6be45a430cac@suse.com>
Date: Fri, 2 Aug 2024 11:16:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [xen-4.19-testing test] 187097: regressions - FAIL
To: Anthony PERARD <anthony@xenproject.org>
Cc: xen-devel@lists.xenproject.org,
 osstest service owner <osstest-admin@xenproject.org>
References: <osstest-187097-mainreport@xen.org>
 <73902a85-2750-4684-b6f5-33dd67c72172@suse.com> <ZqyRBbeY8KAzdjXV@l14>
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: <ZqyRBbeY8KAzdjXV@l14>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 02.08.2024 09:55, Anthony PERARD wrote:
> On Fri, Aug 02, 2024 at 08:33:09AM +0200, Jan Beulich wrote:
>> On 01.08.2024 23:38, osstest service owner wrote:
>>> flight 187097 xen-4.19-testing real [real]
>>> flight 187112 xen-4.19-testing real-retest [real]
>>> http://logs.test-lab.xenproject.org/osstest/logs/187097/
>>> http://logs.test-lab.xenproject.org/osstest/logs/187112/
>>>
>>> Regressions :-(
>>>
>>> Tests which did not succeed and are blocking,
>>> including tests which could not be run:
>>>  test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop       fail REGR. vs. 187044
>>
>> Hmm, this is now pretty persistent in failing. Yet none of the changes
>> under test should have affected behavior in any way. Ideas, anyone?
> 
> This test passed only a single time, across all branches in the last
> year. And that happen to be on the new stable branch.

Oh, wow - I didn't even think of this as a possibility; I could have
checked myself otherwise.

> http://logs.test-lab.xenproject.org/osstest/results/history/test-amd64-amd64-xl-qemut-ws16-amd64/ALL.html
> 
> The success rate is incredebly low.
> 
> force-push ?

Yes. No idea how force-pushes work these days, though. Nor did I ever
do any myself.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 09:17:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 09:17:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770788.1181375 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZoQ9-0000Iv-0k; Fri, 02 Aug 2024 09:17:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770788.1181375; Fri, 02 Aug 2024 09:17:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZoQ8-0000Io-UI; Fri, 02 Aug 2024 09:17:56 +0000
Received: by outflank-mailman (input) for mailman id 770788;
 Fri, 02 Aug 2024 09:17:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZoQ7-00005g-A2
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 09:17:55 +0000
Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com
 [2a00:1450:4864:20::12c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 191ee0d9-50b0-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 11:17:53 +0200 (CEST)
Received: by mail-lf1-x12c.google.com with SMTP id
 2adb3069b0e04-52efbb55d24so12251512e87.1
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 02:17:53 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9d4379asm75221166b.138.2024.08.02.02.17.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 02 Aug 2024 02:17:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 191ee0d9-50b0-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722590273; x=1723195073; 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=8ZK76z8aIs69JD8JU7H2Y5Zjmu8Sx0T3prGDbGcYxwk=;
        b=R8T2UqnzkeEo33+zoYzul1/iJ2xdD4q38m/fj8idtow2pxoe91TEZRL5rgJoJ/MKPK
         eLWRnnfuwNkWUEB3g1zY6U658fiWyRmbDD304vZzIuVVFoVJDyymOvYfTCEB7nTjxBV5
         aMAzQWM3tBllI7nHnR0iC7RlRnc8NYoivBydG8PgsB0Zix8JfJ0la26YZy+q+Sn24uDK
         TSKdDyFlIP1ryG0TEwcd2JM+aBdKb423O+eCN/pD/cB70mRvZZbz1VN2XIrlJeT1LisN
         l41kxuP45aTEi2QegtDoR7O+QpH5x3c6ExA6YzTk5AYaCBXP6LFdUPhpKDjLyzEmUalV
         0unQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722590273; x=1723195073;
        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=8ZK76z8aIs69JD8JU7H2Y5Zjmu8Sx0T3prGDbGcYxwk=;
        b=ROH5N7cRs5zphmEXcxECR4lvC22Q6TMAzwUkkXwc1eaTVgbd7D3ucVub2HimY260VQ
         tUlHeurUXk/zKHo4VGz3H5YhRwgoUtIOB9Jxqa8CL49GExpbVhpvgjtw78/WdgJMXET7
         mO+YGeKhr2pVjF9c1YB6oOJmUBH3lanjJA5PyrtToDhwI1KhuZqNwt1UJclxXk3VKx1D
         O8Qc9gfvLxB/98ZIpRbrFgZ475/tfgowNIqnscGgLYzAG5pu0IzG2bVsL//7zBvAV/7F
         itdXr8b9E1uAmTH12GhjA4iEKJAJuep8qLc187BijDrLbX8DhGqF07yFly7TOwZ357Og
         43Ig==
X-Forwarded-Encrypted: i=1; AJvYcCVvXP4voCEOjRnVwzEOEWQxsyTR3yB7y8IqTMWMGq2vUDVqT7JvKepurX8yzb9BuspsFN5LrRBZ8soUVoOxyk8V3n12oQfrzBzde3GkKJw=
X-Gm-Message-State: AOJu0YxMJUoK60UuNgnf7GAeUbi4+m/EvM7otOPb1bG9Qf3nCnOuEB/Y
	x1DsnFyI6b44PpQZK5vU4h7RcQktBjh3kQ2yCbogrCbMZom5eRINpYNrOfBgnw==
X-Google-Smtp-Source: AGHT+IEZa+3Rnvqd7ejylT4hm530vMludnq4Qyn2gi9imnnFCTi0ah98oKOhSIBGMWqOhwWNhdIXYQ==
X-Received: by 2002:ac2:4e0b:0:b0:52c:db76:2a7a with SMTP id 2adb3069b0e04-530bb393e72mr2318788e87.34.1722590273174;
        Fri, 02 Aug 2024 02:17:53 -0700 (PDT)
Message-ID: <ec1a68d4-a3a5-4c47-ad8c-9055abc9a2ec@suse.com>
Date: Fri, 2 Aug 2024 11:17:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v12 2/7] x86/pvh: Allow (un)map_pirq when dom0 is PVH
To: "Chen, Jiqian" <Jiqian.Chen@amd.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>, Juergen Gross <jgross@suse.com>,
 "Daniel P . Smith" <dpsmith@apertussolutions.com>,
 "Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>,
 "Huang, Ray" <Ray.Huang@amd.com>
References: <Zqn7HEuooChgRCuf@macbook>
 <d65ae152-22ee-4a57-8ff4-43ef0c234f5f@suse.com> <ZqoF55yapMxGN_WM@macbook>
 <fa33fbf8-32b6-48dc-a30c-dd76b021a76d@suse.com> <ZqogJVHV36ytYVP1@macbook>
 <ff922c7a-aa66-4b23-8b9f-63b0b403ff14@suse.com> <Zqo2N7CDshL7ZoMK@macbook>
 <BL1PR12MB584914D078416A5F0ECA0AE0E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
 <ZqyUxv7UcaRcksCG@macbook>
 <BL1PR12MB584967C87F8EBC9B753C7B10E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
 <ZqyaWryc_42KSnK_@macbook>
 <BL1PR12MB58493838F5F7A13AC3DC80E5E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <BL1PR12MB58493838F5F7A13AC3DC80E5E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 02.08.2024 10:40, Chen, Jiqian wrote:
> On 2024/8/2 16:35, Roger Pau Monné wrote:
>> On Fri, Aug 02, 2024 at 08:17:15AM +0000, Chen, Jiqian wrote:
>>> On 2024/8/2 16:11, Roger Pau Monné wrote:
>>>> I think this patch needs to be adjusted to drop the change to
>>>> xen/arch/x86/physdev.c, as just allowing PHYSDEVOP_{,un}map_pirq
>>>> without any change to do_physdev_op() should result in the correct
>>>> behavior.
>>> Do you mean that I don't need to add any further restrictions in do_physdev_op(), just simply allow PHYSDEVOP_{,un}map_pirq in hvm_physdev_op() ?
>>
>> That's my understanding, yes, no further restrictions should be added.
> 
> Are you okey with this?

I think I already indicated so - yes, for the time being.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 09:22:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 09:22:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770796.1181386 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZoU3-0001q6-K7; Fri, 02 Aug 2024 09:21:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770796.1181386; Fri, 02 Aug 2024 09:21:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZoU3-0001pz-Gr; Fri, 02 Aug 2024 09:21:59 +0000
Received: by outflank-mailman (input) for mailman id 770796;
 Fri, 02 Aug 2024 09:21:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZoU1-0001pr-Pl
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 09:21:57 +0000
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com
 [2a00:1450:4864:20::529])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a9fbba4d-50b0-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 11:21:56 +0200 (CEST)
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5afa207b8bfso8397285a12.0
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 02:21:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9d45452sm75452066b.111.2024.08.02.02.21.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 02 Aug 2024 02:21:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a9fbba4d-50b0-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722590516; x=1723195316; 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=N8+EJYI9leEtgevuRyDON90kG9LR0bATAV0PxKKihd8=;
        b=G03HjcEenn9MIU6zxtlcz9VSFSji3x3WrNoNTosbkvJpE1glHpVpkmuKSb9aEJLM5B
         g+AkwirxfPeo7jbe+b0NF2Ap5G3lyrf7beShWxGEaf/uulrpTpzdQyCyUgfXZTBOIgn2
         VMFSvwHJRtSRhmgF4or1bBLLG3hqbcVN/ov9W9qt1jLPBmIoDnuaqlN0NHfcR++n3jNe
         S4WOhJZyELnw6hFpJQwRHN5rg7v4/Zn3h0pxH+RbCu3XBUP8yuWPANyl8aiGRscz786Z
         ynakVVpY7VeN6JczQAfFnrU8dB/OtTh4DdlMUNuuimxHdmArb/nJR+V/dbd/YW7dwdyV
         pyew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722590516; x=1723195316;
        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=N8+EJYI9leEtgevuRyDON90kG9LR0bATAV0PxKKihd8=;
        b=XMuwjzhkFIp1kmGkN1kM0PFpzMxKn8T9GCqiBHnvR1bJ5plRV2rKM+DgS0GHT1WIWB
         vjkPsQ6/8vQZh5Htl91r+o/U5PCN7Y1I1xcYBND+IHYhKq9ho9h8B/XXf9zJ7DJvuCHM
         ORVYyyL24phsjPseEOpSxWyVO97uh40UIXYp9Lz8cuwL8n6/XC9/KjhOO9ain1/BkDmP
         iALavaHlnUIWyy0QcCWjxKLQcfJi50xvv6sEowvvH/IIZMeP910M8JARg2qZsO/DviSE
         1IGShRQSxtCCutRn3kV7Npc0qoeHAitDJOby3oNVrx1NuXPh6GPXTQflzCeko4KQUj+X
         NuVQ==
X-Gm-Message-State: AOJu0YyNmrY0HUMRRATCl6FtUYEf/w+QA1ebmG/A5wO/K+yKGWRnzLLP
	eFtkNg3B1ZJXPytByzLxFFFBB4n2xwRz0t21CdqlK8GAnie4pAr7G4yg5mbvK2gZRRqZpPn1qYk
	=
X-Google-Smtp-Source: AGHT+IFw5FdcHNqUG3khxmyZgbSor5C+nryqVw/byjc7PMgUEHIr8wTfk8iZQ8vGkiHA0SUTTqQ+fg==
X-Received: by 2002:a17:907:72c9:b0:a7a:d093:f843 with SMTP id a640c23a62f3a-a7dc50feae0mr206020966b.63.1722590516242;
        Fri, 02 Aug 2024 02:21:56 -0700 (PDT)
Message-ID: <83e20f26-ae59-4191-a12d-f31f779c91e2@suse.com>
Date: Fri, 2 Aug 2024 11:21:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v11 4/5] xen/riscv: enable GENERIC_BUG_FRAME
To: oleksii.kurochko@gmail.com
Cc: xen-devel@lists.xenproject.org
References: <cover.1721731887.git.oleksii.kurochko@gmail.com>
 <b79bcfb9031564fc8d275af66fa94c1e82e54de2.1721731887.git.oleksii.kurochko@gmail.com>
 <7c03ed78-7c80-45bf-acf3-a916b7abb7d5@suse.com>
 <6c379c6a0ac3e046c67647fa63d085a341906224.camel@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: <6c379c6a0ac3e046c67647fa63d085a341906224.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 02.08.2024 11:14, oleksii.kurochko@gmail.com wrote:
> On Mon, 2024-07-29 at 15:00 +0200, Jan Beulich wrote:
>>> To have working BUG(), WARN(), ASSERT, run_in_exception_handler()
>>> it is needed to enable GENERIC_BUG_FRAME.
>>>
>>> ebreak is used as BUG_insn so when macros from <xen/bug.h> are
>>> used, an exception with BREAKPOINT cause will be generated.
>>>
>>> ebreak triggers a debug trap, which starts in debug mode and is
>>> then filtered by every mode. A debugger will first handle the
>>> debug trap and check if ebreak was set by it or not. If not,
>>> CAUSE_BREAKPOINT will be generated for the mode where the ebreak
>>> instruction was executed.
>>
>> Here and in the similar code comment you talk about an external
>> debugger, requiring debug mode, which is an optional feature. In
>> my earlier comments what I was referring to was pure software
>> debugging. I continue to fail to see how properly distinguishing
>> ebreak uses for breakpoints from ebreak uses for e.g. BUG() and
>> WARN() is going to be feasible.
> GDB keeps track of what addresses it has breakpoints at.

Of course it does. But in Xen how do you decide whether to trigger
the debugger when you've hit an ebreak? (Just to repeat, my question
is about the purely software debugging case; no hardware debugging
extensions. In such a case, aiui, Xen gains control first and then
decides whether to trigger the debugger, or whether to handle the
exception internally. Sure, none of this infrastructure is in place
right now, but imo it wants taking into consideration.)

> And if QEMU is being used, GDB isn't actually inserting ebreak
> instructions because QEMU has an infinite amount of "hardware"
> breakpoints.
> 
> If it answers your original question I could add this to commit
> message/code in the next patch version.

I'm afraid it still doesn't.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 09:29:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 09:29:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770809.1181396 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZob7-00038k-9t; Fri, 02 Aug 2024 09:29:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770809.1181396; Fri, 02 Aug 2024 09:29:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZob7-00038d-7Q; Fri, 02 Aug 2024 09:29:17 +0000
Received: by outflank-mailman (input) for mailman id 770809;
 Fri, 02 Aug 2024 09:29: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=pzkb=PB=bounce.vates.tech=bounce-md_30504962.66aca6e7.v1-0eba0c511ac14d4ca8f9341c37603e9f@srs-se1.protection.inumbo.net>)
 id 1sZob5-00038X-Sz
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 09:29:16 +0000
Received: from mail132-30.atl131.mandrillapp.com
 (mail132-30.atl131.mandrillapp.com [198.2.132.30])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id adf80112-50b1-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 11:29:13 +0200 (CEST)
Received: from pmta09.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail132-30.atl131.mandrillapp.com (Mailchimp) with ESMTP id
 4Wb0s400J2zP0Jmsx
 for <xen-devel@lists.xenproject.org>; Fri,  2 Aug 2024 09:29:12 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 0eba0c511ac14d4ca8f9341c37603e9f; Fri, 02 Aug 2024 09:29:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: adf80112-50b1-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1722590952; x=1722851452;
	bh=VhRB6aEhuJizpvxU+Ixu7l7UuM3M0W1wAmT8Exi3Sc8=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=ssvd9eFX+xWj9jU9PLnUgaCc/XmF0fuQnwvU4G5mdfbUy580qnHK16j4MhHQl+F8I
	 qF3ENatuxnfUgii6wBGh7cKEi5zDTI17fJdwIz31GTbleht2JR4An6rBwOq1IdbUna
	 MrsbKxTGFoQRBGCRnyPgLch0KaEQ6lK4uHKB/ujWIk3nBsitJRip/IkcBhtdLTZLqy
	 ZCS/8qy01tvXtG95BD8aKQuJKvgYJW06OV93dTMjDyDJKqmAkwWEEUbD4+XRq60Zz9
	 criiHx2M+pwrmzCUKf2y2jGTOp3QoBgvqefv50ji6DOp78DE9hghV7wPfyt/jSjXav
	 e8TUm0rXwvSuA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1722590952; x=1722851452; i=anthony.perard@vates.tech;
	bh=VhRB6aEhuJizpvxU+Ixu7l7UuM3M0W1wAmT8Exi3Sc8=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=fkzL+rfQ9/ntJjwu2TR081f45IZLc9/0ObbEhFWj2fGQao/bNtieqtOPLCEY4TI+Q
	 5jr6y3aFEzfG0t+94sgT6fjWvpb4FAEc2DTXqgbm+enbKeCMwQUKn0HIFfQWVV6HHm
	 0CF7PqpkVIhwNiTZ4KExNgMCm7rhFAJLx23P48lUaf/x3aNynLFvo47v0cTlbRqh5o
	 BjlfRszwZFu+vLk47QzC6ziSPxz1G6aWCFILB0qa3mk9w6e9flqGmvGSfkADshXplr
	 kirSdr7VzSCgOBTmbuwCvHshY0Pj3TKfabXwvUNXAQflS4gqwOFhwyB0FsZTeuagAa
	 cQSm65O8r8Gyg==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH]=20mktarball:=20only=20archive=20Xen?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1722590950826
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
Message-Id: <Zqym5op9e2BAn5KA@l14>
References: <cf280800-d0d6-4493-933f-f83f418dd91d@suse.com>
In-Reply-To: <cf280800-d0d6-4493-933f-f83f418dd91d@suse.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.0eba0c511ac14d4ca8f9341c37603e9f?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240802:md
Date: Fri, 02 Aug 2024 09:29:11 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Thu, Aug 01, 2024 at 05:46:37PM +0200, Jan Beulich wrote:
> This is the simplistic approach; I'm sure this could now be done quite a
> bit more efficiently. I also expect there's no longer a need to run
> ./configure ahead of the invocation of this script, but since I have no
> idea why it was needed earlier on, I'm not removing that here from the
> doc. I further expect that the subtree-force-update-all prereq could
> also be dropped from the two involved Makefile goals. As that
> intermediate goal isn't used for any other purpose, the question there
> would be whether there's any reason to retain it. IOW all cleanup that's
> probably better done separately, by someone actually using all of that
> machinery.

The ./configure step might not be needed anymore since
00691c6c90b2 ("tools: Allow to make *-dir-force-update without ./configure")
and `make src-tarball-release` works without issue, without running
./configure that is.

And yes, `subtree-force-update-all` prereq could be dropped from
"src-tarbal%" targets in this patch. I've just tried, and the produced
tarball is the same without or with the prereq.

As for removing the rule "subtree-force-update-all", I don't think
that's a good idea at all. As long as Xen's build systems is cloning
subtrees we need to keep the rule. Those subtrees aren't going away
anytime soon, especially mini-os for stubdom.

Cheers,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 09:35:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 09:35:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770817.1181406 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZogc-0004c5-Sz; Fri, 02 Aug 2024 09:34:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770817.1181406; Fri, 02 Aug 2024 09:34:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZogc-0004by-Ph; Fri, 02 Aug 2024 09:34:58 +0000
Received: by outflank-mailman (input) for mailman id 770817;
 Fri, 02 Aug 2024 09: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=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZogb-0004bs-TA
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 09:34:57 +0000
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com
 [2a00:1450:4864:20::529])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7a555c0f-50b2-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 11:34:56 +0200 (CEST)
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5af326eddb2so5305778a12.1
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 02:34:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ecabb2sm76637766b.214.2024.08.02.02.34.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 02 Aug 2024 02:34:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7a555c0f-50b2-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722591295; x=1723196095; 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=IZ8EcOpsXrt02ySDEHAtgYUraLY+wIsLYMyC376Ur0g=;
        b=emACKsfLmhjB1Vnsu34FRMB+Sgiq1EPG1cvmw72WdCtg6dEKStzFOtSaKviURNgqF/
         XoewbbaTbe8vWSKLcCXH2f3h2m+hIQjmvB9QXhoFV/TpMH0Hr6vIkBGH5MRVZ+5HatLF
         V+O1S4TbItG8Kfj35WsJe/18PPt2VuBVQLhQI9RYOeiyygIF/nzgXU3TSEcJgTUhTtPo
         zoRycBG3q08zkMtHtI1MTqPK1aeO6WvwQR+UMuU6CI5ekMBQQ0cyP2vtLq4+g2cGJlIj
         6kmcp1RFFmlXbCRyk9fpXP19E1zZ62X2i9wdw6H3CgjuOIqMUA8SPpdRlbEMPWYv2OAq
         wZew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722591295; x=1723196095;
        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=IZ8EcOpsXrt02ySDEHAtgYUraLY+wIsLYMyC376Ur0g=;
        b=VnQojAqAUcyoDUO25gickfDyzl7wXByfvg7xoSJqGRzwAXVIX8K2Gi5c8Gjd7c9Opa
         nXGS5J25uZMu4HI7DGEf4PgwnBCDnGcF8vpnGABN4pydXxuvHSXqTgeQayMdaypT6UdX
         i/8AcMhZYuhYbbLltTrJBgw78T/BVda/f98P0CA9aNgGie+jaOBcw6sdRfWN6t49Quc5
         VW9MPYnErJnvmonZJ+GzTiEZBuj63SAqIuh2XB2CORHB/MSdqqKSHFdjtL1Yf9jI63nr
         HkUzfljQ5Xyvbn8rwEdccY8hzPXyPXJbAWG+szIMUb82m183LioOTteY28UyB6N4xBV8
         y4rA==
X-Gm-Message-State: AOJu0YwMChpLk6+Zb7Z3iqN94D34Lkdg89KkTvVQUn1d8OvQBI0rL5/7
	abCRV/1o1xr924re93iY8wLE1+O+LnOoC6Qcv3ux+Wm/HWnu7SDkPOIwamGONw==
X-Google-Smtp-Source: AGHT+IF6fAwz+FKIaZNJB2j5cJNpKzTqDK8HZS2bk3v7A298D52OgCSN85aiJKzqtEE2enpae1xOTA==
X-Received: by 2002:a17:907:72d4:b0:a7a:b18a:6c with SMTP id a640c23a62f3a-a7dbcc28507mr355805866b.16.1722591295295;
        Fri, 02 Aug 2024 02:34:55 -0700 (PDT)
Message-ID: <4cff5f0b-3a19-4071-a201-51ea72ee48ce@suse.com>
Date: Fri, 2 Aug 2024 11:34:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] mktarball: only archive Xen
To: Anthony PERARD <anthony.perard@vates.tech>
Cc: xen-devel@lists.xenproject.org, Andrew Cooper
 <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <cf280800-d0d6-4493-933f-f83f418dd91d@suse.com>
 <Zqym5op9e2BAn5KA@l14>
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: <Zqym5op9e2BAn5KA@l14>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 02.08.2024 11:29, Anthony PERARD wrote:
> As for removing the rule "subtree-force-update-all", I don't think
> that's a good idea at all. As long as Xen's build systems is cloning
> subtrees we need to keep the rule. Those subtrees aren't going away
> anytime soon, especially mini-os for stubdom.

So you expect people might be using that goal from the command line?
Fair enough to keep it if so. I simply didn't think a goal with this
long a name would be intended for manual use.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 09:37:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 09:37:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770826.1181416 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZojL-0005y1-AM; Fri, 02 Aug 2024 09:37:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770826.1181416; Fri, 02 Aug 2024 09:37:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZojL-0005xu-64; Fri, 02 Aug 2024 09:37:47 +0000
Received: by outflank-mailman (input) for mailman id 770826;
 Fri, 02 Aug 2024 09:37:45 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZojJ-0005xo-Rf
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 09:37:45 +0000
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [2a00:1450:4864:20::534])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id de34ec4e-50b2-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 11:37:43 +0200 (CEST)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5b8c2a61386so412017a12.2
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 02:37:43 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b839716490sm881791a12.5.2024.08.02.02.37.41
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 02 Aug 2024 02:37:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: de34ec4e-50b2-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722591463; x=1723196263; 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=hYE8daY2atLpvpqeoutGssR2085BBUEClZ3nf/XHhzA=;
        b=JQLQRHa/2ouZLNDTDoUXh+kc+sXwsepNGVC6dRVoeaswJPA+MogC2d5t0w3jA9/BWL
         X5q/XWvA4t7rn2qDc/an5zU1lr2P0g/MyOqY7+7d9h8jNMhSkuZ61YIxpoQq/c8oseIb
         hq0M3jUSsVrYBC2bIrZcAi0iWgEVS52RmDhSpomTQTbm08K8n7tm3KNpYsLjEEt3W9P2
         CP78TvOpWAukjC2okS2ww3kUoclM3xymdewaUn3+IgNM17pPXWsUVWZ4lgAZFtrEfjx+
         7MqDRjShkZjpkT9s8lShQHJUbeIu6Bi7XA+409Jv9n0GiOag4FbZ2Pr8alq2swqnZvXF
         dA/w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722591463; x=1723196263;
        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=hYE8daY2atLpvpqeoutGssR2085BBUEClZ3nf/XHhzA=;
        b=wTTYHttc16YNIvDZTv1WwcOIsZ/hbfBeAuPFoAFxaAjPn+3wQ6lJEy40EwoLa4OfHW
         XD9N+NPLtIAIMw8kB/F9GtWCAhGLVKNhqngM2O5KD2KoUJ1mhDnZ0nX3Ll/xfc4oydic
         9/FRDgqpe3vxH0h9UpJ22XYzHap8t3fev9eJz4TsqHisD5SmloeISRnZ/LJlhXBERtV2
         rdz8OIEKbcxnDJwcigoj1Yo6BbmbuU8xha92ylEwXiliAOSFsOlIbfpCDw72Ob4W0Ci0
         veXY1DlDLoizmEurTYWf6KaBfkDiBT59BvmcueXWVsSuUCKSfDYMf07zGhu3OC+jAHgr
         1kUQ==
X-Gm-Message-State: AOJu0Yzn8I+ZgxSQX43Ym893YtJ+U/wIGpMeqehdY9LuDKqD/i3mIJpe
	xvUxx7sEaCY8ITbr0UKRd6qk7xjlZAjKUxf9TJuSeehmJcPGpYDHNb4+1FU4/MN0HAFPiwFHAv8
	=
X-Google-Smtp-Source: AGHT+IHFXSA5F2rVH+ytOp2whHS/UmaqqkDm7L/2CwEXo36QV/1g8RYkLLNORQB8r6SoTGOmT2ysUA==
X-Received: by 2002:aa7:cd98:0:b0:5a3:8c9:3c1d with SMTP id 4fb4d7f45d1cf-5b7f3bcfc21mr1981697a12.14.1722591462723;
        Fri, 02 Aug 2024 02:37:42 -0700 (PDT)
Message-ID: <c990a47d-42df-4116-8402-e0d7a648cd33@suse.com>
Date: Fri, 2 Aug 2024 11:37:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v12 2/7] x86/pvh: Allow (un)map_pirq when dom0 is PVH
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "Chen, Jiqian" <Jiqian.Chen@amd.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>, Juergen Gross <jgross@suse.com>,
 "Daniel P . Smith" <dpsmith@apertussolutions.com>,
 "Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>,
 "Huang, Ray" <Ray.Huang@amd.com>
References: <Zqn014wCEfWhyo1-@macbook>
 <8ff685a6-0cbd-45cd-a818-4535a040c478@suse.com> <Zqn7HEuooChgRCuf@macbook>
 <d65ae152-22ee-4a57-8ff4-43ef0c234f5f@suse.com> <ZqoF55yapMxGN_WM@macbook>
 <fa33fbf8-32b6-48dc-a30c-dd76b021a76d@suse.com> <ZqogJVHV36ytYVP1@macbook>
 <ff922c7a-aa66-4b23-8b9f-63b0b403ff14@suse.com> <Zqo2N7CDshL7ZoMK@macbook>
 <BL1PR12MB584914D078416A5F0ECA0AE0E7B32@BL1PR12MB5849.namprd12.prod.outlook.com>
 <ZqyUxv7UcaRcksCG@macbook>
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: <ZqyUxv7UcaRcksCG@macbook>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 02.08.2024 10:11, Roger Pau Monné wrote:
> On Fri, Aug 02, 2024 at 02:37:24AM +0000, Chen, Jiqian wrote:
>> On 2024/7/31 21:03, Roger Pau Monné wrote:
>>> On Wed, Jul 31, 2024 at 01:39:40PM +0200, Jan Beulich wrote:
>>>> On 31.07.2024 13:29, Roger Pau Monné wrote:
>>>>> On Wed, Jul 31, 2024 at 11:55:35AM +0200, Jan Beulich wrote:
>>>>>> On 31.07.2024 11:37, Roger Pau Monné wrote:
>>>>>>> On Wed, Jul 31, 2024 at 11:02:01AM +0200, Jan Beulich wrote:
>>>>>>>> On 31.07.2024 10:51, Roger Pau Monné wrote:
>>>>>>>>> I agree with (a), but I don't think enabling PVH dom0 usage of the
>>>>>>>>> hypercalls should be gated on this.  As said a PV dom0 is already
>>>>>>>>> capable of issuing PHYSDEVOP_{,un}map_pirq operations against a PVH
>>>>>>>>> domU.
>>>>>>>>
>>>>>>>> Okay, I can accept that as an intermediate position. We ought to deny
>>>>>>>> such requests at some point though for PVH domains, the latest in the
>>>>>>>> course of making vPCI work there.
>>>>>>>
>>>>>>> Hm, once physdev_map_pirq() works as intended against PVH domains, I
>>>>>>> don't see why we would prevent the usage of PHYSDEVOP_{,un}map_pirq
>>>>>>> against such domains.
>>>>>>
>>>>>> Well. If it can be made work as intended, then I certainly agree. However,
>>>>>> without even the concept of pIRQ in PVH I'm having a hard time seeing how
>>>>>> it can be made work. Iirc you were advocating for us to not introduce pIRQ
>>>>>> into PVH.
>>>>>
>>>>> From what I'm seeing here the intention is to expose
>>>>> PHYSDEVOP_{,un}map_pirq to PVH dom0, so there must be some notion of
>>>>> pIRQs or akin in a PVH dom0?  Even if only for passthrough needs.
>>>>
>>>> Only in so far as it is an abstract, handle-like value pertaining solely
>>>> to the target domain.
>>>>
>>>>>> Maybe you're thinking of re-using the sub-ops, requiring PVH domains to
>>>>>> pass in GSIs?
>>>>>
>>>>> I think that was one my proposals, to either introduce a new
>>>>> hypercall that takes a GSI, or to modify the PHYSDEVOP_{,un}map_pirq
>>>>> in an ABI compatible way so that semantically the field could be a GSI
>>>>> rather than a pIRQ.  We however would also need a way to reference an
>>>>> MSI entry.
>>>>
>>>> Of course.
>>>>
>>>>> My main concern is not with pIRQs by itself, pIRQs are just an
>>>>> abstract way to reference interrupts, my concern and what I wanted to
>>>>> avoid on PVH is being able to route pIRQs over event channels.  IOW:
>>>>> have interrupts from physical devices delivered over event channels.
>>>>
>>>> Oh, I might have slightly misunderstood your intentions then.
>>>
>>> My intention would be to not even use pIRQs at all, in order to avoid
>>> the temptation of the guest itself managing interrupts using
>>> hypercalls, hence I would have preferred that abstract interface to be
>>> something else.
>>>
>>> Maybe we could even expose the Xen IRQ space directly, and just use
>>> that as interrupt handles, but since I'm not the one doing the work
>>> I'm not sure it's fair to ask for something that would require more
>>> changes internally to Xen.
>>>
>>>>>> I think I suggested something along these lines also to
>>>>>> Jiqian, yet with the now intended exposure to !has_pirq() domains I'm
>>>>>> not sure this could be made work reliably.
>>>>>
>>>>> I'm afraid I've been lacking behind on reviewing those series.
>>>>>
>>>>>> Which reminds me of another question I had: What meaning does the pirq
>>>>>> field have right now, if Dom0 would issue the request against a PVH DomU?
>>>>>> What meaning will it have for a !has_pirq() HVM domain?
>>>>>
>>>>> The pirq field could be a way to reference an interrupt.  It doesn't
>>>>> need to be exposed to the PVH domU at all, but it's a way for the
>>>>> device model to identify which interrupt should be mapped to which
>>>>> domain.
>>>>
>>>> Since pIRQ-s are per-domain, _that_ kind of association won't be
>>>> helped. But yes, as per above it could serve as an abstract handle-
>>>> like value.
>>>
>>> I would be fine with doing the interrupt bindings based on IRQs
>>> instead of pIRQs, but I'm afraid that would require more changes to
>>> hypercalls and Xen internals.
>>>
>>> At some point I need to work on a new interface to do passthrough, so
>>> that we can remove the usage of domctls from QEMU.  That might be a
>>> good opportunity to switch from using pIRQs.
>>
>> Thanks for your input, but I may be a bit behind you with my knowledge and can't fully understand the discussion.
>> How should I modify this question later?
>> Should I add a new hypercall specifically for passthrough?
>> Or if it is to prevent the (un)map from being used for PVH guests, can I just add a new function to check if the subject domain is a PVH type? Like is_pvh_domain().
> 
> I think that would be part of a new interface, as said before I don't
> think it would be fair to force you to do all this work.  I won't
> oppose with the approach to attempt to re-use the existing interfaces
> as much as possible.
> 
> I think this patch needs to be adjusted to drop the change to
> xen/arch/x86/physdev.c, as just allowing PHYSDEVOP_{,un}map_pirq
> without any change to do_physdev_op() should result in the correct
> behavior.

Plus perhaps adding respective clarification to the description, as
to exposing the functionality to wider than (presently) necessary
"audience".

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 09:41:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 09:41:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770835.1181426 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZomQ-0007T2-Sh; Fri, 02 Aug 2024 09:40:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770835.1181426; Fri, 02 Aug 2024 09:40:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZomQ-0007Sv-Pm; Fri, 02 Aug 2024 09:40:58 +0000
Received: by outflank-mailman (input) for mailman id 770835;
 Fri, 02 Aug 2024 09:40: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=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZomP-0007So-2e
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 09:40:57 +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 51074e27-50b3-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 11:40:56 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5a1337cfbb5so12762625a12.3
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 02:40:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b839610c77sm885172a12.9.2024.08.02.02.40.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 02 Aug 2024 02:40:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 51074e27-50b3-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722591656; x=1723196456; 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=pKKXex9KFUOu26NCOYv46gE/FsjTIih06YuWjkdAdy0=;
        b=V7rD41K+YVB6d5cF9uhZ4nzm+oQQrynvw6VEyjzd6i4PrPKDzn8OE3sEcJcZ8jVs6+
         rOIp57iFyWuwDfPYxX8IGzzCpz9ofd657P+/eZpR6yPd1M0jFaliaVv+sdvPqTZpO14b
         hij11CCCfzoZlg1TTY8uWG7LlGa41XrNdFUdsyqUP0xGkYTSlzYozTC0foV2LNByHHwY
         Bja+MVwsymm210t1sL9dimhmBOX6st9CFZGv+lFknaOoVXW3FJJLpn3tysltbJHyKMr1
         ImhyxodlcPBVUxtYHvLiiRoFgfGvZ3bVSCrv6zOShHvlyoslz0EqOeR3+2rBFQKfJAnD
         jduw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722591656; x=1723196456;
        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=pKKXex9KFUOu26NCOYv46gE/FsjTIih06YuWjkdAdy0=;
        b=Or1Jl5cfRwSUKtjdmwArEIXyI5vtHks1AIpewSb9g1VMzKG8i2MmzBKMFBS9E9chIB
         k1Q+SoKjfUb+sGoBRfoiwCsqbyI+gbt8Dqvj3HmYcz8zNQodkAamsSeLu5W27yf2mNYr
         e/Z6JavluI0Bk5HrLcGW/G1Vgx0ebBXRWm+iHMO650fs1jLT2Y1ipSbKS/t7Ka8Dpj3w
         GI/LFiRWvXPwL5/3gwHEByNbE87kFk1M/GdCDSjgQlKgaR4Y6M5Bqlg7e0KvBgNzZm9l
         PLbQbsQIt2qVtD2FIlnrYHnleb2Yt6rbjQWJPRjc+VyqOKdpBHAqaQmOZf0BCLs2LCu6
         jlxA==
X-Gm-Message-State: AOJu0YxhP9wSOgI6UrSysqqueir1ISl1fpmwMcjEL0K9GuYPOg21H+cY
	ge5WQrqJLYC/z3YKlqEZjAn7gcT7Ao1KCZl+yHMbmgPMahLw+fh73S6UfK7MkQ==
X-Google-Smtp-Source: AGHT+IFnOZI/8OAJRBwPH2r1vJ7pv8jfSdvMuIzw5oNwVBg7BMFR/MzmBioa4BMqug0/LUbXIqL3eQ==
X-Received: by 2002:aa7:c599:0:b0:5a2:a0d9:c1a2 with SMTP id 4fb4d7f45d1cf-5b7f56fd9cdmr2173272a12.26.1722591655441;
        Fri, 02 Aug 2024 02:40:55 -0700 (PDT)
Message-ID: <d5a6b8e4-d848-4b37-83f2-e492c9e99484@suse.com>
Date: Fri, 2 Aug 2024 11:40:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v12 4/7] x86/domctl: Add hypercall to set the access
 of x86 gsi
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, Andrew Cooper
 <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>, Juergen Gross <jgross@suse.com>,
 "Daniel P . Smith" <dpsmith@apertussolutions.com>,
 Stewart Hildebrand <Stewart.Hildebrand@amd.com>,
 Huang Rui <ray.huang@amd.com>, Jiqian Chen <Jiqian.Chen@amd.com>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-5-Jiqian.Chen@amd.com> <ZqyT7ocbP6AZEb_S@macbook>
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: <ZqyT7ocbP6AZEb_S@macbook>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 02.08.2024 10:08, Roger Pau Monné wrote:
> On Mon, Jul 08, 2024 at 07:41:21PM +0800, Jiqian Chen wrote:
>> Some type of domains don't have PIRQs, like PVH, it doesn't do
>> PHYSDEVOP_map_pirq for each gsi. When passthrough a device
>> to guest base on PVH dom0, callstack
>> pci_add_dm_done->XEN_DOMCTL_irq_permission will fail at function
>> domain_pirq_to_irq, because PVH has no mapping of gsi, pirq and
>> irq on Xen side.
>> What's more, current hypercall XEN_DOMCTL_irq_permission requires
>> passing in pirq to set the access of irq, it is not suitable for
>> dom0 that doesn't have PIRQs.
>>
>> So, add a new hypercall XEN_DOMCTL_gsi_permission to grant/deny
>> the permission of irq(translate from x86 gsi) to dumU when dom0
>> has no PIRQs.
> 
> I've been wondering about this, and if the hypercall is strictly to
> resolve GSIs into IRQs, isn't that the case that Xen identity maps GSI
> into the IRQ space, and hence no translation is required?

It was a long-winded discussion to clarify that in obscure cases
translation is required: Whenever there's a source override in ACPI.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 09:46:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 09:46:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770847.1181456 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZorq-0000JH-4p; Fri, 02 Aug 2024 09:46:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770847.1181456; Fri, 02 Aug 2024 09:46:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZorq-0000JA-1J; Fri, 02 Aug 2024 09:46:34 +0000
Received: by outflank-mailman (input) for mailman id 770847;
 Fri, 02 Aug 2024 09:46:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sjRO=PB=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sZorp-0000IF-0M
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 09:46:33 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on2062e.outbound.protection.outlook.com
 [2a01:111:f403:2412::62e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 17fabafb-50b4-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 11:46:31 +0200 (CEST)
Received: from SJ0PR03CA0220.namprd03.prod.outlook.com (2603:10b6:a03:39f::15)
 by IA1PR12MB6529.namprd12.prod.outlook.com (2603:10b6:208:3a6::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23; Fri, 2 Aug
 2024 09:46:24 +0000
Received: from CO1PEPF000044F5.namprd05.prod.outlook.com
 (2603:10b6:a03:39f:cafe::d) by SJ0PR03CA0220.outlook.office365.com
 (2603:10b6:a03:39f::15) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend
 Transport; Fri, 2 Aug 2024 09:46:24 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1PEPF000044F5.mail.protection.outlook.com (10.167.241.75) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Fri, 2 Aug 2024 09:46:24 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 2 Aug
 2024 04:46:23 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 2 Aug
 2024 04:46:23 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Fri, 2 Aug 2024 04:46:22 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 17fabafb-50b4-11ef-bc03-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=aXe2qJXLoMSUFsl7HnTydDlmdxVYkCTq2zfiKtCP+Srw+gha8lcAQawkDFaVnQ0qBnH4STwo1IxdTg5LsfS0e/uw/n3yOndLZ7/Z7gB8JIB+6+euEGCkWOmCZcSm/uQwyaF+OQjl+ZlMk/7wJKMiLexXWHaH9qNcK/lC2rM+1Vcx2IAxkXu9BnN6cexs1okdPflorCxuqetinFubDiOC490/GYsBwfTXYEAXAmRWEll3lfS/rl6v+0tTGppVLkpUeh9ieVSfvE9wXMk+48ZIN1efmbFN1EXBulbqsANBh+RRfic2HGpTRWXLYA9PldfU6WPISRXLeYOkWQj17L3+NA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ROvLqZynJLVIZT8BYNTLOyYLBnBJrqyCwo6P9kBWoS0=;
 b=cqc3n9HVyiuoyPNBKBNOKkIJoxLodGpycZy7xZLIFpW1m7o/QOe7Od+YhIyDkIXTZnmRcOFeS3tiHEbfdIZvFkxTpn7a7t48kWWJ+TNgTurvD4dchwPg/uFkEe2nbjTk5E/iKepFuXe/3yvGEPu4CTyEbHmUB7ACOMNdlk4A1TNIBKL3Dk+3yrcuNHcGCWt1acZ9V+HO1vXlHOj7QpxSullMDkW4gqP6GT/Sstobsg1hotcoXNA7TCIr1tvtZrdKj4XsmcWaF59z7dDisFlTIoRpf1MAfTado1EeaQi+d49i07gQqnSPT36IVE+pfa7DJ6Y/z+LkXwrZRWiRHdmmpA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ROvLqZynJLVIZT8BYNTLOyYLBnBJrqyCwo6P9kBWoS0=;
 b=3HHeDDdfVX/Qr4CKCvNyihXwjvF7F9lXSQ+EQ58hkH4ZKI0RGXoldJB6eyBHdbX1cH/pI8Vu9qG4/N4JPEtLMJWkyD7gEyAdE5wNW4lFiRMMKidEvbOxk0XtzdUH2Vqd9wT5Cpn+IlUJb9PMe3VSeXTDwlWCx1BzlJxeBrr7FAo=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<artem_mygaiev@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v2 2/3] docs: fusa : reqs: Added a sample of requirements [DO_NOT_MERGE]
Date: Fri, 2 Aug 2024 10:46:13 +0100
Message-ID: <20240802094614.1114227-3-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240802094614.1114227-1-ayan.kumar.halder@amd.com>
References: <20240802094614.1114227-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000044F5:EE_|IA1PR12MB6529:EE_
X-MS-Office365-Filtering-Correlation-Id: 58bdf271-4a89-4801-c450-08dcb2d7f911
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?PdO/TAU8A3MOYDqMnnHGrbqiDqvneeUQy6kktoosJV+5Lq20q2DckOWoHhYi?=
 =?us-ascii?Q?W/G67xCXNm9B3kQSbsog5JdVugkkptbh67+9VGD6WDjBuiwVRlWbfouepYe2?=
 =?us-ascii?Q?JNKwrtjYELoYbdM90andgFTR1+OQH/L6rbk3HjYfmglrvyoPPLE7e5WXD2HD?=
 =?us-ascii?Q?caowbN2Hnovf643WAkB4pmg/EulrBRyJVXt4o7g3qcwog2Y2XmmLK/mTSora?=
 =?us-ascii?Q?bjFg1awKZKLjHI/8BWOk410ujMhKc/sSMM8dnD0SziIV8kaJ0X4VO8bWSPG2?=
 =?us-ascii?Q?JxMreqjBJjiyZbK/68HmQnEgjQP/GmFK9q5VAr5HWA3yedJy4rdqT9HJxIpg?=
 =?us-ascii?Q?UU7Zvg3Y1jdcy8RBYGd+BZCQDizMe1nvcG7ySAHq3eHYQZw/XxQTpROcls6o?=
 =?us-ascii?Q?GoAwT6c43mddO9pbDvUNPXySPI9PJxFa/rr96JRDiJNpb9ke2Au1KeiY9NH8?=
 =?us-ascii?Q?uzWFOKIbiGnQZNzPJSnH6gIc5Yn4r4kXI8N1K0TbsJfnSSi+cNXmCwr+H4sk?=
 =?us-ascii?Q?Ar+b1ISMpfgl/it6JN81aE3SgoIw8nkItQ4fuR1I8rpcp3vAFtgk87oT+oCN?=
 =?us-ascii?Q?VAq8/9B1irjFWjvasPui845uUwRPYoI4H8PyMtA/kKt9bPG5xptElQp/9MLK?=
 =?us-ascii?Q?V6GYmeNfW9+dANy0pnbpm+xHWk1xwIllGedPFSXuCmxjN94TJ8Xcl+Z9FkSN?=
 =?us-ascii?Q?oFKMvIKP6yQiHzULRl3EeLqOE3mj+2YEWl9p80+zv3PYeOKMOKrzntqa/75j?=
 =?us-ascii?Q?jJZEXvzVSvUKEjQHjaoxhpzimBzsem59pnjmKXmh5eq33gE5XhzkP4PPOp6G?=
 =?us-ascii?Q?n2F5RetbUNgLr1uASebF+c9EQ9HOn1l1FRMVQkSDa4O8MFX3epuYz8Sda6/4?=
 =?us-ascii?Q?8Lx9/glVlIPD8Au080PLx9rcaVfmRbqYs7aftq1OWl2DQs9LOEWJUkLaNxQ3?=
 =?us-ascii?Q?FOW5xPYcMuEhFGsXxnjlt4rGqgdse2RA6JOejzaudfk1PWB1dDuPxNamga94?=
 =?us-ascii?Q?hTz7HH3m2duk7EyTBZHSAZ4QpF4FSHkN93TqQLRD99b0L4QKGrrgHYHM7jOi?=
 =?us-ascii?Q?gqAD1X5WYWMdG4LW90vAMDiibuhBChCDU8WQzuFRX6Tm0p1p85f19vVVNJdL?=
 =?us-ascii?Q?HC8kCObG1m7UGC0x/yBdcrvUq5MV+QWBcq1Dltec+vTS9Lsg+5rIz4G1rgDE?=
 =?us-ascii?Q?QHK/194ANGxTSkMzbI3XB2BixiCBtpdGe8u1y3tYtO3Mf4ZRCKQDpcuyiMxx?=
 =?us-ascii?Q?ZrSShzwXK7GWyYVdA3lb3LOZ0d2op18VQXR4sdHpRkSjSiUkH64tc4/lOA7V?=
 =?us-ascii?Q?+8o+rQFP1AzgPUIrP7HvYKmLSbBic8srqtSuddYS6unfn0Nb91KM11URl/SG?=
 =?us-ascii?Q?+1UtmN0kHoG31kU5koErOHFBETqA?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 09:46:24.3515
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 58bdf271-4a89-4801-c450-08dcb2d7f911
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000044F5.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6529

Added a sample of market, product and design requirements. This is to
help explain how we are writing the requirements and understand the
context of the first patch.
We will be sending these requirements for review in the subsequent
patches.

Please do not merge this patch.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
Changes from :-

v1 - 1. Filenames contain '-' instead of '_'.

 .../reqs/design-reqs/arm64/emulated-uart.rst  | 240 ++++++++++++++++++
 .../reqs/design-reqs/arm64/generic-timer.rst  | 146 +++++++++++
 docs/fusa/reqs/design-reqs/xen-version.rst    | 207 +++++++++++++++
 docs/fusa/reqs/market-reqs/reqs.rst           |  77 ++++++
 docs/fusa/reqs/product-reqs/reqs.rst          |  64 +++++
 5 files changed, 734 insertions(+)
 create mode 100644 docs/fusa/reqs/design-reqs/arm64/emulated-uart.rst
 create mode 100644 docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
 create mode 100644 docs/fusa/reqs/design-reqs/xen-version.rst
 create mode 100644 docs/fusa/reqs/market-reqs/reqs.rst
 create mode 100644 docs/fusa/reqs/product-reqs/reqs.rst

diff --git a/docs/fusa/reqs/design-reqs/arm64/emulated-uart.rst b/docs/fusa/reqs/design-reqs/arm64/emulated-uart.rst
new file mode 100644
index 0000000000..483db92fa8
--- /dev/null
+++ b/docs/fusa/reqs/design-reqs/arm64/emulated-uart.rst
@@ -0,0 +1,240 @@
+UART
+====
+
+The following are the requirements related to SBSA UART [1] emulated and
+exposed by Xen to Arm64 domains.
+
+Probe the UART device tree node
+-------------------------------
+
+`XenSwdgn~arm64_uart_probe_dt_node~1`
+
+Description:
+Xen shall generate a device tree node for the SBSA UART (in accordance to Arm
+SBSA UART device tree binding [2]) to allow domains to probe it.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Transmit data in software polling mode
+--------------------------------------
+
+`XenSwdgn~arm64_uart_transmit_data_poll_mode~1`
+
+Description:
+Domain shall transmit data in polling mode (i.e. without involving interrupts).
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Transmit data in interrupt driven mode
+--------------------------------------
+
+`XenSwdgn~arm64_uart_transmit_data_irq_mode~1`
+
+Description:
+Domain shall transmit data in interrupt driven mode.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Receive data in software polling mode
+-------------------------------------
+
+`XenSwdgn~arm64_uart_receive_data_polling_mode~1`
+
+Description:
+Domain shall receive data in polling mode (i.e. without involving interrupts).
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Receive data in interrupt driven mode
+-------------------------------------
+
+`XenSwdgn~arm64_uart_receive_data_interrupt_driven_mode~1`
+
+Description:
+Domain shall receive data in interrupt driven mode.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART data register
+-------------------------
+
+`XenSwdgn~arm64_uart_access_data_register~1`
+
+Description:
+Domain shall access (read/write) UART data register.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART receive status register
+-----------------------------------
+
+`XenSwdgn~arm64_uart_access_receive_status_register~1`
+
+Description:
+Domain shall access (read/write) UART receive status register.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART flag register
+-------------------------
+
+`XenSwdgn~arm64_uart_access_flag_register~1`
+
+Description:
+Domain shall access (read only) UART flag register.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART mask set/clear register
+-----------------------------------
+
+`XenSwdgn~arm64_uart_access_mask_register~1`
+
+Description:
+Domain shall access (read/write) UART mask set/clear register.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART raw interrupt status register
+-----------------------------------------
+
+`XenSwdgn~arm64_uart_access_raw_interrupt_status_register~1`
+
+Description:
+Domain shall access (read only) UART raw interrupt status register.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART masked interrupt status register
+--------------------------------------------
+
+`XenSwdgn~arm64_uart_access_mask_irq_status_register~1`
+
+Description:
+Domain shall access (read only) UART masked interrupt status register.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART interrupt clear register
+------------------------------------
+
+`XenSwdgn~arm64_uart_access_irq_clear_register~1`
+
+Description:
+Domain shall access (write only) UART interrupt clear register.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Receive UART TX interrupt
+-------------------------
+
+`XenSwdgn~arm64_uart_receive_tx_irq~1`
+
+Description:
+Domain shall receive UART TX interrupt
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Receive UART RX interrupt reception
+-----------------------------------
+
+`XenSwdgn~arm64_uart_receive_rx_irq~1`
+
+Description:
+Domain shall receive UART RX interrupt
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Initial State
+=============
+
+Access UART in an initial (reset) state
+---------------------------------------
+
+`XenSwdgn~arm64_uart_access_reset_state~1`
+
+Description:
+Domain shall be given the access to the UART in a state, where all registers
+hold the reset value according to the specification [3] (only for registers
+implemented as part of SBSA UART).
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+| [1] Arm Base System Architecture, chapter B
+| [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/serial/arm_sbsa_uart.txt
+| [3] PrimeCell UART (PL011)
diff --git a/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
new file mode 100644
index 0000000000..00228448a3
--- /dev/null
+++ b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
@@ -0,0 +1,146 @@
+Generic Timer
+=============
+
+The following are the requirements related to ARM Generic Timer [1] interface
+exposed by Xen to Arm64 domains.
+
+Probe the Generic Timer device tree node from a domain
+------------------------------------------------------
+
+`XenSwdgn~arm64_probe_generic_timer_dt~1`
+
+Description:
+Xen shall generate a device tree node for the Generic Timer (in accordance to
+ARM architected timer device tree binding [2]) to allow domains to probe it.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Read system counter frequency
+-----------------------------
+
+`XenSwdgn~arm64_read_system_counter_freq~1`
+
+Description:
+Domain shall read the frequency of the system counter (either via CNTFRQ_EL0
+register or "clock-frequency" device tree property if present).
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Access CNTKCTL_EL1 system register from a domain
+------------------------------------------------
+
+`XenSwdgn~arm64_access_cntkctl_el1_system_register~1`
+
+Description:
+Domain shall access the counter-timer kernel control register to allow
+controlling the access to the timer from userspace (EL0).
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Access virtual timer from a domain
+----------------------------------
+
+`XenSwdgn~arm64_access_virtual_timer~1`
+
+Description:
+Domain shall access and make use of the virtual timer by accessing the following
+system registers:
+CNTVCT_EL0,
+CNTV_CTL_EL0,
+CNTV_CVAL_EL0,
+CNTV_TVAL_EL0.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Access physical timer from a domain
+-----------------------------------
+
+`XenSwdgn~arm64_access_physical_timer~1`
+
+Description:
+Domain shall access and make use of the physical timer by accessing the
+following system registers:
+CNTPCT_EL0,
+CNTP_CTL_EL0,
+CNTP_CVAL_EL0,
+CNTP_TVAL_EL0.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Trigger the virtual timer interrupt from a domain
+-------------------------------------------------
+
+`XenSwdgn~arm64_trigger_virtual_timer_interrupt~1`
+
+Description:
+Domain shall program the virtual timer to generate the interrupt when the
+asserted condition is met.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Trigger the physical timer interrupt from a domain
+--------------------------------------------------
+
+`XenSwdgn~arm64_trigger_physical_timer_interrupt~1`
+
+Description:
+Domain shall program the physical timer to generate the interrupt when the
+asserted condition is met.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Assumption of Use on the Firmware
+=================================
+
+Expose system timer frequency
+-----------------------------
+
+`XenSwdgn~arm64_program_cntfrq_el0_or_dt_prop_system_timer_freq~1`
+
+Description:
+Underlying firmware shall program CNTFRQ_EL0 with the system timer frequency.
+As an alternative, "clock-frequency" dt property (in the host device tree) can
+also be used to specify the system timer frequency. This helps in case of buggy
+firmware when CNTFRQ_EL0 is programmed incorrectly or not programmed at all.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
diff --git a/docs/fusa/reqs/design-reqs/xen-version.rst b/docs/fusa/reqs/design-reqs/xen-version.rst
new file mode 100644
index 0000000000..c5c58bb2df
--- /dev/null
+++ b/docs/fusa/reqs/design-reqs/xen-version.rst
@@ -0,0 +1,207 @@
+Hypercall xen_version
+=====================
+
+The following are the requirements related to __HYPERVISOR_xen_version hypercall
+[1] exposed by Xen to Arm64 and AMD64 PVH domains.
+
+Access hypercall __HYPERVISOR_xen_version for getting xen version
+-----------------------------------------------------------------
+
+`XenSwdgn~access_hyp_xen_version_read_ver~1`
+
+Description:
+Domain shall access __HYPERVISOR_xen_version passing XENVER_version
+as a command.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Validate the xen version returned by the XENVER_version command
+---------------------------------------------------------------
+
+`XenSwdgn~validate_version_hyp_xen_version~1`
+
+Description:
+The xen version returned should correspond to 4.18.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Access hypercall __HYPERVISOR_xen_version for getting xen extraversion
+----------------------------------------------------------------------
+
+`XenSwdgn~access_hyp_xen_version_get_extraversion~1`
+
+Description:
+Domain shall access __HYPERVISOR_xen_version passing XENVER_extraversion as a
+command.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Access hypercall __HYPERVISOR_xen_version for getting compile information
+-------------------------------------------------------------------------
+
+`XenSwdgn~access_hyp_xen_version_get_compile_info~1`
+
+Description:
+Domain shall access __HYPERVISOR_xen_version passing XENVER_compile_info as a
+command.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Access hypercall __HYPERVISOR_xen_version for getting capabilities
+------------------------------------------------------------------
+
+`XenSwdgn~access_hyp_xen_version_get_capabilities~1`
+
+Description:
+Domain shall access __HYPERVISOR_xen_version passing XENVER_capabilities as a
+command.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Validate the capabilities returned by XENVER_capabilities command
+-----------------------------------------------------------------
+
+`XenSwdgn~validate_cap_return_xenver_capabilities~1`
+
+Description:
+For Arm64, the capabilities returned should be xen-*-aarch64 string.
+For AMD64 PVH, the capabilities returned should be hvm-*-x86_64 string.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Access hypercall __HYPERVISOR_xen_version for getting changeset
+---------------------------------------------------------------
+
+`XenSwdgn~access_hyp_xen_version_get_changeset~1`
+
+Description:
+Domain shall access __HYPERVISOR_xen_version passing XENVER_changeset
+as a command.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Access hypercall __HYPERVISOR_xen_version for getting features
+--------------------------------------------------------------
+
+`XenSwdgn~access_hyp_xen_version_get_features~1`
+
+Description:
+Domain shall access __HYPERVISOR_xen_version passing XENVER_get_features as a
+command.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Check supported features returned by the XENVER_get_features command when the submap index passed is 0
+------------------------------------------------------------------------------------------------------
+
+`XenSwdgn~check_supported_features_xenver_get_features~1`
+
+Description:
+For Arm64, the bit position corresponding to the supported features should be 1.
+Examples of Arm64 supported features:
+
+ * XENFEAT_ARM_SMCCC_supported
+
+For AMD64 PVH, the bit positions corresponding to the supported features should
+be 1.
+Examples of AMD64 PVH supported features:
+
+ * XENFEAT_memory_op_vnode_supported
+ * XENFEAT_vcpu_time_phys_area
+ * XENFEAT_runstate_phys_area
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Access hypercall __HYPERVISOR_xen_version for getting guest handle
+------------------------------------------------------------------
+
+`XenSwdgn~access_hyp_xen_version_get_guest_handle~1`
+
+Description:
+Domain shall access __HYPERVISOR_xen_version passing XENVER_guest_handle as a
+command.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Access hypercall __HYPERVISOR_xen_version for getting xen pagesize
+------------------------------------------------------------------
+
+`XenSwdgn~access_hyp_xen_version_get_xen_pagesize~1`
+
+Description:
+Domain shall access __HYPERVISOR_xen_version passing XENVER_pagesize
+as a command and NULL as the guest handle.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Validate the page size returned by XENVER_pagesize command
+----------------------------------------------------------
+
+`XenSwdgn~validate_page_size_xenver_pagesize_cmd~1`
+
+Description:
+The returned page size should be 4KB.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+| [1] https://xenbits.xenproject.org/gitweb/?p=xen.git;a=blob;f=xen/include/public/version.h;hb=HEAD
diff --git a/docs/fusa/reqs/market-reqs/reqs.rst b/docs/fusa/reqs/market-reqs/reqs.rst
new file mode 100644
index 0000000000..a3f84cd503
--- /dev/null
+++ b/docs/fusa/reqs/market-reqs/reqs.rst
@@ -0,0 +1,77 @@
+Functional Requirements
+=======================
+
+Run Arm64 VMs
+-------------
+
+`XenMkt~run_arm64_vms~1`
+
+Description:
+Xen shall run Arm64 VMs.
+
+Rationale:
+
+Comments:
+
+Needs:
+ - XenProd
+
+Run AMD-x86 VMs
+---------------
+
+`XenMkt~run_x86_vms~1`
+
+Description:
+Xen shall run AMD-x86 VMs.
+
+Rationale:
+
+Comments:
+
+Needs:
+ - XenProd
+
+Support non paravirtualised VMs
+-------------------------------
+
+`XenMkt~non_pv_vms_support~1`
+
+Description:
+Xen shall support running guests which are not virtualisation aware.
+
+Rationale:
+
+Comments:
+
+Needs:
+ - XenProd
+
+Provide console to the VMs
+--------------------------
+
+`XenMkt~provide_console_vms~1`
+
+Description:
+Xen shall provide a console to a VM.
+
+Rationale:
+
+Comments:
+
+Needs:
+ - XenProd
+
+Provide timer to the VMs
+------------------------
+
+`XenMkt~provide_timer_vms~1`
+
+Description:
+Xen shall provide a timer to a VM.
+
+Rationale:
+
+Comments:
+
+Needs:
+ - XenProd
diff --git a/docs/fusa/reqs/product-reqs/reqs.rst b/docs/fusa/reqs/product-reqs/reqs.rst
new file mode 100644
index 0000000000..9954b7532a
--- /dev/null
+++ b/docs/fusa/reqs/product-reqs/reqs.rst
@@ -0,0 +1,64 @@
+Domain Creation And Runtime
+===========================
+
+Emulated UART
+-------------
+
+`XenProd~emulated_uart~1`
+
+Description:
+Xen shall emulate Arm SBSA UART on behalf of the domains.
+
+Rationale:
+
+Comments:
+The domains can use it to write/read to/from the console.
+
+Covers:
+ - `XenMkt~run_arm64_vms~1`
+ - `XenMkt~non_pv_vms_support~1`
+ - `XenMkt~provide_console_vms~1`
+
+Needs:
+ - XenSwdgn
+
+Emulated Timer
+--------------
+
+`XenProd~emulated_timer~1`
+
+Description:
+Xen shall emulate Arm Generic Timer timer on behalf of domains.
+
+Rationale:
+
+Comments:
+The domains can use it for e.g. scheduling.
+
+Covers:
+ - `XenMkt~run_arm64_vms~1`
+ - `XenMkt~non_pv_vms_support~1`
+ - `XenMkt~provide_timer_vms~1`
+
+Needs:
+ - XenSwdgn
+
+Version Hypercall
+-----------------
+
+`XenProd~version_hypercall~1`
+
+Description:
+Xen shall provide an interface to expose Xen version, type and compile
+information.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenMkt~run_arm64_vms~1`
+ - `XenMkt~run_x86_vms~1`
+
+Needs:
+ - XenSwdgn
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 09:46:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 09:46:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770845.1181436 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZorm-0008Fb-En; Fri, 02 Aug 2024 09:46:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770845.1181436; Fri, 02 Aug 2024 09:46:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZorm-0008FU-Am; Fri, 02 Aug 2024 09:46:30 +0000
Received: by outflank-mailman (input) for mailman id 770845;
 Fri, 02 Aug 2024 09:46:29 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sjRO=PB=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sZorl-00083o-2y
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 09:46:29 +0000
Received: from NAM12-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam12on2061e.outbound.protection.outlook.com
 [2a01:111:f403:200a::61e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1591fb04-50b4-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 11:46:27 +0200 (CEST)
Received: from SJ0PR03CA0219.namprd03.prod.outlook.com (2603:10b6:a03:39f::14)
 by DM6PR12MB4356.namprd12.prod.outlook.com (2603:10b6:5:2aa::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23; Fri, 2 Aug
 2024 09:46:22 +0000
Received: from CO1PEPF000044F5.namprd05.prod.outlook.com
 (2603:10b6:a03:39f:cafe::a9) by SJ0PR03CA0219.outlook.office365.com
 (2603:10b6:a03:39f::14) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend
 Transport; Fri, 2 Aug 2024 09:46:22 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1PEPF000044F5.mail.protection.outlook.com (10.167.241.75) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Fri, 2 Aug 2024 09:46:22 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 2 Aug
 2024 04:46:19 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 2 Aug
 2024 04:46:19 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Fri, 2 Aug 2024 04:46:18 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1591fb04-50b4-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=FWxpjV88gapLYVANCSieKzHsC+sRccOcqczRdTK2RfTSrh8tKuCkNDpPIzoDgh0WFQ7xWDP2e+LQF6//p/i31N19q5MOuLOQgOV3SAkjSOIpaj7ZRWVGOib6QkYnGoO0K/frdXz5+p2QgD9e2AsWuh73JgGwpxzCMoQoMgqrdEL28oWwEMOy+rmPHpltwr1DD9vdjIOGVgjJwkqiIGtlq1on38Z2i6+RKHS7MW8RPNYnvcXLju63ORi1vgrYvyuRywiyibsyq+uQEHMJwCpP7ukjqLLKxebCAqtaemixWeTydt3vvk9nRgENf6+SP/7zzvoZQulb6UkJly02W5MtCw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=UHQpMccu1yV6wAzWmUCoAEh7UVBNVQqXn3aoswC3wJg=;
 b=npvEqwAHk89VarIOOWHOccUJU98yOHD3epaxwmTnfAezndajSemUWvVdR0DcyAA8KgqpvC7SdhphSDxcyjeMpTpY5+Q9HhMhJneU8iXXLT+X3aodTRQZu/m3EKJR4BOR9p9k5sn26y8G/P1OTnO1l5c4wvD5iR4hhF64y4qiA5C7TkuAUlPlyQ3QwaJKgb1HrtD00bOadymsHdXnWWp5q8rjTs8qB2pxDwrUJDQlxCnNfbV1G/HSlboFq5o03vyAIhM2wLWij6oU1rQKSod/MESJ7s4aiwk0tZliMzTK/YN8VMVnQqWyw1shJZZPteLKuuoKG9uvehtaM9TnvDivvA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=UHQpMccu1yV6wAzWmUCoAEh7UVBNVQqXn3aoswC3wJg=;
 b=Ipj6eWhabw/C2BO72LfHzYdjMWl+rJUzCkBd375LwtkRRy/2vmWW3Em6w3yYD0qHYnivvMrjjsHeTtTorJB6yBvHd89wtZCmHFcw7XgITmKhjzcRxWntJLQeQSq0775X/XP8kCDk5Az5zY8EDzGA3MZyB02iyOP8ujR2RM+jN/o=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<artem_mygaiev@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v2 0/3] Introduce functional safety related documents
Date: Fri, 2 Aug 2024 10:46:11 +0100
Message-ID: <20240802094614.1114227-1-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000044F5:EE_|DM6PR12MB4356:EE_
X-MS-Office365-Filtering-Correlation-Id: 85653052-0ff8-417b-4a88-08dcb2d7f7b3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|82310400026|376014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?CN4LGdD4G6Omr2nbybuUnbo/KNL+2NMtMKumbpjKNIkuUuVtMEfWR2xIZrMm?=
 =?us-ascii?Q?DsLemrW0QhONwCBHARUiA0BEg+gvAF7c7zP6gd6z4bkeafJXHnItPSxe+p8Y?=
 =?us-ascii?Q?xhlGpE3CdntkJK+ad3USx/8z9ap5mEce6f05khbZ42TAblL9np11z6WTChXK?=
 =?us-ascii?Q?gYCmsgnptxf/waSRBeWiqCvKpsJxlAx17fK65VUSpuu6fyqlJlCN7iU37VdG?=
 =?us-ascii?Q?wbVhwOzGwPB77MaVRKAcPf9JqW554CBuM4rldnnWrkgOECKdRzDfAT8aMrZC?=
 =?us-ascii?Q?aayPM7XcMq9W5+vH9cPdfdYbSPTJeckkTlOfyh3zzA3wKS0K23D9v9zlBgG3?=
 =?us-ascii?Q?0jibjRC6sLlAwZqHjm5ixOnL8A7lorsiZjDPmAp5NLQaF4DxcTENk6NO+3Rv?=
 =?us-ascii?Q?FtD18VesaDfgpOYHjKQ9tKBzwnY4T9pitlmen0aJOe+Kh2bZnINQud0ZgZnI?=
 =?us-ascii?Q?QkcJg22EGRx70GOxpGW/tNuzqkazKffs80YlzGNolu1AM+oZt9xeOGB1rEdY?=
 =?us-ascii?Q?V43GOK1KYX2mBa1FT2RmL9Z+dUHcFCKwnchElzRIimzIRNEYaWemb1UU1+JE?=
 =?us-ascii?Q?jsqRW2wqtvLPa3xNbBeAzRIfYgLijjCMveu/Ig6Rmgz7bmHbHMos9NTCicKS?=
 =?us-ascii?Q?a6LHcnkgsNhXJIvDVe4a3EOZ4lW+AYq7LYTYc6+F+7DGQqn4SaRxGme0JYOa?=
 =?us-ascii?Q?t9R6wsTWfMzIlznwhdrqmMucmQnp4lrxzD5WhsoR2XYJzEghgDIGrV+Ex1Ar?=
 =?us-ascii?Q?ikgDvfGzYzpZy8hNwg9eGSJOcjsMGj+hJF8ZdI/nPz9vFnDmeyKUby3Rxakn?=
 =?us-ascii?Q?vDtDhUtU9aG6vd41l36fIuMFvG8EMJraXjOKiQL9PzkvucPGajM7gb7zIeTx?=
 =?us-ascii?Q?uFIGw0+PfyDdr6TGyf7hrIau1Lsz8RslsQLnbZchh3vbuso4LuHzu7VdV1Kx?=
 =?us-ascii?Q?0XsTiLLsxLzrA/lfOOk+F1vjBHhoRDjk4K6q/hl961OnEm7C/HveLmk0Xzhz?=
 =?us-ascii?Q?W7BCAuek860ZQMts52fnhmTvzSAtOEGbQZkAPGYP1/oibUl7QMtpAMuLb6PU?=
 =?us-ascii?Q?uKom7jFTti/YWRyu/OeHSDltnGTizGMMbscAOZvlC2RDctaeZ/7z+rvfGDgK?=
 =?us-ascii?Q?+XppbgiKImsmmpcaTt+Lx7Z4WxsZwDRgXbga6JCuo5QfUQGOKY8xgg8j1pS2?=
 =?us-ascii?Q?t/Am5HcGAnTzWoQFx3uwLEORuFkUIvrtNSnUWoq0aQ1rblC3O6uqUsXveHkK?=
 =?us-ascii?Q?dBaruxKIVHvPYCmQWxWNDPJtN4a4kmaeN2a+in0MHieiMTptvfCOGtwwkojc?=
 =?us-ascii?Q?3cL+fdwW3OhR6lMmNpHo44X/bNa0QJq7dLXYoWanelZf+VsDHerEgwx2pes5?=
 =?us-ascii?Q?m+WVOTogCAOTKKZgC9w3qyUH2cwT?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(376014)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 09:46:22.0390
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 85653052-0ff8-417b-4a88-08dcb2d7f7b3
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000044F5.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4356

Hi,

In the Xen summit, we presented an update on Xen Functional Safety. For
details, please refer to 
https://youtu.be/eFRTHSGDMfQ?si=sYOdYfDI7qsgkcjE  ("Xen Functional
Safety - an Update - Ayan Kumar Halder & Michal Orzel, AMD")
 
We wish to start with upstreaming the requirements.

This patches illustrate how we are writing the requirements and provides
some examples.
The support level is experimental and it will be maintained on a best
effort basis.

Changes from v1 :-
1. Added "docs: fusa: reqs: Added a requirements writing style guide" in this
patch serie.

Ayan Kumar Halder (3):
  docs: Introduce Fusa Requirement and define maintainers
  docs: fusa : reqs: Added a sample of requirements [DO_NOT_MERGE]
  docs: fusa: reqs: Added a requirements writing style guide

 MAINTAINERS                                   |   9 +
 docs/fusa/reqs/README.md                      |  78 ++++++
 docs/fusa/reqs/REQUIREMENTS-STYLE             |  34 +++
 .../reqs/design-reqs/arm64/emulated-uart.rst  | 240 ++++++++++++++++++
 .../reqs/design-reqs/arm64/generic-timer.rst  | 146 +++++++++++
 docs/fusa/reqs/design-reqs/xen-version.rst    | 207 +++++++++++++++
 docs/fusa/reqs/market-reqs/reqs.rst           |  77 ++++++
 docs/fusa/reqs/product-reqs/reqs.rst          |  64 +++++
 8 files changed, 855 insertions(+)
 create mode 100644 docs/fusa/reqs/README.md
 create mode 100644 docs/fusa/reqs/REQUIREMENTS-STYLE
 create mode 100644 docs/fusa/reqs/design-reqs/arm64/emulated-uart.rst
 create mode 100644 docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
 create mode 100644 docs/fusa/reqs/design-reqs/xen-version.rst
 create mode 100644 docs/fusa/reqs/market-reqs/reqs.rst
 create mode 100644 docs/fusa/reqs/product-reqs/reqs.rst

-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 09:46:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 09:46:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770846.1181441 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZorm-0008Ir-N9; Fri, 02 Aug 2024 09:46:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770846.1181441; Fri, 02 Aug 2024 09:46:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZorm-0008HT-Ix; Fri, 02 Aug 2024 09:46:30 +0000
Received: by outflank-mailman (input) for mailman id 770846;
 Fri, 02 Aug 2024 09:46:30 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sjRO=PB=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sZorm-00083o-3B
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 09:46:30 +0000
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on20617.outbound.protection.outlook.com
 [2a01:111:f400:7e88::617])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 163822dc-50b4-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 11:46:28 +0200 (CEST)
Received: from SJ0PR03CA0240.namprd03.prod.outlook.com (2603:10b6:a03:39f::35)
 by SN7PR12MB7154.namprd12.prod.outlook.com (2603:10b6:806:2a5::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Fri, 2 Aug
 2024 09:46:23 +0000
Received: from CO1PEPF000044F5.namprd05.prod.outlook.com
 (2603:10b6:a03:39f:cafe::fe) by SJ0PR03CA0240.outlook.office365.com
 (2603:10b6:a03:39f::35) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend
 Transport; Fri, 2 Aug 2024 09:46:23 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1PEPF000044F5.mail.protection.outlook.com (10.167.241.75) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Fri, 2 Aug 2024 09:46:23 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 2 Aug
 2024 04:46:20 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Fri, 2 Aug 2024 04:46:20 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 163822dc-50b4-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=lyZ9shV5hb3FjOcnS8jNaM7e4o11EwPzPbh53TEqkbPEJGRyZbHk+SCLzZPNfFfIBSn4e79auUoxRJsJNP6xpBrzSs7vA7MR1ZeddaUYH9ILbmKyHdZ/p4bIMe30fakx2SfBa7+xiBIKAl2ALk9rmEkewyTNKepAIZfVDrbLfNOMUmKBEvTusAuNu+S3lMBB1AzqybVBVAIKZeqkecjMul3UII2mLwtAU70O6f9x8fsvkAw45L+F96vxDiX/dMPUioUO1HZt4N4IXCsbGFNgW4Qs3RW1cc9sB3gVeltgr7XcmaFfnhypE7GxgP3hfbB9rGVwh9LIJPSlJ1jumYl3HQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=RFFqgAkmdyOuJy5JYhvhPk6hTFrLiUYeXIC7Vd/14p0=;
 b=WqNGy8ZvXJeQf3UHrnRQum6GN+mHZxa3+4oVbeGLU0BTdws4gFWM480HEMuRWFq4iIqkUgvnvPsjw+dCUHBaNGG8og04NvG6OYavIBfWTsgsJ2be0PCa432QSoHWXcvXHCzAa0FfHF6ebAKohM2TuOpVo6KRKd+Bi265RMAywzbjdp0vJ5xgtS3m8ndYAXptueeLtQ180uEBoxGqwnTnP2p/HF1wfdMiL4wGn21Oh42l+nQ0hg7r+K1R7ZoRBV4g9Z7lLrN2G4UaH+vtUz/nWp+0bsXdhowLLgzP6pNLL/358f0elX+wfTTskR6LRGxRolD+axHqVRr7rWRCfX7LgA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=RFFqgAkmdyOuJy5JYhvhPk6hTFrLiUYeXIC7Vd/14p0=;
 b=tfQOt4xAVuF3Yct6Ca2dkoJ8/gVJJfC0oatji2I52p8GqATRqXAY9oCKvqlwuD1dcr70scUVkO4nDirQrKKNAbnhVg3wxGxBLU6txdFfoldzQ9BU2S/sA0Dof4RdVzWt/g177c3rbv33hXunPcinW8+pVJqrMEn+0gjfDC9jR/I=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<artem_mygaiev@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v2 1/3] docs: Introduce Fusa Requirement and define maintainers
Date: Fri, 2 Aug 2024 10:46:12 +0100
Message-ID: <20240802094614.1114227-2-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240802094614.1114227-1-ayan.kumar.halder@amd.com>
References: <20240802094614.1114227-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB03.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000044F5:EE_|SN7PR12MB7154:EE_
X-MS-Office365-Filtering-Correlation-Id: 1907e77b-087e-4ec7-1afc-08dcb2d7f866
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?TKgxOJLfwoGsBGRweiVrLRa++kchUkRfy45ZjWZT/EbgBWLakQTTA/ikCEoy?=
 =?us-ascii?Q?uhBNnSnQRVIawYv9Es5ugl1IfD8zFVwmTx3OdTe0NmpUF1R5AZu9TVGFEeZf?=
 =?us-ascii?Q?lF8/Xj2GQW5gPhfegCydI6Z4d9TyGqBvTONl++hrUt4zJli7Ukxn0Tm09KcU?=
 =?us-ascii?Q?p0SXvmKj7RAYqqrlg5/Gt9V99SzykedVgvtxiQx5HLU5WcxiUsbcWNc1EyIS?=
 =?us-ascii?Q?IoMwLZIQTAJEeI4cSUbbR0LuTQRsHo9stC+lT/HCTVRXqF/bJ6IqHAZG46M3?=
 =?us-ascii?Q?RbA051SJrjQ9fdlVSov8SVu0zjXuzIwc17zllD6DpIIC1nyHJESBFaT/NRye?=
 =?us-ascii?Q?zyrW4EY0N/Z1KNj+wLMvGJ4A4jPy65UNvpNjDVKk+lnFgUvt5hmEl6H+41o4?=
 =?us-ascii?Q?bmhQcmHaiJU/uzgMFWKUSEch53b1RkUXM5E4yYHwcjciI+V+uE7ZEUclVy3W?=
 =?us-ascii?Q?lcfwfMfZkUia4G3mQpoNi3Jng9uKrj0Dv5EEv+8MG7uo50QZjuQmCjBc+jbX?=
 =?us-ascii?Q?c0ZbjXdun8FvY4SRYnk9Q8UwtnWmu+GFsjjKR7jEjjODd3TvUG3SO5O+vv+C?=
 =?us-ascii?Q?0IVqfiZPOAsBtlvlnHDABIfD6tpcNN8IEmrJgVKzAATlqHK3qfWZIw0T00vK?=
 =?us-ascii?Q?7PbezplzEBkjaRFzY31BdUDlSq9giozEwO0imVgYjuViPAp/xNd5hynMkNoB?=
 =?us-ascii?Q?Sf6qi6Nb9gT5AWzj7mZgSJbuugpQdlmhVGCqrOVVOBhrT061v3iH9Uhz2rZd?=
 =?us-ascii?Q?aBxi9296leowe4maalnkiWhBSgsbUCRjHZzC9H2Ft4w3mTbIAAh/E6agKu59?=
 =?us-ascii?Q?wxUvYhXyEMAwO3oTjT/+sXEgvK7Z7Tc8I6jl1zOTQBxwxhpMm1YKWAYeX5/T?=
 =?us-ascii?Q?SdK3yH3dZ54gOIqXflTXulNosWECS6eUbCwoIBfISCJRQWZOBB6ns/3EwuYz?=
 =?us-ascii?Q?7YXMqfWlC3lD6FtAACny1c5JtJ0SnvcAb2xJwX4bEGJRrBQm0OKDDdtkxJTS?=
 =?us-ascii?Q?RwegbqcfOfNJAEd3EHyXCS5l9qSlNX+JOqhkVIXoSbGNtJxtD8PlZ28C6QR9?=
 =?us-ascii?Q?NFxZ/dN41S3nS1+i+JSIa3HMcgLuLK8qwB8YeQKdO4wuUGbFfMqRpnhR7U1r?=
 =?us-ascii?Q?360RFpTinMpWphIRa0SchzBmgkr7LYPXuud4CbKHCXpGbJXzn9Jzy4Ah/SQ2?=
 =?us-ascii?Q?XoSmoAK747qrSibHl+szNcgTbQUVu6fVWRkYiyEAMmGpDpsnx3o+wSlcWufN?=
 =?us-ascii?Q?QoU6zVsPbt6V0f75YIxDXVtO5ezod9M5AtYXgiq+C5wWYIeBYIEqgb/N91yo?=
 =?us-ascii?Q?LHD+u99N7mT3i5krpEqsWFD1okMpt+LY/7gAF4JwpkQ26mh/FbTmgto+/ryO?=
 =?us-ascii?Q?10m25KGTFwN2QJoaePq8otQBHhDImISIoLD/zyhrlvB3CzP4sQ=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 09:46:23.2421
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 1907e77b-087e-4ec7-1afc-08dcb2d7f866
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000044F5.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7154

The FUSA folder is expected to contain requirements and other documents
to enable safety certification of Xen hypervisor.
Added a README to explain how the requirements are categorized, written
and their supported status.

Added maintainers for the same.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
Changes from :-

v1 - 1. Added a comment from Stefano.
2. Added Ack.

 MAINTAINERS              |  9 +++++
 docs/fusa/reqs/README.md | 78 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 87 insertions(+)
 create mode 100644 docs/fusa/reqs/README.md

diff --git a/MAINTAINERS b/MAINTAINERS
index 7c524a8a93..0d328e065c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -314,6 +314,15 @@ F:	xen/arch/x86/include/asm/x86_*/efi*.h
 F:	xen/common/efi/
 F:	xen/include/efi/
 
+FUSA
+M:	Stefano Stabellini <sstabellini@kernel.org>
+M:	Bertrand Marquis <bertrand.marquis@arm.com>
+M:	Michal Orzel <michal.orzel@amd.com>
+M:	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
+M:	Artem Mygaiev <artem_mygaiev@epam.com>
+S:	Supported
+F:	docs/fusa/
+
 GDBSX DEBUGGER
 M:	Elena Ufimtseva <elena.ufimtseva@oracle.com>
 S:	Supported
diff --git a/docs/fusa/reqs/README.md b/docs/fusa/reqs/README.md
new file mode 100644
index 0000000000..651f0a4e00
--- /dev/null
+++ b/docs/fusa/reqs/README.md
@@ -0,0 +1,78 @@
+This folder contains a set of requirements describing Xen and its implementation
+in a form suitable for a safety certification process.
+
+The status is experimental and it is maintained on a best effort basis. The
+requirements may get slightly out of sync with the code. We are actively working
+on a process to keep them updated, more details to follow.
+
+The requirements writing style is inspired from the ANSI/IEEE guide to Software
+Requirements Standard 830-1984.
+
+The requirements are categorized as follows :-
+
+1. Market requirements - They define the high level functionalities of the
+hypervisor without going into concepts specific to Xen. Those should allow a
+system architect to understand wether Xen is providing the functionalities it
+needs for its system. This is the top level of the requirements.
+
+2. Product requirements - They define the Xen specific concepts and interfaces
+provided by Xen without going into implementation details. One or several of
+those requirements are linked to each market requirement. An Architect can use
+them understand how Xen fulfils a market need and design how Xen should be used
+in his system.
+
+3. Design requirements - They describe what the software implementation is doing
+from a technical point of view. One or several design requirement together
+define how product requirements are fulfilled technically and are linked to
+them. An implementer can use them to know how to write or understand the Xen
+code.
+
+The requirements are linked using OpenFastTrace
+(https://github.com/itsallcode/openfasttrace/blob/main/doc/user_guide.md).
+OpenFastTrace parses through the requirements and generates a traceability
+report.
+
+The following is the skeleton for a requirement.
+
+Title  /* Title of the requirement */
+-----
+
+`unique_tag`
+/*
+ * Each requirement needs to have a unique tag associated. The format is
+ * req_type~name~revision.
+ *
+ * Thus, it consists of three components :-
+ * requirement type - This denotes the category of requirement. Thus, it shall
+ * be 'XenMkt', 'XenProd' or 'XenSwdgn' to denote market, product or design
+ * requirement.
+ * name - This denotes name of the requirement. In case of architecture specific
+ * requirements, this starts with the architecture type (ie x86_64, arm64).
+ * revision number - This gets incremented each time the requirement is modified.
+ */
+
+Description:
+This shall describe the requirement in a definitive tone. In other words,
+the requirement begins with 'Xen shall ...'. Further, the description is
+expected to be unambiguous and consistent.
+
+Rationale:
+This describes a rationale explaining the reason of the presence of the
+requirement when this can help the reader. This field can be left blank.
+
+Comments:
+This describes the use cases for the requirement when this can help the
+reader. This field can be left blank as well.
+
+Covers:
+This denotes the unique_tag of the parent. This field is non existent for the
+market requirement as it is the top level.
+
+Needs:
+This denotes the requirement type of its children. This field is non existent
+for the design requirements as there are no subsequent requirements linked to
+them.
+
+
+The requirements are expected to the technically correct and follow the above
+guidelines.
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 09:46:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 09:46:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770848.1181465 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZort-0000ge-C9; Fri, 02 Aug 2024 09:46:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770848.1181465; Fri, 02 Aug 2024 09:46:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZort-0000fy-94; Fri, 02 Aug 2024 09:46:37 +0000
Received: by outflank-mailman (input) for mailman id 770848;
 Fri, 02 Aug 2024 09:46:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sjRO=PB=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sZorr-0000IF-Up
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 09:46:35 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20600.outbound.protection.outlook.com
 [2a01:111:f403:2416::600])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1a357734-50b4-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 11:46:35 +0200 (CEST)
Received: from MW4PR03CA0316.namprd03.prod.outlook.com (2603:10b6:303:dd::21)
 by IA1PR12MB7712.namprd12.prod.outlook.com (2603:10b6:208:420::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Fri, 2 Aug
 2024 09:46:30 +0000
Received: from CO1PEPF000044F4.namprd05.prod.outlook.com
 (2603:10b6:303:dd:cafe::68) by MW4PR03CA0316.outlook.office365.com
 (2603:10b6:303:dd::21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend
 Transport; Fri, 2 Aug 2024 09:46:30 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1PEPF000044F4.mail.protection.outlook.com (10.167.241.74) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Fri, 2 Aug 2024 09:46:30 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 2 Aug
 2024 04:46:28 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Fri, 2 Aug 2024 04:46:28 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1a357734-50b4-11ef-bc03-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=qzMsOsh6m+1P9nXHgp/vZfvRcpIZ+qGnptm0MFiNMasn/ZkaKH7tVR3KVXrAFf/MZWylh4NVnTvgeu38D6Iv1fKtcpYCRy+p26siIJ0m6lELz3B088rKFPNWt87itpwLIFuEvj/NAWqIKwu70X0O37RVN9jHi/FjE2svBqDXG/1GOM46CwzNwjmEYSgeRA8adM7/j8elrMgfte58B6v5b1/y73kaw6SvvxfzXfrOQwpCcNVgfeiIcyGmLnclQKhdgYDKcmE6LNrIKBpZpBJE1aXjca6xXL2KktMD1O9u1xTFWgvsHt7VIj0r6D+/soAOGZgeTJJstVPL4WjweiiDQg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+PH+usP0G5xTrCqcAYiKhBQS5kLnoQhrAx4bS3grPWU=;
 b=ZLQAUaMgplfwLYT7Md7aS4xkKhkMJF/zesUwNXj/T+kqJG5trz+OV7s5qz0FoOcNLqbhGkx5vCitElBb5PgaILduSXBrv4/L5Dj5j4eg2HTYOj8S3BjRwVK/XXDQzS1G6Wukpg1nqwLIM+aqmziS8gxo3J8IGvxKLeIZzpyAQnQnbtwWgCuFgv7dHE7zjSs3KpAkqQEl7eEjHSQi3kSfNVPpIUwunnvZgDmP8AIkadBF4DMSkFZZjIf/+f3rcDk0O40SXVaQGBt9eLMRfBiKNTmNw8qDiEGQk3BSkGDAG88JvUzA8FuxGMr1hCjBQrcSBPvZo4vw0lr+QcfqzakYfw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+PH+usP0G5xTrCqcAYiKhBQS5kLnoQhrAx4bS3grPWU=;
 b=f/KMXBU2Ylsveor7OW+Iag7LUO9FscbC9IwWa5a5Va889dXMIfX1EDP0oJ9k83tn/b0P59LBrtiYBN4ZBW7C0+kjjgnOLn7OTQPssfRb3B+MlETBU/isaTWebxNc/5JPGfJXbvr0GTYqnUBNqwdN5l5P6JvyYqJLRxM7nXFE4NA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<artem_mygaiev@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v2 3/3] docs: fusa: reqs: Added a requirements writing style guide
Date: Fri, 2 Aug 2024 10:46:14 +0100
Message-ID: <20240802094614.1114227-4-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240802094614.1114227-1-ayan.kumar.halder@amd.com>
References: <20240802094614.1114227-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB03.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000044F4:EE_|IA1PR12MB7712:EE_
X-MS-Office365-Filtering-Correlation-Id: b5a92b44-4c90-457f-601c-08dcb2d7fc99
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|376014|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?2G6eOntsc83bzXk3z5whKCebIWycyvprIq77dBLZiyi6CxBvPgTDsP6bRBFV?=
 =?us-ascii?Q?iuqdnIkMpwiRWeM4swmOf2JkvzKwsRavHYfNNEDjglVtYEbJaKFhDymsEyJZ?=
 =?us-ascii?Q?hoGhlqb8yaI/FZ/XBXVYTHqc1hutrtOHLiNtmugtac59tRNFFR3IclfcY8yQ?=
 =?us-ascii?Q?c2YlMRTyKk7jyzBc6PfJJIVk7oEwu46bX9p9iVCOjg6K3L+50YONvgd5QBgN?=
 =?us-ascii?Q?A5/ml9sT4wPzKM7bNYPt7ipfS0bcQa7bH3H7VVYrgCB9Ag677Cc+2/6jcuFs?=
 =?us-ascii?Q?ERyadC3gdlNGwTYxTGocYxk2wW9gJQshrbzYS2GwLv/e9nkHYyHbaZyPQHua?=
 =?us-ascii?Q?ZkRDvQhZoU/x2eAUTO5hQ/kOZDEbf5228mZYHZqMT82a9/gy6aOn/YZVmaSe?=
 =?us-ascii?Q?/V0KYzMzWi3weOx+xjDwSuPplBpxhDHUAGwiKz48p8K1DUmoF1NLt0HLKHKW?=
 =?us-ascii?Q?AcFUqKWlFMScQmqqLeG/5+oy52ZZSnURnNYR4zDflCxDXV+AegMN3xcuYYFh?=
 =?us-ascii?Q?JzKFtdmjEO4DRi8CTRKAIyUN7OrndN87Kx6TYvIHMVKM7zUWUPdnroo10duL?=
 =?us-ascii?Q?9t84927qSwbvoAIHHf+ZR8hjPUGWe4gqCe27CH6CmdeIfxE2WYNa6WTldj1t?=
 =?us-ascii?Q?RpAdKjk9qcap5JHOWHEQ3/TvmMXDET9MGfJG+BDsoj6/d9sNbUoGJdTTfIAP?=
 =?us-ascii?Q?mhuexlgt6gcCBjP7xvzH78O6K9mKkjNbXPiept6u9KvJT5VTye7auHwUSoaH?=
 =?us-ascii?Q?o84LB9bLz5h0zhQ4jidCwy4Xif9VhXbldUX5Ed2OsiRNTYCAR7CzypcqlLQK?=
 =?us-ascii?Q?65jh422HZM0y4qtx5OgBd/Kp5RoApGVuJf9dVvlwxAZWAXas0mX5sKP1ZZf1?=
 =?us-ascii?Q?kgd9AYP3Qi87l2FU6MdypXeeU8D0CbN9+r0rRoRY3o7IOKRA/R5rMfZZ5sIg?=
 =?us-ascii?Q?ZSKVLNwJep4zKh/M5zYw4C65WZ7cZBjb7rfk+1Fz2gCjutnXX7q1EL2dcDXR?=
 =?us-ascii?Q?WVvCgldBt9LojjnB0oybCrtodkpmS4aWnwY0yA9UNtW1AF6kwnuImR4UySie?=
 =?us-ascii?Q?Z1qx6K6lK+w1oaRNTVX4mrUCS66fGlzlCUFi5IvI9tRl1sr8tS9FFWRZ9tCY?=
 =?us-ascii?Q?Zr2ypgUPMfgNM/auqBNhBCrbWYP5u8c4jJmbP2EemL1SAIBQLJe3b0SJfTJu?=
 =?us-ascii?Q?7R0rABpHGNPHmjy4NMwcy3g0yldK2bgYGb1M6rhR6jyiIRVKCKEnSzqIjQ9n?=
 =?us-ascii?Q?kx4aleyc9quXZ+DuI3YRLHfH+pk30zqYFqL9juuAqKhzh+O6BKOR8WGiV6Hg?=
 =?us-ascii?Q?hf8Sfezorlg3IGZx4Ta6f0GzkJ0HiuVXWaGv9HZu6R3ZyUVkD+X2zQkriPjg?=
 =?us-ascii?Q?7bg/F1GhZFvh1/igYlX8mDTN1qfWDlvJvIQgy3xXjdbtBMhuhOxMrlVg4rYs?=
 =?us-ascii?Q?bPljRmb0huzVjm4mY2mQgqOfh/ldAFt5?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 09:46:30.2578
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b5a92b44-4c90-457f-601c-08dcb2d7fc99
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000044F4.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7712

Added a guide to help write and review requirements. The requirements
are written to enable safety certification of Xen hypervisor.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
Changes from :-

v1 - 1. No change.

 docs/fusa/reqs/REQUIREMENTS-STYLE | 34 +++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 docs/fusa/reqs/REQUIREMENTS-STYLE

diff --git a/docs/fusa/reqs/REQUIREMENTS-STYLE b/docs/fusa/reqs/REQUIREMENTS-STYLE
new file mode 100644
index 0000000000..cd2408b9f2
--- /dev/null
+++ b/docs/fusa/reqs/REQUIREMENTS-STYLE
@@ -0,0 +1,34 @@
+Requirements writing style for the Xen Hypervisor
+=================================================
+
+The requirements writing style described below is the style used for writing the
+requirements of the Xen hypervisor to enable functional safety certification.
+
+The requirements writing style is inspired from the ANSI/IEEE guide to Software
+Requirements Standard. Specifically, the requirements should satisfy the
+following validation checklist.
+(Source - https://www.nasa.gov/reference/appendix-c-how-to-write-a-good-requirement)
+
+Clarity -
+The requirements should be clear, unambiguous, consise and simple. Each
+requirement should express a single thought. Each requirement stated should have
+a single interpretation.
+
+Consistency -
+Any requirement shouldn't contradict with any other requirement. The requirements
+should be categorized correctly (the categories have been explained in the
+README). The tone of each requirement should be definitive (ie "Xen shall ..."
+should be present in each requirement).
+
+Traceability -
+Any market requirement should be linked to the product requirement/s and
+vice versa. Any product requirement should be linked to the design requirement/s
+and vice versa. Full bi-directional traceability should be maintained between
+market, product and design requirements.
+
+Correctness -
+The requirements should be feasible and technically correct (at the time of
+writing). However, it is not expected that the requirements will be kept upto
+date with the code.
+
+The requirements follow the same license and line length as the code.
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 09:48:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 09:48:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770876.1181476 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZou7-0002ki-VP; Fri, 02 Aug 2024 09:48:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770876.1181476; Fri, 02 Aug 2024 09:48:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZou7-0002kb-RW; Fri, 02 Aug 2024 09:48:55 +0000
Received: by outflank-mailman (input) for mailman id 770876;
 Fri, 02 Aug 2024 09:48:54 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=q5EM=PB=bounce.vates.tech=bounce-md_30504962.66acab83.v1-f1cd66103ba84679b24e48d33b4ef37f@srs-se1.protection.inumbo.net>)
 id 1sZou6-0002kT-Qm
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 09:48:54 +0000
Received: from mail132-30.atl131.mandrillapp.com
 (mail132-30.atl131.mandrillapp.com [198.2.132.30])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6cbb129b-50b4-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 11:48:52 +0200 (CEST)
Received: from pmta09.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail132-30.atl131.mandrillapp.com (Mailchimp) with ESMTP id
 4Wb1Hl2cjXzP0Jmsx
 for <xen-devel@lists.xenproject.org>; Fri,  2 Aug 2024 09:48:51 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 f1cd66103ba84679b24e48d33b4ef37f; Fri, 02 Aug 2024 09:48:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6cbb129b-50b4-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1722592131; x=1722852631;
	bh=3paG7WC5tpFjE6isF4nMpqvZDXu4SaH1/XFsf9DbhnE=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=MMR44B54Pwb8w2eXIomrlVjLSDBqBq52/UsQonhkrowV5AqKP3XMig85HTvU3W4nU
	 8ra3FibVaOKJaYFzC3ehpkrsyBkWLyK7gwW+0eHiclFRvD0SqXp/6XDFNEQXqXGBZQ
	 EdA4iF/UjzGv956YB5VGlzbAsS93Z9gS5jGrqUQSqppuUpnwWTKxH4JSbZbU5XCUdw
	 MzHy8QIrdeFHOqiPvOSYbPh8rJ6oEM8B50WlS6VpweU7mznSu5b+rqgvglrSL84Rdw
	 LSDzE/TqpE6FKkiF0XH+QWnA9XG2EJsCCM30CbJ3PzsiR30ApMUaYg3H6FibJY5s/h
	 UXAh7fq2QRAWw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1722592131; x=1722852631; i=anthony.perard@vates.tech;
	bh=3paG7WC5tpFjE6isF4nMpqvZDXu4SaH1/XFsf9DbhnE=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=qIPRBUOgOFri+DZjQnN8dxBm+9g+gwjTXcRTa+TGYLu7+K2f9ahta5F5aSgGxk1yH
	 voRr0r5VKT2KoL8dNanN/Zqc22inu6bBe0zjm7uIKwCnbrSVzb3o+No3WUII7+CIHR
	 LteKiiyAroXeQW3Z2L386sEEvUF1YIZhE7jDtt0VP0ul1WAD8l47KhB/+SQAQsMBnQ
	 bYXeyBGSUda0KszbpiS6K+o5YotRW8uXq2btEw6RB/vo91GJ+Xn3b3QYD9jyRq4bBT
	 H9H4OHCdmc4rrM3nkHvtpk1ZIpQuMctj/DPOasArYO8GHPhRmB1VmPQPBWMC4ZQaS5
	 4FmYIdZTB/BBA==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH]=20mktarball:=20only=20archive=20Xen?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1722592130481
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
Message-Id: <ZqyrgV5vXPKwppvP@l14>
References: <cf280800-d0d6-4493-933f-f83f418dd91d@suse.com> <Zqym5op9e2BAn5KA@l14> <4cff5f0b-3a19-4071-a201-51ea72ee48ce@suse.com>
In-Reply-To: <4cff5f0b-3a19-4071-a201-51ea72ee48ce@suse.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.f1cd66103ba84679b24e48d33b4ef37f?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240802:md
Date: Fri, 02 Aug 2024 09:48:51 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Fri, Aug 02, 2024 at 11:34:53AM +0200, Jan Beulich wrote:
> On 02.08.2024 11:29, Anthony PERARD wrote:
> > As for removing the rule "subtree-force-update-all", I don't think
> > that's a good idea at all. As long as Xen's build systems is cloning
> > subtrees we need to keep the rule. Those subtrees aren't going away
> > anytime soon, especially mini-os for stubdom.
> 
> So you expect people might be using that goal from the command line?
> Fair enough to keep it if so. I simply didn't think a goal with this
> long a name would be intended for manual use.

Well, there's "subtree-force-update" described in `make help`, intended
to be used by developers. The "-all" variate update every subtree
regardless whether they are enable with ./configure or not. I did confuse the
two when replying, so I don't know if "-all" variate is still useful or
not.

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 09:52:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 09:52:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770884.1181486 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZoxu-0004DT-E1; Fri, 02 Aug 2024 09:52:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770884.1181486; Fri, 02 Aug 2024 09:52:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZoxu-0004DM-AZ; Fri, 02 Aug 2024 09:52:50 +0000
Received: by outflank-mailman (input) for mailman id 770884;
 Fri, 02 Aug 2024 09:52: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=0M7b=PB=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1sZoxt-0004DG-8A
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 09:52:49 +0000
Received: from EUR03-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur03on20604.outbound.protection.outlook.com
 [2a01:111:f403:260c::604])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f8461b80-50b4-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 11:52:46 +0200 (CEST)
Received: from AS4P190CA0012.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5de::12)
 by GVXPR08MB11036.eurprd08.prod.outlook.com (2603:10a6:150:1f6::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21; Fri, 2 Aug
 2024 09:52:43 +0000
Received: from AMS0EPF0000019A.eurprd05.prod.outlook.com
 (2603:10a6:20b:5de:cafe::15) by AS4P190CA0012.outlook.office365.com
 (2603:10a6:20b:5de::12) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend
 Transport; Fri, 2 Aug 2024 09:52:43 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AMS0EPF0000019A.mail.protection.outlook.com (10.167.16.246) with
 Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7828.19
 via Frontend Transport; Fri, 2 Aug 2024 09:52:42 +0000
Received: ("Tessian outbound 4bc87b8a8d84:v365");
 Fri, 02 Aug 2024 09:52:42 +0000
Received: from L17de36cca420.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 4D9AD9BE-BFFB-4D70-B8C7-E08392DE0425.1; 
 Fri, 02 Aug 2024 09:52:35 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id
 L17de36cca420.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 02 Aug 2024 09:52:35 +0000
Received: from DB9PR08MB6588.eurprd08.prod.outlook.com (2603:10a6:10:25a::24)
 by AS8PR08MB5895.eurprd08.prod.outlook.com (2603:10a6:20b:298::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Fri, 2 Aug
 2024 09:52:34 +0000
Received: from DB9PR08MB6588.eurprd08.prod.outlook.com
 ([fe80::a8fc:ea0d:baf1:23a]) by DB9PR08MB6588.eurprd08.prod.outlook.com
 ([fe80::a8fc:ea0d:baf1:23a%3]) with mapi id 15.20.7828.023; Fri, 2 Aug 2024
 09:52:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f8461b80-50b4-11ef-bc03-fd08da9f4363
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=tg3Sbl8YXsh1ZAhT3qe+hshjFndu5lMO5Y9AYrSk/o288bcqep/8Usbuz8lQGRoyRkGaT8YqWK9a9SQtrVjX58j2X6XM9zpAW1aD334FticfMHbr5J5kyxDXIF3Ihyrzd0+0kAHBFyLiwixTe8EU0yuqqZa7Hwc3OfNzPfKvEYK3y2ksHkJPe66X/lu/z11AldaXFm8v5YPrgqU/j3W3YAliPrENLGi1v7K8JZ1LEbOjdgDuLtmwCPBEQICVjoczxV29LE2v9/xyQ8uvd52/Ko0eieAz880Qfy7EWW6xzWe3rRf9Gpypua/f/drH4C5O0s2mfSlMsJSSN4JAYrL5Cw==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4zny0u29PDwoKSUUaQ4Crr8XYTC3FaXx+RhNkv7KRZQ=;
 b=wjcySPO0NYTyisOuOt3/YkujZFjr5YeH133Jk36CQVwMwMknCkWLfl4TF3PG7HQXdk2edntuXkKkZA0P5z2WNJY9iUwz73K6dLPBt4f2wDJgE/nRDnq+G46VbnCSY7tutPUvr+UEypWRizzEaWNVptCgWkxBvaCWSugIFYUw83H39uU3JbZ9RB8FlFISC+UaGG4bAaepyod2QEW0Wxkg0y8VB+k6T7i1TykR5oCJsEPJ3a1q9B2khJieVKYkAgxWdILpGwkkf0jsdMKibCQs2HhvjJ8AO/05ShwBVHySk4yqGWLH8ykAkF5s9C077KzZOQAGrEi7LAoj+g8lok180g==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com;
 dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com;
 dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4zny0u29PDwoKSUUaQ4Crr8XYTC3FaXx+RhNkv7KRZQ=;
 b=aJmvCn0m52wMQ7fCHmt0op3jDj/J8JefQcWQY7MIxh66WghWBneBRqFqy7DzsnGhaL5sCdcXDODAxncn7eBuDKaqg6iTa2oNnkDji1E5Hh2WrABkcd0x+MygkB3HBWt0txjW16xArphYjLb80UfWwGmnI8Op0/x3PKs5uGfuIpY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: d68d85d69b02cc6e
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=gU6tXNAjWjVQQ99UgTTReR4eb9J2vOktrteMVexQylsAU2LQHRetgGzZEISxZtHBZ4+rKWrnCiRP6EIVu6tju0Ter4vo5qYwBRYhUG3NgmEPgVK1hX8zxutHLom4b1zacjZYTYr2w7/PfqTcnQj4+DjB8FRv3TLUYzG5ESBLEy/FjR799Df7iwTlGQXVifyECMCOskY+1XsuZBaeYplaIReT24lubb15gT45bCGr59yYLsGSNaC7oFCZVqo2vZRsztxCznFH3OR2b2jQREpSvwTSxjz3NZFV5O2E4sz7MZpr4Ud6I5Cehc6JQyB+MdUjMNqUvnHN8c/yYnDbkQ2+3Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4zny0u29PDwoKSUUaQ4Crr8XYTC3FaXx+RhNkv7KRZQ=;
 b=cJwWI7aZXczmwkyux0G0SI8+k8iTcijZMdoeKlDYxpjPCxuTRQJZEwZWbfqB9+yNrWGIrwbVNgdfQvJJAbiYwdTiTP+ZFTAVyeLqxhzkJhniAs6tr2Gw5a2I96GhRBE+mgMaFnA5AqxwAjlVYfECKywBISLLxCiOIxYtoFTv1dV/d3Kw66Xbrv5troMwpp7Fu+W94UffXnbYMuB4cKcPvQGNnTp0K/2RFU+bjdcWc22RM+t40a8+TsgxGu955rkGqpV+n+/tCiqxA8RGzyekiG0VnMfCbRAe4tkBMMWRpeo+2jdaRq8zR5lymYUEFqhagZS3WAXDlgrotNT/q6YX3A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4zny0u29PDwoKSUUaQ4Crr8XYTC3FaXx+RhNkv7KRZQ=;
 b=aJmvCn0m52wMQ7fCHmt0op3jDj/J8JefQcWQY7MIxh66WghWBneBRqFqy7DzsnGhaL5sCdcXDODAxncn7eBuDKaqg6iTa2oNnkDji1E5Hh2WrABkcd0x+MygkB3HBWt0txjW16xArphYjLb80UfWwGmnI8Op0/x3PKs5uGfuIpY=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, Michal Orzel
	<michal.orzel@amd.com>, "artem_mygaiev@epam.com" <artem_mygaiev@epam.com>,
	Julien Grall <julien@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2 3/3] docs: fusa: reqs: Added a requirements writing
 style guide
Thread-Topic: [PATCH v2 3/3] docs: fusa: reqs: Added a requirements writing
 style guide
Thread-Index: AQHa5MDknNNq96uHEUOMvzKrR1J1AbITudaA
Date: Fri, 2 Aug 2024 09:52:33 +0000
Message-ID: <A9ACD5AA-E2F4-4BCC-91BE-76450138FDA6@arm.com>
References: <20240802094614.1114227-1-ayan.kumar.halder@amd.com>
 <20240802094614.1114227-4-ayan.kumar.halder@amd.com>
In-Reply-To: <20240802094614.1114227-4-ayan.kumar.halder@amd.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3774.600.62)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	DB9PR08MB6588:EE_|AS8PR08MB5895:EE_|AMS0EPF0000019A:EE_|GVXPR08MB11036:EE_
X-MS-Office365-Filtering-Correlation-Id: 975bc3ba-b4c8-4b8a-cc8e-08dcb2d8da86
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|366016|1800799024|376014|38070700018;
X-Microsoft-Antispam-Message-Info-Original:
 =?us-ascii?Q?UJ/BIezo2ECAGrGWn2sh5tHF+NQgDk30ZRCaKTPBf/IjmrChdFXU/Fg+FiFr?=
 =?us-ascii?Q?HKvzKHFNavdACClLLjg5GyKfH7dH8feoMgEDysmPo5TDaWas8JZLNWvmrsUL?=
 =?us-ascii?Q?pOsQhnHLPFMPGBEhBI02fdiJBg3i1lPkiQJHvgCUD4z0VXYt+IKK6Yow8uBZ?=
 =?us-ascii?Q?DoYms8bhSeAnZUhLRsG13Slu4RteVkDVnnlVIecR2wy99F48ONk+z7MNCTNI?=
 =?us-ascii?Q?Ry4ufZHGmMXLKJV4TQCtzGkndxnj/q9j2OS83Lnd0NTYndqDhiDwRSw4YT4w?=
 =?us-ascii?Q?2MOmDrzisDup8jC+LmtB6dWdY44+63gYf5ZKXDpyr0Cmx4UJ53f3TLXsurRn?=
 =?us-ascii?Q?gakpDQKLFmAUyybyUBgZ9liRbgbLyUSvXqcnFzbE6ehuVUZBgYU4J/WqV9Rs?=
 =?us-ascii?Q?0wbTxWAsvjk0S8cy3h5xXb6rDISk6bgE9S/qhVZ9UnFSq2H8Y8ayOohEBoXf?=
 =?us-ascii?Q?GmFwkTDaX9IsknZDO6wRjd1dqpYaMoT7Qvw9MSIO6dKaflJtp70I87ZM1eOW?=
 =?us-ascii?Q?zqbM3uph1YLY2pCMlzEmUC1bIrJbQMp4DZIO/MmXEbxyD5X9x3FaaeTZ5ZHT?=
 =?us-ascii?Q?a+pEum0cbcWg97h1d/t5mPrqDK2lAKWmLo7ZGpTCBpDPSfGwAqc41bC6fcaJ?=
 =?us-ascii?Q?2eYZSibR1X42TeYRtw7nDezT4jE/1nO89o2sw3a+dZ5ChwfPWMs6JlghPPk/?=
 =?us-ascii?Q?t5Y9zqRmWSTjpeKzFb48lIJYgMC+HAcT44AKLUaw63VPqOWndvjWycd0RbBc?=
 =?us-ascii?Q?xfg1ztiSub1RABcoxOM+tiw00gciCY1CbKqhd8qGv/goFZ418WJL8cnc8T0Z?=
 =?us-ascii?Q?rH0v1SL+xQn3PRaiAt0elOghR5t9Y93GkLdBRQJmkKP31WrqIbV4h76sEuiq?=
 =?us-ascii?Q?qT2pFHzPF86Bjn0nIhP2gwUbi1LyxqdiC0p3sljgjXTZLZfERn43I2e8ywNR?=
 =?us-ascii?Q?5Pb8Asv6gWah+JtUcAZQy5KxdxFnIw2II4qkZII37dXzlrZzh/LJwKTJ1mhn?=
 =?us-ascii?Q?HVaHRAkbhb1yjo9+MDV4K68E9SgTu/xLwOB2S7U5c+V6PlsuCBCpFkKuHlgt?=
 =?us-ascii?Q?k3VEVntl4A1QvSR3vy92NLtYnZT5pW9/yvJSDOWeKI8d81GuD+8q+GP0ns1j?=
 =?us-ascii?Q?Tm890BZfPNyUh7I4cF7thURwxQDfF2F10Y4VptCHg6z00wil/0I4bvMCnuhK?=
 =?us-ascii?Q?Btl/jUlNVF9q+ZiuNRlu6jVirfXSZ/1LHhFa+xVM3DAowt8CRg3hpwZd8y4M?=
 =?us-ascii?Q?DuF2XjhMNFG9c+zIF77Moi8fSvwE27mBxYUQ7zu3e6RhxvKF+2SGKBNCald3?=
 =?us-ascii?Q?4EbzKC4CtKc/Ncv2gM8TEgUydxRecPb9S9AxePkJizw+UO9q9humYBVMG31P?=
 =?us-ascii?Q?D0W2Jx7cjcqLxowWSBFgOzi5Mjh1mWwc9bK6pa20iDkWaqRPIA=3D=3D?=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR08MB6588.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(38070700018);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <60717A3E1DBB7649AC0A6CFCBB85ED38@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB5895
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-SkipListedInternetSender:
 ip=[2603:10a6:10:25a::24];domain=DB9PR08MB6588.eurprd08.prod.outlook.com
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AMS0EPF0000019A.eurprd05.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	fa003658-43eb-4dc1-3be6-08dcb2d8d536
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|35042699022|1800799024|82310400026|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?mU6C6oR09H1TtRwsvDdMfgcWc/s3qh7Kkn4qyZp+VlNi7Y4WZVhvfJ8z0o//?=
 =?us-ascii?Q?MyhQ8XsW3jZuDjb8tcrNADpNAs7mKv1gkn2gHHXkZD/CHGmjKGJTMjRZIJKh?=
 =?us-ascii?Q?BsdQz/ed7CpUpYNdOG/8w4wnQz1Ahg0YiJI3n8aQu1VUgjpY9eBktz7cjMPA?=
 =?us-ascii?Q?6NszI6xjFWNIWPGZWV2vf/RTqfdS6V/QTLG58dEKko8L9qorSkRFjd9Z4Li7?=
 =?us-ascii?Q?PArRw0T2cDMvkR7ViDNOjyIwyps8BKjrLelMBLTrR9Gd69bj/wM0zo1Ccs3E?=
 =?us-ascii?Q?Kbx2a061BHnGtFKUjYOg9c2Q7jQMub8PzEhJvpa7MdTjOartmgxG7Cvw9q4h?=
 =?us-ascii?Q?tYt4KdCX4V3KBty+0mxqvF2E2ySPR553Es0/O2cr5xdi9QxYGRWD0fpxC23m?=
 =?us-ascii?Q?kv0AA52190N3DTGD/7Rtsld8PLMY87cW8tFJ7qBbO2t3MmN1PrFFYN0SGkcL?=
 =?us-ascii?Q?m7QZcNU/1JopwhIPSm0kGTGqhRIRtdDsAQVP9babJYuvlwu15F/a5qQR9o2y?=
 =?us-ascii?Q?oZVls9AA1wn4XaHZ12HbrZRE6sMxY2pop88bPg/PC5rTAyz52z2QK98FyjUb?=
 =?us-ascii?Q?tUSgh/5g3wT4kmHrtGwH5Tc7b5gf6o44q/Srx87LSK44GQMrq4w8wnSlFqPb?=
 =?us-ascii?Q?5pKtWtU2k05OEe/+iCZ32+kVIjjB2k7S3FMIKEfltsH1t3xOzGDsbA+sibsY?=
 =?us-ascii?Q?31ZQp+Su8ujT4D0TQVvMFrMsls5g7k+BM6dxlUngX093NcPQtyFNnoa2Ofxc?=
 =?us-ascii?Q?BWefay7ws3rm8EnLCWj1WRufPnAebAET/gHgJSJzdLCf6iDkXXsf0idVxo+S?=
 =?us-ascii?Q?TjX5D2FJKHK35imW8gCJOx+vIEPoAOGdDXaYqRjkXCPfK1nU8vy7MUTRYZo3?=
 =?us-ascii?Q?n5tqnvrcDQTGRgS91oVd1KCKX2CCb/qD9HPPuPz7/qfb5k80ts40+D3lDayD?=
 =?us-ascii?Q?cJe2sCF4IFcOjAEXajtzKe/Eg2DPkQTgce4FocvXxUrepAt965UTqjy4z2Mm?=
 =?us-ascii?Q?TkAUWJ3RqVATXTlZUHLoKQ4ivbyUtYhBhMCkg7rpVUvcvYiWEaHYjEHvoq1X?=
 =?us-ascii?Q?ZtuvT0yCYZpgpGqSAbOH2zD32yOD6D0pAUOLLz/Z0CMmhWVQXGL63UGQUmOD?=
 =?us-ascii?Q?gzsWQGTtIRJveZ4LqYr6Eq0bG6m47Y+fQQ2iHUlubM/fq7M31VHki+/g3qXF?=
 =?us-ascii?Q?RHUnv8EYgXbziBot5IS84RtIpa4VxF6ZNTnN3qjwa2K52gvMJZftioy6krFG?=
 =?us-ascii?Q?YETWP3HIJsCc74ItQA+02FdMCfDaSjZrgKZuB1qS8SLoRO52cT+PqH6numSg?=
 =?us-ascii?Q?EScx0ZbiXinnHCS6Bm0XJcY3tAI1hwCOXoqEMyIkjPzGQTyCeWY+pp3GrNFJ?=
 =?us-ascii?Q?Nh4P75GfrWzgIB4J9h6aAczSxgU2+Gt20QH1eVlISJ2i8Lr1uc5OQRZNpsl+?=
 =?us-ascii?Q?YrHzBtchSw+o38v4qtUPazhg0Hq63sOx?=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230040)(36860700013)(35042699022)(1800799024)(82310400026)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 09:52:42.8246
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 975bc3ba-b4c8-4b8a-cc8e-08dcb2d8da86
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AMS0EPF0000019A.eurprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB11036

Hi Ayan,

> On 2 Aug 2024, at 11:46, Ayan Kumar Halder <ayan.kumar.halder@amd.com> wr=
ote:
>=20
> Added a guide to help write and review requirements. The requirements
> are written to enable safety certification of Xen hypervisor.
>=20

Just a reminder if someone commits this serie:
PATCH 2 MUST NO BE COMMITED !!

Would have been a good idea to have it at the end of the serie and this one=
 before.

In any case:

> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> Changes from :-
>=20
> v1 - 1. No change.
>=20
> docs/fusa/reqs/REQUIREMENTS-STYLE | 34 +++++++++++++++++++++++++++++++
> 1 file changed, 34 insertions(+)
> create mode 100644 docs/fusa/reqs/REQUIREMENTS-STYLE
>=20
> diff --git a/docs/fusa/reqs/REQUIREMENTS-STYLE b/docs/fusa/reqs/REQUIREME=
NTS-STYLE
> new file mode 100644
> index 0000000000..cd2408b9f2
> --- /dev/null
> +++ b/docs/fusa/reqs/REQUIREMENTS-STYLE
> @@ -0,0 +1,34 @@
> +Requirements writing style for the Xen Hypervisor
> +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> +
> +The requirements writing style described below is the style used for wri=
ting the
> +requirements of the Xen hypervisor to enable functional safety certifica=
tion.
> +
> +The requirements writing style is inspired from the ANSI/IEEE guide to S=
oftware
> +Requirements Standard. Specifically, the requirements should satisfy the
> +following validation checklist.
> +(Source - https://www.nasa.gov/reference/appendix-c-how-to-write-a-good-=
requirement)
> +
> +Clarity -
> +The requirements should be clear, unambiguous, consise and simple. Each
> +requirement should express a single thought. Each requirement stated sho=
uld have
> +a single interpretation.
> +
> +Consistency -
> +Any requirement shouldn't contradict with any other requirement. The req=
uirements
> +should be categorized correctly (the categories have been explained in t=
he
> +README). The tone of each requirement should be definitive (ie "Xen shal=
l ..."
> +should be present in each requirement).
> +
> +Traceability -
> +Any market requirement should be linked to the product requirement/s and
> +vice versa. Any product requirement should be linked to the design requi=
rement/s
> +and vice versa. Full bi-directional traceability should be maintained be=
tween
> +market, product and design requirements.
> +
> +Correctness -
> +The requirements should be feasible and technically correct (at the time=
 of
> +writing). However, it is not expected that the requirements will be kept=
 upto
> +date with the code.
> +
> +The requirements follow the same license and line length as the code.
> --=20
> 2.25.1
>=20



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 09:59:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 09:59:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770904.1181496 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZp4g-0005vx-3O; Fri, 02 Aug 2024 09:59:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770904.1181496; Fri, 02 Aug 2024 09:59:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZp4g-0005vq-0f; Fri, 02 Aug 2024 09:59:50 +0000
Received: by outflank-mailman (input) for mailman id 770904;
 Fri, 02 Aug 2024 09:59:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZp4e-0005vg-NA; Fri, 02 Aug 2024 09:59:48 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZp4e-0002FC-ID; Fri, 02 Aug 2024 09:59:48 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZp4e-0003Au-7X; Fri, 02 Aug 2024 09:59:48 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZp4e-0008By-77; Fri, 02 Aug 2024 09:59:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=AH35vD+dUUth1qGcc2OIcB8RCxD7KrA2SGmufcn3amg=; b=kU9pRB8TsbeaB2QEDHHNqSE2RC
	SK/y5/wzmgWFETa5pnFprivFQTYfF9kZRi8deOrL6/8o76oQFVCKMxf3SiZSJacEctjCYBl793jo6
	Ri+V1nfMON2HH3I4sVHqtcQv9ckdSmvl6I8VLsaPn1qaCIOkCBVI8VHg/+LdYG8Ep+C8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187120-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187120: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=4f5de749cb2247a4ead21523f2d9deb389291636
X-Osstest-Versions-That:
    ovmf=87d3a6272ca8637787813256c1a2435e89e326e2
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 02 Aug 2024 09:59:48 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 4f5de749cb2247a4ead21523f2d9deb389291636
baseline version:
 ovmf                 87d3a6272ca8637787813256c1a2435e89e326e2

Last test of basis   187117  2024-08-02 05:43:32 Z    0 days
Testing same since   187120  2024-08-02 08:11:33 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Abdul Lateef Attar <AbdulLateef.Attar@amd.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   87d3a6272c..4f5de749cb  4f5de749cb2247a4ead21523f2d9deb389291636 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 10:23:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 10:23:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770921.1181506 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZpQp-0002og-TM; Fri, 02 Aug 2024 10:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770921.1181506; Fri, 02 Aug 2024 10:22:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZpQp-0002oZ-PN; Fri, 02 Aug 2024 10:22:43 +0000
Received: by outflank-mailman (input) for mailman id 770921;
 Fri, 02 Aug 2024 10:22: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=14L3=PB=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sZpQo-0002oT-D3
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 10:22:42 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 25f2f8e5-50b9-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 12:22:40 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-52efc60a6e6so12418878e87.1
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 03:22:41 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530bba11068sm191137e87.117.2024.08.02.03.22.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 03:22:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 25f2f8e5-50b9-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722594160; x=1723198960; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=yCgYY/I2udiFa4xahad1Th6VvBrGEt9FEZKr9uWxXLM=;
        b=dYjTtnxTsEZuxd2goaV/2BlJ6tPvM1dBIRkrIP+OwkRmu5LKdN/jWa7UTiuWNun8qK
         HW3USkjVhu9n5hzGLlL74DL5NiwJbPg6Zw8e1aU4GH9ch/fwiLYLO/fSGeM6wwOAy38h
         RTGa2ayGMHl0wVIRyPjauq+cD2sTPaWwWKxo/UZHipNWIQn8mHyprHMQg7j1Ns5Mscq2
         z0wwdaw/HuJpHq2TYHtNaqNw62qmOmfAHL5TueG9z4E3p91U/iwpgfOf4KRP7qJ4+tFq
         GZ0F/5a3HCkhpqpqBUOdHRlnDNEgz/0UhCghJKIvrg9yKRuH1FlRKgaCA9vK4IJxtO2+
         t/+A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722594160; x=1723198960;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=yCgYY/I2udiFa4xahad1Th6VvBrGEt9FEZKr9uWxXLM=;
        b=PHN9w1Aw1Xo9SnVTrqZ0W4NH9ZjwMrrOf0HuZJ6PnASUjKCV1cccsCUWMe9nqP8wDZ
         CiXGJy50Z5Smn8cPaW/52k0k2u1ZqQGw3XVYtDnA55C5rxml4JFy4Mmt836pIzxDawHl
         k1+ehitmd4f/EQr6MIil98ZqMRZzTE6xW3iilKBowowoM0LZElHGAKh2NTFxAJnODxXB
         yvpMXaXwMc68nhHwFBqPe7M05m/T9Hk7TpYrU0mbXRKTB6kYsG0tLqvUXgyBVHg/5W4g
         KgYm0slq2Ov68d/O/c/oqfKnyH6KP4uQx6nw5vsmSiDMhy6mQ54DTvpFc5sLfeY/9caZ
         6k2w==
X-Gm-Message-State: AOJu0YzS3FCsKJScZwQw3se0lCvvuY5oETvjbHmXmas2CYqRPLiaBaOt
	9NKH7/yg4xiNxTbHiZx8Tfj2nGdkQB8NnKOcrM+46X+FCv0bdgLGTQvL+g==
X-Google-Smtp-Source: AGHT+IFOUpNvc8PW8nPp/7eyiCfaW/4Au2IiKGzHI/kJ55VQqxs1eHKmwKxHsmRNxVAs+o2opFigkg==
X-Received: by 2002:a05:6512:2389:b0:52e:9ecd:3465 with SMTP id 2adb3069b0e04-530bb3b1891mr1990296e87.57.1722594160060;
        Fri, 02 Aug 2024 03:22:40 -0700 (PDT)
Message-ID: <a16ac4cd3fe0143e40f8b5ec993cd6049d41ea3d.camel@gmail.com>
Subject: Re: [PATCH v11 4/5] xen/riscv: enable GENERIC_BUG_FRAME
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org
Date: Fri, 02 Aug 2024 12:22:39 +0200
In-Reply-To: <83e20f26-ae59-4191-a12d-f31f779c91e2@suse.com>
References: <cover.1721731887.git.oleksii.kurochko@gmail.com>
	 <b79bcfb9031564fc8d275af66fa94c1e82e54de2.1721731887.git.oleksii.kurochko@gmail.com>
	 <7c03ed78-7c80-45bf-acf3-a916b7abb7d5@suse.com>
	 <6c379c6a0ac3e046c67647fa63d085a341906224.camel@gmail.com>
	 <83e20f26-ae59-4191-a12d-f31f779c91e2@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Fri, 2024-08-02 at 11:21 +0200, Jan Beulich wrote:
> On 02.08.2024 11:14, oleksii.kurochko@gmail.com=C2=A0wrote:
> > On Mon, 2024-07-29 at 15:00 +0200, Jan Beulich wrote:
> > > > To have working BUG(), WARN(), ASSERT,
> > > > run_in_exception_handler()
> > > > it is needed to enable GENERIC_BUG_FRAME.
> > > >=20
> > > > ebreak is used as BUG_insn so when macros from <xen/bug.h> are
> > > > used, an exception with BREAKPOINT cause will be generated.
> > > >=20
> > > > ebreak triggers a debug trap, which starts in debug mode and is
> > > > then filtered by every mode. A debugger will first handle the
> > > > debug trap and check if ebreak was set by it or not. If not,
> > > > CAUSE_BREAKPOINT will be generated for the mode where the
> > > > ebreak
> > > > instruction was executed.
> > >=20
> > > Here and in the similar code comment you talk about an external
> > > debugger, requiring debug mode, which is an optional feature. In
> > > my earlier comments what I was referring to was pure software
> > > debugging. I continue to fail to see how properly distinguishing
> > > ebreak uses for breakpoints from ebreak uses for e.g. BUG() and
> > > WARN() is going to be feasible.
> > GDB keeps track of what addresses it has breakpoints at.
>=20
> Of course it does. But in Xen how do you decide whether to trigger
> the debugger when you've hit an ebreak? (Just to repeat, my question
> is about the purely software debugging case; no hardware debugging
> extensions. In such a case, aiui, Xen gains control first and then
> decides whether to trigger the debugger, or whether to handle the
> exception internally. Sure, none of this infrastructure is in place
> right now, but imo it wants taking into consideration.)
Well, then something like KGDB is needed for Xen and mechanism to
notify guests to something similar to:

Right now Xen detects that 'ebreak' is inserted by using the function
do_bug_frame():
```
    case CAUSE_BREAKPOINT:
        if ( do_bug_frame(cpu_regs, pc) >=3D 0 )
        {
            if ( !(is_kernel_text(pc) || is_kernel_inittext(pc)) )
            {
                printk("Something wrong with PC: %#lx\n", pc);
                die();
            }

            cpu_regs->sepc +=3D GET_INSN_LENGTH(*(uint16_t *)pc);
        }
```

So if do_bug_frame() return < 0 then it should be ebreak inserted by
the debugger so need to notify GDB that he should handle that.
At the moment I think we can add():
```
        if ( do_bug_frame(cpu_regs, pc) >=3D 0 )
        {
		...

            cpu_regs->sepc +=3D GET_INSN_LENGTH(*(uint16_t *)pc);
        }
	else
	{
	    printk("this is not Xen's ebreak\n");
            die();
        }
```

Probably, to have the message is enough ( "this is not Xen's ebreak\n"
):
```
        if ( do_bug_frame(cpu_regs, pc) >=3D 0 )
        {
		...
        }
	else
	    printk("this is not Xen's ebreak\n");

        cpu_regs->sepc +=3D GET_INSN_LENGTH(*(uint16_t *)pc);
```

>=20
> > And if QEMU is being used, GDB isn't actually inserting ebreak
> > instructions because QEMU has an infinite amount of "hardware"
> > breakpoints.
> >=20
> > If it answers your original question I could add this to commit
> > message/code in the next patch version.
>=20
> I'm afraid it still doesn't.
So if we are speaking about the case QEMU + GDB then no ebreak
instruction will be inserted. So what happens is:
1. QEMU notices PC hits breakpoint ( "hardware" breakpoints are used +
GDB keeps track of what addresses it has breakpoints at )
2. QEMU tells GDB that the program received SIGTRAP
3. GDB does debugger tasks.

In case of real hardware it will be JTAG and OpenOCD to interface with
it and GDB will use OpenOCD for debugging purpose which follows RISC-V
debug spec and everything will work as I described in the commit
message/code.

Or it could be still without external h/w debugger ( using ebreak
instruction ) but then hypervisor should have an infrastrucutre to
notify GDB that a breakpoint is hited ( something like KGDB in Linux
kernel ) and for this case we will print the message mentioned above (
+ stop Xen if it is necessary )

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 10:24:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 10:24:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770930.1181516 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZpSZ-0003OD-AH; Fri, 02 Aug 2024 10:24:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770930.1181516; Fri, 02 Aug 2024 10:24:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZpSZ-0003O6-7J; Fri, 02 Aug 2024 10:24:31 +0000
Received: by outflank-mailman (input) for mailman id 770930;
 Fri, 02 Aug 2024 10:24:30 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZpSY-0003Ns-3j; Fri, 02 Aug 2024 10:24:30 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZpSX-0002qL-NB; Fri, 02 Aug 2024 10:24:29 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZpSX-00043R-Bb; Fri, 02 Aug 2024 10:24:29 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZpSX-00063q-BB; Fri, 02 Aug 2024 10:24:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=w+K3jkwVo1UtKS6cG5UW4KEAdmJ/DNzfLRjunMxy3is=; b=UGxGOX8mdb+v4Hfj3SGLJvrTF8
	EcA8w+q3ojdhdJBdsQzkhHekrOvfwfB8K+YMAcxdLnr49zPTVbdC0owqU9tHU3aGE6rr/H4a5fWFD
	b/H2a9NVx5OkCvDVk60YoNUlL9tmuF0t6BFa2AEEzswZ9KzcqYcXNO2ToA/E2hENYEO4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187118-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187118: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=984cb316cb27b53704c607e640a7dd2763b898ab
X-Osstest-Versions-That:
    xen=1c4fb9bb49b7babbcaa0b62384841ba4acb49356
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 02 Aug 2024 10:24:29 +0000

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

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  984cb316cb27b53704c607e640a7dd2763b898ab
baseline version:
 xen                  1c4fb9bb49b7babbcaa0b62384841ba4acb49356

Last test of basis   187106  2024-08-01 12:00:23 Z    0 days
Testing same since   187118  2024-08-02 07:00:24 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  George Dunlap <george.dunlap@cloud.com>
  Jan Beulich <jbeulich@suse.com>
  Matthew Barnes <matthew.barnes@cloud.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Roger Pau Monné <roger.pau@citrix.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   1c4fb9bb49..984cb316cb  984cb316cb27b53704c607e640a7dd2763b898ab -> smoke


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 10:30:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 10:30:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770943.1181525 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZpYF-0005eY-US; Fri, 02 Aug 2024 10:30:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770943.1181525; Fri, 02 Aug 2024 10:30:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZpYF-0005eR-Rh; Fri, 02 Aug 2024 10:30:23 +0000
Received: by outflank-mailman (input) for mailman id 770943;
 Fri, 02 Aug 2024 10:30:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZpYF-0005eL-0q
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 10:30:23 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3869ed2a-50ba-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 12:30:21 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a7a9a369055so876594266b.3
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 03:30:21 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9d4dd45sm82391366b.104.2024.08.02.03.30.20
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 02 Aug 2024 03:30:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3869ed2a-50ba-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722594621; x=1723199421; 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=F22XMe4vty8J1P+rIV7UcvVeYo+tLPb7wD4NewjtCto=;
        b=cvjjeVrtB4NJuf0cVOIChLj2gLoxlaoW1Oq9O2dY5592nBlp678dYu3FJgqq7dcNaA
         GvK2GmrezfSANnqF0XgjdOxUuJ03GGj1REFVlHUAcvXuz/L0Ufi0DstSFQwbbWXkT4Ll
         4J/2ir8/v4pupakQ5CDtDX9XhSiMUF+m+rYh+4ejigEz58cSGJ4kgd1s9mxX6ILXkJqS
         QGpRUI/es3AYenTc0fXspjTJOAlEo8vOfmD2hqnyf5d7E+UJDGU8P/+XDYbKpB0hd3ji
         Uz7vfdWAMSrAnjtLRksH39vyjwVfDFAnVGlMJUpYzJyGzZCOGCpuMSkY11zc2ifTc5fZ
         blvw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722594621; x=1723199421;
        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=F22XMe4vty8J1P+rIV7UcvVeYo+tLPb7wD4NewjtCto=;
        b=Cx0s4LMu/vcCvhTbtGZKCtFKjycnq0stCo20qEAu5haP163tGmEbFMytkAF3TnRRGY
         sPeIL7lMMSJpkqxBIeVaw5utHy54ItdqYnu14lc3oRSHK3Q+rtFbWv9WYvIDRhsBmYJc
         OKVIqEbTIVt5oXIxcyu1wUb8J3pHm6Xs5ZmCiWdJDSdDAKTIBzoJtQSRaOc7a0m+Bnqb
         nAT48gMlF8QsKOFSdvRTs1wVVkaydv6OHkSr2uArcq+aGfAxWdG+lZcJnYBiCnquFKu9
         3RQoY/ZLQPDXg8gkApTowny0jrEBctGDKzEf1B5PZbIjslB2su6aXnYwmln0p105zXFv
         BKPA==
X-Gm-Message-State: AOJu0Yxq9kZh+HkS+Jj1dzWFHbXpqCdADEhyvXPwheQTEE3C5T+8rYVn
	M7aZtAJRBxgeoeNFy44p3dsDWwohNoGA27GN7XCtlqJ9oJimRbbmO7jyX+cM/w==
X-Google-Smtp-Source: AGHT+IGqaaXcyfeWsiDk9FWXE2tjerza4uMCaAmuGD0hGWRFJKx49bmLKlGcDmLvSqq3zb2TvoXprw==
X-Received: by 2002:a17:907:3da4:b0:a7a:a3f7:38a2 with SMTP id a640c23a62f3a-a7dc4fefd18mr282784266b.41.1722594620590;
        Fri, 02 Aug 2024 03:30:20 -0700 (PDT)
Message-ID: <1d3ef706-fa3d-4dee-818c-83904012ca35@suse.com>
Date: Fri, 2 Aug 2024 12:30:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v11 4/5] xen/riscv: enable GENERIC_BUG_FRAME
To: oleksii.kurochko@gmail.com
Cc: xen-devel@lists.xenproject.org
References: <cover.1721731887.git.oleksii.kurochko@gmail.com>
 <b79bcfb9031564fc8d275af66fa94c1e82e54de2.1721731887.git.oleksii.kurochko@gmail.com>
 <7c03ed78-7c80-45bf-acf3-a916b7abb7d5@suse.com>
 <6c379c6a0ac3e046c67647fa63d085a341906224.camel@gmail.com>
 <83e20f26-ae59-4191-a12d-f31f779c91e2@suse.com>
 <a16ac4cd3fe0143e40f8b5ec993cd6049d41ea3d.camel@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: <a16ac4cd3fe0143e40f8b5ec993cd6049d41ea3d.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 02.08.2024 12:22, oleksii.kurochko@gmail.com wrote:
> On Fri, 2024-08-02 at 11:21 +0200, Jan Beulich wrote:
>> On 02.08.2024 11:14, oleksii.kurochko@gmail.com wrote:
>>> On Mon, 2024-07-29 at 15:00 +0200, Jan Beulich wrote:
>>>>> To have working BUG(), WARN(), ASSERT,
>>>>> run_in_exception_handler()
>>>>> it is needed to enable GENERIC_BUG_FRAME.
>>>>>
>>>>> ebreak is used as BUG_insn so when macros from <xen/bug.h> are
>>>>> used, an exception with BREAKPOINT cause will be generated.
>>>>>
>>>>> ebreak triggers a debug trap, which starts in debug mode and is
>>>>> then filtered by every mode. A debugger will first handle the
>>>>> debug trap and check if ebreak was set by it or not. If not,
>>>>> CAUSE_BREAKPOINT will be generated for the mode where the
>>>>> ebreak
>>>>> instruction was executed.
>>>>
>>>> Here and in the similar code comment you talk about an external
>>>> debugger, requiring debug mode, which is an optional feature. In
>>>> my earlier comments what I was referring to was pure software
>>>> debugging. I continue to fail to see how properly distinguishing
>>>> ebreak uses for breakpoints from ebreak uses for e.g. BUG() and
>>>> WARN() is going to be feasible.
>>> GDB keeps track of what addresses it has breakpoints at.
>>
>> Of course it does. But in Xen how do you decide whether to trigger
>> the debugger when you've hit an ebreak? (Just to repeat, my question
>> is about the purely software debugging case; no hardware debugging
>> extensions. In such a case, aiui, Xen gains control first and then
>> decides whether to trigger the debugger, or whether to handle the
>> exception internally. Sure, none of this infrastructure is in place
>> right now, but imo it wants taking into consideration.)
> Well, then something like KGDB is needed for Xen and mechanism to
> notify guests to something similar to:
> 
> Right now Xen detects that 'ebreak' is inserted by using the function
> do_bug_frame():
> ```
>     case CAUSE_BREAKPOINT:
>         if ( do_bug_frame(cpu_regs, pc) >= 0 )
>         {
>             if ( !(is_kernel_text(pc) || is_kernel_inittext(pc)) )
>             {
>                 printk("Something wrong with PC: %#lx\n", pc);
>                 die();
>             }
> 
>             cpu_regs->sepc += GET_INSN_LENGTH(*(uint16_t *)pc);
>         }
> ```
> 
> So if do_bug_frame() return < 0 then it should be ebreak inserted by
> the debugger so need to notify GDB that he should handle that.
> At the moment I think we can add():
> ```
>         if ( do_bug_frame(cpu_regs, pc) >= 0 )
>         {
> 		...
> 
>             cpu_regs->sepc += GET_INSN_LENGTH(*(uint16_t *)pc);
>         }
> 	else
> 	{
> 	    printk("this is not Xen's ebreak\n");
>             die();
>         }
> ```

Except that, as previously said, this will break if the debugger inserted
a breakpoint where Xen already has an ebreak. That's where we started from
in this discussion. Recall that my question was how the use of ebreak can
be correct / reliable here. It is for a reason that on x86 we do not use
the shorter INT3 instruction, but the longer UD2 one for BUG() etc.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 10:53:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 10:53:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770959.1181535 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZpuU-0001GJ-MD; Fri, 02 Aug 2024 10:53:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770959.1181535; Fri, 02 Aug 2024 10:53:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZpuU-0001GC-Jd; Fri, 02 Aug 2024 10:53:22 +0000
Received: by outflank-mailman (input) for mailman id 770959;
 Fri, 02 Aug 2024 10:53:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=SQaU=PB=epam.com=prvs=4944f0ddb9=sergiy_kibrik@srs-se1.protection.inumbo.net>)
 id 1sZpuT-0001G6-DB
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 10:53:21 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6db0ffb7-50bd-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 12:53:20 +0200 (CEST)
Received: from pps.filterd (m0174681.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4728unHP019684;
 Fri, 2 Aug 2024 10:53:09 GMT
Received: from as8pr04cu009.outbound.protection.outlook.com
 (mail-westeuropeazlp17011029.outbound.protection.outlook.com [40.93.65.29])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 40rjd029jk-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Fri, 02 Aug 2024 10:53:09 +0000 (GMT)
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com (2603:10a6:20b:5c0::11)
 by AS2PR03MB9395.eurprd03.prod.outlook.com (2603:10a6:20b:59d::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Fri, 2 Aug
 2024 10:53:06 +0000
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d]) by AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d%4]) with mapi id 15.20.7828.023; Fri, 2 Aug 2024
 10:53:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6db0ffb7-50bd-11ef-bc03-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=OKA5tuXM5msTfUzmW+U5eciEvxgbsMJhSN4oEeeE2AopHKsqAT+RNLk4XrvYczBuLd3NFzn6347TxYyZkAr5fCFlhzMqzYyJac+I+0gFs8ipJk6HToYSDmJq/DviMpE3AJiHwrQXqMAhRpZuBu1gXaz9B9lbeBg4lngiCUzg6aaxtMSgfZVVYh3kiaiGrlE65PuIi1C/QXeyCbikiQky4uTBsML9gqjKhg0JZkm02DV4jPDhQyct4kQMQWSS4+cdfhRAwbZVr5htLCj1CFxwUw1l4fG+QYIDQOTOE33u44koJpRSUiJ8H37YqCswBx7JxOX5Vzfi3lRLous8REAL0g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=twp8q0lDoPWw47l5n3lTxsMj9kwYVZfhW/a8qtrss38=;
 b=QsyNOd7+4Kee4wK8fAY1cvu53XPuY8gtIsMhup0ZGqQsaJXyBctS3X6jPBE9zaS3y2hptqU7Ai6g/+0h/4T6ucq3WIEEea6qDotdHDTg0nck87vszB8c0lzr/AHLC9BSVPDTTpaWeKUfRRMaMVZXfDi1uGkqSMwv8FtzNQRB3LIe9QOBhAS45XBGsQ4kJ13t/uF/kLWi+YqOsTQ9nIHV5j2IoOSl1Pw2LH+1OBniRxLkbB0KsbxFndXrIG/QJqo6MYvNscFH+nVSAgoXwPSA7ZLWI8mB4Ky2zwrPw4baU0yclK0GAuIsr0XBZk0iUk7L6VUqPGDOUzxkiACzUdB0kg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=twp8q0lDoPWw47l5n3lTxsMj9kwYVZfhW/a8qtrss38=;
 b=hV+uyO5ttj1OyYEdkAwCfTJcGNWjnWkeSaeFxpgQsUHDvTmKkJMwcQ02oANa03U6WdRjkJUV5AA6Qgzb9GoItzL4aYgcfkxB3VHJvw184tFtfe2Tr8UxAIGMk4qFMM21p0BZaFJGOfoPh3WCIKbtiJZjB+th2BPVzlicCfTB884X2k0/2Wi308lw0gQE23+I1klhxl+RosLq0J4ge6E63mWlYlQC1VciRs/8MZUlx9Xk1c3s8DksvIII+CFzAy+o2rhzJL6IaCUc9tU3/sSSkZ1kUI3HVreCfsrtqQObemwvFKjR0YlZYszEugJhv5y9hPI101k6hxUMSqyQsDwZ1A==
Message-ID: <ccd77283-4b88-4351-a3f9-bd4240b9b845@epam.com>
Date: Fri, 2 Aug 2024 13:53:04 +0300
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v5 09/13] x86/vmx: guard access to cpu_has_vmx_* in
 common code
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
        Paul Durrant <paul@xen.org>, Andrew Cooper <andrew.cooper3@citrix.com>,
        xen-devel@lists.xenproject.org
References: <cover.1722333634.git.Sergiy_Kibrik@epam.com>
 <c2961c8b67041883ce5a5f6d0511a31dc7fbe22d.1722333634.git.Sergiy_Kibrik@epam.com>
 <cc92ed50-89f7-48c9-b0e1-cd61a020001c@suse.com>
Content-Language: en-US
From: Sergiy Kibrik <sergiy_kibrik@epam.com>
In-Reply-To: <cc92ed50-89f7-48c9-b0e1-cd61a020001c@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: BE1P281CA0218.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:b10:88::8) To AS8PR03MB9192.eurprd03.prod.outlook.com
 (2603:10a6:20b:5c0::11)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9192:EE_|AS2PR03MB9395:EE_
X-MS-Office365-Filtering-Correlation-Id: 541dbef5-8c74-4c34-215e-08dcb2e14a22
X-LD-Processed: b41b72d0-4e9f-4c26-8a69-f949f367c91d,ExtAddr
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?SnBvZFhCY3FPRmNYUzBXZVNpMmEzQ0FHbGFXcmdaeDNaeGdpVVJvNGJFZVNG?=
 =?utf-8?B?SkwvQTl1eUdXMTFuVVJZVUYvY0dRWVh1K3FTR010dndkczQwaDgzNUVLVVVZ?=
 =?utf-8?B?b2JzRnhPVk5yb3ZKakJJYkhSTkpoSlZ3bFNYMENnWU1UWGVyVkNGUytoM3N2?=
 =?utf-8?B?eCtqeW00RFR3WUNKTDdaTmxHbUpMQVNaMU5nK2Rqekp2WGhDWTdqdGIxU3pq?=
 =?utf-8?B?ZUJSRFNRNWp5TnNKejF1REdOalBFNGtSWlBUS0UrYko4M1BXWHgwcEpKQmFp?=
 =?utf-8?B?VlZLRWJrQVhVNGZmdGVlUGY2ZzY3UWp0dmFLK29QNXRMSEdtSDlmQ29Hd1RJ?=
 =?utf-8?B?R1J2QUhZWTl5d0tNVW9tRncwRXNpRjdmRktVSGUvYVd3Nk5IYTdRMFlHMnZ3?=
 =?utf-8?B?djZ2TVU4aHF6UnZoNXJuUjN1MnBqRmJNaXp4ank1NWZ5S2FtMXdpeHhkcjhS?=
 =?utf-8?B?a2tUWjM3UjZpR1gzVlh4MTJUbHh2S2ExdzhPZENrdTZPU29FNVVsS1oyWWtw?=
 =?utf-8?B?VkoyQ0FUVHVKWCtKNHUwM0dnSFJNQ1FTMi9qTjdrbllxRnZwYmEzaWpwdmJr?=
 =?utf-8?B?Wk52WVBBell5SUVFU3hRa1dxZEg0d20vbXhTdzZUN3g4bnhUQU1jVTVrL21j?=
 =?utf-8?B?Rkc5VEhrekxKc01Jb3pEVTJjdDFnaVZ0QUtDRkxpQWR5SXh3eXF4M1pzWS9T?=
 =?utf-8?B?ZjZyeVc5cVE3bG9YaXdQc215MUI1N2NaaVcrVkNUQjBpSkdUa1RjNFI1aEdO?=
 =?utf-8?B?dTMvR2xDOExPaDhoNmNROGZJd0dieXlxeHhDdkJEUHlQSXB1WWh2QnJHdytt?=
 =?utf-8?B?SS9BaTFVV0Q1ZlFYLzVFNUJ2eFA4c3VvL01JMkN1RHdvRElSNlRkTDZ0aFo0?=
 =?utf-8?B?WWlkMVVCY3psMzN5bDRQQUNPR3l6SFF3T0FDTk1pMk5xaFhzVmswb0o0STZT?=
 =?utf-8?B?WDFObTJtR0orQnh2czV2NGdmSXA5OUtrRlFwNkN3K3FtY2VFaWlTSG9GNW5Y?=
 =?utf-8?B?Qi9STklIV2ZPdndqT0YzRnp4akdYTnB3VlpwajJVZVBWaEVEY0xnQXgvbmNz?=
 =?utf-8?B?Q2VmczhZaFRzYy9BV1FDL3U4MEZUUjhYOEhzU0k1SkZFeXpNQkkrU0Z0T0Y0?=
 =?utf-8?B?Z2JvYmJnajE1blB1dFRWbzQvNm9XeXllREJSNHR1MGFPdmc1dFhNTjJKVG5r?=
 =?utf-8?B?TzlqWXFMRXVjUVhZNmRma1QzdksyMWNEQ1lpUUZCRjlLUlJDTHhQd2Q1SVpu?=
 =?utf-8?B?RDJaY2tEYTB3VFV5ckc1MlZLUVh2NlBoSXFFUHhHZzlZRXJLT1Rwc2ZIQjR3?=
 =?utf-8?B?dVFzQlluSXVuRmRQa293ZmlWRFdQaHpJdUFkaTcwcDVOdTZFQUJ5QUZzaXhE?=
 =?utf-8?B?eE5ab1dLZm93N1krdnBNd3ZMdFN6RW5KT1hmVHAyT0Z5YTVqNmN2a0M1VmFE?=
 =?utf-8?B?YlVLWUFGZVhSVWQ4aGI1S1JLdlFQRnJtMWJ2REpwT0JPTUJiWm5rSDBEYXFS?=
 =?utf-8?B?VVE2andjZlNDYXVwWnF2U0lRZ1VuWitaQlhlSkFPN2l4a1N6M21jcUZHWllP?=
 =?utf-8?B?eTFqVWtXMWUzZU5OSzFSR1hRdnpjYkVEa28wR0xndUpIZE1CSWh5RzcxRUM3?=
 =?utf-8?B?QWVUUzA5OUJVYmhoNHVMYXlOVXF5T1ltUDZzLyt6bHBvcGg4SGJCQmhWMitH?=
 =?utf-8?B?ZkdBRXBuU0JKaGk2Mi9sb1ExZ0p4OUVFaVBOcTVRYzN6aW10MHFza3o0dll0?=
 =?utf-8?B?NlBrZUlzWkc0S1hVcmhmL1hJNE1ZZmtOQkVTRHdod3F1K1RsRkdIblBBRDBF?=
 =?utf-8?B?THQwMEw1OEFnMDdrZWd6UT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9192.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Q1JScHVxSGIxbDJaZ2NqbUlXZHQ3S2FOUlc3ckdwdDVETWZkajhOVzFQeGJx?=
 =?utf-8?B?ZnpERFNEYmNWbVhFMkdSaXB2WS9DN0hZWnI0MUV3STFmdmxlK0wxZVFlOFQ0?=
 =?utf-8?B?YnAvenR1SEN6eWd1TlE4YUpURHlmQnFjVE5BRzFCSDcwYVIzK2UyYnZKOTRx?=
 =?utf-8?B?NllBN0tKeVpHNVk1cEgyYitqK0RRZERVWXBTRW1xWVF0Y0tsN2M4aUt1VGVp?=
 =?utf-8?B?NHl5dS83WjM3dlppQkM0VDdoUllmQTBQaWJqdUd5NG95Z0ZnSmc1WXU3TTR0?=
 =?utf-8?B?L3dhVEp0NXFWeThuU2xzcHQ4RUwySHo3NGJicjVnVURaUE54K0RGcEZNS0gx?=
 =?utf-8?B?emErbkRjSjU1Vmw3eTZJNDM4SEZSMThZcTJvOGhDeENQRzRyZ3l6Y2dzRmo1?=
 =?utf-8?B?ZzZ5a2RtaEFMUHZkL2NvR2s1UHBzZ1haZkpzdCtNVnByanJOdG5xbDF6TVdX?=
 =?utf-8?B?R2JjQ3JrQ3ZNU0ZRY0R3bktocjV2SjBaaDhhL0ptSFk2aXg0K0FXRG4ydEVO?=
 =?utf-8?B?TEtacHdXMUlTbVhvSTNMeVpQTkdaM0tsbkpUbVdOVFR6dXRPK05vMEFDVTR1?=
 =?utf-8?B?MkJBT3VRTHk1NW5oZzhSbU5QT0ZoSWJqdFpPN2tYemViRFBZTDFkVXdHODlB?=
 =?utf-8?B?Sm02Vmx5Sis1ZUF6K3ZPOUw3TGZEdWZjSHpZcmxjV3l2RkFCdmZrTVNMVjdQ?=
 =?utf-8?B?RjgxbE1wZ3lBREY5WXd3d0NFZDYrb2dDU1B6aitIZlROTmwySHFLUUN0dFFK?=
 =?utf-8?B?RUh0UTd1d2JCYkRsbWdhMG80V3FvSC9OU3JnVjIxcEw5dktGSThDalpESVNH?=
 =?utf-8?B?dVBLSmswdnZJeitDcStZclhzWGhLWkhMY3hyOWlrSWVPYUpsQ3YwaUJWaG0z?=
 =?utf-8?B?bWhFQ1diQ05WWjZsR0MyVFYzZFJtVEgxV3gycklnSUY1Wk4rK1RLcDN3YUc0?=
 =?utf-8?B?dThqYTdkalUvR3ZoVHpybFdDc2lWNTQxZTg5bGMwc0NYY3B1MDNoOE1JUFht?=
 =?utf-8?B?QTloUjI3UHhBUllSdHdRb0Y1VVJKN01UMytYeVpSTUE1Rk9TRi81M2tScTc3?=
 =?utf-8?B?UnVQdUowQWRHa2NLVWNkeFBDb1FCaGV3a1FuL2dsMWNQcFNpYUNvdGc5NE1o?=
 =?utf-8?B?YWFGQ3pWYnJmMk50SGc5ZWhrMHBGSTVsczFEMUFtNHFrU2JLblNWRmlCdHRX?=
 =?utf-8?B?L05heTNLMHJIK2hiOGpIcWI1cG54V1R4eFJWV2pYREljb0syTUhHRmQ2bmox?=
 =?utf-8?B?OHpWUGJZRWVscVF3K3BFSVd0Y0xPREx6L1VpeVUxU0kwYkdBV0JRNGpMMDgz?=
 =?utf-8?B?K05SMmdqbWdDdGZHbGNaTnVxL3hXeWZGTFdyallrUmFKdDZqZVdYUlA0L1Nw?=
 =?utf-8?B?NEdtZUFJSUZzejlkNjBGdW9BZ09yVXNIVHBiL1lFMWp3MDBsc3ViU2UwYk1B?=
 =?utf-8?B?S1hBZ21paWNTenFGdTlnY00rMDR1dkpyRXpLR3BSejVKZFUwWGt2ZTZUU09u?=
 =?utf-8?B?ZWE3UU4vcFBuUk50Q3JWL202RUNhZ08zUUJrUkgyaklTekJOTU1QbjMxS0VJ?=
 =?utf-8?B?YUN5bVRyOUpPWXlIZHJJcW5TZWx1TElrL3EvYVFnNWtDVFZMMFF3aW1UYmdQ?=
 =?utf-8?B?NmFJZVpnb3ZYUXZEYjVQeVV4OC8yVlhZZlNON0FpQy9JV0h4Y05WRmYwMTND?=
 =?utf-8?B?UDZBRlIyRVJlWnRWdkxENTMrMk54TnoxcmxCYmhQQjVEZVBJTGNWU2NPOER6?=
 =?utf-8?B?RFNZNGY2L3FXWWF2TlNMOHRtc1VpOElGVmdacnFPczBWUXNWZi9jenhKdDds?=
 =?utf-8?B?dFYwcDNMRGJRbXNzNXZEcHVzMktFbXVid3J6K0Y2U0h4VE9adWJhOFVoUGpX?=
 =?utf-8?B?a2ZMT3FjK25OamF2QlhWUGNicTY1eldZWDdPS2FLUUhBandKNmRVZlpjbWRV?=
 =?utf-8?B?TGozUlgvT2pEcFpzRStzdi9XTGtSY0pLdkdPREpVSTlVQjA2WlN6Ni9BQ3RW?=
 =?utf-8?B?TjZOdDlvdmFGdlUwL1ZYeWdMT0ZLWlJSeEZmYnR5S0c2SkRsY2M1MlZvaTBG?=
 =?utf-8?B?M0JKZ04xTUdWek01eVduVFJaWjd0U25mNnNCczlNT1ptOGlZVXF0TXNZKy9t?=
 =?utf-8?Q?peImQ5QdepK6S3ER0bT54JaFB?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 541dbef5-8c74-4c34-215e-08dcb2e14a22
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9192.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 10:53:06.2071
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: UU2HUSee2hl/Ztf2btGpsHn+n6LJOcC4G+hVwhFf/3jJKeQ/e+epGnVB87I+jQtLuI9VsDsttSE63MwJPGtiOQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR03MB9395
X-Proofpoint-GUID: Ll_cGk91SQTtfhOWQcF4L_AVO1TY_1rV
X-Proofpoint-ORIG-GUID: Ll_cGk91SQTtfhOWQcF4L_AVO1TY_1rV
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16
 definitions=2024-08-02_07,2024-08-01_01,2024-05-17_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501
 lowpriorityscore=0 suspectscore=0 impostorscore=0 phishscore=0
 malwarescore=0 mlxlogscore=999 clxscore=1015 adultscore=0 mlxscore=0
 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.19.0-2407110000 definitions=main-2408020073

31.07.24 15:23, Jan Beulich:
> On 30.07.2024 12:33, Sergiy Kibrik wrote:
>> There're several places in common code, outside of arch/x86/hvm/vmx,
>> where cpu_has_vmx_* get accessed without checking whether VMX supported first.
>> These macros rely on global variables defined in vmx code, so when VMX support
>> is disabled accesses to these variables turn into build failures.
>>
>> To overcome these failures, build-time check is done before accessing global
>> variables, so that DCE would remove these variables.
>>
>> Signed-off-by: Sergiy Kibrik<Sergiy_Kibrik@epam.com>
>> Acked-by: Paul Durrant<paul@xen.org>
>> CC: Andrew Cooper<andrew.cooper3@citrix.com>
>> CC: Jan Beulich<jbeulich@suse.com>
>> ---
>> changes in v5:
>>   - change kconfig option name VMX -> INTEL_VMX
>>   - do not change .c files, only modify macros in vmcs.h
> Better, yet still not going far enough, as indicated earlier:

I must've misunderstood your earlier suggestion. Are we talking about 
modifying all of cpu_has_vmx_* macros -- even though most of them used 
internally to VMX code and don't cause any trouble in common code?

   -Sergiy


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 10:56:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 10:56:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770968.1181545 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZpxT-000272-3q; Fri, 02 Aug 2024 10:56:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770968.1181545; Fri, 02 Aug 2024 10:56:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZpxT-00026v-17; Fri, 02 Aug 2024 10:56:27 +0000
Received: by outflank-mailman (input) for mailman id 770968;
 Fri, 02 Aug 2024 10:56:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AAnW=PB=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZpxR-00023m-MX
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 10:56:25 +0000
Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com
 [2607:f8b0:4864:20::834])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dc06f410-50bd-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 12:56:24 +0200 (CEST)
Received: by mail-qt1-x834.google.com with SMTP id
 d75a77b69052e-44ff6f3c427so38023161cf.1
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 03:56:24 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6bb9c7977cbsm5886376d6.43.2024.08.02.03.56.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 03:56:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dc06f410-50bd-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722596183; x=1723200983; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=VJejKKDmLBL4QGQ2wyHF/zzRoWY9S5VJQkv71rHdd/c=;
        b=jja2gxz5P6enJvxxSBtZq/73pLSUdWFpewPqdf78wQbGIdeI3uCsyPiZkwtodmq2e4
         80voygdCR2xZ7DmSnuj23LPpHby7VMGZCDPEVsZXeoHYYfUspN1S/TKnk8IaB4VAlZWd
         rl3PMpqQo4hoaYJaQfr4pTL0papvf4egwnljI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722596183; x=1723200983;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=VJejKKDmLBL4QGQ2wyHF/zzRoWY9S5VJQkv71rHdd/c=;
        b=UAKQ3JfuTzSfYDcouvfdKHV0k0GV2ZDCVFhUw/XWSFyGkCoUJ+MdwoM+5Xm/bJBJmk
         B3CjY7FsYhwjurPxg95MmFNEfQMeVRxQYBveJ9Njbl6olVQwa5clJz7HKyZdJF4J2h2X
         lOWxm1ScpQs0TccTInTGfeAl4H7wayTGZLC/GT09kEc5QV34dRI/yG3paBPCcO7Jr/XB
         5zyFNLOW1a0rbHajDUsbhl/T36X2vrVqI2euc7buz9dMO8XT0+wiEe/g82WLHykXthiC
         R6wmpfv4tsXFUHG8zeKrUj6YaAFy1pprKahSgx/HjbYufHbOFdf6CsTZSQZJ5+ITfS9k
         0Jpw==
X-Gm-Message-State: AOJu0Yw/b0haApJ3ad83btfV95ufo/Xjjxz6b8UQhB9V96vc4zp0YBOs
	9HM+W8cgPBZ8EdY0mEc58GDusGupDKuOcf98uIWLtzrz6hW/EBkSe6GrPQyZdjJStTY/I4FGAgu
	+
X-Google-Smtp-Source: AGHT+IGrm6c1AIDBFSqUoa63EhtpNVe/ftxmWHGfK/r2xxp8JHWwhzn+6deEyuq+GUxzaNO3PFMWlw==
X-Received: by 2002:a05:6214:3d9c:b0:6b5:db9e:2c73 with SMTP id 6a1803df08f44-6bb98379c0amr42929416d6.10.1722596183117;
        Fri, 02 Aug 2024 03:56:23 -0700 (PDT)
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Community Manager <community.manager@xenproject.org>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH v4] x86/shutdown: change default reboot method preference
Date: Fri,  2 Aug 2024 12:56:13 +0200
Message-ID: <20240802105613.99197-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The current logic to chose the preferred reboot method is based on the mode Xen
has been booted into, so if the box is booted from UEFI, the preferred reboot
method will be to use the ResetSystem() run time service call.

However, that method seems to be widely untested, and quite often leads to a
result similar to:

Hardware Dom0 shutdown: rebooting machine
----[ Xen-4.18-unstable  x86_64  debug=y  Tainted:   C    ]----
CPU:    0
RIP:    e008:[<0000000000000017>] 0000000000000017
RFLAGS: 0000000000010202   CONTEXT: hypervisor
[...]
Xen call trace:
   [<0000000000000017>] R 0000000000000017
   [<ffff83207eff7b50>] S ffff83207eff7b50
   [<ffff82d0403525aa>] F machine_restart+0x1da/0x261
   [<ffff82d04035263c>] F apic_wait_icr_idle+0/0x37
   [<ffff82d040233689>] F smp_call_function_interrupt+0xc7/0xcb
   [<ffff82d040352f05>] F call_function_interrupt+0x20/0x34
   [<ffff82d04033b0d5>] F do_IRQ+0x150/0x6f3
   [<ffff82d0402018c2>] F common_interrupt+0x132/0x140
   [<ffff82d040283d33>] F arch/x86/acpi/cpu_idle.c#acpi_idle_do_entry+0x113/0x129
   [<ffff82d04028436c>] F arch/x86/acpi/cpu_idle.c#acpi_processor_idle+0x3eb/0x5f7
   [<ffff82d04032a549>] F arch/x86/domain.c#idle_loop+0xec/0xee

****************************************
Panic on CPU 0:
FATAL TRAP: vector = 6 (invalid opcode)
****************************************

Which in most cases does lead to a reboot, however that's unreliable.

Change the default reboot preference to prefer ACPI over UEFI if available and
not in reduced hardware mode.

This is in line to what Linux does, so it's unlikely to cause issues on current
and future hardware, since there's a much higher chance of vendors testing
hardware with Linux rather than Xen.

Add a special case for one Acer model that does require being rebooted using
ResetSystem().  See Linux commit 0082517fa4bce for rationale.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
Changes since v3:
 - Add changelog entry.

Changes since v2:
 - Rebase and remove incorrect paragraph from the commit message.

Changes since v1:
 - Add special case for Acer model to use UEFI reboot.
 - Adjust commit message.
---
 CHANGELOG.md            |  2 ++
 xen/arch/x86/shutdown.c | 19 +++++++++++++++----
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index eeaaa8b2741d..5521ae5bb37a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 ## [4.20.0 UNRELEASED](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=staging) - TBD
 
 ### Changed
+ - On x86:
+   - Prefer ACPI reboot over UEFI ResetSystem() run time service call.
 
 ### Added
 
diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c
index acceec2a385d..fa60d1638d58 100644
--- a/xen/arch/x86/shutdown.c
+++ b/xen/arch/x86/shutdown.c
@@ -150,19 +150,20 @@ static void default_reboot_type(void)
 
     if ( xen_guest )
         reboot_type = BOOT_XEN;
+    else if ( !acpi_disabled && !acpi_gbl_reduced_hardware )
+        reboot_type = BOOT_ACPI;
     else if ( efi_enabled(EFI_RS) )
         reboot_type = BOOT_EFI;
-    else if ( acpi_disabled )
-        reboot_type = BOOT_KBD;
     else
-        reboot_type = BOOT_ACPI;
+        reboot_type = BOOT_KBD;
 }
 
 static int __init cf_check override_reboot(const struct dmi_system_id *d)
 {
     enum reboot_type type = (long)d->driver_data;
 
-    if ( type == BOOT_ACPI && acpi_disabled )
+    if ( (type == BOOT_ACPI && acpi_disabled) ||
+         (type == BOOT_EFI && !efi_enabled(EFI_RS)) )
         type = BOOT_KBD;
 
     if ( reboot_type != type )
@@ -172,6 +173,7 @@ static int __init cf_check override_reboot(const struct dmi_system_id *d)
             [BOOT_KBD]  = "keyboard controller",
             [BOOT_ACPI] = "ACPI",
             [BOOT_CF9]  = "PCI",
+            [BOOT_EFI]  = "UEFI",
         };
 
         reboot_type = type;
@@ -492,6 +494,15 @@ static const struct dmi_system_id __initconstrel reboot_dmi_table[] = {
             DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
             DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R740")),
     },
+    {    /* Handle problems with rebooting on Acer TravelMate X514-51T. */
+        .callback = override_reboot,
+        .driver_data = (void *)(long)BOOT_EFI,
+        .ident = "Acer TravelMate X514-51T",
+        .matches = {
+            DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+            DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate X514-51T"),
+        },
+    },
     { }
 };
 
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 11:02:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 11:02:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770980.1181555 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZq3F-00047v-Q3; Fri, 02 Aug 2024 11:02:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770980.1181555; Fri, 02 Aug 2024 11:02:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZq3F-00047o-NW; Fri, 02 Aug 2024 11:02:25 +0000
Received: by outflank-mailman (input) for mailman id 770980;
 Fri, 02 Aug 2024 11:02:24 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=14L3=PB=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sZq3E-00047g-1a
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 11:02:24 +0000
Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com
 [2a00:1450:4864:20::22b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b151d455-50be-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 13:02:22 +0200 (CEST)
Received: by mail-lj1-x22b.google.com with SMTP id
 38308e7fff4ca-2f15790b472so21287611fa.0
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 04:02:22 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530bba35a43sm193419e87.231.2024.08.02.04.02.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 04:02:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b151d455-50be-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722596541; x=1723201341; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=QIeYc3VnZ5itKfrF+UwIjwjKtQd/VntST+I/E1lVRVk=;
        b=ZvFGWHXDR/xmPEjR6bRRKJwzfOpJ+rWZ63N4265xFZmycVuL5cX3P6tz+9ysFXPtKs
         hXbS8JxPKZioQzmvmm/wHuAaHxWoo0HJrkgahNGJoQ2WACOHNo9SDKKa8mcR3QMst7tQ
         RuU2fW4sg2Qr+GRH+qlU+gt/nU3FMX2PLnkisZ7s2izBK44Go7lWZnp/CDV40YnGY9n2
         z0Ct+Al+34SaJD12JaX6QBAMBGApVkuFONeqXUwzLOg/RFhBDlwUEd2btxMViCxnOcTW
         HFAo7R2gUsAjoJzdrZHdhCJrYkTvqzQmlV6fWrIduLnowl0fYysnS89B8+PBprPivTFX
         iAjw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722596541; x=1723201341;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=QIeYc3VnZ5itKfrF+UwIjwjKtQd/VntST+I/E1lVRVk=;
        b=k5M00mKEpYMMhYUxjCy0+lNEyrvSiStDIUd53TxQYbN5qM+0tpNLODsDPFETFlI6/o
         hUHN8llxZzYv0QlGFh/9AmIPay3MBEc9Mli32ENLCw0Wil10FhA0YwUnXs5RlleT1Yyg
         /bZQSODeP9YFy6iC7uyER4ye3OAva7gMEOu6IU/TfItZhmAzZJJju/fXJON82Xkf28cL
         8v820QIpAN6r/5tbWIcy950oWCRYzRR07a5dyXsPSAexdFqabfbOKE8Widv7xFd2aWgj
         jNPvs5lHTZLjiIKK2s6tRPkY6g9qoDNRD5PTHkgUkij/yuLN9o2uVpn/jLnvPcfuREm2
         tdTQ==
X-Gm-Message-State: AOJu0YwV8YSW/FBo+OWPgXiSp0K+IREBLua9kRFSTWXiWbBQLcLjwdqB
	0aTWQ/mQEW7r+94ZGR6aBXpMAz3C85QLlxHW/hH1ZhiG5/uSWDHIPIzKhQ==
X-Google-Smtp-Source: AGHT+IGfwGu3S9iwCgrMQtk+HzYZePLedG8xfld/lb0xcpenCaMwDO90ls1OQ9MyQYQMSZJ/x5kD7w==
X-Received: by 2002:a05:6512:ac6:b0:52e:a60e:3a0a with SMTP id 2adb3069b0e04-530bb39d1dfmr1994060e87.2.1722596540783;
        Fri, 02 Aug 2024 04:02:20 -0700 (PDT)
Message-ID: <1b3aff2873f3e9a46b6dd7936717c32945ecf30f.camel@gmail.com>
Subject: Re: [PATCH v11 4/5] xen/riscv: enable GENERIC_BUG_FRAME
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org
Date: Fri, 02 Aug 2024 13:02:19 +0200
In-Reply-To: <1d3ef706-fa3d-4dee-818c-83904012ca35@suse.com>
References: <cover.1721731887.git.oleksii.kurochko@gmail.com>
	 <b79bcfb9031564fc8d275af66fa94c1e82e54de2.1721731887.git.oleksii.kurochko@gmail.com>
	 <7c03ed78-7c80-45bf-acf3-a916b7abb7d5@suse.com>
	 <6c379c6a0ac3e046c67647fa63d085a341906224.camel@gmail.com>
	 <83e20f26-ae59-4191-a12d-f31f779c91e2@suse.com>
	 <a16ac4cd3fe0143e40f8b5ec993cd6049d41ea3d.camel@gmail.com>
	 <1d3ef706-fa3d-4dee-818c-83904012ca35@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Fri, 2024-08-02 at 12:30 +0200, Jan Beulich wrote:
> On 02.08.2024 12:22, oleksii.kurochko@gmail.com=C2=A0wrote:
> > On Fri, 2024-08-02 at 11:21 +0200, Jan Beulich wrote:
> > > On 02.08.2024 11:14, oleksii.kurochko@gmail.com=C2=A0wrote:
> > > > On Mon, 2024-07-29 at 15:00 +0200, Jan Beulich wrote:
> > > > > > To have working BUG(), WARN(), ASSERT,
> > > > > > run_in_exception_handler()
> > > > > > it is needed to enable GENERIC_BUG_FRAME.
> > > > > >=20
> > > > > > ebreak is used as BUG_insn so when macros from <xen/bug.h>
> > > > > > are
> > > > > > used, an exception with BREAKPOINT cause will be generated.
> > > > > >=20
> > > > > > ebreak triggers a debug trap, which starts in debug mode
> > > > > > and is
> > > > > > then filtered by every mode. A debugger will first handle
> > > > > > the
> > > > > > debug trap and check if ebreak was set by it or not. If
> > > > > > not,
> > > > > > CAUSE_BREAKPOINT will be generated for the mode where the
> > > > > > ebreak
> > > > > > instruction was executed.
> > > > >=20
> > > > > Here and in the similar code comment you talk about an
> > > > > external
> > > > > debugger, requiring debug mode, which is an optional feature.
> > > > > In
> > > > > my earlier comments what I was referring to was pure software
> > > > > debugging. I continue to fail to see how properly
> > > > > distinguishing
> > > > > ebreak uses for breakpoints from ebreak uses for e.g. BUG()
> > > > > and
> > > > > WARN() is going to be feasible.
> > > > GDB keeps track of what addresses it has breakpoints at.
> > >=20
> > > Of course it does. But in Xen how do you decide whether to
> > > trigger
> > > the debugger when you've hit an ebreak? (Just to repeat, my
> > > question
> > > is about the purely software debugging case; no hardware
> > > debugging
> > > extensions. In such a case, aiui, Xen gains control first and
> > > then
> > > decides whether to trigger the debugger, or whether to handle the
> > > exception internally. Sure, none of this infrastructure is in
> > > place
> > > right now, but imo it wants taking into consideration.)
> > Well, then something like KGDB is needed for Xen and mechanism to
> > notify guests to something similar to:
> >=20
> > Right now Xen detects that 'ebreak' is inserted by using the
> > function
> > do_bug_frame():
> > ```
> > =C2=A0=C2=A0=C2=A0 case CAUSE_BREAKPOINT:
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( do_bug_frame(cpu_regs, =
pc) >=3D 0 )
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (=
 !(is_kernel_text(pc) || is_kernel_inittext(pc)) )
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 printk("Something wrong with PC: %#lx\n", pc);
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 die();
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> >=20
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cpu_=
regs->sepc +=3D GET_INSN_LENGTH(*(uint16_t *)pc);
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > ```
> >=20
> > So if do_bug_frame() return < 0 then it should be ebreak inserted
> > by
> > the debugger so need to notify GDB that he should handle that.
> > At the moment I think we can add():
> > ```
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( do_bug_frame(cpu_regs, =
pc) >=3D 0 )
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > 		...
> >=20
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cpu_=
regs->sepc +=3D GET_INSN_LENGTH(*(uint16_t *)pc);
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > 	else
> > 	{
> > 	=C2=A0=C2=A0=C2=A0 printk("this is not Xen's ebreak\n");
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 die(=
);
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > ```
>=20
> Except that, as previously said, this will break if the debugger
> inserted
> a breakpoint where Xen already has an ebreak. That's where we started
> from
> in this discussion. Recall that my question was how the use of ebreak
> can
> be correct / reliable here. It is for a reason that on x86 we do not
> use
> the shorter INT3 instruction, but the longer UD2 one for BUG() etc.
Okay, in this case it will be an issue but only in case if the debugger
really will insert ebreak instruction but not something else. I wasn't
able to find a case when it is really inserted ebreak in case of RISC-
V.

However I agree that it would be safer to use something like UD2 but
RISC-V doesn't have such instruction ( at least I don't see such in a
spec).

There is something what we need is mentioned here:
https://github.com/riscv-non-isa/riscv-asm-manual/blob/main/riscv-asm.md#in=
struction-aliases
But the problem is that is "de-facto" standard, but not really standard
instruction. Anyway, I will update the patch to use (C0001073) instead
of ebreak.

~ Oleksii




From xen-devel-bounces@lists.xenproject.org Fri Aug 02 11:08:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 11:08:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770990.1181566 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZq9M-0005Sk-FA; Fri, 02 Aug 2024 11:08:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770990.1181566; Fri, 02 Aug 2024 11:08:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZq9M-0005Sd-BR; Fri, 02 Aug 2024 11:08:44 +0000
Received: by outflank-mailman (input) for mailman id 770990;
 Fri, 02 Aug 2024 11:08: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=14L3=PB=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sZq9K-0005SW-Fp
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 11:08:42 +0000
Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com
 [2a00:1450:4864:20::231])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 937bc4bf-50bf-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 13:08:41 +0200 (CEST)
Received: by mail-lj1-x231.google.com with SMTP id
 38308e7fff4ca-2f149845fbaso44492541fa.3
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 04:08:41 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f15e25dfe2sm1316341fa.112.2024.08.02.04.08.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 04:08:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 937bc4bf-50bf-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722596921; x=1723201721; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=ojFO8cXjPSdfB5lF9L82J6BKszmfAWhCwc440r7e/OU=;
        b=IbRwVoBSueyUO4FjB2gSOR6qL/TLgfs9eBMRz3s8XBHnMzZXfrFOi5ydrRxu+o0YFf
         7/FD8F6EOqE064xwC5jqWfxMs95J4dwLn8Go1JYxVSJGHx8sFYchkkkQygXanbpck3wE
         /EvUFukzJ/IeVn84ynqlQ5JWs5NVKwJJzVFaR+MQ9YEsPaT5NikTzye53+33J4jYle0t
         S2oS677EtM5Uvj8ZgpfPbnCU9/bPF2fr2ybqZGbH2f3z42d3dO8fgFNlFJ70Tm6pkOWW
         y0nJzOd2A9ImWO6uOZS2GQVC1YBrYRY1YvDRCR9YlfdsfVLiNC+bMNgAqsxB491wYoNf
         YBFg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722596921; x=1723201721;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=ojFO8cXjPSdfB5lF9L82J6BKszmfAWhCwc440r7e/OU=;
        b=ZCrthxqVvjxjSXucedykKzPClkKgi2tUtd1S0RYE13miJ+daYCpSrhUmPOtxWjMI4r
         ewj7FqqMKQJSbzln5fn8r/Wot/M7Grs37HSMxsBncXVqRQEcxaQel8VXiYOyvWCc3HiS
         UDKR+ZDhdkEWw91fOpu7WbKmRq/nc1uNfbYq5AlHXoDLGtoGpGHAIpITRab+4PgchVpe
         WXSy/4T7j1U0N+S3LGWrAQk86ekVdV+EdjXc9hVW1xj0eypg+QfIs8MqEYduFgZQ8KF9
         OPJx9T3LeKzbLqI/qyFySLxIfKK/cXOppeeHHkDpkJEexjaEhsXMZNrgeE+XzNiZ7m3c
         OHlQ==
X-Forwarded-Encrypted: i=1; AJvYcCUrVLnrsnpNNyUEZIZeM351TfiLM6wh7g01yBjlMTaSfaatl991vhZeZtOl6W1FiEybIDnR8JVtyyWHEt/mkavVX4sYDLr4UDvbhXxBHQo=
X-Gm-Message-State: AOJu0YyUWqJy4jPPiND/NbskDXptx288kma/itjphoRafyJJLIvhWId3
	MiZM9mrFkKbeSnhB4dkDv1ZV5jE6hexAM7tShSVL2NsvcJLgfoHK
X-Google-Smtp-Source: AGHT+IH/VVOf4/KSHbMUXdzeyy2e9Xv2n0S8O9JofUfnqwAy/rjU5RMzB6nmu3gzfAnLyvzSKT2s+w==
X-Received: by 2002:a2e:86cf:0:b0:2ef:2d80:b903 with SMTP id 38308e7fff4ca-2f15aa71966mr23642691fa.8.1722596920500;
        Fri, 02 Aug 2024 04:08:40 -0700 (PDT)
Message-ID: <2666e025bd7a5bade7ca35f2d26a980094fdf823.camel@gmail.com>
Subject: Re: [PATCH v4] x86/shutdown: change default reboot method preference
From: oleksii.kurochko@gmail.com
To: Roger Pau Monne <roger.pau@citrix.com>, xen-devel@lists.xenproject.org
Cc: Community Manager <community.manager@xenproject.org>, Jan Beulich
	 <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, Marek
 =?ISO-8859-1?Q?Marczykowski-G=F3recki?=
	 <marmarek@invisiblethingslab.com>
Date: Fri, 02 Aug 2024 13:08:39 +0200
In-Reply-To: <20240802105613.99197-1-roger.pau@citrix.com>
References: <20240802105613.99197-1-roger.pau@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Fri, 2024-08-02 at 12:56 +0200, Roger Pau Monne wrote:
> The current logic to chose the preferred reboot method is based on
> the mode Xen
> has been booted into, so if the box is booted from UEFI, the
> preferred reboot
> method will be to use the ResetSystem() run time service call.
>=20
> However, that method seems to be widely untested, and quite often
> leads to a
> result similar to:
>=20
> Hardware Dom0 shutdown: rebooting machine
> ----[ Xen-4.18-unstable=C2=A0 x86_64=C2=A0 debug=3Dy=C2=A0 Tainted:=C2=A0=
=C2=A0 C=C2=A0=C2=A0=C2=A0 ]----
> CPU:=C2=A0=C2=A0=C2=A0 0
> RIP:=C2=A0=C2=A0=C2=A0 e008:[<0000000000000017>] 0000000000000017
> RFLAGS: 0000000000010202=C2=A0=C2=A0 CONTEXT: hypervisor
> [...]
> Xen call trace:
> =C2=A0=C2=A0 [<0000000000000017>] R 0000000000000017
> =C2=A0=C2=A0 [<ffff83207eff7b50>] S ffff83207eff7b50
> =C2=A0=C2=A0 [<ffff82d0403525aa>] F machine_restart+0x1da/0x261
> =C2=A0=C2=A0 [<ffff82d04035263c>] F apic_wait_icr_idle+0/0x37
> =C2=A0=C2=A0 [<ffff82d040233689>] F smp_call_function_interrupt+0xc7/0xcb
> =C2=A0=C2=A0 [<ffff82d040352f05>] F call_function_interrupt+0x20/0x34
> =C2=A0=C2=A0 [<ffff82d04033b0d5>] F do_IRQ+0x150/0x6f3
> =C2=A0=C2=A0 [<ffff82d0402018c2>] F common_interrupt+0x132/0x140
> =C2=A0=C2=A0 [<ffff82d040283d33>] F
> arch/x86/acpi/cpu_idle.c#acpi_idle_do_entry+0x113/0x129
> =C2=A0=C2=A0 [<ffff82d04028436c>] F
> arch/x86/acpi/cpu_idle.c#acpi_processor_idle+0x3eb/0x5f7
> =C2=A0=C2=A0 [<ffff82d04032a549>] F arch/x86/domain.c#idle_loop+0xec/0xee
>=20
> ****************************************
> Panic on CPU 0:
> FATAL TRAP: vector =3D 6 (invalid opcode)
> ****************************************
>=20
> Which in most cases does lead to a reboot, however that's unreliable.
>=20
> Change the default reboot preference to prefer ACPI over UEFI if
> available and
> not in reduced hardware mode.
>=20
> This is in line to what Linux does, so it's unlikely to cause issues
> on current
> and future hardware, since there's a much higher chance of vendors
> testing
> hardware with Linux rather than Xen.
>=20
> Add a special case for one Acer model that does require being
> rebooted using
> ResetSystem().=C2=A0 See Linux commit 0082517fa4bce for rationale.
>=20
> Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
> Acked-by: Marek Marczykowski-G=C3=B3recki
> <marmarek@invisiblethingslab.com>
> ---
> Changes since v3:
> =C2=A0- Add changelog entry.
>=20
> Changes since v2:
> =C2=A0- Rebase and remove incorrect paragraph from the commit message.
>=20
> Changes since v1:
> =C2=A0- Add special case for Acer model to use UEFI reboot.
> =C2=A0- Adjust commit message.
> ---
> =C2=A0CHANGELOG.md=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 |=C2=A0 2 ++
> =C2=A0xen/arch/x86/shutdown.c | 19 +++++++++++++++----
> =C2=A02 files changed, 17 insertions(+), 4 deletions(-)
>=20
> diff --git a/CHANGELOG.md b/CHANGELOG.md
> index eeaaa8b2741d..5521ae5bb37a 100644
> --- a/CHANGELOG.md
> +++ b/CHANGELOG.md
> @@ -7,6 +7,8 @@ The format is based on [Keep a
> Changelog](https://keepachangelog.com/en/1.0.0/)
> =C2=A0## [4.20.0
> UNRELEASED](https://xenbits.xenproject.org/gitweb/?p=3Dxen.git;a=3Dshortl
> og;h=3Dstaging) - TBD
> =C2=A0
> =C2=A0### Changed
> + - On x86:
> +=C2=A0=C2=A0 - Prefer ACPI reboot over UEFI ResetSystem() run time servi=
ce
> call.
Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Thanks.

~ Oleksii

> =C2=A0
> =C2=A0### Added
> =C2=A0
> diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c
> index acceec2a385d..fa60d1638d58 100644
> --- a/xen/arch/x86/shutdown.c
> +++ b/xen/arch/x86/shutdown.c
> @@ -150,19 +150,20 @@ static void default_reboot_type(void)
> =C2=A0
> =C2=A0=C2=A0=C2=A0=C2=A0 if ( xen_guest )
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 reboot_type =3D BOOT_XEN=
;
> +=C2=A0=C2=A0=C2=A0 else if ( !acpi_disabled && !acpi_gbl_reduced_hardwar=
e )
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 reboot_type =3D BOOT_ACPI;
> =C2=A0=C2=A0=C2=A0=C2=A0 else if ( efi_enabled(EFI_RS) )
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 reboot_type =3D BOOT_EFI=
;
> -=C2=A0=C2=A0=C2=A0 else if ( acpi_disabled )
> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 reboot_type =3D BOOT_KBD;
> =C2=A0=C2=A0=C2=A0=C2=A0 else
> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 reboot_type =3D BOOT_ACPI;
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 reboot_type =3D BOOT_KBD;
> =C2=A0}
> =C2=A0
> =C2=A0static int __init cf_check override_reboot(const struct
> dmi_system_id *d)
> =C2=A0{
> =C2=A0=C2=A0=C2=A0=C2=A0 enum reboot_type type =3D (long)d->driver_data;
> =C2=A0
> -=C2=A0=C2=A0=C2=A0 if ( type =3D=3D BOOT_ACPI && acpi_disabled )
> +=C2=A0=C2=A0=C2=A0 if ( (type =3D=3D BOOT_ACPI && acpi_disabled) ||
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (type =3D=3D BOOT_EFI &=
& !efi_enabled(EFI_RS)) )
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 type =3D BOOT_KBD;
> =C2=A0
> =C2=A0=C2=A0=C2=A0=C2=A0 if ( reboot_type !=3D type )
> @@ -172,6 +173,7 @@ static int __init cf_check override_reboot(const
> struct dmi_system_id *d)
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =
[BOOT_KBD]=C2=A0 =3D "keyboard controller",
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =
[BOOT_ACPI] =3D "ACPI",
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =
[BOOT_CF9]=C2=A0 =3D "PCI",
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 [BOOT=
_EFI]=C2=A0 =3D "UEFI",
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 };
> =C2=A0
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 reboot_type =3D type;
> @@ -492,6 +494,15 @@ static const struct dmi_system_id __initconstrel
> reboot_dmi_table[] =3D {
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =
DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R740")),
> =C2=A0=C2=A0=C2=A0=C2=A0 },
> +=C2=A0=C2=A0=C2=A0 {=C2=A0=C2=A0=C2=A0 /* Handle problems with rebooting=
 on Acer TravelMate X514-
> 51T. */
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .callback =3D override_reboot=
,
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .driver_data =3D (void *)(lon=
g)BOOT_EFI,
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .ident =3D "Acer TravelMate X=
514-51T",
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 .matches =3D {
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DMI_M=
ATCH(DMI_SYS_VENDOR, "Acer"),
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DMI_M=
ATCH(DMI_PRODUCT_NAME, "TravelMate X514-51T"),
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 },
> +=C2=A0=C2=A0=C2=A0 },
> =C2=A0=C2=A0=C2=A0=C2=A0 { }
> =C2=A0};
> =C2=A0



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 11:10:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 11:10:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.770998.1181575 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZqAg-0006tb-Nz; Fri, 02 Aug 2024 11:10:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 770998.1181575; Fri, 02 Aug 2024 11:10:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZqAg-0006tU-LN; Fri, 02 Aug 2024 11:10:06 +0000
Received: by outflank-mailman (input) for mailman id 770998;
 Fri, 02 Aug 2024 11:10:05 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZqAf-0006kJ-Il
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 11:10:05 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c42640fd-50bf-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 13:10:03 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-52efbc57456so7964363e87.1
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 04:10: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
 4fb4d7f45d1cf-5b83a152e41sm968711a12.47.2024.08.02.04.10.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 02 Aug 2024 04:10:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c42640fd-50bf-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722597003; x=1723201803; 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=VQVTKoyS6NDUODlV2oYjuCieTKBHODztz3IrYmLdUMc=;
        b=NgFII3UqPJ2xrL47m+WBm11O+qHziAwW5YWMF9bs6sQ9nTzvid10kq/s9rkpZBZ7QT
         x6Z18OHejN6uMRkVcDM9IQA/uAMVva7F9Z6yE9hJr7zkHojjOs656HBCuf7c2sFXY0oG
         H5j+EMREnHlDYn7iGbXcm2Spe8NMhxmLo5Lv377gkdkD2VisCczXEc7V7Su6q1vgyDQB
         XgFUhBrGemM3mM63M8Gyi43VvQ+Ty7yLgscmQfYnsh857bMNNp/1DNWa+UHK4IVgh4KF
         yAgMTwtiQML0jFGddB3ea06P7xMt7V3v2EfDidYoY+5x8QOQCX0cwz2CfvhvE1sqRxdD
         ME2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722597003; x=1723201803;
        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=VQVTKoyS6NDUODlV2oYjuCieTKBHODztz3IrYmLdUMc=;
        b=BVtLbBZhQTFVr/m0rl2vkCVY7Yoj6ndZLk7Dy/B/yg0dNAn4lhhuaWNdejkzCvdrx2
         W3I19lQIzHGg+plySLr93E1ZIxZGpRrbWN6eRvW2TBHktsj9RS1DNhnCg9BtCAfL28+W
         g8j2AIH8U7hOznDXuADobZz412aISLnQ36w3sIZNr8+Py+99+r8DdoY54HKQSDhDNjop
         v70Rdznvw44yXomSnPpDUH+vcVKo2TlVhs2SogqY7vdeGtDScPrLIyx8dhpiFqyecZPS
         IMnRQKQVRQF3uQFQs/4XboJob6EtxN5tgghPTU3Z7GA4Nwyxzd1tuMSO75NhoWl57ulD
         qK0Q==
X-Forwarded-Encrypted: i=1; AJvYcCWVNmmVXF13d6yNTrW1VOJjF50UTnt13WH9TTwURm3Zu9kPL0Sw0HXvBkPBDWxTP2j24EF4xDnZes2HUIRX7QHUv1Y/j8SXGKw9yNySM48=
X-Gm-Message-State: AOJu0YwrwNbd3JL4VVvufVvJPV4IoyALU7OTaB+ECkSwsgaRMHQwQC3N
	vWk1FuzgEEHsLmnlRzWbciIRRBF2ozTggT9CV7wLROMHLFGEtv/Z+ypTqZwaSQ==
X-Google-Smtp-Source: AGHT+IHlyvBwRwMVhXponBmYBkh+X9Sp1H8HkMTR7Ul9m7+U/Wh6UAH+JChmzr+G8vPGeSEn3umSBQ==
X-Received: by 2002:a05:6512:3e06:b0:52e:9a91:bba3 with SMTP id 2adb3069b0e04-530bb36ba51mr2065994e87.15.1722597002496;
        Fri, 02 Aug 2024 04:10:02 -0700 (PDT)
Message-ID: <fc8de47e-1b67-4dad-a01a-714fe0005de0@suse.com>
Date: Fri, 2 Aug 2024 13:10:00 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v5 09/13] x86/vmx: guard access to cpu_has_vmx_* in
 common code
To: Sergiy Kibrik <sergiy_kibrik@epam.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>, Paul Durrant <paul@xen.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1722333634.git.Sergiy_Kibrik@epam.com>
 <c2961c8b67041883ce5a5f6d0511a31dc7fbe22d.1722333634.git.Sergiy_Kibrik@epam.com>
 <cc92ed50-89f7-48c9-b0e1-cd61a020001c@suse.com>
 <ccd77283-4b88-4351-a3f9-bd4240b9b845@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <ccd77283-4b88-4351-a3f9-bd4240b9b845@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 02.08.2024 12:53, Sergiy Kibrik wrote:
> 31.07.24 15:23, Jan Beulich:
>> On 30.07.2024 12:33, Sergiy Kibrik wrote:
>>> There're several places in common code, outside of arch/x86/hvm/vmx,
>>> where cpu_has_vmx_* get accessed without checking whether VMX supported first.
>>> These macros rely on global variables defined in vmx code, so when VMX support
>>> is disabled accesses to these variables turn into build failures.
>>>
>>> To overcome these failures, build-time check is done before accessing global
>>> variables, so that DCE would remove these variables.
>>>
>>> Signed-off-by: Sergiy Kibrik<Sergiy_Kibrik@epam.com>
>>> Acked-by: Paul Durrant<paul@xen.org>
>>> CC: Andrew Cooper<andrew.cooper3@citrix.com>
>>> CC: Jan Beulich<jbeulich@suse.com>
>>> ---
>>> changes in v5:
>>>   - change kconfig option name VMX -> INTEL_VMX
>>>   - do not change .c files, only modify macros in vmcs.h
>> Better, yet still not going far enough, as indicated earlier:
> 
> I must've misunderstood your earlier suggestion. Are we talking about 
> modifying all of cpu_has_vmx_* macros -- even though most of them used 
> internally to VMX code and don't cause any trouble in common code?

Yes. Where exactly they're used can change any moment (in principle at
least).

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 11:13:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 11:13:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771006.1181587 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZqE1-0007X9-6X; Fri, 02 Aug 2024 11:13:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771006.1181587; Fri, 02 Aug 2024 11:13:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZqE1-0007X2-2V; Fri, 02 Aug 2024 11:13:33 +0000
Received: by outflank-mailman (input) for mailman id 771006;
 Fri, 02 Aug 2024 11:13:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=AAnW=PB=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZqE0-0007Ww-E9
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 11:13:32 +0000
Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com
 [2607:f8b0:4864:20::f2b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3ff10ee1-50c0-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 13:13:31 +0200 (CEST)
Received: by mail-qv1-xf2b.google.com with SMTP id
 6a1803df08f44-6b7acf213a3so39772676d6.1
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 04:13:31 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6bb9c79b2aasm6010206d6.54.2024.08.02.04.13.28
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 04:13:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3ff10ee1-50c0-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722597209; x=1723202009; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=Wu3re5EYOLVVxiZpi2T1eeKPM9el+p/H8hrjUeOaywU=;
        b=nDYwuFKGvpSX3IAc0tkKddW4IN/Xzaa84oX7nf3f2F0GjCKnLPxOCQ6Pd6qjVz6cOR
         JlwS9j6BMQHW3MzMAP65GwltMnj/mkKlnI3aiOZkCArm/G7qpM3mNrB3/Q8+T73uEva5
         cVcmfh9Lds5cTPEm9Ib+HayjCw9aexFCckTxE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722597209; x=1723202009;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=Wu3re5EYOLVVxiZpi2T1eeKPM9el+p/H8hrjUeOaywU=;
        b=CpxPZGvmYhkg4Hep2goXEzGzEJ6AILtGBZ/M3JVvAyxCQ7kjUrRIKVsy0h0hLbHoho
         fjkjfEJ/odMMCs8EC9mSqRW48uLNopPRofouhqKS7OpK55s91FRiUzA8pLlciT9/f+BC
         zkm6Z82nh2eraFG7ZuuCPMamAshq2gkgwJkp2m/EvxQm57pDwcuFC0yOKGQmcKUhZ5y3
         bSLe1nITZzTIQYLX8eUwEp2L3sb59rTJ0A4std3BNG2sqefBZermZ2NOVG9LlfG+1G8z
         54di+AgjqDtOI+Slc7TP9f5NiN5hC+ZnDu2SM8bb6ZZ1rUWTnIM3benYbXqBWkeizIBe
         PeRg==
X-Gm-Message-State: AOJu0Yx2YpbhVady/NK4mHvh0OcOxYPpoXswyJ4FybT4Q/C6OyD4R+c/
	cIZBa7URTJMSIFfyS2a6juSSlLzHf0dZeWZprpATLVNqSE773//ZVd2s0j+vm1y7pfiZAXJGTml
	I
X-Google-Smtp-Source: AGHT+IGGnws1a2RFzBi9opY3XhC8YzmES+GIQyL3u0H49d5ReFGS6J7wM1QJvA14FFQFtdhy0yH9kA==
X-Received: by 2002:a05:6214:3b83:b0:6b5:65bd:123b with SMTP id 6a1803df08f44-6bb98261be8mr42243386d6.0.1722597209159;
        Fri, 02 Aug 2024 04:13:29 -0700 (PDT)
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v4] x86/dom0: delay setting SMAP after dom0 build is done
Date: Fri,  2 Aug 2024 13:12:44 +0200
Message-ID: <20240802111244.99340-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Delay setting X86_CR4_SMAP on the BSP until the domain building is done, so
that there's no need to disable SMAP.  Note however that SMAP is enabled for
the APs on bringup, as domain builder code strictly run on the BSP.  Delaying
the setting for the APs would mean having to do a callfunc IPI later in order
to set it on all the APs.

The fixes tag is to account for the wrong usage of cpu_has_smap in
create_dom0(), it should instead have used
boot_cpu_has(X86_FEATURE_XEN_SMAP).

While there also make cr4_pv32_mask __ro_after_init.

Fixes: 493ab190e5b1 ('xen/sm{e, a}p: allow disabling sm{e, a}p for Xen itself')
Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
Changes since v3:
 - Be more selective when setting cr4_pv32_mask.

Changes since v2:
 - Change approach.
 - Add fixes tag.
---
 xen/arch/x86/setup.c | 48 +++++++++++++++++++++++++-------------------
 1 file changed, 27 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index eee20bb1753c..a7a85e94e3c8 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -80,7 +80,7 @@ int8_t __initdata opt_probe_port_aliases = -1;
 boolean_param("probe-port-aliases", opt_probe_port_aliases);
 
 /* Only used in asm code and within this source file */
-unsigned long asmlinkage __read_mostly cr4_pv32_mask;
+unsigned long asmlinkage __ro_after_init cr4_pv32_mask;
 
 /* **** Linux config option: propagated to domain0. */
 /* "acpi=off":    Sisables both ACPI table parsing and interpreter. */
@@ -955,26 +955,9 @@ static struct domain *__init create_dom0(const module_t *image,
         }
     }
 
-    /*
-     * Temporarily clear SMAP in CR4 to allow user-accesses in construct_dom0().
-     * This saves a large number of corner cases interactions with
-     * copy_from_user().
-     */
-    if ( cpu_has_smap )
-    {
-        cr4_pv32_mask &= ~X86_CR4_SMAP;
-        write_cr4(read_cr4() & ~X86_CR4_SMAP);
-    }
-
     if ( construct_dom0(d, image, headroom, initrd, cmdline) != 0 )
         panic("Could not construct domain 0\n");
 
-    if ( cpu_has_smap )
-    {
-        write_cr4(read_cr4() | X86_CR4_SMAP);
-        cr4_pv32_mask |= X86_CR4_SMAP;
-    }
-
     return d;
 }
 
@@ -1907,16 +1890,26 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     if ( cpu_has_smep && opt_smep != SMEP_HVM_ONLY )
         setup_force_cpu_cap(X86_FEATURE_XEN_SMEP);
     if ( boot_cpu_has(X86_FEATURE_XEN_SMEP) )
+    {
         set_in_cr4(X86_CR4_SMEP);
+        BUILD_BUG_ON(!(X86_CR4_SMEP & XEN_CR4_PV32_BITS));
+        cr4_pv32_mask |= X86_CR4_SMEP;
+    }
 
     if ( !opt_smap )
         setup_clear_cpu_cap(X86_FEATURE_SMAP);
     if ( cpu_has_smap && opt_smap != SMAP_HVM_ONLY )
         setup_force_cpu_cap(X86_FEATURE_XEN_SMAP);
     if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
-        set_in_cr4(X86_CR4_SMAP);
-
-    cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;
+        /*
+         * Set SMAP on the %cr4 mask so that it's set for APs on bringup, but
+         * don't set for the BSP until domain building is done.
+         *
+         * Don't set it in cr4_pv32_mask either, until it's also set on the
+         * BSP.  Otherwise the BUG in cr4_pv32_restore would trigger for events
+         * received on the BSP.
+         */
+        mmu_cr4_features |= X86_CR4_SMAP;
 
     if ( boot_cpu_has(X86_FEATURE_FSGSBASE) )
         set_in_cr4(X86_CR4_FSGSBASE);
@@ -2048,6 +2041,19 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     if ( !dom0 )
         panic("Could not set up DOM0 guest OS\n");
 
+    /*
+     * Enable SMAP only after being done with the domain building phase, as the
+     * PV builder switches to the domain page-tables and must be run with SMAP
+     * disabled.
+     */
+    if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
+    {
+        ASSERT(mmu_cr4_features & X86_CR4_SMAP);
+        write_cr4(read_cr4() | X86_CR4_SMAP);
+        BUILD_BUG_ON(!(X86_CR4_SMAP & XEN_CR4_PV32_BITS));
+        cr4_pv32_mask |= X86_CR4_SMAP;
+    }
+
     heap_init_late();
 
     init_trace_bufs();
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 11:18:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 11:18:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771018.1181597 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZqIU-0000WR-Qy; Fri, 02 Aug 2024 11:18:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771018.1181597; Fri, 02 Aug 2024 11:18:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZqIU-0000WK-Lu; Fri, 02 Aug 2024 11:18:10 +0000
Received: by outflank-mailman (input) for mailman id 771018;
 Fri, 02 Aug 2024 11:18: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=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZqIT-0000WB-3h
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 11:18:09 +0000
Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com
 [2a00:1450:4864:20::22a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e4a10162-50c0-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 13:18:07 +0200 (CEST)
Received: by mail-lj1-x22a.google.com with SMTP id
 38308e7fff4ca-2f15dd0b489so9508901fa.3
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 04:18:07 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9d437bbsm86671366b.121.2024.08.02.04.18.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 02 Aug 2024 04:18:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e4a10162-50c0-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722597487; x=1723202287; 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=Lqo+36Qc1nlXNyw/C5M1bynBVeWABxzqvPSrqc8LcMg=;
        b=AetRudV7aiNp0EuE2dc55dZAudxlbav2AIgOFhLP4INtTvwNEu7ecOoiKseVdYUnLB
         sDrUSISl+8v2QEnrf0ZFmAKc26037lye/3fMaAnX9HcuUFdpQOkJY0b39Q3ERs2iMWuj
         hsP1rW+gVrHzuAHT9qj9i6CoWOuCLwLTZNTcWTLjDNG30pQ8gu4wHKqDsMMes3R7jDwL
         1ep+HsIlw2e8awTI+q0KqXr/3Eht+zhUcKt+IiFuD7Jr2iZTCJMemgDI2X+CY/kGjDOu
         snJdNNc4qkbO/qBE0Ka2CNfIl7jWqNJPD8RJTC7K67pjNAqFeKy8Lvfg8u2bpTuC7cUA
         kvNA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722597487; x=1723202287;
        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=Lqo+36Qc1nlXNyw/C5M1bynBVeWABxzqvPSrqc8LcMg=;
        b=FQA2FE524JYA31zk8pArNKddiT2nSqdB1jiFFsfLsbAKinQZ+UQNTqWCpxi0SoIkjq
         NZMHv6GmEpMISWEoHws8LlDS66TPjOMyWKXYi9SQk+hI/+GGgXGC4kd2BPmonglG4/ws
         +rKPG7qTAppzeL9emIFJSHUHIMoUApoG/u9O7pv0QzCLIj0epxIQNg6ENzVMRpkFKDdR
         QShq8Bsm88Aya/JjTlYTfOHjORlRbTcovp6SX36bYMTFiwo6uMMq0Zi6TvK61g9y4nOT
         XXVzP1b2o0CIUyt73JbKTwH9mREDzWOyZ2KC+LGu3bSAphyUwAqR3ThhiIJivnxdLN+m
         wCeg==
X-Gm-Message-State: AOJu0YxJ7DZVGxDpasT2lzdko3vRaZJ/4xhAhtpLLrY+PRfxeSYvs55L
	qnEbBSjUgDMDT5UKrgJuY3mJVAPbnYZsNNv0mfMozyMzvwCYvctQdYrbyeGIyQ==
X-Google-Smtp-Source: AGHT+IF5uOSvj97YAe8JI5nIAM8aSmBICP+rG8gwDMEg6ano6clXFj196AmNWWuayT8vzwT/QE6TDw==
X-Received: by 2002:a05:6512:3da6:b0:52c:9725:b32b with SMTP id 2adb3069b0e04-530bb36f8ddmr2050031e87.17.1722597486492;
        Fri, 02 Aug 2024 04:18:06 -0700 (PDT)
Message-ID: <6f339355-4f82-4b84-b437-cc72dc063b64@suse.com>
Date: Fri, 2 Aug 2024 13:18:04 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v11 4/5] xen/riscv: enable GENERIC_BUG_FRAME
To: oleksii.kurochko@gmail.com
Cc: xen-devel@lists.xenproject.org
References: <cover.1721731887.git.oleksii.kurochko@gmail.com>
 <b79bcfb9031564fc8d275af66fa94c1e82e54de2.1721731887.git.oleksii.kurochko@gmail.com>
 <7c03ed78-7c80-45bf-acf3-a916b7abb7d5@suse.com>
 <6c379c6a0ac3e046c67647fa63d085a341906224.camel@gmail.com>
 <83e20f26-ae59-4191-a12d-f31f779c91e2@suse.com>
 <a16ac4cd3fe0143e40f8b5ec993cd6049d41ea3d.camel@gmail.com>
 <1d3ef706-fa3d-4dee-818c-83904012ca35@suse.com>
 <1b3aff2873f3e9a46b6dd7936717c32945ecf30f.camel@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: <1b3aff2873f3e9a46b6dd7936717c32945ecf30f.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 02.08.2024 13:02, oleksii.kurochko@gmail.com wrote:
> There is something what we need is mentioned here:
> https://github.com/riscv-non-isa/riscv-asm-manual/blob/main/riscv-asm.md#instruction-aliases
> But the problem is that is "de-facto" standard, but not really standard
> instruction. Anyway, I will update the patch to use (C0001073) instead
> of ebreak.

Well, the official spec, in the C extension, mentions 0x0000 as "defined
illegal instruction". Wouldn't using that work? It's going to be undefined
no matter whether the C extension is actually implemented.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 11:26:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 11:26:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771028.1181606 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZqQi-0002T7-HJ; Fri, 02 Aug 2024 11:26:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771028.1181606; Fri, 02 Aug 2024 11:26:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZqQi-0002SU-EV; Fri, 02 Aug 2024 11:26:40 +0000
Received: by outflank-mailman (input) for mailman id 771028;
 Fri, 02 Aug 2024 11:26: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=14L3=PB=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sZqQh-0002QR-0z
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 11:26:39 +0000
Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com
 [2a00:1450:4864:20::12b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1487611a-50c2-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 13:26:37 +0200 (CEST)
Received: by mail-lf1-x12b.google.com with SMTP id
 2adb3069b0e04-52f00ad303aso12277064e87.2
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 04:26:37 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530bba3d075sm201593e87.268.2024.08.02.04.26.35
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 04:26:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1487611a-50c2-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722597996; x=1723202796; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=YaAP7smygLkz3CuBgBU7MLOgysw2GlGv+eXZXZeMU+o=;
        b=EJaXTPlyqycjQTgBd8ad9TA0UhjypJA+Pqc/PYoUiqgkS+ppjLKEIjCf/o3WGGSsv6
         UNpAR9GiJiu1ySv1xnTx6iAypza/8QXpzk6NZqXXI+xOnOZeyHTwEnODGhwQuY29dXuU
         ApCiFp0HbeXj3IvdI2bLzAPP/LtuiVzSLfpCjb2BXtOX+jaKnd5ig+Qbh7zlgVy/OQik
         VEZdl6QvkFEPZiqy8BTmB1qwAMdK0QLUe0Cacy7wVfUQ86YRIoYuc+7GBKiliD7MafXD
         wyGd1825/RQtVo+fYXtKkh0jEIXWbD2XIxVwiH09wnt8e/vNEEZr9IYA4wpNg64VwSaw
         82EQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722597996; x=1723202796;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=YaAP7smygLkz3CuBgBU7MLOgysw2GlGv+eXZXZeMU+o=;
        b=tEdEOb/+9H9AQ2l7mmKB4e38D6ZrynlgNSiMISlsTbB6SRJV5/KlZsdvMBXkZE4VLU
         IDeiYCPv6r/YyW3B4Gq0K1U8hqFCj+Leq54WwYKfWHSSazPkeVSnL9z9bpGY/4GRw4c/
         Pw2Mj8h9P/Mhv6xm9rk12E9wAJyPeWoRD1b1Z+pNTbfQgxxmWg+zC5xIu8dBIGRp/xLa
         2lTzhcD+N8r0OIGgONKbsI2C+YEbOi5o/PHZMJRpfJXr9NEOHnyRv9UtnQdGqfoAm0ht
         Z47ab8WqYFmjljCZJ0pYjlMFZG27gbVdqj8V2+foCzVMCD0b2ddCT/bLEUcoFnwSEqog
         J6pw==
X-Gm-Message-State: AOJu0YzQMsK02TLGcex6uecH0vp6bNiKgk9QBz6PrlnLSlbVv27ca2Sn
	R51zv1s0zaOHGWXn+qPlzCpCxRZzdcR7fh4s2tPqDxbSKubjKiWY
X-Google-Smtp-Source: AGHT+IEl6snRdxuhBwAEONwVjY8XhE6pjDejADBKmvzhb+LJsoK1BmUCXi8mtWmMmDMqc7/NHlvLbg==
X-Received: by 2002:a05:6512:b98:b0:52c:c9bb:2ba4 with SMTP id 2adb3069b0e04-530bb3cde63mr1869125e87.46.1722597995939;
        Fri, 02 Aug 2024 04:26:35 -0700 (PDT)
Message-ID: <2d61a90941e2df7b24907b8578a425ea6bfe15c7.camel@gmail.com>
Subject: Re: [PATCH v11 4/5] xen/riscv: enable GENERIC_BUG_FRAME
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org
Date: Fri, 02 Aug 2024 13:26:35 +0200
In-Reply-To: <6f339355-4f82-4b84-b437-cc72dc063b64@suse.com>
References: <cover.1721731887.git.oleksii.kurochko@gmail.com>
	 <b79bcfb9031564fc8d275af66fa94c1e82e54de2.1721731887.git.oleksii.kurochko@gmail.com>
	 <7c03ed78-7c80-45bf-acf3-a916b7abb7d5@suse.com>
	 <6c379c6a0ac3e046c67647fa63d085a341906224.camel@gmail.com>
	 <83e20f26-ae59-4191-a12d-f31f779c91e2@suse.com>
	 <a16ac4cd3fe0143e40f8b5ec993cd6049d41ea3d.camel@gmail.com>
	 <1d3ef706-fa3d-4dee-818c-83904012ca35@suse.com>
	 <1b3aff2873f3e9a46b6dd7936717c32945ecf30f.camel@gmail.com>
	 <6f339355-4f82-4b84-b437-cc72dc063b64@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Fri, 2024-08-02 at 13:18 +0200, Jan Beulich wrote:
> On 02.08.2024 13:02, oleksii.kurochko@gmail.com=C2=A0wrote:
> > There is something what we need is mentioned here:
> > https://github.com/riscv-non-isa/riscv-asm-manual/blob/main/riscv-asm.m=
d#instruction-aliases
> > But the problem is that is "de-facto" standard, but not really
> > standard
> > instruction. Anyway, I will update the patch to use (C0001073)
> > instead
> > of ebreak.
>=20
> Well, the official spec, in the C extension, mentions 0x0000 as
> "defined
> illegal instruction". Wouldn't using that work? It's going to be
> undefined
> no matter whether the C extension is actually implemented.
It should work. I will use 0x0000 then. Thanks.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 12:05:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 12:05:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771042.1181616 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZr23-0000fc-IO; Fri, 02 Aug 2024 12:05:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771042.1181616; Fri, 02 Aug 2024 12:05:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZr23-0000fV-Ec; Fri, 02 Aug 2024 12:05:15 +0000
Received: by outflank-mailman (input) for mailman id 771042;
 Fri, 02 Aug 2024 12:05: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=AAnW=PB=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sZr22-0000fP-FQ
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 12:05:14 +0000
Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com
 [2607:f8b0:4864:20::82c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 78da1d5c-50c7-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 14:05:13 +0200 (CEST)
Received: by mail-qt1-x82c.google.com with SMTP id
 d75a77b69052e-44f6700addcso34035741cf.2
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 05:05:13 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 d75a77b69052e-4518a6e5c35sm6788891cf.47.2024.08.02.05.05.11
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 05:05:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 78da1d5c-50c7-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1722600312; x=1723205112; darn=lists.xenproject.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=hVJg0+nu4wkHktptE3dFs15rYFV2ig63vkdRke6igDY=;
        b=Q/89laYNR/3N/9ZUyYgi4liCSjkgPIzn1g97Cy5KsJEGtzaP864UqsZHItcNUkrgzT
         gtvKP93dwXP3yBWYVnEz4uwWQ9GiVKtxay3H9JpwUM7eioYGKwWCgIRHW80xatUYmdH8
         ED7wTVhE0LAv2Qaakca8ba0sccIVTUsu4UbX8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722600312; x=1723205112;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=hVJg0+nu4wkHktptE3dFs15rYFV2ig63vkdRke6igDY=;
        b=YXShiwf3fGR54xqyDxF3IKGr5d/gcKUcqDVlO3Kvpx7LazBQCflm9tToaICaOvnGC0
         g/zlXSBQDKmQmwbHQnJ0ZO4tAN6dZyEe8MCcpmyettPLN1Fq45o42zj3DKT0REp+5OgE
         YNpxrQ6kr0KQOPVHis78Jijc3thPalgR0diImj2zK0M8w/Pkacw74T2HaHUxbRKSOqS2
         ABo/hOQDmAN9R7t3eqK2ijhAlGPNzBg2TiIP0TMjPDV3pD4hj3GHRGjp6DM7Aqgl1qv5
         IVuRbVYRfj5dCPf57XTO53XBOxzjJ8NsmgJx3g475MC14kZ7WV6K3P7SRwf7uAG6CpBE
         k9Yg==
X-Gm-Message-State: AOJu0Yyrw/LfQil6gPc99LuYk3+9o4iBFZnPKxOShchU5Xooas3fEsky
	0h3BfCnD4RR3A8UBKudOeT5FjZMyrcFEM+wiwTwCjx4h75kUbLXJLCIA9SddJyc=
X-Google-Smtp-Source: AGHT+IHeF40GD7omxwOogNikdKICNXxzXqHXdcGsQGpV2pXlHpmWtWqAMp3K2GRxEVuGSEHBdOvBxQ==
X-Received: by 2002:ac8:580a:0:b0:447:f89a:4d37 with SMTP id d75a77b69052e-4518929e522mr35873881cf.44.1722600312002;
        Fri, 02 Aug 2024 05:05:12 -0700 (PDT)
Date: Fri, 2 Aug 2024 14:05:08 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
	George Dunlap <gwd@xenproject.org>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	Juergen Gross <jgross@suse.com>,
	"Daniel P . Smith" <dpsmith@apertussolutions.com>,
	Stewart Hildebrand <Stewart.Hildebrand@amd.com>,
	Huang Rui <ray.huang@amd.com>, Jiqian Chen <Jiqian.Chen@amd.com>
Subject: Re: [XEN PATCH v12 4/7] x86/domctl: Add hypercall to set the access
 of x86 gsi
Message-ID: <ZqzLdLAakJ6AGg9O@macbook>
References: <20240708114124.407797-1-Jiqian.Chen@amd.com>
 <20240708114124.407797-5-Jiqian.Chen@amd.com>
 <ZqyT7ocbP6AZEb_S@macbook>
 <d5a6b8e4-d848-4b37-83f2-e492c9e99484@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <d5a6b8e4-d848-4b37-83f2-e492c9e99484@suse.com>

On Fri, Aug 02, 2024 at 11:40:53AM +0200, Jan Beulich wrote:
> On 02.08.2024 10:08, Roger Pau Monné wrote:
> > On Mon, Jul 08, 2024 at 07:41:21PM +0800, Jiqian Chen wrote:
> >> Some type of domains don't have PIRQs, like PVH, it doesn't do
> >> PHYSDEVOP_map_pirq for each gsi. When passthrough a device
> >> to guest base on PVH dom0, callstack
> >> pci_add_dm_done->XEN_DOMCTL_irq_permission will fail at function
> >> domain_pirq_to_irq, because PVH has no mapping of gsi, pirq and
> >> irq on Xen side.
> >> What's more, current hypercall XEN_DOMCTL_irq_permission requires
> >> passing in pirq to set the access of irq, it is not suitable for
> >> dom0 that doesn't have PIRQs.
> >>
> >> So, add a new hypercall XEN_DOMCTL_gsi_permission to grant/deny
> >> the permission of irq(translate from x86 gsi) to dumU when dom0
> >> has no PIRQs.
> > 
> > I've been wondering about this, and if the hypercall is strictly to
> > resolve GSIs into IRQs, isn't that the case that Xen identity maps GSI
> > into the IRQ space, and hence no translation is required?
> 
> It was a long-winded discussion to clarify that in obscure cases
> translation is required: Whenever there's a source override in ACPI.

Right, I see it's a bit convoluted to get the overrides, as those are
indexed by IO-APIC pin, so we need to resolve the GSI -> (ioapic, pin)
first and then check for any possible overrides.

Might be helpful to mention in the commit description that the GSI to
IRQ translation is done to account for ACPI overrides, as otherwise
GSIs are identity mapped into IRQs.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 12:15:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 12:15:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771052.1181626 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrBZ-0002qt-EA; Fri, 02 Aug 2024 12:15:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771052.1181626; Fri, 02 Aug 2024 12:15:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrBZ-0002qm-BC; Fri, 02 Aug 2024 12:15:05 +0000
Received: by outflank-mailman (input) for mailman id 771052;
 Fri, 02 Aug 2024 12:15:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sjRO=PB=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sZrBY-0002qa-3q
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 12:15:04 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on20620.outbound.protection.outlook.com
 [2a01:111:f403:2414::620])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d6958d7e-50c8-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 14:15:01 +0200 (CEST)
Received: from BYAPR11CA0067.namprd11.prod.outlook.com (2603:10b6:a03:80::44)
 by MW4PR12MB6897.namprd12.prod.outlook.com (2603:10b6:303:20a::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Fri, 2 Aug
 2024 12:14:55 +0000
Received: from CO1PEPF000075EF.namprd03.prod.outlook.com
 (2603:10b6:a03:80:cafe::14) by BYAPR11CA0067.outlook.office365.com
 (2603:10b6:a03:80::44) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend
 Transport; Fri, 2 Aug 2024 12:14:55 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1PEPF000075EF.mail.protection.outlook.com (10.167.249.38) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Fri, 2 Aug 2024 12:14:55 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 2 Aug
 2024 07:14:53 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Fri, 2 Aug 2024 07:14:53 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d6958d7e-50c8-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=EU6UWUy+WJ2SdzJVPGyYvRKTr/xK/ckUXw92MqkBS5C1gNOerircKk0RPT4VscZHAxkrilcp09oiWroanKIY3d1CKvxh+BhDXjzb3HZSLtE0pZmRdN5t5yvxWg8kRi5GQfUAdOHrmYUrTcIS6QV8pyR07ctXB4Sy8vpLFjVRq/XMy5oDT6Wz4tqRj0QiLv1FVhxjAJ3GalYLZlLHjEnSOFDJmYsezasUiG7r9pbqChr3dcomz5u44Jp67o/hmQeSUcO9/ZIgJZ9LsYIhPLi+9VXqD8wH328ye+F4BkdRo2JCrlJTqugeZd6Gab80ec0IxNBPtNemPcLWHAdoWsWyHQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ITrrWosK14v5+EcosBCaPLfPpp+3saTWMWs0TdG6SCY=;
 b=Lqec4XdeLpmXebov2Xfe56Ebghv4r6Of43oZNKMtHW3CNinhNF+MDryabhHKjFTbQGWHsBm1n2hppZEcpnxWd2YkGwOCcM0E9vUhx8/fdqShfP7QBU6/uYw0nLgZT/RdqhSS4kLwasks4eqTpVlA/RMxuT9cU1hi24hftWq8cdtQyzDIEKp3ISNKSLgnoSFuJ6otMyAoF0WQqMB6PVzac9qCGi4rsc+5tQCVVnHM6PLFV5ZOMhmoxnLHfLkW/Vj04qHLt8kadVI0w+uCOACTWaURuoZedGWh4N+t+C8Yb8lGHGIetqKCBbQjXkQNAXruTIquew5Az5cT2A8/8y3q8g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ITrrWosK14v5+EcosBCaPLfPpp+3saTWMWs0TdG6SCY=;
 b=dJWXEL3dViEzGODHZ732d1xa3LLtOF3HZIRDxelvuWy3lGVdqtp622AyQEgi1NAkCh5+jbOCEl04l6gM5enTA8brcoRtce50HRnoSL1YhwWkpQKMAubf5Dv6kpNjGMW3lKt6NT/f53dmZNUr8qgI/dISdiZgMTMQMPpQ/ZwtRX0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<Volodymyr_Babchuk@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v1 0/4] xen: arm: Split MMU code in preparation for MPU work (part 2)
Date: Fri, 2 Aug 2024 13:14:39 +0100
Message-ID: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB04.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000075EF:EE_|MW4PR12MB6897:EE_
X-MS-Office365-Filtering-Correlation-Id: d87fad3d-8db1-4aaa-748d-08dcb2ecb84e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|376014|82310400026|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?84Owe0XAVjygxau687Y59fsulKs4bBUFWs+Np4wIWqQIU8g1AIQowdmEAhrL?=
 =?us-ascii?Q?IDj3hh42PTWg8zkGoHgP64K+3CD+oeDG1cu0vY/4UgN29EZc4pD+FAD7dhyh?=
 =?us-ascii?Q?PoxAi4TL6hcUr1TfW+yl3I954Xxcpv4k3uUGxqc+bdiHBVrEqFl5I2uK2taH?=
 =?us-ascii?Q?BF6c5B0YKCRL7Erodl8puc3kux3qTmSZ1TLL9SDBN3gKqEil5xJto1eQh5um?=
 =?us-ascii?Q?JMS59KFVS5IK5mM+u+hTe8T/QJTsMYS5iqonLFxqDOsLcU1mZv1l3suISHiY?=
 =?us-ascii?Q?XpVgemyGEk8BPYUSQZ8sQX8R1jsjSrGCLhw9PoQ7TIiGVunCkrae23I8wiSu?=
 =?us-ascii?Q?VN4ZpSxmjBejXAEqZoD/wdjB7eCxMDz8ibbU0tFBFg5LYDX0cTlpmMxnESwt?=
 =?us-ascii?Q?YQtPTI3I1IiTUF8Ey/7Mucu8Eo+TbWO4Lyusb/mA99h3z5WyfWfR7lZCV5XX?=
 =?us-ascii?Q?exAfj8BlfzUHN8bYZkQ63RCHjeWkAqueRdkC9svvRw3egAjbOZ6XxP0PLZvG?=
 =?us-ascii?Q?1N30d36wRIS2MtXTiSgl+ZwcZjxpbKOhV+n+DzIVV3137wVlsEz/Uloa0E/q?=
 =?us-ascii?Q?LPINXNtLOYya4lmfXkXwUWp14PdjRHt5eFiT27aGo4arsIBeWV/X79Yn3cnr?=
 =?us-ascii?Q?0tJfH7wPSP1rkaBQdRTQAQhETGCFYpIwelcqKpNqU3t3nGOFyAh9+MQOxih9?=
 =?us-ascii?Q?hba1RDozIqcC8Ws5Q6cvenCsGOItaSm3QmtIM3BaP9ByJWEXxFc+q+3vuSSB?=
 =?us-ascii?Q?thWQOxkZ2WV6AXPpfnus8vmUdh/YFcYSDC/Dl6JM5kPw6nULDzYqvD9PFgcY?=
 =?us-ascii?Q?0uuI6Up9euqV6taPzggbF4DuDkjzMjOp/+N0TIr9+/rqOqarx6dG9NhEiIGr?=
 =?us-ascii?Q?+jIgmzsMSusKrmtRF47nq13NULjI+qM28zqno/ZAisgpWH7IvcY423Sglqox?=
 =?us-ascii?Q?rrva2RFo2LVybFJBCHpipNSSNlQ1ygulcCPzO2xCMZg2gVQiH8bwGeiitkRM?=
 =?us-ascii?Q?K1GVYGmaXSNg9xGexZNxV9cuVJXx+T6vNMVeX386BLLwjKcvOwdBs+cnNyws?=
 =?us-ascii?Q?LIumll7zKHVKid+FeockCT8DR3Rbv5NwHPsfU7vPKdQIfQGLnwK0RnY7b786?=
 =?us-ascii?Q?3eYHGl0nIUxvMx9YUlCnULesXJt2aH72Bhx2LSqWso2lpPaUAFQIhzBIWswx?=
 =?us-ascii?Q?0BIcmisNltq2l4xOiBW6idmqaV/xl+xE9ans0rSmndno4cy4ix3ADwmcfeYn?=
 =?us-ascii?Q?9S2L6Bqvso3JFlMdhiVF8XyCg0XN7OfOmZKg1mJg2pOvlUz99rnFgn2FPDfg?=
 =?us-ascii?Q?jxiDZ6+28u4nmdUu73lF7UbySbgdD8KxdCzkijnTdWvhVzMa0KQGvKYKM/VY?=
 =?us-ascii?Q?yIc3On+a3uL5Zz5Ypi1E5PiGhI3X?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(82310400026)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 12:14:55.1286
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d87fad3d-8db1-4aaa-748d-08dcb2ecb84e
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000075EF.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6897

Hi,

In https://patchew.org/Xen/20231116145032.1651305-1-Henry.Wang@arm.com/, Henry has
reorganized some of the code between the MMU specific and generic files.

In this patch serie, we address the remaining code reorg so that MMU specific
code is cleanly separated and we have added stubs wherever necessary to avoid
introducing if-def.

Ayan Kumar Halder (4):
  xen: arm: Add an empty stub for update_identity_mapping()
  xen: arm: make VMAP only support in MMU system
  xen: arm: Move the functions of domain_page to MMU specific
  xen: arm: Enclose access to EL2 MMU specific registers under
    CONFIG_MMU

 xen/arch/arm/Kconfig                |   6 +-
 xen/arch/arm/Makefile               |   2 +-
 xen/arch/arm/domain_page.c          | 161 +----------------------
 xen/arch/arm/include/asm/arm32/mm.h |  12 ++
 xen/arch/arm/include/asm/arm64/mm.h |   6 +
 xen/arch/arm/mmu/Makefile           |   1 +
 xen/arch/arm/mmu/domain_page.c      | 194 ++++++++++++++++++++++++++++
 xen/arch/arm/setup.c                |   4 +
 xen/arch/arm/smpboot.c              |   2 +
 xen/arch/arm/traps.c                |   6 +-
 xen/include/xen/vmap.h              |   6 +
 11 files changed, 242 insertions(+), 158 deletions(-)
 create mode 100644 xen/arch/arm/mmu/domain_page.c

-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 12:15:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 12:15:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771053.1181630 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrBZ-0002u8-Ms; Fri, 02 Aug 2024 12:15:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771053.1181630; Fri, 02 Aug 2024 12:15:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrBZ-0002sI-Ht; Fri, 02 Aug 2024 12:15:05 +0000
Received: by outflank-mailman (input) for mailman id 771053;
 Fri, 02 Aug 2024 12:15:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sjRO=PB=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sZrBY-0002qg-PP
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 12:15:04 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on2062c.outbound.protection.outlook.com
 [2a01:111:f403:2412::62c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d851c910-50c8-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 14:15:03 +0200 (CEST)
Received: from SJ0PR05CA0158.namprd05.prod.outlook.com (2603:10b6:a03:339::13)
 by CY8PR12MB7490.namprd12.prod.outlook.com (2603:10b6:930:91::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21; Fri, 2 Aug
 2024 12:15:00 +0000
Received: from CO1PEPF000075ED.namprd03.prod.outlook.com
 (2603:10b6:a03:339:cafe::a0) by SJ0PR05CA0158.outlook.office365.com
 (2603:10b6:a03:339::13) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.7 via Frontend
 Transport; Fri, 2 Aug 2024 12:14:59 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1PEPF000075ED.mail.protection.outlook.com (10.167.249.36) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Fri, 2 Aug 2024 12:14:59 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 2 Aug
 2024 07:14:58 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Fri, 2 Aug 2024 07:14:57 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d851c910-50c8-11ef-bc03-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=KdVhNL8i0aqkMGAD75hA8z8aEZGs3/ynFmkimqNcwm1EkbpjV2jRJLC/4NfR22yQuV3zn8Bw/LudSMBYGIQf1Q2boEj1PxGyEYubC41867Khlj4EHkhqYawiNfoTRC7QnxJ0mAaStCPo/WpUAvraep2QL93TbEjrvLPVucDFSbKk5wuOoB0W732gKk1L1/BovzvtbT8JiAEYiFeCdFD11esF3k5i48kf6EAwCzjO0bLNdZXwns5sIjdnUSToOQF5MPRdpQHHrLyUVMMwFRhOL+e8336SKko8J79+IOldrPPLAsTFH7NOCh6DKOD86EpzsYZZm6gAg6V1YUKSKmgzKQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=XbeaJd8GtmoVpwkrWBrV6r0T4S0kHTIYvztCQ94vIfY=;
 b=QdpPD0RkyWYSCU0ZwniiqStn0WmvqMCIkVmdLTJ707fv3smjtsJ4xS5IAhyjxRwOz8ULa/jmLJS3wIL4B3uGYGxM/NmpJJedXHd12aFidAMIPVA/SQd9caVny/bz1Frcj69KmKX92On8em4x7gBxregiwxrIPCSQtACrPyc7IqwBQGl6facvjWdnLjkrnoKQWldA9cFbNQ3VJ0scm7Vz3YTHBRWcdzaeD4OHTmU2lxjMKROmOHctQbhsZkf8gDeXN2fYKe7Qx93+Lv5ZOeayN0fVGWX8JVb0m8PqEgfiQcirmP/OfMZAA26vRaYHmSPdsxbTj4xZ8DQL8Sazuglo+Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XbeaJd8GtmoVpwkrWBrV6r0T4S0kHTIYvztCQ94vIfY=;
 b=0Vm5//ZoB72pBBoszV4+sR8a8RIsljr87+fG5V2nZso6x/YEOYugiU1ukDYj8lYe+1bAB2QpXO+30bry9srN05WgZekhJ3r03bayIV8vrA6tPeaGWNG9CNs6M3VNtLBhlfBVCz43A/w/bd+wuT+OEW8hfMkbOCAB8fL888Ezdjg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<Volodymyr_Babchuk@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v1 1/4] xen: arm: Add an empty stub for update_identity_mapping()
Date: Fri, 2 Aug 2024 13:14:40 +0100
Message-ID: <20240802121443.1531693-2-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
References: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB04.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000075ED:EE_|CY8PR12MB7490:EE_
X-MS-Office365-Filtering-Correlation-Id: 7474f087-44d5-4db6-03cf-08dcb2ecbada
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?hEqxY7WTBg8wQv/L0BJKuMNUJQLJNZ8Y6F/1+p77RvqWs8Xt3mUOIvloYueP?=
 =?us-ascii?Q?w+V+uUWhcsSwCuCV9OAo6BuIGnOeLoNRymvMlJtzvRrM9wuV7Ng+D3376k8u?=
 =?us-ascii?Q?2FjuN7pwGkJhWYe7zpXUQ+WLz24RGs+Kcw8QC+J4Nj0p+cZPZHGQSgZHD8W1?=
 =?us-ascii?Q?JlOzh1TZDeIqySOC3TUVwacUqVZA1mpmMOwazzlApZ4H0Ggx4kjMgS6RTvHi?=
 =?us-ascii?Q?vmCS9pPHLUM57V0EHIkaS1bxx+X6KTIstoad4a2H9HFL01YoWNOqSczcPNU1?=
 =?us-ascii?Q?g+n/PgR08C2DbEzd1uYTUBdV328XNWDz01iVUHy/L9R7ZMAGpq80UDbpYlGo?=
 =?us-ascii?Q?EVmAl7+PL7lYM3G+2bju+VxBCDZ1eOsjzgnTG7yjwX49sjmq34BnfkzYuy6X?=
 =?us-ascii?Q?bbrh/BaRLfKm3dDrOFHHdQVxvbYF2T1IB0nYCNQJ7siS0Us6o6AQvI+4CciG?=
 =?us-ascii?Q?fZzlbXqPCtWMu9fFsGQJWhqr9S+b7bvL4/AEsCyC6vlKFUDRJl/zoCm7+1Kq?=
 =?us-ascii?Q?Rtdkmw3HtGc0dX11oocrZM8uZJqgYlUovtNDnne6waRur74S8YpxT8+ltY1u?=
 =?us-ascii?Q?AZBtkgZcynWxz/5ROnzxBwMFhLnikcEV/SyTA8hOD/GcdEtYD7uxujhoXvMK?=
 =?us-ascii?Q?CU6jl8ZNg8DGhxP7nKQXDpimigfhyhOCibHaAknRYnx5p7WhTj9zTtKFUybv?=
 =?us-ascii?Q?oAbCFOXki/1i7pp4RQVwBWm8nxOz/1Y9TYpxgiS7YPSJMc8Ixi+nS68ONqIF?=
 =?us-ascii?Q?fXrGRlzmpU7m+uUraavc4GDtJczrDcAK2usalR6okL/vKcOJ8z05frRU0evu?=
 =?us-ascii?Q?LzNQXkG4f32l7lIwDKXCn5dq1lo42owmZbnSls+CSRG3tVC1AcZlWWhyMxEB?=
 =?us-ascii?Q?K7G3DRNdN2h4micUuYTjgXSo89Ux196tc+HbUd9jRs1jnCTDZ56sSd4dBrKC?=
 =?us-ascii?Q?af87M72OwJ3W/YzWVFqzw4kIyhQT8L80DZhUxqpXcD0RHnr1X+89jGzoBnul?=
 =?us-ascii?Q?nHdeYjjxFtMxyrn7yT/iV9rLidi1Yt78w85Fg+SVO9tIgpPH9irTqq0KeiLc?=
 =?us-ascii?Q?M4mvtukGXOL77ShpwWiQ2cb1aIPCmhfwYAg3n6/5ICGzkAnY0WgzKpwuxX9j?=
 =?us-ascii?Q?VhcVCptoISA3pWF0LQb64N9Tbpahjv7boTD5ulJ8RaOJC1isQJU/p7mszyFt?=
 =?us-ascii?Q?+oQqchqdipayR3IuryczWiuMu2RSRzBgSvIlsz0dOEpCg/Ngv/BMwwMGThgB?=
 =?us-ascii?Q?+4xOK945gHawn+MO2UTvA+eGoX1ObxbCnOg1caVTHB+//djNXxDsh2UG9rfn?=
 =?us-ascii?Q?VOZxpQgpPEyqmyugNn+J+d6fJ3I2SjveLL+8vGkJkLlOtPihI/oHp9Vudouq?=
 =?us-ascii?Q?l1qVMo3ZNlhtkrkEl0bQqlM6CEnDJqCoKWJs893K+6oiIoNIsuJrpKSkAAUw?=
 =?us-ascii?Q?EqqIlSSuOwFfTGXio0ikvv462erBUhDq?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 12:14:59.3987
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 7474f087-44d5-4db6-03cf-08dcb2ecbada
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000075ED.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7490

This is in continuation to commit
f661a20aa880: "Extract MMU-specific MM code".

update_identity_mapping() is defined for MMU specific logic.
It is invoked from smpboot.c. Thus, we add an empty stub to avoid
if-defery.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
 xen/arch/arm/include/asm/arm64/mm.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/arch/arm/include/asm/arm64/mm.h b/xen/arch/arm/include/asm/arm64/mm.h
index e0bd23a6ed..f595205fa3 100644
--- a/xen/arch/arm/include/asm/arm64/mm.h
+++ b/xen/arch/arm/include/asm/arm64/mm.h
@@ -14,6 +14,7 @@ static inline bool arch_mfns_in_directmap(unsigned long mfn, unsigned long nr)
 
 void arch_setup_page_tables(void);
 
+#ifdef CONFIG_MMU
 /*
  * Enable/disable the identity mapping in the live page-tables (i.e.
  * the one pointed by TTBR_EL2).
@@ -22,6 +23,11 @@ void arch_setup_page_tables(void);
  * supported.
  */
 void update_identity_mapping(bool enable);
+#else /* CONFIG_MMU */
+static inline void update_identity_mapping(bool enable)
+{
+}
+#endif /* CONFIG_MMU */
 
 #endif /* __ARM_ARM64_MM_H__ */
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 12:15:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 12:15:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771054.1181646 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrBg-0003NN-TM; Fri, 02 Aug 2024 12:15:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771054.1181646; Fri, 02 Aug 2024 12:15:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrBg-0003ND-Qj; Fri, 02 Aug 2024 12:15:12 +0000
Received: by outflank-mailman (input) for mailman id 771054;
 Fri, 02 Aug 2024 12:15:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sjRO=PB=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sZrBf-0002qg-7n
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 12:15:11 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on20625.outbound.protection.outlook.com
 [2a01:111:f403:2412::625])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dd1c7229-50c8-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 14:15:10 +0200 (CEST)
Received: from PH7P220CA0072.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:32c::31)
 by PH0PR12MB7485.namprd12.prod.outlook.com (2603:10b6:510:1e9::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22; Fri, 2 Aug
 2024 12:15:06 +0000
Received: from CY4PEPF0000E9CF.namprd03.prod.outlook.com
 (2603:10b6:510:32c:cafe::51) by PH7P220CA0072.outlook.office365.com
 (2603:10b6:510:32c::31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend
 Transport; Fri, 2 Aug 2024 12:15:03 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CY4PEPF0000E9CF.mail.protection.outlook.com (10.167.241.134) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Fri, 2 Aug 2024 12:15:02 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 2 Aug
 2024 07:15:01 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Fri, 2 Aug 2024 07:15:00 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dd1c7229-50c8-11ef-bc03-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=UKrWA47OVwAZllrifdvyN+cgcSIDqdM1MG5hepUF9ujI2nffKoMNvzW5tVDz3KTpfndkhNj/9ftZ/PK0eKGv5QZREpTAJ54cVuspoyVGZ2/sLHsDnaPxxsLOeWiXijSfmrg3j8+DLr66d0/pxkZ+C+qUzUPnt7TAYRe1PLRmvNdZUtGQFKDi19Ul/ETadMnx9rx7lhOVxW73nroeqFrZInqXOLwfJcg/XXgpwcktGZxTgxwvgtqg10sd2Hpa/bxrJF8ngC83W6EAR2PEUc/Un4/OVyAEwcdy/0umRKmo+tzac0O7QZ6sSd4PwTD3JujrkszC+ydVSVF6v4NkxniG4g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=rcvevutIA8wF3Pys0d5aki/QrgNfXYtD6SWLs8zRKls=;
 b=s5Ci7QnURzu2TDqqaDr1RrFfgjmrZ9xIerqJbMEEBS9OOLA1rN8lw3s4cywh7UnV+sR9lPTUe7J6puKVb7YPa58od76QczKiNcrm5BMqOLcdc5ZbGZu3Nd+vVFFJ+uGOuOn+CzcVBq/gAUhk72kuEzCIHXzgB1rcSoUKUgjsVeo3A27c4rt++ewmFPEX5A903JBZJZ/d7Y6LWqj4QjNmpsPqov5UeYQ7cc1FxRmkYHigT8GYTYcMDQYOI/rMa96onn9flL7YEZou+XsO0aMhBTR5r6delas4vS4ow5wPNjHAZxuYx8zRu1XxyilEvCU+FrD0spZWRLWHtsXzi6i5bw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=rcvevutIA8wF3Pys0d5aki/QrgNfXYtD6SWLs8zRKls=;
 b=Vyj+iQVOPo/EgVYaK1RF0sf++A6GxKxq+5zhg3p8MWl0JwvdLRzpHFYFR4jd68O3RFc6swodpoDM6KuzpO63LzViKD4aVEQVIRojUzLk+fJDMNj8IKLvzrhyz+ZnBJkwlvpBpQc/qUSc4w/BDwN5GKBsoFXJ+OOYraQBqindlN8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<Volodymyr_Babchuk@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>, Penny Zheng <penny.zheng@arm.com>, "Wei
 Chen" <wei.chen@arm.com>
Subject: [PATCH v1 2/4] xen: arm: make VMAP only support in MMU system
Date: Fri, 2 Aug 2024 13:14:41 +0100
Message-ID: <20240802121443.1531693-3-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
References: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB03.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9CF:EE_|PH0PR12MB7485:EE_
X-MS-Office365-Filtering-Correlation-Id: 35ae0cc8-dca4-4418-a24e-08dcb2ecbcd5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?GFXWBsM7TeZL3KJ6/PAvM3bzy4UIo8R7A1yMUPyi1MhFPdvxRCO4etI0haQI?=
 =?us-ascii?Q?R4bSLXAUYy1Lc4WGDoVUJfq/A1BNLylRUYFTocYL7jWwqC71BoSK83iYHdS3?=
 =?us-ascii?Q?y8eFuO7J7/YKVIt+OLU8PxKoUhntEmKLVVLiscZ38Dh4giooT7RZT9AttzlN?=
 =?us-ascii?Q?benvv1lTR5rK4APKSYeLaQxLmXFNN4yjwjKYh72Nm/u2C8QVqG0QhtGX6iKW?=
 =?us-ascii?Q?iYxzOcM7LpD2R2PFWJw0FqKtV62+uPswx0Xc3RBFXZ6lzIZ1uPcS6thnuQ0l?=
 =?us-ascii?Q?H4aXnZ5i8eGYHcQMLJiU8BUQv6FcomkD/vc28sMfCScvEQOcQj7D4UZTKpNI?=
 =?us-ascii?Q?+colwOfBCoGTBx6f/srbY4Gh1vpxlZZpjh1GyvMGv79zOSmRFBugIZaihCHj?=
 =?us-ascii?Q?I1IXu6zObTwWBCXpQo7oKdF10THJ10VQ73LUy8T8qWnTSjPPgG96pea5OJKY?=
 =?us-ascii?Q?3BHjczxTT+F14maOamTRW+R6XS2hGPbO9APlh+bCJcwcj586uGSkRvqeQ22I?=
 =?us-ascii?Q?TyTQv2HUili/djqz6Vw1Ou1utXEOQ8tiOg7hkwUwcVW23zJ12p0ZSm7nU7AZ?=
 =?us-ascii?Q?3ZKPxVw2a/kadj8Vbv6MLFBruDS3AosOPJ/f7eSlzqEGhfg8qQR15/kw2xch?=
 =?us-ascii?Q?RR6WlpqfGcMLjdd4Br2nxmTrFLKIsC/3djiGwKaNDbWcJgsecwjLxf08d4A0?=
 =?us-ascii?Q?VBYLbeMX0BopUPwfeyA6J1hIbLgjJQX3K+SLvQMw6L2znDysLUcP7a6ZtrvH?=
 =?us-ascii?Q?CDWT0D4MpzWQKapgWKya3dXEfkeiiJO4wSOlGrUcrsvk76aLzlQpl2C27dwM?=
 =?us-ascii?Q?35qWrUSwMzFkf09XJtZsbeKOpbJ86TPuM48pk2Gbks82Gvd1Iv2/OI2dHAuf?=
 =?us-ascii?Q?MlWuEznx2WluZnDLbYW7o6CZMgu1tSThZ0t+NBGZPuMHo/dL9tA7Z73rz/c1?=
 =?us-ascii?Q?mJML+223stvz+CGt1ETNnSXHmXsK37fI3frpfBlrm73h01m2UtKi66TOdALI?=
 =?us-ascii?Q?7diC0dizI1UlqtL/EmJTXJENfbHYs7gm5ThSXLbjC1+b2Wa7rr2+zti+3eG6?=
 =?us-ascii?Q?M1tl/S7vmCV2a3uCMbQSTsCRzv90qSpsGaGqgGyjdgDpbs69Sf18dVtDGwEe?=
 =?us-ascii?Q?+Y1Psf9zISm/txWB5aqcafTzAsE1VXGDXLZ+48eI3HCICkJ4QtlsMQmhAL1O?=
 =?us-ascii?Q?mR1JGsxm24HXySyTo2CNPl1lA4MnjveMlJlfU8gopK/ufgp+8D28eD6WmFPg?=
 =?us-ascii?Q?e2Chcm8VM5aVuRYupggh0NH/Uv+Bpqmo/iShrCOpqLbhB6mtixIBwkFBaS6Z?=
 =?us-ascii?Q?f01fFsQrVi62hWUb+qa9nKCVKDBF+OyURIrYJrXYxmu90SMQTvLYSld5p2xy?=
 =?us-ascii?Q?udb1xxtzFgosx5eUzBxrYRacltFrHrUP3kXy2dHAmDRR14vsfg=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 12:15:02.8036
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 35ae0cc8-dca4-4418-a24e-08dcb2ecbcd5
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000E9CF.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7485

From: Penny Zheng <penny.zheng@arm.com>

VMAP is widely used in ALTERNATIVE feature, CPUERRATA feature, etc to
remap a range of memory with new memory attributes. Since this is
highly dependent on virtual address translation, we choose to fold VMAP
in MMU system.

In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
only support in MMU system on ARM architecture. And we make features
like ALTERNATIVE, CPUERRATA, etc, now depend on VMAP.

Split "https://patchwork.kernel.org/project/xen-devel/patch/20230626033443.2943270-16-Penny.Zheng@arm.com/"
into Arm specific

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Signed-off-by: Wei Chen <wei.chen@arm.com>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
 xen/arch/arm/Kconfig   | 6 +++++-
 xen/arch/arm/Makefile  | 2 +-
 xen/arch/arm/setup.c   | 4 ++++
 xen/arch/arm/smpboot.c | 2 ++
 xen/include/xen/vmap.h | 6 ++++++
 5 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 21d03d9f44..c8d417298c 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -12,7 +12,7 @@ config ARM_64
 config ARM
 	def_bool y
 	select FUNCTION_ALIGNMENT_4B
-	select HAS_ALTERNATIVE
+	select HAS_ALTERNATIVE if HAS_VMAP
 	select HAS_DEVICE_TREE
 	select HAS_PASSTHROUGH
 	select HAS_UBSAN
@@ -58,9 +58,13 @@ config PADDR_BITS
 	default 40 if ARM_PA_BITS_40
 	default 48 if ARM_64
 
+config HAS_VMAP
+	def_bool y
+
 config MMU
 	def_bool y
 	select HAS_PMAP
+	select HAS_VMAP
 
 source "arch/Kconfig"
 
diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 45dc29ea53..6882814d38 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -11,7 +11,7 @@ obj-$(CONFIG_HAS_VPCI) += vpci.o
 
 obj-$(CONFIG_HAS_ALTERNATIVE) += alternative.o
 obj-y += bootfdt.init.o
-obj-y += cpuerrata.o
+obj-$(CONFIG_HAS_VMAP) += cpuerrata.o
 obj-y += cpufeature.o
 obj-y += decode.o
 obj-y += device.o
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 0c2fdaceaf..9d34ac7f64 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -804,11 +804,13 @@ void asmlinkage __init start_xen(unsigned long boot_phys_offset,
     nr_cpu_ids = smp_get_max_cpus();
     printk(XENLOG_INFO "SMP: Allowing %u CPUs\n", nr_cpu_ids);
 
+#ifdef CONFIG_HAS_VMAP
     /*
      * Some errata relies on SMCCC version which is detected by psci_init()
      * (called from smp_init_cpus()).
      */
     check_local_cpu_errata();
+#endif
 
     check_local_cpu_features();
 
@@ -879,8 +881,10 @@ void asmlinkage __init start_xen(unsigned long boot_phys_offset,
      * It needs to be called after do_initcalls to be able to use
      * stop_machine (tasklets initialized via an initcall).
      */
+#ifdef CONFIG_HAS_VMAP
     apply_alternatives_all();
     enable_errata_workarounds();
+#endif
     enable_cpu_features();
 
     /* Create initial domain 0. */
diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c
index 04e363088d..999afc028e 100644
--- a/xen/arch/arm/smpboot.c
+++ b/xen/arch/arm/smpboot.c
@@ -406,7 +406,9 @@ void asmlinkage start_secondary(void)
 
     local_abort_enable();
 
+#ifdef CONFIG_HAS_VMAP
     check_local_cpu_errata();
+#endif
     check_local_cpu_features();
 
     printk(XENLOG_DEBUG "CPU %u booted.\n", smp_processor_id());
diff --git a/xen/include/xen/vmap.h b/xen/include/xen/vmap.h
index fdae37e950..84797acfc0 100644
--- a/xen/include/xen/vmap.h
+++ b/xen/include/xen/vmap.h
@@ -138,10 +138,16 @@ static inline void iounmap(void __iomem *va)
 /* Pointer to 1 octet past the end of the VMAP_DEFAULT virtual area */
 void *arch_vmap_virt_end(void);
 
+#ifdef CONFIG_MMU
 /* Initialises the VMAP_DEFAULT virtual range */
 static inline void vm_init(void)
 {
     vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end());
 }
+#else
+static inline void vm_init(void)
+{
+}
+#endif
 
 #endif /* __XEN_VMAP_H__ */
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 12:15:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 12:15:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771055.1181656 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrBk-0003f4-7M; Fri, 02 Aug 2024 12:15:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771055.1181656; Fri, 02 Aug 2024 12:15:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrBk-0003eo-4N; Fri, 02 Aug 2024 12:15:16 +0000
Received: by outflank-mailman (input) for mailman id 771055;
 Fri, 02 Aug 2024 12:15: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=sjRO=PB=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sZrBi-0002qg-Kc
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 12:15:14 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on20601.outbound.protection.outlook.com
 [2a01:111:f403:2415::601])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id de730912-50c8-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 14:15:13 +0200 (CEST)
Received: from SJ0PR05CA0157.namprd05.prod.outlook.com (2603:10b6:a03:339::12)
 by SJ0PR12MB8137.namprd12.prod.outlook.com (2603:10b6:a03:4e5::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23; Fri, 2 Aug
 2024 12:15:07 +0000
Received: from CO1PEPF000075ED.namprd03.prod.outlook.com
 (2603:10b6:a03:339:cafe::ef) by SJ0PR05CA0157.outlook.office365.com
 (2603:10b6:a03:339::12) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.7 via Frontend
 Transport; Fri, 2 Aug 2024 12:15:07 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1PEPF000075ED.mail.protection.outlook.com (10.167.249.36) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Fri, 2 Aug 2024 12:15:07 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 2 Aug
 2024 07:15:04 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 2 Aug
 2024 07:15:04 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Fri, 2 Aug 2024 07:15:03 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: de730912-50c8-11ef-bc03-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=iiJ7Ah8zot/lWpKDaXDyPsuuotS1d25NWhcgZ/SE83f4FnJqA5Os5RYcK6GUrrJkPjG3rs1F4iA1C9Za+lN4amckByprWSC8Ouc3x0pdPA4dR623zFkUtRp7w/UjXsFQbMVokL3jJPMZOiz/Bx1uLZd7yTvuQfOZXjxcWvT9c6/Dn/+jgxOecmGpObioOzNgMwQn5JDlni2gM3QHmeEb+dV5F394tajrixP5lwAdXU5WIKoBxTCIV45m4v2BoYKjXyp+ZtvLdggaWd1A4ky2ZMd2K3E30e3sORL8aEvgJTd+DDkj5MgO7Bniw9wPx0Yrd88pdq4OJYXwEW8zEM9txw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+gbu1SZsMqv/ljlaxlr9Do4f1so8bAzCrex0cdS+Y3s=;
 b=HULiGt1uOXFTN2osiiLymB3qictP7CpeZZ8P3AmaRQ9gTHlNySGZPJ0PdJq1o/D2Pl/4Nduk9vpLzMuU945jBamkotju2KC3bJ6QHiH9z/5of+Ba6fc9Ue1MyDSP5gAvZw1+xQGSdMuAoeNWOgGtX/TgfkjMjp9YcN5/UcRWNs01WCzZ9GDPXcKd/U7PwKFA9xWDjqzPlRKGdu9Ia1klDKQPh+MqPFIS/Jj/XSNYDg88HO0fyL2LRcG1DqO7bWMRt1cPOGn2nAdWe2s2krk5WWEnXcvf5fBdN+AO+qdtOnrd1aGoE81nn6XsHNTj/1ShcJYpAmB6Dt3nMhE7w+Xm9w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+gbu1SZsMqv/ljlaxlr9Do4f1so8bAzCrex0cdS+Y3s=;
 b=WYSA9f0+ghKLxiELIgJkCDvhRs7RBlteRkPv4jQJe3FyhPI/1fqCZk2cMCoYAYr+cswdhfYPtFDPIFMeMZ/w3QMLwxmILtdGtJVyv9Okq4SIGRWJv5LRMqCvQ/CE4hMJSGbKjzFtiwFt5HHnqxIEBpNcEhSHtWzrZsOLa17mGWI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<Volodymyr_Babchuk@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v1 3/4] xen: arm: Move the functions of domain_page to MMU specific
Date: Fri, 2 Aug 2024 13:14:42 +0100
Message-ID: <20240802121443.1531693-4-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
References: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000075ED:EE_|SJ0PR12MB8137:EE_
X-MS-Office365-Filtering-Correlation-Id: 02ff3655-c8a5-47f4-54a3-08dcb2ecbf9c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?bf0omMeu0YGuOTyHs4dIxcJJpWyNeqWwsrtvv9jnuiFOLduVMwaICwqhLese?=
 =?us-ascii?Q?9pploC+Lt8zcrP0ZFdY2oNVFDELtBWecaj2QMtsOhoPx0lMsDNhcPaw2kG7Z?=
 =?us-ascii?Q?Tys7GFPoLsW18D7JmH+NM2cJfJ9kAMrO148w+TADynM3GbDLxp+gHelCzMCV?=
 =?us-ascii?Q?qG3MiX/gJJPlSoXT7f5PkSSOBCyl2iF39X0z1vu/YiVK1dg0qGuPghhA9KBw?=
 =?us-ascii?Q?x0L48SKBSlz5sAv7J+jD7WpK1MlZ3WQ+8+Hc4bKke2kh4y29XCT11TUnQDiI?=
 =?us-ascii?Q?cQkF5dhIpUb7Yfkbu7o7vmiqai7aAs2Qu7yCaMmEJPrKuwPdKzNC5jRDkq+/?=
 =?us-ascii?Q?PrlVsC9T2UrlYpg+wwjYW1n45IcgKBlzHYpUDi8ddCmMkS7l9tBr7goUQeOw?=
 =?us-ascii?Q?uc93j74DsjsRMYJAUOOjM3hIGD8iQHeDD9aKDWlekrCf8+FfsGgxG+kd9G8P?=
 =?us-ascii?Q?Df/3I0ICOajRbVMlOeL8uTPOT65KR1CQxdqn1FqUtpXU0dwYbCQE9pL8WxjM?=
 =?us-ascii?Q?i5z6m3HWeD89KUGyDNNWN2ULtLOZ0jJK77HnGvH++qpTaFC1tkTlodNypWya?=
 =?us-ascii?Q?nXNREs6USMtSNYIfoplylJWbCZN1D2ZcgWJxQT4SbptKCwfElnLUerk9ybmH?=
 =?us-ascii?Q?chKUr3k4JVD2YZQWOsKGU484Ico8sIILooEXPGsz4mwT4SHwticKURC97ZvN?=
 =?us-ascii?Q?lo4QcP5aLLBTKdS2OJPit+AIg3M0bBx8k+jvYO+WTziCd3QoR8U52SjG4/D3?=
 =?us-ascii?Q?Ixf71JHvC4ESW+dON/Q2OgnbB9h0iGhVA/9fjzIgkMG+thDkSzDGkHm6lz6H?=
 =?us-ascii?Q?Sqm0JhVe+EGTNu0WL2dCdnn/SZ+RaDN/j4idREtzwPVo0kljNoDDQuFN7qDg?=
 =?us-ascii?Q?Z1etgwAgwlzNwIWfSIpWwMKIeZoRs9hwp1BUAstaZiYLpBUIB4/EbGeAR40g?=
 =?us-ascii?Q?LYEdTzY/DJ7w6S0/gj9zU6S+Yx1VnufTy5nuBgPGC9D0EgqLEZZe6zZpvu7k?=
 =?us-ascii?Q?xa0IHO+EQI0aRe/ep70+enDPSPIBdEaJUS8Q9ceR1J/1GIUCuzikn9ApTfpN?=
 =?us-ascii?Q?JlJrRPnTohgDjaj3JwEnmwyx3bivau2TvESP0r2sNL6ZyRzZN+fCiSrrl6++?=
 =?us-ascii?Q?TU1PS6KrzcQFIy1MSLCrzEY//tXikEKcsPAI2k//bHbKL39O7bULXlIxRXPG?=
 =?us-ascii?Q?tOC2tCHBmCC433ZvqiiuHglaIQR9SAkpGYkir8Fr/7SGVSm/M5feXjlP85hP?=
 =?us-ascii?Q?lX7CqGX/+TX8RO+Kdyp6tAmQ4xW3FzxE4IbrtAe3SCMC+5317ynJi5GjbLWe?=
 =?us-ascii?Q?KVBVW6DxazXOI4EgiXECPDX2wFHgVM7mKBTiUIayBiYBQHOFo9NGjFW/PJ9V?=
 =?us-ascii?Q?EevpLbkSsJ99dVZrW9VQmUqnpHPYzd810eJXNAENd+emn2ulRKHSNU+Mfv03?=
 =?us-ascii?Q?aoFhmZu1riE=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 12:15:07.3987
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 02ff3655-c8a5-47f4-54a3-08dcb2ecbf9c
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000075ED.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB8137

Moved init_domheap_mappings(), map_domain_page_global(),
unmap_domain_page_global(), map_domain_page(), unmap_domain_page(),
domain_page_map_to_mfn() to MMU specific folder.

On the top level, we have added stubs which will invoke the
MMU specific equivalent of these functions.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
 xen/arch/arm/domain_page.c          | 161 +----------------------
 xen/arch/arm/include/asm/arm32/mm.h |  12 ++
 xen/arch/arm/mmu/Makefile           |   1 +
 xen/arch/arm/mmu/domain_page.c      | 194 ++++++++++++++++++++++++++++
 4 files changed, 213 insertions(+), 155 deletions(-)
 create mode 100644 xen/arch/arm/mmu/domain_page.c

diff --git a/xen/arch/arm/domain_page.c b/xen/arch/arm/domain_page.c
index 3a43601623..49fe551d84 100644
--- a/xen/arch/arm/domain_page.c
+++ b/xen/arch/arm/domain_page.c
@@ -3,185 +3,36 @@
 #include <xen/pmap.h>
 #include <xen/vmap.h>
 
-/* Override macros from asm/page.h to make them work with mfn_t */
-#undef virt_to_mfn
-#define virt_to_mfn(va) _mfn(__virt_to_mfn(va))
-
-/* cpu0's domheap page tables */
-static DEFINE_PAGE_TABLES(cpu0_dommap, DOMHEAP_SECOND_PAGES);
-
-/*
- * xen_dommap == pages used by map_domain_page, these pages contain
- * the second level pagetables which map the domheap region
- * starting at DOMHEAP_VIRT_START in 2MB chunks.
- */
-static DEFINE_PER_CPU(lpae_t *, xen_dommap);
-
-/*
- * Prepare the area that will be used to map domheap pages. They are
- * mapped in 2MB chunks, so we need to allocate the page-tables up to
- * the 2nd level.
- *
- * The caller should make sure the root page-table for @cpu has been
- * allocated.
- */
 bool init_domheap_mappings(unsigned int cpu)
 {
-    unsigned int order = get_order_from_pages(DOMHEAP_SECOND_PAGES);
-    lpae_t *root = per_cpu(xen_pgtable, cpu);
-    unsigned int i, first_idx;
-    lpae_t *domheap;
-    mfn_t mfn;
-
-    ASSERT(root);
-    ASSERT(!per_cpu(xen_dommap, cpu));
-
-    /*
-     * The domheap for cpu0 is initialized before the heap is initialized.
-     * So we need to use pre-allocated pages.
-     */
-    if ( !cpu )
-        domheap = cpu0_dommap;
-    else
-        domheap = alloc_xenheap_pages(order, 0);
-
-    if ( !domheap )
-        return false;
-
-    /* Ensure the domheap has no stray mappings */
-    memset(domheap, 0, DOMHEAP_SECOND_PAGES * PAGE_SIZE);
-
-    /*
-     * Update the first level mapping to reference the local CPUs
-     * domheap mapping pages.
-     */
-    mfn = virt_to_mfn(domheap);
-    first_idx = first_table_offset(DOMHEAP_VIRT_START);
-    for ( i = 0; i < DOMHEAP_SECOND_PAGES; i++ )
-    {
-        lpae_t pte = mfn_to_xen_entry(mfn_add(mfn, i), MT_NORMAL);
-        pte.pt.table = 1;
-        write_pte(&root[first_idx + i], pte);
-    }
-
-    per_cpu(xen_dommap, cpu) = domheap;
-
-    return true;
+    return init_domheap_mappings_mm(cpu);
 }
 
 void *map_domain_page_global(mfn_t mfn)
 {
-    return vmap(&mfn, 1);
+    return map_domain_page_global_mm(mfn);
 }
 
 void unmap_domain_page_global(const void *ptr)
 {
-    vunmap(ptr);
+    return unmap_domain_page_global_mm(ptr);
 }
 
 /* Map a page of domheap memory */
 void *map_domain_page(mfn_t mfn)
 {
-    unsigned long flags;
-    lpae_t *map = this_cpu(xen_dommap);
-    unsigned long slot_mfn = mfn_x(mfn) & ~XEN_PT_LPAE_ENTRY_MASK;
-    vaddr_t va;
-    lpae_t pte;
-    int i, slot;
-
-    local_irq_save(flags);
-
-    /* The map is laid out as an open-addressed hash table where each
-     * entry is a 2MB superpage pte.  We use the available bits of each
-     * PTE as a reference count; when the refcount is zero the slot can
-     * be reused. */
-    for ( slot = (slot_mfn >> XEN_PT_LPAE_SHIFT) % DOMHEAP_ENTRIES, i = 0;
-          i < DOMHEAP_ENTRIES;
-          slot = (slot + 1) % DOMHEAP_ENTRIES, i++ )
-    {
-        if ( map[slot].pt.avail < 0xf &&
-             map[slot].pt.base == slot_mfn &&
-             map[slot].pt.valid )
-        {
-            /* This slot already points to the right place; reuse it */
-            map[slot].pt.avail++;
-            break;
-        }
-        else if ( map[slot].pt.avail == 0 )
-        {
-            /* Commandeer this 2MB slot */
-            pte = mfn_to_xen_entry(_mfn(slot_mfn), MT_NORMAL);
-            pte.pt.avail = 1;
-            write_pte(map + slot, pte);
-            break;
-        }
-
-    }
-    /* If the map fills up, the callers have misbehaved. */
-    BUG_ON(i == DOMHEAP_ENTRIES);
-
-#ifndef NDEBUG
-    /* Searching the hash could get slow if the map starts filling up.
-     * Cross that bridge when we come to it */
-    {
-        static int max_tries = 32;
-        if ( i >= max_tries )
-        {
-            dprintk(XENLOG_WARNING, "Domheap map is filling: %i tries\n", i);
-            max_tries *= 2;
-        }
-    }
-#endif
-
-    local_irq_restore(flags);
-
-    va = (DOMHEAP_VIRT_START
-          + (slot << SECOND_SHIFT)
-          + ((mfn_x(mfn) & XEN_PT_LPAE_ENTRY_MASK) << THIRD_SHIFT));
-
-    /*
-     * We may not have flushed this specific subpage at map time,
-     * since we only flush the 4k page not the superpage
-     */
-    flush_xen_tlb_range_va_local(va, PAGE_SIZE);
-
-    return (void *)va;
+    return map_domain_page_mm(mfn);
 }
 
 /* Release a mapping taken with map_domain_page() */
 void unmap_domain_page(const void *ptr)
 {
-    unsigned long flags;
-    lpae_t *map = this_cpu(xen_dommap);
-    int slot = ((unsigned long)ptr - DOMHEAP_VIRT_START) >> SECOND_SHIFT;
-
-    if ( !ptr )
-        return;
-
-    local_irq_save(flags);
-
-    ASSERT(slot >= 0 && slot < DOMHEAP_ENTRIES);
-    ASSERT(map[slot].pt.avail != 0);
-
-    map[slot].pt.avail--;
-
-    local_irq_restore(flags);
+    return unmap_domain_page_mm(ptr);
 }
 
 mfn_t domain_page_map_to_mfn(const void *ptr)
 {
-    unsigned long va = (unsigned long)ptr;
-    lpae_t *map = this_cpu(xen_dommap);
-    int slot = (va - DOMHEAP_VIRT_START) >> SECOND_SHIFT;
-    unsigned long offset = (va>>THIRD_SHIFT) & XEN_PT_LPAE_ENTRY_MASK;
-
-    if ( (va >= VMAP_VIRT_START) && ((va - VMAP_VIRT_START) < VMAP_VIRT_SIZE) )
-        return virt_to_mfn(va);
-
-    ASSERT(slot >= 0 && slot < DOMHEAP_ENTRIES);
-    ASSERT(map[slot].pt.avail != 0);
-
-    return mfn_add(lpae_get_mfn(map[slot]), offset);
+    return domain_page_map_to_mfn_mm(ptr);
 }
 
 /*
diff --git a/xen/arch/arm/include/asm/arm32/mm.h b/xen/arch/arm/include/asm/arm32/mm.h
index 856f2dbec4..7cee031f52 100644
--- a/xen/arch/arm/include/asm/arm32/mm.h
+++ b/xen/arch/arm/include/asm/arm32/mm.h
@@ -18,6 +18,18 @@ static inline bool arch_mfns_in_directmap(unsigned long mfn, unsigned long nr)
 
 bool init_domheap_mappings(unsigned int cpu);
 
+bool init_domheap_mappings_mm(unsigned int cpu);
+
+void *map_domain_page_global_mm(mfn_t mfn);
+
+void unmap_domain_page_global_mm(const void *ptr);
+
+void *map_domain_page_mm(mfn_t mfn);
+
+void unmap_domain_page_mm(const void *ptr);
+
+mfn_t domain_page_map_to_mfn_mm(const void *ptr);
+
 static inline void arch_setup_page_tables(void)
 {
 }
diff --git a/xen/arch/arm/mmu/Makefile b/xen/arch/arm/mmu/Makefile
index 67475fcd80..2cb44b857d 100644
--- a/xen/arch/arm/mmu/Makefile
+++ b/xen/arch/arm/mmu/Makefile
@@ -2,3 +2,4 @@ obj-y += p2m.o
 obj-y += pt.o
 obj-y += setup.o
 obj-y += smpboot.o
+obj-$(CONFIG_ARCH_MAP_DOMAIN_PAGE) += domain_page.o
diff --git a/xen/arch/arm/mmu/domain_page.c b/xen/arch/arm/mmu/domain_page.c
new file mode 100644
index 0000000000..af45748ace
--- /dev/null
+++ b/xen/arch/arm/mmu/domain_page.c
@@ -0,0 +1,194 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+#include <xen/mm.h>
+#include <xen/pmap.h>
+#include <xen/vmap.h>
+
+/* Override macros from asm/page.h to make them work with mfn_t */
+#undef virt_to_mfn
+#define virt_to_mfn(va) _mfn(__virt_to_mfn(va))
+
+/* cpu0's domheap page tables */
+static DEFINE_PAGE_TABLES(cpu0_dommap, DOMHEAP_SECOND_PAGES);
+
+/*
+ * xen_dommap == pages used by map_domain_page, these pages contain
+ * the second level pagetables which map the domheap region
+ * starting at DOMHEAP_VIRT_START in 2MB chunks.
+ */
+static DEFINE_PER_CPU(lpae_t *, xen_dommap);
+
+/*
+ * Prepare the area that will be used to map domheap pages. They are
+ * mapped in 2MB chunks, so we need to allocate the page-tables up to
+ * the 2nd level.
+ *
+ * The caller should make sure the root page-table for @cpu has been
+ * allocated.
+ */
+bool init_domheap_mappings_mm(unsigned int cpu)
+{
+    unsigned int order = get_order_from_pages(DOMHEAP_SECOND_PAGES);
+    lpae_t *root = per_cpu(xen_pgtable, cpu);
+    unsigned int i, first_idx;
+    lpae_t *domheap;
+    mfn_t mfn;
+
+    ASSERT(root);
+    ASSERT(!per_cpu(xen_dommap, cpu));
+
+    /*
+     * The domheap for cpu0 is initialized before the heap is initialized.
+     * So we need to use pre-allocated pages.
+     */
+    if ( !cpu )
+        domheap = cpu0_dommap;
+    else
+        domheap = alloc_xenheap_pages(order, 0);
+
+    if ( !domheap )
+        return false;
+
+    /* Ensure the domheap has no stray mappings */
+    memset(domheap, 0, DOMHEAP_SECOND_PAGES * PAGE_SIZE);
+
+    /*
+     * Update the first level mapping to reference the local CPUs
+     * domheap mapping pages.
+     */
+    mfn = virt_to_mfn(domheap);
+    first_idx = first_table_offset(DOMHEAP_VIRT_START);
+    for ( i = 0; i < DOMHEAP_SECOND_PAGES; i++ )
+    {
+        lpae_t pte = mfn_to_xen_entry(mfn_add(mfn, i), MT_NORMAL);
+        pte.pt.table = 1;
+        write_pte(&root[first_idx + i], pte);
+    }
+
+    per_cpu(xen_dommap, cpu) = domheap;
+
+    return true;
+}
+
+void *map_domain_page_global_mm(mfn_t mfn)
+{
+    return vmap(&mfn, 1);
+}
+
+void unmap_domain_page_global_mm(const void *ptr)
+{
+    vunmap(ptr);
+}
+
+/* Map a page of domheap memory */
+void *map_domain_page_mm(mfn_t mfn)
+{
+    unsigned long flags;
+    lpae_t *map = this_cpu(xen_dommap);
+    unsigned long slot_mfn = mfn_x(mfn) & ~XEN_PT_LPAE_ENTRY_MASK;
+    vaddr_t va;
+    lpae_t pte;
+    int i, slot;
+
+    local_irq_save(flags);
+
+    /* The map is laid out as an open-addressed hash table where each
+     * entry is a 2MB superpage pte.  We use the available bits of each
+     * PTE as a reference count; when the refcount is zero the slot can
+     * be reused. */
+    for ( slot = (slot_mfn >> XEN_PT_LPAE_SHIFT) % DOMHEAP_ENTRIES, i = 0;
+          i < DOMHEAP_ENTRIES;
+          slot = (slot + 1) % DOMHEAP_ENTRIES, i++ )
+    {
+        if ( map[slot].pt.avail < 0xf &&
+             map[slot].pt.base == slot_mfn &&
+             map[slot].pt.valid )
+        {
+            /* This slot already points to the right place; reuse it */
+            map[slot].pt.avail++;
+            break;
+        }
+        else if ( map[slot].pt.avail == 0 )
+        {
+            /* Commandeer this 2MB slot */
+            pte = mfn_to_xen_entry(_mfn(slot_mfn), MT_NORMAL);
+            pte.pt.avail = 1;
+            write_pte(map + slot, pte);
+            break;
+        }
+
+    }
+    /* If the map fills up, the callers have misbehaved. */
+    BUG_ON(i == DOMHEAP_ENTRIES);
+
+#ifndef NDEBUG
+    /* Searching the hash could get slow if the map starts filling up.
+     * Cross that bridge when we come to it */
+    {
+        static int max_tries = 32;
+        if ( i >= max_tries )
+        {
+            dprintk(XENLOG_WARNING, "Domheap map is filling: %i tries\n", i);
+            max_tries *= 2;
+        }
+    }
+#endif
+
+    local_irq_restore(flags);
+
+    va = (DOMHEAP_VIRT_START
+          + (slot << SECOND_SHIFT)
+          + ((mfn_x(mfn) & XEN_PT_LPAE_ENTRY_MASK) << THIRD_SHIFT));
+
+    /*
+     * We may not have flushed this specific subpage at map time,
+     * since we only flush the 4k page not the superpage
+     */
+    flush_xen_tlb_range_va_local(va, PAGE_SIZE);
+
+    return (void *)va;
+}
+
+/* Release a mapping taken with map_domain_page() */
+void unmap_domain_page_mm(const void *ptr)
+{
+    unsigned long flags;
+    lpae_t *map = this_cpu(xen_dommap);
+    int slot = ((unsigned long)ptr - DOMHEAP_VIRT_START) >> SECOND_SHIFT;
+
+    if ( !ptr )
+        return;
+
+    local_irq_save(flags);
+
+    ASSERT(slot >= 0 && slot < DOMHEAP_ENTRIES);
+    ASSERT(map[slot].pt.avail != 0);
+
+    map[slot].pt.avail--;
+
+    local_irq_restore(flags);
+}
+
+mfn_t domain_page_map_to_mfn_mm(const void *ptr)
+{
+    unsigned long va = (unsigned long)ptr;
+    lpae_t *map = this_cpu(xen_dommap);
+    int slot = (va - DOMHEAP_VIRT_START) >> SECOND_SHIFT;
+    unsigned long offset = (va>>THIRD_SHIFT) & XEN_PT_LPAE_ENTRY_MASK;
+
+    if ( (va >= VMAP_VIRT_START) && ((va - VMAP_VIRT_START) < VMAP_VIRT_SIZE) )
+        return virt_to_mfn(va);
+
+    ASSERT(slot >= 0 && slot < DOMHEAP_ENTRIES);
+    ASSERT(map[slot].pt.avail != 0);
+
+    return mfn_add(lpae_get_mfn(map[slot]), offset);
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 12:15:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 12:15:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771056.1181666 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrBo-0003zV-Ih; Fri, 02 Aug 2024 12:15:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771056.1181666; Fri, 02 Aug 2024 12:15:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrBo-0003zM-Em; Fri, 02 Aug 2024 12:15:20 +0000
Received: by outflank-mailman (input) for mailman id 771056;
 Fri, 02 Aug 2024 12:15:19 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sjRO=PB=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sZrBn-0002qa-1y
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 12:15:19 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20601.outbound.protection.outlook.com
 [2a01:111:f403:2416::601])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e05818b6-50c8-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 14:15:17 +0200 (CEST)
Received: from SJ0PR05CA0176.namprd05.prod.outlook.com (2603:10b6:a03:339::31)
 by SA1PR12MB8096.namprd12.prod.outlook.com (2603:10b6:806:326::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Fri, 2 Aug
 2024 12:15:12 +0000
Received: from CO1PEPF000075ED.namprd03.prod.outlook.com
 (2603:10b6:a03:339:cafe::f7) by SJ0PR05CA0176.outlook.office365.com
 (2603:10b6:a03:339::31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.7 via Frontend
 Transport; Fri, 2 Aug 2024 12:15:12 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1PEPF000075ED.mail.protection.outlook.com (10.167.249.36) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Fri, 2 Aug 2024 12:15:11 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 2 Aug
 2024 07:15:07 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 2 Aug
 2024 07:15:07 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Fri, 2 Aug 2024 07:15:06 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e05818b6-50c8-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=oslAwda1dOk84CVTp2i4/WK6dl3r8449U7UftkgNjVvtkM0MiUShwwEPU+P6nVNRUsPqzqp0PCyUIyxnLKAJANf72Kjh/AF3kelOoHceuv1ciPazigdRZ9CFDp5OlnIuXEpG935mwTJ+eC+hHy/PmD/59CNQf2Wu5T0UQKbvg6JOyFZnF4Z0oE+Q0XwOIhrMip5Ao1hNB3h/PN5o8My3NujsVSlJHecU172J/oyORkJ7pcYCrjpWqHGYE1d9ZmbvyCfXtByFGNS1aUTU7Hib3NoHdiVegP6xWGVnwfbXltSrUHv2PQQ7ENFuz734nwZ1OsVmef1SUUmpg9una7OgVA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=sEyWPlBd3oxoq5owatePmHZPc7oCgtMUIdm8ZJtjgDM=;
 b=Nz5oqFLGW1FaAJgIeLYcn0pVWE/Lx0kbirLzp8JriOoTZZicQwJfxyvBSTVG9eqdeUg/PX65v8qg13f0grendsE5hPTugstn8vdf6+VEQKGOSTcShiJT5YFb9+k6DR/3NXeyewWCLiKL5rAslquwPnc/5Xfqifi2+mIcVsgdJUSSZx7GUShbF0BLlbGxaoHGfOultfL+/7tLT0/FIp5oGEpMWDFKia9zHqIn8G75uYU6AJUmcF27JZWBnTfC8AzviPs1DpC3CfLUq8+aPzE6YBjQvMLCcAN42eJXAr1OYjBukvHCBd2mfGTQfyM1FOcmwJD0Z6quiq/CYNhSTuSRBQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=sEyWPlBd3oxoq5owatePmHZPc7oCgtMUIdm8ZJtjgDM=;
 b=J7+3DMvNiP53g8Qb0wDSiXR8RdWZMqekooLUY9YaEA7RT3zwChmSYuKpCxJILyr/Zg3C4SP9hE/S+1loshqhp9tqTAuJWzF2e/BMWKi6XSO0t5w87tDVJr++ZMctgmTu7dEPXBqhtgk6MNQ7L5EaqEUokYfQvr7xT2/rorem6sc=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<Volodymyr_Babchuk@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v1 4/4] xen: arm: Enclose access to EL2 MMU specific registers under CONFIG_MMU
Date: Fri, 2 Aug 2024 13:14:43 +0100
Message-ID: <20240802121443.1531693-5-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
References: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000075ED:EE_|SA1PR12MB8096:EE_
X-MS-Office365-Filtering-Correlation-Id: 61979d1a-0a7f-4ef2-82d2-08dcb2ecc254
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|36860700013|82310400026|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?RK9Z/YLBpjoTcRSgGwROFfWHPvL/1mP1tAZiD1aCfCFXZCeINf8iELG5aMGR?=
 =?us-ascii?Q?P8DZbIlFgWbXAYRGijGLk1PZ8W5FxqfLFCPn3gYl9b27zyo3DmUeLrYSIHls?=
 =?us-ascii?Q?0IT1QnkDZcI/ZmN0vrNtKSeIn6ea4mCetCDRne+6+N3ivEkuXopIL/SZu6pB?=
 =?us-ascii?Q?WpKXd98WOJwQMURgWItSDvanA/u7/1O4qJg9maEXxiueE9tuaQ+4GQ95wZAx?=
 =?us-ascii?Q?MNf31izaNNTOBl/0/y9+R+AoLXZ6B2GyE5eEJirPYZ1AFXeumuyiCTgJmgpb?=
 =?us-ascii?Q?9ww0JiIiUjGNG6t0ZbwsZ6wIckGWVNB3qv0m5n70ola1jJsjz95i3uQF8DG4?=
 =?us-ascii?Q?Ug9NbrAi/2Ai8lz4NN1/VvixvoHkkcn/V+P1friweP/ghCfnRFpUldRHfoj3?=
 =?us-ascii?Q?GHh3f+KkizxeEVoNZjTx3SkWq7WEyh2uv3Ro2UmbAqZx5DRDThHNOuZRApqD?=
 =?us-ascii?Q?2WsqpmD3zUiazQ3MYX5Lg0mo4bh4uBcdTfnHssZVrP86RSbR+8uB9tN6cHVy?=
 =?us-ascii?Q?GCbEudB/4BEZ43/fMnJEuc0x4Q0PSmqgXf0ShuMEnWeX0Hq5FhNNOo4HrN2q?=
 =?us-ascii?Q?z4DlIP1clCZ/hVtESvQqCXxjMFc5YDCAQZb7jaSteV1E2N/i0qQlI5OnTsnU?=
 =?us-ascii?Q?0u8DlQtYpsLMN0pgP6V7CLR6OlqC+2Iswed3e15xvQPt0aWQS9gPF2RvvGTc?=
 =?us-ascii?Q?JDxmBUJR846DWpv2oOCIyx/Fh5JIwmIVxM/LkEJ5ss0ICaLqlurnQOBWiOz/?=
 =?us-ascii?Q?WEovErJl/i5XdmDDoQmtf3Nr75TQOib34TUBRpX6iWIw1jAVUP2rxFkiZtRq?=
 =?us-ascii?Q?qjdBeukIvD72pGvWq00w1/J4G33QgwKCpnRsOA3+BSRpCFSFwJYOSqYuJZsi?=
 =?us-ascii?Q?nuBkRxv5yNNp4TwAWmtDkPGB3zoDK4Stf/BUi46qkZQbhST0U8QNO4iXrD2P?=
 =?us-ascii?Q?Q5hd2wDT5q2rk6Ca6A5w8jE6AORuq75YEcWOS1weWkzltTBLDubWQ+okw0L+?=
 =?us-ascii?Q?df8K6tAoDOyqurpsJTaj/aarcjG5HZNiX1+BkkW8P5WtCd8l/gOhKFiaoono?=
 =?us-ascii?Q?fUwLzab9J1RxfcgcUTZKNmtsl4N3yKSuwOcqF7Zto3hFcHXMUxiYT6ICD2Rk?=
 =?us-ascii?Q?O4HYb4hbFzOnuiUV4t8LNORyOVx31mMHC85gBVAVhuCpRIsHiO89YHTHbopA?=
 =?us-ascii?Q?ZVpUEPgCjM4k7wfNMglYiwcdPvyLzYt+MVvpD4bYKkaRP8dmIbP1KuBCdNu/?=
 =?us-ascii?Q?ODrjIJ5twYy7C3PF3jC2yp1siAkhkKPsdW+wgtsv+hvzu129iEQ3GOkHpI47?=
 =?us-ascii?Q?qMkMyE17ZX6eTWoPc4LM2RsZVP6wULbtJ4/lN9ILtYwWLN4PEbMuRR/gTVRg?=
 =?us-ascii?Q?s8iDNj5tK12cJ5nywMVDCKzEeSFqtDSCeMiG3u1qUKlZp9O4ntlprISvq3V6?=
 =?us-ascii?Q?fW5uoljkAWnMxogm+XZxeeB+lXeGd5x3?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700013)(82310400026)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 12:15:11.9612
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 61979d1a-0a7f-4ef2-82d2-08dcb2ecc254
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000075ED.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8096

All the EL2 MMU specific registers are enclosed within CONFIG_MMU.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
 xen/arch/arm/traps.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index aac6c599f8..766aacee77 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -919,12 +919,14 @@ static void _show_registers(const struct cpu_user_regs *regs,
 #endif
     }
     printk("  VTCR_EL2: %"PRIregister"\n", READ_SYSREG(VTCR_EL2));
-    printk(" VTTBR_EL2: %016"PRIx64"\n", ctxt->vttbr_el2);
     printk("\n");
 
     printk(" SCTLR_EL2: %"PRIregister"\n", READ_SYSREG(SCTLR_EL2));
     printk("   HCR_EL2: %"PRIregister"\n", READ_SYSREG(HCR_EL2));
+#ifdef CONFIG_MMU
+    printk(" VTTBR_EL2: %016"PRIx64"\n", ctxt->vttbr_el2);
     printk(" TTBR0_EL2: %016"PRIx64"\n", READ_SYSREG64(TTBR0_EL2));
+#endif
     printk("\n");
     printk("   ESR_EL2: %"PRIregister"\n", regs->hsr);
     printk(" HPFAR_EL2: %"PRIregister"\n", READ_SYSREG(HPFAR_EL2));
@@ -956,7 +958,9 @@ void show_registers(const struct cpu_user_regs *regs)
     if ( guest_mode(regs) && is_32bit_domain(current->domain) )
         ctxt.ifsr32_el2 = READ_SYSREG(IFSR32_EL2);
 #endif
+#ifdef CONFIG_MMU
     ctxt.vttbr_el2 = READ_SYSREG64(VTTBR_EL2);
+#endif
 
     _show_registers(regs, &ctxt, guest_mode(regs), current);
 }
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 12:30:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 12:30:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771098.1181676 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrQR-0000vc-Vo; Fri, 02 Aug 2024 12:30:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771098.1181676; Fri, 02 Aug 2024 12:30:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrQR-0000vV-Rh; Fri, 02 Aug 2024 12:30:27 +0000
Received: by outflank-mailman (input) for mailman id 771098;
 Fri, 02 Aug 2024 12:30:26 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bU9L=PB=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sZrQQ-0000vO-DW
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 12:30:26 +0000
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com
 [2a00:1450:4864:20::130])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fd89849b-50ca-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 14:30:24 +0200 (CEST)
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-52f04c29588so13595587e87.3
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 05:30:24 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b839b2b556sm1059248a12.25.2024.08.02.05.30.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 02 Aug 2024 05:30:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fd89849b-50ca-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722601823; x=1723206623; 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=6WpW9GrMS3uuRlZd8yvdWhxdviVpX6JNG09/uACtHQc=;
        b=N75tfemnPmMVSiqYzRmgOUILwfNebU5OZM2ljvsIrqUSU7hukCXArDdTu9jcTCrDin
         5VMdEv6x+i8TD6wNenHKCzMsz2Kf3d7Ui2pzvOPo10ELDTRJuEVU2jIHemb3SxKRDI2j
         0DZxOn5IK4R4JhdQ9mQjG3o3uVriEwSRRcVKP90JPBulNl5ayjD+IIDC8/S9nlaO1cym
         wwnOHyy0T9Jiw3P0+W4CfBSw/3UYUuRZ/Ix7umFuVlOdo6Dh2slQx3dOYbqlK8RShaso
         ATFWfOa7I7o8P9otoROaT7cPVqTPchp+biz7cwVR+rt3vPR9j8gK2IOIKP/+2iR0dINl
         aCdQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722601823; x=1723206623;
        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=6WpW9GrMS3uuRlZd8yvdWhxdviVpX6JNG09/uACtHQc=;
        b=KMpDu+mlZu4WTdzD69gkldaQANUWF+nekBZB8sMwD/q5VSakTN9LR8bSpHdxt7e6u6
         IaAkZ8Y3x9Al3mTDYu2A8lg3cyQz2liOUR9wHB5pI5YRkC8sHSJX+YnDu60BZve/b7UU
         7OcGyFIGusQX5yf5+mrX4roJAWytWdioQcFw0K0WntlxF+I+OWWyz549Kql/RON56vdX
         gYbkVeWq20048qsb40XEVzBE1ZEVNTKaM1HafRj0hFgA4ouqtuzHXSL6dd51oc3gFxc+
         G6pSeSwk5aD6UV/4rZL3/g312YngNIel5LI2IU3pwOp2jDkeEgXYsHZqkU2DG9ofmm57
         X5XQ==
X-Gm-Message-State: AOJu0YydLjKVHSR1UNTp5gFC7OEPPyDLUe7pzSMkZhTak5Q2A+efBFI6
	v3zTi5pT7Q26KanfgYQsSDMCUV33XGCa5SSzKAWn/milJdNP7XPz074dKs6reQ==
X-Google-Smtp-Source: AGHT+IEohhA032ltsmxmgWdFbGc5cYUuuanRw9uJn+YnJk6qZIZM/C6OoTuyXynoE467cwFlGvJifg==
X-Received: by 2002:a05:6512:1110:b0:52e:f99e:5dd1 with SMTP id 2adb3069b0e04-530bb4d7879mr2003779e87.47.1722601823269;
        Fri, 02 Aug 2024 05:30:23 -0700 (PDT)
Message-ID: <4f9eb1b0-16bd-4456-89f5-c53513a4efe5@suse.com>
Date: Fri, 2 Aug 2024 14:30:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 2/4] xen: arm: make VMAP only support in MMU system
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com,
 julien@xen.org
References: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
 <20240802121443.1531693-3-ayan.kumar.halder@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240802121443.1531693-3-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 02.08.2024 14:14, Ayan Kumar Halder wrote:> --- a/xen/include/xen/vmap.h
> +++ b/xen/include/xen/vmap.h
> @@ -138,10 +138,16 @@ static inline void iounmap(void __iomem *va)
>  /* Pointer to 1 octet past the end of the VMAP_DEFAULT virtual area */
>  void *arch_vmap_virt_end(void);
>  
> +#ifdef CONFIG_MMU
>  /* Initialises the VMAP_DEFAULT virtual range */
>  static inline void vm_init(void)
>  {
>      vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end());
>  }
> +#else
> +static inline void vm_init(void)
> +{
> +}
> +#endif

Imo in such a case the #ifdef wants to be put inside the existing function,
avoiding the need for a 2nd instance.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 12:52:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 12:52:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771109.1181685 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrm5-0004mz-KT; Fri, 02 Aug 2024 12:52:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771109.1181685; Fri, 02 Aug 2024 12:52:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrm5-0004ms-HH; Fri, 02 Aug 2024 12:52:49 +0000
Received: by outflank-mailman (input) for mailman id 771109;
 Fri, 02 Aug 2024 12:52:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZrm4-0004mi-H3; Fri, 02 Aug 2024 12:52:48 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZrm4-0005KQ-8P; Fri, 02 Aug 2024 12:52:48 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZrm3-0002OV-QZ; Fri, 02 Aug 2024 12:52:47 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZrm3-0002HI-Pw; Fri, 02 Aug 2024 12:52:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=G0mg1wtIbhUyK48c6Khyn9om1rx5pZc2ZcMoxkW/Q/8=; b=tYvsXsBcixX/GtZY5MZuEYpWGR
	+oSnXQBP/tKox7+7iryIJSPuenNlGTDu9QmynN7Vh4XsawUAl8lK8vn3lLYpxaSeSn9f6+JsbmZcK
	0cRe26yXi7LjVITCWVhmwWNoWdDIbN8f5f4OZrGy5IDqSaULl+G0PVc0dBvB/ew+Q19A=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187115-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187115: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=c0ecd6388360d930440cc5554026818895199923
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 02 Aug 2024 12:52:47 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827

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

version targeted for testing:
 linux                c0ecd6388360d930440cc5554026818895199923
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   16 days
Failing since        186925  2024-07-20 09:44:52 Z   13 days   28 attempts
Testing same since   187115  2024-08-02 00:13:00 Z    0 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 12:57:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 12:57:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771121.1181695 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrqD-0005o6-54; Fri, 02 Aug 2024 12:57:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771121.1181695; Fri, 02 Aug 2024 12:57:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrqD-0005nz-2T; Fri, 02 Aug 2024 12:57:05 +0000
Received: by outflank-mailman (input) for mailman id 771121;
 Fri, 02 Aug 2024 12:57:03 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tTZu=PB=linutronix.de=tglx@srs-se1.protection.inumbo.net>)
 id 1sZrqA-0005m0-Ul
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 12:57:03 +0000
Received: from galois.linutronix.de (galois.linutronix.de [193.142.43.55])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b54ddac8-50ce-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 14:57:01 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b54ddac8-50ce-11ef-8776-851b0ebba9a2
From: Thomas Gleixner <tglx@linutronix.de>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020; t=1722603419;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=lD3D+R0O0Em71mRsMfaOIka63qjKDA7WWE2rtnMjgEU=;
	b=dZcUWZSGh9bGff4aCRomiWr1icF2Wg4bv0lRE9aRsL5FKsB8Q6pWnBY+f7tuYRIditgxTE
	7yvT7OEA1TVi9/w25Fjg4GbFzDfDlu4dl8AbarCh5bEB9fNsZzoi+5VBQsKK1kXdopM3SP
	KPexSQqTua7F3MXymturY2rwzgw/PIUhEQ5yeaSSqtGXn6EbTBi+JyzsPMpQeWXRIniH/Z
	o5oFfx+pMrUt92cANNTgUwKDsxx/3S3eXxWp/9vpR3ZbSTUiPkVflvXw1dS2ieI1F2v7Mw
	UCu+2AjwQREJxDSlfyydp/JUYekKS8C6hXDUKZQR4BOev8Lrz+oPsfTvcaAggA==
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020e; t=1722603419;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=lD3D+R0O0Em71mRsMfaOIka63qjKDA7WWE2rtnMjgEU=;
	b=LcS0nrflXj5N91hTteiaGk7vViHLu1+T9de/uWLDfB8oqgfeg2UYqnKEj7WaMjtHcxEwy/
	ocCi8Am6lrFvfPCg==
To: Alexey Dobriyan <adobriyan@gmail.com>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
 x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>, Juergen Gross
 <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH 2/3] x86/cpu: fix unbootable VMs by inlining memcmp in
 hypervisor_cpuid_base
In-Reply-To: <304592cf-e4a7-4ba1-baa6-4941c60f0e3c@p183>
References: <a9f505a6-fd31-4cfa-a193-d21638bb14f1@p183>
 <304592cf-e4a7-4ba1-baa6-4941c60f0e3c@p183>
Date: Fri, 02 Aug 2024 14:56:58 +0200
Message-ID: <87frrn13s5.ffs@tglx>
MIME-Version: 1.0
Content-Type: text/plain

On Fri, Aug 02 2024 at 11:50, Alexey Dobriyan wrote:

Please amend functions with '()' in the subject line and the change log
consistently.

> diff --git a/arch/x86/include/asm/cpuid.h b/arch/x86/include/asm/cpuid.h
> index 6b122a31da06..3eca7824430e 100644
> --- a/arch/x86/include/asm/cpuid.h
> +++ b/arch/x86/include/asm/cpuid.h
> @@ -196,7 +196,20 @@ static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves)
>  	for_each_possible_hypervisor_cpuid_base(base) {
>  		cpuid(base, &eax, &signature[0], &signature[1], &signature[2]);
>  
> -		if (!memcmp(sig, signature, 12) &&
> +		/*
> +		 * FIXME rewrite cpuid comparators to accept uint32_t[3].

Which comparators?

Thanks,

        tglx


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 12:57:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 12:57:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771128.1181705 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrqn-0006LO-D4; Fri, 02 Aug 2024 12:57:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771128.1181705; Fri, 02 Aug 2024 12:57:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrqn-0006LH-Ab; Fri, 02 Aug 2024 12:57:41 +0000
Received: by outflank-mailman (input) for mailman id 771128;
 Fri, 02 Aug 2024 12:57:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tTZu=PB=linutronix.de=tglx@srs-se1.protection.inumbo.net>)
 id 1sZrqm-0006EW-TC
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 12:57:40 +0000
Received: from galois.linutronix.de (galois.linutronix.de
 [2a0a:51c0:0:12e:550::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cc42b336-50ce-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 14:57:40 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cc42b336-50ce-11ef-bc03-fd08da9f4363
From: Thomas Gleixner <tglx@linutronix.de>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020; t=1722603459;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=O5e/6G+UM25BxlQUWxbyryv4bOzCBkl7nWu90dDPr9o=;
	b=Dup5ih/c9Ll7xhiCpSGh6zVCY45x1W4PsqPA+PCB2DM3mpo1gNzQsSzdGifc36R5UOEEze
	ZBf+q+DoMqnSL3mH7Z3U9AYqpEE2HTPJ5mEQ+w3MpLBalmERpW8IHVyYlTI6tZwnyqmDGk
	grL+8QKBU0YhDQEo10R4xMukgMgisptf2ry2Lj0mg9VVdDgHK5Ehd9UtfgPaWfHk0dEofp
	uUugO96lR/VPSIbBdV8M5v6s+snNRFloDqJwNg46jkP7iekI51Da/tMj19GJLXlys6cOTf
	n/Q6aBK67Le/w2zLg8JrQtoV2R5E52HHF89/tHif4Mt6QqgtK+ZUanD/ew8ZNg==
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020e; t=1722603459;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=O5e/6G+UM25BxlQUWxbyryv4bOzCBkl7nWu90dDPr9o=;
	b=EubcF067iHPxmtEKaSAyakWHQcL1X08DPzdAbR8Q5dHoQQix8euEBg5kr2mEjOPGylVXfE
	Q5JLjuPUIADNINDA==
To: Alexey Dobriyan <adobriyan@gmail.com>, Juergen Gross <jgross@suse.com>,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] xen, pvh: fix unbootable VMs by inlining memset in
 xen_prepare_pvh
In-Reply-To: <3fe4502f-020e-46de-976a-b32a76de478a@p183>
References: <a9f505a6-fd31-4cfa-a193-d21638bb14f1@p183>
 <3fe4502f-020e-46de-976a-b32a76de478a@p183>
Date: Fri, 02 Aug 2024 14:57:38 +0200
Message-ID: <87cymr13r1.ffs@tglx>
MIME-Version: 1.0
Content-Type: text/plain

On Fri, Aug 02 2024 at 11:53, Alexey Dobriyan wrote:
> If this memset() is not inlined than PVH early boot code can call
> into KASAN-instrumented memset() which results in unbootable VMs.
>
> Ubuntu's 22.04.4 LTS gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
> doesn't inline this memset but inlines __builtin_memset.

memset() ......



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 12:59:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 12:59:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771134.1181716 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrsX-0006u0-ON; Fri, 02 Aug 2024 12:59:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771134.1181716; Fri, 02 Aug 2024 12:59:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZrsX-0006tt-LO; Fri, 02 Aug 2024 12:59:29 +0000
Received: by outflank-mailman (input) for mailman id 771134;
 Fri, 02 Aug 2024 12:59:28 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZrsW-0006tj-Bi; Fri, 02 Aug 2024 12:59:28 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZrsW-0005Qu-8U; Fri, 02 Aug 2024 12:59:28 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZrsV-0002XU-VH; Fri, 02 Aug 2024 12:59:28 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZrsV-00074b-UT; Fri, 02 Aug 2024 12:59:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=MJhm09PyrdgO8RjnPLmxNJR8xiSbwkXLk2aD1WlEuIg=; b=NU45m6DmPUkUlwPp6T0C88Dh1M
	7v3WPOh0bb4rbr5xr3zzWBJQs6wqf5EByvfdm071RFZc088HTpV2Nw+T0Vuam/WcdkxSudE56pw2l
	0ZcwYK0UvuJuT617AGX40cObwfl2u0QYrTFW1CXUQ1zfEMQ1CbpERULRq2t2AfJhuRTk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187122-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187122: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=24a375fcdd26ce5a36bde69b92f638420fddf9c8
X-Osstest-Versions-That:
    ovmf=4f5de749cb2247a4ead21523f2d9deb389291636
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 02 Aug 2024 12:59:27 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 24a375fcdd26ce5a36bde69b92f638420fddf9c8
baseline version:
 ovmf                 4f5de749cb2247a4ead21523f2d9deb389291636

Last test of basis   187120  2024-08-02 08:11:33 Z    0 days
Testing same since   187122  2024-08-02 10:13:19 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jiaxin Wu <jiaxin.wu@intel.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   4f5de749cb..24a375fcdd  24a375fcdd26ce5a36bde69b92f638420fddf9c8 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 13:12:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 13:12:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771158.1181726 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZs5K-0001kH-W1; Fri, 02 Aug 2024 13:12:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771158.1181726; Fri, 02 Aug 2024 13:12:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZs5K-0001kA-Si; Fri, 02 Aug 2024 13:12:42 +0000
Received: by outflank-mailman (input) for mailman id 771158;
 Fri, 02 Aug 2024 13:12:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sZs5J-0001k4-IK
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 13:12:41 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sZs5E-0005jD-Ao; Fri, 02 Aug 2024 13:12:36 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sZs5E-00036G-2g; Fri, 02 Aug 2024 13:12:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=JupsZZ+Diqhv/xf89O+5VVu+c/Z5WfGq1+1dwyo21PE=; b=EptXq9PrF7SsddQJMKUEq6/mEY
	G7lXscW48vnzV6mI/G2XAS1xgpQcJjiu0BxIGVjwgSHY8yCPKQqB36Tt0m1ckmSrFPNtpURP8dxcn
	f5DYD8ThxKLi+/d5rDTxuq1qmdcw+loLfbirZV86EAvvO8ed7f3lHFHNMaj/mO5fo9sc=;
Message-ID: <1e6049c6-9474-40a4-a560-03294f945898@xen.org>
Date: Fri, 2 Aug 2024 14:12:34 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 1/4] xen: arm: Add an empty stub for
 update_identity_mapping()
Content-Language: en-GB
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com
Cc: xen-devel@lists.xenproject.org
References: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
 <20240802121443.1531693-2-ayan.kumar.halder@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20240802121443.1531693-2-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Ayan,

On 02/08/2024 13:14, Ayan Kumar Halder wrote:
> This is in continuation to commit
> f661a20aa880: "Extract MMU-specific MM code".
> 
> update_identity_mapping() is defined for MMU specific logic.
> It is invoked from smpboot.c. Thus, we add an empty stub to avoid
> if-defery.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
>   xen/arch/arm/include/asm/arm64/mm.h | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/xen/arch/arm/include/asm/arm64/mm.h b/xen/arch/arm/include/asm/arm64/mm.h
> index e0bd23a6ed..f595205fa3 100644
> --- a/xen/arch/arm/include/asm/arm64/mm.h
> +++ b/xen/arch/arm/include/asm/arm64/mm.h
> @@ -14,6 +14,7 @@ static inline bool arch_mfns_in_directmap(unsigned long mfn, unsigned long nr)
>   
>   void arch_setup_page_tables(void);
>   
> +#ifdef CONFIG_MMU
>   /*
>    * Enable/disable the identity mapping in the live page-tables (i.e.
>    * the one pointed by TTBR_EL2).
> @@ -22,6 +23,11 @@ void arch_setup_page_tables(void);
>    * supported.
>    */
>   void update_identity_mapping(bool enable);
> +#else /* CONFIG_MMU */
> +static inline void update_identity_mapping(bool enable)
> +{
> +}
> +#endif /* CONFIG_MMU */

The name of the function reads a bit odd in the context of the MPU. How 
about providing a new helper called update_boot_mapping()? For MPU, it 
would still be empty (assuming this is the right approach) whereas for 
the MMU it would call update_identity_mapping().

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 13:26:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 13:26:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771171.1181736 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsIE-0003w4-41; Fri, 02 Aug 2024 13:26:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771171.1181736; Fri, 02 Aug 2024 13:26:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsIE-0003vx-10; Fri, 02 Aug 2024 13:26:02 +0000
Received: by outflank-mailman (input) for mailman id 771171;
 Fri, 02 Aug 2024 13:26:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=FJ6P=PB=suse.com=nik.borisov@srs-se1.protection.inumbo.net>)
 id 1sZsIC-0003vr-Sx
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 13:26:00 +0000
Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com
 [2a00:1450:4864:20::232])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c1f470ef-50d2-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 15:25:59 +0200 (CEST)
Received: by mail-lj1-x232.google.com with SMTP id
 38308e7fff4ca-2eeb1ba0468so121538961fa.0
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 06:25:59 -0700 (PDT)
Received: from [192.168.0.20] (nborisov.ddns.nbis.net. [109.121.143.186])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b83b92b970sm1125275a12.72.2024.08.02.06.25.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 02 Aug 2024 06:25:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c1f470ef-50d2-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722605159; x=1723209959; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:content-language:from
         :references:cc:to:subject:user-agent:mime-version:date:message-id
         :from:to:cc:subject:date:message-id:reply-to;
        bh=cJhmQirVizUqOCgmsekY21nCq2G6MWUHMhqZQdlEfZc=;
        b=MXynIDcbyaftastIns+hsE3wav89LHzmYWLr9KYn98BH8W4KURCF8KNjFmV2wpZKs8
         vvjkZwrC3mRCSIRcG041BMm3cCb+oIBRUPpJH1bWFTZQ0yeZTcWyzp8DfQB3FcIYeH1i
         zO6A/OrwYJbTXw99hU5MvzXlkM4vkRTePdbXNnpylHQ/tsc+nclkgxpkIiN3jDPMd3Hl
         75sH82xg0cRAmBqja79mUiAXGY3cwuRLqUThvLpqW/HCE0A5Zv25WumnlP69WUrJOnRQ
         v6UXbOx059hDiYYUB4KYYdulvbCTfmtmDRAVxizx7Ox3VqT/IZvuqnVAVBXOpNkkBifK
         skRA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722605159; x=1723209959;
        h=content-transfer-encoding:in-reply-to:content-language:from
         :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=cJhmQirVizUqOCgmsekY21nCq2G6MWUHMhqZQdlEfZc=;
        b=IB8d8EGDx+Vi359viCKJmKmqGkPeVxgC5t/3Kh2asZEGYfNkZwmUc9syaTwal27My0
         HUgi/7JQjOFejgSADqjToADTdVUze/8uM2Lxf80dr3H9fvkxMAD+/7rGt495lU8iV58d
         Zmzj03B5OneeKJp/8UvlVM8AkyUa25EjiItZjB8DbqJybY9NBAWFoD0eOXTiFUmmajE3
         yahufkBY7K1MIy4NF2jEItjbbPdkr+rypOK2NIQgaKUj0eJJkCN3sa3tkBqMiAJoZRnB
         9rjqav0hyZ5hpuoQjg4A45P6QGH4GTTirhTa7mBLwbJr3qfNQUk0cfz65LjW4CzZqz7N
         Uagg==
X-Gm-Message-State: AOJu0YyZLbhCMKkU6bxKEYGsJrTXkuo2Ek2ZVxgQHNI9oAG3EDtvTPq3
	GOvezqPUSt7Jnu4TGCdSJ6fiTRzABUWAWhoSzPqpkYifX2m0jwiXdPuNVIvYvVg=
X-Google-Smtp-Source: AGHT+IHBvsYwfwOgou5WXpOcO14cjQZULKYPfbBjoNyalongwp4wd13+FAnvLOiLZkJZEUFWOqqo9w==
X-Received: by 2002:a2e:88d9:0:b0:2ef:2617:8952 with SMTP id 38308e7fff4ca-2f15aaa8480mr22670781fa.18.1722605159128;
        Fri, 02 Aug 2024 06:25:59 -0700 (PDT)
Message-ID: <824e522d-c9e2-4e24-8ce6-aca6573db06a@suse.com>
Date: Fri, 2 Aug 2024 16:25:56 +0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/3] x86/cpu: fix unbootable VMs by inlining memcmp in
 hypervisor_cpuid_base
To: Alexey Dobriyan <adobriyan@gmail.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
 x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
 Juergen Gross <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>
References: <a9f505a6-fd31-4cfa-a193-d21638bb14f1@p183>
 <304592cf-e4a7-4ba1-baa6-4941c60f0e3c@p183>
From: Nikolay Borisov <nik.borisov@suse.com>
Content-Language: en-US
In-Reply-To: <304592cf-e4a7-4ba1-baa6-4941c60f0e3c@p183>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 2.08.24 г. 11:50 ч., Alexey Dobriyan wrote:
> If this memcmp() is not inlined then PVH early boot code can call
> into KASAN-instrumented memcmp() which results in unbootable VMs:
> 
> 	pvh_start_xen
> 	xen_prepare_pvh
> 	xen_cpuid_base
> 	hypervisor_cpuid_base
> 	memcmp
> 
> Ubuntu's gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04) inlines
> memcmp with patch and the bug is partially fixed.
> 
> Leave FIXME just in case someone cares enough to compare 3 pairs of
> integers like 3 pairs of integers.
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
> 
>   arch/x86/include/asm/cpuid.h | 15 ++++++++++++++-
>   1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/include/asm/cpuid.h b/arch/x86/include/asm/cpuid.h
> index 6b122a31da06..3eca7824430e 100644
> --- a/arch/x86/include/asm/cpuid.h
> +++ b/arch/x86/include/asm/cpuid.h
> @@ -196,7 +196,20 @@ static inline uint32_t hypervisor_cpuid_base(const char *sig, uint32_t leaves)
>   	for_each_possible_hypervisor_cpuid_base(base) {
>   		cpuid(base, &eax, &signature[0], &signature[1], &signature[2]);
>   
> -		if (!memcmp(sig, signature, 12) &&
> +		/*
> +		 * FIXME rewrite cpuid comparators to accept uint32_t[3].
> +		 *
> +		 * This memcmp()
> +		 * a) is called from PVH early boot code
> +		 *    before instrumentation is set up,
> +		 * b) may be compiled to "call memcmp" (not inlined),
> +		 * c) memcmp() itself may be instrumented.
> +		 *
> +		 * Any combination of 2 is fine, but all 3 aren't.
> +		 *
> +		 * Force inline this function call.
> +		 */
> +		if (!__builtin_memcmp(sig, signature, 12) &&

Instead of putting this giant FIXME, why not simply do the comparison as 
ints, i.e ((uint32_t)&sig[0]) == signature1 && ((uitn32_t)&sig[4]) == 
signature2 && ((uint32_t)&sig[8] == signature_3  and be done with it?

>   		    (leaves == 0 || ((eax - base) >= leaves)))
>   			return base;
>   	}
> 


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 13:27:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 13:27:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771179.1181745 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsJl-00055k-DE; Fri, 02 Aug 2024 13:27:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771179.1181745; Fri, 02 Aug 2024 13:27:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsJl-00055d-AY; Fri, 02 Aug 2024 13:27:37 +0000
Received: by outflank-mailman (input) for mailman id 771179;
 Fri, 02 Aug 2024 13:27:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sZsJj-00055V-UA
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 13:27:35 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sZsJf-00063b-QM; Fri, 02 Aug 2024 13:27:31 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sZsJf-0003ux-Ht; Fri, 02 Aug 2024 13:27:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
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=VlUTGn6xtobJG8lTUxNL8lDtfe2NNnec5m5HU9Fti6U=; b=WQnrIO7n9JoLVV37I4QsbiS8+X
	KKL5idpBtk6RdKNHu8V2Yd41lQLpiuT5/ismKQ2urkklG3985bmJIcr1kON54YAzuQPrRfWXrLlwh
	vPyfTN1SKh4z2mQn0HqvPej7xn0Qc/vRFtpbUr6cgECXSGNkB/SAqOUVLOQE8toEwxqE=;
Message-ID: <a17d0c07-3f98-4eab-9f84-77d64b562cbf@xen.org>
Date: Fri, 2 Aug 2024 14:27:29 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 2/4] xen: arm: make VMAP only support in MMU system
Content-Language: en-GB
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>
References: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
 <20240802121443.1531693-3-ayan.kumar.halder@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20240802121443.1531693-3-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 02/08/2024 13:14, Ayan Kumar Halder wrote:
> From: Penny Zheng <penny.zheng@arm.com>
> 
> VMAP is widely used in ALTERNATIVE feature, CPUERRATA feature, etc to
> remap a range of memory with new memory attributes. Since this is
> highly dependent on virtual address translation, we choose to fold VMAP
> in MMU system.
> 
> In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
> only support in MMU system on ARM architecture. And we make features
> like ALTERNATIVE, CPUERRATA, etc, now depend on VMAP.

While I agree that alternative should depend on VMAP (for now), I feel 
this is incorrect for CPUERRATA. Very likely, you will need to deal with 
them on the MPU.

Before making any suggestion, would you be able to clarify how you 
envision to deal with errata? Will they be selected at built time or 
boot time?

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 13:29:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 13:29:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771187.1181756 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsLP-0005dm-OD; Fri, 02 Aug 2024 13:29:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771187.1181756; Fri, 02 Aug 2024 13:29:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsLP-0005df-KM; Fri, 02 Aug 2024 13:29:19 +0000
Received: by outflank-mailman (input) for mailman id 771187;
 Fri, 02 Aug 2024 13:29:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tTZu=PB=linutronix.de=tglx@srs-se1.protection.inumbo.net>)
 id 1sZsLO-0005dZ-Bj
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 13:29:18 +0000
Received: from galois.linutronix.de (galois.linutronix.de
 [2a0a:51c0:0:12e:550::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 379a8edb-50d3-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 15:29:17 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 379a8edb-50d3-11ef-bc03-fd08da9f4363
From: Thomas Gleixner <tglx@linutronix.de>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020; t=1722605356;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=XGzg2GI52aMVT+D2Uiqc+6QeQHTjRhsZ/Zs1cCBOQtE=;
	b=SiOm2omP/tgfjELJXSOEYlM8oF68VQ0LL30cTKg6qUSPSHf8TIJ2NgjXa5CvcKwpB76uGX
	gcGPx+l9GbUZ5c57Myn+S0vARRsJC3aAv2NFgTLjR0heoWxtnPQ2c14YXaI/rEb3TTYalU
	OaLDwVzpMb+FuELeGkUCbkRlL/uhBr/ApOEiNlvFuTj5fyNRbrhs9oZCIX0NSCyP95DQou
	GdH0dXWJLsh9+RHry7Eh8u2OA1N/9PsUMqyVn0Z0ikRFNHy/uoWXqRbcwcq7dc4UXYv0ha
	kw27E8rw2aDTgeGx+oY2nQQVQjOLK05lqq5THKWk9zBtzde2ovXJZHxFllOM7Q==
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020e; t=1722605356;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=XGzg2GI52aMVT+D2Uiqc+6QeQHTjRhsZ/Zs1cCBOQtE=;
	b=3wk4aHblZYZP+DV3l2Bg1qTrEEEdZEIg+aR9vzhFn9qF3Dg5Vg8WZhUjovKl81TtSo6blo
	6DmekKP/L43SC0CQ==
To: Nikolay Borisov <nik.borisov@suse.com>, Alexey Dobriyan
 <adobriyan@gmail.com>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov
 <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
 x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>, Juergen Gross
 <jgross@suse.com>, Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH 2/3] x86/cpu: fix unbootable VMs by inlining memcmp in
 hypervisor_cpuid_base
In-Reply-To: <824e522d-c9e2-4e24-8ce6-aca6573db06a@suse.com>
References: <a9f505a6-fd31-4cfa-a193-d21638bb14f1@p183>
 <304592cf-e4a7-4ba1-baa6-4941c60f0e3c@p183>
 <824e522d-c9e2-4e24-8ce6-aca6573db06a@suse.com>
Date: Fri, 02 Aug 2024 15:29:16 +0200
Message-ID: <877ccz12ab.ffs@tglx>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Fri, Aug 02 2024 at 16:25, Nikolay Borisov wrote:
> On 2.08.24 =D0=B3. 11:50 =D1=87., Alexey Dobriyan wrote:
>> If this memcmp() is not inlined then PVH early boot code can call
>> into KASAN-instrumented memcmp() which results in unbootable VMs:
>>=20
>> 	pvh_start_xen
>> 	xen_prepare_pvh
>> 	xen_cpuid_base
>> 	hypervisor_cpuid_base
>> 	memcmp
>>=20
>> Ubuntu's gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04) inlines
>> memcmp with patch and the bug is partially fixed.
>>=20
>> Leave FIXME just in case someone cares enough to compare 3 pairs of
>> integers like 3 pairs of integers.
>>=20
>> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
>> ---
>>=20
>>   arch/x86/include/asm/cpuid.h | 15 ++++++++++++++-
>>   1 file changed, 14 insertions(+), 1 deletion(-)
>>=20
>> diff --git a/arch/x86/include/asm/cpuid.h b/arch/x86/include/asm/cpuid.h
>> index 6b122a31da06..3eca7824430e 100644
>> --- a/arch/x86/include/asm/cpuid.h
>> +++ b/arch/x86/include/asm/cpuid.h
>> @@ -196,7 +196,20 @@ static inline uint32_t hypervisor_cpuid_base(const =
char *sig, uint32_t leaves)
>>   	for_each_possible_hypervisor_cpuid_base(base) {
>>   		cpuid(base, &eax, &signature[0], &signature[1], &signature[2]);
>>=20=20=20
>> -		if (!memcmp(sig, signature, 12) &&
>> +		/*
>> +		 * FIXME rewrite cpuid comparators to accept uint32_t[3].
>> +		 *
>> +		 * This memcmp()
>> +		 * a) is called from PVH early boot code
>> +		 *    before instrumentation is set up,
>> +		 * b) may be compiled to "call memcmp" (not inlined),
>> +		 * c) memcmp() itself may be instrumented.
>> +		 *
>> +		 * Any combination of 2 is fine, but all 3 aren't.
>> +		 *
>> +		 * Force inline this function call.
>> +		 */
>> +		if (!__builtin_memcmp(sig, signature, 12) &&
>
> Instead of putting this giant FIXME, why not simply do the comparison as=
=20
> ints, i.e ((uint32_t)&sig[0]) =3D=3D signature1 && ((uitn32_t)&sig[4]) =
=3D=3D=20
> signature2 && ((uint32_t)&sig[8] =3D=3D signature_3  and be done with it?

Because a smart compiler might turn it into a memcmp() :


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 13:33:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 13:33:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771196.1181765 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsPS-00076e-6l; Fri, 02 Aug 2024 13:33:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771196.1181765; Fri, 02 Aug 2024 13:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsPS-00076X-3Z; Fri, 02 Aug 2024 13:33:30 +0000
Received: by outflank-mailman (input) for mailman id 771196;
 Fri, 02 Aug 2024 13:33:29 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sZsPR-00076Q-Al
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 13:33:29 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sZsPN-0006C2-AD; Fri, 02 Aug 2024 13:33:25 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sZsPN-0004Pp-3y; Fri, 02 Aug 2024 13:33:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=CrIHsFYnmBSmvtHn4HyRXn0fD/ErvVhaLr+Llf96ch8=; b=FZRE0rIxllkBBIsUOp/fFqh79e
	P/doT5pjfO5BkyULYtKIj8/mBy7LF9UBvXPCqw14cETBHT8VZmct7BEZwcsilMgA+S6Uy5HZ71meI
	Htco6xzSB2MmWp7KxsAHH4rXqx8CjDx3qVs29vZBgoS6i1x3J0rEK5RrcVDzT389XijQ=;
Message-ID: <de98dd2d-7516-4e7a-ae96-903479f5b179@xen.org>
Date: Fri, 2 Aug 2024 14:33:23 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 3/4] xen: arm: Move the functions of domain_page to MMU
 specific
Content-Language: en-GB
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com
Cc: xen-devel@lists.xenproject.org
References: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
 <20240802121443.1531693-4-ayan.kumar.halder@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20240802121443.1531693-4-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 02/08/2024 13:14, Ayan Kumar Halder wrote:
> Moved init_domheap_mappings(), map_domain_page_global(),
> unmap_domain_page_global(), map_domain_page(), unmap_domain_page(),
> domain_page_map_to_mfn() to MMU specific folder.
> 
> On the top level, we have added stubs which will invoke the
> MMU specific equivalent of these functions.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
>   xen/arch/arm/domain_page.c          | 161 +----------------------

Looking at what's left in domain_page.c, we seem to have just a series 
of stubs:

bool init_domheap_mappings(unsigned int cpu)
{
     return init_domheap_mappings_mm(cpu);
}

void *map_domain_page_global(mfn_t mfn)
{
     return map_domain_page_global_mm(mfn);
}

void unmap_domain_page_global(const void *ptr)
{
     return unmap_domain_page_global_mm(ptr);
}

/* Map a page of domheap memory */
void *map_domain_page(mfn_t mfn)
{
     return map_domain_page_mm(mfn);
}

/* Release a mapping taken with map_domain_page() */
void unmap_domain_page(const void *ptr)
{
     return unmap_domain_page_mm(ptr);
}

mfn_t domain_page_map_to_mfn(const void *ptr)
{
     return domain_page_map_to_mfn_mm(ptr);
}

The indirection seems unnecessary to me. What about renaming 
arch/arm/domain_page.c to arch/arm/mmu/domain_page.c? Then, for the MMU 
you can implement unmap_domain_page() & co rather than suffixed _mm ones.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 13:38:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 13:38:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771207.1181776 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsUG-0008MH-Pb; Fri, 02 Aug 2024 13:38:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771207.1181776; Fri, 02 Aug 2024 13:38:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsUG-0008MA-Lh; Fri, 02 Aug 2024 13:38:28 +0000
Received: by outflank-mailman (input) for mailman id 771207;
 Fri, 02 Aug 2024 13:38:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sZsUF-0008M4-Cp
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 13:38:27 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sZsUB-0006IU-Oe; Fri, 02 Aug 2024 13:38:23 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sZsUB-0004kg-IV; Fri, 02 Aug 2024 13:38:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=0Mnt8qb6UUrag6u8E+Ls9M3d32DHCKoh+4f+CmWSTiw=; b=HS7mzkHP5yHFAQ3VmIwaVH3Eu4
	Nf50FgEPVHbBEMypfkFRBcjpNdjmCloSMWVs/cFUv//Jw7kqaAU1hpCmlnmLowc+o23QlRF/LSLfk
	OBiZvBEeRww15RORpSXOCl7EThD8s2ZMM7jeQ0OEkFl34HbIg4W0O00imwBOjl98DB5U=;
Message-ID: <3e6340a5-1eea-4784-96c1-980419a3755d@xen.org>
Date: Fri, 2 Aug 2024 14:38:22 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 4/4] xen: arm: Enclose access to EL2 MMU specific
 registers under CONFIG_MMU
Content-Language: en-GB
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com
Cc: xen-devel@lists.xenproject.org
References: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
 <20240802121443.1531693-5-ayan.kumar.halder@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20240802121443.1531693-5-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 02/08/2024 13:14, Ayan Kumar Halder wrote:
> All the EL2 MMU specific registers are enclosed within CONFIG_MMU.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
>   xen/arch/arm/traps.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index aac6c599f8..766aacee77 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -919,12 +919,14 @@ static void _show_registers(const struct cpu_user_regs *regs,
>   #endif
>       }
>       printk("  VTCR_EL2: %"PRIregister"\n", READ_SYSREG(VTCR_EL2));
> -    printk(" VTTBR_EL2: %016"PRIx64"\n", ctxt->vttbr_el2);

Can you #ifdef the field vttrb_el2 if it is not meant to be used?

>       printk("\n");
>   
>       printk(" SCTLR_EL2: %"PRIregister"\n", READ_SYSREG(SCTLR_EL2));
>       printk("   HCR_EL2: %"PRIregister"\n", READ_SYSREG(HCR_EL2));
> +#ifdef CONFIG_MMU
> +    printk(" VTTBR_EL2: %016"PRIx64"\n", ctxt->vttbr_el2);

VTCR_EL2 and VTTBR_EL2 needs to be read together. So I would prefer the 
printk is not moved.

>       printk(" TTBR0_EL2: %016"PRIx64"\n", READ_SYSREG64(TTBR0_EL2));
> +#endif
 >       printk("\n");>       printk("   ESR_EL2: %"PRIregister"\n", 
regs->hsr);
>       printk(" HPFAR_EL2: %"PRIregister"\n", READ_SYSREG(HPFAR_EL2));
> @@ -956,7 +958,9 @@ void show_registers(const struct cpu_user_regs *regs)
>       if ( guest_mode(regs) && is_32bit_domain(current->domain) )
>           ctxt.ifsr32_el2 = READ_SYSREG(IFSR32_EL2);
>   #endif
> +#ifdef CONFIG_MMU
>       ctxt.vttbr_el2 = READ_SYSREG64(VTTBR_EL2);
> +#endif
>   
>       _show_registers(regs, &ctxt, guest_mode(regs), current);
>   }

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 13:54:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 13:54:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771218.1181791 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsjZ-0003Ag-AS; Fri, 02 Aug 2024 13:54:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771218.1181791; Fri, 02 Aug 2024 13:54:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsjZ-000397-5u; Fri, 02 Aug 2024 13:54:17 +0000
Received: by outflank-mailman (input) for mailman id 771218;
 Fri, 02 Aug 2024 13:54: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=14L3=PB=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sZsjY-00036j-4z
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 13:54:16 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b42042f5-50d6-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 15:54:14 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2ef27bfd15bso104951951fa.2
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 06:54:14 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f15e1ae4easm1684271fa.43.2024.08.02.06.54.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 06:54:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b42042f5-50d6-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722606854; x=1723211654; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=8vYENS4GOrzDyoLqzf6YJMTgRNv1aUaS9P/N7H1oUq4=;
        b=AU0nBErxAefkckDo35pM0PB6HRscd5GLz5hRg61lP6VYubOkKxdzyh7A5GDtJ4lK+z
         W8fogpy3HAN/+UR417JKUEhvW38TzChX/eBSDnjKWmktOg4vldp1XuCIqA9Brke0nwkw
         WIqqTZLBnzv1uGnzztRFP/RuhwZ0VUkWSw8HX+HEZfRm5r9Ta4D/KixjIqWTF1l+8ATC
         uZJfahBXmy5/Uq78SWSzBLdIdJ76XD5QNy6wWW1tEFk8Qn1SGskVO0kME0B/tCnEo/4S
         bOh1YkUi5lpC9YQOH9Of3Lnq/pCDW5lyl79gDflFx7vK8Bvu8NIt1snbIIe48uHK4PBm
         dFlQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722606854; x=1723211654;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=8vYENS4GOrzDyoLqzf6YJMTgRNv1aUaS9P/N7H1oUq4=;
        b=pS0pPW8aPtnDYjyxQMwK9fNgf9Lgsk9BhkfuNC3pa3gQRX/LwQQvd9E5Tu5zGY5QqO
         0TpMq7Y0itZhsbBB3cCBOnuBQbiNtRoR4wW+fVVppcadm+Cc/Y/xYQOac4ljWlUKl96P
         YbkuAO4iKmPohDal4sFjJZhTDSbXf1JdtNkPEAK3nZEd96dt13l+4pUjm1rPt1WXZtEH
         T4w3Xb1SLHx/ckgJUrGDUX6t8ojqAOB5PZZnKQsfcCvE3qFvvdDPt/TOjOxVCc1+wDw/
         i2Vor5vDUdcvjP5EhSkHww1eEdicqP1tMBVrl149oiyufyYzNHdsWSeGmzIlrjBopotn
         E44g==
X-Gm-Message-State: AOJu0YwxMd0GgovULa6XYbeM2u5avnfs38S67VCeDDVrTOCKE0GFXndm
	S7ERZmcSsRZ0p5loQbikYZixuWCkLjFuIjmz2NT3TRzCznHCZpFHL1DImg==
X-Google-Smtp-Source: AGHT+IFqAyT4ng08KrkKSh6DAucBsCP0itGzNsRbWuHjWX1FPj1vH48eGKEHoyxLs8vKk0vc8tuTQA==
X-Received: by 2002:a2e:9606:0:b0:2ef:23ec:9357 with SMTP id 38308e7fff4ca-2f15a9f988emr27541791fa.0.1722606853462;
        Fri, 02 Aug 2024 06:54:13 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v12 1/3] xen/riscv: enable GENERIC_BUG_FRAME
Date: Fri,  2 Aug 2024 15:54:07 +0200
Message-ID: <3d507ce45606d22e9fa07dd6087870c16b5c4a4e.1722605952.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1722605952.git.oleksii.kurochko@gmail.com>
References: <cover.1722605952.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Enable GENERIC_BUG_FRAME to support BUG(), WARN(), ASSERT,
and run_in_exception_handler().

The 0x0000 opcode is used for BUG_INSTR, which, when macros from
<xen/bug.h> are used, triggers an exception with the
ILLEGAL_INSTRUCTION cause.
This opcode is encoded as a 2-byte instruction and is invalid if
CONFIG_RISCV_ISA_C is enabled or not.
Using 'ebreak' as BUG_INSTR does not guarantee proper handling of macros
from <xen/bug.h>. If a debugger inserts a breakpoint (using the 'ebreak'
instruction) at a location where Xen already uses 'ebreak', it
creates ambiguity. Xen cannot distinguish whether the 'ebreak'
instruction is inserted by the debugger or is part of Xen's own code.

Remove BUG_INSN_32 and BUG_INSN_16 macros as they encode the ebreak
instruction, which is no longer used for BUG_INSN.

Update the commit above the definition of INS_LENGTH_MASK as ebreak
isn't and 2-byte instruction is used to encode BUG_INSTR so it doesn't
matter if CONFIG_RISCV_ISA_C is enabled or not.

<xen/lib.h> is included for the reason that panic() and printk() are
used in common/bug.c and RISC-V fails if it is not included.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V12:
 - Update the commit message
 - Use 0x0000 as BUG_INSTR instead of 'ebreak' to deal with cases when
   the debugger inserts 'ebreak' into the place where Xen has ebreak.
 - Remove BUG_INSN_32 and BUG_INSN_16 macros as they encode the ebreak
   instruction, which is no longer used for BUG_INSN.
 - Update the commit above the definition of INS_LENGTH_MASK.
 - Move break inside "if ( do_bug_frame(cpu_regs, pc) >= 0 )".
---
Changes in V11:
  - update the commit message
  - change "%lx" to "%#x" for PC register printing.
  - drop +1 in argument of is_kernel_text(pc) and is_kernel_inittext(pc).
  - drop return for case CAUSE_BREAKPOINT.
  - add break to default and add a blank like above it.
  - add a comment CAUSE_BREAKPOINT is handled instead of illegal instruction.
---
Changes in V10:
 - put 'select GENERIC_BUG_FRAME' in "Config RISCV".
 - rework do_trap() to not fetch an instruction in case when the cause of trap
   is BUG_insn.
 - drop read_instr() and is_valid_bug_insn().
 - update the commit message.
---
Changes in V9:
 - Rebase on the top of current staging.
 - use GENERIC_BUG_FRAME as now we have common code available.
 - add xen/lib.h to bug.c to fix a compilation error around printk.
 - update the commit message.
 - update the code of read_instr() in traps.c
 - fold two-s if into 1 in do_trap.
---
Changes in V8:
  - remove Pointless initializer of id.
  - make bug_frames[] array constant.
  - remove cast_to_bug_frame(addr).
  - rename is_valig_bugaddr to is_valid_bug_insn().
  - add check that read_instr is used only on xen code
  - update the commit message.
---
Changes in V7:
 - move to this patch the definition of cast_to_bug_frame() from the previous patch.
 - update the comment in bug.h.
 - update the comment above do_bug_frame().
 - fix code style.
 - add comment to read_instr func.
 - add space for bug_frames in lds.S.
---
Changes in V6:
  - Avoid LINK_TO_LOAD() as bug.h functionality expected to be used
    after MMU is enabled.
  - Change early_printk() to printk()
---
Changes in V5:
  - Remove "#include <xen/types.h>" from <asm/bug.h> as there is no any need in it anymore
  - Update macros GET_INSN_LENGTH: remove UL and 'unsigned int len;' from it
  - Remove " include <xen/bug.h>" from risc/setup.c. it is not needed in the current version of
    the patch
  - change an argument type from vaddr_t to uint32_t for is_valid_bugaddr and introduce read_instr() to
    read instruction properly as the length of qinstruction can be either 32 or 16 bits.
  - Code style fixes
  - update the comments before do_bug_frame() in riscv/trap.c
  - Refactor is_valid_bugaddr() function.
  - introduce macros cast_to_bug_frame(addr) to hide casts.
  - use LINK_TO_LOAD() for addresses which are linker time relative.
---
Changes in V4:
  - Updates in RISC-V's <asm/bug.h>:
    * Add explanatory comment about why there is only defined for 32-bits length
      instructions and 16/32-bits BUG_INSN_{16,32}.
    * Change 'unsigned long' to 'unsigned int' inside GET_INSN_LENGTH().
    * Update declaration of is_valid_bugaddr(): switch return type from int to bool
      and the argument from 'unsigned int' to 'vaddr'.
  - Updates in RISC-V's traps.c:
    * replace /xen and /asm includes
    * update definition of is_valid_bugaddr():switch return type from int to bool
      and the argument from 'unsigned int' to 'vaddr'. Code style inside function
      was updated too.
    * do_bug_frame() refactoring:
      * local variables start and bug became 'const struct bug_frame'
      * bug_frames[] array became 'static const struct bug_frame[] = ...'
      * remove all casts
      * remove unneeded comments and add an explanatory comment that the do_bug_frame()
        will be switched to a generic one.
    * do_trap() refactoring:
      * read 16-bits value instead of 32-bits as compressed instruction can
        be used and it might happen than only 16-bits may be accessible.
      * code style updates
      * re-use instr variable instead of re-reading instruction.
  - Updates in setup.c:
    * add blank line between xen/ and asm/ includes.
---
Changes in V3:
  - Rebase the patch "xen/riscv: introduce an implementation of macros
    from <asm/bug.h>" on top of patch series [introduce generic implementation
    of macros from bug.h]
---
Changes in V2:
  - Remove __ in define namings
  - Update run_in_exception_handler() with
    register void *fn_ asm(__stringify(BUG_FN_REG)) = (fn);
  - Remove bug_instr_t type and change it's usage to uint32_t
---
 xen/arch/riscv/Kconfig           |  1 +
 xen/arch/riscv/include/asm/bug.h | 12 +++++-------
 xen/arch/riscv/traps.c           | 25 ++++++++++++++++++++++++-
 xen/common/bug.c                 |  1 +
 4 files changed, 31 insertions(+), 8 deletions(-)

diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index b4b354a778..f531e96657 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -1,6 +1,7 @@
 config RISCV
 	def_bool y
 	select FUNCTION_ALIGNMENT_16B
+	select GENERIC_BUG_FRAME
 
 config RISCV_64
 	def_bool y
diff --git a/xen/arch/riscv/include/asm/bug.h b/xen/arch/riscv/include/asm/bug.h
index f5ff96140f..1fffef5037 100644
--- a/xen/arch/riscv/include/asm/bug.h
+++ b/xen/arch/riscv/include/asm/bug.h
@@ -9,7 +9,11 @@
 
 #ifndef __ASSEMBLY__
 
-#define BUG_INSTR "ebreak"
+#include <xen/stringify.h>
+
+#define BUG_OPCODE  0x0000
+
+#define BUG_INSTR ".hword " __stringify(BUG_OPCODE)
 
 /*
  * The base instruction set has a fixed length of 32-bit naturally aligned
@@ -17,16 +21,10 @@
  *
  * There are extensions of variable length ( where each instruction can be
  * any number of 16-bit parcels in length ).
- *
- * Compressed ISA is used now where the instruction length is 16 bit  and
- * 'ebreak' instruction, in this case, can be either 16 or 32 bit (
- * depending on if compressed ISA is used or not )
  */
 #define INSN_LENGTH_MASK        _UL(0x3)
 #define INSN_LENGTH_32          _UL(0x3)
 
-#define BUG_INSN_32             _UL(0x00100073) /* ebreak */
-#define BUG_INSN_16             _UL(0x9002)     /* c.ebreak */
 #define COMPRESSED_INSN_MASK    _UL(0xffff)
 
 #define GET_INSN_LENGTH(insn)                               \
diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
index cb18b30ff2..72ffdcd79e 100644
--- a/xen/arch/riscv/traps.c
+++ b/xen/arch/riscv/traps.c
@@ -5,6 +5,7 @@
  * RISC-V Trap handlers
  */
 
+#include <xen/bug.h>
 #include <xen/lib.h>
 #include <xen/sched.h>
 
@@ -103,7 +104,29 @@ static void do_unexpected_trap(const struct cpu_user_regs *regs)
 
 void do_trap(struct cpu_user_regs *cpu_regs)
 {
-    do_unexpected_trap(cpu_regs);
+    register_t pc = cpu_regs->sepc;
+    unsigned long cause = csr_read(CSR_SCAUSE);
+
+    switch ( cause )
+    {
+    case CAUSE_ILLEGAL_INSTRUCTION:
+        if ( do_bug_frame(cpu_regs, pc) >= 0 )
+        {
+            if ( !(is_kernel_text(pc) || is_kernel_inittext(pc)) )
+            {
+                printk("Something wrong with PC: %#lx\n", pc);
+                die();
+            }
+
+            cpu_regs->sepc += GET_INSN_LENGTH(*(uint16_t *)pc);
+
+            break;
+        }
+
+    default:
+        do_unexpected_trap(cpu_regs);
+        break;
+    }
 }
 
 void vcpu_show_execution_state(struct vcpu *v)
diff --git a/xen/common/bug.c b/xen/common/bug.c
index b7c5d8fd4d..75cb35fcfa 100644
--- a/xen/common/bug.c
+++ b/xen/common/bug.c
@@ -1,6 +1,7 @@
 #include <xen/bug.h>
 #include <xen/errno.h>
 #include <xen/kernel.h>
+#include <xen/lib.h>
 #include <xen/livepatch.h>
 #include <xen/string.h>
 #include <xen/types.h>
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 13:54:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 13:54:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771220.1181806 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsja-0003QE-3s; Fri, 02 Aug 2024 13:54:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771220.1181806; Fri, 02 Aug 2024 13:54:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsjZ-0003Pn-Ta; Fri, 02 Aug 2024 13:54:17 +0000
Received: by outflank-mailman (input) for mailman id 771220;
 Fri, 02 Aug 2024 13:54:17 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=14L3=PB=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sZsjZ-00036y-6F
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 13:54:17 +0000
Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com
 [2a00:1450:4864:20::22f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b473272c-50d6-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 15:54:15 +0200 (CEST)
Received: by mail-lj1-x22f.google.com with SMTP id
 38308e7fff4ca-2ef2cce8be8so101593261fa.1
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 06:54:15 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f15e1ae4easm1684271fa.43.2024.08.02.06.54.13
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 06:54:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b473272c-50d6-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722606854; x=1723211654; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=wIOcN4PHeriEnZEntkfGwdQOvLPTgN17YwTpAAoCcJk=;
        b=Nv0ZTqmwLLUqoDpTMXFSV94/6g8FuGWi7+eOUz4aKaKCBdayDXWuk5X3sMRkRpymco
         +5ikDiWC8pCIAQR78nXK3uKrMrf6yV9vBd/wCpLS08+ogC0u+8HCpPf+KXVlD6XEiLLH
         88mqYOMYOSTEiahbrBfJGVN2u6Ea+5IUbNnHH9RDBMKfgC2tG0y/uhkWvCbg2v2TC2nL
         kLPe3EtYpYgOoOg0HjAcx5fp8lIAAKiE+Rk9DOkLIzsQH3QsHyI4gUKYj0LoG4TxYSzB
         Y5DRyq+frqMCe83pT6pGT3asv5vijmt1MkyeQ8R/MiQp4wTc6DGCclC8iN8MiXVswK7E
         GCMw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722606854; x=1723211654;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=wIOcN4PHeriEnZEntkfGwdQOvLPTgN17YwTpAAoCcJk=;
        b=N6eIBHJLjX0Ne581M8NRttPAsxnoKR+ZaSgi56VhjbER5TJitdLl4D2cj42KlhVUdA
         S5p7hOA8e36T0yKCVe+ujeDJobMehQdCY6N8dYqY29n5Orwa/6jF/XN91R4KUxbY8RM8
         Qpe1ozFBIvaw6RCzZGbL98I9skyVFULZSzmDLoCoEp5NyNEkZ+rG4aD23ucEDTbv33D2
         dWK9TwnqbWUh0zoh7liuaU+JhWB1k4ZiNxPB+RBMj6Pf1DMkuOtFTAWwAgfuuy1IqXlG
         wznComm84b2DDf00hZQqaoUN/97INKJm+/FA4tIT6eZAdDAKqje7h8V7pCbipdexskqZ
         P9cg==
X-Gm-Message-State: AOJu0YwgiOLn15QOuI9bfquPQa7Wbd2Npou6jKcYQIKVe/nYc8xpaCvj
	9YyDq0fa0gUr2yWpHZkhS+ZdT7Xy8hfjHmMSUDLs71gY0l/fN3sGryB2Aw==
X-Google-Smtp-Source: AGHT+IEANmQhPUVt4MoYximYaBpIi4QWwle/e/k966V3fREoWHOCp71fE3RGalCYB+bkOiMMtOb0uA==
X-Received: by 2002:a2e:884e:0:b0:2ef:2580:c0c6 with SMTP id 38308e7fff4ca-2f15aa9a091mr27091761fa.14.1722606854199;
        Fri, 02 Aug 2024 06:54:14 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v12 2/3] xen/riscv: test basic exception handling stuff
Date: Fri,  2 Aug 2024 15:54:08 +0200
Message-ID: <d76cb965066a9fb5ca23294777cbfb6d97c19099.1722605952.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1722605952.git.oleksii.kurochko@gmail.com>
References: <cover.1722605952.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Introduces testing of some macros from <xen/bug.h>.

Also wraps this testing into SELF_TESTS config to not produce
a noise in the log related to functionality testing ( in the
current case, it is macros from xen/bug.h ) when CONFIG_SELF_TESTS
is disabled.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
---
Changes in V12:
 - Notrhing changed. Only rebase.
---
Changes in V11:
 - update the commit message.
---
Changes in V10:
 - wrap test_macros_from_bug_h() under "#ifdef CONFIG_SELF_TESTS"
 - update the commit title to: "xen/riscv: test basic exception handling stuff"
---
Changes in V9:
  - s/early_printk/printk as common code is now available
---
Changes in V5-V8:
  - Nothing changed. Only rebase.
---
Changes in V4:
  - Add Acked-by: Alistair Francis <alistair.francis@wdc.com>
---
Changes in V2-V3:
  - Nothing changed
---
 xen/arch/riscv/setup.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index a6a29a1508..4defad68f4 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -19,6 +19,22 @@ void arch_get_xen_caps(xen_capabilities_info_t *info)
 unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
     __aligned(STACK_SIZE);
 
+#ifdef CONFIG_SELF_TESTS
+static void test_run_in_exception(const struct cpu_user_regs *regs)
+{
+    printk("If you see this message, ");
+    printk("run_in_exception_handler is most likely working\n");
+}
+
+static void test_macros_from_bug_h(void)
+{
+    run_in_exception_handler(test_run_in_exception);
+    WARN();
+    printk("If you see this message, ");
+    printk("WARN is most likely working\n");
+}
+#endif
+
 void __init noreturn start_xen(unsigned long bootcpu_id,
                                paddr_t dtb_addr)
 {
@@ -26,6 +42,10 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
 
     trap_init();
 
+#ifdef CONFIG_SELF_TESTS
+    test_macros_from_bug_h();
+#endif
+
     printk("All set up\n");
 
     for ( ;; )
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 13:54:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 13:54:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771217.1181786 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsjZ-000377-20; Fri, 02 Aug 2024 13:54:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771217.1181786; Fri, 02 Aug 2024 13:54:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsjY-000370-Ur; Fri, 02 Aug 2024 13:54:16 +0000
Received: by outflank-mailman (input) for mailman id 771217;
 Fri, 02 Aug 2024 13:54:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=14L3=PB=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sZsjX-00036j-RH
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 13:54:15 +0000
Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com
 [2a00:1450:4864:20::232])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b3c11e00-50d6-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 15:54:14 +0200 (CEST)
Received: by mail-lj1-x232.google.com with SMTP id
 38308e7fff4ca-2ef32fea28dso94709861fa.2
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 06:54:14 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f15e1ae4easm1684271fa.43.2024.08.02.06.54.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 06:54:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b3c11e00-50d6-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722606853; x=1723211653; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=/Ntbnvw8MpC/M0odqqqPpDWj0+tD2Vlduqp8T9CgQOA=;
        b=E5lyX5kHMUcdbxDelMWcl++DCbytGLa9ywPRCatW6CbSp5A+OjI4dDBQPTtKtOAXXQ
         zmvbnyQF79H5/Ko+Q/jK5/Yq70QsKfm1TLedSZEeESvdn4vpWO+Y9wTdRqQXYt75vE6N
         9a6zPhGoLLaIWBQWQ8kYMoGdY5NSbK8fzX1XeGOQP5aca85lobb0m8ALjlLx7yEq40D1
         HEtnBEcfCh2f9G6KUU+qh0g1dXEua7dz3+Anf1USdw8TqYYrNuZstSnOcr8swrru5H0G
         5+X/bq2fYXKlT+8nyGlrMH0uGSYf3KcDl7ryamq0pFWX5K92exO2ixhmVXBY0CtgeaEJ
         L2DA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722606853; x=1723211653;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=/Ntbnvw8MpC/M0odqqqPpDWj0+tD2Vlduqp8T9CgQOA=;
        b=LMrsYsV2+/fAUmLtPGYDamK67vF85mquiEq9o33jCjcIjF6l4i46iKrgEQGoCSIKAU
         Egz1q3CpeMCDmoi7Gur3uvOCAlC9lhlFqwE4AhoLGKs/uPRNTEnYl3G3bHgDiP54GPkq
         DmwNQmjc1N0rqSTwCGwmwquTCKnAFyMQ7LwVMWPApP6n7imiFLJe8ZIWm2oNda39xG+h
         v72jdpgeGjdOJvdqwf2Myj2sABptNMw7J7KauYYr8K96lYIwkzAuOnk0RzMKh9RKxFBf
         vBYtvM9oR7rLlAcKcTUWKCPUmydXZDm7A5HbBPwnYedCPOQAJqPaDV/MnG+xr60tebSQ
         REjw==
X-Gm-Message-State: AOJu0YyZY9Yeh16um/+UM5q56r88HOtlIuXcbtegZs9zCjg6jT1MJ3Mv
	gWx5VKHHltMOz0qXd4BR679ft1QK2go7VGeWOuGphVi5TpUU37P8QEGdag==
X-Google-Smtp-Source: AGHT+IFF5ifwd6IMltFqhWedTSaz2/kmX0vsaeu0500eV2yqUIH+pDEBjcAr9PB5fvbVYyBd8e3oaw==
X-Received: by 2002:a2e:320c:0:b0:2ee:d5c3:388b with SMTP id 38308e7fff4ca-2f15ab06368mr24473641fa.39.1722606852728;
        Fri, 02 Aug 2024 06:54:12 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v12 0/3] RISCV basic exception handling implementation
Date: Fri,  2 Aug 2024 15:54:06 +0200
Message-ID: <cover.1722605952.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The patch series provides a basic implementation of exception handling.
It can do only basic things such as decode a cause of an exception,
save/restore registers and execute "wfi" instruction if an exception
can not be handled.

To verify that exception handling works well it was used macros
from <asm/bug.h> such as BUG/WARN/run_in_exception/assert_failed.

It wasn't implemented show_execution_state() and stack trace discovering
as it's not necessary now.

---
Changes in V12:
 - Drop patch series depenency from "Enable build of full Xen for RISC-V" as
   this depenency has been merged to staging.
 - Change BUG_INSTR from 'ebreak' to 0x0000 ( UNIMP instruction ).
 - add new patch with refactoring of decode_trap_cause().
 - The following patches were merged to staging:
   - [PATCH v11 1/5] xen/riscv: use printk() instead of early_printk()
   - [PATCH v11 2/5] xen/riscv: introduce decode_cause() stuff
   - [PATCH v11 3/5] xen/riscv: introduce trap_init()
 - All other changes please look in patch separately.
---
Changes in V10 - V11:
 - No generic changes to describe here. Please look at patch-specific changes.
---
Changes in V9:
 - Update the cover letter message.
 - s/early_printk/printk.
 - use GENERIC_BUG_FRAME instead of arch-specific implementation of do_bug_frame().
 - Rebase on top of current staging and riscv-full-xen-build-v14.
---
Changes in V8:
 - Update the commit message of the cover letter.
 - Remove the patch with an introduction of dummy asm/bug.h and introduce
   normal asm/bug.h
 - Fix typo in return string from decode_reserved_interrupt_cause
 - Add "Acked-by: Alistair Francis <alistair.francis@wdc.com>" for the patch
   "xen/riscv: introduce decode_cause() stuff"
 - Remove Pointless initializer of id in do_bug_frame().
 - Make bug_frames[] array constant in do_bug_frame().
 - Remove cast_to_bug_frame(addr).
 - Rename is_valig_bugaddr to is_valid_bug_insn().
 - Add check that read_instr is used only on Xen code
 - Update the commit message.
---
Changes in V7:
 - Update the depenency ( mentioned in the cover letter message ) of the current
   patch series.
 - clean up comments.
 - code style fixes.
 - move definition of cast_to_bug_frame() from patch 4 to 5.
---
Changes in V6:
 - Update the cover letter message: the patch set is based on MMU patch series.
 - Introduce new patch with temporary printk functionality. ( it will be
   removed when Xen common code will be ready )
 - Change early_printk() to printk().
 - Remove usage of LINK_TO_LOAD() due to the MMU being enabled first.
 - Add additional explanatory comments.
 - Remove patch "xen/riscv: initialize boot_info structure" from the patch
   series.
---
Changes in V5:
 - Rebase on top of [1] and [2]
 - Add new patch which introduces stub for <asm/bug.h> to keep Xen compilable
   as in the patch [xen/riscv: introduce decode_cause() stuff] is used
   header <xen/lib.h> which requires <asm/bug.h>.
 - Remove <xen/error.h> from riscv/traps/c as nothing would require
   inclusion.
 - decode_reserved_interrupt_cause(), decode_interrupt_cause(),
   decode_cause, do_unexpected_trap() were made as static they are expected
   to be used only in traps.c
 - Remove "#include <xen/types.h>" from <asm/bug.h> as there is no any need in it anymore
 - Update macros GET_INSN_LENGTH: remove UL and 'unsigned int len;' from it
 - Remove " include <xen/bug.h>" from risc/setup.c. it is not needed in the current version of
   the patch
 - change an argument type from vaddr_t to uint32_t for is_valid_bugaddr and introduce 
   read_instr() to read instruction properly as the length of qinstruction can be
   either 32 or 16 bits.
 - Code style fixes
 - update the comments before do_bug_frame() in riscv/trap.c
 - [[PATCH v4 5/5] automation: modify RISC-V smoke test ] was dropped as it was provided
   more simple solution by Andrew.  CI: Simplify RISCV smoke testing
 - Refactor is_valid_bugaddr() function.
 - 2 new patches ([PATCH v5 {1-2}/7]) were introduced, the goal of which is to recalculate
   addresses used in traps.c, which can be linker time relative. It is needed as we don't
   have enabled MMU yet.
---
Changes in V4:
  - Rebase the patch series on top of new version of [introduce generic
    implementation of macros from bug.h] patch series.
  - Update the cover letter message as 'Early printk' was merged and
    the current one patch series is based only on [introduce generic
    implementation of macros from bug.h] which hasn't been commited yet.
  - The following patches of the patch series were merged to staging:
      [PATCH v3 01/14] xen/riscv: change ISA to r64G
      [PATCH v3 02/14] xen/riscv: add <asm/asm.h> header
      [PATCH v3 03/14] xen/riscv: add <asm/riscv_encoding.h header
      [PATCH v3 04/14] xen/riscv: add <asm/csr.h> header
      [PATCH v3 05/14] xen/riscv: introduce empty <asm/string.h>
      [PATCH v3 06/14] xen/riscv: introduce empty <asm/cache.h>
      [PATCH v3 07/14] xen/riscv: introduce exception context
      [PATCH v3 08/14] xen/riscv: introduce exception handlers implementation
      [PATCH v3 10/14] xen/riscv: mask all interrupts
  - Fix addressed comments in xen-devel mailing list.

---
Changes in V3:
  - Change the name of config RISCV_ISA_RV64IMA to RISCV_ISA_RV64G
    as instructions from Zicsr and Zifencei extensions aren't part of
    I extension any more.
  - Rebase the patch "xen/riscv: introduce an implementation of macros
    from <asm/bug.h>" on top of patch series [introduce generic implementation
    of macros from bug.h]
  - Update commit messages
---
Changes in V2:
  - take the latest riscv_encoding.h from OpenSBI, update it with Xen
    related changes, and update the commit message with "Origin:"
    tag and the commit message itself.
  - add "Origin:" tag to the commit messag of the patch
    [xen/riscv: add <asm/csr.h> header].
  - Remove the patch [xen/riscv: add early_printk_hnum() function] as the
    functionality provided by the patch isn't used now.
  - Refactor prcoess.h: move structure offset defines to asm-offsets.c,
    change register_t to unsigned long.
  - Refactor entry.S to use offsets defined in asm-offsets.C
  - Rename {__,}handle_exception to handle_trap() and do_trap() to be more
    consistent with RISC-V spec.
  - Merge the pathc which introduces do_unexpected_trap() with the patch
    [xen/riscv: introduce exception handlers implementation].
  - Rename setup_trap_handler() to trap_init() and update correspondingly
    the patches in the patch series.
  - Refactor bug.h, remove bug_instr_t type from it.
  - Refactor decode_trap_cause() function to be more optimization-friendly.
  - Add two new empty headers: <cache.h> and <string.h> as they are needed to
    include <xen/lib.h> which provides ARRAY_SIZE and other macros.
  - Code style fixes.
---

Oleksii Kurochko (3):
  xen/riscv: enable GENERIC_BUG_FRAME
  xen/riscv: test basic exception handling stuff
  xen/riscv: refactor decode_trap_cause()

 xen/arch/riscv/Kconfig           |  1 +
 xen/arch/riscv/include/asm/bug.h | 12 +++++-------
 xen/arch/riscv/setup.c           | 20 +++++++++++++++++++
 xen/arch/riscv/traps.c           | 33 ++++++++++++++++++++++++++++----
 xen/common/bug.c                 |  1 +
 5 files changed, 56 insertions(+), 11 deletions(-)

-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 13:54:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 13:54:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771219.1181799 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsjZ-0003Ks-Pn; Fri, 02 Aug 2024 13:54:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771219.1181799; Fri, 02 Aug 2024 13:54:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZsjZ-0003Jw-Kv; Fri, 02 Aug 2024 13:54:17 +0000
Received: by outflank-mailman (input) for mailman id 771219;
 Fri, 02 Aug 2024 13:54: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=14L3=PB=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sZsjY-00036j-OS
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 13:54:16 +0000
Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com
 [2a00:1450:4864:20::22a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b4e9a8b5-50d6-11ef-bc03-fd08da9f4363;
 Fri, 02 Aug 2024 15:54:16 +0200 (CEST)
Received: by mail-lj1-x22a.google.com with SMTP id
 38308e7fff4ca-2ef2d582e31so96118121fa.2
 for <xen-devel@lists.xenproject.org>; Fri, 02 Aug 2024 06:54:16 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f15e1ae4easm1684271fa.43.2024.08.02.06.54.14
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 02 Aug 2024 06:54:14 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b4e9a8b5-50d6-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722606855; x=1723211655; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=9xMFnCQstUzRDpJ+Lt8V1NerdXhHxQ/jZPU/wjOAbGA=;
        b=axmmV1u+JFrGY4t8gaewl3rsax935QuHnNRN9uoKtfGgdrjXJcCXPhNxJa2MgI2SYF
         1g7XyYMHaF912EFkK3iFXN0vrhVlgDziAwzNGC0uupYidVvk3PK8XiqC0Tf4N3mU1JMm
         IIV7h/zm4rDyzM7kB3HfM76eT6NigcVAr75iVrTvgmHYULEo1NSp6kkmrZiBQaalPqsi
         q/TpFTPvBMKr/le6t9xDtqDPx4dD4xoQ+zQjnbMzdwR77BN+/7f3sVm1NKsnBeZhv5t9
         NLeTcd2wiIExuQ2ovhLGLsLcRBh24lMrvp6cNkfGp/CqNeu8lVQSfZMaJSZdKDqf4Uuo
         QvIQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722606855; x=1723211655;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=9xMFnCQstUzRDpJ+Lt8V1NerdXhHxQ/jZPU/wjOAbGA=;
        b=l1ndGbcZKO/5A1QJtSPntR9AQrDMU7ggqwM6VuMHbtUbxurSXBZw3wajO9P/PXz9Gx
         kovcSJemEIPms89lDKnIIDcFQSzO28vaNaws/EkW8eGY9NwMeIVP+Ek1o+hMQ1u4dLrL
         0aYGrDo/98H+6KnkDDsvTFD+CWWnFXk0mFhgpee0J9s/53J892c+jIdvh7Xh3B3Mp1MZ
         g3WO7SkIeaGYmT9D+3a+NmcFguw3nQg9jyecwueY22VY9PUyc3vPa/SH5NAOyOmBFqfc
         IVFCEau5HRSbcmLyIt1wDSNDJ6dZRqiM1m4hpLYIAvTyW0lUMDdwURPSrrnhdE56N5mS
         6yKQ==
X-Gm-Message-State: AOJu0Yy4UmOAG0RzNmTC/YszXUOpaKwtYenJn8bhZNf4ztg1CG27mwbM
	FdxjV0P97sOW9bR8ZZzcaAoQMGrYG9z7siN3l3nr0GEHe4CPrBt4/8olTQ==
X-Google-Smtp-Source: AGHT+IHxufmfzYuTB4oOeLssPmvuH/MFYbb7j6IzGfwer3jhklgSUL5HMxdQgEe6RvQlMF1MzkmnAg==
X-Received: by 2002:a2e:2c11:0:b0:2ef:243b:6dce with SMTP id 38308e7fff4ca-2f15aa84ec7mr23882531fa.10.1722606855031;
        Fri, 02 Aug 2024 06:54:15 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v12 3/3] xen/riscv: refactor decode_trap_cause()
Date: Fri,  2 Aug 2024 15:54:09 +0200
Message-ID: <88e15908d6ac363934b6da52091443af28bd7291.1722605952.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1722605952.git.oleksii.kurochko@gmail.com>
References: <cover.1722605952.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use array_access_nospec() to prevent guest speculation.

Avoid double access of trap_causes[cause].

Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V12:
 - New patch.
---
 xen/arch/riscv/traps.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
index 72ffdcd79e..51f6e45ccc 100644
--- a/xen/arch/riscv/traps.c
+++ b/xen/arch/riscv/traps.c
@@ -7,6 +7,7 @@
 
 #include <xen/bug.h>
 #include <xen/lib.h>
+#include <xen/nospec.h>
 #include <xen/sched.h>
 
 #include <asm/processor.h>
@@ -48,9 +49,10 @@ static const char *decode_trap_cause(unsigned long cause)
         [CAUSE_STORE_GUEST_PAGE_FAULT] = "Guest Store/AMO Page Fault",
     };
 
-    if ( cause < ARRAY_SIZE(trap_causes) && trap_causes[cause] )
-        return trap_causes[cause];
-    return "UNKNOWN";
+    const char *res = cause < ARRAY_SIZE(trap_causes) ? array_access_nospec(trap_causes, cause)
+                                                      : NULL;
+
+    return res ?: "UNKNOWN";
 }
 
 static const char *decode_reserved_interrupt_cause(unsigned long irq_cause)
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 15:54:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 15:54:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771262.1181827 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZubl-0006cL-9E; Fri, 02 Aug 2024 15:54:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771262.1181827; Fri, 02 Aug 2024 15:54:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZubl-0006cE-4t; Fri, 02 Aug 2024 15:54:21 +0000
Received: by outflank-mailman (input) for mailman id 771262;
 Fri, 02 Aug 2024 15:54:19 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZubj-0006c4-Jd; Fri, 02 Aug 2024 15:54:19 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZubj-0000N3-8j; Fri, 02 Aug 2024 15:54:19 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZubi-0000aT-Vn; Fri, 02 Aug 2024 15:54:19 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZubi-0003sz-VP; Fri, 02 Aug 2024 15:54:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=3bVXN8GglNXLUbQHjdQJOBdilBPOTh0SBO/VNHMo4G8=; b=x3aR2tUX4j6Qjflt9+bZYB7YAQ
	whzds52/qkIKcNjfBthhoWElrxNMMe7511FKek7kmkZOs2AoQp6RMdy0MIw9/knxzszWB17AevF5/
	azzaVNjaI4qbZ5JbZ4R/qZdd2Ni3zzfbqhF917mRFoxVU/F8D0LGLrTNrbAaNgI8XM3Q=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187124-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187124: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=f203a6db92eedf03ac544ed270404cb29d3dea7f
X-Osstest-Versions-That:
    ovmf=24a375fcdd26ce5a36bde69b92f638420fddf9c8
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 02 Aug 2024 15:54:18 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 f203a6db92eedf03ac544ed270404cb29d3dea7f
baseline version:
 ovmf                 24a375fcdd26ce5a36bde69b92f638420fddf9c8

Last test of basis   187122  2024-08-02 10:13:19 Z    0 days
Testing same since   187124  2024-08-02 13:11:29 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Aithal Srikanth <sraithal@amd.com>
  Sami Mujawar <sami.mujawar@arm.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   24a375fcdd..f203a6db92  f203a6db92eedf03ac544ed270404cb29d3dea7f -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 16:54:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 16:54:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771276.1181835 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZvXQ-0007I9-FC; Fri, 02 Aug 2024 16:53:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771276.1181835; Fri, 02 Aug 2024 16:53:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZvXQ-0007I2-CG; Fri, 02 Aug 2024 16:53:56 +0000
Received: by outflank-mailman (input) for mailman id 771276;
 Fri, 02 Aug 2024 16:53:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZvXP-0007Hs-7W; Fri, 02 Aug 2024 16:53:55 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZvXO-00021W-Tu; Fri, 02 Aug 2024 16:53:54 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sZvXO-0003Ze-F2; Fri, 02 Aug 2024 16:53:54 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sZvXO-0002oZ-EV; Fri, 02 Aug 2024 16:53:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=U2O/5Rk+aPBiIlIyEVoFxOX+TNFt1/zcvWTGH21a6nw=; b=L15nVmGlX4MpTQqWPI1KcDBKcJ
	EezaOx2xeul5Ka66eG7k+Fd6C6A2a5tjR4Bz7YyGrjQwxUP0ZBsd6RGskpNLZWiMjVYwolUUZbILw
	CzQqU0Odp/Sr/+q1UoXedNG0kOCBqeAB7howX6+PhRoNPmNhlQUK3zcEq8ryKWDWjcr8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187116-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187116: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=1c4fb9bb49b7babbcaa0b62384841ba4acb49356
X-Osstest-Versions-That:
    xen=36f75d39b38d94a0d17119a4178c08de994ead23
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 02 Aug 2024 16:53:54 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 xen                  1c4fb9bb49b7babbcaa0b62384841ba4acb49356
baseline version:
 xen                  36f75d39b38d94a0d17119a4178c08de994ead23

Last test of basis   187103  2024-08-01 08:10:58 Z    1 days
Testing same since   187116  2024-08-02 04:00:58 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alejandro Vallejo <alejandro.vallejo@cloud.com>
  Alistair Francis <alistair.francis@wdc.com>
  Christian Lindig <christian.lindig@cloud.com>
  Jan Beulich <jbeulich@suse.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Petr Beneš <w1benny@gmail.com>
  Sergiy Kibrik <Sergiy_Kibrik@epam.com>
  Tamas K Lengyel <tamas@tklengyel.com>
  Xenia Ragiadakou <burzalodowa@gmail.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   36f75d39b3..1c4fb9bb49  1c4fb9bb49b7babbcaa0b62384841ba4acb49356 -> master


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 18:27:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 18:27:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771313.1181918 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZwza-0004AS-U0; Fri, 02 Aug 2024 18:27:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771313.1181918; Fri, 02 Aug 2024 18:27:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZwza-0004AL-R5; Fri, 02 Aug 2024 18:27:06 +0000
Received: by outflank-mailman (input) for mailman id 771313;
 Fri, 02 Aug 2024 18:27:05 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=bqIr=PB=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1sZwzZ-0004AF-Pu
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 18:27:05 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on20622.outbound.protection.outlook.com
 [2a01:111:f403:2414::622])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cfd4d46d-50fc-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 20:27:02 +0200 (CEST)
Received: from CYZPR17CA0003.namprd17.prod.outlook.com (2603:10b6:930:8c::23)
 by IA1PR12MB6114.namprd12.prod.outlook.com (2603:10b6:208:3ea::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.33; Fri, 2 Aug
 2024 18:26:59 +0000
Received: from CY4PEPF0000EDD3.namprd03.prod.outlook.com
 (2603:10b6:930:8c:cafe::8d) by CYZPR17CA0003.outlook.office365.com
 (2603:10b6:930:8c::23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend
 Transport; Fri, 2 Aug 2024 18:26:58 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CY4PEPF0000EDD3.mail.protection.outlook.com (10.167.241.199) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Fri, 2 Aug 2024 18:26:57 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 2 Aug
 2024 13:26:57 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 2 Aug
 2024 13:26:56 -0500
Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Fri, 2 Aug 2024 13:26:55 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cfd4d46d-50fc-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Ibbaw0Oq8s+BkhW1WL0hf8/QUKqtVsaXq1Hs93II3TTyUtqfU46BrByuyuTDLw4rwk3PVqYycbWpWdh6Bdd1+g6FS2EXdkazvt+bZTqswvG4NapYg7G1Ms2hYha5dnPCRdeAfxS88Il/XHxzNM8OTPLIczVpwfwV2oMllwMIp6Ae9n2T+LIaESrZ4xDwmiHBpYcqUyXkVjX/Iuj96y7Fq1W45xH2eAoK2geHSEV/DTakmh1o7BQerbuAwW6lJtxe9PK4Mh7pO8UzUlYaczMb/hAUmXwZOaG8UOXe9kjGwS26toDAcDXGIUswtZ36t/Ft5l5uV1lnte7hkd5vtEmZdw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Kv5fGZrFl8nTwtSrKv0t7Iw/ZltTaBD+iHRePMAY000=;
 b=ARB+aZWlbuj+Z4zafSn9nYzYEdFeoGBzQe0CshWdipq2grZKWYlHDQYaxhMPkibOfXu9OVxe1d2vqu4Rv7inAluCbq7m+Jn3WswvDKaR4Phc1jXqxJ66csEWg6x7SxDWZrrsVmDool4R6fL8C+nrg9iBvUS/3Bv2nhfxMdcWrwJozt+lbrBW7wY2tQ0uJjoQ+5Eo4eA2p1ZpCADMMeLdIXCaO6hCXlVB8V8kVDE6WqR8ajRJZUdvXN7BBKTsC5FVenGoyLOebEYU3HxDbmpsidKare8wqyq9gxLKMXZxhYjcEXFgW9EYXHDDrZC28sCtefHgY0HT4xplM3mjFvdsTw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Kv5fGZrFl8nTwtSrKv0t7Iw/ZltTaBD+iHRePMAY000=;
 b=SpJowFidjkecCZY/751liry+7qfD6H6cElY7yQCi26ofGUPSkeIVVL6VGGJQprsGPp5JHEBXa/IaMRMLTPxjPxeezwrTw15YQI0xV7mbYZiJ9dAtPuSZ9gWODs5urkWjVXquu0GbPXGBD36iZGdVPIwaTMHZWpCLoEJ5SOVk1go=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stewart Hildebrand <stewart.hildebrand@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>
Subject: [PATCH] xen/arm: vITS: add #msi-cells property
Date: Fri, 2 Aug 2024 14:26:52 -0400
Message-ID: <20240802182654.8976-1-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000EDD3:EE_|IA1PR12MB6114:EE_
X-MS-Office365-Filtering-Correlation-Id: f92e9815-259b-4b87-caca-08dcb320b19d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?VcUCV32pqVobMYf50jGRLKC0JQ6UKMIvwcIIB0UQWhyv3QKzi/MoFMQZyIVF?=
 =?us-ascii?Q?OTnX8gv2Aus2s14jXnq7z3VtKB0BQd3oPs6dn0BGLlPk7qJcodZBZAhTj+oZ?=
 =?us-ascii?Q?TUib5N+ndyQi2n0VzjlAFKnldAwGLdolIXV7+pHrpc6rVIXbOkUy9Jy3PZVY?=
 =?us-ascii?Q?UT6L5L5Pp7UugIb5Dp41N1yFNULlIhDnJnOvl5DaXK1iDIXVY5KHtQf1vmcL?=
 =?us-ascii?Q?tYLpAsVIXbCCYxztD96y7B32VWcVQmkv7LYC84wvNZabFKi2RwO+wCb+3XM/?=
 =?us-ascii?Q?BLcOv6+hxDSPpQ6hajfQ3NVYQeVLONlWAsH43MOzmwmTIWEPDqm3x1W3ifQP?=
 =?us-ascii?Q?nDfXWBj6UtL3Yc1P5WnDamJEST/+WZNhzuW7QFfG0/lCs8phGmxAjZ9rZc9y?=
 =?us-ascii?Q?eJzf55ck4ZWkRJcmcSBBmLIDfrXSR65KUIXNRfGSTf/gWEKaQgZ4wt3DuHyy?=
 =?us-ascii?Q?hTKgW+wni807vbZT1OzylBe9QvhWlRxZ7XChKC/QDCGpGNN2qorJWXeCXgHE?=
 =?us-ascii?Q?EfJzxv3cX4pqd+0nNfynpHhzna1GT3tciqxh2enP5AhRQpw0ylE4NNO6dewN?=
 =?us-ascii?Q?oLWjcd8j+cC8AW0yut+lEY7dRwu73AOfaapNQI0hs497goJY6G+jhhY1kHl8?=
 =?us-ascii?Q?rQicT/WgDHQMTz7xYF45+cFP80DoXY2RV3NfZFqqhSvSYagkFkBWFyU+/pgH?=
 =?us-ascii?Q?zoUze5/XFVhq12IOv26pSClXspNj1AMseR4Fko04Y9WBIEvYinp/uhDN+PPp?=
 =?us-ascii?Q?Th42visdSmzy6VsGYcX6wJCHD41WYp5liaH3i9/PuqYAaFM+YthmCw1KFCzU?=
 =?us-ascii?Q?8JMa1oo07gfv2aNEru794HzsdqIcVZaFntQiOs29XK69TNNhKzzXTxO7TNY0?=
 =?us-ascii?Q?bwdb5QrKh2Q/T58AmXHlUS7zMnibpG7vH+r9KeLzLCOH0UyIePrLg5ZyrhY1?=
 =?us-ascii?Q?qaLdRNP2lRc7CSgCDJTvSMMg8x5lwMdAg6PNMVmiQzE6FscVGkzjWraycbsY?=
 =?us-ascii?Q?NkiupjKbAW+8cc46OL7sH94O74L6A2WP3nS+09s6mxuXqfzRauZvF9AfXeNT?=
 =?us-ascii?Q?QkoX39NBcA+no3J/O9Z/s8ApYwyHp7OUPb/eyP16psmsjViQ7nE/xdzpTsUH?=
 =?us-ascii?Q?0LZGahy8a6+h6zN6DoxQ+yEKuDxdow6RtyNYvRaEFNg4k65Festkfcbkvb9v?=
 =?us-ascii?Q?xqBaACq0I1+0iU1kAy4iSokvcZV/LylSsmSZZWpbfxj28k725IV8CPDBldaQ?=
 =?us-ascii?Q?1hKRiwJ4TBcJ43l6pznF40eqys8n/i1DgUOHZGiJk9T9WCsnmfqWjc/jbbQ3?=
 =?us-ascii?Q?YXLtYe0o5S5Su/Kr13k/kTRcCtu5PV7nmF0CeaOSvJ8W7KrSBl56NEWgHQSN?=
 =?us-ascii?Q?G4cyp1O2JBN8PILDBX4IKLdhyhvw+7ICWP5GG5BNwJrtNLu7IVsnVNE53ESD?=
 =?us-ascii?Q?bYq4xVi41ewAjfyvtFSUnELZ8bqVRq1G?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2024 18:26:57.8751
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: f92e9815-259b-4b87-caca-08dcb320b19d
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000EDD3.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6114

Non-PCI platform devices may use the ITS. Dom0 Linux drivers for such
devices are failing to register IRQs due to a missing #msi-cells
property. Add the missing #msi-cells property.

Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
See Linux dc4dae00d82f ("Docs: dt: add #msi-cells to GICv3 ITS binding")
---
 xen/arch/arm/gic-v3-its.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
index 8afcd9783bc8..55bed3fe87d0 100644
--- a/xen/arch/arm/gic-v3-its.c
+++ b/xen/arch/arm/gic-v3-its.c
@@ -951,6 +951,10 @@ int gicv3_its_make_hwdom_dt_nodes(const struct domain *d,
         if ( res )
             return res;
 
+        res = fdt_property_cell(fdt, "#msi-cells", 1);
+        if ( res )
+            return res;
+
         if ( its->phandle )
         {
             res = fdt_property_cell(fdt, "phandle", its->phandle);

base-commit: 984cb316cb27b53704c607e640a7dd2763b898ab
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 02 21:02:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 21:02:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771324.1181928 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZzPI-00015N-Cb; Fri, 02 Aug 2024 21:01:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771324.1181928; Fri, 02 Aug 2024 21:01:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZzPI-00015G-90; Fri, 02 Aug 2024 21:01:48 +0000
Received: by outflank-mailman (input) for mailman id 771324;
 Fri, 02 Aug 2024 21:01:46 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=XJnr=PB=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sZzPG-00015A-It
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 21:01:46 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6ab8699a-5112-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 23:01:43 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 7ACCACE1B32;
 Fri,  2 Aug 2024 21:01:37 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3278C4AF0A;
 Fri,  2 Aug 2024 21:01:35 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6ab8699a-5112-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1722632496;
	bh=hjSHbVI+sfiBsG0uuVOXBWhucL4WQGvhXOs/tzI/YNQ=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=lj4rjeeJnysn6aXt2QafGpKyJIshTREkAA3+NtWmyZPgKTQmhS1xYJxLDm2/dPZdH
	 /lkv9eo2bMtkxuYDQ1X8Zh8Z+gsEZXfbqAFIYzREQnXbtZ2BMkKtRStyfnDCsl/BeG
	 riqlozv+rkQ/oYWlfvfWQS3Gvqq+DjaxINhVJT8LmBEcEt7Aryz6WNiiGR1n4EbnNV
	 fmENDILeD9guQvI2FWACd/A/y9ejay9+dLyEn/VFW/0Fh6FSHMJszHjUCd0adi1nJ6
	 fGg3CuE60ToOA3F/t4IEiam2PGhofXdQ2Qo0Kj1kLrky2KIsRey93wCFRAU7c83Usu
	 C4rqIooiiXuKA==
Date: Fri, 2 Aug 2024 14:01:34 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
cc: sstabellini@kernel.org, bertrand.marquis@arm.com, michal.orzel@amd.com, 
    artem_mygaiev@epam.com, julien@xen.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 1/3] docs: Introduce Fusa Requirement and define
 maintainers
In-Reply-To: <20240802094614.1114227-2-ayan.kumar.halder@amd.com>
Message-ID: <alpine.DEB.2.22.394.2408021400000.114241@ubuntu-linux-20-04-desktop>
References: <20240802094614.1114227-1-ayan.kumar.halder@amd.com> <20240802094614.1114227-2-ayan.kumar.halder@amd.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 2 Aug 2024, Ayan Kumar Halder wrote:
> The FUSA folder is expected to contain requirements and other documents
> to enable safety certification of Xen hypervisor.
> Added a README to explain how the requirements are categorized, written
> and their supported status.
> 
> Added maintainers for the same.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes from :-
> 
> v1 - 1. Added a comment from Stefano.
> 2. Added Ack.
> 
>  MAINTAINERS              |  9 +++++
>  docs/fusa/reqs/README.md | 78 ++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 87 insertions(+)
>  create mode 100644 docs/fusa/reqs/README.md
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 7c524a8a93..0d328e065c 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -314,6 +314,15 @@ F:	xen/arch/x86/include/asm/x86_*/efi*.h
>  F:	xen/common/efi/
>  F:	xen/include/efi/
>  
> +FUSA
> +M:	Stefano Stabellini <sstabellini@kernel.org>
> +M:	Bertrand Marquis <bertrand.marquis@arm.com>
> +M:	Michal Orzel <michal.orzel@amd.com>
> +M:	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> +M:	Artem Mygaiev <artem_mygaiev@epam.com>
> +S:	Supported
> +F:	docs/fusa/
> +
>  GDBSX DEBUGGER
>  M:	Elena Ufimtseva <elena.ufimtseva@oracle.com>
>  S:	Supported
> diff --git a/docs/fusa/reqs/README.md b/docs/fusa/reqs/README.md
> new file mode 100644
> index 0000000000..651f0a4e00
> --- /dev/null
> +++ b/docs/fusa/reqs/README.md
> @@ -0,0 +1,78 @@
> +This folder contains a set of requirements describing Xen and its implementation
> +in a form suitable for a safety certification process.
> +
> +The status is experimental and it is maintained on a best effort basis. The
> +requirements may get slightly out of sync with the code. We are actively working
> +on a process to keep them updated, more details to follow.
> +
> +The requirements writing style is inspired from the ANSI/IEEE guide to Software
> +Requirements Standard 830-1984.
> +
> +The requirements are categorized as follows :-
> +
> +1. Market requirements - They define the high level functionalities of the
> +hypervisor without going into concepts specific to Xen. Those should allow a
> +system architect to understand wether Xen is providing the functionalities it
> +needs for its system. This is the top level of the requirements.
> +
> +2. Product requirements - They define the Xen specific concepts and interfaces
> +provided by Xen without going into implementation details. One or several of
> +those requirements are linked to each market requirement. An Architect can use
> +them understand how Xen fulfils a market need and design how Xen should be used
> +in his system.
> +
> +3. Design requirements - They describe what the software implementation is doing
> +from a technical point of view. One or several design requirement together
> +define how product requirements are fulfilled technically and are linked to
> +them. An implementer can use them to know how to write or understand the Xen
> +code.
> +
> +The requirements are linked using OpenFastTrace
> +(https://github.com/itsallcode/openfasttrace/blob/main/doc/user_guide.md).
> +OpenFastTrace parses through the requirements and generates a traceability
> +report.
> +
> +The following is the skeleton for a requirement.
> +
> +Title  /* Title of the requirement */
> +-----
> +
> +`unique_tag`
> +/*
> + * Each requirement needs to have a unique tag associated. The format is
> + * req_type~name~revision.
> + *
> + * Thus, it consists of three components :-
> + * requirement type - This denotes the category of requirement. Thus, it shall
> + * be 'XenMkt', 'XenProd' or 'XenSwdgn' to denote market, product or design
> + * requirement.
> + * name - This denotes name of the requirement. In case of architecture specific
> + * requirements, this starts with the architecture type (ie x86_64, arm64).
> + * revision number - This gets incremented each time the requirement is modified.
> + */
> +
> +Description:
> +This shall describe the requirement in a definitive tone. In other words,
> +the requirement begins with 'Xen shall ...'. Further, the description is
> +expected to be unambiguous and consistent.
> +
> +Rationale:
> +This describes a rationale explaining the reason of the presence of the
> +requirement when this can help the reader. This field can be left blank.
> +
> +Comments:
> +This describes the use cases for the requirement when this can help the
> +reader. This field can be left blank as well.
> +
> +Covers:
> +This denotes the unique_tag of the parent. This field is non existent for the
> +market requirement as it is the top level.
> +
> +Needs:
> +This denotes the requirement type of its children. This field is non existent
> +for the design requirements as there are no subsequent requirements linked to
> +them.
> +
> +
> +The requirements are expected to the technically correct and follow the above
> +guidelines.
> -- 
> 2.25.1
> 


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 21:20:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 21:20:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771333.1181938 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZzhg-0004Nm-Ru; Fri, 02 Aug 2024 21:20:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771333.1181938; Fri, 02 Aug 2024 21:20:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sZzhg-0004Nf-P2; Fri, 02 Aug 2024 21:20:48 +0000
Received: by outflank-mailman (input) for mailman id 771333;
 Fri, 02 Aug 2024 21:20:46 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=XJnr=PB=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sZzhe-0004NZ-R6
 for xen-devel@lists.xenproject.org; Fri, 02 Aug 2024 21:20:46 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 13acc28f-5115-11ef-8776-851b0ebba9a2;
 Fri, 02 Aug 2024 23:20:44 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 6035B628BC;
 Fri,  2 Aug 2024 21:20:43 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2506AC32782;
 Fri,  2 Aug 2024 21:20:42 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 13acc28f-5115-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1722633643;
	bh=gZieMJsogEOuFTWGeMFfv426PVhIQ7ykKlKqIJsIQH8=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=QFGNZ3WbIAYkIsYR0JkLUWctDvsvU9sCtgeXtMO4M840WNIMPj0jJUI4vZekm5Dx9
	 2HhuuwUtyXRJDB3y/IJbXbllPW7Mq6iexxodUqRwKd9bXaAwLdmrP1peON3li/jOIP
	 6gnx1SGPwWuTcRsMYyQRbzISFDPQLCJRTvxAVPsSnwI2CqSRkxNjt98DYyQzDKy3vc
	 cjovrGpk6BGe20UPE8zdSo2gV+UsSac0tPBgXt5kk4MF551XF2zqGsrTSr32e5t0n7
	 k0zSlj2Tn2n8gkBhjaess6I/yNIuz8L/paul3bY+jANjlLXr8Y95SRscdeGOYco8V/
	 2S2YWWvHi2X0w==
Date: Fri, 2 Aug 2024 14:20:41 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
cc: xen-devel@lists.xenproject.org, 
    Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH] xen/arm: vITS: add #msi-cells property
In-Reply-To: <20240802182654.8976-1-stewart.hildebrand@amd.com>
Message-ID: <alpine.DEB.2.22.394.2408021420320.114241@ubuntu-linux-20-04-desktop>
References: <20240802182654.8976-1-stewart.hildebrand@amd.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 2 Aug 2024, Stewart Hildebrand wrote:
> Non-PCI platform devices may use the ITS. Dom0 Linux drivers for such
> devices are failing to register IRQs due to a missing #msi-cells
> property. Add the missing #msi-cells property.
> 
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> See Linux dc4dae00d82f ("Docs: dt: add #msi-cells to GICv3 ITS binding")
> ---
>  xen/arch/arm/gic-v3-its.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
> index 8afcd9783bc8..55bed3fe87d0 100644
> --- a/xen/arch/arm/gic-v3-its.c
> +++ b/xen/arch/arm/gic-v3-its.c
> @@ -951,6 +951,10 @@ int gicv3_its_make_hwdom_dt_nodes(const struct domain *d,
>          if ( res )
>              return res;
>  
> +        res = fdt_property_cell(fdt, "#msi-cells", 1);
> +        if ( res )
> +            return res;
> +
>          if ( its->phandle )
>          {
>              res = fdt_property_cell(fdt, "phandle", its->phandle);
> 
> base-commit: 984cb316cb27b53704c607e640a7dd2763b898ab
> -- 
> 2.45.2
> 


From xen-devel-bounces@lists.xenproject.org Fri Aug 02 22:45:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 02 Aug 2024 22:45:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771348.1181955 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sa11W-0007nY-TA; Fri, 02 Aug 2024 22:45:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771348.1181955; Fri, 02 Aug 2024 22:45:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sa11W-0007nR-Py; Fri, 02 Aug 2024 22:45:22 +0000
Received: by outflank-mailman (input) for mailman id 771348;
 Fri, 02 Aug 2024 22:45:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sa11W-0007nH-1B; Fri, 02 Aug 2024 22:45:22 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sa11V-0007xp-ML; Fri, 02 Aug 2024 22:45:21 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sa11U-0008V2-TN; Fri, 02 Aug 2024 22:45:21 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sa11U-00066K-Sz; Fri, 02 Aug 2024 22:45:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=6ypoMoV9pi+Qv77qRKzYLuN+Tz7hjtc/VORdR6YWft0=; b=A/OqrlxT5oWqjZdzhnecfxmPUJ
	7uGc9qlw4idNDFOUdQv7yM365f8tFx1pzcaYkmZHwn1F2Piof4w9VBdSAf4S8eY2zp6WQOvsmJdXg
	U6BPUEsuHHhBb3YkeVSLzsvDj+SeJuHw4jX4nIpbnBHDONqvJT9xidCcwSaiMRWXN8wQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187121-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.19-testing test] 187121: regressions - FAIL
X-Osstest-Failures:
    xen-4.19-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:regression
    xen-4.19-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=026c9fa29716b0ff0f8b7c687908e71ba29cf239
X-Osstest-Versions-That:
    xen=fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 02 Aug 2024 22:45:20 +0000

flight 187121 xen-4.19-testing real [real]
flight 187126 xen-4.19-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187121/
http://logs.test-lab.xenproject.org/osstest/logs/187126/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop       fail REGR. vs. 187044

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

version targeted for testing:
 xen                  026c9fa29716b0ff0f8b7c687908e71ba29cf239
baseline version:
 xen                  fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e

Last test of basis   187044  2024-07-29 16:07:22 Z    4 days
Testing same since   187048  2024-07-30 01:41:30 Z    3 days    6 attempts

------------------------------------------------------------
People who touched revisions under test:
  Julien Grall <jgrall@amazon.com>

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


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

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

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

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


Not pushing.

------------------------------------------------------------
commit 026c9fa29716b0ff0f8b7c687908e71ba29cf239
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:45 2024 +0100

    Set 4.19 version
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit df9b8a649f0424e0a949c0f9a7961724bbe8ea70
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:08 2024 +0100

    README: make heading say 4.19
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit b2d2878ab2686b92fcdd7bbca4ff4c312a42bc11
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:18:01 2024 +0100

    Config.mk: Bump tags to 4.19.0 final
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Sat Aug 03 00:52:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Aug 2024 00:52:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771363.1181967 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sa30S-0001HB-VU; Sat, 03 Aug 2024 00:52:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771363.1181967; Sat, 03 Aug 2024 00:52:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sa30S-0001H3-QX; Sat, 03 Aug 2024 00:52:24 +0000
Received: by outflank-mailman (input) for mailman id 771363;
 Sat, 03 Aug 2024 00:52:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sa30R-0001Gt-8E; Sat, 03 Aug 2024 00:52:23 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sa30Q-0002fO-SZ; Sat, 03 Aug 2024 00:52:22 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sa30Q-00047F-Fa; Sat, 03 Aug 2024 00:52:22 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sa30Q-0007zE-F4; Sat, 03 Aug 2024 00:52:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=S603AAcyH9UGRYoYdL+qIqZaP7wtN6TdQ/b3kkYZ+iE=; b=fewlITgU2+n9X43s1/CgCuDTtT
	QcvX896cB5XZRU8M5V1lj5TIk9LgCZZCjoVbQF1J1+Iy0Dce3qY1ntGIz4aWIurv5Sun1zkIsETS9
	VRKMt10jlxSclP6MDfkGPnhpgBaUQ2+IBKHxyLvyjABK/mtnKZMERkipnN+YKyT/XIs0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187127-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187127: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=ded5474718a84366dac80aae039a693b66fa7e2e
X-Osstest-Versions-That:
    xen=984cb316cb27b53704c607e640a7dd2763b898ab
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 03 Aug 2024 00:52:22 +0000

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

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  ded5474718a84366dac80aae039a693b66fa7e2e
baseline version:
 xen                  984cb316cb27b53704c607e640a7dd2763b898ab

Last test of basis   187118  2024-08-02 07:00:24 Z    0 days
Testing same since   187127  2024-08-02 22:02:05 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Bertrand Marquis <bertrand.marquis@arm.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Stefano Stabellini <sstabellini@kernel.org>
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   984cb316cb..ded5474718  ded5474718a84366dac80aae039a693b66fa7e2e -> smoke


From xen-devel-bounces@lists.xenproject.org Sat Aug 03 03:15:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Aug 2024 03:15:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771379.1181976 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sa5ER-00075e-Kt; Sat, 03 Aug 2024 03:14:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771379.1181976; Sat, 03 Aug 2024 03:14:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sa5ER-00075X-HP; Sat, 03 Aug 2024 03:14:59 +0000
Received: by outflank-mailman (input) for mailman id 771379;
 Sat, 03 Aug 2024 03:14:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sa5EQ-00075N-4i; Sat, 03 Aug 2024 03:14:58 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sa5EP-0008Lj-WA; Sat, 03 Aug 2024 03:14:58 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sa5EP-0001IW-JC; Sat, 03 Aug 2024 03:14:57 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sa5EP-0004ub-If; Sat, 03 Aug 2024 03:14:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=oqYJDRxiCZhv3q9UoYWzegTXO2cfkvOs0bEeU6ak0os=; b=AeohnoQv9vJn3d+YYAk5roxv6g
	/676G1ucr7RwbJUujgs0YaWeJcQ+Hz7+Bn9fFNP6EaKZvMKmCijR5oT2zUbVy5kzbQo3hWSpoT2RH
	bkIdcBMaQEuub7GopjeQ5OzaXJJWld+KIEv7FlZn/6zxu+stGD/TiBTHISp5p4StHIug=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187123-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187123: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=c0ecd6388360d930440cc5554026818895199923
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 03 Aug 2024 03:14:57 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827

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

version targeted for testing:
 linux                c0ecd6388360d930440cc5554026818895199923
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   17 days
Failing since        186925  2024-07-20 09:44:52 Z   13 days   29 attempts
Testing same since   187115  2024-08-02 00:13:00 Z    1 days    2 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Sat Aug 03 06:17:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Aug 2024 06:17:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771401.1181985 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sa84g-0007a4-6q; Sat, 03 Aug 2024 06:17:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771401.1181985; Sat, 03 Aug 2024 06:17:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sa84g-0007Zx-3x; Sat, 03 Aug 2024 06:17:06 +0000
Received: by outflank-mailman (input) for mailman id 771401;
 Sat, 03 Aug 2024 06:17:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ktMO=PC=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1sa84e-0007Zq-On
 for xen-devel@lists.xenproject.org; Sat, 03 Aug 2024 06:17:04 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ffb3cec1-515f-11ef-bc03-fd08da9f4363;
 Sat, 03 Aug 2024 08:17:02 +0200 (CEST)
Received: from support.bugseng.com (support.bugseng.com [162.55.131.47])
 by support.bugseng.com (Postfix) with ESMTPA id C8F744EE0737;
 Sat,  3 Aug 2024 08:17:01 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ffb3cec1-515f-11ef-bc03-fd08da9f4363
MIME-Version: 1.0
Date: Sat, 03 Aug 2024 08:17:01 +0200
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, nicola.vetrini@bugseng.com,
 consulting@bugseng.com
Subject: Re: [PATCH] automation: fix eclair scanning for merge requests
In-Reply-To: <alpine.DEB.2.22.394.2408011500280.114241@ubuntu-linux-20-04-desktop>
References: <alpine.DEB.2.22.394.2408011500280.114241@ubuntu-linux-20-04-desktop>
Message-ID: <f5990dbcf0131768fdfd35bfdfd8930c@bugseng.com>
X-Sender: nicola.vetrini@bugseng.com
Organization: BUGSENG s.r.l.
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit

On 2024-08-02 00:06, Stefano Stabellini wrote:
> The ECLAIR jobs part of the Gitlab CI pipeline fail reliably when the
> pipeline is started from a merge request. This is the error:
> 
> Unexpected event pull_request
> 
> The error is a consequence of action.settings setting 
> event=pull_request
> for merge_request_event. Given that we don't need any special behavior
> from ECLAIR for merge requests, just run the regular scan, change
> action.settings to set event=push for merge_request_event (same as for
> pipeline triggered by git push).
> 

According to my analysis, the error stems from the fact that 
automation/scripts/eclair unconditionally calls action_push.sh, which is 
not designed to handle merge requests (that would be 
action_pull_request.sh). One approach, that needs to be tested, could be 
to execute that second script based on the value of 
${CI_PIPELINE_SOURCE}.

The main difference the approach taken in this patch is that the 
analysis results will be relative to the nearest merge point with the 
staging tree. If that's not something that is desired, then this 
approach looks good to me.

> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
> 
> ---
> Example of a failure:
> https://gitlab.com/xen-project/hardware/xen/-/jobs/7486162928
> 
> Example of a success with this patch applies:
> https://gitlab.com/xen-project/people/sstabellini/xen/-/pipelines/1397672866
> 
> diff --git a/automation/eclair_analysis/ECLAIR/action.settings 
> b/automation/eclair_analysis/ECLAIR/action.settings
> index 1577368b61..1bfb22b1c1 100644
> --- a/automation/eclair_analysis/ECLAIR/action.settings
> +++ b/automation/eclair_analysis/ECLAIR/action.settings
> @@ -64,14 +64,11 @@ gitlab)
> 
>      case "${CI_PIPELINE_SOURCE}" in
>      merge_request_event)
> -        event=pull_request
> -        pullRequestId="${CI_MERGE_REQUEST_IID}"
> -        pullRequestHeadRef="${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
> -        pullRequestHeadRepo="${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}"
> -        pullRequestBaseRef="${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}"
> -        pullRequestUser="${GITLAB_USER_LOGIN}"
> +        event=push
> +        ref_kind=branch
> +        ref="${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
>          headCommitId="${CI_COMMIT_SHA}"
> -        baseCommitId="${CI_MERGE_REQUEST_DIFF_BASE_SHA}"
> +        pushUser="${GITLAB_USER_NAME}"
>          ;;
>      push | pipeline | web | schedule)
>          event=push

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Sat Aug 03 07:49:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Aug 2024 07:49:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771422.1181995 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sa9Vh-0003ez-J7; Sat, 03 Aug 2024 07:49:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771422.1181995; Sat, 03 Aug 2024 07:49:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sa9Vh-0003es-GN; Sat, 03 Aug 2024 07:49:05 +0000
Received: by outflank-mailman (input) for mailman id 771422;
 Sat, 03 Aug 2024 07:49:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sa9Vg-0003eg-FO; Sat, 03 Aug 2024 07:49:04 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sa9Vf-0005AN-VZ; Sat, 03 Aug 2024 07:49:04 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sa9Vf-0003SP-7R; Sat, 03 Aug 2024 07:49:03 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sa9Vf-0005dG-6g; Sat, 03 Aug 2024 07:49:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=n2Fwf6bBpvOD3DPkBTSu7FRX1t9melHmUu8SM/yrGM4=; b=5+B4yAMWhjOkS4nYDSn2FM4hxx
	lPSL4KiFoMo5q/Za+N7yP1tuJCwNNiZeocjoA2AJXSj0uV/gM37KgrKKEFcGVB/opvIaT+a9Gf5KR
	SpeLXdGCIiwGJ1XipQOAXVJc8+QazYwCLvMJPtNxFTXOhg/H6rzT9RGYLui0Ek2b2tAk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187125-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187125: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-xl-qcow2:host-ping-check-xen:fail:heisenbug
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=984cb316cb27b53704c607e640a7dd2763b898ab
X-Osstest-Versions-That:
    xen=1c4fb9bb49b7babbcaa0b62384841ba4acb49356
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 03 Aug 2024 07:49:03 +0000

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

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-qcow2    10 host-ping-check-xen fail pass in 187131-retest

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

version targeted for testing:
 xen                  984cb316cb27b53704c607e640a7dd2763b898ab
baseline version:
 xen                  1c4fb9bb49b7babbcaa0b62384841ba4acb49356

Last test of basis   187116  2024-08-02 04:00:58 Z    1 days
Testing same since   187125  2024-08-02 17:10:45 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  George Dunlap <george.dunlap@cloud.com>
  Jan Beulich <jbeulich@suse.com>
  Matthew Barnes <matthew.barnes@cloud.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Roger Pau Monné <roger.pau@citrix.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   1c4fb9bb49..984cb316cb  984cb316cb27b53704c607e640a7dd2763b898ab -> master


From xen-devel-bounces@lists.xenproject.org Sat Aug 03 11:40:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Aug 2024 11:40:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771468.1182022 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saD6r-0002CE-QX; Sat, 03 Aug 2024 11:39:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771468.1182022; Sat, 03 Aug 2024 11:39:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saD6r-0002Bw-Kz; Sat, 03 Aug 2024 11:39:41 +0000
Received: by outflank-mailman (input) for mailman id 771468;
 Sat, 03 Aug 2024 11:39:40 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saD6q-0002Bm-3n; Sat, 03 Aug 2024 11:39:40 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saD6p-0001gG-Ol; Sat, 03 Aug 2024 11:39:39 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saD6p-0008QW-6i; Sat, 03 Aug 2024 11:39:39 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1saD6p-0005PV-6A; Sat, 03 Aug 2024 11:39:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=yZlr9p45+Y/JK+Lnj1opevtkTCbku5m+RRNJUDlJj2I=; b=WyD+wplVc6hPsvQ7Rh7waN0X3e
	zNbAMaIjI3p9n1iKma3VtJt+EGNG6ghu0ayt90uH8fx0G6krXCbPYai38tNcQdjQUUb0t6tuTI/Qq
	Mgn787KZVw3ZiIigc+W6HAHC2yg6fFebBsGdNZb1U6UI7k3aV0uUUIzDUVmY+UJjFelw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187128-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.19-testing test] 187128: regressions - FAIL
X-Osstest-Failures:
    xen-4.19-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:regression
    xen-4.19-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=026c9fa29716b0ff0f8b7c687908e71ba29cf239
X-Osstest-Versions-That:
    xen=fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 03 Aug 2024 11:39:39 +0000

flight 187128 xen-4.19-testing real [real]
flight 187134 xen-4.19-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187128/
http://logs.test-lab.xenproject.org/osstest/logs/187134/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop       fail REGR. vs. 187044

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

version targeted for testing:
 xen                  026c9fa29716b0ff0f8b7c687908e71ba29cf239
baseline version:
 xen                  fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e

Last test of basis   187044  2024-07-29 16:07:22 Z    4 days
Testing same since   187048  2024-07-30 01:41:30 Z    4 days    7 attempts

------------------------------------------------------------
People who touched revisions under test:
  Julien Grall <jgrall@amazon.com>

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


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

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

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

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


Not pushing.

------------------------------------------------------------
commit 026c9fa29716b0ff0f8b7c687908e71ba29cf239
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:45 2024 +0100

    Set 4.19 version
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit df9b8a649f0424e0a949c0f9a7961724bbe8ea70
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:08 2024 +0100

    README: make heading say 4.19
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit b2d2878ab2686b92fcdd7bbca4ff4c312a42bc11
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:18:01 2024 +0100

    Config.mk: Bump tags to 4.19.0 final
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Sat Aug 03 14:57:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Aug 2024 14:57:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771499.1182031 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saGBi-0004Km-8S; Sat, 03 Aug 2024 14:56:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771499.1182031; Sat, 03 Aug 2024 14:56:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saGBi-0004Kf-5v; Sat, 03 Aug 2024 14:56:54 +0000
Received: by outflank-mailman (input) for mailman id 771499;
 Sat, 03 Aug 2024 14:56:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saGBg-0004KC-5r; Sat, 03 Aug 2024 14:56:52 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saGBf-0005FX-Py; Sat, 03 Aug 2024 14:56:51 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saGBf-0007qW-6G; Sat, 03 Aug 2024 14:56:51 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1saGBf-0006fE-5V; Sat, 03 Aug 2024 14:56:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=qFW8zYj/TaHQi9s7UM9GdJpFtvmuUx619I3lRvqHwhM=; b=mRbF6+bC0I9w35yuAFTIy3LkdF
	D2RVzZc/n4mZojKGKmsoSIW0m+8QAkVWVKtZIsXb/ocdCN35qU7ozBZLfEQML18UsurW7IhDOkjDD
	9CPV+0OiM55o905G776v0C7/yFR0W29SUYiunsw60917EyBESgNWtkeLj+5VbYJ/ta48=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187129-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187129: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:build-armhf:xen-build:fail:regression
    linux-linus:build-armhf-libvirt:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-examine:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-libvirt:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:build-check(1):blocked:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=17712b7ea0756799635ba159cc773082230ed028
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 03 Aug 2024 14:56:51 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 build-armhf                   6 xen-build                fail REGR. vs. 186827

Tests which did not succeed, but are not blocking:
 build-armhf-libvirt           1 build-check(1)               blocked  n/a
 test-armhf-armhf-examine      1 build-check(1)               blocked  n/a
 test-armhf-armhf-libvirt      1 build-check(1)               blocked  n/a
 test-armhf-armhf-libvirt-vhd  1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl           1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-arndale   1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-credit1   1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-credit2   1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-multivcpu  1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-qcow2     1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-raw       1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-rtds      1 build-check(1)               blocked  n/a
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 186827
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                17712b7ea0756799635ba159cc773082230ed028
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   17 days
Failing since        186925  2024-07-20 09:44:52 Z   14 days   30 attempts
Testing same since   187129  2024-08-03 03:20:13 Z    0 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Sat Aug 03 16:50:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Aug 2024 16:50:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771517.1182042 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saHx6-0003gH-4t; Sat, 03 Aug 2024 16:49:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771517.1182042; Sat, 03 Aug 2024 16:49:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saHx6-0003gA-1N; Sat, 03 Aug 2024 16:49:56 +0000
Received: by outflank-mailman (input) for mailman id 771517;
 Sat, 03 Aug 2024 16:49:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saHx5-0003fk-Bd; Sat, 03 Aug 2024 16:49:55 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saHx5-0007ac-6c; Sat, 03 Aug 2024 16:49:55 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saHx4-00048r-PD; Sat, 03 Aug 2024 16:49:54 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1saHx4-0003V8-Or; Sat, 03 Aug 2024 16:49:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=J60hmfHzCUKhU8IXqGkcg82j2hNqscryGv8eWrUQqNg=; b=hZ29ssL1bT3d9qdI/i38nSKNq9
	kNGXXy8KvKDS/XqhRlpfsnLSlKQ64wi67q7vWsGGMhufq7ew/ys6LZxG3ZfIJo3HeMTB0Ng4IFwUp
	k1QFNwCWlCUpoYQ7QAs+TgyGrgIxe4RaIw1wr/TreyfaMR/WJWtu3DkplB/UGvZRV6NE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187130-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187130: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=6b521fef8c672689b69443f26a11e267f13c225d
X-Osstest-Versions-That:
    libvirt=ac0b669c562574b3b5c94ce6f922819bb0a21bf1
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 03 Aug 2024 16:49:54 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 libvirt              6b521fef8c672689b69443f26a11e267f13c225d
baseline version:
 libvirt              ac0b669c562574b3b5c94ce6f922819bb0a21bf1

Last test of basis   187099  2024-08-01 04:19:04 Z    2 days
Testing same since   187130  2024-08-03 04:21:40 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Göran Uddeborg <goeran@uddeborg.se>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   ac0b669c56..6b521fef8c  6b521fef8c672689b69443f26a11e267f13c225d -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sat Aug 03 23:56:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Aug 2024 23:56:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771549.1182052 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saObm-0002gD-QD; Sat, 03 Aug 2024 23:56:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771549.1182052; Sat, 03 Aug 2024 23:56:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saObm-0002g5-L3; Sat, 03 Aug 2024 23:56:22 +0000
Received: by outflank-mailman (input) for mailman id 771549;
 Sat, 03 Aug 2024 23:56:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saObl-0002fv-3k; Sat, 03 Aug 2024 23:56:21 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saObk-000706-OW; Sat, 03 Aug 2024 23:56:20 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saObk-0000G9-4m; Sat, 03 Aug 2024 23:56:20 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1saObk-0001SH-4F; Sat, 03 Aug 2024 23:56:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=qfK1rhaNLgEPbBQsyN2UAD98aKPtV1d2slJCNKa9DgY=; b=gAgknFb84yIO09PP+AmpaKNd3R
	Fm+MoYF9Q0bxYs0Z+4+XQJDSfZGXaiZI8BFCB6nzMMgVmYwMmaIKLmifMYlY5TWpDfQGeSuSauLVp
	GhyqnRhdPA5YRs5/EKaYqlS5xTNdhhgvEmAH9RSywOGQBpHbe22PeUkO1tXMaHr2CZ7c=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187132-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-6.1 test] 187132: regressions - FAIL
X-Osstest-Failures:
    linux-6.1:test-armhf-armhf-xl:guest-start/debian.repeat:fail:regression
    linux-6.1:test-armhf-armhf-xl:xen-boot:fail:heisenbug
    linux-6.1:test-armhf-armhf-xl-credit1:xen-boot:fail:heisenbug
    linux-6.1:test-armhf-armhf-xl-raw:debian-di-install:fail:heisenbug
    linux-6.1:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=48d525b0e4634c487cf46a41c1e2824e9ee258ce
X-Osstest-Versions-That:
    linux=c1cec4dad96b5e49c2b7680f7246acf58d4c87da
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 03 Aug 2024 23:56:20 +0000

flight 187132 linux-6.1 real [real]
flight 187137 linux-6.1 real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187132/
http://logs.test-lab.xenproject.org/osstest/logs/187137/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-xl         18 guest-start/debian.repeat fail REGR. vs. 187026

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl           8 xen-boot         fail in 187137 pass in 187132
 test-armhf-armhf-xl-credit1   8 xen-boot            fail pass in 187137-retest
 test-armhf-armhf-xl-raw      12 debian-di-install   fail pass in 187137-retest

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

version targeted for testing:
 linux                48d525b0e4634c487cf46a41c1e2824e9ee258ce
baseline version:
 linux                c1cec4dad96b5e49c2b7680f7246acf58d4c87da

Last test of basis   187026  2024-07-27 09:43:41 Z    7 days
Testing same since   187132  2024-08-03 07:13:30 Z    0 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Sun Aug 04 01:51:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Aug 2024 01:51:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771563.1182065 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saQP2-0005sN-TY; Sun, 04 Aug 2024 01:51:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771563.1182065; Sun, 04 Aug 2024 01:51:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saQP2-0005sF-NS; Sun, 04 Aug 2024 01:51:20 +0000
Received: by outflank-mailman (input) for mailman id 771563;
 Sun, 04 Aug 2024 01:51:20 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saQP1-0005s5-Uu; Sun, 04 Aug 2024 01:51:19 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saQP1-0003xV-GK; Sun, 04 Aug 2024 01:51:19 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saQP0-00032D-Sz; Sun, 04 Aug 2024 01:51:19 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1saQP0-0005sp-SN; Sun, 04 Aug 2024 01:51:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=TcFA3dGF9R+ZV+lVjU6waVQyiSvSh37hLMp/fCRTAZ0=; b=4YMAzcRMX1UHom97a1WNyHgqBq
	jTTGcmVNmsx5bxZZqsya1fydaVYIULunscoMQN7xqSgjCmXB/4CNStNTBdF7U+D00tO0lDil/aDnk
	s97aucAxGPwjyTeDCF6xPoJxiuwkLycX21bFvM+fxkD+huKEoGDsKVbw+RVl4tXKcjDw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187133-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187133: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=ded5474718a84366dac80aae039a693b66fa7e2e
X-Osstest-Versions-That:
    xen=984cb316cb27b53704c607e640a7dd2763b898ab
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 04 Aug 2024 01:51:18 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 xen                  ded5474718a84366dac80aae039a693b66fa7e2e
baseline version:
 xen                  984cb316cb27b53704c607e640a7dd2763b898ab

Last test of basis   187125  2024-08-02 17:10:45 Z    1 days
Testing same since   187133  2024-08-03 07:51:35 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Bertrand Marquis <bertrand.marquis@arm.com>
  Nicola Vetrini <nicola.vetrini@bugseng.com>
  Stefano Stabellini <sstabellini@kernel.org>
  Stefano Stabellini <stefano.stabellini@amd.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   984cb316cb..ded5474718  ded5474718a84366dac80aae039a693b66fa7e2e -> master


From xen-devel-bounces@lists.xenproject.org Sun Aug 04 06:47:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Aug 2024 06:47:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771585.1182089 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saV1g-00054A-49; Sun, 04 Aug 2024 06:47:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771585.1182089; Sun, 04 Aug 2024 06:47:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saV1f-000540-US; Sun, 04 Aug 2024 06:47:31 +0000
Received: by outflank-mailman (input) for mailman id 771585;
 Sun, 04 Aug 2024 06:47:30 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saV1e-00053q-Kv; Sun, 04 Aug 2024 06:47:30 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saV1e-0002aQ-Dd; Sun, 04 Aug 2024 06:47:30 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saV1d-00009E-Uz; Sun, 04 Aug 2024 06:47:30 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1saV1d-000728-RT; Sun, 04 Aug 2024 06:47:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=LJ80Kf/Nh3/0r//v6SVfyG+nboZ27MPBRhniXxouXmQ=; b=WY2/mj+lxPWPkiqjKgRQsIE2Cw
	0x9jeBshObwDC4Fh7h1Opc9X4fdIbvruHz0rKb173731D29ylD8MsFVLPqHoC94TYV8wN7PiF8ANc
	mRJfVS7T4v33B/VZ93NYscqrDefFR62P1p19PAnbecXx7/Fs38qTHPHeiPpdNLaXLMKQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187135-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.19-testing test] 187135: regressions - FAIL
X-Osstest-Failures:
    xen-4.19-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:regression
    xen-4.19-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=026c9fa29716b0ff0f8b7c687908e71ba29cf239
X-Osstest-Versions-That:
    xen=fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 04 Aug 2024 06:47:29 +0000

flight 187135 xen-4.19-testing real [real]
flight 187142 xen-4.19-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187135/
http://logs.test-lab.xenproject.org/osstest/logs/187142/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop       fail REGR. vs. 187044

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

version targeted for testing:
 xen                  026c9fa29716b0ff0f8b7c687908e71ba29cf239
baseline version:
 xen                  fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e

Last test of basis   187044  2024-07-29 16:07:22 Z    5 days
Testing same since   187048  2024-07-30 01:41:30 Z    5 days    8 attempts

------------------------------------------------------------
People who touched revisions under test:
  Julien Grall <jgrall@amazon.com>

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


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

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

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

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


Not pushing.

------------------------------------------------------------
commit 026c9fa29716b0ff0f8b7c687908e71ba29cf239
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:45 2024 +0100

    Set 4.19 version
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit df9b8a649f0424e0a949c0f9a7961724bbe8ea70
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:08 2024 +0100

    README: make heading say 4.19
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit b2d2878ab2686b92fcdd7bbca4ff4c312a42bc11
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:18:01 2024 +0100

    Config.mk: Bump tags to 4.19.0 final
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Sun Aug 04 10:35:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Aug 2024 10:35:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771615.1182102 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saYZn-0003DP-KK; Sun, 04 Aug 2024 10:34:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771615.1182102; Sun, 04 Aug 2024 10:34:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saYZn-0003DI-HH; Sun, 04 Aug 2024 10:34:59 +0000
Received: by outflank-mailman (input) for mailman id 771615;
 Sun, 04 Aug 2024 10:34:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saYZl-0003D8-WA; Sun, 04 Aug 2024 10:34:58 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saYZl-00077Y-Mm; Sun, 04 Aug 2024 10:34:57 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saYZl-0002BQ-5r; Sun, 04 Aug 2024 10:34:57 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1saYZl-0004bL-3n; Sun, 04 Aug 2024 10:34:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=UuNyDZxatiNfKt5MHb08RqPTG/1nHJP93U4foXNatQo=; b=sqPvBqZ8ZhObSUg20tc9nZbgB9
	MM5ng0M1/8Fm9vhM+1Uum/hDks6eYbuwKGG3vEP8JNUQ+JclN3mYm0H96xG2B034zDbyVVN5BIh4l
	gCGMDtv03xGO6KjxH+llLbB2M7ZfxfVtjGKwteTOHSfmuI7+o+AxgH20p1iNQFEvbOUk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187136-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187136: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:build-armhf:xen-build:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-credit2:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:build-check(1):blocked:nonblocking
    linux-linus:build-armhf-libvirt:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-examine:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-libvirt:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=17712b7ea0756799635ba159cc773082230ed028
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 04 Aug 2024 10:34:57 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 build-armhf                   6 xen-build      fail in 187129 REGR. vs. 186827

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 187129

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-credit2   1 build-check(1)           blocked in 187129 n/a
 test-armhf-armhf-xl-raw       1 build-check(1)           blocked in 187129 n/a
 build-armhf-libvirt           1 build-check(1)           blocked in 187129 n/a
 test-armhf-armhf-xl-credit1   1 build-check(1)           blocked in 187129 n/a
 test-armhf-armhf-examine      1 build-check(1)           blocked in 187129 n/a
 test-armhf-armhf-libvirt      1 build-check(1)           blocked in 187129 n/a
 test-armhf-armhf-xl-qcow2     1 build-check(1)           blocked in 187129 n/a
 test-armhf-armhf-xl-arndale   1 build-check(1)           blocked in 187129 n/a
 test-armhf-armhf-libvirt-vhd  1 build-check(1)           blocked in 187129 n/a
 test-armhf-armhf-xl           1 build-check(1)           blocked in 187129 n/a
 test-armhf-armhf-xl-rtds      1 build-check(1)           blocked in 187129 n/a
 test-armhf-armhf-xl-multivcpu  1 build-check(1)          blocked in 187129 n/a
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 186827
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 186827
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                17712b7ea0756799635ba159cc773082230ed028
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   18 days
Failing since        186925  2024-07-20 09:44:52 Z   15 days   31 attempts
Testing same since   187129  2024-08-03 03:20:13 Z    1 days    2 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Sun Aug 04 10:51:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Aug 2024 10:51:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771627.1182112 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saYps-0006M9-2O; Sun, 04 Aug 2024 10:51:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771627.1182112; Sun, 04 Aug 2024 10:51:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saYpr-0006M2-Ug; Sun, 04 Aug 2024 10:51:35 +0000
Received: by outflank-mailman (input) for mailman id 771627;
 Sun, 04 Aug 2024 10:51:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saYpr-0006Ls-0g; Sun, 04 Aug 2024 10:51:35 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saYpq-0007QP-R7; Sun, 04 Aug 2024 10:51:34 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saYpq-0002gq-Fn; Sun, 04 Aug 2024 10:51:34 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1saYpq-0001lT-FB; Sun, 04 Aug 2024 10:51:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=YwMIKHz1bbN8zAtraR8zRywUAhh3LqCqaCVLuj5nRgw=; b=rwz9LC70x/4CFIT/IOCewdfnXY
	bWK+SmOQdbNrjvgfGuBNYYk3kbJ/ES4eXxs35M41RrRdbfRoVgO+de5PTU0AcD9vuxybdJJ4s+IMT
	t3iFayJNB6d+eOyPXCbdMjae6lUJtobjl6QtKu+w5KfM/4TeJIilqztVJP/Y1OMLOXsc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187144-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187144: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=159f1aee56d270d2575e50eb2af077abe182fc9b
X-Osstest-Versions-That:
    ovmf=f203a6db92eedf03ac544ed270404cb29d3dea7f
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 04 Aug 2024 10:51:34 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 159f1aee56d270d2575e50eb2af077abe182fc9b
baseline version:
 ovmf                 f203a6db92eedf03ac544ed270404cb29d3dea7f

Last test of basis   187124  2024-08-02 13:11:29 Z    1 days
Testing same since   187144  2024-08-04 07:41:35 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Aaron Pop <aaronpop@microsoft.com>
  Joey Vagedes <joeyvagedes@microsoft.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   f203a6db92..159f1aee56  159f1aee56d270d2575e50eb2af077abe182fc9b -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sun Aug 04 12:56:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Aug 2024 12:56:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771645.1182121 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saamF-0006AA-Mq; Sun, 04 Aug 2024 12:55:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771645.1182121; Sun, 04 Aug 2024 12:55:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saamF-0006A3-KL; Sun, 04 Aug 2024 12:55:59 +0000
Received: by outflank-mailman (input) for mailman id 771645;
 Sun, 04 Aug 2024 12:55:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saamE-00069s-HA; Sun, 04 Aug 2024 12:55:58 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saamE-0001hW-Aq; Sun, 04 Aug 2024 12:55:58 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saamE-0000LC-37; Sun, 04 Aug 2024 12:55:58 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1saamE-0000dF-2P; Sun, 04 Aug 2024 12:55:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=KH27cPa20AbXR6ha/9kQuRFKr5r9LgEcIYhOGTm4sy0=; b=HdEE6yK7ugzdXCdQSTvAcCVYdZ
	nWjs935dnoVO5YZKs8r/uybjYF+lJWeZGzI9VxvJYpciT/2h58SuWapimjsaWZcKAin+2yJhqoAMG
	Qsy2dRv8NoPWg+xM0BoXqOR3UGvb6tt9XPp100iUy2eAOwKuJPS8bgSkF3976SClxD9E=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187146-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187146: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=5ff99e0dabefea14b04e190c1659f4817fcb7bc0
X-Osstest-Versions-That:
    ovmf=159f1aee56d270d2575e50eb2af077abe182fc9b
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 04 Aug 2024 12:55:58 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 5ff99e0dabefea14b04e190c1659f4817fcb7bc0
baseline version:
 ovmf                 159f1aee56d270d2575e50eb2af077abe182fc9b

Last test of basis   187144  2024-08-04 07:41:35 Z    0 days
Testing same since   187146  2024-08-04 11:13:58 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Aaron Pop <aaronpop@microsoft.com>
  joe <37425738+JoeLopez333@users.noreply.github.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   159f1aee56..5ff99e0dab  5ff99e0dabefea14b04e190c1659f4817fcb7bc0 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sun Aug 04 13:18:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Aug 2024 13:18:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771659.1182132 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sab7T-0001IS-D6; Sun, 04 Aug 2024 13:17:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771659.1182132; Sun, 04 Aug 2024 13:17:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sab7T-0001IL-9u; Sun, 04 Aug 2024 13:17:55 +0000
Received: by outflank-mailman (input) for mailman id 771659;
 Sun, 04 Aug 2024 13:17:53 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ufFg=PD=yahoo.com=avikalpa@srs-se1.protection.inumbo.net>)
 id 1sab7R-0001IE-5c
 for xen-devel@lists.xenproject.org; Sun, 04 Aug 2024 13:17:53 +0000
Received: from sonic306-20.consmr.mail.sg3.yahoo.com
 (sonic306-20.consmr.mail.sg3.yahoo.com [106.10.241.140])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f09e13c1-5263-11ef-8776-851b0ebba9a2;
 Sun, 04 Aug 2024 15:17:49 +0200 (CEST)
Received: from sonic.gate.mail.ne1.yahoo.com by
 sonic306.consmr.mail.sg3.yahoo.com with HTTP; Sun, 4 Aug 2024 13:17:43 +0000
Received: by hermes--production-sg3-fc85cddf6-6jgr8 (Yahoo Inc. Hermes SMTP
 Server) with ESMTPA ID 37747466b1a90a07168896b733ea2d20; 
 Sun, 04 Aug 2024 13:17:43 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f09e13c1-5263-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1722777463; bh=KTuMdd1zh6HTDH2YhL7095Abn07VWBYYH9xAFPngVZ4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=sQYokT/er7U+fm/NXGGLqGuFrzGTuvsedt9Xuo/YTbGknZ1YJxz9KbWv+INoqKYv4bIe3dtRvGiFrmr95fV9RRKGet98RrQMbQuG1y22B4DCBLIBmzF1IJ+IGdhfFjl7xBsj/jtmv/lNISNqqtOVtxj5Eok1pYbknCZA2CjhCptgUCfQF1O1OgcXBVvXpnonFRYcoMldNpOi8FzJpU7CRkRggXb/4KtFBMOiquZZlCMoRPhwwKgocFZ39UJvxh2KduKo6AONpq1HiRmnVaxIieMJj/2fTDk2ztLdjD/BJip6iTndui9noeXqcK7dZM1oxEz8cbFUQoCu3HExnK1ibA==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1722777463; bh=bI6cyOFgBn+wEt/H6ZDs8QZTm0BWA3SV+KxzWmck2Oy=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=jgtfumF2s+jg3wneMdXT5zyg1fKBUZGZoNNKbeZAIAlH/fXIEM2hBz6hCN6BiR9emG0MyxJUW33B+W5rfeZRx4LwHhidU76zs/mReowJf3COMV48R9kVNFGYMCndgPVx3+0+be0xQx99DCcDduNrjdIil2kVPM8NstHZW2SdaAQMLldXruWogqpWLPXTNM+wOVwXeHBX868gXPX48zz7GYZfYmTsN/aeBfiay9GQKzPw2dEQfrfNVr4UgC6hDNu69D+5Wi+zzk2XMTPq96egtu8jcNRcNJ3EYHIlyG3Ue3XnUifGnss2vA+8utcMmb4S0BlGs+7BIPOhR2lcIXTF/w==
X-YMail-OSG: 8H3zK2oVM1mu_UzawiwNFOMntvun56b2MS1sHxEeFXGjAhcPPi6VSb.KzWVFhJ0
 oM22j1FXUJ3o0Ow1fRxcGKvLyPq1oJsq.0FTvuvWcsymPgHbNptJO7HHUt2CHTAPQpnozVRovt4g
 JSZwu4hFMv7HtfwMjICzaH27b_dgjEcrFEG5yEBy1b7U8.63LKNc_yJp5rMyIP0Nbb16PdwpA0Hj
 ZZmti62AiZuZcxDUkgn8NzA5rYaory68_FPVMlm.N_rZqpVexLk2WmZ5VTuMa4VpKUEcAmT.3ZnX
 OPUqeQkKO8Du2K7gZecRlCTFlyNFgmMh09EBzxA_JHDGIWUs4Cyu3T7oypWPVffJ34HBKbfj8SH3
 BG0NymIE4bgiSgExSFRsc.H8xRNgoo3Wo3OOoFGyiPHOjPBOLXFKRvXp5ggnNecyDKe.CPgCUEoF
 mhAjamf.n2JrZI7MoC4yO48hIevQbIFGq9FanK3rks.kcfuNvZ5dF_zCIUPW1EXWH1hZEu.dvTHf
 Th6vLE6mI_Ifr6d9XTfUfhRXmULxYLdofTSv2TeCNycON4QXREij7aU1YlNlLVISKssUmAORHQUY
 ce18DW0I9T7ySxmpVWCYFRyJdntiThK_TQDu59ekrdIYEkfNnQrtH7htAzBUm3vDX68htfmNEIFd
 V6YzTvO7ASB9kZQJwAp8_brFYkXRgaMnaJVPLTbx64_o79K2N18vSUQ0B7b1R5n8mZfu1cbxHFyP
 QW3Gc7hg3WUp361hcEXsSOFPhdVb9oAHdwbw17wSvF_m27wvVz50vqizz9MQ1qUbnAZvYTp.0ZQp
 OTdz4FRAiPTOo5fO7ZwszKRQvwrU3z88YCxQlr4ucVo31Lzz9C2RhKqeWcRG1AKnTYaQ5GUnUdJ3
 V2iEkYKtZwxgL7Pni7MUl9VrjqRosDwxiGBYpmyfjV05ls.whXh95dNQ4sUEzsRoRvNgbgtLkX6Y
 c.KDMTXqyuMLK9xacUlMfHSDZhBaVF1Rr4s0ptLTA9TKYgcn0JfEAgOyW3DiDwm2BU5r8QTo52Ke
 s.6eOXGZuOIPluvQQAe_4ABXz1KmI3f8r0HAIYKPHj8lEuA0KIV90NsTE3l4Bb1mI_PNQy4O_vTT
 4aHYNtYJiRbY7vTyGoAgRysgmjRabCup4er9vh1rNv4WnPtT2r6wqBsZ_2O.nywtWzP6uMbUi3SX
 StxO2AdlerSzocObWJE7Xs1WrlZV338u9cVRNXfwyfNyvj.Cu0lYx.5iQLB2X9graverN2z0wNrK
 bjtywPRdGn.bQRap3JrKt1K1oI5pcPBg7PvY0TnYfIYZh8zqEjFeiUQdhZnqqkTg1swVWZj4TTHf
 hB5ZYyTH5YMPC7gXnL3LN_F3z4y830VNCc6qE5f.owVTGZZl4M_1Mewr.yAgaZ11Et3yoQPNwiOj
 jwq9qfs2yYaVK5VJuM.3lqnV6lwXqf7FRuNEy7mFys7arcSTxb9otAiptgBFmAofVq7Az1ISh17m
 RNjsehFKK9AjXL0brRsz4D55ilFPr2PQANTrYq58Ubfh5E6_II_25x6ou7vDOEBwp.S0cDwVSGSR
 XGE47HPAcX8dG8dQ2L0XgE8q1BMsYRAUiBUJzsSxyxX1Hxrqn411.GNd7VLpTOvMMNZBck_9e5B.
 GXvFKYLCQZflt6qUAzBS8XIVSxn8Bcs5RxYBejlorXp229rHMW.hkO7jNsdNM5y3Fg.mNl_KAa2C
 BkAZ.WnD0SgWMNm.0FDbunUaGPEKltkSUhMl38NORGP3zs8QNJZJ8q6Gn7jAyjLXMf__q_l.rNIC
 0ZzO_Tvr3GgADDpdkwcjEAr3an__PyZTxhAz.T3Q9DKI89erzYfT5dUj2haQ3oKfFI8YGkb3sEMJ
 HIM9kyMsf3_rTwx2KKCeVgx73SFIQQMK7OsaOyyTiEyDQ.7MivheTg9052BygNQ4jIB1xMflK5j0
 6GjBiyfDhiqhBKsSf0Zo472DuwYKe7YVea9A3aSGhY.k_ivGHj80JrpJhLhCwIrgbLru1yC7UHk7
 _X8KEr8z1atWBrogwIaWpuEKNo5oUBogZbtbqmTbyt3cf4ZjyHS4p_8JPfaJSIywYzGLJB0.VkjY
 zaErbMPlGEz5hAA.TFcwXGmW7sv.PUCq8s1wnRwxl0FxHfc3EpIpDH78MquISftexO8Xmwosi3QM
 USmEcA7P_tlvk_pK3NmYY.rAK9hsYGJu8rgXRJ42qJG6v6AZkWUWi3IC5KN5DekJtfC6q3kYiR52
 oFA--
X-Sonic-MF: <avikalpa@yahoo.com>
X-Sonic-ID: b9a632db-0c31-4574-a195-875efe122acf
Message-ID: <dc5c9dff-6bee-493a-8315-b2eee48bd802@yahoo.com>
Date: Sun, 4 Aug 2024 18:47:23 +0530
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: kexec failure with Xen 4.19-rc4 and 4.20-dev on linux host
To: Jan Beulich <jbeulich@suse.com>
Cc: kexec@lists.infradead.org, horms@verge.net.au,
 xen-devel@lists.xenproject.org, Baoquan He <bhe@redhat.com>,
 andrew.cooper3@citrix.com
References: <05395ed2-3bf3-4926-8e24-c2e7ff37ed26@yahoo.com>
 <cebc7800-df78-4f90-9f8e-82e3f9120b6e@yahoo.com>
 <ZqxUMgcEHakeFPaU@MiWiFi-R3L-srv>
 <abaceb99-4b80-49d7-ab7f-b190f73e858d@yahoo.com>
 <ac57dec1-68a3-471d-8f4c-c87fd9dca619@suse.com>
Content-Language: en-US
From: A Kundu <avikalpa@yahoo.com>
In-Reply-To: <ac57dec1-68a3-471d-8f4c-c87fd9dca619@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Mailer: WebService/1.1.22544 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo
Content-Length: 6805

On 8/2/24 13:25, Jan Beulich wrote:
 > On 02.08.2024 09:28, A Kundu wrote:
 >> On 8/2/24 09:06, Baoquan He wrote:
 >>> On 07/31/24 at 06:34pm, A Kundu wrote:
 >>>> I am experiencing issues using kexec to load Xen 4.17(debian's apt 
version),
 >>>> Xen 4.19-rc4 (compiled from source) and 4.20-dev (compiled from 
source) on a
 >>>> debian host.
 >>> You should CC this to XEN dev list so that XEN dev knows this and may
 >>> provide help. Not everyone is interested in and knows XEN.
 >>>
 >>>> System information:
 >>>> $ uname -a
 >>>> Linux host 6.9.10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.9.10-1 
(2024-07-19)
 >>>> x86_64 GNU/Linux
 >>>>
 >>>> $ kexec --version # compiled from source tarball with ./configure 
--with-xen
 >>>> kexec-tools 2.0.29
 >>>>
 >>>> Steps to reproduce:
 >>>>
 >>>> 1. Set variables:
 >>>>
 >>>> XEN_HYPERVISOR="/boot/xen.gz"
 >>>> XEN_CMD="dom0_mem=6G dom0_max_vcpus=6 dom0_vcpus_pin cpufreq=xen"
 >>>>
 >>>> 2. Attempt to load Xen 4.19-rc4:
 >>>>
 >>>> # kexec -l "$XEN_HYPERVISOR" --command-line="$XEN_CMD"
 >>>> Could not find a free area of memory of 0x3b6001 bytes...
 >>>> elf_exec_build_load_relocatable: ELF exec load failed
 >>>>
 >>>> 3. Attempt to load Xen 4.20-dev:
 >>>>
 >>>> # kexec -l "$XEN_HYPERVISOR" --command-line="$XEN_CMD"
 >>>> Could not find a free area of memory of 0x3f8001 bytes...
 >>>> elf_exec_build_load_relocatable: ELF exec load failed
 >>>>
 >>>> 4. Attempt to load Xen 4.17 (from debian rrepositories):
 >>>> # kexec -l /boot/xen-4.17-amd64.gz --command-line="$XEN_CMD"
 >>>> Could not find a free area of memory of 0x3b4001 bytes...
 >>>> elf_exec_build_load_relocatable: ELF exec load failed
 >
 > And with all of them saying effectively the same, did you verify you
 > actually have a sufficiently large area reserved? The obvious
 > place for you to look at is Xen's boot log (obtained via serial
 > console or "xl dmesg" immediately after booting the system). If you
 > find everything as expected there, ...
 >
 >>>> If you need any further information to investigate this problem,
 >>>> please let me know.
 >
 > ... please provide that boot log.

Dear Jan,

Thank you for your response and suggestions.

As mentioned in my original message, I have already attempted to load
Xen using kexec with various versions (4.17, 4.19-rc4, and 4.20-dev),
all of which resulted in the same error:

Could not find a free area of memory of 0x3b6001 bytes...
elf_exec_build_load_relocatable: ELF exec load failed

I have also followed up on your suggestion to check the Xen boot log
using "xl dmesg", but unfortunately, I received the following error:

xencall: error: Could not obtain handle on privileged command interface: 
No such file or directory
libxl: error: libxl.c:102:libxl_ctx_alloc: cannot open libxc handle: No 
such file or directory
cannot init xl context

This indicates that Xen did not boot successfully, so there are no logs
available.

 >
 > And with all of them saying effectively the same, did you verify you
 > actually have a sufficiently large area reserved? The obvious
 > place for you to look at is Xen's boot log (obtained via serial
 > console or "xl dmesg" immediately after booting the system). If you
 > find everything as expected there, ...
 >

In an attempt to resolve the memory allocation issue, I have tried the
following:

Added a crashkernel=<size>@<offset> parameter to the host kernel command
line to reserve a dedicated memory region for kexec, and attempted to
load Xen into that area.

Experimented with the mem=<size> parameter to limit the amount of memory
used by the host kernel, hoping to leave more contiguous space available
for loading Xen.

Unfortunately, neither of these approaches resolved the issue, and I
still encounter the same memory allocation error when attempting to load
Xen with kexec.

I have also reviewed the available documentation for kexec and Xen, but
much of it appears to be outdated, referencing archaic options like
--vmm which no longer exist in the current version of kexec-tools.

 > Jan

At this point, I'm unsure of how to proceed. I suspect the issue may be
related to changes in the kexec codebase and its interaction with Xen,
as kexec docs for Xen has not been actively maintained since 2017.

git log -1 --format="%ad" -- docs/misc/kexec_and_kdump.txt
Fri Jun 9 14:11:37 2017 +0200

If it's not too much to ask, could you please check if you can
successfully launch the Xen kernel using kexec with kexec-tools
version > 2.x.x and a Linux kernel version >= 6.6?

I have never been able to boot the Xen kernel with anything (syslinux,
zfsbootmenu)other than GRUB and mboot.c32, as used by Citrix or XCP-ng.

In fact, I have never come across a Xen distribution that doesn't rely
on GRUB for xen, which makes me question whether kexec'ing the Xen
kernel is even possible at this point.


For reference, I'm providing a log of my attempts to boot Xen using
ZFSBootMenu (a barebones linux kernel trying to boot via kexec; other 
details irrelevant):

tee: /zfsbootmenu/environments/zroot/ROOT/debian/mnt/var/zbm.log: 
Read-only file system
=== Attempting to Launch Xen ===
Selected Kernel     : /boot/vmlinuz-6.9.12-amd64
Selected initramfs  : /boot/initrd.img-6.9.12-amd64
Selected BE         : zroot/ROOT/debian
Selected Mountpoint : /zfsbootmenu/environments/zroot/ROOT/debian/mnt
ZFSBootMenu kernel commandline: quiet loglevel=0

zfs get org.zfsbootmenu:commandline zroot/ROOT/debian
NAME               PROPERTY VALUE                                        
SOURCE
zroot/ROOT/debian  org.zfsbootmenu:commandline  quiet crashkernel=0M 
memmap=64M$0x100000000  local
(^^^ This is the linux/dom0 commandline, executed by kexec)

=== Memory reported by head /proc/meminfo ===
MemTotal:        8044084 kB
MemFree:         7822332 kB
MemAvailable:    7687320 kB
Buffers:              0 kB
Cached:           49136 kB
SwapCached:           0 kB
Active:           45868 kB
Inactive:             0 kB
Active(anon):     45868 kB
Inactive(anon):       0 kB
=== End of Memory Report ===

Xen kernel found. Attempting kexec...
Xen Kernel Path     : 
/zfsbootmenu/environments/zroot/ROOT/debian/mnt/boot/xen.gz
Try gzip decompression.
Could not find a free area of memory of 0x3ba001 bytes...
elf_exec_build_load_relocatable: ELF exec load failed
Executing kexec...
Nothing has been loaded!

After booting into linux what happens, I have already shared.

If you have any further insights or suggestions on how to overcome this
memory allocation issue or successfully boot Xen using kexec on a modern
system, I would greatly appreciate your guidance.

Thank you for your time and assistance.

Best regards,
A Kundu


From xen-devel-bounces@lists.xenproject.org Sun Aug 04 14:02:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Aug 2024 14:02:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771667.1182142 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sabo7-000065-LC; Sun, 04 Aug 2024 14:01:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771667.1182142; Sun, 04 Aug 2024 14:01:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sabo7-00005x-H0; Sun, 04 Aug 2024 14:01:59 +0000
Received: by outflank-mailman (input) for mailman id 771667;
 Sun, 04 Aug 2024 13:18:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=o17T=PD=decay.netherworld.org=mag@srs-se1.protection.inumbo.net>)
 id 1sab8F-0001m1-LO
 for xen-devel@lists.xen.org; Sun, 04 Aug 2024 13:18:43 +0000
Received: from sinister.netherworld.org (sinister.netherworld.org
 [38.100.53.3]) by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id 11251976-5264-11ef-8776-851b0ebba9a2;
 Sun, 04 Aug 2024 15:18:41 +0200 (CEST)
Received: from decay.netherworld.org (decay.netherworld.org [192.168.6.20])
 by sinister.netherworld.org (8.17.1/8.17.1) with ESMTP id 474DIegj018897
 for <xen-devel@lists.xen.org>; Sun, 4 Aug 2024 09:18:40 -0400
Received: from decay.netherworld.org (localhost [127.0.0.1])
 by decay.netherworld.org (8.17.1/8.17.1) with ESMTP id 474DIeNI015175
 for <xen-devel@lists.xen.org>; Sun, 4 Aug 2024 09:18:40 -0400
Received: (from mag@localhost)
 by decay.netherworld.org (8.17.1/8.17.1/Submit) id 474DIeBq015174;
 Sun, 4 Aug 2024 09:18:40 -0400
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 11251976-5264-11ef-8776-851b0ebba9a2
Date: Sun, 4 Aug 2024 09:18:39 -0400 (EDT)
From: "John E. Krokes" <mag@netherworld.org>
To: xen-devel@lists.xen.org
Subject: [BUG] incorrect "help" output
Message-ID: <c79f8028-6c34-0e25-1445-79e5bcb93890@decay.netherworld.org>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset=US-ASCII

Here's a simple and obvious mistake:


~> xl help | grep vsnd
  vsnd-attach         Create a new virtual sound device
  vsnd-list           List virtual display devices for a domain
  vsnd-detach         Destroy a domain's virtual sound device
  ~>


I'm pretty sure vsnd-list should say "sound devices" instead of
"display devices". The problem is in tools/xl/xl_cmdtable.c.


~> xl info
host                   : hoffa
release                : 6.1.0-23-amd64
version                : #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15)
machine                : x86_64
nr_cpus                : 2
max_cpu_id             : 5
nr_nodes               : 1
cores_per_socket       : 2
threads_per_core       : 1
cpu_mhz                : 3013.706
hw_caps                : 178bf3ff:00802001:ee500800:000037ff:00000000:00000000:00000000:00000180
virt_caps              : pv hvm hap shadow gnttab-v1 gnttab-v2
total_memory           : 4063
free_memory            : 2995
sharing_freed_memory   : 0
sharing_used_memory    : 0
outstanding_claims     : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 17
xen_extra              : .4-pre
xen_version            : 4.17.4-pre
xen_caps               : xen-3.0-x86_64 hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64 
xen_scheduler          : credit2
xen_pagesize           : 4096
platform_params        : virt_start=0xffff800000000000
xen_changeset          : 
xen_commandline        : placeholder dom0_mem=512M,max:512M
cc_compiler            : x86_64-linux-gnu-gcc (Debian 12.2.0-14) 12.2.0
cc_compile_by          : pkg-xen-devel
cc_compile_domain      : lists.alioth.debian.org
cc_compile_date        : Sun Feb  4 15:31:59 UTC 2024
build_id               : d0c85ddff788a56b72811a274a9f56888198eb6e
xend_config_format     : 4
~>


Thanks for your hard work.

-Mag


From xen-devel-bounces@lists.xenproject.org Sun Aug 04 14:56:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Aug 2024 14:56:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771685.1182152 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sacep-0008CB-Gl; Sun, 04 Aug 2024 14:56:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771685.1182152; Sun, 04 Aug 2024 14:56:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sacep-0008C4-DW; Sun, 04 Aug 2024 14:56:27 +0000
Received: by outflank-mailman (input) for mailman id 771685;
 Sun, 04 Aug 2024 14:56:26 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saceo-0008Bu-S7; Sun, 04 Aug 2024 14:56:26 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saceo-0003kJ-BW; Sun, 04 Aug 2024 14:56:26 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sacen-00044N-TD; Sun, 04 Aug 2024 14:56:25 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sacen-0007bO-Sc; Sun, 04 Aug 2024 14:56:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=XL8wxZsZYQHu6K9g1xBiQTs0by7diyvFeVLPuR9DLTA=; b=N/NjF8FG0584JYCp2aWV9xiCj6
	3kifwA2xweVP2OZufBoMbZf1kscZkeBNmeKfqBvnJd62lCShAT3OMFnz1X2a4QNClWt81YkMTpu6A
	I9sSRJtaGrSawT+q8sgAo+VHbbYzEEDSLR7c/Vqtw2GHbjV45lJd+BKVCJ85w63IXPtY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187139-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-6.1 test] 187139: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-6.1:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=48d525b0e4634c487cf46a41c1e2824e9ee258ce
X-Osstest-Versions-That:
    linux=c1cec4dad96b5e49c2b7680f7246acf58d4c87da
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 04 Aug 2024 14:56:25 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 linux                48d525b0e4634c487cf46a41c1e2824e9ee258ce
baseline version:
 linux                c1cec4dad96b5e49c2b7680f7246acf58d4c87da

Last test of basis   187026  2024-07-27 09:43:41 Z    8 days
Testing same since   187132  2024-08-03 07:13:30 Z    1 days    2 attempts

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

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


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

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

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

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


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   c1cec4dad96b..48d525b0e463  48d525b0e4634c487cf46a41c1e2824e9ee258ce -> tested/linux-6.1


From xen-devel-bounces@lists.xenproject.org Sun Aug 04 18:19:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 04 Aug 2024 18:19:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771703.1182163 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1safp1-0002Wi-BX; Sun, 04 Aug 2024 18:19:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771703.1182163; Sun, 04 Aug 2024 18:19:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1safp1-0002Wb-76; Sun, 04 Aug 2024 18:19:11 +0000
Received: by outflank-mailman (input) for mailman id 771703;
 Sun, 04 Aug 2024 18:19:10 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1safp0-0002WR-9i; Sun, 04 Aug 2024 18:19:10 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1safoz-0008BM-Up; Sun, 04 Aug 2024 18:19:09 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1safoz-0000eu-Cs; Sun, 04 Aug 2024 18:19:09 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1safoz-0005lt-CL; Sun, 04 Aug 2024 18:19:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=BBIAxcigYTJ+/Euxz2ow4Dzy9ynyl5STHsMmbzoMC5g=; b=QOnnwtLPRWYUNJY8ZziSsT74m8
	wfo8LysX/18DubKd1DH/LSB5fD9zKkNhFy/oEGs30E+dAfcogDgZ1IaEP7Vnbt/JXYkyT09co0NHQ
	Yv/GP9HHk0ipw3DoKGb7Ltc00zDdO0NrOkNudGsE+AX6XuGwTNInvGNI0fx9vB4DPgUc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187140-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187140: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-libvirt:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=ded5474718a84366dac80aae039a693b66fa7e2e
X-Osstest-Versions-That:
    xen=ded5474718a84366dac80aae039a693b66fa7e2e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 04 Aug 2024 18:19:09 +0000

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

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-libvirt     18 guest-start/debian.repeat  fail pass in 187133

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

version targeted for testing:
 xen                  ded5474718a84366dac80aae039a693b66fa7e2e
baseline version:
 xen                  ded5474718a84366dac80aae039a693b66fa7e2e

Last test of basis   187140  2024-08-04 01:54:56 Z    0 days
Testing same since                          (not found)         0 attempts

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


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

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

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

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


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 00:50:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 00:50:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771721.1182172 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1salvb-0006W9-NP; Mon, 05 Aug 2024 00:50:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771721.1182172; Mon, 05 Aug 2024 00:50:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1salvb-0006W2-IF; Mon, 05 Aug 2024 00:50:23 +0000
Received: by outflank-mailman (input) for mailman id 771721;
 Mon, 05 Aug 2024 00:50:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1salva-0006Vr-6p; Mon, 05 Aug 2024 00:50:22 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1salvZ-0007Xe-Rg; Mon, 05 Aug 2024 00:50:21 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1salvZ-0001qW-AG; Mon, 05 Aug 2024 00:50:21 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1salvZ-0000NH-9o; Mon, 05 Aug 2024 00:50:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=wI3AtxsUv55Oi14D9RiQqbWtRqNfZr7Sp+CkFJM2Vm0=; b=WMecQ3Ru0cdRUSa3KJSMufmfFm
	zxmivCZ6LlQ1x27xLMnrLXdjjCVf+gItyrE3qvteu1ciLd82w5N5Nc6i+iY5zKmvZILnHHalkrGhC
	yipFYZlT7gzCfSr/Bxd2+L81WjdI7qLcl10d5yD2t3dzO3h8F/wX4z+SvivcpCXJZljs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187143-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.19-testing test] 187143: regressions - FAIL
X-Osstest-Failures:
    xen-4.19-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:regression
    xen-4.19-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=026c9fa29716b0ff0f8b7c687908e71ba29cf239
X-Osstest-Versions-That:
    xen=fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 05 Aug 2024 00:50:21 +0000

flight 187143 xen-4.19-testing real [real]
flight 187147 xen-4.19-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187143/
http://logs.test-lab.xenproject.org/osstest/logs/187147/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop       fail REGR. vs. 187044

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

version targeted for testing:
 xen                  026c9fa29716b0ff0f8b7c687908e71ba29cf239
baseline version:
 xen                  fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e

Last test of basis   187044  2024-07-29 16:07:22 Z    6 days
Testing same since   187048  2024-07-30 01:41:30 Z    5 days    9 attempts

------------------------------------------------------------
People who touched revisions under test:
  Julien Grall <jgrall@amazon.com>

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


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

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

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

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


Not pushing.

------------------------------------------------------------
commit 026c9fa29716b0ff0f8b7c687908e71ba29cf239
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:45 2024 +0100

    Set 4.19 version
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit df9b8a649f0424e0a949c0f9a7961724bbe8ea70
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:08 2024 +0100

    README: make heading say 4.19
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit b2d2878ab2686b92fcdd7bbca4ff4c312a42bc11
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:18:01 2024 +0100

    Config.mk: Bump tags to 4.19.0 final
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 03:41:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 03:41:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771735.1182181 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saoai-0000D1-Jz; Mon, 05 Aug 2024 03:41:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771735.1182181; Mon, 05 Aug 2024 03:41:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saoai-0000Cu-HC; Mon, 05 Aug 2024 03:41:00 +0000
Received: by outflank-mailman (input) for mailman id 771735;
 Mon, 05 Aug 2024 03:40:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saoah-0000Ch-Aq; Mon, 05 Aug 2024 03:40:59 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saoah-0005yF-4w; Mon, 05 Aug 2024 03:40:59 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saoag-000889-Mp; Mon, 05 Aug 2024 03:40:58 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1saoag-0004ut-GM; Mon, 05 Aug 2024 03:40:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=P/241RwIG1OhGSNRtIFfFy9HZ6aTJR0BZoLTChVGRpU=; b=nU5Hhee0w8beFrBXdwdhAv7oCA
	nxAG26k2QTMH7+LQzC2LyAZiv1doYuI0uYyaqK8iZNohwbe5bBTKW2YOc4f/BiJ3FBaJtyhrKilpZ
	KsfhRiKNoxF2/JOLLMgoe+sJfADzzVWuvlNlW3p6kkmkcsC0AxTe+4UyCGKaQ+B0DTfA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187145-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187145: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:regression
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=defaf1a2113a22b00dfa1abc0fd2014820eaf065
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 05 Aug 2024 03:40:58 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 12 debian-hvm-install fail REGR. vs. 186827
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail REGR. vs. 186827

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

version targeted for testing:
 linux                defaf1a2113a22b00dfa1abc0fd2014820eaf065
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   19 days
Failing since        186925  2024-07-20 09:44:52 Z   15 days   32 attempts
Testing same since   187145  2024-08-04 10:40:33 Z    0 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 05:42:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 05:42:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771754.1182191 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saqTz-0000Nj-2j; Mon, 05 Aug 2024 05:42:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771754.1182191; Mon, 05 Aug 2024 05:42:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saqTy-0000Nc-WD; Mon, 05 Aug 2024 05:42:11 +0000
Received: by outflank-mailman (input) for mailman id 771754;
 Mon, 05 Aug 2024 05:34:45 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xvKm=PE=iweiny-mobl=iweiny@srs-se1.protection.inumbo.net>)
 id 1saqMn-0007Wz-7s
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 05:34:45 +0000
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 68035286-52ec-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 07:34:40 +0200 (CEST)
Received: from fmviesa010.fm.intel.com ([10.60.135.150])
 by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 04 Aug 2024 22:34:36 -0700
Received: from iweiny-mobl.amr.corp.intel.com (HELO localhost)
 ([10.125.110.189])
 by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 04 Aug 2024 22:34:33 -0700
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 68035286-52ec-11ef-8776-851b0ebba9a2
X-CSE-ConnectionGUID: z2/LkfXyRJ+bV+h2cJd8zA==
X-CSE-MsgGUID: hFnhIHTYQbi3ZRDos5dOCQ==
X-IronPort-AV: E=McAfee;i="6700,10204,11154"; a="20731495"
X-IronPort-AV: E=Sophos;i="6.09,263,1716274800"; 
   d="scan'208";a="20731495"
X-CSE-ConnectionGUID: 1NXb37qGSpirdIrbQu6z0A==
X-CSE-MsgGUID: VDS3b8awRmeD430ULxE1Pg==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.09,263,1716274800"; 
   d="scan'208";a="56135504"
Date: Mon, 5 Aug 2024 00:34:31 -0500
From: Ira Weiny <iweiny@iweiny-mobl>
To: Christoph Hellwig <hch@lst.de>, Dave Jiang <dave.jiang@intel.com>,
	Alison Schofield <alison.schofield@intel.com>
Cc: Jens Axboe <axboe@kernel.dk>, Geert Uytterhoeven <geert@linux-m68k.org>,
	Richard Weinberger <richard@nod.at>,
	Philipp Reisner <philipp.reisner@linbit.com>,
	Lars Ellenberg <lars.ellenberg@linbit.com>,
	Christoph =?iso-8859-1?Q?B=F6hmwalder?= <christoph.boehmwalder@linbit.com>,
	Josef Bacik <josef@toxicpanda.com>, Ming Lei <ming.lei@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>,
	Alasdair Kergon <agk@redhat.com>, Mike Snitzer <snitzer@kernel.org>,
	Mikulas Patocka <mpatocka@redhat.com>, Song Liu <song@kernel.org>,
	Yu Kuai <yukuai3@huawei.com>,
	Vineeth Vijayan <vneethv@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-m68k@lists.linux-m68k.org, linux-um@lists.infradead.org,
	drbd-dev@lists.linbit.com, nbd@other.debian.org,
	linuxppc-dev@lists.ozlabs.org, ceph-devel@vger.kernel.org,
	virtualization@lists.linux.dev, xen-devel@lists.xenproject.org,
	linux-bcache@vger.kernel.org, dm-devel@lists.linux.dev,
	linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org,
	linux-mtd@lists.infradead.org, nvdimm@lists.linux.dev,
	linux-nvme@lists.infradead.org, linux-s390@vger.kernel.org,
	linux-scsi@vger.kernel.org, linux-block@vger.kernel.org,
	Damien Le Moal <dlemoal@kernel.org>, ira.weiny@intel.com
Subject: Re: [PATCH 20/26] block: move the dax flag to queue_limits
Message-ID: <ZrBkFKs5i9P_Wbxr@iweiny-mobl>
References: <20240617060532.127975-1-hch@lst.de>
 <20240617060532.127975-21-hch@lst.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240617060532.127975-21-hch@lst.de>

On Mon, Jun 17, 2024 at 08:04:47AM +0200, Christoph Hellwig wrote:
> Move the dax flag into the queue_limits feature field so that it can be
> set atomically with the queue frozen.

I've only just bisected this issue.  So I'm not at all sure what is going on.

What I do know is that the ndctl dax-ext4.sh and dax-xfs.sh tests are failing
in 6.11.  I bisected to this patch.  A revert fixes ext4 but not xfs.

I plan to continue looking into it in the morning.

Alison, Dave, AFAICS this is not related to the panics you are seeing in other
tests.

Ira

> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
> ---
>  block/blk-mq-debugfs.c       | 1 -
>  drivers/md/dm-table.c        | 4 ++--
>  drivers/nvdimm/pmem.c        | 7 ++-----
>  drivers/s390/block/dcssblk.c | 2 +-
>  include/linux/blkdev.h       | 6 ++++--
>  5 files changed, 9 insertions(+), 11 deletions(-)
> 
> diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
> index 62b132e9a9ce3b..f4fa820251ce83 100644
> --- a/block/blk-mq-debugfs.c
> +++ b/block/blk-mq-debugfs.c
> @@ -88,7 +88,6 @@ static const char *const blk_queue_flag_name[] = {
>  	QUEUE_FLAG_NAME(SAME_FORCE),
>  	QUEUE_FLAG_NAME(INIT_DONE),
>  	QUEUE_FLAG_NAME(POLL),
> -	QUEUE_FLAG_NAME(DAX),
>  	QUEUE_FLAG_NAME(STATS),
>  	QUEUE_FLAG_NAME(REGISTERED),
>  	QUEUE_FLAG_NAME(QUIESCED),
> diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
> index 84d636712c7284..e44697037e86f4 100644
> --- a/drivers/md/dm-table.c
> +++ b/drivers/md/dm-table.c
> @@ -1834,11 +1834,11 @@ int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
>  		limits->features |= BLK_FEAT_WRITE_CACHE | BLK_FEAT_FUA;
>  
>  	if (dm_table_supports_dax(t, device_not_dax_capable)) {
> -		blk_queue_flag_set(QUEUE_FLAG_DAX, q);
> +		limits->features |= BLK_FEAT_DAX;
>  		if (dm_table_supports_dax(t, device_not_dax_synchronous_capable))
>  			set_dax_synchronous(t->md->dax_dev);
>  	} else
> -		blk_queue_flag_clear(QUEUE_FLAG_DAX, q);
> +		limits->features &= ~BLK_FEAT_DAX;
>  
>  	if (dm_table_any_dev_attr(t, device_dax_write_cache_enabled, NULL))
>  		dax_write_cache(t->md->dax_dev, true);
> diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
> index b821dcf018f6ae..1dd74c969d5a09 100644
> --- a/drivers/nvdimm/pmem.c
> +++ b/drivers/nvdimm/pmem.c
> @@ -465,7 +465,6 @@ static int pmem_attach_disk(struct device *dev,
>  	struct dax_device *dax_dev;
>  	struct nd_pfn_sb *pfn_sb;
>  	struct pmem_device *pmem;
> -	struct request_queue *q;
>  	struct gendisk *disk;
>  	void *addr;
>  	int rc;
> @@ -499,6 +498,8 @@ static int pmem_attach_disk(struct device *dev,
>  	}
>  	if (fua)
>  		lim.features |= BLK_FEAT_FUA;
> +	if (is_nd_pfn(dev))
> +		lim.features |= BLK_FEAT_DAX;
>  
>  	if (!devm_request_mem_region(dev, res->start, resource_size(res),
>  				dev_name(&ndns->dev))) {
> @@ -509,7 +510,6 @@ static int pmem_attach_disk(struct device *dev,
>  	disk = blk_alloc_disk(&lim, nid);
>  	if (IS_ERR(disk))
>  		return PTR_ERR(disk);
> -	q = disk->queue;
>  
>  	pmem->disk = disk;
>  	pmem->pgmap.owner = pmem;
> @@ -547,9 +547,6 @@ static int pmem_attach_disk(struct device *dev,
>  	}
>  	pmem->virt_addr = addr;
>  
> -	if (pmem->pfn_flags & PFN_MAP)
> -		blk_queue_flag_set(QUEUE_FLAG_DAX, q);
> -
>  	disk->fops		= &pmem_fops;
>  	disk->private_data	= pmem;
>  	nvdimm_namespace_disk_name(ndns, disk->disk_name);
> diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
> index 6d1689a2717e5f..d5a5d11ae0dcdf 100644
> --- a/drivers/s390/block/dcssblk.c
> +++ b/drivers/s390/block/dcssblk.c
> @@ -548,6 +548,7 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
>  {
>  	struct queue_limits lim = {
>  		.logical_block_size	= 4096,
> +		.features		= BLK_FEAT_DAX,
>  	};
>  	int rc, i, j, num_of_segments;
>  	struct dcssblk_dev_info *dev_info;
> @@ -643,7 +644,6 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char
>  	dev_info->gd->fops = &dcssblk_devops;
>  	dev_info->gd->private_data = dev_info;
>  	dev_info->gd->flags |= GENHD_FL_NO_PART;
> -	blk_queue_flag_set(QUEUE_FLAG_DAX, dev_info->gd->queue);
>  
>  	seg_byte_size = (dev_info->end - dev_info->start + 1);
>  	set_capacity(dev_info->gd, seg_byte_size >> 9); // size in sectors
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index f3d4519d609d95..7022e06a3dd9a3 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -307,6 +307,9 @@ enum {
>  
>  	/* supports REQ_NOWAIT */
>  	BLK_FEAT_NOWAIT				= (1u << 7),
> +
> +	/* supports DAX */
> +	BLK_FEAT_DAX				= (1u << 8),
>  };
>  
>  /*
> @@ -575,7 +578,6 @@ struct request_queue {
>  #define QUEUE_FLAG_SAME_FORCE	12	/* force complete on same CPU */
>  #define QUEUE_FLAG_INIT_DONE	14	/* queue is initialized */
>  #define QUEUE_FLAG_POLL		16	/* IO polling enabled if set */
> -#define QUEUE_FLAG_DAX		19	/* device supports DAX */
>  #define QUEUE_FLAG_STATS	20	/* track IO start and completion times */
>  #define QUEUE_FLAG_REGISTERED	22	/* queue has been registered to a disk */
>  #define QUEUE_FLAG_QUIESCED	24	/* queue has been quiesced */
> @@ -602,7 +604,7 @@ bool blk_queue_flag_test_and_set(unsigned int flag, struct request_queue *q);
>  #define blk_queue_io_stat(q)	((q)->limits.features & BLK_FEAT_IO_STAT)
>  #define blk_queue_zone_resetall(q)	\
>  	test_bit(QUEUE_FLAG_ZONE_RESETALL, &(q)->queue_flags)
> -#define blk_queue_dax(q)	test_bit(QUEUE_FLAG_DAX, &(q)->queue_flags)
> +#define blk_queue_dax(q)	((q)->limits.features & BLK_FEAT_DAX)
>  #define blk_queue_pci_p2pdma(q)	\
>  	test_bit(QUEUE_FLAG_PCI_P2PDMA, &(q)->queue_flags)
>  #ifdef CONFIG_BLK_RQ_ALLOC_TIME
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 06:01:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 06:01:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771768.1182201 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saqmo-0003dO-FV; Mon, 05 Aug 2024 06:01:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771768.1182201; Mon, 05 Aug 2024 06:01:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saqmo-0003dH-Ck; Mon, 05 Aug 2024 06:01:38 +0000
Received: by outflank-mailman (input) for mailman id 771768;
 Mon, 05 Aug 2024 06:01: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=I4ub=PE=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1saqmn-0003dB-07
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 06:01:37 +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 2bc3247d-52f0-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 08:01:35 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5af51684d52so11801180a12.1
 for <xen-devel@lists.xenproject.org>; Sun, 04 Aug 2024 23:01:35 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b839c24084sm4432996a12.30.2024.08.04.23.01.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 04 Aug 2024 23:01:34 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2bc3247d-52f0-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722837695; x=1723442495; 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=lED7dYRCywCuRbUhwJdEA2o6RkCdCtgphXCI+gOxtf4=;
        b=Zd/LVREMN17dcovo6sf6Z1RYPgMvdh8I9i280wYvTbg7RSpJktBezOGgQyGSvBRjvV
         6UrMnmpS3CS0eVOGTiwGqoRIaK+qPp3yeCA95e1irP244V8kJVkqdsYuDZJ+kEswaRhX
         8mNn0XNtUSqbAKS8CyolDtMcLUKm643V8csClM8QbUymAXy7xKaGrqGJlqHrOjpu0YYK
         XL/6Sx321TOMM+zWZQoyPOrc7KGZfpMLDUy0znjgyTYXFu2lzVvlcrfLlIp8+4BqdYWa
         GkNvRe2ofc606wIlipvuw0oIIP8HjX48GZ4MTeTqByewMp5S+5zqikrT0CLOD1DFOLct
         J9KQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722837695; x=1723442495;
        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=lED7dYRCywCuRbUhwJdEA2o6RkCdCtgphXCI+gOxtf4=;
        b=LdxEWTPWiKcOIydQHfgXFD0B6d1Sposwp50RAloqN2Pujo7JkD1FF0Bqmv9KEUlydb
         Y+rVi3Y8TD3fRwsEhI1HEMeO5dpt5+kpLzOvct/MmidBgYnfzImsFhEzjRQDciApSOt0
         jViT2pALdfPHTyZOjMmjazpVH9JoQa80w4DHzTZ2JKegSZA+jCRAoP8dV1oCQx9bjGMg
         he/77vf2NgXIlMtgSgJa0vE40gLzA7bPrZn4vccFl5LnvPXn1qNgyX5+brbuMZAW4OMc
         xiO1tdRndX3JdyR+fThAq5WcRSqfZOscP58ahQzPtb8MZQU3A2IXTAE9Z+4jqy+otuGx
         5EDQ==
X-Forwarded-Encrypted: i=1; AJvYcCUZHTPji9fIVP+7KuCy7ItKJ3LWLUSZbf/iBNxi2rCWT7aFczN5Ple06E2Y7SUIqMSDQt9jvwkBpfalZpo38EHXlENnQ+2/ypXYD7B0uJI=
X-Gm-Message-State: AOJu0YyKey1AALdxAGxD1AIixEGkAJ0F/3pX6KRgFAvWZPh42G/uWwrF
	aY++SsQ4RneMG1OUqDOSKeEWapPkbIWdl74JRdFkEvD/096uWWH88VawrwzTcA==
X-Google-Smtp-Source: AGHT+IF/MuyBawxYvRAf2/TBrWgfmNs447RfTFJwEQ0MmP6J7PKNna0mpxrB9khI+C1oUahtt2JhwQ==
X-Received: by 2002:a05:6402:2689:b0:5b9:462d:c539 with SMTP id 4fb4d7f45d1cf-5b9462dcb76mr6299336a12.3.1722837694547;
        Sun, 04 Aug 2024 23:01:34 -0700 (PDT)
Message-ID: <18032298-e535-4405-890e-6ab9d54cf7e3@suse.com>
Date: Mon, 5 Aug 2024 08:01:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: kexec failure with Xen 4.19-rc4 and 4.20-dev on linux host
To: A Kundu <avikalpa@yahoo.com>
Cc: kexec@lists.infradead.org, horms@verge.net.au,
 xen-devel@lists.xenproject.org, Baoquan He <bhe@redhat.com>,
 andrew.cooper3@citrix.com
References: <05395ed2-3bf3-4926-8e24-c2e7ff37ed26@yahoo.com>
 <cebc7800-df78-4f90-9f8e-82e3f9120b6e@yahoo.com>
 <ZqxUMgcEHakeFPaU@MiWiFi-R3L-srv>
 <abaceb99-4b80-49d7-ab7f-b190f73e858d@yahoo.com>
 <ac57dec1-68a3-471d-8f4c-c87fd9dca619@suse.com>
 <dc5c9dff-6bee-493a-8315-b2eee48bd802@yahoo.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: <dc5c9dff-6bee-493a-8315-b2eee48bd802@yahoo.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 04.08.2024 15:17, A Kundu wrote:
> On 8/2/24 13:25, Jan Beulich wrote:
>  > On 02.08.2024 09:28, A Kundu wrote:
>  >> On 8/2/24 09:06, Baoquan He wrote:
>  >>> On 07/31/24 at 06:34pm, A Kundu wrote:
>  >>>> I am experiencing issues using kexec to load Xen 4.17(debian's apt 
> version),
>  >>>> Xen 4.19-rc4 (compiled from source) and 4.20-dev (compiled from 
> source) on a
>  >>>> debian host.
>  >>> You should CC this to XEN dev list so that XEN dev knows this and may
>  >>> provide help. Not everyone is interested in and knows XEN.
>  >>>
>  >>>> System information:
>  >>>> $ uname -a
>  >>>> Linux host 6.9.10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.9.10-1 
> (2024-07-19)
>  >>>> x86_64 GNU/Linux
>  >>>>
>  >>>> $ kexec --version # compiled from source tarball with ./configure 
> --with-xen
>  >>>> kexec-tools 2.0.29
>  >>>>
>  >>>> Steps to reproduce:
>  >>>>
>  >>>> 1. Set variables:
>  >>>>
>  >>>> XEN_HYPERVISOR="/boot/xen.gz"
>  >>>> XEN_CMD="dom0_mem=6G dom0_max_vcpus=6 dom0_vcpus_pin cpufreq=xen"
>  >>>>
>  >>>> 2. Attempt to load Xen 4.19-rc4:
>  >>>>
>  >>>> # kexec -l "$XEN_HYPERVISOR" --command-line="$XEN_CMD"
>  >>>> Could not find a free area of memory of 0x3b6001 bytes...
>  >>>> elf_exec_build_load_relocatable: ELF exec load failed
>  >>>>
>  >>>> 3. Attempt to load Xen 4.20-dev:
>  >>>>
>  >>>> # kexec -l "$XEN_HYPERVISOR" --command-line="$XEN_CMD"
>  >>>> Could not find a free area of memory of 0x3f8001 bytes...
>  >>>> elf_exec_build_load_relocatable: ELF exec load failed
>  >>>>
>  >>>> 4. Attempt to load Xen 4.17 (from debian rrepositories):
>  >>>> # kexec -l /boot/xen-4.17-amd64.gz --command-line="$XEN_CMD"
>  >>>> Could not find a free area of memory of 0x3b4001 bytes...
>  >>>> elf_exec_build_load_relocatable: ELF exec load failed
>  >
>  > And with all of them saying effectively the same, did you verify you
>  > actually have a sufficiently large area reserved? The obvious
>  > place for you to look at is Xen's boot log (obtained via serial
>  > console or "xl dmesg" immediately after booting the system). If you
>  > find everything as expected there, ...
>  >
>  >>>> If you need any further information to investigate this problem,
>  >>>> please let me know.
>  >
>  > ... please provide that boot log.
> 
> I have also followed up on your suggestion to check the Xen boot log
> using "xl dmesg", but unfortunately, I received the following error:
> 
> xencall: error: Could not obtain handle on privileged command interface: 
> No such file or directory
> libxl: error: libxl.c:102:libxl_ctx_alloc: cannot open libxc handle: No 
> such file or directory
> cannot init xl context
> 
> This indicates that Xen did not boot successfully, so there are no logs
> available.

The fact that you have Dom0 up makes clear that Xen booted okay(ish). The
fact that you get "No such file or directory" from xencall suggests you
either didn't load the xen-privcmd driver (normally arrangements are made
by distros for this to happen automatically), or you didn't even build it.

>  > And with all of them saying effectively the same, did you verify you
>  > actually have a sufficiently large area reserved? The obvious
>  > place for you to look at is Xen's boot log (obtained via serial
>  > console or "xl dmesg" immediately after booting the system). If you
>  > find everything as expected there, ...
>  >
> 
> In an attempt to resolve the memory allocation issue, I have tried the
> following:
> 
> Added a crashkernel=<size>@<offset> parameter to the host kernel command
> line to reserve a dedicated memory region for kexec, and attempted to
> load Xen into that area.

That was a remote guess of mine. This command line option is meaningless
when running under Xen. The reservation needs to be done in Xen.

Overall for the moment I'm inclined to say that xen-devel@ isn't the right
forum here. xen-users@ might be quite a bit more appropriate until you
actually run into issues with Xen itself, not with its (correct) use.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 06:17:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 06:17:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771778.1182211 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sar1v-00061v-Sz; Mon, 05 Aug 2024 06:17:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771778.1182211; Mon, 05 Aug 2024 06:17:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sar1v-00061o-QQ; Mon, 05 Aug 2024 06:17:15 +0000
Received: by outflank-mailman (input) for mailman id 771778;
 Mon, 05 Aug 2024 06:17:14 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=I4ub=PE=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sar1u-00061i-Qn
 for xen-devel@lists.xen.org; Mon, 05 Aug 2024 06:17:14 +0000
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com
 [2a00:1450:4864:20::12e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5a6937e1-52f2-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 08:17:12 +0200 (CEST)
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-52efdf02d13so16350197e87.2
 for <xen-devel@lists.xen.org>; Sun, 04 Aug 2024 23:17:12 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9d42825sm412369066b.123.2024.08.04.23.17.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 04 Aug 2024 23:17:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5a6937e1-52f2-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722838632; x=1723443432; darn=lists.xen.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=MbvJ05UAFQQZo2nYRYkOVwY26JkXQ5QL51jc2pRyyqE=;
        b=XNQ4QeHxD6mU6Ir+CA1AZGgdCu92MERfIwt+jc0Fl6POVuSaQ4+evUOHtlWK3bxZEJ
         5SS5dw4ZpabkbxOlKXGXJQmX7jp2nBFqo8+BGZhsSNkSDNta10SFvnRJYhZ26HnKhObz
         C2vhz3ZkHqNXsoymi6f/baXV1XO+PRmTPg7yqyEhG8C1oZ0nA5MN+PvsBwpOUfR7uC6h
         521UiFtZnqjrd8FycVY3tZdp6ihPz5AkIcMf2DQBZwpETt5Heo/W3Av+Jn/LdfmRzE8e
         //T/ne1f8uNtF1LwgvZppfH7/qF4K8OrzXJzDe31SSoGiwccc5Wznjcf5mznIOaIvMsE
         Lr6g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722838632; x=1723443432;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :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=MbvJ05UAFQQZo2nYRYkOVwY26JkXQ5QL51jc2pRyyqE=;
        b=wK/0hjTC0OSyUA59qplakm+NfRlgbdZXptXaEh3KYOHO1tbDU5AbBW7ZZSMfL1A8Cr
         HoIL3qU+qcT1Cz57MxGLqhBr2x0oHM8n7QO1mE75mH18HuMaX4RMGW+5BdMOcMLAjRho
         uzZwrnKcdrKNtmc8CsxJKWIixUn+ONIYOeF9zSsnt4bvTUHw+pWF931OB4W3R8oxpydc
         Zg30CiCI+a4LULeEFol6Z6KqLACyFpeH6Y4Yxc0Lm42sGn/kyMP+0tnXOTKtA2MH7XSA
         JG8Gtx304aLZXSm0zBImRiMlWRlUJzzV1jGJFqWeJbZNum6a2U0GJFDBUOHuu8pWkQ4/
         vzaQ==
X-Gm-Message-State: AOJu0YxM9JdQrJWWDRAMeanPFXBkBY/W+3c0JNleBWiiIxNXWfY8Tr54
	yZdvg6kyLv1dFOmgp1shVxe7EaaYHIQBl6gLAUGn9RI5esxW92dnAEFeKenq76BxcNA4/6h5Mmc
	=
X-Google-Smtp-Source: AGHT+IHOIM4dm7aptX0+n4AFJVfQ5UBh3mEAekwTg1OVC6QZJM/ioq43tKnRBrw23LG3Wl236q7skQ==
X-Received: by 2002:a05:6512:ba3:b0:52c:df8e:a367 with SMTP id 2adb3069b0e04-530bb3bbfd1mr9065118e87.53.1722838631630;
        Sun, 04 Aug 2024 23:17:11 -0700 (PDT)
Message-ID: <8e25bb26-2356-43a3-a479-6a679c6577c5@suse.com>
Date: Mon, 5 Aug 2024 08:17:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [BUG] incorrect "help" output
To: "John E. Krokes" <mag@netherworld.org>
References: <c79f8028-6c34-0e25-1445-79e5bcb93890@decay.netherworld.org>
Content-Language: en-US
Cc: xen-devel@lists.xen.org
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+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: <c79f8028-6c34-0e25-1445-79e5bcb93890@decay.netherworld.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 04.08.2024 15:18, John E. Krokes wrote:
> Here's a simple and obvious mistake:
> 
> 
> ~> xl help | grep vsnd
>   vsnd-attach         Create a new virtual sound device
>   vsnd-list           List virtual display devices for a domain
>   vsnd-detach         Destroy a domain's virtual sound device
>   ~>
> 
> 
> I'm pretty sure vsnd-list should say "sound devices" instead of
> "display devices". The problem is in tools/xl/xl_cmdtable.c.

Would you mind sending a patch (against the current staging tree)?

Jan



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 06:20:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 06:20:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771785.1182222 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sar4y-0007UA-BK; Mon, 05 Aug 2024 06:20:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771785.1182222; Mon, 05 Aug 2024 06:20:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sar4y-0007U3-8O; Mon, 05 Aug 2024 06:20:24 +0000
Received: by outflank-mailman (input) for mailman id 771785;
 Mon, 05 Aug 2024 06:20:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=I4ub=PE=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sar4x-0007Tx-4P
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 06:20:23 +0000
Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com
 [2a00:1450:4864:20::635])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cb612f87-52f2-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 08:20:22 +0200 (CEST)
Received: by mail-ej1-x635.google.com with SMTP id
 a640c23a62f3a-a7a94478a4eso878385266b.1
 for <xen-devel@lists.xenproject.org>; Sun, 04 Aug 2024 23:20:22 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ec8884sm408764166b.193.2024.08.04.23.20.20
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 04 Aug 2024 23:20:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cb612f87-52f2-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722838821; x=1723443621; 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=869kuP4Lnvrx5DEWD5/ojqqEgHTb0oU2mz3m4TNNB6o=;
        b=C/SEXyX7fEv9iiu2QSDHTtEuibEdY9kxTwm4aMvcpB+j4N5rnFc2ILmDKA3U71tuyw
         wWH9pTiCps7zfZLqMRVyz1Bz9cy+Y23nmF8sZveqr9TAPZ1SDUQbcmQfUkU/mTNMOEJl
         8KMBkSXmimoV0cys7bhWUKdXhRfP4ZGyHPmzSnb2tXQUQCoI6dUn4imcDXJq3/m9nTem
         2JD5qKtONXv3CLikdEhKM0oKOBfS8ca2rNkko/wxKCRLBWuQkm+v3l6HiRgMYb9GvAWq
         E7REEymku0K9pb3Z9ywAuB9E4yXIS2ZdbpmOvNOM/YgxuiuGUGpkT4/BspwbiyV/xHkH
         b1Dg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722838821; x=1723443621;
        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=869kuP4Lnvrx5DEWD5/ojqqEgHTb0oU2mz3m4TNNB6o=;
        b=W0QCEQPF8yjCnvG3vh1wXYSq+lDH6/Tz6JKsNxKIUgmkr4yCaA4FDFVgyYMutUCDa5
         wzGowMZvAg14+ChD/v5pRBWukxkK+mYzUmTy10ZTNZlNhTE57yI212yrM8yqbgANuSJu
         asFx9Ztmhn2071KysA6zdFaEvuevtBor5as+IwGltDw8fn9agacz7qhpC4WEhLTTFp1d
         2jaMqEhqKXqxI7qloFZN4raz/l8QVKEOTO7PheIlM6Y3/8qsSX7qDcDQ9KLBQKo7wnQB
         IIMJTbBL0Cn10dDAojqUJQm8c8EW959NrCSGYhmEqYsp6rgwnkuM6PSiBSbjpjl54+H8
         OKkw==
X-Forwarded-Encrypted: i=1; AJvYcCX+4ZQaaZtuIY2NdfGepPlTBTjXptt9sIf1mraB/7G4x4pNvKwZgbOK3k+E44+jKzWjyV92guazb7PbdTRi6S6sPIrt7uWkNYEmnvX/yYI=
X-Gm-Message-State: AOJu0Yz50uV3rK+r7Ips/K+n/R4/veFF1bmGI4ALljV5k+yNs05yI8r9
	Icav3Ej9/GRBLEUhrtRzgNhKvnjYzD1UmrcsY50xKGKOcqAR9N+AS3pSN397tQ==
X-Google-Smtp-Source: AGHT+IFUzIPQY1vXxHwadlUQvYMUkWZjk+hlU4MTFsblcEf6PGBWwImYDY/Lt9jEzWjy2AABNwM4lg==
X-Received: by 2002:a17:906:eec3:b0:a77:d9b5:ad4b with SMTP id a640c23a62f3a-a7dbcbd5b6cmr1185379566b.9.1722838821358;
        Sun, 04 Aug 2024 23:20:21 -0700 (PDT)
Message-ID: <361eb1c3-003b-47d2-bcd9-0f06e91bfd0a@suse.com>
Date: Mon, 5 Aug 2024 08:20:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v12 3/3] xen/riscv: refactor decode_trap_cause()
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1722605952.git.oleksii.kurochko@gmail.com>
 <88e15908d6ac363934b6da52091443af28bd7291.1722605952.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <88e15908d6ac363934b6da52091443af28bd7291.1722605952.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 02.08.2024 15:54, Oleksii Kurochko wrote:
> Use array_access_nospec() to prevent guest speculation.
> 
> Avoid double access of trap_causes[cause].
> 
> Suggested-by: Jan Beulich <jbeulich@suse.com>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
with ...

> @@ -48,9 +49,10 @@ static const char *decode_trap_cause(unsigned long cause)
>          [CAUSE_STORE_GUEST_PAGE_FAULT] = "Guest Store/AMO Page Fault",
>      };
>  
> -    if ( cause < ARRAY_SIZE(trap_causes) && trap_causes[cause] )
> -        return trap_causes[cause];
> -    return "UNKNOWN";
> +    const char *res = cause < ARRAY_SIZE(trap_causes) ? array_access_nospec(trap_causes, cause)

... the overly long line here suitably wrapped; commonly we'd do this
as ...

> +                                                      : NULL;

    const char *res = cause < ARRAY_SIZE(trap_causes)
                      ? array_access_nospec(trap_causes, cause)
                      : NULL;

I guess I'll adjust this while committing.

Jan

> +    return res ?: "UNKNOWN";
>  }
>  
>  static const char *decode_reserved_interrupt_cause(unsigned long irq_cause)



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 07:52:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 07:52:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771802.1182232 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sasWI-0003qm-DH; Mon, 05 Aug 2024 07:52:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771802.1182232; Mon, 05 Aug 2024 07:52:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sasWI-0003qf-AR; Mon, 05 Aug 2024 07:52:42 +0000
Received: by outflank-mailman (input) for mailman id 771802;
 Mon, 05 Aug 2024 07:52:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Dvoq=PE=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sasWH-0003qZ-5t
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 07:52:41 +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 b0181106-52ff-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 09:52:39 +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 A3EE51FCF5;
 Mon,  5 Aug 2024 07:52:38 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 60EDC13254;
 Mon,  5 Aug 2024 07:52:38 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id rV7TFcaEsGaKUQAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 05 Aug 2024 07:52:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b0181106-52ff-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1722844358; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references:autocrypt:autocrypt;
	bh=q+dNz6/7N1KNq68VIPGcmOTrJw3gqbQv0bPxpvc5P2U=;
	b=loy2Z9RgdGtjIhbLVBOAWG/+z+5pdP2kDbgKj827TU4b2wR7l7P9F4mRfIimntZUhmW31q
	+zHmZp4te7wdqIPMgfsITUIeOSnK88Cki360ECZJFA9zfz22J9p9RD2oXlM3T7T29rIpW5
	OGU7ndn5n16il8dMj6mmIbo8EfToyeE=
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1722844358; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references:autocrypt:autocrypt;
	bh=q+dNz6/7N1KNq68VIPGcmOTrJw3gqbQv0bPxpvc5P2U=;
	b=loy2Z9RgdGtjIhbLVBOAWG/+z+5pdP2kDbgKj827TU4b2wR7l7P9F4mRfIimntZUhmW31q
	+zHmZp4te7wdqIPMgfsITUIeOSnK88Cki360ECZJFA9zfz22J9p9RD2oXlM3T7T29rIpW5
	OGU7ndn5n16il8dMj6mmIbo8EfToyeE=
Message-ID: <74bac0d8-de7a-41df-87ed-b7e2d4140ade@suse.com>
Date: Mon, 5 Aug 2024 09:52:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: kexec failure with Xen 4.19-rc4 and 4.20-dev on linux host
To: Jan Beulich <jbeulich@suse.com>, A Kundu <avikalpa@yahoo.com>
Cc: kexec@lists.infradead.org, horms@verge.net.au,
 xen-devel@lists.xenproject.org, Baoquan He <bhe@redhat.com>,
 andrew.cooper3@citrix.com
References: <05395ed2-3bf3-4926-8e24-c2e7ff37ed26@yahoo.com>
 <cebc7800-df78-4f90-9f8e-82e3f9120b6e@yahoo.com>
 <ZqxUMgcEHakeFPaU@MiWiFi-R3L-srv>
 <abaceb99-4b80-49d7-ab7f-b190f73e858d@yahoo.com>
 <ac57dec1-68a3-471d-8f4c-c87fd9dca619@suse.com>
 <dc5c9dff-6bee-493a-8315-b2eee48bd802@yahoo.com>
 <18032298-e535-4405-890e-6ab9d54cf7e3@suse.com>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <18032298-e535-4405-890e-6ab9d54cf7e3@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------MauQ67W1CiCmNyumbihs2Qec"
X-Spam-Level: 
X-Spamd-Result: default: False [-5.18 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	SIGNED_PGP(-2.00)[];
	MIME_BASE64_TEXT_BOGUS(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-0.998];
	MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain];
	NEURAL_HAM_SHORT(-0.19)[-0.962];
	MIME_UNKNOWN(0.10)[application/pgp-keys];
	MIME_BASE64_TEXT(0.10)[];
	XM_UA_NO_VERSION(0.01)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FREEMAIL_ENVRCPT(0.00)[yahoo.com];
	FREEMAIL_TO(0.00)[suse.com,yahoo.com];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	MIME_TRACE(0.00)[0:+,1:+,2:+,3:+,4:~,5:~];
	ARC_NA(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	HAS_ATTACHMENT(0.00)[];
	TO_DN_SOME(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	RCPT_COUNT_SEVEN(0.00)[7];
	MID_RHS_MATCH_FROM(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo]
X-Spam-Flag: NO
X-Spam-Score: -5.18

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------MauQ67W1CiCmNyumbihs2Qec
Content-Type: multipart/mixed; boundary="------------DN8FSuVoJn0UraqDFj85p3Ja";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>, A Kundu <avikalpa@yahoo.com>
Cc: kexec@lists.infradead.org, horms@verge.net.au,
 xen-devel@lists.xenproject.org, Baoquan He <bhe@redhat.com>,
 andrew.cooper3@citrix.com
Message-ID: <74bac0d8-de7a-41df-87ed-b7e2d4140ade@suse.com>
Subject: Re: kexec failure with Xen 4.19-rc4 and 4.20-dev on linux host
References: <05395ed2-3bf3-4926-8e24-c2e7ff37ed26@yahoo.com>
 <cebc7800-df78-4f90-9f8e-82e3f9120b6e@yahoo.com>
 <ZqxUMgcEHakeFPaU@MiWiFi-R3L-srv>
 <abaceb99-4b80-49d7-ab7f-b190f73e858d@yahoo.com>
 <ac57dec1-68a3-471d-8f4c-c87fd9dca619@suse.com>
 <dc5c9dff-6bee-493a-8315-b2eee48bd802@yahoo.com>
 <18032298-e535-4405-890e-6ab9d54cf7e3@suse.com>
In-Reply-To: <18032298-e535-4405-890e-6ab9d54cf7e3@suse.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJ3BBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AAIQkQoDSui/t3IH4WIQQ+pJkfkcoLMCa4X6CgNK6L+3cgfgn7AJ9DmMd0SMJE
 ePbc7/m22D2v04iu7ACffXTdZQhNl557tJuDXZSBxDmW/tLOwU0EWTecRBAIAIK5OMKMU5R2
 Lk2bbjgX7vyQuCFFyKf9rC/4itNwhYWFSlKzVj3WJBDsoi2KvPm7AI+XB6NIkNAkshL5C0kd
 pcNd5Xo0jRR5/WE/bT7LyrJ0OJWS/qUit5eNNvsO+SxGAk28KRa1ieVLeZi9D03NL0+HIAtZ
 tecfqwgl3Y72UpLUyt+r7LQhcI/XR5IUUaD4C/chB4Vq2QkDKO7Q8+2HJOrFIjiVli4lU+Sf
 OBp64m//Y1xys++Z4ODoKh7tkh5DxiO3QBHG7bHK0CSQsJ6XUvPVYubAuy1XfSDzSeSBl//C
 v78Fclb+gi9GWidSTG/4hsEzd1fY5XwCZG/XJJY9M/sAAwUH/09Ar9W2U1Qm+DwZeP2ii3Ou
 14Z9VlVVPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------DN8FSuVoJn0UraqDFj85p3Ja
Content-Type: multipart/mixed; boundary="------------LHsUp8Nk0UKDkSsiuvmY99VN"

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

T24gMDUuMDguMjQgMDg6MDEsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAwNC4wOC4yMDI0
IDE1OjE3LCBBIEt1bmR1IHdyb3RlOg0KPj4gT24gOC8yLzI0IDEzOjI1LCBKYW4gQmV1bGlj
aCB3cm90ZToNCj4+ICAgPiBPbiAwMi4wOC4yMDI0IDA5OjI4LCBBIEt1bmR1IHdyb3RlOg0K
Pj4gICA+PiBPbiA4LzIvMjQgMDk6MDYsIEJhb3F1YW4gSGUgd3JvdGU6DQo+PiAgID4+PiBP
biAwNy8zMS8yNCBhdCAwNjozNHBtLCBBIEt1bmR1IHdyb3RlOg0KPj4gICA+Pj4+IEkgYW0g
ZXhwZXJpZW5jaW5nIGlzc3VlcyB1c2luZyBrZXhlYyB0byBsb2FkIFhlbiA0LjE3KGRlYmlh
bidzIGFwdA0KPj4gdmVyc2lvbiksDQo+PiAgID4+Pj4gWGVuIDQuMTktcmM0IChjb21waWxl
ZCBmcm9tIHNvdXJjZSkgYW5kIDQuMjAtZGV2IChjb21waWxlZCBmcm9tDQo+PiBzb3VyY2Up
IG9uIGENCj4+ICAgPj4+PiBkZWJpYW4gaG9zdC4NCj4+ICAgPj4+IFlvdSBzaG91bGQgQ0Mg
dGhpcyB0byBYRU4gZGV2IGxpc3Qgc28gdGhhdCBYRU4gZGV2IGtub3dzIHRoaXMgYW5kIG1h
eQ0KPj4gICA+Pj4gcHJvdmlkZSBoZWxwLiBOb3QgZXZlcnlvbmUgaXMgaW50ZXJlc3RlZCBp
biBhbmQga25vd3MgWEVOLg0KPj4gICA+Pj4NCj4+ICAgPj4+PiBTeXN0ZW0gaW5mb3JtYXRp
b246DQo+PiAgID4+Pj4gJCB1bmFtZSAtYQ0KPj4gICA+Pj4+IExpbnV4IGhvc3QgNi45LjEw
LWFtZDY0ICMxIFNNUCBQUkVFTVBUX0RZTkFNSUMgRGViaWFuIDYuOS4xMC0xDQo+PiAoMjAy
NC0wNy0xOSkNCj4+ICAgPj4+PiB4ODZfNjQgR05VL0xpbnV4DQo+PiAgID4+Pj4NCj4+ICAg
Pj4+PiAkIGtleGVjIC0tdmVyc2lvbiAjIGNvbXBpbGVkIGZyb20gc291cmNlIHRhcmJhbGwg
d2l0aCAuL2NvbmZpZ3VyZQ0KPj4gLS13aXRoLXhlbg0KPj4gICA+Pj4+IGtleGVjLXRvb2xz
IDIuMC4yOQ0KPj4gICA+Pj4+DQo+PiAgID4+Pj4gU3RlcHMgdG8gcmVwcm9kdWNlOg0KPj4g
ICA+Pj4+DQo+PiAgID4+Pj4gMS4gU2V0IHZhcmlhYmxlczoNCj4+ICAgPj4+Pg0KPj4gICA+
Pj4+IFhFTl9IWVBFUlZJU09SPSIvYm9vdC94ZW4uZ3oiDQo+PiAgID4+Pj4gWEVOX0NNRD0i
ZG9tMF9tZW09NkcgZG9tMF9tYXhfdmNwdXM9NiBkb20wX3ZjcHVzX3BpbiBjcHVmcmVxPXhl
biINCj4+ICAgPj4+Pg0KPj4gICA+Pj4+IDIuIEF0dGVtcHQgdG8gbG9hZCBYZW4gNC4xOS1y
YzQ6DQo+PiAgID4+Pj4NCj4+ICAgPj4+PiAjIGtleGVjIC1sICIkWEVOX0hZUEVSVklTT1Ii
IC0tY29tbWFuZC1saW5lPSIkWEVOX0NNRCINCj4+ICAgPj4+PiBDb3VsZCBub3QgZmluZCBh
IGZyZWUgYXJlYSBvZiBtZW1vcnkgb2YgMHgzYjYwMDEgYnl0ZXMuLi4NCj4+ICAgPj4+PiBl
bGZfZXhlY19idWlsZF9sb2FkX3JlbG9jYXRhYmxlOiBFTEYgZXhlYyBsb2FkIGZhaWxlZA0K
Pj4gICA+Pj4+DQo+PiAgID4+Pj4gMy4gQXR0ZW1wdCB0byBsb2FkIFhlbiA0LjIwLWRldjoN
Cj4+ICAgPj4+Pg0KPj4gICA+Pj4+ICMga2V4ZWMgLWwgIiRYRU5fSFlQRVJWSVNPUiIgLS1j
b21tYW5kLWxpbmU9IiRYRU5fQ01EIg0KPj4gICA+Pj4+IENvdWxkIG5vdCBmaW5kIGEgZnJl
ZSBhcmVhIG9mIG1lbW9yeSBvZiAweDNmODAwMSBieXRlcy4uLg0KPj4gICA+Pj4+IGVsZl9l
eGVjX2J1aWxkX2xvYWRfcmVsb2NhdGFibGU6IEVMRiBleGVjIGxvYWQgZmFpbGVkDQo+PiAg
ID4+Pj4NCj4+ICAgPj4+PiA0LiBBdHRlbXB0IHRvIGxvYWQgWGVuIDQuMTcgKGZyb20gZGVi
aWFuIHJyZXBvc2l0b3JpZXMpOg0KPj4gICA+Pj4+ICMga2V4ZWMgLWwgL2Jvb3QveGVuLTQu
MTctYW1kNjQuZ3ogLS1jb21tYW5kLWxpbmU9IiRYRU5fQ01EIg0KPj4gICA+Pj4+IENvdWxk
IG5vdCBmaW5kIGEgZnJlZSBhcmVhIG9mIG1lbW9yeSBvZiAweDNiNDAwMSBieXRlcy4uLg0K
Pj4gICA+Pj4+IGVsZl9leGVjX2J1aWxkX2xvYWRfcmVsb2NhdGFibGU6IEVMRiBleGVjIGxv
YWQgZmFpbGVkDQo+PiAgID4NCj4+ICAgPiBBbmQgd2l0aCBhbGwgb2YgdGhlbSBzYXlpbmcg
ZWZmZWN0aXZlbHkgdGhlIHNhbWUsIGRpZCB5b3UgdmVyaWZ5IHlvdQ0KPj4gICA+IGFjdHVh
bGx5IGhhdmUgYSBzdWZmaWNpZW50bHkgbGFyZ2UgYXJlYSByZXNlcnZlZD8gVGhlIG9idmlv
dXMNCj4+ICAgPiBwbGFjZSBmb3IgeW91IHRvIGxvb2sgYXQgaXMgWGVuJ3MgYm9vdCBsb2cg
KG9idGFpbmVkIHZpYSBzZXJpYWwNCj4+ICAgPiBjb25zb2xlIG9yICJ4bCBkbWVzZyIgaW1t
ZWRpYXRlbHkgYWZ0ZXIgYm9vdGluZyB0aGUgc3lzdGVtKS4gSWYgeW91DQo+PiAgID4gZmlu
ZCBldmVyeXRoaW5nIGFzIGV4cGVjdGVkIHRoZXJlLCAuLi4NCj4+ICAgPg0KPj4gICA+Pj4+
IElmIHlvdSBuZWVkIGFueSBmdXJ0aGVyIGluZm9ybWF0aW9uIHRvIGludmVzdGlnYXRlIHRo
aXMgcHJvYmxlbSwNCj4+ICAgPj4+PiBwbGVhc2UgbGV0IG1lIGtub3cuDQo+PiAgID4NCj4+
ICAgPiAuLi4gcGxlYXNlIHByb3ZpZGUgdGhhdCBib290IGxvZy4NCj4+DQo+PiBJIGhhdmUg
YWxzbyBmb2xsb3dlZCB1cCBvbiB5b3VyIHN1Z2dlc3Rpb24gdG8gY2hlY2sgdGhlIFhlbiBi
b290IGxvZw0KPj4gdXNpbmcgInhsIGRtZXNnIiwgYnV0IHVuZm9ydHVuYXRlbHksIEkgcmVj
ZWl2ZWQgdGhlIGZvbGxvd2luZyBlcnJvcjoNCj4+DQo+PiB4ZW5jYWxsOiBlcnJvcjogQ291
bGQgbm90IG9idGFpbiBoYW5kbGUgb24gcHJpdmlsZWdlZCBjb21tYW5kIGludGVyZmFjZToN
Cj4+IE5vIHN1Y2ggZmlsZSBvciBkaXJlY3RvcnkNCj4+IGxpYnhsOiBlcnJvcjogbGlieGwu
YzoxMDI6bGlieGxfY3R4X2FsbG9jOiBjYW5ub3Qgb3BlbiBsaWJ4YyBoYW5kbGU6IE5vDQo+
PiBzdWNoIGZpbGUgb3IgZGlyZWN0b3J5DQo+PiBjYW5ub3QgaW5pdCB4bCBjb250ZXh0DQo+
Pg0KPj4gVGhpcyBpbmRpY2F0ZXMgdGhhdCBYZW4gZGlkIG5vdCBib290IHN1Y2Nlc3NmdWxs
eSwgc28gdGhlcmUgYXJlIG5vIGxvZ3MNCj4+IGF2YWlsYWJsZS4NCj4gDQo+IFRoZSBmYWN0
IHRoYXQgeW91IGhhdmUgRG9tMCB1cCBtYWtlcyBjbGVhciB0aGF0IFhlbiBib290ZWQgb2th
eShpc2gpLiBUaGUNCj4gZmFjdCB0aGF0IHlvdSBnZXQgIk5vIHN1Y2ggZmlsZSBvciBkaXJl
Y3RvcnkiIGZyb20geGVuY2FsbCBzdWdnZXN0cyB5b3UNCj4gZWl0aGVyIGRpZG4ndCBsb2Fk
IHRoZSB4ZW4tcHJpdmNtZCBkcml2ZXIgKG5vcm1hbGx5IGFycmFuZ2VtZW50cyBhcmUgbWFk
ZQ0KPiBieSBkaXN0cm9zIGZvciB0aGlzIHRvIGhhcHBlbiBhdXRvbWF0aWNhbGx5KSwgb3Ig
eW91IGRpZG4ndCBldmVuIGJ1aWxkIGl0Lg0KDQpUaGUgbWVzc2FnZXMgc2VlbiBkb24ndCBp
bmRpY2F0ZSB0aGF0IFhlbiBib290ZWQgb2theShpc2gpLiBJIGdldCB0aGUgc2FtZQ0KbWVz
c2FnZXMgd2hlbiBoYXZpbmcgYm9vdGVkIHRoZSBMaW51eCBrZXJuZWwgb24gYmFyZSBtZXRh
bCB3aXRob3V0IFhlbi4NCg0KPiANCj4+ICAgPiBBbmQgd2l0aCBhbGwgb2YgdGhlbSBzYXlp
bmcgZWZmZWN0aXZlbHkgdGhlIHNhbWUsIGRpZCB5b3UgdmVyaWZ5IHlvdQ0KPj4gICA+IGFj
dHVhbGx5IGhhdmUgYSBzdWZmaWNpZW50bHkgbGFyZ2UgYXJlYSByZXNlcnZlZD8gVGhlIG9i
dmlvdXMNCj4+ICAgPiBwbGFjZSBmb3IgeW91IHRvIGxvb2sgYXQgaXMgWGVuJ3MgYm9vdCBs
b2cgKG9idGFpbmVkIHZpYSBzZXJpYWwNCj4+ICAgPiBjb25zb2xlIG9yICJ4bCBkbWVzZyIg
aW1tZWRpYXRlbHkgYWZ0ZXIgYm9vdGluZyB0aGUgc3lzdGVtKS4gSWYgeW91DQo+PiAgID4g
ZmluZCBldmVyeXRoaW5nIGFzIGV4cGVjdGVkIHRoZXJlLCAuLi4NCj4+ICAgPg0KPj4NCj4+
IEluIGFuIGF0dGVtcHQgdG8gcmVzb2x2ZSB0aGUgbWVtb3J5IGFsbG9jYXRpb24gaXNzdWUs
IEkgaGF2ZSB0cmllZCB0aGUNCj4+IGZvbGxvd2luZzoNCj4+DQo+PiBBZGRlZCBhIGNyYXNo
a2VybmVsPTxzaXplPkA8b2Zmc2V0PiBwYXJhbWV0ZXIgdG8gdGhlIGhvc3Qga2VybmVsIGNv
bW1hbmQNCj4+IGxpbmUgdG8gcmVzZXJ2ZSBhIGRlZGljYXRlZCBtZW1vcnkgcmVnaW9uIGZv
ciBrZXhlYywgYW5kIGF0dGVtcHRlZCB0bw0KPj4gbG9hZCBYZW4gaW50byB0aGF0IGFyZWEu
DQo+IA0KPiBUaGF0IHdhcyBhIHJlbW90ZSBndWVzcyBvZiBtaW5lLiBUaGlzIGNvbW1hbmQg
bGluZSBvcHRpb24gaXMgbWVhbmluZ2xlc3MNCj4gd2hlbiBydW5uaW5nIHVuZGVyIFhlbi4g
VGhlIHJlc2VydmF0aW9uIG5lZWRzIHRvIGJlIGRvbmUgaW4gWGVuLg0KDQpKdXN0IG9uZSB0
aGluZyB0byBhZGQgaGVyZTogd2hhdCBkbyB5b3Ugd2FudCB0byBhY2NvbXBsaXNoIGJ5IGtl
eGVjLWluZyBpbnRvDQpYZW4/IFlvdSBuZWVkIHRvIHNwZWNpZnkgYSBkb20wIGtlcm5lbCBh
bmQgcHJvYmFibHkgdGhlIGRvbTAncyBpbml0cmQsIHRvby4NCg0KT3IgZG8geW91IGhhdmUg
Y29uZmlndXJlZCB5b3VyIGRvbTAgdG8gd29yayB3aXRob3V0IGFuIGluaXRyZD8gRXZlbiBp
biB0aGlzDQpjYXNlIHlvdSdkIG5lZWQgdG8gcGFzcyBvbiB0aGUgZG9tMCB0byBYZW4gdmlh
IHRoZSBrZXhlYyBjb21tYW5kLg0KDQoNCkp1ZXJnZW4NCg==
--------------LHsUp8Nk0UKDkSsiuvmY99VN
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-----

--------------LHsUp8Nk0UKDkSsiuvmY99VN--

--------------DN8FSuVoJn0UraqDFj85p3Ja--

--------------MauQ67W1CiCmNyumbihs2Qec
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/Ey8FAmawhMUFAwAAAAAACgkQsN6d1ii/Ey/9
gAf/SZegv69LmeqHP2DNggDDH7lqmngG29cLY2rICRpWNhm33cI83L98CW6n4t/wkFDxTO8AwCX8
EQ0zKDIdi6yy5vZlJHmbQx68ov0T7sA2iMx2agkoi5rNxl++CMlz/kBO5iBqjajOmmz7xMr8xTQ0
0DN8KKGMdx4V0X/ukYNKMapwO9/eiwQ+XZArry47tvZFhHMuWsfIO6VatUjz/M5Ya4VxW3CCTDgz
JEhjNtLS2FrYwzSCON3bB2MrP8dXV5mZqugi4zA3n4/il4y3zvoGfxDTV17wcFLdLtfz5txNLH4j
FuQVAduTA63qt/MnewRk1TNzsPMTQcf4BjqpSGDqcg==
=XDjq
-----END PGP SIGNATURE-----

--------------MauQ67W1CiCmNyumbihs2Qec--


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 07:58:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 07:58:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771811.1182242 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sasbg-0004sf-44; Mon, 05 Aug 2024 07:58:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771811.1182242; Mon, 05 Aug 2024 07:58:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sasbg-0004sY-0A; Mon, 05 Aug 2024 07:58:16 +0000
Received: by outflank-mailman (input) for mailman id 771811;
 Mon, 05 Aug 2024 07:58:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sasbe-0004sO-QE; Mon, 05 Aug 2024 07:58:14 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sasbe-0002JI-GN; Mon, 05 Aug 2024 07:58:14 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sasbe-0006FS-1t; Mon, 05 Aug 2024 07:58:14 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sasbe-0001P2-1N; Mon, 05 Aug 2024 07:58:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=93DzS+6buU01KJjB5PTWikwkvL5K28tZrX64OZLlBZ0=; b=OL6xEcK82JQwYMtBGX7knqYZZs
	ZJ8KLPbjbQY76JcqasKohxNK9PYB8uTvUo1zDS3iYu0t5vDBaqkXxtTGtiIBsXPvnfJzILaWpEsbT
	GdIVUcuaQsU+ewHRxF38RcE2/yAtFCFSIeafP5bjs2bPwCUNHEnZ6rmj3eTLcq/kEc0o=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187151-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187151: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=68b4c4b481f3129132cd90c45d241990445f4a3a
X-Osstest-Versions-That:
    ovmf=5ff99e0dabefea14b04e190c1659f4817fcb7bc0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 05 Aug 2024 07:58:14 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 68b4c4b481f3129132cd90c45d241990445f4a3a
baseline version:
 ovmf                 5ff99e0dabefea14b04e190c1659f4817fcb7bc0

Last test of basis   187146  2024-08-04 11:13:58 Z    0 days
Testing same since   187151  2024-08-05 06:13:31 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jason1 Lin <jason1.lin@intel.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   5ff99e0dab..68b4c4b481  68b4c4b481f3129132cd90c45d241990445f4a3a -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 08:12:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 08:12:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771827.1182253 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saspN-0008JU-DC; Mon, 05 Aug 2024 08:12:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771827.1182253; Mon, 05 Aug 2024 08:12:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saspN-0008JN-8V; Mon, 05 Aug 2024 08:12:25 +0000
Received: by outflank-mailman (input) for mailman id 771827;
 Mon, 05 Aug 2024 08:12:23 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Dvoq=PE=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1saspL-0008JH-3S
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 08:12:23 +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 6fca85f6-5302-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 10:12:20 +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 CF61A21B7A;
 Mon,  5 Aug 2024 08:12:19 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A210B13254;
 Mon,  5 Aug 2024 08:12:19 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id ohfEJWOJsGZdVwAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 05 Aug 2024 08:12:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6fca85f6-5302-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1722845539; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references:autocrypt:autocrypt;
	bh=ltVcg4amxt6pccipxB3f7kEjMqgZuYFi/jPyHyc77rI=;
	b=KKsPe7RCZD3cM+mdXjhn5h1W1VmVDSKxgOyVW98J+0ZVg0GQsTUl5WzpKnTXQcXahrYryz
	QNDpdRK3GGLbwsZO7t0A24QqXBGGqUkmxMLQ4Yphembx5zq892ldihcixHas6mqoRNPCRb
	h514lT894WFK8MuuwTDk8HRndvEsmLY=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1722845539; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references:autocrypt:autocrypt;
	bh=ltVcg4amxt6pccipxB3f7kEjMqgZuYFi/jPyHyc77rI=;
	b=KKsPe7RCZD3cM+mdXjhn5h1W1VmVDSKxgOyVW98J+0ZVg0GQsTUl5WzpKnTXQcXahrYryz
	QNDpdRK3GGLbwsZO7t0A24QqXBGGqUkmxMLQ4Yphembx5zq892ldihcixHas6mqoRNPCRb
	h514lT894WFK8MuuwTDk8HRndvEsmLY=
Message-ID: <a5fb0aa4-3d8d-49bf-8669-6dc81c4564ed@suse.com>
Date: Mon, 5 Aug 2024 10:12:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [KEXEC] Lacking documentation and kexec failure with Xen 4.19-rc4
 and 4.20-dev on linux host
To: A Kundu <avikalpa@yahoo.com>, xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com
References: <05395ed2-3bf3-4926-8e24-c2e7ff37ed26.ref@yahoo.com>
 <05395ed2-3bf3-4926-8e24-c2e7ff37ed26@yahoo.com>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <05395ed2-3bf3-4926-8e24-c2e7ff37ed26@yahoo.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------B2ZOMl0aUfKfh4a4NwiTWw4y"
X-Spam-Level: 
X-Spamd-Result: default: False [-3.19 / 50.00];
	SIGNED_PGP(-2.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain];
	NEURAL_HAM_SHORT(-0.20)[-0.999];
	MIME_BASE64_TEXT(0.10)[];
	MIME_UNKNOWN(0.10)[application/pgp-keys];
	XM_UA_NO_VERSION(0.01)[];
	RCVD_TLS_ALL(0.00)[];
	FREEMAIL_ENVRCPT(0.00)[yahoo.com];
	ARC_NA(0.00)[];
	MIME_TRACE(0.00)[0:+,1:+,2:+,3:+,4:~,5:~];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	TO_DN_SOME(0.00)[];
	FREEMAIL_TO(0.00)[yahoo.com,lists.xenproject.org];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	RCPT_COUNT_THREE(0.00)[3];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	MID_RHS_MATCH_FROM(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	HAS_ATTACHMENT(0.00)[]
X-Spam-Flag: NO
X-Spam-Score: -3.19

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------B2ZOMl0aUfKfh4a4NwiTWw4y
Content-Type: multipart/mixed; boundary="------------8FHjDX5se0YtTY2kFe0iFJn0";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: A Kundu <avikalpa@yahoo.com>, xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com
Message-ID: <a5fb0aa4-3d8d-49bf-8669-6dc81c4564ed@suse.com>
Subject: Re: [KEXEC] Lacking documentation and kexec failure with Xen 4.19-rc4
 and 4.20-dev on linux host
References: <05395ed2-3bf3-4926-8e24-c2e7ff37ed26.ref@yahoo.com>
 <05395ed2-3bf3-4926-8e24-c2e7ff37ed26@yahoo.com>
In-Reply-To: <05395ed2-3bf3-4926-8e24-c2e7ff37ed26@yahoo.com>

--------------8FHjDX5se0YtTY2kFe0iFJn0
Content-Type: multipart/mixed; boundary="------------gCy8dGgYXAbGQPV0qSxi6kWN"

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

T24gMzAuMDcuMjQgMDY6MDIsIEEgS3VuZHUgd3JvdGU6DQo+IEkgYW0gZXhwZXJpZW5jaW5n
IGlzc3VlcyB1c2luZyBrZXhlYyB0byBsb2FkIFhlbiA0LjE5LXJjNCBhbmQNCj4gNC4yMC1k
ZXYgb24gYSBkZWJpYW4gaG9zdC4NCj4gDQo+IFRoZSBjdXJyZW50IGRvY3VtZW50YXRpb24g
YXQNCj4gaHR0cHM6Ly94ZW5iaXRzLnhlbnByb2plY3Qub3JnL2RvY3MvNC4xOS10ZXN0aW5n
L21pc2Mva2V4ZWNfYW5kX2tkdW1wLnR4dA0KPiBhcHBlYXJzIHRvIGJlIG1pc3NpbmcgY3J1
Y2lhbCBkZXRhaWxzIG9uIHByb3Blcmx5IHVzaW5nIGtleGVjDQo+IHdpdGggdGhlIC0tdm1t
IG9wdGlvbiBmb3IgbG9hZGluZyBYZW4uDQo+IA0KPiBrZXhlYyBjb21wbGFpbnMgdGhlIC0t
dm1tIG9wdGlvbiBpcyBub3QgcHJlc2VudC4NCj4gDQo+IFN5c3RlbSBpbmZvcm1hdGlvbjoN
Cj4gJCB1bmFtZSAtYQ0KPiBMaW51eCBob3N0IDYuOS4xMC1hbWQ2NCAjMSBTTVAgUFJFRU1Q
VF9EWU5BTUlDIERlYmlhbiA2LjkuMTAtMSAoMjAyNC0wNy0xOSkgDQo+IHg4Nl82NCBHTlUv
TGludXgNCj4gDQo+ICQga2V4ZWMgLS12ZXJzaW9uICMgY29tcGlsZWQgZnJvbSBzb3VyY2Ug
dGFyYmFsbCB3aXRoIC4vY29uZmlndXJlIC0td2l0aC14ZW4NCj4ga2V4ZWMtdG9vbHMgMi4w
LjI5DQo+IA0KPiBTdGVwcyB0byByZXByb2R1Y2U6DQo+IA0KPiAxLiBTZXQgdmFyaWFibGVz
Og0KPiANCj4gWEVOX0hZUEVSVklTT1I9Ii9ib290L3hlbi5neiINCj4gWEVOX0NNRD0iZG9t
MF9tZW09NkcgZG9tMF9tYXhfdmNwdXM9NiBkb20wX3ZjcHVzX3BpbiBjcHVmcmVxPXhlbiIN
Cj4gDQo+IDIuIEF0dGVtcHQgdG8gbG9hZCBYZW4gNC4xOS1yYzQ6DQo+IA0KPiAjIGtleGVj
IC1sICIkWEVOX0hZUEVSVklTT1IiIC0tY29tbWFuZC1saW5lPSIkWEVOX0NNRCINCj4gQ291
bGQgbm90IGZpbmQgYSBmcmVlIGFyZWEgb2YgbWVtb3J5IG9mIDB4M2I2MDAxIGJ5dGVzLi4u
DQo+IGVsZl9leGVjX2J1aWxkX2xvYWRfcmVsb2NhdGFibGU6IEVMRiBleGVjIGxvYWQgZmFp
bGVkDQo+IA0KPiAzLiBBdHRlbXB0IHRvIGxvYWQgWGVuIDQuMjAtZGV2Og0KPiANCj4gIyBr
ZXhlYyAtbCAiJFhFTl9IWVBFUlZJU09SIiAtLWNvbW1hbmQtbGluZT0iJFhFTl9DTUQiDQo+
IENvdWxkIG5vdCBmaW5kIGEgZnJlZSBhcmVhIG9mIG1lbW9yeSBvZiAweDNmODAwMSBieXRl
cy4uLg0KPiBlbGZfZXhlY19idWlsZF9sb2FkX3JlbG9jYXRhYmxlOiBFTEYgZXhlYyBsb2Fk
IGZhaWxlZA0KPiANCj4gNC4gRm9sbG93IHRoZSBzdGVwcyBpbiB0aGUgWGVuIG1hbnVhbCBh
dCBtaXNjL2tleGVjX2FuZF9rZHVtcC50eHQ6DQo+IA0KPiAjIFNldCB2YXJpYWJsZXMNCj4g
DQo+IFhFTl9JTUFHRT0iL2Jvb3QveGVuLTQuMTktcmMuZ3oiDQo+IERPTTBfSU1BR0U9Ii9i
b290L3ZtbGludXotNi45LjEwLWFtZDY0Ig0KPiBET00wX0lOSVRSRD0iL2Jvb3QvaW5pdHJk
LmltZy02LjkuMTAtYW1kNjQiDQo+IERPTTBfTUVNT1JZPSI2RyINCj4gRE9NMF9DUFVTPSIw
LTUiDQo+IA0KPiAjIFByZXBhcmUgWGVuIGFuZCBkb20wIGNvbW1hbmQgbGluZSBhcmd1bWVu
dHMNCj4gDQo+IFhFTl9BUkdTPSJuby1yZWFsLW1vZGUgZG9tMF9tZW09JHtET00wX01FTU9S
WX0iDQo+IERPTTBfQVJHUz0ibWF4X2NwdXM9NiBkb20wX21heF92Y3B1cz02IGRvbTBfdmNw
dXNfcGluIg0KPiANCj4gIyBMb2FkIFhlbiBhbmQgZG9tMCBrZXJuZWwNCj4gDQo+IGtleGVj
IC1sIC0tYXBwZW5kPSIke1hFTl9BUkdTfSAtLSAke0RPTTBfQVJHU30iIC0taW5pdHJkPSR7
RE9NMF9JTklUUkR9IFwNCj4gIMKgIC0tdm1tPSR7WEVOX0lNQUdFfSAke0RPTTBfSU1BR0V9
DQo+IA0KPiBSZXN1bHQ6DQo+IGtleGVjOiB1bnJlY29nbml6ZWQgb3B0aW9uICctLXZtbT0v
Ym9vdC94ZW4tNC4xOS1yYy5neicNCj4gDQo+IEkgaGF2ZSB0cmllZCBjb21waWxpbmcga2V4
ZWMtdG9vbHMgMi4wLjI5IGZyb20gc291cmNlIHVzaW5nDQo+IC4vY29uZmlndXJlIC0td2l0
aC14ZW4sIGFzIHdlbGwgYXMgdXNpbmcgZGViaWFuJ3MgYXB0IHZlcnNpb24sIGJ1dA0KPiBi
b3RoIHJlc3VsdCBpbiB0aGUgc2FtZSAidW5yZWNvZ25pemVkIG9wdGlvbiAnLS12bW0nIiBl
cnJvci4NCj4gDQo+IFBsZWFzZSBwcm92aWRlIGd1aWRhbmNlIG9uIHRoZSBjb3JyZWN0IHN0
ZXBzIHRvIGdldCBrZXhlYyB3b3JraW5nDQo+IGZvciBsb2FkaW5nIFhlbiA0LjE5LXJjNCBh
bmQgNC4yMC1kZXYuIEFkZGl0aW9uYWxseSwgSSBraW5kbHkNCj4gcmVxdWVzdCB0aGF0IHRo
ZSBkb2N1bWVudGF0aW9uIGJlIHVwZGF0ZWQgd2l0aCB0aGVzZSBkZXRhaWxzIHRvDQo+IGFz
c2lzdCBvdGhlciB1c2VycyB3aG8gbWF5IGVuY291bnRlciB0aGlzIGlzc3VlLg0KDQpUaGUg
bWVudGlvbmVkIGRvY3VtZW50YXRpb24gaGFzbid0IHNlZW4gYW55IHVwZGF0ZXMgc2luY2Ug
MjAwOCBpbiB0aGUNCnBhcnQgeW91IGFyZSBpbnRlcmVzdGVkIGluLiBJIGJlbGlldmUgdGhl
IG1vc3Qgc2FuZSBhY3Rpb24gd291bGQgYmUgdG8NCnJlbW92ZSB0aGUgIktleGVjIiBjaGFw
dGVyIGNvbXBsZXRlbHkuDQoNCldpdGggWGVuIEknbSBub3QgYXdhcmUgb2YgYW55IHVzZSBj
YXNlIG5vd2FkYXlzIG90aGVyIHRoYW4gdGhhdCBleHBsYWluZWQNCmluIHRoZSAiS2R1bXAi
IGNoYXB0ZXIuDQoNCg0KSnVlcmdlbg0K
--------------gCy8dGgYXAbGQPV0qSxi6kWN
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-----

--------------gCy8dGgYXAbGQPV0qSxi6kWN--

--------------8FHjDX5se0YtTY2kFe0iFJn0--

--------------B2ZOMl0aUfKfh4a4NwiTWw4y
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/Ey8FAmawiWMFAwAAAAAACgkQsN6d1ii/Ey8h
ugf8DO78EgYpWXfEHRO+xxTRLnhUd+k7XBQXZR5eII6KhedBz/3gdMUV2IqnfLLK51Y1tOPX/2x8
tpIC/wr/k+V4wLPG6Fwqz8B11soUrJEczKIM49hBrjYmGUC8LIdzgdisgTcEFT98UeRnWof1JVZc
9XhUJakr57SbKaECClPNdBfRoni/Pg399FdfvtdXnwZt8noIPPe6+CeN7UqETDQesGwno61ifP6i
WxW4ZKOfbAzPgGkVU/nIXJ0EMB89EgLgJVXOhoaD6Gcap+lGXB5lEQlbwPMU8peEp0ZMGztuNuBm
pYn+A+73ZOjhktyqHWDhrHzVeD3fj85bIBiO44lMQw==
=khBV
-----END PGP SIGNATURE-----

--------------B2ZOMl0aUfKfh4a4NwiTWw4y--


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 08:13:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 08:13:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771835.1182261 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sasqK-0000OC-KK; Mon, 05 Aug 2024 08:13:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771835.1182261; Mon, 05 Aug 2024 08:13:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sasqK-0000O5-HW; Mon, 05 Aug 2024 08:13:24 +0000
Received: by outflank-mailman (input) for mailman id 771835;
 Mon, 05 Aug 2024 08:13:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=I4ub=PE=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sasqK-0000Is-4N
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 08:13:24 +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 95408a96-5302-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 10:13:23 +0200 (CEST)
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-a7aa4ca9d72so1186361566b.0
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 01:13:23 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ecb085sm420682166b.212.2024.08.05.01.13.21
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 05 Aug 2024 01:13:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 95408a96-5302-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722845603; x=1723450403; 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=RSVAtk8ASxSlNuTkSOv8+pp8eaYCgFgeM8xdbggOScc=;
        b=JzW7hEueux6DMnjAZZR2BZ49wW3j5JXzuNgtkTvIdInUELZO8uKrDXRuaGayKbFmcz
         Zt0W3ECgKN8JxiDHkd1zDmOSNGvR3MoWy5Hx2Q6WfmBvVKANfBySW9dGFkTWsGlc/4Qq
         gxyNx//mlK3g/QKTxekInXX4Sua9R+/6yFc5BPzk82LyIbS13vgqjZMnMqbUFR+NkZpx
         GDBd9b34l0ZugzfoJM2n3etwBIJXnc2O/3kAsj5jVb4M8JcM0otONLTs9yoct6GaKez6
         4erh3fI7L9CNJhVaX3Vu5AS1H19RQhflsIZAMNoJ7Zl8qdLxIIP1Qp8XiC9bBoE0rEiz
         5MIQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722845603; x=1723450403;
        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=RSVAtk8ASxSlNuTkSOv8+pp8eaYCgFgeM8xdbggOScc=;
        b=bu+IUxfLwKtCGp67gRw5WiAotJ9lKbHutiC3vG44hR9IM5KyBjTYJybB4U9LYah5Qm
         j3nP3V4GT+FG/5ELdhwKyLpmU4gWxfqbB0dfqSBT7U35sd8RWyPqYUevbNqNo9djFOsR
         7wYJvNd+ArL3jEN2M2sJ4ssDTys0+sREA0LOUv779l9KXtoldNDM03bgxJhr/cJwJyjE
         xbAYovVfTZUXoUpgrMrAkf91mDd8nidQMZN46IV2SoqmTqbNEzylTWiSg43/smVdb1L5
         mj+An2kitQ7RZQBzh0denN0TwDYeihQDGZkimF8jrtXMWAWgBjPavtVdN/HPjStwaTU8
         w6EA==
X-Forwarded-Encrypted: i=1; AJvYcCW3P3G34SoqrTmMPAtJ612XMDWCdR5rKsrhe9oSkEQuPE3zNuZCWh8le9TxfjCBzddVIa3w8ECUSXU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzIujv3UdlKnWgxjOadNTPOLCwYU4SMnSlwrQSmVoxk5e50rqF3
	2UvYAZlpesMvM60iVLkbI2zD3rpgA9Y+nU54915ErpxPzy4sSlRvTwpdBagbSw==
X-Google-Smtp-Source: AGHT+IE5ZRJCjb3GqsOmwC+xbgcZTTM2VpGf8UcOIyb+KQACkjiBdiAfi7ZL7+GH5plWx6S7KjODbA==
X-Received: by 2002:a17:907:c009:b0:a7d:cf4f:1817 with SMTP id a640c23a62f3a-a7dcf4f1a38mr702447866b.0.1722845602460;
        Mon, 05 Aug 2024 01:13:22 -0700 (PDT)
Message-ID: <ee4d05f4-f533-4f03-99ba-65ddefa54d82@suse.com>
Date: Mon, 5 Aug 2024 10:13:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: kexec failure with Xen 4.19-rc4 and 4.20-dev on linux host
To: Juergen Gross <jgross@suse.com>, A Kundu <avikalpa@yahoo.com>
Cc: kexec@lists.infradead.org, horms@verge.net.au,
 xen-devel@lists.xenproject.org, Baoquan He <bhe@redhat.com>,
 andrew.cooper3@citrix.com
References: <05395ed2-3bf3-4926-8e24-c2e7ff37ed26@yahoo.com>
 <cebc7800-df78-4f90-9f8e-82e3f9120b6e@yahoo.com>
 <ZqxUMgcEHakeFPaU@MiWiFi-R3L-srv>
 <abaceb99-4b80-49d7-ab7f-b190f73e858d@yahoo.com>
 <ac57dec1-68a3-471d-8f4c-c87fd9dca619@suse.com>
 <dc5c9dff-6bee-493a-8315-b2eee48bd802@yahoo.com>
 <18032298-e535-4405-890e-6ab9d54cf7e3@suse.com>
 <74bac0d8-de7a-41df-87ed-b7e2d4140ade@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: <74bac0d8-de7a-41df-87ed-b7e2d4140ade@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 05.08.2024 09:52, Juergen Gross wrote:
> On 05.08.24 08:01, Jan Beulich wrote:
>> On 04.08.2024 15:17, A Kundu wrote:
>>> On 8/2/24 13:25, Jan Beulich wrote:
>>>   > On 02.08.2024 09:28, A Kundu wrote:
>>>   >> On 8/2/24 09:06, Baoquan He wrote:
>>>   >>> On 07/31/24 at 06:34pm, A Kundu wrote:
>>>   >>>> I am experiencing issues using kexec to load Xen 4.17(debian's apt
>>> version),
>>>   >>>> Xen 4.19-rc4 (compiled from source) and 4.20-dev (compiled from
>>> source) on a
>>>   >>>> debian host.
>>>   >>> You should CC this to XEN dev list so that XEN dev knows this and may
>>>   >>> provide help. Not everyone is interested in and knows XEN.
>>>   >>>
>>>   >>>> System information:
>>>   >>>> $ uname -a
>>>   >>>> Linux host 6.9.10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.9.10-1
>>> (2024-07-19)
>>>   >>>> x86_64 GNU/Linux
>>>   >>>>
>>>   >>>> $ kexec --version # compiled from source tarball with ./configure
>>> --with-xen
>>>   >>>> kexec-tools 2.0.29
>>>   >>>>
>>>   >>>> Steps to reproduce:
>>>   >>>>
>>>   >>>> 1. Set variables:
>>>   >>>>
>>>   >>>> XEN_HYPERVISOR="/boot/xen.gz"
>>>   >>>> XEN_CMD="dom0_mem=6G dom0_max_vcpus=6 dom0_vcpus_pin cpufreq=xen"
>>>   >>>>
>>>   >>>> 2. Attempt to load Xen 4.19-rc4:
>>>   >>>>
>>>   >>>> # kexec -l "$XEN_HYPERVISOR" --command-line="$XEN_CMD"
>>>   >>>> Could not find a free area of memory of 0x3b6001 bytes...
>>>   >>>> elf_exec_build_load_relocatable: ELF exec load failed
>>>   >>>>
>>>   >>>> 3. Attempt to load Xen 4.20-dev:
>>>   >>>>
>>>   >>>> # kexec -l "$XEN_HYPERVISOR" --command-line="$XEN_CMD"
>>>   >>>> Could not find a free area of memory of 0x3f8001 bytes...
>>>   >>>> elf_exec_build_load_relocatable: ELF exec load failed
>>>   >>>>
>>>   >>>> 4. Attempt to load Xen 4.17 (from debian rrepositories):
>>>   >>>> # kexec -l /boot/xen-4.17-amd64.gz --command-line="$XEN_CMD"
>>>   >>>> Could not find a free area of memory of 0x3b4001 bytes...
>>>   >>>> elf_exec_build_load_relocatable: ELF exec load failed
>>>   >
>>>   > And with all of them saying effectively the same, did you verify you
>>>   > actually have a sufficiently large area reserved? The obvious
>>>   > place for you to look at is Xen's boot log (obtained via serial
>>>   > console or "xl dmesg" immediately after booting the system). If you
>>>   > find everything as expected there, ...
>>>   >
>>>   >>>> If you need any further information to investigate this problem,
>>>   >>>> please let me know.
>>>   >
>>>   > ... please provide that boot log.
>>>
>>> I have also followed up on your suggestion to check the Xen boot log
>>> using "xl dmesg", but unfortunately, I received the following error:
>>>
>>> xencall: error: Could not obtain handle on privileged command interface:
>>> No such file or directory
>>> libxl: error: libxl.c:102:libxl_ctx_alloc: cannot open libxc handle: No
>>> such file or directory
>>> cannot init xl context
>>>
>>> This indicates that Xen did not boot successfully, so there are no logs
>>> available.
>>
>> The fact that you have Dom0 up makes clear that Xen booted okay(ish). The
>> fact that you get "No such file or directory" from xencall suggests you
>> either didn't load the xen-privcmd driver (normally arrangements are made
>> by distros for this to happen automatically), or you didn't even build it.
> 
> The messages seen don't indicate that Xen booted okay(ish). I get the same
> messages when having booted the Linux kernel on bare metal without Xen.

Hmm, I didn't even think of this as a possible case, considering the question
was forwarded to xen-devel (from a kexec list). I'm afraid Xen simply plays
no role when setting up kexec (to whatever target) from a bare metal env.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 08:19:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 08:19:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771844.1182271 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sasw4-0001UC-7v; Mon, 05 Aug 2024 08:19:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771844.1182271; Mon, 05 Aug 2024 08:19:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sasw4-0001U5-5I; Mon, 05 Aug 2024 08:19:20 +0000
Received: by outflank-mailman (input) for mailman id 771844;
 Mon, 05 Aug 2024 08:19:19 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sasw2-0001Tv-UV; Mon, 05 Aug 2024 08:19:18 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sasw2-0003Cb-Mw; Mon, 05 Aug 2024 08:19:18 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sasw2-0006qQ-64; Mon, 05 Aug 2024 08:19:18 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sasw2-0000cd-5S; Mon, 05 Aug 2024 08:19:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=n7YpCrYTa4FYRP24J1OLjgbCruS/S8gWch4ZMoDFQJ8=; b=yZiZV5oR/AL4XpfDSLbraUyzEC
	E1WQuIhU+aRjX+WvVVbxt09xPy9FYUmosinfqkMcTIgfyfX928MSbJS3REcA82gX+zn0+K9nRqm4b
	NEB/rjlgohV83IhYD4TpKSAyx9EDdi3tvnOMeuxaBh7FpSlzdBUyvKtT2RsosaZzVnFQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187148-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.19-testing test] 187148: regressions - FAIL
X-Osstest-Failures:
    xen-4.19-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:regression
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:windows-install:fail:heisenbug
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=026c9fa29716b0ff0f8b7c687908e71ba29cf239
X-Osstest-Versions-That:
    xen=fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 05 Aug 2024 08:19:18 +0000

flight 187148 xen-4.19-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187148/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop       fail REGR. vs. 187044

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-ws16-amd64 12 windows-install    fail pass in 187143

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

version targeted for testing:
 xen                  026c9fa29716b0ff0f8b7c687908e71ba29cf239
baseline version:
 xen                  fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e

Last test of basis   187044  2024-07-29 16:07:22 Z    6 days
Testing same since   187048  2024-07-30 01:41:30 Z    6 days   10 attempts

------------------------------------------------------------
People who touched revisions under test:
  Julien Grall <jgrall@amazon.com>

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


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

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

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

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


Not pushing.

------------------------------------------------------------
commit 026c9fa29716b0ff0f8b7c687908e71ba29cf239
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:45 2024 +0100

    Set 4.19 version
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit df9b8a649f0424e0a949c0f9a7961724bbe8ea70
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:08 2024 +0100

    README: make heading say 4.19
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit b2d2878ab2686b92fcdd7bbca4ff4c312a42bc11
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:18:01 2024 +0100

    Config.mk: Bump tags to 4.19.0 final
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 09:08:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 09:08:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771863.1182290 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sathX-0000lE-2f; Mon, 05 Aug 2024 09:08:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771863.1182290; Mon, 05 Aug 2024 09:08:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sathW-0000l7-Uy; Mon, 05 Aug 2024 09:08:22 +0000
Received: by outflank-mailman (input) for mailman id 771863;
 Mon, 05 Aug 2024 09:08:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sathV-0000l1-Fh
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 09:08:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sathU-00043R-Hq; Mon, 05 Aug 2024 09:08:20 +0000
Received: from [15.248.2.233] (helo=[10.24.67.21])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sathU-0007Nh-4l; Mon, 05 Aug 2024 09:08:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=7LHqG+5cQRYyexYtSZaKbPnZjvCTOGvJ8WmVaGI+YWQ=; b=Vs0iIkAedtkyrJsi1IvCeAgZEM
	n1e86pQ8jqiOqiuqpEyWXP00bETMwBM/AiE7yaPlEyfqFiUUBLLvrWQCJcyRHIrX7kC1+FTgjrxGY
	HAk4WmPS1ycJ723M4TOrv07KmPufU9+CrwiTcWXCbLbAdde5cytw6PkGE5TnoAkYGDlw=;
Message-ID: <309d42dc-e540-4fbe-a69e-2be6414deb70@xen.org>
Date: Mon, 5 Aug 2024 10:08:17 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 1/9] xen/device-tree: Move Arm's setup.c bootinfo
 functions to common
Content-Language: en-GB
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 xen-devel@lists.xenproject.org
Cc: Shawn Anastasio <sanastasio@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
 <102f8b60c55cdf2db5890b9fb1c2fb66e61c4a67.1721834549.git.oleksii.kurochko@gmail.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <102f8b60c55cdf2db5890b9fb1c2fb66e61c4a67.1721834549.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 24/07/2024 16:31, Oleksii Kurochko wrote:
> Changes in V5:
>   - add xen/include/xen/bootfdt.h to MAINTAINERS file.
>   - drop message "Early device tree parsing and".
>   - After rebase on top of the current staging the following changes were done:
>     - init bootinfo variable in <common/device-tree/bootinfo.c> with BOOTINFO_INIT;
>     - update the code of dt_unreserved_regions():
>         CONFIG_STATIC_SHM related changes and getting of reserved_mem
>         bootinfo_get_shmem() ??
>     - update the code of meminfo_overlap_check():
>         add check ( INVALID_PADDR == bank_start ) to if case.
>     - update the code of check_reserved_regions_overlap():
>         CONFIG_STATIC_SHM related changes.
>     - struct bootinfo was updated ( CONFIG_STATIC_SHM changes )
>     - add shared_meminfo ( because of CONFIG_STATIC_SHM )
>     - struct struct membanks was update with __struct group so <xen/kernel> is
>       neeeded to be included in bootfdt.h
>     - move BOOTINFO_ACPI_INIT, BOOTINFO_SHMEM_INIT, BOOTINFO_INIT to generic bootfdt.h
>     - bootinfo_get_reserved_mem(), bootinfo_get_mem(), bootinfo_get_acpi(),
>       bootinfo_get_shmem() and bootinfo_get_shmem_extra() were moved to xen/bootfdt.h
>   - s/arm32/CONFIG_SEPARATE_XENHEAP/

I think this change deserve a comment in the commit message.

[...]

> --- /dev/null
> +++ b/xen/common/device-tree/bootinfo.c
> @@ -0,0 +1,459 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Derived from $xen/arch/arm/setup.c.

I would suggest to mention the version of Xen this is derived from.

Acked-by: Julien Grall <jgrall@amazon.com>

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 09:14:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 09:14:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771872.1182299 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1satn5-0002EK-Kk; Mon, 05 Aug 2024 09:14:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771872.1182299; Mon, 05 Aug 2024 09:14:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1satn5-0002ED-ID; Mon, 05 Aug 2024 09:14:07 +0000
Received: by outflank-mailman (input) for mailman id 771872;
 Mon, 05 Aug 2024 09:14: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=006L=PE=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1satn4-0002E7-FD
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 09:14:06 +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 0fce43bf-530b-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 11:14:04 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-52f01ec08d6so14557392e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 02:14:04 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530bba11015sm1057745e87.92.2024.08.05.02.14.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 05 Aug 2024 02:14:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0fce43bf-530b-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722849244; x=1723454044; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=yw6q5AGcWhKd7lizOSzsg9z2583TFXz8J61Yx95iWGM=;
        b=c37FZlBlCh/tup/B1zhU+cA99VVDcvjTuRtXLr6fpQr00a5h4xVn90zdB0Mzq/AErh
         KVEAcOZ3egeAPVmcri3RtE/4yjl7bw3usA360mnOiwUaYUDAPY/jjDBy7L1g5RPTVaZy
         VrUZqsg53FWRm5ZETkLZulf9XI6xKxfD/9iFHq7JSnVCGU0R76pJUOdgsrwdvQDBX+FN
         cRvLpFKJxOxv5vHy7bOMN5sd1czyM1psRx5mC8b5gY+7Mm//cLLFvAhwSSNwsgUKRIhh
         5Dp52Jc22AtP+sGvUyazITtCtqd/o2kHxYFE0YPFqvIoLodvL1623GPIHxpYQHT9OFCW
         gTcw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722849244; x=1723454044;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=yw6q5AGcWhKd7lizOSzsg9z2583TFXz8J61Yx95iWGM=;
        b=laRdt/13+iBuc+cQesTgTRXl5DjUOyNLpuMPscom87wDG6hB2desgqgv6VQdyuf77U
         QYzjQZvTK1sk5XTzbtnqgumVAhOYDQFBSJMspAs6TPQf1ZbibvCT4ywuMQDbbAMeIY+F
         EQwuEib7FKv5Poblv8aDv/rQmSVhUIhrQYeIuSwoiqaX7ruAPwPJrqrS+vF+r8PgehbP
         3Dm0kQ22bm9RN+uDie4xmAVDY9+p74HB/KCI733zfSMNU5mZZDYB6PoSIJkMfKzhwF78
         R5wm+EBtEPUi77LdWriftzVm3XG8H6rjhOeW0bsB6QeW69LDxBm0E9beMIK5xB5syLIY
         Cqyg==
X-Forwarded-Encrypted: i=1; AJvYcCWD3dORMSFUS49oobBZKTKJQCgcQiHZ0RSEsEuLGMI/v3Gl8PRIlV1mzBFusf/aojE8fC8T9MZWBi/vB0Ae9ggL27AN2+Y2wJiteVMq1YQ=
X-Gm-Message-State: AOJu0YyM0rc0by6SoUocYZD8A2n0lsgg37gQTDOqwSNslbIVtbEctfYC
	7rQLpbXLQrNVGzlNn8x9G/gGSk/m8R4AtoKMiYAkGFyRyQX4wO5w
X-Google-Smtp-Source: AGHT+IEZ4nmmHU3qzz9KXfHZ4ei1f3Ec4DVzpMxZH+hUk1BXAhOcSR9ZzFXyhP1f1S8AyfuUvDkjog==
X-Received: by 2002:a05:6512:130f:b0:52c:e11e:d493 with SMTP id 2adb3069b0e04-530bb381028mr7851176e87.26.1722849243540;
        Mon, 05 Aug 2024 02:14:03 -0700 (PDT)
Message-ID: <3a8545f9eb661df8082efc086161024d9601f7e1.camel@gmail.com>
Subject: Re: [PATCH v12 3/3] xen/riscv: refactor decode_trap_cause()
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Mon, 05 Aug 2024 11:14:02 +0200
In-Reply-To: <361eb1c3-003b-47d2-bcd9-0f06e91bfd0a@suse.com>
References: <cover.1722605952.git.oleksii.kurochko@gmail.com>
	 <88e15908d6ac363934b6da52091443af28bd7291.1722605952.git.oleksii.kurochko@gmail.com>
	 <361eb1c3-003b-47d2-bcd9-0f06e91bfd0a@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: base64
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

T24gTW9uLCAyMDI0LTA4LTA1IGF0IDA4OjIwICswMjAwLCBKYW4gQmV1bGljaCB3cm90ZToKPiBP
biAwMi4wOC4yMDI0IDE1OjU0LCBPbGVrc2lpIEt1cm9jaGtvIHdyb3RlOgo+ID4gVXNlIGFycmF5
X2FjY2Vzc19ub3NwZWMoKSB0byBwcmV2ZW50IGd1ZXN0IHNwZWN1bGF0aW9uLgo+ID4gCj4gPiBB
dm9pZCBkb3VibGUgYWNjZXNzIG9mIHRyYXBfY2F1c2VzW2NhdXNlXS4KPiA+IAo+ID4gU3VnZ2Vz
dGVkLWJ5OiBKYW4gQmV1bGljaCA8amJldWxpY2hAc3VzZS5jb20+Cj4gPiBTaWduZWQtb2ZmLWJ5
OiBPbGVrc2lpIEt1cm9jaGtvIDxvbGVrc2lpLmt1cm9jaGtvQGdtYWlsLmNvbT4KPiAKPiBSZXZp
ZXdlZC1ieTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgo+IHdpdGggLi4uCj4gCj4g
PiBAQCAtNDgsOSArNDksMTAgQEAgc3RhdGljIGNvbnN0IGNoYXIgKmRlY29kZV90cmFwX2NhdXNl
KHVuc2lnbmVkCj4gPiBsb25nIGNhdXNlKQo+ID4gwqDCoMKgwqDCoMKgwqDCoCBbQ0FVU0VfU1RP
UkVfR1VFU1RfUEFHRV9GQVVMVF0gPSAiR3Vlc3QgU3RvcmUvQU1PIFBhZ2UKPiA+IEZhdWx0IiwK
PiA+IMKgwqDCoMKgIH07Cj4gPiDCoAo+ID4gLcKgwqDCoCBpZiAoIGNhdXNlIDwgQVJSQVlfU0la
RSh0cmFwX2NhdXNlcykgJiYgdHJhcF9jYXVzZXNbY2F1c2VdICkKPiA+IC3CoMKgwqDCoMKgwqDC
oCByZXR1cm4gdHJhcF9jYXVzZXNbY2F1c2VdOwo+ID4gLcKgwqDCoCByZXR1cm4gIlVOS05PV04i
Owo+ID4gK8KgwqDCoCBjb25zdCBjaGFyICpyZXMgPSBjYXVzZSA8IEFSUkFZX1NJWkUodHJhcF9j
YXVzZXMpID8KPiA+IGFycmF5X2FjY2Vzc19ub3NwZWModHJhcF9jYXVzZXMsIGNhdXNlKQo+IAo+
IC4uLiB0aGUgb3Zlcmx5IGxvbmcgbGluZSBoZXJlIHN1aXRhYmx5IHdyYXBwZWQ7IGNvbW1vbmx5
IHdlJ2QgZG8gdGhpcwo+IGFzIC4uLgo+IAo+ID4gK8KgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKg
wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC
oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgOiBOVUxMOwo+IAo+IMKgwqDCoCBjb25zdCBjaGFyICpy
ZXMgPSBjYXVzZSA8IEFSUkFZX1NJWkUodHJhcF9jYXVzZXMpCj4gwqDCoMKgwqDCoMKgwqDCoMKg
wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgID8gYXJyYXlfYWNjZXNzX25vc3BlYyh0cmFwX2NhdXNl
cywgY2F1c2UpCj4gwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIDog
TlVMTDsKPiAKPiBJIGd1ZXNzIEknbGwgYWRqdXN0IHRoaXMgd2hpbGUgY29tbWl0dGluZy4KSSB3
aWxsIGJlIGhhcHB5IHdpdGggdGhhdC4gVGhhbmtzIQoKfiBPbGVrc2lpCj4gCj4gSmFuCj4gCj4g
PiArwqDCoMKgIHJldHVybiByZXMgPzogIlVOS05PV04iOwo+ID4gwqB9Cj4gPiDCoAo+ID4gwqBz
dGF0aWMgY29uc3QgY2hhciAqZGVjb2RlX3Jlc2VydmVkX2ludGVycnVwdF9jYXVzZSh1bnNpZ25l
ZCBsb25nCj4gPiBpcnFfY2F1c2UpCj4gCgo=



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 09:31:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 09:31:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771881.1182310 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sau3X-0005dq-0Z; Mon, 05 Aug 2024 09:31:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771881.1182310; Mon, 05 Aug 2024 09:31:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sau3W-0005dj-U2; Mon, 05 Aug 2024 09:31:06 +0000
Received: by outflank-mailman (input) for mailman id 771881;
 Mon, 05 Aug 2024 09:31:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sau3V-0005dd-IW
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 09:31:05 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sau3U-0004Ot-O1; Mon, 05 Aug 2024 09:31:04 +0000
Received: from [15.248.2.233] (helo=[10.24.67.21])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sau3U-0000N8-Fp; Mon, 05 Aug 2024 09:31:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=6dVHa9GCqavIg/HNqh81Sed1LHwaGW0erF9aFIlbcNY=; b=Tu0Gf/SPon9RWRUt/OIAuEVAUf
	gXxX+N4b5wbvAizOBT4VQezAi8geFHkTZny6wIzAty5htZFsy2pIMO43yv2hivaRFwnSZV/6GoB31
	rFavrIX2eVEEReScC6Mhi74pEYhNG1uGNZd2abifP8Gyl6Im6WQsV1lSAVX3P6vY3vvc=;
Message-ID: <4af8ef8c-b3c1-48b4-930b-72f8ef7d26d7@xen.org>
Date: Mon, 5 Aug 2024 10:31:02 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 2/9] xen/common: Move Arm's bootfdt.c to common
Content-Language: en-GB
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 xen-devel@lists.xenproject.org
Cc: Shawn Anastasio <sanastasio@raptorengineering.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
 <35558886445c39c0f570632d355b42bb764dbdc4.1721834549.git.oleksii.kurochko@gmail.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <35558886445c39c0f570632d355b42bb764dbdc4.1721834549.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Oleksii,

On 24/07/2024 16:31, Oleksii Kurochko wrote:
> From: Shawn Anastasio <sanastasio@raptorengineering.com>
> 
> Move Arm's bootfdt.c to xen/common so that it can be used by other
> device tree architectures like PPC and RISCV.
> 
> Suggested-by: Julien Grall <julien@xen.org>
> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
> Acked-by: Julien Grall <julien@xen.org>

On Matrix you asked me to review this patch again. This wasn't obvious 
given you kept my ack. If you think a review is needed, then please 
either drop the ack or explain why you keep it and ask if it is fine.

Also, I tend to list in the changes where this was acked. In this case, 
you said I acked v4.

Anyway, before confirming my ack, I would like to ask some clarification.

> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
> Changes in V7:
>   - Nothing changed. Only rebase.
> ---
> Changes in V6:
>   - update the version of the patch to v6.
> ---
> Changes in V5:
>   - add xen/include/xen/bootfdt.h to MAINTAINERS file.

I don't see any change in MAINTAINERS within this patch. Did you happen 
to copy/paste all the changes made in the series?

In fact the only change related to this patch doesn't seem to be listed.

[...]

> +#ifndef CONFIG_STATIC_SHM
> +static inline int process_shm_node(const void *fdt, int node,
> +                                   uint32_t address_cells, uint32_t size_cells)
> +{
> +    printk("CONFIG_STATIC_SHM must be enabled for parsing static shared"
> +            " memory nodes\n");
> +    return -EINVAL;
> +}
> +#endif

I see you duplicated the stub from arch/arm/include/static-shmem.h. But 
the one in static-shmem.h will now be unreachable. I think it needs to 
be removed.

Also, I think this change deserve an explanation in the commit message.

[...]

> +static void __init early_print_info(void)
> +{
> +    const struct membanks *mi = bootinfo_get_mem();
> +    const struct membanks *mem_resv = bootinfo_get_reserved_mem();
> +    struct bootmodules *mods = &bootinfo.modules;
> +    struct bootcmdlines *cmds = &bootinfo.cmdlines;
> +    unsigned int i;
> +
> +    for ( i = 0; i < mi->nr_banks; i++ )
> +        printk("RAM: %"PRIpaddr" - %"PRIpaddr"\n",
> +                mi->bank[i].start,
> +                mi->bank[i].start + mi->bank[i].size - 1);
> +    printk("\n");
> +    for ( i = 0 ; i < mods->nr_mods; i++ )
> +        printk("MODULE[%d]: %"PRIpaddr" - %"PRIpaddr" %-12s\n",
> +                i,
> +                mods->module[i].start,
> +                mods->module[i].start + mods->module[i].size,
> +                boot_module_kind_as_string(mods->module[i].kind));
> +
> +    for ( i = 0; i < mem_resv->nr_banks; i++ )
> +    {
> +        printk(" RESVD[%u]: %"PRIpaddr" - %"PRIpaddr"\n", i,
> +               mem_resv->bank[i].start,
> +               mem_resv->bank[i].start + mem_resv->bank[i].size - 1);
> +    }
> +#ifdef CONFIG_STATIC_SHM
> +    early_print_info_shmem();
> +#endif

Similar remark here.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 09:33:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 09:33:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771889.1182320 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sau5k-0006Cy-CH; Mon, 05 Aug 2024 09:33:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771889.1182320; Mon, 05 Aug 2024 09:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sau5k-0006Cr-9H; Mon, 05 Aug 2024 09:33:24 +0000
Received: by outflank-mailman (input) for mailman id 771889;
 Mon, 05 Aug 2024 09:33:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sau5i-0006Ch-LG; Mon, 05 Aug 2024 09:33:22 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sau5i-0004SV-KR; Mon, 05 Aug 2024 09:33:22 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sau5i-0000s6-4k; Mon, 05 Aug 2024 09:33:22 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sau5i-0007es-49; Mon, 05 Aug 2024 09:33:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=lgp9qejkhbN6RJFU09scK1CJclhtBXcQcfiYrfWFKJs=; b=Gq6zR/2ACKf5ZyH4du9wBtKp+M
	EPE/ukGVdf9uf2UAFPB/7iSMbmcX5yvIrKKw16tbv+JZQ0y2dN/GHO2lOq2CCLaEhpafDMcjLQ8+w
	CKBlbYg6+rcPjXfd1TiM3X3nFiHauYTv+CZShfjW7197Jyli9Vhv0pyYvkctdxClHrtk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187152-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187152: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=5d43165ff8596c2fa07b7d4de3c482d64338ca99
X-Osstest-Versions-That:
    ovmf=68b4c4b481f3129132cd90c45d241990445f4a3a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 05 Aug 2024 09:33:22 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 5d43165ff8596c2fa07b7d4de3c482d64338ca99
baseline version:
 ovmf                 68b4c4b481f3129132cd90c45d241990445f4a3a

Last test of basis   187151  2024-08-05 06:13:31 Z    0 days
Testing same since   187152  2024-08-05 08:15:15 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Dun Tan <dun.tan@intel.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   68b4c4b481..5d43165ff8  5d43165ff8596c2fa07b7d4de3c482d64338ca99 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 09:34:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 09:34:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771899.1182330 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sau71-0006kO-N6; Mon, 05 Aug 2024 09:34:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771899.1182330; Mon, 05 Aug 2024 09:34:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sau71-0006kH-IW; Mon, 05 Aug 2024 09:34:43 +0000
Received: by outflank-mailman (input) for mailman id 771899;
 Mon, 05 Aug 2024 09:34: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=4fqT=PE=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1sau70-0006jy-0N
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 09:34:42 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f072fd40-530d-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 11:34:40 +0200 (CEST)
Received: from truciolo.bugseng.com.homenet.telecomitalia.it
 (host-87-20-207-105.retail.telecomitalia.it [87.20.207.105])
 by support.bugseng.com (Postfix) with ESMTPSA id 36D214EE0758;
 Mon,  5 Aug 2024 11:34:40 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f072fd40-530d-11ef-bc03-fd08da9f4363
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [XEN PATCH 2/2] automation/eclair: tag more guidelines as clean
Date: Mon,  5 Aug 2024 11:34:33 +0200
Message-Id: <d552057fece18290c86e082434e3a04c783b4d46.1722842330.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1722842330.git.federico.serafini@bugseng.com>
References: <cover.1722842330.git.federico.serafini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Tag more of the accepted guidelines as clean to avoid regressions.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 automation/eclair_analysis/ECLAIR/tagging.ecl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/eclair_analysis/ECLAIR/tagging.ecl
index e7b32773e6..4d0ac94848 100644
--- a/automation/eclair_analysis/ECLAIR/tagging.ecl
+++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
@@ -56,11 +56,14 @@ MC3R1.R9.3||
 MC3R1.R9.4||
 MC3R1.R9.5||
 MC3R1.R10.2||
+MC3R1.R11.6||
 MC3R1.R11.7||
 MC3R1.R11.9||
 MC3R1.R12.5||
 MC3R1.R14.1||
+MC3R1.R14.3||
 MC3R1.R14.4||
+MC3R1.R16.2||
 MC3R1.R16.7||
 MC3R1.R17.1||
 MC3R1.R17.3||
@@ -85,6 +88,7 @@ MC3R1.R21.7||
 MC3R1.R21.8||
 MC3R1.R21.9||
 MC3R1.R21.10||
+MC3R1.R21.11||
 MC3R1.R21.12||
 MC3R1.R21.13||
 MC3R1.R21.19||
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 09:34:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 09:34:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771900.1182335 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sau71-0006my-W4; Mon, 05 Aug 2024 09:34:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771900.1182335; Mon, 05 Aug 2024 09:34:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sau71-0006lD-PI; Mon, 05 Aug 2024 09:34:43 +0000
Received: by outflank-mailman (input) for mailman id 771900;
 Mon, 05 Aug 2024 09:34:42 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4fqT=PE=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1sau70-0006k4-QV
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 09:34:42 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f074c511-530d-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 11:34:40 +0200 (CEST)
Received: from truciolo.bugseng.com.homenet.telecomitalia.it
 (host-87-20-207-105.retail.telecomitalia.it [87.20.207.105])
 by support.bugseng.com (Postfix) with ESMTPSA id 6F4E54EE0737;
 Mon,  5 Aug 2024 11:34:39 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f074c511-530d-11ef-8776-851b0ebba9a2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [XEN PATCH 0/2] automation/eclair: tag more rules as clean
Date: Mon,  5 Aug 2024 11:34:31 +0200
Message-Id: <cover.1722842330.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Sort -v monitored guidelines and tag more guidelines as clean.

Federico Serafini (2):
  automation/eclair: sort monitored guidelines with -V
  automation/eclair: tag more guidelines as clean

 .../eclair_analysis/ECLAIR/monitored.ecl      | 92 +++++++++----------
 automation/eclair_analysis/ECLAIR/tagging.ecl |  4 +
 2 files changed, 50 insertions(+), 46 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 09:34:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 09:34:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771901.1182351 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sau73-0007EY-5m; Mon, 05 Aug 2024 09:34:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771901.1182351; Mon, 05 Aug 2024 09:34:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sau73-0007EL-0b; Mon, 05 Aug 2024 09:34:45 +0000
Received: by outflank-mailman (input) for mailman id 771901;
 Mon, 05 Aug 2024 09:34:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4fqT=PE=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1sau71-0006k4-GS
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 09:34:43 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f074c501-530d-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 11:34:40 +0200 (CEST)
Received: from truciolo.bugseng.com.homenet.telecomitalia.it
 (host-87-20-207-105.retail.telecomitalia.it [87.20.207.105])
 by support.bugseng.com (Postfix) with ESMTPSA id DD2AA4EE073D;
 Mon,  5 Aug 2024 11:34:39 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f074c501-530d-11ef-8776-851b0ebba9a2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [XEN PATCH 1/2] automation/eclair: sort monitored guidelines with -V
Date: Mon,  5 Aug 2024 11:34:32 +0200
Message-Id: <cc69ad735dd53b10237981ded44229f8e6894076.1722842330.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <cover.1722842330.git.federico.serafini@bugseng.com>
References: <cover.1722842330.git.federico.serafini@bugseng.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

To improve readability, sort guidelines with -V.

No functional change.
---
 .../eclair_analysis/ECLAIR/monitored.ecl      | 92 +++++++++----------
 1 file changed, 46 insertions(+), 46 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/monitored.ecl b/automation/eclair_analysis/ECLAIR/monitored.ecl
index 8a7e3f3cea..7b085a329a 100644
--- a/automation/eclair_analysis/ECLAIR/monitored.ecl
+++ b/automation/eclair_analysis/ECLAIR/monitored.ecl
@@ -2,58 +2,17 @@
 -enable=MC3R1.D1.1
 -enable=MC3R1.D2.1
 -enable=MC3R1.D4.1
+-enable=MC3R1.D4.3
+-enable=MC3R1.D4.7
 -enable=MC3R1.D4.10
 -enable=MC3R1.D4.11
 -enable=MC3R1.D4.12
 -enable=MC3R1.D4.14
--enable=MC3R1.D4.3
--enable=MC3R1.D4.7
--enable=MC3R1.R10.1
--enable=MC3R1.R10.2
 -enable=MC3R1.R1.1
--enable=MC3R1.R11.1
--enable=MC3R1.R11.7
--enable=MC3R1.R11.8
--enable=MC3R1.R11.9
--enable=MC3R1.R12.5
 -enable=MC3R1.R1.3
--enable=MC3R1.R13.6
--enable=MC3R1.R13.1
 -enable=MC3R1.R1.4
--enable=MC3R1.R14.1
--enable=MC3R1.R14.4
--enable=MC3R1.R16.2
--enable=MC3R1.R16.3
--enable=MC3R1.R16.4
--enable=MC3R1.R16.6
--enable=MC3R1.R16.7
--enable=MC3R1.R17.1
--enable=MC3R1.R17.3
--enable=MC3R1.R17.4
--enable=MC3R1.R17.5
--enable=MC3R1.R17.6
--enable=MC3R1.R18.6
--enable=MC3R1.R19.1
--enable=MC3R1.R20.12
--enable=MC3R1.R20.13
--enable=MC3R1.R20.14
--enable=MC3R1.R20.4
--enable=MC3R1.R20.7
--enable=MC3R1.R20.9
 -enable=MC3R1.R2.1
--enable=MC3R1.R21.10
--enable=MC3R1.R21.13
--enable=MC3R1.R21.17
--enable=MC3R1.R21.18
--enable=MC3R1.R21.19
--enable=MC3R1.R21.20
--enable=MC3R1.R21.21
--enable=MC3R1.R21.9
 -enable=MC3R1.R2.2
--enable=MC3R1.R22.2
--enable=MC3R1.R22.4
--enable=MC3R1.R22.5
--enable=MC3R1.R22.6
 -enable=MC3R1.R2.6
 -enable=MC3R1.R3.1
 -enable=MC3R1.R3.2
@@ -72,32 +31,73 @@
 -enable=MC3R1.R7.3
 -enable=MC3R1.R7.4
 -enable=MC3R1.R8.1
--enable=MC3R1.R8.10
--enable=MC3R1.R8.12
--enable=MC3R1.R8.14
 -enable=MC3R1.R8.2
 -enable=MC3R1.R8.3
 -enable=MC3R1.R8.4
 -enable=MC3R1.R8.5
 -enable=MC3R1.R8.6
 -enable=MC3R1.R8.8
+-enable=MC3R1.R8.10
+-enable=MC3R1.R8.12
+-enable=MC3R1.R8.14
 -enable=MC3R1.R9.2
 -enable=MC3R1.R9.3
 -enable=MC3R1.R9.4
 -enable=MC3R1.R9.5
+-enable=MC3R1.R10.1
+-enable=MC3R1.R10.2
+-enable=MC3R1.R11.1
+-enable=MC3R1.R11.7
+-enable=MC3R1.R11.8
+-enable=MC3R1.R11.9
+-enable=MC3R1.R12.5
+-enable=MC3R1.R13.1
+-enable=MC3R1.R13.6
+-enable=MC3R1.R14.1
+-enable=MC3R1.R14.4
+-enable=MC3R1.R16.2
+-enable=MC3R1.R16.3
+-enable=MC3R1.R16.4
+-enable=MC3R1.R16.6
+-enable=MC3R1.R16.7
+-enable=MC3R1.R17.1
+-enable=MC3R1.R17.3
+-enable=MC3R1.R17.4
+-enable=MC3R1.R17.5
+-enable=MC3R1.R17.6
+-enable=MC3R1.R18.6
 -enable=MC3R1.R18.8
+-enable=MC3R1.R19.1
 -enable=MC3R1.R20.2
 -enable=MC3R1.R20.3
+-enable=MC3R1.R20.4
 -enable=MC3R1.R20.6
+-enable=MC3R1.R20.7
+-enable=MC3R1.R20.9
 -enable=MC3R1.R20.11
+-enable=MC3R1.R20.12
+-enable=MC3R1.R20.13
+-enable=MC3R1.R20.14
 -enable=MC3R1.R21.3
 -enable=MC3R1.R21.4
 -enable=MC3R1.R21.5
 -enable=MC3R1.R21.7
 -enable=MC3R1.R21.8
+-enable=MC3R1.R21.9
+-enable=MC3R1.R21.10
 -enable=MC3R1.R21.12
+-enable=MC3R1.R21.13
+-enable=MC3R1.R21.17
+-enable=MC3R1.R21.18
+-enable=MC3R1.R21.19
+-enable=MC3R1.R21.20
+-enable=MC3R1.R21.21
 -enable=MC3R1.R22.1
+-enable=MC3R1.R22.2
 -enable=MC3R1.R22.3
+-enable=MC3R1.R22.4
+-enable=MC3R1.R22.5
+-enable=MC3R1.R22.6
 -enable=MC3R1.R22.7
 -enable=MC3R1.R22.8
 -enable=MC3R1.R22.9
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 09:44:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 09:44:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771931.1182366 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sauGc-0001cY-8O; Mon, 05 Aug 2024 09:44:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771931.1182366; Mon, 05 Aug 2024 09:44:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sauGc-0001cR-5k; Mon, 05 Aug 2024 09:44:38 +0000
Received: by outflank-mailman (input) for mailman id 771931;
 Mon, 05 Aug 2024 09:44:37 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=006L=PE=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sauGb-0001aQ-7x
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 09:44:37 +0000
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com
 [2a00:1450:4864:20::529])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5336454a-530f-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 11:44:35 +0200 (CEST)
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5a1c49632deso12764238a12.2
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 02:44:35 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5babb4ec55csm2319308a12.47.2024.08.05.02.44.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 05 Aug 2024 02:44:34 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5336454a-530f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722851075; x=1723455875; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=mzuxSTbL5Cxx/kk9TbbpNOLZT/vyDNKq19mBiAE1u34=;
        b=dK0KKzZPkQozkSjzbJJWYRHjYsZRAjTNQzAakmYG+okKulsGhFD8PThw+1i5OfsDzE
         1b0vK2NAQ0XMrrrMYjBKpAdg01VpEODAIoSSijDoTnGhhsmJuO5qI5Hxk0lWMZ0vkIrl
         Yz9/tMCUkU6ScodQ5GM9A0+StoPtJFfqHLrV6wye8pDrHkwKhnd+K/eCsEMog0hFo3ve
         K+UAwlDgIpRI4L7o6gIrBUfLZ0RuSb5g3rP2m1wbAIk2APx8fSxLFyv/NJMw1ksjWJDO
         LmSfoiSlSRi+W85dt0V0QFUeZJrjHtkmfR8h6iruTekfclcvt4AQLBX2qk6rRUqYoU0N
         7QIw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722851075; x=1723455875;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=mzuxSTbL5Cxx/kk9TbbpNOLZT/vyDNKq19mBiAE1u34=;
        b=LT1u6MTVrAy5plX+cYeUnstRE9CWIjGtgLuxmK3CXEfawatGh/fC9a3jUJDnWYEmy+
         NNbj0XhsacP94bYT8rsTmvChj4bbEWInX68FCjPrZ2Z195g/jyBQ+kpcx9zftIpuV2p1
         +z8mr8xFf1m2GJ3LlbVwPYWMqWs3cxFhuMZR885DB2/l8bvR4JhEZC98mSL41/KHQ3SD
         5n3rehNLGax7Msa5YTLQfbN3MugIUl1RBbznVlyAAcJwza61UCwQ08gG9JdEqy8gTVH1
         1O3Z6dXppZQ+fpRfcW9FTrUMUZvRhpO49p1Q+e8Xc5e9HeF78FzoXDd+oJDzlq48WWYP
         G0kw==
X-Forwarded-Encrypted: i=1; AJvYcCXM/eANoPWWtXuI7UGCvG+zoPI37cJQMKgvxd3MWadVkq2pcuqDC7Xw8N8gCDC3+Phu+VuEdW86J5CI+R7ehUCy6hWDcyheq3BiS1Asrws=
X-Gm-Message-State: AOJu0Yw7qvt9kgHcmBGbAAQ6jstWSaBt542+NAmDBurrk5f64NXJAsce
	b5WYZQghg+zMCxd6rloTabplCO9QdWpjAtUhdEv4si6qWudK5j1T0jSmhg==
X-Google-Smtp-Source: AGHT+IFz7Q/QeZaa7/2D31He2kegrSgerncFwKVtSpE4CxAkxCn9OZmGjY4cEeiaLM7hWSKkFDBM7w==
X-Received: by 2002:a05:6402:14da:b0:5a1:aa6d:9469 with SMTP id 4fb4d7f45d1cf-5b7f5dc6bc2mr7208845a12.38.1722851074836;
        Mon, 05 Aug 2024 02:44:34 -0700 (PDT)
Message-ID: <3c03ff921b8c1950eb8376e94cdfb490ea28bf4b.camel@gmail.com>
Subject: Re: [PATCH v7 1/9] xen/device-tree: Move Arm's setup.c bootinfo
 functions to common
From: oleksii.kurochko@gmail.com
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Shawn Anastasio <sanastasio@raptorengineering.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, Stefano
 Stabellini <sstabellini@kernel.org>, Bertrand Marquis
 <bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>,  "Daniel P. Smith"
 <dpsmith@apertussolutions.com>
Date: Mon, 05 Aug 2024 11:44:33 +0200
In-Reply-To: <309d42dc-e540-4fbe-a69e-2be6414deb70@xen.org>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
	 <102f8b60c55cdf2db5890b9fb1c2fb66e61c4a67.1721834549.git.oleksii.kurochko@gmail.com>
	 <309d42dc-e540-4fbe-a69e-2be6414deb70@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

Hi Julien,

On Mon, 2024-08-05 at 10:08 +0100, Julien Grall wrote:
> Hi,
>=20
> On 24/07/2024 16:31, Oleksii Kurochko wrote:
> > Changes in V5:
> > =C2=A0 - add xen/include/xen/bootfdt.h to MAINTAINERS file.
> > =C2=A0 - drop message "Early device tree parsing and".
> > =C2=A0 - After rebase on top of the current staging the following
> > changes were done:
> > =C2=A0=C2=A0=C2=A0 - init bootinfo variable in <common/device-tree/boot=
info.c>
> > with BOOTINFO_INIT;
> > =C2=A0=C2=A0=C2=A0 - update the code of dt_unreserved_regions():
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CONFIG_STATIC_SHM related ch=
anges and getting of
> > reserved_mem
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bootinfo_get_shmem() ??
> > =C2=A0=C2=A0=C2=A0 - update the code of meminfo_overlap_check():
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 add check ( INVALID_PADDR =
=3D=3D bank_start ) to if case.
> > =C2=A0=C2=A0=C2=A0 - update the code of check_reserved_regions_overlap(=
):
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CONFIG_STATIC_SHM related ch=
anges.
> > =C2=A0=C2=A0=C2=A0 - struct bootinfo was updated ( CONFIG_STATIC_SHM ch=
anges )
> > =C2=A0=C2=A0=C2=A0 - add shared_meminfo ( because of CONFIG_STATIC_SHM =
)
> > =C2=A0=C2=A0=C2=A0 - struct struct membanks was update with __struct gr=
oup so
> > <xen/kernel> is
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 neeeded to be included in bootfdt.h
> > =C2=A0=C2=A0=C2=A0 - move BOOTINFO_ACPI_INIT, BOOTINFO_SHMEM_INIT, BOOT=
INFO_INIT
> > to generic bootfdt.h
> > =C2=A0=C2=A0=C2=A0 - bootinfo_get_reserved_mem(), bootinfo_get_mem(),
> > bootinfo_get_acpi(),
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bootinfo_get_shmem() and bootinfo_get_sh=
mem_extra() were
> > moved to xen/bootfdt.h
> > =C2=A0 - s/arm32/CONFIG_SEPARATE_XENHEAP/
>=20
> I think this change deserve a comment in the commit message.
Sure, I will mention that ( IIUC only this
"s/arm32/CONFIG_SEPARATE_XENHEAP/" should be mentioned ).

>=20
> [...]
>=20
> > --- /dev/null
> > +++ b/xen/common/device-tree/bootinfo.c
> > @@ -0,0 +1,459 @@
> > +/* SPDX-License-Identifier: GPL-2.0-or-later */
> > +/*
> > + * Derived from $xen/arch/arm/setup.c.
>=20
> I would suggest to mention the version of Xen this is derived from.
Will it be enough only Xen version without commit hash?

>=20
> Acked-by: Julien Grall <jgrall@amazon.com>
Thanks!

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 09:47:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 09:47:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771948.1182377 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sauJ3-0002nv-Km; Mon, 05 Aug 2024 09:47:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771948.1182377; Mon, 05 Aug 2024 09:47:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sauJ3-0002no-IB; Mon, 05 Aug 2024 09:47:09 +0000
Received: by outflank-mailman (input) for mailman id 771948;
 Mon, 05 Aug 2024 09:47: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=kPoy=PE=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sauJ1-0002ni-Si
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 09:47:08 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on20601.outbound.protection.outlook.com
 [2a01:111:f403:2417::601])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id abd949a2-530f-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 11:47:05 +0200 (CEST)
Received: from BYAPR01CA0070.prod.exchangelabs.com (2603:10b6:a03:94::47) by
 SJ1PR12MB6291.namprd12.prod.outlook.com (2603:10b6:a03:456::22) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug
 2024 09:47:01 +0000
Received: from SJ5PEPF000001CD.namprd05.prod.outlook.com
 (2603:10b6:a03:94:cafe::e6) by BYAPR01CA0070.outlook.office365.com
 (2603:10b6:a03:94::47) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.25 via Frontend
 Transport; Mon, 5 Aug 2024 09:47:01 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SJ5PEPF000001CD.mail.protection.outlook.com (10.167.242.42) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Mon, 5 Aug 2024 09:47:01 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 5 Aug
 2024 04:47:00 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Mon, 5 Aug 2024 04:46:58 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: abd949a2-530f-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ZOIqbavgocNcsvRUKgLRbHjSdisN2u5TYmUva+LThGskQN1KrWRkEAQTarN+0iSwURW45GXApLgw94RXM19ETpo52Eoq3vqZ0BbVcUvp+nuTC2Yqn3PAAaqE6IeOd1tkt2BlJwIuQU/+0BbwkPW/YRyARlOKYKKuXNbrGvjOE1f5tD09KG2ga1HojlvMfOuzbomxdHqbI6/aLslUOjSeKEb/GGhfgKec4UEF7LPXWzepLZgZdDZLGhuFxdSDqx9y/kQt6uMnKZTnqGwZ4AuIDJi4C2GOzg9DvssHBGq8x9sITc6Kwy5Puj3uMhcIkebzOstiakaqZLJowO7HPtcOqg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=E99LVFsQWeJISOVn+4uedavONNTPguCtZ0S6JTbRGIs=;
 b=cFWz0970H4STx8k+r7O8RFWFm3lgVEtbID2iWULNP9+x7uKF6yOliLM1MUuPPyU3jT23/r30zHKJqTSN29nvRiITQsH39fUr1EQLXdLQwEeo1w12xsB5FPgS0/8GilAkhZL8RNhlJrOS1M9nRvXBsybwfQBlyJdJeIXKRjp8mVcxdIp8uVqDXg4Ho7hF7vnYqbzKbz9riEqm/6HkS0+IB6LZW3SqPnFd/5PF9KjnBg+ozEbEyuv4PpZEZ3Atrmvd9aMi63w1kXABTovavvX9g3gCWXQQ6w+oGqIIMgffp0D3D7hxPG9eBIw4pzgnglaTqPmsEPJF9Io4yLimYcedNQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=E99LVFsQWeJISOVn+4uedavONNTPguCtZ0S6JTbRGIs=;
 b=mw55oU7GFtR5q/hr0bCM6wuhMDanyfRQBkvBJXxcQ5498yyR74fBZnsjlr96mWt95LZKFGK9dUJ1xdML9BMCcWHdXV1x9tbPY4/YDlOu+TW2zoi0/ttkRJ5OanVhu6I9tSSSsRglZIgXYcFxWagwxTykLOSt3Yq3tcjraNjYNz0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <15c5709f-a81c-4ca4-8851-89938a5a6141@amd.com>
Date: Mon, 5 Aug 2024 11:46:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/3] docs: Introduce Fusa Requirement and define
 maintainers
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, <sstabellini@kernel.org>,
	<bertrand.marquis@arm.com>, <artem_mygaiev@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
References: <20240802094614.1114227-1-ayan.kumar.halder@amd.com>
 <20240802094614.1114227-2-ayan.kumar.halder@amd.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240802094614.1114227-2-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB03.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001CD:EE_|SJ1PR12MB6291:EE_
X-MS-Office365-Filtering-Correlation-Id: ae6d3d39-29e9-490d-b1e8-08dcb5338e72
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?T0MvTC80Skh3U1VaOU9HRDVpRUVReG5ZdVJudXkxeWp2NG9FYno0ajVBeWxx?=
 =?utf-8?B?M0VsbjIwU0Rja3lrR3RkWkZCT1hMcjZ5ckc2bUtXMTdIeWNzYngwNlpIRmRL?=
 =?utf-8?B?OExQUHZ1NVVjZEVyMEFHMUR5MXlvZnJEa1NpSVVPcnVQbWFvNW5oZ3lWV0w0?=
 =?utf-8?B?ckY4elNXQ0x6MW1aM1ZRT09WcTA3bWc0UGxzc2UrVnVLUElSL2RMS1oxTHBl?=
 =?utf-8?B?N1EzL0hQRE9xUjRudDFwVEYyeStuUWg4UU04ZE9BY1k4T2hSQ3ZLVzB2Y082?=
 =?utf-8?B?MDJPYkFjVGlTRjUvbTJEVDV6MkwxVUwxNFYyRmRyeElrZVJ2cCtubkRzK2dv?=
 =?utf-8?B?a2xqVU5SWkN5NjJ1RDFRZ0VMT2dLc3BRVUZPMi9qYzZIWTZ2c0JBWktSTEw0?=
 =?utf-8?B?a2JaeW5ZWVlZVStSdzFtLyt4Slc0VUVSOUhBV3lwUEt3SGxveUMzdkdYczdw?=
 =?utf-8?B?SnI4SmQ1ZnJWcUlyNVN3ZTRRRXAyYnJKYnpycEJUeEJvbkd0aHdjU3U0VUhm?=
 =?utf-8?B?cVp2THdBMm4zMWt1OElpRmpNd2R2Z05mRW9UZU9sYnlaZDhOVkNYWDZjdk9R?=
 =?utf-8?B?Sll3Z0NwekdOK05YcWRDUE5vVWRONUJUVFM5dmxENkJjdExXZk9mSFZYdTdm?=
 =?utf-8?B?anEvTTE5VUh4Q09pdGFyQzEzQk1Xb3pYSTM2S1U2SmVBM0xESkg1Wk1kWGww?=
 =?utf-8?B?QjgrVlJISTFmbzhmcWJPSG1CRmU4WnhlMFpsaU03eWdzQ1IyU0IzMTRBT2VV?=
 =?utf-8?B?QWJNaHVvQXliME5UR0RrbVhSTUozckV1Y3Bpb0ExZHBiZEd1SjBERWJoM0hN?=
 =?utf-8?B?NEhmSFZFNkRvbFFwdmp4LzdGaGFScXYxU1pVOWZTMXhKUWJHTnZINmZOZW9R?=
 =?utf-8?B?NCt0aVZWdjdwcDVEL1ZESys1dFo3VStWTXg0VDFUY0RwKzZUYTAxWEVyLzJn?=
 =?utf-8?B?TXBWSWYxL3ZqZmVWTkFCQ1Y2Y2VkeUhhd2d5K0RicnhZS0lhTXI0em9rWm5K?=
 =?utf-8?B?ZW9tRmdXZ1NGTWdkR04wZ1lZYVQ3elgzZ3FlN2FiZUg5S0U4VVhCaFordXNy?=
 =?utf-8?B?Sk1ERnM2Q28zT2dET3ZVYWZqMmE5ekhLUlRPSEQ3Q2JpdGFRMFB5Q044d3k1?=
 =?utf-8?B?Nkw3Y2tjTEYwMjhpK1pJVHhHWWJ1VFZsRDEwVnhKYWczSDBORzJHTHkvQzhH?=
 =?utf-8?B?Z21rWmlZTGxUTC9NWkQ1WExiRnhoZnUxQTJOYWdxa1RyaGJLZTJnYm9paldx?=
 =?utf-8?B?YjlyV1BwZ0FxL0NmR3dtOEttWEdqZ3Z2cTRaeFo5YUFJRFFLZE9tYXZVOCs3?=
 =?utf-8?B?NExnU1VvVlhDbUpxRGtHWFFBT1loalNWQlI1Zyt2cmxpNS9BWHBPR3hLa0Zp?=
 =?utf-8?B?ZlgrSldLWmx0RmpuUXF5NzlNNUtnNkh2dVQrc1RhOTQ2dGwwdFk1aXZIL0FF?=
 =?utf-8?B?bVFnMFVrNmZuaGpKRWR1UlQxMVBJQ1RLT1ZvNTJmMytsMVpMQTlDMEVPMnJw?=
 =?utf-8?B?aFVJcHNRQVlLVStTUElFaC9RS3Y5eWZRSmVrQU9TUWZxMUoxZFhxbjRQN0VG?=
 =?utf-8?B?SzEwZ1BPcFRHa1dwb1RwQ2gzWmoxYXN3VHZlNG5CQnFUcGI0MkExeGxXZ2Vr?=
 =?utf-8?B?K0lnUFJpRCs5WmpiQzJBUXhhSVdnZjlwb2dGMDFtd2dKcjBEa1BCQytoQU9v?=
 =?utf-8?B?WmFJOFE4SzZRRHlPVDZZSFg4Z1pHWnE0ZnN1cFBjWVRFRUovUGJQMXE1ZlpT?=
 =?utf-8?B?SXYrOHoza3FWMVhXRTZpaDNiSjdoR0hMeGcvd1ZrbFJ0RXJnMW1kdnN4VmIr?=
 =?utf-8?B?eFZpcUhyZkRFZFovQThMcG0wempHZC9BdmpUWkFMejR1a1ZhY1NCTUVoY1Fv?=
 =?utf-8?B?WkdBbDZNbDFXaUtud2plZVl3Y1pLd0poUjZqbXVvL3I4aTN5UnY2c1pwTlhN?=
 =?utf-8?Q?l0lGNf77141Nw4mkAquAhqkjkta3AP9C?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 09:47:01.6046
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ae6d3d39-29e9-490d-b1e8-08dcb5338e72
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF000001CD.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6291

Hi Ayan,

On 02/08/2024 11:46, Ayan Kumar Halder wrote:
> The FUSA folder is expected to contain requirements and other documents
> to enable safety certification of Xen hypervisor.
> Added a README to explain how the requirements are categorized, written
> and their supported status.
> 
> Added maintainers for the same.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
> ---
> Changes from :-
> 
> v1 - 1. Added a comment from Stefano.
> 2. Added Ack.
> 
>  MAINTAINERS              |  9 +++++
>  docs/fusa/reqs/README.md | 78 ++++++++++++++++++++++++++++++++++++++++
I have 2 questions:
1) Most of our docs are written in RST, same will be true for requirements docs. Any specific reason for using markdown?
2) In the current form of this patch, docs/fusa won't be part of the generated Xen docs. Is this intended? Don't we want to
include it?

Apart from that:
Acked-by: Michal Orzel <michal.orzel@amd.com>

~Michal


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 10:00:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 10:00:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771960.1182386 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sauVr-00061b-PO; Mon, 05 Aug 2024 10:00:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771960.1182386; Mon, 05 Aug 2024 10:00:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sauVr-00061U-Mj; Mon, 05 Aug 2024 10:00:23 +0000
Received: by outflank-mailman (input) for mailman id 771960;
 Mon, 05 Aug 2024 10:00:22 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=I4ub=PE=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sauVq-00061J-Ge
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 10:00:22 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8662abb0-5311-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 12:00:20 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a7a81bd549eso933950566b.3
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 03:00:20 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9c12be2sm429934466b.89.2024.08.05.03.00.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 05 Aug 2024 03:00:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8662abb0-5311-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722852020; x=1723456820; 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=CkNveMy+M0++asi1hycWjFaNcL8qXuh0CAOdJs61m64=;
        b=ABwG8x6tqxYDxOkHP/gCUvoVrgBqgNCXgWEBcHZfk5g0R/Rf/Z8vY/MNOHC4IhkGGf
         3XGWphFHD8RfTJ0kWBMyYZc/jkYwqFp6CPbJitShxle1EKhgJnSUVBQQ+x5kyIevR8c7
         AkX506USKVCEwLBh1vH4laYZPVvfazud/jr9Z5/VayG7GUv/yjgslDBri799/d+se+bN
         rhQwFtCR15PtA41dhV8o0EaQ9/eH6NrcCBdnvdzOvGB26JxDJ5uYPynX3eWQxcfaPLxf
         pMEQdvoLHnfDRR3rcvt+L6gUUMVXnYTeLGGqzeKd3Atz+OuurAbXtpJGtiR7d2aa1jcM
         LHLg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722852020; x=1723456820;
        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=CkNveMy+M0++asi1hycWjFaNcL8qXuh0CAOdJs61m64=;
        b=fdFzl8afqbJzdxDWidYI2X7n6LbhzW4DM2Fnbon60/5U4hS7JIiGgSxZafJLNMDTMR
         JDpeHq+Yras+5Vsf8eixlFh7oS0V1uRz54i1BcBXJ8jCmp5MjX7soJyX6UZIioIAnU20
         J/qyxxyUKwCDwtqIkdf93U5TMzTn1rIQ+DFtR0pt21l8FySy13R4klAXCxsOXMSnbwuy
         h7jacNGwcHJO+i5onZ6uwmyEH4IcN/1dSmskJ+Sv8hET51YaVMKcrK9o+6APQw4N62XJ
         A/wKCMGVDw0qmCmKKJUrDSNzTvbkB753NxGjHZnZ1A0sKjF8+/6VHDeBCOOHyi5yeCP8
         L2RQ==
X-Forwarded-Encrypted: i=1; AJvYcCU443HuMaz81xRURDri86E3VboQIMXOUteBCoSuDH3VKbTH80LfFmWQdGAHfSJ8OoQHwrcOl9N6LnTTLkiYhsI+eWE2jKf/7fIMSJ3K6Q0=
X-Gm-Message-State: AOJu0YyvtxOZPNJhsh8rhYGc6ii0vMF7NPu5KhYXgEUmII1o5igwXgda
	XlGijcbq/GfKrt0xeDysCi/Ahf1S9+jkD/4SywfCS/W57/8WQCJx2s5YW+aluQ==
X-Google-Smtp-Source: AGHT+IEsIPnc+76Sx6oI97rMS6CzYr7yAXMTFSn5uFbR96q8iLtB1nM4w5K9UmwN+OcB+xbVazYHVg==
X-Received: by 2002:a17:907:2dac:b0:a6f:586b:6c2 with SMTP id a640c23a62f3a-a7dc510131cmr769192266b.60.1722852019889;
        Mon, 05 Aug 2024 03:00:19 -0700 (PDT)
Message-ID: <5d96bb76-8204-422e-a584-ff9e699aef38@suse.com>
Date: Mon, 5 Aug 2024 12:00:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4] x86/shutdown: change default reboot method preference
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Community Manager <community.manager@xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <20240802105613.99197-1-roger.pau@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240802105613.99197-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 02.08.2024 12:56, Roger Pau Monne wrote:
> @@ -492,6 +494,15 @@ static const struct dmi_system_id __initconstrel reboot_dmi_table[] = {
>              DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
>              DMI_MATCH(DMI_PRODUCT_NAME, "PowerEdge R740")),
>      },
> +    {    /* Handle problems with rebooting on Acer TravelMate X514-51T. */
> +        .callback = override_reboot,
> +        .driver_data = (void *)(long)BOOT_EFI,
> +        .ident = "Acer TravelMate X514-51T",
> +        .matches = {
> +            DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
> +            DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate X514-51T"),
> +        },
> +    },
>      { }
>  };
>  

Sadly this wasn't properly re-based over the introduction of DMI_MATCH2()
and friends. I guess I'll make a patch, hoping to find someone to ack it
before you return.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 10:04:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 10:04:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771968.1182396 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saua8-0006bf-8T; Mon, 05 Aug 2024 10:04:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771968.1182396; Mon, 05 Aug 2024 10:04:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saua8-0006bY-5w; Mon, 05 Aug 2024 10:04:48 +0000
Received: by outflank-mailman (input) for mailman id 771968;
 Mon, 05 Aug 2024 10:04:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=006L=PE=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1saua6-0006bQ-U1
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 10:04:46 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 247644a3-5312-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 12:04:45 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a7d89bb07e7so857009466b.3
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 03:04:45 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9d4392bsm433366866b.108.2024.08.05.03.04.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 05 Aug 2024 03:04:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 247644a3-5312-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722852285; x=1723457085; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=iOH2UfWF4WwNhd7gGYP5371pLuNg59MCHPKE+ev/Nzk=;
        b=K6g4Fd2Q9P57GR1NUBAP3Is5jTkJXgngWH1F3P8jxOb0nZRC9uvT2SWen4aupZaKzw
         LEXlbEwCkPSsVzJl2Sf1sp+Fk3r+WBpw4CYUzpYLMkBAyDdwg5GPdlrTMhp4DPKRSgSy
         NkqdggPN+dGz/VULnmaxXAyDQdpism2iaIBhRJLp3GbekldAzuT5vbxC5/DhPO8gdrIn
         +3ZlAU87akcD6hvYQ0mmUyageHuVgTZmjVF06Bzhrus08X/rQmB7xuzCTt9rwyRVNMV0
         VJQcFogO8ti8A4SKBRkFUX+Mn++TQSjwepBl4vfDWDoiDuTNLVHwvhrACSjyDU3uM/Fx
         PU5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722852285; x=1723457085;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=iOH2UfWF4WwNhd7gGYP5371pLuNg59MCHPKE+ev/Nzk=;
        b=rkWTTGn9o4pIVy9qietO9yhLc6C4/K1E3re8vTiYrM0RgldL1mG7OiYBUpCeD1W0gk
         M1DLqw9MsF1O68dVBiOvwWnQlWhnPYDW1BYH6Pa6FGCERC9pEpOQWFjXJZJLfRKCeayl
         kR560H9NdURRKQo2kiTKkJItlWWYti7GWVQsa7x/OfThWULleaULXxLtgwJ/+SszpFbz
         l1cOsQT4WeahfFX5eO+ro2imR3FQ0Enu5D+V4jahsPZlZsARx+TCSDgSCEWKIEd403Ws
         KSSs7YrF2fPtkMQZqu/wz2dlhOvjno090/V+vxBEbIPLl7Z0zUlk1TNjREQaKRWUC8kx
         DOiA==
X-Forwarded-Encrypted: i=1; AJvYcCVjlSCidAC8QJpCJ+e7xXUiNEB2tj+rsWCEtXExClRknPKOT0JftrjBirltJ33uzuUhzFUSMSqDlRqVRSMhMdATtEsFUxFFr96itytAE2w=
X-Gm-Message-State: AOJu0YysquQ9U9P7p62WD1LEoK5OOv2Wfql1IdPfBZ46LafwZDodc04N
	xI/K5LczkAQNiSMYoUw8Wh5Ywd22cIFDhfy7ECov1qVtmEhDJuxt
X-Google-Smtp-Source: AGHT+IF6jwQwwtLGwqhNcoCH3VH69bxffZipEnEG0gX50Ylm2uvvCd6YHrSJYvo3aM2u1f+zvZM+zw==
X-Received: by 2002:a17:907:934a:b0:a7a:a5ed:43d0 with SMTP id a640c23a62f3a-a7dc5071046mr856632966b.47.1722852285123;
        Mon, 05 Aug 2024 03:04:45 -0700 (PDT)
Message-ID: <ca3829ee2de52277c2f6ad0aa400405895dbeee3.camel@gmail.com>
Subject: Re: [PATCH v7 2/9] xen/common: Move Arm's bootfdt.c to common
From: oleksii.kurochko@gmail.com
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Shawn Anastasio <sanastasio@raptorengineering.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Bertrand Marquis <bertrand.marquis@arm.com>, 
 Michal Orzel <michal.orzel@amd.com>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, "Daniel P. Smith"
 <dpsmith@apertussolutions.com>
Date: Mon, 05 Aug 2024 12:04:44 +0200
In-Reply-To: <4af8ef8c-b3c1-48b4-930b-72f8ef7d26d7@xen.org>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
	 <35558886445c39c0f570632d355b42bb764dbdc4.1721834549.git.oleksii.kurochko@gmail.com>
	 <4af8ef8c-b3c1-48b4-930b-72f8ef7d26d7@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

Hi Julien,

On Mon, 2024-08-05 at 10:31 +0100, Julien Grall wrote:
> Hi Oleksii,
>=20
> On 24/07/2024 16:31, Oleksii Kurochko wrote:
> > From: Shawn Anastasio <sanastasio@raptorengineering.com>
> >=20
> > Move Arm's bootfdt.c to xen/common so that it can be used by other
> > device tree architectures like PPC and RISCV.
> >=20
> > Suggested-by: Julien Grall <julien@xen.org>
> > Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
> > Acked-by: Julien Grall <julien@xen.org>
>=20
> On Matrix you asked me to review this patch again. This wasn't
> obvious=20
> given you kept my ack. If you think a review is needed, then please=20
> either drop the ack or explain why you keep it and ask if it is fine.
>=20
> Also, I tend to list in the changes where this was acked. In this
> case,=20
> you said I acked v4.
>=20
> Anyway, before confirming my ack, I would like to ask some
> clarification.
>=20
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > ---
> > Changes in V7:
> > =C2=A0 - Nothing changed. Only rebase.
> > ---
> > Changes in V6:
> > =C2=A0 - update the version of the patch to v6.
> > ---
> > Changes in V5:
> > =C2=A0 - add xen/include/xen/bootfdt.h to MAINTAINERS file.
>=20
> I don't see any change in MAINTAINERS within this patch. Did you
> happen=20
> to copy/paste all the changes made in the series?
This change should be mentioned in this patch. It is part of the
previous patch (
https://lore.kernel.org/xen-devel/102f8b60c55cdf2db5890b9fb1c2fb66e61c4a67.=
1721834549.git.oleksii.kurochko@gmail.com/
)

>=20
> In fact the only change related to this patch doesn't seem to be
> listed.
>=20
> [...]
>=20
> > +#ifndef CONFIG_STATIC_SHM
> > +static inline int process_shm_node(const void *fdt, int node,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uint32_t addre=
ss_cells,
> > uint32_t size_cells)
> > +{
> > +=C2=A0=C2=A0=C2=A0 printk("CONFIG_STATIC_SHM must be enabled for parsi=
ng static
> > shared"
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 " m=
emory nodes\n");
> > +=C2=A0=C2=A0=C2=A0 return -EINVAL;
> > +}
> > +#endif
>=20
> I see you duplicated the stub from arch/arm/include/static-shmem.h.
> But=20
> the one in static-shmem.h will now be unreachable. I think it needs
> to=20
> be removed.
Overlooked that. Originally I added that to make Xen RISC-V and PPC
build happy as early_scan_node() code uses process_shm_node():
   static int __init early_scan_node(const void *fdt,
                                     int node, const char *name, int
   depth,
                                     u32 address_cells, u32 size_cells,
                                     void *data)
   {
   ...
       else if ( depth =3D=3D 2 && device_tree_node_compatible(fdt, node,
   "xen,domain") )
           rc =3D process_domain_node(fdt, node, name, address_cells,
   size_cells);
       else if ( depth <=3D 3 && device_tree_node_compatible(fdt, node,
   "xen,domain-shared-memory-v1") )
           rc =3D process_shm_node(fdt, node, address_cells, size_cells);
  =20
       if ( rc < 0 )
           printk("fdt: node `%s': parsing failed\n", name);
       return rc;
   }

Instead of introducing stub for process_shm_node() when
CONFIG_STATIC_SHM I think it would be better to add "#ifdef
CONFIG_STATIC_SHM" to early_scan_node():

   static int __init early_scan_node(const void *fdt,
                                     int node, const char *name, int
   depth,
                                     u32 address_cells, u32 size_cells,
                                     void *data)
   {
   ...
       else if ( depth =3D=3D 2 && device_tree_node_compatible(fdt, node,
   "xen,domain") )
           rc =3D process_domain_node(fdt, node, name, address_cells,
   size_cells);
   #ifdef CONFIG_STATIC_SHM
       else if ( depth <=3D 3 && device_tree_node_compatible(fdt, node,
   "xen,domain-shared-memory-v1") )
           rc =3D process_shm_node(fdt, node, address_cells, size_cells);
   #endif
  =20
       if ( rc < 0 )
           printk("fdt: node `%s': parsing failed\n", name);
       return rc;
   }

>=20
> Also, I think this change deserve an explanation in the commit
> message.
If the option I mentioned above looks okay then definitely I have to
mentioned that in commit message.

Thanks.

~ Oleksii

>=20
> [...]
>=20
> > +static void __init early_print_info(void)
> > +{
> > +=C2=A0=C2=A0=C2=A0 const struct membanks *mi =3D bootinfo_get_mem();
> > +=C2=A0=C2=A0=C2=A0 const struct membanks *mem_resv =3D bootinfo_get_re=
served_mem();
> > +=C2=A0=C2=A0=C2=A0 struct bootmodules *mods =3D &bootinfo.modules;
> > +=C2=A0=C2=A0=C2=A0 struct bootcmdlines *cmds =3D &bootinfo.cmdlines;
> > +=C2=A0=C2=A0=C2=A0 unsigned int i;
> > +
> > +=C2=A0=C2=A0=C2=A0 for ( i =3D 0; i < mi->nr_banks; i++ )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printk("RAM: %"PRIpaddr" - =
%"PRIpaddr"\n",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 mi->bank[i].start,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 mi->bank[i].start + mi->bank[i].size - 1);
> > +=C2=A0=C2=A0=C2=A0 printk("\n");
> > +=C2=A0=C2=A0=C2=A0 for ( i =3D 0 ; i < mods->nr_mods; i++ )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printk("MODULE[%d]: %"PRIpa=
ddr" - %"PRIpaddr" %-12s\n",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 i,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 mods->module[i].start,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 mods->module[i].start + mods->module[i].size,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 boot_module_kind_as_string(mods->module[i].kind));
> > +
> > +=C2=A0=C2=A0=C2=A0 for ( i =3D 0; i < mem_resv->nr_banks; i++ )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printk(" RESVD[%u]: %"PRIpa=
ddr" - %"PRIpaddr"\n", i,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 mem_resv->bank[i].start,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 mem_resv->bank[i].start + mem_resv->bank[i].size -
> > 1);
> > +=C2=A0=C2=A0=C2=A0 }
> > +#ifdef CONFIG_STATIC_SHM
> > +=C2=A0=C2=A0=C2=A0 early_print_info_shmem();
> > +#endif
>=20
> Similar remark here.
>=20
> Cheers,
>=20



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 10:11:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 10:11:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771977.1182406 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saugU-0000Pr-1s; Mon, 05 Aug 2024 10:11:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771977.1182406; Mon, 05 Aug 2024 10:11:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saugT-0000Pk-VD; Mon, 05 Aug 2024 10:11:21 +0000
Received: by outflank-mailman (input) for mailman id 771977;
 Mon, 05 Aug 2024 10:11:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1saugT-0000PL-H5
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 10:11:21 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1saugS-0005Dz-GL; Mon, 05 Aug 2024 10:11:20 +0000
Received: from [15.248.2.233] (helo=[10.24.67.21])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1saugS-0003YX-3m; Mon, 05 Aug 2024 10:11:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=raSY8yO7Vpumwv+IdAqNEvq7rYgNQoXS7S2GaDX7I+U=; b=fNFo9kSPwCrI/3k6MxZ9rFD2Ip
	xU44EnJT89Zj3HZNV1+NLGE7ZzLXAc6AKt3ZON/dkQcb1JakofmdjYmAQBOLxQhRJ4mP5K8ccUuw8
	ngWWOifiBlnmOEGu0DVocpFoEw66BtynWVMR0Hs1R8nESbsTKxihl42U7of6aLkvJMpk=;
Message-ID: <20ab6b79-3764-4af3-9631-942b90aa4695@xen.org>
Date: Mon, 5 Aug 2024 11:11:17 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 1/9] xen/device-tree: Move Arm's setup.c bootinfo
 functions to common
Content-Language: en-GB
To: oleksii.kurochko@gmail.com, xen-devel@lists.xenproject.org
Cc: Shawn Anastasio <sanastasio@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
 <102f8b60c55cdf2db5890b9fb1c2fb66e61c4a67.1721834549.git.oleksii.kurochko@gmail.com>
 <309d42dc-e540-4fbe-a69e-2be6414deb70@xen.org>
 <3c03ff921b8c1950eb8376e94cdfb490ea28bf4b.camel@gmail.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <3c03ff921b8c1950eb8376e94cdfb490ea28bf4b.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 05/08/2024 10:44, oleksii.kurochko@gmail.com wrote:
>> [...]
>>
>>> --- /dev/null
>>> +++ b/xen/common/device-tree/bootinfo.c
>>> @@ -0,0 +1,459 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-or-later */
>>> +/*
>>> + * Derived from $xen/arch/arm/setup.c.
>>
>> I would suggest to mention the version of Xen this is derived from.
> Will it be enough only Xen version without commit hash?

I think so, the code you moved has not changed recently since 4.19.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 10:21:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 10:21:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771986.1182416 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saupu-0002dm-UQ; Mon, 05 Aug 2024 10:21:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771986.1182416; Mon, 05 Aug 2024 10:21:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saupu-0002df-Rt; Mon, 05 Aug 2024 10:21:06 +0000
Received: by outflank-mailman (input) for mailman id 771986;
 Mon, 05 Aug 2024 10:21:06 +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 1saupu-0002dZ-2C
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 10:21:06 +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 1saupt-0005Og-1y; Mon, 05 Aug 2024 10:21:05 +0000
Received: from [15.248.2.233] (helo=[10.24.67.21])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1saups-00044I-QZ; Mon, 05 Aug 2024 10:21:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=Gmo3FN4NHUF1UcZ25SglyBsgf4fSL0u0+jIBTiXG2tQ=; b=qiw6yKsaaTBHoGMs9Ol4bJIRh8
	PlSyIGF/CvecZr5Z30+wBIB8uj+U9BfybshOYOnR/OAMGD6nuth+1HwKlTeMMTYkJo6hoVzE5Ndum
	bUvQoafvfD1yVbmvvuyCIn1UzcOjTYz1swyKqGj39oATFH1Zjg8MqvgTnQHYN2oWgzkw=;
Message-ID: <00822b8c-d77a-4603-a2b3-47abff50a277@xen.org>
Date: Mon, 5 Aug 2024 11:21:02 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 2/9] xen/common: Move Arm's bootfdt.c to common
Content-Language: en-GB
To: oleksii.kurochko@gmail.com, xen-devel@lists.xenproject.org
Cc: Shawn Anastasio <sanastasio@raptorengineering.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
 <35558886445c39c0f570632d355b42bb764dbdc4.1721834549.git.oleksii.kurochko@gmail.com>
 <4af8ef8c-b3c1-48b4-930b-72f8ef7d26d7@xen.org>
 <ca3829ee2de52277c2f6ad0aa400405895dbeee3.camel@gmail.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <ca3829ee2de52277c2f6ad0aa400405895dbeee3.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 05/08/2024 11:04, oleksii.kurochko@gmail.com wrote:
> Hi Julien,

Hi Oleksii,

> 
> On Mon, 2024-08-05 at 10:31 +0100, Julien Grall wrote:
>> Hi Oleksii,
>>
>> On 24/07/2024 16:31, Oleksii Kurochko wrote:
>>> From: Shawn Anastasio <sanastasio@raptorengineering.com>
>>>
>>> Move Arm's bootfdt.c to xen/common so that it can be used by other
>>> device tree architectures like PPC and RISCV.
>>>
>>> Suggested-by: Julien Grall <julien@xen.org>
>>> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
>>> Acked-by: Julien Grall <julien@xen.org>
>>
>> On Matrix you asked me to review this patch again. This wasn't
>> obvious
>> given you kept my ack. If you think a review is needed, then please
>> either drop the ack or explain why you keep it and ask if it is fine.
>>
>> Also, I tend to list in the changes where this was acked. In this
>> case,
>> you said I acked v4.
>>
>> Anyway, before confirming my ack, I would like to ask some
>> clarification.
>>
>>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>>> ---
>>> Changes in V7:
>>>    - Nothing changed. Only rebase.
>>> ---
>>> Changes in V6:
>>>    - update the version of the patch to v6.
>>> ---
>>> Changes in V5:
>>>    - add xen/include/xen/bootfdt.h to MAINTAINERS file.
>>
>> I don't see any change in MAINTAINERS within this patch. Did you
>> happen
>> to copy/paste all the changes made in the series?
> This change should be mentioned in this patch. It is part of the
> previous patch (
> https://lore.kernel.org/xen-devel/102f8b60c55cdf2db5890b9fb1c2fb66e61c4a67.1721834549.git.oleksii.kurochko@gmail.com/
> )
> 
>>
>> In fact the only change related to this patch doesn't seem to be
>> listed.
>>
>> [...]
>>
>>> +#ifndef CONFIG_STATIC_SHM
>>> +static inline int process_shm_node(const void *fdt, int node,
>>> +                                   uint32_t address_cells,
>>> uint32_t size_cells)
>>> +{
>>> +    printk("CONFIG_STATIC_SHM must be enabled for parsing static
>>> shared"
>>> +            " memory nodes\n");
>>> +    return -EINVAL;
>>> +}
>>> +#endif
>>
>> I see you duplicated the stub from arch/arm/include/static-shmem.h.
>> But
>> the one in static-shmem.h will now be unreachable. I think it needs
>> to
>> be removed.
> Overlooked that. Originally I added that to make Xen RISC-V and PPC
> build happy as early_scan_node() code uses process_shm_node():
>     static int __init early_scan_node(const void *fdt,
>                                       int node, const char *name, int
>     depth,
>                                       u32 address_cells, u32 size_cells,
>                                       void *data)
>     {
>     ...
>         else if ( depth == 2 && device_tree_node_compatible(fdt, node,
>     "xen,domain") )
>             rc = process_domain_node(fdt, node, name, address_cells,
>     size_cells);
>         else if ( depth <= 3 && device_tree_node_compatible(fdt, node,
>     "xen,domain-shared-memory-v1") )
>             rc = process_shm_node(fdt, node, address_cells, size_cells);
>     
>         if ( rc < 0 )
>             printk("fdt: node `%s': parsing failed\n", name);
>         return rc;
>     }
> 
> Instead of introducing stub for process_shm_node() when
> CONFIG_STATIC_SHM I think it would be better to add "#ifdef
> CONFIG_STATIC_SHM" to early_scan_node():
> 
>     static int __init early_scan_node(const void *fdt,
>                                       int node, const char *name, int
>     depth,
>                                       u32 address_cells, u32 size_cells,
>                                       void *data)
>     {
>     ...
>         else if ( depth == 2 && device_tree_node_compatible(fdt, node,
>     "xen,domain") )
>             rc = process_domain_node(fdt, node, name, address_cells,
>     size_cells);
>     #ifdef CONFIG_STATIC_SHM
>         else if ( depth <= 3 && device_tree_node_compatible(fdt, node,
>     "xen,domain-shared-memory-v1") )
>             rc = process_shm_node(fdt, node, address_cells, size_cells);
>     #endif

With this proposal, you would not throw an error if the user specify 
"xen,domain-shared-memory-v1" but Xen is not able to support it. This 
will be a change of behavior for Arm.

So my preferred approach is to stick with the existing patch and an 
explanation in the commit message.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 10:23:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 10:23:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.771995.1182426 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sausN-0003DZ-9a; Mon, 05 Aug 2024 10:23:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 771995.1182426; Mon, 05 Aug 2024 10:23:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sausN-0003DS-77; Mon, 05 Aug 2024 10:23:39 +0000
Received: by outflank-mailman (input) for mailman id 771995;
 Mon, 05 Aug 2024 10:23:38 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=I4ub=PE=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sausM-0003DM-4J
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 10:23:38 +0000
Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com
 [2a00:1450:4864:20::633])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c62b870f-5314-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 12:23:36 +0200 (CEST)
Received: by mail-ej1-x633.google.com with SMTP id
 a640c23a62f3a-a7a83a968ddso1368153066b.0
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 03:23:36 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9bc3c8bsm440185466b.1.2024.08.05.03.23.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 05 Aug 2024 03:23:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c62b870f-5314-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722853415; x=1723458215; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=N1rQ+j9xKh/S7MKfQQ/ldOL7Ldf5NR4IuMQQniQe7t0=;
        b=Uuj9C8UXLmuM2+iW1WdVxksXYWCgvz7NDZru5BfuUNKsNcjmDnfdwln8e3EMP9IsoN
         9ARpNYbIo82feeSLicTE4XYw4/QH4ZSM+dGFVx443Ec+QwpYXT8EXBSsuHH/EKBcSgDc
         trdUidIyBAszQzrM7/MtXmTTLjnZzoXmgGuZTzliE6BZklvGF0/0WmSGo7sbRR8XySUs
         VQ5bnhAN54xIsv9d339CPXnZAfP54klUkRockCGvhJRgAAqLPfcF/neMFsA64kXgRIRk
         ZxpxV9aLwT/hEaIdoSpvY9P1j2pbLFbMg7jGuvKsvfCa7RAiEhNvJmhhweIAOwe+Ixdg
         tyBg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722853415; x=1723458215;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=N1rQ+j9xKh/S7MKfQQ/ldOL7Ldf5NR4IuMQQniQe7t0=;
        b=LVrFSfdddmvaqkw3UB0HQ1zShUjc9kjKZ/tRF4ichkobYHBh1LE7ehjNHO/y1stZVi
         UT+z5dQM0yYNKLoRFJdOy+Mu8hCRx5Gc07al2ZPkUtodnsCJmu5Szkd2yED5avy+eByH
         KZ1whPcqlMx27wLXPapIWWAm/JERJLouloKZ9UxCCclrSWQmOF/5akoAj5Pxe6BOjFim
         Z4m6blfsrg7rYoPNR1eAMrfo6rBKlLBidLQMwXUVE6Rw6o387Bxnp0tF1XrvTImmS/zN
         5ZWN4wtU2lkSZI3K+YoHgD1amILrwdKAlosAPhjKRR3XZ4K4TMqyrScfDw4oU2aPDzwZ
         3K6w==
X-Gm-Message-State: AOJu0Ywbj/gCya4GPx1Rs2ZRT8A6IEn1mfYL5YRjhIeQIdNwJYuF/68h
	jNWwniELUKYsbX2yidtXTVul9UY6LDdD3n0cp3KqeQu2YxaXsLovm2JOeNUW4f1jKiE6pWinYQU
	=
X-Google-Smtp-Source: AGHT+IEH5Gvoz3vrU+v/Y28Svj6J/Quuy0DbALDjFdkfZWgXaXJ2GQq2SK/51TEs3KF0pdv1PPCJ9Q==
X-Received: by 2002:a17:907:d22:b0:a7d:2fb2:d852 with SMTP id a640c23a62f3a-a7dc50a4b64mr798017366b.52.1722853415392;
        Mon, 05 Aug 2024 03:23:35 -0700 (PDT)
Message-ID: <71df7167-fa92-405e-bf5b-a307e990e5a3@suse.com>
Date: Mon, 5 Aug 2024 12:23:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86/shutdown: use DMI_MATCH2()
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

... to please Misra C:2012 Rule 9.3 (Arrays shall not be partially
initialized).

Fixes: d81dd3130351 ("x86/shutdown: change default reboot method preference")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Cc-ing REST since the two other x86 maintainers are away, yet the CI will
want fixing.

--- a/xen/arch/x86/shutdown.c
+++ b/xen/arch/x86/shutdown.c
@@ -498,10 +498,9 @@ static const struct dmi_system_id __init
         .callback = override_reboot,
         .driver_data = (void *)(long)BOOT_EFI,
         .ident = "Acer TravelMate X514-51T",
-        .matches = {
+        DMI_MATCH2(
             DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
-            DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate X514-51T"),
-        },
+            DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate X514-51T")),
     },
     { }
 };


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 10:44:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 10:44:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772005.1182437 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1savCQ-0007JJ-Th; Mon, 05 Aug 2024 10:44:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772005.1182437; Mon, 05 Aug 2024 10:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1savCQ-0007JC-QD; Mon, 05 Aug 2024 10:44:22 +0000
Received: by outflank-mailman (input) for mailman id 772005;
 Mon, 05 Aug 2024 10:44:21 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3WU3=PE=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1savCP-0007Iq-Cs
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 10:44:21 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on2060e.outbound.protection.outlook.com
 [2a01:111:f403:2418::60e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id aa884b65-5317-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 12:44:19 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by IA0PR12MB9047.namprd12.prod.outlook.com (2603:10b6:208:402::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.27; Mon, 5 Aug
 2024 10:44:14 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7828.024; Mon, 5 Aug 2024
 10:44:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aa884b65-5317-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=bv1OM4tzCsB6lBj5rCNxg1F2c0cFHFzHlbH9Wxof7pe3AeSr0WWDyNXbhgQqSxQmjEMQ2S/Z+pxElZzHcvSoPi/snjJmyjOvFrEAGtaMrde3OPBLvEdz6krKShbRqIC39J+CRcDxEGP3FbKZ+MlZD0pphuMUotobwCE9e1603fogz/C9bB0lorjviAvYuTrbI8Mpdf38LKFRY8CNiEeKo/0K1Jl2OCmV3ggtTJGaprbuTXZBSu/p5oSDm/EXVSjtoV4gZEL1WisCiFf+X13+OK5fuuxxzO3WBG3fEOnMSXdMCCg0hhVpyJVogEczRP61iZD/Nqe8F/x3e73gNEsKlQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=hco20DxapGbz/qeh7BEKD6UNZGS9ISlQ2qWzNelTuf8=;
 b=TuM7KVGnPtc1qn6LosP09zYB6f5JoGieAf27XpYfSdMFnNF9JVYlJYmmC4azPpXg533RsA34mtr2kHViFCCnbrB6bbsAoEuAikNAqcrdHVy2vnbgA3n70yUMNC3Jw/9V5WJbhkfRRTxl361fvMoUYY3ExJmM3NQXrczE6z4ZiiWDPInq66oT7DhrbJkgbv2N31wgGmtqsRu4YroUgokkuzH74gmNZZKNVRev296v7TPOIqUW4ySFqtmDl3SjC/uNalVcMPVe6UYaBDpijpVHeFu9a7kU8ccTuCVw87pveFF/XvxXvU0xNtrWHVTBPHBnaJqUFCYBBA+8S8amDiOGQA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hco20DxapGbz/qeh7BEKD6UNZGS9ISlQ2qWzNelTuf8=;
 b=U9ehBDBakmNTBOSoNAm0Y+016ePInuiPo5GRijyrV1VgXTrkrfC7GDbK6K9Zrd21cytJsd5TFrkIi57AVrmJGSDn3bYLFh0xE4xvpeVSN9jTkrh7nl8Kcep+f3oN2rU13fopjHGVb1O3N+gxugkdLrYs2RV1mBQxOTb2+T8yZJ0=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <9587f469-b038-45f3-8931-87e06b273763@amd.com>
Date: Mon, 5 Aug 2024 11:44:07 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 2/4] xen: arm: make VMAP only support in MMU system
To: Julien Grall <julien@xen.org>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>
References: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
 <20240802121443.1531693-3-ayan.kumar.halder@amd.com>
 <a17d0c07-3f98-4eab-9f84-77d64b562cbf@xen.org>
Content-Language: en-GB
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <a17d0c07-3f98-4eab-9f84-77d64b562cbf@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0317.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:390::18) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|IA0PR12MB9047:EE_
X-MS-Office365-Filtering-Correlation-Id: cbc65e58-c2e9-4051-5959-08dcb53b8be8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?K21HY05keGd5VTRhaW9jNE5WNmlFaTZaeUtBU1dFdFUzNHFlSk5jSXBKYzRN?=
 =?utf-8?B?dzBkNElmVmdaMmt0cUtITWZGMTEzclNjRVRvZHYvUWhXTUY5RUk1cVRvaGRu?=
 =?utf-8?B?VkUvME1LckNlMlN2Q2Y4RDRTczZEM0xNU2hndFJaUncxMGE2U0FRWFVDWWNB?=
 =?utf-8?B?Wit3OEpSeXdEVDA2MFdEakZNc0ExQzArK1RyOE8vTTgwTHlkM0hhYTNtVkND?=
 =?utf-8?B?M0pLZ25nY3Y5a2ZuTFpZc0R2UUM1RDZSUVREQzliM2M2NWsyTGNKdVdSQU9w?=
 =?utf-8?B?c05LdGFQK2tWNnRvTUxMelBMMGZabmx0Ky9qZ01FNlhlcUdqYlFVdk40b29v?=
 =?utf-8?B?SWg1dGU3SkRJQ0duRXkveFYzMllvUHMybXJqQ3Nob214Qmp1Q1F5RU5xQ0FI?=
 =?utf-8?B?dUxVUGhWb0diNGY3cU56U1JmNFRJakcrZmhzQ2xLNVJPSkhaMytUblhYTzZH?=
 =?utf-8?B?VVVCQnZnMFRWcG84QldMZndOdjJtSVlmS25ZZ2xOSTM2VE02NmVBUGJZWjFP?=
 =?utf-8?B?YmVVVHpKS2tpTDlWWkpmWW53YVk2NGZyaWFQcVhzMmgrRFY5ODd6TXgybHRu?=
 =?utf-8?B?OGtZUk1pODFrSEdCeENpSUFJd0cybWxnUVBVOUJlRm1MZEY5cENnbXNrN05C?=
 =?utf-8?B?c0c3UExZOVRZRE5GY210aExiclRCWktZNWl4TzVvWXpLMlZsR0k0K1BjODFB?=
 =?utf-8?B?Ukk1dWp5bE5nQWhyK2kybzZIWnFxQng4Vzc5Z0U4OFh4ZXd0R2Z5MUpMSVlv?=
 =?utf-8?B?NjhhRWdPR3NWNW8zRnpsaW40TXN4blo3SGRZZlBQczgzWUNONE5xREszQkFs?=
 =?utf-8?B?YUg5MzNqaVIvVTY5N0w2Mmc4c3d5VG1XVXV6N0dKK1QwQ29IZzNsVWxrK1Nr?=
 =?utf-8?B?RVVtY2dtdTdOZDROMVJnbVdMZzhuMjUrb3IzSTZDaUJudUM1RmVzdE9Ram5R?=
 =?utf-8?B?NFljYjJuRmNaeWFlcW9kOTVENmFjYkxIcXFxUXpLbmhBcXRDZlROYnNIR3Bt?=
 =?utf-8?B?MUcxZFhvcE5IQVI5NXJVYm45ampidE9WaEFiaE1kc3k2L2l3d1ZlZWlRdzln?=
 =?utf-8?B?czNUNlpkMUNzbnNJd1JKUjQ0R0RHVkhBNVJtRlczMkx3MmtJSkV6Smp2SkdT?=
 =?utf-8?B?K3l4NndzQ3RoQWsyZEphSUdlMUhKK1BGZGFTMVJ0eHNZRVloUnVYQ0djS3lO?=
 =?utf-8?B?WXB4L2IxKzB1L0szUUx5eXZyNm9qaGI0akNLRlNVU2kvYjArYmd2WHFWMXd2?=
 =?utf-8?B?SDBpMTRvakJLK2l6cWhPNC9XUXhKQTgzRkRnaDUybGtoTnYyWVA2L3RFZkxL?=
 =?utf-8?B?QXVHd3cxbTFtWUhMaDF0dTBIcGp1QlFxZHNUNHA1eGYwODdkN2I1UUVwbTV2?=
 =?utf-8?B?aFJxQ2NPOXcyRWh6Y095TFVOSEdrUVFkVllxUmVOdGUybnhYNGN5S2VLMXlo?=
 =?utf-8?B?OXNXN3ZGVGhzV0l5VExlc2JxOXhYRVdlTzBYUDNaRmk1bURzMjZLUDlwaUdh?=
 =?utf-8?B?M0t3bXhuMXNlQ1FRMjgxQ1h2dVBqT2JNMGZ5dHdEdFFZYnFrK3A5NStaSFFh?=
 =?utf-8?B?TlBqRG5KT0RKUW15MkxvckJnWFFrM0R0RTd6MDAzQVdOSkZwSEJNOFpoODBZ?=
 =?utf-8?B?SmIrWW1IbTdZOTMwQ3UvenNLTGZRQlBkeXhJWnVMdkhKUEVzQ1Q2RlJvOUdX?=
 =?utf-8?B?U3oyZ0puRGJZN2NWeko4aHVHQU9RQ1M0YXM5NWpwb3hKdTZzRXZJMUU4czNL?=
 =?utf-8?B?WGxKaG5oYnJDNlgyL2NLQmVvWmVhVTFHNjFCb2Y5cFdRQTA5cDUxNU85VEgv?=
 =?utf-8?B?aW9Ya05YVnpXTkhWK2xxUT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bDRiY2VMMUljUEtpL1JrQzIyK3c3MWFXd2ZPNk8xYlBsOTdKTjlPQW1EN1JU?=
 =?utf-8?B?TWpGQlVuM1Q2U3pIVENtc0hzRTFpWWFQUkxSam1jbVh1YWtleGhhSUhRdkl3?=
 =?utf-8?B?bjlLeUxDa0JDTGpJOHgrWGZmVmJ6UXNCYS9wRXRLanBTb25jNDN4T1grQkI5?=
 =?utf-8?B?OElKUlc2eUI5MFUvZ3UxeTlIQm5ETWZZZHYzUmNTOVdzQU94VUptRThRU1l2?=
 =?utf-8?B?NEpkUW8rbk1PQnpaQ0dYM241bmY2R0hwM2w0NmNCZDdLQW52SE5DdktRckQ2?=
 =?utf-8?B?Q0hIdld4dWovS1drejF6cktKQ1lKanJTMVBmdHpsVk81UU40OFBhYXNYT2dn?=
 =?utf-8?B?OEJTbURsOTZkTGVya1NjRnlaak5ycE51bUpldEVqeEg3RTdYR0RRMWpmTkFO?=
 =?utf-8?B?OVhIY3dvMVp4YXpFakVNYWxnUjUycnpHMG03VjExNW9hdTFGa21tWHB6Y0N4?=
 =?utf-8?B?OG5rMU5Yb0hpVGI2cCtLOUdYVThMNk1KRkN0akxpdkFpZ0Y4Y09GY0ZjMDU4?=
 =?utf-8?B?Q3JmdWVtMGo5MmtwQmdKcElyZFNWK1B4WDkxaDQyU3VIdnFLcTJ5Y3NDQXZH?=
 =?utf-8?B?RVd4NzVha2h4c3c3ZWVNY21ZTnlFVkh5MVZMMVMzRms0OVlHUTJ2REprY2Qz?=
 =?utf-8?B?TEdGM2lYemtVcW1DWEtVUUxRbVJmOTZTK3RTQ25mckQxeE0rVk9EQkdkRkts?=
 =?utf-8?B?UlNQbVJGNEJuUW9sa1E4WlZjclRHTDg4QVMwU1RXZURucUowUjZjbFJRdGNJ?=
 =?utf-8?B?czlJSnVEU3dTd2h3ajY4cnBaSnEvODZkL3dXZlBZNjM3QTVkRHM2ZFI1MGdC?=
 =?utf-8?B?SDNTMnNtd281ck9NclhvNXZOL2VGcVBpb2o2KzJiUEl1RmsrbldET2tvRXhL?=
 =?utf-8?B?S05zZnNVOGdWQXRrSjk5RjZIL2wwSUt4cHIyVTZoUlVoaDE1b2tJTWdGNEVl?=
 =?utf-8?B?K3R2VXF0Q1RuWGIyc3ZJcmZ3YzBzQUFKeTRBaWZtVTdvaGpWaTBMQld3YWJz?=
 =?utf-8?B?eWRPdCtZajRPYVdXd1BnSTVPWTJnU3QwYVRmYnJ5WjF2eng4bTMzY1UrUEdo?=
 =?utf-8?B?dVlUV2xKZTNvbnFOWE5Jb1JZQVg2Ty9sN1pTR2I4bEp1b09qMUEvenFFTHdu?=
 =?utf-8?B?Q1k3TzBSZ25qeFArR2RFMGpHakpoZGRFSjlKbXlKd3lYR0JuQXZnaFRpVGFp?=
 =?utf-8?B?a2J6akk5VVlKUlFyWXNMUjVGQ1FySGdQb0EvZ3FSUC9EZXFNZTlEelRyUnF5?=
 =?utf-8?B?YitFKzN3ZitoRHIvU216TS9zVmx5S2hFSW9PRkxXSm5ITWNTZ0VEa1J5OUM1?=
 =?utf-8?B?MG4wVjU1VlRqRmt5alNIMDFib21tdTZSeHZvdXppQjN6T1FCREd5Z0JXT0M0?=
 =?utf-8?B?RXNTdm5wQjh4eVRIMk10WkVaZEFqWXJFYzBRYUptODcxYmNHaGdraGVseTdn?=
 =?utf-8?B?WTMrVnE3emtGSmhaUCsyeWtPRzJmbGs0bXJpK1orMm9wZ2pMakY4dmV4d0tU?=
 =?utf-8?B?dC9iQWtSMzhwYk5XVWphdTVORkxnakhSSEtZZG9nNHF6M1FEWXBiS0VkUGN2?=
 =?utf-8?B?dlMvV0xkTktTS3JOTVgrRGxzVkhCZHZiUEozU1FMbmNoV0k0MzQxTEZ1MXdi?=
 =?utf-8?B?ZWo0c3g1bDZuMnpVYUx0aVBPbkRIditwZ3E0eTNxZC9zM1FTcEJUOGJIR28x?=
 =?utf-8?B?aERIbDErNzdvN2lJQzhYVWpBdDhlT1NYSTJYWE01SGlQd253RlhVLzB0MWVo?=
 =?utf-8?B?RW5SL1gxRWdXak45VStqQjd2TjUwWE9rQ2xVT21DTFFDS2dFc2FzWFZ0bitY?=
 =?utf-8?B?UUNhSlNOa3U5bjk5UFRna1lTWXZvTmdheXQxZmNRVmZETHQrMG91KzVUQUlh?=
 =?utf-8?B?ZEVXWTlwRm5PV2tjbUo5eng1a3BNUXBTU3crR1drMVVjVm5tQ2FqRldCSWlp?=
 =?utf-8?B?L0VWUWxuM1Bwb2szTkxrVGxNVDVsNnBFNmhIYU9OR3pmRlJVZzIvS1R0REE4?=
 =?utf-8?B?dVJHZzJaSkprMGE1NHZNQXpTYmsxSVpLWVBrT1JXOTMwY1BlZ2w4dURTZHVJ?=
 =?utf-8?B?dDFKSlZLcW9QUnNObEpKYmoyaWhaelJpdlJoRlloSHJ2Q0NlN0ZmeHUxVkVG?=
 =?utf-8?Q?23elNkDbBUeOVRP6jmZspkbdA?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: cbc65e58-c2e9-4051-5959-08dcb53b8be8
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 10:44:13.6832
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: VFBBv9lL3Fyk6lX90Ypcmm40R3cVNfE18g1S3kK/nKZ/Q7oWpes6qBzn26ev9QMbvh8mheCP9qcYf/6T7Mbh/Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB9047


On 02/08/2024 14:27, Julien Grall wrote:
> Hi,
Hi Julien,
>
> On 02/08/2024 13:14, Ayan Kumar Halder wrote:
>> From: Penny Zheng <penny.zheng@arm.com>
>>
>> VMAP is widely used in ALTERNATIVE feature, CPUERRATA feature, etc to
>> remap a range of memory with new memory attributes. Since this is
>> highly dependent on virtual address translation, we choose to fold VMAP
>> in MMU system.
>>
>> In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
>> only support in MMU system on ARM architecture. And we make features
>> like ALTERNATIVE, CPUERRATA, etc, now depend on VMAP.
>
> While I agree that alternative should depend on VMAP (for now), I feel 
> this is incorrect for CPUERRATA. Very likely, you will need to deal 
> with them on the MPU.
>
> Before making any suggestion, would you be able to clarify how you 
> envision to deal with errata? Will they be selected at built time or 
> boot time?

TBH, I hadn't thought that through. I am thinking about selecting them 
at built time (like it is been done for Arm64 cpus).

However given that there are lesser number of MPU cpus (only R52 and 
R82) compared to  MMU ones, could there be a simpler approach.

I am open to any suggestions you have.

Also, can we disable the CPUERRATA on MPU until we add support for the 
first errata ?

- Ayan

>
> Cheers,
>


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 10:54:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 10:54:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772015.1182447 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1savMQ-00016k-PY; Mon, 05 Aug 2024 10:54:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772015.1182447; Mon, 05 Aug 2024 10:54:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1savMQ-00016d-Mt; Mon, 05 Aug 2024 10:54:42 +0000
Received: by outflank-mailman (input) for mailman id 772015;
 Mon, 05 Aug 2024 10:54:41 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=I4ub=PE=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1savMP-00016U-5A
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 10:54:41 +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 1c88e616-5319-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 12:54:39 +0200 (CEST)
Received: by mail-lj1-x22c.google.com with SMTP id
 38308e7fff4ca-2f029e9c9cfso154347551fa.2
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 03:54:38 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ec8884sm437302066b.193.2024.08.05.03.54.37
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 05 Aug 2024 03:54:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1c88e616-5319-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722855278; x=1723460078; 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=l1JaD3qqSJVHtZGZQXMOIsNAb0JiZDTaP1+z2cdeRPY=;
        b=A4mRl08bHlf4p1yr8b8MSL/1zwuAvPr3b0nGIYxgNhzMGEdWbK2018hYCZssOgjmf8
         Rj73LdDLwtggcWwoo3A5xxAd/E+Yn+WfJakC/UwlhtNG19piFzCynQlNXAtEzuNWrG3l
         3k+A4Zli1+GU8sFazf5NQ5NIQ+50g58V2YiHHVO6FziKmANu2dPPDtzLN1/qnyt92rj+
         ReAGGCo/LzGIpfRJ8NbwdY9DKzMnweAYirrE81b8qctxVxqpNbOeI1NjnIfnBnOUj2xX
         RV1gDJcG1kzHo5IUVGtOXzAZlEn9Cxr6ZBHucHWF7gIA/y8u77yjNeJpzh8xqOSLFTLE
         Rb6g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722855278; x=1723460078;
        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=l1JaD3qqSJVHtZGZQXMOIsNAb0JiZDTaP1+z2cdeRPY=;
        b=kk4v0NEyfkjsbv9Nz/P0nlRB2kfvK6w0qDlk7SA5wR0JkkDUKFaWgIzg3A1d0kjjFA
         MWd9HydoNpKnXyfTXJ3sBkxvhYg2+7rVhCQRJ0AqTDWZWVUIbTUWQBqk2NapR5bOWn96
         TYyKat7AQb4oePdfjcKIDgHNBlGmEPA2NWkBhdk2KWwOOjBhJOHt7IPsGLrQgTUSvuVV
         MQE2MsiAvd8eUtiSGDqDK4zmjIEn72TbneJ1kpjtBmtuGIPb6Z+RHr3VufL1jHywUwpQ
         r92D9vpj92F/kuYHYy8IB0ycUx0gLxyBhoDf4bSuxcAuylZRkUyzr7T+ASt5A/FS/cru
         GFOw==
X-Forwarded-Encrypted: i=1; AJvYcCULaeq/70AKUmMZVzk7ZEMySGtikVK+R0vahvuDIsFJz765BydiRc4mBdA26NL5N6cofSP5kIDAspp6y3atH8F0n8tM5tQ7Q1A/PFmgwyw=
X-Gm-Message-State: AOJu0YxfKEXIeCHO56ewf6x40adw8sEy08gmB6VWnWn/ZXhzIVG9QBaD
	q/rSjkAAnakrkLTGi7/HkKO+ZsTfe8nQOP+lBy95INlUNXT4XHRvttDADO93FQ==
X-Google-Smtp-Source: AGHT+IEiPwZVoMLIeyshCrtA4wU4JGm301M2yqzfpbJcjel/ePOk5B/z9V+/fmgmU6ZDhzQtNo7Fog==
X-Received: by 2002:a2e:9c84:0:b0:2ef:2dbe:7455 with SMTP id 38308e7fff4ca-2f15aa88c48mr101663321fa.1.1722855278137;
        Mon, 05 Aug 2024 03:54:38 -0700 (PDT)
Message-ID: <fac7981a-d003-4b84-bdc6-91e4f4769f11@suse.com>
Date: Mon, 5 Aug 2024 12:54:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4] x86/dom0: delay setting SMAP after dom0 build is done
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <20240802111244.99340-1-roger.pau@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240802111244.99340-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 02.08.2024 13:12, Roger Pau Monne wrote:
> @@ -1907,16 +1890,26 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
>      if ( cpu_has_smep && opt_smep != SMEP_HVM_ONLY )
>          setup_force_cpu_cap(X86_FEATURE_XEN_SMEP);
>      if ( boot_cpu_has(X86_FEATURE_XEN_SMEP) )
> +    {
>          set_in_cr4(X86_CR4_SMEP);
> +        BUILD_BUG_ON(!(X86_CR4_SMEP & XEN_CR4_PV32_BITS));
> +        cr4_pv32_mask |= X86_CR4_SMEP;
> +    }
>  
>      if ( !opt_smap )
>          setup_clear_cpu_cap(X86_FEATURE_SMAP);
>      if ( cpu_has_smap && opt_smap != SMAP_HVM_ONLY )
>          setup_force_cpu_cap(X86_FEATURE_XEN_SMAP);
>      if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> -        set_in_cr4(X86_CR4_SMAP);
> -
> -    cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;
> +        /*
> +         * Set SMAP on the %cr4 mask so that it's set for APs on bringup, but
> +         * don't set for the BSP until domain building is done.
> +         *
> +         * Don't set it in cr4_pv32_mask either, until it's also set on the
> +         * BSP.  Otherwise the BUG in cr4_pv32_restore would trigger for events
> +         * received on the BSP.
> +         */
> +        mmu_cr4_features |= X86_CR4_SMAP;
>  
>      if ( boot_cpu_has(X86_FEATURE_FSGSBASE) )
>          set_in_cr4(X86_CR4_FSGSBASE);

A further few lines down from here we have

    trap_init();

which in turn calls cpu_init(), which in turn calls write_ptbase(). That,
however, loads CR4 from mmu_cr4_features (that's still the idle vCPU we're
on, but pv_make_cr4() wouldn't really be any better). Which I think
explains both of Marek's systems hitting

(XEN) [    3.321965] Xen SMAP violation
(XEN) [    3.325885] ----[ Xen-4.20-unstable  x86_64  debug=y  Not tainted ]----
(XEN) [    3.333755] CPU:    0
(XEN) [    3.336818] RIP:    e008:[<ffff82d04031fd8f>] init_hypercall_page+0x11/0x6b
(XEN) [    3.345032] RFLAGS: 0000000000010287   CONTEXT: hypervisor
(XEN) [    3.351622] rax: cccccccccccccccc   rbx: ffff83047da9d000   rcx: 00007cfb7a7af8a4
(XEN) [    3.360399] rdx: ffff83047da9d000   rsi: ffffffff81df5000   rdi: ffff83047da9d000
(XEN) [    3.369241] rbp: ffff82d04045f890   rsp: ffff82d04045f890   r8:  ffff83048a9519c8
(XEN) [    3.378023] r9:  ffff8304800a83e0   r10: 0000000000000031   r11: 000000000000000a
(XEN) [    3.386852] r12: 0000000000000000   r13: 0000000000000000   r14: ffffffff83630000
(XEN) [    3.395653] r15: ffff83000009ef90   cr0: 000000008005003b   cr4: 0000000000f526e0
(XEN) [    3.404424] cr3: 000000047b631000   cr2: ffffffff81df5000
(XEN) [    3.410964] fsb: 0000000000000000   gsb: 0000000000000000   gss: 0000000000000000
(XEN) [    3.419746] ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
(XEN) [    3.427978] Xen code around <ffff82d04031fd8f> (init_hypercall_page+0x11/0x6b):
(XEN) [    3.436599]  cc cc cc cc cc cc cc cc <48> 89 06 48 89 86 f8 0f 00 00 48 8d 7e 08 48 83
(XEN) [    3.445861] Xen stack trace from rsp=ffff82d04045f890:
(XEN) [    3.452094]    ffff82d04045fd38 ffff82d04043e39d ffff83000009ef90 ffffffff83630000
(XEN) [    3.461028]    0000000000000000 ffff83047b631000 0000000000003800 0000000000000ff0
(XEN) [    3.469974]    0000000000000000 0000000000000000 ffff83047da9d000 ffffffff83651000
(XEN) [    3.478873]    ffffffff81000000 ffffffff83630000 0000000000000000 0000000000000000
(XEN) [    3.487772]    000000000000001f 000000000047c000 ffffffff83630000 ffffffff83800000
(XEN) [    3.496657]    000000000000001f ffff83047b631ff8 0000000000478000 0000000000003800
(XEN) [    3.505569]    ffff83047b634ff0 ffffffff83631000 0000008000800000 ffffffff80000000
(XEN) [    3.514479]    0000000000004000 0000008000000000 0000000000024743 0000000000100000
(XEN) [    3.523394]    ffff83047b6330d8 0000000000000020 0000000024742cf0 ffff82d040494b60
(XEN) [    3.532293]    ffff83047da8b000 ffffffff003e856c 0000000000000000 ffff830489bbd768
(XEN) [    3.541198]    ffff830489bbd96c 0000000000000000 0000000000000000 0000000000000000
(XEN) [    3.550090]    0000000000000001 ffff82d040462b4e ffffffff83241160 0000000000000001
(XEN) [    3.559012]    ffff82d0403e7612 ffffffff81df5000 0000000000000001 ffff82d0403e75ec
(XEN) [    3.567915]    ffffffff80000000 0000000000000001 ffff82d040462ac4 0000000000000000
(XEN) [    3.576822]    0000000000000002 ffff82d040462ad1 ffff830489bbd7a4 0000000000000002
(XEN) [    3.585720]    ffff82d0403e75b0 ffff830489bbd778 0000000000000002 ffff82d040462add
(XEN) [    3.594618]    ffff830489bbd790 0000000000000002 ffff82d0403e75a9 ffff830489bbd880
(XEN) [    3.603499]    0000000000000002 ffff82d040462aeb ffff830489bbd86c 0000000000000002
(XEN) [    3.612422]    ffff82d0403e7621 ffff830489bbd81c 0000000000000000 0000000000000000
(XEN) [    3.621314]    0000000000000000 0000000000000001 ffff82d040462af4 ffff800000000000
(XEN) [    3.630212] Xen call trace:
(XEN) [    3.633848]    [<ffff82d04031fd8f>] R init_hypercall_page+0x11/0x6b
(XEN) [    3.641314]    [<ffff82d04043e39d>] F dom0_construct_pv+0x1414/0x1fc7
(XEN) [    3.648961]    [<ffff82d0404520d9>] F construct_dom0+0xa4/0xb7
(XEN) [    3.655955]    [<ffff82d04044a185>] F __start_xen+0x2247/0x246d
(XEN) [    3.663058]    [<ffff82d040203334>] F __high_start+0x94/0xa0

I'm a little puzzled though that this doesn't already hit during
elf_load_binary(). Nevertheless I'm afraid I see no reasonable alternative
to reverting, for the time being.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 11:00:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 11:00:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772025.1182461 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1savRi-0003PU-HQ; Mon, 05 Aug 2024 11:00:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772025.1182461; Mon, 05 Aug 2024 11:00:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1savRi-0003PN-DS; Mon, 05 Aug 2024 11:00:10 +0000
Received: by outflank-mailman (input) for mailman id 772025;
 Mon, 05 Aug 2024 11:00:10 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CTh2=PE=epam.com=prvs=4947b23bd1=sergiy_kibrik@srs-se1.protection.inumbo.net>)
 id 1savRh-0003PC-TP
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 11:00:09 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dffcca44-5319-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 13:00:07 +0200 (CEST)
Received: from pps.filterd (m0174682.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4757Z2TE005410;
 Mon, 5 Aug 2024 10:59:53 GMT
Received: from eur05-db8-obe.outbound.protection.outlook.com
 (mail-db8eur05lp2105.outbound.protection.outlook.com [104.47.17.105])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 40scfpcb0d-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Mon, 05 Aug 2024 10:59:52 +0000 (GMT)
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com (2603:10a6:20b:5c0::11)
 by DB9PR03MB8351.eurprd03.prod.outlook.com (2603:10a6:10:392::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.24; Mon, 5 Aug
 2024 10:59:48 +0000
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d]) by AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d%4]) with mapi id 15.20.7828.023; Mon, 5 Aug 2024
 10:59:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dffcca44-5319-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=RSbvP6Jj+xhRTeoilSLFdW8d8zXPJrXRQ1BNvo9LqbF2LK5+pr6rPUTsz98OKfWlc5OQ9uthCxAFOPh+1W1TItQ1bwxJ9ttjFWmwJL0EXKkZDtA3Gs9yjX/KsF+A5R8JYAHre4BTzKC/crk3Vey5HrJA3mGy1Oase2qsZ3ZVsvISFdJzBadrH+F9OnwPd9x+7O8dC3JZXqDbJq9c1oi0EtLqjeJD2h1ZcarRejQJp9a/CL4GeFLUVLFjSebKH1f5DUolVFqr6l4q5A5lRRQHiOWhEZUz9rQHZ4+48rc36MsyVa1OccpNz179hLum9eVlQgswVb1cfC+g3cLvKB5yhQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Rs7a3c0/s4ohRRs/H44R8yUhVxmz3B4BO3u+mNif0g0=;
 b=WGxZZe+hwiBE+8QqeAtm8W+KGk1DlmPqS7+fhGT2TrxqX92EKwOAz2OnZ5dS3AUMAJ5jMCv89y7v/043Xb63LMn1pP1XcoerZoabdD3JIPaxkNiFmt11DWRFTwnsKAz9R7gYigi6xC6wlWzKcVNCUKmGkz2bu5/8uL75WcTIQdmm5gqFRb51cOpVRcFaWtI5yeguRuj5SJppRTnMMtuLo/WpA6qxrVSyskpoDa3g4se+RAbAGz0uoIraRCPqF2n52BEVhN/c2nPKnoyDMfxqOo+klQN1bJOhqV0CiLoDFyrr0PZPR/Wz8/KZl/HPhGf+3nXWc7Nv34F/gKBXb+v1Ww==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Rs7a3c0/s4ohRRs/H44R8yUhVxmz3B4BO3u+mNif0g0=;
 b=MRSBIbdRf+Ut+R6Hurpjs6+1/kGswpSNu4wpMUGfsytdVd0Tae4Q7EQxsY8c8CKr4hwEVLp5rQdfICqJs5+ajVbwVvGvuv03PHzeT2cqiqTTwLDhcN1ECcI2W4CF7s/eo61g+cLctpIc2mWz92QnNwXu2gkAq9x5tgPWAEpEXqmdOJYt7H2lxlXLg0B7KCpEtCksyLA1ECY3trgljpur/bWm6ygtM6TaAozwI25hxt+utZbE9Ygn2RtTYdoqEZ67RrEv9OrbGbapkAkfavLML9rkkuc/E12fDI6AoX7AwrfiMioJW8sx98fbitiA1akmtq6zR/yxO8V3jDKBD85mHw==
Message-ID: <479bc6f4-1b7f-4a62-a155-52268ef6824e@epam.com>
Date: Mon, 5 Aug 2024 13:59:44 +0300
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v5 11/13] ioreq: do not build
 arch_vcpu_ioreq_completion() for non-VMX configurations
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Bertrand Marquis <bertrand.marquis@arm.com>,
        Michal Orzel <michal.orzel@amd.com>,
        Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
        =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
        Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
        Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1722333634.git.Sergiy_Kibrik@epam.com>
 <67f143c15bece937d7b5c0739b14cc53b0c8c13d.1722333634.git.Sergiy_Kibrik@epam.com>
 <19f3a14c-33ab-4381-8b6c-707db41b48fb@suse.com>
Content-Language: en-US
From: Sergiy Kibrik <sergiy_kibrik@epam.com>
In-Reply-To: <19f3a14c-33ab-4381-8b6c-707db41b48fb@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: BE1P281CA0150.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:b10:7c::8) To AS8PR03MB9192.eurprd03.prod.outlook.com
 (2603:10a6:20b:5c0::11)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9192:EE_|DB9PR03MB8351:EE_
X-MS-Office365-Filtering-Correlation-Id: 77231f58-c936-4536-29e6-08dcb53db940
X-LD-Processed: b41b72d0-4e9f-4c26-8a69-f949f367c91d,ExtAddr
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?aWtmUDdZQ2dBZzdmK1diakpabjVwblErUVQ4bDFlMXUybXNveFZLd052STV0?=
 =?utf-8?B?a2RRcnFaZjlDU2NoS1RtN2lmbnpCZVVqWXdFRTAybHg3dFNwczdFcVRpNXBz?=
 =?utf-8?B?ZWJlN0tpUUpSYmVhZSt5cENTVitOOXd0QlRmS3AxU1doVWhSTjFpaDJLckEx?=
 =?utf-8?B?TE5ESlBLQk96NmhnODdTSkdxSlhnL2xvTWNRTENHL1VRY1pPdzJQL3RqTXZY?=
 =?utf-8?B?UXVJL1lnTzl3VEVGN2RZZm4rR252djFWSVpvVmtRcGdtQ2QwNytmZVF4Zjdp?=
 =?utf-8?B?THEyYkkxZkwwQjlXSGJESWJPOXNETjdFdUM0TVdreURKYVFXQVgyYUo1dUVX?=
 =?utf-8?B?K2c1QlNzVHA4dEhXOXEzNWhHRm12cHNaQmwxR0IzemhkakpPS0FubkZQVFhv?=
 =?utf-8?B?ZkNrQ1lUYWtCZk83VmxQbFE3S2dPWGV2MEc1d2QyMklMTHdWVlJJaVIvM1Jt?=
 =?utf-8?B?NkE2WTVRejgwZXFldThTenlwN3czYm1LdElwREpBSDFRZG5JMmFZNmJuaVdR?=
 =?utf-8?B?T21MbHZPL0NrdUFodlhFQXlCMklRNzd0L0pVbU1NSUJWVzZJb1VPcGVIeWd5?=
 =?utf-8?B?TEwzZUJFR2lNcjEvNTE4MkRmRlI3NnUzWHQ5UUNXYXM5L1c2NHIxNUZ4eGpJ?=
 =?utf-8?B?U21YcGdRQUJkS1g5TUp6TjRDR3VuMnBzM3JXTXVrazVQdVVqQXFRUVh0UUlp?=
 =?utf-8?B?WTFTdUhpMFZ3bFMrNm5CRnRseWtZWHl2TFl5amxnNERNeXhnTU5tSHpWT1BM?=
 =?utf-8?B?eGpoVjdHREVHck9FZGcvaEJwQSsrOVp3TWh5TkxiOUlxMjZpSlMya0pSZDhk?=
 =?utf-8?B?dENDVVBWYVUrTE15SytJSXVyK0QvTldZY2xTVFRGSndwTDdhRFJMbWg1b3Bz?=
 =?utf-8?B?R1VMeEN0a0tPaThqanNMMGFJbW0wcEJVNGNwaGJtaWt3dVFWMHdqRWxnRlR4?=
 =?utf-8?B?Uk5TbmljM3QrdnZHS1I4MDUvVDJiblRENWczR3VjTG1taHBGS0pkVS9WeUMz?=
 =?utf-8?B?V0RKNzV2M3h2NldxZmcvcTNORTYzdWRxTGF5enhJNXZwWVhXU0ZjdTVFT1lM?=
 =?utf-8?B?OERpdHlRNkxzUzhMYVJKQlh5c3FqVVBGK1MrV2VHUTI3ZEpKRDJkUWJzWWhR?=
 =?utf-8?B?cEZHMXZ5ODVnNXA0OWd1YzVYbnhweWdpSVU0aG01azMwOUcyenFwemJ4TTNp?=
 =?utf-8?B?NFVkckhmT3d0dW54Vkl0cjBKVi9aUUdSc1kzMG9CZjF3MkZudkt0N2pZb1o2?=
 =?utf-8?B?OWJYQi90Ri9UQmdCbnd0czE2K1FINEQ4N0IzRnd2b3RLb0lqWmdmMERNbHlT?=
 =?utf-8?B?bnBuK0VSQkVYRS9GUWVTSzJwQTROcHNqdEZLaFRBa3R6M1A1U3RQeGFCMEZM?=
 =?utf-8?B?TXpjT243UUhiT3BLdHc1RWtueFFNTUtTTnUzUEJrbDg1WXNrZE53TnhVd0hj?=
 =?utf-8?B?WTJnQWFZVUVVeVZBRDRQSDBCdWEwdnhaNG95WEtXbHAxSTkzcTNpcHVrb25l?=
 =?utf-8?B?UWFNOFRVYXFzb283Q1JNQ0IyUzFYSzNGODRwYWxORS92WVNCL0R2emlCVkhu?=
 =?utf-8?B?K0JmZkwzZ3I1dy9DZllvOU5RL0hqSThoY0EwZXYzRkN3ZHQvZEY2WHZmMGlv?=
 =?utf-8?B?Mk5KcFNhbzNYemhuaVNaQnBONmU1RS81MkVCZndMRmcvRk5hYTlGQnV5aUU2?=
 =?utf-8?B?Qk5JMU02MzhobUJ5aEI4ZnFMdDdwc3JvMWEveWN4ZW9FWkJQTFlkdWdEMXJS?=
 =?utf-8?B?RFpsMXViT1Q1MUJmTmZvYXhUTWJkeUlXWXFCNXkxMDNNUUh4cGZqUXMxWTg1?=
 =?utf-8?B?Um5aOG5YTUVSRFdvL081UT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9192.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bDJZYmg1UElNR3pmemlTQ05XS0g0Lzk4T21MOVozb0FzNldDdkFBUnA3anF1?=
 =?utf-8?B?Y3BKOWM0OUhNejA0aE5MYXF5VzZ1YWphZXBVMVVORDhFNzh2TC8zRHpxeWwy?=
 =?utf-8?B?NkQ5SEtQR09NdkFWZmI5ejlHQk5INXdQaEhDM2hRRlBPUVA2cXB6WitXNzR6?=
 =?utf-8?B?UU9mb0NIWHpnbXcrZUF5YkIwMmNFbUt1UTRkcjIzUkFkdzlXUTh5eW44VDhs?=
 =?utf-8?B?d0h1U0xJbWFURWFLZllYalZUY3p3bGE0NHYwNTljWkY4ODJTKzFueTVWM0to?=
 =?utf-8?B?N3BzRTRhQXNNd1NxVml5Y1lVeUVXbjlEOWJXbXpMYVIxQ1ZvdHdoWnhzQzk4?=
 =?utf-8?B?bFlWeHpHSmRGaTRLU1diUGZkMTVHNzZwZVZhcHZvbG0vL2lMUjhjcnZpdndO?=
 =?utf-8?B?Rk5zbmJzT3BqQm5vNFdKVXFyTTlQZHg3bVBYend5Q0xFdi9JcmdtaVY4VnVR?=
 =?utf-8?B?WWJaa2FvS05zUHRUcHJScGNaS1MrRFhYQWx5K1FmcXEzc1M0TlcrQXZERnJn?=
 =?utf-8?B?UCt1VmJIWUcxdWUrbnBra05kUUdyVzY2YnNEcjd5NVh6ZW8zUldnVmdockNp?=
 =?utf-8?B?aWk3KzdtcXdHVTBYQ0FUTVhXYUxEN0JsRkpFZEdyekxhZ3Y0QUhKL2VoRm9l?=
 =?utf-8?B?a1ArcWtQSUJLLzREVDBlbjM3eVZlWjhaclpKYk1Ga204YnhIR1VOSTkwek1V?=
 =?utf-8?B?QVFZem0rWWxHZlVJUVFEcGtJTGRqQ3EycXNDWU5VbjdpSC8ycUFXOEMrMjYr?=
 =?utf-8?B?QjJYR2RqbFdtaVRDWWVuQXJsSXRMbm5NSVd3Yk0yODhiTWlTbW12Q2xPYjFv?=
 =?utf-8?B?V21Ca1I4aTZiNW5SOXhEMXNlYmNOQW9uYTBUdkNWLzMwU2VGQy9vNHJWNURY?=
 =?utf-8?B?N2N3MWJvc2RranBUdzkvQXBXN2tuQi84aE9yNGxsQ1FrYWIweG51U0t4ZktN?=
 =?utf-8?B?M1BVenVlODBEY2wvb2xSc21weENQMUlMQ3YyK3lYNlhwOHQ5V2hIOWh2djVM?=
 =?utf-8?B?eVZDQitHVTFrYmt5WlF6ekIzWU13a3MwOFRwU0RRMG5pZ2ZsR2JaK2ZoME85?=
 =?utf-8?B?UFBCOFFwYzBVdVBLcUx6NXBXTlFYS2ZOZHkxZXlWaEUweE00WmNWTitYU3RP?=
 =?utf-8?B?a29pdkNIN1lMaFJoeWg4UFEwbVVHOW54ZXVQSjh3VS9obE9Jblh5TzRUaUFO?=
 =?utf-8?B?c3NMRGhWTDZkUzM3a3JOc1JiU3NEa3FTWkZTS1BYRUVJOFhrKzdzbkpSVWdm?=
 =?utf-8?B?UDkxWkFaSUt3YWxLMkZVWC9Lbzl0a2piRyt1NXJLdXFFdEF2TG5IWnBzT1p3?=
 =?utf-8?B?RHNQeExlZFpNZEhVNURQb1g5SWQrclp1VXVrRkZQUC9BN3k2dWVmRVVOdEJL?=
 =?utf-8?B?a05PKzdkdWQ5aS9pSTA5QjZuZEJPQWsxZWF3WTJkczhER0JFVEhMRmt5N013?=
 =?utf-8?B?QjkvTVlGaHJ1QnFpSjNSdFBzdUV3SCt5NzZkUVZGQ3RxTmtBUFVmZG16b3No?=
 =?utf-8?B?dFY1clRFY1ptL0N4Qk14aHNXUm9nV0ErWVJRbDRQamdlQSsxTCtSb3dUWjZh?=
 =?utf-8?B?VXhnMldwYkJ0Ui9DZCtreGRLL042YVZ2bXRjdUZGY0J5Sjhxc2V1ajUyUXcx?=
 =?utf-8?B?RVd2WmxHSjNCUHhyZCs1VU9mWWZidWN1cVBZVEhBYnVFbUNmUk9CRkROblYw?=
 =?utf-8?B?U0IwOGdrbHd6RGNKemhPazIwQ21EMXZIaW1NWGJrNEoxUXIzcjgvdnVubTJ4?=
 =?utf-8?B?a2crb2c3bngzNnVFRFYzTFFpQ1Z3SFNYZUUzM1k3RExHNVZvbkRhQk9aQmF1?=
 =?utf-8?B?SjBsM1VGUjdUSDFQQWRWaGFtNTNRZEd6OHU0Zy91K0tZbXRXaEcvWW5iazR4?=
 =?utf-8?B?KzkrUmV0S3o3YnFuNkU2YkFuN0lHWlJmVE5aMmZZZVc5aWtKY2dVRVNQWTFt?=
 =?utf-8?B?M25tUzFJMkRmYlFGUFhmOWhnSDgxNm9ITU9NQ1RHTzNUMnYzcTMyREpzL1JS?=
 =?utf-8?B?bTVmdDVkVGliNzF3bEZ4U25hMFhod2JuYWtQak8xYlBXSDNZS3I4c2tlTnZ0?=
 =?utf-8?B?cXBrcnZCdmtKRzJoMW9CcFBCd01XZUxPVTdPcng2YVVlU3QwK1F0dnZ4TWlD?=
 =?utf-8?Q?G14aF0MatM6LIj5fJX8RNlTuk?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 77231f58-c936-4536-29e6-08dcb53db940
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9192.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 10:59:48.6767
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: MUFRa98QEbL0mVOBikBn0KDdbB/iOFmc3D4XZcWe7aN/SlxWK8ARyxNnEPo6Ws2Hj6crijwDz6+B2nspw/C5VQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR03MB8351
X-Proofpoint-GUID: 9wwGDx1pmikFu0U_r8slUbEX0Q0THZXs
X-Proofpoint-ORIG-GUID: 9wwGDx1pmikFu0U_r8slUbEX0Q0THZXs
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16
 definitions=2024-08-04_14,2024-08-02_01,2024-05-17_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501
 impostorscore=0 malwarescore=0 bulkscore=0 adultscore=0 mlxlogscore=987
 spamscore=0 mlxscore=0 phishscore=0 suspectscore=0 lowpriorityscore=0
 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.19.0-2407110000 definitions=main-2408050078

31.07.24 15:39, Jan Beulich:
[..]
>> ---
>> changes in v5:
>>   - introduce ARCH_IOREQ_COMPLETION option & put arch_vcpu_ioreq_completion() under it
>>   - description changed
> 
> I'm worried by this naming inconsistency: We also have arch_ioreq_complete_mmio(),
> and who know what else we'll gain. I think the Kconfig identifier wants to equally
> include VCPU.
> 

sure, I'll make it ARCH_VCPU_IOREQ_COMPLETION

[..]
>> --- a/xen/include/xen/ioreq.h
>> +++ b/xen/include/xen/ioreq.h
>> @@ -111,7 +111,17 @@ void ioreq_domain_init(struct domain *d);
>>   int ioreq_server_dm_op(struct xen_dm_op *op, struct domain *d, bool *const_op);
>>   
>>   bool arch_ioreq_complete_mmio(void);
>> +
>> +#ifdef CONFIG_ARCH_IOREQ_COMPLETION
>>   bool arch_vcpu_ioreq_completion(enum vio_completion completion);
>> +#else
>> +static inline bool arch_vcpu_ioreq_completion(enum vio_completion completion)
>> +{
>> +    ASSERT_UNREACHABLE();
>> +    return true;
>> +}
> 
> I understand this is how the Arm stub had it, but is "true" really appropriate
> here? Looking at the sole vcpu_ioreq_handle_completion() call site in x86 code,
> I'm inclined to say "false" would be better: We shouldn't resume a vCPU when
> such an (internal) error has been encountered.
> 

not just Arm stub, both x86 & Arm variants of 
arch_vcpu_ioreq_completion() return true unconditionally, so there must 
be a reason for this.

   -Sergiy


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 11:00:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 11:00:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772026.1182470 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1savRl-0003eW-NH; Mon, 05 Aug 2024 11:00:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772026.1182470; Mon, 05 Aug 2024 11:00:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1savRl-0003eP-Kg; Mon, 05 Aug 2024 11:00:13 +0000
Received: by outflank-mailman (input) for mailman id 772026;
 Mon, 05 Aug 2024 11:00:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CTh2=PE=epam.com=prvs=4947b23bd1=sergiy_kibrik@srs-se1.protection.inumbo.net>)
 id 1savRk-0003dz-PZ
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 11:00:12 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e2078a23-5319-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 13:00:11 +0200 (CEST)
Received: from pps.filterd (m0174680.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4758xPjS031315;
 Mon, 5 Aug 2024 11:00:06 GMT
Received: from eur03-am7-obe.outbound.protection.outlook.com
 (mail-am7eur03lp2232.outbound.protection.outlook.com [104.47.51.232])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 40tuqa0dst-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Mon, 05 Aug 2024 11:00:06 +0000 (GMT)
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com (2603:10a6:20b:5c0::11)
 by DU0PR03MB9801.eurprd03.prod.outlook.com (2603:10a6:10:44b::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.25; Mon, 5 Aug
 2024 11:00:03 +0000
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d]) by AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d%4]) with mapi id 15.20.7828.023; Mon, 5 Aug 2024
 11:00:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e2078a23-5319-11ef-bc03-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=kVFBbJqtYWln+TFpuaDu8ppQakcYR0z486WB1YDFsDSnoaA/9xV1GaWXfQWqxFIedj4IS2xTKyv14nMoXJTuMHCgEpfuk8Ksi9x24cfqhHJnMCOjf8tMNuoYJ5aT38g4W3MbXVl9QXbEdrYREh3miW/MmlYR1UyYOQ3TCuK+d+QaTvFBN+5GynOGDhpAHyH22jriyDLjOTsRzZfcA84/RTnhSzXG2TJdJdxYwh05vt+a8p5yH/1AoKrpGfuo4llyAGdSOE2UCgjBnnwywqiFnlhXy5lX46NYJw2wMQydIX0g2c2iGh9QO+yVd8JxZBWf9j3JM6o6FxgamWA0pOx1XQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=y/j1ooJXuqNaX7jLUIrC2BUpsx9/yYjNSUWWlkZRGOM=;
 b=vDvuiiZDyhpLf3YdPujU60PX4l5mM7mhLgpXR0IpDMf/gs+ce9XQLBNTgOS12J4C/VM/nD2cX4q0e5/gjGvh7Qxxxwr1z2AWQaEp81UdBIr8sBW7mXBClvVrNk3vc3Nef/1v7a5QpJZg8V5GwoTvRRAZeeBr7+cWic1vFHKknKTPZ/IO8I3zN85EPpUQ3fj1DDfBK0XeXJuc70sJdIcH+Wnrpop4H2j34SGE1zos0Hq7/pVHqEIZBClbHpTFE/jVa1mDNTQmQSWxCaUqEx+Xdodx07KIMpflIdlHjupSjf9RUPNsUJNKSSlHSoq2QT630pw+ysOSeuqKJ6ACOxmAjg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=y/j1ooJXuqNaX7jLUIrC2BUpsx9/yYjNSUWWlkZRGOM=;
 b=QCvzrO21Xkz79ntRPY5n18iU3uvxH4nCwzvBVysrSfp+56tLUbqZqbmFv2q/OJKk422GzHZHY0EGJ7BQupxUS9+72hbPx9zHKAxOIyAUp0nF3/TApV3t8DqAQQ4izmMpF++sj7Hs5AmD6Mnq9gXLxGVwfu1CMg513PsbcSsWHLGmBy4NTu0FeNm9w9uIhA/WcxzI7hB817MmHORakZaH094wniOj8BPBvRBeB1xBKhPMd5PjJHinGJh7XL82yEqLblN/3O1cec8K14aMF2ojh4UJ7LCdOd8O72gzALHO7I12KddbS+J4kV+I/jjHnON50ZdmN6JCf0PUJrgN9iZdBA==
Message-ID: <95a15330-d7ed-4162-8af7-d807551ed711@epam.com>
Date: Mon, 5 Aug 2024 14:00:01 +0300
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v5 13/13] x86/hvm: make AMD-V and Intel VT-x support
 configurable
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
        =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
        xen-devel@lists.xenproject.org
References: <cover.1722333634.git.Sergiy_Kibrik@epam.com>
 <827008e4af26814e4cd4bf6abbb92c77fc136aa8.1722333634.git.Sergiy_Kibrik@epam.com>
 <b9356c61-d927-45cf-857d-e9c80e9587eb@suse.com>
Content-Language: en-US
From: Sergiy Kibrik <sergiy_kibrik@epam.com>
In-Reply-To: <b9356c61-d927-45cf-857d-e9c80e9587eb@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: BE1P281CA0149.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:b10:7c::10) To AS8PR03MB9192.eurprd03.prod.outlook.com
 (2603:10a6:20b:5c0::11)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9192:EE_|DU0PR03MB9801:EE_
X-MS-Office365-Filtering-Correlation-Id: dd93c850-ac4f-4ebe-2b9b-08dcb53dc234
X-LD-Processed: b41b72d0-4e9f-4c26-8a69-f949f367c91d,ExtAddr
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?Vk14Y1piaDBWWlR5cXZ6a3NuNS83ZERvZUtsenBhdDFGSmo1MG8yWmRoOEpC?=
 =?utf-8?B?RE5UYldUdWh3cGFXcUUyZ2JjWDJyWWYva056VjVwRHcwSk0rbnF3dmNkdUYx?=
 =?utf-8?B?cGNZRy9qWG8yNE02Nm03VEozU1JjY2M4UXJjZHVTTFRPaEdZTkZlRmhBU2J4?=
 =?utf-8?B?OUNUekRPaHc2NTlsM2dhRHV4UEY5ZS84K1BkeTRheXkySm12b2tGNER2Qi9t?=
 =?utf-8?B?d2twUnRxYUNzRWQzaENob1NKbk9STzBaVHRLTS9HQUJEMUVmdjZ4czRITVFo?=
 =?utf-8?B?OVRIbzlmM1E5dDVzOFJreXZrOGMyRXJuMVNIRU1MVTEyQkxMekFZMndyVlBy?=
 =?utf-8?B?VDd4RVRNa2ltdDJ0ek5OOUNTTHBneE5uSWoyWXlxWmFPZG9ZTkIySHNLb1Zn?=
 =?utf-8?B?VHFGaWU1RmNtWVZWTkNCOVdtVWdxWlVYdis1aFhQQTBXc3pEcTlMTXhDRytF?=
 =?utf-8?B?VHR5ZGxLY3cyeFkzTmxFTFRlaXVDRlZ3cEdoMXpBSTJpMC8vb1BFL0g5SFla?=
 =?utf-8?B?SWJDdU5MaHhSc0FwQnhLWEx1Q1Z6eGhWWEtsREVqaXUyN2R0SDdUNnpmbE4z?=
 =?utf-8?B?NGVFU0IxMFY1c0tsOXkxeUZSTEpQSmNsa2pOT3VNSHkwUzlKSnlMZ0tTMlFL?=
 =?utf-8?B?UDd5TE41RS9ZRmdRS01UajV3VVc5TU9GcUppek9CVnN2aE4wY2RlVVZGbW1h?=
 =?utf-8?B?a3pUSCtTRFBWblkrV3g0cG1qbXJSRURJb0ZzcTNxNVpWL1g1bXhDenhaeWxZ?=
 =?utf-8?B?TFlHK2NYSVhTTlNkQ3RDQmxteDhqcUkwRGVzelpiYWErcEppL3ZYTEdoc2E0?=
 =?utf-8?B?QkVGSG54OHUzR3YyNUQ1Skl1SExpMjRQR2dtSEZJbzlqSnhFYWs2SFJhWUVI?=
 =?utf-8?B?RW1rTkVVanpKRzY5Nm9pNG5yYXRNYllLQzhBd2hRL1J4L2N2NStFYTU2anht?=
 =?utf-8?B?NHlJT1ZFS1ZwVUEzWmpiTVllanh4WE1FUnpZWlRJWTZicUlyVmJBdVM4ejlF?=
 =?utf-8?B?eXlHcngxK3F6WFpLaFNYbU1NSE1YYjZmaDFSRzNOVG84R3lZbVRkMkIzZ2Vh?=
 =?utf-8?B?U2V1YTQxQzFjSWtMMWdhN3VLQnJOZTV4OGQ2bTVCNHlCS0xhenprWkkwbWIx?=
 =?utf-8?B?bm9vU1lhRkVvcVlNbGQ3cnVtN2d3ck9vOXRLaG5qZEU1V1hyM2xRSklZSjlK?=
 =?utf-8?B?SFNxSWM4bkNQdUNTN0ZYR2V2YTZremtkRDBYRmIyLzRqQXlTOFg1NUNWVURu?=
 =?utf-8?B?ekxuMTRld0pLQ2VsSzhuY3RZbjQrdVpCK2EzMC9WejVyWVdzOERLRksvL0Rp?=
 =?utf-8?B?M0wyUGdsN3BlYUd5bEdRQStTcnhTQ1hTMWgwOXBwb3huODI2K3MrcHJRRWpH?=
 =?utf-8?B?WkMxVGxlaU53Ty9Senh1STE1S0RETVBiOEl1ZDh2QkVkMW1sMXRleDdpT08z?=
 =?utf-8?B?a0UyNlB0YkI0NjJhT3NTM2hIMGdLNklsM3BQRlFWWEJRVC9RRDRUY0diKzN6?=
 =?utf-8?B?NXhSUkFQTndkc01heFZzalFhMXpMcDFLdEw1WStPVUJ1YXZXalArZitvSk44?=
 =?utf-8?B?bXJIdElQaWV6STlYSzZiWHk0VkR2VWY5M3cxVm01TWxHdHkxSVI5MjhMZndD?=
 =?utf-8?B?Z1RLQUNIMUo5S0VzMXNUSVFmWEMrbmNpT0w2YTVKWjhGOC8va09FTG9vbHZV?=
 =?utf-8?B?S2pWYnZJbVdOQy92Zjl2VWNvYXg4c1RhOWU4dFlOMFJJS1NRbG9qNzB6ck0z?=
 =?utf-8?B?cCtXd0JoKzZmS29GMzNTUk1teDFPVEhNY29lbTM1NGh1T05KazVlNlMxaTNW?=
 =?utf-8?B?M0VJWjkwa2JlQThlSmpCUT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9192.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZnIyU3lSQnZVTW5CNUZUQ1J3QStIWlROWXZaNzhHUGxad2VWRU9NL2w5VnpG?=
 =?utf-8?B?TGVlcklVSmcveWVrdG50ZUJOQTNxMkZMWkRTNGt3MmZKMmpaSENjR0pPNmx2?=
 =?utf-8?B?Mk9CWmc5bEN6Mk11dlBrVVFpL1JuYm9haysxSzZYTUxheUlvN1YvWWVjRGsz?=
 =?utf-8?B?M1o5NlF0SmprSXE3QXczTkdTNWpqUlIzWmdhSUltcElBUURtQWVXTmtQWTYr?=
 =?utf-8?B?VUc5UTRBZmxrY0ZkNFk2REI2enNXRFI5T3c4a2t6YXJVeVY0eWhRL0w0N1N5?=
 =?utf-8?B?RlNETUU5NDYrOEphZjY5RWxRRGNnZkd3MWhSNW5DcnY2ZldhT01xVU5xc016?=
 =?utf-8?B?VlI5dmlTQkRpRWQ3M2F3VXNnb0ZRM2pVODFUY0hLOXhwbmtqSXQrM25kSnps?=
 =?utf-8?B?MHREWmlKTExybGw4cmlNSVZFa2ZmYnd2OUF2ZDN0RnFNSnJYa3RVTU9uV3Bx?=
 =?utf-8?B?YXVPdmEyMkhpMlUycHFuRDI0a1U3eDZrK2ZwbUxiS3MyWmVLVi9JdFJ1YWFC?=
 =?utf-8?B?VW1TNUNRRzRHRThvTUpDY29ZREFDMVZtaHJyeGhtN2xWMmR0VkxKVG9rbzlE?=
 =?utf-8?B?MnB5Y3Fzc3VSMXhjSDJmbWhWbU1LM0JtVnV0ZGZqaXFKL01NUWM3YVBYM3Mv?=
 =?utf-8?B?R2M5UFVSQkFGeEVmaW1aZkQ5Zk1ibGVoUXRLYzdSSDhkVFJuTm5rdmRnbU55?=
 =?utf-8?B?MEU1WHFjKzhydzN0ODdaTklCVldVQXFSdVVneXR5bjRuU3dWMERLcklPSVVs?=
 =?utf-8?B?Zkx2MDk5N015VlpxakhqNmFsbUZrc3hNZ09QeWEwdFVicDk4QkFqVGtkOVNP?=
 =?utf-8?B?cXVPMGU3SzhIOHA1bjI1amRnd1FGdjNlRmlpaHU0QlArcEhFdDhwdlFXQUFC?=
 =?utf-8?B?bTY5VDdBS2dpckJMaG9jR0RsbmxwakNzNFIyZFlrMjl1S3hLeXZIR282Y2J5?=
 =?utf-8?B?WmxIc1JEODFGeEsza0FPUTZSdFptSEdhTzExNFNsWGIyRmx2QnlRM0lhaUw0?=
 =?utf-8?B?NHVXYVd0NVVlL3A2MnBEdnl6eEU3eFRpOXZPVlorRnpIL0c5cy9ERDdnS1FX?=
 =?utf-8?B?RDNiYlpUZ25FenRkQ0pqS24vR25LTWo0QnpnQVdLR2tYOTl2ZmJpZVBkb0pZ?=
 =?utf-8?B?Um02S0xRWkRnWnFEbmdPZVQweElIbFgrVkVxTjQ5TUN3cDFhTFByeWlDR2lr?=
 =?utf-8?B?SFhEUjVJaFBBY05ncEVhVDRDZEgvYncraUc1ZVo3MmJHbkhYeGE3eTNMQk5t?=
 =?utf-8?B?STYxNUxVM2ZrME5xQ2E3NmNKZ3ROdlJnZlFwUzg5aUNBbnppcHBCNEUvV1pt?=
 =?utf-8?B?MVZaMGJjZ1B2MmZoUGV3NjJ2elk2d3BUckkvK2dlWVJZZUxDWVFzU0F4TU9i?=
 =?utf-8?B?NXd6WGNDSkFkNWhnM0gxSFQwYzR4M2k5dDlFdFhlVFJab3pXb090Ujh1N3FX?=
 =?utf-8?B?bk53WVN3WVBGWnZEaFRJTi9BTlFDK1NydXJTUFNlR21IbXlOTklva2FZNFVh?=
 =?utf-8?B?bjIxQlZadDJQQVBCcUxtOTFCRVVuQ0l2T3NIME9vS0duOXpTZm44RitlQUlJ?=
 =?utf-8?B?TEFYbnVKajlXZnpQWkFSSDVsN09xek9oMWQ3M3U0QU9PVGQ2S1gzaXdRcmNT?=
 =?utf-8?B?NytTNHY0R0RSWXpVWU42MFpNOFEvT3RTUUVacjk3OEFLWDcxOFV2MWVKZHVV?=
 =?utf-8?B?a2JCWC9zNUJ6UEdiQUlvYjhKOFJFY0JlMFpzNDBjb0dUSUJjVzd4eWZXVHVX?=
 =?utf-8?B?MExHRVdtYm82bTZ0WGpMdkVyVTNTZnlnKzg5dVJGelZCWW9RaGg4clRLb283?=
 =?utf-8?B?UzZlWDAyYlpBcHJNdWJNZGFKUGZGckZIT1hZakswZkZLZWEzMWxuREFhbkgv?=
 =?utf-8?B?NFhMK05Id2EyOEpjd2FGNCs0cE5FOW5PWGFGUEpHV3k3TWtkVEZ1QmFWZ3Mr?=
 =?utf-8?B?RlE1YWpvK3dHdjlyQXIrLzI0eEhEMzJlZHFIemI4UUdVS0hIczh0Qk45UDNs?=
 =?utf-8?B?Z1hIdHY1MUFlTmErRnY0TitVT2xyT29wYnJYS0tlNlV2NUxEKzA5aHBrc3JQ?=
 =?utf-8?B?ZjkydStkVUh6WTB4UVZ6MzNQdVd2dTZtTGRXZ3k0Rkg2M0hjaXd3RnRWTFJ2?=
 =?utf-8?Q?yeMF0UcO16GFqUmmCEuNj+0SV?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: dd93c850-ac4f-4ebe-2b9b-08dcb53dc234
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9192.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 11:00:03.6523
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: X2aVGpV5uk/o/LCCx3HA5m6QvCsmv/KWan0bgu6UdeZU2tLsPzsmLv4il5zvYcKjkJavnCYN0IrGWaUs77IsvA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR03MB9801
X-Proofpoint-ORIG-GUID: 3HUv8IrJHWXxr_GIJFHVxbw4Hq55gg9t
X-Proofpoint-GUID: 3HUv8IrJHWXxr_GIJFHVxbw4Hq55gg9t
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16
 definitions=2024-08-04_14,2024-08-02_01,2024-05-17_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0
 phishscore=0 spamscore=0 bulkscore=0 mlxlogscore=892 malwarescore=0
 impostorscore=0 mlxscore=0 suspectscore=0 priorityscore=1501
 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.19.0-2407110000 definitions=main-2408050079

01.08.24 14:39, Jan Beulich:
> On 30.07.2024 12:41, Sergiy Kibrik wrote:
>> --- a/xen/arch/x86/Kconfig
>> +++ b/xen/arch/x86/Kconfig
>> @@ -123,11 +123,25 @@ config HVM
>>   	  If unsure, say Y.
>>   
>>   config AMD_SVM
>> -	def_bool HVM
>> +	bool "AMD-V" if EXPERT
>> +	depends on HVM
>> +	default HVM
>> +	help
>> +	  Enables virtual machine extensions on platforms that implement the
>> +	  AMD Virtualization Technology (AMD-V).
>> +	  If your system includes a processor with AMD-V support, say Y.
>> +	  If in doubt, say Y.
>>   
>>   config INTEL_VMX
>> -	def_bool HVM
>> +	bool "Intel VT-x" if EXPERT
>> +	depends on HVM
>> +	default HVM
>>   	select ARCH_IOREQ_COMPLETION
>> +	help
>> +	  Enables virtual machine extensions on platforms that implement the
>> +	  Intel Virtualization Technology (Intel VT-x).
>> +	  If your system includes a processor with Intel VT-x support, say Y.
>> +	  If in doubt, say Y.
> 
> Despite my earlier ack: It appears to make little sense to use "default HVM"
> when there's also "depends on HVM". "default y" would be more clear imo, even
> if just slightly.
> 

indeed, I'll fix it in v6 series

   -Sergiy


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 11:22:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 11:22:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772046.1182480 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1savme-0008CE-D3; Mon, 05 Aug 2024 11:21:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772046.1182480; Mon, 05 Aug 2024 11:21:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1savme-0008C7-AB; Mon, 05 Aug 2024 11:21:48 +0000
Received: by outflank-mailman (input) for mailman id 772046;
 Mon, 05 Aug 2024 11:21:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CTh2=PE=epam.com=prvs=4947b23bd1=sergiy_kibrik@srs-se1.protection.inumbo.net>)
 id 1savmc-0008C1-Iw
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 11:21:46 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e54b650c-531c-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 13:21:45 +0200 (CEST)
Received: from pps.filterd (m0174681.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 475ALPhb008784;
 Mon, 5 Aug 2024 11:21:41 GMT
Received: from duzpr83cu001.outbound.protection.outlook.com
 (mail-northeuropeazlp17013009.outbound.protection.outlook.com [40.93.64.9])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 40tr2493gv-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Mon, 05 Aug 2024 11:21:41 +0000 (GMT)
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com (2603:10a6:20b:5c0::11)
 by AS8PR03MB9984.eurprd03.prod.outlook.com (2603:10a6:20b:630::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.25; Mon, 5 Aug
 2024 11:21:38 +0000
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d]) by AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d%4]) with mapi id 15.20.7828.023; Mon, 5 Aug 2024
 11:21:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e54b650c-531c-11ef-bc03-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=CjqQ7aot27l3dJjKdXMiJjkc1tSuO2BZybsGqUeDzWvr+c5LPhKkihZslLuQU35+R2ZhUvVfo8Sa7/SfDqYUMO1ahdOjlCrbB/p6E7hKLAd4/CGJtY5A2jK5yYFM1VXlY8Pg8yE0OH4TIJcR+L97d+yxmpEF8EwPmbmZxWQzCZqeAURB2mKdSHCSqyiKJe12FTlP9Qob1o/SRg1mASm8sKesJ09QP4rlLw/TNzFTghGsyI1tpBNdUjCWjPiBFeqjBGrSMVw0h0aDdHTeAM1589/PxMUEYJF84n8JehtzEJA2TiOQ70vm3hx9yeiIFPYkbPnZomDMS3ECGoOI2TNqcw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=IQGh/N2W0lmiqf6q1V5qC0271Vixl035rbiqXEuqGYU=;
 b=Gn3giWeoErbwCd3CLDnh9L6d6pylx19L9+Vyn93dw2QbpvpBxBjc+l3478i/efmIGZgDzgULHIn6PkFHIb51H7sC3rQ1Mo77PoGAo0zNIJhzKjLUETjstpRm/EEP4dzgRl8loZ8w7A1f9FcWV45AAdtqllRoG+UbZnaydp5weBxttzkRznhRq5Sg2/uKzqe2mm73Tb+qquMET7wB7YAoEIyUzD7RNBwCZr8PXkPYX2Xvs+agZ/+i2gZ5JggI/B09rWtbZTLs5gY0G5iVp3YWtU2gMiHm9lpjdKIe3Gf/QuFV8Qd6CJbOgOMdCdGYswO00yzs0UBYYzwzBJ0NpU5L+w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IQGh/N2W0lmiqf6q1V5qC0271Vixl035rbiqXEuqGYU=;
 b=BES5vjDnmvaIjitfR2GNw7O2iA3g/0LZ0/OHglKQZIrl7ky84Llfle4cXgev9xtooyjxJ0g5KiMifZx7O+js+0xGnIJ9VV6bTVnMxO5ddEr920Y4RF4yAdAKIP30msQ7VAP1V64opb0Y9EYuGPRMQmNu8GgtTXerSzxVQNwCqyMvLIJHsvLANaY6uGccemfCnEjmF8HW/CEe+N0IiV0i5HrJ4CZRyB5iDBcIwgRPmdJChKARQQ+wcAvj2nNGbMwZ8YgcFyVmjguAocQ9uLuWc5Hl692vGABd2FxTjQmQ/qWwNDfPiHY4DNCB0+NU3fO0IsG8UA4lgkMKbaNvWYUNcw==
Message-ID: <32ebe9ac-a9d6-49a3-937e-468d7f2d3ddb@epam.com>
Date: Mon, 5 Aug 2024 14:21:36 +0300
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v5 10/13] x86/vpmu: guard calls to vmx/svm functions
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
        =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
        xen-devel@lists.xenproject.org
References: <cover.1722333634.git.Sergiy_Kibrik@epam.com>
 <fda81012adec8c4993acd83076f1a46f2d71d668.1722333634.git.Sergiy_Kibrik@epam.com>
 <1494c80d-9056-4922-a5e1-33cfdb1e41cf@suse.com>
Content-Language: en-US
From: Sergiy Kibrik <sergiy_kibrik@epam.com>
In-Reply-To: <1494c80d-9056-4922-a5e1-33cfdb1e41cf@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: BE1P281CA0249.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:b10:8b::11) To AS8PR03MB9192.eurprd03.prod.outlook.com
 (2603:10a6:20b:5c0::11)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9192:EE_|AS8PR03MB9984:EE_
X-MS-Office365-Filtering-Correlation-Id: 3eb0f67d-5492-47c1-ba2e-08dcb540c5de
X-LD-Processed: b41b72d0-4e9f-4c26-8a69-f949f367c91d,ExtAddr
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?OTJXeTRzc0tsT1d6ZzFTMTVKL0xVRVh1VTZkWm5SejQxMUxZOUVUQTc4MW9T?=
 =?utf-8?B?UzhWWTdwblhXem1sUHFINlY1Zm5aNVAwY0FxR2ZOeHUwMUxDWjJEZDVIbG8z?=
 =?utf-8?B?UUlqbjJQVkFBL3FqeTB1S0ZsVldUdmlaSTJHeE1YcGVRMHNQU0pLaTNuWWNw?=
 =?utf-8?B?bmdsS3VNR0FZOHFtVmtHTlU5OGFnUno5ei9USTBaOE80aFVDTjBHcStYeGM5?=
 =?utf-8?B?cEsrdllRWW8wQ1d3dHFBZGo3YVNqMVE1c0tlNVlLckU5OGdONW43RG56eEx6?=
 =?utf-8?B?TDltS2FiMERxSjY4LzFudi9wWEl1YXpUc0NzUUxObzVGdW92bituamVnMVdX?=
 =?utf-8?B?MG9ORjdzUDlqcy9CcWVTL3dLZWsvNVN0T2N4Wk03UlJSU3pwOVZNN2t0Ync5?=
 =?utf-8?B?OXVLZUtBdkMzeU9JQjFkaDhLUU5WdUViYkpSbFZUVTJLRW1SSFJFN2tURFlu?=
 =?utf-8?B?alQzdE9mOHdzaVF5czBZWGxNdi9TNHhVYVVKakxuWGJDazc0SXJJRlY0TUxD?=
 =?utf-8?B?ZlpNR05GU3pCV2c5enE3ZVJDdWdDRzNaZ09RL3o3b3I1UnpBbE5KSWVMWmRQ?=
 =?utf-8?B?SmJPZXZQemdBOVY5Z1F6MlI2aXhjWnlBT2g4cHdjNmRkdXlPcFZSNEVFRHND?=
 =?utf-8?B?N1JKSnFGWW13MTlNb2szbGRzVzFGTEhWYkN2TUdpWnF2R3A5ZStDRmg2U1pX?=
 =?utf-8?B?dk91MTlQWEF4b1ljSGlUUFhGN2d4ck1tc1Vjc2plMTBBZURaaGVteWpCRFpl?=
 =?utf-8?B?NHd1dFZCMTY0NDhGZDUvWEVzTS83OG9selAydHE2aC96YWx6c0NMcTg3dU5N?=
 =?utf-8?B?VTJ3RHpYUVBUdy9yTzdGNm00bzRwdlYva1dkcnN5NGhnbUw1Nkk5REE1ZEJT?=
 =?utf-8?B?ckl1KzFaMDBFSEY2ZnQ1WFl1a2tZVmpzMXB6NitjWEhoQkRTT1RpQ3ZGYTIy?=
 =?utf-8?B?N1VpbzZxSUZlY2pyU1ZxbEFkT3pMMkFHWS94MGZESFBVblFDWHY3VTJTNlJr?=
 =?utf-8?B?RlJlMnNlYjl5T1hxK3VoTENWWUVad1FMZTFabFptWldSTkhsbEdRVm56MXRp?=
 =?utf-8?B?QjZZMFo3Vk5lR0xIancyeklEckFQcmw3ZlhoYWVNUkMrVnpJSHZFZ01oWjBz?=
 =?utf-8?B?L0RYQVRidk1sNzg2R0RxcWh4WXNBU1IzZ3JhYU4rUzZrVmFHaUp3dHIvVllj?=
 =?utf-8?B?UUp5RHFFNCtkSU9aWTg0Q0JIN2ZVM2l2Q1pIb0Y5eldjQ3RXSjdaS1FEWjEr?=
 =?utf-8?B?bEt5Q2hTR0t6N3pZTUFjaVZHY3dmeEhzUFEvY2pEQ0t3SG9NS2tYVVdaUWVH?=
 =?utf-8?B?VlJZR09yVkRacEhFOVF1MkZ3TktXNG5YaFZ5ZzhrdGVaNTZQbEJCc25kUXpE?=
 =?utf-8?B?bzNKbnE5cmNXYit3cVlxUC9Vc0VXbWhNeDEwaGRpaTk4bzBpWXB5RXlKSU1K?=
 =?utf-8?B?aFo3RUdUaXZXaDVuVjZ0V09SdjZ1c25KbmV2Q2pMaEhlN1k4NzNGckg2aVBo?=
 =?utf-8?B?Y2h0RWx2NVBaZVBDME9KSGY3VnVCb1hsL2hwU2hEVlZmd3htTCtZYUJYbzEr?=
 =?utf-8?B?RVp0eXBvaVBwbzBKN2dyZnVyZ2dGQXRGdmdOaE1zZEJzZUVwZUNCU04vRmho?=
 =?utf-8?B?VXdaTFJOSU1peEdoU1FQcHk0R2NyRzIrWS8vT0ttLzBtZGpzL1gvVWE2aWhD?=
 =?utf-8?B?YWlmOWRxR3VHTGZ4RWdkUnZyd1h5T3dpWk5ucERnK0owRHVvZXNYTVhhZWdY?=
 =?utf-8?B?TnRBaCs4SHk1WU1sSlhDWGNsa2ZHWFFLa25ONEpJT3Y5ak5idEltTSt2RVJX?=
 =?utf-8?B?TUpqN283aW5qS0tiVWcxZz09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9192.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YVNFLzFlazBubEwrMWxwcWMwT3VxTDZvWVFFN25yN1NjSDFUVHAvY2dVSm8x?=
 =?utf-8?B?ekNhYlgzZFBITjgvakR6TDhJRnZXTkpnNG93dE9aMnlWSkt4UlpKYlE1c3BF?=
 =?utf-8?B?NkpqUTZyMitObmNUendkNVc0TklqU2R5UmVGUU5HZ3lpQlVObDRsbko5SVdN?=
 =?utf-8?B?VGFsa0xwQURBd2pWSytTQUFKMVh0T3RXdm56SFQxNVloaGIyS0o1cU1WS1Jv?=
 =?utf-8?B?NHRNRkc0VXNxeUhVR28xVk54bDdKclBMVUh5K214cFNSTUtIcG5ieXJISmJF?=
 =?utf-8?B?RU9UcU02QmZyM2VlbTRCZ1E5QXgwMU5sZW01cm5tT1hwaTJ0ZDNrVFdKajBX?=
 =?utf-8?B?NlBHRlNhbXNxNzU2TTg3cXVSTGJab2RkSFpPWmE4R29halNxMWwrQ05scnFI?=
 =?utf-8?B?RytOSDVnTWtwUXlCM2d2aWhpS0oxY3VyL0pvdFQ0Q0NueVhpTW92VTV2OEF0?=
 =?utf-8?B?ZkRhNFYrUjBmTkp4a0JoRHBHRjlQYUZZT0o2cXRtN1pmRkQ2UlhYK2QrRzZj?=
 =?utf-8?B?dTUyTyt0TXI3U1lDSE1GYllpdG15RzdiQU5DV0NUNUZ3UU1FUGhRQUNJOG1t?=
 =?utf-8?B?bFpDejZiNlpja1QxcFZwRTNuMytIdWY2dmI3cGR4QkxlUnIyaFdzWDRjUmUr?=
 =?utf-8?B?SU15U1lRN0ZaYW44STVxTVl3Vm83SE9ON20yN3ZUZ1N5VkdxTHZXRStSSWRH?=
 =?utf-8?B?UnJ4VkdEalFuNkFqT0hHTXQ5MDRtbDJoZUJTQjNuYkh2TG9zNTI3YlY5TGRJ?=
 =?utf-8?B?YWlmQjJ2ZUNOUE9LTGpNdlYrQTRIQXcvS28welJNelhBZXhoUkZ5TnRuUFZU?=
 =?utf-8?B?dEJPckF1RWN5blkzOHBOK0V0Z21PcUpRVnJVTXhRZUp6NGl2UjRONlQ2Q3FF?=
 =?utf-8?B?a1NaSXJESTJRdXVvV0liWkJDSUszNEVkKzdRdnBtY3E1T3Vmb0EwUVpnNVVk?=
 =?utf-8?B?UDFvN1VEbDNvTEt1Z05kUFYwOWdLUVdFNlhHMEpKOEFFRTR0THBNZUt4TkRY?=
 =?utf-8?B?VzlNNGwwbitUWWhEMzRNclpJVWJWeUg3OGZRVEc1SjJQdEhXdHAxMUlBV3pu?=
 =?utf-8?B?VmhJZVRaQnFJcXFxeHZrM1RyNm9YTkxjb1JMVVRmaDM0bEJKM3l5V0dXRDBa?=
 =?utf-8?B?MjFxclhMdHRzS2VwSlJkYkMyb3hkdENoTDVoTDZJaHo4cythZ0lValRiYWZ3?=
 =?utf-8?B?QkZaM0ZKL1EyRzR0ZCtWTnowYmYwc2w0OHZDZ21ZUTRGUmN0YXNRc0htZ0hE?=
 =?utf-8?B?ZFF2ZHpqc3pUWk8ra2VKc0hOQTdHN2ZncTVoOVRmTWZLcVpVdEdiT3hySUlQ?=
 =?utf-8?B?SkVtdDhuVEkweVpnUGtxdW1SUFRyby9WcHovNnB1aVFxendjN2ZvRDZpUXNQ?=
 =?utf-8?B?WDZWNzlrQzhkZUJxRUVTWElEcWw2SytHdktmYUFra3Bqck1hNzFBL3d4N0ZO?=
 =?utf-8?B?ZGIyVHQzVGpJTFJ5SFdoa2lvakVoN2IyQWRuM29QT3dDaXVLbHhaM0VTdUg2?=
 =?utf-8?B?dUZUWUN3Y3d4ejZrR2thSVJFSEg2ZURIUG5CSldKcGVrakVVY3hva20vaHA0?=
 =?utf-8?B?YnlXaCtUVjVJN0E2R2wrZU5NQnJmcEZjbE43SlVVSHhIOHVTNkl0MHJ1bTRu?=
 =?utf-8?B?dFRyL2cvdUJMN0hybUJ2ajhzMnlFRExRbTUxUnJSUDJDaXlsZUZxR1NFaCtw?=
 =?utf-8?B?Q09VbGY0T3hlSFZEK0VMNXpPQTBkWldwREFnbktPS05IQ1grRG1jeGF0Qlox?=
 =?utf-8?B?MG5ublNJRnN4M0QvQVFobGFWY0lkZDFNVW83Q0dhQVNpNkNRZTRFdGNFRUJH?=
 =?utf-8?B?UTFlRlZPWitMWHl4aWtHVWhQTW91UkphVTY4a1A4Yms3dDBxdStCeUdoNFUw?=
 =?utf-8?B?RWprK1o5Q3VuMTgySnZmSmFLcVphZHhqZ2t1aUtsb3R4UjlCeEdxK1VBVzQ3?=
 =?utf-8?B?ZFc2NnJaVkNrWjBybGZwSjlqcnFJQWVPTjUxWmNIMng2Y1VxUmphejFFVE5V?=
 =?utf-8?B?SWRYdW5VdDhoblZ2TUdmQnlYTlRMQU9EN2pYRGxxdENzQUZLQTN2dWJxbWc4?=
 =?utf-8?B?VDMvcGZUUFQzTGF1cnFjd0hJaW5JbW1TdDdyRXBxUW5adk5OcFpqeGo5T3hu?=
 =?utf-8?Q?edymSb9jvs3tWxoGWXKPoAck5?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3eb0f67d-5492-47c1-ba2e-08dcb540c5de
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9192.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 11:21:38.3423
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: TtWA2w4Qh3TFB/SNmElcLDpz7wvxTJW0SWUXZxsvk2x4izTuzSQ1uioLTFoSoIW0AbmhkJ32zourhu2TooaRmQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB9984
X-Proofpoint-ORIG-GUID: fsftyIa1HtjalZcxnwoPmrmwCtOpIaFW
X-Proofpoint-GUID: fsftyIa1HtjalZcxnwoPmrmwCtOpIaFW
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16
 definitions=2024-08-04_14,2024-08-02_01,2024-05-17_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0
 priorityscore=1501 mlxscore=0 spamscore=0 bulkscore=0 mlxlogscore=964
 impostorscore=0 lowpriorityscore=0 adultscore=0 clxscore=1015
 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.19.0-2407110000 definitions=main-2408050081

31.07.24 15:29, Jan Beulich:
>> @@ -326,14 +328,14 @@ static inline void __core2_vpmu_load(struct vcpu *v)
>>       if ( vpmu_is_set(vcpu_vpmu(v), VPMU_CPU_HAS_DS) )
>>           wrmsrl(MSR_IA32_DS_AREA, core2_vpmu_cxt->ds_area);
>>   
>> -    if ( !is_hvm_vcpu(v) )
>> +    if ( !is_vmx_vcpu(v) )
>>       {
>>           wrmsrl(MSR_CORE_PERF_GLOBAL_OVF_CTRL, core2_vpmu_cxt->global_ovf_ctrl);
>>           core2_vpmu_cxt->global_ovf_ctrl = 0;
>>           wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, core2_vpmu_cxt->global_ctrl);
>>       }
>>       /* Restore MSR from context when used with a fork */
>> -    else if ( mem_sharing_is_fork(v->domain) )
>> +    else if ( is_vmx_vcpu(v) && mem_sharing_is_fork(v->domain) )
>>           vmx_write_guest_msr(v, MSR_CORE_PERF_GLOBAL_CTRL,
>>                               core2_vpmu_cxt->global_ctrl);
>>   }
> Same here. With those dropped (I could do so while committing, as long as you
> agree):
> Reviewed-by: Jan Beulich<jbeulich@suse.com>

oops, these are leftovers from prev. patch versions, not needed anymore ofc.
As there'll be v6 of this patch series I'll fix it then.

   -Sergiy


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 11:31:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 11:31:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772055.1182490 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1savvs-00020n-As; Mon, 05 Aug 2024 11:31:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772055.1182490; Mon, 05 Aug 2024 11:31:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1savvs-00020g-8H; Mon, 05 Aug 2024 11:31:20 +0000
Received: by outflank-mailman (input) for mailman id 772055;
 Mon, 05 Aug 2024 11:31:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3WU3=PE=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1savvq-00020a-L1
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 11:31:18 +0000
Received: from NAM02-SN1-obe.outbound.protection.outlook.com
 (mail-sn1nam02on2060b.outbound.protection.outlook.com
 [2a01:111:f400:7ea9::60b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 39f2387c-531e-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 13:31:17 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by DM4PR12MB6112.namprd12.prod.outlook.com (2603:10b6:8:aa::7) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.7828.26; Mon, 5 Aug 2024 11:31:12 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7828.024; Mon, 5 Aug 2024
 11:31:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 39f2387c-531e-11ef-bc03-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=N5tkki6hrPX0/lymnq8se9V5BXsrV6JtBDsF/lI8h1d9XZab79uvlUWEwDm8yqBw1XBN3Ua4KNsiaR7ZIZSfGB8bJ9OwJA2gXeu/gJEokc4AiaqP8+3hFzfa1nEDrfR9Dy4i0NQjgBauNeXjNJrzA8NxXjcTOM5xnPdvW0FhXa3+jIXXvYmhoSP2uj+Dr6rT1PYiqvFdXKUHLt/iu9vUJMfDgMctUAjPqmTc9rrEDntgrTpIwXozIKhTsUYlug9FPJDxf4QMbbzns9l57LERK8OMFsSMzzS+9Yh8N+BNNrItME+oYnul+Nh+e4NlXGISnLiIOFdQ7OA7ShszcN2QJA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=6B5PZ2cRTgSOdnor8+eA0UOSNdKeHF5CTrgg5bm8jbw=;
 b=cqoo8Conky28Z49f9lZVKHXKnJ9B5alctNq8jQIRgmRL3qM2CXzD25jl5enyw0oLRg3YAbcLzGJMTYiq0TC4cb7YkXlQ7/MTbkxLJR5hnstQBBg75h0ARR9QJyRdwLPdcyg6KrBdsc4ON6CJI/jdY8QnVEbs2QNPV6zXJU+liCBXW7Jp3rb4PX3J4fcapbX4QAgh+V90CLAn7E3zXNor+aJm+ADwe8MFXR2JKjlIJltTFkRoZYQPVEToyQ0CvzxO8CQnUChEu481yfa1qkQ8A590KEGYdUe8GNzc6o32cxKHCpTNYjKIFDq7Snff4UJq/iCBAgx3mrVoOKFCKH8JrQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=6B5PZ2cRTgSOdnor8+eA0UOSNdKeHF5CTrgg5bm8jbw=;
 b=jDwjfEhbw/foUB8OKf6wC/5LEv/h81LwLJch7/A5TstRCdJWVi2aP0ixXLxfaQeF7xkwYM+94uY+MopOLjCy6cYT5haqCv/t7UqQnrBKmh72Z/2frSziOp2uo2sxfT1tvjxeVjRWSYVOkFusqrZYeIHJvVo6170AYE4rOYKv+Bc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <1f151a72-711a-4e84-ba4b-182a3f26601a@amd.com>
Date: Mon, 5 Aug 2024 12:31:07 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 3/4] xen: arm: Move the functions of domain_page to MMU
 specific
Content-Language: en-GB
To: Julien Grall <julien@xen.org>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com
Cc: xen-devel@lists.xenproject.org
References: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
 <20240802121443.1531693-4-ayan.kumar.halder@amd.com>
 <de98dd2d-7516-4e7a-ae96-903479f5b179@xen.org>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <de98dd2d-7516-4e7a-ae96-903479f5b179@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0234.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a6::23) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|DM4PR12MB6112:EE_
X-MS-Office365-Filtering-Correlation-Id: 859829ad-d01f-42c5-4c9d-08dcb5421c39
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?OUVtSmplVFpubUJSM0JXYnVTRHlTL3pCZWVFUlo5ZXowWFF0cDBGZ0ptNXpU?=
 =?utf-8?B?RXJ3OGc2SmIwVDZLc0pZRXdBWk51RWhyWDNhb1hkNDYxaGRHWDVjMGhsdlZo?=
 =?utf-8?B?UWlZOTB5VExDZWFHc2JMQkYvK2h5QTUvcUptTVFwT3RhNTJQRXc1ZmZQTGJi?=
 =?utf-8?B?dnZHb2ZnS1AvbVNlQUl5dElHREgwM0FwbzJMaDRHSDMvRGlKU0pVVkN6WU1H?=
 =?utf-8?B?TnQ3RlBLWWhjc2QxVS9YOVpTbUdiZ1I0MlpDYlZobmhYWjVFamJOQ2NkWjBt?=
 =?utf-8?B?UlZhdDFMRWVKVm1yRFZaaGlkOW44ZjMvbW5CamtMV2VneUtmcEV6NFhTc20y?=
 =?utf-8?B?b3ZpSmQ0eEJ1WmpRZXRML21sK2ErUk5Sanhud0pWdUtscVcwaVdweUZIUmFn?=
 =?utf-8?B?NlZucFFLSnY4ckFONndRZWJnS1BjM0E4UFp4dDZSOG95SnpMWVF6SWpQSUhy?=
 =?utf-8?B?U3F6ZmMxQThOZm52b0h4M2QvUlczeW5oUHlKOG9tSWd0eFNreDNuMWppbzhm?=
 =?utf-8?B?ZEQ2RUVZbmFtSnNpYzVVN2FOb3hETkZGTHhhSHB3czFXSTFpRmtGRE5Leld6?=
 =?utf-8?B?TkJtL0ZIdTRVL2JqcUY3YzJXdjNRL1JockVMM1h5MWNseExHRVQ0cXZrU3RL?=
 =?utf-8?B?RUthcjVuVVd2RGNhZzZIN3I1NXU5ZkhiVmtXOHFZRmVKYjUzbGVvYlNQQ3FB?=
 =?utf-8?B?d1JiR09DOUhJS0drTXZsakloWDE5emFnUUtLZ0F3MDBmb1Foazh0WHZ2TXdv?=
 =?utf-8?B?V3dSVk1rTzJuUFJLTjhWK3VwWk10L3RUTTM0SnpKa0MyOENtS0FidHcwVW8z?=
 =?utf-8?B?WkJvdU1rQVVINHBzaUg3UEFNSDFZb3ROdUN2bzdTemRjSDQ4MGRyaTlva1ZS?=
 =?utf-8?B?THZGR0xNNzIrVEZrckMrbzRvdlZXRXp6aFlJdlpTYmpUUnJtQSszcmh6NDdV?=
 =?utf-8?B?blJnbWhJZWFmczhIWlpUclhyN2Y2dWJsS3BIWm9nY0lBa3QzcDBDcFRIOHlZ?=
 =?utf-8?B?cjZKb3RxZ3hpeWRaVjBqT2VBbnVGaU1XYTlmK20rMDVVV3V0eTFxMWhPaGNn?=
 =?utf-8?B?MkIzWjZ5alRWSVZhS2xzV1BTUVFjOFJudDE2TEJTaGNUSSsvdHoxVjVwYW5D?=
 =?utf-8?B?dHBCUmpib21LbHdYUDFBY2JYekZCWkNOSHBaYzdXZWVLODl4RlR3RVN4SE5r?=
 =?utf-8?B?YXZYb2lJZjdFaHpSbmNnck1WUmR6NFhQQkZqSlBTZ1o1UDEzblR1aUFMLzJQ?=
 =?utf-8?B?ZGlwZGFEdklUd20vYTM3eHJLWHNYZ0xXNG5uOHlpRkVtYnhBWDRnUCtVc1Ay?=
 =?utf-8?B?ajlQUnh5N3NvUUxKWnlWdU5vTi9hN1JKeTRBMHNBNkR1UWpUL1RzKzlrWHFm?=
 =?utf-8?B?bXJqMEdDcTVFVzBBaFNFTjVMSTBjbStwdXJMTWZFcjJ5MmVUM1FZUEJwRkNo?=
 =?utf-8?B?OGh3UENRRHNabEhIWEhwM09FRVZvY1M0T3dBK3ZlbmNtWVVUeW4ybnExK2pS?=
 =?utf-8?B?TUl2MkdQSXVrbGg5MHFUczhrdzFYVmk1eHUvYndTNGlPT0Q3SnJWL2hYUy9W?=
 =?utf-8?B?N1hBd05yUGo0UHkvb0t0SStxRUZhamZVc0hUdWNUMmpCTDIzbU1xTXVFb0Mx?=
 =?utf-8?B?TTFubm9Vcmxvem1tRWJ3MHB3OGkvQ0NiWDllbWpNdTdHVVNVUnRKYTVnMVcz?=
 =?utf-8?B?WVpzUENxUThXVCsydkN0QVhYMUlMR0JmKytmbmZpMndrQytnY1NJUEZoaVNN?=
 =?utf-8?B?R3d5WDY1MUNVMVo3WXZxSUIyWVNrZGw3OTRTQ1JhSWNFTk1ZTE8yMTFsREtL?=
 =?utf-8?B?U1Ywd2hZcFlLd3FhcDF6QT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?bHNNZ1NYMnNMSDdCNEorN2RmUTlscXFMM0VhZytRM3dkcGI0VG5tVUJwdFo4?=
 =?utf-8?B?UDR3T24rMEZBWlMxS3p2ejF5NmRiYjFFUXdxODJUekx6ZUZoNVA0ZnZXMWFh?=
 =?utf-8?B?eWowSVFERHpkLzNYWDRMYThacGovSWsyVm5uV2dZKzYzaVRVM0gwS1pOSVRS?=
 =?utf-8?B?U0VwcEY3eE1qR1NrTXRuUm5KbGRpakM1Wmh1YTIwUG1YVFdiRWlYVWxBZXpV?=
 =?utf-8?B?WEVxbytlT0ZPeXA1US9tcldpT2Nnd0VjWGgrc2Q4b0N4cnEvemJUcENBTDhD?=
 =?utf-8?B?ZnFNUGRHZjc2ZlUzQUVIc3NzLzczYmpHMUI4M21jWm9jbUx2RVFIcWZwUjI1?=
 =?utf-8?B?Zm51YSt1RDRCOEQ4c25tZnRsMERFK1lqWk4zcTNCTGFndzQxU2NlcGNjWFBt?=
 =?utf-8?B?MVZrQVFVUFg3ZmhBY2c4R1hLWG1EMFVrRFQyZTlxSlRMRVd3U3JUb2pRaEEw?=
 =?utf-8?B?RWtIMVRrdHlTUEFpVmNnTW5mby9pRThkaHo2MExVaHZJNUpwbmlYbjB3Y0s1?=
 =?utf-8?B?eTRNZ21Eby9adXdDRXUrYlVieHpSUUlBL1Q3dzlIdStBd2o4VWZWRTA3WXpI?=
 =?utf-8?B?c1FnL2dFbTFCWkl6WjZwamJwbEpUdXRkeGw0c1prSXRSMXNSMkFDRVYzVTVT?=
 =?utf-8?B?K1N3ZDZBNitkaEU2RjlYeXIxNVZ5Z0ZxVHVwa3FWRXE2NHBDM0t4ekVFL25D?=
 =?utf-8?B?SFNVWGlMMUxQV09ORHF4NUxZRnBJR2c2UnVubk9UaTRrVzFtb0ErV3oxUWtM?=
 =?utf-8?B?MDNnTDRRajZWb29hYVNWTGtJUFRFQnZBb1RON2ZzUEFwRUIxU0VUTGtRaEUy?=
 =?utf-8?B?dW1ZbFViOEw1SWh0WEpSQ29Qb3ZkRTFwU085N045cHZXcjgzcUVYbmNjc2RR?=
 =?utf-8?B?MUErWXdmeFo5ZUtrQmFoeVhOUkcxQ0tJenYvUWdCQm1YMFU2UGc3VDUrQ25K?=
 =?utf-8?B?WUsrbFpvdExTdzhZUFcxTitselRVQTJwYkR4dFA5M3c5VXhsSStublFROTk3?=
 =?utf-8?B?aUlwMlpxMlJtRzBlY25oS0d6ZEdMNFJOREpBK3JmOEZ4MHZWSEhMTENmNEZ2?=
 =?utf-8?B?alpkYXdQU2hNRUZTR1BHNkpzSi9HUExINEhNMUpjcTZlQUJSUDhWN3FjblFO?=
 =?utf-8?B?MkZtN0ZNaWRTZjF4VUVzbDFEVno2SktSVU05Q2xlVFhnSEE3OWI1dytLUW9x?=
 =?utf-8?B?YXhsc0FiNE85b0tCcTFyZ0srNWJtemVreGxlV3NXOGpkQSs0cFZtc0EyTUJG?=
 =?utf-8?B?OGtDQVFaVDFTMjBUWHpPL3lyVmszVVRZV0pTckQxd203R2xubGJNRkRKM1Z2?=
 =?utf-8?B?S2pFMGQzZW05VTUxK1dRVkYxR0ZNb1diaVBOVi9QeXF4eVJOaGY1ZkZWNVpY?=
 =?utf-8?B?T3JGbEVEcnBmT0RMYnRPdXVZYzNadjZ5c28xK0tHVWgvNWFsNVYyd1R3MjAy?=
 =?utf-8?B?dDdUOEhhcW02UnQ1WVNoeVR6K3pPWlRIaUxpUVp1RFI5SmJQUk5lTEI4RUxt?=
 =?utf-8?B?TEVrMHBmYmI2cHBoemVHZExyZ2hRb0NjaWtva1FiMkhWeWI3TVBuU3pGZFdZ?=
 =?utf-8?B?cGQyUmlaNGNNdVB3K2xDWWtLYnIycTNFZHJxdmc3MGFXbnhKMmM0UHFxVE1x?=
 =?utf-8?B?NG1oYnhEWnM5T3E0Qm9ZZlFndG5aR2tENkJrUlllQjFMME5jdm93VVhIdS9G?=
 =?utf-8?B?bTc4Y0xlN2xNWVdrK3VhVmdQRW5FVVVvTml5UXpONExEdXB1eVM4WU9CQUhF?=
 =?utf-8?B?ZFpGZWJ0MEIxMXpaU0FqaEYzeXUwZkxaQkpiR2ZxVUtBemprelB0NytYaThK?=
 =?utf-8?B?ZnJwNjFrbjIvKzdxZG1lK2tvckZidEdvV3VMcWtXWHZCenhmYldtalFWTEJ6?=
 =?utf-8?B?cC92amo0RFJXRm43NTFuU0pzVzZrbzdyZGg0Ly9MQ2tJTmhRcVZrOHp0Qmdl?=
 =?utf-8?B?SXF2Ym5xY3VDanBreEtaMHQ4QzY3dkM5aW5pOGZPQjVDekFDQ3ZRdjBhaHUr?=
 =?utf-8?B?Y3YvemxrU2xraWw4Ny90Y1BUWkFFMkhGSnMyVEVQRWdxL1d2ODBXakF3VWti?=
 =?utf-8?B?OGlza3dOYnlMQ0Z5OCs1NjNMNnB0czJldnZBeng0Z0RRWmc2cklHSGVFSkl4?=
 =?utf-8?Q?ZYYm6CTeD59zkhwZ5Ctrf8UUK?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 859829ad-d01f-42c5-4c9d-08dcb5421c39
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 11:31:12.6854
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: GFGf+NNRZ09L18TmwKjs0C3v8lTG5WcGFsCxQe6LCrrn5ismAmM/mkf5uJvTpQcCcZDbpGQivv87SYB8ybFmuw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6112


On 02/08/2024 14:33, Julien Grall wrote:
> Hi,
Hi Julien,
>
> On 02/08/2024 13:14, Ayan Kumar Halder wrote:
>> Moved init_domheap_mappings(), map_domain_page_global(),
>> unmap_domain_page_global(), map_domain_page(), unmap_domain_page(),
>> domain_page_map_to_mfn() to MMU specific folder.
>>
>> On the top level, we have added stubs which will invoke the
>> MMU specific equivalent of these functions.
>>
>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>> ---
>>   xen/arch/arm/domain_page.c          | 161 +----------------------
>
> Looking at what's left in domain_page.c, we seem to have just a series 
> of stubs:
>
> bool init_domheap_mappings(unsigned int cpu)
> {
>     return init_domheap_mappings_mm(cpu);
> }
>
> void *map_domain_page_global(mfn_t mfn)
> {
>     return map_domain_page_global_mm(mfn);
> }
>
> void unmap_domain_page_global(const void *ptr)
> {
>     return unmap_domain_page_global_mm(ptr);
> }
>
> /* Map a page of domheap memory */
> void *map_domain_page(mfn_t mfn)
> {
>     return map_domain_page_mm(mfn);
> }
>
> /* Release a mapping taken with map_domain_page() */
> void unmap_domain_page(const void *ptr)
> {
>     return unmap_domain_page_mm(ptr);
> }
>
> mfn_t domain_page_map_to_mfn(const void *ptr)
> {
>     return domain_page_map_to_mfn_mm(ptr);
> }
>
> The indirection seems unnecessary to me. What about renaming 
> arch/arm/domain_page.c to arch/arm/mmu/domain_page.c? Then, for the 
> MMU you can implement unmap_domain_page() & co rather than suffixed 
> _mm ones.

Makes sense. I will do this way.

- Ayan

>
> Cheers,
>


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 11:36:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 11:36:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772064.1182501 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saw0h-0002gk-UH; Mon, 05 Aug 2024 11:36:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772064.1182501; Mon, 05 Aug 2024 11:36:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saw0h-0002gd-R0; Mon, 05 Aug 2024 11:36:19 +0000
Received: by outflank-mailman (input) for mailman id 772064;
 Mon, 05 Aug 2024 11:36:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=006L=PE=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1saw0h-0002gX-A5
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 11:36:19 +0000
Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com
 [2a00:1450:4864:20::231])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ee4dc5b9-531e-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 13:36:18 +0200 (CEST)
Received: by mail-lj1-x231.google.com with SMTP id
 38308e7fff4ca-2ef248ab2aeso145693781fa.0
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 04:36:18 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9bc3d09sm447203566b.17.2024.08.05.04.36.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 05 Aug 2024 04:36:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ee4dc5b9-531e-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722857778; x=1723462578; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=ipK8rpT6JL15t4PadxePzMqWe6QKOf6oB0X7YmhdJJk=;
        b=Sn3lGiRgZGH0gMzhPzgw2Hazya7ai7g5KubpvRuywA8gghaKPIGQtslz23sK9BnrOs
         juBqueZaqBjRPDw2Hbo8FYzHnaBARUhGbFreTSXZXzz/bE121KD6Txn9Y5LezB1wM0ux
         X+0hi/7rI54KmMCehhAhxeLH7sh8neROvjVriLkkUaec3NNp1VT1aOCp47wWBdw3iEPU
         dMRjucmYP4GPQwcn94NjeFkIChzkU7ogPjmILpUZ5gr08lC3XaImxAFNxK2TnBLYgiql
         twUXdoXqPw9z+n64E7Y1yIcXfpLcqOLBL2gES5VKyIWJI8LR+h3HoO26ZvtNFNCpT2xJ
         gZQg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722857778; x=1723462578;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=ipK8rpT6JL15t4PadxePzMqWe6QKOf6oB0X7YmhdJJk=;
        b=P4nS4lpbKWuWUUrN5I4/1IjL8O3thvUjYuSV6vI6XnBHdUkwpKz9RBDwtcQTwIvCo2
         TwWygoQIQNuZ4XfMwo5Car0VWtSCP/UyflAlvAFvuocVbu1qct+36eeFZKx30TCjNxH/
         nmO6eStp5tKBSxjfECqGtT9LerlpHVjMRbLFqC3ewrOHoADc3GxnJbyA1Sqa+OURavkc
         fLZsXw3zviPeZaBev3fqYElItmjiVZo4hTaU/6Fn3Au/yxidxHeHdeF5EWADqRwfvj51
         lPETBucDruuCNtcmeeZHrFAOUUXhc9yaWVwzuD39rnL+mB1bydzk+PkUplcyYOcBsjcu
         0c5A==
X-Gm-Message-State: AOJu0YxZapNJTcQIS/NOv6+31+lvmn04IV9nvz5DTsfQ4lg/3dsWGfjS
	1zBxFIj26qW8dSvvXKAkIb5m2TH/ykXWGNnHdvg9sF0RS2YxD6fGvuQj0Q==
X-Google-Smtp-Source: AGHT+IG/EUrZB1s+boULShzWOU4O8V6niAQh8YhveqHwV/yM1gQwEiTi8omSnvtvpgAOJGA4wY152w==
X-Received: by 2002:a2e:b164:0:b0:2ef:226e:e150 with SMTP id 38308e7fff4ca-2f15ab2a5c0mr85483951fa.32.1722857777202;
        Mon, 05 Aug 2024 04:36:17 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: [PATCH v1 0/2] Common device tree stuff
Date: Mon,  5 Aug 2024 13:33:48 +0200
Message-ID: <cover.1722856894.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The current patch series introduces the common device tree functions
between several architectures: Arm, PPC, RISC-V.

Originally these patches were a part of Shawn's patch series [1].
At that moment it was v4 version of this patches.

After RISC-V started to need this changes these patches have been
rebased on top of the current staging with addional updates after
rebase.
For some time, these patches from v5 to v7 version were the part of
the patch series [2] but not to block almost ready patches for merging
it was decided to move them to separate patch series.

[1]
https://lore.kernel.org/xen-devel/cover.1712893887.git.sanastasio@raptorengineering.com/

[2]
https://lore.kernel.org/xen-devel/cover.1721834549.git.oleksii.kurochko@gmail.com/

Shawn Anastasio (2):
  xen/device-tree: Move Arm's setup.c bootinfo functions to common
  xen/common: Move Arm's bootfdt.c to common

 MAINTAINERS                             |    2 +
 xen/arch/arm/Makefile                   |    1 -
 xen/arch/arm/bootfdt.c                  |  622 -------
 xen/arch/arm/include/asm/setup.h        |  198 +-
 xen/arch/arm/include/asm/static-shmem.h |    9 -
 xen/arch/arm/setup.c                    |  432 -----
 xen/common/Makefile                     |    2 +-
 xen/common/device-tree/Makefile         |    3 +
 xen/common/device-tree/bootfdt.c        |  635 +++++++
 xen/common/device-tree/bootinfo.c       |  459 +++++
 xen/common/device-tree/device_tree.c    | 2253 +++++++++++++++++++++++
 xen/common/device_tree.c                | 2253 -----------------------
 xen/include/xen/bootfdt.h               |  209 +++
 13 files changed, 3563 insertions(+), 3515 deletions(-)
 delete mode 100644 xen/arch/arm/bootfdt.c
 create mode 100644 xen/common/device-tree/Makefile
 create mode 100644 xen/common/device-tree/bootfdt.c
 create mode 100644 xen/common/device-tree/bootinfo.c
 create mode 100644 xen/common/device-tree/device_tree.c
 delete mode 100644 xen/common/device_tree.c
 create mode 100644 xen/include/xen/bootfdt.h

-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 11:36:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 11:36:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772066.1182521 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saw0o-0003DQ-HM; Mon, 05 Aug 2024 11:36:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772066.1182521; Mon, 05 Aug 2024 11:36:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saw0o-0003DJ-DX; Mon, 05 Aug 2024 11:36:26 +0000
Received: by outflank-mailman (input) for mailman id 772066;
 Mon, 05 Aug 2024 11:36: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=006L=PE=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1saw0m-0002gX-1D
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 11:36:24 +0000
Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com
 [2a00:1450:4864:20::633])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id efd89e98-531e-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 13:36:21 +0200 (CEST)
Received: by mail-ej1-x633.google.com with SMTP id
 a640c23a62f3a-a7aa086b077so909875166b.0
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 04:36:21 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9bc3d09sm447203566b.17.2024.08.05.04.36.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 05 Aug 2024 04:36:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: efd89e98-531e-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722857780; x=1723462580; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=+uwf35f2uh+P4NAcFH5aNGBxpK9iZWsUOlZHCgKO8Bw=;
        b=c7F9+QtOKxGYfFQhx+w5dfxh6s+bu8aviajo5NSkI2pG1mqC98Zl1mBSZ39WhfmgE+
         LK/88EAX54sLngAiujigNxbRy0OWbDGTdTCjbcffxHyNeXheVpX7wJ5BqKw0KtpxQiWg
         j2lCrG71mNT6gQoZlxUg2+kCalUH2g2CMeR3L8FsZ7lOw1AK+TBOelfcm5v7pCren2rY
         Vkj7vNG0iczdKQsjH6QJsN8n6VyDNkBf1S169ADOQK/5+6TCwoPUGGmx2kEnGLvpmU2F
         E69W5fHpuMJAVGh4NiGgc4BsiEYKCO28xZI7lbeKF09Qo5La0LGII10UImDd2w8tmG28
         Uh8Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722857780; x=1723462580;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=+uwf35f2uh+P4NAcFH5aNGBxpK9iZWsUOlZHCgKO8Bw=;
        b=Wuvoz2zlHGeM0WzAovVfO7aaKQpsH0Uj+MplC/a78AQ9Srma1EN3uEV82Oq+7LztIi
         MgiiTW2qIkhYkOB42QaGW496pmJDCpIL1hQgiSHBXzT3DRkbYS5mIXJNUZ1Zym/F6OFa
         0QDyXMcOOULCZw+K0hor6UUdI6a5tVg0+LhB6Qkukz3vN1YkhQNDShs+kS5qx5ithtWv
         ifOF2kznLs03IRMmuysoq5QHL8lB1X0UIJtRFb16et11BTIgeOIW0jrH4hOkI3YfLXqu
         WFN6ITBxFfPtzA59TgwTzjaODycbT7HdoWDLC6ZYQTGLZmg6l3Q0pkmDz9enmqapwoFP
         0ZHA==
X-Gm-Message-State: AOJu0YzYqkBZIkLmu7B3eJwtYtpNi6+WRmNSTVGO+05DV8wtwV6xUi47
	YMROarNh5xCn1+aPY0TVodEHmtUskLjmLuYDfNeWc4aOwxkpsHepGngIJQ==
X-Google-Smtp-Source: AGHT+IHFInaNVckdbcZwW/fxMAd4ox59V2w8M55zeT7L4zWL+LVCTPw1NzaIh5aRRcZMiGPBGgSTeg==
X-Received: by 2002:a17:907:724b:b0:a77:b516:3023 with SMTP id a640c23a62f3a-a7dc4db2a1emr801298866b.4.1722857778733;
        Mon, 05 Aug 2024 04:36:18 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Shawn Anastasio <sanastasio@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v8 1/2] xen/device-tree: Move Arm's setup.c bootinfo functions to common
Date: Mon,  5 Aug 2024 13:33:49 +0200
Message-ID: <712aebb98a689b248f29e783eb8e72a5e7568e5b.1722856894.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1722856894.git.oleksii.kurochko@gmail.com>
References: <cover.1722856894.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Shawn Anastasio <sanastasio@raptorengineering.com>

Arm's setup.c contains a collection of functions for parsing memory map
and other boot information from a device tree. Since these routines are
generally useful on any architecture that supports device tree booting,
move them into xen/common/device-tree.

Also, common/device_tree.c has been moved to the device-tree folder with
the corresponding updates to common/Makefile and common/device-tree/Makefile.

Mentioning of arm32 is changed to CONFIG_SEPARATE_XENHEAP in comparison with
original ARM's code as now it is moved in common code.

Suggested-by: Julien Grall <julien@xen.org>
Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Julien Grall <jgrall@amazon.com>
---
Changes in V8:
 - add the version of Xen from which bootinfo.c was derived from.
 - update the commit message.
 - add Acked-by: Julien Grall <jgrall@amazon.com>.
---
Changes in V7:
 - move obj-$(CONFIG_HAS_DEVICE_TREE) += device-tree/ to proper place in common/Makefile.
 - rename macros __XEN_BOOTFDT_H__ to XEN_BOOTFDT_H to not violate MISRA rule 21.1.
 - drop definition of "#define MAX_FDT_SIZE SZ_2M" in xen/bootfdt.h as it is expected to
   be arch-specific. Back "#define MAX_FDT_SIZE SZ_2M" to arm/setup.h where it was before
   these changes.
 - git mv xen/common/device_tree.c xen/common/device-tree/ and update correspondingly
   Makefiles of common/ and common/device-tree
 - update the commit message
---
Changes in V6:
 - update the version of the patch to v6.   
---
Changes in V5:
 - After rebase the Shawn's patch v4 on top of current staging the following
   was done:
   - add xen/include/xen/bootfdt.h to MAINTAINERS file.
   - drop message "Early device tree parsing and".
   - After rebase on top of the current staging the following changes were done:
     - init bootinfo variable in <common/device-tree/bootinfo.c> with BOOTINFO_INIT;
     - update the code of dt_unreserved_regions():
         CONFIG_STATIC_SHM related changes and getting of reserved_mem
         bootinfo_get_shmem()
     - update the code of meminfo_overlap_check():
         add check ( INVALID_PADDR == bank_start ) to if case.
     - update the code of check_reserved_regions_overlap():
         CONFIG_STATIC_SHM related changes.
     - struct bootinfo was updated ( CONFIG_STATIC_SHM changes )
     - add shared_meminfo ( because of CONFIG_STATIC_SHM )
     - struct struct membanks was update with __struct group so <xen/kernel> is
       neeeded to be included in bootfdt.h
     - move BOOTINFO_ACPI_INIT, BOOTINFO_SHMEM_INIT, BOOTINFO_INIT to generic bootfdt.h
     - bootinfo_get_reserved_mem(), bootinfo_get_mem(), bootinfo_get_acpi(),
       bootinfo_get_shmem() and bootinfo_get_shmem_extra() were moved to xen/bootfdt.h
   - s/arm32/CONFIG_SEPARATE_XENHEAP/
   - add inclusion of <xen/macros.h> because there are function in <xen/bootfdt.h> which
     are using container_of().
 ---
Changes in v4:
  - create new xen/include/bootinfo.h rather than relying on arch's
    asm/setup.h to provide required definitions for bootinfo.c
  - build bootinfo.c as .init.o
  - clean up and sort bootinfo.c's #includes
  - use CONFIG_SEPARATE_XENHEAP rather than CONFIG_ARM_32 to guard
    xenheap-specific behavior of populate_boot_allocator
  - (MAINTAINERS) include all of common/device-tree rather than just
    bootinfo.c
---
 MAINTAINERS                          |    2 +
 xen/arch/arm/include/asm/setup.h     |  185 +--
 xen/arch/arm/setup.c                 |  432 -----
 xen/common/Makefile                  |    2 +-
 xen/common/device-tree/Makefile      |    2 +
 xen/common/device-tree/bootinfo.c    |  459 ++++++
 xen/common/device-tree/device_tree.c | 2253 ++++++++++++++++++++++++++
 xen/common/device_tree.c             | 2253 --------------------------
 xen/include/xen/bootfdt.h            |  195 +++
 9 files changed, 2913 insertions(+), 2870 deletions(-)
 create mode 100644 xen/common/device-tree/Makefile
 create mode 100644 xen/common/device-tree/bootinfo.c
 create mode 100644 xen/common/device-tree/device_tree.c
 delete mode 100644 xen/common/device_tree.c
 create mode 100644 xen/include/xen/bootfdt.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 7c524a8a93..96adf60671 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -291,9 +291,11 @@ M:	Bertrand Marquis <bertrand.marquis@arm.com>
 M:	Michal Orzel <michal.orzel@amd.com>
 S:	Supported
 F:	xen/common/libfdt/
+F:	xen/common/device-tree/
 F:	xen/common/device_tree.c
 F:	xen/common/dt-overlay.c
 F:	xen/include/xen/libfdt/
+F:	xen/include/xen/bootfdt.h
 F:	xen/include/xen/device_tree.h
 F:	xen/drivers/passthrough/device_tree.c
 
diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index c34179da93..1748be29e5 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -3,159 +3,11 @@
 
 #include <public/version.h>
 #include <asm/p2m.h>
+#include <xen/bootfdt.h>
 #include <xen/device_tree.h>
 
-#define MIN_FDT_ALIGN 8
 #define MAX_FDT_SIZE SZ_2M
 
-#define NR_MEM_BANKS 256
-#define NR_SHMEM_BANKS 32
-
-#define MAX_MODULES 32 /* Current maximum useful modules */
-
-typedef enum {
-    BOOTMOD_XEN,
-    BOOTMOD_FDT,
-    BOOTMOD_KERNEL,
-    BOOTMOD_RAMDISK,
-    BOOTMOD_XSM,
-    BOOTMOD_GUEST_DTB,
-    BOOTMOD_UNKNOWN
-}  bootmodule_kind;
-
-enum membank_type {
-    /*
-     * The MEMBANK_DEFAULT type refers to either reserved memory for the
-     * device/firmware (when the bank is in 'reserved_mem') or any RAM (when
-     * the bank is in 'mem').
-     */
-    MEMBANK_DEFAULT,
-    /*
-     * The MEMBANK_STATIC_DOMAIN type is used to indicate whether the memory
-     * bank is bound to a static Xen domain. It is only valid when the bank
-     * is in reserved_mem.
-     */
-    MEMBANK_STATIC_DOMAIN,
-    /*
-     * The MEMBANK_STATIC_HEAP type is used to indicate whether the memory
-     * bank is reserved as static heap. It is only valid when the bank is
-     * in reserved_mem.
-     */
-    MEMBANK_STATIC_HEAP,
-    /*
-     * The MEMBANK_FDT_RESVMEM type is used to indicate whether the memory
-     * bank is from the FDT reserve map.
-     */
-    MEMBANK_FDT_RESVMEM,
-};
-
-/* Indicates the maximum number of characters(\0 included) for shm_id */
-#define MAX_SHM_ID_LENGTH 16
-
-struct shmem_membank_extra {
-    char shm_id[MAX_SHM_ID_LENGTH];
-    unsigned int nr_shm_borrowers;
-};
-
-struct membank {
-    paddr_t start;
-    paddr_t size;
-    union {
-        enum membank_type type;
-#ifdef CONFIG_STATIC_SHM
-        struct shmem_membank_extra *shmem_extra;
-#endif
-    };
-};
-
-struct membanks {
-    __struct_group(membanks_hdr, common, ,
-        unsigned int nr_banks;
-        unsigned int max_banks;
-    );
-    struct membank bank[];
-};
-
-struct meminfo {
-    struct membanks_hdr common;
-    struct membank bank[NR_MEM_BANKS];
-};
-
-struct shared_meminfo {
-    struct membanks_hdr common;
-    struct membank bank[NR_SHMEM_BANKS];
-    struct shmem_membank_extra extra[NR_SHMEM_BANKS];
-};
-
-/*
- * The domU flag is set for kernels and ramdisks of "xen,domain" nodes.
- * The purpose of the domU flag is to avoid getting confused in
- * kernel_probe, where we try to guess which is the dom0 kernel and
- * initrd to be compatible with all versions of the multiboot spec. 
- */
-#define BOOTMOD_MAX_CMDLINE 1024
-struct bootmodule {
-    bootmodule_kind kind;
-    bool domU;
-    paddr_t start;
-    paddr_t size;
-};
-
-/* DT_MAX_NAME is the node name max length according the DT spec */
-#define DT_MAX_NAME 41
-struct bootcmdline {
-    bootmodule_kind kind;
-    bool domU;
-    paddr_t start;
-    char dt_name[DT_MAX_NAME];
-    char cmdline[BOOTMOD_MAX_CMDLINE];
-};
-
-struct bootmodules {
-    int nr_mods;
-    struct bootmodule module[MAX_MODULES];
-};
-
-struct bootcmdlines {
-    unsigned int nr_mods;
-    struct bootcmdline cmdline[MAX_MODULES];
-};
-
-struct bootinfo {
-    struct meminfo mem;
-    /* The reserved regions are only used when booting using Device-Tree */
-    struct meminfo reserved_mem;
-    struct bootmodules modules;
-    struct bootcmdlines cmdlines;
-#ifdef CONFIG_ACPI
-    struct meminfo acpi;
-#endif
-#ifdef CONFIG_STATIC_SHM
-    struct shared_meminfo shmem;
-#endif
-    bool static_heap;
-};
-
-#ifdef CONFIG_ACPI
-#define BOOTINFO_ACPI_INIT .acpi.common.max_banks = NR_MEM_BANKS,
-#else
-#define BOOTINFO_ACPI_INIT
-#endif
-
-#ifdef CONFIG_STATIC_SHM
-#define BOOTINFO_SHMEM_INIT .shmem.common.max_banks = NR_SHMEM_BANKS,
-#else
-#define BOOTINFO_SHMEM_INIT
-#endif
-
-#define BOOTINFO_INIT                               \
-{                                                   \
-    .mem.common.max_banks = NR_MEM_BANKS,           \
-    .reserved_mem.common.max_banks = NR_MEM_BANKS,  \
-    BOOTINFO_ACPI_INIT                              \
-    BOOTINFO_SHMEM_INIT                             \
-}
-
 struct map_range_data
 {
     struct domain *d;
@@ -167,39 +19,8 @@ struct map_range_data
     struct rangeset *irq_ranges;
 };
 
-extern struct bootinfo bootinfo;
-
 extern domid_t max_init_domid;
 
-static inline struct membanks *bootinfo_get_mem(void)
-{
-    return container_of(&bootinfo.mem.common, struct membanks, common);
-}
-
-static inline struct membanks *bootinfo_get_reserved_mem(void)
-{
-    return container_of(&bootinfo.reserved_mem.common, struct membanks, common);
-}
-
-#ifdef CONFIG_ACPI
-static inline struct membanks *bootinfo_get_acpi(void)
-{
-    return container_of(&bootinfo.acpi.common, struct membanks, common);
-}
-#endif
-
-#ifdef CONFIG_STATIC_SHM
-static inline struct membanks *bootinfo_get_shmem(void)
-{
-    return container_of(&bootinfo.shmem.common, struct membanks, common);
-}
-
-static inline struct shmem_membank_extra *bootinfo_get_shmem_extra(void)
-{
-    return bootinfo.shmem.extra;
-}
-#endif
-
 void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len);
 
 size_t estimate_efi_size(unsigned int mem_nr_banks);
@@ -220,9 +41,6 @@ void fw_unreserved_regions(paddr_t s, paddr_t e,
                            void (*cb)(paddr_t ps, paddr_t pe),
                            unsigned int first);
 
-size_t boot_fdt_info(const void *fdt, paddr_t paddr);
-const char *boot_fdt_cmdline(const void *fdt);
-
 bool check_reserved_regions_overlap(paddr_t region_start, paddr_t region_size);
 
 struct bootmodule *add_boot_module(bootmodule_kind kind,
@@ -237,7 +55,6 @@ struct bootcmdline * boot_cmdline_find_by_name(const char *name);
 const char *boot_module_kind_as_string(bootmodule_kind kind);
 
 void init_pdx(void);
-void populate_boot_allocator(void);
 void setup_mm(void);
 
 extern uint32_t hyp_traps_vector[];
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 0c2fdaceaf..cb2c0a16b8 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -48,8 +48,6 @@
 #include <xsm/xsm.h>
 #include <asm/acpi.h>
 
-struct bootinfo __initdata bootinfo = BOOTINFO_INIT;
-
 /*
  * Sanitized version of cpuinfo containing only features available on all
  * cores (only on arm64 as there is no sanitization support on arm32).
@@ -203,321 +201,6 @@ static void __init processor_id(void)
     processor_setup();
 }
 
-static void __init dt_unreserved_regions(paddr_t s, paddr_t e,
-                                         void (*cb)(paddr_t ps, paddr_t pe),
-                                         unsigned int first)
-{
-    const struct membanks *reserved_mem = bootinfo_get_reserved_mem();
-#ifdef CONFIG_STATIC_SHM
-    const struct membanks *shmem = bootinfo_get_shmem();
-    unsigned int offset;
-#endif
-    unsigned int i;
-
-    /*
-     * i is the current bootmodule we are evaluating across all possible
-     * kinds.
-     */
-    for ( i = first; i < reserved_mem->nr_banks; i++ )
-    {
-        paddr_t r_s = reserved_mem->bank[i].start;
-        paddr_t r_e = r_s + reserved_mem->bank[i].size;
-
-        if ( s < r_e && r_s < e )
-        {
-            dt_unreserved_regions(r_e, e, cb, i + 1);
-            dt_unreserved_regions(s, r_s, cb, i + 1);
-            return;
-        }
-    }
-
-#ifdef CONFIG_STATIC_SHM
-    /*
-     * When retrieving the corresponding shared memory addresses
-     * below, we need to index the shmem->bank starting from 0, hence
-     * we need to use i - reserved_mem->nr_banks.
-    */
-    offset = reserved_mem->nr_banks;
-    for ( ; i - offset < shmem->nr_banks; i++ )
-    {
-        paddr_t r_s, r_e;
-
-        r_s = shmem->bank[i - offset].start;
-
-        /* Shared memory banks can contain INVALID_PADDR as start */
-        if ( INVALID_PADDR == r_s )
-            continue;
-
-        r_e = r_s + shmem->bank[i - offset].size;
-
-        if ( s < r_e && r_s < e )
-        {
-            dt_unreserved_regions(r_e, e, cb, i + 1);
-            dt_unreserved_regions(s, r_s, cb, i + 1);
-            return;
-        }
-    }
-#endif
-
-    cb(s, e);
-}
-
-/*
- * TODO: '*_end' could be 0 if the bank/region is at the end of the physical
- * address space. This is for now not handled as it requires more rework.
- */
-static bool __init meminfo_overlap_check(const struct membanks *mem,
-                                         paddr_t region_start,
-                                         paddr_t region_size)
-{
-    paddr_t bank_start = INVALID_PADDR, bank_end = 0;
-    paddr_t region_end = region_start + region_size;
-    unsigned int i, bank_num = mem->nr_banks;
-
-    for ( i = 0; i < bank_num; i++ )
-    {
-        bank_start = mem->bank[i].start;
-        bank_end = bank_start + mem->bank[i].size;
-
-        if ( INVALID_PADDR == bank_start || region_end <= bank_start ||
-             region_start >= bank_end )
-            continue;
-        else
-        {
-            printk("Region: [%#"PRIpaddr", %#"PRIpaddr") overlapping with bank[%u]: [%#"PRIpaddr", %#"PRIpaddr")\n",
-                   region_start, region_end, i, bank_start, bank_end);
-            return true;
-        }
-    }
-
-    return false;
-}
-
-/*
- * TODO: '*_end' could be 0 if the module/region is at the end of the physical
- * address space. This is for now not handled as it requires more rework.
- */
-static bool __init bootmodules_overlap_check(struct bootmodules *bootmodules,
-                                             paddr_t region_start,
-                                             paddr_t region_size)
-{
-    paddr_t mod_start = INVALID_PADDR, mod_end = 0;
-    paddr_t region_end = region_start + region_size;
-    unsigned int i, mod_num = bootmodules->nr_mods;
-
-    for ( i = 0; i < mod_num; i++ )
-    {
-        mod_start = bootmodules->module[i].start;
-        mod_end = mod_start + bootmodules->module[i].size;
-
-        if ( region_end <= mod_start || region_start >= mod_end )
-            continue;
-        else
-        {
-            printk("Region: [%#"PRIpaddr", %#"PRIpaddr") overlapping with mod[%u]: [%#"PRIpaddr", %#"PRIpaddr")\n",
-                   region_start, region_end, i, mod_start, mod_end);
-            return true;
-        }
-    }
-
-    return false;
-}
-
-void __init fw_unreserved_regions(paddr_t s, paddr_t e,
-                                  void (*cb)(paddr_t ps, paddr_t pe),
-                                  unsigned int first)
-{
-    if ( acpi_disabled )
-        dt_unreserved_regions(s, e, cb, first);
-    else
-        cb(s, e);
-}
-
-/*
- * Given an input physical address range, check if this range is overlapping
- * with the existing reserved memory regions defined in bootinfo.
- * Return true if the input physical address range is overlapping with any
- * existing reserved memory regions, otherwise false.
- */
-bool __init check_reserved_regions_overlap(paddr_t region_start,
-                                           paddr_t region_size)
-{
-    const struct membanks *mem_banks[] = {
-        bootinfo_get_reserved_mem(),
-#ifdef CONFIG_ACPI
-        bootinfo_get_acpi(),
-#endif
-#ifdef CONFIG_STATIC_SHM
-        bootinfo_get_shmem(),
-#endif
-    };
-    unsigned int i;
-
-    /*
-     * Check if input region is overlapping with reserved memory banks or
-     * ACPI EfiACPIReclaimMemory (when ACPI feature is enabled) or static
-     * shared memory banks (when static shared memory feature is enabled)
-     */
-    for ( i = 0; i < ARRAY_SIZE(mem_banks); i++ )
-        if ( meminfo_overlap_check(mem_banks[i], region_start, region_size) )
-            return true;
-
-    /* Check if input region is overlapping with bootmodules */
-    if ( bootmodules_overlap_check(&bootinfo.modules,
-                                   region_start, region_size) )
-        return true;
-
-    return false;
-}
-
-struct bootmodule __init *add_boot_module(bootmodule_kind kind,
-                                          paddr_t start, paddr_t size,
-                                          bool domU)
-{
-    struct bootmodules *mods = &bootinfo.modules;
-    struct bootmodule *mod;
-    unsigned int i;
-
-    if ( mods->nr_mods == MAX_MODULES )
-    {
-        printk("Ignoring %s boot module at %"PRIpaddr"-%"PRIpaddr" (too many)\n",
-               boot_module_kind_as_string(kind), start, start + size);
-        return NULL;
-    }
-
-    if ( check_reserved_regions_overlap(start, size) )
-        return NULL;
-
-    for ( i = 0 ; i < mods->nr_mods ; i++ )
-    {
-        mod = &mods->module[i];
-        if ( mod->kind == kind && mod->start == start )
-        {
-            if ( !domU )
-                mod->domU = false;
-            return mod;
-        }
-    }
-
-    mod = &mods->module[mods->nr_mods++];
-    mod->kind = kind;
-    mod->start = start;
-    mod->size = size;
-    mod->domU = domU;
-
-    return mod;
-}
-
-/*
- * boot_module_find_by_kind can only be used to return Xen modules (e.g
- * XSM, DTB) or Dom0 modules. This is not suitable for looking up guest
- * modules.
- */
-struct bootmodule * __init boot_module_find_by_kind(bootmodule_kind kind)
-{
-    struct bootmodules *mods = &bootinfo.modules;
-    struct bootmodule *mod;
-    int i;
-    for (i = 0 ; i < mods->nr_mods ; i++ )
-    {
-        mod = &mods->module[i];
-        if ( mod->kind == kind && !mod->domU )
-            return mod;
-    }
-    return NULL;
-}
-
-void __init add_boot_cmdline(const char *name, const char *cmdline,
-                             bootmodule_kind kind, paddr_t start, bool domU)
-{
-    struct bootcmdlines *cmds = &bootinfo.cmdlines;
-    struct bootcmdline *cmd;
-
-    if ( cmds->nr_mods == MAX_MODULES )
-    {
-        printk("Ignoring %s cmdline (too many)\n", name);
-        return;
-    }
-
-    cmd = &cmds->cmdline[cmds->nr_mods++];
-    cmd->kind = kind;
-    cmd->domU = domU;
-    cmd->start = start;
-
-    ASSERT(strlen(name) <= DT_MAX_NAME);
-    safe_strcpy(cmd->dt_name, name);
-
-    if ( strlen(cmdline) > BOOTMOD_MAX_CMDLINE )
-        panic("module %s command line too long\n", name);
-    safe_strcpy(cmd->cmdline, cmdline);
-}
-
-/*
- * boot_cmdline_find_by_kind can only be used to return Xen modules (e.g
- * XSM, DTB) or Dom0 modules. This is not suitable for looking up guest
- * modules.
- */
-struct bootcmdline * __init boot_cmdline_find_by_kind(bootmodule_kind kind)
-{
-    struct bootcmdlines *cmds = &bootinfo.cmdlines;
-    struct bootcmdline *cmd;
-    int i;
-
-    for ( i = 0 ; i < cmds->nr_mods ; i++ )
-    {
-        cmd = &cmds->cmdline[i];
-        if ( cmd->kind == kind && !cmd->domU )
-            return cmd;
-    }
-    return NULL;
-}
-
-struct bootcmdline * __init boot_cmdline_find_by_name(const char *name)
-{
-    struct bootcmdlines *mods = &bootinfo.cmdlines;
-    struct bootcmdline *mod;
-    unsigned int i;
-
-    for (i = 0 ; i < mods->nr_mods ; i++ )
-    {
-        mod = &mods->cmdline[i];
-        if ( strcmp(mod->dt_name, name) == 0 )
-            return mod;
-    }
-    return NULL;
-}
-
-struct bootmodule * __init boot_module_find_by_addr_and_kind(bootmodule_kind kind,
-                                                             paddr_t start)
-{
-    struct bootmodules *mods = &bootinfo.modules;
-    struct bootmodule *mod;
-    unsigned int i;
-
-    for (i = 0 ; i < mods->nr_mods ; i++ )
-    {
-        mod = &mods->module[i];
-        if ( mod->kind == kind && mod->start == start )
-            return mod;
-    }
-    return NULL;
-}
-
-const char * __init boot_module_kind_as_string(bootmodule_kind kind)
-{
-    switch ( kind )
-    {
-    case BOOTMOD_XEN:     return "Xen";
-    case BOOTMOD_FDT:     return "Device Tree";
-    case BOOTMOD_KERNEL:  return "Kernel";
-    case BOOTMOD_RAMDISK: return "Ramdisk";
-    case BOOTMOD_XSM:     return "XSM";
-    case BOOTMOD_GUEST_DTB:     return "DTB";
-    case BOOTMOD_UNKNOWN: return "Unknown";
-    default: BUG();
-    }
-}
-
 void __init discard_initial_modules(void)
 {
     struct bootmodules *mi = &bootinfo.modules;
@@ -556,40 +239,6 @@ static void * __init relocate_fdt(paddr_t dtb_paddr, size_t dtb_size)
     return fdt;
 }
 
-/*
- * Return the end of the non-module region starting at s. In other
- * words return s the start of the next modules after s.
- *
- * On input *end is the end of the region which should be considered
- * and it is updated to reflect the end of the module, clipped to the
- * end of the region if it would run over.
- */
-static paddr_t __init next_module(paddr_t s, paddr_t *end)
-{
-    struct bootmodules *mi = &bootinfo.modules;
-    paddr_t lowest = ~(paddr_t)0;
-    int i;
-
-    for ( i = 0; i < mi->nr_mods; i++ )
-    {
-        paddr_t mod_s = mi->module[i].start;
-        paddr_t mod_e = mod_s + mi->module[i].size;
-
-        if ( !mi->module[i].size )
-            continue;
-
-        if ( mod_s < s )
-            continue;
-        if ( mod_s > lowest )
-            continue;
-        if ( mod_s > *end )
-            continue;
-        lowest = mod_s;
-        *end = min(*end, mod_e);
-    }
-    return lowest;
-}
-
 void __init init_pdx(void)
 {
     const struct membanks *mem = bootinfo_get_mem();
@@ -635,87 +284,6 @@ void __init init_pdx(void)
     }
 }
 
-/*
- * Populate the boot allocator.
- * If a static heap was not provided by the admin, all the RAM but the
- * following regions will be added:
- *  - Modules (e.g., Xen, Kernel)
- *  - Reserved regions
- *  - Xenheap (arm32 only)
- * If a static heap was provided by the admin, populate the boot
- * allocator with the corresponding regions only, but with Xenheap excluded
- * on arm32.
- */
-void __init populate_boot_allocator(void)
-{
-    unsigned int i;
-    const struct membanks *banks = bootinfo_get_mem();
-    const struct membanks *reserved_mem = bootinfo_get_reserved_mem();
-    paddr_t s, e;
-
-    if ( bootinfo.static_heap )
-    {
-        for ( i = 0 ; i < reserved_mem->nr_banks; i++ )
-        {
-            if ( reserved_mem->bank[i].type != MEMBANK_STATIC_HEAP )
-                continue;
-
-            s = reserved_mem->bank[i].start;
-            e = s + reserved_mem->bank[i].size;
-#ifdef CONFIG_ARM_32
-            /* Avoid the xenheap, note that the xenheap cannot across a bank */
-            if ( s <= mfn_to_maddr(directmap_mfn_start) &&
-                 e >= mfn_to_maddr(directmap_mfn_end) )
-            {
-                init_boot_pages(s, mfn_to_maddr(directmap_mfn_start));
-                init_boot_pages(mfn_to_maddr(directmap_mfn_end), e);
-            }
-            else
-#endif
-                init_boot_pages(s, e);
-        }
-
-        return;
-    }
-
-    for ( i = 0; i < banks->nr_banks; i++ )
-    {
-        const struct membank *bank = &banks->bank[i];
-        paddr_t bank_end = bank->start + bank->size;
-
-        s = bank->start;
-        while ( s < bank_end )
-        {
-            paddr_t n = bank_end;
-
-            e = next_module(s, &n);
-
-            if ( e == ~(paddr_t)0 )
-                e = n = bank_end;
-
-            /*
-             * Module in a RAM bank other than the one which we are
-             * not dealing with here.
-             */
-            if ( e > bank_end )
-                e = bank_end;
-
-#ifdef CONFIG_ARM_32
-            /* Avoid the xenheap */
-            if ( s < mfn_to_maddr(directmap_mfn_end) &&
-                 mfn_to_maddr(directmap_mfn_start) < e )
-            {
-                e = mfn_to_maddr(directmap_mfn_start);
-                n = mfn_to_maddr(directmap_mfn_end);
-            }
-#endif
-
-            fw_unreserved_regions(s, e, init_boot_pages, 0);
-            s = n;
-        }
-    }
-}
-
 size_t __read_mostly dcache_line_bytes;
 
 /* C entry point for boot CPU */
diff --git a/xen/common/Makefile b/xen/common/Makefile
index f12a474d40..7e66802a9e 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -6,7 +6,7 @@ obj-$(CONFIG_HYPFS_CONFIG) += config_data.o
 obj-$(CONFIG_CORE_PARKING) += core_parking.o
 obj-y += cpu.o
 obj-$(CONFIG_DEBUG_TRACE) += debugtrace.o
-obj-$(CONFIG_HAS_DEVICE_TREE) += device_tree.o
+obj-$(CONFIG_HAS_DEVICE_TREE) += device-tree/
 obj-$(CONFIG_IOREQ_SERVER) += dm.o
 obj-y += domain.o
 obj-$(CONFIG_OVERLAY_DTB) += dt-overlay.o
diff --git a/xen/common/device-tree/Makefile b/xen/common/device-tree/Makefile
new file mode 100644
index 0000000000..da892dd55d
--- /dev/null
+++ b/xen/common/device-tree/Makefile
@@ -0,0 +1,2 @@
+obj-y += bootinfo.init.o
+obj-y += device_tree.o
diff --git a/xen/common/device-tree/bootinfo.c b/xen/common/device-tree/bootinfo.c
new file mode 100644
index 0000000000..f2e6a1145b
--- /dev/null
+++ b/xen/common/device-tree/bootinfo.c
@@ -0,0 +1,459 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Derived from Xen 4.19's $xen/arch/arm/setup.c.
+ *
+ * bookkeeping routines.
+ *
+ * Tim Deegan <tim@xen.org>
+ * Copyright (c) 2011 Citrix Systems.
+ * Copyright (c) 2024 Raptor Engineering LLC
+ */
+
+#include <xen/acpi.h>
+#include <xen/bootfdt.h>
+#include <xen/bug.h>
+#include <xen/device_tree.h>
+#include <xen/init.h>
+#include <xen/libfdt/libfdt-xen.h>
+#include <xen/mm.h>
+
+struct bootinfo __initdata bootinfo = BOOTINFO_INIT;
+
+const char * __init boot_module_kind_as_string(bootmodule_kind kind)
+{
+    switch ( kind )
+    {
+    case BOOTMOD_XEN:     return "Xen";
+    case BOOTMOD_FDT:     return "Device Tree";
+    case BOOTMOD_KERNEL:  return "Kernel";
+    case BOOTMOD_RAMDISK: return "Ramdisk";
+    case BOOTMOD_XSM:     return "XSM";
+    case BOOTMOD_GUEST_DTB:     return "DTB";
+    case BOOTMOD_UNKNOWN: return "Unknown";
+    default: BUG();
+    }
+}
+
+static void __init dt_unreserved_regions(paddr_t s, paddr_t e,
+                                         void (*cb)(paddr_t ps, paddr_t pe),
+                                         unsigned int first)
+{
+    const struct membanks *reserved_mem = bootinfo_get_reserved_mem();
+#ifdef CONFIG_STATIC_SHM
+    const struct membanks *shmem = bootinfo_get_shmem();
+    unsigned int offset;
+#endif
+    unsigned int i;
+
+    /*
+     * i is the current bootmodule we are evaluating across all possible
+     * kinds.
+     */
+    for ( i = first; i < reserved_mem->nr_banks; i++ )
+    {
+        paddr_t r_s = reserved_mem->bank[i].start;
+        paddr_t r_e = r_s + reserved_mem->bank[i].size;
+
+        if ( s < r_e && r_s < e )
+        {
+            dt_unreserved_regions(r_e, e, cb, i + 1);
+            dt_unreserved_regions(s, r_s, cb, i + 1);
+            return;
+        }
+    }
+
+#ifdef CONFIG_STATIC_SHM
+    /*
+     * When retrieving the corresponding shared memory addresses
+     * below, we need to index the shmem->bank starting from 0, hence
+     * we need to use i - reserved_mem->nr_banks.
+    */
+    offset = reserved_mem->nr_banks;
+    for ( ; i - offset < shmem->nr_banks; i++ )
+    {
+        paddr_t r_s, r_e;
+
+        r_s = shmem->bank[i - offset].start;
+
+        /* Shared memory banks can contain INVALID_PADDR as start */
+        if ( INVALID_PADDR == r_s )
+            continue;
+
+        r_e = r_s + shmem->bank[i - offset].size;
+
+        if ( s < r_e && r_s < e )
+        {
+            dt_unreserved_regions(r_e, e, cb, i + 1);
+            dt_unreserved_regions(s, r_s, cb, i + 1);
+            return;
+        }
+    }
+#endif
+
+    cb(s, e);
+}
+
+/*
+ * TODO: '*_end' could be 0 if the bank/region is at the end of the physical
+ * address space. This is for now not handled as it requires more rework.
+ */
+static bool __init meminfo_overlap_check(const struct membanks *mem,
+                                         paddr_t region_start,
+                                         paddr_t region_size)
+{
+    paddr_t bank_start = INVALID_PADDR, bank_end = 0;
+    paddr_t region_end = region_start + region_size;
+    unsigned int i, bank_num = mem->nr_banks;
+
+    for ( i = 0; i < bank_num; i++ )
+    {
+        bank_start = mem->bank[i].start;
+        bank_end = bank_start + mem->bank[i].size;
+
+        if ( INVALID_PADDR == bank_start || region_end <= bank_start ||
+             region_start >= bank_end )
+            continue;
+        else
+        {
+            printk("Region: [%#"PRIpaddr", %#"PRIpaddr") overlapping with bank[%u]: [%#"PRIpaddr", %#"PRIpaddr")\n",
+                   region_start, region_end, i, bank_start, bank_end);
+            return true;
+        }
+    }
+
+    return false;
+}
+
+/*
+ * TODO: '*_end' could be 0 if the module/region is at the end of the physical
+ * address space. This is for now not handled as it requires more rework.
+ */
+static bool __init bootmodules_overlap_check(struct bootmodules *bootmodules,
+                                             paddr_t region_start,
+                                             paddr_t region_size)
+{
+    paddr_t mod_start = INVALID_PADDR, mod_end = 0;
+    paddr_t region_end = region_start + region_size;
+    unsigned int i, mod_num = bootmodules->nr_mods;
+
+    for ( i = 0; i < mod_num; i++ )
+    {
+        mod_start = bootmodules->module[i].start;
+        mod_end = mod_start + bootmodules->module[i].size;
+
+        if ( region_end <= mod_start || region_start >= mod_end )
+            continue;
+        else
+        {
+            printk("Region: [%#"PRIpaddr", %#"PRIpaddr") overlapping with mod[%u]: [%#"PRIpaddr", %#"PRIpaddr")\n",
+                   region_start, region_end, i, mod_start, mod_end);
+            return true;
+        }
+    }
+
+    return false;
+}
+
+void __init fw_unreserved_regions(paddr_t s, paddr_t e,
+                                  void (*cb)(paddr_t ps, paddr_t pe),
+                                  unsigned int first)
+{
+    if ( acpi_disabled )
+        dt_unreserved_regions(s, e, cb, first);
+    else
+        cb(s, e);
+}
+
+/*
+ * Given an input physical address range, check if this range is overlapping
+ * with the existing reserved memory regions defined in bootinfo.
+ * Return true if the input physical address range is overlapping with any
+ * existing reserved memory regions, otherwise false.
+ */
+bool __init check_reserved_regions_overlap(paddr_t region_start,
+                                           paddr_t region_size)
+{
+    const struct membanks *mem_banks[] = {
+        bootinfo_get_reserved_mem(),
+#ifdef CONFIG_ACPI
+        bootinfo_get_acpi(),
+#endif
+#ifdef CONFIG_STATIC_SHM
+        bootinfo_get_shmem(),
+#endif
+    };
+    unsigned int i;
+
+    /*
+     * Check if input region is overlapping with reserved memory banks or
+     * ACPI EfiACPIReclaimMemory (when ACPI feature is enabled) or static
+     * shared memory banks (when static shared memory feature is enabled)
+     */
+    for ( i = 0; i < ARRAY_SIZE(mem_banks); i++ )
+        if ( meminfo_overlap_check(mem_banks[i], region_start, region_size) )
+            return true;
+
+    /* Check if input region is overlapping with bootmodules */
+    if ( bootmodules_overlap_check(&bootinfo.modules,
+                                   region_start, region_size) )
+        return true;
+
+    return false;
+}
+
+struct bootmodule __init *add_boot_module(bootmodule_kind kind,
+                                          paddr_t start, paddr_t size,
+                                          bool domU)
+{
+    struct bootmodules *mods = &bootinfo.modules;
+    struct bootmodule *mod;
+    unsigned int i;
+
+    if ( mods->nr_mods == MAX_MODULES )
+    {
+        printk("Ignoring %s boot module at %"PRIpaddr"-%"PRIpaddr" (too many)\n",
+               boot_module_kind_as_string(kind), start, start + size);
+        return NULL;
+    }
+
+    if ( check_reserved_regions_overlap(start, size) )
+        return NULL;
+
+    for ( i = 0 ; i < mods->nr_mods ; i++ )
+    {
+        mod = &mods->module[i];
+        if ( mod->kind == kind && mod->start == start )
+        {
+            if ( !domU )
+                mod->domU = false;
+            return mod;
+        }
+    }
+
+    mod = &mods->module[mods->nr_mods++];
+    mod->kind = kind;
+    mod->start = start;
+    mod->size = size;
+    mod->domU = domU;
+
+    return mod;
+}
+
+/*
+ * boot_module_find_by_kind can only be used to return Xen modules (e.g
+ * XSM, DTB) or Dom0 modules. This is not suitable for looking up guest
+ * modules.
+ */
+struct bootmodule * __init boot_module_find_by_kind(bootmodule_kind kind)
+{
+    struct bootmodules *mods = &bootinfo.modules;
+    struct bootmodule *mod;
+    int i;
+    for (i = 0 ; i < mods->nr_mods ; i++ )
+    {
+        mod = &mods->module[i];
+        if ( mod->kind == kind && !mod->domU )
+            return mod;
+    }
+    return NULL;
+}
+
+void __init add_boot_cmdline(const char *name, const char *cmdline,
+                             bootmodule_kind kind, paddr_t start, bool domU)
+{
+    struct bootcmdlines *cmds = &bootinfo.cmdlines;
+    struct bootcmdline *cmd;
+
+    if ( cmds->nr_mods == MAX_MODULES )
+    {
+        printk("Ignoring %s cmdline (too many)\n", name);
+        return;
+    }
+
+    cmd = &cmds->cmdline[cmds->nr_mods++];
+    cmd->kind = kind;
+    cmd->domU = domU;
+    cmd->start = start;
+
+    ASSERT(strlen(name) <= DT_MAX_NAME);
+    safe_strcpy(cmd->dt_name, name);
+
+    if ( strlen(cmdline) > BOOTMOD_MAX_CMDLINE )
+        panic("module %s command line too long\n", name);
+    safe_strcpy(cmd->cmdline, cmdline);
+}
+
+/*
+ * boot_cmdline_find_by_kind can only be used to return Xen modules (e.g
+ * XSM, DTB) or Dom0 modules. This is not suitable for looking up guest
+ * modules.
+ */
+struct bootcmdline * __init boot_cmdline_find_by_kind(bootmodule_kind kind)
+{
+    struct bootcmdlines *cmds = &bootinfo.cmdlines;
+    struct bootcmdline *cmd;
+    int i;
+
+    for ( i = 0 ; i < cmds->nr_mods ; i++ )
+    {
+        cmd = &cmds->cmdline[i];
+        if ( cmd->kind == kind && !cmd->domU )
+            return cmd;
+    }
+    return NULL;
+}
+
+struct bootcmdline * __init boot_cmdline_find_by_name(const char *name)
+{
+    struct bootcmdlines *mods = &bootinfo.cmdlines;
+    struct bootcmdline *mod;
+    unsigned int i;
+
+    for (i = 0 ; i < mods->nr_mods ; i++ )
+    {
+        mod = &mods->cmdline[i];
+        if ( strcmp(mod->dt_name, name) == 0 )
+            return mod;
+    }
+    return NULL;
+}
+
+struct bootmodule * __init boot_module_find_by_addr_and_kind(bootmodule_kind kind,
+                                                             paddr_t start)
+{
+    struct bootmodules *mods = &bootinfo.modules;
+    struct bootmodule *mod;
+    unsigned int i;
+
+    for (i = 0 ; i < mods->nr_mods ; i++ )
+    {
+        mod = &mods->module[i];
+        if ( mod->kind == kind && mod->start == start )
+            return mod;
+    }
+    return NULL;
+}
+
+/*
+ * Return the end of the non-module region starting at s. In other
+ * words return s the start of the next modules after s.
+ *
+ * On input *end is the end of the region which should be considered
+ * and it is updated to reflect the end of the module, clipped to the
+ * end of the region if it would run over.
+ */
+static paddr_t __init next_module(paddr_t s, paddr_t *end)
+{
+    struct bootmodules *mi = &bootinfo.modules;
+    paddr_t lowest = ~(paddr_t)0;
+    int i;
+
+    for ( i = 0; i < mi->nr_mods; i++ )
+    {
+        paddr_t mod_s = mi->module[i].start;
+        paddr_t mod_e = mod_s + mi->module[i].size;
+
+        if ( !mi->module[i].size )
+            continue;
+
+        if ( mod_s < s )
+            continue;
+        if ( mod_s > lowest )
+            continue;
+        if ( mod_s > *end )
+            continue;
+        lowest = mod_s;
+        *end = min(*end, mod_e);
+    }
+    return lowest;
+}
+
+/*
+ * Populate the boot allocator.
+ * If a static heap was not provided by the admin, all the RAM but the
+ * following regions will be added:
+ *  - Modules (e.g., Xen, Kernel)
+ *  - Reserved regions
+ *  - Xenheap (CONFIG_SEPARATE_XENHEAP only)
+ * If a static heap was provided by the admin, populate the boot
+ * allocator with the corresponding regions only, but with Xenheap excluded
+ * on CONFIG_SEPARATE_XENHEAP.
+ */
+void __init populate_boot_allocator(void)
+{
+    unsigned int i;
+    const struct membanks *banks = bootinfo_get_mem();
+    const struct membanks *reserved_mem = bootinfo_get_reserved_mem();
+    paddr_t s, e;
+
+    if ( bootinfo.static_heap )
+    {
+        for ( i = 0 ; i < reserved_mem->nr_banks; i++ )
+        {
+            if ( reserved_mem->bank[i].type != MEMBANK_STATIC_HEAP )
+                continue;
+
+            s = reserved_mem->bank[i].start;
+            e = s + reserved_mem->bank[i].size;
+#ifdef CONFIG_SEPARATE_XENHEAP
+            /* Avoid the xenheap, note that the xenheap cannot across a bank */
+            if ( s <= mfn_to_maddr(directmap_mfn_start) &&
+                 e >= mfn_to_maddr(directmap_mfn_end) )
+            {
+                init_boot_pages(s, mfn_to_maddr(directmap_mfn_start));
+                init_boot_pages(mfn_to_maddr(directmap_mfn_end), e);
+            }
+            else
+#endif
+                init_boot_pages(s, e);
+        }
+
+        return;
+    }
+
+    for ( i = 0; i < banks->nr_banks; i++ )
+    {
+        const struct membank *bank = &banks->bank[i];
+        paddr_t bank_end = bank->start + bank->size;
+
+        s = bank->start;
+        while ( s < bank_end )
+        {
+            paddr_t n = bank_end;
+
+            e = next_module(s, &n);
+
+            if ( e == ~(paddr_t)0 )
+                e = n = bank_end;
+
+            /*
+             * Module in a RAM bank other than the one which we are
+             * not dealing with here.
+             */
+            if ( e > bank_end )
+                e = bank_end;
+
+#ifdef CONFIG_SEPARATE_XENHEAP
+            /* Avoid the xenheap */
+            if ( s < mfn_to_maddr(directmap_mfn_end) &&
+                 mfn_to_maddr(directmap_mfn_start) < e )
+            {
+                e = mfn_to_maddr(directmap_mfn_start);
+                n = mfn_to_maddr(directmap_mfn_end);
+            }
+#endif
+
+            fw_unreserved_regions(s, e, init_boot_pages, 0);
+            s = n;
+        }
+    }
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/common/device-tree/device_tree.c b/xen/common/device-tree/device_tree.c
new file mode 100644
index 0000000000..8d1017a49d
--- /dev/null
+++ b/xen/common/device-tree/device_tree.c
@@ -0,0 +1,2253 @@
+/*
+ * Device Tree
+ *
+ * Copyright (C) 2012 Citrix Systems, Inc.
+ * Copyright 2009 Benjamin Herrenschmidt, IBM Corp
+ * benh@kernel.crashing.org
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <xen/types.h>
+#include <xen/init.h>
+#include <xen/guest_access.h>
+#include <xen/device_tree.h>
+#include <xen/kernel.h>
+#include <xen/lib.h>
+#include <xen/libfdt/libfdt.h>
+#include <xen/mm.h>
+#include <xen/stdarg.h>
+#include <xen/string.h>
+#include <xen/cpumask.h>
+#include <xen/ctype.h>
+#include <asm/setup.h>
+#include <xen/err.h>
+
+const void *device_tree_flattened;
+dt_irq_xlate_func dt_irq_xlate;
+/* Host device tree */
+struct dt_device_node *dt_host;
+/* Interrupt controller node*/
+const struct dt_device_node *dt_interrupt_controller;
+DEFINE_RWLOCK(dt_host_lock);
+
+/**
+ * struct dt_alias_prop - Alias property in 'aliases' node
+ * @link: List node to link the structure in aliases_lookup list
+ * @alias: Alias property name
+ * @np: Pointer to device_node that the alias stands for
+ * @id: Index value from end of alias name
+ * @stem: Alias string without the index
+ *
+ * The structure represents one alias property of 'aliases' node as
+ * an entry in aliases_lookup list.
+ */
+struct dt_alias_prop {
+    struct list_head link;
+    const char *alias;
+    struct dt_device_node *np;
+    int id;
+    char stem[0];
+};
+
+static LIST_HEAD(aliases_lookup);
+
+#ifdef CONFIG_DEVICE_TREE_DEBUG
+static void dt_dump_addr(const char *s, const __be32 *addr, int na)
+{
+    dt_dprintk("%s", s);
+    while ( na-- )
+        dt_dprintk(" %08x", be32_to_cpu(*(addr++)));
+    dt_dprintk("\n");
+}
+#else
+static void dt_dump_addr(const char *s, const __be32 *addr, int na) { }
+#endif
+
+#define DT_BAD_ADDR ((u64)-1)
+
+/* Max address size we deal with */
+#define DT_MAX_ADDR_CELLS 4
+#define DT_CHECK_ADDR_COUNT(na) ((na) > 0 && (na) <= DT_MAX_ADDR_CELLS)
+#define DT_CHECK_COUNTS(na, ns) (DT_CHECK_ADDR_COUNT(na) && (ns) > 0)
+
+/* Callbacks for bus specific translators */
+struct dt_bus
+{
+    const char *name;
+    const char *addresses;
+    bool (*match)(const struct dt_device_node *node);
+    void (*count_cells)(const struct dt_device_node *child,
+                        int *addrc, int *sizec);
+    u64 (*map)(__be32 *addr, const __be32 *range, int na, int ns, int pna);
+    int (*translate)(__be32 *addr, u64 offset, int na);
+    unsigned int (*get_flags)(const __be32 *addr);
+};
+
+void dt_get_range(const __be32 **cellp, const struct dt_device_node *np,
+                  u64 *address, u64 *size)
+{
+    *address = dt_next_cell(dt_n_addr_cells(np), cellp);
+    *size = dt_next_cell(dt_n_size_cells(np), cellp);
+}
+
+void dt_set_cell(__be32 **cellp, int size, u64 val)
+{
+    int cells = size;
+
+    while ( size-- )
+    {
+        (*cellp)[size] = cpu_to_fdt32(val);
+        val >>= 32;
+    }
+
+    (*cellp) += cells;
+}
+
+void dt_set_range(__be32 **cellp, const struct dt_device_node *np,
+                  u64 address, u64 size)
+{
+    dt_set_cell(cellp, dt_n_addr_cells(np), address);
+    dt_set_cell(cellp, dt_n_size_cells(np), size);
+}
+
+void dt_child_set_range(__be32 **cellp, int addrcells, int sizecells,
+                        u64 address, u64 size)
+{
+    dt_set_cell(cellp, addrcells, address);
+    dt_set_cell(cellp, sizecells, size);
+}
+
+static void __init *unflatten_dt_alloc(unsigned long *mem, unsigned long size,
+                                       unsigned long align)
+{
+    void *res;
+
+    *mem = ROUNDUP(*mem, align);
+    res = (void *)*mem;
+    *mem += size;
+
+    return res;
+}
+
+/* Find a property with a given name for a given node and return it. */
+const struct dt_property *dt_find_property(const struct dt_device_node *np,
+                                           const char *name, u32 *lenp)
+{
+    const struct dt_property *pp;
+
+    if ( !np )
+        return NULL;
+
+    for ( pp = np->properties; pp; pp = pp->next )
+    {
+        if ( dt_prop_cmp(pp->name, name) == 0 )
+        {
+            if ( lenp )
+                *lenp = pp->length;
+            break;
+        }
+    }
+
+    return pp;
+}
+
+const void *dt_get_property(const struct dt_device_node *np,
+                            const char *name, u32 *lenp)
+{
+    const struct dt_property *pp = dt_find_property(np, name, lenp);
+
+    return pp ? pp->value : NULL;
+}
+
+bool dt_property_read_u32(const struct dt_device_node *np,
+                          const char *name, u32 *out_value)
+{
+    u32 len;
+    const __be32 *val;
+
+    val = dt_get_property(np, name, &len);
+    if ( !val || len < sizeof(*out_value) )
+        return 0;
+
+    *out_value = be32_to_cpup(val);
+
+    return 1;
+}
+
+
+bool dt_property_read_u64(const struct dt_device_node *np,
+                          const char *name, u64 *out_value)
+{
+    u32 len;
+    const __be32 *val;
+
+    val = dt_get_property(np, name, &len);
+    if ( !val || len < sizeof(*out_value) )
+        return 0;
+
+    *out_value = dt_read_number(val, 2);
+
+    return 1;
+}
+int dt_property_read_string(const struct dt_device_node *np,
+                            const char *propname, const char **out_string)
+{
+    const struct dt_property *pp = dt_find_property(np, propname, NULL);
+
+    if ( !pp )
+        return -EINVAL;
+    if ( !pp->length )
+        return -ENODATA;
+    if ( strnlen(pp->value, pp->length) >= pp->length )
+        return -EILSEQ;
+
+    *out_string = pp->value;
+
+    return 0;
+}
+
+/**
+ * dt_find_property_value_of_size
+ *
+ * @np:     device node from which the property value is to be read.
+ * @propname:   name of the property to be searched.
+ * @min:    minimum allowed length of property value
+ * @max:    maximum allowed length of property value (0 means unlimited)
+ * @len:    if !=NULL, actual length is written to here
+ *
+ * Search for a property in a device node and valid the requested size.
+ *
+ * Return: The property value on success, -EINVAL if the property does not
+ * exist, -ENODATA if property does not have a value, and -EOVERFLOW if the
+ * property data is too small or too large.
+ */
+static void *dt_find_property_value_of_size(const struct dt_device_node *np,
+                                            const char *propname, u32 min,
+                                            u32 max, size_t *len)
+{
+    const struct dt_property *prop = dt_find_property(np, propname, NULL);
+
+    if ( !prop )
+        return ERR_PTR(-EINVAL);
+    if ( !prop->value )
+        return ERR_PTR(-ENODATA);
+    if ( prop->length < min )
+        return ERR_PTR(-EOVERFLOW);
+    if ( max && prop->length > max )
+        return ERR_PTR(-EOVERFLOW);
+
+    if ( len )
+        *len = prop->length;
+
+    return prop->value;
+}
+
+int dt_property_read_variable_u32_array(const struct dt_device_node *np,
+                                        const char *propname, u32 *out_values,
+                                        size_t sz_min, size_t sz_max)
+{
+    size_t sz, count;
+    const __be32 *val = dt_find_property_value_of_size(np, propname,
+                        (sz_min * sizeof(*out_values)),
+                        (sz_max * sizeof(*out_values)),
+                        &sz);
+
+    if ( IS_ERR(val) )
+        return PTR_ERR(val);
+
+    if ( !sz_max )
+        sz = sz_min;
+    else
+        sz /= sizeof(*out_values);
+
+    count = sz;
+    while ( count-- )
+        *out_values++ = be32_to_cpup(val++);
+
+    return sz;
+}
+
+int dt_property_match_string(const struct dt_device_node *np,
+                             const char *propname, const char *string)
+{
+    const struct dt_property *dtprop = dt_find_property(np, propname, NULL);
+    size_t l;
+    int i;
+    const char *p, *end;
+
+    if ( !dtprop )
+        return -EINVAL;
+    if ( !dtprop->value )
+        return -ENODATA;
+
+    p = dtprop->value;
+    end = p + dtprop->length;
+
+    for ( i = 0; p < end; i++, p += l )
+    {
+        l = strnlen(p, end - p) + 1;
+        if ( p + l > end )
+            return -EILSEQ;
+        if ( strcmp(string, p) == 0 )
+            return i; /* Found it; return index */
+    }
+    return -ENODATA;
+}
+
+bool dt_device_is_compatible(const struct dt_device_node *device,
+                             const char *compat)
+{
+    const char* cp;
+    u32 cplen, l;
+
+    cp = dt_get_property(device, "compatible", &cplen);
+    if ( cp == NULL )
+        return 0;
+    while ( cplen > 0 )
+    {
+        if ( dt_compat_cmp(cp, compat) == 0 )
+            return 1;
+        l = strlen(cp) + 1;
+        cp += l;
+        cplen -= l;
+    }
+
+    return 0;
+}
+
+bool dt_machine_is_compatible(const char *compat)
+{
+    const struct dt_device_node *root;
+    bool rc = false;
+
+    root = dt_find_node_by_path("/");
+    if ( root )
+    {
+        rc = dt_device_is_compatible(root, compat);
+    }
+    return rc;
+}
+
+struct dt_device_node *dt_find_node_by_name(struct dt_device_node *from,
+                                            const char *name)
+{
+    struct dt_device_node *np;
+    struct dt_device_node *dt;
+
+    dt = from ? from->allnext : dt_host;
+    dt_for_each_device_node(dt, np)
+        if ( np->name && (dt_node_cmp(np->name, name) == 0) )
+            break;
+
+    return np;
+}
+
+struct dt_device_node *dt_find_node_by_type(struct dt_device_node *from,
+                                            const char *type)
+{
+    struct dt_device_node *np;
+    struct dt_device_node *dt;
+
+    dt = from ? from->allnext : dt_host;
+    dt_for_each_device_node(dt, np)
+        if ( np->type && (dt_node_cmp(np->type, type) == 0) )
+            break;
+
+    return np;
+}
+
+struct dt_device_node *dt_find_node_by_path_from(struct dt_device_node *from,
+                                                 const char *path)
+{
+    struct dt_device_node *np;
+
+    dt_for_each_device_node(from, np)
+        if ( np->full_name && (dt_node_cmp(np->full_name, path) == 0) )
+            break;
+
+    return np;
+}
+
+int dt_find_node_by_gpath(XEN_GUEST_HANDLE(char) u_path, uint32_t u_plen,
+                          struct dt_device_node **node)
+{
+    char *path;
+
+    path = safe_copy_string_from_guest(u_path, u_plen, PAGE_SIZE);
+    if ( IS_ERR(path) )
+        return PTR_ERR(path);
+
+    *node = dt_find_node_by_path(path);
+
+    xfree(path);
+
+    return (*node == NULL) ? -ESRCH : 0;
+}
+
+struct dt_device_node *dt_find_node_by_alias(const char *alias)
+{
+    const struct dt_alias_prop *app;
+
+    list_for_each_entry( app, &aliases_lookup, link )
+    {
+        if ( !strcmp(app->alias, alias) )
+            return app->np;
+    }
+
+    return NULL;
+}
+
+const struct dt_device_match *
+dt_match_node(const struct dt_device_match *matches,
+              const struct dt_device_node *node)
+{
+    if ( !matches )
+        return NULL;
+
+    while ( matches->path || matches->type ||
+            matches->compatible || matches->not_available || matches->prop )
+    {
+        bool match = true;
+
+        if ( matches->path )
+            match &= dt_node_path_is_equal(node, matches->path);
+
+        if ( matches->type )
+            match &= dt_device_type_is_equal(node, matches->type);
+
+        if ( matches->compatible )
+            match &= dt_device_is_compatible(node, matches->compatible);
+
+        if ( matches->not_available )
+            match &= !dt_device_is_available(node);
+
+        if ( matches->prop )
+            match &= dt_find_property(node, matches->prop, NULL) != NULL;
+
+        if ( match )
+            return matches;
+        matches++;
+    }
+
+    return NULL;
+}
+
+const struct dt_device_node *dt_get_parent(const struct dt_device_node *node)
+{
+    if ( !node )
+        return NULL;
+
+    return node->parent;
+}
+
+struct dt_device_node *
+dt_find_compatible_node(struct dt_device_node *from,
+                        const char *type,
+                        const char *compatible)
+{
+    struct dt_device_node *np;
+    struct dt_device_node *dt;
+
+    dt = from ? from->allnext : dt_host;
+    dt_for_each_device_node(dt, np)
+    {
+        if ( type
+             && !(np->type && (dt_node_cmp(np->type, type) == 0)) )
+            continue;
+        if ( dt_device_is_compatible(np, compatible) )
+            break;
+    }
+
+    return np;
+}
+
+struct dt_device_node *
+dt_find_matching_node(struct dt_device_node *from,
+                      const struct dt_device_match *matches)
+{
+    struct dt_device_node *np;
+    struct dt_device_node *dt;
+
+    dt = from ? from->allnext : dt_host;
+    dt_for_each_device_node(dt, np)
+    {
+        if ( dt_match_node(matches, np) )
+            return np;
+    }
+
+    return NULL;
+}
+
+static int __dt_n_addr_cells(const struct dt_device_node *np, bool parent)
+{
+    const __be32 *ip;
+
+    do {
+        if ( np->parent && !parent )
+            np = np->parent;
+        parent = false;
+
+        ip = dt_get_property(np, "#address-cells", NULL);
+        if ( ip )
+            return be32_to_cpup(ip);
+    } while ( np->parent );
+    /* No #address-cells property for the root node */
+    return DT_ROOT_NODE_ADDR_CELLS_DEFAULT;
+}
+
+static int __dt_n_size_cells(const struct dt_device_node *np, bool parent)
+{
+    const __be32 *ip;
+
+    do {
+        if ( np->parent && !parent )
+            np = np->parent;
+        parent = false;
+
+        ip = dt_get_property(np, "#size-cells", NULL);
+        if ( ip )
+            return be32_to_cpup(ip);
+    } while ( np->parent );
+    /* No #address-cells property for the root node */
+    return DT_ROOT_NODE_SIZE_CELLS_DEFAULT;
+}
+
+int dt_n_addr_cells(const struct dt_device_node *np)
+{
+    return __dt_n_addr_cells(np, false);
+}
+
+int dt_n_size_cells(const struct dt_device_node *np)
+{
+    return __dt_n_size_cells(np, false);
+}
+
+int dt_child_n_addr_cells(const struct dt_device_node *parent)
+{
+    return __dt_n_addr_cells(parent, true);
+}
+
+int dt_child_n_size_cells(const struct dt_device_node *parent)
+{
+    return __dt_n_size_cells(parent, true);
+}
+
+/*
+ * These are defined in Linux where much of this code comes from, but
+ * are currently unused outside this file in the context of Xen.
+ */
+#define IORESOURCE_BITS         0x000000ff      /* Bus-specific bits */
+
+#define IORESOURCE_TYPE_BITS    0x00001f00      /* Resource type */
+#define IORESOURCE_IO           0x00000100      /* PCI/ISA I/O ports */
+#define IORESOURCE_MEM          0x00000200
+#define IORESOURCE_REG          0x00000300      /* Register offsets */
+#define IORESOURCE_IRQ          0x00000400
+#define IORESOURCE_DMA          0x00000800
+#define IORESOURCE_BUS          0x00001000
+
+#define IORESOURCE_PREFETCH     0x00002000      /* No side effects */
+#define IORESOURCE_READONLY     0x00004000
+#define IORESOURCE_CACHEABLE    0x00008000
+#define IORESOURCE_RANGELENGTH  0x00010000
+#define IORESOURCE_SHADOWABLE   0x00020000
+
+/*
+ * Default translator (generic bus)
+ */
+static bool dt_bus_default_match(const struct dt_device_node *node)
+{
+    /* Root node doesn't have "ranges" property */
+    if ( node->parent == NULL )
+        return 1;
+
+    /* The default bus is only used when the "ranges" property exists.
+     * Otherwise we can't translate the address
+     */
+    return (dt_get_property(node, "ranges", NULL) != NULL);
+}
+
+static void dt_bus_default_count_cells(const struct dt_device_node *dev,
+                                int *addrc, int *sizec)
+{
+    if ( addrc )
+        *addrc = dt_n_addr_cells(dev);
+    if ( sizec )
+        *sizec = dt_n_size_cells(dev);
+}
+
+static u64 dt_bus_default_map(__be32 *addr, const __be32 *range,
+                              int na, int ns, int pna)
+{
+    u64 cp, s, da;
+
+    cp = dt_read_number(range, na);
+    s = dt_read_number(range + na + pna, ns);
+    da = dt_read_number(addr, na);
+
+    dt_dprintk("DT: default map, cp=%llx, s=%llx, da=%llx\n",
+               (unsigned long long)cp, (unsigned long long)s,
+               (unsigned long long)da);
+
+    /*
+     * If the number of address cells is larger than 2 we assume the
+     * mapping doesn't specify a physical address. Rather, the address
+     * specifies an identifier that must match exactly.
+     */
+    if ( na > 2 && memcmp(range, addr, na * 4) != 0 )
+        return DT_BAD_ADDR;
+
+    if ( da < cp || da >= (cp + s) )
+        return DT_BAD_ADDR;
+    return da - cp;
+}
+
+static int dt_bus_default_translate(__be32 *addr, u64 offset, int na)
+{
+    u64 a = dt_read_number(addr, na);
+
+    memset(addr, 0, na * 4);
+    a += offset;
+    if ( na > 1 )
+        addr[na - 2] = cpu_to_be32(a >> 32);
+    addr[na - 1] = cpu_to_be32(a & 0xffffffffu);
+
+    return 0;
+}
+static unsigned int dt_bus_default_get_flags(const __be32 *addr)
+{
+    return IORESOURCE_MEM;
+}
+
+/*
+ * PCI bus specific translator
+ */
+
+static bool dt_node_is_pci(const struct dt_device_node *np)
+{
+    bool is_pci = !strcmp(np->name, "pcie") || !strcmp(np->name, "pci");
+
+    if ( is_pci )
+        printk(XENLOG_WARNING "%s: Missing device_type\n", np->full_name);
+
+    return is_pci;
+}
+
+static bool dt_bus_pci_match(const struct dt_device_node *np)
+{
+    /*
+     * "pciex" is PCI Express "vci" is for the /chaos bridge on 1st-gen PCI
+     * powermacs "ht" is hypertransport
+     *
+     * If none of the device_type match, and that the node name is
+     * "pcie" or "pci", accept the device as PCI (with a warning).
+     */
+    return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex") ||
+        !strcmp(np->type, "vci") || !strcmp(np->type, "ht") ||
+        dt_node_is_pci(np);
+}
+
+static void dt_bus_pci_count_cells(const struct dt_device_node *np,
+				   int *addrc, int *sizec)
+{
+    if (addrc)
+        *addrc = 3;
+    if (sizec)
+        *sizec = 2;
+}
+
+static unsigned int dt_bus_pci_get_flags(const __be32 *addr)
+{
+    unsigned int flags = 0;
+    u32 w = be32_to_cpup(addr);
+
+    switch((w >> 24) & 0x03) {
+    case 0x01:
+        flags |= IORESOURCE_IO;
+        break;
+    case 0x02: /* 32 bits */
+    case 0x03: /* 64 bits */
+        flags |= IORESOURCE_MEM;
+        break;
+    }
+    if (w & 0x40000000)
+        flags |= IORESOURCE_PREFETCH;
+    return flags;
+}
+
+static u64 dt_bus_pci_map(__be32 *addr, const __be32 *range, int na, int ns,
+		int pna)
+{
+    u64 cp, s, da;
+    unsigned int af, rf;
+
+    af = dt_bus_pci_get_flags(addr);
+    rf = dt_bus_pci_get_flags(range);
+
+    /* Check address type match */
+    if ((af ^ rf) & (IORESOURCE_MEM | IORESOURCE_IO))
+        return DT_BAD_ADDR;
+
+    /* Read address values, skipping high cell */
+    cp = dt_read_number(range + 1, na - 1);
+    s  = dt_read_number(range + na + pna, ns);
+    da = dt_read_number(addr + 1, na - 1);
+
+    dt_dprintk("DT: PCI map, cp=%llx, s=%llx, da=%llx\n",
+               (unsigned long long)cp, (unsigned long long)s,
+               (unsigned long long)da);
+
+    if (da < cp || da >= (cp + s))
+        return DT_BAD_ADDR;
+    return da - cp;
+}
+
+static int dt_bus_pci_translate(__be32 *addr, u64 offset, int na)
+{
+    return dt_bus_default_translate(addr + 1, offset, na - 1);
+}
+
+/*
+ * Array of bus specific translators
+ */
+static const struct dt_bus dt_busses[] =
+{
+    /* PCI */
+    {
+        .name = "pci",
+        .addresses = "assigned-addresses",
+        .match = dt_bus_pci_match,
+        .count_cells = dt_bus_pci_count_cells,
+        .map = dt_bus_pci_map,
+        .translate = dt_bus_pci_translate,
+        .get_flags = dt_bus_pci_get_flags,
+    },
+    /* Default */
+    {
+        .name = "default",
+        .addresses = "reg",
+        .match = dt_bus_default_match,
+        .count_cells = dt_bus_default_count_cells,
+        .map = dt_bus_default_map,
+        .translate = dt_bus_default_translate,
+        .get_flags = dt_bus_default_get_flags,
+    },
+};
+
+static const struct dt_bus *dt_match_bus(const struct dt_device_node *np)
+{
+    int i;
+
+    for ( i = 0; i < ARRAY_SIZE(dt_busses); i++ )
+        if ( !dt_busses[i].match || dt_busses[i].match(np) )
+            return &dt_busses[i];
+
+    return NULL;
+}
+
+static const __be32 *dt_get_address(const struct dt_device_node *dev,
+                                    unsigned int index, u64 *size,
+                                    unsigned int *flags)
+{
+    const __be32 *prop;
+    u32 psize;
+    const struct dt_device_node *parent;
+    const struct dt_bus *bus;
+    int onesize, i, na, ns;
+
+    /* Get parent & match bus type */
+    parent = dt_get_parent(dev);
+    if ( parent == NULL )
+        return NULL;
+
+    bus = dt_match_bus(parent);
+    if ( !bus )
+        return NULL;
+    bus->count_cells(dev, &na, &ns);
+
+    if ( !DT_CHECK_ADDR_COUNT(na) )
+        return NULL;
+
+    /* Get "reg" or "assigned-addresses" property */
+    prop = dt_get_property(dev, bus->addresses, &psize);
+    if ( prop == NULL )
+        return NULL;
+    psize /= 4;
+
+    onesize = na + ns;
+    for ( i = 0; psize >= onesize; psize -= onesize, prop += onesize, i++ )
+    {
+        if ( i == index )
+        {
+            if ( size )
+                *size = dt_read_number(prop + na, ns);
+            if ( flags )
+                *flags = bus->get_flags(prop);
+            return prop;
+        }
+    }
+    return NULL;
+}
+
+static int dt_translate_one(const struct dt_device_node *parent,
+                            const struct dt_bus *bus,
+                            const struct dt_bus *pbus,
+                            __be32 *addr, int na, int ns,
+                            int pna, const char *rprop)
+{
+    const __be32 *ranges;
+    unsigned int rlen;
+    int rone;
+    u64 offset = DT_BAD_ADDR;
+
+    ranges = dt_get_property(parent, rprop, &rlen);
+    if ( ranges == NULL )
+    {
+        printk(XENLOG_ERR "DT: no ranges; cannot translate\n");
+        return 1;
+    }
+    if ( rlen == 0 )
+    {
+        offset = dt_read_number(addr, na);
+        memset(addr, 0, pna * 4);
+        dt_dprintk("DT: empty ranges; 1:1 translation\n");
+        goto finish;
+    }
+
+    dt_dprintk("DT: walking ranges...\n");
+
+    /* Now walk through the ranges */
+    rlen /= 4;
+    rone = na + pna + ns;
+    for ( ; rlen >= rone; rlen -= rone, ranges += rone )
+    {
+        offset = bus->map(addr, ranges, na, ns, pna);
+        if ( offset != DT_BAD_ADDR )
+            break;
+    }
+    if ( offset == DT_BAD_ADDR )
+    {
+        dt_dprintk("DT: not found !\n");
+        return 1;
+    }
+    memcpy(addr, ranges + na, 4 * pna);
+
+finish:
+    dt_dump_addr("DT: parent translation for:", addr, pna);
+    dt_dprintk("DT: with offset: %llx\n", (unsigned long long)offset);
+
+    /* Translate it into parent bus space */
+    return pbus->translate(addr, offset, pna);
+}
+
+/*
+ * Translate an address from the device-tree into a CPU physical address,
+ * this walks up the tree and applies the various bus mappings on the
+ * way.
+ *
+ * Note: We consider that crossing any level with #size-cells == 0 to mean
+ * that translation is impossible (that is we are not dealing with a value
+ * that can be mapped to a cpu physical address). This is not really specified
+ * that way, but this is traditionally the way IBM at least do things
+ */
+static u64 __dt_translate_address(const struct dt_device_node *dev,
+                                  const __be32 *in_addr, const char *rprop)
+{
+    const struct dt_device_node *parent = NULL;
+    const struct dt_bus *bus, *pbus;
+    __be32 addr[DT_MAX_ADDR_CELLS];
+    int na, ns, pna, pns;
+    u64 result = DT_BAD_ADDR;
+
+    dt_dprintk("DT: ** translation for device %s **\n", dev->full_name);
+
+    /* Get parent & match bus type */
+    parent = dt_get_parent(dev);
+    if ( parent == NULL )
+        goto bail;
+    bus = dt_match_bus(parent);
+    if ( !bus )
+        goto bail;
+
+    /* Count address cells & copy address locally */
+    bus->count_cells(dev, &na, &ns);
+    if ( !DT_CHECK_COUNTS(na, ns) )
+    {
+        printk(XENLOG_ERR "dt_parse: Bad cell count for device %s\n",
+                  dev->full_name);
+        goto bail;
+    }
+    memcpy(addr, in_addr, na * 4);
+
+    dt_dprintk("DT: bus is %s (na=%d, ns=%d) on %s\n",
+               bus->name, na, ns, parent->full_name);
+    dt_dump_addr("DT: translating address:", addr, na);
+
+    /* Translate */
+    for ( ;; )
+    {
+        /* Switch to parent bus */
+        dev = parent;
+        parent = dt_get_parent(dev);
+
+        /* If root, we have finished */
+        if ( parent == NULL )
+        {
+            dt_dprintk("DT: reached root node\n");
+            result = dt_read_number(addr, na);
+            break;
+        }
+
+        /* Get new parent bus and counts */
+        pbus = dt_match_bus(parent);
+        if ( pbus == NULL )
+        {
+            printk("DT: %s is not a valid bus\n", parent->full_name);
+            break;
+        }
+        pbus->count_cells(dev, &pna, &pns);
+        if ( !DT_CHECK_COUNTS(pna, pns) )
+        {
+            printk(XENLOG_ERR "dt_parse: Bad cell count for parent %s\n",
+                   dev->full_name);
+            break;
+        }
+
+        dt_dprintk("DT: parent bus is %s (na=%d, ns=%d) on %s\n",
+                   pbus->name, pna, pns, parent->full_name);
+
+        /* Apply bus translation */
+        if ( dt_translate_one(dev, bus, pbus, addr, na, ns, pna, rprop) )
+            break;
+
+        /* Complete the move up one level */
+        na = pna;
+        ns = pns;
+        bus = pbus;
+
+        dt_dump_addr("DT: one level translation:", addr, na);
+    }
+
+bail:
+    return result;
+}
+
+/* dt_device_address - Translate device tree address and return it */
+int dt_device_get_address(const struct dt_device_node *dev, unsigned int index,
+                          u64 *addr, u64 *size)
+{
+    const __be32 *addrp;
+    unsigned int flags;
+
+    addrp = dt_get_address(dev, index, size, &flags);
+    if ( addrp == NULL )
+        return -EINVAL;
+
+    if ( !addr )
+        return -EINVAL;
+
+    *addr = __dt_translate_address(dev, addrp, "ranges");
+
+    if ( *addr == DT_BAD_ADDR )
+        return -EINVAL;
+
+    return 0;
+}
+
+int dt_device_get_paddr(const struct dt_device_node *dev, unsigned int index,
+                        paddr_t *addr, paddr_t *size)
+{
+    uint64_t dt_addr, dt_size;
+    int ret;
+
+    ret = dt_device_get_address(dev, index, &dt_addr, &dt_size);
+    if ( ret )
+        return ret;
+
+    if ( !addr )
+        return -EINVAL;
+
+    if ( dt_addr != (paddr_t)dt_addr )
+    {
+        printk("Error: Physical address 0x%"PRIx64" for node=%s is greater than max width (%zu bytes) supported\n",
+               dt_addr, dev->name, sizeof(paddr_t));
+        return -ERANGE;
+    }
+
+    *addr = dt_addr;
+
+    if ( size )
+    {
+        if ( dt_size != (paddr_t)dt_size )
+        {
+            printk("Error: Physical size 0x%"PRIx64" for node=%s is greater than max width (%zu bytes) supported\n",
+                   dt_size, dev->name, sizeof(paddr_t));
+            return -ERANGE;
+        }
+
+        *size = dt_size;
+    }
+
+    return ret;
+}
+
+int dt_for_each_range(const struct dt_device_node *dev,
+                      int (*cb)(const struct dt_device_node *dev,
+                                uint64_t addr, uint64_t length,
+                                void *data),
+                      void *data)
+{
+    const struct dt_device_node *parent = NULL;
+    const struct dt_bus *bus, *pbus;
+    const __be32 *ranges;
+    __be32 addr[DT_MAX_ADDR_CELLS];
+    unsigned int rlen;
+    int na, ns, pna, pns, rone;
+
+    bus = dt_match_bus(dev);
+    if ( !bus )
+        return 0; /* device is not a bus */
+
+    parent = dt_get_parent(dev);
+    if ( parent == NULL )
+        return -EINVAL;
+
+    ranges = dt_get_property(dev, "ranges", &rlen);
+    if ( ranges == NULL )
+    {
+        printk(XENLOG_ERR "DT: no ranges; cannot enumerate %s\n",
+               dev->full_name);
+        return -EINVAL;
+    }
+    if ( rlen == 0 ) /* Nothing to do */
+        return 0;
+
+    bus->count_cells(dev, &na, &ns);
+    if ( !DT_CHECK_COUNTS(na, ns) )
+    {
+        printk(XENLOG_ERR "dt_parse: Bad cell count for device %s\n",
+                  dev->full_name);
+        return -EINVAL;
+    }
+
+    pbus = dt_match_bus(parent);
+    if ( pbus == NULL )
+    {
+        printk("DT: %s is not a valid bus\n", parent->full_name);
+        return -EINVAL;
+    }
+
+    pbus->count_cells(dev, &pna, &pns);
+    if ( !DT_CHECK_COUNTS(pna, pns) )
+    {
+        printk(XENLOG_ERR "dt_parse: Bad cell count for parent %s\n",
+               dev->full_name);
+        return -EINVAL;
+    }
+
+    /* Now walk through the ranges */
+    rlen /= 4;
+    rone = na + pna + ns;
+
+    dt_dprintk("%s: dev=%s, bus=%s, parent=%s, rlen=%d, rone=%d\n",
+               __func__,
+               dt_node_name(dev), bus->name,
+               dt_node_name(parent), rlen, rone);
+
+    for ( ; rlen >= rone; rlen -= rone, ranges += rone )
+    {
+        uint64_t a, s;
+        int ret;
+
+        memcpy(addr, ranges + na, 4 * pna);
+
+        a = __dt_translate_address(dev, addr, "ranges");
+        s = dt_read_number(ranges + na + pna, ns);
+
+        ret = cb(dev, a, s, data);
+        if ( ret )
+        {
+            dt_dprintk(" -> callback failed=%d\n", ret);
+            return ret;
+        }
+
+    }
+
+    return 0;
+}
+
+/**
+ * dt_find_node_by_phandle - Find a node given a phandle
+ * @handle: phandle of the node to find
+ *
+ * Returns a node pointer.
+ */
+struct dt_device_node *dt_find_node_by_phandle(dt_phandle handle)
+{
+    struct dt_device_node *np;
+
+    dt_for_each_device_node(dt_host, np)
+        if ( np->phandle == handle )
+            break;
+
+    return np;
+}
+
+/**
+ * dt_irq_find_parent - Given a device node, find its interrupt parent node
+ * @child: pointer to device node
+ *
+ * Returns a pointer to the interrupt parent node, or NULL if the interrupt
+ * parent could not be determined.
+ */
+static const struct dt_device_node *
+dt_irq_find_parent(const struct dt_device_node *child)
+{
+    const struct dt_device_node *p;
+    const __be32 *parp;
+
+    do
+    {
+        parp = dt_get_property(child, "interrupt-parent", NULL);
+        if ( parp == NULL )
+            p = dt_get_parent(child);
+        else
+            p = dt_find_node_by_phandle(be32_to_cpup(parp));
+        child = p;
+    } while ( p && dt_get_property(p, "#interrupt-cells", NULL) == NULL );
+
+    return p;
+}
+
+unsigned int dt_number_of_irq(const struct dt_device_node *device)
+{
+    const struct dt_device_node *p;
+    const __be32 *intspec, *tmp;
+    u32 intsize, intlen;
+    int intnum;
+
+    dt_dprintk("dt_irq_number: dev=%s\n", device->full_name);
+
+    /* Try the new-style interrupts-extended first */
+    intnum = dt_count_phandle_with_args(device, "interrupts-extended",
+                                        "#interrupt-cells");
+    if ( intnum >= 0 )
+    {
+        dt_dprintk(" using 'interrupts-extended' property\n");
+        dt_dprintk(" intnum=%d\n", intnum);
+        return intnum;
+    }
+
+    /* Get the interrupts property */
+    intspec = dt_get_property(device, "interrupts", &intlen);
+    if ( intspec == NULL )
+        return 0;
+    intlen /= sizeof(*intspec);
+
+    dt_dprintk(" using 'interrupts' property\n");
+    dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
+
+    /* Look for the interrupt parent. */
+    p = dt_irq_find_parent(device);
+    if ( p == NULL )
+        return 0;
+
+    /* Get size of interrupt specifier */
+    tmp = dt_get_property(p, "#interrupt-cells", NULL);
+    if ( tmp == NULL )
+        return 0;
+    intsize = be32_to_cpu(*tmp);
+
+    dt_dprintk(" intsize=%d intlen=%d\n", intsize, intlen);
+
+    return (intlen / intsize);
+}
+
+unsigned int dt_number_of_address(const struct dt_device_node *dev)
+{
+    const __be32 *prop;
+    u32 psize;
+    const struct dt_device_node *parent;
+    const struct dt_bus *bus;
+    int onesize, na, ns;
+
+    /* Get parent & match bus type */
+    parent = dt_get_parent(dev);
+    if ( parent == NULL )
+        return 0;
+
+    bus = dt_match_bus(parent);
+    if ( !bus )
+        return 0;
+    bus->count_cells(dev, &na, &ns);
+
+    if ( !DT_CHECK_COUNTS(na, ns) )
+        return 0;
+
+    /* Get "reg" or "assigned-addresses" property */
+    prop = dt_get_property(dev, bus->addresses, &psize);
+    if ( prop == NULL )
+        return 0;
+
+    psize /= 4;
+    onesize = na + ns;
+
+    return (psize / onesize);
+}
+
+int dt_for_each_irq_map(const struct dt_device_node *dev,
+                        int (*cb)(const struct dt_device_node *dev,
+                                  const struct dt_irq *dt_irq,
+                                  void *data),
+                        void *data)
+{
+    const struct dt_device_node *ipar, *tnode, *old = NULL;
+    const __be32 *tmp, *imap;
+    u32 intsize = 1, addrsize, pintsize = 0, paddrsize = 0;
+    u32 imaplen;
+    int i, ret;
+
+    struct dt_raw_irq dt_raw_irq;
+    struct dt_irq dt_irq;
+
+    dt_dprintk("%s: par=%s cb=%p data=%p\n", __func__,
+               dev->full_name, cb, data);
+
+    ipar = dev;
+
+    /* First get the #interrupt-cells property of the current cursor
+     * that tells us how to interpret the passed-in intspec. If there
+     * is none, we are nice and just walk up the tree
+     */
+    do {
+        tmp = dt_get_property(ipar, "#interrupt-cells", NULL);
+        if ( tmp != NULL )
+        {
+            intsize = be32_to_cpu(*tmp);
+            break;
+        }
+        tnode = ipar;
+        ipar = dt_irq_find_parent(ipar);
+    } while ( ipar );
+    if ( ipar == NULL )
+    {
+        dt_dprintk(" -> no parent found !\n");
+        goto fail;
+    }
+
+    dt_dprintk("%s: ipar=%s, size=%d\n", __func__, ipar->full_name, intsize);
+
+    if ( intsize > DT_MAX_IRQ_SPEC )
+    {
+        dt_dprintk(" -> too many irq specifier cells\n");
+        goto fail;
+    }
+
+    /* Look for this #address-cells. We have to implement the old linux
+     * trick of looking for the parent here as some device-trees rely on it
+     */
+    old = ipar;
+    do {
+        tmp = dt_get_property(old, "#address-cells", NULL);
+        tnode = dt_get_parent(old);
+        old = tnode;
+    } while ( old && tmp == NULL );
+
+    old = NULL;
+    addrsize = (tmp == NULL) ? 2 : be32_to_cpu(*tmp);
+
+    dt_dprintk(" -> addrsize=%d\n", addrsize);
+
+    /* Now look for an interrupt-map */
+    imap = dt_get_property(dev, "interrupt-map", &imaplen);
+    /* No interrupt-map found. Ignore */
+    if ( imap == NULL )
+    {
+        dt_dprintk(" -> no map, ignoring\n");
+        return 0;
+    }
+    imaplen /= sizeof(u32);
+
+    /* Parse interrupt-map */
+    while ( imaplen > (addrsize + intsize + 1) )
+    {
+        /* skip child unit address and child interrupt specifier */
+        imap += addrsize + intsize;
+        imaplen -= addrsize + intsize;
+
+        /* Get the interrupt parent */
+        ipar = dt_find_node_by_phandle(be32_to_cpup(imap));
+        imap++;
+        --imaplen;
+
+        /* Check if not found */
+        if ( ipar == NULL )
+        {
+            dt_dprintk(" -> imap parent not found !\n");
+            goto fail;
+        }
+
+        dt_dprintk(" -> ipar %s\n", dt_node_name(ipar));
+
+        /* Get #interrupt-cells and #address-cells of new
+         * parent
+         */
+        tmp = dt_get_property(ipar, "#interrupt-cells", NULL);
+        if ( tmp == NULL )
+        {
+            dt_dprintk(" -> parent lacks #interrupt-cells!\n");
+            goto fail;
+        }
+        pintsize = be32_to_cpu(*tmp);
+        tmp = dt_get_property(ipar, "#address-cells", NULL);
+        paddrsize = (tmp == NULL) ? 0 : be32_to_cpu(*tmp);
+
+        dt_dprintk(" -> pintsize=%d, paddrsize=%d\n",
+                   pintsize, paddrsize);
+
+        if ( pintsize > DT_MAX_IRQ_SPEC )
+        {
+            dt_dprintk(" -> too many irq specifier cells in parent\n");
+            goto fail;
+        }
+
+        /* Check for malformed properties */
+        if ( imaplen < (paddrsize + pintsize) )
+            goto fail;
+
+        imap += paddrsize;
+        imaplen -= paddrsize;
+
+        dt_raw_irq.controller = ipar;
+        dt_raw_irq.size = pintsize;
+        for ( i = 0; i < pintsize; i++ )
+            dt_raw_irq.specifier[i] = dt_read_number(imap + i, 1);
+
+        if ( dt_raw_irq.controller != dt_interrupt_controller )
+        {
+            /*
+             * We don't map IRQs connected to secondary IRQ controllers as
+             * these IRQs have no meaning to us until they connect to the
+             * primary controller.
+             *
+             * Secondary IRQ controllers will at some point connect to
+             * the primary controller (possibly via other IRQ controllers).
+             * We map the IRQs at that last connection point.
+             */
+            imap += pintsize;
+            imaplen -= pintsize;
+            dt_dprintk(" -> Skipped IRQ for secondary IRQ controller\n");
+            continue;
+        }
+
+        ret = dt_irq_translate(&dt_raw_irq, &dt_irq);
+        if ( ret )
+        {
+            dt_dprintk(" -> failed to translate IRQ: %d\n", ret);
+            return ret;
+        }
+
+        ret = cb(dev, &dt_irq, data);
+        if ( ret )
+        {
+            dt_dprintk(" -> callback failed=%d\n", ret);
+            return ret;
+        }
+
+        imap += pintsize;
+        imaplen -= pintsize;
+
+        dt_dprintk(" -> imaplen=%d\n", imaplen);
+    }
+
+    return 0;
+
+fail:
+    return -EINVAL;
+}
+
+/**
+ * dt_irq_map_raw - Low level interrupt tree parsing
+ * @parent:     the device interrupt parent
+ * @intspec:    interrupt specifier ("interrupts" property of the device)
+ * @ointsize:   size of the passed in interrupt specifier
+ * @addr:       address specifier (start of "reg" property of the device)
+ * @oirq:       structure dt_raw_irq filled by this function
+ *
+ * Returns 0 on success and a negative number on error
+ *
+ * This function is a low-level interrupt tree walking function. It
+ * can be used to do a partial walk with synthesized reg and interrupts
+ * properties, for example when resolving PCI interrupts when no device
+ * node exist for the parent.
+ */
+static int dt_irq_map_raw(const struct dt_device_node *parent,
+                          const __be32 *intspec, u32 ointsize,
+                          const __be32 *addr,
+                          struct dt_raw_irq *oirq)
+{
+    const struct dt_device_node *ipar, *tnode, *old = NULL, *newpar = NULL;
+    const __be32 *tmp, *imap, *imask;
+    u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0;
+    u32 imaplen;
+    int match, i;
+
+    dt_dprintk("dt_irq_map_raw: par=%s,intspec=[0x%08x 0x%08x...],ointsize=%d\n",
+               parent->full_name, be32_to_cpup(intspec),
+               be32_to_cpup(intspec + 1), ointsize);
+
+    ipar = parent;
+
+    /* First get the #interrupt-cells property of the current cursor
+     * that tells us how to interpret the passed-in intspec. If there
+     * is none, we are nice and just walk up the tree
+     */
+    do {
+        tmp = dt_get_property(ipar, "#interrupt-cells", NULL);
+        if ( tmp != NULL )
+        {
+            intsize = be32_to_cpu(*tmp);
+            break;
+        }
+        tnode = ipar;
+        ipar = dt_irq_find_parent(ipar);
+    } while ( ipar );
+    if ( ipar == NULL )
+    {
+        dt_dprintk(" -> no parent found !\n");
+        goto fail;
+    }
+
+    dt_dprintk("dt_irq_map_raw: ipar=%s, size=%d\n", ipar->full_name, intsize);
+
+    if ( ointsize != intsize )
+        return -EINVAL;
+
+    /* Look for this #address-cells. We have to implement the old linux
+     * trick of looking for the parent here as some device-trees rely on it
+     */
+    old = ipar;
+    do {
+        tmp = dt_get_property(old, "#address-cells", NULL);
+        tnode = dt_get_parent(old);
+        old = tnode;
+    } while ( old && tmp == NULL );
+
+    old = NULL;
+    addrsize = (tmp == NULL) ? 2 : be32_to_cpu(*tmp);
+
+    dt_dprintk(" -> addrsize=%d\n", addrsize);
+
+    /* Now start the actual "proper" walk of the interrupt tree */
+    while ( ipar != NULL )
+    {
+        /* Now check if cursor is an interrupt-controller and if it is
+         * then we are done
+         */
+        if ( dt_get_property(ipar, "interrupt-controller", NULL) != NULL )
+        {
+            dt_dprintk(" -> got it !\n");
+            if ( intsize > DT_MAX_IRQ_SPEC )
+            {
+                dt_dprintk(" -> intsize(%u) greater than DT_MAX_IRQ_SPEC(%u)\n",
+                           intsize, DT_MAX_IRQ_SPEC);
+                goto fail;
+            }
+            for ( i = 0; i < intsize; i++ )
+                oirq->specifier[i] = dt_read_number(intspec + i, 1);
+            oirq->size = intsize;
+            oirq->controller = ipar;
+            return 0;
+        }
+
+        /* Now look for an interrupt-map */
+        imap = dt_get_property(ipar, "interrupt-map", &imaplen);
+        /* No interrupt map, check for an interrupt parent */
+        if ( imap == NULL )
+        {
+            dt_dprintk(" -> no map, getting parent\n");
+            newpar = dt_irq_find_parent(ipar);
+            goto skiplevel;
+        }
+        imaplen /= sizeof(u32);
+
+        /* Look for a mask */
+        imask = dt_get_property(ipar, "interrupt-map-mask", NULL);
+
+        /* If we were passed no "reg" property and we attempt to parse
+         * an interrupt-map, then #address-cells must be 0.
+         * Fail if it's not.
+         */
+        if ( addr == NULL && addrsize != 0 )
+        {
+            dt_dprintk(" -> no reg passed in when needed !\n");
+            goto fail;
+        }
+
+        /* Parse interrupt-map */
+        match = 0;
+        while ( imaplen > (addrsize + intsize + 1) && !match )
+        {
+            /* Compare specifiers */
+            match = 1;
+            for ( i = 0; i < addrsize && match; ++i )
+            {
+                __be32 mask = imask ? imask[i] : cpu_to_be32(0xffffffffu);
+                match = ((addr[i] ^ imap[i]) & mask) == 0;
+            }
+            for ( ; i < (addrsize + intsize) && match; ++i )
+            {
+                __be32 mask = imask ? imask[i] : cpu_to_be32(0xffffffffu);
+                match = ((intspec[i-addrsize] ^ imap[i]) & mask) == 0;
+            }
+            imap += addrsize + intsize;
+            imaplen -= addrsize + intsize;
+
+            dt_dprintk(" -> match=%d (imaplen=%d)\n", match, imaplen);
+
+            /* Get the interrupt parent */
+            newpar = dt_find_node_by_phandle(be32_to_cpup(imap));
+            imap++;
+            --imaplen;
+
+            /* Check if not found */
+            if ( newpar == NULL )
+            {
+                dt_dprintk(" -> imap parent not found !\n");
+                goto fail;
+            }
+
+            /* Get #interrupt-cells and #address-cells of new
+             * parent
+             */
+            tmp = dt_get_property(newpar, "#interrupt-cells", NULL);
+            if ( tmp == NULL )
+            {
+                dt_dprintk(" -> parent lacks #interrupt-cells!\n");
+                goto fail;
+            }
+            newintsize = be32_to_cpu(*tmp);
+            tmp = dt_get_property(newpar, "#address-cells", NULL);
+            newaddrsize = (tmp == NULL) ? 0 : be32_to_cpu(*tmp);
+
+            dt_dprintk(" -> newintsize=%d, newaddrsize=%d\n",
+                       newintsize, newaddrsize);
+
+            /* Check for malformed properties */
+            if ( imaplen < (newaddrsize + newintsize) )
+                goto fail;
+
+            imap += newaddrsize + newintsize;
+            imaplen -= newaddrsize + newintsize;
+
+            dt_dprintk(" -> imaplen=%d\n", imaplen);
+        }
+        if ( !match )
+            goto fail;
+
+        old = newpar;
+        addrsize = newaddrsize;
+        intsize = newintsize;
+        intspec = imap - intsize;
+        addr = intspec - addrsize;
+
+    skiplevel:
+        /* Iterate again with new parent */
+        dt_dprintk(" -> new parent: %s\n", dt_node_full_name(newpar));
+        ipar = newpar;
+        newpar = NULL;
+    }
+fail:
+    return -EINVAL;
+}
+
+int dt_device_get_raw_irq(const struct dt_device_node *device,
+                          unsigned int index,
+                          struct dt_raw_irq *out_irq)
+{
+    const struct dt_device_node *p;
+    const __be32 *intspec, *tmp, *addr;
+    u32 intsize, intlen;
+    int res = -EINVAL;
+    struct dt_phandle_args args;
+    int i;
+
+    dt_dprintk("dt_device_get_raw_irq: dev=%s, index=%u\n",
+               device->full_name, index);
+
+    /* Get the reg property (if any) */
+    addr = dt_get_property(device, "reg", NULL);
+
+    /* Try the new-style interrupts-extended first */
+    res = dt_parse_phandle_with_args(device, "interrupts-extended",
+                                     "#interrupt-cells", index, &args);
+    if ( !res )
+    {
+        dt_dprintk(" using 'interrupts-extended' property\n");
+        dt_dprintk(" intspec=%d intsize=%d\n", args.args[0], args.args_count);
+
+        for ( i = 0; i < args.args_count; i++ )
+            args.args[i] = cpu_to_be32(args.args[i]);
+
+        return dt_irq_map_raw(args.np, args.args, args.args_count,
+                              addr, out_irq);
+    }
+
+    /* Get the interrupts property */
+    intspec = dt_get_property(device, "interrupts", &intlen);
+    if ( intspec == NULL )
+        return -EINVAL;
+    intlen /= sizeof(*intspec);
+
+    dt_dprintk(" using 'interrupts' property\n");
+    dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
+
+    /* Look for the interrupt parent. */
+    p = dt_irq_find_parent(device);
+    if ( p == NULL )
+        return -EINVAL;
+
+    /* Get size of interrupt specifier */
+    tmp = dt_get_property(p, "#interrupt-cells", NULL);
+    if ( tmp == NULL )
+        goto out;
+    intsize = be32_to_cpu(*tmp);
+
+    dt_dprintk(" intsize=%d intlen=%d\n", intsize, intlen);
+
+    /* Check index */
+    if ( (index + 1) * intsize > intlen )
+        goto out;
+
+    /* Get new specifier and map it */
+    res = dt_irq_map_raw(p, intspec + index * intsize, intsize,
+                         addr, out_irq);
+    if ( res )
+        goto out;
+out:
+    return res;
+}
+
+int dt_irq_translate(const struct dt_raw_irq *raw,
+                     struct dt_irq *out_irq)
+{
+    ASSERT(dt_irq_xlate != NULL);
+    ASSERT(dt_interrupt_controller != NULL);
+
+    /*
+     * TODO: Retrieve the right irq_xlate. This is only works for the primary
+     * interrupt controller.
+     */
+    if ( raw->controller != dt_interrupt_controller )
+        return -EINVAL;
+
+    return dt_irq_xlate(raw->specifier, raw->size,
+                        &out_irq->irq, &out_irq->type);
+}
+
+int dt_device_get_irq(const struct dt_device_node *device, unsigned int index,
+                      struct dt_irq *out_irq)
+{
+    struct dt_raw_irq raw;
+    int res;
+
+    res = dt_device_get_raw_irq(device, index, &raw);
+
+    if ( res )
+        return res;
+
+    return dt_irq_translate(&raw, out_irq);
+}
+
+bool dt_device_is_available(const struct dt_device_node *device)
+{
+    const char *status;
+    u32 statlen;
+
+    status = dt_get_property(device, "status", &statlen);
+    if ( status == NULL )
+        return 1;
+
+    if ( statlen > 0 )
+    {
+        if ( !strcmp(status, "okay") || !strcmp(status, "ok") )
+            return 1;
+    }
+
+    return 0;
+}
+
+bool dt_device_for_passthrough(const struct dt_device_node *device)
+{
+    return (dt_find_property(device, "xen,passthrough", NULL) != NULL);
+
+}
+
+static int __dt_parse_phandle_with_args(const struct dt_device_node *np,
+                                        const char *list_name,
+                                        const char *cells_name,
+                                        int cell_count, int index,
+                                        struct dt_phandle_args *out_args)
+{
+    const __be32 *list, *list_end;
+    int rc = 0, cur_index = 0;
+    u32 size, count = 0;
+    struct dt_device_node *node = NULL;
+    dt_phandle phandle;
+
+    /* Retrieve the phandle list property */
+    list = dt_get_property(np, list_name, &size);
+    if ( !list )
+        return -ENOENT;
+    list_end = list + size / sizeof(*list);
+
+    /* Loop over the phandles until all the requested entry is found */
+    while ( list < list_end )
+    {
+        rc = -EINVAL;
+        count = 0;
+
+        /*
+         * If phandle is 0, then it is an empty entry with no
+         * arguments.  Skip forward to the next entry.
+         * */
+        phandle = be32_to_cpup(list++);
+        if ( phandle )
+        {
+            /*
+             * Find the provider node and parse the #*-cells
+             * property to determine the argument length.
+             *
+             * This is not needed if the cell count is hard-coded
+             * (i.e. cells_name not set, but cell_count is set),
+             * except when we're going to return the found node
+             * below.
+             */
+            if ( cells_name || cur_index == index )
+            {
+                node = dt_find_node_by_phandle(phandle);
+                if ( !node )
+                {
+                    printk(XENLOG_ERR "%s: could not find phandle\n",
+                           np->full_name);
+                    goto err;
+                }
+            }
+
+            if ( cells_name )
+            {
+                if ( !dt_property_read_u32(node, cells_name, &count) )
+                {
+                    printk("%s: could not get %s for %s\n",
+                           np->full_name, cells_name, node->full_name);
+                    goto err;
+                }
+            }
+            else
+                count = cell_count;
+
+            /*
+             * Make sure that the arguments actually fit in the
+             * remaining property data length
+             */
+            if ( list + count > list_end )
+            {
+                printk(XENLOG_ERR "%s: arguments longer than property\n",
+                       np->full_name);
+                goto err;
+            }
+        }
+
+        /*
+         * All of the error cases above bail out of the loop, so at
+         * this point, the parsing is successful. If the requested
+         * index matches, then fill the out_args structure and return,
+         * or return -ENOENT for an empty entry.
+         */
+        rc = -ENOENT;
+        if ( cur_index == index )
+        {
+            if (!phandle)
+                goto err;
+
+            if ( out_args )
+            {
+                int i;
+
+                WARN_ON(count > MAX_PHANDLE_ARGS);
+                if (count > MAX_PHANDLE_ARGS)
+                    count = MAX_PHANDLE_ARGS;
+                out_args->np = node;
+                out_args->args_count = count;
+                for ( i = 0; i < count; i++ )
+                    out_args->args[i] = be32_to_cpup(list++);
+            }
+
+            /* Found it! return success */
+            return 0;
+        }
+
+        node = NULL;
+        list += count;
+        cur_index++;
+    }
+
+    /*
+     * Returning result will be one of:
+     * -ENOENT : index is for empty phandle
+     * -EINVAL : parsing error on data
+     * [1..n]  : Number of phandle (count mode; when index = -1)
+     */
+    rc = index < 0 ? cur_index : -ENOENT;
+err:
+    return rc;
+}
+
+struct dt_device_node *dt_parse_phandle(const struct dt_device_node *np,
+                                        const char *phandle_name, int index)
+{
+    struct dt_phandle_args args;
+
+    if (index < 0)
+        return NULL;
+
+    if (__dt_parse_phandle_with_args(np, phandle_name, NULL, 0,
+                                     index, &args))
+        return NULL;
+
+    return args.np;
+}
+
+
+int dt_parse_phandle_with_args(const struct dt_device_node *np,
+                               const char *list_name,
+                               const char *cells_name, int index,
+                               struct dt_phandle_args *out_args)
+{
+    if ( index < 0 )
+        return -EINVAL;
+    return __dt_parse_phandle_with_args(np, list_name, cells_name, 0,
+                                        index, out_args);
+}
+
+int dt_count_phandle_with_args(const struct dt_device_node *np,
+                               const char *list_name,
+                               const char *cells_name)
+{
+    return __dt_parse_phandle_with_args(np, list_name, cells_name, 0, -1, NULL);
+}
+
+/**
+ * unflatten_dt_node - Alloc and populate a device_node from the flat tree
+ * @fdt: The parent device tree blob
+ * @mem: Memory chunk to use for allocating device nodes and properties
+ * @p: pointer to node in flat tree
+ * @dad: Parent struct device_node
+ * @allnextpp: pointer to ->allnext from last allocated device_node
+ * @fpsize: Size of the node path up at the current depth.
+ */
+static unsigned long unflatten_dt_node(const void *fdt,
+                                       unsigned long mem,
+                                       unsigned long *p,
+                                       struct dt_device_node *dad,
+                                       struct dt_device_node ***allnextpp,
+                                       unsigned long fpsize)
+{
+    struct dt_device_node *np;
+    struct dt_property *pp, **prev_pp = NULL;
+    char *pathp;
+    u32 tag;
+    unsigned int l, allocl;
+    int has_name = 0;
+    int new_format = 0;
+
+    tag = be32_to_cpup((__be32 *)(*p));
+    if ( tag != FDT_BEGIN_NODE )
+    {
+        printk(XENLOG_WARNING "Weird tag at start of node: %x\n", tag);
+        return mem;
+    }
+    *p += 4;
+    pathp = (char *)*p;
+    l = allocl = strlen(pathp) + 1;
+    *p = ROUNDUP(*p + l, 4);
+
+    /* version 0x10 has a more compact unit name here instead of the full
+     * path. we accumulate the full path size using "fpsize", we'll rebuild
+     * it later. We detect this because the first character of the name is
+     * not '/'.
+     */
+    if ( (*pathp) != '/' )
+    {
+        new_format = 1;
+        if ( fpsize == 0 )
+        {
+            /* root node: special case. fpsize accounts for path
+             * plus terminating zero. root node only has '/', so
+             * fpsize should be 2, but we want to avoid the first
+             * level nodes to have two '/' so we use fpsize 1 here
+             */
+            fpsize = 1;
+            allocl = 2;
+        }
+        else
+        {
+            /* account for '/' and path size minus terminal 0
+             * already in 'l'
+             */
+            fpsize += l;
+            allocl = fpsize;
+        }
+    }
+
+    np = unflatten_dt_alloc(&mem, sizeof(struct dt_device_node) + allocl,
+                            __alignof__(struct dt_device_node));
+    if ( allnextpp )
+    {
+        memset(np, 0, sizeof(*np));
+        np->full_name = ((char *)np) + sizeof(struct dt_device_node);
+        /* By default dom0 owns the device */
+        np->used_by = 0;
+        /* By default the device is not protected */
+        np->is_protected = false;
+        INIT_LIST_HEAD(&np->domain_list);
+
+        if ( new_format )
+        {
+            char *fn = np->full_name;
+            /* rebuild full path for new format */
+            if ( dad && dad->parent )
+            {
+                strlcpy(fn, dad->full_name, allocl);
+#ifdef DEBUG_DT
+                if ( (strlen(fn) + l + 1) != allocl )
+                {
+                    dt_dprintk("%s: p: %d, l: %d, a: %d\n",
+                               pathp, (int)strlen(fn),
+                               l, allocl);
+                }
+#endif
+                fn += strlen(fn);
+            }
+            *(fn++) = '/';
+            memcpy(fn, pathp, l);
+        }
+        else
+            memcpy(np->full_name, pathp, l);
+        prev_pp = &np->properties;
+        **allnextpp = np;
+        *allnextpp = &np->allnext;
+        if ( dad != NULL )
+        {
+            np->parent = dad;
+            /* we temporarily use the next field as `last_child'*/
+            if ( dad->next == NULL )
+                dad->child = np;
+            else
+                dad->next->sibling = np;
+            dad->next = np;
+        }
+    }
+    /* process properties */
+    while ( 1 )
+    {
+        u32 sz, noff;
+        const char *pname;
+
+        tag = be32_to_cpup((__be32 *)(*p));
+        if ( tag == FDT_NOP )
+        {
+            *p += 4;
+            continue;
+        }
+        if ( tag != FDT_PROP )
+            break;
+        *p += 4;
+        sz = be32_to_cpup((__be32 *)(*p));
+        noff = be32_to_cpup((__be32 *)((*p) + 4));
+        *p += 8;
+        if ( fdt_version(fdt) < 0x10 )
+            *p = ROUNDUP(*p, sz >= 8 ? 8 : 4);
+
+        pname = fdt_string(fdt, noff);
+        if ( pname == NULL )
+        {
+            dt_dprintk("Can't find property name in list!\n");
+            break;
+        }
+        if ( strcmp(pname, "name") == 0 )
+            has_name = 1;
+        l = strlen(pname) + 1;
+        pp = unflatten_dt_alloc(&mem, sizeof(struct dt_property),
+                                __alignof__(struct dt_property));
+        if ( allnextpp )
+        {
+            /* We accept flattened tree phandles either in
+             * ePAPR-style "phandle" properties, or the
+             * legacy "linux,phandle" properties.  If both
+             * appear and have different values, things
+             * will get weird.  Don't do that. */
+            if ( (strcmp(pname, "phandle") == 0) ||
+                 (strcmp(pname, "linux,phandle") == 0) )
+            {
+                if ( np->phandle == 0 )
+                    np->phandle = be32_to_cpup((__be32*)*p);
+            }
+            /* And we process the "ibm,phandle" property
+             * used in pSeries dynamic device tree
+             * stuff */
+            if ( strcmp(pname, "ibm,phandle") == 0 )
+                np->phandle = be32_to_cpup((__be32 *)*p);
+            pp->name = pname;
+            pp->length = sz;
+            pp->value = (void *)*p;
+            *prev_pp = pp;
+            prev_pp = &pp->next;
+        }
+        *p = ROUNDUP((*p) + sz, 4);
+    }
+    /* with version 0x10 we may not have the name property, recreate
+     * it here from the unit name if absent
+     */
+    if ( !has_name )
+    {
+        char *p1 = pathp, *ps = pathp, *pa = NULL;
+        int sz;
+
+        while ( *p1 )
+        {
+            if ( (*p1) == '@' )
+                pa = p1;
+            if ( (*p1) == '/' )
+                ps = p1 + 1;
+            p1++;
+        }
+        if ( pa < ps )
+            pa = p1;
+        sz = (pa - ps) + 1;
+        pp = unflatten_dt_alloc(&mem, sizeof(struct dt_property) + sz,
+                                __alignof__(struct dt_property));
+        if ( allnextpp )
+        {
+            pp->name = "name";
+            pp->length = sz;
+            pp->value = pp + 1;
+            /*
+             * The device tree creation code assume that the property
+             * "name" is not a fake.
+             * To avoid a big divergence with Linux code, only remove
+             * property link. In this case we will lose a bit of memory
+             */
+#if 0
+            *prev_pp = pp;
+            prev_pp = &pp->next;
+#endif
+            np->name = pp->value;
+            memcpy(pp->value, ps, sz - 1);
+            ((char *)pp->value)[sz - 1] = 0;
+            dt_dprintk("fixed up name for %s -> %s\n", pathp,
+                       (char *)pp->value);
+            /* Generic device initialization */
+            np->dev.type = DEV_DT;
+            np->dev.of_node = np;
+        }
+    }
+    if ( allnextpp )
+    {
+        *prev_pp = NULL;
+        np->name = (np->name) ? : dt_get_property(np, "name", NULL);
+        np->type = dt_get_property(np, "device_type", NULL);
+
+        if ( !np->name )
+            np->name = "<NULL>";
+        if ( !np->type )
+            np->type = "<NULL>";
+    }
+    while ( tag == FDT_BEGIN_NODE || tag == FDT_NOP )
+    {
+        if ( tag == FDT_NOP )
+            *p += 4;
+        else
+            mem = unflatten_dt_node(fdt, mem, p, np, allnextpp, fpsize);
+        tag = be32_to_cpup((__be32 *)(*p));
+    }
+    if ( tag != FDT_END_NODE )
+    {
+        printk(XENLOG_WARNING "Weird tag at end of node: %x\n", tag);
+        return mem;
+    }
+
+    *p += 4;
+    return mem;
+}
+
+int unflatten_device_tree(const void *fdt, struct dt_device_node **mynodes)
+{
+    unsigned long start, mem, size;
+    struct dt_device_node **allnextp = mynodes;
+
+    dt_dprintk(" -> unflatten_device_tree()\n");
+
+    dt_dprintk("Unflattening device tree:\n");
+    dt_dprintk("magic: %#08x\n", fdt_magic(fdt));
+    dt_dprintk("size: %#08x\n", fdt_totalsize(fdt));
+    dt_dprintk("version: %#08x\n", fdt_version(fdt));
+
+    /* First pass, scan for size */
+    start = ((unsigned long)fdt) + fdt_off_dt_struct(fdt);
+    size = unflatten_dt_node(fdt, 0, &start, NULL, NULL, 0);
+    if ( !size )
+        return -EINVAL;
+
+    size = (size | 3) + 1;
+
+    dt_dprintk("  size is %#lx allocating...\n", size);
+
+    /* Allocate memory for the expanded device tree */
+    mem = (unsigned long)_xmalloc (size + 4, __alignof__(struct dt_device_node));
+    if ( !mem )
+        return -ENOMEM;
+
+    ((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeefU);
+
+    dt_dprintk("  unflattening %lx...\n", mem);
+
+    /* Second pass, do actual unflattening */
+    start = ((unsigned long)fdt) + fdt_off_dt_struct(fdt);
+    unflatten_dt_node(fdt, mem, &start, NULL, &allnextp, 0);
+    if ( be32_to_cpup((__be32 *)start) != FDT_END )
+    {
+        printk(XENLOG_ERR "Weird tag at end of tree: %08x\n",
+                  *((u32 *)start));
+        xfree((void *)mem);
+        return -EINVAL;
+    }
+
+    if ( be32_to_cpu(((__be32 *)mem)[size / 4]) != 0xdeadbeefU )
+    {
+        printk(XENLOG_ERR "End of tree marker overwritten: %08x\n",
+                  be32_to_cpu(((__be32 *)mem)[size / 4]));
+        xfree((void *)mem);
+        return -EINVAL;
+    }
+
+    *allnextp = NULL;
+
+    dt_dprintk(" <- unflatten_device_tree()\n");
+
+    return 0;
+}
+
+static void dt_alias_add(struct dt_alias_prop *ap,
+                         struct dt_device_node *np,
+                         int id, const char *stem, int stem_len)
+{
+    ap->np = np;
+    ap->id = id;
+    strlcpy(ap->stem, stem, stem_len + 1);
+    list_add_tail(&ap->link, &aliases_lookup);
+    dt_dprintk("adding DT alias:%s: stem=%s id=%d node=%s\n",
+               ap->alias, ap->stem, ap->id, dt_node_full_name(np));
+}
+
+/**
+ * dt_alias_scan - Scan all properties of 'aliases' node
+ *
+ * The function scans all the properties of 'aliases' node and populate
+ * the the global lookup table with the properties.  It returns the
+ * number of alias_prop found, or error code in error case.
+ */
+static void __init dt_alias_scan(void)
+{
+    const struct dt_property *pp;
+    const struct dt_device_node *aliases;
+
+    aliases = dt_find_node_by_path("/aliases");
+    if ( !aliases )
+        return;
+
+    dt_for_each_property_node( aliases, pp )
+    {
+        const char *start = pp->name;
+        const char *end = start + strlen(start);
+        struct dt_device_node *np;
+        struct dt_alias_prop *ap;
+        int id, len;
+
+        /* Skip those we do not want to proceed */
+        if ( !strcmp(pp->name, "name") ||
+             !strcmp(pp->name, "phandle") ||
+             !strcmp(pp->name, "linux,phandle") )
+            continue;
+
+        np = dt_find_node_by_path(pp->value);
+        if ( !np )
+            continue;
+
+        /* walk the alias backwards to extract the id and work out
+         * the 'stem' string */
+        while ( isdigit(*(end-1)) && end > start )
+            end--;
+        len = end - start;
+
+        id = simple_strtoll(end, NULL, 10);
+
+        /* Allocate an alias_prop with enough space for the stem */
+        ap = _xmalloc(sizeof(*ap) + len + 1, 4);
+        if ( !ap )
+            continue;
+        ap->alias = start;
+        dt_alias_add(ap, np, id, start, len);
+    }
+}
+
+struct dt_device_node * __init
+dt_find_interrupt_controller(const struct dt_device_match *matches)
+{
+    struct dt_device_node *np = NULL;
+
+    while ( (np = dt_find_matching_node(np, matches)) )
+    {
+        if ( !dt_find_property(np, "interrupt-controller", NULL) )
+            continue;
+
+        if ( dt_get_parent(np) )
+            break;
+    }
+
+    return np;
+}
+
+void __init dt_unflatten_host_device_tree(void)
+{
+    int error = unflatten_device_tree(device_tree_flattened, &dt_host);
+
+    if ( error )
+        panic("unflatten_device_tree failed with error %d\n", error);
+
+    dt_alias_scan();
+}
+
+int dt_get_pci_domain_nr(struct dt_device_node *node)
+{
+    u32 domain;
+    int error;
+
+    error = dt_property_read_u32(node, "linux,pci-domain", &domain);
+    if ( !error )
+        return -EINVAL;
+
+    return (u16)domain;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
deleted file mode 100644
index 8d1017a49d..0000000000
--- a/xen/common/device_tree.c
+++ /dev/null
@@ -1,2253 +0,0 @@
-/*
- * Device Tree
- *
- * Copyright (C) 2012 Citrix Systems, Inc.
- * Copyright 2009 Benjamin Herrenschmidt, IBM Corp
- * benh@kernel.crashing.org
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#include <xen/types.h>
-#include <xen/init.h>
-#include <xen/guest_access.h>
-#include <xen/device_tree.h>
-#include <xen/kernel.h>
-#include <xen/lib.h>
-#include <xen/libfdt/libfdt.h>
-#include <xen/mm.h>
-#include <xen/stdarg.h>
-#include <xen/string.h>
-#include <xen/cpumask.h>
-#include <xen/ctype.h>
-#include <asm/setup.h>
-#include <xen/err.h>
-
-const void *device_tree_flattened;
-dt_irq_xlate_func dt_irq_xlate;
-/* Host device tree */
-struct dt_device_node *dt_host;
-/* Interrupt controller node*/
-const struct dt_device_node *dt_interrupt_controller;
-DEFINE_RWLOCK(dt_host_lock);
-
-/**
- * struct dt_alias_prop - Alias property in 'aliases' node
- * @link: List node to link the structure in aliases_lookup list
- * @alias: Alias property name
- * @np: Pointer to device_node that the alias stands for
- * @id: Index value from end of alias name
- * @stem: Alias string without the index
- *
- * The structure represents one alias property of 'aliases' node as
- * an entry in aliases_lookup list.
- */
-struct dt_alias_prop {
-    struct list_head link;
-    const char *alias;
-    struct dt_device_node *np;
-    int id;
-    char stem[0];
-};
-
-static LIST_HEAD(aliases_lookup);
-
-#ifdef CONFIG_DEVICE_TREE_DEBUG
-static void dt_dump_addr(const char *s, const __be32 *addr, int na)
-{
-    dt_dprintk("%s", s);
-    while ( na-- )
-        dt_dprintk(" %08x", be32_to_cpu(*(addr++)));
-    dt_dprintk("\n");
-}
-#else
-static void dt_dump_addr(const char *s, const __be32 *addr, int na) { }
-#endif
-
-#define DT_BAD_ADDR ((u64)-1)
-
-/* Max address size we deal with */
-#define DT_MAX_ADDR_CELLS 4
-#define DT_CHECK_ADDR_COUNT(na) ((na) > 0 && (na) <= DT_MAX_ADDR_CELLS)
-#define DT_CHECK_COUNTS(na, ns) (DT_CHECK_ADDR_COUNT(na) && (ns) > 0)
-
-/* Callbacks for bus specific translators */
-struct dt_bus
-{
-    const char *name;
-    const char *addresses;
-    bool (*match)(const struct dt_device_node *node);
-    void (*count_cells)(const struct dt_device_node *child,
-                        int *addrc, int *sizec);
-    u64 (*map)(__be32 *addr, const __be32 *range, int na, int ns, int pna);
-    int (*translate)(__be32 *addr, u64 offset, int na);
-    unsigned int (*get_flags)(const __be32 *addr);
-};
-
-void dt_get_range(const __be32 **cellp, const struct dt_device_node *np,
-                  u64 *address, u64 *size)
-{
-    *address = dt_next_cell(dt_n_addr_cells(np), cellp);
-    *size = dt_next_cell(dt_n_size_cells(np), cellp);
-}
-
-void dt_set_cell(__be32 **cellp, int size, u64 val)
-{
-    int cells = size;
-
-    while ( size-- )
-    {
-        (*cellp)[size] = cpu_to_fdt32(val);
-        val >>= 32;
-    }
-
-    (*cellp) += cells;
-}
-
-void dt_set_range(__be32 **cellp, const struct dt_device_node *np,
-                  u64 address, u64 size)
-{
-    dt_set_cell(cellp, dt_n_addr_cells(np), address);
-    dt_set_cell(cellp, dt_n_size_cells(np), size);
-}
-
-void dt_child_set_range(__be32 **cellp, int addrcells, int sizecells,
-                        u64 address, u64 size)
-{
-    dt_set_cell(cellp, addrcells, address);
-    dt_set_cell(cellp, sizecells, size);
-}
-
-static void __init *unflatten_dt_alloc(unsigned long *mem, unsigned long size,
-                                       unsigned long align)
-{
-    void *res;
-
-    *mem = ROUNDUP(*mem, align);
-    res = (void *)*mem;
-    *mem += size;
-
-    return res;
-}
-
-/* Find a property with a given name for a given node and return it. */
-const struct dt_property *dt_find_property(const struct dt_device_node *np,
-                                           const char *name, u32 *lenp)
-{
-    const struct dt_property *pp;
-
-    if ( !np )
-        return NULL;
-
-    for ( pp = np->properties; pp; pp = pp->next )
-    {
-        if ( dt_prop_cmp(pp->name, name) == 0 )
-        {
-            if ( lenp )
-                *lenp = pp->length;
-            break;
-        }
-    }
-
-    return pp;
-}
-
-const void *dt_get_property(const struct dt_device_node *np,
-                            const char *name, u32 *lenp)
-{
-    const struct dt_property *pp = dt_find_property(np, name, lenp);
-
-    return pp ? pp->value : NULL;
-}
-
-bool dt_property_read_u32(const struct dt_device_node *np,
-                          const char *name, u32 *out_value)
-{
-    u32 len;
-    const __be32 *val;
-
-    val = dt_get_property(np, name, &len);
-    if ( !val || len < sizeof(*out_value) )
-        return 0;
-
-    *out_value = be32_to_cpup(val);
-
-    return 1;
-}
-
-
-bool dt_property_read_u64(const struct dt_device_node *np,
-                          const char *name, u64 *out_value)
-{
-    u32 len;
-    const __be32 *val;
-
-    val = dt_get_property(np, name, &len);
-    if ( !val || len < sizeof(*out_value) )
-        return 0;
-
-    *out_value = dt_read_number(val, 2);
-
-    return 1;
-}
-int dt_property_read_string(const struct dt_device_node *np,
-                            const char *propname, const char **out_string)
-{
-    const struct dt_property *pp = dt_find_property(np, propname, NULL);
-
-    if ( !pp )
-        return -EINVAL;
-    if ( !pp->length )
-        return -ENODATA;
-    if ( strnlen(pp->value, pp->length) >= pp->length )
-        return -EILSEQ;
-
-    *out_string = pp->value;
-
-    return 0;
-}
-
-/**
- * dt_find_property_value_of_size
- *
- * @np:     device node from which the property value is to be read.
- * @propname:   name of the property to be searched.
- * @min:    minimum allowed length of property value
- * @max:    maximum allowed length of property value (0 means unlimited)
- * @len:    if !=NULL, actual length is written to here
- *
- * Search for a property in a device node and valid the requested size.
- *
- * Return: The property value on success, -EINVAL if the property does not
- * exist, -ENODATA if property does not have a value, and -EOVERFLOW if the
- * property data is too small or too large.
- */
-static void *dt_find_property_value_of_size(const struct dt_device_node *np,
-                                            const char *propname, u32 min,
-                                            u32 max, size_t *len)
-{
-    const struct dt_property *prop = dt_find_property(np, propname, NULL);
-
-    if ( !prop )
-        return ERR_PTR(-EINVAL);
-    if ( !prop->value )
-        return ERR_PTR(-ENODATA);
-    if ( prop->length < min )
-        return ERR_PTR(-EOVERFLOW);
-    if ( max && prop->length > max )
-        return ERR_PTR(-EOVERFLOW);
-
-    if ( len )
-        *len = prop->length;
-
-    return prop->value;
-}
-
-int dt_property_read_variable_u32_array(const struct dt_device_node *np,
-                                        const char *propname, u32 *out_values,
-                                        size_t sz_min, size_t sz_max)
-{
-    size_t sz, count;
-    const __be32 *val = dt_find_property_value_of_size(np, propname,
-                        (sz_min * sizeof(*out_values)),
-                        (sz_max * sizeof(*out_values)),
-                        &sz);
-
-    if ( IS_ERR(val) )
-        return PTR_ERR(val);
-
-    if ( !sz_max )
-        sz = sz_min;
-    else
-        sz /= sizeof(*out_values);
-
-    count = sz;
-    while ( count-- )
-        *out_values++ = be32_to_cpup(val++);
-
-    return sz;
-}
-
-int dt_property_match_string(const struct dt_device_node *np,
-                             const char *propname, const char *string)
-{
-    const struct dt_property *dtprop = dt_find_property(np, propname, NULL);
-    size_t l;
-    int i;
-    const char *p, *end;
-
-    if ( !dtprop )
-        return -EINVAL;
-    if ( !dtprop->value )
-        return -ENODATA;
-
-    p = dtprop->value;
-    end = p + dtprop->length;
-
-    for ( i = 0; p < end; i++, p += l )
-    {
-        l = strnlen(p, end - p) + 1;
-        if ( p + l > end )
-            return -EILSEQ;
-        if ( strcmp(string, p) == 0 )
-            return i; /* Found it; return index */
-    }
-    return -ENODATA;
-}
-
-bool dt_device_is_compatible(const struct dt_device_node *device,
-                             const char *compat)
-{
-    const char* cp;
-    u32 cplen, l;
-
-    cp = dt_get_property(device, "compatible", &cplen);
-    if ( cp == NULL )
-        return 0;
-    while ( cplen > 0 )
-    {
-        if ( dt_compat_cmp(cp, compat) == 0 )
-            return 1;
-        l = strlen(cp) + 1;
-        cp += l;
-        cplen -= l;
-    }
-
-    return 0;
-}
-
-bool dt_machine_is_compatible(const char *compat)
-{
-    const struct dt_device_node *root;
-    bool rc = false;
-
-    root = dt_find_node_by_path("/");
-    if ( root )
-    {
-        rc = dt_device_is_compatible(root, compat);
-    }
-    return rc;
-}
-
-struct dt_device_node *dt_find_node_by_name(struct dt_device_node *from,
-                                            const char *name)
-{
-    struct dt_device_node *np;
-    struct dt_device_node *dt;
-
-    dt = from ? from->allnext : dt_host;
-    dt_for_each_device_node(dt, np)
-        if ( np->name && (dt_node_cmp(np->name, name) == 0) )
-            break;
-
-    return np;
-}
-
-struct dt_device_node *dt_find_node_by_type(struct dt_device_node *from,
-                                            const char *type)
-{
-    struct dt_device_node *np;
-    struct dt_device_node *dt;
-
-    dt = from ? from->allnext : dt_host;
-    dt_for_each_device_node(dt, np)
-        if ( np->type && (dt_node_cmp(np->type, type) == 0) )
-            break;
-
-    return np;
-}
-
-struct dt_device_node *dt_find_node_by_path_from(struct dt_device_node *from,
-                                                 const char *path)
-{
-    struct dt_device_node *np;
-
-    dt_for_each_device_node(from, np)
-        if ( np->full_name && (dt_node_cmp(np->full_name, path) == 0) )
-            break;
-
-    return np;
-}
-
-int dt_find_node_by_gpath(XEN_GUEST_HANDLE(char) u_path, uint32_t u_plen,
-                          struct dt_device_node **node)
-{
-    char *path;
-
-    path = safe_copy_string_from_guest(u_path, u_plen, PAGE_SIZE);
-    if ( IS_ERR(path) )
-        return PTR_ERR(path);
-
-    *node = dt_find_node_by_path(path);
-
-    xfree(path);
-
-    return (*node == NULL) ? -ESRCH : 0;
-}
-
-struct dt_device_node *dt_find_node_by_alias(const char *alias)
-{
-    const struct dt_alias_prop *app;
-
-    list_for_each_entry( app, &aliases_lookup, link )
-    {
-        if ( !strcmp(app->alias, alias) )
-            return app->np;
-    }
-
-    return NULL;
-}
-
-const struct dt_device_match *
-dt_match_node(const struct dt_device_match *matches,
-              const struct dt_device_node *node)
-{
-    if ( !matches )
-        return NULL;
-
-    while ( matches->path || matches->type ||
-            matches->compatible || matches->not_available || matches->prop )
-    {
-        bool match = true;
-
-        if ( matches->path )
-            match &= dt_node_path_is_equal(node, matches->path);
-
-        if ( matches->type )
-            match &= dt_device_type_is_equal(node, matches->type);
-
-        if ( matches->compatible )
-            match &= dt_device_is_compatible(node, matches->compatible);
-
-        if ( matches->not_available )
-            match &= !dt_device_is_available(node);
-
-        if ( matches->prop )
-            match &= dt_find_property(node, matches->prop, NULL) != NULL;
-
-        if ( match )
-            return matches;
-        matches++;
-    }
-
-    return NULL;
-}
-
-const struct dt_device_node *dt_get_parent(const struct dt_device_node *node)
-{
-    if ( !node )
-        return NULL;
-
-    return node->parent;
-}
-
-struct dt_device_node *
-dt_find_compatible_node(struct dt_device_node *from,
-                        const char *type,
-                        const char *compatible)
-{
-    struct dt_device_node *np;
-    struct dt_device_node *dt;
-
-    dt = from ? from->allnext : dt_host;
-    dt_for_each_device_node(dt, np)
-    {
-        if ( type
-             && !(np->type && (dt_node_cmp(np->type, type) == 0)) )
-            continue;
-        if ( dt_device_is_compatible(np, compatible) )
-            break;
-    }
-
-    return np;
-}
-
-struct dt_device_node *
-dt_find_matching_node(struct dt_device_node *from,
-                      const struct dt_device_match *matches)
-{
-    struct dt_device_node *np;
-    struct dt_device_node *dt;
-
-    dt = from ? from->allnext : dt_host;
-    dt_for_each_device_node(dt, np)
-    {
-        if ( dt_match_node(matches, np) )
-            return np;
-    }
-
-    return NULL;
-}
-
-static int __dt_n_addr_cells(const struct dt_device_node *np, bool parent)
-{
-    const __be32 *ip;
-
-    do {
-        if ( np->parent && !parent )
-            np = np->parent;
-        parent = false;
-
-        ip = dt_get_property(np, "#address-cells", NULL);
-        if ( ip )
-            return be32_to_cpup(ip);
-    } while ( np->parent );
-    /* No #address-cells property for the root node */
-    return DT_ROOT_NODE_ADDR_CELLS_DEFAULT;
-}
-
-static int __dt_n_size_cells(const struct dt_device_node *np, bool parent)
-{
-    const __be32 *ip;
-
-    do {
-        if ( np->parent && !parent )
-            np = np->parent;
-        parent = false;
-
-        ip = dt_get_property(np, "#size-cells", NULL);
-        if ( ip )
-            return be32_to_cpup(ip);
-    } while ( np->parent );
-    /* No #address-cells property for the root node */
-    return DT_ROOT_NODE_SIZE_CELLS_DEFAULT;
-}
-
-int dt_n_addr_cells(const struct dt_device_node *np)
-{
-    return __dt_n_addr_cells(np, false);
-}
-
-int dt_n_size_cells(const struct dt_device_node *np)
-{
-    return __dt_n_size_cells(np, false);
-}
-
-int dt_child_n_addr_cells(const struct dt_device_node *parent)
-{
-    return __dt_n_addr_cells(parent, true);
-}
-
-int dt_child_n_size_cells(const struct dt_device_node *parent)
-{
-    return __dt_n_size_cells(parent, true);
-}
-
-/*
- * These are defined in Linux where much of this code comes from, but
- * are currently unused outside this file in the context of Xen.
- */
-#define IORESOURCE_BITS         0x000000ff      /* Bus-specific bits */
-
-#define IORESOURCE_TYPE_BITS    0x00001f00      /* Resource type */
-#define IORESOURCE_IO           0x00000100      /* PCI/ISA I/O ports */
-#define IORESOURCE_MEM          0x00000200
-#define IORESOURCE_REG          0x00000300      /* Register offsets */
-#define IORESOURCE_IRQ          0x00000400
-#define IORESOURCE_DMA          0x00000800
-#define IORESOURCE_BUS          0x00001000
-
-#define IORESOURCE_PREFETCH     0x00002000      /* No side effects */
-#define IORESOURCE_READONLY     0x00004000
-#define IORESOURCE_CACHEABLE    0x00008000
-#define IORESOURCE_RANGELENGTH  0x00010000
-#define IORESOURCE_SHADOWABLE   0x00020000
-
-/*
- * Default translator (generic bus)
- */
-static bool dt_bus_default_match(const struct dt_device_node *node)
-{
-    /* Root node doesn't have "ranges" property */
-    if ( node->parent == NULL )
-        return 1;
-
-    /* The default bus is only used when the "ranges" property exists.
-     * Otherwise we can't translate the address
-     */
-    return (dt_get_property(node, "ranges", NULL) != NULL);
-}
-
-static void dt_bus_default_count_cells(const struct dt_device_node *dev,
-                                int *addrc, int *sizec)
-{
-    if ( addrc )
-        *addrc = dt_n_addr_cells(dev);
-    if ( sizec )
-        *sizec = dt_n_size_cells(dev);
-}
-
-static u64 dt_bus_default_map(__be32 *addr, const __be32 *range,
-                              int na, int ns, int pna)
-{
-    u64 cp, s, da;
-
-    cp = dt_read_number(range, na);
-    s = dt_read_number(range + na + pna, ns);
-    da = dt_read_number(addr, na);
-
-    dt_dprintk("DT: default map, cp=%llx, s=%llx, da=%llx\n",
-               (unsigned long long)cp, (unsigned long long)s,
-               (unsigned long long)da);
-
-    /*
-     * If the number of address cells is larger than 2 we assume the
-     * mapping doesn't specify a physical address. Rather, the address
-     * specifies an identifier that must match exactly.
-     */
-    if ( na > 2 && memcmp(range, addr, na * 4) != 0 )
-        return DT_BAD_ADDR;
-
-    if ( da < cp || da >= (cp + s) )
-        return DT_BAD_ADDR;
-    return da - cp;
-}
-
-static int dt_bus_default_translate(__be32 *addr, u64 offset, int na)
-{
-    u64 a = dt_read_number(addr, na);
-
-    memset(addr, 0, na * 4);
-    a += offset;
-    if ( na > 1 )
-        addr[na - 2] = cpu_to_be32(a >> 32);
-    addr[na - 1] = cpu_to_be32(a & 0xffffffffu);
-
-    return 0;
-}
-static unsigned int dt_bus_default_get_flags(const __be32 *addr)
-{
-    return IORESOURCE_MEM;
-}
-
-/*
- * PCI bus specific translator
- */
-
-static bool dt_node_is_pci(const struct dt_device_node *np)
-{
-    bool is_pci = !strcmp(np->name, "pcie") || !strcmp(np->name, "pci");
-
-    if ( is_pci )
-        printk(XENLOG_WARNING "%s: Missing device_type\n", np->full_name);
-
-    return is_pci;
-}
-
-static bool dt_bus_pci_match(const struct dt_device_node *np)
-{
-    /*
-     * "pciex" is PCI Express "vci" is for the /chaos bridge on 1st-gen PCI
-     * powermacs "ht" is hypertransport
-     *
-     * If none of the device_type match, and that the node name is
-     * "pcie" or "pci", accept the device as PCI (with a warning).
-     */
-    return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex") ||
-        !strcmp(np->type, "vci") || !strcmp(np->type, "ht") ||
-        dt_node_is_pci(np);
-}
-
-static void dt_bus_pci_count_cells(const struct dt_device_node *np,
-				   int *addrc, int *sizec)
-{
-    if (addrc)
-        *addrc = 3;
-    if (sizec)
-        *sizec = 2;
-}
-
-static unsigned int dt_bus_pci_get_flags(const __be32 *addr)
-{
-    unsigned int flags = 0;
-    u32 w = be32_to_cpup(addr);
-
-    switch((w >> 24) & 0x03) {
-    case 0x01:
-        flags |= IORESOURCE_IO;
-        break;
-    case 0x02: /* 32 bits */
-    case 0x03: /* 64 bits */
-        flags |= IORESOURCE_MEM;
-        break;
-    }
-    if (w & 0x40000000)
-        flags |= IORESOURCE_PREFETCH;
-    return flags;
-}
-
-static u64 dt_bus_pci_map(__be32 *addr, const __be32 *range, int na, int ns,
-		int pna)
-{
-    u64 cp, s, da;
-    unsigned int af, rf;
-
-    af = dt_bus_pci_get_flags(addr);
-    rf = dt_bus_pci_get_flags(range);
-
-    /* Check address type match */
-    if ((af ^ rf) & (IORESOURCE_MEM | IORESOURCE_IO))
-        return DT_BAD_ADDR;
-
-    /* Read address values, skipping high cell */
-    cp = dt_read_number(range + 1, na - 1);
-    s  = dt_read_number(range + na + pna, ns);
-    da = dt_read_number(addr + 1, na - 1);
-
-    dt_dprintk("DT: PCI map, cp=%llx, s=%llx, da=%llx\n",
-               (unsigned long long)cp, (unsigned long long)s,
-               (unsigned long long)da);
-
-    if (da < cp || da >= (cp + s))
-        return DT_BAD_ADDR;
-    return da - cp;
-}
-
-static int dt_bus_pci_translate(__be32 *addr, u64 offset, int na)
-{
-    return dt_bus_default_translate(addr + 1, offset, na - 1);
-}
-
-/*
- * Array of bus specific translators
- */
-static const struct dt_bus dt_busses[] =
-{
-    /* PCI */
-    {
-        .name = "pci",
-        .addresses = "assigned-addresses",
-        .match = dt_bus_pci_match,
-        .count_cells = dt_bus_pci_count_cells,
-        .map = dt_bus_pci_map,
-        .translate = dt_bus_pci_translate,
-        .get_flags = dt_bus_pci_get_flags,
-    },
-    /* Default */
-    {
-        .name = "default",
-        .addresses = "reg",
-        .match = dt_bus_default_match,
-        .count_cells = dt_bus_default_count_cells,
-        .map = dt_bus_default_map,
-        .translate = dt_bus_default_translate,
-        .get_flags = dt_bus_default_get_flags,
-    },
-};
-
-static const struct dt_bus *dt_match_bus(const struct dt_device_node *np)
-{
-    int i;
-
-    for ( i = 0; i < ARRAY_SIZE(dt_busses); i++ )
-        if ( !dt_busses[i].match || dt_busses[i].match(np) )
-            return &dt_busses[i];
-
-    return NULL;
-}
-
-static const __be32 *dt_get_address(const struct dt_device_node *dev,
-                                    unsigned int index, u64 *size,
-                                    unsigned int *flags)
-{
-    const __be32 *prop;
-    u32 psize;
-    const struct dt_device_node *parent;
-    const struct dt_bus *bus;
-    int onesize, i, na, ns;
-
-    /* Get parent & match bus type */
-    parent = dt_get_parent(dev);
-    if ( parent == NULL )
-        return NULL;
-
-    bus = dt_match_bus(parent);
-    if ( !bus )
-        return NULL;
-    bus->count_cells(dev, &na, &ns);
-
-    if ( !DT_CHECK_ADDR_COUNT(na) )
-        return NULL;
-
-    /* Get "reg" or "assigned-addresses" property */
-    prop = dt_get_property(dev, bus->addresses, &psize);
-    if ( prop == NULL )
-        return NULL;
-    psize /= 4;
-
-    onesize = na + ns;
-    for ( i = 0; psize >= onesize; psize -= onesize, prop += onesize, i++ )
-    {
-        if ( i == index )
-        {
-            if ( size )
-                *size = dt_read_number(prop + na, ns);
-            if ( flags )
-                *flags = bus->get_flags(prop);
-            return prop;
-        }
-    }
-    return NULL;
-}
-
-static int dt_translate_one(const struct dt_device_node *parent,
-                            const struct dt_bus *bus,
-                            const struct dt_bus *pbus,
-                            __be32 *addr, int na, int ns,
-                            int pna, const char *rprop)
-{
-    const __be32 *ranges;
-    unsigned int rlen;
-    int rone;
-    u64 offset = DT_BAD_ADDR;
-
-    ranges = dt_get_property(parent, rprop, &rlen);
-    if ( ranges == NULL )
-    {
-        printk(XENLOG_ERR "DT: no ranges; cannot translate\n");
-        return 1;
-    }
-    if ( rlen == 0 )
-    {
-        offset = dt_read_number(addr, na);
-        memset(addr, 0, pna * 4);
-        dt_dprintk("DT: empty ranges; 1:1 translation\n");
-        goto finish;
-    }
-
-    dt_dprintk("DT: walking ranges...\n");
-
-    /* Now walk through the ranges */
-    rlen /= 4;
-    rone = na + pna + ns;
-    for ( ; rlen >= rone; rlen -= rone, ranges += rone )
-    {
-        offset = bus->map(addr, ranges, na, ns, pna);
-        if ( offset != DT_BAD_ADDR )
-            break;
-    }
-    if ( offset == DT_BAD_ADDR )
-    {
-        dt_dprintk("DT: not found !\n");
-        return 1;
-    }
-    memcpy(addr, ranges + na, 4 * pna);
-
-finish:
-    dt_dump_addr("DT: parent translation for:", addr, pna);
-    dt_dprintk("DT: with offset: %llx\n", (unsigned long long)offset);
-
-    /* Translate it into parent bus space */
-    return pbus->translate(addr, offset, pna);
-}
-
-/*
- * Translate an address from the device-tree into a CPU physical address,
- * this walks up the tree and applies the various bus mappings on the
- * way.
- *
- * Note: We consider that crossing any level with #size-cells == 0 to mean
- * that translation is impossible (that is we are not dealing with a value
- * that can be mapped to a cpu physical address). This is not really specified
- * that way, but this is traditionally the way IBM at least do things
- */
-static u64 __dt_translate_address(const struct dt_device_node *dev,
-                                  const __be32 *in_addr, const char *rprop)
-{
-    const struct dt_device_node *parent = NULL;
-    const struct dt_bus *bus, *pbus;
-    __be32 addr[DT_MAX_ADDR_CELLS];
-    int na, ns, pna, pns;
-    u64 result = DT_BAD_ADDR;
-
-    dt_dprintk("DT: ** translation for device %s **\n", dev->full_name);
-
-    /* Get parent & match bus type */
-    parent = dt_get_parent(dev);
-    if ( parent == NULL )
-        goto bail;
-    bus = dt_match_bus(parent);
-    if ( !bus )
-        goto bail;
-
-    /* Count address cells & copy address locally */
-    bus->count_cells(dev, &na, &ns);
-    if ( !DT_CHECK_COUNTS(na, ns) )
-    {
-        printk(XENLOG_ERR "dt_parse: Bad cell count for device %s\n",
-                  dev->full_name);
-        goto bail;
-    }
-    memcpy(addr, in_addr, na * 4);
-
-    dt_dprintk("DT: bus is %s (na=%d, ns=%d) on %s\n",
-               bus->name, na, ns, parent->full_name);
-    dt_dump_addr("DT: translating address:", addr, na);
-
-    /* Translate */
-    for ( ;; )
-    {
-        /* Switch to parent bus */
-        dev = parent;
-        parent = dt_get_parent(dev);
-
-        /* If root, we have finished */
-        if ( parent == NULL )
-        {
-            dt_dprintk("DT: reached root node\n");
-            result = dt_read_number(addr, na);
-            break;
-        }
-
-        /* Get new parent bus and counts */
-        pbus = dt_match_bus(parent);
-        if ( pbus == NULL )
-        {
-            printk("DT: %s is not a valid bus\n", parent->full_name);
-            break;
-        }
-        pbus->count_cells(dev, &pna, &pns);
-        if ( !DT_CHECK_COUNTS(pna, pns) )
-        {
-            printk(XENLOG_ERR "dt_parse: Bad cell count for parent %s\n",
-                   dev->full_name);
-            break;
-        }
-
-        dt_dprintk("DT: parent bus is %s (na=%d, ns=%d) on %s\n",
-                   pbus->name, pna, pns, parent->full_name);
-
-        /* Apply bus translation */
-        if ( dt_translate_one(dev, bus, pbus, addr, na, ns, pna, rprop) )
-            break;
-
-        /* Complete the move up one level */
-        na = pna;
-        ns = pns;
-        bus = pbus;
-
-        dt_dump_addr("DT: one level translation:", addr, na);
-    }
-
-bail:
-    return result;
-}
-
-/* dt_device_address - Translate device tree address and return it */
-int dt_device_get_address(const struct dt_device_node *dev, unsigned int index,
-                          u64 *addr, u64 *size)
-{
-    const __be32 *addrp;
-    unsigned int flags;
-
-    addrp = dt_get_address(dev, index, size, &flags);
-    if ( addrp == NULL )
-        return -EINVAL;
-
-    if ( !addr )
-        return -EINVAL;
-
-    *addr = __dt_translate_address(dev, addrp, "ranges");
-
-    if ( *addr == DT_BAD_ADDR )
-        return -EINVAL;
-
-    return 0;
-}
-
-int dt_device_get_paddr(const struct dt_device_node *dev, unsigned int index,
-                        paddr_t *addr, paddr_t *size)
-{
-    uint64_t dt_addr, dt_size;
-    int ret;
-
-    ret = dt_device_get_address(dev, index, &dt_addr, &dt_size);
-    if ( ret )
-        return ret;
-
-    if ( !addr )
-        return -EINVAL;
-
-    if ( dt_addr != (paddr_t)dt_addr )
-    {
-        printk("Error: Physical address 0x%"PRIx64" for node=%s is greater than max width (%zu bytes) supported\n",
-               dt_addr, dev->name, sizeof(paddr_t));
-        return -ERANGE;
-    }
-
-    *addr = dt_addr;
-
-    if ( size )
-    {
-        if ( dt_size != (paddr_t)dt_size )
-        {
-            printk("Error: Physical size 0x%"PRIx64" for node=%s is greater than max width (%zu bytes) supported\n",
-                   dt_size, dev->name, sizeof(paddr_t));
-            return -ERANGE;
-        }
-
-        *size = dt_size;
-    }
-
-    return ret;
-}
-
-int dt_for_each_range(const struct dt_device_node *dev,
-                      int (*cb)(const struct dt_device_node *dev,
-                                uint64_t addr, uint64_t length,
-                                void *data),
-                      void *data)
-{
-    const struct dt_device_node *parent = NULL;
-    const struct dt_bus *bus, *pbus;
-    const __be32 *ranges;
-    __be32 addr[DT_MAX_ADDR_CELLS];
-    unsigned int rlen;
-    int na, ns, pna, pns, rone;
-
-    bus = dt_match_bus(dev);
-    if ( !bus )
-        return 0; /* device is not a bus */
-
-    parent = dt_get_parent(dev);
-    if ( parent == NULL )
-        return -EINVAL;
-
-    ranges = dt_get_property(dev, "ranges", &rlen);
-    if ( ranges == NULL )
-    {
-        printk(XENLOG_ERR "DT: no ranges; cannot enumerate %s\n",
-               dev->full_name);
-        return -EINVAL;
-    }
-    if ( rlen == 0 ) /* Nothing to do */
-        return 0;
-
-    bus->count_cells(dev, &na, &ns);
-    if ( !DT_CHECK_COUNTS(na, ns) )
-    {
-        printk(XENLOG_ERR "dt_parse: Bad cell count for device %s\n",
-                  dev->full_name);
-        return -EINVAL;
-    }
-
-    pbus = dt_match_bus(parent);
-    if ( pbus == NULL )
-    {
-        printk("DT: %s is not a valid bus\n", parent->full_name);
-        return -EINVAL;
-    }
-
-    pbus->count_cells(dev, &pna, &pns);
-    if ( !DT_CHECK_COUNTS(pna, pns) )
-    {
-        printk(XENLOG_ERR "dt_parse: Bad cell count for parent %s\n",
-               dev->full_name);
-        return -EINVAL;
-    }
-
-    /* Now walk through the ranges */
-    rlen /= 4;
-    rone = na + pna + ns;
-
-    dt_dprintk("%s: dev=%s, bus=%s, parent=%s, rlen=%d, rone=%d\n",
-               __func__,
-               dt_node_name(dev), bus->name,
-               dt_node_name(parent), rlen, rone);
-
-    for ( ; rlen >= rone; rlen -= rone, ranges += rone )
-    {
-        uint64_t a, s;
-        int ret;
-
-        memcpy(addr, ranges + na, 4 * pna);
-
-        a = __dt_translate_address(dev, addr, "ranges");
-        s = dt_read_number(ranges + na + pna, ns);
-
-        ret = cb(dev, a, s, data);
-        if ( ret )
-        {
-            dt_dprintk(" -> callback failed=%d\n", ret);
-            return ret;
-        }
-
-    }
-
-    return 0;
-}
-
-/**
- * dt_find_node_by_phandle - Find a node given a phandle
- * @handle: phandle of the node to find
- *
- * Returns a node pointer.
- */
-struct dt_device_node *dt_find_node_by_phandle(dt_phandle handle)
-{
-    struct dt_device_node *np;
-
-    dt_for_each_device_node(dt_host, np)
-        if ( np->phandle == handle )
-            break;
-
-    return np;
-}
-
-/**
- * dt_irq_find_parent - Given a device node, find its interrupt parent node
- * @child: pointer to device node
- *
- * Returns a pointer to the interrupt parent node, or NULL if the interrupt
- * parent could not be determined.
- */
-static const struct dt_device_node *
-dt_irq_find_parent(const struct dt_device_node *child)
-{
-    const struct dt_device_node *p;
-    const __be32 *parp;
-
-    do
-    {
-        parp = dt_get_property(child, "interrupt-parent", NULL);
-        if ( parp == NULL )
-            p = dt_get_parent(child);
-        else
-            p = dt_find_node_by_phandle(be32_to_cpup(parp));
-        child = p;
-    } while ( p && dt_get_property(p, "#interrupt-cells", NULL) == NULL );
-
-    return p;
-}
-
-unsigned int dt_number_of_irq(const struct dt_device_node *device)
-{
-    const struct dt_device_node *p;
-    const __be32 *intspec, *tmp;
-    u32 intsize, intlen;
-    int intnum;
-
-    dt_dprintk("dt_irq_number: dev=%s\n", device->full_name);
-
-    /* Try the new-style interrupts-extended first */
-    intnum = dt_count_phandle_with_args(device, "interrupts-extended",
-                                        "#interrupt-cells");
-    if ( intnum >= 0 )
-    {
-        dt_dprintk(" using 'interrupts-extended' property\n");
-        dt_dprintk(" intnum=%d\n", intnum);
-        return intnum;
-    }
-
-    /* Get the interrupts property */
-    intspec = dt_get_property(device, "interrupts", &intlen);
-    if ( intspec == NULL )
-        return 0;
-    intlen /= sizeof(*intspec);
-
-    dt_dprintk(" using 'interrupts' property\n");
-    dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
-
-    /* Look for the interrupt parent. */
-    p = dt_irq_find_parent(device);
-    if ( p == NULL )
-        return 0;
-
-    /* Get size of interrupt specifier */
-    tmp = dt_get_property(p, "#interrupt-cells", NULL);
-    if ( tmp == NULL )
-        return 0;
-    intsize = be32_to_cpu(*tmp);
-
-    dt_dprintk(" intsize=%d intlen=%d\n", intsize, intlen);
-
-    return (intlen / intsize);
-}
-
-unsigned int dt_number_of_address(const struct dt_device_node *dev)
-{
-    const __be32 *prop;
-    u32 psize;
-    const struct dt_device_node *parent;
-    const struct dt_bus *bus;
-    int onesize, na, ns;
-
-    /* Get parent & match bus type */
-    parent = dt_get_parent(dev);
-    if ( parent == NULL )
-        return 0;
-
-    bus = dt_match_bus(parent);
-    if ( !bus )
-        return 0;
-    bus->count_cells(dev, &na, &ns);
-
-    if ( !DT_CHECK_COUNTS(na, ns) )
-        return 0;
-
-    /* Get "reg" or "assigned-addresses" property */
-    prop = dt_get_property(dev, bus->addresses, &psize);
-    if ( prop == NULL )
-        return 0;
-
-    psize /= 4;
-    onesize = na + ns;
-
-    return (psize / onesize);
-}
-
-int dt_for_each_irq_map(const struct dt_device_node *dev,
-                        int (*cb)(const struct dt_device_node *dev,
-                                  const struct dt_irq *dt_irq,
-                                  void *data),
-                        void *data)
-{
-    const struct dt_device_node *ipar, *tnode, *old = NULL;
-    const __be32 *tmp, *imap;
-    u32 intsize = 1, addrsize, pintsize = 0, paddrsize = 0;
-    u32 imaplen;
-    int i, ret;
-
-    struct dt_raw_irq dt_raw_irq;
-    struct dt_irq dt_irq;
-
-    dt_dprintk("%s: par=%s cb=%p data=%p\n", __func__,
-               dev->full_name, cb, data);
-
-    ipar = dev;
-
-    /* First get the #interrupt-cells property of the current cursor
-     * that tells us how to interpret the passed-in intspec. If there
-     * is none, we are nice and just walk up the tree
-     */
-    do {
-        tmp = dt_get_property(ipar, "#interrupt-cells", NULL);
-        if ( tmp != NULL )
-        {
-            intsize = be32_to_cpu(*tmp);
-            break;
-        }
-        tnode = ipar;
-        ipar = dt_irq_find_parent(ipar);
-    } while ( ipar );
-    if ( ipar == NULL )
-    {
-        dt_dprintk(" -> no parent found !\n");
-        goto fail;
-    }
-
-    dt_dprintk("%s: ipar=%s, size=%d\n", __func__, ipar->full_name, intsize);
-
-    if ( intsize > DT_MAX_IRQ_SPEC )
-    {
-        dt_dprintk(" -> too many irq specifier cells\n");
-        goto fail;
-    }
-
-    /* Look for this #address-cells. We have to implement the old linux
-     * trick of looking for the parent here as some device-trees rely on it
-     */
-    old = ipar;
-    do {
-        tmp = dt_get_property(old, "#address-cells", NULL);
-        tnode = dt_get_parent(old);
-        old = tnode;
-    } while ( old && tmp == NULL );
-
-    old = NULL;
-    addrsize = (tmp == NULL) ? 2 : be32_to_cpu(*tmp);
-
-    dt_dprintk(" -> addrsize=%d\n", addrsize);
-
-    /* Now look for an interrupt-map */
-    imap = dt_get_property(dev, "interrupt-map", &imaplen);
-    /* No interrupt-map found. Ignore */
-    if ( imap == NULL )
-    {
-        dt_dprintk(" -> no map, ignoring\n");
-        return 0;
-    }
-    imaplen /= sizeof(u32);
-
-    /* Parse interrupt-map */
-    while ( imaplen > (addrsize + intsize + 1) )
-    {
-        /* skip child unit address and child interrupt specifier */
-        imap += addrsize + intsize;
-        imaplen -= addrsize + intsize;
-
-        /* Get the interrupt parent */
-        ipar = dt_find_node_by_phandle(be32_to_cpup(imap));
-        imap++;
-        --imaplen;
-
-        /* Check if not found */
-        if ( ipar == NULL )
-        {
-            dt_dprintk(" -> imap parent not found !\n");
-            goto fail;
-        }
-
-        dt_dprintk(" -> ipar %s\n", dt_node_name(ipar));
-
-        /* Get #interrupt-cells and #address-cells of new
-         * parent
-         */
-        tmp = dt_get_property(ipar, "#interrupt-cells", NULL);
-        if ( tmp == NULL )
-        {
-            dt_dprintk(" -> parent lacks #interrupt-cells!\n");
-            goto fail;
-        }
-        pintsize = be32_to_cpu(*tmp);
-        tmp = dt_get_property(ipar, "#address-cells", NULL);
-        paddrsize = (tmp == NULL) ? 0 : be32_to_cpu(*tmp);
-
-        dt_dprintk(" -> pintsize=%d, paddrsize=%d\n",
-                   pintsize, paddrsize);
-
-        if ( pintsize > DT_MAX_IRQ_SPEC )
-        {
-            dt_dprintk(" -> too many irq specifier cells in parent\n");
-            goto fail;
-        }
-
-        /* Check for malformed properties */
-        if ( imaplen < (paddrsize + pintsize) )
-            goto fail;
-
-        imap += paddrsize;
-        imaplen -= paddrsize;
-
-        dt_raw_irq.controller = ipar;
-        dt_raw_irq.size = pintsize;
-        for ( i = 0; i < pintsize; i++ )
-            dt_raw_irq.specifier[i] = dt_read_number(imap + i, 1);
-
-        if ( dt_raw_irq.controller != dt_interrupt_controller )
-        {
-            /*
-             * We don't map IRQs connected to secondary IRQ controllers as
-             * these IRQs have no meaning to us until they connect to the
-             * primary controller.
-             *
-             * Secondary IRQ controllers will at some point connect to
-             * the primary controller (possibly via other IRQ controllers).
-             * We map the IRQs at that last connection point.
-             */
-            imap += pintsize;
-            imaplen -= pintsize;
-            dt_dprintk(" -> Skipped IRQ for secondary IRQ controller\n");
-            continue;
-        }
-
-        ret = dt_irq_translate(&dt_raw_irq, &dt_irq);
-        if ( ret )
-        {
-            dt_dprintk(" -> failed to translate IRQ: %d\n", ret);
-            return ret;
-        }
-
-        ret = cb(dev, &dt_irq, data);
-        if ( ret )
-        {
-            dt_dprintk(" -> callback failed=%d\n", ret);
-            return ret;
-        }
-
-        imap += pintsize;
-        imaplen -= pintsize;
-
-        dt_dprintk(" -> imaplen=%d\n", imaplen);
-    }
-
-    return 0;
-
-fail:
-    return -EINVAL;
-}
-
-/**
- * dt_irq_map_raw - Low level interrupt tree parsing
- * @parent:     the device interrupt parent
- * @intspec:    interrupt specifier ("interrupts" property of the device)
- * @ointsize:   size of the passed in interrupt specifier
- * @addr:       address specifier (start of "reg" property of the device)
- * @oirq:       structure dt_raw_irq filled by this function
- *
- * Returns 0 on success and a negative number on error
- *
- * This function is a low-level interrupt tree walking function. It
- * can be used to do a partial walk with synthesized reg and interrupts
- * properties, for example when resolving PCI interrupts when no device
- * node exist for the parent.
- */
-static int dt_irq_map_raw(const struct dt_device_node *parent,
-                          const __be32 *intspec, u32 ointsize,
-                          const __be32 *addr,
-                          struct dt_raw_irq *oirq)
-{
-    const struct dt_device_node *ipar, *tnode, *old = NULL, *newpar = NULL;
-    const __be32 *tmp, *imap, *imask;
-    u32 intsize = 1, addrsize, newintsize = 0, newaddrsize = 0;
-    u32 imaplen;
-    int match, i;
-
-    dt_dprintk("dt_irq_map_raw: par=%s,intspec=[0x%08x 0x%08x...],ointsize=%d\n",
-               parent->full_name, be32_to_cpup(intspec),
-               be32_to_cpup(intspec + 1), ointsize);
-
-    ipar = parent;
-
-    /* First get the #interrupt-cells property of the current cursor
-     * that tells us how to interpret the passed-in intspec. If there
-     * is none, we are nice and just walk up the tree
-     */
-    do {
-        tmp = dt_get_property(ipar, "#interrupt-cells", NULL);
-        if ( tmp != NULL )
-        {
-            intsize = be32_to_cpu(*tmp);
-            break;
-        }
-        tnode = ipar;
-        ipar = dt_irq_find_parent(ipar);
-    } while ( ipar );
-    if ( ipar == NULL )
-    {
-        dt_dprintk(" -> no parent found !\n");
-        goto fail;
-    }
-
-    dt_dprintk("dt_irq_map_raw: ipar=%s, size=%d\n", ipar->full_name, intsize);
-
-    if ( ointsize != intsize )
-        return -EINVAL;
-
-    /* Look for this #address-cells. We have to implement the old linux
-     * trick of looking for the parent here as some device-trees rely on it
-     */
-    old = ipar;
-    do {
-        tmp = dt_get_property(old, "#address-cells", NULL);
-        tnode = dt_get_parent(old);
-        old = tnode;
-    } while ( old && tmp == NULL );
-
-    old = NULL;
-    addrsize = (tmp == NULL) ? 2 : be32_to_cpu(*tmp);
-
-    dt_dprintk(" -> addrsize=%d\n", addrsize);
-
-    /* Now start the actual "proper" walk of the interrupt tree */
-    while ( ipar != NULL )
-    {
-        /* Now check if cursor is an interrupt-controller and if it is
-         * then we are done
-         */
-        if ( dt_get_property(ipar, "interrupt-controller", NULL) != NULL )
-        {
-            dt_dprintk(" -> got it !\n");
-            if ( intsize > DT_MAX_IRQ_SPEC )
-            {
-                dt_dprintk(" -> intsize(%u) greater than DT_MAX_IRQ_SPEC(%u)\n",
-                           intsize, DT_MAX_IRQ_SPEC);
-                goto fail;
-            }
-            for ( i = 0; i < intsize; i++ )
-                oirq->specifier[i] = dt_read_number(intspec + i, 1);
-            oirq->size = intsize;
-            oirq->controller = ipar;
-            return 0;
-        }
-
-        /* Now look for an interrupt-map */
-        imap = dt_get_property(ipar, "interrupt-map", &imaplen);
-        /* No interrupt map, check for an interrupt parent */
-        if ( imap == NULL )
-        {
-            dt_dprintk(" -> no map, getting parent\n");
-            newpar = dt_irq_find_parent(ipar);
-            goto skiplevel;
-        }
-        imaplen /= sizeof(u32);
-
-        /* Look for a mask */
-        imask = dt_get_property(ipar, "interrupt-map-mask", NULL);
-
-        /* If we were passed no "reg" property and we attempt to parse
-         * an interrupt-map, then #address-cells must be 0.
-         * Fail if it's not.
-         */
-        if ( addr == NULL && addrsize != 0 )
-        {
-            dt_dprintk(" -> no reg passed in when needed !\n");
-            goto fail;
-        }
-
-        /* Parse interrupt-map */
-        match = 0;
-        while ( imaplen > (addrsize + intsize + 1) && !match )
-        {
-            /* Compare specifiers */
-            match = 1;
-            for ( i = 0; i < addrsize && match; ++i )
-            {
-                __be32 mask = imask ? imask[i] : cpu_to_be32(0xffffffffu);
-                match = ((addr[i] ^ imap[i]) & mask) == 0;
-            }
-            for ( ; i < (addrsize + intsize) && match; ++i )
-            {
-                __be32 mask = imask ? imask[i] : cpu_to_be32(0xffffffffu);
-                match = ((intspec[i-addrsize] ^ imap[i]) & mask) == 0;
-            }
-            imap += addrsize + intsize;
-            imaplen -= addrsize + intsize;
-
-            dt_dprintk(" -> match=%d (imaplen=%d)\n", match, imaplen);
-
-            /* Get the interrupt parent */
-            newpar = dt_find_node_by_phandle(be32_to_cpup(imap));
-            imap++;
-            --imaplen;
-
-            /* Check if not found */
-            if ( newpar == NULL )
-            {
-                dt_dprintk(" -> imap parent not found !\n");
-                goto fail;
-            }
-
-            /* Get #interrupt-cells and #address-cells of new
-             * parent
-             */
-            tmp = dt_get_property(newpar, "#interrupt-cells", NULL);
-            if ( tmp == NULL )
-            {
-                dt_dprintk(" -> parent lacks #interrupt-cells!\n");
-                goto fail;
-            }
-            newintsize = be32_to_cpu(*tmp);
-            tmp = dt_get_property(newpar, "#address-cells", NULL);
-            newaddrsize = (tmp == NULL) ? 0 : be32_to_cpu(*tmp);
-
-            dt_dprintk(" -> newintsize=%d, newaddrsize=%d\n",
-                       newintsize, newaddrsize);
-
-            /* Check for malformed properties */
-            if ( imaplen < (newaddrsize + newintsize) )
-                goto fail;
-
-            imap += newaddrsize + newintsize;
-            imaplen -= newaddrsize + newintsize;
-
-            dt_dprintk(" -> imaplen=%d\n", imaplen);
-        }
-        if ( !match )
-            goto fail;
-
-        old = newpar;
-        addrsize = newaddrsize;
-        intsize = newintsize;
-        intspec = imap - intsize;
-        addr = intspec - addrsize;
-
-    skiplevel:
-        /* Iterate again with new parent */
-        dt_dprintk(" -> new parent: %s\n", dt_node_full_name(newpar));
-        ipar = newpar;
-        newpar = NULL;
-    }
-fail:
-    return -EINVAL;
-}
-
-int dt_device_get_raw_irq(const struct dt_device_node *device,
-                          unsigned int index,
-                          struct dt_raw_irq *out_irq)
-{
-    const struct dt_device_node *p;
-    const __be32 *intspec, *tmp, *addr;
-    u32 intsize, intlen;
-    int res = -EINVAL;
-    struct dt_phandle_args args;
-    int i;
-
-    dt_dprintk("dt_device_get_raw_irq: dev=%s, index=%u\n",
-               device->full_name, index);
-
-    /* Get the reg property (if any) */
-    addr = dt_get_property(device, "reg", NULL);
-
-    /* Try the new-style interrupts-extended first */
-    res = dt_parse_phandle_with_args(device, "interrupts-extended",
-                                     "#interrupt-cells", index, &args);
-    if ( !res )
-    {
-        dt_dprintk(" using 'interrupts-extended' property\n");
-        dt_dprintk(" intspec=%d intsize=%d\n", args.args[0], args.args_count);
-
-        for ( i = 0; i < args.args_count; i++ )
-            args.args[i] = cpu_to_be32(args.args[i]);
-
-        return dt_irq_map_raw(args.np, args.args, args.args_count,
-                              addr, out_irq);
-    }
-
-    /* Get the interrupts property */
-    intspec = dt_get_property(device, "interrupts", &intlen);
-    if ( intspec == NULL )
-        return -EINVAL;
-    intlen /= sizeof(*intspec);
-
-    dt_dprintk(" using 'interrupts' property\n");
-    dt_dprintk(" intspec=%d intlen=%d\n", be32_to_cpup(intspec), intlen);
-
-    /* Look for the interrupt parent. */
-    p = dt_irq_find_parent(device);
-    if ( p == NULL )
-        return -EINVAL;
-
-    /* Get size of interrupt specifier */
-    tmp = dt_get_property(p, "#interrupt-cells", NULL);
-    if ( tmp == NULL )
-        goto out;
-    intsize = be32_to_cpu(*tmp);
-
-    dt_dprintk(" intsize=%d intlen=%d\n", intsize, intlen);
-
-    /* Check index */
-    if ( (index + 1) * intsize > intlen )
-        goto out;
-
-    /* Get new specifier and map it */
-    res = dt_irq_map_raw(p, intspec + index * intsize, intsize,
-                         addr, out_irq);
-    if ( res )
-        goto out;
-out:
-    return res;
-}
-
-int dt_irq_translate(const struct dt_raw_irq *raw,
-                     struct dt_irq *out_irq)
-{
-    ASSERT(dt_irq_xlate != NULL);
-    ASSERT(dt_interrupt_controller != NULL);
-
-    /*
-     * TODO: Retrieve the right irq_xlate. This is only works for the primary
-     * interrupt controller.
-     */
-    if ( raw->controller != dt_interrupt_controller )
-        return -EINVAL;
-
-    return dt_irq_xlate(raw->specifier, raw->size,
-                        &out_irq->irq, &out_irq->type);
-}
-
-int dt_device_get_irq(const struct dt_device_node *device, unsigned int index,
-                      struct dt_irq *out_irq)
-{
-    struct dt_raw_irq raw;
-    int res;
-
-    res = dt_device_get_raw_irq(device, index, &raw);
-
-    if ( res )
-        return res;
-
-    return dt_irq_translate(&raw, out_irq);
-}
-
-bool dt_device_is_available(const struct dt_device_node *device)
-{
-    const char *status;
-    u32 statlen;
-
-    status = dt_get_property(device, "status", &statlen);
-    if ( status == NULL )
-        return 1;
-
-    if ( statlen > 0 )
-    {
-        if ( !strcmp(status, "okay") || !strcmp(status, "ok") )
-            return 1;
-    }
-
-    return 0;
-}
-
-bool dt_device_for_passthrough(const struct dt_device_node *device)
-{
-    return (dt_find_property(device, "xen,passthrough", NULL) != NULL);
-
-}
-
-static int __dt_parse_phandle_with_args(const struct dt_device_node *np,
-                                        const char *list_name,
-                                        const char *cells_name,
-                                        int cell_count, int index,
-                                        struct dt_phandle_args *out_args)
-{
-    const __be32 *list, *list_end;
-    int rc = 0, cur_index = 0;
-    u32 size, count = 0;
-    struct dt_device_node *node = NULL;
-    dt_phandle phandle;
-
-    /* Retrieve the phandle list property */
-    list = dt_get_property(np, list_name, &size);
-    if ( !list )
-        return -ENOENT;
-    list_end = list + size / sizeof(*list);
-
-    /* Loop over the phandles until all the requested entry is found */
-    while ( list < list_end )
-    {
-        rc = -EINVAL;
-        count = 0;
-
-        /*
-         * If phandle is 0, then it is an empty entry with no
-         * arguments.  Skip forward to the next entry.
-         * */
-        phandle = be32_to_cpup(list++);
-        if ( phandle )
-        {
-            /*
-             * Find the provider node and parse the #*-cells
-             * property to determine the argument length.
-             *
-             * This is not needed if the cell count is hard-coded
-             * (i.e. cells_name not set, but cell_count is set),
-             * except when we're going to return the found node
-             * below.
-             */
-            if ( cells_name || cur_index == index )
-            {
-                node = dt_find_node_by_phandle(phandle);
-                if ( !node )
-                {
-                    printk(XENLOG_ERR "%s: could not find phandle\n",
-                           np->full_name);
-                    goto err;
-                }
-            }
-
-            if ( cells_name )
-            {
-                if ( !dt_property_read_u32(node, cells_name, &count) )
-                {
-                    printk("%s: could not get %s for %s\n",
-                           np->full_name, cells_name, node->full_name);
-                    goto err;
-                }
-            }
-            else
-                count = cell_count;
-
-            /*
-             * Make sure that the arguments actually fit in the
-             * remaining property data length
-             */
-            if ( list + count > list_end )
-            {
-                printk(XENLOG_ERR "%s: arguments longer than property\n",
-                       np->full_name);
-                goto err;
-            }
-        }
-
-        /*
-         * All of the error cases above bail out of the loop, so at
-         * this point, the parsing is successful. If the requested
-         * index matches, then fill the out_args structure and return,
-         * or return -ENOENT for an empty entry.
-         */
-        rc = -ENOENT;
-        if ( cur_index == index )
-        {
-            if (!phandle)
-                goto err;
-
-            if ( out_args )
-            {
-                int i;
-
-                WARN_ON(count > MAX_PHANDLE_ARGS);
-                if (count > MAX_PHANDLE_ARGS)
-                    count = MAX_PHANDLE_ARGS;
-                out_args->np = node;
-                out_args->args_count = count;
-                for ( i = 0; i < count; i++ )
-                    out_args->args[i] = be32_to_cpup(list++);
-            }
-
-            /* Found it! return success */
-            return 0;
-        }
-
-        node = NULL;
-        list += count;
-        cur_index++;
-    }
-
-    /*
-     * Returning result will be one of:
-     * -ENOENT : index is for empty phandle
-     * -EINVAL : parsing error on data
-     * [1..n]  : Number of phandle (count mode; when index = -1)
-     */
-    rc = index < 0 ? cur_index : -ENOENT;
-err:
-    return rc;
-}
-
-struct dt_device_node *dt_parse_phandle(const struct dt_device_node *np,
-                                        const char *phandle_name, int index)
-{
-    struct dt_phandle_args args;
-
-    if (index < 0)
-        return NULL;
-
-    if (__dt_parse_phandle_with_args(np, phandle_name, NULL, 0,
-                                     index, &args))
-        return NULL;
-
-    return args.np;
-}
-
-
-int dt_parse_phandle_with_args(const struct dt_device_node *np,
-                               const char *list_name,
-                               const char *cells_name, int index,
-                               struct dt_phandle_args *out_args)
-{
-    if ( index < 0 )
-        return -EINVAL;
-    return __dt_parse_phandle_with_args(np, list_name, cells_name, 0,
-                                        index, out_args);
-}
-
-int dt_count_phandle_with_args(const struct dt_device_node *np,
-                               const char *list_name,
-                               const char *cells_name)
-{
-    return __dt_parse_phandle_with_args(np, list_name, cells_name, 0, -1, NULL);
-}
-
-/**
- * unflatten_dt_node - Alloc and populate a device_node from the flat tree
- * @fdt: The parent device tree blob
- * @mem: Memory chunk to use for allocating device nodes and properties
- * @p: pointer to node in flat tree
- * @dad: Parent struct device_node
- * @allnextpp: pointer to ->allnext from last allocated device_node
- * @fpsize: Size of the node path up at the current depth.
- */
-static unsigned long unflatten_dt_node(const void *fdt,
-                                       unsigned long mem,
-                                       unsigned long *p,
-                                       struct dt_device_node *dad,
-                                       struct dt_device_node ***allnextpp,
-                                       unsigned long fpsize)
-{
-    struct dt_device_node *np;
-    struct dt_property *pp, **prev_pp = NULL;
-    char *pathp;
-    u32 tag;
-    unsigned int l, allocl;
-    int has_name = 0;
-    int new_format = 0;
-
-    tag = be32_to_cpup((__be32 *)(*p));
-    if ( tag != FDT_BEGIN_NODE )
-    {
-        printk(XENLOG_WARNING "Weird tag at start of node: %x\n", tag);
-        return mem;
-    }
-    *p += 4;
-    pathp = (char *)*p;
-    l = allocl = strlen(pathp) + 1;
-    *p = ROUNDUP(*p + l, 4);
-
-    /* version 0x10 has a more compact unit name here instead of the full
-     * path. we accumulate the full path size using "fpsize", we'll rebuild
-     * it later. We detect this because the first character of the name is
-     * not '/'.
-     */
-    if ( (*pathp) != '/' )
-    {
-        new_format = 1;
-        if ( fpsize == 0 )
-        {
-            /* root node: special case. fpsize accounts for path
-             * plus terminating zero. root node only has '/', so
-             * fpsize should be 2, but we want to avoid the first
-             * level nodes to have two '/' so we use fpsize 1 here
-             */
-            fpsize = 1;
-            allocl = 2;
-        }
-        else
-        {
-            /* account for '/' and path size minus terminal 0
-             * already in 'l'
-             */
-            fpsize += l;
-            allocl = fpsize;
-        }
-    }
-
-    np = unflatten_dt_alloc(&mem, sizeof(struct dt_device_node) + allocl,
-                            __alignof__(struct dt_device_node));
-    if ( allnextpp )
-    {
-        memset(np, 0, sizeof(*np));
-        np->full_name = ((char *)np) + sizeof(struct dt_device_node);
-        /* By default dom0 owns the device */
-        np->used_by = 0;
-        /* By default the device is not protected */
-        np->is_protected = false;
-        INIT_LIST_HEAD(&np->domain_list);
-
-        if ( new_format )
-        {
-            char *fn = np->full_name;
-            /* rebuild full path for new format */
-            if ( dad && dad->parent )
-            {
-                strlcpy(fn, dad->full_name, allocl);
-#ifdef DEBUG_DT
-                if ( (strlen(fn) + l + 1) != allocl )
-                {
-                    dt_dprintk("%s: p: %d, l: %d, a: %d\n",
-                               pathp, (int)strlen(fn),
-                               l, allocl);
-                }
-#endif
-                fn += strlen(fn);
-            }
-            *(fn++) = '/';
-            memcpy(fn, pathp, l);
-        }
-        else
-            memcpy(np->full_name, pathp, l);
-        prev_pp = &np->properties;
-        **allnextpp = np;
-        *allnextpp = &np->allnext;
-        if ( dad != NULL )
-        {
-            np->parent = dad;
-            /* we temporarily use the next field as `last_child'*/
-            if ( dad->next == NULL )
-                dad->child = np;
-            else
-                dad->next->sibling = np;
-            dad->next = np;
-        }
-    }
-    /* process properties */
-    while ( 1 )
-    {
-        u32 sz, noff;
-        const char *pname;
-
-        tag = be32_to_cpup((__be32 *)(*p));
-        if ( tag == FDT_NOP )
-        {
-            *p += 4;
-            continue;
-        }
-        if ( tag != FDT_PROP )
-            break;
-        *p += 4;
-        sz = be32_to_cpup((__be32 *)(*p));
-        noff = be32_to_cpup((__be32 *)((*p) + 4));
-        *p += 8;
-        if ( fdt_version(fdt) < 0x10 )
-            *p = ROUNDUP(*p, sz >= 8 ? 8 : 4);
-
-        pname = fdt_string(fdt, noff);
-        if ( pname == NULL )
-        {
-            dt_dprintk("Can't find property name in list!\n");
-            break;
-        }
-        if ( strcmp(pname, "name") == 0 )
-            has_name = 1;
-        l = strlen(pname) + 1;
-        pp = unflatten_dt_alloc(&mem, sizeof(struct dt_property),
-                                __alignof__(struct dt_property));
-        if ( allnextpp )
-        {
-            /* We accept flattened tree phandles either in
-             * ePAPR-style "phandle" properties, or the
-             * legacy "linux,phandle" properties.  If both
-             * appear and have different values, things
-             * will get weird.  Don't do that. */
-            if ( (strcmp(pname, "phandle") == 0) ||
-                 (strcmp(pname, "linux,phandle") == 0) )
-            {
-                if ( np->phandle == 0 )
-                    np->phandle = be32_to_cpup((__be32*)*p);
-            }
-            /* And we process the "ibm,phandle" property
-             * used in pSeries dynamic device tree
-             * stuff */
-            if ( strcmp(pname, "ibm,phandle") == 0 )
-                np->phandle = be32_to_cpup((__be32 *)*p);
-            pp->name = pname;
-            pp->length = sz;
-            pp->value = (void *)*p;
-            *prev_pp = pp;
-            prev_pp = &pp->next;
-        }
-        *p = ROUNDUP((*p) + sz, 4);
-    }
-    /* with version 0x10 we may not have the name property, recreate
-     * it here from the unit name if absent
-     */
-    if ( !has_name )
-    {
-        char *p1 = pathp, *ps = pathp, *pa = NULL;
-        int sz;
-
-        while ( *p1 )
-        {
-            if ( (*p1) == '@' )
-                pa = p1;
-            if ( (*p1) == '/' )
-                ps = p1 + 1;
-            p1++;
-        }
-        if ( pa < ps )
-            pa = p1;
-        sz = (pa - ps) + 1;
-        pp = unflatten_dt_alloc(&mem, sizeof(struct dt_property) + sz,
-                                __alignof__(struct dt_property));
-        if ( allnextpp )
-        {
-            pp->name = "name";
-            pp->length = sz;
-            pp->value = pp + 1;
-            /*
-             * The device tree creation code assume that the property
-             * "name" is not a fake.
-             * To avoid a big divergence with Linux code, only remove
-             * property link. In this case we will lose a bit of memory
-             */
-#if 0
-            *prev_pp = pp;
-            prev_pp = &pp->next;
-#endif
-            np->name = pp->value;
-            memcpy(pp->value, ps, sz - 1);
-            ((char *)pp->value)[sz - 1] = 0;
-            dt_dprintk("fixed up name for %s -> %s\n", pathp,
-                       (char *)pp->value);
-            /* Generic device initialization */
-            np->dev.type = DEV_DT;
-            np->dev.of_node = np;
-        }
-    }
-    if ( allnextpp )
-    {
-        *prev_pp = NULL;
-        np->name = (np->name) ? : dt_get_property(np, "name", NULL);
-        np->type = dt_get_property(np, "device_type", NULL);
-
-        if ( !np->name )
-            np->name = "<NULL>";
-        if ( !np->type )
-            np->type = "<NULL>";
-    }
-    while ( tag == FDT_BEGIN_NODE || tag == FDT_NOP )
-    {
-        if ( tag == FDT_NOP )
-            *p += 4;
-        else
-            mem = unflatten_dt_node(fdt, mem, p, np, allnextpp, fpsize);
-        tag = be32_to_cpup((__be32 *)(*p));
-    }
-    if ( tag != FDT_END_NODE )
-    {
-        printk(XENLOG_WARNING "Weird tag at end of node: %x\n", tag);
-        return mem;
-    }
-
-    *p += 4;
-    return mem;
-}
-
-int unflatten_device_tree(const void *fdt, struct dt_device_node **mynodes)
-{
-    unsigned long start, mem, size;
-    struct dt_device_node **allnextp = mynodes;
-
-    dt_dprintk(" -> unflatten_device_tree()\n");
-
-    dt_dprintk("Unflattening device tree:\n");
-    dt_dprintk("magic: %#08x\n", fdt_magic(fdt));
-    dt_dprintk("size: %#08x\n", fdt_totalsize(fdt));
-    dt_dprintk("version: %#08x\n", fdt_version(fdt));
-
-    /* First pass, scan for size */
-    start = ((unsigned long)fdt) + fdt_off_dt_struct(fdt);
-    size = unflatten_dt_node(fdt, 0, &start, NULL, NULL, 0);
-    if ( !size )
-        return -EINVAL;
-
-    size = (size | 3) + 1;
-
-    dt_dprintk("  size is %#lx allocating...\n", size);
-
-    /* Allocate memory for the expanded device tree */
-    mem = (unsigned long)_xmalloc (size + 4, __alignof__(struct dt_device_node));
-    if ( !mem )
-        return -ENOMEM;
-
-    ((__be32 *)mem)[size / 4] = cpu_to_be32(0xdeadbeefU);
-
-    dt_dprintk("  unflattening %lx...\n", mem);
-
-    /* Second pass, do actual unflattening */
-    start = ((unsigned long)fdt) + fdt_off_dt_struct(fdt);
-    unflatten_dt_node(fdt, mem, &start, NULL, &allnextp, 0);
-    if ( be32_to_cpup((__be32 *)start) != FDT_END )
-    {
-        printk(XENLOG_ERR "Weird tag at end of tree: %08x\n",
-                  *((u32 *)start));
-        xfree((void *)mem);
-        return -EINVAL;
-    }
-
-    if ( be32_to_cpu(((__be32 *)mem)[size / 4]) != 0xdeadbeefU )
-    {
-        printk(XENLOG_ERR "End of tree marker overwritten: %08x\n",
-                  be32_to_cpu(((__be32 *)mem)[size / 4]));
-        xfree((void *)mem);
-        return -EINVAL;
-    }
-
-    *allnextp = NULL;
-
-    dt_dprintk(" <- unflatten_device_tree()\n");
-
-    return 0;
-}
-
-static void dt_alias_add(struct dt_alias_prop *ap,
-                         struct dt_device_node *np,
-                         int id, const char *stem, int stem_len)
-{
-    ap->np = np;
-    ap->id = id;
-    strlcpy(ap->stem, stem, stem_len + 1);
-    list_add_tail(&ap->link, &aliases_lookup);
-    dt_dprintk("adding DT alias:%s: stem=%s id=%d node=%s\n",
-               ap->alias, ap->stem, ap->id, dt_node_full_name(np));
-}
-
-/**
- * dt_alias_scan - Scan all properties of 'aliases' node
- *
- * The function scans all the properties of 'aliases' node and populate
- * the the global lookup table with the properties.  It returns the
- * number of alias_prop found, or error code in error case.
- */
-static void __init dt_alias_scan(void)
-{
-    const struct dt_property *pp;
-    const struct dt_device_node *aliases;
-
-    aliases = dt_find_node_by_path("/aliases");
-    if ( !aliases )
-        return;
-
-    dt_for_each_property_node( aliases, pp )
-    {
-        const char *start = pp->name;
-        const char *end = start + strlen(start);
-        struct dt_device_node *np;
-        struct dt_alias_prop *ap;
-        int id, len;
-
-        /* Skip those we do not want to proceed */
-        if ( !strcmp(pp->name, "name") ||
-             !strcmp(pp->name, "phandle") ||
-             !strcmp(pp->name, "linux,phandle") )
-            continue;
-
-        np = dt_find_node_by_path(pp->value);
-        if ( !np )
-            continue;
-
-        /* walk the alias backwards to extract the id and work out
-         * the 'stem' string */
-        while ( isdigit(*(end-1)) && end > start )
-            end--;
-        len = end - start;
-
-        id = simple_strtoll(end, NULL, 10);
-
-        /* Allocate an alias_prop with enough space for the stem */
-        ap = _xmalloc(sizeof(*ap) + len + 1, 4);
-        if ( !ap )
-            continue;
-        ap->alias = start;
-        dt_alias_add(ap, np, id, start, len);
-    }
-}
-
-struct dt_device_node * __init
-dt_find_interrupt_controller(const struct dt_device_match *matches)
-{
-    struct dt_device_node *np = NULL;
-
-    while ( (np = dt_find_matching_node(np, matches)) )
-    {
-        if ( !dt_find_property(np, "interrupt-controller", NULL) )
-            continue;
-
-        if ( dt_get_parent(np) )
-            break;
-    }
-
-    return np;
-}
-
-void __init dt_unflatten_host_device_tree(void)
-{
-    int error = unflatten_device_tree(device_tree_flattened, &dt_host);
-
-    if ( error )
-        panic("unflatten_device_tree failed with error %d\n", error);
-
-    dt_alias_scan();
-}
-
-int dt_get_pci_domain_nr(struct dt_device_node *node)
-{
-    u32 domain;
-    int error;
-
-    error = dt_property_read_u32(node, "linux,pci-domain", &domain);
-    if ( !error )
-        return -EINVAL;
-
-    return (u16)domain;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/include/xen/bootfdt.h b/xen/include/xen/bootfdt.h
new file mode 100644
index 0000000000..c39428d5f5
--- /dev/null
+++ b/xen/include/xen/bootfdt.h
@@ -0,0 +1,195 @@
+#ifndef XEN_BOOTFDT_H
+#define XEN_BOOTFDT_H
+
+#include <xen/types.h>
+#include <xen/kernel.h>
+#include <xen/macros.h>
+
+#define MIN_FDT_ALIGN 8
+
+#define NR_MEM_BANKS 256
+#define NR_SHMEM_BANKS 32
+
+#define MAX_MODULES 32 /* Current maximum useful modules */
+
+typedef enum {
+    BOOTMOD_XEN,
+    BOOTMOD_FDT,
+    BOOTMOD_KERNEL,
+    BOOTMOD_RAMDISK,
+    BOOTMOD_XSM,
+    BOOTMOD_GUEST_DTB,
+    BOOTMOD_UNKNOWN
+}  bootmodule_kind;
+
+enum membank_type {
+    /*
+     * The MEMBANK_DEFAULT type refers to either reserved memory for the
+     * device/firmware (when the bank is in 'reserved_mem') or any RAM (when
+     * the bank is in 'mem').
+     */
+    MEMBANK_DEFAULT,
+    /*
+     * The MEMBANK_STATIC_DOMAIN type is used to indicate whether the memory
+     * bank is bound to a static Xen domain. It is only valid when the bank
+     * is in reserved_mem.
+     */
+    MEMBANK_STATIC_DOMAIN,
+    /*
+     * The MEMBANK_STATIC_HEAP type is used to indicate whether the memory
+     * bank is reserved as static heap. It is only valid when the bank is
+     * in reserved_mem.
+     */
+    MEMBANK_STATIC_HEAP,
+    /*
+     * The MEMBANK_FDT_RESVMEM type is used to indicate whether the memory
+     * bank is from the FDT reserve map.
+     */
+    MEMBANK_FDT_RESVMEM,
+};
+
+/* Indicates the maximum number of characters(\0 included) for shm_id */
+#define MAX_SHM_ID_LENGTH 16
+
+struct shmem_membank_extra {
+    char shm_id[MAX_SHM_ID_LENGTH];
+    unsigned int nr_shm_borrowers;
+};
+
+struct membank {
+    paddr_t start;
+    paddr_t size;
+    union {
+        enum membank_type type;
+#ifdef CONFIG_STATIC_SHM
+        struct shmem_membank_extra *shmem_extra;
+#endif
+    };
+};
+
+struct membanks {
+    __struct_group(membanks_hdr, common, ,
+        unsigned int nr_banks;
+        unsigned int max_banks;
+    );
+    struct membank bank[];
+};
+
+struct meminfo {
+    struct membanks_hdr common;
+    struct membank bank[NR_MEM_BANKS];
+};
+
+struct shared_meminfo {
+    struct membanks_hdr common;
+    struct membank bank[NR_SHMEM_BANKS];
+    struct shmem_membank_extra extra[NR_SHMEM_BANKS];
+};
+
+/*
+ * The domU flag is set for kernels and ramdisks of "xen,domain" nodes.
+ * The purpose of the domU flag is to avoid getting confused in
+ * kernel_probe, where we try to guess which is the dom0 kernel and
+ * initrd to be compatible with all versions of the multiboot spec.
+ */
+#define BOOTMOD_MAX_CMDLINE 1024
+struct bootmodule {
+    bootmodule_kind kind;
+    bool domU;
+    paddr_t start;
+    paddr_t size;
+};
+
+/* DT_MAX_NAME is the node name max length according the DT spec */
+#define DT_MAX_NAME 41
+struct bootcmdline {
+    bootmodule_kind kind;
+    bool domU;
+    paddr_t start;
+    char dt_name[DT_MAX_NAME];
+    char cmdline[BOOTMOD_MAX_CMDLINE];
+};
+
+struct bootmodules {
+    int nr_mods;
+    struct bootmodule module[MAX_MODULES];
+};
+
+struct bootcmdlines {
+    unsigned int nr_mods;
+    struct bootcmdline cmdline[MAX_MODULES];
+};
+
+struct bootinfo {
+    struct meminfo mem;
+    /* The reserved regions are only used when booting using Device-Tree */
+    struct meminfo reserved_mem;
+    struct bootmodules modules;
+    struct bootcmdlines cmdlines;
+#ifdef CONFIG_ACPI
+    struct meminfo acpi;
+#endif
+#ifdef CONFIG_STATIC_SHM
+    struct shared_meminfo shmem;
+#endif
+    bool static_heap;
+};
+
+#ifdef CONFIG_ACPI
+#define BOOTINFO_ACPI_INIT .acpi.common.max_banks = NR_MEM_BANKS,
+#else
+#define BOOTINFO_ACPI_INIT
+#endif
+
+#ifdef CONFIG_STATIC_SHM
+#define BOOTINFO_SHMEM_INIT .shmem.common.max_banks = NR_SHMEM_BANKS,
+#else
+#define BOOTINFO_SHMEM_INIT
+#endif
+
+#define BOOTINFO_INIT                               \
+{                                                   \
+    .mem.common.max_banks = NR_MEM_BANKS,           \
+    .reserved_mem.common.max_banks = NR_MEM_BANKS,  \
+    BOOTINFO_ACPI_INIT                              \
+    BOOTINFO_SHMEM_INIT                             \
+}
+
+extern struct bootinfo bootinfo;
+
+void populate_boot_allocator(void);
+
+size_t boot_fdt_info(const void *fdt, paddr_t paddr);
+
+const char *boot_fdt_cmdline(const void *fdt);
+
+static inline struct membanks *bootinfo_get_reserved_mem(void)
+{
+    return container_of(&bootinfo.reserved_mem.common, struct membanks, common);
+}
+
+static inline struct membanks *bootinfo_get_mem(void)
+{
+    return container_of(&bootinfo.mem.common, struct membanks, common);
+}
+
+#ifdef CONFIG_ACPI
+static inline struct membanks *bootinfo_get_acpi(void)
+{
+    return container_of(&bootinfo.acpi.common, struct membanks, common);
+}
+#endif
+
+#ifdef CONFIG_STATIC_SHM
+static inline struct membanks *bootinfo_get_shmem(void)
+{
+    return container_of(&bootinfo.shmem.common, struct membanks, common);
+}
+
+static inline struct shmem_membank_extra *bootinfo_get_shmem_extra(void)
+{
+    return bootinfo.shmem.extra;
+}
+#endif
+
+#endif /* XEN_BOOTFDT_H */
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 11:36:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 11:36:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772065.1182511 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saw0m-0002wH-4c; Mon, 05 Aug 2024 11:36:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772065.1182511; Mon, 05 Aug 2024 11:36:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saw0m-0002wA-1M; Mon, 05 Aug 2024 11:36:24 +0000
Received: by outflank-mailman (input) for mailman id 772065;
 Mon, 05 Aug 2024 11:36:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=006L=PE=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1saw0l-0002gX-19
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 11:36:23 +0000
Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com
 [2a00:1450:4864:20::52a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id efe85f0d-531e-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 13:36:21 +0200 (CEST)
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-5b8c2a6135dso3137099a12.1
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 04:36:21 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9bc3d09sm447203566b.17.2024.08.05.04.36.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 05 Aug 2024 04:36:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: efe85f0d-531e-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722857780; x=1723462580; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=EhS5SP84yaabDwJXaAvhqsL4sG4Ur5p/KeFyNUDrOpE=;
        b=VEbQCkNsdyOKutoezfHuh8DDxzhzeOy9f5o8mdNFveWMmrsrAD8eYd9EKv+0i2D/C2
         nNJaW7ihNx7Useze8IuG7H+siVaGNTVD6P6ucC7JhUJ9QEAC6HWGxF5YOWP3I+TezCOM
         hRQWzNlhaykm7gzeLgWFdclP5hBTJhq4ETSiTtWpD0SkHAZYIj6qHoAnbLd/kElOtzwe
         tN31CuUP2RAEz8YWKO8Pl4MRgQCigEwKIjKKOb6U09ml75JP6PanjYxn1rDHozRqPLdh
         +2vC1SBWpGS6z49eLBDKfZtYBljH5LhOqZzrQhmDzx1StHuF3WatZySQsmgUf3DWerJx
         D1ig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722857780; x=1723462580;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=EhS5SP84yaabDwJXaAvhqsL4sG4Ur5p/KeFyNUDrOpE=;
        b=DCDaZOqBjZ3uXAYinHiEbhkVKa/cVVgg4LAwOpHDVvclBizFIOi2Lwvyzm/29Lr+PO
         /X6W4V+yvnPTN0JK1ZAO3vzvdtlFF8QJF0qlS7i8Go+ov4Hk83UN5icK7TkhaCUYMRFb
         fkaNMQFfZ8kXnwqN6yVN12axwecXuDMM4+62Gp2rvCqXX27nPMOgKqPNRy5FEP7N03Vy
         9382a0gWqZhc5WXGl9p5SavstowbAjkQYCatXk/oX81x9WfYPXCBt7O247Da2pwx5jwl
         QA0iDOvqsTLv/VSBIIz04SWKvJnyPFytzeOgKv/7Gp++4fpXMwfHghZRP0yindWEN8A2
         KWCA==
X-Gm-Message-State: AOJu0YycfBMCZaFtBCubwxVTAdzZ0Y6kEtlymOPjiV4ahDth2/Zy5ZIH
	tzGho+gBmArrSU1ZcrHp+zMk2eWQyPD1EXVnC1YBThTb69+Hao/0AQuQcA==
X-Google-Smtp-Source: AGHT+IGbHL5gv1t+RJSNoB78fdxf2/d0SWq60n9JrBBEY3tr9jN2Uh/asjG50iUt/vhCNgXgsVlcJw==
X-Received: by 2002:a17:907:6d2a:b0:a7c:4095:ccb6 with SMTP id a640c23a62f3a-a7dc4e4b27bmr870411266b.16.1722857779833;
        Mon, 05 Aug 2024 04:36:19 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Shawn Anastasio <sanastasio@raptorengineering.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: [PATCH v8 2/2] xen/common: Move Arm's bootfdt.c to common
Date: Mon,  5 Aug 2024 13:33:50 +0200
Message-ID: <85321f4a2fc7f1d892aa658603bffaae25249045.1722856894.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1722856894.git.oleksii.kurochko@gmail.com>
References: <cover.1722856894.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Shawn Anastasio <sanastasio@raptorengineering.com>

Move Arm's bootfdt.c to xen/common so that it can be used by other
device tree architectures like PPC and RISCV.

Remove stubs for process_shm_node() and early_print_info_shmem()
from $xen/arch/arm/include/asm/static-shmem.h.
These stubs are removed to avoid introducing them for architectures
that do not support CONFIG_STATIC_SHM.
The process_shm_node() stub is now implemented in common code to
maintain the current behavior of early_scan_code() on ARM.
The early_print_info_shmem() stub is only used in early_print_info(),
so it's now guarded with #ifdef CONFIG_STATIC_SHM ... #endif.

Suggested-by: Julien Grall <julien@xen.org>
Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V8:
 - Fix the change log for this patch ( accidentally the change log of the previous
   patch was copied to this ).
 - Drop the stub of process_shm_node() and early_print_info_shmem() in
   xen/arch/arm/include/asm/static-shmem.h as it is moved to common code to not
   re-introduce the same stub for each architecture which doesn't support
   CONFIG_STATIC_SHM now.
 - Drop Acked-by: Julien Grall <julien@xen.org> as after the Ack additional changes were
   done so an additional review is needed.
---
Changes in V7:
 - Nothing changed. Only rebase.
---
Changes in V6:
 - update the version of the patch to v6.
---
Changes in v5:
 - add guard #ifdef CONFIG_STATIC_SHM around inclusion of <asm/static-shmem.h>
   in common/device-tree/bootfdt.c.
 - add stub for process_shm_node() in case CONFIG_STATIC_SHM isn't enabled.
 - add guard around #ifdef CONFIG_STATIC_SHM aroud early_print_info_shmem() in
   early_print_info().
---
Changes in v4:
  - move function prototypes to patch 2's xen/include/bootfdt.h
  - clean up #includes
---
 xen/arch/arm/Makefile                   |   1 -
 xen/arch/arm/bootfdt.c                  | 622 -----------------------
 xen/arch/arm/include/asm/setup.h        |  13 -
 xen/arch/arm/include/asm/static-shmem.h |   9 -
 xen/common/device-tree/Makefile         |   1 +
 xen/common/device-tree/bootfdt.c        | 635 ++++++++++++++++++++++++
 xen/include/xen/bootfdt.h               |  14 +
 7 files changed, 650 insertions(+), 645 deletions(-)
 delete mode 100644 xen/arch/arm/bootfdt.c
 create mode 100644 xen/common/device-tree/bootfdt.c

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 45dc29ea53..da9c979dc4 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -10,7 +10,6 @@ obj-$(CONFIG_TEE) += tee/
 obj-$(CONFIG_HAS_VPCI) += vpci.o
 
 obj-$(CONFIG_HAS_ALTERNATIVE) += alternative.o
-obj-y += bootfdt.init.o
 obj-y += cpuerrata.o
 obj-y += cpufeature.o
 obj-y += decode.o
diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
deleted file mode 100644
index 6e060111d9..0000000000
--- a/xen/arch/arm/bootfdt.c
+++ /dev/null
@@ -1,622 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Early Device Tree
- *
- * Copyright (C) 2012-2014 Citrix Systems, Inc.
- */
-#include <xen/types.h>
-#include <xen/lib.h>
-#include <xen/kernel.h>
-#include <xen/init.h>
-#include <xen/efi.h>
-#include <xen/device_tree.h>
-#include <xen/lib.h>
-#include <xen/libfdt/libfdt-xen.h>
-#include <xen/sort.h>
-#include <xsm/xsm.h>
-#include <asm/setup.h>
-#include <asm/static-shmem.h>
-
-static void __init __maybe_unused build_assertions(void)
-{
-    /*
-     * Check that no padding is between struct membanks "bank" flexible array
-     * member and struct meminfo "bank" member
-     */
-    BUILD_BUG_ON((offsetof(struct membanks, bank) !=
-                 offsetof(struct meminfo, bank)));
-    /* Ensure "struct membanks" is 8-byte aligned */
-    BUILD_BUG_ON(alignof(struct membanks) != 8);
-}
-
-static bool __init device_tree_node_is_available(const void *fdt, int node)
-{
-    const char *status;
-    int len;
-
-    status = fdt_getprop(fdt, node, "status", &len);
-    if ( !status )
-        return true;
-
-    if ( len > 0 )
-    {
-        if ( !strcmp(status, "ok") || !strcmp(status, "okay") )
-            return true;
-    }
-
-    return false;
-}
-
-static bool __init device_tree_node_matches(const void *fdt, int node,
-                                            const char *match)
-{
-    const char *name;
-    size_t match_len;
-
-    name = fdt_get_name(fdt, node, NULL);
-    match_len = strlen(match);
-
-    /* Match both "match" and "match@..." patterns but not
-       "match-foo". */
-    return strncmp(name, match, match_len) == 0
-        && (name[match_len] == '@' || name[match_len] == '\0');
-}
-
-static bool __init device_tree_node_compatible(const void *fdt, int node,
-                                               const char *match)
-{
-    int len, l;
-    const void *prop;
-
-    prop = fdt_getprop(fdt, node, "compatible", &len);
-    if ( prop == NULL )
-        return false;
-
-    while ( len > 0 ) {
-        if ( !dt_compat_cmp(prop, match) )
-            return true;
-        l = strlen(prop) + 1;
-        prop += l;
-        len -= l;
-    }
-
-    return false;
-}
-
-void __init device_tree_get_reg(const __be32 **cell, uint32_t address_cells,
-                                uint32_t size_cells, paddr_t *start,
-                                paddr_t *size)
-{
-    uint64_t dt_start, dt_size;
-
-    /*
-     * dt_next_cell will return uint64_t whereas paddr_t may not be 64-bit.
-     * Thus, there is an implicit cast from uint64_t to paddr_t.
-     */
-    dt_start = dt_next_cell(address_cells, cell);
-    dt_size = dt_next_cell(size_cells, cell);
-
-    if ( dt_start != (paddr_t)dt_start )
-    {
-        printk("Physical address greater than max width supported\n");
-        WARN();
-    }
-
-    if ( dt_size != (paddr_t)dt_size )
-    {
-        printk("Physical size greater than max width supported\n");
-        WARN();
-    }
-
-    /*
-     * Xen will truncate the address/size if it is greater than the maximum
-     * supported width and it will give an appropriate warning.
-     */
-    *start = dt_start;
-    *size = dt_size;
-}
-
-static int __init device_tree_get_meminfo(const void *fdt, int node,
-                                          const char *prop_name,
-                                          u32 address_cells, u32 size_cells,
-                                          struct membanks *mem,
-                                          enum membank_type type)
-{
-    const struct fdt_property *prop;
-    unsigned int i, banks;
-    const __be32 *cell;
-    u32 reg_cells = address_cells + size_cells;
-    paddr_t start, size;
-
-    if ( !device_tree_node_is_available(fdt, node) )
-        return 0;
-
-    if ( address_cells < 1 || size_cells < 1 )
-    {
-        printk("fdt: property `%s': invalid #address-cells or #size-cells",
-               prop_name);
-        return -EINVAL;
-    }
-
-    prop = fdt_get_property(fdt, node, prop_name, NULL);
-    if ( !prop )
-        return -ENOENT;
-
-    cell = (const __be32 *)prop->data;
-    banks = fdt32_to_cpu(prop->len) / (reg_cells * sizeof (u32));
-
-    for ( i = 0; i < banks && mem->nr_banks < mem->max_banks; i++ )
-    {
-        device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
-        if ( mem == bootinfo_get_reserved_mem() &&
-             check_reserved_regions_overlap(start, size) )
-            return -EINVAL;
-        /* Some DT may describe empty bank, ignore them */
-        if ( !size )
-            continue;
-        mem->bank[mem->nr_banks].start = start;
-        mem->bank[mem->nr_banks].size = size;
-        mem->bank[mem->nr_banks].type = type;
-        mem->nr_banks++;
-    }
-
-    if ( i < banks )
-    {
-        printk("Warning: Max number of supported memory regions reached.\n");
-        return -ENOSPC;
-    }
-
-    return 0;
-}
-
-u32 __init device_tree_get_u32(const void *fdt, int node,
-                               const char *prop_name, u32 dflt)
-{
-    const struct fdt_property *prop;
-
-    prop = fdt_get_property(fdt, node, prop_name, NULL);
-    if ( !prop || prop->len < sizeof(u32) )
-        return dflt;
-
-    return fdt32_to_cpu(*(uint32_t*)prop->data);
-}
-
-/**
- * device_tree_for_each_node - iterate over all device tree sub-nodes
- * @fdt: flat device tree.
- * @node: parent node to start the search from
- * @func: function to call for each sub-node.
- * @data: data to pass to @func.
- *
- * Any nodes nested at DEVICE_TREE_MAX_DEPTH or deeper are ignored.
- *
- * Returns 0 if all nodes were iterated over successfully.  If @func
- * returns a value different from 0, that value is returned immediately.
- */
-int __init device_tree_for_each_node(const void *fdt, int node,
-                                     device_tree_node_func func,
-                                     void *data)
-{
-    /*
-     * We only care about relative depth increments, assume depth of
-     * node is 0 for simplicity.
-     */
-    int depth = 0;
-    const int first_node = node;
-    u32 address_cells[DEVICE_TREE_MAX_DEPTH];
-    u32 size_cells[DEVICE_TREE_MAX_DEPTH];
-    int ret;
-
-    do {
-        const char *name = fdt_get_name(fdt, node, NULL);
-        u32 as, ss;
-
-        if ( depth >= DEVICE_TREE_MAX_DEPTH )
-        {
-            printk("Warning: device tree node `%s' is nested too deep\n",
-                   name);
-            continue;
-        }
-
-        as = depth > 0 ? address_cells[depth-1] : DT_ROOT_NODE_ADDR_CELLS_DEFAULT;
-        ss = depth > 0 ? size_cells[depth-1] : DT_ROOT_NODE_SIZE_CELLS_DEFAULT;
-
-        address_cells[depth] = device_tree_get_u32(fdt, node,
-                                                   "#address-cells", as);
-        size_cells[depth] = device_tree_get_u32(fdt, node,
-                                                "#size-cells", ss);
-
-        /* skip the first node */
-        if ( node != first_node )
-        {
-            ret = func(fdt, node, name, depth, as, ss, data);
-            if ( ret != 0 )
-                return ret;
-        }
-
-        node = fdt_next_node(fdt, node, &depth);
-    } while ( node >= 0 && depth > 0 );
-
-    return 0;
-}
-
-static int __init process_memory_node(const void *fdt, int node,
-                                      const char *name, int depth,
-                                      u32 address_cells, u32 size_cells,
-                                      struct membanks *mem)
-{
-    return device_tree_get_meminfo(fdt, node, "reg", address_cells, size_cells,
-                                   mem, MEMBANK_DEFAULT);
-}
-
-static int __init process_reserved_memory_node(const void *fdt, int node,
-                                               const char *name, int depth,
-                                               u32 address_cells,
-                                               u32 size_cells,
-                                               void *data)
-{
-    int rc = process_memory_node(fdt, node, name, depth, address_cells,
-                                 size_cells, data);
-
-    if ( rc == -ENOSPC )
-        panic("Max number of supported reserved-memory regions reached.\n");
-    else if ( rc != -ENOENT )
-        return rc;
-    return 0;
-}
-
-static int __init process_reserved_memory(const void *fdt, int node,
-                                          const char *name, int depth,
-                                          u32 address_cells, u32 size_cells)
-{
-    return device_tree_for_each_node(fdt, node,
-                                     process_reserved_memory_node,
-                                     bootinfo_get_reserved_mem());
-}
-
-static void __init process_multiboot_node(const void *fdt, int node,
-                                          const char *name,
-                                          u32 address_cells, u32 size_cells)
-{
-    static int __initdata kind_guess = 0;
-    const struct fdt_property *prop;
-    const __be32 *cell;
-    bootmodule_kind kind;
-    paddr_t start, size;
-    int len;
-    /* sizeof("/chosen/") + DT_MAX_NAME + '/' + DT_MAX_NAME + '/0' => 92 */
-    char path[92];
-    int parent_node, ret;
-    bool domU;
-
-    parent_node = fdt_parent_offset(fdt, node);
-    ASSERT(parent_node >= 0);
-
-    /* Check that the node is under "/chosen" (first 7 chars of path) */
-    ret = fdt_get_path(fdt, node, path, sizeof (path));
-    if ( ret != 0 || strncmp(path, "/chosen", 7) )
-        return;
-
-    prop = fdt_get_property(fdt, node, "reg", &len);
-    if ( !prop )
-        panic("node %s missing `reg' property\n", name);
-
-    if ( len < dt_cells_to_size(address_cells + size_cells) )
-        panic("fdt: node `%s': `reg` property length is too short\n",
-                    name);
-
-    cell = (const __be32 *)prop->data;
-    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
-
-    if ( fdt_node_check_compatible(fdt, node, "xen,linux-zimage") == 0 ||
-         fdt_node_check_compatible(fdt, node, "multiboot,kernel") == 0 )
-        kind = BOOTMOD_KERNEL;
-    else if ( fdt_node_check_compatible(fdt, node, "xen,linux-initrd") == 0 ||
-              fdt_node_check_compatible(fdt, node, "multiboot,ramdisk") == 0 )
-        kind = BOOTMOD_RAMDISK;
-    else if ( fdt_node_check_compatible(fdt, node, "xen,xsm-policy") == 0 )
-        kind = BOOTMOD_XSM;
-    else if ( fdt_node_check_compatible(fdt, node, "multiboot,device-tree") == 0 )
-        kind = BOOTMOD_GUEST_DTB;
-    else
-        kind = BOOTMOD_UNKNOWN;
-
-    /**
-     * Guess the kind of these first two unknowns respectively:
-     * (1) The first unknown must be kernel.
-     * (2) Detect the XSM Magic from the 2nd unknown:
-     *     a. If it's XSM, set the kind as XSM, and that also means we
-     *     won't load ramdisk;
-     *     b. if it's not XSM, set the kind as ramdisk.
-     *     So if user want to load ramdisk, it must be the 2nd unknown.
-     * We also detect the XSM Magic for the following unknowns,
-     * then set its kind according to the return value of has_xsm_magic.
-     */
-    if ( kind == BOOTMOD_UNKNOWN )
-    {
-        switch ( kind_guess++ )
-        {
-        case 0: kind = BOOTMOD_KERNEL; break;
-        case 1: kind = BOOTMOD_RAMDISK; break;
-        default: break;
-        }
-        if ( kind_guess > 1 && has_xsm_magic(start) )
-            kind = BOOTMOD_XSM;
-    }
-
-    domU = fdt_node_check_compatible(fdt, parent_node, "xen,domain") == 0;
-    add_boot_module(kind, start, size, domU);
-
-    prop = fdt_get_property(fdt, node, "bootargs", &len);
-    if ( !prop )
-        return;
-    add_boot_cmdline(fdt_get_name(fdt, parent_node, &len), prop->data,
-                     kind, start, domU);
-}
-
-static int __init process_chosen_node(const void *fdt, int node,
-                                      const char *name,
-                                      u32 address_cells, u32 size_cells)
-{
-    const struct fdt_property *prop;
-    paddr_t start, end;
-    int len;
-
-    if ( fdt_get_property(fdt, node, "xen,static-heap", NULL) )
-    {
-        int rc;
-
-        printk("Checking for static heap in /chosen\n");
-
-        rc = device_tree_get_meminfo(fdt, node, "xen,static-heap",
-                                     address_cells, size_cells,
-                                     bootinfo_get_reserved_mem(),
-                                     MEMBANK_STATIC_HEAP);
-        if ( rc )
-            return rc;
-
-        bootinfo.static_heap = true;
-    }
-
-    printk("Checking for initrd in /chosen\n");
-
-    prop = fdt_get_property(fdt, node, "linux,initrd-start", &len);
-    if ( !prop )
-        /* No initrd present. */
-        return 0;
-    if ( len != sizeof(u32) && len != sizeof(u64) )
-    {
-        printk("linux,initrd-start property has invalid length %d\n", len);
-        return -EINVAL;
-    }
-    start = dt_read_paddr((const void *)&prop->data, dt_size_to_cells(len));
-
-    prop = fdt_get_property(fdt, node, "linux,initrd-end", &len);
-    if ( !prop )
-    {
-        printk("linux,initrd-end not present but -start was\n");
-        return -EINVAL;
-    }
-    if ( len != sizeof(u32) && len != sizeof(u64) )
-    {
-        printk("linux,initrd-end property has invalid length %d\n", len);
-        return -EINVAL;
-    }
-    end = dt_read_paddr((const void *)&prop->data, dt_size_to_cells(len));
-
-    if ( start >= end )
-    {
-        printk("linux,initrd limits invalid: %"PRIpaddr" >= %"PRIpaddr"\n",
-                  start, end);
-        return -EINVAL;
-    }
-
-    printk("Initrd %"PRIpaddr"-%"PRIpaddr"\n", start, end);
-
-    add_boot_module(BOOTMOD_RAMDISK, start, end-start, false);
-
-    return 0;
-}
-
-static int __init process_domain_node(const void *fdt, int node,
-                                      const char *name,
-                                      u32 address_cells, u32 size_cells)
-{
-    const struct fdt_property *prop;
-
-    printk("Checking for \"xen,static-mem\" in domain node\n");
-
-    prop = fdt_get_property(fdt, node, "xen,static-mem", NULL);
-    if ( !prop )
-        /* No "xen,static-mem" present. */
-        return 0;
-
-    return device_tree_get_meminfo(fdt, node, "xen,static-mem", address_cells,
-                                   size_cells, bootinfo_get_reserved_mem(),
-                                   MEMBANK_STATIC_DOMAIN);
-}
-
-static int __init early_scan_node(const void *fdt,
-                                  int node, const char *name, int depth,
-                                  u32 address_cells, u32 size_cells,
-                                  void *data)
-{
-    int rc = 0;
-
-    /*
-     * If Xen has been booted via UEFI, the memory banks are
-     * populated. So we should skip the parsing.
-     */
-    if ( !efi_enabled(EFI_BOOT) &&
-         device_tree_node_matches(fdt, node, "memory") )
-        rc = process_memory_node(fdt, node, name, depth,
-                                 address_cells, size_cells, bootinfo_get_mem());
-    else if ( depth == 1 && !dt_node_cmp(name, "reserved-memory") )
-        rc = process_reserved_memory(fdt, node, name, depth,
-                                     address_cells, size_cells);
-    else if ( depth <= 3 && (device_tree_node_compatible(fdt, node, "xen,multiboot-module" ) ||
-              device_tree_node_compatible(fdt, node, "multiboot,module" )))
-        process_multiboot_node(fdt, node, name, address_cells, size_cells);
-    else if ( depth == 1 && device_tree_node_matches(fdt, node, "chosen") )
-        rc = process_chosen_node(fdt, node, name, address_cells, size_cells);
-    else if ( depth == 2 && device_tree_node_compatible(fdt, node, "xen,domain") )
-        rc = process_domain_node(fdt, node, name, address_cells, size_cells);
-    else if ( depth <= 3 && device_tree_node_compatible(fdt, node, "xen,domain-shared-memory-v1") )
-        rc = process_shm_node(fdt, node, address_cells, size_cells);
-
-    if ( rc < 0 )
-        printk("fdt: node `%s': parsing failed\n", name);
-    return rc;
-}
-
-static void __init early_print_info(void)
-{
-    const struct membanks *mi = bootinfo_get_mem();
-    const struct membanks *mem_resv = bootinfo_get_reserved_mem();
-    struct bootmodules *mods = &bootinfo.modules;
-    struct bootcmdlines *cmds = &bootinfo.cmdlines;
-    unsigned int i;
-
-    for ( i = 0; i < mi->nr_banks; i++ )
-        printk("RAM: %"PRIpaddr" - %"PRIpaddr"\n",
-                mi->bank[i].start,
-                mi->bank[i].start + mi->bank[i].size - 1);
-    printk("\n");
-    for ( i = 0 ; i < mods->nr_mods; i++ )
-        printk("MODULE[%d]: %"PRIpaddr" - %"PRIpaddr" %-12s\n",
-                i,
-                mods->module[i].start,
-                mods->module[i].start + mods->module[i].size,
-                boot_module_kind_as_string(mods->module[i].kind));
-
-    for ( i = 0; i < mem_resv->nr_banks; i++ )
-    {
-        printk(" RESVD[%u]: %"PRIpaddr" - %"PRIpaddr"\n", i,
-               mem_resv->bank[i].start,
-               mem_resv->bank[i].start + mem_resv->bank[i].size - 1);
-    }
-    early_print_info_shmem();
-    printk("\n");
-    for ( i = 0 ; i < cmds->nr_mods; i++ )
-        printk("CMDLINE[%"PRIpaddr"]:%s %s\n", cmds->cmdline[i].start,
-               cmds->cmdline[i].dt_name,
-               &cmds->cmdline[i].cmdline[0]);
-    printk("\n");
-}
-
-/* This function assumes that memory regions are not overlapped */
-static int __init cmp_memory_node(const void *key, const void *elem)
-{
-    const struct membank *handler0 = key;
-    const struct membank *handler1 = elem;
-
-    if ( handler0->start < handler1->start )
-        return -1;
-
-    if ( handler0->start >= (handler1->start + handler1->size) )
-        return 1;
-
-    return 0;
-}
-
-static void __init swap_memory_node(void *_a, void *_b, size_t size)
-{
-    struct membank *a = _a, *b = _b;
-
-    SWAP(*a, *b);
-}
-
-/**
- * boot_fdt_info - initialize bootinfo from a DTB
- * @fdt: flattened device tree binary
- *
- * Returns the size of the DTB.
- */
-size_t __init boot_fdt_info(const void *fdt, paddr_t paddr)
-{
-    struct membanks *reserved_mem = bootinfo_get_reserved_mem();
-    struct membanks *mem = bootinfo_get_mem();
-    unsigned int i;
-    int nr_rsvd;
-    int ret;
-
-    ret = fdt_check_header(fdt);
-    if ( ret < 0 )
-        panic("No valid device tree\n");
-
-    add_boot_module(BOOTMOD_FDT, paddr, fdt_totalsize(fdt), false);
-
-    nr_rsvd = fdt_num_mem_rsv(fdt);
-    if ( nr_rsvd < 0 )
-        panic("Parsing FDT memory reserve map failed (%d)\n", nr_rsvd);
-
-    for ( i = 0; i < nr_rsvd; i++ )
-    {
-        struct membank *bank;
-        paddr_t s, sz;
-
-        if ( fdt_get_mem_rsv_paddr(device_tree_flattened, i, &s, &sz) < 0 )
-            continue;
-
-        if ( reserved_mem->nr_banks < reserved_mem->max_banks )
-        {
-            bank = &reserved_mem->bank[reserved_mem->nr_banks];
-            bank->start = s;
-            bank->size = sz;
-            bank->type = MEMBANK_FDT_RESVMEM;
-            reserved_mem->nr_banks++;
-        }
-        else
-            panic("Cannot allocate reserved memory bank\n");
-    }
-
-    ret = device_tree_for_each_node(fdt, 0, early_scan_node, NULL);
-    if ( ret )
-        panic("Early FDT parsing failed (%d)\n", ret);
-
-    /*
-     * On Arm64 setup_directmap_mappings() expects to be called with the lowest
-     * bank in memory first. There is no requirement that the DT will provide
-     * the banks sorted in ascending order. So sort them through.
-     */
-    sort(mem->bank, mem->nr_banks, sizeof(struct membank),
-         cmp_memory_node, swap_memory_node);
-
-    early_print_info();
-
-    return fdt_totalsize(fdt);
-}
-
-const __init char *boot_fdt_cmdline(const void *fdt)
-{
-    int node;
-    const struct fdt_property *prop;
-
-    node = fdt_path_offset(fdt, "/chosen");
-    if ( node < 0 )
-        return NULL;
-
-    prop = fdt_get_property(fdt, node, "xen,xen-bootargs", NULL);
-    if ( prop == NULL )
-    {
-        struct bootcmdline *dom0_cmdline =
-            boot_cmdline_find_by_kind(BOOTMOD_KERNEL);
-
-        if (fdt_get_property(fdt, node, "xen,dom0-bootargs", NULL) ||
-            ( dom0_cmdline && dom0_cmdline->cmdline[0] ) )
-            prop = fdt_get_property(fdt, node, "bootargs", NULL);
-    }
-    if ( prop == NULL )
-        return NULL;
-
-    return prop->data;
-}
-
-/*
- * Local variables:
- * mode: C
- * c-file-style: "BSD"
- * c-basic-offset: 4
- * indent-tabs-mode: nil
- * End:
- */
diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 1748be29e5..64c227d171 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -41,19 +41,6 @@ void fw_unreserved_regions(paddr_t s, paddr_t e,
                            void (*cb)(paddr_t ps, paddr_t pe),
                            unsigned int first);
 
-bool check_reserved_regions_overlap(paddr_t region_start, paddr_t region_size);
-
-struct bootmodule *add_boot_module(bootmodule_kind kind,
-                                   paddr_t start, paddr_t size, bool domU);
-struct bootmodule *boot_module_find_by_kind(bootmodule_kind kind);
-struct bootmodule * boot_module_find_by_addr_and_kind(bootmodule_kind kind,
-                                                             paddr_t start);
-void add_boot_cmdline(const char *name, const char *cmdline,
-                      bootmodule_kind kind, paddr_t start, bool domU);
-struct bootcmdline *boot_cmdline_find_by_kind(bootmodule_kind kind);
-struct bootcmdline * boot_cmdline_find_by_name(const char *name);
-const char *boot_module_kind_as_string(bootmodule_kind kind);
-
 void init_pdx(void);
 void setup_mm(void);
 
diff --git a/xen/arch/arm/include/asm/static-shmem.h b/xen/arch/arm/include/asm/static-shmem.h
index 806ee41cfc..fd0867c4f2 100644
--- a/xen/arch/arm/include/asm/static-shmem.h
+++ b/xen/arch/arm/include/asm/static-shmem.h
@@ -80,15 +80,6 @@ static inline int process_shm_chosen(struct domain *d,
     return 0;
 }
 
-static inline int process_shm_node(const void *fdt, int node,
-                                   uint32_t address_cells, uint32_t size_cells)
-{
-    printk("CONFIG_STATIC_SHM must be enabled for parsing static shared memory nodes\n");
-    return -EINVAL;
-}
-
-static inline void early_print_info_shmem(void) {};
-
 static inline void init_sharedmem_pages(void) {};
 
 static inline int remove_shm_from_rangeset(const struct kernel_info *kinfo,
diff --git a/xen/common/device-tree/Makefile b/xen/common/device-tree/Makefile
index da892dd55d..22a053f184 100644
--- a/xen/common/device-tree/Makefile
+++ b/xen/common/device-tree/Makefile
@@ -1,2 +1,3 @@
+obj-y += bootfdt.init.o
 obj-y += bootinfo.init.o
 obj-y += device_tree.o
diff --git a/xen/common/device-tree/bootfdt.c b/xen/common/device-tree/bootfdt.c
new file mode 100644
index 0000000000..748b5f7c69
--- /dev/null
+++ b/xen/common/device-tree/bootfdt.c
@@ -0,0 +1,635 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Early Device Tree
+ *
+ * Copyright (C) 2012-2014 Citrix Systems, Inc.
+ */
+
+#include <xen/bootfdt.h>
+#include <xen/device_tree.h>
+#include <xen/efi.h>
+#include <xen/init.h>
+#include <xen/kernel.h>
+#include <xen/libfdt/libfdt-xen.h>
+#include <xen/sort.h>
+#include <xsm/xsm.h>
+#include <asm/setup.h>
+#ifdef CONFIG_STATIC_SHM
+#include <asm/static-shmem.h>
+#endif
+
+static void __init __maybe_unused build_assertions(void)
+{
+    /*
+     * Check that no padding is between struct membanks "bank" flexible array
+     * member and struct meminfo "bank" member
+     */
+    BUILD_BUG_ON((offsetof(struct membanks, bank) !=
+                 offsetof(struct meminfo, bank)));
+    /* Ensure "struct membanks" is 8-byte aligned */
+    BUILD_BUG_ON(alignof(struct membanks) != 8);
+}
+
+static bool __init device_tree_node_is_available(const void *fdt, int node)
+{
+    const char *status;
+    int len;
+
+    status = fdt_getprop(fdt, node, "status", &len);
+    if ( !status )
+        return true;
+
+    if ( len > 0 )
+    {
+        if ( !strcmp(status, "ok") || !strcmp(status, "okay") )
+            return true;
+    }
+
+    return false;
+}
+
+static bool __init device_tree_node_matches(const void *fdt, int node,
+                                            const char *match)
+{
+    const char *name;
+    size_t match_len;
+
+    name = fdt_get_name(fdt, node, NULL);
+    match_len = strlen(match);
+
+    /* Match both "match" and "match@..." patterns but not
+       "match-foo". */
+    return strncmp(name, match, match_len) == 0
+        && (name[match_len] == '@' || name[match_len] == '\0');
+}
+
+static bool __init device_tree_node_compatible(const void *fdt, int node,
+                                               const char *match)
+{
+    int len, l;
+    const void *prop;
+
+    prop = fdt_getprop(fdt, node, "compatible", &len);
+    if ( prop == NULL )
+        return false;
+
+    while ( len > 0 ) {
+        if ( !dt_compat_cmp(prop, match) )
+            return true;
+        l = strlen(prop) + 1;
+        prop += l;
+        len -= l;
+    }
+
+    return false;
+}
+
+void __init device_tree_get_reg(const __be32 **cell, uint32_t address_cells,
+                                uint32_t size_cells, paddr_t *start,
+                                paddr_t *size)
+{
+    uint64_t dt_start, dt_size;
+
+    /*
+     * dt_next_cell will return uint64_t whereas paddr_t may not be 64-bit.
+     * Thus, there is an implicit cast from uint64_t to paddr_t.
+     */
+    dt_start = dt_next_cell(address_cells, cell);
+    dt_size = dt_next_cell(size_cells, cell);
+
+    if ( dt_start != (paddr_t)dt_start )
+    {
+        printk("Physical address greater than max width supported\n");
+        WARN();
+    }
+
+    if ( dt_size != (paddr_t)dt_size )
+    {
+        printk("Physical size greater than max width supported\n");
+        WARN();
+    }
+
+    /*
+     * Xen will truncate the address/size if it is greater than the maximum
+     * supported width and it will give an appropriate warning.
+     */
+    *start = dt_start;
+    *size = dt_size;
+}
+
+static int __init device_tree_get_meminfo(const void *fdt, int node,
+                                          const char *prop_name,
+                                          u32 address_cells, u32 size_cells,
+                                          struct membanks *mem,
+                                          enum membank_type type)
+{
+    const struct fdt_property *prop;
+    unsigned int i, banks;
+    const __be32 *cell;
+    u32 reg_cells = address_cells + size_cells;
+    paddr_t start, size;
+
+    if ( !device_tree_node_is_available(fdt, node) )
+        return 0;
+
+    if ( address_cells < 1 || size_cells < 1 )
+    {
+        printk("fdt: property `%s': invalid #address-cells or #size-cells",
+               prop_name);
+        return -EINVAL;
+    }
+
+    prop = fdt_get_property(fdt, node, prop_name, NULL);
+    if ( !prop )
+        return -ENOENT;
+
+    cell = (const __be32 *)prop->data;
+    banks = fdt32_to_cpu(prop->len) / (reg_cells * sizeof (u32));
+
+    for ( i = 0; i < banks && mem->nr_banks < mem->max_banks; i++ )
+    {
+        device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+        if ( mem == bootinfo_get_reserved_mem() &&
+             check_reserved_regions_overlap(start, size) )
+            return -EINVAL;
+        /* Some DT may describe empty bank, ignore them */
+        if ( !size )
+            continue;
+        mem->bank[mem->nr_banks].start = start;
+        mem->bank[mem->nr_banks].size = size;
+        mem->bank[mem->nr_banks].type = type;
+        mem->nr_banks++;
+    }
+
+    if ( i < banks )
+    {
+        printk("Warning: Max number of supported memory regions reached.\n");
+        return -ENOSPC;
+    }
+
+    return 0;
+}
+
+u32 __init device_tree_get_u32(const void *fdt, int node,
+                               const char *prop_name, u32 dflt)
+{
+    const struct fdt_property *prop;
+
+    prop = fdt_get_property(fdt, node, prop_name, NULL);
+    if ( !prop || prop->len < sizeof(u32) )
+        return dflt;
+
+    return fdt32_to_cpu(*(uint32_t*)prop->data);
+}
+
+/**
+ * device_tree_for_each_node - iterate over all device tree sub-nodes
+ * @fdt: flat device tree.
+ * @node: parent node to start the search from
+ * @func: function to call for each sub-node.
+ * @data: data to pass to @func.
+ *
+ * Any nodes nested at DEVICE_TREE_MAX_DEPTH or deeper are ignored.
+ *
+ * Returns 0 if all nodes were iterated over successfully.  If @func
+ * returns a value different from 0, that value is returned immediately.
+ */
+int __init device_tree_for_each_node(const void *fdt, int node,
+                                     device_tree_node_func func,
+                                     void *data)
+{
+    /*
+     * We only care about relative depth increments, assume depth of
+     * node is 0 for simplicity.
+     */
+    int depth = 0;
+    const int first_node = node;
+    u32 address_cells[DEVICE_TREE_MAX_DEPTH];
+    u32 size_cells[DEVICE_TREE_MAX_DEPTH];
+    int ret;
+
+    do {
+        const char *name = fdt_get_name(fdt, node, NULL);
+        u32 as, ss;
+
+        if ( depth >= DEVICE_TREE_MAX_DEPTH )
+        {
+            printk("Warning: device tree node `%s' is nested too deep\n",
+                   name);
+            continue;
+        }
+
+        as = depth > 0 ? address_cells[depth-1] : DT_ROOT_NODE_ADDR_CELLS_DEFAULT;
+        ss = depth > 0 ? size_cells[depth-1] : DT_ROOT_NODE_SIZE_CELLS_DEFAULT;
+
+        address_cells[depth] = device_tree_get_u32(fdt, node,
+                                                   "#address-cells", as);
+        size_cells[depth] = device_tree_get_u32(fdt, node,
+                                                "#size-cells", ss);
+
+        /* skip the first node */
+        if ( node != first_node )
+        {
+            ret = func(fdt, node, name, depth, as, ss, data);
+            if ( ret != 0 )
+                return ret;
+        }
+
+        node = fdt_next_node(fdt, node, &depth);
+    } while ( node >= 0 && depth > 0 );
+
+    return 0;
+}
+
+static int __init process_memory_node(const void *fdt, int node,
+                                      const char *name, int depth,
+                                      u32 address_cells, u32 size_cells,
+                                      struct membanks *mem)
+{
+    return device_tree_get_meminfo(fdt, node, "reg", address_cells, size_cells,
+                                   mem, MEMBANK_DEFAULT);
+}
+
+static int __init process_reserved_memory_node(const void *fdt, int node,
+                                               const char *name, int depth,
+                                               u32 address_cells,
+                                               u32 size_cells,
+                                               void *data)
+{
+    int rc = process_memory_node(fdt, node, name, depth, address_cells,
+                                 size_cells, data);
+
+    if ( rc == -ENOSPC )
+        panic("Max number of supported reserved-memory regions reached.\n");
+    else if ( rc != -ENOENT )
+        return rc;
+    return 0;
+}
+
+static int __init process_reserved_memory(const void *fdt, int node,
+                                          const char *name, int depth,
+                                          u32 address_cells, u32 size_cells)
+{
+    return device_tree_for_each_node(fdt, node,
+                                     process_reserved_memory_node,
+                                     bootinfo_get_reserved_mem());
+}
+
+static void __init process_multiboot_node(const void *fdt, int node,
+                                          const char *name,
+                                          u32 address_cells, u32 size_cells)
+{
+    static int __initdata kind_guess = 0;
+    const struct fdt_property *prop;
+    const __be32 *cell;
+    bootmodule_kind kind;
+    paddr_t start, size;
+    int len;
+    /* sizeof("/chosen/") + DT_MAX_NAME + '/' + DT_MAX_NAME + '/0' => 92 */
+    char path[92];
+    int parent_node, ret;
+    bool domU;
+
+    parent_node = fdt_parent_offset(fdt, node);
+    ASSERT(parent_node >= 0);
+
+    /* Check that the node is under "/chosen" (first 7 chars of path) */
+    ret = fdt_get_path(fdt, node, path, sizeof (path));
+    if ( ret != 0 || strncmp(path, "/chosen", 7) )
+        return;
+
+    prop = fdt_get_property(fdt, node, "reg", &len);
+    if ( !prop )
+        panic("node %s missing `reg' property\n", name);
+
+    if ( len < dt_cells_to_size(address_cells + size_cells) )
+        panic("fdt: node `%s': `reg` property length is too short\n",
+                    name);
+
+    cell = (const __be32 *)prop->data;
+    device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
+
+    if ( fdt_node_check_compatible(fdt, node, "xen,linux-zimage") == 0 ||
+         fdt_node_check_compatible(fdt, node, "multiboot,kernel") == 0 )
+        kind = BOOTMOD_KERNEL;
+    else if ( fdt_node_check_compatible(fdt, node, "xen,linux-initrd") == 0 ||
+              fdt_node_check_compatible(fdt, node, "multiboot,ramdisk") == 0 )
+        kind = BOOTMOD_RAMDISK;
+    else if ( fdt_node_check_compatible(fdt, node, "xen,xsm-policy") == 0 )
+        kind = BOOTMOD_XSM;
+    else if ( fdt_node_check_compatible(fdt, node, "multiboot,device-tree") == 0 )
+        kind = BOOTMOD_GUEST_DTB;
+    else
+        kind = BOOTMOD_UNKNOWN;
+
+    /**
+     * Guess the kind of these first two unknowns respectively:
+     * (1) The first unknown must be kernel.
+     * (2) Detect the XSM Magic from the 2nd unknown:
+     *     a. If it's XSM, set the kind as XSM, and that also means we
+     *     won't load ramdisk;
+     *     b. if it's not XSM, set the kind as ramdisk.
+     *     So if user want to load ramdisk, it must be the 2nd unknown.
+     * We also detect the XSM Magic for the following unknowns,
+     * then set its kind according to the return value of has_xsm_magic.
+     */
+    if ( kind == BOOTMOD_UNKNOWN )
+    {
+        switch ( kind_guess++ )
+        {
+        case 0: kind = BOOTMOD_KERNEL; break;
+        case 1: kind = BOOTMOD_RAMDISK; break;
+        default: break;
+        }
+        if ( kind_guess > 1 && has_xsm_magic(start) )
+            kind = BOOTMOD_XSM;
+    }
+
+    domU = fdt_node_check_compatible(fdt, parent_node, "xen,domain") == 0;
+    add_boot_module(kind, start, size, domU);
+
+    prop = fdt_get_property(fdt, node, "bootargs", &len);
+    if ( !prop )
+        return;
+    add_boot_cmdline(fdt_get_name(fdt, parent_node, &len), prop->data,
+                     kind, start, domU);
+}
+
+static int __init process_chosen_node(const void *fdt, int node,
+                                      const char *name,
+                                      u32 address_cells, u32 size_cells)
+{
+    const struct fdt_property *prop;
+    paddr_t start, end;
+    int len;
+
+    if ( fdt_get_property(fdt, node, "xen,static-heap", NULL) )
+    {
+        int rc;
+
+        printk("Checking for static heap in /chosen\n");
+
+        rc = device_tree_get_meminfo(fdt, node, "xen,static-heap",
+                                     address_cells, size_cells,
+                                     bootinfo_get_reserved_mem(),
+                                     MEMBANK_STATIC_HEAP);
+        if ( rc )
+            return rc;
+
+        bootinfo.static_heap = true;
+    }
+
+    printk("Checking for initrd in /chosen\n");
+
+    prop = fdt_get_property(fdt, node, "linux,initrd-start", &len);
+    if ( !prop )
+        /* No initrd present. */
+        return 0;
+    if ( len != sizeof(u32) && len != sizeof(u64) )
+    {
+        printk("linux,initrd-start property has invalid length %d\n", len);
+        return -EINVAL;
+    }
+    start = dt_read_paddr((const void *)&prop->data, dt_size_to_cells(len));
+
+    prop = fdt_get_property(fdt, node, "linux,initrd-end", &len);
+    if ( !prop )
+    {
+        printk("linux,initrd-end not present but -start was\n");
+        return -EINVAL;
+    }
+    if ( len != sizeof(u32) && len != sizeof(u64) )
+    {
+        printk("linux,initrd-end property has invalid length %d\n", len);
+        return -EINVAL;
+    }
+    end = dt_read_paddr((const void *)&prop->data, dt_size_to_cells(len));
+
+    if ( start >= end )
+    {
+        printk("linux,initrd limits invalid: %"PRIpaddr" >= %"PRIpaddr"\n",
+                  start, end);
+        return -EINVAL;
+    }
+
+    printk("Initrd %"PRIpaddr"-%"PRIpaddr"\n", start, end);
+
+    add_boot_module(BOOTMOD_RAMDISK, start, end-start, false);
+
+    return 0;
+}
+
+static int __init process_domain_node(const void *fdt, int node,
+                                      const char *name,
+                                      u32 address_cells, u32 size_cells)
+{
+    const struct fdt_property *prop;
+
+    printk("Checking for \"xen,static-mem\" in domain node\n");
+
+    prop = fdt_get_property(fdt, node, "xen,static-mem", NULL);
+    if ( !prop )
+        /* No "xen,static-mem" present. */
+        return 0;
+
+    return device_tree_get_meminfo(fdt, node, "xen,static-mem", address_cells,
+                                   size_cells, bootinfo_get_reserved_mem(),
+                                   MEMBANK_STATIC_DOMAIN);
+}
+
+#ifndef CONFIG_STATIC_SHM
+static inline int process_shm_node(const void *fdt, int node,
+                                   uint32_t address_cells, uint32_t size_cells)
+{
+    printk("CONFIG_STATIC_SHM must be enabled for parsing static shared"
+            " memory nodes\n");
+    return -EINVAL;
+}
+#endif
+
+static int __init early_scan_node(const void *fdt,
+                                  int node, const char *name, int depth,
+                                  u32 address_cells, u32 size_cells,
+                                  void *data)
+{
+    int rc = 0;
+
+    /*
+     * If Xen has been booted via UEFI, the memory banks are
+     * populated. So we should skip the parsing.
+     */
+    if ( !efi_enabled(EFI_BOOT) &&
+         device_tree_node_matches(fdt, node, "memory") )
+        rc = process_memory_node(fdt, node, name, depth,
+                                 address_cells, size_cells, bootinfo_get_mem());
+    else if ( depth == 1 && !dt_node_cmp(name, "reserved-memory") )
+        rc = process_reserved_memory(fdt, node, name, depth,
+                                     address_cells, size_cells);
+    else if ( depth <= 3 && (device_tree_node_compatible(fdt, node, "xen,multiboot-module" ) ||
+              device_tree_node_compatible(fdt, node, "multiboot,module" )))
+        process_multiboot_node(fdt, node, name, address_cells, size_cells);
+    else if ( depth == 1 && device_tree_node_matches(fdt, node, "chosen") )
+        rc = process_chosen_node(fdt, node, name, address_cells, size_cells);
+    else if ( depth == 2 && device_tree_node_compatible(fdt, node, "xen,domain") )
+        rc = process_domain_node(fdt, node, name, address_cells, size_cells);
+    else if ( depth <= 3 && device_tree_node_compatible(fdt, node, "xen,domain-shared-memory-v1") )
+        rc = process_shm_node(fdt, node, address_cells, size_cells);
+
+    if ( rc < 0 )
+        printk("fdt: node `%s': parsing failed\n", name);
+    return rc;
+}
+
+static void __init early_print_info(void)
+{
+    const struct membanks *mi = bootinfo_get_mem();
+    const struct membanks *mem_resv = bootinfo_get_reserved_mem();
+    struct bootmodules *mods = &bootinfo.modules;
+    struct bootcmdlines *cmds = &bootinfo.cmdlines;
+    unsigned int i;
+
+    for ( i = 0; i < mi->nr_banks; i++ )
+        printk("RAM: %"PRIpaddr" - %"PRIpaddr"\n",
+                mi->bank[i].start,
+                mi->bank[i].start + mi->bank[i].size - 1);
+    printk("\n");
+    for ( i = 0 ; i < mods->nr_mods; i++ )
+        printk("MODULE[%d]: %"PRIpaddr" - %"PRIpaddr" %-12s\n",
+                i,
+                mods->module[i].start,
+                mods->module[i].start + mods->module[i].size,
+                boot_module_kind_as_string(mods->module[i].kind));
+
+    for ( i = 0; i < mem_resv->nr_banks; i++ )
+    {
+        printk(" RESVD[%u]: %"PRIpaddr" - %"PRIpaddr"\n", i,
+               mem_resv->bank[i].start,
+               mem_resv->bank[i].start + mem_resv->bank[i].size - 1);
+    }
+#ifdef CONFIG_STATIC_SHM
+    early_print_info_shmem();
+#endif
+    printk("\n");
+    for ( i = 0 ; i < cmds->nr_mods; i++ )
+        printk("CMDLINE[%"PRIpaddr"]:%s %s\n", cmds->cmdline[i].start,
+               cmds->cmdline[i].dt_name,
+               &cmds->cmdline[i].cmdline[0]);
+    printk("\n");
+}
+
+/* This function assumes that memory regions are not overlapped */
+static int __init cmp_memory_node(const void *key, const void *elem)
+{
+    const struct membank *handler0 = key;
+    const struct membank *handler1 = elem;
+
+    if ( handler0->start < handler1->start )
+        return -1;
+
+    if ( handler0->start >= (handler1->start + handler1->size) )
+        return 1;
+
+    return 0;
+}
+
+static void __init swap_memory_node(void *_a, void *_b, size_t size)
+{
+    struct membank *a = _a, *b = _b;
+
+    SWAP(*a, *b);
+}
+
+/**
+ * boot_fdt_info - initialize bootinfo from a DTB
+ * @fdt: flattened device tree binary
+ *
+ * Returns the size of the DTB.
+ */
+size_t __init boot_fdt_info(const void *fdt, paddr_t paddr)
+{
+    struct membanks *reserved_mem = bootinfo_get_reserved_mem();
+    struct membanks *mem = bootinfo_get_mem();
+    unsigned int i;
+    int nr_rsvd;
+    int ret;
+
+    ret = fdt_check_header(fdt);
+    if ( ret < 0 )
+        panic("No valid device tree\n");
+
+    add_boot_module(BOOTMOD_FDT, paddr, fdt_totalsize(fdt), false);
+
+    nr_rsvd = fdt_num_mem_rsv(fdt);
+    if ( nr_rsvd < 0 )
+        panic("Parsing FDT memory reserve map failed (%d)\n", nr_rsvd);
+
+    for ( i = 0; i < nr_rsvd; i++ )
+    {
+        struct membank *bank;
+        paddr_t s, sz;
+
+        if ( fdt_get_mem_rsv_paddr(device_tree_flattened, i, &s, &sz) < 0 )
+            continue;
+
+        if ( reserved_mem->nr_banks < reserved_mem->max_banks )
+        {
+            bank = &reserved_mem->bank[reserved_mem->nr_banks];
+            bank->start = s;
+            bank->size = sz;
+            bank->type = MEMBANK_FDT_RESVMEM;
+            reserved_mem->nr_banks++;
+        }
+        else
+            panic("Cannot allocate reserved memory bank\n");
+    }
+
+    ret = device_tree_for_each_node(fdt, 0, early_scan_node, NULL);
+    if ( ret )
+        panic("Early FDT parsing failed (%d)\n", ret);
+
+    /*
+     * On Arm64 setup_directmap_mappings() expects to be called with the lowest
+     * bank in memory first. There is no requirement that the DT will provide
+     * the banks sorted in ascending order. So sort them through.
+     */
+    sort(mem->bank, mem->nr_banks, sizeof(struct membank),
+         cmp_memory_node, swap_memory_node);
+
+    early_print_info();
+
+    return fdt_totalsize(fdt);
+}
+
+const __init char *boot_fdt_cmdline(const void *fdt)
+{
+    int node;
+    const struct fdt_property *prop;
+
+    node = fdt_path_offset(fdt, "/chosen");
+    if ( node < 0 )
+        return NULL;
+
+    prop = fdt_get_property(fdt, node, "xen,xen-bootargs", NULL);
+    if ( prop == NULL )
+    {
+        struct bootcmdline *dom0_cmdline =
+            boot_cmdline_find_by_kind(BOOTMOD_KERNEL);
+
+        if (fdt_get_property(fdt, node, "xen,dom0-bootargs", NULL) ||
+            ( dom0_cmdline && dom0_cmdline->cmdline[0] ) )
+            prop = fdt_get_property(fdt, node, "bootargs", NULL);
+    }
+    if ( prop == NULL )
+        return NULL;
+
+    return prop->data;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/xen/bootfdt.h b/xen/include/xen/bootfdt.h
index c39428d5f5..16fa05f38f 100644
--- a/xen/include/xen/bootfdt.h
+++ b/xen/include/xen/bootfdt.h
@@ -157,6 +157,20 @@ struct bootinfo {
 
 extern struct bootinfo bootinfo;
 
+bool check_reserved_regions_overlap(paddr_t region_start,
+                                    paddr_t region_size);
+
+struct bootmodule *add_boot_module(bootmodule_kind kind,
+                                   paddr_t start, paddr_t size, bool domU);
+struct bootmodule *boot_module_find_by_kind(bootmodule_kind kind);
+struct bootmodule * boot_module_find_by_addr_and_kind(bootmodule_kind kind,
+                                                             paddr_t start);
+void add_boot_cmdline(const char *name, const char *cmdline,
+                      bootmodule_kind kind, paddr_t start, bool domU);
+struct bootcmdline *boot_cmdline_find_by_kind(bootmodule_kind kind);
+struct bootcmdline * boot_cmdline_find_by_name(const char *name);
+const char *boot_module_kind_as_string(bootmodule_kind kind);
+
 void populate_boot_allocator(void);
 
 size_t boot_fdt_info(const void *fdt, paddr_t paddr);
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 11:58:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 11:58:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772100.1182531 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sawMG-0008Vj-FP; Mon, 05 Aug 2024 11:58:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772100.1182531; Mon, 05 Aug 2024 11:58:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sawMG-0008Vc-Cg; Mon, 05 Aug 2024 11:58:36 +0000
Received: by outflank-mailman (input) for mailman id 772100;
 Mon, 05 Aug 2024 11:58:34 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=I4ub=PE=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sawME-0008VW-Cz
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 11:58:34 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0952be56-5322-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 13:58:32 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a7a9185e1c0so958918266b.1
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 04:58:32 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9c0c557sm443978566b.53.2024.08.05.04.58.30
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 05 Aug 2024 04:58:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0952be56-5322-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722859112; x=1723463912; 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=E1KOzPMdnY/bhNr3czsLkBgmv07wzxPYhtsRSLD3708=;
        b=e3NjvPjYNehrjTRdP/bsN4bTMM+/ziO+eR+vC4sLGDrM2mmKxuUzo/C8z4RqtuvZWl
         jJNvdyvfuAmNpHRxQ1zY8DOCwgMhwvHabLwgaF8PONek9/DQEzLca3fBKcTHRzxKj3q0
         36SO85EHrGU5GYOLSbEZIe5egvcS5OwimTv0cy0MeKLyOPlFtT+hAlBt4Ju7HZnglBUH
         /U3uzyGMbpjuqlXZ3oVhmiX3xYYkLQhiednpqzd2+YEvkKsK9W/CJJVm5x4w4aSMm+8o
         30LwBnb1PU1yx5KN7Uj9YC4l8mCUCKcAXv1sbNLB78M2ioCIJ5TYcGPsUwvhy4fEHvls
         HwKg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722859112; x=1723463912;
        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=E1KOzPMdnY/bhNr3czsLkBgmv07wzxPYhtsRSLD3708=;
        b=Yi7yhDitv4shClolCoo3fb1sbl0dShlKkqRgnpqSiCjUDmsTVOaybpii6+1ri+OMPv
         D7hjR+mv8A+Q13T4/c8eZJJjhVxz98ApGLzOGl1dvzo8oipdHkzvDX4t45lWpJi6IR+d
         H0sctMTW1dBKEO+7HgtLyw7J7/TSaIbR7k8ZjPebPFd5ho1vqTQPbI0xABvVVijM2S7o
         E1Nn+lgotLb+vamCVFllRg1ZvJLsZd9fLkiFGBQzZsG2JHs5PKrO0dB4gu5M3NX5G4Xa
         akYV3fKRPX/VJ266jzbw+F8yS0+b0dr01ZVyZQKStRJM/Oax+bDGzNxx2cVSr09sEiyX
         6Eow==
X-Forwarded-Encrypted: i=1; AJvYcCWjAcVVotogZsVHPWK1OcpY96fW8+HpvS35rAi8DetYITe3q24N8E0SueLlGU7IHlAoOGfiUJzwd0t33W9k+/ARNQ4/dyrgg6g14nM27qo=
X-Gm-Message-State: AOJu0YzsaeeTtbEwWwW9XY1Sw5R8IIxC+Yz4xUHclpiYejGYfyRhadtt
	Pp+GQs/jdOVhPE4Z3ZthpAw+SVX3uVuGR3yuiDpFChxKedQgvbBUJcDeryCvvQ==
X-Google-Smtp-Source: AGHT+IGmDjaMCxV4T8cDlXffTzqKUS/nd2GDjVCRyV6JBDijempu5D7EQTuUquGx4i/Ow5fZOuzXeA==
X-Received: by 2002:a17:907:8692:b0:a7a:a33e:47b7 with SMTP id a640c23a62f3a-a7dc512ca02mr731263466b.69.1722859111579;
        Mon, 05 Aug 2024 04:58:31 -0700 (PDT)
Message-ID: <0fdfb454-62a4-4d68-9eaa-a5ce7b82f0a2@suse.com>
Date: Mon, 5 Aug 2024 13:58:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v8 1/2] xen/device-tree: Move Arm's setup.c bootinfo
 functions to common
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Shawn Anastasio <sanastasio@raptorengineering.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 Julien Grall <jgrall@amazon.com>, xen-devel@lists.xenproject.org
References: <cover.1722856894.git.oleksii.kurochko@gmail.com>
 <712aebb98a689b248f29e783eb8e72a5e7568e5b.1722856894.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <712aebb98a689b248f29e783eb8e72a5e7568e5b.1722856894.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 05.08.2024 13:33, Oleksii Kurochko wrote:
> From: Shawn Anastasio <sanastasio@raptorengineering.com>
> 
> Arm's setup.c contains a collection of functions for parsing memory map
> and other boot information from a device tree. Since these routines are
> generally useful on any architecture that supports device tree booting,
> move them into xen/common/device-tree.
> 
> Also, common/device_tree.c has been moved to the device-tree folder with
> the corresponding updates to common/Makefile and common/device-tree/Makefile.
> 
> Mentioning of arm32 is changed to CONFIG_SEPARATE_XENHEAP in comparison with
> original ARM's code as now it is moved in common code.
> 
> Suggested-by: Julien Grall <julien@xen.org>
> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> Acked-by: Julien Grall <jgrall@amazon.com>
> ---
> Changes in V8:
>  - add the version of Xen from which bootinfo.c was derived from.
>  - update the commit message.
>  - add Acked-by: Julien Grall <jgrall@amazon.com>.
> ---
> Changes in V7:
>  - move obj-$(CONFIG_HAS_DEVICE_TREE) += device-tree/ to proper place in common/Makefile.
>  - rename macros __XEN_BOOTFDT_H__ to XEN_BOOTFDT_H to not violate MISRA rule 21.1.
>  - drop definition of "#define MAX_FDT_SIZE SZ_2M" in xen/bootfdt.h as it is expected to
>    be arch-specific. Back "#define MAX_FDT_SIZE SZ_2M" to arm/setup.h where it was before
>    these changes.
>  - git mv xen/common/device_tree.c xen/common/device-tree/ and update correspondingly
>    Makefiles of common/ and common/device-tree
>  - update the commit message
> ---
> Changes in V6:
>  - update the version of the patch to v6.   
> ---
> Changes in V5:
>  - After rebase the Shawn's patch v4 on top of current staging the following
>    was done:
>    - add xen/include/xen/bootfdt.h to MAINTAINERS file.
>    - drop message "Early device tree parsing and".
>    - After rebase on top of the current staging the following changes were done:
>      - init bootinfo variable in <common/device-tree/bootinfo.c> with BOOTINFO_INIT;
>      - update the code of dt_unreserved_regions():
>          CONFIG_STATIC_SHM related changes and getting of reserved_mem
>          bootinfo_get_shmem()
>      - update the code of meminfo_overlap_check():
>          add check ( INVALID_PADDR == bank_start ) to if case.
>      - update the code of check_reserved_regions_overlap():
>          CONFIG_STATIC_SHM related changes.
>      - struct bootinfo was updated ( CONFIG_STATIC_SHM changes )
>      - add shared_meminfo ( because of CONFIG_STATIC_SHM )
>      - struct struct membanks was update with __struct group so <xen/kernel> is
>        neeeded to be included in bootfdt.h
>      - move BOOTINFO_ACPI_INIT, BOOTINFO_SHMEM_INIT, BOOTINFO_INIT to generic bootfdt.h
>      - bootinfo_get_reserved_mem(), bootinfo_get_mem(), bootinfo_get_acpi(),
>        bootinfo_get_shmem() and bootinfo_get_shmem_extra() were moved to xen/bootfdt.h
>    - s/arm32/CONFIG_SEPARATE_XENHEAP/
>    - add inclusion of <xen/macros.h> because there are function in <xen/bootfdt.h> which
>      are using container_of().
>  ---
> Changes in v4:
>   - create new xen/include/bootinfo.h rather than relying on arch's
>     asm/setup.h to provide required definitions for bootinfo.c
>   - build bootinfo.c as .init.o
>   - clean up and sort bootinfo.c's #includes
>   - use CONFIG_SEPARATE_XENHEAP rather than CONFIG_ARM_32 to guard
>     xenheap-specific behavior of populate_boot_allocator
>   - (MAINTAINERS) include all of common/device-tree rather than just
>     bootinfo.c
> ---
>  MAINTAINERS                          |    2 +
>  xen/arch/arm/include/asm/setup.h     |  185 +--
>  xen/arch/arm/setup.c                 |  432 -----
>  xen/common/Makefile                  |    2 +-
>  xen/common/device-tree/Makefile      |    2 +
>  xen/common/device-tree/bootinfo.c    |  459 ++++++
>  xen/common/device-tree/device_tree.c | 2253 ++++++++++++++++++++++++++
>  xen/common/device_tree.c             | 2253 --------------------------
>  xen/include/xen/bootfdt.h            |  195 +++
>  9 files changed, 2913 insertions(+), 2870 deletions(-)
>  create mode 100644 xen/common/device-tree/Makefile
>  create mode 100644 xen/common/device-tree/bootinfo.c
>  create mode 100644 xen/common/device-tree/device_tree.c

Can the moved file please be in sync with its directory, naming (i.e. dash
vs underscore) wise? I also expect the diff would be quite a bit smaller
with git's rename detection properly enabled.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 12:45:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 12:45:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772118.1182556 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sax5V-00089e-Cd; Mon, 05 Aug 2024 12:45:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772118.1182556; Mon, 05 Aug 2024 12:45:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sax5V-00089X-9c; Mon, 05 Aug 2024 12:45:21 +0000
Received: by outflank-mailman (input) for mailman id 772118;
 Mon, 05 Aug 2024 12:45:20 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3WU3=PE=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sax5U-00089R-A4
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 12:45:20 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on2061b.outbound.protection.outlook.com
 [2a01:111:f403:2414::61b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8f6d927c-5328-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 14:45:15 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by DS0PR12MB7851.namprd12.prod.outlook.com (2603:10b6:8:14a::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.30; Mon, 5 Aug
 2024 12:45:10 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7828.024; Mon, 5 Aug 2024
 12:45:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8f6d927c-5328-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=KgkTyHWGu6jdU+OM7WDLF280TfVFdQo4ccJWGtaCje3ygQ4SCSs7D1bpGluMwnlThWUlRpjSdAVYnAZEa0dK0mRGTpkY6tnaGRGdy2zCJbDcyBz64KxuHgNZQJgP2Ll6l8m5tg+AhNvbvWcMU3u/t053BKX/UsC3Skl//TxPL3C+5+OMIHbmX7B0pyHO/q6p86RftXN7d47RVEj8AT1VCT570qVJqK9ideiuLEXKXIFZQ+D+MKVMvBWAKBK6V6aCzPdasA223GDYTbCWg1DFe1ZbVkQGCpS+PWFHHa/zeP700UrwyDucRvxCx4rVff1mmXlcNvdPP9fM4ZT6u9A53w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=GuYDlS++PiAA9vBQY2VEjNxlGypGJ0ia/jBjJGwwp/Q=;
 b=RV/jGDqYBd8YlRz64j6+rdezHqKUPNh0PZdwDycT3NpwmGNxDlQbwDG2rirXupF751IDJ3fVO/KTxUOGR1/4xUVKgg6k6PsSJH/RL8yseR0yobqvpOhfk9/DcuC41NmZJgXc5fpJDyvSVCBqrWz5ptbnJW8fXpIFUFlMhhgXe9Z2KTv0rDeTjO4ChB5D1iN+UAIdtAnhw8808RnT/e+3oEcX0RzbAa/vQB1hvoCftuggqi847vf2ckt8t5GQAmYrMiJRLohmQC6MakBwQy8EFwEAycs60XCE2kU4uMTYWxAKwLFgeR/RtUjLl5uYIfDTamdWRTPW9IlcFbDxIWr11Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=GuYDlS++PiAA9vBQY2VEjNxlGypGJ0ia/jBjJGwwp/Q=;
 b=gfOV79GHPZuFZucQXv49ycmdmvLpXQIGsKiS36s+62plWJB/W7t97/RkZVg6XCyjXbqhri3gaXa2D928WHeT24j7MO8i/Pxk+LoS3gnXwpD3sVemK/Hm08Uix6jNtS15IZi9jyNSHP3rdflPR+1mhmGT1k8mtWPu65LbPYC2sNI=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <bb77afd1-3fed-47ab-b83b-ec3e06d0c5a1@amd.com>
Date: Mon, 5 Aug 2024 13:45:04 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/3] docs: Introduce Fusa Requirement and define
 maintainers
Content-Language: en-GB
To: Michal Orzel <michal.orzel@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, artem_mygaiev@epam.com, julien@xen.org
Cc: xen-devel@lists.xenproject.org
References: <20240802094614.1114227-1-ayan.kumar.halder@amd.com>
 <20240802094614.1114227-2-ayan.kumar.halder@amd.com>
 <15c5709f-a81c-4ca4-8851-89938a5a6141@amd.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <15c5709f-a81c-4ca4-8851-89938a5a6141@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0079.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:190::12) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|DS0PR12MB7851:EE_
X-MS-Office365-Filtering-Correlation-Id: 1a0d452d-ac70-475e-0ac3-08dcb54c711b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?eVFyRERQR200RTJxcUQ5NjIxT09GM1RsZXhycWJWNTlXSVNiNko5VlFNeHV3?=
 =?utf-8?B?ZGRIcm9GUC9DdjdadC83eEVzOStiT2R1eFdhc3lwUUNJUG94NzRSY3dhdVlH?=
 =?utf-8?B?TVk1VytRNnUwbUtLZndaTE9mOVVUeFAyYkc5SG95WlhtUVFaSVMwT3diblZZ?=
 =?utf-8?B?Z3RlR0dxczRrVWh5MHRBek1LVW9jVDVJZURlTlJ5RmtsMHA2K08wREV5UUl0?=
 =?utf-8?B?Z3N4SWNpT0JtOG5LRlc2WWxwaGdxRzFZanA1dXdDVjc1anc2SlE3VmkxQmkx?=
 =?utf-8?B?Q2tmRklUNFhRbTJmSXZ0LzdrOUE5VHJXcXdFa1Q5OVlMSXlqWTZTU1JYNzBp?=
 =?utf-8?B?alZMTzRIMFRpZ092blFtSGRvS3l1OVljeWxtVUpvazdObTlKcTRUQksyYU1Q?=
 =?utf-8?B?Z3BTTUE1QWIzNnJmN3ZPTUIrNzROTEJhYkgrREJNdjF2NXhvUWhEdkhybi9T?=
 =?utf-8?B?YklETTRrd2E4TVhMdndhUXB3SDVPSjBtb2pxbXYwOUlwTW9LQkZLZkpRU3FK?=
 =?utf-8?B?YVh3OVlIeVNUaWtnVGxSY3I5dU5YcjVONW5sd0d3c09JNXBObkYrN1E1cEZj?=
 =?utf-8?B?anQxcHlFdkRqS3NrLzA3SlpJUWJydHdxazRsME8rclg3Z0hPc3c2NHV0OWI1?=
 =?utf-8?B?ZUYyL1I2c2xNeWlib1VycDJKZU1SdDFTOGhBN1E3ck9PV0lNUXFMM0JTaVRi?=
 =?utf-8?B?QmY0NFpjNDhXcFBDZFBhMFpLSjVCVUk5djBwL25uQmVqWWZmQXRBNTE2Z0FY?=
 =?utf-8?B?bE5qc0pYd1k5OElHdGp5OC9naU5QVWVkS2xaN0cvMWV2UVVDckdEckFRS2dq?=
 =?utf-8?B?YXcwQkM4MFEyMTkvSmtHZnpOamN3dWpSQm12d0Z1Q0JYYXp5am84MHpmRGov?=
 =?utf-8?B?ODc0ZkVGYTNuNkREOERvSTBhRXVsVW9WSm5ZQ3ppd3lYM1E1YzhZTTBrUFow?=
 =?utf-8?B?d0JEZUQvNUFLKy9haXVacklLbWdNTis4Wk9nbjRVUGtXNGcxQjN2dWp3Uk5J?=
 =?utf-8?B?TmszdUxEaEVGZUpRN2cvMHNTbXV5ZDNOdFRua2laN0hnMHl0V2IzTm53eEJP?=
 =?utf-8?B?L3BjeTNaSjQ2ZGNDRk5FMGtxNUNNYUJ4M21PaW1xSzE0UHFhK3B2SE05MW1Y?=
 =?utf-8?B?RytFOU1ZSnoyelhNKzI4Z2dQekRLQ0VCYU9yM2U3QXVQeUNROCtPaldxcEdY?=
 =?utf-8?B?Y0xkS0xwVTlKSHIvUTVJUTFMaytIUEgzSGJJeENzNk1Ob0dpeW5OMnUySVdD?=
 =?utf-8?B?cmJCSno4NUp5YzB4b25KejRxbHZSRHprZW9vTnZxSWdUcXBKdEgwNStHTEkw?=
 =?utf-8?B?K3VMY2E0Y0JNM3dhcW9ZSDRENDB2V3M1Qk9SS0s0aTJ6eWl6Q0FxUmJDNXNN?=
 =?utf-8?B?Q1lYOEJvd1BJWk82VG5GRHVQNTNmK2g2L3R4T28wL1p3TGdaY2lLVTRuOW9x?=
 =?utf-8?B?ZkVLdSsrSTBvMGFXdzlkL2wrLzA4Z1NKNHptWW50YjU0WXJic25iNmlrbEUw?=
 =?utf-8?B?bXJXQ2pxbnVwNjkwR0ZVaG83R0R5UkpCa3pCaklQblJpRzdzb2ZVTC8rbXVu?=
 =?utf-8?B?M0ZHSlRFR0JDUlFadksrMVVQMTExbFlQelZkb0wwTkpsRlRuNXhHSDc1eEM1?=
 =?utf-8?B?ckplZnllRFBwNlVWaGZ3TSt3MmNPNEx0NXhCZ2dCUU13MS93Zy9WL1c5Sk9o?=
 =?utf-8?B?SDdqNVBUeTdIWFR5YWhRMTRmcUJWQm00eDNVTUFRZW9ZbzdPelNNTUk5c2JV?=
 =?utf-8?B?MThPQXJFalE2d0xabG9IRzRBbExXZCtSUmpZUk5mMFYxZG1WWG41VjhDeGI3?=
 =?utf-8?B?a3RRUS9ndjFxZGt1K2lxZz09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MTdzR1VaMFZlTGxLay9LVDBRakY3aUlZSDlyZjlPeFd2bTd5U2lGYkhNV0Vt?=
 =?utf-8?B?VU01UTUzWDQ1TFpsM0F3MXBFdFJ1TjVtSUxQS2RlM3FFN2FUakk4R3k2dkcx?=
 =?utf-8?B?bnQrZElZTTVsbGFOSWpEUFo4RjhsZ2JiVWdHYlRiMkUydjJjM0FZMzBydEhE?=
 =?utf-8?B?clNRcmRaNlA2d2hOU2hmaksyM01od3hCM1Q1Q3dXK1dUTzNTdi9SOXJOL1BZ?=
 =?utf-8?B?ZjJmT0tmNFBiSXNHUmRLNUVWWllKemtCWHFublpVSDltMlYxSCszZ1ZQUHUr?=
 =?utf-8?B?cFpmNVZUMFBpYkpqdC9EU0tLNnE5cEJCS0VvdEFnSkdwZTc2MXRkQ09xdEk0?=
 =?utf-8?B?TXA4ancrbHhaM3BwZnZaZTV0eWhWd2ZHWTBqSFQvV3RxSjBRRnVzcG5JYmw4?=
 =?utf-8?B?NFdvRWxFVHcrY3ROdC9OU08vM0ROYkpUMTlpYVF5OUVNQ3Yxc0Fvd3YzL3py?=
 =?utf-8?B?QjN3WC9SWE1BcEFZWGl4T3BFM1lDQmRWQm84Q2piTnl4V1VnaVdjK3BmemFF?=
 =?utf-8?B?eTNvQVZyNWJIMW45RUk0ZkdGZVZrWGlrWXRIK29DZ0dXQUlaMHB2aVFHMnp6?=
 =?utf-8?B?ZjQ2ZjEzN2RzR2JSdlFyUlNNbHpXSGdlVlVieXc5YkNIQ0dpRXlWTVI3ZDF3?=
 =?utf-8?B?bVdINXdlSS9lbjM3VGI3Snl0MG1oVzdNdnoycW53OEgwSFdFMkRrQy9KVVpX?=
 =?utf-8?B?U1kwOUNjNjUxZDU5QVA1dkVVMXRDa2ExaWhqRXJWVGdBY0pic2NDT1YvNUtN?=
 =?utf-8?B?blE5dWpsK0JOUzVBamIxOHhDV1R0WGVJVllZNThrTTJUbnNLZkEreHhZMkFL?=
 =?utf-8?B?YWVLdTdReGMwNHJtOUZGRk8wVDZnRU1iWGJ1UW5BcWs5UkE5aW5NdjFLdG9R?=
 =?utf-8?B?eHh6ZGhPU3ljWjlmQmp6NHFvTThGMHVROXlUbGpJQVVwU01BRncyZ2VKNEdH?=
 =?utf-8?B?TXlFT2QydU9ZazhIRnZVMHhMWnRVRWVGTW5VNElnZzNPME9uc0VVTGwxZlJt?=
 =?utf-8?B?TCtPY2l4ZWc3NDRCYmRSbkFnK0ZoakNMWm9jY05CUXFaM1ZoSjJ5MTUxdjAx?=
 =?utf-8?B?QjdmaXBmNVlpZis1VE0zU2xHNFV5YitGaHorTEpHOU5PSVFnNEZUNjVQRTZC?=
 =?utf-8?B?eUlqV2QxU3U2UkhzQjJ6Y3VHMnNQZlE0eEI0WHhrRGd3clo5SDY0OFdmSkQy?=
 =?utf-8?B?TWxjT3VWckF4Sk1ZZzhpMWJzeVpraGZadlg2R1NCU0liMGlhZ1RVdDcwV1NG?=
 =?utf-8?B?U052eWhSMy95VTJOZzBYRXI2dlA1YnRwVjBwZHFZTVBJYUM3QkROMTlVaCt3?=
 =?utf-8?B?YUVyc2tlYUtwNFB5SzYreDFxOTdDbGVqbFZoM0RPRTdORk9QamM1NmZuWVNE?=
 =?utf-8?B?cUNVTGVUdTBicTh2anZqNGhKSXJuRlZqbjBnSnpkY2ZqU21pbDVqNVY2MFZs?=
 =?utf-8?B?UVV5RkFIZ1pVUlA2YlBDWmxvd2RjbStRTG9STWhlRFp2OGxXU1hQV0lUKzFP?=
 =?utf-8?B?M1RmUFlDWTZQd2hwUDNWQnRnVnNGdWdUbW9xM0cySU42Smp5c3pZN3M5Zzlt?=
 =?utf-8?B?eFl1KzlZT0RpTFF4SHhxQTRic0ZRWngwRXhxWkNlVEczVVM1V3R3RFdXL3kw?=
 =?utf-8?B?QkRzR2tlQlJsOEVVS3BuQmNIMjRJU0FXQVJpK0pXQWlWVFMydmZyS01TL1hV?=
 =?utf-8?B?OUMxeFZscVRZUlYrUS9hQzhTSGxSU2tHUHpPTzA3cFZZbXdYdmFZc0I3WXh6?=
 =?utf-8?B?d0JjYkxaR2UzNW9jSnJLY0M2V2NHTEIyWkVPTXhoNmRpL3kyVUlqUmgrUFc0?=
 =?utf-8?B?dmQ2WDhXVWswU3NnZHVzak9kcnZMSnIrTm5xUmdJZW93Z3Zsbjg1Y1BncFhx?=
 =?utf-8?B?VXFRTXNoRWV0L0FoR3YvQ2oxWFViamlsVENVWjhnZXhXV0JlM0xtajl6RG9K?=
 =?utf-8?B?RzBTU0dFdEVScEpnSHhpVHlxQjI3Z3BSanlhbk5yODdKYjkyWk91VFdpZlhN?=
 =?utf-8?B?YnRzM1lPWDVZdlU0dXNCY1pvUnc5cldOb0pFT1htUVBvc2R2U3Zqc3d3Mm5R?=
 =?utf-8?B?ZGxvU1F5ZzYwNXBvVkRCZmgwRDYwVkFFclpzNlFtV1Jla0RKdjZVNmZjeUxL?=
 =?utf-8?Q?w6t0JMiYY1x794D2ROhDxYcdo?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1a0d452d-ac70-475e-0ac3-08dcb54c711b
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 12:45:10.0627
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Gciqf6AAIYrxWrsAUjDuJ0fTnEOLsFEMwkSHSlKqrFV/3BRoP0log2PNZtVvxrqu1Y7HHMfvivnaAZl6gw4Mbg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7851


On 05/08/2024 10:46, Michal Orzel wrote:
> Hi Ayan,
Hi Michal,
>
> On 02/08/2024 11:46, Ayan Kumar Halder wrote:
>> The FUSA folder is expected to contain requirements and other documents
>> to enable safety certification of Xen hypervisor.
>> Added a README to explain how the requirements are categorized, written
>> and their supported status.
>>
>> Added maintainers for the same.
>>
>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>> Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
>> ---
>> Changes from :-
>>
>> v1 - 1. Added a comment from Stefano.
>> 2. Added Ack.
>>
>>   MAINTAINERS              |  9 +++++
>>   docs/fusa/reqs/README.md | 78 ++++++++++++++++++++++++++++++++++++++++
> I have 2 questions:
> 1) Most of our docs are written in RST, same will be true for requirements docs. Any specific reason for using markdown?
No specific reason as such. I am happy for this filename to be renamed 
on commit.
> 2) In the current form of this patch, docs/fusa won't be part of the generated Xen docs. Is this intended? Don't we want to
> include it?
docs/fusa will become a part of the generated Xen docs when the 
requirements (see patch 2) are added.
>
> Apart from that:
> Acked-by: Michal Orzel <michal.orzel@amd.com>
- Ayan
>
> ~Michal


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 12:56:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 12:56:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772126.1182566 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saxG5-0001nD-B3; Mon, 05 Aug 2024 12:56:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772126.1182566; Mon, 05 Aug 2024 12:56:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saxG5-0001n6-7q; Mon, 05 Aug 2024 12:56:17 +0000
Received: by outflank-mailman (input) for mailman id 772126;
 Mon, 05 Aug 2024 12:56:16 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saxG4-0001kk-Bg; Mon, 05 Aug 2024 12:56:16 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saxG4-0008JV-3Z; Mon, 05 Aug 2024 12:56:16 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saxG3-00014d-Jo; Mon, 05 Aug 2024 12:56:15 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1saxG3-0001bb-JK; Mon, 05 Aug 2024 12:56:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=G/F7uDSQ/qbwe6Il+qxmsGXRGqU5jeWvY/yHXSK1WKM=; b=53kt8jkBuvNpU7ZDrG4XErd8kP
	ekVflXLAaPw9UU075N/q56XrwUSHaiq3ZN05DIwOmPiizkKdcdeGrCPFiM6buwtI8U3WOHGePQMOY
	M5iyYr3taLWEBXz90GW6gj8B8XTxnmi4eiXrLnVm9BO+pHhDGvHfUv6VV5sSyNeiIBhU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187149-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187149: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=ded5474718a84366dac80aae039a693b66fa7e2e
X-Osstest-Versions-That:
    xen=ded5474718a84366dac80aae039a693b66fa7e2e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 05 Aug 2024 12:56:15 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 xen                  ded5474718a84366dac80aae039a693b66fa7e2e
baseline version:
 xen                  ded5474718a84366dac80aae039a693b66fa7e2e

Last test of basis   187149  2024-08-05 01:53:50 Z    0 days
Testing same since                          (not found)         0 attempts

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


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

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

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

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


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 12:57:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 12:57:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772145.1182576 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saxGy-0002jj-LK; Mon, 05 Aug 2024 12:57:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772145.1182576; Mon, 05 Aug 2024 12:57:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saxGy-0002jc-Ha; Mon, 05 Aug 2024 12:57:12 +0000
Received: by outflank-mailman (input) for mailman id 772145;
 Mon, 05 Aug 2024 12:57:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saxGx-0002jO-Es; Mon, 05 Aug 2024 12:57:11 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saxGx-0008ME-Dw; Mon, 05 Aug 2024 12:57:11 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1saxGx-00015V-2C; Mon, 05 Aug 2024 12:57:11 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1saxGx-00027R-1h; Mon, 05 Aug 2024 12:57:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=7A8PZpPAVnkDy//UXH6P3KDIophAGHnH3fuqs2WV2TU=; b=sSUllvN5stzn5uI4l/IqCSKrzJ
	jzf+ZeQHBK91Trgmu7GtflxFqIl9gzlubG1QNS0rfzJwnYuyYdMAmPR2q6W7jYcoEqkrGpoRqhQ6f
	ZwOjlNXdcHF70uStcLsXvGT19qYxr2Il/yA3BpIp5DM8n2fZXl8J0MJvcegXTdB2+HqQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187154-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187154: regressions - FAIL
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:xen-boot:fail:regression
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=ac6b9309694de9b2b5163886656282f6ada71565
X-Osstest-Versions-That:
    xen=ded5474718a84366dac80aae039a693b66fa7e2e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 05 Aug 2024 12:57:11 +0000

flight 187154 xen-unstable-smoke real [real]
flight 187155 xen-unstable-smoke real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187154/
http://logs.test-lab.xenproject.org/osstest/logs/187155/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-libvirt      8 xen-boot                 fail REGR. vs. 187127

Tests which did not succeed, but are not blocking:
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  ac6b9309694de9b2b5163886656282f6ada71565
baseline version:
 xen                  ded5474718a84366dac80aae039a693b66fa7e2e

Last test of basis   187127  2024-08-02 22:02:05 Z    2 days
Testing same since   187154  2024-08-05 09:02:05 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Roger Pau Monné <roger.pau@citrix.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     fail    


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

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

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

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


Not pushing.

------------------------------------------------------------
commit ac6b9309694de9b2b5163886656282f6ada71565
Author: Roger Pau Monné <roger.pau@citrix.com>
Date:   Mon Aug 5 10:18:05 2024 +0200

    x86/dom0: delay setting SMAP after dom0 build is done
    
    Delay setting X86_CR4_SMAP on the BSP until the domain building is done, so
    that there's no need to disable SMAP.  Note however that SMAP is enabled for
    the APs on bringup, as domain builder code strictly run on the BSP.  Delaying
    the setting for the APs would mean having to do a callfunc IPI later in order
    to set it on all the APs.
    
    The fixes tag is to account for the wrong usage of cpu_has_smap in
    create_dom0(), it should instead have used
    boot_cpu_has(X86_FEATURE_XEN_SMAP).
    
    While there also make cr4_pv32_mask __ro_after_init.
    
    Fixes: 493ab190e5b1 ('xen/sm{e, a}p: allow disabling sm{e, a}p for Xen itself')
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>

commit d81dd31303513a1626973778d557a6493d86511a
Author: Roger Pau Monné <roger.pau@citrix.com>
Date:   Mon Aug 5 10:16:54 2024 +0200

    x86/shutdown: change default reboot method preference
    
    The current logic to chose the preferred reboot method is based on the mode Xen
    has been booted into, so if the box is booted from UEFI, the preferred reboot
    method will be to use the ResetSystem() run time service call.
    
    However, that method seems to be widely untested, and quite often leads to a
    result similar to:
    
    Hardware Dom0 shutdown: rebooting machine
    ----[ Xen-4.18-unstable  x86_64  debug=y  Tainted:   C    ]----
    CPU:    0
    RIP:    e008:[<0000000000000017>] 0000000000000017
    RFLAGS: 0000000000010202   CONTEXT: hypervisor
    [...]
    Xen call trace:
       [<0000000000000017>] R 0000000000000017
       [<ffff83207eff7b50>] S ffff83207eff7b50
       [<ffff82d0403525aa>] F machine_restart+0x1da/0x261
       [<ffff82d04035263c>] F apic_wait_icr_idle+0/0x37
       [<ffff82d040233689>] F smp_call_function_interrupt+0xc7/0xcb
       [<ffff82d040352f05>] F call_function_interrupt+0x20/0x34
       [<ffff82d04033b0d5>] F do_IRQ+0x150/0x6f3
       [<ffff82d0402018c2>] F common_interrupt+0x132/0x140
       [<ffff82d040283d33>] F arch/x86/acpi/cpu_idle.c#acpi_idle_do_entry+0x113/0x129
       [<ffff82d04028436c>] F arch/x86/acpi/cpu_idle.c#acpi_processor_idle+0x3eb/0x5f7
       [<ffff82d04032a549>] F arch/x86/domain.c#idle_loop+0xec/0xee
    
    ****************************************
    Panic on CPU 0:
    FATAL TRAP: vector = 6 (invalid opcode)
    ****************************************
    
    Which in most cases does lead to a reboot, however that's unreliable.
    
    Change the default reboot preference to prefer ACPI over UEFI if available and
    not in reduced hardware mode.
    
    This is in line to what Linux does, so it's unlikely to cause issues on current
    and future hardware, since there's a much higher chance of vendors testing
    hardware with Linux rather than Xen.
    
    Add a special case for one Acer model that does require being rebooted using
    ResetSystem().  See Linux commit 0082517fa4bce for rationale.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 13:12:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 13:12:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772160.1182588 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saxVP-0005mk-2N; Mon, 05 Aug 2024 13:12:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772160.1182588; Mon, 05 Aug 2024 13:12:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saxVO-0005md-W1; Mon, 05 Aug 2024 13:12:06 +0000
Received: by outflank-mailman (input) for mailman id 772160;
 Mon, 05 Aug 2024 13:12: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=kPoy=PE=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1saxVO-0005mX-Ep
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 13:12:06 +0000
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on20615.outbound.protection.outlook.com
 [2a01:111:f400:7e88::615])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4e6bc992-532c-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 15:12:04 +0200 (CEST)
Received: from BN0PR10CA0010.namprd10.prod.outlook.com (2603:10b6:408:143::14)
 by SA3PR12MB9177.namprd12.prod.outlook.com (2603:10b6:806:39d::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.33; Mon, 5 Aug
 2024 13:11:58 +0000
Received: from BN1PEPF00005FFF.namprd05.prod.outlook.com
 (2603:10b6:408:143:cafe::33) by BN0PR10CA0010.outlook.office365.com
 (2603:10b6:408:143::14) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.27 via Frontend
 Transport; Mon, 5 Aug 2024 13:11:58 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BN1PEPF00005FFF.mail.protection.outlook.com (10.167.243.231) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Mon, 5 Aug 2024 13:11:57 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 5 Aug
 2024 08:11:57 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 5 Aug
 2024 08:11:57 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Mon, 5 Aug 2024 08:11:55 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4e6bc992-532c-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=BRclFnMyceTrdiLAVttJOUH7cYDlfvsS/oQMYead3icNj295UKH0VJ3OXHfwJzqzEMz4vvuQ4e8dux33K1wEY+KHj/HncSQPFD1toXOP/QdKwzLPbrw8vQm2Jrg6jpodhCHJHVHtHT+9f/2/XTEOQtLJWcN1/wocHIK5sN1JRv47t6MoQesF8AXdodqerkzUwyEU3Y0KpcwUXL6SRkrPGFahYdB4BCaO6imuA2qWXlruuNrfC8u5dtW8Bf/OcnZiIzHD8IHshUmjhHQPY5kvA1pjNsG2T6HlXI62tNLsD4kG1hpXW3nMNTEcg1gcQcIRJ5M3YhMpXyXSmxAfsE+wdQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=c7bgU0E+tbUNJkpb+OlUYg7e12sO+l/9+vetuOjVCjE=;
 b=xsfxANMAuFeT3o8tMJ0cKbGr7VyxK/Ee4QhstA0T25ORuHDdSyBglpB/YZ0Ru+cu2TXnGCGxZSS6uGRaAFAKX/yIvtWv+nnkB2Yqs67X0u7NReMCK5raeXkRo8V7tABi5yIkDwV8QWIdQQZ17EGi3nNK1OdPw7JCIGwBVNwyu1jsf7qgeDz9Ru1SJizbBTKgb5i7qNw48bKocH6zvCWBUU0l3GXqMfgfERFLS9kx9tixxyMyVrXgDHkmv5afNv++SXW8LW49QELXmLjEUPa0+rv7Qqo8e0x8dRowIhsyMmDNtRRVoSMeynn6+/9z2U5w4UT2zZi0AOlQ+pLxpMxOUA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=c7bgU0E+tbUNJkpb+OlUYg7e12sO+l/9+vetuOjVCjE=;
 b=tjvP2u5jlQ0rRpg1Tc/LJ25VvWwwje8LM627/PRKHTwSXkYHls2PjgQbrz5Riv0vxjXT14ieX1nYzKJw0wqZMbIl3Y+pnUJujPIZHIP6ew7XishTZsnk5DdjUmcLORxyH7JyagdhhQkXf0AgCD74lmy1/ulBwbfSXNQMPvuhlL8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <d5a02069-6651-4b0f-a440-003cd2bfc237@amd.com>
Date: Mon, 5 Aug 2024 15:11:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/3] docs: Introduce Fusa Requirement and define
 maintainers
To: Ayan Kumar Halder <ayankuma@amd.com>, Ayan Kumar Halder
	<ayan.kumar.halder@amd.com>, <sstabellini@kernel.org>,
	<bertrand.marquis@arm.com>, <artem_mygaiev@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
References: <20240802094614.1114227-1-ayan.kumar.halder@amd.com>
 <20240802094614.1114227-2-ayan.kumar.halder@amd.com>
 <15c5709f-a81c-4ca4-8851-89938a5a6141@amd.com>
 <bb77afd1-3fed-47ab-b83b-ec3e06d0c5a1@amd.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <bb77afd1-3fed-47ab-b83b-ec3e06d0c5a1@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN1PEPF00005FFF:EE_|SA3PR12MB9177:EE_
X-MS-Office365-Filtering-Correlation-Id: 9741a8dc-b38b-4878-eec1-08dcb5502f82
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?T3BHbllSbU5RVmI4OVRTOVJ2YnBINGZHWWg0TFVTNW5Xd203REtVcFcwdkRz?=
 =?utf-8?B?Mk9xNHFaeVdWcmdhNEFSNXd1V1NpMS9nWDBSSm5taUV4a0ZKVkhYL3hHZGRi?=
 =?utf-8?B?UFpyVGdUenhXQ0VwSktpUDJXWjlHcTZvVnVwQi9wTVJaWTdOay9xNnhDOVEz?=
 =?utf-8?B?K2dTenB6VWhmOVJxQXJXelB4VHkxQmV4WkdQaFZHZXJtejBKNnBYTGl6THpt?=
 =?utf-8?B?K2ZVcWpkWDlQMGFJcTgwZVNwOWJXNFVGVElON0Z2SUhXVlFxaEEvZ0JQcEZO?=
 =?utf-8?B?cnl4MnNsU05hRm9ZdVJ3dngvcDFWbHIzaW9aRitrclY5RkN3N1R2Ym1MQ3pC?=
 =?utf-8?B?MzlOTHUvRWZuN3k2UytsTzFIVXY3N0M0MWNFM1U5VjZ3Ni9yZFFVTk1JVGhW?=
 =?utf-8?B?NHpFZGtmQ1hUNjRHWkx2bURLd0ZrcU55QXBuK25uTk10Q25sYnJ0YS9OQW5T?=
 =?utf-8?B?YXROOWNzZ2haYmlQYlVkelVERmlEc0gybFpEbmhEakNJQnZIajM5b1lDdGIv?=
 =?utf-8?B?Q1JNRUdzZEVwSmRjdkQyRmQ1elcxcnc0TUVSSlNwVnBCT1JBUmFyYnpIMjhT?=
 =?utf-8?B?SEcvV2NON1BBT3g2TGhpQkRYRmVYRHZ0VFNLUldzLzJ2b0R6d3NlWm03WmI3?=
 =?utf-8?B?UlArK2NXSExydHJhNTZIZGZVMjdqVnJITGlCT05Fb05lSzI1Qi9DQ0ZHRm9U?=
 =?utf-8?B?aUN0cW9USTNuUzg4bkh2MWtTZFBoVFBYdE5DYmZHWWtzc0NHemxqZFcrTHBt?=
 =?utf-8?B?b2NYY2NCcVpYRkdhYlhBaVAybGVJQkZWSWdRNXJkRjEvb011WHhJNEZqUEtG?=
 =?utf-8?B?VitMbE1YWjI4N0N0alZQZllleUlGR1dMaUNLa1dnTVR3ZVdpamd4MWI5VW11?=
 =?utf-8?B?Wmt6bDkzekFMQm90Mk1TNWpMYlVTYzRoaEVKRDhBMUV5aVV3Y2IzWjhvNFVi?=
 =?utf-8?B?Um56TlB2VXZHcStJUysvbExCaG5qYUJIcWJiSlZmcVdNYzJmUDE2NU00SDYy?=
 =?utf-8?B?RWtqbzlNRFRPaUxQR0xLaXUrUG5JWHc0VnBXckVHRmpxVjQwZ24xbHZETTFP?=
 =?utf-8?B?VWM5d2E1SmxNMWVqY3ZtU3h0dXFlVUl0TFlWNUhzbDE5dDNldjQ2ekwyUXE0?=
 =?utf-8?B?cG5Ub0QwZ1F0V1Z1UUY2eUhRbENQQ3cvemgrUVlHa0I3UHoxcnR4OFcxOFR0?=
 =?utf-8?B?dEdhU3RrSDdYK1F3MzlTbEViOUcyQjFYUUt4WXg3MDZsVWcxa0JDb2pUUlVQ?=
 =?utf-8?B?MWE0QVMxZFp5YVBzSk9DY2JzbEdZTkRMSW53LzVtemVITjU4QW5YM3FjdGNa?=
 =?utf-8?B?bFBNQjFiYXNZOXZLM3lIWFhJdDdzQVB1L2h5RlBJLzhnUjcxeXZEbVRBU2Ft?=
 =?utf-8?B?K1NuR3RDbnhMQUJsMkU0VjJ5RXdJVi9oRFZEeHJRc1E5QW0rYTQ5a0tyVmNC?=
 =?utf-8?B?TEd4QzBJN053MFlkelBJSW1zREVJNVIybU9pUnZtdzlKbXd4TTltNHd2OGw0?=
 =?utf-8?B?S1cvU0hPSVRRd1NvZ2pNM3l6bC9mSnJhdmZrdlYrNmZzTEREWWcxLzduMFkw?=
 =?utf-8?B?Vm5RQ2Q0M0NvMTRPdFFOUUlwSkp6bHVGYWlHV2hwMkJyNno3Qkh1cFRIbHdr?=
 =?utf-8?B?Qk9Ha1JHcFJ1SzF4L3FUT2JZS3AyaG92TlZIU0hZWlJqcWRUWFRCQVJDN1d1?=
 =?utf-8?B?NERpRGF2TnJkMlhSZzU5QnppeTRXcTA0eU1ERERBZnFjOWRCQWUyQ0VCbHpl?=
 =?utf-8?B?bFVOY084VzZISDFreU9tOExiL1RNU3FybFpwK1R5Yk5tTzV5MmpUQ1RZWXRQ?=
 =?utf-8?B?SXVZSWJDRjY4ZUg4Z3JQN0N0N01vNE1xSDR2UW1PNmJvSmo1MjAxR2N1NDRV?=
 =?utf-8?B?NmJlZGFITXUxUVJma09ZL3Y5anhxVVFWckJTQXhITDc1SnRPejBSclM5OXpR?=
 =?utf-8?Q?cCUjTCXiEoddu782Xoj4W54uE8HeaAzu?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 13:11:57.8263
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 9741a8dc-b38b-4878-eec1-08dcb5502f82
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN1PEPF00005FFF.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB9177



On 05/08/2024 14:45, Ayan Kumar Halder wrote:
> 
> On 05/08/2024 10:46, Michal Orzel wrote:
>> Hi Ayan,
> Hi Michal,
>>
>> On 02/08/2024 11:46, Ayan Kumar Halder wrote:
>>> The FUSA folder is expected to contain requirements and other documents
>>> to enable safety certification of Xen hypervisor.
>>> Added a README to explain how the requirements are categorized, written
>>> and their supported status.
>>>
>>> Added maintainers for the same.
>>>
>>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>>> Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
>>> ---
>>> Changes from :-
>>>
>>> v1 - 1. Added a comment from Stefano.
>>> 2. Added Ack.
>>>
>>>   MAINTAINERS              |  9 +++++
>>>   docs/fusa/reqs/README.md | 78 ++++++++++++++++++++++++++++++++++++++++
>> I have 2 questions:
>> 1) Most of our docs are written in RST, same will be true for requirements docs. Any specific reason for using markdown?
> No specific reason as such. I am happy for this filename to be renamed 
> on commit.
If we want RST, I'm afraid it would involve more changes than it can be done on commit (rstcheck reports quite a few).
Also, renaming to RST would result in this file being picked up by sphinx build and it would report a warning too.

>> 2) In the current form of this patch, docs/fusa won't be part of the generated Xen docs. Is this intended? Don't we want to
>> include it?
> docs/fusa will become a part of the generated Xen docs when the 
> requirements (see patch 2) are added.
If you want docs/fusa to be included, why not doing this right away?

~Michal


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 13:26:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 13:26:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772169.1182599 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saxjJ-0008FO-83; Mon, 05 Aug 2024 13:26:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772169.1182599; Mon, 05 Aug 2024 13:26:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1saxjJ-0008FH-5D; Mon, 05 Aug 2024 13:26:29 +0000
Received: by outflank-mailman (input) for mailman id 772169;
 Mon, 05 Aug 2024 13:26: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=I4ub=PE=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1saxjH-0008FB-Vu
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 13:26:27 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5123bfbd-532e-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 15:26:26 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a7a843bef98so1058042766b.2
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 06:26:26 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ec7311sm450930166b.195.2024.08.05.06.26.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 05 Aug 2024 06:26:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5123bfbd-532e-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722864386; x=1723469186; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=+LzdTN0LrxG38E8N8sPxyACXjQToDaja2vpqjapp9Eg=;
        b=RdJmJdVBRZeoxP0pmdm9ihdh4hHZINOR2KgzvUyeDCzabyD+jqwaB7EIUntFWBdwcF
         S3d4L7/RIdGhc9jGrKypiIDcQ1lXeSah1T4KpLU/9cPwGeXuI6HRGWE4ql6oqHNaiXf1
         zK5C5uTNLoDGeSrmcjOmc5O7x05svH2io65P6OvTbpitgMbEVpG6pG0TzHZ95/5/R2rO
         2U1o5A4AzPUO/N29qP/Th1k6x16q0sfERkkui5wJljTQs6amEV42FNSX2QUJ0pLG3kJd
         2GRnzb0MQBgqagLTUFvFkcjp8wHfhMDZMLrjJlfF4sRlfuYsdacp2f6pDyskKpj7EV5+
         9a1g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722864386; x=1723469186;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=+LzdTN0LrxG38E8N8sPxyACXjQToDaja2vpqjapp9Eg=;
        b=Vy5xd7B5OdV0IKVaA8Tie0/Z0RGCOf86rrvUz6QXZdJ3tcPjBpVZfiiYigPtSgQLpE
         tAZ6kqkX0q1IqQEnqsJkXEEAcUsgf/cadFNYBjcSfpeFgWGYm/CS4f2Ozfcok4ME8h4Z
         NSa+0dKMYMlmGQQhnEbnShGvLGqSn1kmu6Ui2k2aL8ThM2wBCLEHADH0bQdkejOqOsin
         p3Pzkmy46Y2kUj+rz90kye39O6KNOSDdvVq0f14loBUrcf4Y43/1eFTEaHOHkr4K/xoZ
         1bzoTKfEwzh/WLmPjZmlAk5zLMv4vrRS9GScY7ZDLXEbcP3ctdsNz2xeBF1EVhb0TD5Q
         opZw==
X-Gm-Message-State: AOJu0YyjY1ixAVYt1qdBig0deGJ6b1NRlR/WV31TCq9YClh7UR6Q1bQF
	vWgSj6me8zKp+b+QUtJwbOCQe1GbaUV/I9rFCmm+NYKAlH8LLDY9ALiUVZXmgVE0yXvobs6O+ho
	=
X-Google-Smtp-Source: AGHT+IEaSEApBX9iP9WPNnL2z7ZkuNTBn/gY4lvs+wzc4dIaNoeI7NG7bGtwnguukxMUlhzFhUkQYg==
X-Received: by 2002:a17:907:2d08:b0:a7a:929f:c0ce with SMTP id a640c23a62f3a-a7dc4df9533mr670154366b.19.1722864386087;
        Mon, 05 Aug 2024 06:26:26 -0700 (PDT)
Message-ID: <81ae365f-98b4-4bb6-bbb6-c5423dfda038@suse.com>
Date: Mon, 5 Aug 2024 15:26:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86emul: don't call ->read_segment() with x86_seg_none
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

LAR, LSL, VERR, and VERW emulation involve calling protmode_load_seg()
with x86_seg_none. The fuzzer's read_segment() hook function has an
assertion which triggers in this case. Calling the hook function,
however, makes little sense for those insns, as there's no data to
retrieve. Instead zero-filling the output structure is what properly
corresponds to those insns being invoked with a NUL selector.

Fixes: 06a3b8cd7ad2 ("x86emul: support LAR/LSL/VERR/VERW")
Oss-fuzz: 70918
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
It is pure guesswork that one of those insns did trigger the assertion.
The report from oss-fuzz sadly lacks details on the insn under
emulation. I'm further surprised that AFL never found this.

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -839,7 +839,8 @@ protmode_load_seg(
         case x86_seg_tr:
             goto raise_exn;
         }
-        if ( !_amd_like(cp) || vcpu_has_nscb() || !ops->read_segment ||
+        if ( seg == x86_seg_none || !_amd_like(cp) || vcpu_has_nscb() ||
+             !ops->read_segment ||
              ops->read_segment(seg, sreg, ctxt) != X86EMUL_OKAY )
             memset(sreg, 0, sizeof(*sreg));
         else


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 13:46:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 13:46:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772179.1182608 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1say2o-0003Bj-OM; Mon, 05 Aug 2024 13:46:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772179.1182608; Mon, 05 Aug 2024 13:46:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1say2o-0003Bc-Lt; Mon, 05 Aug 2024 13:46:38 +0000
Received: by outflank-mailman (input) for mailman id 772179;
 Mon, 05 Aug 2024 13:46: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=I4ub=PE=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1say2n-0003BW-HI
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 13:46:37 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 223aee22-5331-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 15:46:36 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-52f025ab3a7so14463903e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 06:46:36 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ec4875sm452370766b.191.2024.08.05.06.46.35
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 05 Aug 2024 06:46:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 223aee22-5331-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722865596; x=1723470396; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=He/VNCUucT/Fwk6jTYK47AImSamRG/7DWHnSj9sWCVw=;
        b=KDoeMq7vxjkajdYcWIsLfZnHzhauV2ORSZmhUOjcPkmwEQBObUPSmCFKAq4YwCn/wH
         x6+3M8+0gReSYVYP/POzmnLp5JZrTBk+ge0rwIJXofqC4emN/tq0Mv+oabejbGjfsZPt
         5TaDxKaSBow2PPl3gxzSBfAcAJHRFYVcK0Xn1W9RYVIDcaTKKQuVMw1rzDEslzXzSUJN
         y9Zx0mVBOBzLY6MqR75hlRCmK8OwXrszWdddpjGOXqsKtguZOWj2tuWIhkdRnoyv/FvR
         k7KcQJo6OUZ37tbor5mDyoB/1izZe+sZdl4GyooEnkO+OZ6Q4epETP+3Hr2STRZwfzih
         Q4ag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722865596; x=1723470396;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=He/VNCUucT/Fwk6jTYK47AImSamRG/7DWHnSj9sWCVw=;
        b=vEIaGA7+NE+Is/ARG75fdx1k9zeKYDqe9eSVuf48rZt9VeCNJghRB0iD5+XNoYZmXV
         EOEaeR94UEynWcvPtKoDBOZpJ0nY/ROt0zjMwkQHbDUtz3lI68VG3W0PEPlYw7W5TlcP
         plGHrOLQYl2SEVqqs+N/PwG9d3rsoX1pzgDvhywEt8+Wqn0DJxXEGFgfyxwZH1bt9tDb
         ftAm/aYVc3hx7EQ+orK0TFT2NsMKv/Y64o9TKQ5pe65kKkUwHqCvyz7aCfHoZIbUjQS1
         01KCcoZ1BGXS8smX6qecojcBtBPd46fcOSDluLPjy/ESdiT0eCKpS+5ITU28Env1PUTF
         ginw==
X-Gm-Message-State: AOJu0Yya1s+1TKzNnI32y7KYGDdXva5JXvlR+geQX+uj/Fci+ffKrdkD
	9wU7xtLK1DD9gtOx4Vv87vWsD8JHSHL6NPX752QMlzOtQic5x+AD31kaayd7NGCnohXuQupjAms
	=
X-Google-Smtp-Source: AGHT+IGy9jZ7RLTGmvjzn0RBpgGWrPBiXl/l3d9ErdNVjjA70cR6cjXQkd6yFekvTpn3cmZdM8ccGQ==
X-Received: by 2002:a05:6512:3a6:b0:530:d088:2348 with SMTP id 2adb3069b0e04-530d09aac9dmr1316004e87.54.1722865595714;
        Mon, 05 Aug 2024 06:46:35 -0700 (PDT)
Message-ID: <9f73c7bd-4aa3-4a66-a12c-4bfda6aa233a@suse.com>
Date: Mon, 5 Aug 2024 15:46:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86emul: avoid UB shift in AVX512 VPMOV* handling
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

For widening and narrowing moves, operand (vector) size is calculated
from a table. This calculation, for the AVX512 cases, lives ahead of
validation of EVEX.L'L (which cannot be 3 without raising #UD). Account
for the later checking by adjusting the constants in the expression such
that even EVEX.L'L == 3 will yield a non-UB shift (read: shift count
reliably >= 0).

Fixes: 3988beb08 ("x86emul: support AVX512{F,BW} zero- and sign-extending moves")
Oss-fuzz: 70914
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -5788,7 +5788,7 @@ x86_emulate(
             d = DstMem | SrcReg | TwoOp;
         }
         generate_exception_if(evex.brs, X86_EXC_UD);
-        op_bytes = 32 >> (pmov_convert_delta[b & 7] + 1 - evex.lr);
+        op_bytes = 64 >> (pmov_convert_delta[b & 7] + 2 - evex.lr);
         elem_bytes = (b & 7) < 3 ? 1 : (b & 7) != 5 ? 2 : 4;
         goto avx512f_no_sae;
 


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 14:10:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 14:10:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772189.1182619 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sayQB-0007dO-Kd; Mon, 05 Aug 2024 14:10:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772189.1182619; Mon, 05 Aug 2024 14:10:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sayQB-0007dH-Gd; Mon, 05 Aug 2024 14:10:47 +0000
Received: by outflank-mailman (input) for mailman id 772189;
 Mon, 05 Aug 2024 14:10:46 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=XyDJ=PE=decay.netherworld.org=mag@srs-se1.protection.inumbo.net>)
 id 1sayQA-0007dB-K6
 for xen-devel@lists.xen.org; Mon, 05 Aug 2024 14:10:46 +0000
Received: from sinister.netherworld.org (sinister.netherworld.org
 [38.100.53.3]) by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id 80ad457b-5334-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 16:10:44 +0200 (CEST)
Received: from decay.netherworld.org (decay.netherworld.org [192.168.6.20])
 by sinister.netherworld.org (8.17.1/8.17.1) with ESMTP id 475EAggB020711;
 Mon, 5 Aug 2024 10:10:42 -0400
Received: from decay.netherworld.org (localhost [127.0.0.1])
 by decay.netherworld.org (8.17.1/8.17.1) with ESMTP id 475EAgQt021863;
 Mon, 5 Aug 2024 10:10:42 -0400
Received: (from mag@localhost)
 by decay.netherworld.org (8.17.1/8.17.1/Submit) id 475EAguK021862;
 Mon, 5 Aug 2024 10:10:42 -0400
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 80ad457b-5334-11ef-8776-851b0ebba9a2
Date: Mon, 5 Aug 2024 10:10:42 -0400 (EDT)
From: "John E. Krokes" <mag@netherworld.org>
To: Jan Beulich <jbeulich@suse.com>
cc: xen-devel@lists.xen.org
Subject: Re: [BUG] incorrect "help" output
In-Reply-To: <8e25bb26-2356-43a3-a479-6a679c6577c5@suse.com>
Message-ID: <7c7499df-b87f-7c77-e534-ac713b50f9ef@decay.netherworld.org>
References: <c79f8028-6c34-0e25-1445-79e5bcb93890@decay.netherworld.org> <8e25bb26-2356-43a3-a479-6a679c6577c5@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII; format=flowed

On Mon, 5 Aug 2024, Jan Beulich wrote:

> On 04.08.2024 15:18, John E. Krokes wrote:
>> Here's a simple and obvious mistake:
>>
>>
>> ~> xl help | grep vsnd
>>   vsnd-attach         Create a new virtual sound device
>>   vsnd-list           List virtual display devices for a domain
>>   vsnd-detach         Destroy a domain's virtual sound device
>>   ~>
>>
>>
>> I'm pretty sure vsnd-list should say "sound devices" instead of
>> "display devices". The problem is in tools/xl/xl_cmdtable.c.
>
> Would you mind sending a patch (against the current staging tree)?
>
> Jan
>
>

I am preparing to send it now.

This is my first time actually using git for anything. I believe I have
complied with all of the requirements and used all of the right tools.
I apologize if I am wrong about that.

-Mag


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 14:12:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 14:12:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772197.1182628 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sayRe-0008AX-Tc; Mon, 05 Aug 2024 14:12:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772197.1182628; Mon, 05 Aug 2024 14:12:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sayRe-0008AQ-RA; Mon, 05 Aug 2024 14:12:18 +0000
Received: by outflank-mailman (input) for mailman id 772197;
 Mon, 05 Aug 2024 14:12:17 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=XyDJ=PE=decay.netherworld.org=mag@srs-se1.protection.inumbo.net>)
 id 1sayRd-00089W-Lw
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 14:12:17 +0000
Received: from sinister.netherworld.org (sinister.netherworld.org
 [38.100.53.3]) by se1-gles-flk1.inumbo.com (Halon) with ESMTP
 id b77f6c41-5334-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 16:12:15 +0200 (CEST)
Received: from decay.netherworld.org (decay.netherworld.org [192.168.6.20])
 by sinister.netherworld.org (8.17.1/8.17.1) with ESMTP id 475ECE35020715;
 Mon, 5 Aug 2024 10:12:14 -0400
Received: from decay.netherworld.org (localhost [127.0.0.1])
 by decay.netherworld.org (8.17.1/8.17.1) with ESMTP id 475ECEUE021887;
 Mon, 5 Aug 2024 10:12:14 -0400
Received: (from mag@localhost)
 by decay.netherworld.org (8.17.1/8.17.1/Submit) id 475ECDRu021886;
 Mon, 5 Aug 2024 10:12:13 -0400
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b77f6c41-5334-11ef-8776-851b0ebba9a2
From: "John E. Krokes" <mag@netherworld.org>
To: xen-devel@lists.xenproject.org
Cc: "John E. Krokes" <mag@netherworld.org>,
        Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH] Fixed incorrect output in xl's "help" command.
Date: Mon,  5 Aug 2024 10:11:59 -0400
Message-Id: <20240805141159.21872-1-mag@netherworld.org>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In "xl help", the output includes this line:

 vsnd-list           List virtual display devices for a domain

This should obviously say "sound devices" instead of "display devices".

Signed-off-by: John E. Krokes <mag@netherworld.org>
---
 tools/xl/xl_cmdtable.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
index 42751228c1..53fc22d344 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -433,7 +433,7 @@ const struct cmd_spec cmd_table[] = {
     },
     { "vsnd-list",
       &main_vsndlist, 0, 0,
-      "List virtual display devices for a domain",
+      "List virtual sound devices for a domain",
       "<Domain(s)>",
     },
     { "vsnd-detach",
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 14:14:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 14:14:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772205.1182638 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sayTw-0000LZ-Cz; Mon, 05 Aug 2024 14:14:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772205.1182638; Mon, 05 Aug 2024 14:14:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sayTw-0000LS-AX; Mon, 05 Aug 2024 14:14:40 +0000
Received: by outflank-mailman (input) for mailman id 772205;
 Mon, 05 Aug 2024 14:14:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Dvoq=PE=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sayTv-0000LM-2q
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 14:14:39 +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 0c4aee72-5335-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 16:14:37 +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 B3D5D1F80E;
 Mon,  5 Aug 2024 14:14:35 +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 8A49F13254;
 Mon,  5 Aug 2024 14:14:35 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id LJW5H0vesGYtSQAAD6G6ig
 (envelope-from <jgross@suse.com>); Mon, 05 Aug 2024 14:14:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0c4aee72-5335-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1722867277; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references:autocrypt:autocrypt;
	bh=iRmuPONZYXjZ27Qbnkj1Am/4n1+dUPEDyXGv1R2oKW8=;
	b=fN9OafP8Vl8/y06pemsSkFcny9OtB7I0OI25Wd5kQvN3nUgmbNLHHLroKwmbToFPqGccU2
	a447S0hYc0qh9w34RPdcJfhlSaY0Q8+NqlfT0/vw1Eto/cqR9DgmPxkOfl5kTE7oRMxaGI
	AJyMhPR3OBnPoB49j0WKjgc/HHu5dqs=
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1722867275; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references:autocrypt:autocrypt;
	bh=iRmuPONZYXjZ27Qbnkj1Am/4n1+dUPEDyXGv1R2oKW8=;
	b=Mif0Hls82ZhBsHum5TRNmbYFsGr76K5sNTsA31lLiH18uqcf5F02lcYe4N4RIfNBAEqGWx
	ynAXACUCcKvH6tNzL+uoH3KYQymfPWMapjRLkWj0RGYzCEY39eRnZRFfryR2HBtf7PQH9Y
	yoxzd6Xhl1mBGESnfLh59Kdw6mNnzEA=
Message-ID: <9988e590-e992-4d3e-b77b-5bde8c80d1cf@suse.com>
Date: Mon, 5 Aug 2024 16:14:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] Fixed incorrect output in xl's "help" command.
To: "John E. Krokes" <mag@netherworld.org>, xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>
References: <20240805141159.21872-1-mag@netherworld.org>
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: <20240805141159.21872-1-mag@netherworld.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------HmBAieBmsm0IKikIuKtSRqYK"
X-Spam-Level: 
X-Spamd-Result: default: False [-2.19 / 50.00];
	SIGNED_PGP(-2.00)[];
	MIME_BASE64_TEXT_BOGUS(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain];
	NEURAL_HAM_SHORT(-0.20)[-0.998];
	MIME_UNKNOWN(0.10)[application/pgp-keys];
	MIME_BASE64_TEXT(0.10)[];
	XM_UA_NO_VERSION(0.01)[];
	RCVD_TLS_ALL(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	MIME_TRACE(0.00)[0:+,1:+,2:+,3:+,4:~,5:~];
	ARC_NA(0.00)[];
	TO_DN_SOME(0.00)[];
	MID_RHS_MATCH_FROM(0.00)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	RCPT_COUNT_THREE(0.00)[3];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,netherworld.org:email,suse.com:email];
	HAS_ATTACHMENT(0.00)[]
X-Spam-Flag: NO
X-Spam-Score: -2.19

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------HmBAieBmsm0IKikIuKtSRqYK
Content-Type: multipart/mixed; boundary="------------3hmkqBCtzu1K7Ks7af1T0K0G";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: "John E. Krokes" <mag@netherworld.org>, xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>
Message-ID: <9988e590-e992-4d3e-b77b-5bde8c80d1cf@suse.com>
Subject: Re: [PATCH] Fixed incorrect output in xl's "help" command.
References: <20240805141159.21872-1-mag@netherworld.org>
In-Reply-To: <20240805141159.21872-1-mag@netherworld.org>

--------------3hmkqBCtzu1K7Ks7af1T0K0G
Content-Type: multipart/mixed; boundary="------------hvf1qqYwky1LvZp59zKDG4Ax"

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

T24gMDUuMDguMjQgMTY6MTEsIEpvaG4gRS4gS3Jva2VzIHdyb3RlOg0KPiBJbiAieGwgaGVs
cCIsIHRoZSBvdXRwdXQgaW5jbHVkZXMgdGhpcyBsaW5lOg0KPiANCj4gICB2c25kLWxpc3Qg
ICAgICAgICAgIExpc3QgdmlydHVhbCBkaXNwbGF5IGRldmljZXMgZm9yIGEgZG9tYWluDQo+
IA0KPiBUaGlzIHNob3VsZCBvYnZpb3VzbHkgc2F5ICJzb3VuZCBkZXZpY2VzIiBpbnN0ZWFk
IG9mICJkaXNwbGF5IGRldmljZXMiLg0KPiANCj4gU2lnbmVkLW9mZi1ieTogSm9obiBFLiBL
cm9rZXMgPG1hZ0BuZXRoZXJ3b3JsZC5vcmc+DQoNClJldmlld2VkLWJ5OiBKdWVyZ2VuIEdy
b3NzIDxqZ3Jvc3NAc3VzZS5jb20+DQoNCg0KSnVlcmdlbg0KDQo=
--------------hvf1qqYwky1LvZp59zKDG4Ax
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-----

--------------hvf1qqYwky1LvZp59zKDG4Ax--

--------------3hmkqBCtzu1K7Ks7af1T0K0G--

--------------HmBAieBmsm0IKikIuKtSRqYK
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/Ey8FAmaw3ksFAwAAAAAACgkQsN6d1ii/Ey9x
mwf/ZkfkSlXZrXXo/sNSqnO5i6CBVaJpnnvIVadKiKOyQ9ASQ3iwhlaZtNLJMLc70lVVwAZ/1NSK
x65obIKSAsMEXyxzspW2/cng4lujGBrOI3pftDJCsFiuYktC/AX1QIS+C1NlHcpzDDBLY8WeLopY
XLSUO/HynYSVqkIkP5IkolkJusm/zP00rHNVuS07lVfK3VpIVzNbstpKda7msWzYCU+WusYjPrSi
m/xMVTq757oHAh54k9UxDlQQWjOOrN91UU96hxYKnGyR4cUwIUB22PIJkSliuvLqlZrEcP5yqe8P
Jyu//MsdA6v8WxJT2tjwy1I6aLDp5BnTKV7OI5cT+A==
=eOzE
-----END PGP SIGNATURE-----

--------------HmBAieBmsm0IKikIuKtSRqYK--


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 14:17:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 14:17:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772212.1182648 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sayWk-0001PZ-Pw; Mon, 05 Aug 2024 14:17:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772212.1182648; Mon, 05 Aug 2024 14:17:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sayWk-0001PS-NQ; Mon, 05 Aug 2024 14:17:34 +0000
Received: by outflank-mailman (input) for mailman id 772212;
 Mon, 05 Aug 2024 14:17:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=I4ub=PE=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sayWj-0001PI-BG
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 14:17:33 +0000
Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com
 [2a00:1450:4864:20::12b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7471c344-5335-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 16:17:32 +0200 (CEST)
Received: by mail-lf1-x12b.google.com with SMTP id
 2adb3069b0e04-52f025ab3a7so14506380e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 07:17:32 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bb884cddf4sm1743439a12.66.2024.08.05.07.17.31
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 05 Aug 2024 07:17:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7471c344-5335-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722867452; x=1723472252; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Ko0MflhDQ7BonKM2X6psyr3vzTTfAWLWr063r7rjalE=;
        b=bLzb3HDc6omFkz6yhZYT6W5QRMHs2Xpf7Th3ID1ZJbBSxiFN9lb/fsClBydK3MtuCz
         NMgKvZMuoay1E4J25i2LkGjQBWkKJD9QHjWpvtfJ3VWZYlULIUyoFYOs28CQ27Cqr8DK
         Ku8C+6y36O+OQ2ybRz4wPQ+HRtRSh3O6gy2hV8qw87fp6hqLMciyhVTGsngqP1jdQlRa
         CUFEF4WgCR5Zz9f0zO34aBVFUkC3pAVKGg9Wjd/EEUvAM1uptPVU7BLiRnps6QiVb4XM
         r31jOkxMKPTJckIzcAScyx0NJKyKWdxrjMBOzez/zA8q4/ZBTjgdjTxnBdhNN6xUAt/Q
         4Ygw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722867452; x=1723472252;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=Ko0MflhDQ7BonKM2X6psyr3vzTTfAWLWr063r7rjalE=;
        b=hzWRAwv/eDnGTRjQNW4di4dokJ34HJd1lIXurss+sVjpZm2WD1UaLd7pOKHWgil9nH
         lsEGI61ZqPGwNKHUA0Zz1/DVCVD7WNaK9Xzda6S+hgoe8kUTxKNN85ywbgfrikapFlNK
         pfmxgTn7ownfMOB3n/Eu7P1jsbPNZETBN4y3FqvLlyKgL0y4zdYD7YHdxQ3+GQ7Jla/N
         G3jNpaZF7eC1TFIeqpzCKiMcdxAtIdwQ8c/FGrdRXcvYVb7LQ7hhpQ54VKYXQSPWdxqy
         hcYJ6fVzaMgxMB5k8km6boc5zgrvRg/oRDVSMYO1fSwo/z+oFcdi8q12omu8gMqtf3ZK
         m8wA==
X-Gm-Message-State: AOJu0YxVSUloNj8FIVToAm+5pcKd+wxpxs6PNB0UgvaLpH/M9ZacG6s8
	wosXqWAd6Yyq3uxa+sFoJNwVnu9Qj072wIzYhHvVKtjGVJtaXEhpDgtRcJ3c+3I6E10cQDx7yRk
	=
X-Google-Smtp-Source: AGHT+IECIBP0QQETPA9IIHORScdM1T8EjDgY23b2GplUj3HY//Qt8bdyb7o67Jm9hn0bLP1E+iQVPA==
X-Received: by 2002:a05:6512:3d89:b0:52e:987f:cfe4 with SMTP id 2adb3069b0e04-530bb396e7amr7639320e87.30.1722867451623;
        Mon, 05 Aug 2024 07:17:31 -0700 (PDT)
Message-ID: <20944ace-6fb8-4a70-82aa-4ed595d01e5e@suse.com>
Date: Mon, 5 Aug 2024 16:17:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86emul: adjust 2nd param of idiv_dbl()
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

-LONG_MIN cannot be represented in a long and hence is UB, for being one
larger than LONG_MAX.

The caller passing an unsigned long and the 1st param also being (array
of) unsigned long, change the 2nd param accordingly while adding the
sole necessary cast. This was the original form of the function anyway.

Fixes: 5644ce014223 ("x86emul: relax asm() constraints")
Oss-fuzz: 70923
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -607,9 +607,9 @@ static bool div_dbl(unsigned long u[2],
  * NB. We don't use idiv directly as it's moderately hard to work out
  *     ahead of time whether it will #DE, which we cannot allow to happen.
  */
-static bool idiv_dbl(unsigned long u[2], long v)
+static bool idiv_dbl(unsigned long u[2], unsigned long v)
 {
-    bool negu = (long)u[1] < 0, negv = v < 0;
+    bool negu = (long)u[1] < 0, negv = (long)v < 0;
 
     /* u = abs(u) */
     if ( negu )


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 14:43:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 14:43:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772224.1182660 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sayvJ-0005u5-PH; Mon, 05 Aug 2024 14:42:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772224.1182660; Mon, 05 Aug 2024 14:42:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sayvJ-0005ty-L4; Mon, 05 Aug 2024 14:42:57 +0000
Received: by outflank-mailman (input) for mailman id 772224;
 Mon, 05 Aug 2024 14:42: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=VQKQ=PE=arm.com=Rahul.Singh@srs-se1.protection.inumbo.net>)
 id 1sayvI-0005ts-8G
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 14:42:56 +0000
Received: from EUR03-VI1-obe.outbound.protection.outlook.com
 (mail-vi1eur03on20612.outbound.protection.outlook.com
 [2a01:111:f403:260c::612])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ff951622-5338-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 16:42:54 +0200 (CEST)
Received: from DU6P191CA0028.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:53f::14)
 by DB9PR08MB9611.eurprd08.prod.outlook.com (2603:10a6:10:461::12) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug
 2024 14:42:51 +0000
Received: from DB3PEPF0000885F.eurprd02.prod.outlook.com
 (2603:10a6:10:53f:cafe::23) by DU6P191CA0028.outlook.office365.com
 (2603:10a6:10:53f::14) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26 via Frontend
 Transport; Mon, 5 Aug 2024 14:42:51 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 DB3PEPF0000885F.mail.protection.outlook.com (10.167.242.10) with
 Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7849.8
 via Frontend Transport; Mon, 5 Aug 2024 14:42:50 +0000
Received: ("Tessian outbound edeef5361dc2:v365");
 Mon, 05 Aug 2024 14:42:50 +0000
Received: from Lf95ec7aef42c.2
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 F281C5D2-DE9B-464B-A4E3-DE6FB08D2F60.1; 
 Mon, 05 Aug 2024 14:42:38 +0000
Received: from EUR05-VI1-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id
 Lf95ec7aef42c.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Mon, 05 Aug 2024 14:42:38 +0000
Received: from PAXPR08MB7154.eurprd08.prod.outlook.com (2603:10a6:102:207::17)
 by DU2PR08MB7341.eurprd08.prod.outlook.com (2603:10a6:10:2f0::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug
 2024 14:42:35 +0000
Received: from PAXPR08MB7154.eurprd08.prod.outlook.com
 ([fe80::2631:ff92:5cd9:3587]) by PAXPR08MB7154.eurprd08.prod.outlook.com
 ([fe80::2631:ff92:5cd9:3587%6]) with mapi id 15.20.7784.020; Mon, 5 Aug 2024
 14:42:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ff951622-5338-11ef-bc03-fd08da9f4363
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=q1KRPWtCaUDxMs0gGOS64gJ6CKI6jVNkuT+hwqnjGzq3IXxeZv8pYD5ULlg/Yn62nFzeERejNXkJUoYD0vG3XCHCgYJVZhm275tY4IZBcwRFvIrq9bkvuoHoNWoZw5GHCH/2oY81/dD7W/M5QpaQ2iSaXVtIKAxlO5vPMUVyduQkZN5l1yssgkij6WssaNXeuCvNgYMWGtPbCocCBlUKv3NIN8bWf4MGUhV1v48mc5QqDwATSG/UWqC3arfS53W2ivuSoJRuRxYj2pn3yHm4VTuHpPoBC0k+pd4Wb3URZvPXkWTBq12uEeHb5iOaJi0U1CYD0xMmQr14EN8yntOsLA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=I5yGcUbzsPK+yakwkAcP1FUQqd6qShahvhgtwtKTMyA=;
 b=L4Z68xxytWFF9KWD0SgYmqeXAVndXQirdzJcIFbIdFwZjUyJh4FcJ6TWqqIROBC0uZgh3amTonJNYTCqz+4/3C0I306bGe2kcYMC28DBDhSkxh2zAhnBzpuvrrotRebIvc0ay1gz8xXgJHyxOHVjvjD8VWUf0PBNf0cuayM6PJbsSxT3hS/dxGreAKifhRTZPvRzloAHcEqim8/n8QpxeYKW8v11xJfvnJFLXb7ct8Zr2Tdj7JwdmCm2PK3c2o004Mkhh5PkGGBBWxeJ+AeFTW5sZ4Z15GuVsf1VWzFB/yIPeOZaBlzdbnGQkQAuxFkZVqEiSkmkOfEcOup6WWGrMw==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com;
 dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com;
 dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=I5yGcUbzsPK+yakwkAcP1FUQqd6qShahvhgtwtKTMyA=;
 b=kGnTM0uXLVlUcvcT1skCaZOLHFDHbmVDT+iCe+bpDj5pBkY9l699eLr5JETmHsvXZ4B/aHjEIHPhifgPjWEgQIJyMBtsNP026zGBPDzk5WLuhoiUJ70EheR+1/6wAaGSxJrKnz7X//AU5sIbSoR9/t2OvcYDklkQwqzYq4Guxrg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 00e9e1b316179ddf
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=n+B4Dp+Q/dHX1SgP/DFCDLtLAh+I6uArswELQHglnrirmt4GNF4x/UxVMnOml7V0XAHZsD9Io4n13N58+qIfjcxJkrV6hLHhkkNJV8ZWLiJkpWsbBzUuSZQp0lpDrecid5QvHZYzBh64yBk0mKJ65tW1Ol+3rwJW+XXAQ5vi+mkURXgXKVaViG6qXR81O3Hjk5mOaDxKu5I3HPc89F26ZHk1RNxyCf9u91Ho+9CHQQb7QXbBCFw/oKdlKinAQIF870uzZJD8BQHQg8H7m65C7Kw4oZgePU3yu6cfgPVN1cT6XLn5zMs2/aZglkvGRM5ZUEqUi5DBT9EWbcljSxwThQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=I5yGcUbzsPK+yakwkAcP1FUQqd6qShahvhgtwtKTMyA=;
 b=QvYfhpdNg9nHCxpJzNI04gCzghlAd/mJGTV8GBeIYFhAkUonej7z+dB8el9bS06GfKKlL6lqfNjCfXQfSxtlK8vG+0Jc8h/II1vdPVzcHOC/1iHYwYpIp6VKXcQbmXbUtVD0UdJFjqGwAEIP93XuTstqdWwcJjDthdPjmkIt1ihkJwO2Agb/97GJ2iW5rCW9jpx7ZMT7uyaw/vpy0zA1pk0Rcd5nm5yCkPDNpYDWe9NgHW4d+SJWj3L6LHxsuY0o0LjsvuOuWKWFf5cfDqqJ01oonG1Et8lnUyNL3VlOZTMrg7pAGs8THO1cjXs4APs8BItZ/3KQV6E1Iu2su8k4tw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=I5yGcUbzsPK+yakwkAcP1FUQqd6qShahvhgtwtKTMyA=;
 b=kGnTM0uXLVlUcvcT1skCaZOLHFDHbmVDT+iCe+bpDj5pBkY9l699eLr5JETmHsvXZ4B/aHjEIHPhifgPjWEgQIJyMBtsNP026zGBPDzk5WLuhoiUJ70EheR+1/6wAaGSxJrKnz7X//AU5sIbSoR9/t2OvcYDklkQwqzYq4Guxrg=
From: Rahul Singh <Rahul.Singh@arm.com>
To: Stewart Hildebrand <Stewart.Hildebrand@amd.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<Bertrand.Marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH] xen/arm: vITS: add #msi-cells property
Thread-Topic: [PATCH] xen/arm: vITS: add #msi-cells property
Thread-Index: AQHa5Qmh1vmjy32rpkCopxzgGZ2sd7IYwTSA
Date: Mon, 5 Aug 2024 14:42:35 +0000
Message-ID: <2D3D5C00-974A-4B2F-9229-44B6F760A9D0@arm.com>
References: <20240802182654.8976-1-stewart.hildebrand@amd.com>
In-Reply-To: <20240802182654.8976-1-stewart.hildebrand@amd.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	PAXPR08MB7154:EE_|DU2PR08MB7341:EE_|DB3PEPF0000885F:EE_|DB9PR08MB9611:EE_
X-MS-Office365-Filtering-Correlation-Id: cb237345-d31f-4a67-e656-08dcb55ce17d
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|366016|1800799024|376014|38070700018;
X-Microsoft-Antispam-Message-Info-Original:
 =?utf-8?B?dWljQ01uRFlkTkY1TlBNc2YwL25kcVlJeGI1bU8vZ3l2UlNCUHVQTkNwWWZV?=
 =?utf-8?B?SzdhTUlTSGxSbTJScGF2NExya0EwWEJUOGNGWTh2RTRQUDA5ZzgxR1E2OG5Y?=
 =?utf-8?B?MFFzek56eVVOY2xpc1ZqbHQ1UExzb1NtOGFkWXpiWVNRck9meUc0Rk41SWpi?=
 =?utf-8?B?Y1VLMjhsbnpsM3dHclRqV2s4VFFFZEFtdWIzc3pkL3hBb1BlSWl5WmYxM1NL?=
 =?utf-8?B?UjlxUkVVd1JQTW9ET3JZSHpCc3ZoZXJweEhZZ0lTdldSdkd1MW1Hayt2S2R4?=
 =?utf-8?B?SCtlanovK244ektxUTZCVTlSL2VSbkJ6TElsWlMxcm41OFFOTTZnTWViY2hW?=
 =?utf-8?B?VUxEU29XblROc0llN3I1S2pBRzZjRFhhZ3BwbmZRK05VM0hEZnRvQ1lHQmdD?=
 =?utf-8?B?NVozeVl1T1hkVDZwbG82VDRTYjFmQTBIOXlONjRjY3dQblBOVXorYlZLZkN3?=
 =?utf-8?B?UUkxUG80aTRDZHZHYUc4YjlBK1Y4SUhJczdxbFRlOUZvaW8rcy9TVEdGbXdJ?=
 =?utf-8?B?eUtuc1FQNmZvWitZVFVraWlvQ21rUXlYZStSZ05aL05nWnEzamZIT3F0TXpJ?=
 =?utf-8?B?L1hnZDhjQzN4UTM2SkRRRU1VVTgvZUcxdnovTnRNM1FpemJPekpZcWd3bEhn?=
 =?utf-8?B?VmdMSDYwaW5SanV6R0pNTFloRTZabTVNRkZYSnlLRVRwUTNkRGRPcFdiTC9I?=
 =?utf-8?B?WmZUT2xVaFFnUlRZa1NJbTRhOFd3KzZod3Z2bEcydHZuV0JMczdsOW9vb3dn?=
 =?utf-8?B?ZmpnUi9qN1oyN29nRDhuTzlGWVduNG1xTnZQcXlpeVl1K1ZCWEcrL1o2WGNU?=
 =?utf-8?B?emFiWE93VnovRG90TnBzamc1bGxnOGZGRHN5a3VlTmx3UUsvU1RLS1ZRYmNF?=
 =?utf-8?B?ejBBQ0Q0akl2ajkxMStzMkJ0dVhsRUNrdDlpUVpQMzkrNmo0eStLbnViUDNB?=
 =?utf-8?B?ek8xdUtLS2RkdWZibUQ0QThWUlJCanowWnpERitoYVZFVGx4cnU5a0c1dHBz?=
 =?utf-8?B?S3JKd3JpOWd4SkZFTlFTTkNtZkxibmphR0JDcUV3RWdOTktndE15UzlxUU5s?=
 =?utf-8?B?bnZzL3d0azF1QzNZOWJHZjE5NUVUVmlrUlQrRys2bXd5akU3ak9RMWhRdVFv?=
 =?utf-8?B?b0ZqWVVxbHpUaHRrUDY0UDlhRVRIeUQ3WUcyUXNzUGVJOFVUbUhDMEVtc2VP?=
 =?utf-8?B?dVdwOFJiSG1QNUpKN2J2c1dBdnYvWFkrVDJsRWlyQ0NwOWtPd3VPb241VVY2?=
 =?utf-8?B?SlpJSEpWVmtEQjdScmxWQWt0MDBGTzFZM0xJdlcwd2JkakptWXN4OXptY1Z3?=
 =?utf-8?B?bGIweWVyMWJmNUFEenVhQklNKzVycHZleXgxSFhQODh5dkZNY1ZmT2VHMjhl?=
 =?utf-8?B?Szk3eDZHNWw1QkNtL25YWWx4dTVQRmwwcnZPTWoxU2hHcW1LRkh1RS95R2FI?=
 =?utf-8?B?azVycXhVUjFVWkJaTWdrRWZZNWY1S0tHd2Y1UVBzV1YvRndWTVB3WmRyYzJH?=
 =?utf-8?B?Z2xJT2FaSDcrRkNJSFJBeEo5QlhJSWMyWlR2VzlBT2EyTm9IM1ExbFNqOFFx?=
 =?utf-8?B?b2FEK1d4NVgyVUl3ZXR5YjdWMncvdmZBM05abFRaNVdqWG96WnQ3R3J4TjBG?=
 =?utf-8?B?N093WkNpUXJVNDlQNGlyVVVQNFdGbStTd1RnVEVjVWNGLzBHd0hRRGtRczlT?=
 =?utf-8?B?OThBV1FUcDdHUFZyUXZOVW0wQnJXd1ExaGYzdVQ1LzhYRUxHTkJYYWFaaWJm?=
 =?utf-8?B?WnY3OXVJL2RmL0dhNC9XS0pISzZPUDFjN3RsVFhCNGRaRWtVMVh5TnBMQXlp?=
 =?utf-8?B?YW82MWc1UTNPUWxuU1VKSG96T3hhZ1RSRjMwbys1RFkzc3dVVWdxQTl3aERG?=
 =?utf-8?B?QTJzay9FYkRSaVFBcHJuOFJ2RnFmWTlRNXVOSCs2bE0yZ2c9PQ==?=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR08MB7154.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(38070700018);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="utf-8"
Content-ID: <F8454B812CBC7B4BB45E101ED5B011FB@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB7341
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-SkipListedInternetSender:
 ip=[2603:10a6:102:207::17];domain=PAXPR08MB7154.eurprd08.prod.outlook.com
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 DB3PEPF0000885F.eurprd02.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	6b5e7f5f-b98b-4e39-28bb-08dcb55cd8a0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|82310400026|35042699022|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?ajNoY0lOMkYxZnkydjIva3hHUDdKNlpSV2lTbnp0YmtvakJON29IYjU3Q21s?=
 =?utf-8?B?ZzV3OUxPR2szZlhON0lBc2YwckNybHNrRENPalhoOWR3NVRXZzJlbER6QWtz?=
 =?utf-8?B?QUdDT2hFTm5GZ1lId3dBYk9HQUpLSTRuYXZjdlFUR2xHbzIycFZTMHMrVXNS?=
 =?utf-8?B?NUdSL2ViK0kxdVBDY0JuOWlvbDArL1c0UjFvRWI4MnRBem9zMnpOWTdHV3VP?=
 =?utf-8?B?Zk43b2U1a3ZBM3VKNmQyQk1KVmdKUXlBR3ZVQnNKbDRNa2ZsQ2RVaCtkdHZo?=
 =?utf-8?B?VGRZZUlmVEJqY3drQnZnZkJ0UHhvRGtDbVUyRFJZazVRS21VVGR1Q01acU85?=
 =?utf-8?B?UCtocWY0VDBLWmU3bUwvSjBsckhhSHB4bTA1NXc3cWtBVkdscXM4Y1lsY3h6?=
 =?utf-8?B?NjdCeE41UlJFZnhRdWZoaVpmT05TRFA2QjE4VG5WZUpONUZ3WURFeGNoZFRm?=
 =?utf-8?B?cEtpMlJYYlBER0d5aWgzOXZiM2M5Y1p0blBKNVkwWDljRzFSTTUvUmZIR0ZX?=
 =?utf-8?B?MktoVkdvZkF4b3VOUVhCK2NDZXI5UElyVTJUUXYvbEE3WkRvMDZ6SWUxSWxG?=
 =?utf-8?B?MlBKclJyUWdlQVFIdHdmRmxLTk5kU29sbE1OK1pFOUlNZThPaDJEcVZUbzVJ?=
 =?utf-8?B?ZWtlbUZ5ZzdRVUxiajhJSFNDeWFDZXBXQzJxalZLMWZhQllDWXpoQ29RMU52?=
 =?utf-8?B?RS9nWnJwTm0xQzBwdnlZL2dzQnlEcnR0alVJSFhINkJyakhGOUs5M3k0UEUr?=
 =?utf-8?B?Z01aLzdpbFR6ZFJCUWNsaFhCa2VoRmVwWnJGU2xuTE05ZDFMKzU2ZXFxTWI4?=
 =?utf-8?B?UXZRczluU011cXpVNmtjaDRRbjJla05iNmdZZ1RqcVFQbDI3TEYrenl6QTh0?=
 =?utf-8?B?cGtqTWRia011R0J6bm1WdXhTbGtJRnVSNVlWUEd1WFNsNThUTmEzTzdocHd3?=
 =?utf-8?B?QS9QbFQzY3gyQmFsbFNvZEFoeFZTbDVyWGJZM0FPaFUwWUs4SzAxR3puc1Va?=
 =?utf-8?B?cDI2QitubmlnWG5iY0hWNEgvc3JFMFdlaUtlcHI2bExCRWd0cGtrSE5WZkZl?=
 =?utf-8?B?cUpHTGZDbzNjNUw4UThCRlcxdE41YmF2QmxOVHUrdzhZK1dpMmtnNUNjZnEz?=
 =?utf-8?B?UTAwcHFFSjFlZXRaM2FkM0hRdklYOVFyUG1ESGFSVHpqeVk1WVRZcStQaTBP?=
 =?utf-8?B?UjRJZzdjZUYvTm8wdkpwNzBZRUh4QmpLRzRxc1VkaURwVjJQMzYrL1dKMjN3?=
 =?utf-8?B?QW55UnBGTjQyTUpDNmFRa1RkUDEyekpjby80U01ZNVU0K3NYVFhLZzJ4WGll?=
 =?utf-8?B?UVl5ZnI4cDVHdHJBOVd5QXBldUIwYzVDeWVXSHovejRlc2tWVklRcEVwcmkz?=
 =?utf-8?B?Mko5clFJUTFiUmU5R1RhbEZ2T1BRdGFHWnNyZ25rYWlmSnJ1SW1qZVMxbjZz?=
 =?utf-8?B?TFBZN1BYN0xELzBHUUFNMnpXZ3RUZ1hSdXZGakk5b2EweGhKWHp5N3c3L3lZ?=
 =?utf-8?B?R2NEZkVEWWhsNVpzaE5sNlNpKzhJbEZFZ0xtS0lCVzJJT3pnYi9hMmxFajJn?=
 =?utf-8?B?dEx3VGlxY0M4Y1lRTDRrN3FwUXluYURuRTRFazdrMnhLVlJRODM1Q3ZDVjFG?=
 =?utf-8?B?c0RFQjMxTFROVkZGbTVYSngxNUFJQUlCZDJnckNOdHQvM2dudnFmT0dIYkJ5?=
 =?utf-8?B?eG1vRjVTbmNQMmdWRjlNeTZhVlhWczZmUU9RQ1FNNjdiOTFpem4yaUhERGlL?=
 =?utf-8?B?eXZja3pENC80U3ZRUi9BU1Z6akl1ZGhWdDFsR25aUFk2U0xVK1RaQmR2Ykc2?=
 =?utf-8?B?elVNby9jdW1ncDNHOEVuNmlUYU1wRWE2Yk85bWFGd2xjUmJDelN2VjdocVB3?=
 =?utf-8?B?ekV1UDkyZkkzVUVxVDIxSk1Rc281NWVrTEZFaWZUdTFZa2M4YWV2Q2VKSld1?=
 =?utf-8?Q?Un/eAlEKTmjIWxeFw65Q27FbloIw1eoz?=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(35042699022)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 14:42:50.4042
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: cb237345-d31f-4a67-e656-08dcb55ce17d
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DB3PEPF0000885F.eurprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB9611

SGkgU3Rld2FydCwNCg0KPiBPbiAyIEF1ZyAyMDI0LCBhdCA3OjI24oCvUE0sIFN0ZXdhcnQgSGls
ZGVicmFuZCA8U3Rld2FydC5IaWxkZWJyYW5kQGFtZC5jb20+IHdyb3RlOg0KPiANCj4gTm9uLVBD
SSBwbGF0Zm9ybSBkZXZpY2VzIG1heSB1c2UgdGhlIElUUy4gRG9tMCBMaW51eCBkcml2ZXJzIGZv
ciBzdWNoDQo+IGRldmljZXMgYXJlIGZhaWxpbmcgdG8gcmVnaXN0ZXIgSVJRcyBkdWUgdG8gYSBt
aXNzaW5nICNtc2ktY2VsbHMNCj4gcHJvcGVydHkuIEFkZCB0aGUgbWlzc2luZyAjbXNpLWNlbGxz
IHByb3BlcnR5Lg0KPiANCj4gU2lnbmVkLW9mZi1ieTogU3Rld2FydCBIaWxkZWJyYW5kIDxzdGV3
YXJ0LmhpbGRlYnJhbmRAYW1kLmNvbT4NCg0KUmV2aWV3ZWQtYnk6IFJhaHVsIFNpbmdoIDxyYWh1
bC5zaW5naEBhcm0uY29tPg0KDQpSZWdhcmRzLA0KUmFodWwNCg0KPiAtLS0NCj4gU2VlIExpbnV4
IGRjNGRhZTAwZDgyZiAoIkRvY3M6IGR0OiBhZGQgI21zaS1jZWxscyB0byBHSUN2MyBJVFMgYmlu
ZGluZyIpDQo+IC0tLQ0KPiB4ZW4vYXJjaC9hcm0vZ2ljLXYzLWl0cy5jIHwgNCArKysrDQo+IDEg
ZmlsZSBjaGFuZ2VkLCA0IGluc2VydGlvbnMoKykNCj4gDQo+IGRpZmYgLS1naXQgYS94ZW4vYXJj
aC9hcm0vZ2ljLXYzLWl0cy5jIGIveGVuL2FyY2gvYXJtL2dpYy12My1pdHMuYw0KPiBpbmRleCA4
YWZjZDk3ODNiYzguLjU1YmVkM2ZlODdkMCAxMDA2NDQNCj4gLS0tIGEveGVuL2FyY2gvYXJtL2dp
Yy12My1pdHMuYw0KPiArKysgYi94ZW4vYXJjaC9hcm0vZ2ljLXYzLWl0cy5jDQo+IEBAIC05NTEs
NiArOTUxLDEwIEBAIGludCBnaWN2M19pdHNfbWFrZV9od2RvbV9kdF9ub2Rlcyhjb25zdCBzdHJ1
Y3QgZG9tYWluICpkLA0KPiAgICAgICAgIGlmICggcmVzICkNCj4gICAgICAgICAgICAgcmV0dXJu
IHJlczsNCj4gDQo+ICsgICAgICAgIHJlcyA9IGZkdF9wcm9wZXJ0eV9jZWxsKGZkdCwgIiNtc2kt
Y2VsbHMiLCAxKTsNCj4gKyAgICAgICAgaWYgKCByZXMgKQ0KPiArICAgICAgICAgICAgcmV0dXJu
IHJlczsNCj4gKw0KPiAgICAgICAgIGlmICggaXRzLT5waGFuZGxlICkNCj4gICAgICAgICB7DQo+
ICAgICAgICAgICAgIHJlcyA9IGZkdF9wcm9wZXJ0eV9jZWxsKGZkdCwgInBoYW5kbGUiLCBpdHMt
PnBoYW5kbGUpOw0KPiANCj4gYmFzZS1jb21taXQ6IDk4NGNiMzE2Y2IyN2I1MzcwNGM2MDdlNjQw
YTdkZDI3NjNiODk4YWINCj4gLS0gDQo+IDIuNDUuMg0KPiANCj4gDQoNCg==


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 15:14:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 15:14:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772235.1182672 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sazPH-0002R9-8W; Mon, 05 Aug 2024 15:13:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772235.1182672; Mon, 05 Aug 2024 15:13:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sazPH-0002R2-4X; Mon, 05 Aug 2024 15:13:55 +0000
Received: by outflank-mailman (input) for mailman id 772235;
 Mon, 05 Aug 2024 15:13: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=006L=PE=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sazPF-0002Qw-Cj
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 15:13:53 +0000
Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com
 [2a00:1450:4864:20::52f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 529e4304-533d-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 17:13:51 +0200 (CEST)
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5ab2baf13d9so14525297a12.2
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 08:13:51 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9c0c0casm459190166b.47.2024.08.05.08.13.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 05 Aug 2024 08:13:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 529e4304-533d-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722870831; x=1723475631; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=7xhTf6UWXOOdVzYrJWJTUCMhvxqpinHthVWY5u00adE=;
        b=nn7jYyTA4N/m26YmJZI8YNVLnPAypPEoNi4ZHU2WXnxd6jEl8qoe3oBzrRV9z7k81G
         tM/SH08fzo8o2eXK8THODL5Fbklv3WuyNH+yZdeKhS0ajD0vlremrzLUdfQzZB0PS1JT
         Umt+kuJOe3dflqeKYaQjCk0InIGHiDhWrNAfoIaO9sp8zrwv2xcEX60FsUfylLPa/ixD
         pMtBsOaPvKdjlkX5d0BpGCPIX6U33wUTGTgpY2mDJdvaJ3bRdNoWBp9rxEDPHwVxzmK2
         a13B4vDjxozg9N5qrVVR5SbOzUzHVe+R8K92TORRt3H7uyPzgFWlh59cSKxiMGAZ7kKc
         JhfQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722870831; x=1723475631;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=7xhTf6UWXOOdVzYrJWJTUCMhvxqpinHthVWY5u00adE=;
        b=TcrzvQ4Ao5W2c/Okpz5marA0Gh+mChaH149+ARlKBUpZO8VAGQNICWbNxXTqbvXJwu
         6N6XZ9dTjjEvtv7+9AhU5Ub7sdjelNcw2fkRPK7Z7Eg+6VCipHILO1j29+IYqus/MJ9U
         zAQqwEfYp72i9wTPjuWnL+z/UvVP1k8KaXuaGDTAS0dmlcQWPP37dL3zDyh0HVqnTE+L
         VwkNkJq0o2OwZV4RvC5p/t7vTFyAvRKv+aLOwEJYqe9Fa1i5sjDMVqqt7bNs3aVTGwJD
         avi2YIMJyDvUEfIX5Ft739wKDdewY4yTjSqnPRNZAXWI1vZM0VFqcSTUkxZlUrpphebp
         zm2A==
X-Forwarded-Encrypted: i=1; AJvYcCWD13qqDAaBZMXMcGe9YWUSz2dsQ+R9o9Irit+z4UdG2QcqE24lG+ZKfqQGa2uSizEGMMmXXocjxtYJnQg2EtMnN/hliZuc7YxM2GcKBnI=
X-Gm-Message-State: AOJu0YzX6OYpudRdWePXFa+w9syn7xibNFAmAwdtmuOSBJBd+38Z9n4l
	Eqi8yFyfbwq9BNUFLwAqFTwjfAQHef6By4KzmrHeDyig6GzgSJXC
X-Google-Smtp-Source: AGHT+IGzT7SDS0Pn+VYIQtBRtr+cZUerl75LbF0dF3QY2kSJalpJBqiegw4B2ZAVpwI3+Salt8tdKg==
X-Received: by 2002:a17:906:730f:b0:a6f:501d:c224 with SMTP id a640c23a62f3a-a7dc5100bbcmr936027766b.57.1722870830785;
        Mon, 05 Aug 2024 08:13:50 -0700 (PDT)
Message-ID: <afbbf9ed7c575e3b2c3f9a668db0b27258822ee0.camel@gmail.com>
Subject: Re: [PATCH v3 4/9] xen/riscv: setup fixmap mapping
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org,
 Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
 <michal.orzel@amd.com>
Date: Mon, 05 Aug 2024 17:13:49 +0200
In-Reply-To: <917cc521-c0c4-49e8-bc40-948679398bc6@suse.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
	 <04576976b82b97442f645b83b3d62475d144af8e.1721834549.git.oleksii.kurochko@gmail.com>
	 <917cc521-c0c4-49e8-bc40-948679398bc6@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Mon, 2024-07-29 at 15:35 +0200, Jan Beulich wrote:
> > +=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0 BUG_ON(pte_is_valid(*pte));
> > +
> > +=C2=A0=C2=A0=C2=A0 tmp =3D paddr_to_pte(LINK_TO_LOAD((unsigned long)&x=
en_fixmap),
> > PTE_TABLE);
>=20
> I'm a little puzzled by the use of LINK_TO_LOAD() (and LOAD_TO_LINK()
> a
> little further up) here. Don't you have functioning __pa() and
> __va()?
Can __pa() and __va() be used in this case?

According to comments for other architectures, these macros are used
for converting between Xen heap virtual addresses (VA) and machine
addresses (MA). I may have misunderstood what is meant by the Xen heap
in this context, but I'm not sure if xen_fixmap[] and page tables are
considered part of the Xen heap.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 15:34:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 15:34:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772244.1182685 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sazjC-0005mI-Oe; Mon, 05 Aug 2024 15:34:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772244.1182685; Mon, 05 Aug 2024 15:34:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sazjC-0005mB-M2; Mon, 05 Aug 2024 15:34:30 +0000
Received: by outflank-mailman (input) for mailman id 772244;
 Mon, 05 Aug 2024 15:34:30 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=006L=PE=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sazjC-0005m5-0o
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 15:34:30 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 336fa4f3-5340-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 17:34:27 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-52efa9500e0so12462284e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 08:34:27 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530bba29fefsm1164111e87.179.2024.08.05.08.34.26
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 05 Aug 2024 08:34:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 336fa4f3-5340-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722872067; x=1723476867; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=LD20EJ+qCgeHjbro+8+iDkgyD+LlruaDhC7VGm1lfR0=;
        b=PwrMTBU0Mju8SKikpzPzoap4HWmTOMarKrfZACe/IHWcX1c5vKowURhEwV1vXzC0Cu
         ZwuahQEEzdPEktFmla2bF3TyofUiYcRw+o/2dC3Z4IwYxDE96XzU4RXBu5A4IphUYTRT
         RP0z49cNGlhn3AxWTVbnUN/39L2Y+QktTzkRwpOPoJclmrWyCcUEqfiyfo/el+1LzK6p
         55D96ukMonL/oBnxOtdZm+1d3Qq9h0fzyJjwWFzr8hp15JfVan3azV+b08rnefH5PAWo
         HYqeWZ5Q1Vri5+DgoNhAo6XhROPT7sPXMoYyYOGYadWQcoEkiZQSr0HRj+LoXZNRNSq/
         jx5A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722872067; x=1723476867;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=LD20EJ+qCgeHjbro+8+iDkgyD+LlruaDhC7VGm1lfR0=;
        b=GuG6UyYRzYGct7U8dYLJv/mjl7/3/Pkq+tT35zMzy4dtm0qlnDr7SN0W+WfPzHOaUh
         Ln1eA2CRGSGoPeOtrli1cK6lMu9yrOMKvH87Vm25ojpfPDzrm7W6N83IzKSqwLE79wq1
         qOWefLP+w/vV8X2qEI0agI14WI3Ko8RqQhkDjEDqokJAB3yfa1xVkVwV5yIPbnIWs0sb
         Cp6GR6juTVfFOZ6331QFSV6fiwbcn2jaQt639RrmrHiBfltAD26TycOvUWyZaG8vsgCz
         6W4inoKuZtuUgAc15HEiOOzZD/aZKbdcDD6Peduc7gvgYLWVMGCDt+39JmQuI/UElStm
         iHFA==
X-Forwarded-Encrypted: i=1; AJvYcCVWS0YBJMq3VWtbKgxZlc6nZzqqlD+Pt0P9KD51cHeBB6ZRFdvqxHGuGliQAJ1+V5Gu50s2ydXHHeLUun7ZuigC8PSkFpSeZq0ZH0D15uw=
X-Gm-Message-State: AOJu0Yyn2GP5YkLr3XpTDK6U/9BRCWfQaDG13febeR8B65/6GJNIUTzu
	XtnkWPCJlIqQkLA66T33cR2G2yTn84AwDyWHQSyJeVuh1z8TXbQn
X-Google-Smtp-Source: AGHT+IHJZs2TDIUGCJCSi4FpUBddaDXYZO6rAGJYpLJUVfVzoUNL33yUCEO8zFolVsSmADKqfXL+ig==
X-Received: by 2002:a05:6512:401d:b0:530:ac6e:ea2f with SMTP id 2adb3069b0e04-530bb39d218mr8442502e87.37.1722872067052;
        Mon, 05 Aug 2024 08:34:27 -0700 (PDT)
Message-ID: <fba675f7256aec1492f8446b0a0716e05bc91c54.camel@gmail.com>
Subject: Re: [PATCH v3 4/9] xen/riscv: setup fixmap mapping
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org,
 Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
 <michal.orzel@amd.com>
Date: Mon, 05 Aug 2024 17:34:25 +0200
In-Reply-To: <afbbf9ed7c575e3b2c3f9a668db0b27258822ee0.camel@gmail.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
	 <04576976b82b97442f645b83b3d62475d144af8e.1721834549.git.oleksii.kurochko@gmail.com>
	 <917cc521-c0c4-49e8-bc40-948679398bc6@suse.com>
	 <afbbf9ed7c575e3b2c3f9a668db0b27258822ee0.camel@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Mon, 2024-08-05 at 17:13 +0200, oleksii.kurochko@gmail.com wrote:
> On Mon, 2024-07-29 at 15:35 +0200, Jan Beulich wrote:
> > > +=C2=A0=C2=A0=C2=A0 }
> > > +
> > > +=C2=A0=C2=A0=C2=A0 BUG_ON(pte_is_valid(*pte));
> > > +
> > > +=C2=A0=C2=A0=C2=A0 tmp =3D paddr_to_pte(LINK_TO_LOAD((unsigned long)=
&xen_fixmap),
> > > PTE_TABLE);
> >=20
> > I'm a little puzzled by the use of LINK_TO_LOAD() (and
> > LOAD_TO_LINK()
> > a
> > little further up) here. Don't you have functioning __pa() and
> > __va()?
> Can __pa() and __va() be used in this case?
>=20
> According to comments for other architectures, these macros are used
> for converting between Xen heap virtual addresses (VA) and machine
> addresses (MA). I may have misunderstood what is meant by the Xen
> heap
> in this context, but I'm not sure if xen_fixmap[] and page tables are
> considered part of the Xen heap.

One more thing: can we use __pa() and __va() in setup_fixmap()?

As I understand it, to define __pa() and __va(), the DIRECTMAP mapping
should be mapped first. However, this requires information about RAM
banks, which is provided in the device tree file. But we can't map
device tree without fixmap. Am I missing something?

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 15:36:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 15:36:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772252.1182694 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sazl4-0006iu-2Q; Mon, 05 Aug 2024 15:36:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772252.1182694; Mon, 05 Aug 2024 15:36:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sazl3-0006in-WC; Mon, 05 Aug 2024 15:36:26 +0000
Received: by outflank-mailman (input) for mailman id 772252;
 Mon, 05 Aug 2024 15:36: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=Prgv=PE=cloud.com=matthew.barnes@srs-se1.protection.inumbo.net>)
 id 1sazl2-0006g7-Jv
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 15:36:24 +0000
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [2a00:1450:4864:20::534])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 787c8cc6-5340-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 17:36:23 +0200 (CEST)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5a156557029so15359430a12.2
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 08:36:23 -0700 (PDT)
Received: from EMEAENGAAD91498.citrite.net ([217.156.233.154])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b839c24084sm5034957a12.30.2024.08.05.08.36.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 05 Aug 2024 08:36:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 787c8cc6-5340-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1722872183; x=1723476983; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=+MMMGxN2ape1bNpYFITLCt9gyz15hVErQ7V7ZB8BCQc=;
        b=MaDZlG7q5pbg3uQC5DOi18/DRTVkVxj9/GYqdKSoMtJEDc1cV/d0n78b84JgjbpdCm
         GPc+hRPYWe/OkfZXgZgplTWtqbQydwIWUk8/lPFZDkRkfMF00i3UNpE28jeckNQ/UBxX
         xHDPfLPrtuCKq4LTw8SuZ3ORO1dHsNmP/na1Q=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722872183; x=1723476983;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=+MMMGxN2ape1bNpYFITLCt9gyz15hVErQ7V7ZB8BCQc=;
        b=h7xCqNdWNLHmZgbGEExv7aW09dwoPoHIJbWR7kTheRzOWbcCYB69h3PnqJFNQRqkfT
         YmZ5R/Sbn75IG9bttki/c6EbnScA0wXvSLZeclY3eGoVbpDBhWihkBDMGfo5mRmgiURv
         G2aJVIh2PkwLH6LRIezDzRsWpLXqYoWFMc2wPDFXGpVjVZpNmmlccbDH7yjD+ElMUKl8
         DSDp9XHGNTvBNVykkHY4gZeYTEAS0JYk70ncRJd/HYRnmMad4Y/vXkZOMoLbMtPx/Gmn
         CL5RIXnCe0zJvd++vy2bGbnODXPSBO6bEP25NPCaVNFii+70kH/QI5gHDNOm/OfU9khe
         A/Vg==
X-Gm-Message-State: AOJu0Yxx0tom3ZWpN/XZzvND+3EuMQAs6O7rqjE1y6rwPk8X3XLm14nW
	tc6qWlUIyvRS9GWPrMtAeG3sBgvX4hO/S3V/FKZPXWGiDVeSiIdAA+ndCk6tpuIm8LHOwJ/m43q
	H
X-Google-Smtp-Source: AGHT+IEaxLbhD+/3nmdFqwJz0D5GFn1XhsnekeUBQTH+EmFNhLQROZ27ebimh8f7yKMhQgbpHmdkUw==
X-Received: by 2002:a50:e602:0:b0:5a2:1b9d:1d3d with SMTP id 4fb4d7f45d1cf-5b7f5414380mr8359471a12.29.1722872182592;
        Mon, 05 Aug 2024 08:36:22 -0700 (PDT)
From: Matthew Barnes <matthew.barnes@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Matthew Barnes <matthew.barnes@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [XEN PATCH] x86/emul: Fix misaligned IO breakpoint behaviour in PV guests
Date: Mon,  5 Aug 2024 16:36:08 +0100
Message-Id: <88d0c78e7fecac79d4ef958962c59836c966cc91.1722871218.git.matthew.barnes@cloud.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Bcc: Matthew Barnes <matthew.barnes@cloud.com>
Content-Transfer-Encoding: 8bit

When hardware breakpoints are configured on misaligned IO ports, the
hardware will mask the addresses based on the breakpoint width during
comparison.

For PV guests, misaligned IO breakpoints do not behave the same way, and
therefore yield different results.

This patch tweaks the emulation of IO breakpoints for PV guests such
that they reproduce the same behaviour as hardware.

Signed-off-by: Matthew Barnes <matthew.barnes@cloud.com>
---
 xen/arch/x86/pv/emul-priv-op.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index f101510a1bab..02901a379b2a 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -324,7 +324,7 @@ static unsigned int check_guest_io_breakpoint(struct vcpu *v,
                                               unsigned int len)
 {
     unsigned int width, i, match = 0;
-    unsigned long start;
+    unsigned long start, debug_mask;
 
     if ( !v->arch.pv.dr7_emul || !(v->arch.pv.ctrlreg[4] & X86_CR4_DE) )
         return 0;
@@ -346,7 +346,9 @@ static unsigned int check_guest_io_breakpoint(struct vcpu *v,
         case DR_LEN_8: width = 8; break;
         }
 
-        if ( (start < (port + len)) && ((start + width) > port) )
+        debug_mask = (~(width - 1u));
+
+        if ( ((start & debug_mask) < (port + len)) && (((start & debug_mask) + width) > port) )
             match |= 1u << i;
     }
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 15:42:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 15:42:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772260.1182705 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sazqM-0008E7-N7; Mon, 05 Aug 2024 15:41:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772260.1182705; Mon, 05 Aug 2024 15:41:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sazqM-0008E0-Iz; Mon, 05 Aug 2024 15:41:54 +0000
Received: by outflank-mailman (input) for mailman id 772260;
 Mon, 05 Aug 2024 15:41:53 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=I4ub=PE=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sazqL-0008Du-CS
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 15:41:53 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3baaa5d5-5341-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 17:41:51 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a7a91cdcc78so569772766b.3
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 08:41:51 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5baff14989fsm2446690a12.55.2024.08.05.08.41.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 05 Aug 2024 08:41:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3baaa5d5-5341-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722872510; x=1723477310; 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=whlPeet9tumQdwGZh3kKRJwNp4fjd104vNOWSO00Izo=;
        b=cD9kdfsaSXwcPq7CYmDzfTqdZro7Yr0J5LiYD1wscJR6davo3M0zIYupJ/e1TSf2e/
         0mM5BrTrbBkMkMhzhHsWfVi7z7airsskXzh5Lwt+K14oaurvSobb6c2aaw34Gu0H82DH
         V6mWzVXXRokFbqcHOt2oCb/+AsbWCV1o8jJ+XscqbSp3jsJ0tOGFRRNMyzqilG/KIrhX
         fbrzKeJ2yTEhhPB7XqssSfQLSr/w9SyDpGmPuLVkyDZqyzERGAZx2czaC15Qb6c3cEi3
         lnsWzMZ/Y79DcSrTthBa9kLqMSMekinLrdU5cyZBbELTCKEoAAfJjOz3GfsztIla8XM8
         0yoA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722872510; x=1723477310;
        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=whlPeet9tumQdwGZh3kKRJwNp4fjd104vNOWSO00Izo=;
        b=lA+cOk0fDltsiGOHc7TnCLkDPm8nkRjZYBERP443/gjQZv+2ls4sUiYqUVa+B6Qo1q
         gfVvQMm2qPpQbfSfZxmLhPCS9+xN/v8z1L6om0KRtTyO+UyYy95qLti+9UA/9gdRvfdm
         7aSPc8xHjEQuTmXIg2Bo8z9wON54N5CTl04lA925dN6ylpfkWPUHBbFTHgrFbwzO7QDQ
         zu5zsG5SdrTFXJaVjNCt2hGwpZuaFQq8bSD994M5fP9lFeySTbeHNhX2lFZZzSDuzkQ7
         WHviT82wTu0m3VJrKhyOFjEVVt+4kvfTg70syVVOP4fph0rhTCMypfhZTdMmXafnzAQh
         ddDQ==
X-Forwarded-Encrypted: i=1; AJvYcCXYKahZb1RYfsS2001XDKwC4iHcRRip+nv1nQP568L96BQ9jbugR74lM2w4/HVm0burXimjvQsnsA60NdssH+Lj8oyod30Ppee8fdE3wI0=
X-Gm-Message-State: AOJu0YyHuSb0kx7rWEAffZwqHf2LDyjbfrONdi3j4NVkb/QXQ58sLZwk
	ZV1w+7lpXijeAmS60lhpiGnEGgEfyZTnLcQTsdQH9ZxNjQuqCGBxzp+ebrIz9Q==
X-Google-Smtp-Source: AGHT+IHnj9s28UqsmVG+caybjitodkmU0CItj/80rhMoOkjyjkq+ajN7bpuRF1b6wisPagLH3syf8g==
X-Received: by 2002:a05:6402:1657:b0:5a1:4f76:1a1b with SMTP id 4fb4d7f45d1cf-5b7f3ad8779mr10437536a12.15.1722872510347;
        Mon, 05 Aug 2024 08:41:50 -0700 (PDT)
Message-ID: <0245feaa-6cf2-4f44-843f-38cdcc6b7a42@suse.com>
Date: Mon, 5 Aug 2024 17:41:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v12 1/3] xen/riscv: enable GENERIC_BUG_FRAME
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1722605952.git.oleksii.kurochko@gmail.com>
 <3d507ce45606d22e9fa07dd6087870c16b5c4a4e.1722605952.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <3d507ce45606d22e9fa07dd6087870c16b5c4a4e.1722605952.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 02.08.2024 15:54, Oleksii Kurochko wrote:
> Enable GENERIC_BUG_FRAME to support BUG(), WARN(), ASSERT,
> and run_in_exception_handler().
> 
> The 0x0000 opcode is used for BUG_INSTR, which, when macros from
> <xen/bug.h> are used, triggers an exception with the
> ILLEGAL_INSTRUCTION cause.
> This opcode is encoded as a 2-byte instruction and is invalid if
> CONFIG_RISCV_ISA_C is enabled or not.

Yes, but there's a caveat: Without the C extension instructions have
to be aligned on 32-bit boundaries. You can't just go and insert a
16-bit item there. When RISCV_ISA_C is not set, I think you want to
insert two such 16-bit zeroes. Beware of an alignment handling bug
in the assembler - don't think of using an alignment directive here.

> Update the commit above the definition of INS_LENGTH_MASK as ebreak

s/commit/comment/?

> --- a/xen/arch/riscv/include/asm/bug.h
> +++ b/xen/arch/riscv/include/asm/bug.h
> @@ -9,7 +9,11 @@
>  
>  #ifndef __ASSEMBLY__
>  
> -#define BUG_INSTR "ebreak"
> +#include <xen/stringify.h>
> +
> +#define BUG_OPCODE  0x0000

You don't really use this other than ...

> +#define BUG_INSTR ".hword " __stringify(BUG_OPCODE)

... here - does this really warrant a separate #define _and_ inclusion of
stringify.h?

Furthermore you want to avoid using .hword (or any data generating
directive), to avoid disturbing disassembly. Please use .insn if at all
possible. I understand though that in certain cases you won't be able to
use .insn. Yet for the common case (more recent binutils) you'd still
better avoid .hword or alike, imo.

> @@ -103,7 +104,29 @@ static void do_unexpected_trap(const struct cpu_user_regs *regs)
>  
>  void do_trap(struct cpu_user_regs *cpu_regs)
>  {
> -    do_unexpected_trap(cpu_regs);
> +    register_t pc = cpu_regs->sepc;
> +    unsigned long cause = csr_read(CSR_SCAUSE);
> +
> +    switch ( cause )
> +    {
> +    case CAUSE_ILLEGAL_INSTRUCTION:
> +        if ( do_bug_frame(cpu_regs, pc) >= 0 )
> +        {
> +            if ( !(is_kernel_text(pc) || is_kernel_inittext(pc)) )
> +            {
> +                printk("Something wrong with PC: %#lx\n", pc);
> +                die();
> +            }
> +
> +            cpu_regs->sepc += GET_INSN_LENGTH(*(uint16_t *)pc);
> +
> +            break;
> +        }
> +
> +    default:

The falling-through here wants annotating, preferably with the pseudo-
keyword.

Jan

> +        do_unexpected_trap(cpu_regs);
> +        break;
> +    }
>  }



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 15:45:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 15:45:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772268.1182714 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sazu0-0000PX-4j; Mon, 05 Aug 2024 15:45:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772268.1182714; Mon, 05 Aug 2024 15:45:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sazu0-0000PQ-22; Mon, 05 Aug 2024 15:45:40 +0000
Received: by outflank-mailman (input) for mailman id 772268;
 Mon, 05 Aug 2024 15:45:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=I4ub=PE=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1saztz-0000PJ-4o
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 15:45:39 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c2dfb6f3-5341-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 17:45:38 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-5af6a1afa63so11957004a12.0
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 08:45:38 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9e83e93sm459814766b.166.2024.08.05.08.45.36
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 05 Aug 2024 08:45:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c2dfb6f3-5341-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722872737; x=1723477537; 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=uTXiuz2E7nzM9sjWOqGHxzR6Zq6rjXqESyWGNGV1XJw=;
        b=ML37ttH0o4YVbi4NiMCGQ43b72Po9BpwQ3Qk/qgjAbcysDK6X4w8x3/2VjXGrSQHmg
         4CDEenJlf/jP+dmino06hISY3LbrRkBMp91t/fgs+TzzHa+hfWFd871C+1FLxn7UZrMR
         a91+oNynAfmuNKw0HgyupzR7GyzLxvUAZfXN/RViL+I1heRZ7QYrzF6p31iAGmDJA+LO
         SZ1ijUHJPIF0nCCUIGYyi3wf4b65bbGluc4WwthATsvMapBsi9qtC4HP4ZXM9MBUQ5wr
         paS1DLYzMliI0ZS0ebUAg9C+B+RjdxOkLFFtqcGAQPwPIysJOfR0qebXrZa89Rc9GVOY
         jIww==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722872737; x=1723477537;
        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=uTXiuz2E7nzM9sjWOqGHxzR6Zq6rjXqESyWGNGV1XJw=;
        b=hAoR9OYydfOJ9dETxBDHGXf40iaJEnGvH8waGEgbpr3Savx08UWL+TEbIIIXYKyKPk
         nLXmq0vRuKaEHuq8dEIkLStbalF8L5cM+zNc0KsQQNaAwCkF/m70Iajkx9FSorNU0dBd
         yQN2Q6j9Wl1NwJRx9nu+pCMq1VEzZkbWar0MM0uT0DVB+VEuIgVQWB9Ler5LwySSK39o
         PC0VwZpXOlnTUj15J+LRFUwrshzow8B2lZjvDf9aKQR2xA0L9DanaQK+ibRttankHYCi
         D7qEriAC+QlfKFoYLUO1XBeeu05ST34Y5aKBcw1A1FLnHPh1flX0WFlsmYDwgk3FPC4X
         Nudw==
X-Forwarded-Encrypted: i=1; AJvYcCVGP4/pZhqDPU3Lq3ktqP0F3IwYRJ6d+NDgXOCbIg+tu/jiWLUQLtjpIzgPf0khxnxloWnuc3rpnee0GIuuCc1YnNH+vPTBYB9me6q4KUE=
X-Gm-Message-State: AOJu0YwCTeNINduBb75LYHx7zimsqcb1cjHjovlGvCtRLZJ2tlJagntQ
	F3pqTct0nsTaYX83jYEBeMvnb92I6qItZR4VDykKAs21gI+dXcfaK89zkuQSZg==
X-Google-Smtp-Source: AGHT+IHg4tnknpAMo2XKplmqlo7xLD7h5Q1ouXahz3QlwrBz/DBSlsgsVh1ZaSlCmQdg892nnUzNVg==
X-Received: by 2002:a17:907:d25:b0:a72:8d40:52b8 with SMTP id a640c23a62f3a-a7dc4db57e9mr934882566b.3.1722872737414;
        Mon, 05 Aug 2024 08:45:37 -0700 (PDT)
Message-ID: <d68f3047-5b12-4802-aac3-bb0b9c76cb08@suse.com>
Date: Mon, 5 Aug 2024 17:45:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 4/9] xen/riscv: setup fixmap mapping
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
 <04576976b82b97442f645b83b3d62475d144af8e.1721834549.git.oleksii.kurochko@gmail.com>
 <917cc521-c0c4-49e8-bc40-948679398bc6@suse.com>
 <afbbf9ed7c575e3b2c3f9a668db0b27258822ee0.camel@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: <afbbf9ed7c575e3b2c3f9a668db0b27258822ee0.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 05.08.2024 17:13, oleksii.kurochko@gmail.com wrote:
> On Mon, 2024-07-29 at 15:35 +0200, Jan Beulich wrote:
>>> +    }
>>> +
>>> +    BUG_ON(pte_is_valid(*pte));
>>> +
>>> +    tmp = paddr_to_pte(LINK_TO_LOAD((unsigned long)&xen_fixmap),
>>> PTE_TABLE);
>>
>> I'm a little puzzled by the use of LINK_TO_LOAD() (and LOAD_TO_LINK()
>> a
>> little further up) here. Don't you have functioning __pa() and
>> __va()?
> Can __pa() and __va() be used in this case?
> 
> According to comments for other architectures, these macros are used
> for converting between Xen heap virtual addresses (VA) and machine
> addresses (MA). I may have misunderstood what is meant by the Xen heap
> in this context, but I'm not sure if xen_fixmap[] and page tables are
> considered part of the Xen heap.

I didn't check Arm, but on x86 virt_to_maddr() (underlying __pa()) has
special case code to also allow addresses within the Xen image (area).

Jan



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 15:48:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 15:48:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772279.1182725 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sazwd-0001kg-KE; Mon, 05 Aug 2024 15:48:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772279.1182725; Mon, 05 Aug 2024 15:48:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sazwd-0001kZ-HU; Mon, 05 Aug 2024 15:48:23 +0000
Received: by outflank-mailman (input) for mailman id 772279;
 Mon, 05 Aug 2024 15:48:21 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=I4ub=PE=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sazwb-0001kQ-Qj
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 15:48:21 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2334df70-5342-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 17:48:19 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-5a20de39cfbso13631262a12.1
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 08:48:19 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bb88d1d9a3sm1683960a12.26.2024.08.05.08.48.18
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 05 Aug 2024 08:48:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2334df70-5342-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722872899; x=1723477699; 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=8pwD5E1cYfrRyZTIXFKA990Wqf+kRr0bcG+ogXOoR4g=;
        b=cS4D18ZsMXM39PLvqSWv9z62jyQ949nbL8uszvQg5tzWI4lRY0OFUycMFJTmgvuiuq
         ael00YyQrY9E8i29T9RwPwvnF0H2WcVAhXJJyUqEmEMSpdhE3xehUzPA48elqZ8vDYOZ
         6TiMWA0pp1XVZL32oriW2IwNdQIcmV91XxGzhAh5L6flwJc0bmAs9A1YhPWzYt0hVesA
         OItmtSNygg5h7WBajVCDRWjxM6N856IYPim0MKaxBVJewh81e7+WIk64K09xhSTn0Feq
         kUo3+sBgCTeT5f99JwqaARiAsBDv4K9CPW7k18uH2sEsbZMaPJwU+1mc8EvLBODWMxUO
         OkxQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722872899; x=1723477699;
        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=8pwD5E1cYfrRyZTIXFKA990Wqf+kRr0bcG+ogXOoR4g=;
        b=NckwEDn2Ms3rYdgqodIrokUc2wxQ0eRtBEK/ZqNPMIrkt5zIjfdfZQjQbsWSOvxx0a
         CBTlqV3JUjjzw4UayOZmkuCuK/jxRezNsix134YfgdIuaKBwcwNhxZoTLVDUMytk6r5s
         2zcbHtD8deveMQ41wTQsuvcL3UOfPP7eCPB8+z0qBvXVs83CTiaUd+cBiXS2Fgucp8HL
         +ibNrlBvLx4Lmql3BIIiRIO5Oiie5oneLOXmDqf0p3sLMgL9ruFL21rTLpeWAEkHtebn
         joouEYEhCO2mAO6o+J4URue8qvt/W3WbO5y8XTZ59xV4PQ3E4cKEtrHqWd3Yk8Dzrn7g
         HyRA==
X-Forwarded-Encrypted: i=1; AJvYcCW/IuOjp+3AKaColzIX6ptWKNTuYfQZl9DxHH1YZbL66hfuP9XUJrea9q0KtF98VMEsxAbM7YqVUQMp+VTsj5XK9/gYJ3QCCr+r04dPfmk=
X-Gm-Message-State: AOJu0YwxjiFj/iMcDERM/PFrt1sL+fRUksxQ1REg4zocZiaKboaQ2hMq
	Jqe0XEy5er0aYJ/C1oz1CZ2JrGQYPX7we7BxOwM628MEoDpwyGN/0gUqmEI4kg==
X-Google-Smtp-Source: AGHT+IGEkH1gwSSLrASEw6niAb06QoExu7GdG0CZmsneVvOpYe58inqevJFIWvsuBRV0h7vDTlc5iA==
X-Received: by 2002:a50:ed08:0:b0:5a3:af31:9ae4 with SMTP id 4fb4d7f45d1cf-5b7f36f58ccmr9734335a12.5.1722872898989;
        Mon, 05 Aug 2024 08:48:18 -0700 (PDT)
Message-ID: <85bf5a08-9d47-4f9f-b1e8-ca12e610f393@suse.com>
Date: Mon, 5 Aug 2024 17:48:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 4/9] xen/riscv: setup fixmap mapping
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
 <04576976b82b97442f645b83b3d62475d144af8e.1721834549.git.oleksii.kurochko@gmail.com>
 <917cc521-c0c4-49e8-bc40-948679398bc6@suse.com>
 <afbbf9ed7c575e3b2c3f9a668db0b27258822ee0.camel@gmail.com>
 <fba675f7256aec1492f8446b0a0716e05bc91c54.camel@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: <fba675f7256aec1492f8446b0a0716e05bc91c54.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 05.08.2024 17:34, oleksii.kurochko@gmail.com wrote:
> On Mon, 2024-08-05 at 17:13 +0200, oleksii.kurochko@gmail.com wrote:
>> On Mon, 2024-07-29 at 15:35 +0200, Jan Beulich wrote:
>>>> +    }
>>>> +
>>>> +    BUG_ON(pte_is_valid(*pte));
>>>> +
>>>> +    tmp = paddr_to_pte(LINK_TO_LOAD((unsigned long)&xen_fixmap),
>>>> PTE_TABLE);
>>>
>>> I'm a little puzzled by the use of LINK_TO_LOAD() (and
>>> LOAD_TO_LINK()
>>> a
>>> little further up) here. Don't you have functioning __pa() and
>>> __va()?
>> Can __pa() and __va() be used in this case?
>>
>> According to comments for other architectures, these macros are used
>> for converting between Xen heap virtual addresses (VA) and machine
>> addresses (MA). I may have misunderstood what is meant by the Xen
>> heap
>> in this context, but I'm not sure if xen_fixmap[] and page tables are
>> considered part of the Xen heap.
> 
> One more thing: can we use __pa() and __va() in setup_fixmap()?
> 
> As I understand it, to define __pa() and __va(), the DIRECTMAP mapping
> should be mapped first. However, this requires information about RAM
> banks, which is provided in the device tree file. But we can't map
> device tree without fixmap. Am I missing something?

Depends on further plans. In principle VA <-> PA translation within the
directmap range and within the Xen image range is purely arithmetic, not
requiring any mappings to have been established. You don't access any
of the referenced memory in the course of doing the translation, after
all.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 16:00:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 16:00:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772288.1182735 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb08f-0005PL-Ju; Mon, 05 Aug 2024 16:00:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772288.1182735; Mon, 05 Aug 2024 16:00:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb08f-0005PE-HM; Mon, 05 Aug 2024 16:00:49 +0000
Received: by outflank-mailman (input) for mailman id 772288;
 Mon, 05 Aug 2024 16:00:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sb08e-0005P4-TB; Mon, 05 Aug 2024 16:00:48 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sb08e-0003yu-Ms; Mon, 05 Aug 2024 16:00:48 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sb08e-0005ai-4U; Mon, 05 Aug 2024 16:00:48 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sb08e-0004BC-41; Mon, 05 Aug 2024 16:00:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=WUAk0G6ZtT9op6Ovwp2eJK7MyzUP6u5giMGQvKJLXZ0=; b=bE1a9UgUyxpjnf3vQKmRkNGhc7
	deIoxYiF77o3ujqyoldk+sBAbiq07Q1C2Uu/8dVgUYm9ba6Ov0RTjtwUp3iIFTwEi9Ry0uZuluZv8
	t5C6JrUOxPGyFUfx97NmEEW9bWg0Csj3ySriUvNGrLNvIXgpvsTAdv0RPJMS4+PZDalU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187157-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187157: regressions - FAIL
X-Osstest-Failures:
    xen-unstable-smoke:build-armhf:xen-build:fail:regression
    xen-unstable-smoke:test-armhf-armhf-xl:build-check(1):blocked:nonblocking
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=bec25f11d5180d407cf04d2de2525fa6f876bde1
X-Osstest-Versions-That:
    xen=ded5474718a84366dac80aae039a693b66fa7e2e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 05 Aug 2024 16:00:48 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-armhf                   6 xen-build                fail REGR. vs. 187127

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl           1 build-check(1)               blocked  n/a
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  bec25f11d5180d407cf04d2de2525fa6f876bde1
baseline version:
 xen                  ded5474718a84366dac80aae039a693b66fa7e2e

Last test of basis   187127  2024-08-02 22:02:05 Z    2 days
Failing since        187154  2024-08-05 09:02:05 Z    0 days    2 attempts
Testing same since   187157  2024-08-05 13:12:16 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Roger Pau Monné <roger.pau@citrix.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  fail    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          blocked 
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


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

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

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

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


Not pushing.

------------------------------------------------------------
commit bec25f11d5180d407cf04d2de2525fa6f876bde1
Author: Jan Beulich <jbeulich@suse.com>
Date:   Mon Aug 5 12:55:37 2024 +0200

    Revert "x86/dom0: delay setting SMAP after dom0 build is done"
    
    This reverts commit ac6b9309694de9b2b5163886656282f6ada71565. The
    change crashes Xen on boot on SMAP-capable systems.

commit ac6b9309694de9b2b5163886656282f6ada71565
Author: Roger Pau Monné <roger.pau@citrix.com>
Date:   Mon Aug 5 10:18:05 2024 +0200

    x86/dom0: delay setting SMAP after dom0 build is done
    
    Delay setting X86_CR4_SMAP on the BSP until the domain building is done, so
    that there's no need to disable SMAP.  Note however that SMAP is enabled for
    the APs on bringup, as domain builder code strictly run on the BSP.  Delaying
    the setting for the APs would mean having to do a callfunc IPI later in order
    to set it on all the APs.
    
    The fixes tag is to account for the wrong usage of cpu_has_smap in
    create_dom0(), it should instead have used
    boot_cpu_has(X86_FEATURE_XEN_SMAP).
    
    While there also make cr4_pv32_mask __ro_after_init.
    
    Fixes: 493ab190e5b1 ('xen/sm{e, a}p: allow disabling sm{e, a}p for Xen itself')
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>

commit d81dd31303513a1626973778d557a6493d86511a
Author: Roger Pau Monné <roger.pau@citrix.com>
Date:   Mon Aug 5 10:16:54 2024 +0200

    x86/shutdown: change default reboot method preference
    
    The current logic to chose the preferred reboot method is based on the mode Xen
    has been booted into, so if the box is booted from UEFI, the preferred reboot
    method will be to use the ResetSystem() run time service call.
    
    However, that method seems to be widely untested, and quite often leads to a
    result similar to:
    
    Hardware Dom0 shutdown: rebooting machine
    ----[ Xen-4.18-unstable  x86_64  debug=y  Tainted:   C    ]----
    CPU:    0
    RIP:    e008:[<0000000000000017>] 0000000000000017
    RFLAGS: 0000000000010202   CONTEXT: hypervisor
    [...]
    Xen call trace:
       [<0000000000000017>] R 0000000000000017
       [<ffff83207eff7b50>] S ffff83207eff7b50
       [<ffff82d0403525aa>] F machine_restart+0x1da/0x261
       [<ffff82d04035263c>] F apic_wait_icr_idle+0/0x37
       [<ffff82d040233689>] F smp_call_function_interrupt+0xc7/0xcb
       [<ffff82d040352f05>] F call_function_interrupt+0x20/0x34
       [<ffff82d04033b0d5>] F do_IRQ+0x150/0x6f3
       [<ffff82d0402018c2>] F common_interrupt+0x132/0x140
       [<ffff82d040283d33>] F arch/x86/acpi/cpu_idle.c#acpi_idle_do_entry+0x113/0x129
       [<ffff82d04028436c>] F arch/x86/acpi/cpu_idle.c#acpi_processor_idle+0x3eb/0x5f7
       [<ffff82d04032a549>] F arch/x86/domain.c#idle_loop+0xec/0xee
    
    ****************************************
    Panic on CPU 0:
    FATAL TRAP: vector = 6 (invalid opcode)
    ****************************************
    
    Which in most cases does lead to a reboot, however that's unreliable.
    
    Change the default reboot preference to prefer ACPI over UEFI if available and
    not in reduced hardware mode.
    
    This is in line to what Linux does, so it's unlikely to cause issues on current
    and future hardware, since there's a much higher chance of vendors testing
    hardware with Linux rather than Xen.
    
    Add a special case for one Acer model that does require being rebooted using
    ResetSystem().  See Linux commit 0082517fa4bce for rationale.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
    Acked-By: Oleksii Kurochko <oleksii.kurochko@gmail.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 16:02:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 16:02:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772298.1182745 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb0AS-0005xw-Ux; Mon, 05 Aug 2024 16:02:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772298.1182745; Mon, 05 Aug 2024 16:02:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb0AS-0005xp-SJ; Mon, 05 Aug 2024 16:02:40 +0000
Received: by outflank-mailman (input) for mailman id 772298;
 Mon, 05 Aug 2024 16:02:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=006L=PE=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sb0AS-0005xj-7n
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 16:02:40 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 23909ace-5344-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 18:02:39 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-a7a9cf7d3f3so1307008666b.1
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 09:02:39 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9d437f5sm462243566b.125.2024.08.05.09.02.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 05 Aug 2024 09:02:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 23909ace-5344-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722873759; x=1723478559; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=6yxsVWFOrJPfBxYTPcsTdHoghvDcDOv2KcXLSMOwrA8=;
        b=INbIjSC63SiKLzT1KKMPn7lsxnCWMSUWQrZ6BaSqgT/N/Lv0aVei/sH1AITF5Yinqr
         5+atsBqtgYR8B948GBqxEVRvUG45JVxXYJG2K0Ve/KeDLPF2cLimFau7n166zphtLPva
         726qM1ocYqARZtS31DWsxCaeAALPJDu+UZo9w9f+R3huQXK3qFMUxz8tfPv5keNPXXL5
         ZFG11GDN0WAjypAhJBIUsTig+CXeoZQG2eHgYgpgeRjdFFQSgmPott0+onWHNXHlifZK
         vU2pWTnQnldltkkp3xRCWi6bzbhR7C9VeB9DG935Xh1yeGptLRWK+6UdXt9I/e4wiRjK
         VsGw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722873759; x=1723478559;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=6yxsVWFOrJPfBxYTPcsTdHoghvDcDOv2KcXLSMOwrA8=;
        b=oI6qHpwD0GGQ3YcO571O4FQsEqqInZsTk6JJOnehYWg2zkqovP2gaf81KaChhPPmU9
         kvfo1KobBHTnPOB5npYBiAdeWOI7TwJUmb1mwenqWSWn3QUymMiuW+JqhNbimlpE0fls
         GHt0htTFdvwuxx7HB3Qz1vZcKgETrQrrZJQkkpIiSyVkOBbGGP41paMMu/IgqrKNkogb
         ck9WHz3gw3Fn2Jcn969nt43od+jnb9Btt33QwyA8B/7QQSx2iIUGGSAg6/5XjyLv+irp
         B52mBUd5J+IhCLGWEwjrnTt0RGdxLKj3NhXiX6jJaW3BfeilBN/UANE7w2tgUU4LrfRj
         LOyg==
X-Forwarded-Encrypted: i=1; AJvYcCXNuNnroWTW0OXnibgB/LyGaYQa72KD/1jbeHuWLtIu3GU0N1JwDWrhHw/AATJWWUlKVwHocM15loq3tnKco5Sp5vwJIojpPV2+MWvn3UE=
X-Gm-Message-State: AOJu0YxOPDtdPuy682vO4aAv1eWFLYeS/TTUZWcu5Tls0taEPf1PI2w3
	F/6QFJjwLALDrvPKlXrozf/hxWj0fCMYZEIWDqUzLQwfiftgUd2y
X-Google-Smtp-Source: AGHT+IGrDFDLwlyVSKXwOtYEYDVh01p6oxiQoUDhxPfSIJQtJcgkWxhNoBHx/HiPe24S59GYgS2ZVg==
X-Received: by 2002:a17:907:7d94:b0:a77:cd51:3b32 with SMTP id a640c23a62f3a-a7dc51600b4mr860203466b.62.1722873758297;
        Mon, 05 Aug 2024 09:02:38 -0700 (PDT)
Message-ID: <ca7ba33e8314d776a1c7928730ab58eeec58dde7.camel@gmail.com>
Subject: Re: [PATCH v3 4/9] xen/riscv: setup fixmap mapping
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org,
 Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
 <michal.orzel@amd.com>
Date: Mon, 05 Aug 2024 18:02:36 +0200
In-Reply-To: <d68f3047-5b12-4802-aac3-bb0b9c76cb08@suse.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
	 <04576976b82b97442f645b83b3d62475d144af8e.1721834549.git.oleksii.kurochko@gmail.com>
	 <917cc521-c0c4-49e8-bc40-948679398bc6@suse.com>
	 <afbbf9ed7c575e3b2c3f9a668db0b27258822ee0.camel@gmail.com>
	 <d68f3047-5b12-4802-aac3-bb0b9c76cb08@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Mon, 2024-08-05 at 17:45 +0200, Jan Beulich wrote:
> On 05.08.2024 17:13, oleksii.kurochko@gmail.com=C2=A0wrote:
> > On Mon, 2024-07-29 at 15:35 +0200, Jan Beulich wrote:
> > > > +=C2=A0=C2=A0=C2=A0 }
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 BUG_ON(pte_is_valid(*pte));
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 tmp =3D paddr_to_pte(LINK_TO_LOAD((unsigned
> > > > long)&xen_fixmap),
> > > > PTE_TABLE);
> > >=20
> > > I'm a little puzzled by the use of LINK_TO_LOAD() (and
> > > LOAD_TO_LINK()
> > > a
> > > little further up) here. Don't you have functioning __pa() and
> > > __va()?
> > Can __pa() and __va() be used in this case?
> >=20
> > According to comments for other architectures, these macros are
> > used
> > for converting between Xen heap virtual addresses (VA) and machine
> > addresses (MA). I may have misunderstood what is meant by the Xen
> > heap
> > in this context, but I'm not sure if xen_fixmap[] and page tables
> > are
> > considered part of the Xen heap.
>=20
> I didn't check Arm, but on x86 virt_to_maddr() (underlying __pa())
> has
> special case code to also allow addresses within the Xen image
> (area).

Yes, it is true for __virt_to_maddr:
   static inline unsigned long __virt_to_maddr(unsigned long va)
   {
       ASSERT(va < DIRECTMAP_VIRT_END);
       if ( va >=3D DIRECTMAP_VIRT_START )
           va -=3D DIRECTMAP_VIRT_START;
       else
       {
           BUILD_BUG_ON(XEN_VIRT_END - XEN_VIRT_START !=3D GB(1));
           /* Signed, so ((long)XEN_VIRT_START >> 30) fits in an imm32. */
           ASSERT(((long)va >> (PAGE_ORDER_1G + PAGE_SHIFT)) =3D=3D
                  ((long)XEN_VIRT_START >> (PAGE_ORDER_1G + PAGE_SHIFT)));
  =20
           va +=3D xen_phys_start - XEN_VIRT_START;
       }
       return (va & ma_va_bottom_mask) |
              ((va << pfn_pdx_hole_shift) & ma_top_mask);
   }
  =20
But in case of __maddr_to_virt ( __va() ) it is using directmap region:
   static inline void *__maddr_to_virt(unsigned long ma)
   {
       ASSERT(pfn_to_pdx(ma >> PAGE_SHIFT) < (DIRECTMAP_SIZE >>
   PAGE_SHIFT));
       return (void *)(DIRECTMAP_VIRT_START +
                       ((ma & ma_va_bottom_mask) |
                        ((ma & ma_top_mask) >> pfn_pdx_hole_shift)));
   }

But I have to use both __va() and __pa().
__va() inside cycle to find L1 page table:

    for ( i =3D HYP_PT_ROOT_LEVEL; i-- > 1; )
    {
        BUG_ON(!pte_is_valid(*pte));

        pte =3D (pte_t *)LOAD_TO_LINK(pte_to_paddr(*pte));
        pte =3D &pte[pt_index(i, FIXMAP_ADDR(0))];
    }

__pa() to set a physical address of L0 page table:
    tmp =3D paddr_to_pte(LINK_TO_LOAD((unsigned long)&xen_fixmap),
PTE_TABLE);
    write_pte(pte, tmp);


~ Oleksii


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 16:08:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 16:08:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772308.1182754 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb0Fg-0007GX-GM; Mon, 05 Aug 2024 16:08:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772308.1182754; Mon, 05 Aug 2024 16:08:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb0Fg-0007GQ-Dp; Mon, 05 Aug 2024 16:08:04 +0000
Received: by outflank-mailman (input) for mailman id 772308;
 Mon, 05 Aug 2024 16:08:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=I4ub=PE=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sb0Ff-0007GK-Mb
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 16:08:03 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e45d98f3-5344-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 18:08:02 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a7ac469e4c4so987526766b.0
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 09:08:02 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc96c8b49sm465315166b.0.2024.08.05.09.08.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 05 Aug 2024 09:08:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e45d98f3-5344-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722874082; x=1723478882; 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=9BeLD2yw9ngxAoRu/G9OxnIu35gemIMBK0FkFDCdWeE=;
        b=U5epyj7GIdkz90GPvu0m0mzcxRHOPg/ufM3KdhsGXoelAGztW41KYhMcsQmcNk31ce
         F8l8pwLTd9cWKguCvsg/r+PeLmL4QRUae+5I5fddUMLEXNs0WEFknDcxHzi/jER5eMSV
         gwgUHl1V96jN8e9bB/ZSgHwvN2VH0DDCDAwj+EVDzeIXgfSjkSA2OD/etiYUMC39nffa
         25UKivBGZlyGKbmGJoCq/iUSYaoM7QbMmEg++dyDht9hN9AauW7L/iQMiYOqtZryjSWq
         /Zul1d76bgqsVs2BNLef8kDMiMs9roHvCPobhXnGHfdcdWDlrMlxcC/uPqTR0sbvITnf
         sOLA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722874082; x=1723478882;
        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=9BeLD2yw9ngxAoRu/G9OxnIu35gemIMBK0FkFDCdWeE=;
        b=tsQD8hFAZl3KEEcj8t+VLGlvsEQOaCv1dSdp3/cqR8lDFbjgN9JKfRRd38YWONQgUm
         hDnzQMPLPjK/E8c7i5DjpCZf7tC+nWKW8+MU8lJOJsrG4RxAzjLmuK6K0uKN1tCzlD6K
         8Yctdp2uCsPcvwgGO7Hk3CzbjzYS1cggcIBR8p/LcsSHU7kM7vEDN0uub00RVGAWJsyI
         Wf7Ndo1iR2c4bvH4nErTGqRdJU1LrArzmOveJBlfzodMpGgixHpvFJOMIFBnyj/0pEDK
         3CfKluvZYKnWOi5GbDxguV8REcbulY71gQjbrQeosadByh4hX2zNUOIxNco43rso+EOp
         PvYQ==
X-Forwarded-Encrypted: i=1; AJvYcCUixuXJ/IdYmmsrPux9hWGzN6NWLMugbW5xb/BzSYuHun9XsyaFfar0D1m5gy9hDoimZtx9BpWrOUY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwL3kKE3ulk9Wl9n6WyNdY04zsFr0ujjt+7anIoF3Kftg3Jiaii
	Ex67etfFWTw0tEp7Y9Ev2Cpfp3sd4DuJJfc+eoAqsfoyqdRs87fY6NSdwMgosw==
X-Google-Smtp-Source: AGHT+IFioB2f2YKEN+6Pnqo4hgrKxU+KZGVoIoSjD0yYTI+w/zkAcZpv0S8ZB/dxwdEB7Oa4jKUUrw==
X-Received: by 2002:a17:907:868d:b0:a77:cdae:6a59 with SMTP id a640c23a62f3a-a7dbe6302e4mr1144738466b.21.1722874082007;
        Mon, 05 Aug 2024 09:08:02 -0700 (PDT)
Message-ID: <d9440569-037e-4b8e-b092-250c5eb569bc@suse.com>
Date: Mon, 5 Aug 2024 18:08:01 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH] x86/emul: Fix misaligned IO breakpoint behaviour in
 PV guests
To: Matthew Barnes <matthew.barnes@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <88d0c78e7fecac79d4ef958962c59836c966cc91.1722871218.git.matthew.barnes@cloud.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: <88d0c78e7fecac79d4ef958962c59836c966cc91.1722871218.git.matthew.barnes@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 05.08.2024 17:36, Matthew Barnes wrote:
> When hardware breakpoints are configured on misaligned IO ports, the
> hardware will mask the addresses based on the breakpoint width during
> comparison.
> 
> For PV guests, misaligned IO breakpoints do not behave the same way, and
> therefore yield different results.
> 
> This patch tweaks the emulation of IO breakpoints for PV guests such
> that they reproduce the same behaviour as hardware.
> 
> Signed-off-by: Matthew Barnes <matthew.barnes@cloud.com>

No Fixes: tag?

> --- a/xen/arch/x86/pv/emul-priv-op.c
> +++ b/xen/arch/x86/pv/emul-priv-op.c
> @@ -324,7 +324,7 @@ static unsigned int check_guest_io_breakpoint(struct vcpu *v,
>                                                unsigned int len)
>  {
>      unsigned int width, i, match = 0;
> -    unsigned long start;
> +    unsigned long start, debug_mask;
>  
>      if ( !v->arch.pv.dr7_emul || !(v->arch.pv.ctrlreg[4] & X86_CR4_DE) )
>          return 0;
> @@ -346,7 +346,9 @@ static unsigned int check_guest_io_breakpoint(struct vcpu *v,
>          case DR_LEN_8: width = 8; break;
>          }
>  
> -        if ( (start < (port + len)) && ((start + width) > port) )
> +        debug_mask = (~(width - 1u));

Maybe simply alter "start" directly:

        start &= ~(width - 1UL);

I've switched to making the resulting mask an unsigned long quantity at the
same time, as I don't think we ought to masking off the top 32 bits.

Then ...

> +        if ( ((start & debug_mask) < (port + len)) && (((start & debug_mask) + width) > port) )

... I also won't need to complain that this line now is too long.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 16:14:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 16:14:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772317.1182764 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb0Lu-0000OD-AJ; Mon, 05 Aug 2024 16:14:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772317.1182764; Mon, 05 Aug 2024 16:14:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb0Lu-0000O4-7S; Mon, 05 Aug 2024 16:14:30 +0000
Received: by outflank-mailman (input) for mailman id 772317;
 Mon, 05 Aug 2024 16:14:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=I4ub=PE=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sb0Lt-0000Ny-2C
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 16:14:29 +0000
Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com
 [2a00:1450:4864:20::52f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c9a4b5ff-5345-11ef-bc03-fd08da9f4363;
 Mon, 05 Aug 2024 18:14:27 +0200 (CEST)
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5a3b866ebc9so14982991a12.3
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 09:14:27 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9c0b8e7sm470139366b.72.2024.08.05.09.14.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 05 Aug 2024 09:14:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c9a4b5ff-5345-11ef-bc03-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722874467; x=1723479267; 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=eCAKDuUU/1wCeEvBVVMiSsFmNNuG6C0f0pjIPN8QTgA=;
        b=WkCl3PVoQKJmLEgCicvbsM/oy3zCaEFLNWE9yj2swil5tV73sVzGTxPKVMUxfxHobr
         vge0lnxolW8qFv/GtbYVy1kGKrSGz2h7D2D/cCfrj7MkPSgLvOFCCq2xbH/grKQzHURF
         waF4BWwybtZQqVLQUjjaq8TwAO5anB+U/kjriRoHsrzzVlX+qoV98FOOvpKTICQIDmB4
         yWGylzzKycrzUFb3yCAcbW8K47S28359e/gSjU168FVGM+AwvBA2wszJdafOsUL+uWOx
         2k+nLjgsJuLAIdkRqCCuk9yZHhmuvLqkDSqhDsGUsVk74UePMHW5H13ChL0THnQ/teyw
         /wuQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722874467; x=1723479267;
        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=eCAKDuUU/1wCeEvBVVMiSsFmNNuG6C0f0pjIPN8QTgA=;
        b=JsAFY5fBLSzFlBnvTyWcI4849W9uGnlLyACeNTDT9rYVI2qXH0xwRQKiulsSTMd6SB
         vdSultmWiF7xT2ovTNANROtLeEz90BBPFytYVS63okge/T71/1Gk8uWmBtgz+60sLFxx
         NgiWMhvGiK/dr+q8fkayIjFUDiPiy1zgWiOYXCHvKcOgUigvpFqEKEyQfNhpM+ockGiR
         2OujS9S5VwFdguwusxDcKpIBiRqh7N+a0rpVkiCB93dfM+/AM+gbibp+nJqYs+RcQ0Kp
         NCt33FWDg6714L3kIGfhlzPryYFymszBNDAjiK35RmGAof1tFgXsSgmGQ2x0z82D7VOd
         9p7Q==
X-Forwarded-Encrypted: i=1; AJvYcCXs5ZoW9zaDuDZ9GcMdxdH8WtVlQzBwnATuSKV7/14Bjvhnz7drISN4DEbMeGiecZFfxvhDSG20Lmq/ZPpq1FvIZ/+RszpAn5PxVosJaJ0=
X-Gm-Message-State: AOJu0YxNWi0IpBIYeyTSjQKxXqXiw5lpXkO4JAFfS+etIPVKIJiMxHeL
	ngJLKu46/FTL+Ij3qdqea1/JjCorGVWwy4ZQzO53HWNzR/x4BCjA+h4Mf+LQrw==
X-Google-Smtp-Source: AGHT+IFlIEuXyh4sZj8FmIr3FWs4tk3XG1Pmb+2A4p/f2pKoIT7/aQ3k+1srIdaztu2N6BuNC3ij0g==
X-Received: by 2002:a17:906:7314:b0:a7a:af5d:f313 with SMTP id a640c23a62f3a-a7dc4faba47mr886307666b.22.1722874466713;
        Mon, 05 Aug 2024 09:14:26 -0700 (PDT)
Message-ID: <35b277c6-8715-4c5b-b82d-ae29bbac8643@suse.com>
Date: Mon, 5 Aug 2024 18:14:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 4/9] xen/riscv: setup fixmap mapping
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
 <04576976b82b97442f645b83b3d62475d144af8e.1721834549.git.oleksii.kurochko@gmail.com>
 <917cc521-c0c4-49e8-bc40-948679398bc6@suse.com>
 <afbbf9ed7c575e3b2c3f9a668db0b27258822ee0.camel@gmail.com>
 <d68f3047-5b12-4802-aac3-bb0b9c76cb08@suse.com>
 <ca7ba33e8314d776a1c7928730ab58eeec58dde7.camel@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: <ca7ba33e8314d776a1c7928730ab58eeec58dde7.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 05.08.2024 18:02, oleksii.kurochko@gmail.com wrote:
> On Mon, 2024-08-05 at 17:45 +0200, Jan Beulich wrote:
>> On 05.08.2024 17:13, oleksii.kurochko@gmail.com wrote:
>>> On Mon, 2024-07-29 at 15:35 +0200, Jan Beulich wrote:
>>>>> +    }
>>>>> +
>>>>> +    BUG_ON(pte_is_valid(*pte));
>>>>> +
>>>>> +    tmp = paddr_to_pte(LINK_TO_LOAD((unsigned
>>>>> long)&xen_fixmap),
>>>>> PTE_TABLE);
>>>>
>>>> I'm a little puzzled by the use of LINK_TO_LOAD() (and
>>>> LOAD_TO_LINK()
>>>> a
>>>> little further up) here. Don't you have functioning __pa() and
>>>> __va()?
>>> Can __pa() and __va() be used in this case?
>>>
>>> According to comments for other architectures, these macros are
>>> used
>>> for converting between Xen heap virtual addresses (VA) and machine
>>> addresses (MA). I may have misunderstood what is meant by the Xen
>>> heap
>>> in this context, but I'm not sure if xen_fixmap[] and page tables
>>> are
>>> considered part of the Xen heap.
>>
>> I didn't check Arm, but on x86 virt_to_maddr() (underlying __pa())
>> has
>> special case code to also allow addresses within the Xen image
>> (area).
> 
> Yes, it is true for __virt_to_maddr:
>    static inline unsigned long __virt_to_maddr(unsigned long va)
>    {
>        ASSERT(va < DIRECTMAP_VIRT_END);
>        if ( va >= DIRECTMAP_VIRT_START )
>            va -= DIRECTMAP_VIRT_START;
>        else
>        {
>            BUILD_BUG_ON(XEN_VIRT_END - XEN_VIRT_START != GB(1));
>            /* Signed, so ((long)XEN_VIRT_START >> 30) fits in an imm32. */
>            ASSERT(((long)va >> (PAGE_ORDER_1G + PAGE_SHIFT)) ==
>                   ((long)XEN_VIRT_START >> (PAGE_ORDER_1G + PAGE_SHIFT)));
>    
>            va += xen_phys_start - XEN_VIRT_START;
>        }
>        return (va & ma_va_bottom_mask) |
>               ((va << pfn_pdx_hole_shift) & ma_top_mask);
>    }
>    
> But in case of __maddr_to_virt ( __va() ) it is using directmap region:
>    static inline void *__maddr_to_virt(unsigned long ma)
>    {
>        ASSERT(pfn_to_pdx(ma >> PAGE_SHIFT) < (DIRECTMAP_SIZE >>
>    PAGE_SHIFT));
>        return (void *)(DIRECTMAP_VIRT_START +
>                        ((ma & ma_va_bottom_mask) |
>                         ((ma & ma_top_mask) >> pfn_pdx_hole_shift)));
>    }
> 
> But I have to use both __va() and __pa().
> __va() inside cycle to find L1 page table:
> 
>     for ( i = HYP_PT_ROOT_LEVEL; i-- > 1; )
>     {
>         BUG_ON(!pte_is_valid(*pte));
> 
>         pte = (pte_t *)LOAD_TO_LINK(pte_to_paddr(*pte));
>         pte = &pte[pt_index(i, FIXMAP_ADDR(0))];
>     }
> 
> __pa() to set a physical address of L0 page table:
>     tmp = paddr_to_pte(LINK_TO_LOAD((unsigned long)&xen_fixmap),
> PTE_TABLE);
>     write_pte(pte, tmp);

Hmm, then using at least LINK_TO_LOAD() is going to be unavoidable for the
time being, I guess. Yet midterm I think they should disappear from here. 

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 19:02:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 19:02:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772344.1182786 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb2xU-0000Fh-Ap; Mon, 05 Aug 2024 19:01:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772344.1182786; Mon, 05 Aug 2024 19:01:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb2xU-0000Fa-7j; Mon, 05 Aug 2024 19:01:28 +0000
Received: by outflank-mailman (input) for mailman id 772344;
 Mon, 05 Aug 2024 19:01:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sb2xS-0000FB-TC
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 19:01:26 +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 1sb2xR-0007NK-RZ; Mon, 05 Aug 2024 19:01:25 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.244])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sb2xR-0001mb-K5; Mon, 05 Aug 2024 19:01:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=OaT3F0yh0XwvogJKjRg1RLdZlN4Ss7A68YRgvOiwPv8=; b=Gwj4ELdoDtxhMd418IFWCikbFj
	4msOfaQ019d7IHbWictUPqYNV1yPaMPeochHxJfkQ7AW91YeSgbTnvGpXxeUItcn3hc2TopRwzyAf
	IT//083Adqw55ArMRLr/6ILiKfFQd+hez7n1or5wyCpbFXwCJFjrZZA66AHooTp2zco4=;
Message-ID: <c8aa0451-4a99-4496-a5eb-cb4cf6b49862@xen.org>
Date: Mon, 5 Aug 2024 20:01:23 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v8 2/2] xen/common: Move Arm's bootfdt.c to common
Content-Language: en-GB
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 xen-devel@lists.xenproject.org
Cc: Shawn Anastasio <sanastasio@raptorengineering.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>
References: <cover.1722856894.git.oleksii.kurochko@gmail.com>
 <85321f4a2fc7f1d892aa658603bffaae25249045.1722856894.git.oleksii.kurochko@gmail.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <85321f4a2fc7f1d892aa658603bffaae25249045.1722856894.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 05/08/2024 12:33, Oleksii Kurochko wrote:
> From: Shawn Anastasio <sanastasio@raptorengineering.com>
> 
> Move Arm's bootfdt.c to xen/common so that it can be used by other
> device tree architectures like PPC and RISCV.
> 
> Remove stubs for process_shm_node() and early_print_info_shmem()
> from $xen/arch/arm/include/asm/static-shmem.h.
> These stubs are removed to avoid introducing them for architectures
> that do not support CONFIG_STATIC_SHM.
> The process_shm_node() stub is now implemented in common code to
> maintain the current behavior of early_scan_code() on ARM.
> The early_print_info_shmem() stub is only used in early_print_info(),
> so it's now guarded with #ifdef CONFIG_STATIC_SHM ... #endif.
> 
> Suggested-by: Julien Grall <julien@xen.org>
> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 20:12:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 20:12:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772352.1182796 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb44A-0002Aw-8x; Mon, 05 Aug 2024 20:12:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772352.1182796; Mon, 05 Aug 2024 20:12:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb44A-0002Ap-6O; Mon, 05 Aug 2024 20:12:26 +0000
Received: by outflank-mailman (input) for mailman id 772352;
 Mon, 05 Aug 2024 20:12:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sb449-0002Af-EE; Mon, 05 Aug 2024 20:12:25 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sb449-0000SS-67; Mon, 05 Aug 2024 20:12:25 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sb448-00031T-TB; Mon, 05 Aug 2024 20:12:24 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sb448-0006Rc-Sg; Mon, 05 Aug 2024 20:12:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=jODfizFNirFqtZMsgQf3O7+QpCTijY+wHprV6THCttE=; b=DYEB6pQWr9jFF7i0oWt9kVMWb2
	G4PWh77RY/9SBo8n8OukjXOOBBeN5IpdHyp565qKXyY1gYpsCDERmZzJYjGL3DgqIK4LrwODf9Yex
	WHPwA/uUo2IguLgkOYzce/7CoCY4c9xYvqya5RgUu9hwEJq+lLUnsyJiUiJcwEMWRW/w=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187150-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187150: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-localmigrate/x10:fail:regression
    linux-linus:test-armhf-armhf-libvirt-vhd:host-ping-check-xen:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=de9c2c66ad8e787abec7c9d7eff4f8c3cdd28aed
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 05 Aug 2024 20:12:24 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827
 test-amd64-amd64-xl-qemut-ws16-amd64 18 guest-localmigrate/x10 fail REGR. vs. 186827

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

version targeted for testing:
 linux                de9c2c66ad8e787abec7c9d7eff4f8c3cdd28aed
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   20 days
Failing since        186925  2024-07-20 09:44:52 Z   16 days   33 attempts
Testing same since   187150  2024-08-05 03:47:01 Z    0 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 21:01:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 21:01:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772363.1182807 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb4pT-00010C-SL; Mon, 05 Aug 2024 21:01:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772363.1182807; Mon, 05 Aug 2024 21:01:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb4pT-000105-Oh; Mon, 05 Aug 2024 21:01:19 +0000
Received: by outflank-mailman (input) for mailman id 772363;
 Mon, 05 Aug 2024 21:01:19 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+Idk=PE=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sb4pS-0000zy-Ub
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 21:01:18 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id da7aa8d3-536d-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 23:01:16 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 84CF560C74;
 Mon,  5 Aug 2024 21:01:14 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EFB2C32782;
 Mon,  5 Aug 2024 21:01:13 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: da7aa8d3-536d-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1722891674;
	bh=IB1+KeSKSkZ4PVC2DdCuvNjm4O98/WWrETEdHGV17kw=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=stYwPTWi0AF6emv658UZRAFBdPxPh9epP6w4p6aa7sll4TBex5BXAQMMb9z5BgL88
	 w8pAgWJ7IwkUfwAp7uaj6iZ3q+UWmAfyDNjSsVKFzGfhCCMTqfcWTd+D+7kEZSi8sJ
	 jp6Ev23bNJdLaRYW/Dh6XTLXzpazoXyIz7BlOhfLI1sASfeON7jXbbCcUsG81Xv8Wa
	 L3ew1/3oC16qKVFboi5rN7y31GXcDosTGvZDVa0ZSk8EMXfHShLAGz8YBsc3DZdwRO
	 LtvD969G2gP3ZYZsnIs7QCI5GZt1vvE+e5h+bTq8rr01CwHx/lNFjXcN2SJKrg2C1i
	 pgYxp3qLGbDng==
Date: Mon, 5 Aug 2024 14:01:09 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Marek Marczykowski <marmarek@invisiblethingslab.com>
Subject: Re: [PATCH] x86/shutdown: use DMI_MATCH2()
In-Reply-To: <71df7167-fa92-405e-bf5b-a307e990e5a3@suse.com>
Message-ID: <alpine.DEB.2.22.394.2408051401030.4954@ubuntu-linux-20-04-desktop>
References: <71df7167-fa92-405e-bf5b-a307e990e5a3@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 5 Aug 2024, Jan Beulich wrote:
> ... to please Misra C:2012 Rule 9.3 (Arrays shall not be partially
> initialized).
> 
> Fixes: d81dd3130351 ("x86/shutdown: change default reboot method preference")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>



> ---
> Cc-ing REST since the two other x86 maintainers are away, yet the CI will
> want fixing.
> 
> --- a/xen/arch/x86/shutdown.c
> +++ b/xen/arch/x86/shutdown.c
> @@ -498,10 +498,9 @@ static const struct dmi_system_id __init
>          .callback = override_reboot,
>          .driver_data = (void *)(long)BOOT_EFI,
>          .ident = "Acer TravelMate X514-51T",
> -        .matches = {
> +        DMI_MATCH2(
>              DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
> -            DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate X514-51T"),
> -        },
> +            DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate X514-51T")),
>      },
>      { }
>  };
> 


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 21:10:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 21:10:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772371.1182817 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb4xw-0002cQ-Ot; Mon, 05 Aug 2024 21:10:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772371.1182817; Mon, 05 Aug 2024 21:10:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb4xw-0002bs-LZ; Mon, 05 Aug 2024 21:10:04 +0000
Received: by outflank-mailman (input) for mailman id 772371;
 Mon, 05 Aug 2024 21:10:03 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+Idk=PE=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sb4xu-0002Ez-VC
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 21:10:02 +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 12960084-536f-11ef-bc04-fd08da9f4363;
 Mon, 05 Aug 2024 23:10:00 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 1C45BCE0B89;
 Mon,  5 Aug 2024 21:09:54 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1B5EC32782;
 Mon,  5 Aug 2024 21:09:52 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 12960084-536f-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1722892193;
	bh=9CMcrHK/+sJ2mFm1ONU1jdDiD1dAJ5Xr5U6REbOE2K8=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=Ii6OkRVGHezxfx0GIyvC5Noonj9lkrOtn0vJO55+3Q50iBNYSm8lH3PVS58Krh+fk
	 +VdU6h4gOwARPE3vfrLinmtnArDK3ZJEfiVFbVmyNfUMj80Sb/ouu/RKCxr+6rKbkv
	 ZvNMIM7IQnP2UgEV/TZR/m2le6n10EtMYLvWGD9s0J/PLx5cQVItXAVQ6U4q8VOhkO
	 Jb+WY55Qzuxpg7qFKwFy8qphWiFy9mhuqyRtMo0Wd//iZNoDzbA+yRMaCDOz4sEIG7
	 cz0bHaT9t3sDypYHwMFM4RIR6j08JUv6ax3skhDKPgy5ehsANylNKhwnoPiSGzyZX1
	 QdT1vzu0f9uoA==
Date: Mon, 5 Aug 2024 14:09:51 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Simone Ballarin <simone.ballarin@bugseng.com>, 
    Doug Goldstein <cardoe@cardoe.com>, 
    Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [XEN PATCH 1/2] automation/eclair: sort monitored guidelines
 with -V
In-Reply-To: <cc69ad735dd53b10237981ded44229f8e6894076.1722842330.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2408051409450.4954@ubuntu-linux-20-04-desktop>
References: <cover.1722842330.git.federico.serafini@bugseng.com> <cc69ad735dd53b10237981ded44229f8e6894076.1722842330.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 5 Aug 2024, Federico Serafini wrote:
> To improve readability, sort guidelines with -V.
> 
> No functional change.

Acked-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
>  .../eclair_analysis/ECLAIR/monitored.ecl      | 92 +++++++++----------
>  1 file changed, 46 insertions(+), 46 deletions(-)
> 
> diff --git a/automation/eclair_analysis/ECLAIR/monitored.ecl b/automation/eclair_analysis/ECLAIR/monitored.ecl
> index 8a7e3f3cea..7b085a329a 100644
> --- a/automation/eclair_analysis/ECLAIR/monitored.ecl
> +++ b/automation/eclair_analysis/ECLAIR/monitored.ecl
> @@ -2,58 +2,17 @@
>  -enable=MC3R1.D1.1
>  -enable=MC3R1.D2.1
>  -enable=MC3R1.D4.1
> +-enable=MC3R1.D4.3
> +-enable=MC3R1.D4.7
>  -enable=MC3R1.D4.10
>  -enable=MC3R1.D4.11
>  -enable=MC3R1.D4.12
>  -enable=MC3R1.D4.14
> --enable=MC3R1.D4.3
> --enable=MC3R1.D4.7
> --enable=MC3R1.R10.1
> --enable=MC3R1.R10.2
>  -enable=MC3R1.R1.1
> --enable=MC3R1.R11.1
> --enable=MC3R1.R11.7
> --enable=MC3R1.R11.8
> --enable=MC3R1.R11.9
> --enable=MC3R1.R12.5
>  -enable=MC3R1.R1.3
> --enable=MC3R1.R13.6
> --enable=MC3R1.R13.1
>  -enable=MC3R1.R1.4
> --enable=MC3R1.R14.1
> --enable=MC3R1.R14.4
> --enable=MC3R1.R16.2
> --enable=MC3R1.R16.3
> --enable=MC3R1.R16.4
> --enable=MC3R1.R16.6
> --enable=MC3R1.R16.7
> --enable=MC3R1.R17.1
> --enable=MC3R1.R17.3
> --enable=MC3R1.R17.4
> --enable=MC3R1.R17.5
> --enable=MC3R1.R17.6
> --enable=MC3R1.R18.6
> --enable=MC3R1.R19.1
> --enable=MC3R1.R20.12
> --enable=MC3R1.R20.13
> --enable=MC3R1.R20.14
> --enable=MC3R1.R20.4
> --enable=MC3R1.R20.7
> --enable=MC3R1.R20.9
>  -enable=MC3R1.R2.1
> --enable=MC3R1.R21.10
> --enable=MC3R1.R21.13
> --enable=MC3R1.R21.17
> --enable=MC3R1.R21.18
> --enable=MC3R1.R21.19
> --enable=MC3R1.R21.20
> --enable=MC3R1.R21.21
> --enable=MC3R1.R21.9
>  -enable=MC3R1.R2.2
> --enable=MC3R1.R22.2
> --enable=MC3R1.R22.4
> --enable=MC3R1.R22.5
> --enable=MC3R1.R22.6
>  -enable=MC3R1.R2.6
>  -enable=MC3R1.R3.1
>  -enable=MC3R1.R3.2
> @@ -72,32 +31,73 @@
>  -enable=MC3R1.R7.3
>  -enable=MC3R1.R7.4
>  -enable=MC3R1.R8.1
> --enable=MC3R1.R8.10
> --enable=MC3R1.R8.12
> --enable=MC3R1.R8.14
>  -enable=MC3R1.R8.2
>  -enable=MC3R1.R8.3
>  -enable=MC3R1.R8.4
>  -enable=MC3R1.R8.5
>  -enable=MC3R1.R8.6
>  -enable=MC3R1.R8.8
> +-enable=MC3R1.R8.10
> +-enable=MC3R1.R8.12
> +-enable=MC3R1.R8.14
>  -enable=MC3R1.R9.2
>  -enable=MC3R1.R9.3
>  -enable=MC3R1.R9.4
>  -enable=MC3R1.R9.5
> +-enable=MC3R1.R10.1
> +-enable=MC3R1.R10.2
> +-enable=MC3R1.R11.1
> +-enable=MC3R1.R11.7
> +-enable=MC3R1.R11.8
> +-enable=MC3R1.R11.9
> +-enable=MC3R1.R12.5
> +-enable=MC3R1.R13.1
> +-enable=MC3R1.R13.6
> +-enable=MC3R1.R14.1
> +-enable=MC3R1.R14.4
> +-enable=MC3R1.R16.2
> +-enable=MC3R1.R16.3
> +-enable=MC3R1.R16.4
> +-enable=MC3R1.R16.6
> +-enable=MC3R1.R16.7
> +-enable=MC3R1.R17.1
> +-enable=MC3R1.R17.3
> +-enable=MC3R1.R17.4
> +-enable=MC3R1.R17.5
> +-enable=MC3R1.R17.6
> +-enable=MC3R1.R18.6
>  -enable=MC3R1.R18.8
> +-enable=MC3R1.R19.1
>  -enable=MC3R1.R20.2
>  -enable=MC3R1.R20.3
> +-enable=MC3R1.R20.4
>  -enable=MC3R1.R20.6
> +-enable=MC3R1.R20.7
> +-enable=MC3R1.R20.9
>  -enable=MC3R1.R20.11
> +-enable=MC3R1.R20.12
> +-enable=MC3R1.R20.13
> +-enable=MC3R1.R20.14
>  -enable=MC3R1.R21.3
>  -enable=MC3R1.R21.4
>  -enable=MC3R1.R21.5
>  -enable=MC3R1.R21.7
>  -enable=MC3R1.R21.8
> +-enable=MC3R1.R21.9
> +-enable=MC3R1.R21.10
>  -enable=MC3R1.R21.12
> +-enable=MC3R1.R21.13
> +-enable=MC3R1.R21.17
> +-enable=MC3R1.R21.18
> +-enable=MC3R1.R21.19
> +-enable=MC3R1.R21.20
> +-enable=MC3R1.R21.21
>  -enable=MC3R1.R22.1
> +-enable=MC3R1.R22.2
>  -enable=MC3R1.R22.3
> +-enable=MC3R1.R22.4
> +-enable=MC3R1.R22.5
> +-enable=MC3R1.R22.6
>  -enable=MC3R1.R22.7
>  -enable=MC3R1.R22.8
>  -enable=MC3R1.R22.9
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 21:10:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 21:10:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772372.1182828 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb4y1-0003DA-1Z; Mon, 05 Aug 2024 21:10:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772372.1182828; Mon, 05 Aug 2024 21:10:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb4y0-0003D2-SP; Mon, 05 Aug 2024 21:10:08 +0000
Received: by outflank-mailman (input) for mailman id 772372;
 Mon, 05 Aug 2024 21:10:07 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=+Idk=PE=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sb4xz-0003B6-7L
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 21:10:07 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 15ced7e4-536f-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 23:10:05 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 8768E60E08;
 Mon,  5 Aug 2024 21:10:03 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77CAFC32782;
 Mon,  5 Aug 2024 21:10:02 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 15ced7e4-536f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1722892203;
	bh=gOvM9GNTT9aamBeH8D5rPqNrADQQutz7YuV6M932/To=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=rYR/hlcsMkPrEkoNf0Md06xs8SaF8vILvH+Pe5mv0pKkaSH3Mu+o9iGFnScCx4qPI
	 0nfH3E3UNUHtJ3HfmnxSfEtRM6o/YTZ1fDE8taGJQr95mLiQnNcz5HzxIcpMEKQuuY
	 LvWLswJQ2I9OiLOFzsNfakp6GO5Is5t+Ypt48rpCPExUQUPrZC9oFO1tRDpo8tQcTn
	 TYOSms4iuvHA+X4ZIbf4S5wEa5ume2WFrXteYh6w6EtD4r0RgmCrsDov7Mj6T4ZcJL
	 nuY8MwpTmSM/G8YSX4lSYP3zReOxhaC/qEIYkqVzZ3JnJf7Z1CFgy1MplsTketWup/
	 LvMGf0M8Ndx1Q==
Date: Mon, 5 Aug 2024 14:10:01 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Simone Ballarin <simone.ballarin@bugseng.com>, 
    Doug Goldstein <cardoe@cardoe.com>, 
    Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [XEN PATCH 2/2] automation/eclair: tag more guidelines as
 clean
In-Reply-To: <d552057fece18290c86e082434e3a04c783b4d46.1722842330.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2408051409560.4954@ubuntu-linux-20-04-desktop>
References: <cover.1722842330.git.federico.serafini@bugseng.com> <d552057fece18290c86e082434e3a04c783b4d46.1722842330.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 5 Aug 2024, Federico Serafini wrote:
> Tag more of the accepted guidelines as clean to avoid regressions.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
>  automation/eclair_analysis/ECLAIR/tagging.ecl | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/eclair_analysis/ECLAIR/tagging.ecl
> index e7b32773e6..4d0ac94848 100644
> --- a/automation/eclair_analysis/ECLAIR/tagging.ecl
> +++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
> @@ -56,11 +56,14 @@ MC3R1.R9.3||
>  MC3R1.R9.4||
>  MC3R1.R9.5||
>  MC3R1.R10.2||
> +MC3R1.R11.6||
>  MC3R1.R11.7||
>  MC3R1.R11.9||
>  MC3R1.R12.5||
>  MC3R1.R14.1||
> +MC3R1.R14.3||
>  MC3R1.R14.4||
> +MC3R1.R16.2||
>  MC3R1.R16.7||
>  MC3R1.R17.1||
>  MC3R1.R17.3||
> @@ -85,6 +88,7 @@ MC3R1.R21.7||
>  MC3R1.R21.8||
>  MC3R1.R21.9||
>  MC3R1.R21.10||
> +MC3R1.R21.11||
>  MC3R1.R21.12||
>  MC3R1.R21.13||
>  MC3R1.R21.19||
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 21:10:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 21:10:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772373.1182837 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb4y2-0003SP-76; Mon, 05 Aug 2024 21:10:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772373.1182837; Mon, 05 Aug 2024 21:10:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb4y2-0003SI-37; Mon, 05 Aug 2024 21:10:10 +0000
Received: by outflank-mailman (input) for mailman id 772373;
 Mon, 05 Aug 2024 21:10:08 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0Qdp=PE=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1sb4y0-0003B6-Mh
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 21:10:08 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20601.outbound.protection.outlook.com
 [2a01:111:f403:2416::601])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 16244e15-536f-11ef-8776-851b0ebba9a2;
 Mon, 05 Aug 2024 23:10:06 +0200 (CEST)
Received: from BY5PR13CA0005.namprd13.prod.outlook.com (2603:10b6:a03:180::18)
 by MN0PR12MB5908.namprd12.prod.outlook.com (2603:10b6:208:37c::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug
 2024 21:10:01 +0000
Received: from SJ1PEPF000023D4.namprd21.prod.outlook.com
 (2603:10b6:a03:180:cafe::45) by BY5PR13CA0005.outlook.office365.com
 (2603:10b6:a03:180::18) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.11 via Frontend
 Transport; Mon, 5 Aug 2024 21:10:01 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SJ1PEPF000023D4.mail.protection.outlook.com (10.167.244.69) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7875.2 via Frontend Transport; Mon, 5 Aug 2024 21:10:00 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 5 Aug
 2024 16:09:59 -0500
Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Mon, 5 Aug 2024 16:09:58 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 16244e15-536f-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=S1Bj48pacmz1xyGKhtOVTyDzej77INfe3oAwd2Sj3ll0MZYHgGoXROwX8u1SbmEesxl8Mfb/MJMJgMo7TSgiDcv0o6OVxIIl+9k0AQ2od5GYOyxKWdLO3vG4+fmdjipqwUQTKF7VJxoV5A8XAV/LXHmsuqF3fFAbsYANTdfcG0SwZCEKhZwC3q4iw3DcstTH5OkS4SCtuFNi04pV51GgnhgX+9uve3D2L8G1pXgjFHcAizUr5n4CK/aG0Z64PVFI7PjyT3Z6pk4JiYJTbHWnTosXRGi0IaB8jK2M8WjDWjHlOyNwLQVxjBA+LXR1CxMFQSlHk8MuuYR4a6fOTvYINQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LqFIWjOEcIiXGqrM6iqQTUtHFx+YHRZKkWFzqALMsCo=;
 b=le1fNnvgojvgciL60FER3PbMAfI0MPGCobCYs/Ik1yCB8n3Xle78/kD6NjkR8gPk1AKY0pHaVhg7NuzvYrNEdNXvm58PyCqFrVedLjD0Ll0Neepg5bJNRDdkgnRNy/6phERdPNKYEoyp+lRK8ji0cxLqco0sIRLbEYWZ6kGq3H3/MONPkCjW/Y5vcyltDybtm+4Z1ilUqpI/9UbjXZFg/J4qnN6OQGPjzxXuxn7KQDMDSPYpDzIufXpArBmRLaNUoAC0GcPxilYwAAjwdIanmW4Bv7A0AH6PDu5QjnLX9iNWr5PglNflPsJuObDrlY/YIha0SB8quosPgBMVM9RKFQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LqFIWjOEcIiXGqrM6iqQTUtHFx+YHRZKkWFzqALMsCo=;
 b=RbuykvQUiCPMb34AQlMUE1ySVOuok4hkq70nLYbHaLgGSMbQSAGYbzNFp1E8LfK2tkB0KCktE2TagXDV/eC9b7nPppio0LP5ZYdi1GJMZdvJSFC9eYMtwXQel6eaRwRGvVezvtE8otDwtmvrij/78K/nCDdkGF+a+FyguY5TRJo=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stewart Hildebrand <stewart.hildebrand@amd.com>, Jan Beulich
	<jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>, Teddy Astie
	<teddy.astie@vates.tech>
Subject: [PATCH] x86/msi: fix locking for SRIOV devices
Date: Mon, 5 Aug 2024 17:09:54 -0400
Message-ID: <20240805210956.364624-1-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB04.amd.com: stewart.hildebrand@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF000023D4:EE_|MN0PR12MB5908:EE_
X-MS-Office365-Filtering-Correlation-Id: ee7e27f2-e02f-4bd6-ec4d-08dcb592f7d4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?6fh09ovxl4iv8+rb7b1ecvY+LxW18p08ghfHXmbZVdYSamL9c5amW8wbYw3W?=
 =?us-ascii?Q?AYGxNf38CyNfQvmI8yuQjT5cdd+tbPKsp8f2MO+iloDFdhA2QBRz1uYJxaGw?=
 =?us-ascii?Q?vkBoK5ZsFT8B7IrFUo+BhxiZ/iqG1dwk+QfXZVaU7o5a2qybXv4vHPljfA3E?=
 =?us-ascii?Q?0MkJH3mX5eEpa11S1qSs7/RzYbhWuOpMIQgwJkv4uNsG2UujvT2WZQCZFvYJ?=
 =?us-ascii?Q?eIZReFxy+igaOOD079KZ+Ku/CVt2LgHjxiNt/KGUh4RB/SG0qrzVrAyPYuMa?=
 =?us-ascii?Q?qCku72BbqKI9bKbAwD5Llf6QgIIvT0gQOg1u/wvFAzHdqly3qFDviwAg3PKR?=
 =?us-ascii?Q?ncUfaCuHLvSPwA0cWwtBMFc4DrTbbo2vFoXnvVchROQsAo2cWyS2NjCxPvma?=
 =?us-ascii?Q?D1rceXrVKbnfMygsvnIeljuuBqIx2JXwEIkp4d9IimPQbACOLm86MzKTQu2E?=
 =?us-ascii?Q?EdGuQI+rw6HVsYu8x0e5WQunfgFUGPBWytvJPe/6HU/vjXt2uDUEre7xc6/2?=
 =?us-ascii?Q?YjA5uk5TdoLbt9ztyr6Nkl8+klOOPnUlQ1swZzw+yOa3iTcd/9xPwnuVfcR7?=
 =?us-ascii?Q?eNSVaYO5vWMF46fNAx4W6ike1g1zslt25KGkbx+DkANsAkCKv5jNx/J5oyrb?=
 =?us-ascii?Q?sJjSNZnCZJSuV6NRpBII5X4FjNH/r6taRT4GNnA+siqzmn1iU1iv8+XaBY2K?=
 =?us-ascii?Q?JU3u+Mfm/3TByU0+qKkpXndbZzKdsjJBshRD4OrTZD1kwr19KOr+BzTqio8F?=
 =?us-ascii?Q?4YwyVb2Z6fGp+2mnLcAHCQIxF+qt4+VpdsK0nmNhDgGHpM9EOYqVzFCW2G5I?=
 =?us-ascii?Q?lNrLhsxCZetZRYdHc0mMPefxVKIJ6Q99T+tKl+cVU4rgBgU8qhMMyh/IbzgX?=
 =?us-ascii?Q?SloCO0dTvYfB9YRp8xPbTgGNqwQ6/zui1WpNPhYMd8EdNfF7GcGkFayWEeF0?=
 =?us-ascii?Q?AV87fnJF0pz6AIKGOwJc3sqxCIbg8eavNyOnJJbvuXp5pb0vDP7/RqLsTwTc?=
 =?us-ascii?Q?T1brw5YNuPQBVjvW3NS0M7AzSB4T64ueYsKduYUrgWkj5uxcYmNY1w2wMFku?=
 =?us-ascii?Q?1MmO+mssxhHgJXE5xdnffd4kC7Pad6sOBTdP5Z19dhSPfcwBorBAhojC5YoE?=
 =?us-ascii?Q?FjfZTus5YJaCRzTtoQbqBREG0Dv/IfSY6dftE95EuoZ31zoWBi3kQoLRc/0I?=
 =?us-ascii?Q?Z3ZI2r06YjZZkDO1+Rf1wekJ6mkCXuz1CRUTo4cmwa1eL3tF/p3c0OvEyJVC?=
 =?us-ascii?Q?XMy/sAlX53fa8ijS46ytXLVqNyazsvyu24OWy6ovuqU7AEpEb6SYXG5RL6sE?=
 =?us-ascii?Q?hB07R6UYzBo+keTssAvKFF+4hDNdM2L/AEDf9c7ohzjmVNEvaniZdOWJ+Wj9?=
 =?us-ascii?Q?c9SWJ/ha7sKd7JUCbdzroWOwgEriYF06bDM/gkfusowymv9zszudFxvfE/qG?=
 =?us-ascii?Q?C95CJyo2Wkjjshb9WNhRdGthVAp34WB1?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 21:10:00.5984
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ee7e27f2-e02f-4bd6-ec4d-08dcb592f7d4
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF000023D4.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5908

In commit 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci
structure") a lock moved from allocate_and_map_msi_pirq() to the caller
and changed from pcidevs_lock() to read_lock(&d->pci_lock). However, one
call path wasn't updated to reflect the change, leading to a failed
assertion observed on debug builds of Xen when an SRIOV device is
present with one or more VFs enabled:

(XEN) Assertion 'd || pcidevs_locked()' failed at drivers/passthrough/pci.c:535
(XEN) ----[ Xen-4.20-unstable  x86_64  debug=y  Not tainted ]----
...
(XEN) Xen call trace:
(XEN)    [<ffff82d040284da8>] R pci_get_pdev+0x4c/0xab
(XEN)    [<ffff82d040344f5c>] F arch/x86/msi.c#read_pci_mem_bar+0x58/0x272
(XEN)    [<ffff82d04034530e>] F arch/x86/msi.c#msix_capability_init+0x198/0x755
(XEN)    [<ffff82d040345dad>] F arch/x86/msi.c#__pci_enable_msix+0x82/0xe8
(XEN)    [<ffff82d0403463e5>] F pci_enable_msi+0x3f/0x78
(XEN)    [<ffff82d04034be2b>] F map_domain_pirq+0x2a4/0x6dc
(XEN)    [<ffff82d04034d4d5>] F allocate_and_map_msi_pirq+0x103/0x262
(XEN)    [<ffff82d04035da5d>] F physdev_map_pirq+0x210/0x259
(XEN)    [<ffff82d04035e798>] F do_physdev_op+0x9c3/0x1454
(XEN)    [<ffff82d040329475>] F pv_hypercall+0x5ac/0x6af
(XEN)    [<ffff82d0402012d3>] F lstar_enter+0x143/0x150

Fix it by passing the struct domain pointer to pci_get_pdev() in this
call path.

Fixes: 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci structure")
Reported-by: Teddy Astie <teddy.astie@vates.tech>
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
Candidate for backport to 4.19
---
 xen/arch/x86/msi.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 0c97fbb3fc03..95a48615a1a4 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -662,7 +662,8 @@ static int msi_capability_init(struct pci_dev *dev,
     return 0;
 }
 
-static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
+static u64 read_pci_mem_bar(struct domain *d, u16 seg, u8 bus, u8 slot, u8 func,
+                            u8 bir, int vf)
 {
     u8 limit;
     u32 addr, base = PCI_BASE_ADDRESS_0;
@@ -670,8 +671,7 @@ static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
 
     if ( vf >= 0 )
     {
-        struct pci_dev *pdev = pci_get_pdev(NULL,
-                                            PCI_SBDF(seg, bus, slot, func));
+        struct pci_dev *pdev = pci_get_pdev(d, PCI_SBDF(seg, bus, slot, func));
         unsigned int pos;
         uint16_t ctrl, num_vf, offset, stride;
 
@@ -829,7 +829,8 @@ static int msix_capability_init(struct pci_dev *dev,
             vf = dev->sbdf.bdf;
         }
 
-        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
+        table_paddr = read_pci_mem_bar(dev->domain, seg, pbus, pslot, pfunc,
+                                       bir, vf);
         WARN_ON(msi && msi->table_base != table_paddr);
         if ( !table_paddr )
         {
@@ -852,7 +853,8 @@ static int msix_capability_init(struct pci_dev *dev,
 
         pba_offset = pci_conf_read32(dev->sbdf, msix_pba_offset_reg(pos));
         bir = (u8)(pba_offset & PCI_MSIX_BIRMASK);
-        pba_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
+        pba_paddr = read_pci_mem_bar(dev->domain, seg, pbus, pslot, pfunc, bir,
+                                     vf);
         WARN_ON(!pba_paddr);
         pba_paddr += pba_offset & ~PCI_MSIX_BIRMASK;
 
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 05 21:31:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 21:31:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772399.1182846 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb5Hx-0007bS-NF; Mon, 05 Aug 2024 21:30:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772399.1182846; Mon, 05 Aug 2024 21:30:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb5Hx-0007bL-Ki; Mon, 05 Aug 2024 21:30:45 +0000
Received: by outflank-mailman (input) for mailman id 772399;
 Mon, 05 Aug 2024 21:30:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sb5Hw-0007bB-Do; Mon, 05 Aug 2024 21:30:44 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sb5Hw-0001sc-5U; Mon, 05 Aug 2024 21:30:44 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sb5Hv-0004qf-St; Mon, 05 Aug 2024 21:30:43 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sb5Hv-0006Eo-SO; Mon, 05 Aug 2024 21:30:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=+96RteeXC8X9uqmOtH3oYMDVih49Dvv40zyGY6cl4EI=; b=jk1xPLZVp25zWxMXt6Q2gjotsF
	zrDF0UT54xqxauRXAEvf2SjCCkHC7XS+U+OLC9luR4d4KvHjxDIigjytcaJ1l85BnlPjl32PLo7QG
	4kRUateMRgbKuHjqi+yVgiiP8YRG3t/VqykTikZhYpSnq/crSF8iEhYC5fCsybZUJ/dg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187160-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187160: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=bec25f11d5180d407cf04d2de2525fa6f876bde1
X-Osstest-Versions-That:
    xen=ded5474718a84366dac80aae039a693b66fa7e2e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 05 Aug 2024 21:30:43 +0000

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

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  bec25f11d5180d407cf04d2de2525fa6f876bde1
baseline version:
 xen                  ded5474718a84366dac80aae039a693b66fa7e2e

Last test of basis   187127  2024-08-02 22:02:05 Z    2 days
Failing since        187154  2024-08-05 09:02:05 Z    0 days    3 attempts
Testing same since   187157  2024-08-05 13:12:16 Z    0 days    2 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Roger Pau Monné <roger.pau@citrix.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   ded5474718..bec25f11d5  bec25f11d5180d407cf04d2de2525fa6f876bde1 -> smoke


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 21:36:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 21:36:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772410.1182856 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb5NC-0008CL-8t; Mon, 05 Aug 2024 21:36:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772410.1182856; Mon, 05 Aug 2024 21:36:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb5NC-0008CE-5g; Mon, 05 Aug 2024 21:36:10 +0000
Received: by outflank-mailman (input) for mailman id 772410;
 Mon, 05 Aug 2024 21:36:09 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sb5NB-0008C8-QS
 for xen-devel@lists.xenproject.org; Mon, 05 Aug 2024 21:36:09 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sb5N9-0001y4-9h; Mon, 05 Aug 2024 21:36:07 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.244])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sb5N9-0003TD-4e; Mon, 05 Aug 2024 21:36:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=sdebRVXfOW2+STapEuSWYi8EDN5kp5eXUezvhU4uBZo=; b=LHdiRiJx4dO6kxinF8I/cmqR2V
	PPUMKaebhWFJqX8azjQIOT3zOZ157xQY6h0MWzCH1NtMI6cmNHV8uvHV+zwDGeBf+s4o7s0R8n2lG
	ldlWz/YCR71NzS0QvR3mD8iBGwbQHlfWvubvEfnN0WZfwhx3FvzNpMbYW6uNqiT/sw7g=;
Message-ID: <a5e64aa0-80a1-41bc-ab8f-11608d6c4586@xen.org>
Date: Mon, 5 Aug 2024 22:36:05 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 2/4] xen: arm: make VMAP only support in MMU system
Content-Language: en-GB
To: Ayan Kumar Halder <ayankuma@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>
References: <20240802121443.1531693-1-ayan.kumar.halder@amd.com>
 <20240802121443.1531693-3-ayan.kumar.halder@amd.com>
 <a17d0c07-3f98-4eab-9f84-77d64b562cbf@xen.org>
 <9587f469-b038-45f3-8931-87e06b273763@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <9587f469-b038-45f3-8931-87e06b273763@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Ayan,

On 05/08/2024 11:44, Ayan Kumar Halder wrote:
> 
> On 02/08/2024 14:27, Julien Grall wrote:
>> Hi,
> Hi Julien,
>>
>> On 02/08/2024 13:14, Ayan Kumar Halder wrote:
>>> From: Penny Zheng <penny.zheng@arm.com>
>>>
>>> VMAP is widely used in ALTERNATIVE feature, CPUERRATA feature, etc to
>>> remap a range of memory with new memory attributes. Since this is
>>> highly dependent on virtual address translation, we choose to fold VMAP
>>> in MMU system.
>>>
>>> In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
>>> only support in MMU system on ARM architecture. And we make features
>>> like ALTERNATIVE, CPUERRATA, etc, now depend on VMAP.
>>
>> While I agree that alternative should depend on VMAP (for now), I feel 
>> this is incorrect for CPUERRATA. Very likely, you will need to deal 
>> with them on the MPU.
>>
>> Before making any suggestion, would you be able to clarify how you 
>> envision to deal with errata? Will they be selected at built time or 
>> boot time?
> 
> TBH, I hadn't thought that through. I am thinking about selecting them 
> at built time (like it is been done for Arm64 cpus).

To clarify, on arm64, the decision to enable the bulk of mitigation is 
done at runtime. The Kconfig is just to remove it from the binary if you 
you are not targeting such HW. With that in mind...

> 
> However given that there are lesser number of MPU cpus (only R52 and 
> R82) compared to  MMU ones, could there be a simpler approach.

... do you mean always an errata enabled in the Kconfig would be always 
mitigate (IOW no runtime selection)?

> 
> I am open to any suggestions you have.
> 
> Also, can we disable the CPUERRATA on MPU until we add support for the 
> first errata ?

So I have looked at the code and it is rather unclear why you actually 
need to disable CPU Errata. Can you clarify what would happen if 
cpuerrata is always built *and* CONFIG_ARM64_HARDEN_BRANCH_PREDICATOR is 
gated by HAS_VMAP? I am assuming we will not need the branch predictor 
hardening on Cortex-R (at least this is the implication from [1]).

Now regarding alternative, at least for arm64 this is used outside of 
the errata. Not critical right now, but at some point you will want to 
re-enable alternatives.

Cheers,

[1] 
https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability


-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 22:30:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 22:30:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772422.1182870 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb6DN-0000hb-6H; Mon, 05 Aug 2024 22:30:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772422.1182870; Mon, 05 Aug 2024 22:30:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb6DN-0000gv-2p; Mon, 05 Aug 2024 22:30:05 +0000
Received: by outflank-mailman (input) for mailman id 772422;
 Mon, 05 Aug 2024 22:30:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sb6DL-0000Ts-Vl; Mon, 05 Aug 2024 22:30:03 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sb6DL-0002tN-Tn; Mon, 05 Aug 2024 22:30:03 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sb6DL-0006ly-I7; Mon, 05 Aug 2024 22:30:03 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sb6DL-0001w7-Hh; Mon, 05 Aug 2024 22:30:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=cFniKeIaWOGzuCzHg8axo035b8vKO5zZShpg4MWPYrg=; b=F/yWQENkEVL6rcerb72NV0BLbb
	D1hmKOd0ys1U/X2NlPDJrAaTOEhMnYuRYOVSzXd61V2LlO5axOWTKmDmrurO8Ht7MoLRaoghiF8Zn
	PzTw4DKK55QtS9AnEdV+UJT66ccO5E1uHjpEK8rwmBnqpUOzKAh8tUq7kTbJ+xEJt0SA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187162-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187162: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=51ada84cd57c5ef6c75a72aeb002226cf9180b21
X-Osstest-Versions-That:
    ovmf=5d43165ff8596c2fa07b7d4de3c482d64338ca99
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 05 Aug 2024 22:30:03 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 51ada84cd57c5ef6c75a72aeb002226cf9180b21
baseline version:
 ovmf                 5d43165ff8596c2fa07b7d4de3c482d64338ca99

Last test of basis   187152  2024-08-05 08:15:15 Z    0 days
Testing same since   187162  2024-08-05 19:41:27 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Michael Kubacki <michael.kubacki@microsoft.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   5d43165ff8..51ada84cd5  51ada84cd57c5ef6c75a72aeb002226cf9180b21 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Mon Aug 05 22:56:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 05 Aug 2024 22:56:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772434.1182879 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb6d4-0004eZ-7g; Mon, 05 Aug 2024 22:56:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772434.1182879; Mon, 05 Aug 2024 22:56:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb6d4-0004eS-56; Mon, 05 Aug 2024 22:56:38 +0000
Received: by outflank-mailman (input) for mailman id 772434;
 Mon, 05 Aug 2024 22:56:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sb6d2-0004eI-JT; Mon, 05 Aug 2024 22:56:36 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sb6d2-0003KG-60; Mon, 05 Aug 2024 22:56:36 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sb6d1-0000LU-Qd; Mon, 05 Aug 2024 22:56:35 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sb6d1-0007h7-QF; Mon, 05 Aug 2024 22:56:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=aEA+b5zy0OgTGY8fVUm1PQ/YEtXDVJOsHYkKl9rQdq8=; b=jLmcbBtXdRcg1YN+KKh2UuqDRu
	KrrAoJQHWjpPDwKVN/A70KQRQ46jLpAXeVGF6dPxs1hpNJOwHFB7L2Wmf1jEuc9c9ZigzF2VibDvb
	ztg5cln5RauHYi8H/cGdN1UAckethVo/RmlPQ+SO9B2xLxcMQCjf33hq617EGVo39CKQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187153-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.19-testing test] 187153: regressions - FAIL
X-Osstest-Failures:
    xen-4.19-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:regression
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:windows-install:fail:heisenbug
    xen-4.19-testing:test-amd64-coresched-amd64-xl:guest-localmigrate/x10:fail:heisenbug
    xen-4.19-testing:test-armhf-armhf-xl-arndale:host-ping-check-xen:fail:heisenbug
    xen-4.19-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=026c9fa29716b0ff0f8b7c687908e71ba29cf239
X-Osstest-Versions-That:
    xen=fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 05 Aug 2024 22:56:35 +0000

flight 187153 xen-4.19-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187153/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop       fail REGR. vs. 187044

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-ws16-amd64 12 windows-install fail in 187148 pass in 187153
 test-amd64-coresched-amd64-xl 20 guest-localmigrate/x10    fail pass in 187148
 test-armhf-armhf-xl-arndale  10 host-ping-check-xen        fail pass in 187148

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

version targeted for testing:
 xen                  026c9fa29716b0ff0f8b7c687908e71ba29cf239
baseline version:
 xen                  fe84f5392d8c96d7d73c0cf02413eeff0ef2a40e

Last test of basis   187044  2024-07-29 16:07:22 Z    7 days
Testing same since   187048  2024-07-30 01:41:30 Z    6 days   11 attempts

------------------------------------------------------------
People who touched revisions under test:
  Julien Grall <jgrall@amazon.com>

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


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

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

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

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


Not pushing.

------------------------------------------------------------
commit 026c9fa29716b0ff0f8b7c687908e71ba29cf239
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:45 2024 +0100

    Set 4.19 version
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit df9b8a649f0424e0a949c0f9a7961724bbe8ea70
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:20:08 2024 +0100

    README: make heading say 4.19
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>

commit b2d2878ab2686b92fcdd7bbca4ff4c312a42bc11
Author: Julien Grall <jgrall@amazon.com>
Date:   Mon Jul 29 18:18:01 2024 +0100

    Config.mk: Bump tags to 4.19.0 final
    
    Signed-off-by: Julien Grall <jgrall@amazon.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 01:04:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 01:04:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772446.1182890 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb8cN-0000yD-Aw; Tue, 06 Aug 2024 01:04:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772446.1182890; Tue, 06 Aug 2024 01:04:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sb8cN-0000y6-7Z; Tue, 06 Aug 2024 01:04:03 +0000
Received: by outflank-mailman (input) for mailman id 772446;
 Tue, 06 Aug 2024 01:04:01 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=O+gn=PF=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sb8cK-0000y0-UW
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 01:04:01 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c15f5b5a-538f-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 03:03:58 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 34024CE0A5F;
 Tue,  6 Aug 2024 01:03:55 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id F33B7C32782;
 Tue,  6 Aug 2024 01:03:53 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c15f5b5a-538f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1722906234;
	bh=fff6QgXPfRhX/+7/6sPATPQgAJtXHDd/CFaVIagRkKU=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=loV3HGYDP8jhoJsM3SoZ6yxOhklQCBkZ7eeNZPfGpWpryU1JEBpPKhm5GE1zaa5D+
	 4gdY3z2ZMZ9DtsbbIevybzBYN+UFJGQljbjc95aje/45goR1IxokrVTbN0y08KVfTB
	 NaEaiPwS8pI59WSXa8h+dRjRDHyCPHHmTcb3uAzSbp6RY1Tod0XUQS3JbOaY4P7CqI
	 lC+Jm+Hk1ZK1oCsuBmXYIZ2c70foYKr86RopVdbqr/xax3ZUkenEdrq+E5djH7ELE+
	 d/HKdeHOr6oUgPgO87SIhScoJiLg74LvY+nicr2C4TBJJ9ckEDUSuyzAoRKjqDOHHX
	 OuWD8ePKXrr9g==
Date: Mon, 5 Aug 2024 18:03:52 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    xen-devel@lists.xenproject.org, consulting@bugseng.com
Subject: Re: [PATCH] automation: fix eclair scanning for merge requests
In-Reply-To: <f5990dbcf0131768fdfd35bfdfd8930c@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2408051712320.4954@ubuntu-linux-20-04-desktop>
References: <alpine.DEB.2.22.394.2408011500280.114241@ubuntu-linux-20-04-desktop> <f5990dbcf0131768fdfd35bfdfd8930c@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Sat, 3 Aug 2024, Nicola Vetrini wrote:
> On 2024-08-02 00:06, Stefano Stabellini wrote:
> > The ECLAIR jobs part of the Gitlab CI pipeline fail reliably when the
> > pipeline is started from a merge request. This is the error:
> > 
> > Unexpected event pull_request
> > 
> > The error is a consequence of action.settings setting event=pull_request
> > for merge_request_event. Given that we don't need any special behavior
> > from ECLAIR for merge requests, just run the regular scan, change
> > action.settings to set event=push for merge_request_event (same as for
> > pipeline triggered by git push).
> > 
> 
> According to my analysis, the error stems from the fact that
> automation/scripts/eclair unconditionally calls action_push.sh, which is not
> designed to handle merge requests (that would be action_pull_request.sh). One
> approach, that needs to be tested, could be to execute that second script
> based on the value of ${CI_PIPELINE_SOURCE}.
> 
> The main difference the approach taken in this patch is that the analysis
> results will be relative to the nearest merge point with the staging tree. If
> that's not something that is desired, then this approach looks good to me.

You are right. I tested the below and it works as expected, see:
https://gitlab.com/xen-project/people/sstabellini/xen/-/pipelines/1401863307


---
>From dee036081cb367862daba264e1eb84ca2505f678 Mon Sep 17 00:00:00 2001
From: Stefano Stabellini <stefano.stabellini@amd.com>
Date: Mon, 5 Aug 2024 14:24:23 -0700
Subject: [PATCH] automation: fix eclair gitlab jobs for merge requests

The "eclair" script calls action_push.sh even for merge request, while
instead action_pull_request.sh should be called, resulting in a job
failure with this error:

Unexpected event pull_request

Fix the script to call action_pull_request.sh appropriately.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
 automation/eclair_analysis/ECLAIR/action_pull_request.sh | 2 +-
 automation/scripts/eclair                                | 9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 automation/eclair_analysis/ECLAIR/action_pull_request.sh

diff --git a/automation/eclair_analysis/ECLAIR/action_pull_request.sh b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
old mode 100644
new mode 100755
index 68f7e6282e..812238e07f
--- a/automation/eclair_analysis/ECLAIR/action_pull_request.sh
+++ b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
@@ -3,7 +3,7 @@
 set -eu
 
 usage() {
-    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR COMMIT_ID" >&2
+    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR" >&2
     exit 2
 }
 
diff --git a/automation/scripts/eclair b/automation/scripts/eclair
index ebcaf09b54..97d743ab53 100755
--- a/automation/scripts/eclair
+++ b/automation/scripts/eclair
@@ -21,5 +21,12 @@ ex=0
 # Fail in case of new reports for clean guidelines
 "${ECLAIR_DIR}/action_check_clean_regressions.sh" "${ECLAIR_OUTPUT_DIR}" || ex=$?
 
-"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
+case "${CI_PIPELINE_SOURCE}" in
+merge_request_event)
+    "${ECLAIR_DIR}/action_pull_request.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
+    ;;
+push | pipeline | web | schedule)
+    "${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
+    ;;
+esac
 [ "${ex}" = 0 ] || exit "${ex}"
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 03:00:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 03:00:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772455.1182900 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbAQo-0001OO-E7; Tue, 06 Aug 2024 03:00:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772455.1182900; Tue, 06 Aug 2024 03:00:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbAQo-0001OH-AU; Tue, 06 Aug 2024 03:00:14 +0000
Received: by outflank-mailman (input) for mailman id 772455;
 Tue, 06 Aug 2024 03:00:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbAQn-0001O7-Lj; Tue, 06 Aug 2024 03:00:13 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbAQn-0002dF-BY; Tue, 06 Aug 2024 03:00:13 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbAQm-0002yk-Ts; Tue, 06 Aug 2024 03:00:12 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbAQm-00026S-Sh; Tue, 06 Aug 2024 03:00:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Zq5EnyJVwLuwuy6/5NV2uxOtfnV/DInIbURjb2Nx2+w=; b=qa7/StStiSF4EJP3RvcgyUaoow
	WQTjSTzZIF9OAbzqax2DWjWBSuXxPLv0xnvrjEJ7Evf6AoX6oHW0VviC7+sZN5Uvxynp+v8kQ4gM8
	EOugpwa598+veZeZOg2n74Hue9oRtP4hP0H4UcDY2ybJAKDtKeBoIR72B27C1QPKuwNw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187165-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187165: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=1b37b3659b5098f764dee5b893e4eb174949f40a
X-Osstest-Versions-That:
    ovmf=51ada84cd57c5ef6c75a72aeb002226cf9180b21
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 06 Aug 2024 03:00:12 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 1b37b3659b5098f764dee5b893e4eb174949f40a
baseline version:
 ovmf                 51ada84cd57c5ef6c75a72aeb002226cf9180b21

Last test of basis   187162  2024-08-05 19:41:27 Z    0 days
Testing same since   187165  2024-08-06 01:16:31 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Michael Kubacki <michael.kubacki@microsoft.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   51ada84cd5..1b37b3659b  1b37b3659b5098f764dee5b893e4eb174949f40a -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 06:04:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 06:04:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772471.1182910 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbDIt-0001fq-QD; Tue, 06 Aug 2024 06:04:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772471.1182910; Tue, 06 Aug 2024 06:04:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbDIt-0001fj-Mw; Tue, 06 Aug 2024 06:04:15 +0000
Received: by outflank-mailman (input) for mailman id 772471;
 Tue, 06 Aug 2024 06:04:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbDIs-0001fZ-AN; Tue, 06 Aug 2024 06:04:14 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbDIs-0006LA-4b; Tue, 06 Aug 2024 06:04:14 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbDIr-0007xS-P8; Tue, 06 Aug 2024 06:04:13 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbDIr-00023Y-Of; Tue, 06 Aug 2024 06:04:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Y8Gnlraoel/tqtLH4UrUsDZLIeCusJteDeTlXknHp+k=; b=fdKWiDaZBPYI/xCBsyephHtwBW
	B6TVyrC3WFLMvm6wLaQ3v4+qvplUUZawPxdEWKBrRe186uNMhu8o0voKCsfc39/lUaiKZBPioiNUd
	/00Mxmc8/BtJtFqbG7wqlw01fcsrT55OV6n5sbC3BVQBoOWWLxJ96bDkrPXCrZICmuBc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187166-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187166: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=472be4d139b26c50949cf30eeb47640810e5ef2c
X-Osstest-Versions-That:
    ovmf=1b37b3659b5098f764dee5b893e4eb174949f40a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 06 Aug 2024 06:04:13 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 472be4d139b26c50949cf30eeb47640810e5ef2c
baseline version:
 ovmf                 1b37b3659b5098f764dee5b893e4eb174949f40a

Last test of basis   187165  2024-08-06 01:16:31 Z    0 days
Testing same since   187166  2024-08-06 03:43:14 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Aaron Pop <aaronpop@microsoft.com>
  John Schock <joschock@microsoft.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   1b37b3659b..472be4d139  472be4d139b26c50949cf30eeb47640810e5ef2c -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 06:26:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 06:26:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772483.1182919 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbDdu-0004vD-FK; Tue, 06 Aug 2024 06:25:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772483.1182919; Tue, 06 Aug 2024 06:25:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbDdu-0004v6-Cm; Tue, 06 Aug 2024 06:25:58 +0000
Received: by outflank-mailman (input) for mailman id 772483;
 Tue, 06 Aug 2024 06:25: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=kFQN=PF=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbDdt-0004v0-9v
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 06:25:57 +0000
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com
 [2a00:1450:4864:20::62a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bcc9338d-53bc-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 08:25:56 +0200 (CEST)
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a7ad02501c3so15303166b.2
 for <xen-devel@lists.xenproject.org>; Mon, 05 Aug 2024 23:25:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9d43065sm519356866b.98.2024.08.05.23.25.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 05 Aug 2024 23:25:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bcc9338d-53bc-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722925555; x=1723530355; 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=fPXs82CIu9qIA00V7IsOlmsbygJW8qXAzf+BDJDLt6I=;
        b=d+LvXnCU56JlolFLsAG98o8nE3ZjfyXXfXNbSJS4UpI7sLJtuzmSB5wuFkjJqXJuyW
         kUpJ3T3Msh+a9di9Z6vqx02V3CaSN92mX/G/L56bigisPtb/YcgQ9Dbv7xPAar9wI0Tb
         oyB7Ajdq7OYK3drZr1lNRYDe9hvZok47pcCfM2MdgmQogbIjwYJQ+dt8XO+fYBeJKsoU
         3/OgjPKI3TMQvnE2ZpwaUkeb0IOFq1DD1VLKismR1eHpKyUahbbFaUFqzLaw0JoPZ5vA
         jwiySQJPEuUsj3ORZPIZZ7E2sheUWd5l79CItZ5OhL0PQVQjOYrtuXw7/27gylVRFUoh
         KJ9w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722925555; x=1723530355;
        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=fPXs82CIu9qIA00V7IsOlmsbygJW8qXAzf+BDJDLt6I=;
        b=ITipDbX9oFBFQondPxbCN4R/u2J4R6S0sjk1TEP1L/MTvNyBfKxYAyU/vWVPPfCpEh
         bdOHaamISiAYJwq3i398n5FPoSkl5sgjn6sNaoavbJDgPHdfmciDnhr23h/BlDAGzhAM
         aGv6Q2SvfZBkNKklmggtdovWTchAYIiD1iQJzpowELg15i4lqToUJTG9Ud0IQg/xCXQH
         n5aCS1zkqhJAUhSOU5fTJNH3N1ODgqB2uBgV/iYW01i3ABD+r7MGUuJMCzNYFznpRYTv
         9ERyWgY6mffkMxBf12Edbu3sLABf57NtyYl3eZU8LYM500Qv9zxaQr2kUg86mQ7UzV05
         VJTA==
X-Forwarded-Encrypted: i=1; AJvYcCWDNGTqJJlfqTiT+VHx1K4mMyDESuga4Vw4lxcjzR2vS8l4CwlVCjczDFMErqY/o2NwRfHi/Ays+NjBCVZCk+8MAB57OMhuWAiCks+3qfY=
X-Gm-Message-State: AOJu0YzyVlBNVv+GMlW3O8bK9YhG8I2Y9wDoWqlPcSWwIZyVkpGqbjsP
	WXeXIbtrrIGI8DE6niOoB2dqjQ6ma5AChDMRb/sl4mOpUkahfpY09T1vs6BkJOPv/3tX+Vp5HqE
	=
X-Google-Smtp-Source: AGHT+IEtFihKaip9pJbqKpHzM+npRuRnKbixYNaDsvMrm1dEq1NG94STVcn7bzU6xSk67qn6uFnAnQ==
X-Received: by 2002:a17:907:2daa:b0:a7a:ab1a:2d71 with SMTP id a640c23a62f3a-a7dc51bd5cbmr1017321066b.59.1722925555212;
        Mon, 05 Aug 2024 23:25:55 -0700 (PDT)
Message-ID: <38836a27-951f-49c8-a10e-e19b910a8444@suse.com>
Date: Tue, 6 Aug 2024 08:25:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/msi: fix locking for SRIOV devices
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <20240805210956.364624-1-stewart.hildebrand@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240805210956.364624-1-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 05.08.2024 23:09, Stewart Hildebrand wrote:
> In commit 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci
> structure") a lock moved from allocate_and_map_msi_pirq() to the caller
> and changed from pcidevs_lock() to read_lock(&d->pci_lock). However, one
> call path wasn't updated to reflect the change, leading to a failed
> assertion observed on debug builds of Xen when an SRIOV device is
> present with one or more VFs enabled:
> 
> (XEN) Assertion 'd || pcidevs_locked()' failed at drivers/passthrough/pci.c:535
> (XEN) ----[ Xen-4.20-unstable  x86_64  debug=y  Not tainted ]----

There must be more to this than just "SR-IOV with VFs enabled"? The
locking change has been there for quite a while, yet the issue was
noticed only know.

> @@ -829,7 +829,8 @@ static int msix_capability_init(struct pci_dev *dev,
>              vf = dev->sbdf.bdf;
>          }
>  
> -        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
> +        table_paddr = read_pci_mem_bar(dev->domain, seg, pbus, pslot, pfunc,
> +                                       bir, vf);

While dev->domain is the owner of dev (seg:bus:slot.func), it may not be
the owner of seg:pbus:pslot.pfunc. Or if it (reliably) is, I'd expect the
guarantees towards that to be spelled out in the description. (Dependency
on ordering of toolstack operations likely wouldn't count as a guarantee
to me. Yet if I'm not mistaken there's a problem in all cases if the VF
was already moved to DomIO, before the DomU is started.)

Further to this, until realizing that the code path leading here is
accessible only for Dom0, I suspected a security angle to this, and hence
didn't respond publicly on Matrix. I noticed, however, that apparently
there's another instance of the same issue (via the other call site of
allocate_and_map_msi_pirq(), i.e. from vpci_msix_arch_enable_entry()
through vpci_msi_enable()). Imo that wants dealing with at the same time
(potentially requiring a different overall approach).

The code path leading here being accessible only for Dom0 likely is also
a mistake (read: overly strict). In principle it ought to be possible to
move a PF to a driver domain, for the VFs to then be assigned to
individual DomU-s. In such a case I expect it shouldn't be Dom0 to invoke
PHYSDEVOP_prepare_msix.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 06:35:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 06:35:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772492.1182930 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbDnD-0006p6-BI; Tue, 06 Aug 2024 06:35:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772492.1182930; Tue, 06 Aug 2024 06:35:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbDnD-0006oy-7R; Tue, 06 Aug 2024 06:35:35 +0000
Received: by outflank-mailman (input) for mailman id 772492;
 Tue, 06 Aug 2024 06:35:33 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7YTl=PF=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1sbDnB-0006oZ-Sv
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 06:35:33 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 13efac80-53be-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 08:35:31 +0200 (CEST)
Received: from support.bugseng.com (support.bugseng.com [162.55.131.47])
 by support.bugseng.com (Postfix) with ESMTPA id DAD254EE0738;
 Tue,  6 Aug 2024 08:35:30 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 13efac80-53be-11ef-8776-851b0ebba9a2
MIME-Version: 1.0
Date: Tue, 06 Aug 2024 08:35:30 +0200
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com
Subject: Re: [PATCH] automation: fix eclair scanning for merge requests
In-Reply-To: <alpine.DEB.2.22.394.2408051712320.4954@ubuntu-linux-20-04-desktop>
References: <alpine.DEB.2.22.394.2408011500280.114241@ubuntu-linux-20-04-desktop>
 <f5990dbcf0131768fdfd35bfdfd8930c@bugseng.com>
 <alpine.DEB.2.22.394.2408051712320.4954@ubuntu-linux-20-04-desktop>
Message-ID: <876a1792599b8a10fb49eefb10d475bc@bugseng.com>
X-Sender: simone.ballarin@bugseng.com
Organization: BUGSENG s.r.l.
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit

On 2024-08-06 03:03, Stefano Stabellini wrote:
> On Sat, 3 Aug 2024, Nicola Vetrini wrote:
>> On 2024-08-02 00:06, Stefano Stabellini wrote:
>> > The ECLAIR jobs part of the Gitlab CI pipeline fail reliably when the
>> > pipeline is started from a merge request. This is the error:
>> >
>> > Unexpected event pull_request
>> >
>> > The error is a consequence of action.settings setting event=pull_request
>> > for merge_request_event. Given that we don't need any special behavior
>> > from ECLAIR for merge requests, just run the regular scan, change
>> > action.settings to set event=push for merge_request_event (same as for
>> > pipeline triggered by git push).
>> >
>> 
>> According to my analysis, the error stems from the fact that
>> automation/scripts/eclair unconditionally calls action_push.sh, which 
>> is not
>> designed to handle merge requests (that would be 
>> action_pull_request.sh). One
>> approach, that needs to be tested, could be to execute that second 
>> script
>> based on the value of ${CI_PIPELINE_SOURCE}.
>> 
>> The main difference the approach taken in this patch is that the 
>> analysis
>> results will be relative to the nearest merge point with the staging 
>> tree. If
>> that's not something that is desired, then this approach looks good to 
>> me.
> 
> You are right. I tested the below and it works as expected, see:
> https://gitlab.com/xen-project/people/sstabellini/xen/-/pipelines/1401863307
> 
> 

Hi Stefano,

the patch looks ok. Don't know whether is should be submitted again. 
Only one minor nit:

> ---
> From dee036081cb367862daba264e1eb84ca2505f678 Mon Sep 17 00:00:00 2001
> From: Stefano Stabellini <stefano.stabellini@amd.com>
> Date: Mon, 5 Aug 2024 14:24:23 -0700
> Subject: [PATCH] automation: fix eclair gitlab jobs for merge requests
> 
> The "eclair" script calls action_push.sh even for merge request, while
> instead action_pull_request.sh should be called, resulting in a job
> failure with this error:
> 
> Unexpected event pull_request
> 
> Fix the script to call action_pull_request.sh appropriately.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
> ---
>  automation/eclair_analysis/ECLAIR/action_pull_request.sh | 2 +-
>  automation/scripts/eclair                                | 9 ++++++++-
>  2 files changed, 9 insertions(+), 2 deletions(-)
>  mode change 100644 => 100755 
> automation/eclair_analysis/ECLAIR/action_pull_request.sh
> 
> diff --git a/automation/eclair_analysis/ECLAIR/action_pull_request.sh 
> b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
> old mode 100644
> new mode 100755
> index 68f7e6282e..812238e07f
> --- a/automation/eclair_analysis/ECLAIR/action_pull_request.sh
> +++ b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
> @@ -3,7 +3,7 @@
>  set -eu
> 
>  usage() {
> -    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR COMMIT_ID" >&2
> +    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR" >&2
>      exit 2
>  }
> 
> diff --git a/automation/scripts/eclair b/automation/scripts/eclair
> index ebcaf09b54..97d743ab53 100755
> --- a/automation/scripts/eclair
> +++ b/automation/scripts/eclair
> @@ -21,5 +21,12 @@ ex=0
>  # Fail in case of new reports for clean guidelines
>  "${ECLAIR_DIR}/action_check_clean_regressions.sh" 
> "${ECLAIR_OUTPUT_DIR}" || ex=$?
> 
> -"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
> +case "${CI_PIPELINE_SOURCE}" in
> +merge_request_event)
> +    "${ECLAIR_DIR}/action_pull_request.sh" "${WTOKEN}" 
> "${ECLAIR_OUTPUT_DIR}"
> +    ;;
> +push | pipeline | web | schedule)
> +    "${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
> +    ;;
> +esac

here I think it's better to give an error if the event is not handled. 
Something similar to

*)
     echo "Unexpected event ${CI_PIPELINE_SOURCE}" >&2
     ex=1
     ;;


>  [ "${ex}" = 0 ] || exit "${ex}"



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 07:03:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 07:03:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772505.1182952 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbEEY-0003G6-FW; Tue, 06 Aug 2024 07:03:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772505.1182952; Tue, 06 Aug 2024 07:03:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbEEY-0003Fz-Cr; Tue, 06 Aug 2024 07:03:50 +0000
Received: by outflank-mailman (input) for mailman id 772505;
 Tue, 06 Aug 2024 07:03:49 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbEEX-0003Fp-04; Tue, 06 Aug 2024 07:03:49 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbEEW-0007RN-JY; Tue, 06 Aug 2024 07:03:48 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbEEW-00013f-3Z; Tue, 06 Aug 2024 07:03:48 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbEEW-0006T5-31; Tue, 06 Aug 2024 07:03:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=n4SOR8+D7tP+TzBNOP0qePlyFaj0NSjTMusilKAt2GE=; b=25K2TR6/k7MPu7t3gcuKAGiwSk
	H+XIfHKIcsFnFMLsbezuTjybDesjh/mwZbuUXmUaaMihNQMXAf85XMedZy4qLzrNxrCaIz//hUGvV
	wLtE7yYUl60gXR0MsZvhsCp9d7bhoAP80jaL8SxENwx1gjZNOve6ABxPb6ekdXYaVGAE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187163-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187163: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-armhf-armhf-xl-raw:debian-di-install:fail:regression
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=c813111d19e65b6336a6352eae9c1ff5c40f722f
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 06 Aug 2024 07:03:48 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827
 test-armhf-armhf-xl-raw      12 debian-di-install        fail REGR. vs. 186827

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

version targeted for testing:
 linux                c813111d19e65b6336a6352eae9c1ff5c40f722f
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   20 days
Failing since        186925  2024-07-20 09:44:52 Z   16 days   34 attempts
Testing same since   187163  2024-08-05 20:40:53 Z    0 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 07:05:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 07:05:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772516.1182962 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbEFZ-0003pL-UQ; Tue, 06 Aug 2024 07:04:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772516.1182962; Tue, 06 Aug 2024 07:04:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbEFZ-0003pE-RJ; Tue, 06 Aug 2024 07:04:53 +0000
Received: by outflank-mailman (input) for mailman id 772516;
 Tue, 06 Aug 2024 07:04:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=nfQe=PF=inria.fr=fonyuy-asheri.caleb@srs-se1.protection.inumbo.net>)
 id 1sbEFY-0003gs-5J
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 07:04:52 +0000
Received: from mail2-relais-roc.national.inria.fr
 (mail2-relais-roc.national.inria.fr [192.134.164.83])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2c8244a2-53c2-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 09:04:51 +0200 (CEST)
Received: from zcs2-store8.inria.fr ([128.93.142.6])
 by mail2-relais-roc.national.inria.fr with ESMTP; 06 Aug 2024 09:04:51 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2c8244a2-53c2-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
  d=inria.fr; s=dc;
  h=date:from:to:cc:message-id:in-reply-to:references:
   subject:mime-version:content-transfer-encoding;
  bh=JBO23CLncQN8Wua0Tl4SDw612qo/NR9TnhmVZJi8TP0=;
  b=agrebRzL+KVAzgk5gYAhlttvvWdWevZ+ofVpIWlmvhDAu8Uxqx+uuTTU
   U9fUVa1S+ylwPPA2mdz5d1VQy+8hzmqWnFzswy4+cileAtUvntM1kr1Mn
   BGb1R+IVIs0HTuBSvkDPoggt6E2Tj5EvB760I5xMvawplIS/epQxYYSFl
   4=;
Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=Pass smtp.mailfrom=fonyuy-asheri.caleb@inria.fr; spf=None smtp.helo=postmaster@zcs2-store8.inria.fr
Received-SPF: Pass (mail2-relais-roc.national.inria.fr: domain of
  fonyuy-asheri.caleb@inria.fr designates 128.93.142.6 as
  permitted sender) identity=mailfrom; client-ip=128.93.142.6;
  receiver=mail2-relais-roc.national.inria.fr;
  envelope-from="fonyuy-asheri.caleb@inria.fr";
  x-sender="fonyuy-asheri.caleb@inria.fr";
  x-conformance=spf_only; x-record-type="v=spf1";
  x-record-text="v=spf1 include:mailout.safebrands.com
  a:basic-mail.safebrands.com a:basic-mail01.safebrands.com
  a:basic-mail02.safebrands.com ip4:128.93.142.0/24
  ip4:192.134.164.0/24 ip4:128.93.162.160 ip4:89.107.174.7 mx
  ~all"
Received-SPF: None (mail2-relais-roc.national.inria.fr: no sender
  authenticity information available from domain of
  postmaster@zcs2-store8.inria.fr) identity=helo;
  client-ip=128.93.142.6;
  receiver=mail2-relais-roc.national.inria.fr;
  envelope-from="fonyuy-asheri.caleb@inria.fr";
  x-sender="postmaster@zcs2-store8.inria.fr";
  x-conformance=spf_only
X-IronPort-AV: E=Sophos;i="6.09,267,1716242400"; 
   d="scan'208";a="178219637"
X-MGA-submission: =?us-ascii?q?MDFeyFYrsujnHhHSNTFYbq2D8e3fbgJ5bplJhB?=
 =?us-ascii?q?ND1we4I+xHbNk5DkNLE0hdDBbBL5AORqZ6fCtZzt0eRhEtv+cSat9xJx?=
 =?us-ascii?q?v5Ac25E8FH4J34A9mj0w7GVOYC7WKjDqzLlYTySPBVLxMX0GgjS0prIo?=
 =?us-ascii?q?PNMge8W5t81g64xn5X9Gih/w=3D=3D?=
Date: Tue, 6 Aug 2024 09:04:50 +0200 (CEST)
From: Fonyuy-Asheri Caleb <fonyuy-asheri.caleb@inria.fr>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>, xen-devel <xen-devel@lists.xenproject.org>
Message-ID: <120712863.15929301.1722927890402.JavaMail.zimbra@inria.fr>
In-Reply-To: <ece26efe-c1af-4fd2-910d-01a33beda5cc@citrix.com>
References: <60751777.2038091.1720694327760.JavaMail.zimbra@inria.fr> <94e94a94-14f2-4fa6-bc3b-6c64c1b84b59@citrix.com> <1546743760.2065506.1720696161057.JavaMail.zimbra@inria.fr> <8f8dac21-92fe-4760-8578-2fbfde2f2c14@citrix.com> <1557490999.4048664.1721029086794.JavaMail.zimbra@inria.fr> <77f1ff6e-a7dd-45c8-b706-429674b559f2@suse.com> <ece26efe-c1af-4fd2-910d-01a33beda5cc@citrix.com>
Subject: Re: Help with Understanding vcpu xstate restore error during vm
 migration
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Originating-IP: [131.254.23.3]
X-Mailer: Zimbra 10.0.8_GA_4611 (ZimbraWebClient - GC127 (Linux)/10.0.8_GA_4611)
Thread-Topic: Help with Understanding vcpu xstate restore error during vm migration
Thread-Index: 9qK/H/iwr6ZqhrFw+kugctFayT/D5A==

Hello Andrew,=20
Hello Jan,

Please permit me to come back to this once again.=20

> On 15/07/2024 9:16 am, Jan Beulich wrote:
>> On 15.07.2024 09:38, Fonyuy-Asheri Caleb wrote:
>>>> Perhaps the more important question, are you booting the skylake with
>>>> cpuid=3Dno-avx on the command line by any chance?
>>> No. I didn't boot any of the machines with any cpuid modification whats=
oever.
>> Yet is there perhaps "Mitigating GDS by disabling AVX" in the boot log o=
f
>> the hypervisor (which sadly so far you didn't supply anywhere afaics)?
>=20
> Oh - good point.=A0 I'd completely forgotten about that.
>=20
> If you've got out-of-date microcode (specifically microcode prior to
> 2023-08-08), then yes, Xen will disable AVX by default to mitigate
> CVE-2022-40982 / "Gather Data Sampling", and the symptoms would look
> exactly like this.
>=20
> ~Andrew


I was able to obtain access to an Ice Lake Xeon processor
which is one of the processors affected by the GDS vulnerability.

I will like to know what could be the effect of this "cpuid=3Dno-avx" xen d=
efault
on the xstates handled by the system. How does this disabling manifest itse=
lf=20
between on my CPUID or list of features?=20

Also, I would like to understand the relationship between xstates in xen an=
d xsave
dependencies on the system? I was expecting to have more xstates once i hav=
e more
xsave dependencies but was surprised to notice a live migration go through =
from a=20
cpu with more xsave dependencies to one with fewer dependencies(features wh=
ich=20
use xsave). Is there something I'm understanding wrongly?=20

Lastly, during vm migration, do we consider all possible xstates or just th=
e active=20
xstates of the cpu? I am not able to figure that out from the code yet.=20


Thank you in advance

Caleb


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 07:24:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 07:24:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772528.1182971 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbEYV-0007HM-HE; Tue, 06 Aug 2024 07:24:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772528.1182971; Tue, 06 Aug 2024 07:24:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbEYV-0007HF-EQ; Tue, 06 Aug 2024 07:24:27 +0000
Received: by outflank-mailman (input) for mailman id 772528;
 Tue, 06 Aug 2024 07:24:26 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=kFQN=PF=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbEYU-0007H9-9i
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 07:24:26 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e773c953-53c4-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 09:24:24 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5afa207b8bfso256993a12.0
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 00:24:23 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5baec9a2818sm3102043a12.61.2024.08.06.00.24.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 06 Aug 2024 00:24:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e773c953-53c4-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722929063; x=1723533863; 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=WbIyOJ9gzY7TRfqlw7xGjPDDzi5zeJl+EwN6wz/Pya4=;
        b=Q9DFzmMklmfyqNeNLrs57xQQ1BuhtqP4rln9j3Zd+1YQC9M2u57Dq2nLh3Y9wcxc3r
         xNvw9OZOigGTuOVVc4d6xbM/fqbP8l+b+e531akHi4Tk2ZuJyq5cuOx71G53BEck8lYc
         df+IMfpr8+L7REjPeqZc+t51gwlajnhlGZo04piRnDQoM7+EUGwdjMSCDzB10EpGJy3Y
         b/J/9DbX4T+yCZBU1Siu6l7RmVBa7oZAlhTCm7EnzKRTakWx3RjfrmnWMpDlOiP1K7/M
         TXTAlMDOsIhlHYZFkg6yoVoESnZwd9DT+PjnKCp2J9n29gRrty4Mz6OkD+BOa7YNaahP
         qKzA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722929063; x=1723533863;
        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=WbIyOJ9gzY7TRfqlw7xGjPDDzi5zeJl+EwN6wz/Pya4=;
        b=wYmDSao3iWmyLGJgpyhyWKq7ncyc4/dfJFkcHfGayxu1QVnGnsXXGxm9p6vf8/AS6q
         aVssRas2L78phbr8kOrtlpxgKHSb8PeIPQCtqTmmwmbrFeH2cn+o2/WMC8guV7sKjeza
         WYtgM5FZJOBxSvwt/pwOV+I+JSYBay3awLU32x8aJJ5igeB++qTpik+glHn9SYEALJno
         /aNdppie8XkcNRN9m0/VfyHMBSwD9444aE02GLGZyrxtsNUh2KOdJLinxOOVjjIhq1LF
         k3ntr/v0p674pVRhZDnhYwBQlGgoDqVj4ieXZAQFiDVYocgYhhUbttSzU6ZiTwcN6uG9
         otIw==
X-Gm-Message-State: AOJu0YzFAc75E4zJSs8zK6HPlcZToh7YDj01iRwL4JB1fDyHcUk5ci7W
	7mH5pc5tIxI02aJHdhw4Lz6RuDLGUTMgAfUJPAxdLZF93VIH8zKfKu8GPWzP4tXIUNoQqvcxHvQ
	=
X-Google-Smtp-Source: AGHT+IH/oGgqXqZahz/hxqJJlhnCsbL4EMrjgFZbNkeBg6+WtuMn5o2q77CmiJik937CQmpMqYDkaw==
X-Received: by 2002:a05:6402:2689:b0:5b9:462d:c539 with SMTP id 4fb4d7f45d1cf-5b9462dcb76mr9288594a12.3.1722929062769;
        Tue, 06 Aug 2024 00:24:22 -0700 (PDT)
Message-ID: <0f69e94a-5720-4f1f-b51d-b4fb2c6bbe0b@suse.com>
Date: Tue, 6 Aug 2024 09:24:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Help with Understanding vcpu xstate restore error during vm
 migration
To: Fonyuy-Asheri Caleb <fonyuy-asheri.caleb@inria.fr>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>
References: <60751777.2038091.1720694327760.JavaMail.zimbra@inria.fr>
 <94e94a94-14f2-4fa6-bc3b-6c64c1b84b59@citrix.com>
 <1546743760.2065506.1720696161057.JavaMail.zimbra@inria.fr>
 <8f8dac21-92fe-4760-8578-2fbfde2f2c14@citrix.com>
 <1557490999.4048664.1721029086794.JavaMail.zimbra@inria.fr>
 <77f1ff6e-a7dd-45c8-b706-429674b559f2@suse.com>
 <ece26efe-c1af-4fd2-910d-01a33beda5cc@citrix.com>
 <120712863.15929301.1722927890402.JavaMail.zimbra@inria.fr>
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: <120712863.15929301.1722927890402.JavaMail.zimbra@inria.fr>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 06.08.2024 09:04, Fonyuy-Asheri Caleb wrote:
>> On 15/07/2024 9:16 am, Jan Beulich wrote:
>>> On 15.07.2024 09:38, Fonyuy-Asheri Caleb wrote:
>>>>> Perhaps the more important question, are you booting the skylake with
>>>>> cpuid=no-avx on the command line by any chance?
>>>> No. I didn't boot any of the machines with any cpuid modification whatsoever.
>>> Yet is there perhaps "Mitigating GDS by disabling AVX" in the boot log of
>>> the hypervisor (which sadly so far you didn't supply anywhere afaics)?
>>
>> Oh - good point.  I'd completely forgotten about that.
>>
>> If you've got out-of-date microcode (specifically microcode prior to
>> 2023-08-08), then yes, Xen will disable AVX by default to mitigate
>> CVE-2022-40982 / "Gather Data Sampling", and the symptoms would look
>> exactly like this.
> 
> I was able to obtain access to an Ice Lake Xeon processor
> which is one of the processors affected by the GDS vulnerability.
> 
> I will like to know what could be the effect of this "cpuid=no-avx" xen default
> on the xstates handled by the system. How does this disabling manifest itself 
> between on my CPUID or list of features? 
> 
> Also, I would like to understand the relationship between xstates in xen and xsave
> dependencies on the system? I was expecting to have more xstates once i have more
> xsave dependencies but was surprised to notice a live migration go through from a 
> cpu with more xsave dependencies to one with fewer dependencies(features which 
> use xsave). Is there something I'm understanding wrongly? 

Here and ...

> Lastly, during vm migration, do we consider all possible xstates or just the active 
> xstates of the cpu? I am not able to figure that out from the code yet. 

... here everything depends on what the guest gets to see. I.e. in your wording
"possible" would mean "possible from the guest's perspective", i.e. what it sees
when it executes CPUID insns with respective inputs. During migration we cannot
go below that, but we certainly can go below what the host may support.

If what you say in the earlier paragraph was the case with upstream Xen and
without you restricting what the guest being migrated was able to see on the
source host, then I think that would indicate a bug somewhere. Yet you don't
provide enough details to be certain.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 07:34:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 07:34:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772537.1182982 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbEi3-0001FE-EB; Tue, 06 Aug 2024 07:34:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772537.1182982; Tue, 06 Aug 2024 07:34:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbEi3-0001F7-B4; Tue, 06 Aug 2024 07:34:19 +0000
Received: by outflank-mailman (input) for mailman id 772537;
 Tue, 06 Aug 2024 07:34:17 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=nfQe=PF=inria.fr=fonyuy-asheri.caleb@srs-se1.protection.inumbo.net>)
 id 1sbEi1-0001F1-Nh
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 07:34:17 +0000
Received: from mail2-relais-roc.national.inria.fr
 (mail2-relais-roc.national.inria.fr [192.134.164.83])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 480b0395-53c6-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 09:34:15 +0200 (CEST)
Received: from zcs2-store8.inria.fr ([128.93.142.6])
 by mail2-relais-roc.national.inria.fr with ESMTP; 06 Aug 2024 09:34:15 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 480b0395-53c6-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
  d=inria.fr; s=dc;
  h=date:from:to:cc:message-id:in-reply-to:references:
   subject:mime-version:content-transfer-encoding;
  bh=Z98VQ38ku/mETtiGB8IuvHlvVOg98ozTyb7LHbx4RxU=;
  b=aCG2bqa5jGiTodO2MOkV7DJjY5PD7AXOxUIcYkN2szTq1Gi1D4ZtVHMT
   eEnBDYqdUktZgaMSI+G0oFsaNYkxaJhAiaNRUfmTbTuwWI+nFXa7QzzvY
   uRnPjo7bX9tZZIpSVG6P+yUr9tK+rZgxEdfyV8qLRbH4ktXsKUyo7AKx+
   w=;
Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=Pass smtp.mailfrom=fonyuy-asheri.caleb@inria.fr; spf=None smtp.helo=postmaster@zcs2-store8.inria.fr
Received-SPF: Pass (mail2-relais-roc.national.inria.fr: domain of
  fonyuy-asheri.caleb@inria.fr designates 128.93.142.6 as
  permitted sender) identity=mailfrom; client-ip=128.93.142.6;
  receiver=mail2-relais-roc.national.inria.fr;
  envelope-from="fonyuy-asheri.caleb@inria.fr";
  x-sender="fonyuy-asheri.caleb@inria.fr";
  x-conformance=spf_only; x-record-type="v=spf1";
  x-record-text="v=spf1 include:mailout.safebrands.com
  a:basic-mail.safebrands.com a:basic-mail01.safebrands.com
  a:basic-mail02.safebrands.com ip4:128.93.142.0/24
  ip4:192.134.164.0/24 ip4:128.93.162.160 ip4:89.107.174.7 mx
  ~all"
Received-SPF: None (mail2-relais-roc.national.inria.fr: no sender
  authenticity information available from domain of
  postmaster@zcs2-store8.inria.fr) identity=helo;
  client-ip=128.93.142.6;
  receiver=mail2-relais-roc.national.inria.fr;
  envelope-from="fonyuy-asheri.caleb@inria.fr";
  x-sender="postmaster@zcs2-store8.inria.fr";
  x-conformance=spf_only
X-IronPort-AV: E=Sophos;i="6.09,267,1716242400"; 
   d="scan'208";a="178222819"
X-MGA-submission: =?us-ascii?q?MDHR/ed5Kbr4qX5PXdcufXevXQAZicie2cFOtX?=
 =?us-ascii?q?YzaKMgm9OfddYtK/og1zuPF+12RJotuigNXDjH3T5JlP6ZALRY/42Xb2?=
 =?us-ascii?q?aAdQ12zPKUgco0dD4zlzyv+3F5bXviErKAv33BlKYFPkmoQnh6JczY3q?=
 =?us-ascii?q?Qh1jpP8LWLongX5yxh7hLHuA=3D=3D?=
Date: Tue, 6 Aug 2024 09:34:14 +0200 (CEST)
From: Fonyuy-Asheri Caleb <fonyuy-asheri.caleb@inria.fr>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, 
	Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <674914344.15937452.1722929654769.JavaMail.zimbra@inria.fr>
In-Reply-To: <0f69e94a-5720-4f1f-b51d-b4fb2c6bbe0b@suse.com>
References: <60751777.2038091.1720694327760.JavaMail.zimbra@inria.fr> <1546743760.2065506.1720696161057.JavaMail.zimbra@inria.fr> <8f8dac21-92fe-4760-8578-2fbfde2f2c14@citrix.com> <1557490999.4048664.1721029086794.JavaMail.zimbra@inria.fr> <77f1ff6e-a7dd-45c8-b706-429674b559f2@suse.com> <ece26efe-c1af-4fd2-910d-01a33beda5cc@citrix.com> <120712863.15929301.1722927890402.JavaMail.zimbra@inria.fr> <0f69e94a-5720-4f1f-b51d-b4fb2c6bbe0b@suse.com>
Subject: Re: Help with Understanding vcpu xstate restore error during vm
 migration
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Originating-IP: [131.254.23.3]
X-Mailer: Zimbra 10.0.8_GA_4611 (ZimbraWebClient - GC127 (Linux)/10.0.8_GA_4611)
Thread-Topic: Help with Understanding vcpu xstate restore error during vm migration
Thread-Index: /VtbDF+0QHvdhs3zRGnfQg/mywn+Ww==

> If what you say in the earlier paragraph was the case with upstream Xen and
> without you restricting what the guest being migrated was able to see on the
> source host, then I think that would indicate a bug somewhere. Yet you don't
> provide enough details to be certain.
> 
> Jan

Sorry for not specifying. I am still in the same context as stated previously. 
I haven't made any modifications to xen and no restrictions on what the guest can see. 

Caleb


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 07:53:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 07:53:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772546.1182993 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbF0N-0004rx-W8; Tue, 06 Aug 2024 07:53:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772546.1182993; Tue, 06 Aug 2024 07:53:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbF0N-0004rq-RR; Tue, 06 Aug 2024 07:53:15 +0000
Received: by outflank-mailman (input) for mailman id 772546;
 Tue, 06 Aug 2024 07:53:14 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=PT90=PF=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sbF0M-0004rk-G5
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 07:53:14 +0000
Received: from NAM02-BN1-obe.outbound.protection.outlook.com
 (mail-bn1nam02on2062c.outbound.protection.outlook.com
 [2a01:111:f403:2407::62c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ed6f23d1-53c8-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 09:53:11 +0200 (CEST)
Received: from BY3PR04CA0015.namprd04.prod.outlook.com (2603:10b6:a03:217::20)
 by MW4PR12MB7312.namprd12.prod.outlook.com (2603:10b6:303:21a::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.24; Tue, 6 Aug
 2024 07:53:07 +0000
Received: from CO1PEPF000042AC.namprd03.prod.outlook.com
 (2603:10b6:a03:217:cafe::76) by BY3PR04CA0015.outlook.office365.com
 (2603:10b6:a03:217::20) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26 via Frontend
 Transport; Tue, 6 Aug 2024 07:53:07 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1PEPF000042AC.mail.protection.outlook.com (10.167.243.41) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Tue, 6 Aug 2024 07:53:06 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 6 Aug
 2024 02:53:05 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 6 Aug
 2024 02:53:05 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Tue, 6 Aug 2024 02:53:04 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ed6f23d1-53c8-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=WAW0Wojw0amHvCnlIs/t2lWx+I3L1Me6PkhNxWsEga4Salpls1mbCh9LLU0NH3t8OkFaqhQTp7ocMMd43SBAHySRUspoiFPf1Esv9Ag0Bg4z6lgYb1MCgQvrZweSDElnugVIVrrMQ+Dzx0LI2qwC7dyOcpAyIbqC7klRLe9iNpxIQHSFJ83GJ8WNN2cZT5n55nQiOOEODlmpeOYtybBdolfNnmt3yVpi2VpNCzDNU41cFxoJ5lTi26z3WILy2wvzNxaV6czQbo63YxJTOBgNhzbTdPdobdQuprMBlegcPRlMhnHNbh4rAU8HcmGjOaA+8zR2iUKwCy6ttUUIRiKW/w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=uoWegJJ4Ymx+vaz/2bMq0zzTdvUXMeTrlvOUuMU4GRs=;
 b=OicCNPd3GzlHVPWGhlUU5CNXsVzme4yAH6f7273im/8vYjKCkPeZ96S+PHO7lMnPW5GPW0J3pqVNW3LshoJMde029zdeFjRtsyI+3psrlkpMws1a+o8+EGMObkldP2e0NL/Lqw7sTWXOK+klrPRyNJTTW5opy7y/Ez12zNyJNRKg1NGVwejn4pMCyvgY46QDQm1ycZ5/N5AF5O0TBX9efwdBLiLHdy4w/zfwymDkbzboukRhJ52IR3jbo5bUsIwSOTlMI5D0HpmCDIBsG0iFgGFfNHAzx3Oj505+Cm6PVntIaMdoDthfeQsARv13w1tjULdJW5MvuyfSbzFWpsCitQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=ti.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=uoWegJJ4Ymx+vaz/2bMq0zzTdvUXMeTrlvOUuMU4GRs=;
 b=1KeGgj0YXGmSoR4O0banjuQhuA77G6/9LNvJsvz1+eQY2H3OBD2/a7aP/xlSwmgASxqGLCM28hbDtmKS8IfadFfz+k1SPnFPs3IuIAlwptc6+zq3x9Vk06QuUkSquiC2hGWyoJaHg0wjzIZ9l0m6PbipMXw/njCQwTjNGZqDX24=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <18deaad4-0bbf-4bf2-919e-7b213a1c8235@amd.com>
Date: Tue, 6 Aug 2024 09:53:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] drivers: char: omap-uart: add "clock-hz" option
To: Amneesh Singh <a-singh21@ti.com>, <xen-devel@lists.xenproject.org>
References: <20240719113313.145587-1-a-singh21@ti.com>
Content-Language: en-US
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240719113313.145587-1-a-singh21@ti.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB05.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000042AC:EE_|MW4PR12MB7312:EE_
X-MS-Office365-Filtering-Correlation-Id: b28d6f26-5784-4700-06f5-08dcb5eccf0b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?QWJPejNkdlNka2VDcGt1dTExVExsSlhsaVNIalhmVUxLbWtFcGlYWkFTVmNx?=
 =?utf-8?B?aFNRZnZ1WWVrWHB0andUV24ySE5WbUVmZ2hmaStzWGVnOFBFbklzSjQ4NFZv?=
 =?utf-8?B?a1p3U3RjRGN2dXRpcnVrWDE5RWovMis2QWZxSlU2MkY2T2xZbk44YXZ2NHpT?=
 =?utf-8?B?OWx5M3JJeHZwRlpKcllPRmNVRTdqYnhwZUVvRk5YRU5Qc1ZlUldrU1dROVFq?=
 =?utf-8?B?ZXNLdHFZM1JQTitneWY3UUVQRFhGdklpTVVYb2hGUXNtMU1RK2kvb1ZTQzQ0?=
 =?utf-8?B?UWZnREFtcTMwWjU2U2psMVRWUUdRR3J1TmFCdzZXd3hIQkh2NktnV2ppZDY4?=
 =?utf-8?B?cUY1MEZzVllYTlRnOGdXQ3ErTnlnaktqakdIcHhJL3l1VkRKYUJna0lCYWxB?=
 =?utf-8?B?SmVpR0ZYVG9sTGVNVmxKVVJiNWRBeVoxZHFJcHZkWEVXYkhyUTdCZENWYXN4?=
 =?utf-8?B?Zk5jTzFya1RDNXFFYStyWktSVk4vc215RElVaWYzZnpjelNKTExJNkFCeTg5?=
 =?utf-8?B?MUE4Tnh6eE5yZTBnZkdTZmxTc24vQ2JaN3FjeXBYeVl6Z1JaYlZpNHVqTDdF?=
 =?utf-8?B?Q0VRVFpSNEZPaVlQY1dndURwa3NqL2dIWkZIMWlZWkVYYXhEZVVSUXZJSGRM?=
 =?utf-8?B?REhlVUNkQmg1dlNtQ2Y0bEZsbEIwOFVOYy9rN3FKdXpYZWp3Z2QxS0pGNEdy?=
 =?utf-8?B?Z3pWaFNUVis1ekdxajRaeHhXelBybFpoelBtcUw0OXRXbkJQZTFDS2tQVWxJ?=
 =?utf-8?B?SkhsQ2k2a1JQcG9YZCtsMWdicFZ1Q2J3VTEveFFTZzJha2hpaGZRdGZPZml0?=
 =?utf-8?B?MjQrckk5b2pUN01yT3hCNThpRGhKdkNIQjNNQSs4Nmh2NVBxS08rbUxPVisz?=
 =?utf-8?B?ZFkveEZZRG94SVNaV05JS1hTOTRtaCtFdngzT0Y4YWpSOGljeTluTExKZXhn?=
 =?utf-8?B?SFdiQm5vdVoxMnlhc2U3RTNweHdjNlVhMndOUEJhaWhoc0JQTk54WVJvblB5?=
 =?utf-8?B?ZGFtL2M3N3k5RzVWSFc2eVowRVR1M0VvSE1rS010K0hyRWNTVXQzMHhRYmJG?=
 =?utf-8?B?Y3E4YTdIdEVkUjh5aVRpd2h1ZG1VbDdKQU1KZ09nRTBRcFNaVU1yZHZoWFhK?=
 =?utf-8?B?ZWN4Z2p4M2kwNFk1ak55Um1tNTBpdFNlL3VISDJ4WEtWVlVnazZSMWZUM2tJ?=
 =?utf-8?B?SjcvS2NqSFdTemtMenZIUG4wN3I3YTAwTXo0SE15dGtERHFhcVJKV0Q4VVRJ?=
 =?utf-8?B?WEt4bVJNWFp0QVRhaDRSSzZ3dW84bUdOQnlGRmtBS3ZXSmY3MkFQb2thRUdF?=
 =?utf-8?B?NFdEV3hqSHJ3U1Nzd3plMFVjQkpmdm83MHNwT0FwbkRRQzh6V096V2FsTDVW?=
 =?utf-8?B?WG04RHZtUk9rNTcxOGo5emVIMDJKWU5JejNkVWNlZHc4cUdKS0dpTm5VS1Ex?=
 =?utf-8?B?dVl4UlpUNXVDWmY3QUlFU3VUa0srZWRoVklaMVE0OWMwUSt2QmFVV2lON1hr?=
 =?utf-8?B?QnFVYi9EU0JmdzkycFBUNzZiS1I3R2l1M0x2K1VNYllXcGpJMXptNE9tTmEv?=
 =?utf-8?B?ZjRZMUgrUGdYLzRvVi9BNWgxamN1RFF5aDA2ampDaDNnUFZyVHJDSUVHK08w?=
 =?utf-8?B?K1IySXlUY1M2UkF2OExhNnZvdXdBcHh6RWZMaFVkUTJ5K1BzOWFkL3NUcUt2?=
 =?utf-8?B?TUl2WnVTOUJrZGNaT095dzNQV0hweFl5THJpWUw3NGkwM3dYeFpTejhma3hC?=
 =?utf-8?B?NFhONlhSM0tJdHVqUWl6QkgvcFhFS0dNaXRuN1crUlQydWxyT1NMZCtwcWtK?=
 =?utf-8?B?RndiQktLZmFuN0pQWCs4SzRLZWdXaEFyanR3aXNLYjlISG13Um90VC8wNm52?=
 =?utf-8?B?R3BaTlcveEhjdkkvaWFGU2tJY05uRExOamd2S1hlM1ZqdStkV2V5c1NXaXdH?=
 =?utf-8?Q?b4BkD6BdtjjQP9jExXFQIMm5MnPLvWUc?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 07:53:06.8408
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b28d6f26-5784-4700-06f5-08dcb5eccf0b
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000042AC.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7312

Hi,

You sent this patch to xen-devel but forgot to CC maintainers. For the future, please use scripts/add_maintainers.pl.
CCing them now.

On 19/07/2024 13:33, Amneesh Singh wrote:
> 
> 
> Quite a few TI K3 devices do not have clock-frequency specified in their
> respective UART nodes. However hard-coding the frequency is not a
Is this property is required? If so, I'd mention that this is to overcome an incorrect device tree.

> solution as the function clock input can differ between SoCs. So,
> similar to com1/com2, let the user pass the frequency as a dtuart option
> via the bootargs. If not specified it will fallback to the same DT
> parsing as before. For example, dtuart=serial2:clock-hz=48000000 can be
> a valid bootarg.
> 
> Signed-off-by: Amneesh Singh <a-singh21@ti.com>
> ---
>  xen/drivers/char/omap-uart.c | 62 +++++++++++++++++++++++++++++-------
>  1 file changed, 50 insertions(+), 12 deletions(-)
> 
> diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
> index 1079198..660c486 100644
> --- a/xen/drivers/char/omap-uart.c
> +++ b/xen/drivers/char/omap-uart.c
> @@ -305,33 +305,71 @@ static struct uart_driver __read_mostly omap_uart_driver = {
>      .vuart_info = omap_vuart_info,
>  };
> 
> +static void __init omap_uart_parse_config(struct omap_uart *uart,
> +                                         const char *config) {
Braces should be placed on their own lines. Refer CODING_STYLE.

> +
> +    char options[256];
256 is a max size of full dtuart string. Since we only parse for clock-hz, do we need the same size here?
Could we say e.g. 64 and extend it in the future if new options will be added?

> +    char *value, *start = options;
Scope of value could be limited to the while loop

> +
> +    if ( !strcmp(config, "") )
> +        return;
> +
> +    strlcpy(options, config, ARRAY_SIZE(options));
> +
> +    while (start != NULL)
White spaces missing. Refer CODING_STYLE.

> +    {
> +        char *name;
> +
> +        /* Parse next name-value pair. */
> +        value = strsep(&start, ",");
> +        name = strsep(&value, "=");
Can name be NULL here? This would want checking for the below strcmp.

> +
> +        if ( !strcmp(name, "clock-hz") )
> +            uart->clock_hz = simple_strtoul(value, NULL, 0);
> +        else
> +            printk("WARNING: UART configuration option %s is not supported\n",
> +                   name);
> +
> +    }
> +}
> +
>  static int __init omap_uart_init(struct dt_device_node *dev,
>                                   const void *data)
>  {
>      const char *config = data;
>      struct omap_uart *uart;
> -    u32 clkspec;
>      int res;
>      paddr_t addr, size;
> 
> -    if ( strcmp(config, "") )
> -        printk("WARNING: UART configuration is not supported\n");
> -
>      uart = &omap_com;
> 
> -    res = dt_property_read_u32(dev, "clock-frequency", &clkspec);
> -    if ( !res )
> -    {
> -        printk("omap-uart: Unable to retrieve the clock frequency\n");
> -        return -EINVAL;
> -    }
> -
> -    uart->clock_hz = clkspec;
> +    /* Default configuration. */
> +    uart->clock_hz = 0;
>      uart->baud = 115200;
>      uart->data_bits = 8;
>      uart->parity = UART_PARITY_NONE;
>      uart->stop_bits = 1;
> 
> +    /*
> +     * Parse dtuart options.
> +     * Valid options:
> +     *   - clock-hz
> +     */
> +    omap_uart_parse_config(uart, config);
> +
> +    /* If clock-hz is missing. */
Apart from missing, clock_hz can be 0 also if user specifies 0

> +    if ( uart->clock_hz == 0 )
> +    {
> +        u32 clkspec;
We are moving away from Linux derived types so please take the occasion to use uint32_t here.
Also, there should be a blank line between definitions/code.

> +        res = dt_property_read_u32(dev, "clock-frequency", &clkspec);
> +        if ( !res )
> +        {
> +            printk("omap-uart: Unable to retrieve the clock frequency\n");
> +            return -EINVAL;
> +        }
> +        uart->clock_hz = clkspec;
> +    }
> +
>      res = dt_device_get_paddr(dev, 0, &addr, &size);
>      if ( res )
>      {
> --
> 2.34.1
> 
> 

~Michal


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 08:40:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 08:40:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772563.1183001 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbFjv-0005EJ-KK; Tue, 06 Aug 2024 08:40:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772563.1183001; Tue, 06 Aug 2024 08:40:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbFjv-0005EC-Gp; Tue, 06 Aug 2024 08:40:19 +0000
Received: by outflank-mailman (input) for mailman id 772563;
 Tue, 06 Aug 2024 08:40:18 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=kFQN=PF=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbFju-0005E6-Eh
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 08:40:18 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 80f440f4-53cf-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 10:40:16 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-5b9d48d1456so953333a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 01:40:16 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b83b82c16dsm5762194a12.76.2024.08.06.01.40.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 06 Aug 2024 01:40:14 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 80f440f4-53cf-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722933616; x=1723538416; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=qkisf6jKS1KBlAD8Y7IQ5SHgqiPRA1qETu3BaY5rjXQ=;
        b=RRlTRRyUkoa/XMPH3zRRJC/lHzLyVzqF9nfV5GBRjUyO+gVNnUNzsdK+Z7VfpvZOZW
         31A95s6d0skrlU80e/xdR6pHaZJA5c400k5nI6l29UU+LzL332mYTuoOJ+nmTt4LxPHZ
         lJHdKrYqwnRbG7wEg/WY9rZ6RmQD9KZ0Kj7J9M77sTPwF3Cy5p75J+0imyB+o2Ttvxtp
         tA3Y9hc621Pic0PQ8rmZ7prcI8jEX/5SQSV9RB8jPSXunvRX+yz5asp+GeAs3L5xhBtW
         ZIyPTkKnlssqznwwny6h8wP6eZJwxkB3lTogRzl7yUDdaq5ioaSwwppHgCvf4i0TYRLu
         08PA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722933616; x=1723538416;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=qkisf6jKS1KBlAD8Y7IQ5SHgqiPRA1qETu3BaY5rjXQ=;
        b=HaBkDs/zfcXXIhG4hD35ejathCc5f5JtmyK4/8YAPJcNhIRXJFJRuQHzcwDv9XhqW1
         TJqRGN9SasuZZQ9F6g8jCQFPQPlVAb65yyt7Q/LyCNZmy4clPBt6nu4bbK+WJqhmsqFi
         E9aP6oXx0nppeBfhzZvJ6BtHBYj6mTP9tla9Xst7b/nqvaQ9CJSjEa2Je85ZbbyhjgX5
         geepeKRiv6MutqdHgZwu37mf0p1dEM2MqNnOtqdOFFBcrt1YtjkdsL66OUykrRckoK70
         MZumE0vTN88rpQ1HiHevd0KDc1HQ8yq2XynkiEHINluhWoB+ZHq1vl+7MVZx9AZUs+X5
         gHpg==
X-Gm-Message-State: AOJu0Yx45rXRmOGW+eg9biLSDLhXrvh5VDec9uCYtbcTq5IDEyF511FZ
	6a1VOW+FR8zAzXNrlppNeXIVcPK83WYnsSQ0Q2aDs6NWgj5cV2YMu4j87JYAMml4p5+iNS+D2xQ
	=
X-Google-Smtp-Source: AGHT+IHLl/hRXVYdwQxx+Y2CTKXIa4SvbyLpy/Ov1B+knkc7lTeRU9sd6MloV7lTBnxq+dNjbTewhQ==
X-Received: by 2002:aa7:d3cd:0:b0:5af:384e:bc0f with SMTP id 4fb4d7f45d1cf-5b80cea2fc8mr11985285a12.16.1722933615609;
        Tue, 06 Aug 2024 01:40:15 -0700 (PDT)
Message-ID: <ad3b9873-b478-4448-8395-498399040324@suse.com>
Date: Tue, 6 Aug 2024 10:40:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Juergen Gross <jgross@suse.com>, Jason Andryuk <jason.andryuk@amd.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] libxl/disk: avoid aliasing of abs()
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Tool chains with -Wshadow enabled by default won't like the function
parameter name "abs", for aliasing stdlib.h's abs(). Rename the
parameter to what other similar functions use.

Fixes: a18b50614d97 ("libxl: Enable stubdom cdrom changing")
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/tools/libs/light/libxl_disk.c
+++ b/tools/libs/light/libxl_disk.c
@@ -935,7 +935,7 @@ static void cdrom_insert_stubdom_disk_ad
                                              libxl__ao_device *aodev);
 static void cdrom_insert_stubdom_query_fdset(libxl__egc *egc,
                                              libxl__ev_time *ev,
-                                             const struct timeval *abs,
+                                             const struct timeval *requested_abs,
                                              int rc);
 static void cdrom_insert_stubdom_parse_fdset(libxl__egc *egc,
                                              libxl__ev_qmp *qmp,
@@ -1259,7 +1259,7 @@ static void cdrom_insert_stubdom_disk_ad
 
 static void cdrom_insert_stubdom_query_fdset(libxl__egc *egc,
                                              libxl__ev_time *ev,
-                                             const struct timeval *abs,
+                                             const struct timeval *requested_abs,
                                              int rc)
 {
     EGC_GC;


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 09:00:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 09:00:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772572.1183011 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbG33-0008Vp-5z; Tue, 06 Aug 2024 09:00:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772572.1183011; Tue, 06 Aug 2024 09:00:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbG33-0008VG-2m; Tue, 06 Aug 2024 09:00:05 +0000
Received: by outflank-mailman (input) for mailman id 772572;
 Tue, 06 Aug 2024 09:00:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=kFQN=PF=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbG32-0008Cu-00
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 09:00:04 +0000
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com
 [2a00:1450:4864:20::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 435ec9e7-53d2-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 11:00:01 +0200 (CEST)
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a728f74c23dso46156766b.1
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 02:00:01 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9bc4230sm530019166b.32.2024.08.06.02.00.00
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 06 Aug 2024 02:00:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 435ec9e7-53d2-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722934801; x=1723539601; 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=nOW7CBVDpL6vf5ChcaCrkQX6d4lPmpje+mFf5nrIlNA=;
        b=D0N+HLeoifibumug5IXABHnDbsx1vWoEK6RA5nMzHawx5IaAkBQr2GhcsGQmlBRNRX
         A5FG2dk/SzehnSNSxOVZOjcD+eNnjEMhXTlzkBtQac9cK1DFPSsQYosy9KBcsNDhIn99
         dMKJaKq7n0vMLSu1h/2HG17rnCKlF55jVHKO0LU75MHqaHKC+QutqBfQd6Wv9/V5MoDm
         vYxl3amgVwRqfvZUMJq2oeN5F5k5USnlarDDNpCsN5ww1XOwcMwCUQ9QKh5jbjTvxE/H
         bcVGHjYKXKDnlDEAkMmklNH8HokeJz+kALen/rT5zkvUEkDbct2U/yh7gImnVkxODdWY
         14sw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722934801; x=1723539601;
        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=nOW7CBVDpL6vf5ChcaCrkQX6d4lPmpje+mFf5nrIlNA=;
        b=wk7n4JpgEE7wIHwGVNJl1GnS7vRy547NEORKLZO9JB42GLzb5APE38/elupi+TBt8r
         hk+GYFzuQ3iHFejlqjX6AMCLED4Ojm7Y3YgapsVWlYh8qng6J6KT4kr9IqhSbDplgdzd
         v501jk3EbA5mu9KMV6ETkYOsVcwnSJh4RFtWY8oVC5B0IhnJNWAd1bWAJI1EsNPms1ks
         FYhUoxRpcXoopGkw08nGGIdltJJ1W3GdTjMPVLNVHv4pFs8ZO1lUAc8Z+G+I41kiBDgj
         Fc90e8Q9EDW3HQ3VuDjEPH3+82roZ/aK0HCOfLG+iFPvolDvCQQPybyVoOUTLUkr+u4/
         bpbA==
X-Gm-Message-State: AOJu0Yz4glta7ocwZ9oprvEVEAkgexs4toySVJPUdp/iCmUUuSfQRG+2
	7yYmYKiov3b6R+AzMEI0n1tn6cY1kIZy675J7HVDemTrJ0zNOCQxqNer+yTcqQ==
X-Google-Smtp-Source: AGHT+IFG8UaTIEZCWmBTtTwkQapdTMPO/I099QIM5lUODmdRGc7aJMgRvcqXfomZCJa81oXjCcpgWg==
X-Received: by 2002:a17:907:e87:b0:a7a:a7b8:ada3 with SMTP id a640c23a62f3a-a7dc4d8f7f4mr1136308166b.3.1722934800739;
        Tue, 06 Aug 2024 02:00:00 -0700 (PDT)
Message-ID: <c4dac0ae-a8f4-4121-ad2e-f7cd61b6e3a8@suse.com>
Date: Tue, 6 Aug 2024 11:00:00 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Help with Understanding vcpu xstate restore error during vm
 migration
To: Fonyuy-Asheri Caleb <fonyuy-asheri.caleb@inria.fr>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>
References: <60751777.2038091.1720694327760.JavaMail.zimbra@inria.fr>
 <1546743760.2065506.1720696161057.JavaMail.zimbra@inria.fr>
 <8f8dac21-92fe-4760-8578-2fbfde2f2c14@citrix.com>
 <1557490999.4048664.1721029086794.JavaMail.zimbra@inria.fr>
 <77f1ff6e-a7dd-45c8-b706-429674b559f2@suse.com>
 <ece26efe-c1af-4fd2-910d-01a33beda5cc@citrix.com>
 <120712863.15929301.1722927890402.JavaMail.zimbra@inria.fr>
 <0f69e94a-5720-4f1f-b51d-b4fb2c6bbe0b@suse.com>
 <674914344.15937452.1722929654769.JavaMail.zimbra@inria.fr>
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: <674914344.15937452.1722929654769.JavaMail.zimbra@inria.fr>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 06.08.2024 09:34, Fonyuy-Asheri Caleb wrote:
>> If what you say in the earlier paragraph was the case with upstream Xen and
>> without you restricting what the guest being migrated was able to see on the
>> source host, then I think that would indicate a bug somewhere. Yet you don't
>> provide enough details to be certain.
> 
> Sorry for not specifying. I am still in the same context as stated previously. 
> I haven't made any modifications to xen and no restrictions on what the guest can see. 

Wasn't it the case that previously you observed AVX disabled, because of
GDS? With AVX disabled, AVX512 would be implicitly disabled, too. Then
migrating from an AVX512-capable host to an AVX512-incapable one would
of course work. Yet of course this is only an example, because I don't
know whether AVX512 is what your new inquiry would have been about. As
indicated - please provide sufficient detail so we actually know what
you're doing and what you observe.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 09:04:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 09:04:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772580.1183022 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbG72-0000pd-LE; Tue, 06 Aug 2024 09:04:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772580.1183022; Tue, 06 Aug 2024 09:04:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbG72-0000pW-IE; Tue, 06 Aug 2024 09:04:12 +0000
Received: by outflank-mailman (input) for mailman id 772580;
 Tue, 06 Aug 2024 09:04:11 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ctxO=PF=ti.com=a-singh21@srs-se1.protection.inumbo.net>)
 id 1sbG71-0000pQ-40
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 09:04:11 +0000
Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d57ea750-53d2-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 11:04:08 +0200 (CEST)
Received: from fllv0035.itg.ti.com ([10.64.41.0])
 by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 47693qGs106718;
 Tue, 6 Aug 2024 04:03:52 -0500
Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23])
 by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 47693q8b085329
 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL);
 Tue, 6 Aug 2024 04:03:52 -0500
Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE112.ent.ti.com
 (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 6
 Aug 2024 04:03:51 -0500
Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE107.ent.ti.com
 (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via
 Frontend Transport; Tue, 6 Aug 2024 04:03:51 -0500
Received: from [172.24.227.225] (nightbug.dhcp.ti.com [172.24.227.225])
 by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 47693nin067213;
 Tue, 6 Aug 2024 04:03:50 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d57ea750-53d2-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com;
	s=ti-com-17Q1; t=1722935032;
	bh=UUJl4CgLdyc974YpPpFSOfNDd2DRfUN1ftfKpQ7/rps=;
	h=Date:Subject:To:CC:References:From:In-Reply-To;
	b=Q4QkQgMbI+Q0hbqaTXIYSeE7LywWP4MubMG/hd1zwcBWSqfCxaYsvsyzEcdz8V4fN
	 DSfxRYprWpMfeaxhN781ljXKbHoubWwYDUHInHhzh+XkEbN1Hx0/tuy3U/WMtiIeOK
	 gCRtZwqNaQ9Z+foNe1DjSZBbUurCymh4Mjvn3nQ4=
Message-ID: <713072f9-5c1f-4958-913c-67c4675de488@ti.com>
Date: Tue, 6 Aug 2024 14:33:48 +0530
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [EXTERNAL] Re: [PATCH] drivers: char: omap-uart: add "clock-hz"
 option
To: Michal Orzel <michal.orzel@amd.com>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>,
        Julien Grall
	<julien@xen.org>,
        Bertrand Marquis <bertrand.marquis@arm.com>
References: <20240719113313.145587-1-a-singh21@ti.com>
 <18deaad4-0bbf-4bf2-919e-7b213a1c8235@amd.com>
Content-Language: en-US
From: Amneesh Singh <a-singh21@ti.com>
Autocrypt: addr=a-singh21@ti.com; keydata=
 xsFNBGaGX/kBEACu0GIGVFYkfov56fJf9bWJxMv0RmXATnRVRAGIpXUYRnNVE+raA8U4ehT9
 N5FAnJqru6cQyW/hLpynZ2wE6iRmY43F3xFQ51c/luYh8OWkC4Boc59HuGhQe79pXi7/P2WC
 iT6tbOXW2CcBzpAhIK+WjwLu/IbNVMyk/n/mGOKdGi1B/n9/zHX79GXG39k5p/7ttaePCUEV
 SZXn8idiOrdGcOe/2B+xQen3nJmraEb5U2ZXe6NeveehKtJRk/15ePhHzxGWhFpwVKSETkvF
 MWfZUEncdN/zunsu/ExWUY4IhnxQyKSsSR8QFV8oyyplV480XF6gJ98e2I6mNNLpI1qrEvSy
 zt0zz6qXyAxqZQippad8PJR7PRp9II2IoHNDQZ6+tt3rP36owYF9AaaNi+t5cBUHmiWZ8P7N
 9iGZv1Orvv2fpD1wDpvwcjkC6VGUVYm9ZbZOtSMuePsVQX9nrDW2FNTbT5tp5/hg/wTo5kt6
 /DeG1lW80SnWhlF7h4OYT4XOADgVflCNdQNPwWODbtMei7UbSEQTlfFM3a1vLZFBQ21hMPjv
 J+0+8wGY6fivbcso4Agb1QQ3TVr07eYcekF2kvm9h1o6obsEUgkd+OgRtKW7UkqrBsDKU1sU
 VpPMsudkfhCfMkpUeMhGm9xCmnwJ7rCZi9bOK68jUwt3IfvI5QARAQABzSBBbW5lZXNoIFNp
 bmdoIDxhLXNpbmdoMjFAdGkuY29tPsLBlAQTAQoAPhYhBCsW73h+3Cjcfr2IgxBEk7TUaRfs
 BQJmhl/5AhsDBQkAdqcABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEBBEk7TUaRfsfjkP
 /jjewYjXKEUQnk+B7BFrTc468G1PRspgKny+DAQ2R8J9zmnfYCbfFSD6tMowMIBuobC3FuHW
 Z3vYXgdzAkz1MRYmzVOrG4Xl/h0XkqvGjOVTAJoKS0AunFjnT1VAUtYjyUw46/CiF1Iwfig5
 2YEA+6DKBNtqhHLID1W1JQHGSdFvnzjvQBke75pAp6QkmLpiQzKcAvNHpMQaZ5VXv+Ls1Ek3
 CcJ2BRX3KjaUEBrYBUR0CZdHkAuKEwzDSFtqXtIfVgAuG1S9U9juhUxoany0u3xXQCWAkJZC
 TunjRNKl64hYw2jpzEJXZa8OvO0En39ZaiqaOQIPdudhj8idEYXOWseEIt9oDrRKT5mBmiks
 QtAYJ0P6/+GOpriQGFeaq9AUkxd62X6JXBPYfFbpYHStDzlkZHLqGukzuBKrjYbV6aVkLRpP
 OgjN/0a35Tpam1HHEqOsfe4HTK4UCJyQg8xMiqM9qpB2MZNJRnPz6hOrKKX+isXCiKKpSwJ0
 2rmnEjPhAqSrSijd1PxZzrbju5+AeOBn/XTuqliusoX+O3WYNN71w7brNamW4KmGa1isBX6u
 H5mvM8LrNPVvljZQM0QIA1yPAoZoqtR8yRB1z3oI7R7+qoirnts/dRjadUP29qKBdSWwjAR7
 KuxuYAABHacAIl31LHWf5QJfDZmTHV0pTiUazsFNBGaGX/kBEADRw7/VxiIwzQNRHhx/r1v6
 GB3six1CjXthn/ERLzVq8ytejbp7gecKef0T8FYjo1s/12Ifdqmq7UrPU606kKljvf3c0oL/
 uS02AHaAT/XI49nB2/LXK3pUkUqkNEapzZZNleN42ve1a0PeCwde57F6ZjfzcGtbN7XJ4pg4
 elpzRa3bFfFhBMOFBTNUpy26nYXub/Xp3Yl+5hZxrVUV0w96+q/P1VcSXlN7YrCw9Ke5V3tT
 O7KAuckTDddECju5CTSPrAORiP5wJoS25WJ86a8dQdFifiMdtAR2GEq8c4bX047CwdYwNqep
 xrTLpiAz7Pk7mCb3ZJLR8DpN7HXRcs4Aonu3BZnex5Q2iLjYZYFnCdCX01j+SPhXSSIBNefq
 So+0NpapPxrHKFjV9VYB0jgrlXemiP2iGznlt3ifw+gzDIKvrS6MH/qXaDT0p5VwYTuOb3be
 O186l7PxgWWYZsOLwFp7QtsHB54IdUXKOzC3iRumsVef0mLmQ9/hVkFHZk4sdQeAEF+7iclJ
 LJE0mioE1daNIPFGVI4V+6oky3IO1tNXHP2OD/CjmFLpPBe7IpSjSlFvq6loPGELNMvd7fOE
 3SDvqM6KxAD0ET00SubzZwTPIEuyw0KUhyN3bIOx2C3PmSz/BkdVhOZkJGPa3nVhQdX0dKF5
 N4wkUgCH1EKgIwARAQABwsF8BBgBCgAmFiEEKxbveH7cKNx+vYiDEESTtNRpF+wFAmaGX/kC
 GwwFCQB2pwAACgkQEESTtNRpF+x20g//QLFUN32HUyh14stjpo7NkuOvcJL5AsgYQ5wrBI5K
 0UMFhyNMpY8ZkRAiEBBhyiEgWHQiI8Zu4pu1DN2KJ3TmVglY0hhCB8lk/fGAOpHGdIISdBCE
 GrJ2Xnn0U51WvRJBBR8aeCz8dG0N41qrcDW8tKd9+SDge9V2FI1/ZrQ8sb8rL2Gvir9kYbOu
 vq4M3HUlN1rdxc2Dt6Nc+/ziLV0RB2011PuLC3yEPf6sB83U2NHgB0VvEWsVumPXxHq+irYL
 VNzFgYPhkw2Hcg5SnKczDUI6zNE6MXmJqzz2hbu8w5pmTK3W50EghZPnSYlkwFt/cCxu5ws8
 4D7z5QjT6ZdrZ8Jg5RVyKe27x+L/idKj9Xhko9K9M3N7KMCrJvYsCLRPxNiRQh3DMuv9zGrw
 kRxAI0TpB7n28BjQIWcf3T8fhOWPNZEnB4RZDnoPhKnFRZcki1CgspD94Q5/wV4S0bM9DdIg
 Z0GycFkh8SCmFU56rJHDHa09bCFzTWZG7ruHNay5nXVQToFuSA3NAgWa5ZR9DUsFw/uL+Uv5
 53mv9SUh3jXHUrhLEf576UJxiA2VVealrOOJDl6w6z97w5fokOZpZpLlNl20g88Y6iJV/isS
 ZmH1yib9zv0XsolJAX6Gk446MqGbVmfk0zyx+lmNQ+B98L939ZhqnROQ8zIlNC+fabI=
In-Reply-To: <18deaad4-0bbf-4bf2-919e-7b213a1c8235@amd.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------E3i8BTeoaIEPZrRYex3hAbkE"
X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180

--------------E3i8BTeoaIEPZrRYex3hAbkE
Content-Type: multipart/mixed; boundary="------------MphJER2dfXwmOZBc0DPqD0DY";
 protected-headers="v1"
From: Amneesh Singh <a-singh21@ti.com>
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>
Message-ID: <713072f9-5c1f-4958-913c-67c4675de488@ti.com>
Subject: Re: [EXTERNAL] Re: [PATCH] drivers: char: omap-uart: add "clock-hz"
 option
References: <20240719113313.145587-1-a-singh21@ti.com>
 <18deaad4-0bbf-4bf2-919e-7b213a1c8235@amd.com>
In-Reply-To: <18deaad4-0bbf-4bf2-919e-7b213a1c8235@amd.com>

--------------MphJER2dfXwmOZBc0DPqD0DY
Content-Type: multipart/mixed; boundary="------------EYEIXmxdB57iQTMZahg0UZRd"

--------------EYEIXmxdB57iQTMZahg0UZRd
Content-Type: multipart/alternative;
 boundary="------------mmxO0gR1xX1sskrFwkjJrYu5"

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

SGksIHRoYW5rcyBhIGxvdCBmb3IgdGhlIHJldmlldyENCg0KT24gMDYvMDgvMjQgMTM6MjMs
IE1pY2hhbCBPcnplbCB3cm90ZToNCj4gSGksDQo+DQo+IFlvdSBzZW50IHRoaXMgcGF0Y2gg
dG8geGVuLWRldmVsIGJ1dCBmb3Jnb3QgdG8gQ0MgbWFpbnRhaW5lcnMuIEZvciB0aGUgZnV0
dXJlLCBwbGVhc2UgdXNlIHNjcmlwdHMvYWRkX21haW50YWluZXJzLnBsLg0KPiBDQ2luZyB0
aGVtIG5vdy4NCkFwb2xvZ2llcywgd2FzIG5vdCBhd2FyZSBvZiB0aGF0Lg0KPiBPbiAxOS8w
Ny8yMDI0IDEzOjMzLCBBbW5lZXNoIFNpbmdoIHdyb3RlOg0KPiA+IA0KPiA+IA0KPiA+IFF1
aXRlIGEgZmV3IFRJIEszIGRldmljZXMgZG8gbm90IGhhdmUgY2xvY2stZnJlcXVlbmN5IHNw
ZWNpZmllZCBpbiB0aGVpcg0KPiA+IHJlc3BlY3RpdmUgVUFSVCBub2Rlcy4gSG93ZXZlciBo
YXJkLWNvZGluZyB0aGUgZnJlcXVlbmN5IGlzIG5vdCBhDQo+IElzIHRoaXMgcHJvcGVydHkg
aXMgcmVxdWlyZWQ/IElmIHNvLCBJJ2QgbWVudGlvbiB0aGF0IHRoaXMgaXMgdG8gb3ZlcmNv
bWUgYW4gaW5jb3JyZWN0IGRldmljZSB0cmVlLg0KVGhlIGNsb2NrIGlucHV0IGlzIHVzdWFs
bHkgc3VwcG9zZWQgdG8gYmUgYXQgNDhNSHosIGJ1dCBjYW4gc3RpbGwgZGlmZmVyIA0KYmV0
d2VlbiBTb0NzLCBhbmQgaWYgSSBhbSBub3Qgd3JvbmcgY2FuIGFsc28gYmUgY2hhbmdlZCBm
cm9tIHRoZSANCmJvb3Rsb2FkZXIuIFRoaXMgbWFrZXMgaXQgaGFyZCB0byBzcGVjaWZ5IHRo
aXMgdmFsdWUgaW4gdGhlIGRldmljZSB0cmVlIA0KaXRzZWxmOyB3aGljaCBpcyBob3dldmVy
IHJlcXVpcmVkIGJ5IHRoZSBjdXJyZW50IG9tYXAtdWFydCBkcml2ZXIgYXMgaXQgDQpuZWl0
aGVyIGhhcyBhIGRlZmF1bHQgbm9yIGEgd2F5IHRvIHBhcnNlIGNvbmZpZyBwYXJhbXMsIGFu
ZCByZWxpZXMgb24gDQpwYXJzaW5nIHRoZSBEVC4NCj4gPiBzb2x1dGlvbiBhcyB0aGUgZnVu
Y3Rpb24gY2xvY2sgaW5wdXQgY2FuIGRpZmZlciBiZXR3ZWVuIFNvQ3MuIFNvLA0KPiA+IHNp
bWlsYXIgdG8gY29tMS9jb20yLCBsZXQgdGhlIHVzZXIgcGFzcyB0aGUgZnJlcXVlbmN5IGFz
IGEgZHR1YXJ0IG9wdGlvbg0KPiA+IHZpYSB0aGUgYm9vdGFyZ3MuIElmIG5vdCBzcGVjaWZp
ZWQgaXQgd2lsbCBmYWxsYmFjayB0byB0aGUgc2FtZSBEVA0KPiA+IHBhcnNpbmcgYXMgYmVm
b3JlLiBGb3IgZXhhbXBsZSwgZHR1YXJ0PXNlcmlhbDI6Y2xvY2staHo9NDgwMDAwMDAgY2Fu
IGJlDQo+ID4gYSB2YWxpZCBib290YXJnLg0KPiA+IA0KPiA+IFNpZ25lZC1vZmYtYnk6IEFt
bmVlc2ggU2luZ2ggPGEtc2luZ2gyMUB0aS5jb20+DQo+ID4gLS0tDQo+ID4gIHhlbi9kcml2
ZXJzL2NoYXIvb21hcC11YXJ0LmMgfCA2MiArKysrKysrKysrKysrKysrKysrKysrKysrKysr
Ky0tLS0tLS0NCj4gPiAgMSBmaWxlIGNoYW5nZWQsIDUwIGluc2VydGlvbnMoKyksIDEyIGRl
bGV0aW9ucygtKQ0KPiA+IA0KPiA+IGRpZmYgLS1naXQgYS94ZW4vZHJpdmVycy9jaGFyL29t
YXAtdWFydC5jIGIveGVuL2RyaXZlcnMvY2hhci9vbWFwLXVhcnQuYw0KPiA+IGluZGV4IDEw
NzkxOTguLjY2MGM0ODYgMTAwNjQ0DQo+ID4gLS0tIGEveGVuL2RyaXZlcnMvY2hhci9vbWFw
LXVhcnQuYw0KPiA+ICsrKyBiL3hlbi9kcml2ZXJzL2NoYXIvb21hcC11YXJ0LmMNCj4gPiBA
QCAtMzA1LDMzICszMDUsNzEgQEAgc3RhdGljIHN0cnVjdCB1YXJ0X2RyaXZlciBfX3JlYWRf
bW9zdGx5IG9tYXBfdWFydF9kcml2ZXIgPSB7DQo+ID4gICAgICAudnVhcnRfaW5mbyA9IG9t
YXBfdnVhcnRfaW5mbywNCj4gPiAgfTsNCj4gPiANCj4gPiArc3RhdGljIHZvaWQgX19pbml0
IG9tYXBfdWFydF9wYXJzZV9jb25maWcoc3RydWN0IG9tYXBfdWFydCAqdWFydCwNCj4gPiAr
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICpj
b25maWcpIHsNCj4gQnJhY2VzIHNob3VsZCBiZSBwbGFjZWQgb24gdGhlaXIgb3duIGxpbmVz
LiBSZWZlciBDT0RJTkdfU1RZTEUuDQpBcG9sb2dpZXMgZm9yIHRoZSBjYXJlbGVzc25lc3Mu
DQo+ID4gKw0KPiA+ICsgICAgY2hhciBvcHRpb25zWzI1Nl07DQo+IDI1NiBpcyBhIG1heCBz
aXplIG9mIGZ1bGwgZHR1YXJ0IHN0cmluZy4gU2luY2Ugd2Ugb25seSBwYXJzZSBmb3IgY2xv
Y2staHosIGRvIHdlIG5lZWQgdGhlIHNhbWUgc2l6ZSBoZXJlPw0KPiBDb3VsZCB3ZSBzYXkg
ZS5nLiA2NCBhbmQgZXh0ZW5kIGl0IGluIHRoZSBmdXR1cmUgaWYgbmV3IG9wdGlvbnMgd2ls
bCBiZSBhZGRlZD8NCkRvbmUsIGRvbid0IHRoaW5rIGl0IG1hdHRlcnMgbXVjaCwgYnV0IHN1
cmUgdGhpbmcuDQo+ID4gKyAgICBjaGFyICp2YWx1ZSwgKnN0YXJ0ID0gb3B0aW9uczsNCj4g
U2NvcGUgb2YgdmFsdWUgY291bGQgYmUgbGltaXRlZCB0byB0aGUgd2hpbGUgbG9vcA0KWWVz
LCB0aGF0J3MgdHJ1ZS4NCj4gPiArDQo+ID4gKyAgICBpZiAoICFzdHJjbXAoY29uZmlnLCAi
IikgKQ0KPiA+ICsgICAgICAgIHJldHVybjsNCj4gPiArDQo+ID4gKyAgICBzdHJsY3B5KG9w
dGlvbnMsIGNvbmZpZywgQVJSQVlfU0laRShvcHRpb25zKSk7DQo+ID4gKw0KPiA+ICsgICAg
d2hpbGUgKHN0YXJ0ICE9IE5VTEwpDQo+IFdoaXRlIHNwYWNlcyBtaXNzaW5nLiBSZWZlciBD
T0RJTkdfU1RZTEUuDQpUaHguDQo+ID4gKyAgICB7DQo+ID4gKyAgICAgICAgY2hhciAqbmFt
ZTsNCj4gPiArDQo+ID4gKyAgICAgICAgLyogUGFyc2UgbmV4dCBuYW1lLXZhbHVlIHBhaXIu
ICovDQo+ID4gKyAgICAgICAgdmFsdWUgPSBzdHJzZXAoJnN0YXJ0LCAiLCIpOw0KPiA+ICsg
ICAgICAgIG5hbWUgPSBzdHJzZXAoJnZhbHVlLCAiPSIpOw0KPiBDYW4gbmFtZSBiZSBOVUxM
IGhlcmU/IFRoaXMgd291bGQgd2FudCBjaGVja2luZyBmb3IgdGhlIGJlbG93IHN0cmNtcC4N
CkluZGVlZCwgYm90aCB0aGUgbmFtZSBhbmQgdmFsdWUgY2FuIGJlIE5VTEwgYXQgdGhpcyBw
b2ludC4gVGh4Lg0KPiA+ICsNCj4gPiArICAgICAgICBpZiAoICFzdHJjbXAobmFtZSwgImNs
b2NrLWh6IikgKQ0KPiA+ICsgICAgICAgICAgICB1YXJ0LT5jbG9ja19oeiA9IHNpbXBsZV9z
dHJ0b3VsKHZhbHVlLCBOVUxMLCAwKTsNCj4gPiArICAgICAgICBlbHNlDQo+ID4gKyAgICAg
ICAgICAgIHByaW50aygiV0FSTklORzogVUFSVCBjb25maWd1cmF0aW9uIG9wdGlvbiAlcyBp
cyBub3Qgc3VwcG9ydGVkXG4iLA0KPiA+ICsgICAgICAgICAgICAgICAgICAgbmFtZSk7DQo+
ID4gKw0KPiA+ICsgICAgfQ0KPiA+ICt9DQo+ID4gKw0KPiA+ICBzdGF0aWMgaW50IF9faW5p
dCBvbWFwX3VhcnRfaW5pdChzdHJ1Y3QgZHRfZGV2aWNlX25vZGUgKmRldiwNCj4gPiAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdm9pZCAqZGF0YSkNCj4gPiAg
ew0KPiA+ICAgICAgY29uc3QgY2hhciAqY29uZmlnID0gZGF0YTsNCj4gPiAgICAgIHN0cnVj
dCBvbWFwX3VhcnQgKnVhcnQ7DQo+ID4gLSAgICB1MzIgY2xrc3BlYzsNCj4gPiAgICAgIGlu
dCByZXM7DQo+ID4gICAgICBwYWRkcl90IGFkZHIsIHNpemU7DQo+ID4gDQo+ID4gLSAgICBp
ZiAoIHN0cmNtcChjb25maWcsICIiKSApDQo+ID4gLSAgICAgICAgcHJpbnRrKCJXQVJOSU5H
OiBVQVJUIGNvbmZpZ3VyYXRpb24gaXMgbm90IHN1cHBvcnRlZFxuIik7DQo+ID4gLQ0KPiA+
ICAgICAgdWFydCA9ICZvbWFwX2NvbTsNCj4gPiANCj4gPiAtICAgIHJlcyA9IGR0X3Byb3Bl
cnR5X3JlYWRfdTMyKGRldiwgImNsb2NrLWZyZXF1ZW5jeSIsICZjbGtzcGVjKTsNCj4gPiAt
ICAgIGlmICggIXJlcyApDQo+ID4gLSAgICB7DQo+ID4gLSAgICAgICAgcHJpbnRrKCJvbWFw
LXVhcnQ6IFVuYWJsZSB0byByZXRyaWV2ZSB0aGUgY2xvY2sgZnJlcXVlbmN5XG4iKTsNCj4g
PiAtICAgICAgICByZXR1cm4gLUVJTlZBTDsNCj4gPiAtICAgIH0NCj4gPiAtDQo+ID4gLSAg
ICB1YXJ0LT5jbG9ja19oeiA9IGNsa3NwZWM7DQo+ID4gKyAgICAvKiBEZWZhdWx0IGNvbmZp
Z3VyYXRpb24uICovDQo+ID4gKyAgICB1YXJ0LT5jbG9ja19oeiA9IDA7DQo+ID4gICAgICB1
YXJ0LT5iYXVkID0gMTE1MjAwOw0KPiA+ICAgICAgdWFydC0+ZGF0YV9iaXRzID0gODsNCj4g
PiAgICAgIHVhcnQtPnBhcml0eSA9IFVBUlRfUEFSSVRZX05PTkU7DQo+ID4gICAgICB1YXJ0
LT5zdG9wX2JpdHMgPSAxOw0KPiA+IA0KPiA+ICsgICAgLyoNCj4gPiArICAgICAqIFBhcnNl
IGR0dWFydCBvcHRpb25zLg0KPiA+ICsgICAgICogVmFsaWQgb3B0aW9uczoNCj4gPiArICAg
ICAqICAgLSBjbG9jay1oeg0KPiA+ICsgICAgICovDQo+ID4gKyAgICBvbWFwX3VhcnRfcGFy
c2VfY29uZmlnKHVhcnQsIGNvbmZpZyk7DQo+ID4gKw0KPiA+ICsgICAgLyogSWYgY2xvY2st
aHogaXMgbWlzc2luZy4gKi8NCj4gQXBhcnQgZnJvbSBtaXNzaW5nLCBjbG9ja19oeiBjYW4g
YmUgMCBhbHNvIGlmIHVzZXIgc3BlY2lmaWVzIDANClRoYXQncyB0cnVlLCB0aHguDQo+ID4g
KyAgICBpZiAoIHVhcnQtPmNsb2NrX2h6ID09IDAgKQ0KPiA+ICsgICAgew0KPiA+ICsgICAg
ICAgIHUzMiBjbGtzcGVjOw0KPiBXZSBhcmUgbW92aW5nIGF3YXkgZnJvbSBMaW51eCBkZXJp
dmVkIHR5cGVzIHNvIHBsZWFzZSB0YWtlIHRoZSBvY2Nhc2lvbiB0byB1c2UgdWludDMyX3Qg
aGVyZS4NCj4gQWxzbywgdGhlcmUgc2hvdWxkIGJlIGEgYmxhbmsgbGluZSBiZXR3ZWVuIGRl
ZmluaXRpb25zL2NvZGUuDQpHb3QgaXQuDQo+ID4gKyAgICAgICAgcmVzID0gZHRfcHJvcGVy
dHlfcmVhZF91MzIoZGV2LCAiY2xvY2stZnJlcXVlbmN5IiwgJmNsa3NwZWMpOw0KPiA+ICsg
ICAgICAgIGlmICggIXJlcyApDQo+ID4gKyAgICAgICAgew0KPiA+ICsgICAgICAgICAgICBw
cmludGsoIm9tYXAtdWFydDogVW5hYmxlIHRvIHJldHJpZXZlIHRoZSBjbG9jayBmcmVxdWVu
Y3lcbiIpOw0KPiA+ICsgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsNCj4gPiArICAgICAg
ICB9DQo+ID4gKyAgICAgICAgdWFydC0+Y2xvY2tfaHogPSBjbGtzcGVjOw0KPiA+ICsgICAg
fQ0KPiA+ICsNCj4gPiAgICAgIHJlcyA9IGR0X2RldmljZV9nZXRfcGFkZHIoZGV2LCAwLCAm
YWRkciwgJnNpemUpOw0KPiA+ICAgICAgaWYgKCByZXMgKQ0KPiA+ICAgICAgew0KPiA+IC0t
DQo+ID4gMi4zNC4xDQo+ID4gDQo+ID4gDQo+DQo+IH5NaWNoYWwNClJlZ2FyZHMNCkFtbmVl
c2gNCg==
--------------mmxO0gR1xX1sskrFwkjJrYu5
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF=
-8">
  </head>
  <body>
    <p>Hi, thanks a lot for the review!<br>
    </p>
    <div class=3D"moz-cite-prefix">On 06/08/24 13:23, Michal Orzel wrote:=
<br>
    </div>
    <blockquote type=3D"cite"
      cite=3D"mid:18deaad4-0bbf-4bf2-919e-7b213a1c8235@amd.com">
      <pre
style=3D"font-family: sans-serif; font-size: 100%; white-space: pre-wrap;=
 word-wrap: break-word">Hi,

You sent this patch to xen-devel but forgot to CC maintainers. For the fu=
ture, please use scripts/add_maintainers.pl.
CCing them now.</pre>
    </blockquote>
    Apologies, was not aware of that.<br>
    <blockquote type=3D"cite"
      cite=3D"mid:18deaad4-0bbf-4bf2-919e-7b213a1c8235@amd.com">
      <pre
style=3D"font-family: sans-serif; font-size: 100%; white-space: pre-wrap;=
 word-wrap: break-word">
On 19/07/2024 13:33, Amneesh Singh wrote:
&gt;=20
&gt;=20
&gt; Quite a few TI K3 devices do not have clock-frequency specified in t=
heir
&gt; respective UART nodes. However hard-coding the frequency is not a
Is this property is required? If so, I'd mention that this is to overcome=
 an incorrect device tree.</pre>
    </blockquote>
    <span style=3D"white-space: pre-wrap">The clock input is usually supp=
osed to be at 48MHz, but can still
differ between SoCs, and if I am not wrong can also be changed from
the bootloader. This makes it hard to specify this value in the device
tree itself; which is however required by the current omap-uart driver
as it neither has a default nor a way to parse config params, and relies
on parsing the DT.

</span>
    <blockquote type=3D"cite"
      cite=3D"mid:18deaad4-0bbf-4bf2-919e-7b213a1c8235@amd.com">
      <pre
style=3D"font-family: sans-serif; font-size: 100%; white-space: pre-wrap;=
 word-wrap: break-word">&gt; solution as the function clock input can dif=
fer between SoCs. So,
&gt; similar to com1/com2, let the user pass the frequency as a dtuart op=
tion
&gt; via the bootargs. If not specified it will fallback to the same DT
&gt; parsing as before. For example, dtuart=3Dserial2:clock-hz=3D48000000=
 can be
&gt; a valid bootarg.
&gt;=20
&gt; Signed-off-by: Amneesh Singh <a class=3D"moz-txt-link-rfc2396E" href=
=3D"mailto:a-singh21@ti.com">&lt;a-singh21@ti.com&gt;</a>
&gt; ---
&gt;  xen/drivers/char/omap-uart.c | 62 +++++++++++++++++++++++++++++----=
---
&gt;  1 file changed, 50 insertions(+), 12 deletions(-)
&gt;=20
&gt; diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-ua=
rt.c
&gt; index 1079198..660c486 100644
&gt; --- a/xen/drivers/char/omap-uart.c
&gt; +++ b/xen/drivers/char/omap-uart.c
&gt; @@ -305,33 +305,71 @@ static struct uart_driver __read_mostly omap_u=
art_driver =3D {
&gt;      .vuart_info =3D omap_vuart_info,
&gt;  };
&gt;=20
&gt; +static void __init omap_uart_parse_config(struct omap_uart *uart,
&gt; +                                         const char *config) {
Braces should be placed on their own lines. Refer CODING_STYLE.
</pre>
    </blockquote>
    Apologies for the carelessness.<br>
    <blockquote type=3D"cite"
      cite=3D"mid:18deaad4-0bbf-4bf2-919e-7b213a1c8235@amd.com">
      <pre
style=3D"font-family: sans-serif; font-size: 100%; white-space: pre-wrap;=
 word-wrap: break-word">&gt; +
&gt; +    char options[256];
256 is a max size of full dtuart string. Since we only parse for clock-hz=
, do we need the same size here?
Could we say e.g. 64 and extend it in the future if new options will be a=
dded?</pre>
    </blockquote>
    Done, don't think it matters much, but sure thing.<br>
    <blockquote type=3D"cite"
      cite=3D"mid:18deaad4-0bbf-4bf2-919e-7b213a1c8235@amd.com">
      <pre
style=3D"font-family: sans-serif; font-size: 100%; white-space: pre-wrap;=
 word-wrap: break-word">
&gt; +    char *value, *start =3D options;
Scope of value could be limited to the while loop</pre>
    </blockquote>
    Yes, that's true.<br>
    <blockquote type=3D"cite"
      cite=3D"mid:18deaad4-0bbf-4bf2-919e-7b213a1c8235@amd.com">
      <pre
style=3D"font-family: sans-serif; font-size: 100%; white-space: pre-wrap;=
 word-wrap: break-word">
&gt; +
&gt; +    if ( !strcmp(config, "") )
&gt; +        return;
&gt; +
&gt; +    strlcpy(options, config, ARRAY_SIZE(options));
&gt; +
&gt; +    while (start !=3D NULL)
White spaces missing. Refer CODING_STYLE.
</pre>
    </blockquote>
    Thx.<br>
    <blockquote type=3D"cite"
      cite=3D"mid:18deaad4-0bbf-4bf2-919e-7b213a1c8235@amd.com">
      <pre
style=3D"font-family: sans-serif; font-size: 100%; white-space: pre-wrap;=
 word-wrap: break-word">&gt; +    {
&gt; +        char *name;
&gt; +
&gt; +        /* Parse next name-value pair. */
&gt; +        value =3D strsep(&amp;start, ",");
&gt; +        name =3D strsep(&amp;value, "=3D");
Can name be NULL here? This would want checking for the below strcmp.</pr=
e>
    </blockquote>
    <span style=3D"white-space: pre-wrap">Indeed, both the name and value=
 can be NULL at this point. Thx.
</span>
    <blockquote type=3D"cite"
      cite=3D"mid:18deaad4-0bbf-4bf2-919e-7b213a1c8235@amd.com">
      <pre
style=3D"font-family: sans-serif; font-size: 100%; white-space: pre-wrap;=
 word-wrap: break-word">&gt; +
&gt; +        if ( !strcmp(name, "clock-hz") )
&gt; +            uart-&gt;clock_hz =3D simple_strtoul(value, NULL, 0);
&gt; +        else
&gt; +            printk("WARNING: UART configuration option %s is not su=
pported\n",
&gt; +                   name);
&gt; +
&gt; +    }
&gt; +}
&gt; +
&gt;  static int __init omap_uart_init(struct dt_device_node *dev,
&gt;                                   const void *data)
&gt;  {
&gt;      const char *config =3D data;
&gt;      struct omap_uart *uart;
&gt; -    u32 clkspec;
&gt;      int res;
&gt;      paddr_t addr, size;
&gt;=20
&gt; -    if ( strcmp(config, "") )
&gt; -        printk("WARNING: UART configuration is not supported\n");
&gt; -
&gt;      uart =3D &amp;omap_com;
&gt;=20
&gt; -    res =3D dt_property_read_u32(dev, "clock-frequency", &amp;clksp=
ec);
&gt; -    if ( !res )
&gt; -    {
&gt; -        printk("omap-uart: Unable to retrieve the clock frequency\n=
");
&gt; -        return -EINVAL;
&gt; -    }
&gt; -
&gt; -    uart-&gt;clock_hz =3D clkspec;
&gt; +    /* Default configuration. */
&gt; +    uart-&gt;clock_hz =3D 0;
&gt;      uart-&gt;baud =3D 115200;
&gt;      uart-&gt;data_bits =3D 8;
&gt;      uart-&gt;parity =3D UART_PARITY_NONE;
&gt;      uart-&gt;stop_bits =3D 1;
&gt;=20
&gt; +    /*
&gt; +     * Parse dtuart options.
&gt; +     * Valid options:
&gt; +     *   - clock-hz
&gt; +     */
&gt; +    omap_uart_parse_config(uart, config);
&gt; +
&gt; +    /* If clock-hz is missing. */
Apart from missing, clock_hz can be 0 also if user specifies 0</pre>
    </blockquote>
    That's true, thx.<br>
    <blockquote type=3D"cite"
      cite=3D"mid:18deaad4-0bbf-4bf2-919e-7b213a1c8235@amd.com">
      <pre
style=3D"font-family: sans-serif; font-size: 100%; white-space: pre-wrap;=
 word-wrap: break-word">
&gt; +    if ( uart-&gt;clock_hz =3D=3D 0 )
&gt; +    {
&gt; +        u32 clkspec;
We are moving away from Linux derived types so please take the occasion t=
o use uint32_t here.
Also, there should be a blank line between definitions/code.</pre>
    </blockquote>
    Got it.<br>
    <blockquote type=3D"cite"
      cite=3D"mid:18deaad4-0bbf-4bf2-919e-7b213a1c8235@amd.com">
      <pre
style=3D"font-family: sans-serif; font-size: 100%; white-space: pre-wrap;=
 word-wrap: break-word">
&gt; +        res =3D dt_property_read_u32(dev, "clock-frequency", &amp;c=
lkspec);
&gt; +        if ( !res )
&gt; +        {
&gt; +            printk("omap-uart: Unable to retrieve the clock frequen=
cy\n");
&gt; +            return -EINVAL;
&gt; +        }
&gt; +        uart-&gt;clock_hz =3D clkspec;
&gt; +    }
&gt; +
&gt;      res =3D dt_device_get_paddr(dev, 0, &amp;addr, &amp;size);
&gt;      if ( res )
&gt;      {
&gt; --
&gt; 2.34.1
&gt;=20
&gt;=20

~Michal
</pre>
    </blockquote>
    Regards<br>
    Amneesh<br>
  </body>
</html>

--------------mmxO0gR1xX1sskrFwkjJrYu5--

--------------EYEIXmxdB57iQTMZahg0UZRd
Content-Type: application/pgp-keys; name="OpenPGP_0x104493B4D46917EC.asc"
Content-Disposition: attachment; filename="OpenPGP_0x104493B4D46917EC.asc"
Content-Description: OpenPGP public key
Content-Transfer-Encoding: quoted-printable

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

xsFNBGaGX/kBEACu0GIGVFYkfov56fJf9bWJxMv0RmXATnRVRAGIpXUYRnNVE+ra
A8U4ehT9N5FAnJqru6cQyW/hLpynZ2wE6iRmY43F3xFQ51c/luYh8OWkC4Boc59H
uGhQe79pXi7/P2WCiT6tbOXW2CcBzpAhIK+WjwLu/IbNVMyk/n/mGOKdGi1B/n9/
zHX79GXG39k5p/7ttaePCUEVSZXn8idiOrdGcOe/2B+xQen3nJmraEb5U2ZXe6Ne
veehKtJRk/15ePhHzxGWhFpwVKSETkvFMWfZUEncdN/zunsu/ExWUY4IhnxQyKSs
SR8QFV8oyyplV480XF6gJ98e2I6mNNLpI1qrEvSyzt0zz6qXyAxqZQippad8PJR7
PRp9II2IoHNDQZ6+tt3rP36owYF9AaaNi+t5cBUHmiWZ8P7N9iGZv1Orvv2fpD1w
DpvwcjkC6VGUVYm9ZbZOtSMuePsVQX9nrDW2FNTbT5tp5/hg/wTo5kt6/DeG1lW8
0SnWhlF7h4OYT4XOADgVflCNdQNPwWODbtMei7UbSEQTlfFM3a1vLZFBQ21hMPjv
J+0+8wGY6fivbcso4Agb1QQ3TVr07eYcekF2kvm9h1o6obsEUgkd+OgRtKW7Ukqr
BsDKU1sUVpPMsudkfhCfMkpUeMhGm9xCmnwJ7rCZi9bOK68jUwt3IfvI5QARAQAB
zSBBbW5lZXNoIFNpbmdoIDxhLXNpbmdoMjFAdGkuY29tPsLBlAQTAQoAPhYhBCsW
73h+3Cjcfr2IgxBEk7TUaRfsBQJmhl/5AhsDBQkAdqcABQsJCAcCBhUKCQgLAgQW
AgMBAh4BAheAAAoJEBBEk7TUaRfsfjkP/jjewYjXKEUQnk+B7BFrTc468G1PRspg
Kny+DAQ2R8J9zmnfYCbfFSD6tMowMIBuobC3FuHWZ3vYXgdzAkz1MRYmzVOrG4Xl
/h0XkqvGjOVTAJoKS0AunFjnT1VAUtYjyUw46/CiF1Iwfig52YEA+6DKBNtqhHLI
D1W1JQHGSdFvnzjvQBke75pAp6QkmLpiQzKcAvNHpMQaZ5VXv+Ls1Ek3CcJ2BRX3
KjaUEBrYBUR0CZdHkAuKEwzDSFtqXtIfVgAuG1S9U9juhUxoany0u3xXQCWAkJZC
TunjRNKl64hYw2jpzEJXZa8OvO0En39ZaiqaOQIPdudhj8idEYXOWseEIt9oDrRK
T5mBmiksQtAYJ0P6/+GOpriQGFeaq9AUkxd62X6JXBPYfFbpYHStDzlkZHLqGukz
uBKrjYbV6aVkLRpPOgjN/0a35Tpam1HHEqOsfe4HTK4UCJyQg8xMiqM9qpB2MZNJ
RnPz6hOrKKX+isXCiKKpSwJ02rmnEjPhAqSrSijd1PxZzrbju5+AeOBn/XTuqliu
soX+O3WYNN71w7brNamW4KmGa1isBX6uH5mvM8LrNPVvljZQM0QIA1yPAoZoqtR8
yRB1z3oI7R7+qoirnts/dRjadUP29qKBdSWwjAR7KuxuYAABHacAIl31LHWf5QJf
DZmTHV0pTiUazsFNBGaGX/kBEADRw7/VxiIwzQNRHhx/r1v6GB3six1CjXthn/ER
LzVq8ytejbp7gecKef0T8FYjo1s/12Ifdqmq7UrPU606kKljvf3c0oL/uS02AHaA
T/XI49nB2/LXK3pUkUqkNEapzZZNleN42ve1a0PeCwde57F6ZjfzcGtbN7XJ4pg4
elpzRa3bFfFhBMOFBTNUpy26nYXub/Xp3Yl+5hZxrVUV0w96+q/P1VcSXlN7YrCw
9Ke5V3tTO7KAuckTDddECju5CTSPrAORiP5wJoS25WJ86a8dQdFifiMdtAR2GEq8
c4bX047CwdYwNqepxrTLpiAz7Pk7mCb3ZJLR8DpN7HXRcs4Aonu3BZnex5Q2iLjY
ZYFnCdCX01j+SPhXSSIBNefqSo+0NpapPxrHKFjV9VYB0jgrlXemiP2iGznlt3if
w+gzDIKvrS6MH/qXaDT0p5VwYTuOb3beO186l7PxgWWYZsOLwFp7QtsHB54IdUXK
OzC3iRumsVef0mLmQ9/hVkFHZk4sdQeAEF+7iclJLJE0mioE1daNIPFGVI4V+6ok
y3IO1tNXHP2OD/CjmFLpPBe7IpSjSlFvq6loPGELNMvd7fOE3SDvqM6KxAD0ET00
SubzZwTPIEuyw0KUhyN3bIOx2C3PmSz/BkdVhOZkJGPa3nVhQdX0dKF5N4wkUgCH
1EKgIwARAQABwsF8BBgBCgAmFiEEKxbveH7cKNx+vYiDEESTtNRpF+wFAmaGX/kC
GwwFCQB2pwAACgkQEESTtNRpF+x20g//QLFUN32HUyh14stjpo7NkuOvcJL5AsgY
Q5wrBI5K0UMFhyNMpY8ZkRAiEBBhyiEgWHQiI8Zu4pu1DN2KJ3TmVglY0hhCB8lk
/fGAOpHGdIISdBCEGrJ2Xnn0U51WvRJBBR8aeCz8dG0N41qrcDW8tKd9+SDge9V2
FI1/ZrQ8sb8rL2Gvir9kYbOuvq4M3HUlN1rdxc2Dt6Nc+/ziLV0RB2011PuLC3yE
Pf6sB83U2NHgB0VvEWsVumPXxHq+irYLVNzFgYPhkw2Hcg5SnKczDUI6zNE6MXmJ
qzz2hbu8w5pmTK3W50EghZPnSYlkwFt/cCxu5ws84D7z5QjT6ZdrZ8Jg5RVyKe27
x+L/idKj9Xhko9K9M3N7KMCrJvYsCLRPxNiRQh3DMuv9zGrwkRxAI0TpB7n28BjQ
IWcf3T8fhOWPNZEnB4RZDnoPhKnFRZcki1CgspD94Q5/wV4S0bM9DdIgZ0GycFkh
8SCmFU56rJHDHa09bCFzTWZG7ruHNay5nXVQToFuSA3NAgWa5ZR9DUsFw/uL+Uv5
53mv9SUh3jXHUrhLEf576UJxiA2VVealrOOJDl6w6z97w5fokOZpZpLlNl20g88Y
6iJV/isSZmH1yib9zv0XsolJAX6Gk446MqGbVmfk0zyx+lmNQ+B98L939ZhqnROQ
8zIlNC+fabI=3D
=3D3mR5
-----END PGP PUBLIC KEY BLOCK-----

--------------EYEIXmxdB57iQTMZahg0UZRd--

--------------MphJER2dfXwmOZBc0DPqD0DY--

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

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

wsF5BAABCAAjFiEEKxbveH7cKNx+vYiDEESTtNRpF+wFAmax5vQFAwAAAAAACgkQEESTtNRpF+yl
Eg/+L2cj5YVIcHOK8NGuKGl7gs1HzN9gGFzYEFI6bfwgxqFXGB1WlhJ31Y1heHnLwe0QbWPVGdFb
Wyanhd1/8PEKxezlPdukItylvujw8AkLfyL88f96tEdiQkC1GKZhy5scBXKSdETQOTwnpAz4J999
dt39X0x6d5uezBe69CDMrofjAiul1cvDZstbyy13yi8sfRfocnDOH5ew9uD9lPyNCqblouGmNmqh
hdBr7jsUG0ZeQCSqFxMKiy7d1oooLnkY8NFpnOvlFW4U34cdT73tS6LJqZ7GhWCg/uuAmGBAgwdn
1EW2JAPgSOpoQireBiwmYQ43xWVchg+MK+4usz5kOdCLYqU09wtRXP/Mi+ZzhvAfrP+O9ykhB3HV
XcZUGLbXPiXVFfYJQXBqm8s8dewRW6XgoYBeGBKVJQ8zcEr2hvjxBN5IjYssIPw1zQ5muAkYGNbG
9lEYhfCnINAF3iSKHA3Fea+DetKmveQSM7FXxdSV6xqqocRnfsvdtSxHIOHWmfOaRDGirs9RUnsx
nZ9d1nV5KtLvLAE2U2oe/KQf5aa3Y+/0KwnRJyN3EVqe+eA/pIpgzZPUyuFFisqo7Ohsghu9j3yA
OCh1br6zvOSQV8cwQ1C8ATShodx1lt02pMSmuJpfD+KQCEenaE9QzcU7CuJ2Sb5Iuv4wfNfalOCG
LH0=
=L/ss
-----END PGP SIGNATURE-----

--------------E3i8BTeoaIEPZrRYex3hAbkE--


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 09:05:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 09:05:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772589.1183032 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbG83-0001QW-17; Tue, 06 Aug 2024 09:05:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772589.1183032; Tue, 06 Aug 2024 09:05:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbG82-0001QP-Uh; Tue, 06 Aug 2024 09:05:14 +0000
Received: by outflank-mailman (input) for mailman id 772589;
 Tue, 06 Aug 2024 09:05:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbG82-0001QA-9d; Tue, 06 Aug 2024 09:05:14 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbG82-0001hT-10; Tue, 06 Aug 2024 09:05:14 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbG81-0004Fo-Nk; Tue, 06 Aug 2024 09:05:13 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbG81-0000LN-N9; Tue, 06 Aug 2024 09:05:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=bpCz1vGzZOvQw1RFW61NNZCPqolzYIZOHNz73Ax7ycM=; b=Br9GZ9j5bhgwzNLKtq8hX+6BGA
	CCiRhufS2R5znRt8VJKEdaJo1vXdcdMZVnsey/zjrEik8mZb5RFfvm7tsl+qHXWdIWvcs2bWDKr3n
	RCAFlqieI3ntdFZ0bmYoWCJqm5sWd5b7zUHazNHwWDPSADqX5plB5SLztakwv4Xy0z9U=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187168-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187168: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=a29a9cce5f9afa32560d966e501247246ec96ef6
X-Osstest-Versions-That:
    ovmf=472be4d139b26c50949cf30eeb47640810e5ef2c
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 06 Aug 2024 09:05:13 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 a29a9cce5f9afa32560d966e501247246ec96ef6
baseline version:
 ovmf                 472be4d139b26c50949cf30eeb47640810e5ef2c

Last test of basis   187166  2024-08-06 03:43:14 Z    0 days
Testing same since   187168  2024-08-06 06:11:29 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Aaron Pop <aaronpop@microsoft.com>
  kuqin12 <42554914+kuqin12@users.noreply.github.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   472be4d139..a29a9cce5f  a29a9cce5f9afa32560d966e501247246ec96ef6 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 09:17:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 09:17:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772602.1183041 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGJP-00046E-2F; Tue, 06 Aug 2024 09:16:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772602.1183041; Tue, 06 Aug 2024 09: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 <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGJO-000467-Vw; Tue, 06 Aug 2024 09:16:58 +0000
Received: by outflank-mailman (input) for mailman id 772602;
 Tue, 06 Aug 2024 09:16: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 1sbGJN-000461-RK
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 09:16: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 1sbGJN-0001up-81; Tue, 06 Aug 2024 09:16:57 +0000
Received: from [15.248.3.88] (helo=[10.24.67.24])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbGJN-0001jF-0X; Tue, 06 Aug 2024 09:16:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:Cc:
	References:To:Subject:MIME-Version:Date:Message-ID;
	bh=SN3hoKBjMyUWtJllNwW7DnmkEjQwYN22OSSQfPIAx34=; b=dmw//Y9Q0fEPeh7x/4NTVrLeXV
	DWT3IXetFcgpUxNRLAkDluX2M+m+vrFoVNEcBXYZPIUzK63jr1Z++haDc99jUPj5P8YEhqypiQTnU
	KexzJuajeU9uzR7fWDd8C1zFrqrcA6i10UeuKtH7E1Xk8CguaMOFKLdF9gCaqOzU6Rdk=;
Message-ID: <b7ef34fe-f6eb-45e8-8f6a-0e2c4bd0175b@xen.org>
Date: Tue, 6 Aug 2024 10:16:55 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] drivers: char: omap-uart: add "clock-hz" option
Content-Language: en-GB
To: Amneesh Singh <a-singh21@ti.com>, xen-devel@lists.xenproject.org
References: <20240719113313.145587-1-a-singh21@ti.com>
Cc: Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Stefano Stabellini <sstabellini@kernel.org>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20240719113313.145587-1-a-singh21@ti.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 19/07/2024 12:33, Amneesh Singh wrote:
> Quite a few TI K3 devices do not have clock-frequency specified in their
> respective UART nodes.

Can you outline why fixing the device-tree is not solution?

> However hard-coding the frequency is not a
 > solution as the function clock input can differ between SoCs.

Can you provide some details how Linux is handling those SoCs?

> So,
> similar to com1/com2, let the user pass the frequency as a dtuart option
> via the bootargs. If not specified it will fallback to the same DT
> parsing as before. For example, dtuart=serial2:clock-hz=48000000 can be
> a valid bootarg.

Regardless my questions, any change to the command line needs to be 
documented in docs/misc/xen-command-line.pandoc.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 09:18:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 09:18:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772609.1183051 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGKz-0004eB-C3; Tue, 06 Aug 2024 09:18:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772609.1183051; Tue, 06 Aug 2024 09:18:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGKz-0004e4-9O; Tue, 06 Aug 2024 09:18:37 +0000
Received: by outflank-mailman (input) for mailman id 772609;
 Tue, 06 Aug 2024 09:18:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbGKx-0004de-V7; Tue, 06 Aug 2024 09:18:35 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbGKx-0001wt-Sw; Tue, 06 Aug 2024 09:18:35 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbGKx-0004Zw-EI; Tue, 06 Aug 2024 09:18:35 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbGKx-0003Ve-Dl; Tue, 06 Aug 2024 09:18:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=AKD2g2/K5zuRVWyifqJOyHp367PS4jSTd3Tct59AGW0=; b=zwOrxtU6868RIvkKxOv3Wo+yEn
	sKM2fE9HT+w4wSS4UI5qtar0/ad4nd/rNPuRy9EwvTFuGKfrhwBMaBaWcYlX0atkuDNfcHKyBQaH6
	UmwVDkAcAUwun/MfCmh9J7GMSz3857R4bGQkgOo49t9uQkdOL0Dz50vuvBvK+6j2tD1o=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187164-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187164: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=bec25f11d5180d407cf04d2de2525fa6f876bde1
X-Osstest-Versions-That:
    xen=ded5474718a84366dac80aae039a693b66fa7e2e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 06 Aug 2024 09:18:35 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 xen                  bec25f11d5180d407cf04d2de2525fa6f876bde1
baseline version:
 xen                  ded5474718a84366dac80aae039a693b66fa7e2e

Last test of basis   187149  2024-08-05 01:53:50 Z    1 days
Testing same since   187164  2024-08-05 21:38:57 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Roger Pau Monné <roger.pau@citrix.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   ded5474718..bec25f11d5  bec25f11d5180d407cf04d2de2525fa6f876bde1 -> master


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 09:26:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 09:26:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772623.1183074 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGSN-0006Ik-9M; Tue, 06 Aug 2024 09:26:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772623.1183074; Tue, 06 Aug 2024 09:26:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGSN-0006Id-6C; Tue, 06 Aug 2024 09:26:15 +0000
Received: by outflank-mailman (input) for mailman id 772623;
 Tue, 06 Aug 2024 09:26:14 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ctxO=PF=ti.com=a-singh21@srs-se1.protection.inumbo.net>)
 id 1sbGSM-0006HS-0F
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 09:26:14 +0000
Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ead34c26-53d5-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 11:26:11 +0200 (CEST)
Received: from fllv0035.itg.ti.com ([10.64.41.0])
 by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 4769Q8IT114217;
 Tue, 6 Aug 2024 04:26:08 -0500
Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29])
 by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 4769Q8aJ099740
 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL);
 Tue, 6 Aug 2024 04:26:08 -0500
Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE108.ent.ti.com
 (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 6
 Aug 2024 04:26:08 -0500
Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE105.ent.ti.com
 (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via
 Frontend Transport; Tue, 6 Aug 2024 04:26:08 -0500
Received: from localhost (nightbug.dhcp.ti.com [172.24.227.225])
 by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 4769Q7Ah098907;
 Tue, 6 Aug 2024 04:26:08 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ead34c26-53d5-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com;
	s=ti-com-17Q1; t=1722936368;
	bh=1+2zExbbx5eHIAIZNAv1tu60FH4abf/vPaxiPcu1zPA=;
	h=Date:From:To:Subject:References:In-Reply-To;
	b=Cc+hcXW7B00d2FyaVjSeQOgHucHzcHz4cEnhSJFT6farGq80MbBRm0Ah2BDsgOvRg
	 xGmt8xB5XIk9jGf1PySaQiO7wF03HG0OAvjOzmTrm6e8rpcyQafDE5mc+CvgJk+yZO
	 CJlPpKKJCVOYJqFYgn+rpnVDIiFvB4YdakwTAkHQ=
Date: Tue, 6 Aug 2024 14:56:06 +0530
From: Amneesh Singh <a-singh21@ti.com>
To: Michal Orzel <michal.orzel@amd.com>, <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] drivers: char: omap-uart: add "clock-hz" option
Message-ID: <gnn2vye33vp4mp4k2ncl23rdfv5qfhatatzfkg2qhsla6232za@hjk2szchnfab>
References: <20240719113313.145587-1-a-singh21@ti.com>
 <18deaad4-0bbf-4bf2-919e-7b213a1c8235@amd.com>
 <713072f9-5c1f-4958-913c-67c4675de488@ti.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <713072f9-5c1f-4958-913c-67c4675de488@ti.com>
X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180

Was not using my usual mailing client, hence the abomination on the web
view of the mailing list. Pardon the subject too.

Apologies
Amneesh


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 09:30:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 09:30:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772632.1183084 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGWA-0008J2-PQ; Tue, 06 Aug 2024 09:30:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772632.1183084; Tue, 06 Aug 2024 09:30:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGWA-0008Iv-LH; Tue, 06 Aug 2024 09:30:10 +0000
Received: by outflank-mailman (input) for mailman id 772632;
 Tue, 06 Aug 2024 09:30: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=nfQe=PF=inria.fr=fonyuy-asheri.caleb@srs-se1.protection.inumbo.net>)
 id 1sbGW9-0008Ip-1m
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 09:30:09 +0000
Received: from mail2-relais-roc.national.inria.fr
 (mail2-relais-roc.national.inria.fr [192.134.164.83])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 773fc3ee-53d6-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 11:30:06 +0200 (CEST)
Received: from zcs2-store8.inria.fr ([128.93.142.6])
 by mail2-relais-roc.national.inria.fr with ESMTP; 06 Aug 2024 11:30:06 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 773fc3ee-53d6-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
  d=inria.fr; s=dc;
  h=date:from:to:cc:message-id:in-reply-to:references:
   subject:mime-version:content-transfer-encoding;
  bh=rLZbUJ6tcbgYc+05/z/Y9OMSrr8l7UrrM/xvDeuwQnA=;
  b=Qm1hG+q/yFN7x4NqPU+r7dxLXMGtfzdND8blFNojHa0bDFM7nN3Bbd9o
   3BPwAzdI3+DDdmbGBYMtrEB9sTaW3wcDWb4Ga2mliL8fPbfXnAwl+MhCR
   IwtcQBLZ9EvQxckmjI9NNM6fAQ2BCaOp3byZotvDTaUALCPoEzj+Q4pI/
   c=;
Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=Pass smtp.mailfrom=fonyuy-asheri.caleb@inria.fr; spf=None smtp.helo=postmaster@zcs2-store8.inria.fr
Received-SPF: Pass (mail2-relais-roc.national.inria.fr: domain of
  fonyuy-asheri.caleb@inria.fr designates 128.93.142.6 as
  permitted sender) identity=mailfrom; client-ip=128.93.142.6;
  receiver=mail2-relais-roc.national.inria.fr;
  envelope-from="fonyuy-asheri.caleb@inria.fr";
  x-sender="fonyuy-asheri.caleb@inria.fr";
  x-conformance=spf_only; x-record-type="v=spf1";
  x-record-text="v=spf1 include:mailout.safebrands.com
  a:basic-mail.safebrands.com a:basic-mail01.safebrands.com
  a:basic-mail02.safebrands.com ip4:128.93.142.0/24
  ip4:192.134.164.0/24 ip4:128.93.162.160 ip4:89.107.174.7 mx
  ~all"
Received-SPF: None (mail2-relais-roc.national.inria.fr: no sender
  authenticity information available from domain of
  postmaster@zcs2-store8.inria.fr) identity=helo;
  client-ip=128.93.142.6;
  receiver=mail2-relais-roc.national.inria.fr;
  envelope-from="fonyuy-asheri.caleb@inria.fr";
  x-sender="postmaster@zcs2-store8.inria.fr";
  x-conformance=spf_only
X-IronPort-AV: E=Sophos;i="6.09,267,1716242400"; 
   d="scan'208";a="178240269"
X-MGA-submission: =?us-ascii?q?MDGCX/YwVCsCaCjliXTFRyqUkKj5kqX9zv8Bpc?=
 =?us-ascii?q?ZbXXYaVPchyStRePOALyqhuOn2GjtnhDKqOe7ei7NOEDaim81aMojCAV?=
 =?us-ascii?q?iA8c6NAwZ5PdG/kJANT7u0gFCpFQyr3hzMi2sPrDARN+N09pjMEaUAdH?=
 =?us-ascii?q?SgaoPngNf+3hhfEsmrGfhHHg=3D=3D?=
Date: Tue, 6 Aug 2024 11:30:05 +0200 (CEST)
From: Fonyuy-Asheri Caleb <fonyuy-asheri.caleb@inria.fr>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, 
	Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <349786242.15991470.1722936605909.JavaMail.zimbra@inria.fr>
In-Reply-To: <c4dac0ae-a8f4-4121-ad2e-f7cd61b6e3a8@suse.com>
References: <60751777.2038091.1720694327760.JavaMail.zimbra@inria.fr> <1557490999.4048664.1721029086794.JavaMail.zimbra@inria.fr> <77f1ff6e-a7dd-45c8-b706-429674b559f2@suse.com> <ece26efe-c1af-4fd2-910d-01a33beda5cc@citrix.com> <120712863.15929301.1722927890402.JavaMail.zimbra@inria.fr> <0f69e94a-5720-4f1f-b51d-b4fb2c6bbe0b@suse.com> <674914344.15937452.1722929654769.JavaMail.zimbra@inria.fr> <c4dac0ae-a8f4-4121-ad2e-f7cd61b6e3a8@suse.com>
Subject: Re: Help with Understanding vcpu xstate restore error during vm
 migration
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Originating-IP: [131.254.23.3]
X-Mailer: Zimbra 10.0.8_GA_4611 (ZimbraWebClient - GC127 (Linux)/10.0.8_GA_4611)
Thread-Topic: Help with Understanding vcpu xstate restore error during vm migration
Thread-Index: t3nof4WF/XMpfunOjNBJQ79sKvEaFw==



> On 06.08.2024 09:34, Fonyuy-Asheri Caleb wrote:
>>> If what you say in the earlier paragraph was the case with upstream Xen and
>>> without you restricting what the guest being migrated was able to see on the
>>> source host, then I think that would indicate a bug somewhere. Yet you don't
>>> provide enough details to be certain.
>> 
>> Sorry for not specifying. I am still in the same context as stated previously.
>> I haven't made any modifications to xen and no restrictions on what the guest
>> can see.
> 
> Wasn't it the case that previously you observed AVX disabled, because of
> GDS? With AVX disabled, AVX512 would be implicitly disabled, too. Then

In my previous setup I wasn't able to confirm the GDS status because at the time
we mentioned it in discussions I no longer had access to the experiment environment. 

> migrating from an AVX512-capable host to an AVX512-incapable one would
> of course work. Yet of course this is only an example, because I don't
> know whether AVX512 is what your new inquiry would have been about. As
> indicated - please provide sufficient detail so we actually know what
> you're doing and what you observe.
> 
> Jan

Seems there's more to this than I think. Here's the entire information about my setup. 

Source Server: 
   Processor: Intel(R) Xeon(R) Platinum 8358 CPU @ 2.60GHz
   Xsave dependences(based on xen gen-cpuid.py): 
                     'fma', 'avx', 'f16c', 'avx2', 'avx512f', 'avx512dq', 'avx512cd', 
                      'avx512bw', 'avx512vl', 'xsaveopt', 'xsavec', 'xgetbv1', 'xsaves', 
                      'pku', 'avx512_vbmi2', 'vaes', 'vpclmulqdq', 'avx512_vnni', 'avx512_bitalg', 
                      'avx512_vpopcntdq'


Target Server:
   Processor: Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz
   Xsave dependencies: 
             'fma', 'avx', 'f16c', 'avx2', 'mpx', 'avx512f', 'avx512dq', 
             'avx512cd', 'avx512bw', 'avx512vl', 'xsaveopt', 'xsavec', 'xgetbv1', 'xsaves', 'pku'

Operating System: Debian12 (on both source and target servers)
Guest OS: Ubuntu 18.04 (PV)

Xen version: 4.18.3-pre (commit 01f7a3c792241d348a4e454a30afdf6c0d6cd71c)


So I have the following which are available on my source server but not on the target server: 
'avx512_vbmi2', 'vaes', 'vpclmulqdq', 'avx512_vnni', 'avx512_bitalg', 'avx512_vpopcntdq'

Per my current understanding, I would expect more xstates on the VM than supported on the target
server and hence a failure with xstate verification when restoring CPU state. 

However migrating a guest from Source to target works. 

Note that these extra avx512 features are all visible to the guest I migrate.

Caleb







From xen-devel-bounces@lists.xenproject.org Tue Aug 06 09:33:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 09:33:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772641.1183094 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGYw-0000VT-8X; Tue, 06 Aug 2024 09:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772641.1183094; Tue, 06 Aug 2024 09:33:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGYw-0000VM-5n; Tue, 06 Aug 2024 09:33:02 +0000
Received: by outflank-mailman (input) for mailman id 772641;
 Tue, 06 Aug 2024 09:33:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=HPS5=PF=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sbGYv-0000VG-8Z
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 09:33:01 +0000
Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com
 [2a00:1450:4864:20::22a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id df007a78-53d6-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 11:33:00 +0200 (CEST)
Received: by mail-lj1-x22a.google.com with SMTP id
 38308e7fff4ca-2f0dfdc9e16so5359381fa.2
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 02:33:00 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f15e273b68sm14101161fa.134.2024.08.06.02.32.58
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 06 Aug 2024 02:32:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: df007a78-53d6-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722936780; x=1723541580; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=1/HjB2PAAaGycgqMtIi4q8QL2Xbc5dwur2HVMfpuOJ8=;
        b=KZtE1qjX6S2qGb8QvjOKbrOmFg0jCruxGIxxLvcDPfqYW/tSpb/owmks5/vDISStlq
         z5W/ED6GV9p2AzeT0eZMtAcZwlsrDT5KnAbWri9S4Z45kpGE4NtYUcJpFO86OUqs880v
         /1hJkanrYWky0xnVlThEw1atCYbgB/tMuGnUjhQcIDruKK7SkLjbodYrUkuH7/mFGU6I
         7ZWMvgty/2KzbsSWQ2MUSBNUGUPkdpCRPGcBUEEj0m48mZuhvVDjVytxRcTPLnxLQO8X
         rnI3G11W0mRFhsAOjEVBJlS+8B6xAPJO/cexB76RmT3wCGHdORuRENxzySa43DeBTUwv
         IaBQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722936780; x=1723541580;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=1/HjB2PAAaGycgqMtIi4q8QL2Xbc5dwur2HVMfpuOJ8=;
        b=jnv7tSIP9zaQf0nwStUMCqaAGuflWFH/NLJHwIeKdBz5ijX23j7GtIBzCNJ98ETAJH
         Dl/Zrolz40X9eF/ldBO9i3UsZtqfvm8pdveK6HOpQKgHvbTYoIuOFgMmVC2RoSKfuc/o
         dj3la8DxJi8YLFmcKFrRCQy8GXOYW5JJM1SJOkRNiQXKTg5F/Xf5koohTAoecBBxpRZi
         5b0ccWB5qEidvWcC8JlwP0oBtUBsg87V3arCbXMhnb34OuRj6FQnmrmlRLiOcqxdGjqE
         2z8vGMnsho3PQEdoEmBHARUx/SJI6bJMu7QnvK52TE2RvxCQv8YTvXvi6vsnhCKUtiSf
         zzVA==
X-Forwarded-Encrypted: i=1; AJvYcCVIY8dRmGQ5C2IxkqDQbeEQmhDMk7eG//OeFCqEwgTrwqWleSjAAlKaAVOuK/UOojxyYpJF80KLtiSgJ2Mr16kOR1TeLdysGOqQHz4Bwrs=
X-Gm-Message-State: AOJu0YxMPwadNz1hqtVDtlQguk2S9jd6ObHRvRLeN+hXZCpinHEnwkrX
	mJcNVawB6qliPTo0+kv/WO7v6vzOI7gfcbDWfs4FNXCD8rkEpr3c
X-Google-Smtp-Source: AGHT+IHyit2VFQ9k/wMwWJkqpj8yE6znYUlEQ3GTzjPRotf3+sbkX6Vc/6Ss/etHxMvEl+MyTKxN8Q==
X-Received: by 2002:a2e:94cf:0:b0:2ef:2c27:6680 with SMTP id 38308e7fff4ca-2f15aa91245mr91107281fa.12.1722936779123;
        Tue, 06 Aug 2024 02:32:59 -0700 (PDT)
Message-ID: <7a1eb753125f7a3df55049de8e83bbef0818cf55.camel@gmail.com>
Subject: Re: [PATCH v3 4/9] xen/riscv: setup fixmap mapping
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org,
 Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
 <michal.orzel@amd.com>
Date: Tue, 06 Aug 2024 11:32:58 +0200
In-Reply-To: <35b277c6-8715-4c5b-b82d-ae29bbac8643@suse.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
	 <04576976b82b97442f645b83b3d62475d144af8e.1721834549.git.oleksii.kurochko@gmail.com>
	 <917cc521-c0c4-49e8-bc40-948679398bc6@suse.com>
	 <afbbf9ed7c575e3b2c3f9a668db0b27258822ee0.camel@gmail.com>
	 <d68f3047-5b12-4802-aac3-bb0b9c76cb08@suse.com>
	 <ca7ba33e8314d776a1c7928730ab58eeec58dde7.camel@gmail.com>
	 <35b277c6-8715-4c5b-b82d-ae29bbac8643@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Mon, 2024-08-05 at 18:14 +0200, Jan Beulich wrote:
> On 05.08.2024 18:02, oleksii.kurochko@gmail.com=C2=A0wrote:
> > On Mon, 2024-08-05 at 17:45 +0200, Jan Beulich wrote:
> > > On 05.08.2024 17:13, oleksii.kurochko@gmail.com=C2=A0wrote:
> > > > On Mon, 2024-07-29 at 15:35 +0200, Jan Beulich wrote:
> > > > > > +=C2=A0=C2=A0=C2=A0 }
> > > > > > +
> > > > > > +=C2=A0=C2=A0=C2=A0 BUG_ON(pte_is_valid(*pte));
> > > > > > +
> > > > > > +=C2=A0=C2=A0=C2=A0 tmp =3D paddr_to_pte(LINK_TO_LOAD((unsigned
> > > > > > long)&xen_fixmap),
> > > > > > PTE_TABLE);
> > > > >=20
> > > > > I'm a little puzzled by the use of LINK_TO_LOAD() (and
> > > > > LOAD_TO_LINK()
> > > > > a
> > > > > little further up) here. Don't you have functioning __pa()
> > > > > and
> > > > > __va()?
> > > > Can __pa() and __va() be used in this case?
> > > >=20
> > > > According to comments for other architectures, these macros are
> > > > used
> > > > for converting between Xen heap virtual addresses (VA) and
> > > > machine
> > > > addresses (MA). I may have misunderstood what is meant by the
> > > > Xen
> > > > heap
> > > > in this context, but I'm not sure if xen_fixmap[] and page
> > > > tables
> > > > are
> > > > considered part of the Xen heap.
> > >=20
> > > I didn't check Arm, but on x86 virt_to_maddr() (underlying
> > > __pa())
> > > has
> > > special case code to also allow addresses within the Xen image
> > > (area).
> >=20
> > Yes, it is true for __virt_to_maddr:
> > =C2=A0=C2=A0 static inline unsigned long __virt_to_maddr(unsigned long =
va)
> > =C2=A0=C2=A0 {
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ASSERT(va < DIRECTMAP_VIRT_END);
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( va >=3D DIRECTMAP_VIRT_START =
)
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 va -=3D DI=
RECTMAP_VIRT_START;
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BUILD_BUG_=
ON(XEN_VIRT_END - XEN_VIRT_START !=3D GB(1));
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* Signed,=
 so ((long)XEN_VIRT_START >> 30) fits in an
> > imm32. */
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ASSERT(((l=
ong)va >> (PAGE_ORDER_1G + PAGE_SHIFT)) =3D=3D
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((long)XEN_VIRT_START >> (PAGE_ORDER_1G +
> > PAGE_SHIFT)));
> > =C2=A0=C2=A0=20
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 va +=3D xe=
n_phys_start - XEN_VIRT_START;
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return (va & ma_va_bottom_mask) |
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 ((va << pfn_pdx_hole_shift) & ma_top_mask);
> > =C2=A0=C2=A0 }
> > =C2=A0=C2=A0=20
> > But in case of __maddr_to_virt ( __va() ) it is using directmap
> > region:
> > =C2=A0=C2=A0 static inline void *__maddr_to_virt(unsigned long ma)
> > =C2=A0=C2=A0 {
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ASSERT(pfn_to_pdx(ma >> PAGE_SHIFT=
) < (DIRECTMAP_SIZE >>
> > =C2=A0=C2=A0 PAGE_SHIFT));
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return (void *)(DIRECTMAP_VIRT_STA=
RT +
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((ma & ma_v=
a_bottom_mask) |
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((ma =
& ma_top_mask) >>
> > pfn_pdx_hole_shift)));
> > =C2=A0=C2=A0 }
> >=20
> > But I have to use both __va() and __pa().
> > __va() inside cycle to find L1 page table:
> >=20
> > =C2=A0=C2=A0=C2=A0 for ( i =3D HYP_PT_ROOT_LEVEL; i-- > 1; )
> > =C2=A0=C2=A0=C2=A0 {
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BUG_ON(!pte_is_valid(*pte));
> >=20
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pte =3D (pte_t *)LOAD_TO_LIN=
K(pte_to_paddr(*pte));
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pte =3D &pte[pt_index(i, FIX=
MAP_ADDR(0))];
> > =C2=A0=C2=A0=C2=A0 }
> >=20
> > __pa() to set a physical address of L0 page table:
> > =C2=A0=C2=A0=C2=A0 tmp =3D paddr_to_pte(LINK_TO_LOAD((unsigned long)&xe=
n_fixmap),
> > PTE_TABLE);
> > =C2=A0=C2=A0=C2=A0 write_pte(pte, tmp);
>=20
> Hmm, then using at least LINK_TO_LOAD() is going to be unavoidable
> for the
> time being, I guess. Yet midterm I think they should disappear from
> here.
I think that in this specific case both LINK_TO_LOAD() and
LOAD_TO_LINK() should be used.

__va() -> __maddr_to_virt() can't be used here as it's calculation is
based on DIRECTMAP_VIRT_START thereby we will receive incorrect virtual
address of page table.

__pa() -> __virt_to_maddr() can't be used too because virtual address
of xen_fixmap will be always bigger then DIRECTMAP_VIRT_START ( as
XEN_VIRT_START > DIRECTMAP_VIRT_START ) thereby physical address (PA)
will be calculated based on DIRECTMAP_VIRT_START and incorrect PA of
xen_fixmap will be received.

It seems to me that it is only one choice we have at the moment ( and
probably in the case of fixmap mapping ) is to use
LINK_TO_LOAD()/LOAD_TO_LINK().

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 09:42:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 09:42:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772654.1183104 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGhU-0002jM-3H; Tue, 06 Aug 2024 09:41:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772654.1183104; Tue, 06 Aug 2024 09:41:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGhT-0002jF-Vw; Tue, 06 Aug 2024 09:41:51 +0000
Received: by outflank-mailman (input) for mailman id 772654;
 Tue, 06 Aug 2024 09:41:51 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=kFQN=PF=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbGhT-0002j9-0f
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 09:41:51 +0000
Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com
 [2a00:1450:4864:20::531])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1a1d8706-53d8-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 11:41:48 +0200 (CEST)
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5a10835487fso823354a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 02:41:48 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b83a03b403sm5901370a12.42.2024.08.06.02.41.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 06 Aug 2024 02:41:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1a1d8706-53d8-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722937308; x=1723542108; 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=+oKCBMhcstSt6SQLNCOfWe2M0/48UJUJ+Kv4HPbMB6I=;
        b=fML2BoKyhUg/fcP8FUi7/MFVGZl9fdTlcCPuACsv0VKocDgMIWuUR9rCuN09yb2zvZ
         bRl5LJ0cC1W7OIuj5T1sPCupm0l651M8C6sPehC/BJ/FPjnTZsYWuY9O+REucYh6kJtm
         BNssg1prlhoeHLMhWLtJNhzoH91F/Ik18BiQAfhQri2FbI0ZjjWsi5w35oIrbR5b29dp
         kBXbhURorVSlzA9HWG+u1v2CYEBsdbu4Em0dtgxS8YwdSSmm34nrCfFakZpHAn2Tp0Zn
         a9Wp2k9xyUkNCR6dfKKI9NQKxfyNAMbSWzW1eOWT1mCVfAipZ+orE8owCmkryCJqF2Q0
         YcfA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722937308; x=1723542108;
        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=+oKCBMhcstSt6SQLNCOfWe2M0/48UJUJ+Kv4HPbMB6I=;
        b=rgfQIP44xMbKRq1VIwJTuPx/RmaN+1qsTxranIfgBzaveePWIKaZaWavgPF34mgMSm
         hYib0ojsGh7vbHITZYuje1rxB6KvAhYrQoUNkuKtHse706UoTpfBtdD9cbEG3169rrZI
         ppNM7+kjnqQmZckqbwl2HSQ7vMLdS0VNgoDFIBjkfoqHQ7cICArq+mP2+oLaj+soNI6A
         4+gL+FGhRe7rV9rNbKkB8fdXQNafOOq58U58sYE2PWTd1skSB3X5x/NHMR3nXHVkcmhV
         OUMOTZtynNqBmRJvMCxN9vClIubmDqXLm3A+ciYToJPBSzSJ8xbjHnSDaJ/RnufT3u4e
         NgIA==
X-Gm-Message-State: AOJu0YyNh+hz0Cli/VnFSrMenm0RnnNz+MT+l/LRHzcP+a6L8jbVksUE
	th2B8Kz2ritPJomtQtwWu+jf9U/doiUZBGgWrZPfWswJHPoMq0nUF8i0YPDXGA==
X-Google-Smtp-Source: AGHT+IE6fq8HD4NSbz8vcAeFRzV3yTYDi5hZsFC4DojON+D7JYm3i1KjExmZFB1lCw5LlTLyHOSrmw==
X-Received: by 2002:a05:6402:c08:b0:5b9:3846:8bab with SMTP id 4fb4d7f45d1cf-5b938469427mr7871938a12.14.1722937308279;
        Tue, 06 Aug 2024 02:41:48 -0700 (PDT)
Message-ID: <01c81e66-a921-458c-bf9e-fe1bd9054936@suse.com>
Date: Tue, 6 Aug 2024 11:41:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Help with Understanding vcpu xstate restore error during vm
 migration
To: Fonyuy-Asheri Caleb <fonyuy-asheri.caleb@inria.fr>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>
References: <60751777.2038091.1720694327760.JavaMail.zimbra@inria.fr>
 <1557490999.4048664.1721029086794.JavaMail.zimbra@inria.fr>
 <77f1ff6e-a7dd-45c8-b706-429674b559f2@suse.com>
 <ece26efe-c1af-4fd2-910d-01a33beda5cc@citrix.com>
 <120712863.15929301.1722927890402.JavaMail.zimbra@inria.fr>
 <0f69e94a-5720-4f1f-b51d-b4fb2c6bbe0b@suse.com>
 <674914344.15937452.1722929654769.JavaMail.zimbra@inria.fr>
 <c4dac0ae-a8f4-4121-ad2e-f7cd61b6e3a8@suse.com>
 <349786242.15991470.1722936605909.JavaMail.zimbra@inria.fr>
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: <349786242.15991470.1722936605909.JavaMail.zimbra@inria.fr>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 06.08.2024 11:30, Fonyuy-Asheri Caleb wrote:
> Seems there's more to this than I think. Here's the entire information about my setup. 
> 
> Source Server: 
>    Processor: Intel(R) Xeon(R) Platinum 8358 CPU @ 2.60GHz
>    Xsave dependences(based on xen gen-cpuid.py): 
>                      'fma', 'avx', 'f16c', 'avx2', 'avx512f', 'avx512dq', 'avx512cd', 
>                       'avx512bw', 'avx512vl', 'xsaveopt', 'xsavec', 'xgetbv1', 'xsaves', 
>                       'pku', 'avx512_vbmi2', 'vaes', 'vpclmulqdq', 'avx512_vnni', 'avx512_bitalg', 
>                       'avx512_vpopcntdq'
> 
> 
> Target Server:
>    Processor: Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz
>    Xsave dependencies: 
>              'fma', 'avx', 'f16c', 'avx2', 'mpx', 'avx512f', 'avx512dq', 
>              'avx512cd', 'avx512bw', 'avx512vl', 'xsaveopt', 'xsavec', 'xgetbv1', 'xsaves', 'pku'
> 
> Operating System: Debian12 (on both source and target servers)
> Guest OS: Ubuntu 18.04 (PV)
> 
> Xen version: 4.18.3-pre (commit 01f7a3c792241d348a4e454a30afdf6c0d6cd71c)
> 
> 
> So I have the following which are available on my source server but not on the target server: 
> 'avx512_vbmi2', 'vaes', 'vpclmulqdq', 'avx512_vnni', 'avx512_bitalg', 'avx512_vpopcntdq'

None of these require extra state (i.e. registers), hence ...

> Per my current understanding, I would expect more xstates on the VM than supported on the target
> server and hence a failure with xstate verification when restoring CPU state. 

... no extra "xstates" (as you name it).

> However migrating a guest from Source to target works. 
> 
> Note that these extra avx512 features are all visible to the guest I migrate.

Ah yes. While that's a bug, it's a known one I think, awaiting further work
that Andrew has been meaning to do for quite some time, yet always getting
preempted by security stuff and other emergencies. For guests to migrate
safely, I think right now it is required that you limit features visible to
them on the source host.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 09:47:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 09:47:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772663.1183114 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGmg-0003xA-L1; Tue, 06 Aug 2024 09:47:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772663.1183114; Tue, 06 Aug 2024 09:47:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGmg-0003x3-Hs; Tue, 06 Aug 2024 09:47:14 +0000
Received: by outflank-mailman (input) for mailman id 772663;
 Tue, 06 Aug 2024 09:47:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=nfQe=PF=inria.fr=fonyuy-asheri.caleb@srs-se1.protection.inumbo.net>)
 id 1sbGmf-0003wx-Dw
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 09:47:13 +0000
Received: from mail2-relais-roc.national.inria.fr
 (mail2-relais-roc.national.inria.fr [192.134.164.83])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dab1fa26-53d8-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 11:47:12 +0200 (CEST)
Received: from zcs2-store8.inria.fr ([128.93.142.6])
 by mail2-relais-roc.national.inria.fr with ESMTP; 06 Aug 2024 11:47:12 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dab1fa26-53d8-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
  d=inria.fr; s=dc;
  h=date:from:to:cc:message-id:in-reply-to:references:
   subject:mime-version:content-transfer-encoding;
  bh=uOSTUW0wHH91foBefCbjh4fKrhLmcHTnW4FvTxJ5R4A=;
  b=ubKS+EaOQt+jkxyL8CjJ/bkczytPnddeI1wpxVBrLcrtimHZF4jWIgHs
   mw09vXiwuWXVJftOPh0rcysG4dhOQiAwmPyQTQ5KRMUiIstuYnG2keZDC
   wBzEf4HfOBMqQmnoe2vdBu3FPdYb34X+DNQMVvoqacGy2NrdDsrPaMNvv
   0=;
Authentication-Results: mail2-relais-roc.national.inria.fr; dkim=none (message not signed) header.i=none; spf=Pass smtp.mailfrom=fonyuy-asheri.caleb@inria.fr; spf=None smtp.helo=postmaster@zcs2-store8.inria.fr
Received-SPF: Pass (mail2-relais-roc.national.inria.fr: domain of
  fonyuy-asheri.caleb@inria.fr designates 128.93.142.6 as
  permitted sender) identity=mailfrom; client-ip=128.93.142.6;
  receiver=mail2-relais-roc.national.inria.fr;
  envelope-from="fonyuy-asheri.caleb@inria.fr";
  x-sender="fonyuy-asheri.caleb@inria.fr";
  x-conformance=spf_only; x-record-type="v=spf1";
  x-record-text="v=spf1 include:mailout.safebrands.com
  a:basic-mail.safebrands.com a:basic-mail01.safebrands.com
  a:basic-mail02.safebrands.com ip4:128.93.142.0/24
  ip4:192.134.164.0/24 ip4:128.93.162.160 ip4:89.107.174.7 mx
  ~all"
Received-SPF: None (mail2-relais-roc.national.inria.fr: no sender
  authenticity information available from domain of
  postmaster@zcs2-store8.inria.fr) identity=helo;
  client-ip=128.93.142.6;
  receiver=mail2-relais-roc.national.inria.fr;
  envelope-from="fonyuy-asheri.caleb@inria.fr";
  x-sender="postmaster@zcs2-store8.inria.fr";
  x-conformance=spf_only
X-IronPort-AV: E=Sophos;i="6.09,267,1716242400"; 
   d="scan'208";a="178242627"
X-MGA-submission: =?us-ascii?q?MDFuSmj7JEU5Woa2C/8y4gk1v8IThNGwkaSFBl?=
 =?us-ascii?q?OrcnrD1wNtKhT0DQ46mozohXnI4VLu3RCcdTRlyFPNQ1HXT9nqAjRt8g?=
 =?us-ascii?q?oEGDoGJVznurPoGF66fvsT3K99xk1TwzaMFmUD6fkAzbJQe0d6yJQF4d?=
 =?us-ascii?q?edwkGuIUP4rtf6HHjuTLsCuQ=3D=3D?=
Date: Tue, 6 Aug 2024 11:47:11 +0200 (CEST)
From: Fonyuy-Asheri Caleb <fonyuy-asheri.caleb@inria.fr>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, 
	Andrew Cooper <andrew.cooper3@citrix.com>
Message-ID: <1386943432.15998792.1722937631752.JavaMail.zimbra@inria.fr>
In-Reply-To: <01c81e66-a921-458c-bf9e-fe1bd9054936@suse.com>
References: <60751777.2038091.1720694327760.JavaMail.zimbra@inria.fr> <ece26efe-c1af-4fd2-910d-01a33beda5cc@citrix.com> <120712863.15929301.1722927890402.JavaMail.zimbra@inria.fr> <0f69e94a-5720-4f1f-b51d-b4fb2c6bbe0b@suse.com> <674914344.15937452.1722929654769.JavaMail.zimbra@inria.fr> <c4dac0ae-a8f4-4121-ad2e-f7cd61b6e3a8@suse.com> <349786242.15991470.1722936605909.JavaMail.zimbra@inria.fr> <01c81e66-a921-458c-bf9e-fe1bd9054936@suse.com>
Subject: Re: Help with Understanding vcpu xstate restore error during vm
 migration
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Originating-IP: [131.254.23.3]
X-Mailer: Zimbra 10.0.8_GA_4611 (ZimbraWebClient - GC127 (Linux)/10.0.8_GA_4611)
Thread-Topic: Help with Understanding vcpu xstate restore error during vm migration
Thread-Index: P/6vW+qQTpVqGWdsVMUUezzCcOoSng==

> 
> None of these require extra state (i.e. registers), hence ...
> 
>> Per my current understanding, I would expect more xstates on the VM than
>> supported on the target
>> server and hence a failure with xstate verification when restoring CPU state.
> 
> ... no extra "xstates" (as you name it).

I see. Makes more sense now. So if i understand correctly, not all these features
have states and hence are not all taken into account during xstate verification. 

> 
>> However migrating a guest from Source to target works.
>> 
>> Note that these extra avx512 features are all visible to the guest I migrate.
> 
> Ah yes. While that's a bug, it's a known one I think, awaiting further work
> that Andrew has been meaning to do for quite some time, yet always getting
> preempted by security stuff and other emergencies. For guests to migrate
> safely, I think right now it is required that you limit features visible to
> them on the source host.

Noted. Will take that into account when evaluating the impact of unnecessary 
features. 

> 
> Jan

Thanks again Jan

Caleb


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 09:49:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 09:49:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772671.1183124 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGp4-0004WY-1Z; Tue, 06 Aug 2024 09:49:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772671.1183124; Tue, 06 Aug 2024 09:49:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGp3-0004WR-U2; Tue, 06 Aug 2024 09:49:41 +0000
Received: by outflank-mailman (input) for mailman id 772671;
 Tue, 06 Aug 2024 09:49:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=HPS5=PF=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sbGp2-0004WL-8x
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 09:49:40 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 327d6f0d-53d9-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 11:49:39 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-52fc14d6689so316086e87.1
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 02:49:39 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530bba1129dsm1419786e87.118.2024.08.06.02.49.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 06 Aug 2024 02:49:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 327d6f0d-53d9-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722937779; x=1723542579; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=3kttPg0jTgLnySiSrZ7tLdlSbiwfr5TPh4B2ogxf3Oc=;
        b=d2G35J60EWJ/8UNma3uW39I3H2lYfCVM756l7jXxtcwUlkbth9IB5Qf1kO157kvgeF
         aCrUQays3Y1Us3bUvHOnbKard85uoZcvgG8Ghzlw2cdcon6faA4BhV5Rn9IqY2+JMfiR
         MeiLEKN4FEyIgoVBscRgtDLFj+/0Th7hdypQf58xGA+jmyng2aA4fjzOu9cx7j0d2Wix
         h55LZBnn2+baPiNLj0dPaojsvB0Sj5qelc1A5wxrxdp4JJ0CaqFBED/zdQarnp4S0UmC
         qPNJW7AWvbooCxG21IdGsIMCxNl4hpHSYPkoGBOHHKmdE2DTKwKb6srvkz4cofM1maPQ
         1dxA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722937779; x=1723542579;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=3kttPg0jTgLnySiSrZ7tLdlSbiwfr5TPh4B2ogxf3Oc=;
        b=qmqvP2iSx57KOfbyPrd39qTxJEWkvQGNsPOvdUj7sbNi9Z0mC+Ot43+GrrisFluJvg
         ClBWPbkYokVSuhR6K3kkdCxVXonGaQJaPziYLvqK6vKbSTgXyTas4G6Aefo6Z90fn6MR
         LsPrn9rwGLTiR046tv23RtSM6jjkQvmKLrc5mPKxoTU22qBmiAJQ76gNqRmq3Nc+az6H
         swsmxPqHmM4yD6hWoasLQUDTnYovyYWaO1lW4KY0s5TSf9Bi17g/tEKOrErp6dvBOsBU
         LABBCdBalH9Gp1uGp3sVA0R07HvKtNrim0cGMVz3bsxJo8qfHoMWRZz/OAaSX6alZDHO
         JKWA==
X-Forwarded-Encrypted: i=1; AJvYcCVk2rusYCejHu952cxhrlaBIzklzKWUKXINdHF8cd87N6X1Sj9AM+tiXkwTJ4Ji5bf1loJkHnLbMwunBDQsywCUvOhphaEtgzfCGDczY0A=
X-Gm-Message-State: AOJu0Yw8fVG3CerUHh7u+EejLIdvXgYqjwA+ET6TBPpsAjDTnuau104N
	HrK6hQkQLhm2dtCZDJAJ1T3m76LapvojaKPyVsSroDH0kAnem9be
X-Google-Smtp-Source: AGHT+IHdaJ2d+FehdSZ71SWMJj1TqpOUvVFfxlhnC0ETJdDFF58f31asuDsUmXcsjFepSQds/cZ+FQ==
X-Received: by 2002:a05:6512:10d0:b0:52c:842b:c276 with SMTP id 2adb3069b0e04-530bb3a2ee0mr10062699e87.53.1722937778258;
        Tue, 06 Aug 2024 02:49:38 -0700 (PDT)
Message-ID: <887c062b02e9eae9953759275d97c1fafd608d28.camel@gmail.com>
Subject: Re: [PATCH v3 4/9] xen/riscv: setup fixmap mapping
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org,
 Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
 <michal.orzel@amd.com>
Date: Tue, 06 Aug 2024 11:49:36 +0200
In-Reply-To: <917cc521-c0c4-49e8-bc40-948679398bc6@suse.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
	 <04576976b82b97442f645b83b3d62475d144af8e.1721834549.git.oleksii.kurochko@gmail.com>
	 <917cc521-c0c4-49e8-bc40-948679398bc6@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Mon, 2024-07-29 at 15:35 +0200, Jan Beulich wrote:
> > +=C2=A0=C2=A0=C2=A0 write_pte(pte, tmp);
> > +
> > +=C2=A0=C2=A0=C2=A0 sfence_vma();
> > +
> > +=C2=A0=C2=A0=C2=A0 printk("(XEN) fixmap is mapped\n");
>=20
> Why the (XEN) prefix? And perhaps why the printk() in the first
> place?
printk() is available after common code started to be buildable and can
be used here as we have already introduced early_puts() which uses
sbi_console_putchar(). So it doesn't matter if we use printk() or
early_printk() here the result will be the same the call of
sbi_console_putchar().

Am I missing something?

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 09:50:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 09:50:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772678.1183133 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGps-0005uH-8t; Tue, 06 Aug 2024 09:50:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772678.1183133; Tue, 06 Aug 2024 09:50:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGps-0005uA-6O; Tue, 06 Aug 2024 09:50:32 +0000
Received: by outflank-mailman (input) for mailman id 772678;
 Tue, 06 Aug 2024 09:50:30 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ctxO=PF=ti.com=a-singh21@srs-se1.protection.inumbo.net>)
 id 1sbGpq-00052v-9X
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 09:50:30 +0000
Received: from lelv0143.ext.ti.com (lelv0143.ext.ti.com [198.47.23.248])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4e400841-53d9-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 11:50:27 +0200 (CEST)
Received: from lelv0266.itg.ti.com ([10.180.67.225])
 by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 4769oH4u034387;
 Tue, 6 Aug 2024 04:50:17 -0500
Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22])
 by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 4769oHOI107799
 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL);
 Tue, 6 Aug 2024 04:50:17 -0500
Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE111.ent.ti.com
 (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 6
 Aug 2024 04:50:17 -0500
Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE111.ent.ti.com
 (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via
 Frontend Transport; Tue, 6 Aug 2024 04:50:17 -0500
Received: from localhost (nightbug.dhcp.ti.com [172.24.227.225])
 by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 4769oGuT001402;
 Tue, 6 Aug 2024 04:50:17 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4e400841-53d9-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com;
	s=ti-com-17Q1; t=1722937817;
	bh=KGxtvzWm4CKuEy1Yhe+/6m3wsihu1QMSnKc4+ubhIBc=;
	h=Date:From:To:CC:Subject:References:In-Reply-To;
	b=zBAb8anr5oSaL3DKMJ2yfXRsJu1BJ7f6ldOTgmUl/IKUs80ggaIPxkwgi7ek8+Ptb
	 FEuZkjsKe4EZOuw7qH1zgNvCRop/oCSGaShYEyxUfS+kBa+Ufp0gxLWDYvc5xX/WSn
	 uH9YHUnAJ20Ap+EDWxFMeaWIvSpEVlkSuSFM8qJ8=
Date: Tue, 6 Aug 2024 15:20:16 +0530
From: Amneesh Singh <a-singh21@ti.com>
To: Julien Grall <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>,
        Bertrand Marquis
	<bertrand.marquis@arm.com>,
        Michal Orzel <michal.orzel@amd.com>,
        Stefano
 Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH] drivers: char: omap-uart: add "clock-hz" option
Message-ID: <njlq7laeswww46izwpkzuvnvu3lcycv7kc6dt2urbrpimj6uej@tzjuwwhwwqmp>
References: <20240719113313.145587-1-a-singh21@ti.com>
 <b7ef34fe-f6eb-45e8-8f6a-0e2c4bd0175b@xen.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <b7ef34fe-f6eb-45e8-8f6a-0e2c4bd0175b@xen.org>
X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180

On 10:16-20240806, Julien Grall wrote:
> Hi,
> 
> On 19/07/2024 12:33, Amneesh Singh wrote:
> > Quite a few TI K3 devices do not have clock-frequency specified in their
> > respective UART nodes.
> 
> Can you outline why fixing the device-tree is not solution?
Because other frequencies, say 96MHz or 192 MHz are also valid inputs.
> 
> > However hard-coding the frequency is not a
>  > solution as the function clock input can differ between SoCs.
> 
> Can you provide some details how Linux is handling those SoCs?
Yes, like omap-uart under xen, the 8250_omap driver also parses the DT,
but unlike omap-uart, falls back to clk_get_rate() and if the value is
still zero, it defaults to 48MHz.
> 
> > So,
> > similar to com1/com2, let the user pass the frequency as a dtuart option
> > via the bootargs. If not specified it will fallback to the same DT
> > parsing as before. For example, dtuart=serial2:clock-hz=48000000 can be
> > a valid bootarg.
> 
> Regardless my questions, any change to the command line needs to be
> documented in docs/misc/xen-command-line.pandoc.
I am not sure if that will be necessary as the dtuart option already
says: "The options are device specific."
> 
> Cheers,
> 
> --
> Julien Grall
> 
> 
Regards
Amneesh


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 09:56:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 09:56:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772689.1183143 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGvl-0006n0-18; Tue, 06 Aug 2024 09:56:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772689.1183143; Tue, 06 Aug 2024 09:56:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGvk-0006mt-UR; Tue, 06 Aug 2024 09:56:36 +0000
Received: by outflank-mailman (input) for mailman id 772689;
 Tue, 06 Aug 2024 09:56:35 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sbGvj-0006mn-NW
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 09:56:35 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbGvi-0002gS-W4; Tue, 06 Aug 2024 09:56:34 +0000
Received: from [15.248.3.88] (helo=[10.24.67.24])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbGvi-0004OU-Pq; Tue, 06 Aug 2024 09:56:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=pCDUeCl7JSf1zMFDj8muVFgR+avZxKuB4ubtrhZtYYg=; b=nB6/oQe+PObh4izO54suJwmgea
	f4UsFvTJWqsncUL/8e7/KoexDq6rhUZJM0JnZRI4k/wTqr7Pe192Q7jYzxq0EWlD3KQz/QSvtJxar
	62Um51AoM8nkgPUYvLP5ALkZnNKBIrVY/+vr3Y5iDCcGlnUiq+PYkHKFp6nymHSPL4Pc=;
Message-ID: <8c12dc98-bc9f-49bf-bc18-ddae99fa7312@xen.org>
Date: Tue, 6 Aug 2024 10:56:33 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] drivers: char: omap-uart: add "clock-hz" option
Content-Language: en-GB
To: Amneesh Singh <a-singh21@ti.com>
Cc: xen-devel@lists.xenproject.org,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <20240719113313.145587-1-a-singh21@ti.com>
 <b7ef34fe-f6eb-45e8-8f6a-0e2c4bd0175b@xen.org>
 <njlq7laeswww46izwpkzuvnvu3lcycv7kc6dt2urbrpimj6uej@tzjuwwhwwqmp>
From: Julien Grall <julien@xen.org>
In-Reply-To: <njlq7laeswww46izwpkzuvnvu3lcycv7kc6dt2urbrpimj6uej@tzjuwwhwwqmp>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 06/08/2024 10:50, Amneesh Singh wrote:
> On 10:16-20240806, Julien Grall wrote:
>> Hi,
>>
>> On 19/07/2024 12:33, Amneesh Singh wrote:
>>> Quite a few TI K3 devices do not have clock-frequency specified in their
>>> respective UART nodes.
>>
>> Can you outline why fixing the device-tree is not solution?
> Because other frequencies, say 96MHz or 192 MHz are also valid inputs.

Are you saying this is configurable by the user? Or do you mean the 
firmware can configure it?

>>
>>> However hard-coding the frequency is not a
>>   > solution as the function clock input can differ between SoCs.
>>
>> Can you provide some details how Linux is handling those SoCs?
> Yes, like omap-uart under xen, the 8250_omap driver also parses the DT,
> but unlike omap-uart, falls back to clk_get_rate() and if the value is
> still zero, it defaults to 48MHz.

Thanks for the information. Then my next question is why Linux can get 
away with a default value and not Xen?

To give more context, I don't feel it is right to ask the user to 
specify the clock speed. Xen should have a sane default like Linux.

>>
>>> So,
>>> similar to com1/com2, let the user pass the frequency as a dtuart option
>>> via the bootargs. If not specified it will fallback to the same DT
>>> parsing as before. For example, dtuart=serial2:clock-hz=48000000 can be
>>> a valid bootarg.
>>
>> Regardless my questions, any change to the command line needs to be
>> documented in docs/misc/xen-command-line.pandoc.
> I am not sure if that will be necessary as the dtuart option already
> says: "The options are device specific."

Let me ask differently, if you don't document in 
xen-command-line.pandoc, then how do you expect the user to know that 
the option clockspeed exists and what is the expected value?

To me the right place is in xen-command-line.pandoc because it should 
describe all the options (including device specific ones).

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 09:59:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 09:59:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772711.1183154 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGyV-0007zI-Eh; Tue, 06 Aug 2024 09:59:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772711.1183154; Tue, 06 Aug 2024 09:59:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbGyV-0007zB-Ba; Tue, 06 Aug 2024 09:59:27 +0000
Received: by outflank-mailman (input) for mailman id 772711;
 Tue, 06 Aug 2024 09:59:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=kFQN=PF=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbGyU-0007z5-IW
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 09:59:26 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8fddd7d1-53da-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 11:59:25 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5b7b6a30454so752977a12.2
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 02:59:25 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b83b92b970sm5843527a12.72.2024.08.06.02.59.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 06 Aug 2024 02:59:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8fddd7d1-53da-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722938365; x=1723543165; 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=b73ahphvk6W4hm93AWPdJsQg7PL24daLavqkCv+jrRs=;
        b=Fwc/peZmRsJHQxoQU5tl0AAJjV893UBLvdlSHe6RwrFoJsN+11JgDMosHrILnwWPe7
         FpRKDAkeIypN5ONYwypParEZvqSoM+EgVlKJH5C60vwCOJz/Y0OjQE3+jxTvCckKxJ6H
         mgbx8I5wCDwMTi9kt8H2hzML6F+85Wd0EUKFRc7HsRrSHgVHCRqoE4IEUPjesTKJSVlo
         ACNjkQjDicmo6hTU0dIpuJL2bpz4Yid2lBwY5RqukptP0jg3laLmaTJn3ItdKWD0PZF8
         Up2VP6QKmDdW80tvQS/Keij2CjI2VHp6cze7kX5pROQOtlV4nvRHIapq/oL4MMAbHaVd
         iH/A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722938365; x=1723543165;
        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=b73ahphvk6W4hm93AWPdJsQg7PL24daLavqkCv+jrRs=;
        b=j9m3ncwzyocAwbviszafVwkFKMHCI3uUiWmtsMcbrEOlXU603yxOUO8+A07TvYrA6p
         /rc+VHsKIP06EOOPuMZ+Dcz45lpTnKxJEDRc0kZSTrBSlpPm+xdKuS/U9tg7zLG9Ow/d
         CKDB0u/CKVqnyl9uM31idKGsfxvxrqFb58n059nZTa6M/jBdPdLcG4lH4wKG21h9WzbN
         XQrBfQVNxgE8/ewNZmU5ceEc89BxnB9fbriSaav55EGCa74FxtwjhUu9+1y4tg0zV7KB
         MLEwbjJ9+eN5xRkJ0AO+o4DZ9Vr7DGcStOs6Q+Ul+IuQaa1XYR5ReHwae47khCTh5tk0
         CTCg==
X-Forwarded-Encrypted: i=1; AJvYcCUbSBjc4n8aWShDzquQLqKJfCci3zQ3iw5Cat5mZW/S6iGbGcPUvfjqIL2CzoTmgDFqUTMoxja48mpIfi/ls2vN3xsQ0cDCo1VIzQTOtto=
X-Gm-Message-State: AOJu0YzX8eoyfLbku3EyU+JBtb2JTjB8N+gnvFcrkuZS+5TIrszZzTBz
	VXBbDD6EMy/9KSv4sNeeVPfRkk4rHG0t/IW7ok7VFgwnJiupL/s0FXH+aRt/Qw==
X-Google-Smtp-Source: AGHT+IGqGk2bEy03qvOR1KNksiFVF95trO4mA1Cy2QXqA5C0m+LzqAF9HyIQKwx+fu6+m5Hnc8O1hQ==
X-Received: by 2002:aa7:c053:0:b0:5b1:433:579b with SMTP id 4fb4d7f45d1cf-5b7f57f63f3mr8910035a12.37.1722938364834;
        Tue, 06 Aug 2024 02:59:24 -0700 (PDT)
Message-ID: <6a945181-96e8-4816-a2a8-aac6fdd1dfbb@suse.com>
Date: Tue, 6 Aug 2024 11:59:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 4/9] xen/riscv: setup fixmap mapping
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
 <04576976b82b97442f645b83b3d62475d144af8e.1721834549.git.oleksii.kurochko@gmail.com>
 <917cc521-c0c4-49e8-bc40-948679398bc6@suse.com>
 <887c062b02e9eae9953759275d97c1fafd608d28.camel@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: <887c062b02e9eae9953759275d97c1fafd608d28.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 06.08.2024 11:49, oleksii.kurochko@gmail.com wrote:
> On Mon, 2024-07-29 at 15:35 +0200, Jan Beulich wrote:
>>> +    write_pte(pte, tmp);
>>> +
>>> +    sfence_vma();
>>> +
>>> +    printk("(XEN) fixmap is mapped\n");
>>
>> Why the (XEN) prefix? And perhaps why the printk() in the first
>> place?
> printk() is available after common code started to be buildable and can
> be used here as we have already introduced early_puts() which uses
> sbi_console_putchar(). So it doesn't matter if we use printk() or
> early_printk() here the result will be the same the call of
> sbi_console_putchar().
> 
> Am I missing something?

Apparently yes, as you answered neither of my questions. To put them
differently: What value does this log message have, outside of your
own development activities? What value does the explicit (XEN) have
when printk() prepends such a prefix already anyway?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 10:12:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 10:12:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772721.1183164 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHAg-0002rS-H0; Tue, 06 Aug 2024 10:12:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772721.1183164; Tue, 06 Aug 2024 10:12:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHAg-0002rL-E3; Tue, 06 Aug 2024 10:12:02 +0000
Received: by outflank-mailman (input) for mailman id 772721;
 Tue, 06 Aug 2024 10:12:01 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=HPS5=PF=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sbHAf-0002rF-9r
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 10:12:01 +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 510b71d8-53dc-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 12:11:59 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-52f00ad303aso854924e87.2
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 03:11:59 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9c6627esm535870466b.95.2024.08.06.03.11.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 06 Aug 2024 03:11:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 510b71d8-53dc-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722939118; x=1723543918; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=1XwduJp1zaq5JLdw8QoROqS1iDa5pAJHna5xKRYNEZo=;
        b=SgA9SLS/VO2i2FmoU4ofYE2XWUhDkB25fmj4bdqpylURU4WWSjtPbTMoILxENPnWxa
         RWffxYU4yK1NyoJ8TYuJE8sPDzx7jGo6etjTlTAWPVo0QGTCbIawXcb9XAGqw2aqUgwI
         vLpA541MgXsyZehBsayhWe1ptT30gYZlaD4OFyZ0yC1YI0v20UAyUa4uZF/xHoA4vy0b
         0vE4Rumo20im9l+POgODpYVf8DiAcGwR83/+jd6pOwHmhze5QHt1qR2HrzbeybKOWt3Y
         OFGei7r3jcQH8MHMTmHLiZHuD2jvCKwgIVEi6TRUQCDteXq3Ic+UCpj0ryTubtFKa/9+
         YqTw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722939118; x=1723543918;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=1XwduJp1zaq5JLdw8QoROqS1iDa5pAJHna5xKRYNEZo=;
        b=GHhGDooZUpyBiaGt5050OSVsQM3GSIXwAy5BBgqxDLBGdLbeta9xR2ZtERbt5CzkIa
         qb9g606b7WuuZ2MwLxwt/C6I0ZeyLYf1pReADNx7uorTCnrcTENwoONbur27FbrDljr2
         hq1J28+dA7kTvAFXWd0HUqbYqDM+DBZKID09ZPEfk2JCzBfVdzfOz63JZ9wIR9MoM/Ze
         soKwFG1TPd2t63mRCWOpFYpWm204cj6llBwztpWudU+qwuK+zqVouPkUAK3XTCpxlOf3
         dnYww67dC97rsi5U3d5dknaQoyuidR4tlv1pGczbzyvq2bTbGQGI0csxA6LIb/JMgd2X
         BnTA==
X-Forwarded-Encrypted: i=1; AJvYcCWA7GhRQ/kBDjv7Z4xPLyyZLJzjaxkTQoMPJSuCy8INlvqLg6fg1ZZfbtBFe9F0YG40pO0gp4DWfLZ4hk/fYldjLja+SGNRjewqdennN7s=
X-Gm-Message-State: AOJu0YxjhfvAxnt6B2VrM30NNA575oJDgaRS6M57YkkdVZo8ncgxqy9U
	4n3JgUiiMEBh3+JfTWk/C/EYBo6jEgN7ibDCzIQPwyWNP16HfJM/
X-Google-Smtp-Source: AGHT+IHRY+xNoJ0f8yJ6AZhRE8v+X6Y/g0y1pCMvfoSnd/zYE0xZix7n5Q/ZyUWPhy/spd6Ch33Xpg==
X-Received: by 2002:a05:6512:3d20:b0:530:9d86:6322 with SMTP id 2adb3069b0e04-530bb3ca42cmr10572274e87.41.1722939118036;
        Tue, 06 Aug 2024 03:11:58 -0700 (PDT)
Message-ID: <89d6b01ac85899c85f1dbfdaa907435e12de75c2.camel@gmail.com>
Subject: Re: [PATCH v12 1/3] xen/riscv: enable GENERIC_BUG_FRAME
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Tue, 06 Aug 2024 12:11:56 +0200
In-Reply-To: <0245feaa-6cf2-4f44-843f-38cdcc6b7a42@suse.com>
References: <cover.1722605952.git.oleksii.kurochko@gmail.com>
	 <3d507ce45606d22e9fa07dd6087870c16b5c4a4e.1722605952.git.oleksii.kurochko@gmail.com>
	 <0245feaa-6cf2-4f44-843f-38cdcc6b7a42@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Mon, 2024-08-05 at 17:41 +0200, Jan Beulich wrote:
> On 02.08.2024 15:54, Oleksii Kurochko wrote:
> > Enable GENERIC_BUG_FRAME to support BUG(), WARN(), ASSERT,
> > and run_in_exception_handler().
> >=20
> > The 0x0000 opcode is used for BUG_INSTR, which, when macros from
> > <xen/bug.h> are used, triggers an exception with the
> > ILLEGAL_INSTRUCTION cause.
> > This opcode is encoded as a 2-byte instruction and is invalid if
> > CONFIG_RISCV_ISA_C is enabled or not.
>=20
> Yes, but there's a caveat: Without the C extension instructions have
> to be aligned on 32-bit boundaries. You can't just go and insert a
> 16-bit item there. When RISCV_ISA_C is not set, I think you want to
> insert two such 16-bit zeroes. Beware of an alignment handling bug
> in the assembler - don't think of using an alignment directive here.
Then probably it will be better to define BUG_INSTR as:
 #define BUG_INSTR "UNIMP"
and let compiler to provide proper opcode.

Or define BUG_INSTRT always as 0x00000000 will be better?
>=20
>=20
> > --- a/xen/arch/riscv/include/asm/bug.h
> > +++ b/xen/arch/riscv/include/asm/bug.h
> > @@ -9,7 +9,11 @@
> > =C2=A0
> > =C2=A0#ifndef __ASSEMBLY__
> > =C2=A0
> > -#define BUG_INSTR "ebreak"
> > +#include <xen/stringify.h>
> > +
> > +#define BUG_OPCODE=C2=A0 0x0000
>=20
> You don't really use this other than ...
>=20
> > +#define BUG_INSTR ".hword " __stringify(BUG_OPCODE)
>=20
> ... here - does this really warrant a separate #define _and_
> inclusion of
> stringify.h?
>=20
> Furthermore you want to avoid using .hword (or any data generating
> directive), to avoid disturbing disassembly. Please use .insn if at
> all
> possible. I understand though that in certain cases you won't be able
> to
> use .insn. Yet for the common case (more recent binutils) you'd still
> better avoid .hword or alike, imo.
>=20
> > @@ -103,7 +104,29 @@ static void do_unexpected_trap(const struct
> > cpu_user_regs *regs)
> > =C2=A0
> > =C2=A0void do_trap(struct cpu_user_regs *cpu_regs)
> > =C2=A0{
> > -=C2=A0=C2=A0=C2=A0 do_unexpected_trap(cpu_regs);
> > +=C2=A0=C2=A0=C2=A0 register_t pc =3D cpu_regs->sepc;
> > +=C2=A0=C2=A0=C2=A0 unsigned long cause =3D csr_read(CSR_SCAUSE);
> > +
> > +=C2=A0=C2=A0=C2=A0 switch ( cause )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0 case CAUSE_ILLEGAL_INSTRUCTION:
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( do_bug_frame(cpu_regs,=
 pc) >=3D 0 )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if =
( !(is_kernel_text(pc) || is_kernel_inittext(pc)) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 printk("Something wrong with PC: %#lx\n", pc);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 die();
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cpu=
_regs->sepc +=3D GET_INSN_LENGTH(*(uint16_t *)pc);
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bre=
ak;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0 default:
>=20
> The falling-through here wants annotating, preferably with the
> pseudo-
> keyword.
What kind of pseudo-keyword? I though about /* goto default */ to
underline that CAUSE_ILLEGAL_INSTRUCTION should be close to "default:".

~ Oleksii
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 do_unexpected_trap(cpu_regs=
);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break;
> > +=C2=A0=C2=A0=C2=A0 }
> > =C2=A0}
>=20



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 10:15:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 10:15:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772729.1183174 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHDX-0003RH-TY; Tue, 06 Aug 2024 10:14:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772729.1183174; Tue, 06 Aug 2024 10:14:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHDX-0003RA-Qh; Tue, 06 Aug 2024 10:14:59 +0000
Received: by outflank-mailman (input) for mailman id 772729;
 Tue, 06 Aug 2024 10:14:58 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=HPS5=PF=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sbHDW-0003R4-R6
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 10:14:58 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bbb62401-53dc-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 12:14:58 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a7b2dbd81e3so63887666b.1
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 03:14:58 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9d437c6sm532820866b.129.2024.08.06.03.14.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 06 Aug 2024 03:14:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bbb62401-53dc-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722939297; x=1723544097; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=nZtmgBig573h2DSlpGLZvZ9aWWXikos4tIwVudaTY9I=;
        b=NxfF+gqSvJIWcvVhhK2ZgmNz/jN1umD6Whi9TOniVghtwB8rujwVd9DBl4d0O+r5RD
         lYQ60Cgf+WYNK7BpMvl7bTTi7Fx2AEVhfiyardwE+jljb7lr/qj8ghayAjVYyciLod4m
         Wdsh+FJGQEst2bC62BZi8qo/c0j5xCZGiNZS/sv0VBmstGcSRuEyzJGT+QhSlhGjxPiw
         exsLyun6Bj6+V8SCm9OaChq366UzGMacmnuGMj66flrmMwib6zV0iShaio3hfoUSZPU1
         f85XzHeNjiSH4MQnBwf+WLHiFJJ1ZPu4S4xCXF1X/c5PYAWTl/JNajNCr3Y/Cf30o+IK
         8Dvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722939297; x=1723544097;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=nZtmgBig573h2DSlpGLZvZ9aWWXikos4tIwVudaTY9I=;
        b=mroZXVbABgXW/AZBH3sgzpHPLw6LJUQXwy6NBT1hFCLvJTU0UBD13ZzvodDnP4US1Q
         NsgPCwJcDIftTm0/BpM2ij10m4s/a7TPcs7DOmUUJjffllj1uuSIfQXPf3Q2ZmJwFFDp
         6ETCds75d9Fxt5Y1HwNqlBkFCaDzb4np1pP/Okp6MTOCuqZOE6N+DRjgQd4PbZtW6fuq
         GsFALOgEiKPIwZPoCXfXAjYACIacIBaF80PTz6gs+hOdgXhC+RJY/3ZogQBWVAARrA0u
         mdyswjC9h5BYbyuw/CJrhT8L669aoqCUw/JrdfaShCA2Eapyey4RgejL1xGQry35fN1k
         XUog==
X-Forwarded-Encrypted: i=1; AJvYcCVKa3nnC3r9Bq7OspzlqKd2GLNClBgcVMDdwlUol5rp6+woIY3fJ7gM8SCMH0kKkqgFOo7FzKHkmyMIfSoCetvYc4N1JLRWe//UXQUwdEU=
X-Gm-Message-State: AOJu0Yx9RA3rC4KTdCfZ7eQSE/nsgQmP/lcIXzNeFEDy8tDR9zBTLcYY
	EQdf82VTbok2VLf8XRUXNFGoDuNNNbQFiQcAXA7pSxkCl1iLsyRb
X-Google-Smtp-Source: AGHT+IEPx8/rH86O8Pb8tRszfj3QBvywmJ/icjae4zgynPAomDgdK0fTYthafIervJASTW1tPxazVw==
X-Received: by 2002:a17:906:d554:b0:a72:6849:cb0f with SMTP id a640c23a62f3a-a7dc5100463mr976345266b.62.1722939297178;
        Tue, 06 Aug 2024 03:14:57 -0700 (PDT)
Message-ID: <95e26b56c36354bedc05c5b437d0ef70b0a52693.camel@gmail.com>
Subject: Re: [PATCH v3 4/9] xen/riscv: setup fixmap mapping
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org,
 Bertrand Marquis <bertrand.marquis@arm.com>, Michal Orzel
 <michal.orzel@amd.com>
Date: Tue, 06 Aug 2024 12:14:56 +0200
In-Reply-To: <6a945181-96e8-4816-a2a8-aac6fdd1dfbb@suse.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
	 <04576976b82b97442f645b83b3d62475d144af8e.1721834549.git.oleksii.kurochko@gmail.com>
	 <917cc521-c0c4-49e8-bc40-948679398bc6@suse.com>
	 <887c062b02e9eae9953759275d97c1fafd608d28.camel@gmail.com>
	 <6a945181-96e8-4816-a2a8-aac6fdd1dfbb@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Tue, 2024-08-06 at 11:59 +0200, Jan Beulich wrote:
> On 06.08.2024 11:49, oleksii.kurochko@gmail.com=C2=A0wrote:
> > On Mon, 2024-07-29 at 15:35 +0200, Jan Beulich wrote:
> > > > +=C2=A0=C2=A0=C2=A0 write_pte(pte, tmp);
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 sfence_vma();
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 printk("(XEN) fixmap is mapped\n");
> > >=20
> > > Why the (XEN) prefix? And perhaps why the printk() in the first
> > > place?
> > printk() is available after common code started to be buildable and
> > can
> > be used here as we have already introduced early_puts() which uses
> > sbi_console_putchar(). So it doesn't matter if we use printk() or
> > early_printk() here the result will be the same the call of
> > sbi_console_putchar().
> >=20
> > Am I missing something?
>=20
> Apparently yes, as you answered neither of my questions. To put them
> differently: What value does this log message have, outside of your
> own development activities?=C2=A0
Probably there is no any value. Just show that mapping of fixmap has
been finished. I think that we can really this printk.

> What value does the explicit (XEN) have
> when printk() prepends such a prefix already anyway?
I thought that I answered on this question before that there is no any
sense in the explicit "(XEN)".

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 10:24:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 10:24:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772738.1183184 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHN6-0005mK-PD; Tue, 06 Aug 2024 10:24:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772738.1183184; Tue, 06 Aug 2024 10:24:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHN6-0005mD-Lz; Tue, 06 Aug 2024 10:24:52 +0000
Received: by outflank-mailman (input) for mailman id 772738;
 Tue, 06 Aug 2024 10:24:50 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbHN4-0005m1-Ja; Tue, 06 Aug 2024 10:24:50 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbHN4-0003DC-Dp; Tue, 06 Aug 2024 10:24:50 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbHN3-0006Zd-WD; Tue, 06 Aug 2024 10:24:50 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbHN3-0003ln-Vp; Tue, 06 Aug 2024 10:24:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=YwshohOURnJkz3wWvbUmgaFygmNGr2TEzY8zhmd2blk=; b=lCXsKjScoVOYeLEen/dJX9aAQl
	14b25ikeLEVGqWu5B6J94EMR99fZE6Gsm0yaOlQfE14Kr5kEuIv4qysO2WNie35TAR+mhPbAsvLB9
	lcxnAgfIZij114qfwH8WKcEJpOTwf9ur3PDFuWG6mO2voDTWZqavz+sm1VWo4jxchuN8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187169-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187169: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=44a37c7832e49cdee103a0af392b7c12705bdc25
X-Osstest-Versions-That:
    xen=bec25f11d5180d407cf04d2de2525fa6f876bde1
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 06 Aug 2024 10:24:49 +0000

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

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  44a37c7832e49cdee103a0af392b7c12705bdc25
baseline version:
 xen                  bec25f11d5180d407cf04d2de2525fa6f876bde1

Last test of basis   187160  2024-08-05 17:03:57 Z    0 days
Testing same since   187169  2024-08-06 07:00:33 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Sergiy Kibrik <Sergiy_Kibrik@epam.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   bec25f11d5..44a37c7832  44a37c7832e49cdee103a0af392b7c12705bdc25 -> smoke


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 10:29:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 10:29:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772752.1183194 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHRm-0007Av-Dr; Tue, 06 Aug 2024 10:29:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772752.1183194; Tue, 06 Aug 2024 10:29:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHRm-0007Ao-BE; Tue, 06 Aug 2024 10:29:42 +0000
Received: by outflank-mailman (input) for mailman id 772752;
 Tue, 06 Aug 2024 10:29:41 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ByCl=PF=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbHRl-0007Ai-8i
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 10:29:41 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c85b3b27-53de-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 12:29:38 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5b3fff87e6bso611055a12.0
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 03:29:38 -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
 4fb4d7f45d1cf-5b839c25558sm5842319a12.32.2024.08.06.03.29.37
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 06 Aug 2024 03:29:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c85b3b27-53de-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722940178; x=1723544978; 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=ara8Ck//VhUeTFESs0zv2ocdoS7WiqC+ams8ldqOD8g=;
        b=TE3cvynrRytkVsd8cW7qC0ds0ytRsRwBxNzH0qkozes5CJ9KKCOsqcpXCVOm2PJ8Zg
         NsamPg8oF37TS2jab4K9Mr0YlbweumwTFr14nNVxikE7aoqvIS0Z234uEHigS8JySiBv
         W2CoIckoWjt0ec04kkhHqiSsfxrJsP0D8l48hBg9ckw2T9aUNaSqYNlLVmngDuO4+4fO
         yu1f9WEb02NhaU1eGuWWMkwcg1VFvUpoRAi7Y25rgMJvN8eGit44O+E4nDgpWY4ffC7L
         M7A8KEQ+zsWenpcc/E/ivfZclHVE+InlSdYb2PsvCQ0LiHTO9h5cYxlY29DOb68K0eoC
         p2ug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722940178; x=1723544978;
        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=ara8Ck//VhUeTFESs0zv2ocdoS7WiqC+ams8ldqOD8g=;
        b=MAZFgyZMhvh3UusaI/fFGfbj/Ik30P1vqu4QZo7VNjgWUEDdarTF0R/k1X1Z6fWtGn
         df6y8IAmjrOvf3q+sTUcJvpFyw88MWAgbdpr6mz6VjxPe3OuhmdGQnzujx8ulGL+qZs6
         66lMB50txkwKoX9op0x2QpE2Lpq5nOlwVrbXBK2NCzdBYifCH2kj+3ud2gU1r4IJsoM9
         dR0vhtsqHg6CRjb7L4svfhi8vqv/C7wfU/IOAdnB6KC3pAxrVvq6213TOYApMubK26UL
         9pag/FDSX9gBMwkTuZ8zwr3cNkh04nYOA3ypYWlglRi/CTdLud7+WbdQOrJigyfLstzR
         Cxtw==
X-Forwarded-Encrypted: i=1; AJvYcCWiYIkzjb8HbDREd2t2bB+mGnQL5mLLaqm5y2nEsjJ7emmJcY7V0AZmLqdAmu1FllCHkggnO+Jielbmyc1xk5V+iKYOgDt/TzvIRQJqTXk=
X-Gm-Message-State: AOJu0Yz2IX8HXe2BvUXmDsQPcdkNviiXv4FJHHM45Tbc8+5u7i/1gVwN
	1I5pTHmcIEqyt3i6BEghExZkILOnQZgIsR23xi73lNo+HEUc/hhmzes30BZSgU4=
X-Google-Smtp-Source: AGHT+IFZJqkh3XINVxZYEUmUFQWgau0QkX25NIfXXGejXjkLdZGBlvCb6/BB/wxJb40934O1mv18PA==
X-Received: by 2002:a50:fe99:0:b0:5a2:abcb:c4cf with SMTP id 4fb4d7f45d1cf-5b7f4294f19mr10731768a12.22.1722940177571;
        Tue, 06 Aug 2024 03:29:37 -0700 (PDT)
Message-ID: <dd233141-5beb-4681-874a-7cffcd3d9da2@suse.com>
Date: Tue, 6 Aug 2024 12:29:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] libxl/disk: avoid aliasing of abs()
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Jason Andryuk <jason.andryuk@amd.com>
References: <ad3b9873-b478-4448-8395-498399040324@suse.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <ad3b9873-b478-4448-8395-498399040324@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 06.08.24 10:40, Jan Beulich wrote:
> Tool chains with -Wshadow enabled by default won't like the function
> parameter name "abs", for aliasing stdlib.h's abs(). Rename the
> parameter to what other similar functions use.
> 
> Fixes: a18b50614d97 ("libxl: Enable stubdom cdrom changing")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 10:36:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 10:36:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772760.1183203 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHYC-0000JC-25; Tue, 06 Aug 2024 10:36:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772760.1183203; Tue, 06 Aug 2024 10:36:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHYB-0000J5-Vs; Tue, 06 Aug 2024 10:36:19 +0000
Received: by outflank-mailman (input) for mailman id 772760;
 Tue, 06 Aug 2024 10:36:18 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ctxO=PF=ti.com=a-singh21@srs-se1.protection.inumbo.net>)
 id 1sbHYA-0000IY-Hd
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 10:36:18 +0000
Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b44d7d12-53df-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 12:36:15 +0200 (CEST)
Received: from fllv0034.itg.ti.com ([10.64.40.246])
 by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 476Aa0mQ084900;
 Tue, 6 Aug 2024 05:36:00 -0500
Received: from DLEE109.ent.ti.com (dlee109.ent.ti.com [157.170.170.41])
 by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 476Aa0dS114092
 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL);
 Tue, 6 Aug 2024 05:36:00 -0500
Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE109.ent.ti.com
 (157.170.170.41) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 6
 Aug 2024 05:36:00 -0500
Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE114.ent.ti.com
 (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via
 Frontend Transport; Tue, 6 Aug 2024 05:36:00 -0500
Received: from localhost (nightbug.dhcp.ti.com [172.24.227.225])
 by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 476AZxUb073256;
 Tue, 6 Aug 2024 05:36:00 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b44d7d12-53df-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com;
	s=ti-com-17Q1; t=1722940561;
	bh=qcQiwfiYAyGU3CfBX04/XJcXkyEng2Hb+rFNMTIbWNw=;
	h=Date:From:To:CC:Subject:References:In-Reply-To;
	b=Vjo09Z9lNKoFcVbTfHr8vOaD97qZqSan41bkr5o+kEieNIBA2Xh1D30+SG1xWkUSs
	 wxk0QatgvZ7HekTNtsXraXMx8nHBq3RFBXSg81CVTGQf7QpiRYMg/kgboLtSLwLeyH
	 k5BEhzmKPLQN5O3XA1J0sIN0mO3R3N00egHNCNWk=
Date: Tue, 6 Aug 2024 16:05:59 +0530
From: Amneesh Singh <a-singh21@ti.com>
To: Julien Grall <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>,
        Bertrand Marquis
	<bertrand.marquis@arm.com>,
        Michal Orzel <michal.orzel@amd.com>,
        Stefano
 Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH] drivers: char: omap-uart: add "clock-hz" option
Message-ID: <csvohhbfi7ilqjzmozhb7u75jp7kfncpyj335hz5vksjw7lr46@57puayor4b4r>
References: <20240719113313.145587-1-a-singh21@ti.com>
 <b7ef34fe-f6eb-45e8-8f6a-0e2c4bd0175b@xen.org>
 <njlq7laeswww46izwpkzuvnvu3lcycv7kc6dt2urbrpimj6uej@tzjuwwhwwqmp>
 <8c12dc98-bc9f-49bf-bc18-ddae99fa7312@xen.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <8c12dc98-bc9f-49bf-bc18-ddae99fa7312@xen.org>
X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180

On 10:56-20240806, Julien Grall wrote:
> On 06/08/2024 10:50, Amneesh Singh wrote:
> > On 10:16-20240806, Julien Grall wrote:
> >> Hi,
> >>
> >> On 19/07/2024 12:33, Amneesh Singh wrote:
> >>> Quite a few TI K3 devices do not have clock-frequency specified in their
> >>> respective UART nodes.
> >>
> >> Can you outline why fixing the device-tree is not solution?
> > Because other frequencies, say 96MHz or 192 MHz are also valid inputs.
> 
> Are you saying this is configurable by the user? Or do you mean the
> firmware can configure it?
u-boot or some other bootloader are free to configure it. And usually,
linux's clock driver will pick it up using clk_get_rate (if not
specified in the DT), I think. Now, in case we add the frequency to the
DT, it may not match with the actual frequency configured before Xen
initialisation. Since, there is no equivalent to clk_get_rate under Xen,
and the fact I'm using imagebuilder, I found it easier to pass the
frequency the way I did.
Apologies if I come off as unclear. I recently joined as an intern and
am playing around with Xen.
> 
> >>
> >>> However hard-coding the frequency is not a
> >>   > solution as the function clock input can differ between SoCs.
> >>
> >> Can you provide some details how Linux is handling those SoCs?
> > Yes, like omap-uart under xen, the 8250_omap driver also parses the DT,
> > but unlike omap-uart, falls back to clk_get_rate() and if the value is
> > still zero, it defaults to 48MHz.
> 
> Thanks for the information. Then my next question is why Linux can get
> away with a default value and not Xen?
Sure why not? I guess, we can use a default value if everything fails
but there should still be a way for the user to specify the frequency.
Of course, we can instead just force the user to change the DT slightly
by just specifying the frequency. However, I feel it is easier to add it
here, especially when there's already a method to pass these options via
the command-line in place.
I believe, this is the best we can do with this.
> 
> To give more context, I don't feel it is right to ask the user to
> specify the clock speed. Xen should have a sane default like Linux.
> 
> >>
> >>> So,
> >>> similar to com1/com2, let the user pass the frequency as a dtuart option
> >>> via the bootargs. If not specified it will fallback to the same DT
> >>> parsing as before. For example, dtuart=serial2:clock-hz=48000000 can be
> >>> a valid bootarg.
> >>
> >> Regardless my questions, any change to the command line needs to be
> >> documented in docs/misc/xen-command-line.pandoc.
> > I am not sure if that will be necessary as the dtuart option already
> > says: "The options are device specific."
> 
> Let me ask differently, if you don't document in
> xen-command-line.pandoc, then how do you expect the user to know that
> the option clockspeed exists and what is the expected value?
> 
> To me the right place is in xen-command-line.pandoc because it should
> describe all the options (including device specific ones).
I have no qualms with adding device specific options, if that's not an
issue with everyone else :)
> 
> Cheers,
> 
> --
> Julien Grall
> 
> 
Thanks and regards
Amneesh


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 10:36:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 10:36:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772761.1183213 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHYF-0000Xi-9q; Tue, 06 Aug 2024 10:36:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772761.1183213; Tue, 06 Aug 2024 10:36:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHYF-0000XX-7B; Tue, 06 Aug 2024 10:36:23 +0000
Received: by outflank-mailman (input) for mailman id 772761;
 Tue, 06 Aug 2024 10:36:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=HPS5=PF=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sbHYE-0000EE-Eb
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 10:36:22 +0000
Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com
 [2a00:1450:4864:20::633])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b8e6961e-53df-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 12:36:21 +0200 (CEST)
Received: by mail-ej1-x633.google.com with SMTP id
 a640c23a62f3a-a7a8553db90so56561466b.2
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 03:36:21 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ec7311sm533015466b.195.2024.08.06.03.36.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 06 Aug 2024 03:36:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b8e6961e-53df-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722940581; x=1723545381; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=b65N4SwtDbsKX9JuFYOfFusoXPOaVsNL5Pih+isLvVk=;
        b=Q/SMrv6lnNtK8DRS9t/oXsFt22T0nTSOXQnA01l5cKKy7XGNPyQ8OZJpT16FoWtTwl
         a+YPjIbxtAmgacNdT2ojoMKAhxUSZYNxi6iGKfrTvRpboXxV1EGBy4sagZR/MnE78H8+
         BArHXWaWZMZ0Jy8i1ZWRf8TCwx1+su41Fo+6ZCkkZQC3tGPITB1c5fQMb59DeXqr3RDF
         QpFMr7vsXf5iigeZhTzloDOso4vewvpY3c6yBT3HAiAJkPOF5cfuN5YiONCkBh6Ssu9q
         40xMBUvL9CwBBvQpTpZqkE/lZcYDUzZdbQKs+SREnS1/W5Ga9wccuKry1XJQarAGAJe6
         jvMQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722940581; x=1723545381;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=b65N4SwtDbsKX9JuFYOfFusoXPOaVsNL5Pih+isLvVk=;
        b=PktYYexLL/kiabTP2lU1M40+6IlzYCqQWCKrNuA1viudQSJ8yEvgSzPgY9zvEPjzHd
         ReXwYgxMIQ52sOM4wEXWtn6+7udSbWoovzCY1jlr+cPVBXSXWFxXlL3OROgkoZEw3s00
         qrkDYZier6RjTSzUtXC5BKuEQE4gbZu+SsvdxWGZEIydHEWOau9lUjos3dSW8ftMjNbA
         WGtnhaGrKGe90nqxNsDlqTtWl/ULx+eH50RoPemRztCrEfkOZlaR9HFp4q4dn8234vdi
         i46rXOzNJOwsDr6rEHFd5HKiSTk5LGMSnJc/5sj6hq5QhVY5Hz7IPUXVKyqqRLkI7nAy
         ByiQ==
X-Forwarded-Encrypted: i=1; AJvYcCXpCcoEjUC6PqQMP7fZFZ1eE2Fxc0FBbsx9FAvZfQl435VoH+KxWQu2snyFcRIXNoY2zKfp6nM1seNg778tkLm/dDucXUqfcU/Rf62ldho=
X-Gm-Message-State: AOJu0YzQZGhEA7U+/diz5ibPo+3f+QPGB8jCkebGVywl3flSLJE2ukEZ
	ZIOf9uBF+UESbpIua2O7D1hR1qE/3E/B4PyVDv6a6PZBPk2PkrV5
X-Google-Smtp-Source: AGHT+IHhVUvRdvh6GIdZKWOUaEkS54ePKbyCOfxydERmzjE/cplIqu9dg+l3U3uE5+t+DPRbkl+t/g==
X-Received: by 2002:a17:907:c00f:b0:a7d:e956:ad51 with SMTP id a640c23a62f3a-a7de956af6dmr588806466b.21.1722940580875;
        Tue, 06 Aug 2024 03:36:20 -0700 (PDT)
Message-ID: <0bf58f6598a7a60b700a7526b3abb3f1e5ea6ecd.camel@gmail.com>
Subject: Re: [PATCH v8 1/2] xen/device-tree: Move Arm's setup.c bootinfo
 functions to common
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Shawn Anastasio <sanastasio@raptorengineering.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, Bertrand Marquis
 <bertrand.marquis@arm.com>,  Michal Orzel <michal.orzel@amd.com>, Volodymyr
 Babchuk <Volodymyr_Babchuk@epam.com>, "Daniel P. Smith"
 <dpsmith@apertussolutions.com>, Julien Grall <jgrall@amazon.com>, 
 xen-devel@lists.xenproject.org
Date: Tue, 06 Aug 2024 12:36:19 +0200
In-Reply-To: <0fdfb454-62a4-4d68-9eaa-a5ce7b82f0a2@suse.com>
References: <cover.1722856894.git.oleksii.kurochko@gmail.com>
	 <712aebb98a689b248f29e783eb8e72a5e7568e5b.1722856894.git.oleksii.kurochko@gmail.com>
	 <0fdfb454-62a4-4d68-9eaa-a5ce7b82f0a2@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Mon, 2024-08-05 at 13:58 +0200, Jan Beulich wrote:
> On 05.08.2024 13:33, Oleksii Kurochko wrote:
> > From: Shawn Anastasio <sanastasio@raptorengineering.com>
> >=20
> > Arm's setup.c contains a collection of functions for parsing memory
> > map
> > and other boot information from a device tree. Since these routines
> > are
> > generally useful on any architecture that supports device tree
> > booting,
> > move them into xen/common/device-tree.
> >=20
> > Also, common/device_tree.c has been moved to the device-tree folder
> > with
> > the corresponding updates to common/Makefile and common/device-
> > tree/Makefile.
> >=20
> > Mentioning of arm32 is changed to CONFIG_SEPARATE_XENHEAP in
> > comparison with
> > original ARM's code as now it is moved in common code.
> >=20
> > Suggested-by: Julien Grall <julien@xen.org>
> > Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > Acked-by: Julien Grall <jgrall@amazon.com>
> > ---
> > Changes in V8:
> > =C2=A0- add the version of Xen from which bootinfo.c was derived from.
> > =C2=A0- update the commit message.
> > =C2=A0- add Acked-by: Julien Grall <jgrall@amazon.com>.
> > ---
> > Changes in V7:
> > =C2=A0- move obj-$(CONFIG_HAS_DEVICE_TREE) +=3D device-tree/ to proper
> > place in common/Makefile.
> > =C2=A0- rename macros __XEN_BOOTFDT_H__ to XEN_BOOTFDT_H to not violate
> > MISRA rule 21.1.
> > =C2=A0- drop definition of "#define MAX_FDT_SIZE SZ_2M" in xen/bootfdt.=
h
> > as it is expected to
> > =C2=A0=C2=A0 be arch-specific. Back "#define MAX_FDT_SIZE SZ_2M" to
> > arm/setup.h where it was before
> > =C2=A0=C2=A0 these changes.
> > =C2=A0- git mv xen/common/device_tree.c xen/common/device-tree/ and
> > update correspondingly
> > =C2=A0=C2=A0 Makefiles of common/ and common/device-tree
> > =C2=A0- update the commit message
> > ---
> > Changes in V6:
> > =C2=A0- update the version of the patch to v6.=C2=A0=C2=A0=20
> > ---
> > Changes in V5:
> > =C2=A0- After rebase the Shawn's patch v4 on top of current staging the
> > following
> > =C2=A0=C2=A0 was done:
> > =C2=A0=C2=A0 - add xen/include/xen/bootfdt.h to MAINTAINERS file.
> > =C2=A0=C2=A0 - drop message "Early device tree parsing and".
> > =C2=A0=C2=A0 - After rebase on top of the current staging the following
> > changes were done:
> > =C2=A0=C2=A0=C2=A0=C2=A0 - init bootinfo variable in <common/device-tre=
e/bootinfo.c>
> > with BOOTINFO_INIT;
> > =C2=A0=C2=A0=C2=A0=C2=A0 - update the code of dt_unreserved_regions():
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CONFIG_STATIC_SHM rela=
ted changes and getting of
> > reserved_mem
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bootinfo_get_shmem()
> > =C2=A0=C2=A0=C2=A0=C2=A0 - update the code of meminfo_overlap_check():
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 add check ( INVALID_PA=
DDR =3D=3D bank_start ) to if case.
> > =C2=A0=C2=A0=C2=A0=C2=A0 - update the code of check_reserved_regions_ov=
erlap():
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CONFIG_STATIC_SHM rela=
ted changes.
> > =C2=A0=C2=A0=C2=A0=C2=A0 - struct bootinfo was updated ( CONFIG_STATIC_=
SHM changes )
> > =C2=A0=C2=A0=C2=A0=C2=A0 - add shared_meminfo ( because of CONFIG_STATI=
C_SHM )
> > =C2=A0=C2=A0=C2=A0=C2=A0 - struct struct membanks was update with __str=
uct group so
> > <xen/kernel> is
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 neeeded to be included in bootfdt.=
h
> > =C2=A0=C2=A0=C2=A0=C2=A0 - move BOOTINFO_ACPI_INIT, BOOTINFO_SHMEM_INIT=
, BOOTINFO_INIT
> > to generic bootfdt.h
> > =C2=A0=C2=A0=C2=A0=C2=A0 - bootinfo_get_reserved_mem(), bootinfo_get_me=
m(),
> > bootinfo_get_acpi(),
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bootinfo_get_shmem() and bootinfo_=
get_shmem_extra() were
> > moved to xen/bootfdt.h
> > =C2=A0=C2=A0 - s/arm32/CONFIG_SEPARATE_XENHEAP/
> > =C2=A0=C2=A0 - add inclusion of <xen/macros.h> because there are functi=
on in
> > <xen/bootfdt.h> which
> > =C2=A0=C2=A0=C2=A0=C2=A0 are using container_of().
> > =C2=A0---
> > Changes in v4:
> > =C2=A0 - create new xen/include/bootinfo.h rather than relying on arch'=
s
> > =C2=A0=C2=A0=C2=A0 asm/setup.h to provide required definitions for boot=
info.c
> > =C2=A0 - build bootinfo.c as .init.o
> > =C2=A0 - clean up and sort bootinfo.c's #includes
> > =C2=A0 - use CONFIG_SEPARATE_XENHEAP rather than CONFIG_ARM_32 to guard
> > =C2=A0=C2=A0=C2=A0 xenheap-specific behavior of populate_boot_allocator
> > =C2=A0 - (MAINTAINERS) include all of common/device-tree rather than
> > just
> > =C2=A0=C2=A0=C2=A0 bootinfo.c
> > ---
> > =C2=A0MAINTAINERS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0 2 +
> > =C2=A0xen/arch/arm/include/asm/setup.h=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 =
185 +--
> > =C2=A0xen/arch/arm/setup.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 432 -----
> > =C2=A0xen/common/Makefile=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=
=A0 2 +-
> > =C2=A0xen/common/device-tree/Makefile=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=
=C2=A0=C2=A0=C2=A0 2 +
> > =C2=A0xen/common/device-tree/bootinfo.c=C2=A0=C2=A0=C2=A0 |=C2=A0 459 +=
+++++
> > =C2=A0xen/common/device-tree/device_tree.c | 2253
> > ++++++++++++++++++++++++++
> > =C2=A0xen/common/device_tree.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 2253 ----------------------
> > ----
> > =C2=A0xen/include/xen/bootfdt.h=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 195 +++
> > =C2=A09 files changed, 2913 insertions(+), 2870 deletions(-)
> > =C2=A0create mode 100644 xen/common/device-tree/Makefile
> > =C2=A0create mode 100644 xen/common/device-tree/bootinfo.c
> > =C2=A0create mode 100644 xen/common/device-tree/device_tree.c
>=20
> Can the moved file please be in sync with its directory, naming (i.e.
> dash
> vs underscore) wise? I also expect the diff would be quite a bit
> smaller
> with git's rename detection properly enabled.
Sure, I will sent new patch series version soon. Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 10:36:51 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 10:36:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772777.1183223 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHYh-0001T0-HC; Tue, 06 Aug 2024 10:36:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772777.1183223; Tue, 06 Aug 2024 10:36:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHYh-0001St-EG; Tue, 06 Aug 2024 10:36:51 +0000
Received: by outflank-mailman (input) for mailman id 772777;
 Tue, 06 Aug 2024 10:36:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=HPS5=PF=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sbHYg-0000EE-3X
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 10:36:50 +0000
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com
 [2a00:1450:4864:20::62a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c980031b-53df-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 12:36:49 +0200 (CEST)
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a7d89bb07e7so50343766b.3
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 03:36:49 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9bc3cfesm538440966b.2.2024.08.06.03.36.48
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 06 Aug 2024 03:36:48 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c980031b-53df-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722940609; x=1723545409; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=RFtBrtEcDkT8CUfFVYSUAwjgVLP/XZHVGTf/vOi9tU4=;
        b=fHtb0MviEBLAgsI0KQVcdxxhywAiMRIyUERPTbnahen9sfd6iAqIV7H4mxI5GQOMf9
         peEdfggzut+panaldW/K8+Iv5Zo/0293juQQbt0gAvcq4dfgsPeGJVm/Nviiv3BY1hNU
         jV4HWXj1hXkzm2HUcv6bBYT+hQKmrLYLhfzdd0rfymWuJWHHKL4npUQ1uFB44fVle+TZ
         9d+IFmLBSal5w1uFR3nQmEGmCtjVTrXC0LJOi5ShHgJIOfMMTlZdg0LI8thdRp+FJCdd
         zbKNv5mOyB5FtNIUBITL8zHw76jCbq38oxQ4Zhbk45b3+XGEDbQbpX91aPYuJkBZnBIs
         C87g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722940609; x=1723545409;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=RFtBrtEcDkT8CUfFVYSUAwjgVLP/XZHVGTf/vOi9tU4=;
        b=cAMYb3988hsx1RFa47j4PW4Fs1QJvAiUicS+fWXRTv4SIgrxw/I8vp6xRObO06yL5L
         4+2MUjsEeJWfIuPYshcZuTMEA6p7ajjnS5tD/uK3ZYZMr6Z4Lzl0jlSfyXYlK58jqKic
         dI4k9zSQAlWhEQqRnTwWMkhLPmVapBiFI6KUxx066LJBD0QkLq7OMEuZlDr0NG8t7tVo
         v/UpTXUVTu9NRnPGnU8mVtw1KLUR91mfvCCXB3hQI4PPZfVckTHvmWXJB456God+3NY1
         p27Kq5w9P8JUru9vylf3VRAvcHZBdsU9om8LYAB0mERAx4Pa5SEgIhHs33WYr738KCxI
         F+rQ==
X-Forwarded-Encrypted: i=1; AJvYcCUYY2ix0+Fsu6fhiJnsDF02RKPDrOoQ5dhJ/1XixG6UuIRI4pIh1m91Hz8pqpBtWSQ9dchU+IJjf3p+mbFORVFKQhKF6W7+BqmVG1SRcj8=
X-Gm-Message-State: AOJu0YwkS5/Mrm1HYqtQ5W+0X6Fiiy5nqf4qlEIm6xqnjEHvzJ0tLWPL
	DOoLa3+nkN3tAIyMjxp6eUWssdfzg5hukxQxeTsI2gNEKgxAGQrY
X-Google-Smtp-Source: AGHT+IFAW/Kl8lG1/5m3thEc/a0rVPmSeemlvrs7mENtEc7wb4cFsw5agBZItQMSvGxkjYBCqf9X2g==
X-Received: by 2002:a17:906:bc21:b0:a7a:8da1:eb00 with SMTP id a640c23a62f3a-a7dc4da7644mr1057348766b.7.1722940608812;
        Tue, 06 Aug 2024 03:36:48 -0700 (PDT)
Message-ID: <d4378fbd76517b8745d3cfce9fabdf2176fc2bcd.camel@gmail.com>
Subject: Re: [PATCH v8 2/2] xen/common: Move Arm's bootfdt.c to common
From: oleksii.kurochko@gmail.com
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Shawn Anastasio <sanastasio@raptorengineering.com>, Stefano Stabellini
 <sstabellini@kernel.org>, Bertrand Marquis <bertrand.marquis@arm.com>, 
 Michal Orzel <michal.orzel@amd.com>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, "Daniel P. Smith"
 <dpsmith@apertussolutions.com>
Date: Tue, 06 Aug 2024 12:36:47 +0200
In-Reply-To: <c8aa0451-4a99-4496-a5eb-cb4cf6b49862@xen.org>
References: <cover.1722856894.git.oleksii.kurochko@gmail.com>
	 <85321f4a2fc7f1d892aa658603bffaae25249045.1722856894.git.oleksii.kurochko@gmail.com>
	 <c8aa0451-4a99-4496-a5eb-cb4cf6b49862@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

Hi Julien,

On Mon, 2024-08-05 at 20:01 +0100, Julien Grall wrote:
> Hi,
>=20
> On 05/08/2024 12:33, Oleksii Kurochko wrote:
> > From: Shawn Anastasio <sanastasio@raptorengineering.com>
> >=20
> > Move Arm's bootfdt.c to xen/common so that it can be used by other
> > device tree architectures like PPC and RISCV.
> >=20
> > Remove stubs for process_shm_node() and early_print_info_shmem()
> > from $xen/arch/arm/include/asm/static-shmem.h.
> > These stubs are removed to avoid introducing them for architectures
> > that do not support CONFIG_STATIC_SHM.
> > The process_shm_node() stub is now implemented in common code to
> > maintain the current behavior of early_scan_code() on ARM.
> > The early_print_info_shmem() stub is only used in
> > early_print_info(),
> > so it's now guarded with #ifdef CONFIG_STATIC_SHM ... #endif.
> >=20
> > Suggested-by: Julien Grall <julien@xen.org>
> > Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>=20
> Acked-by: Julien Grall <jgrall@amazon.com>
Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 10:43:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 10:43:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772790.1183234 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHf3-0003Wn-63; Tue, 06 Aug 2024 10:43:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772790.1183234; Tue, 06 Aug 2024 10:43:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHf3-0003Wg-32; Tue, 06 Aug 2024 10:43:25 +0000
Received: by outflank-mailman (input) for mailman id 772790;
 Tue, 06 Aug 2024 10:43:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbHf1-0003WW-Ok; Tue, 06 Aug 2024 10:43:23 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbHf1-0003XK-JX; Tue, 06 Aug 2024 10:43:23 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbHf1-0007bs-0n; Tue, 06 Aug 2024 10:43:23 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbHf0-00079U-Tx; Tue, 06 Aug 2024 10:43:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=XAEjuEW711DMPKCkZY7+IYXlC9ZtESFtEJAn2MWZfeU=; b=ibRLzTd4xIp+7SlHDTTYWyZdlI
	6AzrUQub91B9vD2UmJ9IcCn4xDfUzVmByBmAppknuWhYK/U1h2L3/8jWE3/neHBHe4nc4NF7GmR5J
	beqXWkWaV+hPxkwMte925pD3msKaTsAyxAhyEnXXO8fF+TAK6hxNH70SNXm7/n7JsZ5g=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187167-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187167: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=049846497b9e8a3eec82bfdcf3ebfe7c15e62c55
X-Osstest-Versions-That:
    libvirt=6b521fef8c672689b69443f26a11e267f13c225d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 06 Aug 2024 10:43:22 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 libvirt              049846497b9e8a3eec82bfdcf3ebfe7c15e62c55
baseline version:
 libvirt              6b521fef8c672689b69443f26a11e267f13c225d

Last test of basis   187130  2024-08-03 04:21:40 Z    3 days
Testing same since   187167  2024-08-06 04:20:38 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Adam Julis <ajulis@redhat.com>
  Göran Uddeborg <goeran@uddeborg.se>
  Jiri Denemark <jdenemar@redhat.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   6b521fef8c..049846497b  049846497b9e8a3eec82bfdcf3ebfe7c15e62c55 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 10:49:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 10:49:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772806.1183244 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHl0-0004x3-U5; Tue, 06 Aug 2024 10:49:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772806.1183244; Tue, 06 Aug 2024 10:49:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbHl0-0004ww-RS; Tue, 06 Aug 2024 10:49:34 +0000
Received: by outflank-mailman (input) for mailman id 772806;
 Tue, 06 Aug 2024 10:49:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ctxO=PF=ti.com=a-singh21@srs-se1.protection.inumbo.net>)
 id 1sbHl0-0004wq-D3
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 10:49:34 +0000
Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8f173aa3-53e1-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 12:49:32 +0200 (CEST)
Received: from lelv0266.itg.ti.com ([10.180.67.225])
 by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 476AnU1X087446;
 Tue, 6 Aug 2024 05:49:30 -0500
Received: from DLEE110.ent.ti.com (dlee110.ent.ti.com [157.170.170.21])
 by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 476AnUCx008656
 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL);
 Tue, 6 Aug 2024 05:49:30 -0500
Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE110.ent.ti.com
 (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 6
 Aug 2024 05:49:29 -0500
Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE112.ent.ti.com
 (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via
 Frontend Transport; Tue, 6 Aug 2024 05:49:29 -0500
Received: from localhost (nightbug.dhcp.ti.com [172.24.227.225])
 by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 476AnTP1090964;
 Tue, 6 Aug 2024 05:49:29 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8f173aa3-53e1-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com;
	s=ti-com-17Q1; t=1722941370;
	bh=V5BXEJxHyDGMyRqXr9lunBGw1q8uMv10uHLqYG6H71o=;
	h=From:To:CC:Subject:Date:In-Reply-To:References;
	b=OD27xh2jQ95+bxK1g3bssmfF/rqjUYgBzSBGuQO+FNlhWcB6apqxGLUwNiQpqaQtE
	 2mYxi8sgZ93aoZvv8E/9IIQoGtej+J5htiISdMfKsb6NsErJcnklrrY9FqwTSvWNSZ
	 Kfv2Bvo8ogT597czBP1G+lrjQdh/rp1ktSK8Ii1s=
From: Amneesh Singh <a-singh21@ti.com>
To: <a-singh21@ti.com>
CC: <xen-devel@lists.xenproject.org>, <anthony.perard@vates.tech>
Subject: Re: [PATCH] tools/helpers/init-dom0less: fix vcpu availability
Date: Tue, 6 Aug 2024 16:19:18 +0530
Message-ID: <20240806104918.706970-1-a-singh21@ti.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240802075823.116920-1-a-singh21@ti.com>
References: <20240802075823.116920-1-a-singh21@ti.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180

CCing the maintainer


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 11:08:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 11:08:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772815.1183254 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbI3L-0000R4-Eh; Tue, 06 Aug 2024 11:08:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772815.1183254; Tue, 06 Aug 2024 11:08:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbI3L-0000Qx-Bi; Tue, 06 Aug 2024 11:08:31 +0000
Received: by outflank-mailman (input) for mailman id 772815;
 Tue, 06 Aug 2024 11:08:29 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sbI3J-0000Qr-Oy
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 11:08:29 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbI3J-0003y5-3W; Tue, 06 Aug 2024 11:08:29 +0000
Received: from [15.248.3.88] (helo=[10.24.67.24])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbI3I-0000tR-T0; Tue, 06 Aug 2024 11:08:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=1bvXE5uRH/Dv/062MxORbx12HueYP6+rEdAcvS7ItMk=; b=bdqp/4Vk4tvRmrDtNmzFsDZuJl
	/jVdLAZAREEO5YCg94r1c7N7AcCZ3Ctqnlow68eL9D+shBtnLdYifNIcGo9aS5ggDpEr85eg27RbH
	bydljk1LhVE5tiuY3bkzDyBpFeaBdWuzXYgXlWnvkmpAAw+9y/hrssgjOvEYhKWmAt0s=;
Message-ID: <ff6a7077-efbb-4002-9426-a9f05760f8f8@xen.org>
Date: Tue, 6 Aug 2024 12:08:27 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] drivers: char: omap-uart: add "clock-hz" option
Content-Language: en-GB
To: Amneesh Singh <a-singh21@ti.com>
Cc: xen-devel@lists.xenproject.org,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <20240719113313.145587-1-a-singh21@ti.com>
 <b7ef34fe-f6eb-45e8-8f6a-0e2c4bd0175b@xen.org>
 <njlq7laeswww46izwpkzuvnvu3lcycv7kc6dt2urbrpimj6uej@tzjuwwhwwqmp>
 <8c12dc98-bc9f-49bf-bc18-ddae99fa7312@xen.org>
 <csvohhbfi7ilqjzmozhb7u75jp7kfncpyj335hz5vksjw7lr46@57puayor4b4r>
From: Julien Grall <julien@xen.org>
In-Reply-To: <csvohhbfi7ilqjzmozhb7u75jp7kfncpyj335hz5vksjw7lr46@57puayor4b4r>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 06/08/2024 11:35, Amneesh Singh wrote:
> On 10:56-20240806, Julien Grall wrote:
>> On 06/08/2024 10:50, Amneesh Singh wrote:
>>> On 10:16-20240806, Julien Grall wrote:
>>>> Hi,
>>>>
>>>> On 19/07/2024 12:33, Amneesh Singh wrote:
>>>>> Quite a few TI K3 devices do not have clock-frequency specified in their
>>>>> respective UART nodes.
>>>>
>>>> Can you outline why fixing the device-tree is not solution?
>>> Because other frequencies, say 96MHz or 192 MHz are also valid inputs.
>>
>> Are you saying this is configurable by the user? Or do you mean the
>> firmware can configure it?
> u-boot or some other bootloader are free to configure it. And usually,
> linux's clock driver will pick it up using clk_get_rate (if not
> specified in the DT), I think. Now, in case we add the frequency to the
> DT, it may not match with the actual frequency configured before Xen
> initialisation. Since, there is no equivalent to clk_get_rate under Xen,
> and the fact I'm using imagebuilder, I found it easier to pass the
> frequency the way I did.

Thanks for the explanation. I haven't looked in details, but how 
difficult would it be to implement clk_get_rate() (at least just enough 
to work for the UART) in Xen?

>>>>
>>>>> However hard-coding the frequency is not a
>>>>    > solution as the function clock input can differ between SoCs.
>>>>
>>>> Can you provide some details how Linux is handling those SoCs?
>>> Yes, like omap-uart under xen, the 8250_omap driver also parses the DT,
>>> but unlike omap-uart, falls back to clk_get_rate() and if the value is
>>> still zero, it defaults to 48MHz.
>>
>> Thanks for the information. Then my next question is why Linux can get
>> away with a default value and not Xen?
> Sure why not? I guess, we can use a default value if everything fails
> but there should still be a way for the user to specify the frequency.

I think I am still missing something. Why would Xen allow the user to 
specify the clock speed if Linux doesn't? At least to me, it is more 
likely that a user would want to boot Linux on your HW than Xen...

> Of course, we can instead just force the user to change the DT slightly
> by just specifying the frequency. However, I feel it is easier to add it
> here, especially when there's already a method to pass these options via
> the command-line in place.
 > I believe, this is the best we can do with this.

The problem is the command line is OS/hypervisor specific. But the 
problem you describe doesn't seem Xen specific. This is where the DT is 
handy because you describe once and it can be used everywhere.

Overall, at the moment, I don't think the command line option is the 
right approach. If I am not mistaken, it would make Xen less 
user-friendly (compare to Linux) to boot on your HW as the user would 
need to specify the clockspeed on the command line. I think we should 
investigate other approaches such as implementing partially 
clk_get_rate() (if this is how Linux manage to retrieve the clock speed 
without any command line option).

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 11:41:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 11:41:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772827.1183274 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbIZB-0006hx-2H; Tue, 06 Aug 2024 11:41:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772827.1183274; Tue, 06 Aug 2024 11:41:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbIZA-0006hq-Vh; Tue, 06 Aug 2024 11:41:24 +0000
Received: by outflank-mailman (input) for mailman id 772827;
 Tue, 06 Aug 2024 11:41:23 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=HPS5=PF=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sbIZ9-0006hC-2X
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 11:41:23 +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 cc647c82-53e8-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 13:41:19 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-52fcc56c882so3887358e87.0
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 04:41:19 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530bba07891sm1466093e87.22.2024.08.06.04.41.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 06 Aug 2024 04:41:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cc647c82-53e8-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722944479; x=1723549279; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=vG5ncRvairjCkr+MpN3fScaqyU5Vca5xbMf9rFGyo/E=;
        b=RDaCIuR6YgiHcFVzLhqf1M/lsvRnPRT7GRD0wurekTkZaGFnRkII+7/+ELHJXREBkk
         dTtriFXRFpbVqobsR400oc5KF6Zjg6e+gKazgzmUyOyZHunxZ1d4vWr0N/IxnL1VP99p
         y84Hq3fqVtoUJgjYGKIu0uhtBGvPaWevjTyXxXr0E8oU+2G7Zd/a+885uf0bp7mNPpvQ
         K8qU/lqTJhbsVv1KrOWuBIa4Bf0ekrfqB5n2/Ako376nu4AvU6l2Nj0PnqGDjInEjpwi
         KZBxdxG/8+tJDnCedzhMYlWfltvmuGfzCHbLsx1sfsTamhx3h8QF5LlDektkkNW/4iEl
         bdoA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722944479; x=1723549279;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=vG5ncRvairjCkr+MpN3fScaqyU5Vca5xbMf9rFGyo/E=;
        b=Jy5JeWR1GjkYsLhNPuYqaTlzzRkY6CuVvTXVqekFc3/xi/hNPGLWNadGBJVRRniX2H
         K9P8DfjBJTU+WSxLYLHuSEZhsddj/nIyRJtHPtE1Pp27ndZDemccTIKCXEW5z+ZH7zV7
         EtddAy2iXZt3d+ewjOD0SExX/YoOAK3qd+9vl+v0LqoCmx1NitKw4hlTBNQcjYLKyug+
         qFV7fPBC8GKh+ShWTZzBB5ATwirk2QYCX3HSlenVcWTA4TACzNdkxNP/5f0nTM2aUz49
         dBaif1jCgDV4i3nOm9VBgmrZNPGzE5wQwi4ZxnD4BdLYOghphtwaErUS1QIMTEMvsSzB
         Ym/A==
X-Gm-Message-State: AOJu0YwYL4S4rdh8fn3iOqolPG+3+NARqTljPvt8hSP37Srj4tYgOzJg
	hLiDBKZQV0TZE5jkAgv1R/ac9oVFxlRw6nIQhvFYc1Vx8VZZc5WukfJ44g==
X-Google-Smtp-Source: AGHT+IEB7EuJa6UojpkoU5DZ+m4t37Ub0hQd0f/BxUhDU5i8Bgfw7ccYoRWRlEQLyx8Sa1w6/Vhx0w==
X-Received: by 2002:a05:6512:3b06:b0:52c:ad70:6feb with SMTP id 2adb3069b0e04-530bb2e8691mr4009661e87.20.1722944478939;
        Tue, 06 Aug 2024 04:41:18 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Shawn Anastasio <sanastasio@raptorengineering.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v2 2/2] xen/common: Move Arm's bootfdt.c to common
Date: Tue,  6 Aug 2024 13:41:14 +0200
Message-ID: <c98165b4e168d74e8bca91ba7c111e6faaa309a4.1722941799.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1722941799.git.oleksii.kurochko@gmail.com>
References: <cover.1722941799.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Shawn Anastasio <sanastasio@raptorengineering.com>

Move Arm's bootfdt.c to xen/common so that it can be used by other
device tree architectures like PPC and RISCV.

Remove stubs for process_shm_node() and early_print_info_shmem()
from $xen/arch/arm/include/asm/static-shmem.h.
These stubs are removed to avoid introducing them for architectures
that do not support CONFIG_STATIC_SHM.
The process_shm_node() stub is now implemented in common code to
maintain the current behavior of early_scan_code() on ARM.
The early_print_info_shmem() stub is only used in early_print_info(),
so it's now guarded with #ifdef CONFIG_STATIC_SHM ... #endif.

Suggested-by: Julien Grall <julien@xen.org>
Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Julien Grall <jgrall@amazon.com>
---
Changes in V9:
 - add Acked-by: Julien Grall <jgrall@amazon.com>
---
Changes in V8:
 - Fix the change log for this patch ( accidentally the change log of the previous
   patch was copied to this ).
 - Drop the stub of process_shm_node() and early_print_info_shmem() in
   xen/arch/arm/include/asm/static-shmem.h as it is moved to common code to not
   re-introduce the same stub for each architecture which doesn't support
   CONFIG_STATIC_SHM now.
 - Drop Acked-by: Julien Grall <julien@xen.org> as after the Ack additional changes were
   done so an additional review is needed.
---
Changes in V7:
 - Nothing changed. Only rebase.
---
Changes in V6:
 - update the version of the patch to v6.
---
Changes in v5:
 - After rebase the Shawn's patch v4 on top of current staging the following
   was done:
   - add guard #ifdef CONFIG_STATIC_SHM around inclusion of <asm/static-shmem.h>
     in common/device-tree/bootfdt.c.
   - add stub for process_shm_node() in case CONFIG_STATIC_SHM isn't enabled.
   - add guard around #ifdef CONFIG_STATIC_SHM aroud early_print_info_shmem() in
     early_print_info().
---
Changes in v4:
  - move function prototypes to patch 2's xen/include/bootfdt.h
  - clean up #includes
---
 xen/arch/arm/Makefile                         |  1 -
 xen/arch/arm/include/asm/setup.h              | 13 ----------
 xen/arch/arm/include/asm/static-shmem.h       |  9 -------
 xen/common/device-tree/Makefile               |  1 +
 .../arm => common/device-tree}/bootfdt.c      | 24 +++++++++++++++----
 xen/include/xen/bootfdt.h                     | 14 +++++++++++
 6 files changed, 34 insertions(+), 28 deletions(-)
 rename xen/{arch/arm => common/device-tree}/bootfdt.c (98%)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 45dc29ea53..da9c979dc4 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -10,7 +10,6 @@ obj-$(CONFIG_TEE) += tee/
 obj-$(CONFIG_HAS_VPCI) += vpci.o
 
 obj-$(CONFIG_HAS_ALTERNATIVE) += alternative.o
-obj-y += bootfdt.init.o
 obj-y += cpuerrata.o
 obj-y += cpufeature.o
 obj-y += decode.o
diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index 1748be29e5..64c227d171 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -41,19 +41,6 @@ void fw_unreserved_regions(paddr_t s, paddr_t e,
                            void (*cb)(paddr_t ps, paddr_t pe),
                            unsigned int first);
 
-bool check_reserved_regions_overlap(paddr_t region_start, paddr_t region_size);
-
-struct bootmodule *add_boot_module(bootmodule_kind kind,
-                                   paddr_t start, paddr_t size, bool domU);
-struct bootmodule *boot_module_find_by_kind(bootmodule_kind kind);
-struct bootmodule * boot_module_find_by_addr_and_kind(bootmodule_kind kind,
-                                                             paddr_t start);
-void add_boot_cmdline(const char *name, const char *cmdline,
-                      bootmodule_kind kind, paddr_t start, bool domU);
-struct bootcmdline *boot_cmdline_find_by_kind(bootmodule_kind kind);
-struct bootcmdline * boot_cmdline_find_by_name(const char *name);
-const char *boot_module_kind_as_string(bootmodule_kind kind);
-
 void init_pdx(void);
 void setup_mm(void);
 
diff --git a/xen/arch/arm/include/asm/static-shmem.h b/xen/arch/arm/include/asm/static-shmem.h
index 806ee41cfc..fd0867c4f2 100644
--- a/xen/arch/arm/include/asm/static-shmem.h
+++ b/xen/arch/arm/include/asm/static-shmem.h
@@ -80,15 +80,6 @@ static inline int process_shm_chosen(struct domain *d,
     return 0;
 }
 
-static inline int process_shm_node(const void *fdt, int node,
-                                   uint32_t address_cells, uint32_t size_cells)
-{
-    printk("CONFIG_STATIC_SHM must be enabled for parsing static shared memory nodes\n");
-    return -EINVAL;
-}
-
-static inline void early_print_info_shmem(void) {};
-
 static inline void init_sharedmem_pages(void) {};
 
 static inline int remove_shm_from_rangeset(const struct kernel_info *kinfo,
diff --git a/xen/common/device-tree/Makefile b/xen/common/device-tree/Makefile
index f813f7555f..990abd571a 100644
--- a/xen/common/device-tree/Makefile
+++ b/xen/common/device-tree/Makefile
@@ -1,2 +1,3 @@
+obj-y += bootfdt.init.o
 obj-y += bootinfo.init.o
 obj-y += device-tree.o
diff --git a/xen/arch/arm/bootfdt.c b/xen/common/device-tree/bootfdt.c
similarity index 98%
rename from xen/arch/arm/bootfdt.c
rename to xen/common/device-tree/bootfdt.c
index 6e060111d9..f7998979c1 100644
--- a/xen/arch/arm/bootfdt.c
+++ b/xen/common/device-tree/bootfdt.c
@@ -4,18 +4,20 @@
  *
  * Copyright (C) 2012-2014 Citrix Systems, Inc.
  */
-#include <xen/types.h>
-#include <xen/lib.h>
-#include <xen/kernel.h>
-#include <xen/init.h>
-#include <xen/efi.h>
+
+#include <xen/bootfdt.h>
 #include <xen/device_tree.h>
+#include <xen/efi.h>
+#include <xen/init.h>
+#include <xen/kernel.h>
 #include <xen/lib.h>
 #include <xen/libfdt/libfdt-xen.h>
 #include <xen/sort.h>
 #include <xsm/xsm.h>
 #include <asm/setup.h>
+#ifdef CONFIG_STATIC_SHM
 #include <asm/static-shmem.h>
+#endif
 
 static void __init __maybe_unused build_assertions(void)
 {
@@ -436,6 +438,16 @@ static int __init process_domain_node(const void *fdt, int node,
                                    MEMBANK_STATIC_DOMAIN);
 }
 
+#ifndef CONFIG_STATIC_SHM
+static inline int process_shm_node(const void *fdt, int node,
+                                   uint32_t address_cells, uint32_t size_cells)
+{
+    printk("CONFIG_STATIC_SHM must be enabled for parsing static shared"
+            " memory nodes\n");
+    return -EINVAL;
+}
+#endif
+
 static int __init early_scan_node(const void *fdt,
                                   int node, const char *name, int depth,
                                   u32 address_cells, u32 size_cells,
@@ -495,7 +507,9 @@ static void __init early_print_info(void)
                mem_resv->bank[i].start,
                mem_resv->bank[i].start + mem_resv->bank[i].size - 1);
     }
+#ifdef CONFIG_STATIC_SHM
     early_print_info_shmem();
+#endif
     printk("\n");
     for ( i = 0 ; i < cmds->nr_mods; i++ )
         printk("CMDLINE[%"PRIpaddr"]:%s %s\n", cmds->cmdline[i].start,
diff --git a/xen/include/xen/bootfdt.h b/xen/include/xen/bootfdt.h
index c39428d5f5..16fa05f38f 100644
--- a/xen/include/xen/bootfdt.h
+++ b/xen/include/xen/bootfdt.h
@@ -157,6 +157,20 @@ struct bootinfo {
 
 extern struct bootinfo bootinfo;
 
+bool check_reserved_regions_overlap(paddr_t region_start,
+                                    paddr_t region_size);
+
+struct bootmodule *add_boot_module(bootmodule_kind kind,
+                                   paddr_t start, paddr_t size, bool domU);
+struct bootmodule *boot_module_find_by_kind(bootmodule_kind kind);
+struct bootmodule * boot_module_find_by_addr_and_kind(bootmodule_kind kind,
+                                                             paddr_t start);
+void add_boot_cmdline(const char *name, const char *cmdline,
+                      bootmodule_kind kind, paddr_t start, bool domU);
+struct bootcmdline *boot_cmdline_find_by_kind(bootmodule_kind kind);
+struct bootcmdline * boot_cmdline_find_by_name(const char *name);
+const char *boot_module_kind_as_string(bootmodule_kind kind);
+
 void populate_boot_allocator(void);
 
 size_t boot_fdt_info(const void *fdt, paddr_t paddr);
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 11:41:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 11:41:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772826.1183264 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbIZ6-0006TC-SE; Tue, 06 Aug 2024 11:41:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772826.1183264; Tue, 06 Aug 2024 11:41:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbIZ6-0006T5-Oa; Tue, 06 Aug 2024 11:41:20 +0000
Received: by outflank-mailman (input) for mailman id 772826;
 Tue, 06 Aug 2024 11:41:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=HPS5=PF=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sbIZ5-0006Sz-Cc
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 11:41:19 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cb89295f-53e8-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 13:41:18 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-52f01ec08d6so612320e87.2
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 04:41:18 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530bba07891sm1466093e87.22.2024.08.06.04.41.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 06 Aug 2024 04:41:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cb89295f-53e8-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722944477; x=1723549277; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=q5upltfC9xlBQsVci2xz+gISSqYTLts91WnziLkDiE0=;
        b=hxgjNWA9tKSSQZy2Hd9ivWVtqTii3qL23zOgeFnDXN3w2ZNiyPiuKjt2XoJHzQ4irh
         ZyKgU3bJl+8MDF9zC3n4InpyL9yMv7BnDO+u48PDZvXMyPSJKnEWSUYeP7LD2TQ2pzqF
         cd9+jfTUiMfwV7IR96Oi7SdIO23CFE/4KlIxFihTAwDOU0hJVfZYO2wMpsZESWHM6+sQ
         S1UBt4fynHmaslqKjav0tVrTUbeHwW+1/qPxtpiX2PhgdwbDDKhWhi0Os85So9RBu7Cr
         wptkhQpB02QnzIZiXzcb5HZZojdJVEcazRAw6esm0GFd13sgj841ts44S1Xz7uF0uxTm
         XsDQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722944477; x=1723549277;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=q5upltfC9xlBQsVci2xz+gISSqYTLts91WnziLkDiE0=;
        b=Z7qHvihjkZNtkurt22sH3lSDCELRpKkO0lbP6XV+9qhBZdh5jXkj438EnMr2X0nZiV
         YCWoHyB/Q2OZt/ByOlZtloaNQ002tkdWOfVI7hVeswVMgukSUo5RSSzvVzMLGoZY6KLg
         LWNUsCGzmSMlnh4MxBg5Yt7iNcTeOWEgWIsEHnDnDG9NjIamFoAths1sWeXk4/nl6QG1
         q7k40aCi0QmdKIyMe5Y2cwxspmSU0NuzMYGVdDQINMf1SeQ3uxVeXOIXiFj8mJZU0bdK
         n+aBCzIiOYeGH7C/NJDpWzHkVezXIsOuNJqW/obmo8x1jisnkTd6kLQNt6xSNI+LmaOw
         vFdw==
X-Gm-Message-State: AOJu0Yz4VFJdEh5fUd+ljp6ofrcFkK4MJIjDXEG7QQ4yssNMBS6JO04H
	+H9qL+Pi1zaz1zuMoGxokvWUD/PG+sKgBQWh5VEnHQbSmSsk0ejrjDD3/g==
X-Google-Smtp-Source: AGHT+IF34GC2zjw3ILcydfrdcGbCtCq8kocU7Q66JTBHp7tgOAPJsD0Sc17utXxnKcdm3NHCC5ohrw==
X-Received: by 2002:a05:6512:3d04:b0:52e:9b15:1c60 with SMTP id 2adb3069b0e04-530bb3a5035mr11155570e87.48.1722944477156;
        Tue, 06 Aug 2024 04:41:17 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>
Subject: [PATCH v2 0/2] Common device tree stuff
Date: Tue,  6 Aug 2024 13:41:12 +0200
Message-ID: <cover.1722941799.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The current patch series introduces the common device tree functions
between several architectures: Arm, PPC, RISC-V.

Originally these patches were a part of Shawn's patch series [1].
At that moment it was v4 version of this patches.

After RISC-V started to need this changes these patches have been
rebased on top of the current staging with addional updates after
rebase.
For some time, these patches from v5 to v7 version were the part of
the patch series [2] but not to block almost ready patches for merging
it was decided to move them to separate patch series.

CI tests results:
 https://gitlab.com/xen-project/people/olkur/xen/-/pipelines/1402476423

[1]
https://lore.kernel.org/xen-devel/cover.1712893887.git.sanastasio@raptorengineering.com/

[2]
https://lore.kernel.org/xen-devel/cover.1721834549.git.oleksii.kurochko@gmail.com/
---
Changes in v2:
 - add Acked-by: Julien Grall <julien@xen.org> for Patch 2
 - rename xen/common/device_tree.c to xen/common/device-tree.c
 - update MAINTAINERS file: drop xen/common/device_tree.c from it.
 - make diff smaller using git's options:
      --diff-algorithm=minimal --find-renames
---

Shawn Anastasio (2):
  xen/device-tree: Move Arm's setup.c bootinfo functions to common
  xen/common: Move Arm's bootfdt.c to common

 MAINTAINERS                                   |   3 +-
 xen/arch/arm/Makefile                         |   1 -
 xen/arch/arm/include/asm/setup.h              | 198 +-------
 xen/arch/arm/include/asm/static-shmem.h       |   9 -
 xen/arch/arm/setup.c                          | 432 -----------------
 xen/common/Makefile                           |   2 +-
 xen/common/device-tree/Makefile               |   3 +
 .../arm => common/device-tree}/bootfdt.c      |  24 +-
 xen/common/device-tree/bootinfo.c             | 459 ++++++++++++++++++
 .../device-tree.c}                            |   0
 xen/include/xen/bootfdt.h                     | 209 ++++++++
 11 files changed, 694 insertions(+), 646 deletions(-)
 create mode 100644 xen/common/device-tree/Makefile
 rename xen/{arch/arm => common/device-tree}/bootfdt.c (98%)
 create mode 100644 xen/common/device-tree/bootinfo.c
 rename xen/common/{device_tree.c => device-tree/device-tree.c} (100%)
 create mode 100644 xen/include/xen/bootfdt.h

-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 11:41:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 11:41:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772828.1183278 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbIZB-0006ky-Bi; Tue, 06 Aug 2024 11:41:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772828.1183278; Tue, 06 Aug 2024 11:41:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbIZB-0006k3-74; Tue, 06 Aug 2024 11:41:25 +0000
Received: by outflank-mailman (input) for mailman id 772828;
 Tue, 06 Aug 2024 11:41:23 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=HPS5=PF=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sbIZ9-0006hC-9T
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 11:41:23 +0000
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com
 [2a00:1450:4864:20::132])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cc29d6f9-53e8-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 13:41:19 +0200 (CEST)
Received: by mail-lf1-x132.google.com with SMTP id
 2adb3069b0e04-52fc4388a64so649655e87.1
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 04:41:19 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530bba07891sm1466093e87.22.2024.08.06.04.41.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 06 Aug 2024 04:41:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cc29d6f9-53e8-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722944479; x=1723549279; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=ca5ZXo630vry9EjSQxd1/+2PESi5C2mBKEiwPXnd7Q4=;
        b=lOxkj29UknKbkCD0as7vrYkyrWOk9LCvtuBguBs81VSqmTbrTS0ZrIvzgJ2bxvvoVI
         JvPzyoVDn7/eAon7G71xaab4VjlDiSfXtSeQWJlOZoNvLitEbrwT0RfzQIBbzlCEEvdv
         HchkOBq9LcLpqO0cne+q1i6FQSi3I8z6n1DtxyVD4xyuuqqzFikEnko9HDZB042F5v0M
         T+6vKsaM0ETM5BZoGsKKAMZ29Kdrz5MNjFNv6yiJHVHd7jl9iSOPiOzTYDMxIcnx8b0B
         yakrTwWvn29/bFw7OYkF0Auko7cKC3J0UyXib1gfFM9fYaH9zCuC8tAbpeAbvGCvdnUF
         UJhA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722944479; x=1723549279;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=ca5ZXo630vry9EjSQxd1/+2PESi5C2mBKEiwPXnd7Q4=;
        b=GZ+pFJgoH7CZ9kttKYA4M4hE0X0hnUFYiOvSVbttr6hnYPgeAztOhTmz393gctp3So
         pY86CCUyEWtJLyj3c5uoD9mDlGisiZcCtR33U75d5tr4Vl1TSiShcssAwSY80zbDU2x6
         qjVR9on9ZiExfLxGTatU+C4bmbRJw3iDUDvrzYs88JL/YamWrScmEs5YFYBcF86yyPE1
         HA3lNdZ1dk3uBo/lxRmyGdMIt0dUMun5oRL/+yfjHXk5Ym+3KCqbCh3YFRzmeM1nrZ8v
         io31Ln0XPKK1AV6Au+qm8d6ujiXsLwtZoEjiarv7DAQhQob5eQDAcDewLwD0Rr8UsTqE
         laWA==
X-Gm-Message-State: AOJu0Yy62oDuTx+1ncwD5yylKnkDyHcjrppYAGYxV8f1Pqcmr6ME1T5L
	/enA6mDnOOebuCDv+7PXL7pFFhPJBi2ySUesZJIkpDcE3cPp64y0JvRqpQ==
X-Google-Smtp-Source: AGHT+IFJY9zq4dtupWct6NBDBLTwQTe0g/6ZfEO9g2HxfPf6u6Sczcg2h9NZ5YJFlv1Bsv4qtQaZoQ==
X-Received: by 2002:a05:6512:308c:b0:52e:fdeb:9381 with SMTP id 2adb3069b0e04-530bb39b806mr10179422e87.43.1722944478093;
        Tue, 06 Aug 2024 04:41:18 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Shawn Anastasio <sanastasio@raptorengineering.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Julien Grall <jgrall@amazon.com>
Subject: [PATCH v2 1/2] xen/device-tree: Move Arm's setup.c bootinfo functions to common
Date: Tue,  6 Aug 2024 13:41:13 +0200
Message-ID: <811f6e0001e7a83ea9282a98513407aa19d26256.1722941799.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1722941799.git.oleksii.kurochko@gmail.com>
References: <cover.1722941799.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Shawn Anastasio <sanastasio@raptorengineering.com>

Arm's setup.c contains a collection of functions for parsing memory map
and other boot information from a device tree. Since these routines are
generally useful on any architecture that supports device tree booting,
move them into xen/common/device-tree.

Also, common/device_tree.c has been moved to the device-tree folder with
the corresponding updates to common/Makefile and common/device-tree/Makefile.

Mentioning of arm32 is changed to CONFIG_SEPARATE_XENHEAP in comparison with
original ARM's code as now it is moved in common code.

Suggested-by: Julien Grall <julien@xen.org>
Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Julien Grall <jgrall@amazon.com>
---
Changes in V9:
 - rename xen/common/device_tree.c to xen/common/device-tree.c
 - update MAINTAINERS file: drop xen/common/device_tree.c from it.
---
Changes in V8:
 - add the version of Xen from which bootinfo.c was derived from.
 - update the commit message.
 - add Acked-by: Julien Grall <jgrall@amazon.com>.
---
Changes in V7:
 - move obj-$(CONFIG_HAS_DEVICE_TREE) += device-tree/ to proper place in common/Makefile.
 - rename macros __XEN_BOOTFDT_H__ to XEN_BOOTFDT_H to not violate MISRA rule 21.1.
 - drop definition of "#define MAX_FDT_SIZE SZ_2M" in xen/bootfdt.h as it is expected to
   be arch-specific. Back "#define MAX_FDT_SIZE SZ_2M" to arm/setup.h where it was before
   these changes.
 - git mv xen/common/device_tree.c xen/common/device-tree/ and update correspondingly
   Makefiles of common/ and common/device-tree
 - update the commit message
---
Changes in V6:
 - update the version of the patch to v6.   
---
Changes in V5:
 - After rebase the Shawn's patch v4 on top of current staging the following
   was done:
   - add xen/include/xen/bootfdt.h to MAINTAINERS file.
   - drop message "Early device tree parsing and".
   - After rebase on top of the current staging the following changes were done:
     - init bootinfo variable in <common/device-tree/bootinfo.c> with BOOTINFO_INIT;
     - update the code of dt_unreserved_regions():
         CONFIG_STATIC_SHM related changes and getting of reserved_mem
         bootinfo_get_shmem()
     - update the code of meminfo_overlap_check():
         add check ( INVALID_PADDR == bank_start ) to if case.
     - update the code of check_reserved_regions_overlap():
         CONFIG_STATIC_SHM related changes.
     - struct bootinfo was updated ( CONFIG_STATIC_SHM changes )
     - add shared_meminfo ( because of CONFIG_STATIC_SHM )
     - struct struct membanks was update with __struct group so <xen/kernel> is
       neeeded to be included in bootfdt.h
     - move BOOTINFO_ACPI_INIT, BOOTINFO_SHMEM_INIT, BOOTINFO_INIT to generic bootfdt.h
     - bootinfo_get_reserved_mem(), bootinfo_get_mem(), bootinfo_get_acpi(),
       bootinfo_get_shmem() and bootinfo_get_shmem_extra() were moved to xen/bootfdt.h
   - s/arm32/CONFIG_SEPARATE_XENHEAP/
   - add inclusion of <xen/macros.h> because there are function in <xen/bootfdt.h> which
     are using container_of().
 ---
Changes in v4:
  - create new xen/include/bootinfo.h rather than relying on arch's
    asm/setup.h to provide required definitions for bootinfo.c
  - build bootinfo.c as .init.o
  - clean up and sort bootinfo.c's #includes
  - use CONFIG_SEPARATE_XENHEAP rather than CONFIG_ARM_32 to guard
    xenheap-specific behavior of populate_boot_allocator
  - (MAINTAINERS) include all of common/device-tree rather than just
    bootinfo.c
---
 MAINTAINERS                                   |   3 +-
 xen/arch/arm/include/asm/setup.h              | 185 +------
 xen/arch/arm/setup.c                          | 432 -----------------
 xen/common/Makefile                           |   2 +-
 xen/common/device-tree/Makefile               |   2 +
 xen/common/device-tree/bootinfo.c             | 459 ++++++++++++++++++
 .../device-tree.c}                            |   0
 xen/include/xen/bootfdt.h                     | 195 ++++++++
 8 files changed, 660 insertions(+), 618 deletions(-)
 create mode 100644 xen/common/device-tree/Makefile
 create mode 100644 xen/common/device-tree/bootinfo.c
 rename xen/common/{device_tree.c => device-tree/device-tree.c} (100%)
 create mode 100644 xen/include/xen/bootfdt.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 7c524a8a93..89be48fdf9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -291,9 +291,10 @@ M:	Bertrand Marquis <bertrand.marquis@arm.com>
 M:	Michal Orzel <michal.orzel@amd.com>
 S:	Supported
 F:	xen/common/libfdt/
-F:	xen/common/device_tree.c
+F:	xen/common/device-tree/
 F:	xen/common/dt-overlay.c
 F:	xen/include/xen/libfdt/
+F:	xen/include/xen/bootfdt.h
 F:	xen/include/xen/device_tree.h
 F:	xen/drivers/passthrough/device_tree.c
 
diff --git a/xen/arch/arm/include/asm/setup.h b/xen/arch/arm/include/asm/setup.h
index c34179da93..1748be29e5 100644
--- a/xen/arch/arm/include/asm/setup.h
+++ b/xen/arch/arm/include/asm/setup.h
@@ -3,159 +3,11 @@
 
 #include <public/version.h>
 #include <asm/p2m.h>
+#include <xen/bootfdt.h>
 #include <xen/device_tree.h>
 
-#define MIN_FDT_ALIGN 8
 #define MAX_FDT_SIZE SZ_2M
 
-#define NR_MEM_BANKS 256
-#define NR_SHMEM_BANKS 32
-
-#define MAX_MODULES 32 /* Current maximum useful modules */
-
-typedef enum {
-    BOOTMOD_XEN,
-    BOOTMOD_FDT,
-    BOOTMOD_KERNEL,
-    BOOTMOD_RAMDISK,
-    BOOTMOD_XSM,
-    BOOTMOD_GUEST_DTB,
-    BOOTMOD_UNKNOWN
-}  bootmodule_kind;
-
-enum membank_type {
-    /*
-     * The MEMBANK_DEFAULT type refers to either reserved memory for the
-     * device/firmware (when the bank is in 'reserved_mem') or any RAM (when
-     * the bank is in 'mem').
-     */
-    MEMBANK_DEFAULT,
-    /*
-     * The MEMBANK_STATIC_DOMAIN type is used to indicate whether the memory
-     * bank is bound to a static Xen domain. It is only valid when the bank
-     * is in reserved_mem.
-     */
-    MEMBANK_STATIC_DOMAIN,
-    /*
-     * The MEMBANK_STATIC_HEAP type is used to indicate whether the memory
-     * bank is reserved as static heap. It is only valid when the bank is
-     * in reserved_mem.
-     */
-    MEMBANK_STATIC_HEAP,
-    /*
-     * The MEMBANK_FDT_RESVMEM type is used to indicate whether the memory
-     * bank is from the FDT reserve map.
-     */
-    MEMBANK_FDT_RESVMEM,
-};
-
-/* Indicates the maximum number of characters(\0 included) for shm_id */
-#define MAX_SHM_ID_LENGTH 16
-
-struct shmem_membank_extra {
-    char shm_id[MAX_SHM_ID_LENGTH];
-    unsigned int nr_shm_borrowers;
-};
-
-struct membank {
-    paddr_t start;
-    paddr_t size;
-    union {
-        enum membank_type type;
-#ifdef CONFIG_STATIC_SHM
-        struct shmem_membank_extra *shmem_extra;
-#endif
-    };
-};
-
-struct membanks {
-    __struct_group(membanks_hdr, common, ,
-        unsigned int nr_banks;
-        unsigned int max_banks;
-    );
-    struct membank bank[];
-};
-
-struct meminfo {
-    struct membanks_hdr common;
-    struct membank bank[NR_MEM_BANKS];
-};
-
-struct shared_meminfo {
-    struct membanks_hdr common;
-    struct membank bank[NR_SHMEM_BANKS];
-    struct shmem_membank_extra extra[NR_SHMEM_BANKS];
-};
-
-/*
- * The domU flag is set for kernels and ramdisks of "xen,domain" nodes.
- * The purpose of the domU flag is to avoid getting confused in
- * kernel_probe, where we try to guess which is the dom0 kernel and
- * initrd to be compatible with all versions of the multiboot spec. 
- */
-#define BOOTMOD_MAX_CMDLINE 1024
-struct bootmodule {
-    bootmodule_kind kind;
-    bool domU;
-    paddr_t start;
-    paddr_t size;
-};
-
-/* DT_MAX_NAME is the node name max length according the DT spec */
-#define DT_MAX_NAME 41
-struct bootcmdline {
-    bootmodule_kind kind;
-    bool domU;
-    paddr_t start;
-    char dt_name[DT_MAX_NAME];
-    char cmdline[BOOTMOD_MAX_CMDLINE];
-};
-
-struct bootmodules {
-    int nr_mods;
-    struct bootmodule module[MAX_MODULES];
-};
-
-struct bootcmdlines {
-    unsigned int nr_mods;
-    struct bootcmdline cmdline[MAX_MODULES];
-};
-
-struct bootinfo {
-    struct meminfo mem;
-    /* The reserved regions are only used when booting using Device-Tree */
-    struct meminfo reserved_mem;
-    struct bootmodules modules;
-    struct bootcmdlines cmdlines;
-#ifdef CONFIG_ACPI
-    struct meminfo acpi;
-#endif
-#ifdef CONFIG_STATIC_SHM
-    struct shared_meminfo shmem;
-#endif
-    bool static_heap;
-};
-
-#ifdef CONFIG_ACPI
-#define BOOTINFO_ACPI_INIT .acpi.common.max_banks = NR_MEM_BANKS,
-#else
-#define BOOTINFO_ACPI_INIT
-#endif
-
-#ifdef CONFIG_STATIC_SHM
-#define BOOTINFO_SHMEM_INIT .shmem.common.max_banks = NR_SHMEM_BANKS,
-#else
-#define BOOTINFO_SHMEM_INIT
-#endif
-
-#define BOOTINFO_INIT                               \
-{                                                   \
-    .mem.common.max_banks = NR_MEM_BANKS,           \
-    .reserved_mem.common.max_banks = NR_MEM_BANKS,  \
-    BOOTINFO_ACPI_INIT                              \
-    BOOTINFO_SHMEM_INIT                             \
-}
-
 struct map_range_data
 {
     struct domain *d;
@@ -167,39 +19,8 @@ struct map_range_data
     struct rangeset *irq_ranges;
 };
 
-extern struct bootinfo bootinfo;
-
 extern domid_t max_init_domid;
 
-static inline struct membanks *bootinfo_get_mem(void)
-{
-    return container_of(&bootinfo.mem.common, struct membanks, common);
-}
-
-static inline struct membanks *bootinfo_get_reserved_mem(void)
-{
-    return container_of(&bootinfo.reserved_mem.common, struct membanks, common);
-}
-
-#ifdef CONFIG_ACPI
-static inline struct membanks *bootinfo_get_acpi(void)
-{
-    return container_of(&bootinfo.acpi.common, struct membanks, common);
-}
-#endif
-
-#ifdef CONFIG_STATIC_SHM
-static inline struct membanks *bootinfo_get_shmem(void)
-{
-    return container_of(&bootinfo.shmem.common, struct membanks, common);
-}
-
-static inline struct shmem_membank_extra *bootinfo_get_shmem_extra(void)
-{
-    return bootinfo.shmem.extra;
-}
-#endif
-
 void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len);
 
 size_t estimate_efi_size(unsigned int mem_nr_banks);
@@ -220,9 +41,6 @@ void fw_unreserved_regions(paddr_t s, paddr_t e,
                            void (*cb)(paddr_t ps, paddr_t pe),
                            unsigned int first);
 
-size_t boot_fdt_info(const void *fdt, paddr_t paddr);
-const char *boot_fdt_cmdline(const void *fdt);
-
 bool check_reserved_regions_overlap(paddr_t region_start, paddr_t region_size);
 
 struct bootmodule *add_boot_module(bootmodule_kind kind,
@@ -237,7 +55,6 @@ struct bootcmdline * boot_cmdline_find_by_name(const char *name);
 const char *boot_module_kind_as_string(bootmodule_kind kind);
 
 void init_pdx(void);
-void populate_boot_allocator(void);
 void setup_mm(void);
 
 extern uint32_t hyp_traps_vector[];
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 0c2fdaceaf..cb2c0a16b8 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -48,8 +48,6 @@
 #include <xsm/xsm.h>
 #include <asm/acpi.h>
 
-struct bootinfo __initdata bootinfo = BOOTINFO_INIT;
-
 /*
  * Sanitized version of cpuinfo containing only features available on all
  * cores (only on arm64 as there is no sanitization support on arm32).
@@ -203,321 +201,6 @@ static void __init processor_id(void)
     processor_setup();
 }
 
-static void __init dt_unreserved_regions(paddr_t s, paddr_t e,
-                                         void (*cb)(paddr_t ps, paddr_t pe),
-                                         unsigned int first)
-{
-    const struct membanks *reserved_mem = bootinfo_get_reserved_mem();
-#ifdef CONFIG_STATIC_SHM
-    const struct membanks *shmem = bootinfo_get_shmem();
-    unsigned int offset;
-#endif
-    unsigned int i;
-
-    /*
-     * i is the current bootmodule we are evaluating across all possible
-     * kinds.
-     */
-    for ( i = first; i < reserved_mem->nr_banks; i++ )
-    {
-        paddr_t r_s = reserved_mem->bank[i].start;
-        paddr_t r_e = r_s + reserved_mem->bank[i].size;
-
-        if ( s < r_e && r_s < e )
-        {
-            dt_unreserved_regions(r_e, e, cb, i + 1);
-            dt_unreserved_regions(s, r_s, cb, i + 1);
-            return;
-        }
-    }
-
-#ifdef CONFIG_STATIC_SHM
-    /*
-     * When retrieving the corresponding shared memory addresses
-     * below, we need to index the shmem->bank starting from 0, hence
-     * we need to use i - reserved_mem->nr_banks.
-    */
-    offset = reserved_mem->nr_banks;
-    for ( ; i - offset < shmem->nr_banks; i++ )
-    {
-        paddr_t r_s, r_e;
-
-        r_s = shmem->bank[i - offset].start;
-
-        /* Shared memory banks can contain INVALID_PADDR as start */
-        if ( INVALID_PADDR == r_s )
-            continue;
-
-        r_e = r_s + shmem->bank[i - offset].size;
-
-        if ( s < r_e && r_s < e )
-        {
-            dt_unreserved_regions(r_e, e, cb, i + 1);
-            dt_unreserved_regions(s, r_s, cb, i + 1);
-            return;
-        }
-    }
-#endif
-
-    cb(s, e);
-}
-
-/*
- * TODO: '*_end' could be 0 if the bank/region is at the end of the physical
- * address space. This is for now not handled as it requires more rework.
- */
-static bool __init meminfo_overlap_check(const struct membanks *mem,
-                                         paddr_t region_start,
-                                         paddr_t region_size)
-{
-    paddr_t bank_start = INVALID_PADDR, bank_end = 0;
-    paddr_t region_end = region_start + region_size;
-    unsigned int i, bank_num = mem->nr_banks;
-
-    for ( i = 0; i < bank_num; i++ )
-    {
-        bank_start = mem->bank[i].start;
-        bank_end = bank_start + mem->bank[i].size;
-
-        if ( INVALID_PADDR == bank_start || region_end <= bank_start ||
-             region_start >= bank_end )
-            continue;
-        else
-        {
-            printk("Region: [%#"PRIpaddr", %#"PRIpaddr") overlapping with bank[%u]: [%#"PRIpaddr", %#"PRIpaddr")\n",
-                   region_start, region_end, i, bank_start, bank_end);
-            return true;
-        }
-    }
-
-    return false;
-}
-
-/*
- * TODO: '*_end' could be 0 if the module/region is at the end of the physical
- * address space. This is for now not handled as it requires more rework.
- */
-static bool __init bootmodules_overlap_check(struct bootmodules *bootmodules,
-                                             paddr_t region_start,
-                                             paddr_t region_size)
-{
-    paddr_t mod_start = INVALID_PADDR, mod_end = 0;
-    paddr_t region_end = region_start + region_size;
-    unsigned int i, mod_num = bootmodules->nr_mods;
-
-    for ( i = 0; i < mod_num; i++ )
-    {
-        mod_start = bootmodules->module[i].start;
-        mod_end = mod_start + bootmodules->module[i].size;
-
-        if ( region_end <= mod_start || region_start >= mod_end )
-            continue;
-        else
-        {
-            printk("Region: [%#"PRIpaddr", %#"PRIpaddr") overlapping with mod[%u]: [%#"PRIpaddr", %#"PRIpaddr")\n",
-                   region_start, region_end, i, mod_start, mod_end);
-            return true;
-        }
-    }
-
-    return false;
-}
-
-void __init fw_unreserved_regions(paddr_t s, paddr_t e,
-                                  void (*cb)(paddr_t ps, paddr_t pe),
-                                  unsigned int first)
-{
-    if ( acpi_disabled )
-        dt_unreserved_regions(s, e, cb, first);
-    else
-        cb(s, e);
-}
-
-/*
- * Given an input physical address range, check if this range is overlapping
- * with the existing reserved memory regions defined in bootinfo.
- * Return true if the input physical address range is overlapping with any
- * existing reserved memory regions, otherwise false.
- */
-bool __init check_reserved_regions_overlap(paddr_t region_start,
-                                           paddr_t region_size)
-{
-    const struct membanks *mem_banks[] = {
-        bootinfo_get_reserved_mem(),
-#ifdef CONFIG_ACPI
-        bootinfo_get_acpi(),
-#endif
-#ifdef CONFIG_STATIC_SHM
-        bootinfo_get_shmem(),
-#endif
-    };
-    unsigned int i;
-
-    /*
-     * Check if input region is overlapping with reserved memory banks or
-     * ACPI EfiACPIReclaimMemory (when ACPI feature is enabled) or static
-     * shared memory banks (when static shared memory feature is enabled)
-     */
-    for ( i = 0; i < ARRAY_SIZE(mem_banks); i++ )
-        if ( meminfo_overlap_check(mem_banks[i], region_start, region_size) )
-            return true;
-
-    /* Check if input region is overlapping with bootmodules */
-    if ( bootmodules_overlap_check(&bootinfo.modules,
-                                   region_start, region_size) )
-        return true;
-
-    return false;
-}
-
-struct bootmodule __init *add_boot_module(bootmodule_kind kind,
-                                          paddr_t start, paddr_t size,
-                                          bool domU)
-{
-    struct bootmodules *mods = &bootinfo.modules;
-    struct bootmodule *mod;
-    unsigned int i;
-
-    if ( mods->nr_mods == MAX_MODULES )
-    {
-        printk("Ignoring %s boot module at %"PRIpaddr"-%"PRIpaddr" (too many)\n",
-               boot_module_kind_as_string(kind), start, start + size);
-        return NULL;
-    }
-
-    if ( check_reserved_regions_overlap(start, size) )
-        return NULL;
-
-    for ( i = 0 ; i < mods->nr_mods ; i++ )
-    {
-        mod = &mods->module[i];
-        if ( mod->kind == kind && mod->start == start )
-        {
-            if ( !domU )
-                mod->domU = false;
-            return mod;
-        }
-    }
-
-    mod = &mods->module[mods->nr_mods++];
-    mod->kind = kind;
-    mod->start = start;
-    mod->size = size;
-    mod->domU = domU;
-
-    return mod;
-}
-
-/*
- * boot_module_find_by_kind can only be used to return Xen modules (e.g
- * XSM, DTB) or Dom0 modules. This is not suitable for looking up guest
- * modules.
- */
-struct bootmodule * __init boot_module_find_by_kind(bootmodule_kind kind)
-{
-    struct bootmodules *mods = &bootinfo.modules;
-    struct bootmodule *mod;
-    int i;
-    for (i = 0 ; i < mods->nr_mods ; i++ )
-    {
-        mod = &mods->module[i];
-        if ( mod->kind == kind && !mod->domU )
-            return mod;
-    }
-    return NULL;
-}
-
-void __init add_boot_cmdline(const char *name, const char *cmdline,
-                             bootmodule_kind kind, paddr_t start, bool domU)
-{
-    struct bootcmdlines *cmds = &bootinfo.cmdlines;
-    struct bootcmdline *cmd;
-
-    if ( cmds->nr_mods == MAX_MODULES )
-    {
-        printk("Ignoring %s cmdline (too many)\n", name);
-        return;
-    }
-
-    cmd = &cmds->cmdline[cmds->nr_mods++];
-    cmd->kind = kind;
-    cmd->domU = domU;
-    cmd->start = start;
-
-    ASSERT(strlen(name) <= DT_MAX_NAME);
-    safe_strcpy(cmd->dt_name, name);
-
-    if ( strlen(cmdline) > BOOTMOD_MAX_CMDLINE )
-        panic("module %s command line too long\n", name);
-    safe_strcpy(cmd->cmdline, cmdline);
-}
-
-/*
- * boot_cmdline_find_by_kind can only be used to return Xen modules (e.g
- * XSM, DTB) or Dom0 modules. This is not suitable for looking up guest
- * modules.
- */
-struct bootcmdline * __init boot_cmdline_find_by_kind(bootmodule_kind kind)
-{
-    struct bootcmdlines *cmds = &bootinfo.cmdlines;
-    struct bootcmdline *cmd;
-    int i;
-
-    for ( i = 0 ; i < cmds->nr_mods ; i++ )
-    {
-        cmd = &cmds->cmdline[i];
-        if ( cmd->kind == kind && !cmd->domU )
-            return cmd;
-    }
-    return NULL;
-}
-
-struct bootcmdline * __init boot_cmdline_find_by_name(const char *name)
-{
-    struct bootcmdlines *mods = &bootinfo.cmdlines;
-    struct bootcmdline *mod;
-    unsigned int i;
-
-    for (i = 0 ; i < mods->nr_mods ; i++ )
-    {
-        mod = &mods->cmdline[i];
-        if ( strcmp(mod->dt_name, name) == 0 )
-            return mod;
-    }
-    return NULL;
-}
-
-struct bootmodule * __init boot_module_find_by_addr_and_kind(bootmodule_kind kind,
-                                                             paddr_t start)
-{
-    struct bootmodules *mods = &bootinfo.modules;
-    struct bootmodule *mod;
-    unsigned int i;
-
-    for (i = 0 ; i < mods->nr_mods ; i++ )
-    {
-        mod = &mods->module[i];
-        if ( mod->kind == kind && mod->start == start )
-            return mod;
-    }
-    return NULL;
-}
-
-const char * __init boot_module_kind_as_string(bootmodule_kind kind)
-{
-    switch ( kind )
-    {
-    case BOOTMOD_XEN:     return "Xen";
-    case BOOTMOD_FDT:     return "Device Tree";
-    case BOOTMOD_KERNEL:  return "Kernel";
-    case BOOTMOD_RAMDISK: return "Ramdisk";
-    case BOOTMOD_XSM:     return "XSM";
-    case BOOTMOD_GUEST_DTB:     return "DTB";
-    case BOOTMOD_UNKNOWN: return "Unknown";
-    default: BUG();
-    }
-}
-
 void __init discard_initial_modules(void)
 {
     struct bootmodules *mi = &bootinfo.modules;
@@ -556,40 +239,6 @@ static void * __init relocate_fdt(paddr_t dtb_paddr, size_t dtb_size)
     return fdt;
 }
 
-/*
- * Return the end of the non-module region starting at s. In other
- * words return s the start of the next modules after s.
- *
- * On input *end is the end of the region which should be considered
- * and it is updated to reflect the end of the module, clipped to the
- * end of the region if it would run over.
- */
-static paddr_t __init next_module(paddr_t s, paddr_t *end)
-{
-    struct bootmodules *mi = &bootinfo.modules;
-    paddr_t lowest = ~(paddr_t)0;
-    int i;
-
-    for ( i = 0; i < mi->nr_mods; i++ )
-    {
-        paddr_t mod_s = mi->module[i].start;
-        paddr_t mod_e = mod_s + mi->module[i].size;
-
-        if ( !mi->module[i].size )
-            continue;
-
-        if ( mod_s < s )
-            continue;
-        if ( mod_s > lowest )
-            continue;
-        if ( mod_s > *end )
-            continue;
-        lowest = mod_s;
-        *end = min(*end, mod_e);
-    }
-    return lowest;
-}
-
 void __init init_pdx(void)
 {
     const struct membanks *mem = bootinfo_get_mem();
@@ -635,87 +284,6 @@ void __init init_pdx(void)
     }
 }
 
-/*
- * Populate the boot allocator.
- * If a static heap was not provided by the admin, all the RAM but the
- * following regions will be added:
- *  - Modules (e.g., Xen, Kernel)
- *  - Reserved regions
- *  - Xenheap (arm32 only)
- * If a static heap was provided by the admin, populate the boot
- * allocator with the corresponding regions only, but with Xenheap excluded
- * on arm32.
- */
-void __init populate_boot_allocator(void)
-{
-    unsigned int i;
-    const struct membanks *banks = bootinfo_get_mem();
-    const struct membanks *reserved_mem = bootinfo_get_reserved_mem();
-    paddr_t s, e;
-
-    if ( bootinfo.static_heap )
-    {
-        for ( i = 0 ; i < reserved_mem->nr_banks; i++ )
-        {
-            if ( reserved_mem->bank[i].type != MEMBANK_STATIC_HEAP )
-                continue;
-
-            s = reserved_mem->bank[i].start;
-            e = s + reserved_mem->bank[i].size;
-#ifdef CONFIG_ARM_32
-            /* Avoid the xenheap, note that the xenheap cannot across a bank */
-            if ( s <= mfn_to_maddr(directmap_mfn_start) &&
-                 e >= mfn_to_maddr(directmap_mfn_end) )
-            {
-                init_boot_pages(s, mfn_to_maddr(directmap_mfn_start));
-                init_boot_pages(mfn_to_maddr(directmap_mfn_end), e);
-            }
-            else
-#endif
-                init_boot_pages(s, e);
-        }
-
-        return;
-    }
-
-    for ( i = 0; i < banks->nr_banks; i++ )
-    {
-        const struct membank *bank = &banks->bank[i];
-        paddr_t bank_end = bank->start + bank->size;
-
-        s = bank->start;
-        while ( s < bank_end )
-        {
-            paddr_t n = bank_end;
-
-            e = next_module(s, &n);
-
-            if ( e == ~(paddr_t)0 )
-                e = n = bank_end;
-
-            /*
-             * Module in a RAM bank other than the one which we are
-             * not dealing with here.
-             */
-            if ( e > bank_end )
-                e = bank_end;
-
-#ifdef CONFIG_ARM_32
-            /* Avoid the xenheap */
-            if ( s < mfn_to_maddr(directmap_mfn_end) &&
-                 mfn_to_maddr(directmap_mfn_start) < e )
-            {
-                e = mfn_to_maddr(directmap_mfn_start);
-                n = mfn_to_maddr(directmap_mfn_end);
-            }
-#endif
-
-            fw_unreserved_regions(s, e, init_boot_pages, 0);
-            s = n;
-        }
-    }
-}
-
 size_t __read_mostly dcache_line_bytes;
 
 /* C entry point for boot CPU */
diff --git a/xen/common/Makefile b/xen/common/Makefile
index f12a474d40..7e66802a9e 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -6,7 +6,7 @@ obj-$(CONFIG_HYPFS_CONFIG) += config_data.o
 obj-$(CONFIG_CORE_PARKING) += core_parking.o
 obj-y += cpu.o
 obj-$(CONFIG_DEBUG_TRACE) += debugtrace.o
-obj-$(CONFIG_HAS_DEVICE_TREE) += device_tree.o
+obj-$(CONFIG_HAS_DEVICE_TREE) += device-tree/
 obj-$(CONFIG_IOREQ_SERVER) += dm.o
 obj-y += domain.o
 obj-$(CONFIG_OVERLAY_DTB) += dt-overlay.o
diff --git a/xen/common/device-tree/Makefile b/xen/common/device-tree/Makefile
new file mode 100644
index 0000000000..f813f7555f
--- /dev/null
+++ b/xen/common/device-tree/Makefile
@@ -0,0 +1,2 @@
+obj-y += bootinfo.init.o
+obj-y += device-tree.o
diff --git a/xen/common/device-tree/bootinfo.c b/xen/common/device-tree/bootinfo.c
new file mode 100644
index 0000000000..f2e6a1145b
--- /dev/null
+++ b/xen/common/device-tree/bootinfo.c
@@ -0,0 +1,459 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Derived from Xen 4.19's $xen/arch/arm/setup.c.
+ *
+ * bookkeeping routines.
+ *
+ * Tim Deegan <tim@xen.org>
+ * Copyright (c) 2011 Citrix Systems.
+ * Copyright (c) 2024 Raptor Engineering LLC
+ */
+
+#include <xen/acpi.h>
+#include <xen/bootfdt.h>
+#include <xen/bug.h>
+#include <xen/device_tree.h>
+#include <xen/init.h>
+#include <xen/libfdt/libfdt-xen.h>
+#include <xen/mm.h>
+
+struct bootinfo __initdata bootinfo = BOOTINFO_INIT;
+
+const char * __init boot_module_kind_as_string(bootmodule_kind kind)
+{
+    switch ( kind )
+    {
+    case BOOTMOD_XEN:     return "Xen";
+    case BOOTMOD_FDT:     return "Device Tree";
+    case BOOTMOD_KERNEL:  return "Kernel";
+    case BOOTMOD_RAMDISK: return "Ramdisk";
+    case BOOTMOD_XSM:     return "XSM";
+    case BOOTMOD_GUEST_DTB:     return "DTB";
+    case BOOTMOD_UNKNOWN: return "Unknown";
+    default: BUG();
+    }
+}
+
+static void __init dt_unreserved_regions(paddr_t s, paddr_t e,
+                                         void (*cb)(paddr_t ps, paddr_t pe),
+                                         unsigned int first)
+{
+    const struct membanks *reserved_mem = bootinfo_get_reserved_mem();
+#ifdef CONFIG_STATIC_SHM
+    const struct membanks *shmem = bootinfo_get_shmem();
+    unsigned int offset;
+#endif
+    unsigned int i;
+
+    /*
+     * i is the current bootmodule we are evaluating across all possible
+     * kinds.
+     */
+    for ( i = first; i < reserved_mem->nr_banks; i++ )
+    {
+        paddr_t r_s = reserved_mem->bank[i].start;
+        paddr_t r_e = r_s + reserved_mem->bank[i].size;
+
+        if ( s < r_e && r_s < e )
+        {
+            dt_unreserved_regions(r_e, e, cb, i + 1);
+            dt_unreserved_regions(s, r_s, cb, i + 1);
+            return;
+        }
+    }
+
+#ifdef CONFIG_STATIC_SHM
+    /*
+     * When retrieving the corresponding shared memory addresses
+     * below, we need to index the shmem->bank starting from 0, hence
+     * we need to use i - reserved_mem->nr_banks.
+    */
+    offset = reserved_mem->nr_banks;
+    for ( ; i - offset < shmem->nr_banks; i++ )
+    {
+        paddr_t r_s, r_e;
+
+        r_s = shmem->bank[i - offset].start;
+
+        /* Shared memory banks can contain INVALID_PADDR as start */
+        if ( INVALID_PADDR == r_s )
+            continue;
+
+        r_e = r_s + shmem->bank[i - offset].size;
+
+        if ( s < r_e && r_s < e )
+        {
+            dt_unreserved_regions(r_e, e, cb, i + 1);
+            dt_unreserved_regions(s, r_s, cb, i + 1);
+            return;
+        }
+    }
+#endif
+
+    cb(s, e);
+}
+
+/*
+ * TODO: '*_end' could be 0 if the bank/region is at the end of the physical
+ * address space. This is for now not handled as it requires more rework.
+ */
+static bool __init meminfo_overlap_check(const struct membanks *mem,
+                                         paddr_t region_start,
+                                         paddr_t region_size)
+{
+    paddr_t bank_start = INVALID_PADDR, bank_end = 0;
+    paddr_t region_end = region_start + region_size;
+    unsigned int i, bank_num = mem->nr_banks;
+
+    for ( i = 0; i < bank_num; i++ )
+    {
+        bank_start = mem->bank[i].start;
+        bank_end = bank_start + mem->bank[i].size;
+
+        if ( INVALID_PADDR == bank_start || region_end <= bank_start ||
+             region_start >= bank_end )
+            continue;
+        else
+        {
+            printk("Region: [%#"PRIpaddr", %#"PRIpaddr") overlapping with bank[%u]: [%#"PRIpaddr", %#"PRIpaddr")\n",
+                   region_start, region_end, i, bank_start, bank_end);
+            return true;
+        }
+    }
+
+    return false;
+}
+
+/*
+ * TODO: '*_end' could be 0 if the module/region is at the end of the physical
+ * address space. This is for now not handled as it requires more rework.
+ */
+static bool __init bootmodules_overlap_check(struct bootmodules *bootmodules,
+                                             paddr_t region_start,
+                                             paddr_t region_size)
+{
+    paddr_t mod_start = INVALID_PADDR, mod_end = 0;
+    paddr_t region_end = region_start + region_size;
+    unsigned int i, mod_num = bootmodules->nr_mods;
+
+    for ( i = 0; i < mod_num; i++ )
+    {
+        mod_start = bootmodules->module[i].start;
+        mod_end = mod_start + bootmodules->module[i].size;
+
+        if ( region_end <= mod_start || region_start >= mod_end )
+            continue;
+        else
+        {
+            printk("Region: [%#"PRIpaddr", %#"PRIpaddr") overlapping with mod[%u]: [%#"PRIpaddr", %#"PRIpaddr")\n",
+                   region_start, region_end, i, mod_start, mod_end);
+            return true;
+        }
+    }
+
+    return false;
+}
+
+void __init fw_unreserved_regions(paddr_t s, paddr_t e,
+                                  void (*cb)(paddr_t ps, paddr_t pe),
+                                  unsigned int first)
+{
+    if ( acpi_disabled )
+        dt_unreserved_regions(s, e, cb, first);
+    else
+        cb(s, e);
+}
+
+/*
+ * Given an input physical address range, check if this range is overlapping
+ * with the existing reserved memory regions defined in bootinfo.
+ * Return true if the input physical address range is overlapping with any
+ * existing reserved memory regions, otherwise false.
+ */
+bool __init check_reserved_regions_overlap(paddr_t region_start,
+                                           paddr_t region_size)
+{
+    const struct membanks *mem_banks[] = {
+        bootinfo_get_reserved_mem(),
+#ifdef CONFIG_ACPI
+        bootinfo_get_acpi(),
+#endif
+#ifdef CONFIG_STATIC_SHM
+        bootinfo_get_shmem(),
+#endif
+    };
+    unsigned int i;
+
+    /*
+     * Check if input region is overlapping with reserved memory banks or
+     * ACPI EfiACPIReclaimMemory (when ACPI feature is enabled) or static
+     * shared memory banks (when static shared memory feature is enabled)
+     */
+    for ( i = 0; i < ARRAY_SIZE(mem_banks); i++ )
+        if ( meminfo_overlap_check(mem_banks[i], region_start, region_size) )
+            return true;
+
+    /* Check if input region is overlapping with bootmodules */
+    if ( bootmodules_overlap_check(&bootinfo.modules,
+                                   region_start, region_size) )
+        return true;
+
+    return false;
+}
+
+struct bootmodule __init *add_boot_module(bootmodule_kind kind,
+                                          paddr_t start, paddr_t size,
+                                          bool domU)
+{
+    struct bootmodules *mods = &bootinfo.modules;
+    struct bootmodule *mod;
+    unsigned int i;
+
+    if ( mods->nr_mods == MAX_MODULES )
+    {
+        printk("Ignoring %s boot module at %"PRIpaddr"-%"PRIpaddr" (too many)\n",
+               boot_module_kind_as_string(kind), start, start + size);
+        return NULL;
+    }
+
+    if ( check_reserved_regions_overlap(start, size) )
+        return NULL;
+
+    for ( i = 0 ; i < mods->nr_mods ; i++ )
+    {
+        mod = &mods->module[i];
+        if ( mod->kind == kind && mod->start == start )
+        {
+            if ( !domU )
+                mod->domU = false;
+            return mod;
+        }
+    }
+
+    mod = &mods->module[mods->nr_mods++];
+    mod->kind = kind;
+    mod->start = start;
+    mod->size = size;
+    mod->domU = domU;
+
+    return mod;
+}
+
+/*
+ * boot_module_find_by_kind can only be used to return Xen modules (e.g
+ * XSM, DTB) or Dom0 modules. This is not suitable for looking up guest
+ * modules.
+ */
+struct bootmodule * __init boot_module_find_by_kind(bootmodule_kind kind)
+{
+    struct bootmodules *mods = &bootinfo.modules;
+    struct bootmodule *mod;
+    int i;
+    for (i = 0 ; i < mods->nr_mods ; i++ )
+    {
+        mod = &mods->module[i];
+        if ( mod->kind == kind && !mod->domU )
+            return mod;
+    }
+    return NULL;
+}
+
+void __init add_boot_cmdline(const char *name, const char *cmdline,
+                             bootmodule_kind kind, paddr_t start, bool domU)
+{
+    struct bootcmdlines *cmds = &bootinfo.cmdlines;
+    struct bootcmdline *cmd;
+
+    if ( cmds->nr_mods == MAX_MODULES )
+    {
+        printk("Ignoring %s cmdline (too many)\n", name);
+        return;
+    }
+
+    cmd = &cmds->cmdline[cmds->nr_mods++];
+    cmd->kind = kind;
+    cmd->domU = domU;
+    cmd->start = start;
+
+    ASSERT(strlen(name) <= DT_MAX_NAME);
+    safe_strcpy(cmd->dt_name, name);
+
+    if ( strlen(cmdline) > BOOTMOD_MAX_CMDLINE )
+        panic("module %s command line too long\n", name);
+    safe_strcpy(cmd->cmdline, cmdline);
+}
+
+/*
+ * boot_cmdline_find_by_kind can only be used to return Xen modules (e.g
+ * XSM, DTB) or Dom0 modules. This is not suitable for looking up guest
+ * modules.
+ */
+struct bootcmdline * __init boot_cmdline_find_by_kind(bootmodule_kind kind)
+{
+    struct bootcmdlines *cmds = &bootinfo.cmdlines;
+    struct bootcmdline *cmd;
+    int i;
+
+    for ( i = 0 ; i < cmds->nr_mods ; i++ )
+    {
+        cmd = &cmds->cmdline[i];
+        if ( cmd->kind == kind && !cmd->domU )
+            return cmd;
+    }
+    return NULL;
+}
+
+struct bootcmdline * __init boot_cmdline_find_by_name(const char *name)
+{
+    struct bootcmdlines *mods = &bootinfo.cmdlines;
+    struct bootcmdline *mod;
+    unsigned int i;
+
+    for (i = 0 ; i < mods->nr_mods ; i++ )
+    {
+        mod = &mods->cmdline[i];
+        if ( strcmp(mod->dt_name, name) == 0 )
+            return mod;
+    }
+    return NULL;
+}
+
+struct bootmodule * __init boot_module_find_by_addr_and_kind(bootmodule_kind kind,
+                                                             paddr_t start)
+{
+    struct bootmodules *mods = &bootinfo.modules;
+    struct bootmodule *mod;
+    unsigned int i;
+
+    for (i = 0 ; i < mods->nr_mods ; i++ )
+    {
+        mod = &mods->module[i];
+        if ( mod->kind == kind && mod->start == start )
+            return mod;
+    }
+    return NULL;
+}
+
+/*
+ * Return the end of the non-module region starting at s. In other
+ * words return s the start of the next modules after s.
+ *
+ * On input *end is the end of the region which should be considered
+ * and it is updated to reflect the end of the module, clipped to the
+ * end of the region if it would run over.
+ */
+static paddr_t __init next_module(paddr_t s, paddr_t *end)
+{
+    struct bootmodules *mi = &bootinfo.modules;
+    paddr_t lowest = ~(paddr_t)0;
+    int i;
+
+    for ( i = 0; i < mi->nr_mods; i++ )
+    {
+        paddr_t mod_s = mi->module[i].start;
+        paddr_t mod_e = mod_s + mi->module[i].size;
+
+        if ( !mi->module[i].size )
+            continue;
+
+        if ( mod_s < s )
+            continue;
+        if ( mod_s > lowest )
+            continue;
+        if ( mod_s > *end )
+            continue;
+        lowest = mod_s;
+        *end = min(*end, mod_e);
+    }
+    return lowest;
+}
+
+/*
+ * Populate the boot allocator.
+ * If a static heap was not provided by the admin, all the RAM but the
+ * following regions will be added:
+ *  - Modules (e.g., Xen, Kernel)
+ *  - Reserved regions
+ *  - Xenheap (CONFIG_SEPARATE_XENHEAP only)
+ * If a static heap was provided by the admin, populate the boot
+ * allocator with the corresponding regions only, but with Xenheap excluded
+ * on CONFIG_SEPARATE_XENHEAP.
+ */
+void __init populate_boot_allocator(void)
+{
+    unsigned int i;
+    const struct membanks *banks = bootinfo_get_mem();
+    const struct membanks *reserved_mem = bootinfo_get_reserved_mem();
+    paddr_t s, e;
+
+    if ( bootinfo.static_heap )
+    {
+        for ( i = 0 ; i < reserved_mem->nr_banks; i++ )
+        {
+            if ( reserved_mem->bank[i].type != MEMBANK_STATIC_HEAP )
+                continue;
+
+            s = reserved_mem->bank[i].start;
+            e = s + reserved_mem->bank[i].size;
+#ifdef CONFIG_SEPARATE_XENHEAP
+            /* Avoid the xenheap, note that the xenheap cannot across a bank */
+            if ( s <= mfn_to_maddr(directmap_mfn_start) &&
+                 e >= mfn_to_maddr(directmap_mfn_end) )
+            {
+                init_boot_pages(s, mfn_to_maddr(directmap_mfn_start));
+                init_boot_pages(mfn_to_maddr(directmap_mfn_end), e);
+            }
+            else
+#endif
+                init_boot_pages(s, e);
+        }
+
+        return;
+    }
+
+    for ( i = 0; i < banks->nr_banks; i++ )
+    {
+        const struct membank *bank = &banks->bank[i];
+        paddr_t bank_end = bank->start + bank->size;
+
+        s = bank->start;
+        while ( s < bank_end )
+        {
+            paddr_t n = bank_end;
+
+            e = next_module(s, &n);
+
+            if ( e == ~(paddr_t)0 )
+                e = n = bank_end;
+
+            /*
+             * Module in a RAM bank other than the one which we are
+             * not dealing with here.
+             */
+            if ( e > bank_end )
+                e = bank_end;
+
+#ifdef CONFIG_SEPARATE_XENHEAP
+            /* Avoid the xenheap */
+            if ( s < mfn_to_maddr(directmap_mfn_end) &&
+                 mfn_to_maddr(directmap_mfn_start) < e )
+            {
+                e = mfn_to_maddr(directmap_mfn_start);
+                n = mfn_to_maddr(directmap_mfn_end);
+            }
+#endif
+
+            fw_unreserved_regions(s, e, init_boot_pages, 0);
+            s = n;
+        }
+    }
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/common/device_tree.c b/xen/common/device-tree/device-tree.c
similarity index 100%
rename from xen/common/device_tree.c
rename to xen/common/device-tree/device-tree.c
diff --git a/xen/include/xen/bootfdt.h b/xen/include/xen/bootfdt.h
new file mode 100644
index 0000000000..c39428d5f5
--- /dev/null
+++ b/xen/include/xen/bootfdt.h
@@ -0,0 +1,195 @@
+#ifndef XEN_BOOTFDT_H
+#define XEN_BOOTFDT_H
+
+#include <xen/types.h>
+#include <xen/kernel.h>
+#include <xen/macros.h>
+
+#define MIN_FDT_ALIGN 8
+
+#define NR_MEM_BANKS 256
+#define NR_SHMEM_BANKS 32
+
+#define MAX_MODULES 32 /* Current maximum useful modules */
+
+typedef enum {
+    BOOTMOD_XEN,
+    BOOTMOD_FDT,
+    BOOTMOD_KERNEL,
+    BOOTMOD_RAMDISK,
+    BOOTMOD_XSM,
+    BOOTMOD_GUEST_DTB,
+    BOOTMOD_UNKNOWN
+}  bootmodule_kind;
+
+enum membank_type {
+    /*
+     * The MEMBANK_DEFAULT type refers to either reserved memory for the
+     * device/firmware (when the bank is in 'reserved_mem') or any RAM (when
+     * the bank is in 'mem').
+     */
+    MEMBANK_DEFAULT,
+    /*
+     * The MEMBANK_STATIC_DOMAIN type is used to indicate whether the memory
+     * bank is bound to a static Xen domain. It is only valid when the bank
+     * is in reserved_mem.
+     */
+    MEMBANK_STATIC_DOMAIN,
+    /*
+     * The MEMBANK_STATIC_HEAP type is used to indicate whether the memory
+     * bank is reserved as static heap. It is only valid when the bank is
+     * in reserved_mem.
+     */
+    MEMBANK_STATIC_HEAP,
+    /*
+     * The MEMBANK_FDT_RESVMEM type is used to indicate whether the memory
+     * bank is from the FDT reserve map.
+     */
+    MEMBANK_FDT_RESVMEM,
+};
+
+/* Indicates the maximum number of characters(\0 included) for shm_id */
+#define MAX_SHM_ID_LENGTH 16
+
+struct shmem_membank_extra {
+    char shm_id[MAX_SHM_ID_LENGTH];
+    unsigned int nr_shm_borrowers;
+};
+
+struct membank {
+    paddr_t start;
+    paddr_t size;
+    union {
+        enum membank_type type;
+#ifdef CONFIG_STATIC_SHM
+        struct shmem_membank_extra *shmem_extra;
+#endif
+    };
+};
+
+struct membanks {
+    __struct_group(membanks_hdr, common, ,
+        unsigned int nr_banks;
+        unsigned int max_banks;
+    );
+    struct membank bank[];
+};
+
+struct meminfo {
+    struct membanks_hdr common;
+    struct membank bank[NR_MEM_BANKS];
+};
+
+struct shared_meminfo {
+    struct membanks_hdr common;
+    struct membank bank[NR_SHMEM_BANKS];
+    struct shmem_membank_extra extra[NR_SHMEM_BANKS];
+};
+
+/*
+ * The domU flag is set for kernels and ramdisks of "xen,domain" nodes.
+ * The purpose of the domU flag is to avoid getting confused in
+ * kernel_probe, where we try to guess which is the dom0 kernel and
+ * initrd to be compatible with all versions of the multiboot spec.
+ */
+#define BOOTMOD_MAX_CMDLINE 1024
+struct bootmodule {
+    bootmodule_kind kind;
+    bool domU;
+    paddr_t start;
+    paddr_t size;
+};
+
+/* DT_MAX_NAME is the node name max length according the DT spec */
+#define DT_MAX_NAME 41
+struct bootcmdline {
+    bootmodule_kind kind;
+    bool domU;
+    paddr_t start;
+    char dt_name[DT_MAX_NAME];
+    char cmdline[BOOTMOD_MAX_CMDLINE];
+};
+
+struct bootmodules {
+    int nr_mods;
+    struct bootmodule module[MAX_MODULES];
+};
+
+struct bootcmdlines {
+    unsigned int nr_mods;
+    struct bootcmdline cmdline[MAX_MODULES];
+};
+
+struct bootinfo {
+    struct meminfo mem;
+    /* The reserved regions are only used when booting using Device-Tree */
+    struct meminfo reserved_mem;
+    struct bootmodules modules;
+    struct bootcmdlines cmdlines;
+#ifdef CONFIG_ACPI
+    struct meminfo acpi;
+#endif
+#ifdef CONFIG_STATIC_SHM
+    struct shared_meminfo shmem;
+#endif
+    bool static_heap;
+};
+
+#ifdef CONFIG_ACPI
+#define BOOTINFO_ACPI_INIT .acpi.common.max_banks = NR_MEM_BANKS,
+#else
+#define BOOTINFO_ACPI_INIT
+#endif
+
+#ifdef CONFIG_STATIC_SHM
+#define BOOTINFO_SHMEM_INIT .shmem.common.max_banks = NR_SHMEM_BANKS,
+#else
+#define BOOTINFO_SHMEM_INIT
+#endif
+
+#define BOOTINFO_INIT                               \
+{                                                   \
+    .mem.common.max_banks = NR_MEM_BANKS,           \
+    .reserved_mem.common.max_banks = NR_MEM_BANKS,  \
+    BOOTINFO_ACPI_INIT                              \
+    BOOTINFO_SHMEM_INIT                             \
+}
+
+extern struct bootinfo bootinfo;
+
+void populate_boot_allocator(void);
+
+size_t boot_fdt_info(const void *fdt, paddr_t paddr);
+
+const char *boot_fdt_cmdline(const void *fdt);
+
+static inline struct membanks *bootinfo_get_reserved_mem(void)
+{
+    return container_of(&bootinfo.reserved_mem.common, struct membanks, common);
+}
+
+static inline struct membanks *bootinfo_get_mem(void)
+{
+    return container_of(&bootinfo.mem.common, struct membanks, common);
+}
+
+#ifdef CONFIG_ACPI
+static inline struct membanks *bootinfo_get_acpi(void)
+{
+    return container_of(&bootinfo.acpi.common, struct membanks, common);
+}
+#endif
+
+#ifdef CONFIG_STATIC_SHM
+static inline struct membanks *bootinfo_get_shmem(void)
+{
+    return container_of(&bootinfo.shmem.common, struct membanks, common);
+}
+
+static inline struct shmem_membank_extra *bootinfo_get_shmem_extra(void)
+{
+    return bootinfo.shmem.extra;
+}
+#endif
+
+#endif /* XEN_BOOTFDT_H */
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 11:51:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 11:51:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772854.1183294 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbIiC-0001Hr-8z; Tue, 06 Aug 2024 11:50:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772854.1183294; Tue, 06 Aug 2024 11:50:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbIiC-0001Hk-69; Tue, 06 Aug 2024 11:50:44 +0000
Received: by outflank-mailman (input) for mailman id 772854;
 Tue, 06 Aug 2024 11:50:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ctxO=PF=ti.com=a-singh21@srs-se1.protection.inumbo.net>)
 id 1sbIiB-0001Hc-05
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 11:50:43 +0000
Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 178c0f6d-53ea-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 13:50:39 +0200 (CEST)
Received: from lelv0265.itg.ti.com ([10.180.67.224])
 by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 476BoQcq016373;
 Tue, 6 Aug 2024 06:50:26 -0500
Received: from DLEE110.ent.ti.com (dlee110.ent.ti.com [157.170.170.21])
 by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 476BoQ4R009825
 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL);
 Tue, 6 Aug 2024 06:50:26 -0500
Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE110.ent.ti.com
 (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 6
 Aug 2024 06:50:25 -0500
Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE106.ent.ti.com
 (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via
 Frontend Transport; Tue, 6 Aug 2024 06:50:25 -0500
Received: from localhost (nightbug.dhcp.ti.com [172.24.227.225])
 by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 476BoPT0044809;
 Tue, 6 Aug 2024 06:50:25 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 178c0f6d-53ea-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com;
	s=ti-com-17Q1; t=1722945026;
	bh=ITZ380bjRYsLPXZoSRvWEuPfymBXO69Wp3tIMO2jzbw=;
	h=Date:From:To:CC:Subject:References:In-Reply-To;
	b=fPAe0u17Z6+xcan208mN66WJNiurIRk/JZ8wq+HALXEudB3UvNyE/+v3FfLqfH1oH
	 vB1qwonTvneXh/qietZdqM1Wr4KNou76xSTzfKyBicX7KwarqR1OQDHRPVmRIC1x04
	 nCheLhder0KqdbnDImvKrPY5QV1UPn8VyWFmhEmQ=
Date: Tue, 6 Aug 2024 17:20:24 +0530
From: Amneesh Singh <a-singh21@ti.com>
To: Julien Grall <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>,
        Bertrand Marquis
	<bertrand.marquis@arm.com>,
        Michal Orzel <michal.orzel@amd.com>,
        Stefano
 Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH] drivers: char: omap-uart: add "clock-hz" option
Message-ID: <pm2tulzvwuexw6stt2gx6nxbhnmqy36tbswde7j26wtq3x6wob@hyxxarp32or5>
References: <20240719113313.145587-1-a-singh21@ti.com>
 <b7ef34fe-f6eb-45e8-8f6a-0e2c4bd0175b@xen.org>
 <njlq7laeswww46izwpkzuvnvu3lcycv7kc6dt2urbrpimj6uej@tzjuwwhwwqmp>
 <8c12dc98-bc9f-49bf-bc18-ddae99fa7312@xen.org>
 <csvohhbfi7ilqjzmozhb7u75jp7kfncpyj335hz5vksjw7lr46@57puayor4b4r>
 <ff6a7077-efbb-4002-9426-a9f05760f8f8@xen.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <ff6a7077-efbb-4002-9426-a9f05760f8f8@xen.org>
X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180

Hi

On 12:08-20240806, Julien Grall wrote:
> Hi,
> 
> On 06/08/2024 11:35, Amneesh Singh wrote:
> > On 10:56-20240806, Julien Grall wrote:
> >> On 06/08/2024 10:50, Amneesh Singh wrote:
> >>> On 10:16-20240806, Julien Grall wrote:
> >>>> Hi,
> >>>>
> >>>> On 19/07/2024 12:33, Amneesh Singh wrote:
> >>>>> Quite a few TI K3 devices do not have clock-frequency specified in their
> >>>>> respective UART nodes.
> >>>>
> >>>> Can you outline why fixing the device-tree is not solution?
> >>> Because other frequencies, say 96MHz or 192 MHz are also valid inputs.
> >>
> >> Are you saying this is configurable by the user? Or do you mean the
> >> firmware can configure it?
> > u-boot or some other bootloader are free to configure it. And usually,
> > linux's clock driver will pick it up using clk_get_rate (if not
> > specified in the DT), I think. Now, in case we add the frequency to the
> > DT, it may not match with the actual frequency configured before Xen
> > initialisation. Since, there is no equivalent to clk_get_rate under Xen,
> > and the fact I'm using imagebuilder, I found it easier to pass the
> > frequency the way I did.
> 
> Thanks for the explanation. I haven't looked in details, but how
> difficult would it be to implement clk_get_rate() (at least just enough
> to work for the UART) in Xen?
To be honest, I have no idea, I am not at all familiar with linux's
clock API. I just did this to get UART to work under Xen.
> >>>>
> >>>>> However hard-coding the frequency is not a
> >>>>    > solution as the function clock input can differ between SoCs.
> >>>>
> >>>> Can you provide some details how Linux is handling those SoCs?
> >>> Yes, like omap-uart under xen, the 8250_omap driver also parses the DT,
> >>> but unlike omap-uart, falls back to clk_get_rate() and if the value is
> >>> still zero, it defaults to 48MHz.
> >>
> >> Thanks for the information. Then my next question is why Linux can get
> >> away with a default value and not Xen?
> > Sure why not? I guess, we can use a default value if everything fails
> > but there should still be a way for the user to specify the frequency.
> 
> I think I am still missing something. Why would Xen allow the user to
> specify the clock speed if Linux doesn't? At least to me, it is more
> likely that a user would want to boot Linux on your HW than Xen...
That was not worded correctly, apologies. What I meant was a way for
the user to specify it since apart from DT, unlike linux, there is no
way for Xen to determine the frequency other than using default of
course.
> 
> > Of course, we can instead just force the user to change the DT slightly
> > by just specifying the frequency. However, I feel it is easier to add it
> > here, especially when there's already a method to pass these options via
> > the command-line in place.
>  > I believe, this is the best we can do with this.
> 
> The problem is the command line is OS/hypervisor specific. But the
> problem you describe doesn't seem Xen specific. This is where the DT is
> handy because you describe once and it can be used everywhere.
> 
> Overall, at the moment, I don't think the command line option is the
> right approach. If I am not mistaken, it would make Xen less
> user-friendly (compare to Linux) to boot on your HW as the user would
You are correct that it's an extra step, but curently, it's either
specifying it in the bootarg or specifying in the DT. Both are the
things that the user would have to do. I just went with what was easier
for me as a user. It is pretty similar to the current com1/com2
interface anyway.

> need to specify the clockspeed on the command line. I think we should
> investigate other approaches such as implementing partially
> clk_get_rate() (if this is how Linux manage to retrieve the clock speed
> without any command line option).
I guess, we can just ditch the entire idea, and just use the a default
fallback and just print a message informing the user that there is no
frequency in the DT. I do not think implementing clk_get_rate (or any
clock API) is feasible or worth the effort to be completely honest.
What do you think? I do not particularly have any issues with that. I 
feel like this is a niche case (at least now) anyway.
> 
> Cheers,
> 
> --
> Julien Grall
> 
>

Regards
Amneesh


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 12:48:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 12:48:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772868.1183303 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbJc0-0001ao-Ce; Tue, 06 Aug 2024 12:48:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772868.1183303; Tue, 06 Aug 2024 12:48:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbJc0-0001ah-9P; Tue, 06 Aug 2024 12:48:24 +0000
Received: by outflank-mailman (input) for mailman id 772868;
 Tue, 06 Aug 2024 12:48:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sbJby-0001ab-Um
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 12:48:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbJby-0005fo-72; Tue, 06 Aug 2024 12:48:22 +0000
Received: from 54-240-197-232.amazon.com ([54.240.197.232]
 helo=dev-dsk-jgrall-1b-035652ec.eu-west-1.amazon.com)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbJbx-0007eA-Rr; Tue, 06 Aug 2024 12:48:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:
	Subject:Cc:To:From; bh=bgtg7AJNCNjW0PVNQtg8CBjCCHn+6JUhVvhjRrYGPYw=; b=pR0obT
	hKWc8nKwnes/f4MHLQ48aIJgvOyHGUy8cUPdGKjHyx+x0Y95/bQfQL9e2g75Ax6PRZUZgpSTBZgeu
	hwggwo+Sot6M+EucjSv61TmwP7OkyWAxDVow/TVm/yeui5PkRHEV0Y5QKKacnV/8bbqF0jYYyu8Br
	nozNNk0SSwU=;
From: Julien Grall <julien@xen.org>
To: xen-devel@lists.xenproject.org
Cc: julien@xen.org,
	Julien Grall <jgrall@amazon.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH] xen/arm64: entry: Actually skip do_trap_*() when an SError is triggered
Date: Tue,  6 Aug 2024 13:48:15 +0100
Message-Id: <20240806124815.53492-1-julien@xen.org>
X-Mailer: git-send-email 2.40.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Julien Grall <jgrall@amazon.com>

For SErrors, we support two configurations:
  * Every SErrors will result to a panic in Xen
  * We will forward SErrors triggered by a VM back to itself

For the latter case, we want to skip the call to do_trap_*() because the PC
was already adjusted.

However, the alternative used to decide between the two configurations
is inverted. This would result to the VM corrupting itself if:
  * x19 is non-zero in the panic case
  * advance PC too much in the second case

Solve the issue by switch from alternative_if to alternative_if_not.

Fixes: a458d3bd0d25 ("xen/arm: entry: Ensure the guest state is synced when receiving a vSError")
Signed-off-by: Julien Grall <jgrall@amazon.com>

----

This is a candidate to be backported to all supported tree.

I don't have a setup where I can easily inject SError. But this was tested
by setting x19 to 1 just before the first alternative and use "serrors=panic".

Before this patch, Linux would get stuck.
---
 xen/arch/arm/arm64/entry.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/arm64/entry.S b/xen/arch/arm/arm64/entry.S
index 6251135ebdd2..fab10f8a0d26 100644
--- a/xen/arch/arm/arm64/entry.S
+++ b/xen/arch/arm/arm64/entry.S
@@ -259,7 +259,7 @@
          * apart. The easiest way is to duplicate the few instructions
          * that need to be skipped.
          */
-        alternative_if SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT
+        alternative_if_not SKIP_SYNCHRONIZE_SERROR_ENTRY_EXIT
         cbnz      x19, 1f
         mov       x0, sp
         bl        do_trap_\trap
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 13:27:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 13:27:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772880.1183314 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbKDM-0007rw-9Z; Tue, 06 Aug 2024 13:27:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772880.1183314; Tue, 06 Aug 2024 13:27:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbKDM-0007rp-6K; Tue, 06 Aug 2024 13:27:00 +0000
Received: by outflank-mailman (input) for mailman id 772880;
 Tue, 06 Aug 2024 13: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=PT90=PF=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sbKDK-0007ri-IB
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 13:26:58 +0000
Received: from NAM02-BN1-obe.outbound.protection.outlook.com
 (mail-bn1nam02on20617.outbound.protection.outlook.com
 [2a01:111:f403:2407::617])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8d2b2c44-53f7-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 15:26:57 +0200 (CEST)
Received: from DM6PR03CA0013.namprd03.prod.outlook.com (2603:10b6:5:40::26) by
 SA1PR12MB7174.namprd12.prod.outlook.com (2603:10b6:806:2b1::22) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23; Tue, 6 Aug
 2024 13:26:52 +0000
Received: from DS1PEPF00017095.namprd03.prod.outlook.com
 (2603:10b6:5:40:cafe::f3) by DM6PR03CA0013.outlook.office365.com
 (2603:10b6:5:40::26) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26 via Frontend
 Transport; Tue, 6 Aug 2024 13:26:52 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 DS1PEPF00017095.mail.protection.outlook.com (10.167.17.138) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Tue, 6 Aug 2024 13:26:51 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 6 Aug
 2024 08:26:51 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 6 Aug
 2024 08:26:50 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Tue, 6 Aug 2024 08:26:49 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8d2b2c44-53f7-11ef-bc04-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=PiXmb0VTMK6NQZVNvx779RzU1HFc4tkVy8GHbRaAWfK3cGjq35PFoCov1323lGyWUEgoQfudoGp/BZoiUt2RYCHrq0C0hPpXU99B2JXeppUjUe9ePDKa/j6GNHyIC7kLvgEzLtvwWJ2yHuLdBtZByxApHmWaz2T+uPQSosuT4ZuL19JpZ79e4nS/l4/PZ+uyOVqXqiFU7WCV9E6AM4jIm22+g+TsxULAVsmPGCxz6S+42RVEbZ56+T9Qr7mw2w4SLjQLfiV8VunogYqXQj5hEQTJH3NmfFIssyZat2TDTP7EjseJVCjy44b1UyrqmxUOJUpIgNRkxrOiei/ZNqJ5BA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3qAgu7bbX8Y4bq2KxCRNtu8hDQUJng1HwUV9zC6GnUo=;
 b=Qyu6cKyONpUJPeUPOkXkeWUgM1FJIWlwIHZ4KVeE2fVb0CrpwCJuXgeMNPai15wR8/JkBwXOHrHz0mKgSVxCsnFGdTxdBKTtGQtaPJHC5dbSS3X2N99O3XveqyYFX56RyGmg1gxwEjJk8eubZ4Ajfn6bzFFe8EeQRjDpmbi70ybmXLbNcElSpYnhIPraawOq7VwLtN39pOn3eL3U/eL6+KXeINrm0ArygCtQpSAOZUtNnP0TrzvlztbHTggJ5ZT8IldaLKfukP9MiFYHXK7vxppzVJuan/NaMljl1k79nBdO9M1Oy5z60q1e3gYbppg/n0kFW3B4b4tFH09r4Am5nA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3qAgu7bbX8Y4bq2KxCRNtu8hDQUJng1HwUV9zC6GnUo=;
 b=yf8G8xw4zpkAgRlKq0VCb/LiHGiVDi1LiZ6WjZxB2XmF6hfSWMYZYfAfDwT4YZbBKulM3kcvFNhmDcNQ+a1Hn6OF+XOrarmli0H3wa0UKT7qTCWm5HhKTkf0SMDMzKdNmjscpFRtXoeW/nKGMz1DxeVvA5NxR0jMoIPR0uJDwq4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <a27a865a-8a23-4185-9b31-d5fc6e362812@amd.com>
Date: Tue, 6 Aug 2024 15:26:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/arm64: entry: Actually skip do_trap_*() when an
 SError is triggered
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Julien Grall <jgrall@amazon.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240806124815.53492-1-julien@xen.org>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240806124815.53492-1-julien@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB05.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS1PEPF00017095:EE_|SA1PR12MB7174:EE_
X-MS-Office365-Filtering-Correlation-Id: 40ef85ca-9020-41eb-7a08-08dcb61b6ec3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?SWFiMmFHbmp3aDhoSTNFdmFzN2k1em00cmE1VDlYbWxOcUtvOW1RMmhCNkRz?=
 =?utf-8?B?enpUQlFlaFR4RWZDTDhCQjZoK0F2QVdPZ2xKSTB0Y2psZXB4ek9meEs0MGdr?=
 =?utf-8?B?c3ZhYUNpSHlIM2ZFcGVIdlVqQTIxY1RYdlc2U3RzN0VPa0pQZERuRk5oR3lT?=
 =?utf-8?B?d3JHT0F1Y1ZHaHQ2MGNPSi9Ba1pLU1hVdDVBd0hHU3Z6WHpHT0Rwa1ZpcmRD?=
 =?utf-8?B?TVZNR3dWbURDZWNzSlFwL0o2bGhocW9SaXI0QnBqQi9aa0tvaXY0ZDlWaEZj?=
 =?utf-8?B?TnlZa3JOVnJaZHAzSHhhajlVQ2QxeURSTG9qZVFzUkRId3NOeFlXWHh5d29F?=
 =?utf-8?B?b2RIeVozWlJsa01lUll0ZDM4aGcxSFRrc2x2d3p3M0RlemtrcjZPUzlwQlg5?=
 =?utf-8?B?N0h3Q24yNHcwd2dDNlVOSXd2ZkxUQVZIQmZRZ085bWtZcmlhVDR1dFZsV2Zu?=
 =?utf-8?B?Mk9IZ2RpS3ViMlBIc2lrVnkzSGRweVg3UXdCOFFtRHl2RW5OVTRaRjNncWlJ?=
 =?utf-8?B?eGluaHdxUUI1TE14cjRNNDJsa0szN2dyNEo5WUkrTXM1RjEzUGFWbG9DUWNJ?=
 =?utf-8?B?VWJQWG0zc3kzVi9QN3E2MFU1VjNLeU1HSENlVXVYZTEyTVVUOG13Q2RVRTNk?=
 =?utf-8?B?TXFDUlpJZHNpTW96VmNNM3dhdkNYYVFmZ1RLU293c04yVit4NW4zbVhWUE5D?=
 =?utf-8?B?bGVSRC9IdXk4V2NZei8wcHE2RUdnaDV4aTRya0hsOTM0OWZPMnFDWVRzOVBD?=
 =?utf-8?B?YnJYQytybjR4QWVDaVlyQitMUUIvdTdVTUZtTVA2YkZCNENMczBwWmVGN0xs?=
 =?utf-8?B?dU5lek1CNjBQWFhBUyswU1Z4SFd0KzhNKy9sUVJWQURYclhaajg2dkFMVTQ4?=
 =?utf-8?B?YUEzR1Q5UUJEWjMweGd3TElma1lQQnRzUHpmN2c5c1pGenRPVnJwTHg3bklG?=
 =?utf-8?B?aFRGbE9QWjFYUWp2cTRpTTNoejdMQUVNZnR5T3lYdXhHTUlpT25RY3ZicE5Z?=
 =?utf-8?B?dlFRVldKWWkxNEtnd1NFNUE5ZHRiMFU2ZWNWT3RNaHA3dS9hWFFzdzhKK1d0?=
 =?utf-8?B?WXlEdEVza1BwTWhhQzFtVDR4dXphdkZYSnBUNFNLTHhER29PNVYzdVNteEVD?=
 =?utf-8?B?ZWVuVCtEVU5ZVkJpTmJMbGJNMVV0cDhiUWcrVHovZEV4Qk1OYVJRTjZMTkd4?=
 =?utf-8?B?aDlmdFNGNmhFSUJ2YWQ3WmtpcmNCWlNnMzdqRmRRUFJJT3VNVGRpNjBVYmlU?=
 =?utf-8?B?OHMrdGxaRXF6QjZFZjg4SWtDZ2V1a1RCSkZPTFo3TlB5bW9pSmV2MkZTSzFR?=
 =?utf-8?B?MVFPODRKdkc1OU9KZ0tHTU1KYlNQMFB6cmtBd3pvM01BYkZaVnNpcHZRVFdj?=
 =?utf-8?B?WlduNDFUUTQwMmlvYlVJZDNnSEFVTmNYRmRlZyt1bGJXT2lyVTF6RGlOS3I0?=
 =?utf-8?B?bjEyOU83TU5GR2xqUmdpb3BLS1E5bGwydGpGNVpRcTlYZXQrYklWdTk1b3RT?=
 =?utf-8?B?SmNFRVk1WnI2b2N2SkwxelZWRC9DTHJFY3VKZTIxRGpCVlQ0aTNTd2RqT0sr?=
 =?utf-8?B?UFREVUl0WkdsZ2ZIeUpwRTlKSFZ2Z1pBN0tvUjFMRFJIb0g5bDdwTFE5OHRD?=
 =?utf-8?B?Y3JJV0ZRbGpDemtsVmprVlZHN3dBbElodXU0NXo4TWx5eEl3QUVmMjRUbjVL?=
 =?utf-8?B?ZGlMR1VtZ2IrS0krWGRhMXVHSFZlNDlmd0k4THh1THRRVi9relVIV01EdjVr?=
 =?utf-8?B?T3dmdW5NR1d1VkwzSDhlaytGWU5zWXZsRFdMWS9GVVJMck5xdFFFeW1SRkVy?=
 =?utf-8?B?U3dvWGJKaTVzQkRVRmo2YmhwV0tlQjFzMHZYaHZzMGduUmEyaFk0NllEeUlB?=
 =?utf-8?B?NHM3SCt4cy9mbmhPZjRwY29WTmtBWStuSm1ZaFk2bVVocmF1NFg3Y3JHczE0?=
 =?utf-8?Q?7AYKZddj9/E=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 13:26:51.7350
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 40ef85ca-9020-41eb-7a08-08dcb61b6ec3
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS1PEPF00017095.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7174

Hi Julien,

On 06/08/2024 14:48, Julien Grall wrote:
> 
> 
> From: Julien Grall <jgrall@amazon.com>
> 
> For SErrors, we support two configurations:
>   * Every SErrors will result to a panic in Xen
>   * We will forward SErrors triggered by a VM back to itself
> 
> For the latter case, we want to skip the call to do_trap_*() because the PC
> was already adjusted.
> 
> However, the alternative used to decide between the two configurations
> is inverted. This would result to the VM corrupting itself if:
>   * x19 is non-zero in the panic case
>   * advance PC too much in the second case
> 
> Solve the issue by switch from alternative_if to alternative_if_not.
> 
> Fixes: a458d3bd0d25 ("xen/arm: entry: Ensure the guest state is synced when receiving a vSError")
> Signed-off-by: Julien Grall <jgrall@amazon.com>
Acked-by: Michal Orzel <michal.orzel@amd.com>

> 
> ----
3 instead of 4 dashes

~Michal


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 13:30:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 13:30:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772887.1183324 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbKGw-0000vn-PI; Tue, 06 Aug 2024 13:30:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772887.1183324; Tue, 06 Aug 2024 13:30:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbKGw-0000vg-Lq; Tue, 06 Aug 2024 13:30:42 +0000
Received: by outflank-mailman (input) for mailman id 772887;
 Tue, 06 Aug 2024 13:30:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sbKGw-0000vZ-1t
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 13:30:42 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbKGv-0006OJ-Fq; Tue, 06 Aug 2024 13:30:41 +0000
Received: from [15.248.3.88] (helo=[10.24.67.24])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbKGv-0001k8-9w; Tue, 06 Aug 2024 13:30:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=oX7JKqvoy/EGL5j5wM8Z1UtRDLRcRXI8Zs2djUr1Wc0=; b=fRmsdibOAiWz2XsnZhExwT+7ys
	LDpGEIslXT+G2/pKUi0MNCkcmMCgMZeAkmWCl9pFfUyZtMfbN/qxGhdqN39cnh8z8d9oRLcAAbcSn
	IZVuqXKxaXVair5IKR79ktwcEWpM3yWAkWJLwk5uuBMAcJnD7VRWEKKEjL4SU4vEPaT4=;
Message-ID: <c1178d7a-ac95-4022-82d5-8da5901b6f43@xen.org>
Date: Tue, 6 Aug 2024 14:30:39 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/arm64: entry: Actually skip do_trap_*() when an
 SError is triggered
Content-Language: en-GB
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Julien Grall <jgrall@amazon.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240806124815.53492-1-julien@xen.org>
 <a27a865a-8a23-4185-9b31-d5fc6e362812@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <a27a865a-8a23-4185-9b31-d5fc6e362812@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 06/08/2024 14:26, Michal Orzel wrote:
> Hi Julien,
> 
> On 06/08/2024 14:48, Julien Grall wrote:
>>
>>
>> From: Julien Grall <jgrall@amazon.com>
>>
>> For SErrors, we support two configurations:
>>    * Every SErrors will result to a panic in Xen
>>    * We will forward SErrors triggered by a VM back to itself
>>
>> For the latter case, we want to skip the call to do_trap_*() because the PC
>> was already adjusted.
>>
>> However, the alternative used to decide between the two configurations
>> is inverted. This would result to the VM corrupting itself if:
>>    * x19 is non-zero in the panic case
>>    * advance PC too much in the second case
>>
>> Solve the issue by switch from alternative_if to alternative_if_not.
>>
>> Fixes: a458d3bd0d25 ("xen/arm: entry: Ensure the guest state is synced when receiving a vSError")
>> Signed-off-by: Julien Grall <jgrall@amazon.com>
> Acked-by: Michal Orzel <michal.orzel@amd.com>
> 
>>
>> ----
> 3 instead of 4 dashes

I will fixed it.

The patchqueue tool I am using will strip anything after "---". So I am 
using ---- to version changelog... I tend to forget that I need to 
manually call sed -i 's/^----/---/' *.patch before sending every patch.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 14:12:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 14:12:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772897.1183336 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbKvW-0007fm-Pd; Tue, 06 Aug 2024 14:12:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772897.1183336; Tue, 06 Aug 2024 14:12:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbKvW-0007ff-Mo; Tue, 06 Aug 2024 14:12:38 +0000
Received: by outflank-mailman (input) for mailman id 772897;
 Tue, 06 Aug 2024 14:12: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=ByCl=PF=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbKvV-0007fZ-Du
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 14:12:37 +0000
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com
 [2a00:1450:4864:20::130])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id eda85e9d-53fd-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 16:12:35 +0200 (CEST)
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-530ad969360so1020372e87.0
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 07:12:35 -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
 4fb4d7f45d1cf-5b83960f101sm6052431a12.20.2024.08.06.07.12.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 06 Aug 2024 07:12:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eda85e9d-53fd-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722953554; x=1723558354; darn=lists.xenproject.org;
        h=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=y6kpQ4eA3HCo4eCJbxriKhqxa9g5EExTuqQ3M1gsnLo=;
        b=bHizHddkvxUsgPK1lBbVozWkjfeX5lDf5SUAsPCXL9nRIxxWoOyV2VpooZ1k/+WRPk
         9kqRCo2+Y/WQrCcDKeT5W5xlZCy6kPHXO/UjaxpmIJYS5cFxDv/0YiStoX0+losoXaSO
         LQnV9M6eAveDYkf+HWoWJ7ZqJxLwcCmVtwzAtINANsBiCXkxXkuR1gCrbPikyVCP+X2F
         ej7eK+perL7afDY2D82lmhZAx15VRa686eLd+jj+kkQuOYSoxVS8LkOzWvFR72rSd5zg
         SDBT56o1ZkiXFtTH56ptnLzgmcn4j99LDiUZTMRnau/u960MkjLyQkqIG2v+Fg+AUXPi
         qaPQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722953554; x=1723558354;
        h=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=y6kpQ4eA3HCo4eCJbxriKhqxa9g5EExTuqQ3M1gsnLo=;
        b=Psx2FAv+lzmFDhZJD2zWUt4NUmlVzCQt3fxH8cIZN1OVhPpYQYreyO31McDEulRp/d
         izEdDXelUuAWlkcbw5jpu0FRIdiJBn0j2eU2ll2owuUa6muGICTcHWWtavFS/O7jCwEM
         NWFQuyQqDpr7XS84/G0WPg6/wus7KFxy/L0+McTLS4lYrBo13XnSI31VdSjbjApVZU3E
         uo/KkQk/qLINciwTXKqrl0uSisS9jyQV48LVs9/s0YAc7NFWPM4w40C9H7lCQcM8PW5/
         TS/IY4nA+uRhmiEAcb7FjRPIsG3EGwM7vHUcop9kKUBjuoj4JfAopRcfvoErjSVy3PEf
         u59Q==
X-Gm-Message-State: AOJu0YxD15IUJin6C2+rdy8RY2mMyfbu/PNoLwWxsA3UKq2KrKgLEaOu
	waDqrfD7VICO6qh8NSBaPU5ClgtroV8LI+3PectkHdVaj3tl/OOtAxj1uJlvCpE=
X-Google-Smtp-Source: AGHT+IFVFFJoR3peZEPbAvkRJIcAEGTfnZ+s74MH3U/te/p5YaTc4NZy01jSMGMHfRnwa5/WLDMvVg==
X-Received: by 2002:a05:6512:3b9c:b0:52c:dac3:392b with SMTP id 2adb3069b0e04-530bb3a2334mr10425784e87.33.1722953554091;
        Tue, 06 Aug 2024 07:12:34 -0700 (PDT)
Content-Type: multipart/mixed; boundary="------------AQ4HBPRyjOeE3SI2rjxB1tor"
Message-ID: <6a7508dd-9f81-4fce-9c83-8b4fae924d48@suse.com>
Date: Tue, 6 Aug 2024 16:12:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: ACPI NVS range conflicting with Dom0 page tables (or kernel
 image)
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <a5a8a016-2107-46fb-896b-2baaf66566d4@suse.com>
 <ZnBCFgHltVqj2FDh@mail-itl>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <ZnBCFgHltVqj2FDh@mail-itl>

This is a multi-part message in MIME format.
--------------AQ4HBPRyjOeE3SI2rjxB1tor
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Marek,

On 17.06.24 16:03, Marek Marczykowski-Górecki wrote:
> On Mon, Jun 17, 2024 at 01:22:37PM +0200, Jan Beulich wrote:
>> Hello,
>>
>> while it feels like we had a similar situation before, I can't seem to be
>> able to find traces thereof, or associated (Linux) commits.
> 
> Is it some AMD Threadripper system by a chance? Previous thread on this
> issue:
> https://lore.kernel.org/xen-devel/CAOCpoWdOH=xGxiQSC1c5Ueb1THxAjH4WiZbCZq-QT+d_KAk3SA@mail.gmail.com/
> 
>> With
>>
>> (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4000000
>> ...
>> (XEN)  Dom0 alloc.:   0000000440000000->0000000448000000 (619175 pages to be allocated)
>> ...
>> (XEN)  Loaded kernel: ffffffff81000000->ffffffff84000000
>>
>> the kernel occupies the space from 16Mb to 64Mb in the initial allocation.
>> Page tables come (almost) directly above:
>>
>> (XEN)  Page tables:   ffffffff84001000->ffffffff84026000
>>
>> I.e. they're just above the 64Mb boundary. Yet sadly in the host E820 map
>> there is
>>
>> (XEN)  [0000000004000000, 0000000004009fff] (ACPI NVS)
>>
>> i.e. a non-RAM range starting at 64Mb. The kernel (currently) won't tolerate
>> such an overlap (also if it was overlapping the kernel image, e.g. if on the
>> machine in question s sufficiently much larger kernel was used). Yet with its
>> fundamental goal of making its E820 match the host one I'm also in trouble
>> thinking of possible solutions / workarounds. I certainly do not see Xen
>> trying to cover for this, as the E820 map re-arrangement is purely a kernel
>> side decision (forward ported kernels got away without, and what e.g. the
>> BSDs do is entirely unknown to me).
> 
> In Qubes we have worked around the issue by moving the kernel lower
> (CONFIG_PHYSICAL_START=0x200000):
> https://github.com/QubesOS/qubes-linux-kernel/commit/3e8be4ac1682370977d4d0dc1d782c428d860282
> 
> Far from ideal, but gets it bootable...
> 

could you test the attached kernel patches? They should fix the issue without
having to modify CONFIG_PHYSICAL_START.

I have tested them to boot up without problem on my test system, but I don't
have access to a system showing the E820 map conflict you are seeing.

The patches have been developed against kernel 6.11-rc2, but I think they
should apply to a 6.10 and maybe even an older kernel.

If possible it would be nice to verify suspend to disk still working, as
the kernel will need to access the ACPI NVS area in this case.


Juergen
--------------AQ4HBPRyjOeE3SI2rjxB1tor
Content-Type: text/x-patch; charset=UTF-8;
 name="0001-xen-use-correct-end-address-of-kernel-for-conflict-c.patch"
Content-Disposition: attachment;
 filename*0="0001-xen-use-correct-end-address-of-kernel-for-conflict-c.pa";
 filename*1="tch"
Content-Transfer-Encoding: base64

RnJvbSBkYjg1YWJmYTQ0ZjIwODU2MzIwZjljZjE5YTRiNGZlNmQ5NGIzMGY4IE1vbiBTZXAg
MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKdWVyZ2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+
CkRhdGU6IFNhdCwgMyBBdWcgMjAyNCAwODowMToyMiArMDIwMApTdWJqZWN0OiBbUEFUQ0gg
MS81XSB4ZW46IHVzZSBjb3JyZWN0IGVuZCBhZGRyZXNzIG9mIGtlcm5lbCBmb3IgY29uZmxp
Y3QKIGNoZWNraW5nCgpXaGVuIHJ1bm5pbmcgYXMgYSBYZW4gUFYgZG9tMCB0aGUga2VybmVs
IGlzIGxvYWRlZCBieSB0aGUgaHlwZXJ2aXNvcgp1c2luZyBhIGRpZmZlcmVudCBtZW1vcnkg
bWFwIHRoYW4gdGhhdCBvZiB0aGUgaG9zdC4gSW4gb3JkZXIgdG8KbWluaW1pemUgdGhlIHJl
cXVpcmVkIGNoYW5nZXMgaW4gdGhlIGtlcm5lbCwgdGhlIGtlcm5lbCBhZGFwdHMgaXRzCm1l
bW9yeSBtYXAgdG8gdGhhdCBvZiB0aGUgaG9zdC4gSW4gb3JkZXIgdG8gZG8gdGhhdCBpdCBp
cyBjaGVja2luZwpmb3IgY29uZmxpY3RzIG9mIGl0cyBsb2FkIGFkZHJlc3Mgd2l0aCB0aGUg
aG9zdCBtZW1vcnkgbWFwLgoKVW5mb3J0dW5hdGVseSB0aGUgdGVzdGVkIG1lbW9yeSByYW5n
ZSBkb2VzIG5vdCBpbmNsdWRlIHRoZSAuYnJrCmFyZWEsIHdoaWNoIG1pZ2h0IHJlc3VsdCBp
biBjcmFzaGVzIG9yIG1lbW9yeSBjb3JydXB0aW9uIHdoZW4gdGhpcwphcmVhIGRvZXMgY29u
ZmxpY3Qgd2l0aGUgdGhlIG1lbW9yeSBtYXAgb2YgdGhlIGhvc3QuCgpGaXggdGhlIHRlc3Qg
YnkgdXNpbmcgdGhlIF9lbmQgbGFiZWwgaW5zdGVhZCBvZiBfX2Jzc19zdG9wLgoKRml4ZXM6
IDgwOGZkYjcxOTM2YyAoInhlbjogY2hlY2sgZm9yIGtlcm5lbCBtZW1vcnkgY29uZmxpY3Rp
bmcgd2l0aCBtZW1vcnkgbGF5b3V0IikKU2lnbmVkLW9mZi1ieTogSnVlcmdlbiBHcm9zcyA8
amdyb3NzQHN1c2UuY29tPgotLS0KIGFyY2gveDg2L3hlbi9zZXR1cC5jIHwgMiArLQogMSBm
aWxlIGNoYW5nZWQsIDEgaW5zZXJ0aW9uKCspLCAxIGRlbGV0aW9uKC0pCgpkaWZmIC0tZ2l0
IGEvYXJjaC94ODYveGVuL3NldHVwLmMgYi9hcmNoL3g4Ni94ZW4vc2V0dXAuYwppbmRleCA4
MDZkZGIyMzkxZDkuLjRiY2M3MGE3MWI3ZCAxMDA2NDQKLS0tIGEvYXJjaC94ODYveGVuL3Nl
dHVwLmMKKysrIGIvYXJjaC94ODYveGVuL3NldHVwLmMKQEAgLTgyNSw3ICs4MjUsNyBAQCBj
aGFyICogX19pbml0IHhlbl9tZW1vcnlfc2V0dXAodm9pZCkKIAkgKiB0byByZWxvY2F0aW5n
IChhbmQgZXZlbiByZXVzaW5nKSBwYWdlcyB3aXRoIGtlcm5lbCB0ZXh0IG9yIGRhdGEuCiAJ
ICovCiAJaWYgKHhlbl9pc19lODIwX3Jlc2VydmVkKF9fcGFfc3ltYm9sKF90ZXh0KSwKLQkJ
CV9fcGFfc3ltYm9sKF9fYnNzX3N0b3ApIC0gX19wYV9zeW1ib2woX3RleHQpKSkgeworCQkJ
CSBfX3BhX3N5bWJvbChfZW5kKSAtIF9fcGFfc3ltYm9sKF90ZXh0KSkpIHsKIAkJeGVuX3Jh
d19jb25zb2xlX3dyaXRlKCJYZW4gaHlwZXJ2aXNvciBhbGxvY2F0ZWQga2VybmVsIG1lbW9y
eSBjb25mbGljdHMgd2l0aCBFODIwIG1hcFxuIik7CiAJCUJVRygpOwogCX0KLS0gCjIuNDMu
MAoK
--------------AQ4HBPRyjOeE3SI2rjxB1tor
Content-Type: text/x-patch; charset=UTF-8;
 name="0002-xen-introduce-generic-helper-checking-for-memory-map.patch"
Content-Disposition: attachment;
 filename*0="0002-xen-introduce-generic-helper-checking-for-memory-map.pa";
 filename*1="tch"
Content-Transfer-Encoding: base64

RnJvbSBjMDNiNzU1ZTI3MzYzOWI4NjVkMzUxYmExZDM2NjI1ZmM4YjI3OTFlIE1vbiBTZXAg
MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKdWVyZ2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+
CkRhdGU6IEZyaSwgMiBBdWcgMjAyNCAxNDoxMTowNiArMDIwMApTdWJqZWN0OiBbUEFUQ0gg
Mi81XSB4ZW46IGludHJvZHVjZSBnZW5lcmljIGhlbHBlciBjaGVja2luZyBmb3IgbWVtb3J5
IG1hcAogY29uZmxpY3RzCgpXaGVuIGJvb3RpbmcgYXMgYSBYZW4gUFYgZG9tMCB0aGUgbWVt
b3J5IGxheW91dCBvZiB0aGUgZG9tMCBpcwptb2RpZmllZCB0byBtYXRjaCB0aGF0IG9mIHRo
ZSBob3N0LCBhcyB0aGlzIHJlcXVpcmVzIGxlc3MgY2hhbmdlcyBpbgp0aGUga2VybmVsIGZv
ciBzdXBwb3J0aW5nIFhlbi4KClRoZXJlIGFyZSBzb21lIGNhc2VzLCB0aG91Z2gsIHdoaWNo
IGFyZSBwcm9ibGVtYXRpYywgYXMgaXQgaXMgdGhlIFhlbgpoeXBlcnZpc29yIHNlbGVjdGlu
ZyB0aGUga2VybmVsJ3MgbG9hZCBhZGRyZXNzIHBsdXMgc29tZSBvdGhlciBkYXRhLAp3aGlj
aCBtaWdodCBjb25mbGljdCB3aXRoIHRoZSBob3N0J3MgbWVtb3J5IG1hcC4KClRoZXNlIGNv
bmZsaWN0cyBhcmUgZGV0ZWN0ZWQgYXQgYm9vdCB0aW1lIGFuZCByZXN1bHQgaW4gYSBib290
IGVycm9yLgpJbiBvcmRlciB0byBzdXBwb3J0IGhhbmRsaW5nIGF0IGxlYXN0IHNvbWUgb2Yg
dGhlc2UgY29uZmxpY3RzIGluCmZ1dHVyZSwgaW50cm9kdWNlIGEgZ2VuZXJpYyBoZWxwZXIg
ZnVuY3Rpb24gd2hpY2ggd2lsbCBsYXRlciBnYWluIHRoZQphYmlsaXR5IHRvIGFkYXB0IHRo
ZSBtZW1vcnkgbGF5b3V0IHdoZW4gcG9zc2libGUuCgpBZGQgdGhlIG1pc3NpbmcgY2hlY2sg
Zm9yIHRoZSB4ZW5fc3RhcnRfaW5mbyBhcmVhLgoKU2lnbmVkLW9mZi1ieTogSnVlcmdlbiBH
cm9zcyA8amdyb3NzQHN1c2UuY29tPgotLS0KIGFyY2gveDg2L3hlbi9tbXVfcHYuYyAgfCAg
NSArLS0tLQogYXJjaC94ODYveGVuL3NldHVwLmMgICB8IDM0ICsrKysrKysrKysrKysrKysr
KysrKysrKysrKystLS0tLS0KIGFyY2gveDg2L3hlbi94ZW4tb3BzLmggfCAgMyArKy0KIDMg
ZmlsZXMgY2hhbmdlZCwgMzEgaW5zZXJ0aW9ucygrKSwgMTEgZGVsZXRpb25zKC0pCgpkaWZm
IC0tZ2l0IGEvYXJjaC94ODYveGVuL21tdV9wdi5jIGIvYXJjaC94ODYveGVuL21tdV9wdi5j
CmluZGV4IGYxY2UzOWQ2ZDMyYy4uODM5ZTY2MTM3NTNkIDEwMDY0NAotLS0gYS9hcmNoL3g4
Ni94ZW4vbW11X3B2LmMKKysrIGIvYXJjaC94ODYveGVuL21tdV9wdi5jCkBAIC0yMDE4LDEw
ICsyMDE4LDcgQEAgdm9pZCBfX2luaXQgeGVuX3Jlc2VydmVfc3BlY2lhbF9wYWdlcyh2b2lk
KQogCiB2b2lkIF9faW5pdCB4ZW5fcHRfY2hlY2tfZTgyMCh2b2lkKQogewotCWlmICh4ZW5f
aXNfZTgyMF9yZXNlcnZlZCh4ZW5fcHRfYmFzZSwgeGVuX3B0X3NpemUpKSB7Ci0JCXhlbl9y
YXdfY29uc29sZV93cml0ZSgiWGVuIGh5cGVydmlzb3IgYWxsb2NhdGVkIHBhZ2UgdGFibGUg
bWVtb3J5IGNvbmZsaWN0cyB3aXRoIEU4MjAgbWFwXG4iKTsKLQkJQlVHKCk7Ci0JfQorCXhl
bl9jaGtfaXNfZTgyMF91c2FibGUoeGVuX3B0X2Jhc2UsIHhlbl9wdF9zaXplLCAicGFnZSB0
YWJsZSIpOwogfQogCiBzdGF0aWMgdW5zaWduZWQgY2hhciBkdW1teV9tYXBwaW5nW1BBR0Vf
U0laRV0gX19wYWdlX2FsaWduZWRfYnNzOwpkaWZmIC0tZ2l0IGEvYXJjaC94ODYveGVuL3Nl
dHVwLmMgYi9hcmNoL3g4Ni94ZW4vc2V0dXAuYwppbmRleCA0YmNjNzBhNzFiN2QuLjk2NzY1
MTgwNTE0YiAxMDA2NDQKLS0tIGEvYXJjaC94ODYveGVuL3NldHVwLmMKKysrIGIvYXJjaC94
ODYveGVuL3NldHVwLmMKQEAgLTU2Nyw3ICs1NjcsNyBAQCBzdGF0aWMgdm9pZCBfX2luaXQg
eGVuX2lnbm9yZV91bnVzYWJsZSh2b2lkKQogCX0KIH0KIAotYm9vbCBfX2luaXQgeGVuX2lz
X2U4MjBfcmVzZXJ2ZWQocGh5c19hZGRyX3Qgc3RhcnQsIHBoeXNfYWRkcl90IHNpemUpCitz
dGF0aWMgYm9vbCBfX2luaXQgeGVuX2lzX2U4MjBfcmVzZXJ2ZWQocGh5c19hZGRyX3Qgc3Rh
cnQsIHBoeXNfYWRkcl90IHNpemUpCiB7CiAJc3RydWN0IGU4MjBfZW50cnkgKmVudHJ5Owog
CXVuc2lnbmVkIG1hcGNudDsKQEAgLTYyNCw2ICs2MjQsMjMgQEAgcGh5c19hZGRyX3QgX19p
bml0IHhlbl9maW5kX2ZyZWVfYXJlYShwaHlzX2FkZHJfdCBzaXplKQogCXJldHVybiAwOwog
fQogCisvKgorICogQ2hlY2sgZm9yIGFuIGFyZWEgaW4gcGh5c2ljYWwgbWVtb3J5IHRvIGJl
IHVzYWJsZSBmb3Igbm9uLW1vdmFibGUgcHVycG9zZXMuCisgKiBBbiBhcmVhIGlzIGNvbnNp
ZGVyZWQgdG8gdXNhYmxlIGlmIHRoZSB1c2VkIEU4MjAgbWFwIGxpc3RzIGl0IHRvIGJlIFJB
TS4KKyAqIEluIGNhc2UgdGhlIGFyZWEgaXMgbm90IHVzYWJsZSwgY3Jhc2ggdGhlIHN5c3Rl
bSB3aXRoIGFuIGVycm9yIG1lc3NhZ2UuCisgKi8KK3ZvaWQgX19pbml0IHhlbl9jaGtfaXNf
ZTgyMF91c2FibGUocGh5c19hZGRyX3Qgc3RhcnQsIHBoeXNfYWRkcl90IHNpemUsCisJCQkJ
ICAgY29uc3QgY2hhciAqY29tcG9uZW50KQoreworCWlmICgheGVuX2lzX2U4MjBfcmVzZXJ2
ZWQoc3RhcnQsIHNpemUpKQorCQlyZXR1cm47CisKKwl4ZW5fcmF3X2NvbnNvbGVfd3JpdGUo
IlhlbiBoeXBlcnZpc29yIGFsbG9jYXRlZCAiKTsKKwl4ZW5fcmF3X2NvbnNvbGVfd3JpdGUo
Y29tcG9uZW50KTsKKwl4ZW5fcmF3X2NvbnNvbGVfd3JpdGUoIiBtZW1vcnkgY29uZmxpY3Rz
IHdpdGggRTgyMCBtYXBcbiIpOworCUJVRygpOworfQorCiAvKgogICogTGlrZSBtZW1jcHks
IGJ1dCB3aXRoIHBoeXNpY2FsIGFkZHJlc3NlcyBmb3IgZGVzdCBhbmQgc3JjLgogICovCkBA
IC04MjQsMTEgKzg0MSwxNiBAQCBjaGFyICogX19pbml0IHhlbl9tZW1vcnlfc2V0dXAodm9p
ZCkKIAkgKiBGYWlsaW5nIG5vdyBpcyBiZXR0ZXIgdGhhbiBydW5uaW5nIGludG8gd2VpcmQg
cHJvYmxlbXMgbGF0ZXIgZHVlCiAJICogdG8gcmVsb2NhdGluZyAoYW5kIGV2ZW4gcmV1c2lu
ZykgcGFnZXMgd2l0aCBrZXJuZWwgdGV4dCBvciBkYXRhLgogCSAqLwotCWlmICh4ZW5faXNf
ZTgyMF9yZXNlcnZlZChfX3BhX3N5bWJvbChfdGV4dCksCi0JCQkJIF9fcGFfc3ltYm9sKF9l
bmQpIC0gX19wYV9zeW1ib2woX3RleHQpKSkgewotCQl4ZW5fcmF3X2NvbnNvbGVfd3JpdGUo
IlhlbiBoeXBlcnZpc29yIGFsbG9jYXRlZCBrZXJuZWwgbWVtb3J5IGNvbmZsaWN0cyB3aXRo
IEU4MjAgbWFwXG4iKTsKLQkJQlVHKCk7Ci0JfQorCXhlbl9jaGtfaXNfZTgyMF91c2FibGUo
X19wYV9zeW1ib2woX3RleHQpLAorCQkJICAgICAgIF9fcGFfc3ltYm9sKF9lbmQpIC0gX19w
YV9zeW1ib2woX3RleHQpLAorCQkJICAgICAgICJrZXJuZWwiKTsKKworCS8qCisJICogQ2hl
Y2sgZm9yIGEgY29uZmxpY3Qgb2YgdGhlIHhlbl9zdGFydF9pbmZvIG1lbW9yeSB3aXRoIHRo
ZSB0YXJnZXQKKwkgKiBFODIwIG1hcC4KKwkgKi8KKwl4ZW5fY2hrX2lzX2U4MjBfdXNhYmxl
KF9fcGEoeGVuX3N0YXJ0X2luZm8pLCBzaXplb2YoKnhlbl9zdGFydF9pbmZvKSwKKwkJCSAg
ICAgICAieGVuX3N0YXJ0X2luZm8iKTsKIAogCS8qCiAJICogQ2hlY2sgZm9yIGEgY29uZmxp
Y3Qgb2YgdGhlIGh5cGVydmlzb3Igc3VwcGxpZWQgcGFnZSB0YWJsZXMgd2l0aApkaWZmIC0t
Z2l0IGEvYXJjaC94ODYveGVuL3hlbi1vcHMuaCBiL2FyY2gveDg2L3hlbi94ZW4tb3BzLmgK
aW5kZXggMGNmMTZmYzc5ZTBiLi45YTI3ZDFkNjUzZDMgMTAwNjQ0Ci0tLSBhL2FyY2gveDg2
L3hlbi94ZW4tb3BzLmgKKysrIGIvYXJjaC94ODYveGVuL3hlbi1vcHMuaApAQCAtNDgsNyAr
NDgsOCBAQCB2b2lkIHhlbl9tbV91bnBpbl9hbGwodm9pZCk7CiB2b2lkIF9faW5pdCB4ZW5f
cmVsb2NhdGVfcDJtKHZvaWQpOwogI2VuZGlmCiAKLWJvb2wgX19pbml0IHhlbl9pc19lODIw
X3Jlc2VydmVkKHBoeXNfYWRkcl90IHN0YXJ0LCBwaHlzX2FkZHJfdCBzaXplKTsKK3ZvaWQg
X19pbml0IHhlbl9jaGtfaXNfZTgyMF91c2FibGUocGh5c19hZGRyX3Qgc3RhcnQsIHBoeXNf
YWRkcl90IHNpemUsCisJCQkJICAgY29uc3QgY2hhciAqY29tcG9uZW50KTsKIHVuc2lnbmVk
IGxvbmcgX19yZWYgeGVuX2Noa19leHRyYV9tZW0odW5zaWduZWQgbG9uZyBwZm4pOwogdm9p
ZCBfX2luaXQgeGVuX2ludl9leHRyYV9tZW0odm9pZCk7CiB2b2lkIF9faW5pdCB4ZW5fcmVt
YXBfbWVtb3J5KHZvaWQpOwotLSAKMi40My4wCgo=
--------------AQ4HBPRyjOeE3SI2rjxB1tor
Content-Type: text/x-patch; charset=UTF-8;
 name="0003-xen-move-checks-for-e820-conflicts-further-up.patch"
Content-Disposition: attachment;
 filename="0003-xen-move-checks-for-e820-conflicts-further-up.patch"
Content-Transfer-Encoding: base64

RnJvbSA5MmJlYTkxMDdjNzc2NTc4YzQxNWM1NmI0ZjZiM2M3YmNhOTBjN2U5IE1vbiBTZXAg
MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKdWVyZ2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+
CkRhdGU6IFR1ZSwgNiBBdWcgMjAyNCAwOTo1Njo0OCArMDIwMApTdWJqZWN0OiBbUEFUQ0gg
My81XSB4ZW46IG1vdmUgY2hlY2tzIGZvciBlODIwIGNvbmZsaWN0cyBmdXJ0aGVyIHVwCgpN
b3ZlIHRoZSBjaGVja3MgZm9yIGU4MjAgbWVtb3J5IG1hcCBjb25mbGljdHMgdXNpbmcgdGhl
Cnhlbl9jaGtfaXNfZTgyMF91c2FibGUoKSBoZWxwZXIgZnVydGhlciB1cCBpbiBvcmRlciB0
byBwcmVwYXJlCnJlc29sdmluZyBzb21lIG9mIHRoZSBwb3NzaWJsZSBjb25mbGljdHMgYnkg
ZG9pbmcgc29tZSBlODIwIG1hcAptb2RpZmljYXRpb25zLCB3aGljaCBtdXN0IGhhcHBlbiBi
ZWZvcmUgZXZhbHVhdGluZyB0aGUgUkFNIGxheW91dC4KClNpZ25lZC1vZmYtYnk6IEp1ZXJn
ZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT4KLS0tCiBhcmNoL3g4Ni94ZW4vc2V0dXAuYyB8
IDQ0ICsrKysrKysrKysrKysrKysrKysrKystLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAxIGZp
bGUgY2hhbmdlZCwgMjIgaW5zZXJ0aW9ucygrKSwgMjIgZGVsZXRpb25zKC0pCgpkaWZmIC0t
Z2l0IGEvYXJjaC94ODYveGVuL3NldHVwLmMgYi9hcmNoL3g4Ni94ZW4vc2V0dXAuYwppbmRl
eCA5Njc2NTE4MDUxNGIuLmRiYTY4OTUxZWQ2YiAxMDA2NDQKLS0tIGEvYXJjaC94ODYveGVu
L3NldHVwLmMKKysrIGIvYXJjaC94ODYveGVuL3NldHVwLmMKQEAgLTc2NCw2ICs3NjQsMjgg
QEAgY2hhciAqIF9faW5pdCB4ZW5fbWVtb3J5X3NldHVwKHZvaWQpCiAJLyogTWFrZSBzdXJl
IHRoZSBYZW4tc3VwcGxpZWQgbWVtb3J5IG1hcCBpcyB3ZWxsLW9yZGVyZWQuICovCiAJZTgy
MF9fdXBkYXRlX3RhYmxlKCZ4ZW5fZTgyMF90YWJsZSk7CiAKKwkvKgorCSAqIENoZWNrIHdo
ZXRoZXIgdGhlIGtlcm5lbCBpdHNlbGYgY29uZmxpY3RzIHdpdGggdGhlIHRhcmdldCBFODIw
IG1hcC4KKwkgKiBGYWlsaW5nIG5vdyBpcyBiZXR0ZXIgdGhhbiBydW5uaW5nIGludG8gd2Vp
cmQgcHJvYmxlbXMgbGF0ZXIgZHVlCisJICogdG8gcmVsb2NhdGluZyAoYW5kIGV2ZW4gcmV1
c2luZykgcGFnZXMgd2l0aCBrZXJuZWwgdGV4dCBvciBkYXRhLgorCSAqLworCXhlbl9jaGtf
aXNfZTgyMF91c2FibGUoX19wYV9zeW1ib2woX3RleHQpLAorCQkJICAgICAgIF9fcGFfc3lt
Ym9sKF9lbmQpIC0gX19wYV9zeW1ib2woX3RleHQpLAorCQkJICAgICAgICJrZXJuZWwiKTsK
KworCS8qCisJICogQ2hlY2sgZm9yIGEgY29uZmxpY3Qgb2YgdGhlIHhlbl9zdGFydF9pbmZv
IG1lbW9yeSB3aXRoIHRoZSB0YXJnZXQKKwkgKiBFODIwIG1hcC4KKwkgKi8KKwl4ZW5fY2hr
X2lzX2U4MjBfdXNhYmxlKF9fcGEoeGVuX3N0YXJ0X2luZm8pLCBzaXplb2YoKnhlbl9zdGFy
dF9pbmZvKSwKKwkJCSAgICAgICAieGVuX3N0YXJ0X2luZm8iKTsKKworCS8qCisJICogQ2hl
Y2sgZm9yIGEgY29uZmxpY3Qgb2YgdGhlIGh5cGVydmlzb3Igc3VwcGxpZWQgcGFnZSB0YWJs
ZXMgd2l0aAorCSAqIHRoZSB0YXJnZXQgRTgyMCBtYXAuCisJICovCisJeGVuX3B0X2NoZWNr
X2U4MjAoKTsKKwogCW1heF9wYWdlcyA9IHhlbl9nZXRfbWF4X3BhZ2VzKCk7CiAKIAkvKiBI
b3cgbWFueSBleHRyYSBwYWdlcyBkbyB3ZSBuZWVkIGR1ZSB0byByZW1hcHBpbmc/ICovCkBA
IC04MzYsMjggKzg1OCw2IEBAIGNoYXIgKiBfX2luaXQgeGVuX21lbW9yeV9zZXR1cCh2b2lk
KQogCiAJZTgyMF9fdXBkYXRlX3RhYmxlKGU4MjBfdGFibGUpOwogCi0JLyoKLQkgKiBDaGVj
ayB3aGV0aGVyIHRoZSBrZXJuZWwgaXRzZWxmIGNvbmZsaWN0cyB3aXRoIHRoZSB0YXJnZXQg
RTgyMCBtYXAuCi0JICogRmFpbGluZyBub3cgaXMgYmV0dGVyIHRoYW4gcnVubmluZyBpbnRv
IHdlaXJkIHByb2JsZW1zIGxhdGVyIGR1ZQotCSAqIHRvIHJlbG9jYXRpbmcgKGFuZCBldmVu
IHJldXNpbmcpIHBhZ2VzIHdpdGgga2VybmVsIHRleHQgb3IgZGF0YS4KLQkgKi8KLQl4ZW5f
Y2hrX2lzX2U4MjBfdXNhYmxlKF9fcGFfc3ltYm9sKF90ZXh0KSwKLQkJCSAgICAgICBfX3Bh
X3N5bWJvbChfZW5kKSAtIF9fcGFfc3ltYm9sKF90ZXh0KSwKLQkJCSAgICAgICAia2VybmVs
Iik7Ci0KLQkvKgotCSAqIENoZWNrIGZvciBhIGNvbmZsaWN0IG9mIHRoZSB4ZW5fc3RhcnRf
aW5mbyBtZW1vcnkgd2l0aCB0aGUgdGFyZ2V0Ci0JICogRTgyMCBtYXAuCi0JICovCi0JeGVu
X2Noa19pc19lODIwX3VzYWJsZShfX3BhKHhlbl9zdGFydF9pbmZvKSwgc2l6ZW9mKCp4ZW5f
c3RhcnRfaW5mbyksCi0JCQkgICAgICAgInhlbl9zdGFydF9pbmZvIik7Ci0KLQkvKgotCSAq
IENoZWNrIGZvciBhIGNvbmZsaWN0IG9mIHRoZSBoeXBlcnZpc29yIHN1cHBsaWVkIHBhZ2Ug
dGFibGVzIHdpdGgKLQkgKiB0aGUgdGFyZ2V0IEU4MjAgbWFwLgotCSAqLwotCXhlbl9wdF9j
aGVja19lODIwKCk7Ci0KIAl4ZW5fcmVzZXJ2ZV94ZW5fbWZubGlzdCgpOwogCiAJLyogQ2hl
Y2sgZm9yIGEgY29uZmxpY3Qgb2YgdGhlIGluaXRyZCB3aXRoIHRoZSB0YXJnZXQgRTgyMCBt
YXAuICovCi0tIAoyLjQzLjAKCg==
--------------AQ4HBPRyjOeE3SI2rjxB1tor
Content-Type: text/x-patch; charset=UTF-8;
 name="0004-xen-move-max_pfn-in-xen_memory_setup-out-of-function.patch"
Content-Disposition: attachment;
 filename*0="0004-xen-move-max_pfn-in-xen_memory_setup-out-of-function.pa";
 filename*1="tch"
Content-Transfer-Encoding: base64

RnJvbSAxMDFlNmIxOWJjNjkwNmJhMDY5YjIwYWQ0MWJjZjU1Nzc1OTQzOTlhIE1vbiBTZXAg
MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKdWVyZ2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+
CkRhdGU6IFR1ZSwgNiBBdWcgMjAyNCAxMDoyNDo0MSArMDIwMApTdWJqZWN0OiBbUEFUQ0gg
NC81XSB4ZW46IG1vdmUgbWF4X3BmbiBpbiB4ZW5fbWVtb3J5X3NldHVwKCkgb3V0IG9mIGZ1
bmN0aW9uCiBzY29wZQoKSW5zdGVhZCBvZiBoYXZpbmcgbWF4X3BmbiBhcyBhIGxvY2FsIHZh
cmlhYmxlIG9mIHhlbl9tZW1vcnlfc2V0dXAoKSwKbWFrZSBpdCBhIHN0YXRpYyB2YXJpYWJs
ZSBpbiBzZXR1cC5jIGluc3RlYWQuIFRoaXMgYXZvaWRzIGhhdmluZyB0bwpwYXNzIGl0IHRv
IHN1YmZ1bmN0aW9ucywgd2hpY2ggd2lsbCBiZSBuZWVkZWQgaW4gbW9yZSBjYXNlcyBpbiBm
dXR1cmUuCgpSZW5hbWUgaXQgdG8gaW5pX25yX3BhZ2VzLCBhcyB0aGUgdmFsdWUgZGVub3Rl
cyB0aGUgY3VycmVudGx5IHVzYWJsZQpudW1iZXIgb2YgbWVtb3J5IHBhZ2VzIGFzIHBhc3Nl
ZCBmcm9tIHRoZSBoeXBlcnZpc29yIGF0IGJvb3QgdGltZS4KClNpZ25lZC1vZmYtYnk6IEp1
ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT4KLS0tCiBhcmNoL3g4Ni94ZW4vc2V0dXAu
YyB8IDUzICsrKysrKysrKysrKysrKysrKysrKystLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAx
IGZpbGUgY2hhbmdlZCwgMjcgaW5zZXJ0aW9ucygrKSwgMjYgZGVsZXRpb25zKC0pCgpkaWZm
IC0tZ2l0IGEvYXJjaC94ODYveGVuL3NldHVwLmMgYi9hcmNoL3g4Ni94ZW4vc2V0dXAuYwpp
bmRleCBkYmE2ODk1MWVkNmIuLmQ2NzhjMDMzMDk3MSAxMDA2NDQKLS0tIGEvYXJjaC94ODYv
eGVuL3NldHVwLmMKKysrIGIvYXJjaC94ODYveGVuL3NldHVwLmMKQEAgLTQ2LDYgKzQ2LDkg
QEAgYm9vbCB4ZW5fcHZfcGNpX3Bvc3NpYmxlOwogLyogRTgyMCBtYXAgdXNlZCBkdXJpbmcg
c2V0dGluZyB1cCBtZW1vcnkuICovCiBzdGF0aWMgc3RydWN0IGU4MjBfdGFibGUgeGVuX2U4
MjBfdGFibGUgX19pbml0ZGF0YTsKIAorLyogTnVtYmVyIG9mIGluaXRpYWxseSB1c2FibGUg
bWVtb3J5IHBhZ2VzLiAqLworc3RhdGljIHVuc2lnbmVkIGxvbmcgaW5pX25yX3BhZ2VzIF9f
aW5pdGRhdGE7CisKIC8qCiAgKiBCdWZmZXIgdXNlZCB0byByZW1hcCBpZGVudGl0eSBtYXBw
ZWQgcGFnZXMuIFdlIG9ubHkgbmVlZCB0aGUgdmlydHVhbCBzcGFjZS4KICAqIFRoZSBwaHlz
aWNhbCBwYWdlIGJlaGluZCB0aGlzIGFkZHJlc3MgaXMgcmVtYXBwZWQgYXMgbmVlZGVkIHRv
IGRpZmZlcmVudApAQCAtMjEyLDcgKzIxNSw3IEBAIHN0YXRpYyBpbnQgX19pbml0IHhlbl9m
cmVlX21mbih1bnNpZ25lZCBsb25nIG1mbikKICAqIGFzIGEgZmFsbGJhY2sgaWYgdGhlIHJl
bWFwcGluZyBmYWlscy4KICAqLwogc3RhdGljIHZvaWQgX19pbml0IHhlbl9zZXRfaWRlbnRp
dHlfYW5kX3JlbGVhc2VfY2h1bmsodW5zaWduZWQgbG9uZyBzdGFydF9wZm4sCi0JCQl1bnNp
Z25lZCBsb25nIGVuZF9wZm4sIHVuc2lnbmVkIGxvbmcgbnJfcGFnZXMpCisJCQkJCQkgICAg
ICB1bnNpZ25lZCBsb25nIGVuZF9wZm4pCiB7CiAJdW5zaWduZWQgbG9uZyBwZm4sIGVuZDsK
IAlpbnQgcmV0OwpAQCAtMjIwLDcgKzIyMyw3IEBAIHN0YXRpYyB2b2lkIF9faW5pdCB4ZW5f
c2V0X2lkZW50aXR5X2FuZF9yZWxlYXNlX2NodW5rKHVuc2lnbmVkIGxvbmcgc3RhcnRfcGZu
LAogCVdBUk5fT04oc3RhcnRfcGZuID4gZW5kX3Bmbik7CiAKIAkvKiBSZWxlYXNlIHBhZ2Vz
IGZpcnN0LiAqLwotCWVuZCA9IG1pbihlbmRfcGZuLCBucl9wYWdlcyk7CisJZW5kID0gbWlu
KGVuZF9wZm4sIGluaV9ucl9wYWdlcyk7CiAJZm9yIChwZm4gPSBzdGFydF9wZm47IHBmbiA8
IGVuZDsgcGZuKyspIHsKIAkJdW5zaWduZWQgbG9uZyBtZm4gPSBwZm5fdG9fbWZuKHBmbik7
CiAKQEAgLTM0MSwxNSArMzQ0LDE0IEBAIHN0YXRpYyB2b2lkIF9faW5pdCB4ZW5fZG9fc2V0
X2lkZW50aXR5X2FuZF9yZW1hcF9jaHVuaygKICAqIHRvIFhlbiBhbmQgbm90IHJlbWFwcGVk
LgogICovCiBzdGF0aWMgdW5zaWduZWQgbG9uZyBfX2luaXQgeGVuX3NldF9pZGVudGl0eV9h
bmRfcmVtYXBfY2h1bmsoCi0JdW5zaWduZWQgbG9uZyBzdGFydF9wZm4sIHVuc2lnbmVkIGxv
bmcgZW5kX3BmbiwgdW5zaWduZWQgbG9uZyBucl9wYWdlcywKLQl1bnNpZ25lZCBsb25nIHJl
bWFwX3BmbikKKwl1bnNpZ25lZCBsb25nIHN0YXJ0X3BmbiwgdW5zaWduZWQgbG9uZyBlbmRf
cGZuLCB1bnNpZ25lZCBsb25nIHJlbWFwX3BmbikKIHsKIAl1bnNpZ25lZCBsb25nIHBmbjsK
IAl1bnNpZ25lZCBsb25nIGkgPSAwOwogCXVuc2lnbmVkIGxvbmcgbiA9IGVuZF9wZm4gLSBz
dGFydF9wZm47CiAKIAlpZiAocmVtYXBfcGZuID09IDApCi0JCXJlbWFwX3BmbiA9IG5yX3Bh
Z2VzOworCQlyZW1hcF9wZm4gPSBpbmlfbnJfcGFnZXM7CiAKIAl3aGlsZSAoaSA8IG4pIHsK
IAkJdW5zaWduZWQgbG9uZyBjdXJfcGZuID0gc3RhcnRfcGZuICsgaTsKQEAgLTM1OCwxOSAr
MzYwLDE5IEBAIHN0YXRpYyB1bnNpZ25lZCBsb25nIF9faW5pdCB4ZW5fc2V0X2lkZW50aXR5
X2FuZF9yZW1hcF9jaHVuaygKIAkJdW5zaWduZWQgbG9uZyByZW1hcF9yYW5nZV9zaXplOwog
CiAJCS8qIERvIG5vdCByZW1hcCBwYWdlcyBiZXlvbmQgdGhlIGN1cnJlbnQgYWxsb2NhdGlv
biAqLwotCQlpZiAoY3VyX3BmbiA+PSBucl9wYWdlcykgeworCQlpZiAoY3VyX3BmbiA+PSBp
bmlfbnJfcGFnZXMpIHsKIAkJCS8qIElkZW50aXR5IG1hcCByZW1haW5pbmcgcGFnZXMgKi8K
IAkJCXNldF9waHlzX3JhbmdlX2lkZW50aXR5KGN1cl9wZm4sIGN1cl9wZm4gKyBzaXplKTsK
IAkJCWJyZWFrOwogCQl9Ci0JCWlmIChjdXJfcGZuICsgc2l6ZSA+IG5yX3BhZ2VzKQotCQkJ
c2l6ZSA9IG5yX3BhZ2VzIC0gY3VyX3BmbjsKKwkJaWYgKGN1cl9wZm4gKyBzaXplID4gaW5p
X25yX3BhZ2VzKQorCQkJc2l6ZSA9IGluaV9ucl9wYWdlcyAtIGN1cl9wZm47CiAKIAkJcmVt
YXBfcmFuZ2Vfc2l6ZSA9IHhlbl9maW5kX3Bmbl9yYW5nZSgmcmVtYXBfcGZuKTsKIAkJaWYg
KCFyZW1hcF9yYW5nZV9zaXplKSB7CiAJCQlwcl93YXJuKCJVbmFibGUgdG8gZmluZCBhdmFp
bGFibGUgcGZuIHJhbmdlLCBub3QgcmVtYXBwaW5nIGlkZW50aXR5IHBhZ2VzXG4iKTsKIAkJ
CXhlbl9zZXRfaWRlbnRpdHlfYW5kX3JlbGVhc2VfY2h1bmsoY3VyX3BmbiwKLQkJCQkJCWN1
cl9wZm4gKyBsZWZ0LCBucl9wYWdlcyk7CisJCQkJCQkJICAgY3VyX3BmbiArIGxlZnQpOwog
CQkJYnJlYWs7CiAJCX0KIAkJLyogQWRqdXN0IHNpemUgdG8gZml0IGluIGN1cnJlbnQgZTgy
MCBSQU0gcmVnaW9uICovCkBAIC0zOTcsMTggKzM5OSwxOCBAQCBzdGF0aWMgdW5zaWduZWQg
bG9uZyBfX2luaXQgeGVuX3NldF9pZGVudGl0eV9hbmRfcmVtYXBfY2h1bmsoCiB9CiAKIHN0
YXRpYyB1bnNpZ25lZCBsb25nIF9faW5pdCB4ZW5fY291bnRfcmVtYXBfcGFnZXMoCi0JdW5z
aWduZWQgbG9uZyBzdGFydF9wZm4sIHVuc2lnbmVkIGxvbmcgZW5kX3BmbiwgdW5zaWduZWQg
bG9uZyBucl9wYWdlcywKKwl1bnNpZ25lZCBsb25nIHN0YXJ0X3BmbiwgdW5zaWduZWQgbG9u
ZyBlbmRfcGZuLAogCXVuc2lnbmVkIGxvbmcgcmVtYXBfcGFnZXMpCiB7Ci0JaWYgKHN0YXJ0
X3BmbiA+PSBucl9wYWdlcykKKwlpZiAoc3RhcnRfcGZuID49IGluaV9ucl9wYWdlcykKIAkJ
cmV0dXJuIHJlbWFwX3BhZ2VzOwogCi0JcmV0dXJuIHJlbWFwX3BhZ2VzICsgbWluKGVuZF9w
Zm4sIG5yX3BhZ2VzKSAtIHN0YXJ0X3BmbjsKKwlyZXR1cm4gcmVtYXBfcGFnZXMgKyBtaW4o
ZW5kX3BmbiwgaW5pX25yX3BhZ2VzKSAtIHN0YXJ0X3BmbjsKIH0KIAotc3RhdGljIHVuc2ln
bmVkIGxvbmcgX19pbml0IHhlbl9mb3JlYWNoX3JlbWFwX2FyZWEodW5zaWduZWQgbG9uZyBu
cl9wYWdlcywKK3N0YXRpYyB1bnNpZ25lZCBsb25nIF9faW5pdCB4ZW5fZm9yZWFjaF9yZW1h
cF9hcmVhKAogCXVuc2lnbmVkIGxvbmcgKCpmdW5jKSh1bnNpZ25lZCBsb25nIHN0YXJ0X3Bm
biwgdW5zaWduZWQgbG9uZyBlbmRfcGZuLAotCQkJICAgICAgdW5zaWduZWQgbG9uZyBucl9w
YWdlcywgdW5zaWduZWQgbG9uZyBsYXN0X3ZhbCkpCisJCQkgICAgICB1bnNpZ25lZCBsb25n
IGxhc3RfdmFsKSkKIHsKIAlwaHlzX2FkZHJfdCBzdGFydCA9IDA7CiAJdW5zaWduZWQgbG9u
ZyByZXRfdmFsID0gMDsKQEAgLTQzNiw4ICs0MzgsNyBAQCBzdGF0aWMgdW5zaWduZWQgbG9u
ZyBfX2luaXQgeGVuX2ZvcmVhY2hfcmVtYXBfYXJlYSh1bnNpZ25lZCBsb25nIG5yX3BhZ2Vz
LAogCQkJCWVuZF9wZm4gPSBQRk5fVVAoZW50cnktPmFkZHIpOwogCiAJCQlpZiAoc3RhcnRf
cGZuIDwgZW5kX3BmbikKLQkJCQlyZXRfdmFsID0gZnVuYyhzdGFydF9wZm4sIGVuZF9wZm4s
IG5yX3BhZ2VzLAotCQkJCQkgICAgICAgcmV0X3ZhbCk7CisJCQkJcmV0X3ZhbCA9IGZ1bmMo
c3RhcnRfcGZuLCBlbmRfcGZuLCByZXRfdmFsKTsKIAkJCXN0YXJ0ID0gZW5kOwogCQl9CiAJ
fQpAQCAtNzAwLDcgKzcwMSw3IEBAIHN0YXRpYyB2b2lkIF9faW5pdCB4ZW5fcmVzZXJ2ZV94
ZW5fbWZubGlzdCh2b2lkKQogICoqLwogY2hhciAqIF9faW5pdCB4ZW5fbWVtb3J5X3NldHVw
KHZvaWQpCiB7Ci0JdW5zaWduZWQgbG9uZyBtYXhfcGZuLCBwZm5fcywgbl9wZm5zOworCXVu
c2lnbmVkIGxvbmcgcGZuX3MsIG5fcGZuczsKIAlwaHlzX2FkZHJfdCBtZW1fZW5kLCBhZGRy
LCBzaXplLCBjaHVua19zaXplOwogCXUzMiB0eXBlOwogCWludCByYzsKQEAgLTcxMiw5ICs3
MTMsOSBAQCBjaGFyICogX19pbml0IHhlbl9tZW1vcnlfc2V0dXAodm9pZCkKIAlpbnQgb3A7
CiAKIAl4ZW5fcGFyc2VfNTEyZ2IoKTsKLQltYXhfcGZuID0geGVuX2dldF9wYWdlc19saW1p
dCgpOwotCW1heF9wZm4gPSBtaW4obWF4X3BmbiwgeGVuX3N0YXJ0X2luZm8tPm5yX3BhZ2Vz
KTsKLQltZW1fZW5kID0gUEZOX1BIWVMobWF4X3Bmbik7CisJaW5pX25yX3BhZ2VzID0geGVu
X2dldF9wYWdlc19saW1pdCgpOworCWluaV9ucl9wYWdlcyA9IG1pbihpbmlfbnJfcGFnZXMs
IHhlbl9zdGFydF9pbmZvLT5ucl9wYWdlcyk7CisJbWVtX2VuZCA9IFBGTl9QSFlTKGluaV9u
cl9wYWdlcyk7CiAKIAltZW1tYXAubnJfZW50cmllcyA9IEFSUkFZX1NJWkUoeGVuX2U4MjBf
dGFibGUuZW50cmllcyk7CiAJc2V0X3hlbl9ndWVzdF9oYW5kbGUobWVtbWFwLmJ1ZmZlciwg
eGVuX2U4MjBfdGFibGUuZW50cmllcyk7CkBAIC03ODksMTAgKzc5MCwxMCBAQCBjaGFyICog
X19pbml0IHhlbl9tZW1vcnlfc2V0dXAodm9pZCkKIAltYXhfcGFnZXMgPSB4ZW5fZ2V0X21h
eF9wYWdlcygpOwogCiAJLyogSG93IG1hbnkgZXh0cmEgcGFnZXMgZG8gd2UgbmVlZCBkdWUg
dG8gcmVtYXBwaW5nPyAqLwotCW1heF9wYWdlcyArPSB4ZW5fZm9yZWFjaF9yZW1hcF9hcmVh
KG1heF9wZm4sIHhlbl9jb3VudF9yZW1hcF9wYWdlcyk7CisJbWF4X3BhZ2VzICs9IHhlbl9m
b3JlYWNoX3JlbWFwX2FyZWEoeGVuX2NvdW50X3JlbWFwX3BhZ2VzKTsKIAotCWlmIChtYXhf
cGFnZXMgPiBtYXhfcGZuKQotCQlleHRyYV9wYWdlcyArPSBtYXhfcGFnZXMgLSBtYXhfcGZu
OworCWlmIChtYXhfcGFnZXMgPiBpbmlfbnJfcGFnZXMpCisJCWV4dHJhX3BhZ2VzICs9IG1h
eF9wYWdlcyAtIGluaV9ucl9wYWdlczsKIAogCS8qCiAJICogQ2xhbXAgdGhlIGFtb3VudCBv
ZiBleHRyYSBtZW1vcnkgdG8gYSBFWFRSQV9NRU1fUkFUSU8KQEAgLTgwMSw4ICs4MDIsOCBA
QCBjaGFyICogX19pbml0IHhlbl9tZW1vcnlfc2V0dXAodm9pZCkKIAkgKiBNYWtlIHN1cmUg
d2UgaGF2ZSBubyBtZW1vcnkgYWJvdmUgbWF4X3BhZ2VzLCBhcyB0aGlzIGFyZWEKIAkgKiBp
c24ndCBoYW5kbGVkIGJ5IHRoZSBwMm0gbWFuYWdlbWVudC4KIAkgKi8KLQltYXhtZW1fcGFn
ZXMgPSBFWFRSQV9NRU1fUkFUSU8gKiBtaW4obWF4X3BmbiwgUEZOX0RPV04oTUFYTUVNKSk7
Ci0JZXh0cmFfcGFnZXMgPSBtaW4zKG1heG1lbV9wYWdlcywgZXh0cmFfcGFnZXMsIG1heF9w
YWdlcyAtIG1heF9wZm4pOworCW1heG1lbV9wYWdlcyA9IEVYVFJBX01FTV9SQVRJTyAqIG1p
bihpbmlfbnJfcGFnZXMsIFBGTl9ET1dOKE1BWE1FTSkpOworCWV4dHJhX3BhZ2VzID0gbWlu
MyhtYXhtZW1fcGFnZXMsIGV4dHJhX3BhZ2VzLCBtYXhfcGFnZXMgLSBpbmlfbnJfcGFnZXMp
OwogCWkgPSAwOwogCWFkZHIgPSB4ZW5fZTgyMF90YWJsZS5lbnRyaWVzWzBdLmFkZHI7CiAJ
c2l6ZSA9IHhlbl9lODIwX3RhYmxlLmVudHJpZXNbMF0uc2l6ZTsKQEAgLTg4NSw3ICs4ODYs
NyBAQCBjaGFyICogX19pbml0IHhlbl9tZW1vcnlfc2V0dXAodm9pZCkKIAkgKiBTZXQgaWRl
bnRpdHkgbWFwIG9uIG5vbi1SQU0gcGFnZXMgYW5kIHByZXBhcmUgcmVtYXBwaW5nIHRoZQog
CSAqIHVuZGVybHlpbmcgUkFNLgogCSAqLwotCXhlbl9mb3JlYWNoX3JlbWFwX2FyZWEobWF4
X3BmbiwgeGVuX3NldF9pZGVudGl0eV9hbmRfcmVtYXBfY2h1bmspOworCXhlbl9mb3JlYWNo
X3JlbWFwX2FyZWEoeGVuX3NldF9pZGVudGl0eV9hbmRfcmVtYXBfY2h1bmspOwogCiAJcHJf
aW5mbygiUmVsZWFzZWQgJWxkIHBhZ2UocylcbiIsIHhlbl9yZWxlYXNlZF9wYWdlcyk7CiAK
LS0gCjIuNDMuMAoK
--------------AQ4HBPRyjOeE3SI2rjxB1tor
Content-Type: text/x-patch; charset=UTF-8;
 name="0005-xen-tolerate-ACPI-NVS-memory-overlapping-with-Xen-al.patch"
Content-Disposition: attachment;
 filename*0="0005-xen-tolerate-ACPI-NVS-memory-overlapping-with-Xen-al.pa";
 filename*1="tch"
Content-Transfer-Encoding: base64

RnJvbSBmYTg5YWJhMTJiZDM0YzkxOGNlOTU4ZTc3ZTQ0N2Q3OTdmNzBmNTMzIE1vbiBTZXAg
MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBKdWVyZ2VuIEdyb3NzIDxqZ3Jvc3NAc3VzZS5jb20+
CkRhdGU6IEZyaSwgMiBBdWcgMjAyNCAyMDoxNDoyMiArMDIwMApTdWJqZWN0OiBbUEFUQ0gg
NS81XSB4ZW46IHRvbGVyYXRlIEFDUEkgTlZTIG1lbW9yeSBvdmVybGFwcGluZyB3aXRoIFhl
bgogYWxsb2NhdGVkIG1lbW9yeQoKSW4gb3JkZXIgdG8gbWluaW1pemUgcmVxdWlyZWQgc3Bl
Y2lhbCBoYW5kbGluZyBmb3IgcnVubmluZyBhcyBYZW4gUFYKZG9tMCwgdGhlIG1lbW9yeSBs
YXlvdXQgaXMgbW9kaWZpZWQgdG8gbWF0Y2ggdGhhdCBvZiB0aGUgaG9zdC4gVGhpcwpyZXF1
aXJlcyB0byBoYXZlIG9ubHkgUkFNIGF0IHRoZSBsb2NhdGlvbnMgd2hlcmUgWGVuIGFsbG9j
YXRlZCBtZW1vcnkKaXMgbGl2aW5nLiBVbmZvcnR1bmF0ZWx5IHRoZXJlIHNlZW0gdG8gYmUg
c29tZSBtYWNoaW5lcywgd2hlcmUgQUNQSQpOVlMgaXMgbG9jYXRlZCBhdCA2NCBNQiwgcmVz
dWx0aW5nIGluIGEgY29uZmxpY3Qgd2l0aCB0aGUgbG9hZGVkCmtlcm5lbCBvciB0aGUgaW5p
dGlhbCBwYWdlIHRhYmxlcyBidWlsdCBieSBYZW4uCgpBcyBBQ1BJIE5WUyBuZWVkcyB0byBi
ZSBhY2Nlc3NlZCBieSB0aGUga2VybmVsIG9ubHkgZm9yIHNhdmluZyBhbmQKcmVzdG9yaW5n
IGl0IGFjcm9zcyBzdXNwZW5kIG9wZXJhdGlvbnMsIGl0IGNhbiBiZSByZWxvY2F0ZWQgaW4g
dGhlCmRvbTAncyBtZW1vcnkgbWFwIGJ5IHN3YXBwaW5nIGl0IHdpdGggdW51c2VkIFJBTSAo
dGhpcyBpcyBwb3NzaWJsZQp2aWEgbW9kaWZpY2F0aW9uIG9mIHRoZSBkb20wIFAyTSBtYXAp
LgoKV2hpbGUgdGhlIEU4MjAgbWFwIGNhbiAoYW5kIHNob3VsZCkgYmUgbW9kaWZpZWQgcmln
aHQgYXdheSwgdGhlIFAyTQptYXAgY2FuIGJlIHVwZGF0ZWQgb25seSBhZnRlciBtZW1vcnkg
YWxsb2NhdGlvbiBpcyB3b3JraW5nLCBhcyB0aGUgUDJNCm1hcCBtaWdodCBuZWVkIHRvIGJl
IGV4dGVuZGVkLgoKRml4ZXM6IDgwOGZkYjcxOTM2YyAoInhlbjogY2hlY2sgZm9yIGtlcm5l
bCBtZW1vcnkgY29uZmxpY3Rpbmcgd2l0aCBtZW1vcnkgbGF5b3V0IikKU2lnbmVkLW9mZi1i
eTogSnVlcmdlbiBHcm9zcyA8amdyb3NzQHN1c2UuY29tPgotLS0KIGFyY2gveDg2L3hlbi9z
ZXR1cC5jIHwgMTMzICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr
Ky0KIDEgZmlsZSBjaGFuZ2VkLCAxMzIgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbigtKQoK
ZGlmZiAtLWdpdCBhL2FyY2gveDg2L3hlbi9zZXR1cC5jIGIvYXJjaC94ODYveGVuL3NldHVw
LmMKaW5kZXggZDY3OGMwMzMwOTcxLi5kYmI1ZDEzY2E2MWEgMTAwNjQ0Ci0tLSBhL2FyY2gv
eDg2L3hlbi9zZXR1cC5jCisrKyBiL2FyY2gveDg2L3hlbi9zZXR1cC5jCkBAIC00OSw2ICs0
OSwxNSBAQCBzdGF0aWMgc3RydWN0IGU4MjBfdGFibGUgeGVuX2U4MjBfdGFibGUgX19pbml0
ZGF0YTsKIC8qIE51bWJlciBvZiBpbml0aWFsbHkgdXNhYmxlIG1lbW9yeSBwYWdlcy4gKi8K
IHN0YXRpYyB1bnNpZ25lZCBsb25nIGluaV9ucl9wYWdlcyBfX2luaXRkYXRhOwogCisvKiBS
ZW1hcHBlZCBub24tUkFNIGFyZWFzICovCisjZGVmaW5lIE5SX05PTlJBTV9SRU1BUCA0Citz
dGF0aWMgc3RydWN0IG5vbnJhbV9yZW1hcCB7CisJdW5zaWduZWQgbG9uZyBtYWRkcjsKKwl1
bnNpZ25lZCBsb25nIHNpemU7CisJdW5zaWduZWQgbG9uZyBwYWRkcjsKK30geGVuX25vbnJh
bV9yZW1hcFtOUl9OT05SQU1fUkVNQVBdIF9faW5pdGRhdGE7CitzdGF0aWMgdW5zaWduZWQg
aW50IG5yX25vbnJhbV9yZW1hcCBfX2luaXRkYXRhOworCiAvKgogICogQnVmZmVyIHVzZWQg
dG8gcmVtYXAgaWRlbnRpdHkgbWFwcGVkIHBhZ2VzLiBXZSBvbmx5IG5lZWQgdGhlIHZpcnR1
YWwgc3BhY2UuCiAgKiBUaGUgcGh5c2ljYWwgcGFnZSBiZWhpbmQgdGhpcyBhZGRyZXNzIGlz
IHJlbWFwcGVkIGFzIG5lZWRlZCB0byBkaWZmZXJlbnQKQEAgLTQ1Miw2ICs0NjEsOCBAQCBz
dGF0aWMgdW5zaWduZWQgbG9uZyBfX2luaXQgeGVuX2ZvcmVhY2hfcmVtYXBfYXJlYSgKICAq
IHRvIGJlIHJlbWFwcGVkIG1lbW9yeSBpdHNlbGYgaW4gYSBsaW5rZWQgbGlzdCBhbmNob3Jl
ZCBhdCB4ZW5fcmVtYXBfbWZuLgogICogVGhpcyBzY2hlbWUgYWxsb3dzIHRvIHJlbWFwIHRo
ZSBkaWZmZXJlbnQgY2h1bmtzIGluIGFyYml0cmFyeSBvcmRlciB3aGlsZQogICogdGhlIHJl
c3VsdGluZyBtYXBwaW5nIHdpbGwgYmUgaW5kZXBlbmRlbnQgZnJvbSB0aGUgb3JkZXIuCisg
KiBJbiBjYXNlIHhlbl9lODIwX3Jlc29sdmVfY29uZmxpY3RzKCkgZGlkIHJlbG9jYXRlIHNv
bWUgbm9uLVJBTSBFODIwCisgKiBlbnRyaWVzLCBzZXQgdGhlIGNvcnJlY3QgUDJNIGluZm9y
bWF0aW9uIGZvciB0aGUgYWZmZWN0ZWQgcGFnZXMuCiAgKi8KIHZvaWQgX19pbml0IHhlbl9y
ZW1hcF9tZW1vcnkodm9pZCkKIHsKQEAgLTQ5NSw2ICs1MDYsMjkgQEAgdm9pZCBfX2luaXQg
eGVuX3JlbWFwX21lbW9yeSh2b2lkKQogCXNldF9wdGVfbWZuKGJ1ZiwgbWZuX3NhdmUsIFBB
R0VfS0VSTkVMKTsKIAogCXByX2luZm8oIlJlbWFwcGVkICVsZCBwYWdlKHMpXG4iLCByZW1h
cHBlZCk7CisKKwlpZiAobnJfbm9ucmFtX3JlbWFwID09IDApCisJCXJldHVybjsKKworCXJl
bWFwcGVkID0gMDsKKwlmb3IgKGkgPSAwOyBpIDwgbnJfbm9ucmFtX3JlbWFwOyBpKyspIHsK
KwkJc3RydWN0IG5vbnJhbV9yZW1hcCAqcmVtYXAgPSB4ZW5fbm9ucmFtX3JlbWFwICsgaTsK
KworCQlwZm4gPSBQRk5fRE9XTihyZW1hcC0+cGFkZHIpOworCQltZm5fc2F2ZSA9IFBGTl9E
T1dOKHJlbWFwLT5tYWRkcik7CisJCWZvciAobGVuID0gMDsgbGVuIDwgcmVtYXAtPnNpemU7
IGxlbiArPSBQQUdFX1NJWkUpIHsKKwkJCWlmICghc2V0X3BoeXNfdG9fbWFjaGluZShwZm4s
IG1mbl9zYXZlKSkgeworCQkJCVdBUk4oMSwgIkZhaWxlZCB0byBzZXQgcDJtIG1hcHBpbmcg
Zm9yIHBmbj0lbGQgbWZuPSVsZFxuIiwKKwkJCQkgICAgIHBmbiwgbWZuX3NhdmUpOworCQkJ
CUJVRygpOworCQkJfQorCQkJcGZuKys7CisJCQltZm5fc2F2ZSsrOworCQkJcmVtYXBwZWQr
KzsKKwkJfQorCX0KKworCXByX2luZm8oIlJlbWFwcGVkICVsZCBub24tUkFNIHBhZ2Uocylc
biIsIHJlbWFwcGVkKTsKIH0KIAogc3RhdGljIHVuc2lnbmVkIGxvbmcgX19pbml0IHhlbl9n
ZXRfcGFnZXNfbGltaXQodm9pZCkKQEAgLTYyNSwxNCArNjU5LDExMSBAQCBwaHlzX2FkZHJf
dCBfX2luaXQgeGVuX2ZpbmRfZnJlZV9hcmVhKHBoeXNfYWRkcl90IHNpemUpCiAJcmV0dXJu
IDA7CiB9CiAKKy8qCisgKiBTd2FwIGEgbm9uLVJBTSBFODIwIG1hcCBlbnRyeSB3aXRoIFJB
TSBhYm92ZSBpbmlfbnJfcGFnZXMuCisgKiBOb3RlIHRoYXQgdGhlIEU4MjAgbWFwIGlzIG1v
ZGlmaWVkIGFjY29yZGluZ2x5LCBidXQgdGhlIFAyTSBtYXAgaXNuJ3QgeWV0LgorICogVGhl
IGFkYXB0aW9uIG9mIHRoZSBQMk0gbXVzdCBiZSBkZWZlcnJlZCB1bnRpbCBwYWdlIGFsbG9j
YXRpb24gaXMgcG9zc2libGUuCisgKi8KK3N0YXRpYyB2b2lkIF9faW5pdCB4ZW5fZTgyMF9z
d2FwX2VudHJ5X3dpdGhfcmFtKHN0cnVjdCBlODIwX2VudHJ5ICpzd2FwX2VudHJ5KQorewor
CXN0cnVjdCBlODIwX2VudHJ5ICplbnRyeTsKKwl1bnNpZ25lZCBpbnQgbWFwY250OworCXBo
eXNfYWRkcl90IG1lbV9lbmQgPSBQRk5fUEhZUyhpbmlfbnJfcGFnZXMpOworCXN0cnVjdCBu
b25yYW1fcmVtYXAgKnJlbWFwOworCXBoeXNfYWRkcl90IHN3YXBfYWRkciwgc3dhcF9zaXpl
LCBlbnRyeV9lbmQ7CisKKwlpZiAobnJfbm9ucmFtX3JlbWFwID09IE5SX05PTlJBTV9SRU1B
UCkgeworCQl4ZW5fcmF3X2NvbnNvbGVfd3JpdGUoIk51bWJlciBvZiByZXF1aXJlZCBFODIw
IGVudHJ5IHJlbWFwcGluZyBhY3Rpb25zIGV4Y2VlZCBtYXhpbXVtIHZhbHVlXG4iKTsKKwkJ
QlVHKCk7CisJfQorCisJc3dhcF9hZGRyID0gUEFHRV9BTElHTl9ET1dOKHN3YXBfZW50cnkt
PmFkZHIpOworCXN3YXBfc2l6ZSA9IFBBR0VfQUxJR04oc3dhcF9lbnRyeS0+YWRkciAtIHN3
YXBfYWRkciArIHN3YXBfZW50cnktPnNpemUpOworCXJlbWFwID0geGVuX25vbnJhbV9yZW1h
cCArIG5yX25vbnJhbV9yZW1hcDsKKwllbnRyeSA9IHhlbl9lODIwX3RhYmxlLmVudHJpZXM7
CisKKwlmb3IgKG1hcGNudCA9IDA7IG1hcGNudCA8IHhlbl9lODIwX3RhYmxlLm5yX2VudHJp
ZXM7IG1hcGNudCsrKSB7CisJCWVudHJ5X2VuZCA9IGVudHJ5LT5hZGRyICsgZW50cnktPnNp
emU7CisJCWlmIChlbnRyeS0+dHlwZSA9PSBFODIwX1RZUEVfUkFNICYmIGVudHJ5LT5zaXpl
ID49IHN3YXBfc2l6ZSAmJgorCQkgICAgZW50cnlfZW5kIC0gc3dhcF9zaXplID49IG1lbV9l
bmQpIHsKKwkJCS8qIFJlZHVjZSBSQU0gZW50cnkgYnkgbmVlZGVkIHNwYWNlICh3aG9sZSBw
YWdlcykuICovCisJCQllbnRyeS0+c2l6ZSAtPSBzd2FwX3NpemU7CisKKwkJCS8qIEFkZCBu
ZXcgZW50cnkgYXQgdGhlIGVuZCBvZiBFODIwIG1hcC4gKi8KKwkJCWVudHJ5ID0geGVuX2U4
MjBfdGFibGUuZW50cmllcyArCisJCQkJeGVuX2U4MjBfdGFibGUubnJfZW50cmllczsKKwkJ
CXhlbl9lODIwX3RhYmxlLm5yX2VudHJpZXMrKzsKKworCQkJLyogRmlsbCBuZXcgZW50cnkg
KGtlZXAgc2l6ZSBhbmQgcGFnZSBvZmZzZXQpLiAqLworCQkJZW50cnktPnR5cGUgPSBzd2Fw
X2VudHJ5LT50eXBlOworCQkJZW50cnktPmFkZHIgPSBlbnRyeV9lbmQgLSBzd2FwX3NpemUg
KworCQkJCSAgICAgIHN3YXBfYWRkciAtIHN3YXBfZW50cnktPmFkZHI7CisJCQllbnRyeS0+
c2l6ZSA9IHN3YXBfZW50cnktPnNpemU7CisKKwkJCS8qIENvbnZlcnQgb2xkIGVudHJ5IHRv
IFJBTSwgYWxpZ24gdG8gcGFnZXMuICovCisJCQlzd2FwX2VudHJ5LT50eXBlID0gRTgyMF9U
WVBFX1JBTTsKKwkJCXN3YXBfZW50cnktPmFkZHIgPSBzd2FwX2FkZHI7CisJCQlzd2FwX2Vu
dHJ5LT5zaXplID0gc3dhcF9zaXplOworCisJCQkvKiBSZW1lbWJlciBQRk48LT5NRk4gcmVs
YXRpb24gZm9yIFAyTSB1cGRhdGUuICovCisJCQlyZW1hcC0+bWFkZHIgPSBzd2FwX2FkZHI7
CisJCQlyZW1hcC0+c2l6ZSA9IHN3YXBfc2l6ZTsKKwkJCXJlbWFwLT5wYWRkciA9IGVudHJ5
X2VuZCAtIHN3YXBfc2l6ZTsKKwkJCW5yX25vbnJhbV9yZW1hcCsrOworCisJCQkvKiBPcmRl
ciBFODIwIHRhYmxlIGFuZCBtZXJnZSBlbnRyaWVzLiAqLworCQkJZTgyMF9fdXBkYXRlX3Rh
YmxlKCZ4ZW5fZTgyMF90YWJsZSk7CisKKwkJCXJldHVybjsKKwkJfQorCisJCWVudHJ5Kys7
CisJfQorCisJeGVuX3Jhd19jb25zb2xlX3dyaXRlKCJObyBzdWl0YWJsZSBhcmVhIGZvdW5k
IGZvciByZXF1aXJlZCBFODIwIGVudHJ5IHJlbWFwcGluZyBhY3Rpb25cbiIpOworCUJVRygp
OworfQorCisvKgorICogTG9vayBmb3Igbm9uLVJBTSBtZW1vcnkgdHlwZXMgaW4gYSBzcGVj
aWZpYyBndWVzdCBwaHlzaWNhbCBhcmVhIGFuZCBtb3ZlCisgKiB0aG9zZSBhd2F5IGlmIHBv
c3NpYmxlIChBQ1BJIE5WUyBvbmx5IGZvciBub3cpLgorICovCitzdGF0aWMgdm9pZCBfX2lu
aXQgeGVuX2U4MjBfcmVzb2x2ZV9jb25mbGljdHMocGh5c19hZGRyX3Qgc3RhcnQsCisJCQkJ
CSAgICAgIHBoeXNfYWRkcl90IHNpemUpCit7CisJc3RydWN0IGU4MjBfZW50cnkgKmVudHJ5
OworCXVuc2lnbmVkIGludCBtYXBjbnQ7CisJcGh5c19hZGRyX3QgZW5kOworCisJaWYgKCFz
aXplKQorCQlyZXR1cm47CisKKwllbmQgPSBzdGFydCArIHNpemU7CisJZW50cnkgPSB4ZW5f
ZTgyMF90YWJsZS5lbnRyaWVzOworCisJZm9yIChtYXBjbnQgPSAwOyBtYXBjbnQgPCB4ZW5f
ZTgyMF90YWJsZS5ucl9lbnRyaWVzOyBtYXBjbnQrKykgeworCQlpZiAoZW50cnktPmFkZHIg
Pj0gZW5kKQorCQkJcmV0dXJuOworCisJCWlmIChlbnRyeS0+YWRkciArIGVudHJ5LT5zaXpl
ID4gc3RhcnQgJiYKKwkJICAgIGVudHJ5LT50eXBlID09IEU4MjBfVFlQRV9OVlMpCisJCQl4
ZW5fZTgyMF9zd2FwX2VudHJ5X3dpdGhfcmFtKGVudHJ5KTsKKworCQllbnRyeSsrOworCX0K
K30KKwogLyoKICAqIENoZWNrIGZvciBhbiBhcmVhIGluIHBoeXNpY2FsIG1lbW9yeSB0byBi
ZSB1c2FibGUgZm9yIG5vbi1tb3ZhYmxlIHB1cnBvc2VzLgotICogQW4gYXJlYSBpcyBjb25z
aWRlcmVkIHRvIHVzYWJsZSBpZiB0aGUgdXNlZCBFODIwIG1hcCBsaXN0cyBpdCB0byBiZSBS
QU0uCisgKiBBbiBhcmVhIGlzIGNvbnNpZGVyZWQgdG8gdXNhYmxlIGlmIHRoZSB1c2VkIEU4
MjAgbWFwIGxpc3RzIGl0IHRvIGJlIFJBTSBvcgorICogc29tZSBvdGhlciB0eXBlIHdoaWNo
IGNhbiBiZSBtb3ZlZCB0byBoaWdoZXIgUEZOcyB3aGlsZSBrZWVwaW5nIHRoZSBNRk5zLgog
ICogSW4gY2FzZSB0aGUgYXJlYSBpcyBub3QgdXNhYmxlLCBjcmFzaCB0aGUgc3lzdGVtIHdp
dGggYW4gZXJyb3IgbWVzc2FnZS4KICAqLwogdm9pZCBfX2luaXQgeGVuX2Noa19pc19lODIw
X3VzYWJsZShwaHlzX2FkZHJfdCBzdGFydCwgcGh5c19hZGRyX3Qgc2l6ZSwKIAkJCQkgICBj
b25zdCBjaGFyICpjb21wb25lbnQpCiB7CisJeGVuX2U4MjBfcmVzb2x2ZV9jb25mbGljdHMo
c3RhcnQsIHNpemUpOworCiAJaWYgKCF4ZW5faXNfZTgyMF9yZXNlcnZlZChzdGFydCwgc2l6
ZSkpCiAJCXJldHVybjsKIAotLSAKMi40My4wCgo=

--------------AQ4HBPRyjOeE3SI2rjxB1tor--


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 14:23:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 14:23:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772909.1183347 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbL67-0001Od-RO; Tue, 06 Aug 2024 14:23:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772909.1183347; Tue, 06 Aug 2024 14:23:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbL67-0001OW-Ok; Tue, 06 Aug 2024 14:23:35 +0000
Received: by outflank-mailman (input) for mailman id 772909;
 Tue, 06 Aug 2024 14:23: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=kFQN=PF=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbL67-0001OQ-0E
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 14:23:35 +0000
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com
 [2a00:1450:4864:20::529])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7657badc-53ff-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 16:23:34 +0200 (CEST)
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5a1f9bc80e3so337584a12.2
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 07:23:34 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b839b2b96bsm6017951a12.23.2024.08.06.07.23.32
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 06 Aug 2024 07:23:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7657badc-53ff-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722954213; x=1723559013; 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=Or5KMDJPnWhnjeiGi70Y2ulkd7njF+gdNZa2YENPn+0=;
        b=IxcAwKRw/wNEF9iANTSPiDDBv/dv3b0iHtmv+Vu2io4BENXDqST7Mx5JistthOdOFu
         r7SOn9C1NuD/ep0FzbA3ZrbPMra838HC4LgBySRCc55nJJL5tfmB7ItGSgjKdpauFgO8
         uz+bh2wwleVNewR/Wky4iot2KWm6lXnkX1Q0/qrft3Onrg+brVvxy02d9log4smKzHgr
         XeTHPZlc5Mj4RI02iMVSBtbHAQAyWIT1zp+3ABBtnieUtFSnFr9K4/dBaXu2WJ5cCWN7
         9mMovBFvvtHBevFew8/j5mHk4KuIqb6p3djZJif8M6B8g+gNnrg6HBqVz/iWb0uvWhrJ
         j4fg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722954213; x=1723559013;
        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=Or5KMDJPnWhnjeiGi70Y2ulkd7njF+gdNZa2YENPn+0=;
        b=ug7sJUbfK1iQmEfE0W+b9vC6IMy2CGhE3pw5WgHBVl/zyZ9Fx4yKqRbhDcoRIFQySq
         6uNl/Uc7JyE7dR6egaAcJ9qOgRQ6KZn4oA0hNrfQ+l5UjuniZ84X+85Tc4SJr/AM84ED
         djQAmt/ciEYUMMeAf/ZRxfIuEYNLZj3CQJZoUOgGe+ZsYamOS6ADkf8JhUcVFZCrF7pj
         Gf/zP0Mw5lYBvfSBijiYQRD9s1P3Wg0bb3yauYXASc8VfdaXsDXrwXrfXEeXG2GFf3ZC
         E6sbvsr8cE9+2FYBi2FOhEu2pTTvVN98WA7BCbM/BzSoVNmFVgRT0uf3RmolTUZG+ABe
         oSeQ==
X-Forwarded-Encrypted: i=1; AJvYcCVgD6Emm5LcC4cPYOLnbUzfHw4kxiE/vWNG7Hxln7j0DkmJv7SyRrENsLYYf5bDTdu/UgmofFib1fmPABD0F2X4PZyMKRyYLff5dSmSOyk=
X-Gm-Message-State: AOJu0Yxdv0clmtmqCwZ2m9+hEGdjQEajKHgsDh2DWP4IV/HQ8yEvd9AK
	nyyoGvAuJUPcNtdBNwej7Jbe5p81/+BUacZarP2NBa0GdXbAM//+7El1HJPaVDNsvKFKagl6l48
	=
X-Google-Smtp-Source: AGHT+IENlHB0cvVqyXkGZgpGzu1jJA9yVQlWrz6sZ6oUgnahqpGuMGlH43v5WVpev6R5GSB/csdhHQ==
X-Received: by 2002:aa7:cad6:0:b0:5a2:80f:a6dd with SMTP id 4fb4d7f45d1cf-5b7f3ad811bmr14197828a12.14.1722954213184;
        Tue, 06 Aug 2024 07:23:33 -0700 (PDT)
Message-ID: <1bd59e0a-0468-4944-b9bb-d9aae5fe55b5@suse.com>
Date: Tue, 6 Aug 2024 16:23:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v12 1/3] xen/riscv: enable GENERIC_BUG_FRAME
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1722605952.git.oleksii.kurochko@gmail.com>
 <3d507ce45606d22e9fa07dd6087870c16b5c4a4e.1722605952.git.oleksii.kurochko@gmail.com>
 <0245feaa-6cf2-4f44-843f-38cdcc6b7a42@suse.com>
 <89d6b01ac85899c85f1dbfdaa907435e12de75c2.camel@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: <89d6b01ac85899c85f1dbfdaa907435e12de75c2.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 06.08.2024 12:11, oleksii.kurochko@gmail.com wrote:
> On Mon, 2024-08-05 at 17:41 +0200, Jan Beulich wrote:
>> On 02.08.2024 15:54, Oleksii Kurochko wrote:
>>> Enable GENERIC_BUG_FRAME to support BUG(), WARN(), ASSERT,
>>> and run_in_exception_handler().
>>>
>>> The 0x0000 opcode is used for BUG_INSTR, which, when macros from
>>> <xen/bug.h> are used, triggers an exception with the
>>> ILLEGAL_INSTRUCTION cause.
>>> This opcode is encoded as a 2-byte instruction and is invalid if
>>> CONFIG_RISCV_ISA_C is enabled or not.
>>
>> Yes, but there's a caveat: Without the C extension instructions have
>> to be aligned on 32-bit boundaries. You can't just go and insert a
>> 16-bit item there. When RISCV_ISA_C is not set, I think you want to
>> insert two such 16-bit zeroes. Beware of an alignment handling bug
>> in the assembler - don't think of using an alignment directive here.
> Then probably it will be better to define BUG_INSTR as:
>  #define BUG_INSTR "UNIMP"
> and let compiler to provide proper opcode.
> 
> Or define BUG_INSTRT always as 0x00000000 will be better?

I don't know.

>>> --- a/xen/arch/riscv/include/asm/bug.h
>>> +++ b/xen/arch/riscv/include/asm/bug.h
>>> @@ -9,7 +9,11 @@
>>>  
>>>  #ifndef __ASSEMBLY__
>>>  
>>> -#define BUG_INSTR "ebreak"
>>> +#include <xen/stringify.h>
>>> +
>>> +#define BUG_OPCODE  0x0000
>>
>> You don't really use this other than ...
>>
>>> +#define BUG_INSTR ".hword " __stringify(BUG_OPCODE)
>>
>> ... here - does this really warrant a separate #define _and_
>> inclusion of
>> stringify.h?
>>
>> Furthermore you want to avoid using .hword (or any data generating
>> directive), to avoid disturbing disassembly. Please use .insn if at
>> all
>> possible. I understand though that in certain cases you won't be able
>> to
>> use .insn. Yet for the common case (more recent binutils) you'd still
>> better avoid .hword or alike, imo.
>>
>>> @@ -103,7 +104,29 @@ static void do_unexpected_trap(const struct
>>> cpu_user_regs *regs)
>>>  
>>>  void do_trap(struct cpu_user_regs *cpu_regs)
>>>  {
>>> -    do_unexpected_trap(cpu_regs);
>>> +    register_t pc = cpu_regs->sepc;
>>> +    unsigned long cause = csr_read(CSR_SCAUSE);
>>> +
>>> +    switch ( cause )
>>> +    {
>>> +    case CAUSE_ILLEGAL_INSTRUCTION:
>>> +        if ( do_bug_frame(cpu_regs, pc) >= 0 )
>>> +        {
>>> +            if ( !(is_kernel_text(pc) || is_kernel_inittext(pc)) )
>>> +            {
>>> +                printk("Something wrong with PC: %#lx\n", pc);
>>> +                die();
>>> +            }
>>> +
>>> +            cpu_regs->sepc += GET_INSN_LENGTH(*(uint16_t *)pc);
>>> +
>>> +            break;
>>> +        }
>>> +
>>> +    default:
>>
>> The falling-through here wants annotating, preferably with the
>> pseudo-
>> keyword.
> What kind of pseudo-keyword? I though about /* goto default */ to
> underline that CAUSE_ILLEGAL_INSTRUCTION should be close to "default:".

In compiler.h we define "fallthrough" specifically for purposes like
this.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 15:21:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 15:21:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772919.1183356 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbLzw-0002Dx-Uj; Tue, 06 Aug 2024 15:21:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772919.1183356; Tue, 06 Aug 2024 15:21:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbLzw-0002Dq-SF; Tue, 06 Aug 2024 15:21:16 +0000
Received: by outflank-mailman (input) for mailman id 772919;
 Tue, 06 Aug 2024 15:21:15 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=9A+u=PF=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1sbLzv-0002Dk-Jf
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 15:21:15 +0000
Received: from fout2-smtp.messagingengine.com (fout2-smtp.messagingengine.com
 [103.168.172.145]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8246e722-5407-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 17:21:10 +0200 (CEST)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45])
 by mailfout.nyi.internal (Postfix) with ESMTP id 886391389716;
 Tue,  6 Aug 2024 11:21:09 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute5.internal (MEProxy); Tue, 06 Aug 2024 11:21:09 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue,
 6 Aug 2024 11:21:08 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8246e722-5407-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:subject:subject:to:to; s=fm3; t=1722957669;
	 x=1723044069; bh=rUeUpyM7lcuXXD37NZVfHe8cuZcDSbwZr4aitJQxSa8=; b=
	u38mMJibfdPMwqwbKxrVOA1bHAd41OT7PeBEW0+yWxs32miEhrXiUsiOg4+AZKF5
	CAapq7IH/i/6Q6HM/tSJSKsPgq5sXrNk5647FMF/0fjMOBnV1KS8ssdmPNQyrQnP
	/PvTuG4xAdz3ZUVVoc6lEs8nF/EvY5j7X9mVszi8igfCZejuribwKIaLUyQ/4iyt
	6TiZVHLjsqGqVcuC/zZHh3Y1N+1gnNOWTGwK88m0KPh+m4JGbWB5KfnZBAhm4xjp
	M0xvWONT4GWuZzLHqubxJ82B3+tmdTRE1YktOVvzvFqz8Eu/YMcwBWW8ngQNvj98
	QGJ/u6MNz8BAR82Alh/OmQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:subject:subject:to
	:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
	fm3; t=1722957669; x=1723044069; bh=rUeUpyM7lcuXXD37NZVfHe8cuZcD
	SbwZr4aitJQxSa8=; b=BFwyOZ7mG2sxmxsuOD3SoeuDoFBMmHqa9DcainY698Ha
	pJXcSQlNf3kdzO2JHNnTR8J/B1ZFQ3E1/VqDAGuxZ3D1EVWINngi4rK5D6aXKP3K
	OX656mN4N5kiyEqwWedGu2fA+EDlGEKr+YRyC8oSFSuURGNiVKE2FXvsz1U1yjy4
	iV+LRBrrHE3WyH/tXTTuKipLNF8n9mhOKmH6uL7Zb0cUUS5EZYUMpNTp0MTsvYGB
	W/PgBL7QVT4RnpmdCGoNJxbatw19TOhxpx+xMfTVozz3dmFoSMWAza03+HYaMNif
	9BFzMKk1U/LCOe/F69MZN2cg2TKYLR09egN8yIzsbA==
X-ME-Sender: <xms:ZT-yZhDhnX-J0OrLbX0cx4evNlv9PbuLqbBs0B5l1xHTRNgIOgGXMw>
    <xme:ZT-yZvhPI9EU5lH2jk-RMwCIYz7r8MKrMujEvmkuEYYtjvqO2QWTVQcEFkcUraJFU
    6eF1gMJ1HJNvA>
X-ME-Received: <xmr:ZT-yZsk04oXTUG3v6YT0t1RLAY01FXxQkxsHGli8P8J10V8stuhSaaETozwATsxICG-kjlM72xBrG7Z2Kj1yDm60PRkya4motw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrkeekgdekjecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghk
    ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh
    hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeetueeg
    fefhffdvffetleeltdelkedvlefhkeehgfehhffhheehudeitdegheejleenucffohhmrg
    hinhepkhgvrhhnvghlrdhorhhgpdhgihhthhhusgdrtghomhenucevlhhushhtvghrufhi
    iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhesihhnvhhish
    hisghlvghthhhinhhgshhlrggsrdgtohhmpdhnsggprhgtphhtthhopedt
X-ME-Proxy: <xmx:ZT-yZrx77HhOZkunAu8klgNJNnfcnwG5ezgmdx1HFGRjas95plJ1Ng>
    <xmx:ZT-yZmRbb0lQlbd8fPFm3GK8RyHTGOTZR5LpadW-p8FvBkz9ZO6WSA>
    <xmx:ZT-yZuZdnMnqphdUsWrbKeX0pqZruavHfngVMBC_JIAFnAowBs6_YA>
    <xmx:ZT-yZnQwlso1s_X5PKkClKxLOAOMRU9SuWPxPUJxwBVy87ZgKCxMrg>
    <xmx:ZT-yZhfxXK_z2qPVxpglmrgasOq9-XvK7y9V485kXV5XlI37iblupN3E>
Feedback-ID: i1568416f:Fastmail
Date: Tue, 6 Aug 2024 17:21:04 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: =?utf-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: ACPI NVS range conflicting with Dom0 page tables (or kernel
 image)
Message-ID: <ZrI_YSBSiC7w5iP6@mail-itl>
References: <a5a8a016-2107-46fb-896b-2baaf66566d4@suse.com>
 <ZnBCFgHltVqj2FDh@mail-itl>
 <6a7508dd-9f81-4fce-9c83-8b4fae924d48@suse.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="+/Jd73saw8PY1hkU"
Content-Disposition: inline
In-Reply-To: <6a7508dd-9f81-4fce-9c83-8b4fae924d48@suse.com>


--+/Jd73saw8PY1hkU
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Tue, 6 Aug 2024 17:21:04 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: =?utf-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: ACPI NVS range conflicting with Dom0 page tables (or kernel
 image)

On Tue, Aug 06, 2024 at 04:12:32PM +0200, J=C3=BCrgen Gro=C3=9F wrote:
> Marek,
>=20
> On 17.06.24 16:03, Marek Marczykowski-G=C3=B3recki wrote:
> > On Mon, Jun 17, 2024 at 01:22:37PM +0200, Jan Beulich wrote:
> > > Hello,
> > >=20
> > > while it feels like we had a similar situation before, I can't seem t=
o be
> > > able to find traces thereof, or associated (Linux) commits.
> >=20
> > Is it some AMD Threadripper system by a chance? Previous thread on this
> > issue:
> > https://lore.kernel.org/xen-devel/CAOCpoWdOH=3DxGxiQSC1c5Ueb1THxAjH4WiZ=
bCZq-QT+d_KAk3SA@mail.gmail.com/
> >=20
> > > With
> > >=20
> > > (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4000000
> > > ...
> > > (XEN)  Dom0 alloc.:   0000000440000000->0000000448000000 (619175 page=
s to be allocated)
> > > ...
> > > (XEN)  Loaded kernel: ffffffff81000000->ffffffff84000000
> > >=20
> > > the kernel occupies the space from 16Mb to 64Mb in the initial alloca=
tion.
> > > Page tables come (almost) directly above:
> > >=20
> > > (XEN)  Page tables:   ffffffff84001000->ffffffff84026000
> > >=20
> > > I.e. they're just above the 64Mb boundary. Yet sadly in the host E820=
 map
> > > there is
> > >=20
> > > (XEN)  [0000000004000000, 0000000004009fff] (ACPI NVS)
> > >=20
> > > i.e. a non-RAM range starting at 64Mb. The kernel (currently) won't t=
olerate
> > > such an overlap (also if it was overlapping the kernel image, e.g. if=
 on the
> > > machine in question s sufficiently much larger kernel was used). Yet =
with its
> > > fundamental goal of making its E820 match the host one I'm also in tr=
ouble
> > > thinking of possible solutions / workarounds. I certainly do not see =
Xen
> > > trying to cover for this, as the E820 map re-arrangement is purely a =
kernel
> > > side decision (forward ported kernels got away without, and what e.g.=
 the
> > > BSDs do is entirely unknown to me).
> >=20
> > In Qubes we have worked around the issue by moving the kernel lower
> > (CONFIG_PHYSICAL_START=3D0x200000):
> > https://github.com/QubesOS/qubes-linux-kernel/commit/3e8be4ac1682370977=
d4d0dc1d782c428d860282
> >=20
> > Far from ideal, but gets it bootable...
> >=20
>=20
> could you test the attached kernel patches? They should fix the issue wit=
hout
> having to modify CONFIG_PHYSICAL_START.
>=20
> I have tested them to boot up without problem on my test system, but I do=
n't
> have access to a system showing the E820 map conflict you are seeing.
>=20
> The patches have been developed against kernel 6.11-rc2, but I think they
> should apply to a 6.10 and maybe even an older kernel.

Sure, but tomorrow-ish.

> If possible it would be nice to verify suspend to disk still working, as
> the kernel will need to access the ACPI NVS area in this case.

That might be harder, as Qubes OS doesn't support suspend to disk, but
I'll see if something can be done.

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

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

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmayP2EACgkQ24/THMrX
1yw1rwf/dK/+E6YFeHh5RyUesBDO8XGSgWFN00iLaDoop3SZGuTYPBoQXia18raw
nWWbsYkUEKnuBOFZw8wt7eKAF9wL5iUOrd+7SPeWuIdvpmaqovEQr86yK7oXG9nq
OBBteiYXMpf4wtxsGh9gY3yINo7qGeSCSzjHyETuHI0mHpIAL1pso+vtLL40v67s
iA0RBg2vbGUBTSWGe0lQBKJ71sqjz//5x8v9SKlYidoME4KCZneCvHz6g2QdtKPX
fUeLdr/wZTbQZKg1StLQmISR8s4Hdjby9Ed7XYPgHfaQASSjLsXitT5HYc2fy+eF
XfXmghlrK49cOl//Z498UFj1klad2Q==
=OpvJ
-----END PGP SIGNATURE-----

--+/Jd73saw8PY1hkU--


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 15:24:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 15:24:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772927.1183366 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbM32-0002nM-BS; Tue, 06 Aug 2024 15:24:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772927.1183366; Tue, 06 Aug 2024 15:24:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbM32-0002nF-8w; Tue, 06 Aug 2024 15:24:28 +0000
Received: by outflank-mailman (input) for mailman id 772927;
 Tue, 06 Aug 2024 15:24:26 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ByCl=PF=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbM30-0002n4-Lx
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 15:24:26 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f62a882d-5407-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 17:24:24 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-a7a9cf7d3f3so98061066b.1
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 08:24:24 -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-a7dc9e80dedsm553942266b.163.2024.08.06.08.24.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 06 Aug 2024 08:24:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f62a882d-5407-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1722957864; x=1723562664; 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=8fVgVKNyjP6ucB/6jAVB83Nmvj5lW4cVibaIAlraYw4=;
        b=NSIFjABlXQtJVxhUrNFLcChpTYIpbYWt7Mw5A27izUwkacaMaNho7Vr0ogc83k0k1Z
         VIe4VCQ3Wex7GedjPnH/41wRDbHWnpOrtjAI2R83l8uTYp4tz3YWeecnxhfXaKOF3KU+
         Xny+NGW0/YDlsNJYuN0JUISTBwDQEEX+I/aggbOYJyaJUCMSkKuwRsQcGtoxRvZ68Nyt
         CyDn1x4Tvi3UrNzfXUtS3Yp1mo7zNgmIiD833pwkZwRXK3xeAlXGHw4114e6SPMl4d0T
         3gRF0w5u/27ZkrnBqVEGZjAlUhH4/CvLXYqIJ9nNjzLGgpyo+AIZee5L7P0MDGPgF0EP
         xjXA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722957864; x=1723562664;
        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=8fVgVKNyjP6ucB/6jAVB83Nmvj5lW4cVibaIAlraYw4=;
        b=sqGa3Ofjc2qmQI+xqIW5gHQ/0DxCneiDb2mlHLllyn4qJbTsxu60G6v/sgLl5ysUmq
         LKEc6DsqH7eXrHCkT3jPRtAFTF6l507Yu6qzMvSCOEgNFyZC4EU2Y1e2YBNa0tOmr6b3
         cBGivkE3JHF5oxqDyGl5blWLXFXHoErX9YyIMNPSSrj+9yxNvT96azmDgqtVapmDr2+T
         gH+l2i/G9+RM14gCuqHzeve35W+v5Qiy25Eay/6eAgFc6qWVqOBLA6PyZLp5jXIEMDt7
         HWBLaMpktfD9gB3kRvX0o9AZiXCXqA66aQQ2exjQ1MWJzi1FleCNK2Q7JD15io0GLuWv
         gO6w==
X-Forwarded-Encrypted: i=1; AJvYcCVbz4LP6TrGYubbInMcboCs6dUNAoUD+fVcSF6wZWMnd3l7DXrhvpT4/xCqmGMHYgBV0/HkejPpDtWXkE4yHXW+GB5Gq1jCJas8fRDPuLU=
X-Gm-Message-State: AOJu0Yy7iOrHypN/nMo29TEmrg4Fclbcq1qs9/XWuajfoJshuiXoKQpx
	jxJsNl8a+2cgRsaj6WYTm2FYWPhDXAh3IIaVrUUwfMR7eNneqFI5ipb6s8SSe8k=
X-Google-Smtp-Source: AGHT+IG6CkAQJrVVcOBqPo1YEFchqnFPHpxjVe+Ghf1HBvcIoezK0khlJM5185SUM09nf1JaKLT86A==
X-Received: by 2002:a17:907:3e84:b0:a6f:5150:b807 with SMTP id a640c23a62f3a-a7dc4fcc3a6mr1144017466b.35.1722957863768;
        Tue, 06 Aug 2024 08:24:23 -0700 (PDT)
Message-ID: <1dc37ba4-c0ef-4be7-9699-31cf839c6deb@suse.com>
Date: Tue, 6 Aug 2024 17:24:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: ACPI NVS range conflicting with Dom0 page tables (or kernel
 image)
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>
Cc: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <a5a8a016-2107-46fb-896b-2baaf66566d4@suse.com>
 <ZnBCFgHltVqj2FDh@mail-itl> <6a7508dd-9f81-4fce-9c83-8b4fae924d48@suse.com>
 <ZrI_YSBSiC7w5iP6@mail-itl>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <ZrI_YSBSiC7w5iP6@mail-itl>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 06.08.24 17:21, Marek Marczykowski-Górecki wrote:
> On Tue, Aug 06, 2024 at 04:12:32PM +0200, Jürgen Groß wrote:
>> Marek,
>>
>> On 17.06.24 16:03, Marek Marczykowski-Górecki wrote:
>>> On Mon, Jun 17, 2024 at 01:22:37PM +0200, Jan Beulich wrote:
>>>> Hello,
>>>>
>>>> while it feels like we had a similar situation before, I can't seem to be
>>>> able to find traces thereof, or associated (Linux) commits.
>>>
>>> Is it some AMD Threadripper system by a chance? Previous thread on this
>>> issue:
>>> https://lore.kernel.org/xen-devel/CAOCpoWdOH=xGxiQSC1c5Ueb1THxAjH4WiZbCZq-QT+d_KAk3SA@mail.gmail.com/
>>>
>>>> With
>>>>
>>>> (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4000000
>>>> ...
>>>> (XEN)  Dom0 alloc.:   0000000440000000->0000000448000000 (619175 pages to be allocated)
>>>> ...
>>>> (XEN)  Loaded kernel: ffffffff81000000->ffffffff84000000
>>>>
>>>> the kernel occupies the space from 16Mb to 64Mb in the initial allocation.
>>>> Page tables come (almost) directly above:
>>>>
>>>> (XEN)  Page tables:   ffffffff84001000->ffffffff84026000
>>>>
>>>> I.e. they're just above the 64Mb boundary. Yet sadly in the host E820 map
>>>> there is
>>>>
>>>> (XEN)  [0000000004000000, 0000000004009fff] (ACPI NVS)
>>>>
>>>> i.e. a non-RAM range starting at 64Mb. The kernel (currently) won't tolerate
>>>> such an overlap (also if it was overlapping the kernel image, e.g. if on the
>>>> machine in question s sufficiently much larger kernel was used). Yet with its
>>>> fundamental goal of making its E820 match the host one I'm also in trouble
>>>> thinking of possible solutions / workarounds. I certainly do not see Xen
>>>> trying to cover for this, as the E820 map re-arrangement is purely a kernel
>>>> side decision (forward ported kernels got away without, and what e.g. the
>>>> BSDs do is entirely unknown to me).
>>>
>>> In Qubes we have worked around the issue by moving the kernel lower
>>> (CONFIG_PHYSICAL_START=0x200000):
>>> https://github.com/QubesOS/qubes-linux-kernel/commit/3e8be4ac1682370977d4d0dc1d782c428d860282
>>>
>>> Far from ideal, but gets it bootable...
>>>
>>
>> could you test the attached kernel patches? They should fix the issue without
>> having to modify CONFIG_PHYSICAL_START.
>>
>> I have tested them to boot up without problem on my test system, but I don't
>> have access to a system showing the E820 map conflict you are seeing.
>>
>> The patches have been developed against kernel 6.11-rc2, but I think they
>> should apply to a 6.10 and maybe even an older kernel.
> 
> Sure, but tomorrow-ish.

Thanks.

> 
>> If possible it would be nice to verify suspend to disk still working, as
>> the kernel will need to access the ACPI NVS area in this case.
> 
> That might be harder, as Qubes OS doesn't support suspend to disk, but
> I'll see if something can be done.

Thinking about it - can this ever work with Xen?


Juergen



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 15:50:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 15:50:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772937.1183377 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbMRt-0007bn-4E; Tue, 06 Aug 2024 15:50:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772937.1183377; Tue, 06 Aug 2024 15:50:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbMRt-0007bg-1R; Tue, 06 Aug 2024 15:50:09 +0000
Received: by outflank-mailman (input) for mailman id 772937;
 Tue, 06 Aug 2024 15:50:07 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbMRr-0007bW-MX; Tue, 06 Aug 2024 15:50:07 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbMRr-0000M7-G9; Tue, 06 Aug 2024 15:50:07 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbMRq-0004Os-Vd; Tue, 06 Aug 2024 15:50:07 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbMRq-0004pF-VA; Tue, 06 Aug 2024 15:50:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=37hHY6/E9zsq82gmP0cXPo9sd53A584Yarjy5BvHaF8=; b=GKKGscCH5cY73qbYJokSFBOX+L
	jkBHRKK0vlVe3rfCPZnriQQusDDF1da250va/rNjWzup7OduBd8dzyV31uC5HJ3zDMoqdnJXJEPEB
	VlBs2TWueBATLg5eMBNUZj2l378Cnywkz1ygJ2HEN0Hu/t48XPijlCK4KBveHwCKOXA8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187170-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187170: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-armhf-armhf-xl-rtds:xen-boot:fail:allowable
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=b446a2dae984fa5bd56dd7c3a02a426f87e05813
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 06 Aug 2024 15:50:06 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827

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

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

version targeted for testing:
 linux                b446a2dae984fa5bd56dd7c3a02a426f87e05813
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   20 days
Failing since        186925  2024-07-20 09:44:52 Z   17 days   35 attempts
Testing same since   187170  2024-08-06 07:07:10 Z    0 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 16:32:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 16:32:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772952.1183397 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbN6e-00067p-JK; Tue, 06 Aug 2024 16:32:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772952.1183397; Tue, 06 Aug 2024 16:32:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbN6e-00067i-F1; Tue, 06 Aug 2024 16:32:16 +0000
Received: by outflank-mailman (input) for mailman id 772952;
 Tue, 06 Aug 2024 16:32:15 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kzDu=PF=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sbN6d-0005tQ-4i
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 16:32:15 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20600.outbound.protection.outlook.com
 [2a01:111:f403:2416::600])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6eb5f844-5411-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 18:32:13 +0200 (CEST)
Received: from SN7PR04CA0114.namprd04.prod.outlook.com (2603:10b6:806:122::29)
 by PH8PR12MB6940.namprd12.prod.outlook.com (2603:10b6:510:1bf::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.13; Tue, 6 Aug
 2024 16:32:08 +0000
Received: from SN1PEPF0002636D.namprd02.prod.outlook.com
 (2603:10b6:806:122:cafe::8e) by SN7PR04CA0114.outlook.office365.com
 (2603:10b6:806:122::29) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend
 Transport; Tue, 6 Aug 2024 16:32:08 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SN1PEPF0002636D.mail.protection.outlook.com (10.167.241.138) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Tue, 6 Aug 2024 16:32:07 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 6 Aug
 2024 11:32:06 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Tue, 6 Aug 2024 11:32:06 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6eb5f844-5411-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=CUKCNick5EhAwmTXGGCiAUvG56sGGIbE/0jlDjrMENTfq0HpwciTNqH4BhKAEEOgA7Sud9VaTxOUEYp8U0CFxvZBwileaQUscG1IZwoHm2j31EyxyVXGgpM7KZSnasJa19V/UiaHm6kpHM6leKdMikdGpTf34DeifJlHXJ8Qvro6tJwT/Q5+t7Eb+Hm0rN5hq3YXtA20d1m83rkxPpZzuex+PliFR+NhFkSRppeu/yAU2boeVFNTqsfYNoVlGEZKLvYXwq+XCWRYIi1bECOjp1C7vOyy4do3kwne45NpVw+SaeFMDs9SI8xJO64NZlneMxsPbTh7Y1kOzbPQt+c/WQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=sjXHs0GS12gvovEpgz4SBPfUlhQQ5tb3kdEgFOzd9ik=;
 b=yQ8wsGhkCFKWxBhthWaf8NucgmpNyNUQc9xoFFbSxbehFojuy2jBmPrGi6C384fj6zymqrCa14iaWbrwb4J7rrA8nSwt90ZZGsNWfkbEyCEdirozt8rfvOHG/q2SpD5S3CRtAjirjKKHvrJwR+2x1M/htHdkqBBa3rOeinePKe6O+Eo88yPS2dkFI1iiTiOVewbaaia18u+9KPHyK9LrVivoSwmmR4VB9Y13QEc1XDg760Pj6Jx5YnMBT6I3VUzf2rlpuwlnNyLYv3IVTHYJMEIbL+KHyyGovYYenOUKEluCpwHslcdOwIP4rZi2H2Mrmqw/zeGcMG03eM3m56OSZQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=sjXHs0GS12gvovEpgz4SBPfUlhQQ5tb3kdEgFOzd9ik=;
 b=BDGCIU9pQoq3hqv5R4kBzTxP/PuwbV2CW5IZddbjWqkIHAzZubGAOroOH+nEFKbrqhnDuoO0Q4lf6v3PpUgkWRuRZTJCfQe1xhB2WNyE/5T5k8CpNCn0cK/aUiUPh7MeaSTCof/hSPfjP2JmzzbJDLRcqHQMr6t2GllSNa8DW2g=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<artem_mygaiev@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v3 1/3] docs: Introduce Fusa Requirement and define maintainers
Date: Tue, 6 Aug 2024 17:31:55 +0100
Message-ID: <20240806163157.2850636-2-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240806163157.2850636-1-ayan.kumar.halder@amd.com>
References: <20240806163157.2850636-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB03.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN1PEPF0002636D:EE_|PH8PR12MB6940:EE_
X-MS-Office365-Filtering-Correlation-Id: 3a9e3cb0-ac9d-4028-2bad-08dcb635507e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|36860700013|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?GcwRm+iTfn1qljqEvZS++wUDHHxSYUueDfjwfY8UvP1pNRQ71b/WmSfe1NaX?=
 =?us-ascii?Q?U3X3AjGOtYiwpS8A37iL2OVJ05IdXrKvJQaNDn1UqHuy5MZ1HTfx2xSiB63F?=
 =?us-ascii?Q?4bkUPuOdFh5dfRG/2uMRWvg5yUiHyqWtjIEd5gfAHi45r4c3Oih4dkcJ5IUs?=
 =?us-ascii?Q?yHEykcIIHUDkiCWo4g2O4Zxe7/YTDwuDks5s2oFINtSGsIFIdqCA1b9KdwB6?=
 =?us-ascii?Q?astNru4NiFg28M1qquCC6gnTKIr6N9djKWIiRP5ydNb37OylsreA4goKZKVv?=
 =?us-ascii?Q?E30KSgUsFnPP1g/79cMlmdB6LCly14R0VQFx6UvHW0b+kgkuN9kXTK9cwLDq?=
 =?us-ascii?Q?yWLIkAVOoVawTzOjr9rdP3i+ibYOX0zzCL6M83itMdHM6b+y/UcPodDWtebe?=
 =?us-ascii?Q?MGHAxNhI0/o7Hukbc7vjX/si1kAxfEpuefGp5RNHJ3FHDK56tgUVlOT2waeY?=
 =?us-ascii?Q?9nsUJz0f2JDf08iic5jo9wdheS399+deWfhbxnaIEPc6rOF2mmytX6Y2dmQB?=
 =?us-ascii?Q?ic7LHJ5y0nKtA6C+BDV2hWBvstH/0KNzvvR8qJ+cmL+51++I5HP3KblywQ9y?=
 =?us-ascii?Q?+kJnvqD7P8Jl6EFE0Vv5sl0VPfuZtuV87iNmQmAmPXOAAHOi2JyUcDqXSWU9?=
 =?us-ascii?Q?D0/85WH0MJzbneuZpq2tdwyvRD5/QbXPA/wOuuxLvMrIlINWs6mB/nkzcZAv?=
 =?us-ascii?Q?TBKowTCrX9/pQARg5Mwet2duV+w0Oz73MpP5IuN+EMycFch3GUpQQeKqJrYV?=
 =?us-ascii?Q?raZpp0a3SXDXYc53CHaMVrU3HlWp7bHBUTLX7gKk6uPh00oFJkmqmqBJ/p7O?=
 =?us-ascii?Q?zQgRnurNgKAPcfAsxQoILIpLKUCBYx/oaH361vz2PRVx/W5vwPM2bsL/CrzY?=
 =?us-ascii?Q?ffqtYMAIRxH68ZE+jHQj3lO3872EFZpjpyOx60v33uRyeHUpvgUjm8Be9e24?=
 =?us-ascii?Q?NkawWiy0XpRRbcNnmxdrJ7YUnigEIt2GWESy0qgeZzBVs4TdrbC34aLiWPp8?=
 =?us-ascii?Q?B2JZWXVV4M9AezASijeegy9j0Ef+sQVWtQyRdCMNzHGqe0MBYoSuY9CgOQQd?=
 =?us-ascii?Q?jDGcAc8VP/giKpE/ItC/bTON/Hqo+HvrPB0GT68O43f55EJaBssEqq6aaTBB?=
 =?us-ascii?Q?nF548sisCCaT/Qc0ZGFcRNW6Krc2/xgz3cHO+HsuWZ7KZ3hoXYy8/jC9ZacM?=
 =?us-ascii?Q?F4xk05588nTP2g83i3m0X3b3Ny4tFitMYitkEE0XJrfX/njGbjwNSap71mzD?=
 =?us-ascii?Q?sZ30DbCT0brUbNB2pSe8+jdUR84frfhs1HwhU7hd5lRgJ78anR85dD8q2srN?=
 =?us-ascii?Q?DQ9Ixf5/ZA35Y+AUr6PpJBCOfwAp16hlJ2kzyBQshfDDlfSE3GKXtyPNORNz?=
 =?us-ascii?Q?C9ikIUND1sNzx0ePYOaCzaU5gsN5LDmBeivlLuohvYA0bYL4fQ=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 16:32:07.8954
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 3a9e3cb0-ac9d-4028-2bad-08dcb635507e
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SN1PEPF0002636D.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6940

The FUSA folder is expected to contain requirements and other documents
to enable safety certification of Xen hypervisor.
Added a intro to explain how the requirements are categorized, written
and their supported status.
Also, added index.rst for inclusion in build docs.

Added maintainers for the same.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes from :-

v1 - 1. Added a comment from Stefano.
2. Added Ack.

v2 - 1. Renamed README to intro and changed the format from MD to RST
(as the majority of files are in RST format and it gets picked during
building of the docs).
However, the actual contents hasn't changed so I am keeping the acks.

2. Added SPDX license identifier to the intro file.

 MAINTAINERS              |  9 +++++
 docs/fusa/index.rst      |  9 +++++
 docs/fusa/reqs/index.rst |  9 +++++
 docs/fusa/reqs/intro.rst | 86 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 113 insertions(+)
 create mode 100644 docs/fusa/index.rst
 create mode 100644 docs/fusa/reqs/index.rst
 create mode 100644 docs/fusa/reqs/intro.rst

diff --git a/MAINTAINERS b/MAINTAINERS
index 7c524a8a93..0d328e065c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -314,6 +314,15 @@ F:	xen/arch/x86/include/asm/x86_*/efi*.h
 F:	xen/common/efi/
 F:	xen/include/efi/
 
+FUSA
+M:	Stefano Stabellini <sstabellini@kernel.org>
+M:	Bertrand Marquis <bertrand.marquis@arm.com>
+M:	Michal Orzel <michal.orzel@amd.com>
+M:	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
+M:	Artem Mygaiev <artem_mygaiev@epam.com>
+S:	Supported
+F:	docs/fusa/
+
 GDBSX DEBUGGER
 M:	Elena Ufimtseva <elena.ufimtseva@oracle.com>
 S:	Supported
diff --git a/docs/fusa/index.rst b/docs/fusa/index.rst
new file mode 100644
index 0000000000..13bf4e8e23
--- /dev/null
+++ b/docs/fusa/index.rst
@@ -0,0 +1,9 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+Functional Safety documentation
+===============================
+
+.. toctree::
+   :maxdepth: 2
+
+   reqs
diff --git a/docs/fusa/reqs/index.rst b/docs/fusa/reqs/index.rst
new file mode 100644
index 0000000000..78c02b1d9b
--- /dev/null
+++ b/docs/fusa/reqs/index.rst
@@ -0,0 +1,9 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+Requirements documentation
+==========================
+
+.. toctree::
+   :maxdepth: 2
+
+   intro
diff --git a/docs/fusa/reqs/intro.rst b/docs/fusa/reqs/intro.rst
new file mode 100644
index 0000000000..d67b18dd9f
--- /dev/null
+++ b/docs/fusa/reqs/intro.rst
@@ -0,0 +1,86 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+##################################
+Requirements Introduction Document
+##################################
+
+This folder contains a set of requirements describing Xen and its implementation
+in a form suitable for a safety certification process.
+
+The status is experimental and it is maintained on a best effort basis. The
+requirements may get slightly out of sync with the code. We are actively working
+on a process to keep them updated, more details to follow.
+
+The requirements writing style is inspired from the ANSI/IEEE guide to Software
+Requirements Standard 830-1984.
+
+The requirements are categorized as follows :-
+
+1. Market requirements - They define the high level functionalities of the
+hypervisor without going into concepts specific to Xen. Those should allow a
+system architect to understand wether Xen is providing the functionalities it
+needs for its system. This is the top level of the requirements.
+
+2. Product requirements - They define the Xen specific concepts and interfaces
+provided by Xen without going into implementation details. One or several of
+those requirements are linked to each market requirement. An Architect can use
+them understand how Xen fulfils a market need and design how Xen should be used
+in his system.
+
+3. Design requirements - They describe what the software implementation is doing
+from a technical point of view. One or several design requirement together
+define how product requirements are fulfilled technically and are linked to
+them. An implementer can use them to know how to write or understand the Xen
+code.
+
+The requirements are linked using OpenFastTrace
+(https://github.com/itsallcode/openfasttrace/blob/main/doc/user_guide.md).
+OpenFastTrace parses through the requirements and generates a traceability
+report.
+
+The following is the skeleton for a requirement.
+
+Title of the requirement
+========================
+
+`unique_tag`
+
+..
+
+  Each requirement needs to have a unique tag associated. The format is
+  req_type~name~revision.
+
+  Thus, it consists of three components :-
+  requirement type - This denotes the category of requirement. Thus, it shall
+  be 'XenMkt', 'XenProd' or 'XenSwdgn' to denote market, product or design
+  requirement.
+  name - This denotes name of the requirement. In case of architecture specific
+  requirements, this starts with the architecture type (ie x86_64, arm64).
+  revision number - This gets incremented each time the requirement is modified.
+
+
+Description:
+This shall describe the requirement in a definitive tone. In other words,
+the requirement begins with 'Xen shall ...'. Further, the description is
+expected to be unambiguous and consistent.
+
+Rationale:
+This describes a rationale explaining the reason of the presence of the
+requirement when this can help the reader. This field can be left blank.
+
+Comments:
+This describes the use cases for the requirement when this can help the
+reader. This field can be left blank as well.
+
+Covers:
+This denotes the unique_tag of the parent. This field is non existent for the
+market requirement as it is the top level.
+
+Needs:
+This denotes the requirement type of its children. This field is non existent
+for the design requirements as there are no subsequent requirements linked to
+them.
+
+
+The requirements are expected to the technically correct and follow the above
+guidelines.
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 16:32:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 16:32:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772953.1183406 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbN6h-0006OI-Oz; Tue, 06 Aug 2024 16:32:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772953.1183406; Tue, 06 Aug 2024 16:32:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbN6h-0006OB-MI; Tue, 06 Aug 2024 16:32:19 +0000
Received: by outflank-mailman (input) for mailman id 772953;
 Tue, 06 Aug 2024 16:32:18 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kzDu=PF=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sbN6f-0005tQ-Vg
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 16:32:17 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on2060e.outbound.protection.outlook.com
 [2a01:111:f403:2418::60e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 70ca58e3-5411-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 18:32:16 +0200 (CEST)
Received: from SN7PR04CA0093.namprd04.prod.outlook.com (2603:10b6:806:122::8)
 by LV3PR12MB9188.namprd12.prod.outlook.com (2603:10b6:408:19b::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Tue, 6 Aug
 2024 16:32:09 +0000
Received: from SN1PEPF0002636D.namprd02.prod.outlook.com
 (2603:10b6:806:122:cafe::f1) by SN7PR04CA0093.outlook.office365.com
 (2603:10b6:806:122::8) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.22 via Frontend
 Transport; Tue, 6 Aug 2024 16:32:09 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SN1PEPF0002636D.mail.protection.outlook.com (10.167.241.138) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Tue, 6 Aug 2024 16:32:09 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 6 Aug
 2024 11:32:08 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Tue, 6 Aug 2024 11:32:07 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 70ca58e3-5411-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=nUiPdNjtq71VDGuDDiFw/uDIoHEWHLezKBWhbj+ZjNs/TSe5St03Jzkm56pks+ApOFJSIfPpcsIUtTPPwBlYXY4RqTdvxSpQxTEKNgM1Bb0f83GRlX5SrJ5t3WqzlRyVZ9b8+k0ucn8rDoxfM8dCrfufj/B/fkcf08D/dt9ydF8jJK+e6c1ZzxZPmsabOqpqxrbb7+K00ZLLKrH4DvkYk7MZZ4sC0Cd6Fu2pC7tJ0Oek5Af2K456uQ1cdB7IFo5A4BgVbwMp5yIhgjmcrEiuVI/Po+ER8CKYtaA/TMYqV3BAnYftYh42TsYJkzVp5ry+g8IqLqMG7RsbfMRt6PVnyw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=nG75xyPT6ImZGBvR/mVd+v4hrOggcpDGgSesNfGn4jU=;
 b=jbqmNhiUY6SqwWYXeuvnF2rrQrTXVJgfgS67FV4Ndj5HDwMFYATiuaQJ62Qt6AM7yD18bnDZeeQ8cJdtcSEy6o4+4LewoYM2I1fX/r8RhiPUxhkacIYl044Mzud5sWgaaAnyyWbXLTEgLQpckAWiGcb6EYryjYeojEPu6aSYkJw/cEuKtnWWu0SC9NTqAsV53pcQ4/FTEocQI4JO56J9CNrTGOvNogqIf/UZ2FQ7ZqR9KYuzJdxGm4hagndTv/JscF8RqPBtn6W+ceowu2HMBJQUK0IVa0PjVLKj3TUPRWVUijk07ozPsFpU9fpbTGmiLIwxamZ38ilU2x8XQ53VIw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=nG75xyPT6ImZGBvR/mVd+v4hrOggcpDGgSesNfGn4jU=;
 b=B9RKplne18juSTA3X6bV9RMQNi7GIZIonRuHO0xdyJfH5LG+aXR0DlPImQhdllPZkqWUImJo1lX9bSaSRjGeSaiXnZaLzHqOnSDMxBdewo11v0wDUhcxvgWlYxDtdAlReUmCC6dBc9JlmFZbgPW+on5PzlIU9XLaACZ0K7QVJDk=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<artem_mygaiev@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v3 2/3] docs: fusa: reqs: Added a requirements writing style guide
Date: Tue, 6 Aug 2024 17:31:56 +0100
Message-ID: <20240806163157.2850636-3-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240806163157.2850636-1-ayan.kumar.halder@amd.com>
References: <20240806163157.2850636-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB03.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN1PEPF0002636D:EE_|LV3PR12MB9188:EE_
X-MS-Office365-Filtering-Correlation-Id: 8501c3c9-f32c-46ad-c0c1-08dcb6355135
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?7BhZAtE0jRUpJrZqOzjriDctfDxJk25HMrrr/0FOaPMjkb4Rj0wqAiKORAuP?=
 =?us-ascii?Q?r3dy16zGgvtOXyuIZxf85z+sGDTAroVXqG5QxYiB9EPw1fsSbK/AFshutHl6?=
 =?us-ascii?Q?Zo63J2mOyKaq1zOYfV2B58WZdH/C61Vc9LTzyXxjhXNO+ZkJtPyZxley94Yp?=
 =?us-ascii?Q?FVfmmtqR53CtDLSjms+iknUqqZQeVMvKKP7L+om6hf2Up8kPkcg7bfpSR1TE?=
 =?us-ascii?Q?7PBWYz4bWVNtc3NArYBN4CTXsd/9fg+AcTelc/DFG5ZNldhdF9x8oT5fdcEc?=
 =?us-ascii?Q?RlGo32zhEuGI5fEsK3SlL/rAav0n4XoGDA3YdXzpjsjQQsyg3WyyxT4ARV2x?=
 =?us-ascii?Q?JyLErmUiZFY4GMfTWqfD2yqThve+Su6uV7fyCHWYw24I32MDWGuptAl0sYyD?=
 =?us-ascii?Q?H8PVkgOvQOhYDsfTHtNVwQ2pPE7ARoPbEWOacOd5oGgb0gn9W/rFSLExoB7Q?=
 =?us-ascii?Q?gV+oe/2oNK8wBLbNwCvoVg1RTsl1uBYB9xZ0FK54nZxKCPbGUmXVD2v56AMk?=
 =?us-ascii?Q?77MSVoNVJVVff3/6EdBWpcby26/ZEV66T4yNBgicyIAe4O9isJNIaxeuWUwD?=
 =?us-ascii?Q?x+HJd+cDb6jqp5mKWX+ZwG7445CX1ZTC0HOXqQ/FCdRh0r78dKlzU4mYDViG?=
 =?us-ascii?Q?fMuOpCnW2M36CPxFyOkaWaqkTyAQaIRUmezZlQahP4z42Es/uT7L/DJMueJ/?=
 =?us-ascii?Q?DXIox5rsczDHPV3Ad76ICg679tZuHy3WNT8PGtA7L0hIRyCpnzQ00pA2/hPT?=
 =?us-ascii?Q?21Cq66VfJ37iYs70K4Avl0cnMcprBdn/NqjWJMpv4qKVeUSha186aSDwS86P?=
 =?us-ascii?Q?wevIpid4keUVYH2D+GFaeKd6SvLTxmb0UNvYshIjdonGSOu5HHWu6CZrsOnc?=
 =?us-ascii?Q?AOs1rluY6BB5ijvbLvRNGIWrFLemq0v27ndpLnw5VjjjF9QQrbcE5m7snJq+?=
 =?us-ascii?Q?CYuRsPLQQ+Zb9tbaGJWyXMzfDuaBBazJJ1D8OMjXRUSy0hMZ0wAHbxkJ/9ur?=
 =?us-ascii?Q?u+abODo0LjyKtkORqKB3b3etZZOeKE/E4Z7AUdsaDEW2rOnWp0ocSNL2g8fD?=
 =?us-ascii?Q?hKOxo/oa9v4eBT7818HmzXYBg2SAZxzpIwTGDwTbLruPNqEktOnaVs9fP2AF?=
 =?us-ascii?Q?kNNsVm3HVd969ya9hCsZ7y37ruQKtvszYueMM2JwLF/7OhsvBLNWKDbHpFsN?=
 =?us-ascii?Q?JcwDHDynB+YRtD7OS31cWKUo+OLxUtrlTVL+bszfdTgfvwEK5pkDMpVBodcS?=
 =?us-ascii?Q?bBS3Ckb5QpjdmOoPRv67sfqW9DMW9oclLhbSQmFSbwgHTl5E6e/YP6hOJ3oy?=
 =?us-ascii?Q?/YSODfpdQsZZraeUGfQufBrrkzqQR7Jmrf/e8FlREBiTXy2mi0QnQm2OD34X?=
 =?us-ascii?Q?DSAC/zraJV/U6k+ZVMGr3K2+zZDZ//p5kjnywZaOtQOSyGI6CYTuWN9jcCMm?=
 =?us-ascii?Q?CZtbrj2t3x69Yljy9dwpfzrXPG0CY+OX?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 16:32:09.0985
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 8501c3c9-f32c-46ad-c0c1-08dcb6355135
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SN1PEPF0002636D.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9188

Added a guide to help write and review requirements. The requirements
are written to enable safety certification of Xen hypervisor.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Acked-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
Changes from -

v1, v2 - No changes.

 docs/fusa/reqs/REQUIREMENTS-STYLE | 34 +++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 docs/fusa/reqs/REQUIREMENTS-STYLE

diff --git a/docs/fusa/reqs/REQUIREMENTS-STYLE b/docs/fusa/reqs/REQUIREMENTS-STYLE
new file mode 100644
index 0000000000..cd2408b9f2
--- /dev/null
+++ b/docs/fusa/reqs/REQUIREMENTS-STYLE
@@ -0,0 +1,34 @@
+Requirements writing style for the Xen Hypervisor
+=================================================
+
+The requirements writing style described below is the style used for writing the
+requirements of the Xen hypervisor to enable functional safety certification.
+
+The requirements writing style is inspired from the ANSI/IEEE guide to Software
+Requirements Standard. Specifically, the requirements should satisfy the
+following validation checklist.
+(Source - https://www.nasa.gov/reference/appendix-c-how-to-write-a-good-requirement)
+
+Clarity -
+The requirements should be clear, unambiguous, consise and simple. Each
+requirement should express a single thought. Each requirement stated should have
+a single interpretation.
+
+Consistency -
+Any requirement shouldn't contradict with any other requirement. The requirements
+should be categorized correctly (the categories have been explained in the
+README). The tone of each requirement should be definitive (ie "Xen shall ..."
+should be present in each requirement).
+
+Traceability -
+Any market requirement should be linked to the product requirement/s and
+vice versa. Any product requirement should be linked to the design requirement/s
+and vice versa. Full bi-directional traceability should be maintained between
+market, product and design requirements.
+
+Correctness -
+The requirements should be feasible and technically correct (at the time of
+writing). However, it is not expected that the requirements will be kept upto
+date with the code.
+
+The requirements follow the same license and line length as the code.
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 16:32:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 16:32:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772954.1183417 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbN6l-0006fd-5f; Tue, 06 Aug 2024 16:32:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772954.1183417; Tue, 06 Aug 2024 16:32:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbN6l-0006fU-2P; Tue, 06 Aug 2024 16:32:23 +0000
Received: by outflank-mailman (input) for mailman id 772954;
 Tue, 06 Aug 2024 16:32:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kzDu=PF=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sbN6j-0006ds-Gy
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 16:32:21 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on20623.outbound.protection.outlook.com
 [2a01:111:f403:2412::623])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 728445f0-5411-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 18:32:19 +0200 (CEST)
Received: from SN7PR04CA0108.namprd04.prod.outlook.com (2603:10b6:806:122::23)
 by IA0PR12MB8256.namprd12.prod.outlook.com (2603:10b6:208:407::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Tue, 6 Aug
 2024 16:32:12 +0000
Received: from SN1PEPF0002636D.namprd02.prod.outlook.com
 (2603:10b6:806:122:cafe::1a) by SN7PR04CA0108.outlook.office365.com
 (2603:10b6:806:122::23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend
 Transport; Tue, 6 Aug 2024 16:32:11 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SN1PEPF0002636D.mail.protection.outlook.com (10.167.241.138) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Tue, 6 Aug 2024 16:32:11 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 6 Aug
 2024 11:32:10 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Tue, 6 Aug 2024 11:32:09 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 728445f0-5411-11ef-bc04-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=etdKK395KNo7Yq06oURYqjTqkV/eX5eIJPo3+JD6QPs10VlBNEqCXnLTnJcQG7i52FHMIXH2yIygG25r3Q5rAMHr99Y0Rnl8o2vMjSYlLoFTcVhpr6XiR1yfmvrOWj8SS9CR/TTqDO622DA4EwS4QXa0jmNoPkU93h2VWRsnQsGzv+XNSZjr3+V8eVrO2WmiAtCtzcOvqu/QCFxDTPy4vK+kqXcvjCn3akrZGaOoMVchwqDMaJi9bobFrwBDQrCwraxdiAgmeJoRHr7ya7ZuTRi9jB7P2+T64y0iOSOeGWr9Cqml2Mdgga/DeYEaMTbbV7aVQYb7mv5B26NiFFmqkg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Ro4RCdbeVMPWPxCUKX0Z9qQcm5SjMsD0JCUP7059ZMU=;
 b=xwXxu9CqW1nRXM01pvOPOHo2dtiKC3MfApNv5o8oO4WnS2hIfexmbPIkRCAUophF3+6AjHgDWgB6EU2hKkGBhdfmp+m9/wkt+AGFZ0ovQSLGLOSLHa/SfBB34Pt5CbfArnlfmYlsdrtYWfwK7hJA+OTibbqd9/2jemIquvUbYKmX2HMCLlnnBg9T/ukKX7C8FITLNUfJaaKfzJT/IeP9dy6oTsBQ7Z84RoM5HqEtcbc8XhmzEd8IBO7zqmx6v2+ljh3CEzH2FiJm4KHpDUGN6RkzqULfXW0drxVcTvSbNL8Flys85TwrUSXZhY8sBDA7mZJAB2j5U4QTEFwOgEm4yQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Ro4RCdbeVMPWPxCUKX0Z9qQcm5SjMsD0JCUP7059ZMU=;
 b=rTISSYUzgj5wSCl3sflUjwFBhlSXoxpUHrblcjAdCM0CeDinSKAIXlY/giWL+pTgkVVL8AhmpIyy91X987WVecVExU/Nc97Yk77VM2osFxmF172iybjeAltkPPnS0X7Pp1L1z3ntTgjzH5kInUA2MOXpEDMgQ/k+vZvlvqjN1Ic=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<artem_mygaiev@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v3 3/3] docs: fusa : reqs: Added a sample of requirements [DO_NOT_MERGE]
Date: Tue, 6 Aug 2024 17:31:57 +0100
Message-ID: <20240806163157.2850636-4-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240806163157.2850636-1-ayan.kumar.halder@amd.com>
References: <20240806163157.2850636-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB03.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN1PEPF0002636D:EE_|IA0PR12MB8256:EE_
X-MS-Office365-Filtering-Correlation-Id: 71aa3aa4-1df0-4934-c161-08dcb63552db
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?NFs7yay+imCQ6Os/a4YaIc4qLiiA08yQ+OJFYK+5j6a2o6ZogB2Fz129vtEw?=
 =?us-ascii?Q?vgisnjyzvKUUkbJS6mtlra+eqSC7w4GvBGuuqf3Lio8qFO8edVWLhJhL1goM?=
 =?us-ascii?Q?Jp0CW23HDbz3IfwYqMC4eO5rrr4ZLnl5ApHUeyJ/0eWtl0juPgV4vx4Ffof/?=
 =?us-ascii?Q?ZZy+paVgYSCxBc/D3o+FJEM0Yw24SdV1proSBxvaK2QouajwUHs4WjFUsYs4?=
 =?us-ascii?Q?RgDOScbbDFAas9KZWmwjT/kA1bB8JJgmp+dsrdzzOfMjk0NKo8hrR6Elcqb4?=
 =?us-ascii?Q?ErOVfqNK5AjTGWk/By/BNPZvBRRjLMzfz7Tdpn/E0Rbs9S5D2govzhpqBkoF?=
 =?us-ascii?Q?rDu1eb2Qtl39GvH2M2poifA/+eqo2k9tpXrX+j13W+zCOMyqu7mBzJ1yldJD?=
 =?us-ascii?Q?yRrBXPhvAApDpBO5RhlF8yrYDwBx0MTstd9j2nND26ju9G0HHzakgdQ10JaW?=
 =?us-ascii?Q?oVnHPCE17TGWuPiePvniSqm6Wxr60pIANqnF3Po/xfoD7i1ScQX4ssiGjqTK?=
 =?us-ascii?Q?TI3diJHWUCuBljaz3H08zbTHXi6/jdW9CcCtb0+EdR6QHPuuPm7os1Q2gp15?=
 =?us-ascii?Q?aDd9NgSbtYZ9WdgoeZBQKmytox5F2+hSvH2rw0U6grvEN/wkWZ8utiIBQ6+S?=
 =?us-ascii?Q?dCbv2K3F/hFbRZs8a2upqkpnuC19V1Hb0TyYsvO9RS7zvrb10/hY1sCrgqwi?=
 =?us-ascii?Q?zKe5RJu8eM3AD9fklCSZyXbZ7D3egTqF4cX7rqZvG0KRKxj0zEMlAtX7dVJk?=
 =?us-ascii?Q?A738t4MBrIBUnHuaiNyme+ImziN9cZeNXJVpag4cZ4zlWsGi1lQM2JlC7R19?=
 =?us-ascii?Q?X40nk22hbCXpA0UXXZD033/o6imeSuEhRgKTSM0MsOcE4NY+bi7l4gXgLcMy?=
 =?us-ascii?Q?6fmvfqu1SfBsGCHWGJpInMPEiA9reggQimM5VlYXnMr1HqtLWpm5zu7zt8v+?=
 =?us-ascii?Q?LrTBkQeKq8BxWzr7PFQWGQTinIZJtPsiVH98NeFpyFkjM/AEf9d2jXmo+U2x?=
 =?us-ascii?Q?bfEm2xyILCagSSjfYRopBaTbhHsDOgmrvZuWVfGmXQXeh4d5L4mQVKdEnTgo?=
 =?us-ascii?Q?6UBMWYLU+CDm8eWQWRX5EzDkNhz3RUPMmY9e1PVXjgRUPvS6j+xXMchB20YZ?=
 =?us-ascii?Q?YCijyeB2ORV83F4Ca3T9NFlvbX2c98g24Ab9g6mypYsEMAg3XMn16OTpok2i?=
 =?us-ascii?Q?I/HQ0LDTt75KEEHNTriMikFof7ui3AltViXZUGpbAoAtmhA3xOHakUHWI6if?=
 =?us-ascii?Q?PLBgCTfgka5t35CgLLar7zLbTfKpB8JvBKEW1iEPKdAu3BiDq67n9R6qET03?=
 =?us-ascii?Q?T5sXqsMc1A7c/TjlQ4yp4VVbRIZKC2eojkFUOTrpPlqj6Acy/7iwMHRrBB4o?=
 =?us-ascii?Q?8vc+gxJg7i0NNsGDoo9j42qSsp9l?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 16:32:11.8485
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 71aa3aa4-1df0-4934-c161-08dcb63552db
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SN1PEPF0002636D.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8256

Added a sample of market, product and design requirements. This is to
help explain how we are writing the requirements and understand the
context of the first patch.
We will be sending these requirements for review in the subsequent
patches.

Please do not merge this patch.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
Changes from :-

v1, v2 - No changes.

 .../reqs/design-reqs/arm64/emulated-uart.rst  | 240 ++++++++++++++++++
 .../reqs/design-reqs/arm64/generic-timer.rst  | 146 +++++++++++
 docs/fusa/reqs/design-reqs/xen-version.rst    | 207 +++++++++++++++
 docs/fusa/reqs/market-reqs/reqs.rst           |  77 ++++++
 docs/fusa/reqs/product-reqs/reqs.rst          |  64 +++++
 5 files changed, 734 insertions(+)
 create mode 100644 docs/fusa/reqs/design-reqs/arm64/emulated-uart.rst
 create mode 100644 docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
 create mode 100644 docs/fusa/reqs/design-reqs/xen-version.rst
 create mode 100644 docs/fusa/reqs/market-reqs/reqs.rst
 create mode 100644 docs/fusa/reqs/product-reqs/reqs.rst

diff --git a/docs/fusa/reqs/design-reqs/arm64/emulated-uart.rst b/docs/fusa/reqs/design-reqs/arm64/emulated-uart.rst
new file mode 100644
index 0000000000..483db92fa8
--- /dev/null
+++ b/docs/fusa/reqs/design-reqs/arm64/emulated-uart.rst
@@ -0,0 +1,240 @@
+UART
+====
+
+The following are the requirements related to SBSA UART [1] emulated and
+exposed by Xen to Arm64 domains.
+
+Probe the UART device tree node
+-------------------------------
+
+`XenSwdgn~arm64_uart_probe_dt_node~1`
+
+Description:
+Xen shall generate a device tree node for the SBSA UART (in accordance to Arm
+SBSA UART device tree binding [2]) to allow domains to probe it.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Transmit data in software polling mode
+--------------------------------------
+
+`XenSwdgn~arm64_uart_transmit_data_poll_mode~1`
+
+Description:
+Domain shall transmit data in polling mode (i.e. without involving interrupts).
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Transmit data in interrupt driven mode
+--------------------------------------
+
+`XenSwdgn~arm64_uart_transmit_data_irq_mode~1`
+
+Description:
+Domain shall transmit data in interrupt driven mode.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Receive data in software polling mode
+-------------------------------------
+
+`XenSwdgn~arm64_uart_receive_data_polling_mode~1`
+
+Description:
+Domain shall receive data in polling mode (i.e. without involving interrupts).
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Receive data in interrupt driven mode
+-------------------------------------
+
+`XenSwdgn~arm64_uart_receive_data_interrupt_driven_mode~1`
+
+Description:
+Domain shall receive data in interrupt driven mode.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART data register
+-------------------------
+
+`XenSwdgn~arm64_uart_access_data_register~1`
+
+Description:
+Domain shall access (read/write) UART data register.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART receive status register
+-----------------------------------
+
+`XenSwdgn~arm64_uart_access_receive_status_register~1`
+
+Description:
+Domain shall access (read/write) UART receive status register.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART flag register
+-------------------------
+
+`XenSwdgn~arm64_uart_access_flag_register~1`
+
+Description:
+Domain shall access (read only) UART flag register.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART mask set/clear register
+-----------------------------------
+
+`XenSwdgn~arm64_uart_access_mask_register~1`
+
+Description:
+Domain shall access (read/write) UART mask set/clear register.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART raw interrupt status register
+-----------------------------------------
+
+`XenSwdgn~arm64_uart_access_raw_interrupt_status_register~1`
+
+Description:
+Domain shall access (read only) UART raw interrupt status register.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART masked interrupt status register
+--------------------------------------------
+
+`XenSwdgn~arm64_uart_access_mask_irq_status_register~1`
+
+Description:
+Domain shall access (read only) UART masked interrupt status register.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART interrupt clear register
+------------------------------------
+
+`XenSwdgn~arm64_uart_access_irq_clear_register~1`
+
+Description:
+Domain shall access (write only) UART interrupt clear register.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Receive UART TX interrupt
+-------------------------
+
+`XenSwdgn~arm64_uart_receive_tx_irq~1`
+
+Description:
+Domain shall receive UART TX interrupt
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Receive UART RX interrupt reception
+-----------------------------------
+
+`XenSwdgn~arm64_uart_receive_rx_irq~1`
+
+Description:
+Domain shall receive UART RX interrupt
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Initial State
+=============
+
+Access UART in an initial (reset) state
+---------------------------------------
+
+`XenSwdgn~arm64_uart_access_reset_state~1`
+
+Description:
+Domain shall be given the access to the UART in a state, where all registers
+hold the reset value according to the specification [3] (only for registers
+implemented as part of SBSA UART).
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+| [1] Arm Base System Architecture, chapter B
+| [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/serial/arm_sbsa_uart.txt
+| [3] PrimeCell UART (PL011)
diff --git a/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
new file mode 100644
index 0000000000..00228448a3
--- /dev/null
+++ b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
@@ -0,0 +1,146 @@
+Generic Timer
+=============
+
+The following are the requirements related to ARM Generic Timer [1] interface
+exposed by Xen to Arm64 domains.
+
+Probe the Generic Timer device tree node from a domain
+------------------------------------------------------
+
+`XenSwdgn~arm64_probe_generic_timer_dt~1`
+
+Description:
+Xen shall generate a device tree node for the Generic Timer (in accordance to
+ARM architected timer device tree binding [2]) to allow domains to probe it.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Read system counter frequency
+-----------------------------
+
+`XenSwdgn~arm64_read_system_counter_freq~1`
+
+Description:
+Domain shall read the frequency of the system counter (either via CNTFRQ_EL0
+register or "clock-frequency" device tree property if present).
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Access CNTKCTL_EL1 system register from a domain
+------------------------------------------------
+
+`XenSwdgn~arm64_access_cntkctl_el1_system_register~1`
+
+Description:
+Domain shall access the counter-timer kernel control register to allow
+controlling the access to the timer from userspace (EL0).
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Access virtual timer from a domain
+----------------------------------
+
+`XenSwdgn~arm64_access_virtual_timer~1`
+
+Description:
+Domain shall access and make use of the virtual timer by accessing the following
+system registers:
+CNTVCT_EL0,
+CNTV_CTL_EL0,
+CNTV_CVAL_EL0,
+CNTV_TVAL_EL0.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Access physical timer from a domain
+-----------------------------------
+
+`XenSwdgn~arm64_access_physical_timer~1`
+
+Description:
+Domain shall access and make use of the physical timer by accessing the
+following system registers:
+CNTPCT_EL0,
+CNTP_CTL_EL0,
+CNTP_CVAL_EL0,
+CNTP_TVAL_EL0.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Trigger the virtual timer interrupt from a domain
+-------------------------------------------------
+
+`XenSwdgn~arm64_trigger_virtual_timer_interrupt~1`
+
+Description:
+Domain shall program the virtual timer to generate the interrupt when the
+asserted condition is met.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Trigger the physical timer interrupt from a domain
+--------------------------------------------------
+
+`XenSwdgn~arm64_trigger_physical_timer_interrupt~1`
+
+Description:
+Domain shall program the physical timer to generate the interrupt when the
+asserted condition is met.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Assumption of Use on the Firmware
+=================================
+
+Expose system timer frequency
+-----------------------------
+
+`XenSwdgn~arm64_program_cntfrq_el0_or_dt_prop_system_timer_freq~1`
+
+Description:
+Underlying firmware shall program CNTFRQ_EL0 with the system timer frequency.
+As an alternative, "clock-frequency" dt property (in the host device tree) can
+also be used to specify the system timer frequency. This helps in case of buggy
+firmware when CNTFRQ_EL0 is programmed incorrectly or not programmed at all.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
diff --git a/docs/fusa/reqs/design-reqs/xen-version.rst b/docs/fusa/reqs/design-reqs/xen-version.rst
new file mode 100644
index 0000000000..c5c58bb2df
--- /dev/null
+++ b/docs/fusa/reqs/design-reqs/xen-version.rst
@@ -0,0 +1,207 @@
+Hypercall xen_version
+=====================
+
+The following are the requirements related to __HYPERVISOR_xen_version hypercall
+[1] exposed by Xen to Arm64 and AMD64 PVH domains.
+
+Access hypercall __HYPERVISOR_xen_version for getting xen version
+-----------------------------------------------------------------
+
+`XenSwdgn~access_hyp_xen_version_read_ver~1`
+
+Description:
+Domain shall access __HYPERVISOR_xen_version passing XENVER_version
+as a command.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Validate the xen version returned by the XENVER_version command
+---------------------------------------------------------------
+
+`XenSwdgn~validate_version_hyp_xen_version~1`
+
+Description:
+The xen version returned should correspond to 4.18.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Access hypercall __HYPERVISOR_xen_version for getting xen extraversion
+----------------------------------------------------------------------
+
+`XenSwdgn~access_hyp_xen_version_get_extraversion~1`
+
+Description:
+Domain shall access __HYPERVISOR_xen_version passing XENVER_extraversion as a
+command.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Access hypercall __HYPERVISOR_xen_version for getting compile information
+-------------------------------------------------------------------------
+
+`XenSwdgn~access_hyp_xen_version_get_compile_info~1`
+
+Description:
+Domain shall access __HYPERVISOR_xen_version passing XENVER_compile_info as a
+command.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Access hypercall __HYPERVISOR_xen_version for getting capabilities
+------------------------------------------------------------------
+
+`XenSwdgn~access_hyp_xen_version_get_capabilities~1`
+
+Description:
+Domain shall access __HYPERVISOR_xen_version passing XENVER_capabilities as a
+command.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Validate the capabilities returned by XENVER_capabilities command
+-----------------------------------------------------------------
+
+`XenSwdgn~validate_cap_return_xenver_capabilities~1`
+
+Description:
+For Arm64, the capabilities returned should be xen-*-aarch64 string.
+For AMD64 PVH, the capabilities returned should be hvm-*-x86_64 string.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Access hypercall __HYPERVISOR_xen_version for getting changeset
+---------------------------------------------------------------
+
+`XenSwdgn~access_hyp_xen_version_get_changeset~1`
+
+Description:
+Domain shall access __HYPERVISOR_xen_version passing XENVER_changeset
+as a command.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Access hypercall __HYPERVISOR_xen_version for getting features
+--------------------------------------------------------------
+
+`XenSwdgn~access_hyp_xen_version_get_features~1`
+
+Description:
+Domain shall access __HYPERVISOR_xen_version passing XENVER_get_features as a
+command.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Check supported features returned by the XENVER_get_features command when the submap index passed is 0
+------------------------------------------------------------------------------------------------------
+
+`XenSwdgn~check_supported_features_xenver_get_features~1`
+
+Description:
+For Arm64, the bit position corresponding to the supported features should be 1.
+Examples of Arm64 supported features:
+
+ * XENFEAT_ARM_SMCCC_supported
+
+For AMD64 PVH, the bit positions corresponding to the supported features should
+be 1.
+Examples of AMD64 PVH supported features:
+
+ * XENFEAT_memory_op_vnode_supported
+ * XENFEAT_vcpu_time_phys_area
+ * XENFEAT_runstate_phys_area
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Access hypercall __HYPERVISOR_xen_version for getting guest handle
+------------------------------------------------------------------
+
+`XenSwdgn~access_hyp_xen_version_get_guest_handle~1`
+
+Description:
+Domain shall access __HYPERVISOR_xen_version passing XENVER_guest_handle as a
+command.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Access hypercall __HYPERVISOR_xen_version for getting xen pagesize
+------------------------------------------------------------------
+
+`XenSwdgn~access_hyp_xen_version_get_xen_pagesize~1`
+
+Description:
+Domain shall access __HYPERVISOR_xen_version passing XENVER_pagesize
+as a command and NULL as the guest handle.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+Validate the page size returned by XENVER_pagesize command
+----------------------------------------------------------
+
+`XenSwdgn~validate_page_size_xenver_pagesize_cmd~1`
+
+Description:
+The returned page size should be 4KB.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~version_hypercall~1`
+
+| [1] https://xenbits.xenproject.org/gitweb/?p=xen.git;a=blob;f=xen/include/public/version.h;hb=HEAD
diff --git a/docs/fusa/reqs/market-reqs/reqs.rst b/docs/fusa/reqs/market-reqs/reqs.rst
new file mode 100644
index 0000000000..a3f84cd503
--- /dev/null
+++ b/docs/fusa/reqs/market-reqs/reqs.rst
@@ -0,0 +1,77 @@
+Functional Requirements
+=======================
+
+Run Arm64 VMs
+-------------
+
+`XenMkt~run_arm64_vms~1`
+
+Description:
+Xen shall run Arm64 VMs.
+
+Rationale:
+
+Comments:
+
+Needs:
+ - XenProd
+
+Run AMD-x86 VMs
+---------------
+
+`XenMkt~run_x86_vms~1`
+
+Description:
+Xen shall run AMD-x86 VMs.
+
+Rationale:
+
+Comments:
+
+Needs:
+ - XenProd
+
+Support non paravirtualised VMs
+-------------------------------
+
+`XenMkt~non_pv_vms_support~1`
+
+Description:
+Xen shall support running guests which are not virtualisation aware.
+
+Rationale:
+
+Comments:
+
+Needs:
+ - XenProd
+
+Provide console to the VMs
+--------------------------
+
+`XenMkt~provide_console_vms~1`
+
+Description:
+Xen shall provide a console to a VM.
+
+Rationale:
+
+Comments:
+
+Needs:
+ - XenProd
+
+Provide timer to the VMs
+------------------------
+
+`XenMkt~provide_timer_vms~1`
+
+Description:
+Xen shall provide a timer to a VM.
+
+Rationale:
+
+Comments:
+
+Needs:
+ - XenProd
diff --git a/docs/fusa/reqs/product-reqs/reqs.rst b/docs/fusa/reqs/product-reqs/reqs.rst
new file mode 100644
index 0000000000..9954b7532a
--- /dev/null
+++ b/docs/fusa/reqs/product-reqs/reqs.rst
@@ -0,0 +1,64 @@
+Domain Creation And Runtime
+===========================
+
+Emulated UART
+-------------
+
+`XenProd~emulated_uart~1`
+
+Description:
+Xen shall emulate Arm SBSA UART on behalf of the domains.
+
+Rationale:
+
+Comments:
+The domains can use it to write/read to/from the console.
+
+Covers:
+ - `XenMkt~run_arm64_vms~1`
+ - `XenMkt~non_pv_vms_support~1`
+ - `XenMkt~provide_console_vms~1`
+
+Needs:
+ - XenSwdgn
+
+Emulated Timer
+--------------
+
+`XenProd~emulated_timer~1`
+
+Description:
+Xen shall emulate Arm Generic Timer timer on behalf of domains.
+
+Rationale:
+
+Comments:
+The domains can use it for e.g. scheduling.
+
+Covers:
+ - `XenMkt~run_arm64_vms~1`
+ - `XenMkt~non_pv_vms_support~1`
+ - `XenMkt~provide_timer_vms~1`
+
+Needs:
+ - XenSwdgn
+
+Version Hypercall
+-----------------
+
+`XenProd~version_hypercall~1`
+
+Description:
+Xen shall provide an interface to expose Xen version, type and compile
+information.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenMkt~run_arm64_vms~1`
+ - `XenMkt~run_x86_vms~1`
+
+Needs:
+ - XenSwdgn
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 16:32:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 16:32:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772951.1183386 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbN6d-0005th-Ah; Tue, 06 Aug 2024 16:32:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772951.1183386; Tue, 06 Aug 2024 16:32:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbN6d-0005ta-7e; Tue, 06 Aug 2024 16:32:15 +0000
Received: by outflank-mailman (input) for mailman id 772951;
 Tue, 06 Aug 2024 16:32:14 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kzDu=PF=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sbN6c-0005tQ-GI
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 16:32:14 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on20615.outbound.protection.outlook.com
 [2a01:111:f403:2412::615])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6ce4ca88-5411-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 18:32:10 +0200 (CEST)
Received: from SN7PR04CA0091.namprd04.prod.outlook.com (2603:10b6:806:122::6)
 by DS0PR12MB8527.namprd12.prod.outlook.com (2603:10b6:8:161::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Tue, 6 Aug
 2024 16:32:05 +0000
Received: from SN1PEPF0002636D.namprd02.prod.outlook.com
 (2603:10b6:806:122:cafe::f8) by SN7PR04CA0091.outlook.office365.com
 (2603:10b6:806:122::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.23 via Frontend
 Transport; Tue, 6 Aug 2024 16:32:05 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SN1PEPF0002636D.mail.protection.outlook.com (10.167.241.138) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Tue, 6 Aug 2024 16:32:05 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 6 Aug
 2024 11:32:04 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Tue, 6 Aug 2024 11:32:03 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6ce4ca88-5411-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=aBLB6b4mFhC5Mz+4dGlup34y0QoZVckgukzX9+lUxe9sfPNrA7IB6rf9jeFS8ok5wt16n0anw3SaBmtqwyyk0yx9/M9mhKbdw78IGq8ho67VxCuN0BtXp3wS8FCTeuLSMG7hPS7Daae9rVl2lONwCjZpwseYfVXU5/3V6tJhohG7OXPMzppvk5hT40B8A1LIABIVpAVXFL7yB5+kH2APTG5IVindY0uI5q5gnqZrdpXejSbFtWX2rXCw5dAj59oLcN6eASD9XYWWBhW1c+KeMRn6XbR7auU5W996m72bRlgZKY7DVhlXPHtaL3xw6dXnM4pTeOqtIKhH2vBryDKZ8g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0bb26WuaFZVbtVLb9SlV+3buAosHUSgsuXTVaggE8UA=;
 b=hcbFO3Ap5ZEUKvvAPK5R3f0ITL5E3ufjBL8oeaE67/WWfEA7A8GuiRmStr96Be40fxloHahgNZHcfkuSTLexjHVmN3ZNb7yMyAHm3TvRD8dmCW+W+mmS+IiUG3DpVg/L/L4m0EtZHUb9CAotVxFRdzVtEc4yxB2xNQ7Jn8mPfz6m93ijYGj2cDkV2MRxK6VZE2FGp5aHbkZ6CFVdGa65U65Q9xaBYtTkqZRrWYgjx2wQQZm6XThaudFzQ8xpbiHebIt+UHa/TYR0Rfolsy27clQI0jnE2ehFmeHv7YFzlLe5kvu+4n5vrBTY0iZcZzDdTtbcQIP797k3/WxhnDf5PQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0bb26WuaFZVbtVLb9SlV+3buAosHUSgsuXTVaggE8UA=;
 b=REXePFuqSSv6Pe0gFDNXIT1Zscz5H5pXOPzPz2gUIpwfYwE9Nlcso7bxplaPwaAe/QK6Ao+GHr8YwaZJ7Cr5Q05Tv1zJtTpStTDIVKVehZfO590R+IwG0wX6W1nBd2yJZ00SZwwPQAsKCX/BlRJLNLOTM6WvuQBLNfCqSZqLSFM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<artem_mygaiev@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v3 0/3] Introduce functional safety related documents
Date: Tue, 6 Aug 2024 17:31:54 +0100
Message-ID: <20240806163157.2850636-1-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB03.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN1PEPF0002636D:EE_|DS0PR12MB8527:EE_
X-MS-Office365-Filtering-Correlation-Id: 43622a85-7e75-4ec3-a15a-08dcb6354ece
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?vh7YITdKp1GUJRfJ6iKWY8ZYdCBe/pB39vmxfveYtdg/b5deyodL7xc+L/kE?=
 =?us-ascii?Q?e6gTXYb8z7FFxSqp/FS55FLdXAmBjY+7QB9ntFuRGvNRRdTP0aNcui76Ex9G?=
 =?us-ascii?Q?3oKXVeDzHH/IHprmzqzXNguW2lSiRkqU5+M3Dpo7n2zrc1h1j2RnTFjoEHJ8?=
 =?us-ascii?Q?YQVQZ0BG2YaIaPcK83IfgDQvjHlITDhuAH2Ow24VlxIdt+ko5ilXHoPQ5yOQ?=
 =?us-ascii?Q?OdsoCQ3hH7xS3CyPdZGdysXjTszJFVWCy+X+BXqVJbx+Kvc2LEEvFGwT8E6V?=
 =?us-ascii?Q?OOfAAD2LSsBU5X9kbo2Wl/2sbbBcbXaH0XWGzz+9GxLBSSFezoAafTTWdAIi?=
 =?us-ascii?Q?QfIY9wcuiyS8GNbx6WzHTroZVdQ1BOuzabLUazWRxK+OxPbwZ13r7jp6hj4x?=
 =?us-ascii?Q?EfY6Lel+S33iThqPsRhaUDpk/5CKThTh4FGDaER2oby444xXmfQYdCnwDOG4?=
 =?us-ascii?Q?OIt5+CdmX9zcoke3W39iBiYOLct53ySLQUY9lDGqGlXeucTv7AOhZCOV5yFT?=
 =?us-ascii?Q?qiHXETzggL84h3OF7wIbnvt/fX51KIYt50XY8G3MZtGF5nNNmByk96fme1/K?=
 =?us-ascii?Q?ox+Tzo0iiF3owAOt6cei2A6wrmM8SYoLEJEBOyyV5EBueQQRvl2TDAsvrQcn?=
 =?us-ascii?Q?m/87h3u2Ci07SoiQWJxtdvC4VLtlfNgZgZsfC4ZPAfdRRUxan47VEs841Gjv?=
 =?us-ascii?Q?qMOzA8dLZ2L+LVrAanP8W/l/xOPm78sp0Zc569V1Dx8niwd1ZPvNIG3d4NlH?=
 =?us-ascii?Q?+UGEcd+NHrBTc7f6hthOOMite3O9YW6ooqKOyodV6UkuQIvP5Kau8vmNd6bf?=
 =?us-ascii?Q?S7iin3Tq4bSl3frS38ZhquVNXmkKgff7mpIGAQV/PoQ6yAeWBkZrYgvP+oo/?=
 =?us-ascii?Q?sa/GfBR8W/G7v3eldZv4rrDVc0guPZS7ftEJMNhJZ1JcLM2LPJ1PekiJnoGu?=
 =?us-ascii?Q?akD6Dz1ewfmLBY9s4eHArRRfyGhCWGVLEE5G8u/JLfAKeA1B1WPvfwhdYi+U?=
 =?us-ascii?Q?85q6O6EjmSAidm0ysum3iIwvCdbWvAZir9wfu9QnxDEeSS95dYIMr5S/vPZJ?=
 =?us-ascii?Q?71oRnXuanOkNhHgjFGXlnIIcYwNo1a07FC3z9HtHCzWFLHO1J641kUZAtBXq?=
 =?us-ascii?Q?Jg2VLWxSoHCq/o07QVOi0ane1HxOj4gSvxK2gkegdbJHpaV7mwFubc5DZSxC?=
 =?us-ascii?Q?3ZUKlWohxiaYUPXLwqn8FSurLsXdDNFElKtEGQjxX0ZMwT8oK8se7QcPKaCh?=
 =?us-ascii?Q?RIG0ljrDV0NdViXzy8VsbxPEbzNno6KfhpdsDvXzHczTHZPyov84rp1o7F9n?=
 =?us-ascii?Q?yinhlIP3fih72zLpT/2j80guM1/sIX4ZuL3iT2fyl+9Uz4WKnKytcKI07eBg?=
 =?us-ascii?Q?zp7/wcDzyw3nHb6wdSaWJXocW+nc?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 16:32:05.0516
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 43622a85-7e75-4ec3-a15a-08dcb6354ece
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SN1PEPF0002636D.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8527

Hi,

In the Xen summit, we presented an update on Xen Functional Safety. For
details, please refer to 
https://youtu.be/eFRTHSGDMfQ?si=sYOdYfDI7qsgkcjE  ("Xen Functional
Safety - an Update - Ayan Kumar Halder & Michal Orzel, AMD")
 
We wish to start with upstreaming the requirements.

This patches illustrate how we are writing the requirements and provides
some examples.
The support level is experimental and it will be maintained on a best
effort basis.

Changes from v1 :-
1. Added "docs: fusa: reqs: Added a requirements writing style guide" in this
patch serie.

v2 :-
1. Reordered patches 2 and 3.
2. Changes mentioned in individual files.


Ayan Kumar Halder (3):
  docs: Introduce Fusa Requirement and define maintainers
  docs: fusa: reqs: Added a requirements writing style guide
  docs: fusa : reqs: Added a sample of requirements [DO_NOT_MERGE]

 MAINTAINERS                                   |   9 +
 docs/fusa/index.rst                           |   9 +
 docs/fusa/reqs/REQUIREMENTS-STYLE             |  34 +++
 .../reqs/design-reqs/arm64/emulated-uart.rst  | 240 ++++++++++++++++++
 .../reqs/design-reqs/arm64/generic-timer.rst  | 146 +++++++++++
 docs/fusa/reqs/design-reqs/xen-version.rst    | 207 +++++++++++++++
 docs/fusa/reqs/index.rst                      |   9 +
 docs/fusa/reqs/intro.rst                      |  86 +++++++
 docs/fusa/reqs/market-reqs/reqs.rst           |  77 ++++++
 docs/fusa/reqs/product-reqs/reqs.rst          |  64 +++++
 10 files changed, 881 insertions(+)
 create mode 100644 docs/fusa/index.rst
 create mode 100644 docs/fusa/reqs/REQUIREMENTS-STYLE
 create mode 100644 docs/fusa/reqs/design-reqs/arm64/emulated-uart.rst
 create mode 100644 docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
 create mode 100644 docs/fusa/reqs/design-reqs/xen-version.rst
 create mode 100644 docs/fusa/reqs/index.rst
 create mode 100644 docs/fusa/reqs/intro.rst
 create mode 100644 docs/fusa/reqs/market-reqs/reqs.rst
 create mode 100644 docs/fusa/reqs/product-reqs/reqs.rst

-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 16:38:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 16:38:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772987.1183447 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbNCA-0000nB-CH; Tue, 06 Aug 2024 16:37:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772987.1183447; Tue, 06 Aug 2024 16:37:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbNCA-0000n2-7q; Tue, 06 Aug 2024 16:37:58 +0000
Received: by outflank-mailman (input) for mailman id 772987;
 Tue, 06 Aug 2024 16:37: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=HPS5=PF=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sbNC8-0000K5-Uj
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 16:37:56 +0000
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [2a00:1450:4864:20::534])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3b4ba3c8-5412-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 18:37:55 +0200 (CEST)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5a15692b6f6so1252416a12.0
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 09:37:55 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b839708c56sm6130442a12.2.2024.08.06.09.37.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 06 Aug 2024 09:37:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3b4ba3c8-5412-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722962274; x=1723567074; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=L/Zbn2a14GKs5tYnWS9wWhluQiN5HzX568Es6OXBxYc=;
        b=JauJaSg0YE2usxOhzKLqHnmdiqeB3HrrvOtlMVG36qmJgZwDFgWuDXzYsvlPdk4aNO
         bDmAXtRH0ck8WDOM284KPcKhmivSUAMNznXMO+jActgavG0dWjtbQrJI87XbWwQn4Qd6
         c1BtDZ5VgbY4rSLnMCQulVYlb0kvv2ichgv63ocO8mVsamHu4ZHedlIYXcgL0CCLN7Qw
         ALxtOY/D0zieUgODlFmXIB8m+/zW1109FOlrrTcDXwLpVtfyj0nU/di6/AqdRbNNXCVf
         Qs1wn4fQF2FszRMhS368nHA//pGpXYS4IuNN1agXTvgWneMxN0F7zrWBSHKk7M5bpSV6
         LU9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722962274; x=1723567074;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=L/Zbn2a14GKs5tYnWS9wWhluQiN5HzX568Es6OXBxYc=;
        b=HeJT7TtbT7ZSZQvyYZi8Zsc4q6d+1C31ipQavWknjoJ0+cnFtvzDJG8I+0HcLQ3Fx8
         Cp2bHths0IN/gL32iMMz5QpOyzQVR9qdlUiTv4lTxHYlpRNXlqNWwfVC0w1P3Bg/q2WQ
         /JRTFVTcdNz2t5mOTFlMCO9PEtq+ZktECYwIlJYID2VMWD43fuvWPX3qEzIixRVUkpBo
         +8dxPQE+68QtpTC0ioLs7/kzn42dBfhX6sqNBBFhQvnxOkpU36HmgTpGreWHF7AYOjoF
         0rJdCN2lTBO8e8KAtUiUa7ZbYCncCLD13v42hJzQcRFwOXU0lhXBBMerGT6scBOaMSTn
         GHJg==
X-Gm-Message-State: AOJu0Yweuff049nLvQnOxNM1qgHqYFIiqZGdFdOycqHQApFP2ClaknDt
	6dZPIJJmQ2QeFkYE57F9/rWXQLlA59O6Kv3tqucrrDrwyktmkR6h/JXusw==
X-Google-Smtp-Source: AGHT+IFJNqSE4REWswtsQjnFc/RMGzrgjPXR54oSr80O8g7PxeOx279jo2TGDHO/Ag890La0nFFmaw==
X-Received: by 2002:a05:6402:457:b0:59e:b95d:e769 with SMTP id 4fb4d7f45d1cf-5b7f36f3fdamr12422813a12.5.1722962274383;
        Tue, 06 Aug 2024 09:37:54 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v13 2/2] xen/riscv: test basic exception handling stuff
Date: Tue,  6 Aug 2024 18:37:50 +0200
Message-ID: <bd9ecafdd545009cebd8b7aa8a14a21325b35c0d.1722960083.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1722960083.git.oleksii.kurochko@gmail.com>
References: <cover.1722960083.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Introduce testing for macros in <xen/bug.h>

Wrap the testing in the SELF_TESTS configuration to avoid log
noise related to functionality testing
(specifically, macros from <xen/bug.h>) when CONFIG_SELF_TESTS
is disabled.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
---
Changes in V13:
 - update the commit message.
---
Changes in V12:
 - Notrhing changed. Only rebase.
---
Changes in V11:
 - update the commit message.
---
Changes in V10:
 - wrap test_macros_from_bug_h() under "#ifdef CONFIG_SELF_TESTS"
 - update the commit title to: "xen/riscv: test basic exception handling stuff"
---
Changes in V9:
  - s/early_printk/printk as common code is now available
---
Changes in V5-V8:
  - Nothing changed. Only rebase.
---
Changes in V4:
  - Add Acked-by: Alistair Francis <alistair.francis@wdc.com>
---
Changes in V2-V3:
  - Nothing changed
---
 xen/arch/riscv/setup.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index a6a29a1508..4defad68f4 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -19,6 +19,22 @@ void arch_get_xen_caps(xen_capabilities_info_t *info)
 unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
     __aligned(STACK_SIZE);
 
+#ifdef CONFIG_SELF_TESTS
+static void test_run_in_exception(const struct cpu_user_regs *regs)
+{
+    printk("If you see this message, ");
+    printk("run_in_exception_handler is most likely working\n");
+}
+
+static void test_macros_from_bug_h(void)
+{
+    run_in_exception_handler(test_run_in_exception);
+    WARN();
+    printk("If you see this message, ");
+    printk("WARN is most likely working\n");
+}
+#endif
+
 void __init noreturn start_xen(unsigned long bootcpu_id,
                                paddr_t dtb_addr)
 {
@@ -26,6 +42,10 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
 
     trap_init();
 
+#ifdef CONFIG_SELF_TESTS
+    test_macros_from_bug_h();
+#endif
+
     printk("All set up\n");
 
     for ( ;; )
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 16:38:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 16:38:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772986.1183433 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbNC9-0000Na-2S; Tue, 06 Aug 2024 16:37:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772986.1183433; Tue, 06 Aug 2024 16:37:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbNC8-0000NL-T5; Tue, 06 Aug 2024 16:37:56 +0000
Received: by outflank-mailman (input) for mailman id 772986;
 Tue, 06 Aug 2024 16:37: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=HPS5=PF=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sbNC8-0000K5-4V
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 16:37:56 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3a7fa595-5412-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 18:37:54 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-5a3b866ebc9so1072515a12.3
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 09:37:54 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b839708c56sm6130442a12.2.2024.08.06.09.37.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 06 Aug 2024 09:37:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3a7fa595-5412-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722962273; x=1723567073; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=NggYMZ36LWwkaetnIEf12MqUml0kytycMiC2PqmClSs=;
        b=Glq4wqAm2V3hZOQHcPsSLEGldHKJFIRqEAEyIB7IQ1KU67RoiDelo02K45FwkQz3gx
         cNH2C5OOmhtwpBkU3sXjaTPCMVs+q4PPWD+d33CRUZ1jdgW8fdPOjvJOl9mGpgvd/k4z
         2VHn4N0p6AQ0xHNYpidlqZ/WtsRd51hNWoT9j+eX5ISjIV4K2DPlLtEBlKU6+pRSkfTh
         U3d0+JjzPfN3VnnqGy8F3B5DDWQ6Wpda+XI75nn1ogvdk6NjgsiPuX1MP5psjzuhjz7o
         pRo6FNqSrwyJqz0OuEgczE1qWjLMYSW2LA9GOj6RFWU1f8twIvOxVGRPMkIu8q3yL7LM
         ThKQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722962273; x=1723567073;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=NggYMZ36LWwkaetnIEf12MqUml0kytycMiC2PqmClSs=;
        b=MlRximGS/0S5qTkZ4AcX2fGk5Bb45FSqQOg9Cp1Yl9z7hVTC7TT4RIUZ7WeOFUhZDD
         9Nhx63v9nZBJXL78kZU82LmvYx1jgxVCNVz/L2PiU3y0fW/JQfbb4hvpZmjIx+Ze1IJt
         9v28ktH8JoDGbZw+QDfIbBLY/pMGdIlCAc72hZ8evCd5euFyXvDQjaLmCqRvug7F46MR
         J1IhAthk7mHuNPopSEmzvbVIT3QKDy5bPzR3co65rkeGTlJgGIA9EtbwMShHbjFE3inq
         F1csragjJy553NQm2iaQxANFumHIJfUUMZo3RMxgx4U80zCHmGs0FXM3tQcfsCHh4HTZ
         Y3oA==
X-Gm-Message-State: AOJu0Yw743Q2QNNuFhfFtfG373fqzYrUZCZViAVreSCqhipjdBgc1Hdg
	j55r4Te0crshQr7BmvzWeiwA3HQXhuBbkaWNRbnWRsi4KrM4xdjM6+Fpww==
X-Google-Smtp-Source: AGHT+IHANTbhAMM695xuKO3SXkk6yDeMCZfwrM3Xx7TLmC7orh5rJZIeN3E95TK/jJMueP668j7Dsw==
X-Received: by 2002:a05:6402:284:b0:5af:51d6:d8e with SMTP id 4fb4d7f45d1cf-5b7f419f7f8mr10748346a12.20.1722962272788;
        Tue, 06 Aug 2024 09:37:52 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v13 0/2] RISCV basic exception handling implementation
Date: Tue,  6 Aug 2024 18:37:48 +0200
Message-ID: <cover.1722960083.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The patch series provides a basic implementation of exception handling.
It can do only basic things such as decode a cause of an exception,
save/restore registers and execute "wfi" instruction if an exception
can not be handled.

To verify that exception handling works well it was used macros
from <asm/bug.h> such as BUG/WARN/run_in_exception/assert_failed.

It wasn't implemented show_execution_state() and stack trace discovering
as it's not necessary now.

CI results:
 https://gitlab.com/xen-project/people/olkur/xen/-/pipelines/1402965420

---
Changes in V13:
 - The following patches were merged to staging:
   [PATCH v12 3/3] xen/riscv: refactor decode_trap_cause()
 - Define BUG_INSTR as "UNIMP" to cover properly the cases when
   CONFIG_RISCV_ISA_C is enabled and not.
 - All other changes please look in patch separately.
 - Add link to CI results of this patch series.
 - Rebase patch series on top of current staging.
---
Changes in V12:
 - Drop patch series depenency from "Enable build of full Xen for RISC-V" as
   this depenency has been merged to staging.
 - Change BUG_INSTR from 'ebreak' to 0x0000 ( UNIMP instruction ).
 - add new patch with refactoring of decode_trap_cause().
 - The following patches were merged to staging:
   - [PATCH v11 1/5] xen/riscv: use printk() instead of early_printk()
   - [PATCH v11 2/5] xen/riscv: introduce decode_cause() stuff
   - [PATCH v11 3/5] xen/riscv: introduce trap_init()
 - All other changes please look in patch separately.
---
Changes in V10 - V11:
 - No generic changes to describe here. Please look at patch-specific changes.
---
Changes in V9:
 - Update the cover letter message.
 - s/early_printk/printk.
 - use GENERIC_BUG_FRAME instead of arch-specific implementation of do_bug_frame().
 - Rebase on top of current staging and riscv-full-xen-build-v14.
---
Changes in V8:
 - Update the commit message of the cover letter.
 - Remove the patch with an introduction of dummy asm/bug.h and introduce
   normal asm/bug.h
 - Fix typo in return string from decode_reserved_interrupt_cause
 - Add "Acked-by: Alistair Francis <alistair.francis@wdc.com>" for the patch
   "xen/riscv: introduce decode_cause() stuff"
 - Remove Pointless initializer of id in do_bug_frame().
 - Make bug_frames[] array constant in do_bug_frame().
 - Remove cast_to_bug_frame(addr).
 - Rename is_valig_bugaddr to is_valid_bug_insn().
 - Add check that read_instr is used only on Xen code
 - Update the commit message.
---
Changes in V7:
 - Update the depenency ( mentioned in the cover letter message ) of the current
   patch series.
 - clean up comments.
 - code style fixes.
 - move definition of cast_to_bug_frame() from patch 4 to 5.
---
Changes in V6:
 - Update the cover letter message: the patch set is based on MMU patch series.
 - Introduce new patch with temporary printk functionality. ( it will be
   removed when Xen common code will be ready )
 - Change early_printk() to printk().
 - Remove usage of LINK_TO_LOAD() due to the MMU being enabled first.
 - Add additional explanatory comments.
 - Remove patch "xen/riscv: initialize boot_info structure" from the patch
   series.
---
Changes in V5:
 - Rebase on top of [1] and [2]
 - Add new patch which introduces stub for <asm/bug.h> to keep Xen compilable
   as in the patch [xen/riscv: introduce decode_cause() stuff] is used
   header <xen/lib.h> which requires <asm/bug.h>.
 - Remove <xen/error.h> from riscv/traps/c as nothing would require
   inclusion.
 - decode_reserved_interrupt_cause(), decode_interrupt_cause(),
   decode_cause, do_unexpected_trap() were made as static they are expected
   to be used only in traps.c
 - Remove "#include <xen/types.h>" from <asm/bug.h> as there is no any need in it anymore
 - Update macros GET_INSN_LENGTH: remove UL and 'unsigned int len;' from it
 - Remove " include <xen/bug.h>" from risc/setup.c. it is not needed in the current version of
   the patch
 - change an argument type from vaddr_t to uint32_t for is_valid_bugaddr and introduce 
   read_instr() to read instruction properly as the length of qinstruction can be
   either 32 or 16 bits.
 - Code style fixes
 - update the comments before do_bug_frame() in riscv/trap.c
 - [[PATCH v4 5/5] automation: modify RISC-V smoke test ] was dropped as it was provided
   more simple solution by Andrew.  CI: Simplify RISCV smoke testing
 - Refactor is_valid_bugaddr() function.
 - 2 new patches ([PATCH v5 {1-2}/7]) were introduced, the goal of which is to recalculate
   addresses used in traps.c, which can be linker time relative. It is needed as we don't
   have enabled MMU yet.
---
Changes in V4:
  - Rebase the patch series on top of new version of [introduce generic
    implementation of macros from bug.h] patch series.
  - Update the cover letter message as 'Early printk' was merged and
    the current one patch series is based only on [introduce generic
    implementation of macros from bug.h] which hasn't been commited yet.
  - The following patches of the patch series were merged to staging:
      [PATCH v3 01/14] xen/riscv: change ISA to r64G
      [PATCH v3 02/14] xen/riscv: add <asm/asm.h> header
      [PATCH v3 03/14] xen/riscv: add <asm/riscv_encoding.h header
      [PATCH v3 04/14] xen/riscv: add <asm/csr.h> header
      [PATCH v3 05/14] xen/riscv: introduce empty <asm/string.h>
      [PATCH v3 06/14] xen/riscv: introduce empty <asm/cache.h>
      [PATCH v3 07/14] xen/riscv: introduce exception context
      [PATCH v3 08/14] xen/riscv: introduce exception handlers implementation
      [PATCH v3 10/14] xen/riscv: mask all interrupts
  - Fix addressed comments in xen-devel mailing list.

---
Changes in V3:
  - Change the name of config RISCV_ISA_RV64IMA to RISCV_ISA_RV64G
    as instructions from Zicsr and Zifencei extensions aren't part of
    I extension any more.
  - Rebase the patch "xen/riscv: introduce an implementation of macros
    from <asm/bug.h>" on top of patch series [introduce generic implementation
    of macros from bug.h]
  - Update commit messages
---
Changes in V2:
  - take the latest riscv_encoding.h from OpenSBI, update it with Xen
    related changes, and update the commit message with "Origin:"
    tag and the commit message itself.
  - add "Origin:" tag to the commit messag of the patch
    [xen/riscv: add <asm/csr.h> header].
  - Remove the patch [xen/riscv: add early_printk_hnum() function] as the
    functionality provided by the patch isn't used now.
  - Refactor prcoess.h: move structure offset defines to asm-offsets.c,
    change register_t to unsigned long.
  - Refactor entry.S to use offsets defined in asm-offsets.C
  - Rename {__,}handle_exception to handle_trap() and do_trap() to be more
    consistent with RISC-V spec.
  - Merge the pathc which introduces do_unexpected_trap() with the patch
    [xen/riscv: introduce exception handlers implementation].
  - Rename setup_trap_handler() to trap_init() and update correspondingly
    the patches in the patch series.
  - Refactor bug.h, remove bug_instr_t type from it.
  - Refactor decode_trap_cause() function to be more optimization-friendly.
  - Add two new empty headers: <cache.h> and <string.h> as they are needed to
    include <xen/lib.h> which provides ARRAY_SIZE and other macros.
  - Code style fixes.
---
Oleksii Kurochko (2):
  xen/riscv: enable GENERIC_BUG_FRAME
  xen/riscv: test basic exception handling stuff

 xen/arch/riscv/Kconfig           |  1 +
 xen/arch/riscv/include/asm/bug.h |  8 +++-----
 xen/arch/riscv/setup.c           | 20 ++++++++++++++++++++
 xen/arch/riscv/traps.c           | 26 +++++++++++++++++++++++++-
 xen/common/bug.c                 |  1 +
 5 files changed, 50 insertions(+), 6 deletions(-)

-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 16:38:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 16:38:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.772985.1183426 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbNC8-0000KI-OX; Tue, 06 Aug 2024 16:37:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 772985.1183426; Tue, 06 Aug 2024 16:37:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbNC8-0000KB-M2; Tue, 06 Aug 2024 16:37:56 +0000
Received: by outflank-mailman (input) for mailman id 772985;
 Tue, 06 Aug 2024 16:37:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=HPS5=PF=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sbNC7-0000Jt-IW
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 16:37:55 +0000
Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com
 [2a00:1450:4864:20::52a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3ae46a20-5412-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 18:37:54 +0200 (CEST)
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-5b9d48d1456so30515a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 06 Aug 2024 09:37:54 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b839708c56sm6130442a12.2.2024.08.06.09.37.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 06 Aug 2024 09:37:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3ae46a20-5412-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1722962274; x=1723567074; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Ti+mt/1uMMi7JLPjgJYKhqxaEaRYrTbLXwbihRv8QHU=;
        b=j7Z8y0XrvsNnm2N0UU1h7AChPCkFD6MxSzzpxJyM6vHBPvMASusDkNfJzgM1x7YeZ0
         Ifpe/kzaUt86g2UXEUQIJmEensaTvwukZto+QA5h20edxS5tFi8I2aPFkp7t+5dn14Cm
         S4RgNI2wxkHpTqpt+ZVhuVAgBMYRG0qKSPi53hv1fm2DhTMg4n9JkNnbQyjS+dMr3uAO
         oXNGdcmrwV/xuGQbvtDKkLBGkQNBmQuWorneSd/jLeba+qKVCwLr4M/JZ+vWeZeRlbXX
         rvyPdwNEZ6/yzP2pSVAcLwWHl8ryW4lGZmWshbt6h3kv/l4UYEywk+b09qkwWdYWYjAJ
         d5kQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1722962274; x=1723567074;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Ti+mt/1uMMi7JLPjgJYKhqxaEaRYrTbLXwbihRv8QHU=;
        b=CEmTrGJghFuUBG7r67lrLD0IXzORA8mvuiBpZdC06LyLk5IVIY8moBCv7yLrIfuFht
         qUYtxtn+myzTpZg23YePb+oFZ1l+98ZwkwcHAjkB8pSry5acxeQumO1uAWG4qlEq0H9x
         ol9SYkh9ttFgnEGddikGrUee6pX8N7Usngj4JienSsNSTpiLk0/XZ+PDKt6k73uEhke8
         uxrW3TNZ8WubkxWXtJw8zdqrPYAvz5ciI6SjNXbRq7D0wCaF8q78yIJsBjsBZXXrLy7n
         mmPGXF7Jtbe8CL4yxM1N3yTeFvRQsDJN7WagyGG1ZBr1P9ufdNZdygg35/5MrpYACd7W
         5dVw==
X-Gm-Message-State: AOJu0Yy+ujwjGUI/VYCcUEeZT82nMXfRdVcvXAcB7k0WeL7I7j+RWr/s
	VLfBCtJS/ooz/aU7h3DLGW03FAe0ICM/cacIYyCKGSjV77hIl1s6v2ElRw==
X-Google-Smtp-Source: AGHT+IEcW4ivBa9VJ4kM/q5GKqO4YlEqHsmmQQwXt92tS+p9N4/xfIcL5HvvjBzGc/ctDrexTJss6w==
X-Received: by 2002:a05:6402:1913:b0:5ba:bf81:a971 with SMTP id 4fb4d7f45d1cf-5babf81ab6amr8722320a12.1.1722962273632;
        Tue, 06 Aug 2024 09:37:53 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v13 1/2] xen/riscv: enable GENERIC_BUG_FRAME
Date: Tue,  6 Aug 2024 18:37:49 +0200
Message-ID: <516ada36487fd57f7a784f9fb3fe328f5365bd85.1722960083.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1722960083.git.oleksii.kurochko@gmail.com>
References: <cover.1722960083.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Enable GENERIC_BUG_FRAME to support BUG(), WARN(), ASSERT,
and run_in_exception_handler().

"UNIMP" is used for BUG_INSTR, which, when macros from <xen/bug.h>
are used, triggers an exception with the ILLEGAL_INSTRUCTION cause.
This instruction is encoded as a 2-byte instruction when
CONFIG_RISCV_ISA_C is enabled:
  ffffffffc0046ba0:       0000                    unimp
and is encoded as a 4-byte instruction when CONFIG_RISCV_ISA_C
ins't enabled:
  ffffffffc005a460:       c0001073                unimp

Using 'ebreak' as BUG_INSTR does not guarantee proper handling of macros
from <xen/bug.h>. If a debugger inserts a breakpoint (using the 'ebreak'
instruction) at a location where Xen already uses 'ebreak', it
creates ambiguity. Xen cannot distinguish whether the 'ebreak'
instruction is inserted by the debugger or is part of Xen's own code.

Remove BUG_INSN_32 and BUG_INSN_16 macros as they encode the ebreak
instruction, which is no longer used for BUG_INSN.

Update the comment above the definition of INS_LENGTH_MASK as instead of
'ebreak' instruction 'unimp' instruction is used.

<xen/lib.h> is included for the reason that panic() and printk() are
used in common/bug.c and RISC-V fails if it is not included.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V13:
 - add fallthrough for " case CAUSE_ILLEGAL_INSTRUCTION" in do_trap().
 - define BUG_INSTR as "UNIMP" to cover properly the cases when
   CONFIG_RISCV_ISA_C is enabled and not.
 - Update the comment above the definition of INS_LENGTH_MASK.
 - Update the commit message.
---
Changes in V12:
 - Update the commit message
 - Use 0x0000 as BUG_INSTR instead of 'ebreak' to deal with cases when
   the debugger inserts 'ebreak' into the place where Xen has ebreak.
 - Remove BUG_INSN_32 and BUG_INSN_16 macros as they encode the ebreak
   instruction, which is no longer used for BUG_INSN.
 - Update the commit above the definition of INS_LENGTH_MASK.
 - Move break inside "if ( do_bug_frame(cpu_regs, pc) >= 0 )".
---
Changes in V11:
  - update the commit message
  - change "%lx" to "%#x" for PC register printing.
  - drop +1 in argument of is_kernel_text(pc) and is_kernel_inittext(pc).
  - drop return for case CAUSE_BREAKPOINT.
  - add break to default and add a blank like above it.
  - add a comment CAUSE_BREAKPOINT is handled instead of illegal instruction.
---
Changes in V10:
 - put 'select GENERIC_BUG_FRAME' in "Config RISCV".
 - rework do_trap() to not fetch an instruction in case when the cause of trap
   is BUG_insn.
 - drop read_instr() and is_valid_bug_insn().
 - update the commit message.
---
Changes in V9:
 - Rebase on the top of current staging.
 - use GENERIC_BUG_FRAME as now we have common code available.
 - add xen/lib.h to bug.c to fix a compilation error around printk.
 - update the commit message.
 - update the code of read_instr() in traps.c
 - fold two-s if into 1 in do_trap.
---
Changes in V8:
  - remove Pointless initializer of id.
  - make bug_frames[] array constant.
  - remove cast_to_bug_frame(addr).
  - rename is_valig_bugaddr to is_valid_bug_insn().
  - add check that read_instr is used only on xen code
  - update the commit message.
---
Changes in V7:
 - move to this patch the definition of cast_to_bug_frame() from the previous patch.
 - update the comment in bug.h.
 - update the comment above do_bug_frame().
 - fix code style.
 - add comment to read_instr func.
 - add space for bug_frames in lds.S.
---
Changes in V6:
  - Avoid LINK_TO_LOAD() as bug.h functionality expected to be used
    after MMU is enabled.
  - Change early_printk() to printk()
---
Changes in V5:
  - Remove "#include <xen/types.h>" from <asm/bug.h> as there is no any need in it anymore
  - Update macros GET_INSN_LENGTH: remove UL and 'unsigned int len;' from it
  - Remove " include <xen/bug.h>" from risc/setup.c. it is not needed in the current version of
    the patch
  - change an argument type from vaddr_t to uint32_t for is_valid_bugaddr and introduce read_instr() to
    read instruction properly as the length of qinstruction can be either 32 or 16 bits.
  - Code style fixes
  - update the comments before do_bug_frame() in riscv/trap.c
  - Refactor is_valid_bugaddr() function.
  - introduce macros cast_to_bug_frame(addr) to hide casts.
  - use LINK_TO_LOAD() for addresses which are linker time relative.
---
Changes in V4:
  - Updates in RISC-V's <asm/bug.h>:
    * Add explanatory comment about why there is only defined for 32-bits length
      instructions and 16/32-bits BUG_INSN_{16,32}.
    * Change 'unsigned long' to 'unsigned int' inside GET_INSN_LENGTH().
    * Update declaration of is_valid_bugaddr(): switch return type from int to bool
      and the argument from 'unsigned int' to 'vaddr'.
  - Updates in RISC-V's traps.c:
    * replace /xen and /asm includes
    * update definition of is_valid_bugaddr():switch return type from int to bool
      and the argument from 'unsigned int' to 'vaddr'. Code style inside function
      was updated too.
    * do_bug_frame() refactoring:
      * local variables start and bug became 'const struct bug_frame'
      * bug_frames[] array became 'static const struct bug_frame[] = ...'
      * remove all casts
      * remove unneeded comments and add an explanatory comment that the do_bug_frame()
        will be switched to a generic one.
    * do_trap() refactoring:
      * read 16-bits value instead of 32-bits as compressed instruction can
        be used and it might happen than only 16-bits may be accessible.
      * code style updates
      * re-use instr variable instead of re-reading instruction.
  - Updates in setup.c:
    * add blank line between xen/ and asm/ includes.
---
Changes in V3:
  - Rebase the patch "xen/riscv: introduce an implementation of macros
    from <asm/bug.h>" on top of patch series [introduce generic implementation
    of macros from bug.h]
---
Changes in V2:
  - Remove __ in define namings
  - Update run_in_exception_handler() with
    register void *fn_ asm(__stringify(BUG_FN_REG)) = (fn);
  - Remove bug_instr_t type and change it's usage to uint32_t
---
 xen/arch/riscv/Kconfig           |  1 +
 xen/arch/riscv/include/asm/bug.h |  8 +++-----
 xen/arch/riscv/traps.c           | 26 +++++++++++++++++++++++++-
 xen/common/bug.c                 |  1 +
 4 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index b4b354a778..f531e96657 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -1,6 +1,7 @@
 config RISCV
 	def_bool y
 	select FUNCTION_ALIGNMENT_16B
+	select GENERIC_BUG_FRAME
 
 config RISCV_64
 	def_bool y
diff --git a/xen/arch/riscv/include/asm/bug.h b/xen/arch/riscv/include/asm/bug.h
index f5ff96140f..30941816de 100644
--- a/xen/arch/riscv/include/asm/bug.h
+++ b/xen/arch/riscv/include/asm/bug.h
@@ -9,7 +9,7 @@
 
 #ifndef __ASSEMBLY__
 
-#define BUG_INSTR "ebreak"
+#define BUG_INSTR "UNIMP"
 
 /*
  * The base instruction set has a fixed length of 32-bit naturally aligned
@@ -18,15 +18,13 @@
  * There are extensions of variable length ( where each instruction can be
  * any number of 16-bit parcels in length ).
  *
- * Compressed ISA is used now where the instruction length is 16 bit  and
- * 'ebreak' instruction, in this case, can be either 16 or 32 bit (
+ * Compressed ISA is used now where the instruction length is 16 bit and
+ * 'unimp' instruction, in this case, can be either 16 or 32 bit (
  * depending on if compressed ISA is used or not )
  */
 #define INSN_LENGTH_MASK        _UL(0x3)
 #define INSN_LENGTH_32          _UL(0x3)
 
-#define BUG_INSN_32             _UL(0x00100073) /* ebreak */
-#define BUG_INSN_16             _UL(0x9002)     /* c.ebreak */
 #define COMPRESSED_INSN_MASK    _UL(0xffff)
 
 #define GET_INSN_LENGTH(insn)                               \
diff --git a/xen/arch/riscv/traps.c b/xen/arch/riscv/traps.c
index 7149504ebc..d55a4a827b 100644
--- a/xen/arch/riscv/traps.c
+++ b/xen/arch/riscv/traps.c
@@ -5,6 +5,8 @@
  * RISC-V Trap handlers
  */
 
+#include <xen/bug.h>
+#include <xen/compiler.h>
 #include <xen/lib.h>
 #include <xen/nospec.h>
 #include <xen/sched.h>
@@ -106,7 +108,29 @@ static void do_unexpected_trap(const struct cpu_user_regs *regs)
 
 void do_trap(struct cpu_user_regs *cpu_regs)
 {
-    do_unexpected_trap(cpu_regs);
+    register_t pc = cpu_regs->sepc;
+    unsigned long cause = csr_read(CSR_SCAUSE);
+
+    switch ( cause )
+    {
+    case CAUSE_ILLEGAL_INSTRUCTION:
+        if ( do_bug_frame(cpu_regs, pc) >= 0 )
+        {
+            if ( !(is_kernel_text(pc) || is_kernel_inittext(pc)) )
+            {
+                printk("Something wrong with PC: %#lx\n", pc);
+                die();
+            }
+
+            cpu_regs->sepc += GET_INSN_LENGTH(*(uint16_t *)pc);
+
+            break;
+        }
+        fallthrough;
+    default:
+        do_unexpected_trap(cpu_regs);
+        break;
+    }
 }
 
 void vcpu_show_execution_state(struct vcpu *v)
diff --git a/xen/common/bug.c b/xen/common/bug.c
index b7c5d8fd4d..75cb35fcfa 100644
--- a/xen/common/bug.c
+++ b/xen/common/bug.c
@@ -1,6 +1,7 @@
 #include <xen/bug.h>
 #include <xen/errno.h>
 #include <xen/kernel.h>
+#include <xen/lib.h>
 #include <xen/livepatch.h>
 #include <xen/string.h>
 #include <xen/types.h>
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 17:43:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 17:43:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773016.1183457 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbODY-0004MM-Rn; Tue, 06 Aug 2024 17:43:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773016.1183457; Tue, 06 Aug 2024 17:43:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbODY-0004MF-Ng; Tue, 06 Aug 2024 17:43:28 +0000
Received: by outflank-mailman (input) for mailman id 773016;
 Tue, 06 Aug 2024 17:43:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=O+gn=PF=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sbODX-0004M9-QH
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 17:43:27 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 619245e2-541b-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 19:43:26 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 290C060FF0;
 Tue,  6 Aug 2024 17:43:24 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39207C32786;
 Tue,  6 Aug 2024 17:43:23 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 619245e2-541b-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1722966203;
	bh=9LnT1RvN6QmNUGJn6ZUTD2Kp4LmNfzlYIhm7wNIhYfM=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=SOTqO78dPrmW+PqrKd4h4X0i9p8QcbJMfD2L95KxSNxsn+YjzyjOWvF/l6w9/VcCf
	 QX7Dp/c0nvfZROR2/IC6carg1PFI4ZUphiIkGJ5SxoGW41SwTY0UgQBrQ8Ympgjhpl
	 dEBDDnG3AY1sYmBYYwl5lMyIE94BYr7cTMP7fWW+DohVX00ivnsRqQaB8918DlwVnk
	 BWc1/hQ7kokKx8QdaaHI9CB826pI75TzK0ssJRPpLnGqJU6IWKrQYfWvZooN7DzgGI
	 dsn6NNjI63X8rhvFs9ek8CSxuB+jF8PMzvALUX2XaTAhSIB3BPUcP993FyOxPIh96n
	 SN+uDN1IDkZ4w==
Date: Tue, 6 Aug 2024 10:43:21 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
    Anthony PERARD <anthony.perard@vates.tech>, 
    Juergen Gross <jgross@suse.com>, Jason Andryuk <jason.andryuk@amd.com>
Subject: Re: [PATCH] libxl/disk: avoid aliasing of abs()
In-Reply-To: <ad3b9873-b478-4448-8395-498399040324@suse.com>
Message-ID: <alpine.DEB.2.22.394.2408061043050.4954@ubuntu-linux-20-04-desktop>
References: <ad3b9873-b478-4448-8395-498399040324@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 5 Aug 2024, Jan Beulich wrote:
> Tool chains with -Wshadow enabled by default won't like the function
> parameter name "abs", for aliasing stdlib.h's abs(). Rename the
> parameter to what other similar functions use.
> 
> Fixes: a18b50614d97 ("libxl: Enable stubdom cdrom changing")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> --- a/tools/libs/light/libxl_disk.c
> +++ b/tools/libs/light/libxl_disk.c
> @@ -935,7 +935,7 @@ static void cdrom_insert_stubdom_disk_ad
>                                               libxl__ao_device *aodev);
>  static void cdrom_insert_stubdom_query_fdset(libxl__egc *egc,
>                                               libxl__ev_time *ev,
> -                                             const struct timeval *abs,
> +                                             const struct timeval *requested_abs,
>                                               int rc);
>  static void cdrom_insert_stubdom_parse_fdset(libxl__egc *egc,
>                                               libxl__ev_qmp *qmp,
> @@ -1259,7 +1259,7 @@ static void cdrom_insert_stubdom_disk_ad
>  
>  static void cdrom_insert_stubdom_query_fdset(libxl__egc *egc,
>                                               libxl__ev_time *ev,
> -                                             const struct timeval *abs,
> +                                             const struct timeval *requested_abs,
>                                               int rc)
>  {
>      EGC_GC;
> 


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 17:59:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 17:59:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773024.1183467 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbOT6-0006vk-34; Tue, 06 Aug 2024 17:59:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773024.1183467; Tue, 06 Aug 2024 17:59:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbOT6-0006vd-0D; Tue, 06 Aug 2024 17:59:32 +0000
Received: by outflank-mailman (input) for mailman id 773024;
 Tue, 06 Aug 2024 17:59:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=O+gn=PF=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sbOT4-0006vX-F7
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 17:59:30 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9fc1da7f-541d-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 19:59:29 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 715C260EF9;
 Tue,  6 Aug 2024 17:59:27 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9ADD3C32786;
 Tue,  6 Aug 2024 17:59:26 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9fc1da7f-541d-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1722967167;
	bh=GrfkeoeKJld1TWWzn8ni1CD1wNZ1Mx9SdRHvpW/rEDQ=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=LTV75rIHjRBE1uzwq78+clPD24d2AX8AoTuUGpAqp31kJKVx9UsU9U73EPV0reX/v
	 4Qvt4F7v8/mmD4+EJvLuSYjMgNAmJD6i/HbEYsJB0t0yKvLqyM6wKryxP/iMLiT6cN
	 ykW+ta1C7YeAF3N0pZYnFTvNVhIUJDqMe6BMSCFNwtO549PieSDfEg5OevYAnlI6UV
	 DUYldqEgs8GD/yhF2w1hnaIGtPxvfX8Z7u9lDirECzW2Sb3tNN9A/yTvf0r47uNyHs
	 EaYTwBPk2mK3hG/u4vZ6ix91PDTNzkcaiY+23UEAAxD1RMEqdCm+M5NmAPMZhhlSK5
	 +53CI4nHKowrg==
Date: Tue, 6 Aug 2024 10:59:25 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Subject: Re: [PATCH] x86emul: avoid UB shift in AVX512 VPMOV* handling
In-Reply-To: <9f73c7bd-4aa3-4a66-a12c-4bfda6aa233a@suse.com>
Message-ID: <alpine.DEB.2.22.394.2408061059180.4954@ubuntu-linux-20-04-desktop>
References: <9f73c7bd-4aa3-4a66-a12c-4bfda6aa233a@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 5 Aug 2024, Jan Beulich wrote:
> For widening and narrowing moves, operand (vector) size is calculated
> from a table. This calculation, for the AVX512 cases, lives ahead of
> validation of EVEX.L'L (which cannot be 3 without raising #UD). Account
> for the later checking by adjusting the constants in the expression such
> that even EVEX.L'L == 3 will yield a non-UB shift (read: shift count
> reliably >= 0).
> 
> Fixes: 3988beb08 ("x86emul: support AVX512{F,BW} zero- and sign-extending moves")
> Oss-fuzz: 70914
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> @@ -5788,7 +5788,7 @@ x86_emulate(
>              d = DstMem | SrcReg | TwoOp;
>          }
>          generate_exception_if(evex.brs, X86_EXC_UD);
> -        op_bytes = 32 >> (pmov_convert_delta[b & 7] + 1 - evex.lr);
> +        op_bytes = 64 >> (pmov_convert_delta[b & 7] + 2 - evex.lr);
>          elem_bytes = (b & 7) < 3 ? 1 : (b & 7) != 5 ? 2 : 4;
>          goto avx512f_no_sae;
>  
> 


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 18:11:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 18:11:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773033.1183476 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbOeh-0001Wc-0u; Tue, 06 Aug 2024 18:11:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773033.1183476; Tue, 06 Aug 2024 18:11:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbOeg-0001WV-U8; Tue, 06 Aug 2024 18:11:30 +0000
Received: by outflank-mailman (input) for mailman id 773033;
 Tue, 06 Aug 2024 18:11:29 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=O+gn=PF=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sbOef-0001WP-0T
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 18:11:29 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4b5abaa5-541f-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 20:11:26 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 2529A6105D;
 Tue,  6 Aug 2024 18:11:25 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BF5CC32786;
 Tue,  6 Aug 2024 18:11:24 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4b5abaa5-541f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1722967884;
	bh=OMno+4mvFjVXagyRg1105Ffz86MvKEEtmKwrLxqOudg=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=NYla24froCrKazIuBaXOgFiKYLQIrlTr5V9GaXPZyop6nOpAUtO/2eCcoJsjDTp1k
	 nawj2JvYAbIbnvtbGZLfEgQLlhDmy+feeytteRHFQGw1C36NRHokaxxRWFCx0AMHUh
	 DNhpRMdzGq0Q2IeWikPSP9QI/PxnNFaD0S7aPx4NbcCDv2vS6mfvjtIWLXiYLRXYg3
	 MfY8EsULgIJXSyxKFe7ABgjvFpqvujx4sQFbiah5ZF7niQpTHSdXoc8weMLADqOCPM
	 kQdMxpZboD+GmHe7Tr4VD5MDOevyoivDsRn4yRmBUpOqyggaeZ3IDk7JOFopTSN9cA
	 KjIiOAHJ9bVXA==
Date: Tue, 6 Aug 2024 11:11:23 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Subject: Re: [PATCH] x86emul: adjust 2nd param of idiv_dbl()
In-Reply-To: <20944ace-6fb8-4a70-82aa-4ed595d01e5e@suse.com>
Message-ID: <alpine.DEB.2.22.394.2408061111150.4954@ubuntu-linux-20-04-desktop>
References: <20944ace-6fb8-4a70-82aa-4ed595d01e5e@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 5 Aug 2024, Jan Beulich wrote:
> -LONG_MIN cannot be represented in a long and hence is UB, for being one
> larger than LONG_MAX.
> 
> The caller passing an unsigned long and the 1st param also being (array
> of) unsigned long, change the 2nd param accordingly while adding the
> sole necessary cast. This was the original form of the function anyway.
> 
> Fixes: 5644ce014223 ("x86emul: relax asm() constraints")
> Oss-fuzz: 70923
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> @@ -607,9 +607,9 @@ static bool div_dbl(unsigned long u[2],
>   * NB. We don't use idiv directly as it's moderately hard to work out
>   *     ahead of time whether it will #DE, which we cannot allow to happen.
>   */
> -static bool idiv_dbl(unsigned long u[2], long v)
> +static bool idiv_dbl(unsigned long u[2], unsigned long v)
>  {
> -    bool negu = (long)u[1] < 0, negv = v < 0;
> +    bool negu = (long)u[1] < 0, negv = (long)v < 0;
>  
>      /* u = abs(u) */
>      if ( negu )
> 


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 18:24:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 18:24:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773042.1183487 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbOr3-0003fP-4r; Tue, 06 Aug 2024 18:24:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773042.1183487; Tue, 06 Aug 2024 18:24:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbOr3-0003fI-1F; Tue, 06 Aug 2024 18:24:17 +0000
Received: by outflank-mailman (input) for mailman id 773042;
 Tue, 06 Aug 2024 18:24:16 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=O+gn=PF=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sbOr2-0003fC-Dq
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 18:24:16 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 14316341-5421-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 20:24:14 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 19671CE0B2C;
 Tue,  6 Aug 2024 18:24:11 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3708C32786;
 Tue,  6 Aug 2024 18:24:09 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 14316341-5421-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1722968650;
	bh=bWHhvPFF8Wx2JGLU3gSDx/cmkVvRs8T4Ai9q3ToRkYg=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=IohomgoVcfYAkHxSHouyASF4e2zQiAYII0fI7vxylj9gQ8OTKrD1RLSGR+umhENez
	 W2sgKtaTEybKdx5SSc0isel7KYpKEVBaZyA4LEHJXrSqDn95ZtEzThxlC5F0KKxaEA
	 DW4bPG8IzZKXwrC3IWcDemZTJffVA+QK6owz/HXmbI7YsCTcKkm+t5e58Y7/pTcoDP
	 oWnDsRcXF7FJnCGfHBhu5HfsGJMgvqcIohxEjs4VdDKA9n44d4dwotL+L/Spgy0SmC
	 K4Xnh0MtcT7Mo8dO+bfTW0SO5xVs448DqoIzbBEU+ewwQwOlV/StVjRY7z4zkOp042
	 Pc8kE27XQAQIw==
Date: Tue, 6 Aug 2024 11:24:08 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Subject: Re: [PATCH] x86emul: don't call ->read_segment() with x86_seg_none
In-Reply-To: <81ae365f-98b4-4bb6-bbb6-c5423dfda038@suse.com>
Message-ID: <alpine.DEB.2.22.394.2408061117080.4954@ubuntu-linux-20-04-desktop>
References: <81ae365f-98b4-4bb6-bbb6-c5423dfda038@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 5 Aug 2024, Jan Beulich wrote:
> LAR, LSL, VERR, and VERW emulation involve calling protmode_load_seg()
> with x86_seg_none. The fuzzer's read_segment() hook function has an
> assertion which triggers in this case. Calling the hook function,
> however, makes little sense for those insns, as there's no data to
> retrieve. Instead zero-filling the output structure is what properly
> corresponds to those insns being invoked with a NUL selector.
> 
> Fixes: 06a3b8cd7ad2 ("x86emul: support LAR/LSL/VERR/VERW")
> Oss-fuzz: 70918
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Looking at oss-fuzz's report and at this patch I think it is correct

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>


That said, there are a few other places where read_segment is called
without any checks for seg being x86_seg_none. The hvm implementation of
read_segment (hvmemul_read_segment) seems to return error if
x86_seg_none is passed as an argument, but there is no return error
checks any time we call ops->read_segment in x86_emulate.c.

It seems that there might still be an issue?


> ---
> It is pure guesswork that one of those insns did trigger the assertion.
> The report from oss-fuzz sadly lacks details on the insn under
> emulation. I'm further surprised that AFL never found this.
> 
> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> @@ -839,7 +839,8 @@ protmode_load_seg(
>          case x86_seg_tr:
>              goto raise_exn;
>          }
> -        if ( !_amd_like(cp) || vcpu_has_nscb() || !ops->read_segment ||
> +        if ( seg == x86_seg_none || !_amd_like(cp) || vcpu_has_nscb() ||
> +             !ops->read_segment ||
>               ops->read_segment(seg, sreg, ctxt) != X86EMUL_OKAY )
>              memset(sreg, 0, sizeof(*sreg));
>          else
> 


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 18:25:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 18:25:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773050.1183497 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbOsZ-0004CI-E9; Tue, 06 Aug 2024 18:25:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773050.1183497; Tue, 06 Aug 2024 18:25:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbOsZ-0004CB-B4; Tue, 06 Aug 2024 18:25:51 +0000
Received: by outflank-mailman (input) for mailman id 773050;
 Tue, 06 Aug 2024 18:25: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=O+gn=PF=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sbOsY-0004C3-Ic
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 18:25:50 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4cffb16a-5421-11ef-8776-851b0ebba9a2;
 Tue, 06 Aug 2024 20:25:48 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 9E07060F07;
 Tue,  6 Aug 2024 18:25:46 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF782C32786;
 Tue,  6 Aug 2024 18:25:45 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4cffb16a-5421-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1722968746;
	bh=rPa+1HeeFmftibh4oOpqQB7IQRCFkuq5lqmqFXhl9v0=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=LIsRw5EwSmidZbv6gyEK6RadV/+aG1es+wX7FrZWLErJsJwCbBsHwdL5XPLzEsx/2
	 U94KPa96+YejsZqaKpLxUzucupGOoqrLbM8YCji8KfYMtHr4FIuCT3vmTT3IQ2+N9s
	 jaZc+Krwach6vsDsrA7+K8IiY8+ecO6q4XzpdJWB88XKutLagdsI3L4oEBcT8yAk08
	 E3BDxSL8igfXYSU1olIzQuMHQaiSfsX87hnh6M0+rWfNqlhDH9AuoR4k0seyMCWkae
	 VTE6FX8XFlFccjmcFrnTtqt6IDaJPWhX5bkC8JWYczBryHPbzTzsj0PjkcHKPp+BZ5
	 ULtUXoiCCpdzg==
Date: Tue, 6 Aug 2024 11:25:44 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Simone Ballarin <simone.ballarin@bugseng.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    xen-devel@lists.xenproject.org, consulting@bugseng.com
Subject: Re: [PATCH] automation: fix eclair scanning for merge requests
In-Reply-To: <876a1792599b8a10fb49eefb10d475bc@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2408061124280.4954@ubuntu-linux-20-04-desktop>
References: <alpine.DEB.2.22.394.2408011500280.114241@ubuntu-linux-20-04-desktop> <f5990dbcf0131768fdfd35bfdfd8930c@bugseng.com> <alpine.DEB.2.22.394.2408051712320.4954@ubuntu-linux-20-04-desktop> <876a1792599b8a10fb49eefb10d475bc@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 6 Aug 2024, Simone Ballarin wrote:
> On 2024-08-06 03:03, Stefano Stabellini wrote:
> > On Sat, 3 Aug 2024, Nicola Vetrini wrote:
> > > On 2024-08-02 00:06, Stefano Stabellini wrote:
> > > > The ECLAIR jobs part of the Gitlab CI pipeline fail reliably when the
> > > > pipeline is started from a merge request. This is the error:
> > > >
> > > > Unexpected event pull_request
> > > >
> > > > The error is a consequence of action.settings setting event=pull_request
> > > > for merge_request_event. Given that we don't need any special behavior
> > > > from ECLAIR for merge requests, just run the regular scan, change
> > > > action.settings to set event=push for merge_request_event (same as for
> > > > pipeline triggered by git push).
> > > >
> > > 
> > > According to my analysis, the error stems from the fact that
> > > automation/scripts/eclair unconditionally calls action_push.sh, which is
> > > not
> > > designed to handle merge requests (that would be action_pull_request.sh).
> > > One
> > > approach, that needs to be tested, could be to execute that second script
> > > based on the value of ${CI_PIPELINE_SOURCE}.
> > > 
> > > The main difference the approach taken in this patch is that the analysis
> > > results will be relative to the nearest merge point with the staging tree.
> > > If
> > > that's not something that is desired, then this approach looks good to me.
> > 
> > You are right. I tested the below and it works as expected, see:
> > https://gitlab.com/xen-project/people/sstabellini/xen/-/pipelines/1401863307
> > 
> > 
> 
> Hi Stefano,
> 
> the patch looks ok. Don't know whether is should be submitted again. Only one
> minor nit:
> 
> > ---
> > From dee036081cb367862daba264e1eb84ca2505f678 Mon Sep 17 00:00:00 2001
> > From: Stefano Stabellini <stefano.stabellini@amd.com>
> > Date: Mon, 5 Aug 2024 14:24:23 -0700
> > Subject: [PATCH] automation: fix eclair gitlab jobs for merge requests
> > 
> > The "eclair" script calls action_push.sh even for merge request, while
> > instead action_pull_request.sh should be called, resulting in a job
> > failure with this error:
> > 
> > Unexpected event pull_request
> > 
> > Fix the script to call action_pull_request.sh appropriately.
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
> > ---
> >  automation/eclair_analysis/ECLAIR/action_pull_request.sh | 2 +-
> >  automation/scripts/eclair                                | 9 ++++++++-
> >  2 files changed, 9 insertions(+), 2 deletions(-)
> >  mode change 100644 => 100755
> > automation/eclair_analysis/ECLAIR/action_pull_request.sh
> > 
> > diff --git a/automation/eclair_analysis/ECLAIR/action_pull_request.sh
> > b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
> > old mode 100644
> > new mode 100755
> > index 68f7e6282e..812238e07f
> > --- a/automation/eclair_analysis/ECLAIR/action_pull_request.sh
> > +++ b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
> > @@ -3,7 +3,7 @@
> >  set -eu
> > 
> >  usage() {
> > -    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR COMMIT_ID" >&2
> > +    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR" >&2
> >      exit 2
> >  }
> > 
> > diff --git a/automation/scripts/eclair b/automation/scripts/eclair
> > index ebcaf09b54..97d743ab53 100755
> > --- a/automation/scripts/eclair
> > +++ b/automation/scripts/eclair
> > @@ -21,5 +21,12 @@ ex=0
> >  # Fail in case of new reports for clean guidelines
> >  "${ECLAIR_DIR}/action_check_clean_regressions.sh" "${ECLAIR_OUTPUT_DIR}" ||
> > ex=$?
> > 
> > -"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
> > +case "${CI_PIPELINE_SOURCE}" in
> > +merge_request_event)
> > +    "${ECLAIR_DIR}/action_pull_request.sh" "${WTOKEN}"
> > "${ECLAIR_OUTPUT_DIR}"
> > +    ;;
> > +push | pipeline | web | schedule)
> > +    "${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
> > +    ;;
> > +esac
> 
> here I think it's better to give an error if the event is not handled.
> Something similar to
> 
> *)
>     echo "Unexpected event ${CI_PIPELINE_SOURCE}" >&2
>     ex=1
>     ;;

Good suggestion. Here is the updated patch, please ack.

---

>From f49aacb3f281eca073ccdd9fd1326d79b58b7ed2 Mon Sep 17 00:00:00 2001
From: Stefano Stabellini <stefano.stabellini@amd.com>
Date: Mon, 5 Aug 2024 14:24:23 -0700
Subject: [PATCH v3] automation: fix eclair gitlab jobs for merge requests

The "eclair" script calls action_push.sh even for merge request, while
instead action_pull_request.sh should be called, resulting in a job
failure with this error:

Unexpected event pull_request

Fix the script to call action_pull_request.sh appropriately.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
Changes in v3:
- handle unexpected ${CI_PIPELINE_SOURCE}
---
 .../eclair_analysis/ECLAIR/action_pull_request.sh   |  2 +-
 automation/scripts/eclair                           | 13 ++++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 automation/eclair_analysis/ECLAIR/action_pull_request.sh

diff --git a/automation/eclair_analysis/ECLAIR/action_pull_request.sh b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
old mode 100644
new mode 100755
index 68f7e6282e..812238e07f
--- a/automation/eclair_analysis/ECLAIR/action_pull_request.sh
+++ b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
@@ -3,7 +3,7 @@
 set -eu
 
 usage() {
-    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR COMMIT_ID" >&2
+    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR" >&2
     exit 2
 }
 
diff --git a/automation/scripts/eclair b/automation/scripts/eclair
index ebcaf09b54..3ec760bab8 100755
--- a/automation/scripts/eclair
+++ b/automation/scripts/eclair
@@ -21,5 +21,16 @@ ex=0
 # Fail in case of new reports for clean guidelines
 "${ECLAIR_DIR}/action_check_clean_regressions.sh" "${ECLAIR_OUTPUT_DIR}" || ex=$?
 
-"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
+case "${CI_PIPELINE_SOURCE}" in
+merge_request_event)
+    "${ECLAIR_DIR}/action_pull_request.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
+    ;;
+push | pipeline | web | schedule)
+    "${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
+    ;;
+*)
+    echo "Unexpected event ${CI_PIPELINE_SOURCE}" >&2
+    ex=1
+    ;;
+esac
 [ "${ex}" = 0 ] || exit "${ex}"
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 18:39:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 18:39:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773060.1183506 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbP5p-0006v7-IH; Tue, 06 Aug 2024 18:39:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773060.1183506; Tue, 06 Aug 2024 18:39:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbP5p-0006v0-Em; Tue, 06 Aug 2024 18:39:33 +0000
Received: by outflank-mailman (input) for mailman id 773060;
 Tue, 06 Aug 2024 18:39:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sbP5o-0006uu-JQ
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 18:39:32 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbP5n-0003u0-TS; Tue, 06 Aug 2024 18:39:31 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbP5n-0001dN-NE; Tue, 06 Aug 2024 18:39:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:
	References:Cc:To:From:Subject:MIME-Version:Date:Message-ID;
	bh=Q4oiiBQrnLtDMBmAE82vdEsAbOoqARQ2yu6VDxhK4VM=; b=mjpuj81Olt6MrA9OeTOv7v3BWq
	6o5MRO6Y/ylXUMAysQsoJi7BfidzDi+zIqy0jMGRJQ+F4Hop1W16sz+VJBvCA8+2f/Nv8vMI5sW6A
	RNxFdWJ2am1aKMwo0ZCBd4nSaBTHGx+Tavl9hRRdYgeGniNADRIOOcHDEkiCXLxWuCs0=;
Message-ID: <6746ba68-bb14-4ebf-83c7-90504ceea1c7@xen.org>
Date: Tue, 6 Aug 2024 19:39:30 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.20] xen/arm: dom0less: Add #redistributor-regions
 property to GICv3 node
Content-Language: en-GB
From: Julien Grall <julien@xen.org>
To: Luca Fancellu <Luca.Fancellu@arm.com>, Michal Orzel <michal.orzel@amd.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240704075419.34966-1-michal.orzel@amd.com>
 <19A039ED-1B56-4C16-B1D0-72F28AA123C5@arm.com>
 <7f426aab-bccb-4255-994f-2d1613f2342b@xen.org>
In-Reply-To: <7f426aab-bccb-4255-994f-2d1613f2342b@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 05/07/2024 14:03, Julien Grall wrote:
> Hi,
> 
> On 04/07/2024 11:39, Luca Fancellu wrote:
>>
>>
>>> On 4 Jul 2024, at 08:54, Michal Orzel <michal.orzel@amd.com> wrote:
>>>
>>> Dom0less domain using host memory layout may use more than one
>>> re-distributor region (d->arch.vgic.nr_regions > 1). In that case Xen
>>> will add them in a "reg" property of a GICv3 domU node. Guest needs to
>>> know how many regions to search for, and therefore the GICv3 dt binding
>>> [1] specifies that "#redistributor-regions" property is required if more
>>> than one redistributor region is present. However, Xen does not add this
>>> property which makes guest believe, there is just one such region. This
>>> can lead to guest boot failure when doing GIC SMP initialization. Fix it
>>> by adding this property, which matches what we do for hwdom.
>>>
>>> [1] Linux: Documentation/devicetree/bindings/interrupt-controller/ 
>>> arm,gic-v3.yaml
>>>
>>> Fixes: 4809f9ec7d71 ("xen/arm: if direct-map domain use native 
>>> addresses for GICv3")
>>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>>> ---
>>
>> Looks good to me!
>>
>> Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
> 
> Acked-by: Julien Grall <jgrall@amazon.com>

This is now committed.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 18:39:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 18:39:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773066.1183516 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbP6F-0007NN-Ob; Tue, 06 Aug 2024 18:39:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773066.1183516; Tue, 06 Aug 2024 18:39:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbP6F-0007NG-M5; Tue, 06 Aug 2024 18:39:59 +0000
Received: by outflank-mailman (input) for mailman id 773066;
 Tue, 06 Aug 2024 18:39:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sbP6E-0007Lj-4W
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 18:39:58 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbP6D-0003uL-No; Tue, 06 Aug 2024 18:39:57 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbP6D-0001eJ-Hr; Tue, 06 Aug 2024 18:39:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:
	References:Cc:To:From:Subject:MIME-Version:Date:Message-ID;
	bh=+e5XHDTRAnazXZQtCWKKY19N0VD+F4o20nWqNjgGQic=; b=ShVj6OnT65oJs5Qjg8oJTGrS7a
	fVzM7hoVdRhbhTOWBJNNzbVVtHJovYJEkirM7XyYoQurIJey2HpsRKBd5+8XnuCtV2zqYzjYypydX
	ZBIvLDTPQgNYFPgS8Wq7NpecLq4AzIYlrBEmJndpGZcc0QAOz8a3/x7g+OLv2xw1EoAw=;
Message-ID: <1bac1646-0713-487e-9840-ea825bbc92e1@xen.org>
Date: Tue, 6 Aug 2024 19:39:56 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.20 v2] xen/arm: bootfdt: Fix device tree memory node
 probing
Content-Language: en-GB
From: Julien Grall <julien@xen.org>
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Luca Fancellu <luca.fancellu@arm.com>
References: <20240710112204.33542-1-michal.orzel@amd.com>
 <08ba090b-c7a6-4aaa-8bda-f7bce6389f86@xen.org>
In-Reply-To: <08ba090b-c7a6-4aaa-8bda-f7bce6389f86@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 10/07/2024 22:11, Julien Grall wrote:
> Hi,
> 
> On 10/07/2024 12:22, Michal Orzel wrote:
>> Memory node probing is done as part of early_scan_node() that is called
>> for each node with depth >= 1 (root node is at depth 0). According to
>> Devicetree Specification v0.4, chapter 3.4, /memory node can only exists
>> as a top level node. However, Xen incorrectly considers all the nodes 
>> with
>> unit node name "memory" as RAM. This buggy behavior can result in a
>> failure if there are other nodes in the device tree (at depth >= 2) with
>> "memory" as unit node name. An example can be a "memory@xxx" node under
>> /reserved-memory. Fix it by introducing device_tree_is_memory_node() to
>> perform all the required checks to assess if a node is a proper /memory
>> node.
>>
>> Fixes: 3e99c95ba1c8 ("arm, device tree: parse the DTB for RAM location 
>> and size")
>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>> Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
>> Tested-by: Luca Fancellu <luca.fancellu@arm.com>
> 
> Reviewed-by: Julien Grall <julien@xen.org>

This is now committed.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 18:40:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 18:40:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773076.1183527 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbP79-0000Oz-3a; Tue, 06 Aug 2024 18:40:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773076.1183527; Tue, 06 Aug 2024 18:40:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbP78-0000Os-Vm; Tue, 06 Aug 2024 18:40:54 +0000
Received: by outflank-mailman (input) for mailman id 773076;
 Tue, 06 Aug 2024 18:40:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sbP77-0000Og-EL
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 18:40:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbP77-0003vh-0Z; Tue, 06 Aug 2024 18:40:53 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbP76-0001iJ-Rl; Tue, 06 Aug 2024 18:40:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=SZUvY6J/pe1Wzj0NT8f5dbKruV7K0c98HtuX/dzyPrs=; b=c44cRCbQAWfwJacg43tMx63XOU
	mZekMUFOPQ4RIib+ziAm9uw+66i5+agNoyP3Y6MzJEydcs3WLkIg3S2lb0HhAzq70SKrB2lq5wS89
	JyPJJKinUzrTy3YaaAl6x6t+VQByLVz3rTObs+fMoniGB5SRyD5Nm1AvS50oJQ2UJTqA=;
Message-ID: <b093e07a-d9b7-47f1-9f02-0e43d50b8c7e@xen.org>
Date: Tue, 6 Aug 2024 19:40:51 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 0/2] Common device tree stuff
Content-Language: en-GB
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
 <jbeulich@suse.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>
References: <cover.1722941799.git.oleksii.kurochko@gmail.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <cover.1722941799.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 06/08/2024 12:41, Oleksii Kurochko wrote:
> The current patch series introduces the common device tree functions
> between several architectures: Arm, PPC, RISC-V.
> 
> Originally these patches were a part of Shawn's patch series [1].
> At that moment it was v4 version of this patches.
> 
> After RISC-V started to need this changes these patches have been
> rebased on top of the current staging with addional updates after
> rebase.
> For some time, these patches from v5 to v7 version were the part of
> the patch series [2] but not to block almost ready patches for merging
> it was decided to move them to separate patch series.
> 
> CI tests results:
>   https://gitlab.com/xen-project/people/olkur/xen/-/pipelines/1402476423
> 
> [1]
> https://lore.kernel.org/xen-devel/cover.1712893887.git.sanastasio@raptorengineering.com/
> 
> [2]
> https://lore.kernel.org/xen-devel/cover.1721834549.git.oleksii.kurochko@gmail.com/
> ---
> Changes in v2:
>   - add Acked-by: Julien Grall <julien@xen.org> for Patch 2
>   - rename xen/common/device_tree.c to xen/common/device-tree.c
>   - update MAINTAINERS file: drop xen/common/device_tree.c from it.
>   - make diff smaller using git's options:
>        --diff-algorithm=minimal --find-renames
> ---
> 
> Shawn Anastasio (2):
>    xen/device-tree: Move Arm's setup.c bootinfo functions to common
>    xen/common: Move Arm's bootfdt.c to common

I have committed the series.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 18:41:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 18:41:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773086.1183536 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbP7m-0000vI-Ai; Tue, 06 Aug 2024 18:41:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773086.1183536; Tue, 06 Aug 2024 18:41:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbP7m-0000vB-87; Tue, 06 Aug 2024 18:41:34 +0000
Received: by outflank-mailman (input) for mailman id 773086;
 Tue, 06 Aug 2024 18:41:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sbP7l-0000v5-Lm
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 18:41:33 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbP7l-0003yL-6j; Tue, 06 Aug 2024 18:41:33 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sbP7l-0001l2-2Q; Tue, 06 Aug 2024 18:41:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=l3LSozffNEDX3TZF6ewtBCUssb3LZqMVJ1MjJ+Jf1Ug=; b=3iJk1J2MkifRCG22WShSbmXFzz
	E955jjmQ91ZvR6JL/bqxYv8+Ratoxkx4BVaKxfqE2FC2ARrUKs27wL0b5Bk78QRsW5aRAIbjorNoT
	7F8OSBGfllxaEJ+q5aqtUyGNfn0lmY5hU+YiXVh757D43SfoLzpNLMuASVTl6b2nNNLY=;
Message-ID: <076fe048-c89c-496e-a2dc-2076649638cc@xen.org>
Date: Tue, 6 Aug 2024 19:41:31 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/arm: vITS: add #msi-cells property
Content-Language: en-GB
To: Stefano Stabellini <sstabellini@kernel.org>,
 Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: xen-devel@lists.xenproject.org,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240802182654.8976-1-stewart.hildebrand@amd.com>
 <alpine.DEB.2.22.394.2408021420320.114241@ubuntu-linux-20-04-desktop>
From: Julien Grall <julien@xen.org>
In-Reply-To: <alpine.DEB.2.22.394.2408021420320.114241@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 02/08/2024 22:20, Stefano Stabellini wrote:
> On Fri, 2 Aug 2024, Stewart Hildebrand wrote:
>> Non-PCI platform devices may use the ITS. Dom0 Linux drivers for such
>> devices are failing to register IRQs due to a missing #msi-cells
>> property. Add the missing #msi-cells property.
>>
>> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

This is now committed.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 19:12:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 19:12:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773101.1183567 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbPbW-0006xd-VL; Tue, 06 Aug 2024 19:12:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773101.1183567; Tue, 06 Aug 2024 19:12:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbPbW-0006xW-Ro; Tue, 06 Aug 2024 19:12:18 +0000
Received: by outflank-mailman (input) for mailman id 773101;
 Tue, 06 Aug 2024 19:12:17 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbPbV-0006vn-92; Tue, 06 Aug 2024 19:12:17 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbPbU-0004cb-Vb; Tue, 06 Aug 2024 19:12:17 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbPbU-00035y-HJ; Tue, 06 Aug 2024 19:12:16 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbPbU-00037B-Gz; Tue, 06 Aug 2024 19:12:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=HdwcexOtk08xTg6JidU8YN5wc9Pb2p69LmIvW8F5jPk=; b=BZi0XerBLRPuHq3kKbSRG5nt4V
	XtRB+0ftN+8jcJZH0shf75NLJUAGFllTmDvn4m6kPQl1GrfgmUxKULm7USbO5hA7xnUMUqYsePnVo
	O3J2aNRRkuOIDpqhHcnl/crtQhSNHVWiHErr5qPTKr35QFx+v8KF6WYM+xY+r7Qu3dJw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187171-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187171: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=bec25f11d5180d407cf04d2de2525fa6f876bde1
X-Osstest-Versions-That:
    xen=bec25f11d5180d407cf04d2de2525fa6f876bde1
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 06 Aug 2024 19:12:16 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 xen                  bec25f11d5180d407cf04d2de2525fa6f876bde1
baseline version:
 xen                  bec25f11d5180d407cf04d2de2525fa6f876bde1

Last test of basis   187171  2024-08-06 09:22:53 Z    0 days
Testing same since                          (not found)         0 attempts

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


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

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

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

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


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Tue Aug 06 19:15:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 19:15:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773112.1183577 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbPew-0007Zn-Hi; Tue, 06 Aug 2024 19:15:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773112.1183577; Tue, 06 Aug 2024 19:15:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbPew-0007Zg-Dx; Tue, 06 Aug 2024 19:15:50 +0000
Received: by outflank-mailman (input) for mailman id 773112;
 Tue, 06 Aug 2024 19:15:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7YTl=PF=bugseng.com=simone.ballarin@srs-se1.protection.inumbo.net>)
 id 1sbPeu-0007Za-Bd
 for xen-devel@lists.xenproject.org; Tue, 06 Aug 2024 19:15:48 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 48997b22-5428-11ef-bc04-fd08da9f4363;
 Tue, 06 Aug 2024 21:15:46 +0200 (CEST)
Received: from support.bugseng.com (support.bugseng.com [162.55.131.47])
 by support.bugseng.com (Postfix) with ESMTPA id E86014EE0738;
 Tue,  6 Aug 2024 21:15:45 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 48997b22-5428-11ef-bc04-fd08da9f4363
MIME-Version: 1.0
Date: Tue, 06 Aug 2024 21:15:45 +0200
From: Simone Ballarin <simone.ballarin@bugseng.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com
Subject: Re: [PATCH] automation: fix eclair scanning for merge requests
In-Reply-To: <alpine.DEB.2.22.394.2408061124280.4954@ubuntu-linux-20-04-desktop>
References: <alpine.DEB.2.22.394.2408011500280.114241@ubuntu-linux-20-04-desktop>
 <f5990dbcf0131768fdfd35bfdfd8930c@bugseng.com>
 <alpine.DEB.2.22.394.2408051712320.4954@ubuntu-linux-20-04-desktop>
 <876a1792599b8a10fb49eefb10d475bc@bugseng.com>
 <alpine.DEB.2.22.394.2408061124280.4954@ubuntu-linux-20-04-desktop>
Message-ID: <481901df1269750bba2da4294f32fd14@bugseng.com>
X-Sender: simone.ballarin@bugseng.com
Organization: BUGSENG s.r.l.
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit

On 2024-08-06 20:25, Stefano Stabellini wrote:
> On Tue, 6 Aug 2024, Simone Ballarin wrote:
>> On 2024-08-06 03:03, Stefano Stabellini wrote:
>> > On Sat, 3 Aug 2024, Nicola Vetrini wrote:
>> > > On 2024-08-02 00:06, Stefano Stabellini wrote:
>> > > > The ECLAIR jobs part of the Gitlab CI pipeline fail reliably when the
>> > > > pipeline is started from a merge request. This is the error:
>> > > >
>> > > > Unexpected event pull_request
>> > > >
>> > > > The error is a consequence of action.settings setting event=pull_request
>> > > > for merge_request_event. Given that we don't need any special behavior
>> > > > from ECLAIR for merge requests, just run the regular scan, change
>> > > > action.settings to set event=push for merge_request_event (same as for
>> > > > pipeline triggered by git push).
>> > > >
>> > >
>> > > According to my analysis, the error stems from the fact that
>> > > automation/scripts/eclair unconditionally calls action_push.sh, which is
>> > > not
>> > > designed to handle merge requests (that would be action_pull_request.sh).
>> > > One
>> > > approach, that needs to be tested, could be to execute that second script
>> > > based on the value of ${CI_PIPELINE_SOURCE}.
>> > >
>> > > The main difference the approach taken in this patch is that the analysis
>> > > results will be relative to the nearest merge point with the staging tree.
>> > > If
>> > > that's not something that is desired, then this approach looks good to me.
>> >
>> > You are right. I tested the below and it works as expected, see:
>> > https://gitlab.com/xen-project/people/sstabellini/xen/-/pipelines/1401863307
>> >
>> >
>> 
>> Hi Stefano,
>> 
>> the patch looks ok. Don't know whether is should be submitted again. 
>> Only one
>> minor nit:
>> 
>> > ---
>> > From dee036081cb367862daba264e1eb84ca2505f678 Mon Sep 17 00:00:00 2001
>> > From: Stefano Stabellini <stefano.stabellini@amd.com>
>> > Date: Mon, 5 Aug 2024 14:24:23 -0700
>> > Subject: [PATCH] automation: fix eclair gitlab jobs for merge requests
>> >
>> > The "eclair" script calls action_push.sh even for merge request, while
>> > instead action_pull_request.sh should be called, resulting in a job
>> > failure with this error:
>> >
>> > Unexpected event pull_request
>> >
>> > Fix the script to call action_pull_request.sh appropriately.
>> >
>> > Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
>> > ---
>> >  automation/eclair_analysis/ECLAIR/action_pull_request.sh | 2 +-
>> >  automation/scripts/eclair                                | 9 ++++++++-
>> >  2 files changed, 9 insertions(+), 2 deletions(-)
>> >  mode change 100644 => 100755
>> > automation/eclair_analysis/ECLAIR/action_pull_request.sh
>> >
>> > diff --git a/automation/eclair_analysis/ECLAIR/action_pull_request.sh
>> > b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
>> > old mode 100644
>> > new mode 100755
>> > index 68f7e6282e..812238e07f
>> > --- a/automation/eclair_analysis/ECLAIR/action_pull_request.sh
>> > +++ b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
>> > @@ -3,7 +3,7 @@
>> >  set -eu
>> >
>> >  usage() {
>> > -    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR COMMIT_ID" >&2
>> > +    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR" >&2
>> >      exit 2
>> >  }
>> >
>> > diff --git a/automation/scripts/eclair b/automation/scripts/eclair
>> > index ebcaf09b54..97d743ab53 100755
>> > --- a/automation/scripts/eclair
>> > +++ b/automation/scripts/eclair
>> > @@ -21,5 +21,12 @@ ex=0
>> >  # Fail in case of new reports for clean guidelines
>> >  "${ECLAIR_DIR}/action_check_clean_regressions.sh" "${ECLAIR_OUTPUT_DIR}" ||
>> > ex=$?
>> >
>> > -"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
>> > +case "${CI_PIPELINE_SOURCE}" in
>> > +merge_request_event)
>> > +    "${ECLAIR_DIR}/action_pull_request.sh" "${WTOKEN}"
>> > "${ECLAIR_OUTPUT_DIR}"
>> > +    ;;
>> > +push | pipeline | web | schedule)
>> > +    "${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
>> > +    ;;
>> > +esac
>> 
>> here I think it's better to give an error if the event is not handled.
>> Something similar to
>> 
>> *)
>>     echo "Unexpected event ${CI_PIPELINE_SOURCE}" >&2
>>     ex=1
>>     ;;
> 
> Good suggestion. Here is the updated patch, please ack.
> 
> ---
> 
> From f49aacb3f281eca073ccdd9fd1326d79b58b7ed2 Mon Sep 17 00:00:00 2001
> From: Stefano Stabellini <stefano.stabellini@amd.com>
> Date: Mon, 5 Aug 2024 14:24:23 -0700
> Subject: [PATCH v3] automation: fix eclair gitlab jobs for merge 
> requests
> 
> The "eclair" script calls action_push.sh even for merge request, while
> instead action_pull_request.sh should be called, resulting in a job
> failure with this error:
> 
> Unexpected event pull_request
> 
> Fix the script to call action_pull_request.sh appropriately.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Reviewed-by: Simone Ballarin <simone.ballarin@bugseng.com>
> ---
> Changes in v3:
> - handle unexpected ${CI_PIPELINE_SOURCE}
> ---
>  .../eclair_analysis/ECLAIR/action_pull_request.sh   |  2 +-
>  automation/scripts/eclair                           | 13 ++++++++++++-
>  2 files changed, 13 insertions(+), 2 deletions(-)
>  mode change 100644 => 100755 
> automation/eclair_analysis/ECLAIR/action_pull_request.sh
> 
> diff --git a/automation/eclair_analysis/ECLAIR/action_pull_request.sh 
> b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
> old mode 100644
> new mode 100755
> index 68f7e6282e..812238e07f
> --- a/automation/eclair_analysis/ECLAIR/action_pull_request.sh
> +++ b/automation/eclair_analysis/ECLAIR/action_pull_request.sh
> @@ -3,7 +3,7 @@
>  set -eu
> 
>  usage() {
> -    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR COMMIT_ID" >&2
> +    echo "Usage: $0 WTOKEN ANALYSIS_OUTPUT_DIR" >&2
>      exit 2
>  }
> 
> diff --git a/automation/scripts/eclair b/automation/scripts/eclair
> index ebcaf09b54..3ec760bab8 100755
> --- a/automation/scripts/eclair
> +++ b/automation/scripts/eclair
> @@ -21,5 +21,16 @@ ex=0
>  # Fail in case of new reports for clean guidelines
>  "${ECLAIR_DIR}/action_check_clean_regressions.sh" 
> "${ECLAIR_OUTPUT_DIR}" || ex=$?
> 
> -"${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
> +case "${CI_PIPELINE_SOURCE}" in
> +merge_request_event)
> +    "${ECLAIR_DIR}/action_pull_request.sh" "${WTOKEN}" 
> "${ECLAIR_OUTPUT_DIR}"
> +    ;;
> +push | pipeline | web | schedule)
> +    "${ECLAIR_DIR}/action_push.sh" "${WTOKEN}" "${ECLAIR_OUTPUT_DIR}"
> +    ;;
> +*)
> +    echo "Unexpected event ${CI_PIPELINE_SOURCE}" >&2
> +    ex=1
> +    ;;
> +esac
>  [ "${ex}" = 0 ] || exit "${ex}"


From xen-devel-bounces@lists.xenproject.org Tue Aug 06 22:24:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 06 Aug 2024 22:24:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773127.1183598 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbSab-0001P8-EQ; Tue, 06 Aug 2024 22:23:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773127.1183598; Tue, 06 Aug 2024 22:23:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbSab-0001P1-Bv; Tue, 06 Aug 2024 22:23:33 +0000
Received: by outflank-mailman (input) for mailman id 773127;
 Tue, 06 Aug 2024 22:23:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbSaa-0001Or-BI; Tue, 06 Aug 2024 22:23:32 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbSaa-0007pv-0G; Tue, 06 Aug 2024 22:23:32 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbSaZ-0003b6-EQ; Tue, 06 Aug 2024 22:23:31 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbSaZ-0002F3-Dq; Tue, 06 Aug 2024 22:23:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=RVnIF0/FvbtIXvOHXTLgx3Yc4yGnO948SspkbtSsZVQ=; b=UZyF28wAT8xEp822neRmaTd03S
	097t9/ocy0Y9nQXGVDMQYSSOLrh8UswybnbgUqQDiDSTaHmxs5+qMHt9bMSFfrN/lmHbPMCEro0s6
	w1x/p1WJzgxsxFASgXUylBMyxC8ZCtZBfj5CcTm2ZEGVhmXjExaKim/MpDMmWcDUK2f4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187173-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187173: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=2dbb61001b335c8f980b39ef9fa05fe5b2bca3e6
X-Osstest-Versions-That:
    xen=44a37c7832e49cdee103a0af392b7c12705bdc25
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 06 Aug 2024 22:23:31 +0000

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

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  2dbb61001b335c8f980b39ef9fa05fe5b2bca3e6
baseline version:
 xen                  44a37c7832e49cdee103a0af392b7c12705bdc25

Last test of basis   187169  2024-08-06 07:00:33 Z    0 days
Testing same since   187173  2024-08-06 19:02:13 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Julien Grall <jgrall@amazon.com>
  Luca Fancellu <luca.fancellu@arm.com>
  Michal Orzel <michal.orzel@amd.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Shawn Anastasio <sanastasio@raptorengineering.com>
  Stewart Hildebrand <stewart.hildebrand@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   44a37c7832..2dbb61001b  2dbb61001b335c8f980b39ef9fa05fe5b2bca3e6 -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 00:16:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 00:16:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773158.1183608 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbULY-0000wn-38; Wed, 07 Aug 2024 00:16:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773158.1183608; Wed, 07 Aug 2024 00:16:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbULY-0000wg-0b; Wed, 07 Aug 2024 00:16:08 +0000
Received: by outflank-mailman (input) for mailman id 773158;
 Wed, 07 Aug 2024 00:16:07 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbULX-0000wW-4l; Wed, 07 Aug 2024 00:16:07 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbULW-0002Ji-UU; Wed, 07 Aug 2024 00:16:06 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbULW-0007IH-F6; Wed, 07 Aug 2024 00:16:06 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbULW-000282-En; Wed, 07 Aug 2024 00:16:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=uDIEJnPkQSvmV4BYXCaSQ7UTgk472B+By4LaaJykxYg=; b=YYpeE5lq1sOtebqz9csF9RNekO
	C7zq8l3CDZUymo10LJY/Dh3cma6wCX6ght2JO2iw+vJUqHP2YT3Bkl1CXiTb0r4Ek4MlnJuv3oTZj
	tvjp1KLJmfKxbRGrIqkYuhjI2I5Kc7rEUfsvYETQVg20H8Mf4r1+uqJkDJnjpl1dC46o=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187172-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187172: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=eb5e56d1491297e0881c95824e2050b7c205f0d4
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 07 Aug 2024 00:16:06 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827

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

version targeted for testing:
 linux                eb5e56d1491297e0881c95824e2050b7c205f0d4
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   21 days
Failing since        186925  2024-07-20 09:44:52 Z   17 days   36 attempts
Testing same since   187172  2024-08-06 16:14:17 Z    0 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 01:54:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 01:54:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773172.1183620 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbVs9-0001H7-Qq; Wed, 07 Aug 2024 01:53:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773172.1183620; Wed, 07 Aug 2024 01:53:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbVs9-0001H0-LB; Wed, 07 Aug 2024 01:53:53 +0000
Received: by outflank-mailman (input) for mailman id 773172;
 Wed, 07 Aug 2024 01:53:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbVs9-0001Gq-04; Wed, 07 Aug 2024 01:53:53 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbVs8-0006eQ-Qm; Wed, 07 Aug 2024 01:53:52 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbVs8-0002Vi-Bp; Wed, 07 Aug 2024 01:53:52 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbVs8-0007Hk-9b; Wed, 07 Aug 2024 01:53:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=qNzeYxVtRVUTek6iDevIJy5fuNS0IK4nnXXgBB5AMk8=; b=X6U0J4wpnBQCMysG8zWaF/Qn6+
	ZQgd+iau9a0nCO+Rf7r7m0zSkusu/WbSSGdXGUxNR1L5SyLde886a6EDUQitiDMmX8oYjt05/9sGf
	OUMWtu1Jaizhw4aqST2VZMnXTdM4Iztd+1EXXrCgNGhnn+DJXysD4j1r4XcP8GpKKTrM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187175-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187175: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=6b9b96ddebf269579730ff2a65f324505bc2aba9
X-Osstest-Versions-That:
    xen=2dbb61001b335c8f980b39ef9fa05fe5b2bca3e6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 07 Aug 2024 01:53:52 +0000

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

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  6b9b96ddebf269579730ff2a65f324505bc2aba9
baseline version:
 xen                  2dbb61001b335c8f980b39ef9fa05fe5b2bca3e6

Last test of basis   187173  2024-08-06 19:02:13 Z    0 days
Testing same since   187175  2024-08-06 23:03:56 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Federico Serafini <federico.serafini@bugseng.com>
  Stefano Stabellini <sstabellini@kernel.org>
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   2dbb61001b..6b9b96ddeb  6b9b96ddebf269579730ff2a65f324505bc2aba9 -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 04:41:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 04:41:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773187.1183631 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbYTw-0000H8-2l; Wed, 07 Aug 2024 04:41:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773187.1183631; Wed, 07 Aug 2024 04:41:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbYTv-0000H1-WB; Wed, 07 Aug 2024 04:41:04 +0000
Received: by outflank-mailman (input) for mailman id 773187;
 Wed, 07 Aug 2024 04:41:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbYTu-0000Gr-LT; Wed, 07 Aug 2024 04:41:02 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbYTu-0001k2-HV; Wed, 07 Aug 2024 04:41:02 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbYTt-0000QP-WB; Wed, 07 Aug 2024 04:41:02 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbYTt-0007A9-Vj; Wed, 07 Aug 2024 04:41:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=8a778V0mAOWUkQ8j8v4ffRNZ/Qn/gbqVvNa3O53RPyI=; b=4EAaucRkhM7Qcpj9icMd6H+m5M
	oriiYOhgKQ52/wKcbLriRfYMiCfVSPcWisguqHE2BH0prtem+qNEKoad8Fp3uRlbhKaGApH6rUHNH
	fTSsTRO0Mt9pY4y+rs1o+rM63RE9HnweGIanu14wcFbvZwzPtrx8zwYXYGIsIqSTvy2Q=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187174-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187174: regressions - FAIL
X-Osstest-Failures:
    xen-unstable:build-armhf:xen-build:fail:regression
    xen-unstable:build-armhf-libvirt:build-check(1):blocked:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:build-check(1):blocked:nonblocking
    xen-unstable:test-armhf-armhf-examine:build-check(1):blocked:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:build-check(1):blocked:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:build-check(1):blocked:nonblocking
    xen-unstable:test-armhf-armhf-xl:build-check(1):blocked:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:build-check(1):blocked:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:build-check(1):blocked:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:build-check(1):blocked:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:build-check(1):blocked:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:build-check(1):blocked:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:build-check(1):blocked:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=44a37c7832e49cdee103a0af392b7c12705bdc25
X-Osstest-Versions-That:
    xen=bec25f11d5180d407cf04d2de2525fa6f876bde1
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 07 Aug 2024 04:41:01 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-armhf                   6 xen-build                fail REGR. vs. 187171

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

version targeted for testing:
 xen                  44a37c7832e49cdee103a0af392b7c12705bdc25
baseline version:
 xen                  bec25f11d5180d407cf04d2de2525fa6f876bde1

Last test of basis   187171  2024-08-06 09:22:53 Z    0 days
Testing same since   187174  2024-08-06 19:39:15 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Sergiy Kibrik <Sergiy_Kibrik@epam.com>

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


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

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

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

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


Not pushing.

------------------------------------------------------------
commit 44a37c7832e49cdee103a0af392b7c12705bdc25
Author: Jan Beulich <jbeulich@suse.com>
Date:   Tue Aug 6 08:37:10 2024 +0200

    x86/shutdown: use DMI_MATCH2()
    
    ... to please Misra C:2012 Rule 9.3 (Arrays shall not be partially
    initialized).
    
    Fixes: d81dd3130351 ("x86/shutdown: change default reboot method preference")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

commit 10eccbb821cbd0d623ba3cb68a01dfb79c39ea48
Author: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Date:   Tue Aug 6 08:36:29 2024 +0200

    xen/riscv: refactor decode_trap_cause()
    
    Use array_access_nospec() to prevent guest speculation.
    
    Avoid double access of trap_causes[cause].
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>

commit cddbee85d0c0386a2126c4698c1f63baeaf292f1
Author: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Date:   Tue Aug 6 08:35:09 2024 +0200

    x86/vpmu: guard calls to vmx/svm functions
    
    If VMX/SVM disabled in the build, we may still want to have vPMU drivers for
    PV guests. Yet in such case before using VMX/SVM features and functions we have
    to explicitly check if they're available in the build. For this purpose
    (and also not to complicate conditionals) two helpers introduced --
    is_{vmx,svm}_vcpu(v) that check both HVM & VMX/SVM conditions at the same time,
    and they replace is_hvm_vcpu(v) macro in Intel/AMD PMU drivers.
    
    Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 05:15:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 05:15:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773198.1183643 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbZ0r-0005PM-Kv; Wed, 07 Aug 2024 05:15:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773198.1183643; Wed, 07 Aug 2024 05:15:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbZ0r-0005PF-GV; Wed, 07 Aug 2024 05:15:05 +0000
Received: by outflank-mailman (input) for mailman id 773198;
 Wed, 07 Aug 2024 05:15:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=n6VL=PG=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1sbZ0q-0005P9-3Z
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 05:15:04 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on20600.outbound.protection.outlook.com
 [2a01:111:f403:2415::600])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fec3fcee-547b-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 07:15:01 +0200 (CEST)
Received: from BY5PR04CA0028.namprd04.prod.outlook.com (2603:10b6:a03:1d0::38)
 by IA1PR12MB7757.namprd12.prod.outlook.com (2603:10b6:208:422::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Wed, 7 Aug
 2024 05:14:57 +0000
Received: from SJ5PEPF000001E9.namprd05.prod.outlook.com
 (2603:10b6:a03:1d0:cafe::f1) by BY5PR04CA0028.outlook.office365.com
 (2603:10b6:a03:1d0::38) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.27 via Frontend
 Transport; Wed, 7 Aug 2024 05:14:57 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SJ5PEPF000001E9.mail.protection.outlook.com (10.167.242.197) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Wed, 7 Aug 2024 05:14:57 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 7 Aug
 2024 00:14:55 -0500
Received: from [172.23.60.101] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 7 Aug 2024 00:14:55 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fec3fcee-547b-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=qunMY/39g8IznVoUGBWOnTGmBvX6382LkjYzxFZYZ4jFi2uKjlY0D9ZEb94PRBwP7lRIOZqwHWl4RiUbIjfDRech24En2eNHf55hB6uabwcT+iojWMyqGVVgZihHpH7w5oSbjtyt3J4mLcuLpNvrD4qYVPXL0a5lu0Wl5ji4X/oYLqLspU7L41LRoVvtSBi0hiCZoKlVBTJXZgCvKk4fnSZo708nUjnXZ571rEsZXzVfQirei6ZYGW7BtIpPQgr+GPwcp0XS/csJn/Dxkhj/WGRXzuCxQVvcUZNNJqR8/K//b3LM7BCMVdehwjnewqEQk7Ao/BSYGZrzsQLu34Pf8g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Hozdtx6yrd2950c3UReUlDos23J9H9xc0mZfXU9SHWY=;
 b=bQR8MwWJF9A5unGwrqNs4JmMbG3CHR8/HIvPVNwNNatiDirv9qFfT4KVqlUSRWuaEqNEZhi97CUCdMuh9L9eSjmY7z60GNKXJst9roNCtqHwUIaJn13vArpQN99F21AlI25Vq7LzR6xHbB9TlkYrMDUSb0h1eKrebn9uj3AVJuyo39n6rCvt/O9MHyihaNzGnXBiwVb1xv1ZEUNc3h9IAvj76XJ3C+E+MbOpCCYvEINMVD3inP+7yTjgw7PHjghr3p24riZ4PdxTTovOudliLsxbeWyieuFJA5+lU6xkMMTi4QmnvHvYPjNkc8DJh+4WR7hqLt43NptZo6DCyeyv9Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Hozdtx6yrd2950c3UReUlDos23J9H9xc0mZfXU9SHWY=;
 b=wZzNBnRTsrt/5Id00RvW2L3m2n20I/B6UJigTtGFkMpw38oXZ4pVwbApT8jleYSmfbyonNqOdySxMdljrLgJOTVXFgvUqWMcRx6XbXSFQMoF94g51A+5gpYGLVsVn1si8T2yI+otIXoxqCgV5mqA5oBqSYUCOAckxrnSWwhd9/Y=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <6e4b8820-5cb4-4f8b-8fff-b77ae49fbe38@amd.com>
Date: Wed, 7 Aug 2024 01:14:54 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/msi: fix locking for SRIOV devices
To: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, Teddy Astie
	<teddy.astie@vates.tech>, <xen-devel@lists.xenproject.org>
References: <20240805210956.364624-1-stewart.hildebrand@amd.com>
 <38836a27-951f-49c8-a10e-e19b910a8444@suse.com>
Content-Language: en-US
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
In-Reply-To: <38836a27-951f-49c8-a10e-e19b910a8444@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB04.amd.com: stewart.hildebrand@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001E9:EE_|IA1PR12MB7757:EE_
X-MS-Office365-Filtering-Correlation-Id: f02e5d3e-9efa-46f9-3c8d-08dcb69fe11e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?djh5NnZncmJtVkJnaUZtWC9obWFDL0lDMzVtTThWamc3SDlyV3JvZ0syVncx?=
 =?utf-8?B?elVPMGRhdzN4Z0Z0REVzTHhxbXRuRk1vNUJiZ0pZQ21Ka2lDTDZ2ZXlxWmJS?=
 =?utf-8?B?QjF3cGNRZHUrbVpxei92aWgvTExOV2tOZkY0cmovNk9xMmcxZlgrenVRMU1k?=
 =?utf-8?B?Q2FWdVg4YTRId1pOZytNVmV4bVpzTE1qYWNlTlpidHFkMVQrekp4NGxHWklW?=
 =?utf-8?B?VG9NRFhxTEpmYWQ2dEYyLzFYcEtJT1VDcGIvZ0ZjdUlLbW10M2RYbm5hUFNC?=
 =?utf-8?B?ZFMxanJJa1lZZ2tldWdjSE5VSnJReEx6RG1uMHVtZ0V1WW90NWhJc28xejZi?=
 =?utf-8?B?dTAzSUVTQytHMmhCUVc1NWlpWitmMjJOV1ZUSGhqNHZWUzV4NldWNFp5ZHFO?=
 =?utf-8?B?cnVQTmdXaTRTc1FyT09Da1c1TXY1eFNDZXF2b2hUb2hKdXBlcHRuZ3NVTWJV?=
 =?utf-8?B?c2QrMHF6VFhwczFlS0pSWXY0blkzMlEvcVYzeU1ZOCtiZEdvdWV0a3NwOEIr?=
 =?utf-8?B?RC9LSW9XZVpIempadjU1OTV0eFhaNFFHUU5Gc3RBYUtjS3NUejBwWlF4Nm9p?=
 =?utf-8?B?QjRZcWhMVngwYmVQUlZTbC8vRTZOcm1qdmRxaC82azBIclB3TjFncG5oSEtx?=
 =?utf-8?B?dW8yNTIydGxtTVFKUG9wSmNXc1lPc1FPVzIrK2YyVUZOVDBDNm9zWkorVFVU?=
 =?utf-8?B?OVpJZ043cEtxb2IzM244TE5QWHNJV2FjOHJGZ0NjOGdQSWpMRUh0TjJWeVhs?=
 =?utf-8?B?R3FOTzA5WERYN2l4dVBZT3pMNXJ1YlZtTTZnWWN3M1ljd2llWVc5R043L0V4?=
 =?utf-8?B?MndyN0dLcWl2MFBDWDNPWGQ1TCtjK3M5ZnZ2TlFRNk9lOXlqenJ2anhjc1ZQ?=
 =?utf-8?B?MFVUUmk5QU1leVlsZ250dEFnbTB2WE9qSVBpRFN1RExtUkNVUXZzRit6cU5v?=
 =?utf-8?B?b2dCaWtuZ2NPWjF2VTY2Zld4RkNHKzY5YUNYRS9aUjBpa0VCU2JWdkhIM0Zu?=
 =?utf-8?B?d2lweEgzdU9HUGMxOUx4UVhmbDBNM1hvQ2VybXNEcnNublFvREg3UjYxV21E?=
 =?utf-8?B?VjVINzRjSFR5QUFzNDVZbElNenAvb01EWlJxa3JIQ2ZHN3BocTFtUkJzOEEy?=
 =?utf-8?B?K3hzYWg4b3pndFhCaWVhV1FRVC9MaHBUVGE4Mi9JMklrVWRBekNJSjQxa2xD?=
 =?utf-8?B?ZUcvQjB6N0NoSUdJZXZhUHhtbHZtakxqbXJCcU9wMFFjOUFPYldmNUxJdWY3?=
 =?utf-8?B?ZTNjVTJPaHkxS3puMERQS3hHWnh1Q3FnQ1dkYVZXRHZibk1SenRiUWl4OEFr?=
 =?utf-8?B?UVJwTWg1b1hMRkxicFJteTNLa3V0aTlaNlgvSnkrWTJ0QzE2dmNRUlRyekE1?=
 =?utf-8?B?N3ZiNzdJZzhMQWJuNXNUTTloRHpURVRaV3FhMURYaEJuQzdYQ1JrN05YcDd3?=
 =?utf-8?B?RExVdXR2QWJ5ZDhEMk51cFNXVkcvalc5REdncHJkaVBuMEUycEsyTTdSNFJX?=
 =?utf-8?B?aGdqZEt2NXNEOUdsWnFLUjBocm53dTR3aVFhdDRVZ1FwdldLc1d4bS9nSWsx?=
 =?utf-8?B?WnFXRjZ0cm5wM3djZjFuRnZDTTA4ZjVYM3ZtaWNmUEJueW93cUlaZGttL09P?=
 =?utf-8?B?Wm1rUXFxekpVbXJreXJ2bFo4SGxtNTRKTWtxYmN5ekk4OGQ2Tnh0bSs5MjBv?=
 =?utf-8?B?dlpMdkxGNXd5VE1kTFJQZDNGVWwzZEI2YmdYcENFbmR0NGViK0NoUlJyN1lo?=
 =?utf-8?B?Uktua25Cc1VTcHo3NE96b0hGcE9RVkhhOU9pZS8yKzdkaG5SQlZLc3hWd3Vu?=
 =?utf-8?B?YVJVTHVGNjE3ZklGNVdhbVFVUVJhYkhEeTZsZzFzdU5CdU5Jb0E0dk1GSHVZ?=
 =?utf-8?B?NHZHcUE4bVRtOUdKbVRFQUZyTmZ5Y2w5MGp3dlNEWjFvcERaQ0V1NFk0dWdL?=
 =?utf-8?Q?+I6m+najUrjfcZK4Lkd35TsvflnnPTsO?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2024 05:14:57.1272
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: f02e5d3e-9efa-46f9-3c8d-08dcb69fe11e
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF000001E9.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7757

On 8/6/24 02:25, Jan Beulich wrote:
> On 05.08.2024 23:09, Stewart Hildebrand wrote:
>> In commit 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci
>> structure") a lock moved from allocate_and_map_msi_pirq() to the caller
>> and changed from pcidevs_lock() to read_lock(&d->pci_lock). However, one
>> call path wasn't updated to reflect the change, leading to a failed
>> assertion observed on debug builds of Xen when an SRIOV device is
>> present with one or more VFs enabled:
>>
>> (XEN) Assertion 'd || pcidevs_locked()' failed at drivers/passthrough/pci.c:535
>> (XEN) ----[ Xen-4.20-unstable  x86_64  debug=y  Not tainted ]----
> 
> There must be more to this than just "SR-IOV with VFs enabled"? The
> locking change has been there for quite a while, yet the issue was
> noticed only know.

Yes, the conditions as far as I can tell are:
* PV dom0
* Debug build (debug=y) only
* There is a SR-IOV device in the system with one or more VFs enabled/configured
* Dom0 has loaded the driver for the VF and enabled MSI-X

The assert triggers when dom0 loads the VF driver and enables MSI-X
before PHYSDEVOP_prepare_msix is invoked.

>> @@ -829,7 +829,8 @@ static int msix_capability_init(struct pci_dev *dev,
>>              vf = dev->sbdf.bdf;
>>          }
>>  
>> -        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
>> +        table_paddr = read_pci_mem_bar(dev->domain, seg, pbus, pslot, pfunc,
>> +                                       bir, vf);
> 
> While dev->domain is the owner of dev (seg:bus:slot.func), it may not be
> the owner of seg:pbus:pslot.pfunc. Or if it (reliably) is, I'd expect the
> guarantees towards that to be spelled out in the description. (Dependency
> on ordering of toolstack operations likely wouldn't count as a guarantee
> to me. Yet if I'm not mistaken there's a problem in all cases if the VF
> was already moved to DomIO, before the DomU is started.)

On the possibility that they're not the same (now or in the future),
disregard this patch.

> Further to this, until realizing that the code path leading here is
> accessible only for Dom0, I suspected a security angle to this, and hence
> didn't respond publicly on Matrix. I noticed, however, that apparently
> there's another instance of the same issue (via the other call site of
> allocate_and_map_msi_pirq(), i.e. from vpci_msix_arch_enable_entry()
> through vpci_msi_enable()). Imo that wants dealing with at the same time
> (potentially requiring a different overall approach).

There's a simpler way to solve this: the VF doesn't strictly need to
obtain the pdev of its associated PF, so the call to pci_get_pdev() can
be removed from read_pci_mem_bar(). Patch to follow...

> The code path leading here being accessible only for Dom0 likely is also
> a mistake (read: overly strict). In principle it ought to be possible to
> move a PF to a driver domain, for the VFs to then be assigned to
> individual DomU-s. In such a case I expect it shouldn't be Dom0 to invoke
> PHYSDEVOP_prepare_msix.
> 
> Jan



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 05:20:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 05:20:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773207.1183653 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbZ6B-0007Kj-DI; Wed, 07 Aug 2024 05:20:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773207.1183653; Wed, 07 Aug 2024 05:20:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbZ6B-0007Kc-8W; Wed, 07 Aug 2024 05:20:35 +0000
Received: by outflank-mailman (input) for mailman id 773207;
 Wed, 07 Aug 2024 05:20:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=n6VL=PG=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1sbZ69-0007KW-Pi
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 05:20:33 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on2061e.outbound.protection.outlook.com
 [2a01:111:f403:2414::61e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c418c1fb-547c-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 07:20:32 +0200 (CEST)
Received: from BL1P222CA0009.NAMP222.PROD.OUTLOOK.COM (2603:10b6:208:2c7::14)
 by BL3PR12MB6476.namprd12.prod.outlook.com (2603:10b6:208:3bc::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Wed, 7 Aug
 2024 05:20:29 +0000
Received: from BL02EPF0002992D.namprd02.prod.outlook.com
 (2603:10b6:208:2c7:cafe::21) by BL1P222CA0009.outlook.office365.com
 (2603:10b6:208:2c7::14) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.27 via Frontend
 Transport; Wed, 7 Aug 2024 05:20:29 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 BL02EPF0002992D.mail.protection.outlook.com (10.167.249.58) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Wed, 7 Aug 2024 05:20:28 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 7 Aug
 2024 00:20:28 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 7 Aug
 2024 00:20:27 -0500
Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 7 Aug 2024 00:20:27 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c418c1fb-547c-11ef-bc04-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=sNafmEuUyboh9fbDadnluUUS/jxtULnp6wIwpOI/D7iBTtJXPsNfVWyKwXp3ZZUGKYWz5ThJISnzrj1n4UT2aX3diVgrOjmUytIKui/CN1Tu0banalOYWFrGEKEg6Av4K/3Q5Nuja8UtCnLkIgglEpByT4fmtW5DIOAjVUxxg1iFYaPjrCEnX+enxjPfkJaQaHfS+grLriZzZKl+j7dBe47V51Lydq1Fkem9fWi1v5P2r5jAtI5ZA1970IwKNwycvgTNVW71ahYy5H8inAVo4NNx6LJp+PrIy74AAmnr6yLS4BrxA8D5hJ4dUS8ydAHuSYsiSc83PVG+kjlp2uu/Vw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=aT5c0LeWRQMJB4XifmOf9ZnmeErl11LgIobwRxzYzNE=;
 b=dJlB307mu0I0LkmCoA7dFnSuqXnhUeEauSnIesHs3RxYKBSiJyOCgtB1OrEwrXWd/0+FmvWNytMoQbxWu+Ds0IHuVWDkj77YCWYWdUpVi4VG4qXbZIYM5hymK4F4TWywhBXvqvurmkXDFzTFAdj4Qy2PAzSAgQKaLC/ZTStcD1tMQK20rQoI01ToBAE1WuirXsblo8zzB9+I0/atN/25g9SzytZv2SY4m+Nycsbv7Obd9pdly0g3IxwShOvlyVaQf5Mt0bDU8Y3pvlendbpCRXx2RHckFX1VIoWkwinqwe8GeDoZ6zCqnEm8IWpic2CK9j4q2dn0jxn+z+xv9sgwnA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=aT5c0LeWRQMJB4XifmOf9ZnmeErl11LgIobwRxzYzNE=;
 b=xxmXf1jyA3ugZO+BLzy/rX2MOTVZF5NCZYBNiChy/Kp44tvXJmSzNZgdrmclM4AkE03BJnbX9QIF9y4ywcoT4lE7De41Rp0FmdtvVV7uKVuwZkN0GWJokOykf/B/kreM/YW4CHNNXhh2t3cEED+fP6PlcM8YbLeyPJ6J3NKVpKI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stewart Hildebrand <stewart.hildebrand@amd.com>, Jan Beulich
	<jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>, Teddy Astie
	<teddy.astie@vates.tech>
Subject: [PATCH v2] x86/msi: fix locking for SR-IOV devices
Date: Wed, 7 Aug 2024 01:20:08 -0400
Message-ID: <20240807052011.582099-1-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL02EPF0002992D:EE_|BL3PR12MB6476:EE_
X-MS-Office365-Filtering-Correlation-Id: 936c4f55-bf2c-4be9-8988-08dcb6a0a69d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?yLxxZ3cqf+Kwd7RZMyc5p0LegCXN/gfwbGQKBWCrlMnO/x1xAulk6yxIDq21?=
 =?us-ascii?Q?hibHxYtNC4HOHgXSBWiJKzgdn5QKqhNvByWLSj+ew4EcJDGQo0/N+oGYGtms?=
 =?us-ascii?Q?afFPg4z5R2CkF7rQQlEnbtLYkHrPFqkotGeEGRJQu0czbAxS/JCbBNpI5d7A?=
 =?us-ascii?Q?N8+4p56AT6F7i/sGYUegg8KJNVDrUSWzBB9babJYNKZe5dvE2m882BMqCkQo?=
 =?us-ascii?Q?ImT90bWNbAp4hEl6gB19vKcz6RDhoF6dhBn4CgOAdUcGmOxg6XDQNHuxTHcB?=
 =?us-ascii?Q?S6l8duK7M4znu5ByBgRZQbyWaDnuzrFwCaQ+3n5FMrINwW8Q9QdjjxB/fb0L?=
 =?us-ascii?Q?wx2faGXyMxoog+qom+gb08JGWKpYzfiTlEmqNmeKsNa3OjnV1xnAXttf/YDE?=
 =?us-ascii?Q?T7EqZfBJ3ncmhMLgSDpyZQeB3rrvJxIzPRpmh901BpgGazogYS4sXTzRK2fx?=
 =?us-ascii?Q?NSFFvAN6OxbbAdFeApL/htrbU0NBKKR4W8WqvT3R1/D8rGee2avsd+rHnRJu?=
 =?us-ascii?Q?D7ryYFHDbnL8V9kvYWUOOvUM7+5EBDpkoC30SqwYvYSTofSECPgX+xA4O7r+?=
 =?us-ascii?Q?HfpSHNnblWONFtROpBjXdmbCST65C0RbZAIgqtd92kjKGoUl7sBSJe0113T2?=
 =?us-ascii?Q?rTzYiPagSdHh/uti9HIZ3TxboPZsmu8JelDf5tS20+jXWv90U29gcSAIoKgf?=
 =?us-ascii?Q?kPnnPjVjELJ2oN4r3AOucsvs4AHlLvzQp6DXrZw9SLoiHsP1NFZ9Ca3GgXTJ?=
 =?us-ascii?Q?ej8Bt5u67YfihWZ9Q3Hr4+WMgqfndlzERf2w8iONyCvZcJK016R91sIlZUT8?=
 =?us-ascii?Q?+M6SQo5FmzN2HFK2cUfNyax+YkH5D8OXfEbqF4TFWG0R+8B5B4R7C4QgftPU?=
 =?us-ascii?Q?mvN63o14mn/nmAbh3qJdeP8xKYsGsA18cTXYfo7Rwczq99uifbmA7BEywscM?=
 =?us-ascii?Q?wTAzQR//gEI2lg5SLnm7u3ArxRDDPsxfgYuM7bRTZfkv5AgJqQV3vA3i2OOI?=
 =?us-ascii?Q?Kd/hs1dUjcJ62/4OLJ1ZpfusllRrwp20/++BdxGsFYrEfXoypt4iTV4u1sAZ?=
 =?us-ascii?Q?X/H/BiriEMzoX2gsGe51GIPiG5SXHOUHwaYUk4fMqeKztqfthebXiIUKvE23?=
 =?us-ascii?Q?SYXXgpe/zq0zxj2THOKoNGf23J7VTnPwtOkELotLaEbN86oJWIouDRe6pu+c?=
 =?us-ascii?Q?69G+G+UsnVmMnr4Hmcu4JUAvvtbA4VSiJ0/9kPjRF7De43+CWAihd8G3cdLq?=
 =?us-ascii?Q?Z4vaC5bUxhQxVHmsg/pXq3IrD4HD2qkrxhTV93e9DfVnP9RFvH3p+lB15e6n?=
 =?us-ascii?Q?P0WeR/KJLPSQcWGtmM0sQoDG8LzFfIwEbVO8OwZAehSTbJbWg5K778j3qvzS?=
 =?us-ascii?Q?1ximmPMQI1zGsylacBuytp7tqYkHI1Vcs/Tv/A8zcq2DO4z+FR/hrcJ8//RO?=
 =?us-ascii?Q?gsKzKKKmc/MG5pXhQHgbrewa1mGBmIOf?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2024 05:20:28.5507
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 936c4f55-bf2c-4be9-8988-08dcb6a0a69d
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL02EPF0002992D.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6476

In commit 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci
structure") a lock moved from allocate_and_map_msi_pirq() to the caller
and changed from pcidevs_lock() to read_lock(&d->pci_lock). However, one
call path wasn't updated to reflect the change, leading to a failed
assertion observed under the following conditions:

* PV dom0
* Debug build (debug=y) of Xen
* There is an SR-IOV device in the system with one or more VFs enabled
* Dom0 has loaded the driver for the VF and enabled MSI-X

(XEN) Assertion 'd || pcidevs_locked()' failed at drivers/passthrough/pci.c:535
(XEN) ----[ Xen-4.20-unstable  x86_64  debug=y  Not tainted ]----
...
(XEN) Xen call trace:
(XEN)    [<ffff82d040284da8>] R pci_get_pdev+0x4c/0xab
(XEN)    [<ffff82d040344f5c>] F arch/x86/msi.c#read_pci_mem_bar+0x58/0x272
(XEN)    [<ffff82d04034530e>] F arch/x86/msi.c#msix_capability_init+0x198/0x755
(XEN)    [<ffff82d040345dad>] F arch/x86/msi.c#__pci_enable_msix+0x82/0xe8
(XEN)    [<ffff82d0403463e5>] F pci_enable_msi+0x3f/0x78
(XEN)    [<ffff82d04034be2b>] F map_domain_pirq+0x2a4/0x6dc
(XEN)    [<ffff82d04034d4d5>] F allocate_and_map_msi_pirq+0x103/0x262
(XEN)    [<ffff82d04035da5d>] F physdev_map_pirq+0x210/0x259
(XEN)    [<ffff82d04035e798>] F do_physdev_op+0x9c3/0x1454
(XEN)    [<ffff82d040329475>] F pv_hypercall+0x5ac/0x6af
(XEN)    [<ffff82d0402012d3>] F lstar_enter+0x143/0x150

In read_pci_mem_bar(), the VF obtains the pdev pointer for its
associated PF to access the vf_rlen array. This array is initialized in
pci_add_device() and doesn't change afterwards. Copy the array to the
pdev of the VF, and remove the troublesome call to pci_get_pdev().

Fixes: 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci structure")
Reported-by: Teddy Astie <teddy.astie@vates.tech>
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
Candidate for backport to 4.19

v1->v2:
* remove call to pci_get_pdev()
---
 xen/arch/x86/msi.c            | 23 ++++++++++-------------
 xen/drivers/passthrough/pci.c |  7 +++++++
 2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 0c97fbb3fc03..5b28fb19b78f 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -662,7 +662,8 @@ static int msi_capability_init(struct pci_dev *dev,
     return 0;
 }
 
-static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
+static u64 read_pci_mem_bar(struct pci_dev *pdev, u16 seg, u8 bus, u8 slot,
+                            u8 func, u8 bir, int vf)
 {
     u8 limit;
     u32 addr, base = PCI_BASE_ADDRESS_0;
@@ -670,19 +671,15 @@ static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
 
     if ( vf >= 0 )
     {
-        struct pci_dev *pdev = pci_get_pdev(NULL,
-                                            PCI_SBDF(seg, bus, slot, func));
+        pci_sbdf_t pf_sbdf = PCI_SBDF(seg, bus, slot, func);
         unsigned int pos;
         uint16_t ctrl, num_vf, offset, stride;
 
-        if ( !pdev )
-            return 0;
-
-        pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_SRIOV);
-        ctrl = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_CTRL);
-        num_vf = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_NUM_VF);
-        offset = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_OFFSET);
-        stride = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_STRIDE);
+        pos = pci_find_ext_capability(pf_sbdf, PCI_EXT_CAP_ID_SRIOV);
+        ctrl = pci_conf_read16(pf_sbdf, pos + PCI_SRIOV_CTRL);
+        num_vf = pci_conf_read16(pf_sbdf, pos + PCI_SRIOV_NUM_VF);
+        offset = pci_conf_read16(pf_sbdf, pos + PCI_SRIOV_VF_OFFSET);
+        stride = pci_conf_read16(pf_sbdf, pos + PCI_SRIOV_VF_STRIDE);
 
         if ( !pos ||
              !(ctrl & PCI_SRIOV_CTRL_VFE) ||
@@ -829,7 +826,7 @@ static int msix_capability_init(struct pci_dev *dev,
             vf = dev->sbdf.bdf;
         }
 
-        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
+        table_paddr = read_pci_mem_bar(dev, seg, pbus, pslot, pfunc, bir, vf);
         WARN_ON(msi && msi->table_base != table_paddr);
         if ( !table_paddr )
         {
@@ -852,7 +849,7 @@ static int msix_capability_init(struct pci_dev *dev,
 
         pba_offset = pci_conf_read32(dev->sbdf, msix_pba_offset_reg(pos));
         bir = (u8)(pba_offset & PCI_MSIX_BIRMASK);
-        pba_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
+        pba_paddr = read_pci_mem_bar(dev, seg, pbus, pslot, pfunc, bir, vf);
         WARN_ON(!pba_paddr);
         pba_paddr += pba_offset & ~PCI_MSIX_BIRMASK;
 
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 5a446d3dcee0..3a6a6abe205e 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -654,6 +654,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
     const char *type;
     int ret;
     bool pf_is_extfn = false;
+    uint64_t vf_rlen[6] = { 0 };
 
     if ( !info )
         type = "device";
@@ -664,7 +665,10 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
                             PCI_SBDF(seg, info->physfn.bus,
                                      info->physfn.devfn));
         if ( pdev )
+        {
             pf_is_extfn = pdev->info.is_extfn;
+            memcpy(vf_rlen, pdev->vf_rlen, sizeof(pdev->vf_rlen));
+        }
         pcidevs_unlock();
         if ( !pdev )
             pci_add_device(seg, info->physfn.bus, info->physfn.devfn,
@@ -700,7 +704,10 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
          * extended function.
          */
         if ( pdev->info.is_virtfn )
+        {
             pdev->info.is_extfn = pf_is_extfn;
+            memcpy(pdev->vf_rlen, vf_rlen, sizeof(pdev->vf_rlen));
+        }
     }
 
     if ( !pdev->info.is_virtfn && !pdev->vf_rlen[0] )

base-commit: 6b9b96ddebf269579730ff2a65f324505bc2aba9
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 05:49:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 05:49:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773217.1183662 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbZXf-0002ua-J2; Wed, 07 Aug 2024 05:48:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773217.1183662; Wed, 07 Aug 2024 05:48:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbZXf-0002uT-FY; Wed, 07 Aug 2024 05:48:59 +0000
Received: by outflank-mailman (input) for mailman id 773217;
 Wed, 07 Aug 2024 05:48:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbZXe-0002uJ-9v; Wed, 07 Aug 2024 05:48:58 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbZXe-0003Qs-3c; Wed, 07 Aug 2024 05:48:58 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbZXd-0002LK-Np; Wed, 07 Aug 2024 05:48:57 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbZXd-0002Cl-NR; Wed, 07 Aug 2024 05:48:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=YtSEjTzPi4sQEsHbWOvhfQtfCfPJFhJ+BIvIAVrBKnM=; b=R1/vG6ERECE+94h6J/Sk1OrtFB
	A3vxwbJOJFw9sBiz5ccpsyl+6cAG57z5dNuyffElcBzRko0Ufiy06uB7PmcUJhNmBruu2CuH0Smsy
	o3SopXGzbsauAjyvJ6gVMWzkSLVRGe/9M0xauFVVcBoJyfoQPZ9Pmm+SyNVgRcUP00Pc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187177-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187177: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=976113774320e5f18bb5bd6f21dd062c1d74f3d4
X-Osstest-Versions-That:
    ovmf=a29a9cce5f9afa32560d966e501247246ec96ef6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 07 Aug 2024 05:48:57 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 976113774320e5f18bb5bd6f21dd062c1d74f3d4
baseline version:
 ovmf                 a29a9cce5f9afa32560d966e501247246ec96ef6

Last test of basis   187168  2024-08-06 06:11:29 Z    0 days
Testing same since   187177  2024-08-07 03:43:22 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Igor Kulchytskyy <116655144+igorkulchytskyy@users.noreply.github.com>
  Igor Kulchytskyy <igork@ami.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   a29a9cce5f..9761137743  976113774320e5f18bb5bd6f21dd062c1d74f3d4 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 07:34:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 07:34:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773230.1183672 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbbBu-0001Yd-Kv; Wed, 07 Aug 2024 07:34:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773230.1183672; Wed, 07 Aug 2024 07:34:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbbBu-0001YW-IH; Wed, 07 Aug 2024 07:34:38 +0000
Received: by outflank-mailman (input) for mailman id 773230;
 Wed, 07 Aug 2024 07:34:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=628V=PG=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbbBt-0001YN-Nn
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 07:34:37 +0000
Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com
 [2a00:1450:4864:20::230])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7f05b484-548f-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 09:34:36 +0200 (CEST)
Received: by mail-lj1-x230.google.com with SMTP id
 38308e7fff4ca-2f0dfdc9e16so17825001fa.2
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 00:34:36 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9c0ca17sm616541366b.84.2024.08.07.00.34.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 07 Aug 2024 00:34:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7f05b484-548f-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723016075; x=1723620875; 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=KewNuW9n1edfIS0RiACMpFknIvW8EA2RWi5tQI1QLCs=;
        b=Wuk3rk1g/2/ucv3w0UCpiHQyHUz1o1abpenS8H2mtEWxH8eFsoU20xQ3596WnVc1r1
         6cUIzznc0Okyu0xtJxzLZrlKDL0hdlXoZsQaQb8FKIW8Uif81KqsRJNPnErP1j2fQkct
         XWIxUoGPRznUj6U5EQC9xiM47c2pozxe8P453Q2LmPCUmIZs7TcO9RahCwNmNdiGsit9
         c0nILiHWYYBtUnQC4c2QQ/7nfSxHdWPff33Nix7e4vNZ0OP/6saaNxiDOmu7DHPhez1Y
         KpdPpfVQ8lD/yU8/TUS5cXOAGxMosXbZbSjkWkj+PHLX3//RU2cz5gblN0SfNjT3PjKQ
         kUjg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723016075; x=1723620875;
        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=KewNuW9n1edfIS0RiACMpFknIvW8EA2RWi5tQI1QLCs=;
        b=K0WoOJLCnKrMi3eDt7ObrhlfGReUmtSU0VQyCbl0Qr5oXUNaeDvrNjFQhNleuiuFJM
         cVUhxu5Rs0303+bs0yJLl/sdawqp7ZAFGJUQcjDhHpadZuoZKnNkEn4s/YU22YtHs53M
         g2/0vKgJ8AP0GH4vrZLhzm9n6KgrI07MYpkPRWFPfCpB6ByKdfB+sv5CG42ySELiwA3Y
         Zw0/YUBTnafY8vNq9hiK5nUWzk8tSsMZSZNdxk3DqstUyRBpApr/pICaqqT18dpxUMQt
         sMyrjz4Kpz27civJTb4HXnydpQ+N7eYOnje/tRTfwO4nluCJXLlHAjKlCG9C4xJfS2HJ
         nDvw==
X-Gm-Message-State: AOJu0YzyCSpsnEFdEWm8dJ8LMgKSfCqNeBLcybd3rt8LSHFymAny+c9C
	9zHG6K+AU+xRkqnbzRVnKzXjyXAztWOtODRi8Kiw8LS+zwYLi/9O6WapcdhgeQ==
X-Google-Smtp-Source: AGHT+IGgjFLQstj05pJ7r+3mPVx3HlePyDeUNg+hQQiKQXuBVzNn0t3O2ayROtkvB19LSjnGhAgTng==
X-Received: by 2002:a05:6512:2804:b0:52e:fc01:ddfa with SMTP id 2adb3069b0e04-530bb387c7cmr11515116e87.7.1723016075340;
        Wed, 07 Aug 2024 00:34:35 -0700 (PDT)
Message-ID: <d4ea2213-4c12-40d2-ba12-64f2e7e492c6@suse.com>
Date: Wed, 7 Aug 2024 09:34:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: don't call ->read_segment() with x86_seg_none
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <81ae365f-98b4-4bb6-bbb6-c5423dfda038@suse.com>
 <alpine.DEB.2.22.394.2408061117080.4954@ubuntu-linux-20-04-desktop>
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: <alpine.DEB.2.22.394.2408061117080.4954@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 06.08.2024 20:24, Stefano Stabellini wrote:
> On Mon, 5 Aug 2024, Jan Beulich wrote:
>> LAR, LSL, VERR, and VERW emulation involve calling protmode_load_seg()
>> with x86_seg_none. The fuzzer's read_segment() hook function has an
>> assertion which triggers in this case. Calling the hook function,
>> however, makes little sense for those insns, as there's no data to
>> retrieve. Instead zero-filling the output structure is what properly
>> corresponds to those insns being invoked with a NUL selector.
>>
>> Fixes: 06a3b8cd7ad2 ("x86emul: support LAR/LSL/VERR/VERW")
>> Oss-fuzz: 70918
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Looking at oss-fuzz's report and at this patch I think it is correct
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>

S-o-b?

> That said, there are a few other places where read_segment is called
> without any checks for seg being x86_seg_none. The hvm implementation of
> read_segment (hvmemul_read_segment) seems to return error if
> x86_seg_none is passed as an argument, but there is no return error
> checks any time we call ops->read_segment in x86_emulate.c.

There is a pretty limited number of cases where x86_seg_none is used.
For example, state->ea.mem.seg cannot hold this value.
realmode_load_seg() also cannot be passed this value. We could add
assertions to that effect, yet that can get unwieldy as further
x86_seg_* enumerators are added (see "x86: introduce x86_seg_sys"; I
expect we'll need at least one more when adding VMX/SVM insn emulation,
where physical addresses are used as insn operands).

> It seems that there might still be an issue?

In my auditing I didn't spot any.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 07:37:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 07:37:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773239.1183682 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbbEI-0002Uu-1s; Wed, 07 Aug 2024 07:37:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773239.1183682; Wed, 07 Aug 2024 07:37:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbbEH-0002Un-U1; Wed, 07 Aug 2024 07:37:05 +0000
Received: by outflank-mailman (input) for mailman id 773239;
 Wed, 07 Aug 2024 07:37:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=628V=PG=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbbEH-0002Uh-AV
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 07:37:05 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d76ddf76-548f-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 09:37:04 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-5b9d48d1456so548207a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 00:37:04 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bba48b7310sm393957a12.92.2024.08.07.00.37.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 07 Aug 2024 00:37:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d76ddf76-548f-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723016224; x=1723621024; 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=4yC/bY4Xzf1y8u5hpA43JNh/VEMcup47Z7FEtIC+Tqc=;
        b=FJu+wsGGThRvg1EyzAWUHbGnLo8I+8Q8gTMZNq9Ng/WU7xrrkekurTE8Gp61ILB9He
         34Bhr8UNeGfB8xfmi0OYFB5QuVpGZm/34SNr2hLKV0RRrVmeMi5LZHUO4Eib+lsI1vuz
         4kCcZTNmBY9Gkvq0TQ7734OG/c2EHIHc0E499sAgZA8ZZufqHwKapu/eeXEv9aD8qkXm
         LOlY1DWArphrryktUuldKJUWitJVRYE3ubyoyKu5kVG/+zTKUnChoz2QXEbsjU9vDvNw
         V/YmLVwJ6K2dRwJM81JoEWbxXfzk9fF3Uvfx9IWYB6XOWYEXlvLLrp0F78SZrnCxw9/u
         ixhQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723016224; x=1723621024;
        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=4yC/bY4Xzf1y8u5hpA43JNh/VEMcup47Z7FEtIC+Tqc=;
        b=Ou0QpJenuIOaFjiYSf4LGA/9OITdQInbHzzZ5h85iggIbGU6YMIQKy8OINydOca3Ii
         r2BCeFhni0JFo7wx5dyKw/stNXMycbHWvhWR+7A5yvkQOOWVtlvheoj2a9Zeh4ZRvd3E
         V2PUplbdm4J10D4gN5SJFAUPaJa/80X/XH67IC8ZKaLweWYt6JcfiLR8evoedCuhp8wz
         4gyict6gOPkTzKTb7FDkU30tJqNnYznL2Frl4lnq64Wzdt3+gj2t1PDpATi5IdxszXQs
         Q8ssatI5jW+7vgE0kSe8t/ml+yTO8rx1/4R255h+0C3oTTTGH9OWoOgnPkioH38SVmN1
         z75Q==
X-Gm-Message-State: AOJu0Yyw657SfZgLh17w0IhR8Bwy2sSeDtNKNq9PD/Z/+OPgRHkf+qgG
	MD8wxRkn6nw9H0NXQER8bnLE7SPJsCdRIxpK822PMym23hqqXFsKrhDTfTSAWQ==
X-Google-Smtp-Source: AGHT+IHA9bxnSQegEa6tpkad+YyBBWmU0uBNI70FsIQnWk4uO00SdLJyJp9saUQqyvMihBsDXPcCIg==
X-Received: by 2002:aa7:d644:0:b0:5b8:4a95:2fe7 with SMTP id 4fb4d7f45d1cf-5bba367771emr999398a12.1.1723016223677;
        Wed, 07 Aug 2024 00:37:03 -0700 (PDT)
Message-ID: <e7908da9-69e0-4be2-8c6f-c339f75c290d@suse.com>
Date: Wed, 7 Aug 2024 09:37:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: ACPI NVS range conflicting with Dom0 page tables (or kernel
 image)
To: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
References: <a5a8a016-2107-46fb-896b-2baaf66566d4@suse.com>
 <ZnBCFgHltVqj2FDh@mail-itl> <6a7508dd-9f81-4fce-9c83-8b4fae924d48@suse.com>
 <ZrI_YSBSiC7w5iP6@mail-itl> <1dc37ba4-c0ef-4be7-9699-31cf839c6deb@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: <1dc37ba4-c0ef-4be7-9699-31cf839c6deb@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 06.08.2024 17:24, Jürgen Groß wrote:
> On 06.08.24 17:21, Marek Marczykowski-Górecki wrote:
>> On Tue, Aug 06, 2024 at 04:12:32PM +0200, Jürgen Groß wrote:
>>> If possible it would be nice to verify suspend to disk still working, as
>>> the kernel will need to access the ACPI NVS area in this case.
>>
>> That might be harder, as Qubes OS doesn't support suspend to disk, but
>> I'll see if something can be done.
> 
> Thinking about it - can this ever work with Xen?

Not with today's Xen, I don't think. Hence why S4 is filtered out
somewhere. It'll take (perhaps a lot of) extra interaction between
Dom0 and Xen for this to work.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 09:59:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 09:59:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773259.1183698 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdS6-0006uV-QB; Wed, 07 Aug 2024 09:59:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773259.1183698; Wed, 07 Aug 2024 09:59:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdS6-0006uO-Lw; Wed, 07 Aug 2024 09:59:30 +0000
Received: by outflank-mailman (input) for mailman id 773259;
 Wed, 07 Aug 2024 09:59:29 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbdS5-0006uC-2B; Wed, 07 Aug 2024 09:59:29 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbdS4-0008Uo-GV; Wed, 07 Aug 2024 09:59:28 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbdS4-0003R6-4C; Wed, 07 Aug 2024 09:59:28 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbdS4-0006lW-3a; Wed, 07 Aug 2024 09:59:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=7gAKYxnZHK2+MXK62VOe/64JXycZIkBfvP+WvKl2JRs=; b=jVrk3KIkynihGL5/E4kANUV0B2
	qOJnssgMJTlOW0Xm8avgYDgl9o35f66Y5ETiXXF8yo8E4Ra062xASnMPsruY7Gf2zsRH1XQ9EQYGg
	1Xx3zH5kr6g07A05ZmRCAplzDkm1GJVni239VIvT1doOOyJagHmh60L2bDvSKivqLgZM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187176-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187176: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=d4560686726f7a357922f300fc81f5964be8df04
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 07 Aug 2024 09:59:28 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827

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

version targeted for testing:
 linux                d4560686726f7a357922f300fc81f5964be8df04
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   21 days
Failing since        186925  2024-07-20 09:44:52 Z   18 days   37 attempts
Testing same since   187176  2024-08-07 00:41:55 Z    0 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 10:23:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 10:23:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773271.1183707 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdp9-0002l3-IH; Wed, 07 Aug 2024 10:23:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773271.1183707; Wed, 07 Aug 2024 10:23:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdp9-0002kw-Fc; Wed, 07 Aug 2024 10:23:19 +0000
Received: by outflank-mailman (input) for mailman id 773271;
 Wed, 07 Aug 2024 10:23:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=QSOH=PG=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1sbdp7-0002kq-FS
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 10:23:17 +0000
Received: from fout6-smtp.messagingengine.com (fout6-smtp.messagingengine.com
 [103.168.172.149]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0df80900-54a7-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 12:23:15 +0200 (CEST)
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43])
 by mailfout.nyi.internal (Postfix) with ESMTP id C54FE138FCA0;
 Wed,  7 Aug 2024 06:23:13 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute3.internal (MEProxy); Wed, 07 Aug 2024 06:23:13 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed,
 7 Aug 2024 06:23:12 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0df80900-54a7-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:subject:subject:to:to; s=fm3; t=1723026193;
	 x=1723112593; bh=80J6FeQYU8px2uFNfNGWbopbgbf7TT2mOrZHsdYDB7k=; b=
	XNTPs+vAcQ4LB8gFumm4T3FrFOmWMIsGk5zJs3sLhqiAArOiXJUq2ghUjBiO27AQ
	/xd56YZYeu1NyeugR9PBHb2zMnKRX7iJrWcZTEklEOYaxHNxK86/4hnzRFfM42dM
	kl54/Mnc8gUHmu+wmWblVARykUozRIyAXSHmmf9LrUynkDKIr6KFp1kxBiMn1CC2
	+9WmEV2Ychjtm+K50DX7we8q5szJOyucqSNwYwRiLjS5Eux3RVwTIrcccVmA/3Y7
	GEHqYb+Cy/nFp/VkpnvqU9zYe+p88u84TuDq7o2fJ7DcSLXp0dI/wwpZeflvx9/Z
	/K7aGckF/Kebm4OgYQNppg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:subject:subject:to
	:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
	fm3; t=1723026193; x=1723112593; bh=80J6FeQYU8px2uFNfNGWbopbgbf7
	TT2mOrZHsdYDB7k=; b=Bm7kKK97UljXv5nV8EuczXBu5S9n0uSnGUpZRKZI9uGE
	GjJhfsia6Lvch3vOiZb8oM5oLHoJ2UlPQP+neCBwuOtvqom/D3yLcoJBSRyEKWwJ
	w02XY0EdkLt/7tmSpjoOX7i78DNR712/H9yXX9kX3/pZVRyGJdLaKZMzQnt5SJKo
	TdPjPvaTaenwtoR6K3sV3qjlfMKxfuypnlA2IiRbO8kYFJ/X+KOesWyltLa9Z0uh
	ktTcsFL2vSia6CxQxhnOliWao3Q7e2mrYhFp4/QBqO3LLapgxmyhmoz6LVZJ840R
	Tef8xntddqlEjP7GPjSi0JoO6KLh2HXL56RBSEgHlQ==
X-ME-Sender: <xms:EUuzZtZI4NoVn7QP7-Z7GxsXtcMY70t_4uMYJa2Wb8GU-ApPeNbtUw>
    <xme:EUuzZkZjLbT2igo5yeQx_38EXrJas0gXg-kvnKv2P1Til0yP7Orz5Mh0rqTzr_nop
    iIqqEMtZ9ixtw>
X-ME-Received: <xmr:EUuzZv-AbK4Izuw-KUp3W8_ncSHiRcInDbCep5bXy_4zRSZHYHsGGX5KYPzl2qloX5KmVNwqg6GWGGfU9YhOJ3N9GwgpON_CQg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrledtgddvjecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghk
    ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh
    hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeetueeg
    fefhffdvffetleeltdelkedvlefhkeehgfehhffhheehudeitdegheejleenucffohhmrg
    hinhepkhgvrhhnvghlrdhorhhgpdhgihhthhhusgdrtghomhenucevlhhushhtvghrufhi
    iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhesihhnvhhish
    hisghlvghthhhinhhgshhlrggsrdgtohhmpdhnsggprhgtphhtthhopedt
X-ME-Proxy: <xmx:EUuzZrpyDxJoGwxYGI3iynBQmqSZzNNtwgVCc86rEDgKI9ca5mZjuA>
    <xmx:EUuzZoq5Yt21W_zh_rsXbQYAQVDDtUanX6Fg2952kBfeNX2gW01bfQ>
    <xmx:EUuzZhSY2S0kjJ_2yAKau_tOcusWPAzzFPCGsrv5leLUq_WyoR5eCg>
    <xmx:EUuzZgpKVQH-9swHA8MlS_sEO95lh1NVd1SnKi4C-LBmELc6SXzVSQ>
    <xmx:EUuzZv2tsx5lNxgwvqRGET5IQB845l1TnC7X1wtzyLLVeqaG0ewRomBT>
Feedback-ID: i1568416f:Fastmail
Date: Wed, 7 Aug 2024 12:23:10 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: =?utf-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: ACPI NVS range conflicting with Dom0 page tables (or kernel
 image)
Message-ID: <ZrNLDmRC_5DC_1K3@mail-itl>
References: <a5a8a016-2107-46fb-896b-2baaf66566d4@suse.com>
 <ZnBCFgHltVqj2FDh@mail-itl>
 <6a7508dd-9f81-4fce-9c83-8b4fae924d48@suse.com>
 <ZrI_YSBSiC7w5iP6@mail-itl>
 <1dc37ba4-c0ef-4be7-9699-31cf839c6deb@suse.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="uerYtl9e1WjgzsRn"
Content-Disposition: inline
In-Reply-To: <1dc37ba4-c0ef-4be7-9699-31cf839c6deb@suse.com>


--uerYtl9e1WjgzsRn
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Wed, 7 Aug 2024 12:23:10 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: =?utf-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: ACPI NVS range conflicting with Dom0 page tables (or kernel
 image)

On Tue, Aug 06, 2024 at 05:24:22PM +0200, J=C3=BCrgen Gro=C3=9F wrote:
> On 06.08.24 17:21, Marek Marczykowski-G=C3=B3recki wrote:
> > On Tue, Aug 06, 2024 at 04:12:32PM +0200, J=C3=BCrgen Gro=C3=9F wrote:
> > > Marek,
> > >=20
> > > On 17.06.24 16:03, Marek Marczykowski-G=C3=B3recki wrote:
> > > > On Mon, Jun 17, 2024 at 01:22:37PM +0200, Jan Beulich wrote:
> > > > > Hello,
> > > > >=20
> > > > > while it feels like we had a similar situation before, I can't se=
em to be
> > > > > able to find traces thereof, or associated (Linux) commits.
> > > >=20
> > > > Is it some AMD Threadripper system by a chance? Previous thread on =
this
> > > > issue:
> > > > https://lore.kernel.org/xen-devel/CAOCpoWdOH=3DxGxiQSC1c5Ueb1THxAjH=
4WiZbCZq-QT+d_KAk3SA@mail.gmail.com/
> > > >=20
> > > > > With
> > > > >=20
> > > > > (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4000000
> > > > > ...
> > > > > (XEN)  Dom0 alloc.:   0000000440000000->0000000448000000 (619175 =
pages to be allocated)
> > > > > ...
> > > > > (XEN)  Loaded kernel: ffffffff81000000->ffffffff84000000
> > > > >=20
> > > > > the kernel occupies the space from 16Mb to 64Mb in the initial al=
location.
> > > > > Page tables come (almost) directly above:
> > > > >=20
> > > > > (XEN)  Page tables:   ffffffff84001000->ffffffff84026000
> > > > >=20
> > > > > I.e. they're just above the 64Mb boundary. Yet sadly in the host =
E820 map
> > > > > there is
> > > > >=20
> > > > > (XEN)  [0000000004000000, 0000000004009fff] (ACPI NVS)
> > > > >=20
> > > > > i.e. a non-RAM range starting at 64Mb. The kernel (currently) won=
't tolerate
> > > > > such an overlap (also if it was overlapping the kernel image, e.g=
=2E if on the
> > > > > machine in question s sufficiently much larger kernel was used). =
Yet with its
> > > > > fundamental goal of making its E820 match the host one I'm also i=
n trouble
> > > > > thinking of possible solutions / workarounds. I certainly do not =
see Xen
> > > > > trying to cover for this, as the E820 map re-arrangement is purel=
y a kernel
> > > > > side decision (forward ported kernels got away without, and what =
e.g. the
> > > > > BSDs do is entirely unknown to me).
> > > >=20
> > > > In Qubes we have worked around the issue by moving the kernel lower
> > > > (CONFIG_PHYSICAL_START=3D0x200000):
> > > > https://github.com/QubesOS/qubes-linux-kernel/commit/3e8be4ac168237=
0977d4d0dc1d782c428d860282
> > > >=20
> > > > Far from ideal, but gets it bootable...
> > > >=20
> > >=20
> > > could you test the attached kernel patches? They should fix the issue=
 without
> > > having to modify CONFIG_PHYSICAL_START.
> > >=20
> > > I have tested them to boot up without problem on my test system, but =
I don't
> > > have access to a system showing the E820 map conflict you are seeing.
> > >=20
> > > The patches have been developed against kernel 6.11-rc2, but I think =
they
> > > should apply to a 6.10 and maybe even an older kernel.
> >=20
> > Sure, but tomorrow-ish.
>=20
> Thanks.

Seems to work :)

Snippets from Xen log:

    (XEN) EFI RAM map:
    (XEN)  [0000000000000000, 000000000009ffff] (usable)
    (XEN)  [00000000000a0000, 00000000000fffff] (reserved)
    (XEN)  [0000000000100000, 0000000003ffffff] (usable)
    (XEN)  [0000000004000000, 0000000004011fff] (ACPI NVS)
    (XEN)  [0000000004012000, 0000000009df1fff] (usable)
    (XEN)  [0000000009df2000, 0000000009ffffff] (reserved)
    (XEN)  [000000000a000000, 00000000a8840fff] (usable)
    (XEN)  [00000000a8841000, 00000000a9d9ffff] (reserved)
    (XEN)  [00000000a9da0000, 00000000a9dd4fff] (ACPI data)
    (XEN)  [00000000a9dd5000, 00000000a9dd5fff] (reserved)
    (XEN)  [00000000a9dd6000, 00000000a9f20fff] (ACPI data)
    (XEN)  [00000000a9f21000, 00000000aa099fff] (ACPI NVS)
    (XEN)  [00000000aa09a000, 00000000ab1fefff] (reserved)
    (XEN)  [00000000ab1ff000, 00000000abffffff] (usable)
    (XEN)  [00000000ac000000, 00000000afffffff] (reserved)
    (XEN)  [00000000b2500000, 00000000b2580fff] (reserved)
    (XEN)  [00000000b3580000, 00000000b3600fff] (reserved)
    (XEN)  [00000000e2100000, 00000000e2280fff] (reserved)
    (XEN)  [00000000fa180000, 00000000fa200fff] (reserved)
    (XEN)  [00000000fa300000, 00000000fa3fffff] (reserved)
    (XEN)  [00000000fea00000, 00000000feafffff] (reserved)
    (XEN)  [00000000fec00000, 00000000fec00fff] (reserved)
    (XEN)  [00000000fec10000, 00000000fec10fff] (reserved)
    (XEN)  [00000000fed00000, 00000000fed00fff] (reserved)
    (XEN)  [00000000fed40000, 00000000fed44fff] (reserved)
    (XEN)  [00000000fed80000, 00000000fed8ffff] (reserved)
    (XEN)  [00000000fedc2000, 00000000fedcffff] (reserved)
    (XEN)  [00000000fedd4000, 00000000fedd5fff] (reserved)
    (XEN)  [00000000fee00000, 00000000feefffff] (reserved)
    (XEN)  [00000000ff000000, 00000000ffffffff] (reserved)
    (XEN)  [0000000100000000, 000000104f1fffff] (usable)
    (XEN)  [000000104f200000, 000000104fffffff] (reserved)
    (XEN)  [0000010000000000, 00000100103fffff] (reserved)
    (XEN)  [0000018030000000, 00000180403fffff] (reserved)
    (XEN)  [0000018060000000, 00000180703fffff] (reserved)
    (XEN)  [0000020090000000, 00000200a03fffff] (reserved)
    ...
    (XEN) Dom0 has maximum 1400 PIRQs
    (XEN)  Xen  kernel: 64-bit, lsb
    (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4800000
    (XEN) PHYSICAL MEMORY ARRANGEMENT:
    (XEN)  Dom0 alloc.:   0000001010000000->0000001018000000 (1000315 pages=
 to be allocated)
    (XEN)  Init. ramdisk: 000000104b57b000->000000104f1ffe72
    (XEN) VIRTUAL MEMORY ARRANGEMENT:
    (XEN)  Loaded kernel: ffffffff81000000->ffffffff84800000
    (XEN)  Phys-Mach map: 0000008000000000->0000008000800000
    (XEN)  Start info:    ffffffff84800000->ffffffff848004b8
    (XEN)  Page tables:   ffffffff84801000->ffffffff8482a000
    (XEN)  Boot stack:    ffffffff8482a000->ffffffff8482b000
    (XEN)  TOTAL:         ffffffff80000000->ffffffff84c00000
    (XEN)  ENTRY ADDRESS: ffffffff838b7640

So, it would indeed conflict with the ACPI NVS region, but the system
started, and later dom0 reports this region remapped:

    [    0.000000] BIOS-provided physical RAM map:
    [    0.000000] Xen: [mem 0x0000000000000000-0x000000000007ffff] usable
    [    0.000000] Xen: [mem 0x0000000000080000-0x00000000000fffff] reserved
    [    0.000000] Xen: [mem 0x0000000000100000-0x0000000009df1fff] usable
    [    0.000000] Xen: [mem 0x0000000009df2000-0x0000000009ffffff] reserved
    [    0.000000] Xen: [mem 0x000000000a000000-0x00000000a8840fff] usable
    [    0.000000] Xen: [mem 0x00000000a8841000-0x00000000a9d9ffff] reserved
    [    0.000000] Xen: [mem 0x00000000a9da0000-0x00000000a9dd4fff] ACPI da=
ta
    [    0.000000] Xen: [mem 0x00000000a9dd5000-0x00000000a9dd5fff] reserved
    [    0.000000] Xen: [mem 0x00000000a9dd6000-0x00000000a9f20fff] ACPI da=
ta
    [    0.000000] Xen: [mem 0x00000000a9f21000-0x00000000aa099fff] ACPI NVS
    [    0.000000] Xen: [mem 0x00000000aa09a000-0x00000000ab1fefff] reserved
    [    0.000000] Xen: [mem 0x00000000ab1ff000-0x00000000abffffff] usable
    [    0.000000] Xen: [mem 0x00000000ac000000-0x00000000afffffff] reserved
    [    0.000000] Xen: [mem 0x00000000b2500000-0x00000000b2580fff] reserved
    [    0.000000] Xen: [mem 0x00000000b3580000-0x00000000b3600fff] reserved
    [    0.000000] Xen: [mem 0x00000000e2100000-0x00000000e2280fff] reserved
    [    0.000000] Xen: [mem 0x00000000fa180000-0x00000000fa200fff] reserved
    [    0.000000] Xen: [mem 0x00000000fa300000-0x00000000fa3fffff] reserved
    [    0.000000] Xen: [mem 0x00000000fea00000-0x00000000feafffff] reserved
    [    0.000000] Xen: [mem 0x00000000fec00000-0x00000000fec00fff] reserved
    [    0.000000] Xen: [mem 0x00000000fec10000-0x00000000fec10fff] reserved
    [    0.000000] Xen: [mem 0x00000000fed00000-0x00000000fed00fff] reserved
    [    0.000000] Xen: [mem 0x00000000fed40000-0x00000000fed44fff] reserved
    [    0.000000] Xen: [mem 0x00000000fed80000-0x00000000fed8ffff] reserved
    [    0.000000] Xen: [mem 0x00000000fedc2000-0x00000000fedcffff] reserved
    [    0.000000] Xen: [mem 0x00000000fedd4000-0x00000000fedd5fff] reserved
    [    0.000000] Xen: [mem 0x00000000fee00000-0x00000000feefffff] reserved
    [    0.000000] Xen: [mem 0x00000000ff000000-0x00000000ffffffff] reserved
    [    0.000000] Xen: [mem 0x0000000100000000-0x0000000156c4bfff] usable
    [    0.000000] Xen: [mem 0x000000104f1ee000-0x000000104f1fffff] ACPI NVS
    [    0.000000] Xen: [mem 0x000000104f200000-0x000000104fffffff] reserved
    [    0.000000] Xen: [mem 0x0000010000000000-0x00000100103fffff] reserved
    [    0.000000] Xen: [mem 0x0000018030000000-0x00000180403fffff] reserved
    [    0.000000] Xen: [mem 0x0000018060000000-0x00000180703fffff] reserved
    [    0.000000] Xen: [mem 0x0000020090000000-0x00000200a03fffff] reserved

> > > If possible it would be nice to verify suspend to disk still working,=
 as
> > > the kernel will need to access the ACPI NVS area in this case.
> >=20
> > That might be harder, as Qubes OS doesn't support suspend to disk, but
> > I'll see if something can be done.
>=20
> Thinking about it - can this ever work with Xen?

Indeed, this is not going to work.

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

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

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmazSw4ACgkQ24/THMrX
1yyg8Af9GhBq2YLPw3mNXP+C2KTJD5nhqHIS6j+43PnwCq5eECfGytfRSIZBSfpH
QvrBeUCNDn48bwKmI+i00e0vnv58IaMmYXr/+d2xoQFNKaiIKuiqki9TBQIu1xlK
nFQ1SKzCfREe6XQIYHn9i5WIOQrvEP6af4kVeE49bdGuLmGqC7rOgcxdAJW2sdo3
UxMSEex5KNXDbuOYhoCkRfcywep7jaTdEQQvDARmudjxJ42VsVOnQoOcqHVNsi4Y
pL52DKKR8kU0DhlwiUf7Nv+8U6pdK0vw2/Dup6iJhzU0CB1UpnSZfLzD/c45JhdK
WRpOthDYjZoyrLcZe5PTMSZJClq20g==
=MaVz
-----END PGP SIGNATURE-----

--uerYtl9e1WjgzsRn--


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 10:26:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 10:26:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773282.1183717 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdsE-0003l3-2C; Wed, 07 Aug 2024 10:26:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773282.1183717; Wed, 07 Aug 2024 10:26:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdsD-0003kw-Vw; Wed, 07 Aug 2024 10:26:29 +0000
Received: by outflank-mailman (input) for mailman id 773282;
 Wed, 07 Aug 2024 10:26: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=6zTk=PG=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbdsC-0003MI-Lk
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 10:26:28 +0000
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com
 [2a00:1450:4864:20::529])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8141d2b7-54a7-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 12:26:27 +0200 (CEST)
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5a108354819so2153948a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 03:26:27 -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-a7dc9c0b8dasm624162266b.83.2024.08.07.03.26.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 07 Aug 2024 03:26:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8141d2b7-54a7-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723026387; x=1723631187; 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=y+yWkpUGbn5rI64AYdVaoeb2qv2IE7IG5GMZ/XTUW3k=;
        b=VJtN49MNG+63nukO45Y81oOKxNx3sIsZntyxgwVx5XFG9GWm+XVQiE2fARzuMJUSks
         t0X6IfKG+/IZIYLKjjFSvRocs50xdG27dCCdTnoRD4IsfmXMjUB7DuOGu69mQO8NzT9E
         5WhepqvyUQNtE/vao6b3rKXzAWWIesQcOVI+0eS4H/erPHwKVh+erhSGoVa7IugYL+ex
         M6kJg8O7oFPSXGu7hfomxwXpV9LsXIwfmR4y/qqmI9i5xBrgExwzo+7/xiPS8SEim3TM
         L4+oGsA7rPkVIz+kMqramcn3pAqAnZe/AzNQfjfmCqNlWLRh6UwcfD+jwTfoOfvocSGW
         p5og==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723026387; x=1723631187;
        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=y+yWkpUGbn5rI64AYdVaoeb2qv2IE7IG5GMZ/XTUW3k=;
        b=ny+FcNWOkGwWGZ8NxET+KXB7RH6u/qXGS1r22Wxd7JsjjwRKuXp0TOmRq8PHY+uyZp
         DzdBbNiinn90LhkGPP4ipezm8R2u6B5zoweh2Nj5LthSR4dhw7DXNfTHf3a/wDP6Kflo
         J1LTV9GSjVnGSl4TOlgexGlteoeohzqCnvlsAmWNs2PHlKtXrgi7mWI15kktJbxFAPy/
         Jk/koHPigncsp5mgsbYyq/fjUHQ/by8MtYNDQJYT4kGgxwbnq/GPSa7KjvX8/R5Vx6zg
         omUs7O42u7NiVgEvq8fBUKb+8ffpwIDGWcWRas/qqRqoNSQX3+Sz5B7fllsgSyd5J5Nq
         R9dQ==
X-Forwarded-Encrypted: i=1; AJvYcCVL90D2BD5ICrfi4YNdbyeiZneG1tQmYagTUsshap/SRyiN4M5N1YZA89eFftrWECFnwL5SQuXSeSkEXBBaTh1q5wpbCWy6arP41hylKCM=
X-Gm-Message-State: AOJu0YzreeL4YIhLlWzjhPktgSg2v1mIrJFYlZ6PMHVe8/vnUuSi1RlL
	byVt749gNWgA6fxQzniEfq1beUTaohvz++wfQXZGadgr7+/k6Ho+y4AhPOYMEYk=
X-Google-Smtp-Source: AGHT+IGMq/EWEpoUXL5nXdqEBBXqLYJ72GtWWY89H2AwugTgFUvaX31KAHfjOpZUqY64Vwcc+HcDkA==
X-Received: by 2002:a17:907:d92:b0:a77:dcda:1fe1 with SMTP id a640c23a62f3a-a7dc4fb01ddmr1391606166b.25.1723026387024;
        Wed, 07 Aug 2024 03:26:27 -0700 (PDT)
Message-ID: <73dd2dea-d3bc-490e-b5a4-3d426cf5660b@suse.com>
Date: Wed, 7 Aug 2024 12:26:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: ACPI NVS range conflicting with Dom0 page tables (or kernel
 image)
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>
Cc: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <a5a8a016-2107-46fb-896b-2baaf66566d4@suse.com>
 <ZnBCFgHltVqj2FDh@mail-itl> <6a7508dd-9f81-4fce-9c83-8b4fae924d48@suse.com>
 <ZrI_YSBSiC7w5iP6@mail-itl> <1dc37ba4-c0ef-4be7-9699-31cf839c6deb@suse.com>
 <ZrNLDmRC_5DC_1K3@mail-itl>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <ZrNLDmRC_5DC_1K3@mail-itl>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 07.08.24 12:23, Marek Marczykowski-Górecki wrote:
> On Tue, Aug 06, 2024 at 05:24:22PM +0200, Jürgen Groß wrote:
>> On 06.08.24 17:21, Marek Marczykowski-Górecki wrote:
>>> On Tue, Aug 06, 2024 at 04:12:32PM +0200, Jürgen Groß wrote:
>>>> Marek,
>>>>
>>>> On 17.06.24 16:03, Marek Marczykowski-Górecki wrote:
>>>>> On Mon, Jun 17, 2024 at 01:22:37PM +0200, Jan Beulich wrote:
>>>>>> Hello,
>>>>>>
>>>>>> while it feels like we had a similar situation before, I can't seem to be
>>>>>> able to find traces thereof, or associated (Linux) commits.
>>>>>
>>>>> Is it some AMD Threadripper system by a chance? Previous thread on this
>>>>> issue:
>>>>> https://lore.kernel.org/xen-devel/CAOCpoWdOH=xGxiQSC1c5Ueb1THxAjH4WiZbCZq-QT+d_KAk3SA@mail.gmail.com/
>>>>>
>>>>>> With
>>>>>>
>>>>>> (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4000000
>>>>>> ...
>>>>>> (XEN)  Dom0 alloc.:   0000000440000000->0000000448000000 (619175 pages to be allocated)
>>>>>> ...
>>>>>> (XEN)  Loaded kernel: ffffffff81000000->ffffffff84000000
>>>>>>
>>>>>> the kernel occupies the space from 16Mb to 64Mb in the initial allocation.
>>>>>> Page tables come (almost) directly above:
>>>>>>
>>>>>> (XEN)  Page tables:   ffffffff84001000->ffffffff84026000
>>>>>>
>>>>>> I.e. they're just above the 64Mb boundary. Yet sadly in the host E820 map
>>>>>> there is
>>>>>>
>>>>>> (XEN)  [0000000004000000, 0000000004009fff] (ACPI NVS)
>>>>>>
>>>>>> i.e. a non-RAM range starting at 64Mb. The kernel (currently) won't tolerate
>>>>>> such an overlap (also if it was overlapping the kernel image, e.g. if on the
>>>>>> machine in question s sufficiently much larger kernel was used). Yet with its
>>>>>> fundamental goal of making its E820 match the host one I'm also in trouble
>>>>>> thinking of possible solutions / workarounds. I certainly do not see Xen
>>>>>> trying to cover for this, as the E820 map re-arrangement is purely a kernel
>>>>>> side decision (forward ported kernels got away without, and what e.g. the
>>>>>> BSDs do is entirely unknown to me).
>>>>>
>>>>> In Qubes we have worked around the issue by moving the kernel lower
>>>>> (CONFIG_PHYSICAL_START=0x200000):
>>>>> https://github.com/QubesOS/qubes-linux-kernel/commit/3e8be4ac1682370977d4d0dc1d782c428d860282
>>>>>
>>>>> Far from ideal, but gets it bootable...
>>>>>
>>>>
>>>> could you test the attached kernel patches? They should fix the issue without
>>>> having to modify CONFIG_PHYSICAL_START.
>>>>
>>>> I have tested them to boot up without problem on my test system, but I don't
>>>> have access to a system showing the E820 map conflict you are seeing.
>>>>
>>>> The patches have been developed against kernel 6.11-rc2, but I think they
>>>> should apply to a 6.10 and maybe even an older kernel.
>>>
>>> Sure, but tomorrow-ish.
>>
>> Thanks.
> 
> Seems to work :)
> 
> Snippets from Xen log:
> 
>      (XEN) EFI RAM map:
>      (XEN)  [0000000000000000, 000000000009ffff] (usable)
>      (XEN)  [00000000000a0000, 00000000000fffff] (reserved)
>      (XEN)  [0000000000100000, 0000000003ffffff] (usable)
>      (XEN)  [0000000004000000, 0000000004011fff] (ACPI NVS)
>      (XEN)  [0000000004012000, 0000000009df1fff] (usable)
>      (XEN)  [0000000009df2000, 0000000009ffffff] (reserved)
>      (XEN)  [000000000a000000, 00000000a8840fff] (usable)
>      (XEN)  [00000000a8841000, 00000000a9d9ffff] (reserved)
>      (XEN)  [00000000a9da0000, 00000000a9dd4fff] (ACPI data)
>      (XEN)  [00000000a9dd5000, 00000000a9dd5fff] (reserved)
>      (XEN)  [00000000a9dd6000, 00000000a9f20fff] (ACPI data)
>      (XEN)  [00000000a9f21000, 00000000aa099fff] (ACPI NVS)
>      (XEN)  [00000000aa09a000, 00000000ab1fefff] (reserved)
>      (XEN)  [00000000ab1ff000, 00000000abffffff] (usable)
>      (XEN)  [00000000ac000000, 00000000afffffff] (reserved)
>      (XEN)  [00000000b2500000, 00000000b2580fff] (reserved)
>      (XEN)  [00000000b3580000, 00000000b3600fff] (reserved)
>      (XEN)  [00000000e2100000, 00000000e2280fff] (reserved)
>      (XEN)  [00000000fa180000, 00000000fa200fff] (reserved)
>      (XEN)  [00000000fa300000, 00000000fa3fffff] (reserved)
>      (XEN)  [00000000fea00000, 00000000feafffff] (reserved)
>      (XEN)  [00000000fec00000, 00000000fec00fff] (reserved)
>      (XEN)  [00000000fec10000, 00000000fec10fff] (reserved)
>      (XEN)  [00000000fed00000, 00000000fed00fff] (reserved)
>      (XEN)  [00000000fed40000, 00000000fed44fff] (reserved)
>      (XEN)  [00000000fed80000, 00000000fed8ffff] (reserved)
>      (XEN)  [00000000fedc2000, 00000000fedcffff] (reserved)
>      (XEN)  [00000000fedd4000, 00000000fedd5fff] (reserved)
>      (XEN)  [00000000fee00000, 00000000feefffff] (reserved)
>      (XEN)  [00000000ff000000, 00000000ffffffff] (reserved)
>      (XEN)  [0000000100000000, 000000104f1fffff] (usable)
>      (XEN)  [000000104f200000, 000000104fffffff] (reserved)
>      (XEN)  [0000010000000000, 00000100103fffff] (reserved)
>      (XEN)  [0000018030000000, 00000180403fffff] (reserved)
>      (XEN)  [0000018060000000, 00000180703fffff] (reserved)
>      (XEN)  [0000020090000000, 00000200a03fffff] (reserved)
>      ...
>      (XEN) Dom0 has maximum 1400 PIRQs
>      (XEN)  Xen  kernel: 64-bit, lsb
>      (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4800000
>      (XEN) PHYSICAL MEMORY ARRANGEMENT:
>      (XEN)  Dom0 alloc.:   0000001010000000->0000001018000000 (1000315 pages to be allocated)
>      (XEN)  Init. ramdisk: 000000104b57b000->000000104f1ffe72
>      (XEN) VIRTUAL MEMORY ARRANGEMENT:
>      (XEN)  Loaded kernel: ffffffff81000000->ffffffff84800000
>      (XEN)  Phys-Mach map: 0000008000000000->0000008000800000
>      (XEN)  Start info:    ffffffff84800000->ffffffff848004b8
>      (XEN)  Page tables:   ffffffff84801000->ffffffff8482a000
>      (XEN)  Boot stack:    ffffffff8482a000->ffffffff8482b000
>      (XEN)  TOTAL:         ffffffff80000000->ffffffff84c00000
>      (XEN)  ENTRY ADDRESS: ffffffff838b7640
> 
> So, it would indeed conflict with the ACPI NVS region, but the system
> started, and later dom0 reports this region remapped:
> 
>      [    0.000000] BIOS-provided physical RAM map:
>      [    0.000000] Xen: [mem 0x0000000000000000-0x000000000007ffff] usable
>      [    0.000000] Xen: [mem 0x0000000000080000-0x00000000000fffff] reserved
>      [    0.000000] Xen: [mem 0x0000000000100000-0x0000000009df1fff] usable
>      [    0.000000] Xen: [mem 0x0000000009df2000-0x0000000009ffffff] reserved
>      [    0.000000] Xen: [mem 0x000000000a000000-0x00000000a8840fff] usable
>      [    0.000000] Xen: [mem 0x00000000a8841000-0x00000000a9d9ffff] reserved
>      [    0.000000] Xen: [mem 0x00000000a9da0000-0x00000000a9dd4fff] ACPI data
>      [    0.000000] Xen: [mem 0x00000000a9dd5000-0x00000000a9dd5fff] reserved
>      [    0.000000] Xen: [mem 0x00000000a9dd6000-0x00000000a9f20fff] ACPI data
>      [    0.000000] Xen: [mem 0x00000000a9f21000-0x00000000aa099fff] ACPI NVS
>      [    0.000000] Xen: [mem 0x00000000aa09a000-0x00000000ab1fefff] reserved
>      [    0.000000] Xen: [mem 0x00000000ab1ff000-0x00000000abffffff] usable
>      [    0.000000] Xen: [mem 0x00000000ac000000-0x00000000afffffff] reserved
>      [    0.000000] Xen: [mem 0x00000000b2500000-0x00000000b2580fff] reserved
>      [    0.000000] Xen: [mem 0x00000000b3580000-0x00000000b3600fff] reserved
>      [    0.000000] Xen: [mem 0x00000000e2100000-0x00000000e2280fff] reserved
>      [    0.000000] Xen: [mem 0x00000000fa180000-0x00000000fa200fff] reserved
>      [    0.000000] Xen: [mem 0x00000000fa300000-0x00000000fa3fffff] reserved
>      [    0.000000] Xen: [mem 0x00000000fea00000-0x00000000feafffff] reserved
>      [    0.000000] Xen: [mem 0x00000000fec00000-0x00000000fec00fff] reserved
>      [    0.000000] Xen: [mem 0x00000000fec10000-0x00000000fec10fff] reserved
>      [    0.000000] Xen: [mem 0x00000000fed00000-0x00000000fed00fff] reserved
>      [    0.000000] Xen: [mem 0x00000000fed40000-0x00000000fed44fff] reserved
>      [    0.000000] Xen: [mem 0x00000000fed80000-0x00000000fed8ffff] reserved
>      [    0.000000] Xen: [mem 0x00000000fedc2000-0x00000000fedcffff] reserved
>      [    0.000000] Xen: [mem 0x00000000fedd4000-0x00000000fedd5fff] reserved
>      [    0.000000] Xen: [mem 0x00000000fee00000-0x00000000feefffff] reserved
>      [    0.000000] Xen: [mem 0x00000000ff000000-0x00000000ffffffff] reserved
>      [    0.000000] Xen: [mem 0x0000000100000000-0x0000000156c4bfff] usable
>      [    0.000000] Xen: [mem 0x000000104f1ee000-0x000000104f1fffff] ACPI NVS
>      [    0.000000] Xen: [mem 0x000000104f200000-0x000000104fffffff] reserved
>      [    0.000000] Xen: [mem 0x0000010000000000-0x00000100103fffff] reserved
>      [    0.000000] Xen: [mem 0x0000018030000000-0x00000180403fffff] reserved
>      [    0.000000] Xen: [mem 0x0000018060000000-0x00000180703fffff] reserved
>      [    0.000000] Xen: [mem 0x0000020090000000-0x00000200a03fffff] reserved

Thanks for the testing!

Are you fine with me adding your "Tested-by:"?


Juergen


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 10:29:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 10:29:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773290.1183727 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdvC-0004Ke-Fo; Wed, 07 Aug 2024 10:29:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773290.1183727; Wed, 07 Aug 2024 10:29:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdvC-0004KX-D4; Wed, 07 Aug 2024 10:29:34 +0000
Received: by outflank-mailman (input) for mailman id 773290;
 Wed, 07 Aug 2024 10:29:33 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=QSOH=PG=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1sbdvB-0004KR-DS
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 10:29:33 +0000
Received: from fout6-smtp.messagingengine.com (fout6-smtp.messagingengine.com
 [103.168.172.149]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eaf11689-54a7-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 12:29:25 +0200 (CEST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailfout.nyi.internal (Postfix) with ESMTP id AE886138FCB7;
 Wed,  7 Aug 2024 06:29:29 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute1.internal (MEProxy); Wed, 07 Aug 2024 06:29:29 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed,
 7 Aug 2024 06:29:28 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eaf11689-54a7-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:subject:subject:to:to; s=fm3; t=1723026569;
	 x=1723112969; bh=cTdfBIzfd5Ast37IVVf9UsEEPljcZyHaeZvmiHWtIE4=; b=
	OzyWNo0mr8O+BpG6I8Bev3Ew75a1uLGeVGMYn+TCt/CvrAN1HXkOx11OWVM3l3aG
	eujCLB/GRrIwr4p+tnfChrtWnrQW9H2WWQ+MWFvVEIXmilY6zsn1fTy8PbDB7IoU
	J1kpvDPiyrYJb3TUHO0rcAt2si5imXSUg6/XzXDz2Yf7RY1KrK1MXfMQGAnoAzG9
	0zDW4bu4nH9g1EP1hZfQIzkteLlTTsZvkWeJdkxgo5ZAMrJxM7pToIa8R7+S5r07
	VQpJdeWMRqWHToBe0yA+4sI0QhIhyRFQmPzmfdZFIcKbrxU/4xNoyzXkzLyy8o6f
	fwWXByp68fndsHpIretMIw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:subject:subject:to
	:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
	fm3; t=1723026569; x=1723112969; bh=cTdfBIzfd5Ast37IVVf9UsEEPljc
	ZyHaeZvmiHWtIE4=; b=TBm4kcp69Qzmm+7VM5GGKHMOvSByYLMHQi/HqJ0eADGq
	qlIxwItdGJlJCYjfD1HS69C6M1shx8naiGZN2z/OAFlGy1eqNvCTkRvrbOfOjY0/
	LDzoYEOl/IZOZire5JEXbgr6uT3NO5mT5CssbXXxmFl92WN5pxXFun2J6HviPTsq
	eZJO2uKx3wCEheugW+YciRUxmHOGh66fEkTKwzoAnee0/eUjDSW4Iih16W5nfzqI
	lf2UcXacsRwC21uZLYWd4Vvl1Ioqd/e3hYk2f2bS4RNrfL0vPacazBobbeUiSzFV
	NNdoAW1Ma93U3W2mAc+fKbZQPmEv7PTfm7CqFUrbFQ==
X-ME-Sender: <xms:iUyzZsz4K_w8x_HJXBLf78XedBxVOgDCCFZHSbkfVP72pmdo4m8ITw>
    <xme:iUyzZgRTRmxgoER6-SWaejyu_Aam7jHKB8wOjf4XZM25qVbiLQeG8uiv_oKF6uEdV
    qDTKn7ZAHlInQ>
X-ME-Received: <xmr:iUyzZuVIlz_Vyo4PpVFMMhgVpFv9srZ_nlqn7f7VqQcVKz1gCEtyBR5sY0SotjRSo8vj1viTvAgdj8eCK6aO0OqB3d6yIFbkKg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrledtgddvlecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
    uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
    fjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecuhfhrohhmpeforghrvghk
    ucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvh
    hishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeetueeg
    fefhffdvffetleeltdelkedvlefhkeehgfehhffhheehudeitdegheejleenucffohhmrg
    hinhepkhgvrhhnvghlrdhorhhgpdhgihhthhhusgdrtghomhenucevlhhushhtvghrufhi
    iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhesihhnvhhish
    hisghlvghthhhinhhgshhlrggsrdgtohhmpdhnsggprhgtphhtthhopedt
X-ME-Proxy: <xmx:iUyzZqgz5ww-8QDCSXYOKmwkLtTHVSPtz9haBmLd80vKJPB6O2u9og>
    <xmx:iUyzZuCy_cFVGnf19T3lZZZwIfHRyFOvH5-p7k6FN4J2n37-WeNhhw>
    <xmx:iUyzZrIFIS8A4OgqgnY2Yc6e-NK4AwHuA6mywfwpMxV3gbsUzCQCQA>
    <xmx:iUyzZlDq4spQpofWChOjzoGNvllIchDEavt88c6a5ehxiLjd1rMvLQ>
    <xmx:iUyzZhM8-EoEF3tPdjhfUc5EYUQc11ZTmTlTX9nAx8V_eiOfAMvgzmko>
Feedback-ID: i1568416f:Fastmail
Date: Wed, 7 Aug 2024 12:29:25 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: =?utf-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: ACPI NVS range conflicting with Dom0 page tables (or kernel
 image)
Message-ID: <ZrNMhZ9F2b1syvio@mail-itl>
References: <a5a8a016-2107-46fb-896b-2baaf66566d4@suse.com>
 <ZnBCFgHltVqj2FDh@mail-itl>
 <6a7508dd-9f81-4fce-9c83-8b4fae924d48@suse.com>
 <ZrI_YSBSiC7w5iP6@mail-itl>
 <1dc37ba4-c0ef-4be7-9699-31cf839c6deb@suse.com>
 <ZrNLDmRC_5DC_1K3@mail-itl>
 <73dd2dea-d3bc-490e-b5a4-3d426cf5660b@suse.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="N7pNbbSHyZYMHRjm"
Content-Disposition: inline
In-Reply-To: <73dd2dea-d3bc-490e-b5a4-3d426cf5660b@suse.com>


--N7pNbbSHyZYMHRjm
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Wed, 7 Aug 2024 12:29:25 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: =?utf-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Cc: Jan Beulich <jbeulich@suse.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: ACPI NVS range conflicting with Dom0 page tables (or kernel
 image)

On Wed, Aug 07, 2024 at 12:26:26PM +0200, J=C3=BCrgen Gro=C3=9F wrote:
> On 07.08.24 12:23, Marek Marczykowski-G=C3=B3recki wrote:
> > On Tue, Aug 06, 2024 at 05:24:22PM +0200, J=C3=BCrgen Gro=C3=9F wrote:
> > > On 06.08.24 17:21, Marek Marczykowski-G=C3=B3recki wrote:
> > > > On Tue, Aug 06, 2024 at 04:12:32PM +0200, J=C3=BCrgen Gro=C3=9F wro=
te:
> > > > > Marek,
> > > > >=20
> > > > > On 17.06.24 16:03, Marek Marczykowski-G=C3=B3recki wrote:
> > > > > > On Mon, Jun 17, 2024 at 01:22:37PM +0200, Jan Beulich wrote:
> > > > > > > Hello,
> > > > > > >=20
> > > > > > > while it feels like we had a similar situation before, I can'=
t seem to be
> > > > > > > able to find traces thereof, or associated (Linux) commits.
> > > > > >=20
> > > > > > Is it some AMD Threadripper system by a chance? Previous thread=
 on this
> > > > > > issue:
> > > > > > https://lore.kernel.org/xen-devel/CAOCpoWdOH=3DxGxiQSC1c5Ueb1TH=
xAjH4WiZbCZq-QT+d_KAk3SA@mail.gmail.com/
> > > > > >=20
> > > > > > > With
> > > > > > >=20
> > > > > > > (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x40=
00000
> > > > > > > ...
> > > > > > > (XEN)  Dom0 alloc.:   0000000440000000->0000000448000000 (619=
175 pages to be allocated)
> > > > > > > ...
> > > > > > > (XEN)  Loaded kernel: ffffffff81000000->ffffffff84000000
> > > > > > >=20
> > > > > > > the kernel occupies the space from 16Mb to 64Mb in the initia=
l allocation.
> > > > > > > Page tables come (almost) directly above:
> > > > > > >=20
> > > > > > > (XEN)  Page tables:   ffffffff84001000->ffffffff84026000
> > > > > > >=20
> > > > > > > I.e. they're just above the 64Mb boundary. Yet sadly in the h=
ost E820 map
> > > > > > > there is
> > > > > > >=20
> > > > > > > (XEN)  [0000000004000000, 0000000004009fff] (ACPI NVS)
> > > > > > >=20
> > > > > > > i.e. a non-RAM range starting at 64Mb. The kernel (currently)=
 won't tolerate
> > > > > > > such an overlap (also if it was overlapping the kernel image,=
 e.g. if on the
> > > > > > > machine in question s sufficiently much larger kernel was use=
d). Yet with its
> > > > > > > fundamental goal of making its E820 match the host one I'm al=
so in trouble
> > > > > > > thinking of possible solutions / workarounds. I certainly do =
not see Xen
> > > > > > > trying to cover for this, as the E820 map re-arrangement is p=
urely a kernel
> > > > > > > side decision (forward ported kernels got away without, and w=
hat e.g. the
> > > > > > > BSDs do is entirely unknown to me).
> > > > > >=20
> > > > > > In Qubes we have worked around the issue by moving the kernel l=
ower
> > > > > > (CONFIG_PHYSICAL_START=3D0x200000):
> > > > > > https://github.com/QubesOS/qubes-linux-kernel/commit/3e8be4ac16=
82370977d4d0dc1d782c428d860282
> > > > > >=20
> > > > > > Far from ideal, but gets it bootable...
> > > > > >=20
> > > > >=20
> > > > > could you test the attached kernel patches? They should fix the i=
ssue without
> > > > > having to modify CONFIG_PHYSICAL_START.
> > > > >=20
> > > > > I have tested them to boot up without problem on my test system, =
but I don't
> > > > > have access to a system showing the E820 map conflict you are see=
ing.
> > > > >=20
> > > > > The patches have been developed against kernel 6.11-rc2, but I th=
ink they
> > > > > should apply to a 6.10 and maybe even an older kernel.
> > > >=20
> > > > Sure, but tomorrow-ish.
> > >=20
> > > Thanks.
> >=20
> > Seems to work :)
> >=20
> > Snippets from Xen log:
> >=20
> >      (XEN) EFI RAM map:
> >      (XEN)  [0000000000000000, 000000000009ffff] (usable)
> >      (XEN)  [00000000000a0000, 00000000000fffff] (reserved)
> >      (XEN)  [0000000000100000, 0000000003ffffff] (usable)
> >      (XEN)  [0000000004000000, 0000000004011fff] (ACPI NVS)
> >      (XEN)  [0000000004012000, 0000000009df1fff] (usable)
> >      (XEN)  [0000000009df2000, 0000000009ffffff] (reserved)
> >      (XEN)  [000000000a000000, 00000000a8840fff] (usable)
> >      (XEN)  [00000000a8841000, 00000000a9d9ffff] (reserved)
> >      (XEN)  [00000000a9da0000, 00000000a9dd4fff] (ACPI data)
> >      (XEN)  [00000000a9dd5000, 00000000a9dd5fff] (reserved)
> >      (XEN)  [00000000a9dd6000, 00000000a9f20fff] (ACPI data)
> >      (XEN)  [00000000a9f21000, 00000000aa099fff] (ACPI NVS)
> >      (XEN)  [00000000aa09a000, 00000000ab1fefff] (reserved)
> >      (XEN)  [00000000ab1ff000, 00000000abffffff] (usable)
> >      (XEN)  [00000000ac000000, 00000000afffffff] (reserved)
> >      (XEN)  [00000000b2500000, 00000000b2580fff] (reserved)
> >      (XEN)  [00000000b3580000, 00000000b3600fff] (reserved)
> >      (XEN)  [00000000e2100000, 00000000e2280fff] (reserved)
> >      (XEN)  [00000000fa180000, 00000000fa200fff] (reserved)
> >      (XEN)  [00000000fa300000, 00000000fa3fffff] (reserved)
> >      (XEN)  [00000000fea00000, 00000000feafffff] (reserved)
> >      (XEN)  [00000000fec00000, 00000000fec00fff] (reserved)
> >      (XEN)  [00000000fec10000, 00000000fec10fff] (reserved)
> >      (XEN)  [00000000fed00000, 00000000fed00fff] (reserved)
> >      (XEN)  [00000000fed40000, 00000000fed44fff] (reserved)
> >      (XEN)  [00000000fed80000, 00000000fed8ffff] (reserved)
> >      (XEN)  [00000000fedc2000, 00000000fedcffff] (reserved)
> >      (XEN)  [00000000fedd4000, 00000000fedd5fff] (reserved)
> >      (XEN)  [00000000fee00000, 00000000feefffff] (reserved)
> >      (XEN)  [00000000ff000000, 00000000ffffffff] (reserved)
> >      (XEN)  [0000000100000000, 000000104f1fffff] (usable)
> >      (XEN)  [000000104f200000, 000000104fffffff] (reserved)
> >      (XEN)  [0000010000000000, 00000100103fffff] (reserved)
> >      (XEN)  [0000018030000000, 00000180403fffff] (reserved)
> >      (XEN)  [0000018060000000, 00000180703fffff] (reserved)
> >      (XEN)  [0000020090000000, 00000200a03fffff] (reserved)
> >      ...
> >      (XEN) Dom0 has maximum 1400 PIRQs
> >      (XEN)  Xen  kernel: 64-bit, lsb
> >      (XEN)  Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x4800000
> >      (XEN) PHYSICAL MEMORY ARRANGEMENT:
> >      (XEN)  Dom0 alloc.:   0000001010000000->0000001018000000 (1000315 =
pages to be allocated)
> >      (XEN)  Init. ramdisk: 000000104b57b000->000000104f1ffe72
> >      (XEN) VIRTUAL MEMORY ARRANGEMENT:
> >      (XEN)  Loaded kernel: ffffffff81000000->ffffffff84800000
> >      (XEN)  Phys-Mach map: 0000008000000000->0000008000800000
> >      (XEN)  Start info:    ffffffff84800000->ffffffff848004b8
> >      (XEN)  Page tables:   ffffffff84801000->ffffffff8482a000
> >      (XEN)  Boot stack:    ffffffff8482a000->ffffffff8482b000
> >      (XEN)  TOTAL:         ffffffff80000000->ffffffff84c00000
> >      (XEN)  ENTRY ADDRESS: ffffffff838b7640
> >=20
> > So, it would indeed conflict with the ACPI NVS region, but the system
> > started, and later dom0 reports this region remapped:
> >=20
> >      [    0.000000] BIOS-provided physical RAM map:
> >      [    0.000000] Xen: [mem 0x0000000000000000-0x000000000007ffff] us=
able
> >      [    0.000000] Xen: [mem 0x0000000000080000-0x00000000000fffff] re=
served
> >      [    0.000000] Xen: [mem 0x0000000000100000-0x0000000009df1fff] us=
able
> >      [    0.000000] Xen: [mem 0x0000000009df2000-0x0000000009ffffff] re=
served
> >      [    0.000000] Xen: [mem 0x000000000a000000-0x00000000a8840fff] us=
able
> >      [    0.000000] Xen: [mem 0x00000000a8841000-0x00000000a9d9ffff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000a9da0000-0x00000000a9dd4fff] AC=
PI data
> >      [    0.000000] Xen: [mem 0x00000000a9dd5000-0x00000000a9dd5fff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000a9dd6000-0x00000000a9f20fff] AC=
PI data
> >      [    0.000000] Xen: [mem 0x00000000a9f21000-0x00000000aa099fff] AC=
PI NVS
> >      [    0.000000] Xen: [mem 0x00000000aa09a000-0x00000000ab1fefff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000ab1ff000-0x00000000abffffff] us=
able
> >      [    0.000000] Xen: [mem 0x00000000ac000000-0x00000000afffffff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000b2500000-0x00000000b2580fff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000b3580000-0x00000000b3600fff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000e2100000-0x00000000e2280fff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000fa180000-0x00000000fa200fff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000fa300000-0x00000000fa3fffff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000fea00000-0x00000000feafffff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000fec00000-0x00000000fec00fff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000fec10000-0x00000000fec10fff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000fed00000-0x00000000fed00fff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000fed40000-0x00000000fed44fff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000fed80000-0x00000000fed8ffff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000fedc2000-0x00000000fedcffff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000fedd4000-0x00000000fedd5fff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000fee00000-0x00000000feefffff] re=
served
> >      [    0.000000] Xen: [mem 0x00000000ff000000-0x00000000ffffffff] re=
served
> >      [    0.000000] Xen: [mem 0x0000000100000000-0x0000000156c4bfff] us=
able
> >      [    0.000000] Xen: [mem 0x000000104f1ee000-0x000000104f1fffff] AC=
PI NVS
> >      [    0.000000] Xen: [mem 0x000000104f200000-0x000000104fffffff] re=
served
> >      [    0.000000] Xen: [mem 0x0000010000000000-0x00000100103fffff] re=
served
> >      [    0.000000] Xen: [mem 0x0000018030000000-0x00000180403fffff] re=
served
> >      [    0.000000] Xen: [mem 0x0000018060000000-0x00000180703fffff] re=
served
> >      [    0.000000] Xen: [mem 0x0000020090000000-0x00000200a03fffff] re=
served
>=20
> Thanks for the testing!
>=20
> Are you fine with me adding your "Tested-by:"?

Yes.

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

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

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmazTIUACgkQ24/THMrX
1yyPQwf+N873r4L+YrVWbzv//XPsToEKjYfrGW2KEBtqtvwcG9t+wFEmT6b/4g7s
qwwWmw5rQCwli+NfyahsedtWg6qhpG2gVhkgxWVP9zidOCX9cZ22ICJRaKfXAYgb
AVayH4ESMrV5h/sT5OpH7ty+1Uwbqf4nMFCwmmGJ9yVYiKwf0cyw5ROgU4O3fNDU
XCAYpwy5fYV/YD4+cEhfIhGsF058o4qyI8WLQaYvrdqltSldtlABiqP9t2im7Ag3
aS/J1nIYM+t5U5WXvxEXItpbLVOEt2gqOKSoAhLRNvIozAj+jFuWUmfgStli4CCa
vflwcLuc1ML3WkGmysnaseB7rsHHYg==
=2+xf
-----END PGP SIGNATURE-----

--N7pNbbSHyZYMHRjm--


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 10:33:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 10:33:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773299.1183739 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdzG-0005nQ-18; Wed, 07 Aug 2024 10:33:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773299.1183739; Wed, 07 Aug 2024 10:33:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdzF-0005nJ-Sz; Wed, 07 Aug 2024 10:33:45 +0000
Received: by outflank-mailman (input) for mailman id 773299;
 Wed, 07 Aug 2024 10:33:44 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6zTk=PG=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbdzE-0005nD-6a
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 10:33:44 +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 810aebf1-54a8-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 12:33:37 +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 7906F1F86A;
 Wed,  7 Aug 2024 10:33:41 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 208F213297;
 Wed,  7 Aug 2024 10:33:41 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id e4WABoVNs2beHwAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 07 Aug 2024 10:33:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 810aebf1-54a8-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723026821; 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=qsPSyX3JmaVc+f4Tkm+uJmQXt6zFhh500l0/kg//IC8=;
	b=ui9gXtc3qWxb6jKcxoJev/mYYLyE6GwG3QInrdzyJV7NL/OW2WM86pC8F9OC4BkA/qx0q2
	Uqc58iyxU0aJDBQbCJM5ZSxFGmnbjzmNjrZTxedCwQ/xoqGR3nc62gqGTfqEDWQts6NjPg
	RW0VLoMG2vYPHNSFA4q2Ix29zjTpwHg=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=ui9gXtc3
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723026821; 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=qsPSyX3JmaVc+f4Tkm+uJmQXt6zFhh500l0/kg//IC8=;
	b=ui9gXtc3qWxb6jKcxoJev/mYYLyE6GwG3QInrdzyJV7NL/OW2WM86pC8F9OC4BkA/qx0q2
	Uqc58iyxU0aJDBQbCJM5ZSxFGmnbjzmNjrZTxedCwQ/xoqGR3nc62gqGTfqEDWQts6NjPg
	RW0VLoMG2vYPHNSFA4q2Ix29zjTpwHg=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH 0/5] xen: fix dom0 PV boot on some AMD machines
Date: Wed,  7 Aug 2024 12:33:31 +0200
Message-ID: <20240807103338.22007-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 [-3.01 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	MID_CONTAINS_FROM(1.00)[];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	ARC_NA(0.00)[];
	MIME_TRACE(0.00)[0:+];
	FROM_HAS_DN(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	RCVD_TLS_ALL(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	RCPT_COUNT_SEVEN(0.00)[10];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	TO_DN_SOME(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Action: no action
X-Spam-Flag: NO
X-Spam-Score: -3.01
X-Rspamd-Queue-Id: 7906F1F86A

There have been reports of failed boots with Xen due to an overlap of
the kernel's memory with ACPI NVS reported in the E820 map of the host.

This series fixes this issue by moving the NVS area in dom0 to some
higher address.

Juergen Gross (5):
  xen: use correct end address of kernel for conflict checking
  xen: introduce generic helper checking for memory map conflicts
  xen: move checks for e820 conflicts further up
  xen: move max_pfn in xen_memory_setup() out of function scope
  xen: tolerate ACPI NVS memory overlapping with Xen allocated memory

 arch/x86/xen/mmu_pv.c  |   5 +-
 arch/x86/xen/setup.c   | 242 +++++++++++++++++++++++++++++++++--------
 arch/x86/xen/xen-ops.h |   3 +-
 3 files changed, 201 insertions(+), 49 deletions(-)

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 10:33:51 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 10:33:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773300.1183747 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdzL-00063o-AN; Wed, 07 Aug 2024 10:33:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773300.1183747; Wed, 07 Aug 2024 10:33:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdzL-00063h-7t; Wed, 07 Aug 2024 10:33:51 +0000
Received: by outflank-mailman (input) for mailman id 773300;
 Wed, 07 Aug 2024 10:33: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=6zTk=PG=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbdzJ-0005nD-9Q
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 10:33:49 +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 84639a3e-54a8-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 12:33: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-out2.suse.de (Postfix) with ESMTPS id 3BC0F1F8BD;
 Wed,  7 Aug 2024 10:33: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 E0A1013297;
 Wed,  7 Aug 2024 10:33: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 2lNkNYpNs2blHwAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 07 Aug 2024 10:33:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 84639a3e-54a8-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723026827; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=5V+UOas05CCJX1lp+n/kvQ+Bo/4QFe3PiFfjQw3draY=;
	b=XMzAC1YMl90C7b1lVoVe6deG5bKZooG8TmMQhahGnwg6aWvmq0vJFZ9nmZPrBRF534vb66
	xGDhq+YFNo0Q8FG5uvGfspmj9WNymK02YjHn4RwxOoPJ1sMl0sSvT1YZ/PtiMEJ9HbmN97
	2tfpQijyy76Q81Pl+n7mvY/4AFs4iWs=
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723026827; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=5V+UOas05CCJX1lp+n/kvQ+Bo/4QFe3PiFfjQw3draY=;
	b=XMzAC1YMl90C7b1lVoVe6deG5bKZooG8TmMQhahGnwg6aWvmq0vJFZ9nmZPrBRF534vb66
	xGDhq+YFNo0Q8FG5uvGfspmj9WNymK02YjHn4RwxOoPJ1sMl0sSvT1YZ/PtiMEJ9HbmN97
	2tfpQijyy76Q81Pl+n7mvY/4AFs4iWs=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH 1/5] xen: use correct end address of kernel for conflict checking
Date: Wed,  7 Aug 2024 12:33:32 +0200
Message-ID: <20240807103338.22007-2-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240807103338.22007-1-jgross@suse.com>
References: <20240807103338.22007-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spamd-Result: default: False [-3.30 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	MIME_TRACE(0.00)[0:+];
	RCPT_COUNT_SEVEN(0.00)[10];
	RCVD_TLS_ALL(0.00)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	TO_DN_SOME(0.00)[];
	FROM_HAS_DN(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FROM_EQ_ENVFROM(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]
X-Spam-Score: -3.30
X-Spam-Flag: NO
X-Spam-Level: 

When running as a Xen PV dom0 the kernel is loaded by the hypervisor
using a different memory map than that of the host. In order to
minimize the required changes in the kernel, the kernel adapts its
memory map to that of the host. In order to do that it is checking
for conflicts of its load address with the host memory map.

Unfortunately the tested memory range does not include the .brk
area, which might result in crashes or memory corruption when this
area does conflict withe the memory map of the host.

Fix the test by using the _end label instead of __bss_stop.

Fixes: 808fdb71936c ("xen: check for kernel memory conflicting with memory layout")
Signed-off-by: Juergen Gross <jgross@suse.com>
Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 arch/x86/xen/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 806ddb2391d9..4bcc70a71b7d 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -825,7 +825,7 @@ char * __init xen_memory_setup(void)
 	 * to relocating (and even reusing) pages with kernel text or data.
 	 */
 	if (xen_is_e820_reserved(__pa_symbol(_text),
-			__pa_symbol(__bss_stop) - __pa_symbol(_text))) {
+				 __pa_symbol(_end) - __pa_symbol(_text))) {
 		xen_raw_console_write("Xen hypervisor allocated kernel memory conflicts with E820 map\n");
 		BUG();
 	}
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 10:33:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 10:33:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773301.1183758 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdzP-0006Lw-Hk; Wed, 07 Aug 2024 10:33:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773301.1183758; Wed, 07 Aug 2024 10:33:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdzP-0006Lp-FD; Wed, 07 Aug 2024 10:33:55 +0000
Received: by outflank-mailman (input) for mailman id 773301;
 Wed, 07 Aug 2024 10:33:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6zTk=PG=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbdzO-0006Kl-M4
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 10:33:54 +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 8af31eb0-54a8-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 12:33:53 +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 112DA1FB8C;
 Wed,  7 Aug 2024 10:33:53 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A339513297;
 Wed,  7 Aug 2024 10:33: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 WypzJpBNs2boHwAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 07 Aug 2024 10:33:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8af31eb0-54a8-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723026833; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=BZ7eaJU0nEL6OIQnax25lzy77xjuIx0p2h07T/rBkxA=;
	b=gK5TgjAU1LY1lov2apQWsmY2WEIO2sn1L7VGiYyGcB0ktwaUPzNwDTD66hdL43tdiMCkPl
	TPqsrEG03Ovb5hbIis4zBiVEYbAd+uBOtLE4WY9VKcMTIukCVM3L5qQ8rD/ay66HQ9pYDf
	LppKSi4h8xaR/wKuUg9xqJZXniMbp1Q=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=gK5TgjAU
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723026833; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=BZ7eaJU0nEL6OIQnax25lzy77xjuIx0p2h07T/rBkxA=;
	b=gK5TgjAU1LY1lov2apQWsmY2WEIO2sn1L7VGiYyGcB0ktwaUPzNwDTD66hdL43tdiMCkPl
	TPqsrEG03Ovb5hbIis4zBiVEYbAd+uBOtLE4WY9VKcMTIukCVM3L5qQ8rD/ay66HQ9pYDf
	LppKSi4h8xaR/wKuUg9xqJZXniMbp1Q=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH 2/5] xen: introduce generic helper checking for memory map conflicts
Date: Wed,  7 Aug 2024 12:33:33 +0200
Message-ID: <20240807103338.22007-3-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240807103338.22007-1-jgross@suse.com>
References: <20240807103338.22007-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Level: 
X-Rspamd-Action: no action
X-Spam-Score: -3.51
X-Spam-Flag: NO
X-Rspamd-Queue-Id: 112DA1FB8C
X-Spamd-Result: default: False [-3.51 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	MIME_TRACE(0.00)[0:+];
	RCPT_COUNT_SEVEN(0.00)[10];
	RCVD_TLS_ALL(0.00)[];
	TO_DN_SOME(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:email];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org

When booting as a Xen PV dom0 the memory layout of the dom0 is
modified to match that of the host, as this requires less changes in
the kernel for supporting Xen.

There are some cases, though, which are problematic, as it is the Xen
hypervisor selecting the kernel's load address plus some other data,
which might conflict with the host's memory map.

These conflicts are detected at boot time and result in a boot error.
In order to support handling at least some of these conflicts in
future, introduce a generic helper function which will later gain the
ability to adapt the memory layout when possible.

Add the missing check for the xen_start_info area.

Signed-off-by: Juergen Gross <jgross@suse.com>
Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 arch/x86/xen/mmu_pv.c  |  5 +----
 arch/x86/xen/setup.c   | 34 ++++++++++++++++++++++++++++------
 arch/x86/xen/xen-ops.h |  3 ++-
 3 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c
index f1ce39d6d32c..839e6613753d 100644
--- a/arch/x86/xen/mmu_pv.c
+++ b/arch/x86/xen/mmu_pv.c
@@ -2018,10 +2018,7 @@ void __init xen_reserve_special_pages(void)
 
 void __init xen_pt_check_e820(void)
 {
-	if (xen_is_e820_reserved(xen_pt_base, xen_pt_size)) {
-		xen_raw_console_write("Xen hypervisor allocated page table memory conflicts with E820 map\n");
-		BUG();
-	}
+	xen_chk_is_e820_usable(xen_pt_base, xen_pt_size, "page table");
 }
 
 static unsigned char dummy_mapping[PAGE_SIZE] __page_aligned_bss;
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 4bcc70a71b7d..96765180514b 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -567,7 +567,7 @@ static void __init xen_ignore_unusable(void)
 	}
 }
 
-bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size)
+static bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size)
 {
 	struct e820_entry *entry;
 	unsigned mapcnt;
@@ -624,6 +624,23 @@ phys_addr_t __init xen_find_free_area(phys_addr_t size)
 	return 0;
 }
 
+/*
+ * Check for an area in physical memory to be usable for non-movable purposes.
+ * An area is considered to usable if the used E820 map lists it to be RAM.
+ * In case the area is not usable, crash the system with an error message.
+ */
+void __init xen_chk_is_e820_usable(phys_addr_t start, phys_addr_t size,
+				   const char *component)
+{
+	if (!xen_is_e820_reserved(start, size))
+		return;
+
+	xen_raw_console_write("Xen hypervisor allocated ");
+	xen_raw_console_write(component);
+	xen_raw_console_write(" memory conflicts with E820 map\n");
+	BUG();
+}
+
 /*
  * Like memcpy, but with physical addresses for dest and src.
  */
@@ -824,11 +841,16 @@ char * __init xen_memory_setup(void)
 	 * Failing now is better than running into weird problems later due
 	 * to relocating (and even reusing) pages with kernel text or data.
 	 */
-	if (xen_is_e820_reserved(__pa_symbol(_text),
-				 __pa_symbol(_end) - __pa_symbol(_text))) {
-		xen_raw_console_write("Xen hypervisor allocated kernel memory conflicts with E820 map\n");
-		BUG();
-	}
+	xen_chk_is_e820_usable(__pa_symbol(_text),
+			       __pa_symbol(_end) - __pa_symbol(_text),
+			       "kernel");
+
+	/*
+	 * Check for a conflict of the xen_start_info memory with the target
+	 * E820 map.
+	 */
+	xen_chk_is_e820_usable(__pa(xen_start_info), sizeof(*xen_start_info),
+			       "xen_start_info");
 
 	/*
 	 * Check for a conflict of the hypervisor supplied page tables with
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index 0cf16fc79e0b..9a27d1d653d3 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -48,7 +48,8 @@ void xen_mm_unpin_all(void);
 void __init xen_relocate_p2m(void);
 #endif
 
-bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size);
+void __init xen_chk_is_e820_usable(phys_addr_t start, phys_addr_t size,
+				   const char *component);
 unsigned long __ref xen_chk_extra_mem(unsigned long pfn);
 void __init xen_inv_extra_mem(void);
 void __init xen_remap_memory(void);
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 10:34:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 10:34:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773302.1183768 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdzU-0006gx-SK; Wed, 07 Aug 2024 10:34:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773302.1183768; Wed, 07 Aug 2024 10:34:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdzU-0006gl-OL; Wed, 07 Aug 2024 10:34:00 +0000
Received: by outflank-mailman (input) for mailman id 773302;
 Wed, 07 Aug 2024 10:33:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6zTk=PG=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbdzT-0006Kl-Mh
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 10:33: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 8e3dd574-54a8-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 12:33:59 +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 BF7AE1F86A;
 Wed,  7 Aug 2024 10:33: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 6F69213297;
 Wed,  7 Aug 2024 10:33: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 xoCyGZZNs2b3HwAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 07 Aug 2024 10:33:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8e3dd574-54a8-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723026838; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=39Sts4C7oOClwSNtkpQ1zmallaopCCgiNRjix3mq5lw=;
	b=cp39cEpulefVdJvWEbkFEXb/5Sp9ly9hCFrGYQI5Qf7h206XcUY8ulLm2WXOg12OTFD0il
	ifZLdzXja31H7tveD0eID8tzH3YaW8MweJKThiNL9geUACCQ0BFLu8ah6p26kYSSEOO3H3
	kp9HCu1Yjt0eniKv7W1OZuXDak5J1Ac=
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723026838; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=39Sts4C7oOClwSNtkpQ1zmallaopCCgiNRjix3mq5lw=;
	b=cp39cEpulefVdJvWEbkFEXb/5Sp9ly9hCFrGYQI5Qf7h206XcUY8ulLm2WXOg12OTFD0il
	ifZLdzXja31H7tveD0eID8tzH3YaW8MweJKThiNL9geUACCQ0BFLu8ah6p26kYSSEOO3H3
	kp9HCu1Yjt0eniKv7W1OZuXDak5J1Ac=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH 3/5] xen: move checks for e820 conflicts further up
Date: Wed,  7 Aug 2024 12:33:34 +0200
Message-ID: <20240807103338.22007-4-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240807103338.22007-1-jgross@suse.com>
References: <20240807103338.22007-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spamd-Result: default: False [-3.30 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	MIME_TRACE(0.00)[0:+];
	ARC_NA(0.00)[];
	FROM_HAS_DN(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	TO_DN_SOME(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	RCPT_COUNT_SEVEN(0.00)[10];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]
X-Spam-Score: -3.30
X-Spam-Flag: NO
X-Spam-Level: 

Move the checks for e820 memory map conflicts using the
xen_chk_is_e820_usable() helper further up in order to prepare
resolving some of the possible conflicts by doing some e820 map
modifications, which must happen before evaluating the RAM layout.

Signed-off-by: Juergen Gross <jgross@suse.com>
Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 arch/x86/xen/setup.c | 44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 96765180514b..dba68951ed6b 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -764,6 +764,28 @@ char * __init xen_memory_setup(void)
 	/* Make sure the Xen-supplied memory map is well-ordered. */
 	e820__update_table(&xen_e820_table);
 
+	/*
+	 * Check whether the kernel itself conflicts with the target E820 map.
+	 * Failing now is better than running into weird problems later due
+	 * to relocating (and even reusing) pages with kernel text or data.
+	 */
+	xen_chk_is_e820_usable(__pa_symbol(_text),
+			       __pa_symbol(_end) - __pa_symbol(_text),
+			       "kernel");
+
+	/*
+	 * Check for a conflict of the xen_start_info memory with the target
+	 * E820 map.
+	 */
+	xen_chk_is_e820_usable(__pa(xen_start_info), sizeof(*xen_start_info),
+			       "xen_start_info");
+
+	/*
+	 * Check for a conflict of the hypervisor supplied page tables with
+	 * the target E820 map.
+	 */
+	xen_pt_check_e820();
+
 	max_pages = xen_get_max_pages();
 
 	/* How many extra pages do we need due to remapping? */
@@ -836,28 +858,6 @@ char * __init xen_memory_setup(void)
 
 	e820__update_table(e820_table);
 
-	/*
-	 * Check whether the kernel itself conflicts with the target E820 map.
-	 * Failing now is better than running into weird problems later due
-	 * to relocating (and even reusing) pages with kernel text or data.
-	 */
-	xen_chk_is_e820_usable(__pa_symbol(_text),
-			       __pa_symbol(_end) - __pa_symbol(_text),
-			       "kernel");
-
-	/*
-	 * Check for a conflict of the xen_start_info memory with the target
-	 * E820 map.
-	 */
-	xen_chk_is_e820_usable(__pa(xen_start_info), sizeof(*xen_start_info),
-			       "xen_start_info");
-
-	/*
-	 * Check for a conflict of the hypervisor supplied page tables with
-	 * the target E820 map.
-	 */
-	xen_pt_check_e820();
-
 	xen_reserve_xen_mfnlist();
 
 	/* Check for a conflict of the initrd with the target E820 map. */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 10:34:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 10:34:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773312.1183778 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdzb-0007GH-3K; Wed, 07 Aug 2024 10:34:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773312.1183778; Wed, 07 Aug 2024 10:34:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdza-0007Fy-Vo; Wed, 07 Aug 2024 10:34:06 +0000
Received: by outflank-mailman (input) for mailman id 773312;
 Wed, 07 Aug 2024 10:34:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6zTk=PG=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbdzZ-0006Kl-Vb
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 10:34:05 +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 91a2b5e3-54a8-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 12:34:04 +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 7555621D05;
 Wed,  7 Aug 2024 10:34: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 25C3613297;
 Wed,  7 Aug 2024 10:34:04 +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 MQm1B5xNs2YBIAAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 07 Aug 2024 10:34:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 91a2b5e3-54a8-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723026844; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=R2HRNEjKteadr0yEjLsc+mhlWZGd0BCfAetOymhMvJ4=;
	b=o+poM77ZPB0bP6oyzFWAYI5SPJwfn6ZZwZNaZqA7gOLjA9f5pBJUtXaeYV+7XHG2qcRfkw
	p75iMeTRwVZM8vL3XeVJD4ZutW1jcrhnwNT1vf23msGayGk0vLTFW5U+i4M7qfroLZuvTu
	XHJtVkCIldNCGBhS605Fit8/VNRPRsI=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723026844; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=R2HRNEjKteadr0yEjLsc+mhlWZGd0BCfAetOymhMvJ4=;
	b=o+poM77ZPB0bP6oyzFWAYI5SPJwfn6ZZwZNaZqA7gOLjA9f5pBJUtXaeYV+7XHG2qcRfkw
	p75iMeTRwVZM8vL3XeVJD4ZutW1jcrhnwNT1vf23msGayGk0vLTFW5U+i4M7qfroLZuvTu
	XHJtVkCIldNCGBhS605Fit8/VNRPRsI=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH 4/5] xen: move max_pfn in xen_memory_setup() out of function scope
Date: Wed,  7 Aug 2024 12:33:35 +0200
Message-ID: <20240807103338.22007-5-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240807103338.22007-1-jgross@suse.com>
References: <20240807103338.22007-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spamd-Result: default: False [-3.30 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	MIME_TRACE(0.00)[0:+];
	RCPT_COUNT_SEVEN(0.00)[10];
	RCVD_TLS_ALL(0.00)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	TO_DN_SOME(0.00)[];
	FROM_HAS_DN(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FROM_EQ_ENVFROM(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]
X-Spam-Score: -3.30
X-Spam-Flag: NO
X-Spam-Level: 

Instead of having max_pfn as a local variable of xen_memory_setup(),
make it a static variable in setup.c instead. This avoids having to
pass it to subfunctions, which will be needed in more cases in future.

Rename it to ini_nr_pages, as the value denotes the currently usable
number of memory pages as passed from the hypervisor at boot time.

Signed-off-by: Juergen Gross <jgross@suse.com>
Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 arch/x86/xen/setup.c | 53 ++++++++++++++++++++++----------------------
 1 file changed, 27 insertions(+), 26 deletions(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index dba68951ed6b..d678c0330971 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -46,6 +46,9 @@ bool xen_pv_pci_possible;
 /* E820 map used during setting up memory. */
 static struct e820_table xen_e820_table __initdata;
 
+/* Number of initially usable memory pages. */
+static unsigned long ini_nr_pages __initdata;
+
 /*
  * Buffer used to remap identity mapped pages. We only need the virtual space.
  * The physical page behind this address is remapped as needed to different
@@ -212,7 +215,7 @@ static int __init xen_free_mfn(unsigned long mfn)
  * as a fallback if the remapping fails.
  */
 static void __init xen_set_identity_and_release_chunk(unsigned long start_pfn,
-			unsigned long end_pfn, unsigned long nr_pages)
+						      unsigned long end_pfn)
 {
 	unsigned long pfn, end;
 	int ret;
@@ -220,7 +223,7 @@ static void __init xen_set_identity_and_release_chunk(unsigned long start_pfn,
 	WARN_ON(start_pfn > end_pfn);
 
 	/* Release pages first. */
-	end = min(end_pfn, nr_pages);
+	end = min(end_pfn, ini_nr_pages);
 	for (pfn = start_pfn; pfn < end; pfn++) {
 		unsigned long mfn = pfn_to_mfn(pfn);
 
@@ -341,15 +344,14 @@ static void __init xen_do_set_identity_and_remap_chunk(
  * to Xen and not remapped.
  */
 static unsigned long __init xen_set_identity_and_remap_chunk(
-	unsigned long start_pfn, unsigned long end_pfn, unsigned long nr_pages,
-	unsigned long remap_pfn)
+	unsigned long start_pfn, unsigned long end_pfn, unsigned long remap_pfn)
 {
 	unsigned long pfn;
 	unsigned long i = 0;
 	unsigned long n = end_pfn - start_pfn;
 
 	if (remap_pfn == 0)
-		remap_pfn = nr_pages;
+		remap_pfn = ini_nr_pages;
 
 	while (i < n) {
 		unsigned long cur_pfn = start_pfn + i;
@@ -358,19 +360,19 @@ static unsigned long __init xen_set_identity_and_remap_chunk(
 		unsigned long remap_range_size;
 
 		/* Do not remap pages beyond the current allocation */
-		if (cur_pfn >= nr_pages) {
+		if (cur_pfn >= ini_nr_pages) {
 			/* Identity map remaining pages */
 			set_phys_range_identity(cur_pfn, cur_pfn + size);
 			break;
 		}
-		if (cur_pfn + size > nr_pages)
-			size = nr_pages - cur_pfn;
+		if (cur_pfn + size > ini_nr_pages)
+			size = ini_nr_pages - cur_pfn;
 
 		remap_range_size = xen_find_pfn_range(&remap_pfn);
 		if (!remap_range_size) {
 			pr_warn("Unable to find available pfn range, not remapping identity pages\n");
 			xen_set_identity_and_release_chunk(cur_pfn,
-						cur_pfn + left, nr_pages);
+							   cur_pfn + left);
 			break;
 		}
 		/* Adjust size to fit in current e820 RAM region */
@@ -397,18 +399,18 @@ static unsigned long __init xen_set_identity_and_remap_chunk(
 }
 
 static unsigned long __init xen_count_remap_pages(
-	unsigned long start_pfn, unsigned long end_pfn, unsigned long nr_pages,
+	unsigned long start_pfn, unsigned long end_pfn,
 	unsigned long remap_pages)
 {
-	if (start_pfn >= nr_pages)
+	if (start_pfn >= ini_nr_pages)
 		return remap_pages;
 
-	return remap_pages + min(end_pfn, nr_pages) - start_pfn;
+	return remap_pages + min(end_pfn, ini_nr_pages) - start_pfn;
 }
 
-static unsigned long __init xen_foreach_remap_area(unsigned long nr_pages,
+static unsigned long __init xen_foreach_remap_area(
 	unsigned long (*func)(unsigned long start_pfn, unsigned long end_pfn,
-			      unsigned long nr_pages, unsigned long last_val))
+			      unsigned long last_val))
 {
 	phys_addr_t start = 0;
 	unsigned long ret_val = 0;
@@ -436,8 +438,7 @@ static unsigned long __init xen_foreach_remap_area(unsigned long nr_pages,
 				end_pfn = PFN_UP(entry->addr);
 
 			if (start_pfn < end_pfn)
-				ret_val = func(start_pfn, end_pfn, nr_pages,
-					       ret_val);
+				ret_val = func(start_pfn, end_pfn, ret_val);
 			start = end;
 		}
 	}
@@ -700,7 +701,7 @@ static void __init xen_reserve_xen_mfnlist(void)
  **/
 char * __init xen_memory_setup(void)
 {
-	unsigned long max_pfn, pfn_s, n_pfns;
+	unsigned long pfn_s, n_pfns;
 	phys_addr_t mem_end, addr, size, chunk_size;
 	u32 type;
 	int rc;
@@ -712,9 +713,9 @@ char * __init xen_memory_setup(void)
 	int op;
 
 	xen_parse_512gb();
-	max_pfn = xen_get_pages_limit();
-	max_pfn = min(max_pfn, xen_start_info->nr_pages);
-	mem_end = PFN_PHYS(max_pfn);
+	ini_nr_pages = xen_get_pages_limit();
+	ini_nr_pages = min(ini_nr_pages, xen_start_info->nr_pages);
+	mem_end = PFN_PHYS(ini_nr_pages);
 
 	memmap.nr_entries = ARRAY_SIZE(xen_e820_table.entries);
 	set_xen_guest_handle(memmap.buffer, xen_e820_table.entries);
@@ -789,10 +790,10 @@ char * __init xen_memory_setup(void)
 	max_pages = xen_get_max_pages();
 
 	/* How many extra pages do we need due to remapping? */
-	max_pages += xen_foreach_remap_area(max_pfn, xen_count_remap_pages);
+	max_pages += xen_foreach_remap_area(xen_count_remap_pages);
 
-	if (max_pages > max_pfn)
-		extra_pages += max_pages - max_pfn;
+	if (max_pages > ini_nr_pages)
+		extra_pages += max_pages - ini_nr_pages;
 
 	/*
 	 * Clamp the amount of extra memory to a EXTRA_MEM_RATIO
@@ -801,8 +802,8 @@ char * __init xen_memory_setup(void)
 	 * Make sure we have no memory above max_pages, as this area
 	 * isn't handled by the p2m management.
 	 */
-	maxmem_pages = EXTRA_MEM_RATIO * min(max_pfn, PFN_DOWN(MAXMEM));
-	extra_pages = min3(maxmem_pages, extra_pages, max_pages - max_pfn);
+	maxmem_pages = EXTRA_MEM_RATIO * min(ini_nr_pages, PFN_DOWN(MAXMEM));
+	extra_pages = min3(maxmem_pages, extra_pages, max_pages - ini_nr_pages);
 	i = 0;
 	addr = xen_e820_table.entries[0].addr;
 	size = xen_e820_table.entries[0].size;
@@ -885,7 +886,7 @@ char * __init xen_memory_setup(void)
 	 * Set identity map on non-RAM pages and prepare remapping the
 	 * underlying RAM.
 	 */
-	xen_foreach_remap_area(max_pfn, xen_set_identity_and_remap_chunk);
+	xen_foreach_remap_area(xen_set_identity_and_remap_chunk);
 
 	pr_info("Released %ld page(s)\n", xen_released_pages);
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 10:34:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 10:34:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773322.1183788 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdzi-0007rh-G2; Wed, 07 Aug 2024 10:34:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773322.1183788; Wed, 07 Aug 2024 10:34:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbdzi-0007rY-CI; Wed, 07 Aug 2024 10:34:14 +0000
Received: by outflank-mailman (input) for mailman id 773322;
 Wed, 07 Aug 2024 10:34:13 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6zTk=PG=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbdzh-0005nD-0C
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 10:34:13 +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 9204fcc7-54a8-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 12:34:05 +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 2F4BA1F38C;
 Wed,  7 Aug 2024 10:34:10 +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 D3D6313297;
 Wed,  7 Aug 2024 10:34:09 +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 EtNGMqFNs2YHIAAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 07 Aug 2024 10:34:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9204fcc7-54a8-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723026850; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=Al7zo/qSAtfnUKorMrepmOjOtINp14/ntSQIbzHttSY=;
	b=NKh1xKP/gOKUmwWnYF9YDX+wJwcqXgQ3O7FZbLvVlFG3czRAHXbVs5h7cfKnoaRLkmr5FS
	N25TFBudfavnJe933nNpl8WSjGu5gLcXXsdFjjR1fKpN28xHSk9K6eqz20FY5jz2wO0fjJ
	m+gXac26xudWhKMlv6PhcTQDXFYxp8Q=
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723026850; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=Al7zo/qSAtfnUKorMrepmOjOtINp14/ntSQIbzHttSY=;
	b=NKh1xKP/gOKUmwWnYF9YDX+wJwcqXgQ3O7FZbLvVlFG3czRAHXbVs5h7cfKnoaRLkmr5FS
	N25TFBudfavnJe933nNpl8WSjGu5gLcXXsdFjjR1fKpN28xHSk9K6eqz20FY5jz2wO0fjJ
	m+gXac26xudWhKMlv6PhcTQDXFYxp8Q=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH 5/5] xen: tolerate ACPI NVS memory overlapping with Xen allocated memory
Date: Wed,  7 Aug 2024 12:33:36 +0200
Message-ID: <20240807103338.22007-6-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240807103338.22007-1-jgross@suse.com>
References: <20240807103338.22007-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spamd-Result: default: False [-3.30 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	MIME_TRACE(0.00)[0:+];
	RCPT_COUNT_SEVEN(0.00)[10];
	RCVD_TLS_ALL(0.00)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	TO_DN_SOME(0.00)[];
	FROM_HAS_DN(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FROM_EQ_ENVFROM(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email]
X-Spam-Score: -3.30
X-Spam-Flag: NO
X-Spam-Level: 

In order to minimize required special handling for running as Xen PV
dom0, the memory layout is modified to match that of the host. This
requires to have only RAM at the locations where Xen allocated memory
is living. Unfortunately there seem to be some machines, where ACPI
NVS is located at 64 MB, resulting in a conflict with the loaded
kernel or the initial page tables built by Xen.

As ACPI NVS needs to be accessed by the kernel only for saving and
restoring it across suspend operations, it can be relocated in the
dom0's memory map by swapping it with unused RAM (this is possible
via modification of the dom0 P2M map).

While the E820 map can (and should) be modified right away, the P2M
map can be updated only after memory allocation is working, as the P2M
map might need to be extended.

Fixes: 808fdb71936c ("xen: check for kernel memory conflicting with memory layout")
Signed-off-by: Juergen Gross <jgross@suse.com>
Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 arch/x86/xen/setup.c | 133 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 132 insertions(+), 1 deletion(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index d678c0330971..dbb5d13ca61a 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -49,6 +49,15 @@ static struct e820_table xen_e820_table __initdata;
 /* Number of initially usable memory pages. */
 static unsigned long ini_nr_pages __initdata;
 
+/* Remapped non-RAM areas */
+#define NR_NONRAM_REMAP 4
+static struct nonram_remap {
+	unsigned long maddr;
+	unsigned long size;
+	unsigned long paddr;
+} xen_nonram_remap[NR_NONRAM_REMAP] __initdata;
+static unsigned int nr_nonram_remap __initdata;
+
 /*
  * Buffer used to remap identity mapped pages. We only need the virtual space.
  * The physical page behind this address is remapped as needed to different
@@ -452,6 +461,8 @@ static unsigned long __init xen_foreach_remap_area(
  * to be remapped memory itself in a linked list anchored at xen_remap_mfn.
  * This scheme allows to remap the different chunks in arbitrary order while
  * the resulting mapping will be independent from the order.
+ * In case xen_e820_resolve_conflicts() did relocate some non-RAM E820
+ * entries, set the correct P2M information for the affected pages.
  */
 void __init xen_remap_memory(void)
 {
@@ -495,6 +506,29 @@ void __init xen_remap_memory(void)
 	set_pte_mfn(buf, mfn_save, PAGE_KERNEL);
 
 	pr_info("Remapped %ld page(s)\n", remapped);
+
+	if (nr_nonram_remap == 0)
+		return;
+
+	remapped = 0;
+	for (i = 0; i < nr_nonram_remap; i++) {
+		struct nonram_remap *remap = xen_nonram_remap + i;
+
+		pfn = PFN_DOWN(remap->paddr);
+		mfn_save = PFN_DOWN(remap->maddr);
+		for (len = 0; len < remap->size; len += PAGE_SIZE) {
+			if (!set_phys_to_machine(pfn, mfn_save)) {
+				WARN(1, "Failed to set p2m mapping for pfn=%ld mfn=%ld\n",
+				     pfn, mfn_save);
+				BUG();
+			}
+			pfn++;
+			mfn_save++;
+			remapped++;
+		}
+	}
+
+	pr_info("Remapped %ld non-RAM page(s)\n", remapped);
 }
 
 static unsigned long __init xen_get_pages_limit(void)
@@ -625,14 +659,111 @@ phys_addr_t __init xen_find_free_area(phys_addr_t size)
 	return 0;
 }
 
+/*
+ * Swap a non-RAM E820 map entry with RAM above ini_nr_pages.
+ * Note that the E820 map is modified accordingly, but the P2M map isn't yet.
+ * The adaption of the P2M must be deferred until page allocation is possible.
+ */
+static void __init xen_e820_swap_entry_with_ram(struct e820_entry *swap_entry)
+{
+	struct e820_entry *entry;
+	unsigned int mapcnt;
+	phys_addr_t mem_end = PFN_PHYS(ini_nr_pages);
+	struct nonram_remap *remap;
+	phys_addr_t swap_addr, swap_size, entry_end;
+
+	if (nr_nonram_remap == NR_NONRAM_REMAP) {
+		xen_raw_console_write("Number of required E820 entry remapping actions exceed maximum value\n");
+		BUG();
+	}
+
+	swap_addr = PAGE_ALIGN_DOWN(swap_entry->addr);
+	swap_size = PAGE_ALIGN(swap_entry->addr - swap_addr + swap_entry->size);
+	remap = xen_nonram_remap + nr_nonram_remap;
+	entry = xen_e820_table.entries;
+
+	for (mapcnt = 0; mapcnt < xen_e820_table.nr_entries; mapcnt++) {
+		entry_end = entry->addr + entry->size;
+		if (entry->type == E820_TYPE_RAM && entry->size >= swap_size &&
+		    entry_end - swap_size >= mem_end) {
+			/* Reduce RAM entry by needed space (whole pages). */
+			entry->size -= swap_size;
+
+			/* Add new entry at the end of E820 map. */
+			entry = xen_e820_table.entries +
+				xen_e820_table.nr_entries;
+			xen_e820_table.nr_entries++;
+
+			/* Fill new entry (keep size and page offset). */
+			entry->type = swap_entry->type;
+			entry->addr = entry_end - swap_size +
+				      swap_addr - swap_entry->addr;
+			entry->size = swap_entry->size;
+
+			/* Convert old entry to RAM, align to pages. */
+			swap_entry->type = E820_TYPE_RAM;
+			swap_entry->addr = swap_addr;
+			swap_entry->size = swap_size;
+
+			/* Remember PFN<->MFN relation for P2M update. */
+			remap->maddr = swap_addr;
+			remap->size = swap_size;
+			remap->paddr = entry_end - swap_size;
+			nr_nonram_remap++;
+
+			/* Order E820 table and merge entries. */
+			e820__update_table(&xen_e820_table);
+
+			return;
+		}
+
+		entry++;
+	}
+
+	xen_raw_console_write("No suitable area found for required E820 entry remapping action\n");
+	BUG();
+}
+
+/*
+ * Look for non-RAM memory types in a specific guest physical area and move
+ * those away if possible (ACPI NVS only for now).
+ */
+static void __init xen_e820_resolve_conflicts(phys_addr_t start,
+					      phys_addr_t size)
+{
+	struct e820_entry *entry;
+	unsigned int mapcnt;
+	phys_addr_t end;
+
+	if (!size)
+		return;
+
+	end = start + size;
+	entry = xen_e820_table.entries;
+
+	for (mapcnt = 0; mapcnt < xen_e820_table.nr_entries; mapcnt++) {
+		if (entry->addr >= end)
+			return;
+
+		if (entry->addr + entry->size > start &&
+		    entry->type == E820_TYPE_NVS)
+			xen_e820_swap_entry_with_ram(entry);
+
+		entry++;
+	}
+}
+
 /*
  * Check for an area in physical memory to be usable for non-movable purposes.
- * An area is considered to usable if the used E820 map lists it to be RAM.
+ * An area is considered to usable if the used E820 map lists it to be RAM or
+ * some other type which can be moved to higher PFNs while keeping the MFNs.
  * In case the area is not usable, crash the system with an error message.
  */
 void __init xen_chk_is_e820_usable(phys_addr_t start, phys_addr_t size,
 				   const char *component)
 {
+	xen_e820_resolve_conflicts(start, size);
+
 	if (!xen_is_e820_reserved(start, size))
 		return;
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 10:37:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 10:37:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773355.1183798 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbe2n-0001Tv-TH; Wed, 07 Aug 2024 10:37:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773355.1183798; Wed, 07 Aug 2024 10:37:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbe2n-0001To-QU; Wed, 07 Aug 2024 10:37:25 +0000
Received: by outflank-mailman (input) for mailman id 773355;
 Wed, 07 Aug 2024 10:37:24 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6zTk=PG=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbe2m-0001SQ-92
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 10:37:24 +0000
Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com
 [2a00:1450:4864:20::12c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 046f6a51-54a9-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 12:37:17 +0200 (CEST)
Received: by mail-lf1-x12c.google.com with SMTP id
 2adb3069b0e04-52f04b4abdcso2346513e87.2
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 03:37:22 -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
 6a1803df08f44-6bb9c83cbf0sm55134536d6.83.2024.08.07.03.37.20
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 07 Aug 2024 03:37:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 046f6a51-54a9-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723027042; x=1723631842; 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=ZtCQR4llpSQl4Ce3bHRxPr7DOi5yHbkr62zhtLRBZ+U=;
        b=F1QISNktbxrst3LHxEn3Fd8gKL14SwrUpJJj0D+Mua1aZtPv588aMOBfMt2CfLGm9Z
         lNYodUlhOTyTENgUr3yqDHREtKoWT9VTk7hrnyeGYxU2WCtX7KLIIv7rrKuluTR91Tmj
         eQ2YN2X//Z/y113Gf+OOZaebjtPnrooC0wUW2lUAbVoSmqhzS3H5E0wTVpr31lhwk3DP
         BHNmmR4/5crk/cDeKeewi2Xelnx8C0d1phQYGJOoqVpvINy+ScJpk0d0PmXKb8Zrh7n5
         5JzUj7TAChgcBBjgmLRIlSMfwEdvVohAubenPDUIzO86+Bd5lZx6zh6SfbzuAqw3prem
         +lrw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723027042; x=1723631842;
        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=ZtCQR4llpSQl4Ce3bHRxPr7DOi5yHbkr62zhtLRBZ+U=;
        b=iR9Pnwv7UOurTpLQP9HgrBH1ip0Ao/N76s+tBIkKGZxzWiaHMJ9HpZoG7SG6/rYWa6
         Bg94o+fJ4MjUfn92f499iTM41aAh7I++fgvMhRz9NZyc4wtN+dE1N+JA39D3zAIAJ+/l
         DS49hldbdL070z65zRhX0S/rUWX5fnXYoVKodwCFgsdWSbaX/na9fLFQt+Q7o90Ucs9F
         6jfrUPU+XZdozv/XUYbXL0WnLoXy0pQ38gS+4d2b8JzT1DD3vVQq0BVPmhHpxCSLUH8D
         KDEyTE86I1l7OEOQcTvuYsIVovKOfk9m1wrzIJZyMXnTlf5gNzuLUYRlaLGDpwcWTzQW
         AFzg==
X-Forwarded-Encrypted: i=1; AJvYcCXyhHVT5VNAoGrSefNqSSOcVlF291aPvzgWb+zWfVcHjbI79lBZfB6UVUIjLMqVy9wb3eXuf7nt+i0XdlLRM3KStitp5+rPuyavKi6EL64=
X-Gm-Message-State: AOJu0YxjHUIxyYadxlQqWkQc7NweaICyYfYtJfM0LjGCdRotozbS7dF8
	TZk7dOoDsALkh9ZVhNVOw5fQKTHqDgIMdlWleSWgzDnAdzzQb6cKPkk4akl1Frk=
X-Google-Smtp-Source: AGHT+IFWwx7rLRv7+flp6Qt7KN7Rfr939cJSrryBKNbjkCy0kv0cVckwj4XS6cvKdooZF/iTAYmZoA==
X-Received: by 2002:a05:6512:1094:b0:52e:9ebe:7325 with SMTP id 2adb3069b0e04-530bb374627mr11571201e87.31.1723027041666;
        Wed, 07 Aug 2024 03:37:21 -0700 (PDT)
Message-ID: <b46c051f-98c2-4748-8423-3e3a4511b043@suse.com>
Date: Wed, 7 Aug 2024 12:37:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/5] xen: fix dom0 PV boot on some AMD machines
To: linux-kernel@vger.kernel.org, x86@kernel.org
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org
References: <20240807103338.22007-1-jgross@suse.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <20240807103338.22007-1-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 07.08.24 12:33, Juergen Gross wrote:
> There have been reports of failed boots with Xen due to an overlap of
> the kernel's memory with ACPI NVS reported in the E820 map of the host.
> 
> This series fixes this issue by moving the NVS area in dom0 to some
> higher address.
> 
> Juergen Gross (5):
>    xen: use correct end address of kernel for conflict checking
>    xen: introduce generic helper checking for memory map conflicts
>    xen: move checks for e820 conflicts further up
>    xen: move max_pfn in xen_memory_setup() out of function scope
>    xen: tolerate ACPI NVS memory overlapping with Xen allocated memory
> 
>   arch/x86/xen/mmu_pv.c  |   5 +-
>   arch/x86/xen/setup.c   | 242 +++++++++++++++++++++++++++++++++--------
>   arch/x86/xen/xen-ops.h |   3 +-
>   3 files changed, 201 insertions(+), 49 deletions(-)
> 

Please ignore this series, messed up the "Tested-by:" of Marek by omitting
the tag. Will resend.


Juergen


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 10:41:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 10:41:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773370.1183809 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbe6Y-00033a-Db; Wed, 07 Aug 2024 10:41:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773370.1183809; Wed, 07 Aug 2024 10:41:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbe6Y-00033T-9D; Wed, 07 Aug 2024 10:41:18 +0000
Received: by outflank-mailman (input) for mailman id 773370;
 Wed, 07 Aug 2024 10:41: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=6zTk=PG=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbe6W-00033N-Su
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 10:41:16 +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 8ea160f1-54a9-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 12:41:09 +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 DD82721CFD;
 Wed,  7 Aug 2024 10:41:13 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 81B6E13297;
 Wed,  7 Aug 2024 10:41:13 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id 3omfHUlPs2YBIgAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 07 Aug 2024 10:41:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8ea160f1-54a9-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723027273; 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=qsPSyX3JmaVc+f4Tkm+uJmQXt6zFhh500l0/kg//IC8=;
	b=c9s8q1h7PuFNImDLnrn5CfMWUTg74m3RiiPv7cGwuc7yVANsH0pAOJAzvKj03s74HCs3ct
	uTMCIRl7eZCR+smQVnPEwaO0tXocBn1NJKEVKKHy8k1NGFfF+8YCMa0CyGhE9xbumEfvno
	G/T0xDuiWPCfOAttYvwmw56XIT0DgcY=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723027273; 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=qsPSyX3JmaVc+f4Tkm+uJmQXt6zFhh500l0/kg//IC8=;
	b=c9s8q1h7PuFNImDLnrn5CfMWUTg74m3RiiPv7cGwuc7yVANsH0pAOJAzvKj03s74HCs3ct
	uTMCIRl7eZCR+smQVnPEwaO0tXocBn1NJKEVKKHy8k1NGFfF+8YCMa0CyGhE9xbumEfvno
	G/T0xDuiWPCfOAttYvwmw56XIT0DgcY=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH 0/5] xen: fix dom0 PV boot on some AMD machines
Date: Wed,  7 Aug 2024 12:41:05 +0200
Message-ID: <20240807104110.18117-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 [-2.80 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	ARC_NA(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	MIME_TRACE(0.00)[0:+];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RCVD_TLS_ALL(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	RCPT_COUNT_SEVEN(0.00)[10];
	RCVD_COUNT_TWO(0.00)[2];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo]
X-Spam-Score: -2.80
X-Spam-Flag: NO
X-Spam-Level: 

There have been reports of failed boots with Xen due to an overlap of
the kernel's memory with ACPI NVS reported in the E820 map of the host.

This series fixes this issue by moving the NVS area in dom0 to some
higher address.

Juergen Gross (5):
  xen: use correct end address of kernel for conflict checking
  xen: introduce generic helper checking for memory map conflicts
  xen: move checks for e820 conflicts further up
  xen: move max_pfn in xen_memory_setup() out of function scope
  xen: tolerate ACPI NVS memory overlapping with Xen allocated memory

 arch/x86/xen/mmu_pv.c  |   5 +-
 arch/x86/xen/setup.c   | 242 +++++++++++++++++++++++++++++++++--------
 arch/x86/xen/xen-ops.h |   3 +-
 3 files changed, 201 insertions(+), 49 deletions(-)

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 10:41:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 10:41:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773371.1183818 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbe6c-0003J5-Jp; Wed, 07 Aug 2024 10:41:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773371.1183818; Wed, 07 Aug 2024 10:41:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbe6c-0003Iw-GK; Wed, 07 Aug 2024 10:41:22 +0000
Received: by outflank-mailman (input) for mailman id 773371;
 Wed, 07 Aug 2024 10:41:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6zTk=PG=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbe6a-0003I0-VR
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 10:41:20 +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 950adb50-54a9-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 12:41:20 +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 AA10021CFE;
 Wed,  7 Aug 2024 10:41:19 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 54CC513297;
 Wed,  7 Aug 2024 10:41:19 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id j747E09Ps2YQIgAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 07 Aug 2024 10:41:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 950adb50-54a9-11ef-bc04-fd08da9f4363
Authentication-Results: smtp-out1.suse.de;
	none
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH 1/5] xen: use correct end address of kernel for conflict checking
Date: Wed,  7 Aug 2024 12:41:06 +0200
Message-ID: <20240807104110.18117-2-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240807104110.18117-1-jgross@suse.com>
References: <20240807104110.18117-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Pre-Result: action=no action;
	module=replies;
	Message is reply to one we originated
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Spamd-Result: default: False [-4.00 / 50.00];
	REPLY(-4.00)[]
X-Rspamd-Queue-Id: AA10021CFE
X-Spam-Level: 
X-Rspamd-Pre-Result: action=no action;
	module=replies;
	Message is reply to one we originated
X-Rspamd-Action: no action
X-Spam-Flag: NO
X-Spam-Score: -4.00

When running as a Xen PV dom0 the kernel is loaded by the hypervisor
using a different memory map than that of the host. In order to
minimize the required changes in the kernel, the kernel adapts its
memory map to that of the host. In order to do that it is checking
for conflicts of its load address with the host memory map.

Unfortunately the tested memory range does not include the .brk
area, which might result in crashes or memory corruption when this
area does conflict withe the memory map of the host.

Fix the test by using the _end label instead of __bss_stop.

Fixes: 808fdb71936c ("xen: check for kernel memory conflicting with memory layout")

Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 arch/x86/xen/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 806ddb2391d9..4bcc70a71b7d 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -825,7 +825,7 @@ char * __init xen_memory_setup(void)
 	 * to relocating (and even reusing) pages with kernel text or data.
 	 */
 	if (xen_is_e820_reserved(__pa_symbol(_text),
-			__pa_symbol(__bss_stop) - __pa_symbol(_text))) {
+				 __pa_symbol(_end) - __pa_symbol(_text))) {
 		xen_raw_console_write("Xen hypervisor allocated kernel memory conflicts with E820 map\n");
 		BUG();
 	}
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 10:41:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 10:41:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773372.1183828 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbe6i-0003cS-Rq; Wed, 07 Aug 2024 10:41:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773372.1183828; Wed, 07 Aug 2024 10:41:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbe6i-0003cL-O2; Wed, 07 Aug 2024 10:41:28 +0000
Received: by outflank-mailman (input) for mailman id 773372;
 Wed, 07 Aug 2024 10:41:27 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6zTk=PG=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbe6h-00033N-Ju
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 10:41:27 +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 95841f90-54a9-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 12:41:20 +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 6CD071F807;
 Wed,  7 Aug 2024 10:41:25 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 15AA813297;
 Wed,  7 Aug 2024 10:41:25 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id he/lA1VPs2YeIgAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 07 Aug 2024 10:41:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 95841f90-54a9-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723027285; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=LEPD7L+PrX6jbrsj5UZebNb1W2NcisUaeKba9OJ0nRo=;
	b=LUYTC61WgoxQZisyGVLtQzUgwgoTf5pzPem32y7U6kp+DXDzaZOVFxGtlwzDaJE8BxxafK
	4S60ze5VkHMB3FOYNGAeiAo1WVqleWsTsCTgkB1mWESWybTjYboqFwf23EellDssAS6NCv
	EyUl3qhbXGd4fWpKjWypcJRvhYGA09Y=
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723027285; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=LEPD7L+PrX6jbrsj5UZebNb1W2NcisUaeKba9OJ0nRo=;
	b=LUYTC61WgoxQZisyGVLtQzUgwgoTf5pzPem32y7U6kp+DXDzaZOVFxGtlwzDaJE8BxxafK
	4S60ze5VkHMB3FOYNGAeiAo1WVqleWsTsCTgkB1mWESWybTjYboqFwf23EellDssAS6NCv
	EyUl3qhbXGd4fWpKjWypcJRvhYGA09Y=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH 2/5] xen: introduce generic helper checking for memory map conflicts
Date: Wed,  7 Aug 2024 12:41:07 +0200
Message-ID: <20240807104110.18117-3-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240807104110.18117-1-jgross@suse.com>
References: <20240807104110.18117-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spamd-Result: default: False [-7.30 / 50.00];
	REPLY(-4.00)[];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	ARC_NA(0.00)[];
	RCPT_COUNT_SEVEN(0.00)[11];
	MIME_TRACE(0.00)[0:+];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,imap1.dmz-prg2.suse.org:helo,invisiblethingslab.com:email]
X-Spam-Score: -7.30
X-Spam-Flag: NO
X-Spam-Level: 

When booting as a Xen PV dom0 the memory layout of the dom0 is
modified to match that of the host, as this requires less changes in
the kernel for supporting Xen.

There are some cases, though, which are problematic, as it is the Xen
hypervisor selecting the kernel's load address plus some other data,
which might conflict with the host's memory map.

These conflicts are detected at boot time and result in a boot error.
In order to support handling at least some of these conflicts in
future, introduce a generic helper function which will later gain the
ability to adapt the memory layout when possible.

Add the missing check for the xen_start_info area.

Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 arch/x86/xen/mmu_pv.c  |  5 +----
 arch/x86/xen/setup.c   | 34 ++++++++++++++++++++++++++++------
 arch/x86/xen/xen-ops.h |  3 ++-
 3 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c
index f1ce39d6d32c..839e6613753d 100644
--- a/arch/x86/xen/mmu_pv.c
+++ b/arch/x86/xen/mmu_pv.c
@@ -2018,10 +2018,7 @@ void __init xen_reserve_special_pages(void)
 
 void __init xen_pt_check_e820(void)
 {
-	if (xen_is_e820_reserved(xen_pt_base, xen_pt_size)) {
-		xen_raw_console_write("Xen hypervisor allocated page table memory conflicts with E820 map\n");
-		BUG();
-	}
+	xen_chk_is_e820_usable(xen_pt_base, xen_pt_size, "page table");
 }
 
 static unsigned char dummy_mapping[PAGE_SIZE] __page_aligned_bss;
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 4bcc70a71b7d..96765180514b 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -567,7 +567,7 @@ static void __init xen_ignore_unusable(void)
 	}
 }
 
-bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size)
+static bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size)
 {
 	struct e820_entry *entry;
 	unsigned mapcnt;
@@ -624,6 +624,23 @@ phys_addr_t __init xen_find_free_area(phys_addr_t size)
 	return 0;
 }
 
+/*
+ * Check for an area in physical memory to be usable for non-movable purposes.
+ * An area is considered to usable if the used E820 map lists it to be RAM.
+ * In case the area is not usable, crash the system with an error message.
+ */
+void __init xen_chk_is_e820_usable(phys_addr_t start, phys_addr_t size,
+				   const char *component)
+{
+	if (!xen_is_e820_reserved(start, size))
+		return;
+
+	xen_raw_console_write("Xen hypervisor allocated ");
+	xen_raw_console_write(component);
+	xen_raw_console_write(" memory conflicts with E820 map\n");
+	BUG();
+}
+
 /*
  * Like memcpy, but with physical addresses for dest and src.
  */
@@ -824,11 +841,16 @@ char * __init xen_memory_setup(void)
 	 * Failing now is better than running into weird problems later due
 	 * to relocating (and even reusing) pages with kernel text or data.
 	 */
-	if (xen_is_e820_reserved(__pa_symbol(_text),
-				 __pa_symbol(_end) - __pa_symbol(_text))) {
-		xen_raw_console_write("Xen hypervisor allocated kernel memory conflicts with E820 map\n");
-		BUG();
-	}
+	xen_chk_is_e820_usable(__pa_symbol(_text),
+			       __pa_symbol(_end) - __pa_symbol(_text),
+			       "kernel");
+
+	/*
+	 * Check for a conflict of the xen_start_info memory with the target
+	 * E820 map.
+	 */
+	xen_chk_is_e820_usable(__pa(xen_start_info), sizeof(*xen_start_info),
+			       "xen_start_info");
 
 	/*
 	 * Check for a conflict of the hypervisor supplied page tables with
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index 0cf16fc79e0b..9a27d1d653d3 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -48,7 +48,8 @@ void xen_mm_unpin_all(void);
 void __init xen_relocate_p2m(void);
 #endif
 
-bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size);
+void __init xen_chk_is_e820_usable(phys_addr_t start, phys_addr_t size,
+				   const char *component);
 unsigned long __ref xen_chk_extra_mem(unsigned long pfn);
 void __init xen_inv_extra_mem(void);
 void __init xen_remap_memory(void);
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 10:41:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 10:41:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773373.1183838 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbe6o-00044J-AJ; Wed, 07 Aug 2024 10:41:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773373.1183838; Wed, 07 Aug 2024 10:41:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbe6o-000448-7H; Wed, 07 Aug 2024 10:41:34 +0000
Received: by outflank-mailman (input) for mailman id 773373;
 Wed, 07 Aug 2024 10:41:33 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6zTk=PG=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbe6n-00033N-Cq
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 10:41:33 +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 98edc35c-54a9-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 12:41:26 +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 4718221D09;
 Wed,  7 Aug 2024 10:41:31 +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 DCB2113297;
 Wed,  7 Aug 2024 10:41:30 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id su46NFpPs2YkIgAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 07 Aug 2024 10:41:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 98edc35c-54a9-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723027291; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=dWJJMR8rBuh/QPRtNN+RcR8hDqRUcjKWCA7J80NLso8=;
	b=qnE8fYFP4gwW+nXwpdR80jZOfndfb8Y101T9TucjArPeBoAuu5NCh26FxkpLUfqHm9d337
	JJGGWMlPMDTnN/dryUuQj5wuXwoQlK1gJI5n+rZauRhzL4t5mdByRms8c8ghks23PYC8jV
	a+m5cWwebAIabk/tl0zpo/Yk4UK4HLQ=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723027291; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=dWJJMR8rBuh/QPRtNN+RcR8hDqRUcjKWCA7J80NLso8=;
	b=qnE8fYFP4gwW+nXwpdR80jZOfndfb8Y101T9TucjArPeBoAuu5NCh26FxkpLUfqHm9d337
	JJGGWMlPMDTnN/dryUuQj5wuXwoQlK1gJI5n+rZauRhzL4t5mdByRms8c8ghks23PYC8jV
	a+m5cWwebAIabk/tl0zpo/Yk4UK4HLQ=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH 3/5] xen: move checks for e820 conflicts further up
Date: Wed,  7 Aug 2024 12:41:08 +0200
Message-ID: <20240807104110.18117-4-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240807104110.18117-1-jgross@suse.com>
References: <20240807104110.18117-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Level: 
X-Spamd-Result: default: False [-4.30 / 50.00];
	REPLY(-4.00)[];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	MIME_TRACE(0.00)[0:+];
	ARC_NA(0.00)[];
	FROM_HAS_DN(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	TO_DN_SOME(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	RCPT_COUNT_SEVEN(0.00)[11];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,invisiblethingslab.com:email,suse.com:email]
X-Spam-Flag: NO
X-Spam-Score: -4.30

Move the checks for e820 memory map conflicts using the
xen_chk_is_e820_usable() helper further up in order to prepare
resolving some of the possible conflicts by doing some e820 map
modifications, which must happen before evaluating the RAM layout.

Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 arch/x86/xen/setup.c | 44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 96765180514b..dba68951ed6b 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -764,6 +764,28 @@ char * __init xen_memory_setup(void)
 	/* Make sure the Xen-supplied memory map is well-ordered. */
 	e820__update_table(&xen_e820_table);
 
+	/*
+	 * Check whether the kernel itself conflicts with the target E820 map.
+	 * Failing now is better than running into weird problems later due
+	 * to relocating (and even reusing) pages with kernel text or data.
+	 */
+	xen_chk_is_e820_usable(__pa_symbol(_text),
+			       __pa_symbol(_end) - __pa_symbol(_text),
+			       "kernel");
+
+	/*
+	 * Check for a conflict of the xen_start_info memory with the target
+	 * E820 map.
+	 */
+	xen_chk_is_e820_usable(__pa(xen_start_info), sizeof(*xen_start_info),
+			       "xen_start_info");
+
+	/*
+	 * Check for a conflict of the hypervisor supplied page tables with
+	 * the target E820 map.
+	 */
+	xen_pt_check_e820();
+
 	max_pages = xen_get_max_pages();
 
 	/* How many extra pages do we need due to remapping? */
@@ -836,28 +858,6 @@ char * __init xen_memory_setup(void)
 
 	e820__update_table(e820_table);
 
-	/*
-	 * Check whether the kernel itself conflicts with the target E820 map.
-	 * Failing now is better than running into weird problems later due
-	 * to relocating (and even reusing) pages with kernel text or data.
-	 */
-	xen_chk_is_e820_usable(__pa_symbol(_text),
-			       __pa_symbol(_end) - __pa_symbol(_text),
-			       "kernel");
-
-	/*
-	 * Check for a conflict of the xen_start_info memory with the target
-	 * E820 map.
-	 */
-	xen_chk_is_e820_usable(__pa(xen_start_info), sizeof(*xen_start_info),
-			       "xen_start_info");
-
-	/*
-	 * Check for a conflict of the hypervisor supplied page tables with
-	 * the target E820 map.
-	 */
-	xen_pt_check_e820();
-
 	xen_reserve_xen_mfnlist();
 
 	/* Check for a conflict of the initrd with the target E820 map. */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 10:41:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 10:41:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773380.1183847 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbe6u-0004Vc-He; Wed, 07 Aug 2024 10:41:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773380.1183847; Wed, 07 Aug 2024 10:41:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbe6u-0004VT-EU; Wed, 07 Aug 2024 10:41:40 +0000
Received: by outflank-mailman (input) for mailman id 773380;
 Wed, 07 Aug 2024 10:41:39 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=6zTk=PG=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbe6t-00033N-8x
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 10:41:39 +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 9c6e7ead-54a9-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 12:41:32 +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 1AD1721D0A;
 Wed,  7 Aug 2024 10:41:37 +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 B89E113297;
 Wed,  7 Aug 2024 10:41:36 +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 po6hK2BPs2Y3IgAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 07 Aug 2024 10:41:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9c6e7ead-54a9-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723027297; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=67Tp86aOVS8QP/GkFPihX/Ae6F141YUARfLRlav5UEw=;
	b=We12Cl/QcqG6IZAxLI2izb1FxSc1Tf3vBn64x9HvTZzjSe6UHo15z2WK8Ej55VaJsAMYIM
	GEs6K8SUbmXyH8Mfz1cSFoIrCwwo/Ud1Qeelfkk2UDU62uoFlRSjZGxKUgHMpjLbbFCx5q
	IqHLlikv0kU725wvKM3/nDKU34EYhdE=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723027297; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=67Tp86aOVS8QP/GkFPihX/Ae6F141YUARfLRlav5UEw=;
	b=We12Cl/QcqG6IZAxLI2izb1FxSc1Tf3vBn64x9HvTZzjSe6UHo15z2WK8Ej55VaJsAMYIM
	GEs6K8SUbmXyH8Mfz1cSFoIrCwwo/Ud1Qeelfkk2UDU62uoFlRSjZGxKUgHMpjLbbFCx5q
	IqHLlikv0kU725wvKM3/nDKU34EYhdE=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH 4/5] xen: move max_pfn in xen_memory_setup() out of function scope
Date: Wed,  7 Aug 2024 12:41:09 +0200
Message-ID: <20240807104110.18117-5-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240807104110.18117-1-jgross@suse.com>
References: <20240807104110.18117-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Level: 
X-Spamd-Result: default: False [-4.30 / 50.00];
	REPLY(-4.00)[];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	ARC_NA(0.00)[];
	RCPT_COUNT_SEVEN(0.00)[11];
	MIME_TRACE(0.00)[0:+];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,invisiblethingslab.com:email,suse.com:email]
X-Spam-Flag: NO
X-Spam-Score: -4.30

Instead of having max_pfn as a local variable of xen_memory_setup(),
make it a static variable in setup.c instead. This avoids having to
pass it to subfunctions, which will be needed in more cases in future.

Rename it to ini_nr_pages, as the value denotes the currently usable
number of memory pages as passed from the hypervisor at boot time.

Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 arch/x86/xen/setup.c | 53 ++++++++++++++++++++++----------------------
 1 file changed, 27 insertions(+), 26 deletions(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index dba68951ed6b..d678c0330971 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -46,6 +46,9 @@ bool xen_pv_pci_possible;
 /* E820 map used during setting up memory. */
 static struct e820_table xen_e820_table __initdata;
 
+/* Number of initially usable memory pages. */
+static unsigned long ini_nr_pages __initdata;
+
 /*
  * Buffer used to remap identity mapped pages. We only need the virtual space.
  * The physical page behind this address is remapped as needed to different
@@ -212,7 +215,7 @@ static int __init xen_free_mfn(unsigned long mfn)
  * as a fallback if the remapping fails.
  */
 static void __init xen_set_identity_and_release_chunk(unsigned long start_pfn,
-			unsigned long end_pfn, unsigned long nr_pages)
+						      unsigned long end_pfn)
 {
 	unsigned long pfn, end;
 	int ret;
@@ -220,7 +223,7 @@ static void __init xen_set_identity_and_release_chunk(unsigned long start_pfn,
 	WARN_ON(start_pfn > end_pfn);
 
 	/* Release pages first. */
-	end = min(end_pfn, nr_pages);
+	end = min(end_pfn, ini_nr_pages);
 	for (pfn = start_pfn; pfn < end; pfn++) {
 		unsigned long mfn = pfn_to_mfn(pfn);
 
@@ -341,15 +344,14 @@ static void __init xen_do_set_identity_and_remap_chunk(
  * to Xen and not remapped.
  */
 static unsigned long __init xen_set_identity_and_remap_chunk(
-	unsigned long start_pfn, unsigned long end_pfn, unsigned long nr_pages,
-	unsigned long remap_pfn)
+	unsigned long start_pfn, unsigned long end_pfn, unsigned long remap_pfn)
 {
 	unsigned long pfn;
 	unsigned long i = 0;
 	unsigned long n = end_pfn - start_pfn;
 
 	if (remap_pfn == 0)
-		remap_pfn = nr_pages;
+		remap_pfn = ini_nr_pages;
 
 	while (i < n) {
 		unsigned long cur_pfn = start_pfn + i;
@@ -358,19 +360,19 @@ static unsigned long __init xen_set_identity_and_remap_chunk(
 		unsigned long remap_range_size;
 
 		/* Do not remap pages beyond the current allocation */
-		if (cur_pfn >= nr_pages) {
+		if (cur_pfn >= ini_nr_pages) {
 			/* Identity map remaining pages */
 			set_phys_range_identity(cur_pfn, cur_pfn + size);
 			break;
 		}
-		if (cur_pfn + size > nr_pages)
-			size = nr_pages - cur_pfn;
+		if (cur_pfn + size > ini_nr_pages)
+			size = ini_nr_pages - cur_pfn;
 
 		remap_range_size = xen_find_pfn_range(&remap_pfn);
 		if (!remap_range_size) {
 			pr_warn("Unable to find available pfn range, not remapping identity pages\n");
 			xen_set_identity_and_release_chunk(cur_pfn,
-						cur_pfn + left, nr_pages);
+							   cur_pfn + left);
 			break;
 		}
 		/* Adjust size to fit in current e820 RAM region */
@@ -397,18 +399,18 @@ static unsigned long __init xen_set_identity_and_remap_chunk(
 }
 
 static unsigned long __init xen_count_remap_pages(
-	unsigned long start_pfn, unsigned long end_pfn, unsigned long nr_pages,
+	unsigned long start_pfn, unsigned long end_pfn,
 	unsigned long remap_pages)
 {
-	if (start_pfn >= nr_pages)
+	if (start_pfn >= ini_nr_pages)
 		return remap_pages;
 
-	return remap_pages + min(end_pfn, nr_pages) - start_pfn;
+	return remap_pages + min(end_pfn, ini_nr_pages) - start_pfn;
 }
 
-static unsigned long __init xen_foreach_remap_area(unsigned long nr_pages,
+static unsigned long __init xen_foreach_remap_area(
 	unsigned long (*func)(unsigned long start_pfn, unsigned long end_pfn,
-			      unsigned long nr_pages, unsigned long last_val))
+			      unsigned long last_val))
 {
 	phys_addr_t start = 0;
 	unsigned long ret_val = 0;
@@ -436,8 +438,7 @@ static unsigned long __init xen_foreach_remap_area(unsigned long nr_pages,
 				end_pfn = PFN_UP(entry->addr);
 
 			if (start_pfn < end_pfn)
-				ret_val = func(start_pfn, end_pfn, nr_pages,
-					       ret_val);
+				ret_val = func(start_pfn, end_pfn, ret_val);
 			start = end;
 		}
 	}
@@ -700,7 +701,7 @@ static void __init xen_reserve_xen_mfnlist(void)
  **/
 char * __init xen_memory_setup(void)
 {
-	unsigned long max_pfn, pfn_s, n_pfns;
+	unsigned long pfn_s, n_pfns;
 	phys_addr_t mem_end, addr, size, chunk_size;
 	u32 type;
 	int rc;
@@ -712,9 +713,9 @@ char * __init xen_memory_setup(void)
 	int op;
 
 	xen_parse_512gb();
-	max_pfn = xen_get_pages_limit();
-	max_pfn = min(max_pfn, xen_start_info->nr_pages);
-	mem_end = PFN_PHYS(max_pfn);
+	ini_nr_pages = xen_get_pages_limit();
+	ini_nr_pages = min(ini_nr_pages, xen_start_info->nr_pages);
+	mem_end = PFN_PHYS(ini_nr_pages);
 
 	memmap.nr_entries = ARRAY_SIZE(xen_e820_table.entries);
 	set_xen_guest_handle(memmap.buffer, xen_e820_table.entries);
@@ -789,10 +790,10 @@ char * __init xen_memory_setup(void)
 	max_pages = xen_get_max_pages();
 
 	/* How many extra pages do we need due to remapping? */
-	max_pages += xen_foreach_remap_area(max_pfn, xen_count_remap_pages);
+	max_pages += xen_foreach_remap_area(xen_count_remap_pages);
 
-	if (max_pages > max_pfn)
-		extra_pages += max_pages - max_pfn;
+	if (max_pages > ini_nr_pages)
+		extra_pages += max_pages - ini_nr_pages;
 
 	/*
 	 * Clamp the amount of extra memory to a EXTRA_MEM_RATIO
@@ -801,8 +802,8 @@ char * __init xen_memory_setup(void)
 	 * Make sure we have no memory above max_pages, as this area
 	 * isn't handled by the p2m management.
 	 */
-	maxmem_pages = EXTRA_MEM_RATIO * min(max_pfn, PFN_DOWN(MAXMEM));
-	extra_pages = min3(maxmem_pages, extra_pages, max_pages - max_pfn);
+	maxmem_pages = EXTRA_MEM_RATIO * min(ini_nr_pages, PFN_DOWN(MAXMEM));
+	extra_pages = min3(maxmem_pages, extra_pages, max_pages - ini_nr_pages);
 	i = 0;
 	addr = xen_e820_table.entries[0].addr;
 	size = xen_e820_table.entries[0].size;
@@ -885,7 +886,7 @@ char * __init xen_memory_setup(void)
 	 * Set identity map on non-RAM pages and prepare remapping the
 	 * underlying RAM.
 	 */
-	xen_foreach_remap_area(max_pfn, xen_set_identity_and_remap_chunk);
+	xen_foreach_remap_area(xen_set_identity_and_remap_chunk);
 
 	pr_info("Released %ld page(s)\n", xen_released_pages);
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 10:41:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 10:41:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773385.1183858 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbe6y-0004tX-QC; Wed, 07 Aug 2024 10:41:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773385.1183858; Wed, 07 Aug 2024 10:41:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbe6y-0004tQ-Mn; Wed, 07 Aug 2024 10:41:44 +0000
Received: by outflank-mailman (input) for mailman id 773385;
 Wed, 07 Aug 2024 10:41: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=6zTk=PG=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sbe6y-0003I0-1R
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 10:41:44 +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 a2e7a1a5-54a9-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 12:41:43 +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 E24351F38C;
 Wed,  7 Aug 2024 10:41:42 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 803AB13297;
 Wed,  7 Aug 2024 10:41:42 +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 DVfIHWZPs2Y9IgAAD6G6ig
 (envelope-from <jgross@suse.com>); Wed, 07 Aug 2024 10:41:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a2e7a1a5-54a9-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723027302; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=Eu33IF37KPV2peySpoH2AKulwBtPRZshtpTGtlDrC4o=;
	b=m0w7vF4UF9VBkwcbgKeJEkLaQfkFICc7DrOR73PQmWVbjIhve+gSA1r7kmLJH60K/SXQ5q
	9JatpbIuObHmzIz8s7IvNf/DheM0hxg3ru6+5S0XE/yPUaI19Ar1nynPwEyQtOEgme+J34
	KFd9vXZ88IUg0jUpqcCc3BAOkhiSkjg=
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723027302; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=Eu33IF37KPV2peySpoH2AKulwBtPRZshtpTGtlDrC4o=;
	b=m0w7vF4UF9VBkwcbgKeJEkLaQfkFICc7DrOR73PQmWVbjIhve+gSA1r7kmLJH60K/SXQ5q
	9JatpbIuObHmzIz8s7IvNf/DheM0hxg3ru6+5S0XE/yPUaI19Ar1nynPwEyQtOEgme+J34
	KFd9vXZ88IUg0jUpqcCc3BAOkhiSkjg=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH 5/5] xen: tolerate ACPI NVS memory overlapping with Xen allocated memory
Date: Wed,  7 Aug 2024 12:41:10 +0200
Message-ID: <20240807104110.18117-6-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240807104110.18117-1-jgross@suse.com>
References: <20240807104110.18117-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spamd-Result: default: False [-7.30 / 50.00];
	REPLY(-4.00)[];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	ARC_NA(0.00)[];
	RCPT_COUNT_SEVEN(0.00)[11];
	MIME_TRACE(0.00)[0:+];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	FROM_HAS_DN(0.00)[];
	TO_DN_SOME(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,imap1.dmz-prg2.suse.org:helo,invisiblethingslab.com:email]
X-Spam-Score: -7.30
X-Spam-Flag: NO
X-Spam-Level: 

In order to minimize required special handling for running as Xen PV
dom0, the memory layout is modified to match that of the host. This
requires to have only RAM at the locations where Xen allocated memory
is living. Unfortunately there seem to be some machines, where ACPI
NVS is located at 64 MB, resulting in a conflict with the loaded
kernel or the initial page tables built by Xen.

As ACPI NVS needs to be accessed by the kernel only for saving and
restoring it across suspend operations, it can be relocated in the
dom0's memory map by swapping it with unused RAM (this is possible
via modification of the dom0 P2M map).

While the E820 map can (and should) be modified right away, the P2M
map can be updated only after memory allocation is working, as the P2M
map might need to be extended.

Fixes: 808fdb71936c ("xen: check for kernel memory conflicting with memory layout")
Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 arch/x86/xen/setup.c | 133 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 132 insertions(+), 1 deletion(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index d678c0330971..dbb5d13ca61a 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -49,6 +49,15 @@ static struct e820_table xen_e820_table __initdata;
 /* Number of initially usable memory pages. */
 static unsigned long ini_nr_pages __initdata;
 
+/* Remapped non-RAM areas */
+#define NR_NONRAM_REMAP 4
+static struct nonram_remap {
+	unsigned long maddr;
+	unsigned long size;
+	unsigned long paddr;
+} xen_nonram_remap[NR_NONRAM_REMAP] __initdata;
+static unsigned int nr_nonram_remap __initdata;
+
 /*
  * Buffer used to remap identity mapped pages. We only need the virtual space.
  * The physical page behind this address is remapped as needed to different
@@ -452,6 +461,8 @@ static unsigned long __init xen_foreach_remap_area(
  * to be remapped memory itself in a linked list anchored at xen_remap_mfn.
  * This scheme allows to remap the different chunks in arbitrary order while
  * the resulting mapping will be independent from the order.
+ * In case xen_e820_resolve_conflicts() did relocate some non-RAM E820
+ * entries, set the correct P2M information for the affected pages.
  */
 void __init xen_remap_memory(void)
 {
@@ -495,6 +506,29 @@ void __init xen_remap_memory(void)
 	set_pte_mfn(buf, mfn_save, PAGE_KERNEL);
 
 	pr_info("Remapped %ld page(s)\n", remapped);
+
+	if (nr_nonram_remap == 0)
+		return;
+
+	remapped = 0;
+	for (i = 0; i < nr_nonram_remap; i++) {
+		struct nonram_remap *remap = xen_nonram_remap + i;
+
+		pfn = PFN_DOWN(remap->paddr);
+		mfn_save = PFN_DOWN(remap->maddr);
+		for (len = 0; len < remap->size; len += PAGE_SIZE) {
+			if (!set_phys_to_machine(pfn, mfn_save)) {
+				WARN(1, "Failed to set p2m mapping for pfn=%ld mfn=%ld\n",
+				     pfn, mfn_save);
+				BUG();
+			}
+			pfn++;
+			mfn_save++;
+			remapped++;
+		}
+	}
+
+	pr_info("Remapped %ld non-RAM page(s)\n", remapped);
 }
 
 static unsigned long __init xen_get_pages_limit(void)
@@ -625,14 +659,111 @@ phys_addr_t __init xen_find_free_area(phys_addr_t size)
 	return 0;
 }
 
+/*
+ * Swap a non-RAM E820 map entry with RAM above ini_nr_pages.
+ * Note that the E820 map is modified accordingly, but the P2M map isn't yet.
+ * The adaption of the P2M must be deferred until page allocation is possible.
+ */
+static void __init xen_e820_swap_entry_with_ram(struct e820_entry *swap_entry)
+{
+	struct e820_entry *entry;
+	unsigned int mapcnt;
+	phys_addr_t mem_end = PFN_PHYS(ini_nr_pages);
+	struct nonram_remap *remap;
+	phys_addr_t swap_addr, swap_size, entry_end;
+
+	if (nr_nonram_remap == NR_NONRAM_REMAP) {
+		xen_raw_console_write("Number of required E820 entry remapping actions exceed maximum value\n");
+		BUG();
+	}
+
+	swap_addr = PAGE_ALIGN_DOWN(swap_entry->addr);
+	swap_size = PAGE_ALIGN(swap_entry->addr - swap_addr + swap_entry->size);
+	remap = xen_nonram_remap + nr_nonram_remap;
+	entry = xen_e820_table.entries;
+
+	for (mapcnt = 0; mapcnt < xen_e820_table.nr_entries; mapcnt++) {
+		entry_end = entry->addr + entry->size;
+		if (entry->type == E820_TYPE_RAM && entry->size >= swap_size &&
+		    entry_end - swap_size >= mem_end) {
+			/* Reduce RAM entry by needed space (whole pages). */
+			entry->size -= swap_size;
+
+			/* Add new entry at the end of E820 map. */
+			entry = xen_e820_table.entries +
+				xen_e820_table.nr_entries;
+			xen_e820_table.nr_entries++;
+
+			/* Fill new entry (keep size and page offset). */
+			entry->type = swap_entry->type;
+			entry->addr = entry_end - swap_size +
+				      swap_addr - swap_entry->addr;
+			entry->size = swap_entry->size;
+
+			/* Convert old entry to RAM, align to pages. */
+			swap_entry->type = E820_TYPE_RAM;
+			swap_entry->addr = swap_addr;
+			swap_entry->size = swap_size;
+
+			/* Remember PFN<->MFN relation for P2M update. */
+			remap->maddr = swap_addr;
+			remap->size = swap_size;
+			remap->paddr = entry_end - swap_size;
+			nr_nonram_remap++;
+
+			/* Order E820 table and merge entries. */
+			e820__update_table(&xen_e820_table);
+
+			return;
+		}
+
+		entry++;
+	}
+
+	xen_raw_console_write("No suitable area found for required E820 entry remapping action\n");
+	BUG();
+}
+
+/*
+ * Look for non-RAM memory types in a specific guest physical area and move
+ * those away if possible (ACPI NVS only for now).
+ */
+static void __init xen_e820_resolve_conflicts(phys_addr_t start,
+					      phys_addr_t size)
+{
+	struct e820_entry *entry;
+	unsigned int mapcnt;
+	phys_addr_t end;
+
+	if (!size)
+		return;
+
+	end = start + size;
+	entry = xen_e820_table.entries;
+
+	for (mapcnt = 0; mapcnt < xen_e820_table.nr_entries; mapcnt++) {
+		if (entry->addr >= end)
+			return;
+
+		if (entry->addr + entry->size > start &&
+		    entry->type == E820_TYPE_NVS)
+			xen_e820_swap_entry_with_ram(entry);
+
+		entry++;
+	}
+}
+
 /*
  * Check for an area in physical memory to be usable for non-movable purposes.
- * An area is considered to usable if the used E820 map lists it to be RAM.
+ * An area is considered to usable if the used E820 map lists it to be RAM or
+ * some other type which can be moved to higher PFNs while keeping the MFNs.
  * In case the area is not usable, crash the system with an error message.
  */
 void __init xen_chk_is_e820_usable(phys_addr_t start, phys_addr_t size,
 				   const char *component)
 {
+	xen_e820_resolve_conflicts(start, size);
+
 	if (!xen_is_e820_reserved(start, size))
 		return;
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 11:30:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 11:30:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773437.1183871 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sberc-0006Q5-Va; Wed, 07 Aug 2024 11:29:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773437.1183871; Wed, 07 Aug 2024 11:29:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sberc-0006Py-Sv; Wed, 07 Aug 2024 11:29:56 +0000
Received: by outflank-mailman (input) for mailman id 773437;
 Wed, 07 Aug 2024 11:29:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YcC0=PG=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sberb-0006Ps-KF
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 11:29:55 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5d28d816-54b0-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 13:29:54 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-530e2235688so38194e87.3
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 04:29:52 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530de47c4b8sm213164e87.267.2024.08.07.04.29.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 07 Aug 2024 04:29:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5d28d816-54b0-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723030192; x=1723634992; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=d2JsYo1r/Er9ZgaBQ9Ckx1SyKJv5bFJIGt+kr1/h0TA=;
        b=E0ybEt5NJ4MFjbeKo2rdS1e3kD797ToM8fNisJcXghq+TEcI0QItXNSG5EPnJY2h4L
         ZqR/VFThU1n555k2sgUWQsBxrmkcDS2pD5+Ynhl5Cxpm8RMPjlTRTJezQcLeBIsaGdxu
         ebbVpgwBcaeF/tJwcUeZRDq8vRrE429TooPQ0JS3ZRonuuXbpQoI+m0B7hI/Mcs3e+fX
         7+pA9uxdzCi7Zu65ayw6hOiqftI9URgjLoAL8KVR+4jWa1v1uRxOLujEHCLirvBF7oIC
         feANW+VJLk4oYr8Gfgg5jrJALe7THNeZSdfriOU0CZM2r0NtEnj07fW1I15t/ymAWXsC
         Bbag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723030192; x=1723634992;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=d2JsYo1r/Er9ZgaBQ9Ckx1SyKJv5bFJIGt+kr1/h0TA=;
        b=tnO23BWl1URzR+yeskg4ERsxPXbmKu/x5tMEmS6wd5lweikZIGVU6LKeSTYmD3CRAG
         YBDrLJaEjeCbV1Su8FckPGrVC+PIVYpeZ+X/xF0Rp42euI5qOArxtrmquMkUJ4oK4ppm
         OXXjZa9pBMh5/zAWNqlMPZFjiXwf7h+oiK7vVxSbdqkg8fYocQpIYSxU7g70ZXBm3yfS
         AFfb0+QV+0gnU8ac1e9RYf+8SuCE3vyekWA/sKCzVZAlTSst6aQb6GllaNuacXAx8dxt
         1G3ZO5HTfyTwUfsnpGarYa7MB6YVBZ/rzwnyVxAxAbfRyXntnvFDbe8J8cMlNrWyXp+9
         fpmA==
X-Forwarded-Encrypted: i=1; AJvYcCV6pr8Jz8V/tQssl5EA9OFgCM9Pm3bBVfywbPySuTM58jtG1RpOj1ZCqNUahiuQK7A1wy4QIiT5v7kpyuOylkY9OrNypAxy8pcgYFU7bxM=
X-Gm-Message-State: AOJu0Yxn3vLu+yZgi9Onx779kQJH1uv6LhGxqujHb+DuaYG09Avirdcj
	YpT9Kx26zQg7BF2630/20zoNPFEoUhjp6nvsBww0oaAYbrq9o4s4
X-Google-Smtp-Source: AGHT+IGPjl/4HvLman57VbVnHqBPHglxkwdBCj9BJiWbDxM4B6Rcc5ydbw7b31TJgFqNOxh5ERwbog==
X-Received: by 2002:ac2:4c48:0:b0:52f:2adf:d445 with SMTP id 2adb3069b0e04-530bb39b88cmr13703358e87.41.1723030191485;
        Wed, 07 Aug 2024 04:29:51 -0700 (PDT)
Message-ID: <62165b298cd214d6aab5b5edcc68c2edc97b88d9.camel@gmail.com>
Subject: Re: [PATCH v3 7/9] xen/riscv: introduce and init SBI RFENCE
 extension
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Wed, 07 Aug 2024 13:29:50 +0200
In-Reply-To: <97554cbe-7009-4bc9-8205-7a9e0f29aad0@suse.com>
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
	 <fb2d24731f870378d79077be39b1bc19cc655327.1721834549.git.oleksii.kurochko@gmail.com>
	 <49d3a181-0830-4f55-83a4-c6c9fd54eb17@suse.com>
	 <b7433d25bb3ca7a0f4e54f561b450b5724fb46dc.camel@gmail.com>
	 <97554cbe-7009-4bc9-8205-7a9e0f29aad0@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Tue, 2024-07-30 at 11:17 +0200, Jan Beulich wrote:
> > > > +
> > > > +static void sbi_cpumask_to_hartmask(const struct cpumask
> > > > *cmask,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 struct cpumask *hmask)
> > >=20
> > > I doubt it is valud to re-use struct cpumask for hart maps.
> > Why not? Would it be better to use unsigned long *hmask?
>=20
> It's not only better, but imo a requirement. Unless there's a
> guarantee
> by the spec that hart IDs for any subset of harts are sequential and
> starting from 0, you just can't assume they fall in the [0,NR_CPUS)
> or
> really [0,nr_cpu_ids) range. Yet without that you simply can't
> (ab)use
> struct cpumask (and btw it wants to be cpumask_t everywhere).
>=20
> You may want to take a look at struct physid_mask that we have on x86
> for the equivalent purpose.
Could you please explain me why factor 4 is used in defintion of
MAX_APICS and why 256 ( is it a maximum number of APIC IDs can be
supported in the system? ):
  #define MAX_APICS     MAX(256, 4 * NR_CPUS)

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 11:37:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 11:37:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773447.1183880 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbeyx-0000DR-QJ; Wed, 07 Aug 2024 11:37:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773447.1183880; Wed, 07 Aug 2024 11:37:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbeyx-0000DK-Nb; Wed, 07 Aug 2024 11:37:31 +0000
Received: by outflank-mailman (input) for mailman id 773447;
 Wed, 07 Aug 2024 11:37:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=628V=PG=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbeyw-0000DE-3x
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 11:37:30 +0000
Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com
 [2a00:1450:4864:20::634])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6d3d9b1a-54b1-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 13:37:29 +0200 (CEST)
Received: by mail-ej1-x634.google.com with SMTP id
 a640c23a62f3a-a7a8553db90so187562766b.2
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 04:37:29 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9d45447sm633017766b.100.2024.08.07.04.37.27
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 07 Aug 2024 04:37:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6d3d9b1a-54b1-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723030648; x=1723635448; 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=BPmDtebTkY8GF7r3U38egw0uGT3CRuirbDX68D+VpEs=;
        b=Z8ejTEEwakAg3Q3UbL0J7bsaW/QvYlDYFwqvOkIginVMg4aPrQ3CSDZqwyS9KmC4FF
         RCNFZDPrOmB87OYI6XmMk4FRzDVBjZ0Yp7J4dHLBDndXQ+UdjIbx7T1fj6fqZcLD7WQC
         0Owx/D0TmXRjGtsxwKQJM95U879r+eq4VLh6hQywVTHuNgVaMG0HzbYZQHflvVwu+rY2
         kc86pGhZcbwGNI6iRu2eUb3yl3M6mTFf8c4yHm71MoIXvEyvk6UAC78DqM7dZB5LhKe3
         xdeCPU3SAwuq5zGmK7GEZH1nvVP4/PAzo1h3sbSGOWusBvoIycAiuigveli19AMuPykA
         R/lA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723030648; x=1723635448;
        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=BPmDtebTkY8GF7r3U38egw0uGT3CRuirbDX68D+VpEs=;
        b=reXfROxLWGgup3124IdmeieRy8e4tBuEJ50QTVihlcRnvm+nqkkaBCbtmgQbgssXIv
         MDAk7Poi9KPs5LM18ZdPTVpsi/FkGKLa4M1SaJn+4QZcJR+w+VsOhLLklR7zjNBN8IPw
         Bb2oX9iJwjBFfZ3ujRez8HJbuXUWmcpdpj7e9+J/uRVB3RQshpjfwtN3cVO/3K0iLujL
         T9L/UVuCAV1VNNK8+uyb5gSjOfkgD2B28mYiaCFSO3Kk9jtBqP3il4kLJsEMotOMc16b
         8ZiVjRJ1VjGlS4QGH5gf2IKhjfGRNzIeVr7bh8gLln8q4suv0UJSxehmojvZZYzpvsWt
         OKYA==
X-Forwarded-Encrypted: i=1; AJvYcCXUZNEI72vMZBoWDJorhgEY4TU6wehEyyqNFuQSJcvoVI3A7d4eKTVz0DoQRKKeziZmvoUk22XHoVBJL5fJQKI9qd7Sf7Mw9fnmtYS5Ctw=
X-Gm-Message-State: AOJu0YwAvzW+FCIrEaIXk0X9rlZQZR+P2a/tHEqBtnRSVpI+gHRZ4kav
	wt7DE1S+LXJYcjamrNr2RlodlI5af+FIOd+mD4+hSCbjJloJS0xP8B5CxXqy1g==
X-Google-Smtp-Source: AGHT+IGFAez5XeXpy23b5XINS82uokeaVqDPzuD1VXch/0Tg4K2nviJmCSrPiIk/1FzD4aT+ETkE+g==
X-Received: by 2002:a17:907:d92:b0:a77:c583:4f78 with SMTP id a640c23a62f3a-a7dc4fee5f7mr1665439166b.39.1723030648401;
        Wed, 07 Aug 2024 04:37:28 -0700 (PDT)
Message-ID: <8c882970-c640-4fde-b939-c3838c3a474e@suse.com>
Date: Wed, 7 Aug 2024 13:37:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 7/9] xen/riscv: introduce and init SBI RFENCE extension
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1721834549.git.oleksii.kurochko@gmail.com>
 <fb2d24731f870378d79077be39b1bc19cc655327.1721834549.git.oleksii.kurochko@gmail.com>
 <49d3a181-0830-4f55-83a4-c6c9fd54eb17@suse.com>
 <b7433d25bb3ca7a0f4e54f561b450b5724fb46dc.camel@gmail.com>
 <97554cbe-7009-4bc9-8205-7a9e0f29aad0@suse.com>
 <62165b298cd214d6aab5b5edcc68c2edc97b88d9.camel@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: <62165b298cd214d6aab5b5edcc68c2edc97b88d9.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 07.08.2024 13:29, oleksii.kurochko@gmail.com wrote:
> On Tue, 2024-07-30 at 11:17 +0200, Jan Beulich wrote:
>>>>> +
>>>>> +static void sbi_cpumask_to_hartmask(const struct cpumask
>>>>> *cmask,
>>>>> +                 struct cpumask *hmask)
>>>>
>>>> I doubt it is valud to re-use struct cpumask for hart maps.
>>> Why not? Would it be better to use unsigned long *hmask?
>>
>> It's not only better, but imo a requirement. Unless there's a
>> guarantee
>> by the spec that hart IDs for any subset of harts are sequential and
>> starting from 0, you just can't assume they fall in the [0,NR_CPUS)
>> or
>> really [0,nr_cpu_ids) range. Yet without that you simply can't
>> (ab)use
>> struct cpumask (and btw it wants to be cpumask_t everywhere).
>>
>> You may want to take a look at struct physid_mask that we have on x86
>> for the equivalent purpose.
> Could you please explain me why factor 4 is used in defintion of
> MAX_APICS and why 256 ( is it a maximum number of APIC IDs can be
> supported in the system? ):
>   #define MAX_APICS     MAX(256, 4 * NR_CPUS)

Both numbers are pretty arbitrary, I suppose. APIC IDs need not be
contiguous, which is what the multiplication by 4 is trying to cover
for. Plus on old (non-x2APIC) systems APIC IDs are only 8 bits wide,
and allowing for all possible values in that case is cheap enough -
hence the 256.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 11:52:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 11:52:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773458.1183890 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbfCt-0003J1-SQ; Wed, 07 Aug 2024 11:51:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773458.1183890; Wed, 07 Aug 2024 11:51:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbfCt-0003Iu-Pq; Wed, 07 Aug 2024 11:51:55 +0000
Received: by outflank-mailman (input) for mailman id 773458;
 Wed, 07 Aug 2024 11:51:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbfCs-0003Ik-9P; Wed, 07 Aug 2024 11:51:54 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbfCr-000299-VE; Wed, 07 Aug 2024 11:51:53 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbfCr-00082Y-GS; Wed, 07 Aug 2024 11:51:53 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbfCr-000775-G3; Wed, 07 Aug 2024 11:51:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=VYdJsH0hwfGNOrO9ddbfky+E951ScKIDNL0qsZiLY/g=; b=sNn4tf6O6+1SQWx6h+/Os6PmvQ
	jugrVKAOR1ls0qSiUktYYOD3PIKA3LTQr/Gm3oJ+nC0wkfpHZo4vyKwGSqX4O2ivtkFwVq5nfX/wy
	l8NH7LBPZ0zkOsWGuZ/mCozyJOJ9ZSQIWOs2RqoqMYoPniQqMx/VLPtooC8/wMSfIikU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187178-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187178: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=432e442ca8eeb4ed8c0dcc3a3c7d723f85b38c40
X-Osstest-Versions-That:
    libvirt=049846497b9e8a3eec82bfdcf3ebfe7c15e62c55
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 07 Aug 2024 11:51:53 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 libvirt              432e442ca8eeb4ed8c0dcc3a3c7d723f85b38c40
baseline version:
 libvirt              049846497b9e8a3eec82bfdcf3ebfe7c15e62c55

Last test of basis   187167  2024-08-06 04:20:38 Z    1 days
Testing same since   187178  2024-08-07 04:20:35 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Göran Uddeborg <goeran@uddeborg.se>
  Peter Krempa <pkrempa@redhat.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   049846497b..432e442ca8  432e442ca8eeb4ed8c0dcc3a3c7d723f85b38c40 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 12:05:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 12:05:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773471.1183901 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbfQA-0005VP-7T; Wed, 07 Aug 2024 12:05:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773471.1183901; Wed, 07 Aug 2024 12:05:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbfQA-0005VI-4s; Wed, 07 Aug 2024 12:05:38 +0000
Received: by outflank-mailman (input) for mailman id 773471;
 Wed, 07 Aug 2024 12:05:36 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=628V=PG=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbfQ8-0005VC-Rj
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 12:05:36 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 56d80051-54b5-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 14:05:29 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5bb477e3a6dso2083221a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 05:05:34 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b839716a97sm6906543a12.16.2024.08.07.05.05.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 07 Aug 2024 05:05:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 56d80051-54b5-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723032334; x=1723637134; 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=MuT+owmBfBGHR66APeEDFcZLpyhq79heLar8HGmLCSk=;
        b=AQvBbO8+9l8jDIiEbTwjKt37Ii5gZKy4SlWp4Piq6CXfopq2NcSQT9OwkXc6eevJ6q
         AcQaOb23lW+rij2I4nNqp4h3hzWRT5aB7sCmOOBcDgKjA4Gpsud2vtLxH1L3F18Dg8P0
         6diWoWv4S0SCJEgjLEitIfJxiYQo1C3rqHU8x0RdFARmlcB8DG6Ze3TNG9+6yu9a9bbB
         7B0MK0tvmxLWVAjp1iJ1iWOimU0Hw6MndQdGw7McoZAdnJ1FLZK5LyikzbZi4rcQf4bq
         PzJj8wxX9HFvPmkaqm0Ke3s6+WXj++GGFY7lES70pwffmVhAdcxRDsCfiGDLYOYPujsH
         Dx/A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723032334; x=1723637134;
        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=MuT+owmBfBGHR66APeEDFcZLpyhq79heLar8HGmLCSk=;
        b=cNlnykeGHQP+WbxgcC1XQG9jFjubRrskKPCqXLtuscQIrKmiWvdB1N85VbF41BpLoY
         YZZreXawmNAEcUXWQXvdvTMa+jz8WJVgdygEEB6CT0d4tLnLpFVp9higJRfXKZbneevP
         VlJSZR0W3WJWt+Ba6g1wtjsUEJ5/e/Lmqge4TdHOhBeuLP8UxjALfK+k0Cj+GG1aUG37
         x9T2DjAcvhNePLIMNPk/fPRpbIkII7B0a2F+S5Ow28Humbpp7F1nKmK4KBB7Uhp5qHoL
         IGimzyaYLsvWjuDKU5GRsndkOu2ZFkeVP4Pwi7x6rj1zWa6zIZfdhs8p9bH9oAsi6I4y
         rjSA==
X-Forwarded-Encrypted: i=1; AJvYcCUgak+IK4ZftXkvav7Ik5QdEDkUeeMp3zu2otzdCXHw8JlBA2CK/PZTGi40uCyUl/kYXDzUT16I7FA9iRu9xdr/BfOpdtBCO7xlBiLlEV4=
X-Gm-Message-State: AOJu0YyaQ7+kgHFpj7cwufUXPMx2B8pz0w5McE9MmEcvtYz+fOhGOCgd
	IBGERWfib2WpTQBTlEg0Lv1rUlthX9kEPAz3hmyUKgO8UbPC4KnyLxbKrYwZDg==
X-Google-Smtp-Source: AGHT+IHvW8je1lTSF8Nb98ubzh722Xg2WrwmRlMCXY9CtnaNJOL4qZOIC7XEf4k2/+uVM13wAgiu7g==
X-Received: by 2002:a05:6402:b11:b0:5a1:32d1:91a6 with SMTP id 4fb4d7f45d1cf-5b7f4295746mr12722364a12.22.1723032333919;
        Wed, 07 Aug 2024 05:05:33 -0700 (PDT)
Message-ID: <90d67e10-6e35-487e-a9e7-611a0fa3b00b@suse.com>
Date: Wed, 7 Aug 2024 14:05:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 5/5] xen: tolerate ACPI NVS memory overlapping with Xen
 allocated memory
To: Juergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, linux-kernel@vger.kernel.org,
 x86@kernel.org
References: <20240807104110.18117-1-jgross@suse.com>
 <20240807104110.18117-6-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: <20240807104110.18117-6-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 07.08.2024 12:41, Juergen Gross wrote:
> In order to minimize required special handling for running as Xen PV
> dom0, the memory layout is modified to match that of the host. This
> requires to have only RAM at the locations where Xen allocated memory
> is living. Unfortunately there seem to be some machines, where ACPI
> NVS is located at 64 MB, resulting in a conflict with the loaded
> kernel or the initial page tables built by Xen.
> 
> As ACPI NVS needs to be accessed by the kernel only for saving and
> restoring it across suspend operations, it can be relocated in the
> dom0's memory map by swapping it with unused RAM (this is possible
> via modification of the dom0 P2M map).

While the kernel may not (directly) need to access it for other purposes,
what about AML accessing it? As you can't advertise the movement to ACPI,
and as non-RAM mappings are carried out by drivers/acpi/osl.c:acpi_map()
using acpi_os_ioremap(), phys-to-machine translations won't cover for
that (unless I'm overlooking something, which unfortunately seems like I
might be).

Even without that I wonder in how far tools (kexec?) may be misguided by
relocating non-RAM memory ranges. Even more so when stuff traditionally
living below the 4G boundary suddenly moves far beyond that.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 13:03:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 13:03:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773480.1183910 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbgJc-0006Pz-9F; Wed, 07 Aug 2024 13:02:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773480.1183910; Wed, 07 Aug 2024 13:02:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbgJc-0006Ps-6Y; Wed, 07 Aug 2024 13:02:56 +0000
Received: by outflank-mailman (input) for mailman id 773480;
 Wed, 07 Aug 2024 13:02:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=nNf5=PG=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1sbgJb-0006PW-D6
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 13:02:55 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 59d813da-54bd-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 15:02:50 +0200 (CEST)
Received: from support.bugseng.com (support.bugseng.com [162.55.131.47])
 by support.bugseng.com (Postfix) with ESMTPA id 7389E4EE0738;
 Wed,  7 Aug 2024 15:02:49 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 59d813da-54bd-11ef-bc04-fd08da9f4363
MIME-Version: 1.0
Date: Wed, 07 Aug 2024 15:02:49 +0200
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: xen-devel@lists.xenproject.org, Shawn Anastasio
 <sanastasio@raptorengineering.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, Julien Grall
 <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Bertrand
 Marquis <bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, "Daniel P. Smith"
 <dpsmith@apertussolutions.com>, Julien Grall <jgrall@amazon.com>
Subject: Re: [PATCH v2 1/2] xen/device-tree: Move Arm's setup.c bootinfo
 functions to common
In-Reply-To: <811f6e0001e7a83ea9282a98513407aa19d26256.1722941799.git.oleksii.kurochko@gmail.com>
References: <cover.1722941799.git.oleksii.kurochko@gmail.com>
 <811f6e0001e7a83ea9282a98513407aa19d26256.1722941799.git.oleksii.kurochko@gmail.com>
Message-ID: <c6804c838a08408412a6cdc2fa91777a@bugseng.com>
X-Sender: nicola.vetrini@bugseng.com
Organization: BUGSENG s.r.l.
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit

On 2024-08-06 13:41, Oleksii Kurochko wrote:
> From: Shawn Anastasio <sanastasio@raptorengineering.com>
> 
> Arm's setup.c contains a collection of functions for parsing memory map
> and other boot information from a device tree. Since these routines are
> generally useful on any architecture that supports device tree booting,
> move them into xen/common/device-tree.
> 
> Also, common/device_tree.c has been moved to the device-tree folder 
> with
> the corresponding updates to common/Makefile and 
> common/device-tree/Makefile.
> 
> Mentioning of arm32 is changed to CONFIG_SEPARATE_XENHEAP in comparison 
> with
> original ARM's code as now it is moved in common code.
> 

Hi,

chiming in to this thread to note that fw_unreserved_regions is probably 
a leftover from this commit that ought to be moved to bootdft.h, as it 
generates a MISRA C Rule 8.4 violation [1] (non-blocking).

I made a tentative patch here [2], but not all builds are passing.

[1] 
https://saas.eclairit.com:3787/fs/var/local/eclair/xen-project.ecdf/xen-project/xen/ECLAIR_normal/staging/ARM64/7520607251/PROJECT.ecd;/by_service/MC3R1.R8.4.html

[2] 
https://gitlab.com/xen-project/people/bugseng/xen/-/commits/MC3R1.R8.4

> Suggested-by: Julien Grall <julien@xen.org>
> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> Acked-by: Julien Grall <jgrall@amazon.com>
> ---
> Changes in V9:
>  - rename xen/common/device_tree.c to xen/common/device-tree.c
>  - update MAINTAINERS file: drop xen/common/device_tree.c from it.
> ---
> Changes in V8:
>  - add the version of Xen from which bootinfo.c was derived from.
>  - update the commit message.
>  - add Acked-by: Julien Grall <jgrall@amazon.com>.
> ---
> Changes in V7:
>  - move obj-$(CONFIG_HAS_DEVICE_TREE) += device-tree/ to proper place 
> in common/Makefile.
>  - rename macros __XEN_BOOTFDT_H__ to XEN_BOOTFDT_H to not violate 
> MISRA rule 21.1.
>  - drop definition of "#define MAX_FDT_SIZE SZ_2M" in xen/bootfdt.h as 
> it is expected to
>    be arch-specific. Back "#define MAX_FDT_SIZE SZ_2M" to arm/setup.h 
> where it was before
>    these changes.
>  - git mv xen/common/device_tree.c xen/common/device-tree/ and update 
> correspondingly
>    Makefiles of common/ and common/device-tree
>  - update the commit message
> ---
> Changes in V6:
>  - update the version of the patch to v6.
> ---
> Changes in V5:
>  - After rebase the Shawn's patch v4 on top of current staging the 
> following
>    was done:
>    - add xen/include/xen/bootfdt.h to MAINTAINERS file.
>    - drop message "Early device tree parsing and".
>    - After rebase on top of the current staging the following changes 
> were done:
>      - init bootinfo variable in <common/device-tree/bootinfo.c> with 
> BOOTINFO_INIT;
>      - update the code of dt_unreserved_regions():
>          CONFIG_STATIC_SHM related changes and getting of reserved_mem
>          bootinfo_get_shmem()
>      - update the code of meminfo_overlap_check():
>          add check ( INVALID_PADDR == bank_start ) to if case.
>      - update the code of check_reserved_regions_overlap():
>          CONFIG_STATIC_SHM related changes.
>      - struct bootinfo was updated ( CONFIG_STATIC_SHM changes )
>      - add shared_meminfo ( because of CONFIG_STATIC_SHM )
>      - struct struct membanks was update with __struct group so 
> <xen/kernel> is
>        neeeded to be included in bootfdt.h
>      - move BOOTINFO_ACPI_INIT, BOOTINFO_SHMEM_INIT, BOOTINFO_INIT to 
> generic bootfdt.h
>      - bootinfo_get_reserved_mem(), bootinfo_get_mem(), 
> bootinfo_get_acpi(),
>        bootinfo_get_shmem() and bootinfo_get_shmem_extra() were moved 
> to xen/bootfdt.h
>    - s/arm32/CONFIG_SEPARATE_XENHEAP/
>    - add inclusion of <xen/macros.h> because there are function in 
> <xen/bootfdt.h> which
>      are using container_of().
>  ---
> Changes in v4:
>   - create new xen/include/bootinfo.h rather than relying on arch's
>     asm/setup.h to provide required definitions for bootinfo.c
>   - build bootinfo.c as .init.o
>   - clean up and sort bootinfo.c's #includes
>   - use CONFIG_SEPARATE_XENHEAP rather than CONFIG_ARM_32 to guard
>     xenheap-specific behavior of populate_boot_allocator
>   - (MAINTAINERS) include all of common/device-tree rather than just
>     bootinfo.c
> ---
>  MAINTAINERS                                   |   3 +-
>  xen/arch/arm/include/asm/setup.h              | 185 +------
>  xen/arch/arm/setup.c                          | 432 -----------------
>  xen/common/Makefile                           |   2 +-
>  xen/common/device-tree/Makefile               |   2 +
>  xen/common/device-tree/bootinfo.c             | 459 ++++++++++++++++++
>  .../device-tree.c}                            |   0
>  xen/include/xen/bootfdt.h                     | 195 ++++++++
>  8 files changed, 660 insertions(+), 618 deletions(-)
>  create mode 100644 xen/common/device-tree/Makefile
>  create mode 100644 xen/common/device-tree/bootinfo.c
>  rename xen/common/{device_tree.c => device-tree/device-tree.c} (100%)
>  create mode 100644 xen/include/xen/bootfdt.h
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 7c524a8a93..89be48fdf9 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -291,9 +291,10 @@ M:	Bertrand Marquis <bertrand.marquis@arm.com>
>  M:	Michal Orzel <michal.orzel@amd.com>
>  S:	Supported
>  F:	xen/common/libfdt/
> -F:	xen/common/device_tree.c
> +F:	xen/common/device-tree/
>  F:	xen/common/dt-overlay.c
>  F:	xen/include/xen/libfdt/
> +F:	xen/include/xen/bootfdt.h
>  F:	xen/include/xen/device_tree.h
>  F:	xen/drivers/passthrough/device_tree.c
> 
> diff --git a/xen/arch/arm/include/asm/setup.h 
> b/xen/arch/arm/include/asm/setup.h
> index c34179da93..1748be29e5 100644
> --- a/xen/arch/arm/include/asm/setup.h
> +++ b/xen/arch/arm/include/asm/setup.h
> @@ -3,159 +3,11 @@
> 
>  #include <public/version.h>
>  #include <asm/p2m.h>
> +#include <xen/bootfdt.h>
>  #include <xen/device_tree.h>
> 
> -#define MIN_FDT_ALIGN 8
>  #define MAX_FDT_SIZE SZ_2M
> 
> -#define NR_MEM_BANKS 256
> -#define NR_SHMEM_BANKS 32
> -
> -#define MAX_MODULES 32 /* Current maximum useful modules */
> -
> -typedef enum {
> -    BOOTMOD_XEN,
> -    BOOTMOD_FDT,
> -    BOOTMOD_KERNEL,
> -    BOOTMOD_RAMDISK,
> -    BOOTMOD_XSM,
> -    BOOTMOD_GUEST_DTB,
> -    BOOTMOD_UNKNOWN
> -}  bootmodule_kind;
> -
> -enum membank_type {
> -    /*
> -     * The MEMBANK_DEFAULT type refers to either reserved memory for 
> the
> -     * device/firmware (when the bank is in 'reserved_mem') or any RAM 
> (when
> -     * the bank is in 'mem').
> -     */
> -    MEMBANK_DEFAULT,
> -    /*
> -     * The MEMBANK_STATIC_DOMAIN type is used to indicate whether the 
> memory
> -     * bank is bound to a static Xen domain. It is only valid when the 
> bank
> -     * is in reserved_mem.
> -     */
> -    MEMBANK_STATIC_DOMAIN,
> -    /*
> -     * The MEMBANK_STATIC_HEAP type is used to indicate whether the 
> memory
> -     * bank is reserved as static heap. It is only valid when the bank 
> is
> -     * in reserved_mem.
> -     */
> -    MEMBANK_STATIC_HEAP,
> -    /*
> -     * The MEMBANK_FDT_RESVMEM type is used to indicate whether the 
> memory
> -     * bank is from the FDT reserve map.
> -     */
> -    MEMBANK_FDT_RESVMEM,
> -};
> -
> -/* Indicates the maximum number of characters(\0 included) for shm_id 
> */
> -#define MAX_SHM_ID_LENGTH 16
> -
> -struct shmem_membank_extra {
> -    char shm_id[MAX_SHM_ID_LENGTH];
> -    unsigned int nr_shm_borrowers;
> -};
> -
> -struct membank {
> -    paddr_t start;
> -    paddr_t size;
> -    union {
> -        enum membank_type type;
> -#ifdef CONFIG_STATIC_SHM
> -        struct shmem_membank_extra *shmem_extra;
> -#endif
> -    };
> -};
> -
> -struct membanks {
> -    __struct_group(membanks_hdr, common, ,
> -        unsigned int nr_banks;
> -        unsigned int max_banks;
> -    );
> -    struct membank bank[];
> -};
> -
> -struct meminfo {
> -    struct membanks_hdr common;
> -    struct membank bank[NR_MEM_BANKS];
> -};
> -
> -struct shared_meminfo {
> -    struct membanks_hdr common;
> -    struct membank bank[NR_SHMEM_BANKS];
> -    struct shmem_membank_extra extra[NR_SHMEM_BANKS];
> -};
> -
> -/*
> - * The domU flag is set for kernels and ramdisks of "xen,domain" 
> nodes.
> - * The purpose of the domU flag is to avoid getting confused in
> - * kernel_probe, where we try to guess which is the dom0 kernel and
> - * initrd to be compatible with all versions of the multiboot spec.
> - */
> -#define BOOTMOD_MAX_CMDLINE 1024
> -struct bootmodule {
> -    bootmodule_kind kind;
> -    bool domU;
> -    paddr_t start;
> -    paddr_t size;
> -};
> -
> -/* DT_MAX_NAME is the node name max length according the DT spec */
> -#define DT_MAX_NAME 41
> -struct bootcmdline {
> -    bootmodule_kind kind;
> -    bool domU;
> -    paddr_t start;
> -    char dt_name[DT_MAX_NAME];
> -    char cmdline[BOOTMOD_MAX_CMDLINE];
> -};
> -
> -struct bootmodules {
> -    int nr_mods;
> -    struct bootmodule module[MAX_MODULES];
> -};
> -
> -struct bootcmdlines {
> -    unsigned int nr_mods;
> -    struct bootcmdline cmdline[MAX_MODULES];
> -};
> -
> -struct bootinfo {
> -    struct meminfo mem;
> -    /* The reserved regions are only used when booting using 
> Device-Tree */
> -    struct meminfo reserved_mem;
> -    struct bootmodules modules;
> -    struct bootcmdlines cmdlines;
> -#ifdef CONFIG_ACPI
> -    struct meminfo acpi;
> -#endif
> -#ifdef CONFIG_STATIC_SHM
> -    struct shared_meminfo shmem;
> -#endif
> -    bool static_heap;
> -};
> -
> -#ifdef CONFIG_ACPI
> -#define BOOTINFO_ACPI_INIT .acpi.common.max_banks = NR_MEM_BANKS,
> -#else
> -#define BOOTINFO_ACPI_INIT
> -#endif
> -
> -#ifdef CONFIG_STATIC_SHM
> -#define BOOTINFO_SHMEM_INIT .shmem.common.max_banks = NR_SHMEM_BANKS,
> -#else
> -#define BOOTINFO_SHMEM_INIT
> -#endif
> -
> -#define BOOTINFO_INIT                               \
> -{                                                   \
> -    .mem.common.max_banks = NR_MEM_BANKS,           \
> -    .reserved_mem.common.max_banks = NR_MEM_BANKS,  \
> -    BOOTINFO_ACPI_INIT                              \
> -    BOOTINFO_SHMEM_INIT                             \
> -}
> -
>  struct map_range_data
>  {
>      struct domain *d;
> @@ -167,39 +19,8 @@ struct map_range_data
>      struct rangeset *irq_ranges;
>  };
> 
> -extern struct bootinfo bootinfo;
> -
>  extern domid_t max_init_domid;
> 
> -static inline struct membanks *bootinfo_get_mem(void)
> -{
> -    return container_of(&bootinfo.mem.common, struct membanks, 
> common);
> -}
> -
> -static inline struct membanks *bootinfo_get_reserved_mem(void)
> -{
> -    return container_of(&bootinfo.reserved_mem.common, struct 
> membanks, common);
> -}
> -
> -#ifdef CONFIG_ACPI
> -static inline struct membanks *bootinfo_get_acpi(void)
> -{
> -    return container_of(&bootinfo.acpi.common, struct membanks, 
> common);
> -}
> -#endif
> -
> -#ifdef CONFIG_STATIC_SHM
> -static inline struct membanks *bootinfo_get_shmem(void)
> -{
> -    return container_of(&bootinfo.shmem.common, struct membanks, 
> common);
> -}
> -
> -static inline struct shmem_membank_extra 
> *bootinfo_get_shmem_extra(void)
> -{
> -    return bootinfo.shmem.extra;
> -}
> -#endif
> -
>  void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len);
> 
>  size_t estimate_efi_size(unsigned int mem_nr_banks);
> @@ -220,9 +41,6 @@ void fw_unreserved_regions(paddr_t s, paddr_t e,
>                             void (*cb)(paddr_t ps, paddr_t pe),
>                             unsigned int first);
> 
> -size_t boot_fdt_info(const void *fdt, paddr_t paddr);
> -const char *boot_fdt_cmdline(const void *fdt);
> -
>  bool check_reserved_regions_overlap(paddr_t region_start, paddr_t 
> region_size);
> 
>  struct bootmodule *add_boot_module(bootmodule_kind kind,
> @@ -237,7 +55,6 @@ struct bootcmdline * boot_cmdline_find_by_name(const 
> char *name);
>  const char *boot_module_kind_as_string(bootmodule_kind kind);
> 
>  void init_pdx(void);
> -void populate_boot_allocator(void);
>  void setup_mm(void);
> 
>  extern uint32_t hyp_traps_vector[];
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index 0c2fdaceaf..cb2c0a16b8 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -48,8 +48,6 @@
>  #include <xsm/xsm.h>
>  #include <asm/acpi.h>
> 
> -struct bootinfo __initdata bootinfo = BOOTINFO_INIT;
> -
>  /*
>   * Sanitized version of cpuinfo containing only features available on 
> all
>   * cores (only on arm64 as there is no sanitization support on arm32).
> @@ -203,321 +201,6 @@ static void __init processor_id(void)
>      processor_setup();
>  }
> 
> -static void __init dt_unreserved_regions(paddr_t s, paddr_t e,
> -                                         void (*cb)(paddr_t ps, 
> paddr_t pe),
> -                                         unsigned int first)
> -{
> -    const struct membanks *reserved_mem = bootinfo_get_reserved_mem();
> -#ifdef CONFIG_STATIC_SHM
> -    const struct membanks *shmem = bootinfo_get_shmem();
> -    unsigned int offset;
> -#endif
> -    unsigned int i;
> -
> -    /*
> -     * i is the current bootmodule we are evaluating across all 
> possible
> -     * kinds.
> -     */
> -    for ( i = first; i < reserved_mem->nr_banks; i++ )
> -    {
> -        paddr_t r_s = reserved_mem->bank[i].start;
> -        paddr_t r_e = r_s + reserved_mem->bank[i].size;
> -
> -        if ( s < r_e && r_s < e )
> -        {
> -            dt_unreserved_regions(r_e, e, cb, i + 1);
> -            dt_unreserved_regions(s, r_s, cb, i + 1);
> -            return;
> -        }
> -    }
> -
> -#ifdef CONFIG_STATIC_SHM
> -    /*
> -     * When retrieving the corresponding shared memory addresses
> -     * below, we need to index the shmem->bank starting from 0, hence
> -     * we need to use i - reserved_mem->nr_banks.
> -    */
> -    offset = reserved_mem->nr_banks;
> -    for ( ; i - offset < shmem->nr_banks; i++ )
> -    {
> -        paddr_t r_s, r_e;
> -
> -        r_s = shmem->bank[i - offset].start;
> -
> -        /* Shared memory banks can contain INVALID_PADDR as start */
> -        if ( INVALID_PADDR == r_s )
> -            continue;
> -
> -        r_e = r_s + shmem->bank[i - offset].size;
> -
> -        if ( s < r_e && r_s < e )
> -        {
> -            dt_unreserved_regions(r_e, e, cb, i + 1);
> -            dt_unreserved_regions(s, r_s, cb, i + 1);
> -            return;
> -        }
> -    }
> -#endif
> -
> -    cb(s, e);
> -}
> -
> -/*
> - * TODO: '*_end' could be 0 if the bank/region is at the end of the 
> physical
> - * address space. This is for now not handled as it requires more 
> rework.
> - */
> -static bool __init meminfo_overlap_check(const struct membanks *mem,
> -                                         paddr_t region_start,
> -                                         paddr_t region_size)
> -{
> -    paddr_t bank_start = INVALID_PADDR, bank_end = 0;
> -    paddr_t region_end = region_start + region_size;
> -    unsigned int i, bank_num = mem->nr_banks;
> -
> -    for ( i = 0; i < bank_num; i++ )
> -    {
> -        bank_start = mem->bank[i].start;
> -        bank_end = bank_start + mem->bank[i].size;
> -
> -        if ( INVALID_PADDR == bank_start || region_end <= bank_start 
> ||
> -             region_start >= bank_end )
> -            continue;
> -        else
> -        {
> -            printk("Region: [%#"PRIpaddr", %#"PRIpaddr") overlapping 
> with bank[%u]: [%#"PRIpaddr", %#"PRIpaddr")\n",
> -                   region_start, region_end, i, bank_start, bank_end);
> -            return true;
> -        }
> -    }
> -
> -    return false;
> -}
> -
> -/*
> - * TODO: '*_end' could be 0 if the module/region is at the end of the 
> physical
> - * address space. This is for now not handled as it requires more 
> rework.
> - */
> -static bool __init bootmodules_overlap_check(struct bootmodules 
> *bootmodules,
> -                                             paddr_t region_start,
> -                                             paddr_t region_size)
> -{
> -    paddr_t mod_start = INVALID_PADDR, mod_end = 0;
> -    paddr_t region_end = region_start + region_size;
> -    unsigned int i, mod_num = bootmodules->nr_mods;
> -
> -    for ( i = 0; i < mod_num; i++ )
> -    {
> -        mod_start = bootmodules->module[i].start;
> -        mod_end = mod_start + bootmodules->module[i].size;
> -
> -        if ( region_end <= mod_start || region_start >= mod_end )
> -            continue;
> -        else
> -        {
> -            printk("Region: [%#"PRIpaddr", %#"PRIpaddr") overlapping 
> with mod[%u]: [%#"PRIpaddr", %#"PRIpaddr")\n",
> -                   region_start, region_end, i, mod_start, mod_end);
> -            return true;
> -        }
> -    }
> -
> -    return false;
> -}
> -
> -void __init fw_unreserved_regions(paddr_t s, paddr_t e,
> -                                  void (*cb)(paddr_t ps, paddr_t pe),
> -                                  unsigned int first)
> -{
> -    if ( acpi_disabled )
> -        dt_unreserved_regions(s, e, cb, first);
> -    else
> -        cb(s, e);
> -}
> -
> -/*
> - * Given an input physical address range, check if this range is 
> overlapping
> - * with the existing reserved memory regions defined in bootinfo.
> - * Return true if the input physical address range is overlapping with 
> any
> - * existing reserved memory regions, otherwise false.
> - */
> -bool __init check_reserved_regions_overlap(paddr_t region_start,
> -                                           paddr_t region_size)
> -{
> -    const struct membanks *mem_banks[] = {
> -        bootinfo_get_reserved_mem(),
> -#ifdef CONFIG_ACPI
> -        bootinfo_get_acpi(),
> -#endif
> -#ifdef CONFIG_STATIC_SHM
> -        bootinfo_get_shmem(),
> -#endif
> -    };
> -    unsigned int i;
> -
> -    /*
> -     * Check if input region is overlapping with reserved memory banks 
> or
> -     * ACPI EfiACPIReclaimMemory (when ACPI feature is enabled) or 
> static
> -     * shared memory banks (when static shared memory feature is 
> enabled)
> -     */
> -    for ( i = 0; i < ARRAY_SIZE(mem_banks); i++ )
> -        if ( meminfo_overlap_check(mem_banks[i], region_start, 
> region_size) )
> -            return true;
> -
> -    /* Check if input region is overlapping with bootmodules */
> -    if ( bootmodules_overlap_check(&bootinfo.modules,
> -                                   region_start, region_size) )
> -        return true;
> -
> -    return false;
> -}
> -
> -struct bootmodule __init *add_boot_module(bootmodule_kind kind,
> -                                          paddr_t start, paddr_t size,
> -                                          bool domU)
> -{
> -    struct bootmodules *mods = &bootinfo.modules;
> -    struct bootmodule *mod;
> -    unsigned int i;
> -
> -    if ( mods->nr_mods == MAX_MODULES )
> -    {
> -        printk("Ignoring %s boot module at %"PRIpaddr"-%"PRIpaddr" 
> (too many)\n",
> -               boot_module_kind_as_string(kind), start, start + size);
> -        return NULL;
> -    }
> -
> -    if ( check_reserved_regions_overlap(start, size) )
> -        return NULL;
> -
> -    for ( i = 0 ; i < mods->nr_mods ; i++ )
> -    {
> -        mod = &mods->module[i];
> -        if ( mod->kind == kind && mod->start == start )
> -        {
> -            if ( !domU )
> -                mod->domU = false;
> -            return mod;
> -        }
> -    }
> -
> -    mod = &mods->module[mods->nr_mods++];
> -    mod->kind = kind;
> -    mod->start = start;
> -    mod->size = size;
> -    mod->domU = domU;
> -
> -    return mod;
> -}
> -
> -/*
> - * boot_module_find_by_kind can only be used to return Xen modules 
> (e.g
> - * XSM, DTB) or Dom0 modules. This is not suitable for looking up 
> guest
> - * modules.
> - */
> -struct bootmodule * __init boot_module_find_by_kind(bootmodule_kind 
> kind)
> -{
> -    struct bootmodules *mods = &bootinfo.modules;
> -    struct bootmodule *mod;
> -    int i;
> -    for (i = 0 ; i < mods->nr_mods ; i++ )
> -    {
> -        mod = &mods->module[i];
> -        if ( mod->kind == kind && !mod->domU )
> -            return mod;
> -    }
> -    return NULL;
> -}
> -
> -void __init add_boot_cmdline(const char *name, const char *cmdline,
> -                             bootmodule_kind kind, paddr_t start, bool 
> domU)
> -{
> -    struct bootcmdlines *cmds = &bootinfo.cmdlines;
> -    struct bootcmdline *cmd;
> -
> -    if ( cmds->nr_mods == MAX_MODULES )
> -    {
> -        printk("Ignoring %s cmdline (too many)\n", name);
> -        return;
> -    }
> -
> -    cmd = &cmds->cmdline[cmds->nr_mods++];
> -    cmd->kind = kind;
> -    cmd->domU = domU;
> -    cmd->start = start;
> -
> -    ASSERT(strlen(name) <= DT_MAX_NAME);
> -    safe_strcpy(cmd->dt_name, name);
> -
> -    if ( strlen(cmdline) > BOOTMOD_MAX_CMDLINE )
> -        panic("module %s command line too long\n", name);
> -    safe_strcpy(cmd->cmdline, cmdline);
> -}
> -
> -/*
> - * boot_cmdline_find_by_kind can only be used to return Xen modules 
> (e.g
> - * XSM, DTB) or Dom0 modules. This is not suitable for looking up 
> guest
> - * modules.
> - */
> -struct bootcmdline * __init boot_cmdline_find_by_kind(bootmodule_kind 
> kind)
> -{
> -    struct bootcmdlines *cmds = &bootinfo.cmdlines;
> -    struct bootcmdline *cmd;
> -    int i;
> -
> -    for ( i = 0 ; i < cmds->nr_mods ; i++ )
> -    {
> -        cmd = &cmds->cmdline[i];
> -        if ( cmd->kind == kind && !cmd->domU )
> -            return cmd;
> -    }
> -    return NULL;
> -}
> -
> -struct bootcmdline * __init boot_cmdline_find_by_name(const char 
> *name)
> -{
> -    struct bootcmdlines *mods = &bootinfo.cmdlines;
> -    struct bootcmdline *mod;
> -    unsigned int i;
> -
> -    for (i = 0 ; i < mods->nr_mods ; i++ )
> -    {
> -        mod = &mods->cmdline[i];
> -        if ( strcmp(mod->dt_name, name) == 0 )
> -            return mod;
> -    }
> -    return NULL;
> -}
> -
> -struct bootmodule * __init 
> boot_module_find_by_addr_and_kind(bootmodule_kind kind,
> -                                                             paddr_t 
> start)
> -{
> -    struct bootmodules *mods = &bootinfo.modules;
> -    struct bootmodule *mod;
> -    unsigned int i;
> -
> -    for (i = 0 ; i < mods->nr_mods ; i++ )
> -    {
> -        mod = &mods->module[i];
> -        if ( mod->kind == kind && mod->start == start )
> -            return mod;
> -    }
> -    return NULL;
> -}
> -
> -const char * __init boot_module_kind_as_string(bootmodule_kind kind)
> -{
> -    switch ( kind )
> -    {
> -    case BOOTMOD_XEN:     return "Xen";
> -    case BOOTMOD_FDT:     return "Device Tree";
> -    case BOOTMOD_KERNEL:  return "Kernel";
> -    case BOOTMOD_RAMDISK: return "Ramdisk";
> -    case BOOTMOD_XSM:     return "XSM";
> -    case BOOTMOD_GUEST_DTB:     return "DTB";
> -    case BOOTMOD_UNKNOWN: return "Unknown";
> -    default: BUG();
> -    }
> -}
> -
>  void __init discard_initial_modules(void)
>  {
>      struct bootmodules *mi = &bootinfo.modules;
> @@ -556,40 +239,6 @@ static void * __init relocate_fdt(paddr_t 
> dtb_paddr, size_t dtb_size)
>      return fdt;
>  }
> 
> -/*
> - * Return the end of the non-module region starting at s. In other
> - * words return s the start of the next modules after s.
> - *
> - * On input *end is the end of the region which should be considered
> - * and it is updated to reflect the end of the module, clipped to the
> - * end of the region if it would run over.
> - */
> -static paddr_t __init next_module(paddr_t s, paddr_t *end)
> -{
> -    struct bootmodules *mi = &bootinfo.modules;
> -    paddr_t lowest = ~(paddr_t)0;
> -    int i;
> -
> -    for ( i = 0; i < mi->nr_mods; i++ )
> -    {
> -        paddr_t mod_s = mi->module[i].start;
> -        paddr_t mod_e = mod_s + mi->module[i].size;
> -
> -        if ( !mi->module[i].size )
> -            continue;
> -
> -        if ( mod_s < s )
> -            continue;
> -        if ( mod_s > lowest )
> -            continue;
> -        if ( mod_s > *end )
> -            continue;
> -        lowest = mod_s;
> -        *end = min(*end, mod_e);
> -    }
> -    return lowest;
> -}
> -
>  void __init init_pdx(void)
>  {
>      const struct membanks *mem = bootinfo_get_mem();
> @@ -635,87 +284,6 @@ void __init init_pdx(void)
>      }
>  }
> 
> -/*
> - * Populate the boot allocator.
> - * If a static heap was not provided by the admin, all the RAM but the
> - * following regions will be added:
> - *  - Modules (e.g., Xen, Kernel)
> - *  - Reserved regions
> - *  - Xenheap (arm32 only)
> - * If a static heap was provided by the admin, populate the boot
> - * allocator with the corresponding regions only, but with Xenheap 
> excluded
> - * on arm32.
> - */
> -void __init populate_boot_allocator(void)
> -{
> -    unsigned int i;
> -    const struct membanks *banks = bootinfo_get_mem();
> -    const struct membanks *reserved_mem = bootinfo_get_reserved_mem();
> -    paddr_t s, e;
> -
> -    if ( bootinfo.static_heap )
> -    {
> -        for ( i = 0 ; i < reserved_mem->nr_banks; i++ )
> -        {
> -            if ( reserved_mem->bank[i].type != MEMBANK_STATIC_HEAP )
> -                continue;
> -
> -            s = reserved_mem->bank[i].start;
> -            e = s + reserved_mem->bank[i].size;
> -#ifdef CONFIG_ARM_32
> -            /* Avoid the xenheap, note that the xenheap cannot across 
> a bank */
> -            if ( s <= mfn_to_maddr(directmap_mfn_start) &&
> -                 e >= mfn_to_maddr(directmap_mfn_end) )
> -            {
> -                init_boot_pages(s, mfn_to_maddr(directmap_mfn_start));
> -                init_boot_pages(mfn_to_maddr(directmap_mfn_end), e);
> -            }
> -            else
> -#endif
> -                init_boot_pages(s, e);
> -        }
> -
> -        return;
> -    }
> -
> -    for ( i = 0; i < banks->nr_banks; i++ )
> -    {
> -        const struct membank *bank = &banks->bank[i];
> -        paddr_t bank_end = bank->start + bank->size;
> -
> -        s = bank->start;
> -        while ( s < bank_end )
> -        {
> -            paddr_t n = bank_end;
> -
> -            e = next_module(s, &n);
> -
> -            if ( e == ~(paddr_t)0 )
> -                e = n = bank_end;
> -
> -            /*
> -             * Module in a RAM bank other than the one which we are
> -             * not dealing with here.
> -             */
> -            if ( e > bank_end )
> -                e = bank_end;
> -
> -#ifdef CONFIG_ARM_32
> -            /* Avoid the xenheap */
> -            if ( s < mfn_to_maddr(directmap_mfn_end) &&
> -                 mfn_to_maddr(directmap_mfn_start) < e )
> -            {
> -                e = mfn_to_maddr(directmap_mfn_start);
> -                n = mfn_to_maddr(directmap_mfn_end);
> -            }
> -#endif
> -
> -            fw_unreserved_regions(s, e, init_boot_pages, 0);
> -            s = n;
> -        }
> -    }
> -}
> -
>  size_t __read_mostly dcache_line_bytes;
> 
>  /* C entry point for boot CPU */
> diff --git a/xen/common/Makefile b/xen/common/Makefile
> index f12a474d40..7e66802a9e 100644
> --- a/xen/common/Makefile
> +++ b/xen/common/Makefile
> @@ -6,7 +6,7 @@ obj-$(CONFIG_HYPFS_CONFIG) += config_data.o
>  obj-$(CONFIG_CORE_PARKING) += core_parking.o
>  obj-y += cpu.o
>  obj-$(CONFIG_DEBUG_TRACE) += debugtrace.o
> -obj-$(CONFIG_HAS_DEVICE_TREE) += device_tree.o
> +obj-$(CONFIG_HAS_DEVICE_TREE) += device-tree/
>  obj-$(CONFIG_IOREQ_SERVER) += dm.o
>  obj-y += domain.o
>  obj-$(CONFIG_OVERLAY_DTB) += dt-overlay.o
> diff --git a/xen/common/device-tree/Makefile 
> b/xen/common/device-tree/Makefile
> new file mode 100644
> index 0000000000..f813f7555f
> --- /dev/null
> +++ b/xen/common/device-tree/Makefile
> @@ -0,0 +1,2 @@
> +obj-y += bootinfo.init.o
> +obj-y += device-tree.o
> diff --git a/xen/common/device-tree/bootinfo.c 
> b/xen/common/device-tree/bootinfo.c
> new file mode 100644
> index 0000000000..f2e6a1145b
> --- /dev/null
> +++ b/xen/common/device-tree/bootinfo.c
> @@ -0,0 +1,459 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Derived from Xen 4.19's $xen/arch/arm/setup.c.
> + *
> + * bookkeeping routines.
> + *
> + * Tim Deegan <tim@xen.org>
> + * Copyright (c) 2011 Citrix Systems.
> + * Copyright (c) 2024 Raptor Engineering LLC
> + */
> +
> +#include <xen/acpi.h>
> +#include <xen/bootfdt.h>
> +#include <xen/bug.h>
> +#include <xen/device_tree.h>
> +#include <xen/init.h>
> +#include <xen/libfdt/libfdt-xen.h>
> +#include <xen/mm.h>
> +
> +struct bootinfo __initdata bootinfo = BOOTINFO_INIT;
> +
> +const char * __init boot_module_kind_as_string(bootmodule_kind kind)
> +{
> +    switch ( kind )
> +    {
> +    case BOOTMOD_XEN:     return "Xen";
> +    case BOOTMOD_FDT:     return "Device Tree";
> +    case BOOTMOD_KERNEL:  return "Kernel";
> +    case BOOTMOD_RAMDISK: return "Ramdisk";
> +    case BOOTMOD_XSM:     return "XSM";
> +    case BOOTMOD_GUEST_DTB:     return "DTB";
> +    case BOOTMOD_UNKNOWN: return "Unknown";
> +    default: BUG();
> +    }
> +}
> +
> +static void __init dt_unreserved_regions(paddr_t s, paddr_t e,
> +                                         void (*cb)(paddr_t ps, 
> paddr_t pe),
> +                                         unsigned int first)
> +{
> +    const struct membanks *reserved_mem = bootinfo_get_reserved_mem();
> +#ifdef CONFIG_STATIC_SHM
> +    const struct membanks *shmem = bootinfo_get_shmem();
> +    unsigned int offset;
> +#endif
> +    unsigned int i;
> +
> +    /*
> +     * i is the current bootmodule we are evaluating across all 
> possible
> +     * kinds.
> +     */
> +    for ( i = first; i < reserved_mem->nr_banks; i++ )
> +    {
> +        paddr_t r_s = reserved_mem->bank[i].start;
> +        paddr_t r_e = r_s + reserved_mem->bank[i].size;
> +
> +        if ( s < r_e && r_s < e )
> +        {
> +            dt_unreserved_regions(r_e, e, cb, i + 1);
> +            dt_unreserved_regions(s, r_s, cb, i + 1);
> +            return;
> +        }
> +    }
> +
> +#ifdef CONFIG_STATIC_SHM
> +    /*
> +     * When retrieving the corresponding shared memory addresses
> +     * below, we need to index the shmem->bank starting from 0, hence
> +     * we need to use i - reserved_mem->nr_banks.
> +    */
> +    offset = reserved_mem->nr_banks;
> +    for ( ; i - offset < shmem->nr_banks; i++ )
> +    {
> +        paddr_t r_s, r_e;
> +
> +        r_s = shmem->bank[i - offset].start;
> +
> +        /* Shared memory banks can contain INVALID_PADDR as start */
> +        if ( INVALID_PADDR == r_s )
> +            continue;
> +
> +        r_e = r_s + shmem->bank[i - offset].size;
> +
> +        if ( s < r_e && r_s < e )
> +        {
> +            dt_unreserved_regions(r_e, e, cb, i + 1);
> +            dt_unreserved_regions(s, r_s, cb, i + 1);
> +            return;
> +        }
> +    }
> +#endif
> +
> +    cb(s, e);
> +}
> +
> +/*
> + * TODO: '*_end' could be 0 if the bank/region is at the end of the 
> physical
> + * address space. This is for now not handled as it requires more 
> rework.
> + */
> +static bool __init meminfo_overlap_check(const struct membanks *mem,
> +                                         paddr_t region_start,
> +                                         paddr_t region_size)
> +{
> +    paddr_t bank_start = INVALID_PADDR, bank_end = 0;
> +    paddr_t region_end = region_start + region_size;
> +    unsigned int i, bank_num = mem->nr_banks;
> +
> +    for ( i = 0; i < bank_num; i++ )
> +    {
> +        bank_start = mem->bank[i].start;
> +        bank_end = bank_start + mem->bank[i].size;
> +
> +        if ( INVALID_PADDR == bank_start || region_end <= bank_start 
> ||
> +             region_start >= bank_end )
> +            continue;
> +        else
> +        {
> +            printk("Region: [%#"PRIpaddr", %#"PRIpaddr") overlapping 
> with bank[%u]: [%#"PRIpaddr", %#"PRIpaddr")\n",
> +                   region_start, region_end, i, bank_start, bank_end);
> +            return true;
> +        }
> +    }
> +
> +    return false;
> +}
> +
> +/*
> + * TODO: '*_end' could be 0 if the module/region is at the end of the 
> physical
> + * address space. This is for now not handled as it requires more 
> rework.
> + */
> +static bool __init bootmodules_overlap_check(struct bootmodules 
> *bootmodules,
> +                                             paddr_t region_start,
> +                                             paddr_t region_size)
> +{
> +    paddr_t mod_start = INVALID_PADDR, mod_end = 0;
> +    paddr_t region_end = region_start + region_size;
> +    unsigned int i, mod_num = bootmodules->nr_mods;
> +
> +    for ( i = 0; i < mod_num; i++ )
> +    {
> +        mod_start = bootmodules->module[i].start;
> +        mod_end = mod_start + bootmodules->module[i].size;
> +
> +        if ( region_end <= mod_start || region_start >= mod_end )
> +            continue;
> +        else
> +        {
> +            printk("Region: [%#"PRIpaddr", %#"PRIpaddr") overlapping 
> with mod[%u]: [%#"PRIpaddr", %#"PRIpaddr")\n",
> +                   region_start, region_end, i, mod_start, mod_end);
> +            return true;
> +        }
> +    }
> +
> +    return false;
> +}
> +
> +void __init fw_unreserved_regions(paddr_t s, paddr_t e,
> +                                  void (*cb)(paddr_t ps, paddr_t pe),
> +                                  unsigned int first)
> +{
> +    if ( acpi_disabled )
> +        dt_unreserved_regions(s, e, cb, first);
> +    else
> +        cb(s, e);
> +}
> +
> +/*
> + * Given an input physical address range, check if this range is 
> overlapping
> + * with the existing reserved memory regions defined in bootinfo.
> + * Return true if the input physical address range is overlapping with 
> any
> + * existing reserved memory regions, otherwise false.
> + */
> +bool __init check_reserved_regions_overlap(paddr_t region_start,
> +                                           paddr_t region_size)
> +{
> +    const struct membanks *mem_banks[] = {
> +        bootinfo_get_reserved_mem(),
> +#ifdef CONFIG_ACPI
> +        bootinfo_get_acpi(),
> +#endif
> +#ifdef CONFIG_STATIC_SHM
> +        bootinfo_get_shmem(),
> +#endif
> +    };
> +    unsigned int i;
> +
> +    /*
> +     * Check if input region is overlapping with reserved memory banks 
> or
> +     * ACPI EfiACPIReclaimMemory (when ACPI feature is enabled) or 
> static
> +     * shared memory banks (when static shared memory feature is 
> enabled)
> +     */
> +    for ( i = 0; i < ARRAY_SIZE(mem_banks); i++ )
> +        if ( meminfo_overlap_check(mem_banks[i], region_start, 
> region_size) )
> +            return true;
> +
> +    /* Check if input region is overlapping with bootmodules */
> +    if ( bootmodules_overlap_check(&bootinfo.modules,
> +                                   region_start, region_size) )
> +        return true;
> +
> +    return false;
> +}
> +
> +struct bootmodule __init *add_boot_module(bootmodule_kind kind,
> +                                          paddr_t start, paddr_t size,
> +                                          bool domU)
> +{
> +    struct bootmodules *mods = &bootinfo.modules;
> +    struct bootmodule *mod;
> +    unsigned int i;
> +
> +    if ( mods->nr_mods == MAX_MODULES )
> +    {
> +        printk("Ignoring %s boot module at %"PRIpaddr"-%"PRIpaddr" 
> (too many)\n",
> +               boot_module_kind_as_string(kind), start, start + size);
> +        return NULL;
> +    }
> +
> +    if ( check_reserved_regions_overlap(start, size) )
> +        return NULL;
> +
> +    for ( i = 0 ; i < mods->nr_mods ; i++ )
> +    {
> +        mod = &mods->module[i];
> +        if ( mod->kind == kind && mod->start == start )
> +        {
> +            if ( !domU )
> +                mod->domU = false;
> +            return mod;
> +        }
> +    }
> +
> +    mod = &mods->module[mods->nr_mods++];
> +    mod->kind = kind;
> +    mod->start = start;
> +    mod->size = size;
> +    mod->domU = domU;
> +
> +    return mod;
> +}
> +
> +/*
> + * boot_module_find_by_kind can only be used to return Xen modules 
> (e.g
> + * XSM, DTB) or Dom0 modules. This is not suitable for looking up 
> guest
> + * modules.
> + */
> +struct bootmodule * __init boot_module_find_by_kind(bootmodule_kind 
> kind)
> +{
> +    struct bootmodules *mods = &bootinfo.modules;
> +    struct bootmodule *mod;
> +    int i;
> +    for (i = 0 ; i < mods->nr_mods ; i++ )
> +    {
> +        mod = &mods->module[i];
> +        if ( mod->kind == kind && !mod->domU )
> +            return mod;
> +    }
> +    return NULL;
> +}
> +
> +void __init add_boot_cmdline(const char *name, const char *cmdline,
> +                             bootmodule_kind kind, paddr_t start, bool 
> domU)
> +{
> +    struct bootcmdlines *cmds = &bootinfo.cmdlines;
> +    struct bootcmdline *cmd;
> +
> +    if ( cmds->nr_mods == MAX_MODULES )
> +    {
> +        printk("Ignoring %s cmdline (too many)\n", name);
> +        return;
> +    }
> +
> +    cmd = &cmds->cmdline[cmds->nr_mods++];
> +    cmd->kind = kind;
> +    cmd->domU = domU;
> +    cmd->start = start;
> +
> +    ASSERT(strlen(name) <= DT_MAX_NAME);
> +    safe_strcpy(cmd->dt_name, name);
> +
> +    if ( strlen(cmdline) > BOOTMOD_MAX_CMDLINE )
> +        panic("module %s command line too long\n", name);
> +    safe_strcpy(cmd->cmdline, cmdline);
> +}
> +
> +/*
> + * boot_cmdline_find_by_kind can only be used to return Xen modules 
> (e.g
> + * XSM, DTB) or Dom0 modules. This is not suitable for looking up 
> guest
> + * modules.
> + */
> +struct bootcmdline * __init boot_cmdline_find_by_kind(bootmodule_kind 
> kind)
> +{
> +    struct bootcmdlines *cmds = &bootinfo.cmdlines;
> +    struct bootcmdline *cmd;
> +    int i;
> +
> +    for ( i = 0 ; i < cmds->nr_mods ; i++ )
> +    {
> +        cmd = &cmds->cmdline[i];
> +        if ( cmd->kind == kind && !cmd->domU )
> +            return cmd;
> +    }
> +    return NULL;
> +}
> +
> +struct bootcmdline * __init boot_cmdline_find_by_name(const char 
> *name)
> +{
> +    struct bootcmdlines *mods = &bootinfo.cmdlines;
> +    struct bootcmdline *mod;
> +    unsigned int i;
> +
> +    for (i = 0 ; i < mods->nr_mods ; i++ )
> +    {
> +        mod = &mods->cmdline[i];
> +        if ( strcmp(mod->dt_name, name) == 0 )
> +            return mod;
> +    }
> +    return NULL;
> +}
> +
> +struct bootmodule * __init 
> boot_module_find_by_addr_and_kind(bootmodule_kind kind,
> +                                                             paddr_t 
> start)
> +{
> +    struct bootmodules *mods = &bootinfo.modules;
> +    struct bootmodule *mod;
> +    unsigned int i;
> +
> +    for (i = 0 ; i < mods->nr_mods ; i++ )
> +    {
> +        mod = &mods->module[i];
> +        if ( mod->kind == kind && mod->start == start )
> +            return mod;
> +    }
> +    return NULL;
> +}
> +
> +/*
> + * Return the end of the non-module region starting at s. In other
> + * words return s the start of the next modules after s.
> + *
> + * On input *end is the end of the region which should be considered
> + * and it is updated to reflect the end of the module, clipped to the
> + * end of the region if it would run over.
> + */
> +static paddr_t __init next_module(paddr_t s, paddr_t *end)
> +{
> +    struct bootmodules *mi = &bootinfo.modules;
> +    paddr_t lowest = ~(paddr_t)0;
> +    int i;
> +
> +    for ( i = 0; i < mi->nr_mods; i++ )
> +    {
> +        paddr_t mod_s = mi->module[i].start;
> +        paddr_t mod_e = mod_s + mi->module[i].size;
> +
> +        if ( !mi->module[i].size )
> +            continue;
> +
> +        if ( mod_s < s )
> +            continue;
> +        if ( mod_s > lowest )
> +            continue;
> +        if ( mod_s > *end )
> +            continue;
> +        lowest = mod_s;
> +        *end = min(*end, mod_e);
> +    }
> +    return lowest;
> +}
> +
> +/*
> + * Populate the boot allocator.
> + * If a static heap was not provided by the admin, all the RAM but the
> + * following regions will be added:
> + *  - Modules (e.g., Xen, Kernel)
> + *  - Reserved regions
> + *  - Xenheap (CONFIG_SEPARATE_XENHEAP only)
> + * If a static heap was provided by the admin, populate the boot
> + * allocator with the corresponding regions only, but with Xenheap 
> excluded
> + * on CONFIG_SEPARATE_XENHEAP.
> + */
> +void __init populate_boot_allocator(void)
> +{
> +    unsigned int i;
> +    const struct membanks *banks = bootinfo_get_mem();
> +    const struct membanks *reserved_mem = bootinfo_get_reserved_mem();
> +    paddr_t s, e;
> +
> +    if ( bootinfo.static_heap )
> +    {
> +        for ( i = 0 ; i < reserved_mem->nr_banks; i++ )
> +        {
> +            if ( reserved_mem->bank[i].type != MEMBANK_STATIC_HEAP )
> +                continue;
> +
> +            s = reserved_mem->bank[i].start;
> +            e = s + reserved_mem->bank[i].size;
> +#ifdef CONFIG_SEPARATE_XENHEAP
> +            /* Avoid the xenheap, note that the xenheap cannot across 
> a bank */
> +            if ( s <= mfn_to_maddr(directmap_mfn_start) &&
> +                 e >= mfn_to_maddr(directmap_mfn_end) )
> +            {
> +                init_boot_pages(s, mfn_to_maddr(directmap_mfn_start));
> +                init_boot_pages(mfn_to_maddr(directmap_mfn_end), e);
> +            }
> +            else
> +#endif
> +                init_boot_pages(s, e);
> +        }
> +
> +        return;
> +    }
> +
> +    for ( i = 0; i < banks->nr_banks; i++ )
> +    {
> +        const struct membank *bank = &banks->bank[i];
> +        paddr_t bank_end = bank->start + bank->size;
> +
> +        s = bank->start;
> +        while ( s < bank_end )
> +        {
> +            paddr_t n = bank_end;
> +
> +            e = next_module(s, &n);
> +
> +            if ( e == ~(paddr_t)0 )
> +                e = n = bank_end;
> +
> +            /*
> +             * Module in a RAM bank other than the one which we are
> +             * not dealing with here.
> +             */
> +            if ( e > bank_end )
> +                e = bank_end;
> +
> +#ifdef CONFIG_SEPARATE_XENHEAP
> +            /* Avoid the xenheap */
> +            if ( s < mfn_to_maddr(directmap_mfn_end) &&
> +                 mfn_to_maddr(directmap_mfn_start) < e )
> +            {
> +                e = mfn_to_maddr(directmap_mfn_start);
> +                n = mfn_to_maddr(directmap_mfn_end);
> +            }
> +#endif
> +
> +            fw_unreserved_regions(s, e, init_boot_pages, 0);
> +            s = n;
> +        }
> +    }
> +}
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> diff --git a/xen/common/device_tree.c 
> b/xen/common/device-tree/device-tree.c
> similarity index 100%
> rename from xen/common/device_tree.c
> rename to xen/common/device-tree/device-tree.c
> diff --git a/xen/include/xen/bootfdt.h b/xen/include/xen/bootfdt.h
> new file mode 100644
> index 0000000000..c39428d5f5
> --- /dev/null
> +++ b/xen/include/xen/bootfdt.h
> @@ -0,0 +1,195 @@
> +#ifndef XEN_BOOTFDT_H
> +#define XEN_BOOTFDT_H
> +
> +#include <xen/types.h>
> +#include <xen/kernel.h>
> +#include <xen/macros.h>
> +
> +#define MIN_FDT_ALIGN 8
> +
> +#define NR_MEM_BANKS 256
> +#define NR_SHMEM_BANKS 32
> +
> +#define MAX_MODULES 32 /* Current maximum useful modules */
> +
> +typedef enum {
> +    BOOTMOD_XEN,
> +    BOOTMOD_FDT,
> +    BOOTMOD_KERNEL,
> +    BOOTMOD_RAMDISK,
> +    BOOTMOD_XSM,
> +    BOOTMOD_GUEST_DTB,
> +    BOOTMOD_UNKNOWN
> +}  bootmodule_kind;
> +
> +enum membank_type {
> +    /*
> +     * The MEMBANK_DEFAULT type refers to either reserved memory for 
> the
> +     * device/firmware (when the bank is in 'reserved_mem') or any RAM 
> (when
> +     * the bank is in 'mem').
> +     */
> +    MEMBANK_DEFAULT,
> +    /*
> +     * The MEMBANK_STATIC_DOMAIN type is used to indicate whether the 
> memory
> +     * bank is bound to a static Xen domain. It is only valid when the 
> bank
> +     * is in reserved_mem.
> +     */
> +    MEMBANK_STATIC_DOMAIN,
> +    /*
> +     * The MEMBANK_STATIC_HEAP type is used to indicate whether the 
> memory
> +     * bank is reserved as static heap. It is only valid when the bank 
> is
> +     * in reserved_mem.
> +     */
> +    MEMBANK_STATIC_HEAP,
> +    /*
> +     * The MEMBANK_FDT_RESVMEM type is used to indicate whether the 
> memory
> +     * bank is from the FDT reserve map.
> +     */
> +    MEMBANK_FDT_RESVMEM,
> +};
> +
> +/* Indicates the maximum number of characters(\0 included) for shm_id 
> */
> +#define MAX_SHM_ID_LENGTH 16
> +
> +struct shmem_membank_extra {
> +    char shm_id[MAX_SHM_ID_LENGTH];
> +    unsigned int nr_shm_borrowers;
> +};
> +
> +struct membank {
> +    paddr_t start;
> +    paddr_t size;
> +    union {
> +        enum membank_type type;
> +#ifdef CONFIG_STATIC_SHM
> +        struct shmem_membank_extra *shmem_extra;
> +#endif
> +    };
> +};
> +
> +struct membanks {
> +    __struct_group(membanks_hdr, common, ,
> +        unsigned int nr_banks;
> +        unsigned int max_banks;
> +    );
> +    struct membank bank[];
> +};
> +
> +struct meminfo {
> +    struct membanks_hdr common;
> +    struct membank bank[NR_MEM_BANKS];
> +};
> +
> +struct shared_meminfo {
> +    struct membanks_hdr common;
> +    struct membank bank[NR_SHMEM_BANKS];
> +    struct shmem_membank_extra extra[NR_SHMEM_BANKS];
> +};
> +
> +/*
> + * The domU flag is set for kernels and ramdisks of "xen,domain" 
> nodes.
> + * The purpose of the domU flag is to avoid getting confused in
> + * kernel_probe, where we try to guess which is the dom0 kernel and
> + * initrd to be compatible with all versions of the multiboot spec.
> + */
> +#define BOOTMOD_MAX_CMDLINE 1024
> +struct bootmodule {
> +    bootmodule_kind kind;
> +    bool domU;
> +    paddr_t start;
> +    paddr_t size;
> +};
> +
> +/* DT_MAX_NAME is the node name max length according the DT spec */
> +#define DT_MAX_NAME 41
> +struct bootcmdline {
> +    bootmodule_kind kind;
> +    bool domU;
> +    paddr_t start;
> +    char dt_name[DT_MAX_NAME];
> +    char cmdline[BOOTMOD_MAX_CMDLINE];
> +};
> +
> +struct bootmodules {
> +    int nr_mods;
> +    struct bootmodule module[MAX_MODULES];
> +};
> +
> +struct bootcmdlines {
> +    unsigned int nr_mods;
> +    struct bootcmdline cmdline[MAX_MODULES];
> +};
> +
> +struct bootinfo {
> +    struct meminfo mem;
> +    /* The reserved regions are only used when booting using 
> Device-Tree */
> +    struct meminfo reserved_mem;
> +    struct bootmodules modules;
> +    struct bootcmdlines cmdlines;
> +#ifdef CONFIG_ACPI
> +    struct meminfo acpi;
> +#endif
> +#ifdef CONFIG_STATIC_SHM
> +    struct shared_meminfo shmem;
> +#endif
> +    bool static_heap;
> +};
> +
> +#ifdef CONFIG_ACPI
> +#define BOOTINFO_ACPI_INIT .acpi.common.max_banks = NR_MEM_BANKS,
> +#else
> +#define BOOTINFO_ACPI_INIT
> +#endif
> +
> +#ifdef CONFIG_STATIC_SHM
> +#define BOOTINFO_SHMEM_INIT .shmem.common.max_banks = NR_SHMEM_BANKS,
> +#else
> +#define BOOTINFO_SHMEM_INIT
> +#endif
> +
> +#define BOOTINFO_INIT                               \
> +{                                                   \
> +    .mem.common.max_banks = NR_MEM_BANKS,           \
> +    .reserved_mem.common.max_banks = NR_MEM_BANKS,  \
> +    BOOTINFO_ACPI_INIT                              \
> +    BOOTINFO_SHMEM_INIT                             \
> +}
> +
> +extern struct bootinfo bootinfo;
> +
> +void populate_boot_allocator(void);
> +
> +size_t boot_fdt_info(const void *fdt, paddr_t paddr);
> +
> +const char *boot_fdt_cmdline(const void *fdt);
> +
> +static inline struct membanks *bootinfo_get_reserved_mem(void)
> +{
> +    return container_of(&bootinfo.reserved_mem.common, struct 
> membanks, common);
> +}
> +
> +static inline struct membanks *bootinfo_get_mem(void)
> +{
> +    return container_of(&bootinfo.mem.common, struct membanks, 
> common);
> +}
> +
> +#ifdef CONFIG_ACPI
> +static inline struct membanks *bootinfo_get_acpi(void)
> +{
> +    return container_of(&bootinfo.acpi.common, struct membanks, 
> common);
> +}
> +#endif
> +
> +#ifdef CONFIG_STATIC_SHM
> +static inline struct membanks *bootinfo_get_shmem(void)
> +{
> +    return container_of(&bootinfo.shmem.common, struct membanks, 
> common);
> +}
> +
> +static inline struct shmem_membank_extra 
> *bootinfo_get_shmem_extra(void)
> +{
> +    return bootinfo.shmem.extra;
> +}
> +#endif
> +
> +#endif /* XEN_BOOTFDT_H */

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 13:40:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 13:40:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773490.1183920 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbgtw-00043u-4D; Wed, 07 Aug 2024 13:40:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773490.1183920; Wed, 07 Aug 2024 13:40:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbgtw-00043n-1c; Wed, 07 Aug 2024 13:40:28 +0000
Received: by outflank-mailman (input) for mailman id 773490;
 Wed, 07 Aug 2024 13:40:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ZlkY=PG=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1sbgtu-00043g-Sv
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 13:40:27 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on20601.outbound.protection.outlook.com
 [2a01:111:f403:2415::601])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 991764d3-54c2-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 15:40:25 +0200 (CEST)
Received: from BYAPR06CA0064.namprd06.prod.outlook.com (2603:10b6:a03:14b::41)
 by PH8PR12MB7254.namprd12.prod.outlook.com (2603:10b6:510:225::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Wed, 7 Aug
 2024 13:40:18 +0000
Received: from SJ5PEPF00000206.namprd05.prod.outlook.com
 (2603:10b6:a03:14b:cafe::16) by BYAPR06CA0064.outlook.office365.com
 (2603:10b6:a03:14b::41) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26 via Frontend
 Transport; Wed, 7 Aug 2024 13:40:18 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SJ5PEPF00000206.mail.protection.outlook.com (10.167.244.39) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Wed, 7 Aug 2024 13:40:17 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 7 Aug
 2024 08:40:17 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 7 Aug
 2024 08:40:16 -0500
Received: from [172.24.53.91] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 7 Aug 2024 08:40:16 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 991764d3-54c2-11ef-bc04-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=w/dQSxfXwMJhZG+3RaJ6mOOMnslrf1n3Zmq/Pl5DksX+kIlRxlQDCYspKbGSjE1Pp3B0hwBVs2oQJw24AKCDUIIkwKDZu0qpc5LQ9d9TM2pPgk6YA8ri/Ovznjrx/3FyEtJId5jCki895yhjKVurZPthHCK93EvcQ2JbvfFkgC5uldg/TXWr9CBO4PEqTQMFVMnd0Cce24bk+hGl8Jsmyds2o/P/H9aP9khvDNVlsglG0qhDPbjn/oz2vTsgKoOzM+54KbmI2+W/r4qRc5KXrUp34JsEQTA3jXgAMj1JrOBx9fSTdOT0qAOHdiiGF9FG1TT8SATFhXrUS06be3RHGw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=SQACBxpLx/CTvpuGh/6cQ1UFrJR4k4WszKJBVkwALMU=;
 b=hMQR88RJpphpJoY03WtCmziPVDYOiCXSHDmh4TgvWxCxf1eb4wYjq1s5oJktC8IcTQwKsdzjSjip+8SlboowwQbCQO4+ztNmsujdD+75/C91KWlzADvvf6pR0VGRdXs/i/nJTdelQswbfn/XJ0V0NNm5wAv8u0Kwq8kwIMtVpzMAZDpZ+MkCM/4fxmAJKt6+V1gL+0IjwdjMNc0I9NqLbXLVPLOBxK4z3eDl9kaVEGYRVC0dcea5EVSGRk0SordomjhBG/2Pu9QRMsyMB4m02DnW3oL/+/dswRqeZGSBqj5L1mk+k7pfrAz+annzXXH8rSI8r1NCpHMOP/1QdPZ6jA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=SQACBxpLx/CTvpuGh/6cQ1UFrJR4k4WszKJBVkwALMU=;
 b=LLZODVyoFdAvjZ9Mi0mvDriqcpzfKkK8mhTwATXQPE0ARE3bcNiXvxAkstomy1xoaiz5vtQw/no1Yz6eeHo1usXC8FeffpzET3zB6vtCbaEAfZ3TVgqNe8CqIvcMlKlO4viNbdMc/FIO2e1f0v+Pfb1S7YtqDIwiNKBTIP+Se6k=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <de6ecf5f-8c82-4583-aa5d-f81505c01969@amd.com>
Date: Wed, 7 Aug 2024 09:40:29 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] libxl/disk: avoid aliasing of abs()
To: Jan Beulich <jbeulich@suse.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
CC: Anthony PERARD <anthony.perard@vates.tech>, Juergen Gross
	<jgross@suse.com>
References: <ad3b9873-b478-4448-8395-498399040324@suse.com>
Content-Language: en-US
From: Jason Andryuk <jason.andryuk@amd.com>
In-Reply-To: <ad3b9873-b478-4448-8395-498399040324@suse.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF00000206:EE_|PH8PR12MB7254:EE_
X-MS-Office365-Filtering-Correlation-Id: d53de4ad-7411-4bbf-a36d-08dcb6e679b3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?Yjk0U2tBd0FhVm1ZWkRZS0xINU04amo2b3FBRkljR2NKOUZiVWJic1dxOUFN?=
 =?utf-8?B?UEk5bHBGdTRSdFUzcXptR3NCaXlBWjl4SnZXajY4YlJXSGdzc1VFVGp6bHBo?=
 =?utf-8?B?c2xMK3crTjVlRHNBNC9VVWxaWnMyY1BVR2dTWStyTTFGZEo3WmdKSFN4Vko3?=
 =?utf-8?B?U3RHOTQxM3JKTHZvcVJsRDdNK2ZjNzhveHlrT2ZVWmI5SHFodjRRaVI1bEtP?=
 =?utf-8?B?NW5RSnBKMXIvd1p6UkV1a0pmRm9BTlQ1TjZFdW5QM05iajJPU2dUNHBNT3Js?=
 =?utf-8?B?Ty90TTZ6akliVVA1RVhGOGNMeEM4YlV6UUQ5STBCcTFRZTRFNlFKeEVPMnQy?=
 =?utf-8?B?am94bVRxckFlS2VWTXlFOU9OajJscUlyY2JPQ1NuaCsySTlpMGxwdVhheWM3?=
 =?utf-8?B?V3h4aXZDUjRiaXVkN0FVYk83SkxveEEvY0VBQ0tNREo4R1EyZTF6QzdCWkJJ?=
 =?utf-8?B?UnYxTG9JTjJ5cm1YQTZTNW5wbkdRNVBja1hvekVrdXB5Ri9wY2lyMU9PcFJi?=
 =?utf-8?B?OXR4MzJtUGVTQjlQLzlOQXd6cUtoUFg2ZmFzVmlObHFGaW00Tnc4Wk9uaWtu?=
 =?utf-8?B?K25scHJkU1JMTDJmYTF3L0c4WFl5NmZDM3dFZWhMYjV1RHMvNzZUQ2tFY3I2?=
 =?utf-8?B?cXFrakpmVm11OVBqem9IMDhUWnczZjVwVjhaWS9vd2Z5bXMvTG1mUXg0c3Bi?=
 =?utf-8?B?RG5ucmp3MlArdDlNQWRMQ1d5dnFFbkJ4aFhONVBLRFczNGtlQm9NbmdWeGhw?=
 =?utf-8?B?eDQyYjVVRzVNM3Bpb3RvcVJ2b2EwTVRQcDFoSlFxblVwWDhUZURYcFhSb21j?=
 =?utf-8?B?Y2NZNy9hUkZ5SFZnVjl5V2JLQi9CVGszcUpqdWMzNFR5dTJ4ZkVPQWsrWC9D?=
 =?utf-8?B?U2Zta2l4R01hMDhEdGp3aEFXTElqYWJFaHAyejl3MHN4OUFWTGNJWStvQXJk?=
 =?utf-8?B?SldDWlF5amh3d1k0azUxcnJKOTlKMXdYY3RxUzV1bndEWmVWcmtOMHIySXBM?=
 =?utf-8?B?R1VGNEMwU1pkenBQY0xQOVVIUHVnVGJnVUpMY2VCVllORmIvdlRack12VFN4?=
 =?utf-8?B?NjF5QWpzRzd2bUtuNnkxOHdteWNHTVlSUGJoOG5qRTZ5S1J1QS8xMEx4MXQ2?=
 =?utf-8?B?YkFsYUlCdTRTVHNhelhzSlpPblNWZ2RrV01vKzQrYXBZSTU1YzA5VUk0eE13?=
 =?utf-8?B?dEVQeThUU2dWa0NNVnJmRVlUWWRJNFp5SFNmZ2xQTkpzWGJLZExibjZJa0Fr?=
 =?utf-8?B?KzczL0pBeXI4TXA2eFdmOEZEa1pZOGF1dU8wcFg5K3pCVEJ3Z25VSUdzcFZl?=
 =?utf-8?B?cmJoUStNT255eUhMVnBWMVJ1bzk0NUhna0R6NkZFbnAxUVFWVENYWE5RNUp2?=
 =?utf-8?B?b2NSY3ZJb0orSXdWZ28rVTRTM0dDcmdPK1M3WlN6Y09OaXE3V2FGbE1DdGxx?=
 =?utf-8?B?b01wa2tJRWhRNlBIeEhMQWxONmprc2E3cEQxQ2RVUU1haFlPSE9xRHhHTkcw?=
 =?utf-8?B?ZU9YeE1VQTNRUUFOUC9rLzlmbGRmWlpoUTFQeUNKU0h5eFFnMnR6Sk4rNTFF?=
 =?utf-8?B?Qk1laVZxMVJ1WTdyTDI2dHNtN09qNk02TXRNcDJyMU44YU5BY3RNNlRIY1I1?=
 =?utf-8?B?UmNaeGV5SmpMVWw4NjdrdVNRaEZSS3YxT0QzV05lNGNFdS9tVDlpcUxIZ2xS?=
 =?utf-8?B?UkhmN054Qmk5dFV0RVRHdVZnWkw4eUpDbUNHWlI1L3VYd0Y0WXZzTWU5ZGFY?=
 =?utf-8?B?VVc5dHZ5QjJsNmJWNEtJbExDckR2Z1czbE1xc21Ob1pKL3JQcUE4RldnWXl0?=
 =?utf-8?B?N2xhQlVyU3liT1Q2UzVLNjRvU2wyS1hQU2tBOFptcXZvWlNmVEtOL1Q4MnM0?=
 =?utf-8?B?Y3J2ZW9uZmx1T25vRTRmQTJKVStEbVhMcFc1Zis3L0lGZXhtNzVRbjlEWjQr?=
 =?utf-8?Q?VWhl9mWSpbDR8Idddjnl6qAQ3hzy74Zp?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2024 13:40:17.8754
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d53de4ad-7411-4bbf-a36d-08dcb6e679b3
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF00000206.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7254

On 2024-08-06 04:40, Jan Beulich wrote:
> Tool chains with -Wshadow enabled by default won't like the function
> parameter name "abs", for aliasing stdlib.h's abs(). Rename the
> parameter to what other similar functions use.
> 
> Fixes: a18b50614d97 ("libxl: Enable stubdom cdrom changing")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>

Thanks,
Jason


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 13:48:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 13:48:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773501.1183960 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbh1y-0005qC-Ij; Wed, 07 Aug 2024 13:48:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773501.1183960; Wed, 07 Aug 2024 13:48:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbh1y-0005pG-FR; Wed, 07 Aug 2024 13:48:46 +0000
Received: by outflank-mailman (input) for mailman id 773501;
 Wed, 07 Aug 2024 13:48:45 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=nE80=PG=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sbh1x-0005AD-7r
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 13:48:45 +0000
Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com
 [2a00:1450:4864:20::536])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c2d5edc2-54c3-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 15:48:43 +0200 (CEST)
Received: by mail-ed1-x536.google.com with SMTP id
 4fb4d7f45d1cf-5af51684d52so2139034a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 06:48:43 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b83960f353sm7017710a12.15.2024.08.07.06.48.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 07 Aug 2024 06:48:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c2d5edc2-54c3-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723038523; x=1723643323; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=6ss20XkPoOS/17MJ2dIfZqErwnJ4zQ6MM+H++oOIE0s=;
        b=RsJ/oxCBXDZjOo6aTCy7P52KXLoHF0bMgk3jQCQuPmRxpDzo1dSkDk5Nmi4d/zrf4x
         Py37kFqTczOaBcS7dZLcM141TeAQKkoB4JlrxDUvbIKtjIC7h2sGVcLFMedSpdymynXY
         kolwpFcbCjui/g6sPOkSlKgWYNOJRsxNZWc6M=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723038523; x=1723643323;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=6ss20XkPoOS/17MJ2dIfZqErwnJ4zQ6MM+H++oOIE0s=;
        b=JVHKYraNbwEtI8D+cLoRtnWPBZj+wJPCA7AXrASwjL+JhzEd3ydOMjwRD+TC/42Nrc
         ZEUsFMHMvXO/giEBO30xEkcVtkd7BrDtLYC8wzE+oijXrh0qB7ghdKPUZdRyEfFaKqtf
         JSQvNGp7XnfWy+pCXNH4dWBqxeqslmd4m/u5Cx6NaeU9jtSKuUAjxeXeBsZjDfvCDVqX
         j/l7ZMLTYGEEkrRK0ofxXxaI5GHtRob/URrMGxPPx99s5/axwntEzIo2JhZUN/M/mjfr
         usla7QhOYRgeQXDBIlufE/PlzUJ/qlI46BLtXRUpckDIllVPLEaxfv68hcbeLzLAUhCl
         A5mg==
X-Gm-Message-State: AOJu0Yw0NRT+kziN9Ip7ahNDKXo9DlnNiAFATbWPjr1WKza70fUfW5k2
	qcaLtPhpN4MJcCi9wvUdrc+uFkm8U62ibfedmOTs7yEUNdHzRwW6pUSaRKLo51mnLuB/TOyiKcR
	C
X-Google-Smtp-Source: AGHT+IHCXTM5fGaE9/iFzHECw4HaTuzn5M6eXxe17YBVWA7pFfxIaCBP3tiSHOseOczCK8WOgg8Oog==
X-Received: by 2002:a50:ff0b:0:b0:5a0:f8a2:9cf4 with SMTP id 4fb4d7f45d1cf-5b7f5129b4bmr12290625a12.25.1723038522669;
        Wed, 07 Aug 2024 06:48:42 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH 3/5] x86: Set xen_phys_start and trampoline_xen_phys_start earlier
Date: Wed,  7 Aug 2024 14:48:17 +0100
Message-ID: <20240807134819.8987-4-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

No reason to wait, if Xen image is loaded by EFI (not multiboot
EFI path) these are set in efi_arch_load_addr_check, but
not in the multiboot EFI code path.
This change makes the 2 code paths more similar and allows
the usage of these variables if needed.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/head.S | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 296f76146a..5b82221038 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -259,6 +259,11 @@ __efi64_mb2_start:
         jmp     x86_32_switch
 
 .Lefi_multiboot2_proto:
+        /* Save Xen image load base address for later use. */
+        lea     __image_base__(%rip),%rsi
+        movq    %rsi, xen_phys_start(%rip)
+        movl    %esi, trampoline_xen_phys_start(%rip)
+
         /* Zero EFI SystemTable, EFI ImageHandle addresses and cmdline. */
         xor     %esi,%esi
         xor     %edi,%edi
@@ -605,10 +610,6 @@ trampoline_setup:
          * Called on legacy BIOS and EFI platforms.
          */
 
-        /* Save Xen image load base address for later use. */
-        mov     %esi, sym_esi(xen_phys_start)
-        mov     %esi, sym_esi(trampoline_xen_phys_start)
-
         /* Get bottom-most low-memory stack address. */
         mov     sym_esi(trampoline_phys), %ecx
         add     $TRAMPOLINE_SPACE,%ecx
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 13:48:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 13:48:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773498.1183932 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbh1w-0005Ab-TG; Wed, 07 Aug 2024 13:48:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773498.1183932; Wed, 07 Aug 2024 13:48:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbh1w-0005AU-Os; Wed, 07 Aug 2024 13:48:44 +0000
Received: by outflank-mailman (input) for mailman id 773498;
 Wed, 07 Aug 2024 13:48:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=nE80=PG=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sbh1u-0005AD-TV
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 13:48:42 +0000
Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com
 [2a00:1450:4864:20::22b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c1361343-54c3-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 15:48:41 +0200 (CEST)
Received: by mail-lj1-x22b.google.com with SMTP id
 38308e7fff4ca-2ef32fea28dso20003881fa.2
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 06:48:41 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b83960f353sm7017710a12.15.2024.08.07.06.48.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 07 Aug 2024 06:48:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c1361343-54c3-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723038520; x=1723643320; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=IFxLqYHEKLum9CCtuJaF9+4IfFws5JZ6DONkQLdXj6E=;
        b=kinrW5Ge/7yOwYzIESa4NTIa2Hwspi5YVnBdznwwjDS4AjLiqTlo0nXIfHKs4xEuhS
         6DoL47Y+e2LmKUaIJ2iGQ3p66veB/PhBXvKOTM3kxT33im8WeffPQphO0/6ED/8rAUTs
         I8AvStIXY1n/XHlwtA+JseDNKPtk511yQiRPY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723038520; x=1723643320;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=IFxLqYHEKLum9CCtuJaF9+4IfFws5JZ6DONkQLdXj6E=;
        b=onS1J03g5Z3WUnR2+tTVFTstwIg4ice/UemQE22EiSXvJFKwAXlbms1b25phTjJKem
         DnBexHAm0OsIu7+jH5vdc5D2S6u/KNxO4q8xRxaJyUtLMFqIstOquyNfbF3+Dh0Umo60
         Qb71sBGOAAYpPSVZizXINYY84ls2LSGzbWJ5v3Rc8zHNWfO0bD+OrPszRH977mJeChRR
         U4jWpwXjSGriLnLLRmJm+1r6ux5/Myc3Ho3yKLB6biuUdDUttpz4M8RfVmzc4ChStwLA
         5X95l9l0Y2Djd8faIANJSg7/qgfLzmz+CaO5OGo9exr0AyjevhvxSVpcvhrChNldGXcz
         nQJg==
X-Gm-Message-State: AOJu0YxC5jXkZBch7SRiSrwhQUG5Tvu6UiPA8xpaNQ8E3hgWDx+mj7i2
	CoUp7PTjojCkHA1nXCstV/EgjxQF30nJhNAYb9pxrB/xyOuh5WsVh7TDLgMCSJjOVgBq9md+qF0
	1
X-Google-Smtp-Source: AGHT+IF5+ckexxMB2mRk7r1dMYFDwYSzxoE8wfINleeNYXs9OThiii+pR8Mf2DxWcdrdhYir1H8ELw==
X-Received: by 2002:a2e:8683:0:b0:2ef:2d3d:3cc3 with SMTP id 38308e7fff4ca-2f15aa71865mr123964901fa.4.1723038519843;
        Wed, 07 Aug 2024 06:48:39 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH 0/5] Improve support for EFI multiboot loading
Date: Wed,  7 Aug 2024 14:48:14 +0100
Message-ID: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

------------------------------------------------------------------------------
(This series is work from Frediano. He's having some issues with his dev
environment and asked me to push it to xen-devel on his behalf)
------------------------------------------------------------------------------

Testing this feature in preparation for UEFI CA memory mitigation
requirements I found some issues causing the loading to fail and
other minor issues.
Details in series commit messages.

Frediano Ziglio (5):
  x86: Put trampoline in .init.data section
  x86: Fix early output messages in case of EFI
  x86: Set xen_phys_start and trampoline_xen_phys_start earlier
  x86: Force proper gdt_boot_base setting
  x86: Rollback relocation in case of EFI multiboot

 xen/arch/x86/boot/head.S  | 81 ++++++++++++++++++++++++++++++---------
 xen/arch/x86/boot/reloc.c | 63 +++++++++++++++++++++++++++++-
 2 files changed, 125 insertions(+), 19 deletions(-)

-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 13:48:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 13:48:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773500.1183943 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbh1x-0005JH-EY; Wed, 07 Aug 2024 13:48:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773500.1183943; Wed, 07 Aug 2024 13:48:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbh1x-0005HQ-7G; Wed, 07 Aug 2024 13:48:45 +0000
Received: by outflank-mailman (input) for mailman id 773500;
 Wed, 07 Aug 2024 13:48:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=nE80=PG=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sbh1v-0005AD-It
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 13:48:43 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c193147c-54c3-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 15:48:41 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5a10835487fso2854813a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 06:48:41 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b83960f353sm7017710a12.15.2024.08.07.06.48.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 07 Aug 2024 06:48:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c193147c-54c3-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723038521; x=1723643321; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=o7eodO/9HzqH08fbvCI7vy2Uyw8SnwXrkAc77uD4d2A=;
        b=eBmFeBDkNd87aJhO+ZE7x/ImfPfj+wxGn0b6RqJRAry5eqGWjMu2VUkh3mniOF1LUY
         8kJfDYYZkcDYt+MEkFIgHLYwdSVQlsQga4mP3d/xyAiQMoAPUJysjYgxXKw96el3Wxy/
         GEmzKfZkfRwpLxhevcFbs85MkQwB77S3BpB7o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723038521; x=1723643321;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=o7eodO/9HzqH08fbvCI7vy2Uyw8SnwXrkAc77uD4d2A=;
        b=Z/JNdUw//WdfpfZ1FMEzStTe2l3w2u/IHPrhWSFpk00EdoS/c5qQHpcsmvR7dR5+D/
         C4dSPxIyitib2C8Bn07m9I4L924HopFlXXPXzRkyUuQ9FDd/HyOKLjTDBUx6t8URqPGD
         omodKRDHbPyX183YMItTs3E2JR63diKKgu2f1OY2fGA+kcU5PCIsf3fIRMMO+3T1ZHzZ
         ahVx73ytZ76Sq4kbMQsSCupIrklq08P7MnxHN0mYM6XJ/qAxx7+ZguPmr8afRGtWHCjy
         5XJ4hESuJfK//08o2ltT6/TkqVzz9cPLxy/Z4xuCSycAPuRPPRaLaY57YuGQWL+ghNTN
         QSnw==
X-Gm-Message-State: AOJu0Ywkf6nM/fM8uHMTgUZwJzAKD1RYO2D0dprDUcwSk5Mz1qeX7jLk
	dr+NwXnhu8lcWM53IJtongKm/79S0hkU7OWu38JCLXTiSxa+++hYLBP0qvmHi0X7g/Vmu6XMXOl
	4
X-Google-Smtp-Source: AGHT+IHfPjkr6YvB77y4L8XA3v+BcfW12X55BGLdGL+x8IdxKIMhcYOiZjiZPba6g4zjb1J6DD+tUA==
X-Received: by 2002:a05:6402:2032:b0:5a3:a4d7:caf5 with SMTP id 4fb4d7f45d1cf-5b7f5dc13cemr11942212a12.36.1723038520673;
        Wed, 07 Aug 2024 06:48:40 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH 1/5] x86: Put trampoline in .init.data section
Date: Wed,  7 Aug 2024 14:48:15 +0100
Message-ID: <20240807134819.8987-2-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This change allows to put the trampoline in a separate, not executable
section. The trampoline contains a mix of code and data (data which
is modified from C code during early start so must be writable).
This is in preparation for W^X patch in order to satisfy UEFI CA
memory mitigation requirements.
At the moment .init.text and .init.data in EFI mode are put together
so they will be in the same final section as before this patch.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/head.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index d8ac0f0494..f027ff45fd 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -870,6 +870,8 @@ cmdline_parse_early:
 reloc:
         .incbin "reloc.bin"
 
+        .section .init.data, "aw", @progbits
+        .align 4
 ENTRY(trampoline_start)
 #include "trampoline.S"
 ENTRY(trampoline_end)
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 13:48:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 13:48:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773499.1183937 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbh1x-0005Do-5T; Wed, 07 Aug 2024 13:48:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773499.1183937; Wed, 07 Aug 2024 13:48:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbh1w-0005Cw-VF; Wed, 07 Aug 2024 13:48:44 +0000
Received: by outflank-mailman (input) for mailman id 773499;
 Wed, 07 Aug 2024 13:48: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=nE80=PG=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sbh1v-0005AI-E9
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 13:48:43 +0000
Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com
 [2a00:1450:4864:20::22d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c22c20e7-54c3-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 15:48:42 +0200 (CEST)
Received: by mail-lj1-x22d.google.com with SMTP id
 38308e7fff4ca-2f040733086so21372121fa.1
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 06:48:42 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b83960f353sm7017710a12.15.2024.08.07.06.48.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 07 Aug 2024 06:48:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c22c20e7-54c3-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723038522; x=1723643322; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=wGRtbIN13o/ciUAaf4wEJGcURp+ZlWP4onOzPdvMd2A=;
        b=SAn7ebwph8UNrja7FvAiOECzqlzt6tqo+Kb27CoM7xC2pLtT7vd1pglkORw2k9WBIo
         xiBMu1+Vp9I0vVTkS4Bjl7ApzaYErat9ef6BdvdlPjQwVLeI9K9Q1uzOYxQAxoJVG/Dv
         sBt1gLWOZx/GGFszfi0Wx0wKpnnrKn4OnP7qY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723038522; x=1723643322;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=wGRtbIN13o/ciUAaf4wEJGcURp+ZlWP4onOzPdvMd2A=;
        b=A7yfaBTUO4ApVZIL5hspa9zqwggSJ/EPLhTkX3F4fXtSOlWkuy17WhMIjjkgVwP6PK
         LaszW4E42LY/NfpJz+/OqYbbpQ7rMS4IdMGQk98Hbq6JUqDsF7MWf7DrdXIyU4tqGjtv
         Splzsd6dM7EoOQEpclxb6D8aMjPx5SSbU7eKcpfbpyk7uD/OzioI82qg5g7KEnpBu/We
         /QNnDURLtSIwaUvP2pdS0fJJSjALZfInox4dGGl5KdwtOeYOxKQ0eLc9n426b2+DBSSs
         56g1a/r4vO6WAsE4Zdyv7eFLpwOUTH5cGMU/dpsHQAMkN9+ee04DVnrEKX153R637US+
         9CiQ==
X-Gm-Message-State: AOJu0YxBhMM4QwmXuQxEZ0JSgneienu/S2xTBhRR/LLGmagsBEfGFnVR
	zp5rUhe0EU807tNczkNZlOvfg41d2KQE2Pcbs8pHLPexWReX2nf7riSDY/clvzjP+BkHwltb4SS
	d
X-Google-Smtp-Source: AGHT+IG1l8Rjqon1YH1RNx/xfW2NajRmcQ+83qN/XAymq6z2D6oNRyKPWQ/aF56UUdD0Gabg4msoyA==
X-Received: by 2002:a2e:9bc5:0:b0:2f0:1fd5:2f29 with SMTP id 38308e7fff4ca-2f15aaa6099mr129936081fa.19.1723038521707;
        Wed, 07 Aug 2024 06:48:41 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH 2/5] x86: Fix early output messages in case of EFI
Date: Wed,  7 Aug 2024 14:48:16 +0100
Message-ID: <20240807134819.8987-3-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

If code is loaded by EFI the loader will relocate the image
under 4GB. This cause offsets in x86 code generated by
sym_offs(SYMBOL) to be relocated too (basically they won't be
offsets from image base). In order to get real offset the
formulae "sym_offs(SYMBOL) - sym_offs(__image_base__)" is
used instead.
Also, in some case %esi register (that should point to
__image_base__ addresss) is not set so compute in all cases.
Code tested forcing failures in the code.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/head.S | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index f027ff45fd..296f76146a 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -188,8 +188,27 @@ early_error: /* Here to improve the disassembly. */
         xor     %edi,%edi                       # No VGA text buffer
         jmp     .Lprint_err
 .Lget_vtb:
-        mov     sym_esi(vga_text_buffer), %edi
+        mov     $sym_offs(vga_text_buffer), %edi
 .Lprint_err:
+        mov     $sym_offs(__image_base__), %ebx
+
+        /* compute base, relocation or not */
+        call    1f
+1:
+        pop     %esi
+        subl    $sym_offs(1b), %esi
+        addl    %ebx, %esi
+
+        /* adjust offset and load */
+        test    %edi, %edi
+        jz      1f
+        subl    %ebx, %edi
+        movl    (%edi,%esi,1), %edi
+1:
+
+        /* adjust message offset */
+        subl    %ebx, %ecx
+
         add     %ecx, %esi     # Add string offset to relocation base.
         # NOTE: No further use of sym_esi() till the end of the "function"!
 1:
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 13:48:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 13:48:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773502.1183971 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbh20-00067w-1u; Wed, 07 Aug 2024 13:48:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773502.1183971; Wed, 07 Aug 2024 13:48:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbh1z-00067o-Ud; Wed, 07 Aug 2024 13:48:47 +0000
Received: by outflank-mailman (input) for mailman id 773502;
 Wed, 07 Aug 2024 13:48:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=nE80=PG=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sbh1x-0005AI-Tx
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 13:48:45 +0000
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com
 [2a00:1450:4864:20::52d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c3d58bc4-54c3-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 15:48:45 +0200 (CEST)
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-5bb8e62570fso2684663a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 06:48:45 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b83960f353sm7017710a12.15.2024.08.07.06.48.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 07 Aug 2024 06:48:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c3d58bc4-54c3-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723038524; x=1723643324; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=j0P2O0so3M3+faOWsBdEY2/POlgK4yVIXKMk2Q6OuFU=;
        b=iAoiPvx3eMS3A+aZnAIzNn02TKhWoTZGBKy4BjNlv1A0OApXKCZzVuHnzS1hxN54ad
         exjUozp6ApvCoRNNLG3ue40u4U00SIUCpUXvtq6xZ/sAaeMKj3BLB8X5t9n7TWGpkHd0
         vlX5Uzm5z24KUryTXGQBoCBLbFOJgmCFiwyPo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723038524; x=1723643324;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=j0P2O0so3M3+faOWsBdEY2/POlgK4yVIXKMk2Q6OuFU=;
        b=Vo895biDKg1Ejz9G/nKeGRzdJF1jFMY8BoouipR5nqg5BC+oj6Gt16iF0GYblCE5dp
         2lpn0zw80ArKrrGHa94OyAcUVkp4Hu567291Qbj+Sq9nC08MMrbSWplcCCMSXaQZMwp6
         z/8iIsGPbYRl7VZ67gEpS3UkQDs8RKEXlwmrBPDkSiCdXgNCl35JrZ8qQktd80cYNlg9
         oBb4oMSGisZe45sPJ3HdGM3KBAWrPks7k/DybJ8/AKm8SJ71nnLNgJKYafo8P5kXYfQG
         zwAd5QPqj4ZVoytIvbO7mFmQpOHL7LnnVj0QqpdSwMA5iTnMvcxO/+kPtcwVKMA8XW46
         iRsw==
X-Gm-Message-State: AOJu0YwKvGetLtxhO2K4BXnYfr9uH0PR5ch2rvHZGZq1Xl9GaDrF7u6z
	5ciP+E99vVoOvOtZJPEGdcNh9F/wYhwldBb/Mr0Vd+9QaVrrtXrs2R4shdp4RrMfu/hg1fUfzux
	K
X-Google-Smtp-Source: AGHT+IFxiUbA4aqh8QoSftI9J0K9AalqflVdBk2c6Kh9BR0drMFevjsJzg2bcxaav/UmEHj0VqlgvA==
X-Received: by 2002:aa7:c3cc:0:b0:5a0:e62c:61bd with SMTP id 4fb4d7f45d1cf-5b7f5413b5cmr12727946a12.29.1723038524429;
        Wed, 07 Aug 2024 06:48:44 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH 5/5] x86: Rollback relocation in case of EFI multiboot
Date: Wed,  7 Aug 2024 14:48:19 +0100
Message-ID: <20240807134819.8987-6-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In case EFI not multiboot rolling back relocation is done in
efi_arch_post_exit_boot, called by efi_start however this is
not done in multiboot code path.
Do it also for this path to make it work correctly.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/head.S  | 29 +++++++++++++++---
 xen/arch/x86/boot/reloc.c | 63 ++++++++++++++++++++++++++++++++++++++-
 2 files changed, 87 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index abfa3d82f7..75ac74a589 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -352,6 +352,7 @@ __efi64_mb2_start:
         and     $~15,%rsp
 
         /* Save Multiboot2 magic on the stack. */
+        shlq    $32, %rax
         push    %rax
 
         /* Save EFI ImageHandle on the stack. */
@@ -382,11 +383,24 @@ __efi64_mb2_start:
         /* Just pop an item from the stack. */
         pop     %rax
 
-        /* Restore Multiboot2 magic. */
-        pop     %rax
+        /* Prepare stack for relocation call */
+        subq    $16, %rsp
+        lea     l2_bootmap(%rip), %ecx
+        movl    %ecx, 16(%rsp)
+        lea     l3_bootmap(%rip), %ecx
+        movl    %ecx, 12(%rsp)
+        lea     __base_relocs_end(%rip), %ecx
+        movl    %ecx, 8(%rsp)
+        lea     __base_relocs_start(%rip), %ecx
+        movl    %ecx, 4(%rsp)
+        lea     __image_base__(%rip),%rsi
+        movl    %esi, (%rsp)
+        movabsq $__XEN_VIRT_START, %rcx
+        subq    %rsi, %rcx
+        push    %rcx
 
-        /* Jump to trampoline_setup after switching CPU to x86_32 mode. */
-        lea     trampoline_setup(%rip),%r15
+        /* Jump to trampoline_efi_setup after switching CPU to x86_32 mode. */
+        lea     trampoline_efi_setup(%rip),%r15
 
 x86_32_switch:
         mov     %r15,%rdi
@@ -557,6 +571,12 @@ __start:
         and     $~(MULTIBOOT2_TAG_ALIGN-1),%ecx
         jmp     .Lmb2_tsize
 
+trampoline_efi_setup:
+        movb    $1, %al
+        call    reloc
+        pop     %eax
+        jmp     trampoline_setup
+
 trampoline_bios_setup:
         /*
          * Called on legacy BIOS platforms only.
@@ -627,6 +647,7 @@ trampoline_setup:
         push    %ecx                /* Bottom-most low-memory stack address. */
         push    %ebx                /* Multiboot / PVH information address. */
         push    %eax                /* Magic number. */
+        movb    $0, %al
         call    reloc
 #ifdef CONFIG_PVH_GUEST
         cmpb    $0, sym_esi(pvh_boot)
diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
index 4033557481..3aa97a99d0 100644
--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -23,7 +23,9 @@ asm (
     "    .text                         \n"
     "    .globl _start                 \n"
     "_start:                           \n"
-    "    jmp  reloc                    \n"
+    "    cmpb $0, %al                  \n"
+    "    je   reloc                    \n"
+    "    jmp  reloc_pe_back            \n"
     );
 
 #include "defs.h"
@@ -375,6 +377,65 @@ void *__stdcall reloc(uint32_t magic, uint32_t in, uint32_t trampoline,
     }
 }
 
+struct pe_base_relocs {
+    u32 rva;
+    u32 size;
+    u16 entries[];
+};
+
+#define PE_BASE_RELOC_ABS      0
+#define PE_BASE_RELOC_HIGHLOW  3
+#define PE_BASE_RELOC_DIR64   10
+
+void __stdcall reloc_pe_back(long long delta,
+                             uint32_t xen_phys_start,
+                             const struct pe_base_relocs *__base_relocs_start,
+                             const struct pe_base_relocs *__base_relocs_end,
+                             char *l3_bootmap, char *l2_bootmap)
+{
+    const struct pe_base_relocs *base_relocs;
+
+    for ( base_relocs = __base_relocs_start; base_relocs < __base_relocs_end; )
+    {
+        unsigned int i = 0, n;
+
+        n = (base_relocs->size - sizeof(*base_relocs)) /
+            sizeof(*base_relocs->entries);
+
+        /*
+         * Relevant l{2,3}_bootmap entries get initialized explicitly in
+         * efi_arch_memory_setup(), so we must not apply relocations there.
+         * l2_directmap's first slot, otoh, should be handled normally, as
+         * efi_arch_memory_setup() won't touch it (xen_phys_start should
+         * never be zero).
+         */
+        if ( xen_phys_start + base_relocs->rva == (unsigned long)l3_bootmap ||
+             xen_phys_start + base_relocs->rva == (unsigned long)l2_bootmap )
+            i = n;
+
+        for ( ; i < n; ++i )
+        {
+            unsigned long addr = xen_phys_start + base_relocs->rva +
+                                 (base_relocs->entries[i] & 0xfff);
+
+            switch ( base_relocs->entries[i] >> 12 )
+            {
+            case PE_BASE_RELOC_ABS:
+                break;
+            case PE_BASE_RELOC_HIGHLOW:
+                if ( delta )
+                    *(u32 *)addr += delta;
+                break;
+            case PE_BASE_RELOC_DIR64:
+                if ( delta )
+                    *(u64 *)addr += delta;
+                break;
+            }
+        }
+        base_relocs = (const void *)(base_relocs->entries + i + (i & 1));
+    }
+}
+
 /*
  * Local variables:
  * mode: C
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 13:48:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 13:48:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773503.1183976 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbh20-00069z-Dh; Wed, 07 Aug 2024 13:48:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773503.1183976; Wed, 07 Aug 2024 13:48:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbh20-00068s-5M; Wed, 07 Aug 2024 13:48:48 +0000
Received: by outflank-mailman (input) for mailman id 773503;
 Wed, 07 Aug 2024 13:48:46 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=nE80=PG=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sbh1x-0005AD-UC
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 13:48:45 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c333feae-54c3-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 15:48:44 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-5b01af9b0c9so2004978a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 06:48:44 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b83960f353sm7017710a12.15.2024.08.07.06.48.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 07 Aug 2024 06:48:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c333feae-54c3-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723038523; x=1723643323; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=PtnPxebiV0FOs9Be6cyaf3Vp45b5Mwz7UfucVn6WbxI=;
        b=CqtN8RIhDHwMHJhKxxyFN4vudwuoTeLauX9/MSOXiLxERpzpwPer2QdK+72gXEo8w6
         XVRDtou9y0sEJYXW7bp5D+Ij60WXGsM+SBcjHlbubaHRCSidITyvn9HIs4B/NJ8MuxWF
         i93HU5eF7le5GT0Diecat8RDQeUHAQH9sPbRM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723038523; x=1723643323;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=PtnPxebiV0FOs9Be6cyaf3Vp45b5Mwz7UfucVn6WbxI=;
        b=Qh3AcLAo46LZEfNYbgqgNHyBDrL5Gg4qlnbOgvzZ4GI4DCr4/fs9rR4SPNuDw3vbjU
         McnfEAIcmclCLIC9fV9sqUyb9TUfZb4NRvlceqR9L6blW9QMOsIYl8yAJYNB0vytVxpi
         IJ50NCmYrUqLrqv8FERWz5y5rpiinuzbABrwhN4Nm8KzQwH3wSypBMYAGIIy6mTXw8WO
         OlYqQ1xu0BVzKTNbw/PoaLeuzA6amosZ3k8VljoAcfoFwmMQE8geRSJrm8rmC8GKasiQ
         TNRX6jKSCa97C5QxDGXvXUcY+4sWFJ56FTrOLyeNta4rvXGBO5f1zsYujcooByXWbv8B
         0yXg==
X-Gm-Message-State: AOJu0Yy7aEzMgxx9eTWaLGf2gKzK7qdNI7gFyerFoJ/hkB/y9TxqhU6r
	/4QkOSjifTx+u+F7gWTnA+eUhfG5v3XR1aMzwqJQ7jK/rHErfaxt62nTuTIpCkyNK3StYj9U+Vr
	y
X-Google-Smtp-Source: AGHT+IG4FXzaPjOkx4vTqxbBk8DdOUhH9rRyVIw44LocTNgv3PCN99jLkRnGQYbczuJH1gfp0oL8Xw==
X-Received: by 2002:aa7:d501:0:b0:584:8feb:c3a1 with SMTP id 4fb4d7f45d1cf-5b7f36f8e9fmr13738466a12.1.1723038523464;
        Wed, 07 Aug 2024 06:48:43 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH 4/5] x86: Force proper gdt_boot_base setting
Date: Wed,  7 Aug 2024 14:48:18 +0100
Message-ID: <20240807134819.8987-5-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Instead of relocate the value at that position compute it
entirely and write it.
During EFI boots sym_offs(SYMBOL) are potentially relocated
causing the values to be corrupted.
For PVH and BIOS the change won't be necessary but keep the
code consistent.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/head.S | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 5b82221038..abfa3d82f7 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -132,8 +132,7 @@ multiboot2_header:
 gdt_boot_descr:
         .word   .Ltrampoline_gdt_end - trampoline_gdt - 1
 gdt_boot_base:
-        .long   sym_offs(trampoline_gdt)
-        .long   0 /* Needed for 64-bit lgdt */
+        .quad   0 /* Needed for 64-bit lgdt */
 
 vga_text_buffer:
         .long   0xb8000
@@ -392,15 +391,16 @@ __efi64_mb2_start:
 x86_32_switch:
         mov     %r15,%rdi
 
-        /* Store Xen image load base address in place accessible for 32-bit code. */
-        lea     __image_base__(%rip),%esi
-
         cli
 
         /* Initialize GDTR. */
-        add     %esi,gdt_boot_base(%rip)
+        lea     trampoline_gdt(%rip),%esi
+        movl    %esi,gdt_boot_base(%rip)
         lgdt    gdt_boot_descr(%rip)
 
+        /* Store Xen image load base address in place accessible for 32-bit code. */
+        lea     __image_base__(%rip),%esi
+
         /* Reload code selector. */
         pushq   $BOOT_CS32
         lea     cs32_switch(%rip),%edx
@@ -458,7 +458,8 @@ __pvh_start:
         movb    $-1, sym_esi(opt_console_xen)
 
         /* Prepare gdt and segments */
-        add     %esi, sym_esi(gdt_boot_base)
+        lea     sym_esi(trampoline_gdt), %ecx
+        movl    %ecx, sym_esi(gdt_boot_base)
         lgdt    sym_esi(gdt_boot_descr)
 
         mov     $BOOT_DS, %ecx
@@ -562,7 +563,8 @@ trampoline_bios_setup:
          *
          * Initialize GDTR and basic data segments.
          */
-        add     %esi,sym_esi(gdt_boot_base)
+        lea     sym_esi(trampoline_gdt), %ecx
+        movl    %ecx, sym_esi(gdt_boot_base)
         lgdt    sym_esi(gdt_boot_descr)
 
         mov     $BOOT_DS,%ecx
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 14:39:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 14:39:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773553.1183992 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbhot-0008Vc-VL; Wed, 07 Aug 2024 14:39:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773553.1183992; Wed, 07 Aug 2024 14:39:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbhot-0008VV-QN; Wed, 07 Aug 2024 14:39:19 +0000
Received: by outflank-mailman (input) for mailman id 773553;
 Wed, 07 Aug 2024 14:39:18 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=628V=PG=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbhos-0008VP-Hm
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 14:39:18 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d27ed480-54ca-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 16:39:16 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-52f04b3cb33so4365702e87.0
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 07:39:16 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9e841a7sm649381666b.179.2024.08.07.07.39.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 07 Aug 2024 07:39:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d27ed480-54ca-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723041556; x=1723646356; 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=rV8lX1PlLqJsOe3OdUMnd/J2qEfLznI40xZkelHj5I0=;
        b=LB5JVC6+3FIR3QQWtYj0MKOrelesJz9QhyxnOp7JMxkAC+j+0mwU5T6VyncIYTYIoj
         flXFgos/hcF9w+8VmQmrbByvGGiupI+HE5tt0A6BfN5+nEWnGulAg0A/jV/5q5Ix5orp
         7owGdzeNENrBWdFymjQDf1TI7Ita2QgsGxWGFgvMqhMuy5Mm9VoKRepvo8AOewOmaw8Z
         X0w8i/CWKC3/bZhq9rgcYj+WHv6MTiGp4ZkGBNzuY1N9uV4qX8gR/buGIHPnwJVMbuWg
         j2ilkYSoggQpjG/2QFdRpBmRvKy/rPMLzcDuWIG+W8hXEuthe3p6kwAc/BqCM5oIeunT
         6xow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723041556; x=1723646356;
        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=rV8lX1PlLqJsOe3OdUMnd/J2qEfLznI40xZkelHj5I0=;
        b=RfXcJ4SKjYkHjhYYVD2Z90r8jD43P0rx+cqD/a13YuQH/4Cl2PqpRdkmoDnKESiQ+5
         i/KA1h8+2lyfiwchyPvaJFPr/sFMxDQCewjYWSoXj2mzNycZ8Fd6lyP5vswihpkr/fzL
         S9I989YxDPC+D+yZm2bxJpr7kD4B73au0lB4vudIooxYHsg+W2dqiMMsJXtvH29RfLI+
         5i5W7ZTknALD5WYKQ2nDQ5M2nq9l0OZOGqJys/gk97AoJnTDTyRao3jwxIbvu5HRLLVC
         M9dNMC2Kj1Tst0ijtdwiiiC+tsd1D67zFncW+UscC/JXJ5K9NK947ElIY1nzWInm6Bu6
         xGAQ==
X-Forwarded-Encrypted: i=1; AJvYcCXHFOZglZ7EWEm8RnGX7hS3ccdTWXW78ejdpEB5MYOKT9ALXzKZwxdGnGTNtX4hnGXKXejQw+7FByJK8thIEWUsAmWnzB4P8EmCgkMUKiY=
X-Gm-Message-State: AOJu0YzFj3wphgWgfe4JXDycb2IZimk3jUCyan7SUAWL16MKKxNJdIgU
	FNy/BGZTjJuiyXTfxBVo3o2CqfmzceXZ9eHQ3LfLqiUZrjh70FzC94eIJ0sHNw==
X-Google-Smtp-Source: AGHT+IGX0/uR4KmM4tEtp9euSANWYm8Ugg7qMsBiN9nb9yFSY0VTQZAVZAtuTS0x37qqRVk2oZIvIg==
X-Received: by 2002:a05:6512:b07:b0:529:b718:8d00 with SMTP id 2adb3069b0e04-530bb3734f5mr15518173e87.8.1723041555693;
        Wed, 07 Aug 2024 07:39:15 -0700 (PDT)
Message-ID: <714d14c9-cd5e-4456-84ac-379e736c31c1@suse.com>
Date: Wed, 7 Aug 2024 16:39:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v13 1/2] xen/riscv: enable GENERIC_BUG_FRAME
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1722960083.git.oleksii.kurochko@gmail.com>
 <516ada36487fd57f7a784f9fb3fe328f5365bd85.1722960083.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <516ada36487fd57f7a784f9fb3fe328f5365bd85.1722960083.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 06.08.2024 18:37, Oleksii Kurochko wrote:
> Enable GENERIC_BUG_FRAME to support BUG(), WARN(), ASSERT,
> and run_in_exception_handler().
> 
> "UNIMP" is used for BUG_INSTR, which, when macros from <xen/bug.h>
> are used, triggers an exception with the ILLEGAL_INSTRUCTION cause.
> This instruction is encoded as a 2-byte instruction when
> CONFIG_RISCV_ISA_C is enabled:
>   ffffffffc0046ba0:       0000                    unimp
> and is encoded as a 4-byte instruction when CONFIG_RISCV_ISA_C
> ins't enabled:
>   ffffffffc005a460:       c0001073                unimp
> 
> Using 'ebreak' as BUG_INSTR does not guarantee proper handling of macros
> from <xen/bug.h>. If a debugger inserts a breakpoint (using the 'ebreak'
> instruction) at a location where Xen already uses 'ebreak', it
> creates ambiguity. Xen cannot distinguish whether the 'ebreak'
> instruction is inserted by the debugger or is part of Xen's own code.
> 
> Remove BUG_INSN_32 and BUG_INSN_16 macros as they encode the ebreak
> instruction, which is no longer used for BUG_INSN.
> 
> Update the comment above the definition of INS_LENGTH_MASK as instead of
> 'ebreak' instruction 'unimp' instruction is used.
> 
> <xen/lib.h> is included for the reason that panic() and printk() are
> used in common/bug.c and RISC-V fails if it is not included.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

Just one more (cosmetic) question:

> --- a/xen/arch/riscv/include/asm/bug.h
> +++ b/xen/arch/riscv/include/asm/bug.h
> @@ -9,7 +9,7 @@
>  
>  #ifndef __ASSEMBLY__
>  
> -#define BUG_INSTR "ebreak"
> +#define BUG_INSTR "UNIMP"

Deliberately all uppercase?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 14:42:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 14:42:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773561.1184001 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbhrZ-0001Un-A6; Wed, 07 Aug 2024 14:42:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773561.1184001; Wed, 07 Aug 2024 14:42:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbhrZ-0001Ug-6s; Wed, 07 Aug 2024 14:42:05 +0000
Received: by outflank-mailman (input) for mailman id 773561;
 Wed, 07 Aug 2024 14:42:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=nE80=PG=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sbhrX-0001UY-UL
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 14:42:03 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 35085de3-54cb-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 16:42:01 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-5b8c2a6135eso1184198a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 07:42:01 -0700 (PDT)
Received: from localhost ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b83a152e4dsm7154107a12.48.2024.08.07.07.42.00
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 07 Aug 2024 07:42:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 35085de3-54cb-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723041721; x=1723646521; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=0AxUYojaPf9XDmnVQj8HHru1cs+c4/iNI1AGzjdZhM4=;
        b=OZkmDFxraXP5gSELH3htUK/wQ0J7txwaNys+8cXmkvffMbPaiYK4tXY+k81beO8udn
         0qFa9uDkmlkjxvaejXHlmJEKK4tkr1k7zCcD1mryFHT5WNeWUnmw0PGWC6yjRHsf4sKW
         yd/nvioBL112eNDzvD+snD9IKRpS+fYJKFUT8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723041721; x=1723646521;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=0AxUYojaPf9XDmnVQj8HHru1cs+c4/iNI1AGzjdZhM4=;
        b=jfjAJ4Hqt6B7ll8z3BiZ68/Ry0KUmGcGmE8CayPsTzqTb/OvUA+xTjWyBPomsTIMtO
         bLWtA3EMKEv00zvOhEuZJL/PZImk30Jd+mn03KDk7LfFeZhba3oqANWI2UaYk7HF60IH
         lL35hgEpOfsMSVPtSOeoKs/f9xMLzt+j5kMQTxJAqlH59zoDZcCnh2ZqlEulzELbjIzU
         IpSGYQtALtKJXuev6ZXo57jIoH2qgSyOpnD5klFu9Qh8MXwW6NQyUQYsE0pRRDR6oAUH
         MLOqgvdZ0j5ypvIrJ+xVseiclxvx/hBR2sIVwzpjAWAjFAZwKvlNyomQA3dqNhMILTqp
         U1jw==
X-Forwarded-Encrypted: i=1; AJvYcCVNKw6I83rM1Gq13apolDxwgQ92QDTqcW7lD/L35SR8Srhu3UxquMrJCkt29r7Z/BIkGQMJhwGk24Qj7C9zLI9ripx1qdJnTJTvQ6N//O0=
X-Gm-Message-State: AOJu0YwaI6A6WR4y7BBXSAiV/jtJMbk17B1+bEIf+SZ5aiI+UNsEOH95
	/yyzYwJt1Kf/bxCepLnxZrPdvJ6x/SyIjMo7t9f2bKl2JSRnAH/TnWSLUW7j5XU=
X-Google-Smtp-Source: AGHT+IETq79MThODDxcTvfeYrC5SfPSJWtPgzacBD2+nQdgB/vmQ4NxtnowcxjF6zpYjoZ4ZRcJ2jQ==
X-Received: by 2002:aa7:ca46:0:b0:5b7:faba:311b with SMTP id 4fb4d7f45d1cf-5bba3680434mr2062620a12.5.1723041721085;
        Wed, 07 Aug 2024 07:42:01 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Wed, 07 Aug 2024 15:41:59 +0100
Message-Id: <D39RBA6G4ASA.2SHREKOQBFQLC@cloud.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
 =?utf-8?q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, "Xen-devel"
 <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH for-4.20 3/4] x86/fpu: Combine fpu_ctxt and xsave_area
 in arch_vcpu
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Jan Beulich" <jbeulich@suse.com>
X-Mailer: aerc 0.17.0
References: <cover.1720538832.git.alejandro.vallejo@cloud.com>
 <170c78f39dfef620d9060be3f1b31313673f09b9.1720538832.git.alejandro.vallejo@cloud.com> <78ae0b2f-e0a6-4ab9-b7a6-43e1357ff9b9@suse.com> <D2STLWUF9965.3QXLJ2TWIXS1Z@cloud.com> <4cc61747-904c-4b00-a722-2c31f7d04c2d@suse.com>
In-Reply-To: <4cc61747-904c-4b00-a722-2c31f7d04c2d@suse.com>

Hi. Sorry, I've been busy and couldn't get back to this sooner.

On Fri Jul 19, 2024 at 10:14 AM BST, Jan Beulich wrote:
> On 18.07.2024 18:54, Alejandro Vallejo wrote:
> > On Thu Jul 18, 2024 at 12:49 PM BST, Jan Beulich wrote:
> >> On 09.07.2024 17:52, Alejandro Vallejo wrote:
> >>> --- a/xen/arch/x86/include/asm/domain.h
> >>> +++ b/xen/arch/x86/include/asm/domain.h
> >>> @@ -591,12 +591,7 @@ struct pv_vcpu
> >>> =20
> >>>  struct arch_vcpu
> >>>  {
> >>> -    /*
> >>> -     * guest context (mirroring struct vcpu_guest_context) common
> >>> -     * between pv and hvm guests
> >>> -     */
> >>> -
> >>> -    void              *fpu_ctxt;
> >>> +    /* Fixed point registers */
> >>>      struct cpu_user_regs user_regs;
> >>
> >> Not exactly, no. Selector registers are there as well for example, whi=
ch
> >> I wouldn't consider "fixed point" ones. I wonder why the existing comm=
ent
> >> cannot simply be kept, perhaps extended to mention that fpu_ctxt now l=
ives
> >> elsewhere.
> >=20
> > Would you prefer "general purpose registers"? It's not quite that eithe=
r, but
> > it's arguably closer. I can part with the comment altogether but I'd ra=
ther
> > leave a token amount of information to say "non-FPU register state" (bu=
t not
> > that, because that would be a terrible description).=20
> >=20
> > I'd rather update it to something that better reflects reality, as I fo=
und it
> > quite misleading when reading through. I initially thought it may have =
been
> > related to struct layout (as in C-style single-level inheritance), but =
as it
> > turns out it's merely establishing a vague relationship between arch_vc=
pu and
> > vcpu_guest_context. I can believe once upon a time the relationship was=
 closer
> > than it it now, but with the guest context missing AVX state, MSR state=
 and
> > other bits and pieces I thought it better to avoid such confusions for =
future
> > navigators down the line so limit its description to the line below.
>
> As said, I'd prefer if you amended the existing comment. Properly describ=
ing
> what's in cpu_user_regs isn't quite as easy in only very few words. Neith=
er
> "fixed point register" nor "general purpose registers" really covers it. =
And
> I'd really like to avoid having potentially confusing comments.

Sure.

>
> >>> --- a/xen/arch/x86/xstate.c
> >>> +++ b/xen/arch/x86/xstate.c
> >>> @@ -507,9 +507,16 @@ int xstate_alloc_save_area(struct vcpu *v)
> >>>      unsigned int size;
> >>> =20
> >>>      if ( !cpu_has_xsave )
> >>> -        return 0;
> >>> -
> >>> -    if ( !is_idle_vcpu(v) || !cpu_has_xsavec )
> >>> +    {
> >>> +        /*
> >>> +         * This is bigger than FXSAVE_SIZE by 64 bytes, but it helps=
 treating
> >>> +         * the FPU state uniformly as an XSAVE buffer even if XSAVE =
is not
> >>> +         * available in the host. Note the alignment restriction of =
the XSAVE
> >>> +         * area are stricter than those of the FXSAVE area.
> >>> +         */
> >>> +        size =3D XSTATE_AREA_MIN_SIZE;
> >>
> >> What exactly would break if just (a little over) 512 bytes worth were =
allocated
> >> when there's no XSAVE? If it was exactly 512, something like xstate_al=
l() would
> >> need to apply a little more care, I guess. Yet for that having just al=
ways-zero
> >> xstate_bv and xcomp_bv there would already suffice (e.g. using
> >> offsetof(..., xsave_hdr.reserved) here, to cover further fields gainin=
g meaning
> >> down the road). Remember that due to xmalloc() overhead and the 64-byt=
e-aligned
> >> requirement, you can only have 6 of them in a page the way you do it, =
when the
> >> alternative way 7 would fit (if I got my math right).
> >=20
> > I'm slightly confused.
> >=20
> > XSTATE_AREA_MIN_SIZE is already 512 + 64 to account for the XSAVE heade=
r,
> > including its reserved fields. Did you mean something else?
>
> No, I didn't. I've in fact commented on it precisely because it is the va=
lue
> you name. That's larger than necessary, and when suitably shrunk - as sai=
d -
> one more of these structures could fit in a page (assuming they were all
> allocated back-to-back, which isn't quite true right now, but other
> intervening allocations may or may not take space from the same page, so
> chances are still that the ones here all might come from one page as long=
 as
> there's space left).
>
> >     #define XSAVE_HDR_SIZE            64
> >     #define XSAVE_SSE_OFFSET          160
> >     #define XSTATE_YMM_SIZE           256
> >     #define FXSAVE_SIZE               512
> >     #define XSAVE_HDR_OFFSET          FXSAVE_SIZE
> >     #define XSTATE_AREA_MIN_SIZE      (FXSAVE_SIZE + XSAVE_HDR_SIZE)
> >=20
> > Part of the rationale is to simplify other bits of code that are curren=
tly
> > conditionalized on v->xsave_header being NULL. And for that the full xs=
ave
> > header must be present (even if unused because !cpu_xsave)
>
> But that's my point: The reserved[] part doesn't need to be there; it's
> not being accessed anywhere, I don't think.
>
> Jan

The reserved octets want to be in the structure so we can zero them out on
machines with XSAVE. Once they are it's quite dangerous to not allocate spa=
ce
for them, as doing something like "*xsave_area =3D *foo;" would overflow th=
e
allocation silently (that's in fact what the next patch does).

Combined with the fact that (a) not having XSAVE is fairly rare and (b) all=
 of
this is bound to end up round to the page anyway once we get Address Space
Isolation going... it really doesn't motivate me to save a handful of octet=
s
per vCPU. The cost in memory would be negligible even if we had tens of
thousands of them running concurrently.

Cheers,
Alejandro


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 15:02:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 15:02:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773574.1184011 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbiAz-0005Fh-5k; Wed, 07 Aug 2024 15:02:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773574.1184011; Wed, 07 Aug 2024 15:02:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbiAz-0005Fa-1Z; Wed, 07 Aug 2024 15:02:09 +0000
Received: by outflank-mailman (input) for mailman id 773574;
 Wed, 07 Aug 2024 15:02:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ZlkY=PG=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1sbiAx-0005FU-NG
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 15:02:07 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on20600.outbound.protection.outlook.com
 [2a01:111:f403:2417::600])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 027c213b-54ce-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 17:02:06 +0200 (CEST)
Received: from MN2PR19CA0057.namprd19.prod.outlook.com (2603:10b6:208:19b::34)
 by CY5PR12MB6431.namprd12.prod.outlook.com (2603:10b6:930:39::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.13; Wed, 7 Aug
 2024 15:02:02 +0000
Received: from BL6PEPF0001AB71.namprd02.prod.outlook.com
 (2603:10b6:208:19b:cafe::1d) by MN2PR19CA0057.outlook.office365.com
 (2603:10b6:208:19b::34) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.29 via Frontend
 Transport; Wed, 7 Aug 2024 15:02:01 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 BL6PEPF0001AB71.mail.protection.outlook.com (10.167.242.164) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Wed, 7 Aug 2024 15:02:01 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 7 Aug
 2024 10:02:01 -0500
Received: from [172.24.53.91] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 7 Aug 2024 10:02:00 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 027c213b-54ce-11ef-bc04-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=D3mQocEVCPwtZ1dshHR5xDl5hz+IwopsIJC/9BvBhj0KlG+kW/o8o2owAHDv+/YQZKR5nG8UYuR6mMP9xPTIidEXPXMLb0nPcTvfYeS2aDLNNraWFgwYQtpe2p9NRB6cYuk1VHmPwEvvs95EcDaC13gd5jo9vVKo+m1YqKVVkc++A2+mZhx9Xw+c2dAq3xSnd5QPBMq0JTf43mF6hBlVcF6B+KLCfLZTsUz5T8YHQm0iLfqPv358DHPVp8KOufAzU8GCgNZemD4psHYAVCCuIt9mGQQaA7UMaMxFORL++YlbEhNQKD28K11/FFE3A0mwjlhp7lypmz8yPu0UcZALPQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OYYUaF/FTTY48T5J102NLO42+tpmVcbrbpil0R9w4dw=;
 b=ngui8AzShIVfFrImCGqxfbPgqSImUqJwJEqlAkydB0nZWII+vQlPIdCUjnG70IzmBNVpCQT6ZqzzudDokgd3yjSk6G01lvZ0a+1a9jVCprre0wkCfSkYg7corqDyLiGn+uEeXxxXucGc8jzpGElFokj2xAAr/onuHyWsKWInt1UNmhK5UJCXc6CvKcA9objqxNtkjf0Jm4jppIp9wu1C3cXoJn335H8r4xwx8Hy97zj3h2cmZj5cd8KnLCQx7GKeyRgE9FRFbSLUZzQ8k7S+IQdV0NcaLCqx0LOQPgbz2is4m/p5wqqApb3XSG3NaO+gWtNksg+mitTFFD6J+l0ImQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OYYUaF/FTTY48T5J102NLO42+tpmVcbrbpil0R9w4dw=;
 b=IOF60S8JZTtwb0BnUC9f8YidiK/XRAzbKMsmBdvmyNos8B1Zyy1n9scCgCBYPd+PKqMUncXeIGrmCs+Jq/VLJnt7ISPho3+zcOTFsJkfnuHzN+dqrHhA69Au0eRu6lStB2rhpzptMgultSGp3J6mn0iXjb/lDQk2VBjKd/QRJCs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <32d13cad-b9b9-4775-a18e-c3ac6b7c5657@amd.com>
Date: Wed, 7 Aug 2024 11:02:13 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] tools/xl: add suspend-to-ram and resume subcommands
To: Jan Beulich <jbeulich@suse.com>, zithro <slack@rabbit.lu>
CC: Andrew Cooper <andrew.cooper3@citrix.com>,
	<xen-devel@lists.xenproject.org>, =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
	<marmarek@invisiblethingslab.com>, Anthony PERARD <anthony.perard@vates.tech>
References: <4e9f3590be9f19edb87e05c7b7c2efeae8863109.1709190010.git.slack@rabbit.lu>
 <500adb55-4927-4876-aa22-3269538bb4c7@rabbit.lu>
 <59e3fdd5-f13b-414c-95e1-46e86a4779ac@suse.com>
Content-Language: en-US
From: Jason Andryuk <jason.andryuk@amd.com>
In-Reply-To: <59e3fdd5-f13b-414c-95e1-46e86a4779ac@suse.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
Received-SPF: None (SATLEXMB03.amd.com: jason.andryuk@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB71:EE_|CY5PR12MB6431:EE_
X-MS-Office365-Filtering-Correlation-Id: 401eaa12-1ad4-46f7-6d6f-08dcb6f1e486
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?NlVpRnpCTWhKcTFEMXFqNzg5NU9LNlRWWWU1YXpBQStON2FQYy9zMkVrYlkw?=
 =?utf-8?B?ZW5teTdHMW1nUVIxUEd1cWRtYmtuTStJRWNiYmxYNkV3SzN1OFE3M1pUeGVn?=
 =?utf-8?B?RE4yK1NkSTdDL1kxUzd5T3UzaFZBRFdZOFVwR3c2cE10TExZWG5pQXluVzVt?=
 =?utf-8?B?UlJweERFTVFETUF2NVVLWDY2STduSzgxQm5iS29MVTF0eThyVVNFV3dkMHhq?=
 =?utf-8?B?bGd2UUF0YmpraUkwZTJIS2c0QStoMUFKdDJPY2lkMUp3OHpYdnBwMENiajRr?=
 =?utf-8?B?WmxVL0toYUhTWklEWmlZSzVpald6RXgvNlBEOEtZcHBIbk9BSXFsSzErZ1dF?=
 =?utf-8?B?YW5kbGYvcE13bjd5c3pneURKTU9qdWlXdlhiY2FtYWo3SW9BcVZCc3M5cE1j?=
 =?utf-8?B?T0l3YWxuL0xYOFBRdkhMamFBREVvMWVleVV1QXE2QUUxeWZ4dW1heTZvWGdO?=
 =?utf-8?B?OThPLzE1S1BWUGkzeDNYSFlPQWw2ZlZaQnpLNnkrM3NwVHF0dGNzajZabW5x?=
 =?utf-8?B?eGVtanFQWnY2OERYMHJKeVBsa2ZVZGdjS3lEdmVFS0k1VStQNmVCenVFcW5P?=
 =?utf-8?B?VVp6d0ZhK05XS1R0L1dTK1JBY25ML0tPdUFoanJrTVk3bVZHODRRa3VtKzk4?=
 =?utf-8?B?aExMOGhIRUk4cUtiVFZUUnA2dVBaUSthU1puWUlTU1NUT003R0hmZHFocVBD?=
 =?utf-8?B?enV6Z3BKSkVCTHNkQkxoVHB3Z3BiZ1JxcnNoMDBLU3NQZ0dYMHpVNURqaDg3?=
 =?utf-8?B?b2lFcGQ5VVREYnRJVHpjaDdETDN0WTQxdkljZDU1ck0xTjRVT24rVUlHeHph?=
 =?utf-8?B?QjNoMXp1UXFoYWJsdm1CY0FCYW13ZGUrbEp5N3lkQ2JrM0RPZ2R2ZVhzdzNG?=
 =?utf-8?B?a0xJSFpyWEhlZVZxaFh1Um54SVk1OFNSRER0UWtMTy8wVWwvajNrdy91V0tw?=
 =?utf-8?B?ZXFaV2tQdjhTdTNBZmZlTncrdmZPZ3lBKy90d3ZUS3JuZ1dpVUtUa2cxSmgz?=
 =?utf-8?B?MTM4M0hxNnRWcDNucVVGQlVkd25mRFdnYk8yUFJpWStMNDZmdFp4SzZSNHBn?=
 =?utf-8?B?OFFhOWZpa2J1cUlncG00ckNMSmthTUpFSnJ5QmVoVjdVN3Z4MkRDR09yaDVB?=
 =?utf-8?B?K3Y2OVhkVmw2anJRTUE4WkZkZkM4WXUyeFB3SHVEM21CNXhCcUJGdlJvQW1r?=
 =?utf-8?B?TWpvZ2t1anVqREJuZjgvNjd6ZXRtSlJ0Q05vVTNTWm1wTG4zNHpLZWdQUTBa?=
 =?utf-8?B?c0tzS1plKy9IMjlYMkJkNFcwelNJcVh0ZUpOaFJ6REZJWVZ3djNoNW1ISHpx?=
 =?utf-8?B?Sk9vZHZqN1hLLzZTQ3c2Vmh2bWZXeVhCd01rdGtaRGNQU1ZkekJJU0t5dW4z?=
 =?utf-8?B?RXZUV2ZYYk9OOWhaZHhlNHNFSzBjcFJKVU1kMFB1TTdlS0xRd2piODBsSTla?=
 =?utf-8?B?U0xTa2hpNzBVQmtTTzhCK1M2bXVSbTZMTXZtMDcwcG16blI3WTQwd1ozZlg0?=
 =?utf-8?B?cUZ3T2xYcVQ1Z3lUTDNxdFpKTG1JUmhhVTRMZ0pWT1c2aGNMK0NONVV5QzN3?=
 =?utf-8?B?SzRqcDdMVThic0JaU2tUV1JtUk1oS2J1M1pkR0JDV05Xa045TE55ZkdvbXpn?=
 =?utf-8?B?T2tVckNuMngzSVZ3aDBzcncyM3dyOFphZmFPRndGT09OcGsvK2NCaEJnalVw?=
 =?utf-8?B?a0c3WWRhY1BUSjlWUFBmR3BYc0N6UzhTL3F0NXAvRW1hemhkTVYxcEU1YzY1?=
 =?utf-8?B?THdWOHNCVk5IUnBZeFo4SzRKejlZaGRaa3ZLaWlvVTc3M0dwZVN3UW1vZmhQ?=
 =?utf-8?B?bU10eXpPd1RFYkVDZDhRdGFNRWhNdVhNbDJQNVgwU0lscCtSSkZpRGtqSGU3?=
 =?utf-8?B?RXJZbzM1MjJUaEhkYUgrRS9FTHhFd3ROOUNyUHgvMmR1UWkwN3U3T201YnlN?=
 =?utf-8?Q?hz2F5LWP+HfF1JCJ4P08o0tK47WMM/s/?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2024 15:02:01.6531
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 401eaa12-1ad4-46f7-6d6f-08dcb6f1e486
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL6PEPF0001AB71.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6431

On 2024-07-30 02:42, Jan Beulich wrote:
> On 30.07.2024 00:31, zithro wrote:
>> Added my S-o-B (no other change).
>>
>> PS: re-sent to account for Anthony mail address change
>>
>> On 29 Feb 2024 08:00, zithro / Cyril Rébert wrote:
>>> The xl command doesn't provide suspend/resume, so add them :
>>>     xl suspend-to-ram <Domain>
>>>     xl resume <Domain>
>>>
>>> This patch follows a discussion on XenDevel: when you want the
>>> virtualized equivalent of "sleep"-ing a host, it's better to
>>> suspend/resume than to pause/unpause a domain.
>>>
>>> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>> Suggested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
>> Signed-off-by: Cyril Rébert (zithro) <slack@rabbit.lu>
> 
> Imo you want to properly re-submit, ...
> 
>>> ---
>>> - Tested on v4.17, x86
> 
> ... with this testing also advanced to 4.19.

I'll test and re-submit this.

Thanks,
Jason


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 15:21:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 15:21:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773583.1184021 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbiTn-0000Rr-Ng; Wed, 07 Aug 2024 15:21:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773583.1184021; Wed, 07 Aug 2024 15:21:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbiTn-0000Rk-K1; Wed, 07 Aug 2024 15:21:35 +0000
Received: by outflank-mailman (input) for mailman id 773583;
 Wed, 07 Aug 2024 15:21:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=628V=PG=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbiTm-0000Re-20
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 15:21:34 +0000
Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com
 [2a00:1450:4864:20::62d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ba14c51f-54d0-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 17:21:32 +0200 (CEST)
Received: by mail-ej1-x62d.google.com with SMTP id
 a640c23a62f3a-a7a81bd549eso163638266b.3
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 08:21:32 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9bc3d09sm656255366b.17.2024.08.07.08.21.31
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 07 Aug 2024 08:21:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ba14c51f-54d0-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723044092; x=1723648892; 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=0Y0HdTaxLAKW7NWU8atRiLHK9vVzCaHiSQfFFTOAwMw=;
        b=Dm7SYsumiJQjxzCU3FspCXPvrbJQ6QY4T3MA9WXznUFb5Z8lMDchRa7W8TztrUm1a9
         DRq1vxyZj6IpF6rFUEECl866ERKZO6BDCfOP/clwPpxtLL64NPtP9hgSy/t5uUkMshKF
         AHTDHvlO+59cDnCFDMQ6oiAGSDm2GbPmDQk478CheiYJDQcOj6CbYIsuqUv0p4RFsS6/
         YD8VjjiQV863OluHuM6VLeKiB6oTHW1oHDo52NbcdQUuz2UDdxU/XxrOzSVky3eBqhXj
         T3jYrZoWDAzxOyDJohZO/eOnBVgZMkG6meuXFxPE3z3WNwlQgKY7ffdU44Q91wVhNlaI
         ovXg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723044092; x=1723648892;
        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=0Y0HdTaxLAKW7NWU8atRiLHK9vVzCaHiSQfFFTOAwMw=;
        b=DE65xxQeycK1ceoMRmp9qr2B6kVsav15UN+6KaCHhdooJi0UsMFtW7rdUp6qMGo01Q
         jcyIpyN10maF4EFxZZ3KkeaDFRQnIn3AJ0HQEjTNcv20bZjW1fWvBn+KlL/+CgMCAXbB
         4JuUTUhfawjm6U1s7VNzrGarcTCx39vtimMWcCutIjabEqZYw3hyCD+iKOWWgtTPF5U8
         l5J6g75iL8P5DxCCnwXyvbivUEBwIeqI8wpknctcRBScjT+bOLQC/YOVSOXv0E+9Rjx0
         NNiyUQJlY4FFyyzGTa9xfHSFkfjiXAzfs9NLuLKb5MmU+C5gliuSHXhgXWGI718igU7K
         xlvg==
X-Forwarded-Encrypted: i=1; AJvYcCUrMYmWN+FkVSqAL38BzLGoJ3kS3dGaSPSNCGWmmtpznZLKVeBDRqGXCq7AhGRP1v7LzG2t5lkJyJKG4p8goRizbzsrKV/FfoR6K6v0SFQ=
X-Gm-Message-State: AOJu0YzHU9Rw3G59tTkY8crevgJTocSFzGWPp6wSQ/z7UU2Jowoc2Mdz
	9PtZfVtU8NCh7AJC1SyYpCV/AN/virFbVknc4JnHyJ4axawem83wvLPoIOEadg==
X-Google-Smtp-Source: AGHT+IHTDt3c8CNRTfHLm0hUzzh+1ZvtydKydFRA6khQMmb4R5yI4S4VTJIhGa8aj0KgZEzCDxxCOQ==
X-Received: by 2002:a17:906:730f:b0:a6f:501d:c224 with SMTP id a640c23a62f3a-a7dc5100bbcmr1452286766b.57.1723044091696;
        Wed, 07 Aug 2024 08:21:31 -0700 (PDT)
Message-ID: <1b0475fe-4371-4bf7-a469-aa580648f210@suse.com>
Date: Wed, 7 Aug 2024 17:21:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] x86/msi: fix locking for SR-IOV devices
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <20240807052011.582099-1-stewart.hildebrand@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240807052011.582099-1-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 07.08.2024 07:20, Stewart Hildebrand wrote:
> --- a/xen/arch/x86/msi.c
> +++ b/xen/arch/x86/msi.c
> @@ -662,7 +662,8 @@ static int msi_capability_init(struct pci_dev *dev,
>      return 0;
>  }
>  
> -static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
> +static u64 read_pci_mem_bar(struct pci_dev *pdev, u16 seg, u8 bus, u8 slot,
> +                            u8 func, u8 bir, int vf)
>  {

First I thought this was a leftover from the earlier version. But you need
it for accessing the vf_rlen[] field. Yet that's properly misleading,
especially when considering that the fix also wants backporting. What pdev
represents here changes. I think you want to pass in just vf_rlen (if we
really want to go this route; I'm a little wary of this repurposing of the
field, albeit I see no real technical issue).

Of course there's a BUILD_BUG_ON() which we need to get creative with, in
order to now outright drop it (see also below).

> @@ -670,19 +671,15 @@ static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
>  
>      if ( vf >= 0 )
>      {
> -        struct pci_dev *pdev = pci_get_pdev(NULL,
> -                                            PCI_SBDF(seg, bus, slot, func));
> +        pci_sbdf_t pf_sbdf = PCI_SBDF(seg, bus, slot, func);

I think this wants naming just "sbdf" and moving to function scope. There
are more places in the function which, in a subsequent change, could also
benefit from this new local variable.

> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -654,6 +654,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>      const char *type;
>      int ret;
>      bool pf_is_extfn = false;
> +    uint64_t vf_rlen[6] = { 0 };

The type of this variable needs to be tied to that of the struct field
you copy to/from. Otherwise, if the struct field changes type ...

> @@ -664,7 +665,10 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>                              PCI_SBDF(seg, info->physfn.bus,
>                                       info->physfn.devfn));
>          if ( pdev )
> +        {
>              pf_is_extfn = pdev->info.is_extfn;
> +            memcpy(vf_rlen, pdev->vf_rlen, sizeof(pdev->vf_rlen));

... there'll be nothing for the compiler to tell us. Taken together with
the BUILD_BUG_ON() related remark further up, I think you want to
introduce a typedef and/or struct here to make things properly typesafe
(as then you can avoid the use of memcpy()).

Seeing the conditional we're in, what if we take ...

> +        }
>          pcidevs_unlock();
>          if ( !pdev )
>              pci_add_device(seg, info->physfn.bus, info->physfn.devfn,

... this fallback path?

> @@ -700,7 +704,10 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>           * extended function.
>           */
>          if ( pdev->info.is_virtfn )
> +        {
>              pdev->info.is_extfn = pf_is_extfn;
> +            memcpy(pdev->vf_rlen, vf_rlen, sizeof(pdev->vf_rlen));
> +        }
>      }

Similarly here - what if the enclosing if()'s condition is false? Even
if these cases couldn't be properly taken care of, they'd at least need
discussing in the description. In this context note how in a subsequent
invocation of pci_add_device() for the PF the missing data in vf_rlen[]
would actually be populated into the placeholder struct that the
fallback invocation of pci_add_device() would have created. Yet the
previously created VF's struct wouldn't be updated (afaict). This was,
iirc, the main reason to always consult the PF's ->vf_rlen[].

An alternative approach might be to add a link from VF to PF, while
making sure that the PF struct won't be de-allocated until all its VFs
have gone away. That would then also allow to eliminate the problematic
pci_get_pdev().

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 15:40:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 15:40:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773594.1184030 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbilZ-00037H-66; Wed, 07 Aug 2024 15:39:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773594.1184030; Wed, 07 Aug 2024 15:39:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbilZ-00037A-34; Wed, 07 Aug 2024 15:39:57 +0000
Received: by outflank-mailman (input) for mailman id 773594;
 Wed, 07 Aug 2024 15:39: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=8zg6=PG=cloud.com=matthew.barnes@srs-se1.protection.inumbo.net>)
 id 1sbilY-00036l-09
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 15:39:56 +0000
Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com
 [2a00:1450:4864:20::632])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4a8069d7-54d3-11ef-8776-851b0ebba9a2;
 Wed, 07 Aug 2024 17:39:53 +0200 (CEST)
Received: by mail-ej1-x632.google.com with SMTP id
 a640c23a62f3a-a7aada2358fso178978566b.0
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 08:39:53 -0700 (PDT)
Received: from EMEAENGAAD91498.citrite.net ([217.156.233.154])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9e83848sm659353366b.177.2024.08.07.08.39.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 07 Aug 2024 08:39:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4a8069d7-54d3-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723045193; x=1723649993; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=UmDI4Dz84kXGt5jmXeHADz7wjjK1TvXqao2udkFRzFU=;
        b=YYik4yjS/jkj//IfceODnxa+oj6GzRXk9nO6hMy2p80/aNshYoSbpITJnMHdAqQyOS
         /lRpMQF3jIUhWtcCHLhc0AsgYd3MJ09zVItZK1uCKcwprmnuL1wb+nio4JCzr2eZeznL
         n9fqp/9NzknGjC6/y50/5ofoHXjAGRYKK5Am4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723045193; x=1723649993;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=UmDI4Dz84kXGt5jmXeHADz7wjjK1TvXqao2udkFRzFU=;
        b=LYP7qBWj2xAJ2YGQ5wS4bolIZ/NB/ltbdCEczaUg0M+XUgH1Cp6fFHFr7gske6d6ba
         KyhkGFF7djhSoI2ShqrednTWakjsUxrV8MynuoOcJhL/l/OFqbQRazJ9eZOyU2vuWP1W
         6V75nqx1xVq/ffN3h22pL0VDr2rZh7KzQ4Kxbij1FVUsHiXZzB8iUfzQk05u3vY2pD1T
         Q9CntFndaKIJtAc1GBGzX5ao3NSUHqvGKToFJFqw6zvVwIoz7ypVnWV40CUpsToJSY9x
         u4wqLborApT1cKg8BeKkdxU+aseLLcDWhVOI3s501DnQkskps4p55ra3wAjpHe/YpiYU
         PV8A==
X-Gm-Message-State: AOJu0YzMgS6YEcug7l0xCXlSmFC2HIdqo7cC9ilZ3NBo7eu261LRadyg
	EaUrdbiOTs/xcCBrg75sfQH45ke/Al0TNT2hkBQI9TJ2inL+FkybIQhMIU061DbDb3+4DPOHuH5
	P
X-Google-Smtp-Source: AGHT+IHUaiC7CK6CdZ199QZAgPkzDI8L6GWOCXVbHNwek8ATHbDzH//F+Chui1fY3ZszYHvOcl2DaA==
X-Received: by 2002:a17:906:dc8f:b0:a7d:88c4:2897 with SMTP id a640c23a62f3a-a8078fef41cmr230132166b.2.1723045192458;
        Wed, 07 Aug 2024 08:39:52 -0700 (PDT)
From: Matthew Barnes <matthew.barnes@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Matthew Barnes <matthew.barnes@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [XEN PATCH v2] x86/emul: Fix misaligned IO breakpoint behaviour in PV guests
Date: Wed,  7 Aug 2024 16:39:37 +0100
Message-Id: <4219d12fcd075635c8c2548c5d14471642af3038.1723045077.git.matthew.barnes@cloud.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Bcc: Matthew Barnes <matthew.barnes@cloud.com>
Content-Transfer-Encoding: 8bit

When hardware breakpoints are configured on misaligned IO ports, the
hardware will mask the addresses based on the breakpoint width during
comparison.

For PV guests, misaligned IO breakpoints do not behave the same way, and
therefore yield different results.

This patch tweaks the emulation of IO breakpoints for PV guests such
that they reproduce the same behaviour as hardware.

Fixes: bec9e3205018 ("x86: emulate I/O port access breakpoints")
Signed-off-by: Matthew Barnes <matthew.barnes@cloud.com>
---
Changes in v2:
- Refactor breakpoint port masking to be more succinct
- Add 'Fixes' line to commit message
---
 xen/arch/x86/pv/emul-priv-op.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index f101510a1bab..aa11ecadaac0 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -346,6 +346,8 @@ static unsigned int check_guest_io_breakpoint(struct vcpu *v,
         case DR_LEN_8: width = 8; break;
         }
 
+        start &= ~(width - 1UL);
+
         if ( (start < (port + len)) && ((start + width) > port) )
             match |= 1u << i;
     }
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 07 15:55:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 15:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773603.1184041 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbj08-00065W-Eq; Wed, 07 Aug 2024 15:55:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773603.1184041; Wed, 07 Aug 2024 15:55:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbj08-00065P-C8; Wed, 07 Aug 2024 15:55:00 +0000
Received: by outflank-mailman (input) for mailman id 773603;
 Wed, 07 Aug 2024 15:54: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=YcC0=PG=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sbj07-00065J-E6
 for xen-devel@lists.xenproject.org; Wed, 07 Aug 2024 15:54:59 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 657cd022-54d5-11ef-bc04-fd08da9f4363;
 Wed, 07 Aug 2024 17:54:58 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-5a309d1a788so2187394a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 08:54:58 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5b83b82bf63sm7158115a12.75.2024.08.07.08.54.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 07 Aug 2024 08:54:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 657cd022-54d5-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723046097; x=1723650897; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=qRX8RVG4FEOsacXpgLDq2I3cLU9cm+hxNM7YEM968OE=;
        b=NA7cnjYssTfTsL60r2TbtuDke+YvQKngTg+21PNKeke2QZtx2Zs/n6SLSoR2hUkYnn
         k2jMD6ntjDl1mOMOhO8WjonF6EtuGnsruxOmJI5/vW1UqnE/AwDMJ1KC70bTZc44OR1/
         mdy8HX4cWYHaZByryHfkBRl6pE1T4CLMiHj5odwDTz06SZphqgfAb5Bd4tnkvQyelImB
         AL61XNn2Ar6FGXWuGpsecU6jVsvA5c7rShmCN2ku4LM4D6k9RA17jEru8GeMzprbxI/t
         gueq9SpaqEtUqCinYfdZnvP3a/sseYYCfnvswfvnCsuwWQ18q6eCRkfF3om1iLybjsF5
         xYQQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723046097; x=1723650897;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=qRX8RVG4FEOsacXpgLDq2I3cLU9cm+hxNM7YEM968OE=;
        b=PjJU9T9nLO244ESM4dKNBIStwFoSakSsIg7AIz8aUZwagkPU028dOejEI1ReBcruyb
         5O7ZqDm2F64DJYvoEdhOteBedctp0fawAxmrloi20v+FkbnQQAEkiLcJA6tgJ2zGgTok
         lD/e1s7+PB5egeqAVq4BWgiV0lJa2ljU1+IPnHCiD2t08amE8Oirv4lMRToKiv8L82+j
         DZCiySeTD6T6WTR8ZkapQDvRvmCYQmB9jbP6r4qvoUAzw21VPJWoqzrOlVZwceCcgYlK
         eWn5i5mMfbbG1ej7Gufo3x5PsoVNNJTWPIOKj6cSSoGSlmuRrVnGb6B6P1rShNZBTCBO
         2yCg==
X-Forwarded-Encrypted: i=1; AJvYcCUFAnJ/YwECebVIa1D4BhfP1ykDiH+WW3sYh2yTUkLJMEKxqdBa61EBLoE7gPS1tsilEkyVnfPJfqsXKBURfpquWSTrlnzbYelIZCKXwXg=
X-Gm-Message-State: AOJu0YxX+WueUc9B8qz+6Of+5VpCHqogUqtna5LpezL8+b0YZKVWlxK8
	nyam9hyC/mOV/DiLpC2d+cK7eNgs3WFCwMDCluiUsL7nl7qi5VWs
X-Google-Smtp-Source: AGHT+IFjMrV0NJeyQxj1R2xI3QLqmUlC7KzJBSb8IhsDOX4MbKIh/D7av/2y4LjL7o2GIAvtGJUEaA==
X-Received: by 2002:a50:a6d4:0:b0:5b8:3cff:718b with SMTP id 4fb4d7f45d1cf-5b83cff72d6mr13073485a12.16.1723046097148;
        Wed, 07 Aug 2024 08:54:57 -0700 (PDT)
Message-ID: <541ad417f440744b2a4238f5a5c5d65deefe81f4.camel@gmail.com>
Subject: Re: [PATCH v13 1/2] xen/riscv: enable GENERIC_BUG_FRAME
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Wed, 07 Aug 2024 17:54:56 +0200
In-Reply-To: <714d14c9-cd5e-4456-84ac-379e736c31c1@suse.com>
References: <cover.1722960083.git.oleksii.kurochko@gmail.com>
	 <516ada36487fd57f7a784f9fb3fe328f5365bd85.1722960083.git.oleksii.kurochko@gmail.com>
	 <714d14c9-cd5e-4456-84ac-379e736c31c1@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Wed, 2024-08-07 at 16:39 +0200, Jan Beulich wrote:
> On 06.08.2024 18:37, Oleksii Kurochko wrote:
> > Enable GENERIC_BUG_FRAME to support BUG(), WARN(), ASSERT,
> > and run_in_exception_handler().
> >=20
> > "UNIMP" is used for BUG_INSTR, which, when macros from <xen/bug.h>
> > are used, triggers an exception with the ILLEGAL_INSTRUCTION cause.
> > This instruction is encoded as a 2-byte instruction when
> > CONFIG_RISCV_ISA_C is enabled:
> > =C2=A0 ffffffffc0046ba0:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 0000=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unimp
> > and is encoded as a 4-byte instruction when CONFIG_RISCV_ISA_C
> > ins't enabled:
> > =C2=A0 ffffffffc005a460:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 c0001073=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 unimp
> >=20
> > Using 'ebreak' as BUG_INSTR does not guarantee proper handling of
> > macros
> > from <xen/bug.h>. If a debugger inserts a breakpoint (using the
> > 'ebreak'
> > instruction) at a location where Xen already uses 'ebreak', it
> > creates ambiguity. Xen cannot distinguish whether the 'ebreak'
> > instruction is inserted by the debugger or is part of Xen's own
> > code.
> >=20
> > Remove BUG_INSN_32 and BUG_INSN_16 macros as they encode the ebreak
> > instruction, which is no longer used for BUG_INSN.
> >=20
> > Update the comment above the definition of INS_LENGTH_MASK as
> > instead of
> > 'ebreak' instruction 'unimp' instruction is used.
> >=20
> > <xen/lib.h> is included for the reason that panic() and printk()
> > are
> > used in common/bug.c and RISC-V fails if it is not included.
> >=20
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>=20
> Acked-by: Jan Beulich <jbeulich@suse.com>
Thanks.

>=20
> Just one more (cosmetic) question:
>=20
> > --- a/xen/arch/riscv/include/asm/bug.h
> > +++ b/xen/arch/riscv/include/asm/bug.h
> > @@ -9,7 +9,7 @@
> > =C2=A0
> > =C2=A0#ifndef __ASSEMBLY__
> > =C2=A0
> > -#define BUG_INSTR "ebreak"
> > +#define BUG_INSTR "UNIMP"
>=20
> Deliberately all uppercase?
It could be lowercase without any issue. It was mentioned in uppercase
in RISC-V assembly manual:
```
To better diagnose situations where the program flow reaches an
unexpected
location, you might want to emit there an instruction that's known to
trap. You
can use an `UNIMP` pseudoinstruction, ...
```

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 17:25:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 17:25:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773626.1184095 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbkP7-0003fo-Ez; Wed, 07 Aug 2024 17:24:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773626.1184095; Wed, 07 Aug 2024 17:24:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbkP7-0003fh-Br; Wed, 07 Aug 2024 17:24:53 +0000
Received: by outflank-mailman (input) for mailman id 773626;
 Wed, 07 Aug 2024 17:24:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbkP6-0003fX-O4; Wed, 07 Aug 2024 17:24:52 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbkP6-00006m-MK; Wed, 07 Aug 2024 17:24:52 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbkP6-00011T-73; Wed, 07 Aug 2024 17:24:52 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbkP6-0007KS-6f; Wed, 07 Aug 2024 17:24:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=0wOEjQG52gmsSfGK46jJSvkh7rs39mUCIcXm0aaa8LA=; b=v94P2PVElSyX99Y1sTwuSu0eZO
	yi9bRLtQfj3PAEGv4WrYnMhjcePR4JezaDY0+Uu3+vIXI5U1cBgZCsrBP0r767t6gMJmvpXM36rqg
	1vRclWcujixywerdMGhsSy2olMpT7h6i6C5PZARGXhpgyxTZZUNVz56KdOJU+qBj16r0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187180-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187180: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=6b9b96ddebf269579730ff2a65f324505bc2aba9
X-Osstest-Versions-That:
    xen=bec25f11d5180d407cf04d2de2525fa6f876bde1
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 07 Aug 2024 17:24:52 +0000

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

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail pass in 187183-retest

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

version targeted for testing:
 xen                  6b9b96ddebf269579730ff2a65f324505bc2aba9
baseline version:
 xen                  bec25f11d5180d407cf04d2de2525fa6f876bde1

Last test of basis   187171  2024-08-06 09:22:53 Z    1 days
Failing since        187174  2024-08-06 19:39:15 Z    0 days    2 attempts
Testing same since   187180  2024-08-07 04:45:44 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Julien Grall <jgrall@amazon.com>
  Luca Fancellu <luca.fancellu@arm.com>
  Michal Orzel <michal.orzel@amd.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Sergiy Kibrik <Sergiy_Kibrik@epam.com>
  Shawn Anastasio <sanastasio@raptorengineering.com>
  Stefano Stabellini <sstabellini@kernel.org>
  Stefano Stabellini <stefano.stabellini@amd.com>
  Stewart Hildebrand <stewart.hildebrand@amd.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   bec25f11d5..6b9b96ddeb  6b9b96ddebf269579730ff2a65f324505bc2aba9 -> master


From xen-devel-bounces@lists.xenproject.org Wed Aug 07 20:55:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Aug 2024 20:55:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773674.1184120 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbngm-00005k-48; Wed, 07 Aug 2024 20:55:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773674.1184120; Wed, 07 Aug 2024 20:55:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbngm-00005c-1A; Wed, 07 Aug 2024 20:55:20 +0000
Received: by outflank-mailman (input) for mailman id 773674;
 Wed, 07 Aug 2024 20:55:18 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbngk-00005R-Mp; Wed, 07 Aug 2024 20:55:18 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbngk-0003jY-Cj; Wed, 07 Aug 2024 20:55:18 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbngj-0005nV-PP; Wed, 07 Aug 2024 20:55:17 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbngj-0005AZ-P2; Wed, 07 Aug 2024 20:55:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=tBxz0uLEbttOf4eyXQQU/NqbnTXQRM7J5mK1icK5vVY=; b=3cbPk5ggtiwWrzqUgbzAa41TE6
	SmMrSd3v8vd4x5EGz9aX5SVuNnj/dU2Bvhw2Znkw4CWz+4gTrPzoB/410O6PdG6MvXxQ3e04JWqN2
	l2aKisXeDw3SzPSHxY2Gf08YEWRtgsr9jTZqeFzQMQ69egKUyGMTRUiJQw8y88DSOFX4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187182-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187182: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:xen-boot:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=d4560686726f7a357922f300fc81f5964be8df04
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 07 Aug 2024 20:55:17 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827

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

version targeted for testing:
 linux                d4560686726f7a357922f300fc81f5964be8df04
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   22 days
Failing since        186925  2024-07-20 09:44:52 Z   18 days   38 attempts
Testing same since   187176  2024-08-07 00:41:55 Z    0 days    2 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 01:16:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 01:16:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773687.1184130 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbrlB-0006ig-6R; Thu, 08 Aug 2024 01:16:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773687.1184130; Thu, 08 Aug 2024 01:16:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbrlB-0006iZ-3D; Thu, 08 Aug 2024 01:16:09 +0000
Received: by outflank-mailman (input) for mailman id 773687;
 Thu, 08 Aug 2024 01:16:08 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbrlA-0006iN-Eg; Thu, 08 Aug 2024 01:16:08 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbrlA-00033k-3v; Thu, 08 Aug 2024 01:16:08 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbrl9-0006to-Oc; Thu, 08 Aug 2024 01:16:07 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbrl9-0005aT-O9; Thu, 08 Aug 2024 01:16:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=/XEPsRw6U+lmTDn8l0/Al+BUoQyQLXjkvNvv85INuzk=; b=h4KaVbkFpdATvnS4ccyexDj/IR
	bBF0uQaQDdvK1zrefN2fXu0ptCWcdGQLObR4UKg4Cv/icP6+700et4Gu6JuJ1iFyID8zPJYFwTXF3
	FgxEXYv4o4T2EdjR1hz2YivJ3e9X9nmOg1iUcU1lWCSErhIXf0/k7BJmqWaUfHWTc97Y=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187185-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187185: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=ab6ad2fbdbaad1eb3a766973d6f587685d784d48
X-Osstest-Versions-That:
    ovmf=976113774320e5f18bb5bd6f21dd062c1d74f3d4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 08 Aug 2024 01:16:07 +0000

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

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 ab6ad2fbdbaad1eb3a766973d6f587685d784d48
baseline version:
 ovmf                 976113774320e5f18bb5bd6f21dd062c1d74f3d4

Last test of basis   187177  2024-08-07 03:43:22 Z    0 days
Testing same since   187185  2024-08-07 23:13:17 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Saloni Kasbekar <saloni.kasbekar@intel.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   9761137743..ab6ad2fbdb  ab6ad2fbdbaad1eb3a766973d6f587685d784d48 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 03:26:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 03:26:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773699.1184140 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbtmy-0000SV-Um; Thu, 08 Aug 2024 03:26:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773699.1184140; Thu, 08 Aug 2024 03:26:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbtmy-0000SO-Rq; Thu, 08 Aug 2024 03:26:08 +0000
Received: by outflank-mailman (input) for mailman id 773699;
 Thu, 08 Aug 2024 03:26:08 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbtmy-0000SE-5E; Thu, 08 Aug 2024 03:26:08 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbtmx-0005gL-TE; Thu, 08 Aug 2024 03:26:07 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbtmx-0002ld-9I; Thu, 08 Aug 2024 03:26:07 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbtmx-0006ru-8h; Thu, 08 Aug 2024 03:26:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=gOPqC+X+c7OWkmrBLIq0exM+uKojTSU2rziQ2csQt+E=; b=KIEcozOBQeZJK5hXjvhM8KSeF0
	NKn9+KEQntu9aYLiKR7l5nU+WyKIYVuTEHIHbfZbrr33GPEgwso/DiaeBVvA7jKYdXZb34D4LQsyk
	MVTAtNFopcOUEA+HtyyeOUkZDKxzpaNaK2hvioouK13aHU/jvXDZGycHPRqv7WtPSNFg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187184-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187184: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:regression
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=6a0e38264012809afa24113ee2162dc07f4ed22b
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 08 Aug 2024 03:26:07 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail REGR. vs. 186827

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

version targeted for testing:
 linux                6a0e38264012809afa24113ee2162dc07f4ed22b
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   22 days
Failing since        186925  2024-07-20 09:44:52 Z   18 days   39 attempts
Testing same since   187184  2024-08-07 21:12:35 Z    0 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 04:36:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 04:36:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773711.1184150 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbuss-0002sc-T4; Thu, 08 Aug 2024 04:36:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773711.1184150; Thu, 08 Aug 2024 04:36:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbuss-0002sV-Px; Thu, 08 Aug 2024 04:36:18 +0000
Received: by outflank-mailman (input) for mailman id 773711;
 Thu, 08 Aug 2024 04:36:16 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbusq-0002sL-QI; Thu, 08 Aug 2024 04:36:16 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbusq-00077d-Fg; Thu, 08 Aug 2024 04:36:16 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sbusp-0006ph-WB; Thu, 08 Aug 2024 04:36:16 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sbusp-0008Ay-VZ; Thu, 08 Aug 2024 04:36:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=T9pia2LFqC+DREfFaCHmV5goD/0qMqRGtB6yWdsCg3M=; b=7Nm8ip2OW7bm2O6hW4wLiwPL37
	+fH/9lFv232u628OgSmnKAFzBSioq20BYAVpClz2zpYifZUgO1ICNid8VpuQRtLIaDDRZI1ebg4U5
	yTzTPsLz15Uq3qtHfZTIVzZMm0Iu+31WfSdahh2fHIsz4piB4OyRz+gttTPfny8TS+Wg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187187-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187187: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=b0f43dd3fdec2363e3548ec31eb455dc1c4ac761
X-Osstest-Versions-That:
    ovmf=ab6ad2fbdbaad1eb3a766973d6f587685d784d48
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 08 Aug 2024 04:36:15 +0000

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

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

Last test of basis   187185  2024-08-07 23:13:17 Z    0 days
Testing same since   187187  2024-08-08 01:56:57 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Dat Mach <dmach@nvidia.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   ab6ad2fbdb..b0f43dd3fd  b0f43dd3fdec2363e3548ec31eb455dc1c4ac761 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 06:54:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 06:54:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773726.1184160 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbx2V-0006Bf-Fy; Thu, 08 Aug 2024 06:54:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773726.1184160; Thu, 08 Aug 2024 06:54:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbx2V-0006BY-Cc; Thu, 08 Aug 2024 06:54:23 +0000
Received: by outflank-mailman (input) for mailman id 773726;
 Thu, 08 Aug 2024 06:54:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbx2U-0006BQ-F3
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 06:54:22 +0000
Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com
 [2a00:1450:4864:20::52f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 09f0bd00-5553-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 08:54:21 +0200 (CEST)
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5a3b866ebc9so657351a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 07 Aug 2024 23:54:21 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bbb2e5e717sm326021a12.85.2024.08.07.23.54.20
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 07 Aug 2024 23:54:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 09f0bd00-5553-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723100060; x=1723704860; 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=wjxPx5bBvGFmvmqASkZblaZ3W3BnBimY0US45zLzZFs=;
        b=DcOKvz4Ly2eeXarwtnNygiyisGLzCvPnj7hIwnEukj4OAmGuLeXFlD1vd6lM7OvJl/
         tL833CQcNs4f/oKIbcKAKPX2QAgDUi86YRYeTlWQQd5052o0cCJLwTNLubav5DJA3E3k
         NFlcryNbJR5o6hotctsQ0ZCLl8FoTyoz8aDbbapJ5h2AeElGaOFXEZVrNDcHeO+wPl54
         CNgDOKO3zN5hoTLgqI8VxYfEWO8NvTqvwRBY259qSdOXOJH6cAdTVcsefquifkbLq4FR
         vuwN1i2ev9PTcT0pCKD74eIWF7iccUAvFkmcW4GaTTyuQUdy/Xi9xXkxMaKb2QsLc4+E
         u13g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723100060; x=1723704860;
        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=wjxPx5bBvGFmvmqASkZblaZ3W3BnBimY0US45zLzZFs=;
        b=OakkkUtRJJm0BvS8xeB2K7pajAtMrQ+k8aUm/e3baduihaHmJUN3r3r0a1inh8CTHh
         uR6vb9jFX1NNdkVdDyb/yEERHJcybBZa03rO4YTIO6jTSKsV92a0bXAPTeS1hpfq5myj
         kGWjsbLkXvhYhc3xphs90dxJekpm/AWDfX9Fz/qkDqkTULEJX+VfL/yWq+v4mfvKroCB
         JPbwBmfAFnpHbzsGMWzGW0gUChITS9LguG2RvCeFREYJ9nZHZBRilh6BBvD/smRoxbQE
         m8tui+LUAU1q9YEuWDppH6iGQL29ebAw+zDJuG/+BBCP83GQ59YhNPp2dYY37ZjA9fei
         r8XA==
X-Forwarded-Encrypted: i=1; AJvYcCUNRaKC1ukOaiHrvj4gSNpwnfWBn0U324kLXUt+UVQj498KQ9t+l0Id2oOhWEJxlENvv6EY+1YEbfWbal7d3cBGNs90NGR+dmuZtDzW2fU=
X-Gm-Message-State: AOJu0YwML9V7gHpS+uZGviJKfZlg4EGUMkIHjxV9iBwLXAr42H0QS79d
	LLcdkQ8M5JTX3kqDAuvyCXQ0rCZ7echCC1EK7bWNBXxLfyfi+ZBiUscU2TTdtA==
X-Google-Smtp-Source: AGHT+IHlVfH3qZ3THZ8Y8RDriFS7qu69aGRzSmw46WQ54OdNbwfyqJmCPRdviYIApZANOWpXB19LtA==
X-Received: by 2002:a05:6402:274d:b0:58b:9561:650b with SMTP id 4fb4d7f45d1cf-5bbb23f6b24mr839205a12.25.1723100060438;
        Wed, 07 Aug 2024 23:54:20 -0700 (PDT)
Message-ID: <9ec8cee5-649d-4a7c-b1e2-0c6c83daee0b@suse.com>
Date: Thu, 8 Aug 2024 08:54:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v2] x86/emul: Fix misaligned IO breakpoint behaviour
 in PV guests
To: Matthew Barnes <matthew.barnes@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <4219d12fcd075635c8c2548c5d14471642af3038.1723045077.git.matthew.barnes@cloud.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: <4219d12fcd075635c8c2548c5d14471642af3038.1723045077.git.matthew.barnes@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 07.08.2024 17:39, Matthew Barnes wrote:
> When hardware breakpoints are configured on misaligned IO ports, the
> hardware will mask the addresses based on the breakpoint width during
> comparison.
> 
> For PV guests, misaligned IO breakpoints do not behave the same way, and
> therefore yield different results.
> 
> This patch tweaks the emulation of IO breakpoints for PV guests such
> that they reproduce the same behaviour as hardware.
> 
> Fixes: bec9e3205018 ("x86: emulate I/O port access breakpoints")
> Signed-off-by: Matthew Barnes <matthew.barnes@cloud.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Thu Aug 08 07:11:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 07:11:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773735.1184170 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbxJ6-0001HH-0T; Thu, 08 Aug 2024 07:11:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773735.1184170; Thu, 08 Aug 2024 07:11:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbxJ5-0001HA-Sk; Thu, 08 Aug 2024 07:11:31 +0000
Received: by outflank-mailman (input) for mailman id 773735;
 Thu, 08 Aug 2024 07:11:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbxJ4-0001H4-Fz
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 07:11:30 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6e799b77-5555-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 09:11:28 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5a1337cfbb5so774524a12.3
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 00:11:28 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bbb2e5ed4asm343835a12.83.2024.08.08.00.11.27
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 00:11:27 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6e799b77-5555-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723101088; x=1723705888; 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=OIbBZ7rPq/lWNPoeKV3SIykU/mWcxqiwdGJ9AXQk8T4=;
        b=WKGqvA0emJxI0x1nqGXInFgppw3RXbsyJYAhE7a3zqlG+9BU2h4KmGSExqBAD+PimN
         TPx5qMXDLgZAKgS76VF45MYo3MiYIbneLCTFp04zA2+m1kHu7Mvoc3PApWzDo+LwjZjQ
         8hSO+yfQK7cnE884MGpXNT8qSh+d/okY8964Uv4HjWdOCb4TUYb66dH5ZkCsvNIoZn/w
         jlshzGrfDPrY3CpwIEXGGfY1PCAFpZbni4FdkEERQEKHNS4rvKPMkdZv4OqNL1UpRNG6
         kImOYLnnGjyQy1AD8JhE8N1iEwpsJuTgPn3IGzpdoyXxai9ilKofYyRDQSvz2Uy+2hKx
         7hDQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723101088; x=1723705888;
        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=OIbBZ7rPq/lWNPoeKV3SIykU/mWcxqiwdGJ9AXQk8T4=;
        b=Fu5+T4uNu8hCd4r7F21tqRuMOn92l7RkcACfmor3OV3hvWp86BgH2Q+vesGuMgR46y
         VOhOTI79MsEq0AGLMVPFiC5lRMolxfVkiXXGtzOqe1/Cu1y58GkIIysyHmET7H3Gm+Gy
         6lxN6UzR+TxYvFVuvUWcsV39IbXrtAl26iVHhF8PfP8KtWccYQxftFOaiIxxXxs0+SZD
         KttiZcH/yns3G1vR0z0zkpMU934WMrZIQj8gDSG2cuqolc/0bp0CPyWRouZfFADM63FB
         uPC43jg1v3r22p5GIY2kdtxWc2qdJl2kw3eJ0hUNpEXk5YvNhH+30+v3Q5/slLZnP2qn
         rg5Q==
X-Forwarded-Encrypted: i=1; AJvYcCUooAUf9g8jTbTGbm+n5opxTeULufrjVO6l/hSB2dkQglxVk+oJMUT6nHplQsPfCW/GQwsnLzNhtG4=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy98rKVYNG2eXHXgQsde9EHS7rCtDasqylzGt2NKDpRNisVmAUV
	BKQAQ7+Eir04iIpmY4bAyB6tNkcl9/0c9TWrE2JQv1W8afvT21DJtXxY0eJ1RQ==
X-Google-Smtp-Source: AGHT+IEer2cc+CiMlWUWJFGP/fJ+qH/zZ6AS8HK4X+1hetHPA74wA1gweLE/fKB8gJxYahOQyn530A==
X-Received: by 2002:a05:6402:5206:b0:587:86d8:8b54 with SMTP id 4fb4d7f45d1cf-5bbb2182b28mr820282a12.4.1723101087951;
        Thu, 08 Aug 2024 00:11:27 -0700 (PDT)
Message-ID: <5e081ae3-25b1-48cd-8878-8efd47b57032@suse.com>
Date: Thu, 8 Aug 2024 09:11:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v2] x86/intel: optional build of PSR support
To: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <20240801084453.1163506-1-Sergiy_Kibrik@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240801084453.1163506-1-Sergiy_Kibrik@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 01.08.2024 10:44, Sergiy Kibrik wrote:
> --- a/xen/arch/x86/domctl.c
> +++ b/xen/arch/x86/domctl.c
> @@ -1162,6 +1162,7 @@ long arch_do_domctl(
>      }
>  
>      case XEN_DOMCTL_psr_cmt_op:
> +#ifdef CONFIG_INTEL
>          if ( !psr_cmt_enabled() )
>          {
>              ret = -ENODEV;
> @@ -1190,11 +1191,16 @@ long arch_do_domctl(
>              ret = -ENOSYS;

This pre-existing use of -ENOSYS is imo wrong; should be -EINVAL or -EOPNOTSUPP.

>              break;
>          }
> +
> +#else /* CONFIG_INTEL */
> +        ret = -ENOSYS;

This use therefore is imo wrong, too. However, can't we avoid #ifdef-ary here
altogether by supplying a stub psr_cmt_enabled() (plus keeping the decls
visible for psr_{alloc,free}_rmid())? Similarly for the respective code in
sysctl.c then.

> +#endif
>          break;
>  
>      case XEN_DOMCTL_psr_alloc:
>          switch ( domctl->u.psr_alloc.cmd )
>          {
> +#ifdef CONFIG_INTEL
>          case XEN_DOMCTL_PSR_SET_L3_CBM:
>              ret = psr_set_val(d, domctl->u.psr_alloc.target,
>                                domctl->u.psr_alloc.data,
> @@ -1257,6 +1263,8 @@ long arch_do_domctl(
>  
>  #undef domctl_psr_get_val
>  
> +#endif /* CONFIG_INTEL */
> +
>          default:
>              ret = -EOPNOTSUPP;
>              break;

Here (and again for the respective sysctl code) otoh I'm okay with the #ifdef.

> @@ -225,10 +233,11 @@ long arch_do_sysctl(
>  
>      case XEN_SYSCTL_psr_alloc:
>      {
> -        uint32_t data[PSR_INFO_ARRAY_SIZE] = { };
> +        uint32_t __maybe_unused data[PSR_INFO_ARRAY_SIZE] = { };

Remark to Andrew: Leaving aside the fact that the initializer here stands in
the way of doing so, the need for this (imo ugly) attribute is one of the
reasons why generally I'd prefer such declarations to live ...

>          switch ( sysctl->u.psr_alloc.cmd )
>          {
> +#ifdef CONFIG_INTEL

... immediately inside the switch() accessing them.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 07:34:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 07:34:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773744.1184179 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbxf6-0004vN-Na; Thu, 08 Aug 2024 07:34:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773744.1184179; Thu, 08 Aug 2024 07:34:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbxf6-0004vG-KW; Thu, 08 Aug 2024 07:34:16 +0000
Received: by outflank-mailman (input) for mailman id 773744;
 Thu, 08 Aug 2024 07:34:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbxf5-0004vA-KC
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 07:34:15 +0000
Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com
 [2a00:1450:4864:20::52c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9c8e5a94-5558-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 09:34:14 +0200 (CEST)
Received: by mail-ed1-x52c.google.com with SMTP id
 4fb4d7f45d1cf-5a309d1a788so616204a12.3
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 00:34:14 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9bc3c4fsm713666766b.33.2024.08.08.00.34.13
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 00:34:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9c8e5a94-5558-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723102454; x=1723707254; 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=FvbSpkbhROaKt0ZoBbzbmF66E7ChOpZajBTvXGE0qWg=;
        b=Pdf+/tLKbIyg3uHuP+/tXGou3wdnNE8bGFBXGkq67TbG+X8YIGJNHoZGXBv/ACcmUK
         B16HkLdy1U3gUs11GD4tJr7Jzflco81lkYpdUZAeWMzVX9FC7vOh0DF/HbsyZYViYd8/
         zxBi54rTZMua0kEm93DeawwxCs8uMBN4evJn1n3cD0QUk/rTn3z/BjmpviZ4C7DZxvan
         rgYiiZ8RGV55WpCxoSG/j4NMo6lU/W3BMcGpXB2uokpWxjFFg4padB3a5EmcU3tyH31p
         P8vSYuAIEHqnVSyr9UutRG92MWn4fnq+D/DJhAf36ZeU+BPyvAThdfV0E/OMi2ZilQJn
         fHqA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723102454; x=1723707254;
        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=FvbSpkbhROaKt0ZoBbzbmF66E7ChOpZajBTvXGE0qWg=;
        b=HPbeyYnhWEZeP7MWJ5moMAAYVMJA9F8DsTJFbjI7qhVqaYIcAIFtyWIhu4CKwsktmH
         xuqKAe7n9moNSkVzcfzY94bdmStUYL0/W0lT98KQh6Vdu+MSlgf44ebmZ2pmQVYDQrMi
         0bOKUrBxPKAlK0FYL+gNCCvuMG2zE8EkvFyOJQr8dQ9xkg01hhgOpvtePVKI4y9rXouC
         Q9C6R/le3iDHWSQqICW1s0nFeKz91jVyKpJvyhxWCG3K3nPxxjE8iBoD4XZVx2S+5+A2
         0IoMtjgq9W0Z8UYqj77Q62xdtK7r7T8Ap8k6wl0q83KU1yaPzh78m3rNhYf5is84c6Jv
         lc/A==
X-Forwarded-Encrypted: i=1; AJvYcCVZlyIjcAOoOmGkUDDwOZfSoRMb1FJGXZtDJklbi5WToL9mvhCnwPkGwWX56lQSOXKkU65QMq0+dhot24riXuMOnEqhXuUfXPiygzCMjmQ=
X-Gm-Message-State: AOJu0Yzt8nSURa/VSLkE05/h/jNBBRsZU5PnzguSZo0wBvOAY8rxBwAR
	eSdslWbvPXNimbmoJUH/D5XVKu97Nxgnh+I0dyvNx/wSHlozwrtiRaHILGyiUQ==
X-Google-Smtp-Source: AGHT+IEO0e2aAnHSJQ8Q3xHrwm7bYfM0DFHfQrEC03pasgqcdlWv3LhgQt4X3tK+4UxXGpzleX3ngg==
X-Received: by 2002:a17:907:f714:b0:a7a:9f0f:ab2b with SMTP id a640c23a62f3a-a8090db15e6mr64311566b.32.1723102453621;
        Thu, 08 Aug 2024 00:34:13 -0700 (PDT)
Message-ID: <ad72cc97-b9dd-4e7e-93f6-333805e40785@suse.com>
Date: Thu, 8 Aug 2024 09:34:12 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/5] x86: Put trampoline in .init.data section
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-2-alejandro.vallejo@cloud.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: <20240807134819.8987-2-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 07.08.2024 15:48, Alejandro Vallejo wrote:
> This change allows to put the trampoline in a separate, not executable
> section. The trampoline contains a mix of code and data (data which
> is modified from C code during early start so must be writable).
> This is in preparation for W^X patch in order to satisfy UEFI CA
> memory mitigation requirements.

Which, aiui, has the downside of disassembly of the section no longer
happening by default, when using objdump or similar tools, which go from
section attributes. Why is it being in .init.text (and hence RX) not
appropriate? It should - in principle at least - be possible to avoid
all in-place writing to it, but instead only ever write to its relocated
copy. Quite a bit more code churn of course.

I wonder if we shouldn't put the trampoline in its own section, RWX in
the object file, and switched to whatever appropriate in the binary
(which really may be RX, not RW).

> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -870,6 +870,8 @@ cmdline_parse_early:
>  reloc:
>          .incbin "reloc.bin"
>  
> +        .section .init.data, "aw", @progbits
> +        .align 4

Is the .align really needed here? I think ...

>  ENTRY(trampoline_start)

... ENTRY() covers this properly? And actually in a better way, using
CODE_FILL (which ultimately we will want to switch from 0x90 to 0xcc, I
suppose) rather than whatever the assembler puts in by default for data
sections.

Jan

>  #include "trampoline.S"
>  ENTRY(trampoline_end)



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 07:49:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 07:49:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773753.1184191 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbxtu-0007b4-UQ; Thu, 08 Aug 2024 07:49:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773753.1184191; Thu, 08 Aug 2024 07:49:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbxtu-0007ax-Pw; Thu, 08 Aug 2024 07:49:34 +0000
Received: by outflank-mailman (input) for mailman id 773753;
 Thu, 08 Aug 2024 07:49:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbxtt-0007ar-Qa
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 07:49:33 +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 bfcb38b7-555a-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 09:49:32 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5b8c2a61386so793775a12.2
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 00:49:32 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bbb2d34a69sm369770a12.70.2024.08.08.00.49.31
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 00:49:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bfcb38b7-555a-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723103372; x=1723708172; 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=dy+N9f0P7qZ431Chc19ivswpPwLGLpvsx4lm/PF1zX8=;
        b=bSgJ5NkoB7jyJz6d5WVbaE9zC603pmRHFGfM+qq/JYSQmjYYJgfCI5d8wLVtdnR0B8
         BZMDDvgqEHcvAZLBMWJBBtiDU6Jeq+in0hC/19ndifpby03pIXU1qnTJU5GRO68/kG8p
         II0lixVk6o8Ynn5fcIPcSbDpCK461jTSFZjLhUGXzvRSLY3RvR6BQx8q8LyA4Sez6x/x
         OxWjz6ar8JC22TfrEfca55M1HvSCmrBGx/hrmD9sKmGGOWdSGJsS4EaSRj1Uq6hS4WSd
         H+ABW1Ld0nuPUwXg8X2vXjGxLtJHRP5dUGoFIPbpRjZEVVM24jwXjk4msuLRTd1gGqhQ
         0skw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723103372; x=1723708172;
        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=dy+N9f0P7qZ431Chc19ivswpPwLGLpvsx4lm/PF1zX8=;
        b=ln8XhIyECXbvS5228cPrUYmjiSs0oFEYa3gc1GT9wv8n+WE5Aira/Rx6SDpJqt0ExT
         P2XJgmHsuSph9LR1/71zLxQmqfhsFL3zYMcOimRlcePbxQXqJ8oSKBqpYQbZYpyRPE+Q
         OW6n9kZ3r82xeP1+5CP/6GdhvVyxa0ZgzYg0hRApzvjvR0TeVU1Bo7JTgKi4u1HBjfa+
         D5GlYjkEjoAFkadzaxBvdDF9CBxsFidE/guad2W3nSy28UPqRaWd13e2tgWNj6a11yVm
         z+lXPi3jtYHNJNw0FDz6mL3De9XY8d5i1E9mpU9ExGhzh5i06QbaikG4dU6oekL5kPUy
         NSUA==
X-Forwarded-Encrypted: i=1; AJvYcCWuyqfNjleaNOTB3uiNO3i8cfAiUvknkMz2e/86p/3POdIMZgnxfoS3bGcU+tryF8MnccWfCWAaVfsaz/hPkZrR38/gl3hjWGSEINLVypw=
X-Gm-Message-State: AOJu0Yx19CDDaaVZX1dnfRUm1JW0vYb/bYd6MiFJMjY8y5pcblpxLnNY
	gldbQo3QoKoXGA7pyQYMVZVwPhWgUKlI0p/oFiAktaog+z3mTC57T6Sg+1w98Q==
X-Google-Smtp-Source: AGHT+IFr/U85rnSIZALNdBIx2UOvzx6GmS6M3+hn2qhYW+AXAGBJm3ri3YpVysrhcusy8Xiajp0TNQ==
X-Received: by 2002:a05:6402:1d4d:b0:578:60a6:7c69 with SMTP id 4fb4d7f45d1cf-5bbb23def27mr701785a12.30.1723103371677;
        Thu, 08 Aug 2024 00:49:31 -0700 (PDT)
Message-ID: <7f1e17dd-d105-4f6c-87d3-69f3dca4ab82@suse.com>
Date: Thu, 8 Aug 2024 09:49:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/5] x86: Fix early output messages in case of EFI
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-3-alejandro.vallejo@cloud.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: <20240807134819.8987-3-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 07.08.2024 15:48, Alejandro Vallejo wrote:
> If code is loaded by EFI the loader will relocate the image
> under 4GB.

This is the MB2 EFI path you're talking about? Since there are two paths,
I think this needs clearly separating in all descriptions.

If it is the MB2 path, then "relocate" isn't quite correct, I think:
Relocations aren't applied in that case, as none are present in xen.gz.
I'd rather call this "put at an address below 4G". However, that isn't
any different from the non-EFI MB1/2 paths, is it? I feel like I'm
missing something here.

> This cause offsets in x86 code generated by
> sym_offs(SYMBOL) to be relocated too (basically they won't be
> offsets from image base). In order to get real offset the
> formulae "sym_offs(SYMBOL) - sym_offs(__image_base__)" is
> used instead.

The main calculations of %esi are, if I'm not mistaken,

        /* Store Xen image load base address in place accessible for 32-bit code. */
        lea     __image_base__(%rip),%esi

and

        /* Calculate the load base address. */
        call    1f
1:      pop     %esi
        sub     $sym_offs(1b), %esi

i.e. both deliberately %rip-relative to be position-independent. What's
wrong with this?

There are many more uses of sym_esi(). Why is it only this single one
which poses a problem?

> Also, in some case %esi register (that should point to
> __image_base__ addresss) is not set so compute in all cases.

Which "some case" is this?

> Code tested forcing failures in the code.
> 
> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>

No Fixes: tag?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 08:04:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 08:04:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773765.1184200 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sby8J-0002qz-4s; Thu, 08 Aug 2024 08:04:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773765.1184200; Thu, 08 Aug 2024 08:04:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sby8J-0002qs-2F; Thu, 08 Aug 2024 08:04:27 +0000
Received: by outflank-mailman (input) for mailman id 773765;
 Thu, 08 Aug 2024 08:04:26 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sby8I-0002qi-0O; Thu, 08 Aug 2024 08:04:26 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sby8H-000317-LQ; Thu, 08 Aug 2024 08:04:25 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sby8H-0007c4-7e; Thu, 08 Aug 2024 08:04:25 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sby8H-0007CG-6y; Thu, 08 Aug 2024 08:04:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=BHrqF9kqNpZ91q2Fh78/CbBVRD++Y6M+Mq7BCTaa5gE=; b=SmAFZ3UO0t0mdHOIDXICIXMldi
	6r5xaXSp1jy4ZhRV0D3yrUhaQlTQLgd64NokiX758YKKIFQOv1tfGBiFGW8bSVLL0c3xRUe5LrsRK
	0ofLdvGLZHKtkN8i1h8duapheXVdTYzqDKHmbbZQbBsamvhR5nyjBqjWJGqD620nd/ns=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187186-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187186: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qcow2:guest-start/debian.repeat:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=6b9b96ddebf269579730ff2a65f324505bc2aba9
X-Osstest-Versions-That:
    xen=6b9b96ddebf269579730ff2a65f324505bc2aba9
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 08 Aug 2024 08:04:25 +0000

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

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-libvirt-vhd 19 guest-start/debian.repeat fail in 187180 pass in 187186
 test-amd64-amd64-xl-qcow2    21 guest-start/debian.repeat  fail pass in 187180

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

version targeted for testing:
 xen                  6b9b96ddebf269579730ff2a65f324505bc2aba9
baseline version:
 xen                  6b9b96ddebf269579730ff2a65f324505bc2aba9

Last test of basis   187186  2024-08-08 01:53:56 Z    0 days
Testing same since                          (not found)         0 attempts

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


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

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

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

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


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 08:25:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 08:25:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773778.1184210 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbySe-0006Xz-TX; Thu, 08 Aug 2024 08:25:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773778.1184210; Thu, 08 Aug 2024 08:25:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbySe-0006Xs-Qc; Thu, 08 Aug 2024 08:25:28 +0000
Received: by outflank-mailman (input) for mailman id 773778;
 Thu, 08 Aug 2024 08:25:27 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbySd-0006Xm-MH
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 08:25:27 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c23b752f-555f-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 10:25:25 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a7d2a9a23d9so77859866b.3
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 01:25:24 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9e849a0sm713084766b.186.2024.08.08.01.25.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 01:25:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c23b752f-555f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723105524; x=1723710324; 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=tbDcsWIOxquofFn6/C3Fg72f8HmtE3hKT4qBwwY9+so=;
        b=L8ZzE3IBmzLBC7ZeF9GgHRX/xdKO2lPNRH7DgMTJsWkTdnx/iwf6zYQNOFauKcWOzl
         oAQOrLmjMTKs/9eC7lfTUSQ/ZKYVuoCQtBnG28ch3CjLlCXB9bO5oIVKZLTYmrpxOxw0
         rPDIKWQZTdCYm9XVIBkbiWzG4aTFBt1/iuXUP/1NkTa4CsNkMP97vhmrAsEMJyVq78MY
         kjd4ZGqpg7m2yYPN0rUbpIvDziJIlZWdnZpjijpbx9Fm/w9di7JlY+t3iiscSpJqf8OD
         54KIa4Dj7Ixqi3h7kb37RkdsT4e5t9iiC/qnY4YN2QQ3LWyMG7jxNAeN/tSbq4OpLlIm
         kk5w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723105524; x=1723710324;
        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=tbDcsWIOxquofFn6/C3Fg72f8HmtE3hKT4qBwwY9+so=;
        b=so7QQxmu0qViqizukUpwgTHZl5ppv/2crMkfOA5J5aqSnHwzdGdRs/s+fFRr8g2zzI
         49x+SqwaQX9p56cbv/aUZj5Fj2VDtnxj7wi4zSwCj3uf/j9OoVER93PVPkSL1rdmfxJ/
         aUTfVzbiX2c6wz+DfZz/p2rO5BN/GMRjI2InPFVo66/wK1PO7Ja/u7nofAT4+mFaf6IC
         gB+dQ1uZ3ZDjp5ZtKaKxShdhq871/fC+6f/npE8T7PKlmRYbiZb5X86OnU5QAUZQFwxf
         5X+98k6B4d2O2H4akby7Jxz6ze3syS0/HnxKHMPI33RTFNt8ENElEJGQjliQn9VKcXAP
         RmLQ==
X-Forwarded-Encrypted: i=1; AJvYcCXZ55KGLuUpW06c3HfXUq+cRfkH/HTWhh3aQsokdWXwFj506RA4K720CV+ztwmnxIwZcwOkQ+fBX66lo7q8Gp7G6aXugp5mcLrtcuIrOfo=
X-Gm-Message-State: AOJu0YwGt4UDBZW84ftjPzJPmHAGwuAGPmsZAKy79yINviEcrS0kAwc6
	/xu+epTm20gHOvzNAs/iWGXG3qxsnZzpAcHDpjC1ICSbn0Fr10VVQGrUsH406A==
X-Google-Smtp-Source: AGHT+IGhvO0jeCi7OjizkFBa1xmuedP4VzCRoAXWil4FYJGjw9wQUd497/Qlun6BwlXzPK+UWyOa7w==
X-Received: by 2002:a17:907:9815:b0:a77:c26c:a571 with SMTP id a640c23a62f3a-a8090e63227mr72824566b.54.1723105523588;
        Thu, 08 Aug 2024 01:25:23 -0700 (PDT)
Message-ID: <cf819b39-6ce8-4446-b7b6-a1b247f45400@suse.com>
Date: Thu, 8 Aug 2024 10:25:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/5] x86: Set xen_phys_start and trampoline_xen_phys_start
 earlier
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-4-alejandro.vallejo@cloud.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: <20240807134819.8987-4-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 07.08.2024 15:48, Alejandro Vallejo wrote:
> No reason to wait, if Xen image is loaded by EFI (not multiboot
> EFI path) these are set in efi_arch_load_addr_check, but
> not in the multiboot EFI code path.
> This change makes the 2 code paths more similar and allows
> the usage of these variables if needed.

I'm afraid I'm struggling with any "similarity" argument here. Imo it
would be better what, if anything, needs (is going to need) either or
both of these set earlier. Which isn't to say it's wrong to do early
what can be done early, just that ...

> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -259,6 +259,11 @@ __efi64_mb2_start:
>          jmp     x86_32_switch
>  
>  .Lefi_multiboot2_proto:
> +        /* Save Xen image load base address for later use. */
> +        lea     __image_base__(%rip),%rsi
> +        movq    %rsi, xen_phys_start(%rip)
> +        movl    %esi, trampoline_xen_phys_start(%rip)

... this path is EFI only if I'm not mistaken, while ...

> @@ -605,10 +610,6 @@ trampoline_setup:
>           * Called on legacy BIOS and EFI platforms.
>           */
>  
> -        /* Save Xen image load base address for later use. */
> -        mov     %esi, sym_esi(xen_phys_start)
> -        mov     %esi, sym_esi(trampoline_xen_phys_start)

... the comment in context is pretty clear about this code also being
used in the non-EFI case. It is, however, the case that %esi is 0 in
that case. Yet surely you want to mention this in the description, to
clarify the correctness of the change.

Also in the code you move please consistently omit insn suffixes when
they're not needed. Just like it was in the original code, and just
like you already omit the q from "lea".

Finally, if you used a register other than %rsi (say %r14) you could
replace the "lea" after x86_32_switch by a 2nd "mov", similar to the
one that's already there to load %edi. (You'd need to move the new
code up by yet a few more lines, to cover the jump to x86_32_switch
there, too.)

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 08:49:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 08:49:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773788.1184220 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbyq0-0002Jt-QM; Thu, 08 Aug 2024 08:49:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773788.1184220; Thu, 08 Aug 2024 08:49:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbyq0-0002Jm-Mb; Thu, 08 Aug 2024 08:49:36 +0000
Received: by outflank-mailman (input) for mailman id 773788;
 Thu, 08 Aug 2024 08:49: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=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbypz-0002Jg-UU
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 08:49:35 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 22bacde9-5563-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 10:49:34 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a7a94478a4eso286641066b.1
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 01:49:34 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9c0c7e0sm712311066b.75.2024.08.08.01.49.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 01:49:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22bacde9-5563-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723106974; x=1723711774; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=sJkaHtA/J9SI/0adxdVabs1XoyBLCWwlOZV6CZRNFa0=;
        b=eqrItFViadim2kUolCGKlNPllUseSeRuit8OYH2xnn461+I++CwnYEBaTqio7eLuD0
         yBVC5geUvXCyB3sbTSpoxEvUDVgghWCNctt+9paHlTLMcOKvih/gBp0fnazn8ijXaB/t
         C0JOFhF3QyryM7BE/7gkWVN7bUyNagko8dRZAuNHcGI0kJhOA1JOKIwXDUsabWe1Cj02
         r9Z3iQtR0vWaKe/nNLwnGTTK0wdCZKS7eZkdQvveZ9u5+D35iOxbcAQDIs5/T9kkxOnk
         KZ2Oqpft2rmUWpkJfXzIe+o3lf+R+fY81c9nCSAmkFzKi48+2hS3Z2F+/DoT4zvO4LaQ
         ZqOw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723106974; x=1723711774;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=sJkaHtA/J9SI/0adxdVabs1XoyBLCWwlOZV6CZRNFa0=;
        b=Kseqk97EZOt0iyOtCA3FiI5nSWG9516HnJ+s+pu4rrqBlBzd/qZZ5pQQh+WA+RsCSd
         eiYiCucI0FGzLDhC6HjhwFdMW8wIZ6WMTqRgfio3za0wkkYTR1Xrrz7wtwSMfe30fu2P
         jEDlN/50bonPBH8wu0KgaIWelhwuODkMN5Afh9Yplr4JuNbkwgLFNm+wdI4YWHEMODID
         i6PoB7/gALj5CWzGcNF45b2uMl1bm2askTNSu/P5CVZrALkzwyqFuB3ZdaW5eXnhMwxi
         C6C6L7rcF18JUxY/3tRD0n5v7p0zBjZBvaXnP0O9ExjjUy3dehd1TVAnn88b1iiMJg16
         R7RA==
X-Gm-Message-State: AOJu0YxBpZI2i56YYMY4z20887LHOR8OWXIvLPa1U/0aMk6n3vbQmtK6
	c+p7uZNLlEZsIHtv1gY46kU6+CWaMQJBrtfoU9ltJFteQRZP/0kEC3PUIU2XPJemLkgPi2bYmRo
	=
X-Google-Smtp-Source: AGHT+IH984NpWgziB3hXTmoZOVXVVMBbflrYRbfZq/UfTjZUglFAlGkm0i2S8N5KujOl8D1ityPuIQ==
X-Received: by 2002:a17:906:c108:b0:a7a:afe8:1015 with SMTP id a640c23a62f3a-a809207c521mr91324466b.29.1723106973900;
        Thu, 08 Aug 2024 01:49:33 -0700 (PDT)
Message-ID: <f2186827-62e6-4b24-8a6c-0c2a9499c232@suse.com>
Date: Thu, 8 Aug 2024 10:49:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86: slightly simplify MB2/EFI "magic" check
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

A few dozen lines down from here we repeatedly use a pattern involving
just a single (conditional) branch. Do so also when checking for the
boot loader magic value.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
I further question the placement of the clearing of vga_text_buffer,
just out of context: Shouldn't that be placed with the increments of
efi_platform and skip_realmode? Or else is the terminology in comments
("on EFI platforms") wrong in one of the two places? In the end, if we
are entered at __efi64_mb2_start but the magic doesn't match, we simply
don't know what environment we're in. There may or may not be a VGA
console at the default address, so we may as well (try to) write to it
(just like we do when entered at start).

--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -233,13 +233,11 @@ __efi64_mb2_start:
 
         /* Check for Multiboot2 bootloader. */
         cmp     $MULTIBOOT2_BOOTLOADER_MAGIC,%eax
-        je      .Lefi_multiboot2_proto
 
         /* Jump to .Lnot_multiboot after switching CPU to x86_32 mode. */
         lea     .Lnot_multiboot(%rip), %r15
-        jmp     x86_32_switch
+        jne     x86_32_switch
 
-.Lefi_multiboot2_proto:
         /* Zero EFI SystemTable, EFI ImageHandle addresses and cmdline. */
         xor     %esi,%esi
         xor     %edi,%edi


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 09:29:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 09:29:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773800.1184229 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbzSf-0000M3-HE; Thu, 08 Aug 2024 09:29:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773800.1184229; Thu, 08 Aug 2024 09:29:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbzSf-0000Lw-Eg; Thu, 08 Aug 2024 09:29:33 +0000
Received: by outflank-mailman (input) for mailman id 773800;
 Thu, 08 Aug 2024 09:29:32 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbzSe-0000Lq-Pl
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 09:29:32 +0000
Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com
 [2a00:1450:4864:20::536])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b6dfd453-5568-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 11:29:30 +0200 (CEST)
Received: by mail-ed1-x536.google.com with SMTP id
 4fb4d7f45d1cf-5b3fff87e6bso775236a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 02:29:30 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bbb2bf962dsm448854a12.15.2024.08.08.02.29.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 02:29:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b6dfd453-5568-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723109370; x=1723714170; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=np7STbx2lMKh44IZp2I+buIAIwrFbrKnBvYJBYd/X8s=;
        b=HSIUxB9IoUp8BLrdQKb0tPZCd0Te6cavij3FCWfLEQniiYPWX9EaC4qobV73V3soSj
         X196uhuP53QZ4B4YKxW7XwvB/sfud/C6sqKsfsZZXpQZfG7lZtOgAgiQbfsDeo+6BF/V
         h6H7IE6Vh1+q+FO37ODhCt1zSL4fEtRIOeQoLrgt73pDFx9GeKU95fetZVZmxS8WJ9uB
         SmnQ/gMUMHDZ08zp+1AXuNKV+nsjMtXm7HNMbNzFRoNg6VJKykvZ+O1me83N9bvn2y/d
         ZSUYYTrRo8K7Dat1dciNGnH9WOLdplGn4dolmAqW64dlW+X8AlEklCGgr4n25Mze5L8T
         gNeg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723109370; x=1723714170;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :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=np7STbx2lMKh44IZp2I+buIAIwrFbrKnBvYJBYd/X8s=;
        b=DSAZAvhGle8TPUg+DoPlGGoE4JA48ThXdHEfG6ZMUmvX4v1kj8zZFiIochU2Hd39ZT
         QDGWFgVBcuaKQPuKPTtpdosHawHmjq97WYC5rJEnMbqEJXJOxBvm2BVSftGlcBQZ/ean
         3vpfi0bUBq80Lbc69BKstDb0vBeNvtGgRKgvNV2sdVuLp5JZrzOs5q11emhuyCHzzfWg
         2wgKvR50qPCcPqy0g9F4y321gV8VrtC1t6bcCDP8fppB6PMLlO2YUA73X+rHzGFct0y9
         59WSXFH/9yFOf086gpY8hLm1C+KSNxRfqJ1C5avbg33hi9jwIiM664GQbBbW2yQOH6jx
         E8Uw==
X-Gm-Message-State: AOJu0Yz76DHy0hDiIIg9H2XpPADOO3iB/JOjsymmmxfakVOZRHmI582f
	90eDWJJlDijGa+F98zs8ITF4bhkLZ1FuvSrTaFS9DflAGxnQpioMLEmF9hFDS+zq5xv9bqCqP54
	=
X-Google-Smtp-Source: AGHT+IFK9ep32stWhgWOYotxk8xMsHwkVWyrvn+Eq6X8aOgVvO838LzZanFjU5vKI6oie3Xzol8dwQ==
X-Received: by 2002:a05:6402:34cb:b0:5af:874d:1b7b with SMTP id 4fb4d7f45d1cf-5bbb218dfadmr1110563a12.1.1723109369836;
        Thu, 08 Aug 2024 02:29:29 -0700 (PDT)
Message-ID: <bd4c8ef5-a6bb-42ae-9b69-c3d14eeac55e@suse.com>
Date: Thu, 8 Aug 2024 11:29:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/5] x86: Fix early output messages in case of EFI
To: Frediano Ziglio <frediano.ziglio@cloud.com>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-3-alejandro.vallejo@cloud.com>
 <7f1e17dd-d105-4f6c-87d3-69f3dca4ab82@suse.com>
 <CACHz=ZjYdBcB_S1tpXpuRQDKGAKY=SrgTEy8_0Wyq_q+bOBfHg@mail.gmail.com>
Content-Language: en-US
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+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: <CACHz=ZjYdBcB_S1tpXpuRQDKGAKY=SrgTEy8_0Wyq_q+bOBfHg@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

(re-adding xen-devel@)

On 08.08.2024 10:33, Frediano Ziglio wrote:
> On Thu, Aug 8, 2024 at 8:49 AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 07.08.2024 15:48, Alejandro Vallejo wrote:
>>> If code is loaded by EFI the loader will relocate the image
>>> under 4GB.
>>
>> This is the MB2 EFI path you're talking about? Since there are two paths,
>> I think this needs clearly separating in all descriptions.
>>
>> If it is the MB2 path, then "relocate" isn't quite correct, I think:
>> Relocations aren't applied in that case, as none are present in xen.gz.
>> I'd rather call this "put at an address below 4G". However, that isn't
>> any different from the non-EFI MB1/2 paths, is it? I feel like I'm
>> missing something here.
>>
> 
> Yes, xen.gz has no relocation, but xen.efi has them,

Of course, I know. I was the one to actually add them, after all. But:
Are you (silently) adding a 4th way of booting Xen, using xen.efi yet
not its PE-header-specified entry point? So far we had three ways only:
Non-EFI (xen.gz:start), native EFI (xen.efi:efi_start), and GrUB2+EFI
(xen.gz:__efi64_mb2_start). You effectively suggest GrUB2+EFI
(xen.efi:__efi64_mb2_start), if I'm not mistaken. Where is such a mode
even specified? When using the MB2 entry point, it's not obvious at all
whether the boot loader is even supposed to be respecting the .reloc
section of the PE binary (imo that's contrary to the original idea of
multiboot).

> Normally probably you are using xen.gz instead of xen.efi however we
> are adding multiboot with PE support and secure boot so we need to use
> PE format for signing.

Note how here is the first time that you actually mention you're adding
a new boot mode. That's quite relevant as context for the entire series,
I would say.

>>> This cause offsets in x86 code generated by
>>> sym_offs(SYMBOL) to be relocated too (basically they won't be
>>> offsets from image base). In order to get real offset the
>>> formulae "sym_offs(SYMBOL) - sym_offs(__image_base__)" is
>>> used instead.
>>
>> The main calculations of %esi are, if I'm not mistaken,
>>
>>         /* Store Xen image load base address in place accessible for 32-bit code. */
>>         lea     __image_base__(%rip),%esi
>>
> 
> Which is correct
> 
>> and
>>
>>         /* Calculate the load base address. */
>>         call    1f
>> 1:      pop     %esi
>>         sub     $sym_offs(1b), %esi
>>
>> i.e. both deliberately %rip-relative to be position-independent. What's
>> wrong with this?
>>
> 
> This can be wrong if sym_offs(1b) was relocated and not patched by
> efi_arch_relocate_image.

Of course, if in the course of GrUB's loading of xen.efi base relocations
are applied (unlike when loading an ELF binary, where afaik base relocs
would be ignored, even if there were any), then this calculation is of
course going to be wrong. Can't we correct it though, to properly resemble
PIC code:

        /* Calculate the load base address. */
        call    1f
1:      pop     %esi
        sub     1b - start, %esi

or (because start is in a different section):

        /* Calculate the load base address. */
        call    1f
1:      pop     %esi
        sub     $sym_offs(1b), %esi
        add     $sym_offs(start), %esi

(or something along these lines)?

> Consider .Lnot_multiboot label call, here we didn't set %esi and in my
> case (GRUB using PE) the EFI version was used.

How does %esi matter at .Lnot_multiboot? It starts mattering from
x86_32_switch onwards, and it is being set there.

>> There are many more uses of sym_esi(). Why is it only this single one
>> which poses a problem?
> 
> Because potentially %esi is not set (see above example, but better to
> make sure is always valid) and becase potentially for EFI code is
> relocated.
> IMO stripping relocation and calling C code (like efi_multiboot2)
> supposed to be execute at a different location is a bomb waiting to
> explode.

Yet that has been working fine for xen.gz? There definitely is a risk,
but that risk isn't new afaict.

>>> Also, in some case %esi register (that should point to
>>> __image_base__ addresss) is not set so compute in all cases.
>>
>> Which "some case" is this?
> 
> In __efi64_mb2_start path there are some. Note that we use %rsi for
> different purposes there.

All cases there where %esi would matter branch to x86_32_switch first
afaics. As mentioned, %esi is being set one of the first things after
the x86_32_switch label.

>>> Code tested forcing failures in the code.
>>>
>>> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
>>
>> No Fixes: tag?
> 
> Not sure here, should I open some ticker and refer to it?

Well, now that I learned that you're trying to add a new boot mode,
there's no need for a Fixes: tag. Yet the patch title then also
shouldn't say "Fix" - that made it look like you're addressing some
problem with one of the existing boot modes we have.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 09:37:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 09:37:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773811.1184242 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbzZn-0002NP-8g; Thu, 08 Aug 2024 09:36:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773811.1184242; Thu, 08 Aug 2024 09:36:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbzZn-0002NI-5c; Thu, 08 Aug 2024 09:36:55 +0000
Received: by outflank-mailman (input) for mailman id 773811;
 Thu, 08 Aug 2024 09:36: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=vpfq=PH=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sbzZl-0002NC-LZ
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 09:36:53 +0000
Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com
 [2607:f8b0:4864:20::c32])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bddd4c8d-5569-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 11:36:52 +0200 (CEST)
Received: by mail-oo1-xc32.google.com with SMTP id
 006d021491bc7-5d5c324267aso407750eaf.0
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 02:36:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bddd4c8d-5569-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723109811; x=1723714611; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=BAaPz5K8D2s3Jt9n5ajrSs4DeRMUrIEj3bmYYi/KbZM=;
        b=IUF8Als1puJw5I4BkgBgclMDS2Bod6s0u8rb5QIN7X+v9oWTcK5ru6rV94eEqQJRGh
         Npe0h/cDnBVSntJY/spoomss2Lu9XJYwpviRx5Zul1HWvf0jG8ePUmZMQ3stozboLysj
         M/0XdHWHZsPR8eU1PXyJ/Iepoy0b020KOJrII=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723109811; x=1723714611;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=BAaPz5K8D2s3Jt9n5ajrSs4DeRMUrIEj3bmYYi/KbZM=;
        b=AQs24vjj1WFHpPT4IMieorXDDCJNfJT7gclFHu/7j2yNp9Kut1ixtfsiYy6EEP1K+T
         2fNNt2l6kFiXzPjNKzTi0OaoQibJUPdRd5jkTaWY/YZmah+UJyoRu41pjb6n9Z/TOT0Z
         nhS+HcasdWCewgYBr+Y3l/yMt+l5UFDJg5fepX4lTuPr3fWYSQlUquaa3/14Kh9k/Alk
         VPEWRlPPfDD2+rr3GwBFF64/GyelpmmtY2J8QKvtXk9Y9ApRUQCtpgB5qujLmQKXC2vp
         R7SkzQOmOXYI6964LZpr5eBZtun6g5qvIu9ONM1RdIML5yLuXgofCsrtjUCB+aGoKV18
         zofg==
X-Gm-Message-State: AOJu0Yz4E0F0xTa5ZVufyqv64MWq1YWyEfjCWUgL6zgk7G9UL70KXDu1
	G7/3E4P3bknpzXWawYQn0EEpay1iJpUePz0Sz6Z4EP9X0sMIbMwEo4PRPWpWOsVe3XHbb1hBNZw
	4OThmbRKuc+qJhdFeBap+j1xu+QnrSgFS4rONEg==
X-Google-Smtp-Source: AGHT+IF0BDU9dAFRJtIpY1RiU947qjI0XkobVCwvkMhhxD+ukjd0b12fUfZ24Vgg92HUKPhqqDcmPQesgmXOdNKCSmw=
X-Received: by 2002:a05:6820:1e8b:b0:5d8:750:21b with SMTP id
 006d021491bc7-5d8559e5bd7mr1283914eaf.1.1723109811101; Thu, 08 Aug 2024
 02:36:51 -0700 (PDT)
MIME-Version: 1.0
References: <f2186827-62e6-4b24-8a6c-0c2a9499c232@suse.com>
In-Reply-To: <f2186827-62e6-4b24-8a6c-0c2a9499c232@suse.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Thu, 8 Aug 2024 10:36:40 +0100
Message-ID: <CACHz=ZiSJxdv_jVuE8sq6=JVcpXerKD0-TJxvium++8jpQEnsw@mail.gmail.com>
Subject: Re: [PATCH] x86: slightly simplify MB2/EFI "magic" check
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Aug 8, 2024 at 9:49=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wrot=
e:
>
> A few dozen lines down from here we repeatedly use a pattern involving
> just a single (conditional) branch. Do so also when checking for the
> boot loader magic value.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> I further question the placement of the clearing of vga_text_buffer,
> just out of context: Shouldn't that be placed with the increments of
> efi_platform and skip_realmode? Or else is the terminology in comments
> ("on EFI platforms") wrong in one of the two places? In the end, if we
> are entered at __efi64_mb2_start but the magic doesn't match, we simply
> don't know what environment we're in. There may or may not be a VGA
> console at the default address, so we may as well (try to) write to it
> (just like we do when entered at start).
>

I don't think __efi64_mb2_start should be ever get called by anything
else than multiboot2. Was EFI supported by multiboot version 1 maybe?
As far as I can see we will print an error and halt the machine so we
expect something really wrong to have happened.
We could indeed be in a position where we have VGA available. Or EFI?
Or not? As said something really weird and unexpected happened. Maybe
the safer way would be to print on serial and try to print on VGA in
this case. At the moment we mix the 2 prints (each character is
duplicated), printing all message to serial and then trying to print
all message to VGA and then halt could be an option.

> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -233,13 +233,11 @@ __efi64_mb2_start:
>
>          /* Check for Multiboot2 bootloader. */
>          cmp     $MULTIBOOT2_BOOTLOADER_MAGIC,%eax
> -        je      .Lefi_multiboot2_proto
>
>          /* Jump to .Lnot_multiboot after switching CPU to x86_32 mode. *=
/
>          lea     .Lnot_multiboot(%rip), %r15
> -        jmp     x86_32_switch
> +        jne     x86_32_switch
>

It looks good to me. Maybe a bit less readable.

> -.Lefi_multiboot2_proto:
>          /* Zero EFI SystemTable, EFI ImageHandle addresses and cmdline. =
*/
>          xor     %esi,%esi
>          xor     %edi,%edi
>

Frediano


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 09:54:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 09:54:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773821.1184252 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbzqY-0005WX-Oc; Thu, 08 Aug 2024 09:54:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773821.1184252; Thu, 08 Aug 2024 09:54:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbzqY-0005WQ-M2; Thu, 08 Aug 2024 09:54:14 +0000
Received: by outflank-mailman (input) for mailman id 773821;
 Thu, 08 Aug 2024 09:54:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbzqX-0005WK-3C
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 09:54:13 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 29dc118e-556c-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 11:54:12 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a7d26c2297eso89059666b.2
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 02:54:12 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9bc3c9asm722903366b.37.2024.08.08.02.54.10
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 02:54:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 29dc118e-556c-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723110851; x=1723715651; 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=J23X6oenTFAwiBGLPWt0/Ua9Rpl8VpLyrX8qu7BBaQo=;
        b=SkIVi2schZ2AfQEfzOzf7iXq8EIaA0JmvCKnApz0P/6c4RxDwgJKgi4iA96aUwVB/P
         FfyM1+LEK1ifegC2iwPbXEEFvg1+IAw2lX11DdSFj5pDcYeH1LdT64b8OrotZpD1ou3j
         aM9muhRkag57CX5toYb50DRG3bGtAGt2lRUdGPdQRWPPEsC7nixJx9b2ecqhDbHXaaBK
         V5Ekqon6wyfu9TdRt4TtGer3kWS7OktXszRzrSsQ6ljhFXcYtJY3HvK27UZZFplfQc5V
         44WcUjXEQLkgHDjxWtLXNl6wQvmMPWsP7G6qjm0eNqUBDDyUWq6Bko00+Lhu4NkU0hM6
         GHAQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723110851; x=1723715651;
        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=J23X6oenTFAwiBGLPWt0/Ua9Rpl8VpLyrX8qu7BBaQo=;
        b=XyQZ2w4NDxKDjuyg8lLGGb4/vHGAWi651GVZIuXKZgABSrfAyMR3HQVvjrhPD8uDGs
         y2RTNuiJ6eIS7WJWWGjVFFg3Inm3lgnmeif/fdIAFIqfarHOg2nZmUMHF5OcLZ/xHyEt
         Zs+sHAv6S+wQL8Nfl4rp4JANkSnz/blOPhcUvmOuLhq7YT0m0g1HCi1nNCim1RuBtd7E
         YJ+Un4hLdj9XiYEvPuhXku5OIyVShI6yvEAINIrnNPM/PeK6dLnoDNqH3VDUjRTSgGcJ
         p8h6yi7YfaZogIelrbnosJC2rqYbmIYrz+hwSj5p8DeG9wiTNsBsU6Y3/NpJFqj0kJk3
         +6wg==
X-Gm-Message-State: AOJu0YwIWuABFgIeMp1e83gi16AUeKSKRLt/M+47BM2FveSXrcHQJU9p
	xFif4jGP9Bp3/6XFyQi4rX7YLt4hyEx4nQykpHjgXc406k1yae0Bhhc5wlRuww==
X-Google-Smtp-Source: AGHT+IEcMISohg+tHiNs71em6Sf42o6qQqOxQuJNgBTJmC37Ir3GhCAvYe+1F7siHgz8UACrNqC9pw==
X-Received: by 2002:a17:907:1b27:b0:a7a:9447:3e8b with SMTP id a640c23a62f3a-a8090c82a6amr99222666b.25.1723110851292;
        Thu, 08 Aug 2024 02:54:11 -0700 (PDT)
Message-ID: <a1929a39-6b63-4ea4-9e09-886a82166d39@suse.com>
Date: Thu, 8 Aug 2024 11:54:10 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86: slightly simplify MB2/EFI "magic" check
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <f2186827-62e6-4b24-8a6c-0c2a9499c232@suse.com>
 <CACHz=ZiSJxdv_jVuE8sq6=JVcpXerKD0-TJxvium++8jpQEnsw@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: <CACHz=ZiSJxdv_jVuE8sq6=JVcpXerKD0-TJxvium++8jpQEnsw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 08.08.2024 11:36, Frediano Ziglio wrote:
> On Thu, Aug 8, 2024 at 9:49 AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> A few dozen lines down from here we repeatedly use a pattern involving
>> just a single (conditional) branch. Do so also when checking for the
>> boot loader magic value.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> I further question the placement of the clearing of vga_text_buffer,
>> just out of context: Shouldn't that be placed with the increments of
>> efi_platform and skip_realmode? Or else is the terminology in comments
>> ("on EFI platforms") wrong in one of the two places? In the end, if we
>> are entered at __efi64_mb2_start but the magic doesn't match, we simply
>> don't know what environment we're in. There may or may not be a VGA
>> console at the default address, so we may as well (try to) write to it
>> (just like we do when entered at start).
> 
> I don't think __efi64_mb2_start should be ever get called by anything
> else than multiboot2. Was EFI supported by multiboot version 1 maybe?

No, there was no EFI with MB1.

> As far as I can see we will print an error and halt the machine so we
> expect something really wrong to have happened.
> We could indeed be in a position where we have VGA available. Or EFI?
> Or not? As said something really weird and unexpected happened. Maybe
> the safer way would be to print on serial and try to print on VGA in
> this case. At the moment we mix the 2 prints (each character is
> duplicated), printing all message to serial and then trying to print
> all message to VGA and then halt could be an option.

Sounds like you see something wrong with the "mixing" as you call it?
I'm suggesting exactly that: Try to output something to both possible
channels. Whether there's serial at the default port we don't know
either, after all.

What we kind of know is that we're in 64-bit mode (yet even that could
probably do with verifying, when we already have to assume something
is very broken). Even there I'd expect the VGA range to be mapped by
the identity page tables that our caller must have put in place.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 09:58:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 09:58:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773830.1184262 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbzuI-0006eg-55; Thu, 08 Aug 2024 09:58:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773830.1184262; Thu, 08 Aug 2024 09:58:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sbzuI-0006eZ-2W; Thu, 08 Aug 2024 09:58:06 +0000
Received: by outflank-mailman (input) for mailman id 773830;
 Thu, 08 Aug 2024 09:58:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sbzuG-0006eT-Ln
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 09:58:04 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b367c2e9-556c-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 11:58:02 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a7ac449a0e6so74296166b.1
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 02:58:02 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9c12a79sm723917866b.60.2024.08.08.02.58.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 02:58:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b367c2e9-556c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723111082; x=1723715882; 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=dKikCVFLb4uJce7xEaR093Avd0a4h5DuqfDjKb3Vnwo=;
        b=PenDbTz+D6L7yvW4RJUpyvktBVHjaKB2Onuq0+tT6ZbHhPv4HIRbck6wPwgJc+QqVV
         C/OjK7XCz319TgGErcMIBpDU+L7KPgMTm+5TObmfh01QVbDZYKaIkLBU/rmpweecBuj+
         R7B9+pWHGrC5sK2BJgS8K/W/rMFyR63fB0FPaSPCRQmdm47FOPm+KY7ttB5EQIr/Azrn
         knIPYFJOLRAwra4sxMTvako0WadsjRPytieFPpFywr95dGc4RWkUzHvww/ANQYPAU2rI
         +QQpkf3pKVueHS7J/bqs43ocXhowynwN1EWDx6Ypxy6eOe1pFen9dfNq7SGXZVbG7cLP
         aBCw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723111082; x=1723715882;
        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=dKikCVFLb4uJce7xEaR093Avd0a4h5DuqfDjKb3Vnwo=;
        b=LBIyWefdeIxFLgbaIAKufxFQoCHHFAsKcD1ujNKmfoCL0TI5ra1jxjaBPZaj4tbkNY
         D1oobVOhDy7FLyN7lDoWYkJSP69CKM2r2oXAXKqBCdF776sRxt3SLRPiaKtymDjxCZAw
         Exi4U9DmW4e5VBvFLQOlCPPfWuSOOMckfnAOJPX3W9m9khrORtxR/i9LskbnnuGZvj7G
         CDpezsXzHDOMtx0gq76++soh1OQG59CoRU+M8NDAXS3HlgFJjxcQU+/RRjtxb7y4ic1B
         luyuEVMe8EYvxTgvCxPzPKuHWK/mqQTuAcVXnvYO/C0/XBcR1HD7SSTLfjC/YD3OY0Em
         uyNw==
X-Forwarded-Encrypted: i=1; AJvYcCWktUepnszya4E+YKXlTd8XuvwAGJdb0TnQ8YHoz0920ZiEmZvA49+DG5RiEnbuLY01xSMA+firtESlr+UwESOaTjpHFePNGQyLhUNsUB0=
X-Gm-Message-State: AOJu0YzbSA9KjS8NAlQOkkwfNosUmjcx/smcA6VZs9lcYSeUOhNjKls3
	izy7HR2+QbXqjvT6zpxt80YUEP5t8Q5vNX9pORcGwYmr4jwCAU3yY8SHhsebGg==
X-Google-Smtp-Source: AGHT+IEiKYeqaw3yygp+l4U3XnU+IANaxVWGVYjjw6fmgetopqXoTS5U4xEVa2Y8hTNosL/xhFr5VA==
X-Received: by 2002:a17:907:f74b:b0:a7a:c256:3ce with SMTP id a640c23a62f3a-a8090c7e891mr99779666b.21.1723111082114;
        Thu, 08 Aug 2024 02:58:02 -0700 (PDT)
Message-ID: <fea5c345-5cf6-4144-9ccf-5c0f7a34a136@suse.com>
Date: Thu, 8 Aug 2024 11:58:01 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/5] x86: Force proper gdt_boot_base setting
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-5-alejandro.vallejo@cloud.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: <20240807134819.8987-5-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 07.08.2024 15:48, Alejandro Vallejo wrote:
> Instead of relocate the value at that position compute it
> entirely and write it.
> During EFI boots sym_offs(SYMBOL) are potentially relocated
> causing the values to be corrupted.
> For PVH and BIOS the change won't be necessary but keep the
> code consistent.

As already hinted at in a reply to an earlier patch - there are ample
further uses of sym_offs(). Imo we need to sort them all in one go,
not by hacking use sites individually. Which hopefully can be done by
simply calculating %esi correctly.

Jan



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 10:06:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 10:06:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773840.1184272 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc02l-00005m-Uu; Thu, 08 Aug 2024 10:06:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773840.1184272; Thu, 08 Aug 2024 10:06:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc02l-00005e-S1; Thu, 08 Aug 2024 10:06:51 +0000
Received: by outflank-mailman (input) for mailman id 773840;
 Thu, 08 Aug 2024 10:06:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=JkzM=PH=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1sc02k-0008M5-6G
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 10:06:50 +0000
Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ec37f939-556d-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 12:06:48 +0200 (CEST)
Received: from pb-smtp1.pobox.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id DEDC12CEB0;
 Thu,  8 Aug 2024 06:06:46 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id D47162CEAF;
 Thu,  8 Aug 2024 06:06:46 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [185.130.54.64])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 79F2C2CEAE;
 Thu,  8 Aug 2024 06:06:45 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ec37f939-556d-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:mime-version:content-transfer-encoding;
	 s=sasl; bh=FfmIVgfH8XoLD7cO63wuh0h1UGmD3rJp5C7+5+dQn00=; b=L7XD
	UqgYPwO5fpfgGSLUs+jwrS1gP+vuPgj7pqSxU3pRvn4/ghsAGfMfwdK9rO4IFMv0
	2tbnK09FzbtFG0iOIYZGNaiWFStORrCsfCxvZddSkJRWIhE6QUUWmx/ZbQdgY0qw
	VsCs4z83hGXyXCHsmVdf+Y3+RTFYOm8irsks1Tk=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>
Subject: [XEN PATCH v6 0/3] x86: make CPU virtualisation support configurable
Date: Thu,  8 Aug 2024 13:06:43 +0300
Message-Id: <cover.1723110344.git.Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
X-Pobox-Relay-ID:
 EB0EA8CC-556D-11EF-88B1-2BAEEB2EC81B-90055647!pb-smtp1.pobox.com
Content-Transfer-Encoding: quoted-printable

These are final 3 patches of the series for making VMX/SVM support in Xen
configurable:

https://lore.kernel.org/xen-devel/cover.1722333634.git.Sergiy_Kibrik@epam=
.com/

Minor changes comparing to v5, changelogs are provided per-patch.

  -Sergiy=20

Sergiy Kibrik (1):
  x86/vmx: guard access to cpu_has_vmx_* in common code

Xenia Ragiadakou (2):
  ioreq: do not build arch_vcpu_ioreq_completion() for non-VMX
    configurations
  x86/hvm: make AMD-V and Intel VT-x support configurable

 xen/Kconfig                             |  6 ++
 xen/arch/arm/ioreq.c                    |  6 --
 xen/arch/x86/Kconfig                    | 19 +++++-
 xen/arch/x86/hvm/ioreq.c                |  2 +
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h | 90 ++++++++++++++++---------
 xen/include/xen/ioreq.h                 | 10 +++
 6 files changed, 95 insertions(+), 38 deletions(-)

--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 10:09:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 10:09:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773850.1184282 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc04q-00010c-Ap; Thu, 08 Aug 2024 10:09:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773850.1184282; Thu, 08 Aug 2024 10:09:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc04q-00010V-7w; Thu, 08 Aug 2024 10:09:00 +0000
Received: by outflank-mailman (input) for mailman id 773850;
 Thu, 08 Aug 2024 10:08:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=JkzM=PH=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1sc04o-00010O-VO
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 10:08:59 +0000
Received: from pb-smtp21.pobox.com (pb-smtp21.pobox.com [173.228.157.53])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 38e74763-556e-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 12:08:57 +0200 (CEST)
Received: from pb-smtp21.pobox.com (unknown [127.0.0.1])
 by pb-smtp21.pobox.com (Postfix) with ESMTP id 2437531CAF;
 Thu,  8 Aug 2024 06:08:55 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1])
 by pb-smtp21.pobox.com (Postfix) with ESMTP id 1C52931CAE;
 Thu,  8 Aug 2024 06:08:55 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [185.130.54.64])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 8FC1A31CAD;
 Thu,  8 Aug 2024 06:08:50 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 38e74763-556e-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:in-reply-to:references:mime-version
	:content-transfer-encoding; s=sasl; bh=rLkBK7EmUw733LUBbAQ/wJYe5
	yKogIWbC4rHjZir5Ao=; b=bto60RDINWmeaM2SuyuKtMc1rGwz+0SGPAjVuNu3c
	9982G0z6rUQts0Sz5JvbxcuSlx9ANPGbTikadmo5nwrI9QwIgpIHKaWZJIJrkZJY
	3L6AyAO3v4K1Pf9TCFraZhh8wtD+4KD2hWwNMRvM5x+e3VQ1Vkltl/55KmZf9YLB
	vk=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Paul Durrant <paul@xen.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [XEN PATCH v6 1/3] x86/vmx: guard access to cpu_has_vmx_* in common code
Date: Thu,  8 Aug 2024 13:08:46 +0300
Message-Id: <6486b627fd3bdcca3ad877ed6c97ca5cbc51d8e3.1723110344.git.Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1723110344.git.Sergiy_Kibrik@epam.com>
References: <cover.1723110344.git.Sergiy_Kibrik@epam.com>
MIME-Version: 1.0
X-Pobox-Relay-ID:
 359DBB58-556E-11EF-AD78-E92ED1CD468F-90055647!pb-smtp21.pobox.com
Content-Transfer-Encoding: quoted-printable

There're several places in common code, outside of arch/x86/hvm/vmx,
where cpu_has_vmx_* get accessed without checking whether VMX supported f=
irst.
These macros rely on global variables defined in vmx code, so when VMX su=
pport
is disabled accesses to these variables turn into build failures.

To overcome these failures, build-time check is done before accessing glo=
bal
variables, so that DCE would remove these variables.

Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Acked-by: Paul Durrant <paul@xen.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Jan Beulich <jbeulich@suse.com>
---
changes in v6:
 - guard all of cpu_has_vmx_* macros
changes in v5:
 - change kconfig option name VMX -> INTEL_VMX
 - do not change .c files, only modify macros in vmcs.h
changes in v4:
 - use IS_ENABLED(CONFIG_VMX) instead of using_vmx
---
 xen/arch/x86/include/asm/hvm/vmx/vmcs.h | 90 ++++++++++++++++---------
 1 file changed, 60 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h b/xen/arch/x86/inclu=
de/asm/hvm/vmx/vmcs.h
index 58140af691..939b87eb50 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
@@ -298,69 +298,99 @@ extern u64 vmx_ept_vpid_cap;
 #define VMX_TSC_MULTIPLIER_MAX                  0xffffffffffffffffULL
=20
 #define cpu_has_wbinvd_exiting \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_WBINVD_EXITING)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_WBINVD_EXITING)
 #define cpu_has_vmx_virtualize_apic_accesses \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSE=
S)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSE=
S)
 #define cpu_has_vmx_tpr_shadow \
-    (vmx_cpu_based_exec_control & CPU_BASED_TPR_SHADOW)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_cpu_based_exec_control & CPU_BASED_TPR_SHADOW)
 #define cpu_has_vmx_vnmi \
-    (vmx_pin_based_exec_control & PIN_BASED_VIRTUAL_NMIS)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_pin_based_exec_control & PIN_BASED_VIRTUAL_NMIS)
 #define cpu_has_vmx_msr_bitmap \
-    (vmx_cpu_based_exec_control & CPU_BASED_ACTIVATE_MSR_BITMAP)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_cpu_based_exec_control & CPU_BASED_ACTIVATE_MSR_BITMAP)
 #define cpu_has_vmx_secondary_exec_control \
-    (vmx_cpu_based_exec_control & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_cpu_based_exec_control & CPU_BASED_ACTIVATE_SECONDARY_CONTROLS)
 #define cpu_has_vmx_tertiary_exec_control \
-    (vmx_cpu_based_exec_control & CPU_BASED_ACTIVATE_TERTIARY_CONTROLS)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_cpu_based_exec_control & CPU_BASED_ACTIVATE_TERTIARY_CONTROLS)
 #define cpu_has_vmx_ept \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_EPT)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_EPT)
 #define cpu_has_vmx_dt_exiting \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITIN=
G)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_DESCRIPTOR_TABLE_EXITIN=
G)
 #define cpu_has_vmx_rdtscp \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_RDTSCP)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_RDTSCP)
 #define cpu_has_vmx_vpid \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VPID)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VPID)
 #define cpu_has_monitor_trap_flag \
-    (vmx_cpu_based_exec_control & CPU_BASED_MONITOR_TRAP_FLAG)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_cpu_based_exec_control & CPU_BASED_MONITOR_TRAP_FLAG)
 #define cpu_has_vmx_pat \
-    (vmx_vmentry_control & VM_ENTRY_LOAD_GUEST_PAT)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_vmentry_control & VM_ENTRY_LOAD_GUEST_PAT)
 #define cpu_has_vmx_efer \
-    (vmx_vmentry_control & VM_ENTRY_LOAD_GUEST_EFER)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_vmentry_control & VM_ENTRY_LOAD_GUEST_EFER)
 #define cpu_has_vmx_unrestricted_guest \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_UNRESTRICTED_GUEST)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_UNRESTRICTED_GUEST)
 #define vmx_unrestricted_guest(v)               \
     ((v)->arch.hvm.vmx.secondary_exec_control & \
      SECONDARY_EXEC_UNRESTRICTED_GUEST)
 #define cpu_has_vmx_ple \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_PAUSE_LOOP_EXITING)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_PAUSE_LOOP_EXITING)
 #define cpu_has_vmx_invpcid \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_INVPCID)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_INVPCID)
 #define cpu_has_vmx_apic_reg_virt \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_APIC_REGISTER_VIRT)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_APIC_REGISTER_VIRT)
 #define cpu_has_vmx_virtual_intr_delivery \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY)
 #define cpu_has_vmx_virtualize_x2apic_mode \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE)
 #define cpu_has_vmx_posted_intr_processing \
-    (vmx_pin_based_exec_control & PIN_BASED_POSTED_INTERRUPT)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_pin_based_exec_control & PIN_BASED_POSTED_INTERRUPT)
 #define cpu_has_vmx_vmcs_shadowing \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VMCS_SHADOWING)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VMCS_SHADOWING)
 #define cpu_has_vmx_vmfunc \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VM_FUNCTIONS)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VM_FUNCTIONS)
 #define cpu_has_vmx_virt_exceptions \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_VIRT_EXCEPTIONS)
 #define cpu_has_vmx_pml \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_PML)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_ENABLE_PML)
 #define cpu_has_vmx_mpx \
-    ((vmx_vmexit_control & VM_EXIT_CLEAR_BNDCFGS) && \
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     (vmx_vmexit_control & VM_EXIT_CLEAR_BNDCFGS) && \
      (vmx_vmentry_control & VM_ENTRY_LOAD_BNDCFGS))
 #define cpu_has_vmx_xsaves \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_XSAVES)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_XSAVES)
 #define cpu_has_vmx_tsc_scaling \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_TSC_SCALING)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_TSC_SCALING)
 #define cpu_has_vmx_bus_lock_detection \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_BUS_LOCK_DETECTION)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_BUS_LOCK_DETECTION)
 #define cpu_has_vmx_notify_vm_exiting \
-    (vmx_secondary_exec_control & SECONDARY_EXEC_NOTIFY_VM_EXITING)
+    (IS_ENABLED(CONFIG_INTEL_VMX) && \
+     vmx_secondary_exec_control & SECONDARY_EXEC_NOTIFY_VM_EXITING)
=20
 #define VMCS_RID_TYPE_MASK              0x80000000U
=20
--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 10:11:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 10:11:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773858.1184293 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc06w-0002TQ-NF; Thu, 08 Aug 2024 10:11:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773858.1184293; Thu, 08 Aug 2024 10:11:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc06w-0002TJ-Iz; Thu, 08 Aug 2024 10:11:10 +0000
Received: by outflank-mailman (input) for mailman id 773858;
 Thu, 08 Aug 2024 10:11:10 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=JkzM=PH=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1sc06v-0002TB-U0
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 10:11:09 +0000
Received: from pb-smtp21.pobox.com (pb-smtp21.pobox.com [173.228.157.53])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 84df10d6-556e-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 12:11:05 +0200 (CEST)
Received: from pb-smtp21.pobox.com (unknown [127.0.0.1])
 by pb-smtp21.pobox.com (Postfix) with ESMTP id 2B10B31D10;
 Thu,  8 Aug 2024 06:11:03 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1])
 by pb-smtp21.pobox.com (Postfix) with ESMTP id 242D931D0F;
 Thu,  8 Aug 2024 06:11:03 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [185.130.54.64])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp21.pobox.com (Postfix) with ESMTPSA id EDA2D31D0C;
 Thu,  8 Aug 2024 06:10:58 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 84df10d6-556e-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:in-reply-to:references:mime-version
	:content-transfer-encoding; s=sasl; bh=jkj3n75J3Xa5OS3eW3QITrbx8
	NB9ZCV+n3azsRyLMWo=; b=ZrnBXFqfjRdTXCMRKFiLpgwQVGpjlRg1lpgpcToF0
	oJUWy8oVvGDhvNpfToPLtn47rcdWdms1xgW3MxKj107NbeaUNzzh6854/pqJdIhF
	uFD4AQklESB+fC8gcJBi0UbWByxn+Ld3edNX0S1DiPb5kCaSjps/1r67mZ26aIWi
	yA=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Xenia Ragiadakou <burzalodowa@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
	Julien Grall <julien@xen.org>
Subject: [XEN PATCH v6 2/3] ioreq: do not build arch_vcpu_ioreq_completion() for non-VMX configurations
Date: Thu,  8 Aug 2024 13:10:54 +0300
Message-Id: <04e5397ecfcdb4d5680c7d36f71c4b471004ccd0.1723110344.git.Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1723110344.git.Sergiy_Kibrik@epam.com>
References: <cover.1723110344.git.Sergiy_Kibrik@epam.com>
MIME-Version: 1.0
X-Pobox-Relay-ID:
 8223E5EC-556E-11EF-8DA7-E92ED1CD468F-90055647!pb-smtp21.pobox.com
Content-Transfer-Encoding: quoted-printable

From: Xenia Ragiadakou <burzalodowa@gmail.com>

VIO_realmode_completion is specific to vmx realmode and thus the function
arch_vcpu_ioreq_completion() has actual handling work only in VMX-enabled=
 build,
as for the rest x86 and ARM build configurations it is basically a stub.

Here a separate configuration option ARCH_IOREQ_COMPLETION introduced tha=
t tells
whether the platform we're building for requires any specific ioreq compl=
etion
handling. As of now only VMX has such requirement, so the option is selec=
ted
by INTEL_VMX, for other configurations a generic default stub is provided
(it is ARM's version of arch_vcpu_ioreq_completion() moved to common head=
er).

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
CC: Julien Grall <julien@xen.org>
CC: Jan Beulich <jbeulich@suse.com>
---
changes in v6:
 - rename option ARCH_IOREQ_COMPLETION -> ARCH_VCPU_IOREQ_COMPLETION
 - put a comment with brief option's description
changes in v5:
 - introduce ARCH_IOREQ_COMPLETION option & put arch_vcpu_ioreq_completio=
n() under it
 - description changed
changes in v4:
 - move whole arch_vcpu_ioreq_completion() under CONFIG_VMX and remove
   ARM's variant of this handler, as Julien suggested
---
 xen/Kconfig              |  6 ++++++
 xen/arch/arm/ioreq.c     |  6 ------
 xen/arch/x86/Kconfig     |  1 +
 xen/arch/x86/hvm/ioreq.c |  2 ++
 xen/include/xen/ioreq.h  | 10 ++++++++++
 5 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/xen/Kconfig b/xen/Kconfig
index e459cdac0c..b8d08af374 100644
--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -95,4 +95,10 @@ config LTO
 config ARCH_SUPPORTS_INT128
 	bool
=20
+#
+# For platforms that require specific handling of ioreq completion event=
s
+#
+config ARCH_VCPU_IOREQ_COMPLETION
+	bool
+
 source "Kconfig.debug"
diff --git a/xen/arch/arm/ioreq.c b/xen/arch/arm/ioreq.c
index 5df755b48b..2e829d2e7f 100644
--- a/xen/arch/arm/ioreq.c
+++ b/xen/arch/arm/ioreq.c
@@ -135,12 +135,6 @@ bool arch_ioreq_complete_mmio(void)
     return false;
 }
=20
-bool arch_vcpu_ioreq_completion(enum vio_completion completion)
-{
-    ASSERT_UNREACHABLE();
-    return true;
-}
-
 /*
  * The "legacy" mechanism of mapping magic pages for the IOREQ servers
  * is x86 specific, so the following hooks don't need to be implemented =
on Arm:
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 7ef5c8bc48..74e081c7bd 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -127,6 +127,7 @@ config AMD_SVM
=20
 config INTEL_VMX
 	def_bool HVM
+	select ARCH_VCPU_IOREQ_COMPLETION
=20
 config XEN_SHSTK
 	bool "Supervisor Shadow Stacks"
diff --git a/xen/arch/x86/hvm/ioreq.c b/xen/arch/x86/hvm/ioreq.c
index 4eb7a70182..5c3d0c69aa 100644
--- a/xen/arch/x86/hvm/ioreq.c
+++ b/xen/arch/x86/hvm/ioreq.c
@@ -29,6 +29,7 @@ bool arch_ioreq_complete_mmio(void)
     return handle_mmio();
 }
=20
+#ifdef CONFIG_VCPU_ARCH_IOREQ_COMPLETION
 bool arch_vcpu_ioreq_completion(enum vio_completion completion)
 {
     switch ( completion )
@@ -51,6 +52,7 @@ bool arch_vcpu_ioreq_completion(enum vio_completion com=
pletion)
=20
     return true;
 }
+#endif
=20
 static gfn_t hvm_alloc_legacy_ioreq_gfn(struct ioreq_server *s)
 {
diff --git a/xen/include/xen/ioreq.h b/xen/include/xen/ioreq.h
index cd399adf17..29a17e8ff5 100644
--- a/xen/include/xen/ioreq.h
+++ b/xen/include/xen/ioreq.h
@@ -111,7 +111,17 @@ void ioreq_domain_init(struct domain *d);
 int ioreq_server_dm_op(struct xen_dm_op *op, struct domain *d, bool *con=
st_op);
=20
 bool arch_ioreq_complete_mmio(void);
+
+#ifdef CONFIG_VCPU_ARCH_IOREQ_COMPLETION
 bool arch_vcpu_ioreq_completion(enum vio_completion completion);
+#else
+static inline bool arch_vcpu_ioreq_completion(enum vio_completion comple=
tion)
+{
+    ASSERT_UNREACHABLE();
+    return true;
+}
+#endif
+
 int arch_ioreq_server_map_pages(struct ioreq_server *s);
 void arch_ioreq_server_unmap_pages(struct ioreq_server *s);
 void arch_ioreq_server_enable(struct ioreq_server *s);
--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 10:13:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 10:13:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773868.1184302 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc08w-000367-4s; Thu, 08 Aug 2024 10:13:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773868.1184302; Thu, 08 Aug 2024 10:13:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc08w-000360-2G; Thu, 08 Aug 2024 10:13:14 +0000
Received: by outflank-mailman (input) for mailman id 773868;
 Thu, 08 Aug 2024 10:13:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=JkzM=PH=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1sc08v-00035t-2v
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 10:13:13 +0000
Received: from pb-smtp21.pobox.com (pb-smtp21.pobox.com [173.228.157.53])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d0d9b115-556e-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 12:13:12 +0200 (CEST)
Received: from pb-smtp21.pobox.com (unknown [127.0.0.1])
 by pb-smtp21.pobox.com (Postfix) with ESMTP id 9574B31D25;
 Thu,  8 Aug 2024 06:13:10 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1])
 by pb-smtp21.pobox.com (Postfix) with ESMTP id 9008D31D24;
 Thu,  8 Aug 2024 06:13:10 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [185.130.54.64])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 6257D31D1F;
 Thu,  8 Aug 2024 06:13:06 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d0d9b115-556e-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:in-reply-to:references:mime-version
	:content-transfer-encoding; s=sasl; bh=sYeNlXd320jgCemX/nEWnRjUu
	eRsq3RVfPj+4GsXNkw=; b=t3lazugoe7/x1qIZmwl8Npi/moFcbTxBNi/52MiGH
	r9nibkCsJnVLfUdmZJR8rr4zi6LDVLaDZuETm9o2q9uCd8sRdq9GgA5omZeaHmGa
	h1P4Q3HH9RLRxp/v2Cqq6czo8RRkrI6tU2QJgPn+lX1OkYoLfiIgcyTLrr4xgXTR
	fQ=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Xenia Ragiadakou <burzalodowa@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Subject: [XEN PATCH v6 3/3] x86/hvm: make AMD-V and Intel VT-x support configurable
Date: Thu,  8 Aug 2024 13:13:02 +0300
Message-Id: <f16a25ff16fe14461fad91716acee7a716e5c3fe.1723110344.git.Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1723110344.git.Sergiy_Kibrik@epam.com>
References: <cover.1723110344.git.Sergiy_Kibrik@epam.com>
MIME-Version: 1.0
X-Pobox-Relay-ID:
 CE1762DA-556E-11EF-AE19-E92ED1CD468F-90055647!pb-smtp21.pobox.com
Content-Transfer-Encoding: quoted-printable

From: Xenia Ragiadakou <burzalodowa@gmail.com>

Provide the user with configuration control over the cpu virtualization s=
upport
in Xen by making AMD_SVM and INTEL_VMX options user selectable.

To preserve the current default behavior, both options depend on HVM and
default to value of HVM.

To prevent users from unknowingly disabling virtualization support, make =
the
controls user selectable only if EXPERT is enabled.

No functional change intended.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
changes in v6:
 - "default y" instead of "default HVM"
changes in v5:
- change kconfig option name SVM/VMX -> AMD_SVM/INTEL_VMX
changes in v3:
 - only tags added
---
 xen/arch/x86/Kconfig | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 74e081c7bd..d0aaf359eb 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -123,11 +123,25 @@ config HVM
 	  If unsure, say Y.
=20
 config AMD_SVM
-	def_bool HVM
+	bool "AMD-V" if EXPERT
+	depends on HVM
+	default y
+	help
+	  Enables virtual machine extensions on platforms that implement the
+	  AMD Virtualization Technology (AMD-V).
+	  If your system includes a processor with AMD-V support, say Y.
+	  If in doubt, say Y.
=20
 config INTEL_VMX
-	def_bool HVM
+	bool "Intel VT-x" if EXPERT
+	depends on HVM
+	default y
 	select ARCH_VCPU_IOREQ_COMPLETION
+	help
+	  Enables virtual machine extensions on platforms that implement the
+	  Intel Virtualization Technology (Intel VT-x).
+	  If your system includes a processor with Intel VT-x support, say Y.
+	  If in doubt, say Y.
=20
 config XEN_SHSTK
 	bool "Supervisor Shadow Stacks"
--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 10:31:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 10:31:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773881.1184313 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc0Ql-0007Aw-KU; Thu, 08 Aug 2024 10:31:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773881.1184313; Thu, 08 Aug 2024 10:31:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc0Ql-0007Ap-Gi; Thu, 08 Aug 2024 10:31:39 +0000
Received: by outflank-mailman (input) for mailman id 773881;
 Thu, 08 Aug 2024 10:31:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=6I4s=PH=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1sc0Qj-0007Aj-OR
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 10:31:38 +0000
Received: from fhigh2-smtp.messagingengine.com
 (fhigh2-smtp.messagingengine.com [103.168.172.153])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 61b583d2-5571-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 12:31:34 +0200 (CEST)
Received: from compute6.internal (compute6.nyi.internal [10.202.2.47])
 by mailfhigh.nyi.internal (Postfix) with ESMTP id A269C1146C2A;
 Thu,  8 Aug 2024 06:31:32 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
 by compute6.internal (MEProxy); Thu, 08 Aug 2024 06:31:32 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 8 Aug 2024 06:31:31 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 61b583d2-5571-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:message-id:mime-version:reply-to
	:subject:subject:to:to; s=fm3; t=1723113092; x=1723199492; bh=MX
	44/EWhOUxV2E2PRqPcKlXwkRrpynBXksdVpdffh/o=; b=Sfzg6hgXJ1wKHB9P/L
	+Fel/YzCpIfhYgYm/2ItWvfwPJRzbHti4ZIUPmVBCvaZYLlnjPW78aHFUpWsZHbT
	AQFOU/RWjxM6F6StxaKYPoC1+4vrR0qLmazfcnUbwHfjwN3RwJEM5bEgs5ZnNm0H
	xTJFKOoSAFqgkGVH5ovD73lTbj5iD9eL4Ic0rzxqBzRK5VdKcoSn6rliFrmiELtr
	AKBpksKgFzOvPgG+q6TpguvENTi0KzaZN4dGXsTVxAgduGWkBUy2GiftfpIUAaRZ
	jhfAxdGXdFukphepXXQegqdObXN2T2/bIaDGSLw8tyRGwPzO3SC32ECMMAO9yqBk
	QzMg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:message-id
	:mime-version:reply-to:subject:subject:to:to:x-me-proxy
	:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=
	1723113092; x=1723199492; bh=MX44/EWhOUxV2E2PRqPcKlXwkRrpynBXksd
	Vpdffh/o=; b=k+p26n/Y3/RUqrhpgNcikgQf5f/0GmeD7IPqTmvi+EofKyVm734
	TjADUpCWWvFZ4nnMnivCcpEeT0oo2gaG4HZjhUrU1v1aXSh8LJAV6Sw/OPzUd/08
	2D9isZCEol7pojvle//jXE8IiuHe2WfwSbfpnpgDepAzvyuWlegADrCXODsK6nsy
	pELW6o4IxH/nlkux0dirrP9xlfY7N+3Nul0CCHZCfObUEALteAfMORVf4vSn9ZLN
	dgjLWzzsy4RZIiklUQcsw+fU4oUtAqDLcB1/Pot6UEXYJN4HPYjqC04bLsWQ4Xeo
	CIkzNZm5MyjDY+Oao8IOZ+dTG6LZgtiAlQg==
X-ME-Sender: <xms:hJ60ZgECmiSryqumJyj4CpKH6jbimkWZO4XJJrSfAK2Ywcq9QapKgQ>
    <xme:hJ60ZpXcQfLAkcBNYklqZ206ZhST5MegOG5jP1QeTsVcSc3SE2PBvuVbXB1yT2AF3
    XOn4KG7d2Aang>
X-ME-Received: <xmr:hJ60ZqIh9djv6u8XbYmWzfoQ-HKLiFvPwxIpDnkdpKZ9Uy3e1OnJ-IA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrledvgddvlecutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr
    tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth
    hsucdlqddutddtmdenucfjughrpeffhffvvefukfggtggusehgtderredttdejnecuhfhr
    ohhmpeforghrvghkucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmh
    grrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrght
    thgvrhhnpeehgfeuvdejkeeikeeludelteevfeegffegteefffetheetffduudejuedugf
    dvteenucffohhmrghinhepqhhusggvshdqohhsrdhorhhgpdhgihhthhhusgdrtghomhen
    ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmh
    grrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhmpdhnsggprhgtphht
    thhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeigvghnqdguvghvvghlse
    hlihhsthhsrdigvghnphhrohhjvggtthdrohhrghdprhgtphhtthhopehjghhrohhsshes
    shhushgvrdgtohhmpdhrtghpthhtohepshhsthgrsggvlhhlihhniheskhgvrhhnvghlrd
    horhhgpdhrtghpthhtohepohhlvghkshgrnhgurhgpthihshhhtghhvghnkhhosegvphgr
    mhdrtghomhdprhgtphhtthhopehrvghgrhgvshhsihhonhhssehlihhsthhsrdhlihhnuh
    igrdguvghv
X-ME-Proxy: <xmx:hJ60ZiFK0l7BtgmVhziBoIOkfp6sZckUZStschxVBC9zR2ytrNAj9w>
    <xmx:hJ60ZmX60n78_jvGaZmsCaYL6EymfslYmknDzO1CJplaPCk3sIOfRA>
    <xmx:hJ60ZlP3zXhYPP-iRvLbxHrdS2cOpZ6khrTYzNQBmp4UG7D2WJlYAw>
    <xmx:hJ60Zt1xCOmu9eXBsSpXeM9hTXsFX4q4g77MOeNupKAK9lXM8tesBg>
    <xmx:hJ60Zkx_sVU4AhNMumtRm3FetoBMlX98_yXouWAjz0O3_EO9Rt-3XwHY>
Feedback-ID: i1568416f:Fastmail
Date: Thu, 8 Aug 2024 12:31:13 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: xen-devel <xen-devel@lists.xenproject.org>
Cc: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	regressions@lists.linux.dev
Subject: [REGRESSION] kernel NULL pointer dereference in xen-balloon with mem
 hotplug
Message-ID: <ZrSecpuTN9zgtqYu@mail-itl>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="kt7u1tiUe8A/rt3t"
Content-Disposition: inline


--kt7u1tiUe8A/rt3t
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Thu, 8 Aug 2024 12:31:13 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: xen-devel <xen-devel@lists.xenproject.org>
Cc: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	regressions@lists.linux.dev
Subject: [REGRESSION] kernel NULL pointer dereference in xen-balloon with mem
 hotplug

Hi,

When testing Linux 6.11-rc2, I've got the crash like below. It's a PVH
guest started with 400MB memory, and then extended via mem hotplug (I
don't know to what exact size it was at this time, but up to 4GB), it
was quite early in the domU boot process, I suspect it could be the
first mem hotplug even happening there.
Unfortunately I don't have reliable reproducer, it crashed only once
over several test runs. I don't remember seeing such crash before, so it
looks like a regression in 6.11. I'm not sure if that matters, but it's
on ADL, very similar to the qubes-hw2 gitlab runner.

The crash message:

    [    3.606538] BUG: kernel NULL pointer dereference, address: 000000000=
0000000
    [    3.606556] #PF: supervisor read access in kernel mode
    [    3.606568] #PF: error_code(0x0000) - not-present page
    [    3.606580] PGD 0 P4D 0=20
    [    3.606590] Oops: Oops: 0000 [#1] PREEMPT SMP NOPTI
    [    3.606603] CPU: 1 UID: 0 PID: 45 Comm: xen-balloon Not tainted 6.11=
=2E0-0.rc2.1.qubes.1.fc37.x86_64 #1
    [    3.606623] RIP: 0010:phys_pmd_init+0x96/0x500
    [    3.606636] Code: 89 ed 48 c1 e8 12 48 81 e7 00 00 e0 ff 25 f8 0f 00=
 00 4c 8d af 00 00 20 00 4c 8d 24 03 48 8b 1c 24 4c 39 fd 0f 83 89 02 00 00=
 <49> 8b 0c 24 48 f7 c1 9f ff ff ff 0f 84 b6 01 00 00 48 8b 05 d2 99
    [    3.606680] RSP: 0018:ffffc90000987b90 EFLAGS: 00010287
    [    3.606695] RAX: 0000000000000000 RBX: 8000000000000163 RCX: 0000000=
000000004
    [    3.606713] RDX: 0000000090000000 RSI: 0000000080000000 RDI: 0000000=
080000000
    [    3.606729] RBP: 0000000080000000 R08: 8000000000000163 R09: 0000000=
000000001
    [    3.606748] R10: 0000000000000000 R11: 0000000000ffff0a R12: 0000000=
000000000
    [    3.606766] R13: 0000000080200000 R14: 0000000000000000 R15: 0000000=
090000000
    [    3.606784] FS:  0000000000000000(0000) GS:ffff888018500000(0000) kn=
lGS:0000000000000000
    [    3.606802] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [    3.606819] CR2: 0000000000000000 CR3: 00000000107bc000 CR4: 0000000=
000750ef0
    [    3.606840] PKRU: 55555554
    [    3.606847] Call Trace:
    [    3.606854]  <TASK>
    [    3.606862]  ? __die+0x23/0x70
    [    3.606876]  ? page_fault_oops+0x95/0x190
    [    3.606887]  ? exc_page_fault+0x76/0x190
    [    3.606900]  ? asm_exc_page_fault+0x26/0x30
    [    3.606917]  ? phys_pmd_init+0x96/0x500
    [    3.606927]  phys_pud_init+0xe8/0x4f0
    [    3.606940]  __kernel_physical_mapping_init+0x1d5/0x380
    [    3.606955]  ? synchronize_rcu_normal.part.0+0x45/0x70
    [    3.606971]  init_memory_mapping+0xb0/0x1f0
    [    3.606983]  arch_add_memory+0x2f/0x50
    [    3.606997]  add_memory_resource+0xff/0x2c0
    [    3.607008]  reserve_additional_memory+0x162/0x1d0
    [    3.607026]  balloon_thread+0xe4/0x490
    [    3.607041]  ? __pfx_autoremove_wake_function+0x10/0x10
    [    3.607060]  ? __pfx_balloon_thread+0x10/0x10
    [    3.607076]  kthread+0xcf/0x100
    [    3.607090]  ? __pfx_kthread+0x10/0x10
    [    3.607101]  ret_from_fork+0x31/0x50
    [    3.607112]  ? __pfx_kthread+0x10/0x10
    [    3.607123]  ret_from_fork_asm+0x1a/0x30
    [    3.607135]  </TASK>
    [    3.607141] Modules linked in: xenfs binfmt_misc nft_reject_inet nf_=
reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nf_conntrack nf_defrag_ipv6 nf=
_defrag_ipv4 nf_tables nfnetlink intel_rapl_msr intel_rapl_common intel_unc=
ore_frequency_common crct10dif_pclmul crc32_pclmul crc32c_intel polyval_clm=
ulni polyval_generic ghash_clmulni_intel sha512_ssse3 sha256_ssse3 sha1_sss=
e3 xen_netfront xen_privcmd xen_gntdev xen_gntalloc xen_blkback xen_evtchn =
loop fuse ip_tables overlay xen_blkfront
    [    3.607266] CR2: 0000000000000000
    [    3.607277] ---[ end trace 0000000000000000 ]---
    [    3.607291] RIP: 0010:phys_pmd_init+0x96/0x500
    [    3.607307] Code: 89 ed 48 c1 e8 12 48 81 e7 00 00 e0 ff 25 f8 0f 00=
 00 4c 8d af 00 00 20 00 4c 8d 24 03 48 8b 1c 24 4c 39 fd 0f 83 89 02 00 00=
 <49> 8b 0c 24 48 f7 c1 9f ff ff ff 0f 84 b6 01 00 00 48 8b 05 d2 99
    [    3.607356] RSP: 0018:ffffc90000987b90 EFLAGS: 00010287
    [    3.607371] RAX: 0000000000000000 RBX: 8000000000000163 RCX: 0000000=
000000004
    [    3.607389] RDX: 0000000090000000 RSI: 0000000080000000 RDI: 0000000=
080000000
    [    3.607406] RBP: 0000000080000000 R08: 8000000000000163 R09: 0000000=
000000001
    [    3.607428] R10: 0000000000000000 R11: 0000000000ffff0a R12: 0000000=
000000000
    [    3.607449] R13: 0000000080200000 R14: 0000000000000000 R15: 0000000=
090000000
    [    3.607469] FS:  0000000000000000(0000) GS:ffff888018500000(0000) kn=
lGS:0000000000000000
    [    3.607488] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [    3.607504] CR2: 0000000000000000 CR3: 00000000107bc000 CR4: 0000000=
000750ef0
    [    3.607525] PKRU: 55555554
    [    3.607533] Kernel panic - not syncing: Fatal exception
    [    3.607599] Kernel Offset: disabled

Full domU log:
https://openqa.qubes-os.org/tests/108883/file/system_tests-qubes.tests.inte=
g.vm_qrexec_gui.TC_20_NonAudio_whonix-workstation-17.test_105.guest-test-in=
st-vm2.log
Other logs, including dom0 and Xen messages:
https://openqa.qubes-os.org/tests/108883#downloads

Kernel config is build from merging
https://github.com/QubesOS/qubes-linux-kernel/blob/005ae1ac3819d957379e48fb=
2cfd33f511a47275/config-base
with
https://github.com/QubesOS/qubes-linux-kernel/blob/005ae1ac3819d957379e48fb=
2cfd33f511a47275/config-qubes
(options set in the latter takes precedence)
Especially, it has:
CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=3Dy
CONFIG_XEN_UNPOPULATED_ALLOC=3Dy

#regzbot introduced: v6.10..v6.11-rc2

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

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

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAma0nnIACgkQ24/THMrX
1yyw4wf/VHGBECVm870HmY0iwiXw0Wjf7qkIVuUbdK4O/z3R5o8tcv1MnkMM8wQG
otXtOP6C3QN5GP0iILNlObzmsrtFpNXFDoDi8fWZkHJ2nOHo3tr9iGaOzlB+L2KM
XpAT5n9JFSHAz8xY/DbU81m2CGGMvvRXTq9o6d/B5wO9lYbqOSN5yjPZHCifsHb9
Vsnf3c0hzk2qBCzb5wq806kOit37+8RHjYy0vPQVjPwaZmTwT6NRxvunDmTjCXz2
H2F93zXnRaC/6KGICTFJCjOYOYyLGhXUbYO+EOuVys6XDHQFO1YXa5Ob/1ylFVFg
CI79rS8pTHkv9Il8KfiwnNc8ovwEAQ==
=ZqgP
-----END PGP SIGNATURE-----

--kt7u1tiUe8A/rt3t--


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 10:36:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 10:36:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773892.1184322 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc0Vf-0007wA-53; Thu, 08 Aug 2024 10:36:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773892.1184322; Thu, 08 Aug 2024 10:36:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc0Vf-0007w3-25; Thu, 08 Aug 2024 10:36:43 +0000
Received: by outflank-mailman (input) for mailman id 773892;
 Thu, 08 Aug 2024 10:36:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sc0Vd-0007uh-6u
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 10:36:41 +0000
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com
 [2a00:1450:4864:20::62a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 18841c8a-5572-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 12:36:39 +0200 (CEST)
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a7aa4bf4d1eso108034766b.0
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 03:36:39 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ec8884sm725231766b.193.2024.08.08.03.36.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 03:36:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 18841c8a-5572-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723113399; x=1723718199; 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=PzDA/usYkved4BZbdw6J/ufK5oGICJQfOYw2WjQpl8A=;
        b=eKyRSsGVw21zOaGDeo+SGLhjWlQKwCQGazm4mx+blsCo7acg9XUfa8PKVpGvquSM1Q
         dwenQ7wBxmo0dCOdJvA6EGeAoTfVy2jIkqX3hpgUJxG8qEBCXyMftilD/EC1CHVhuXpk
         wEyJ+cabHTpABZlyINNC5YzRNzyaqz8+NSd3tsgQRvaNqbjeCn0faozhbFF+fPpXvKD1
         pLeJhaqtHIxn4/b/00KtAzzGVP+JaQ0dCnfPjwbW3HSE4kpxPPZM2a+GkNnN7l/vyPZh
         uqHf+82SuoRq7xAPsVrz6QLM1KHhS6c8O4Bva51n0PKoiDB+PUzlhZKhsavR4M/Sw0A+
         MLYQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723113399; x=1723718199;
        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=PzDA/usYkved4BZbdw6J/ufK5oGICJQfOYw2WjQpl8A=;
        b=o4HHs/XEpHtX3kru91YAJOpgqUNcbsfhjN4PNNDvyleOhnyjmquCL21jBa/leoapaP
         OyKxGHMTabjjj1Qq6K8QpeTTeNOnFJV6/Evy7yNiySPgmNYGQQh1XU0Kiq4clccCa28O
         U7hO5k+kBg7eeHty618Q8uil2l86ZHrswQ69qf8atTCDpRwqUwxPg8NbdQ4NJjvI90Ya
         KGJajtOkJYFQls7bNzG/ZWMHawU9WH6zwZv0hxjEirD0orBW7FJNyAGFajSJpMzlRBL2
         HDErHjajHyxPJC2pU1v/n5/6n2uDKosvmmX895H/rTeHl+jdwsaXyrK7/r1jiOfRxl7N
         FsXA==
X-Forwarded-Encrypted: i=1; AJvYcCVTXwDVreXNNIZr6YTPMDMyBAqDIMPUoff6+HUKBOfzxmVvHSg1DzwjKwD02Lyp1rwMF/Felyr+Krsphe4wAG/MbCMTt6+8TwfGGidWpY0=
X-Gm-Message-State: AOJu0YxP80tJ/K7+htzwsMHPMq/ca6lllVeJQd/FoA9VqaO6GWZubE3q
	0t4aU6s4VdFw5NQuxuWWFZcuiQ/vhevYhB5Mv7IOnpfkYG5UTBiHak65L1pa1xF2xGT+osoJ4BM
	=
X-Google-Smtp-Source: AGHT+IEMTnYrws1JouxtNS0vn5DA4Doi61pLKO9PCaIXmrdlRv8i6zKbQv8n3mDxueDKMefy0pl9Jw==
X-Received: by 2002:a17:907:944c:b0:a7a:c083:8575 with SMTP id a640c23a62f3a-a80907c97e5mr94279066b.0.1723113399146;
        Thu, 08 Aug 2024 03:36:39 -0700 (PDT)
Message-ID: <68a1b0cf-24a4-49a2-a398-6fa56a6bcdc3@suse.com>
Date: Thu, 8 Aug 2024 12:36:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 5/5] x86: Rollback relocation in case of EFI multiboot
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-6-alejandro.vallejo@cloud.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: <20240807134819.8987-6-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 07.08.2024 15:48, Alejandro Vallejo wrote:
> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -352,6 +352,7 @@ __efi64_mb2_start:
>          and     $~15,%rsp
>  
>          /* Save Multiboot2 magic on the stack. */
> +        shlq    $32, %rax

As indicated for the earlier patch: No insn suffixes please when they're
not actually needed to clarify operand size. (Or else at the very least
be consistent and have suffixes everywhere. Comment applies throughout
the patch.)

Additionally there's some trickery going on here which absolutely needs
commenting, at least lightly. Aiui ...

>          push    %rax
>  
>          /* Save EFI ImageHandle on the stack. */
> @@ -382,11 +383,24 @@ __efi64_mb2_start:
>          /* Just pop an item from the stack. */
>          pop     %rax
>  
> -        /* Restore Multiboot2 magic. */
> -        pop     %rax

... you eliminate this in favor of ...

> +        /* Prepare stack for relocation call */
> +        subq    $16, %rsp

... using the low half of that stack slot here for the last function
argument, then POPing %eax entirely elsewhere, in trampoline_efi_setup.

> +        lea     l2_bootmap(%rip), %ecx
> +        movl    %ecx, 16(%rsp)
> +        lea     l3_bootmap(%rip), %ecx
> +        movl    %ecx, 12(%rsp)
> +        lea     __base_relocs_end(%rip), %ecx
> +        movl    %ecx, 8(%rsp)
> +        lea     __base_relocs_start(%rip), %ecx
> +        movl    %ecx, 4(%rsp)
> +        lea     __image_base__(%rip),%rsi

Nit: Consistently blanks after commas please in new code.

> +        movl    %esi, (%rsp)

Since a 32-bit value suffices, why a 64-bit LEA above?

> +        movabsq $__XEN_VIRT_START, %rcx
> +        subq    %rsi, %rcx
> +        push    %rcx
>  
> -        /* Jump to trampoline_setup after switching CPU to x86_32 mode. */
> -        lea     trampoline_setup(%rip),%r15
> +        /* Jump to trampoline_efi_setup after switching CPU to x86_32 mode. */
> +        lea     trampoline_efi_setup(%rip),%r15
>  
>  x86_32_switch:
>          mov     %r15,%rdi

All of the changes here are benign to the existing MB2/EFI code path just
because __base_relocs_start[] is empty there, aiui. That could certainly
do with making explicit in the description. Initially I meant to indicate
that apparently you're breaking that path.

> --- a/xen/arch/x86/boot/reloc.c
> +++ b/xen/arch/x86/boot/reloc.c
> @@ -23,7 +23,9 @@ asm (
>      "    .text                         \n"
>      "    .globl _start                 \n"
>      "_start:                           \n"
> -    "    jmp  reloc                    \n"
> +    "    cmpb $0, %al                  \n"
> +    "    je   reloc                    \n"

While minor here, I think we should generally prefer TEST (and then JZ)
over CMP when checking for 0. I wonder though whether we really want to
go with this kind of multiplexing. A new reloc-pe.c may be a cleaner
approach. This may then (possibly later) also allow to (more easily)
exclude this code when linking xen-syms.

> @@ -375,6 +377,65 @@ void *__stdcall reloc(uint32_t magic, uint32_t in, uint32_t trampoline,
>      }
>  }
>  
> +struct pe_base_relocs {
> +    u32 rva;
> +    u32 size;
> +    u16 entries[];

uint<N>_t please in new code (but see also at the bottom).

> +};
> +
> +#define PE_BASE_RELOC_ABS      0
> +#define PE_BASE_RELOC_HIGHLOW  3
> +#define PE_BASE_RELOC_DIR64   10
> +
> +void __stdcall reloc_pe_back(long long delta,
> +                             uint32_t xen_phys_start,
> +                             const struct pe_base_relocs *__base_relocs_start,
> +                             const struct pe_base_relocs *__base_relocs_end,
> +                             char *l3_bootmap, char *l2_bootmap)

You only ever use the last two when cast to unsigned long. What's wrong
with declaring them as unsigned long right away? xen_phys_start may also
want to have unsigned long type.

> +{
> +    const struct pe_base_relocs *base_relocs;
> +
> +    for ( base_relocs = __base_relocs_start; base_relocs < __base_relocs_end; )
> +    {
> +        unsigned int i = 0, n;
> +
> +        n = (base_relocs->size - sizeof(*base_relocs)) /
> +            sizeof(*base_relocs->entries);
> +
> +        /*
> +         * Relevant l{2,3}_bootmap entries get initialized explicitly in
> +         * efi_arch_memory_setup(), so we must not apply relocations there.
> +         * l2_directmap's first slot, otoh, should be handled normally, as
> +         * efi_arch_memory_setup() won't touch it (xen_phys_start should
> +         * never be zero).
> +         */
> +        if ( xen_phys_start + base_relocs->rva == (unsigned long)l3_bootmap ||
> +             xen_phys_start + base_relocs->rva == (unsigned long)l2_bootmap )
> +            i = n;
> +
> +        for ( ; i < n; ++i )
> +        {
> +            unsigned long addr = xen_phys_start + base_relocs->rva +
> +                                 (base_relocs->entries[i] & 0xfff);
> +
> +            switch ( base_relocs->entries[i] >> 12 )
> +            {
> +            case PE_BASE_RELOC_ABS:
> +                break;
> +            case PE_BASE_RELOC_HIGHLOW:
> +                if ( delta )
> +                    *(u32 *)addr += delta;
> +                break;
> +            case PE_BASE_RELOC_DIR64:
> +                if ( delta )
> +                    *(u64 *)addr += delta;
> +                break;
> +            }

Except for the dropped default case (which imo needs to be there, just
that you can't use blexit() here), the body of the function looks like
a plain copy of efi_arch_relocate_image(). We want to avoid such
(source) duplication, and rather put the logic in e.g. a header
included by both parties.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 11:22:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 11:22:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773907.1184332 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc1E2-00005j-Cs; Thu, 08 Aug 2024 11:22:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773907.1184332; Thu, 08 Aug 2024 11:22:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc1E2-00005b-A2; Thu, 08 Aug 2024 11:22:34 +0000
Received: by outflank-mailman (input) for mailman id 773907;
 Thu, 08 Aug 2024 11:22:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sc1E1-00005U-ED
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 11:22:33 +0000
Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com
 [2a00:1450:4864:20::633])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 81043b03-5578-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 13:22:32 +0200 (CEST)
Received: by mail-ej1-x633.google.com with SMTP id
 a640c23a62f3a-a6265d3ba8fso72179766b.0
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 04:22:32 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9c0cae0sm726939466b.56.2024.08.08.04.22.31
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 04:22:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 81043b03-5578-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723116152; x=1723720952; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=p8FHoDPkHcs4VHYTOWUZslUsd3E+KvGyOubSbSuJsXs=;
        b=WrFoYUwEh2gN3DQppbNJvtyhPr265hAfeVYpSZ/FxD3Hkw1OcICFzy6L//V3NWJwLT
         p73bt5p7p2PXYJKNwBVJP1KreCzkr5fzVgrnL0pvlDVmRV3M8eB9UNzOFgSFS2HEm/iO
         HmBtCV4RCf73oQjKh0hzamnkgmF5uHnpbJaQHOL+N/qPQAbVvqGF7+z8kIyoum/b0Z+3
         jH/2cckiKg0m/MM/+2snUbkDD/tCv7DNhdQjbNw0/f6foj5/S0KFTp6ZyKucK8W48G1Z
         kETORK3f7UFCOkRrA0HBWqydi8ztExW9QMPHyz3nFUky9zTHF+NlNzJUvmSORP3v/Rx7
         cJmw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723116152; x=1723720952;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :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=p8FHoDPkHcs4VHYTOWUZslUsd3E+KvGyOubSbSuJsXs=;
        b=vQV/edXWlH9vtIcDjQ+v8216tw4svHdS2PJzrThSsIc/pImW7T6ym7n1ZwLY2tsx0o
         yHf9AjJ/wjyPebbJ59UBxWQ1/RMnG25uOHyN8BVSUklFi3S0X+wOyNnOiXtTICA62rql
         SF2X/YjRNPaeoT/4Roe/PQ/1NnzT1zfOqSsJdvijYqPF4ohcgow34xOyuJjW2Xr6IyWK
         V06GHGPYxzJY1ilrV+pQa07LMDyaoxKcEEfQy4qLZb+OWyig2+Rb+NaNIPU1xsZf9o/O
         Vcgn+JEV1WlMcCi1UVImvMY5OisBZMs9mo8l8+deRbCD45DZ9t8FnBPkxa53Xh9/gZn2
         pBFg==
X-Gm-Message-State: AOJu0Ywx2NP2aR16CTk7ARbmb4FqluSPqer0jVODyie/zAdiHZGp17Vi
	KQRxJdP3l+w8lHnhqXowTfeA7ky+pqaoUeI0pqWeeEMWV1Oi5szzkB7MYHCNCP0jOfkoOlhBT78
	=
X-Google-Smtp-Source: AGHT+IFmPlXbj4rZrGHlI/NBPvOm2s+ZNMp3BzJHTProh7JAm/dDwHLeKYmzj/RktjErBXpeU+Re2A==
X-Received: by 2002:a17:906:dc95:b0:a7c:4095:ccb6 with SMTP id a640c23a62f3a-a8090c7f43emr118676666b.16.1723116151465;
        Thu, 08 Aug 2024 04:22:31 -0700 (PDT)
Message-ID: <579fd84d-0a31-43b3-8ce1-f826134cd8a2@suse.com>
Date: Thu, 8 Aug 2024 13:22:30 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Assertion failed at arch/x86/genapic/x2apic.c:38 on S3 resume
 nested in KVM on AMD
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>
References: <Zp--KHAFuDVnH1Oq@mail-itl>
Content-Language: en-US
Cc: xen-devel <xen-devel@lists.xenproject.org>
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 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: <Zp--KHAFuDVnH1Oq@mail-itl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 23.07.2024 16:28, Marek Marczykowski-Górecki wrote:
> I'm observing a crash like the one below when trying to resume from S3.
> It happens on Xen nested in KVM (QEMU 9.0, Linux 6.9.3) but only on AMD.
> The very same software stack on Intel works just fine. QEMU is running
> with "-cpu host,+svm,+invtsc -machine q35,kernel-irqchip=split -device
> amd-iommu,intremap=on -smp 2" among others.
> 
>     (XEN) Preparing system for ACPI S3 state.
>     (XEN) Disabling non-boot CPUs ...
>     (XEN) Broke affinity for IRQ1, new: {0-1}
>     (XEN) Broke affinity for IRQ20, new: {0-1}
>     (XEN) Broke affinity for IRQ22, new: {0-1}
>     (XEN) Entering ACPI S3 state.
>     (XEN) Finishing wakeup from ACPI S3 state.
>     (XEN) Enabling non-boot CPUs  ...
>     (XEN) Assertion 'cpumask_test_cpu(this_cpu, per_cpu(cluster_cpus, this_cpu))' failed at arch/x86/genapic/x2apic.c:38
>     (XEN) ----[ Xen-4.20  x86_64  debug=y  Not tainted ]----
>     (XEN) CPU:    1
>     (XEN) RIP:    e008:[<ffff82d04028862b>] x2apic.c#init_apic_ldr_x2apic_cluster+0x8a/0x1b9
>     (XEN) RFLAGS: 0000000000010096   CONTEXT: hypervisor
>     (XEN) rax: ffff830278a25f50   rbx: 0000000000000001   rcx: ffff82d0405e1700
>     (XEN) rdx: 0000003233412000   rsi: ffff8302739da2d8   rdi: 0000000000000000
>     (XEN) rbp: 00000000000000c8   rsp: ffff8302739d7e78   r8:  0000000000000001
>     (XEN) r9:  ffff8302739d7fa0   r10: 0000000000000001   r11: 0000000000000000
>     (XEN) r12: 0000000000000001   r13: 0000000000000001   r14: 0000000000000000
>     (XEN) r15: 0000000000000000   cr0: 000000008005003b   cr4: 00000000007506e0
>     (XEN) cr3: 000000007fa7a000   cr2: 0000000000000000
>     (XEN) fsb: 0000000000000000   gsb: 0000000000000000   gss: 0000000000000000
>     (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
>     (XEN) Xen code around <ffff82d04028862b> (x2apic.c#init_apic_ldr_x2apic_cluster+0x8a/0x1b9):
>     (XEN)  cf 82 ff ff eb b7 0f 0b <0f> 0b 48 8d 05 9c fc 33 00 48 8b 0d a5 0a 35 00
>     (XEN) Xen stack trace from rsp=ffff8302739d7e78:
>     (XEN)    0000000000000000 00000000000000c8 0000000000000001 0000000000000001
>     (XEN)    0000000000000000 ffff82d0402f1d83 ffff8302739d7fff 00000000000000c8
>     (XEN)    0000000000000001 0000000000000001 ffff82d04031adb9 0000000000000001
>     (XEN)    0000000000000000 0000000000000000 0000000000000000 ffff82d040276677
>     (XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
>     (XEN)    ffff88810037c000 0000000000000001 0000000000000246 deadbeefdeadf00d
>     (XEN)    0000000000000001 aaaaaaaaaaaaaaaa 0000000000000000 ffffffff811d130a
>     (XEN)    deadbeefdeadf00d deadbeefdeadf00d deadbeefdeadf00d 0000010000000000
>     (XEN)    ffffffff811d130a 000000000000e033 0000000000000246 ffffc900400b3ef8
>     (XEN)    000000000000e02b 000000000000beef 000000000000beef 000000000000beef
>     (XEN)    000000000000beef 0000e01000000001 ffff8302739de000 0000003233412000
>     (XEN)    00000000007506e0 0000000000000000 0000000000000000 0000000200000000
>     (XEN)    0000000000000002
>     (XEN) Xen call trace:
>     (XEN)    [<ffff82d04028862b>] R x2apic.c#init_apic_ldr_x2apic_cluster+0x8a/0x1b9
>     (XEN)    [<ffff82d0402f1d83>] S setup_local_APIC+0x26/0x449
>     (XEN)    [<ffff82d04031adb9>] S start_secondary+0x1c4/0x37a
>     (XEN)    [<ffff82d040276677>] S __high_start+0x87/0xd0
>     (XEN) 
>     (XEN) 
>     (XEN) ****************************************
>     (XEN) Panic on CPU 1:
>     (XEN) Assertion 'cpumask_test_cpu(this_cpu, per_cpu(cluster_cpus, this_cpu))' failed at arch/x86/genapic/x2apic.c:38
>     (XEN) ****************************************

Would you mind giving the patch below a try?

Jan

x86/x2APIC: correct cluster tracking upon CPUs going down for S3

Downing CPUs for S3 is somewhat special: Since we can expect the system
to come back up in exactly the same hardware configuration, per-CPU data
for the secondary CPUs isn't de-allocated (and then cleared upon re-
allocation when the CPUs are being brought back up). Therefore the
cluster_cpus per-CPU pointer will retain its value for all CPUs other
than the final one in a cluster (i.e. in particular for all CPUs in the
same cluster as CPU0). That, however, is in conflict with the assertion
early in init_apic_ldr_x2apic_cluster().

Note that the issue is avoided on Intel hardware, where we park CPUs
instead of bringing them down.

Extend the bypassing of the freeing to the suspend case, thus making
suspend/resume also a tiny bit faster.

Fixes: 2e6c8f182c9c ("x86: distinguish CPU offlining from CPU removal")
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -228,7 +228,8 @@ static int cf_check update_clusterinfo(
     case CPU_UP_CANCELED:
     case CPU_DEAD:
     case CPU_REMOVE:
-        if ( park_offline_cpus == (action != CPU_REMOVE) )
+        if ( park_offline_cpus == (action != CPU_REMOVE) ||
+             system_state == SYS_STATE_suspend )
             break;
         if ( per_cpu(cluster_cpus, cpu) )
         {




From xen-devel-bounces@lists.xenproject.org Thu Aug 08 12:02:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 12:02:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773939.1184407 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc1qR-0007s6-0d; Thu, 08 Aug 2024 12:02:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773939.1184407; Thu, 08 Aug 2024 12:02:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc1qQ-0007rz-TS; Thu, 08 Aug 2024 12:02:14 +0000
Received: by outflank-mailman (input) for mailman id 773939;
 Thu, 08 Aug 2024 12:02:13 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sc1qP-0007rk-MD; Thu, 08 Aug 2024 12:02:13 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sc1qP-0007AZ-BY; Thu, 08 Aug 2024 12:02:13 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sc1qO-00059M-P8; Thu, 08 Aug 2024 12:02:12 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sc1qO-0003hq-Oc; Thu, 08 Aug 2024 12:02:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=0iVEkBcbMvASe5Yk+c+wDLR8fIdyjS00b732TcuFDl8=; b=l+Dr6nny8/z4qN8hDb4YqI7/Jo
	hDItJndr9XYFo+pfi4yPW90+t6g+S9tcdUp7Ir+92gA4v2u6+S/c2k6+T1uDUnocqh5+VbFNKIpf0
	g+r9wGSPp2OID6bhVnnnZvVc2RGaMxx9sOid70lfm+XOEPfnwy6U6RAp3Rnp43e46kKU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187188-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187188: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:regression
    linux-linus:test-amd64-amd64-libvirt:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=6a0e38264012809afa24113ee2162dc07f4ed22b
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 08 Aug 2024 12:02:12 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail REGR. vs. 186827

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-libvirt     20 guest-start/debian.repeat  fail pass in 187184

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

version targeted for testing:
 linux                6a0e38264012809afa24113ee2162dc07f4ed22b
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   22 days
Failing since        186925  2024-07-20 09:44:52 Z   19 days   40 attempts
Testing same since   187184  2024-08-07 21:12:35 Z    0 days    2 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 12:09:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 12:09:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773965.1184479 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc1xt-0001Qo-Fx; Thu, 08 Aug 2024 12:09:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773965.1184479; Thu, 08 Aug 2024 12:09:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc1xt-0001Qh-Cx; Thu, 08 Aug 2024 12:09:57 +0000
Received: by outflank-mailman (input) for mailman id 773965;
 Thu, 08 Aug 2024 12:09: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=eqo7=PH=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sc1xs-0001Bl-30
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 12:09:56 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on20620.outbound.protection.outlook.com
 [2a01:111:f403:2414::620])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1eb32eab-557f-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 14:09:54 +0200 (CEST)
Received: from MW4PR04CA0130.namprd04.prod.outlook.com (2603:10b6:303:84::15)
 by MN2PR12MB4469.namprd12.prod.outlook.com (2603:10b6:208:268::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Thu, 8 Aug
 2024 12:09:48 +0000
Received: from CO1PEPF000042AA.namprd03.prod.outlook.com
 (2603:10b6:303:84:cafe::1b) by MW4PR04CA0130.outlook.office365.com
 (2603:10b6:303:84::15) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15 via Frontend
 Transport; Thu, 8 Aug 2024 12:09:48 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1PEPF000042AA.mail.protection.outlook.com (10.167.243.39) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Thu, 8 Aug 2024 12:09:47 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 8 Aug
 2024 07:09:45 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Thu, 8 Aug 2024 07:09:44 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1eb32eab-557f-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=r45nxc5ioOZfh+axUX0eSv5kIqMvcqbSZMOJtkKbx5eH/lehbCQQaMeXTMuhSGZyOIDrXT6fE4DvcYAuPJHpmgt3bPWC99XAocT9cjUJrTuSaDQl6hetXXDKDTJ32rhRBg34nWvLrDcUjBwQXcFWZMJq6WOGG0io9M+cYJt8B+tjV4IIXM1N4xJXRecdQmUr4pF0CWfDBb+fUcxY0fnPoK9zn5dLZTCYPquA+wERigOWm3A59n2AncoaQ352FenJL31nlfs9M5gakS/Z+2SUMDJUfw64XsEet7bt9gmVzhj5uSBts0/Ew5egpbPd94nH2gd/5kEGOgnFSd/IaCv/bg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BwnutoGseyOzPvX5xpU7euJ358TBpCesIKsrFcbDnqU=;
 b=ugiShT6dDzYiTlOynD3opqKpHmCuXow995k/4PbLHW+QbhWYGHQxMwcRKSvq80ylVEQnnzkfAxcOCYnKlkSMD9QaY4DxjT7FSKp02OeS6d0ZDt+XSTKLGXJfqVYBU8bWLaqTmobVeJvepdYY+xwcK/Hfzl5JdG47sMekWIzQ+nO7jehGPH2fwk/3puRbqzN4a3mXOeEM6WoDZsW8KZOwxWPCS651nGLp+2hib1b7OIrDwaBXmOix4LJ+RbgWSWJtlYCoZPpq7neNaH6LUY56WXKlwawGLBqMboGBvNod0H7nWqEc1sGfty548UmfJaLP8aHp1Hi+NkJQkGVRitDxDQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BwnutoGseyOzPvX5xpU7euJ358TBpCesIKsrFcbDnqU=;
 b=syPB84+sX6kqZLMHisPRl9eo+E3JxK2hol2sw2rqvjn5XAA2Ng6Fcde+5lWl4YQxNtG055Zu+UrJK2An1ik33CH4rv34th9smBfB1pmdW1RS1UkN0vH3dgAAkKbx9D8Td4dSUV82BWT9mqTfHMrw68gPo/qNTDqNcdvnihpzw38=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<Volodymyr_Babchuk@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>, Penny Zheng <penny.zheng@arm.com>, "Wei
 Chen" <wei.chen@arm.com>
Subject: [PATCH v2 2/4] xen: arm: make VMAP only support in MMU system
Date: Thu, 8 Aug 2024 13:09:34 +0100
Message-ID: <20240808120936.3299937-3-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
References: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB03.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000042AA:EE_|MN2PR12MB4469:EE_
X-MS-Office365-Filtering-Correlation-Id: bbe88be2-003a-4d26-2cc1-08dcb7a2ffb7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?Lc7ottl+1M2zg0f2LDpRfZmm711mqvS07oMMJjEjb9ygofS9Fpsm9knnJW83?=
 =?us-ascii?Q?huobFhSyaTujCPWzs4J5Gm/gg2zL6d+eqEZqHX2EH+rvwtcT1m3YngM301fw?=
 =?us-ascii?Q?a637cHm4egl+MR9g5eOjvRneXWSWMATLM9vJnBNrZeYEER27iyUvhhIXbFiM?=
 =?us-ascii?Q?hFq8JDP688CCDfow4GlSjJoYjCWbWShbv5m+4Lr1Iojyb5W3vSOHWdBtaaTO?=
 =?us-ascii?Q?A445dYyUzQtgWCGoDbmlDBlmOohCLaKUfBOvTj2uLQe1Ikzk5eDgqjbYCyKJ?=
 =?us-ascii?Q?AjT63sSifoANOyBb0fxn/2xZnMxP2y+fTjsYPUNlwxPyVW0YHL5WOZNHSKzS?=
 =?us-ascii?Q?CkVefcZFjuof6HKjio60ftcxL0fnbv/9Vs7XbIlAvS+JMQcOOXYHGxIek13s?=
 =?us-ascii?Q?enRadHUj9SnSRipk39ujUIwVp4lQc4HDgzvHozNrbOSUx+7acQa50CnTXo5b?=
 =?us-ascii?Q?ZtuvMKfZ7YtxjS9tgjKdjHS+SB0jmUDQ8OGPxvA4TiJBuK/78mtKAuSm4qrz?=
 =?us-ascii?Q?LZcdXaWbbRvUDH56MMeW0XEI3W8x2v9ORy3wnZfFGrYbU1KB7WJ9WfLIMxbJ?=
 =?us-ascii?Q?0MA0TOOMNkr9CysdGjSnjekPd9lDqWS81Rk37DfvQRTgogV+p4HWP/DmkmBE?=
 =?us-ascii?Q?XH9WnmSbPEsR8LzBboS5IL07L6uIhcuvrMKKIFhs5zpTA5PyOzmmNKMGzLQc?=
 =?us-ascii?Q?dggUjROLD5BcT+mEIBxV0+HldhYzXfo9fl+KOFalDYx1+VfpcHCovk6hwwsj?=
 =?us-ascii?Q?7qDrxRAYZajtwzONHavs2gEXFOCbU/bS1te+b4/RedYm1Nfrf7IApOJPg/9n?=
 =?us-ascii?Q?SzARhGjBNYxJ+Tq3nWWk/F8SknpFWzK9mLamuRH6pAL22b87Xtt9kNiOzSds?=
 =?us-ascii?Q?mmWiUDhokIUGcpZPiVqtzfyAWZcNd3oZiXv9RXuWfVnrD046qZSHat33Ry25?=
 =?us-ascii?Q?rzazvgDTeOHS3tas7l3VOfiRIHZAUcODNoh47Gpn4SwZIMbC9D2jJ/gdwXej?=
 =?us-ascii?Q?e1P8VgmB9tKvaCAS2duXCWw5qlFZlDNY/Pg0zwfBlgTffR8xLdLFTfGe/ICu?=
 =?us-ascii?Q?pJcVpZMVI7NNSyyFaH1SwiRZ8oOdMWKogkuMQN+ONghW9J5SCMWBWGjI8eYd?=
 =?us-ascii?Q?gbQ2SYB2gw/m2yYDxlVbkDPmj6rgCRpdLNgoQ151x9AYzQIoshoyUWnhrHKp?=
 =?us-ascii?Q?BXNRRGF0Jb08e4wCkI/dVCRpoVHw0LVhv4lXdzRRA3brYO4I0ZnO3vnRDqq5?=
 =?us-ascii?Q?84fgZAJJnHOw67O+xrzMulZt6yx09qDON0Aw6umV8kfSB8mO619QQhh0v78F?=
 =?us-ascii?Q?brH3vGqYaIKrooAQncsfnF6wtW++2SfQnMftdrzoupx1s7Xxppuci++p/+d5?=
 =?us-ascii?Q?EFZXqDYBJ/IBrMAjUHlCF+61rUoa?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2024 12:09:47.3953
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: bbe88be2-003a-4d26-2cc1-08dcb7a2ffb7
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000042AA.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4469

From: Penny Zheng <penny.zheng@arm.com>

VMAP is widely used in ALTERNATIVE feature to remap a range of memory
with new memory attributes. Since this is highly dependent on virtual
address translation, we choose to fold VMAP in MMU system.

In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
only support in MMU system on ARM architecture. And ALTERNATIVE now
depend on VMAP.

HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP as speculative
attacks are not possible on non MMU based systems (ie Cortex-R52, R82).
See https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability.

Split "https://patchwork.kernel.org/project/xen-devel/patch/20230626033443.2943270-16-Penny.Zheng@arm.com/"
into Arm specific

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Signed-off-by: Wei Chen <wei.chen@arm.com>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
Changes from :-

v1 - 1. HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP.
2. cpuerrata.c is not gated on HAS_VMAP.

 xen/arch/arm/Kconfig   | 7 ++++++-
 xen/arch/arm/setup.c   | 2 ++
 xen/include/xen/vmap.h | 2 ++
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 21d03d9f44..7d1dde89d7 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -12,7 +12,7 @@ config ARM_64
 config ARM
 	def_bool y
 	select FUNCTION_ALIGNMENT_4B
-	select HAS_ALTERNATIVE
+	select HAS_ALTERNATIVE if HAS_VMAP
 	select HAS_DEVICE_TREE
 	select HAS_PASSTHROUGH
 	select HAS_UBSAN
@@ -58,9 +58,13 @@ config PADDR_BITS
 	default 40 if ARM_PA_BITS_40
 	default 48 if ARM_64
 
+config HAS_VMAP
+	def_bool y
+
 config MMU
 	def_bool y
 	select HAS_PMAP
+	select HAS_VMAP
 
 source "arch/Kconfig"
 
@@ -171,6 +175,7 @@ config ARM_SSBD
 
 config HARDEN_BRANCH_PREDICTOR
 	bool "Harden the branch predictor against aliasing attacks" if EXPERT
+	depends on HAS_VMAP
 	default y
 	help
 	  Speculation attacks against some high-performance processors rely on
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index cb2c0a16b8..7f686d2cca 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -447,7 +447,9 @@ void asmlinkage __init start_xen(unsigned long boot_phys_offset,
      * It needs to be called after do_initcalls to be able to use
      * stop_machine (tasklets initialized via an initcall).
      */
+#ifdef CONFIG_HAS_ALTERNATIVE
     apply_alternatives_all();
+#endif
     enable_errata_workarounds();
     enable_cpu_features();
 
diff --git a/xen/include/xen/vmap.h b/xen/include/xen/vmap.h
index fdae37e950..4c7dfe58ba 100644
--- a/xen/include/xen/vmap.h
+++ b/xen/include/xen/vmap.h
@@ -141,7 +141,9 @@ void *arch_vmap_virt_end(void);
 /* Initialises the VMAP_DEFAULT virtual range */
 static inline void vm_init(void)
 {
+#ifdef CONFIG_MMU
     vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end());
+#endif
 }
 
 #endif /* __XEN_VMAP_H__ */
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 12:09:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 12:09:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773967.1184495 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc1xv-0001kW-9a; Thu, 08 Aug 2024 12:09:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773967.1184495; Thu, 08 Aug 2024 12:09:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc1xv-0001kJ-1l; Thu, 08 Aug 2024 12:09:59 +0000
Received: by outflank-mailman (input) for mailman id 773967;
 Thu, 08 Aug 2024 12:09: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=eqo7=PH=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sc1xu-0001Bl-3Z
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 12:09:58 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on20601.outbound.protection.outlook.com
 [2a01:111:f403:2417::601])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1f312d35-557f-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 14:09:55 +0200 (CEST)
Received: from BYAPR11CA0089.namprd11.prod.outlook.com (2603:10b6:a03:f4::30)
 by BY5PR12MB4305.namprd12.prod.outlook.com (2603:10b6:a03:213::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Thu, 8 Aug
 2024 12:09:52 +0000
Received: from CO1PEPF000042A7.namprd03.prod.outlook.com
 (2603:10b6:a03:f4:cafe::6f) by BYAPR11CA0089.outlook.office365.com
 (2603:10b6:a03:f4::30) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.29 via Frontend
 Transport; Thu, 8 Aug 2024 12:09:52 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1PEPF000042A7.mail.protection.outlook.com (10.167.243.36) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Thu, 8 Aug 2024 12:09:51 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 8 Aug
 2024 07:09:50 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 8 Aug
 2024 07:09:49 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Thu, 8 Aug 2024 07:09:48 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1f312d35-557f-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=i1KL6NZ9fVSt8GhNvSghW6Rv7MEJ6U6115eBdgd0QFs4r6K32r0LhliG2/lF2zVE/qlbgII0tvVj7CvtT9/273nTyuPpS85HD6uRrDdQ0ESmP5dMOw0scNfcsjhs8KBmRCvEsvr5pvpuHdagVpdQpszHrKF2pqfGsUzkP+PMZMo9q+zOoRSDZyvL6jq4xVNfkBK8kfA6jwW3M3TpfygrKMkzABkk9lzn/0u7KpeDzAxVDW9VL3dZHRAWS1p3b1xzXfIr7o420LIC53jXUPYduisUtqEZlUnG7aF9O5WKAIVLeCxmCwNzPGytOLUoppy4U7yvD8dGPwoDgOCe1xfbJQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=FHt71xPDWyVL/mL/ASV+Ga6PDc7Kh8iO9GgDEGgNhss=;
 b=aVeqsB+4XhSYIyy824UwXeeJ4hcagNPu48zsgzmH3gRabU5Sk+sbRL55ItB0AxQt7VKL4wWXflJBhy5tl+GUGE0Z6YS2D73Epn8J0eYTV4kZyzPHJODzJpQU2twVsVWdTT8RH8we8DuSsBPWspPKCdtGEQIni0mEoRhEoIPo3Jby4Mh8MpzghmrnBR2395vvloRtncU96yEFaqbKBXGbqMY9/uJWyHNQd9T5rHUPSwg7bi0Sb55WbniVDAyw5h1Engc/NzclyoNBKQWG+h8P2N3VFis/RmFcYc1gqP5ki3NnRCo5SO9CHEvLD/9PVpkSPQUQ1pEgGe3G4B8VRZxbYA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=FHt71xPDWyVL/mL/ASV+Ga6PDc7Kh8iO9GgDEGgNhss=;
 b=Vi+bGCENyadjN6beCPRe22RHprYzATs+7fD5mZlktJPB/Dl+2gPt+VAw6B/W8Q+oCDgMuPuh29G/IqHk/W8ulSRGEBxbvE2Padw3/B9AWoyZ0Y4JduB7sHLZxhy1oHPc8DUaCsCIMN2fpvKO+qWZ2jF6XDOmWDfbbNfoC1eWFN0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<Volodymyr_Babchuk@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v2 4/4] xen: arm: Enclose access to EL2 MMU specific registers under CONFIG_MMU
Date: Thu, 8 Aug 2024 13:09:36 +0100
Message-ID: <20240808120936.3299937-5-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
References: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000042A7:EE_|BY5PR12MB4305:EE_
X-MS-Office365-Filtering-Correlation-Id: 68d8ef76-460a-41db-5f86-08dcb7a301f4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?MI8MmMqeoVjtpEdvNxnlJ/tgHRZwZyB6P5hoFdvR2EAEBVSCZ22vCX7ovw3w?=
 =?us-ascii?Q?AVBOP0/47TSXx/97XXpFwJqjsOh/bv0sEqLSJ5N5n/zwUc0n4Uv3vM2Luyls?=
 =?us-ascii?Q?krctT2FCdt1zKry+s3tFKx8BjYjCEhxWFLwyA15OM56BojAuKYr97vOdwK7h?=
 =?us-ascii?Q?xVsECwtC+VafwCmeHbx/Z5r5ycHIz9wGz5Ngn4GCKnBuso6p+NhHUtrlQZFz?=
 =?us-ascii?Q?2eMPGX+nm0zXUjGhDWezP1cRz/fyNjrptl2amRuvNVeZ1ba2lhfDbqk0/jTf?=
 =?us-ascii?Q?hSLYzab0uakgZmIDiWSx/j0Gmcn6vkxX7aX20U5haJHCXevDAgbWUCRBqu7u?=
 =?us-ascii?Q?3IZOQt64u90jCxxYoUH7rvAdmNBkLGPifmWzwXWxf5EMk8RZG5ZBFE82xnIb?=
 =?us-ascii?Q?jVx/NdxOZ0p9uf3/CF3YocFxkjrDZ+yb5KJOvrH2cKq8c3Pbu14sHaNvNgOi?=
 =?us-ascii?Q?3YWgoC1+VHyxez6I2tOzX4rBKSbL/lD1LVSH6dBboWa6ETCOCQI6Ktev7LA+?=
 =?us-ascii?Q?PbOR2W07/8barXyHpKkEgdOOE0KYaFJOSLBOfhylIaL7QuzkiyqMqZw1xF3/?=
 =?us-ascii?Q?Uaz1DrfpE83RcRPZ+JjD6wWIVUGwo7G3GAQdcBKJuIXUzqH9Gz/J0EGHawi7?=
 =?us-ascii?Q?djm+CjToPUuESWN6Qj2K52K/AVR/4dHoOWqSxrFAzKXMo8y8dQDxxQp6gTwS?=
 =?us-ascii?Q?7Ey6XyUCiOGqfQ6g1RXWR5yExwPKhE6lT2X+zqRk2YjET9x4JYZelZh08p4S?=
 =?us-ascii?Q?PGJex6QhWxVJmPp2Sl1Sgm8eZs3F3lhzOragVikmLiV7BrVi6AaiuRJQFeLF?=
 =?us-ascii?Q?yQ01Cx+KQ21SjzdoUexTqURMAKsKESEbMNhBndPYqMkCR2zzY5vAh08hmTN7?=
 =?us-ascii?Q?6RAk8locP2PcIB6WCK3raEgeRQovDLyHxaNiG1bfEvjVsde8uzhE4qDXFI2M?=
 =?us-ascii?Q?b9VpgfJT4PpilbrTrPZ4GB9GDHG21Z9WE9XAr4JVFU0BNJD9On4C8t8suoq8?=
 =?us-ascii?Q?ucAlvb1t5z2RMkbICX7hDMnh29ZqL2ZaX/bdUz5uknxOyasmsuwjax25xoOh?=
 =?us-ascii?Q?AZAXOGPWE+8NAwutW9IbabrmQ7p1NZYAdohxYtJPDt3CRHY0AwntQJDpjE/i?=
 =?us-ascii?Q?ilLJxvoIIJhvlSbBsYUiupkwC98qun4Vfty6mCZ5nJP1zMdnTbd3l0Jdg/v9?=
 =?us-ascii?Q?0BaQAPnGFSj4RA2o6QIB1alszCO/SZpV5KQ1TXaJA3bWQqRLGajBwfGCDsDX?=
 =?us-ascii?Q?oQnu+hFed35HbMKT81DkTFn5pi2bMPMyWY6xMcodBWi4AevbxoSOkFu5/18R?=
 =?us-ascii?Q?YwWhZERGuDVP0fo64/mvCrv128iEsvtkLoNS/HTL5tK6/rogSdLZGDRO45cC?=
 =?us-ascii?Q?4o+b/5jkF4VWnbBZ9LFEWdZfJia1dYY40xrRBMmq8TiuX5y1JOcQ+bVXKPnP?=
 =?us-ascii?Q?y5V19O0/vpVhpLQSTnay6C5yEEMP8BrK?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2024 12:09:51.8237
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 68d8ef76-460a-41db-5f86-08dcb7a301f4
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000042A7.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4305

All the EL2 MMU specific registers are enclosed within CONFIG_MMU.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
Changes from v1 :-
1. 'vttbr_el2' field is enclosed with ifdef.
2. No movement of code.

 xen/arch/arm/traps.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index aac6c599f8..f51e1424cb 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -720,8 +720,10 @@ struct reg_ctxt {
     uint32_t ifsr32_el2;
 #endif
 
+#ifdef CONFIG_MMU
     /* Hypervisor-side state */
     uint64_t vttbr_el2;
+#endif
 };
 
 static const char *mode_string(register_t cpsr)
@@ -919,12 +921,16 @@ static void _show_registers(const struct cpu_user_regs *regs,
 #endif
     }
     printk("  VTCR_EL2: %"PRIregister"\n", READ_SYSREG(VTCR_EL2));
+#ifdef CONFIG_MMU
     printk(" VTTBR_EL2: %016"PRIx64"\n", ctxt->vttbr_el2);
+#endif
     printk("\n");
 
     printk(" SCTLR_EL2: %"PRIregister"\n", READ_SYSREG(SCTLR_EL2));
     printk("   HCR_EL2: %"PRIregister"\n", READ_SYSREG(HCR_EL2));
+#ifdef CONFIG_MMU
     printk(" TTBR0_EL2: %016"PRIx64"\n", READ_SYSREG64(TTBR0_EL2));
+#endif
     printk("\n");
     printk("   ESR_EL2: %"PRIregister"\n", regs->hsr);
     printk(" HPFAR_EL2: %"PRIregister"\n", READ_SYSREG(HPFAR_EL2));
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 12:09:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 12:09:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773966.1184489 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc1xu-0001gx-SA; Thu, 08 Aug 2024 12:09:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773966.1184489; Thu, 08 Aug 2024 12:09:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc1xu-0001gq-OU; Thu, 08 Aug 2024 12:09:58 +0000
Received: by outflank-mailman (input) for mailman id 773966;
 Thu, 08 Aug 2024 12:09: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=eqo7=PH=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sc1xt-0001Bl-3D
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 12:09:57 +0000
Received: from NAM02-DM3-obe.outbound.protection.outlook.com
 (mail-dm3nam02on20601.outbound.protection.outlook.com
 [2a01:111:f403:2405::601])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1f0f21f8-557f-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 14:09:55 +0200 (CEST)
Received: from BL1PR13CA0282.namprd13.prod.outlook.com (2603:10b6:208:2bc::17)
 by PH7PR12MB7985.namprd12.prod.outlook.com (2603:10b6:510:27b::5)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.27; Thu, 8 Aug
 2024 12:09:48 +0000
Received: from BL6PEPF0001AB51.namprd04.prod.outlook.com
 (2603:10b6:208:2bc:cafe::1) by BL1PR13CA0282.outlook.office365.com
 (2603:10b6:208:2bc::17) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.13 via Frontend
 Transport; Thu, 8 Aug 2024 12:09:48 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BL6PEPF0001AB51.mail.protection.outlook.com (10.167.242.75) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Thu, 8 Aug 2024 12:09:47 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 8 Aug
 2024 07:09:47 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 8 Aug
 2024 07:09:47 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Thu, 8 Aug 2024 07:09:46 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1f0f21f8-557f-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=pZZRdCi4muUTZhwkG2es7OnvTAAHLJND9rynbE7D4ZYBYWQqRZ1hVUpekEkIi3tRQXaYuGEqv9SY2U7ycffzMuf/2VOiSkqn7HOlNLoKkRjuV9dnTwr4SxoDKNDUavr1fAinwp048Y4bdBuarEIm64q2seCzMVTGuqsn6KtGSiShakDNoUthUPFBNrUe1fDCw8Z75J+p1c0LN9SNIAf8ckFdv2tJGclHfk5s9wPDv/qWfht9VRfdmM2Xe+bXIw+vl54cGEjzO207Dq6JWVgREG3pdajMEMh8ZXDc18aXietdzChOsJm0WJ0i581NdTBNbNXWyWLbtov+yjx4/QBkWQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=oonAN7b47urGvxo0xGpm8NNdDhrVQquVh/ZJyCDFHG4=;
 b=xTzpZtqAzool9+1kC7xASqEM0PuY2R3FK/UaV3RmzZV8mk4h9l8mJe/coygDYD3qQ/uVDjJf2SnuMqS3j1KcJ2UeRdaKJmj8Dq2dWT7ek4pPj02ak+gRPsLEoe8OWbvoLxBkadmBZt+N1vnMgbE5++btRKkmUMsr9tNRTycQmqw7guzIbgae2j0coqzQXaWhxJOg6qRFvdV2I8Jfm2VzsdOpBu2i3xjpaLFhQalQ16AiREE5g3BUW60vMaPjRQZpxQPsdTvDUUUfzbgGwFjaqSdkDkd0rx0NxPIMK6jg+8sjF7xP2kl/oe8bGbNcgpT1EWCNs0NuKNS6ByAVcqneeQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=oonAN7b47urGvxo0xGpm8NNdDhrVQquVh/ZJyCDFHG4=;
 b=SKm0f1uYVz5X373p+QXIw48wt7xY3DwXIlce8npf0goODYqJCavwa78yKo4/Z1GlZSH+mcTuFXVYTOJr4drwrnPP5yNze1bLLeMBmG1gJVXBj7iT5qF2JN8SJUNSSqOe+1AH1eI1gXMlsmfFim0CmXVu2a3x7AbJnI9vqhhpkKA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<Volodymyr_Babchuk@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v2 3/4] xen: arm: Moved domain_page.c to MMU specific
Date: Thu, 8 Aug 2024 13:09:35 +0100
Message-ID: <20240808120936.3299937-4-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
References: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB51:EE_|PH7PR12MB7985:EE_
X-MS-Office365-Filtering-Correlation-Id: c6608c8f-ae3a-4c6e-06ee-08dcb7a2ff9c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|376014|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?KXMr/2+dM8ES9zbqQ9Sg8BH2ZuZmJ2XG0cCwQ3zx4Lc2Rhu5PvZz6ivLYRMK?=
 =?us-ascii?Q?x6Z6uu1q2FRBuNTta6bSg45u7vxGrs9l9gzm0c0U3/WeGUnBGH58jr/vEQ0i?=
 =?us-ascii?Q?01QX5DaX6Vq/oLhVd9+TVUoHf0tCPRK6rQzRct27o8Uaboh/HddOjazKItPj?=
 =?us-ascii?Q?HKEmkOPqLcvoGPOfT8LgbmQ7zacSWlk7hS5lbVXGzh6PtHHAyulFUWnpiBYY?=
 =?us-ascii?Q?KOkHFGMsLrRtwbjrUqo0hssq8yiWRQWVDVXzzrdhXG5wpVHQ3r9MxQBJ1Mhz?=
 =?us-ascii?Q?S14wDE2ZeZBk+5EK7zXQjpktWmIxlcniBytgshqoiOU5aIm7MEfLZIQVD31K?=
 =?us-ascii?Q?YkQGAg3hbvqn2v8/21TEvGDBmhuCivHcqBI4S5a/c+XUnVWhiR9YyPj1xPJ9?=
 =?us-ascii?Q?8b7fiMgYNDIT4DCuMzohHWyojqDs53Vfjz6xieRdZgje2mmzzRJLuPuH/GYF?=
 =?us-ascii?Q?5xE1mdDJpsOlvli9DOd2nGIsN049vrlRb4Gx8bdCdHfEQJ8kcfnP6CQX8853?=
 =?us-ascii?Q?nu5Zzs8bU8wwk4vH2gMyeqgkQH2dS5qZ3NGjvoFGRG5xo0kCcGg/L21MxYhS?=
 =?us-ascii?Q?WMWmsnBTVeH9honw8aN1urORIUm+UsBs7lbp6aP5zKJsQ0pBKsBtdWXTENJ5?=
 =?us-ascii?Q?ywpKE5luHRSBFTJ3pDa4uV/NhMtOE0QhywN8b2UyBRn0bHtYZIhJOdZNyt8j?=
 =?us-ascii?Q?CB9X04TNZrTB2ub3T1XC0/WD2tWnqhbpkDl3VRO9EhUowzeFnaK3qiRHJB3I?=
 =?us-ascii?Q?yPn/HXjGOm7TgR6CB2qtQXKHxd+SbsyjKB2EJTShZReRyZNdu8TaxCGWe6AM?=
 =?us-ascii?Q?Xu//y35WYBPc4l7v0qn1zYvQG/6Y9lMgcy36h2I98sNd697gf+yZDg6zXHtr?=
 =?us-ascii?Q?hWLrZKwX9XTbqRDxU4WRhAJDVgom/0IWPLkTK06JKPLu5SgCXS0tClwG+xq5?=
 =?us-ascii?Q?jDqg04YEw8p+JacvhHaXvEJdwP9b2tvL66ZkUEDY3ExEzwD4XfKgSHATn/1R?=
 =?us-ascii?Q?lop+0dOwArUTnfo56xOnoVLnTiWqcMuhQzvne7f7+sB/wwSh3jonBOKhloiy?=
 =?us-ascii?Q?mTHy/kU+/AzpJG5X5k7yC4Jk2rfVmIX4xoS0Da/bPc1h/zgGG9i+IaVNqsqS?=
 =?us-ascii?Q?ddu6bxeYznpzpDCPG13mH6lbWYpeBxCSI0A3jey23J882HvODJXRoqj4mJkr?=
 =?us-ascii?Q?IJ1vy1Gf7W0XE4iKSrfGwpwJQO7HilLDLUA33MVSHU2VGnIwq/61CCDqkAEy?=
 =?us-ascii?Q?bwt1ycaTUmWEnCZub1N0OYh6x1IafwDV0PCMu2OoCKys+5g7amqs50SbeS9s?=
 =?us-ascii?Q?SrTMA8p1K9LjTWbA6mykFMXLI6UsdmvLNAKdI0yoL2OwCSIymv892p+NjOej?=
 =?us-ascii?Q?SR5blKf8JnOAOhCfl0ecmYZzSXqXoe7Jhg9nJoukRVzgk7/+IjNjHso6bRZA?=
 =?us-ascii?Q?xOqckEf/iHbecRkqrlWJxZSqBQgdHkja?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(376014)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2024 12:09:47.9986
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: c6608c8f-ae3a-4c6e-06ee-08dcb7a2ff9c
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL6PEPF0001AB51.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7985

domain_page.c has been moved to mmu/domain_page.c. The reason
being this file implements MMU specific logic for mapping,
unmapping, etc domain page.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
 xen/arch/arm/mmu/Makefile            | 1 +
 xen/arch/arm/{ => mmu}/domain_page.c | 0
 2 files changed, 1 insertion(+)
 rename xen/arch/arm/{ => mmu}/domain_page.c (100%)

diff --git a/xen/arch/arm/mmu/Makefile b/xen/arch/arm/mmu/Makefile
index 67475fcd80..2cb44b857d 100644
--- a/xen/arch/arm/mmu/Makefile
+++ b/xen/arch/arm/mmu/Makefile
@@ -2,3 +2,4 @@ obj-y += p2m.o
 obj-y += pt.o
 obj-y += setup.o
 obj-y += smpboot.o
+obj-$(CONFIG_ARCH_MAP_DOMAIN_PAGE) += domain_page.o
diff --git a/xen/arch/arm/domain_page.c b/xen/arch/arm/mmu/domain_page.c
similarity index 100%
rename from xen/arch/arm/domain_page.c
rename to xen/arch/arm/mmu/domain_page.c
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 12:09:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 12:09:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773964.1184468 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc1xq-0001By-9E; Thu, 08 Aug 2024 12:09:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773964.1184468; Thu, 08 Aug 2024 12:09:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc1xq-0001Br-6X; Thu, 08 Aug 2024 12:09:54 +0000
Received: by outflank-mailman (input) for mailman id 773964;
 Thu, 08 Aug 2024 12:09:52 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eqo7=PH=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sc1xo-0001Bl-SM
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 12:09:52 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20600.outbound.protection.outlook.com
 [2a01:111:f403:2416::600])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1c06f671-557f-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 14:09:50 +0200 (CEST)
Received: from BN0PR07CA0010.namprd07.prod.outlook.com (2603:10b6:408:141::10)
 by PH7PR12MB7820.namprd12.prod.outlook.com (2603:10b6:510:268::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.13; Thu, 8 Aug
 2024 12:09:43 +0000
Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com
 (2603:10b6:408:141:cafe::e8) by BN0PR07CA0010.outlook.office365.com
 (2603:10b6:408:141::10) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.14 via Frontend
 Transport; Thu, 8 Aug 2024 12:09:43 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Thu, 8 Aug 2024 12:09:43 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 8 Aug
 2024 07:09:41 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 8 Aug
 2024 07:09:41 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Thu, 8 Aug 2024 07:09:40 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1c06f671-557f-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=UbzHsrSLf1V4pze56S6llFmcRDYBxoDMHp8IFVQPPKpulBOHDD8AKiZ5rLvkixMtuWdpTBiMDXHII/ZNYI9fcrM9MJrOGw8W103VpcsLez54wryrkVtb81RKH+3Svbu2vaqtgYh2YoQ1mOFiZLYuBhegG1m4Ss5AFg/T9ICVN9cLXxulPwGplrMB9Ke/i6svfu8PsrYW1eEmb2Scsse8GvLY/tb1o8fVdtj6zNv1O6fvd7nWyGWcD49I0C1ZnMDZUpf3Yzxqs20Fpw9lxLs2PhnQ8lTAS2h8qjifa2Ri+ekuwzlcxJilsiHaN8/yAv0nnT3nmMRY7b3M0jKqRULpHg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yV7NyhtbmiM4x5V4/xuEj04uj/rKjST5nQ5idUZLBpg=;
 b=rwHA4MdnHpU4sRdbgYILODvv6+ufcddyeSbHkgOs0RM9RVIK3CuNcqFUyp10qrTjvyWi/7fZ2Vn3d2P8w3NDP6mfKLsh8C6Lt4/z4kWxYwIIiQsfvM/CaybGY4iyDYZccEig+fIP+8tNRZJ3SHbR/aG3amOHUTNaBgXgkjYk/DDswsdKOI8KQoMYkrk6igOQz77q+v9Py4Blnztr6Nysup3qi75OOCdkKudRFQOsOLnGoqC7Bz7FeShVDQO0gbo2q1RncqXGxgCLOgH/4Vp0S9h5tQMj5wpuk/nr8/2jAwv+IlG1UaTD7H16Y1dT8uBARzX6r7R1It/4xSoUPmgrSg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yV7NyhtbmiM4x5V4/xuEj04uj/rKjST5nQ5idUZLBpg=;
 b=J4W0HZs4wYvxw7wivyDvlog12yVK3Ogf69XjE7Mg9YyrxQY/JgS0vcAltSqA6qonYjywoDG4v0yPSbieZXIwr01AJT6cTuxhr3WLPhe7banTIlvhRDe0e/KqeEqUOdjgAQVqyoyCkmoluAxlCKqLhU8V4YUfeH9cO1P1rHjePjk=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<Volodymyr_Babchuk@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v2 0/4] xen: arm: Split MMU code in preparation for MPU work (part 2)
Date: Thu, 8 Aug 2024 13:09:32 +0100
Message-ID: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4B:EE_|PH7PR12MB7820:EE_
X-MS-Office365-Filtering-Correlation-Id: b5b0d8bc-3ed7-401a-7443-08dcb7a2fcba
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?C9XlKGkxrCu/5s8GfTnFoGAKXdGPynqGrU/bOeldXtvPvOysUP6g+TMzBmDb?=
 =?us-ascii?Q?CysOHdgYhfNUSzq4UHxHkHpOIP7YlKjYOULCoGlT87JfET6t+C5bw0OeWKLy?=
 =?us-ascii?Q?IgH+9QivnC0EKzloPZ1OJFZNCp3O5Om3tQJ4Yriv+EA7oUoaoelqltLUynOr?=
 =?us-ascii?Q?eluyy/bA9Vw0PnMGMO06waaEU8RBlqz5q5YHJBqv6ynDI3Vnz+Hlrtg7586B?=
 =?us-ascii?Q?yQfjRBmrAAvnWEAveH6OzwNOMFydLYRRo2vcKIrZ4Vx4/pwbrg8fv6LmJ3tF?=
 =?us-ascii?Q?ObSbjAuTSqmtfWviY/s68HW5lgooqrX5nqRS1EHrd+FdWu2cxac2HOJLGE5T?=
 =?us-ascii?Q?sO3b2OBhTXBG6QNLuX/LeeMx8C+l7WrR/1ebA0s05/od/cpE4hFgWMfcJI1Q?=
 =?us-ascii?Q?PAgNHSHZLAIhxop6TJmeo7Dyk+cirr08Gr+dnE/KrLso81zNCVpll110htYb?=
 =?us-ascii?Q?A6jd8RJ8ShHVdAWK5meg4kc+mKX1oEu7Uc0u4PSvPW7ERlqZPAMieS0XIo6R?=
 =?us-ascii?Q?mRraKzSnU5QQOG56UUfMV2pTg4kRiM2wGLQetMiVPNQnVxakU8Re3RoRwrPd?=
 =?us-ascii?Q?kmLJa8puCWOPKaFf+VI9anERddr6CHln41/OvMYLOKdzf+ylMlfrAntiKo29?=
 =?us-ascii?Q?Hv9fDZmvFrNeopd2Tar3qMaS49E2OJ8PNegzC79jnmwWP6HMpikWO31MNk2x?=
 =?us-ascii?Q?YWAwawkEUqtOnhBvS8KkcpTUobMGwWgmyjrXLSdO8I6gmwc9BTJLNpijwg5P?=
 =?us-ascii?Q?pITG5Eq9cnCpRaeRIi6BzuvdRE6Ahg5//GrSRK7tqJKH0bWrgWhBISm6APlG?=
 =?us-ascii?Q?UjH/uD1qAcDVgQwJocoQrtQZAIGNbdmPoABCnwi1bz0HdfmIfVtLUch+5uUI?=
 =?us-ascii?Q?fnNNe9WMjdJTeEbkmWjS8MC1AZ8xq9GGAwNz6aGBvcy9fLSGo3ChF2i/B0wy?=
 =?us-ascii?Q?Qx418mjW03YKH+544DTAJo3XLP5Qgwg71ZoV569wgRUYAYM/YSCSl7Qy+yn0?=
 =?us-ascii?Q?EPsWD4mtztas1+JOb+wb0jaEnmy0rj25v36o7bkfPY9QHCyNSLk1AqvlZXSX?=
 =?us-ascii?Q?qER8YHY3Yq2ZdsDe/MaW7MG3wqhZP37Wdf4CbnmPQvCrgIL7Q9kGhonQ+Upn?=
 =?us-ascii?Q?wqk0nkssiyJqB30ttYWH2XejBzHOqPcZGKM6bkwXcHewvXmZL+8LvQQa386y?=
 =?us-ascii?Q?t6yA5pLJaTc/fiwxCJijJjmg1vTcSDYlDtp9rxuokrRmqbhPYbdQjvtVWMWT?=
 =?us-ascii?Q?OJadlfCop2XaK39AVdQbEHoXGKi7BrL2eDW11Asr0U3QQwwLRZ3C/z+pmbSo?=
 =?us-ascii?Q?kPwy9OrD2HrTYbmveQQhw9o8MvyGpsMSbW1h5qAQV88Z6mfIqzzGGE/RldMC?=
 =?us-ascii?Q?IjNijYoKeAcUxt3Kx35JrLWVXpTi?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2024 12:09:43.1805
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b5b0d8bc-3ed7-401a-7443-08dcb7a2fcba
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL6PEPF0001AB4B.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7820

Hi,

In https://patchew.org/Xen/20231116145032.1651305-1-Henry.Wang@arm.com/, Henry has
reorganized some of the code between the MMU specific and generic files.

In this patch serie, we address the remaining code reorg so that MMU specific
code is cleanly separated and we have added stubs wherever necessary to avoid
introducing if-def.

Ayan Kumar Halder (4):
  xen: arm: Add a new helper update_boot_mapping()
  xen: arm: make VMAP only support in MMU system
  xen: arm: Move the functions of domain_page to MMU specific
  xen: arm: Enclose access to EL2 MMU specific registers under
    CONFIG_MMU

 xen/arch/arm/Kconfig                 | 7 ++++++-
 xen/arch/arm/arm64/mmu/mm.c          | 5 +++++
 xen/arch/arm/arm64/smpboot.c         | 6 +++---
 xen/arch/arm/include/asm/mm.h        | 2 ++
 xen/arch/arm/mmu/Makefile            | 1 +
 xen/arch/arm/{ => mmu}/domain_page.c | 0
 xen/arch/arm/setup.c                 | 2 ++
 xen/arch/arm/traps.c                 | 6 ++++++
 xen/include/xen/vmap.h               | 2 ++
 9 files changed, 27 insertions(+), 4 deletions(-)
 rename xen/arch/arm/{ => mmu}/domain_page.c (100%)

-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 12:10:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 12:10:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.773968.1184510 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc1xw-0002AR-FP; Thu, 08 Aug 2024 12:10:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 773968.1184510; Thu, 08 Aug 2024 12:10:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc1xw-00029e-9R; Thu, 08 Aug 2024 12:10:00 +0000
Received: by outflank-mailman (input) for mailman id 773968;
 Thu, 08 Aug 2024 12:09: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=eqo7=PH=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sc1xv-0001oM-K1
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 12:09:59 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on20617.outbound.protection.outlook.com
 [2a01:111:f403:2412::617])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1f2c40e6-557f-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 14:09:58 +0200 (CEST)
Received: from BL1PR13CA0274.namprd13.prod.outlook.com (2603:10b6:208:2bc::9)
 by DS0PR12MB9346.namprd12.prod.outlook.com (2603:10b6:8:1be::15) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.14; Thu, 8 Aug
 2024 12:09:51 +0000
Received: from BL6PEPF0001AB51.namprd04.prod.outlook.com
 (2603:10b6:208:2bc:cafe::2c) by BL1PR13CA0274.outlook.office365.com
 (2603:10b6:208:2bc::9) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.14 via Frontend
 Transport; Thu, 8 Aug 2024 12:09:51 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BL6PEPF0001AB51.mail.protection.outlook.com (10.167.242.75) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Thu, 8 Aug 2024 12:09:51 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 8 Aug
 2024 07:09:50 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 8 Aug
 2024 07:09:43 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Thu, 8 Aug 2024 07:09:42 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1f2c40e6-557f-11ef-bc04-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=eMlQP4+y2FrFx9H4bhyS2a6nkR262E4IcYDsLvcYEwjgRym92KV4cyS+nhW0+PPNRLA4nSeWU1ohHEOOPvQPmg7K6yBcm9aAvblosMZd64VDqkVLmA2s1tfvVYbM1QHKhMfnJYdccIrJBBhymPm2R40qJyXhG6DMmnEhICnswULWxyElQFbjq5e9uN9MhUEPiFeghhyQojJRZ15sw88Z3cvw4c1tDHSytCwg84u8TTrGJfvF/1d9a6yGKSud7XXBRBkU058UUPhY/s/xBlfs6fSCoDODHSzz9vlptvMVKK9KXqVyG1850TRaBrXp6DfkWV/U04b6ZgWXU3VcMnz0TA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ifeqpzTG7mgd8CW0d8omyR5cvab2skN6+VC4y+ldVDE=;
 b=Yp6FTioob0DIU9V56uPrkKk9bpej9Yhvf2vHElIYWVUsiNo11bcQZlTazBIX85Pi3jEoLp30AFLEW9sgVori9TvYgw7QgIjnDq+1XtupeSswLIFrjNHKAS0xDOG3oeZzetxL6aKf75eqml8j4csO2vrE9OQFaRbyHieQ1KyuOQvq2enTqaJVs4v+u8MKSEwX37z8AzJnS/P4JjtDKx0IQdCaJ6rZV9gSbzEpmQsrxbEtcJgmIxRAwSklh3/hMzzbPlGoZtX8+/Do4M6lbEQGH12L2jf6E7PvG2zJjdenmoi4pZ9a2kw4iiwpQ993CMUdexV1zO0ocio7iCMn80nclg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ifeqpzTG7mgd8CW0d8omyR5cvab2skN6+VC4y+ldVDE=;
 b=ZHpW0KBDGLfxOl1gkKYcfHyc0vPUphc7ulVK8iCq1iPjCtQ+OuiVmsp6pnDHjYRG+NPmyw5a99LxtCUCCvF4p1G8kB0w0ReWRf8PwE/qLEf83eJuflW5l3A6yP8YNCUqgXpRkRGiF76hIWQyC8m2rWijnJ5+cVKkmCellzccgcI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<Volodymyr_Babchuk@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v2 1/4] xen: arm: Add a new helper update_boot_mapping()
Date: Thu, 8 Aug 2024 13:09:33 +0100
Message-ID: <20240808120936.3299937-2-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
References: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB51:EE_|DS0PR12MB9346:EE_
X-MS-Office365-Filtering-Correlation-Id: ba38611a-041f-4eda-b6a3-08dcb7a30190
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?iMFINjeaRhphnzIhdQ8+XbUmpPzE8dHzYcTwRERtE1wuA/qlYjtX4e+poJSM?=
 =?us-ascii?Q?CCVwnmA7JXiVb5mIiiVOYJnMqGs59k9EXi+Sq/3hrNqmfX08TkTh2o01iWRQ?=
 =?us-ascii?Q?M2YqrURrPpe4EUWB0bFN5Xhkpbo911LQCogrXzx4c8/WVvdiwMWp33/wAkOg?=
 =?us-ascii?Q?Iiq+bNXFKHcmpJ/vHSc8Wgggm9FB7nOyL/0JEownpHRrDg5SsL2C0rNWEFCR?=
 =?us-ascii?Q?tcLaBaenCj5LW4Xy27WmS4tqewoklgynw6fvgar6j5RNdazwSzdoSIcyGVIv?=
 =?us-ascii?Q?kLsletkW8rwYInyoZ9HOniO9+ZZLuQ4Mg8z85DjFIMxhq3yq0+0IMPFCIPn1?=
 =?us-ascii?Q?E0GEYyArgOBO5guYQCSfUs6SlW5ZTFs815zQr2ey+48cp5Oa4WRH+NRiKgpr?=
 =?us-ascii?Q?pTIazFF8k/p98S20eFKW8vAzUG4j4CCWPEw0MuHk7GpWQcjmfM1Xw95kDLZs?=
 =?us-ascii?Q?HF0n4j14zIJD82g7VE65FAn03ORy2vhERYraTCDa8kmlTpK1PR1TohZ/yFbl?=
 =?us-ascii?Q?oTUMpPnx99NpLyGY7SoruE/aH/A3DMg1IBgqt98nJoyAM4qJCxRk7IU3n6S8?=
 =?us-ascii?Q?/ir2nnEMOx6koYrYhgFH0GNY6iHhh0E60WceaYX6uol4QmaHqWOdh2SS256N?=
 =?us-ascii?Q?PfLapAlQhsZQfvIjvjrpPv5tW2jOfxVbhTp1+Ih2AlKnahlp+pJRerrK5yeJ?=
 =?us-ascii?Q?fDf1FPFJ3O3EDPTbOphhbE6XKZPAECnXHxglZYkRDkBYgycyUYSyUXQIO2cC?=
 =?us-ascii?Q?9/K0KL7xYU088TZRseIsQyry9VNrq7o4HnQtOk2MRLQ8NGO+w04H47Wam8AP?=
 =?us-ascii?Q?o49UQF24E9zUkPaSi2nQLbz4s2BRXZf8LzWSXMP68hQa7ivQq8DfMid4VbhY?=
 =?us-ascii?Q?/1QpPaKN9+z2mTXVa7LK1iO+FUd/J+LtK55h3DXZwO9KAn8kZGQK8cnBjyYs?=
 =?us-ascii?Q?QWeqxi72GpyV9fZ7jYieo4Tot38/1sHCLmeXxBeX3gI9nfwDm5loPVO0fDHX?=
 =?us-ascii?Q?u0n1+CfrTaTIVMPBa8c8e0k1Bd2taHxvL6H10CvHsUfb6jiPHWVbnyRlngFs?=
 =?us-ascii?Q?8oYsV4oO6YIlaQE7muyZ/OibDV9QIGPXa+wjBffnwLqMOWQdNUVrtgEHzBIQ?=
 =?us-ascii?Q?/06KS1u/acFzr1eh5Tqwj7nsRMOLqgrHthtcjM3r1/ufkpcN3nMOFGn/CsSD?=
 =?us-ascii?Q?V7tVjtyrNtYaNXhSp36s2Ydt8tOHQY0CEXxatPEVkjDP9DCxsd8szcwd4kM7?=
 =?us-ascii?Q?vyq3r8rcBlPdljcBIXJgYRhsHpKxnQY/yQIHPMitkQaw9AP1aKqQ3/tMIbTF?=
 =?us-ascii?Q?4sakFYtmZoniEPOZQPkG8gvmmey1MtC2tv6c7gaQfmmi3B+OY8Imwn1tno41?=
 =?us-ascii?Q?WgrpGV5xJ/qTgfvKOSrRmRZft4MkBCj/7oyYfluDh+je5OWZdPIbQ2EW9JN6?=
 =?us-ascii?Q?CozlBzp3IG+Cr/gd8zIRUgcjNS3Q/J6B?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2024 12:09:51.2956
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ba38611a-041f-4eda-b6a3-08dcb7a30190
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL6PEPF0001AB51.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9346

update_boot_mapping() invokes update_identity_mapping() for the MMU specific
code.
Later when the MPU code is added, update_boot_mapping() would invoke the
equivalent.

The common code now invokes update_boot_mapping() instead of
update_identity_mapping(). So, that there is clear abstraction between the
common and MMU/MPU specific logic.

This is in continuation to commit
f661a20aa880: "Extract MMU-specific MM code".

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
Changes from :-

v1 - 1. Introduced update_boot_mapping() which invokes
update_identity_mapping() in MMU specific code.

 xen/arch/arm/arm64/mmu/mm.c   | 5 +++++
 xen/arch/arm/arm64/smpboot.c  | 6 +++---
 xen/arch/arm/include/asm/mm.h | 2 ++
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/arm64/mmu/mm.c b/xen/arch/arm/arm64/mmu/mm.c
index 293acb67e0..72e089a339 100644
--- a/xen/arch/arm/arm64/mmu/mm.c
+++ b/xen/arch/arm/arm64/mmu/mm.c
@@ -125,6 +125,11 @@ void update_identity_mapping(bool enable)
     BUG_ON(rc);
 }
 
+void update_boot_mapping(bool enable)
+{
+    update_identity_mapping(enable);
+}
+
 extern void switch_ttbr_id(uint64_t ttbr);
 
 typedef void (switch_ttbr_fn)(uint64_t ttbr);
diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
index a225fae64d..789f352ab6 100644
--- a/xen/arch/arm/arm64/smpboot.c
+++ b/xen/arch/arm/arm64/smpboot.c
@@ -112,18 +112,18 @@ int arch_cpu_up(int cpu)
     if ( !smp_enable_ops[cpu].prepare_cpu )
         return -ENODEV;
 
-    update_identity_mapping(true);
+    update_boot_mapping(true);
 
     rc = smp_enable_ops[cpu].prepare_cpu(cpu);
     if ( rc )
-        update_identity_mapping(false);
+        update_boot_mapping(false);
 
     return rc;
 }
 
 void arch_cpu_up_finish(void)
 {
-    update_identity_mapping(false);
+    update_boot_mapping(false);
 }
 
 /*
diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index f6ba611f01..e769d2d3b3 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -426,6 +426,8 @@ static inline void page_set_xenheap_gfn(struct page_info *p, gfn_t gfn)
     } while ( (y = cmpxchg(&p->u.inuse.type_info, x, nx)) != x );
 }
 
+void update_boot_mapping(bool enable);
+
 #endif /*  __ARCH_ARM_MM__ */
 /*
  * Local variables:
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 12:38:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 12:38:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774011.1184518 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc2PH-0000Zn-PJ; Thu, 08 Aug 2024 12:38:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774011.1184518; Thu, 08 Aug 2024 12:38:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc2PH-0000Zg-Ma; Thu, 08 Aug 2024 12:38:15 +0000
Received: by outflank-mailman (input) for mailman id 774011;
 Thu, 08 Aug 2024 12:38:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/QhG=PH=cloud.com=kelly.choi@srs-se1.protection.inumbo.net>)
 id 1sc2PG-0000ZV-AY
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 12:38:14 +0000
Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com
 [2a00:1450:4864:20::52f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 13a470f8-5583-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 14:38:13 +0200 (CEST)
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5a309d1a788so916782a12.3
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 05:38:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 13a470f8-5583-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723120692; x=1723725492; darn=lists.xenproject.org;
        h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject
         :date:message-id:reply-to;
        bh=55XU62OwrbRE56FeEwBbVUODmHZOLnWUZZQcJPhxs/g=;
        b=TjzMcu0FPYwZ3admPkEgaiyo+7MJz1MojbhBVkE9g4tYGkb/zk4cJ/rf74G/nivTtd
         6Es4LLIkuNgulA3ntWRDTb7pm5xo/ONGcoCoo9KGnk3vTwnNE62QACHBsbNjV1yUJMEC
         fyWnHXZj8Zk3U6w+j0gmGQE7agIXXDVI1QxGM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723120692; x=1723725492;
        h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=55XU62OwrbRE56FeEwBbVUODmHZOLnWUZZQcJPhxs/g=;
        b=j0kMJrtnA2W2ddEadcQp5W0Rd7h2uyWAQjn2vEbnMLrmcf7I4SMZ5UfI6eqAlkpt8b
         AhAUAhd9Pa4USPIpcxfcCz7XtQ6pXkLNvGg6t5iLdB587Nd4KvUUloh12yWYzcEK2VHJ
         UmBqjD3BYdYtIHQXyhOq0N96yoY8k63wyVCptAXMgexBjMl0nKsYbyNxG+XHKR6eQ/Bd
         LB2lR5N3q61ZUGRL/5fNV8rMU1Uz6tCmNXKyIowQSnIGLqLXQVlPBN+8viW1lDTs6C0w
         SkxpdqvSG0ljOw+SitMLKp2R1WLRuFqpBfi3wvdVlKlkvJ9X7ACl9/9EwFEO9Go19fH/
         nfaw==
X-Gm-Message-State: AOJu0YzlUVMbotdRgRXV7h3vf+nOfpGao9oJgyBhZQVYmOQxlZWffZbI
	otgCZ2CZzBbJBIatSdOU/Aui+B7W9IybIOZR8U783FqeDfwUczPs2M+6Rd4fQXPbj6WacGN6omU
	Hw9A2eveOymYSBNL4UJ0IeSjXTHfY4egchHKwF6AewHUdeLv+S8wgZA==
X-Google-Smtp-Source: AGHT+IEF0yHfD/OfNb/iEL++ru35DvH+3RPQjcGRl9TxWNfKEUU0Hc+ff8dJR+qMlsjj806sCSt5s0Tj8zX39Hq75+k=
X-Received: by 2002:a17:907:7e8b:b0:a7a:b385:37cd with SMTP id
 a640c23a62f3a-a8090dafd3fmr136769666b.30.1723120691338; Thu, 08 Aug 2024
 05:38:11 -0700 (PDT)
MIME-Version: 1.0
From: Kelly Choi <kelly.choi@cloud.com>
Date: Thu, 8 Aug 2024 13:37:35 +0100
Message-ID: <CAO-mL=zBMvaazPHCpVDZuJ_i5bjOeJXq8T3TvwBeQSWrv6iciA@mail.gmail.com>
Subject: Call for help - Xen user documentation
To: xen-devel <xen-devel@lists.xenproject.org>, xen-users@lists.xenproject.org
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Content-Type: multipart/alternative; boundary="000000000000b67dcd061f2b4c38"

--000000000000b67dcd061f2b4c38
Content-Type: text/plain; charset="UTF-8"

Hi all,

As you'll know we've been working on an initiative to update documentation
so that others in the community find it easier to learn about the Xen
Project.

@Alejandro Vallejo <alejandro.vallejo@cloud.com> has kindly started our
Sphinx user documentation but we need your help adding to this!

*All members of the community can contribute to this. *

*GitLab Link: *https://gitlab.com/xen-project/people/agvallejo/xen-userguide
*User facing link: *
https://xen-project.gitlab.io/people/agvallejo/xen-userguide/introduction.html

Once we have enough in our get started documentation, we will look to move
it into the Xen namespace.

*Why is this important?*
Documentation and user guides may take time to create, but ultimately they
help us by attracting new members into the community and getting more
people involved with Xen. As a project we want more people contributing,
helping with reviews, and engaging. To do this, we need to have guides in
place to allow them to get started!

We appreciate this is a community effort, and any time or resource you can
contribute will help the Xen Project project thrive.

Many thanks,
Kelly Choi

Community Manager
Xen Project

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

<div dir=3D"ltr">Hi all,<div><br></div><div>As you&#39;ll know we&#39;ve be=
en working on an initiative=C2=A0to update documentation so that others in =
the community find it easier to learn about the Xen Project.=C2=A0</div><di=
v><br></div><div><a class=3D"gmail_plusreply" id=3D"plusReplyChip-0" href=
=3D"mailto:alejandro.vallejo@cloud.com" tabindex=3D"-1">@Alejandro Vallejo<=
/a>=C2=A0has kindly started our Sphinx user documentation=C2=A0but we need =
your help adding to this!=C2=A0</div><div><br></div><div><b>All=C2=A0member=
s=C2=A0of the community can contribute to this.=C2=A0</b></div><div><br></d=
iv><div><b>GitLab Link:=C2=A0</b><a href=3D"https://gitlab.com/xen-project/=
people/agvallejo/xen-userguide">https://gitlab.com/xen-project/people/agval=
lejo/xen-userguide</a></div><div><b>User facing link:=C2=A0</b><a href=3D"h=
ttps://xen-project.gitlab.io/people/agvallejo/xen-userguide/introduction.ht=
ml">https://xen-project.gitlab.io/people/agvallejo/xen-userguide/introducti=
on.html</a></div><div>=C2=A0</div><div>Once we have enough in our get start=
ed documentation, we will look to move it into the Xen namespace.=C2=A0</di=
v><div><br></div><div><b>Why is this important?</b></div><div>Documentation=
=C2=A0and user guides may take time to create, but ultimately=C2=A0they hel=
p us by attracting new members into the community and getting more people i=
nvolved with Xen. As a project we want more people contributing, helping wi=
th reviews, and engaging. To do this, we need to have guides in place to al=
low them to get started!=C2=A0</div><div><br></div><div>We appreciate this=
=C2=A0is a community effort, and any time or resource you can contribute wi=
ll help the Xen Project project thrive.=C2=A0</div><div><br></div><div><div=
><div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_signatu=
re"><div dir=3D"ltr"><div>Many thanks,</div><div>Kelly Choi</div><div><br><=
/div><div><div style=3D"color:rgb(136,136,136)">Community Manager</div><div=
 style=3D"color:rgb(136,136,136)">Xen Project=C2=A0<br></div></div></div></=
div></div></div></div>

--000000000000b67dcd061f2b4c38--


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 12:49:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 12:49:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774051.1184545 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc2a7-0003rg-2p; Thu, 08 Aug 2024 12:49:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774051.1184545; Thu, 08 Aug 2024 12:49:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc2a6-0003rZ-W8; Thu, 08 Aug 2024 12:49:26 +0000
Received: by outflank-mailman (input) for mailman id 774051;
 Thu, 08 Aug 2024 12:49:25 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sc2a5-0003rT-L2
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 12:49:25 +0000
Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com
 [2a00:1450:4864:20::632])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a31eccc8-5584-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 14:49:23 +0200 (CEST)
Received: by mail-ej1-x632.google.com with SMTP id
 a640c23a62f3a-a7aac70e30dso110724766b.1
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 05:49:23 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9d4522esm735160366b.106.2024.08.08.05.49.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 05:49:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a31eccc8-5584-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723121363; x=1723726163; 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=JCTGqDUixoVuDVnpzib7lZzBHzUkqf5HlKtTUmlzf9I=;
        b=ZqzeyhNtVi1S3rVwuG2Nbcy8+p/2vxRFuEIvE+PicsScWpXiBKeLS8rWIFwpKuMTkf
         7IQjK2QvHsTXnMSnz90VyA/Q/Pug0hmLyCYRXgjNZfzJsPzl92wa2jThI3C0BiU0CnTL
         jVonDfmR1Mg5viLAEWJrJ4OzWNmJc7Ruec0N4aNGBRSQ59ykmiG2vLZXPiuTzC+GmaWX
         u0XAAMq5J3kQYzOZ1tQgp9/w8gAnHjJ/pplhPImHnBAhVPzo3AZZTh0GUHmw1CCO3yDP
         FFaUdpcjItLm9xYhvKWFPCjwKDshcb+Jn6nIjdAKYAjG6Ptopn1zKbmbjudc859eGgn0
         6TJw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723121363; x=1723726163;
        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=JCTGqDUixoVuDVnpzib7lZzBHzUkqf5HlKtTUmlzf9I=;
        b=EYsoMEJTkpUoybGclU5hKNFYbTR8GLt8+Il8Yt08dvVURxNchM0RJRSrZMb5IYbhZx
         cQUu6n2abY21ylIkEwsDOEWrCBrA/D7MzcfwMZ6zTAtGehZ78+jnvsbWdNhxVZzLAtqz
         FCmSRZq4Xi7t29QJ7xodsT1z4/9ja1arSxBD9vV5I9bM05pbJSLKfIhMV4ojIWftULpK
         Qp/jegDUHf74643C3umy0lS0rAjBxUrLmCj6OQKV2RRwhI3MGOvIoq+tn8f+q2HTc+XA
         y55b8JUMYUYey6/uXaLjshdxVD6de8Imk0gtg/6nm/hcj76seFQnktpUpw3Y54UDYH7x
         VpCg==
X-Gm-Message-State: AOJu0Yz3Yp3+YJ3VDA+bsBGCOXye8cH0vObD68lA5CitaLUBSzZwQOIs
	775b3n+dicf0HZ/FGSWCZ8XwyT1EyuA2IXsit7wUphD/zF6FLKSYbTbM4Pv5UQ==
X-Google-Smtp-Source: AGHT+IHBk5SEwOXM5863rG0qimC5uDriNUmmC3eXHmIdpwACKHZVSrzjQd9ZmM8LKlgFGRubB8r1rA==
X-Received: by 2002:a17:906:6a1c:b0:a7a:97a9:ba23 with SMTP id a640c23a62f3a-a8090c7ff48mr111737266b.22.1723121362688;
        Thu, 08 Aug 2024 05:49:22 -0700 (PDT)
Message-ID: <bc643306-a41a-41bb-b7b7-b7c67f9e5bdf@suse.com>
Date: Thu, 8 Aug 2024 14:49:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/4] xen: arm: make VMAP only support in MMU system
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com,
 julien@xen.org
References: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
 <20240808120936.3299937-3-ayan.kumar.halder@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240808120936.3299937-3-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 08.08.2024 14:09, Ayan Kumar Halder wrote:
> @@ -58,9 +58,13 @@ config PADDR_BITS
>  	default 40 if ARM_PA_BITS_40
>  	default 48 if ARM_64
>  
> +config HAS_VMAP
> +	def_bool y

With this being always enabled, ...

>  config MMU
>  	def_bool y
>  	select HAS_PMAP
> +	select HAS_VMAP

.. what use is this?

> --- a/xen/include/xen/vmap.h
> +++ b/xen/include/xen/vmap.h
> @@ -141,7 +141,9 @@ void *arch_vmap_virt_end(void);
>  /* Initialises the VMAP_DEFAULT virtual range */
>  static inline void vm_init(void)
>  {
> +#ifdef CONFIG_MMU
>      vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end());
> +#endif
>  }

What about non-Arm, which all have MMUs but no corresponding Kconfig
setting? And why is this not CONFIG_HAS_VMAP anyway (with HAS_VMAP
properly moved to common/Kconfig, where e.g. HAS_PMAP also lives,
and then unconditionally selected by all other architectures)?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 12:51:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 12:51:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774059.1184555 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc2cM-0005Hf-Ek; Thu, 08 Aug 2024 12:51:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774059.1184555; Thu, 08 Aug 2024 12:51:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc2cM-0005HY-BK; Thu, 08 Aug 2024 12:51:46 +0000
Received: by outflank-mailman (input) for mailman id 774059;
 Thu, 08 Aug 2024 12:51: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=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sc2cK-0005HS-Hg
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 12:51:44 +0000
Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com
 [2a00:1450:4864:20::632])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f6ab043f-5584-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 14:51:43 +0200 (CEST)
Received: by mail-ej1-x632.google.com with SMTP id
 a640c23a62f3a-a7aa086b077so91871266b.0
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 05:51:43 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ec8ddfsm739930966b.210.2024.08.08.05.51.42
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 05:51:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f6ab043f-5584-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723121503; x=1723726303; 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=4etNt+XYZyYIyTNnvshoJKz3i1ju18tV/SxZxWvfW2A=;
        b=CNRtLWosA067wwW4NnvNRcVCUGjjHS1+jSw71Mi5rDv81vXMrBajsxTUo3fBuOXDMB
         WqtDvTlkYssnVA6YI/vRXe1xAesJWjsGkySgeC5lKcsWA4wlDiW482MvCJPzeXLE74K+
         CsaRcXYMBPWavOeC4wz9IgKI7I+gg8EzEtVn7hzvjsolW6XAR9vOVW2KFfcJSnjeguMa
         4j48jNW5M3bCRueapwFaLcKzuz/+nz+hPkJ/v72W/ZINjGPKKBgDlmmqWTSkGBfsP8oX
         0/NT5WibUNtSBj/Mxoi4ExJTDwmFKJ/ZFPiMoP5p4P7keib1zGN4UMAyERPQx/e+jE/y
         VVYA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723121503; x=1723726303;
        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=4etNt+XYZyYIyTNnvshoJKz3i1ju18tV/SxZxWvfW2A=;
        b=nRAAS+sWYq+wdO66jVb/qH3fsDm/VW0DA+jswhxIp6IYTNjcMh28F5mPC+LLoMnVbd
         0VVL3gSq0yobt++4bhjkGD9A+ru2mkn1/lFZiRjwyrZxrp8ZmlFCInQpJCDJuoNcqxSw
         1khuqLKKAG8i6KxfRinyoxBPXXp6gUZbnjqWHGE/AFshM4zsAEQmLPJPsQoTdoGXnBpk
         Y8CoBRjvCzXxzuRkHEXNWiKGei21rZ9h+YEzsr850Ovy9WR+W+feblFiZcpLg8vwUXF0
         JHEj+ElbYRQr6meo3X3B0vetagf/148iCipULH1rvHjLhIZGUtYH7Q+Kv8sJOsZqwpGn
         /DJA==
X-Gm-Message-State: AOJu0YynfsUfNhPOC2SG0o9S5rzBubyvXJUej9Lx6zMOFFMTcmVQaI9z
	fM161obK0jq2HoKhlo4GFFbCafxbLT2GTvmWp1uj+g/mTr7cXeyVlLKspPYvvg==
X-Google-Smtp-Source: AGHT+IFwhj/xJjO3kstTp4YM5nSflKGtgaKETGqxcOcCO6N0+XfIT/uKH+uoyV6DCrPf4AEZrtiNuw==
X-Received: by 2002:a17:907:7f17:b0:a7a:a2b7:93fe with SMTP id a640c23a62f3a-a8090e44042mr112946966b.47.1723121502888;
        Thu, 08 Aug 2024 05:51:42 -0700 (PDT)
Message-ID: <b4094b23-0762-429d-b067-f41e5d86481f@suse.com>
Date: Thu, 8 Aug 2024 14:51:42 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 3/4] xen: arm: Moved domain_page.c to MMU specific
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com,
 julien@xen.org
References: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
 <20240808120936.3299937-4-ayan.kumar.halder@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240808120936.3299937-4-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 08.08.2024 14:09, Ayan Kumar Halder wrote:
> domain_page.c has been moved to mmu/domain_page.c. The reason
> being this file implements MMU specific logic for mapping,
> unmapping, etc domain page.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
>  xen/arch/arm/mmu/Makefile            | 1 +
>  xen/arch/arm/{ => mmu}/domain_page.c | 0
>  2 files changed, 1 insertion(+)
>  rename xen/arch/arm/{ => mmu}/domain_page.c (100%)
> 
> diff --git a/xen/arch/arm/mmu/Makefile b/xen/arch/arm/mmu/Makefile
> index 67475fcd80..2cb44b857d 100644
> --- a/xen/arch/arm/mmu/Makefile
> +++ b/xen/arch/arm/mmu/Makefile
> @@ -2,3 +2,4 @@ obj-y += p2m.o
>  obj-y += pt.o
>  obj-y += setup.o
>  obj-y += smpboot.o
> +obj-$(CONFIG_ARCH_MAP_DOMAIN_PAGE) += domain_page.o

Don't you then also need to remove the respective line from arm/Makefile?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 12:58:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 12:58:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774071.1184564 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc2j1-0006G8-2p; Thu, 08 Aug 2024 12:58:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774071.1184564; Thu, 08 Aug 2024 12:58:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc2j1-0006G1-02; Thu, 08 Aug 2024 12:58:39 +0000
Received: by outflank-mailman (input) for mailman id 774071;
 Thu, 08 Aug 2024 12:58: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=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sc2iz-00068P-JT
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 12:58:37 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ed1f348c-5585-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 14:58:37 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5af6a1afa7bso1082377a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 05:58:37 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ecb546sm737590966b.224.2024.08.08.05.58.35
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 05:58:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ed1f348c-5585-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723121916; x=1723726716; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=u5rHXwCi9oNtHjHF/8RVShXBGLMxVge/YWa5g886Jkw=;
        b=RcrdKWvA8V66TLcAuS6EKE+zrDSYUlGeHaQTE6bhgLUcYseMcezxER5VtrruuwWb3G
         Eee13+5TJhgOADQAuBSieOadB2WXVpMJeSfLa1GidO7jFKr+m4qUDLxiHHnyyd5lK+X/
         KXiJJoc/uBCN8q4tM2hUOX6YEHmAuuvltn1JZMMd3F3Q7SY6gN7/9oXok1duAGCd7CQV
         JuwMbDiO4ZAzc5vr2PtPEuqhC0Ev9HvxmXr1HiXtm2lcsUmVB5Gj60ockK2QpB2Cr1jN
         mYC13TP7WTgWk0u0tt9Nu6SVmORd+eOlHsMNynQZS6eBUGmu34NCgRaht0FYs6No74ET
         I2Yg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723121916; x=1723726716;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :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=u5rHXwCi9oNtHjHF/8RVShXBGLMxVge/YWa5g886Jkw=;
        b=hnOQ1dq/YyraCQVPYEY3gDrw3TuSc1eoCqJ7AOIDLR88zk8twcGmCsDRwDl0fdMtEX
         h9HZAu9XmhqqNYNeD10emVW/Es66oTlWe55GkMiU8IhkOxYHWm8H7QdunP0Zzv6muy4T
         B1Y9hjNYdAV9bImKHQfkAz3XDzdxyr+sUv55yj54dL2F1DebhgFv2kvXX+5kJIOT9DPN
         L6uU6v0duvQMBTZC5vO8Tu08ig6hCK3mOvo89NfEQ7dUwKWaBvIkTF+Do3X5gdrpGBRc
         xeagM9JFmf0PuNumM8ptCjbOfDNu0jDnn5bziy8ZIS4L+2TG5dLqqxTdcAEggsemU0/O
         qxgg==
X-Gm-Message-State: AOJu0YyG/yVcQh0Rv2d/qd1tp8eRhSROU4EhXNwsrQVp3HWMUWMmTpM+
	Y53vBR9RhxECnIHwrfDCLibOmu4nsYDlSFSrgsqvi+FGlApSU6PRO9kiQpMvOw==
X-Google-Smtp-Source: AGHT+IF/wJKd4hp49iEVti2Yw6ihIervu2rQeVMgT/y3TL1QjcAA7B+VPSJgJGeInPPyewbpVLDOew==
X-Received: by 2002:a17:907:7214:b0:a7d:30d2:28f8 with SMTP id a640c23a62f3a-a8090f39628mr136454266b.68.1723121916229;
        Thu, 08 Aug 2024 05:58:36 -0700 (PDT)
Message-ID: <57e01574-2e06-4dd3-bf7f-91b5a19477b1@suse.com>
Date: Thu, 8 Aug 2024 14:58:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/5] x86: Fix early output messages in case of EFI
To: Frediano Ziglio <frediano.ziglio@cloud.com>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-3-alejandro.vallejo@cloud.com>
 <7f1e17dd-d105-4f6c-87d3-69f3dca4ab82@suse.com>
 <CACHz=ZjYdBcB_S1tpXpuRQDKGAKY=SrgTEy8_0Wyq_q+bOBfHg@mail.gmail.com>
 <bd4c8ef5-a6bb-42ae-9b69-c3d14eeac55e@suse.com>
 <CACHz=ZgRK2DMHmiAVsBo1WJVBxbnTka3-CcpgopKB-6gWs5ZSw@mail.gmail.com>
Content-Language: en-US
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+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: <CACHz=ZgRK2DMHmiAVsBo1WJVBxbnTka3-CcpgopKB-6gWs5ZSw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 08.08.2024 14:50, Frediano Ziglio wrote:
> On Thu, Aug 8, 2024 at 10:29 AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> (re-adding xen-devel@)

Did you notice this in my earlier reply? You dropped the list again.

>> On 08.08.2024 10:33, Frediano Ziglio wrote:
>>> On Thu, Aug 8, 2024 at 8:49 AM Jan Beulich <jbeulich@suse.com> wrote:
>>>>> This cause offsets in x86 code generated by
>>>>> sym_offs(SYMBOL) to be relocated too (basically they won't be
>>>>> offsets from image base). In order to get real offset the
>>>>> formulae "sym_offs(SYMBOL) - sym_offs(__image_base__)" is
>>>>> used instead.
>>>>
>>>> The main calculations of %esi are, if I'm not mistaken,
>>>>
>>>>         /* Store Xen image load base address in place accessible for 32-bit code. */
>>>>         lea     __image_base__(%rip),%esi
>>>>
>>>
>>> Which is correct
>>>
>>>> and
>>>>
>>>>         /* Calculate the load base address. */
>>>>         call    1f
>>>> 1:      pop     %esi
>>>>         sub     $sym_offs(1b), %esi
>>>>
>>>> i.e. both deliberately %rip-relative to be position-independent. What's
>>>> wrong with this?
>>>>
>>>
>>> This can be wrong if sym_offs(1b) was relocated and not patched by
>>> efi_arch_relocate_image.
>>
>> Of course, if in the course of GrUB's loading of xen.efi base relocations
>> are applied (unlike when loading an ELF binary, where afaik base relocs
>> would be ignored, even if there were any), then this calculation is of
>> course going to be wrong. Can't we correct it though, to properly resemble
>> PIC code:
>>
>>         /* Calculate the load base address. */
>>         call    1f
>> 1:      pop     %esi
>>         sub     1b - start, %esi
>>
>> or (because start is in a different section):
>>
>>         /* Calculate the load base address. */
>>         call    1f
>> 1:      pop     %esi
>>         sub     $sym_offs(1b), %esi
>>         add     $sym_offs(start), %esi
>>
>> (or something along these lines)?
>>
> 
> Yes, that works. But is a bit painfull, I mean, the %esi will point to
> the correct address, but still you will use something like
> syms_esi(foo) expecting to work but it won't as there will be applied
> a relocation offset.

I find your reply contradictory in itself. You first say this works, to
then say it can't work. The underlying idea has to be to establish %esi
such that it works uniformly.

> On 32bit PIC code you could use something like
> foo@GOTOFF(%esi), assuing %esi is pointing to the global offset table.
> I was trying to use that but linker is complaining a bit as generating
> a 64bit relocation. The x64 architecture supports such relocation as
> 32bit but I didn't find a way to tell assembler to use the 32bit
> version instead of the 64bit one. Also I didn't find a way to set
> _GLOBAL_OFFSET_TABLE_ where I want it to be, it looks like that if the
> linker is not generating it is not picking up the forcedly set symbol.

Even if the toolchain permitted this: We don't have and don't want to
have any GOT. Note how the linker script actually has an assertion for
.got to be empty (plus a few more ones for other sections).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:02:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:02:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774080.1184574 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc2my-00083j-JJ; Thu, 08 Aug 2024 13:02:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774080.1184574; Thu, 08 Aug 2024 13:02:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc2my-00083c-GV; Thu, 08 Aug 2024 13:02:44 +0000
Received: by outflank-mailman (input) for mailman id 774080;
 Thu, 08 Aug 2024 13:02:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sc2mx-00083W-4Y
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:02:43 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7f32abff-5586-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 15:02:42 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a7a9185e1c0so95742966b.1
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:02:42 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9c12a79sm739979566b.60.2024.08.08.06.02.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 06:02:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7f32abff-5586-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723122161; x=1723726961; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=yeLKZbVnG5SDKU6VO1EAbGHOp3mpZRJIZ8cxuvHWISk=;
        b=AZ0EVs0RrZJ/6ubphNh3iVdpGtnl+lQKjPKmYcP78eCNT0dIVWVQz1mYreAs8ozehO
         K3Z6o7LXe0HU9qMwlr1iNdEZbqllcOJGZifQUh/eY0VXkxZs3DcLgdmzGhyzF2TpNUOv
         FSlJpaq4cjPoXRT/gLQ+7yFS+nrUIEmgxzvOdxS3PVATdNOzWYd2RNdPddgfetgMSh5R
         ComT6v7VaLiGevaoN3VqzHFGZV4MiK+Unco0Mi+mvllAYx6L+0AZ9k5Oy0RxU6vQhmLz
         UgG0Adhr3MYavkgMwAAqUJDE/Auath0xX0L5jMWtFrAu+OYOPlr0pCUShtQRVMSoinJo
         V/8w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723122161; x=1723726961;
        h=content-transfer-encoding:in-reply-to:autocrypt: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=yeLKZbVnG5SDKU6VO1EAbGHOp3mpZRJIZ8cxuvHWISk=;
        b=vqTr0YkBbOQA6/gmTEaQfsk63FFvb47ZmIdUGwsqtHyC85S6ktJULMXj1Bl23UEkZn
         npu1UfuOG/GLQzM2jFwatJf6//n1X+20ce1VSE6biH0KxiwNvScLqU0ZyxX97zprDWjs
         X3O+qo4koQBYy9Ng7XcEtmwNDTUe16QMczQ60lgdU7E26kdtGdqNOcCPWl+ibhvGvXYZ
         JFskVGNcEbNjJK3I6QwP4v3DwljPE/V8xFgfAxq/JlIjBkO2CLAeipuuJs4z1h36LK2T
         JTIVESo77sLRRtqLI6pgK762TnTnOYG+mfBMR7zRW5HVSgG1Af8/Z9jacPWf0MqjrBZu
         B6kg==
X-Gm-Message-State: AOJu0YyrnR6MsatU7+YdnFE3LU3eKCFIlLrfaM29TWcq4dCcC037+w4T
	hsLQgbdlgHTxG4iW1KpvarlJhw9F5CLVtwt79AJY0FfltAwxbrO8/7P69oPkvbk+RzgSgcX+vx4
	=
X-Google-Smtp-Source: AGHT+IG1NGQ8ZXjJnRpiHJEqpvqVfxTubtTuQHwJ+awF8lrosGWRbm/O/czqn0lzzBqw9jYvOvZ4zw==
X-Received: by 2002:a17:907:f795:b0:a7a:8e0f:aaf0 with SMTP id a640c23a62f3a-a8090db212bmr140096066b.36.1723122161317;
        Thu, 08 Aug 2024 06:02:41 -0700 (PDT)
Message-ID: <c655dbd9-046a-451a-a7e8-670a1eaf4ab0@suse.com>
Date: Thu, 8 Aug 2024 15:02:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: xen | Failed pipeline for staging | 08aacc39
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <66b4bd64b9733_2f15a5d3890299@gitlab-sidekiq-catchall-v2-754c69bc57-l5rxx.mail>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <66b4bd64b9733_2f15a5d3890299@gitlab-sidekiq-catchall-v2-754c69bc57-l5rxx.mail>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 08.08.2024 14:43, GitLab wrote:
> 
> 
> Pipeline #1405649318 has failed!
> 
> Project: xen ( https://gitlab.com/xen-project/hardware/xen )
> Branch: staging ( https://gitlab.com/xen-project/hardware/xen/-/commits/staging )
> 
> Commit: 08aacc39 ( https://gitlab.com/xen-project/hardware/xen/-/commit/08aacc392d86d4c7dbebdb5e664060ae2af72057 )
> Commit Message: x86/emul: Fix misaligned IO breakpoint behaviou...
> Commit Author: Matthew Barnes
> Committed by: Jan Beulich ( https://gitlab.com/jbeulich )
> 
> 
> Pipeline #1405649318 ( https://gitlab.com/xen-project/hardware/xen/-/pipelines/1405649318 ) triggered by Jan Beulich ( https://gitlab.com/jbeulich )
> had 4 failed jobs.
> 
> Job #7535428747 ( https://gitlab.com/xen-project/hardware/xen/-/jobs/7535428747/raw )
> 
> Stage: build
> Name: qemu-system-aarch64-6.0.0-arm64-export
> Job #7535428873 ( https://gitlab.com/xen-project/hardware/xen/-/jobs/7535428873/raw )
> 
> Stage: build
> Name: alpine-3.18-gcc-debug-arm64-static-shared-mem
> Job #7535428869 ( https://gitlab.com/xen-project/hardware/xen/-/jobs/7535428869/raw )
> 
> Stage: build
> Name: alpine-3.18-gcc-debug-arm64-staticmem
> Job #7535429434 ( https://gitlab.com/xen-project/hardware/xen/-/jobs/7535429434/raw )
> 
> Stage: test
> Name: qemu-smoke-dom0less-arm32-gcc

All Arm failures when the three commits under test only touch x86 code.
How can that be? And Stefano, note how this would needlessly have blocked
a merge request, if we were already using that model you're proposing to
switch to.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:05:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:05:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774096.1184584 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc2pv-0000Tw-3v; Thu, 08 Aug 2024 13:05:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774096.1184584; Thu, 08 Aug 2024 13:05:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc2pv-0000Tp-12; Thu, 08 Aug 2024 13:05:47 +0000
Received: by outflank-mailman (input) for mailman id 774096;
 Thu, 08 Aug 2024 13:05:45 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=vpfq=PH=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sc2pt-0000Tj-Ps
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:05:45 +0000
Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com
 [2607:f8b0:4864:20::236])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eb0feeb5-5586-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 15:05:43 +0200 (CEST)
Received: by mail-oi1-x236.google.com with SMTP id
 5614622812f47-3db1956643bso710262b6e.3
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:05:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eb0feeb5-5586-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723122342; x=1723727142; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=UuzBqePRBVg6JlXG882Jdv6LFkF4h8QLEp7OIo+zHs8=;
        b=D+YoaZbQqXbsfv4WxKJdHke26xJBbvaC/0uNY3f5mL4Q6qCqof0v3gmotdSEy1Qt2V
         HPZ/X2wm+PK8+ULJuEQL1LxtLLZd2cHEwvfRSXXNa6bHPdXICLQx1XfciAJKJmw2vJHB
         v479boSY+VHD5wGJXKOJZGsRCuIjxjJ4rmoDU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723122342; x=1723727142;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=UuzBqePRBVg6JlXG882Jdv6LFkF4h8QLEp7OIo+zHs8=;
        b=mYX7fxw5fzBLTwIwt6EybvVFSTdKnJvOncAX1tyIlMGQX+yYyPYG3dCQt5Pj875xLn
         c8sSK9wgljzct4aNG4og9uAdawy6EMTthef2HtR+2H1XVufhoAkH8uvQYIM9+0Yxm1RI
         WMGJbZr5GfeZcFB5FhNKYAT+5onZm0MLps5J6paOacvTgQdTsMBB1NPxIYBh8ah82knn
         iPuiC2Xcs4GY7ni5agcE4kKJ3K8GDgsPq+TR7SfnEDoFa9uCFPQuxs9TJmq7D27iLsfe
         ECml8Ou9SSptj30IYWWHjODq4X2Hhs462h9+VJbAso5EUJIgyIrYgbJL+TWiH9+fBOZa
         VDlQ==
X-Forwarded-Encrypted: i=1; AJvYcCVeoZf+qgymYwcLaFrLjhylmh4I3Kb3ZUrJVr+RB2ijpnVDtHEf2FodYOQ1Q+weulD2HWzQCi73g5UZBIDYaqJO3FV3D07Rz/oIG4YKT/k=
X-Gm-Message-State: AOJu0YycpETnPS/C8ZPbdlO+pHDKgZTh7NbkB3K+iVqNoEgrGqtiKPcZ
	HmSf9DqKnVPOWXJPqLduFNHVjtjCgVChamwblkccWEO3+Cj8uml5K7h4gMkG48c/fTooFml1YvY
	segXMrw+m4dcP6F9S0DwfrYYpos3PyOtxTfnwvQ==
X-Google-Smtp-Source: AGHT+IHvs5Hv9Gnq1NYHSXCAyfzK/r45jcLRpXWVlN5gvL+YrNmTzAyumfP7pPxIJSlXC57r1CKWf++JxdsrL35ff8k=
X-Received: by 2002:a05:6808:1481:b0:3da:a48b:d1e6 with SMTP id
 5614622812f47-3dc3b41ada9mr1922461b6e.16.1723122342315; Thu, 08 Aug 2024
 06:05:42 -0700 (PDT)
MIME-Version: 1.0
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-2-alejandro.vallejo@cloud.com> <ad72cc97-b9dd-4e7e-93f6-333805e40785@suse.com>
 <CACHz=Zh7wK58mbB762fnevHEKW9qhp-NRJ6buNe1b-qLxP0qPg@mail.gmail.com> <b9b40658-ff13-4240-98a2-4811411e31b6@suse.com>
In-Reply-To: <b9b40658-ff13-4240-98a2-4811411e31b6@suse.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Thu, 8 Aug 2024 14:05:31 +0100
Message-ID: <CACHz=ZhC7J_vEZJV9hpET_LONYDFpptYDGEt=U+a=htNA-vCLw@mail.gmail.com>
Subject: Re: [PATCH 1/5] x86: Put trampoline in .init.data section
To: Jan Beulich <jbeulich@suse.com>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Xen-devel <xen-devel@lists.xenproject.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

(added again missing recipients)

On Thu, Aug 8, 2024 at 9:54=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wrot=
e:
>
> On 08.08.2024 10:00, Frediano Ziglio wrote:
> > On Thu, Aug 8, 2024 at 8:34=E2=80=AFAM Jan Beulich <jbeulich@suse.com> =
wrote:
> >>
> >> On 07.08.2024 15:48, Alejandro Vallejo wrote:
> >>> This change allows to put the trampoline in a separate, not executabl=
e
> >>> section. The trampoline contains a mix of code and data (data which
> >>> is modified from C code during early start so must be writable).
> >>> This is in preparation for W^X patch in order to satisfy UEFI CA
> >>> memory mitigation requirements.
> >>
> >> Which, aiui, has the downside of disassembly of the section no longer
> >> happening by default, when using objdump or similar tools, which go fr=
om
> >> section attributes. Why is it being in .init.text (and hence RX) not
> >> appropriate? It should - in principle at least - be possible to avoid
> >> all in-place writing to it, but instead only ever write to its relocat=
ed
> >> copy. Quite a bit more code churn of course.
> >>
> >> I wonder if we shouldn't put the trampoline in its own section, RWX in
> >> the object file, and switched to whatever appropriate in the binary
> >> (which really may be RX, not RW).
> >
> > We cannot have RWX to satisfy UEFI CA memory mitigation, that's why I
> > had to move it, code sections should not be writeable. We can mark
> > either RX or RW but we use the data very early so we are not able to
> > change the permissions (we can try with all complications that this
> > could bring like how to report an error at so early stages).
>
> The early writing could be done away with, as indicated. There's not
> really any strict requirement to write to the trampoline region within
> the Xen image. All updates to it could in principle be done after it
> was copied into low memory. Then (and of course only then) could it be
> part of an RX section in the image, maybe .init.text, maybe a separate
> .trampoline section.
>
> Jan

Not sure if I should be flattered or scared with that.
You are surely putting quite some trust on me. On the other hand you
are putting also some effort.
The change I proposed is just one line, you are asking to check all
reference, change them correctly and possibly testing them all.
I tried to do a small test (removing symbols from the trampoline) and
for instance head.S is writing to that section. That would require all
references to be made after the copy and to the copy. At the moment
the copy is done differently for different paths so it's less
straightforward than it seems.

Frediano


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:18:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:18:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774107.1184595 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc31v-0003XV-5N; Thu, 08 Aug 2024 13:18:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774107.1184595; Thu, 08 Aug 2024 13:18:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc31v-0003XO-2n; Thu, 08 Aug 2024 13:18:11 +0000
Received: by outflank-mailman (input) for mailman id 774107;
 Thu, 08 Aug 2024 13:18:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=vpfq=PH=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sc31u-0003Wz-6O
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:18:10 +0000
Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com
 [2607:f8b0:4864:20::22c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a7510b3d-5588-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 15:18:09 +0200 (CEST)
Received: by mail-oi1-x22c.google.com with SMTP id
 5614622812f47-3db18c4927bso700983b6e.1
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:18:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a7510b3d-5588-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723123088; x=1723727888; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=e1fpPuQl8cYOlzY3fFlpG5q796ahEHADyk8dq9quYXs=;
        b=ktvtWOFE2gFApY0ZHUlP9rpARAPdsb5vFU9Tngb0KJbCrEiIiW4mXnX1BILAe2zaDM
         KbXBFKUDXH7uNEdhkNpIjrLhWe/fSgsw+tene8NZJPmUmL+Xx6cfwGz11M/tr60YLP6S
         0Sg2DROFtwmxAdy5k6HQ2xpOU0CZtU2MdW+V8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723123088; x=1723727888;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=e1fpPuQl8cYOlzY3fFlpG5q796ahEHADyk8dq9quYXs=;
        b=ocTuGx1tXaM8AQ7ihN2gIQC10bcIdQmI0UzGMzcSJFE0o8c6Ui3eBc5j2We91Uc3tP
         NLy2P/WKoFcf8XhfelEIc/uHt+6e/a1r96bUe7u7rxhtUeSvuEFfP2Z/Bl1bD9Hckrfj
         OTQ9kPfiws6Pv+xZCiLgKZifBUuBc66hs/10Vq6BBBRQg0/sEBtFiEvusGCMuXZslkWP
         obprV8kxpS/mk6cj1Jz14U3BsJzBk2gAesrCTRuTTk9Zj7/o7syypwPmIY7lCAmTArIg
         NvmPv+4LepnkLb36FuP9h5ml0ZizIQJrCQJ1gmbdXHiqnbPu4qMQLWbtjgcCLRu2mI7t
         VYuw==
X-Gm-Message-State: AOJu0YxJgVHwxLA8OZ/DOmirT2+6usTVBTMfAVQC6VUvQNHOfjaFIZxN
	cq7GyAIY9zoY8wNV2K13f0Fuws8l5gUNVt8BIYJwdzEv1/ZZwAhFdYJKH9YLUBQzJW+zvzIPS/a
	YymPMo996KG7sIc8pH1K/TatqNfoTOE+d8rjDKQ==
X-Google-Smtp-Source: AGHT+IEzYKql+mWs+1TWxBJ9+Oo4RWDEnvEbru+4R8kVz4Zt3lL3gojMFpPFHvA79bmZMHzaqENFe6Wm1FK5D2v+3ak=
X-Received: by 2002:a54:4790:0:b0:3da:b3c2:b4c0 with SMTP id
 5614622812f47-3dc3b455a2amr1812443b6e.31.1723123087578; Thu, 08 Aug 2024
 06:18:07 -0700 (PDT)
MIME-Version: 1.0
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-3-alejandro.vallejo@cloud.com> <7f1e17dd-d105-4f6c-87d3-69f3dca4ab82@suse.com>
 <CACHz=ZjYdBcB_S1tpXpuRQDKGAKY=SrgTEy8_0Wyq_q+bOBfHg@mail.gmail.com>
 <bd4c8ef5-a6bb-42ae-9b69-c3d14eeac55e@suse.com> <CACHz=ZgRK2DMHmiAVsBo1WJVBxbnTka3-CcpgopKB-6gWs5ZSw@mail.gmail.com>
 <57e01574-2e06-4dd3-bf7f-91b5a19477b1@suse.com>
In-Reply-To: <57e01574-2e06-4dd3-bf7f-91b5a19477b1@suse.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Thu, 8 Aug 2024 14:17:56 +0100
Message-ID: <CACHz=Zi56VX7VE9ESRhm-3YJCqKV9z3yZKY+nWrz827e0t+rnw@mail.gmail.com>
Subject: Re: [PATCH 2/5] x86: Fix early output messages in case of EFI
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
	Alejandro Vallejo <alejandro.vallejo@cloud.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Aug 8, 2024 at 1:58=E2=80=AFPM Jan Beulich <jbeulich@suse.com> wrot=
e:
>
> On 08.08.2024 14:50, Frediano Ziglio wrote:
> > On Thu, Aug 8, 2024 at 10:29=E2=80=AFAM Jan Beulich <jbeulich@suse.com>=
 wrote:
> >>
> >> (re-adding xen-devel@)
>
> Did you notice this in my earlier reply? You dropped the list again.
>

Yes, later, sorry for that.

> >> On 08.08.2024 10:33, Frediano Ziglio wrote:
> >>> On Thu, Aug 8, 2024 at 8:49=E2=80=AFAM Jan Beulich <jbeulich@suse.com=
> wrote:
> >>>>> This cause offsets in x86 code generated by
> >>>>> sym_offs(SYMBOL) to be relocated too (basically they won't be
> >>>>> offsets from image base). In order to get real offset the
> >>>>> formulae "sym_offs(SYMBOL) - sym_offs(__image_base__)" is
> >>>>> used instead.
> >>>>
> >>>> The main calculations of %esi are, if I'm not mistaken,
> >>>>
> >>>>         /* Store Xen image load base address in place accessible for=
 32-bit code. */
> >>>>         lea     __image_base__(%rip),%esi
> >>>>
> >>>
> >>> Which is correct
> >>>
> >>>> and
> >>>>
> >>>>         /* Calculate the load base address. */
> >>>>         call    1f
> >>>> 1:      pop     %esi
> >>>>         sub     $sym_offs(1b), %esi
> >>>>
> >>>> i.e. both deliberately %rip-relative to be position-independent. Wha=
t's
> >>>> wrong with this?
> >>>>
> >>>
> >>> This can be wrong if sym_offs(1b) was relocated and not patched by
> >>> efi_arch_relocate_image.
> >>
> >> Of course, if in the course of GrUB's loading of xen.efi base relocati=
ons
> >> are applied (unlike when loading an ELF binary, where afaik base reloc=
s
> >> would be ignored, even if there were any), then this calculation is of
> >> course going to be wrong. Can't we correct it though, to properly rese=
mble
> >> PIC code:
> >>
> >>         /* Calculate the load base address. */
> >>         call    1f
> >> 1:      pop     %esi
> >>         sub     1b - start, %esi
> >>
> >> or (because start is in a different section):
> >>
> >>         /* Calculate the load base address. */
> >>         call    1f
> >> 1:      pop     %esi
> >>         sub     $sym_offs(1b), %esi
> >>         add     $sym_offs(start), %esi
> >>
> >> (or something along these lines)?
> >>
> >
> > Yes, that works. But is a bit painfull, I mean, the %esi will point to
> > the correct address, but still you will use something like
> > syms_esi(foo) expecting to work but it won't as there will be applied
> > a relocation offset.
>
> I find your reply contradictory in itself. You first say this works, to
> then say it can't work. The underlying idea has to be to establish %esi
> such that it works uniformly.
>

The computation of %esi is correct after the additional "add" command,
in the sense it will point to the current base (under 4GB) however
then you will use syms_esi(foo) thinking "if %esi is correct then also
syms_esi is correct" and it isn't.
So either you need to add another offset to make syms_esi(foo) correct
having %esi not pointing to the base or assuming that syms_esi(foo)
would need fixing.
Potentially the first option would be better, you just need to
remember to correct %esi after rolling back relocations.

> > On 32bit PIC code you could use something like
> > foo@GOTOFF(%esi), assuing %esi is pointing to the global offset table.
> > I was trying to use that but linker is complaining a bit as generating
> > a 64bit relocation. The x64 architecture supports such relocation as
> > 32bit but I didn't find a way to tell assembler to use the 32bit
> > version instead of the 64bit one. Also I didn't find a way to set
> > _GLOBAL_OFFSET_TABLE_ where I want it to be, it looks like that if the
> > linker is not generating it is not picking up the forcedly set symbol.
>
> Even if the toolchain permitted this: We don't have and don't want to
> have any GOT. Note how the linker script actually has an assertion for
> .got to be empty (plus a few more ones for other sections).
>

I know, @GOTOFF does not generate .got entries, that's the reason I
tried to use it and tell linker my idea of _GLOBAL_OFFSET_TABLE_. It's
just that we need real offsets without relocations and I was looking
at a way to get it. That would simply solve the relocation issue
without having to offset %esi to some weird value.

> Jan

Frediano


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:20:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:20:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774115.1184604 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc33n-0005JG-FZ; Thu, 08 Aug 2024 13:20:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774115.1184604; Thu, 08 Aug 2024 13:20:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc33n-0005J9-Cx; Thu, 08 Aug 2024 13:20:07 +0000
Received: by outflank-mailman (input) for mailman id 774115;
 Thu, 08 Aug 2024 13:20:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=6I4s=PH=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1sc33l-00053o-GG
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:20:05 +0000
Received: from fout7-smtp.messagingengine.com (fout7-smtp.messagingengine.com
 [103.168.172.150]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id eb692b5e-5588-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 15:20:03 +0200 (CEST)
Received: from compute8.internal (compute8.nyi.internal [10.202.2.227])
 by mailfout.nyi.internal (Postfix) with ESMTP id 24D75138FCE4;
 Thu,  8 Aug 2024 09:20:02 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162])
 by compute8.internal (MEProxy); Thu, 08 Aug 2024 09:20:02 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 8 Aug 2024 09:20:01 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eb692b5e-5588-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:subject:subject:to:to; s=fm3; t=1723123202;
	 x=1723209602; bh=cWGrgl5FGkOpZf+r63CqwvJvu4/37TZjtbNVyIWg0To=; b=
	JKOjTZ4u/YUECYEtNtouI0M35TkLbRCbSihXcCGLSzARNW4WffQwoe5aynw+Cuay
	UJT0lWjBV0Fuy+WOYqHvWipdAx4YidOHMa0hwWBgcQFhhQJgDYbJOeI5p6VGuWIK
	NZTOi1dUlgtbiDZtL1jPoM+USw4u5ixGpjrhfrBMGCuEvHL/PogqvJwSpYjJpTAA
	zed8YCwHFdjEo3DdY0u66pxPMC9T3vqaN7/SEpgRNZWRSWfroQeywzaBvN3gJ7Ff
	u5sVIGLXSsBJSfb/D0B1F4WqlIVVN8Dl7+eQtjcEAGtVDsu4xHppLeswLsucmYd9
	vpTUi8AIZsqwfF0iMsueCw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:subject:subject:to
	:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
	fm3; t=1723123202; x=1723209602; bh=cWGrgl5FGkOpZf+r63CqwvJvu4/3
	7TZjtbNVyIWg0To=; b=q10wdtnM6SF2s/y/a/SIwYTQRpbKU8hpJ2RDIizdW+tp
	73t39l4i4g++aY+kcxf9jtROOx2Y7eMXjZl15vsAFfCiYdTgPCzQDkjq+70rHkHx
	agDiHPiS/nj366VGVaeRxvTFegoJe5wLb2q3+ywjn2JFsKRIpBavZC3x4j/Zi69a
	7numRBtGGaDfxFQ47Qh1ZfceoKxjgG2fUiTRwUswon6/oera9Yu17j03FXl2HJ/Y
	mtOBru8M9UJX0yyZ6NuPnM75fkJOPK2fPvshushJyHJl+tvzsDtnzWSEWgvrobtg
	T1yun+VbTVNMLlVkh+QOatrmmLM8wiWeZFybBi3HTw==
X-ME-Sender: <xms:Aca0Zj4nXGS7bQ-zuoCu7Sp-eCpAEVSYcjouhldwUJQjMePbJ7ZOlQ>
    <xme:Aca0Zo6FnL8fUsEILLSjz_2e33eeZNPBxBS6PowNsy2Gat6U88QoMG87mokbNIklt
    yxCmsYcHEztyA>
X-ME-Received: <xmr:Aca0ZqfJ6m9DLGVIBlmeK6NuSMKPALAK5tIDnavJgq5gCenV47Ro-4X5air9dEf_EsvZ9fTCvlRibgLwLvIyWhW_28Jxhg2OOA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrledvgdeivdcutefuodetggdotefrodftvf
    curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr
    tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth
    hsucdlqddutddtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttdejnecu
    hfhrohhmpeforghrvghkucforghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrg
    hrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffr
    rghtthgvrhhnpefgudelteefvefhfeehieetleeihfejhfeludevteetkeevtedtvdegue
    etfeejudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm
    pehmrghrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtohhmpdhnsg
    gprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehjsggvuhhl
    ihgthhesshhushgvrdgtohhmpdhrtghpthhtohepgigvnhdquggvvhgvlheslhhishhtsh
    drgigvnhhprhhojhgvtghtrdhorhhg
X-ME-Proxy: <xmx:Aca0ZkJS-5RkJ5ciyoUfDCzHo8zKaT-OsjamG5CjEBh5abPOwRwyVA>
    <xmx:Aca0ZnIWBYj3uwi-HDo9lDgzv_GuwuhD8E13GpNU4aVbi9RnqIqn3g>
    <xmx:Aca0ZtyWU4qOBFhxUyt8-9_LZRJLflGPzW6aafJtElu0eBYJeTwiVA>
    <xmx:Aca0ZjJ1jkygZ_muHpR2sGQ_iy0AzmkRcWlypr6AD8txNa0tu6m2zw>
    <xmx:Asa0ZtijXUlVnLBOQRnAkyFbncwEVwqFHO6PHf26s1tmHTej53v1XD8i>
Feedback-ID: i1568416f:Fastmail
Date: Thu, 8 Aug 2024 15:19:58 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: Assertion failed at arch/x86/genapic/x2apic.c:38 on S3 resume
 nested in KVM on AMD
Message-ID: <ZrTF_28uPHjPabn2@mail-itl>
References: <Zp--KHAFuDVnH1Oq@mail-itl>
 <579fd84d-0a31-43b3-8ce1-f826134cd8a2@suse.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="CJd+PFfbWa/s+trf"
Content-Disposition: inline
In-Reply-To: <579fd84d-0a31-43b3-8ce1-f826134cd8a2@suse.com>


--CJd+PFfbWa/s+trf
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Thu, 8 Aug 2024 15:19:58 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: Assertion failed at arch/x86/genapic/x2apic.c:38 on S3 resume
 nested in KVM on AMD

On Thu, Aug 08, 2024 at 01:22:30PM +0200, Jan Beulich wrote:
> On 23.07.2024 16:28, Marek Marczykowski-G=C3=B3recki wrote:
> > I'm observing a crash like the one below when trying to resume from S3.
> > It happens on Xen nested in KVM (QEMU 9.0, Linux 6.9.3) but only on AMD.
> > The very same software stack on Intel works just fine. QEMU is running
> > with "-cpu host,+svm,+invtsc -machine q35,kernel-irqchip=3Dsplit -device
> > amd-iommu,intremap=3Don -smp 2" among others.
> >=20
> >     (XEN) Preparing system for ACPI S3 state.
> >     (XEN) Disabling non-boot CPUs ...
> >     (XEN) Broke affinity for IRQ1, new: {0-1}
> >     (XEN) Broke affinity for IRQ20, new: {0-1}
> >     (XEN) Broke affinity for IRQ22, new: {0-1}
> >     (XEN) Entering ACPI S3 state.
> >     (XEN) Finishing wakeup from ACPI S3 state.
> >     (XEN) Enabling non-boot CPUs  ...
> >     (XEN) Assertion 'cpumask_test_cpu(this_cpu, per_cpu(cluster_cpus, t=
his_cpu))' failed at arch/x86/genapic/x2apic.c:38
> >     (XEN) ----[ Xen-4.20  x86_64  debug=3Dy  Not tainted ]----
> >     (XEN) CPU:    1
> >     (XEN) RIP:    e008:[<ffff82d04028862b>] x2apic.c#init_apic_ldr_x2ap=
ic_cluster+0x8a/0x1b9
> >     (XEN) RFLAGS: 0000000000010096   CONTEXT: hypervisor
> >     (XEN) rax: ffff830278a25f50   rbx: 0000000000000001   rcx: ffff82d0=
405e1700
> >     (XEN) rdx: 0000003233412000   rsi: ffff8302739da2d8   rdi: 00000000=
00000000
> >     (XEN) rbp: 00000000000000c8   rsp: ffff8302739d7e78   r8:  00000000=
00000001
> >     (XEN) r9:  ffff8302739d7fa0   r10: 0000000000000001   r11: 00000000=
00000000
> >     (XEN) r12: 0000000000000001   r13: 0000000000000001   r14: 00000000=
00000000
> >     (XEN) r15: 0000000000000000   cr0: 000000008005003b   cr4: 00000000=
007506e0
> >     (XEN) cr3: 000000007fa7a000   cr2: 0000000000000000
> >     (XEN) fsb: 0000000000000000   gsb: 0000000000000000   gss: 00000000=
00000000
> >     (XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e0=
08
> >     (XEN) Xen code around <ffff82d04028862b> (x2apic.c#init_apic_ldr_x2=
apic_cluster+0x8a/0x1b9):
> >     (XEN)  cf 82 ff ff eb b7 0f 0b <0f> 0b 48 8d 05 9c fc 33 00 48 8b 0=
d a5 0a 35 00
> >     (XEN) Xen stack trace from rsp=3Dffff8302739d7e78:
> >     (XEN)    0000000000000000 00000000000000c8 0000000000000001 0000000=
000000001
> >     (XEN)    0000000000000000 ffff82d0402f1d83 ffff8302739d7fff 0000000=
0000000c8
> >     (XEN)    0000000000000001 0000000000000001 ffff82d04031adb9 0000000=
000000001
> >     (XEN)    0000000000000000 0000000000000000 0000000000000000 ffff82d=
040276677
> >     (XEN)    0000000000000000 0000000000000000 0000000000000000 0000000=
000000000
> >     (XEN)    ffff88810037c000 0000000000000001 0000000000000246 deadbee=
fdeadf00d
> >     (XEN)    0000000000000001 aaaaaaaaaaaaaaaa 0000000000000000 fffffff=
f811d130a
> >     (XEN)    deadbeefdeadf00d deadbeefdeadf00d deadbeefdeadf00d 0000010=
000000000
> >     (XEN)    ffffffff811d130a 000000000000e033 0000000000000246 ffffc90=
0400b3ef8
> >     (XEN)    000000000000e02b 000000000000beef 000000000000beef 0000000=
00000beef
> >     (XEN)    000000000000beef 0000e01000000001 ffff8302739de000 0000003=
233412000
> >     (XEN)    00000000007506e0 0000000000000000 0000000000000000 0000000=
200000000
> >     (XEN)    0000000000000002
> >     (XEN) Xen call trace:
> >     (XEN)    [<ffff82d04028862b>] R x2apic.c#init_apic_ldr_x2apic_clust=
er+0x8a/0x1b9
> >     (XEN)    [<ffff82d0402f1d83>] S setup_local_APIC+0x26/0x449
> >     (XEN)    [<ffff82d04031adb9>] S start_secondary+0x1c4/0x37a
> >     (XEN)    [<ffff82d040276677>] S __high_start+0x87/0xd0
> >     (XEN)=20
> >     (XEN)=20
> >     (XEN) ****************************************
> >     (XEN) Panic on CPU 1:
> >     (XEN) Assertion 'cpumask_test_cpu(this_cpu, per_cpu(cluster_cpus, t=
his_cpu))' failed at arch/x86/genapic/x2apic.c:38
> >     (XEN) ****************************************
>=20
> Would you mind giving the patch below a try?

Yes, this seems to fix the issue, thanks!

> Jan
>=20
> x86/x2APIC: correct cluster tracking upon CPUs going down for S3
>=20
> Downing CPUs for S3 is somewhat special: Since we can expect the system
> to come back up in exactly the same hardware configuration, per-CPU data
> for the secondary CPUs isn't de-allocated (and then cleared upon re-
> allocation when the CPUs are being brought back up). Therefore the
> cluster_cpus per-CPU pointer will retain its value for all CPUs other
> than the final one in a cluster (i.e. in particular for all CPUs in the
> same cluster as CPU0). That, however, is in conflict with the assertion
> early in init_apic_ldr_x2apic_cluster().
>=20
> Note that the issue is avoided on Intel hardware, where we park CPUs
> instead of bringing them down.

I wonder why I don't hit this issue on baremetal AMD, only on nested.
Anyway,

Tested-by: Marek Marczykowski-G=C3=B3recki <marmarek@invisiblethingslab.com>

> Extend the bypassing of the freeing to the suspend case, thus making
> suspend/resume also a tiny bit faster.
>=20
> Fixes: 2e6c8f182c9c ("x86: distinguish CPU offlining from CPU removal")
> Reported-by: Marek Marczykowski-G=C3=B3recki <marmarek@invisiblethingslab=
=2Ecom>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>=20
> --- a/xen/arch/x86/genapic/x2apic.c
> +++ b/xen/arch/x86/genapic/x2apic.c
> @@ -228,7 +228,8 @@ static int cf_check update_clusterinfo(
>      case CPU_UP_CANCELED:
>      case CPU_DEAD:
>      case CPU_REMOVE:
> -        if ( park_offline_cpus =3D=3D (action !=3D CPU_REMOVE) )
> +        if ( park_offline_cpus =3D=3D (action !=3D CPU_REMOVE) ||
> +             system_state =3D=3D SYS_STATE_suspend )
>              break;
>          if ( per_cpu(cluster_cpus, cpu) )
>          {
>=20
>=20

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

--CJd+PFfbWa/s+trf
Content-Type: application/pgp-signature; name="signature.asc"

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

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAma0xf8ACgkQ24/THMrX
1yyKrAf8Cf2bkeX0TG+0HmYpuJRkvV+kEQzoaJVu7s/pQ8FsheUNvE+U1bFLs7DG
/OvJQ2sfbIcMIeSmQ0TOHbuYSJUcRGB9vaFqilSY+oEddRHEdKTDFS0r8eOHk8JN
1Ipr8LlIeuqGulxsoNI+u2O/FeCExnyNri7Aszq8UqpmXPLkSQ+qthups/KRi/oa
7c4qhzdTjb6kGGy8qO7gamMWkMJYxaIhBaOXPisP0x/VGLs9qOB/jhkm9BB6PsLI
FFOfhdx1By6oIFDFYzdKnp68QCKaD5ORvu/WwP8vbK5d8juDJ+09aqG6P7l6gZsw
d6Xkf2dO2f9o4gNkdNFPvyo2Jyh/QA==
=eIeI
-----END PGP SIGNATURE-----

--CJd+PFfbWa/s+trf--


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:29:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:29:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774125.1184615 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3Cj-0006Z2-8N; Thu, 08 Aug 2024 13:29:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774125.1184615; Thu, 08 Aug 2024 13:29:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3Cj-0006Yv-5e; Thu, 08 Aug 2024 13:29:21 +0000
Received: by outflank-mailman (input) for mailman id 774125;
 Thu, 08 Aug 2024 13:29:20 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sc3Ci-0006Yp-5D
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:29:20 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 368055b2-558a-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 15:29:18 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-52efd08e6d9so1189284e87.1
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:29:18 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7de4e7f336sm609405266b.131.2024.08.08.06.29.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 06:29:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 368055b2-558a-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723123757; x=1723728557; 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=HlAgrS6XdkKBhn/O0Oh1VoxKIe8ryyMfJFqLOqG0LXU=;
        b=bV77sNeP+S/DclyBqhVXKfhX+IeZUJcQVfBBbEM+DGE2EyRCJBkNEztw5hoZqHu3Mf
         MpKCCxh8TTCsyAk/csOY/9q43EJdrizF+iT+wllhyLl+8f16V/1H1/WmnRy3fBgUK8rz
         UCryUgyY9iR4oWXzTT/swEcU77mhrtSNCHLq3K4tnI1xpVTjJQ+f6hfvWA5AX25cyHI8
         eL4ZAB/Sy2WLCmxoyr27TLsXCitM/DZpgQu75Klwo2NTbVRC2TaKwFWO6tMNbCiCg6FA
         HjqXanzz+6LSGHIOCi6/tYNJ91rDqM0eJ9TEPcDlbp/Y7g9CXZecaf4/8FoFI4OsuwQ2
         Qyfg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723123757; x=1723728557;
        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=HlAgrS6XdkKBhn/O0Oh1VoxKIe8ryyMfJFqLOqG0LXU=;
        b=ZdGWTDvPdrqZbN7Fvoc2aYqWrPbO7KscwB2+/ir4zD/BCnuzdjiJlwlTTdhh/P5Kgh
         +owETtDmDK+y6OVq2eIrgQqmJfUfgzeR91pFPMRIEx9hIP1xrkP1KK98m91IN1tD7HCb
         fgGsMkuygoxclQmfdyeSYLfPYZzGK1T97qEFayxLCD9tuzCCwOfmeQro1D7XuS3xXiek
         bKKhjNXeczIr7M2vm5OxZYpiDJirolklPzfVKntp6vY6IdpHgqjvGRjq2PmOpvgElfEj
         gzFZgqwZixO8S7jt97JJNFCtGPinZ7mjak/bEwGg1qnuYwBht72gr/0baMWjgTphv/9r
         GDHA==
X-Gm-Message-State: AOJu0Yy4fWXrBaBDcxTM2RbhEmJCfeuCFYwYy76sb5pvX6n+6a2koTCK
	weexeX+olFAIdqWOr1EnIkUQ3AAWWknkULylSJ+i/WNel0j+6acRB/wRpykvPA==
X-Google-Smtp-Source: AGHT+IGA12STyTFuj7v6wsPygh6br1wB6Ny2tmHCWM6nFYbC3E5UpPFpICrnw6JsB07ZzLPF3DHwmw==
X-Received: by 2002:a05:6512:400c:b0:52e:9b74:120 with SMTP id 2adb3069b0e04-530e5829a5fmr1308543e87.19.1723123757227;
        Thu, 08 Aug 2024 06:29:17 -0700 (PDT)
Message-ID: <3779cadd-7d86-4c30-b73b-ef5a9e00f03f@suse.com>
Date: Thu, 8 Aug 2024 15:29:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Assertion failed at arch/x86/genapic/x2apic.c:38 on S3 resume
 nested in KVM on AMD
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>
References: <Zp--KHAFuDVnH1Oq@mail-itl>
 <579fd84d-0a31-43b3-8ce1-f826134cd8a2@suse.com> <ZrTF_28uPHjPabn2@mail-itl>
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: <ZrTF_28uPHjPabn2@mail-itl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 08.08.2024 15:19, Marek Marczykowski-Górecki wrote:
> On Thu, Aug 08, 2024 at 01:22:30PM +0200, Jan Beulich wrote:
>> x86/x2APIC: correct cluster tracking upon CPUs going down for S3
>>
>> Downing CPUs for S3 is somewhat special: Since we can expect the system
>> to come back up in exactly the same hardware configuration, per-CPU data
>> for the secondary CPUs isn't de-allocated (and then cleared upon re-
>> allocation when the CPUs are being brought back up). Therefore the
>> cluster_cpus per-CPU pointer will retain its value for all CPUs other
>> than the final one in a cluster (i.e. in particular for all CPUs in the
>> same cluster as CPU0). That, however, is in conflict with the assertion
>> early in init_apic_ldr_x2apic_cluster().
>>
>> Note that the issue is avoided on Intel hardware, where we park CPUs
>> instead of bringing them down.
> 
> I wonder why I don't hit this issue on baremetal AMD, only on nested.

Different clustering arrangements?

> Anyway,
> 
> Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Great, thanks.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:31:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:31:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774139.1184625 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3EM-0008S9-MX; Thu, 08 Aug 2024 13:31:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774139.1184625; Thu, 08 Aug 2024 13:31:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3EM-0008S0-JL; Thu, 08 Aug 2024 13:31:02 +0000
Received: by outflank-mailman (input) for mailman id 774139;
 Thu, 08 Aug 2024 13:31:01 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sc3EL-0008Rq-49
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:31:01 +0000
Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com
 [2a00:1450:4864:20::233])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 72c74ea5-558a-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 15:30:59 +0200 (CEST)
Received: by mail-lj1-x233.google.com with SMTP id
 38308e7fff4ca-2f16d2f2b68so13222491fa.3
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:30:59 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ec8860sm731607066b.209.2024.08.08.06.30.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 06:30:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 72c74ea5-558a-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723123859; x=1723728659; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=c7yswg46iYRjmCAQDqekaVXbZBIqwIPJAVVIJjaG0+c=;
        b=Dw9czV8vXNd+f6Urp2YisuJE9iMnhpr3vwO6y6pULaqtb8tv9U6lcMaedh2HLg+guW
         BbYR3mhS0v+eHbp+vaIRGWg4/n+WwGrE+lIdTb3DjTvzLp+aiWREc8xod4Q6erWZZOEI
         DasixbedX/lIUR68lD3XfnOdKZxeaV54pSHEO5BGF/sgCaMEf2a8X947uuRhpUbZLGaX
         EZfHTJRYjhvCyCA2QV7LbuItkvSmCJnmE0895sMc4qhvgz8EePbVOteB6H6HypuWZp0I
         A4Ty0pQWwIP8GxuUDG7ZAL2YBypt+6MDL2yZ0/3r2IVcEoxaA+kKt7LaD0uGkYg78ug4
         1xjQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723123859; x=1723728659;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=c7yswg46iYRjmCAQDqekaVXbZBIqwIPJAVVIJjaG0+c=;
        b=PMa0nloKmy9Wrsf6t4Pvkj64bIon0a0v4ir/5KPZqXIUprqueSsUDvDuT/IRYA7Jk8
         hohc5tYxwjZV0z70Spx6ZNZycQfKozYhowGASxYSDyQfGQh5IFJqeGjuBE3T/gWJM0ax
         Li1DMOgUDCgo8AmOxtZCMsljid7Gdkw+1RdRe5n4puHkfm9no/fE8nzxlY2EEaGDyfCo
         36ULcXMyQis4zqt433zxFMZN3Sn/em3VPQD8iQJZyd8QC1QjLm4z/jh4wf4kYa0eWxpZ
         +50H0i9dfFAZ/B0cni7DHLmXomrwCK+kxWwDC6gK41h/T501MXfMojCg5EH7SJ7aCvvT
         3l6w==
X-Gm-Message-State: AOJu0YzZuW9jZy1WSjedTypL3V7VK3TaCy+wY4eP/vOzeiRprDGTLumd
	ovvlt0gf8CbR1FWjfO1oIehEpI57cS9iJ6Wc1Bs66MAgiy3KugKieO2cQ5MUqCdMgDSUFGrGa/4
	=
X-Google-Smtp-Source: AGHT+IFp2j1Q/KHB3Y0cT90mPoKS97XyvSAx2TSuwzQp4oqfRUfa1y8CB284P7J5K1u3evF4IZe9lw==
X-Received: by 2002:a05:651c:19a6:b0:2f1:922f:8751 with SMTP id 38308e7fff4ca-2f19dd85aa8mr20555571fa.0.1723123858519;
        Thu, 08 Aug 2024 06:30:58 -0700 (PDT)
Message-ID: <0a082833-3d52-4c9d-8ea4-5be01986cd2c@suse.com>
Date: Thu, 8 Aug 2024 15:30:58 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86/x2APIC: correct cluster tracking upon CPUs going down for
 S3
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Downing CPUs for S3 is somewhat special: Since we can expect the system
to come back up in exactly the same hardware configuration, per-CPU data
for the secondary CPUs isn't de-allocated (and then cleared upon re-
allocation when the CPUs are being brought back up). Therefore the
cluster_cpus per-CPU pointer will retain its value for all CPUs other
than the final one in a cluster (i.e. in particular for all CPUs in the
same cluster as CPU0). That, however, is in conflict with the assertion
early in init_apic_ldr_x2apic_cluster().

Note that the issue is avoided on Intel hardware, where we park CPUs
instead of bringing them down.

Extend the bypassing of the freeing to the suspend case, thus making
suspend/resume also a tiny bit faster.

Fixes: 2e6c8f182c9c ("x86: distinguish CPU offlining from CPU removal")
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -228,7 +228,8 @@ static int cf_check update_clusterinfo(
     case CPU_UP_CANCELED:
     case CPU_DEAD:
     case CPU_REMOVE:
-        if ( park_offline_cpus == (action != CPU_REMOVE) )
+        if ( park_offline_cpus == (action != CPU_REMOVE) ||
+             system_state == SYS_STATE_suspend )
             break;
         if ( per_cpu(cluster_cpus, cpu) )
         {


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:42:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:42:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774151.1184640 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3PN-0002mT-Ux; Thu, 08 Aug 2024 13:42:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774151.1184640; Thu, 08 Aug 2024 13:42:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3PN-0002lX-Qy; Thu, 08 Aug 2024 13:42:25 +0000
Received: by outflank-mailman (input) for mailman id 774151;
 Thu, 08 Aug 2024 13:42:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zgd2=PH=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sc3PM-0002jZ-Gg
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:42:24 +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 0a59fba5-558c-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 15:42:23 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5bb8e62570fso1170344a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:42:23 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bbb2d35172sm676426a12.71.2024.08.08.06.42.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 08 Aug 2024 06:42:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0a59fba5-558c-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723124542; x=1723729342; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=iSMAJrbKIJks8IvZYbCfs4ficfe6mQhEmBJARLfZWYI=;
        b=ahGvNw60o18MvNuwC9ph0jWilQucjKLLSlNJ8/oOj11VnKd6R/i1zz87Td69EfeAMi
         G/xnKaHDNGlH/o8DJJGBoBnJbQdJMBWcfZ06ywir+1BN4JfV3N283e/Ivy6Igkcihqb2
         0gYsjemwNl3+TaHtSyWKyOTpXPmOfZBzOzAzk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723124542; x=1723729342;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=iSMAJrbKIJks8IvZYbCfs4ficfe6mQhEmBJARLfZWYI=;
        b=qtfs3hlQn1wswrcvW8+VH5KO2qG1E8uCHR4Ng9m7mun1LmZrYd+UpihPSDzBS8JKes
         mZuKOHrYH0i54dcnm4taHBXp2xKrWixGADtz0u6+1ZFzj739XOhHYoRIRCp7JHggG7Jv
         XX7OxNvC+Ucia7wHt+TTyVx214dNq+e0Vbp2M8l30w2W8p8OSbtyTMe5Q6jnJdT+UQVU
         2MPtAJMPZI1PUiYNbDcVlupPnfLvQkRBfxT3SZ672C11P09kYCp+82xh/zQJ4ctNPB5a
         gz2vJQ0okL9xU0f+VXEIqpZW2hbx4H5CCN3pxL4u+sorsYpeVHHopgt0wxebHU9vgT/u
         19Xg==
X-Gm-Message-State: AOJu0YyytaWG32VL5yeWJ4ur4o6By4LA1std9Mp3L/HDsid/aJv8/bNc
	VMIslpO0AnpPTFK1g5AUVq5rs5l6NH9Y5OaR20qsEWohDj9sz2ZWUWEZGSikLcyXBKayi0grPAh
	Z
X-Google-Smtp-Source: AGHT+IGUiGSqCpH1+k8o88g8/J60vQ87PRNGPIKuAkIy08w57jyD71wTYz5Zhj1rSM6hN8gmnr2Yvw==
X-Received: by 2002:a05:6402:2108:b0:5a3:5218:5d80 with SMTP id 4fb4d7f45d1cf-5bbb233f281mr1587970a12.21.1723124542052;
        Thu, 08 Aug 2024 06:42:22 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v2 1/2] x86/fpu: Combine fpu_ctxt and xsave_area in arch_vcpu
Date: Thu,  8 Aug 2024 14:41:49 +0100
Message-ID: <20240808134150.29927-2-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240808134150.29927-1-alejandro.vallejo@cloud.com>
References: <20240808134150.29927-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

fpu_ctxt is either a pointer to the legacy x87/SSE save area (used by FXSAVE) or
a pointer aliased with xsave_area that points to its fpu_sse subfield. Such
subfield is at the base and is identical in size and layout to the legacy
buffer.

This patch merges the 2 pointers in the arch_vcpu into a single XSAVE area. In
the very rare case in which the host doesn't support XSAVE all we're doing is
wasting a tiny amount of memory and trading those for a lot more simplicity in
the code.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v2:

  * Added BUILD_BUG_ON(sizeof(x) != sizeof(fpusse_t)) on forceful casts
    involving fpusse_t.
  * Reworded comment on top of vcpu_arch->user_regs
  * Added missing whitespace in x86_emulate/blk.c
---
 xen/arch/x86/domctl.c             |  5 +++-
 xen/arch/x86/hvm/emulate.c        |  4 +--
 xen/arch/x86/hvm/hvm.c            |  5 +++-
 xen/arch/x86/i387.c               | 45 +++++--------------------------
 xen/arch/x86/include/asm/domain.h |  8 +++---
 xen/arch/x86/x86_emulate/blk.c    |  3 ++-
 xen/arch/x86/xstate.c             | 13 ++++++---
 7 files changed, 32 insertions(+), 51 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 68b5b46d1a83..bceff6be0ff3 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1344,7 +1344,10 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
 #define c(fld) (c.nat->fld)
 #endif
 
-    memcpy(&c.nat->fpu_ctxt, v->arch.fpu_ctxt, sizeof(c.nat->fpu_ctxt));
+    memcpy(&c.nat->fpu_ctxt, &v->arch.xsave_area->fpu_sse,
+           sizeof(c.nat->fpu_ctxt));
+    BUILD_BUG_ON(sizeof(c.nat->fpu_ctxt) != sizeof(fpusse_t));
+
     if ( is_pv_domain(d) )
         c(flags = v->arch.pv.vgc_flags & ~(VGCF_i387_valid|VGCF_in_kernel));
     else
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index feb4792cc567..03020542c3ba 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -2363,7 +2363,7 @@ static int cf_check hvmemul_get_fpu(
         alternative_vcall(hvm_funcs.fpu_dirty_intercept);
     else if ( type == X86EMUL_FPU_fpu )
     {
-        const fpusse_t *fpu_ctxt = curr->arch.fpu_ctxt;
+        const fpusse_t *fpu_ctxt = &curr->arch.xsave_area->fpu_sse;
 
         /*
          * Latch current register state so that we can back out changes
@@ -2403,7 +2403,7 @@ static void cf_check hvmemul_put_fpu(
 
     if ( aux )
     {
-        fpusse_t *fpu_ctxt = curr->arch.fpu_ctxt;
+        fpusse_t *fpu_ctxt = &curr->arch.xsave_area->fpu_sse;
         bool dval = aux->dval;
         int mode = hvm_guest_x86_mode(curr);
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index f49e29faf753..6607dba562a4 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -916,7 +916,10 @@ static int cf_check hvm_save_cpu_ctxt(struct vcpu *v, hvm_domain_context_t *h)
 
     if ( v->fpu_initialised )
     {
-        memcpy(ctxt.fpu_regs, v->arch.fpu_ctxt, sizeof(ctxt.fpu_regs));
+        memcpy(ctxt.fpu_regs, &v->arch.xsave_area->fpu_sse,
+               sizeof(ctxt.fpu_regs));
+        BUILD_BUG_ON(sizeof(ctxt.fpu_regs) != sizeof(fpusse_t));
+
         ctxt.flags = XEN_X86_FPU_INITIALISED;
     }
 
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 134e0bece519..fbb9d3584a3d 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -39,7 +39,7 @@ static inline void fpu_xrstor(struct vcpu *v, uint64_t mask)
 /* Restore x87 FPU, MMX, SSE and SSE2 state */
 static inline void fpu_fxrstor(struct vcpu *v)
 {
-    const fpusse_t *fpu_ctxt = v->arch.fpu_ctxt;
+    const fpusse_t *fpu_ctxt = &v->arch.xsave_area->fpu_sse;
 
     /*
      * Some CPUs don't save/restore FDP/FIP/FOP unless an exception
@@ -151,7 +151,7 @@ static inline void fpu_xsave(struct vcpu *v)
 /* Save x87 FPU, MMX, SSE and SSE2 state */
 static inline void fpu_fxsave(struct vcpu *v)
 {
-    fpusse_t *fpu_ctxt = v->arch.fpu_ctxt;
+    fpusse_t *fpu_ctxt = &v->arch.xsave_area->fpu_sse;
     unsigned int fip_width = v->domain->arch.x87_fip_width;
 
     if ( fip_width != 4 )
@@ -212,7 +212,7 @@ void vcpu_restore_fpu_nonlazy(struct vcpu *v, bool need_stts)
      * above) we also need to restore full state, to prevent subsequently
      * saving state belonging to another vCPU.
      */
-    if ( v->arch.fully_eager_fpu || (v->arch.xsave_area && xstate_all(v)) )
+    if ( v->arch.fully_eager_fpu || xstate_all(v) )
     {
         if ( cpu_has_xsave )
             fpu_xrstor(v, XSTATE_ALL);
@@ -299,44 +299,14 @@ void save_fpu_enable(void)
 /* Initialize FPU's context save area */
 int vcpu_init_fpu(struct vcpu *v)
 {
-    int rc;
-
     v->arch.fully_eager_fpu = opt_eager_fpu;
-
-    if ( (rc = xstate_alloc_save_area(v)) != 0 )
-        return rc;
-
-    if ( v->arch.xsave_area )
-        v->arch.fpu_ctxt = &v->arch.xsave_area->fpu_sse;
-    else
-    {
-        BUILD_BUG_ON(__alignof(v->arch.xsave_area->fpu_sse) < 16);
-        v->arch.fpu_ctxt = _xzalloc(sizeof(v->arch.xsave_area->fpu_sse),
-                                    __alignof(v->arch.xsave_area->fpu_sse));
-        if ( v->arch.fpu_ctxt )
-        {
-            fpusse_t *fpu_sse = v->arch.fpu_ctxt;
-
-            fpu_sse->fcw = FCW_DEFAULT;
-            fpu_sse->mxcsr = MXCSR_DEFAULT;
-        }
-        else
-            rc = -ENOMEM;
-    }
-
-    return rc;
+    return xstate_alloc_save_area(v);
 }
 
 void vcpu_setup_fpu(struct vcpu *v, struct xsave_struct *xsave_area,
                     const void *data, unsigned int fcw_default)
 {
-    /*
-     * For the entire function please note that vcpu_init_fpu() (above) points
-     * v->arch.fpu_ctxt into v->arch.xsave_area when XSAVE is available. Hence
-     * accesses through both pointers alias one another, and the shorter form
-     * is used here.
-     */
-    fpusse_t *fpu_sse = v->arch.fpu_ctxt;
+    fpusse_t *fpu_sse = &v->arch.xsave_area->fpu_sse;
 
     ASSERT(!xsave_area || xsave_area == v->arch.xsave_area);
 
@@ -373,10 +343,7 @@ void vcpu_setup_fpu(struct vcpu *v, struct xsave_struct *xsave_area,
 /* Free FPU's context save area */
 void vcpu_destroy_fpu(struct vcpu *v)
 {
-    if ( v->arch.xsave_area )
-        xstate_free_save_area(v);
-    else
-        xfree(v->arch.fpu_ctxt);
+    xstate_free_save_area(v);
 }
 
 /*
diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index bca3258d69ac..3da60af2a44a 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -592,11 +592,11 @@ struct pv_vcpu
 struct arch_vcpu
 {
     /*
-     * guest context (mirroring struct vcpu_guest_context) common
-     * between pv and hvm guests
+     * Guest context common between PV and HVM guests. Includes general purpose
+     * registers, segment registers and other parts of the exception frame.
+     *
+     * It doesn't contain FPU state, as that lives in xsave_area instead.
      */
-
-    void              *fpu_ctxt;
     struct cpu_user_regs user_regs;
 
     /* Debug registers. */
diff --git a/xen/arch/x86/x86_emulate/blk.c b/xen/arch/x86/x86_emulate/blk.c
index e790f4f90056..28b54f26fe29 100644
--- a/xen/arch/x86/x86_emulate/blk.c
+++ b/xen/arch/x86/x86_emulate/blk.c
@@ -11,7 +11,8 @@
     !defined(X86EMUL_NO_SIMD)
 # ifdef __XEN__
 #  include <asm/xstate.h>
-#  define FXSAVE_AREA current->arch.fpu_ctxt
+#  define FXSAVE_AREA ((struct x86_fxsr *) \
+                           (void *)&current->arch.xsave_area->fpu_sse)
 # else
 #  define FXSAVE_AREA get_fpu_save_area()
 # endif
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 5c4144d55e89..850ee31bd18c 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -507,9 +507,16 @@ int xstate_alloc_save_area(struct vcpu *v)
     unsigned int size;
 
     if ( !cpu_has_xsave )
-        return 0;
-
-    if ( !is_idle_vcpu(v) || !cpu_has_xsavec )
+    {
+        /*
+         * This is bigger than FXSAVE_SIZE by 64 bytes, but it helps treating
+         * the FPU state uniformly as an XSAVE buffer even if XSAVE is not
+         * available in the host. Note the alignment restriction of the XSAVE
+         * area are stricter than those of the FXSAVE area.
+         */
+        size = XSTATE_AREA_MIN_SIZE;
+    }
+    else if ( !is_idle_vcpu(v) || !cpu_has_xsavec )
     {
         size = xsave_cntxt_size;
         BUG_ON(size < XSTATE_AREA_MIN_SIZE);
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:42:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:42:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774152.1184647 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3PO-0002u3-Ay; Thu, 08 Aug 2024 13:42:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774152.1184647; Thu, 08 Aug 2024 13:42:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3PO-0002sL-3b; Thu, 08 Aug 2024 13:42:26 +0000
Received: by outflank-mailman (input) for mailman id 774152;
 Thu, 08 Aug 2024 13:42:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zgd2=PH=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sc3PM-0002jZ-Uj
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:42:24 +0000
Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com
 [2a00:1450:4864:20::52a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0b106731-558c-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 15:42:24 +0200 (CEST)
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-5b8c2a6135dso1308792a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:42:24 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bbb2d35172sm676426a12.71.2024.08.08.06.42.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 08 Aug 2024 06:42:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0b106731-558c-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723124543; x=1723729343; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=BwRkrDUsnDDc1HKYet7Tp7o3hYwj8I4tk9q0yVqzszQ=;
        b=TdwrDRqg+IVcDuFKM3p7ZotyXu6Tj6gIKTl+fgM+mhs2j2FVKp3a9JLvUhpDRzO/IH
         4UO49iVEir8UDSaIsSdxce12K4gV5CdogzR8rL1iDpWu4ZZkrNNTCdiueBHDO1qIyBsp
         s6BbQKCeMoDuCTFEcpX6kHCRMJM6LYgM095n8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723124543; x=1723729343;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=BwRkrDUsnDDc1HKYet7Tp7o3hYwj8I4tk9q0yVqzszQ=;
        b=Ut5FKnapOuk9QBrwHig0D4GsVg+MA/XPitZBSo4z1r3b/mTYxmkiiEqXolhw8cCQVa
         N3Q2VHvt3VvPuxIDfqXsjNm6groWwTp2yrvq3bOjRDb8ebN99i4RRTdJOrUsKrkeb8dL
         vajaIqr8vAyaLhztJWNwjjYBLf06k+SHvm9ax7/9jyb/DIW/7AHa/gxr4geAVPlUL3fQ
         WjoHfaKRI4a58lMrt6twPvH45NBD9QJBvbVBSpcQ3o35mcYjxqjsOvIBhrL28KvDM9m1
         zmiC45xOlIi6v1jEEG9zXBmXrhzS4yVOVY9BbMpl02eQ9OLFKQFieP30MZzJe1++Vsig
         fspg==
X-Gm-Message-State: AOJu0Yx2XZpPW5gre56Aa99+a3SeVeXIuA9dNBWkBQVfNOVjiY50f/QN
	lcBUchua49+Ux/FXjs90wmujgf+E5lRtP7rBoWXZnRix9LL6bs5obC4UsrJ/DnfteJDNdoscxzi
	H
X-Google-Smtp-Source: AGHT+IFDlS+F7uKLxzrgTijdmiqpplkXz8gvxBeDAwkAnMvGtlIBNWE5icxfplXQXacuAwrTaPqKmg==
X-Received: by 2002:a05:6402:3591:b0:5af:e7d1:9532 with SMTP id 4fb4d7f45d1cf-5bbb2196e12mr1342204a12.8.1723124543197;
        Thu, 08 Aug 2024 06:42:23 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v2 2/2] x86/fpu: Split fpu_setup_fpu() in two
Date: Thu,  8 Aug 2024 14:41:50 +0100
Message-ID: <20240808134150.29927-3-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240808134150.29927-1-alejandro.vallejo@cloud.com>
References: <20240808134150.29927-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

It was trying to do too many things at once and there was no clear way of
defining what it was meant to do.This commit splits the function in two.

  1. A reset function, parameterized by the FCW value. FCW_RESET means to reset
     the state to power-on reset values, while FCW_DEFAULT means to reset to the
     default values present during vCPU creation.
  2. A x87/SSE state loader (equivalent to the old function when it took a data
     pointer).

While at it, make sure the abridged tag is consistent with the manuals and
start as 0xFF.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v2:

  * Reworded comment about pre-Xen 4.1 migrations.
  * Reset abridged FTW to -1 (tag=0x5555), as per the manuals.
  * Undo const cast-away.
  * Split vcpu_reset_fpu() into vcpu_default_fpu()
    * vcpu_init_fpu() already exists.
  * Removed backticks from comments
---
 xen/arch/x86/domain.c             |  7 ++--
 xen/arch/x86/hvm/hvm.c            | 27 ++++++++++----
 xen/arch/x86/i387.c               | 60 +++++++++++++++----------------
 xen/arch/x86/include/asm/i387.h   | 28 ++++++++++++---
 xen/arch/x86/include/asm/xstate.h |  1 +
 5 files changed, 77 insertions(+), 46 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index d977ec71ca20..5af9e3e7a8b4 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1186,9 +1186,10 @@ int arch_set_info_guest(
          is_pv_64bit_domain(d) )
         v->arch.flags &= ~TF_kernel_mode;
 
-    vcpu_setup_fpu(v, v->arch.xsave_area,
-                   flags & VGCF_I387_VALID ? &c.nat->fpu_ctxt : NULL,
-                   FCW_DEFAULT);
+    if ( flags & VGCF_I387_VALID )
+        vcpu_setup_fpu(v, &c.nat->fpu_ctxt);
+    else
+        vcpu_default_fpu(v);
 
     if ( !compat )
     {
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6607dba562a4..83cb21884ce6 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1164,10 +1164,25 @@ static int cf_check hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     seg.attr = ctxt.ldtr_arbytes;
     hvm_set_segment_register(v, x86_seg_ldtr, &seg);
 
-    /* Cover xsave-absent save file restoration on xsave-capable host. */
-    vcpu_setup_fpu(v, xsave_enabled(v) ? NULL : v->arch.xsave_area,
-                   ctxt.flags & XEN_X86_FPU_INITIALISED ? ctxt.fpu_regs : NULL,
-                   FCW_RESET);
+    /*
+     * On Xen 4.1 and later the FPU state is restored on later HVM context in
+     * the migrate stream, so what we're doing here is initialising the FPU
+     * state for guests from even older versions of Xen.
+     *
+     * In particular:
+     *   1. If there's an XSAVE context later in the stream what we do here for
+     *      the FPU doesn't matter because it'll be overriden later.
+     *   2. If there isn't and the guest didn't use extended states it's still
+     *      fine because we have all the information we need here.
+     *   3. If there isn't and the guest DID use extended states (could've
+     *      happened prior to Xen 4.1) then we're in a pickle because we have
+     *      to make up non-existing state. For this case we initialise the FPU
+     *      as using x87/SSE only because the rest of the state is gone.
+     */
+    if ( ctxt.flags & XEN_X86_FPU_INITIALISED )
+        vcpu_setup_fpu(v, &ctxt.fpu_regs);
+    else
+        vcpu_reset_fpu(v);
 
     v->arch.user_regs.rax = ctxt.rax;
     v->arch.user_regs.rbx = ctxt.rbx;
@@ -4007,9 +4022,7 @@ void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip)
         v->arch.guest_table = pagetable_null();
     }
 
-    if ( v->arch.xsave_area )
-        v->arch.xsave_area->xsave_hdr.xstate_bv = 0;
-    vcpu_setup_fpu(v, v->arch.xsave_area, NULL, FCW_RESET);
+    vcpu_reset_fpu(v);
 
     arch_vcpu_regs_init(v);
     v->arch.user_regs.rip = ip;
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index fbb9d3584a3d..af5ae805998a 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -303,41 +303,37 @@ int vcpu_init_fpu(struct vcpu *v)
     return xstate_alloc_save_area(v);
 }
 
-void vcpu_setup_fpu(struct vcpu *v, struct xsave_struct *xsave_area,
-                    const void *data, unsigned int fcw_default)
+void vcpu_reset_fpu(struct vcpu *v)
 {
-    fpusse_t *fpu_sse = &v->arch.xsave_area->fpu_sse;
-
-    ASSERT(!xsave_area || xsave_area == v->arch.xsave_area);
-
-    v->fpu_initialised = !!data;
+    v->fpu_initialised = false;
+    *v->arch.xsave_area = (struct xsave_struct) {
+        .fpu_sse = {
+            .mxcsr = MXCSR_DEFAULT,
+            .fcw = FCW_RESET,
+            .ftw = FTW_RESET,
+        },
+        .xsave_hdr.xstate_bv = fcw == X86_XCR0_X87,
+    };
+}
 
-    if ( data )
-    {
-        memcpy(fpu_sse, data, sizeof(*fpu_sse));
-        if ( xsave_area )
-            xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
-    }
-    else if ( xsave_area && fcw_default == FCW_DEFAULT )
-    {
-        xsave_area->xsave_hdr.xstate_bv = 0;
-        fpu_sse->mxcsr = MXCSR_DEFAULT;
-    }
-    else
-    {
-        memset(fpu_sse, 0, sizeof(*fpu_sse));
-        fpu_sse->fcw = fcw_default;
-        fpu_sse->mxcsr = MXCSR_DEFAULT;
-        if ( v->arch.xsave_area )
-        {
-            v->arch.xsave_area->xsave_hdr.xstate_bv &= ~XSTATE_FP_SSE;
-            if ( fcw_default != FCW_DEFAULT )
-                v->arch.xsave_area->xsave_hdr.xstate_bv |= X86_XCR0_X87;
-        }
-    }
+void vcpu_default_fpu(struct vcpu *v)
+{
+    v->fpu_initialised = false;
+    *v->arch.xsave_area = (struct xsave_struct) {
+        .fpu_sse = {
+            .mxcsr = MXCSR_DEFAULT,
+            .fcw = FCW_DEFAULT,
+        },
+    };
+}
 
-    if ( xsave_area )
-        xsave_area->xsave_hdr.xcomp_bv = 0;
+void vcpu_setup_fpu(struct vcpu *v, const void *data)
+{
+    v->fpu_initialised = true;
+    *v->arch.xsave_area = (struct xsave_struct) {
+        .fpu_sse = *(const fpusse_t*)data,
+        .xsave_hdr.xstate_bv = XSTATE_FP_SSE,
+    };
 }
 
 /* Free FPU's context save area */
diff --git a/xen/arch/x86/include/asm/i387.h b/xen/arch/x86/include/asm/i387.h
index a783549db991..7a69577de45b 100644
--- a/xen/arch/x86/include/asm/i387.h
+++ b/xen/arch/x86/include/asm/i387.h
@@ -31,10 +31,30 @@ void vcpu_restore_fpu_nonlazy(struct vcpu *v, bool need_stts);
 void vcpu_restore_fpu_lazy(struct vcpu *v);
 void vcpu_save_fpu(struct vcpu *v);
 void save_fpu_enable(void);
-
 int vcpu_init_fpu(struct vcpu *v);
-struct xsave_struct;
-void vcpu_setup_fpu(struct vcpu *v, struct xsave_struct *xsave_area,
-                    const void *data, unsigned int fcw_default);
 void vcpu_destroy_fpu(struct vcpu *v);
+
+/*
+ * Restore v's FPU to power-on reset values
+ *
+ * @param v vCPU containing the FPU
+ */
+void vcpu_reset_fpu(struct vcpu *v);
+
+/*
+ * Restore v's FPU to default values
+ *
+ * @param v vCPU containing the FPU
+ */
+void vcpu_default_fpu(struct vcpu *v);
+
+/*
+ * Load x87/SSE state into v's FPU
+ *
+ * Overrides the XSAVE header to set the state components to be x87 and SSE.
+ *
+ * @param v    vCPU containing the FPU
+ * @param data 512-octet blob for x87/SSE state
+ */
+void vcpu_setup_fpu(struct vcpu *v, const void *data);
 #endif /* __ASM_I386_I387_H */
diff --git a/xen/arch/x86/include/asm/xstate.h b/xen/arch/x86/include/asm/xstate.h
index ebeb2a3dcaf9..6144ed6f8551 100644
--- a/xen/arch/x86/include/asm/xstate.h
+++ b/xen/arch/x86/include/asm/xstate.h
@@ -14,6 +14,7 @@
 
 #define FCW_DEFAULT               0x037f
 #define FCW_RESET                 0x0040
+#define FTW_RESET                 0xFF
 #define MXCSR_DEFAULT             0x1f80
 
 extern uint32_t mxcsr_mask;
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:42:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:42:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774150.1184635 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3PN-0002jw-Mp; Thu, 08 Aug 2024 13:42:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774150.1184635; Thu, 08 Aug 2024 13:42:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3PN-0002jp-Jd; Thu, 08 Aug 2024 13:42:25 +0000
Received: by outflank-mailman (input) for mailman id 774150;
 Thu, 08 Aug 2024 13:42:24 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zgd2=PH=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sc3PM-0002jZ-7t
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:42:24 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 09b6ef68-558c-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 15:42:21 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5af6a1afa63so1102741a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:42:21 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bbb2d35172sm676426a12.71.2024.08.08.06.42.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 08 Aug 2024 06:42:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 09b6ef68-558c-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723124541; x=1723729341; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=2MlJshlEfP0trY6z6ni4t134T1UGkAtWOQ6+tmU3qqA=;
        b=dB/OLh6VoT+XDc1bJz29jtcH5gIorUceDSMEu1HseGWrGZV5YtoJ26OLh3cIC5RePp
         PPDT6fyrE0TDDGO+tgL+GsdKZpFNahf3QDM/CZLEo9Aa33WQipmL8fuwjQCeAt2qin7Q
         u/beXyP9XNV5qw8CCmZrwiDmPI/mkaII8kiUc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723124541; x=1723729341;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=2MlJshlEfP0trY6z6ni4t134T1UGkAtWOQ6+tmU3qqA=;
        b=L4wvW7vPNiyZTKM5uq4A9AaKNfrMmR+EsewapMlQ/vB5K2srmnw9f1L6KE0zqvn0Oe
         DEC9PhIXcYMTQie4iT5VjHfXAaB9C5RMwDZDdpuBwh8MtQs6lY7dlatAOn1UySIN/+eH
         6qHricGsl/q59wVnpsYWvd1gjasgkwwY7bsVoMZkuDk7V1JR6lGy13s4YfsUTBC8hFdE
         FwTYnddPiQ0BrbQsU6ZG5mhaTpuj+l0fz0ARVNUDBO1+Fs8cgjtE/hFdW5LbmtfZV3kC
         kKBCEqEpwArR0SWVjD6kT8g4B+fvi/HQam7T9h094hl4JD9DH5LrqEs+pfysIi3TKXB9
         z/yQ==
X-Gm-Message-State: AOJu0Yy7LN1ProotY1ksGxdo6Zmqo/q+723GBIC2bJbEVM6Yps2fTHV0
	5J5b4S2vaRw0ZUIx+TNUA7shggySAnXJO1nSZtmjqKsawTIRdlfE3opV1Y8wiqmoyCZ4XlV2j3V
	r
X-Google-Smtp-Source: AGHT+IHfcqTL90dQMaU3Kx0X0/vpRT9flDokxYDyPhTTIMLffpxe/phPQd6Lfda81irQIKyShmRG3Q==
X-Received: by 2002:a05:6402:3583:b0:5a2:447b:2143 with SMTP id 4fb4d7f45d1cf-5bbb2218f4dmr1504228a12.10.1723124541078;
        Thu, 08 Aug 2024 06:42:21 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v2 0/2] x86: FPU handling cleanup
Date: Thu,  8 Aug 2024 14:41:48 +0100
Message-ID: <20240808134150.29927-1-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

v1: https://lore.kernel.org/xen-devel/cover.1720538832.git.alejandro.vallejo@cloud.com/T/#t
v1 -> v2: v1/patch1 and v1/patch2 are already in staging.

=============================== Original cover letter =========================
I want to eventually reach a position in which the FPU state can be allocated
from the domheap and hidden via the same core mechanism proposed in Elias'
directmap removal series. Doing so is complicated by the presence of 2 aliased
pointers (v->arch.fpu_ctxt and v->arch.xsave_area) and the rather complicated
semantics of vcpu_setup_fpu(). This series tries to simplify the code so moving
to a "map/modify/unmap" model is more tractable.

Patches 1 and 2 are trivial refactors.

Patch 3 unifies FPU state so an XSAVE area is allocated per vCPU regardless of
the host supporting it or not. The rationale is that the memory savings are
negligible and not worth the extra complexity.

Patch 4 is a non-trivial split of the vcpu_setup_fpu() into 2 separate
functions. One to override x87/SSE state, and another to set a reset state.
===============================================================================

Alejandro Vallejo (2):
  x86/fpu: Combine fpu_ctxt and xsave_area in arch_vcpu
  x86/fpu: Split fpu_setup_fpu() in two

 xen/arch/x86/domain.c             |   7 +-
 xen/arch/x86/domctl.c             |   5 +-
 xen/arch/x86/hvm/emulate.c        |   4 +-
 xen/arch/x86/hvm/hvm.c            |  32 +++++++---
 xen/arch/x86/i387.c               | 103 ++++++++++--------------------
 xen/arch/x86/include/asm/domain.h |   8 +--
 xen/arch/x86/include/asm/i387.h   |  28 ++++++--
 xen/arch/x86/include/asm/xstate.h |   1 +
 xen/arch/x86/x86_emulate/blk.c    |   3 +-
 xen/arch/x86/xstate.c             |  13 +++-
 10 files changed, 108 insertions(+), 96 deletions(-)

-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:42:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:42:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774172.1184665 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3Pv-0004Dw-Ll; Thu, 08 Aug 2024 13:42:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774172.1184665; Thu, 08 Aug 2024 13: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 <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3Pv-0004Do-J5; Thu, 08 Aug 2024 13:42:59 +0000
Received: by outflank-mailman (input) for mailman id 774172;
 Thu, 08 Aug 2024 13:42: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=zgd2=PH=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sc3Pu-0002jZ-K9
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:42:58 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1f3ff6fa-558c-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 15:42:58 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a7d89bb07e7so127096966b.3
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:42:58 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ecb551sm741537166b.223.2024.08.08.06.42.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 08 Aug 2024 06:42:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1f3ff6fa-558c-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723124577; x=1723729377; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=3uKc4D/FCmujJpSYe6Bi/Q/cwgGcN1SIl98HqfdDNIU=;
        b=j3VjLwcFLMsopbU9tHf4Byue+gDPit1w+gvBhAAlNj0trC6LKwzUHae7Fz6Yx6ZT0q
         LnWA2b9L9jPYL5PYupLrHMmDciiiqsKeJ1mhyNRXc1Udw4d/J46QttkMI+XeNZxRY3oF
         stzFgApwCPlMhXG7LLLE8vRWYIphDvaVn5PeY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723124577; x=1723729377;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=3uKc4D/FCmujJpSYe6Bi/Q/cwgGcN1SIl98HqfdDNIU=;
        b=SqLUNZt0Ffx1OSb8EatbzuT5E1FOZ/GqQZanSMPVUiYbS3RSru7LDTDjXrxF6wFsUB
         Q1d3s3vwXXlWVg9a2LWx6YYAhi3b/5Uq4CsIV/R4JlhSp0GpvUm6ks2umqOczlQ0SCqU
         +7RkZA3R0Ig4YynH5kHY8Z6ND3NZ4kro4FOwjcPwNwPhJeqAmF9lKTxdB6qVoCyrgtwd
         Szl2wJOECpiVq6I1sDHchKkrci9aY+awt0bAvVvVOKO9V70hHRCOmsHeILH3EVJs2Qfd
         drXjGap++YipEm4nJHz2JXx+Jw3KRbhgpDizIimOW0ygCd6jhF+MH3NAF0ypp5hPYn94
         tbAA==
X-Gm-Message-State: AOJu0YwNVmpAd61PvAiKnDVqDZZkeMFNhtr04MDbwEuwOD2CAzA3YQl6
	8sHkEbGR8GGZwbXumz2PQt3kk/5Rwbta3D3r9cjLrqUVsUpHBOdEeTz7OWdV158vViWy1SyR1I7
	B
X-Google-Smtp-Source: AGHT+IFfFhFaLf1ArmgnvJU2ePQ6v9ViJlwrPDJl5nizABtj7PAsREdAazV3vZO4vx70PKKP/ds9IQ==
X-Received: by 2002:a17:907:d2da:b0:a72:8762:1f5d with SMTP id a640c23a62f3a-a8090e9e1ecmr147267966b.55.1723124577270;
        Thu, 08 Aug 2024 06:42:57 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH v5 01/10] tools/hvmloader: Fix non-deterministic cpuid()
Date: Thu,  8 Aug 2024 14:42:41 +0100
Message-ID: <20240808134251.29995-2-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
References: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

hvmloader's cpuid() implementation deviates from Xen's in that the value
passed on ecx is unspecified. This means that when used on leaves that
implement subleaves it's unspecified which one you get; though it's more
than likely an invalid one.

Import Xen's implementation so there are no surprises.

Fixes: 318ac791f9f9 ("Add utilities needed for SMBIOS generation to
hvmloader")
Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v5:
  * Added Fixes tag
  * Cosmetic changes to static inline, as proposed by Andrew
---
 tools/firmware/hvmloader/util.c |  9 ---------
 tools/firmware/hvmloader/util.h | 27 ++++++++++++++++++++++++---
 2 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index c34f077b38e3..d3b3f9038e64 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -267,15 +267,6 @@ memcmp(const void *s1, const void *s2, unsigned n)
     return 0;
 }
 
-void
-cpuid(uint32_t idx, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
-{
-    asm volatile (
-        "cpuid"
-        : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
-        : "0" (idx) );
-}
-
 static const char hex_digits[] = "0123456789abcdef";
 
 /* Write a two-character hex representation of 'byte' to digits[].
diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index deb823a892ef..e53a36476b70 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -184,9 +184,30 @@ int uart_exists(uint16_t uart_base);
 int lpt_exists(uint16_t lpt_base);
 int hpet_exists(unsigned long hpet_base);
 
-/* Do cpuid instruction, with operation 'idx' */
-void cpuid(uint32_t idx, uint32_t *eax, uint32_t *ebx,
-           uint32_t *ecx, uint32_t *edx);
+/* Some CPUID calls want 'count' to be placed in ecx */
+static inline void cpuid_count(
+    uint32_t leaf,
+    uint32_t subleaf,
+    uint32_t *eax,
+    uint32_t *ebx,
+    uint32_t *ecx,
+    uint32_t *edx)
+{
+    asm volatile ( "cpuid"
+          : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
+          : "a" (leaf), "c" (subleaf) );
+}
+
+/* Generic CPUID function (subleaf 0) */
+static inline void cpuid(
+    uint32_t leaf,
+    uint32_t *eax,
+    uint32_t *ebx,
+    uint32_t *ecx,
+    uint32_t *edx)
+{
+    cpuid_count(leaf, 0, eax, ebx, ecx, edx);
+}
 
 /* Read the TSC register. */
 static inline uint64_t rdtsc(void)
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:43:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:43:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774174.1184669 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3Pv-0004Gt-W5; Thu, 08 Aug 2024 13:42:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774174.1184669; Thu, 08 Aug 2024 13: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 <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3Pv-0004Fz-S8; Thu, 08 Aug 2024 13:42:59 +0000
Received: by outflank-mailman (input) for mailman id 774174;
 Thu, 08 Aug 2024 13:42:59 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zgd2=PH=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sc3Pv-0003nA-6e
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:42:59 +0000
Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com
 [2a00:1450:4864:20::531])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1eb51c58-558c-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 15:42:57 +0200 (CEST)
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5ba482282d3so1224365a12.2
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:42:57 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ecb551sm741537166b.223.2024.08.08.06.42.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 08 Aug 2024 06:42:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1eb51c58-558c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723124576; x=1723729376; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=Fb/fRv85bmmzcw32Yc/Ue08IVIw7Vq5Y7ll2+BR/9Uk=;
        b=e2+q+6yq0I+x/+XbsxmoIY52DJs6is4SitORHITuVIYoSn5OVZcd4pRp7Ai/idunia
         cSCKa1pSpCPgvPMipn0/usfl67B3kx80VhuYL+LRLRZoLgRMhMCog4U2nKxyLAOhHM6u
         20Z7ziTLpYPJjz5erbnozQl6CxnK1HUoFGrLg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723124576; x=1723729376;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=Fb/fRv85bmmzcw32Yc/Ue08IVIw7Vq5Y7ll2+BR/9Uk=;
        b=P4UNcSR8ynGBc0OnpV+txKb4awDPciyu67EM6ckKJ4QoQQ6nzifd8yAcqGm6toj799
         harmZqK8zpQQK5u5x6SMt2X8UJpl42zk4C/LHQxFpuwjyXaG3/sFbWO9Vb8higYVFDTf
         rVlzgSThylcu15ntumSJKpqEPW9lTVbRncdCxRUSZnz9vrJVQez3p4f/VeVU0epDGMRC
         LzABH8Ay5bL5jFy3YIxpC0LAnGyJdLzGu2Bwj1kHk+NDwmLNReoCxIK5JZutWXgYWokh
         EQSre0yQ+QxgHJYTRyMMoOhZuu9B0Qj9/3NzALohSUW4SNxxBL1WixV42ncj2fHv2G08
         s/bQ==
X-Gm-Message-State: AOJu0Yz0qyZqzWPw4OL6LrNWnCvIXev/lpzkp8kux31/YZuD3PjhhVEr
	llNJv3FwiL2mGE4c8nA5+mlbIoi2xtZXHk2NY9RVnwwc6D782FIeUSLp2Uy7ks4QI5djjdcWBD6
	m
X-Google-Smtp-Source: AGHT+IHLtttzCdCkGNj2BX5U8XHopsFwEsu9dCSpnGXIcoWGN/M3EFkkYC6Wwmt0B7acelDAldbmPQ==
X-Received: by 2002:a17:907:efe8:b0:a7a:a3db:c7b3 with SMTP id a640c23a62f3a-a8090c7ea28mr126181866b.19.1723124576326;
        Thu, 08 Aug 2024 06:42:56 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v5 00/10] x86: Expose consistent topology to guests
Date: Thu,  8 Aug 2024 14:42:40 +0100
Message-ID: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

v4 -> v5:

Largely unchanged and resent for review after the 4.20 dev cycle started.

  * Addressed Andrew's nits in v4/patch1
  * Addressed Jan's concern with MTRR overrides in v4/patch6 by keeping the
    same MTRR data in the vCPU contexts for HVM domain creations.

v4: https://lore.kernel.org/xen-devel/cover.1719416329.git.alejandro.vallejo@cloud.com/
v3 -> v4:

  * Fixed cpuid() bug in hvmloader, causing UB in v3
  * Fixed a bogus assert in hvmloader, also causing a crash in v3
  * Used HVM contexts rather than sync'd algos between Xen and toolstack in
    order to initialise the per-vCPU LAPIC state.
  * Formatting asjustments.

v3: https://lore.kernel.org/xen-devel/cover.1716976271.git.alejandro.vallejo@cloud.com/
v2 -> v3:

  (v2/patch2 and v2/patch4 are already committed)

  * Moved the vlapic check hook addition to v3/patch1
    * And created a check hook for the architectural state too for consistency.
  * Fixed migrations from Xen <= 4.13 by reconstructing the previous topology.
  * Correctly set the APIC ID after a policy change when vlapic is already in
    x2APIC mode.
  * Removed bogus assumption introduced in v1 and v2 on hvmloader about which
    8bit APIC IDs represent ids > 254. (it's "id % 0xff", not "min(id, 0xff)".
        * Used an x2apic flag check instead.
  * Various formatting adjustments.

v2: https://lore.kernel.org/xen-devel/cover.1715102098.git.alejandro.vallejo@cloud.com/
v1 -> v2:

  * v1/patch 4 replaced by a different strategy (See patches 4 and 5 in v2):
      * Have hvmloader populate MADT with the real APIC IDs as read by the APs
        themselves rather than giving it knowledge on how to derive them.
  * Removed patches 2 and 3 in v1, as no longer relevant.
  * Split v1/patch6 in two parts ((a) creating the generator and (b) plugging it
    in) and use the generator in the unit tests of the vcpuid->apicid mapping
    function. Becomes patches 6 and 8 in v2.

  Patch 1: Same as v1/patch1.
  Patch 2: Header dependency cleanup in preparation for patch3.
  Patch 3: Adds vlapic_hidden check for the newly introduced reserved area.
  Patch 4: [hvmloader] Replaces INIT+SIPI+SIPI sequences with hypercalls.
  Patch 5: [hvmloader] Retrieve the per-CPU APIC IDs from the APs themselves.
  Patch 6: Split from v1/patch6.
  Patch 7: Logically matching v1/patch5, but using v2/patch6 for testing.
  Patch 8: Split from v1/patch6.

v1: https://lore.kernel.org/xen-devel/20240109153834.4192-1-alejandro.vallejo@cloud.com/
=== Original cover letter ===

Current topology handling is close to non-existent. As things stand, APIC
IDs are allocated through the apic_id=vcpu_id*2 relation without giving any
hints to the OS on how to parse the x2APIC ID of a given CPU and assuming
the guest will assume 2 threads per core.

This series involves bringing x2APIC IDs into the migration stream, so
older guests keep operating as they used to and enhancing Xen+toolstack so
new guests get topology information consistent with their x2APIC IDs. As a
side effect of this, x2APIC IDs are now packed and don't have (unless under
a pathological case) gaps.

Further work ought to allow combining this topology configurations with
gang-scheduling of guest hyperthreads into affine physical hyperthreads.
For the time being it purposefully keeps the configuration of "1 socket" +
"1 thread per core" + "1 core per vCPU".

Patch 1: Includes x2APIC IDs in the migration stream. This allows Xen to
         reconstruct the right x2APIC IDs on migrated-in guests, and
         future-proofs itself in the face of x2APIC ID derivation changes.
Patch 2: Minor refactor to expose xc_cpu_policy in libxl
Patch 3: Refactors xen/lib/x86 to work on non-Xen freestanding environments
         (e.g: hvmloader)
Patch 4: Remove old assumptions about vcpu_id<->apic_id relationship in hvmloader
Patch 5: Add logic to derive x2APIC IDs given a CPU policy and vCPU IDs
Patch 6: Includes a simple topology generator for toolstack so new guests
         have topologically consistent information in CPUID

Alejandro Vallejo (10):
  tools/hvmloader: Fix non-deterministic cpuid()
  x86/vlapic: Move lapic migration checks to the check hooks
  xen/x86: Add initial x2APIC ID to the per-vLAPIC save area
  xen/x86: Add supporting code for uploading LAPIC contexts during
    domain create
  tools/hvmloader: Retrieve (x2)APIC IDs from the APs themselves
  tools/libguest: Always set vCPU context in vcpu_hvm()
  xen/lib: Add topology generator for x86
  xen/x86: Derive topologically correct x2APIC IDs from the policy
  tools/libguest: Set distinct x2APIC IDs for each vCPU
  xen/x86: Synthesise domain topologies

 tools/firmware/hvmloader/config.h        |   6 +-
 tools/firmware/hvmloader/hvmloader.c     |   4 +-
 tools/firmware/hvmloader/smp.c           |  54 ++++--
 tools/firmware/hvmloader/util.c          |   9 -
 tools/firmware/hvmloader/util.h          |  27 ++-
 tools/include/xen-tools/common-macros.h  |   5 +
 tools/libs/guest/xg_cpuid_x86.c          |  24 ++-
 tools/libs/guest/xg_dom_x86.c            | 114 ++++++++-----
 tools/tests/cpu-policy/test-cpu-policy.c | 201 +++++++++++++++++++++++
 xen/arch/x86/cpu-policy.c                |   9 +-
 xen/arch/x86/cpuid.c                     |  14 +-
 xen/arch/x86/hvm/vlapic.c                | 123 ++++++++++----
 xen/arch/x86/include/asm/hvm/vlapic.h    |   1 +
 xen/include/public/arch-x86/hvm/save.h   |   2 +
 xen/include/xen/lib/x86/cpu-policy.h     |  27 +++
 xen/lib/x86/policy.c                     | 164 ++++++++++++++++++
 xen/lib/x86/private.h                    |   4 +
 17 files changed, 683 insertions(+), 105 deletions(-)

-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:43:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:43:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774176.1184685 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3Px-0004ho-8z; Thu, 08 Aug 2024 13:43:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774176.1184685; Thu, 08 Aug 2024 13:43:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3Px-0004hC-4x; Thu, 08 Aug 2024 13:43:01 +0000
Received: by outflank-mailman (input) for mailman id 774176;
 Thu, 08 Aug 2024 13:42: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=zgd2=PH=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sc3Pv-0002jZ-Md
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:42:59 +0000
Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com
 [2a00:1450:4864:20::634])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1fbddc41-558c-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 15:42:59 +0200 (CEST)
Received: by mail-ej1-x634.google.com with SMTP id
 a640c23a62f3a-a728f74c23dso109161666b.1
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:42:59 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ecb551sm741537166b.223.2024.08.08.06.42.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 08 Aug 2024 06:42:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1fbddc41-558c-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723124578; x=1723729378; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=m48u/GdGc4dt8JDS23gHEKeM1ld2/77KdzYrt97Of94=;
        b=HxiR+QXllcTe5SIve620DTPQeoj6qR1AByWMbw3BtkhNytI6lr4VhjpkwnmnUeNfSg
         Xmkhw8imHXrdia9/m7AqcPN0gX1KfEvtskIbKkr9GhxqZF8pWXE/B34t/PfvUxYSh5g/
         PG+bmFoxs1SzQB8QLXlmuOtWGg3moSzjA2LSM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723124578; x=1723729378;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=m48u/GdGc4dt8JDS23gHEKeM1ld2/77KdzYrt97Of94=;
        b=Wo6LGSmRL5f/dLI+8JEbkbPaCtCFEstVESEeQric1OIn/q2F13V/gWS7hkyICL13ah
         rSlEIvkvo9TxG5ykGlrVBTT6BoMwvWcIzYzTN0EC5av4NvYh/KjCDgQTT4EeitWRMvGx
         +qTFs6uNfaRk+YKAdmpc3Nw8c6qFcThUAxtYvwDqT+J4PmJfpmxcK1+6VWlO4g1c/i1z
         dY2XHjDKXZNojqVQIP7TbE1MxZEblfU/2/A02be1WOYv9u9gLKodryo8ON/TxnSNsDrM
         j3Vd02iM30iu99nHCVMZUjKsp72mBbYmSwJmII2psuHN6KyTpdJsQPsZnoCFF9sg9J8E
         4tuw==
X-Gm-Message-State: AOJu0YyGjuCBaYIEYWB+CCbXdkixJYlNVg1jiUBYwD4965G17HcfGZPU
	oXy+ZV28LSsOJCuVO2OvMoq1mHwrcCPAeRDBje3ZMp351x0omAZM2wjrLEUqDVpo/XTLyx1bHKF
	0
X-Google-Smtp-Source: AGHT+IG5xlBgPWGBV+bvZoU3GFLz+ML1HJ9O5ctJOBxa+Plc/GHfcNRz8omRfI6Vg1lzm2pP9h5rSg==
X-Received: by 2002:a17:907:7f88:b0:a72:7fea:5800 with SMTP id a640c23a62f3a-a8090ee36e5mr157675166b.63.1723124578171;
        Thu, 08 Aug 2024 06:42:58 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v5 02/10] x86/vlapic: Move lapic migration checks to the check hooks
Date: Thu,  8 Aug 2024 14:42:42 +0100
Message-ID: <20240808134251.29995-3-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
References: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

While doing this, factor out checks common to architectural and hidden
state.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
v5:
  * No change
---
 xen/arch/x86/hvm/vlapic.c | 81 +++++++++++++++++++++++++--------------
 1 file changed, 53 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 2ec95942713e..521b98988be9 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1554,60 +1554,85 @@ static void lapic_load_fixup(struct vlapic *vlapic)
                v, vlapic->loaded.id, vlapic->loaded.ldr, good_ldr);
 }
 
-static int cf_check lapic_load_hidden(struct domain *d, hvm_domain_context_t *h)
-{
-    unsigned int vcpuid = hvm_load_instance(h);
-    struct vcpu *v;
-    struct vlapic *s;
 
+static int lapic_check_common(const struct domain *d, unsigned int vcpuid)
+{
     if ( !has_vlapic(d) )
         return -ENODEV;
 
     /* Which vlapic to load? */
-    if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
+    if ( !domain_vcpu(d, vcpuid) )
     {
         dprintk(XENLOG_G_ERR, "HVM restore: dom%d has no apic%u\n",
                 d->domain_id, vcpuid);
         return -EINVAL;
     }
-    s = vcpu_vlapic(v);
 
-    if ( hvm_load_entry_zeroextend(LAPIC, h, &s->hw) != 0 )
+    return 0;
+}
+
+static int cf_check lapic_check_hidden(const struct domain *d,
+                                       hvm_domain_context_t *h)
+{
+    unsigned int vcpuid = hvm_load_instance(h);
+    struct hvm_hw_lapic s;
+    int rc;
+
+    if ( (rc = lapic_check_common(d, vcpuid)) )
+        return rc;
+
+    if ( hvm_load_entry_zeroextend(LAPIC, h, &s) != 0 )
+        return -ENODATA;
+
+    /* EN=0 with EXTD=1 is illegal */
+    if ( (s.apic_base_msr & (APIC_BASE_ENABLE | APIC_BASE_EXTD)) ==
+         APIC_BASE_EXTD )
         return -EINVAL;
 
+    return 0;
+}
+
+static int cf_check lapic_load_hidden(struct domain *d, hvm_domain_context_t *h)
+{
+    unsigned int vcpuid = hvm_load_instance(h);
+    struct vcpu *v = d->vcpu[vcpuid];
+    struct vlapic *s = vcpu_vlapic(v);
+
+    if ( hvm_load_entry_zeroextend(LAPIC, h, &s->hw) != 0 )
+        ASSERT_UNREACHABLE();
+
     s->loaded.hw = 1;
     if ( s->loaded.regs )
         lapic_load_fixup(s);
 
-    if ( !(s->hw.apic_base_msr & APIC_BASE_ENABLE) &&
-         unlikely(vlapic_x2apic_mode(s)) )
-        return -EINVAL;
-
     hvm_update_vlapic_mode(v);
 
     return 0;
 }
 
-static int cf_check lapic_load_regs(struct domain *d, hvm_domain_context_t *h)
+static int cf_check lapic_check_regs(const struct domain *d,
+                                     hvm_domain_context_t *h)
 {
     unsigned int vcpuid = hvm_load_instance(h);
-    struct vcpu *v;
-    struct vlapic *s;
+    int rc;
 
-    if ( !has_vlapic(d) )
-        return -ENODEV;
+    if ( (rc = lapic_check_common(d, vcpuid)) )
+        return rc;
 
-    /* Which vlapic to load? */
-    if ( vcpuid >= d->max_vcpus || (v = d->vcpu[vcpuid]) == NULL )
-    {
-        dprintk(XENLOG_G_ERR, "HVM restore: dom%d has no apic%u\n",
-                d->domain_id, vcpuid);
-        return -EINVAL;
-    }
-    s = vcpu_vlapic(v);
+    if ( !hvm_get_entry(LAPIC_REGS, h) )
+        return -ENODATA;
+
+    return 0;
+}
+
+static int cf_check lapic_load_regs(struct domain *d, hvm_domain_context_t *h)
+{
+    unsigned int vcpuid = hvm_load_instance(h);
+    struct vcpu *v = d->vcpu[vcpuid];
+    struct vlapic *s = vcpu_vlapic(v);
 
     if ( hvm_load_entry(LAPIC_REGS, h, s->regs) != 0 )
-        return -EINVAL;
+        ASSERT_UNREACHABLE();
 
     s->loaded.id = vlapic_get_reg(s, APIC_ID);
     s->loaded.ldr = vlapic_get_reg(s, APIC_LDR);
@@ -1624,9 +1649,9 @@ static int cf_check lapic_load_regs(struct domain *d, hvm_domain_context_t *h)
     return 0;
 }
 
-HVM_REGISTER_SAVE_RESTORE(LAPIC, lapic_save_hidden, NULL,
+HVM_REGISTER_SAVE_RESTORE(LAPIC, lapic_save_hidden, lapic_check_hidden,
                           lapic_load_hidden, 1, HVMSR_PER_VCPU);
-HVM_REGISTER_SAVE_RESTORE(LAPIC_REGS, lapic_save_regs, NULL,
+HVM_REGISTER_SAVE_RESTORE(LAPIC_REGS, lapic_save_regs, lapic_check_regs,
                           lapic_load_regs, 1, HVMSR_PER_VCPU);
 
 int vlapic_init(struct vcpu *v)
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:43:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:43:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774178.1184695 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3Q3-00055B-HH; Thu, 08 Aug 2024 13:43:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774178.1184695; Thu, 08 Aug 2024 13:43:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3Q3-00054u-D5; Thu, 08 Aug 2024 13:43:07 +0000
Received: by outflank-mailman (input) for mailman id 774178;
 Thu, 08 Aug 2024 13:43:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zgd2=PH=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sc3Q2-0002jZ-06
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:43:06 +0000
Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com
 [2a00:1450:4864:20::12b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 23af659a-558c-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 15:43:05 +0200 (CEST)
Received: by mail-lf1-x12b.google.com with SMTP id
 2adb3069b0e04-52f01ec08d6so1249300e87.2
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:43:05 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ecb551sm741537166b.223.2024.08.08.06.43.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 08 Aug 2024 06:43:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 23af659a-558c-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723124584; x=1723729384; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=UeVUUABBzNI1adruZgcaqeCvylgkxU6xakNCgnT+U/k=;
        b=jcAGCJDcIbKKlOuh80vcOez4bmNjVPdAVX/wUwU1IWKRsPEZXe5Q6aON1ax+f7nAd5
         62Jr6dFEnLZ7JYQW0p9wH8PsnAzWRasCGHMIJnGmb9oLui7zwXXk0XI/lKHmgixLVPSd
         d87pluyAN+bSP/5zly1vM8SPs/kzF8yF2zYVM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723124584; x=1723729384;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=UeVUUABBzNI1adruZgcaqeCvylgkxU6xakNCgnT+U/k=;
        b=BNb+Lrj1zO6IqqMG83Scow8TrS8yO8Y8NTJ2eXr6UcOFgpEaq0BTYmd8jSEzYMXS3U
         aqQWY4XoeC7r2cyLwRc6qz+ZAMebF/uhyj+i6G/PPasBCqO2Ox5Tm9wr7aKIHeL3cq4p
         iHvlue64JN2u1N9MUCxxDuXjhZyKF5ynY+RNM0VSVVDj7unWC5MxHKisSqKfGgwu/qg9
         wwrNaFCs8IM8ASR+G8ONYK80R44Y//hdXmI5LBNxmrfSXPoEYYerezOIGffT9GWKIya1
         Qb35CMxOEtg/eOx5n7sVePBdoUugLRtLNp/eyKbclTolWUIqbny8UYeic54ZDPf8IqRu
         H3Zg==
X-Gm-Message-State: AOJu0YwUX1gLRmSHHJSxj+wYyupA0sro8dYoPKvMOihH7ozJHaJhg1qE
	OnDGY2L7eYJeUoxdvE0ztwOqAWdZDfSVS2XvDh9Gzha/qvlvFc1P5HdJX13b1slrtABaVL1/x83
	a
X-Google-Smtp-Source: AGHT+IGwnI6doIkcRTJRGk4Xe7EFDfawKFpStiQEtCj1LLLr7uVkCmRQZvb0FGyZ5Ax36nuOK1TmMg==
X-Received: by 2002:a05:6512:a95:b0:52e:9ab9:da14 with SMTP id 2adb3069b0e04-530e583f755mr1490222e87.31.1723124584432;
        Thu, 08 Aug 2024 06:43:04 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v5 09/10] tools/libguest: Set distinct x2APIC IDs for each vCPU
Date: Thu,  8 Aug 2024 14:42:49 +0100
Message-ID: <20240808134251.29995-10-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
References: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Have toolstack populate the new x2APIC ID in the LAPIC save record with
the proper IDs intended for each vCPU.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v5:
  * No change
---
 tools/libs/guest/xg_dom_x86.c | 38 ++++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/tools/libs/guest/xg_dom_x86.c b/tools/libs/guest/xg_dom_x86.c
index fafe7acb7e91..a3e4e2052128 100644
--- a/tools/libs/guest/xg_dom_x86.c
+++ b/tools/libs/guest/xg_dom_x86.c
@@ -1004,19 +1004,40 @@ static int vcpu_hvm(struct xc_dom_image *dom)
         HVM_SAVE_TYPE(HEADER) header;
         struct hvm_save_descriptor mtrr_d;
         HVM_SAVE_TYPE(MTRR) mtrr;
+        struct hvm_save_descriptor lapic_d;
+        HVM_SAVE_TYPE(LAPIC) lapic;
         struct hvm_save_descriptor end_d;
         HVM_SAVE_TYPE(END) end;
     } vcpu_ctx;
-    /* Context from full_ctx */
+    /* Contexts from full_ctx */
     const HVM_SAVE_TYPE(MTRR) *mtrr_record;
+    const HVM_SAVE_TYPE(LAPIC) *lapic_record;
     /* Raw context as taken from Xen */
     uint8_t *full_ctx = NULL;
+    xc_cpu_policy_t *policy = xc_cpu_policy_init();
     int rc;
 
     DOMPRINTF_CALLED(dom->xch);
 
     assert(dom->max_vcpus);
 
+    /*
+     * Fetch the CPU policy of this domain. We need it to determine the APIC IDs
+     * each of vCPU in a manner consistent with the exported topology.
+     *
+     * TODO: It's silly to query a policy we have ourselves created. It should
+     *       instead be part of xc_dom_image
+     */
+
+    rc = xc_cpu_policy_get_domain(dom->xch, dom->guest_domid, policy);
+    if ( rc != 0 )
+    {
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: unable to fetch cpu policy for dom%u (rc=%d)",
+                     __func__, dom->guest_domid, rc);
+        goto out;
+    }
+
     /*
      * Get the full HVM context in order to have the header, it is not
      * possible to get the header with getcontext_partial, and crafting one
@@ -1111,6 +1132,8 @@ static int vcpu_hvm(struct xc_dom_image *dom)
     vcpu_ctx.mtrr_d.typecode = HVM_SAVE_CODE(MTRR);
     vcpu_ctx.mtrr_d.length = HVM_SAVE_LENGTH(MTRR);
     vcpu_ctx.mtrr = *mtrr_record;
+    vcpu_ctx.lapic_d.typecode = HVM_SAVE_CODE(LAPIC);
+    vcpu_ctx.lapic_d.length = HVM_SAVE_LENGTH(LAPIC);
     vcpu_ctx.end_d = bsp_ctx.end_d;
     vcpu_ctx.end = bsp_ctx.end;
 
@@ -1125,6 +1148,18 @@ static int vcpu_hvm(struct xc_dom_image *dom)
     {
         vcpu_ctx.mtrr_d.instance = i;
 
+        lapic_record = hvm_get_save_record(full_ctx, HVM_SAVE_CODE(LAPIC), i);
+        if ( !lapic_record )
+        {
+            xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                         "%s: unable to get LAPIC[%d] save record", __func__, i);
+            goto out;
+        }
+
+        vcpu_ctx.lapic = *lapic_record;
+        vcpu_ctx.lapic.x2apic_id = x86_x2apic_id_from_vcpu_id(&policy->policy, i);
+        vcpu_ctx.lapic_d.instance = i;
+
         rc = xc_domain_hvm_setcontext(dom->xch, dom->guest_domid,
                                       (uint8_t *)&vcpu_ctx, sizeof(vcpu_ctx));
         if ( rc != 0 )
@@ -1147,6 +1182,7 @@ static int vcpu_hvm(struct xc_dom_image *dom)
 
  out:
     free(full_ctx);
+    xc_cpu_policy_destroy(policy);
     return rc;
 }
 
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:46:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:46:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774192.1184704 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3T6-0006bd-2n; Thu, 08 Aug 2024 13:46:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774192.1184704; Thu, 08 Aug 2024 13:46:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3T6-0006bW-09; Thu, 08 Aug 2024 13:46:16 +0000
Received: by outflank-mailman (input) for mailman id 774192;
 Thu, 08 Aug 2024 13:46:15 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zgd2=PH=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sc3Pz-0003nA-M7
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:43:03 +0000
Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com
 [2a00:1450:4864:20::62d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2184dabe-558c-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 15:43:01 +0200 (CEST)
Received: by mail-ej1-x62d.google.com with SMTP id
 a640c23a62f3a-a7ac469e4c4so157256866b.0
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:43:01 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ecb551sm741537166b.223.2024.08.08.06.43.00
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 08 Aug 2024 06:43:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2184dabe-558c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723124581; x=1723729381; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Ch+IX6lnENH71AXJ9ytitrdkxTivN5M0WBk5MWa3vLY=;
        b=ZkHKGVlqj0wsNvVFcmRxs3Prt8FdgWl1Q37USeGO7MlEpr0wJjtu3rPaVWzEs5UR0E
         G+12UbcTOPf1TbCziN3l2Eb/WJSA7BcCIy92vjB2KSdVVPDJy+fjfHi2wxoIXRjGmax5
         jzQH3BC+BhY2UbT0WVi9mwD0B18GYsqTxDEbE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723124581; x=1723729381;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Ch+IX6lnENH71AXJ9ytitrdkxTivN5M0WBk5MWa3vLY=;
        b=VQQ+fgLgSw+4C9lxpgXtgYhV7DQ0cWbO6bQ/LRj2pmGxnDpbHD/5Ic0zr/9vTUwwOn
         Rf4djYvRfvxUQo/KTeJvzgYNB66xXz7X269M4zewRY/K2ZgFRsgkKj7ExnO5fam5Cu1y
         XXtc5pz8MT7WLmBlnNKX3UpBNF6dyknYxWi/KcYPkDrm8PdIgZ2BjYQClGzIcs/9+YdU
         mXFywwwSHYo4D4MlNU0IFoJss8w2wohL7RNahGZWO7wwl0nHlegrhJTstf1/Yfi6WCY1
         kIv19JF8s1tqQ8wCeBpa3HdLQj1Q2q814gf3ojCss4t+CowgDgLWgj4tq89shW0mlLIq
         Hinw==
X-Gm-Message-State: AOJu0YxrVIdTMCsYAsQa/700UV7fPGujsAq0ffNuNL/G5d7DBMz8KwkZ
	jeoCOuVGWmNKRSvJn51Tawh+Uu5mUIsRmgm7hb/uXXkLMUTSny08MqJKD6f0SvZozS3tDshzzkE
	4
X-Google-Smtp-Source: AGHT+IGsqgUdRiVpKMpPF6V1Lc/b5Yh4OPDiUx9kn6eaKj8jLOwWi7WVZ/+J9WMPYpAW8iDl9C2VEQ==
X-Received: by 2002:a17:907:ea2:b0:a6f:5609:954f with SMTP id a640c23a62f3a-a8091f1ebb5mr175979066b.12.1723124581075;
        Thu, 08 Aug 2024 06:43:01 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH v5 05/10] tools/hvmloader: Retrieve (x2)APIC IDs from the APs themselves
Date: Thu,  8 Aug 2024 14:42:45 +0100
Message-ID: <20240808134251.29995-6-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
References: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Make it so the APs expose their own APIC IDs in a LUT. We can use that
LUT to
populate the MADT, decoupling the algorithm that relates CPU IDs and
APIC IDs
from hvmloader.

While at this also remove ap_callin, as writing the APIC ID may serve
the same
purpose.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v5:
  * No change
---
 tools/firmware/hvmloader/config.h       |  6 ++-
 tools/firmware/hvmloader/hvmloader.c    |  4 +-
 tools/firmware/hvmloader/smp.c          | 54 ++++++++++++++++++++-----
 tools/include/xen-tools/common-macros.h |  5 +++
 4 files changed, 56 insertions(+), 13 deletions(-)

diff --git a/tools/firmware/hvmloader/config.h b/tools/firmware/hvmloader/config.h
index cd716bf39245..213ac1f28e17 100644
--- a/tools/firmware/hvmloader/config.h
+++ b/tools/firmware/hvmloader/config.h
@@ -4,6 +4,8 @@
 #include <stdint.h>
 #include <stdbool.h>
 
+#include <xen/hvm/hvm_info_table.h>
+
 enum virtual_vga { VGA_none, VGA_std, VGA_cirrus, VGA_pt };
 extern enum virtual_vga virtual_vga;
 
@@ -48,8 +50,10 @@ extern uint8_t ioapic_version;
 
 #define IOAPIC_ID           0x01
 
+extern uint32_t CPU_TO_X2APICID[HVM_MAX_VCPUS];
+
 #define LAPIC_BASE_ADDRESS  0xfee00000
-#define LAPIC_ID(vcpu_id)   ((vcpu_id) * 2)
+#define LAPIC_ID(vcpu_id)   (CPU_TO_X2APICID[(vcpu_id)])
 
 #define PCI_ISA_DEVFN       0x08    /* dev 1, fn 0 */
 #define PCI_ISA_IRQ_MASK    0x0c20U /* ISA IRQs 5,10,11 are PCI connected */
diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c
index f8af88fabf24..5c02e8fc226a 100644
--- a/tools/firmware/hvmloader/hvmloader.c
+++ b/tools/firmware/hvmloader/hvmloader.c
@@ -341,11 +341,11 @@ int main(void)
 
     printf("CPU speed is %u MHz\n", get_cpu_mhz());
 
+    smp_initialise();
+
     apic_setup();
     pci_setup();
 
-    smp_initialise();
-
     perform_tests();
 
     if ( bios->bios_info_setup )
diff --git a/tools/firmware/hvmloader/smp.c b/tools/firmware/hvmloader/smp.c
index 1b940cefd071..b0d4da111904 100644
--- a/tools/firmware/hvmloader/smp.c
+++ b/tools/firmware/hvmloader/smp.c
@@ -29,7 +29,34 @@
 
 #include <xen/vcpu.h>
 
-static int ap_callin;
+/**
+ * Lookup table of x2APIC IDs.
+ *
+ * Each entry is populated its respective CPU as they come online. This is required
+ * for generating the MADT with minimal assumptions about ID relationships.
+ */
+uint32_t CPU_TO_X2APICID[HVM_MAX_VCPUS];
+
+/** Tristate about x2apic being supported. -1=unknown */
+static int has_x2apic = -1;
+
+static uint32_t read_apic_id(void)
+{
+    uint32_t apic_id;
+
+    if ( has_x2apic )
+        cpuid(0xb, NULL, NULL, NULL, &apic_id);
+    else
+    {
+        cpuid(1, NULL, &apic_id, NULL, NULL);
+        apic_id >>= 24;
+    }
+
+    /* Never called by cpu0, so should never return 0 */
+    ASSERT(apic_id);
+
+    return apic_id;
+}
 
 static void cpu_setup(unsigned int cpu)
 {
@@ -37,13 +64,17 @@ static void cpu_setup(unsigned int cpu)
     cacheattr_init();
     printf("done.\n");
 
-    if ( !cpu ) /* Used on the BSP too */
+    /* The BSP exits early because its APIC ID is known to be zero */
+    if ( !cpu )
         return;
 
     wmb();
-    ap_callin = 1;
+    ACCESS_ONCE(CPU_TO_X2APICID[cpu]) = read_apic_id();
 
-    /* After this point, the BSP will shut us down. */
+    /*
+     * After this point the BSP will shut us down. A write to
+     * CPU_TO_X2APICID[cpu] signals the BSP to bring down `cpu`.
+     */
 
     for ( ;; )
         asm volatile ( "hlt" );
@@ -54,10 +85,6 @@ static void boot_cpu(unsigned int cpu)
     static uint8_t ap_stack[PAGE_SIZE] __attribute__ ((aligned (16)));
     static struct vcpu_hvm_context ap;
 
-    /* Initialise shared variables. */
-    ap_callin = 0;
-    wmb();
-
     /* Wake up the secondary processor */
     ap = (struct vcpu_hvm_context) {
         .mode = VCPU_HVM_MODE_32B,
@@ -90,10 +117,11 @@ static void boot_cpu(unsigned int cpu)
         BUG();
 
     /*
-     * Wait for the secondary processor to complete initialisation.
+     * Wait for the secondary processor to complete initialisation,
+     * which is signaled by its x2APIC ID being written to the LUT.
      * Do not touch shared resources meanwhile.
      */
-    while ( !ap_callin )
+    while ( !ACCESS_ONCE(CPU_TO_X2APICID[cpu]) )
         cpu_relax();
 
     /* Take the secondary processor offline. */
@@ -104,6 +132,12 @@ static void boot_cpu(unsigned int cpu)
 void smp_initialise(void)
 {
     unsigned int i, nr_cpus = hvm_info->nr_vcpus;
+    uint32_t ecx;
+
+    cpuid(1, NULL, NULL, &ecx, NULL);
+    has_x2apic = (ecx >> 21) & 1;
+    if ( has_x2apic )
+        printf("x2APIC supported\n");
 
     printf("Multiprocessor initialisation:\n");
     cpu_setup(0);
diff --git a/tools/include/xen-tools/common-macros.h b/tools/include/xen-tools/common-macros.h
index 60912225cb7a..336c6309d96e 100644
--- a/tools/include/xen-tools/common-macros.h
+++ b/tools/include/xen-tools/common-macros.h
@@ -108,4 +108,9 @@
 #define get_unaligned(ptr)      get_unaligned_t(typeof(*(ptr)), ptr)
 #define put_unaligned(val, ptr) put_unaligned_t(typeof(*(ptr)), val, ptr)
 
+#define __ACCESS_ONCE(x) ({                             \
+            (void)(typeof(x))0; /* Scalar typecheck. */ \
+            (volatile typeof(x) *)&(x); })
+#define ACCESS_ONCE(x) (*__ACCESS_ONCE(x))
+
 #endif	/* __XEN_TOOLS_COMMON_MACROS__ */
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:46:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:46:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774200.1184715 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3TB-0006yv-Ba; Thu, 08 Aug 2024 13:46:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774200.1184715; Thu, 08 Aug 2024 13:46:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3TB-0006yo-8j; Thu, 08 Aug 2024 13:46:21 +0000
Received: by outflank-mailman (input) for mailman id 774200;
 Thu, 08 Aug 2024 13:46:20 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zgd2=PH=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sc3Q3-0003nA-UJ
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:43:07 +0000
Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com
 [2a00:1450:4864:20::536])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 24240415-558c-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 15:43:06 +0200 (CEST)
Received: by mail-ed1-x536.google.com with SMTP id
 4fb4d7f45d1cf-5ba43b433beso1093387a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:43:06 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ecb551sm741537166b.223.2024.08.08.06.43.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 08 Aug 2024 06:43:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 24240415-558c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723124585; x=1723729385; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=gLkjP1FzLasHJVmlNeLL5p62QH+uyeVmk8FwAqn+lRU=;
        b=IJhVdLVvKe0bLChglDPxRqZQiBCzxbLemY7fTxnfeYKuy8EM//MKflXDDkDOxfIZO6
         ASQ5c4nV3z+FFfUzlacmCOGeaV8tCbmUDVZBnGmJdt4CV4O2NtOASYT9x8+fAAjMyrou
         O7EDrzy8kQJYPwTXqSKVqdwp6XlG9OmLDdQaw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723124585; x=1723729385;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=gLkjP1FzLasHJVmlNeLL5p62QH+uyeVmk8FwAqn+lRU=;
        b=UB74Fdp/mhbqKUlU5WgImGj67FsYJOHBhtviSnhonJ9y25o/ZhXESIamvv9dO9SZf+
         ISSkVcaZx77pAfb4iNJUX5hFD2F2GjjZjW2GEgYIPqNZT3JcG7o+voWnfq7D5uREWTIe
         2awBpdFSbagdTAGtHuLUNOHTV5HJxQ70V1kcniQDTtiP/jraaz7r0kOy+TRGWd6qbNo1
         uKdUHVSCi0NKQXlNNsUIrB1mEaDqo1ke17Nx+wW7GNGPAKmSw60tlp4nhDZmSBTp5R3B
         S8JNSJeX5M2vbH4VqBU681+E6Yl6+eo0aVJKHoJbsYLssym78nLkI1cZ2LDfRdaaRCay
         FrOQ==
X-Gm-Message-State: AOJu0YxXViY0gvfb8QIvEHFqJOkUy7bwLumT73Hl5Wpfew8jtPgJTJyb
	t0eX1GIZ4FKzrbGD9Jbd130jBmjK6lvd5MVFnwfgPdaMU7XRKKnFSogHfNgEwmRpyM3Q3a6fF+d
	z
X-Google-Smtp-Source: AGHT+IHJUmiffDhfpHY9GjAApf/PSjdJgigIHdEPZmUx93ym1jXMqIXrgzxNN+ImNmAYej/N95EpBw==
X-Received: by 2002:a17:907:3f24:b0:a7a:a4be:2f95 with SMTP id a640c23a62f3a-a8090c25b3bmr164379266b.5.1723124585508;
        Thu, 08 Aug 2024 06:43:05 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v5 10/10] xen/x86: Synthesise domain topologies
Date: Thu,  8 Aug 2024 14:42:50 +0100
Message-ID: <20240808134251.29995-11-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
References: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Expose sensible topologies in leaf 0xb. At the moment it synthesises
non-HT systems, in line with the previous code intent.

Leaf 0xb in the host policy is no longer zapped and the guest {max,def}
policies have their topology leaves zapped instead. The intent is for
toolstack to populate them. There's no current use for the topology
information in the host policy, but it makes no harm.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v5:
  * No change
---
 tools/libs/guest/xg_cpuid_x86.c | 24 +++++++++++++++++++++++-
 xen/arch/x86/cpu-policy.c       |  9 ++++++---
 2 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/tools/libs/guest/xg_cpuid_x86.c b/tools/libs/guest/xg_cpuid_x86.c
index 4453178100ad..6062dcab01ce 100644
--- a/tools/libs/guest/xg_cpuid_x86.c
+++ b/tools/libs/guest/xg_cpuid_x86.c
@@ -725,8 +725,16 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
         p->policy.basic.htt       = test_bit(X86_FEATURE_HTT, host_featureset);
         p->policy.extd.cmp_legacy = test_bit(X86_FEATURE_CMP_LEGACY, host_featureset);
     }
-    else
+    else if ( restore )
     {
+        /*
+         * Reconstruct the topology exposed on Xen <= 4.13. It makes very little
+         * sense, but it's what those guests saw so it's set in stone now.
+         *
+         * Guests from Xen 4.14 onwards carry their own CPUID leaves in the
+         * migration stream so they don't need special treatment.
+         */
+
         /*
          * Topology for HVM guests is entirely controlled by Xen.  For now, we
          * hardcode APIC_ID = vcpu_id * 2 to give the illusion of no SMT.
@@ -782,6 +790,20 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid, bool restore,
             break;
         }
     }
+    else
+    {
+        /* TODO: Expose the ability to choose a custom topology for HVM/PVH */
+        unsigned int threads_per_core = 1;
+        unsigned int cores_per_pkg = di.max_vcpu_id + 1;
+
+        rc = x86_topo_from_parts(&p->policy, threads_per_core, cores_per_pkg);
+        if ( rc )
+        {
+            ERROR("Failed to generate topology: rc=%d t/c=%u c/p=%u",
+                  rc, threads_per_core, cores_per_pkg);
+            goto out;
+        }
+    }
 
     nr_leaves = ARRAY_SIZE(p->leaves);
     rc = x86_cpuid_copy_to_buffer(&p->policy, p->leaves, &nr_leaves);
diff --git a/xen/arch/x86/cpu-policy.c b/xen/arch/x86/cpu-policy.c
index 304dc20cfab8..55a95f6e164c 100644
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -263,9 +263,6 @@ static void recalculate_misc(struct cpu_policy *p)
 
     p->basic.raw[0x8] = EMPTY_LEAF;
 
-    /* TODO: Rework topology logic. */
-    memset(p->topo.raw, 0, sizeof(p->topo.raw));
-
     p->basic.raw[0xc] = EMPTY_LEAF;
 
     p->extd.e1d &= ~CPUID_COMMON_1D_FEATURES;
@@ -613,6 +610,9 @@ static void __init calculate_pv_max_policy(void)
     recalculate_xstate(p);
 
     p->extd.raw[0xa] = EMPTY_LEAF; /* No SVM for PV guests. */
+
+    /* Wipe host topology. Populated by toolstack */
+    memset(p->topo.raw, 0, sizeof(p->topo.raw));
 }
 
 static void __init calculate_pv_def_policy(void)
@@ -776,6 +776,9 @@ static void __init calculate_hvm_max_policy(void)
 
     /* It's always possible to emulate CPUID faulting for HVM guests */
     p->platform_info.cpuid_faulting = true;
+
+    /* Wipe host topology. Populated by toolstack */
+    memset(p->topo.raw, 0, sizeof(p->topo.raw));
 }
 
 static void __init calculate_hvm_def_policy(void)
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:46:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:46:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774206.1184725 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3TH-0007O4-IA; Thu, 08 Aug 2024 13:46:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774206.1184725; Thu, 08 Aug 2024 13:46:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3TH-0007Nx-FR; Thu, 08 Aug 2024 13:46:27 +0000
Received: by outflank-mailman (input) for mailman id 774206;
 Thu, 08 Aug 2024 13:46:26 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zgd2=PH=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sc3Py-0003nA-Nl
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:43:02 +0000
Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com
 [2a00:1450:4864:20::22a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 210833b2-558c-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 15:43:01 +0200 (CEST)
Received: by mail-lj1-x22a.google.com with SMTP id
 38308e7fff4ca-2ef248ab2aeso14004031fa.0
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:43:01 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ecb551sm741537166b.223.2024.08.08.06.42.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 08 Aug 2024 06:42:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 210833b2-558c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723124580; x=1723729380; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=E6jJmilCAYKj/QJkIbHrN87ZkSwCG5OPRTk65J0LtEY=;
        b=J92yXKdUgPmIiKBHw1e98X5vquPKThAE2VnIeF6rg7YeajBix5Jlg3yxi3afBEXdyu
         s4z3lZ+podWwJ8c3wgyg4hw8Nrgf2ZXD2kTvoa1+codHw7D+mWCtWLR442vOqX3TJLU0
         XrznsB7k7JTM4y+ZytzPUt5+jziTQAqNGw0ZQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723124580; x=1723729380;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=E6jJmilCAYKj/QJkIbHrN87ZkSwCG5OPRTk65J0LtEY=;
        b=GpqVhj39HwMd36rMCatDEu+89GBDyoLrQfEYBINRPGjJm6Cm7rBFKQFuzKMK9ZWOnr
         qjJp/ZFaEsO8bczCLAL1a+9NSZJobcL+tnbzFSQ4z95lyTw7hI6Xp+82xhXTxzh2w3sa
         lrOdPt6pAYsdzvRuCTj6MDEWKelihm0LRIK0feered2E/ZiwS3OCmgRGtQPNC5oWAcs/
         6OOCunFlE3gZsY7gXvf3q577Vzb76/a0hiixNSh6zt39Cy/a+8gqV6U7nYDc4fpixK+A
         BEastFptbz5nJl79DF1P9vHbQnf2Z5rjkQYPFT/izUy/szuqJRrv0wwOnZq+ggFe2kPO
         EqlA==
X-Gm-Message-State: AOJu0YzuXGgO3jmpZZz7MfYGXJlqM/Kw21veZ43N0MKzHFHmfr30gwXF
	TDfJDw5ThOWozkDjP7LKDYUF2mNpYO6wUfFsCE3ff+PPcqmKA93gL0CoHW3QZJsKGcJeYqqYkZ5
	m
X-Google-Smtp-Source: AGHT+IFAXzgZL2cAgDALpEN6211JBmUy1AR6RqCr32r8YqyiC74Mdv2qvVDmSS6e3wxq8C8G2MgVvA==
X-Received: by 2002:a2e:a583:0:b0:2ef:2dbe:7455 with SMTP id 38308e7fff4ca-2f19de1b687mr21530961fa.1.1723124580109;
        Thu, 08 Aug 2024 06:43:00 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v5 04/10] xen/x86: Add supporting code for uploading LAPIC contexts during domain create
Date: Thu,  8 Aug 2024 14:42:44 +0100
Message-ID: <20240808134251.29995-5-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
References: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

If toolstack were to upload LAPIC contexts as part of domain creation it
would encounter a problem were the architectural state does not reflect
the APIC ID in the hidden state. This patch ensures updates to the
hidden state trigger an update in the architectural registers so the
APIC ID in both is consistent.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
We could also let toolstack synthesise architectural registers, but
that would be adding logic on how architectural state operates to
software that really shouldn't care. I could be persuaded to do it the
other way, but I think it's going to be messier.

v5:
  * No change
---
 xen/arch/x86/hvm/vlapic.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 0e0699fc8279..3fa839087fe0 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1620,7 +1620,27 @@ static int cf_check lapic_load_hidden(struct domain *d, hvm_domain_context_t *h)
 
     s->loaded.hw = 1;
     if ( s->loaded.regs )
+    {
+        /*
+         * We already processed architectural regs in lapic_load_regs(), so
+         * this must be a migration. Fix up inconsistencies from any older Xen.
+         */
         lapic_load_fixup(s);
+    }
+    else
+    {
+        /*
+         * We haven't seen architectural regs so this could be a migration or a
+         * plain domain create. In the domain create case it's fine to modify
+         * the architectural state to align it to the APIC ID that was just
+         * uploaded and in the migrate case it doesn't matter because the
+         * architectural state will be replaced by the LAPIC_REGS ctx later on.
+         */
+        if ( vlapic_x2apic_mode(s) )
+            set_x2apic_id(s);
+        else
+            vlapic_set_reg(s, APIC_ID, SET_xAPIC_ID(s->hw.x2apic_id));
+    }
 
     hvm_update_vlapic_mode(v);
 
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:46:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:46:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774227.1184735 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3TZ-0008HC-Rd; Thu, 08 Aug 2024 13:46:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774227.1184735; Thu, 08 Aug 2024 13:46:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3TZ-0008H5-Mm; Thu, 08 Aug 2024 13:46:45 +0000
Received: by outflank-mailman (input) for mailman id 774227;
 Thu, 08 Aug 2024 13:46:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zgd2=PH=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sc3Py-0003nA-Gr
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:43:02 +0000
Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com
 [2a00:1450:4864:20::633])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2067c9fe-558c-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 15:43:00 +0200 (CEST)
Received: by mail-ej1-x633.google.com with SMTP id
 a640c23a62f3a-a7ac449a0e6so97726866b.1
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:43:00 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ecb551sm741537166b.223.2024.08.08.06.42.58
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 08 Aug 2024 06:42:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2067c9fe-558c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723124579; x=1723729379; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=+VTFN78Dy6ubfo7KXBLIYL/Uzr8lciQjuQrkAaGjtnE=;
        b=YJXNETU7ePWL1C2wi6asw21A6NPyZ3NnoYFC6h60/ZWgm4v4EtCv+szaWByk0d1ip9
         gT4O46+KBnhA+F0ZvRty1hPtcBy7ZZYmfl45x+FQoPqbCX4KugUnIosIbSDupjLUi4Pa
         NexjDIYD97i5ITut1E7McMgvhpZb4G6TOoiDg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723124579; x=1723729379;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=+VTFN78Dy6ubfo7KXBLIYL/Uzr8lciQjuQrkAaGjtnE=;
        b=bFvQvcx3CBzea7ffe5voru2ptJIDEKVDFwcxllYoDsrWLYhRvEnByLpg6+kV3+dDVc
         vhUS6inFjX1eMYgtGzG300oxi6IHFDSepccL/4BtQk2nxv3k86Z68jzIgNLhIXKfF7rQ
         a0GrNjNID5s1ssYWEn/L8vldh4KwcCe/Mzyac6nPMhGp7zPR05JO+8l/RtNP302Tt1Mn
         lDlFo7jH2ZGW9NzJU1CEa8ZAQjUJo+nhZ9g70fUHF7DLGmRHccfxOxPg5Pyg8ik67w84
         nYPJyt1j9tkHmJEJXodFfYEq1gjGCzDSeUWfftznXBa/HCDKY9/YX2XVFgjukDLfb/J7
         41hw==
X-Gm-Message-State: AOJu0YwoGThnueJ3355n1hjAcprwHHSVSkKErha0Y2vheIOXU7ySmtnd
	JHAc1hTJaZo+r4oiaNdNSrCvZGkiUrc9OmxfvsamxeNkkZuLOhEDJhis4nmYoM2Z74F4iQWm8A2
	J
X-Google-Smtp-Source: AGHT+IHqoPLOpx13tl55zLu8oJpbBkuLBnVeSmOk3BfepcIKxtoZfuEmvq2zx5ODjvJtDyIbKXY6Cw==
X-Received: by 2002:a17:907:2d0c:b0:a77:da14:8409 with SMTP id a640c23a62f3a-a8090e4e0dcmr153843766b.48.1723124579044;
        Thu, 08 Aug 2024 06:42:59 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v5 03/10] xen/x86: Add initial x2APIC ID to the per-vLAPIC save area
Date: Thu,  8 Aug 2024 14:42:43 +0100
Message-ID: <20240808134251.29995-4-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
References: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This allows the initial x2APIC ID to be sent on the migration stream.
This allows further changes to topology and APIC ID assignment without
breaking existing hosts. Given the vlapic data is zero-extended on
restore, fix up migrations from hosts without the field by setting it to
the old convention if zero.

The hardcoded mapping x2apic_id=2*vcpu_id is kept for the time being,
but it's meant to be overriden by toolstack on a later patch with
appropriate values.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v5:
  * No change
---
 xen/arch/x86/cpuid.c                   | 14 +++++---------
 xen/arch/x86/hvm/vlapic.c              | 22 ++++++++++++++++++++--
 xen/arch/x86/include/asm/hvm/vlapic.h  |  1 +
 xen/include/public/arch-x86/hvm/save.h |  2 ++
 4 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/cpuid.c b/xen/arch/x86/cpuid.c
index 2a777436ee27..dcbdeabadce9 100644
--- a/xen/arch/x86/cpuid.c
+++ b/xen/arch/x86/cpuid.c
@@ -138,10 +138,9 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
         const struct cpu_user_regs *regs;
 
     case 0x1:
-        /* TODO: Rework topology logic. */
         res->b &= 0x00ffffffu;
         if ( is_hvm_domain(d) )
-            res->b |= (v->vcpu_id * 2) << 24;
+            res->b |= vlapic_x2apic_id(vcpu_vlapic(v)) << 24;
 
         /* TODO: Rework vPMU control in terms of toolstack choices. */
         if ( vpmu_available(v) &&
@@ -311,18 +310,15 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
 
     case 0xb:
         /*
-         * In principle, this leaf is Intel-only.  In practice, it is tightly
-         * coupled with x2apic, and we offer an x2apic-capable APIC emulation
-         * to guests on AMD hardware as well.
-         *
-         * TODO: Rework topology logic.
+         * Don't expose topology information to PV guests. Exposed on HVM
+         * along with x2APIC because they are tightly coupled.
          */
-        if ( p->basic.x2apic )
+        if ( is_hvm_domain(d) && p->basic.x2apic )
         {
             *(uint8_t *)&res->c = subleaf;
 
             /* Fix the x2APIC identifier. */
-            res->d = v->vcpu_id * 2;
+            res->d = vlapic_x2apic_id(vcpu_vlapic(v));
         }
         break;
 
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 521b98988be9..0e0699fc8279 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1073,7 +1073,7 @@ static uint32_t x2apic_ldr_from_id(uint32_t id)
 static void set_x2apic_id(struct vlapic *vlapic)
 {
     const struct vcpu *v = vlapic_vcpu(vlapic);
-    uint32_t apic_id = v->vcpu_id * 2;
+    uint32_t apic_id = vlapic->hw.x2apic_id;
     uint32_t apic_ldr = x2apic_ldr_from_id(apic_id);
 
     /*
@@ -1453,7 +1453,7 @@ void vlapic_reset(struct vlapic *vlapic)
     if ( v->vcpu_id == 0 )
         vlapic->hw.apic_base_msr |= APIC_BASE_BSP;
 
-    vlapic_set_reg(vlapic, APIC_ID, (v->vcpu_id * 2) << 24);
+    vlapic_set_reg(vlapic, APIC_ID, SET_xAPIC_ID(vlapic->hw.x2apic_id));
     vlapic_do_init(vlapic);
 }
 
@@ -1521,6 +1521,16 @@ static void lapic_load_fixup(struct vlapic *vlapic)
     const struct vcpu *v = vlapic_vcpu(vlapic);
     uint32_t good_ldr = x2apic_ldr_from_id(vlapic->loaded.id);
 
+    /*
+     * Loading record without hw.x2apic_id in the save stream, calculate using
+     * the traditional "vcpu_id * 2" relation. There's an implicit assumption
+     * that vCPU0 always has x2APIC0, which is true for the old relation, and
+     * still holds under the new x2APIC generation algorithm. While that case
+     * goes through the conditional it's benign because it still maps to zero.
+     */
+    if ( !vlapic->hw.x2apic_id )
+        vlapic->hw.x2apic_id = v->vcpu_id * 2;
+
     /* Skip fixups on xAPIC mode, or if the x2APIC LDR is already correct */
     if ( !vlapic_x2apic_mode(vlapic) ||
          (vlapic->loaded.ldr == good_ldr) )
@@ -1589,6 +1599,13 @@ static int cf_check lapic_check_hidden(const struct domain *d,
          APIC_BASE_EXTD )
         return -EINVAL;
 
+    /*
+     * Fail migrations from newer versions of Xen where
+     * rsvd_zero is interpreted as something else.
+     */
+    if ( s.rsvd_zero )
+        return -EINVAL;
+
     return 0;
 }
 
@@ -1667,6 +1684,7 @@ int vlapic_init(struct vcpu *v)
     }
 
     vlapic->pt.source = PTSRC_lapic;
+    vlapic->hw.x2apic_id = 2 * v->vcpu_id;
 
     vlapic->regs_page = alloc_domheap_page(v->domain, MEMF_no_owner);
     if ( !vlapic->regs_page )
diff --git a/xen/arch/x86/include/asm/hvm/vlapic.h b/xen/arch/x86/include/asm/hvm/vlapic.h
index 2c4ff94ae7a8..85c4a236b9f6 100644
--- a/xen/arch/x86/include/asm/hvm/vlapic.h
+++ b/xen/arch/x86/include/asm/hvm/vlapic.h
@@ -44,6 +44,7 @@
 #define vlapic_xapic_mode(vlapic)                               \
     (!vlapic_hw_disabled(vlapic) && \
      !((vlapic)->hw.apic_base_msr & APIC_BASE_EXTD))
+#define vlapic_x2apic_id(vlapic) ((vlapic)->hw.x2apic_id)
 
 /*
  * Generic APIC bitmap vector update & search routines.
diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h
index 7ecacadde165..1c2ec669ffc9 100644
--- a/xen/include/public/arch-x86/hvm/save.h
+++ b/xen/include/public/arch-x86/hvm/save.h
@@ -394,6 +394,8 @@ struct hvm_hw_lapic {
     uint32_t             disabled; /* VLAPIC_xx_DISABLED */
     uint32_t             timer_divisor;
     uint64_t             tdt_msr;
+    uint32_t             x2apic_id;
+    uint32_t             rsvd_zero;
 };
 
 DECLARE_HVM_SAVE_TYPE(LAPIC, 5, struct hvm_hw_lapic);
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:49:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:49:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774243.1184745 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3WA-000137-B9; Thu, 08 Aug 2024 13:49:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774243.1184745; Thu, 08 Aug 2024 13:49:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3WA-000130-7z; Thu, 08 Aug 2024 13:49:26 +0000
Received: by outflank-mailman (input) for mailman id 774243;
 Thu, 08 Aug 2024 13:49:24 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zgd2=PH=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sc3Q1-0003nA-O9
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:43:05 +0000
Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com
 [2a00:1450:4864:20::630])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 22c5ab56-558c-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 15:43:04 +0200 (CEST)
Received: by mail-ej1-x630.google.com with SMTP id
 a640c23a62f3a-a7aada2358fso328243066b.0
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:43:04 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ecb551sm741537166b.223.2024.08.08.06.43.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 08 Aug 2024 06:43:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22c5ab56-558c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723124583; x=1723729383; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Wbk4E5P0kulzM2wSMHSR18a7piPnaRZHfCu+Ysmfmt4=;
        b=Vezwjd1OAaajGk0hgeWszFZZNxyrHT+FUhAzwfVftZqV7m+mPdHzdFfaNtrKVlQNpt
         n6I0dXT8iB9pfRTymiQg0Zntbj6OV98diLqnMsQ/DrP+4DZxJNVofE/vOoPAJ4EkZG/u
         4gsAbiJ/6yEvlIlfaKhbM0vBefI23AZQTLZ4A=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723124583; x=1723729383;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Wbk4E5P0kulzM2wSMHSR18a7piPnaRZHfCu+Ysmfmt4=;
        b=DJetY6PAcL3/OxFaVWB+D+cUNRtnhBjY7hYCXIS2DjlHfZjm+MXhr+VB5lsxURFCVS
         ruzkiE82gJDGSet7FbwERVFdbtd1xRy1copUQ8LSiSvazBP7KyfR5O9Ai5OxurynifOb
         aTma1fIiYSo60w6wrOYXhcmjAnx6db/gH+bMp/pJhTSC58887dmuG9crkXKUcO9yBQMe
         LCa3jFIPN8MDcUQ7HuYeIHOO5ykpfSovw5R8ms05lCLo1eULlOEMWdhlvT0p1W/BboGU
         mYW2I1+3mhr2x1qLPCI/TRcC7PECAzCvOCIgEWdx6JOjGEVqsjmEGjOr8NNTr31gg5Iq
         rIzw==
X-Gm-Message-State: AOJu0YywGG0sYQCVbuXj6pHkR5IBSu/MMCApzpbiyGMDP8/+Q+I003Mm
	3dv9f4WdMclaY4gyE1SZ9Ms+02f+ov7y4yU9Lglc63efj9glkSgEeBJ7GpcbofEu3s7g1cc92IB
	7
X-Google-Smtp-Source: AGHT+IE0yJNfLnzySYuMbL3cadc4rLxRuYKuQaRCOF3SC9X6o2prHqvwFzO9s1qBDqzl+YHKKvh+lA==
X-Received: by 2002:a17:907:9446:b0:a7a:87c1:26c4 with SMTP id a640c23a62f3a-a8091f5684dmr143181766b.17.1723124582978;
        Thu, 08 Aug 2024 06:43:02 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH v5 07/10] xen/lib: Add topology generator for x86
Date: Thu,  8 Aug 2024 14:42:47 +0100
Message-ID: <20240808134251.29995-8-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
References: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add a helper to populate topology leaves in the cpu policy from
threads/core and cores/package counts. It's unit-tested in
test-cpu-policy.c,
but it's not connected to the rest of the code yet.

Adds the ASSERT() macro to xen/lib/x86/private.h, as it was missing.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v5:
  * No change
---
 tools/tests/cpu-policy/test-cpu-policy.c | 133 +++++++++++++++++++++++
 xen/include/xen/lib/x86/cpu-policy.h     |  16 +++
 xen/lib/x86/policy.c                     |  88 +++++++++++++++
 xen/lib/x86/private.h                    |   4 +
 4 files changed, 241 insertions(+)

diff --git a/tools/tests/cpu-policy/test-cpu-policy.c b/tools/tests/cpu-policy/test-cpu-policy.c
index 301df2c00285..849d7cebaa7c 100644
--- a/tools/tests/cpu-policy/test-cpu-policy.c
+++ b/tools/tests/cpu-policy/test-cpu-policy.c
@@ -650,6 +650,137 @@ static void test_is_compatible_failure(void)
     }
 }
 
+static void test_topo_from_parts(void)
+{
+    static const struct test {
+        unsigned int threads_per_core;
+        unsigned int cores_per_pkg;
+        struct cpu_policy policy;
+    } tests[] = {
+        {
+            .threads_per_core = 3, .cores_per_pkg = 1,
+            .policy = {
+                .x86_vendor = X86_VENDOR_AMD,
+                .topo.subleaf = {
+                    { .nr_logical = 3, .level = 0, .type = 1, .id_shift = 2, },
+                    { .nr_logical = 1, .level = 1, .type = 2, .id_shift = 2, },
+                },
+            },
+        },
+        {
+            .threads_per_core = 1, .cores_per_pkg = 3,
+            .policy = {
+                .x86_vendor = X86_VENDOR_AMD,
+                .topo.subleaf = {
+                    { .nr_logical = 1, .level = 0, .type = 1, .id_shift = 0, },
+                    { .nr_logical = 3, .level = 1, .type = 2, .id_shift = 2, },
+                },
+            },
+        },
+        {
+            .threads_per_core = 7, .cores_per_pkg = 5,
+            .policy = {
+                .x86_vendor = X86_VENDOR_AMD,
+                .topo.subleaf = {
+                    { .nr_logical = 7, .level = 0, .type = 1, .id_shift = 3, },
+                    { .nr_logical = 5, .level = 1, .type = 2, .id_shift = 6, },
+                },
+            },
+        },
+        {
+            .threads_per_core = 2, .cores_per_pkg = 128,
+            .policy = {
+                .x86_vendor = X86_VENDOR_AMD,
+                .topo.subleaf = {
+                    { .nr_logical = 2, .level = 0, .type = 1, .id_shift = 1, },
+                    { .nr_logical = 128, .level = 1, .type = 2,
+                      .id_shift = 8, },
+                },
+            },
+        },
+        {
+            .threads_per_core = 3, .cores_per_pkg = 1,
+            .policy = {
+                .x86_vendor = X86_VENDOR_INTEL,
+                .topo.subleaf = {
+                    { .nr_logical = 3, .level = 0, .type = 1, .id_shift = 2, },
+                    { .nr_logical = 3, .level = 1, .type = 2, .id_shift = 2, },
+                },
+            },
+        },
+        {
+            .threads_per_core = 1, .cores_per_pkg = 3,
+            .policy = {
+                .x86_vendor = X86_VENDOR_INTEL,
+                .topo.subleaf = {
+                    { .nr_logical = 1, .level = 0, .type = 1, .id_shift = 0, },
+                    { .nr_logical = 3, .level = 1, .type = 2, .id_shift = 2, },
+                },
+            },
+        },
+        {
+            .threads_per_core = 7, .cores_per_pkg = 5,
+            .policy = {
+                .x86_vendor = X86_VENDOR_INTEL,
+                .topo.subleaf = {
+                    { .nr_logical = 7, .level = 0, .type = 1, .id_shift = 3, },
+                    { .nr_logical = 35, .level = 1, .type = 2, .id_shift = 6, },
+                },
+            },
+        },
+        {
+            .threads_per_core = 2, .cores_per_pkg = 128,
+            .policy = {
+                .x86_vendor = X86_VENDOR_INTEL,
+                .topo.subleaf = {
+                    { .nr_logical = 2, .level = 0, .type = 1, .id_shift = 1, },
+                    { .nr_logical = 256, .level = 1, .type = 2,
+                      .id_shift = 8, },
+                },
+            },
+        },
+    };
+
+    printf("Testing topology synthesis from parts:\n");
+
+    for ( size_t i = 0; i < ARRAY_SIZE(tests); ++i )
+    {
+        const struct test *t = &tests[i];
+        struct cpu_policy actual = { .x86_vendor = t->policy.x86_vendor };
+        int rc = x86_topo_from_parts(&actual, t->threads_per_core,
+                                     t->cores_per_pkg);
+
+        if ( rc || memcmp(&actual.topo, &t->policy.topo, sizeof(actual.topo)) )
+        {
+#define TOPO(n, f)  t->policy.topo.subleaf[(n)].f, actual.topo.subleaf[(n)].f
+            fail("FAIL[%d] - '%s %u t/c, %u c/p'\n",
+                 rc,
+                 x86_cpuid_vendor_to_str(t->policy.x86_vendor),
+                 t->threads_per_core, t->cores_per_pkg);
+            printf("  subleaf=%u  expected_n=%u actual_n=%u\n"
+                   "             expected_lvl=%u actual_lvl=%u\n"
+                   "             expected_type=%u actual_type=%u\n"
+                   "             expected_shift=%u actual_shift=%u\n",
+                   0,
+                   TOPO(0, nr_logical),
+                   TOPO(0, level),
+                   TOPO(0, type),
+                   TOPO(0, id_shift));
+
+            printf("  subleaf=%u  expected_n=%u actual_n=%u\n"
+                   "             expected_lvl=%u actual_lvl=%u\n"
+                   "             expected_type=%u actual_type=%u\n"
+                   "             expected_shift=%u actual_shift=%u\n",
+                   1,
+                   TOPO(1, nr_logical),
+                   TOPO(1, level),
+                   TOPO(1, type),
+                   TOPO(1, id_shift));
+#undef TOPO
+        }
+    }
+}
+
 int main(int argc, char **argv)
 {
     printf("CPU Policy unit tests\n");
@@ -667,6 +798,8 @@ int main(int argc, char **argv)
     test_is_compatible_success();
     test_is_compatible_failure();
 
+    test_topo_from_parts();
+
     if ( nr_failures )
         printf("Done: %u failures\n", nr_failures);
     else
diff --git a/xen/include/xen/lib/x86/cpu-policy.h b/xen/include/xen/lib/x86/cpu-policy.h
index f43e1a3b21e9..116b305a1d7f 100644
--- a/xen/include/xen/lib/x86/cpu-policy.h
+++ b/xen/include/xen/lib/x86/cpu-policy.h
@@ -542,6 +542,22 @@ int x86_cpu_policies_are_compatible(const struct cpu_policy *host,
                                     const struct cpu_policy *guest,
                                     struct cpu_policy_errors *err);
 
+/**
+ * Synthesise topology information in `p` given high-level constraints
+ *
+ * Topology is given in various fields accross several leaves, some of
+ * which are vendor-specific. This function uses the policy itself to
+ * derive such leaves from threads/core and cores/package.
+ *
+ * @param p                   CPU policy of the domain.
+ * @param threads_per_core    threads/core. Doesn't need to be a power of 2.
+ * @param cores_per_package   cores/package. Doesn't need to be a power of 2.
+ * @return                    0 on success; -errno on failure
+ */
+int x86_topo_from_parts(struct cpu_policy *p,
+                        unsigned int threads_per_core,
+                        unsigned int cores_per_pkg);
+
 #endif /* !XEN_LIB_X86_POLICIES_H */
 
 /*
diff --git a/xen/lib/x86/policy.c b/xen/lib/x86/policy.c
index f033d22785be..72b67b44a893 100644
--- a/xen/lib/x86/policy.c
+++ b/xen/lib/x86/policy.c
@@ -2,6 +2,94 @@
 
 #include <xen/lib/x86/cpu-policy.h>
 
+static unsigned int order(unsigned int n)
+{
+    ASSERT(n); /* clz(0) is UB */
+
+    return 8 * sizeof(n) - __builtin_clz(n);
+}
+
+int x86_topo_from_parts(struct cpu_policy *p,
+                        unsigned int threads_per_core,
+                        unsigned int cores_per_pkg)
+{
+    unsigned int threads_per_pkg = threads_per_core * cores_per_pkg;
+    unsigned int apic_id_size;
+
+    if ( !p || !threads_per_core || !cores_per_pkg )
+        return -EINVAL;
+
+    p->basic.max_leaf = MAX(0xb, p->basic.max_leaf);
+
+    memset(p->topo.raw, 0, sizeof(p->topo.raw));
+
+    /* thread level */
+    p->topo.subleaf[0].nr_logical = threads_per_core;
+    p->topo.subleaf[0].id_shift = 0;
+    p->topo.subleaf[0].level = 0;
+    p->topo.subleaf[0].type = 1;
+    if ( threads_per_core > 1 )
+        p->topo.subleaf[0].id_shift = order(threads_per_core - 1);
+
+    /* core level */
+    p->topo.subleaf[1].nr_logical = cores_per_pkg;
+    if ( p->x86_vendor == X86_VENDOR_INTEL )
+        p->topo.subleaf[1].nr_logical = threads_per_pkg;
+    p->topo.subleaf[1].id_shift = p->topo.subleaf[0].id_shift;
+    p->topo.subleaf[1].level = 1;
+    p->topo.subleaf[1].type = 2;
+    if ( cores_per_pkg > 1 )
+        p->topo.subleaf[1].id_shift += order(cores_per_pkg - 1);
+
+    apic_id_size = p->topo.subleaf[1].id_shift;
+
+    /*
+     * Contrary to what the name might seem to imply. HTT is an enabler for
+     * SMP and there's no harm in setting it even with a single vCPU.
+     */
+    p->basic.htt = true;
+    p->basic.lppp = MIN(0xff, threads_per_pkg);
+
+    switch ( p->x86_vendor )
+    {
+    case X86_VENDOR_INTEL: {
+        struct cpuid_cache_leaf *sl = p->cache.subleaf;
+
+        for ( size_t i = 0; sl->type &&
+                            i < ARRAY_SIZE(p->cache.raw); i++, sl++ )
+        {
+            sl->cores_per_package = cores_per_pkg - 1;
+            sl->threads_per_cache = threads_per_core - 1;
+            if ( sl->type == 3 /* unified cache */ )
+                sl->threads_per_cache = threads_per_pkg - 1;
+        }
+        break;
+    }
+
+    case X86_VENDOR_AMD:
+    case X86_VENDOR_HYGON:
+        /* Expose p->basic.lppp */
+        p->extd.cmp_legacy = true;
+
+        /* Clip NC to the maximum value it can hold */
+        p->extd.nc = MIN(0xff, threads_per_pkg - 1);
+
+        /* TODO: Expose leaf e1E */
+        p->extd.topoext = false;
+
+        /*
+         * Clip APIC ID to 8 bits, as that's what high core-count machines do.
+         *
+         * That's what AMD EPYC 9654 does with >256 CPUs.
+         */
+        p->extd.apic_id_size = MIN(8, apic_id_size);
+
+        break;
+    }
+
+    return 0;
+}
+
 int x86_cpu_policies_are_compatible(const struct cpu_policy *host,
                                     const struct cpu_policy *guest,
                                     struct cpu_policy_errors *err)
diff --git a/xen/lib/x86/private.h b/xen/lib/x86/private.h
index 60bb82a400b7..2ec9dbee33c2 100644
--- a/xen/lib/x86/private.h
+++ b/xen/lib/x86/private.h
@@ -4,6 +4,7 @@
 #ifdef __XEN__
 
 #include <xen/bitops.h>
+#include <xen/bug.h>
 #include <xen/guest_access.h>
 #include <xen/kernel.h>
 #include <xen/lib.h>
@@ -17,6 +18,7 @@
 
 #else
 
+#include <assert.h>
 #include <errno.h>
 #include <inttypes.h>
 #include <stdbool.h>
@@ -28,6 +30,8 @@
 
 #include <xen-tools/common-macros.h>
 
+#define ASSERT(x) assert(x)
+
 static inline bool test_bit(unsigned int bit, const void *vaddr)
 {
     const char *addr = vaddr;
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:50:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:50:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774262.1184754 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3XC-0002xh-K6; Thu, 08 Aug 2024 13:50:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774262.1184754; Thu, 08 Aug 2024 13:50:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3XC-0002xa-Ha; Thu, 08 Aug 2024 13:50:30 +0000
Received: by outflank-mailman (input) for mailman id 774262;
 Thu, 08 Aug 2024 13:50:30 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zgd2=PH=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sc3Q0-0003nA-MA
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:43:04 +0000
Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com
 [2a00:1450:4864:20::630])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 22119375-558c-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 15:43:02 +0200 (CEST)
Received: by mail-ej1-x630.google.com with SMTP id
 a640c23a62f3a-a7a83a968ddso109089266b.0
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:43:02 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ecb551sm741537166b.223.2024.08.08.06.43.01
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 08 Aug 2024 06:43:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22119375-558c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723124582; x=1723729382; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=44Z3UJCQiLUwVjk+ZfmbNwew8QNeYDhbqPEhop9SA8M=;
        b=dnAtL7ffto0SnuU5D4qk0EvADsSthNUh4ImOT+uTrLrdQGO84gvZuUsI4iFLsP1xtR
         xYkC8BIdAj+YQ7M6olgMQY1FOghKMxWAohac0fo2O/0kWoLP+Oyu3e0j5gu25nQM98Fb
         dc73EPqbBqQ1ilStI2TDZXCwOIu8mC2VlLKmA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723124582; x=1723729382;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=44Z3UJCQiLUwVjk+ZfmbNwew8QNeYDhbqPEhop9SA8M=;
        b=VCb7dZmVgIQh9A6VoHxhMMw8zDYk9lqwGENLewtGXZEHs5ibZu/eZWtT25yXFoTGCW
         jns64ggL6shqwgB5IEOrNAb6GY4/EFD+PiEzqI7nvVEK8xEz9ryZJZDyOj1u/wDe80of
         EXffOJJQVX80mq9fqcs/eLXxXJLo9wMfS3w9giY6BGznzZqD8t2wfZ2hdATd9MLHxHiS
         Y2bA/kVR+ENUvOqMa34cr7xIrELcotquSt1b4NydggTxggoQbOC7UwzuPmVmQ8svdioj
         cQwCEfEneS1ykaCG4DbJyWSbdoIx60p+qT0WUYMuXnKVFJFOVeTGT/EqxKK8kcnOhxoy
         kBgg==
X-Gm-Message-State: AOJu0YzkUFMEpnfIbGVkY90ipOTZIfkauDU+zOSGIdjWYPkFTnSlfqf7
	gdgL1+CvQiNauO7tj8Jbf8nQ6C662Q4wNvHcxCXkDd1xVukeDFqcmsr8UCudaC/rhR9tp3gXVNd
	B
X-Google-Smtp-Source: AGHT+IFj6rQ9MPbgA5ESi29mmvueuOquozJ7crgbGCTA6rqHN5lTa7DD7e0D0VsECtzX+QwdQHbzzA==
X-Received: by 2002:a17:907:e652:b0:a7a:b561:3564 with SMTP id a640c23a62f3a-a8090f07f4dmr131831566b.61.1723124582000;
        Thu, 08 Aug 2024 06:43:02 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v5 06/10] tools/libguest: Always set vCPU context in vcpu_hvm()
Date: Thu,  8 Aug 2024 14:42:46 +0100
Message-ID: <20240808134251.29995-7-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
References: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Currently used by PVH to set MTRR, will be used by a later patch to set
APIC state. Unconditionally send the hypercall, and gate overriding the
MTRR so it remains functionally equivalent.

While at it, add a missing "goto out" to what was the error condition
in the loop.

In principle this patch shouldn't affect functionality. An extra record
(the MTRR) is sent to the hypervisor per vCPU on HVM, but these records
are identical to those retrieved in the first place so there's no
expected functional change.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v5:
  * Ensure MTRRs are only overriden in PVH, and left as-is on HVM
---
 tools/libs/guest/xg_dom_x86.c | 84 ++++++++++++++++++-----------------
 1 file changed, 44 insertions(+), 40 deletions(-)

diff --git a/tools/libs/guest/xg_dom_x86.c b/tools/libs/guest/xg_dom_x86.c
index cba01384ae75..fafe7acb7e91 100644
--- a/tools/libs/guest/xg_dom_x86.c
+++ b/tools/libs/guest/xg_dom_x86.c
@@ -989,6 +989,7 @@ const static void *hvm_get_save_record(const void *ctx, unsigned int type,
 
 static int vcpu_hvm(struct xc_dom_image *dom)
 {
+    /* Initialises the BSP */
     struct {
         struct hvm_save_descriptor header_d;
         HVM_SAVE_TYPE(HEADER) header;
@@ -997,6 +998,18 @@ static int vcpu_hvm(struct xc_dom_image *dom)
         struct hvm_save_descriptor end_d;
         HVM_SAVE_TYPE(END) end;
     } bsp_ctx;
+    /* Initialises APICs and MTRRs of every vCPU */
+    struct {
+        struct hvm_save_descriptor header_d;
+        HVM_SAVE_TYPE(HEADER) header;
+        struct hvm_save_descriptor mtrr_d;
+        HVM_SAVE_TYPE(MTRR) mtrr;
+        struct hvm_save_descriptor end_d;
+        HVM_SAVE_TYPE(END) end;
+    } vcpu_ctx;
+    /* Context from full_ctx */
+    const HVM_SAVE_TYPE(MTRR) *mtrr_record;
+    /* Raw context as taken from Xen */
     uint8_t *full_ctx = NULL;
     int rc;
 
@@ -1083,51 +1096,42 @@ static int vcpu_hvm(struct xc_dom_image *dom)
     bsp_ctx.end_d.instance = 0;
     bsp_ctx.end_d.length = HVM_SAVE_LENGTH(END);
 
-    /* TODO: maybe this should be a firmware option instead? */
-    if ( !dom->device_model )
+    /* TODO: maybe setting MTRRs should be a firmware option instead? */
+    mtrr_record = hvm_get_save_record(full_ctx, HVM_SAVE_CODE(MTRR), 0);
+
+    if ( !mtrr_record)
     {
-        struct {
-            struct hvm_save_descriptor header_d;
-            HVM_SAVE_TYPE(HEADER) header;
-            struct hvm_save_descriptor mtrr_d;
-            HVM_SAVE_TYPE(MTRR) mtrr;
-            struct hvm_save_descriptor end_d;
-            HVM_SAVE_TYPE(END) end;
-        } mtrr = {
-            .header_d = bsp_ctx.header_d,
-            .header = bsp_ctx.header,
-            .mtrr_d.typecode = HVM_SAVE_CODE(MTRR),
-            .mtrr_d.length = HVM_SAVE_LENGTH(MTRR),
-            .end_d = bsp_ctx.end_d,
-            .end = bsp_ctx.end,
-        };
-        const HVM_SAVE_TYPE(MTRR) *mtrr_record =
-            hvm_get_save_record(full_ctx, HVM_SAVE_CODE(MTRR), 0);
-        unsigned int i;
-
-        if ( !mtrr_record )
-        {
-            xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
-                         "%s: unable to get MTRR save record", __func__);
-            goto out;
-        }
+        xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                     "%s: unable to get MTRR save record", __func__);
+        goto out;
+    }
 
-        memcpy(&mtrr.mtrr, mtrr_record, sizeof(mtrr.mtrr));
+    vcpu_ctx.header_d = bsp_ctx.header_d;
+    vcpu_ctx.header = bsp_ctx.header;
+    vcpu_ctx.mtrr_d.typecode = HVM_SAVE_CODE(MTRR);
+    vcpu_ctx.mtrr_d.length = HVM_SAVE_LENGTH(MTRR);
+    vcpu_ctx.mtrr = *mtrr_record;
+    vcpu_ctx.end_d = bsp_ctx.end_d;
+    vcpu_ctx.end = bsp_ctx.end;
 
-        /*
-         * Enable MTRR, set default type to WB.
-         * TODO: add MMIO areas as UC when passthrough is supported.
-         */
-        mtrr.mtrr.msr_mtrr_def_type = MTRR_TYPE_WRBACK | MTRR_DEF_TYPE_ENABLE;
+    /*
+     * Enable MTRR, set default type to WB.
+     * TODO: add MMIO areas as UC when passthrough is supported in PVH
+     */
+    if ( !dom->device_model)
+        vcpu_ctx.mtrr.msr_mtrr_def_type = MTRR_TYPE_WRBACK | MTRR_DEF_TYPE_ENABLE;
 
-        for ( i = 0; i < dom->max_vcpus; i++ )
+    for ( unsigned int i = 0; i < dom->max_vcpus; i++ )
+    {
+        vcpu_ctx.mtrr_d.instance = i;
+
+        rc = xc_domain_hvm_setcontext(dom->xch, dom->guest_domid,
+                                      (uint8_t *)&vcpu_ctx, sizeof(vcpu_ctx));
+        if ( rc != 0 )
         {
-            mtrr.mtrr_d.instance = i;
-            rc = xc_domain_hvm_setcontext(dom->xch, dom->guest_domid,
-                                          (uint8_t *)&mtrr, sizeof(mtrr));
-            if ( rc != 0 )
-                xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
-                             "%s: SETHVMCONTEXT failed (rc=%d)", __func__, rc);
+            xc_dom_panic(dom->xch, XC_INTERNAL_ERROR,
+                         "%s: SETHVMCONTEXT failed (rc=%d)", __func__, rc);
+            goto out;
         }
     }
 
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 13:50:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 13:50:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774276.1184765 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3Xa-0003a2-S7; Thu, 08 Aug 2024 13:50:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774276.1184765; Thu, 08 Aug 2024 13:50:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3Xa-0003Zv-Os; Thu, 08 Aug 2024 13:50:54 +0000
Received: by outflank-mailman (input) for mailman id 774276;
 Thu, 08 Aug 2024 13:50:53 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zgd2=PH=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sc3Q2-0003nA-Mn
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 13:43:06 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2329c604-558c-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 15:43:04 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5a3b866ebc9so1119601a12.3
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 06:43:04 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ecb551sm741537166b.223.2024.08.08.06.43.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 08 Aug 2024 06:43:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2329c604-558c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723124584; x=1723729384; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=dpkaQj0AAChy0px6eMw41BqPD+iDFSczkUolNTgS1vM=;
        b=Wvle1QU1yRusqp67FSsfkWNYx853zY9wOoNS/8VC7rvBQcO+6yTe01yVSVHMSTibDy
         xF2pBD/B4XUMdLh2CLU7ggXFsWKcEEusDfcWYsodoPVdDRIxhfe6DZEDACkNadYCP9aV
         3k+JlO29wg3kniPWTGHm6n2xh7FXEEIbLaOd8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723124584; x=1723729384;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=dpkaQj0AAChy0px6eMw41BqPD+iDFSczkUolNTgS1vM=;
        b=nAYRQr53uTqSJPtg+G6XvGkK9vLN9cU3J2rKZA8QYkDp0AZ1j3MguvWqIzJBmlWE5P
         KEsfEy1PL4wNSarAvUHaODisTdLxAuqZwJpJtPK/U4SF5VSfGzgwHVadrESvkNWlLabY
         /6mFmzMuphIu0onwL89lQFCqDRjQ4KqBiudkdMiNpmHLNKKA6y8ezA0RMpCzC2SkoDjo
         XQ4y5G6272U8JFvI5ETSyL2JoAky5tZr3/h8skzrNa/u7dDfggH/zm/oROCXr9Svi9Qi
         w1H7dJW6h0T9t02RYP45EYKDFY7kMPIdX2z2k46qYdrY3fkME11NsFWK28bbLK+yE1Yt
         8Qfg==
X-Gm-Message-State: AOJu0YzSAYUcOXWApPB+v+3mr87R5y6oav28pvrkzd45z0FQcUj95MQj
	1bNygG3QMp0OQZ/qNUgQsPgMaM8JXmHTeCKS0NmlNg2l0OhqTKJoXA6Pu9Zd6HVV4w70PoTMskn
	E
X-Google-Smtp-Source: AGHT+IGRd6n0ebyaPtVGqWX3E+loxh0iSS5zMIcsnobxxxKh+2BOwVZfM5NY9BxP3vp0hnYSIlvluQ==
X-Received: by 2002:a17:907:d2c5:b0:a77:c95e:9b1c with SMTP id a640c23a62f3a-a8090d7affdmr146859766b.27.1723124583705;
        Thu, 08 Aug 2024 06:43:03 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH v5 08/10] xen/x86: Derive topologically correct x2APIC IDs from the policy
Date: Thu,  8 Aug 2024 14:42:48 +0100
Message-ID: <20240808134251.29995-9-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
References: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Implements the helper for mapping vcpu_id to x2apic_id given a valid
topology in a policy. The algo is written with the intention of
extending it to leaves 0x1f and extended 0x26 in the future.

Toolstack doesn't set leaf 0xb and the HVM default policy has it
cleared, so the leaf is not implemented. In that case, the new helper
just returns the legacy mapping.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v5:
  * No change
---
 tools/tests/cpu-policy/test-cpu-policy.c | 68 +++++++++++++++++++++
 xen/include/xen/lib/x86/cpu-policy.h     | 11 ++++
 xen/lib/x86/policy.c                     | 76 ++++++++++++++++++++++++
 3 files changed, 155 insertions(+)

diff --git a/tools/tests/cpu-policy/test-cpu-policy.c b/tools/tests/cpu-policy/test-cpu-policy.c
index 849d7cebaa7c..e5f9b8f7ee39 100644
--- a/tools/tests/cpu-policy/test-cpu-policy.c
+++ b/tools/tests/cpu-policy/test-cpu-policy.c
@@ -781,6 +781,73 @@ static void test_topo_from_parts(void)
     }
 }
 
+static void test_x2apic_id_from_vcpu_id_success(void)
+{
+    static const struct test {
+        unsigned int vcpu_id;
+        unsigned int threads_per_core;
+        unsigned int cores_per_pkg;
+        uint32_t x2apic_id;
+        uint8_t x86_vendor;
+    } tests[] = {
+        {
+            .vcpu_id = 3, .threads_per_core = 3, .cores_per_pkg = 8,
+            .x2apic_id = 1 << 2,
+        },
+        {
+            .vcpu_id = 6, .threads_per_core = 3, .cores_per_pkg = 8,
+            .x2apic_id = 2 << 2,
+        },
+        {
+            .vcpu_id = 24, .threads_per_core = 3, .cores_per_pkg = 8,
+            .x2apic_id = 1 << 5,
+        },
+        {
+            .vcpu_id = 35, .threads_per_core = 3, .cores_per_pkg = 8,
+            .x2apic_id = (35 % 3) | (((35 / 3) % 8) << 2) | ((35 / 24) << 5),
+        },
+        {
+            .vcpu_id = 96, .threads_per_core = 7, .cores_per_pkg = 3,
+            .x2apic_id = (96 % 7) | (((96 / 7) % 3) << 3) | ((96 / 21) << 5),
+        },
+    };
+
+    const uint8_t vendors[] = {
+        X86_VENDOR_INTEL,
+        X86_VENDOR_AMD,
+        X86_VENDOR_CENTAUR,
+        X86_VENDOR_SHANGHAI,
+        X86_VENDOR_HYGON,
+    };
+
+    printf("Testing x2apic id from vcpu id success:\n");
+
+    /* Perform the test run on every vendor we know about */
+    for ( size_t i = 0; i < ARRAY_SIZE(vendors); ++i )
+    {
+        for ( size_t j = 0; j < ARRAY_SIZE(tests); ++j )
+        {
+            struct cpu_policy policy = { .x86_vendor = vendors[i] };
+            const struct test *t = &tests[j];
+            uint32_t x2apic_id;
+            int rc = x86_topo_from_parts(&policy, t->threads_per_core,
+                                         t->cores_per_pkg);
+
+            if ( rc ) {
+                fail("FAIL[%d] - 'x86_topo_from_parts() failed", rc);
+                continue;
+            }
+
+            x2apic_id = x86_x2apic_id_from_vcpu_id(&policy, t->vcpu_id);
+            if ( x2apic_id != t->x2apic_id )
+                fail("FAIL - '%s cpu%u %u t/c %u c/p'. bad x2apic_id: expected=%u actual=%u\n",
+                     x86_cpuid_vendor_to_str(policy.x86_vendor),
+                     t->vcpu_id, t->threads_per_core, t->cores_per_pkg,
+                     t->x2apic_id, x2apic_id);
+        }
+    }
+}
+
 int main(int argc, char **argv)
 {
     printf("CPU Policy unit tests\n");
@@ -799,6 +866,7 @@ int main(int argc, char **argv)
     test_is_compatible_failure();
 
     test_topo_from_parts();
+    test_x2apic_id_from_vcpu_id_success();
 
     if ( nr_failures )
         printf("Done: %u failures\n", nr_failures);
diff --git a/xen/include/xen/lib/x86/cpu-policy.h b/xen/include/xen/lib/x86/cpu-policy.h
index 116b305a1d7f..6fe19490d290 100644
--- a/xen/include/xen/lib/x86/cpu-policy.h
+++ b/xen/include/xen/lib/x86/cpu-policy.h
@@ -542,6 +542,17 @@ int x86_cpu_policies_are_compatible(const struct cpu_policy *host,
                                     const struct cpu_policy *guest,
                                     struct cpu_policy_errors *err);
 
+/**
+ * Calculates the x2APIC ID of a vCPU given a CPU policy
+ *
+ * If the policy lacks leaf 0xb falls back to legacy mapping of apic_id=cpu*2
+ *
+ * @param p          CPU policy of the domain.
+ * @param id         vCPU ID of the vCPU.
+ * @returns x2APIC ID of the vCPU.
+ */
+uint32_t x86_x2apic_id_from_vcpu_id(const struct cpu_policy *p, uint32_t id);
+
 /**
  * Synthesise topology information in `p` given high-level constraints
  *
diff --git a/xen/lib/x86/policy.c b/xen/lib/x86/policy.c
index 72b67b44a893..c52b7192559a 100644
--- a/xen/lib/x86/policy.c
+++ b/xen/lib/x86/policy.c
@@ -2,6 +2,82 @@
 
 #include <xen/lib/x86/cpu-policy.h>
 
+static uint32_t parts_per_higher_scoped_level(const struct cpu_policy *p,
+                                              size_t lvl)
+{
+    /*
+     * `nr_logical` reported by Intel is the number of THREADS contained in
+     * the next topological scope. For example, assuming a system with 2
+     * threads/core and 3 cores/module in a fully symmetric topology,
+     * `nr_logical` at the core level will report 6. Because it's reporting
+     * the number of threads in a module.
+     *
+     * On AMD/Hygon, nr_logical is already normalized by the higher scoped
+     * level (cores/complex, etc) so we can return it as-is.
+     */
+    if ( p->x86_vendor != X86_VENDOR_INTEL || !lvl )
+        return p->topo.subleaf[lvl].nr_logical;
+
+    return p->topo.subleaf[lvl].nr_logical /
+           p->topo.subleaf[lvl - 1].nr_logical;
+}
+
+uint32_t x86_x2apic_id_from_vcpu_id(const struct cpu_policy *p, uint32_t id)
+{
+    uint32_t shift = 0, x2apic_id = 0;
+
+    /* In the absence of topology leaves, fallback to traditional mapping */
+    if ( !p->topo.subleaf[0].type )
+        return id * 2;
+
+    /*
+     * `id` means different things at different points of the algo
+     *
+     * At lvl=0: global thread_id (same as vcpu_id)
+     * At lvl=1: global core_id
+     * At lvl=2: global socket_id (actually complex_id in AMD, module_id
+     *                             in Intel, but the name is inconsequential)
+     *
+     *                 +--+
+     *            ____ |#0| ______           <= 1 socket
+     *           /     +--+       \+--+
+     *       __#0__              __|#1|__    <= 2 cores/socket
+     *      /   |  \        +--+/  +-|+  \
+     *    #0   #1   #2      |#3|    #4    #5 <= 3 threads/core
+     *                      +--+
+     *
+     * ... and so on. Global in this context means that it's a unique
+     * identifier for the whole topology, and not relative to the level
+     * it's in. For example, in the diagram shown above, we're looking at
+     * thread #3 in the global sense, though it's #0 within its core.
+     *
+     * Note that dividing a global thread_id by the number of threads per
+     * core returns the global core id that contains it. e.g: 0, 1 or 2
+     * divided by 3 returns core_id=0. 3, 4 or 5 divided by 3 returns core
+     * 1, and so on. An analogous argument holds for higher levels. This is
+     * the property we exploit to derive x2apic_id from vcpu_id.
+     *
+     * NOTE: `topo` is currently derived from leaf 0xb, which is bound to two
+     * levels, but once we track leaves 0x1f (or extended 0x26) there will be a
+     * few more. The algorithm is written to cope with that case.
+     */
+    for ( uint32_t i = 0; i < ARRAY_SIZE(p->topo.raw); i++ )
+    {
+        uint32_t nr_parts;
+
+        if ( !p->topo.subleaf[i].type )
+            /* sentinel subleaf */
+            break;
+
+        nr_parts = parts_per_higher_scoped_level(p, i);
+        x2apic_id |= (id % nr_parts) << shift;
+        id /= nr_parts;
+        shift = p->topo.subleaf[i].id_shift;
+    }
+
+    return (id << shift) | x2apic_id;
+}
+
 static unsigned int order(unsigned int n)
 {
     ASSERT(n); /* clz(0) is UB */
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 14:04:51 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 14:04:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774307.1184774 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3kt-0006gH-3R; Thu, 08 Aug 2024 14:04:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774307.1184774; Thu, 08 Aug 2024 14:04:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3kt-0006gA-0f; Thu, 08 Aug 2024 14:04:39 +0000
Received: by outflank-mailman (input) for mailman id 774307;
 Thu, 08 Aug 2024 14:04:37 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sc3kr-0006g4-KD
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 14:04:37 +0000
Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com
 [2a00:1450:4864:20::235])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 24959d70-558f-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 16:04:35 +0200 (CEST)
Received: by mail-lj1-x235.google.com with SMTP id
 38308e7fff4ca-2f149845fbaso11381071fa.3
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 07:04:35 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bbb2bf841asm658654a12.5.2024.08.08.07.04.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 07:04:34 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 24959d70-558f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723125875; x=1723730675; 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=F3Hiwn83/hPkHG9ZCiIgmFLjceHba451PSwmIJ/BWag=;
        b=O/x9OopAdvPa6rO/EnNcjP6u/xt2rLaI+tWEDAh1rP30MgWDzeBUt5VA8V6SPRQXaS
         X7y43rw6Emga58TmTTh2cUuGadD8Zmaf/hQTkeTyPmGLJ9u4VxBcpm0kOTDc+EH5bjuj
         8UHRSoDBCfASpjdjc9b7IAunnoUDHWvxXlA75iqEdYQx3UqPhzk0e6da3IqS9W7Z1wc/
         Ubnl7Ft/v7qDdOg2o6RgtzRa2YhESgCMacXSvdviPVpbB1Y5A76gWZMcDWm5BVGuD1iI
         SL/cofxC4VMO6Sf7+apjdsJZ4KpsjmZBRe8UOqr88cMpPhH6C4zraoClik+gv0i9jDWm
         xYLA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723125875; x=1723730675;
        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=F3Hiwn83/hPkHG9ZCiIgmFLjceHba451PSwmIJ/BWag=;
        b=WAbHDfXCClcy9Sv9hVZyGeVyeAn6NSWMqt6ngqbg1VXiccJXefPTzPAEn+icRPjfJj
         xwgWAIqDP0+nu1oqXaObTZHZx5s865mmTH/ASsJYSdaylGvGSagND16oWBDvlu8yvcet
         9ilQk3C+clTp8/YC30UZRp9gA0C8Wi4azZ+nr+Pvo1IiHz4zC44i2IznaSbsUrgjIEMb
         uhTT9k9PQeW7gcIimNiSsfJTDa43coiHbHdvm3pT1ohLPvZVIpPvUyGTolR3ioHztLP1
         cadc1uc4nRb6BdN4fccc2W+KuWtHuMGJw0U7FwAR3Y4M+CA1VMiFrmNkziS4itdglqB1
         /DvQ==
X-Gm-Message-State: AOJu0YzokAuQVEw4dYBeKaB1Ie2tDGJxTJPeoKK6TRBMjnhZtHaeXrY7
	R4XT5ITTwG9NwQglaTMJ4DCjbwG63zjpqOJ/6vKF/9bCUbVos3qXmlF0tVvNVA==
X-Google-Smtp-Source: AGHT+IG44mFLqcGbvRUJdVwV24iQGHsI8hYShcqkZ2Qx7qzDu0NWYYwQh8ytUSWeGg3NNXaWEmkIqg==
X-Received: by 2002:a05:6512:3350:b0:52e:f950:31f3 with SMTP id 2adb3069b0e04-530e585b975mr1247762e87.35.1723125874543;
        Thu, 08 Aug 2024 07:04:34 -0700 (PDT)
Message-ID: <2e0eac09-4065-4f1c-ba09-70cf9ff9e834@suse.com>
Date: Thu, 8 Aug 2024 16:04:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/5] x86: Fix early output messages in case of EFI
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-3-alejandro.vallejo@cloud.com>
 <7f1e17dd-d105-4f6c-87d3-69f3dca4ab82@suse.com>
 <CACHz=ZjYdBcB_S1tpXpuRQDKGAKY=SrgTEy8_0Wyq_q+bOBfHg@mail.gmail.com>
 <bd4c8ef5-a6bb-42ae-9b69-c3d14eeac55e@suse.com>
 <CACHz=ZgRK2DMHmiAVsBo1WJVBxbnTka3-CcpgopKB-6gWs5ZSw@mail.gmail.com>
 <57e01574-2e06-4dd3-bf7f-91b5a19477b1@suse.com>
 <CACHz=Zi56VX7VE9ESRhm-3YJCqKV9z3yZKY+nWrz827e0t+rnw@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: <CACHz=Zi56VX7VE9ESRhm-3YJCqKV9z3yZKY+nWrz827e0t+rnw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 08.08.2024 15:17, Frediano Ziglio wrote:
> The computation of %esi is correct after the additional "add" command,
> in the sense it will point to the current base (under 4GB) however
> then you will use syms_esi(foo) thinking "if %esi is correct then also
> syms_esi is correct" and it isn't.
> So either you need to add another offset to make syms_esi(foo) correct
> having %esi not pointing to the base or assuming that syms_esi(foo)
> would need fixing.
> Potentially the first option would be better, you just need to
> remember to correct %esi after rolling back relocations.

Right, the preferred goal is to have sym_esi() working right, so you
wouldn't need to touch all of them. The number of direct uses of %esi
is, I think, far smaller.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 14:10:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 14:10:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774317.1184785 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3qE-00018r-Ly; Thu, 08 Aug 2024 14:10:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774317.1184785; Thu, 08 Aug 2024 14:10:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc3qE-00018k-IJ; Thu, 08 Aug 2024 14:10:10 +0000
Received: by outflank-mailman (input) for mailman id 774317;
 Thu, 08 Aug 2024 14:10: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=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sc3qD-00011i-4N
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 14:10:09 +0000
Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com
 [2a00:1450:4864:20::12b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ea487ef0-558f-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 16:10:07 +0200 (CEST)
Received: by mail-lf1-x12b.google.com with SMTP id
 2adb3069b0e04-52efd8807aaso1135878e87.3
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 07:10:07 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9c0cc2asm745458666b.63.2024.08.08.07.10.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 07:10:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ea487ef0-558f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723126207; x=1723731007; 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=fz7OM67V+Q4sMkAh3kEyC5umDcwm4wOSg5gaazlgMNA=;
        b=AvfL6kHnfvcnQ+YHsK2PRTLFkMURzknOdrIjorcz9+nwkZkkeo0JqItWz09jc22QrH
         Uk60s3HI3Y4pCDXLUjLHJarfIrGhqAvtIb94bGwC10XNijl6KiYEKvNwPRZbZJgI2uqK
         syxjTtafFSz+jHjkUomJvzVCSEshtm5mP1PRXXNYBprRPF5+VVsArtFGJn5BJrj56bME
         WZYwh8eRnuYi9k2BtmDbQM9fqe69RGEz/Xvo4poW0uXoOMbx4Xq1tDLfXOVdOfm2vqOH
         G7Ne3XdrGga4qvywIMjAgpNYQgO84BAYZDYTgKrWnxj1Uj/rEwZNWdi/NUAneP0egiTx
         5O0Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723126207; x=1723731007;
        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=fz7OM67V+Q4sMkAh3kEyC5umDcwm4wOSg5gaazlgMNA=;
        b=Hs6WF37ulCjAr712ctNIToxmH5lamI3GsBlQiwFRl85MGYycC1fIiuD3KiwT2c77rV
         bBHKWzKUlU8Z/+KMTZQQjeatuu/2+tT7lVX/PztvscP48+BEAhJp1cJPLTkGwngBM29r
         evCiPOdj94x2OqGcFJ3zgWay/Po6aTnCgjpG+/vdKDMoXnrZHlEk+5qtWeswd1mGGe6O
         f70YhbInzQLne/4S7Rz8lBlTFRBggHKCuCmSaoUxVGn39+T9MfdtZsFi3yYLrNX3orAI
         rQS5f53/7fvlAJiqSaFVclgKTUKqskF3ad8q63KI5zqHf9Xl3YheTqK7C0nvH06wFCaP
         XLJg==
X-Forwarded-Encrypted: i=1; AJvYcCW2ZCbKORtOh++1fiMQfxvlg77pHyIuOCwzVu7AgRKWWnZOqYKAsuBjiJfb72ooNa4EUUY60dxMnVXkKEJNskpP3UpIppHC5/s5pBwgZSI=
X-Gm-Message-State: AOJu0YyMwSdY27ErVaxl1ud1PqncfNSAYIFM/isrpXBX/i7aTaVg4/M1
	vtvjnNS5WgeARbRS0X+K22BxkSsAT6/k51WkfLdTgkVLMtGY77mIYq7GMmN94Q==
X-Google-Smtp-Source: AGHT+IEIWVKDQXoB7DXQ5/2rLddR/leRKMZqk2QwHIiGZj+LpsV0CWAej3/HEE7mhocJ2R6a0dJcJA==
X-Received: by 2002:a05:6512:b03:b0:530:db85:e02a with SMTP id 2adb3069b0e04-530e5875653mr1591848e87.22.1723126206430;
        Thu, 08 Aug 2024 07:10:06 -0700 (PDT)
Message-ID: <b1b7eaea-450c-44bd-b97a-491183a292ff@suse.com>
Date: Thu, 8 Aug 2024 16:10:05 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 01/10] tools/hvmloader: Fix non-deterministic cpuid()
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
 <20240808134251.29995-2-alejandro.vallejo@cloud.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: <20240808134251.29995-2-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 08.08.2024 15:42, Alejandro Vallejo wrote:
> hvmloader's cpuid() implementation deviates from Xen's in that the value
> passed on ecx is unspecified. This means that when used on leaves that
> implement subleaves it's unspecified which one you get; though it's more
> than likely an invalid one.
> 
> Import Xen's implementation so there are no surprises.
> 
> Fixes: 318ac791f9f9 ("Add utilities needed for SMBIOS generation to
> hvmloader")
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

Minor remark: A Fixes: tag wants to go all on a single line.

> --- a/tools/firmware/hvmloader/util.c
> +++ b/tools/firmware/hvmloader/util.c
> @@ -267,15 +267,6 @@ memcmp(const void *s1, const void *s2, unsigned n)
>      return 0;
>  }
>  
> -void
> -cpuid(uint32_t idx, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx)
> -{
> -    asm volatile (
> -        "cpuid"
> -        : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
> -        : "0" (idx) );

Compared to the original ...

> --- a/tools/firmware/hvmloader/util.h
> +++ b/tools/firmware/hvmloader/util.h
> @@ -184,9 +184,30 @@ int uart_exists(uint16_t uart_base);
>  int lpt_exists(uint16_t lpt_base);
>  int hpet_exists(unsigned long hpet_base);
>  
> -/* Do cpuid instruction, with operation 'idx' */
> -void cpuid(uint32_t idx, uint32_t *eax, uint32_t *ebx,
> -           uint32_t *ecx, uint32_t *edx);
> +/* Some CPUID calls want 'count' to be placed in ecx */
> +static inline void cpuid_count(
> +    uint32_t leaf,
> +    uint32_t subleaf,
> +    uint32_t *eax,
> +    uint32_t *ebx,
> +    uint32_t *ecx,
> +    uint32_t *edx)
> +{
> +    asm volatile ( "cpuid"
> +          : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
> +          : "a" (leaf), "c" (subleaf) );

... you alter indentation, without it becoming clear why you do so. Imo
there are only two ways of indenting this which are conforming to our
style - either as it was (secondary lines indented by one more level,
i.e. 4 more spaces) or

    asm volatile ( "cpuid"
                   : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
                   : "a" (leaf), "c" (subleaf) );

I guess I'll take the liberty and adjust while committing.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 14:22:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 14:22:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774330.1184795 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc421-0004bw-O0; Thu, 08 Aug 2024 14:22:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774330.1184795; Thu, 08 Aug 2024 14:22:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc421-0004bp-Jj; Thu, 08 Aug 2024 14:22:21 +0000
Received: by outflank-mailman (input) for mailman id 774330;
 Thu, 08 Aug 2024 14:22:20 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sc420-0004bc-5d; Thu, 08 Aug 2024 14:22:20 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sc41z-0001BW-Ox; Thu, 08 Aug 2024 14:22:19 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sc41z-0001Oe-A0; Thu, 08 Aug 2024 14:22:19 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sc41z-0006oD-9c; Thu, 08 Aug 2024 14:22:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=k4BjgyVCICGQ2AjIC12bMfwufhpC3R8iLJq/wW1dRac=; b=mmPR7svOfmPZb299QeTdhVyIYI
	zhckgIUTUplYVyAicrlho8FyrVo0Ei3TUDjvacPW9fe4TIDgkTGEdVXyZf8Hbqtk8ChPizgUldNKU
	FRX5R66CshcJaIYcJBVjkdBQQy7M6L4Qc+BelwjmZkMk54ZSlCMqfz2Ht3JzdlN4lDUA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187189-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187189: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=0caacf47d7b423db9126660fb0382ed56cd077c1
X-Osstest-Versions-That:
    libvirt=432e442ca8eeb4ed8c0dcc3a3c7d723f85b38c40
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 08 Aug 2024 14:22:19 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 libvirt              0caacf47d7b423db9126660fb0382ed56cd077c1
baseline version:
 libvirt              432e442ca8eeb4ed8c0dcc3a3c7d723f85b38c40

Last test of basis   187178  2024-08-07 04:20:35 Z    1 days
Testing same since   187189  2024-08-08 04:18:45 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrea Bolognani <abologna@redhat.com>
  Danny Sauer <github@dannysauer.com>
  Danny Sauer <gitlab@dannysauer.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   432e442ca8..0caacf47d7  0caacf47d7b423db9126660fb0382ed56cd077c1 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 14:43:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 14:43:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774343.1184805 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc4Lz-0000ga-7i; Thu, 08 Aug 2024 14:42:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774343.1184805; Thu, 08 Aug 2024 14: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 <xen-devel-bounces@lists.xenproject.org>)
	id 1sc4Lz-0000gT-4u; Thu, 08 Aug 2024 14:42:59 +0000
Received: by outflank-mailman (input) for mailman id 774343;
 Thu, 08 Aug 2024 14: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=d5uN=PH=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sc4Lx-0000gM-H0
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 14:42:57 +0000
Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com
 [2a00:1450:4864:20::335])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7f4cd8d5-5594-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 16:42:55 +0200 (CEST)
Received: by mail-wm1-x335.google.com with SMTP id
 5b1f17b1804b1-428f5c0833bso12436725e9.0
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 07:42:55 -0700 (PDT)
Received: from ?IPV6:2003:e5:8741:4a00:60e5:7bee:fc48:e85c?
 (p200300e587414a0060e57beefc48e85c.dip0.t-ipconnect.de.
 [2003:e5:8741:4a00:60e5:7bee:fc48:e85c])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-429059719ebsm78438585e9.18.2024.08.08.07.42.53
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 07:42:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7f4cd8d5-5594-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723128175; x=1723732975; 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=Jv9gb3TPJoZtfBTwu5KhtnLtJz/V1TQePAfnqZ3cjz0=;
        b=N5mIxm8wB+W8+b/xrFL7dS20E7o+pziLElJENwzBhsGOFKRhIj2FtiXpb9ZZmAlZ4O
         OJ/91+fnNGQ25lbY+ey1dnvDusKA3SIjvQQJIVhaNEgd8QL+jLXr/Hn+xunecErOsOno
         dwb4AOpuVdLQ6gokTWhJ7+iMZUElfV1hiTIMVtSC0DdCyF7ha/veauIZsBjk8X9H8mS4
         817UCtjmVcaeNiYS0j4NKlWaTll4pmDNadVKywc+ly21EgB549um+I0Xaxy5ZKQA5SAn
         f23WOjTncL9ifAiQUdE+q4vuSy1DIT2kVQu3hDAex7dCA8k2C3cmWegn+45PCEyYu6SM
         /HPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723128175; x=1723732975;
        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=Jv9gb3TPJoZtfBTwu5KhtnLtJz/V1TQePAfnqZ3cjz0=;
        b=Cvxwba0zgmR4Q+3YymvrurV5vf8ZHbGtKUSCFNi4jozjcqORkps3fDH723GmzVZ1pb
         wKTRYMKEHdN8O36lKTNPgE7pkBp8LlDCYhGPdcZABppEY+kXrfyhJG7I5bYTN+us/mUo
         0hkjbipon4oarC/ksMC8RyYDIE8Eu2EwlAHfOhzk3kF5SVUa3WnciG+4PcXlYgI+37LR
         5F7vPQaQ3cYloK04kxEtdmESGp2pwlj6cXNc9oWKRYBhUfaYKBSt/wnPzIjKbYNQDHdP
         g9f5V/zVcuLBx6TS7A5uHFbQxXiI2c2tjyNgkaGybbPeetiGnpohr6LRIQ56PUEvENMz
         oGJQ==
X-Forwarded-Encrypted: i=1; AJvYcCWGoSnh0bxiJIbaewqG4iPljrTgGqnx3T+kX5/XO/T7vIRBX3aWyvEbCcNOOxYHXd172vHvf1sGOOWNSxPg9QBlCxaIz4H96q5WpuMEFtE=
X-Gm-Message-State: AOJu0YwSdEYuPuE0t+SrJ9nBREBHpIGEDUNSaZgeBzI+t+WraFj6MUmV
	9E5j5mipzAcwQus51UUQTy7QQxVfY5bGii7pDyqwCUZYxHrHj39UItVZfxY5dpc=
X-Google-Smtp-Source: AGHT+IGfHetkju187eiWx/ciHnZOqqXfWCLQz3E6ZDrUpHQOpzLG8ZnfGN6zwAylwTHSvHr33bT8Fw==
X-Received: by 2002:a05:6000:e08:b0:362:4679:b5a with SMTP id ffacd0b85a97d-36d2815552dmr1988101f8f.16.1723128174493;
        Thu, 08 Aug 2024 07:42:54 -0700 (PDT)
Message-ID: <5389eb85-873c-4ae2-a916-6fdd0e5b496d@suse.com>
Date: Thu, 8 Aug 2024 16:42:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 5/5] xen: tolerate ACPI NVS memory overlapping with Xen
 allocated memory
To: Jan Beulich <jbeulich@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, linux-kernel@vger.kernel.org,
 x86@kernel.org
References: <20240807104110.18117-1-jgross@suse.com>
 <20240807104110.18117-6-jgross@suse.com>
 <90d67e10-6e35-487e-a9e7-611a0fa3b00b@suse.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <90d67e10-6e35-487e-a9e7-611a0fa3b00b@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 07.08.24 14:05, Jan Beulich wrote:
> On 07.08.2024 12:41, Juergen Gross wrote:
>> In order to minimize required special handling for running as Xen PV
>> dom0, the memory layout is modified to match that of the host. This
>> requires to have only RAM at the locations where Xen allocated memory
>> is living. Unfortunately there seem to be some machines, where ACPI
>> NVS is located at 64 MB, resulting in a conflict with the loaded
>> kernel or the initial page tables built by Xen.
>>
>> As ACPI NVS needs to be accessed by the kernel only for saving and
>> restoring it across suspend operations, it can be relocated in the
>> dom0's memory map by swapping it with unused RAM (this is possible
>> via modification of the dom0 P2M map).
> 
> While the kernel may not (directly) need to access it for other purposes,
> what about AML accessing it? As you can't advertise the movement to ACPI,
> and as non-RAM mappings are carried out by drivers/acpi/osl.c:acpi_map()
> using acpi_os_ioremap(), phys-to-machine translations won't cover for
> that (unless I'm overlooking something, which unfortunately seems like I
> might be).

Seems I need to hook into acpi_os_ioremap() in order to handle that case.

> Even without that I wonder in how far tools (kexec?) may be misguided by
> relocating non-RAM memory ranges. Even more so when stuff traditionally
> living below the 4G boundary suddenly moves far beyond that.

I don't think kexec is working in PV mode.

Other tools: time will tell, I guess. I prefer a generally working system
with maybe some tools failing over one not booting at all.

The only other general solution I could think of would be something similar
to vmlinuz on bare metal: a "small" boot code looking for an appropriate
location for the kernel and then relocating the "real" kernel accordingly.
This would require quite some effort, though, as the boot code would need
to create the related page tables and p2m table, too. I'd like to avoid
that.


Juergen


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 14:56:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 14:56:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774356.1184815 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc4Z3-0003TN-Ep; Thu, 08 Aug 2024 14:56:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774356.1184815; Thu, 08 Aug 2024 14:56:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc4Z3-0003TG-Br; Thu, 08 Aug 2024 14:56:29 +0000
Received: by outflank-mailman (input) for mailman id 774356;
 Thu, 08 Aug 2024 14:56:28 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sc4Z2-0003T6-FS; Thu, 08 Aug 2024 14:56:28 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sc4Z1-0001lB-UX; Thu, 08 Aug 2024 14:56:27 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sc4Z1-0002hQ-Hg; Thu, 08 Aug 2024 14:56:27 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sc4Z1-0003rX-H7; Thu, 08 Aug 2024 14:56:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=hwsslFCTLbsB3lFqYLoiBFB9zCCkA3Kalt/Er8Q3e4o=; b=tEPC2r/1RNRz2XLGLNVsWXJBn9
	iZ8pH/v52vZTgxBu2mraGaDnfGDh86TE1XFvlZVlpmcOMITF4P8Yv7DXDWGKmWkodrE2K6mtnd4Ch
	5UNUF8mA6gC0Z9J63wcUmMCb4JCMrGOchXWjM3OwMe6B+VHLUcYl7B9QhjGq+0ezgUOo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187190-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187190: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=08aacc392d86d4c7dbebdb5e664060ae2af72057
X-Osstest-Versions-That:
    xen=6b9b96ddebf269579730ff2a65f324505bc2aba9
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 08 Aug 2024 14:56:27 +0000

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

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  08aacc392d86d4c7dbebdb5e664060ae2af72057
baseline version:
 xen                  6b9b96ddebf269579730ff2a65f324505bc2aba9

Last test of basis   187175  2024-08-06 23:03:56 Z    1 days
Testing same since   187190  2024-08-08 12:06:01 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Matthew Barnes <matthew.barnes@cloud.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   6b9b96ddeb..08aacc392d  08aacc392d86d4c7dbebdb5e664060ae2af72057 -> smoke


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 15:03:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 15:03:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774373.1184825 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc4fi-0005iQ-4d; Thu, 08 Aug 2024 15:03:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774373.1184825; Thu, 08 Aug 2024 15:03:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc4fi-0005iJ-1Y; Thu, 08 Aug 2024 15:03:22 +0000
Received: by outflank-mailman (input) for mailman id 774373;
 Thu, 08 Aug 2024 15:03:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=gzZp=PH=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sc4fh-0005iD-DJ
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 15:03:21 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 59893bb4-5597-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 17:03:20 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a7aada2358fso342500466b.0
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 08:03:20 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9e7fe2fsm755051466b.178.2024.08.08.08.03.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 08:03:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 59893bb4-5597-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723129400; x=1723734200; 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=8sQ9PGsBk8Eff8tQCepimSQrw1AMgb/HWeK4EkA3Pzo=;
        b=C6XRpkvwetDDaB/KuBX2G8Yg40N/nB48fm0ZDRCdBkdIwOVQGd+Kz5klxDLTQPUn4o
         uWd/PSimUvY75aDHuMxECx3oG7/H2R5uWWf2MNwW60xFc/Jjp743eyzw5YARZJmIoHvq
         WehIcs9hJptvRvEBtHbR8CnefiXI6PhOLTzpmsVzPlgMXTFCS6brkcHseOt9t8i5DdAb
         vj1Rlg5/mZY5nrEMGG+Xql6wbT52nfiqU9YPKqUfwVlq4TZeV8mWvzf00AZPO5Hu+xqT
         U1oIVpG1mZjScKC5fQXMn0tf+V0QGrghm4CCTvjoj0hRjaLpD+XXP48Pnh0lqHPVN/v0
         fnng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723129400; x=1723734200;
        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=8sQ9PGsBk8Eff8tQCepimSQrw1AMgb/HWeK4EkA3Pzo=;
        b=p94DDYvJdQo9n6fKAv/XP4sjY61qI7JCFIzystjY4l8wOiw2meUpvJ67uGsvpj1fqu
         xG5pk2FNP/gb+bJDJLAQbF/NI3P3JlbHAdkuygiwN2t5vQKE71/ikDWDzLvaCt5n+Up5
         LxTCTT8zd8+v6Oyagh5ujxQunmI9VNy0c3fAdmbszaf7vah+jJx7s1TH4DMzbHtWR0KR
         nHtljfW5NqyanJrm+w8YszfZsdU9Lo1NxOggsxrOyBoB27eMWgKjjFNRAN/e8h7/SgrD
         Rz4jnuRbkGagguMBjhZOY4V0s4j/QTOXdMhPpuMkcFlDEK08CyMka6YP9O/GBqoQl53z
         Uc7g==
X-Forwarded-Encrypted: i=1; AJvYcCWg6jhJRwsEAQRf2mEaEy1hethOmiQOolOFjrptbnPB2EX6GF2QW7x9Ob98F0of/VGybSqi+mZFEj60zn24uMsuLZ+soe2vBNM8VBSLH0c=
X-Gm-Message-State: AOJu0YywDsDbY3LYyo9VaAOXozsh1ZuClhRFXgJ2sQeUk1iHUX7qplbg
	ZwFvXRvT5PTiBpJx3U3hgOsqHJ8Iq08QoydwLfkI2aykHrZP7MsM/5qSysIByA==
X-Google-Smtp-Source: AGHT+IHbEGRrZx7dXgPgKuL89cLMS/JVbDOgFN8ZoeVQ8hco5CBysjwbSaKRxrQHuJA5E7MwiIyOFw==
X-Received: by 2002:a17:907:1b23:b0:a7d:895b:fd with SMTP id a640c23a62f3a-a8091ec5ef8mr203185766b.6.1723129399785;
        Thu, 08 Aug 2024 08:03:19 -0700 (PDT)
Message-ID: <5de3bdbc-74a7-4722-be12-eacea6bebbdf@suse.com>
Date: Thu, 8 Aug 2024 17:03:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 5/5] xen: tolerate ACPI NVS memory overlapping with Xen
 allocated memory
To: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, linux-kernel@vger.kernel.org,
 x86@kernel.org
References: <20240807104110.18117-1-jgross@suse.com>
 <20240807104110.18117-6-jgross@suse.com>
 <90d67e10-6e35-487e-a9e7-611a0fa3b00b@suse.com>
 <5389eb85-873c-4ae2-a916-6fdd0e5b496d@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: <5389eb85-873c-4ae2-a916-6fdd0e5b496d@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 08.08.2024 16:42, Jürgen Groß wrote:
> On 07.08.24 14:05, Jan Beulich wrote:
>> Even without that I wonder in how far tools (kexec?) may be misguided by
>> relocating non-RAM memory ranges. Even more so when stuff traditionally
>> living below the 4G boundary suddenly moves far beyond that.
> 
> I don't think kexec is working in PV mode.

I wasn't thinking of in-Dom0 kexec, but about host one. Iirc the kexec tool
will collect information it needs from various data sources, not uniformly
everything from the hypervisor. But I may be wrong with this.

Jan



From xen-devel-bounces@lists.xenproject.org Thu Aug 08 15:15:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 15:15:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774384.1184835 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc4rB-000831-2y; Thu, 08 Aug 2024 15:15:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774384.1184835; Thu, 08 Aug 2024 15:15:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc4rA-00082u-Vg; Thu, 08 Aug 2024 15:15:12 +0000
Received: by outflank-mailman (input) for mailman id 774384;
 Thu, 08 Aug 2024 15:15:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zgd2=PH=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sc4r9-00082Y-RU
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 15:15:11 +0000
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com
 [2a00:1450:4864:20::62a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 00b9c7bd-5599-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 17:15:10 +0200 (CEST)
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a7aada2358fso344746266b.0
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 08:15:10 -0700 (PDT)
Received: from localhost ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9d437b0sm748171566b.114.2024.08.08.08.15.09
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 08:15:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 00b9c7bd-5599-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723130110; x=1723734910; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=nQsfTtbm6wxPhceWK0RPxgOZV3+hy0lLrq8jTAX0k+E=;
        b=J/byrp+rVxt7RUnr4mrtXNB4EqtuuKoIR9DOPQb6KSUadKRhVtV32/ajZNyxwZr3Aa
         cDWjbtttj9w2lKrN8ByL64xMUCsFU3nLxqpMw4Ja1VmJIaUwcPmC0JrG5tOir3kByG+/
         dmZGgqOf4v+CFe78gDyg6q2KGSPEPOzzRRkqo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723130110; x=1723734910;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=nQsfTtbm6wxPhceWK0RPxgOZV3+hy0lLrq8jTAX0k+E=;
        b=QjoDLlsmtbSPRCPI3jMftA6tFTFSpOUMCeXKy6Xni0v03I5fVAvjIN5lTSATe8XMd3
         NulkxozfAuqVxnes0DUEMno+J144Aw+2X8YPJDZFjXJtR1WpcR2sqHmEo0uSLCjwdLuK
         nlgP9Ubva/I/bSkmWP8Sd2TcZPFjD56ehZPKZsH1g3RQBfII2EaGcSMJau5GafiLOJv5
         nzQYyo7hPM3GvgY+soS4/SixpC7UgFS5xq/qSxc3oEN5vFn1lfpAhjBgMNYv8HrAE0/T
         JyrRqqafeIxQexx+durdkEqXl9M4fd5i8UnJpwb9gPSawMmc5yx3OsQf5vJVq0Y2UrFt
         GFew==
X-Forwarded-Encrypted: i=1; AJvYcCXF5wCgGQFQzaKH8Ux1AfBZYROEcPdFv8PLds08yJnx38HFPq0VFyecL99LskfIqHco9evuejvJ2enDqWCGeHJ6jA9nr7GxS+6iLlzlqSM=
X-Gm-Message-State: AOJu0YypzdwMZqZ2opu7qFnkpfT82VLL76opdxKFwpl66DsM8vAhOur0
	ExW+z4QlIU7RM6klYIAVUDWG/dYFQhSSR+5pGP2yAHrzcItREgqAxroBxrQGzBQ=
X-Google-Smtp-Source: AGHT+IE2GdmWByIC6V69xcREOw8ahs4Lz7BtWkt0qtVO2whMx17qPqsrkapCOdL33Corg+hp2UCbbQ==
X-Received: by 2002:a17:907:a0c:b0:a72:66d5:892c with SMTP id a640c23a62f3a-a8091f5aba8mr213845966b.18.1723130109928;
        Thu, 08 Aug 2024 08:15:09 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Thu, 08 Aug 2024 16:15:08 +0100
Message-Id: <D3AMN7MFF5ZZ.31YRGBE9ICW4G@cloud.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
 =?utf-8?q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, "Anthony PERARD"
 <anthony.perard@vates.tech>, "Xen-devel" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v5 01/10] tools/hvmloader: Fix non-deterministic cpuid()
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Jan Beulich" <jbeulich@suse.com>
X-Mailer: aerc 0.17.0
References: <20240808134251.29995-1-alejandro.vallejo@cloud.com>
 <20240808134251.29995-2-alejandro.vallejo@cloud.com>
 <b1b7eaea-450c-44bd-b97a-491183a292ff@suse.com>
In-Reply-To: <b1b7eaea-450c-44bd-b97a-491183a292ff@suse.com>

On Thu Aug 8, 2024 at 3:10 PM BST, Jan Beulich wrote:
> On 08.08.2024 15:42, Alejandro Vallejo wrote:
> > hvmloader's cpuid() implementation deviates from Xen's in that the valu=
e
> > passed on ecx is unspecified. This means that when used on leaves that
> > implement subleaves it's unspecified which one you get; though it's mor=
e
> > than likely an invalid one.
> >=20
> > Import Xen's implementation so there are no surprises.
> >=20
> > Fixes: 318ac791f9f9 ("Add utilities needed for SMBIOS generation to
> > hvmloader")
> > Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>
> Minor remark: A Fixes: tag wants to go all on a single line.

Noted for next time.

>
> > --- a/tools/firmware/hvmloader/util.c
> > +++ b/tools/firmware/hvmloader/util.c
> > @@ -267,15 +267,6 @@ memcmp(const void *s1, const void *s2, unsigned n)
> >      return 0;
> >  }
> > =20
> > -void
> > -cpuid(uint32_t idx, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint3=
2_t *edx)
> > -{
> > -    asm volatile (
> > -        "cpuid"
> > -        : "=3Da" (*eax), "=3Db" (*ebx), "=3Dc" (*ecx), "=3Dd" (*edx)
> > -        : "0" (idx) );
>
> Compared to the original ...
>
> > --- a/tools/firmware/hvmloader/util.h
> > +++ b/tools/firmware/hvmloader/util.h
> > @@ -184,9 +184,30 @@ int uart_exists(uint16_t uart_base);
> >  int lpt_exists(uint16_t lpt_base);
> >  int hpet_exists(unsigned long hpet_base);
> > =20
> > -/* Do cpuid instruction, with operation 'idx' */
> > -void cpuid(uint32_t idx, uint32_t *eax, uint32_t *ebx,
> > -           uint32_t *ecx, uint32_t *edx);
> > +/* Some CPUID calls want 'count' to be placed in ecx */
> > +static inline void cpuid_count(
> > +    uint32_t leaf,
> > +    uint32_t subleaf,
> > +    uint32_t *eax,
> > +    uint32_t *ebx,
> > +    uint32_t *ecx,
> > +    uint32_t *edx)
> > +{
> > +    asm volatile ( "cpuid"
> > +          : "=3Da" (*eax), "=3Db" (*ebx), "=3Dc" (*ecx), "=3Dd" (*edx)
> > +          : "a" (leaf), "c" (subleaf) );
>
> ... you alter indentation, without it becoming clear why you do so. Imo
> there are only two ways of indenting this which are conforming to our
> style - either as it was (secondary lines indented by one more level,
> i.e. 4 more spaces) or
>
>     asm volatile ( "cpuid"
>                    : "=3Da" (*eax), "=3Db" (*ebx), "=3Dc" (*ecx), "=3Dd" =
(*edx)
>                    : "a" (leaf), "c" (subleaf) );
>
> I guess I'll take the liberty and adjust while committing.
>
> Jan

Sure, I don't mind about that.

As for the indentation difference, the inline assembly is taken quasi-verba=
tim
from arch/x86/include/asm/processor.h. That one happens to have this
indentation.

Cheers,
Alejandro


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 15:30:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 15:30:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774396.1184845 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc55Z-0003Q0-Aa; Thu, 08 Aug 2024 15:30:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774396.1184845; Thu, 08 Aug 2024 15:30:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc55Z-0003PQ-6g; Thu, 08 Aug 2024 15:30:05 +0000
Received: by outflank-mailman (input) for mailman id 774396;
 Thu, 08 Aug 2024 15:30:03 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zgd2=PH=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sc55X-00035H-SA
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 15:30:03 +0000
Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com
 [2a00:1450:4864:20::634])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 13ec76f8-559b-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 17:30:01 +0200 (CEST)
Received: by mail-ej1-x634.google.com with SMTP id
 a640c23a62f3a-a7aa212c1c9so150677366b.2
 for <xen-devel@lists.xenproject.org>; Thu, 08 Aug 2024 08:30:01 -0700 (PDT)
Received: from localhost ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ec6bb6sm750360366b.201.2024.08.08.08.29.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 08 Aug 2024 08:30:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 13ec76f8-559b-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723131001; x=1723735801; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=6II2XuUSzJzY1eIGTebtiqD9vLiW5hEhnBosZCMU69o=;
        b=ER9Xyn6tp+j1ZhGBixY+B75fhQUhNUZtxugHlEdrvuBAnvbTtgj7GF4gOSbv3UXz8G
         C1xXOZC1SrNRrEcK7a0yncBiloNFeg9OKi/Gh8SizHhj7UqklMdAamWqqU6lgPzpYTEn
         YQtexOL0KIDWVVxA1oPS8KExsBSOxPiYnTXws=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723131001; x=1723735801;
        h=in-reply-to:references:to:from:subject:message-id:date
         :content-transfer-encoding:mime-version:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=6II2XuUSzJzY1eIGTebtiqD9vLiW5hEhnBosZCMU69o=;
        b=GtgA10+1v2olusuVCwoc53Xv8Fos2xiSTBZ9ad4iIL5rgfMjYAHG2HFPBDK/mOW0+9
         a+8bOIZ7Bu8f95O6wMEkov1QREz1B6wP5zTokWiRVmfjgcqzb5I5tSXdKt9ksGoTCh1w
         db2L5b8oQqape++yj02u/kmx7AweyKPBXWLfEErq+/4Pmkq67HjNsAS6vj4AzZqUeanP
         /2cnGGoGzqscbAPNu0XfcDqGG2aSo45NBs0W2Y3TtxsyMusmjZTMx81p2Yt9ywcBhSgD
         fPFnfI9g7SZNXUM1KRT1F/pfgB6CTl3w8wSv70aXJ/v18MidhCxooS9T2T/khBivJwIJ
         mygQ==
X-Forwarded-Encrypted: i=1; AJvYcCUDIXwIukFInbI4KK3xfyMLWCybiM/Srsgu0MyI8oTRgujH+pdPIAiQb3rV9dtDGXKWvilCFHyhocFtW12x6NVegGTW3OjZRcKS/oKyY/0=
X-Gm-Message-State: AOJu0Yzu79jG3XW8Y3oioTpN9VgsfdmuWVNa4yUMUYkVpi7eqxYH8j7n
	2aEvUDVTfpDWz+QXUf8n76pK0mSWPuIxUNW5IEauyL2+nci5ua+/I/4Bdvs99Pg6olcvhEuu6g2
	G
X-Google-Smtp-Source: AGHT+IEPW0CRuzjQXw5mwmw9NI9xLnZ3FB9bysWfPiEFYo+6Q7lz7yKjLWWrCJ2IetNW1lgaP5663g==
X-Received: by 2002:a17:907:c7e0:b0:a7a:8876:4427 with SMTP id a640c23a62f3a-a8090c835d0mr158638166b.25.1723131000790;
        Thu, 08 Aug 2024 08:30:00 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Thu, 08 Aug 2024 16:29:58 +0100
Message-Id: <D3AMYKSVBGFR.2IZRXPNCIUUIM@cloud.com>
Subject: Re: xen | Failed pipeline for staging | 08aacc39
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Jan Beulich" <jbeulich@suse.com>, "xen-devel@lists.xenproject.org"
 <xen-devel@lists.xenproject.org>, "Stefano Stabellini"
 <sstabellini@kernel.org>
X-Mailer: aerc 0.17.0
References: <66b4bd64b9733_2f15a5d3890299@gitlab-sidekiq-catchall-v2-754c69bc57-l5rxx.mail> <c655dbd9-046a-451a-a7e8-670a1eaf4ab0@suse.com>
In-Reply-To: <c655dbd9-046a-451a-a7e8-670a1eaf4ab0@suse.com>

On Thu Aug 8, 2024 at 2:02 PM BST, Jan Beulich wrote:
> On 08.08.2024 14:43, GitLab wrote:
> >=20
> >=20
> > Pipeline #1405649318 has failed!
> >=20
> > Project: xen ( https://gitlab.com/xen-project/hardware/xen )
> > Branch: staging ( https://gitlab.com/xen-project/hardware/xen/-/commits=
/staging )
> >=20
> > Commit: 08aacc39 ( https://gitlab.com/xen-project/hardware/xen/-/commit=
/08aacc392d86d4c7dbebdb5e664060ae2af72057 )
> > Commit Message: x86/emul: Fix misaligned IO breakpoint behaviou...
> > Commit Author: Matthew Barnes
> > Committed by: Jan Beulich ( https://gitlab.com/jbeulich )
> >=20
> >=20
> > Pipeline #1405649318 ( https://gitlab.com/xen-project/hardware/xen/-/pi=
pelines/1405649318 ) triggered by Jan Beulich ( https://gitlab.com/jbeulich=
 )
> > had 4 failed jobs.
> >=20
> > Job #7535428747 ( https://gitlab.com/xen-project/hardware/xen/-/jobs/75=
35428747/raw )
> >=20
> > Stage: build
> > Name: qemu-system-aarch64-6.0.0-arm64-export
> > Job #7535428873 ( https://gitlab.com/xen-project/hardware/xen/-/jobs/75=
35428873/raw )
> >=20
> > Stage: build
> > Name: alpine-3.18-gcc-debug-arm64-static-shared-mem
> > Job #7535428869 ( https://gitlab.com/xen-project/hardware/xen/-/jobs/75=
35428869/raw )
> >=20
> > Stage: build
> > Name: alpine-3.18-gcc-debug-arm64-staticmem
> > Job #7535429434 ( https://gitlab.com/xen-project/hardware/xen/-/jobs/75=
35429434/raw )
> >=20
> > Stage: test
> > Name: qemu-smoke-dom0less-arm32-gcc
>
> All Arm failures when the three commits under test only touch x86 code.
> How can that be? And Stefano, note how this would needlessly have blocked
> a merge request, if we were already using that model you're proposing to
> switch to.
>
> Jan

I'd argue it the other way around. It would (may?) have prevented reaching =
that
situation in the first place.

Cheers,
Alejandro


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 15:50:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 15:50:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774405.1184854 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc5PB-0007by-Ri; Thu, 08 Aug 2024 15:50:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774405.1184854; Thu, 08 Aug 2024 15:50:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc5PB-0007br-Oq; Thu, 08 Aug 2024 15:50:21 +0000
Received: by outflank-mailman (input) for mailman id 774405;
 Thu, 08 Aug 2024 15:50: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=eqo7=PH=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sc5PA-0007bl-Dz
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 15:50:20 +0000
Received: from NAM10-BN7-obe.outbound.protection.outlook.com
 (mail-bn7nam10on20621.outbound.protection.outlook.com
 [2a01:111:f403:2009::621])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e8618f6b-559d-11ef-bc04-fd08da9f4363;
 Thu, 08 Aug 2024 17:50:17 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by IA0PR12MB8349.namprd12.prod.outlook.com (2603:10b6:208:407::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Thu, 8 Aug
 2024 15:50:13 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7828.024; Thu, 8 Aug 2024
 15:50:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e8618f6b-559d-11ef-bc04-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=xW0tTbA82r29sEfHTAIpURKkYWzd+YJCO6u8bxdhObWfIZ3P+3XeIh5VeoSHQ2bXLcDjJ4DLpRkf4JE/xXtkZ78mSoe0+xFTBR/5B2pAl8TCmFlxHQvA4W1xG8mZuUHjdFfwXejLcr85BrlW8Ceu4I6N0cCaS9RrQESAjXokGvziqulemXXKNN2uAebvzrtVO14nkrbNseui6FCboYSNdb80ywUTY/Ycd4M8Iln4XxeKElv1RW6BQn9MHedD4nyljjgqdCEZM0KzGwfEbaQO4YnMrHBEBYxySizU3qhoSgKGGe6cpsfPYLEPmqUymV4j59MbUIULG1JGMqqrtvUXbw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=TyitCXqEbTERU7nFSSyE3+PH9eypHEnE3aJSa5KpLkM=;
 b=nZDktst9v3fvCdkHKj4K1rl13TFjQgK9r0b3OgsHcZ6MEYTn6hadjDh1eHINAtxJHtdJGs+0en+Keajxg/c0w0m0iYVa5u8ikeqFVwvuldwiui6SKS+Qhrn8x9HQV9gBQpmJBpzuSRm7cD7hwXXXcGRScn3CD9526wv11nWGUNN92KnszQGURGbIsPtSoqtze03SkqgwzyGX2htybZd1iE8vjeHroYBds7LIdzkIdmg4hgsXQq6ge3sPaM77b+yq8DA3HRIikgORAtbBAvzAYDGQFGOQXo1DaoXxrByBnhD7A6wPktf7meHA5mNVw2u9crP2cgq4dstIfrKm8v8wpQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=TyitCXqEbTERU7nFSSyE3+PH9eypHEnE3aJSa5KpLkM=;
 b=C4SlaTdZCFKtREzNmqFi6OyKBxotFXmMAA7AMVaH8Uh8JL86R9NV8hTDjuObYD1YRFAZRvM07Pud5R1CwAwH3RQrWaBvv3ifNEDGwGxkCQhmtBOmNENsQIagAT6D4KPinzBPfDLQMVR9xCcIM9IHxhNaq36CIyo3VukgFoEipKY=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <3c491d8f-6180-46d7-a996-049df88a023e@amd.com>
Date: Thu, 8 Aug 2024 16:50:08 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/4] xen: arm: make VMAP only support in MMU system
To: Jan Beulich <jbeulich@suse.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com,
 julien@xen.org
References: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
 <20240808120936.3299937-3-ayan.kumar.halder@amd.com>
 <bc643306-a41a-41bb-b7b7-b7c67f9e5bdf@suse.com>
Content-Language: en-GB
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <bc643306-a41a-41bb-b7b7-b7c67f9e5bdf@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: DU7P190CA0003.EURP190.PROD.OUTLOOK.COM
 (2603:10a6:10:550::16) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|IA0PR12MB8349:EE_
X-MS-Office365-Filtering-Correlation-Id: aa91a4bd-ceed-4b3f-1a37-08dcb7c1ca79
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?NzRBN0Z0RGpoci90amRXMEl6aURiZ2ExajBRSnBXWlViRk9ERWJmZ0dYc1h3?=
 =?utf-8?B?ckxRQ2s3TEZWTVh1bVhGT2VDK1NCdW9sY3U5eU5rdHc1MHB6aG00TGpWR3M5?=
 =?utf-8?B?ZjFIT3RXNEp1bHpzaFYxZnVQU3FPUXJudGVQZEZJK3k0Q0ZVQ1VsZXNMSkYz?=
 =?utf-8?B?Q1dJM3JTZ0R3a09UUVV3QmYwME5hZCtlOEg0UThQRldkYSt2N0pMbC9LdHZM?=
 =?utf-8?B?T0Frdm1IeHRsbFJONTFiY2dWc0N5QnN0ZEZ1ejV4SHdZRU45TURxaHVnYVpI?=
 =?utf-8?B?YzdGeEQwaTdzL2U0TEhhUlhuKzBPeGdkT0tjVzBJYmY3Z3F4bTZPRWxSZkRG?=
 =?utf-8?B?TktEYW9hMzJ0RkFyeTJ2TmlXYTZsM2FMZ01nU1ZVRmdqUUZXZG94cmNhTVg0?=
 =?utf-8?B?dExWWWk0U2daSGZWNUNuTG0zQk1KMHNUUnkxM28xRGhnUkowOURLZVNST0Zn?=
 =?utf-8?B?UUNPM2Nmam5WZU1wYnZrSGVyN2FYOWtXTGFYcTVweElBVEpSaXlHZFFZTDFk?=
 =?utf-8?B?dHBPWmVDeUR6cjNia1p6eWp5SGhwM0ZDU3lzUmxWZ0ZqbnZaWTBMdHA3ZS9k?=
 =?utf-8?B?ODMzb1kwK2Y1enRLd2ZHb01BNjlNd29SVUhjUXJkd1EwaDJrV3BPak9HcGUw?=
 =?utf-8?B?R1ZoOU00aVY2eGUwRTN1YVBMMEdKaUppa1NyUkZ1aFNuZ2pvWEVreERSTVpv?=
 =?utf-8?B?cW9mak9aZ3ptYzZkSk1xTXM4N0VoR2gyY0RHKzVIM3VJcTBOTkJsTjVlZEow?=
 =?utf-8?B?Z1lxSFBGSHNBRXVpTVVTOWthRWVOL3JzZkMyVUFCNFNYMHJWQ0N2TzlUd3Jx?=
 =?utf-8?B?WkJXRlN3N2RNd3pjSDlFMk1TSFRWOTBnbWZGK2NVQm5kcU9zN3lSbTBFOEhT?=
 =?utf-8?B?R1liKzNZWHhCbkV0NWE2elluOEJDOEJwRnZYSW16Y3V6QzdoTXRWK2k5Y2N6?=
 =?utf-8?B?VXBtckRnNmd2RVpoOTBXeUlpdGwwT0Rxbm8xcEZETzNaODMrZWk3QW9ERDdk?=
 =?utf-8?B?ZzlvS2E0cTdIUm5JNVd1dHJnenpGb2FPNkJJejFwVSsxK0VoQitVbjNEa3l2?=
 =?utf-8?B?V2ZZZHQ1ZXlxN012UW52ekptQkZvUmZldzhhaHgvdk9mL2I0cCtjSFZRODMy?=
 =?utf-8?B?MUo0WDNKL05QWWZkeWV5V2dYWjBObkhlL29tL1djck0wa3QreDZQU20rWUNu?=
 =?utf-8?B?dVg2QzFiOG03YVpnZVdZZEZKUDd2cVBWZVIvcm1PREhjNmg5bDBiVjZFeHln?=
 =?utf-8?B?WXczZkpuSDVaY2ZsRGZkTzNrc05jSVo2QkM4citKN3c0YjNCNFFXWXB0Q2RQ?=
 =?utf-8?B?c2dzdzVSQmxaQVhEem5DOXBtMGlWSGQweW0yMTlaWjFUN2JIcmg2elVaUzIv?=
 =?utf-8?B?MDZEVEx3a0VsRHJTYld2bEZFQ0RzVGFqM1RlRmhmNWcwOENqZWJGSXJ4Unl2?=
 =?utf-8?B?OG5Jck1oR3JzRGpkeGl4ak4zR214ZUJXbUUvd0pKTEFoZ1NvL0dIWWpLMXZx?=
 =?utf-8?B?VjRoVjkzVUtyVHJBM2c0dFllTU85bWlvTTB1Uzgrc3Zhd213Z3RQeWdYUWNK?=
 =?utf-8?B?YVhIbXgrTVZaUGlKRDljdm5FVHkrUUlad1VHT1RMcVRZOHFNU012YklLWXNX?=
 =?utf-8?B?ZjJZbldJankxdERsYmJqeDh4VFV1T0pvZlFlN3M1Z0k3ZHFIT1JuU2k3eXZp?=
 =?utf-8?B?cHUxTWJFb2Uxczh4b0tGZzAvZnVOSm1OOGZuTkd6ZmFqTzlnSlJodkxwY3hl?=
 =?utf-8?B?Z1RmZ1l2YjhoNk9iWElCQksxM0xkQ1Z6U0tramZROXB6SUNSTEgzdCtDaEpX?=
 =?utf-8?B?T2loL21Dd2RIOSt6bkFMUT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?N1pMVzdOTEpuWWdPQnc5MXoyL1ZhemdHc1QxZUhRZFRMQ3YxVlFKLzhVUjY3?=
 =?utf-8?B?dHd1dU1oS3BTQ2RjYUR2S215aGFtSEwzdE0zVFpuRXYyamNDaTlFNmVrQmU3?=
 =?utf-8?B?ZUJ3L1VyTVhqU3c4NWd0c281LzI3RFE2WFNqK3VEU0o4VExhditMMWhWZXgz?=
 =?utf-8?B?UXBHODRZZ0RhR0FvWlljQzg0cTBRVXh4STBVelhtZ3JWMXcxSDA2N1hJUDhm?=
 =?utf-8?B?MEljZTNucVdJSlN5WkxMcFdvdmVvT1NUQ3lLQURyZWdBNUFqRTd1ZVVtRkdV?=
 =?utf-8?B?L2o2azFyL3l3SUpKUVZSdmJITDZ2V3FGWkhjaDY2NE5KOUdnaEkzbmIzNWFZ?=
 =?utf-8?B?ZjV1bVAxMmtyaFEyNjZaa0VHbFo0VTRvTmFUNlo1YTNhcWdYakxic1hhUlg1?=
 =?utf-8?B?cVdCYUI2QWJTM3R1THp5N0o2UTdKbGhwOXhGTEVrbUUwUzQ4bm11ZjdrWStZ?=
 =?utf-8?B?N0d2b2QxVjl6QXFadWxINytYRFREK0FCR0VYbnZEU05FemtJdFZoK2JScjlW?=
 =?utf-8?B?emdCdmRwWG1EQUxZRXZDaVRzbHdFd29DVDFTN2pJaXRlWXpxaS9GUjdGNWto?=
 =?utf-8?B?cW1vNEIwMndTYk1XTURsaHg1NWVkL05WSGR0MjRIUU4wVHRibXk5bjEwdWpq?=
 =?utf-8?B?eTduUjNHM0p3MDgzckRlcnYxZlZMWmZVcDQxOXdHSHA5ZVd3OUprTk0rMmlN?=
 =?utf-8?B?MUc0cEwzeWFGcVRqZ29XLzBld2NhakFYRnpwNmcxVHdoZnlYMkxoRURrRmhD?=
 =?utf-8?B?aDMwcm5RQlB3UGtKVGxmazFlV2Y3RGRIVlZOMTJWaGYwd3ppRHlUOGpIZ0Jy?=
 =?utf-8?B?MkdWbncvUjBnUFNhV1dRblhVSXRkZlREVE5ha0VoQnUrMVFDZG5wVEIweFRi?=
 =?utf-8?B?b05TaVdRamR5TEhqaEJob0hIdDNEem93dXFsU2xlS0llT1hEMkY3MWw0Vmwy?=
 =?utf-8?B?NGxpZG9rTzNqOTJuK1V1TlNaNzFLN0JIaitrbjVpOThwejMwSC9XOTVUakw2?=
 =?utf-8?B?WWZhcE9TemVRaHFOdElyRSsxRGZLSEFKYTB3L29FM1BucmdUaGVJMlNmVjcx?=
 =?utf-8?B?VVdwWE1HcldNb1Q5Qy8rcTZmZXg5OFVNUEhXUVZCS0JKS2ZFeXdZQWR5S1pS?=
 =?utf-8?B?WHNEbFdqdmczTnlPaEFDbEpTVngyV2drV1JLK1lNMUJrMTRJSWoxc1FpVjJr?=
 =?utf-8?B?eFpKOHNBcjdUcHVhODlNWlRObUQvNExpWmNiZ3RXazBqd21pdzFRR2hGRjBn?=
 =?utf-8?B?NTh5ejFJaGpYemlmd2d4ZDA2SUtoalpjbUNhVGVTeHU5RFVwZnJVTlo3Y0R0?=
 =?utf-8?B?akt6NkJBZ1FKcVlZNjI3RnVBVVk1eE5TRVdIZ3UxVU1qSTI0amRoUUhWcXlh?=
 =?utf-8?B?TkRBaWpPTGl2OENUMzExTW9rSXNJMTFEeHpkMmd6a3hGWm5hMDNvTzdDam12?=
 =?utf-8?B?YVlsSGxTVkRTNlpRdHVhYWo2MDRONENPbG5FUzg5cUhLUEpSV29kZHJFM1Z1?=
 =?utf-8?B?Q3lMTU13K2hFM0w1aHFrcmxtSjdBdHgva3kvTkJWNVp6Z3hNa3MzZUZUWlRr?=
 =?utf-8?B?T3N6Umh5QVVoM1o5Y0x2a2ZSMmRVYSthQTJjaU5HcFI4MUcyNXNtRElpT3Zo?=
 =?utf-8?B?cjFNZ2Y3S0V4RFhLSmtBSjlZc1l4T3NSOW5EQllmbmh5Nlg3K3IxMlY1akpN?=
 =?utf-8?B?cUwyWTNzMitVV2M2MURoLy90T0pnOUVSamJOd282TkwvUmxvZWM5d29LeUtx?=
 =?utf-8?B?MUNRNFdJTE5Fdy9QdGY5SUVrNExlR2tTZUswZmZYUHl3b1NiSGhQSEx6eGdp?=
 =?utf-8?B?ZmxIS0FJR2NaLzAzMVE5K3BxUmhRRjBGNEpkZExGMTBPdUVBc0ViUHhFZ2J5?=
 =?utf-8?B?aUl3eStia0dPSU0rUEM3T1FWWm5QMmw3RDZIaHdpeHIxNmx3UjFpam9VVE1Q?=
 =?utf-8?B?OVg5aHAxZjVnbHJIbnRBYkdVMmJ3ajNzQUR3L1ZwcEJkU1dLYW0vQm93RVhY?=
 =?utf-8?B?Z1QvWTY1bWIyN3pERVhUZVdJWDYrTnVWUVExemIxcEhPdUdGR1lJcWtvUnJk?=
 =?utf-8?B?TWNPd0VwbnpwL0lEVG83bzRFK2JLZjFkOXRjMWMrbEV0SUFoSE9LdHZ5Qkpi?=
 =?utf-8?Q?NgXnXzp5/xVyWrmQQWtraNr0g?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: aa91a4bd-ceed-4b3f-1a37-08dcb7c1ca79
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2024 15:50:13.5976
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: F2cr8Q70f/OjjpXikR4DLvbb5tXywqT6y/kFFIEn2lN0Kt++ztJd2rpSQ3FVWhBWIMkdZG7KZFIWnrjFYki/QA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8349

Hi Jan,

On 08/08/2024 13:49, Jan Beulich wrote:
> On 08.08.2024 14:09, Ayan Kumar Halder wrote:
>> @@ -58,9 +58,13 @@ config PADDR_BITS
>>   	default 40 if ARM_PA_BITS_40
>>   	default 48 if ARM_64
>>   
>> +config HAS_VMAP
>> +	def_bool y
> With this being always enabled, ...

I had to define the config somewhere. It seemed this is the correct 
place to define as HAS_VMAP will be turned off when MPU is introduced.

So, it will be

config HAS_VMAP

            def_bool n

At that time, only MMU will select HAS_VMAP.

>
>>   config MMU
>>   	def_bool y
>>   	select HAS_PMAP
>> +	select HAS_VMAP
> .. what use is this?
>
>> --- a/xen/include/xen/vmap.h
>> +++ b/xen/include/xen/vmap.h
>> @@ -141,7 +141,9 @@ void *arch_vmap_virt_end(void);
>>   /* Initialises the VMAP_DEFAULT virtual range */
>>   static inline void vm_init(void)
>>   {
>> +#ifdef CONFIG_MMU
>>       vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end());
>> +#endif
>>   }
> What about non-Arm, which all have MMUs but no corresponding Kconfig
> setting?

AFAICS , the only file that is of our concern xen/common/vmap.c It is 
enclosed with VMAP_VIRT_START which is defined in mmu specific file 
(xen/arch/arm/include/asm/mmu/layout.h).

So, it will not be compiled for Arm MPU arch.

> And why is this not CONFIG_HAS_VMAP anyway (with HAS_VMAP
> properly moved to common/Kconfig, where e.g. HAS_PMAP also lives,
> and then unconditionally selected by all other architectures)?

I am not sure why CONFIG_HAS_VMAP should be moved to common/Kconfig when 
it will be selected/deselected only for Arm architecture.

- Ayan

>
> Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 16:01:51 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 16:01:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774416.1184865 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc5aE-0001mI-19; Thu, 08 Aug 2024 16:01:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774416.1184865; Thu, 08 Aug 2024 16:01:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sc5aD-0001mB-T3; Thu, 08 Aug 2024 16:01:45 +0000
Received: by outflank-mailman (input) for mailman id 774416;
 Thu, 08 Aug 2024 16:01:45 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eqo7=PH=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sc5aD-0001m5-Dd
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 16:01:45 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on2062b.outbound.protection.outlook.com
 [2a01:111:f403:2418::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 80c62e76-559f-11ef-8776-851b0ebba9a2;
 Thu, 08 Aug 2024 18:01:43 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by MW4PR12MB7431.namprd12.prod.outlook.com (2603:10b6:303:225::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.31; Thu, 8 Aug
 2024 16:01:36 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7828.024; Thu, 8 Aug 2024
 16:01:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 80c62e76-559f-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=mdCYdEi8JVSP/O1pMaf3OX6Uj6/9bfoXUA+6EyI9IMR68pWAcQoKhv36+7xF3yOCBx6y44wCcFYpX0yU7t4Yxa0DKmoNY0NG7RgC8gmF/4/n9Cz4bAKn1dS+x51x3xuxGrvE/yBghftSQqu5VGZR1xsGbkN8iLv8AseJZR8ikaXyJOvLtrquADjDxXQI4TW/6VQjPmdfvka53z5u/EUi/BdWpW9PpYVeXzkTd17kYQcu8FtnLm6mLacEsRlhccvaFccaPbjcGdBA2wfczQZtVvcV6JMQnhXXEKGU5M82quYMb+uF87S1dwk3e09vgkjd1ijIDh8Wls0WC4uCrViReg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=j9owt9l/+ovjFQFTkr3gl2Z+TBC/JDcIg0p3bQgTS/c=;
 b=Mz9X6YzfMWv29E0lS38BUwdMh+3EDO/gTIgTvJWmFycectcQAXNx9BnwjdTJ4YBczMg75i2uCRVIrR8Z51/yh7X89MU2ilHFM7qoZ5fmvxlJ5EZs5pWbXv4Ff8skVPIN+55J6nX1UF4IqGOh/rGdb3Ssqgk8W93wK4jT3aZ4iM2e5BxzFNJbYCNkZu0bfDNYXhwK0ndjpBJ83cGoHrbDtuHr5FGDH6r+dRZBmfiOkjZudTS0ZjfTYmKGOLfRObJlvyshf+OyamHX55DXbvxeLKn1pOQuJbKA2sz3usmMErKSsonc30w18QOcZMjCdjUtCm85Qs3MKB9uR8v0xOUVHA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=j9owt9l/+ovjFQFTkr3gl2Z+TBC/JDcIg0p3bQgTS/c=;
 b=eOwFChT8+GJZz3MKTxjF3mpzLjf687YazZ17Kh9E4Iq5N0tYIHlpGun0ilyuT4uyjfE3cqBGUEnnmQAOLa/lPM6FwFeVq9dVH5KMMvv2OVPk7QUDXP0qBW2nKroVTsRXoU4hCOMBICMkStyjGMUEu/ayL9Yvrd35dIHV1YumdtM=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <3d51c302-e0a7-49bb-af4a-e16bb2f9a0f8@amd.com>
Date: Thu, 8 Aug 2024 17:01:30 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 3/4] xen: arm: Moved domain_page.c to MMU specific
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com,
 julien@xen.org
References: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
 <20240808120936.3299937-4-ayan.kumar.halder@amd.com>
 <b4094b23-0762-429d-b067-f41e5d86481f@suse.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <b4094b23-0762-429d-b067-f41e5d86481f@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0623.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:294::18) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|MW4PR12MB7431:EE_
X-MS-Office365-Filtering-Correlation-Id: 1984dd74-255e-4672-042f-08dcb7c36161
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?dm1uUnMxMmY3QkFxOFk5V0VZbnJKVHlERkFtZUxJcVJsdmNadmdsZGg3dTZI?=
 =?utf-8?B?L0d3dlJJMFdDbUwxaWhIN3FnSTB0bmZkQzBEUk4wTnZ2bFowYzNvSGhkL2VZ?=
 =?utf-8?B?d3R3T3dWbzZ2MWMrZi9JUnoyTmxQUCsxTFJ2MWpUYVR0RjlHSTVpaVNNN1FY?=
 =?utf-8?B?QXZkWHVvbEg2Wm5aUEZWL3FPeXBhRGtXMm5iNlpyczBvcWNRRnM0ckxjQm00?=
 =?utf-8?B?VEY4SFZVZU9WRERUaVBBbkk1ZlYwVUxGWUtrRTI4eERQYlJXMFdUY01OVlZC?=
 =?utf-8?B?VkJ1TVBaL1VsUENOMHN2TjNnQ2hVVUEzK1ZCQ1l5ODhMdEFaTmtuZTcvemJl?=
 =?utf-8?B?T1VPN1lWVzlYR0hiK3FnQWcwazdUbjFCbU1xTzdKa1VoS0xNbnlFSjc4eUM4?=
 =?utf-8?B?L1hJY2cyQmloZmRaN2tWZDhabVVuKzJNVy8zUU4vSGh0NnZnbStjS3dNNXJa?=
 =?utf-8?B?VDlEZjVCUTN4Z2MzZlpCRmNrUi8zRFhWWWdFYVR5em80U2FNZDY4VGtpNmU4?=
 =?utf-8?B?UUxBY25jN25BeGZDTk1rZkdnL2cvUWd4bTVWYTRkRzFNa01KeiszUi9ycU90?=
 =?utf-8?B?dVlNNmEvYXROZlVQMjlXVHY3OWVHUHZ4eXR5d0QrYS9ob2JPcDMzSksvblEr?=
 =?utf-8?B?cmlJMGxCNkxLcXFBS0FJcFNab0VUNzFNY3E2NERQL0w0NDZUQXFkNnA5cERi?=
 =?utf-8?B?dnRnblA5cEF5OGJ2MkR0N3Fuc2xYQTVzKzRxT1RwbjFoaUJxT3VxcHlLV0VK?=
 =?utf-8?B?Q25mRFEzVnNJemJvVTBBMFFCeDJMNHpGQ04yaTBGSWdYRTBOVG9qNG5uTXdv?=
 =?utf-8?B?eUZQT0o2MGJZUjM3cXJXRG5QbHFSSjVkeTVMcFFoTlpCVEM5T1NHSnAwVitB?=
 =?utf-8?B?bVhGVzZ6ZWYvMzRqdFdjV0w3RUN4bjlpbU02OUlhSURtZk1aSzQ0dzBGUGpq?=
 =?utf-8?B?Q1hCYklnZmlxVlVCTFJydGR0cG1UMHdvNWlOc0J1NEt6Yi83UHRSSVBKM21w?=
 =?utf-8?B?MnhjRGpkaU1UMWMxR3gwWUpHeEk1Q2RDUDVhd1V2eXpRVmk5M2hKNXVDbzVr?=
 =?utf-8?B?ZGhHUHVHeTliUm4zWHFsOFpRL01pdlZoRWVoZUR1SnlLb0RFWFMyRTNJSGlz?=
 =?utf-8?B?Z1pZK0x5dEFDUEpucTVZVjY2L1lEL28xUFZLZVBvS3ptK3V5aGVDL3N4WE85?=
 =?utf-8?B?WDBKZ01RUzNxNHUyeENGWUhWZ0tqbW9xSGc3RmRWenRrQ1dSRDhKWXpiNzF2?=
 =?utf-8?B?aG9PUjZZVDFhQUVQdi80blRnaDNaa2REU3ZzUEdleUprWGFySE00eDFyWWlG?=
 =?utf-8?B?WXJwQmZWSmFrODlIa3pUUW41Ni9sOW0xbjZvQ2NrYUtwQ3haaFBadDVod2lJ?=
 =?utf-8?B?UXhNWXZqa2ZZWkhJUDVWT0E3UGdMa2cxWXREaGhkNmlGYXlhOHpNbUU5ZmYz?=
 =?utf-8?B?Z1kvb0pUZHlId2w1NXhMWXUyeDdQbGdreFNnZW1ETzIyVy9zMTd0VTNydWlv?=
 =?utf-8?B?ZVI3UG5Eek9rQVIwd05hWkpUd3YzTTNNaWRzWWZQWmtRRDJQaUZaNDNnUXRM?=
 =?utf-8?B?YzVvbXN4R0J6ZGcxazlCajFNVWxtdDg3YlpKNEhZTnQ3S0NSb3VHek8yNjA1?=
 =?utf-8?B?Zlc1UlhrNHpudWVBdkd4M1FQeGpBWGE5NnN4ZFU2eGVvdm5RU05JTDFibmM2?=
 =?utf-8?B?YmRkWlozS1FtMWl0ZEdCME1DRUhoV1hmYXdZZnNhNXBjM2FDa1VUTE9UaVJn?=
 =?utf-8?B?NzVlUjd3NmhLUFZ4QndFMjJZakFDZmkxRUw2bnZ2SkRQRVVDRVU0aHVlaXZm?=
 =?utf-8?B?NFYyMytxREFXT3JEQjNuUT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZmVwenp4Y2NpcDhsV2JQOUVuWmNwZUtMeEpIUFhnRjZhSk1JRWhFQjZ2YjU4?=
 =?utf-8?B?Sy9kSlRaNU5lakZNOGwrZ1pUK0U3TDFqWmR3MjJUZndYUUFZVWJOQ3BTM2xu?=
 =?utf-8?B?ZTllSk0wNFRTaWVMNEEyWnF2c0R0L0pUR3RRdlpDaHR0UWFlYVRwV3NsclFt?=
 =?utf-8?B?YTRKdDcxU2JXOC9JaFRoMExyQjNZa01Lc215TitWUkZBTnFQelVwNE8wR3g2?=
 =?utf-8?B?emttZ2lTc3NxR3krQ3RPQ0tiYkxPY3BVcUd3M0dqeGJ1d2hWMktvVzBRdWRD?=
 =?utf-8?B?N0VDQTNhcW9DcElnMHd0M3RLRnY2RkYxK2RGZTNFemVzN2FLSVlQVHY2bktw?=
 =?utf-8?B?SkEwNytWbzlUZDhXcUFWN0RUTFBjK0NLZUs5ajE0dllCbFB5VzNhczZvNUJF?=
 =?utf-8?B?eS91YVNUMnNUMkNlaCswTjR4aXZ3TGg4L2FLcXh6WGRHRlpFR3VLVStsLzlR?=
 =?utf-8?B?amhpQ3FJNlNLVXJQWG1OSjJXcFFsb1NFcXNaNnNvQlFBVEZVYldGbURkT1o5?=
 =?utf-8?B?Sm9DTGRvZUl1SzVnNkQyOFVUakpiSUxtei9aUGh1NGNyaGlGeXdyOHZUTVpy?=
 =?utf-8?B?bjJQNVFOVFpPVjdWV2FLZHN3ZHFMVWpvbzdKQjNHbXU5WFB5anlNbDlYckFp?=
 =?utf-8?B?djBEQkdqMldCSk5uR3ZWdTdjaEF5YTgyUUV5TXIzODBnc0Z3N1RyUkpvcll0?=
 =?utf-8?B?dGtEMm9YTXpXZm10UWdoWlFLWC9RMGRzM3ZrQWJJdy9xam9PbFFLTDlxTUw4?=
 =?utf-8?B?RWMxN0wraW55KytXYitBRHN1SnVudVdnZG56OHJvUkNwMEYvZk9iditFT3VS?=
 =?utf-8?B?Q0NFeDJ4SmQ0b0IyOWRyc1dMWHZmelpmK21vaXdRMENNQS9mQ0U5RmhrTG80?=
 =?utf-8?B?Q01hamIrdncydHJydTZMK2xPMGtWejhGeGErb1FUUUFSVi9BTmxka25IVWlx?=
 =?utf-8?B?dHA3TWxvWU9tMEZ2aGlhVXozM1d1OXNIOHRyWERBRktHQlJuSm1UYlUxZ0Zu?=
 =?utf-8?B?SC8yaks2Ym5YeGpnWUg1VXZ0MzNyM2pSM0x5eVBhZlhhc0lwL3JJS2FMYmUx?=
 =?utf-8?B?OWJmcmNta0lCb2I0WWtOUEwvcXRmeVZ5RGpFcGcrVzRWdXhNNjEreVppUXpi?=
 =?utf-8?B?K3YyRVFNM1pqKzg0SENDMDhWVWVHWVRoMGNhRFVNVGNjbUFKMEJiM1RrYmFt?=
 =?utf-8?B?aFRibGxpNWJEZGlwZVVjSHFzVXk3K2dQdHRNeUw1S0ZzUHBFdGVDc2dFT2tU?=
 =?utf-8?B?aWZBMHBUSTN5dnRIMTRiWklEUGhmeWVUZkVsZ1FBSFB6aUxlWndkRHQ0ZDIz?=
 =?utf-8?B?VDg4eGE3cjFZbVFFemtjTUduOGdYMVdJWFhVOXFWcDZKRzhLdDFsRGo0eU1N?=
 =?utf-8?B?N2RHT2VDK2pudXA5MHFNdndXelV2d1RjMVRta3cybWVLK2VWd3I1clBRb0JU?=
 =?utf-8?B?R0srUWsvdkdMNXFWNWRwUERpdlZPMVFDbkhrQlRNbDNUcHlUVEFEK0c5VFRi?=
 =?utf-8?B?eU1XNFJNRy9kTWN1eDZyMTRueXpIWW4zM2g5Y2g5Y2MzenNUWVN4cDdueGxy?=
 =?utf-8?B?Z3ZqUHdpTGdJRm5BNUxLWnFkemRmMXI2MlRSSCt0QUVmMGtERGpBSXVsTkFj?=
 =?utf-8?B?emdFSHRtV2g3K3hJaU5ja0xZbGg2TTd6elV1SzBYU0ZpaWdpUGt2UVMzSmt6?=
 =?utf-8?B?Y1EzRmVTUkhvZS9sMXlTbmoxSjExSGxHNnJKNHIxcGcwemdjdVBoM3FBQXla?=
 =?utf-8?B?RzlXTFJUdUZvTzRhRWszT2hqdmR1UzBnQ2p5QUVaSmJ5TjdIbVhpWWhXRk10?=
 =?utf-8?B?dDBQVVJmNk5ZRlg5NEVhZE56MCtjOGZUU2VkY1NVVTdFdlBQOGtvZUQyZ2ph?=
 =?utf-8?B?TEtWU3FrVHMzSGJQbkkzTU0rUDhzaHN3eTFCV1FPWGdyeUNWeTNyVnhXY2Nm?=
 =?utf-8?B?VHI2eDIza1RuTlErNkpuMkpKaFU3NjZ0UUZpaDZ1cGNMdEFzZ28wVFNvVGlr?=
 =?utf-8?B?bmVkU3ZybjJQVlR2UEhaMERCU1Z5enN3SUxCZ3Y1UUE5OWZ3TmdJMnc3YzQ4?=
 =?utf-8?B?YU5yQXVIb1YvbWttZUp5TkJQSlVjRURSOFVMalN1TklhUDgvMGZVOWx2WXlB?=
 =?utf-8?Q?f+PI9JiGx4TJZNU3pYOTk+f2s?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1984dd74-255e-4672-042f-08dcb7c36161
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2024 16:01:36.1132
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: LS4Jm1DpmcXpBHzkuHAf3Gu5s0cqcjqxFvuIxJXpKYYOXJaoPX8YCVa1wV9KGG+gpBLifzeMofNd7cSFHOGSCA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7431

Hi Jan,

On 08/08/2024 13:51, Jan Beulich wrote:
> On 08.08.2024 14:09, Ayan Kumar Halder wrote:
>> domain_page.c has been moved to mmu/domain_page.c. The reason
>> being this file implements MMU specific logic for mapping,
>> unmapping, etc domain page.
>>
>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>> ---
>>   xen/arch/arm/mmu/Makefile            | 1 +
>>   xen/arch/arm/{ => mmu}/domain_page.c | 0
>>   2 files changed, 1 insertion(+)
>>   rename xen/arch/arm/{ => mmu}/domain_page.c (100%)
>>
>> diff --git a/xen/arch/arm/mmu/Makefile b/xen/arch/arm/mmu/Makefile
>> index 67475fcd80..2cb44b857d 100644
>> --- a/xen/arch/arm/mmu/Makefile
>> +++ b/xen/arch/arm/mmu/Makefile
>> @@ -2,3 +2,4 @@ obj-y += p2m.o
>>   obj-y += pt.o
>>   obj-y += setup.o
>>   obj-y += smpboot.o
>> +obj-$(CONFIG_ARCH_MAP_DOMAIN_PAGE) += domain_page.o
> Don't you then also need to remove the respective line from arm/Makefile?

Yes you are correct. I missed it.

- Ayan

>
> Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 22:22:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 22:22:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774478.1184883 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scBWT-0007Qx-8L; Thu, 08 Aug 2024 22:22:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774478.1184883; Thu, 08 Aug 2024 22:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scBWT-0007Qp-31; Thu, 08 Aug 2024 22:22:17 +0000
Received: by outflank-mailman (input) for mailman id 774478;
 Thu, 08 Aug 2024 22:22:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scBWR-0007Pr-5I; Thu, 08 Aug 2024 22:22:15 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scBWR-0001mg-3D; Thu, 08 Aug 2024 22:22:15 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scBWQ-0003f1-Lf; Thu, 08 Aug 2024 22:22:14 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1scBWQ-00041K-LH; Thu, 08 Aug 2024 22:22:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=6WgKnh9zDud5fQHc5CsdNF+MOrrb+m2LVRkbAjjh7pA=; b=M416IF+PYCqeHHSafMpFHfvH/I
	NVehTLzpz3KHM+LkDMqFGBdZxe2D8toHUWc/3dgyS6C6fGDKSn+SxdZ/qYrM2ccRNr9lLobXS6chd
	JChnwpLcysGbruJa6QVI+p8nvFWAlTHFZXbehJQz7q4l1bm2TJllDhEzMn3XDCvczsro=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187191-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.17-testing test] 187191: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-debianhvm-amd64:debian-hvm-install:fail:heisenbug
    xen-4.17-testing:test-armhf-armhf-xl-credit1:guest-start/debian.repeat:fail:heisenbug
    xen-4.17-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=72db7ba7dbd1287101b9533cd7e4c877f31a0764
X-Osstest-Versions-That:
    xen=6c4e415656d68d905550070d7aa0f3fe219e4422
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 08 Aug 2024 22:22:14 +0000

flight 187191 xen-4.17-testing real [real]
flight 187196 xen-4.17-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187191/
http://logs.test-lab.xenproject.org/osstest/logs/187196/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 12 debian-hvm-install fail pass in 187196-retest
 test-armhf-armhf-xl-credit1 18 guest-start/debian.repeat fail pass in 187196-retest

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

version targeted for testing:
 xen                  72db7ba7dbd1287101b9533cd7e4c877f31a0764
baseline version:
 xen                  6c4e415656d68d905550070d7aa0f3fe219e4422

Last test of basis   187006  2024-07-25 14:38:46 Z   14 days
Testing same since   187191  2024-08-08 12:09:39 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Daniel P. Smith <dpsmith@apertussolutions.com>
  George Dunlap <george.dunlap@cloud.com>
  Jan Beulich <jbeulich@suse.com>
  Juergen Gross <jgross@suse.com>
  Matthew Barnes <matthew.barnes@cloud.com>
  Roger Pau Monné <roger.pau@citrix.com>
  Ross Lagerwall <ross.lagerwall@citrix.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   6c4e415656..72db7ba7db  72db7ba7dbd1287101b9533cd7e4c877f31a0764 -> stable-4.17


From xen-devel-bounces@lists.xenproject.org Thu Aug 08 23:19:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Aug 2024 23:19:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774498.1184917 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scCPb-0007UG-Ij; Thu, 08 Aug 2024 23:19:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774498.1184917; Thu, 08 Aug 2024 23:19:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scCPb-0007U8-Fa; Thu, 08 Aug 2024 23:19:15 +0000
Received: by outflank-mailman (input) for mailman id 774498;
 Thu, 08 Aug 2024 23:19:14 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=f1bC=PH=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1scCPa-0007U2-CX
 for xen-devel@lists.xenproject.org; Thu, 08 Aug 2024 23:19:14 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9d8b752e-55dc-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 01:19:11 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 921F1CE1407;
 Thu,  8 Aug 2024 23:19:08 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48A68C32782;
 Thu,  8 Aug 2024 23:19:07 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9d8b752e-55dc-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723159147;
	bh=wV0KOCd6lbXLJN77s0oj0mlEgtKOhM0ptbv+zoNhRyM=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=gtly/fGm8A5RMtcXHBQvL57MHZzYyol+Dv3UmKM2Q43pHGBJ54D71x9ZqT7to0HiR
	 Cg+chKoYi8VaT6CtX3ovMzRhThS12DHWG1WfAn1W5458eg3d23dMTSdidfejG82Ttq
	 gCD/cdWgcGCs28aRPGAxqHIb+4S/ujm+omVKlpwtPQvExEMVY/Zv+pBDIdPwFpAEYB
	 tlyomKfGVG/9j/EMUfIuYkgdwFNsUA1EWBvZT59Ed8RqBmNerIGx2ct4VKZIlco0kZ
	 uS26KQM2BPTd2V4NNPNdt/LnUyfSKpVv2oEE2lKAKYmqMmBRz7SxW3HsPZ8dos77Dq
	 5SbwhUdaMjX+A==
Date: Thu, 8 Aug 2024 16:19:02 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
cc: Jan Beulich <jbeulich@suse.com>, 
    "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
    Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: xen | Failed pipeline for staging | 08aacc39
In-Reply-To: <D3AMYKSVBGFR.2IZRXPNCIUUIM@cloud.com>
Message-ID: <alpine.DEB.2.22.394.2408081552570.4954@ubuntu-linux-20-04-desktop>
References: <66b4bd64b9733_2f15a5d3890299@gitlab-sidekiq-catchall-v2-754c69bc57-l5rxx.mail> <c655dbd9-046a-451a-a7e8-670a1eaf4ab0@suse.com> <D3AMYKSVBGFR.2IZRXPNCIUUIM@cloud.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 8 Aug 2024, Alejandro Vallejo wrote:
> On Thu Aug 8, 2024 at 2:02 PM BST, Jan Beulich wrote:
> > On 08.08.2024 14:43, GitLab wrote:
> > > 
> > > 
> > > Pipeline #1405649318 has failed!
> > > 
> > > Project: xen ( https://gitlab.com/xen-project/hardware/xen )
> > > Branch: staging ( https://gitlab.com/xen-project/hardware/xen/-/commits/staging )
> > > 
> > > Commit: 08aacc39 ( https://gitlab.com/xen-project/hardware/xen/-/commit/08aacc392d86d4c7dbebdb5e664060ae2af72057 )
> > > Commit Message: x86/emul: Fix misaligned IO breakpoint behaviou...
> > > Commit Author: Matthew Barnes
> > > Committed by: Jan Beulich ( https://gitlab.com/jbeulich )
> > > 
> > > 
> > > Pipeline #1405649318 ( https://gitlab.com/xen-project/hardware/xen/-/pipelines/1405649318 ) triggered by Jan Beulich ( https://gitlab.com/jbeulich )
> > > had 4 failed jobs.
> > > 
> > > Job #7535428747 ( https://gitlab.com/xen-project/hardware/xen/-/jobs/7535428747/raw )
> > > 
> > > Stage: build
> > > Name: qemu-system-aarch64-6.0.0-arm64-export
> > > Job #7535428873 ( https://gitlab.com/xen-project/hardware/xen/-/jobs/7535428873/raw )
> > > 
> > > Stage: build
> > > Name: alpine-3.18-gcc-debug-arm64-static-shared-mem
> > > Job #7535428869 ( https://gitlab.com/xen-project/hardware/xen/-/jobs/7535428869/raw )
> > > 
> > > Stage: build
> > > Name: alpine-3.18-gcc-debug-arm64-staticmem
> > > Job #7535429434 ( https://gitlab.com/xen-project/hardware/xen/-/jobs/7535429434/raw )
> > > 
> > > Stage: test
> > > Name: qemu-smoke-dom0less-arm32-gcc
> >
> > All Arm failures when the three commits under test only touch x86 code.
> > How can that be? And Stefano, note how this would needlessly have blocked
> > a merge request, if we were already using that model you're proposing to
> > switch to.
> >
> > Jan
> 
> I'd argue it the other way around. It would (may?) have prevented reaching that
> situation in the first place.

Thanks, Alejandro. That's exactly the right mindset and precisely why we
should transition to pre-commit testing. Recently, we encountered a few
broken tests caused by easily avoidable errors from untested commits.

As it happens, due to a change in the ARM GitLab runner on August 10, I
added two new temporary ARM GitLab runners. However, one of them appears
to be experiencing intermittent network issues, I might have to disable
it.


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 02:26:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 02:26:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774509.1184926 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scFKD-0005LU-Bk; Fri, 09 Aug 2024 02:25:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774509.1184926; Fri, 09 Aug 2024 02:25:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scFKD-0005LN-95; Fri, 09 Aug 2024 02:25:53 +0000
Received: by outflank-mailman (input) for mailman id 774509;
 Fri, 09 Aug 2024 02:25:51 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scFKB-0005LB-5n; Fri, 09 Aug 2024 02:25:51 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scFKA-0001pJ-Py; Fri, 09 Aug 2024 02:25:50 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scFKA-0001yE-8h; Fri, 09 Aug 2024 02:25:50 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1scFKA-0005Dg-89; Fri, 09 Aug 2024 02:25:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=AfOL2aF9SHVUioTLESGf5VzGmpU4VUhWL31RN1WsP2k=; b=w906P24ykx9hilzIisgeeGRR3b
	rHmStHwista703xJ3ce0mf+0ceDYYVxsxhGDTal8UyJQuSmvvc3IBlbrRZSr/nyukjzTFaUhQ2E2o
	mOywSl54d4PnA5nSJNX/C7B+SB7llHUv1SAZL4YeEtUK42ySpd4Y8r3B+R0wx/xgioSM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187192-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.18-testing test] 187192: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.18-testing:test-armhf-armhf-xl-raw:debian-di-install:fail:heisenbug
    xen-4.18-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=d446b472cc5051c2ef4eaf5f895d96d7a458c8a1
X-Osstest-Versions-That:
    xen=d078d0aa86e9e3b937f673dc89306b3afd09d560
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 09 Aug 2024 02:25:50 +0000

flight 187192 xen-4.18-testing real [real]
flight 187197 xen-4.18-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187192/
http://logs.test-lab.xenproject.org/osstest/logs/187197/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-raw      12 debian-di-install   fail pass in 187197-retest

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

version targeted for testing:
 xen                  d446b472cc5051c2ef4eaf5f895d96d7a458c8a1
baseline version:
 xen                  d078d0aa86e9e3b937f673dc89306b3afd09d560

Last test of basis   187007  2024-07-25 14:38:46 Z   14 days
Testing same since   187192  2024-08-08 12:10:09 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Daniel P. Smith <dpsmith@apertussolutions.com>
  George Dunlap <george.dunlap@cloud.com>
  Jan Beulich <jbeulich@suse.com>
  Juergen Gross <jgross@suse.com>
  Matthew Barnes <matthew.barnes@cloud.com>
  Roger Pau Monné <roger.pau@citrix.com>
  Ross Lagerwall <ross.lagerwall@citrix.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   d078d0aa86..d446b472cc  d446b472cc5051c2ef4eaf5f895d96d7a458c8a1 -> stable-4.18


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 03:32:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 03:32:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774531.1184968 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scGMf-0007gm-Bo; Fri, 09 Aug 2024 03:32:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774531.1184968; Fri, 09 Aug 2024 03:32:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scGMf-0007gf-95; Fri, 09 Aug 2024 03:32:29 +0000
Received: by outflank-mailman (input) for mailman id 774531;
 Fri, 09 Aug 2024 03:32:28 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scGMd-0007gV-WA; Fri, 09 Aug 2024 03:32:28 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scGMd-0002zL-Ns; Fri, 09 Aug 2024 03:32:27 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scGMd-0003Z5-7D; Fri, 09 Aug 2024 03:32:27 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1scGMd-0002NV-6l; Fri, 09 Aug 2024 03:32:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=wcveCttm3DjwyIwCubE7ZmuFa02vGghAwGlLM+EsHEw=; b=WMFP70YL004SE7I8/paMcpyh/r
	dcNm3OhGhdYCsSg26jsrGrfGKGBcD12M/bw3HsnjSc4zWnFgfEJJTshuIiumTLZ+4lizHYbcgX9k6
	/d5GgaghVnF5S7GAM3hbYXQ2bjO0y0bR2MrpwssRWUfvU7X8BSEGJSZJFm9bm12JeY0I=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187193-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.19-testing test] 187193: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.19-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=033060ee6e05f9e86ef1a51674864b55dc15e62c
X-Osstest-Versions-That:
    xen=026c9fa29716b0ff0f8b7c687908e71ba29cf239
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 09 Aug 2024 03:32:27 +0000

flight 187193 xen-4.19-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187193/

Failures :-/ but no regressions.

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

version targeted for testing:
 xen                  033060ee6e05f9e86ef1a51674864b55dc15e62c
baseline version:
 xen                  026c9fa29716b0ff0f8b7c687908e71ba29cf239

Last test of basis   187153  2024-08-05 08:21:47 Z    3 days
Testing same since   187193  2024-08-08 12:10:23 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Daniel P. Smith <dpsmith@apertussolutions.com>
  George Dunlap <george.dunlap@cloud.com>
  Jan Beulich <jbeulich@suse.com>
  Juergen Gross <jgross@suse.com>
  Matthew Barnes <matthew.barnes@cloud.com>
  Roger Pau Monné <roger.pau@citrix.com>
  Ross Lagerwall <ross.lagerwall@citrix.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   026c9fa297..033060ee6e  033060ee6e05f9e86ef1a51674864b55dc15e62c -> stable-4.19


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 04:10:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 04:10:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774554.1185018 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scGxc-0005wb-Nv; Fri, 09 Aug 2024 04:10:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774554.1185018; Fri, 09 Aug 2024 04:10:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scGxc-0005wU-L3; Fri, 09 Aug 2024 04:10:40 +0000
Received: by outflank-mailman (input) for mailman id 774554;
 Fri, 09 Aug 2024 04:10:40 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=t0+Y=PI=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1scGxb-0005wO-QF
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 04:10:39 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on2061f.outbound.protection.outlook.com
 [2a01:111:f403:2418::61f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 542938f3-5605-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 06:10:37 +0200 (CEST)
Received: from SJ0PR13CA0043.namprd13.prod.outlook.com (2603:10b6:a03:2c2::18)
 by MW5PR12MB5652.namprd12.prod.outlook.com (2603:10b6:303:1a0::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Fri, 9 Aug
 2024 04:10:33 +0000
Received: from SJ5PEPF000001CE.namprd05.prod.outlook.com
 (2603:10b6:a03:2c2:cafe::17) by SJ0PR13CA0043.outlook.office365.com
 (2603:10b6:a03:2c2::18) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.13 via Frontend
 Transport; Fri, 9 Aug 2024 04:10:33 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SJ5PEPF000001CE.mail.protection.outlook.com (10.167.242.38) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Fri, 9 Aug 2024 04:10:32 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 8 Aug
 2024 23:10:02 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 8 Aug
 2024 23:09:38 -0500
Received: from [172.23.60.101] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Thu, 8 Aug 2024 23:09:37 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 542938f3-5605-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=wWM/ajW7Op6/mWweS5kVpMSrhtu1WXPBTnbW10PcorXcr0VVcVmqYCmeGH5j7Oz0etvxXQssHRKBKjZP02Gtc8p5U2oqpnJ8u/pYwZsuPz2pl0D+GkAgw/IRHBCT0nyKJmj2L8tt0D1/ChotK+BxPf9KhnUnqYqg4jFlwGiCabu3CdCl8sySOWUGDY6keEvnvN6syVrMQcBVLr0jR+8p1hOKuPlhyyYCzf/LKsHERs5DFqiS3mC+wz+js2dVWYGPACWrFPjCwhFUeEDjaiER7zRX4Si2Oaj6iszm1QDNlquT6165rl8I8MdtQhQR5wOuECr7TMUFvYcfLuHaqVHeAg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=23ey+hy1quDZO9gtdq1bw4Z7pyw4Gk+iRPKGnPVKghY=;
 b=BprUAd8m8eDhRx49dKn2ltTQs99joCzihSETFiSZuoL3LI7Tf2S8Ghs6zdGtPQXGO8zSlxxoiYxAY9O2J1wFd6c7013jq19S4moenGvlMsPKiQk79cagz8XMKzwScuOmFOp08Bf5U/3CywR+aKz73rjGdjzebnp5vbKE4sqj7sIKODmaQl/9UfnlfWguAmS90CLLET8C8uTEaKfyYFTRvBegPntfiaeRKncjGWPk4WDw8hvsMlwb86x7BQ+NZif6qaTyH/GuNqFMxH80bqVCqrCVTy+SIZC50NUb153Y80qoKoX7MGk5XFIjdlA7x21/dEwIIcT5Mhs0Iw2gM9wAMg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=23ey+hy1quDZO9gtdq1bw4Z7pyw4Gk+iRPKGnPVKghY=;
 b=leDaYoYqVUqMJ32zEJ4hwBesrnWqfQYDNrisRvu9WwCybjVG0MyJW62RI+F+Kx/7fExlMrkk2K9/wJaOdBCNPPQg5UI7KCtXzG8iSx7C2fxySbHmt5Jm/rQbFmyeD2Jjqsnk7qxBBWOfrKOvuuxNN854LT8qLxHl1vB37sf5B1k=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <62523c87-9c93-4b71-a71b-e852fce3136d@amd.com>
Date: Fri, 9 Aug 2024 00:09:37 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] x86/msi: fix locking for SR-IOV devices
To: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, Teddy Astie
	<teddy.astie@vates.tech>, <xen-devel@lists.xenproject.org>
References: <20240807052011.582099-1-stewart.hildebrand@amd.com>
 <1b0475fe-4371-4bf7-a469-aa580648f210@suse.com>
Content-Language: en-US
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
In-Reply-To: <1b0475fe-4371-4bf7-a469-aa580648f210@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001CE:EE_|MW5PR12MB5652:EE_
X-MS-Office365-Filtering-Correlation-Id: e4cd1f91-927a-48ec-eb58-08dcb829366c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?bk5jZEYrMURsMExaT2lnUTRSWU9YMm9jZkVyVFNIditBazY3UFZPai8vQ1JD?=
 =?utf-8?B?TGx3K1BWME4zZE9MSDFoQnN5bFd2OUUzSS9zY3dqaFA1RXE5V0ZqL1FJU0hW?=
 =?utf-8?B?eGxTU0o4OXJudWVSVnNkUTM3YUFNa2FER09jMWNyakxhSS9SZlMyOVJ6MWJL?=
 =?utf-8?B?MGpaTEZDK3hDdFAzOVI3OGdCc2dnNzV6MnlNUklzOXZxYzRaTzZHUTNoSW1q?=
 =?utf-8?B?ZWpXSnN3QVlXQVJmVjYzd21YSjlsTi9mZTZMM2xrMWJLUCtUK0xHM2hvckRL?=
 =?utf-8?B?dUdyQzNRV0NNZUlDam13NkpPRk5ma2lEVXRuZFd0TGRGbkVTay81eHllbDE4?=
 =?utf-8?B?TnQzdC95SjZCSTkwR3llQlRhWnprYjA2WnZNakVNeWdOdm1YMmdaZDVrU0Fr?=
 =?utf-8?B?MXdEODlGOEdWMjZuZ0s5OG1EQzRLUDZKc0ZrenQ0aWNuT25FbUl0RWtXekd1?=
 =?utf-8?B?ckc1bWJBcStZRk9Rb05WMmd5UFhWZHhwSExocGZWaDE2UjR6dmF2ZHhmNG9a?=
 =?utf-8?B?cVlldEpXajJXd3JqL0NrMUtwRU1PM1RrVk9BLzAzcWRQR1pjNjlNb0lJOGYw?=
 =?utf-8?B?UWo1WmNBTTJrT3hyUG5mRmlockpGOFlNclB2Q0JOaEIvZEgycUtqZTRUcVRk?=
 =?utf-8?B?T0xNd1g3UXV3NkJ4RVRSWHBoM1Vqd0xFWktkaEVsTzFCcDNnNEVwYnpYc3Zl?=
 =?utf-8?B?R0RzODVxaE51dU1ZUUgrclBCQUI1NnpPVEpIZGNSOHdNeUtTZml3REd1MmEv?=
 =?utf-8?B?eWIvL2FQUWFjK2JCR1MrbU9ZMFdFQ3ovR3h0cVFsOFp4U3VYdWt1a2d5OVJp?=
 =?utf-8?B?clNhKzRwYmVzQmxHLzZEVXJoOC9rckpJeENxb2R3MUwrbUtuMVYvdkRRMTdK?=
 =?utf-8?B?dHFvMkpiZ3dFamVpQjRIVnJNQ3E4MW10cnNqQjEvZ3JNMWJidFEzZzVZdVZK?=
 =?utf-8?B?eGFqRVBGRVpxUWJTNVF0UW5kTm00R3BKakM4eEMrZmRHSDJKWXNhZVhVcUZI?=
 =?utf-8?B?N3prRHd4ZG5WVUtYVkc3RXZzNVV6V0tMSnRKMEg2bGluZ3FUd1ZHZElkUVlW?=
 =?utf-8?B?M2NLdEpSNCsvZXJ5ZUV4ZWJPUWlVQ1ZoZW1MMlFyelRSb1hvRzNQcjUrZUZY?=
 =?utf-8?B?dWhkTzRYUEVVMUpoSnVkNksrdUxxc0lxN0JkdkRZWWxWT3B2bzA5ODNpbGs0?=
 =?utf-8?B?THBORzdqMWZCakhJM0NWQXNmbHI5RFMyMCtIOWdtMVZwTVB5Tis2QXIzKzZQ?=
 =?utf-8?B?MjU3K1p5RlpGRVNoS2wvZ1gwRzhVMVRVOWhWa0FubW82OStyTStHNE5aZUNQ?=
 =?utf-8?B?a1pLUU9iOVdZOUhnRGUwaTREbzBXVVFFS2toSllVYlpacEViK3U0Rm9vTWYy?=
 =?utf-8?B?SG5CWGlKanMvTVdhcUVRenk3cEQ0WTVJc2syL09QSjEwMHlUeFRlU0dVWXM5?=
 =?utf-8?B?anRWZVF1YjFrWTA1OHlmSEE0RjhDNHc0Q0ZwMW1sKzJBblBhNE5kdjNuZWlQ?=
 =?utf-8?B?V1dmbmVTK1BwNnIzTXpOVFRmZXAvaXBsQ0ZPSmY0bzZxUGFYMEdPOE1kQnds?=
 =?utf-8?B?NnpqL0x5cHp5TzgxUEJXMCt2T0MzdmUya0hQWjI3Rjg2NmRqcHhFemJ1RTNz?=
 =?utf-8?B?Z3g5Z3pySzhwRENEZGhmZ05BZENmdnEzRG5QckJvQWp5R2ZRVmZsaHZ1Vll0?=
 =?utf-8?B?eHArK080amR5Rm5Na0taT0lDMGl5MmVqOVlVOUJhUEVWT1NBbWt2OVAyKzhX?=
 =?utf-8?B?NzhyNjIxTTRmdTBjWTJMeUpHSGh4dXp4MzBEdmRHVnZ3V0pNMGl1Tk5JSHp6?=
 =?utf-8?B?MjVxb3FtSWo5N1VReVB2VDJkOG9nemtHcFhMVlhRcnI5VnYvdEUza3dqck0v?=
 =?utf-8?B?NGFzY3ZJTWlJRUZtOEtIcGtTcWJBdDZPVjByTzQ4T3ZzditZNTZQRExsNHVq?=
 =?utf-8?Q?BWWB8UM0g7C4cIfiS9s5jDOWY95lWS+g?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 04:10:32.4639
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: e4cd1f91-927a-48ec-eb58-08dcb829366c
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF000001CE.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR12MB5652

Hi Jan,

Thanks for the feedback.

On 8/7/24 11:21, Jan Beulich wrote:
> On 07.08.2024 07:20, Stewart Hildebrand wrote:
>> --- a/xen/arch/x86/msi.c
>> +++ b/xen/arch/x86/msi.c
>> @@ -662,7 +662,8 @@ static int msi_capability_init(struct pci_dev *dev,
>>      return 0;
>>  }
>>  
>> -static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
>> +static u64 read_pci_mem_bar(struct pci_dev *pdev, u16 seg, u8 bus, u8 slot,
>> +                            u8 func, u8 bir, int vf)
>>  {
> 
> First I thought this was a leftover from the earlier version. But you need
> it for accessing the vf_rlen[] field. Yet that's properly misleading,
> especially when considering that the fix also wants backporting. What pdev
> represents here changes. I think you want to pass in just vf_rlen (if we
> really want to go this route; I'm a little wary of this repurposing of the
> field, albeit I see no real technical issue).

I like your idea below of using a struct, so I'll pass a pointer to the
new struct.

> Of course there's a BUILD_BUG_ON() which we need to get creative with, in
> order to now outright drop it (see also below).

I suppose this BUILD_BUG_ON() is redundant with the one in
pci_add_device()...

>> @@ -670,19 +671,15 @@ static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
>>  
>>      if ( vf >= 0 )
>>      {
>> -        struct pci_dev *pdev = pci_get_pdev(NULL,
>> -                                            PCI_SBDF(seg, bus, slot, func));
>> +        pci_sbdf_t pf_sbdf = PCI_SBDF(seg, bus, slot, func);
> 
> I think this wants naming just "sbdf" and moving to function scope. There
> are more places in the function which, in a subsequent change, could also
> benefit from this new local variable.

Will do.

>> --- a/xen/drivers/passthrough/pci.c
>> +++ b/xen/drivers/passthrough/pci.c
>> @@ -654,6 +654,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>>      const char *type;
>>      int ret;
>>      bool pf_is_extfn = false;
>> +    uint64_t vf_rlen[6] = { 0 };
> 
> The type of this variable needs to be tied to that of the struct field
> you copy to/from. Otherwise, if the struct field changes type ...
> 
>> @@ -664,7 +665,10 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>>                              PCI_SBDF(seg, info->physfn.bus,
>>                                       info->physfn.devfn));
>>          if ( pdev )
>> +        {
>>              pf_is_extfn = pdev->info.is_extfn;
>> +            memcpy(vf_rlen, pdev->vf_rlen, sizeof(pdev->vf_rlen));
> 
> ... there'll be nothing for the compiler to tell us. Taken together with
> the BUILD_BUG_ON() related remark further up, I think you want to
> introduce a typedef and/or struct here to make things properly typesafe
> (as then you can avoid the use of memcpy()).

Here's what I'm thinking:

struct vf_info {
    uint64_t vf_rlen[PCI_SRIOV_NUM_BARS];
    unsigned int refcnt;
};

struct pci_dev {
    ...
    struct vf_info *vf_info;
    ...
};

> Seeing the conditional we're in, what if we take ...
> 
>> +        }
>>          pcidevs_unlock();
>>          if ( !pdev )
>>              pci_add_device(seg, info->physfn.bus, info->physfn.devfn,
> 
> ... this fallback path?

It seems we need another call to pci_get_pdev() here to obtain a
reference to the newly allocated vf_info from the PF's pdev.

>> @@ -700,7 +704,10 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>>           * extended function.
>>           */
>>          if ( pdev->info.is_virtfn )
>> +        {
>>              pdev->info.is_extfn = pf_is_extfn;
>> +            memcpy(pdev->vf_rlen, vf_rlen, sizeof(pdev->vf_rlen));
>> +        }
>>      }
> 
> Similarly here - what if the enclosing if()'s condition is false? Even
> if these cases couldn't be properly taken care of, they'd at least need
> discussing in the description. In this context note how in a subsequent
> invocation of pci_add_device() for the PF the missing data in vf_rlen[]
> would actually be populated into the placeholder struct that the
> fallback invocation of pci_add_device() would have created. Yet the
> previously created VF's struct wouldn't be updated (afaict). This was,
> iirc, the main reason to always consult the PF's ->vf_rlen[].

Right. If info is NULL, either it's a PF in the fallback case, or the
toolstack invoked PHYSDEVOP_manage_pci_add, in which case we treat it as
a PF or non-SR-IOV device. Using PHYSDEVOP_manage_pci_add for a VF is
not a case we handle. We only know if it's a VF if the toolstack has
told us so.

> An alternative approach might be to add a link from VF to PF, while
> making sure that the PF struct won't be de-allocated until all its VFs
> have gone away. That would then also allow to eliminate the problematic
> pci_get_pdev().

I think I can add a link to a new reference-counted struct with just the
info needed (see the proposed struct above).


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 07:15:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 07:15:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774566.1185028 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scJqN-0007P9-Jq; Fri, 09 Aug 2024 07:15:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774566.1185028; Fri, 09 Aug 2024 07:15:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scJqN-0007P2-HB; Fri, 09 Aug 2024 07:15:23 +0000
Received: by outflank-mailman (input) for mailman id 774566;
 Fri, 09 Aug 2024 07:15:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scJqM-0007Oc-3J; Fri, 09 Aug 2024 07:15:22 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scJqL-0007AL-NU; Fri, 09 Aug 2024 07:15:21 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scJqL-0000hJ-3K; Fri, 09 Aug 2024 07:15:21 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1scJqL-0005zQ-2t; Fri, 09 Aug 2024 07:15:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=whlOELahJyPrGEkhlT5kzKeBdnzwdueuL/9zKsM/KXI=; b=ldD8Q9f8TvezBVSN2c44/vSHf1
	3TgkGZUHPTv+8qQ8DZq8S32hVp2mOuDY/HQFq0uuLmvU1tu7GeuepbO+tDIGK6zljH+QXECp/CtAq
	k1Edxmo0XAime3VjJedcJTZOcevm6D7i58Rjb66tKZeHZHH41ymgOsW6sRlJ0KQH6UQU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187194-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187194: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-libvirt:guest-start/debian.repeat:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    linux-linus:test-armhf-armhf-xl:host-ping-check-xen:fail:heisenbug
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=6a0e38264012809afa24113ee2162dc07f4ed22b
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 09 Aug 2024 07:15:21 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-libvirt 20 guest-start/debian.repeat fail in 187188 pass in 187194
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail in 187188 pass in 187194
 test-armhf-armhf-xl          10 host-ping-check-xen        fail pass in 187188

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

version targeted for testing:
 linux                6a0e38264012809afa24113ee2162dc07f4ed22b
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   23 days
Failing since        186925  2024-07-20 09:44:52 Z   19 days   41 attempts
Testing same since   187184  2024-08-07 21:12:35 Z    1 days    3 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 09:35:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 09:35:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774590.1185039 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scM1N-00032s-Ia; Fri, 09 Aug 2024 09:34:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774590.1185039; Fri, 09 Aug 2024 09:34:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scM1N-00032l-FN; Fri, 09 Aug 2024 09:34:53 +0000
Received: by outflank-mailman (input) for mailman id 774590;
 Fri, 09 Aug 2024 09:34:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=TQMG=PI=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1scM1M-000326-TN
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 09:34:52 +0000
Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com
 [2a00:1450:4864:20::52c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a0ea234e-5632-11ef-bc04-fd08da9f4363;
 Fri, 09 Aug 2024 11:34:52 +0200 (CEST)
Received: by mail-ed1-x52c.google.com with SMTP id
 4fb4d7f45d1cf-5b5b67d0024so2114703a12.0
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 02:34:52 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bbb2c6f6ebsm1373929a12.56.2024.08.09.02.34.50
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 09 Aug 2024 02:34:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a0ea234e-5632-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723196092; x=1723800892; 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=vie/7mTHBG1wCPOj38RBCAuED74DuAm56LUWZFPnkBM=;
        b=D6B6nLwsUAWLlW6r7sJJH0Fzspkq4AOxo7ELhdt+us8ws/P3VdeML+3gmz1m5ed8Kl
         yTGip6rW7R7tkw0gWt33G4DHY90zbnGRPxgD+4M01f0h4qLF7HfUzRM3aUkFll4KAw2p
         wi6FI5BX9PiXFd/9RmojlGwf6UzZO2vIYIqRJD+yjEf6VdFUIYyOoVw6khJUFBwyM18S
         UnLiVgokJlWZCA/duYDlJu1e5eLvkT68cqHhWUHgT8Z1qFG5lVgKTp4hoTpeRDamTNV8
         9rnVNvDayRRv10EklO5pHChfgPn9zf5Ld3iCvcFfWlPhEHtm+BL3qrZWa3X72Wscx5xk
         7bNQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723196092; x=1723800892;
        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=vie/7mTHBG1wCPOj38RBCAuED74DuAm56LUWZFPnkBM=;
        b=rI/OnltN/wibk+oWfL/cw3La6+yNdWJt4Qrx49/fKaC61yQfP6OkGYI5Bh7ejfwCig
         xYXfRt5p1obBA4i03h1PQhjHEJf931OvQ4t2Pjf7eZLne4u9PQZdqPWsklahCIF1Bwtz
         h22zJGqXsRQFia3Lwi3eTekvV7D5yjpEE+vPt6ozJMSsNbf1ejJRWe4g9VS4Tr3uG3pT
         PaZX7kyEHRFKJkbjVwvIDILWA9M3/ykAHjwmlNLGhcP/tOdi2wslpR5YxVvQfcasw8bA
         SIS9TEcbmV36DEjfvWDU3hCokab0QOn/rTkibdmkb6ILeNQ2yNRgiIuizKFuvCCgNbWm
         VOhQ==
X-Gm-Message-State: AOJu0Yxa8fE5u6qa6E19LGhgtVUjfOUq4FYIuixbDFJfQVeL+WMwxyur
	Kw0bZQVSIgqKv1BL3pTNFfq/JxZA0Cu6pxdqjspdMR9MoCX5MBtcyfXJsQWxzg==
X-Google-Smtp-Source: AGHT+IFsn6TdwlATxR82p8PfhpY1Qz9V1q4vsqmOFbRGHEsrGudFsSG5tZKjX0udTTs6XfjR2lLkYg==
X-Received: by 2002:a05:6402:2742:b0:59e:b95d:e744 with SMTP id 4fb4d7f45d1cf-5bd0a63e264mr624000a12.29.1723196091641;
        Fri, 09 Aug 2024 02:34:51 -0700 (PDT)
Message-ID: <724aa3bd-26a0-4a01-8be5-69fa838ee9ba@suse.com>
Date: Fri, 9 Aug 2024 11:34:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/4] xen: arm: make VMAP only support in MMU system
To: Ayan Kumar Halder <ayankuma@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com,
 julien@xen.org
References: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
 <20240808120936.3299937-3-ayan.kumar.halder@amd.com>
 <bc643306-a41a-41bb-b7b7-b7c67f9e5bdf@suse.com>
 <3c491d8f-6180-46d7-a996-049df88a023e@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <3c491d8f-6180-46d7-a996-049df88a023e@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 08.08.2024 17:50, Ayan Kumar Halder wrote:
> On 08/08/2024 13:49, Jan Beulich wrote:
>> On 08.08.2024 14:09, Ayan Kumar Halder wrote:
>>> @@ -58,9 +58,13 @@ config PADDR_BITS
>>>   	default 40 if ARM_PA_BITS_40
>>>   	default 48 if ARM_64
>>>   
>>> +config HAS_VMAP
>>> +	def_bool y
>> With this being always enabled, ...
> 
> I had to define the config somewhere. It seemed this is the correct 
> place to define as HAS_VMAP will be turned off when MPU is introduced.
> 
> So, it will be
> 
> config HAS_VMAP
> 
>             def_bool n
> 
> At that time, only MMU will select HAS_VMAP.

Well, but why is it not simply

config HAS_VMAP
	bool

from the very beginning? (There should never be "def_bool n" imo, btw.)

>>> --- a/xen/include/xen/vmap.h
>>> +++ b/xen/include/xen/vmap.h
>>> @@ -141,7 +141,9 @@ void *arch_vmap_virt_end(void);
>>>   /* Initialises the VMAP_DEFAULT virtual range */
>>>   static inline void vm_init(void)
>>>   {
>>> +#ifdef CONFIG_MMU
>>>       vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end());
>>> +#endif
>>>   }
>> What about non-Arm, which all have MMUs but no corresponding Kconfig
>> setting?
> 
> AFAICS , the only file that is of our concern xen/common/vmap.c It is 
> enclosed with VMAP_VIRT_START which is defined in mmu specific file 
> (xen/arch/arm/include/asm/mmu/layout.h).
> 
> So, it will not be compiled for Arm MPU arch.

Yet that wasn't my question. I asked about non-Arm, for all of which it
looks like you're changing behavior of vm_init() (by suddenly making it
do nothing).

>> And why is this not CONFIG_HAS_VMAP anyway (with HAS_VMAP
>> properly moved to common/Kconfig, where e.g. HAS_PMAP also lives,
>> and then unconditionally selected by all other architectures)?
> 
> I am not sure why CONFIG_HAS_VMAP should be moved to common/Kconfig when 
> it will be selected/deselected only for Arm architecture.

Because you will want to use that (not MMU) in vm_init().

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 09:45:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 09:45:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774600.1185049 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scMBO-00055L-G9; Fri, 09 Aug 2024 09:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774600.1185049; Fri, 09 Aug 2024 09:45:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scMBO-00055E-CU; Fri, 09 Aug 2024 09:45:14 +0000
Received: by outflank-mailman (input) for mailman id 774600;
 Fri, 09 Aug 2024 09:45:13 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=TQMG=PI=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1scMBN-000558-Ek
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 09:45:13 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 104cb18f-5634-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 11:45:08 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5bb85e90ad5so1696455a12.3
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 02:45:11 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9c0ca0bsm823132366b.74.2024.08.09.02.45.09
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 09 Aug 2024 02:45:10 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 104cb18f-5634-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723196711; x=1723801511; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=bfXHI7YRjtVXLrVhuwcVI4WW/iq2ERr9gXv13LmzL3Q=;
        b=ZkV/XNAqCxChWG1PivGeNluSqzYb6HCVWcghKAJIECIbGW8kuQ5wS4bUulgsxKhFEx
         bVDmu1NXrvxeUr4U2/PrClqvpvX4QbevsqmcKw9GF33xQ3/5d2+g6RuTWgn75sh0HmXL
         muhVjiJiBDmKgNjUSXs9ACX9tdQD7/oz6P2JJiPZx8Oy/XUTbbmKhbYV2DNvv/kt6YGJ
         KWzHA523RPpQd6GMdk+duNaZbacwOBtYRvEhbtBengSpl1zGzjqTy+5bDwvu1uHk3Z5W
         2aVkuS5KsLrUhnRvzlKtI/kO/FDoXwFy2qp/r+13w3Ns3z4pSqQA1IRQhSI9X2LLNMiX
         RYgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723196711; x=1723801511;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=bfXHI7YRjtVXLrVhuwcVI4WW/iq2ERr9gXv13LmzL3Q=;
        b=OV6YGnX1iAkjz+a0FN/pXylgoHyDhsNtAtIc5CxZbbwcahCatY0RSBOcseGsveishw
         tXFSuqXIiqoq3NTQMU1fozYhaw4ak+Qxu/1DCC7S82/0PGVj5clearKfuP0Fuqyecgq5
         5oUu3ek2bJ0KpOLMBIdah9SqJnOK4QLvxqbaX1ZlkCbQ5qVUCZO6HQTXgXyp1VgUgQu3
         4AxWOn0euu4rw4WFmguSUXp9OfkQrncAj75ESlPIucPQEcSQZv8OUtDbp2Ul0527gGsP
         Tw42LnHt5CKkaejuiTrCywjq5/MVfqf/BI4y207up8Mf4C3M8CPBS5hqZ8iu55BbK7ba
         A0rg==
X-Forwarded-Encrypted: i=1; AJvYcCWNbBwev+uyuRjLS2YZLkhFgfBiSaNwk9CU5TqAAshaH1Yx2lYzWpR34IsnupeIzIPFrN2yYpRqu310t7gylMrWIne4kNGb6VEp8hUk5Bs=
X-Gm-Message-State: AOJu0YyHdySZwEzjnD3oIrbAfRofYPzDYDbJnjm9RGUNkYyrZHoPNW5e
	1CIFiA2zptnlXcdquMF5d0aAwD/WS/O48AAGIE/lZ+y2qgIUygu9ldE56nmzvA==
X-Google-Smtp-Source: AGHT+IHXEVmAihnXwyVjAcegGO2zuDmd5+TRNNiO5xOEembNdL9LIMP2KZqkz3FjqAEANanlRGVsqA==
X-Received: by 2002:a17:907:7ea1:b0:a7a:8cfb:6568 with SMTP id a640c23a62f3a-a80aa67340dmr72208466b.57.1723196710628;
        Fri, 09 Aug 2024 02:45:10 -0700 (PDT)
Message-ID: <64e0ac51-690d-4c44-85fb-6a0b8415fcb7@suse.com>
Date: Fri, 9 Aug 2024 11:45:09 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 5/5] xen: tolerate ACPI NVS memory overlapping with Xen
 allocated memory
From: Jan Beulich <jbeulich@suse.com>
To: Juergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, linux-kernel@vger.kernel.org,
 x86@kernel.org
References: <20240807104110.18117-1-jgross@suse.com>
 <20240807104110.18117-6-jgross@suse.com>
 <90d67e10-6e35-487e-a9e7-611a0fa3b00b@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <90d67e10-6e35-487e-a9e7-611a0fa3b00b@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 07.08.2024 14:05, Jan Beulich wrote:
> On 07.08.2024 12:41, Juergen Gross wrote:
>> In order to minimize required special handling for running as Xen PV
>> dom0, the memory layout is modified to match that of the host. This
>> requires to have only RAM at the locations where Xen allocated memory
>> is living. Unfortunately there seem to be some machines, where ACPI
>> NVS is located at 64 MB, resulting in a conflict with the loaded
>> kernel or the initial page tables built by Xen.
>>
>> As ACPI NVS needs to be accessed by the kernel only for saving and
>> restoring it across suspend operations, it can be relocated in the
>> dom0's memory map by swapping it with unused RAM (this is possible
>> via modification of the dom0 P2M map).
> 
> While the kernel may not (directly) need to access it for other purposes,
> what about AML accessing it? As you can't advertise the movement to ACPI,
> and as non-RAM mappings are carried out by drivers/acpi/osl.c:acpi_map()
> using acpi_os_ioremap(), phys-to-machine translations won't cover for
> that (unless I'm overlooking something, which unfortunately seems like I
> might be).

Thinking some more about this, the above may be pointing in the wrong
direction. If from acpi_os_ioremap() downwards no address translation
(PFN -> MFN) occurred, then what's coming from AML would still be
handled correctly as far as page table entries go. The problem then
might instead be that the mapping would appear to be covering RAM, not
the ACPI NVS region (and there may be checks for that).

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 10:08:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 10:08:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774609.1185059 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scMXR-0000rc-6g; Fri, 09 Aug 2024 10:08:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774609.1185059; Fri, 09 Aug 2024 10:08:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scMXR-0000rV-3J; Fri, 09 Aug 2024 10:08:01 +0000
Received: by outflank-mailman (input) for mailman id 774609;
 Fri, 09 Aug 2024 10:08:00 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7QEF=PI=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1scMXQ-0000rP-2d
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 10:08:00 +0000
Received: from pb-smtp2.pobox.com (pb-smtp2.pobox.com [64.147.108.71])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2a1c64e6-5637-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 12:07:21 +0200 (CEST)
Received: from pb-smtp2.pobox.com (unknown [127.0.0.1])
 by pb-smtp2.pobox.com (Postfix) with ESMTP id ADE912A0AA;
 Fri,  9 Aug 2024 06:07:22 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-smtp2.pobox.com (Postfix) with ESMTP id A3BA42A0A7;
 Fri,  9 Aug 2024 06:07:22 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [185.130.54.120])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 11FE62A0A1;
 Fri,  9 Aug 2024 06:07:16 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2a1c64e6-5637-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:mime-version:content-transfer-encoding;
	 s=sasl; bh=X8/HED5BuW05zs9K9lACT5yymLeMN0/h3TfhqeVH2oY=; b=jz8C
	oGmqPHP5YoBibOmAGYjsM4izPryRC/vU8O26SdZrJx1aKmtdbRfRtvCeZO2ryijW
	mTKkPjc5npvbQst/JxNMjyjZvWhybbitze52aFKyfbfjljtOyLTJ+h2K2LYq3eln
	l6ukXxUkOWw7nxHt9VFlIRe8JPL2A4gtk6BEO9U=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [XEN PATCH v1 0/2] x86/CPU: optional build of Intel/AMD CPUs support
Date: Fri,  9 Aug 2024 13:07:13 +0300
Message-Id: <cover.1723196909.git.Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
X-Pobox-Relay-ID:
 27B162AA-5637-11EF-8F10-9B0F950A682E-90055647!pb-smtp2.pobox.com
Content-Transfer-Encoding: quoted-printable

This series is one more step towards separation of Intel/AMD support in X=
en.
With all preparation work is mostly done now, it becomes possible to make=
 build
of arch/x86/cpu/{amd.c,intel.c} files optional, depending on whether
CONFIG_{AMD,INTEL} are enabled or not.

This can be useful for builds tuned for specific platform -- by reducing =
dead
code that won't ever be executed on that platform anyway.

Note: this series (namely its Intel part) depends on optional PSR support=
 patch:
https://lore.kernel.org/xen-devel/20240801084453.1163506-1-Sergiy_Kibrik@=
epam.com/

  -Sergiy
 =20
Sergiy Kibrik (2):
  x86/intel: optional build of intel.c
  x86/amd: optional build of amd.c

 xen/arch/x86/cpu/Makefile            | 10 +++++-----
 xen/arch/x86/cpu/common.c            |  8 ++++++--
 xen/arch/x86/include/asm/amd.h       | 22 ++++++++++++++++++++++
 xen/arch/x86/include/asm/processor.h |  7 ++++---
 xen/arch/x86/spec_ctrl.c             |  2 ++
 5 files changed, 39 insertions(+), 10 deletions(-)

--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 09 10:09:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 10:09:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774616.1185068 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scMYm-0001Nu-FL; Fri, 09 Aug 2024 10:09:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774616.1185068; Fri, 09 Aug 2024 10:09:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scMYm-0001Nn-Cr; Fri, 09 Aug 2024 10:09:24 +0000
Received: by outflank-mailman (input) for mailman id 774616;
 Fri, 09 Aug 2024 10:09:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7QEF=PI=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1scMYl-0001NP-Av
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 10:09:23 +0000
Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 71e093e4-5637-11ef-bc04-fd08da9f4363;
 Fri, 09 Aug 2024 12:09:22 +0200 (CEST)
Received: from pb-smtp1.pobox.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id 1CDC018663;
 Fri,  9 Aug 2024 06:09:20 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id 155D018662;
 Fri,  9 Aug 2024 06:09:20 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [185.130.54.120])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 26B4418661;
 Fri,  9 Aug 2024 06:09:19 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 71e093e4-5637-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:in-reply-to:references:mime-version
	:content-transfer-encoding; s=sasl; bh=FcgplM/ww4dhD8AId/NsW6zg4
	b4Mk/iLAAxsyvZiVYY=; b=TayMRCp8yrrOqu0YzcfEfILF52M95JlZcBbTb+JtL
	hk9gdbbDZFdKpWIF4OAAyt7LgC6YZeH9XH+v9rcbZDJ66Zj1qUZ4ftMzzf+gs4eU
	xhmamxoJMjT/aWn1xnZ+JIcaO4Na9+laHECzJdPxCqWS8KBn6hYgiPOZczIbnm+Y
	WM=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [XEN PATCH v1 1/2] x86/intel: optional build of intel.c
Date: Fri,  9 Aug 2024 13:09:17 +0300
Message-Id: <25e80b9271607da56abf9d4193e4d91b3d00bd9c.1723196909.git.Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1723196909.git.Sergiy_Kibrik@epam.com>
References: <cover.1723196909.git.Sergiy_Kibrik@epam.com>
MIME-Version: 1.0
X-Pobox-Relay-ID:
 710E7172-5637-11EF-9160-2BAEEB2EC81B-90055647!pb-smtp1.pobox.com
Content-Transfer-Encoding: quoted-printable

With specific config option INTEL in place and most of the code that depe=
nds
on intel.c now can be optionally enabled/disabled it's now possible to pu=
t
the whole intel.c under INTEL option as well. This will allow for a Xen b=
uild
without Intel CPU support.

Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
---
 xen/arch/x86/cpu/Makefile            | 6 +++---
 xen/arch/x86/cpu/common.c            | 4 +++-
 xen/arch/x86/include/asm/processor.h | 7 ++++---
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/cpu/Makefile b/xen/arch/x86/cpu/Makefile
index eafce5f204..020c86bda3 100644
--- a/xen/arch/x86/cpu/Makefile
+++ b/xen/arch/x86/cpu/Makefile
@@ -6,10 +6,10 @@ obj-y +=3D amd.o
 obj-y +=3D centaur.o
 obj-y +=3D common.o
 obj-y +=3D hygon.o
-obj-y +=3D intel.o
-obj-y +=3D intel_cacheinfo.o
+obj-$(CONFIG_INTEL) +=3D intel.o
+obj-$(CONFIG_INTEL) +=3D intel_cacheinfo.o
 obj-y +=3D mwait-idle.o
-obj-y +=3D shanghai.o
+obj-$(CONFIG_INTEL) +=3D shanghai.o
 obj-y +=3D vpmu.o
 obj-$(CONFIG_AMD) +=3D vpmu_amd.o
 obj-$(CONFIG_INTEL) +=3D vpmu_intel.o
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index ff4cd22897..50ce13f81c 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -336,11 +336,13 @@ void __init early_cpu_init(bool verbose)
=20
 	c->x86_vendor =3D x86_cpuid_lookup_vendor(ebx, ecx, edx);
 	switch (c->x86_vendor) {
+#ifdef CONFIG_INTEL
 	case X86_VENDOR_INTEL:    intel_unlock_cpuid_leaves(c);
 				  actual_cpu =3D intel_cpu_dev;    break;
+	case X86_VENDOR_SHANGHAI: actual_cpu =3D shanghai_cpu_dev; break;
+#endif
 	case X86_VENDOR_AMD:      actual_cpu =3D amd_cpu_dev;      break;
 	case X86_VENDOR_CENTAUR:  actual_cpu =3D centaur_cpu_dev;  break;
-	case X86_VENDOR_SHANGHAI: actual_cpu =3D shanghai_cpu_dev; break;
 	case X86_VENDOR_HYGON:    actual_cpu =3D hygon_cpu_dev;    break;
 	default:
 		actual_cpu =3D default_cpu;
diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/=
asm/processor.h
index 66463f6a6d..a88d45252b 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -507,15 +507,16 @@ static inline uint8_t get_cpu_family(uint32_t raw, =
uint8_t *model,
 extern int8_t opt_tsx;
 extern bool rtm_disabled;
 void tsx_init(void);
+void update_mcu_opt_ctrl(void);
+void set_in_mcu_opt_ctrl(uint32_t mask, uint32_t val);
 #else
 #define opt_tsx      0     /* explicitly indicate TSX is off */
 #define rtm_disabled false /* RTM was not force-disabled */
 static inline void tsx_init(void) {}
+static inline void update_mcu_opt_ctrl(void) {}
+static inline void set_in_mcu_opt_ctrl(uint32_t mask, uint32_t val) {}
 #endif
=20
-void update_mcu_opt_ctrl(void);
-void set_in_mcu_opt_ctrl(uint32_t mask, uint32_t val);
-
 enum ap_boot_method {
     AP_BOOT_NORMAL,
     AP_BOOT_SKINIT,
--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 09 10:11:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 10:11:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774625.1185079 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scMak-0002pf-QS; Fri, 09 Aug 2024 10:11:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774625.1185079; Fri, 09 Aug 2024 10:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scMak-0002pY-Nl; Fri, 09 Aug 2024 10:11:26 +0000
Received: by outflank-mailman (input) for mailman id 774625;
 Fri, 09 Aug 2024 10:11:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7QEF=PI=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1scMaj-0002pI-7t
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 10:11:25 +0000
Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bb57f72e-5637-11ef-bc04-fd08da9f4363;
 Fri, 09 Aug 2024 12:11:24 +0200 (CEST)
Received: from pb-smtp1.pobox.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id 72A6C186EA;
 Fri,  9 Aug 2024 06:11:23 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id 69B9A186E9;
 Fri,  9 Aug 2024 06:11:23 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [185.130.54.120])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 85467186E8;
 Fri,  9 Aug 2024 06:11:22 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bb57f72e-5637-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:in-reply-to:references:mime-version
	:content-transfer-encoding; s=sasl; bh=ojiKxXFKhugIX7qMuxIF0x+el
	EBDUt8AoK9fdheBKz0=; b=N6Xf0d6ExwA7PjY/19wATQGl6mBbbrks7ML9o9RLI
	4DizJKTCh57db7gJ5TQOBHqAjhjUU+iEcoY9baKFzqOQnpt8tgibhGa3xbzK5O+9
	Np/cgmV1FEZgORxiNvaqVn3EyzBBXeRKkd+Lh+HIyxmtRDC8Qq4sqMNv+g/SRbYF
	zI=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [XEN PATCH v1 2/2] x86/amd: optional build of amd.c
Date: Fri,  9 Aug 2024 13:11:20 +0300
Message-Id: <5632b05e993cca78a58b800dd37165ccd80b944f.1723196909.git.Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1723196909.git.Sergiy_Kibrik@epam.com>
References: <cover.1723196909.git.Sergiy_Kibrik@epam.com>
MIME-Version: 1.0
X-Pobox-Relay-ID:
 BA99E13C-5637-11EF-970D-2BAEEB2EC81B-90055647!pb-smtp1.pobox.com
Content-Transfer-Encoding: quoted-printable

Similar to making Intel CPU support optional -- as we've got CONFIG_AMD o=
ption
now, we can put arch/x86/cpu/amd.c under it and make it possible to build
Xen without AMD CPU support. One possible use case is to dispose of dead =
code
in Intel-only systems.

Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
---
 xen/arch/x86/cpu/Makefile      |  4 ++--
 xen/arch/x86/cpu/common.c      |  4 +++-
 xen/arch/x86/include/asm/amd.h | 22 ++++++++++++++++++++++
 xen/arch/x86/spec_ctrl.c       |  2 ++
 4 files changed, 29 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/Makefile b/xen/arch/x86/cpu/Makefile
index 020c86bda3..5efd87be38 100644
--- a/xen/arch/x86/cpu/Makefile
+++ b/xen/arch/x86/cpu/Makefile
@@ -2,10 +2,10 @@ obj-y +=3D mcheck/
 obj-y +=3D microcode/
 obj-y +=3D mtrr/
=20
-obj-y +=3D amd.o
+obj-$(CONFIG_AMD) +=3D amd.o
 obj-y +=3D centaur.o
 obj-y +=3D common.o
-obj-y +=3D hygon.o
+obj-$(CONFIG_AMD) +=3D hygon.o
 obj-$(CONFIG_INTEL) +=3D intel.o
 obj-$(CONFIG_INTEL) +=3D intel_cacheinfo.o
 obj-y +=3D mwait-idle.o
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 50ce13f81c..7be689c2e3 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -341,9 +341,11 @@ void __init early_cpu_init(bool verbose)
 				  actual_cpu =3D intel_cpu_dev;    break;
 	case X86_VENDOR_SHANGHAI: actual_cpu =3D shanghai_cpu_dev; break;
 #endif
+#ifdef CONFIG_AMD
 	case X86_VENDOR_AMD:      actual_cpu =3D amd_cpu_dev;      break;
-	case X86_VENDOR_CENTAUR:  actual_cpu =3D centaur_cpu_dev;  break;
 	case X86_VENDOR_HYGON:    actual_cpu =3D hygon_cpu_dev;    break;
+#endif
+	case X86_VENDOR_CENTAUR:  actual_cpu =3D centaur_cpu_dev;  break;
 	default:
 		actual_cpu =3D default_cpu;
 		if (!verbose)
diff --git a/xen/arch/x86/include/asm/amd.h b/xen/arch/x86/include/asm/am=
d.h
index fa4e0fc766..a2481eddc7 100644
--- a/xen/arch/x86/include/asm/amd.h
+++ b/xen/arch/x86/include/asm/amd.h
@@ -158,13 +158,21 @@
 #define is_zen4_uarch()   boot_cpu_has(X86_FEATURE_AUTO_IBRS)
=20
 struct cpuinfo_x86;
+#ifdef CONFIG_AMD
 int cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu, int osvw_id, ...)=
;
+#else
+static inline int cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu, int=
 osvw_id, ...)
+{
+    return false;
+}
+#endif
=20
 extern s8 opt_allow_unsafe;
=20
 void fam10h_check_enable_mmcfg(void);
 void check_enable_amd_mmconf_dmi(void);
=20
+#ifdef CONFIG_AMD
 extern bool amd_acpi_c1e_quirk;
 void amd_check_disable_c1e(unsigned int port, u8 value);
=20
@@ -173,5 +181,19 @@ extern bool amd_virt_spec_ctrl;
 bool amd_setup_legacy_ssbd(void);
 void amd_set_legacy_ssbd(bool enable);
 void amd_set_cpuid_user_dis(bool enable);
+#else
+static inline void amd_set_cpuid_user_dis(bool enable) {}
+static inline void amd_set_legacy_ssbd(bool enable) {}
+static inline bool amd_setup_legacy_ssbd(void)
+{
+    return false;
+}
+
+#define amd_acpi_c1e_quirk (false)
+#define amd_virt_spec_ctrl (false)
+#define amd_legacy_ssbd (false)
+
+static inline void amd_check_disable_c1e(unsigned int port, u8 value) {}
+#endif
=20
 #endif /* __AMD_H__ */
diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index 92405b8be7..8231515c80 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -1884,10 +1884,12 @@ void __init init_speculation_mitigations(void)
             setup_force_cpu_cap(X86_FEATURE_SC_MSR_HVM);
     }
=20
+#ifdef CONFIG_AMD
     /* Support VIRT_SPEC_CTRL.SSBD if AMD_SSBD is not available. */
     if ( opt_msr_sc_hvm && !cpu_has_amd_ssbd &&
          (cpu_has_virt_ssbd || (amd_legacy_ssbd && amd_setup_legacy_ssbd=
())) )
         amd_virt_spec_ctrl =3D true;
+#endif
=20
     /* Figure out default_xen_spec_ctrl. */
     if ( has_spec_ctrl && ibrs )
--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 09 10:23:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 10:23:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774639.1185088 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scMmP-00058C-So; Fri, 09 Aug 2024 10:23:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774639.1185088; Fri, 09 Aug 2024 10:23:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scMmP-000585-QG; Fri, 09 Aug 2024 10:23:29 +0000
Received: by outflank-mailman (input) for mailman id 774639;
 Fri, 09 Aug 2024 10:23: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=RF4x=PI=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1scMmO-00057z-HG
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 10:23:28 +0000
Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com
 [2a00:1450:4864:20::52c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6a8c4d9e-5639-11ef-bc04-fd08da9f4363;
 Fri, 09 Aug 2024 12:23:27 +0200 (CEST)
Received: by mail-ed1-x52c.google.com with SMTP id
 4fb4d7f45d1cf-5b7b6a30454so2340325a12.2
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 03:23:27 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6a8c4d9e-5639-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723199007; x=1723803807; 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=g3OZ6i3t+Jrt4X67Jea4ruZJY8L9jivWEm6rl2B9hLI=;
        b=Zzv7fB6zLPTKEZSZhV7gDrzpO+5vdgkPeePky1V2xVeNSEtyNwm6sjpY3EmScUc13d
         1qRld6Q+5Galf8ZMy/k8K3QPZ4nxZ75W/YD78zt3c3qEpRQ+FH0dFoH4nSkP0gA3supG
         hqpzlZ8H8BP8vGPoCGdVlGdyvjmaUeqhNpLo+QT1UQvSmyS0bMFeBNs5vAyAL2SXWl7g
         ooahUqdAW6lb404SbCfiOrEGcst4J6t9VIa2wi48BXjwFN1z1zvWC0PHO60fOq5AbzlA
         jci05l0xjzm9shJ7ec9uwJjU93SUOaXc3S3HNVl5pqcMduOKhkZW6XK/ZiBx/UbFYqhX
         3nJw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723199007; x=1723803807;
        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=g3OZ6i3t+Jrt4X67Jea4ruZJY8L9jivWEm6rl2B9hLI=;
        b=h6CRJpHX1d9sKPAtiTYRqzWbitUYFSgITumYnNzBUA8LI3BajWTYypzCBz9y1PEmi/
         mJ+EuAxFiEhtEavwo4Z31gzImYlvYOteIkX7LjaCm1uxQbuf/OLEBF74aapE9L83r6Tj
         G8iRFOBAH3o0Y+9zU2WubTnEej/NI37uaYyndWbjOeA4rB+cbbGHN7zhZnLli76s7qkp
         2N+DCOpNL2FCJWspZQ4vrxUulx8l/IRuB1XeO9j6XO72daEM76UDN3J48ZAeQGBPr9au
         bXKVH1LG75fMeBGf7HdLTwnRy2Zj9LFzqj7dBCQ7j9tEYHN8dU8NvY7+jpGe+AzXRfM9
         q4xw==
X-Gm-Message-State: AOJu0YwZ63fTd0E4BYA1zjNvFHdMRzP5d1a08g5kVcnl/ubWM+2ekF2m
	u6JHtjLJFbzKwVND5KA5hKxLmeAI/N9rPnWHBLpcAhlPYchh/cccuwlQ1KYTl0+Cg/WZVPtnp/v
	QY8K25nY19q7Lq1d9fHAjMrATGyg=
X-Google-Smtp-Source: AGHT+IHxefxRbpMyBF4ZHZCeVerzHxDhh0qFok2KXYqAJX5pQIT9ZaQD9x6KqE5CIzDpGTxA9efclW9DEnvN6AsILB0=
X-Received: by 2002:a05:6402:2791:b0:5a2:763e:b8bf with SMTP id
 4fb4d7f45d1cf-5bd0a61181fmr1021909a12.25.1723199006291; Fri, 09 Aug 2024
 03:23:26 -0700 (PDT)
MIME-Version: 1.0
References: <20240522132829.1278625-1-edgar.iglesias@gmail.com>
 <20240522132829.1278625-2-edgar.iglesias@gmail.com> <7AA016AF-03B0-4321-B0B9-FBDD60B24557@arm.com>
In-Reply-To: <7AA016AF-03B0-4321-B0B9-FBDD60B24557@arm.com>
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Date: Fri, 9 Aug 2024 12:23:14 +0200
Message-ID: <CAJy5ezqz8oHfv_an9DtoGwJK2M6d_HO_QhUVvwd7k8wdmibG4w@mail.gmail.com>
Subject: Re: [PATCH v1 1/1] xen/arm: smmuv3: Mark more init-only functions
 with __init
To: Rahul Singh <Rahul.Singh@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, 
	Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>, 
	Bertrand Marquis <Bertrand.Marquis@arm.com>, "michal.orzel@amd.com" <michal.orzel@amd.com>, 
	"Volodymyr_Babchuk@epam.com" <Volodymyr_Babchuk@epam.com>, 
	"edgar.iglesias@amd.com" <edgar.iglesias@amd.com>
Content-Type: multipart/alternative; boundary="000000000000a5bf2e061f3d88dc"

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

On Wed, Jun 5, 2024 at 11:55=E2=80=AFAM Rahul Singh <Rahul.Singh@arm.com> w=
rote:

> Hi Edgar,
>
> > On 22 May 2024, at 2:28=E2=80=AFPM, Edgar E. Iglesias <edgar.iglesias@g=
mail.com>
> wrote:
> >
> > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> >
> > Move more functions that are only called at init to
> > the .init.text section.
> >
> > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
>
> Acked-by: Rahul Singh <rahul.singh@arm.com>
> Tested-by: Rahul Singh <rahul.singh@arm.com>
>
> Regards,
> Rahul
>

Ping!

This still rebases cleanly on top of master but let me know if I should
resend.

Best regards,
Edgar

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

<div dir=3D"ltr"><div dir=3D"ltr">On Wed, Jun 5, 2024 at 11:55=E2=80=AFAM R=
ahul Singh &lt;<a href=3D"mailto:Rahul.Singh@arm.com">Rahul.Singh@arm.com</=
a>&gt; wrote:<br></div><div class=3D"gmail_quote"><blockquote class=3D"gmai=
l_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,20=
4,204);padding-left:1ex">Hi Edgar,<br>
<br>
&gt; On 22 May 2024, at 2:28=E2=80=AFPM, Edgar E. Iglesias &lt;<a href=3D"m=
ailto:edgar.iglesias@gmail.com" target=3D"_blank">edgar.iglesias@gmail.com<=
/a>&gt; wrote:<br>
&gt; <br>
&gt; From: &quot;Edgar E. Iglesias&quot; &lt;<a href=3D"mailto:edgar.iglesi=
as@amd.com" target=3D"_blank">edgar.iglesias@amd.com</a>&gt;<br>
&gt; <br>
&gt; Move more functions that are only called at init to<br>
&gt; the .init.text section.<br>
&gt; <br>
&gt; Signed-off-by: Edgar E. Iglesias &lt;<a href=3D"mailto:edgar.iglesias@=
amd.com" target=3D"_blank">edgar.iglesias@amd.com</a>&gt;<br>
<br>
Acked-by: Rahul Singh &lt;<a href=3D"mailto:rahul.singh@arm.com" target=3D"=
_blank">rahul.singh@arm.com</a>&gt;<br>
Tested-by: Rahul Singh &lt;<a href=3D"mailto:rahul.singh@arm.com" target=3D=
"_blank">rahul.singh@arm.com</a>&gt;<br>
<br>
Regards,<br>
Rahul<br></blockquote><div><br></div><div>Ping!</div><div><br></div><div>Th=
is still rebases cleanly on top of master but let me know if I should resen=
d.</div><div><br></div><div>Best regards,</div><div>Edgar</div></div></div>

--000000000000a5bf2e061f3d88dc--


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 10:37:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 10:37:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774650.1185099 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scMzZ-0007sF-1T; Fri, 09 Aug 2024 10:37:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774650.1185099; Fri, 09 Aug 2024 10:37:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scMzY-0007s8-Uv; Fri, 09 Aug 2024 10:37:04 +0000
Received: by outflank-mailman (input) for mailman id 774650;
 Fri, 09 Aug 2024 10:37:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dBfy=PI=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1scMzX-0007s2-VT
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 10:37:04 +0000
Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com
 [2a00:1450:4864:20::62d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4fedac24-563b-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 12:37:01 +0200 (CEST)
Received: by mail-ej1-x62d.google.com with SMTP id
 a640c23a62f3a-a7aa086b077so194631466b.0
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 03:37:01 -0700 (PDT)
Received: from localhost ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9d8a4b1sm832735766b.151.2024.08.09.03.36.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 09 Aug 2024 03:37:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4fedac24-563b-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723199821; x=1723804621; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=rOJZysuO7YX6C+HiR3FdpKHjYZKOT3NccPJkp3Z5Ok0=;
        b=C6Wm6Cvx7q6VXrrTw1kuek6p6ncxkgzCfZndy1S9ueGJy84y6ub71WAnQFBSfSN1vG
         wlMxTU4RSedE9p6CRqi0LyZfNGRUzd0i8DuILxxPB+15C1ZPA99JRgGJ0BtUE5iraXrO
         6LAJmfafNY8MKkosbtsAYzl+ouB5ghcrd7hl4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723199821; x=1723804621;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=rOJZysuO7YX6C+HiR3FdpKHjYZKOT3NccPJkp3Z5Ok0=;
        b=WRCyAvEzj/GEDTT7VmvHUb5urgoz8yWDbFKn+UkMM8HKG6BjswlDnoBENWX3PJ16Yp
         e8FUrXS8ocpix4Xoc/WCNZcjpqo/6mo3lVuskctvCYMW2RZ3ZyjA06XFJTq0nnBkW2F8
         Pz+lZRzgWPkG/y2/+bBIMkYFL5kyzy9rXutwEVM87g9/hUwU3sTcFJ0hF3HT5F9ivaUG
         ChaCWh2TBYywVTKGxqaBvhe7oPh+8fNcyO14H689VJAqENS/I0gzFaJr60PR7/AJ8O2P
         kvrr3YNqMK2g5qzhMDE5PEYT7sTF9E9RpIVCNyvcGHpMbt6FWMI5Ae/JCCHdx9l4EGYU
         LyEg==
X-Forwarded-Encrypted: i=1; AJvYcCV/IOB/FJ4WlXd0+Aj20SbUHgo+UdWTKfAQcEIDg5ghZmrFyjUMOdrHbfRvlMRyB//iJoeEus0Ez5E=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyZc9HTiXOKensm8vAMP91Db2cseQFSJXk3+SNQHOWTDDRo5Zdn
	fX3aBIpivq5aO5WYf1+hAmkwvRrPH9qdC5y8f290D1yMB/xOo06hsduILEG8mzM=
X-Google-Smtp-Source: AGHT+IGlimiv/HRU8LRFYMwY+vsN7xzqrqZgXQdlTIFvxZayrah58MkyG10eu9tHKoECnicAqiHaFg==
X-Received: by 2002:a17:907:e6a4:b0:a7a:929f:c0cb with SMTP id a640c23a62f3a-a80aa5eb16amr85493866b.38.1723199820960;
        Fri, 09 Aug 2024 03:37:00 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Fri, 09 Aug 2024 11:36:58 +0100
Message-Id: <D3BBCS1WZ3FI.KYTC0BZLDUM9@cloud.com>
Cc: "Jan Beulich" <jbeulich@suse.com>, "Andrew Cooper"
 <andrew.cooper3@citrix.com>, =?utf-8?q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, "Stefano Stabellini" <sstabellini@kernel.org>
Subject: Re: [XEN PATCH v1 1/2] x86/intel: optional build of intel.c
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Sergiy Kibrik" <Sergiy_Kibrik@epam.com>,
 <xen-devel@lists.xenproject.org>
X-Mailer: aerc 0.17.0
References: <cover.1723196909.git.Sergiy_Kibrik@epam.com>
 <25e80b9271607da56abf9d4193e4d91b3d00bd9c.1723196909.git.Sergiy_Kibrik@epam.com>
In-Reply-To: <25e80b9271607da56abf9d4193e4d91b3d00bd9c.1723196909.git.Sergiy_Kibrik@epam.com>

On Fri Aug 9, 2024 at 11:09 AM BST, Sergiy Kibrik wrote:
> With specific config option INTEL in place and most of the code that depe=
nds
> on intel.c now can be optionally enabled/disabled it's now possible to pu=
t
> the whole intel.c under INTEL option as well. This will allow for a Xen b=
uild
> without Intel CPU support.
>
> Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
> ---
>  xen/arch/x86/cpu/Makefile            | 6 +++---
>  xen/arch/x86/cpu/common.c            | 4 +++-
>  xen/arch/x86/include/asm/processor.h | 7 ++++---
>  3 files changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/xen/arch/x86/cpu/Makefile b/xen/arch/x86/cpu/Makefile
> index eafce5f204..020c86bda3 100644
> --- a/xen/arch/x86/cpu/Makefile
> +++ b/xen/arch/x86/cpu/Makefile
> @@ -6,10 +6,10 @@ obj-y +=3D amd.o
>  obj-y +=3D centaur.o
>  obj-y +=3D common.o
>  obj-y +=3D hygon.o
> -obj-y +=3D intel.o
> -obj-y +=3D intel_cacheinfo.o
> +obj-$(CONFIG_INTEL) +=3D intel.o
> +obj-$(CONFIG_INTEL) +=3D intel_cacheinfo.o
>  obj-y +=3D mwait-idle.o
> -obj-y +=3D shanghai.o
> +obj-$(CONFIG_INTEL) +=3D shanghai.o

Why pick this one too? It's based on VIA IP, aiui.

>  obj-y +=3D vpmu.o
>  obj-$(CONFIG_AMD) +=3D vpmu_amd.o
>  obj-$(CONFIG_INTEL) +=3D vpmu_intel.o
> diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
> index ff4cd22897..50ce13f81c 100644
> --- a/xen/arch/x86/cpu/common.c
> +++ b/xen/arch/x86/cpu/common.c
> @@ -336,11 +336,13 @@ void __init early_cpu_init(bool verbose)
> =20
>  	c->x86_vendor =3D x86_cpuid_lookup_vendor(ebx, ecx, edx);
>  	switch (c->x86_vendor) {
> +#ifdef CONFIG_INTEL
>  	case X86_VENDOR_INTEL:    intel_unlock_cpuid_leaves(c);
>  				  actual_cpu =3D intel_cpu_dev;    break;
> +	case X86_VENDOR_SHANGHAI: actual_cpu =3D shanghai_cpu_dev; break;
> +#endif
>  	case X86_VENDOR_AMD:      actual_cpu =3D amd_cpu_dev;      break;
>  	case X86_VENDOR_CENTAUR:  actual_cpu =3D centaur_cpu_dev;  break;
> -	case X86_VENDOR_SHANGHAI: actual_cpu =3D shanghai_cpu_dev; break;
>  	case X86_VENDOR_HYGON:    actual_cpu =3D hygon_cpu_dev;    break;
>  	default:
>  		actual_cpu =3D default_cpu;
> diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/=
asm/processor.h
> index 66463f6a6d..a88d45252b 100644
> --- a/xen/arch/x86/include/asm/processor.h
> +++ b/xen/arch/x86/include/asm/processor.h
> @@ -507,15 +507,16 @@ static inline uint8_t get_cpu_family(uint32_t raw, =
uint8_t *model,
>  extern int8_t opt_tsx;
>  extern bool rtm_disabled;
>  void tsx_init(void);
> +void update_mcu_opt_ctrl(void);
> +void set_in_mcu_opt_ctrl(uint32_t mask, uint32_t val);
>  #else
>  #define opt_tsx      0     /* explicitly indicate TSX is off */
>  #define rtm_disabled false /* RTM was not force-disabled */
>  static inline void tsx_init(void) {}
> +static inline void update_mcu_opt_ctrl(void) {}
> +static inline void set_in_mcu_opt_ctrl(uint32_t mask, uint32_t val) {}
>  #endif
> =20
> -void update_mcu_opt_ctrl(void);
> -void set_in_mcu_opt_ctrl(uint32_t mask, uint32_t val);
> -
>  enum ap_boot_method {
>      AP_BOOT_NORMAL,
>      AP_BOOT_SKINIT,


Cheers,
Alejandro


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 10:46:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 10:46:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774660.1185109 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scN8z-0001Od-Sd; Fri, 09 Aug 2024 10:46:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774660.1185109; Fri, 09 Aug 2024 10:46:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scN8z-0001OW-Pt; Fri, 09 Aug 2024 10:46:49 +0000
Received: by outflank-mailman (input) for mailman id 774660;
 Fri, 09 Aug 2024 10:46: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=jFZ1=PI=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1scN8z-0001Nh-4R
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 10:46:49 +0000
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com
 [2a00:1450:4864:20::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id acd81694-563c-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 12:46:47 +0200 (CEST)
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a7a9cf7d3f3so231668066b.1
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 03:46:47 -0700 (PDT)
Received: from ?IPV6:2003:e5:8741:4a00:60e5:7bee:fc48:e85c?
 (p200300e587414a0060e57beefc48e85c.dip0.t-ipconnect.de.
 [2003:e5:8741:4a00:60e5:7bee:fc48:e85c])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9c0cb9esm826885666b.78.2024.08.09.03.46.45
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 09 Aug 2024 03:46:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: acd81694-563c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723200406; x=1723805206; 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=fJs+/RT35McLGCA60w1WZuDEUgEuqSMSCbSUihWusmo=;
        b=SzP2ucDNktdq0kiderWv+nXWvb6ZEHoBhW0wWXnoZMp62S3+744+dZQJRlsvi635oh
         IHlBwluCuBk+hGp+MFyTEe1RE9a7sVMjfY3JR+9dkdALCzgXJvkhdD1xi94yOlu7w7z+
         i5nSElYePP3zwPR0Pz/rpIkYKF2nZ9gKqKKPs8aWG3PFDBS2b8zwayhUiZb3VIJfOkib
         KjaLkYXc2fJyqG8L6k6lEDUn93U8Kojztc2ZiE9leSg/gj8ynSu/vcjQlzUSLKXze3AO
         /iBS8u5MEacSeGXIBSJBNFPHoSvPSodFX7ECCtvT+bVFObKjv8OLeUgArgHKgqC8W83X
         SfAA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723200406; x=1723805206;
        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=fJs+/RT35McLGCA60w1WZuDEUgEuqSMSCbSUihWusmo=;
        b=sHXcPPUZsNXFeN/lhZlo7N61mCA42rTl2X1J/08qHyM58LfLTz3+wDa8iinijsxSIq
         50Fg42kxa6I6SkTi2WqYnkPd6NRjZdyNvw+4E3F/55asqKMjQ/nXfpHgSmG4o4dOrBVS
         Tm1naWU6eWOucSvqVc08hRRJYzUTtzFh+1c/pLWeDZ7LbhVGtAJtuBhroxbUn7RG6BlU
         KqIx2C4VSxQ9YLRZbzPYXuFvzjeSIDaO2lFR/0UoSvHr5tP1cwP1i2s2JzZOcdT18gn5
         zk/8cVZPL4dzj5FGPVJvwGHAy7mhGL6OwtyuKJUF8Gp1U/lWvTs2x+/ApgRA0BYfFuEX
         PmxQ==
X-Forwarded-Encrypted: i=1; AJvYcCVLXCVRGu+BUQl/OKt6xQFNplrU1pbd25TqDuoxjXoU3wlmRrCf4pAqINiSZSbnxCiVjXdgIxklub4C0CyEOaTCxkbsB0qTzzJewn7PfuY=
X-Gm-Message-State: AOJu0YxKJc3RkgWxFVKKt7N8pj8uaRjCEyou53hhWN5bMnUt8U6euucr
	M+2ABynwhY3CLjjdjEQgrzeRkwbh3uyV4XXqgmDXXJe/6AT++k/ElTu5ZZMiINo=
X-Google-Smtp-Source: AGHT+IHU3rQncxndKon8M2TIzQH6dJgiKVzIYK4fhBeVF/rtLt8FjgDvfOhmmFlz6r8nq1FP3RclxA==
X-Received: by 2002:a17:907:940a:b0:a7d:a0d0:f5c1 with SMTP id a640c23a62f3a-a80aa6e9af0mr78287166b.65.1723200406400;
        Fri, 09 Aug 2024 03:46:46 -0700 (PDT)
Message-ID: <34551b4d-7420-4203-bf14-564b5f3443c4@suse.com>
Date: Fri, 9 Aug 2024 12:46:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 5/5] xen: tolerate ACPI NVS memory overlapping with Xen
 allocated memory
To: Jan Beulich <jbeulich@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, linux-kernel@vger.kernel.org,
 x86@kernel.org
References: <20240807104110.18117-1-jgross@suse.com>
 <20240807104110.18117-6-jgross@suse.com>
 <90d67e10-6e35-487e-a9e7-611a0fa3b00b@suse.com>
 <64e0ac51-690d-4c44-85fb-6a0b8415fcb7@suse.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <64e0ac51-690d-4c44-85fb-6a0b8415fcb7@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 09.08.24 11:45, Jan Beulich wrote:
> On 07.08.2024 14:05, Jan Beulich wrote:
>> On 07.08.2024 12:41, Juergen Gross wrote:
>>> In order to minimize required special handling for running as Xen PV
>>> dom0, the memory layout is modified to match that of the host. This
>>> requires to have only RAM at the locations where Xen allocated memory
>>> is living. Unfortunately there seem to be some machines, where ACPI
>>> NVS is located at 64 MB, resulting in a conflict with the loaded
>>> kernel or the initial page tables built by Xen.
>>>
>>> As ACPI NVS needs to be accessed by the kernel only for saving and
>>> restoring it across suspend operations, it can be relocated in the
>>> dom0's memory map by swapping it with unused RAM (this is possible
>>> via modification of the dom0 P2M map).
>>
>> While the kernel may not (directly) need to access it for other purposes,
>> what about AML accessing it? As you can't advertise the movement to ACPI,
>> and as non-RAM mappings are carried out by drivers/acpi/osl.c:acpi_map()
>> using acpi_os_ioremap(), phys-to-machine translations won't cover for
>> that (unless I'm overlooking something, which unfortunately seems like I
>> might be).
> 
> Thinking some more about this, the above may be pointing in the wrong
> direction. If from acpi_os_ioremap() downwards no address translation
> (PFN -> MFN) occurred, then what's coming from AML would still be
> handled correctly as far as page table entries go. The problem then
> might instead be that the mapping would appear to be covering RAM, not
> the ACPI NVS region (and there may be checks for that).

All PTE entries written go through the P->M translation.


Juergen


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 12:02:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 12:02:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774681.1185118 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scOJX-0005VS-FJ; Fri, 09 Aug 2024 12:01:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774681.1185118; Fri, 09 Aug 2024 12:01:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scOJX-0005VL-C2; Fri, 09 Aug 2024 12:01:47 +0000
Received: by outflank-mailman (input) for mailman id 774681;
 Fri, 09 Aug 2024 12:01:46 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=H3Rt=PI=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1scOJW-0005R8-2K
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 12:01:46 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on20627.outbound.protection.outlook.com
 [2a01:111:f403:2418::627])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 24aa99bf-5647-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 14:01:43 +0200 (CEST)
Received: from BN0PR04CA0200.namprd04.prod.outlook.com (2603:10b6:408:e9::25)
 by LV8PR12MB9334.namprd12.prod.outlook.com (2603:10b6:408:20b::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Fri, 9 Aug
 2024 12:01:39 +0000
Received: from BL02EPF0002992C.namprd02.prod.outlook.com
 (2603:10b6:408:e9:cafe::ae) by BN0PR04CA0200.outlook.office365.com
 (2603:10b6:408:e9::25) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15 via Frontend
 Transport; Fri, 9 Aug 2024 12:01:39 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BL02EPF0002992C.mail.protection.outlook.com (10.167.249.57) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Fri, 9 Aug 2024 12:01:39 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 9 Aug
 2024 07:01:38 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Fri, 9 Aug 2024 07:01:37 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 24aa99bf-5647-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=JmwO9p2qUnOK8klfbjzof9TC3oEdpYjNnSNkKxUo8yvV7fJ79irHIDRRZw/wjpAqiDq7OShucafRrIUrQl36dZtdfm+AU0QgiUYZ5s1jGd049Z+pi4ieX5ZDWxmaQYZE8If3FuEapnUycyp7R1SLg1FnteVqsBXsWzH0rkIQNDLeqYazaqp4mkweabBPNhwVoQgFUneYOnbpLXqP0CZLBnfbxSy1WYzDSSuTAOZ62BYld25nj3/6LLM7KzO6gF7ty6GOJp0aokAgTAtkaEtJBmV3Le3ZIjiwmoF4RLl2yyJZ/k9yKJYgC93Qg38HiT/SY+7AkHCSx0YhYIHsugmYaA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=d3drCeaBQ0zyexRbZtgHyzy7lkzVED4F8scqv1cCEWs=;
 b=V/rkfjuwYMit0jkcE4+5/ZTAfQyaSQmTqCru8sc+tsn38ex4OGSaKoxNmGJzvxxKBrxFxx95XlEA5UFMhdnWZnPYPnloDYllFttfhWZxdqZ+OVlS0rUCKKL79DfZMWyte2/owpT5HmPGAZQsi1VU70XKdC5bOvrisngdNHROT333pt2/+Cj6bfclRwd9XnSA8fQvRuGJ3uZbqPTmfpjQ8VJv05kuNf+jjZSzoOUhaXOnFsunsIOKdttPpw7kb+8GLfqpFK6F4IyzgGwCzfumbdEXlqswevw5c3iCBlxFHiCZR8yl5aXMhfGPqJvLPQBxSW+aQfP5OLg7TJFPQhZMkw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=d3drCeaBQ0zyexRbZtgHyzy7lkzVED4F8scqv1cCEWs=;
 b=1yrTXos0LvrxA5WX9N0uf2MhJeaE4Q8hwcFApOdIOfZPJatRZaXMKJ4zAFQ8aoM6zBpRHL+NbYrGeESr5hPY12e9MTFm9Bkj56TocAWYjYoX88tTzOqplUKQOcM1x9EDteaePUCBGr76o2ZqWya+x+7N0vUNjm9Y8L444l7Zegs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <8d1e7fbc-1220-4e09-bd99-eb8a4a17ea06@amd.com>
Date: Fri, 9 Aug 2024 14:01:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/4] xen: arm: Add a new helper update_boot_mapping()
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, <sstabellini@kernel.org>,
	<bertrand.marquis@arm.com>, <Volodymyr_Babchuk@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
References: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
 <20240808120936.3299937-2-ayan.kumar.halder@amd.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240808120936.3299937-2-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB04.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL02EPF0002992C:EE_|LV8PR12MB9334:EE_
X-MS-Office365-Filtering-Correlation-Id: 83b033cb-3d4d-4f22-01fb-08dcb86b06cd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?eVgvRUFMekh6U0NOcWgzUUpBMGRMU3p1cUlXM2ZLU2hnL21wc1d0alpaTzA2?=
 =?utf-8?B?MTNHSStxcllYRWh1eDlhc1daU3dRU3lVRlFKSm16ODZZbkRMM083ZVJUWThv?=
 =?utf-8?B?Wmx1TEdheVIwVTFDTFpteEVBMHljRTNzWXlaeWlHWnF6cFZmSGJMZlp4SGht?=
 =?utf-8?B?eEphK0pqTDEzdWNxaGt3L3J5NHlFbnZQYlJEOHBrTm9mT0ZEMzR5TkR6OWhs?=
 =?utf-8?B?S3NmR1UyeTI1TUJzVTQyQnRIamJKeHVmQWE0N040eGwvdGpObU9hbE5nMUt0?=
 =?utf-8?B?WWV1ZllWMVN2ZE9IY29LbENUVEVMUlhRZlJzVGZiLzlweGJSZHc0c2JiK0c4?=
 =?utf-8?B?VUdsZ3Bha3NnbG5LZGZlY3pmcHhGZm5PMFNDa2NDSUNsVXBHOXhCSHkxMUY2?=
 =?utf-8?B?UE5aNXd0aHhDM0tVZ0ZyU0JuYkJjQjRJKy8zd0tVMkczOTZHTVZvREt4MmdD?=
 =?utf-8?B?Y1REeVgva3lhZ1c4c0NlVk1SYjdEUGZYeHlIVWlHemhTd20xVTlyL1EyMDVH?=
 =?utf-8?B?M0xrbEdaSlpYK1lHYXc3R0hCTFpYY0lYVzFoUDN5N3hQTTZZTXBwWFFVWDY1?=
 =?utf-8?B?VEFKeXY3SHFiNXBmTk5iYlhYeERkWlV0Z043OTI4M3NqTEYwSHVBUExsMExt?=
 =?utf-8?B?dTdBNWZBaThCTVRQU0hmZXZHWG5qdlZ1RE9LTFp2SW9tWU5VQmxuRGxMbjFn?=
 =?utf-8?B?akF5UEdNQkNVVmZGTzlOWXdsWlpKdkQyL3E2b1BDdEFsRXFPSkVwN3padW1U?=
 =?utf-8?B?OTM0Q0dhSUl5UTRJaVk0eEsyQkxkSFo3N09vMXlxalNNaGJieTgvRGs0dGxS?=
 =?utf-8?B?RW1zV2YwODI3RW9NR1hjZkpENmNyVzRWZE94UGRsMThwRm8xcTUwTldwb2p0?=
 =?utf-8?B?UUFHTUJKcFZUMmtRZ2ZDbUpZZ3lvdUl5ZlRTM094dmlUcmtDZ2l0NmNQMndO?=
 =?utf-8?B?L3hmblc2dGp2RENtUDZjUjZ4WnJlRHc1MmYxdkY5NFE3dFJmamxUSlVwZEM2?=
 =?utf-8?B?MnpEa1dGZ3Q1QXpSVHlzYmtwNnkxQURRUjlJbEkreGFRMTRBSWR1eVB5VFl4?=
 =?utf-8?B?dm5RZE5EcnV3VEJKc0c0Y1pVYzQwSElZdkQ5NHlORHJEVnhkOG1LdmJyTUFj?=
 =?utf-8?B?L1B2a1VBdE9tSDJSR0JrOE9UZVVDVCtKbldkMkJpMHlIMGxKZ3o2NGJTaHJs?=
 =?utf-8?B?d0ZoSnBBbmJIaGhRaEYwYzdTUVo1UDFxaEd3OWFpaXlLb0I4c3FzYndoK3dl?=
 =?utf-8?B?ZEVXMml2WmYxb0Y5RWVFczdUUzNydnhnNUVQOXZYWG8rWEYyUGprcTNyWVN6?=
 =?utf-8?B?M040aHVzTnd0MGZIMUxhRU44aEhxSTVxK3ZjQTB4clFVa3dobitNUFJ5TVNV?=
 =?utf-8?B?c005MUUzc3dDVHEwcWdMdGRxWm92bXhTNXBxVCtVZ0xJalV0TXVhbEJ0amIy?=
 =?utf-8?B?THcrMTR4b2RnKytjVnEwYUlNVmgwOVpjcFlZK2hMZlRJcitXbmhQNFJzTGNK?=
 =?utf-8?B?eWdnbEM5c2tPTnQ1L1dEeERXVFg3R2lBNnZFSlZTczdVRC9EeVJZd0xzdmFW?=
 =?utf-8?B?UmlLRll5UFZGQW84cVVyWk82bjVnUXRwUWxFdXVVR3pqVml3RjVyZnVTQkFz?=
 =?utf-8?B?MVl6a1BGMHBCaitWekVmUzZtVEVWY3IzdTYvTWNLbzc5YkJJSWpiSmVzTWhX?=
 =?utf-8?B?SXR1S2wweWN4UUF6WnVNcEptaG9qSWVpZ00zcC9EQWp5cWYremVvWkhkVXYz?=
 =?utf-8?B?UzZZb0hNOFhsUlRicDhpQWd6ZmN2cnJaa3E1eU82MVI0aSszS2JFWEtUMEkw?=
 =?utf-8?B?andsUXpxOVM5dXN1NWVZVWkrZVlpQWIwNE9JUlNuVUZVZmN0ZE41dUVkL29v?=
 =?utf-8?B?aWxlcCt1MGRjekFGZUZKcjVCd0MzOFhTdndDcU4rU09weWlWRHZENFdTM0xs?=
 =?utf-8?Q?SOD2F0AHS907BtGjBGaHV48C+nRQpBTR?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 12:01:39.4252
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 83b033cb-3d4d-4f22-01fb-08dcb86b06cd
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL02EPF0002992C.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9334

Hi Ayan,

On 08/08/2024 14:09, Ayan Kumar Halder wrote:
> update_boot_mapping() invokes update_identity_mapping() for the MMU specific
> code.
> Later when the MPU code is added, update_boot_mapping() would invoke the
> equivalent.
> 
> The common code now invokes update_boot_mapping() instead of
> update_identity_mapping(). So, that there is clear abstraction between the
> common and MMU/MPU specific logic.
> 
> This is in continuation to commit
> f661a20aa880: "Extract MMU-specific MM code".
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
> Changes from :-
> 
> v1 - 1. Introduced update_boot_mapping() which invokes
> update_identity_mapping() in MMU specific code.
> 
>  xen/arch/arm/arm64/mmu/mm.c   | 5 +++++
>  xen/arch/arm/arm64/smpboot.c  | 6 +++---
>  xen/arch/arm/include/asm/mm.h | 2 ++
>  3 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/arm/arm64/mmu/mm.c b/xen/arch/arm/arm64/mmu/mm.c
> index 293acb67e0..72e089a339 100644
> --- a/xen/arch/arm/arm64/mmu/mm.c
> +++ b/xen/arch/arm/arm64/mmu/mm.c
> @@ -125,6 +125,11 @@ void update_identity_mapping(bool enable)
>      BUG_ON(rc);
>  }
>  
> +void update_boot_mapping(bool enable)
> +{
> +    update_identity_mapping(enable);
With your approach, update_identity_mapping() would only be called from within this file,
therefore it should be marked as static and the prototype removed.

> +}
> +
>  extern void switch_ttbr_id(uint64_t ttbr);
>  
>  typedef void (switch_ttbr_fn)(uint64_t ttbr);
> diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
> index a225fae64d..789f352ab6 100644
> --- a/xen/arch/arm/arm64/smpboot.c
> +++ b/xen/arch/arm/arm64/smpboot.c
> @@ -112,18 +112,18 @@ int arch_cpu_up(int cpu)
>      if ( !smp_enable_ops[cpu].prepare_cpu )
>          return -ENODEV;
>  
> -    update_identity_mapping(true);
> +    update_boot_mapping(true);
>  
>      rc = smp_enable_ops[cpu].prepare_cpu(cpu);
>      if ( rc )
> -        update_identity_mapping(false);
> +        update_boot_mapping(false);
>  
>      return rc;
>  }
>  
>  void arch_cpu_up_finish(void)
>  {
> -    update_identity_mapping(false);
> +    update_boot_mapping(false);
>  }
>  
>  /*
> diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
> index f6ba611f01..e769d2d3b3 100644
> --- a/xen/arch/arm/include/asm/mm.h
> +++ b/xen/arch/arm/include/asm/mm.h
> @@ -426,6 +426,8 @@ static inline void page_set_xenheap_gfn(struct page_info *p, gfn_t gfn)
>      } while ( (y = cmpxchg(&p->u.inuse.type_info, x, nx)) != x );
>  }
>  
> +void update_boot_mapping(bool enable);
The definition is only present for arm64. Shouldn't the prototype be moved to arm64 header?

~Michal


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 12:15:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 12:15:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774702.1185129 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scOX8-0007eb-Iy; Fri, 09 Aug 2024 12:15:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774702.1185129; Fri, 09 Aug 2024 12:15:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scOX8-0007eU-GM; Fri, 09 Aug 2024 12:15:50 +0000
Received: by outflank-mailman (input) for mailman id 774702;
 Fri, 09 Aug 2024 12:15:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=H3Rt=PI=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1scOX7-0007eO-Mc
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 12:15:49 +0000
Received: from NAM02-DM3-obe.outbound.protection.outlook.com
 (mail-dm3nam02on20600.outbound.protection.outlook.com
 [2a01:111:f403:2405::600])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1ba7badd-5649-11ef-bc04-fd08da9f4363;
 Fri, 09 Aug 2024 14:15:48 +0200 (CEST)
Received: from SJ0PR03CA0170.namprd03.prod.outlook.com (2603:10b6:a03:338::25)
 by MW6PR12MB8865.namprd12.prod.outlook.com (2603:10b6:303:23b::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.26; Fri, 9 Aug
 2024 12:15:43 +0000
Received: from CO1PEPF000044EF.namprd05.prod.outlook.com
 (2603:10b6:a03:338:cafe::e8) by SJ0PR03CA0170.outlook.office365.com
 (2603:10b6:a03:338::25) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.30 via Frontend
 Transport; Fri, 9 Aug 2024 12:15:43 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1PEPF000044EF.mail.protection.outlook.com (10.167.241.69) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Fri, 9 Aug 2024 12:15:42 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 9 Aug
 2024 07:15:40 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Fri, 9 Aug 2024 07:15:39 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1ba7badd-5649-11ef-bc04-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=mM77nuaZTZ6wurRMc2LakgTL8EZI1yuTsKKVz/5LTY5id69QlMrJroIQUL/pOYWc3jjJYUQvOGN89tm8VlbYS9dcLsLu4McBfCgCSugB+f93Vv+Y5aj+drJ0SDHgC9QtVUVsIyKrNySa0sdyDXfktSwSVOUd+rjpYbexGnBpGbD1MI/uLZO658JJYWk4SGV/SBJcilSkCK/blrHCvmqh63Rr4bBdLLl9/WAWd2GB+ri1+f4o2ODrOPXW5pJFO+E+qIRU+LBupUHxF3n6ulPWWEeByJtuUVTh7Z4e9o/58UNKI/GLxIXnsdr5L3v0bPhW0knNFyhyG964cbWevPQypQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=HMnzhUbJraVztlOJr23Y1yGnGFvQt5n8gb0g57KqkrI=;
 b=Jzjzl2ulJNpVn2I9U29d+fuTJ3JYyvkkBd1cXpGrVs1TuSu/g2TiBMg4UcuXMKhMaQc5jaHGlEfIF3FuKlo5DGqVB4zbSylApWtI7jpDgiWbcxPR7uNa+yz4aWPGfPDthxfnuq0c6iImly+NyLHLa7J7CseT9MWo8n+0dzj5g0P+4o1xKcQoa4j9lCE2iLa2BmJw9t7qjqRCNOXO1qCF+rc3cOsQ3S0wFxXNQEAv0AjlgzMWymD6OkmYKWnmL7UMQ95YNEKj8ib/f52CRyOLla8htCpyVvnKjmjbnYV7FTUTPrLVTqiXXH41l+EssshARsvbVf2uEaqZDUDtDYhQbg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=HMnzhUbJraVztlOJr23Y1yGnGFvQt5n8gb0g57KqkrI=;
 b=10jKgakr38U79ZrdiMGMiASRun7b7Btx1sCXmcG9zwooZ0UM/B4ooRScsvXgazfscxToHGo2pJXzyo674T/B+oa/qUPyXLUcbvcDlmhOtvrxJ0y+ur4xE1Off+AZ0ByyPwkKk3mkrzmm7cdmG7Z5cb9sH2NGfQ73AclwxRSuuug=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <07e9a5bc-6e51-4073-b7a6-eb7bb7635891@amd.com>
Date: Fri, 9 Aug 2024 14:15:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 4/4] xen: arm: Enclose access to EL2 MMU specific
 registers under CONFIG_MMU
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, <sstabellini@kernel.org>,
	<bertrand.marquis@arm.com>, <Volodymyr_Babchuk@epam.com>, <julien@xen.org>
CC: <xen-devel@lists.xenproject.org>
References: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
 <20240808120936.3299937-5-ayan.kumar.halder@amd.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240808120936.3299937-5-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB03.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000044EF:EE_|MW6PR12MB8865:EE_
X-MS-Office365-Filtering-Correlation-Id: 16428139-0e67-4e60-dc01-08dcb86cfd9c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?bzRCMTZOTkhGRHJaUTdyRkllSFkyMUhBd1Q4cXN4Y0s0OTg3VTFPdnpIbm91?=
 =?utf-8?B?YXdKb09MVTFPaFZlM0lEOUdENTJ1dWdaRXpySXVZaG1tdGpvNURLbWpmKzhO?=
 =?utf-8?B?WHVnU3BLRFU0Sm80TnNqTkJyTHlnUkhSUXp1QWtSNWdoU2pkL3NPQ1FoVlNK?=
 =?utf-8?B?aHlXSWFnUTVFTWpTTGFFZ0Z5Y0hQNXFlMWxFSVFIV2RVQlZjN25BOE9hREJO?=
 =?utf-8?B?MksxVVB0Z1AzeXJyK1FJQ1UyOU9JT3JobHE5eFdxdTd3Qlg1OGpmRlZvbzBw?=
 =?utf-8?B?c21mNnZ6c1p3U2tZeHFESkNwK2JyTUVXb0EvYlNZRjJlUm15OFM5NlRuNnEx?=
 =?utf-8?B?M2RJSVdMR3NBNUc4eHRFVi9pUjZjS1ZrdXR0VDJLMGwyNHNETTdDQzh6MzBU?=
 =?utf-8?B?VVhTdGV5ajJudHRHL2YzbkdCTnFuZnJCVDZPQ1ZuWVREU2JoeXdBY3N3Q0sy?=
 =?utf-8?B?Mk8zZDhKaTJFL01rbEhSZFE0VUpsZVJqYUJPOWEreTRHNnl1S1BlbnJpdXB4?=
 =?utf-8?B?YlNodGNrMkh2dXdwWW0zY2ZDY0pvWldEbXFJM1lkSzNvUks3VWRyQ3NDak1j?=
 =?utf-8?B?L21PbWJnbUdDa2FYQld0aTdJcnMyekwwVTUzMzczRDNseFFVVHZrSVlFZEdm?=
 =?utf-8?B?OUwvSEVHZmNsSWtwWnJZMWpXZmZ5elpsTFlwdHJNMHBWakk4blpCeHltSDcx?=
 =?utf-8?B?bGlPcFhJRWVwaVFFNUFxZXhsdHNYUmwxUGN0OFpybjVMdlk0RUd0QWx0TFND?=
 =?utf-8?B?R0M1TGRYZGZRT01KS21HOC80YThYWWNiZys0WHl2dXJ6VTgxVmlscWFpcTZS?=
 =?utf-8?B?c1MrbW9LbHF4cWU3Y0dWbld0SEFUN2p5TXBQSlZCY0Q3dXZNSElMZ3YxOThu?=
 =?utf-8?B?K2pTWkVwOVRRMWJUZ25iVXB2ZGRjeCs0UDRPcUJSNkhEa2MvZW1sK2JzRVlx?=
 =?utf-8?B?T2wrM2RZQUZNYTEyM0xCUzFFbEU5MXY0dWZQcHYzR0QxVW8rcVFkRzNDWUhD?=
 =?utf-8?B?amE1Qksvc09FOWxzS0tYZDVjSElRNU85ZDZsNHpMWG1yeCtuaThVSDJuTVNN?=
 =?utf-8?B?QnhBckkvZGptL0h3RE5oNlFVZHM2YmFxSWNZV25QeWllR0FWb29XTE1IUnla?=
 =?utf-8?B?QTVJbm5QWUkrWWl5N0tMSzVmbkdLRU96ZW5hN1lQZkR6R2psVG9iL3dRUnZK?=
 =?utf-8?B?UEt6Yy9NMlNsankvYU1hNVk0M01zbHIySTJGUitGUEpobDdVUjdReVZDaEps?=
 =?utf-8?B?eVVIdlJkTXgvU01EV3E1ZVdhVzR6dXhtWm1zU0I3OVNFRFdxcW96NGJjMVVw?=
 =?utf-8?B?aStCelZHMUEyMi9FY2Z6dVJKNkJDS2VGaUMrejF0dmZ1RnhhMlY0L3VwV2J6?=
 =?utf-8?B?WEZvNHdja0RyMi81UDM0L3ZDZkVWVDU5NWd6VWdtM0NQNy9FME5NVHQ3Rjdq?=
 =?utf-8?B?UnBmT1BBNW1RMUpkVjQ4eWNQd09nZGcrZnBjSitiYlByalNQQnZLWTMyZWRa?=
 =?utf-8?B?YlpWd3E1akN3RFd5UWJYSnNjMFZsSVE0Kythdnp4eUhnL2hONGNxZW1XcGtO?=
 =?utf-8?B?Wm45RGF6bU04dGFwbTdhUkViMVhyRllYby9VT21JaE96TWQrZDdteUdQOEIr?=
 =?utf-8?B?VlFrdDBjOTNWbnViMnVwdWxwYzRobXZnOC85dTJXSmhGZTlmd2lkMG80MGg1?=
 =?utf-8?B?b09nNmp6eHprdDdmUHpvK3NlNW5obEhqakNvWFJMZXB2em1sTUYrYkRqamp2?=
 =?utf-8?B?K2JrdWkzN1VKUHE5R3BxYjFrVExETVdsUnV5eXpWa0VLdVRBSjlpM25DWVhP?=
 =?utf-8?B?VGRjeGF4RFFIdlZ4aUlhSU9VNTh0bTFKZUJLOER2czZGYzlXNWhXeFhrZ2pn?=
 =?utf-8?B?cnY0ZHJaVk5ubU16N3ZwNjdzSkJYWkkvdWJzSzZnL2FZVDZtR0k2Uzd5dVd5?=
 =?utf-8?Q?JUEzba3n3jyuAdtxeGcSjzcbithw7SNr?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 12:15:42.8787
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 16428139-0e67-4e60-dc01-08dcb86cfd9c
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000044EF.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8865

Hi Ayan,

On 08/08/2024 14:09, Ayan Kumar Halder wrote:
> All the EL2 MMU specific registers are enclosed within CONFIG_MMU.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
> Changes from v1 :-
> 1. 'vttbr_el2' field is enclosed with ifdef.
> 2. No movement of code.
> 
>  xen/arch/arm/traps.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
> index aac6c599f8..f51e1424cb 100644
> --- a/xen/arch/arm/traps.c
> +++ b/xen/arch/arm/traps.c
> @@ -720,8 +720,10 @@ struct reg_ctxt {
>      uint32_t ifsr32_el2;
>  #endif
>  
> +#ifdef CONFIG_MMU
>      /* Hypervisor-side state */
>      uint64_t vttbr_el2;
Given that you protected the field here, why did you leave assignments in show_registers()
and vcpu_show_registers() unguarded?

~Michal


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 12:19:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 12:19:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774711.1185139 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scOay-0000LI-1l; Fri, 09 Aug 2024 12:19:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774711.1185139; Fri, 09 Aug 2024 12:19:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scOax-0000LB-Us; Fri, 09 Aug 2024 12:19:47 +0000
Received: by outflank-mailman (input) for mailman id 774711;
 Fri, 09 Aug 2024 12:19:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scOax-0000L1-7w; Fri, 09 Aug 2024 12:19:47 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scOax-0004t0-0M; Fri, 09 Aug 2024 12:19:47 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scOaw-0003PV-Id; Fri, 09 Aug 2024 12:19:46 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1scOaw-0003r7-Hn; Fri, 09 Aug 2024 12:19:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ZhX0YHIfAiX1wYhr6YZ5tSwtLQIlBaYJp/OuYzlJ7iM=; b=VSByKb/2KsUtLRTv6ix+KPll+I
	cf8hNHXGeucRmL/SviGpPO+pGHlP/gNbbmAeuL9MWMkYSn5l8QQBqAvPycqodzAAyQ7fu1fLI8v0H
	UzVAeABlTuKFP3fNc5+DuCWMgn/2GEjrHXuLAcPfF33WM3vSEOdos6upbIf/JMC5UIqo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187195-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187195: trouble: broken/fail/pass
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-libvirt-vhd:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-libvirt-vhd:capture-logs(23):broken:regression
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=08aacc392d86d4c7dbebdb5e664060ae2af72057
X-Osstest-Versions-That:
    xen=6b9b96ddebf269579730ff2a65f324505bc2aba9
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 09 Aug 2024 12:19:46 +0000

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

Failures and problems with tests :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-libvirt-vhd    <job status>                 broken
 test-amd64-amd64-libvirt-vhd 23 capture-logs(23)       broken REGR. vs. 187186

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

version targeted for testing:
 xen                  08aacc392d86d4c7dbebdb5e664060ae2af72057
baseline version:
 xen                  6b9b96ddebf269579730ff2a65f324505bc2aba9

Last test of basis   187186  2024-08-08 01:53:56 Z    1 days
Testing same since   187195  2024-08-08 15:11:26 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Matthew Barnes <matthew.barnes@cloud.com>

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


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

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

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

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

broken-job test-amd64-amd64-libvirt-vhd broken
broken-step test-amd64-amd64-libvirt-vhd capture-logs(23)

Not pushing.

------------------------------------------------------------
commit 08aacc392d86d4c7dbebdb5e664060ae2af72057
Author: Matthew Barnes <matthew.barnes@cloud.com>
Date:   Thu Aug 8 13:27:50 2024 +0200

    x86/emul: Fix misaligned IO breakpoint behaviour in PV guests
    
    When hardware breakpoints are configured on misaligned IO ports, the
    hardware will mask the addresses based on the breakpoint width during
    comparison.
    
    For PV guests, misaligned IO breakpoints do not behave the same way, and
    therefore yield different results.
    
    This patch tweaks the emulation of IO breakpoints for PV guests such
    that they reproduce the same behaviour as hardware.
    
    Fixes: bec9e3205018 ("x86: emulate I/O port access breakpoints")
    Signed-off-by: Matthew Barnes <matthew.barnes@cloud.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>

commit ef31716a57e6c29ba14b4f009e9a67277c8117a8
Author: Jan Beulich <jbeulich@suse.com>
Date:   Thu Aug 8 13:27:25 2024 +0200

    x86emul: adjust 2nd param of idiv_dbl()
    
    -LONG_MIN cannot be represented in a long and hence is UB, for being one
    larger than LONG_MAX.
    
    The caller passing an unsigned long and the 1st param also being (array
    of) unsigned long, change the 2nd param accordingly while adding the
    sole necessary cast. This was the original form of the function anyway.
    
    Fixes: 5644ce014223 ("x86emul: relax asm() constraints")
    Oss-fuzz: 70923
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

commit c24615500062eb63f1cfd208c234df5268a880e0
Author: Jan Beulich <jbeulich@suse.com>
Date:   Thu Aug 8 13:26:38 2024 +0200

    x86emul: avoid UB shift in AVX512 VPMOV* handling
    
    For widening and narrowing moves, operand (vector) size is calculated
    from a table. This calculation, for the AVX512 cases, lives ahead of
    validation of EVEX.L'L (which cannot be 3 without raising #UD). Account
    for the later checking by adjusting the constants in the expression such
    that even EVEX.L'L == 3 will yield a non-UB shift (read: shift count
    reliably >= 0).
    
    Fixes: 3988beb08 ("x86emul: support AVX512{F,BW} zero- and sign-extending moves")
    Oss-fuzz: 70914
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 12:48:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 12:48:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774724.1185149 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scP2h-0005Xb-Ay; Fri, 09 Aug 2024 12:48:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774724.1185149; Fri, 09 Aug 2024 12:48:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scP2h-0005XU-79; Fri, 09 Aug 2024 12:48:27 +0000
Received: by outflank-mailman (input) for mailman id 774724;
 Fri, 09 Aug 2024 12:48:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mmNo=PI=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1scP2f-0005X0-Es
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 12:48:25 +0000
Received: from mail-oo1-xc2c.google.com (mail-oo1-xc2c.google.com
 [2607:f8b0:4864:20::c2c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a9454a73-564d-11ef-bc04-fd08da9f4363;
 Fri, 09 Aug 2024 14:48:23 +0200 (CEST)
Received: by mail-oo1-xc2c.google.com with SMTP id
 006d021491bc7-5d5b22f97b7so1559933eaf.2
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 05:48:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a9454a73-564d-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723207702; x=1723812502; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=HJAM21U9aeooXeP9n4hIK7lw9tJ9eYyOJoJlxBE5nUQ=;
        b=chCtywPE7jehzulhLOiI+xV7KiyES6FJt1sr7KSY83f76SsGehugYGTCyMNo9EhAFK
         ErCFTeAD9CwffcCkwHnTROL4PjYy5AGoStB4OsZ4AAAuuvKypc1Bl7x10Mt/eOTGsNQM
         C/DKVIFER/OaFtMR77tzQ7sFoHxXIycR8+EDs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723207702; x=1723812502;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=HJAM21U9aeooXeP9n4hIK7lw9tJ9eYyOJoJlxBE5nUQ=;
        b=enhqnfGa/jCwyfokgnh6wntHUKS2uj4Rn0khurVqrvQvFVEGPKkhUWQNrx018AJ2gQ
         HD8tojxBSRHe2WUH34XJvcNnFq2I03K3dfSCqXjfTdzTsmy091OCiCnJhLjsrf24zvs8
         ApuOH1ASKvjhfZXtBQRneMblD+zXz+4sa28RH4n1riA/hPdPuEX6OqhwLMWbOXMrcXpb
         sWKgn+yruLlzzn9zWtTmqnvjf9821Hw/Aop3ZZma6f4XqaZN2fcDCB2xAfHBdxy7Hi15
         pfiGQDnIjr+XOfN/VDjSxw969kVxE7J2oZ4uznb5QJF9kl26VWe8XRSU+iMmzTbUa0yV
         dlNA==
X-Forwarded-Encrypted: i=1; AJvYcCX8jxOG4qrh4yBcxBnn1/ySrZ3i6PLGbZFL7of6j8RC03Tf+37GXfwW5GmuNzPGBXUCJaCIdMrMPHu9kbBQzlNnyFu5waFHFJzx6YI/f6U=
X-Gm-Message-State: AOJu0YzzswCwhZBdw5oK3dIQNELb7AWygOF7tIgj0icc9zbvsdkhcqKR
	6zCvhG8u6cp9KtF2c69+zSw5Izh4rwGtbmv7IEfuUUtr5dveIDTPCSi3f0C85SzwhfP5Qpi+L72
	fi0XFPgknzjYT6xOkTAt2Q8E7p25GyMHvDiH2wA==
X-Google-Smtp-Source: AGHT+IFAWHTFKj3lIq0XEiDKZsQTtdx8O4ysicspyztSZ1JRwXR4cLWiw26WemI11KKq9t5cSxeyMcdBfoWj4QfYse0=
X-Received: by 2002:a05:6820:162a:b0:5d5:bd48:8ed8 with SMTP id
 006d021491bc7-5d870b39c76mr1719917eaf.5.1723207701742; Fri, 09 Aug 2024
 05:48:21 -0700 (PDT)
MIME-Version: 1.0
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-4-alejandro.vallejo@cloud.com> <cf819b39-6ce8-4446-b7b6-a1b247f45400@suse.com>
In-Reply-To: <cf819b39-6ce8-4446-b7b6-a1b247f45400@suse.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Fri, 9 Aug 2024 13:48:11 +0100
Message-ID: <CACHz=ZgwPunPO771EbX1hKEdmXC1ysBQ7RzYK8K1pakyBS927A@mail.gmail.com>
Subject: Re: [PATCH 3/5] x86: Set xen_phys_start and trampoline_xen_phys_start earlier
To: Jan Beulich <jbeulich@suse.com>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Xen-devel <xen-devel@lists.xenproject.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Aug 8, 2024 at 9:25=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wrot=
e:
>
> On 07.08.2024 15:48, Alejandro Vallejo wrote:
> > No reason to wait, if Xen image is loaded by EFI (not multiboot
> > EFI path) these are set in efi_arch_load_addr_check, but
> > not in the multiboot EFI code path.
> > This change makes the 2 code paths more similar and allows
> > the usage of these variables if needed.
>
> I'm afraid I'm struggling with any "similarity" argument here. Imo it
> would be better what, if anything, needs (is going to need) either or
> both of these set earlier. Which isn't to say it's wrong to do early
> what can be done early, just that ...
>

About similarity is that some part of EFI code expect xen_phys_start
to be initialized so this change make sure that if in the future these
paths are called even for this case they won't break.

> > --- a/xen/arch/x86/boot/head.S
> > +++ b/xen/arch/x86/boot/head.S
> > @@ -259,6 +259,11 @@ __efi64_mb2_start:
> >          jmp     x86_32_switch
> >
> >  .Lefi_multiboot2_proto:
> > +        /* Save Xen image load base address for later use. */
> > +        lea     __image_base__(%rip),%rsi
> > +        movq    %rsi, xen_phys_start(%rip)
> > +        movl    %esi, trampoline_xen_phys_start(%rip)
>
> ... this path is EFI only if I'm not mistaken, while ...
>
> > @@ -605,10 +610,6 @@ trampoline_setup:
> >           * Called on legacy BIOS and EFI platforms.
> >           */
> >
> > -        /* Save Xen image load base address for later use. */
> > -        mov     %esi, sym_esi(xen_phys_start)
> > -        mov     %esi, sym_esi(trampoline_xen_phys_start)
>
> ... the comment in context is pretty clear about this code also being
> used in the non-EFI case. It is, however, the case that %esi is 0 in
> that case. Yet surely you want to mention this in the description, to
> clarify the correctness of the change.

Restored this code.

>
> Also in the code you move please consistently omit insn suffixes when
> they're not needed. Just like it was in the original code, and just
> like you already omit the q from "lea".
>

Done

> Finally, if you used a register other than %rsi (say %r14) you could
> replace the "lea" after x86_32_switch by a 2nd "mov", similar to the
> one that's already there to load %edi. (You'd need to move the new
> code up by yet a few more lines, to cover the jump to x86_32_switch
> there, too.)
>

IMHO it makes code less readable, it's hard to understand which
registers are in use or not, I prefer to compute one more time
instead, this code is not in an hard path and it's going to be
discarded after initialization.

> Jan

Frediano


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 13:00:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 13:00:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774734.1185158 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scPDs-0007c4-9h; Fri, 09 Aug 2024 13:00:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774734.1185158; Fri, 09 Aug 2024 13:00:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scPDs-0007bx-6w; Fri, 09 Aug 2024 13:00:00 +0000
Received: by outflank-mailman (input) for mailman id 774734;
 Fri, 09 Aug 2024 12:59:58 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=TQMG=PI=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1scPDq-0007br-Nd
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 12:59:58 +0000
Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com
 [2a00:1450:4864:20::22f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4713ffd4-564f-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 14:59:56 +0200 (CEST)
Received: by mail-lj1-x22f.google.com with SMTP id
 38308e7fff4ca-2f1a7faa4d5so5480941fa.3
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 05:59:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bbb2c2019bsm1492797a12.31.2024.08.09.05.59.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 09 Aug 2024 05:59:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4713ffd4-564f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723208396; x=1723813196; 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=8dXFKAXsET8zCDF26ypU+CnJma96sPkAGZ7tjqlOgXI=;
        b=F9HpAYc2cj5ww/zM1bKvWiBqAwX/sgzFw23O8g52amOFMvY3DXLX8SgfdG7G99BJHl
         zTSefXQKz4X44/N18lBq9DQvEeVVHZgY2pofxycO9jtTtpCyyf1rvbvkRmHI9mBdJgVV
         TKR1xg19nTEU/iu7DaMHdWSffgYqGzcEmfuQl82nHzUCU5LcrLO1s9l3VGeDKgaB5yCu
         hFXqbhR9M4KPNLKT8FO2AR0DHxV4/yQyQgvVJN/JhwOFgsufe3L4bIcF07553wUX1atp
         3qVgV0huqxA2G39sdvY3NG53j/eu4R1aBj6wWNJl09WaqeBYeCFUgFE5U8MTUv0hPP5X
         Qqmw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723208396; x=1723813196;
        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=8dXFKAXsET8zCDF26ypU+CnJma96sPkAGZ7tjqlOgXI=;
        b=ZuKm0IWA3hudNLwJjoe+mWj0WtGoNydfgtyDjkYhPfpXWqQS/+MgNdYbXnt8lPWGeV
         KH5Qyo9hBz90En4349hXtlij/TykFbo6gK9PcZYuF1L+To4mB0HFZ4ufmrLDTH3s+P0t
         4FKjukdAio1HlrJqiH+tTORH6E7sSxWcQUzCCBDSxg8ZB87OVMGOTT6lMfZBEDoKqYl8
         mKCLbxL6ZntS/vjv5Md4j8eBzp5CjjmICm/AcCE8rbjY6Zsf60te5kiHEKVzm6QJdz+B
         62FaPzg63OQiEAODl4+K7XpvV3uQm2SFzVkaHcWySB42fgfgW8bgTFhIy06sXEmyGXVy
         IGcA==
X-Forwarded-Encrypted: i=1; AJvYcCX2/bg2OkPySkqm6z2PHNd/v1f8x4J4IFXhHi5eAdyx1rJ2puAvo1todXYZ8plvSngFzvHmjWlg6l0=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx/gLUy6CAv/YEsYpmn1KzjeNd04lEQLOEEB5rXZ7lKiPBF6suo
	gah8gB6WXwAfwpvfCmT+rhcMHNo0XAKJvHOq3c1wwQngg05RZArC1aFEiRIyIz6u4eCIaQAjvn4
	=
X-Google-Smtp-Source: AGHT+IEA3f9u2beWXtQ5kMr4Pa5g1fOm3HzWMz8B5qk96RPgetzCMSr1+a9xQQVvjxcRzt947qCuMA==
X-Received: by 2002:a2e:4c02:0:b0:2ef:206c:37c4 with SMTP id 38308e7fff4ca-2f1a6ce6eacmr11312441fa.33.1723208395913;
        Fri, 09 Aug 2024 05:59:55 -0700 (PDT)
Message-ID: <7f0a7c9e-0cac-48ae-b7aa-5c90a1a5f4ca@suse.com>
Date: Fri, 9 Aug 2024 14:59:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/5] x86: Set xen_phys_start and trampoline_xen_phys_start
 earlier
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-4-alejandro.vallejo@cloud.com>
 <cf819b39-6ce8-4446-b7b6-a1b247f45400@suse.com>
 <CACHz=ZgwPunPO771EbX1hKEdmXC1ysBQ7RzYK8K1pakyBS927A@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: <CACHz=ZgwPunPO771EbX1hKEdmXC1ysBQ7RzYK8K1pakyBS927A@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 09.08.2024 14:48, Frediano Ziglio wrote:
> On Thu, Aug 8, 2024 at 9:25 AM Jan Beulich <jbeulich@suse.com> wrote:
>> On 07.08.2024 15:48, Alejandro Vallejo wrote:
>>> No reason to wait, if Xen image is loaded by EFI (not multiboot
>>> EFI path) these are set in efi_arch_load_addr_check, but
>>> not in the multiboot EFI code path.
>>> This change makes the 2 code paths more similar and allows
>>> the usage of these variables if needed.
>>
>> I'm afraid I'm struggling with any "similarity" argument here. Imo it
>> would be better what, if anything, needs (is going to need) either or
>> both of these set earlier. Which isn't to say it's wrong to do early
>> what can be done early, just that ...
>>
> 
> About similarity is that some part of EFI code expect xen_phys_start
> to be initialized so this change make sure that if in the future these
> paths are called even for this case they won't break.
> 
>>> --- a/xen/arch/x86/boot/head.S
>>> +++ b/xen/arch/x86/boot/head.S
>>> @@ -259,6 +259,11 @@ __efi64_mb2_start:
>>>          jmp     x86_32_switch
>>>
>>>  .Lefi_multiboot2_proto:
>>> +        /* Save Xen image load base address for later use. */
>>> +        lea     __image_base__(%rip),%rsi
>>> +        movq    %rsi, xen_phys_start(%rip)
>>> +        movl    %esi, trampoline_xen_phys_start(%rip)
>>
>> ... this path is EFI only if I'm not mistaken, while ...
>>
>>> @@ -605,10 +610,6 @@ trampoline_setup:
>>>           * Called on legacy BIOS and EFI platforms.
>>>           */
>>>
>>> -        /* Save Xen image load base address for later use. */
>>> -        mov     %esi, sym_esi(xen_phys_start)
>>> -        mov     %esi, sym_esi(trampoline_xen_phys_start)
>>
>> ... the comment in context is pretty clear about this code also being
>> used in the non-EFI case. It is, however, the case that %esi is 0 in
>> that case. Yet surely you want to mention this in the description, to
>> clarify the correctness of the change.
> 
> Restored this code.

Was my analysis wrong then and it's actually needed for some specific
case?

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 13:04:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 13:04:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774744.1185169 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scPIB-0000gR-QG; Fri, 09 Aug 2024 13:04:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774744.1185169; Fri, 09 Aug 2024 13:04:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scPIB-0000gK-Nc; Fri, 09 Aug 2024 13:04:27 +0000
Received: by outflank-mailman (input) for mailman id 774744;
 Fri, 09 Aug 2024 13:04:25 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dBfy=PI=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1scPI9-0000fj-Hs
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 13:04:25 +0000
Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com
 [2a00:1450:4864:20::62c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e644dc82-564f-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 15:04:23 +0200 (CEST)
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-a7a94478a4eso506971566b.1
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 06:04:23 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9d437a5sm835020266b.101.2024.08.09.06.04.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 09 Aug 2024 06:04:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e644dc82-564f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723208663; x=1723813463; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=IqFJjaRsLh2UOFChJjBNPbupmjhv4JBVg7GbkBcuHVg=;
        b=RPAiPK5yRVeS8Yvn++GWkh7szcfN16PDKTPj7/srXK82tEqbH+ViVDhEI/w5OxfBtX
         WSTRbPjkebkNXuaqX5JmVwySWKWKeUtUKJgcfFhgd2eEb2eTOIX/oqv0zpYsYGm1RDG2
         qymG9QSFnDmPqUxXw+AtdnL96SFtSfGzC+i0o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723208663; x=1723813463;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=IqFJjaRsLh2UOFChJjBNPbupmjhv4JBVg7GbkBcuHVg=;
        b=NUsXZyTL8VU5iyIjP33QCKwL2KyXz8S0kuzFj8tCsZ7FTJ2Zg2FnXGQUiFctVbGMb8
         oG0bjSd8+OEFmxgNK74fWqgFdYjwfdukG+Lug3sAbmJRsUjq8IgoXL1XJ2XCtUClipb8
         9fDnn58XxOytiuRBb9vEvbTH+VZyw4fbBLqP4z74WVyd5DTjHGAaOvAXzI1XyZ7aOYrx
         dtx3UfY1Ztn8joGT3Xn1brlh1ZljVE2gmlyQ3M9cTp0qoeNSuL/wlkYA0pJkyy1eH+df
         r+uTFvjV3hT8ImmYEIoPJENRur+EKOA274NLMRM7VNL8euso3RcEeKjZr6UPt5m1fzhA
         O04g==
X-Gm-Message-State: AOJu0YyXCLMpX+/zPjnFxQxF2AlOI3dhXokHnzRw756FSd9ddrAiT17X
	Qh7btZi01HNQe96kpg4eT5oPr8KaBXT2znHPJKnnrVE8sf6UDMxypWcXeifTUFcd/85k4185Iql
	B
X-Google-Smtp-Source: AGHT+IF3a2+rZm0LdS0N84wcXkZrMpkLEAxaKgpUmxpZyi4RX8szJX/zSNJo8B4xU11eluiNC+6uLA==
X-Received: by 2002:a17:906:f59f:b0:a77:db39:cc04 with SMTP id a640c23a62f3a-a8091ef4436mr453145066b.11.1723208662561;
        Fri, 09 Aug 2024 06:04:22 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [RFC PATCH] xen: Remove -Wdeclaration-after-statement
Date: Fri,  9 Aug 2024 14:04:18 +0100
Message-ID: <20240809130418.10431-1-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This warning only makes sense when developing using a compiler with C99
support on a codebase meant to be built with C89 compilers too, and
that's no longer the case (nor should it be, as it's been 25 years since
C99 came out already).

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
Yes, I'm opening this can of worms. I'd like to hear others people's
thoughts on this and whether this is something MISRA has views on. If
there's an ulterior non-obvious reason besides stylistic preference I
think it should be documented somewhere, but I haven't seen such an
explanation.

IMO, the presence of this warning causes several undesirable effects:

  1. Small functions are hampered by the preclusion of check+declare
     patterns that improve readability via concision. e.g: Consider a
     silly example like:

     /* with warning */                     /* without warning */
     void foo(uint8_t *p)                   void foo(uint8_t *p)
     {                                      {
         uint8_t  tmp1;                         if ( !p )
         uint16_t tmp2;                             return;
         uint32_t tmp3;
                                                uint8_t  tmp1 = OFFSET1 + *p;
         if ( !p )                              uint16_t tmp2 = OFFSET2 + *p;
             return;                            uint32_t tmp3 = OFFSET3 + *p;

         tmp1 = OFFSET1 + *p;                   /* Lots of uses of `tmpX` */
         tmp2 = OFFSET2 + *p;               }
         tmp2 = OFFSET2 + *p;

         /* Lots of uses of tmpX */
     }

  2. Promotes scope-creep. On small functions it doesn't matter much,
     but on bigger ones to prevent declaring halfway through the body
     needlessly increases variable scope to the full scope in which they
     are defined rather than the subscope of point-of-declaration to
     end-of-current-scope. In cases in which they can be trivially
     defined at that point, it also means they can be trivially misused
     before they are meant to. i.e: On the example in (1) assume the
     conditional in "with warning" is actually a large switch statement.

  3. It facilitates a disconnect between time-of-declaration and
     time-of-use that lead very easily to "use-before-init" bugs.
     While a modern compiler can alleviate the most egregious cases of
     this, there's cases it simply cannot cover. A conditional
     initialization on anything with external linkage combined with a
     conditional use on something else with external linkage will squash
     the warning of using an uninitialised variable. Things are worse
     where the variable in question is preinitialised to something
     credible (e.g: a pointer to NULL), as then that can be misused
     between its declaration and its original point of intended use.

So... thoughts? yay or nay?
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index 2e1a925c8417..288b7ac8bb2d 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -394,7 +394,7 @@ CFLAGS-$(CONFIG_CC_SPLIT_SECTIONS) += -ffunction-sections -fdata-sections
 
 CFLAGS += -nostdinc -fno-builtin -fno-common
 CFLAGS += -Werror -Wredundant-decls -Wwrite-strings -Wno-pointer-arith
-CFLAGS += -Wdeclaration-after-statement -Wuninitialized
+CFLAGS += -Wuninitialized
 $(call cc-option-add,CFLAGS,CC,-Wvla)
 $(call cc-option-add,CFLAGS,CC,-Wflex-array-member-not-at-end)
 $(call cc-option-add,CFLAGS,CC,-Winit-self)
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 09 13:05:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 13:05:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774752.1185178 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scPJ3-0001Ag-2z; Fri, 09 Aug 2024 13:05:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774752.1185178; Fri, 09 Aug 2024 13:05:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scPJ3-0001AZ-0T; Fri, 09 Aug 2024 13:05:21 +0000
Received: by outflank-mailman (input) for mailman id 774752;
 Fri, 09 Aug 2024 13:05:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=TQMG=PI=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1scPJ1-00013P-V8
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 13:05:19 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0732c9bd-5650-11ef-bc04-fd08da9f4363;
 Fri, 09 Aug 2024 15:05:19 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-58ef19aa69dso2069448a12.3
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 06:05:19 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bbb2bf96f5sm1518564a12.14.2024.08.09.06.05.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 09 Aug 2024 06:05:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0732c9bd-5650-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723208718; x=1723813518; 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=BEqg5SLuQGxr6NW9TobcbXN7WqjttX+TdB+5hbj6Sy8=;
        b=GGzfe4WdXgPmbqQzyN8mqjGaXWGIgaZez08K0PYwqo30n8oqH81pfrfxpje39CBZzU
         XI5B6sqSLyqYqGNdaHnaLucT9/3+tNuS4WjJrkfQanCdHWmt6VCtYyo7Pwjbz5neW73X
         zuL09zossnh7issH9fvXbebk65I6DW6wvz3zgW5e4v4taX/WGoKcP5Ten4p/nJG4fYAO
         DcQmgs3gcTRurGcTL2s+47PwyYf85TQm2M+TpwT+efO5WY1qS6OCk3tApb9RO+Uh0ec2
         5NFEixccWm05Z/31C3/Aep3DXMiB37UnIyLheYs3b8r8gxy6gUpGCn9Hrm+rSStZ74xu
         EegQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723208718; x=1723813518;
        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=BEqg5SLuQGxr6NW9TobcbXN7WqjttX+TdB+5hbj6Sy8=;
        b=OPKZNlxWU1+2n3M66mHHkoW1FrXwZTLoEMBLPQVlvOkQUQpW0d4RIx+EHPjz1tsdeT
         RjN2hb9pRBRWfNpBgMfkGncOu1AGvO8tOmczrd3Qi9ogdCRn9tcEa+f9jh+yQTMH76Nm
         cF4pznrstY4ELNOcODKe5etYQjoxYoHKcJSmKH33V10R+bybhJI6c4Ksh9rGkeExsA2z
         cjafYuhBJqHJAFfSz61y8UDPGgRkfHiei5s5lHz6sIyLgHLufYmjYfSQzyQ+QSdcCzIV
         aDio10Kf/BHxZDCkap2eq+goRfNS4thzfmsSwXWl84/U4j98CtF04cpWHp45H7pewyvS
         +++w==
X-Forwarded-Encrypted: i=1; AJvYcCUOrkFBo2PlSlHKLKKC9SprbBAecqR554cR0KzHiahak97PLVhEjnbjuiN+TmZH4cfOrDlkmByU+rU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzLszsQrRL2Ul8s9LTPuyJEe7Ggrbzzln96mc+VEpr7IWF3x6Hj
	+ZsST7s0EIQcwfnB1SiLZVk2h4gyOX0BWcXg2ja/31wGpoc7u14BFALMIxAIbq6wrGNqaGBh60U
	=
X-Google-Smtp-Source: AGHT+IFA3dmlp2kKsleNkpSo5ltZZUCAwn/Q4IKIMoyS4bGXioxVKcUNAwf8tLM622zrmi7WwWj50g==
X-Received: by 2002:a05:6402:40d2:b0:5ba:cb82:a776 with SMTP id 4fb4d7f45d1cf-5bd0a535cefmr1137750a12.9.1723208718268;
        Fri, 09 Aug 2024 06:05:18 -0700 (PDT)
Message-ID: <85a9263b-24cf-47ba-ba83-c2c988dee5c2@suse.com>
Date: Fri, 9 Aug 2024 15:05:17 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] x86/msi: fix locking for SR-IOV devices
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <20240807052011.582099-1-stewart.hildebrand@amd.com>
 <1b0475fe-4371-4bf7-a469-aa580648f210@suse.com>
 <62523c87-9c93-4b71-a71b-e852fce3136d@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <62523c87-9c93-4b71-a71b-e852fce3136d@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 09.08.2024 06:09, Stewart Hildebrand wrote:
> On 8/7/24 11:21, Jan Beulich wrote:
>> On 07.08.2024 07:20, Stewart Hildebrand wrote:
>>> --- a/xen/arch/x86/msi.c
>>> +++ b/xen/arch/x86/msi.c
>>> @@ -662,7 +662,8 @@ static int msi_capability_init(struct pci_dev *dev,
>>>      return 0;
>>>  }
>>>  
>>> -static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
>>> +static u64 read_pci_mem_bar(struct pci_dev *pdev, u16 seg, u8 bus, u8 slot,
>>> +                            u8 func, u8 bir, int vf)
>>>  {
>>
>> First I thought this was a leftover from the earlier version. But you need
>> it for accessing the vf_rlen[] field. Yet that's properly misleading,
>> especially when considering that the fix also wants backporting. What pdev
>> represents here changes. I think you want to pass in just vf_rlen (if we
>> really want to go this route; I'm a little wary of this repurposing of the
>> field, albeit I see no real technical issue).
> 
> I like your idea below of using a struct, so I'll pass a pointer to the
> new struct.
> 
>> Of course there's a BUILD_BUG_ON() which we need to get creative with, in
>> order to now outright drop it (see also below).
> 
> I suppose this BUILD_BUG_ON() is redundant with the one in
> pci_add_device()...

"Redundant" can be positive or negative. Your response sounds as if you
thought one could be dropped, yet I think we want them in both places.

>>> --- a/xen/drivers/passthrough/pci.c
>>> +++ b/xen/drivers/passthrough/pci.c
>>> @@ -654,6 +654,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>>>      const char *type;
>>>      int ret;
>>>      bool pf_is_extfn = false;
>>> +    uint64_t vf_rlen[6] = { 0 };
>>
>> The type of this variable needs to be tied to that of the struct field
>> you copy to/from. Otherwise, if the struct field changes type ...
>>
>>> @@ -664,7 +665,10 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>>>                              PCI_SBDF(seg, info->physfn.bus,
>>>                                       info->physfn.devfn));
>>>          if ( pdev )
>>> +        {
>>>              pf_is_extfn = pdev->info.is_extfn;
>>> +            memcpy(vf_rlen, pdev->vf_rlen, sizeof(pdev->vf_rlen));
>>
>> ... there'll be nothing for the compiler to tell us. Taken together with
>> the BUILD_BUG_ON() related remark further up, I think you want to
>> introduce a typedef and/or struct here to make things properly typesafe
>> (as then you can avoid the use of memcpy()).
> 
> Here's what I'm thinking:
> 
> struct vf_info {
>     uint64_t vf_rlen[PCI_SRIOV_NUM_BARS];
>     unsigned int refcnt;
> };
> 
> struct pci_dev {
>     ...
>     struct vf_info *vf_info;
>     ...
> };

I don't (yet) see the need for refcnt, and I also don't see why it wouldn't
continue to be embedded in struct pci_dev. Specifically ...

>> An alternative approach might be to add a link from VF to PF, while
>> making sure that the PF struct won't be de-allocated until all its VFs
>> have gone away. That would then also allow to eliminate the problematic
>> pci_get_pdev().
> 
> I think I can add a link to a new reference-counted struct with just the
> info needed (see the proposed struct above).

... I think having a link from VF to its PF may turn out helpful in the
future for other purposes, too.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 13:13:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 13:13:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774764.1185189 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scPQz-0003Rj-UA; Fri, 09 Aug 2024 13:13:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774764.1185189; Fri, 09 Aug 2024 13:13:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scPQz-0003Rc-RM; Fri, 09 Aug 2024 13:13:33 +0000
Received: by outflank-mailman (input) for mailman id 774764;
 Fri, 09 Aug 2024 13:13:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=TQMG=PI=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1scPQy-0003RV-DT
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 13:13:32 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2c869b8d-5651-11ef-bc04-fd08da9f4363;
 Fri, 09 Aug 2024 15:13:31 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a7a83a968ddso194139466b.0
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 06:13:31 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a7dc9ecabb2sm836093566b.214.2024.08.09.06.13.30
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 09 Aug 2024 06:13:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2c869b8d-5651-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723209210; x=1723814010; 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=XxlrMOcF3nn7vyFJCGx+Qnh7eje7Ah/PfAv/9leMuqo=;
        b=g25H2iwqGE2i/atbaxjbuLnKLWF1lOYqQzBGH3xsM9UEp0/6qVQ2QB0wyLLR46bcM9
         QSGH4JGQPLLgc0EriuiWynDTrSQq5ijZHQg2nP3VSismJB041o/RfW1gmGPHQVipKjfe
         G27kUAu1z6YlT4x5dycDrlqazIORqxLK46EOSw+2NbyCyA/4CZyupm349qnEu8oELLEQ
         efD1bFUCr0an7ucLhAPwgKRSB12Y1uu58XV9XMOd6owj6LqTTc++lri9F8oYpkWdBgbz
         +ya4fuMmHkpf5E/+AJohammdHHCD4JRkz7oOWB5Cdw3Q10FrV0SCLeUdS6WYD5vwcr+h
         pAVg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723209210; x=1723814010;
        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=XxlrMOcF3nn7vyFJCGx+Qnh7eje7Ah/PfAv/9leMuqo=;
        b=eC55IyOZI5vjmPwnJ07IgOg9QBm0pDvnC8ZYlAxyxqKCdKwhIdjSAFaS1SgxwyHwar
         /Q0YFfY02bFVBItJgV/1U/yrmII8okEKnUnkEGh4z/Slv9yV8Sm/1A4vaG7zzwap4MPP
         WjYMriZr5bgPUQjkF5k4Q3+u1+pOdnZ759z44ZKDTzWla0uChdDaqxefIOt2YOwzwGty
         vpmQ/XD8mnON3Oy6p2IBUVd/7CXdhL4d5+Lhjl6Mnz6brZQhGquW8/e2SboBC6GkI5Ug
         3vYA/ZgWjNeA1SvIUFydSDl2Wo7z/Zod7QFxPn8zd7IiuTY31B8/H4tuNQiHa5sF7Y8b
         p26A==
X-Forwarded-Encrypted: i=1; AJvYcCXlvnE4Z2Wx6sfvc4FPKvH8dEVxUAdyrz2mSs5cyQdL4rx6QFUw79tvNIYRgfwikhWvlDsgWTT07w9FvN1Ezpqyu4VSPsb+u5s4IYTOfB8=
X-Gm-Message-State: AOJu0Yw21OtCUUJ+ncUle/vBi4M4ygkdlhSr/tyU+SJSR1Y0MNCvDfWJ
	WI9YOelct6rrDBKjCijq+xko2c96TmsxafvLnWvb58OZo8HcH0jgTJwmaOiCWQ==
X-Google-Smtp-Source: AGHT+IHaWDwQyjRBGpzmuATkdSOmYfcglLN4Etrw4VsjR6c/JfIFp7bDHk1a2wL1JoXUtKiFTkhcqg==
X-Received: by 2002:a17:907:f715:b0:a7d:a29e:5c41 with SMTP id a640c23a62f3a-a80aa5ebb2emr120804466b.40.1723209210536;
        Fri, 09 Aug 2024 06:13:30 -0700 (PDT)
Message-ID: <b866c321-03b4-4e98-a5e0-8d2ad40f3f02@suse.com>
Date: Fri, 9 Aug 2024 15:13:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [RFC PATCH] xen: Remove -Wdeclaration-after-statement
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240809130418.10431-1-alejandro.vallejo@cloud.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: <20240809130418.10431-1-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 09.08.2024 15:04, Alejandro Vallejo wrote:
> This warning only makes sense when developing using a compiler with C99
> support on a codebase meant to be built with C89 compilers too, and
> that's no longer the case (nor should it be, as it's been 25 years since
> C99 came out already).
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> ---
> Yes, I'm opening this can of worms. I'd like to hear others people's
> thoughts on this and whether this is something MISRA has views on. If
> there's an ulterior non-obvious reason besides stylistic preference I
> think it should be documented somewhere, but I haven't seen such an
> explanation.
> 
> IMO, the presence of this warning causes several undesirable effects:
> 
>   1. Small functions are hampered by the preclusion of check+declare
>      patterns that improve readability via concision. e.g: Consider a
>      silly example like:
> 
>      /* with warning */                     /* without warning */
>      void foo(uint8_t *p)                   void foo(uint8_t *p)
>      {                                      {
>          uint8_t  tmp1;                         if ( !p )
>          uint16_t tmp2;                             return;
>          uint32_t tmp3;
>                                                 uint8_t  tmp1 = OFFSET1 + *p;
>          if ( !p )                              uint16_t tmp2 = OFFSET2 + *p;
>              return;                            uint32_t tmp3 = OFFSET3 + *p;
> 
>          tmp1 = OFFSET1 + *p;                   /* Lots of uses of `tmpX` */
>          tmp2 = OFFSET2 + *p;               }
>          tmp2 = OFFSET2 + *p;
> 
>          /* Lots of uses of tmpX */
>      }
> 
>   2. Promotes scope-creep. On small functions it doesn't matter much,
>      but on bigger ones to prevent declaring halfway through the body
>      needlessly increases variable scope to the full scope in which they
>      are defined rather than the subscope of point-of-declaration to
>      end-of-current-scope. In cases in which they can be trivially
>      defined at that point, it also means they can be trivially misused
>      before they are meant to. i.e: On the example in (1) assume the
>      conditional in "with warning" is actually a large switch statement.
> 
>   3. It facilitates a disconnect between time-of-declaration and
>      time-of-use that lead very easily to "use-before-init" bugs.
>      While a modern compiler can alleviate the most egregious cases of
>      this, there's cases it simply cannot cover. A conditional
>      initialization on anything with external linkage combined with a
>      conditional use on something else with external linkage will squash
>      the warning of using an uninitialised variable. Things are worse
>      where the variable in question is preinitialised to something
>      credible (e.g: a pointer to NULL), as then that can be misused
>      between its declaration and its original point of intended use.

Right, these are the aspects that would improve. The potential downside is
that you no longer have a fixed place (set of places) where to look for
which variables are actually in scope. For people having worked with C89
(and not e.g. C++) for a very long time, mixing of declarations and
statements may be irritating. In fact, having used C++ quite a lot in the
(meanwhile distant) past, I have developed a mental C mode and a mental
C++ one - when in the former I expect declarations at the start of scopes,
while when in the latter I know to expect them everywhere.

All in all - I'm afraid I'm split on this.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 13:51:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 13:51:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774782.1185199 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scQ1P-00022M-Ni; Fri, 09 Aug 2024 13:51:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774782.1185199; Fri, 09 Aug 2024 13:51:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scQ1P-00022F-KU; Fri, 09 Aug 2024 13:51:11 +0000
Received: by outflank-mailman (input) for mailman id 774782;
 Fri, 09 Aug 2024 13:51: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=mmNo=PI=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1scQ1N-000229-S7
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 13:51:09 +0000
Received: from mail-oo1-xc2f.google.com (mail-oo1-xc2f.google.com
 [2607:f8b0:4864:20::c2f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6a8ae2a2-5656-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 15:51:03 +0200 (CEST)
Received: by mail-oo1-xc2f.google.com with SMTP id
 006d021491bc7-5d5d077c60aso1088581eaf.1
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 06:51:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6a8ae2a2-5656-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723211462; x=1723816262; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=j//DRd5ukK5XEt7F98pN8iEWJl+NH/GMZJIug/daUro=;
        b=OHfoV9lxxJi1xb8/LjplSKuGXL627Vnv6+eCrZSwVmt7XVTl0H3u0NAzru56YppjjJ
         4/MrvjV0lpNPJ8uf2aAbZomDtrPqWvT8cQl8H1yLGvGx6hMBf8pB9Yriyx3OTW2XHAyE
         jc7SBi2OjjKdIIV8om/r3T06PqQmbyhskMWJk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723211462; x=1723816262;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=j//DRd5ukK5XEt7F98pN8iEWJl+NH/GMZJIug/daUro=;
        b=iLoLZbQH0ipu2K10abASmvG0yE0UYHLYBZaI5qqCDnsCtd5LpvgZ2Eb/uDmBUL9Njl
         Ybuhr7srY+VDeKqsuaUqrPSkXhWUkqv+SXmlo8DJFq2sp0EAb+FIrIffnmeJlFZaXzTk
         O5fDMZWV3Cf1PJZ37HbCs49qWmGTAPLk697C3c4+q1cZywpMiWhJLq/bYCKc4AHfTnOk
         AWZbM+BucaT+t+PVFoBXju5u+oWhXJWarQdvbfX3/Qxh6PZxCzH4AkqY8FyuY7X+C3lx
         cnjUoLuG8Ylvvs5SyDSTCGp88KhDqIrHXuWkDr0sS9EVMLGMX/wd11/CzkaF45ai8NWo
         MJ2w==
X-Forwarded-Encrypted: i=1; AJvYcCVN0eGk+jYe2Ly1B1MX2QuKFDs1uFhb0T19mZPqq7V7cnP8lGS+pVCH7MnaXZvxkR5tl08qtMUnM4oqUinuQlw9QK9U+bT9IglXdGE7Zeg=
X-Gm-Message-State: AOJu0YygQERzZe/90HTXD+8KO1xVmJKdjW0OU+qYf6/on/3hgpHcAxtH
	k3uasBK/QayDIm/F7zUcOsB3kLO8H3Xgtp2N3o1u8GmdeXC6O+waEBOZjwjWdCQ2B7AuDOe2fri
	jQzevU3M/J1V2CFRBQ9tg4nKHlcGSzrvObSDINA==
X-Google-Smtp-Source: AGHT+IEtqt5BhLC4LoEfKMkFw/9ncIwMtIfcfgF1YrgXPpXZGhAVWdvDDcv1dwhLOvMg701EVDv77Fya2z7wb677op4=
X-Received: by 2002:a05:6820:50c:b0:5c9:d9db:6a51 with SMTP id
 006d021491bc7-5d867695bd8mr2125282eaf.0.1723211461973; Fri, 09 Aug 2024
 06:51:01 -0700 (PDT)
MIME-Version: 1.0
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-4-alejandro.vallejo@cloud.com> <cf819b39-6ce8-4446-b7b6-a1b247f45400@suse.com>
 <CACHz=ZgwPunPO771EbX1hKEdmXC1ysBQ7RzYK8K1pakyBS927A@mail.gmail.com> <7f0a7c9e-0cac-48ae-b7aa-5c90a1a5f4ca@suse.com>
In-Reply-To: <7f0a7c9e-0cac-48ae-b7aa-5c90a1a5f4ca@suse.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Fri, 9 Aug 2024 14:50:51 +0100
Message-ID: <CACHz=ZgCodGsFdyKe+F4gY3nAnymHLQ0T23CWSqauEhbm=Ubeg@mail.gmail.com>
Subject: Re: [PATCH 3/5] x86: Set xen_phys_start and trampoline_xen_phys_start earlier
To: Jan Beulich <jbeulich@suse.com>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Xen-devel <xen-devel@lists.xenproject.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Aug 9, 2024 at 1:59=E2=80=AFPM Jan Beulich <jbeulich@suse.com> wrot=
e:
>
> On 09.08.2024 14:48, Frediano Ziglio wrote:
> > On Thu, Aug 8, 2024 at 9:25=E2=80=AFAM Jan Beulich <jbeulich@suse.com> =
wrote:
> >> On 07.08.2024 15:48, Alejandro Vallejo wrote:
> >>> No reason to wait, if Xen image is loaded by EFI (not multiboot
> >>> EFI path) these are set in efi_arch_load_addr_check, but
> >>> not in the multiboot EFI code path.
> >>> This change makes the 2 code paths more similar and allows
> >>> the usage of these variables if needed.
> >>
> >> I'm afraid I'm struggling with any "similarity" argument here. Imo it
> >> would be better what, if anything, needs (is going to need) either or
> >> both of these set earlier. Which isn't to say it's wrong to do early
> >> what can be done early, just that ...
> >>
> >
> > About similarity is that some part of EFI code expect xen_phys_start
> > to be initialized so this change make sure that if in the future these
> > paths are called even for this case they won't break.
> >
> >>> --- a/xen/arch/x86/boot/head.S
> >>> +++ b/xen/arch/x86/boot/head.S
> >>> @@ -259,6 +259,11 @@ __efi64_mb2_start:
> >>>          jmp     x86_32_switch
> >>>
> >>>  .Lefi_multiboot2_proto:
> >>> +        /* Save Xen image load base address for later use. */
> >>> +        lea     __image_base__(%rip),%rsi
> >>> +        movq    %rsi, xen_phys_start(%rip)
> >>> +        movl    %esi, trampoline_xen_phys_start(%rip)
> >>
> >> ... this path is EFI only if I'm not mistaken, while ...
> >>
> >>> @@ -605,10 +610,6 @@ trampoline_setup:
> >>>           * Called on legacy BIOS and EFI platforms.
> >>>           */
> >>>
> >>> -        /* Save Xen image load base address for later use. */
> >>> -        mov     %esi, sym_esi(xen_phys_start)
> >>> -        mov     %esi, sym_esi(trampoline_xen_phys_start)
> >>
> >> ... the comment in context is pretty clear about this code also being
> >> used in the non-EFI case. It is, however, the case that %esi is 0 in
> >> that case. Yet surely you want to mention this in the description, to
> >> clarify the correctness of the change.
> >
> > Restored this code.
>
> Was my analysis wrong then and it's actually needed for some specific
> case?
>

Not clear to what exactly you are referring.
That later part of code (which was removed) is still needed in case of no-E=
FI.

> Jan

Frediano


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 14:03:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 14:03:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774791.1185209 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scQCl-0004FD-O4; Fri, 09 Aug 2024 14:02:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774791.1185209; Fri, 09 Aug 2024 14:02:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scQCl-0004F6-Kw; Fri, 09 Aug 2024 14:02:55 +0000
Received: by outflank-mailman (input) for mailman id 774791;
 Fri, 09 Aug 2024 14:02:54 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=TQMG=PI=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1scQCk-0004F0-Dl
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 14:02:54 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 11571158-5658-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 16:02:52 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5b9d48d1456so74418a12.1
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 07:02:52 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bbb2c41916sm1542990a12.41.2024.08.09.07.02.50
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 09 Aug 2024 07:02:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 11571158-5658-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723212171; x=1723816971; 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=fcJU+sXFN7aYtAKGFMDSzUQBc8xF9yN7jfOo0YrxvTI=;
        b=a4pmNauLVOKVNZHASN7mRRrKHSJuW6i7nrk/iDKTEYEOJ70AhXavUwEhbuQJYvgIKc
         4HYI0ekDri1VQeYAq8O2SuAWLO2N0hHzpzfQmX0p2vHdnEin68WpLF22dleSPhwGKJMM
         uDQaDKVGS+g7FNgXB7NOYTZAJSDv/BkBcmbLQUUJxuWZT993pdD4zSrqLNoAduoYi8to
         lKXzjCCQpso+nfijvow5+QriiY3xX4i+kFsVdwv5KRz6wWZ2xbxY6yAlmvbgZcbSnk4/
         xtqZr12KdlAQ+z/6SKFNJCTdZNU/0huKiu8B7KpoD33Hha8GiP5KyT1mAJrhAdSMxHJ9
         eBcQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723212171; x=1723816971;
        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=fcJU+sXFN7aYtAKGFMDSzUQBc8xF9yN7jfOo0YrxvTI=;
        b=sH7Da62pYJmxvn95CcLmgII+QgPRUNJhZolfnfa2Ssp9wxF2CT9Is/48JcxvKUexbL
         OXxkwkjg5c+gbGwxv7TgFlge9dWXUWgX2CW+WJBgr1ltkXkYbld9Ywcc3RmIZFduSOfO
         zc4FGFqIJnDbIC/HoD1RqYrhPF2MwwYx81CWfqG4gNleX+jyY8mbRm25e+483wQ7rlYs
         /WPxU54lrMGjLmfvhgwhYA465gs3JjgLWLRm3I7bhKfYfu/uaVw7oR7znGx7DXfGUb1H
         45WHpf+62RGBMiUXk9VMcx3t4By1skV9nbBzWcm/dhIN2cpRFGotc3HSSkJDUmLed2oY
         lhdQ==
X-Forwarded-Encrypted: i=1; AJvYcCWU21QwcWdtay2VtcutrrrIt3WIxNxorXIJ2SB7/BDG5Cr7x+emTL4fHwsAdzKWzll74ByawXRO0vLXxJUbALEpXETUZmoxc27WshvZBH0=
X-Gm-Message-State: AOJu0Yz0Lzpg8wCpJr/3rrTglEQdRju+UXxhPtKJ2LlJtmu+BQj1tVNO
	WVVG2Eyo7CkzSQhVq049H5zO7Y2VV0//yqAbWkv1VkWKS3ajap3aqDPPSFu0908v3k+uTFLByeo
	=
X-Google-Smtp-Source: AGHT+IHgwiB3Yj2AjtytIJg7gocScbnaVXcZXhkgygMlWPTRFVjJg9KS68HGw6mFViU+1EiGGLEJpg==
X-Received: by 2002:a05:6402:4405:b0:5af:384e:bc0f with SMTP id 4fb4d7f45d1cf-5bd0abda8dfmr1736559a12.16.1723212171350;
        Fri, 09 Aug 2024 07:02:51 -0700 (PDT)
Message-ID: <14fc293a-4a0d-4de2-b468-bd0ef8c912b1@suse.com>
Date: Fri, 9 Aug 2024 16:02:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/5] x86: Set xen_phys_start and trampoline_xen_phys_start
 earlier
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-4-alejandro.vallejo@cloud.com>
 <cf819b39-6ce8-4446-b7b6-a1b247f45400@suse.com>
 <CACHz=ZgwPunPO771EbX1hKEdmXC1ysBQ7RzYK8K1pakyBS927A@mail.gmail.com>
 <7f0a7c9e-0cac-48ae-b7aa-5c90a1a5f4ca@suse.com>
 <CACHz=ZgCodGsFdyKe+F4gY3nAnymHLQ0T23CWSqauEhbm=Ubeg@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: <CACHz=ZgCodGsFdyKe+F4gY3nAnymHLQ0T23CWSqauEhbm=Ubeg@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 09.08.2024 15:50, Frediano Ziglio wrote:
> On Fri, Aug 9, 2024 at 1:59 PM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 09.08.2024 14:48, Frediano Ziglio wrote:
>>> On Thu, Aug 8, 2024 at 9:25 AM Jan Beulich <jbeulich@suse.com> wrote:
>>>> On 07.08.2024 15:48, Alejandro Vallejo wrote:
>>>>> No reason to wait, if Xen image is loaded by EFI (not multiboot
>>>>> EFI path) these are set in efi_arch_load_addr_check, but
>>>>> not in the multiboot EFI code path.
>>>>> This change makes the 2 code paths more similar and allows
>>>>> the usage of these variables if needed.
>>>>
>>>> I'm afraid I'm struggling with any "similarity" argument here. Imo it
>>>> would be better what, if anything, needs (is going to need) either or
>>>> both of these set earlier. Which isn't to say it's wrong to do early
>>>> what can be done early, just that ...
>>>>
>>>
>>> About similarity is that some part of EFI code expect xen_phys_start
>>> to be initialized so this change make sure that if in the future these
>>> paths are called even for this case they won't break.
>>>
>>>>> --- a/xen/arch/x86/boot/head.S
>>>>> +++ b/xen/arch/x86/boot/head.S
>>>>> @@ -259,6 +259,11 @@ __efi64_mb2_start:
>>>>>          jmp     x86_32_switch
>>>>>
>>>>>  .Lefi_multiboot2_proto:
>>>>> +        /* Save Xen image load base address for later use. */
>>>>> +        lea     __image_base__(%rip),%rsi
>>>>> +        movq    %rsi, xen_phys_start(%rip)
>>>>> +        movl    %esi, trampoline_xen_phys_start(%rip)
>>>>
>>>> ... this path is EFI only if I'm not mistaken, while ...
>>>>
>>>>> @@ -605,10 +610,6 @@ trampoline_setup:
>>>>>           * Called on legacy BIOS and EFI platforms.
>>>>>           */
>>>>>
>>>>> -        /* Save Xen image load base address for later use. */
>>>>> -        mov     %esi, sym_esi(xen_phys_start)
>>>>> -        mov     %esi, sym_esi(trampoline_xen_phys_start)
>>>>
>>>> ... the comment in context is pretty clear about this code also being
>>>> used in the non-EFI case. It is, however, the case that %esi is 0 in
>>>> that case. Yet surely you want to mention this in the description, to
>>>> clarify the correctness of the change.
>>>
>>> Restored this code.
>>
>> Was my analysis wrong then and it's actually needed for some specific
>> case?
> 
> Not clear to what exactly you are referring.
> That later part of code (which was removed) is still needed in case of no-EFI.

Is it? Under what conditions would %esi be non-zero? As indicated by my earlier
reply, I think it would never be. In which case the two stores are pointless.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 14:35:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 14:35:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774805.1185219 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scQhl-00011s-3L; Fri, 09 Aug 2024 14:34:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774805.1185219; Fri, 09 Aug 2024 14:34:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scQhk-00011l-Vp; Fri, 09 Aug 2024 14:34:56 +0000
Received: by outflank-mailman (input) for mailman id 774805;
 Fri, 09 Aug 2024 14:34:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mmNo=PI=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1scQhj-00011f-Mw
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 14:34:55 +0000
Received: from mail-oo1-xc36.google.com (mail-oo1-xc36.google.com
 [2607:f8b0:4864:20::c36])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8a3ace1f-565c-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 16:34:53 +0200 (CEST)
Received: by mail-oo1-xc36.google.com with SMTP id
 006d021491bc7-5c6661bca43so1291684eaf.0
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 07:34:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8a3ace1f-565c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723214092; x=1723818892; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=lzpK0xgMKwkpzfCOIQ+958spoM/lZq4IA6DXOycC8wE=;
        b=fa+4+bJtUnCMqk/tUtiKIquIAwXO1nXXoSOaN7fF2YtrYwiGVnb6k0qFkqgssdzPmc
         Ug6QvGGu98F8zFmE0Y9tqcT2hXwkJ2HSL/Hqb8vMnUEzcelvGfW7dJPqfiphHy6xLMe1
         0jnkA0Wy0SUEUOyLVhFcnMbjEzr29CWFKaByI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723214092; x=1723818892;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=lzpK0xgMKwkpzfCOIQ+958spoM/lZq4IA6DXOycC8wE=;
        b=JPd+l5bUPS7H6k6cvAKMmI/bBhWkGHxsoJu5JE5sjk1gmRootQ00aP9PZM9jqrrfzI
         1Dph6zX7w5rHuNK6g1UEJYS/yxbvF/6qexStidTSohC9FsFl+ofPzk/IS3iIL25cPaWF
         qXKnp69GEf83EGTuX/9pErx47NUqHuK/XuhcRuTwjukPbncL1CFRppH8FTHVEbmp5AZC
         61PU6/C01LvPG+ts8WL84kHaWi0O+ughoCJCbumkOMHkPSeskC4d7na4KEbt5l4WZmJ9
         QRNUfTf4nvmWn/zgiTS83hciWWNqezgHRrPzqj1AggyrXAJGMW6ZMOBYMPi68ZeuwwUy
         8zkw==
X-Forwarded-Encrypted: i=1; AJvYcCW/VUTAI8KX+yxMnj8eEopLO/iXA6sUyMlRo8wOYRx0K33BIWTWWgAqbz9is6Tek/VTJJreMk7F2VqXJY+pZqVAcanbrcOgCp4rfLFxPR8=
X-Gm-Message-State: AOJu0YyRqelN5Z3CDJSsHrkja9ugz9emz2qr8Qlgq0NjbeW5cupb02Sj
	eOG+/rWKj5SIpPubHpVUQhkGG19lhhhDWvlV4XQmZ0fONpgFMMycX9BV3gnB229Cc7j4r//s8Nf
	L2zcE7sREzMUm+CidUNUeZEfQ7DwuB+XrE4Q1/g==
X-Google-Smtp-Source: AGHT+IHFMeeWzBYSYzsRzV4lob2pHzz9MapgCIl9rIlSW3F0fzjNOeBV2UBJZ7wENQ8BVtmXgAKfoH0DI/ZRAcyK9To=
X-Received: by 2002:a05:6820:1624:b0:5d8:2f32:1844 with SMTP id
 006d021491bc7-5d871b74d5amr2258531eaf.6.1723214092224; Fri, 09 Aug 2024
 07:34:52 -0700 (PDT)
MIME-Version: 1.0
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-4-alejandro.vallejo@cloud.com> <cf819b39-6ce8-4446-b7b6-a1b247f45400@suse.com>
 <CACHz=ZgwPunPO771EbX1hKEdmXC1ysBQ7RzYK8K1pakyBS927A@mail.gmail.com>
 <7f0a7c9e-0cac-48ae-b7aa-5c90a1a5f4ca@suse.com> <CACHz=ZgCodGsFdyKe+F4gY3nAnymHLQ0T23CWSqauEhbm=Ubeg@mail.gmail.com>
 <14fc293a-4a0d-4de2-b468-bd0ef8c912b1@suse.com>
In-Reply-To: <14fc293a-4a0d-4de2-b468-bd0ef8c912b1@suse.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Fri, 9 Aug 2024 15:34:41 +0100
Message-ID: <CACHz=Zj+LKKvPxTd8SGYthBTPiC6bEPrZg0nt=ehpOJ4JwqoiQ@mail.gmail.com>
Subject: Re: [PATCH 3/5] x86: Set xen_phys_start and trampoline_xen_phys_start earlier
To: Jan Beulich <jbeulich@suse.com>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Xen-devel <xen-devel@lists.xenproject.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Aug 9, 2024 at 3:02=E2=80=AFPM Jan Beulich <jbeulich@suse.com> wrot=
e:
>
> On 09.08.2024 15:50, Frediano Ziglio wrote:
> > On Fri, Aug 9, 2024 at 1:59=E2=80=AFPM Jan Beulich <jbeulich@suse.com> =
wrote:
> >>
> >> On 09.08.2024 14:48, Frediano Ziglio wrote:
> >>> On Thu, Aug 8, 2024 at 9:25=E2=80=AFAM Jan Beulich <jbeulich@suse.com=
> wrote:
> >>>> On 07.08.2024 15:48, Alejandro Vallejo wrote:
> >>>>> No reason to wait, if Xen image is loaded by EFI (not multiboot
> >>>>> EFI path) these are set in efi_arch_load_addr_check, but
> >>>>> not in the multiboot EFI code path.
> >>>>> This change makes the 2 code paths more similar and allows
> >>>>> the usage of these variables if needed.
> >>>>
> >>>> I'm afraid I'm struggling with any "similarity" argument here. Imo i=
t
> >>>> would be better what, if anything, needs (is going to need) either o=
r
> >>>> both of these set earlier. Which isn't to say it's wrong to do early
> >>>> what can be done early, just that ...
> >>>>
> >>>
> >>> About similarity is that some part of EFI code expect xen_phys_start
> >>> to be initialized so this change make sure that if in the future thes=
e
> >>> paths are called even for this case they won't break.
> >>>
> >>>>> --- a/xen/arch/x86/boot/head.S
> >>>>> +++ b/xen/arch/x86/boot/head.S
> >>>>> @@ -259,6 +259,11 @@ __efi64_mb2_start:
> >>>>>          jmp     x86_32_switch
> >>>>>
> >>>>>  .Lefi_multiboot2_proto:
> >>>>> +        /* Save Xen image load base address for later use. */
> >>>>> +        lea     __image_base__(%rip),%rsi
> >>>>> +        movq    %rsi, xen_phys_start(%rip)
> >>>>> +        movl    %esi, trampoline_xen_phys_start(%rip)
> >>>>
> >>>> ... this path is EFI only if I'm not mistaken, while ...
> >>>>
> >>>>> @@ -605,10 +610,6 @@ trampoline_setup:
> >>>>>           * Called on legacy BIOS and EFI platforms.
> >>>>>           */
> >>>>>
> >>>>> -        /* Save Xen image load base address for later use. */
> >>>>> -        mov     %esi, sym_esi(xen_phys_start)
> >>>>> -        mov     %esi, sym_esi(trampoline_xen_phys_start)
> >>>>
> >>>> ... the comment in context is pretty clear about this code also bein=
g
> >>>> used in the non-EFI case. It is, however, the case that %esi is 0 in
> >>>> that case. Yet surely you want to mention this in the description, t=
o
> >>>> clarify the correctness of the change.
> >>>
> >>> Restored this code.
> >>
> >> Was my analysis wrong then and it's actually needed for some specific
> >> case?
> >
> > Not clear to what exactly you are referring.
> > That later part of code (which was removed) is still needed in case of =
no-EFI.
>
> Is it? Under what conditions would %esi be non-zero? As indicated by my e=
arlier
> reply, I think it would never be. In which case the two stores are pointl=
ess.
>

I really don't follow, %esi at that point should be the address where
the executable is loader, which should not be zero.

> Jan

Frediano


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 14:56:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 14:56:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774815.1185228 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scR27-0004eh-MV; Fri, 09 Aug 2024 14:55:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774815.1185228; Fri, 09 Aug 2024 14:55:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scR27-0004ea-Jt; Fri, 09 Aug 2024 14:55:59 +0000
Received: by outflank-mailman (input) for mailman id 774815;
 Fri, 09 Aug 2024 14:55:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scR26-0004eP-Ds; Fri, 09 Aug 2024 14:55:58 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scR26-0007eU-4w; Fri, 09 Aug 2024 14:55:58 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scR25-0001mU-Jf; Fri, 09 Aug 2024 14:55:57 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1scR25-0006m5-JM; Fri, 09 Aug 2024 14:55:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=6Uaplc59rdeKbU3/5BjNkkN1WKNubdkFG1NMoQSNUPQ=; b=mG23GwLn+ZFKFaT5FPJH+I/HMv
	EeyIW1BGUDpPLsDAG10aT+sjTAmASzmawZf5G6SppmllB4JE5YOBrmprxZInLbN/E5f7v5kb8CxNq
	hFznkkRXQTjUNa4vnlmZUc569d16KTHVNQwibqbPtj4v6lCGamRGII2h9fIextxTKcsk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187198-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187198: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=11f6773f198636b80e73fb3f69adc83554860172
X-Osstest-Versions-That:
    libvirt=0caacf47d7b423db9126660fb0382ed56cd077c1
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 09 Aug 2024 14:55:57 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 libvirt              11f6773f198636b80e73fb3f69adc83554860172
baseline version:
 libvirt              0caacf47d7b423db9126660fb0382ed56cd077c1

Last test of basis   187189  2024-08-08 04:18:45 Z    1 days
Testing same since   187198  2024-08-09 04:22:38 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Adam Julis <ajulis@redhat.com>
  Göran Uddeborg <goeran@uddeborg.se>
  Jiri Denemark <jdenemar@redhat.com>
  Michal Privoznik <mprivozn@redhat.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   0caacf47d7..11f6773f19  11f6773f198636b80e73fb3f69adc83554860172 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 15:03:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 15:03:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774830.1185238 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scR92-0006e2-DD; Fri, 09 Aug 2024 15:03:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774830.1185238; Fri, 09 Aug 2024 15:03:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scR92-0006dv-Ad; Fri, 09 Aug 2024 15:03:08 +0000
Received: by outflank-mailman (input) for mailman id 774830;
 Fri, 09 Aug 2024 15:03:07 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=t0+Y=PI=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1scR91-0006do-CV
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 15:03:07 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on2060a.outbound.protection.outlook.com
 [2a01:111:f403:2418::60a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7aa60594-5660-11ef-bc04-fd08da9f4363;
 Fri, 09 Aug 2024 17:03:05 +0200 (CEST)
Received: from CH2PR12CA0005.namprd12.prod.outlook.com (2603:10b6:610:57::15)
 by CH3PR12MB7690.namprd12.prod.outlook.com (2603:10b6:610:14e::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.30; Fri, 9 Aug
 2024 15:03:01 +0000
Received: from CH2PEPF0000013B.namprd02.prod.outlook.com
 (2603:10b6:610:57:cafe::c2) by CH2PR12CA0005.outlook.office365.com
 (2603:10b6:610:57::15) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15 via Frontend
 Transport; Fri, 9 Aug 2024 15:03:01 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CH2PEPF0000013B.mail.protection.outlook.com (10.167.244.68) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Fri, 9 Aug 2024 15:03:01 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 9 Aug
 2024 10:03:01 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 9 Aug
 2024 10:03:00 -0500
Received: from [172.23.60.101] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Fri, 9 Aug 2024 10:03:00 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7aa60594-5660-11ef-bc04-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=uRSWTvPg3Z+CE10oy5bJbsIxAoKzq78yzk8T+qgPSM9VLnEMrKsAOiEBKWX1eYeSO6hxmtoJBnUxaLFC5dRE4ivzom3zmagkCwFZ7qZHH6XnzhMGRtMuHGk84IEy4U+JjXBDWtN323zZmeb+Ri12xGHFUZ4CreGU2ir9v0vP+vDw3WXBVPzmrPQWbBauCYjlkeBm1Ndbyihi6rdS+9jGLeIR0ZRAbRd1/eUvD7Stzq3QtbBzAIyqPzIeNkR6966iX9VeNKJKPuefyq66zLVMgik7SspJNM0lNjRhQ7IjMyBeln0U/2wPnd8cSG9opfnMSxz4XQ/cTe/31O9O2+TzwA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=cAkz170Ih7M27frSyd483osaQDl3KTPtm62XDU8Ygbk=;
 b=n1Yfb1GUvmAZpgHfH3AuTZBqycoXvPeQLuyCcHJG8D2fUS4jQHyiD431SD8L8cz5AqIhf6OQfxCSYMmTDwtDDoyElN8fa0eStXhwMv1f5ucO4rmOwt8CJKJ4EabNIfEimuLC8kje+0JHTiOD2puyww/oFcmtcBvhnxPjrovKBz0XuhKWAvu59+I8JxYfz8LNcsBJQakA12ogQOvx5Rz/n6M+4CnXAmOAM2AHs5tePQHZlSYCEiCrYGORR+MRe0+B1fMoCWlygq2NaUmHgZghMazionnA0aTN266cCJDFrxRWsTGl4XxxhqTF+2nYVkdcysgTSrYyjeulFCnj61nORg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=cAkz170Ih7M27frSyd483osaQDl3KTPtm62XDU8Ygbk=;
 b=W0U/zH5sxsMEq9BkLXwsemj55CWTly+cdHEMr6l4/cGGVc0MjVBnJ1GA6MbTuOuYcCmsKdUD4ZDgFZlfZ/rg8L/AKPJ2FEebWMkugCfbIhBQNboYQcrf9CBXidf9edmdomUMVkj2BJXFJFz9KQDdEPMZc2/LPDCSt+rdjaPp0HY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <7c28c7b2-0af0-4f9f-a171-5d8272254f9b@amd.com>
Date: Fri, 9 Aug 2024 11:02:59 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] x86/msi: fix locking for SR-IOV devices
To: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, Teddy Astie
	<teddy.astie@vates.tech>, <xen-devel@lists.xenproject.org>
References: <20240807052011.582099-1-stewart.hildebrand@amd.com>
 <1b0475fe-4371-4bf7-a469-aa580648f210@suse.com>
 <62523c87-9c93-4b71-a71b-e852fce3136d@amd.com>
 <85a9263b-24cf-47ba-ba83-c2c988dee5c2@suse.com>
Content-Language: en-US
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
In-Reply-To: <85a9263b-24cf-47ba-ba83-c2c988dee5c2@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB05.amd.com: stewart.hildebrand@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH2PEPF0000013B:EE_|CH3PR12MB7690:EE_
X-MS-Office365-Filtering-Correlation-Id: 1972dc46-080f-4964-969c-08dcb8845d27
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|82310400026|376014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?TXIxeXUxWVZxMmFSVmlHdHNURUFucUw0dG05OHJSVFF1b2dWSHI3VzFDd1Ev?=
 =?utf-8?B?dG16RDJjcWNvcWdHKzdQT3Q0bVNqb1FRQ3JyYUt0MVZ2TnQwdDhrVk15bnJi?=
 =?utf-8?B?eFo0N3luK0l0VkFjUmxiSUpQWVZaK05LQitPOER5UGFmQUNMajFYbkJVYXB2?=
 =?utf-8?B?RFh1M3hoNkhyMlJYODg1dVV4alNKN0hEd2ZPb1BFTUw2b1lKZWNOOVNtSDFX?=
 =?utf-8?B?ZHNTS1JQQml5WVp4b2JRZ3A4YnVsMHUxdENzYXpnK2pURVp2d3BWWk9qK0lq?=
 =?utf-8?B?TmJFK0F5U1ZpQjAra2Q0TGU0dnJVZklURHJ0U0FuSW9ZbmlnNERMeldGRDh1?=
 =?utf-8?B?Sy9NTkdwVDdWeUxndXhSVGIwOEphUDZhVFJ0OHF2MFlBMHI5V2xZOHFnRmVt?=
 =?utf-8?B?N2NmVURUd2lWcWxuTjBLQXo3MmlWN2MrRm5xVUxWWGVNUkgrMkc1a2tPZTYy?=
 =?utf-8?B?dnQxUVdOQUNQaFMrdm5vVWdJQUdsRk13OWh3c0dXMktEQXQzTzlFaFNEeG1F?=
 =?utf-8?B?YVNVWGdxNk9Qc0NaeWJ4RTMwYzBsb0hsTHNFK3d3Z1orbWhEM3ZyU0lmMjFU?=
 =?utf-8?B?bTBubVo1K0FCMVU4Q2VUR3VaQWJVbUtvdGtOMjNFa08xaFJEVEc2WUc1VWgz?=
 =?utf-8?B?UERPcVBWVXQwcmF2R2t1T3BIYjJ6R1lydWpldmdDcEU4aG1KQXJYdDJzdm9s?=
 =?utf-8?B?bVZvYVQrV29hYXgxVlkwNjFUanArWFR1QmROdFJxcjdSbGtlalRJdEVRTEZv?=
 =?utf-8?B?dWEwK0pLV21GVmRHTHRFM2dDeDFtaW5FMC9zWDY3TjNnOTNTSUwvSkRPaU1T?=
 =?utf-8?B?VldQQWU1Ni9FV0FTVFFESnExa1lxT1RWeGIrREd6dzZ4a2pPUU5kekJkWVpl?=
 =?utf-8?B?MmdDa2NPZUZrbEJmUlJBb2N2WWpEaHJKTkdPSW02cERSbVkzOFZJMlNQdjJw?=
 =?utf-8?B?LzM2cTFLNHdwc2tVMXNLV2liVnV4a2lUcTBKR0VuL3k4UkZPOTNORThiS0VH?=
 =?utf-8?B?VmpDNVVMTTlHOEs1MlNYQkxSd1k0WG41bDkrMnZLcVN0UkdkZVVYZHNrMVVZ?=
 =?utf-8?B?aXgyWTkwVmJNLy9wWGV6dXZENnBvb2JSb3lJeHpaR0ZYTm9XTHg2c05GTHVG?=
 =?utf-8?B?RWkwQjVlMUdHWjloNzNUclRYOEp1dVR1N1NyTUNKLzNPK3NXSEh6ZlhZUEdz?=
 =?utf-8?B?dkRhbzZDRXJFRmZNRitLR1R1UGhKMXpHSWxzRGVnVUVmb3RadkEwZXErdTlz?=
 =?utf-8?B?ZDJjUmZGNGRSbkxFRjh4c2ovY0FwVE1OeWdYWVYwSFpmdXpCa0g3Y2prQlkx?=
 =?utf-8?B?M3FYQlZBQTlwSkJsZzJ4QzdyMFBGbEZLRGtUVGlVTldZemltMUNMSGVzZENq?=
 =?utf-8?B?c0lyZm40amw1dTd5dzdhbjZKRExyd1JFOXFxL0Z6UzhUcmpJNjFkSGhyUE1v?=
 =?utf-8?B?N2VCNS9jckt0V09QUkxxbzllMGRkQzFnSkp0cWViSElobThQbmdPdGJOZ1hS?=
 =?utf-8?B?VGdqMUlkT0tseHNLaE1xQ1FDemR0bFMzNFNBbEtHVGUzUi9Yc3J3WEx6MjUr?=
 =?utf-8?B?MEZ6THFyMzNOWVhPcjdKUXNqc3JQTFFSVlEyS0ZHNFNjOTk4QUlFbkovc3p6?=
 =?utf-8?B?VmRMekRlSk5WYVdUckJmMmxCR0IwYWx5RXFmZlA0T2lWNTRUb0EyT0dlYVJ1?=
 =?utf-8?B?Z1ArVXdmcmJFaHAwWEpPSitwRW1zc1FzS3pMMDF4dlc5NlhVaVJaSDMyWHB6?=
 =?utf-8?B?d21EUHNNTUJEaU9XY1Vpdm5qWU1LQTdPTGQ0Mnppem9lTXpCelltK2VwZTlw?=
 =?utf-8?B?VlEyaXk0V1ZDaTJodW9tK0FwemJXZWtkeWlHWldwUTVxekhLbzdVZXJEWWM0?=
 =?utf-8?B?MXI1N3A0TjdzMUFFUFVydDJkanpYU3BicjVibmJEQ2RaMWpCOGdMa1M0ZlA3?=
 =?utf-8?Q?V49pg6HD0cK687R2On58iXsDovhzt14W?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(376014)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2024 15:03:01.6274
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 1972dc46-080f-4964-969c-08dcb8845d27
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH2PEPF0000013B.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7690

On 8/9/24 09:05, Jan Beulich wrote:
> On 09.08.2024 06:09, Stewart Hildebrand wrote:
>> On 8/7/24 11:21, Jan Beulich wrote:
>>> On 07.08.2024 07:20, Stewart Hildebrand wrote:
>>>> --- a/xen/arch/x86/msi.c
>>>> +++ b/xen/arch/x86/msi.c
>>>> @@ -662,7 +662,8 @@ static int msi_capability_init(struct pci_dev *dev,
>>>>      return 0;
>>>>  }
>>>>  
>>>> -static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
>>>> +static u64 read_pci_mem_bar(struct pci_dev *pdev, u16 seg, u8 bus, u8 slot,
>>>> +                            u8 func, u8 bir, int vf)
>>>>  {
>>>
>>> First I thought this was a leftover from the earlier version. But you need
>>> it for accessing the vf_rlen[] field. Yet that's properly misleading,
>>> especially when considering that the fix also wants backporting. What pdev
>>> represents here changes. I think you want to pass in just vf_rlen (if we
>>> really want to go this route; I'm a little wary of this repurposing of the
>>> field, albeit I see no real technical issue).
>>
>> I like your idea below of using a struct, so I'll pass a pointer to the
>> new struct.
>>
>>> Of course there's a BUILD_BUG_ON() which we need to get creative with, in
>>> order to now outright drop it (see also below).
>>
>> I suppose this BUILD_BUG_ON() is redundant with the one in
>> pci_add_device()...
> 
> "Redundant" can be positive or negative. Your response sounds as if you
> thought one could be dropped, yet I think we want them in both places.
> 
>>>> --- a/xen/drivers/passthrough/pci.c
>>>> +++ b/xen/drivers/passthrough/pci.c
>>>> @@ -654,6 +654,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>>>>      const char *type;
>>>>      int ret;
>>>>      bool pf_is_extfn = false;
>>>> +    uint64_t vf_rlen[6] = { 0 };
>>>
>>> The type of this variable needs to be tied to that of the struct field
>>> you copy to/from. Otherwise, if the struct field changes type ...
>>>
>>>> @@ -664,7 +665,10 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>>>>                              PCI_SBDF(seg, info->physfn.bus,
>>>>                                       info->physfn.devfn));
>>>>          if ( pdev )
>>>> +        {
>>>>              pf_is_extfn = pdev->info.is_extfn;
>>>> +            memcpy(vf_rlen, pdev->vf_rlen, sizeof(pdev->vf_rlen));
>>>
>>> ... there'll be nothing for the compiler to tell us. Taken together with
>>> the BUILD_BUG_ON() related remark further up, I think you want to
>>> introduce a typedef and/or struct here to make things properly typesafe
>>> (as then you can avoid the use of memcpy()).
>>
>> Here's what I'm thinking:
>>
>> struct vf_info {
>>     uint64_t vf_rlen[PCI_SRIOV_NUM_BARS];
>>     unsigned int refcnt;
>> };
>>
>> struct pci_dev {
>>     ...
>>     struct vf_info *vf_info;
>>     ...
>> };
> 
> I don't (yet) see the need for refcnt, and I also don't see why it wouldn't
> continue to be embedded in struct pci_dev. Specifically ...
> 
>>> An alternative approach might be to add a link from VF to PF, while
>>> making sure that the PF struct won't be de-allocated until all its VFs
>>> have gone away. That would then also allow to eliminate the problematic
>>> pci_get_pdev().
>>
>> I think I can add a link to a new reference-counted struct with just the
>> info needed (see the proposed struct above).
> 
> ... I think having a link from VF to its PF may turn out helpful in the
> future for other purposes, too.

Continue to embed in struct pci_dev: okay.

Link from VF to PF: assuming you mean a link to the PF's
struct pci_dev *, okay.

Ensuring the PF's struct pci_dev * won't be de-allocated until the VFs
are gone: I don't think we want to impose any sort of ordering on
whether the toolstack removes VFs or PFs first. So, if not reference
counting (i.e. how many VFs are referring back to the PF), how else
would we make sure that the PF struct won't be de-allocated until all
its VFs have gone away?


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 16:20:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 16:20:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774849.1185269 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scSLL-00025L-ST; Fri, 09 Aug 2024 16:19:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774849.1185269; Fri, 09 Aug 2024 16:19:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scSLL-00022G-LK; Fri, 09 Aug 2024 16:19:55 +0000
Received: by outflank-mailman (input) for mailman id 774849;
 Fri, 09 Aug 2024 16:19:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=k3r+=PI=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1scSLK-0001id-RW
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 16:19:54 +0000
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com
 [2a00:1450:4864:20::12e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 35b0612c-566b-11ef-bc04-fd08da9f4363;
 Fri, 09 Aug 2024 18:19:53 +0200 (CEST)
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-52ed741fe46so2582278e87.0
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 09:19:53 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530de481f09sm1028479e87.285.2024.08.09.09.19.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 09 Aug 2024 09:19:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 35b0612c-566b-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723220393; x=1723825193; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=vMQ/m8Em6+jACg1WgZvSQBZSi2KQCusY5mxmZJsitEA=;
        b=j3yqyxSeasiMaGZiZBIb7zFnQooYTxnwEgNHn/rgVmjncbZxNuVjUkxMEI05/50PMM
         Y8I0y07SzWILQOY4sWcFVsB9mIkEHbT0LfwtdyGGrgvwDmDrW+VK/DWI3YMJx9LbliDN
         kTaxmv82g9TDvNxPIRsJeTcLKidtxwwIN3hIVHadKmwqSN7M0OGlBvxQR0N/gcP2o1oN
         DrLTqj5bg+J5umKGX2jj0Nc39tv/N1br79XXsnup6XpKkUlpO3XtSyxZec1i/nCwITLm
         9XCUIOhbTqmE1kt864IP+rwJsNelxbP8FrqCcOGOYIDq0pIbgWhLshiJX09JkIW1c3yz
         AIDA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723220393; x=1723825193;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=vMQ/m8Em6+jACg1WgZvSQBZSi2KQCusY5mxmZJsitEA=;
        b=pGOtRqXinuh73Tk/9sE6Wom7koBFG+yYON1blaGCVvVLOnmsz/CMl0kJ3zy2cmyqLD
         TLDJEXtnVKhV06LJIITAoH7QG6ERZLp+OE9YyeF1x7+/hRfHrTP5zJRpiJjkY/aRlQGb
         KTpV/S/eXgiSuvza1WHHj/75i22betjD6Ot1X0R9EPKwOhZBWEX91U0yRzQbbb4RtZtf
         UhyZiu89JLqzfUFw8UnHD60KBNpFmQKzW03cvYONaTbFKVpgTonijZJaRSOb8ngCB20t
         RJyqvm+qVr2B7kE6SNGensIEsEslxQLZ2hd/ALU+srbB8tvbZ8OIkHDrM/vFOK1pcMIl
         6MnQ==
X-Gm-Message-State: AOJu0Yz+aH0wYSBw7J4VFL3GvyjbME9YOeyZwOGydBX7XkvhikZWDTlq
	K/75rrQrgX6mK0DpFFXlCkiBaoEhWAtrrQcKCilN0SF3Ij5VzemBjY97Ag==
X-Google-Smtp-Source: AGHT+IH/Smb9k1/wlShAlTUbaXoh3o1AyCoGOQC/Mh0Dtq3H6aLOHx83lNU3px92Zqf7da/veHvtIQ==
X-Received: by 2002:a05:6512:1383:b0:52f:d128:bd13 with SMTP id 2adb3069b0e04-530eea14528mr1260436e87.39.1723220392336;
        Fri, 09 Aug 2024 09:19:52 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v4 3/7] xen/riscv: introduce asm/pmap.h header
Date: Fri,  9 Aug 2024 18:19:41 +0200
Message-ID: <2b4481a52aa260a95df9eaef3cd249a274699809.1723214540.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1723214540.git.oleksii.kurochko@gmail.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Introduce arch_pmap_{un}map functions and select HAS_PMAP for CONFIG_RISCV.

Add pte_from_mfn() for use in arch_pmap_map().

Introduce flush_xen_tlb_one_local() and use it in arch_pmap_{un}map().

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V4:
 - mark arch_pmap_{un}map() as __init: documentation purpose and
   a necessary (but not sufficient) condition here, to validly
   use local TLB flushes only.
 - add flush_xen_tlb_one_local() to arch_pmap_map() as absense of
   "negative" TLB entrues will be guaranted only in the case
   when Svvptc extension is present.
 - s/mfn_from_pte/pte_from_mfn
 - drop flush_xen_tlb_range_va_local() as it isn't used in this patch
 - drop mfn_to_xen_entry() as pte_from_mfn() does the same thing
 - add flags argument to pte_from_mfn().
 - update the commit message.
 - s/flush_xen_tlb_range_va_local/flush_tlb_range_va_local
---
Changes in V3:
 - rename argument of function mfn_to_xen_entry(..., attr -> flags ).
 - update the code of mfn_to_xen_entry() to use flags argument.
 - add blank in mfn_from_pte() in return line.
 - introduce flush_xen_tlb_range_va_local() and use it inside arch_pmap_{un}map().
 - s/__ASM_PMAP_H__/ASM_PMAP_H
 - add SPDX-License-Identifier: GPL-2.0 
---
 xen/arch/riscv/Kconfig                |  1 +
 xen/arch/riscv/include/asm/flushtlb.h |  6 +++++
 xen/arch/riscv/include/asm/page.h     |  6 +++++
 xen/arch/riscv/include/asm/pmap.h     | 36 +++++++++++++++++++++++++++
 4 files changed, 49 insertions(+)
 create mode 100644 xen/arch/riscv/include/asm/pmap.h

diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index 259eea8d3b..0112aa8778 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -3,6 +3,7 @@ config RISCV
 	select FUNCTION_ALIGNMENT_16B
 	select GENERIC_BUG_FRAME
 	select HAS_DEVICE_TREE
+	select HAS_PMAP
 
 config RISCV_64
 	def_bool y
diff --git a/xen/arch/riscv/include/asm/flushtlb.h b/xen/arch/riscv/include/asm/flushtlb.h
index 7ce32bea0b..f4a735fd6c 100644
--- a/xen/arch/riscv/include/asm/flushtlb.h
+++ b/xen/arch/riscv/include/asm/flushtlb.h
@@ -5,6 +5,12 @@
 #include <xen/bug.h>
 #include <xen/cpumask.h>
 
+/* Flush TLB of local processor for address va. */
+static inline void flush_tlb_one_local(vaddr_t va)
+{
+    asm volatile ( "sfence.vma %0" :: "r" (va) : "memory" );
+}
+
 /*
  * Filter the given set of CPUs, removing those that definitely flushed their
  * TLB since @page_timestamp.
diff --git a/xen/arch/riscv/include/asm/page.h b/xen/arch/riscv/include/asm/page.h
index 5db3edb100..d96db0e322 100644
--- a/xen/arch/riscv/include/asm/page.h
+++ b/xen/arch/riscv/include/asm/page.h
@@ -87,6 +87,12 @@ static inline void write_pte(pte_t *p, pte_t pte)
     *p = pte;
 }
 
+static inline pte_t pte_from_mfn(mfn_t mfn, unsigned int flags)
+{
+    unsigned long pte = (mfn_x(mfn) << PTE_PPN_SHIFT) | flags;
+    return (pte_t){ .pte = pte };
+}
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_RISCV_PAGE_H */
diff --git a/xen/arch/riscv/include/asm/pmap.h b/xen/arch/riscv/include/asm/pmap.h
new file mode 100644
index 0000000000..60065c996f
--- /dev/null
+++ b/xen/arch/riscv/include/asm/pmap.h
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef ASM_PMAP_H
+#define ASM_PMAP_H
+
+#include <xen/bug.h>
+#include <xen/init.h>
+#include <xen/mm.h>
+#include <xen/page-size.h>
+
+#include <asm/fixmap.h>
+#include <asm/flushtlb.h>
+#include <asm/system.h>
+
+static inline void __init arch_pmap_map(unsigned int slot, mfn_t mfn)
+{
+    pte_t *entry = &xen_fixmap[slot];
+    pte_t pte;
+
+    ASSERT(!pte_is_valid(*entry));
+
+    pte = pte_from_mfn(mfn, PAGE_HYPERVISOR_RW);
+    write_pte(entry, pte);
+
+    flush_tlb_one_local(FIXMAP_ADDR(slot));
+}
+
+static inline void __init arch_pmap_unmap(unsigned int slot)
+{
+    pte_t pte = {};
+
+    write_pte(&xen_fixmap[slot], pte);
+
+    flush_tlb_one_local(FIXMAP_ADDR(slot));
+}
+
+#endif /* ASM_PMAP_H */
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 09 16:20:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 16:20:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774852.1185305 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scSLO-000322-RB; Fri, 09 Aug 2024 16:19:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774852.1185305; Fri, 09 Aug 2024 16:19:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scSLO-000300-Ly; Fri, 09 Aug 2024 16:19:58 +0000
Received: by outflank-mailman (input) for mailman id 774852;
 Fri, 09 Aug 2024 16:19: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=k3r+=PI=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1scSLO-0001ij-3j
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 16:19:58 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 37776298-566b-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 18:19:56 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-52f04150796so2878963e87.3
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 09:19:56 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530de481f09sm1028479e87.285.2024.08.09.09.19.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 09 Aug 2024 09:19:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 37776298-566b-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723220396; x=1723825196; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=tZjU7tjw7yR1bbBEbhVz3zSJgKCsTCh3BPJUsr71Vos=;
        b=gZAKfx6AkDFwuKsdVdu31/JbZhQQNy+T6M+8tyWs3QYBpGVeC9PPsfQkbprYke8qk5
         RQ0kbkEjY5Cbg1gehKGmLpf77JjK3PzcD/FqFS4fXjYS+pCc44b9E4xl1burV1gxOewY
         rlgmr0VwRyHJuleHopx3Xh3UpylBc8iPfHmynfQD4fUAFOZ2KT6yHTnWogvI6f6YP/P7
         pOSKsRH9dvyISo/ppfnrvoKg/Ea0sFRHIpuO7Ri9fkTlay5jqWHWx3nfmN9O6RV0/NfD
         NoVc7RbnqvL1O1j1F8z3Zkgbs6eCLFkVZlIRwBTUISB0FFPCTHTB22AelMqv5TzWxpWd
         1jXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723220396; x=1723825196;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=tZjU7tjw7yR1bbBEbhVz3zSJgKCsTCh3BPJUsr71Vos=;
        b=pNog6Hdos8XVwFcuNW6j0SSQ4EuXbwRLSv4Aq2hpiu9yzT6eJ1U6wwPzsmCfPMxY0j
         VyjyJMP+znzIjahpYQYSMjL+lEZR8bMJXs/TRyuU/iY5EnH+hwx9R3wBCv1KaFMQnPnt
         NX9fmjxowx3G0VnJqLutEwN6JJu2/Kjfass9wt6m8c4VZBpskAhrH2RUSrhvGf1l0SLL
         uE/NxZOmERj6pHARjZTVziTUXa9c6+G40fL2/W0E2+dAIEEOueIOx5TVf9jPv850S2xw
         v12D+FRLu/pJwGp86sX1/V8hVwboC7yNK0a0L1cTUZroQDJz1N4D0/LVJ1A3icq5L1Tm
         7yDg==
X-Gm-Message-State: AOJu0YzBnzPE+lmHS7Kw/JDQrKeSxSSRdMwpbcXkXkXAj/NJiunVYnLL
	656wNZ3HRbGM+buJ599sWZyTYuZusazm89Ahe3wCGP5dhWhYOMP0nj6WfQ==
X-Google-Smtp-Source: AGHT+IEMfAmZNvQfwPOK0DuxWEaTHAqUzrKAEacRMR6M+Mqbr1p7KpJDBcoxFWmDl13+aARmZnM3mA==
X-Received: by 2002:a05:6512:ac6:b0:52e:9b68:d2d4 with SMTP id 2adb3069b0e04-530eea1dd3amr1501459e87.56.1723220395451;
        Fri, 09 Aug 2024 09:19:55 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v4 7/7] xen/riscv: introduce early_fdt_map()
Date: Fri,  9 Aug 2024 18:19:45 +0200
Message-ID: <98e304fe55e5420aadde60269b4ffb90d25ac39f.1723214540.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1723214540.git.oleksii.kurochko@gmail.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Introduce function which allows to map FDT to Xen.

Also, initialization of device_tree_flattened happens using
early_fdt_map().

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in V4:
 - s/_PAGE_BLOCK/PTE_BLOCK
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>
 - unwarap two lines in panic() in case when device_tree_flattened is NULL
   so  grep-ing for any part of the message line will always produce a hit.
 - slightly update the commit message.
---
Changes in V3:
 - Code style fixes
 - s/SZ_2M/MB(2)
 - fix condition to check if early_fdt_map() in setup.c return NULL or not.
---
Changes in V2:
 - rework early_fdt_map to use map_pages_to_xen()
 - move call early_fdt_map() to C code after MMU is enabled.
---
 xen/arch/riscv/include/asm/mm.h |  2 ++
 xen/arch/riscv/mm.c             | 55 +++++++++++++++++++++++++++++++++
 xen/arch/riscv/setup.c          |  7 +++++
 3 files changed, 64 insertions(+)

diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index ce1557bb27..4b7b00b850 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -259,4 +259,6 @@ static inline unsigned int arch_get_dma_bitsize(void)
 
 void setup_fixmap_mappings(void);
 
+void *early_fdt_map(paddr_t fdt_paddr);
+
 #endif /* _ASM_RISCV_MM_H */
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index e8430def14..df4d22c112 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -1,13 +1,16 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
+#include <xen/bootfdt.h>
 #include <xen/bug.h>
 #include <xen/compiler.h>
 #include <xen/init.h>
 #include <xen/kernel.h>
+#include <xen/libfdt/libfdt.h>
 #include <xen/macros.h>
 #include <xen/mm.h>
 #include <xen/pfn.h>
 #include <xen/sections.h>
+#include <xen/sizes.h>
 
 #include <asm/early_printk.h>
 #include <asm/csr.h>
@@ -369,3 +372,55 @@ int destroy_xen_mappings(unsigned long s, unsigned long e)
     BUG_ON("unimplemented");
     return -1;
 }
+
+void * __init early_fdt_map(paddr_t fdt_paddr)
+{
+    /* We are using 2MB superpage for mapping the FDT */
+    paddr_t base_paddr = fdt_paddr & XEN_PT_LEVEL_MAP_MASK(1);
+    paddr_t offset;
+    void *fdt_virt;
+    uint32_t size;
+    int rc;
+
+    /*
+     * Check whether the physical FDT address is set and meets the minimum
+     * alignment requirement. Since we are relying on MIN_FDT_ALIGN to be at
+     * least 8 bytes so that we always access the magic and size fields
+     * of the FDT header after mapping the first chunk, double check if
+     * that is indeed the case.
+     */
+    BUILD_BUG_ON(MIN_FDT_ALIGN < 8);
+    if ( !fdt_paddr || fdt_paddr % MIN_FDT_ALIGN )
+        return NULL;
+
+    /* The FDT is mapped using 2MB superpage */
+    BUILD_BUG_ON(BOOT_FDT_VIRT_START % MB(2));
+
+    rc = map_pages_to_xen(BOOT_FDT_VIRT_START, maddr_to_mfn(base_paddr),
+                          MB(2) >> PAGE_SHIFT,
+                          PAGE_HYPERVISOR_RO | PTE_BLOCK);
+    if ( rc )
+        panic("Unable to map the device-tree.\n");
+
+    offset = fdt_paddr % XEN_PT_LEVEL_SIZE(1);
+    fdt_virt = (void *)BOOT_FDT_VIRT_START + offset;
+
+    if ( fdt_magic(fdt_virt) != FDT_MAGIC )
+        return NULL;
+
+    size = fdt_totalsize(fdt_virt);
+    if ( size > BOOT_FDT_VIRT_SIZE )
+        return NULL;
+
+    if ( (offset + size) > MB(2) )
+    {
+        rc = map_pages_to_xen(BOOT_FDT_VIRT_START + MB(2),
+                              maddr_to_mfn(base_paddr + MB(2)),
+                              MB(2) >> PAGE_SHIFT,
+                              PAGE_HYPERVISOR_RO | PTE_BLOCK);
+        if ( rc )
+            panic("Unable to map the device-tree\n");
+    }
+
+    return fdt_virt;
+}
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index a49a8eee90..f7221a80d5 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -2,6 +2,7 @@
 
 #include <xen/bug.h>
 #include <xen/compile.h>
+#include <xen/device_tree.h>
 #include <xen/init.h>
 #include <xen/mm.h>
 
@@ -65,6 +66,12 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
 
     setup_fixmap_mappings();
 
+    device_tree_flattened = early_fdt_map(dtb_addr);
+    if ( !device_tree_flattened )
+        panic("Invalid device tree blob at physical address %#lx. The DTB must be 8-byte aligned and must not exceed %lld bytes in size.\n\n"
+              "Please check your bootloader.\n",
+              dtb_addr, BOOT_FDT_VIRT_SIZE);
+
     printk("All set up\n");
 
     for ( ;; )
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 09 16:20:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 16:20:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774851.1185299 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scSLO-0002tO-9p; Fri, 09 Aug 2024 16:19:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774851.1185299; Fri, 09 Aug 2024 16:19:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scSLO-0002t2-4W; Fri, 09 Aug 2024 16:19:58 +0000
Received: by outflank-mailman (input) for mailman id 774851;
 Fri, 09 Aug 2024 16:19: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=k3r+=PI=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1scSLM-0001ij-OL
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 16:19:56 +0000
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com
 [2a00:1450:4864:20::130])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 36921a09-566b-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 18:19:54 +0200 (CEST)
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-52efd8807aaso2806898e87.3
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 09:19:54 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530de481f09sm1028479e87.285.2024.08.09.09.19.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 09 Aug 2024 09:19:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 36921a09-566b-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723220394; x=1723825194; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=GpgV+5ZGflCKHPBAOBT08hiAvUTxczzsSOmyHFj6wLc=;
        b=KTbHnStR86Bc+sNep60Ktx4FLfHyLSZFxZvr5j+LuNXYkyYVgHnsyofEuka7Xq2G4X
         tqhU5fTgXkWnBq+A2Zpq28Pzmely5so3ykmCAJBXiIdNCzG5tnnDi2U1mzQwTVIh0beN
         7393XrUrryBdmx5FDlnGk6T3a2WOR1E39Mv7jinmj62B9zh/4UGBDb+K3EApjA+gkcMP
         3/+OJQ6EIRgKq3vDs1N9cDFJYygDIeIlgNw7n0DbjmVfNYaxID9CWNRBzW2rV9Bcz2F5
         Bjk5m+i3EaQ4ynBj6wuAZ6wSMbkfbcwH6lBLCPxG7FdHeIgIhGHe3tq78vvBqpLXqyV6
         ZFAQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723220394; x=1723825194;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=GpgV+5ZGflCKHPBAOBT08hiAvUTxczzsSOmyHFj6wLc=;
        b=cg7xZg+KknVZTfzYbERs3keqbAqmHO3sI5s3+gtkJyKdVarhUXKm0rMFx5tBNTnLwh
         be+NZt2fT0dJeUNcAeZYyccEB76WdogYqJvvoKKjn0kq6sp1+HjEEdc49H6qeu/7cx98
         qox29yr6zHApvNp5DqbsNKW+qbUMw6BZVkpAxoZISdUN4MZPkW26X2/lRQR2U9a4SSv4
         vtPt+bMHz7JRp1nQ7qeEjDSvBsS+Y5HtlpOkB1FxTYSg/2PBagTUY/LjFYRH5FldX3W7
         kqhAmEQDWNSgkQSkrOwb+6t19JHvoahjfACd6QMPEyxfROEtZnbjrt7JgSdIlpEh4M8c
         VJXQ==
X-Gm-Message-State: AOJu0YyTlkUFIEJxNLWqjEGQdUSot3/+t52okchwaMHoo/rPuiqWAXOH
	svucXTQfPK8IKbsN1CpdrNE5sk529I+PpRnDnCQpdGx5PtrA3Vz9juDEMQ==
X-Google-Smtp-Source: AGHT+IG2o0qMwqTCFaPJECivbHnFDE5xbiar1f50MIJsOHvhhKAnL/B4XeAAWg1etmmQ3xI2x/YfyQ==
X-Received: by 2002:a05:6512:234b:b0:52c:cca8:a9fb with SMTP id 2adb3069b0e04-530ee9d3920mr1497333e87.42.1723220393860;
        Fri, 09 Aug 2024 09:19:53 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v4 5/7] xen/riscv: introduce and initialize SBI RFENCE extension
Date: Fri,  9 Aug 2024 18:19:43 +0200
Message-ID: <1a863d06866f86761d23e6da3f4a6ee58c474473.1723214540.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1723214540.git.oleksii.kurochko@gmail.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Introduce functions to work with the SBI RFENCE extension for issuing
various fence operations to remote CPUs.

Add the sbi_init() function along with auxiliary functions and macro
definitions for proper initialization and checking the availability of
SBI extensions. Currently, this is implemented only for RFENCE.

Introduce sbi_remote_sfence_vma() to send SFENCE_VMA instructions to
a set of target HARTs. This will support the implementation of
flush_xen_tlb_range_va().

Integrate __sbi_rfence_v02 from Linux kernel 6.6.0-rc4 with minimal
modifications:
 - Adapt to Xen code style.
 - Use cpuid_to_hartid() instead of cpuid_to_hartid_map[].
 - Update BIT(...) to BIT(..., UL).
 - Rename __sbi_rfence_v02_call to __sbi_rfence_v02_real and
   remove the unused arg5.
 - Handle NULL cpu_mask to execute rfence on all CPUs by calling
  __sbi_rfence_v02_real(..., 0UL, -1UL,...) instead of creating hmask.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V4:
 - update the commit message.
 - code style fixes
 - update return type of sbi_has_rfence() from int to bool and drop
   conditional operator inside implementation.
 - Update mapping of SBI_ERR_FAILURE in sbi_err_map_xen_errno().
 - Update return type of sbi_spec_is_0_1() and drop conditional operator
   inside implementation.
 - s/0x%lx/%#lx
 - update the comment above declaration of sbi_remote_sfence_vma() with
   more detailed explanation what the function does.
 - update prototype of sbi_remote_sfence_vma(). Now it receives cpumask_t
   and returns int.
 - refactor __sbi_rfence_v02() take from the Linux kernel as it takes into
   account a case that hart id could be from different hbase. For example,
   the case when hart IDs are the following 0, 3, 65, 2. Or the case when
   hart IDs are unsorted: 0 3 1 2.
 - drop sbi_cpumask_to_hartmask() as it is not needed anymore
 - Update the prototype of sbi_remote_sfence_vma() and implemntation accordingly
   to the fact it returns 'int'.
 - s/flush_xen_tlb_one_local/flush_tlb_one_local
---
Changes in V3:
 - new patch.
---
 xen/arch/riscv/include/asm/sbi.h |  64 ++++++++
 xen/arch/riscv/sbi.c             | 252 ++++++++++++++++++++++++++++++-
 xen/arch/riscv/setup.c           |   3 +
 3 files changed, 318 insertions(+), 1 deletion(-)

diff --git a/xen/arch/riscv/include/asm/sbi.h b/xen/arch/riscv/include/asm/sbi.h
index 0e6820a4ed..931613646d 100644
--- a/xen/arch/riscv/include/asm/sbi.h
+++ b/xen/arch/riscv/include/asm/sbi.h
@@ -12,8 +12,42 @@
 #ifndef __ASM_RISCV_SBI_H__
 #define __ASM_RISCV_SBI_H__
 
+#include <xen/cpumask.h>
+
 #define SBI_EXT_0_1_CONSOLE_PUTCHAR		0x1
 
+#define SBI_EXT_BASE                    0x10
+#define SBI_EXT_RFENCE                  0x52464E43
+
+/* SBI function IDs for BASE extension */
+#define SBI_EXT_BASE_GET_SPEC_VERSION   0x0
+#define SBI_EXT_BASE_GET_IMP_ID         0x1
+#define SBI_EXT_BASE_GET_IMP_VERSION    0x2
+#define SBI_EXT_BASE_PROBE_EXT          0x3
+
+/* SBI function IDs for RFENCE extension */
+#define SBI_EXT_RFENCE_REMOTE_FENCE_I           0x0
+#define SBI_EXT_RFENCE_REMOTE_SFENCE_VMA        0x1
+#define SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID   0x2
+#define SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA       0x3
+#define SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID  0x4
+#define SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA       0x5
+#define SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID  0x6
+
+#define SBI_SPEC_VERSION_MAJOR_SHIFT    24
+#define SBI_SPEC_VERSION_MAJOR_MASK     0x7f
+#define SBI_SPEC_VERSION_MINOR_MASK     0xffffff
+
+/* SBI return error codes */
+#define SBI_SUCCESS             0
+#define SBI_ERR_FAILURE         (-1)
+#define SBI_ERR_NOT_SUPPORTED   (-2)
+#define SBI_ERR_INVALID_PARAM   (-3)
+#define SBI_ERR_DENIED          (-4)
+#define SBI_ERR_INVALID_ADDRESS (-5)
+
+#define SBI_SPEC_VERSION_DEFAULT        0x1
+
 struct sbiret {
     long error;
     long value;
@@ -31,4 +65,34 @@ struct sbiret sbi_ecall(unsigned long ext, unsigned long fid,
  */
 void sbi_console_putchar(int ch);
 
+/*
+ * Check underlying SBI implementation has RFENCE
+ *
+ * @return 1 for supported AND 0 for not-supported
+ */
+bool sbi_has_rfence(void);
+
+/*
+ * Instructs the remote harts to execute one or more SFENCE.VMA
+ * instructions, covering the range of virtual addresses between
+ * start_addr and start_addr + size.
+ *
+ * Returns 0 if IPI was sent to all the targeted harts successfully
+ * or negative value if start_addr or size is not valid.
+ *
+ * @hart_mask a cpu mask containing all the target harts.
+ * @param start virtual address start
+ * @param size virtual address range size
+ */
+int sbi_remote_sfence_vma(cpumask_t *cpu_mask,
+                          unsigned long start_addr,
+                          unsigned long size);
+
+/*
+ * Initialize SBI library
+ *
+ * @return 0 on success, otherwise negative errno on failure
+ */
+int sbi_init(void);
+
 #endif /* __ASM_RISCV_SBI_H__ */
diff --git a/xen/arch/riscv/sbi.c b/xen/arch/riscv/sbi.c
index 0ae166c861..39e46ef859 100644
--- a/xen/arch/riscv/sbi.c
+++ b/xen/arch/riscv/sbi.c
@@ -7,11 +7,23 @@
  * Modified by Bobby Eshleman (bobby.eshleman@gmail.com).
  *
  * Copyright (c) 2019 Western Digital Corporation or its affiliates.
- * Copyright (c) 2021-2023 Vates SAS.
+ * Copyright (c) 2021-2024 Vates SAS.
  */
 
+#include <xen/compiler.h>
+#include <xen/const.h>
+#include <xen/cpumask.h>
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/smp.h>
+
+#include <asm/processor.h>
 #include <asm/sbi.h>
 
+static unsigned long sbi_spec_version = SBI_SPEC_VERSION_DEFAULT;
+static unsigned long sbi_fw_id, sbi_fw_version;
+
 struct sbiret sbi_ecall(unsigned long ext, unsigned long fid,
                         unsigned long arg0, unsigned long arg1,
                         unsigned long arg2, unsigned long arg3,
@@ -38,7 +50,245 @@ struct sbiret sbi_ecall(unsigned long ext, unsigned long fid,
     return ret;
 }
 
+static int sbi_err_map_xen_errno(int err)
+{
+    switch ( err )
+    {
+    case SBI_SUCCESS:
+        return 0;
+    case SBI_ERR_DENIED:
+        return -EACCES;
+    case SBI_ERR_INVALID_PARAM:
+        return -EINVAL;
+    case SBI_ERR_INVALID_ADDRESS:
+        return -EFAULT;
+    case SBI_ERR_NOT_SUPPORTED:
+        return -EOPNOTSUPP;
+    case SBI_ERR_FAILURE:
+        fallthrough;
+    default:
+        return -ENOSYS;
+    };
+}
+
 void sbi_console_putchar(int ch)
 {
     sbi_ecall(SBI_EXT_0_1_CONSOLE_PUTCHAR, 0, ch, 0, 0, 0, 0, 0);
 }
+
+static unsigned long sbi_major_version(void)
+{
+    return (sbi_spec_version >> SBI_SPEC_VERSION_MAJOR_SHIFT) &
+        SBI_SPEC_VERSION_MAJOR_MASK;
+}
+
+static unsigned long sbi_minor_version(void)
+{
+    return sbi_spec_version & SBI_SPEC_VERSION_MINOR_MASK;
+}
+
+static long sbi_ext_base_func(long fid)
+{
+    struct sbiret ret;
+
+    ret = sbi_ecall(SBI_EXT_BASE, fid, 0, 0, 0, 0, 0, 0);
+    if ( !ret.error )
+        return ret.value;
+    else
+        return ret.error;
+}
+
+static int __sbi_rfence_v02_real(unsigned long fid,
+                                 unsigned long hmask, unsigned long hbase,
+                                 unsigned long start, unsigned long size,
+                                 unsigned long arg4)
+{
+    struct sbiret ret = {0};
+    int result = 0;
+
+    switch ( fid )
+    {
+    case SBI_EXT_RFENCE_REMOTE_FENCE_I:
+        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
+                0, 0, 0, 0);
+        break;
+    case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA:
+        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
+                start, size, 0, 0);
+        break;
+    case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID:
+        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
+                start, size, arg4, 0);
+        break;
+    case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA:
+        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
+                start, size, 0, 0);
+        break;
+    case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID:
+        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
+                start, size, arg4, 0);
+        break;
+    case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA:
+        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
+                start, size, 0, 0);
+        break;
+    case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID:
+        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
+                start, size, arg4, 0);
+        break;
+
+    default:
+        printk("%s: unknown function ID [%lu]\n",
+               __func__, fid);
+        result = -EINVAL;
+        break;
+    };
+
+    if ( ret.error )
+    {
+        result = sbi_err_map_xen_errno(ret.error);
+        printk("%s: hbase=%lu hmask=%#lx failed (error %d)\n",
+               __func__, hbase, hmask, result);
+    }
+
+    return result;
+}
+
+static int __sbi_rfence_v02(unsigned long fid,
+                            const cpumask_t *cpu_mask,
+                            unsigned long start, unsigned long size,
+                            unsigned long arg4, unsigned long arg5)
+{
+    unsigned long hartid, cpuid, hmask = 0, hbase = 0, htop = 0;
+    int result;
+
+    /*
+     * hart_mask_base can be set to -1 to indicate that hart_mask can be
+     * ignored and all available harts must be considered.
+     */
+    if ( !cpu_mask )
+        return __sbi_rfence_v02_real(fid, 0UL, -1UL, start, size, arg4);
+
+    for_each_cpu( cpuid, cpu_mask )
+    {
+        hartid = cpuid_to_hartid(cpuid);
+        if ( hmask )
+        {
+            if ( hartid + BITS_PER_LONG <= htop ||
+                 hbase + BITS_PER_LONG <= hartid )
+            {
+                result = __sbi_rfence_v02_real(fid, hmask, hbase,
+                                               start, size, arg4);
+                if ( result )
+                    return result;
+                hmask = 0;
+            }
+            else if ( hartid < hbase )
+            {
+                /* shift the mask to fit lower hartid */
+                hmask <<= hbase - hartid;
+                hbase = hartid;
+            }
+        }
+
+        if ( !hmask )
+        {
+            hbase = hartid;
+            htop = hartid;
+        } else if ( hartid > htop )
+            htop = hartid;
+
+        hmask |= BIT(hartid - hbase, UL);
+    }
+
+    if ( hmask )
+    {
+        result = __sbi_rfence_v02_real(fid, hmask, hbase,
+                                       start, size, arg4);
+        if ( result )
+            return result;
+    }
+
+    return 0;
+}
+
+static int (*__sbi_rfence)(unsigned long fid,
+                           const cpumask_t *cpu_mask,
+                           unsigned long start, unsigned long size,
+                           unsigned long arg4, unsigned long arg5) = NULL;
+
+int sbi_remote_sfence_vma(cpumask_t *cpu_mask,
+                          unsigned long start_addr,
+                          unsigned long size)
+{
+    return __sbi_rfence(SBI_EXT_RFENCE_REMOTE_SFENCE_VMA,
+                        cpu_mask, start_addr, size, 0, 0);
+}
+
+#define sbi_get_spec_version()  \
+    sbi_ext_base_func(SBI_EXT_BASE_GET_SPEC_VERSION)
+
+#define sbi_get_firmware_id()   \
+    sbi_ext_base_func(SBI_EXT_BASE_GET_IMP_ID)
+
+#define sbi_get_firmware_version()  \
+    sbi_ext_base_func(SBI_EXT_BASE_GET_IMP_VERSION)
+
+int sbi_probe_extension(long extid)
+{
+    struct sbiret ret;
+
+    ret = sbi_ecall(SBI_EXT_BASE, SBI_EXT_BASE_PROBE_EXT, extid,
+                    0, 0, 0, 0, 0);
+    if ( !ret.error && ret.value )
+        return ret.value;
+
+    return -EOPNOTSUPP;
+}
+
+static bool sbi_spec_is_0_1(void)
+{
+    return (sbi_spec_version == SBI_SPEC_VERSION_DEFAULT);
+}
+
+bool sbi_has_rfence(void)
+{
+    return (__sbi_rfence != NULL);
+}
+
+int __init sbi_init(void)
+{
+    int ret;
+
+    ret = sbi_get_spec_version();
+    if ( ret > 0 )
+        sbi_spec_version = ret;
+
+    printk("SBI specification v%lu.%lu detected\n",
+            sbi_major_version(), sbi_minor_version());
+
+    if ( !sbi_spec_is_0_1() )
+    {
+        sbi_fw_id = sbi_get_firmware_id();
+        sbi_fw_version = sbi_get_firmware_version();
+
+        printk("SBI implementation ID=%#lx Version=%#lx\n",
+            sbi_fw_id, sbi_fw_version);
+
+        if ( sbi_probe_extension(SBI_EXT_RFENCE) > 0 )
+        {
+            __sbi_rfence = __sbi_rfence_v02;
+            printk("SBI v0.2 RFENCE extension detected\n");
+        }
+    } else {
+        BUG_ON("Ooops. SBI spec veriosn 0.1 detected. Need to add support");
+    }
+
+    if ( !sbi_has_rfence() )
+    {
+        BUG_ON("At the moment flush_xen_tlb_range_va() uses SBI rfence to "
+               "flush TLB for all CPUS!");
+    }
+
+    return 0;
+}
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index c9446e6038..a49a8eee90 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -8,6 +8,7 @@
 #include <public/version.h>
 
 #include <asm/early_printk.h>
+#include <asm/sbi.h>
 #include <asm/smp.h>
 #include <asm/traps.h>
 
@@ -56,6 +57,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
 
     trap_init();
 
+    sbi_init();
+
 #ifdef CONFIG_SELF_TESTS
     test_macros_from_bug_h();
 #endif
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 09 16:20:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 16:20:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774846.1185248 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scSLK-0001j1-NV; Fri, 09 Aug 2024 16:19:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774846.1185248; Fri, 09 Aug 2024 16:19:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scSLK-0001iu-Kz; Fri, 09 Aug 2024 16:19:54 +0000
Received: by outflank-mailman (input) for mailman id 774846;
 Fri, 09 Aug 2024 16:19: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=k3r+=PI=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1scSLJ-0001id-AG
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 16:19:53 +0000
Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com
 [2a00:1450:4864:20::12c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 346ec606-566b-11ef-bc04-fd08da9f4363;
 Fri, 09 Aug 2024 18:19:52 +0200 (CEST)
Received: by mail-lf1-x12c.google.com with SMTP id
 2adb3069b0e04-52efc60a6e6so2985523e87.1
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 09:19:52 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530de481f09sm1028479e87.285.2024.08.09.09.19.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 09 Aug 2024 09:19:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 346ec606-566b-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723220390; x=1723825190; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=HL48kB3/PM+2qrvRUySHv84IqBYDmZ6dcgwMZ9tmLEk=;
        b=QZLr1XgLFpumPtsyzSm/568tAy6+URMlVAEGBkKDYPbsYctFhoMiVw0GYKPvIWOewi
         1DWq2PuQVQ0h0Fv3brJk7pt/RvROE12f/nqZ8wAsTTnk4hL5pfUqXx0W/Y0mrmW9+0xr
         MSuhg7hFZQ7SstErvgogsPIIS5jATaJ05mQhduml8F52bkjGAdfwhJSHqdae7HCJNI9O
         e3wY87dz347JGNJIXin2F1LLqjkxyHIodTwfmOrAI2L5JbFeSxNuXcgL8ZOEexttCLay
         wlGzn019NqcZY+SLvMQYdOlqtulsYPpkkaYZcgROYz3OaX2CU+6u8x2eTsre4MEVqrxR
         bhfw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723220390; x=1723825190;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=HL48kB3/PM+2qrvRUySHv84IqBYDmZ6dcgwMZ9tmLEk=;
        b=P+SUt9mUGb6/6Li6rmJbiOFDPL6unDgWXdQQx43kCEu86DImzkce6niQeNvB7w/NV9
         Cz4sZSQ7v8p5Pm8fcy2MUKIeT5zM634koeSrdnoiKQjYTU5tBAoLtI04LvXEYyfxdZvE
         f9R3JFcBRCaI8B6+ajzVewtjjJKSOCiFQ8eKRfff2+QyVqU/ry439PQfMLekWkEWretU
         IJjOCTNWz2qGdjR1RRU24LXxKs06eG8sMc+QM6GCxN+PuR1KSSH32W5h6Qw8h7VqaqNE
         ZOP8ZA/PvWoztSMcBtFPqOOMSanuF9s546R4QtBauVcjJu+NjB5kMsnHO3dUm+J32wDy
         18KQ==
X-Gm-Message-State: AOJu0Yy3XYDt4kxOK3o42rUtIkILgLmNOOrvQxc57M+KSMRhWjy+3lnf
	4dB5uj0Y65Frh6O7wF65/mRUcpBKIQCcPpyRqp1OELa/cjm+olUQ+fvqYg==
X-Google-Smtp-Source: AGHT+IFe2rLVwxAQT7az1xwUSBCspbo33+hRu2xSXkexa6tOAzF+YFKeQLmpuThDOmFs6Ko3oRzcIg==
X-Received: by 2002:a05:6512:3094:b0:52e:969c:db83 with SMTP id 2adb3069b0e04-530ee9951b8mr1399062e87.17.1723220390054;
        Fri, 09 Aug 2024 09:19:50 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v4 0/7] RISCV device tree mapping
Date: Fri,  9 Aug 2024 18:19:38 +0200
Message-ID: <cover.1723214540.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Current patch series introduces device tree mapping for RISC-V
and necessary things for that such as:
- Fixmap mapping
- pmap
- Xen page table processing

Also there is another one depenency:
RISCV basic exception handling implementation [2]

[2] https://lore.kernel.org/xen-devel/cover.1722960083.git.oleksii.kurochko@gmail.com/T/#t

---
Changes in v4:
 - Drop depedency from common devicre tree patch series as it was merged to
   staging.
 - Update the cover letter message.
 - All other changes are patch specific so please look at the patch.
---
Changes in v3:
 - Introduce SBI RFENCE extension support.
 - Introduce and initialize pcpu_info[] and __cpuid_to_hartid_map[] and functionality
   to work with this arrays.
 - Make page table handling arch specific instead of trying to make it generic.
 - All other changes are patch specific so please look at the patch.
---
Changes in v2:
 - Update the cover letter message
 - introduce fixmap mapping
 - introduce pmap
 - introduce CONFIG_GENREIC_PT
 - update use early_fdt_map() after MMU is enabled.
---

Oleksii Kurochko (7):
  xen/riscv: enable CONFIG_HAS_DEVICE_TREE
  xen/riscv: set up fixmap mappings
  xen/riscv: introduce asm/pmap.h header
  xen/riscv: introduce functionality to work with CPU info
  xen/riscv: introduce and initialize SBI RFENCE extension
  xen/riscv: page table handling
  xen/riscv: introduce early_fdt_map()

 xen/arch/riscv/Kconfig                      |   2 +
 xen/arch/riscv/Makefile                     |   3 +
 xen/arch/riscv/include/asm/config.h         |   8 +
 xen/arch/riscv/include/asm/fixmap.h         |  44 +++
 xen/arch/riscv/include/asm/flushtlb.h       |  19 +
 xen/arch/riscv/include/asm/mm.h             |   6 +
 xen/arch/riscv/include/asm/page.h           |  88 +++++
 xen/arch/riscv/include/asm/pmap.h           |  36 ++
 xen/arch/riscv/include/asm/processor.h      |  28 +-
 xen/arch/riscv/include/asm/riscv_encoding.h |   1 +
 xen/arch/riscv/include/asm/sbi.h            |  64 +++
 xen/arch/riscv/include/asm/smp.h            |  10 +
 xen/arch/riscv/mm.c                         | 101 ++++-
 xen/arch/riscv/pt.c                         | 408 ++++++++++++++++++++
 xen/arch/riscv/sbi.c                        | 252 +++++++++++-
 xen/arch/riscv/setup.c                      |  26 ++
 xen/arch/riscv/smp.c                        |   4 +
 xen/arch/riscv/smpboot.c                    |  12 +
 xen/arch/riscv/xen.lds.S                    |   2 +-
 19 files changed, 1104 insertions(+), 10 deletions(-)
 create mode 100644 xen/arch/riscv/include/asm/fixmap.h
 create mode 100644 xen/arch/riscv/include/asm/pmap.h
 create mode 100644 xen/arch/riscv/pt.c
 create mode 100644 xen/arch/riscv/smp.c
 create mode 100644 xen/arch/riscv/smpboot.c

-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 09 16:20:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 16:20:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774850.1185289 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scSLN-0002e5-1b; Fri, 09 Aug 2024 16:19:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774850.1185289; Fri, 09 Aug 2024 16:19:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scSLM-0002dU-Tx; Fri, 09 Aug 2024 16:19:56 +0000
Received: by outflank-mailman (input) for mailman id 774850;
 Fri, 09 Aug 2024 16:19:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=k3r+=PI=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1scSLL-0001id-Re
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 16:19:55 +0000
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com
 [2a00:1450:4864:20::132])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3612a421-566b-11ef-bc04-fd08da9f4363;
 Fri, 09 Aug 2024 18:19:54 +0200 (CEST)
Received: by mail-lf1-x132.google.com with SMTP id
 2adb3069b0e04-52f025ab3a7so2906312e87.2
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 09:19:54 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530de481f09sm1028479e87.285.2024.08.09.09.19.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 09 Aug 2024 09:19:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3612a421-566b-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723220393; x=1723825193; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=UqQH7oDoSogjwT+iqJj3r10A5kWJSmwBWLYEG7TX9Q0=;
        b=T+QxAmyMRwwZEEGS5U8rtiyLlZiyusRu+9VeFy0tSASNSGPSFU7FNeb5ASrMKr205A
         87mtgUyaNd3NsbhsZc5XUi1wTuXNWkcdP3TgEQ2jpUi5XzopzdNwRH2JzzHboNUrim3X
         HXtB3zC9MOMd0Z2rxIG2A8PDXdJuIoaWQcjaoP6Ut3g2/GGTB4+k3L/KAKMrhiKn2Rp2
         YV+j/6XrGqBAEIe56KOXLvWGBAlm8uakOF7AUQ7w6FATXbNljQO60+evsXIY0/ASJ7ha
         9kJ7VSyR6rHA46zsQJhIEaMyU0v3a/fEbO6AWhZTcf9bX9tAwQTnfMMg1xrpbQKkl+7k
         Ht1A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723220393; x=1723825193;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=UqQH7oDoSogjwT+iqJj3r10A5kWJSmwBWLYEG7TX9Q0=;
        b=E2vlPrsvWkAFNUI/zkmxo3RzH27BcA3wh7mhjhjZAt6KoyfL/420Llp+7vwahJza8x
         yUJTMaYA4oaj5HH4qhCArdUcpKVGhYSYtHhiymtfb7Rx6EzfrRRrCYW5zl2kLNZZGeXf
         7AVbIF+VuR7yyUPthgrt+OytDIjjHg7bV/2uGHDIql69C6hemKZ/vTp1JuGeP5OTuVLm
         jw0Abf2bZKiNXuBT2tql57Yw58m4ZxS5iLOFYQV3fRw+KMyM9mT6rBCNJEt2WdOb+1qH
         toK0MuTlufN6aqsxhlzhNdOq23f2txyiRR+Qi6E88qMQscqlsJQkJicx6ZU0uaBkJItW
         w71Q==
X-Gm-Message-State: AOJu0YzaGLQYDx3YXBjHIn0S9eAI14SIbilCv1XbAnEHU9f/wn9o+Sud
	w2Yttf0o5BNlJX3G4mD4CyEMlD06Jkgu95d4v0JKQkWQsdiEOJaKl/X0YQ==
X-Google-Smtp-Source: AGHT+IGPams98PZ3h+60/YlM+HYkwUopLU140INJc/Df18zVWjnLr7hzl+LfTo5ULVe8x0gU1tQtwA==
X-Received: by 2002:a05:6512:ea2:b0:52f:228:cf80 with SMTP id 2adb3069b0e04-530ee9b76c9mr1668389e87.40.1723220393085;
        Fri, 09 Aug 2024 09:19:53 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v4 4/7] xen/riscv: introduce functionality to work with CPU info
Date: Fri,  9 Aug 2024 18:19:42 +0200
Message-ID: <452e2960d1f064a2e3abcaae1ac354f48aafd24c.1723214540.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1723214540.git.oleksii.kurochko@gmail.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Introduce struct pcpu_info to store pCPU-related information.
Initially, it includes only processor_id, but it will be extended
to include guest CPU information and temporary variables for
saving/restoring vCPU registers.

Add set_processor_id() and get_processor_id() functions to set
and retrieve the processor_id stored in pcpu_info.

Introduce cpuid_to_hartid_map[NR_CPUS] to map Xen logical CPUs to
hart IDs (physical CPU IDs). Add auxiliary macros cpuid_to_hartid()
for convenient access to this mapping.

Define smp_processor_id() to provide accurate information,
replacing the previous "dummy" value of 0.

Initialize tp registers to point to pcpu_info[0].
Set processor_id to 0 for logical CPU 0 and store the physical CPU ID
for the current logical CPU in cpuid_to_hartid_map[].

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V4:
 - wrap id with () inside set_processor_id().
 - code style fixes
 - update BUG_ON(id > NR_CPUS) in smp_processor_id() and drop the comment
   above BUG_ON().
 - s/__cpuid_to_hartid_map/cpuid_to_hartid_map
 - s/cpuid_to_hartid_map/cpuid_to_harti ( here cpuid_to_hartid_map is the name
   of the macros ).
 - update the commit message above the code of TP register initialization in
   start_xen().
 - s/smp_setup_processor_id/smp_setup_bootcpu_id
 - update the commit message.
 - cleanup headers which are included in <asm/processor.h>
---
Changes in V3:
 - new patch.
---
 xen/arch/riscv/Makefile                |  2 ++
 xen/arch/riscv/include/asm/processor.h | 28 ++++++++++++++++++++++++--
 xen/arch/riscv/include/asm/smp.h       | 10 +++++++++
 xen/arch/riscv/setup.c                 | 14 +++++++++++++
 xen/arch/riscv/smp.c                   |  4 ++++
 xen/arch/riscv/smpboot.c               | 12 +++++++++++
 6 files changed, 68 insertions(+), 2 deletions(-)
 create mode 100644 xen/arch/riscv/smp.c
 create mode 100644 xen/arch/riscv/smpboot.c

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 81b77b13d6..334fd24547 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -4,6 +4,8 @@ obj-y += mm.o
 obj-$(CONFIG_RISCV_64) += riscv64/
 obj-y += sbi.o
 obj-y += setup.o
+obj-y += smp.o
+obj-y += smpboot.o
 obj-y += stubs.o
 obj-y += traps.o
 obj-y += vm_event.o
diff --git a/xen/arch/riscv/include/asm/processor.h b/xen/arch/riscv/include/asm/processor.h
index 3ae164c265..fd4e9b4a37 100644
--- a/xen/arch/riscv/include/asm/processor.h
+++ b/xen/arch/riscv/include/asm/processor.h
@@ -12,8 +12,32 @@
 
 #ifndef __ASSEMBLY__
 
-/* TODO: need to be implemeted */
-#define smp_processor_id() 0
+#include <xen/bug.h>
+
+register struct pcpu_info *tp asm ("tp");
+
+struct pcpu_info {
+    unsigned int processor_id;
+};
+
+/* tp points to one of these */
+extern struct pcpu_info pcpu_info[NR_CPUS];
+
+#define get_processor_id()      (tp->processor_id)
+#define set_processor_id(id)    do { \
+    tp->processor_id = (id);         \
+} while (0)
+
+static inline unsigned int smp_processor_id(void)
+{
+    unsigned int id;
+
+    id = get_processor_id();
+
+    BUG_ON(id > NR_CPUS);
+
+    return id;
+}
 
 /* On stack VCPU state */
 struct cpu_user_regs
diff --git a/xen/arch/riscv/include/asm/smp.h b/xen/arch/riscv/include/asm/smp.h
index b1ea91b1eb..9f49d2bc8b 100644
--- a/xen/arch/riscv/include/asm/smp.h
+++ b/xen/arch/riscv/include/asm/smp.h
@@ -5,6 +5,8 @@
 #include <xen/cpumask.h>
 #include <xen/percpu.h>
 
+#define INVALID_HARTID UINT_MAX
+
 DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
 DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
 
@@ -14,6 +16,14 @@ DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
  */
 #define park_offline_cpus false
 
+void smp_set_bootcpu_id(unsigned long boot_cpu_hartid);
+
+/*
+ * Mapping between linux logical cpu index and hartid.
+ */
+extern unsigned long cpuid_to_hartid_map[NR_CPUS];
+#define cpuid_to_hartid(cpu) cpuid_to_hartid_map[cpu]
+
 #endif
 
 /*
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index 13f0e8c77d..c9446e6038 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -8,6 +8,7 @@
 #include <public/version.h>
 
 #include <asm/early_printk.h>
+#include <asm/smp.h>
 #include <asm/traps.h>
 
 void arch_get_xen_caps(xen_capabilities_info_t *info)
@@ -40,6 +41,19 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
 {
     remove_identity_mapping();
 
+    /*
+     * tp register contains an address of physical cpu information.
+     * So write physical CPU info of boot cpu to tp register
+     * It will be used later by get_processor_id() ( look at
+     * <asm/processor.h> ):
+     *   #define get_processor_id()    (tp->processor_id)
+     */
+    asm volatile ( "mv tp, %0" : : "r"((unsigned long)&pcpu_info[0]) );
+
+    set_processor_id(0);
+
+    smp_set_bootcpu_id(bootcpu_id);
+
     trap_init();
 
 #ifdef CONFIG_SELF_TESTS
diff --git a/xen/arch/riscv/smp.c b/xen/arch/riscv/smp.c
new file mode 100644
index 0000000000..779d955e3a
--- /dev/null
+++ b/xen/arch/riscv/smp.c
@@ -0,0 +1,4 @@
+#include <xen/smp.h>
+
+/* tp points to one of these per cpu */
+struct pcpu_info pcpu_info[NR_CPUS];
diff --git a/xen/arch/riscv/smpboot.c b/xen/arch/riscv/smpboot.c
new file mode 100644
index 0000000000..6690522a52
--- /dev/null
+++ b/xen/arch/riscv/smpboot.c
@@ -0,0 +1,12 @@
+#include <xen/init.h>
+#include <xen/sections.h>
+#include <xen/smp.h>
+
+unsigned long cpuid_to_hartid_map[NR_CPUS] __ro_after_init = {
+    [0 ... NR_CPUS - 1] = INVALID_HARTID
+};
+
+void __init smp_set_bootcpu_id(unsigned long boot_cpu_hartid)
+{
+    cpuid_to_hartid(0) = boot_cpu_hartid;
+}
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 09 16:20:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 16:20:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774853.1185318 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scSLQ-0003O8-5Q; Fri, 09 Aug 2024 16:20:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774853.1185318; Fri, 09 Aug 2024 16:20:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scSLQ-0003N5-0q; Fri, 09 Aug 2024 16:20:00 +0000
Received: by outflank-mailman (input) for mailman id 774853;
 Fri, 09 Aug 2024 16:19: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=k3r+=PI=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1scSLO-0001ij-OX
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 16:19:58 +0000
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com
 [2a00:1450:4864:20::132])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 373781ff-566b-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 18:19:56 +0200 (CEST)
Received: by mail-lf1-x132.google.com with SMTP id
 2adb3069b0e04-52ed741fe46so2582337e87.0
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 09:19:56 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530de481f09sm1028479e87.285.2024.08.09.09.19.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 09 Aug 2024 09:19:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 373781ff-566b-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723220395; x=1723825195; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=8AZqpn/vuySXbDV9hKMxfpPsYMsIP1Be1fWVrZj6Y7E=;
        b=mPS0DPo7xN0xHylwEq7JFVav0C50scY76XR5tEqhtyk0uRnaFRS9dpu2dFyn7FQ3rP
         irQV6FE3xCG0q9nOGxIhLuQUxXBSY3St9AQoeMrMd7nndbOCtG/Pu6IJXgQV89f5JVXm
         Al++LMVyqaeq0ZFpOUiPiCvauJNYixX6zsTkNzES1EYVabEeccKGKFafiwLVa4W+1T5f
         jOPdFGM3MFNf9oQqcrzk/R0DjsARuxO18FzT9DeybKvD4TMqVoXnpREFibytlYaH4X4+
         16G7TLu6ArIOsdNQW/SOJ4xviRWahZvjgBFLcJWni9KA1cqH0/YBY+LoAb0Rhl0uwX0e
         gYSg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723220395; x=1723825195;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=8AZqpn/vuySXbDV9hKMxfpPsYMsIP1Be1fWVrZj6Y7E=;
        b=ELD07yKkYGfWNSNKvdJGDjQAjuAZNJNW4U5oCI+8zxi9glX8evnFmQCpkZBOQFgWt9
         n9oy23B6SKsYs/E/5o2hwlsGajSbl4glB7GhJ5wEXfXotpLk/p099KXVVLo8BZEyTDBe
         UIZei/ZxUOM7qOe8cuuV3MB+8dh1+XpCYp3yD98+V/vVbYu/1tWZGGWhQf6V0tBI2mta
         VFDEccFpF79GS5T8Udo4hKcduKaReYP1D6KOi/l7BRzcONi1D2jeAwUaHJhgdoyHOyMU
         aG6WBwMCVYx8RjLTHKL34IJWgamEYmbPFTDAHsLhGMGJ4fDEbjAnkEoqzer/ihvBxWJb
         SBmw==
X-Gm-Message-State: AOJu0YxyUtjuKOrdx1wfS7oDnv1bpAyGXyKEWDTjaUGLaNhPPkCKDnHm
	j0ipmaMfiOHixJexbpqgnYSxFvQZrM7w5YU4gj0j2MJcqR73440uwK0ztQ==
X-Google-Smtp-Source: AGHT+IHoI4PvUXrDPfHiv6ps732wzeUfztjJFbU08renNA8ZqUMhQoumtTy5wvABMJS8Xu680I1AwQ==
X-Received: by 2002:a05:6512:3ba4:b0:530:c323:46a8 with SMTP id 2adb3069b0e04-530ee9bc0edmr1587783e87.23.1723220394662;
        Fri, 09 Aug 2024 09:19:54 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v4 6/7] xen/riscv: page table handling
Date: Fri,  9 Aug 2024 18:19:44 +0200
Message-ID: <8362795280a48702bef6f01d41d148edcf299935.1723214540.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1723214540.git.oleksii.kurochko@gmail.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Implement map_pages_to_xen() which requires several
functions to manage page tables and entries:
- pt_update()
- pt_mapping_level()
- pt_update_entry()
- pt_next_level()
- pt_check_entry()

To support these operations, add functions for creating,
mapping, and unmapping Xen tables:
- create_xen_table()
- xen_map_table()
- xen_unmap_table()

Introduce internal macros starting with PTE_* for convenience.
These macros closely resemble PTE bits, with the exception of
PTE_BLOCK, which indicates that a page larger than 4KB is
needed.
RISC-V detects superpages using `pte.x` and `pte.r`, as there
is no specific bit in the PTE for this purpose. From the RISC-V spec:
```
  ...
  4. Otherwise, the PTE is valid. If pte.r = 1 or pte.x = 1, go to step 5.
     Otherwise, this PTE is a pointer to the next level of the page table.
     ... .
  5. A leaf PTE has been found.
     ...
  ...
```

The code doesn’t support super page shattering so 4KB pages are used as
default.
Additionaly as mentioed in RISC-V priviliged spec:
```
 After much deliberation, we have settled on a conventional page size of
 4 KiB for both RV32 and RV64. We expect this decision to ease the porting
 of low-level runtime software and device drivers.

 The TLB reach problem is ameliorated by transparent superpage support in
 modern operating systems [2]. Additionally, multi-level TLB hierarchies
 are quite inexpensive relative to the multi-level cache hierarchies whose
 address space they map.

 [2] Juan Navarro, Sitaram Iyer, Peter Druschel, and Alan Cox. Practical,
     transparent operating system support for superpages.
     SIGOPS Oper. Syst. Rev., 36(SI):89–104, December 2002.
```

In addition introduce flush_tlb_range_va() for TLB flushing across
CPUs after updating the PTE for the requested mapping.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V4:
 - update the commit message.
 - drop xen_ prefix for functions: xen_pt_update(), xen_pt_mapping_level(),
   xen_pt_update_entry(), xen_pt_next_level(), xen_pt_check_entry().
 - drop 'select GENERIC_PT' for CONFIG_RISCV. There is no GENERIC_PT anymore.
 - update implementation of flush_xen_tlb_range_va and s/flush_xen_tlb_range_va/flush_tlb_range_va
 - s/pte_get_mfn/mfn_from_pte. Others similar definitions I decided not to touch as
   they were introduced before and this patter of naming such type of macros will be applied
   for newly introduced macros.
 - drop _PAGE_* definitions and use analogues of PTE_*.
 - introduce PTE_{W,X,R}_MASK and drop PAGE_{XN,W,X}_MASK. Also drop _PAGE_{*}_BIT
 - introduce PAGE_HYPERVISOR_RX.
 - drop unused now l3_table_offset.
 - drop struct pt_t as it was used only for one function. If it will be needed in the future
   pt_t will be re-introduced.
 - code styles fixes in pte_is_table(). drop level argument from t.
 - update implementation and prototype of pte_is_mapping().
 - drop level argument from pt_next_level().
 - introduce definition of SATP_PPN_MASK.
 - isolate PPN of CSR_SATP before shift by PAGE_SHIFT.
 - drop set_permission() functions as it is not used more then once.
 - update prototype of pt_check_entry(): drop level argument as it is not used.
 - pt_check_entry():
   - code style fixes
   - update the sanity check when modifying an entry
   - update the sanity check when when removing a mapping.
 - s/read_only/alloc_only.
 - code style fixes for pt_next_level().
 - pt_update_entry() changes:
   - drop arch_level variable inisde pt_update_entry()
   - drop convertion near virt to paddr_t in DECLARE_OFFSETS(offsets, virt);
   - pull out "goto out inside first 'for' cycle.
   - drop braces for 'if' cases which has only one line.
   - ident 'out' label with one blank.
   - update the comment above alloc_only and also definition to take into
     account  that if pte population was requested or not.
   - drop target variable and rename arch_target argument of the function to
     target.
 - pt_mapping_level() changes:
   - move the check if PTE_BLOCK should be mapped on the top of the function.
   - change int i to unsigned int and update 'for' cycle correspondingly.
 - update prototye of pt_update():
   - drop the comment  above nr_mfns and drop const to be consistent with other
     arguments.
   - always flush TLB at the end of the function as non-present entries can be put
     in the TLB.
   - add fence before TLB flush to ensure that PTEs are all updated before flushing.
 - s/XEN_TABLE_NORMAL_PAGE/XEN_TABLE_NORMAL
 - add a check in map_pages_to_xen() the mfn is not INVALID_MFN.
 - add the comment on top of pt_update() how mfn = INVALID_MFN is considered.
 - s/_PAGE_BLOCK/PTE_BLOCK.
 - add the comment with additional explanation for PTE_BLOCK.
 - drop defintion of FIRST_SIZE as it isn't used.
---
Changes in V3:
 - new patch. ( Technically it is reworked version of the generic approach
   which I tried to suggest in the previous version )
---

 xen/arch/riscv/Makefile                     |   1 +
 xen/arch/riscv/include/asm/flushtlb.h       |  13 +
 xen/arch/riscv/include/asm/mm.h             |   2 +
 xen/arch/riscv/include/asm/page.h           |  76 ++++
 xen/arch/riscv/include/asm/riscv_encoding.h |   1 +
 xen/arch/riscv/mm.c                         |   9 -
 xen/arch/riscv/pt.c                         | 408 ++++++++++++++++++++
 7 files changed, 501 insertions(+), 9 deletions(-)
 create mode 100644 xen/arch/riscv/pt.c

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 334fd24547..d058ea4e95 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -1,6 +1,7 @@
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += entry.o
 obj-y += mm.o
+obj-y += pt.o
 obj-$(CONFIG_RISCV_64) += riscv64/
 obj-y += sbi.o
 obj-y += setup.o
diff --git a/xen/arch/riscv/include/asm/flushtlb.h b/xen/arch/riscv/include/asm/flushtlb.h
index f4a735fd6c..d18b416a60 100644
--- a/xen/arch/riscv/include/asm/flushtlb.h
+++ b/xen/arch/riscv/include/asm/flushtlb.h
@@ -5,12 +5,25 @@
 #include <xen/bug.h>
 #include <xen/cpumask.h>
 
+#include <asm/sbi.h>
+
 /* Flush TLB of local processor for address va. */
 static inline void flush_tlb_one_local(vaddr_t va)
 {
     asm volatile ( "sfence.vma %0" :: "r" (va) : "memory" );
 }
 
+/*
+ * Flush a range of VA's hypervisor mappings from the TLB of all
+ * processors in the inner-shareable domain.
+ */
+static inline void flush_tlb_range_va(vaddr_t va,
+                                      size_t size)
+{
+    BUG_ON(!sbi_has_rfence());
+    sbi_remote_sfence_vma(NULL, va, size);
+}
+
 /*
  * Filter the given set of CPUs, removing those that definitely flushed their
  * TLB since @page_timestamp.
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index a0bdc2bc3a..ce1557bb27 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -42,6 +42,8 @@ static inline void *maddr_to_virt(paddr_t ma)
 #define virt_to_mfn(va)     __virt_to_mfn(va)
 #define mfn_to_virt(mfn)    __mfn_to_virt(mfn)
 
+#define mfn_from_pte(pte) maddr_to_mfn(pte_to_paddr(pte))
+
 struct page_info
 {
     /* Each frame can be threaded onto a doubly-linked list. */
diff --git a/xen/arch/riscv/include/asm/page.h b/xen/arch/riscv/include/asm/page.h
index d96db0e322..0deb1d36aa 100644
--- a/xen/arch/riscv/include/asm/page.h
+++ b/xen/arch/riscv/include/asm/page.h
@@ -20,6 +20,11 @@
 #define XEN_PT_LEVEL_MAP_MASK(lvl)  (~(XEN_PT_LEVEL_SIZE(lvl) - 1))
 #define XEN_PT_LEVEL_MASK(lvl)      (VPN_MASK << XEN_PT_LEVEL_SHIFT(lvl))
 
+/*
+ * PTE format:
+ * | XLEN-1  10 | 9             8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0
+ *       PFN      reserved for SW   D   A   G   U   X   W   R   V
+ */
 #define PTE_VALID                   BIT(0, UL)
 #define PTE_READABLE                BIT(1, UL)
 #define PTE_WRITABLE                BIT(2, UL)
@@ -33,15 +38,72 @@
 #define PTE_LEAF_DEFAULT            (PTE_VALID | PTE_READABLE | PTE_WRITABLE)
 #define PTE_TABLE                   (PTE_VALID)
 
+#define PAGE_HYPERVISOR_RO          (PTE_VALID | PTE_READABLE)
 #define PAGE_HYPERVISOR_RW          (PTE_VALID | PTE_READABLE | PTE_WRITABLE)
+#define PAGE_HYPERVISOR_RX          (PTE_VALID | PTE_READABLE | PTE_EXECUTABLE)
 
 #define PAGE_HYPERVISOR             PAGE_HYPERVISOR_RW
 
+
+/*
+ * There are no such bits in PTE format for RISC-V.
+ *
+ * The code doesn’t support super page shattering so at the moment superpages
+ * can't be used as a default so PTE_BLOCK is introduced to have ability to
+ * tell that superpage should be allocated.
+ * Additionaly as mentioed in RISC-V priviliged spec:
+ * ```
+ *  After much deliberation, we have settled on a conventional page size of
+ *  4 KiB for both RV32 and RV64. We expect this decision to ease the porting
+ *  of low-level runtime software and device drivers.
+ *
+ *  The TLB reach problem is ameliorated by transparent superpage support in
+ *  modern operating systems [2]. Additionally, multi-level TLB hierarchies
+ *  are quite inexpensive relative to the multi-level cache hierarchies whose
+ *  address space they map.
+ *
+ *  [2] Juan Navarro, Sitaram Iyer, Peter Druschel, and Alan Cox. Practical,
+ *      transparent operating system support for superpages.
+ *      SIGOPS Oper. Syst. Rev., 36(SI):89–104, December 2002.
+ * ```
+ *
+ * PTE_POPULATE is introduced to have ability to tell that page tables
+ * shoud be populated.
+ */
+#define PTE_BLOCK       BIT(10, UL)
+#define PTE_POPULATE    BIT(11, UL)
+
+#define PTE_R_MASK(x)   ((x) & PTE_READABLE)
+#define PTE_W_MASK(x)   ((x) & PTE_WRITABLE)
+#define PTE_X_MASK(x)   ((x) & PTE_EXECUTABLE)
+
+#define PTE_RWX_MASK(x) ((x) & (PTE_READABLE | PTE_WRITABLE | PTE_EXECUTABLE))
+
 /* Calculate the offsets into the pagetables for a given VA */
 #define pt_linear_offset(lvl, va)   ((va) >> XEN_PT_LEVEL_SHIFT(lvl))
 
 #define pt_index(lvl, va) (pt_linear_offset((lvl), (va)) & VPN_MASK)
 
+#define TABLE_OFFSET(offs) (_AT(unsigned int, offs) & ((_AC(1, U) << PAGETABLE_ORDER) - 1))
+
+#if RV_STAGE1_MODE > SATP_MODE_SV48
+#error "need to to update DECLARE_OFFSETS macros"
+#else
+
+#define l0_table_offset(va) TABLE_OFFSET(pt_linear_offset(0, va))
+#define l1_table_offset(va) TABLE_OFFSET(pt_linear_offset(1, va))
+#define l2_table_offset(va) TABLE_OFFSET(pt_linear_offset(2, va))
+
+/* Generate an array @var containing the offset for each level from @addr */
+#define DECLARE_OFFSETS(var, addr)          \
+    const unsigned int var[] = {            \
+        l0_table_offset(addr),              \
+        l1_table_offset(addr),              \
+        l2_table_offset(addr),              \
+    }
+
+#endif
+
 /* Page Table entry */
 typedef struct {
 #ifdef CONFIG_RISCV_64
@@ -67,6 +129,20 @@ static inline bool pte_is_valid(pte_t p)
     return p.pte & PTE_VALID;
 }
 
+inline bool pte_is_table(const pte_t p)
+{
+    return ((p.pte & (PTE_VALID |
+                      PTE_READABLE |
+                      PTE_WRITABLE |
+                      PTE_EXECUTABLE)) == PTE_VALID);
+}
+
+static inline bool pte_is_mapping(const pte_t p)
+{
+    return (p.pte & PTE_VALID) &&
+           ((p.pte & PTE_WRITABLE) || (p.pte & PTE_EXECUTABLE));
+}
+
 static inline void invalidate_icache(void)
 {
     BUG_ON("unimplemented");
diff --git a/xen/arch/riscv/include/asm/riscv_encoding.h b/xen/arch/riscv/include/asm/riscv_encoding.h
index 58abe5eccc..1a05d06597 100644
--- a/xen/arch/riscv/include/asm/riscv_encoding.h
+++ b/xen/arch/riscv/include/asm/riscv_encoding.h
@@ -164,6 +164,7 @@
 #define SSTATUS_SD			SSTATUS64_SD
 #define SATP_MODE			SATP64_MODE
 #define SATP_MODE_SHIFT			SATP64_MODE_SHIFT
+#define SATP_PPN_MASK			_ULL(0x00000FFFFFFFFFFF)
 
 #define HGATP_PPN			HGATP64_PPN
 #define HGATP_VMID_SHIFT		HGATP64_VMID_SHIFT
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index b8ff91cf4e..e8430def14 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -369,12 +369,3 @@ int destroy_xen_mappings(unsigned long s, unsigned long e)
     BUG_ON("unimplemented");
     return -1;
 }
-
-int map_pages_to_xen(unsigned long virt,
-                     mfn_t mfn,
-                     unsigned long nr_mfns,
-                     unsigned int flags)
-{
-    BUG_ON("unimplemented");
-    return -1;
-}
diff --git a/xen/arch/riscv/pt.c b/xen/arch/riscv/pt.c
new file mode 100644
index 0000000000..25f69c899b
--- /dev/null
+++ b/xen/arch/riscv/pt.c
@@ -0,0 +1,408 @@
+#include <xen/bug.h>
+#include <xen/domain_page.h>
+#include <xen/errno.h>
+#include <xen/mm.h>
+#include <xen/mm-frame.h>
+#include <xen/pmap.h>
+#include <xen/spinlock.h>
+
+#include <asm/flushtlb.h>
+#include <asm/page.h>
+
+static inline const mfn_t get_root_page(void)
+{
+    unsigned long root_maddr =
+        (csr_read(CSR_SATP) & SATP_PPN_MASK) << PAGE_SHIFT;
+
+    return maddr_to_mfn(root_maddr);
+}
+
+/*
+ * Sanity check of the entry
+ * mfn is not valid and we are not populating page table. This means
+ * we either modify entry or remove an entry.
+ */
+static bool pt_check_entry(pte_t entry, mfn_t mfn, unsigned int flags)
+{
+    /* Sanity check when modifying an entry. */
+    if ( (flags & PTE_VALID) && mfn_eq(mfn, INVALID_MFN) )
+    {
+        /* We don't allow modifying an invalid entry. */
+        if ( !pte_is_valid(entry) )
+        {
+            printk("Modifying invalid entry is not allowed.\n");
+            return false;
+        }
+
+        /* We don't allow modifying a table entry */
+        if ( pte_is_table(entry) )
+        {
+            printk("Modifying a table entry is not allowed.\n");
+            return false;
+        }
+    }
+    /* Sanity check when inserting a mapping */
+    else if ( flags & PTE_VALID )
+    {
+        /* We should be here with a valid MFN. */
+        ASSERT(!mfn_eq(mfn, INVALID_MFN));
+
+        /*
+         * We don't allow replacing any valid entry.
+         *
+         * Note that the function xen_pt_update() relies on this
+         * assumption and will skip the TLB flush. The function will need
+         * to be updated if the check is relaxed.
+         */
+        if ( pte_is_valid(entry) )
+        {
+            if ( pte_is_mapping(entry) )
+                printk("Changing MFN for a valid entry is not allowed (%#"PRI_mfn" -> %#"PRI_mfn").\n",
+                       mfn_x(mfn_from_pte(entry)), mfn_x(mfn));
+            else
+                printk("Trying to replace a table with a mapping.\n");
+            return false;
+        }
+    }
+    /* Sanity check when removing a mapping. */
+    else if ( (flags & (PTE_VALID | PTE_POPULATE)) == 0 )
+    {
+        /* We should be here with an invalid MFN. */
+        ASSERT(mfn_eq(mfn, INVALID_MFN));
+
+        /* We don't allow removing a table */
+        if ( pte_is_table(entry) )
+        {
+            printk("Removing a table is not allowed.\n");
+            return false;
+        }
+    }
+    /* Sanity check when populating the page-table. No check so far. */
+    else
+    {
+        ASSERT(flags & PTE_POPULATE);
+        /* We should be here with an invalid MFN */
+        ASSERT(mfn_eq(mfn, INVALID_MFN));
+    }
+
+    return true;
+}
+
+static pte_t *xen_map_table(mfn_t mfn)
+{
+    /*
+     * During early boot, map_domain_page() may be unusable. Use the
+     * PMAP to map temporarily a page-table.
+     */
+    if ( system_state == SYS_STATE_early_boot )
+        return pmap_map(mfn);
+
+    return map_domain_page(mfn);
+}
+
+static void xen_unmap_table(const pte_t *table)
+{
+    /*
+     * During early boot, xen_map_table() will not use map_domain_page()
+     * but the PMAP.
+     */
+    if ( system_state == SYS_STATE_early_boot )
+        pmap_unmap(table);
+    else
+        unmap_domain_page(table);
+}
+
+static int create_xen_table(pte_t *entry)
+{
+    mfn_t mfn;
+    void *p;
+    pte_t pte;
+
+    if ( system_state != SYS_STATE_early_boot )
+    {
+        struct page_info *pg = alloc_domheap_page(NULL, 0);
+
+        if ( pg == NULL )
+            return -ENOMEM;
+
+        mfn = page_to_mfn(pg);
+    }
+    else
+        mfn = alloc_boot_pages(1, 1);
+
+    p = xen_map_table(mfn);
+    clear_page(p);
+    xen_unmap_table(p);
+
+    pte = pte_from_mfn(mfn, PTE_TABLE);
+    write_pte(entry, pte);
+
+    return 0;
+}
+
+#define XEN_TABLE_MAP_FAILED 0
+#define XEN_TABLE_SUPER_PAGE 1
+#define XEN_TABLE_NORMAL 2
+
+/*
+ * Take the currently mapped table, find the corresponding entry,
+ * and map the next table, if available.
+ *
+ * The alloc_only parameters indicates whether intermediate tables should
+ * be allocated when not present.
+ *
+ * Return values:
+ *  XEN_TABLE_MAP_FAILED: Either alloc_only was set and the entry
+ *  was empty, or allocating a new page failed.
+ *  XEN_TABLE_NORMAL: next level or leaf mapped normally
+ *  XEN_TABLE_SUPER_PAGE: The next entry points to a superpage.
+ */
+static int pt_next_level(bool alloc_only, pte_t **table, unsigned int offset)
+{
+    pte_t *entry;
+    int ret;
+    mfn_t mfn;
+
+    entry = *table + offset;
+
+    if ( !pte_is_valid(*entry) )
+    {
+        if ( alloc_only )
+            return XEN_TABLE_MAP_FAILED;
+
+        ret = create_xen_table(entry);
+        if ( ret )
+            return XEN_TABLE_MAP_FAILED;
+    }
+
+    if ( pte_is_mapping(*entry) )
+        return XEN_TABLE_SUPER_PAGE;
+
+    mfn = mfn_from_pte(*entry);
+
+    xen_unmap_table(*table);
+    *table = xen_map_table(mfn);
+
+    return XEN_TABLE_NORMAL;
+}
+
+/* Update an entry at the level @target. */
+static int pt_update_entry(mfn_t root, unsigned long virt,
+                           mfn_t mfn, unsigned int target,
+                           unsigned int flags)
+{
+    int rc;
+    unsigned int level = HYP_PT_ROOT_LEVEL;
+    pte_t *table;
+    /*
+     * The intermediate page tables are read-only when the MFN is not valid
+     * and we are not populating page table.
+     * This means we either modify permissions or remove an entry.
+     */
+    bool alloc_only = mfn_eq(mfn, INVALID_MFN) && !(flags & PTE_POPULATE);
+    pte_t pte, *entry;
+
+    /* convenience aliases */
+    DECLARE_OFFSETS(offsets, virt);
+
+    table = xen_map_table(root);
+    for ( ; level > target; level-- )
+    {
+        rc = pt_next_level(alloc_only, &table, offsets[level]);
+        if ( rc == XEN_TABLE_MAP_FAILED )
+        {
+            rc = 0;
+
+            /*
+             * We are here because pt_next_level has failed to map
+             * the intermediate page table (e.g the table does not exist
+             * and the pt is read-only). It is a valid case when
+             * removing a mapping as it may not exist in the page table.
+             * In this case, just ignore it.
+             */
+            if ( flags & PTE_VALID )
+            {
+                printk("%s: Unable to map level %u\n", __func__, level);
+                rc = -ENOENT;
+            }
+
+            goto out;
+        }
+        else if ( rc != XEN_TABLE_NORMAL )
+            break;
+    }
+
+    if ( level != target )
+    {
+        printk("%s: Shattering superpage is not supported\n", __func__);
+        rc = -EOPNOTSUPP;
+        goto out;
+    }
+
+    entry = table + offsets[level];
+
+    rc = -EINVAL;
+    if ( !pt_check_entry(*entry, mfn, flags) )
+        goto out;
+
+    /* We are removing the page */
+    if ( !(flags & PTE_VALID) )
+        memset(&pte, 0x00, sizeof(pte));
+    else
+    {
+        /* We are inserting a mapping => Create new pte. */
+        if ( !mfn_eq(mfn, INVALID_MFN) )
+            pte = pte_from_mfn(mfn, PTE_VALID);
+        else /* We are updating the permission => Copy the current pte. */
+            pte = *entry;
+
+        /* update permission according to the flags */
+        pte.pte |= PTE_RWX_MASK(flags) | PTE_ACCESSED | PTE_DIRTY;
+    }
+
+    write_pte(entry, pte);
+
+    rc = 0;
+
+ out:
+    xen_unmap_table(table);
+
+    return rc;
+}
+
+static DEFINE_SPINLOCK(xen_pt_lock);
+
+/* Return the level where mapping should be done */
+static int pt_mapping_level(unsigned long vfn, mfn_t mfn, unsigned long nr,
+                            unsigned int flags)
+{
+    unsigned int level = 0;
+    unsigned long mask;
+    unsigned int i;
+
+    /*
+     * Always use level 0 ( 4k mapping ) mapping unless the caller request
+     * block mapping.
+     */
+    if ( likely(!(flags & PTE_BLOCK)) )
+        return level;
+
+    /*
+     * Don't take into account the MFN when removing mapping (i.e
+     * MFN_INVALID) to calculate the correct target order.
+     *
+     * `vfn` and `mfn` must be both superpage aligned.
+     * They are or-ed together and then checked against the size of
+     * each level.
+     *
+     * `left` is not included and checked separately to allow
+     * superpage mapping even if it is not properly aligned (the
+     * user may have asked to map 2MB + 4k).
+     */
+    mask = !mfn_eq(mfn, INVALID_MFN) ? mfn_x(mfn) : 0;
+    mask |= vfn;
+
+    for ( i = HYP_PT_ROOT_LEVEL; i != 0; i-- )
+    {
+        if ( !(mask & (BIT(XEN_PT_LEVEL_ORDER(i), UL) - 1)) &&
+             (nr >= BIT(XEN_PT_LEVEL_ORDER(i), UL)) )
+        {
+            level = i;
+            break;
+        }
+    }
+
+    return level;
+}
+
+/*
+ * If `mfn` equals `INVALID_MFN`, it indicates that the following page table
+ * update operation might be related to either populating the table,
+ * destroying a mapping, or modifying an existing mapping.
+ */
+static int pt_update(unsigned long virt,
+                     mfn_t mfn,
+                     unsigned long nr_mfns,
+                     unsigned int flags)
+{
+    int rc = 0;
+    unsigned long vfn = virt >> PAGE_SHIFT;
+    unsigned long left = nr_mfns;
+
+    const mfn_t root = get_root_page();
+
+    /*
+     * It is bad idea to have mapping both writeable and
+     * executable.
+     * When modifying/creating mapping (i.e PTE_VALID is set),
+     * prevent any update if this happen.
+     */
+    if ( (flags & PTE_VALID) && PTE_W_MASK(flags) && PTE_X_MASK(flags) )
+    {
+        printk("Mappings should not be both Writeable and Executable.\n");
+        return -EINVAL;
+    }
+
+    if ( !IS_ALIGNED(virt, PAGE_SIZE) )
+    {
+        printk("The virtual address is not aligned to the page-size.\n");
+        return -EINVAL;
+    }
+
+    spin_lock(&xen_pt_lock);
+
+    while ( left )
+    {
+        unsigned int order, level;
+
+        level = pt_mapping_level(vfn, mfn, left, flags);
+        order = XEN_PT_LEVEL_ORDER(level);
+
+        ASSERT(left >= BIT(order, UL));
+
+        rc = pt_update_entry(root, vfn << PAGE_SHIFT, mfn, level,
+                                    flags);
+        if ( rc )
+            break;
+
+        vfn += 1U << order;
+        if ( !mfn_eq(mfn, INVALID_MFN) )
+            mfn = mfn_add(mfn, 1U << order);
+
+        left -= (1U << order);
+
+        if ( rc )
+            break;
+    }
+
+
+    /* ensure that PTEs are all updated before flushing */
+    RISCV_FENCE(rw, rw);
+
+    /*
+     * always flush TLB at the end of the function as non-present entries
+     * can be put in the TLB
+     */
+    flush_tlb_range_va(virt, PAGE_SIZE * nr_mfns);
+
+    spin_unlock(&xen_pt_lock);
+
+    return rc;
+}
+
+int map_pages_to_xen(unsigned long virt,
+                     mfn_t mfn,
+                     unsigned long nr_mfns,
+                     unsigned int flags)
+{
+    /*
+     * Ensure that we have a valid MFN before proceeding.
+     *
+     * If the MFN is invalid, pt_update() might misinterpret the operation,
+     * treating it as either a population, a mapping destruction,
+     * or a mapping modification.
+     */
+    ASSERT(!mfn_eq(mfn, INVALID_MFN));
+
+    return pt_update(virt, mfn, nr_mfns, flags);
+}
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 09 16:20:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 16:20:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774848.1185259 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scSLL-0001pk-9G; Fri, 09 Aug 2024 16:19:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774848.1185259; Fri, 09 Aug 2024 16:19:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scSLL-0001nE-46; Fri, 09 Aug 2024 16:19:55 +0000
Received: by outflank-mailman (input) for mailman id 774848;
 Fri, 09 Aug 2024 16:19:53 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=k3r+=PI=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1scSLJ-0001ij-SK
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 16:19:53 +0000
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com
 [2a00:1450:4864:20::132])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 34ba45e7-566b-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 18:19:51 +0200 (CEST)
Received: by mail-lf1-x132.google.com with SMTP id
 2adb3069b0e04-52f01b8738dso2122976e87.1
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 09:19:51 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530de481f09sm1028479e87.285.2024.08.09.09.19.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 09 Aug 2024 09:19:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 34ba45e7-566b-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723220391; x=1723825191; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=ZEoeDpSVCGC1Y9DhPq4eLpD8REr3S70n2Afun0RLq94=;
        b=IWyI67C4Zik7lSWDWaELwRFE1T0b6eWbEX4veD0snRlZrgC5K9z+9Ek4alLneean0r
         UCYbniGcbSBixtGXb0zKiqvoZcHbD7jXgA/0dblzz8JghX04Xkc7FGVEM0YzGjUjqAd4
         WX5V0tL2ODHC4ShyoS39jLxZfH2LVosv7FRY9Ig0VaMzB6a8iv4jZ8FSrtQyVncCnhpF
         yfK3ptOn1x8IUHxdVs0eJxSbh/7EKwp1ENtJ1NpDVYn3cY7cLtzm4D4m9wmCyW+zMQmd
         Jn24ldwpCGBVsXHkZsm1yHWHUsk2R3S0phhiKenpJ54Y8+CBblLK5jJsnNsfX9xXd8Vf
         ygVw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723220391; x=1723825191;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=ZEoeDpSVCGC1Y9DhPq4eLpD8REr3S70n2Afun0RLq94=;
        b=c7sFNKoqoDN93tY15wbrHn3Xv3RwP7ic2ZQgVKq80anm54MSQrMzRDyaIO44MMJNZz
         gRE+rmZXBIunLaDAH8HVpWyaL2sDd/ANORN7WRAZDFFibL2K3e9oqCoH+fiLIUr8yU39
         f1Ou+K5DBQAERy4WvcJenBeZtiFSqm/ziNrQYX1rTklAhQXi7tGF3qqOCiPprRFfCpNn
         qpwJL/zE+HzSszE6Ew1NM9BlIigJE282PpiHHzPImholGu+nyyV72IfJ3whRd7vsZnYA
         Xw0oGHIhX+x/TEDI+0QzormXsDa30pBKI8fOYEPV+k0cUoK7XiXMGscrWzipLn2i1LnE
         lW8A==
X-Gm-Message-State: AOJu0Yxc4qNYdPn9wD9kNp6BY8lx123c0dpdPknylfVF9s/Ocys5m5R2
	5JpCtLlNGYgRQr/JW5TsPwvaIEYjUOVB1rIbfYXX3aKx/cL7YJumvrIp5g==
X-Google-Smtp-Source: AGHT+IFNZAjU4+OKutmk1+W8LtYamJOzQVs+qWyha0tYPRq/8xvCktfHH1ROPSiLmknz33m00mb5FQ==
X-Received: by 2002:ac2:4c49:0:b0:52e:9882:2cd8 with SMTP id 2adb3069b0e04-530ee96c714mr1517581e87.4.1723220390805;
        Fri, 09 Aug 2024 09:19:50 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v4 1/7] xen/riscv: enable CONFIG_HAS_DEVICE_TREE
Date: Fri,  9 Aug 2024 18:19:39 +0200
Message-ID: <cf61eaf4eaf398630246cd485298b5c14592c690.1723214540.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1723214540.git.oleksii.kurochko@gmail.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Enable build of generic functionality for working with device
tree for RISC-V.
Also, a collection of functions for parsing memory map and other
boot information from a device tree are available now.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in V4:
 - Nothing changed. Only rebase
---
Changes in V3:
 - add Acked-by: Jan Beulich <jbeulich@suse.com>
 - update the commit message
---
Changes in V2:
 - move 'select HAS_DEVICE_TREE' to CONFIG_RISCV.
---
Changes in V1:
 - new patch
---
 xen/arch/riscv/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index f531e96657..259eea8d3b 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -2,6 +2,7 @@ config RISCV
 	def_bool y
 	select FUNCTION_ALIGNMENT_16B
 	select GENERIC_BUG_FRAME
+	select HAS_DEVICE_TREE
 
 config RISCV_64
 	def_bool y
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 09 16:20:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 16:20:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774847.1185256 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scSLL-0001ln-4W; Fri, 09 Aug 2024 16:19:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774847.1185256; Fri, 09 Aug 2024 16:19:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scSLK-0001lM-TX; Fri, 09 Aug 2024 16:19:54 +0000
Received: by outflank-mailman (input) for mailman id 774847;
 Fri, 09 Aug 2024 16:19: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=k3r+=PI=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1scSLJ-0001id-RD
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 16:19:53 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 353d8451-566b-11ef-bc04-fd08da9f4363;
 Fri, 09 Aug 2024 18:19:52 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2ef2c56da6cso24210571fa.1
 for <xen-devel@lists.xenproject.org>; Fri, 09 Aug 2024 09:19:52 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-530de481f09sm1028479e87.285.2024.08.09.09.19.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 09 Aug 2024 09:19:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 353d8451-566b-11ef-bc04-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723220392; x=1723825192; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=r+rGL53DR8g+1PldoLMvMKzqZyZHWG7XWVOFuQUg5t4=;
        b=BjLPE3yaUFBKIFuF5uv6hY2pWtkI0LVTNLQk0KY3k1GSXhMkml20CXCQ0AZNn537QU
         I+ipRF/YndguVkElFyDNLgTGAOEGEbl6qEoRvjAk15EzcbFM38uFNFEZfoqt0lfgxsAV
         ZInQs6BSZx71r1hD466I5L4zoUkIDzY33Bfth2ZN3LkESF/rslsVGXlAiTAwEEP/TJ0u
         Lw5YAtHeJLrgWc4rblLt0YmhqL6SveF5wEW9cCRsfGJO68S2nIn0kroKTxJJleBh5E53
         DdEtyu7hePwRSFq2NnWRbQJJXaAIxz9GDOz4L2YRJ4xBGaliYmtxqNYASTSevnfAO1Gc
         Uqgw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723220392; x=1723825192;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=r+rGL53DR8g+1PldoLMvMKzqZyZHWG7XWVOFuQUg5t4=;
        b=C5bsMUXgJdQqtIaebQ7VJ+4rpFiZVTtnUyjHS+uUHhkS3g73ZIuSPYMcZFbDZRakaK
         dEp6z4TybEUlUNIdLrTtMQZJvCVGG2xoqXLETRIFhEuZVmq4J1SffCOI6HJDjUXs6lgJ
         qPP89fy1A+ic0lDXtHwgbRD201HV+Rulzvvzg12gedZDpZxhJGeumSCOQmGfNoio0z9r
         XDki0x0nBY4zMKQg3RjLSNfViKIKBfNeU9GlGOxjWCihHCPWba2qsm4bwRD7ceVTRHfY
         5dSSULRGB3jIwOpM8LsojazU9rDnVfwoPjDXOlATsC9gwpV1ziHJPFXcuu5dGKilK5ux
         2HZg==
X-Gm-Message-State: AOJu0YxdXM9hNws8+4DvWOLUxLJ/u8E3lhViKsoxneMEUN0XRN3q6v21
	35jfyfsDXhtFkLSQTjyoBJbZi+Fyn22jsYztqOcSS/f4Iet1oSPSOtKgkA==
X-Google-Smtp-Source: AGHT+IElnAVZxzNp1lHvVLN6ebdKd5oOVm+ueArvtZAFYVO8PyYipTsWQTeP1Lkmegy5GnNEisenOg==
X-Received: by 2002:a05:6512:ad5:b0:52e:f9f1:c13a with SMTP id 2adb3069b0e04-530ee9818a2mr1631118e87.12.1723220391572;
        Fri, 09 Aug 2024 09:19:51 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v4 2/7] xen/riscv: set up fixmap mappings
Date: Fri,  9 Aug 2024 18:19:40 +0200
Message-ID: <1c1c0f912a9abbb542baa1ce92e75d64ec8043e9.1723214540.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1723214540.git.oleksii.kurochko@gmail.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Set up fixmap mappings and the L0 page table for fixmap support.

Define new macros in riscv/config.h for calculating
the FIXMAP_BASE address, including BOOT_FDT_VIRT_{START, SIZE},
XEN_VIRT_SIZE, and XEN_VIRT_END.

Update the check for Xen size in riscv/lds.S to use
XEN_VIRT_SIZE instead of a hardcoded constant.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V4:
 - move definitions of XEN_VIRT_SIZE, BOOT_FDT_VIRT_{START,SIZE}, FIXMAP_{BASE,ADDR}
   below XEN_VIRT_START to have definitions appear in order.
 - define FIX_LAST as (FIX_MISC + 1) to have a guard slot at the end.
 - s/enumerated/numbered in the comment
 - update the cycle which looks for L1 page table in setup_fixmap_mapping_function() and
   the comment above him.
 - drop fences inside write_pte() and put 'fence r,r' in setup_fixmap() before sfence_vma().
 - update the commit message
 - drop printk message inside setup_fixmap().
---
Changes in V3:
 - s/XEN_SIZE/XEN_VIRT_SIZE
 - drop usage of XEN_VIRT_END.
 - sort newly introduced defines in config.h by address
 - code style fixes
 - drop runtime check of that pte is valid as it was checked in L1 page table finding cycle by BUG_ON().
 - update implementation of write_pte() with FENCE rw, rw.
 - add BUILD_BUG_ON() to check that amount of entries aren't bigger then entries in page table.
 - drop set_fixmap, clear_fixmap declarations as they aren't used and defined now
 - update the commit message.
 - s/__ASM_FIXMAP_H/ASM_FIXMAP_H
 - add SPDX-License-Identifier: GPL-2.0 
---
 xen/arch/riscv/include/asm/config.h |  8 ++++++
 xen/arch/riscv/include/asm/fixmap.h | 44 +++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/mm.h     |  2 ++
 xen/arch/riscv/include/asm/page.h   |  6 ++++
 xen/arch/riscv/mm.c                 | 43 ++++++++++++++++++++++++++++
 xen/arch/riscv/setup.c              |  2 ++
 xen/arch/riscv/xen.lds.S            |  2 +-
 7 files changed, 106 insertions(+), 1 deletion(-)
 create mode 100644 xen/arch/riscv/include/asm/fixmap.h

diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h
index 50583aafdc..4b4cc529a9 100644
--- a/xen/arch/riscv/include/asm/config.h
+++ b/xen/arch/riscv/include/asm/config.h
@@ -74,6 +74,14 @@
 #error "unsupported RV_STAGE1_MODE"
 #endif
 
+#define XEN_VIRT_SIZE           MB(2)
+
+#define BOOT_FDT_VIRT_START     (XEN_VIRT_START + XEN_VIRT_SIZE)
+#define BOOT_FDT_VIRT_SIZE      MB(4)
+
+#define FIXMAP_BASE             (BOOT_FDT_VIRT_START + BOOT_FDT_VIRT_SIZE)
+#define FIXMAP_ADDR(n)          (FIXMAP_BASE + (n) * PAGE_SIZE)
+
 #define DIRECTMAP_SLOT_END      509
 #define DIRECTMAP_SLOT_START    200
 #define DIRECTMAP_VIRT_START    SLOTN(DIRECTMAP_SLOT_START)
diff --git a/xen/arch/riscv/include/asm/fixmap.h b/xen/arch/riscv/include/asm/fixmap.h
new file mode 100644
index 0000000000..2ecd05dd9f
--- /dev/null
+++ b/xen/arch/riscv/include/asm/fixmap.h
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * fixmap.h: compile-time virtual memory allocation
+ */
+#ifndef ASM_FIXMAP_H
+#define ASM_FIXMAP_H
+
+#include <xen/bug.h>
+#include <xen/page-size.h>
+#include <xen/pmap.h>
+
+#include <asm/page.h>
+
+/* Fixmap slots */
+#define FIX_PMAP_BEGIN (0) /* Start of PMAP */
+#define FIX_PMAP_END (FIX_PMAP_BEGIN + NUM_FIX_PMAP - 1) /* End of PMAP */
+#define FIX_MISC (FIX_PMAP_END + 1)  /* Ephemeral mappings of hardware */
+
+#define FIX_LAST (FIX_MISC + 1) /* +1 means a guard slot */
+
+#define FIXADDR_START FIXMAP_ADDR(0)
+#define FIXADDR_TOP FIXMAP_ADDR(FIX_LAST)
+
+#ifndef __ASSEMBLY__
+
+/*
+ * Direct access to xen_fixmap[] should only happen when {set,
+ * clear}_fixmap() is unusable (e.g. where we would end up to
+ * recursively call the helpers).
+ */
+extern pte_t xen_fixmap[];
+
+#define fix_to_virt(slot) ((void *)FIXMAP_ADDR(slot))
+
+static inline unsigned int virt_to_fix(vaddr_t vaddr)
+{
+    BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
+
+    return ((vaddr - FIXADDR_START) >> PAGE_SHIFT);
+}
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* ASM_FIXMAP_H */
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 25af9e1aaa..a0bdc2bc3a 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -255,4 +255,6 @@ static inline unsigned int arch_get_dma_bitsize(void)
     return 32; /* TODO */
 }
 
+void setup_fixmap_mappings(void);
+
 #endif /* _ASM_RISCV_MM_H */
diff --git a/xen/arch/riscv/include/asm/page.h b/xen/arch/riscv/include/asm/page.h
index c831e16417..5db3edb100 100644
--- a/xen/arch/riscv/include/asm/page.h
+++ b/xen/arch/riscv/include/asm/page.h
@@ -81,6 +81,12 @@ static inline void flush_page_to_ram(unsigned long mfn, bool sync_icache)
     BUG_ON("unimplemented");
 }
 
+/* Write a pagetable entry. */
+static inline void write_pte(pte_t *p, pte_t pte)
+{
+    *p = pte;
+}
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_RISCV_PAGE_H */
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index 7d09e781bf..b8ff91cf4e 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -12,6 +12,7 @@
 #include <asm/early_printk.h>
 #include <asm/csr.h>
 #include <asm/current.h>
+#include <asm/fixmap.h>
 #include <asm/page.h>
 #include <asm/processor.h>
 
@@ -49,6 +50,9 @@ stage1_pgtbl_root[PAGETABLE_ENTRIES];
 pte_t __section(".bss.page_aligned") __aligned(PAGE_SIZE)
 stage1_pgtbl_nonroot[PGTBL_INITIAL_COUNT * PAGETABLE_ENTRIES];
 
+pte_t __section(".bss.page_aligned") __aligned(PAGE_SIZE)
+xen_fixmap[PAGETABLE_ENTRIES];
+
 #define HANDLE_PGTBL(curr_lvl_num)                                          \
     index = pt_index(curr_lvl_num, page_addr);                              \
     if ( pte_is_valid(pgtbl[index]) )                                       \
@@ -191,6 +195,45 @@ static bool __init check_pgtbl_mode_support(struct mmu_desc *mmu_desc,
     return is_mode_supported;
 }
 
+void __init setup_fixmap_mappings(void)
+{
+    pte_t *pte, tmp;
+    unsigned int i;
+
+    BUILD_BUG_ON(FIX_LAST >= PAGETABLE_ENTRIES);
+
+    pte = &stage1_pgtbl_root[pt_index(HYP_PT_ROOT_LEVEL, FIXMAP_ADDR(0))];
+
+    /*
+     * In RISC-V page table levels are numbered from Lx to L0 where
+     * x is the highest page table level for currect  MMU mode ( for example,
+     * for Sv39 has 3 page tables so the x = 2 (L2 -> L1 -> L0) ).
+     *
+     * In this cycle we want to find L1 page table because as L0 page table
+     * xen_fixmap[] will be used.
+     */
+    for ( i = HYP_PT_ROOT_LEVEL; i-- > 1; )
+    {
+        BUG_ON(!pte_is_valid(*pte));
+
+        pte = (pte_t *)LOAD_TO_LINK(pte_to_paddr(*pte));
+        pte = &pte[pt_index(i, FIXMAP_ADDR(0))];
+    }
+
+    BUG_ON(pte_is_valid(*pte));
+
+    tmp = paddr_to_pte(LINK_TO_LOAD((unsigned long)&xen_fixmap), PTE_TABLE);
+    write_pte(pte, tmp);
+
+    RISCV_FENCE(rw, rw);
+    sfence_vma();
+
+    /*
+     * We only need the zeroeth table allocated, but not the PTEs set, because
+     * set_fixmap() will set them on the fly.
+     */
+}
+
 /*
  * setup_initial_pagetables:
  *
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index 4defad68f4..13f0e8c77d 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -46,6 +46,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
     test_macros_from_bug_h();
 #endif
 
+    setup_fixmap_mappings();
+
     printk("All set up\n");
 
     for ( ;; )
diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
index 070b19d915..7a683f6065 100644
--- a/xen/arch/riscv/xen.lds.S
+++ b/xen/arch/riscv/xen.lds.S
@@ -181,6 +181,6 @@ ASSERT(!SIZEOF(.got.plt),  ".got.plt non-empty")
  * Changing the size of Xen binary can require an update of
  * PGTBL_INITIAL_COUNT.
  */
-ASSERT(_end - _start <= MB(2), "Xen too large for early-boot assumptions")
+ASSERT(_end - _start <= XEN_VIRT_SIZE, "Xen too large for early-boot assumptions")
 
 ASSERT(_ident_end - _ident_start <= IDENT_AREA_SIZE, "identity region is too big");
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 09 19:03:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 19:03:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774941.1185329 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scUtP-0006vl-HQ; Fri, 09 Aug 2024 19:03:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774941.1185329; Fri, 09 Aug 2024 19:03:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scUtP-0006ve-EK; Fri, 09 Aug 2024 19:03:15 +0000
Received: by outflank-mailman (input) for mailman id 774941;
 Fri, 09 Aug 2024 19:03:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scUtO-0006vT-Qv; Fri, 09 Aug 2024 19:03:14 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scUtO-0005T5-DT; Fri, 09 Aug 2024 19:03:14 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scUtN-0008WI-UQ; Fri, 09 Aug 2024 19:03:14 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1scUtN-0002kn-U3; Fri, 09 Aug 2024 19:03:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=TquUFlmE06gSWDZWnwQr49f1NBR/74S/eRPJvcKS9aY=; b=LQtr7G3KPBcaJjm+Qt8JQxxnTF
	GNPfWbxX5lE08i4A0Jj0O1cVzRevnCKXsUfCFJchWOafwKPQa04KwLRv3oq1pZhpDXDOFMojxcEXm
	ExvDqNPoIxaNmJHkokFZSQDTWTGtXfFXU9rqgZV5aWKNJ2oz/wO0tevPEOBmwTGwyBxE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187199-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187199: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:regression
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=ee9a43b7cfe2d8a3520335fea7d8ce71b8cabd9d
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 09 Aug 2024 19:03:13 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail REGR. vs. 186827

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

version targeted for testing:
 linux                ee9a43b7cfe2d8a3520335fea7d8ce71b8cabd9d
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   23 days
Failing since        186925  2024-07-20 09:44:52 Z   20 days   42 attempts
Testing same since   187199  2024-08-09 07:20:39 Z    0 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 19:25:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 19:25:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774953.1185339 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scVEg-0001rx-9n; Fri, 09 Aug 2024 19:25:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774953.1185339; Fri, 09 Aug 2024 19:25:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scVEg-0001rq-6X; Fri, 09 Aug 2024 19:25:14 +0000
Received: by outflank-mailman (input) for mailman id 774953;
 Fri, 09 Aug 2024 19:25:13 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=waF5=PI=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1scVEf-0001rk-Hl
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 19:25:13 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 179b244c-5685-11ef-8776-851b0ebba9a2;
 Fri, 09 Aug 2024 21:25:11 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 381DC61767;
 Fri,  9 Aug 2024 19:25:09 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D8C1C32782;
 Fri,  9 Aug 2024 19:25:08 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 179b244c-5685-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723231509;
	bh=Pn7fV/Ax6GfTPY1qzSmiQw6+6NE+7FZHc8ndrA91tUM=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=YobYYuRd+C18iBW3asbH7PfSaSufbTWrM/7sjddnMFNuousuDFeYccCozsRUL88tu
	 PhGwYV5TLtWXTZHrxOjCKbpUSbPlI9ICnxbX94eWimyaYOmIaA3YvdVKdQMEm5Aew/
	 6fTT8g/joFNNH6Ntlqj4dRjMR+10T2EnnbRSotifVYsMRGCsqcddlW54wnea9R/re6
	 1Xy6jvW4Lr7ZRMobv08YyEdApW1XSRK6KdXKiByKxYvKTnQtPbUd7ANmPVpLz5UWX7
	 X855lnHavCuJHOJnJexyTQ6kaDu+jLFxNJOhbj/qt8VazeDjL/MP7Z+jF6SnQ8RCny
	 rCk31EQ4ubkNQ==
Date: Fri, 9 Aug 2024 12:25:03 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
cc: Xen-devel <xen-devel@lists.xenproject.org>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [RFC PATCH] xen: Remove -Wdeclaration-after-statement
In-Reply-To: <20240809130418.10431-1-alejandro.vallejo@cloud.com>
Message-ID: <alpine.DEB.2.22.394.2408091217370.200407@ubuntu-linux-20-04-desktop>
References: <20240809130418.10431-1-alejandro.vallejo@cloud.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

Adding Roberto

Does MISRA have a view on this? I seem to remember this is discouraged?


On Fri, 9 Aug 2024, Alejandro Vallejo wrote:
> This warning only makes sense when developing using a compiler with C99
> support on a codebase meant to be built with C89 compilers too, and
> that's no longer the case (nor should it be, as it's been 25 years since
> C99 came out already).
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> ---
> Yes, I'm opening this can of worms. I'd like to hear others people's
> thoughts on this and whether this is something MISRA has views on. If
> there's an ulterior non-obvious reason besides stylistic preference I
> think it should be documented somewhere, but I haven't seen such an
> explanation.
> 
> IMO, the presence of this warning causes several undesirable effects:
> 
>   1. Small functions are hampered by the preclusion of check+declare
>      patterns that improve readability via concision. e.g: Consider a
>      silly example like:
> 
>      /* with warning */                     /* without warning */
>      void foo(uint8_t *p)                   void foo(uint8_t *p)
>      {                                      {
>          uint8_t  tmp1;                         if ( !p )
>          uint16_t tmp2;                             return;
>          uint32_t tmp3;
>                                                 uint8_t  tmp1 = OFFSET1 + *p;
>          if ( !p )                              uint16_t tmp2 = OFFSET2 + *p;
>              return;                            uint32_t tmp3 = OFFSET3 + *p;
> 
>          tmp1 = OFFSET1 + *p;                   /* Lots of uses of `tmpX` */
>          tmp2 = OFFSET2 + *p;               }
>          tmp2 = OFFSET2 + *p;
> 
>          /* Lots of uses of tmpX */
>      }
> 
>   2. Promotes scope-creep. On small functions it doesn't matter much,
>      but on bigger ones to prevent declaring halfway through the body
>      needlessly increases variable scope to the full scope in which they
>      are defined rather than the subscope of point-of-declaration to
>      end-of-current-scope. In cases in which they can be trivially
>      defined at that point, it also means they can be trivially misused
>      before they are meant to. i.e: On the example in (1) assume the
>      conditional in "with warning" is actually a large switch statement.
> 
>   3. It facilitates a disconnect between time-of-declaration and
>      time-of-use that lead very easily to "use-before-init" bugs.
>      While a modern compiler can alleviate the most egregious cases of
>      this, there's cases it simply cannot cover. A conditional
>      initialization on anything with external linkage combined with a
>      conditional use on something else with external linkage will squash
>      the warning of using an uninitialised variable. Things are worse
>      where the variable in question is preinitialised to something
>      credible (e.g: a pointer to NULL), as then that can be misused
>      between its declaration and its original point of intended use.
> 
> So... thoughts? yay or nay?

In my opinion, there are some instances where mixing declarations and
statements would enhance the code, but these are uncommon. Given the
choice between:

1) declarations always first
2) declarations always mixed with statements

I would choose 1).

One could say that mixing declarations with statements should be done
only when appropriate, but the challenge lies in the subjective nature
of "when appropriate." Different individuals have varying
interpretations of this, which could lead to unnecessary bikeshedding.

For these reasons, I do not support mixing declarations and statements.


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 22:22:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 22:22:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774973.1185349 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scXzl-0002kx-Bj; Fri, 09 Aug 2024 22:22:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774973.1185349; Fri, 09 Aug 2024 22:22:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scXzl-0002kq-8q; Fri, 09 Aug 2024 22:22:01 +0000
Received: by outflank-mailman (input) for mailman id 774973;
 Fri, 09 Aug 2024 22:22:00 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=waF5=PI=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1scXzk-0002kk-9A
 for xen-devel@lists.xenproject.org; Fri, 09 Aug 2024 22:22:00 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org
 [2604:1380:40e1:4800::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c8dbb91f-569d-11ef-8776-851b0ebba9a2;
 Sat, 10 Aug 2024 00:21:56 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id B7435CE180B;
 Fri,  9 Aug 2024 22:21:51 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FA01C32782;
 Fri,  9 Aug 2024 22:21:50 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c8dbb91f-569d-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723242110;
	bh=PrNwgsGz4IBAQJsAwidi/ZJL1yTvraA18BklKUU+izw=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=erln7huUmdj2aaRSEx9VLZdNxgAkLVTBwVfU1jqkRrMKRF0LsJaVyqOyMYHzvpFJq
	 UTbweGO0YaLgHrkLQKZtw5teELOm8llpDqYMTb1MKme9tMzl0lvmjSxVQRvnc30u58
	 QKxxWuU3If1dXPDu4k2Lf/2Y1osH2iDBOz0BGdt4absz7RgmGYM3OgquC4J0FUSlpk
	 yaovFa0xOSuNYX03MqTpgVAzMtWH6g9sK0GrIVZqv3ftfXSboxbLwj7J1bMfpT3JDx
	 7gGLjjdmTl8DeRdAnfv8WkMu4FpSAy4BhfkutBfyNr0LtvSdSecMazHBY3obTbanUs
	 BiEHcGB4LuRAg==
Date: Fri, 9 Aug 2024 15:21:48 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Subject: Re: [PATCH] x86emul: don't call ->read_segment() with x86_seg_none
In-Reply-To: <d4ea2213-4c12-40d2-ba12-64f2e7e492c6@suse.com>
Message-ID: <alpine.DEB.2.22.394.2408091515050.200407@ubuntu-linux-20-04-desktop>
References: <81ae365f-98b4-4bb6-bbb6-c5423dfda038@suse.com> <alpine.DEB.2.22.394.2408061117080.4954@ubuntu-linux-20-04-desktop> <d4ea2213-4c12-40d2-ba12-64f2e7e492c6@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 7 Aug 2024, Jan Beulich wrote:
> On 06.08.2024 20:24, Stefano Stabellini wrote:
> > On Mon, 5 Aug 2024, Jan Beulich wrote:
> >> LAR, LSL, VERR, and VERW emulation involve calling protmode_load_seg()
> >> with x86_seg_none. The fuzzer's read_segment() hook function has an
> >> assertion which triggers in this case. Calling the hook function,
> >> however, makes little sense for those insns, as there's no data to
> >> retrieve. Instead zero-filling the output structure is what properly
> >> corresponds to those insns being invoked with a NUL selector.
> >>
> >> Fixes: 06a3b8cd7ad2 ("x86emul: support LAR/LSL/VERR/VERW")
> >> Oss-fuzz: 70918
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> > 
> > Looking at oss-fuzz's report and at this patch I think it is correct
> > 
> > Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
> 
> S-o-b?

Sorry I meant reviewed-by


> > That said, there are a few other places where read_segment is called
> > without any checks for seg being x86_seg_none. The hvm implementation of
> > read_segment (hvmemul_read_segment) seems to return error if
> > x86_seg_none is passed as an argument, but there is no return error
> > checks any time we call ops->read_segment in x86_emulate.c.
> 
> There is a pretty limited number of cases where x86_seg_none is used.
> For example, state->ea.mem.seg cannot hold this value.
> realmode_load_seg() also cannot be passed this value. We could add
> assertions to that effect, yet that can get unwieldy as further
> x86_seg_* enumerators are added (see "x86: introduce x86_seg_sys"; I
> expect we'll need at least one more when adding VMX/SVM insn emulation,
> where physical addresses are used as insn operands).
> 
> > It seems that there might still be an issue?
> 
> In my auditing I didn't spot any.

Following your explanation I come to the same conclusion as you, so I
think it is OK. But knowing that state->ea.mem.seg cannot hold this
value and realmode_load_seg() also cannot be passed this value is not
something for the casual observer, so in my opinion there is room here
for making the code more resilient and more obvious by always checking
the return value of read_segment.


From xen-devel-bounces@lists.xenproject.org Fri Aug 09 23:22:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 09 Aug 2024 23:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.774985.1185358 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scYvq-0003kX-Ek; Fri, 09 Aug 2024 23:22:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 774985.1185358; Fri, 09 Aug 2024 23:22:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scYvq-0003kQ-Bq; Fri, 09 Aug 2024 23:22:02 +0000
Received: by outflank-mailman (input) for mailman id 774985;
 Fri, 09 Aug 2024 23:22:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scYvp-0003kG-Cu; Fri, 09 Aug 2024 23:22:01 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scYvo-0001po-Vb; Fri, 09 Aug 2024 23:22:01 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scYvo-0000kF-Gr; Fri, 09 Aug 2024 23:22:00 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1scYvo-0006J0-GK; Fri, 09 Aug 2024 23:22:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Z2ZOV2BpJ9iKnadv+1QTy3+6rTmjPMa0oGjT4yAGGnQ=; b=p55YMdNluGOWFVBLJxDeZWn4Lv
	uXwiLHyTbTLzmbONLvqoXG/p/wf/4fVpz7c3rsA3YG6QgaxZeRNqgHr5fojAyWkdTUIv3inPMKuY6
	N/IVyfq0UjnbzwdPU8JfkjSX98iRlAIL6UkXbDiSAncWuKpBFNDs4cXLFuaXhOq6ztzQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187200-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187200: FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-libvirt-vhd:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-libvirt-vhd:capture-logs(23):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=08aacc392d86d4c7dbebdb5e664060ae2af72057
X-Osstest-Versions-That:
    xen=6b9b96ddebf269579730ff2a65f324505bc2aba9
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 09 Aug 2024 23:22:00 +0000

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

Failures and problems with tests :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-libvirt-vhd    <job status>                 broken  in 187195

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-libvirt-vhd 23 capture-logs(23) broken in 187195 pass in 187200
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 187195

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

version targeted for testing:
 xen                  08aacc392d86d4c7dbebdb5e664060ae2af72057
baseline version:
 xen                  6b9b96ddebf269579730ff2a65f324505bc2aba9

Last test of basis   187186  2024-08-08 01:53:56 Z    1 days
Testing same since   187195  2024-08-08 15:11:26 Z    1 days    2 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Matthew Barnes <matthew.barnes@cloud.com>

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


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

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

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

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

broken-job test-amd64-amd64-libvirt-vhd broken

Not pushing.

------------------------------------------------------------
commit 08aacc392d86d4c7dbebdb5e664060ae2af72057
Author: Matthew Barnes <matthew.barnes@cloud.com>
Date:   Thu Aug 8 13:27:50 2024 +0200

    x86/emul: Fix misaligned IO breakpoint behaviour in PV guests
    
    When hardware breakpoints are configured on misaligned IO ports, the
    hardware will mask the addresses based on the breakpoint width during
    comparison.
    
    For PV guests, misaligned IO breakpoints do not behave the same way, and
    therefore yield different results.
    
    This patch tweaks the emulation of IO breakpoints for PV guests such
    that they reproduce the same behaviour as hardware.
    
    Fixes: bec9e3205018 ("x86: emulate I/O port access breakpoints")
    Signed-off-by: Matthew Barnes <matthew.barnes@cloud.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>

commit ef31716a57e6c29ba14b4f009e9a67277c8117a8
Author: Jan Beulich <jbeulich@suse.com>
Date:   Thu Aug 8 13:27:25 2024 +0200

    x86emul: adjust 2nd param of idiv_dbl()
    
    -LONG_MIN cannot be represented in a long and hence is UB, for being one
    larger than LONG_MAX.
    
    The caller passing an unsigned long and the 1st param also being (array
    of) unsigned long, change the 2nd param accordingly while adding the
    sole necessary cast. This was the original form of the function anyway.
    
    Fixes: 5644ce014223 ("x86emul: relax asm() constraints")
    Oss-fuzz: 70923
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

commit c24615500062eb63f1cfd208c234df5268a880e0
Author: Jan Beulich <jbeulich@suse.com>
Date:   Thu Aug 8 13:26:38 2024 +0200

    x86emul: avoid UB shift in AVX512 VPMOV* handling
    
    For widening and narrowing moves, operand (vector) size is calculated
    from a table. This calculation, for the AVX512 cases, lives ahead of
    validation of EVEX.L'L (which cannot be 3 without raising #UD). Account
    for the later checking by adjusting the constants in the expression such
    that even EVEX.L'L == 3 will yield a non-UB shift (read: shift count
    reliably >= 0).
    
    Fixes: 3988beb08 ("x86emul: support AVX512{F,BW} zero- and sign-extending moves")
    Oss-fuzz: 70914
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Sat Aug 10 04:27:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Aug 2024 04:27:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775011.1185377 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scdhC-0001Yb-G9; Sat, 10 Aug 2024 04:27:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775011.1185377; Sat, 10 Aug 2024 04:27:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scdhC-0001YU-Cc; Sat, 10 Aug 2024 04:27:14 +0000
Received: by outflank-mailman (input) for mailman id 775011;
 Sat, 10 Aug 2024 04:27:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scdhA-0001YK-AS; Sat, 10 Aug 2024 04:27:12 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scdhA-0002kE-1s; Sat, 10 Aug 2024 04:27:12 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scdh9-0003ce-EC; Sat, 10 Aug 2024 04:27:11 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1scdh9-0006Kg-D2; Sat, 10 Aug 2024 04:27:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=kWpi+lcXDcSfI7gyA4kONy523y93bEjGW3aSF9hC0rs=; b=oCu0KkFjcRAS0CDzafPPwWFK5H
	7F/bhKvvRW2hBpKse19xjTho/fgUHjFZxUIg3ao418SFQhnoBM7ee2SZUU5S9UpeL0aawu7ANzHEf
	UVMu6bNjLUnqgBoNTN5y7GCrx6lgPmN3mrwTBcK7nMXvN+Hx9mZcdu+TfjnTAL5GqVKE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187203-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187203: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=d61248b0fa2cdfc0be1d806c43d1b211a72b5d49
X-Osstest-Versions-That:
    xen=08aacc392d86d4c7dbebdb5e664060ae2af72057
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 10 Aug 2024 04:27:11 +0000

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

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  d61248b0fa2cdfc0be1d806c43d1b211a72b5d49
baseline version:
 xen                  08aacc392d86d4c7dbebdb5e664060ae2af72057

Last test of basis   187190  2024-08-08 12:06:01 Z    1 days
Testing same since   187203  2024-08-10 01:02:14 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Ayan Kumar Halder <ayan.kumar.halder@amd.com>
  Bertrand Marquis <bertrand.marquis@arm.com>
  Michal Orzel <michal.orzel@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   08aacc392d..d61248b0fa  d61248b0fa2cdfc0be1d806c43d1b211a72b5d49 -> smoke


From xen-devel-bounces@lists.xenproject.org Sat Aug 10 05:02:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Aug 2024 05:02:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775023.1185387 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sceFR-0007f6-2d; Sat, 10 Aug 2024 05:02:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775023.1185387; Sat, 10 Aug 2024 05:02:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sceFQ-0007ez-Vo; Sat, 10 Aug 2024 05:02:36 +0000
Received: by outflank-mailman (input) for mailman id 775023;
 Sat, 10 Aug 2024 05:02:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sceFQ-0007ep-EX; Sat, 10 Aug 2024 05:02:36 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sceFQ-0003cW-71; Sat, 10 Aug 2024 05:02:36 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sceFP-0004Tt-Cd; Sat, 10 Aug 2024 05:02:35 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sceFP-0001PY-CD; Sat, 10 Aug 2024 05:02:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ctGtQgnaQb7Ti0wPmGaWSpjCvrzhve6T+f5EwwpLrU8=; b=LS1/chEnkEz07CAaNqaSNCn2Dk
	+bbb8WRST+DQJNfeTkB1UPUOK3ofuliEvenoIoAyksZoQvzUVPmH9+5pIUOY1m6xA3oNk4haCNSVS
	wDHG95/pNmgAjjJ4EzLKRe9vKona2I4XD3J3wSyhLsONgPQUbwJRUOnTsWzknpLAWXaU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187201-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187201: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:regression
    linux-linus:build-armhf:xen-build:fail:regression
    linux-linus:build-armhf-libvirt:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-examine:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-libvirt:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:build-check(1):blocked:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=afdab700f65e14070d8ab92175544b1c62b8bf03
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 10 Aug 2024 05:02:35 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail REGR. vs. 186827
 build-armhf                   6 xen-build                fail REGR. vs. 186827

Tests which did not succeed, but are not blocking:
 build-armhf-libvirt           1 build-check(1)               blocked  n/a
 test-armhf-armhf-examine      1 build-check(1)               blocked  n/a
 test-armhf-armhf-libvirt      1 build-check(1)               blocked  n/a
 test-armhf-armhf-libvirt-vhd  1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl           1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-arndale   1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-credit1   1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-credit2   1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-multivcpu  1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-qcow2     1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-raw       1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-rtds      1 build-check(1)               blocked  n/a
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 186827
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                afdab700f65e14070d8ab92175544b1c62b8bf03
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   24 days
Failing since        186925  2024-07-20 09:44:52 Z   20 days   43 attempts
Testing same since   187201  2024-08-09 19:14:21 Z    0 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Sat Aug 10 06:59:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Aug 2024 06:59:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775038.1185412 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scg4f-0007d4-KN; Sat, 10 Aug 2024 06:59:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775038.1185412; Sat, 10 Aug 2024 06:59:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scg4f-0007c8-EC; Sat, 10 Aug 2024 06:59:37 +0000
Received: by outflank-mailman (input) for mailman id 775038;
 Sat, 10 Aug 2024 06:59:36 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jkHu=PJ=amd.com=stefano.stabellini@srs-se1.protection.inumbo.net>)
 id 1scg4e-0007ZQ-Iy
 for xen-devel@lists.xenproject.org; Sat, 10 Aug 2024 06:59:36 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20600.outbound.protection.outlook.com
 [2a01:111:f403:2416::600])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 18ef3b80-56e6-11ef-8776-851b0ebba9a2;
 Sat, 10 Aug 2024 08:59:33 +0200 (CEST)
Received: from CH5PR05CA0020.namprd05.prod.outlook.com (2603:10b6:610:1f0::13)
 by SJ0PR12MB5664.namprd12.prod.outlook.com (2603:10b6:a03:42b::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.14; Sat, 10 Aug
 2024 06:59:28 +0000
Received: from DS2PEPF00003446.namprd04.prod.outlook.com
 (2603:10b6:610:1f0:cafe::10) by CH5PR05CA0020.outlook.office365.com
 (2603:10b6:610:1f0::13) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.10 via Frontend
 Transport; Sat, 10 Aug 2024 06:59:28 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 DS2PEPF00003446.mail.protection.outlook.com (10.167.17.73) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Sat, 10 Aug 2024 06:59:28 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sat, 10 Aug
 2024 01:59:25 -0500
Received: from smtp.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Sat, 10 Aug 2024 01:59:24 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 18ef3b80-56e6-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=V95WD4fjCFUM2vHV58SzfkMRhSegNnjut6c1Alkgk6xJo/daxOuAT2KChAapfofaaQduOoM7Pnd8DzESQx0Y3t0piaU5/BKhzH0927ptSV04ApIyefkffsprifVa++KGHDRJkehzAW6vijpgPiz6njcqmjOWBDOSVC4ydUyfjghPgqDn1HS8cuyZCqmYBR0tSY0JGkXftxE0mcqKYgLTOxUYH8CyuPzblLA68rkbPjkv5SUanAP9LqGuPdb0V0tIeHX5+qgLhOC5tbOHlXIPenBSJ1o8N8iwF9U98KhnM/hOuCRPzC3ymUTgxP5qCEXZRDELT4oJ6GtUKUoSbUS90g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=OhV9SNmCmqV3CEmvdRVQ2xzdM7v4lWF5RK7xW812IoI=;
 b=L59SnjZJvwsRS+AAU80GOeNRUIrooBTouNZDaxPElGaDRJBaG1N7Dgo2Q5mxqBl/fcm9Ftu+h6cCF6F09LK0LetXkhVKHyFbZFHDmybd43DC7xllKvgyw4YWWzBvTwV7nC8h8J/N0+cWGuz18nfQtk/3Xcu5yDwAB5RWg9rSlUMeqU5dbGyPlSEsOHR8TVEuhFrAey1VJQQdI2ld9xbyyIQRtE6rYITv35zK8et87SZ3/j4lgMKRRkIQkXZyyfPooxOtZOAkJyBDVqe8ECqnVYGTCp2tYKLMwrpeb2TNLZ+Yx+pejNPbYMa1Pz5m7xIJK1aykdEiHKLksSfjmnaLpw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=OhV9SNmCmqV3CEmvdRVQ2xzdM7v4lWF5RK7xW812IoI=;
 b=tWqb73wuDp4OQJWIgSwr1Rp7B7jX8yQmRpnwsThZnYSYKBeLPZHS7TWV33401msWZPV3hr+v0MuVCJDYUxTYD6PlkozCxV72mWVR/IcLW3LeUFJq/qRzya/X8p6OqW+ksh0hnXTtAKEeCXDdUCw2aKQxixCwMdUvNQ9ZS2wIMrA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Stefano Stabellini <stefano.stabellini@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: <sstabellini@kernel.org>, <cardoe@cardoe.com>, <michal.orzel@amd.com>,
	Stefano Stabellini <stefano.stabellini@amd.com>
Subject: [PATCH 2/3] automation: add "expect" to containers used to run QEMU tests
Date: Fri, 9 Aug 2024 23:59:19 -0700
Message-ID: <20240810065920.415345-2-stefano.stabellini@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <alpine.DEB.2.22.394.2408091700560.298534@ubuntu-linux-20-04-desktop>
References: <alpine.DEB.2.22.394.2408091700560.298534@ubuntu-linux-20-04-desktop>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB04.amd.com: stefano.stabellini@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS2PEPF00003446:EE_|SJ0PR12MB5664:EE_
X-MS-Office365-Filtering-Correlation-Id: 86a1acdd-c34c-4d1f-7016-08dcb909fa0f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?EnQJJHPsar1JFgEtABVsjoD+xShwbl3LiA5/3+sbQhbBMcX84AgwbygmeU2S?=
 =?us-ascii?Q?l0l2WNZRHHBFo6VcNygNakAt00wNSzZbROA/XIQzQvfm5Lpa33v0HP3q/7/J?=
 =?us-ascii?Q?ZYpdst+r5Rd5SQ5sNPOpb1jnaVkgZm73KeE9yt5ibb8q6ccOkXyXM83NzuAK?=
 =?us-ascii?Q?qb+ALbEkPu20R8meSme/Qh4FLPzemTaXZRAES4RaI9w35clX4TPwEYlGC9JR?=
 =?us-ascii?Q?6y5P8B/sKfLZcM1IxGbmH2f+52n6PE/Pol2BjdFxP+yfshF7oscaCQ+Mj3yW?=
 =?us-ascii?Q?Z5+zsuM41lrq4OUent57JpJsQE9pDLaZC3fRLYEGmTR2Xxd7Dr9KHko7uel4?=
 =?us-ascii?Q?HBcCF4GCRnkC+oqJ/HWugwkR5q7EvIxlO5D6az7RgRpTAPLp1xsgzyOb2f/g?=
 =?us-ascii?Q?gTDQZxOCp66mMennaPzDhwH+Dnutw+X6FOc0rqqY+rdKbglseEqmCi/2Seux?=
 =?us-ascii?Q?FzqyLYD/MPP0NbdnlmEva9vSEgcDORsBDnHvJ0qKAbKrpRb+ibYjyQkAtFrw?=
 =?us-ascii?Q?6OismDVoNpzv+fm06aMn2hVRra9K6r2yRy9ZApdTv9+U+8eNqQD8+y0QXnwn?=
 =?us-ascii?Q?AgkmgqBuI3xNsvp8lhavLoN0KCwFTJfIuKz4HlFBstoxbGxw4F4vSC7YuPPm?=
 =?us-ascii?Q?vi7dHQH4rq0/DtfJz8sDCYqpfnG+K1NTUAudNMaMzv2UIljqDwe97k61IOoV?=
 =?us-ascii?Q?yH//TanOeDTs8wnT6/qg47mKsvhvaycsTMN6Qoeez36WY126A67S7O8AFDp5?=
 =?us-ascii?Q?IrMTJdWqR/NHDNe08r0TpBwnE+hFONJXsjgdWKX+j+oPoH0hcnGmz4qI1f7k?=
 =?us-ascii?Q?+JvI4TCq5OiZPs/SJkeZR/3yQygUNkXIZZ8uk7+e8UG0yyyRu7ld6sp7wuxZ?=
 =?us-ascii?Q?EEVYth0K5rI5o/zSin/7NkqEYP/qxcPn+J7QMT/uUybNxxbuz1W63PxtDAMv?=
 =?us-ascii?Q?i5KUmz4uzEqctnMbpCzyGBhR78zSqreRSmvfus3SxzthKE9w6w7AOUuvej1H?=
 =?us-ascii?Q?AvbNyYWXT9EzuGk/yLFIqG5b/TDEAO57DfOWJ8L8w7SjSom2WsKQfRDqz5jN?=
 =?us-ascii?Q?VM+Wd7vpBl+yxjlZlgkdKkiBUo4EMlDFyNtuFoGTq35Ygw6sb17ru4LtS3Xa?=
 =?us-ascii?Q?A9LoXWUAUHGie33mGjMreS6Cl+oxZeqHZbhbZdgAjrE/+frdP7AZa5Pg6SnL?=
 =?us-ascii?Q?zCLoDFaGoJEzkriF3duu79aulvuF7spDq/E91NO3bOoAOWg0GplEu1hwuY2h?=
 =?us-ascii?Q?b+wACbnmiR2Yl3CzC9KDn6G4Qg+ilcGv+VaykKrok8zUl98emwhSfquRr+EI?=
 =?us-ascii?Q?LwL8pbM8mOxIbAAet/8jjVDJXSnoMHUFNlO0tjTuQXeaC9drgooe2EvG9n61?=
 =?us-ascii?Q?WyCjhZZtgmHdCH1HorMptkxk2XWJVyb7p08gvvw9RjxmeDszaqV0/l/k19zi?=
 =?us-ascii?Q?4nLssmzVzZrJJFy0qqgsDTIMTcRM49Eg?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2024 06:59:28.0146
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 86a1acdd-c34c-4d1f-7016-08dcb909fa0f
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS2PEPF00003446.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5664

It will be used for QEMU tests.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
 automation/build/debian/12-ppc64le.dockerfile       | 1 +
 automation/build/debian/12-riscv64.dockerfile       | 1 +
 automation/build/debian/bookworm-arm64v8.dockerfile | 1 +
 automation/build/debian/bookworm.dockerfile         | 1 +
 4 files changed, 4 insertions(+)

diff --git a/automation/build/debian/12-ppc64le.dockerfile b/automation/build/debian/12-ppc64le.dockerfile
index 3b311e675e..1d5b486bb4 100644
--- a/automation/build/debian/12-ppc64le.dockerfile
+++ b/automation/build/debian/12-ppc64le.dockerfile
@@ -26,6 +26,7 @@ RUN <<EOF
 
         # Qemu for test phase
         qemu-system-ppc
+        expect
     )
 
     apt-get -y --no-install-recommends install "${DEPS[@]}"
diff --git a/automation/build/debian/12-riscv64.dockerfile b/automation/build/debian/12-riscv64.dockerfile
index 03fd4b0305..8d7233d675 100644
--- a/automation/build/debian/12-riscv64.dockerfile
+++ b/automation/build/debian/12-riscv64.dockerfile
@@ -26,6 +26,7 @@ RUN <<EOF
 
         # Qemu for test phase
         qemu-system-riscv64
+        expect
     )
 
     apt-get -y --no-install-recommends install "${DEPS[@]}"
diff --git a/automation/build/debian/bookworm-arm64v8.dockerfile b/automation/build/debian/bookworm-arm64v8.dockerfile
index 11acc07bff..da8ae75125 100644
--- a/automation/build/debian/bookworm-arm64v8.dockerfile
+++ b/automation/build/debian/bookworm-arm64v8.dockerfile
@@ -48,6 +48,7 @@ RUN apt-get update && \
         curl \
         cpio \
         busybox-static \
+        expect \
         && \
         apt-get autoremove -y && \
         apt-get clean && \
diff --git a/automation/build/debian/bookworm.dockerfile b/automation/build/debian/bookworm.dockerfile
index db866fde30..3dd70cb6b2 100644
--- a/automation/build/debian/bookworm.dockerfile
+++ b/automation/build/debian/bookworm.dockerfile
@@ -45,6 +45,7 @@ RUN apt-get update && \
         golang \
         # for test phase, qemu-smoke-* jobs
         qemu-system-x86 \
+        expect \
         # for test phase, qemu-alpine-* jobs
         cpio \
         busybox-static \
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Aug 10 06:59:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Aug 2024 06:59:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775036.1185397 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scg4a-0007LK-2n; Sat, 10 Aug 2024 06:59:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775036.1185397; Sat, 10 Aug 2024 06:59:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scg4Z-0007LD-WE; Sat, 10 Aug 2024 06:59:32 +0000
Received: by outflank-mailman (input) for mailman id 775036;
 Sat, 10 Aug 2024 06:59:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jkHu=PJ=amd.com=stefano.stabellini@srs-se1.protection.inumbo.net>)
 id 1scg4Y-0007L7-Mk
 for xen-devel@lists.xenproject.org; Sat, 10 Aug 2024 06:59:30 +0000
Received: from NAM02-SN1-obe.outbound.protection.outlook.com
 (mail-sn1nam02on2060b.outbound.protection.outlook.com
 [2a01:111:f400:7ea9::60b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1608041c-56e6-11ef-bc04-fd08da9f4363;
 Sat, 10 Aug 2024 08:59:28 +0200 (CEST)
Received: from DM6PR05CA0040.namprd05.prod.outlook.com (2603:10b6:5:335::9) by
 PH0PR12MB5605.namprd12.prod.outlook.com (2603:10b6:510:129::14) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Sat, 10 Aug
 2024 06:59:23 +0000
Received: from DS2PEPF00003441.namprd04.prod.outlook.com
 (2603:10b6:5:335:cafe::14) by DM6PR05CA0040.outlook.office365.com
 (2603:10b6:5:335::9) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.10 via Frontend
 Transport; Sat, 10 Aug 2024 06:59:23 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 DS2PEPF00003441.mail.protection.outlook.com (10.167.17.68) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Sat, 10 Aug 2024 06:58:40 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sat, 10 Aug
 2024 01:58:39 -0500
Received: from ubuntu-20.04.2-arm64.shared (10.180.168.240) by
 SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Sat, 10 Aug 2024 01:58:39 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1608041c-56e6-11ef-bc04-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=uqiBFOS80Zjd50XIMh9+lee+eulHHqk69NQVWfPmNGQB+Ry0zpGQp/l8HE2bx4J9un8EZZXm1BGcRc+7onpZKrvWNTt8QG82stJh6sqvdv1/CJmJe8Ow5bc1v0ldQOGQxOm09DkU0Pwz2XJEaD6OtZb+eA+DiqcY6Yi+7jlLIgGYLalTU5Hd1IOpyGPdxXV+LSdcfjor3pjQpA4xQJWlvjYdepb6V1FZzoJdcHe/oLgQR0l939/LMhFWz89rzTOktYNrUAo3OGjP9nmG9T+lDxlRZmKTRJwQ233VtIgFanjYR7P37T/KpbtUYSH9doYo5qyjUchWGiqI8jzrVOYApQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=mA1IX9t7SEDpbsDMnPj76j30u2PPvC5xIm67jnALTNk=;
 b=meIyE+JuTHfQ2vpJ4U+LR5DFvodvLRA17UoMQJUOOGhgmlKm03An+0JdQbvbv8ebGHM/xZrvJyOHUF3wQZXqaqI8ZcWtUQRnpnURfbRCZfvzHIc58EJUno8EBe4jXbKznywReK/5KSBOQKK5xvPCyeKocPz1RxkTXaVKKZGEy7OFI2k3NsBeHdlAk4qa1hM8RX7r0arndna1BH7iJuA+lC1j3A8hZCuk109S4f0+IQYlcNfWy2mvQyQSGjhe/4H9Njn3NINTJQI+xFkwesbfDvQUoK58pB/sXw73r4LDFAtC5vRxGrB7eRSY3v6EZifAmYWiGLmRPWi/8DvpGyQ3zA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mA1IX9t7SEDpbsDMnPj76j30u2PPvC5xIm67jnALTNk=;
 b=KQ3tbuUuLglHR5bfLfQg004Pscci4lCzti35+4Lv8z50p5c8oZHgcsLTnNa1xYCH9giZ9R1wH4bfo2j2VbHe4+n+EAVcMdoqiMqoF3wANANyjxxgd4mHj27Ln3PiYmLDVfOKRTsVuCR2LcnB/OpKPfjGEkTS/k5Pc0ZrxBIJv8E=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Date: Fri, 9 Aug 2024 23:58:38 -0700
From: Stefano Stabellini <stefano.stabellini@amd.com>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: <xen-devel@lists.xenproject.org>
CC: <sstabellini@kernel.org>, <cardoe@cardoe.com>, Michal Orzel
	<michal.orzel@amd.com>
Subject: [PATCH 0/3] automation: improve pipeline
Message-ID: <alpine.DEB.2.22.394.2408091700560.298534@ubuntu-linux-20-04-desktop>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset="US-ASCII"
Received-SPF: None (SATLEXMB04.amd.com: stefano.stabellini@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS2PEPF00003441:EE_|PH0PR12MB5605:EE_
X-MS-Office365-Filtering-Correlation-Id: 3711fabd-608f-4034-77e9-08dcb909f732
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|376014|82310400026|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?2KKkH4THkybMmLHvzQCiSLj4eMh/y/MSCTT/gS8sBWijVPgYEVmLc2OaPFdC?=
 =?us-ascii?Q?MCXiuSkwP9UUjsoyAy/W3fDqg3B0WDIBFIgRO7BSr8tCqaN9Q8euYv6Txw0Z?=
 =?us-ascii?Q?yaVnMK1OHiFlFMW3PtLNQ1Y+EoC5PI1Joxr0OGrr478M01cGS4/aXJZbJRwl?=
 =?us-ascii?Q?Od3GXUtkEcZNpeDkvRTxrlGad+DGJa/RWF6kjny6SuErnwUH/W84a8UrGx91?=
 =?us-ascii?Q?8LaujXe81am2RZ5zMBsqKe35flIMZf9KQotsdosSsAwej5fHhufS4+x9yji1?=
 =?us-ascii?Q?BUiyO7IuGjSikb+RKzVjaDZqbOhv0YLEIaO7DRN1SoYh1hpjPA/b81eyeLJt?=
 =?us-ascii?Q?fGiOqPKUpWavZC9Ymd2PIBbimWvlnqEfY7HuSxluC3q103fMs/VG6EkYnnee?=
 =?us-ascii?Q?+oDYTfGft4EfZOAf1Va+pibQAU39aovS9IcdLYF6I3XKfIXb+i9yD+fOPIY2?=
 =?us-ascii?Q?SNIGMB+//qPZAidkG402Aniwx2AdVHMRPRZakVdcxfmwIup11TuDitd6YKH8?=
 =?us-ascii?Q?Lpn6gUnemEgD3oB+vkmS3C3zSzd2WMZPiDymqbsdQ6HcSDyr3I6sjhNtLAFS?=
 =?us-ascii?Q?ki+NQ7gnAQ/xPS+3iLDuGL8gBImFz1tX3af4BfocPkXFjr9htPJIxEqLuHmx?=
 =?us-ascii?Q?ffl8Kf/Y1JY+I6UE4eTK3BcGx4nzIT901I3X8BsAxpVg/hUMYS8xhaQtR943?=
 =?us-ascii?Q?/3zPn/EVx0zGW+ny+0ZUxtuWI2/ueTDU9lsBTPArojkcW8J2xrwPDa81/Nse?=
 =?us-ascii?Q?zhitVN998aJAV3r0m0ZzSWZ277hNlZl4BeUfcsPsPDOw1/Re7Irz3tFhGtb4?=
 =?us-ascii?Q?58rQAlWuvIkEfJs0iYNTqdF6+Wy/GiGjyOzoxpXS/gMbYcH/fLCebecblpe7?=
 =?us-ascii?Q?x3SUYMdcZjDfzsZZ/8KedEIAGqfa1Ij0QIDBF+qIdEURby3e82p7Blh2+2DB?=
 =?us-ascii?Q?3OCfe/6RqBXXJBuBj5MrRuhyFTYPPi4esz9UOY38OZZMfMLicCWovetchVul?=
 =?us-ascii?Q?yxS/9qfaMmT3lAFPIt26v4JVy+1pey5wI8sCSXFBEsSPToLGSlDC2pMfYO3r?=
 =?us-ascii?Q?iYuw9OLOHBAF2GpW1ZrJhom+MXrvL+IflpRITH8fRnHiDqTrAYwjDvcjwAii?=
 =?us-ascii?Q?tnSBjOKuTRuw1Lge4ZnzKv6UfGUQy5ZBUgdQnTo3UhIC+lx3XmDLzn1WGbYH?=
 =?us-ascii?Q?ebHmLKYqQn0lm4vvi/zhF42ex+OkL84kFqFJ0nQDnPCDs8SvHICkP5it41Hq?=
 =?us-ascii?Q?IxPn1IUKzPZe61LFqOKJqnOTzA2fC4GmNn+6o3zJCdjXlC6P2RLvb8FceH9U?=
 =?us-ascii?Q?ncnMMte7blmQpF6/yrNncpXjkVKtpBbdpIG9YbMJp2NPo0xup3JWUgrKMAXJ?=
 =?us-ascii?Q?h6IrA7TLm4CY5YH4VjKFS7ffoTTxk/M7Q/YYwHBa/GwP4Hxs1AqhXyHiZBJN?=
 =?us-ascii?Q?q2MDXKH/wjkibGCiNVgVgUprIzQs3bvB?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(82310400026)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2024 06:58:40.5239
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 3711fabd-608f-4034-77e9-08dcb909f732
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS2PEPF00003441.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB5605

Hi all,

Given the recent change in ARM64 runners, moving a way from a fast
baremetal ARM64 server to multiple slower ARM64 VMs and server, this
patch series makes the Gitlab pipeline more resilient to random
infrastructure failures by:

- temporarily disabling the Yocto jobs
- increasing the max timeout of QEMU jobs
- introducing "expect" so that QEMU jobs can stop as soon as the right
  string is received instead of waiting until the timeout

I am making all changes consistent across architectures, even thought
they are only required for arm64 right now.

Cheers,

Stefano


Stefano Stabellini (3):
      automation: disable Yocto jobs
      automation: add "expect" to containers used to run QEMU tests
      automation: use expect to run QEMU

 automation/build/debian/12-ppc64le.dockerfile      |  1 +
 automation/build/debian/12-riscv64.dockerfile      |  1 +
 .../build/debian/bookworm-arm64v8.dockerfile       |  1 +
 automation/build/debian/bookworm.dockerfile        |  1 +
 automation/gitlab-ci/build.yaml                    |  3 ++
 automation/scripts/qemu-alpine-x86_64.sh           | 15 ++++----
 automation/scripts/qemu-key.ex                     | 42 ++++++++++++++++++++++
 automation/scripts/qemu-smoke-dom0-arm32.sh        | 15 ++++----
 automation/scripts/qemu-smoke-dom0-arm64.sh        | 15 ++++----
 automation/scripts/qemu-smoke-dom0less-arm32.sh    | 14 ++++----
 automation/scripts/qemu-smoke-dom0less-arm64.sh    | 14 ++++----
 automation/scripts/qemu-smoke-ppc64le.sh           | 12 +++----
 automation/scripts/qemu-smoke-riscv64.sh           | 12 +++----
 automation/scripts/qemu-smoke-x86-64.sh            | 14 ++++----
 automation/scripts/qemu-xtf-dom0less-arm64.sh      | 14 ++++----
 15 files changed, 104 insertions(+), 70 deletions(-)
 create mode 100755 automation/scripts/qemu-key.ex


From xen-devel-bounces@lists.xenproject.org Sat Aug 10 06:59:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Aug 2024 06:59:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775039.1185427 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scg4h-00083x-0C; Sat, 10 Aug 2024 06:59:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775039.1185427; Sat, 10 Aug 2024 06:59:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scg4g-00083m-TI; Sat, 10 Aug 2024 06:59:38 +0000
Received: by outflank-mailman (input) for mailman id 775039;
 Sat, 10 Aug 2024 06:59:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jkHu=PJ=amd.com=stefano.stabellini@srs-se1.protection.inumbo.net>)
 id 1scg4e-0007L7-VP
 for xen-devel@lists.xenproject.org; Sat, 10 Aug 2024 06:59:37 +0000
Received: from NAM12-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam12on20627.outbound.protection.outlook.com
 [2a01:111:f403:200a::627])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 18a00e15-56e6-11ef-bc04-fd08da9f4363;
 Sat, 10 Aug 2024 08:59:34 +0200 (CEST)
Received: from CH5PR05CA0024.namprd05.prod.outlook.com (2603:10b6:610:1f0::29)
 by DS7PR12MB6192.namprd12.prod.outlook.com (2603:10b6:8:97::6) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.7849.17; Sat, 10 Aug 2024 06:59:29 +0000
Received: from DS2PEPF00003446.namprd04.prod.outlook.com
 (2603:10b6:610:1f0:cafe::65) by CH5PR05CA0024.outlook.office365.com
 (2603:10b6:610:1f0::29) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.12 via Frontend
 Transport; Sat, 10 Aug 2024 06:59:29 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 DS2PEPF00003446.mail.protection.outlook.com (10.167.17.73) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Sat, 10 Aug 2024 06:59:28 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sat, 10 Aug
 2024 01:59:26 -0500
Received: from smtp.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Sat, 10 Aug 2024 01:59:25 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 18a00e15-56e6-11ef-bc04-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=y06hgCpMKbnVFsBeizTCc3Af0vtNkDcWcTxouAj/qSkjGKEuszbof2QSXdsPOnpp56tqymMlzNn3MnRQn1ah9QiTJHaX9lONSh07XL5H2H+ma6zrvh52LQO5Ss7VqRwqhPjSX1/RPjnTGVE5JXWND+mDhbkIvKFg5RRqNrHM972Gat+EigEOSvEuiuIi7XPa92BZP8Wq8VpN+ResJKICszT3xErDZLyb7BCFUdY4ywbBXlEdJbi7EDyzQ/9npML+2+f2PNbdL7rH39A9a2cIlHGEqkhTo1H5TYN3wmw4YQYrY4ydPtmwW5rLihuEkgGPdstb2BZkTM2PV0T527zMXw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0XnNG3qW9EH+V9tal+y68KGxesAb9KisVIj+BBdD00Y=;
 b=wTn8DPaowUe6vvqOhAfPAcucr6GUFSgOYTT+Pq07t85jI00wvhWRXp27ryZJ77BpWRmVheZkax/VmtELvchMvWL3YJi0eZCsMSzXht5Habj0a5Hk9m6ygH/Y6RwrDNiLosQ5jW18z6iRakay0FN0Bn7G8hfXxc934NtGXRSOZO9ozSnCMSgyxVBzJnyH11dJyv+LwUPGHcMGtEFo8r2P/J0XM6nqrV1P1LWX4IBVDEcRs4vmu/6TXuRDHtUkkbh6mpxiKhiAnEL2pOqy4MUOzRY+4g29NvlJxIrvc8sX5WwGa60AcxUfSfrksc6xcjMCTO219fW0oSCVht3vfAthKw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0XnNG3qW9EH+V9tal+y68KGxesAb9KisVIj+BBdD00Y=;
 b=saOU/ixInAAdcHjTZ5OJKOqZ7tgK/o8YVcTqTt87vCqmqa+HfVm7BaZ9sEnjFn+ed5o2momwOlVzZy9GcpN0XdnJ3qjVXIa4xePvYqzRSYryjLcWz0deAPx/LNV50dVknYpsHIvuJm3DuPUAQ/faO+Sqcy7xdf32667s6JFDmU8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Stefano Stabellini <stefano.stabellini@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: <sstabellini@kernel.org>, <cardoe@cardoe.com>, <michal.orzel@amd.com>,
	Stefano Stabellini <stefano.stabellini@amd.com>
Subject: [PATCH 3/3] automation: use expect to run QEMU
Date: Fri, 9 Aug 2024 23:59:20 -0700
Message-ID: <20240810065920.415345-3-stefano.stabellini@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <alpine.DEB.2.22.394.2408091700560.298534@ubuntu-linux-20-04-desktop>
References: <alpine.DEB.2.22.394.2408091700560.298534@ubuntu-linux-20-04-desktop>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB04.amd.com: stefano.stabellini@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS2PEPF00003446:EE_|DS7PR12MB6192:EE_
X-MS-Office365-Filtering-Correlation-Id: 85c468a8-08ae-4c26-0671-08dcb909faa8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?fgB3pkC2bdWt83dcgGrwrcuGRqdkUu/PwMKa1feoUP7foIBzd8YonaAvA3Gc?=
 =?us-ascii?Q?tzRVZwCmKr8c4zUceJC/OLvRStkgic2MAdmuYOzdl3H8zSgNOZQT7Uyq4K5k?=
 =?us-ascii?Q?GBv2ctcx2hn4NK25Y8F3degJaGzEQnGPoAS7XGxkQ/pbyiw5/fx/Dypvxdws?=
 =?us-ascii?Q?hNnAjGkACbIoHLP3r/QirLkQFpGDf8IrCS5S9+9+yPZTLO/OqPjkHhCc5a0l?=
 =?us-ascii?Q?tNr+wvXMmKq/HF1yF+qSC+AAKnjDz870PfSzDOq7Q019epdUqkW2hgkUCLI9?=
 =?us-ascii?Q?d5A1akPEcfuAnl9Rg2Fqepbw8ELbhUrgNiWnuokYTLyjMC4mtm+UMvzT86mX?=
 =?us-ascii?Q?PyGFb/h65ucOGQeCJFBk3AqEN7w2NwyYsgxjg9Oy01Dyb8kgQZBoftIf2n6A?=
 =?us-ascii?Q?o6FK7qEqFC9mT/yRYWNMx3o7Jz9ZNqA60lAFHyUvUa4SQPpabPxeKpjJ/5qK?=
 =?us-ascii?Q?sSMIsd6T8c0DcPwHPKCxUZ7xm86GCGdsu//n4ozp6JJZJbqhx0+B7SkZQdke?=
 =?us-ascii?Q?gPi9NREjFnf34o16Oq+wVZ3w2TwvA4k2Cwf2cNSvaf+VRYuy/qAvfUGOTwko?=
 =?us-ascii?Q?21IdyBU8QnOMIV3XG430TIBzwZXOUTL3aSrSATFAZ9/8oYt7xP2hIgdShj+k?=
 =?us-ascii?Q?vZFGucMsCIfaBmgAJpVYzE5qunj4w9W5Gt6HxZmLgDrVU46pPY6Qa/lOals1?=
 =?us-ascii?Q?D22FwagjhU+F3d9qNI1BqUM207BV6iGe9x5QVEPahur4bPK3xXYSA6JPz9dv?=
 =?us-ascii?Q?u1ur0Ou/svWS67LdpDFnDfu6J2Q7aM8EZ2xG880waRpjoYIhOlSyxi1RK5aa?=
 =?us-ascii?Q?OyJmoOYojjKSwqll7s7yUeQcizRLD/gVh4DBGEoj/YWpnvbLHFAu9a+QNKbh?=
 =?us-ascii?Q?TOE5mKPTHPVXJYSm8aYJ0/FUutaweBU2wkI7DeWXOTbNG3CzeZPQs8E8jLU4?=
 =?us-ascii?Q?RYp/qFlHy7BdafU2IGHuAaJffKJKDhLCa85DYeXGw0DaM6Vt3+nTCPzw9iR4?=
 =?us-ascii?Q?cSl0KsNZDgK/h6Jd24NWeQTbySMkYqorYDRQ+n8Ei8NWR0ZzvsOcdp/lTff0?=
 =?us-ascii?Q?qU9WxwmlJvHItubOkHI6qAYGJYM39eYWSgoswDS+luyn1SoHbKEuLmKmdt+d?=
 =?us-ascii?Q?wt9ddMRNvQYpGZt3fmxutgCd7cdF5QOnF3o4J4wY2w/tRLR+85m2C0Lrd9f7?=
 =?us-ascii?Q?co9GsTvN0gn8K5sQnDwj8mWdB+WE2NsdmOyDTuvUzAWnI7HnCeNPcOEcr7oK?=
 =?us-ascii?Q?jVDa8uyKvNqqGoO7r8TgXvYIdeg2Mkqp4E8IViMW2TxipaRJ2HV7fsggaRhw?=
 =?us-ascii?Q?effiNQllIEVCRyxpVLlPv89MICIH8xVgKqhjZ5+/FqywTfupde2+qpFqRUWv?=
 =?us-ascii?Q?TyvIuSD0ESqXer6Hk60Aol5FjAXrg34oyZxTDmTxQuB/i4+XwcUEGSaOavih?=
 =?us-ascii?Q?ipACmuK+LIeG4dUFFJ/MxNilER5bCTlC?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2024 06:59:28.9677
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 85c468a8-08ae-4c26-0671-08dcb909faa8
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS2PEPF00003446.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6192

Use expect to invoke QEMU so that we can terminate the test as soon as
we get the right string in the output instead of waiting until the
final timeout.

For timeout, instead of an hardcoding the value, use a Gitlab CI
variable "QEMU_TIMEOUT" that can be changed depending on the latest
status of the Gitlab CI runners.

Note that for simplicity in the case of dom0less test, the script only
checks for the $passed string. That is because the dom0 prompt and the
$passed string could happen in any order making it difficult to check
with expect which checks for strings in a specific order.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
 automation/scripts/qemu-alpine-x86_64.sh      | 15 +++----
 automation/scripts/qemu-key.ex                | 42 +++++++++++++++++++
 automation/scripts/qemu-smoke-dom0-arm32.sh   | 15 ++++---
 automation/scripts/qemu-smoke-dom0-arm64.sh   | 15 ++++---
 .../scripts/qemu-smoke-dom0less-arm32.sh      | 14 +++----
 .../scripts/qemu-smoke-dom0less-arm64.sh      | 14 +++----
 automation/scripts/qemu-smoke-ppc64le.sh      | 12 +++---
 automation/scripts/qemu-smoke-riscv64.sh      | 12 +++---
 automation/scripts/qemu-smoke-x86-64.sh       | 14 +++----
 automation/scripts/qemu-xtf-dom0less-arm64.sh | 14 +++----
 10 files changed, 97 insertions(+), 70 deletions(-)
 create mode 100755 automation/scripts/qemu-key.ex

diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 8e398dcea3..24b23a573c 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -77,18 +77,15 @@ EOF
 # Run the test
 rm -f smoke.serial
 set +e
-timeout -k 1 720 \
-qemu-system-x86_64 \
+export qemu_cmd="qemu-system-x86_64 \
     -cpu qemu64,+svm \
     -m 2G -smp 2 \
     -monitor none -serial stdio \
     -nographic \
     -device virtio-net-pci,netdev=n0 \
-    -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0 |& \
-        # Remove carriage returns from the stdout output, as gitlab
-        # interface chokes on them
-        tee smoke.serial | sed 's/\r//'
+    -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0"
 
-set -e
-(grep -q "Domain-0" smoke.serial && grep -q "BusyBox" smoke.serial) || exit 1
-exit 0
+export qemu_log="smoke.serial"
+export log_msg="Domain-0"
+export passed="BusyBox"
+./automation/scripts/qemu-key.ex
diff --git a/automation/scripts/qemu-key.ex b/automation/scripts/qemu-key.ex
new file mode 100755
index 0000000000..569ef2781f
--- /dev/null
+++ b/automation/scripts/qemu-key.ex
@@ -0,0 +1,42 @@
+#!/usr/bin/expect -f
+
+set timeout $env(QEMU_TIMEOUT)
+
+log_file -a $env(qemu_log)
+
+match_max 10000
+
+eval spawn $env(qemu_cmd)
+
+expect_after {
+    -re "(.*)\r" {
+        exp_continue
+    }
+    timeout {send_user "ERROR-Timeout!\n"; exit 1}
+    eof {send_user "ERROR-EOF!\n"; exit 1}
+}
+
+if {[info exists env(uboot_cmd)]} {
+    expect "=>"
+
+    send "$env(uboot_cmd)\r"
+}
+
+if {[info exists env(log_msg)]} {
+    expect "$env(log_msg)"
+}
+
+if {[info exists env(xen_cmd)]} {
+    send "$env(xen_cmd)\r"
+}
+
+if {[info exists env(passed)]} {
+    expect {
+        "$env(passed)" {
+            exit 0
+        }
+    }
+}
+
+expect eof
+
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index eaaea5a982..2835d8a908 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -78,9 +78,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
 
 rm -f ${serial_log}
 set +e
-echo "  virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
-timeout -k 1 720 \
-./qemu-system-arm \
+export qemu_cmd="./qemu-system-arm \
    -machine virt \
    -machine virtualization=true \
    -smp 4 \
@@ -91,9 +89,10 @@ timeout -k 1 720 \
    -no-reboot \
    -device virtio-net-pci,netdev=n0 \
    -netdev user,id=n0,tftp=./ \
-   -bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& \
-      tee ${serial_log} | sed 's/\r//'
+   -bios /usr/lib/u-boot/qemu_arm/u-boot.bin"
 
-set -e
-(grep -q "Domain-0" ${serial_log} && grep -q "^/ #" ${serial_log}) || exit 1
-exit 0
+export uboot_cmd="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export qemu_log="${serial_log}"
+export log_msg="Domain-0"
+export passed="/ #"
+../automation/scripts/qemu-key.ex
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 352963a741..c2eac941d2 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -94,9 +94,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
 # Run the test
 rm -f smoke.serial
 set +e
-echo "  virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
-timeout -k 1 720 \
-./binaries/qemu-system-aarch64 \
+export qemu_cmd="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
     -m 2048 -monitor none -serial stdio \
@@ -104,9 +102,10 @@ timeout -k 1 720 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=binaries \
-    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& \
-        tee smoke.serial | sed 's/\r//'
+    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
 
-set -e
-(grep -q "Domain-0" smoke.serial && grep -q "BusyBox" smoke.serial) || exit 1
-exit 0
+export uboot_cmd="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export qemu_log="smoke.serial"
+export log_msg="Domain-0"
+export passed="BusyBox"
+./automation/scripts/qemu-key.ex
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index c027c8c5c8..9fe08c337a 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -131,9 +131,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
 # Run the test
 rm -f ${serial_log}
 set +e
-echo "  virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
-timeout -k 1 240 \
-./qemu-system-arm \
+export qemu_cmd="./qemu-system-arm \
     -machine virt \
     -machine virtualization=true \
     -smp 4 \
@@ -144,9 +142,9 @@ timeout -k 1 240 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=./ \
-    -bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& \
-        tee ${serial_log} | sed 's/\r//'
+    -bios /usr/lib/u-boot/qemu_arm/u-boot.bin"
 
-set -e
-(grep -q "${dom0_prompt}" ${serial_log} && grep -q "${passed}" ${serial_log}) || exit 1
-exit 0
+export uboot_cmd="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export qemu_log="${serial_log}"
+export passed="${passed}"
+../automation/scripts/qemu-key.ex
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index 15258692d5..fd11482f25 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -205,9 +205,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
 # Run the test
 rm -f smoke.serial
 set +e
-echo "  virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
-timeout -k 1 240 \
-./binaries/qemu-system-aarch64 \
+export qemu_cmd="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt,gic-version=$gic_version \
     -m 2048 -monitor none -serial stdio \
@@ -215,9 +213,9 @@ timeout -k 1 240 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=binaries \
-    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& \
-        tee smoke.serial | sed 's/\r//'
+    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
 
-set -e
-(grep -q "^Welcome to Alpine Linux" smoke.serial && grep -q "${passed}" smoke.serial) || exit 1
-exit 0
+export uboot_cmd="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export qemu_log="smoke.serial"
+export passed="${passed}"
+./automation/scripts/qemu-key.ex
diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/scripts/qemu-smoke-ppc64le.sh
index 9088881b73..72ee9765e9 100755
--- a/automation/scripts/qemu-smoke-ppc64le.sh
+++ b/automation/scripts/qemu-smoke-ppc64le.sh
@@ -11,8 +11,7 @@ machine=$1
 rm -f ${serial_log}
 set +e
 
-timeout -k 1 20 \
-qemu-system-ppc64 \
+export qemu_cmd="qemu-system-ppc64 \
     -bios skiboot.lid \
     -M $machine \
     -m 2g \
@@ -21,9 +20,8 @@ qemu-system-ppc64 \
     -monitor none \
     -nographic \
     -serial stdio \
-    -kernel binaries/xen \
-    |& tee ${serial_log} | sed 's/\r//'
+    -kernel binaries/xen"
 
-set -e
-(grep -q "Hello, ppc64le!" ${serial_log}) || exit 1
-exit 0
+export qemu_log="${serial_log}"
+export passed="Hello, ppc64le!"
+./automation/scripts/qemu-key.ex
diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
index f90df3c051..64630ba7d7 100755
--- a/automation/scripts/qemu-smoke-riscv64.sh
+++ b/automation/scripts/qemu-smoke-riscv64.sh
@@ -6,15 +6,13 @@ set -ex
 rm -f smoke.serial
 set +e
 
-timeout -k 1 2 \
-qemu-system-riscv64 \
+export qemu_cmd="qemu-system-riscv64 \
     -M virt \
     -smp 1 \
     -nographic \
     -m 2g \
-    -kernel binaries/xen \
-    |& tee smoke.serial | sed 's/\r//'
+    -kernel binaries/xen"
 
-set -e
-(grep -q "All set up" smoke.serial) || exit 1
-exit 0
+export qemu_log="smoke.serial"
+export passed="All set up"
+./automation/scripts/qemu-key.ex
diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
index 3014d07314..269396f805 100755
--- a/automation/scripts/qemu-smoke-x86-64.sh
+++ b/automation/scripts/qemu-smoke-x86-64.sh
@@ -16,11 +16,11 @@ esac
 
 rm -f smoke.serial
 set +e
-timeout -k 1 30 \
-qemu-system-x86_64 -nographic -kernel binaries/xen \
+export qemu_cmd="qemu-system-x86_64 -nographic -kernel binaries/xen \
         -initrd xtf/tests/example/$k \
-        -append "loglvl=all console=com1 noreboot console_timestamps=boot $extra" \
-        -m 512 -monitor none -serial file:smoke.serial
-set -e
-grep -q 'Test result: SUCCESS' smoke.serial || exit 1
-exit 0
+        -append \"loglvl=all console=com1 noreboot console_timestamps=boot $extra\" \
+        -m 512 -monitor none -serial stdio"
+
+export qemu_log="smoke.serial"
+export passed="Test result: SUCCESS"
+./automation/scripts/qemu-key.ex
diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
index b08c2d44fb..042f4ed2d9 100755
--- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
+++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
@@ -51,9 +51,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
 # Run the test
 rm -f smoke.serial
 set +e
-echo "  virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
-timeout -k 1 120 \
-./binaries/qemu-system-aarch64 \
+export qemu_cmd="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
     -m 2048 -monitor none -serial stdio \
@@ -61,9 +59,9 @@ timeout -k 1 120 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=binaries \
-    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& \
-        tee smoke.serial | sed 's/\r//'
+    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
 
-set -e
-(grep -q "${passed}" smoke.serial) || exit 1
-exit 0
+export uboot_cmd="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export qemu_log="smoke.serial"
+export passed="${passed}"
+./automation/scripts/qemu-key.ex
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Aug 10 06:59:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Aug 2024 06:59:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775037.1185407 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scg4f-0007aQ-B2; Sat, 10 Aug 2024 06:59:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775037.1185407; Sat, 10 Aug 2024 06:59:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scg4f-0007Zv-81; Sat, 10 Aug 2024 06:59:37 +0000
Received: by outflank-mailman (input) for mailman id 775037;
 Sat, 10 Aug 2024 06:59:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jkHu=PJ=amd.com=stefano.stabellini@srs-se1.protection.inumbo.net>)
 id 1scg4d-0007L7-VI
 for xen-devel@lists.xenproject.org; Sat, 10 Aug 2024 06:59:35 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20601.outbound.protection.outlook.com
 [2a01:111:f403:2416::601])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 19f40a5b-56e6-11ef-bc04-fd08da9f4363;
 Sat, 10 Aug 2024 08:59:35 +0200 (CEST)
Received: from CH5PR05CA0024.namprd05.prod.outlook.com (2603:10b6:610:1f0::29)
 by PH0PR12MB7791.namprd12.prod.outlook.com (2603:10b6:510:280::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Sat, 10 Aug
 2024 06:59:27 +0000
Received: from DS2PEPF00003446.namprd04.prod.outlook.com
 (2603:10b6:610:1f0:cafe::a1) by CH5PR05CA0024.outlook.office365.com
 (2603:10b6:610:1f0::29) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.12 via Frontend
 Transport; Sat, 10 Aug 2024 06:59:26 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 DS2PEPF00003446.mail.protection.outlook.com (10.167.17.73) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Sat, 10 Aug 2024 06:59:26 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sat, 10 Aug
 2024 01:59:24 -0500
Received: from smtp.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Sat, 10 Aug 2024 01:59:23 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 19f40a5b-56e6-11ef-bc04-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=dEYe21sj6F0Nikl+LDNZA1Pse+qaAwaEoHizTaYFcHgpQwABvXUdn7CL/hpqdUUl3h0uIfFSZvDMb9PGQI9kGZQc1z2+yG6uG4Xjv5rR2NG1IKq/nq39kIjfTwtT04t8HmHYLFF2qDbuydwnr/rOvM6oQLKkgUpnJWk1W12JUDcQBeTUjADOzpKH58gbX226fWVu4FQ8XKVqVA4cyAIfyTz/hM/yDwHnwfWCNuUmSTxpSD16w4VSZlf2rP3dSNIoeAX3G6jF65bjv8ldGkXh97gN2viFmFcYJUFDhX2qMnrDUY02ZEqpNhNWYigWiCj/LRxG/JWB/3Dw8x/DmfFhdw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=GuMHa6PFELuzKmtNAeqLrGN+Q5ZS4SG6rDQOYJWFiwY=;
 b=EUEx4fBesHomRnTJqUtyLfYH/B3d68BXOuv0ZUWp+0E9P1Mzy7ZMY0WaIUKDDG2SK8Q8OkV7pXnSdI1Z/YuSpA4kL1hHOB8JOqSyhJKVdFdTLNbqbvcef1vv0B48AYZ6/YZEgQ3fo7PC9pGHHipJ/oMCyX7dQNpjfFKbl8CFmjlHvwPaqvQk1Xaudpv59Ny3WjNXmxekZCeXNoiLQdL/a53fxXhLHR4FCd5onZ81zKEJl4fFSskuu1GSFZ/FvcAuhZ13ixV61DBcKLGyLUpBR8sKBOhLTVEgyYkl4kuUdlx0WpmebR0cDHK/l55AR0a29UvTL4e9BDjSu9HizkZzfA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=GuMHa6PFELuzKmtNAeqLrGN+Q5ZS4SG6rDQOYJWFiwY=;
 b=DlKydzNiBqYkuJ6btA9Ym/ZUkMBOZMxkglhZX+Zf47UXUeyPe9tjh7cpo7XBrDd3uQm49ZZmxE3QNS7l3dqMbLgqc/CHKxUrfkmGEcufPuaViu7SLka4DuRrV6fiTWblVKr5oLT17r6yjKUBRhE1/5NGpgjSfODfIFU5kPxb2p8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Stefano Stabellini <stefano.stabellini@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: <sstabellini@kernel.org>, <cardoe@cardoe.com>, <michal.orzel@amd.com>,
	Stefano Stabellini <stefano.stabellini@amd.com>
Subject: [PATCH 1/3] automation: disable Yocto jobs
Date: Fri, 9 Aug 2024 23:59:18 -0700
Message-ID: <20240810065920.415345-1-stefano.stabellini@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <alpine.DEB.2.22.394.2408091700560.298534@ubuntu-linux-20-04-desktop>
References: <alpine.DEB.2.22.394.2408091700560.298534@ubuntu-linux-20-04-desktop>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB04.amd.com: stefano.stabellini@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS2PEPF00003446:EE_|PH0PR12MB7791:EE_
X-MS-Office365-Filtering-Correlation-Id: 96a2db7e-2bf7-4ef4-b7af-08dcb909f912
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|376014|82310400026|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?QHda/JR5EkKqaRNyPz/TYuky2iNN9haBAWLeu3AxkckBEhmu+6ggPrpoGK3k?=
 =?us-ascii?Q?fs4gMLHvazohFR20L9UuDfPCIA3H+YZvDsubRh6541ib9n+Dew81rEN4wigz?=
 =?us-ascii?Q?/bY1gxFM+MyZH2Ufb/0FDMgoYus0XZ0oXKMGVIYFaqlmBPxscIegaU8eNyki?=
 =?us-ascii?Q?712Kx5lDWaQIJqcqHlyrpcptgOFwWkIWOuHkYvX1kr6NW644KtXnaBgWZAik?=
 =?us-ascii?Q?DmKFBvz1r7WaBuwQSubEhKO+ok/WPG5hcWrHmH3EvIYLvIxUOW8upVBLZ76X?=
 =?us-ascii?Q?pfzU9gGhlf3vtBoOE8BwsLC731cueTKDJkUZ8ufZQE4CQe6IkrNuXgQZr5rg?=
 =?us-ascii?Q?HAld7GgDBSxTAJyANPQ0eU1hsXQ3EMUpdK6ODkiQ3ksvPjrJT42HruLydWqv?=
 =?us-ascii?Q?7FpR7jCez3XVitURGljbl4A8Vc5AL7NESPRRmaok06Fep9NOQyBYPzx+DEKp?=
 =?us-ascii?Q?rwI/643oWRxJIxiWgt4ir939+02dsNW9XVOOtLuRifAfD3dbJ+3j8z0DzM6x?=
 =?us-ascii?Q?yPzs8Yrk+/nn16wFUsNqJ48nyb52svkg7oHuC8wGPS/5m7WTuCcZs+loGxc8?=
 =?us-ascii?Q?mDKJLdSe1sMW8qTZSoY44wsWqIcTesD7gL86uF8lx3LsEJruJGofNoLMYH2w?=
 =?us-ascii?Q?zSJwa1YneXOCxtRZ4beAeGC9YOlziPyJ3XqRksCG0Tf1o2MVENfCHcmuWzqR?=
 =?us-ascii?Q?rrDwxgH1xSymwKLeTIGPOgQT8PV74MsInG3ZHyQOn9s3lNBQ17JNCJX+YKb7?=
 =?us-ascii?Q?pxQclLCaILhOtrIpFNoKQM937DsSrZCMvmKEvBpemNAlM3HUcPU22Z7dPs/D?=
 =?us-ascii?Q?TYWAsD40npOSodWmfGKFal39UkYmIXcYnNTRGlSpvfKWB9RSwJeshmbo9+RU?=
 =?us-ascii?Q?n5m4mtIpJUXkNVBPysG0zSy1bXOnQUHW/vGHZOg6fR/nTHdCk+Ul9ozcgkLb?=
 =?us-ascii?Q?hmepJhCecwxP00xJcItKX+Tk7CUJ390SvXd+eKaS6yPF96+jxF2N2GYVxc+o?=
 =?us-ascii?Q?hoCRkH1SKcrmMyIqaqFyTCBuR1QfLMNa47Y0ydBZLZ6G4w32OWKmHzx1EtWG?=
 =?us-ascii?Q?vYQ/KgOA7dkTfwTxQm3pr+G3smd9KSOa7fiJh3084bpM1OHBBgm5AeYEloWE?=
 =?us-ascii?Q?bzUU0wk/5IYySrXQeBZ4ByOxOrcC0qDkycjjpv616r91ooWNdx1AAZhzFq7M?=
 =?us-ascii?Q?mLrTIdL/3I+o+f7789m/dWHvnUhbeyaNkDiFNs1/jew1Gn3rE5I17gSLM6JS?=
 =?us-ascii?Q?MY0yjpvo1kRmvS/9hqCiD95QalxhLf6tkcxkACOM8ithF3FVztCxmfFrB5id?=
 =?us-ascii?Q?pwwueNxPtjh7LrZfRmukg1ivXUopNFRtMImxXsliXrjtjCoV61vV6HWNl1go?=
 =?us-ascii?Q?ExAKxROwc5jhtP0x1wEQv40doKSUFeJCuJtZzS2JdyRWCfwT6EihcKQM5FDZ?=
 =?us-ascii?Q?xAFVY+xwxW1gN/hb3+z+NDDoVN3fHSXJ?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(82310400026)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2024 06:59:26.3115
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 96a2db7e-2bf7-4ef4-b7af-08dcb909f912
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS2PEPF00003446.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7791

The Yocto jobs take a long time to run. We are changing Gitlab ARM64
runners and the new runners might not be able to finish the Yocto jobs
in a reasonable time.

For now, disable the Yocto jobs by turning them into "manual" trigger
(they need to be manually executed.)

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
 automation/gitlab-ci/build.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 32045cef0c..c668736bdc 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -470,17 +470,20 @@ yocto-qemuarm64:
   extends: .yocto-test-arm64
   variables:
     YOCTO_BOARD: qemuarm64
+  when: manual
 
 yocto-qemuarm:
   extends: .yocto-test-arm64
   variables:
     YOCTO_BOARD: qemuarm
     YOCTO_OUTPUT: --copy-output
+  when: manual
 
 yocto-qemux86-64:
   extends: .yocto-test-x86-64
   variables:
     YOCTO_BOARD: qemux86-64
+  when: manual
 
 # Cppcheck analysis jobs
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Sat Aug 10 07:02:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Aug 2024 07:02:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775071.1185437 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scg7b-00027t-JQ; Sat, 10 Aug 2024 07:02:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775071.1185437; Sat, 10 Aug 2024 07:02:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scg7b-00027m-GU; Sat, 10 Aug 2024 07:02:39 +0000
Received: by outflank-mailman (input) for mailman id 775071;
 Sat, 10 Aug 2024 07:02:38 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=FXrv=PJ=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1scg7a-00027g-JY
 for xen-devel@lists.xenproject.org; Sat, 10 Aug 2024 07:02:38 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org
 [2604:1380:40e1:4800::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 852bd851-56e6-11ef-8776-851b0ebba9a2;
 Sat, 10 Aug 2024 09:02:36 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id F0038CE0B22;
 Sat, 10 Aug 2024 07:02:33 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F211C32781;
 Sat, 10 Aug 2024 07:02:32 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 852bd851-56e6-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723273353;
	bh=eoW1in6mmNiosgaxO6oqmstnzl53KTbpDDo9/YwWLJM=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=qQXpQtGnMW2841viUiZ1QZfkng7b3+XTSv0Ml5QVN+86AUecPLK+GWNkb2x24QKXG
	 SzbYCI6RRBazsLMdeKbJgYu9di2v3qzokDDGMRhR8twgVuZBaJBxVsguL8nQAjKwj7
	 LU1mTp7t0sdb2lH8ubknMGwMy2m+uSLF7Y83qHeYi47br3S9wpHiXZyQXImg7uCQO4
	 JP+9z55MTOoDCpB3nTxUfZ4Pb+ajLEfazn36GMraz8KDHVtaZeuDhYLhwxxwhs6JWC
	 7lyFc3noHO86yHOE2+bPQRsiFPI6LLyacwXIF/Lw9vhPB9GWBbPUi6wLDJABeGpKwY
	 Mheds/S8J36ZA==
Date: Sat, 10 Aug 2024 00:02:27 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Stefano Stabellini <stefano.stabellini@amd.com>
cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org, cardoe@cardoe.com, 
    Michal Orzel <michal.orzel@amd.com>
Subject: Re: [PATCH 0/3] automation: improve pipeline
In-Reply-To: <alpine.DEB.2.22.394.2408091700560.298534@ubuntu-linux-20-04-desktop>
Message-ID: <alpine.DEB.2.22.394.2408100002210.298534@ubuntu-linux-20-04-desktop>
References: <alpine.DEB.2.22.394.2408091700560.298534@ubuntu-linux-20-04-desktop>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

I forgot to add proof that it works:

https://gitlab.com/xen-project/people/sstabellini/xen/-/pipelines/1408058335



On Fri, 9 Aug 2024, Stefano Stabellini wrote:
> Hi all,
> 
> Given the recent change in ARM64 runners, moving a way from a fast
> baremetal ARM64 server to multiple slower ARM64 VMs and server, this
> patch series makes the Gitlab pipeline more resilient to random
> infrastructure failures by:
> 
> - temporarily disabling the Yocto jobs
> - increasing the max timeout of QEMU jobs
> - introducing "expect" so that QEMU jobs can stop as soon as the right
>   string is received instead of waiting until the timeout
> 
> I am making all changes consistent across architectures, even thought
> they are only required for arm64 right now.
> 
> Cheers,
> 
> Stefano
> 
> 
> Stefano Stabellini (3):
>       automation: disable Yocto jobs
>       automation: add "expect" to containers used to run QEMU tests
>       automation: use expect to run QEMU
> 
>  automation/build/debian/12-ppc64le.dockerfile      |  1 +
>  automation/build/debian/12-riscv64.dockerfile      |  1 +
>  .../build/debian/bookworm-arm64v8.dockerfile       |  1 +
>  automation/build/debian/bookworm.dockerfile        |  1 +
>  automation/gitlab-ci/build.yaml                    |  3 ++
>  automation/scripts/qemu-alpine-x86_64.sh           | 15 ++++----
>  automation/scripts/qemu-key.ex                     | 42 ++++++++++++++++++++++
>  automation/scripts/qemu-smoke-dom0-arm32.sh        | 15 ++++----
>  automation/scripts/qemu-smoke-dom0-arm64.sh        | 15 ++++----
>  automation/scripts/qemu-smoke-dom0less-arm32.sh    | 14 ++++----
>  automation/scripts/qemu-smoke-dom0less-arm64.sh    | 14 ++++----
>  automation/scripts/qemu-smoke-ppc64le.sh           | 12 +++----
>  automation/scripts/qemu-smoke-riscv64.sh           | 12 +++----
>  automation/scripts/qemu-smoke-x86-64.sh            | 14 ++++----
>  automation/scripts/qemu-xtf-dom0less-arm64.sh      | 14 ++++----
>  15 files changed, 104 insertions(+), 70 deletions(-)
>  create mode 100755 automation/scripts/qemu-key.ex
> 


From xen-devel-bounces@lists.xenproject.org Sat Aug 10 08:25:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Aug 2024 08:25:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775090.1185458 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1schPw-0007Qx-PY; Sat, 10 Aug 2024 08:25:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775090.1185458; Sat, 10 Aug 2024 08:25:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1schPw-0007Qq-Mr; Sat, 10 Aug 2024 08:25:40 +0000
Received: by outflank-mailman (input) for mailman id 775090;
 Sat, 10 Aug 2024 08:25:39 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1schPv-0007Qg-1G; Sat, 10 Aug 2024 08:25:39 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1schPu-0007qN-Vv; Sat, 10 Aug 2024 08:25:39 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1schPu-0004gF-DC; Sat, 10 Aug 2024 08:25:38 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1schPu-0006ap-90; Sat, 10 Aug 2024 08:25:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=hAvpRfkowEl2hchEyYXOJXJmUQ0bRqtGDInebUS83B4=; b=4+yYKRRTNYLmERp8LTH09y2Nbl
	ROX9FarMR8qJDZTeZCGdM/rDO+yoVItODc86SQ8nDmc/IuFup3buhKmoGT5rdQF9HEePzGbxE3j95
	Zfx52wRJdAx9Gfdtyqx193n2ubu2Pewam3l6h2rJMYt1GGY5lXjDdmpn0u2CeiJF1o4c=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187202-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187202: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    xen-unstable:test-amd64-coresched-amd64-xl:debian-fixup:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=08aacc392d86d4c7dbebdb5e664060ae2af72057
X-Osstest-Versions-That:
    xen=6b9b96ddebf269579730ff2a65f324505bc2aba9
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 10 Aug 2024 08:25:38 +0000

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

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail in 187200 pass in 187202
 test-amd64-coresched-amd64-xl 13 debian-fixup              fail pass in 187200

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

version targeted for testing:
 xen                  08aacc392d86d4c7dbebdb5e664060ae2af72057
baseline version:
 xen                  6b9b96ddebf269579730ff2a65f324505bc2aba9

Last test of basis   187186  2024-08-08 01:53:56 Z    2 days
Testing same since   187195  2024-08-08 15:11:26 Z    1 days    3 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Matthew Barnes <matthew.barnes@cloud.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   6b9b96ddeb..08aacc392d  08aacc392d86d4c7dbebdb5e664060ae2af72057 -> master


From xen-devel-bounces@lists.xenproject.org Sat Aug 10 11:41:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Aug 2024 11:41:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775114.1185469 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sckSo-0002rm-2r; Sat, 10 Aug 2024 11:40:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775114.1185469; Sat, 10 Aug 2024 11:40:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sckSo-0002rf-0C; Sat, 10 Aug 2024 11:40:50 +0000
Received: by outflank-mailman (input) for mailman id 775114;
 Sat, 10 Aug 2024 11:40:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sckSm-0002rV-Jc; Sat, 10 Aug 2024 11:40:48 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sckSm-0002hB-DR; Sat, 10 Aug 2024 11:40:48 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sckSl-00045q-TB; Sat, 10 Aug 2024 11:40:48 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sckSl-0005eK-Sk; Sat, 10 Aug 2024 11:40:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=FzCobMh10ynTWpA4p+Rdl+AOwWyFWnr1oeecY/t282Y=; b=PSbhOnZ/Ll9GYVdalbAn/ZQW/u
	3AwRKP2l01HIa9ZKQ5k6BWGxaxJRehpRbPlULibLEq5Bu5n8HeKCZNIphBQEhvCnDmzkOXhzxemHx
	3gnQ+A7bI6kiWZxWIoXUnJOaMhV0/I/YePZMTIdkyfhM70ynFCO6joNcn+yCYYvSaD60=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187204-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187204: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=71f14351f9b6ef3294c86df22751a7eaf019b4e2
X-Osstest-Versions-That:
    libvirt=11f6773f198636b80e73fb3f69adc83554860172
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 10 Aug 2024 11:40:47 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 libvirt              71f14351f9b6ef3294c86df22751a7eaf019b4e2
baseline version:
 libvirt              11f6773f198636b80e73fb3f69adc83554860172

Last test of basis   187198  2024-08-09 04:22:38 Z    1 days
Testing same since   187204  2024-08-10 04:20:32 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Michal Privoznik <mprivozn@redhat.com>
  Peter Krempa <pkrempa@redhat.com>
  Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
  Sandesh Patel <sandesh.patel@nutanix.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   11f6773f19..71f14351f9  71f14351f9b6ef3294c86df22751a7eaf019b4e2 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sat Aug 10 15:42:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Aug 2024 15:42:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775141.1185478 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scoEJ-0004Q4-2k; Sat, 10 Aug 2024 15:42:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775141.1185478; Sat, 10 Aug 2024 15:42:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scoEI-0004Px-Vu; Sat, 10 Aug 2024 15:42:06 +0000
Received: by outflank-mailman (input) for mailman id 775141;
 Sat, 10 Aug 2024 15:42:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scoEH-0004Pl-4h; Sat, 10 Aug 2024 15:42:05 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scoEG-0006rR-R8; Sat, 10 Aug 2024 15:42:04 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scoEG-0002TA-Bw; Sat, 10 Aug 2024 15:42:04 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1scoEG-0007Ja-BN; Sat, 10 Aug 2024 15:42:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=hHFMG699RXtFL8W3+ZeUV1tUVcl425ovSwzwy5HPv2w=; b=eAVohYqVTRzDJ33UemHuZwp8vI
	FymHyk8qmLyI3CLLDggzNV493h2RA//cbsRa/6IOsxvcX+KBM5KpjneY7W9EKWbCLQD9Hy+o9jJdP
	5sFfyW7HyvIjj6quixy4qCVd7FsBacja3zOfeUBBxYf5Vyi6mw93rzlYqwEB8lrp44GE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187205-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187205: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=34ac1e82e5a78d5ed7f647766f5b1b51ca4d983a
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 10 Aug 2024 15:42:04 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827

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

version targeted for testing:
 linux                34ac1e82e5a78d5ed7f647766f5b1b51ca4d983a
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   24 days
Failing since        186925  2024-07-20 09:44:52 Z   21 days   44 attempts
Testing same since   187205  2024-08-10 05:08:29 Z    0 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Sat Aug 10 19:19:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Aug 2024 19:19:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775161.1185489 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scrc4-0002nV-Va; Sat, 10 Aug 2024 19:18:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775161.1185489; Sat, 10 Aug 2024 19:18:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scrc4-0002nO-Rh; Sat, 10 Aug 2024 19:18:52 +0000
Received: by outflank-mailman (input) for mailman id 775161;
 Sat, 10 Aug 2024 19:18:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scrc4-0002nE-Bu; Sat, 10 Aug 2024 19:18:52 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scrc4-0004dp-1F; Sat, 10 Aug 2024 19:18:52 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scrc3-0001ok-IY; Sat, 10 Aug 2024 19:18:51 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1scrc3-0000sz-IA; Sat, 10 Aug 2024 19:18:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=YuDvOQiUWfSLqPVSAIk5InJtfpEaon+rpbPJ3ehR1Ps=; b=vG7PiFDU5IuZHr1fyorgvKzsd6
	A4ovE0I2ZqqYvewsx6/+jmackEaaZKC+0AnNoLP8jsPs42N+HRxADFyalgY6T+pM57RrM32DYZQdh
	225jyHbowtoQVf3V6uF7xGClrNBhzLQEzT3Wk2GYlY63UvVL2w9JWNGrNovhnXkEtqRA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187206-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187206: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=d61248b0fa2cdfc0be1d806c43d1b211a72b5d49
X-Osstest-Versions-That:
    xen=08aacc392d86d4c7dbebdb5e664060ae2af72057
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 10 Aug 2024 19:18:51 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 xen                  d61248b0fa2cdfc0be1d806c43d1b211a72b5d49
baseline version:
 xen                  08aacc392d86d4c7dbebdb5e664060ae2af72057

Last test of basis   187202  2024-08-09 23:40:54 Z    0 days
Testing same since   187206  2024-08-10 08:30:54 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Ayan Kumar Halder <ayan.kumar.halder@amd.com>
  Bertrand Marquis <bertrand.marquis@arm.com>
  Michal Orzel <michal.orzel@amd.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   08aacc392d..d61248b0fa  d61248b0fa2cdfc0be1d806c43d1b211a72b5d49 -> master


From xen-devel-bounces@lists.xenproject.org Sun Aug 11 00:15:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Aug 2024 00:15:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775178.1185507 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scwEh-0004KM-SX; Sun, 11 Aug 2024 00:15:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775178.1185507; Sun, 11 Aug 2024 00:15:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1scwEh-0004KF-Oy; Sun, 11 Aug 2024 00:15:03 +0000
Received: by outflank-mailman (input) for mailman id 775178;
 Sun, 11 Aug 2024 00:15:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scwEg-0004K5-1Z; Sun, 11 Aug 2024 00:15:02 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scwEf-0002fS-S0; Sun, 11 Aug 2024 00:15:01 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1scwEf-0001LB-BK; Sun, 11 Aug 2024 00:15:01 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1scwEf-0004bf-Ak; Sun, 11 Aug 2024 00:15:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ZWAaKgpsbj06IZf41KZrVGRZUksOEMSg9u16jDkIXMQ=; b=E/ARh8mhib/3CGhSHnF9DLB1kb
	NX5oIRUvmUta0t5kIFLELY9IxWT40Ez3jU3i9pCQo6ZYfSTZo5cVwiqRoqYCkaydPoqQ3OO1zkkCX
	5HmwhLztWoCpwchTAthm6Gqysz+30ZKqS+dg957Pjq62JlU0/isGU1l0cHOg8kQuO7Rw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187207-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187207: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=34ac1e82e5a78d5ed7f647766f5b1b51ca4d983a
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 11 Aug 2024 00:15:01 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827

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

version targeted for testing:
 linux                34ac1e82e5a78d5ed7f647766f5b1b51ca4d983a
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   25 days
Failing since        186925  2024-07-20 09:44:52 Z   21 days   45 attempts
Testing same since   187205  2024-08-10 05:08:29 Z    0 days    2 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Sun Aug 11 07:37:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Aug 2024 07:37:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775204.1185518 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sd38H-0004JY-7S; Sun, 11 Aug 2024 07:36:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775204.1185518; Sun, 11 Aug 2024 07:36:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sd38H-0004JR-3D; Sun, 11 Aug 2024 07:36:53 +0000
Received: by outflank-mailman (input) for mailman id 775204;
 Sun, 11 Aug 2024 07:36:51 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sd38F-0004JH-ES; Sun, 11 Aug 2024 07:36:51 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sd38F-0005ab-4r; Sun, 11 Aug 2024 07:36:51 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sd38E-0002RT-Jo; Sun, 11 Aug 2024 07:36:50 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sd38E-0003ow-Hl; Sun, 11 Aug 2024 07:36:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=htev57g2fZ6REDh4AcBRhlhKlOJBIvfvF1Bpo9NYIwQ=; b=MkD2KcqFq5Dz8ivS3VI/P+7SrZ
	MCcVmrWATr/Ia5lefc/He9r7FkWfDzin8CrtK8pym+6L1B8oYxD1dVC/gj0wu6rg0F+oxX8vV/Pqn
	1Ho/EEC8w0ydvZLiZwgZd8bH1URhgyEYIH7sOtGBZlfV25Wa3GtroUwmSWOg1Q70kmp0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187208-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187208: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-coresched-amd64-xl:debian-fixup:fail:regression
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=5189dafa4cf950e675f02ee04b577dfbbad0d9b1
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 11 Aug 2024 07:36:50 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-coresched-amd64-xl 13 debian-fixup            fail REGR. vs. 186827
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827

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

version targeted for testing:
 linux                5189dafa4cf950e675f02ee04b577dfbbad0d9b1
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   25 days
Failing since        186925  2024-07-20 09:44:52 Z   21 days   46 attempts
Testing same since   187208  2024-08-11 00:44:19 Z    0 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Sun Aug 11 10:59:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Aug 2024 10:59:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775225.1185527 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sd6IQ-0000Sf-9y; Sun, 11 Aug 2024 10:59:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775225.1185527; Sun, 11 Aug 2024 10:59:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sd6IQ-0000SY-6n; Sun, 11 Aug 2024 10:59:34 +0000
Received: by outflank-mailman (input) for mailman id 775225;
 Sun, 11 Aug 2024 10:59:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sd6IO-0000SM-Bz; Sun, 11 Aug 2024 10:59:32 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sd6IO-0001EN-1F; Sun, 11 Aug 2024 10:59:32 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sd6IN-0000o8-DK; Sun, 11 Aug 2024 10:59:31 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sd6IN-00084i-CW; Sun, 11 Aug 2024 10:59:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=4Iclq+d1tLZNdiDM93J+Y4BlFlnqpFj+upauRDOKRCo=; b=m4oniAlKcDq/aYSXflHua44WG3
	rYN9OtS4easKUKRrP4OBKPS+EnsxzRLtGMThpQJ4r/kOQYdUbI3eC1eXcC9BEY2JEwV0XhLg+lY+O
	XOmvRzhSEMqbXsMBoHqq6pCJ2zkmapeTSFYissxGBDo7PHUM4lDq8Gkt4iYmG2yNMLqs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187209-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187209: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=d61248b0fa2cdfc0be1d806c43d1b211a72b5d49
X-Osstest-Versions-That:
    xen=d61248b0fa2cdfc0be1d806c43d1b211a72b5d49
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 11 Aug 2024 10:59:31 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 xen                  d61248b0fa2cdfc0be1d806c43d1b211a72b5d49
baseline version:
 xen                  d61248b0fa2cdfc0be1d806c43d1b211a72b5d49

Last test of basis   187209  2024-08-11 01:54:18 Z    0 days
Testing same since                          (not found)         0 attempts

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


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

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

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

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


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Sun Aug 11 15:52:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Aug 2024 15:52:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775263.1185536 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdArV-00017J-FJ; Sun, 11 Aug 2024 15:52:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775263.1185536; Sun, 11 Aug 2024 15:52:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdArV-00017C-Bz; Sun, 11 Aug 2024 15:52:05 +0000
Received: by outflank-mailman (input) for mailman id 775263;
 Sun, 11 Aug 2024 15:52:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdArT-000172-IJ; Sun, 11 Aug 2024 15:52:03 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdArT-0006pz-7E; Sun, 11 Aug 2024 15:52:03 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdArS-000577-NI; Sun, 11 Aug 2024 15:52:02 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sdArS-0005M6-Mc; Sun, 11 Aug 2024 15:52:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=spDWjYpAhev7MzV2rA6BGx9By7G3Jx2a27vpl8vv40w=; b=BiMsGRoL3mMakvnUGm1m8s9ikA
	UqyNHKsblz0pxZPpdvT5C3pamap+q6XhCKjIgPZFfjp7BWI5CMbmnpGerQQnJDr0/C122DVmNxDq8
	GyeXA2561vebtzPAs1NlAhXFrwGy4jys1uF57UwA9K9NJJHDzxUQhxmL87A4/FNKhsGU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187210-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187210: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-amd64-coresched-amd64-xl:debian-fixup:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-arndale:xen-boot:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=5189dafa4cf950e675f02ee04b577dfbbad0d9b1
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 11 Aug 2024 15:52:02 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827

Tests which are failing intermittently (not blocking):
 test-amd64-coresched-amd64-xl 13 debian-fixup    fail in 187208 pass in 187210
 test-armhf-armhf-xl-arndale   8 xen-boot                   fail pass in 187208

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

version targeted for testing:
 linux                5189dafa4cf950e675f02ee04b577dfbbad0d9b1
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   25 days
Failing since        186925  2024-07-20 09:44:52 Z   22 days   47 attempts
Testing same since   187208  2024-08-11 00:44:19 Z    0 days    2 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Sun Aug 11 21:10:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Aug 2024 21:10:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775296.1185546 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdFp9-0004mz-UJ; Sun, 11 Aug 2024 21:09:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775296.1185546; Sun, 11 Aug 2024 21:09:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdFp9-0004ms-Qw; Sun, 11 Aug 2024 21:09:59 +0000
Received: by outflank-mailman (input) for mailman id 775296;
 Sun, 11 Aug 2024 21:09:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdFp8-0004mi-CS; Sun, 11 Aug 2024 21:09:58 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdFp8-0004qM-2R; Sun, 11 Aug 2024 21:09:58 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdFp7-0008I4-Ip; Sun, 11 Aug 2024 21:09:57 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sdFp7-00031s-II; Sun, 11 Aug 2024 21:09:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=5yhMGx3f/fdjoiYnBst/XQkaFQBNwcdL5hOSNCcdYhY=; b=fQbTDwDSZBMOwSxbiIqEaITxf4
	yxMI1RHdizKQwO9kGFQ7d4lCeHfdEuXfjB5CWrgN5+lr/wUyvMTyNFe2+mAzMm5Aur14ZJC72LKAF
	NHEgvXFWC3DfE79NOn+dFPzSsw9ZBRBviT6FAK2I43btniYpyQRorx4iB30GqK3A92AM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187211-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-6.1 test] 187211: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-6.1:test-armhf-armhf-xl-raw:xen-boot:fail:heisenbug
    linux-6.1:test-amd64-amd64-qemuu-freebsd12-amd64:guest-start/freebsd.repeat:fail:heisenbug
    linux-6.1:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    linux-6.1:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=36790ef5e00b69ccb92817f95ba1928eea24eebb
X-Osstest-Versions-That:
    linux=48d525b0e4634c487cf46a41c1e2824e9ee258ce
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 11 Aug 2024 21:09:57 +0000

flight 187211 linux-6.1 real [real]
flight 187213 linux-6.1 real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187211/
http://logs.test-lab.xenproject.org/osstest/logs/187213/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-raw       8 xen-boot            fail pass in 187213-retest
 test-amd64-amd64-qemuu-freebsd12-amd64 21 guest-start/freebsd.repeat fail pass in 187213-retest
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 187213-retest

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

version targeted for testing:
 linux                36790ef5e00b69ccb92817f95ba1928eea24eebb
baseline version:
 linux                48d525b0e4634c487cf46a41c1e2824e9ee258ce

Last test of basis   187139  2024-08-04 00:11:12 Z    7 days
Testing same since   187211  2024-08-11 10:42:52 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  "Huang, Ying" <ying.huang@intel.com>
  Al Viro <viro@zeniv.linux.org.uk>
  Alexander Maltsev <keltar.gw@gmail.com>
  Alexandra Winter <wintera@linux.ibm.com>
  Alexey Gladkov <legion@kernel.org>
  Alice Ryhl <aliceryhl@google.com>
  Andrew Morton <akpm@linux-foundation.org>
  Andy Chiu <andy.chiu@sifive.com>
  Aurinko <petrvelicka@tuta.io>
  Baokun Li <libaokun1@huawei.com>
  Basavaraj Natikar <Basavaraj.Natikar@amd.com>
  Benjamin Tissoires <bentiss@kernel.org>
  Binbin Zhou <zhoubinbin@loongson.cn>
  Bjorn Andersson <andersson@kernel.org>
  bo liu <bo.liu@senarytech.com>
  Catalin Marinas <catalin.marinas@arm.com>
  Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel)
  ChromeOS CQ Test <chromeos-kernel-stable-merge@google.com>
  Dan Carpenter <dan.carpenter@linaro.org>
  Danilo Krummrich <dakr@kernel.org>
  David S. Miller <davem@davemloft.net>
  David Sterba <dsterba@suse.com>
  Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
  Doug Brown <doug@schmorgal.com>
  Dustin L. Howett <dustin@howett.net>
  Edmund Raile <edmund.raile@protonmail.com>
  Eric Dumazet <edumazet@google.com>
  Eric W. Biederman <ebiederm@xmission.com>
  Florian Fainelli <florian.fainelli@broadcom.com>
  Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  Hans de Goede <hdegoede@redhat.com>
  Heiner Kallweit <hkallweit1@gmail.com>
  Herve Codina <herve.codina@bootlin.com>
  Huang Ying <ying.huang@intel.com>
  Ian Forbes <ian.forbes@broadcom.com>
  Imre Deak <imre.deak@intel.com>
  Jaegeuk Kim <jaegeuk@kernel.org>
  Jakub Kicinski <kuba@kernel.org>
  Jani Nikula <jani.nikula@intel.com>
  Javier Carrasco <javier.carrasco.cruz@gmail.com>
  Jiaxun Yang <jiaxun.yang@flygoat.com>
  Jiri Kosina <jkosina@suse.cz>
  Joel Granados <j.granados@samsung.com>
  Jon Hunter <jonathanh@nvidia.com>
  Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
  Jozsef Kadlecsik <kadlec@netfilter.org>
  kernelci.org bot <bot@kernelci.org>
  Krishna Kurapati <quic_kriskura@quicinc.com>
  Kuniyuki Iwashima <kuniyu@amazon.com>
  Lee Jones <lee@kernel.org>
  Li Zhijian <lizhijian@fujitsu.com>
  Linux Kernel Functional Testing <lkft@linaro.org>
  Liu Jing <liujing@cmss.chinamobile.com>
  Lucas Stach <l.stach@pengutronix.de>
  Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  Ma Ke <make24@iscas.ac.cn>
  Maciej Fijalkowski <maciej.fijalkowski@intel.com>
  Maciej Żenczykowski <maze@google.com>
  Mark Bloch <mbloch@nvidia.com>
  Matthieu Baerts (NGI0) <matttbe@kernel.org>
  Mavroudis Chatzilazaridis <mavchatz@protonmail.com>
  Mel Gorman <mgorman@techsingularity.net>
  Michal Kubiak <michal.kubiak@intel.com>
  Miguel Ojeda <ojeda@kernel.org>
  Moshe Shemesh <moshe@nvidia.com>
  Naohiro Aota <naohiro.aota@wdc.com>
  Nikita Zhandarovich <n.zhandarovich@fintech.ru>
  Pablo Neira Ayuso <pablo@netfilter.org>
  Palmer Dabbelt <palmer@rivosinc.com>
  Paolo Abeni <pabeni@redhat.com>
  Patryk Duda <patrykd@google.com>
  Pavel Machek (CIP) <pavel@denx.de>
  Peter Xu <peterx@redhat.com>
  Sasha Levin <sashal@kernel.org>
  Shahar Shitrit <shshitrit@nvidia.com>
  Shuah Khan <skhan@linuxfoundation.org>
  songxiebing <songxiebing@kylinos.cn>
  Stephan Gerhold <stephan.gerhold@kernkonzept.com>
  Suraj Kandpal <suraj.kandpal@intel.com>
  Takashi Iwai <tiwai@suse.de>
  Tariq Toukan <tariqt@nvidia.com>
  Tatsunosuke Tobita <tatsunosuke.tobita@wacom.com>
  Tatsunosuke Tobita <tatsunosuke.wacom@gmail.com>
  Theodore Ts'o <tytso@mit.edu>
  Thomas Bogendoerfer <tsbogend@alpha.franken.de>
  Thomas Gleixner <tglx@linutronix.de>
  Thomas Weißschuh <linux@weissschuh.net>
  Thomas Zimmermann <tzimmermann@suse.de>
  Tony Nguyen <anthony.l.nguyen@intel.com>
  Tvrtko Ursulin <tursulin@ursulin.net>
  Tzung-Bi Shih <tzungbi@kernel.org>
  Viresh Kumar <viresh.kumar@linaro.org>
  WANG Xuerui <git@xen0n.name>
  Will Deacon <will@kernel.org>
  Will McVicker <willmcvicker@google.com>
  Yangtao Li <frank.li@vivo.com>
  Zack Rusin <zack.rusin@broadcom.com>
  Zhang Yi <yi.zhang@huawei.com>
  Zhe Qiao <qiaozhe@iscas.ac.cn>
  Zhiguo Niu <zhiguo.niu@unisoc.com>

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


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

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

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

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


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   48d525b0e463..36790ef5e00b  36790ef5e00b69ccb92817f95ba1928eea24eebb -> tested/linux-6.1


From xen-devel-bounces@lists.xenproject.org Sun Aug 11 23:56:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 11 Aug 2024 23:56:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775334.1185557 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdIPq-0003pa-BA; Sun, 11 Aug 2024 23:56:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775334.1185557; Sun, 11 Aug 2024 23:56:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdIPq-0003pT-7S; Sun, 11 Aug 2024 23:56:02 +0000
Received: by outflank-mailman (input) for mailman id 775334;
 Sun, 11 Aug 2024 23:56:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdIPp-0003pH-Af; Sun, 11 Aug 2024 23:56:01 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdIPp-0007XO-3p; Sun, 11 Aug 2024 23:56:01 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdIPo-0003eb-LY; Sun, 11 Aug 2024 23:56:00 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sdIPo-0005LY-L5; Sun, 11 Aug 2024 23:56:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=XWe5oKQxIZVDyul3U8buZicqQ/oC3sL0ws+aDiJPEco=; b=calbX0Nm5RwR+Hzhq/eh6UHVbM
	GtKK7yBbFrO0DyNU4TFePYZACnWQUUyFKmN5OfEMrhYxyNAN1L2uC/lIZJ20ls3o5rqEoA3lPcYyQ
	tFD7SfVPmilE2qIvfHXl+zOOr6kpr3H81Wh+zU0iISh93btrRXKjdWN9i026V/kO2Eg0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187212-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187212: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=5189dafa4cf950e675f02ee04b577dfbbad0d9b1
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 11 Aug 2024 23:56:00 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827

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

version targeted for testing:
 linux                5189dafa4cf950e675f02ee04b577dfbbad0d9b1
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   26 days
Failing since        186925  2024-07-20 09:44:52 Z   22 days   48 attempts
Testing same since   187208  2024-08-11 00:44:19 Z    0 days    3 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 06:59:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 06:59:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775355.1185567 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdP1F-0001W2-TY; Mon, 12 Aug 2024 06:59:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775355.1185567; Mon, 12 Aug 2024 06:59:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdP1F-0001Vv-QP; Mon, 12 Aug 2024 06:59:05 +0000
Received: by outflank-mailman (input) for mailman id 775355;
 Mon, 12 Aug 2024 06:59:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdP1E-0001Vl-AB; Mon, 12 Aug 2024 06:59:04 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdP1E-0002e9-52; Mon, 12 Aug 2024 06:59:04 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdP1D-00045C-J0; Mon, 12 Aug 2024 06:59:03 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sdP1D-0004sB-I4; Mon, 12 Aug 2024 06:59:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=0dJd5a+R8lbpMUPJFCBbURLuTHkTx/PVaP9ttwNxvlU=; b=M23vxN9b7w0cMOvJpwcZllYaDs
	ovgb76zARHMIOdNByEEdGvxUK2owlW7aMz5mxZxCDmBjtZtTazqH2N9FT/rNNKtnEaWp4pU7xZH0q
	kptkNrNnyULO/2kH2OXZySuQZM9lrWEC4YrM+5FAbq1yvf+rTKDB2hJWjPrsh8OviFOs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187214-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187214: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=7c626ce4bae1ac14f60076d00eafe71af30450ba
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 12 Aug 2024 06:59:03 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827

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

version targeted for testing:
 linux                7c626ce4bae1ac14f60076d00eafe71af30450ba
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   26 days
Failing since        186925  2024-07-20 09:44:52 Z   22 days   49 attempts
Testing same since   187214  2024-08-12 00:14:05 Z    0 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 07:21:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 07:21:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775368.1185577 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdPMR-0005p2-NO; Mon, 12 Aug 2024 07:20:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775368.1185577; Mon, 12 Aug 2024 07:20:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdPMR-0005ov-KW; Mon, 12 Aug 2024 07:20:59 +0000
Received: by outflank-mailman (input) for mailman id 775368;
 Mon, 12 Aug 2024 07:20:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dTGf=PL=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sdPMQ-0005oo-N0
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 07:20:58 +0000
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on20609.outbound.protection.outlook.com
 [2a01:111:f400:7e88::609])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6a16fe15-587b-11ef-bc05-fd08da9f4363;
 Mon, 12 Aug 2024 09:20:56 +0200 (CEST)
Received: from BY3PR05CA0012.namprd05.prod.outlook.com (2603:10b6:a03:254::17)
 by CY8PR12MB7610.namprd12.prod.outlook.com (2603:10b6:930:9a::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Mon, 12 Aug
 2024 07:20:52 +0000
Received: from SJ5PEPF000001EA.namprd05.prod.outlook.com
 (2603:10b6:a03:254:cafe::a3) by BY3PR05CA0012.outlook.office365.com
 (2603:10b6:a03:254::17) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.13 via Frontend
 Transport; Mon, 12 Aug 2024 07:20:52 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SJ5PEPF000001EA.mail.protection.outlook.com (10.167.242.198) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Mon, 12 Aug 2024 07:20:52 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 12 Aug
 2024 02:20:51 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 12 Aug
 2024 02:20:51 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Mon, 12 Aug 2024 02:20:50 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6a16fe15-587b-11ef-bc05-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=LimKdPUhEV6uSspmgb2zCRfHOPakUbMibdp20t5nqSQA9dpXTL+0QHgd/Tn/E9ZeCl+gjc3R20KNxmnzgtWH2IooqFkMJyRVDUR7mqqjzd1Wi+M0B3fE77j48RPDxKxAAwggZkg5SMdsMogGEZVsV7f1n6btaEFS8gtXPGdvYRNQMrGFNFpw6auZWxcRfIufCHauZyN18w4oIygXDbI6eWtY/kjuJauRurFG0ZGaVmScph4Z/kfLvSTwKPCrEI6yZlWUrEGootB1hGZfYHOtGczhm//8y2TSTIi4WMwnRQOBjko8RAMJvYXHULX9FOFWrmhp8ZVLGtJWPOZ6boW23A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=tx+A26PbBCwr/CSm5vc0HT5mhmd7zoOhVNSwpuhgSlk=;
 b=h0jK0bbvH/4+tlH2lAKKcsNEfksCtMALE78Az9CiTxg6pgBHlDTQ/bbo9/OogMYu1IDjuIcTVbMv5Z+4uHbICAfREAWEWHYXXc+k1NJUXJtaQ7vOt8mKPAkVSnXdYa/+QY1Zt+yK9a5ZnHdlHNTzrCAYn2zlng39VFSsM6Mylu0GKQxCwz0mcaezm+gq7MSk1j1HQ7tO6pVOQsIWu8td94W/Zpm3xdQzpCOpSRE+arPebwLWBfloFzXVE84oQG7YjJ6nIniQei/M4xRKMuAlA5hvgCxWKKYfyXJx029DApdsPtNjjjT30XzICf6AyhVkMhcxkGH6fkWexz/fS3RUGg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=tx+A26PbBCwr/CSm5vc0HT5mhmd7zoOhVNSwpuhgSlk=;
 b=T8RlMa0PesMIYJt4rBtux7z7MBb29PNyU6jrMeS+JdH/qTAO86OzA9JdvyrQDPAl/J4fEPUVG2mnduUPsIcRqIjBTI+A7BIt+Chvdy90MKi81x+LLqUM5JD1uIxNvBNbeEKb2LXWRaVEVciTDiYmO3SS9CY4cbIOfzgL6WeP/U4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <20340e59-2bbc-49e7-9827-b9b55fa3fb85@amd.com>
Date: Mon, 12 Aug 2024 09:20:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/3] automation: disable Yocto jobs
To: Stefano Stabellini <stefano.stabellini@amd.com>,
	<xen-devel@lists.xenproject.org>
CC: <sstabellini@kernel.org>, <cardoe@cardoe.com>
References: <alpine.DEB.2.22.394.2408091700560.298534@ubuntu-linux-20-04-desktop>
 <20240810065920.415345-1-stefano.stabellini@amd.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240810065920.415345-1-stefano.stabellini@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001EA:EE_|CY8PR12MB7610:EE_
X-MS-Office365-Filtering-Correlation-Id: 39e3193a-af1d-4196-866a-08dcba9f4c67
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?VXBvN0Z0QkFxdUVaRFR6b2xidytEdmJnRXBKajFUMUtBdWdIYVVzRWtuc0hr?=
 =?utf-8?B?R3dJeW94YlRaZG9pbWVzM0g2TDdnR2liaElGdmdkNzhjOE9PWE16U2ZiSlo0?=
 =?utf-8?B?NmEwZ0tRR1pmUG0vbzZGaGR5SlBzeEtVaEFaRkZOcjNMNVNtZkQ1UnJkb3hX?=
 =?utf-8?B?WG90TkxRZDNxVHRYdWJWb2I3UWFyclRvTjJyU2JZdHhaWGZEUXBkZ2FjZ2d1?=
 =?utf-8?B?QWNnTVR4bU5PbHFqamNVQ3IyYVBTdDB5OVhTNy8xbE5FNVJtVHovSkEwRFNV?=
 =?utf-8?B?S21PM2hIUmI5c00wanU2SmVBRWdGQWhrNE1XSlJOMjlKYXFMZVdZQVRoV3g3?=
 =?utf-8?B?SzVSRUkwandPM29uemRCdUgwakpaMFYrc2R3VEEyRFRMcUFGN2p5UXJvSEZn?=
 =?utf-8?B?ckZ3VTlSb3R0UFg1dlNKcFpicm1DZFlPNmV5ZEdDTXYxSWxKV0tXQis2Q2Qw?=
 =?utf-8?B?VXAwK1ZMWHZ3L3YxTW85MlozaTk0UmRuZUhaVmNZK1ZhTFA5SDVuSkk1VXFu?=
 =?utf-8?B?eUtLYVlLdXZmN3E0V1lMa0FhUmFoUDMxcjBPSXlSektDWXNtc2JWSjdXYUsx?=
 =?utf-8?B?aFB3dWo0UE5CSmdwSGdnRDhDcGRoZGZKc1ZYN01RWm1Dc0hzWmZGdHVKbU1r?=
 =?utf-8?B?cnFzbHkzZ01jQzA2c2pJQ0h1dlNsS2svV2JjTEZqbzhhZzYrTXhTQnJ2aVkw?=
 =?utf-8?B?UHRaem9CcUkrM0dOWDNXM2RqMVo0VHZDL1V5WkU0a09wQnJvRmVFYjMwdFNr?=
 =?utf-8?B?cHZGMFZNYkxGeVpvd0doWXg4OTl4MGZzeVlwRDBWZVQ2NE94bFRROXg1ZDJi?=
 =?utf-8?B?SzI0TWMwSUg5SnAvL2dyVi84MTh5RW5Xcm5qb25JV3hGeGJOWWVoMmlOeGo4?=
 =?utf-8?B?eXNZamxpWUF4Z0luYkl5Ly9RQnRaYjcwVXFhM2xzQVhMazMyUndjU0srSkZK?=
 =?utf-8?B?aVNpdWVIa2RGY09VUUd0a25kUmJic1FBcm1FWjZ2RWxnOGlEVHk3dk5MR0ZJ?=
 =?utf-8?B?aVZ4c3N2U2oyUVIrNGVTZHhHaStMWVdMZ1BSc3JHVnlwK09ha21IMHFDZkt0?=
 =?utf-8?B?Y1V0TldUTlhCZ09FWTRDMU50SFRFeGhVOHcwVXpEK3o2N2Q1a0xMeHRhQ0lZ?=
 =?utf-8?B?RGhhT0FpNzlkREt0TGJhVXlWZ1lUMW5UbFlEN05vUytUWU9JQ2dsaWY5MlhV?=
 =?utf-8?B?dFpvVmVjUE1hMFk2RUtIc2h0SW5sZnlPdHd0aFZsaFlGSmswcGVrWC9NRnFx?=
 =?utf-8?B?YUZrbnhNcWFFOEFqTHVoWnNDNkNUMk1GYUVmRG4vd01KVStFTlgzUTZrbVhH?=
 =?utf-8?B?WjFKMGgwQ2ptRmVRRjR1R0N6cmsvMjZGNEFWRHd4dDlVWWFUU2RHR2NKcW82?=
 =?utf-8?B?dDd5d1VrU3djWGw3cHEvSGFGbk9iSGNXdXJyOERKZlhrbUlzWUVhUGpxWTZB?=
 =?utf-8?B?QkZLV0kvMFh4ZEZXbWhWN2VzR0hKVUxRR2xjZXVjdXlMMkpHR2ZBb2FJNFN6?=
 =?utf-8?B?ZG5qbS9vUmlvS3RNTlczMWJ5VU1BNmFTdHhtVFRRQy9vZDVHLysxRnhQdm0x?=
 =?utf-8?B?dWtBWGlvUWQ1M0NrMnp3TlJPVHBLYXVJUVF1M29JOE00QWRQOUEyY1VuUmhx?=
 =?utf-8?B?ZEJYZlc5QkNuNUd3SVNPbHVBb0E1Y1Y1VXR4eDMwVFJyUUFGUjlSUm0zZ2pn?=
 =?utf-8?B?ZjNGZUJySU1PeXVGMnJNS211SmdFS3FrVDIySTFUcm9lbzMwTWJpOEhXVE5G?=
 =?utf-8?B?azlkcnBoRzM3VHZkQWRXeisxekdHNDBNM2twRStoanBkSlgwSWExSkdMY25u?=
 =?utf-8?B?M3IvbGFtM1pXUGFVOWtMc212K3BpSGlKS1lvYnJObWc3S2V0RUdpdk10K3pJ?=
 =?utf-8?B?dkw3eW5pN0I4K0dsOXVXaTdEWVBVclRaMm9rS2tXZ1pQaWxaWXFLR0Vjbm9m?=
 =?utf-8?Q?QuIxVvD48Cs9tp9vsa3ybbaBVETt4GXa?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2024 07:20:52.2780
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 39e3193a-af1d-4196-866a-08dcba9f4c67
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF000001EA.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7610

Hi Stefano,

On 10/08/2024 08:59, Stefano Stabellini wrote:
> The Yocto jobs take a long time to run. We are changing Gitlab ARM64
> runners and the new runners might not be able to finish the Yocto jobs
> in a reasonable time.
> 
> For now, disable the Yocto jobs by turning them into "manual" trigger
> (they need to be manually executed.)
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal



From xen-devel-bounces@lists.xenproject.org Mon Aug 12 07:22:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 07:22:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775374.1185586 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdPO7-0006OF-2J; Mon, 12 Aug 2024 07:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775374.1185586; Mon, 12 Aug 2024 07:22:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdPO6-0006O8-Vc; Mon, 12 Aug 2024 07:22:42 +0000
Received: by outflank-mailman (input) for mailman id 775374;
 Mon, 12 Aug 2024 07:22:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dTGf=PL=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sdPO5-0006O0-IL
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 07:22:41 +0000
Received: from NAM02-BN1-obe.outbound.protection.outlook.com
 (mail-bn1nam02on20607.outbound.protection.outlook.com
 [2a01:111:f403:2407::607])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a7c94d37-587b-11ef-bc05-fd08da9f4363;
 Mon, 12 Aug 2024 09:22:40 +0200 (CEST)
Received: from SJ0PR05CA0197.namprd05.prod.outlook.com (2603:10b6:a03:330::22)
 by CH3PR12MB8909.namprd12.prod.outlook.com (2603:10b6:610:179::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Mon, 12 Aug
 2024 07:22:36 +0000
Received: from SJ5PEPF000001ED.namprd05.prod.outlook.com
 (2603:10b6:a03:330:cafe::2c) by SJ0PR05CA0197.outlook.office365.com
 (2603:10b6:a03:330::22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.15 via Frontend
 Transport; Mon, 12 Aug 2024 07:22:36 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SJ5PEPF000001ED.mail.protection.outlook.com (10.167.242.201) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Mon, 12 Aug 2024 07:22:36 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 12 Aug
 2024 02:22:35 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Mon, 12 Aug 2024 02:22:34 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a7c94d37-587b-11ef-bc05-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=bIs1RFGuivszGu2TCHQZ/OmAI3GsmbUrXVrq82lOujtnuI4/hiZBdd27lHJC3VknxYFbLZ6i0aY0G5JYKxH4bVYjYqbTBt7MKcnwIt64xiiSN2VePX4drZRI3tOoKcpBEJjUHVDX2MkwTEZjJEZ0Vl/iGuxsLoWWrXMNDvWzUioDlRv/Szg0PiqeTXizIJcAU+/XHMinYI80mHCEbDOI8TCSkMw3MDvuTisU7UJgXb1QPaHOC8vkKLbxoq3ZHOBNRd8vK9ifIIsXsW0Yx4KoA83r1MIln1jbAA4SqPRSk20zZtN8vlOHi49/pRCHRskunxQyXsrbxxxXmh1UzP2msQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3H6QrIuUMJs5hCoepO/7EeJIGAJswBcWDuH5TzngMOo=;
 b=o6q66MWN2rCqdc2S+7n5onAVK14qR/oGRvn8CDlo8EQ911vNoMkMzl65uJh+BvHCyjAI+nTt697oJXZP0unIAsGXYO6F0Zau8HdRnfv5umdTlu2JfIF4OZnS0I6qTnfjbftq2euXuONyTtwwk1+mA2ThbevGChehLU+Croz7NAadnzcS/Q3QI/kkOY+Y0/yldGlbSjCwOOK026nOgVhgQh4dfCqkKCuk66A8tsamPP33Hz9t/HABlaNfZ9WqSN6Mm0uKbpbpIAwTcSShEAJN3xUOyLYJ1pES0mo+3+wKgS/xfKPt0qJ/RFhlnclmYtemMn5sVxJ/8AlGxq0HVwIILg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3H6QrIuUMJs5hCoepO/7EeJIGAJswBcWDuH5TzngMOo=;
 b=GHF2dhZ3GS+diufpzS7pcLt3FjsxRi/1edG5Sj7rZdUkt0atwQhD8nnsZl1QcQ3AfjLlfzoMAvQl6MxZNmFo8XX/kS1M/GpUfgue5pnwMUGpoLX4xEXJudwh6KuYQKlCjaBH01NjWQm1IZuZXkDBnzEbD02s5OBydJSCEkKTY3U=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <063fe8ba-3566-4377-af92-94d53549da4a@amd.com>
Date: Mon, 12 Aug 2024 09:22:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/3] automation: add "expect" to containers used to run
 QEMU tests
To: Stefano Stabellini <stefano.stabellini@amd.com>,
	<xen-devel@lists.xenproject.org>
CC: <sstabellini@kernel.org>, <cardoe@cardoe.com>
References: <alpine.DEB.2.22.394.2408091700560.298534@ubuntu-linux-20-04-desktop>
 <20240810065920.415345-2-stefano.stabellini@amd.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240810065920.415345-2-stefano.stabellini@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB03.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001ED:EE_|CH3PR12MB8909:EE_
X-MS-Office365-Filtering-Correlation-Id: 700beb9b-d32c-47dd-d0b4-08dcba9f8a4c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?SEtzVnc0dHNVNU5DRW1Oc1hVazhYNVRMWThzL1p1REdpZHJ5UVJIaHJaTlcw?=
 =?utf-8?B?dXZxYW9ZSW1NUEpXb3ErY2pZc25DY01IeFlSaVN0bGUvT0dpQzA4K3pqT3Vr?=
 =?utf-8?B?TjYzUkFWSFZBQkYzamlHSUxNMU5VM1ViWHh5UXo2TjJyVUEvSlllcWJlSjJp?=
 =?utf-8?B?VGNrY0JWcndoQ25oK0FVaWRqeXNuTnhFaXhXbWhrTGNsMmt4WE5rczgyTGpv?=
 =?utf-8?B?OU9yWHlxKzZYVXZ5YW9lZDE5Qk9oNW5vaVpzWXZ6NXBYRFQzU1R3cFpqbkVM?=
 =?utf-8?B?dldPY25Cdm96OU81N1hHL2lvQUVmUmFVcmhNOW85emNQMitCNW1VTW9oUzVK?=
 =?utf-8?B?bzBLQ3lTbWJDMGEzMVJHSHZ3RndOM2VJanRqMjNPMFhTdG9rbXJYU29naFFH?=
 =?utf-8?B?NUV2eGZwWS9BRkpjbXh0dkJvbmJnUEtGMHRPSzBnUUFhc1lHVkE0c25ncXBs?=
 =?utf-8?B?M0xOTHlyblJuc2xvMFFUYS9saUZZZXRYR1RsS3poaWZtZGppSXNsVFhQamRD?=
 =?utf-8?B?K1U5OWljQWZ6UXNsSUFVZ0NVanZYUGkxWElsNnl5MDRDbEs3aVlwS3dUSDlw?=
 =?utf-8?B?NHBscVRTZ0JSV3dOTXcvVU1ha1l2Y2twYk5sZ1JMVkhvSnhFdktWWnMwT0gv?=
 =?utf-8?B?Mm1BczJTbDYrQmdpeFludDZXdzBocnJkOG80VHNkaXY3UXFlZVZLMXFRc1ZJ?=
 =?utf-8?B?aEZRaUF5VlRhck5TUjhFVng4YVhrVnNjTG1pbEI1MUlwQVhwd1BjWlI3VlZZ?=
 =?utf-8?B?Sm1BQ3QwT0s0SzlWaGN1R2tac0svbFp2TVVUU09NV0VsLzUzMnE1VGdJQWdK?=
 =?utf-8?B?L3JvaFVpaDdmNkN5NU1uT2Fva25wdGd0am9hbFNZei9Lb1Jxb3I4WXVQWFhM?=
 =?utf-8?B?clc0dGd5alFOVWNsWjRoaVZCUjkxVDVGdlFBTm93U0NuMitvTEo1M1JrWVZ6?=
 =?utf-8?B?TWdPcG1TSGxkMjJMU2NKbVNkNXRmNHRTVnJPb3NLcHM4cHNHd082RlV5QVV2?=
 =?utf-8?B?YnBENGxYK0gzalRLZS9TQTc1ZHg0TlZDMngyQlpvd3pZb3R4ckFNV2NOeHF0?=
 =?utf-8?B?cjc0TXo1UGtDV1VkdGhuTXNzcnpQaXdFL2JLQUFjN3p5K3FmRVRrOVdINHZo?=
 =?utf-8?B?dkgxN2xxMGFnNGlHdEk3SU9PRWo3Z213Vy9GNXY3bisrTkxhenFVSTBIU01Y?=
 =?utf-8?B?RUN4ZEFaVzE5d2JCWTREVDhZRzNxNDNFYlBDdzNhc0JFWUIxaWVKVUNCYkdw?=
 =?utf-8?B?Q3k3NUNXeEtydFpUcTBXUnRBQW9DODRwUnFNYlpTNi9ndWtJa1pVQ1ltTFRv?=
 =?utf-8?B?MjFSRDFNWlhEdlJDOEFXMUxhMlN5SXk0Q2dpVmV5bzNnUHFxY2FDNi9qOWZE?=
 =?utf-8?B?eTY2aXY4OGdmM1BTZHNIVVVyNUFSS2QxSEc5MnpFTnNqbjgxRkQwdEQ2UEsy?=
 =?utf-8?B?Z1VkVU1PWGpwQzNXd040MzliNmhvd0NFbjIzOExiZXhOc3VXVVluTFFPTHZw?=
 =?utf-8?B?VDZhVXR1SHJ2S2pzdnVuNWVHVHZBOTgvZ2V4OVlOSmJkSjU4S1NzTXhpVWxt?=
 =?utf-8?B?Z0hkZjdPdGloK3RsVkkrOWk4QllPT3ZCRWkvY2duaVFXakw2NnJUcnNtK01G?=
 =?utf-8?B?OEh4R3JxTlFhUEo0QS9GNlZCVDcybmVFdlZFTnk1K21JZWRqd2NET3BHaWgw?=
 =?utf-8?B?OVhNNWVWTFVaYnUrZHAvcnBUMUVOeGZGYjBOWWhGMXFwUFFKcE95MThyRUNK?=
 =?utf-8?B?SWVvcmQwcDdSSWtqSGxoZHpmR1JvY1lodmtwRGJiVmF4L04wNnZxRnIxeDF1?=
 =?utf-8?B?bnloYUhEUjY3NlZjT2VZMWtaTXc5UDMydlNkRDNKc1dZbkZVRS9rZjhoWFk4?=
 =?utf-8?B?TXNScFd6S2ZmV2p5SC9XV0xrcXlkM1UreU9icUhGL0Jkdjh3N1djQWxlTzVH?=
 =?utf-8?Q?bf0O8OXuGN0YwQ1g1TESBFIP32XT4qER?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2024 07:22:36.1061
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 700beb9b-d32c-47dd-d0b4-08dcba9f8a4c
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF000001ED.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8909

Hi Stefano,

On 10/08/2024 08:59, Stefano Stabellini wrote:
> It will be used for QEMU tests.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 07:35:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 07:35:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775382.1185597 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdPag-0008QY-5n; Mon, 12 Aug 2024 07:35:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775382.1185597; Mon, 12 Aug 2024 07:35:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdPag-0008QR-2v; Mon, 12 Aug 2024 07:35:42 +0000
Received: by outflank-mailman (input) for mailman id 775382;
 Mon, 12 Aug 2024 07:35:40 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dTGf=PL=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sdPae-0008QL-Ib
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 07:35:40 +0000
Received: from NAM04-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam04on20627.outbound.protection.outlook.com
 [2a01:111:f403:240a::627])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7711cde0-587d-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 09:35:37 +0200 (CEST)
Received: from DS7PR03CA0025.namprd03.prod.outlook.com (2603:10b6:5:3b8::30)
 by SA1PR12MB6725.namprd12.prod.outlook.com (2603:10b6:806:254::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.15; Mon, 12 Aug
 2024 07:35:33 +0000
Received: from CY4PEPF0000E9D5.namprd05.prod.outlook.com
 (2603:10b6:5:3b8:cafe::88) by DS7PR03CA0025.outlook.office365.com
 (2603:10b6:5:3b8::30) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.33 via Frontend
 Transport; Mon, 12 Aug 2024 07:35:33 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CY4PEPF0000E9D5.mail.protection.outlook.com (10.167.241.68) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Mon, 12 Aug 2024 07:35:32 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 12 Aug
 2024 02:35:31 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Mon, 12 Aug 2024 02:35:30 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7711cde0-587d-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Bj4m1oXr7MH0Fkg8tAHSUjdx3EE353dRbPJw7AIz8aNUf6IP5PuW2Kb9HulneR6JSRNfHF1GBWjEcYRIKxmHaLpyqXtM8LmpX6cGwvT+Gv7YwbrdfTzr7xq7mxJJfYzXirjyJebeNoNCM7h+DyJBYtlJPmqguyEWsvTOO/UKIXW7cxlff/X/YsT4uMgiKiq3V4GdgTaJJXxLD+vvC69fbRcfdi2LJ53O2vsAP58UQbncWllH6fVNuKS/EjEraMhUV5C0nMk2pmKtR+dWzXjoBLpJ2fiG5z053U5r92CbeAnCpkgvXy2emp6TDuV5XjZO/4m6SM7lqqt+U0sSJG5OOQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=BmXqXIQcNe6nb7ai1cQ1cYGkGPs2Yvha26R08eg1O18=;
 b=DQ1hZ0f/sqX/mf8dO8Brc5a/6Ex/lQyGw/PXL19CiAGhspgwAzviNQ1Tn1qAmILfu3l+m0TSInxwlwqGo05rGjAqNYqwW3PnLiL1fLXETlqEvjEE+nb8uvessnqLlojjKxNIAEzXF582FJmkS43fhlYhI3kqD5lRya8FvA1w6/2y7riLfNN+Yqk/XpYsni3Gd3i+mLl47RkUm8OvrNuC8/XGxF5MiXzp1ulBCpojvSNn3hWHoQMCYAUWheIaNlaYwhISN3HVv/Hqj6SMwj9fp2ctCpRHwQCpuq+OO/U72apeXFadF8HlWnvvA/cx9Jyv+j5PWaQMS8DD7TJ2gSBFrA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=BmXqXIQcNe6nb7ai1cQ1cYGkGPs2Yvha26R08eg1O18=;
 b=0yHCt7+loRbo/xGHD0PQqZgeYSuyNBL5v7kwLZPOyiUDX3F73kboEMOrrVlYJbPRnOpNucNPl+qeC5hFFOvyku+b/HdnhDOZp0SBzivebOgaS9dOyflpUbFqYvtqPVg7adSvIzmMKo5fMB5zC8QF3UcTktJv5ovE8gTJLmkHF1Q=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <2baf9636-93f2-4f70-9e22-266002302d56@amd.com>
Date: Mon, 12 Aug 2024 09:35:30 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/3] automation: use expect to run QEMU
To: Stefano Stabellini <stefano.stabellini@amd.com>,
	<xen-devel@lists.xenproject.org>
CC: <sstabellini@kernel.org>, <cardoe@cardoe.com>
References: <alpine.DEB.2.22.394.2408091700560.298534@ubuntu-linux-20-04-desktop>
 <20240810065920.415345-3-stefano.stabellini@amd.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240810065920.415345-3-stefano.stabellini@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB04.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D5:EE_|SA1PR12MB6725:EE_
X-MS-Office365-Filtering-Correlation-Id: ac907cea-ea8e-4121-4cb6-08dcbaa158ff
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?ZXMvMERhY3FtRVJsWDdTRFN4WkJhUk90Skh2TDlzQWxMbXMwVmJXLytyR2RU?=
 =?utf-8?B?K0pjZUEycHh1RDV6b1d2YkF5NU1sWHFRZ0JEUW1NaWxPVWdTZjBhNEloRSti?=
 =?utf-8?B?T1ZoS1lVOEtRVkMzRVNxTVI2OXdkMUlzalBnczZqTncrQjZhQlJqVjh1Tm1P?=
 =?utf-8?B?K0NjNEtrbTIrY1VUcSs0VVpaVTRsSEpzMFovdnVtczV0SzlhdDZ4dHF4aEhQ?=
 =?utf-8?B?TmpCZklDQnpYbFk1RGxSOWhpYXJkQ2M5NXRNT2JiY2tqaWs3UWFrRmxXNnl3?=
 =?utf-8?B?akJIYmYwcFNiL0VTSytMTUJCZFdiTk15VmFEMGFCcmRxOEZBV054aktwVm8y?=
 =?utf-8?B?Ulk0Vmh3amU3Z2tsZ2NWemk2YjNxRFBkaW0xdXRodFZQRVJNcVZCYWRpR0dq?=
 =?utf-8?B?VHd2MnpSN3RHR2xPVC94VEkrL2FlbW9tNTArSjNnU3hJMzlEK0RZL3Biak5w?=
 =?utf-8?B?d2VRTXpIZVFNbUdZekJubk9YQjNqa0oxQUtGbTY0MFVFSkI3WXpETllZd0Iy?=
 =?utf-8?B?QndQRUpOM3EraFpFYVdxVmxQOHdtSFJRdU1kS25FWGNQcThGRHNqUzRJOUlw?=
 =?utf-8?B?MDJjYzVUdUFBL1NhYTMxZUNPcStqV1ZiYWFEcG15ZjJsNEZQSGhWcFhIQms5?=
 =?utf-8?B?cnZiYmRDbFFJOE5jZUtLY1N3WEFzYWN1SWIvQ1FQM2x4aTk4a05DVnNPUkxh?=
 =?utf-8?B?S2VYU0NtbDJkNG9TNmh4a0w3T0dLRzZHUnE2Y2ovNXZZbktCWnVaZjRHM1l6?=
 =?utf-8?B?U0N2ZnNESy9CSXNDZ0swRWl0alJUZlA1VUlsY2xobHRzc2QzWFpWd1h6RjVI?=
 =?utf-8?B?R0NlL09zWlA0VjhFYTI5T2V0MEpkK09jK2JYeHZBdmJRMU54VEltdDZ5R3dC?=
 =?utf-8?B?dXVCL2lvU3psY3JZMzdWK0dPa1paMHJ0bUNtNEZ3dFRwenJxQkNaeCswU29N?=
 =?utf-8?B?ZHFOQm5OeXlRQXlNb1ZNMWljcFYzSlR0UnZId3ZqQVZMek9rZ2V5U1Z3Wm1t?=
 =?utf-8?B?VFpYeVB4enJuZzc5UzFCc2h6MEFwWnJ6dktoZy9uRmdCVVN6WjlaeXNJYzcy?=
 =?utf-8?B?anJ3R3FIZzRQcW9kaVVnK3YvdXdtOSt0VytwSTh0Z1pBaERlaTd1UEZaZzNT?=
 =?utf-8?B?aGtQVkZvd1FwRGVJMTIvUzBZU2pzT1NBcVZldGpkN0srdW5WUGl5d0pRVFdP?=
 =?utf-8?B?NzByNHovVGxSSERpb3k2VW9jdzFuM1VGRU5CU2JBZ296alBNUm5vUCtEUy92?=
 =?utf-8?B?VUN1RkZiRkwzdUpVc2IzRGFFRWNHL0N5cjZpLzRqWG5nRklteE9xdzhjWGk2?=
 =?utf-8?B?S1htZ0E3SkM4dVdLQmg2U2NXUUhRMGZlbUpLREtBcklzVU93VDlaVHJuUFpP?=
 =?utf-8?B?WUFBZWlGeW85cWxDMGVab0lZaGtyUEgxNmorNStGTHNscC9lQ05IYjJneFNK?=
 =?utf-8?B?REh1MUFTMGl4RzMvdUk5NFNVS1lZamNWTSt4SmR6RGFRcjdRM0pGOExDeXZq?=
 =?utf-8?B?eHdwcnVKU2x1YUhPM29SaEtUaGNzcU5hRjJoVmkvVExYeFFFRUdPK2lEZDRn?=
 =?utf-8?B?NmdwWE1ndnI3eGRpb0NnS1VpS3ZROVlnOTVudFl4bUNYd3pRSERJZGpXU0lz?=
 =?utf-8?B?RmNaZmxaQkFTdmJROHBZYi9Bam9PcXp2cm1Rd29GZ2lZbk9qRlZpUjc5MWZU?=
 =?utf-8?B?TkdsQWUwZjJJLzRkY1M5OUVkenpabXBsVGRLWGZ4TWpTRGdjNGg1U0pCczRR?=
 =?utf-8?B?djZrenp5S00yS2dENDkrT21ESWx2SG5rRGZWUnlzSHM4Rk95bnZsTFZKV3d5?=
 =?utf-8?B?aFBIazUwNW1tWGE0UEdpSkx5WTJHRi85bTVxL2g1eGgvcFhGalZoUkVEY3V5?=
 =?utf-8?B?bUpueGlHMFFnZ0pPUHB5d1IybndZTThkZHJ0ZDUxa3lsSVYxNTlreVNRWEFZ?=
 =?utf-8?Q?/zLhqlqJtoy7g/eC4Gm/+qhT3YC3vuWr?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2024 07:35:32.3676
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ac907cea-ea8e-4121-4cb6-08dcbaa158ff
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000E9D5.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6725

Hi Stefano,

On 10/08/2024 08:59, Stefano Stabellini wrote:
> Use expect to invoke QEMU so that we can terminate the test as soon as
> we get the right string in the output instead of waiting until the
> final timeout.
This is a great improvement.

> 
> For timeout, instead of an hardcoding the value, use a Gitlab CI
> variable "QEMU_TIMEOUT" that can be changed depending on the latest
> status of the Gitlab CI runners.
What is the current value of QEMU_TIMEOUT? I don't see it being mentioned anywhere.
Could tests define this env var if needed? What would be the precedence then?
I'm thinking that some tests don't need a very big timeout that otherwise is necessary
for longer tests (e.g. xtf test does not need to wait 720s). 

> 
> Note that for simplicity in the case of dom0less test, the script only
> checks for the $passed string. That is because the dom0 prompt and the
> $passed string could happen in any order making it difficult to check
> with expect which checks for strings in a specific order.
I use expect in my local testing too and I search for both strings. More below.

> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
> ---
>  automation/scripts/qemu-alpine-x86_64.sh      | 15 +++----
>  automation/scripts/qemu-key.ex                | 42 +++++++++++++++++++
>  automation/scripts/qemu-smoke-dom0-arm32.sh   | 15 ++++---
>  automation/scripts/qemu-smoke-dom0-arm64.sh   | 15 ++++---
>  .../scripts/qemu-smoke-dom0less-arm32.sh      | 14 +++----
>  .../scripts/qemu-smoke-dom0less-arm64.sh      | 14 +++----
>  automation/scripts/qemu-smoke-ppc64le.sh      | 12 +++---
>  automation/scripts/qemu-smoke-riscv64.sh      | 12 +++---
>  automation/scripts/qemu-smoke-x86-64.sh       | 14 +++----
>  automation/scripts/qemu-xtf-dom0less-arm64.sh | 14 +++----
>  10 files changed, 97 insertions(+), 70 deletions(-)
>  create mode 100755 automation/scripts/qemu-key.ex
> 
> diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
> index 8e398dcea3..24b23a573c 100755
> --- a/automation/scripts/qemu-alpine-x86_64.sh
> +++ b/automation/scripts/qemu-alpine-x86_64.sh
> @@ -77,18 +77,15 @@ EOF
>  # Run the test
>  rm -f smoke.serial
>  set +e
> -timeout -k 1 720 \
> -qemu-system-x86_64 \
> +export qemu_cmd="qemu-system-x86_64 \
Usually (even respected by analyze.sh) exported env variables are written in capital letters

>      -cpu qemu64,+svm \
>      -m 2G -smp 2 \
>      -monitor none -serial stdio \
>      -nographic \
>      -device virtio-net-pci,netdev=n0 \
> -    -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0 |& \
> -        # Remove carriage returns from the stdout output, as gitlab
> -        # interface chokes on them
> -        tee smoke.serial | sed 's/\r//'
> +    -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0"
>  
> -set -e
> -(grep -q "Domain-0" smoke.serial && grep -q "BusyBox" smoke.serial) || exit 1
> -exit 0
> +export qemu_log="smoke.serial"
> +export log_msg="Domain-0"
> +export passed="BusyBox"
NIT: one empty line here for readability

> +./automation/scripts/qemu-key.ex
> diff --git a/automation/scripts/qemu-key.ex b/automation/scripts/qemu-key.ex
NIT: usually expect script have '.exp' extension.

> new file mode 100755
> index 0000000000..569ef2781f
> --- /dev/null
> +++ b/automation/scripts/qemu-key.ex
> @@ -0,0 +1,42 @@
> +#!/usr/bin/expect -f
> +
> +set timeout $env(QEMU_TIMEOUT)
> +
> +log_file -a $env(qemu_log)
> +
> +match_max 10000
> +
> +eval spawn $env(qemu_cmd)
> +
> +expect_after {
> +    -re "(.*)\r" {
> +        exp_continue
> +    }
> +    timeout {send_user "ERROR-Timeout!\n"; exit 1}
> +    eof {send_user "ERROR-EOF!\n"; exit 1}
> +}
> +
> +if {[info exists env(uboot_cmd)]} {
> +    expect "=>"
> +
> +    send "$env(uboot_cmd)\r"
> +}
> +
> +if {[info exists env(log_msg)]} {
> +    expect "$env(log_msg)"
> +}
> +
> +if {[info exists env(xen_cmd)]} {
> +    send "$env(xen_cmd)\r"
> +}
Does not seem to be used at all. For now, I'd suggest to drop it.

> +
> +if {[info exists env(passed)]} {
> +    expect {
> +        "$env(passed)" {
> +            exit 0
> +        }
> +    }
> +}
As said above, in my local testing, I search for both strings (after all we should test that dom0 works too) as follows:

if {[info exists env(dom0_passed)] && [info exists env(domu_passed)]} {
    expect {
        "$env(dom0_passed)" {
            expect "$env(domu_passed)"
            exit 0
        }
        "$env(domu_passed)" {
            expect "$env(dom0_passed)"
            exit 0
        }
    }
}

Apart from that:
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 08:22:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 08:22:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775393.1185607 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdQJc-0000BA-Nl; Mon, 12 Aug 2024 08:22:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775393.1185607; Mon, 12 Aug 2024 08:22:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdQJc-0000B3-L8; Mon, 12 Aug 2024 08:22:08 +0000
Received: by outflank-mailman (input) for mailman id 775393;
 Mon, 12 Aug 2024 08:22:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=PyEi=PL=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdQJc-0000Ax-8q
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 08:22:08 +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 f5f4dbc1-5883-11ef-bc05-fd08da9f4363;
 Mon, 12 Aug 2024 10:22:06 +0200 (CEST)
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-a7a975fb47eso454253866b.3
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 01:22:06 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80bb11a56dsm209069966b.93.2024.08.12.01.22.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 12 Aug 2024 01:22:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f5f4dbc1-5883-11ef-bc05-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723450926; x=1724055726; 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=V12cU1I7zzztQOzO3TirffQGIbp8+sEvf3rquR7zulM=;
        b=R/jmUEx7wfxHw2zFG/hmWaOUot0Cje0dLyUlB1GzYM663FjmZ6CII7jFhgiu9Ve0fD
         AD7jmMxKMZJ9mw4hpT8hiA7O1Vhk4r24GGN1wosE0rgT/RVY4BW5C1LJNbr83EcyJH+F
         SluyjIdqfCG0kYjnHeUGpRCIuyDcpY1s6CiiEVAcpHKt3ztTRJDMa69dXaNKtZ6b10sR
         CjQ3cFCstAvIzWr8ua841uabOc6jE8XaE/Wm2PB0YogJSi2rmKKn0yGPC7+szVfYgGpI
         vOD6+YmIdf2xpcakP4bhKWK21MrGDcWsN7eki6nwOjAQp8gUTEl5hzVreoIwQaCcaW6R
         1azw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723450926; x=1724055726;
        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=V12cU1I7zzztQOzO3TirffQGIbp8+sEvf3rquR7zulM=;
        b=IRm6Z54VX8O+IdleZ0R5R8qVK7oR2Qcl/16wKXNlSuq89xmQJs3Gqry0yCUoQho1/B
         zm8F9bGiauh01oox3s1+bBPeeCxNIVsXtQ6mW89CSHMZ8EsMvb1FuQ1nG3if9wiJjtqv
         YL49c9WBum5fpZnrswrqwq4q1AzHXZTYNuEfez01piF1qAtyiE+UU3I2t2GRIWcP23Tg
         FR3VmIKg5DN8R0aTwAOwKJ328dNOOn+y1VXOCdK89n1PglE2AdRLNl8Vpd8xZnaMmDXQ
         Iof8FjZF7j47yCqWXpSB8RNnr8ug/EU0bB5EQzfwZ+MqoyFHwQObv9mEP17upXcr0mLg
         pQew==
X-Forwarded-Encrypted: i=1; AJvYcCXuYXbOvsr7rEHbeyWt6/ckYfC8y3ZcsDIVX/fdWrUEFew7Ah4rR6LYr5nRmizB4Aw27gZvamh7nzBJjfJFGvSKQPO3/NgU7WBoCFmixm4=
X-Gm-Message-State: AOJu0Yw/SxlbEm/T/dVVnzizGgVNNWHUASmhA657L+VUXwpiJisW3qeu
	00HjKJ+lq+fuA2JYVOaLp1+iNxPiQmkHYYYBoWM7G6aMES++XPQUPC1Ciepdwg==
X-Google-Smtp-Source: AGHT+IGYf4QnxrWOGmpE/BL7LY5pi34ZU+d1R5GzvMs0n/MF1vT1/qrxkY5x6cMHYhXLkt1mRgyrRw==
X-Received: by 2002:a17:907:f14a:b0:a77:c9cc:f96f with SMTP id a640c23a62f3a-a80aa556817mr605905566b.7.1723450925546;
        Mon, 12 Aug 2024 01:22:05 -0700 (PDT)
Message-ID: <26c5f44a-4083-4cbc-a3e8-13895a13df01@suse.com>
Date: Mon, 12 Aug 2024 10:22:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] x86/msi: fix locking for SR-IOV devices
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <20240807052011.582099-1-stewart.hildebrand@amd.com>
 <1b0475fe-4371-4bf7-a469-aa580648f210@suse.com>
 <62523c87-9c93-4b71-a71b-e852fce3136d@amd.com>
 <85a9263b-24cf-47ba-ba83-c2c988dee5c2@suse.com>
 <7c28c7b2-0af0-4f9f-a171-5d8272254f9b@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <7c28c7b2-0af0-4f9f-a171-5d8272254f9b@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 09.08.2024 17:02, Stewart Hildebrand wrote:
> On 8/9/24 09:05, Jan Beulich wrote:
>> On 09.08.2024 06:09, Stewart Hildebrand wrote:
>>> On 8/7/24 11:21, Jan Beulich wrote:
>>>> On 07.08.2024 07:20, Stewart Hildebrand wrote:
>>>>> --- a/xen/arch/x86/msi.c
>>>>> +++ b/xen/arch/x86/msi.c
>>>>> @@ -662,7 +662,8 @@ static int msi_capability_init(struct pci_dev *dev,
>>>>>      return 0;
>>>>>  }
>>>>>  
>>>>> -static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
>>>>> +static u64 read_pci_mem_bar(struct pci_dev *pdev, u16 seg, u8 bus, u8 slot,
>>>>> +                            u8 func, u8 bir, int vf)
>>>>>  {
>>>>
>>>> First I thought this was a leftover from the earlier version. But you need
>>>> it for accessing the vf_rlen[] field. Yet that's properly misleading,
>>>> especially when considering that the fix also wants backporting. What pdev
>>>> represents here changes. I think you want to pass in just vf_rlen (if we
>>>> really want to go this route; I'm a little wary of this repurposing of the
>>>> field, albeit I see no real technical issue).
>>>
>>> I like your idea below of using a struct, so I'll pass a pointer to the
>>> new struct.
>>>
>>>> Of course there's a BUILD_BUG_ON() which we need to get creative with, in
>>>> order to now outright drop it (see also below).
>>>
>>> I suppose this BUILD_BUG_ON() is redundant with the one in
>>> pci_add_device()...
>>
>> "Redundant" can be positive or negative. Your response sounds as if you
>> thought one could be dropped, yet I think we want them in both places.
>>
>>>>> --- a/xen/drivers/passthrough/pci.c
>>>>> +++ b/xen/drivers/passthrough/pci.c
>>>>> @@ -654,6 +654,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>>>>>      const char *type;
>>>>>      int ret;
>>>>>      bool pf_is_extfn = false;
>>>>> +    uint64_t vf_rlen[6] = { 0 };
>>>>
>>>> The type of this variable needs to be tied to that of the struct field
>>>> you copy to/from. Otherwise, if the struct field changes type ...
>>>>
>>>>> @@ -664,7 +665,10 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>>>>>                              PCI_SBDF(seg, info->physfn.bus,
>>>>>                                       info->physfn.devfn));
>>>>>          if ( pdev )
>>>>> +        {
>>>>>              pf_is_extfn = pdev->info.is_extfn;
>>>>> +            memcpy(vf_rlen, pdev->vf_rlen, sizeof(pdev->vf_rlen));
>>>>
>>>> ... there'll be nothing for the compiler to tell us. Taken together with
>>>> the BUILD_BUG_ON() related remark further up, I think you want to
>>>> introduce a typedef and/or struct here to make things properly typesafe
>>>> (as then you can avoid the use of memcpy()).
>>>
>>> Here's what I'm thinking:
>>>
>>> struct vf_info {
>>>     uint64_t vf_rlen[PCI_SRIOV_NUM_BARS];
>>>     unsigned int refcnt;
>>> };
>>>
>>> struct pci_dev {
>>>     ...
>>>     struct vf_info *vf_info;
>>>     ...
>>> };
>>
>> I don't (yet) see the need for refcnt, and I also don't see why it wouldn't
>> continue to be embedded in struct pci_dev. Specifically ...
>>
>>>> An alternative approach might be to add a link from VF to PF, while
>>>> making sure that the PF struct won't be de-allocated until all its VFs
>>>> have gone away. That would then also allow to eliminate the problematic
>>>> pci_get_pdev().
>>>
>>> I think I can add a link to a new reference-counted struct with just the
>>> info needed (see the proposed struct above).
>>
>> ... I think having a link from VF to its PF may turn out helpful in the
>> future for other purposes, too.
> 
> Continue to embed in struct pci_dev: okay.
> 
> Link from VF to PF: assuming you mean a link to the PF's
> struct pci_dev *, okay.
> 
> Ensuring the PF's struct pci_dev * won't be de-allocated until the VFs
> are gone: I don't think we want to impose any sort of ordering on
> whether the toolstack removes VFs or PFs first. So, if not reference
> counting (i.e. how many VFs are referring back to the PF), how else
> would we make sure that the PF struct won't be de-allocated until all
> its VFs have gone away?

Have the PF have a linked list of its VFs, and de-allocate the PF struct
only when that list is empty. (When putting in a VF->PF link, I was
taking it as obvious that then we also want a link the other way around,
i.e. a linked list attached to the PF's struct.) For non-PF devices that
list (if we need to instantiate it in all cases in the first place) will
always be empty.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 08:41:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 08:41:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775403.1185617 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdQcb-0003mY-Bb; Mon, 12 Aug 2024 08:41:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775403.1185617; Mon, 12 Aug 2024 08:41:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdQcb-0003mR-8U; Mon, 12 Aug 2024 08:41:45 +0000
Received: by outflank-mailman (input) for mailman id 775403;
 Mon, 12 Aug 2024 08:41:44 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=PyEi=PL=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdQca-0003mL-3O
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 08:41:44 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b29ca1b1-5886-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 10:41:41 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5af6a1afa7bso4848567a12.1
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 01:41:41 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd1a5e07a9sm1928931a12.78.2024.08.12.01.41.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 12 Aug 2024 01:41:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b29ca1b1-5886-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723452101; x=1724056901; 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=a+esWHnlsL2/Kpon8xB8xB25MWuvuVAXsSeSfgNiSnc=;
        b=PmO7NySitjU19UwvAwXMz7T1n86vf5oNiuZty3UgZm1Czpl5QMEynhNOMICyO3cYn0
         5UD2wRyYNCJZ1S+CuSSN90USFmd2JoEnWIXvOTATy9q3HxdQRTkSqfQEF7FWzUg/qPTG
         cObgHfi5WJ6pBzy7uiVMDfsDdxmzmoTSf69BYoeDcytohsSc3PeyrlGg1yKVOr0qITNV
         plU96KVGoTav64AD9E3dHyH0ah8GbnsC3jBOz4GLnhZ+XLduvmmtj2rjNc9bmmsJ62GW
         KF8xa2Qc9S+Oh0JCgiF6wdUOJor4GqnqRqtWWeTlNAUAaG1LmAAoFUCPnYdwTZQ2aJdo
         A76Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723452101; x=1724056901;
        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=a+esWHnlsL2/Kpon8xB8xB25MWuvuVAXsSeSfgNiSnc=;
        b=dTjHyorMdS/swfhhjYbQsMemQ38CwVs+a63iBe+HaaWCpgCk+aXn5QV2VaFGpBrCId
         v7wsuDU/mQwXsjvBVcvydkRfZbTL5dqImjY38o30ftJqKaTvKfu7WvvbwK+rzjeXJhgF
         bkv6YHrEmc75XWtQuCEC1LyP8Zi8nq7MxesE2QHzhnfZLl5maA3cVo7AivD0P61BbfGJ
         6QWv6WxmiQt7EqPl8pTWX0EpXe3DWGS95yDKsAIl0lldLeEAnFXOJlNYSmpikCqOWQcG
         4mt59wuo8wfmG2pny1UD9hutFovcdr00A1kOmx/Ywo6hZL/aDFPkLKWIayWlygj9W9ux
         /UyA==
X-Forwarded-Encrypted: i=1; AJvYcCVfp04Ym1dWDMN3ufIF6Ykg2gsCrW8LhJKkZAIWeQ2hkA+BFh0VQUKo2GVVhxyGindTlf5NDqQ3g1rj1UvtaRJ8J9joyXyrWU5xDU66W8o=
X-Gm-Message-State: AOJu0Yxxs4G8rQ76RVnbgHSwy2XyZBt2PGHZ/tSuQMhKl8mOOeQZw5n8
	9mBhQ2v/YJhtZ+e+WcS/POhip+8/dpIgOM2vgADqk3p9V6qR9VGcWg/427RiLw==
X-Google-Smtp-Source: AGHT+IFd95W3AOwXfKOAH1IJSmyGhXX/clfeHvrgd1k3ZHMECBlOdbx9VHVMb8b0LXE+GjXagwVbfQ==
X-Received: by 2002:a05:6402:4403:b0:5a2:d411:89fa with SMTP id 4fb4d7f45d1cf-5bd0a693025mr4884017a12.36.1723452101196;
        Mon, 12 Aug 2024 01:41:41 -0700 (PDT)
Message-ID: <bdc1083b-f6bd-4e4e-b56d-9e1fc09393e9@suse.com>
Date: Mon, 12 Aug 2024 10:41:43 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/5] x86: Set xen_phys_start and trampoline_xen_phys_start
 earlier
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-4-alejandro.vallejo@cloud.com>
 <cf819b39-6ce8-4446-b7b6-a1b247f45400@suse.com>
 <CACHz=ZgwPunPO771EbX1hKEdmXC1ysBQ7RzYK8K1pakyBS927A@mail.gmail.com>
 <7f0a7c9e-0cac-48ae-b7aa-5c90a1a5f4ca@suse.com>
 <CACHz=ZgCodGsFdyKe+F4gY3nAnymHLQ0T23CWSqauEhbm=Ubeg@mail.gmail.com>
 <14fc293a-4a0d-4de2-b468-bd0ef8c912b1@suse.com>
 <CACHz=Zj+LKKvPxTd8SGYthBTPiC6bEPrZg0nt=ehpOJ4JwqoiQ@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: <CACHz=Zj+LKKvPxTd8SGYthBTPiC6bEPrZg0nt=ehpOJ4JwqoiQ@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 09.08.2024 16:34, Frediano Ziglio wrote:
> On Fri, Aug 9, 2024 at 3:02 PM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 09.08.2024 15:50, Frediano Ziglio wrote:
>>> On Fri, Aug 9, 2024 at 1:59 PM Jan Beulich <jbeulich@suse.com> wrote:
>>>>
>>>> On 09.08.2024 14:48, Frediano Ziglio wrote:
>>>>> On Thu, Aug 8, 2024 at 9:25 AM Jan Beulich <jbeulich@suse.com> wrote:
>>>>>> On 07.08.2024 15:48, Alejandro Vallejo wrote:
>>>>>>> No reason to wait, if Xen image is loaded by EFI (not multiboot
>>>>>>> EFI path) these are set in efi_arch_load_addr_check, but
>>>>>>> not in the multiboot EFI code path.
>>>>>>> This change makes the 2 code paths more similar and allows
>>>>>>> the usage of these variables if needed.
>>>>>>
>>>>>> I'm afraid I'm struggling with any "similarity" argument here. Imo it
>>>>>> would be better what, if anything, needs (is going to need) either or
>>>>>> both of these set earlier. Which isn't to say it's wrong to do early
>>>>>> what can be done early, just that ...
>>>>>>
>>>>>
>>>>> About similarity is that some part of EFI code expect xen_phys_start
>>>>> to be initialized so this change make sure that if in the future these
>>>>> paths are called even for this case they won't break.
>>>>>
>>>>>>> --- a/xen/arch/x86/boot/head.S
>>>>>>> +++ b/xen/arch/x86/boot/head.S
>>>>>>> @@ -259,6 +259,11 @@ __efi64_mb2_start:
>>>>>>>          jmp     x86_32_switch
>>>>>>>
>>>>>>>  .Lefi_multiboot2_proto:
>>>>>>> +        /* Save Xen image load base address for later use. */
>>>>>>> +        lea     __image_base__(%rip),%rsi
>>>>>>> +        movq    %rsi, xen_phys_start(%rip)
>>>>>>> +        movl    %esi, trampoline_xen_phys_start(%rip)
>>>>>>
>>>>>> ... this path is EFI only if I'm not mistaken, while ...
>>>>>>
>>>>>>> @@ -605,10 +610,6 @@ trampoline_setup:
>>>>>>>           * Called on legacy BIOS and EFI platforms.
>>>>>>>           */
>>>>>>>
>>>>>>> -        /* Save Xen image load base address for later use. */
>>>>>>> -        mov     %esi, sym_esi(xen_phys_start)
>>>>>>> -        mov     %esi, sym_esi(trampoline_xen_phys_start)
>>>>>>
>>>>>> ... the comment in context is pretty clear about this code also being
>>>>>> used in the non-EFI case. It is, however, the case that %esi is 0 in
>>>>>> that case. Yet surely you want to mention this in the description, to
>>>>>> clarify the correctness of the change.
>>>>>
>>>>> Restored this code.
>>>>
>>>> Was my analysis wrong then and it's actually needed for some specific
>>>> case?
>>>
>>> Not clear to what exactly you are referring.
>>> That later part of code (which was removed) is still needed in case of no-EFI.
>>
>> Is it? Under what conditions would %esi be non-zero? As indicated by my earlier
>> reply, I think it would never be. In which case the two stores are pointless.
> 
> I really don't follow, %esi at that point should be the address where
> the executable is loader, which should not be zero.

In the PVH entry point it'll be, but else? Note this code in setup.c:

        /* Is the region suitable for relocating Xen? */
        if ( !xen_phys_start && e <= limit )

That relocating of Xen wouldn't happen if we stored a non-zero value in
the default (xen.gz with grub1/2) case. Also take a look at Xen before
the EFI/MB2 path was added. xen_phys_start wasn't even written from
head.S at that time. And if it's for the PVH entry point alone, that
code then would want moving into the CONFIG_PVH_GUEST section (if at all
possible). Or, if the reason for the change really is "just in case",
another option of course is to leave these two insn in the one central
place they are at right now.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 09:41:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 09:41:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775411.1185627 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdRXu-0007pY-Qd; Mon, 12 Aug 2024 09:40:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775411.1185627; Mon, 12 Aug 2024 09:40:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdRXu-0007pP-LZ; Mon, 12 Aug 2024 09:40:58 +0000
Received: by outflank-mailman (input) for mailman id 775411;
 Mon, 12 Aug 2024 09: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=gveb=PL=epam.com=prvs=4954548ae1=sergiy_kibrik@srs-se1.protection.inumbo.net>)
 id 1sdRXs-0007pJ-Q9
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 09:40:56 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f70694d2-588e-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 11:40:53 +0200 (CEST)
Received: from pps.filterd (m0174680.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47C7M6hS015074;
 Mon, 12 Aug 2024 09:40:41 GMT
Received: from eur05-am6-obe.outbound.protection.outlook.com
 (mail-am6eur05lp2104.outbound.protection.outlook.com [104.47.18.104])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 40x12yujew-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Mon, 12 Aug 2024 09:40:41 +0000 (GMT)
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com (2603:10a6:20b:5c0::11)
 by DBBPR03MB6779.eurprd03.prod.outlook.com (2603:10a6:10:1f5::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Mon, 12 Aug
 2024 09:40:38 +0000
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d]) by AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d%4]) with mapi id 15.20.7849.019; Mon, 12 Aug 2024
 09:40:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f70694d2-588e-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=HIwgFOp1Nr9r9RmolOV4HBi29hRuyNG6/0czDrmM98gPT0QY9ff6S0DJI4P1LvMUpk6Sl8mYjucCZqmksXdaqFS81tgVsqF5vE41/DdkryfSYrgnS34no0mE8/UBTiCorpTHrn+GVx55ZJkr0SOGGsOjQmxdsDjw9fhJ+hTYJwAl3zcdaUPu5J3iFT89lN1GhUIUjQ11KAq4i6kYqZD41m7wXN2RielDqOtZSzCnIq3Q+MUXMs8AY/kbbvxr/+UYzwYr8fBBJwVX15tbCzNXe7ga+ZyepybI5qoX0Po+fvfxAgEhfOF1W/Ph8oFlSFOVigkNtiLdBjkgiG5294CeKw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3J60Lu1Ko24Yt7SDG8qCQTrTfShpIfy43x/+MRA2PSU=;
 b=o9NnS9j+FZ9+4Z17giZi4aWnTkl+hWVzoA4xrjhUWsrCFBVZEl+ITV1bHQxyKWquwujNfAVBQV2wQtzb/wWIoAVnhwazLV65/aRq3eVGzEFdYJjG5v9zADidpsMPndDynnkf4zcNpHi1HVQwImUTX9PDgoirPUINP2LtJHPN1GUYxOPfohe72bmsmcU9Ywzp5ofbiUNKY224s9P97qbmU62bJ3eNvhgEPNtknuF1B0EBREzVp69o7WRQp9UsczwYD4YXfwrANf8qn0tLtm2boAKmetyBuIK5MsAMkWIqIKhKU0X0+3LLwBcvA6ULceiQ5PXTOybkjNQGl9IOc9Hm9A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3J60Lu1Ko24Yt7SDG8qCQTrTfShpIfy43x/+MRA2PSU=;
 b=SRmC1f4QumGs291ZrxE+XlPs/x6BPetAX2vanYn3ryylH8LwU2sC9DhUTOA98FoGOuT5Y1oUhd98Tw1TeLCG/tFS7GIuJeZHcFxgp8GDVS6m3yfchXzSG1Dhr3YJDD4d1EeUns+VFXwdE4Z2i1XWiTmYM0jAkV5ev+HAkzGsfJJy9YNxTmGBGjRbyy3wZiiOdCu1ESkmA3A4ZdeXine8LhVcL5ySTwbaHBkMzzVw91YWne/5mG690iLk0TJmjcDDRG2/+r6Hb1jHIRtxabBG8qAqRHfPbjl4qBuveHorLX+05BTOE/F+LlnhbRL+Dsr0S7s8LH8ptsBY+KF4yjIJ6w==
Message-ID: <dab7d359-4433-448f-b781-03544fd4b68d@epam.com>
Date: Mon, 12 Aug 2024 12:40:36 +0300
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v1 1/2] x86/intel: optional build of intel.c
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
        xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>,
        Andrew Cooper
 <andrew.cooper3@citrix.com>,
        =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>,
        Stefano Stabellini <sstabellini@kernel.org>
References: <cover.1723196909.git.Sergiy_Kibrik@epam.com>
 <25e80b9271607da56abf9d4193e4d91b3d00bd9c.1723196909.git.Sergiy_Kibrik@epam.com>
 <D3BBCS1WZ3FI.KYTC0BZLDUM9@cloud.com>
Content-Language: en-US
From: Sergiy Kibrik <sergiy_kibrik@epam.com>
In-Reply-To: <D3BBCS1WZ3FI.KYTC0BZLDUM9@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: WA2P291CA0030.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d0:1f::26) To AS8PR03MB9192.eurprd03.prod.outlook.com
 (2603:10a6:20b:5c0::11)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9192:EE_|DBBPR03MB6779:EE_
X-MS-Office365-Filtering-Correlation-Id: 2b58cae8-1f57-4f76-f7b0-08dcbab2d301
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?VFdYNndtSksxUzR6M2x4TjRGRUlSUkRvSDJud3NaMXdacXV4UWJ2YkpzTThF?=
 =?utf-8?B?RWtpSmo4YmVodUczajRYUktnZnFqdkRFckpxd0lZNnVaV1NIRVFOZThKL0VQ?=
 =?utf-8?B?NTNyaTZ1c3puMkpNYUZpRGovK0gyRDJ2V0l3UkFubXFzV1N2cWs5YnUrWFVU?=
 =?utf-8?B?VnlBV29QK3JPUkYwMml3R1ZFU0NDSmhnc3p0SzZWR3luemROUFdHaERGdDVM?=
 =?utf-8?B?RGd3VktKbWR5RGREQlhPdzBGVThEY1R6NDg0NjFNL2JlNHJidWdzL0NLeWZO?=
 =?utf-8?B?Ti8zRkJsejAybysyQXdVdWh6TXFVZW1TL3RIS3dkd1c4LzdnSHNWSi9tNHp2?=
 =?utf-8?B?WlpPRk1acUNmNlFSTzh3YWFGRDdxcDNtN0p3dHh3UUlqdklBMVVwek9MWEZZ?=
 =?utf-8?B?M3VOdUY5anhUY3BYR1pGSmo1aWR3RllTVmZKTlhjbFBHWTBMc2JSTUM5SENz?=
 =?utf-8?B?MVpNTkxhUDJUUFVITFVhdW9LLzJ5c0Zlc0prSzVMZ2wwRGt4Yk82dlpKSmFY?=
 =?utf-8?B?dEhVWVZ4WE9Oa0lOZU5MRVRPYVJzb3dIZm9xS2dGdm92NE1SR0ZMKzlqd0VY?=
 =?utf-8?B?TWxpdExHVFRBM2VyQ2VKeDhLTFRQR20vZGF0ZjExRVBRUUJSa2ZTcWFpOVNZ?=
 =?utf-8?B?VHVPTk9tSGh0M0VkUXQ2V2ZFS2trdDZndTgyVGVOYnNEZVJrakhJWmJUMElr?=
 =?utf-8?B?SllpSTRUOTdSaDh3N2VCVWlSOVZ4MEpmSGNycnRuMHI3dTFDYklnSHFodkpl?=
 =?utf-8?B?bjhFWDV3aEtVTEJpeTMxZ2VsaGhlU1gvQmgwaEgrOUV4dTJ0NlBRMnBlcWo3?=
 =?utf-8?B?MVB0R2xWWWJ6dGxyVi9QcUZiMERFSzFkSVpCWmdtTXhVVUVkamNuR29MMUl3?=
 =?utf-8?B?aklHdnFuYU9Zb3pqVWxaUUJxaisxMlFMOHB6NG1UWkdoUythaTBOYVVuM1JU?=
 =?utf-8?B?cUhBbVlwWmtCMzAwM2dMSHhQLzFKRmlMQzdja0hBbW9YVHY0NmhzZ0hqMFlq?=
 =?utf-8?B?Tk9IYVJVK2Nxa3lsQS81dExoLzhoMWhsNy90L1NzNFRZUXpiWDlQNjNQNDA3?=
 =?utf-8?B?WDdCOEhzSWF2dGNRcGhaYmtGRXVzNjljdHhYdFV4a25BaXdFdDdyQytlOGI4?=
 =?utf-8?B?c2FQcHNPSzk2OU8vdmxOc0tyUjZkTncyaEc5V2pITVV1ZFc5T284eW9oUTBz?=
 =?utf-8?B?SG9pbUFaQWFTVmVNb21BNlNuWCtjdHp2VmxOQ0R6MElMM2JDSTJ1akhCbk85?=
 =?utf-8?B?dmpWZ3dUWkNYN05HQ2NUMk54cVhaN1BYR0lKVEU5V2V0VWs0RzA5SEdtL2Nm?=
 =?utf-8?B?MXlnOW5lODBOODErTlJJbGlPNWxHdmV4N2s5SFVDTkdKTTY5QlFjcHNwazFo?=
 =?utf-8?B?bTdLY2xJZ3pGbFJ1bnFLLytrOFZpem95ZUE2LzkyakZUS1BnMFhjL2txWlR6?=
 =?utf-8?B?Y2hmRlYzRmMyaEliVmUzc0lkcXg1ZFFYZ1pSdmhDc01hWDJ5TW1NSnlJaVA3?=
 =?utf-8?B?a3RJR1U2cURRNTJUVldickhHZVNjbC9HdmVtY25Ua2JaNFRZaVFKUkxRZ2VL?=
 =?utf-8?B?NFdES091a29qWVZqVzdyd1J3MmZmeHFOOHAwclhOcXdoR2RsNFNCQW9nNmow?=
 =?utf-8?B?ak9UT28vUHBmb2t2K2xTbU5jOXpMaXJzSzR1S00reW1YejZ6b0p1RUpxMmMr?=
 =?utf-8?B?WlE0UWFzRUhSMis0TjBJUXhxdEJTTTNwNTl6a29KY0RJTE5qV2psS0FJenhw?=
 =?utf-8?B?YkJHTHc1ZWZYMEdnMjhwbDdNbWthOW8zbDNvK0NaS2tPblBJbTNCRHpaVFZ3?=
 =?utf-8?B?eHZDRzdOdTJmM0FxWHFMUT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9192.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?QzAxWFZ2VkRvMnVJekhyTkNYM2hvOGVFcytJYi9DTmk2VnFuMmhUL2hnSkV0?=
 =?utf-8?B?cTk5REVEVmxqZkppdVlXdFU1eXZxWkk3Unh3WXIwMnN4NC9KbDgxUjJWbytV?=
 =?utf-8?B?TTNsWWtRQ2c2VG5UdUkwSThabVg3MFpSVnNjZWJ6TXlVU3RyWlgvZzhsTGpW?=
 =?utf-8?B?MWJVbm9iamhDZWVzM0pzQlZ4c1FWT3N2aDA2cUEvKzJiZ3ZFK0crTmI3NVRx?=
 =?utf-8?B?dUZSV2l4YkJiTU90NkprcnpvVFYyZ3JqSTZtcmZzdWdMbTA4bnEyV0NNOXB2?=
 =?utf-8?B?ZjdVNDYwdnNWTmlIMmxwallkNmpLWk1WUUF1dzF4OW1NMDdoaVRsVTNSOWtQ?=
 =?utf-8?B?YVZjZURSYmovTWFmcUlQbzhuU3hRa0xmR2x3YSsvbGJreWhDUk11dGxzVHRi?=
 =?utf-8?B?bGRyeUJCa2pLL2I2dzgvMEl0U2U5VWtVdFFRZlkyTW1kZnRpd3VFTVhXVThs?=
 =?utf-8?B?cnVjemdVT2RtQytRQ29tejBuMjRNY0VERW4wSXhnL0htR2lSZHg3cGNxeVZp?=
 =?utf-8?B?VkJFNGFrWThMWG1aUS9vTTV2aFZGeE8zM3djc3dtNFlZUVlDRWIvL2Y5eGJx?=
 =?utf-8?B?a3VLSkZZVmMyYkpWSG5lV21KcDAzUVhxVzZldFdkRXd0WFVWeVlnQmc2RVVa?=
 =?utf-8?B?Yzlja3JPVGZ6cFpvLy9Ha2ZxNnZqUUdaem9hV1ZoNHUxVDQ5Z1p4WGZxQUlN?=
 =?utf-8?B?RG4zZ0tCWXVBWkpRSkdDS1lNVEtOYlJiTkRqcFdIdjdETmFOaExYQWZ4QXJv?=
 =?utf-8?B?U2dpZ2E3K3MwbEZOd09jelFEREpwOEdnZ1FrN1JFZFlZemcyUEJ4MWFrY1Fu?=
 =?utf-8?B?bWRtdWVYU1dicXVsRGtCc05JYlFLVklHZWFVclRNazVqa1NucFo3L1lPcjRv?=
 =?utf-8?B?VnpaazVmYUtHbDdJL21HQjRpRElDbFVITWllcmpwc2xEWU9MSVZlUndXUUcr?=
 =?utf-8?B?c0ExRUlDUGU2RzlMY2h2VmxQRG02QWc5Ym1WanBFZ0Z1Y25BYURJaHZHQ1BG?=
 =?utf-8?B?MjFUQTlQWjd2Z0kxSkZhVHVVRnJmcU1NN0FzREU0QTk4Y0tVZ0hqNHUzSHRY?=
 =?utf-8?B?VUVsN1Z6NG00a2EwT0E2bnFTOCtWN0s0OEdBWEMwaDFESGlYbkd2M0xkT3FE?=
 =?utf-8?B?aHpmQmJwSkJpU1hHM28xRDRuY0hVR210b3lHVCtaMFZDMUllS3BGVmt5bTBY?=
 =?utf-8?B?Z1VkYjBSbDdqMDg5ZklYSHpVR0pZWHBHeVEzb0lRRVQ2UENXUDJoTVlqSEM4?=
 =?utf-8?B?TkRraWVZT2ZJN1NxVVd6eDR0T2Y5S0x2cmUrbU1BRmJwVjVxRVNmdWtZM1ZF?=
 =?utf-8?B?Q1phMmRjTUFKZW1WVWV0OTEyK3lMNUl0dFVTUEJCeFBDK3RhQzlqRXpQTVRj?=
 =?utf-8?B?S3kxWEx1RXRqb1lTTFFUeEhxdDMrb3Ftc2U0V0VkTjczRWdXRXlack52ZlAx?=
 =?utf-8?B?YnROSlczMjFaTTJFbHkrSjd3RkxyTzNySkRMVkViRDFocUZJanQwQnc2aVRu?=
 =?utf-8?B?T2NGeWgwZERhNzFFYjcwcGZTVW9lU0k0RVB1VnBFZ0l3bys0Wk5TcHlGbW95?=
 =?utf-8?B?b1JmMER0Mjd0VkhsSE1CRUJFdFVvWnFyU09DN3JoY0xKMzErWWdPNk9KNDUr?=
 =?utf-8?B?eStkM20ya1hUalJPTFk1bGkvUXdRUTZPWi9PeHRNZHFnY3Uxd2FOQkZPb3Bh?=
 =?utf-8?B?dUQ3eGFya3U5VGJ1dWtCN0VFYWhGTHg3K21uOGxUVVFYWlVyQ09lelFpU3dL?=
 =?utf-8?B?Mm1SSFNhSlhJcWJkRFdPc0tCL0xZcGdzME9VaWtXQmFqOGlOV1VLOXdUUXNI?=
 =?utf-8?B?aFVhM0I5ZWNuUTVvWDZpZStxZE11NjVOenIySi9ic0xmV0RiaXViMVJvVjR6?=
 =?utf-8?B?N1lGaDFyTkpDZVdVY2xEc2FHaklEUGNCOXFZSFpDdDc4Um05dXY3c0JQM2xR?=
 =?utf-8?B?aHljdWlEWFBLbUZzNlhBT1ZCYlBQZkRlODdiV0kzVURvNnp1eEJNeWxuTUNh?=
 =?utf-8?B?SHVpRmllVmJqRXJxVTRRL0h3WWtwWDVaTDY4WGFyT0VMamozemQ0Mk0zZmw4?=
 =?utf-8?B?ZWV5OWIxd2VCOGltTDRBVkE1cGlIT2FmYnFLd1FuZGRlb01tOVVLSFFHREhD?=
 =?utf-8?Q?61moXUhN7VXhwRFeWqt1gDSCu?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 2b58cae8-1f57-4f76-f7b0-08dcbab2d301
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9192.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2024 09:40:38.7879
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: JbByr0eQ85wdE2CHEd7JRKSoNDQuxU+t+LU4whmc6SlKv3hViTTtbThEERBxWbf0wM0heTq7VWIMn+ac6ExwoQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR03MB6779
X-Proofpoint-ORIG-GUID: dBRbdRCa-SJjTwK3VPSJNQyIiNw1cw4g
X-Proofpoint-GUID: dBRbdRCa-SJjTwK3VPSJNQyIiNw1cw4g
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16
 definitions=2024-08-12_01,2024-08-07_01,2024-05-17_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0
 clxscore=1011 mlxscore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0
 impostorscore=0 priorityscore=1501 adultscore=0 spamscore=0
 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.19.0-2407110000 definitions=main-2408120072

09.08.24 13:36, Alejandro Vallejo:
> On Fri Aug 9, 2024 at 11:09 AM BST, Sergiy Kibrik wrote:
>> With specific config option INTEL in place and most of the code that depends
>> on intel.c now can be optionally enabled/disabled it's now possible to put
>> the whole intel.c under INTEL option as well. This will allow for a Xen build
>> without Intel CPU support.
>>
>> Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
>> ---
>>   xen/arch/x86/cpu/Makefile            | 6 +++---
>>   xen/arch/x86/cpu/common.c            | 4 +++-
>>   xen/arch/x86/include/asm/processor.h | 7 ++++---
>>   3 files changed, 10 insertions(+), 7 deletions(-)
>>
>> diff --git a/xen/arch/x86/cpu/Makefile b/xen/arch/x86/cpu/Makefile
>> index eafce5f204..020c86bda3 100644
>> --- a/xen/arch/x86/cpu/Makefile
>> +++ b/xen/arch/x86/cpu/Makefile
>> @@ -6,10 +6,10 @@ obj-y += amd.o
>>   obj-y += centaur.o
>>   obj-y += common.o
>>   obj-y += hygon.o
>> -obj-y += intel.o
>> -obj-y += intel_cacheinfo.o
>> +obj-$(CONFIG_INTEL) += intel.o
>> +obj-$(CONFIG_INTEL) += intel_cacheinfo.o
>>   obj-y += mwait-idle.o
>> -obj-y += shanghai.o
>> +obj-$(CONFIG_INTEL) += shanghai.o
> 
> Why pick this one too? It's based on VIA IP, aiui.

shanghai.c and intel.c both use init_intel_cacheinfo() routine, so 
there's build dependency on Intel code.

   -Sergiy


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 09:58:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 09:58:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775421.1185637 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdRoR-00020I-7r; Mon, 12 Aug 2024 09:58:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775421.1185637; Mon, 12 Aug 2024 09:58:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdRoR-00020B-4p; Mon, 12 Aug 2024 09:58:03 +0000
Received: by outflank-mailman (input) for mailman id 775421;
 Mon, 12 Aug 2024 09:58: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=PyEi=PL=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdRoQ-000205-Jb
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 09:58:02 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5c3255b0-5891-11ef-bc05-fd08da9f4363;
 Mon, 12 Aug 2024 11:58:01 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-a7d638a1f27so142236966b.2
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 02:58:01 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80bb1d12e7sm214592966b.122.2024.08.12.02.58.00
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 12 Aug 2024 02:58:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5c3255b0-5891-11ef-bc05-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723456681; x=1724061481; 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=EB26+UQWtBmTSj9MblnATVySQgBtTI+eeJ6Evw3yj4c=;
        b=YuMtM6xPhvmdVrH7P/nELY/J2Ksj99S/Lm03n2SUbZLR3q6af1IvDOJ3b+GfC19FY4
         NX31/BvZImZgtYsO5/eOsEQbEUdPfLefeJgWidvxkc3e/lalLjdzCDBjWgMaDG6YO4Nm
         qbXWrFMuSKeN5K20VaZjsSL0Ldc9f5dbSxsfc8f3N7PzdGQo8KsTJyX63o8IJthMMQxJ
         zpZQd0K2tOXrRiWGBvYFKQrlzG1NdEuupmByoD+whhZOOkqBLU04i9grI9NLsEi8qPYq
         L3l3rvAkPSd3XeaLfYBvqIUtx4ggjCW63RF3Wb9K3qj/3oqrCmb0YB91kBK8xn/W3JuU
         tntw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723456681; x=1724061481;
        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=EB26+UQWtBmTSj9MblnATVySQgBtTI+eeJ6Evw3yj4c=;
        b=PWIfIvlGmAiHSkzWCIbKc8VeYtVr9Z+EUnkM7HjLL2M2UPIW9h+AdJqa+9LPiVvo+1
         lJjVeDpGsWZV8LRssI+Ertc8/LDLfRMnuhxH4B3H5PYkQ0BC+PrutTZHe3PVOGzwtgq0
         xkhtdNHOm/ipFRcN8w75JLNVIVBogxDJCaofah3q4nbAhFfVk+T1KoZuTQUFR8BR+Hpe
         JgFBP3WAoTHOYqVPnrU0h5Ol9z/JXWF83GgexIeRPNcSzfZ3y1rP4jd7xHvwzDriow5x
         6VtPgNl1aTk9ojwCptFJqgWxmCsqygoWRUGNMkX/aoUFoFYk2yWDnaaUBgzJB7ZPL2qO
         SECA==
X-Forwarded-Encrypted: i=1; AJvYcCVE4qICAQrY0dBFoQa0yWQuJY3yfS3cr5yqUvlf6pyTBVFS5RvYt7zMUHS51BK8HUroZOlJDIe4dvr4o7CCW6ss9sLx6DsBMI5nRX1EVhg=
X-Gm-Message-State: AOJu0Yx7S97q7yR4kwWnXfGdeOsIhm6eNR4COALqaV8IHYsT4f3d9pei
	gmne7s24V92SQJ35LIh3RHNoUaF5bGrKbnQO1HfCHK0dfzdn4qzooJ8TsoMxBA==
X-Google-Smtp-Source: AGHT+IE96ARwUQQJ/OgoQNsnp4npalCU0m4H9eegxqxw489gcA70D31eQg8uyQ0PJBUTEAAbVPcfZg==
X-Received: by 2002:a05:6402:2552:b0:5a1:de88:a5ef with SMTP id 4fb4d7f45d1cf-5bd0a61e1d5mr7510997a12.27.1723456680574;
        Mon, 12 Aug 2024 02:58:00 -0700 (PDT)
Message-ID: <d449f8dc-2d59-4836-b26a-b29a83f7d6fb@suse.com>
Date: Mon, 12 Aug 2024 11:58:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v1 1/2] x86/intel: optional build of intel.c
To: Sergiy Kibrik <sergiy_kibrik@epam.com>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <cover.1723196909.git.Sergiy_Kibrik@epam.com>
 <25e80b9271607da56abf9d4193e4d91b3d00bd9c.1723196909.git.Sergiy_Kibrik@epam.com>
 <D3BBCS1WZ3FI.KYTC0BZLDUM9@cloud.com>
 <dab7d359-4433-448f-b781-03544fd4b68d@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <dab7d359-4433-448f-b781-03544fd4b68d@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 12.08.2024 11:40, Sergiy Kibrik wrote:
> 09.08.24 13:36, Alejandro Vallejo:
>> On Fri Aug 9, 2024 at 11:09 AM BST, Sergiy Kibrik wrote:
>>> --- a/xen/arch/x86/cpu/Makefile
>>> +++ b/xen/arch/x86/cpu/Makefile
>>> @@ -6,10 +6,10 @@ obj-y += amd.o
>>>   obj-y += centaur.o
>>>   obj-y += common.o
>>>   obj-y += hygon.o
>>> -obj-y += intel.o
>>> -obj-y += intel_cacheinfo.o
>>> +obj-$(CONFIG_INTEL) += intel.o
>>> +obj-$(CONFIG_INTEL) += intel_cacheinfo.o
>>>   obj-y += mwait-idle.o
>>> -obj-y += shanghai.o
>>> +obj-$(CONFIG_INTEL) += shanghai.o
>>
>> Why pick this one too? It's based on VIA IP, aiui.
> 
> shanghai.c and intel.c both use init_intel_cacheinfo() routine, so 
> there's build dependency on Intel code.

Yet Shanghai isn't as directly a clone of Intel CPUs as Hygon ones are
for AMD. So at the very least you want to justify your choice in the
description. After all there's also the alternative of having a separate
SHANGHAI Kconfig setting, which would merely have "select INTEL" or
"depends on INTEL".

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 10:33:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 10:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775429.1185648 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdSMh-00083h-Sz; Mon, 12 Aug 2024 10:33:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775429.1185648; Mon, 12 Aug 2024 10:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdSMh-00083a-OQ; Mon, 12 Aug 2024 10:33:27 +0000
Received: by outflank-mailman (input) for mailman id 775429;
 Mon, 12 Aug 2024 10:33:26 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdSMg-00083Q-Do; Mon, 12 Aug 2024 10:33:26 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdSMg-0002IG-BJ; Mon, 12 Aug 2024 10:33:26 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdSMf-0004Sx-RQ; Mon, 12 Aug 2024 10:33:25 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sdSMf-00016Y-Qz; Mon, 12 Aug 2024 10:33:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=kTVehJG5y9NYqkIkz26hCYCSQmFeV0YSqyLGPcwtGl4=; b=ecwEWV+h0OX9UXzUyWLExNgjnD
	JCqFFAy7eM5MaPfUeHkbHpQbEKX1JiY3oTImPBC5c0FxQHkuQUJEnd20zQtKZ4oPR2flyfpXmq0HV
	IhSKFD13BfHzgAqZx0rt03sjNiSg1Wel8pGe6/4WjQChhhUSiRFhDgvJoLrepH9ElhlE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187215-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187215: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=d61248b0fa2cdfc0be1d806c43d1b211a72b5d49
X-Osstest-Versions-That:
    xen=d61248b0fa2cdfc0be1d806c43d1b211a72b5d49
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 12 Aug 2024 10:33:25 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 xen                  d61248b0fa2cdfc0be1d806c43d1b211a72b5d49
baseline version:
 xen                  d61248b0fa2cdfc0be1d806c43d1b211a72b5d49

Last test of basis   187215  2024-08-12 01:54:44 Z    0 days
Testing same since                          (not found)         0 attempts

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


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

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

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

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


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Mon Aug 12 12:24:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 12:24:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775457.1185664 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdU5v-0007kG-My; Mon, 12 Aug 2024 12:24:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775457.1185664; Mon, 12 Aug 2024 12:24:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdU5v-0007k9-JW; Mon, 12 Aug 2024 12:24:15 +0000
Received: by outflank-mailman (input) for mailman id 775457;
 Mon, 12 Aug 2024 12:24:14 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KPBI=PL=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sdU5u-0007k2-Re
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 12:24:14 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c874ff3f-58a5-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 14:24:12 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-52f00ad303aso5763516e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 05:24:12 -0700 (PDT)
Received: from localhost ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80bb08fe5dsm225141766b.3.2024.08.12.05.24.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 12 Aug 2024 05:24:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c874ff3f-58a5-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723465452; x=1724070252; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=1EiMNcbDrL/oKXG+2/BbSSs8YnNkAmn62VdQTdoY164=;
        b=KapjBUTAbOrW+Dz/3ByK0cLEsIYPgi2X1n0oXA005zXm61DESiT5JNWy96IT9+RP3/
         FyGHLGbzfyrEhzcO9w4hdOo1TXn/f6b+y/XehrtIePk8XI8dm1Y6ZDZlseX8oK2FrO+S
         EQ6W14+Ami55IbZCzAvCZ+SZ/2SfN0GelpsK8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723465452; x=1724070252;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=1EiMNcbDrL/oKXG+2/BbSSs8YnNkAmn62VdQTdoY164=;
        b=Q7WYN+/ilsn/yTqkWxzU0Kc+zkGT63GAV+vFfbCD4gK8o/LI33JjbE/1HxvTtUZF4b
         iSqszyHMqCj8kfc73O26y9KrT4EEISdw9bDINKmXIkWEplyNKVpF5BEQAKJG7dGYPKWQ
         Em5uQ+HKSW0PFA/27X1tb30qKTjwW2URY9POa1bsc5DRlsCvdBN7epjX24PLdDZeqfOE
         aI+oki8vZdUZcf0D3rmjYdUddlOf+9RBJ2+GP9kS4xkVPNT9Gr0X4o5mcCFLdPD1EZoA
         CTOaR1v64RweqS3kuyHLYgCdMaLi/BSrzEmime4b/kBO0MUSInamumRBH+Ba9stm0DEQ
         znew==
X-Forwarded-Encrypted: i=1; AJvYcCW6j3vCs+CDNUDs2S/KAn0MQyVoJY+QxcwihdXcgYVTss5PqfjkdqCI56mgiIL1E8XAL1+9WSlEton1iVV1edJQyKMjaDv4SqMb6rhEiQk=
X-Gm-Message-State: AOJu0YxaaBWA78WdgsGFp1md7WvemDSWPfGBMIK3LkDT4ZKtOjqS+1lD
	vsVRcPFGxNmmqhF46PRY1sDCwTh1ejYD1wSWVL9h/KZ+FriEl7dBmcNyc1rO354KVdCpDf877iu
	v
X-Google-Smtp-Source: AGHT+IGJ85U7OLxVwY1+ip45LBTIutbtmvof9lFfwCwGRGZ655E0dWxjk/XBByPiOzS9uRyrFAc7qw==
X-Received: by 2002:a05:6512:3d8a:b0:52c:8df9:2e6f with SMTP id 2adb3069b0e04-530ee9d1a39mr6541914e87.42.1723465452094;
        Mon, 12 Aug 2024 05:24:12 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Mon, 12 Aug 2024 13:24:10 +0100
Message-Id: <D3DXIHMBKVC1.21P79JH7NMMG4@cloud.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
 =?utf-8?q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, "Stefano
 Stabellini" <sstabellini@kernel.org>
Subject: Re: [XEN PATCH v1 1/2] x86/intel: optional build of intel.c
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Jan Beulich" <jbeulich@suse.com>, "Sergiy Kibrik"
 <sergiy_kibrik@epam.com>, <xen-devel@lists.xenproject.org>
X-Mailer: aerc 0.17.0
References: <cover.1723196909.git.Sergiy_Kibrik@epam.com>
 <25e80b9271607da56abf9d4193e4d91b3d00bd9c.1723196909.git.Sergiy_Kibrik@epam.com> <D3BBCS1WZ3FI.KYTC0BZLDUM9@cloud.com> <dab7d359-4433-448f-b781-03544fd4b68d@epam.com> <d449f8dc-2d59-4836-b26a-b29a83f7d6fb@suse.com>
In-Reply-To: <d449f8dc-2d59-4836-b26a-b29a83f7d6fb@suse.com>

On Mon Aug 12, 2024 at 10:58 AM BST, Jan Beulich wrote:
> On 12.08.2024 11:40, Sergiy Kibrik wrote:
> > 09.08.24 13:36, Alejandro Vallejo:
> >> On Fri Aug 9, 2024 at 11:09 AM BST, Sergiy Kibrik wrote:
> >>> --- a/xen/arch/x86/cpu/Makefile
> >>> +++ b/xen/arch/x86/cpu/Makefile
> >>> @@ -6,10 +6,10 @@ obj-y +=3D amd.o
> >>>   obj-y +=3D centaur.o
> >>>   obj-y +=3D common.o
> >>>   obj-y +=3D hygon.o
> >>> -obj-y +=3D intel.o
> >>> -obj-y +=3D intel_cacheinfo.o
> >>> +obj-$(CONFIG_INTEL) +=3D intel.o
> >>> +obj-$(CONFIG_INTEL) +=3D intel_cacheinfo.o
> >>>   obj-y +=3D mwait-idle.o
> >>> -obj-y +=3D shanghai.o
> >>> +obj-$(CONFIG_INTEL) +=3D shanghai.o
> >>
> >> Why pick this one too? It's based on VIA IP, aiui.
> >=20
> > shanghai.c and intel.c both use init_intel_cacheinfo() routine, so=20
> > there's build dependency on Intel code.

My point is that the use of Intel functions on Shanghai and not Centaur is
accidental. If shanghai goes under Intel so should Centaur (imo).

>
> Yet Shanghai isn't as directly a clone of Intel CPUs as Hygon ones are
> for AMD. So at the very least you want to justify your choice in the
> description. After all there's also the alternative of having a separate
> SHANGHAI Kconfig setting, which would merely have "select INTEL" or
> "depends on INTEL".
>
> Jan

That's one option, another is for the Kconfig options to explicitly state w=
hich
vendors they apply to. I'd be fine with either. It's less fine for CONFIG_I=
NTEL
to cover a VIA derivative and not the other.

Cheers,
Alejandro


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 12:42:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 12:42:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775467.1185674 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUNs-0002kZ-48; Mon, 12 Aug 2024 12:42:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775467.1185674; Mon, 12 Aug 2024 12:42:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUNs-0002kS-1N; Mon, 12 Aug 2024 12:42:48 +0000
Received: by outflank-mailman (input) for mailman id 775467;
 Mon, 12 Aug 2024 12:42:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=JhuI=PL=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sdUNq-0002kM-Me
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 12:42:46 +0000
Received: from mail-oo1-xc2b.google.com (mail-oo1-xc2b.google.com
 [2607:f8b0:4864:20::c2b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5f2222b7-58a8-11ef-bc05-fd08da9f4363;
 Mon, 12 Aug 2024 14:42:45 +0200 (CEST)
Received: by mail-oo1-xc2b.google.com with SMTP id
 006d021491bc7-5d5c324267aso2565154eaf.0
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 05:42:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5f2222b7-58a8-11ef-bc05-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723466564; x=1724071364; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=BRf+pPvCu+jn0xLuEppOz887jSyZYBS2gnlP85aMlwI=;
        b=CitaaBkDYqe0TyED5ebLVPsdU1AOs3vwCadbDzAweENtB6l5uMdGT3oNV/Z/CeCX3f
         I4TyQ5TOm3iKLFdjg52ROUNBcr3hum4d5SjkGC56phRs9ygl4HHOCHS6FssyaB41/h1H
         zbw9rTn6lRTHrQOtPE0GAdz4BX2rXvSAaNnGs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723466564; x=1724071364;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=BRf+pPvCu+jn0xLuEppOz887jSyZYBS2gnlP85aMlwI=;
        b=EHPADhp3t2muN/qkse6XnM60TzKmAquhDYgSlI4fiuM2VHjYT0G1G7ar1dq5l9qWi0
         8Gg4hqRDlpDrfuYBma83pnAgiJ61l773U9ck+7DCoq/Ic2WkWfq/zj16Zn2cY58JHkyA
         +nK7XFaTaRetFpEgpvi91u4LdapT6lYbCBZaI9k6+OZddRqltehGjaz47jOl8qChs8Lz
         n0cEk/8/H1kLMYcV33+xoFoiXQyNtKnb0vaH4t5db/SLtDxBWc8xfugruXooZJcMteom
         EFcOlirPa3e+LxZjTs577TSlRKvF+YXRju5FBn6Lz560O6pEdhOj0kh+LKuRIKaVPthi
         BbgA==
X-Forwarded-Encrypted: i=1; AJvYcCWe4isEdMxrL2dy4pVYEgq8OU4bSSZq/T2ntSXfK+oPKPqupYdf0Z1YzOitJveopDc9h0zW2JnaEtbsuUAXKcshjeSPrhnysyo0sYsMaAA=
X-Gm-Message-State: AOJu0YwWPisThSSnS0xfDcqsMPiGbzYngJ9KlRIbVPh9EgjwOGfLzOjS
	cP7fNh9YbdFhQsda6GKAGWOtdLKPBVJYKG87R2va5Nv4GE/J8WQz7sYyZWICqQioBYjmUWn/EXY
	j0hFMxexci2prA+tSt+Xr+FPuSoeeBzeCixxemw==
X-Google-Smtp-Source: AGHT+IFkSC0Qd1NEe+qFZ1hFgfPoITDSZRrvnl8rgbOuPP7dakfmcW1VOoPu5uhEa6AxlG7lmGRrhuHliqCP/pykU6A=
X-Received: by 2002:a05:6820:2295:b0:5c4:e8d:58be with SMTP id
 006d021491bc7-5da687f9778mr330429eaf.3.1723466564243; Mon, 12 Aug 2024
 05:42:44 -0700 (PDT)
MIME-Version: 1.0
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-4-alejandro.vallejo@cloud.com> <cf819b39-6ce8-4446-b7b6-a1b247f45400@suse.com>
 <CACHz=ZgwPunPO771EbX1hKEdmXC1ysBQ7RzYK8K1pakyBS927A@mail.gmail.com>
 <7f0a7c9e-0cac-48ae-b7aa-5c90a1a5f4ca@suse.com> <CACHz=ZgCodGsFdyKe+F4gY3nAnymHLQ0T23CWSqauEhbm=Ubeg@mail.gmail.com>
 <14fc293a-4a0d-4de2-b468-bd0ef8c912b1@suse.com> <CACHz=Zj+LKKvPxTd8SGYthBTPiC6bEPrZg0nt=ehpOJ4JwqoiQ@mail.gmail.com>
 <bdc1083b-f6bd-4e4e-b56d-9e1fc09393e9@suse.com>
In-Reply-To: <bdc1083b-f6bd-4e4e-b56d-9e1fc09393e9@suse.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Mon, 12 Aug 2024 13:42:33 +0100
Message-ID: <CACHz=Zj-ZFT=xXcVQS9opVLFvcSGFAGtCWHev+MXQHLwzCPdrQ@mail.gmail.com>
Subject: Re: [PATCH 3/5] x86: Set xen_phys_start and trampoline_xen_phys_start earlier
To: Jan Beulich <jbeulich@suse.com>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Xen-devel <xen-devel@lists.xenproject.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 12, 2024 at 9:41=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> On 09.08.2024 16:34, Frediano Ziglio wrote:
> > On Fri, Aug 9, 2024 at 3:02=E2=80=AFPM Jan Beulich <jbeulich@suse.com> =
wrote:
> >>
> >> On 09.08.2024 15:50, Frediano Ziglio wrote:
> >>> On Fri, Aug 9, 2024 at 1:59=E2=80=AFPM Jan Beulich <jbeulich@suse.com=
> wrote:
> >>>>
> >>>> On 09.08.2024 14:48, Frediano Ziglio wrote:
> >>>>> On Thu, Aug 8, 2024 at 9:25=E2=80=AFAM Jan Beulich <jbeulich@suse.c=
om> wrote:
> >>>>>> On 07.08.2024 15:48, Alejandro Vallejo wrote:
> >>>>>>> No reason to wait, if Xen image is loaded by EFI (not multiboot
> >>>>>>> EFI path) these are set in efi_arch_load_addr_check, but
> >>>>>>> not in the multiboot EFI code path.
> >>>>>>> This change makes the 2 code paths more similar and allows
> >>>>>>> the usage of these variables if needed.
> >>>>>>
> >>>>>> I'm afraid I'm struggling with any "similarity" argument here. Imo=
 it
> >>>>>> would be better what, if anything, needs (is going to need) either=
 or
> >>>>>> both of these set earlier. Which isn't to say it's wrong to do ear=
ly
> >>>>>> what can be done early, just that ...
> >>>>>>
> >>>>>
> >>>>> About similarity is that some part of EFI code expect xen_phys_star=
t
> >>>>> to be initialized so this change make sure that if in the future th=
ese
> >>>>> paths are called even for this case they won't break.
> >>>>>
> >>>>>>> --- a/xen/arch/x86/boot/head.S
> >>>>>>> +++ b/xen/arch/x86/boot/head.S
> >>>>>>> @@ -259,6 +259,11 @@ __efi64_mb2_start:
> >>>>>>>          jmp     x86_32_switch
> >>>>>>>
> >>>>>>>  .Lefi_multiboot2_proto:
> >>>>>>> +        /* Save Xen image load base address for later use. */
> >>>>>>> +        lea     __image_base__(%rip),%rsi
> >>>>>>> +        movq    %rsi, xen_phys_start(%rip)
> >>>>>>> +        movl    %esi, trampoline_xen_phys_start(%rip)
> >>>>>>
> >>>>>> ... this path is EFI only if I'm not mistaken, while ...
> >>>>>>
> >>>>>>> @@ -605,10 +610,6 @@ trampoline_setup:
> >>>>>>>           * Called on legacy BIOS and EFI platforms.
> >>>>>>>           */
> >>>>>>>
> >>>>>>> -        /* Save Xen image load base address for later use. */
> >>>>>>> -        mov     %esi, sym_esi(xen_phys_start)
> >>>>>>> -        mov     %esi, sym_esi(trampoline_xen_phys_start)
> >>>>>>
> >>>>>> ... the comment in context is pretty clear about this code also be=
ing
> >>>>>> used in the non-EFI case. It is, however, the case that %esi is 0 =
in
> >>>>>> that case. Yet surely you want to mention this in the description,=
 to
> >>>>>> clarify the correctness of the change.
> >>>>>
> >>>>> Restored this code.
> >>>>
> >>>> Was my analysis wrong then and it's actually needed for some specifi=
c
> >>>> case?
> >>>
> >>> Not clear to what exactly you are referring.
> >>> That later part of code (which was removed) is still needed in case o=
f no-EFI.
> >>
> >> Is it? Under what conditions would %esi be non-zero? As indicated by m=
y earlier
> >> reply, I think it would never be. In which case the two stores are poi=
ntless.
> >
> > I really don't follow, %esi at that point should be the address where
> > the executable is loader, which should not be zero.
>
> In the PVH entry point it'll be, but else? Note this code in setup.c:
>
>         /* Is the region suitable for relocating Xen? */
>         if ( !xen_phys_start && e <=3D limit )
>
> That relocating of Xen wouldn't happen if we stored a non-zero value in
> the default (xen.gz with grub1/2) case. Also take a look at Xen before
> the EFI/MB2 path was added. xen_phys_start wasn't even written from
> head.S at that time. And if it's for the PVH entry point alone, that
> code then would want moving into the CONFIG_PVH_GUEST section (if at all
> possible). Or, if the reason for the change really is "just in case",
> another option of course is to leave these two insn in the one central
> place they are at right now.
>

Hi,
  as I said I added back the lines in the original place too (I didn't
still send that update, I want to finish other changes you suggested).
The reason I added these lines is the usage in efi-boot.h, it has
nothing to do with PVH. Yes, at the moment that part of the code is
executed only on direct EFI program so it's not impacting these paths
but better safe than sorry.

> Jan

Frediano


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 13:04:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 13:04:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775479.1185684 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUih-0006Mq-Go; Mon, 12 Aug 2024 13:04:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775479.1185684; Mon, 12 Aug 2024 13:04:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUih-0006Mj-E0; Mon, 12 Aug 2024 13:04:19 +0000
Received: by outflank-mailman (input) for mailman id 775479;
 Mon, 12 Aug 2024 13:04:18 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=t0sR=PL=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sdUig-0006Md-Oi
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 13:04:18 +0000
Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com
 [2a00:1450:4864:20::62d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 60814b29-58ab-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 15:04:15 +0200 (CEST)
Received: by mail-ej1-x62d.google.com with SMTP id
 a640c23a62f3a-a7ad02501c3so519208066b.2
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 06:04:15 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80bb0e0643sm228062366b.47.2024.08.12.06.04.13
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 12 Aug 2024 06:04:14 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 60814b29-58ab-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723467855; x=1724072655; 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=o+3HOJlQ0IGpR2wCuV6uV+BTcwB/YqqQtFkrIQUjEqQ=;
        b=pQZ9kvntVgp9BaXA0DU0irno10a5CtF9AlzxZzanEbcSm+/sXxvBczYzrgXyqhBA2k
         TCE02aam/pCsL6REJnVrlKfSKMxJ2nV1Ht8OdbtwAGqY8Rp8CKXyJoLmWPRzyZsBEa+L
         nFu3LBLHhE2ijeUcJ8go+EDWAM9DkrpAawLN0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723467855; x=1724072655;
        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=o+3HOJlQ0IGpR2wCuV6uV+BTcwB/YqqQtFkrIQUjEqQ=;
        b=HMGTQ9qf9oTAvRk3yCUUAL02e7CAq8EfbwQ4NCjq8mx8CrPR/UVYwqq1OOk28WYvQ6
         0Snu3RWU5nmiqGvpXm0VnDaqvi/JyTZ5f/HcCvIO+m8KxY72qD6FChbyEk1N5sMaVXsd
         StfKrgsYoGAFZOdfRwC69mDTDVawfLYha3w5/8vVT54phwBoI+A0XqYX+Blop0Sk1Erh
         Y2DYRmvhKfZ0Jq+DWkSPA8tePzWtd3OeNwZt2z0YKvUjWkJAcRcVGa+wGDIVYQXfX3NC
         stVkki3LEI7P1Wef7HfxxMIRpUAxWAr3ilh9xt0gDqvCL1GwozU3ygIYlMY88HfbnHEW
         nPbA==
X-Forwarded-Encrypted: i=1; AJvYcCW966qfC7QLzalV3P+hTM9ZI8Mh61mewEOpgd0V9vWMObLLWldlEuEY3x9Bu39Nal56IeKjQufD+3gGlt7mzXHQJwtaAY2rBkmwFY2Vnng=
X-Gm-Message-State: AOJu0YzyPcjacZlxpq9oaY5HTA5WazeIbehgW+7u8b1HM1+HbgZBgeK9
	Y9PP32bOID2+PRIXzk+9CXA4zHfVp8SmkXd4rVYoMvTII30ad2f8Cy+za5pTprgLy6PjCSTEZib
	C
X-Google-Smtp-Source: AGHT+IHk03lz1T/6miy2aoL4WJ28V9nwqCGCnf7/ib91Ka4pBOw3ifiGQKlRgAJrTRpJ9LjTa5xrxw==
X-Received: by 2002:a17:907:c8a3:b0:a7a:3928:3529 with SMTP id a640c23a62f3a-a80ed1bfe86mr20242066b.13.1723467854716;
        Mon, 12 Aug 2024 06:04:14 -0700 (PDT)
Message-ID: <a7d15429-ce49-43b1-9bbd-7b0129094388@citrix.com>
Date: Mon, 12 Aug 2024 14:04:11 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: don't call ->read_segment() with x86_seg_none
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <81ae365f-98b4-4bb6-bbb6-c5423dfda038@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <81ae365f-98b4-4bb6-bbb6-c5423dfda038@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 05/08/2024 2:26 pm, Jan Beulich wrote:
> LAR, LSL, VERR, and VERW emulation involve calling protmode_load_seg()
> with x86_seg_none. The fuzzer's read_segment() hook function has an
> assertion which triggers in this case. Calling the hook function,
> however, makes little sense for those insns, as there's no data to
> retrieve. Instead zero-filling the output structure is what properly
> corresponds to those insns being invoked with a NUL selector.
>
> Fixes: 06a3b8cd7ad2 ("x86emul: support LAR/LSL/VERR/VERW")
> Oss-fuzz: 70918
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> It is pure guesswork that one of those insns did trigger the assertion.

Tamas handed me the repro seeing as I don't have access to the bugs.  It
was VERR/VERW.

> The report from oss-fuzz sadly lacks details on the insn under
> emulation.

I've got a still-pending patch to add `--debug` to the harness to dump
that information.

> I'm further surprised that AFL never found this.

I haven't done any AFL testing since 06a3b8cd7ad2 was added.

This crash is specific to VERW/etc with a NULL selector, which will be a
rare combination to encounter.

>
> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> @@ -839,7 +839,8 @@ protmode_load_seg(
>          case x86_seg_tr:
>              goto raise_exn;
>          }
> -        if ( !_amd_like(cp) || vcpu_has_nscb() || !ops->read_segment ||
> +        if ( seg == x86_seg_none || !_amd_like(cp) || vcpu_has_nscb() ||
> +             !ops->read_segment ||
>               ops->read_segment(seg, sreg, ctxt) != X86EMUL_OKAY )
>              memset(sreg, 0, sizeof(*sreg));
>          else

While this fixes the crash, I'm not sure it will behave correctly for
VERR/VERW.

protmode_load_seg() is unconditionally X86EMUL_OKAY for a NULL selector,
and VERW checks for type != 0x8 which an empty attr will pass.

Interestingly, both Intel and AMD state that the NULL selector is
neither readable nor writeable.

Also, looking at the emulator logic, we're missing the DPL vs
CPL/RPL/Conforming checks.

~Andrew


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 13:06:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 13:06:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775487.1185694 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkd-000752-RI; Mon, 12 Aug 2024 13:06:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775487.1185694; Mon, 12 Aug 2024 13:06:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkd-00074v-Og; Mon, 12 Aug 2024 13:06:19 +0000
Received: by outflank-mailman (input) for mailman id 775487;
 Mon, 12 Aug 2024 13:06:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=FAji=PL=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sdUkc-00074b-3o
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 13:06:18 +0000
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com
 [2a00:1450:4864:20::12e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a955124c-58ab-11ef-bc05-fd08da9f4363;
 Mon, 12 Aug 2024 15:06:17 +0200 (CEST)
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-52ef95ec938so4298569e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 06:06:17 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-53200f3f7cbsm733690e87.246.2024.08.12.06.06.15
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 12 Aug 2024 06:06:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a955124c-58ab-11ef-bc05-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723467977; x=1724072777; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=CShc+/eJ/eiKg8FqCgbRmAZvWuQTxo7AG/GfIA6PJS0=;
        b=DsbKZvXphmQJTapC7Dp39ETX7mdK+WRjmteye6iGn/PEQMZD9PqOtz2aBrui+O042M
         d4oSmbAAQrC9rC/yJT4k5T0ZSQdXi2CNOZHtx0g53FP4jFvX/Vsp5fOGvBMGCe00U1UL
         wNEBktXHtvHn+kAY4DuaGCuTHnAoYMFI40akmvd09KYAqXrPCOc7McyfMXoZx8rlbMr2
         run7/341ohcTnRgaz8eHiYgoz52p5ViEM2kYRCP1dWTV9JbqGEOI8/wAaku06ZcYMnjH
         cIiUE13K85Xz10xr5IWaA6lcaMYBYQu27Y9Q5z6JUJ32WxMWUmKuBBp4ORA5ZoI1KxIk
         lOqQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723467977; x=1724072777;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=CShc+/eJ/eiKg8FqCgbRmAZvWuQTxo7AG/GfIA6PJS0=;
        b=ftEfiiTDSZejJwFrd8nVzJPkUI8qc707Wt0R5kteKYFQ98Mtrn8+bbCMk4neeN9o1J
         K1xPvapA9tbsdyB92KavCqFAFEJHneGsMopu+HnOc9YtRS9bDPrW1o6zyrdYmCSFQTuf
         mySsYU5lRwAq6oYJEWuFhCtxVkHpAiNhUu5TjsPRc+k02m96CeU0xVKAB0YHYQwcEjWg
         2K+FK2gO0KiKK7FU5IrKo/Glx9CfsvbNz/6x+XY1wAx5d8gS9hEJd+6TKQvOhpWpcslV
         KrUryHHe1bMwCwd7e4THXxE38e2gvzu7E+RmcVvGtNc96MANBshrOKPFSK2wa3FBsbkI
         jm7g==
X-Forwarded-Encrypted: i=1; AJvYcCWOhZ4f/gziq1TXXvMxycEHIcEba94hk0i4FexBl7n1R/YWhXT7J4C3LVBkrX195iCPH0BOOETP3/ofszZfcYVB0r6AxbmrbkJrEu4E8SY=
X-Gm-Message-State: AOJu0YxHf9K+1Osrs2txzK39HO4/sWhNicPjEgzVdXGwG7bAPLFtvWMj
	OSFLQ0FYVcGXoBBFPq9gDzuDdDPlDYdFEdWikFbZuFijN6nTTtRw
X-Google-Smtp-Source: AGHT+IGyAfAGEwHpXN3mXDKP16d0LaryN/gTiqmKRJmEMkapDIMD5759JSxXq0T/pSPMTWqkAaeRxA==
X-Received: by 2002:a05:6512:696:b0:52c:d6d7:9dd0 with SMTP id 2adb3069b0e04-53213658bdamr53118e87.20.1723467976051;
        Mon, 12 Aug 2024 06:06:16 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org
Subject: [PATCH v1 00/10] xen: pvh: Partial QOM:fication with new x86 PVH machine
Date: Mon, 12 Aug 2024 15:05:55 +0200
Message-ID: <20240812130606.90410-1-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

This series breaks-out parts of the ARM PVH support into a reusable
QOM module. There's a bit of refactoring and some bug-fixes along
the way.

Finally we add a new x86 xen-pvh machine using the new xen-pvh-common
module.

The corresponding changes Xen for PVH x86 are work in progress
(by Xenia Ragiadakou). You can find a current version here:
https://github.com/edgarigl/xen/tree/edgar/virtio-pvh-upstream 

I've briefly described the steps to run Xen PVH x86 guests here
(including example guest kernel config, xl.cfg and xl command-lines):
https://github.com/edgarigl/docs/blob/master/xen/pvh/xenpvh-x86.md

Cheers,
Edgar

Edgar E. Iglesias (10):
  MAINTAINERS: Add docs/system/arm/xenpvh.rst
  hw/arm: xenpvh: Update file header to use SPDX
  hw/arm: xenpvh: Tweak machine description
  hw/arm: xenpvh: Add support for SMP guests
  hw/arm: xenpvh: Break out a common PVH module
  hw/arm: xenpvh: Rename xen_arm.c -> xen-pvh.c
  hw/arm: xenpvh: Reverse virtio-mmio creation order
  hw/xen: pvh-common: Add support for creating PCIe/GPEX
  hw/i386/xen: Add a Xen PVH x86 machine
  docs/system/i386: xenpvh: Add a basic description

 MAINTAINERS                     |   2 +
 docs/system/i386/xenpvh.rst     |  49 ++++++
 docs/system/target-i386.rst     |   1 +
 hw/arm/meson.build              |   2 +-
 hw/arm/trace-events             |   5 -
 hw/arm/xen-pvh.c                | 165 ++++++++++++++++++++
 hw/arm/xen_arm.c                | 267 --------------------------------
 hw/i386/xen/meson.build         |   1 +
 hw/i386/xen/xen-pvh.c           | 196 +++++++++++++++++++++++
 hw/xen/meson.build              |   1 +
 hw/xen/trace-events             |   4 +
 hw/xen/xen-pvh-common.c         | 262 +++++++++++++++++++++++++++++++
 include/hw/xen/xen-pvh-common.h |  53 +++++++
 13 files changed, 735 insertions(+), 273 deletions(-)
 create mode 100644 docs/system/i386/xenpvh.rst
 create mode 100644 hw/arm/xen-pvh.c
 delete mode 100644 hw/arm/xen_arm.c
 create mode 100644 hw/i386/xen/xen-pvh.c
 create mode 100644 hw/xen/xen-pvh-common.c
 create mode 100644 include/hw/xen/xen-pvh-common.h

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 12 13:06:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 13:06:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775488.1185698 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUke-00078H-3d; Mon, 12 Aug 2024 13:06:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775488.1185698; Mon, 12 Aug 2024 13:06:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkd-00077c-VQ; Mon, 12 Aug 2024 13:06:19 +0000
Received: by outflank-mailman (input) for mailman id 775488;
 Mon, 12 Aug 2024 13:06:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=FAji=PL=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sdUkc-00074b-Ss
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 13:06:18 +0000
Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com
 [2a00:1450:4864:20::234])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a9d20988-58ab-11ef-bc05-fd08da9f4363;
 Mon, 12 Aug 2024 15:06:18 +0200 (CEST)
Received: by mail-lj1-x234.google.com with SMTP id
 38308e7fff4ca-2eeb1ba040aso58542581fa.1
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 06:06:18 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f29203d817sm8573481fa.99.2024.08.12.06.06.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 12 Aug 2024 06:06:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a9d20988-58ab-11ef-bc05-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723467978; x=1724072778; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=FnvsVFgAwwQYqvVPxF+lYxfpYXdBbERxwoGEJpJUJUI=;
        b=VNUXtoyXxFeQlfzRQujuWTNEWNDBK4+r8lCcvyE94P6T69/+izCk04ZsdYYCvuf6XZ
         w2zvox0fZUY/mMmxzzhtSoijQP5HaOuT6T+1CW+v0JtPUl6u8S33U1o095yLy+4+SHmf
         CDLqczOsstpMFnO6d6ofUQkcMfu1d1WA0oZd7skyQSr+hKGIeJq1fKeckB1lUD0wdgRJ
         7UR5nUblFA0ftuKR6QswhIbuCsy3yi3Lt4ObIR6UBCKwo6k3REiXf8oNyDNyMqU6hsdV
         qOBdO4qfKIZ5iz2A2wV1nM3Gp7JQyo17zNvT1CBFse4Psilp8tuPt96wSqsQYSNLSRG1
         rijg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723467978; x=1724072778;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=FnvsVFgAwwQYqvVPxF+lYxfpYXdBbERxwoGEJpJUJUI=;
        b=c8KMtCIKlelOfWneO5Z3xVcRpewFd99Wu4FSVCdVOAatmvcmW4XByU0AaW+m3L4uz0
         DLHvD/kwd04RTdQ7NoFYYSvgTfbbsGna9l738qS9rSavM/S2tIT8xrur98UiwAVrC2GE
         YjI/4WYFCiStCcH31fWu8cEwI4HBwR/OeliHpF4XECA1jtbeas8zhgvhrWN41uoInhwp
         fxM7XFnQFwWsi/L2eUL13AZbieW3CXZo2ufDcZsJsMVdiJ0Pcy7qDvggbLeu8y7SW0CO
         +EDYXDmi3ns25FKMD7iM+Op04PojDRenv8h31WCfsrLwArSMGnJB0wP8jj1xExj0J0T5
         RsMw==
X-Forwarded-Encrypted: i=1; AJvYcCVkjDmGjqH2VD+pvhwDPoYnV//v4qvUHKyG4g0ArqFmeUtehrwvLAh+6Ak07fdZnRDblnqPjLdVTDcfAMyDc0Li9CVnFXP1zs9YALh/w58=
X-Gm-Message-State: AOJu0YxE0m0KOjh9cbMFZDW2E1r0W8z8u0eLiLo5uqcwyAqoIFMGQRyC
	l1ayyFHyf0LHiDZqeldVGgoiilRbg+FePNZxHLe/Lwh4SpftOdae
X-Google-Smtp-Source: AGHT+IEH+rt8R3wDG+QKY36k4z1epabtE0qsH5Q2v+VF3qRP2OiK5eGbpOcoKlfiNpSaMtmPoTatVw==
X-Received: by 2002:a2e:721a:0:b0:2ef:1d79:cae7 with SMTP id 38308e7fff4ca-2f2b714cfddmr1523661fa.14.1723467977110;
        Mon, 12 Aug 2024 06:06:17 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org
Subject: [PATCH v1 01/10] MAINTAINERS: Add docs/system/arm/xenpvh.rst
Date: Mon, 12 Aug 2024 15:05:56 +0200
Message-ID: <20240812130606.90410-2-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240812130606.90410-1-edgar.iglesias@gmail.com>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 10af212632..a24c2e14d9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -559,6 +559,7 @@ F: include/hw/xen/
 F: include/sysemu/xen.h
 F: include/sysemu/xen-mapcache.h
 F: stubs/xen-hw-stub.c
+F: docs/system/arm/xenpvh.rst
 
 Guest CPU Cores (NVMM)
 ----------------------
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 12 13:06:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 13:06:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775489.1185714 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkh-0007gh-DE; Mon, 12 Aug 2024 13:06:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775489.1185714; Mon, 12 Aug 2024 13:06:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkh-0007gY-9j; Mon, 12 Aug 2024 13:06:23 +0000
Received: by outflank-mailman (input) for mailman id 775489;
 Mon, 12 Aug 2024 13:06:21 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=FAji=PL=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sdUkf-0007ep-UI
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 13:06:21 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id aa9d6f82-58ab-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 15:06:19 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2f1870c355cso41518911fa.1
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 06:06:19 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f291df57cbsm8687111fa.52.2024.08.12.06.06.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 12 Aug 2024 06:06:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aa9d6f82-58ab-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723467979; x=1724072779; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=q0MBRxvJH0y/bIJK1xHx6k1kVCY+2jxCQ2h5fP5Rdc8=;
        b=XmDjXo/FLlb+oTjzlkUJRxVRUpQajqR2uiuZz5G0K8cbzGzXNCY3HPqgylRZFA46m+
         p+wvERCi82FjzMk8xeIBhHFTmYdtUWwEMwifxiQ2oAjjP6rKRv9ahV/43B4EpZwin4E0
         MAdAgS/oeEH9xL0PmVHpZfTu5N75LduQCMmkqWn67v0edZ0XupC47R//w2GKhv6ljOCL
         GbGnYQHSI3BiqXwINULHC8EvnwiQ3eq9rtdGSFdKinErQpOQXbDJQf6EIm7g/5WB6jV9
         u+O8vRaubmaNGqsGndHqdUwO92pEUPOuBjNu3Ixl285oZfdvyn0IjnvJRdrrol/UvCdV
         JkVw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723467979; x=1724072779;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=q0MBRxvJH0y/bIJK1xHx6k1kVCY+2jxCQ2h5fP5Rdc8=;
        b=QqoDyUrvP9EyhBllF8r1f93zBu7EQzcivIYyK99b27ormNHML3VpWggUHZFpyNDh6O
         0Uv1+Nnw7YwnrOG78vrQfHrCwR4c6FHxCEsbwbFLTN2mE5uIMGUTg1fQ1PaXcm2rQsxz
         k6uWjl7eA/rtyxj6lGGqf+eBsdfGd+jT/lGDtVnQ5bblRKY+DfLbxI+oUAPfcaYsH6RJ
         MyGQACieT30ihehkC6NB/gfAmWkJmoOdsrEgzUwbY00QJ5kEDmVYyd80AfVqDRV+xP3b
         4nxoW/Sc1OduIYdm+GqNcLnDpefIA1l7uOSpxuhyqjglmCiFZRcQQQsJeH2W+AaHzhaF
         l/PA==
X-Forwarded-Encrypted: i=1; AJvYcCWvrjgqXW7zljo37Z6UEFQG4YcLHmo+BKL1kmA2H1BFXPSD12MYRiWy4P5tBOxFh0CMwU7WvelacI8Jhg5tB+stkqy7WLYe3blXhBUrAYY=
X-Gm-Message-State: AOJu0YztDRvWzIf8/X4HDnsJQNSclQoOPYpoV/FweqKqNgY/t/Ly+yqZ
	UgklCnNrDRKjMn3ONo9RLOVmMBIA8TN3s/EWTEOOnGe+kUGGh1pZ
X-Google-Smtp-Source: AGHT+IFl4ehD3FYz4UFHWYeyrWigmFf76jU/CdxDFMCU8WOzXI0nnlPyTlTXorwYYcOTf9CmvnlIAA==
X-Received: by 2002:a2e:8e6e:0:b0:2ef:2b45:b71d with SMTP id 38308e7fff4ca-2f2b7154f70mr1527581fa.24.1723467978593;
        Mon, 12 Aug 2024 06:06:18 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	qemu-arm@nongnu.org
Subject: [PATCH v1 02/10] hw/arm: xenpvh: Update file header to use SPDX
Date: Mon, 12 Aug 2024 15:05:57 +0200
Message-ID: <20240812130606.90410-3-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240812130606.90410-1-edgar.iglesias@gmail.com>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Update file header to use SPDX and remove stray empty
comment line.

No functional changes.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 hw/arm/xen_arm.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
index 6fad829ede..766a194fa1 100644
--- a/hw/arm/xen_arm.c
+++ b/hw/arm/xen_arm.c
@@ -1,24 +1,7 @@
 /*
  * QEMU ARM Xen PVH Machine
  *
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the 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 DEALINGS IN
- * THE SOFTWARE.
+ * SPDX-License-Identifier: MIT
  */
 
 #include "qemu/osdep.h"
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 12 13:06:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 13:06:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775490.1185719 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkh-0007jY-NM; Mon, 12 Aug 2024 13:06:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775490.1185719; Mon, 12 Aug 2024 13:06:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkh-0007iZ-Hv; Mon, 12 Aug 2024 13:06:23 +0000
Received: by outflank-mailman (input) for mailman id 775490;
 Mon, 12 Aug 2024 13:06:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=FAji=PL=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sdUkg-00074b-6o
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 13:06:22 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id abd74066-58ab-11ef-bc05-fd08da9f4363;
 Mon, 12 Aug 2024 15:06:21 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-52f042c15e3so3631306e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 06:06:21 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-53200f4227csm730447e87.279.2024.08.12.06.06.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 12 Aug 2024 06:06:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: abd74066-58ab-11ef-bc05-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723467981; x=1724072781; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=kOLz6jSGUU8Xiq4wmRd5lgikGGH6JiIyvQ0oMaht6JA=;
        b=RXc/ZrfYte0uKHALdoE6QbgS6W8b9qdxmnWl4+PjFaIKMaRjUH8dl82toTaJeYfor/
         ZmBDYHP3mwGz0xxVCcXuTbh02escqGLxXEqZrRU2kAsOTuQDqLG4eVlCv/VHFIubq3BV
         rXlBGkZA0Gc0tvXeXfLlsafNEro/+2XAxyl91LRjAow8kJ8NQ+zfGzx5VkcILjXxc52U
         h+ltwf1eB+PjYq0SAxuhjoFnF0V9Rx5rk0STknLi7J1NVcQW/qTXExEWIsDw9jmnK7H2
         ZAWsKkALQxcWbwBHH8PUN/eFvm9i1LrhMVNWAdYvP3wBa/kcSf5JxgRAYQpKyoNk+Wu3
         ugcg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723467981; x=1724072781;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=kOLz6jSGUU8Xiq4wmRd5lgikGGH6JiIyvQ0oMaht6JA=;
        b=akjC+NKpOyjnuJH4dXxBWfOTjTRhqsBvptaqLOb2lcjxcAzhAfQVPO5yfhdQTgP3o7
         nKtfd7DgqdpmQjKe/Q9dUwgKVOuU3iVFRSIIjOLrpS8zXeg16xT83XxirR1sS/5BLyv+
         Vg4YOOVSefGc3dFmFw1V650XYxIi5pQzIfRNzp6azHqAuTWp3lxQRZMrSsuoQ0xMdGVl
         oSFWCy0vV/woZ5HZW76S4YyaCjGqjRMbntq+l7tockdEiAgHCQOTG0PGywKKxAnOOM8v
         NuWc0w4Ol8LCWEjnIG/EFOaLLEJ2mVdKkwOohZQ5fc7JkvYL/W8spHVuG9vH62R7bvAc
         u7iw==
X-Forwarded-Encrypted: i=1; AJvYcCUp585U+anvsYLPdfaUcizgcUNNm/trhWMVFIsXkJRGoPSFksBS9YNruVrIDz/iLaCvtfymEcWeTPI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyUItlUQOQMDfkA9LqvdqKEHbel1pDLS4Av4ecm3VINuTgmum4o
	lUVDgoLYEKJ+3lGO8fIo5uNEDcXUSvxJXx+69yGrpZpFVqSZUP49
X-Google-Smtp-Source: AGHT+IFVFpgUsSJvoRktx9P5RahE3NL+hK1oSSRb0VxLTivi6mQbcvmAYVxkizJenzqOQTjrR9idAw==
X-Received: by 2002:a05:6512:4020:b0:531:5b03:b1f7 with SMTP id 2adb3069b0e04-5321367c4ecmr11696e87.10.1723467980688;
        Mon, 12 Aug 2024 06:06:20 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	qemu-arm@nongnu.org
Subject: [PATCH v1 03/10] hw/arm: xenpvh: Tweak machine description
Date: Mon, 12 Aug 2024 15:05:58 +0200
Message-ID: <20240812130606.90410-4-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240812130606.90410-1-edgar.iglesias@gmail.com>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Tweak machine description to better express that this is
a Xen PVH machine for ARM.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 hw/arm/xen_arm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
index 766a194fa1..5f75cc3779 100644
--- a/hw/arm/xen_arm.c
+++ b/hw/arm/xen_arm.c
@@ -216,7 +216,7 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
 {
 
     MachineClass *mc = MACHINE_CLASS(oc);
-    mc->desc = "Xen Para-virtualized PC";
+    mc->desc = "Xen PVH ARM machine";
     mc->init = xen_arm_init;
     mc->max_cpus = 1;
     mc->default_machine_opts = "accel=xen";
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 12 13:06:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 13:06:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775491.1185734 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkj-0008Fg-2k; Mon, 12 Aug 2024 13:06:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775491.1185734; Mon, 12 Aug 2024 13:06:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUki-0008EF-T0; Mon, 12 Aug 2024 13:06:24 +0000
Received: by outflank-mailman (input) for mailman id 775491;
 Mon, 12 Aug 2024 13:06:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=FAji=PL=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sdUkh-00074b-A5
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 13:06:23 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ac6bf2df-58ab-11ef-bc05-fd08da9f4363;
 Mon, 12 Aug 2024 15:06:22 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-52f025bc147so4940312e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 06:06:22 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-53200f42164sm727333e87.256.2024.08.12.06.06.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 12 Aug 2024 06:06:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ac6bf2df-58ab-11ef-bc05-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723467982; x=1724072782; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=xwk/c9fy7uMLWpwC3gxJL5qXeUXnd09Co6O9sN+JUhY=;
        b=EPRh7bPHpCtQWDUPLeqHCBhpJ52JHLw6aAH/j15phCMC7ROV1Aq4nh1xc47UfH05ZQ
         zIw8rnIa+PE26tdEgPhGncjosn1IRsTC4mJhTRkaww7uUkeU7Z+HwyhaOmReVuomWM4z
         VlS095k+6RUg1+jy9J5gz50AOFQHRjqlKcFgo4zRfMBfwCBTbUpoFu/k/6iaRZXQ3EXk
         8qxNNR/Rnim0gnueC4Vn/kZiSfJutAxLzy0fQZ9yybMVlNbr223nGC1YlrlOXciKOoz1
         JTTxhNziHFRdSIS9X4E8T6Kal5ZAXlaq8WgbEx0TQcopEaPMxjzaH9sak0BLrZfaKgDv
         GRBA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723467982; x=1724072782;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=xwk/c9fy7uMLWpwC3gxJL5qXeUXnd09Co6O9sN+JUhY=;
        b=ccHoqxbAmpnrNDQdSeaakV0iJ6DUv6/vrHhrhSuagmM1eYT40L1efh9xp8cb/VdXRW
         QEhBmgomxwdmz41+uk/FwxtaI8FTnE0loJh1BiwdCviAJSISWXdBSZ/fLM9RWcZ+athH
         UrBCQK1I2kYfWeGsVSFG5P3XDMU+y0aBxVs7aZZzJ6eMlXRAHk6xybKl9nDKtMs+xjre
         iUrh7raOpxRjuYidheeDuYNANHQMl79FU4IpocmcdNIoeF5SrFuqYXmzUQuuakR/N4KG
         eUQNs39ZozHUFyrzK7krGQZc2F3/VVtBWifsY9kS1S3iRVuXcioUiziOQeJJ3rwh7BOS
         NCfg==
X-Forwarded-Encrypted: i=1; AJvYcCX9pfpLTzcHmcuv90mId2qZ+xxu93vGxHMhHd59yHgKWn24Z8jKcxMxeKVqj7FSr/LKMOScj3HAr8b/OUkpo1B5DAXr1DTRMJs2HnN/5Gs=
X-Gm-Message-State: AOJu0YziOSpNYe9Fcbb54xGPCqMhBO4B4bTfkwoK8eFZBcrkE5fR8ItA
	j4LmFaAsyFRwH7HaWZVEz9C+l14aK24w+2WDRe7GOjcvjqzdgrYQPe1f75fd
X-Google-Smtp-Source: AGHT+IFqodcbXvvGQbYAmgjAlCjjHyzPPhL/5h6u/IlGoF6PnqI7PI9+Ax4L4kxnxBVCA+PqtUfB/w==
X-Received: by 2002:a05:6512:10d1:b0:52e:76e8:e18e with SMTP id 2adb3069b0e04-5321364a598mr46079e87.7.1723467981708;
        Mon, 12 Aug 2024 06:06:21 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	qemu-arm@nongnu.org
Subject: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests
Date: Mon, 12 Aug 2024 15:05:59 +0200
Message-ID: <20240812130606.90410-5-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240812130606.90410-1-edgar.iglesias@gmail.com>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Add SMP support for Xen PVH ARM guests. Create max_cpus ioreq
servers to handle hotplug.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 hw/arm/xen_arm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
index 5f75cc3779..ef8315969c 100644
--- a/hw/arm/xen_arm.c
+++ b/hw/arm/xen_arm.c
@@ -173,7 +173,7 @@ static void xen_arm_init(MachineState *machine)
 
     xen_init_ram(machine);
 
-    xen_register_ioreq(xam->state, machine->smp.cpus, &xen_memory_listener);
+    xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener);
 
     xen_create_virtio_mmio_devices(xam);
 
@@ -218,7 +218,8 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
     MachineClass *mc = MACHINE_CLASS(oc);
     mc->desc = "Xen PVH ARM machine";
     mc->init = xen_arm_init;
-    mc->max_cpus = 1;
+    /* MAX number of vcpus supported by Xen.  */
+    mc->max_cpus = GUEST_MAX_VCPUS;
     mc->default_machine_opts = "accel=xen";
     /* Set explicitly here to make sure that real ram_size is passed */
     mc->default_ram_size = 0;
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 12 13:06:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 13:06:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775493.1185744 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkm-0000DQ-9I; Mon, 12 Aug 2024 13:06:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775493.1185744; Mon, 12 Aug 2024 13:06:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkm-0000CG-5Q; Mon, 12 Aug 2024 13:06:28 +0000
Received: by outflank-mailman (input) for mailman id 775493;
 Mon, 12 Aug 2024 13:06:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=FAji=PL=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sdUkk-00074b-GF
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 13:06:26 +0000
Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com
 [2a00:1450:4864:20::230])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ae0fe130-58ab-11ef-bc05-fd08da9f4363;
 Mon, 12 Aug 2024 15:06:25 +0200 (CEST)
Received: by mail-lj1-x230.google.com with SMTP id
 38308e7fff4ca-2f189a2a7f8so44356521fa.2
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 06:06:25 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f291dff990sm8301261fa.64.2024.08.12.06.06.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 12 Aug 2024 06:06:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ae0fe130-58ab-11ef-bc05-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723467985; x=1724072785; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=W/NQ+bDoiLffxrtbB/M0A1sRyjsF9bgHvteaiAPMvqQ=;
        b=V9rCi0Bx7d09sZMX0TUP7bBTeIxpjVzq8okmGchyI7DwqblFFWEKFo4L86+0sJCNTd
         WesmR2TN6fHt/UzwRy2OfaifTMGqhawOWYO0TIqNLamLyYotqbn4cq4FL2roRRSj8QXd
         OkrbKQ4qZwJAF0rJy+U0y+81stnBF2Mz+wmKRC60iB8z7/EmUG4u84pAa6KXQK/n80iA
         pjpgdCBJWAzqjzebwCfl5cXt9xYO3hkdK5NFtpzgLmXDJ4eoa3X+D+x5aKPnyVGvGPZt
         2EQATJG1+Lj+Xln6e/y4YzE8Xe107lRqaCPOGbmoDYtCD1vZuusnbdd1vfBQqjhZQUe6
         gNFQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723467985; x=1724072785;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=W/NQ+bDoiLffxrtbB/M0A1sRyjsF9bgHvteaiAPMvqQ=;
        b=kvjkOSvlREk4N865N3erEf3/EdFR78zR76qMaLLFmMINS9Bnp8vB3jejyVY0WVFPdx
         4UGbraNnEL0roTmOk+WYLi9AulGy7skgevJI1S6mfHEsV1V8HYy8U46WGjsRnmSNx8dR
         +mcAmdWiOQrbrNAEI2QZm4skWcm9BtLwI/vH33SBb2ieiKPKSaEI5timUPKPq3QtxOCm
         IaRhW8kV/zuQLriM4ghfKzKOKMQwK7GKkc0Bmu+xOBE95vNxZaz0pat/IfCIlP9SulL2
         /KTFTL6defNQVsULJDuzj11ZtkChjpO6Z2oB0x2ISzO4MCFCvRMuFj/wpVow1xQH9d1f
         Tj2A==
X-Forwarded-Encrypted: i=1; AJvYcCW8WfU1PiUDrAGNiakP8t4P+au2vLGWNwyYGFSocxosUdXZ+wdx9U+hldS8v+x6FUlx+HPysp90ozIHQhA/j/iRf0tf+soyiqJFomaxsLM=
X-Gm-Message-State: AOJu0Yw36H8bZQUovzjFha3RTvM9P7zOssSxe0/jWkhoUWkPRviPKnnk
	CYWKpit7RrlKs5EBj99z3A07V4nPQlbq0zVSMiaLfYiZUSDPCyMj
X-Google-Smtp-Source: AGHT+IF2RieUtGeR/iW9cWw+e/zdEKnbAONAmWuXU7OU5a81gT0ntNkasljwsAml/ALKofCfEA9e5A==
X-Received: by 2002:a2e:b1d2:0:b0:2f1:5561:4b4a with SMTP id 38308e7fff4ca-2f2b7155335mr1355051fa.25.1723467984300;
        Mon, 12 Aug 2024 06:06:24 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	qemu-arm@nongnu.org
Subject: [PATCH v1 05/10] hw/arm: xenpvh: Break out a common PVH module
Date: Mon, 12 Aug 2024 15:06:00 +0200
Message-ID: <20240812130606.90410-6-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240812130606.90410-1-edgar.iglesias@gmail.com>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Break out a common Xen PVH module in preparation for
adding a x86 Xen PVH Machine.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 hw/arm/trace-events             |   5 -
 hw/arm/xen_arm.c                | 154 ++++++--------------------
 hw/xen/meson.build              |   1 +
 hw/xen/trace-events             |   4 +
 hw/xen/xen-pvh-common.c         | 185 ++++++++++++++++++++++++++++++++
 include/hw/xen/xen-pvh-common.h |  45 ++++++++
 6 files changed, 269 insertions(+), 125 deletions(-)
 create mode 100644 hw/xen/xen-pvh-common.c
 create mode 100644 include/hw/xen/xen-pvh-common.h

diff --git a/hw/arm/trace-events b/hw/arm/trace-events
index be6c8f720b..c64ad344bd 100644
--- a/hw/arm/trace-events
+++ b/hw/arm/trace-events
@@ -68,10 +68,5 @@ z2_aer915_send_too_long(int8_t msg) "message too long (%i bytes)"
 z2_aer915_send(uint8_t reg, uint8_t value) "reg %d value 0x%02x"
 z2_aer915_event(int8_t event, int8_t len) "i2c event =0x%x len=%d bytes"
 
-# xen_arm.c
-xen_create_virtio_mmio_devices(int i, int irq, uint64_t base) "Created virtio-mmio device %d: irq %d base 0x%"PRIx64
-xen_init_ram(uint64_t machine_ram_size) "Initialized xen ram with size 0x%"PRIx64
-xen_enable_tpm(uint64_t addr) "Connected tpmdev at address 0x%"PRIx64
-
 # bcm2838.c
 bcm2838_gic_set_irq(int irq, int level) "gic irq:%d lvl:%d"
diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
index ef8315969c..b8a5c09bdf 100644
--- a/hw/arm/xen_arm.c
+++ b/hw/arm/xen_arm.c
@@ -12,40 +12,25 @@
 #include "hw/irq.h"
 #include "hw/sysbus.h"
 #include "sysemu/block-backend.h"
-#include "sysemu/tpm_backend.h"
 #include "sysemu/sysemu.h"
-#include "hw/xen/xen-hvm-common.h"
+#include "hw/xen/xen-pvh-common.h"
 #include "sysemu/tpm.h"
 #include "hw/xen/arch_hvm.h"
-#include "trace.h"
 
 #define TYPE_XEN_ARM  MACHINE_TYPE_NAME("xenpvh")
 OBJECT_DECLARE_SIMPLE_TYPE(XenArmState, XEN_ARM)
 
-static const MemoryListener xen_memory_listener = {
-    .region_add = xen_region_add,
-    .region_del = xen_region_del,
-    .log_start = NULL,
-    .log_stop = NULL,
-    .log_sync = NULL,
-    .log_global_start = NULL,
-    .log_global_stop = NULL,
-    .priority = MEMORY_LISTENER_PRIORITY_ACCEL,
-};
-
 struct XenArmState {
     /*< private >*/
     MachineState parent;
 
-    XenIOState *state;
+    XenPVHCommonState pvh;
 
     struct {
         uint64_t tpm_base_addr;
     } cfg;
 };
 
-static MemoryRegion ram_lo, ram_hi;
-
 /*
  * VIRTIO_MMIO_DEV_SIZE is imported from tools/libs/light/libxl_arm.c under Xen
  * repository.
@@ -57,64 +42,6 @@ static MemoryRegion ram_lo, ram_hi;
 #define NR_VIRTIO_MMIO_DEVICES   \
    (GUEST_VIRTIO_MMIO_SPI_LAST - GUEST_VIRTIO_MMIO_SPI_FIRST)
 
-static void xen_set_irq(void *opaque, int irq, int level)
-{
-    if (xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level)) {
-        error_report("xendevicemodel_set_irq_level failed");
-    }
-}
-
-static void xen_create_virtio_mmio_devices(XenArmState *xam)
-{
-    int i;
-
-    for (i = 0; i < NR_VIRTIO_MMIO_DEVICES; i++) {
-        hwaddr base = GUEST_VIRTIO_MMIO_BASE + i * VIRTIO_MMIO_DEV_SIZE;
-        qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL,
-                                         GUEST_VIRTIO_MMIO_SPI_FIRST + i);
-
-        sysbus_create_simple("virtio-mmio", base, irq);
-
-        trace_xen_create_virtio_mmio_devices(i,
-                                             GUEST_VIRTIO_MMIO_SPI_FIRST + i,
-                                             base);
-    }
-}
-
-static void xen_init_ram(MachineState *machine)
-{
-    MemoryRegion *sysmem = get_system_memory();
-    ram_addr_t block_len, ram_size[GUEST_RAM_BANKS];
-
-    trace_xen_init_ram(machine->ram_size);
-    if (machine->ram_size <= GUEST_RAM0_SIZE) {
-        ram_size[0] = machine->ram_size;
-        ram_size[1] = 0;
-        block_len = GUEST_RAM0_BASE + ram_size[0];
-    } else {
-        ram_size[0] = GUEST_RAM0_SIZE;
-        ram_size[1] = machine->ram_size - GUEST_RAM0_SIZE;
-        block_len = GUEST_RAM1_BASE + ram_size[1];
-    }
-
-    memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len,
-                           &error_fatal);
-
-    memory_region_init_alias(&ram_lo, NULL, "xen.ram.lo", &xen_memory,
-                             GUEST_RAM0_BASE, ram_size[0]);
-    memory_region_add_subregion(sysmem, GUEST_RAM0_BASE, &ram_lo);
-    if (ram_size[1] > 0) {
-        memory_region_init_alias(&ram_hi, NULL, "xen.ram.hi", &xen_memory,
-                                 GUEST_RAM1_BASE, ram_size[1]);
-        memory_region_add_subregion(sysmem, GUEST_RAM1_BASE, &ram_hi);
-    }
-
-    /* Setup support for grants.  */
-    memory_region_init_ram(&xen_grants, NULL, "xen.grants", block_len,
-                           &error_fatal);
-    memory_region_add_subregion(sysmem, XEN_GRANT_ADDR_OFF, &xen_grants);
-}
-
 void arch_handle_ioreq(XenIOState *state, ioreq_t *req)
 {
     hw_error("Invalid ioreq type 0x%x\n", req->type);
@@ -135,55 +62,42 @@ void qmp_xen_set_global_dirty_log(bool enable, Error **errp)
 {
 }
 
-#ifdef CONFIG_TPM
-static void xen_enable_tpm(XenArmState *xam)
-{
-    Error *errp = NULL;
-    DeviceState *dev;
-    SysBusDevice *busdev;
-
-    TPMBackend *be = qemu_find_tpm_be("tpm0");
-    if (be == NULL) {
-        error_report("Couldn't find tmp0 backend");
-        return;
-    }
-    dev = qdev_new(TYPE_TPM_TIS_SYSBUS);
-    object_property_set_link(OBJECT(dev), "tpmdev", OBJECT(be), &errp);
-    object_property_set_str(OBJECT(dev), "tpmdev", be->id, &errp);
-    busdev = SYS_BUS_DEVICE(dev);
-    sysbus_realize_and_unref(busdev, &error_fatal);
-    sysbus_mmio_map(busdev, 0, xam->cfg.tpm_base_addr);
-
-    trace_xen_enable_tpm(xam->cfg.tpm_base_addr);
-}
-#endif
-
-static void xen_arm_init(MachineState *machine)
+static void xen_arm_init(MachineState *ms)
 {
-    XenArmState *xam = XEN_ARM(machine);
-
-    xam->state =  g_new0(XenIOState, 1);
+    XenArmState *xam = XEN_ARM(ms);
+    const struct {
+        const char *name;
+        MemMapEntry map;
+    } map[] = {
+        { "ram-low", { GUEST_RAM0_BASE, GUEST_RAM0_SIZE } },
+        { "ram-high", { GUEST_RAM1_BASE, GUEST_RAM1_SIZE } },
+        { "virtio-mmio", { GUEST_VIRTIO_MMIO_BASE, VIRTIO_MMIO_DEV_SIZE } },
+        { "tpm", { xam->cfg.tpm_base_addr, 0x1000 } },
+    };
+    int i;
 
-    if (machine->ram_size == 0) {
-        warn_report("%s non-zero ram size not specified. QEMU machine started"
-                    " without IOREQ (no emulated devices including virtio)",
-                    MACHINE_CLASS(object_get_class(OBJECT(machine)))->desc);
-        return;
+    object_initialize_child(OBJECT(ms), "pvh", &xam->pvh, TYPE_XEN_PVH_COMMON);
+
+    object_property_set_int(OBJECT(&xam->pvh), "max-cpus", ms->smp.max_cpus,
+                            &error_abort);
+    object_property_set_int(OBJECT(&xam->pvh), "ram-size", ms->ram_size,
+                            &error_abort);
+    object_property_set_int(OBJECT(&xam->pvh), "virtio-mmio-num",
+                            NR_VIRTIO_MMIO_DEVICES, &error_abort);
+    object_property_set_int(OBJECT(&xam->pvh), "virtio-mmio-irq-base",
+                            GUEST_VIRTIO_MMIO_SPI_FIRST, &error_abort);
+
+    for (i = 0; i < ARRAY_SIZE(map); i++) {
+        g_autofree char *base_name = g_strdup_printf("%s-base", map[i].name);
+        g_autofree char *size_name = g_strdup_printf("%s-size", map[i].name);
+
+        object_property_set_int(OBJECT(&xam->pvh), base_name, map[i].map.base,
+                                &error_abort);
+        object_property_set_int(OBJECT(&xam->pvh), size_name, map[i].map.size,
+                                &error_abort);
     }
 
-    xen_init_ram(machine);
-
-    xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener);
-
-    xen_create_virtio_mmio_devices(xam);
-
-#ifdef CONFIG_TPM
-    if (xam->cfg.tpm_base_addr) {
-        xen_enable_tpm(xam);
-    } else {
-        warn_report("tpm-base-addr is not provided. TPM will not be enabled");
-    }
-#endif
+    sysbus_realize(SYS_BUS_DEVICE(&xam->pvh), &error_abort);
 }
 
 #ifdef CONFIG_TPM
diff --git a/hw/xen/meson.build b/hw/xen/meson.build
index d887fa9ba4..4a486e3673 100644
--- a/hw/xen/meson.build
+++ b/hw/xen/meson.build
@@ -15,6 +15,7 @@ xen_specific_ss = ss.source_set()
 xen_specific_ss.add(files(
   'xen-mapcache.c',
   'xen-hvm-common.c',
+  'xen-pvh-common.c',
 ))
 if have_xen_pci_passthrough
   xen_specific_ss.add(files(
diff --git a/hw/xen/trace-events b/hw/xen/trace-events
index d1b27f6c11..a07fe41c6d 100644
--- a/hw/xen/trace-events
+++ b/hw/xen/trace-events
@@ -64,6 +64,10 @@ destroy_hvm_domain_cannot_acquire_handle(void) "Cannot acquire xenctrl handle"
 destroy_hvm_domain_failed_action(const char *action, int sts, char *errno_s) "xc_domain_shutdown failed to issue %s, sts %d, %s"
 destroy_hvm_domain_action(int xen_domid, const char *action) "Issued domain %d %s"
 
+# xen-pvh-common.c
+xen_create_virtio_mmio_devices(int i, int irq, uint64_t base) "Created virtio-mmio device %d: irq %d base 0x%"PRIx64
+xen_enable_tpm(uint64_t addr) "Connected tpmdev at address 0x%"PRIx64
+
 # xen-mapcache.c
 xen_map_cache(uint64_t phys_addr) "want 0x%"PRIx64
 xen_remap_bucket(uint64_t index) "index 0x%"PRIx64
diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
new file mode 100644
index 0000000000..0d368398d0
--- /dev/null
+++ b/hw/xen/xen-pvh-common.c
@@ -0,0 +1,185 @@
+/*
+ * Common Xen PVH code.
+ *
+ * Copyright (c) 2024 Advanced Micro Devices, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/error-report.h"
+#include "qapi/error.h"
+#include "hw/boards.h"
+#include "hw/irq.h"
+#include "hw/sysbus.h"
+#include "sysemu/sysemu.h"
+#include "sysemu/tpm.h"
+#include "sysemu/tpm_backend.h"
+#include "hw/xen/xen-pvh-common.h"
+#include "trace.h"
+
+static const MemoryListener xen_memory_listener = {
+    .region_add = xen_region_add,
+    .region_del = xen_region_del,
+    .log_start = NULL,
+    .log_stop = NULL,
+    .log_sync = NULL,
+    .log_global_start = NULL,
+    .log_global_stop = NULL,
+    .priority = MEMORY_LISTENER_PRIORITY_ACCEL,
+};
+
+static void xen_pvh_init_ram(XenPVHCommonState *s,
+                             MemoryRegion *sysmem)
+{
+    ram_addr_t block_len, ram_size[2];
+
+    if (s->cfg.ram_size <= s->cfg.ram_low.size) {
+        ram_size[0] = s->cfg.ram_size;
+        ram_size[1] = 0;
+        block_len = s->cfg.ram_low.base + ram_size[0];
+    } else {
+        ram_size[0] = s->cfg.ram_low.size;
+        ram_size[1] = s->cfg.ram_size - s->cfg.ram_low.size;
+        block_len = s->cfg.ram_high.base + ram_size[1];
+    }
+
+    memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len,
+                           &error_fatal);
+
+    memory_region_init_alias(&s->ram.low, NULL, "xen.ram.lo", &xen_memory,
+                             s->cfg.ram_low.base, ram_size[0]);
+    memory_region_add_subregion(sysmem, s->cfg.ram_low.base, &s->ram.low);
+    if (ram_size[1] > 0) {
+        memory_region_init_alias(&s->ram.high, NULL, "xen.ram.hi", &xen_memory,
+                                 s->cfg.ram_high.base, ram_size[1]);
+        memory_region_add_subregion(sysmem, s->cfg.ram_high.base, &s->ram.high);
+    }
+
+    /* Setup support for grants.  */
+    memory_region_init_ram(&xen_grants, NULL, "xen.grants", block_len,
+                           &error_fatal);
+    memory_region_add_subregion(sysmem, XEN_GRANT_ADDR_OFF, &xen_grants);
+}
+
+static void xen_set_irq(void *opaque, int irq, int level)
+{
+    if (xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level)) {
+        error_report("xendevicemodel_set_irq_level failed");
+    }
+}
+
+static void xen_create_virtio_mmio_devices(XenPVHCommonState *s)
+{
+    int i;
+
+    for (i = 0; i < s->cfg.virtio_mmio_num; i++) {
+        hwaddr base = s->cfg.virtio_mmio.base + i * s->cfg.virtio_mmio.size;
+        qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL,
+                                         s->cfg.virtio_mmio_irq_base + i);
+
+        sysbus_create_simple("virtio-mmio", base, irq);
+
+        trace_xen_create_virtio_mmio_devices(i,
+                                             s->cfg.virtio_mmio_irq_base + i,
+                                             base);
+    }
+}
+
+#ifdef CONFIG_TPM
+static void xen_enable_tpm(XenPVHCommonState *s)
+{
+    Error *errp = NULL;
+    DeviceState *dev;
+    SysBusDevice *busdev;
+
+    TPMBackend *be = qemu_find_tpm_be("tpm0");
+    if (be == NULL) {
+        error_report("Couldn't find tmp0 backend");
+        return;
+    }
+    dev = qdev_new(TYPE_TPM_TIS_SYSBUS);
+    object_property_set_link(OBJECT(dev), "tpmdev", OBJECT(be), &errp);
+    object_property_set_str(OBJECT(dev), "tpmdev", be->id, &errp);
+    busdev = SYS_BUS_DEVICE(dev);
+    sysbus_realize_and_unref(busdev, &error_fatal);
+    sysbus_mmio_map(busdev, 0, s->cfg.tpm.base);
+
+    trace_xen_enable_tpm(s->cfg.tpm.base);
+}
+#endif
+
+static void xen_pvh_realize(DeviceState *dev, Error **errp)
+{
+    XenPVHCommonState *s = XEN_PVH_COMMON(dev);
+    MemoryRegion *sysmem = get_system_memory();
+
+    if (s->cfg.ram_size == 0) {
+        /* FIXME: Prefix with object path and consider bailing out.  */
+        warn_report("non-zero ram size not specified. QEMU machine started"
+                    " without IOREQ (no emulated devices including virtio)");
+        return;
+    }
+
+    if (s->cfg.max_cpus == 0) {
+        /* FIXME: Prefix with object path and bail out.  */
+        warn_report("max-cpus not specified. QEMU machine started");
+        return;
+    }
+
+    xen_pvh_init_ram(s, sysmem);
+    xen_register_ioreq(&s->ioreq, s->cfg.max_cpus, &xen_memory_listener);
+
+    if (s->cfg.virtio_mmio_num) {
+        xen_create_virtio_mmio_devices(s);
+    }
+
+#ifdef CONFIG_TPM
+    if (s->cfg.tpm.base) {
+        xen_enable_tpm(s);
+    } else {
+        warn_report("tpm-base-addr is not provided. TPM will not be enabled");
+    }
+#endif
+}
+
+#define DEFINE_PROP_MEMMAP(n, f) \
+    DEFINE_PROP_UINT64(n "-base", XenPVHCommonState, cfg.f.base, 0), \
+    DEFINE_PROP_UINT64(n "-size", XenPVHCommonState, cfg.f.size, 0)
+
+static Property xen_pvh_properties[] = {
+    DEFINE_PROP_UINT32("max-cpus", XenPVHCommonState, cfg.max_cpus, 0),
+    DEFINE_PROP_UINT64("ram-size", XenPVHCommonState, cfg.ram_size, 0),
+    DEFINE_PROP_MEMMAP("ram-low", ram_low),
+    DEFINE_PROP_MEMMAP("ram-high", ram_high),
+    DEFINE_PROP_MEMMAP("virtio-mmio", virtio_mmio),
+    DEFINE_PROP_MEMMAP("tpm", tpm),
+    DEFINE_PROP_UINT32("virtio-mmio-num", XenPVHCommonState,
+                       cfg.virtio_mmio_num, 0),
+    DEFINE_PROP_UINT32("virtio-mmio-irq-base", XenPVHCommonState,
+                       cfg.virtio_mmio_irq_base, 0),
+    DEFINE_PROP_END_OF_LIST()
+};
+
+static void xen_pvh_class_init(ObjectClass *klass, void *data)
+{
+    DeviceClass *dc = DEVICE_CLASS(klass);
+
+    dc->realize = xen_pvh_realize;
+    device_class_set_props(dc, xen_pvh_properties);
+    /* No VMSD since we haven't got any top-level SoC state to save.  */
+}
+
+static const TypeInfo xen_pvh_info = {
+    .name = TYPE_XEN_PVH_COMMON,
+    .parent = TYPE_SYS_BUS_DEVICE,
+    .instance_size = sizeof(XenPVHCommonState),
+    .class_init = xen_pvh_class_init,
+};
+
+static void xen_pvh_register_types(void)
+{
+    type_register_static(&xen_pvh_info);
+}
+
+type_init(xen_pvh_register_types);
diff --git a/include/hw/xen/xen-pvh-common.h b/include/hw/xen/xen-pvh-common.h
new file mode 100644
index 0000000000..e958b441fd
--- /dev/null
+++ b/include/hw/xen/xen-pvh-common.h
@@ -0,0 +1,45 @@
+/*
+ * QEMU Xen PVH machine - common code.
+ *
+ * Copyright (c) 2024 Advanced Micro Devices, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef XEN_PVH_COMMON_H__
+#define XEN_PVH_COMMON_H__
+
+#include <assert.h>
+#include "hw/sysbus.h"
+#include "hw/hw.h"
+#include "hw/xen/xen-hvm-common.h"
+#include "hw/pci-host/gpex.h"
+
+#define TYPE_XEN_PVH_COMMON "xen-pvh-common"
+OBJECT_DECLARE_SIMPLE_TYPE(XenPVHCommonState, XEN_PVH_COMMON)
+
+typedef struct XenPVHCommonState {
+    /*< private >*/
+    SysBusDevice parent_obj;
+
+    XenIOState ioreq;
+
+    struct {
+        MemoryRegion low;
+        MemoryRegion high;
+    } ram;
+
+    struct {
+        uint64_t ram_size;
+        uint32_t max_cpus;
+        uint32_t virtio_mmio_num;
+        uint32_t virtio_mmio_irq_base;
+        struct {
+            uint64_t base;
+            uint64_t size;
+        } ram_low, ram_high,
+          virtio_mmio,
+          tpm;
+    } cfg;
+} XenPVHCommonState;
+#endif
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 12 13:06:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 13:06:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775494.1185751 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkm-0000Mu-UZ; Mon, 12 Aug 2024 13:06:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775494.1185751; Mon, 12 Aug 2024 13:06:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkm-0000Lj-Oq; Mon, 12 Aug 2024 13:06:28 +0000
Received: by outflank-mailman (input) for mailman id 775494;
 Mon, 12 Aug 2024 13:06:28 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=FAji=PL=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sdUkm-0007ep-0w
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 13:06:28 +0000
Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com
 [2a00:1450:4864:20::233])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ae9f98bd-58ab-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 15:06:26 +0200 (CEST)
Received: by mail-lj1-x233.google.com with SMTP id
 38308e7fff4ca-2f032cb782dso44563071fa.3
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 06:06:26 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f2920525b7sm8607681fa.121.2024.08.12.06.06.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 12 Aug 2024 06:06:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ae9f98bd-58ab-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723467986; x=1724072786; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=KTEAe/pOjkrnvyxDHYihrpK7ln2+IQNSmZ/kBKccldI=;
        b=YIJPUU+llteL1oe/FljqFPaEXYBiwC49LeEZpNYAIEsH99ky4mJG71ovQtl2SsZvsK
         Mf6T+eBXJn5M/st9wuDWspG0Yr+qeaNGZS0eJJ+Miu/NzvnGZcE3jvkVDn33UX/wcc6s
         ybADnCmTXanpJggDmha4Z5ZQZFKjfOUJImayeYH8XN/PEgzO2m3hPzuVVYFolYphwkpR
         ChgAINNdEleQxvMM2M1/I2k9W3dYVuAIH9AQlfVbSEf43Z+UXXS6gzUIbg7ThmmBNynW
         zQXOIDrUOydxBLkzqkWCdKIzXREr0bNIMBHpu2wpVh50BTthMQ5xQY20CdH5Ur1+WhAX
         8OgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723467986; x=1724072786;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=KTEAe/pOjkrnvyxDHYihrpK7ln2+IQNSmZ/kBKccldI=;
        b=m7iIqi34MFikXaVSfKbZqlosRyxteFroOTHb55s4eFWm7yEMMMuhGaDVaXs3lnFVr5
         00EBWOfyqD2ciSz7W2jVESoFi0eUQuY6onBIfd/843DVl5+WEjW/hMD6+GHQjmv90ZkK
         YFqk96JzBs1VQhzpvBCxiIFdMEDU/vpF5MV5dKdp6SvBnsGpndAIxyyz1Ym6q9nJfpzH
         50C/F7tBUIuCXtlde5aKNsJZS1L1xYeqXSLO0jGugvgVuzUvFu9Q5Lf8om4x1ARgDKAf
         FfTbxx8JLAYpm0vzHnZ6l6ncmdnjvfXxBGhT0X1nKsr/TCc7kFMoxI+iXN840Y+HglKI
         xamQ==
X-Forwarded-Encrypted: i=1; AJvYcCWMAz4Hb5hcOHKoG92J1dUcG+s2U2lF5NXahY58WjYOv79Nimg6ePLEtJFxvYiUfaXkuNxTrBEb2iegJZGtn4AwHAkO7Jc7e4g2RW4OjGI=
X-Gm-Message-State: AOJu0Yww43ZHRMBQHejVHYz1NEblRaE9sK0Bsku9w2jf/t4wCVOUmSjF
	rs1pJf+LKz/rWGbWgDe5RxeF+M0IE2tDwGzmqrt8S5V4NMcyVLZi
X-Google-Smtp-Source: AGHT+IH0EXdKyQvoxf37ygreO5y2jLBKuw9Hze8ISbhMj2e1iAgBShVHSABDPv6QJ/gpCgSqjwyxEQ==
X-Received: by 2002:a05:651c:507:b0:2ef:2c86:4d43 with SMTP id 38308e7fff4ca-2f2b714656amr1654731fa.3.1723467985346;
        Mon, 12 Aug 2024 06:06:25 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	qemu-arm@nongnu.org
Subject: [PATCH v1 06/10] hw/arm: xenpvh: Rename xen_arm.c -> xen-pvh.c
Date: Mon, 12 Aug 2024 15:06:01 +0200
Message-ID: <20240812130606.90410-7-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240812130606.90410-1-edgar.iglesias@gmail.com>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Rename xen_arm.c -> xen-pvh.c to better express that this
is a PVH machine and to align with x86 HVM and future PVH
machine filenames:
hw/i386/xen/xen-hvm.c
hw/i386/xen/xen-pvh.c (in preparation)

No functional changes.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 hw/arm/meson.build              | 2 +-
 hw/arm/{xen_arm.c => xen-pvh.c} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename hw/arm/{xen_arm.c => xen-pvh.c} (100%)

diff --git a/hw/arm/meson.build b/hw/arm/meson.build
index 0c07ab522f..769fe9ec1a 100644
--- a/hw/arm/meson.build
+++ b/hw/arm/meson.build
@@ -59,7 +59,7 @@ arm_ss.add(when: 'CONFIG_FSL_IMX7', if_true: files('fsl-imx7.c', 'mcimx7d-sabre.
 arm_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmuv3.c'))
 arm_ss.add(when: 'CONFIG_FSL_IMX6UL', if_true: files('fsl-imx6ul.c', 'mcimx6ul-evk.c'))
 arm_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_soc.c'))
-arm_ss.add(when: 'CONFIG_XEN', if_true: files('xen_arm.c'))
+arm_ss.add(when: 'CONFIG_XEN', if_true: files('xen-pvh.c'))
 
 system_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmu-common.c'))
 system_ss.add(when: 'CONFIG_CHEETAH', if_true: files('palm.c'))
diff --git a/hw/arm/xen_arm.c b/hw/arm/xen-pvh.c
similarity index 100%
rename from hw/arm/xen_arm.c
rename to hw/arm/xen-pvh.c
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 12 13:06:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 13:06:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775495.1185764 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkq-0000uz-CO; Mon, 12 Aug 2024 13:06:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775495.1185764; Mon, 12 Aug 2024 13:06:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkq-0000uh-4u; Mon, 12 Aug 2024 13:06:32 +0000
Received: by outflank-mailman (input) for mailman id 775495;
 Mon, 12 Aug 2024 13:06:30 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=FAji=PL=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sdUko-0007ep-St
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 13:06:30 +0000
Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com
 [2a00:1450:4864:20::22a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b0432a9c-58ab-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 15:06:29 +0200 (CEST)
Received: by mail-lj1-x22a.google.com with SMTP id
 38308e7fff4ca-2ef2d96164aso46452721fa.3
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 06:06:29 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-53200f1ac89sm734534e87.184.2024.08.12.06.06.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 12 Aug 2024 06:06:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b0432a9c-58ab-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723467989; x=1724072789; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Nhh0TpUXfvKDYo1bINWU88Yt0WNYvGv2suBFZ023AEo=;
        b=f4oioUWGILPFUlnvv002QkQz5v79f+efVXkV0vDSfW/dycdVphHWEOMEIss7s+bAcL
         tcdoemY0DyllfXWB5tB6v43MV8VsNDza1p0hnOXdnhkhrFjpq2oP9WIACUtOvQdWN8KW
         0xPPgx95CNTH+dzhw25lGDvJpuc2amxo1gTEfAPWpzm+wBQ5RdILQ05PU2CmibKlenbK
         FHeU3xNZwVyXQRzDIOZl/BtH19AB/9bLAV9q7qy54N17RNnGZLQBTbcvX0Yigd88YRfl
         LIX3G2xMpp6rWgXBFve/dNGSFVurD4GY3INKFuSk6LiQImCYiG+UoGmBI+Bnq/CP+A6e
         r5Ew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723467989; x=1724072789;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Nhh0TpUXfvKDYo1bINWU88Yt0WNYvGv2suBFZ023AEo=;
        b=O6IbwXecgwnSQXiszo9tBVvNqqQPE67UEyY1hSRstoC2h6ticKSlVdaYENSRleN4cH
         rhuNAShYxNzyXuuPG+cNcSsj5YGHl49HYqb5uBkbKrUotGEOe8Wm0o6lw9slKd09E0Rt
         N8Re0EPF6wVGyvQSWYnvsSk+2ZU7q1Xnzy6LHw8PLtMlw/37lCo70gRJ9QKpKo6QB1qg
         lHy/w92E1Le3VzKwn1r83VW6wFSnvkCHwBKlekNvIFmolMOb7ltsf62VwcHRlNpBm2h1
         owlzroQ/nHIzLkXTTFE0zZsIWmQs1RRcn2iI98b1dgdoog6/em11k7jN+x+ISI0viEv+
         dWCA==
X-Forwarded-Encrypted: i=1; AJvYcCWrQz7u7vXU7oOA6s4Aw3XiymoZOz7cZvjipESddFFDEK2zdTReKUvdK/ZOO36HIaiqBbh3m6bB6Zt18SLwK99Yt/2xEJu9gkRarvxXslk=
X-Gm-Message-State: AOJu0YxFSFBVA2Ugj8GaIxfi1wuBDrZ6m3Zr9DXjqAkDX1sVmtkrwJFT
	4vxBG6oCRx7eiNqhZHDGdM8LGh/iGtuKqpcOwntozPApWsbgeCb6
X-Google-Smtp-Source: AGHT+IHSkZQghDr6Glb8JEvdreF6qFC+N2jFtbTRBNglrKRLKqDk7xPj3u/onfFEY6yEqggs5c2vsg==
X-Received: by 2002:a05:6512:1296:b0:52c:dfa0:dca0 with SMTP id 2adb3069b0e04-53213693c31mr31960e87.43.1723467988154;
        Mon, 12 Aug 2024 06:06:28 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH v1 07/10] hw/arm: xenpvh: Reverse virtio-mmio creation order
Date: Mon, 12 Aug 2024 15:06:02 +0200
Message-ID: <20240812130606.90410-8-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240812130606.90410-1-edgar.iglesias@gmail.com>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

We've been creating the virtio-mmio devices in forwards order
but since the qbus lists prepend (rather than append) entries,
the virtio busses end up with decreasing base address order.

Xen enables virtio-mmio nodes in forwards order so there's been
a missmatch. So far, we've been working around this with an
out-of-tree patch to Xen.

This reverses the order making sure the virtio busses end up
ordered with increasing base addresses avoiding the need to
patch Xen.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 hw/xen/xen-pvh-common.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
index 0d368398d0..69a2dbdb6d 100644
--- a/hw/xen/xen-pvh-common.c
+++ b/hw/xen/xen-pvh-common.c
@@ -73,7 +73,18 @@ static void xen_create_virtio_mmio_devices(XenPVHCommonState *s)
 {
     int i;
 
-    for (i = 0; i < s->cfg.virtio_mmio_num; i++) {
+    /*
+     * We create the transports in reverse order. Since qbus_realize()
+     * prepends (not appends) new child buses, the decrementing loop below will
+     * create a list of virtio-mmio buses with increasing base addresses.
+     *
+     * When a -device option is processed from the command line,
+     * qbus_find_recursive() picks the next free virtio-mmio bus in forwards
+     * order.
+     *
+     * This is what the Xen tools expect.
+     */
+    for (i = s->cfg.virtio_mmio_num - 1; i >= 0; i--) {
         hwaddr base = s->cfg.virtio_mmio.base + i * s->cfg.virtio_mmio.size;
         qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL,
                                          s->cfg.virtio_mmio_irq_base + i);
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 12 13:06:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 13:06:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775497.1185773 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkr-0001CY-La; Mon, 12 Aug 2024 13:06:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775497.1185773; Mon, 12 Aug 2024 13:06:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkr-0001Bl-Fk; Mon, 12 Aug 2024 13:06:33 +0000
Received: by outflank-mailman (input) for mailman id 775497;
 Mon, 12 Aug 2024 13:06:32 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=FAji=PL=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sdUkq-0007ep-1s
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 13:06:32 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b1013ab9-58ab-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 15:06:30 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-52f025bc147so4940625e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 06:06:30 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-53200f42667sm739978e87.294.2024.08.12.06.06.28
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 12 Aug 2024 06:06:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b1013ab9-58ab-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723467990; x=1724072790; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=fsU79nmQ1AQVXUbNSxYwoeBBAkcfnxSMEvBp2lKDwWA=;
        b=B/xI+8KavbWBZZglNfWEf48hc0q0hZvTzA5TQwWKGyYhhR4NdslF57hJg4NKekTcb/
         0Q+uZumL7LBhYxSfjRb5GOeIGAZK4Z1vXMNRzL4WDlQ0AXEN7TNqQaPBXXrMfOuflvss
         WTKz4WhJjylmQnLc2VjrbXjkO3d+6FW1SrodK5owAjieVaGHPKAK+IYsWgOOKRMxaGDu
         z6JS5ur5pJz1sekEdkfddLOFTZkW+Z8ir0hMQPmoKRqGxsq89HrjpmZCVDdSSMjTVgwo
         9QKVXcn9NuQK43h0nX7MttEIRW/fKjgxdyDYq7t1FM3ELOtxoUUmYj5rvtjVtIfPfdPo
         iaBw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723467990; x=1724072790;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=fsU79nmQ1AQVXUbNSxYwoeBBAkcfnxSMEvBp2lKDwWA=;
        b=OJbjLmsFzk9yyekvzpcv3LoMEPJIVnkiKnEvxoI1TgRQMqUU/d6r/8ogR8l5gPzZ6U
         XusGrRF9/Nf2AollqusmQt4S6fmIFt9NyHfDY9mQ4uM2Z4scM2pN4uvxRNWKJai+HxVP
         hoQee1upt1Kk9oVB5CR/aESJGx7r+bCAnOn51OjxWk/anKojVUTiVlM29TSKun9ibiF6
         LWIgV3MNon2N1J+tSxAf1hbaaB3Gl+SOxM8pj6avYE8V3tpcJYFV+9ueoWmQGiydbn6b
         71nIfIc9dGjzqQq8YQHjmaFzC/gsAAyi9yfLHAlBngA5qdztA1F5SjvWFbihBGirrBtN
         BTUA==
X-Forwarded-Encrypted: i=1; AJvYcCU9jI7HVqVHMq5yg3RqGYBbAN1wvBey+lOuZWVWZMUBuNvIMyw4l3cThY0x8JNi5YAUWhhLwoxJQN+bKjMluTbtEpoj/+PFvhb7YaQnDjI=
X-Gm-Message-State: AOJu0Yx8nsIrn0UZqTyub3QTn0B+aW7/OS1ay0HoNFBffJQCgYEI/fwQ
	YtbFpdLP5XBwFAGtjm/LlNyL0yO1zdO87f24DYeGy6vxehf+4pwEH6BaVAD5
X-Google-Smtp-Source: AGHT+IExi6OAtMSH2lj/PgBrg+LlxDZERUpkwQQHEWkaEtSD3XJV0ILUPZ6rtXYIo0sScSOwNbS7/Q==
X-Received: by 2002:a05:6512:6d1:b0:52e:941d:7039 with SMTP id 2adb3069b0e04-532136a4e69mr29594e87.59.1723467989238;
        Mon, 12 Aug 2024 06:06:29 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH v1 08/10] hw/xen: pvh-common: Add support for creating PCIe/GPEX
Date: Mon, 12 Aug 2024 15:06:03 +0200
Message-ID: <20240812130606.90410-9-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240812130606.90410-1-edgar.iglesias@gmail.com>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Add support for optionally creating a PCIe/GPEX controller.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 hw/xen/xen-pvh-common.c         | 66 +++++++++++++++++++++++++++++++++
 include/hw/xen/xen-pvh-common.h | 10 ++++-
 2 files changed, 75 insertions(+), 1 deletion(-)

diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
index 69a2dbdb6d..b1432e4bd9 100644
--- a/hw/xen/xen-pvh-common.c
+++ b/hw/xen/xen-pvh-common.c
@@ -120,6 +120,59 @@ static void xen_enable_tpm(XenPVHCommonState *s)
 }
 #endif
 
+static void xen_set_pci_intx_irq(void *opaque, int irq, int level)
+{
+    if (xen_set_pci_intx_level(xen_domid, 0, 0, 0, irq, level)) {
+        error_report("xendevicemodel_set_pci_intx_level failed");
+    }
+}
+
+static inline void xenpvh_gpex_init(XenPVHCommonState *s,
+                                    MemoryRegion *sysmem,
+                                    hwaddr ecam_base, hwaddr ecam_size,
+                                    hwaddr mmio_base, hwaddr mmio_size,
+                                    hwaddr mmio_high_base,
+                                    hwaddr mmio_high_size,
+                                    int intx_irq_base)
+{
+    MemoryRegion *ecam_reg;
+    MemoryRegion *mmio_reg;
+    DeviceState *dev;
+    int i;
+
+    object_initialize_child(OBJECT(s), "gpex", &s->pci.gpex,
+                            TYPE_GPEX_HOST);
+    dev = DEVICE(&s->pci.gpex);
+    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
+
+    ecam_reg = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
+    memory_region_add_subregion(sysmem, ecam_base, ecam_reg);
+
+    mmio_reg = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1);
+
+    if (mmio_size) {
+        memory_region_init_alias(&s->pci.mmio_alias, OBJECT(dev), "pcie-mmio",
+                                 mmio_reg, mmio_base, mmio_size);
+        memory_region_add_subregion(sysmem, mmio_base, &s->pci.mmio_alias);
+    }
+
+    if (mmio_high_size) {
+        memory_region_init_alias(&s->pci.mmio_high_alias, OBJECT(dev),
+                "pcie-mmio-high",
+                mmio_reg, mmio_high_base, mmio_high_size);
+        memory_region_add_subregion(sysmem, mmio_high_base,
+                &s->pci.mmio_high_alias);
+    }
+
+    for (i = 0; i < GPEX_NUM_IRQS; i++) {
+        qemu_irq irq = qemu_allocate_irq(xen_set_pci_intx_irq, s, i);
+
+        sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, irq);
+        gpex_set_irq_num(GPEX_HOST(dev), i, intx_irq_base + i);
+        xen_set_pci_link_route(i, intx_irq_base + i);
+    }
+}
+
 static void xen_pvh_realize(DeviceState *dev, Error **errp)
 {
     XenPVHCommonState *s = XEN_PVH_COMMON(dev);
@@ -152,6 +205,14 @@ static void xen_pvh_realize(DeviceState *dev, Error **errp)
         warn_report("tpm-base-addr is not provided. TPM will not be enabled");
     }
 #endif
+
+    if (s->cfg.ecam.size) {
+        xenpvh_gpex_init(s, sysmem,
+                         s->cfg.ecam.base, s->cfg.ecam.size,
+                         s->cfg.mmio.base, s->cfg.mmio.size,
+                         s->cfg.mmio_high.base, s->cfg.mmio_high.size,
+                         s->cfg.pci_intx_irq_base);
+    }
 }
 
 #define DEFINE_PROP_MEMMAP(n, f) \
@@ -165,10 +226,15 @@ static Property xen_pvh_properties[] = {
     DEFINE_PROP_MEMMAP("ram-high", ram_high),
     DEFINE_PROP_MEMMAP("virtio-mmio", virtio_mmio),
     DEFINE_PROP_MEMMAP("tpm", tpm),
+    DEFINE_PROP_MEMMAP("pci-ecam", ecam),
+    DEFINE_PROP_MEMMAP("pci-mmio", mmio),
+    DEFINE_PROP_MEMMAP("pci-mmio-high", mmio_high),
     DEFINE_PROP_UINT32("virtio-mmio-num", XenPVHCommonState,
                        cfg.virtio_mmio_num, 0),
     DEFINE_PROP_UINT32("virtio-mmio-irq-base", XenPVHCommonState,
                        cfg.virtio_mmio_irq_base, 0),
+    DEFINE_PROP_UINT32("pci-intx-irq-base", XenPVHCommonState,
+                       cfg.pci_intx_irq_base, 0),
     DEFINE_PROP_END_OF_LIST()
 };
 
diff --git a/include/hw/xen/xen-pvh-common.h b/include/hw/xen/xen-pvh-common.h
index e958b441fd..faacfca70e 100644
--- a/include/hw/xen/xen-pvh-common.h
+++ b/include/hw/xen/xen-pvh-common.h
@@ -29,17 +29,25 @@ typedef struct XenPVHCommonState {
         MemoryRegion high;
     } ram;
 
+    struct {
+        GPEXHost gpex;
+        MemoryRegion mmio_alias;
+        MemoryRegion mmio_high_alias;
+    } pci;
+
     struct {
         uint64_t ram_size;
         uint32_t max_cpus;
         uint32_t virtio_mmio_num;
         uint32_t virtio_mmio_irq_base;
+        uint32_t pci_intx_irq_base;
         struct {
             uint64_t base;
             uint64_t size;
         } ram_low, ram_high,
           virtio_mmio,
-          tpm;
+          tpm,
+          ecam, mmio, mmio_high;
     } cfg;
 } XenPVHCommonState;
 #endif
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 12 13:06:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 13:06:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775499.1185779 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUks-0001Gn-4b; Mon, 12 Aug 2024 13:06:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775499.1185779; Mon, 12 Aug 2024 13:06:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUkr-0001FU-QX; Mon, 12 Aug 2024 13:06:33 +0000
Received: by outflank-mailman (input) for mailman id 775499;
 Mon, 12 Aug 2024 13:06:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=FAji=PL=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sdUkq-00074b-8p
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 13:06:32 +0000
Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com
 [2a00:1450:4864:20::22b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b19c9544-58ab-11ef-bc05-fd08da9f4363;
 Mon, 12 Aug 2024 15:06:31 +0200 (CEST)
Received: by mail-lj1-x22b.google.com with SMTP id
 38308e7fff4ca-2f149845fbaso45483501fa.3
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 06:06:31 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f291df3c4esm8503311fa.40.2024.08.12.06.06.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 12 Aug 2024 06:06:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b19c9544-58ab-11ef-bc05-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723467991; x=1724072791; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=zpYqNKXAVuA0a+6/wfjyGjtY9ZeW5tCWM6T6raDN/Y4=;
        b=QgtnSVwvc56thpNKoLxfoUNC63Fjzv+hEvod3nd6UDvPR2s3IUGi6j4YUV2BpclwMj
         BjlEsJzQGwLC8NZQXg5i8Mfidi05RWTd3CErmFhpyv5nOrFa7hD3j1YItkMjfh+S85af
         +DFERiStt4Tc8Qgb2/DiH4FQFy8pD41uaBRT76Rf9bGucoReXgZ6UfbnFmPnHBGcK73f
         SHwF3Wlp8PIaINzUIL+DbpcC8nlSWf/fzhlCA2FIu5mJz4xj/2yxLhNkAUY7E+Pe7vbw
         mSAZrWwIvHf9ejvtUCrHFUxnW+wwTqZzhkrCYtWfbzUD24M+53KWpOmHeEw/Nq4O++PQ
         odkQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723467991; x=1724072791;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=zpYqNKXAVuA0a+6/wfjyGjtY9ZeW5tCWM6T6raDN/Y4=;
        b=iisgonhi8F+AiaTVJt/i++d9IhHL9UGi/9O6XFH76/7hy4+aRfCoct5BUquQyzT533
         ElZGfsNE8ThATyyY2adxpfnpXhfz2iP3Q2i4W4WyAGMDD1n+z0fD6CAuc7eQsa5oGmVm
         ZB1hQmIFZjL7wXbDPFvQb/Xij70UTeBH+yxmcAtzNJbUZ7BI3IooQH2++nYociaeWGGj
         VDs7Lhcdzpf/39qFCXaoL2m7Gv8BOR6Hn0TeQPziNo/LUzmVUj0BanAz40VF7bojwY2W
         1/Z1iT+Wq6j8SQ/zmJtAKzn8WLKi97gMsyCjDzLlRIUPd1ruhNJoVKSTe8a3++a9fbPR
         AaNw==
X-Forwarded-Encrypted: i=1; AJvYcCWPbfU8bBwWKDJzAH0XSWGwS4OxTstfwKlVYECoyaMVf6xMzhZsJdF5qdLTSLnagMYx+o3fk/XcFWG/C78RT7de8cGebOo16j/dou7Miw0=
X-Gm-Message-State: AOJu0YwFS4RRpunwJmAIjLPeT9jlombF23gc82tM5KYMoCNaMEhJ9JMP
	Tv0cTHnGbTjAZQ9Z3mpehiv880foqE2gd40D/AgcdqymNMxFRkT3
X-Google-Smtp-Source: AGHT+IFbDkFVn4nHNTgp2rSK1ep8EB3W/CnGnNoziWsVxIa3hCXemD+rWCA6eJi3qacG+boCLJdOoQ==
X-Received: by 2002:a2e:2414:0:b0:2ef:1808:7523 with SMTP id 38308e7fff4ca-2f2b714d294mr1493031fa.18.1723467990279;
        Mon, 12 Aug 2024 06:06:30 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Eduardo Habkost <eduardo@habkost.net>
Subject: [PATCH v1 09/10] hw/i386/xen: Add a Xen PVH x86 machine
Date: Mon, 12 Aug 2024 15:06:04 +0200
Message-ID: <20240812130606.90410-10-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240812130606.90410-1-edgar.iglesias@gmail.com>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

This adds a Xen PVH x86 machine based on the PVH Common
module used by the ARM PVH machine.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 hw/i386/xen/meson.build |   1 +
 hw/i386/xen/xen-pvh.c   | 196 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 197 insertions(+)
 create mode 100644 hw/i386/xen/xen-pvh.c

diff --git a/hw/i386/xen/meson.build b/hw/i386/xen/meson.build
index 3f0df8bc07..c73c62b8e3 100644
--- a/hw/i386/xen/meson.build
+++ b/hw/i386/xen/meson.build
@@ -4,6 +4,7 @@ i386_ss.add(when: 'CONFIG_XEN', if_true: files(
 ))
 i386_ss.add(when: ['CONFIG_XEN', xen], if_true: files(
   'xen-hvm.c',
+  'xen-pvh.c',
 ))
 
 i386_ss.add(when: 'CONFIG_XEN_BUS', if_true: files(
diff --git a/hw/i386/xen/xen-pvh.c b/hw/i386/xen/xen-pvh.c
new file mode 100644
index 0000000000..9c3d3fc58d
--- /dev/null
+++ b/hw/i386/xen/xen-pvh.c
@@ -0,0 +1,196 @@
+/*
+ * QEMU Xen PVH x86 Machine
+ *
+ * Copyright (c) 2024 Advanced Micro Devices, Inc.
+ * Written by Edgar E. Iglesias <edgar.iglesias@amd.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "qapi/visitor.h"
+#include "qemu/error-report.h"
+#include "hw/boards.h"
+#include "sysemu/sysemu.h"
+#include "hw/xen/arch_hvm.h"
+#include "hw/xen/xen.h"
+#include "hw/xen/xen-pvh-common.h"
+
+#define TYPE_XEN_PVH_X86  MACHINE_TYPE_NAME("xenpvh")
+OBJECT_DECLARE_SIMPLE_TYPE(XenPVHx86State, XEN_PVH_X86)
+
+#define PVH_MAX_CPUS 128
+
+struct XenPVHx86State {
+    /*< private >*/
+    MachineState parent;
+
+    DeviceState *cpu[PVH_MAX_CPUS];
+    XenPVHCommonState pvh;
+
+    /*
+     * We provide these properties to allow Xen to move things to other
+     * addresses for example when users need to accomodate the memory-map
+     * for 1:1 mapped devices/memory.
+     */
+    struct {
+        MemMapEntry ram_low, ram_high;
+        MemMapEntry pci_ecam, pci_mmio, pci_mmio_high;
+    } cfg;
+};
+
+static void xenpvh_cpu_new(MachineState *ms,
+                           XenPVHx86State *xp,
+                           int cpu_idx,
+                           int64_t apic_id)
+{
+    Object *cpu = object_new(ms->cpu_type);
+
+    object_property_add_child(OBJECT(ms), "cpu[*]", cpu);
+    object_property_set_uint(cpu, "apic-id", apic_id, &error_fatal);
+    qdev_realize(DEVICE(cpu), NULL, &error_fatal);
+    object_unref(cpu);
+
+    xp->cpu[cpu_idx] = DEVICE(cpu);
+}
+
+static void xenpvh_init(MachineState *ms)
+{
+    XenPVHx86State *xp = XEN_PVH_X86(ms);
+    const struct {
+        const char *name;
+        MemMapEntry *map;
+    } map[] = {
+        { "ram-low", &xp->cfg.ram_low },
+        { "ram-high", &xp->cfg.ram_high },
+        { "pci-ecam", &xp->cfg.pci_ecam },
+        { "pci-mmio", &xp->cfg.pci_mmio },
+        { "pci-mmio-high", &xp->cfg.pci_mmio_high },
+    };
+    int i;
+
+    object_initialize_child(OBJECT(ms), "pvh", &xp->pvh, TYPE_XEN_PVH_COMMON);
+    object_property_set_int(OBJECT(&xp->pvh), "max-cpus", ms->smp.max_cpus,
+                            &error_abort);
+    object_property_set_int(OBJECT(&xp->pvh), "ram-size", ms->ram_size,
+                            &error_abort);
+
+    for (i = 0; i < ARRAY_SIZE(map); i++) {
+        g_autofree char *base_name = g_strdup_printf("%s-base", map[i].name);
+        g_autofree char *size_name = g_strdup_printf("%s-size", map[i].name);
+
+        object_property_set_int(OBJECT(&xp->pvh), base_name, map[i].map->base,
+                                 &error_abort);
+        object_property_set_int(OBJECT(&xp->pvh), size_name, map[i].map->size,
+                                 &error_abort);
+    }
+
+    /* GSI's 16 - 20 are used for legacy PCIe INTX IRQs.  */
+    object_property_set_int(OBJECT(&xp->pvh), "pci-intx-irq-base", 16,
+                            &error_abort);
+
+    sysbus_realize(SYS_BUS_DEVICE(&xp->pvh), &error_abort);
+
+    /* Create dummy cores. This will indirectly create the APIC MSI window.  */
+    for (i = 0; i < ms->smp.cpus; i++) {
+        xenpvh_cpu_new(ms, xp, i, i);
+    }
+}
+
+#define XENPVH_PROP_MEMMAP_SETTER(n, f)                                    \
+static void xenpvh_set_ ## n ## _ ## f(Object *obj, Visitor *v,            \
+                                       const char *name, void *opaque,     \
+                                       Error **errp)                       \
+{                                                                          \
+    XenPVHx86State *xp = XEN_PVH_X86(obj);                                 \
+    uint64_t value;                                                        \
+                                                                           \
+    if (!visit_type_size(v, name, &value, errp)) {                         \
+        return;                                                            \
+    }                                                                      \
+    xp->cfg.n.f = value;                                                   \
+}
+
+#define XENPVH_PROP_MEMMAP_GETTER(n, f)                                    \
+static void xenpvh_get_ ## n ## _ ## f(Object *obj, Visitor *v,            \
+                                       const char *name, void *opaque,     \
+                                       Error **errp)                       \
+{                                                                          \
+    XenPVHx86State *xp = XEN_PVH_X86(obj);                                 \
+    uint64_t value = xp->cfg.n.f;                                          \
+                                                                           \
+    visit_type_uint64(v, name, &value, errp);                              \
+}
+
+#define XENPVH_PROP_MEMMAP(n)              \
+    XENPVH_PROP_MEMMAP_SETTER(n, base)     \
+    XENPVH_PROP_MEMMAP_SETTER(n, size)     \
+    XENPVH_PROP_MEMMAP_GETTER(n, base)     \
+    XENPVH_PROP_MEMMAP_GETTER(n, size)
+
+
+XENPVH_PROP_MEMMAP(ram_low)
+XENPVH_PROP_MEMMAP(ram_high)
+XENPVH_PROP_MEMMAP(pci_ecam)
+XENPVH_PROP_MEMMAP(pci_mmio)
+XENPVH_PROP_MEMMAP(pci_mmio_high)
+
+static void xenpvh_instance_init(Object *obj)
+{
+    XenPVHx86State *xp = XEN_PVH_X86(obj);
+
+    /* Default memmap.  */
+    xp->cfg.ram_low.base = 0x0;
+    xp->cfg.ram_low.size = 0x80000000U;
+    xp->cfg.ram_high.base = 0xC000000000ULL;
+    xp->cfg.ram_high.size = 0x4000000000ULL;
+}
+
+static void xenpvh_machine_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+
+    mc->desc = "Xen PVH x86 machine";
+    mc->init = xenpvh_init;
+    mc->max_cpus = PVH_MAX_CPUS;
+    mc->default_cpu_type = TARGET_DEFAULT_CPU_TYPE;
+    mc->default_machine_opts = "accel=xen";
+    /* Set explicitly here to make sure that real ram_size is passed */
+    mc->default_ram_size = 0;
+
+#define OC_MEMMAP_PROP(c, prop_name, name)                               \
+do {                                                                     \
+    object_class_property_add(c, prop_name "-base", "uint64_t",          \
+                              xenpvh_get_ ## name ## _base,              \
+                              xenpvh_set_ ## name ## _base, NULL, NULL); \
+    object_class_property_set_description(oc, prop_name "-base",         \
+                              prop_name " base address");                \
+    object_class_property_add(c, prop_name "-size", "uint64_t",          \
+                              xenpvh_get_ ## name ## _size,              \
+                              xenpvh_set_ ## name ## _size, NULL, NULL); \
+    object_class_property_set_description(oc, prop_name "-size",         \
+                              prop_name " size of memory region");       \
+} while (0)
+
+    OC_MEMMAP_PROP(oc, "ram-low", ram_low);
+    OC_MEMMAP_PROP(oc, "ram-high", ram_high);
+    OC_MEMMAP_PROP(oc, "pci-ecam", pci_ecam);
+    OC_MEMMAP_PROP(oc, "pci-mmio", pci_mmio);
+    OC_MEMMAP_PROP(oc, "pci-mmio-high", pci_mmio_high);
+}
+
+static const TypeInfo xenpvh_machine_type = {
+    .name = TYPE_XEN_PVH_X86,
+    .parent = TYPE_MACHINE,
+    .class_init = xenpvh_machine_class_init,
+    .instance_init = xenpvh_instance_init,
+    .instance_size = sizeof(XenPVHx86State),
+};
+
+static void xenpvh_machine_register_types(void)
+{
+    type_register_static(&xenpvh_machine_type);
+}
+
+type_init(xenpvh_machine_register_types)
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 12 13:06:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 13:06:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775505.1185794 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUku-00021z-Oy; Mon, 12 Aug 2024 13:06:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775505.1185794; Mon, 12 Aug 2024 13:06:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUku-00021j-JQ; Mon, 12 Aug 2024 13:06:36 +0000
Received: by outflank-mailman (input) for mailman id 775505;
 Mon, 12 Aug 2024 13:06:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=FAji=PL=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sdUks-00074b-Ke
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 13:06:34 +0000
Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com
 [2a00:1450:4864:20::22d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b31e9298-58ab-11ef-bc05-fd08da9f4363;
 Mon, 12 Aug 2024 15:06:34 +0200 (CEST)
Received: by mail-lj1-x22d.google.com with SMTP id
 38308e7fff4ca-2ef2c56d9dcso49208671fa.2
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 06:06:34 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f29203d7ebsm8631921fa.83.2024.08.12.06.06.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 12 Aug 2024 06:06:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b31e9298-58ab-11ef-bc05-fd08da9f4363
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723467993; x=1724072793; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=mKBi8KqYhGDFlqsXHx9Zw2bI17GecQkQjZL9UWM7DqA=;
        b=kuUQm91TepPzeX6i4z1QYb7s6hZ1cgAqABPCKGKu3MpvVpr3auZGk9Gu5Y8GxOXU4R
         dG3+QI60Hkt+HGY+sZQDjC4yNd+sMiyIKGQMUjYKxmKzqBaGYQYpOJxQbprVWIVV/aQi
         jC2hLBR+8Um+vX2yrQJ4GakXk0U0xzC/VDyUCLU7WPyKeXGoy/DUSJUZzG+EGibEYKCb
         u75k7Qf1pWuU1Wxa3ceInxEL8pMjSpZRMLiN2FEvkhudXPRxBjnRk0ki7ETHBU1NcHki
         EDA1UllcrgHGNDuqy+S+vAGtg3J3c8zWNJFOw8Cj+kzqYhxIoEoS/S0Bbqa6X5uVB8ZZ
         ZsoA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723467993; x=1724072793;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=mKBi8KqYhGDFlqsXHx9Zw2bI17GecQkQjZL9UWM7DqA=;
        b=fxz+z/kKGCW5Z6RBh2uWQwGoM3CjRqjUVpn8ZpYhisgSP7AxxYEgYTL9rUx1/0C1WK
         sxZb674F2cc7xYkph6pfwQOPgi46nJxJ0e0RAYTZtYIL3/0NlbM4XOTRK4u3hAUD8glD
         NUny34tMO//VFuGBsnTwOpkxij+EImTo8XWvArrqUe12YBWhqQY4UEil/N0d6boKQwH/
         kgSrbOWBNKDWkCbK5C24Ny1wzu4rPvFFlYXFz1TfjdyB9AS4Lo7HqFP5GbRSILQM5xTX
         fuTGVQgMYGr6NoOuXkN5al9rmLwRdtnvx03CepD6KaOIsKVcmUAK9BAaXcDhDA3LjtSU
         nIZg==
X-Forwarded-Encrypted: i=1; AJvYcCV0koXZNFNYmnG5EMsSZtW1eAK7qvoedo/fT/NoyxueC9hFnUBzbsVAhmxhF5sjpazxjeEA8PBediNHERlEo0W+1MunBLUjRupfgHIgf2A=
X-Gm-Message-State: AOJu0Yz0fDrc6uOH/anVEM4WeSah0Jq8eCv2diY48k9ndNU4Jbi2yl4r
	mnQbh1edhGPOcfUMrLgzq6GpcfOgYweyfFb4FrnBG4c0mEJv5B2+
X-Google-Smtp-Source: AGHT+IFc8uBG8fAqe8QiFu7qL5vOSuGxpFRzQNhkfUh2olLgNFB3zwVq8FCW9cJURrXcMaKyPvPWuQ==
X-Received: by 2002:a2e:9c10:0:b0:2ef:22bc:6fb0 with SMTP id 38308e7fff4ca-2f2b7179ecbmr1400471fa.34.1723467992891;
        Mon, 12 Aug 2024 06:06:32 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH v1 10/10] docs/system/i386: xenpvh: Add a basic description
Date: Mon, 12 Aug 2024 15:06:05 +0200
Message-ID: <20240812130606.90410-11-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240812130606.90410-1-edgar.iglesias@gmail.com>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 MAINTAINERS                 |  1 +
 docs/system/i386/xenpvh.rst | 49 +++++++++++++++++++++++++++++++++++++
 docs/system/target-i386.rst |  1 +
 3 files changed, 51 insertions(+)
 create mode 100644 docs/system/i386/xenpvh.rst

diff --git a/MAINTAINERS b/MAINTAINERS
index a24c2e14d9..da4c9d4d46 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -560,6 +560,7 @@ F: include/sysemu/xen.h
 F: include/sysemu/xen-mapcache.h
 F: stubs/xen-hw-stub.c
 F: docs/system/arm/xenpvh.rst
+F: docs/system/i386/xenpvh.rst
 
 Guest CPU Cores (NVMM)
 ----------------------
diff --git a/docs/system/i386/xenpvh.rst b/docs/system/i386/xenpvh.rst
new file mode 100644
index 0000000000..354250f073
--- /dev/null
+++ b/docs/system/i386/xenpvh.rst
@@ -0,0 +1,49 @@
+Xen PVH machine (``xenpvh``)
+=========================================
+
+Xen supports a spectrum of types of guests that vary in how they depend
+on HW virtualization features, emulation models and paravirtualization.
+PVH is a mode that uses HW virtualization features (like HVM) but tries
+to avoid emulation models and instead use passthrough or
+paravirtualized devices.
+
+QEMU can be used to provide PV virtio devices on an emulated PCIe controller.
+That is the purpose of this minimal machine.
+
+Supported devices
+-----------------
+
+The x86 Xen PVH QEMU machine provide the following devices:
+
+- RAM
+- GPEX host bridge
+- virtio-pci devices
+
+The idea is to only connect virtio-pci devices but in theory any compatible
+PCI device model will work depending on Xen and guest support.
+
+Running
+-------
+
+The Xen tools will typically construct a command-line and launch QEMU
+for you when needed. But here's an example of what it can look like in
+case you need to construct one manually:
+
+.. code-block:: console
+
+    qemu-system-i386 -xen-domid 3 -no-shutdown        \
+      -chardev socket,id=libxl-cmd,path=/var/run/xen/qmp-libxl-3,server=on,wait=off \
+      -mon chardev=libxl-cmd,mode=control             \
+      -chardev socket,id=libxenstat-cmd,path=/var/run/xen/qmp-libxenstat-3,server=on,wait=off \
+      -mon chardev=libxenstat-cmd,mode=control        \
+      -nodefaults                                     \
+      -no-user-config                                 \
+      -xen-attach -name g0                            \
+      -vnc none                                       \
+      -display none                                   \
+      -device virtio-net-pci,id=nic0,netdev=net0,mac=00:16:3e:5c:81:78 \
+      -netdev type=tap,id=net0,ifname=vif3.0-emu,br=xenbr0,script=no,downscript=no \
+      -smp 4,maxcpus=4                                \
+      -nographic                                      \
+      -machine xenpvh,ram-low-base=0,ram-low-size=2147483648,ram-high-base=4294967296,ram-high-size=2147483648,pci-ecam-base=824633720832,pci-ecam-size=268435456,pci-mmio-base=4026531840,pci-mmio-size=33554432,pci-mmio-high-base=824902156288,pci-mmio-high-size=68719476736 \
+      -m 4096
diff --git a/docs/system/target-i386.rst b/docs/system/target-i386.rst
index 1b8a1f248a..23e84e3ba7 100644
--- a/docs/system/target-i386.rst
+++ b/docs/system/target-i386.rst
@@ -26,6 +26,7 @@ Architectural features
    i386/cpu
    i386/hyperv
    i386/xen
+   i386/xenpvh
    i386/kvm-pv
    i386/sgx
    i386/amd-memory-encryption
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 12 13:20:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 13:20:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775587.1185803 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUyJ-00083o-VU; Mon, 12 Aug 2024 13:20:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775587.1185803; Mon, 12 Aug 2024 13:20:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdUyJ-00083h-Sd; Mon, 12 Aug 2024 13:20:27 +0000
Received: by outflank-mailman (input) for mailman id 775587;
 Mon, 12 Aug 2024 13:20:27 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KPBI=PL=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sdUyJ-00083b-1g
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 13:20:27 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a2667d3d-58ad-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 15:20:25 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-52f01b8738dso3615751e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 06:20:25 -0700 (PDT)
Received: from localhost ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80bb2136d1sm227786066b.155.2024.08.12.06.20.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 12 Aug 2024 06:20:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a2667d3d-58ad-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723468824; x=1724073624; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=JhC2OqDl1puffudqOP75LOp4l/A/qZYepve+hh1qMuk=;
        b=db96YkBaQn1dFw/rF5QFTx+tmSOX09QNuYlsncLMhV8AwREV5znYsgDkaryuiN6v5e
         lnqxYTt48ccR24afdi76rXyf4zLcsGsjnxFH1xWcZ4/yykFaiuEYNgUAv8UWIYOtE3Y8
         z9GpyxkMzpBIv7b1EJ1IE4yWcxSEf9v/N9Gb0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723468824; x=1724073624;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=JhC2OqDl1puffudqOP75LOp4l/A/qZYepve+hh1qMuk=;
        b=vFvew/qwWzIWJAKWmFsOOZfw7RmllvSaUuNWaA2ccrZ0sUFZ9ehdQNYHgJhATNNKzB
         IYMSkoSSVb0a8NnOii/0Nm7AC2FCihq0ZA3LB+fnS8dCjWqNqIbj/l246TOU6JS4RMhV
         OGXA0AtdNVsTLMvLBGGq32xFt/fzXXtnuic/n1MSNztJL3xxrzO1oWc4Wps0QM3OYclZ
         rySggQLqQGemCS0ANtUy640fJi1tOTIgYXRmQynkwoUE/50D5bNx9FulFdAYR9m2INn1
         XskXVf2Hc6YwP8II2fWVOiSYY+dLkkrdz9uWRRnrVKtjdguNszTF06Dv0Q7iqLnKk+cB
         14UQ==
X-Gm-Message-State: AOJu0Yyk2fLckEHS3X61fLSITxrrKE4WX5F5gg28YvDWfolQx2tKGbHh
	5v5hyAEePdk4pk6R8z68feLD8k8TxahVX4vYu69znar2fMcr4EFDxn6w0+ENslI=
X-Google-Smtp-Source: AGHT+IGaFovc/mOscy3BLvf3ZgXoCeeUWfFL9FBEy/9iofOVz6tw2T5/DSZD0nWI2gpSnzSp6ukABw==
X-Received: by 2002:a05:6512:2215:b0:52e:9cf0:69db with SMTP id 2adb3069b0e04-53213684cd6mr83047e87.46.1723468824050;
        Mon, 12 Aug 2024 06:20:24 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Mon, 12 Aug 2024 14:20:22 +0100
Message-Id: <D3DYPIPLBSEA.14PVSCSI619Y8@cloud.com>
Cc: "Xen-devel" <xen-devel@lists.xenproject.org>, "Andrew Cooper"
 <andrew.cooper3@citrix.com>, "Jan Beulich" <jbeulich@suse.com>, "Julien
 Grall" <julien@xen.org>
Subject: Re: [RFC PATCH] xen: Remove -Wdeclaration-after-statement
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Stefano Stabellini" <sstabellini@kernel.org>
X-Mailer: aerc 0.17.0
References: <20240809130418.10431-1-alejandro.vallejo@cloud.com>
 <alpine.DEB.2.22.394.2408091217370.200407@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2408091217370.200407@ubuntu-linux-20-04-desktop>

On Fri Aug 9, 2024 at 8:25 PM BST, Stefano Stabellini wrote:
> Adding Roberto
>
> Does MISRA have a view on this? I seem to remember this is discouraged?
>

I'd be surprised if MISRA didn't promote declaring close to first use to av=
oid
use-before-init, but you very clearly have a lot more exposure to it than I=
 do.

I'm quite curious about what its preference is and the rationale for it.

>
> On Fri, 9 Aug 2024, Alejandro Vallejo wrote:
> > This warning only makes sense when developing using a compiler with C99
> > support on a codebase meant to be built with C89 compilers too, and
> > that's no longer the case (nor should it be, as it's been 25 years sinc=
e
> > C99 came out already).
> >=20
> > Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> > ---
> > Yes, I'm opening this can of worms. I'd like to hear others people's
> > thoughts on this and whether this is something MISRA has views on. If
> > there's an ulterior non-obvious reason besides stylistic preference I
> > think it should be documented somewhere, but I haven't seen such an
> > explanation.
> >=20
> > IMO, the presence of this warning causes several undesirable effects:
> >=20
> >   1. Small functions are hampered by the preclusion of check+declare
> >      patterns that improve readability via concision. e.g: Consider a
> >      silly example like:
> >=20
> >      /* with warning */                     /* without warning */
> >      void foo(uint8_t *p)                   void foo(uint8_t *p)
> >      {                                      {
> >          uint8_t  tmp1;                         if ( !p )
> >          uint16_t tmp2;                             return;
> >          uint32_t tmp3;
> >                                                 uint8_t  tmp1 =3D OFFSE=
T1 + *p;
> >          if ( !p )                              uint16_t tmp2 =3D OFFSE=
T2 + *p;
> >              return;                            uint32_t tmp3 =3D OFFSE=
T3 + *p;
> >=20
> >          tmp1 =3D OFFSET1 + *p;                   /* Lots of uses of `t=
mpX` */
> >          tmp2 =3D OFFSET2 + *p;               }
> >          tmp2 =3D OFFSET2 + *p;
> >=20
> >          /* Lots of uses of tmpX */
> >      }
> >=20
> >   2. Promotes scope-creep. On small functions it doesn't matter much,
> >      but on bigger ones to prevent declaring halfway through the body
> >      needlessly increases variable scope to the full scope in which the=
y
> >      are defined rather than the subscope of point-of-declaration to
> >      end-of-current-scope. In cases in which they can be trivially
> >      defined at that point, it also means they can be trivially misused
> >      before they are meant to. i.e: On the example in (1) assume the
> >      conditional in "with warning" is actually a large switch statement=
.
> >=20
> >   3. It facilitates a disconnect between time-of-declaration and
> >      time-of-use that lead very easily to "use-before-init" bugs.
> >      While a modern compiler can alleviate the most egregious cases of
> >      this, there's cases it simply cannot cover. A conditional
> >      initialization on anything with external linkage combined with a
> >      conditional use on something else with external linkage will squas=
h
> >      the warning of using an uninitialised variable. Things are worse
> >      where the variable in question is preinitialised to something
> >      credible (e.g: a pointer to NULL), as then that can be misused
> >      between its declaration and its original point of intended use.
> >=20
> > So... thoughts? yay or nay?
>
> In my opinion, there are some instances where mixing declarations and
> statements would enhance the code, but these are uncommon. Given the
> choice between:
>
> 1) declarations always first
> 2) declarations always mixed with statements
>
> I would choose 1).

FWIW, so would I under those contraints. But let me at least try to persuad=
e
you. There's at least two more arguments to weigh:

  1. It wasn't that long ago that we had to resort to GNU extensions to wor=
k
     around this restriction. It's mildly annoying having to play games wit=
h
     compiler extensions because we're purposely restricting our use of the
     language.

     See the clang codegen workaround:
        https://lore.kernel.org/xen-devel/D2ZM0D609TOQ.2GQQWR1QALUPA@cloud.=
com/

  2. There's an existing divide between toolstack and hypervisor. Toolstack
     already allows this kind of mixing, and it's hard not-to due to extern=
al
     dependencies. While style doesn't have to match 1:1, it'd be (imo)
     preferrable to try and remove avoidable differences.

     See (40be6307ec00: "Only compile the hypervisor with -Wdeclaration-aft=
er-statement")
         https://lore.kernel.org/xen-devel/20231205183226.26636-1-julien@xe=
n.org/

With this in mind, ...

>
> One could say that mixing declarations with statements should be done
> only when appropriate, but the challenge lies in the subjective nature
> of "when appropriate." Different individuals have varying
> interpretations of this, which could lead to unnecessary bikeshedding.

... I do agree that whatever changes we introduce, considering the usual
complaints about the review process, should be in a direction of measurable
objectivity so as to minimize unproductive nitpicking.

In that sense, a differently worded choice is:

  1. Declarations always at the beginning of the scope closest to first use=
.
  2. Declarations always closest to first use.

They really aren't that different, and we do already make reviews asking fo=
r
declarations to be moved to the closest scope. Given this choice I definite=
ly
prefer (2), in part because it removes the uncertainty from review that tru=
e
freeform declarations would allow, better aligns our dialect of C with the
current standard and aligns the hypervisor style (slightly) with the tools =
it
requires.

Plus the advantages I already mentioned in the original email.

>
> For these reasons, I do not support mixing declarations and statements.

Pending whatever MISRA has to say on the matter, I hope these arguments can
steer your view.

Cheers,
Alejandrq


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 14:05:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 14:05:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775597.1185814 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdVft-00084O-7x; Mon, 12 Aug 2024 14:05:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775597.1185814; Mon, 12 Aug 2024 14:05:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdVft-00084H-5I; Mon, 12 Aug 2024 14:05:29 +0000
Received: by outflank-mailman (input) for mailman id 775597;
 Mon, 12 Aug 2024 14:05: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=PyEi=PL=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdVfs-00084B-7b
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 14:05:28 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eb88e83f-58b3-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 16:05:24 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5b8c2a6135eso434881a12.0
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 07:05:24 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd187f5671sm2165380a12.3.2024.08.12.07.05.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 12 Aug 2024 07:05:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eb88e83f-58b3-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723471524; x=1724076324; 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=JX1QH7IOkjSMUhCLKa0/jbvdEy/KbXTGBFZkU/dLY4M=;
        b=eZV43b93P0SnoOMY+lfmH7RnXJOuS7aqoY/qnwD5/1Ngi0GgLhlVLmWyOtPEZy6i2W
         ehqxqfW3A95ezGObkj9cNChZl9bysfWXq+YdIYWNNGF0ml26oJULHEbFdbPikdAJx6aQ
         ZujWOADuP6ygLK5fUDxPfABGJeCdbM1uMFF/9yWcFFh1Z+LdB6lb+W4mT9E+HUrHcYD6
         ITQ3JX7bggInj3JcHq2tIJtBo3sBIL4XPxpyO6aplhYiw7NebYjOYu53AEMLbq3p0wC9
         Th4VqYnoInQ46AcfE9wRMPELGAojhNEjfyTE/rCR0t50KVJf5eWa/09TRsJbVMLoxYD1
         xMFg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723471524; x=1724076324;
        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=JX1QH7IOkjSMUhCLKa0/jbvdEy/KbXTGBFZkU/dLY4M=;
        b=iXreGFOMjjO0PL6GTGIs7ZEXDoGTQhg8daJ301nFXyef+YqiwzzjzYevdL5pQy0RI/
         1H7DBtoAq/D7+MDPPU8xqcMaILisuFZjUfMwbU6S1Q2jPyOtbEUr9aJPUCnQaCBYnt7o
         qen9qPgxxlE7rmIKkU8LCWS9KvWDKJijFV81k3fOvhnSeyFke9xoVpO/jdEkh1fQa/QB
         46AuqladDjb6tyP+hW50dcFn7/eNyhPxiMVDF8mAzSzUdyIeWvV/DJH15mMu89xCCbWg
         hF0ybwrxXZvxdzJMnHt4gD6yN/1X8ndl8mCX+J/q4XTyxKn+Ccyga7LoX8CEtfCXvRw/
         itbw==
X-Forwarded-Encrypted: i=1; AJvYcCUjGHuyzD1aU4JwSH/nxpSMnnTGSCxu1iNPDGQnq0ZHG2C8YFpVUXCT6g1RnRgB6e5EVE6+Me+kbaEX54pxgCSvoFrnBOEvLVZfTruMO6Q=
X-Gm-Message-State: AOJu0YwvEwwpnspInCv3++JFAKxPhnDNQAmxcrunLY2VrF2L6l99YMvN
	L7Rb7IzGiRswJ6CSPrPjooY7dB1YhsRyqZF2K8EPmHM5iOjaaOUeapoYA1vnvA==
X-Google-Smtp-Source: AGHT+IEUWImIy7cFwJOntnWHhmPAMC5i74plkYYac0jZeFivsaZMvxJO/sg8lbPYqRDWOn5/OjpNlg==
X-Received: by 2002:a05:6402:13d3:b0:5bb:723:a189 with SMTP id 4fb4d7f45d1cf-5bd450f71bcmr259757a12.14.1723471524008;
        Mon, 12 Aug 2024 07:05:24 -0700 (PDT)
Message-ID: <e0081fc2-c631-45a0-a847-edc8dcc3988e@suse.com>
Date: Mon, 12 Aug 2024 16:05:23 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: don't call ->read_segment() with x86_seg_none
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <81ae365f-98b4-4bb6-bbb6-c5423dfda038@suse.com>
 <a7d15429-ce49-43b1-9bbd-7b0129094388@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <a7d15429-ce49-43b1-9bbd-7b0129094388@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 12.08.2024 15:04, Andrew Cooper wrote:
> On 05/08/2024 2:26 pm, Jan Beulich wrote:
>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>> @@ -839,7 +839,8 @@ protmode_load_seg(
>>          case x86_seg_tr:
>>              goto raise_exn;
>>          }
>> -        if ( !_amd_like(cp) || vcpu_has_nscb() || !ops->read_segment ||
>> +        if ( seg == x86_seg_none || !_amd_like(cp) || vcpu_has_nscb() ||
>> +             !ops->read_segment ||
>>               ops->read_segment(seg, sreg, ctxt) != X86EMUL_OKAY )
>>              memset(sreg, 0, sizeof(*sreg));
>>          else
> 
> While this fixes the crash, I'm not sure it will behave correctly for
> VERR/VERW.
> 
> protmode_load_seg() is unconditionally X86EMUL_OKAY for a NULL selector,
> and VERW checks for type != 0x8 which an empty attr will pass.

That's past an sreg.s check, which will have failed (for sreg coming back
all clear).

Also if there was a concern here, it would be orthogonal to the adding of
the seg_none check: It would then have been similarly an issue for all
possibilities of taking the memset() path.

> Interestingly, both Intel and AMD state that the NULL selector is
> neither readable nor writeable.

Which makes sense, doesn't it? A nul selector is really more like a
system segment in this regard (for VERR/VERW).

> Also, looking at the emulator logic, we're missing the DPL vs
> CPL/RPL/Conforming checks.

There's surely nothing "conforming" for a nul selector. Hence perhaps you
refer to something entirely unrelated?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 14:14:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 14:14:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775605.1185824 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdVov-0001wE-3K; Mon, 12 Aug 2024 14:14:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775605.1185824; Mon, 12 Aug 2024 14:14:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdVov-0001w7-06; Mon, 12 Aug 2024 14:14:49 +0000
Received: by outflank-mailman (input) for mailman id 775605;
 Mon, 12 Aug 2024 14:14:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gveb=PL=epam.com=prvs=4954548ae1=sergiy_kibrik@srs-se1.protection.inumbo.net>)
 id 1sdVot-0001w1-CN
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 14:14:47 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 38f678bb-58b5-11ef-bc05-fd08da9f4363;
 Mon, 12 Aug 2024 16:14:45 +0200 (CEST)
Received: from pps.filterd (m0174678.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47CD0jIA021114;
 Mon, 12 Aug 2024 14:14:32 GMT
Received: from eur05-db8-obe.outbound.protection.outlook.com
 (mail-db8eur05lp2105.outbound.protection.outlook.com [104.47.17.105])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 40x124cb7g-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Mon, 12 Aug 2024 14:14:32 +0000 (GMT)
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com (2603:10a6:20b:5c0::11)
 by AS8PR03MB9560.eurprd03.prod.outlook.com (2603:10a6:20b:5a8::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Mon, 12 Aug
 2024 14:14:29 +0000
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d]) by AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d%4]) with mapi id 15.20.7849.019; Mon, 12 Aug 2024
 14:14:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 38f678bb-58b5-11ef-bc05-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=mTFU++3ejtlWaXmS/6di9yOKeJsGFSMBHb1ydz5uZjzaBO7n5B3LuLBbIojBmmI7+QTZicMU6JR6n26h6YCE21qDZORru4FRwQBJD2han/nGkuKd5dMug9lKBuOTBggyC8Irgu4yY+utxxuWl4oCMx3y6pYCkIOt3cc7cYuuP5cEv4uQ4+d6c0m5eTPmGcBFxYS+LemNmVrlIOUtAsBKNoR7ruz1mBLKp+DEGqLpJF1KVEb6CwzjcbZ/ThK1C4jIgtIofFWBU6aTTb35aYxvl2N9E7LQhP4W6ihzZf/KiH47NePdIVQ9XQLdKYya5onF7nNAI8JpFuVVh+7OEGdlJw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=URL71CPaVialNbQgQW35MG+PHRVPVVtw31gkEZNVtMM=;
 b=By7k7f4LYFN7NupmCIwV/En7m+DEZbpyovjXFfOKIZSmpHTtJ5ZG1pGxpivJNqfV3EQjTuyx/lL86uR/acvkEhbYbwhmd0/wC41+PUNMhcyinyFbG7DDQ1+rl4eAgRiqVVhd22Szo+C+oCEKhoUZzdc8qUgAMNm0rgMwhcurcIGNngcpe2exL2v9rOGQBXu9GqGCUVtg1sCGgSiZ3MGdi/TzSAnWK6da/3K15bj3R4ywJ+rnleEgyf7FQIPQ25XCBKwDLEf7iGsUq2lR7UW59wRj0yptk8k3JdtWRUhU6CCCQgjQLfA76glJq9mf3ALyrCyUeqSMbv7MMSGCUx5kUA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=URL71CPaVialNbQgQW35MG+PHRVPVVtw31gkEZNVtMM=;
 b=N5jKT3iPle8Ex2WI1GCN1Q0NQlrgtz8NGpky5QTwytHRUk9gDneVRaavfbxH1VHnQQWuTwqTatNELtTzzZEUHUtWAHDZff/A/VkTosqds3IchHxm3kLMjxFUDtsdoBrvapepIGwYfehu59RfZaxc8ELp6GaRw6taZwW9IXBJxLfWSShkHtO8aNf/3/LqW+P6mWGDj8e83/g2ayAkhp9Y7m+qBl8qnEKFZKXqEYq8lIxCd7Kv/Bt4bGJFk+eHTBjl5ab1vBf4DtsxsIXIeklIB22+ZB6e4EAdAiKDMI3Iqq85iSkf+PYup8oOewma8oaPnmS1pZSVajB9A4qL2nZZBg==
Message-ID: <84663969-fb38-4592-9246-e0ea07aeacd8@epam.com>
Date: Mon, 12 Aug 2024 17:14:27 +0300
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v1 1/2] x86/intel: optional build of intel.c
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
        Jan Beulich <jbeulich@suse.com>, xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
        =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
        Stefano Stabellini <sstabellini@kernel.org>
References: <cover.1723196909.git.Sergiy_Kibrik@epam.com>
 <25e80b9271607da56abf9d4193e4d91b3d00bd9c.1723196909.git.Sergiy_Kibrik@epam.com>
 <D3BBCS1WZ3FI.KYTC0BZLDUM9@cloud.com>
 <dab7d359-4433-448f-b781-03544fd4b68d@epam.com>
 <d449f8dc-2d59-4836-b26a-b29a83f7d6fb@suse.com>
 <D3DXIHMBKVC1.21P79JH7NMMG4@cloud.com>
Content-Language: en-US
From: Sergiy Kibrik <sergiy_kibrik@epam.com>
In-Reply-To: <D3DXIHMBKVC1.21P79JH7NMMG4@cloud.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: WA1P291CA0006.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d0:19::14) To AS8PR03MB9192.eurprd03.prod.outlook.com
 (2603:10a6:20b:5c0::11)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9192:EE_|AS8PR03MB9560:EE_
X-MS-Office365-Filtering-Correlation-Id: 3fc4ce78-3616-4774-d7ca-08dcbad9140f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?Y3ZwUDdwTGJwODdiMUpQam5GWUN5a2ZDbTc1dFRLdWk4ck9XbWxsVmRGY3ov?=
 =?utf-8?B?ZG9YNTJqbm9BeitlalZVKzNGVDdLTGxVVVUxOG5RTkNNc2lHaTVmZXA3azN0?=
 =?utf-8?B?ZVI1cWd5L25GQW5ZMUJMeERvNHFadVcyOGVxYzk4c0VKa0ZNMngyeHVNOXBm?=
 =?utf-8?B?RENLa012djNXcVBKY2RzRVR4VCtHWjk5UjZuWitEdDYzNk1rVnp4a1E2aGRG?=
 =?utf-8?B?bWV4cVRRM2diMmJSRzZHZ0JGd0JEYWpESStZd2U3aStuOTM5cmZxVmVxSlA5?=
 =?utf-8?B?Wkd0NURIRnA2TW9DUWRvQlk4aEtNakIrSFNuUG4wUjArektoVWlBcHZMN3Bo?=
 =?utf-8?B?VTNDcUFSMVczQ092UDltZmNuNHQ2NXM5d2lhWUxERFJHaXdkSFFpbFEyZ1Nq?=
 =?utf-8?B?ZForT1NyamsxTGdLdlJxSENXQ09IM1hDcmdSRnU0MW9mVERVUEtCYzRpQk1R?=
 =?utf-8?B?L0l3Qjk0Nmg1UDc4c1BKWTFjYy8yMCtmZDBJZmRCQ0s0NW4zb2xHRy8zRTFE?=
 =?utf-8?B?OTB5aUxKaXdCTHFKQ2ZTNGVKbUw0dkxBMkhzejBBelRUUE5NVmdsdCtKZFkz?=
 =?utf-8?B?SXR6RlZuc3lhN3BEZDBoQkR1bHJIOEMzNlVyOStYcGRXTEdnd2FRV21hY3Ri?=
 =?utf-8?B?SDVRSnB6QjlPbmQreU8rZVZaSStDV04vYklHUURqUDBoMXNQWWdYVml0cXFn?=
 =?utf-8?B?UnNDbVBUTHh0TFNyQUFCeEJINU5tem9pV3pQUU1QVHMzZEJDYUFQVDl1Yy81?=
 =?utf-8?B?d01La29wVFFIZVhacmVOTTlsZnk1VHhJejcwbnU2UDNnVy9seXVORE5YV2RV?=
 =?utf-8?B?bUUyZm4xbVFuUjVzdWd1M252M0RXOVVWd2hkUUh2c3ZEYUVUdUFKbEY5RTZL?=
 =?utf-8?B?WW9nSm5ya0pFdXp0cklYb3puRldrT3pmMm51a1MvWGxjWHVmb05kSVoyazlF?=
 =?utf-8?B?N2F2VmJhWkVDdjVaSktVeEx1YkJMT3gvemdiMlNrZ1hLR1hWK0pvOXJGVk5Q?=
 =?utf-8?B?TUtieTFwSDRGYUpPZWZMc1VubFZtZ1hJdUhuTTBnQjRCbTloMzVkOHRmV3hp?=
 =?utf-8?B?S0hXRGU3VXVBUTgyK0ZTTW1DeW9UUXdaN0laVTlRRlFuRmNSMkxSY1l6WUo2?=
 =?utf-8?B?YzY1eGJKcUVwVnNzRUtIK3I5cEhKejdZNHNPbHNaYmExcWpreFlVMi9Vc1V5?=
 =?utf-8?B?V1EvN1BNRk1MT0YzT1paazBMK0NEQjcyalphSDVmQStnR3IxWXgrb0F3anc1?=
 =?utf-8?B?UWwwTWpEVEVvME5hNW02TkFNTkVjcUlGVUM5YnVFNVJvSXFQdFJ6NG5mM05a?=
 =?utf-8?B?emhOc1dpM3BBMnN5RVBEVks2NGhNWHFrcWpxMnlCSFZsbnc4dVJMVjBqQnRC?=
 =?utf-8?B?Y09RZkFLZ0dLNlRpOWo1bnJZTUtVS3IyWk4yU2Jab3Zqa3hRZlFpd1NTK2lv?=
 =?utf-8?B?cUQ2OCtEM3I2VW5BcUpRYWhIc2NoaGJnemY1YVpWUlNQOGU1YkprNFVzVEJr?=
 =?utf-8?B?bTc3cUxoSmlMWGp4M1dEUTQ2WWVITzJmcHlPMjd5RkRMbTVqN0U4aUlFeDBs?=
 =?utf-8?B?ZHpSTWE0SDdzZEJNMjdQTkxJdkt6UVdlVVhhaG9ScVZUUFU4VGRMemdlZzBM?=
 =?utf-8?B?SE9uMnlFSHltWUZMU3RsR05NQXRHaEtROXFSaTBJd091QjViZmgycXZWR2kv?=
 =?utf-8?B?bVRqWlhhRnRmS0N4SldiMDJyRFZ2MHFVK2I0M3R3ZmxiSVFnNUpiOWU5QUlH?=
 =?utf-8?B?bkV2NDEybHJKYXFyWkt3VFUyK0h2eExmSEhhbmVzaXcybDZyblY1U0xFVDdr?=
 =?utf-8?B?eEVkZ0sya1VHMElmdE04QT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9192.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YzFvMjJLN0dGdDVPZWQvL3Y1YkxnOVBxMjR4a0kzUEhuZGZsckRadHh2Nnhm?=
 =?utf-8?B?TlhKdVZMMDBJSzN3N3ZPR1IzODV2alM5WnNOL2lxT0t2T1pJSjRla3RTUy9Y?=
 =?utf-8?B?bjYrTElEOC9vTWFzUzF0T3MxR3p3Ui9SdlBwVG9jMzFKMlQ4ODlhTm1lNE9Q?=
 =?utf-8?B?QXdGYXNXQmdLSVh2bEFjck5HZ29xVDZiVXF2aVVCQU5QUUp2OENySks2cCs1?=
 =?utf-8?B?Z1RBVWh4V2ErbUNBOEtNWmNDaFkvdU1nRG52c3JoNHhaUlhvRGJwZExpdkx1?=
 =?utf-8?B?aXIwK04xckZPMlU5ZnduamVxK28zV1FQZ0syc2UzWWEzQ3B3MlA4UkloMndW?=
 =?utf-8?B?b3FhekZrVjRsNHNWbWtSdUMzWjBMczRTN1UxYTg5V0VDMS9Nd2JqeDJ4TW80?=
 =?utf-8?B?V1JVdXJkdkVkbW15ZmRhU0k1R2Nhb0pJcnhVVmw2SnNNRWk4MnhEYWhlQWVo?=
 =?utf-8?B?VVNpYnlxVXpGSHhlbHBIVFdJZktaY3JuNC9UdXhwOXlQWVFTMSsyVkhXUllk?=
 =?utf-8?B?Q0hJWmxST055TGZVdVJ0STZIc1FYOTdUNmZpNG1FYlpxQTJZY1NsQlZxZmdF?=
 =?utf-8?B?UUlaalExVUpQL2toTEpDK2JML0loN20raXBRU0VKUGlDMUNVUWN3c2srU3lh?=
 =?utf-8?B?WWprYWlnalVjMTNKWGJUS2tlY040VjArUUE1S1haU0dsdEdBQTdBZ25xVVBY?=
 =?utf-8?B?NTR2V0Y0MTlDT3RHYTRYOXNsVWVHeittendxdTVuYWNqN3VqdTNUWUk3Q3Ux?=
 =?utf-8?B?SXdiRDNOSXg0UXg3U1JMUFVLTzh4WEZyTVJHSGU5VzJRRWM1ZHhkRVV4UUtS?=
 =?utf-8?B?aExIcVN0S0FDNlM5cDNKT0RodkZZWERCYkZRM2lMSzZTTnFnZjVvRjkwRU96?=
 =?utf-8?B?a3N3WmZLYmhIRzdNU1BSdXdJWk1LdUlnaTB6cHlURm9hSXR3blB5YUxta3Vt?=
 =?utf-8?B?cUw0K1RrZ0I3SzZ2TGg1T3crUHdqWXpxaE1QdnorbEVnN3UwNy9aNTUrNEpn?=
 =?utf-8?B?ZmFZWmVjUktRZEhWU1hOM3NOTUFOTVVzbDVTSnR3bTdmeU9xZUt4YVZkVHh0?=
 =?utf-8?B?eDB4Um5EL0hFWjBMRTlMaGJVcmhGVmJ1USt2RzBuYlBiR2pWUlgvN0tyZzY3?=
 =?utf-8?B?WTh0WWszdXM1UUtZL2JlVmk1cloxTXNLbFdPSUhEZmw0VFNqbzR4aS9EQlNm?=
 =?utf-8?B?Vk5SdStkaEN2OTBqV2U3eS92RFIwMzRNdHpFTzlaVU84OTk5VU4wU0N5OUtK?=
 =?utf-8?B?Ymw3d09yYmVOd25jYkxBRGhBdHpRMEcvMTFxL3ptd1B4OTVFUVNwbjdhbjFV?=
 =?utf-8?B?OGd2OHgzTys4alZVMUdVSkZUK1lpZ1lxRHRVb0tkdjdTbUVGWUZjOXBXOXZO?=
 =?utf-8?B?NW16U3JMSDZ1dDZ3YlUvMUhRNzV2ZklxcmdMVFpnbG1FY2xXUDhEeVFVT1VM?=
 =?utf-8?B?YWFuMjNqMy8wSmlVNVBZNFZUbnZBQWtKUVVkK1J4T0YvL21NTEwzclI4eE9j?=
 =?utf-8?B?ZE0xbCtXNHNnSDJBYlJBUi9ySUtaVTl2b1JnVVBOeVU0d2Q0VHVibXRkSFYr?=
 =?utf-8?B?bEZyT0dWbDJOeEdDUXBZUlBqODJqQ2tlSUJNUXlYQUNoN01EUDFZUWhMRmxE?=
 =?utf-8?B?U3UzWjlQOFRSUDlEQ3huamFqSVlFelUyUVN0N0JjYmEwUEh6ZEZIRVlid2dX?=
 =?utf-8?B?Z3VlbVRJSFloeHNnN0NjOHcycGxocGpTbm50VkNDK1VVKzNSVThkYnFHL1R5?=
 =?utf-8?B?Z3Nrb1JvcHhPSUpnOEsvQ0R1UW1EWm4zSy83MnUvRDFlckJnbU5iUkdTL1Zo?=
 =?utf-8?B?dnMxSGhPcTEwaHczSnlkTlJybE9FTjA1S1V1Y0hSamowQ3hvT00rcnkzQnBF?=
 =?utf-8?B?Z1pucEZDaitNMGdyVnhud2hCNlE4Z3NrckFvM05HWDJEN1ZPTU5PeXlFVzBp?=
 =?utf-8?B?U2ZHV3dFczhseWVKcDlxQVpWWDRHU3Fyb2dqalh3dVR1czU5NGFxc2RnSUgx?=
 =?utf-8?B?bS8rZGNCaFgrV2Q5V1A5YXNadmdkb2Nib0xhVVBFV0FvVm0zNmZ1RVdWSnZK?=
 =?utf-8?B?SG5GVXVtRHI5TmNFcWhYUVB1WHRNMUJabE9ub2pTOFNqV21FaS9LSnJJaGRz?=
 =?utf-8?Q?VubqUFavccdxxVi4PJpEmzIv7?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3fc4ce78-3616-4774-d7ca-08dcbad9140f
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9192.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2024 14:14:28.8547
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: djM9Viccsanx2rBIrCp+MJOm1vVGwRBzOWMA7VXTb3zcUcMPJ32QZCkQFctCCGSj44aBDQ7nkInSGYijX5+EPQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB9560
X-Proofpoint-ORIG-GUID: SL3uxOLmUn_ajVzSBiNX4Z50ZnPqdIEd
X-Proofpoint-GUID: SL3uxOLmUn_ajVzSBiNX4Z50ZnPqdIEd
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16
 definitions=2024-08-12_04,2024-08-12_01,2024-05-17_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 suspectscore=0
 lowpriorityscore=0 clxscore=1015 priorityscore=1501 mlxlogscore=999
 adultscore=0 mlxscore=0 impostorscore=0 bulkscore=0 malwarescore=0
 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.19.0-2407110000 definitions=main-2408120105

12.08.24 15:24, Alejandro Vallejo:
> On Mon Aug 12, 2024 at 10:58 AM BST, Jan Beulich wrote:
>> On 12.08.2024 11:40, Sergiy Kibrik wrote:
>>> 09.08.24 13:36, Alejandro Vallejo:
>>>> On Fri Aug 9, 2024 at 11:09 AM BST, Sergiy Kibrik wrote:
>>>>> --- a/xen/arch/x86/cpu/Makefile
>>>>> +++ b/xen/arch/x86/cpu/Makefile
>>>>> @@ -6,10 +6,10 @@ obj-y += amd.o
>>>>>    obj-y += centaur.o
>>>>>    obj-y += common.o
>>>>>    obj-y += hygon.o
>>>>> -obj-y += intel.o
>>>>> -obj-y += intel_cacheinfo.o
>>>>> +obj-$(CONFIG_INTEL) += intel.o
>>>>> +obj-$(CONFIG_INTEL) += intel_cacheinfo.o
>>>>>    obj-y += mwait-idle.o
>>>>> -obj-y += shanghai.o
>>>>> +obj-$(CONFIG_INTEL) += shanghai.o
>>>>
>>>> Why pick this one too? It's based on VIA IP, aiui.
>>>
>>> shanghai.c and intel.c both use init_intel_cacheinfo() routine, so
>>> there's build dependency on Intel code.
> 
> My point is that the use of Intel functions on Shanghai and not Centaur is
> accidental. If shanghai goes under Intel so should Centaur (imo).
> 
>>
>> Yet Shanghai isn't as directly a clone of Intel CPUs as Hygon ones are
>> for AMD. So at the very least you want to justify your choice in the
>> description. After all there's also the alternative of having a separate
>> SHANGHAI Kconfig setting, which would merely have "select INTEL" or
>> "depends on INTEL".
>>
>> Jan
> 
> That's one option, another is for the Kconfig options to explicitly state which
> vendors they apply to. I'd be fine with either. It's less fine for CONFIG_INTEL
> to cover a VIA derivative and not the other.
> 

I think I'll go with separate kconfig options -- for Centaur, Shanghai & 
Hygon, as we already got a separate submenu for CPUs & everything.
Also this way it's more up to the task of config tuning.

Thanks for clarification!

    -Sergiy


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 14:34:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 14:34:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775614.1185833 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdW84-00062P-O6; Mon, 12 Aug 2024 14:34:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775614.1185833; Mon, 12 Aug 2024 14:34:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdW84-00062I-Lf; Mon, 12 Aug 2024 14:34:36 +0000
Received: by outflank-mailman (input) for mailman id 775614;
 Mon, 12 Aug 2024 14:34:34 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KPBI=PL=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sdW82-00062C-KE
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 14:34:34 +0000
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com
 [2a00:1450:4864:20::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fd5399d1-58b7-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 16:34:32 +0200 (CEST)
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a6265d3ba8fso365026766b.0
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 07:34:32 -0700 (PDT)
Received: from localhost ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80bb0e124bsm235876566b.61.2024.08.12.07.34.31
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 12 Aug 2024 07:34:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fd5399d1-58b7-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723473272; x=1724078072; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=5WI2O/JEw/2cmYdCIjcKiyYFHJkpvo0tYHK+TgeV4Ww=;
        b=T+o3GEJS1qSQt4GXFB2B34rVt0SL1ocyJadNvkD/VyvJiabu0UJvHHyFoi1M+gvjsv
         sPb+TBH5dhMET5c+59HR60heqDu8Y8zyfK5mJ8NIaChdjfLcPdEebIjMp0mtkyJNSqcD
         I/2rgV0dHZHN2E/98o40aPSJmJuuTFFDrPLDI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723473272; x=1724078072;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=5WI2O/JEw/2cmYdCIjcKiyYFHJkpvo0tYHK+TgeV4Ww=;
        b=FkAqkMx29G4ecuhvpgeHUI2wwruvCeDLnOg2zecDKYKPIjLWh93rDRwzHeHfHQwwBE
         xrsdI3Pc3oT2zF96Ffoh/IjDWasV9Phf5anueImVAAOFLtwskpQsyL3Dm+BPh7Pj3ZOu
         Tw+8X7UzwAa7EN4prXG8c+f06puo4ryWW79Rl8RX0gGsqcryTdNwKot4W6+ijJXPa+7T
         rOg1ClK0ClgWxerm5WFFHBL2NGs+2nIVtEFjNki7d9nZbZWlZW2m0Z7Cvy0ygfpDOgHg
         9IDKtd5rt8qhNbU7Oxs0k5AX52oXcByAQ4phvKeDC8/RbP1YGAM/E6tDZb51TnC/5VAG
         6D9A==
X-Forwarded-Encrypted: i=1; AJvYcCVmO00k7IFUpH0TXHVlEp+Ks3dnDxCirCkDVTvb5vtSjXUUR/6iStRK1JBYDyqSfK3icGaA3HSsk1yXuTpeiHXR9G+k3oa1T+3LsTEXlGA=
X-Gm-Message-State: AOJu0Yycss/YP8BbjNYVQlAtVFZOEzOtwiHJ7IAbBBsFSgfdl2pQQM6h
	OjCZM3vqe+ESlSp3sIq3H3+lnGtziZnrrGy9i8D+xx7hUTPxOFjUPl62G7T06Mo=
X-Google-Smtp-Source: AGHT+IEP9UT2arazht5Q4saQ5irCg0pUPRMFyTje4XJpyjY3u5GetlxHQdNq+YJXgo4qXReaz2fhTQ==
X-Received: by 2002:a17:906:6a17:b0:a7a:952b:95ae with SMTP id a640c23a62f3a-a80ed2cba3bmr33616166b.47.1723473271820;
        Mon, 12 Aug 2024 07:34:31 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Mon, 12 Aug 2024 15:34:30 +0100
Message-Id: <D3E0A9YVBOAD.LLLJMNX31BG6@cloud.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
 =?utf-8?q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Subject: Re: [PATCH] x86: slightly simplify MB2/EFI "magic" check
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Jan Beulich" <jbeulich@suse.com>, "xen-devel@lists.xenproject.org"
 <xen-devel@lists.xenproject.org>
X-Mailer: aerc 0.17.0
References: <f2186827-62e6-4b24-8a6c-0c2a9499c232@suse.com>
In-Reply-To: <f2186827-62e6-4b24-8a6c-0c2a9499c232@suse.com>

Hi,

On Thu Aug 8, 2024 at 9:49 AM BST, Jan Beulich wrote:
> A few dozen lines down from here we repeatedly use a pattern involving
> just a single (conditional) branch. Do so also when checking for the
> boot loader magic value.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> I further question the placement of the clearing of vga_text_buffer,
> just out of context: Shouldn't that be placed with the increments of
> efi_platform and skip_realmode? Or else is the terminology in comments
> ("on EFI platforms") wrong in one of the two places? In the end, if we
> are entered at __efi64_mb2_start but the magic doesn't match, we simply
> don't know what environment we're in. There may or may not be a VGA
> console at the default address, so we may as well (try to) write to it
> (just like we do when entered at start).

It's fair to assume we're in 64bits, and in that situation it's also fair t=
o
assume the text console is long gone (pun intended). Seeing how this would =
be a
boot protocol bug, I think the most reasonable thing to do is to leave a po=
ison
value in RAX and then hang (deadbeef..., badcafe..., take a pick). That wou=
ld
point the poor sod debugging this to the right part of the code.

Though this is a largely theoretical issue that I can't see happening in
practice.

>
> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -233,13 +233,11 @@ __efi64_mb2_start:
> =20
>          /* Check for Multiboot2 bootloader. */
>          cmp     $MULTIBOOT2_BOOTLOADER_MAGIC,%eax
> -        je      .Lefi_multiboot2_proto
> =20
>          /* Jump to .Lnot_multiboot after switching CPU to x86_32 mode. *=
/
>          lea     .Lnot_multiboot(%rip), %r15

I don't think there's much benefit to this, but it would read more naturall=
y if
lea was before cmp. Then cmp would be next to its (new) associated jne.

> -        jmp     x86_32_switch
> +        jne     x86_32_switch
> =20
> -.Lefi_multiboot2_proto:
>          /* Zero EFI SystemTable, EFI ImageHandle addresses and cmdline. =
*/
>          xor     %esi,%esi
>          xor     %edi,%edi

Cheers,
Alejandro


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 14:44:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 14:44:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775623.1185844 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdWH6-0008Ef-JB; Mon, 12 Aug 2024 14:43:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775623.1185844; Mon, 12 Aug 2024 14:43:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdWH6-0008EY-G8; Mon, 12 Aug 2024 14:43:56 +0000
Received: by outflank-mailman (input) for mailman id 775623;
 Mon, 12 Aug 2024 14:43:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=PyEi=PL=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdWH5-0008ES-TM
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 14:43:55 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4bca99e2-58b9-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 16:43:53 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a7a9185e1c0so331664166b.1
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 07:43:53 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80bb0e045asm233560066b.52.2024.08.12.07.43.52
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 12 Aug 2024 07:43:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4bca99e2-58b9-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723473833; x=1724078633; 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=xVUo5zWUWLi4Fd1ntyxA9JdIVlguUFpiDsoPnszxioM=;
        b=WBLl6IDi2TnQ+32OJXeCsTgj1PnbLTgFD0bz3COL7o/4goA7QAlp4PXy+kVl5sEcGB
         dLjNrnTOpsW2Uh/qIzuJ66itipqB0NN2BMNUk1avJ/kqrVFIUWjQ1MRpkNRGjrQo8x9J
         qgyKJSBc1CikQqvUJhKUHwJEuLQsFqHSgShPTQzUxMpsVsll/6F777x1PU1ewWJVr4Wb
         5V9l/7UuFpsBibsf5mi1ihMwU2lb8/3HQNd7XQHimvfDj00OnN7fvaBjI8PI0LrW0mFI
         W1dKTKmf5w3ybjPE82LCA14d0DAF23PKiSTYOJJOPQ36TgvyRGb0raIhgjhFjT4I1GW1
         vFjQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723473833; x=1724078633;
        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=xVUo5zWUWLi4Fd1ntyxA9JdIVlguUFpiDsoPnszxioM=;
        b=lQY5zoDYg/OtY/syyyqPnwj40e6KPMgFFS8v1XMoqOHPTKgdvfTky7Xf97Tq1FdCEG
         6e/sfQOeyDiLenhmixj+zm7R0ziWL8vaBwf4o2mSYf2yCM7jC5vYD0rCRT7k853KUjXx
         FFxp91Pg2eNwcQ3162rBdJehlwTdS2gwLsNMUaEkK2MF1V9Wut1oMdl9KKuJGTN77dQ/
         RIS12S3agOSFx+X86u+e0neHxiNAaWrmeHIr4olLZDlWUEH868criMZvSMR4yX4DaFOE
         PlgneNZ4+GPtTsuBE6ECDzNbDn/DyQWJK32C3UfWmvNBfUD01b6nXru8PtoRpRlM4nti
         aDpQ==
X-Forwarded-Encrypted: i=1; AJvYcCWru4KCZIwomBSAAgrn2y8gkd1RcEmY9XMl8zttD5TZRKypD2yBUPM67bpUgACGGjnov5YW6pt2iOsmmSeaYevrGBTMQDGGfQ5cSR8r8iM=
X-Gm-Message-State: AOJu0YyP6fPbbgmTEEnlw0TQ3mKAsJIYj4sqLtGMdnaAgRwVRObJZ7Oo
	58FytcfLF3+H+lCGKjd86Ke7wmwZgQBR0oSgUgyEMScokpPqpHTJTYpvF4DPZQ==
X-Google-Smtp-Source: AGHT+IGNcS7CqhGmQAJ+3jT8p9H+HJMEGxmx1tjpLSW/e4+rNOWz6wzN1PmAom7MyzEiHnr2N4scvA==
X-Received: by 2002:a17:907:94ce:b0:a77:e1fb:7de9 with SMTP id a640c23a62f3a-a80ed1aafebmr33163066b.5.1723473833038;
        Mon, 12 Aug 2024 07:43:53 -0700 (PDT)
Message-ID: <53c6c9ba-de64-4e46-9e29-2e03a9d8224b@suse.com>
Date: Mon, 12 Aug 2024 16:43:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86: slightly simplify MB2/EFI "magic" check
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <f2186827-62e6-4b24-8a6c-0c2a9499c232@suse.com>
 <D3E0A9YVBOAD.LLLJMNX31BG6@cloud.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: <D3E0A9YVBOAD.LLLJMNX31BG6@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 12.08.2024 16:34, Alejandro Vallejo wrote:
> On Thu Aug 8, 2024 at 9:49 AM BST, Jan Beulich wrote:
>> A few dozen lines down from here we repeatedly use a pattern involving
>> just a single (conditional) branch. Do so also when checking for the
>> boot loader magic value.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> I further question the placement of the clearing of vga_text_buffer,
>> just out of context: Shouldn't that be placed with the increments of
>> efi_platform and skip_realmode? Or else is the terminology in comments
>> ("on EFI platforms") wrong in one of the two places? In the end, if we
>> are entered at __efi64_mb2_start but the magic doesn't match, we simply
>> don't know what environment we're in. There may or may not be a VGA
>> console at the default address, so we may as well (try to) write to it
>> (just like we do when entered at start).
> 
> It's fair to assume we're in 64bits, and in that situation it's also fair to
> assume the text console is long gone (pun intended).

How is being in 64-bit mode correlated with there being a VGA console?
(I question "fair to assume" here anyway. We're on a path where we know
something's wonky.)

>> --- a/xen/arch/x86/boot/head.S
>> +++ b/xen/arch/x86/boot/head.S
>> @@ -233,13 +233,11 @@ __efi64_mb2_start:
>>  
>>          /* Check for Multiboot2 bootloader. */
>>          cmp     $MULTIBOOT2_BOOTLOADER_MAGIC,%eax
>> -        je      .Lefi_multiboot2_proto
>>  
>>          /* Jump to .Lnot_multiboot after switching CPU to x86_32 mode. */
>>          lea     .Lnot_multiboot(%rip), %r15
> 
> I don't think there's much benefit to this, but it would read more naturally if
> lea was before cmp. Then cmp would be next to its (new) associated jne.

You did look at the pattern though that I'm referring to in the description?
Knowing that generally paring the CMP/TEST with the Jcc, I would have
switched things around. Yet I wanted to make things as similar as possible,
in the hope that be(com)ing consistent would make it easiest to get such a
minor change in.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 14:49:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 14:49:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775631.1185854 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdWMR-00012V-4s; Mon, 12 Aug 2024 14:49:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775631.1185854; Mon, 12 Aug 2024 14:49:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdWMR-00012O-21; Mon, 12 Aug 2024 14:49:27 +0000
Received: by outflank-mailman (input) for mailman id 775631;
 Mon, 12 Aug 2024 14:49:26 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdWMQ-00012E-3t; Mon, 12 Aug 2024 14:49:26 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdWMQ-0006ef-04; Mon, 12 Aug 2024 14:49:26 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdWMO-0002Dd-Tg; Mon, 12 Aug 2024 14:49:25 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sdWMO-0008Ky-TA; Mon, 12 Aug 2024 14:49:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=J3k4H42CFGw89fa11saa9h7BWRwZ7Y2g5zAhXcZn6hU=; b=c+5sb7RSIR2O2ea0Vzq/pjX5Ww
	1HrFDTiN6bMjs/SAOXAp0IUYyKeWKRzJURjq8Y/bx/m8JHZS/oIe4jF/birxt8XnnQOs41+cjRXvA
	XGHXb3xWazLu++YsjxtSwXL1xVmOaeXFwbsmKEi6FdXUYbZsgKjZIP4+WXfTcNSQUoaI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187216-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187216: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=7c626ce4bae1ac14f60076d00eafe71af30450ba
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 12 Aug 2024 14:49:24 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 187214

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

version targeted for testing:
 linux                7c626ce4bae1ac14f60076d00eafe71af30450ba
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   26 days
Failing since        186925  2024-07-20 09:44:52 Z   23 days   50 attempts
Testing same since   187214  2024-08-12 00:14:05 Z    0 days    2 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 15:16:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 15:16:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775642.1185864 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdWmk-0006Bn-7v; Mon, 12 Aug 2024 15:16:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775642.1185864; Mon, 12 Aug 2024 15:16:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdWmk-0006Bg-4T; Mon, 12 Aug 2024 15:16:38 +0000
Received: by outflank-mailman (input) for mailman id 775642;
 Mon, 12 Aug 2024 15:16:36 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=PyEi=PL=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdWmi-0006Ba-NI
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 15:16:36 +0000
Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com
 [2a00:1450:4864:20::230])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dc4636e3-58bd-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 17:16:34 +0200 (CEST)
Received: by mail-lj1-x230.google.com with SMTP id
 38308e7fff4ca-2f16d2f2b68so62783081fa.3
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 08:16:34 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80bb213171sm239934166b.145.2024.08.12.08.16.32
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 12 Aug 2024 08:16:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dc4636e3-58bd-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723475793; x=1724080593; 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=vJlF/1aluWYLhlaTudjdloSWaJM08MCh0Ia8vV9VbVI=;
        b=YzMXPhgfnMfGOONAJpJEciTLusT1onBTQ7cvD6uRTPZ5kJH2ridZ+gSlJIw15Okvs8
         B3kBl8oFa6lSXS6rnXvW69PBNdsa6BkUyM442tlZmL3rvijuafd8+eBTC+6sX6NP9rWP
         fKda330Og6eJDek9805qJq7CuMngL0u1Pa5hyJ2cSqVFD749Idv4Zwdbj23KC5eEdjqo
         saCXj8ILG2PWgI18FPsjUxW1wwxY4FPK2O6WBjJCLUAYqyDiQT6Rof35x4SPTPkb91j9
         YQHLoy0KEz+qjgp5XV9BnOG2ujAGnaPw3EYt7Z5od4/ACUPUt7HrtHT2/152HbmGFWnO
         xFUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723475793; x=1724080593;
        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=vJlF/1aluWYLhlaTudjdloSWaJM08MCh0Ia8vV9VbVI=;
        b=PyhBrBGr2DBH+wEHGCODhcNC0KexxQQ8e13GpycY5D6DaiiCLha7al5bCAqz6Q3jrY
         1D7CBXMVAjhcn5VC6GhgDkZCUhQvXlcQewSmCVQImx7Tb1gWZZ/nThYukVdLsbOIQCzQ
         u5SlvO1rVnUsxNM0BOtHUb0WaoaumyQ+1aj7oKPOOfPW9yy+6K8X70j7MQZT9VFIO9hI
         cIoOvkRVKk9SKnpWIjI3Tuz9rsJ25fVCUPHPuHMjyI1Lh4z+FwM9P1ozb6nIEUliUskb
         fODsOfdW5OU77aAvzokAn0qx5TP8WgsQeL7GGZ1cn5ZBpd+pmaKl7Jqwn172jHMtX1pp
         DPlA==
X-Forwarded-Encrypted: i=1; AJvYcCUVfQ3eg3HvVe50XdZu7jiJdlGSeMie2IAAVQMLi0tMCDfwpVl1rwWjaYVYTwKwcmDvMqezohBS7nDFhp0DRKV9kN8PH0fQES/z99B4Kss=
X-Gm-Message-State: AOJu0YyMHvFxFS1qaXJPQEcINuLJlvfDgdX4s84TnC+6dK1mrvIV9Ten
	pt+aygjdAZgqahdgp4mGR5rMDqnlN9X/T4JkbhoccupywEsM3ynzbLNGgDSKQw==
X-Google-Smtp-Source: AGHT+IGTs5Buaeky/TI2RHFJk430ODM/lI1hFqOJ3doJTTdxxKXMUvxOFY7SL/u+tfbw163H5wjbdA==
X-Received: by 2002:a2e:8ed3:0:b0:2ef:1ba9:dc5a with SMTP id 38308e7fff4ca-2f2b715cb8cmr5919481fa.28.1723475793226;
        Mon, 12 Aug 2024 08:16:33 -0700 (PDT)
Message-ID: <dea252cf-e853-4eab-a71a-9575f32e9381@suse.com>
Date: Mon, 12 Aug 2024 17:16:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/2] x86/fpu: Combine fpu_ctxt and xsave_area in
 arch_vcpu
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240808134150.29927-1-alejandro.vallejo@cloud.com>
 <20240808134150.29927-2-alejandro.vallejo@cloud.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: <20240808134150.29927-2-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 08.08.2024 15:41, Alejandro Vallejo wrote:
> --- a/xen/arch/x86/domctl.c
> +++ b/xen/arch/x86/domctl.c
> @@ -1344,7 +1344,10 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
>  #define c(fld) (c.nat->fld)
>  #endif
>  
> -    memcpy(&c.nat->fpu_ctxt, v->arch.fpu_ctxt, sizeof(c.nat->fpu_ctxt));
> +    memcpy(&c.nat->fpu_ctxt, &v->arch.xsave_area->fpu_sse,
> +           sizeof(c.nat->fpu_ctxt));
> +    BUILD_BUG_ON(sizeof(c.nat->fpu_ctxt) != sizeof(fpusse_t));

While it may seem unlikely that it would change going forward, I think
that such build-time checks should make no implications at all. I.e.
here the right side ought to be sizeof(v->arch.xsave_area->fpu_sse)
even if that's longer.

Personally I also think that BUILD_BUG_ON(), just like BUG_ON(), would
better live ahead of the construct they're for.

Same again in at least one more place.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 15:23:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 15:23:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775650.1185874 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdWtd-0007k3-0t; Mon, 12 Aug 2024 15:23:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775650.1185874; Mon, 12 Aug 2024 15:23:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdWtc-0007jw-US; Mon, 12 Aug 2024 15:23:44 +0000
Received: by outflank-mailman (input) for mailman id 775650;
 Mon, 12 Aug 2024 15:23:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=PyEi=PL=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdWtb-0007jq-Ay
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 15:23:43 +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 dafdc32b-58be-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 17:23:41 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-52efd8807aaso5844376e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 08:23:41 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80bb1cd2a8sm238536666b.117.2024.08.12.08.23.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 12 Aug 2024 08:23:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dafdc32b-58be-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723476221; x=1724081021; 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=qhIYaTMAVJpgePzorqAz+VjGruhNy9tnxPZ1FYjL5e0=;
        b=IQEYmJjddP93X+g053rnl8TogophbyvHkgjaQndiFsivPA04DpJngaMrPZXpQ9D236
         lU3c2AkKHCRlJwA+C19MVgw8UpLXnUXRi+B1VtOJIaZrZ+Iqjw6Y0yGAmHOgvmlBnN5o
         GUuMUg4xnOGA4aciDY4KsODQtTn9sCuEigf5oFetxIsfvgK4nMEWJHDmmWmy9/QrZAWu
         CUE7K6LzwIMrSkrp8aGLQMvDBX+QhbD4tHImsjQc4nlacFKulbFimNCvDAmVe2J2jLTY
         ljTcR5CHjFvzJNIiNhZLe5ucNZmfcv0TA1q6oyMYxsxeAF5+H98QRK5J1+HGKAU3TnrI
         7EtA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723476221; x=1724081021;
        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=qhIYaTMAVJpgePzorqAz+VjGruhNy9tnxPZ1FYjL5e0=;
        b=wMvrft2EhSJU03aMa68b6N4ksdk5ifb7g7LJjG5RPmJYz85M/zGAW60DF2Q4UlSri5
         vizwqRrJwj6f3LY4+TuQVbCiN8FuyhJY2QIdK6RZvw2AVW5gsDlvUzltbBz8w+J3btRb
         2GuXOMZ/brvtM1m3i4Oz73noOM+xIyN3jWdkfU8elZZBEpEQUjh+j0j9Fd2FvbF7iyb7
         zMgaqAJUnaHm5Xw3BHHCkr9EmFZq9mInhG5suFizHwCpxBxpwBlhKTQLM6d1plU1hUfm
         LXJZBA7cFfOS8+OyYwOJysG1vcZWKA7EGBR6Ebl+mnXo+eSzmoZVejTsyHhbX3IvqnlH
         1heQ==
X-Forwarded-Encrypted: i=1; AJvYcCUka9u+h7A7HnEGiQNCjQLPIkqpuHu+29CT3bTq1z0K+nr6vtkCmMesAQh7QRrPH1Gj5/hWO+wnPEI=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzbhbsr2acLBmS4/4lsd5tgNg5xgDpc1+1EWkw5RFfH8niB/Kit
	6kFnGn4esAe6ym3HKj3DxwCIegl01nLB+fKA/cCwVCchrAiFxrZCjykb6ciYNg==
X-Google-Smtp-Source: AGHT+IFMEtYoxOESwPbTH52lSLHbxRrjOF7w4ReMkt5csNmk/I/Q5vf0LIxb9iW6VoUfPhoTudKBCQ==
X-Received: by 2002:a05:6512:239c:b0:52f:368:5018 with SMTP id 2adb3069b0e04-5321368447dmr415174e87.43.1723476220637;
        Mon, 12 Aug 2024 08:23:40 -0700 (PDT)
Message-ID: <7f001aa8-ee42-4617-8fc4-e4a45d4228e2@suse.com>
Date: Mon, 12 Aug 2024 17:23:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/2] x86/fpu: Split fpu_setup_fpu() in two
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240808134150.29927-1-alejandro.vallejo@cloud.com>
 <20240808134150.29927-3-alejandro.vallejo@cloud.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: <20240808134150.29927-3-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 08.08.2024 15:41, Alejandro Vallejo wrote:
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -1164,10 +1164,25 @@ static int cf_check hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
>      seg.attr = ctxt.ldtr_arbytes;
>      hvm_set_segment_register(v, x86_seg_ldtr, &seg);
>  
> -    /* Cover xsave-absent save file restoration on xsave-capable host. */
> -    vcpu_setup_fpu(v, xsave_enabled(v) ? NULL : v->arch.xsave_area,
> -                   ctxt.flags & XEN_X86_FPU_INITIALISED ? ctxt.fpu_regs : NULL,
> -                   FCW_RESET);
> +    /*
> +     * On Xen 4.1 and later the FPU state is restored on later HVM context in
> +     * the migrate stream, so what we're doing here is initialising the FPU
> +     * state for guests from even older versions of Xen.
> +     *
> +     * In particular:
> +     *   1. If there's an XSAVE context later in the stream what we do here for
> +     *      the FPU doesn't matter because it'll be overriden later.
> +     *   2. If there isn't and the guest didn't use extended states it's still
> +     *      fine because we have all the information we need here.
> +     *   3. If there isn't and the guest DID use extended states (could've
> +     *      happened prior to Xen 4.1) then we're in a pickle because we have
> +     *      to make up non-existing state. For this case we initialise the FPU
> +     *      as using x87/SSE only because the rest of the state is gone.

Was this really possible to happen? Guests wouldn't have been able to
turn on CR4.OSXSAVE, would they?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 15:27:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 15:27:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775660.1185883 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdWxL-0000W7-Fw; Mon, 12 Aug 2024 15:27:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775660.1185883; Mon, 12 Aug 2024 15:27:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdWxL-0000W0-D1; Mon, 12 Aug 2024 15:27:35 +0000
Received: by outflank-mailman (input) for mailman id 775660;
 Mon, 12 Aug 2024 15:27:33 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=y4aN=PL=bugseng.com=roberto.bagnara@srs-se1.protection.inumbo.net>)
 id 1sdWxJ-0000Vu-GB
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 15:27:33 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 63d8c3e6-58bf-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 17:27:31 +0200 (CEST)
Received: from [192.168.68.54] (unknown [78.211.194.87])
 by support.bugseng.com (Postfix) with ESMTPSA id ED2E24EE0757;
 Mon, 12 Aug 2024 17:27:28 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 63d8c3e6-58bf-11ef-8776-851b0ebba9a2
Message-ID: <8fe9413e-aa79-4ace-a322-7504c1c3e43d@bugseng.com>
Date: Mon, 12 Aug 2024 17:27:25 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [RFC PATCH] xen: Remove -Wdeclaration-after-statement
To: Stefano Stabellini <sstabellini@kernel.org>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>
References: <20240809130418.10431-1-alejandro.vallejo@cloud.com>
 <alpine.DEB.2.22.394.2408091217370.200407@ubuntu-linux-20-04-desktop>
Content-Language: en-US
From: Roberto Bagnara <roberto.bagnara@bugseng.com>
In-Reply-To: <alpine.DEB.2.22.394.2408091217370.200407@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 09/08/24 21:25, Stefano Stabellini wrote:
> Adding Roberto
> 
> Does MISRA have a view on this? I seem to remember this is discouraged?

As far as I know, there is nothing in MISRA C against or in favor of
mixing declaration with statements.  The only (slightly) relevant
guideline is advisory Rule 8.9 (An object should be declared at block
scope if its identifier only appears in a single function), which advises
to declare objects at function scope when this is possible.
The rationale of the same rule says, among other things:

   Within a function, whether objects are declared at the outermost
   or innermost block is largely a matter of style.

On the other hand, MISRA C recognizes that reduction of scope
is, all other things being equal, to be preferred, but there
are no guidelines similar to  -Wdeclaration-after-statement.
Rather, the point is "declare it at block scope, if you can;
otherwise declare it at file scope, if you can; otherwise,
declare it at global scope, if you must."
Kind regards,

    Roberto

> On Fri, 9 Aug 2024, Alejandro Vallejo wrote:
>> This warning only makes sense when developing using a compiler with C99
>> support on a codebase meant to be built with C89 compilers too, and
>> that's no longer the case (nor should it be, as it's been 25 years since
>> C99 came out already).
>>
>> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
>> ---
>> Yes, I'm opening this can of worms. I'd like to hear others people's
>> thoughts on this and whether this is something MISRA has views on. If
>> there's an ulterior non-obvious reason besides stylistic preference I
>> think it should be documented somewhere, but I haven't seen such an
>> explanation.
>>
>> IMO, the presence of this warning causes several undesirable effects:
>>
>>    1. Small functions are hampered by the preclusion of check+declare
>>       patterns that improve readability via concision. e.g: Consider a
>>       silly example like:
>>
>>       /* with warning */                     /* without warning */
>>       void foo(uint8_t *p)                   void foo(uint8_t *p)
>>       {                                      {
>>           uint8_t  tmp1;                         if ( !p )
>>           uint16_t tmp2;                             return;
>>           uint32_t tmp3;
>>                                                  uint8_t  tmp1 = OFFSET1 + *p;
>>           if ( !p )                              uint16_t tmp2 = OFFSET2 + *p;
>>               return;                            uint32_t tmp3 = OFFSET3 + *p;
>>
>>           tmp1 = OFFSET1 + *p;                   /* Lots of uses of `tmpX` */
>>           tmp2 = OFFSET2 + *p;               }
>>           tmp2 = OFFSET2 + *p;
>>
>>           /* Lots of uses of tmpX */
>>       }
>>
>>    2. Promotes scope-creep. On small functions it doesn't matter much,
>>       but on bigger ones to prevent declaring halfway through the body
>>       needlessly increases variable scope to the full scope in which they
>>       are defined rather than the subscope of point-of-declaration to
>>       end-of-current-scope. In cases in which they can be trivially
>>       defined at that point, it also means they can be trivially misused
>>       before they are meant to. i.e: On the example in (1) assume the
>>       conditional in "with warning" is actually a large switch statement.
>>
>>    3. It facilitates a disconnect between time-of-declaration and
>>       time-of-use that lead very easily to "use-before-init" bugs.
>>       While a modern compiler can alleviate the most egregious cases of
>>       this, there's cases it simply cannot cover. A conditional
>>       initialization on anything with external linkage combined with a
>>       conditional use on something else with external linkage will squash
>>       the warning of using an uninitialised variable. Things are worse
>>       where the variable in question is preinitialised to something
>>       credible (e.g: a pointer to NULL), as then that can be misused
>>       between its declaration and its original point of intended use.
>>
>> So... thoughts? yay or nay?
> 
> In my opinion, there are some instances where mixing declarations and
> statements would enhance the code, but these are uncommon. Given the
> choice between:
> 
> 1) declarations always first
> 2) declarations always mixed with statements
> 
> I would choose 1).
> 
> One could say that mixing declarations with statements should be done
> only when appropriate, but the challenge lies in the subjective nature
> of "when appropriate." Different individuals have varying
> interpretations of this, which could lead to unnecessary bikeshedding.
> 
> For these reasons, I do not support mixing declarations and statements.
> 


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 15:29:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 15:29:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775667.1185894 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdWz7-00012S-SP; Mon, 12 Aug 2024 15:29:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775667.1185894; Mon, 12 Aug 2024 15:29:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdWz7-00012L-PR; Mon, 12 Aug 2024 15:29:25 +0000
Received: by outflank-mailman (input) for mailman id 775667;
 Mon, 12 Aug 2024 15:29: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=Zvba=PL=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sdWz5-00012E-UQ
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 15:29:24 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on2061f.outbound.protection.outlook.com
 [2a01:111:f403:2418::61f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a5997947-58bf-11ef-bc05-fd08da9f4363;
 Mon, 12 Aug 2024 17:29:22 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by DM6PR12MB4433.namprd12.prod.outlook.com (2603:10b6:5:2a1::20) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Mon, 12 Aug
 2024 15:29:17 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7849.021; Mon, 12 Aug 2024
 15:29:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a5997947-58bf-11ef-bc05-fd08da9f4363
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=AZwEOp2MT/ZZf/lYOlXa+8U2/DTs/7/ihe6qOLPHSAbm7NJ6zzQy7sByAfCvx83S1IQTwtZO9br+6T7i7+37R7lAjB7lHOkQbSi+EDQl/Z9G3gLvgZSXK6RRFPavUzQSahebfKPQni3klNuizxZlVRiKNlkpd4UT8S7jfxLM1sfEGbYXqGEID29c/rpzniTtbhbmyeA9gSXgrS1GdYhfama5DUjLx+mYDjVRrxmtwPJ6DFH2psIlYlb/KnA1ioO7gK4SwRUBJ3MJabkZD5Rd8t/xPQ5PvcxbvnIlATUtMdm2TkHytPsuU2E//8Ow2hdvt3b0bNNo/tlu9gkZP1XPAQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Y/Pyqx72+rNdyVv2ciWhmulfauCoIWBrhRr7N3Qtwww=;
 b=bjurMallLpmFaUGb0tS9HKVqHhDw0sRzdXDqlLiNwo6o3tUSrBcEsdKmndjGweVWCZz19AbdEGoRKKFHT1lZSCXO8KLzlEUgtYh5R3KARR+hgaHZ47+z/6di0Huoe2yzB5cYDmWqfZCao3Y+5Dks7ETwjMtHCLlDt4p+O1esKIG1uwBrzgwMmsQyg6tSLDz2g/dxRoCVQGVifuTuIpr1e7Kqmyr2Hvy70/YhGNdioBELi9pAkd/4jw6NZqOb7FzL3n3oqKRsmKgWCRPT8qbzqQYHFbxsvdIR9zUW6DWanqXz702omPBJ8/wCirAilpo/Bvj5qun0gGkiZOv6NX+0UQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Y/Pyqx72+rNdyVv2ciWhmulfauCoIWBrhRr7N3Qtwww=;
 b=GfZzkNF+uwmIp6Tp6l3iCBNQFszLXmQIpVijolDW4+6d0mY1IHFPhjnfXupf1H3u761sRv86FBal/5/sg0lQO0YtbDNigZqyXK4hDNyUiZsCQAz0z5L3qyr72oMGDDtnnKaNxC1gZDf71DIZsVhWoXikSjknUNgU/jQtHDqhAVY=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <f421aac0-cd05-4203-be2f-ac6e98892c39@amd.com>
Date: Mon, 12 Aug 2024 16:29:11 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/4] xen: arm: Add a new helper update_boot_mapping()
To: Michal Orzel <michal.orzel@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, Volodymyr_Babchuk@epam.com, julien@xen.org
Cc: xen-devel@lists.xenproject.org
References: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
 <20240808120936.3299937-2-ayan.kumar.halder@amd.com>
 <8d1e7fbc-1220-4e09-bd99-eb8a4a17ea06@amd.com>
Content-Language: en-GB
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <8d1e7fbc-1220-4e09-bd99-eb8a4a17ea06@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO2P265CA0043.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:61::31) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|DM6PR12MB4433:EE_
X-MS-Office365-Filtering-Correlation-Id: bbbd2898-cfa9-4a29-4012-08dcbae38719
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?cHg1cUNCbjhWQjVmWTNQbUs4aSt5eVVWd3gyZEpxQ0d6WitTVHBra3ZiSUJv?=
 =?utf-8?B?ZkNld2QrazdzZzRkNWNWMDJXOEpmMjB6Q0oxN1FlUlVxSlIvcVo3OWFkRjRH?=
 =?utf-8?B?UHFQeXlSbXl0Ulh3VWlOVmNweWdaK3JUUjhtM2t6UThBVTRIZ2hsdVpzQ3ZG?=
 =?utf-8?B?S1FrWXYvU3B0RjI3cGhNWVhwSnhRZDFtK3Q1K0xuak9sSUFZWFBzZmJqZEdp?=
 =?utf-8?B?NkhUakV2WVB2amVUcVA5OUZRQkZqUDY0dWoyejRJQXd3NVlnb2dEaWc3S3A5?=
 =?utf-8?B?aXk5MzFkTTJNRmpxR2h2T2ZWWGJoNUVldnZQUkJtUW9VVFVndHV2ZUFKWlJ2?=
 =?utf-8?B?alM3RjBaL1J0Y1NDKy9DbVhOUHIwNmNWYW1ZcGE3NGFaSW5rc0pnWnBEbWtE?=
 =?utf-8?B?MHdKeSs5WE9sKy9vQUlCbk9Kanl1WmJiRlVTd0EreEl1cWJKZWVKL3lKdHBP?=
 =?utf-8?B?dTJTOHpEZ3hVK2k4bmtjVHd2c29hTkNqdFVQSENpN3luSUtMUGhCam45cnFG?=
 =?utf-8?B?b1MrM1c3SnBEUE9URzA0bG9oa0hOT1JkbEp4TEF6WFZwVm0wM3dhRXZ2UUkv?=
 =?utf-8?B?bG9LNUxybWEyeFBVTDRYM2g2aGNSUTlBVUs2NHRmbDdya0l4MEpBRXh5MG82?=
 =?utf-8?B?T1BFUitxaGdSYTZXWUZRcnVpSFMwRjZiNFhEendYbXRkd3ZlM044cEZNdE5F?=
 =?utf-8?B?YnNocW5ITG5sbHRpakMxZnZpeXJRbmtHa1Z3ZEpXL0E0VXM0SXNqcHRKVWJ0?=
 =?utf-8?B?SzRjdlRMNUJ5bklTd3psc2FVM2V4SzJTbzNMMGcwTHIzajRGNkxBUmpENmdk?=
 =?utf-8?B?RFR4ZmNKb2d6ZnpxSmVvdUwrUFk0Tm5jRStDRXFhdm9aK2lmTnAyNTNhb0Zm?=
 =?utf-8?B?S3FYV01FUW16WklhaVlVNGp1eHRvNmJoV2x5MG4yeUR1MnZhSWNLT1RXT1RP?=
 =?utf-8?B?Q1llWjErdE5ZM0NSNStOVGxheW53endlaFhjQ1psV25CVFpSTFY5cVBZK3JI?=
 =?utf-8?B?cG8xRlJMbmpTUUYvNFE2aE1sQzI3NlRFd0xpOGZDVS9QRmVFWFlYdGRIYjBS?=
 =?utf-8?B?dmF5VlFUQ1ZvakFPN3FBUSs0U0pTWUl1TDlDSTRQVm8yQWRQa3FheFJVWmFs?=
 =?utf-8?B?RTdKMmpTNFpwTXo2RXFHbVJpK3Q4Q00zRFFYT2pBUGNyRTBrZHdtRmYzV3da?=
 =?utf-8?B?UXM4Zjc4SUhabzVGcUMvYTFQUllrZkZTREtMUCtNMVJVOFVRa3hXRkNxZUFZ?=
 =?utf-8?B?Mk81UU84RFNjUEd5UzFkZGt4bDBEbDgrb2VHQml1K2NjZ1lRa2wxaFUzNnFw?=
 =?utf-8?B?azFWOEh5c244RnVvdW8wQlBTQmU2cHVENEVsTjlEem1SVTlaYXk1c1hiZUVT?=
 =?utf-8?B?dmpjck1sd3FCcEdvNGFDaUE2OW1CWlJLRFpJNGtFRGJ3ckJ0YWR6cVA2bC82?=
 =?utf-8?B?dm44QlRmR2ttUGpqQ3hHUW9BMlk5RWZzMUFZajN3bWNRNTl5dnV3N0dqTVp2?=
 =?utf-8?B?L2dPZ1UzT2N4a3V1czdHSnNQd2dUMGd4S2pSMXJMWGV0YytqdFpQNmI0d2pK?=
 =?utf-8?B?LzNteEkwSnYyODJkdlpmMTZYeXFXbWVOY01lQVhhdTZYdTBDWDhXSWJKcWZO?=
 =?utf-8?B?eFUrb284Q3hvckY2eVBycGZ0UW8zaW1MT2R6UExBdSszSXk1cnN5ejBjb2tX?=
 =?utf-8?B?TzZQUXRIMjZqeUxNNE1hMGVIZ0N3c3JpK2pjRW1TRllqd3d2NTdIS2FZaWNL?=
 =?utf-8?Q?g/3hhowUYSMuvnT8/drzfguOFaXofTcWMiD7Bok?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?STR4ZWpJdmZ6L2IwL3dFeHNtSFE4TGpHK2lKK1haMWcwTnVoaENhM1g5OTNm?=
 =?utf-8?B?cTk5STI5UGI1NU5vQ1p4Zno1cUV5Tkl3WG4xRGRvOU1LRGtZM2xINDE3Si9I?=
 =?utf-8?B?VmNNTzlLbldoU3FMaE1GSW5OZVpYc3FGdE5PR2hBRytESllVVVNzY3NvdWg1?=
 =?utf-8?B?aC80QXRJcGZtWTVtdGtBYWNKQUtyNUdUNU5HOW5kYzVPVm1kS2NFUng4MUlm?=
 =?utf-8?B?cDVKaExybUYxRnE2ZUVKbVYzTWk3MWZHWDFJV0lSVldBVk16RERmSUpHR1RU?=
 =?utf-8?B?aTNxSDBwVUpyeFdxSlFjUnJhS3hEWE9wWktndDFaeGlnZ0xSOXVmS0FnNUNE?=
 =?utf-8?B?Uk9hTjVablBoR2NnODY1UG9xaDB1SXZDZFI3Y0w0Y0s2REF0S1RZOXFXeWR3?=
 =?utf-8?B?YUpRQjlhQWRQSGQ3VEx3cHVNOGczRE5kMVBrdFJtN01VaUZiR25sMlhNbUxP?=
 =?utf-8?B?b3EyYTljbk9QWFpIT0V1OTI0UGFzN1NaZHdJcGVaeWNaMzI3RHJ0a3ZnVFVs?=
 =?utf-8?B?K0pFOHRZd0JOc0dQdW5tU3I5TjdIYXhwU1lqcmNqckE0R3A2alJOUW5odUNK?=
 =?utf-8?B?cHZHT0FoMFJZZHFDMCt3RFo5Z1FZenJBcGloK3JLeGxqdUlpVityNEVJUHhn?=
 =?utf-8?B?TEozcXcxc1JiVmkyd2trUTlQcEhiMG80enZqTWcyamp5d0tCQTZiczN2aEhM?=
 =?utf-8?B?dmtnNFNidnlyT1psdDBSTWJxNUJiYTB4ODdhSk1pS05MeS9vR3lvY2p2bUZh?=
 =?utf-8?B?aE1tV3pLem01RVA0YmgrRHdLdUl2cTdYR3pVa0QwdGEyOVZqeFdZS0UvWjJ6?=
 =?utf-8?B?dC9iRTVCcVBzVnlJN3FJTENmQXdCNFA0Z0ZJbkNqcncvZmJINWpoWFJNYlFs?=
 =?utf-8?B?V2lQbDFaOGJIRDBXNnlSUlIyVU8vczcxakoydlg0ckdQUUN2M1pXc0pDM0M3?=
 =?utf-8?B?eW5sd3lYc3Y1dmYxQnhaVGFhVmtUZFVvbG4vOVdJT2dIMENDYUVBU3ZHVVZZ?=
 =?utf-8?B?c1NwY24xWElydkFUUkEyajNqMk9rREFyQmRmYVU4SWhlYmVDaVhLaklpcDVs?=
 =?utf-8?B?MDh4ekllYURObE9oakcwbitSQXFPRDlIZmFIZ3VzSEY0djNtZGtqTGIzS3pi?=
 =?utf-8?B?MHpqdUxaVDRMS012dm9iWUVCSjI0WXdDMVhRSHBaSnFUckhiVUN6ZkVScFpn?=
 =?utf-8?B?b3ErLzJCRkY5VzhBQVo4UXNOalNvdk44cGs0YTBQWTRBdFA4d25UQVFKVFJo?=
 =?utf-8?B?UEw5OUdGRk0wczVIb0NsczNzQUFWbjRzVytsU3V6Q3JLRitwTlFOajVmNkRo?=
 =?utf-8?B?N1NRTC9ocjhMQWJNUmdWN1N4eUppRm9qM2c4dEdQaXMydHMrdjNNNEl0TzdY?=
 =?utf-8?B?SWtzZnU2N0dnRE1lNksrYkthd0JCRHB2WGR4Qm4rcW1QWENlRWJ1MWsrOUUw?=
 =?utf-8?B?UG16V3JObklYdk1QSG82c3RRSytqcFVUano0RFZLOTU0UlpqT0RaS2ZpUzlY?=
 =?utf-8?B?aUZNWGF0MlJtazc3b3Vod05Nc2M0M2FUMHBod21vQ081bVNQbVhnOHF6b2Q0?=
 =?utf-8?B?cjc4VnlPa09xU3k2cE9rL05aQkRUMlRmRkc0ZGJDQlV2clB5YXVLSklhU3M2?=
 =?utf-8?B?Q1IwM1dKbTZCK21vY2JHa3NHalJySEFGUVF5RGpmdVZvUys3NzhCc214cGFK?=
 =?utf-8?B?dW1MUnYxbVVGMG9pNS9XWGNzTml4ZGluajBaNW9JTVpVUmJJcjZ0MjI4azkv?=
 =?utf-8?B?b2gxanltd0pWY0ZzQWJWalRaVWdZU2E5K3lGa09lVEs0clJKSlFGRlVXT3Bh?=
 =?utf-8?B?M29yeklUb0ttMUJuVVNKQ29PcU04VlJLNFRmWmdEMEhiZTdpZkFJUVRXYWp6?=
 =?utf-8?B?OFBRUGVVcG9pOGJINXNmL2FpVlhGZHJtaTE4UkFmOUY4SHlvbnI3eDdVaXlk?=
 =?utf-8?B?YnEzVmIxaDFzT2NtenRlM3RxSTdFemtaU3NnRVlDbXVNUjR0TDBvbWZOYjJY?=
 =?utf-8?B?cit0MGRxSG1PZkVUMm5NN3NQdzI1a2pydXdUNFJndW1TMFpDNk12a3IybzQz?=
 =?utf-8?B?VC9wTEpTeUVUR1pTL0k4SkdIWjBteFE2TGVqU0pQQVlLYnArSFBqaXM2UE41?=
 =?utf-8?Q?XJm3lVbUuqmSwxQjeubhGs3wU?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bbbd2898-cfa9-4a29-4012-08dcbae38719
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2024 15:29:17.0986
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: HhI5lspE0rO1TDbMPWD6bV4bLwZQLiKs84jUJUjxsK0U0lM9zZ8DCVqHMcvdpIB6+2qeIhbgU3L7XDvhMN57bw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4433


On 09/08/2024 13:01, Michal Orzel wrote:
> Hi Ayan,
Hi Michal,
>
> On 08/08/2024 14:09, Ayan Kumar Halder wrote:
>> update_boot_mapping() invokes update_identity_mapping() for the MMU specific
>> code.
>> Later when the MPU code is added, update_boot_mapping() would invoke the
>> equivalent.
>>
>> The common code now invokes update_boot_mapping() instead of
>> update_identity_mapping(). So, that there is clear abstraction between the
>> common and MMU/MPU specific logic.
>>
>> This is in continuation to commit
>> f661a20aa880: "Extract MMU-specific MM code".
>>
>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>> ---
>> Changes from :-
>>
>> v1 - 1. Introduced update_boot_mapping() which invokes
>> update_identity_mapping() in MMU specific code.
>>
>>   xen/arch/arm/arm64/mmu/mm.c   | 5 +++++
>>   xen/arch/arm/arm64/smpboot.c  | 6 +++---
>>   xen/arch/arm/include/asm/mm.h | 2 ++
>>   3 files changed, 10 insertions(+), 3 deletions(-)
>>
>> diff --git a/xen/arch/arm/arm64/mmu/mm.c b/xen/arch/arm/arm64/mmu/mm.c
>> index 293acb67e0..72e089a339 100644
>> --- a/xen/arch/arm/arm64/mmu/mm.c
>> +++ b/xen/arch/arm/arm64/mmu/mm.c
>> @@ -125,6 +125,11 @@ void update_identity_mapping(bool enable)
>>       BUG_ON(rc);
>>   }
>>   
>> +void update_boot_mapping(bool enable)
>> +{
>> +    update_identity_mapping(enable);
> With your approach, update_identity_mapping() would only be called from within this file,
> therefore it should be marked as static and the prototype removed.
yes, agreed.
>
>> +}
>> +
>>   extern void switch_ttbr_id(uint64_t ttbr);
>>   
>>   typedef void (switch_ttbr_fn)(uint64_t ttbr);
>> diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
>> index a225fae64d..789f352ab6 100644
>> --- a/xen/arch/arm/arm64/smpboot.c
>> +++ b/xen/arch/arm/arm64/smpboot.c
>> @@ -112,18 +112,18 @@ int arch_cpu_up(int cpu)
>>       if ( !smp_enable_ops[cpu].prepare_cpu )
>>           return -ENODEV;
>>   
>> -    update_identity_mapping(true);
>> +    update_boot_mapping(true);
>>   
>>       rc = smp_enable_ops[cpu].prepare_cpu(cpu);
>>       if ( rc )
>> -        update_identity_mapping(false);
>> +        update_boot_mapping(false);
>>   
>>       return rc;
>>   }
>>   
>>   void arch_cpu_up_finish(void)
>>   {
>> -    update_identity_mapping(false);
>> +    update_boot_mapping(false);
>>   }
>>   
>>   /*
>> diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
>> index f6ba611f01..e769d2d3b3 100644
>> --- a/xen/arch/arm/include/asm/mm.h
>> +++ b/xen/arch/arm/include/asm/mm.h
>> @@ -426,6 +426,8 @@ static inline void page_set_xenheap_gfn(struct page_info *p, gfn_t gfn)
>>       } while ( (y = cmpxchg(&p->u.inuse.type_info, x, nx)) != x );
>>   }
>>   
>> +void update_boot_mapping(bool enable);
> The definition is only present for arm64. Shouldn't the prototype be moved to arm64 header?
Yes, I have replaced the prototype

update_identity_mapping() with update_boot_mapping() in xen/arch/arm/include/asm/arm64/mm.h

- Ayan



From xen-devel-bounces@lists.xenproject.org Mon Aug 12 16:02:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 16:02:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775677.1185903 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdXVD-0007lN-5q; Mon, 12 Aug 2024 16:02:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775677.1185903; Mon, 12 Aug 2024 16:02:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdXVD-0007lG-2r; Mon, 12 Aug 2024 16:02:35 +0000
Received: by outflank-mailman (input) for mailman id 775677;
 Mon, 12 Aug 2024 16:02:34 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Zvba=PL=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sdXVC-0007lA-IR
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 16:02:34 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on20627.outbound.protection.outlook.com
 [2a01:111:f403:2412::627])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 475ebfcf-58c4-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 18:02:31 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by SJ0PR12MB6902.namprd12.prod.outlook.com (2603:10b6:a03:484::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Mon, 12 Aug
 2024 16:02:27 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7849.021; Mon, 12 Aug 2024
 16:02:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 475ebfcf-58c4-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=NH4L/HhV5hcBOo4uUToN70VZgy0B+KeOASudh2WPbGvkAbCPdl1CVIDsdbRkzXXMdxfVLZW2q/1Qnw9BgQyEQ2R2brVxe2p9ir+DTcxhoZZxKIJ4k+dEnXx9htZ0kmbO6yIh/pkJyZxsyHOp5rWHk+ov+YNq7/E2E3gGIfuXMZnJ/4ZNUnEdGMDOw7xEPzlV1bNf9E6QK6qSdm5vxhgmUm6ZtJxE9udvjgB/QM5J7xA1r1eAagwJ5rqFufv+t6s2FH/YsC6EU6ZaAEPCB6P0j4TYJA734K1KRe9lvP9HJddPfXk4tfZyeb8r+fEdJWBaRwbxagdQ+Blba4brBfxBJQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=1zv7eTujslg9st9wOJERPujE+KPIV4AvxSQ14+oEERM=;
 b=aMYrpeDV1FBGFi17ZBVCxAbFdS5aoahm1XUw7FVi9RM4NGbFHoCE6xanU4dmul3VgUAF7kx4jMPUC9uyItFvtooNiOeyc5l6wONQ+SsVx59926ewxfKr/4L5sUnYKARKtsOW5bzpVAZit0faXtJ1EC9tScRxYQAG7PYPeOaySmmzhjcVO+0q5pmSL9uc9BNh1mBLqiMeHIvtmzj7F2NgijEpTmFVsTKSi/U6hbH/lOb2JHRrqCsn0g/b+h1LPo1FWfiiuD0KvkSE+TZnRYhJlJJ4N+nq7w29M4m25qCQvUE4MHIsjXQc6rA72R1A/EZBpMn44TGVoriCnPC4pHQ7lA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=1zv7eTujslg9st9wOJERPujE+KPIV4AvxSQ14+oEERM=;
 b=bkyr31hYW6zawqXEczYQiLBvASSQCS5sJZHq8Fai5ZMaq207SUoZwrlPioY6l2UJHXf95rAEdhOrRDk98Kqi+MtPKeUt0el/60ThAhvs3p5Xj8YEdp07uZkPBhCKcGSYwNv7bw/j6DCylx7hfA2SGUsmE3MB0+/Fe1RrtCsAVMg=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <c5c0a198-97ca-4779-8d1e-91d01b3650ff@amd.com>
Date: Mon, 12 Aug 2024 17:02:21 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/4] xen: arm: make VMAP only support in MMU system
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com,
 julien@xen.org
References: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
 <20240808120936.3299937-3-ayan.kumar.halder@amd.com>
 <bc643306-a41a-41bb-b7b7-b7c67f9e5bdf@suse.com>
 <3c491d8f-6180-46d7-a996-049df88a023e@amd.com>
 <724aa3bd-26a0-4a01-8be5-69fa838ee9ba@suse.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <724aa3bd-26a0-4a01-8be5-69fa838ee9ba@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0097.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:c::13) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|SJ0PR12MB6902:EE_
X-MS-Office365-Filtering-Correlation-Id: c80e13c5-1931-4001-9e86-08dcbae82985
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?cWw4aDN0N3JUNzNUUFlUY1JVQnRYdlFrVDVtNkM4azZHejhKOUExdDlibERt?=
 =?utf-8?B?Q05iNDBKSEVYc3NUWGJlQmpvWDN6NVZJWTRwT21sM2lldHkrZWdmTFZKYUlD?=
 =?utf-8?B?SVNQS0ZPcWFqNVdURlZCNmZJVVNSdmdhVWwvalNEM00wMndHVklVQkNFNm90?=
 =?utf-8?B?RzlSTmx4YVJuQVd5aG1uaDRleXRzOWY0WkxKd2RlMTNWZmNvYjFZMGlqdU5R?=
 =?utf-8?B?K1BFK29FTDc4SXpIU2MrU1FjSzQyOXpLTHd0Um5VZGxJZ3p3aHBweE52aGY4?=
 =?utf-8?B?dW90TTliWUVJQ2Uyem4rWkFPR0dVNC9tUjNGUUlXZTdHbHRzazFTdXQwZE5w?=
 =?utf-8?B?KzBlN0RqTjh5bHJNQU02enp3L0p0Y0djSzB3VWdRenBGSng1ZkpnVUlvZm0r?=
 =?utf-8?B?QlMwTzk2Zy8yQkk1Uk1ScUV6VXZkclltNzUxQW5FYmdBZVg3YlFLaStGTk5W?=
 =?utf-8?B?SjlVbENiTkpPUWdsc3JmVUhsM2lqRjdTOThiRENFZTQ2L1VBcW9yd0xZbFNN?=
 =?utf-8?B?TlQyQkZIZDMyZk9EMmVjQjdmcEF4MHRPeHg2RS9OSjd6YWxKLytJRVBJcWlR?=
 =?utf-8?B?ZUpmRUxVeXE1bG03U0tNRUZlbDRWQjRQbDVHSkZ0OEJuTHZUWVFHSk1ZWU9Y?=
 =?utf-8?B?QjFKVHRYWlJuczh3YkxCeDM1aTZrZ0RZR2o1VktQYTh0ckhJckwwanI5dm8v?=
 =?utf-8?B?UHVWRHZlVURob0NGZUpublpJeG1ac04rM3QxRUxwaWhHbDZjaHZvbzVlaGYz?=
 =?utf-8?B?ZEFQUFRBNVhEL3pwTGpTNkNLZUptQXdyeFVmMXYxZ0Z1VlJoTzl2WUNoLzhT?=
 =?utf-8?B?TmRhbS9UcGhCTDZyL05teDNXbUlFbmVnVkRtRksvMzBSV21WdllwRW9xNFdt?=
 =?utf-8?B?bW1HejZlbVI4R3puSVFvSmJ0cU9UK3hFMmx6SXZXM21kZk9jeGNVQ0lsalB3?=
 =?utf-8?B?SktZYmtPZnBXbmlaOVhtVEVNcE1PbXQ0eEQwdmdhQTYrN0trem9yZW5vTlNQ?=
 =?utf-8?B?TjRpWDZNZzFzZG15K2FrWDlLRHdEOXJxKzE0dG50S3h4aXE2dXZadWhLQWN0?=
 =?utf-8?B?K2RWZWRoOGk5MlVWT2hPWWhhQm4za1d6Q0NLb1hTT3hMb2JWWHpMT2ZpUnpR?=
 =?utf-8?B?c0tRVVpYcFB3YTlqSHA5ZVRvRXNJQWtzOE9WSEt5T1BmYTBaWnVlSDQrWUEy?=
 =?utf-8?B?S3JTZkk4eTZISTdjWVJMRHp4MVFFek1FM2ZYVGNWR3BpOU80ZzFPVyt0bEFM?=
 =?utf-8?B?dHVRTDZOVUhJdkFRY2t6YWM0TEVVcVpJMklvcStEME82M2o0ZGdGL3RycUlQ?=
 =?utf-8?B?VjZ5MDQ1WmpUN1lXd2N4TDYxUWJzOVhIQmZMVENtdVBLUjBySm91VVo5anZm?=
 =?utf-8?B?eWNnZzErZnJrTXhkbTFhQ0NZTXRPT1hrK3gwMzNHV0pDbFd2NTFYa3J0NXpD?=
 =?utf-8?B?Sk5oQy9LQi9seXM3eThJOEI1MGRGNGZxby8wOXh5dXl3ZDFrQjc4MTZEbDB5?=
 =?utf-8?B?WHNHV1I2cWRFanRLUnltL0I0N3ZvUXI0OERrcXVtQm9PYlNnbGRkQ2tUYlUy?=
 =?utf-8?B?MlNnY281ZUdXcDB1VkIyZ3oyUHNzVG1IR0sza0s0dERFcUJvN21UMHhRaXg0?=
 =?utf-8?B?eS8wNnRPQ0p3VXJ6N0FmYW9jNkZhaHA4ZjF5aWZUWHlqd3gza2FOclNmdFBU?=
 =?utf-8?B?cFg4MnduUVp3ZFplaVJ6anNaSHhtN2dqSjNNazJPZGxHdkg3T3dRS05RRzJv?=
 =?utf-8?B?SVdTaWZwNjZicUJaMnJYSGZVNG1sK3ZSYUM0Wm8xdXQwWnVFMHdPb3FEblhx?=
 =?utf-8?B?RGE3VkY0d0VscE1ibWw3dz09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?YldCMk9yL05YdkNuY1l6WkFpbGU3VDBsZjBrUXYrdUxrTndENGZUaDZqd3RI?=
 =?utf-8?B?ejh6THR3WnptWmpxd2Mxbjl6eHZzZm94bmNac2FIVVB3YWJ6THMzbnNwSXFG?=
 =?utf-8?B?cTRVc0FxOWdjV3JnSjd1NmswazM1d2NZeXROV2ZGc0wzWkJWN215aXo0Vk9w?=
 =?utf-8?B?RTRQSGdrYVVyYmZ4UmxZc1Vob0M3VVIxVzBuMWczdk1BbDVnZHppU2kvMVFK?=
 =?utf-8?B?SVlFUE95L0VnNGpZWW9EWG92QXpqSUFNYjJQU3ZyOVpMWk9jMWJZckNzTVhZ?=
 =?utf-8?B?N1A5cndXVFFYdEpzVG9iZUdUcFprQUs3dEljeGllcUFXeFgwdFpmWUVnZThz?=
 =?utf-8?B?WFJpTEJHYzA4NVJ6Qjk5dHZvengrZVIzMUJUMHNQVW1XYzFCa0VqbVMzUzhl?=
 =?utf-8?B?YmxWZUVHSU5weWpNdi9GdjNkeXpyY2FBOXJyYXppSjlNUzJGMXlFVUNlVWdE?=
 =?utf-8?B?VnMyY3ZQSVAvSkhaejM4eTl3WC9Oc0tiaFVxT0lSUjBSdkFrWDF4QndkczNt?=
 =?utf-8?B?SXhkM25FcUNNVGZKdTBIN0xGSFVoMzgySUdwUU9MY1dabXdoMEJoZkR6aVVa?=
 =?utf-8?B?YU9xRWdPNWtNQXBwZ0ptQ0FKQU9zSlp1MTc2SFJScVJIOEQ0NnE4N2hTUCsw?=
 =?utf-8?B?MlVxYmthTHE0ZU5Tem9BWWcreU5uaHYvcWl0T3JaOHczUU15UmQ0QUxscGo1?=
 =?utf-8?B?bGlKdjVoelliYzJNaG00clNVVFlPS3k5MmRRRWNKMHpSZVIvMjQyN2JDZkRj?=
 =?utf-8?B?cGsyd1dVT291NXM2eFN4b21ic21YNllObUsxUmk5UEhlU3lrby9Xdjcxa1A1?=
 =?utf-8?B?MzdlTmVibmVVL0hUWlJtUW5USE9kUS9WVEpMTXZhSDMwaW85bEh6TDVqZytk?=
 =?utf-8?B?TFZDSHpUNkorU1JjdzVnWUt4WnhDUml1cG5Xa29UTzl1a2FSa3VBYU9JSFdU?=
 =?utf-8?B?d1RNczJMY3dtYnY3ZVA2eVN1aVdSR1g3dlhMRCtaZS9ZYzFWRW1JSkVPNndC?=
 =?utf-8?B?cHZXUVE1SnVIZ25TYTFrd2NhdEY2bEhlUG4yYk1yQUxvNFdQMXdyMW8yNjNq?=
 =?utf-8?B?R0txV3pldXp4WmExS3JudXhLTmdKWWJXUm9ReXI5SFJPYWxoU3VGUHZuVjlm?=
 =?utf-8?B?VlE1UE42VjJvTWgySnFyU1J5S2p6RHFJUndEZHNkT2ZYNUFSY3h6RlcwQ2sz?=
 =?utf-8?B?eTA1L3VDOUg1UWo3MllRa3l6eXVqck96NjVMYUlTS3hLREQzUWV1aUxCNFJZ?=
 =?utf-8?B?d1dLTXVJVXFORzRjWlc0cEtJMnhaTk9oOEUyMlRaNEkrYVNEQ1RKc0xid28x?=
 =?utf-8?B?WTBJOXVmeUxZbWY4VnAzcC9jRVA1eXU3Qm15Tjk1cjQxNDQrMUxlcTc4bERt?=
 =?utf-8?B?YXlCc0FYb3dTRWIrM21rMmlRWGhpMmwvSTdnbmxzVWJEdUk4a2xIZnF2T1l2?=
 =?utf-8?B?dHNuY2NvTUUrNm9EdVNweGxwOWM0aUFJQWc0YndVQWJ1UXZwbHhYclVjV1lH?=
 =?utf-8?B?eVloSzBHYTlPUjdYVjcwVkJaYXJldnkzTSsvRkZZYjgwMXZXMzJad2dYaGp2?=
 =?utf-8?B?c044cktkYzJWSFdQV21QM1RtY3o2MFVwcy83MzdpUUFvTDJQUFRGKytIQUp1?=
 =?utf-8?B?dklJdHVxemhkYlM4M3BsSzNseThiQnBPQk1rRTRxKzNnRlFpSW43SzB2VEZq?=
 =?utf-8?B?UFJHcG95Z0cvSlhlbmd6V2JRREdVc21zNW5TQ3ZCaDRzM012aHc4cC9CSWl1?=
 =?utf-8?B?NG94NGZsSWZrQ2lSeENURjZxVGRBeGV2OC8rYW15U3BqdDRieFdSOUVRK0VU?=
 =?utf-8?B?UjZSTkVoeFFISmRGdWRaeTRSOUVFN3FiakQ2aVd4VUtOOHlJZC9YYWpPVEQw?=
 =?utf-8?B?QlpVRUNyNHJENEQzc0hTTXIzLzQ2REJoaDRjRGZidXFWSzhxdXgzMUpTQ2xF?=
 =?utf-8?B?UlZteGVsRHcranNqZWRJWlBQY3BtMS9aTnVWWDk2dEF5anByZXE0bTBWMEJs?=
 =?utf-8?B?d1lPa2dHbmZEaHkzeDR6bFJuSTFSTFhjcS9WQTIvMGlDbUJzOVZaK1hDdGha?=
 =?utf-8?B?LzNCQ080eXphajh3WXFYRGc1MHdRa2xlK2VTRHFuREZwOC9zSGVXUHB4SVBn?=
 =?utf-8?Q?v0sy6+I1NOzWEINxCQV8HKhAE?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c80e13c5-1931-4001-9e86-08dcbae82985
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2024 16:02:27.3992
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: z1gi+YXzzWKHUglwu5xcQFZpWoLMHW69sfNP2YqNR/ikQD7nxUNbSHdYhDhYQHuPm193yLwNH6CVWC5OKomH5A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6902

Hi Jan,

On 09/08/2024 10:34, Jan Beulich wrote:
> On 08.08.2024 17:50, Ayan Kumar Halder wrote:
>> On 08/08/2024 13:49, Jan Beulich wrote:
>>> On 08.08.2024 14:09, Ayan Kumar Halder wrote:
>>>> @@ -58,9 +58,13 @@ config PADDR_BITS
>>>>    	default 40 if ARM_PA_BITS_40
>>>>    	default 48 if ARM_64
>>>>    
>>>> +config HAS_VMAP
>>>> +	def_bool y
>>> With this being always enabled, ...
>> I had to define the config somewhere. It seemed this is the correct
>> place to define as HAS_VMAP will be turned off when MPU is introduced.
>>
>> So, it will be
>>
>> config HAS_VMAP
>>
>>              def_bool n
>>
>> At that time, only MMU will select HAS_VMAP.
> Well, but why is it not simply
>
> config HAS_VMAP
> 	bool
>
> from the very beginning? (There should never be "def_bool n" imo, btw.)
>
>>>> --- a/xen/include/xen/vmap.h
>>>> +++ b/xen/include/xen/vmap.h
>>>> @@ -141,7 +141,9 @@ void *arch_vmap_virt_end(void);
>>>>    /* Initialises the VMAP_DEFAULT virtual range */
>>>>    static inline void vm_init(void)
>>>>    {
>>>> +#ifdef CONFIG_MMU
>>>>        vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end());
>>>> +#endif
>>>>    }
>>> What about non-Arm, which all have MMUs but no corresponding Kconfig
>>> setting?
>> AFAICS , the only file that is of our concern xen/common/vmap.c It is
>> enclosed with VMAP_VIRT_START which is defined in mmu specific file
>> (xen/arch/arm/include/asm/mmu/layout.h).
>>
>> So, it will not be compiled for Arm MPU arch.
> Yet that wasn't my question. I asked about non-Arm, for all of which it
> looks like you're changing behavior of vm_init() (by suddenly making it
> do nothing).

Oh now I see what you mean. There is no CONFIG_MMU is x86 , yet it is 
used to enclose a common code which is a mistake.

So, we should introduce HAS_VMAP in xen/common/Kconfig and select it 
from X86, X86_64 and Arm.

Is my understanding correct ?

- Ayan




From xen-devel-bounces@lists.xenproject.org Mon Aug 12 17:14:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 17:14:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775689.1185914 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdYcH-0001yc-5z; Mon, 12 Aug 2024 17:13:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775689.1185914; Mon, 12 Aug 2024 17:13:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdYcH-0001yV-39; Mon, 12 Aug 2024 17:13:57 +0000
Received: by outflank-mailman (input) for mailman id 775689;
 Mon, 12 Aug 2024 17:13:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Zvba=PL=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sdYcF-0001yJ-Oc
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 17:13:55 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on20601.outbound.protection.outlook.com
 [2a01:111:f403:2415::601])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3f44d1fb-58ce-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 19:13:53 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by MW6PR12MB8705.namprd12.prod.outlook.com (2603:10b6:303:24c::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Mon, 12 Aug
 2024 17:13:42 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7849.021; Mon, 12 Aug 2024
 17:13:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3f44d1fb-58ce-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=fLkLoxFpnqNmjjqlKvABEe70Qs+viReO1xDv+2gKtKT0/UZVen5ykfxXSBJ/GKIaEu7BbBpIQCFZxYaxT4HMgZ5SeLbGzENWGBHfo+SDC/bP4+CN0KK96RPx8gyQqTZHgQOnLc7EPcWmCZGOaO/ycx1zAvzi9K/Yz3wrerxFmcK9zfCkoND67sT/Y6W6Qxde59Lldg3CRTV2xxYuMgMvm6xmfoIgOmJp1gCP0+RsyAHPmtAZjqq3QiuomNDsBtzbN3TacvqkP9efc7xngZYcJGqfxujN9FcOI0fj/AzLA5kP8QGptOl6z2UG7s9sEpUmhMp11qHLPnnhCnu6H5IKBA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=DKru4S+QNA4hEk1mp8ahGuyyOr4JCd++1MajJCNbRZ8=;
 b=y8N7FiS7B4e7uKePD8qyOaDHto7G+FMoGTKaR9RXxsq6LRPJ2Jy/Me6l6qgkLN0EAcdDLWEQXJazvbHConiuWqq+27rpfgjiJB5gags5IyRAADTCFGrXQCCjL7U9KTAjoqmwPIUW6A42zteDgZAatQl+p2p7aw9D8qz1kf9MSmjlBid83FFt7pCzVHjRGApHXmmm8bD0Ac80ELj38Pccykw07/VOKBIpIiosA+b3n2bUr0uBl+7k6P9lAITKJcZ/pd7YSKKD7u5SVwJmTOuuI2yn/kjAubMoWVGQ309nUYhaH/6yM+JctFVArep1wEHKLgGZstf7szy+igpWj5enGA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=DKru4S+QNA4hEk1mp8ahGuyyOr4JCd++1MajJCNbRZ8=;
 b=Ij6CsKv/9Ti4HH6IxW0yYanciCd45pDH+syDr6sIhOFe8ojnRvQPDEsVqy2ZpwUZ1hk/SV5SASYXU62ilzDilbh6Um4AZDxasQCJ8itDJn24/y+pZLwT9Bpytb1ART1s/+1YGM8SMeIcEATim+ye3zo7AhSFV3CWnNlKH5skeSE=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <12a28673-852c-4478-9e46-5aa9d2e8c94b@amd.com>
Date: Mon, 12 Aug 2024 18:13:36 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 4/4] xen: arm: Enclose access to EL2 MMU specific
 registers under CONFIG_MMU
Content-Language: en-GB
To: Michal Orzel <michal.orzel@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, Volodymyr_Babchuk@epam.com, julien@xen.org
Cc: xen-devel@lists.xenproject.org
References: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
 <20240808120936.3299937-5-ayan.kumar.halder@amd.com>
 <07e9a5bc-6e51-4073-b7a6-eb7bb7635891@amd.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <07e9a5bc-6e51-4073-b7a6-eb7bb7635891@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: DU6P191CA0068.EURP191.PROD.OUTLOOK.COM
 (2603:10a6:10:53e::20) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|MW6PR12MB8705:EE_
X-MS-Office365-Filtering-Correlation-Id: 386d48bb-91fa-48e9-bfef-08dcbaf21d62
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?RnBiczFocTZ2bHRlNUJuR1M5elVxNDZjdzkrWk9CS0tvdlFocFE2YUZvNWhQ?=
 =?utf-8?B?RUhYZ1Zvcng3UzFzL2JiR0NMcXphTzgyQ3FKQXd2dFE4UWNGNE1KRzhCUkk0?=
 =?utf-8?B?Vjlzbys5UCs5YXY0ZFFNcEZrYXRVNXhhdXZudllDc2lzemYzUVNRZVhTek82?=
 =?utf-8?B?YVBmUXZGUmI4VVdsN1JaMGdyUGxLSHIzSDJZeXQ0UldKNklLUHp6b2ZDUEx2?=
 =?utf-8?B?Y2plMFVMamF6TVFpamVrcjY3Uks2NmpITFJwMEkwTFoxMUk2ZlR6bnZrK1ha?=
 =?utf-8?B?ZDNPa0FYS1hnUUtnZWdTZDhzQjYwQUdPTldzT3Y3a1hKUlA1M2VqSFkyOTVU?=
 =?utf-8?B?ZEZyNkIwd3A4ZVlBMm42YlkzejVUNWhIN2JlcTczU1NScCsxeWpBYXlGYzhQ?=
 =?utf-8?B?NGE3K3dMQnlmT1VOY3Yva2l2aElxZ1pPemlZVy95cjBkdzc2THVSNW5nTkFI?=
 =?utf-8?B?VFhSVThHTjM2TURzMlB0Ly9KTVZLU0REVEFuU0VsVGRITDJLem5SQVlvZXFn?=
 =?utf-8?B?eXpzc2w5aG9BN040WjkyMDlzdVJZbXpVRFc1SGZidi8xbCtXZXlpOURsbURx?=
 =?utf-8?B?SGw4ZlFDM0dXeUFFZ0k3RXBxQ29SM3Juek81dTI1aDJVWTFTMCtaQS92cmlI?=
 =?utf-8?B?M3k5dHl4cURuSGxWSlhQM2JvUjZTTGxKUEl2bjc5VWhJTE9SR05qL0ErVmFN?=
 =?utf-8?B?Qnd6Ylk4WU1mY3ppUHFUQ2k2Sk5uZGhFam1aM2pPR2x5WGFpbG94THBDSWwx?=
 =?utf-8?B?cUhMSTk2VDI5L0RwUlpxa2ZtelhqV1RDRjdZNE12MHMwVkd1Z3owdlhzUFBL?=
 =?utf-8?B?QWlhMU9kWXpPSTVtVXQ4dDBxY1E3VHNFQ2hOS3BaYlJiYTJEbHJka3Z3OTVE?=
 =?utf-8?B?UzJoUkhMb3JTUGpoUmFpVllXUTRuVE5JTE5XaTNoVlJ4ekpnY3VtL1JQbkRZ?=
 =?utf-8?B?THNoUnVJUEgxZkZkVE9SbzNnS1pXa1N2bFhyUG1PM1c5TXYva1kzc3FBUW1y?=
 =?utf-8?B?NU1rREZBN2FoMVpJZ3UwQllSc2VPWUUxRUdRZCtxM2pPdnJFSy9uWjh3YnlW?=
 =?utf-8?B?eTZ5THZ2NElXNkdZMTFVK2ZBZDlhVXdpL1BwYW53anVpSGZzL1NOODFsUi94?=
 =?utf-8?B?RnNhL1NjQTB1K3hTVEVmQjdiZVBwVzhRTkJGd2gzSW1qanV2ZFBxMzVlZXp5?=
 =?utf-8?B?TXZKREZ3cklPN25KZFpnUjEyUEw1V2NBTlVuSGRhS0MvVkthN29ENHBDdVB4?=
 =?utf-8?B?ZmtLQ0lrWU9QcnVHL3g5ODU3R0VOYXJhTmZwTXVoV2JWVFEzdmhYNHMyblcr?=
 =?utf-8?B?QXZvekY3Nmw2eWlPZ3BiazBlNmJ3ZzNXcTlYczVwZGgxYVFCN0FmRnE0Sk9j?=
 =?utf-8?B?TW1IbUhkcHp3SUJDbTY0a2ZzclpXeWhmQjlwVXZJcW12OXcxNkRHL1MvRmRX?=
 =?utf-8?B?bXdvcldzVnppRjgzK3hveUJZdncrRDZVVTRocmc4aDdQM0s3SmxvSVlLTnh2?=
 =?utf-8?B?Y3lBbG9FSnFyc0E2R29xMUZQMEFhbjRwZkc5T1oxZSs1cUNuTXVkUThDRTB2?=
 =?utf-8?B?L1VxNDN1a0RRRTBuZzhZN3pHbG1wUEk0WTc1T2dqTGtpUVNyck5EZjRhKzBP?=
 =?utf-8?B?ZW1IblN5Ni9qSXU1Wm9IQ0c2ZnJBWmhvUWU4WDVHaFFCQVFwd1NBM1V0aWNN?=
 =?utf-8?B?bnlOM3Z1akJCTmRqRDRNSEUzRzg0bG1hcEc4dDloVGloSEpRRExMYm1Pc0JJ?=
 =?utf-8?B?Ulo0dmphNG16anRaT2J6MTNFSFFEMHVtemtKcVdRc2w1VXo2SHVEdjBzcWIr?=
 =?utf-8?B?VURaYXR0VG8wZXBOZlBCUT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?ZlRYMnZWNDBaR2ozNVlPcklFUHBqYW9WMlhWR094MXhTdXc5WTZQVFFaRHZY?=
 =?utf-8?B?S1ROeU9uMnVlZ0xjYmZmUEtrSWtmc2hqUURLYjdzVTQ3MERTd25OVWcrV2h1?=
 =?utf-8?B?ZlFMdWxZRTRNMmE0VzAzZEhpVXA0WVFvYmpFZGJGMnI0MnJsOU1vSWdhbzhI?=
 =?utf-8?B?Mzd3cGc1cDNWVXlJZE80UzBvVGNoMDJWazVaOFZFU1U3VkwvdGkrSkpkM3Vl?=
 =?utf-8?B?ajFWMllqdnlTd3FpYjBEb2tORm1wQ005NUtnN2ZzQ0twQkhMaWxwT0cvQmM0?=
 =?utf-8?B?dlZzL1JEckk4V1hyZ1MxRzRVUzA1MEhiT0RYTE90WlZpbGNWZmRiU243RGN5?=
 =?utf-8?B?WG9KeXg1dFpBWmJCSWl0MWtLNlZjYjVFcjdPTXE1TVJqYlZLZXhjRERKVjFF?=
 =?utf-8?B?VWFnTlRYaHlGZldHdENoY2RQTlh4dnovc0prdndxUDY4b1A0dFBoY2VCWFZ4?=
 =?utf-8?B?aFBWVXdDb3FQdWs1OHQwQVBaQjJlbmRyVVo0VkdNWDZoTlB5TG9MMmcvOGQ5?=
 =?utf-8?B?bTFlSVVNMm5oM05ITlhnTGxLc1B6d0lXb250NE9wekpuYjJBR0dSQkFOUXRO?=
 =?utf-8?B?L2RTZkVlVzlIQWZMYm5uS2lBVE9YaldXRzE1OTFYd2tFUlRUYzE3bUNFa3dO?=
 =?utf-8?B?M2JmREVrSHorb2hRYmFaQ1BDQ0NrdlZ2cDE4RUNIbTFFQURPemZCWmNxczc4?=
 =?utf-8?B?MVN3ZXd6cHEzbC9CTEIvQnBReTRvRXFBSEFXcHc1ZnFuQ3M1NUwyVmRYN3dv?=
 =?utf-8?B?eGordjBkT2MvVkNUQVVlaDNWS2hJU2FmbFBnUUw3VnNVKy8rV2ppZ2s2bTR2?=
 =?utf-8?B?U0trWEx2YmMzSEVERGVaRTV5MEV6VCt6NndYMEg5Y1pOdGFSeXF2SjRFRG1m?=
 =?utf-8?B?ZlRHSGRQMmR4bmVQNTgxMmpDaDlWKzRKRE1VL3FRY2tkNGs4WklHVFdFb2Jo?=
 =?utf-8?B?cUI1bHlYcjFWbmFSa3U0SnRuZkVXalZ0SStwQk1MRDFyeE81VVpFblRPbGhj?=
 =?utf-8?B?WFk3MnBXWTBENm5pWmRLTUtnMmlZZVRNc0JZemZpeEZKZEdZVlczem1LSnhr?=
 =?utf-8?B?SGpFdHEwT2VzNU9sU2M0dGxQU0k5TXZjQlM2NkVKaG9hSDZOZFdFNll2Vngr?=
 =?utf-8?B?YVNPckRYRU9ROFh0NUFjSkZuZzh6TVoxTUdNQVNiR1dpQ0RRMkZ1ckZHQThK?=
 =?utf-8?B?ekRkVDI0WUR2YVRPaG9kR2lyZVIrb1ZNQTZLWmtmZDVmZEtaT0RheWlQdmRq?=
 =?utf-8?B?M1ZUam5DcDlTOCtMdnNoMk4zTW5VTjhSUU56MXVVOE1rRnRDREt6TzNNaEpL?=
 =?utf-8?B?YTFid0l3V2dyUzVoNDhOSGRXOVRaaU1oeEttc2J6cFVkcnFWZS9QR3Q5WHds?=
 =?utf-8?B?Q2VoL3l5V3YwaWFvQzE3dlI3bURYQ0crQzloNWE1T2RGdnNicnlHeWZZNFVR?=
 =?utf-8?B?MzJrNVpCbTYwL0haYmUzSjcvOUFPMkU2eUdqTjV6eDU1aEUzOWwwN2dsTlVB?=
 =?utf-8?B?T0hqVCs0Q1crakV5MmRkeEpKaHFiYVpWcG9ac3p0blZqVEJQdEg5aGpMZzd6?=
 =?utf-8?B?N0RDNU85QzBDdUFrRnNydXNTc3hpcU93eGRTTWtOS1huaHp0UCs4c0oyMTNN?=
 =?utf-8?B?eWJZbjdNRFFNR2I4U056UGdLdnZVak5OSVBvYWRsbG5ObzZsZCtrUmxvWFlZ?=
 =?utf-8?B?bjlnNDQ4MGl3ckJOTExXUkZpL3VydzU0OWFta3dMZ0NPY21hME9GRVY3Y0ho?=
 =?utf-8?B?OUF1WXFvVGVPUlZBeTBKZjFyRkYwTjBBR1J4UW4zZUQ3eUszem1mYjJEZlh3?=
 =?utf-8?B?RXJ3Z0dNOXJOQmNaRnBHenNuWG5TTS8yNUdCeUZsaTNzSTVrMkZpZzM3THpU?=
 =?utf-8?B?YjA2M0kxSlN2Q1dWQk5NYjhxNzRrenhHUjJhdnhGV1plUlNDdGRoa0dHSk1Y?=
 =?utf-8?B?dk1mcWg5MVBLMUNlZnEreVZtVnFycEJyc1NZT1hkNm40cU5mZ3RiamhHNWwv?=
 =?utf-8?B?TlVmeCtiZDMrbU4vYWh6RVdhTW1mdEV1bVc2OHA2ek9yVnc2NnYwUmhtNVdn?=
 =?utf-8?B?cEo5Z3d3UzduVFpMUjh5Qkl4ZTBIWDBDNVNDZ29sS2phN3VOaTAyblUxWnY0?=
 =?utf-8?Q?K4OBrwwb4HGl7Pkuj5bZEwZh6?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 386d48bb-91fa-48e9-bfef-08dcbaf21d62
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2024 17:13:42.0141
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: ovvGLR7oS1hxvpzl/9aABswAZgmJKI6RiRrLbFNQZgtVVXB9iCLnIlYR/klyrbvj4nEySkMHRrdFa0K1VgGHSA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8705


On 09/08/2024 13:15, Michal Orzel wrote:
> Hi Ayan,
Hi Michal,
>
> On 08/08/2024 14:09, Ayan Kumar Halder wrote:
>> All the EL2 MMU specific registers are enclosed within CONFIG_MMU.
>>
>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>> ---
>> Changes from v1 :-
>> 1. 'vttbr_el2' field is enclosed with ifdef.
>> 2. No movement of code.
>>
>>   xen/arch/arm/traps.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
>> index aac6c599f8..f51e1424cb 100644
>> --- a/xen/arch/arm/traps.c
>> +++ b/xen/arch/arm/traps.c
>> @@ -720,8 +720,10 @@ struct reg_ctxt {
>>       uint32_t ifsr32_el2;
>>   #endif
>>   
>> +#ifdef CONFIG_MMU
>>       /* Hypervisor-side state */
>>       uint64_t vttbr_el2;
> Given that you protected the field here, why did you leave assignments in show_registers()
> and vcpu_show_registers() unguarded?

Makes sense. Sorry I forgot about that.

- Ayan



From xen-devel-bounces@lists.xenproject.org Mon Aug 12 17:35:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 17:35:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775699.1185924 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdYxT-0005XY-TL; Mon, 12 Aug 2024 17:35:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775699.1185924; Mon, 12 Aug 2024 17:35:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdYxT-0005XR-QT; Mon, 12 Aug 2024 17:35:51 +0000
Received: by outflank-mailman (input) for mailman id 775699;
 Mon, 12 Aug 2024 17:35: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=KPBI=PL=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sdYxS-0005XL-LZ
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 17:35:50 +0000
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com
 [2a00:1450:4864:20::529])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4e919385-58d1-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 19:35:48 +0200 (CEST)
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5a156556fb4so5335042a12.3
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 10:35:46 -0700 (PDT)
Received: from localhost ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd1a5dfc9fsm2280308a12.66.2024.08.12.10.35.44
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 12 Aug 2024 10:35:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4e919385-58d1-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723484146; x=1724088946; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=mFPlrxZoLMv9hf55212UKVptTgMELOiCvhI0eA1MZ18=;
        b=BSF2/FCKEqZQfGj0PQdwEY8AU/sbW3RNnKm7486PMA3aDJkTkZQLCPKeZ1NcmmksLC
         uclHZ0Gu+PFMlmWXLr66itoSk8YFsZ1XCpC/iuMCl3PIhJGlkYzp0F9YL0C9oHclVAZV
         F2RhcIsoGfhMCPDjC7kp+wLco+Lqe7Fiwo5ik=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723484146; x=1724088946;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=mFPlrxZoLMv9hf55212UKVptTgMELOiCvhI0eA1MZ18=;
        b=ILMP5SwOAai/Ibj5pD1GOmPGIlz9MG77C4HtijYPNB9V/xgA4GS/scxJJ4s/PlI/m8
         95eLpsG/d58r8mXnMxdPnh9waqnqq3mWHGpcSFe1ofTEDHx6k2G8Dg6CxgyijU2ar6iV
         LEQkjqcPlEozC0cJYQJfSw/EyWmbIsUQzhJMovx51gMFXwGnpniqstMews2YoYANcm2E
         ay5/byY7vBQI7FgADCAPbx3p63c/jE3VKwghWvbiBarHN6boXn8LtCH5kS5MbkGlzPwj
         u6CzmWVIiQIOv+XMx5AQOhzy29K8w3gs8PLWCx/vU3km8wYBypoe6kc0WlVAxLQLZ5CA
         ZVmA==
X-Forwarded-Encrypted: i=1; AJvYcCX7PdI9q7MU9YXh0dmBzpZHwDRBvPYwi99m//dtSRr8t1O90nIEeF0PhN19KklT2yiWkgIq/miAHKWAW8r3GEoug+XefdlG10W2wydo7AE=
X-Gm-Message-State: AOJu0Yy2LM4fN1JVKxDfPy+6LQxXXZpWwVl0wXz5CLIm6Kq7IEK6u4Eu
	xQNDvwknUtYDovz/yhVKxcaVVIPB1y8D3DlCu+1joESfaW9jUHr0zNz9pKgsjNI=
X-Google-Smtp-Source: AGHT+IHbINypJ8c0OvDvKeWOF5JlsSRrxIvKJdOvQ60cSLLTOGFaowPdYNucrU76OpkRRqj48ssnZg==
X-Received: by 2002:a05:6402:e87:b0:5a2:94ef:5573 with SMTP id 4fb4d7f45d1cf-5bd44c78087mr691259a12.37.1723484145413;
        Mon, 12 Aug 2024 10:35:45 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Mon, 12 Aug 2024 18:35:43 +0100
Message-Id: <D3E4510X007T.23EWZ5W1418HP@cloud.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
 =?utf-8?q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] x86: slightly simplify MB2/EFI "magic" check
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Jan Beulich" <jbeulich@suse.com>
X-Mailer: aerc 0.17.0
References: <f2186827-62e6-4b24-8a6c-0c2a9499c232@suse.com>
 <D3E0A9YVBOAD.LLLJMNX31BG6@cloud.com>
 <53c6c9ba-de64-4e46-9e29-2e03a9d8224b@suse.com>
In-Reply-To: <53c6c9ba-de64-4e46-9e29-2e03a9d8224b@suse.com>

Hi,

On Mon Aug 12, 2024 at 3:43 PM BST, Jan Beulich wrote:
> On 12.08.2024 16:34, Alejandro Vallejo wrote:
> > On Thu Aug 8, 2024 at 9:49 AM BST, Jan Beulich wrote:
> >> A few dozen lines down from here we repeatedly use a pattern involving
> >> just a single (conditional) branch. Do so also when checking for the
> >> boot loader magic value.
> >>
> >> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> >> ---
> >> I further question the placement of the clearing of vga_text_buffer,
> >> just out of context: Shouldn't that be placed with the increments of
> >> efi_platform and skip_realmode? Or else is the terminology in comments
> >> ("on EFI platforms") wrong in one of the two places? In the end, if we
> >> are entered at __efi64_mb2_start but the magic doesn't match, we simpl=
y
> >> don't know what environment we're in. There may or may not be a VGA
> >> console at the default address, so we may as well (try to) write to it
> >> (just like we do when entered at start).
> >=20
> > It's fair to assume we're in 64bits, and in that situation it's also fa=
ir to
> > assume the text console is long gone (pun intended).
>
> How is being in 64-bit mode correlated with there being a VGA console?
> (I question "fair to assume" here anyway. We're on a path where we know
> something's wonky.)

The only way in which you could plausibly have a text-mode console in 64bit=
s is
if you booted from BIOS and didn't set a VESA mode, so it boils down to wha=
t
failure modes you want to consider. For "anything goes" you're right that w=
e
can't even be sure of being in 64bit (or 32bit) mode, but that's too dracon=
ian
an assumption to try to uphold, imo. I think that while details in the boot
protocol might be incorrect (like the magic tag), broad strokes (like being=
 in
long mode and having a UEFI runtime) must still hold. Trying to use the ser=
ial
is fine (worst-case scenario it doesn't work), but trying to use a framebuf=
fer
you're not sure about is not unlikely to triple fault your machine prematur=
ely
and then debugging it is a pain even with an emulator.

>
> >> --- a/xen/arch/x86/boot/head.S
> >> +++ b/xen/arch/x86/boot/head.S
> >> @@ -233,13 +233,11 @@ __efi64_mb2_start:
> >> =20
> >>          /* Check for Multiboot2 bootloader. */
> >>          cmp     $MULTIBOOT2_BOOTLOADER_MAGIC,%eax
> >> -        je      .Lefi_multiboot2_proto
> >> =20
> >>          /* Jump to .Lnot_multiboot after switching CPU to x86_32 mode=
. */
> >>          lea     .Lnot_multiboot(%rip), %r15
> >=20
> > I don't think there's much benefit to this, but it would read more natu=
rally if
> > lea was before cmp. Then cmp would be next to its (new) associated jne.
>
> You did look at the pattern though that I'm referring to in the descripti=
on?
> Knowing that generally paring the CMP/TEST with the Jcc, I would have
> switched things around. Yet I wanted to make things as similar as possibl=
e,
> in the hope that be(com)ing consistent would make it easiest to get such =
a
> minor change in.
>
> Jan

I'm not sure about the pattern you mention. Seems like a standard set of
doX+check+cond_jump finished in an unconditional jump. All of them pretty
normal.

Regardless, I'm not arguing against this. While I happen to find it easier =
to
mentally parse it in its current form we do save a jump instruction after y=
our
change. It's just that it'd be easier to follow with the mentioned reversal=
 of
lea and cmp.

Cheers,
Alejandro


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 20:40:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 20:40:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775753.1185934 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdbpe-00076N-HS; Mon, 12 Aug 2024 20:39:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775753.1185934; Mon, 12 Aug 2024 20:39:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdbpe-00076G-Dq; Mon, 12 Aug 2024 20:39:58 +0000
Received: by outflank-mailman (input) for mailman id 775753;
 Mon, 12 Aug 2024 20:39:57 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=WK61=PL=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1sdbpd-00076A-DV
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 20:39:57 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on2060d.outbound.protection.outlook.com
 [2a01:111:f403:2414::60d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 074610f0-58eb-11ef-8776-851b0ebba9a2;
 Mon, 12 Aug 2024 22:39:54 +0200 (CEST)
Received: from SN7P220CA0018.NAMP220.PROD.OUTLOOK.COM (2603:10b6:806:123::23)
 by SJ2PR12MB8012.namprd12.prod.outlook.com (2603:10b6:a03:4c7::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.17; Mon, 12 Aug
 2024 20:39:49 +0000
Received: from SA2PEPF0000150A.namprd04.prod.outlook.com
 (2603:10b6:806:123:cafe::c1) by SN7P220CA0018.outlook.office365.com
 (2603:10b6:806:123::23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend
 Transport; Mon, 12 Aug 2024 20:39:48 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SA2PEPF0000150A.mail.protection.outlook.com (10.167.242.42) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Mon, 12 Aug 2024 20:39:48 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 12 Aug
 2024 15:39:47 -0500
Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Mon, 12 Aug 2024 15:39:46 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 074610f0-58eb-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=IBa6hHVl6eylOhP+iv7lQl4BiKB8hN9QGmdblv6o/OFgtj4RAQex5fPPwEzCVG7Uos6maLWxuWfSdUXuMqlBVXO4r6x5P5wyQT9zWoKy8B61wNNJ1fQzAVdxEx5ISXR/z2OT4EfpmDu5n5sFk3PexUY3jKor1Ax4NYbRJ8PYnGw+/I8xcg2oBwETKO5b8W0KKTEaVeR26g0ObkU5LVceQyWsUBDfjHA6cRFYbAvhIxhtuNm1gMNqDabiweE9BRaYMTLq353Ny2P5WAl5E5YAiHOVERrpqhcLaptbTM2zXnooBjxYRfhhbg9J7vT12s1ysrPzGhzfjtw6/GM0m2w0uw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qhOdXzqVyJvfvUeiucIa5BHdjzCCqp6qsxsfKPppPlk=;
 b=Tgn4+JGOlVKETpBAOU++y4Im2P4rDzoSHdiuQyssHYiRUMAvNehXml7G/g7cD6fnmIuxsyxxMRAsLn6yUo5lARQRTz+JnB1odoSZQuFQRL5e8nP46Y74Yu76rG+Kn19x8zSmBx8OU57jxgJKjHbDxxwW6g46C6gzV5DL/iJbyf/+DQ8TmnCc+IwJbZPXbeadGRol2H0Al89/ykxHO+6tM8UBYRvVEhASvkzxCcGyF3F4SrZWwe7eK9Tr0ek9KBbSPtoDRS/pLu2b2KF2fdP3GUvA9IIhRAbhvFFMKqhkR1UfzMBawf0JURNJF0nNOZJ8cpzkyY1nJ7PbGF2DJ/hfUQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qhOdXzqVyJvfvUeiucIa5BHdjzCCqp6qsxsfKPppPlk=;
 b=zN8Ly/KvDx4VPi0S9z6tuA0dvdieIhTyY4ju5tsNJGX/3YXCarKJ5L5i+69oHH4UoAx5H8FQroetTerFY/+aXhZo5Ne+anNtF6p8rTzq95zvWVYhFWj3irjumDGScRteCT/bso9lx5dgJyR6PVJYbvr25s2oXHsjP9j+g9B0td0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stewart Hildebrand <stewart.hildebrand@amd.com>, Jan Beulich
	<jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Teddy Astie
	<teddy.astie@vates.tech>
Subject: [PATCH v3] x86/msi: fix locking for SR-IOV devices
Date: Mon, 12 Aug 2024 16:39:09 -0400
Message-ID: <20240812203938.981588-1-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB04.amd.com: stewart.hildebrand@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SA2PEPF0000150A:EE_|SJ2PR12MB8012:EE_
X-MS-Office365-Filtering-Correlation-Id: e89596d8-1989-4418-8c9d-08dcbb0ee87d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|376014|1800799024|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?up0cV/lXKLUEyqGLtajczwejqHHVL5lZXg93E3frzUKInUl6z7qHM/5Xnrss?=
 =?us-ascii?Q?Dkhp5x0o4E58WGk2s4tadOIwtXy8CiV+1XcKs3J+rxHZEAtwwWxDa3tHg6s0?=
 =?us-ascii?Q?Ag8U8GDA2BmA+WVwt87g2rAytEeytEWbR5dTcTR1anUux7vEWSWQD2tPiJx0?=
 =?us-ascii?Q?AZkfDq2+QzBq0pCVgyOvrhjtjTMUVZHq4V9chYvzJbgTx/t8RzmoUu4G9QvT?=
 =?us-ascii?Q?FgO0V4buwmm4wnUZchq54NSomzgKpz1C5NhnGWuipLlgia8jjTOsaTnYq020?=
 =?us-ascii?Q?Dxz3HF34GRytmet5v6lQp18/09ppp1d3xK2EfRUcix/KcK7PU1OFNAKgTS94?=
 =?us-ascii?Q?aZ5XUB7Ht2xxVPLu5b7hg7pViGfC6YY3r5scTHx9p/vWjgoRkwb9YT3HOUpJ?=
 =?us-ascii?Q?YNBnESrRa3G/Drc08tN83InFlTCIdrONbetIk0VbJ6cewtDqSWuGQsulluw9?=
 =?us-ascii?Q?TOInlSJbdkEjKNhZ6inisFzeMApPwO3yqfbK5Fedz7ONvn6st0yOkBWY62lg?=
 =?us-ascii?Q?/uHtauWxZHy88q3B6jYdMIhLFYREB9N25bbLKrSPOFT5NNsad4Cc2cB/iet6?=
 =?us-ascii?Q?YzNFwcnjwiTK+iYq+Mt/SLvnp3jjXH3sx0scMzVMjMjjVayalKYiHJse/1ov?=
 =?us-ascii?Q?WsaSwHM7Woo+X1dIXuHHw7NF/il2NZ/xB+usFmqfIeFEWT3qO+9ERpV4435R?=
 =?us-ascii?Q?7cNkHd1oMzSDmBGoNAba/UOZnsbiHLLmCXnT7MEw2geq1Bnttml0pDFoBTUD?=
 =?us-ascii?Q?N/i1gttGz0LGvBhwFIfoOEmxHr09mK6xaaHjwx9tGIUz1fIUg9zdS4QHT/lV?=
 =?us-ascii?Q?6ql3R+4OSTZ8rqlc85NkrlxKSwErJGhUh7nC2roGlpiYgLVT5+c6L+6Bt3RO?=
 =?us-ascii?Q?Bv1GBYDVuio2xGj92zzeqVPULQdxEdBlkhUu3HAT4DGVQLTsq/FZ8mN96mcT?=
 =?us-ascii?Q?Ycb1Z8fzDsxMfYJcXAegs7cFZwYQJr/gNDz/yYcFjD0lzXaE8sgLER5c94lo?=
 =?us-ascii?Q?xO0ccBGQ/+LN09sXnAerILHA7NlyOOtfgHZxQnog41gkZRwHmC5N3FnqoUzU?=
 =?us-ascii?Q?aB37Mk9rEXax2P3PlhpkazNAbO99hbmQT91kARV074OeFX7TTwE6VBChudsj?=
 =?us-ascii?Q?5CXX3EfAr9sL37MAaMDWUJzPUtoi8fHk1ZqgLLzwrsl4JpZ/grEXCHhgPZnq?=
 =?us-ascii?Q?15fOC4AXLWofRetqj16IL7R09NPnOMV8h9i4S5MyyRSsLCToe3GQQO6Z1oBk?=
 =?us-ascii?Q?YVCc7KkNBxskv0GaagA9iRvCXRNM5D6QG9uTGltuxaYk9mSJ9xGhdVzEFsHT?=
 =?us-ascii?Q?mzJEsjokcrVhgeon4jM74rqN37ueSK/tL+WRQq1qIf7FZafK2U7EmVBAegMl?=
 =?us-ascii?Q?OYmeI4h+mUXeLD2cwplvMrhFGWp5jvpTsphAlWdZesxsorGrbwb9mFnWOUYw?=
 =?us-ascii?Q?5YJv/P+XMZ6bTIvWb/kr8+ZxNfsX3ZrU?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(1800799024)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2024 20:39:48.3464
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: e89596d8-1989-4418-8c9d-08dcbb0ee87d
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SA2PEPF0000150A.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8012

In commit 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci
structure") a lock moved from allocate_and_map_msi_pirq() to the caller
and changed from pcidevs_lock() to read_lock(&d->pci_lock). However, one
call path wasn't updated to reflect the change, leading to a failed
assertion observed under the following conditions:

* PV dom0
* Debug build (debug=y) of Xen
* There is an SR-IOV device in the system with one or more VFs enabled
* Dom0 has loaded the driver for the VF and enabled MSI-X

(XEN) Assertion 'd || pcidevs_locked()' failed at drivers/passthrough/pci.c:535
(XEN) ----[ Xen-4.20-unstable  x86_64  debug=y  Not tainted ]----
...
(XEN) Xen call trace:
(XEN)    [<ffff82d040284da8>] R pci_get_pdev+0x4c/0xab
(XEN)    [<ffff82d040344f5c>] F arch/x86/msi.c#read_pci_mem_bar+0x58/0x272
(XEN)    [<ffff82d04034530e>] F arch/x86/msi.c#msix_capability_init+0x198/0x755
(XEN)    [<ffff82d040345dad>] F arch/x86/msi.c#__pci_enable_msix+0x82/0xe8
(XEN)    [<ffff82d0403463e5>] F pci_enable_msi+0x3f/0x78
(XEN)    [<ffff82d04034be2b>] F map_domain_pirq+0x2a4/0x6dc
(XEN)    [<ffff82d04034d4d5>] F allocate_and_map_msi_pirq+0x103/0x262
(XEN)    [<ffff82d04035da5d>] F physdev_map_pirq+0x210/0x259
(XEN)    [<ffff82d04035e798>] F do_physdev_op+0x9c3/0x1454
(XEN)    [<ffff82d040329475>] F pv_hypercall+0x5ac/0x6af
(XEN)    [<ffff82d0402012d3>] F lstar_enter+0x143/0x150

In read_pci_mem_bar(), the VF obtains the struct pci_dev pointer for its
associated PF to access the vf_rlen array. This array is initialized in
pci_add_device() and is only populated in the associated PF's struct
pci_dev.

Add a link from the VF's struct pci_dev to the associated PF struct
pci_dev, ensuring the PF's struct doesn't get deallocated until all its
VFs have gone away. Access the vf_rlen array via the new link to the PF,
and remove the troublesome call to pci_get_pdev().

Add a call to pci_get_pdev() inside the pcidevs_lock()-locked section of
pci_add_device() to set up the link from VF to PF. In case the new
pci_add_device() invocation fails to find the associated PF (returning
NULL), we are no worse off than before: read_pci_mem_bar() will still
return 0 in that case.

Note that currently the only way for Xen to know if a device is a VF is
if the toolstack tells Xen about it. Using PHYSDEVOP_manage_pci_add for
a VF is not a case that Xen handles.

Fixes: 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci structure")
Reported-by: Teddy Astie <teddy.astie@vates.tech>
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
Candidate for backport to 4.19

v2->v3:
* link from VF to PF's struct pci_dev *

v1->v2:
* remove call to pci_get_pdev()
---
 xen/arch/x86/msi.c            | 34 ++++++++++++++-------------
 xen/drivers/passthrough/pci.c | 44 +++++++++++++++++++++++++++++++----
 xen/include/xen/pci.h         | 12 +++++++++-
 3 files changed, 69 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 0c97fbb3fc03..1e3a0c450224 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -662,34 +662,32 @@ static int msi_capability_init(struct pci_dev *dev,
     return 0;
 }
 
-static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
+static u64 read_pci_mem_bar(struct pf_info *pf_info, u16 seg, u8 bus, u8 slot,
+                            u8 func, u8 bir, int vf)
 {
+    pci_sbdf_t sbdf = PCI_SBDF(seg, bus, slot, func);
     u8 limit;
     u32 addr, base = PCI_BASE_ADDRESS_0;
     u64 disp = 0;
 
     if ( vf >= 0 )
     {
-        struct pci_dev *pdev = pci_get_pdev(NULL,
-                                            PCI_SBDF(seg, bus, slot, func));
         unsigned int pos;
         uint16_t ctrl, num_vf, offset, stride;
 
-        if ( !pdev )
-            return 0;
-
-        pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_SRIOV);
-        ctrl = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_CTRL);
-        num_vf = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_NUM_VF);
-        offset = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_OFFSET);
-        stride = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_STRIDE);
+        pos = pci_find_ext_capability(sbdf, PCI_EXT_CAP_ID_SRIOV);
+        ctrl = pci_conf_read16(sbdf, pos + PCI_SRIOV_CTRL);
+        num_vf = pci_conf_read16(sbdf, pos + PCI_SRIOV_NUM_VF);
+        offset = pci_conf_read16(sbdf, pos + PCI_SRIOV_VF_OFFSET);
+        stride = pci_conf_read16(sbdf, pos + PCI_SRIOV_VF_STRIDE);
 
         if ( !pos ||
              !(ctrl & PCI_SRIOV_CTRL_VFE) ||
              !(ctrl & PCI_SRIOV_CTRL_MSE) ||
              !num_vf || !offset || (num_vf > 1 && !stride) ||
              bir >= PCI_SRIOV_NUM_BARS ||
-             !pdev->vf_rlen[bir] )
+             !pf_info ||
+             !pf_info->vf_rlen[bir] )
             return 0;
         base = pos + PCI_SRIOV_BAR;
         vf -= PCI_BDF(bus, slot, func) + offset;
@@ -703,8 +701,8 @@ static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
         }
         if ( vf >= num_vf )
             return 0;
-        BUILD_BUG_ON(ARRAY_SIZE(pdev->vf_rlen) != PCI_SRIOV_NUM_BARS);
-        disp = vf * pdev->vf_rlen[bir];
+        BUILD_BUG_ON(ARRAY_SIZE(pf_info->vf_rlen) != PCI_SRIOV_NUM_BARS);
+        disp = vf * pf_info->vf_rlen[bir];
         limit = PCI_SRIOV_NUM_BARS;
     }
     else switch ( pci_conf_read8(PCI_SBDF(seg, bus, slot, func),
@@ -813,6 +811,7 @@ static int msix_capability_init(struct pci_dev *dev,
         int vf;
         paddr_t pba_paddr;
         unsigned int pba_offset;
+        struct pf_info *pf_info = NULL;
 
         if ( !dev->info.is_virtfn )
         {
@@ -827,9 +826,12 @@ static int msix_capability_init(struct pci_dev *dev,
             pslot = PCI_SLOT(dev->info.physfn.devfn);
             pfunc = PCI_FUNC(dev->info.physfn.devfn);
             vf = dev->sbdf.bdf;
+            if ( dev->virtfn.pf_pdev )
+                pf_info = &dev->virtfn.pf_pdev->physfn;
         }
 
-        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
+        table_paddr = read_pci_mem_bar(pf_info, seg, pbus, pslot, pfunc, bir,
+                                       vf);
         WARN_ON(msi && msi->table_base != table_paddr);
         if ( !table_paddr )
         {
@@ -852,7 +854,7 @@ static int msix_capability_init(struct pci_dev *dev,
 
         pba_offset = pci_conf_read32(dev->sbdf, msix_pba_offset_reg(pos));
         bir = (u8)(pba_offset & PCI_MSIX_BIRMASK);
-        pba_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
+        pba_paddr = read_pci_mem_bar(pf_info, seg, pbus, pslot, pfunc, bir, vf);
         WARN_ON(!pba_paddr);
         pba_paddr += pba_offset & ~PCI_MSIX_BIRMASK;
 
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 5a446d3dcee0..1294836bca44 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -341,6 +341,8 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
 
     list_add(&pdev->alldevs_list, &pseg->alldevs_list);
 
+    INIT_LIST_HEAD(&pdev->physfn.vf_list);
+
     /* update bus2bridge */
     switch ( pdev->type = pdev_type(pseg->nr, bus, devfn) )
     {
@@ -446,7 +448,27 @@ static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
 
     list_del(&pdev->alldevs_list);
     pdev_msi_deinit(pdev);
-    xfree(pdev);
+
+    if ( pdev->info.is_virtfn )
+    {
+        struct pci_dev *pf_pdev = pdev->virtfn.pf_pdev;
+
+        if ( pf_pdev )
+        {
+            list_del(&pdev->virtfn.next);
+            if ( pf_pdev->physfn.dealloc_pending &&
+                 list_empty(&pf_pdev->physfn.vf_list) )
+                xfree(pf_pdev);
+        }
+        xfree(pdev);
+    }
+    else
+    {
+        if ( list_empty(&pdev->physfn.vf_list) )
+            xfree(pdev);
+        else
+            pdev->physfn.dealloc_pending = true;
+    }
 }
 
 static void __init _pci_hide_device(struct pci_dev *pdev)
@@ -700,10 +722,22 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
          * extended function.
          */
         if ( pdev->info.is_virtfn )
+        {
+            struct pci_dev *pf_pdev;
+
             pdev->info.is_extfn = pf_is_extfn;
+            pf_pdev = pci_get_pdev(NULL,
+                                   PCI_SBDF(seg, info->physfn.bus,
+                                            info->physfn.devfn));
+            if ( pf_pdev )
+            {
+                pdev->virtfn.pf_pdev = pf_pdev;
+                list_add(&pdev->virtfn.next, &pf_pdev->physfn.vf_list);
+            }
+        }
     }
 
-    if ( !pdev->info.is_virtfn && !pdev->vf_rlen[0] )
+    if ( !pdev->info.is_virtfn && !pdev->physfn.vf_rlen[0] )
     {
         unsigned int pos = pci_find_ext_capability(pdev->sbdf,
                                                    PCI_EXT_CAP_ID_SRIOV);
@@ -715,7 +749,9 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
         {
             unsigned int i;
 
-            BUILD_BUG_ON(ARRAY_SIZE(pdev->vf_rlen) != PCI_SRIOV_NUM_BARS);
+            BUILD_BUG_ON(ARRAY_SIZE(pdev->physfn.vf_rlen) !=
+                                    PCI_SRIOV_NUM_BARS);
+
             for ( i = 0; i < PCI_SRIOV_NUM_BARS; )
             {
                 unsigned int idx = pos + PCI_SRIOV_BAR + i * 4;
@@ -730,7 +766,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
                     continue;
                 }
                 ret = pci_size_mem_bar(pdev->sbdf, idx, NULL,
-                                       &pdev->vf_rlen[i],
+                                       &pdev->physfn.vf_rlen[i],
                                        PCI_BAR_VF |
                                        ((i == PCI_SRIOV_NUM_BARS - 1) ?
                                         PCI_BAR_LAST : 0));
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 63e49f0117e9..5bb6fef3934b 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -150,7 +150,17 @@ struct pci_dev {
         unsigned int count;
 #define PT_FAULT_THRESHOLD 10
     } fault;
-    u64 vf_rlen[6];
+    struct pf_info {
+        /* Only populated for PFs (info.is_virtfn == false) */
+        uint64_t vf_rlen[PCI_SRIOV_NUM_BARS];
+        struct list_head vf_list;             /* List head */
+        bool dealloc_pending;
+    } physfn;
+    struct {
+        /* Only populated for VFs (info.is_virtfn == true) */
+        struct pci_dev *pf_pdev;              /* Link from VF to PF */
+        struct list_head next;                /* Entry in vf_list */
+    } virtfn;
 
     /* Data for vPCI. */
     struct vpci *vpci;

base-commit: d61248b0fa2cdfc0be1d806c43d1b211a72b5d49
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 12 20:55:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 20:55:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775763.1185943 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdc4w-0001id-US; Mon, 12 Aug 2024 20:55:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775763.1185943; Mon, 12 Aug 2024 20:55:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdc4w-0001iW-Rk; Mon, 12 Aug 2024 20:55:46 +0000
Received: by outflank-mailman (input) for mailman id 775763;
 Mon, 12 Aug 2024 20:55:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdc4v-0001iM-KS; Mon, 12 Aug 2024 20:55:45 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdc4v-00053L-Fd; Mon, 12 Aug 2024 20:55:45 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdc4v-0005xu-1Q; Mon, 12 Aug 2024 20:55:45 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sdc4v-0003Ox-0u; Mon, 12 Aug 2024 20:55:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=u19qRQR2UdI48oQOuDELC4j+ndxSwE4/d6o5XED3ID0=; b=wdl7eKmWg6rinUHeqW+/E6r+P6
	v4hIHxR1zZ5fgLDNLO7MKBT6yXlmFVgsVErgT1rbWsbm3NJqYvY5N98N0pVKpb4CzXC8Li33riMy2
	zDqnc0P3DBpHb7ghY8jynq2WL3ssp2A7mwI2SByZNYVyk1gaVE3UGd6AspA9G/iGxqRw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187217-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187217: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:build-armhf:xen-build:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:windows-install:fail:heisenbug
    linux-linus:build-armhf-libvirt:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-examine:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-libvirt:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:build-check(1):blocked:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=7c626ce4bae1ac14f60076d00eafe71af30450ba
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 12 Aug 2024 20:55:45 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827
 build-armhf                   6 xen-build                fail REGR. vs. 186827

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail in 187216 pass in 187217
 test-amd64-amd64-xl-qemuu-ws16-amd64 12 windows-install    fail pass in 187216

Tests which did not succeed, but are not blocking:
 build-armhf-libvirt           1 build-check(1)               blocked  n/a
 test-armhf-armhf-examine      1 build-check(1)               blocked  n/a
 test-armhf-armhf-libvirt      1 build-check(1)               blocked  n/a
 test-armhf-armhf-libvirt-vhd  1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl           1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-arndale   1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-credit1   1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-credit2   1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-multivcpu  1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-qcow2     1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-raw       1 build-check(1)               blocked  n/a
 test-armhf-armhf-xl-rtds      1 build-check(1)               blocked  n/a
 test-armhf-armhf-libvirt 16 saverestore-support-check fail in 187216 like 186827
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop  fail in 187216 like 186827
 test-armhf-armhf-xl-arndale 15 migrate-support-check fail in 187216 never pass
 test-armhf-armhf-xl-arndale 16 saverestore-support-check fail in 187216 never pass
 test-armhf-armhf-libvirt    15 migrate-support-check fail in 187216 never pass
 test-armhf-armhf-xl-credit1 15 migrate-support-check fail in 187216 never pass
 test-armhf-armhf-xl-credit1 16 saverestore-support-check fail in 187216 never pass
 test-armhf-armhf-xl         15 migrate-support-check fail in 187216 never pass
 test-armhf-armhf-xl     16 saverestore-support-check fail in 187216 never pass
 test-armhf-armhf-xl-rtds    15 migrate-support-check fail in 187216 never pass
 test-armhf-armhf-xl-rtds 16 saverestore-support-check fail in 187216 never pass
 test-armhf-armhf-xl-credit2 15 migrate-support-check fail in 187216 never pass
 test-armhf-armhf-xl-credit2 16 saverestore-support-check fail in 187216 never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check fail in 187216 never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check fail in 187216 never pass
 test-armhf-armhf-xl-qcow2   14 migrate-support-check fail in 187216 never pass
 test-armhf-armhf-xl-qcow2 15 saverestore-support-check fail in 187216 never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check fail in 187216 never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check fail in 187216 never pass
 test-armhf-armhf-xl-raw     14 migrate-support-check fail in 187216 never pass
 test-armhf-armhf-xl-raw 15 saverestore-support-check fail in 187216 never pass
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 186827
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass

version targeted for testing:
 linux                7c626ce4bae1ac14f60076d00eafe71af30450ba
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   27 days
Failing since        186925  2024-07-20 09:44:52 Z   23 days   51 attempts
Testing same since   187214  2024-08-12 00:14:05 Z    0 days    3 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Mon Aug 12 21:40:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Aug 2024 21:40:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775778.1185955 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdcmE-00012t-5i; Mon, 12 Aug 2024 21:40:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775778.1185955; Mon, 12 Aug 2024 21:40:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdcmE-00012m-1H; Mon, 12 Aug 2024 21:40:30 +0000
Received: by outflank-mailman (input) for mailman id 775778;
 Mon, 12 Aug 2024 21:40:28 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=t0sR=PL=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sdcmC-00012g-8Q
 for xen-devel@lists.xenproject.org; Mon, 12 Aug 2024 21:40:28 +0000
Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com
 [2a00:1450:4864:20::431])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7cd8a090-58f3-11ef-a505-bb4a2ccca743;
 Mon, 12 Aug 2024 23:40:26 +0200 (CEST)
Received: by mail-wr1-x431.google.com with SMTP id
 ffacd0b85a97d-36868fcb919so2863651f8f.2
 for <xen-devel@lists.xenproject.org>; Mon, 12 Aug 2024 14:40:26 -0700 (PDT)
Received: from [192.168.1.10] (host-92-26-98-202.as13285.net. [92.26.98.202])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-36e4c93715asm8555676f8f.30.2024.08.12.14.40.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 12 Aug 2024 14:40:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7cd8a090-58f3-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723498826; x=1724103626; 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=kv2IkYiLEKLSCjw7hBr3PGkFtO3UkWasVBl2HKRipTw=;
        b=eInabzBj3Lby4n2mqVmtcXmuGRaWVqUVH09LzUjdAp7d3CiFLEh0EUTsS5I7469oXb
         oh2XmooW9cEBCreXbf+Psaca3MFJaSPfb1uWxRBTfOryDNuUVZ+ZZLn1ZdfEPnQSPrk7
         zD4X+f+lYpDdorV5IEU5NktBMa1JDfEAzRjGs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723498826; x=1724103626;
        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=kv2IkYiLEKLSCjw7hBr3PGkFtO3UkWasVBl2HKRipTw=;
        b=wn2j4eSUaMOGyexEKivT2MDDoKgv67hflg3QpUeBf0i+rDiqM3rbMTwaYBvTcoAlYz
         TMRxTHf0buVClvRW36ZzcuhBxKZ69pb7y+qrrFMCQBWQWISiPF3Y1FWgOA4cLjcu5UM2
         QJ8Z2eRtWpv8ePpa2Gln5G7XPUpunx/amtpjQp5w3qI47hno0QDZidHdgvqqiSCgWzcV
         +UidUXGDEi9v73eNQ+Jdr5obckwYH2MkD7TDihLowYxKxsHA0pAZRkxM38rO/IvKhSdY
         SwBASsjyFoE1IXOVtJwa44Crk3sjSTNz2+M44uidsuqG8zYAjSBDqaQ2C5PfoDu9TM+F
         n2Xw==
X-Forwarded-Encrypted: i=1; AJvYcCXYfPwHyAWjt1D+wq3JF1zbk7rWHQ5xArAddAsrdsErWZXRTgLS23/Y0vQM123PrBDoR/XW1I5nG3x9RhIT5tcW8x5MzGP75YBbbgqdffo=
X-Gm-Message-State: AOJu0Ywf79mqwXQrKyqJZ0qr2HswA1CXDl+tRmj8SXRMOqG/WSKFw39V
	ILPqAmfhRduS82TyLJrtQuSqQeLhHIzarD29vShbNMSzplJw8xf99bU6OBqWWIo=
X-Google-Smtp-Source: AGHT+IEJwWlFdcmD/YMTVIaxxNA6wCte/q06QIip2E6eoviBQlSg+9Ixt4z+teqY/EVsrSX/kayWiw==
X-Received: by 2002:adf:9c09:0:b0:36b:bd38:c724 with SMTP id ffacd0b85a97d-3716cd2e504mr1028292f8f.47.1723498826075;
        Mon, 12 Aug 2024 14:40:26 -0700 (PDT)
Message-ID: <18701bb3-7aa3-4f46-8071-be4cf75a2e76@citrix.com>
Date: Mon, 12 Aug 2024 22:40:24 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86: slightly simplify MB2/EFI "magic" check
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <f2186827-62e6-4b24-8a6c-0c2a9499c232@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <f2186827-62e6-4b24-8a6c-0c2a9499c232@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 08/08/2024 9:49 am, Jan Beulich wrote:
> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -233,13 +233,11 @@ __efi64_mb2_start:
>  
>          /* Check for Multiboot2 bootloader. */
>          cmp     $MULTIBOOT2_BOOTLOADER_MAGIC,%eax
> -        je      .Lefi_multiboot2_proto
>  
>          /* Jump to .Lnot_multiboot after switching CPU to x86_32 mode. */
>          lea     .Lnot_multiboot(%rip), %r15
> -        jmp     x86_32_switch
> +        jne     x86_32_switch
>  
> -.Lefi_multiboot2_proto:
>          /* Zero EFI SystemTable, EFI ImageHandle addresses and cmdline. */
>          xor     %esi,%esi
>          xor     %edi,%edi


You've split the logical in two, and now the comment is in the wrong
position.

If you're going to make this change, it wants to end up reading:

    /* Jump to .Lnot_multiboot after switching CPU to x86_32 mode. */
    lea     .Lnot_multiboot(%rip), %r15

    /* Check for Multiboot2 bootloader. */
    cmp     $MULTIBOOT2_BOOTLOADER_MAGIC,%eax
    jne     x86_32_switch


Not that it's really relevant, but this form also macrofuses nicely.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 01:11:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 01:11:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775794.1185973 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdg3v-0005pi-4t; Tue, 13 Aug 2024 01:10:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775794.1185973; Tue, 13 Aug 2024 01:10:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdg3v-0005pb-0O; Tue, 13 Aug 2024 01:10:59 +0000
Received: by outflank-mailman (input) for mailman id 775794;
 Tue, 13 Aug 2024 01:10: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=nBzl=PM=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1sdg3u-0005pS-2u
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 01:10:58 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e312f55f-5910-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 03:10:54 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.18.1/8.17.1) with ESMTPS id 47D1AgJv027961
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Mon, 12 Aug 2024 21:10:48 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.18.1/8.15.2/Submit) id 47D1AfGi027960;
 Mon, 12 Aug 2024 18:10:41 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e312f55f-5910-11ef-8776-851b0ebba9a2
Date: Mon, 12 Aug 2024 18:10:41 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: =?iso-8859-1?Q?J=FCrgen_Gro=DF?= <jgross@suse.com>
Cc: Andrei Semenov <andrei.semenov@vates.tech>, xen-devel@lists.xenproject.org,
        Andrew Cooper <andrew.cooper3@citrix.com>,
        Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Subject: Re: AMD EPYC virtual network performances
Message-ID: <Zrqykdarr7JHaeOZ@mattapan.m5p.com>
References: <959bbf84-24da-4da3-a059-dc1aa32b27ef@vates.tech>
 <352bba40-27fc-416b-985f-20e66c0c4b72@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <352bba40-27fc-416b-985f-20e66c0c4b72@suse.com>
X-Spam-Status: No, score=0.3 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=4.0.1
X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on mattapan.m5p.com

On Tue, Jul 09, 2024 at 11:37:07AM +0200, Jrgen Gro wrote:
> 
> In both directories you can see the number of spurious events by looking
> into the spurious_events file.
> 
> In the end the question is why so many spurious events are happening. Finding
> the reason might be hard, though.

Hopefully my comments on this drew your attention, yet lack of response
suggests otherwise.  I'm wondering whether this is an APIC misprogramming
issue, similar to the x2APIC issue which was causing trouble with recent
AMD processors.

Trying to go after the Linux software RAID1, my current attempt is
"iommu=debug iommu=no-intremap".  I'm seeing *lots* of messages from
spurious events in `xl dmesg`.  So many I have a difficult time believing
they are related to hardware I/O.

In which case could the performance problem observed by Andrei Semenov
be due to misprogramming of [x2]APIC triggering spurious events?


If so this is actually rather serious as there is so much noise it is
impossible to debug anything else.

In other news logs are available for private (PGP) viewing.  If one of
the core developers has an appropriate AMD machine (IOMMUv2, Zen 1 or
later; >=2 available SATA ports) I would send a pair of devices *known*
to manifest the RAID1 issue.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Tue Aug 13 01:45:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 01:45:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775804.1185981 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgbg-0002CW-NN; Tue, 13 Aug 2024 01:45:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775804.1185981; Tue, 13 Aug 2024 01:45:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgbg-0002CP-Ku; Tue, 13 Aug 2024 01:45:52 +0000
Received: by outflank-mailman (input) for mailman id 775804;
 Tue, 13 Aug 2024 01:45:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jgOn=PM=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sdgbf-0002CJ-PR
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 01:45:51 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org
 [2604:1380:40e1:4800::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c3c746a4-5915-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 03:45:50 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 8EAA3CE1098;
 Tue, 13 Aug 2024 01:45:45 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70FBCC4AF09;
 Tue, 13 Aug 2024 01:45:42 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c3c746a4-5915-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723513543;
	bh=y7xq1E/AVCMdkVkPZZGZ9H2ZIIdZ94R5oUZ1GBbJ0EM=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=q6IONffbf9PePnTEjpMVzp/BFnjwhOSRDZUYQC/vXbIjaq5yrLw/f2nn1rmbA14iS
	 2H/pvK9eDRg3/w/X0N02gNu8P8+VSGhB/9R1cTelc/Kfob5/5+BqJinWX2grM3JIvp
	 eicAG9xCylyfm/HP1LPhNAq0Xx39p1iReKPwCnxB4OPm92sZ7GXGeHnCipzANzEtOB
	 pleBhALP9lwvWXbm/W/muIFZHWF4IIZ0nBwEoEyjTUyBOtz7NpnuolUC2UKcM97Ky7
	 mGX3+squm1cKIElDwSR+M5/rpvXjaUY4+3hKBYPbmYp8dZNWAG5C8SqWTYmXpQ/Qmu
	 RWAFv3BR07o9Q==
Date: Mon, 12 Aug 2024 18:45:41 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony@xenproject.org, 
    paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
    xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, 
    xen-devel@lists.xenproject.org
Subject: Re: [PATCH v1 01/10] MAINTAINERS: Add docs/system/arm/xenpvh.rst
In-Reply-To: <20240812130606.90410-2-edgar.iglesias@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408121646290.298534@ubuntu-linux-20-04-desktop>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com> <20240812130606.90410-2-edgar.iglesias@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  MAINTAINERS | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 10af212632..a24c2e14d9 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -559,6 +559,7 @@ F: include/hw/xen/
>  F: include/sysemu/xen.h
>  F: include/sysemu/xen-mapcache.h
>  F: stubs/xen-hw-stub.c
> +F: docs/system/arm/xenpvh.rst
>  
>  Guest CPU Cores (NVMM)
>  ----------------------
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 01:45:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 01:45:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775805.1185992 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgbk-0002RD-VM; Tue, 13 Aug 2024 01:45:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775805.1185992; Tue, 13 Aug 2024 01:45:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgbk-0002R6-SD; Tue, 13 Aug 2024 01:45:56 +0000
Received: by outflank-mailman (input) for mailman id 775805;
 Tue, 13 Aug 2024 01:45:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jgOn=PM=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sdgbj-0002Qe-Pp
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 01:45:55 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org
 [2604:1380:40e1:4800::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c6003687-5915-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 03:45:53 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id CA89ACE10D3;
 Tue, 13 Aug 2024 01:45:51 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98C3AC4AF0D;
 Tue, 13 Aug 2024 01:45:49 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c6003687-5915-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723513551;
	bh=ECjQDs9jziapBcyXSTtq2tx6hUghV1n/XxS12P5heA0=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=RL1TyfKukkhFoK7lg6aUIzmfh+UjCF4vgBgj42v8NqiVovWn08NTuEl/1OommeWCx
	 eakdXydKoigcr39Mo32UuHCs/YG1M3OBrPyxngLg46TVYz3FATUxnnY0HzZkIcF9Yd
	 xZMqPwlD5nrweeprJkCRwBIA87nkrBC80sGSi5dyt1QHcXZDVhbCiCLpa940JbV+tA
	 EfSbNMaBoHu9PafV01E2G5RCkCd/+D8WQBsTxUYVNtHuHa8uPl1Dt8rgQzX09wvfXK
	 U+4fUVTaP8HiQIqn86tC8bSUJQDnGkIzknVUcKsC1ycdrNGUfTip80tTECBLDblCau
	 C89g7o2ir0RaA==
Date: Mon, 12 Aug 2024 18:45:48 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony@xenproject.org, 
    paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
    xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, 
    xen-devel@lists.xenproject.org, qemu-arm@nongnu.org
Subject: Re: [PATCH v1 02/10] hw/arm: xenpvh: Update file header to use
 SPDX
In-Reply-To: <20240812130606.90410-3-edgar.iglesias@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408121646560.298534@ubuntu-linux-20-04-desktop>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com> <20240812130606.90410-3-edgar.iglesias@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> 
> Update file header to use SPDX and remove stray empty
> comment line.
> 
> No functional changes.
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  hw/arm/xen_arm.c | 19 +------------------
>  1 file changed, 1 insertion(+), 18 deletions(-)
> 
> diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
> index 6fad829ede..766a194fa1 100644
> --- a/hw/arm/xen_arm.c
> +++ b/hw/arm/xen_arm.c
> @@ -1,24 +1,7 @@
>  /*
>   * QEMU ARM Xen PVH Machine
>   *
> - *
> - * Permission is hereby granted, free of charge, to any person obtaining a copy
> - * of this software and associated documentation files (the "Software"), to deal
> - * in the Software without restriction, including without limitation the 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 DEALINGS IN
> - * THE SOFTWARE.
> + * SPDX-License-Identifier: MIT
>   */
>  
>  #include "qemu/osdep.h"
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 01:46:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 01:46:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775806.1186001 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgbr-0002jB-5b; Tue, 13 Aug 2024 01:46:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775806.1186001; Tue, 13 Aug 2024 01:46:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgbr-0002j2-2m; Tue, 13 Aug 2024 01:46:03 +0000
Received: by outflank-mailman (input) for mailman id 775806;
 Tue, 13 Aug 2024 01:46:01 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jgOn=PM=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sdgbp-0002Qe-1j
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 01:46:01 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c9a848bf-5915-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 03:45:59 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id AE593614F9;
 Tue, 13 Aug 2024 01:45:57 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05C6FC4AF09;
 Tue, 13 Aug 2024 01:45:55 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c9a848bf-5915-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723513557;
	bh=c7qNRpyDUtvju/qAk+YMAJaPGvskpjD01S2agnEPCiQ=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=ilrZNn1Te05ZkG2uzeYAKdlwv80dCsj2//lN8yzLyuVj3U/Qyj7iqwjWW4+6Ro42A
	 IWzDqc2V3vtHcBfR1AoBMwl3cFrGLVP041j8EVPqhDA2yH+bq7agTFsbxsTqrx42tq
	 DG3R1GKtLEIhbFK3vPbIDKPGuC0h3WW7ptTqKMpC/FU1a+bazY2t1lnkzKFQFFAJT9
	 9t8u+tgiP3xY+tvMwjuW+BFptD2aFkutHgPHIestZf+yWGiqFAjvHK5wIaH3NWHvl9
	 nuvaMGxA33Mh92kR7w62I+He8YnVAtNXACPTIA99bO8tTcbXotSTuuk4pEPTyA+pky
	 fcVOQAqxDiLXw==
Date: Mon, 12 Aug 2024 18:45:54 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony@xenproject.org, 
    paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
    xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, 
    xen-devel@lists.xenproject.org, qemu-arm@nongnu.org
Subject: Re: [PATCH v1 03/10] hw/arm: xenpvh: Tweak machine description
In-Reply-To: <20240812130606.90410-4-edgar.iglesias@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408121647440.298534@ubuntu-linux-20-04-desktop>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com> <20240812130606.90410-4-edgar.iglesias@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> 
> Tweak machine description to better express that this is
> a Xen PVH machine for ARM.
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  hw/arm/xen_arm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
> index 766a194fa1..5f75cc3779 100644
> --- a/hw/arm/xen_arm.c
> +++ b/hw/arm/xen_arm.c
> @@ -216,7 +216,7 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
>  {
>  
>      MachineClass *mc = MACHINE_CLASS(oc);
> -    mc->desc = "Xen Para-virtualized PC";
> +    mc->desc = "Xen PVH ARM machine";
>      mc->init = xen_arm_init;
>      mc->max_cpus = 1;
>      mc->default_machine_opts = "accel=xen";
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 01:47:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 01:47:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775826.1186011 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgd9-0004Au-GO; Tue, 13 Aug 2024 01:47:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775826.1186011; Tue, 13 Aug 2024 01:47:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgd9-0004An-DW; Tue, 13 Aug 2024 01:47:23 +0000
Received: by outflank-mailman (input) for mailman id 775826;
 Tue, 13 Aug 2024 01:47:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jgOn=PM=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sdgd8-0004Ab-Jr
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 01:47:22 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fab79cb8-5915-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 03:47:21 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 6F0B06151C;
 Tue, 13 Aug 2024 01:47:20 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5CFBC4AF0D;
 Tue, 13 Aug 2024 01:47:18 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fab79cb8-5915-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723513640;
	bh=fMn8dtUROSmqJUNq0JhJUJsk6JPdhvOhOc2jEf7/A9o=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=urp84KlH+9mVHG3gXIHHqyYE9L/j0qFLU5qEooK4sM9aGZ9oCL+FLaJb8+fVvC4Ff
	 CjKD9eBGmyK7Laxkdq085YiJhqISw3IenQHdSrzDE73lgB4+r/SjEakswvLj8GjvWd
	 R8rzz0dNDPzLxTYxYr9Fa9wHC5CIHfjM30QpN30ElK6fn112oU9G5wvxuEu9WHzpoO
	 eayk5KUaukLhOcFkGP7DZhQXGSbLbyTla/XO9ayBaaca2+gqjaYF9NcbFXQnRdSa5U
	 P2Mh8GirKSOPN30GARr/a5FpJ/H4Slslzl8zF4dcYHqEgNE95vTtPsgAOTmLz3kElX
	 7a3GPUSMMxHrQ==
Date: Mon, 12 Aug 2024 18:47:17 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony@xenproject.org, 
    paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
    xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, 
    xen-devel@lists.xenproject.org, qemu-arm@nongnu.org
Subject: Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests
In-Reply-To: <20240812130606.90410-5-edgar.iglesias@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408121650590.298534@ubuntu-linux-20-04-desktop>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com> <20240812130606.90410-5-edgar.iglesias@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> 
> Add SMP support for Xen PVH ARM guests. Create max_cpus ioreq
> servers to handle hotplug.
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> ---
>  hw/arm/xen_arm.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
> index 5f75cc3779..ef8315969c 100644
> --- a/hw/arm/xen_arm.c
> +++ b/hw/arm/xen_arm.c
> @@ -173,7 +173,7 @@ static void xen_arm_init(MachineState *machine)
>  
>      xen_init_ram(machine);
>  
> -    xen_register_ioreq(xam->state, machine->smp.cpus, &xen_memory_listener);
> +    xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener);
>  
>      xen_create_virtio_mmio_devices(xam);
>  
> @@ -218,7 +218,8 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
>      MachineClass *mc = MACHINE_CLASS(oc);
>      mc->desc = "Xen PVH ARM machine";
>      mc->init = xen_arm_init;
> -    mc->max_cpus = 1;
> +    /* MAX number of vcpus supported by Xen.  */
> +    mc->max_cpus = GUEST_MAX_VCPUS;

Will this cause allocations of data structures with 128 elements?
Looking at hw/xen/xen-hvm-common.c:xen_do_ioreq_register it seems
possible? Or hw/xen/xen-hvm-common.c:xen_do_ioreq_register is called
later on with the precise vCPU value which should be provided to QEMU
via the -smp command line option
(tools/libs/light/libxl_dm.c:libxl__build_device_model_args_new)?



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 01:48:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 01:48:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775833.1186022 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgdl-0004gV-Ny; Tue, 13 Aug 2024 01:48:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775833.1186022; Tue, 13 Aug 2024 01:48:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgdl-0004gO-LJ; Tue, 13 Aug 2024 01:48:01 +0000
Received: by outflank-mailman (input) for mailman id 775833;
 Tue, 13 Aug 2024 01:48:00 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jgOn=PM=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sdgdk-0004dr-30
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 01:48:00 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0fb0bdc1-5916-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 03:47:57 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 1A992CE115A;
 Tue, 13 Aug 2024 01:47:55 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7DD5C4AF09;
 Tue, 13 Aug 2024 01:47:52 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0fb0bdc1-5916-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723513674;
	bh=cGXnWkFSW0WUXy8FVztv+ami4miDC4PeO4UhRrHpTFU=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=G9c+B7Hny3KVMSmQWbX4ro7MwKEXDoeoyxJZFS2Ybaz1PD5zTuHz6YQfdelCExTFy
	 ZCF/3ZoXSkVIJEoJUyz+QK/yqOAxD0Vsb8dtpNOnwLliJ7RWPGehMxaao6x7P5q7MB
	 4bz/ajVT2oOFm/rgsYyFPKFikfrofp0A6YQWOFQPA2DUk4MxYOLuf2lU9eyCKxvavL
	 M+Vr5SRc4f5goyXqdKXb1LEgk+I4P3I4pGOvoSRjqwkg7ZKgZaeF/+Irc/pIp66gZQ
	 nCmDYDLIf1z8k/Uztb3vtktPKFTKhhZ4mRGm19AmxOCjd+SeISzeO5QiG70tbJQvxu
	 wQNeJQ1dV2gHQ==
Date: Mon, 12 Aug 2024 18:47:51 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony@xenproject.org, 
    paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
    xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, 
    xen-devel@lists.xenproject.org, qemu-arm@nongnu.org
Subject: Re: [PATCH v1 05/10] hw/arm: xenpvh: Break out a common PVH module
In-Reply-To: <20240812130606.90410-6-edgar.iglesias@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408121720290.298534@ubuntu-linux-20-04-desktop>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com> <20240812130606.90410-6-edgar.iglesias@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> 
> Break out a common Xen PVH module in preparation for
> adding a x86 Xen PVH Machine.
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> ---
>  hw/arm/trace-events             |   5 -
>  hw/arm/xen_arm.c                | 154 ++++++--------------------
>  hw/xen/meson.build              |   1 +
>  hw/xen/trace-events             |   4 +
>  hw/xen/xen-pvh-common.c         | 185 ++++++++++++++++++++++++++++++++
>  include/hw/xen/xen-pvh-common.h |  45 ++++++++
>  6 files changed, 269 insertions(+), 125 deletions(-)
>  create mode 100644 hw/xen/xen-pvh-common.c
>  create mode 100644 include/hw/xen/xen-pvh-common.h
> 
> diff --git a/hw/arm/trace-events b/hw/arm/trace-events
> index be6c8f720b..c64ad344bd 100644
> --- a/hw/arm/trace-events
> +++ b/hw/arm/trace-events
> @@ -68,10 +68,5 @@ z2_aer915_send_too_long(int8_t msg) "message too long (%i bytes)"
>  z2_aer915_send(uint8_t reg, uint8_t value) "reg %d value 0x%02x"
>  z2_aer915_event(int8_t event, int8_t len) "i2c event =0x%x len=%d bytes"
>  
> -# xen_arm.c
> -xen_create_virtio_mmio_devices(int i, int irq, uint64_t base) "Created virtio-mmio device %d: irq %d base 0x%"PRIx64
> -xen_init_ram(uint64_t machine_ram_size) "Initialized xen ram with size 0x%"PRIx64
> -xen_enable_tpm(uint64_t addr) "Connected tpmdev at address 0x%"PRIx64
> -
>  # bcm2838.c
>  bcm2838_gic_set_irq(int irq, int level) "gic irq:%d lvl:%d"
> diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
> index ef8315969c..b8a5c09bdf 100644
> --- a/hw/arm/xen_arm.c
> +++ b/hw/arm/xen_arm.c
> @@ -12,40 +12,25 @@
>  #include "hw/irq.h"
>  #include "hw/sysbus.h"
>  #include "sysemu/block-backend.h"
> -#include "sysemu/tpm_backend.h"
>  #include "sysemu/sysemu.h"
> -#include "hw/xen/xen-hvm-common.h"
> +#include "hw/xen/xen-pvh-common.h"
>  #include "sysemu/tpm.h"
>  #include "hw/xen/arch_hvm.h"
> -#include "trace.h"
>  
>  #define TYPE_XEN_ARM  MACHINE_TYPE_NAME("xenpvh")
>  OBJECT_DECLARE_SIMPLE_TYPE(XenArmState, XEN_ARM)
>  
> -static const MemoryListener xen_memory_listener = {
> -    .region_add = xen_region_add,
> -    .region_del = xen_region_del,
> -    .log_start = NULL,
> -    .log_stop = NULL,
> -    .log_sync = NULL,
> -    .log_global_start = NULL,
> -    .log_global_stop = NULL,
> -    .priority = MEMORY_LISTENER_PRIORITY_ACCEL,
> -};
> -
>  struct XenArmState {
>      /*< private >*/
>      MachineState parent;
>  
> -    XenIOState *state;
> +    XenPVHCommonState pvh;
>  
>      struct {
>          uint64_t tpm_base_addr;
>      } cfg;
>  };
>  
> -static MemoryRegion ram_lo, ram_hi;
> -
>  /*
>   * VIRTIO_MMIO_DEV_SIZE is imported from tools/libs/light/libxl_arm.c under Xen
>   * repository.
> @@ -57,64 +42,6 @@ static MemoryRegion ram_lo, ram_hi;
>  #define NR_VIRTIO_MMIO_DEVICES   \
>     (GUEST_VIRTIO_MMIO_SPI_LAST - GUEST_VIRTIO_MMIO_SPI_FIRST)
>  
> -static void xen_set_irq(void *opaque, int irq, int level)
> -{
> -    if (xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level)) {
> -        error_report("xendevicemodel_set_irq_level failed");
> -    }
> -}
> -
> -static void xen_create_virtio_mmio_devices(XenArmState *xam)
> -{
> -    int i;
> -
> -    for (i = 0; i < NR_VIRTIO_MMIO_DEVICES; i++) {
> -        hwaddr base = GUEST_VIRTIO_MMIO_BASE + i * VIRTIO_MMIO_DEV_SIZE;
> -        qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL,
> -                                         GUEST_VIRTIO_MMIO_SPI_FIRST + i);
> -
> -        sysbus_create_simple("virtio-mmio", base, irq);
> -
> -        trace_xen_create_virtio_mmio_devices(i,
> -                                             GUEST_VIRTIO_MMIO_SPI_FIRST + i,
> -                                             base);
> -    }
> -}

There are 4 trivial functions in this file:

void arch_handle_ioreq(XenIOState *state, ioreq_t *req)
void arch_xen_set_memory(XenIOState *state, MemoryRegionSection *section,
                         bool add)
void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length)
void qmp_xen_set_global_dirty_log(bool enable, Error **errp)

Do you think it would make sense to move these too to xen-pvh-common.c ?


> -
> -static void xen_init_ram(MachineState *machine)
> -{
> -    MemoryRegion *sysmem = get_system_memory();
> -    ram_addr_t block_len, ram_size[GUEST_RAM_BANKS];
> -
> -    trace_xen_init_ram(machine->ram_size);
> -    if (machine->ram_size <= GUEST_RAM0_SIZE) {
> -        ram_size[0] = machine->ram_size;
> -        ram_size[1] = 0;
> -        block_len = GUEST_RAM0_BASE + ram_size[0];
> -    } else {
> -        ram_size[0] = GUEST_RAM0_SIZE;
> -        ram_size[1] = machine->ram_size - GUEST_RAM0_SIZE;
> -        block_len = GUEST_RAM1_BASE + ram_size[1];
> -    }
> -
> -    memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len,
> -                           &error_fatal);
> -
> -    memory_region_init_alias(&ram_lo, NULL, "xen.ram.lo", &xen_memory,
> -                             GUEST_RAM0_BASE, ram_size[0]);
> -    memory_region_add_subregion(sysmem, GUEST_RAM0_BASE, &ram_lo);
> -    if (ram_size[1] > 0) {
> -        memory_region_init_alias(&ram_hi, NULL, "xen.ram.hi", &xen_memory,
> -                                 GUEST_RAM1_BASE, ram_size[1]);
> -        memory_region_add_subregion(sysmem, GUEST_RAM1_BASE, &ram_hi);
> -    }
> -
> -    /* Setup support for grants.  */
> -    memory_region_init_ram(&xen_grants, NULL, "xen.grants", block_len,
> -                           &error_fatal);
> -    memory_region_add_subregion(sysmem, XEN_GRANT_ADDR_OFF, &xen_grants);
> -}
> -
>  void arch_handle_ioreq(XenIOState *state, ioreq_t *req)
>  {
>      hw_error("Invalid ioreq type 0x%x\n", req->type);
> @@ -135,55 +62,42 @@ void qmp_xen_set_global_dirty_log(bool enable, Error **errp)
>  {
>  }
>  
> -#ifdef CONFIG_TPM
> -static void xen_enable_tpm(XenArmState *xam)
> -{
> -    Error *errp = NULL;
> -    DeviceState *dev;
> -    SysBusDevice *busdev;
> -
> -    TPMBackend *be = qemu_find_tpm_be("tpm0");
> -    if (be == NULL) {
> -        error_report("Couldn't find tmp0 backend");
> -        return;
> -    }
> -    dev = qdev_new(TYPE_TPM_TIS_SYSBUS);
> -    object_property_set_link(OBJECT(dev), "tpmdev", OBJECT(be), &errp);
> -    object_property_set_str(OBJECT(dev), "tpmdev", be->id, &errp);
> -    busdev = SYS_BUS_DEVICE(dev);
> -    sysbus_realize_and_unref(busdev, &error_fatal);
> -    sysbus_mmio_map(busdev, 0, xam->cfg.tpm_base_addr);
> -
> -    trace_xen_enable_tpm(xam->cfg.tpm_base_addr);
> -}
> -#endif
> -
> -static void xen_arm_init(MachineState *machine)
> +static void xen_arm_init(MachineState *ms)
>  {
> -    XenArmState *xam = XEN_ARM(machine);
> -
> -    xam->state =  g_new0(XenIOState, 1);
> +    XenArmState *xam = XEN_ARM(ms);
> +    const struct {
> +        const char *name;
> +        MemMapEntry map;
> +    } map[] = {
> +        { "ram-low", { GUEST_RAM0_BASE, GUEST_RAM0_SIZE } },
> +        { "ram-high", { GUEST_RAM1_BASE, GUEST_RAM1_SIZE } },
> +        { "virtio-mmio", { GUEST_VIRTIO_MMIO_BASE, VIRTIO_MMIO_DEV_SIZE } },
> +        { "tpm", { xam->cfg.tpm_base_addr, 0x1000 } },
> +    };
> +    int i;
>  
> -    if (machine->ram_size == 0) {
> -        warn_report("%s non-zero ram size not specified. QEMU machine started"
> -                    " without IOREQ (no emulated devices including virtio)",
> -                    MACHINE_CLASS(object_get_class(OBJECT(machine)))->desc);
> -        return;
> +    object_initialize_child(OBJECT(ms), "pvh", &xam->pvh, TYPE_XEN_PVH_COMMON);
> +
> +    object_property_set_int(OBJECT(&xam->pvh), "max-cpus", ms->smp.max_cpus,
> +                            &error_abort);

Is ms->smp.max_cpus updated according to the QEMU command line option?
If so, that would solve the problem of the static initialization of
max_cpus to GUEST_MAX_VCPUS in xen_arm_machine_class_init.


> +    object_property_set_int(OBJECT(&xam->pvh), "ram-size", ms->ram_size,
> +                            &error_abort);
> +    object_property_set_int(OBJECT(&xam->pvh), "virtio-mmio-num",
> +                            NR_VIRTIO_MMIO_DEVICES, &error_abort);
> +    object_property_set_int(OBJECT(&xam->pvh), "virtio-mmio-irq-base",
> +                            GUEST_VIRTIO_MMIO_SPI_FIRST, &error_abort);
> +
> +    for (i = 0; i < ARRAY_SIZE(map); i++) {
> +        g_autofree char *base_name = g_strdup_printf("%s-base", map[i].name);
> +        g_autofree char *size_name = g_strdup_printf("%s-size", map[i].name);
> +
> +        object_property_set_int(OBJECT(&xam->pvh), base_name, map[i].map.base,
> +                                &error_abort);
> +        object_property_set_int(OBJECT(&xam->pvh), size_name, map[i].map.size,
> +                                &error_abort);
>      }
>  
> -    xen_init_ram(machine);
> -
> -    xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener);
> -
> -    xen_create_virtio_mmio_devices(xam);
> -
> -#ifdef CONFIG_TPM
> -    if (xam->cfg.tpm_base_addr) {
> -        xen_enable_tpm(xam);

Do you think it makes sense also to move xen_arm_get_tpm_base_addr and
xen_arm_set_tpm_base_addr to xen-pvh-common.c ?



> -    } else {
> -        warn_report("tpm-base-addr is not provided. TPM will not be enabled");
> -    }
> -#endif
> +    sysbus_realize(SYS_BUS_DEVICE(&xam->pvh), &error_abort);
>  }
>  
>  #ifdef CONFIG_TPM
> diff --git a/hw/xen/meson.build b/hw/xen/meson.build
> index d887fa9ba4..4a486e3673 100644
> --- a/hw/xen/meson.build
> +++ b/hw/xen/meson.build
> @@ -15,6 +15,7 @@ xen_specific_ss = ss.source_set()
>  xen_specific_ss.add(files(
>    'xen-mapcache.c',
>    'xen-hvm-common.c',
> +  'xen-pvh-common.c',
>  ))
>  if have_xen_pci_passthrough
>    xen_specific_ss.add(files(
> diff --git a/hw/xen/trace-events b/hw/xen/trace-events
> index d1b27f6c11..a07fe41c6d 100644
> --- a/hw/xen/trace-events
> +++ b/hw/xen/trace-events
> @@ -64,6 +64,10 @@ destroy_hvm_domain_cannot_acquire_handle(void) "Cannot acquire xenctrl handle"
>  destroy_hvm_domain_failed_action(const char *action, int sts, char *errno_s) "xc_domain_shutdown failed to issue %s, sts %d, %s"
>  destroy_hvm_domain_action(int xen_domid, const char *action) "Issued domain %d %s"
>  
> +# xen-pvh-common.c
> +xen_create_virtio_mmio_devices(int i, int irq, uint64_t base) "Created virtio-mmio device %d: irq %d base 0x%"PRIx64
> +xen_enable_tpm(uint64_t addr) "Connected tpmdev at address 0x%"PRIx64
> +
>  # xen-mapcache.c
>  xen_map_cache(uint64_t phys_addr) "want 0x%"PRIx64
>  xen_remap_bucket(uint64_t index) "index 0x%"PRIx64
> diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
> new file mode 100644
> index 0000000000..0d368398d0
> --- /dev/null
> +++ b/hw/xen/xen-pvh-common.c
> @@ -0,0 +1,185 @@
> +/*
> + * Common Xen PVH code.
> + *
> + * Copyright (c) 2024 Advanced Micro Devices, Inc.
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
> +#include "qemu/osdep.h"
> +#include "qemu/error-report.h"
> +#include "qapi/error.h"
> +#include "hw/boards.h"
> +#include "hw/irq.h"
> +#include "hw/sysbus.h"
> +#include "sysemu/sysemu.h"
> +#include "sysemu/tpm.h"
> +#include "sysemu/tpm_backend.h"
> +#include "hw/xen/xen-pvh-common.h"
> +#include "trace.h"
> +
> +static const MemoryListener xen_memory_listener = {
> +    .region_add = xen_region_add,
> +    .region_del = xen_region_del,
> +    .log_start = NULL,
> +    .log_stop = NULL,
> +    .log_sync = NULL,
> +    .log_global_start = NULL,
> +    .log_global_stop = NULL,
> +    .priority = MEMORY_LISTENER_PRIORITY_ACCEL,
> +};
> +
> +static void xen_pvh_init_ram(XenPVHCommonState *s,
> +                             MemoryRegion *sysmem)
> +{
> +    ram_addr_t block_len, ram_size[2];
> +
> +    if (s->cfg.ram_size <= s->cfg.ram_low.size) {
> +        ram_size[0] = s->cfg.ram_size;
> +        ram_size[1] = 0;
> +        block_len = s->cfg.ram_low.base + ram_size[0];
> +    } else {
> +        ram_size[0] = s->cfg.ram_low.size;
> +        ram_size[1] = s->cfg.ram_size - s->cfg.ram_low.size;
> +        block_len = s->cfg.ram_high.base + ram_size[1];
> +    }
> +
> +    memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len,
> +                           &error_fatal);
> +
> +    memory_region_init_alias(&s->ram.low, NULL, "xen.ram.lo", &xen_memory,
> +                             s->cfg.ram_low.base, ram_size[0]);
> +    memory_region_add_subregion(sysmem, s->cfg.ram_low.base, &s->ram.low);
> +    if (ram_size[1] > 0) {
> +        memory_region_init_alias(&s->ram.high, NULL, "xen.ram.hi", &xen_memory,
> +                                 s->cfg.ram_high.base, ram_size[1]);
> +        memory_region_add_subregion(sysmem, s->cfg.ram_high.base, &s->ram.high);
> +    }
> +
> +    /* Setup support for grants.  */
> +    memory_region_init_ram(&xen_grants, NULL, "xen.grants", block_len,
> +                           &error_fatal);
> +    memory_region_add_subregion(sysmem, XEN_GRANT_ADDR_OFF, &xen_grants);
> +}
> +
> +static void xen_set_irq(void *opaque, int irq, int level)
> +{
> +    if (xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level)) {
> +        error_report("xendevicemodel_set_irq_level failed");
> +    }
> +}
> +
> +static void xen_create_virtio_mmio_devices(XenPVHCommonState *s)
> +{
> +    int i;
> +
> +    for (i = 0; i < s->cfg.virtio_mmio_num; i++) {
> +        hwaddr base = s->cfg.virtio_mmio.base + i * s->cfg.virtio_mmio.size;
> +        qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL,
> +                                         s->cfg.virtio_mmio_irq_base + i);
> +
> +        sysbus_create_simple("virtio-mmio", base, irq);
> +
> +        trace_xen_create_virtio_mmio_devices(i,
> +                                             s->cfg.virtio_mmio_irq_base + i,
> +                                             base);
> +    }
> +}
> +
> +#ifdef CONFIG_TPM
> +static void xen_enable_tpm(XenPVHCommonState *s)
> +{
> +    Error *errp = NULL;
> +    DeviceState *dev;
> +    SysBusDevice *busdev;
> +
> +    TPMBackend *be = qemu_find_tpm_be("tpm0");
> +    if (be == NULL) {
> +        error_report("Couldn't find tmp0 backend");
> +        return;
> +    }
> +    dev = qdev_new(TYPE_TPM_TIS_SYSBUS);
> +    object_property_set_link(OBJECT(dev), "tpmdev", OBJECT(be), &errp);
> +    object_property_set_str(OBJECT(dev), "tpmdev", be->id, &errp);
> +    busdev = SYS_BUS_DEVICE(dev);
> +    sysbus_realize_and_unref(busdev, &error_fatal);
> +    sysbus_mmio_map(busdev, 0, s->cfg.tpm.base);
> +
> +    trace_xen_enable_tpm(s->cfg.tpm.base);
> +}
> +#endif
> +
> +static void xen_pvh_realize(DeviceState *dev, Error **errp)
> +{
> +    XenPVHCommonState *s = XEN_PVH_COMMON(dev);
> +    MemoryRegion *sysmem = get_system_memory();
> +
> +    if (s->cfg.ram_size == 0) {
> +        /* FIXME: Prefix with object path and consider bailing out.  */

I am not sure about these two FIXME


> +        warn_report("non-zero ram size not specified. QEMU machine started"
> +                    " without IOREQ (no emulated devices including virtio)");

Also the warn message has a double negative?


> +        return;
> +    }
> +
> +    if (s->cfg.max_cpus == 0) {
> +        /* FIXME: Prefix with object path and bail out.  */
> +        warn_report("max-cpus not specified. QEMU machine started");
> +        return;
> +    }
> +
> +    xen_pvh_init_ram(s, sysmem);
> +    xen_register_ioreq(&s->ioreq, s->cfg.max_cpus, &xen_memory_listener);
> +
> +    if (s->cfg.virtio_mmio_num) {
> +        xen_create_virtio_mmio_devices(s);
> +    }
> +
> +#ifdef CONFIG_TPM
> +    if (s->cfg.tpm.base) {
> +        xen_enable_tpm(s);
> +    } else {
> +        warn_report("tpm-base-addr is not provided. TPM will not be enabled");
> +    }
> +#endif
> +}
> +
> +#define DEFINE_PROP_MEMMAP(n, f) \
> +    DEFINE_PROP_UINT64(n "-base", XenPVHCommonState, cfg.f.base, 0), \
> +    DEFINE_PROP_UINT64(n "-size", XenPVHCommonState, cfg.f.size, 0)
> +
> +static Property xen_pvh_properties[] = {
> +    DEFINE_PROP_UINT32("max-cpus", XenPVHCommonState, cfg.max_cpus, 0),
> +    DEFINE_PROP_UINT64("ram-size", XenPVHCommonState, cfg.ram_size, 0),
> +    DEFINE_PROP_MEMMAP("ram-low", ram_low),
> +    DEFINE_PROP_MEMMAP("ram-high", ram_high),
> +    DEFINE_PROP_MEMMAP("virtio-mmio", virtio_mmio),
> +    DEFINE_PROP_MEMMAP("tpm", tpm),
> +    DEFINE_PROP_UINT32("virtio-mmio-num", XenPVHCommonState,
> +                       cfg.virtio_mmio_num, 0),
> +    DEFINE_PROP_UINT32("virtio-mmio-irq-base", XenPVHCommonState,
> +                       cfg.virtio_mmio_irq_base, 0),
> +    DEFINE_PROP_END_OF_LIST()
> +};
> +
> +static void xen_pvh_class_init(ObjectClass *klass, void *data)
> +{
> +    DeviceClass *dc = DEVICE_CLASS(klass);
> +
> +    dc->realize = xen_pvh_realize;
> +    device_class_set_props(dc, xen_pvh_properties);
> +    /* No VMSD since we haven't got any top-level SoC state to save.  */
> +}
> +
> +static const TypeInfo xen_pvh_info = {
> +    .name = TYPE_XEN_PVH_COMMON,
> +    .parent = TYPE_SYS_BUS_DEVICE,
> +    .instance_size = sizeof(XenPVHCommonState),
> +    .class_init = xen_pvh_class_init,
> +};
> +
> +static void xen_pvh_register_types(void)
> +{
> +    type_register_static(&xen_pvh_info);
> +}
> +
> +type_init(xen_pvh_register_types);
> diff --git a/include/hw/xen/xen-pvh-common.h b/include/hw/xen/xen-pvh-common.h
> new file mode 100644
> index 0000000000..e958b441fd
> --- /dev/null
> +++ b/include/hw/xen/xen-pvh-common.h
> @@ -0,0 +1,45 @@
> +/*
> + * QEMU Xen PVH machine - common code.
> + *
> + * Copyright (c) 2024 Advanced Micro Devices, Inc.
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
> +#ifndef XEN_PVH_COMMON_H__
> +#define XEN_PVH_COMMON_H__
> +
> +#include <assert.h>
> +#include "hw/sysbus.h"
> +#include "hw/hw.h"
> +#include "hw/xen/xen-hvm-common.h"
> +#include "hw/pci-host/gpex.h"
> +
> +#define TYPE_XEN_PVH_COMMON "xen-pvh-common"
> +OBJECT_DECLARE_SIMPLE_TYPE(XenPVHCommonState, XEN_PVH_COMMON)
> +
> +typedef struct XenPVHCommonState {
> +    /*< private >*/
> +    SysBusDevice parent_obj;
> +
> +    XenIOState ioreq;
> +
> +    struct {
> +        MemoryRegion low;
> +        MemoryRegion high;
> +    } ram;
> +
> +    struct {
> +        uint64_t ram_size;
> +        uint32_t max_cpus;
> +        uint32_t virtio_mmio_num;
> +        uint32_t virtio_mmio_irq_base;
> +        struct {
> +            uint64_t base;
> +            uint64_t size;
> +        } ram_low, ram_high,
> +          virtio_mmio,
> +          tpm;
> +    } cfg;
> +} XenPVHCommonState;
> +#endif
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 01:48:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 01:48:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775834.1186032 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgds-0004zD-2n; Tue, 13 Aug 2024 01:48:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775834.1186032; Tue, 13 Aug 2024 01:48:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgdr-0004z4-W5; Tue, 13 Aug 2024 01:48:07 +0000
Received: by outflank-mailman (input) for mailman id 775834;
 Tue, 13 Aug 2024 01:48:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jgOn=PM=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sdgdq-0004Ab-QM
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 01:48:06 +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 14af59ca-5916-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 03:48:06 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id A5F60CE1153;
 Tue, 13 Aug 2024 01:48:03 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42CACC4AF09;
 Tue, 13 Aug 2024 01:48:01 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 14af59ca-5916-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723513682;
	bh=VkK9y3PftMujevNgRvLFeHhq9QPvuE6tdab0J9rfRrQ=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=uEeLSfLHcLEgcCu0BjrGZDwg1HpxlafoArMgDFX7h2PUDazcstMjFJVFo9gArJXH9
	 AwU66a/gXHvf4ey3lfyNuynXq8IXsgRRihLrK4FBpZ/lm3STkUy8W8DU1Hzu2lAq/8
	 KCzrRWXk9eS+WizWjlNg6bnW7O4gw9tpWKt6zp6F5OmKS/VK2psZ+01bv2B0d/wo4S
	 ZUQ8sKnhyMGvK2hxoH1JvbHT4OxtEmrs7lCqljTelHTep9nEHkPbweg53AlXcl855i
	 S3xYjYgQ8qXps0jq+zd8DblXZ7Ashp+HJxnlos8sg+t0l5SBqzys3gtlKKEs5w0tyg
	 BEvEv7QJ5tLFw==
Date: Mon, 12 Aug 2024 18:48:00 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony@xenproject.org, 
    paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
    xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, 
    xen-devel@lists.xenproject.org, qemu-arm@nongnu.org
Subject: Re: [PATCH v1 06/10] hw/arm: xenpvh: Rename xen_arm.c -> xen-pvh.c
In-Reply-To: <20240812130606.90410-7-edgar.iglesias@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408121812210.298534@ubuntu-linux-20-04-desktop>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com> <20240812130606.90410-7-edgar.iglesias@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> 
> Rename xen_arm.c -> xen-pvh.c to better express that this
> is a PVH machine and to align with x86 HVM and future PVH
> machine filenames:
> hw/i386/xen/xen-hvm.c
> hw/i386/xen/xen-pvh.c (in preparation)
> 
> No functional changes.
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  hw/arm/meson.build              | 2 +-
>  hw/arm/{xen_arm.c => xen-pvh.c} | 0
>  2 files changed, 1 insertion(+), 1 deletion(-)
>  rename hw/arm/{xen_arm.c => xen-pvh.c} (100%)
> 
> diff --git a/hw/arm/meson.build b/hw/arm/meson.build
> index 0c07ab522f..769fe9ec1a 100644
> --- a/hw/arm/meson.build
> +++ b/hw/arm/meson.build
> @@ -59,7 +59,7 @@ arm_ss.add(when: 'CONFIG_FSL_IMX7', if_true: files('fsl-imx7.c', 'mcimx7d-sabre.
>  arm_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmuv3.c'))
>  arm_ss.add(when: 'CONFIG_FSL_IMX6UL', if_true: files('fsl-imx6ul.c', 'mcimx6ul-evk.c'))
>  arm_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_soc.c'))
> -arm_ss.add(when: 'CONFIG_XEN', if_true: files('xen_arm.c'))
> +arm_ss.add(when: 'CONFIG_XEN', if_true: files('xen-pvh.c'))
>  
>  system_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmu-common.c'))
>  system_ss.add(when: 'CONFIG_CHEETAH', if_true: files('palm.c'))
> diff --git a/hw/arm/xen_arm.c b/hw/arm/xen-pvh.c
> similarity index 100%
> rename from hw/arm/xen_arm.c
> rename to hw/arm/xen-pvh.c
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 01:48:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 01:48:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775835.1186042 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgdx-0005Iy-9N; Tue, 13 Aug 2024 01:48:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775835.1186042; Tue, 13 Aug 2024 01:48:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgdx-0005Ip-6X; Tue, 13 Aug 2024 01:48:13 +0000
Received: by outflank-mailman (input) for mailman id 775835;
 Tue, 13 Aug 2024 01:48:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jgOn=PM=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sdgdv-0004Ab-RQ
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 01:48:11 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 184f2c65-5916-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 03:48:11 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id E3D6261522;
 Tue, 13 Aug 2024 01:48:09 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54A4DC4AF0D;
 Tue, 13 Aug 2024 01:48:08 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 184f2c65-5916-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723513689;
	bh=LynzrHYz8D0kw2B04lBsBEFfNJwdRhtojW0Yvbjp3qQ=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=XbvMesIUTszXI/eTME4zydA6roCrVH5Fapt4+25OQsRQ219lE794BCMnotWSbFhOK
	 5cKSJXzO0+g2gdHeBImOFjuvw7YSYyVtAUY/yvQ7+/CpdBCF1Xh94kXaTkpVIQXd/L
	 iUqvp27U17axV7oY2jir3sHaRbIRBNLkTdiC3APYuY3CcvInex14A/tNkQOf0s+JXb
	 euhC0w0OGzQ13OenNlNURydVn8W7vDouK5q3UEvRqimvhxKnUQwRI5EoQc8ZuFew5m
	 OYQ4j173cIZiyd8I9bNU23aKetIiDls47NgFs7bBipAdmto/SG7f4lVxX+JN5OswtR
	 jKB1CC7LfiqaA==
Date: Mon, 12 Aug 2024 18:48:07 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony@xenproject.org, 
    paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
    xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, 
    xen-devel@lists.xenproject.org
Subject: Re: [PATCH v1 07/10] hw/arm: xenpvh: Reverse virtio-mmio creation
 order
In-Reply-To: <20240812130606.90410-8-edgar.iglesias@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408121813200.298534@ubuntu-linux-20-04-desktop>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com> <20240812130606.90410-8-edgar.iglesias@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> 
> We've been creating the virtio-mmio devices in forwards order
> but since the qbus lists prepend (rather than append) entries,
> the virtio busses end up with decreasing base address order.
> 
> Xen enables virtio-mmio nodes in forwards order so there's been
> a missmatch. So far, we've been working around this with an
> out-of-tree patch to Xen.
> 
> This reverses the order making sure the virtio busses end up
> ordered with increasing base addresses avoiding the need to
> patch Xen.
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  hw/xen/xen-pvh-common.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
> index 0d368398d0..69a2dbdb6d 100644
> --- a/hw/xen/xen-pvh-common.c
> +++ b/hw/xen/xen-pvh-common.c
> @@ -73,7 +73,18 @@ static void xen_create_virtio_mmio_devices(XenPVHCommonState *s)
>  {
>      int i;
>  
> -    for (i = 0; i < s->cfg.virtio_mmio_num; i++) {
> +    /*
> +     * We create the transports in reverse order. Since qbus_realize()
> +     * prepends (not appends) new child buses, the decrementing loop below will
> +     * create a list of virtio-mmio buses with increasing base addresses.
> +     *
> +     * When a -device option is processed from the command line,
> +     * qbus_find_recursive() picks the next free virtio-mmio bus in forwards
> +     * order.
> +     *
> +     * This is what the Xen tools expect.
> +     */
> +    for (i = s->cfg.virtio_mmio_num - 1; i >= 0; i--) {
>          hwaddr base = s->cfg.virtio_mmio.base + i * s->cfg.virtio_mmio.size;
>          qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL,
>                                           s->cfg.virtio_mmio_irq_base + i);
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 01:48:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 01:48:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775851.1186052 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgeT-0006AY-Gg; Tue, 13 Aug 2024 01:48:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775851.1186052; Tue, 13 Aug 2024 01:48:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgeT-0006AR-Dz; Tue, 13 Aug 2024 01:48:45 +0000
Received: by outflank-mailman (input) for mailman id 775851;
 Tue, 13 Aug 2024 01:48:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jgOn=PM=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sdgeR-0004dr-CZ
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 01:48:43 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2a5aa4f3-5916-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 03:48:41 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 5DB7561524;
 Tue, 13 Aug 2024 01:48:40 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id C015EC4AF0E;
 Tue, 13 Aug 2024 01:48:38 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2a5aa4f3-5916-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723513720;
	bh=G6inMSvY1KniC+SCcLnpUK0HXdFGeYhyTMLJYR3qE7w=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=VjyXlIeV4kQ2WzOXxbxlCYIi6UptcMnZdLkoF3e8r9kG9Ydz9kfLxBg0T+sUZjXsp
	 +gFY6p8zEleJAxF4daY4Thi9wrUbvtKoB1i4cpy+yGyGtS71GK2Xc4v5UjlWfAhdbe
	 IZgsZHbTVJbIwe4ZLarKn+gz6MXKmItENYqdNHeaCNcx/0Bu2JGQY3izVXAsQ0mxde
	 UiChJOKpQ3J5uoYOTID4Co8tygjuhxjYGEyHodpHPFPEEKFqnJaOgVJTBiMLZoMr5T
	 YyFvzWDroSIVEPuoaR/TQrTorGLZK6chHtgsHS119qk8DXjgGyMYzWNX7UAsBCG0j+
	 iqM1M7sYw+VkQ==
Date: Mon, 12 Aug 2024 18:48:37 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony@xenproject.org, 
    paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
    xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, 
    xen-devel@lists.xenproject.org
Subject: Re: [PATCH v1 08/10] hw/xen: pvh-common: Add support for creating
 PCIe/GPEX
In-Reply-To: <20240812130606.90410-9-edgar.iglesias@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408121822370.298534@ubuntu-linux-20-04-desktop>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com> <20240812130606.90410-9-edgar.iglesias@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> 
> Add support for optionally creating a PCIe/GPEX controller.
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> ---
>  hw/xen/xen-pvh-common.c         | 66 +++++++++++++++++++++++++++++++++
>  include/hw/xen/xen-pvh-common.h | 10 ++++-
>  2 files changed, 75 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
> index 69a2dbdb6d..b1432e4bd9 100644
> --- a/hw/xen/xen-pvh-common.c
> +++ b/hw/xen/xen-pvh-common.c
> @@ -120,6 +120,59 @@ static void xen_enable_tpm(XenPVHCommonState *s)
>  }
>  #endif
>  
> +static void xen_set_pci_intx_irq(void *opaque, int irq, int level)
> +{
> +    if (xen_set_pci_intx_level(xen_domid, 0, 0, 0, irq, level)) {

Looking at the implementation of XEN_DMOP_set_pci_intx_level in
xen/arch/x86/hvm/dm.c, it looks like the device parameter of
xen_set_pci_intx_level is required?


> +        error_report("xendevicemodel_set_pci_intx_level failed");
> +    }
> +}
> +
> +static inline void xenpvh_gpex_init(XenPVHCommonState *s,
> +                                    MemoryRegion *sysmem,
> +                                    hwaddr ecam_base, hwaddr ecam_size,
> +                                    hwaddr mmio_base, hwaddr mmio_size,
> +                                    hwaddr mmio_high_base,
> +                                    hwaddr mmio_high_size,
> +                                    int intx_irq_base)
> +{
> +    MemoryRegion *ecam_reg;
> +    MemoryRegion *mmio_reg;
> +    DeviceState *dev;
> +    int i;
> +
> +    object_initialize_child(OBJECT(s), "gpex", &s->pci.gpex,
> +                            TYPE_GPEX_HOST);
> +    dev = DEVICE(&s->pci.gpex);
> +    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
> +
> +    ecam_reg = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
> +    memory_region_add_subregion(sysmem, ecam_base, ecam_reg);

I notice we don't use ecam_size anywhere? Is that because the size is
standard?


> +    mmio_reg = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1);
> +
> +    if (mmio_size) {
> +        memory_region_init_alias(&s->pci.mmio_alias, OBJECT(dev), "pcie-mmio",
> +                                 mmio_reg, mmio_base, mmio_size);
> +        memory_region_add_subregion(sysmem, mmio_base, &s->pci.mmio_alias);
> +    }
> +
> +    if (mmio_high_size) {
> +        memory_region_init_alias(&s->pci.mmio_high_alias, OBJECT(dev),
> +                "pcie-mmio-high",
> +                mmio_reg, mmio_high_base, mmio_high_size);
> +        memory_region_add_subregion(sysmem, mmio_high_base,
> +                &s->pci.mmio_high_alias);
> +    }
> +
> +    for (i = 0; i < GPEX_NUM_IRQS; i++) {
> +        qemu_irq irq = qemu_allocate_irq(xen_set_pci_intx_irq, s, i);
> +
> +        sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, irq);
> +        gpex_set_irq_num(GPEX_HOST(dev), i, intx_irq_base + i);
> +        xen_set_pci_link_route(i, intx_irq_base + i);

xen_set_pci_link_route is not currently implemented on ARM?

Looking at hw/i386/pc_piix.c:piix_intx_routing_notifier_xen it seems
that the routing is much more complex over there. But looking at other
machines that use GPEX such as hw/arm/virt.c it looks like the routing
is straightforward the same way as in this patch.

I thought that PCI interrupt pin swizzling was required, but maybe not ?

It is totally fine if we do something different, simpler, than
hw/i386/pc_piix.c:piix_intx_routing_notifier_xen. I just want to make
sure that things remain consistent between ARM and x86, and also between
Xen and QEMU view of virtual PCI interrupt routing.



> +    }
> +}
> +
>  static void xen_pvh_realize(DeviceState *dev, Error **errp)
>  {
>      XenPVHCommonState *s = XEN_PVH_COMMON(dev);
> @@ -152,6 +205,14 @@ static void xen_pvh_realize(DeviceState *dev, Error **errp)
>          warn_report("tpm-base-addr is not provided. TPM will not be enabled");
>      }
>  #endif
> +
> +    if (s->cfg.ecam.size) {
> +        xenpvh_gpex_init(s, sysmem,
> +                         s->cfg.ecam.base, s->cfg.ecam.size,
> +                         s->cfg.mmio.base, s->cfg.mmio.size,
> +                         s->cfg.mmio_high.base, s->cfg.mmio_high.size,
> +                         s->cfg.pci_intx_irq_base);
> +    }
>  }
>  
>  #define DEFINE_PROP_MEMMAP(n, f) \
> @@ -165,10 +226,15 @@ static Property xen_pvh_properties[] = {
>      DEFINE_PROP_MEMMAP("ram-high", ram_high),
>      DEFINE_PROP_MEMMAP("virtio-mmio", virtio_mmio),
>      DEFINE_PROP_MEMMAP("tpm", tpm),
> +    DEFINE_PROP_MEMMAP("pci-ecam", ecam),
> +    DEFINE_PROP_MEMMAP("pci-mmio", mmio),
> +    DEFINE_PROP_MEMMAP("pci-mmio-high", mmio_high),
>      DEFINE_PROP_UINT32("virtio-mmio-num", XenPVHCommonState,
>                         cfg.virtio_mmio_num, 0),
>      DEFINE_PROP_UINT32("virtio-mmio-irq-base", XenPVHCommonState,
>                         cfg.virtio_mmio_irq_base, 0),
> +    DEFINE_PROP_UINT32("pci-intx-irq-base", XenPVHCommonState,
> +                       cfg.pci_intx_irq_base, 0),
>      DEFINE_PROP_END_OF_LIST()
>  };
>  
> diff --git a/include/hw/xen/xen-pvh-common.h b/include/hw/xen/xen-pvh-common.h
> index e958b441fd..faacfca70e 100644
> --- a/include/hw/xen/xen-pvh-common.h
> +++ b/include/hw/xen/xen-pvh-common.h
> @@ -29,17 +29,25 @@ typedef struct XenPVHCommonState {
>          MemoryRegion high;
>      } ram;
>  
> +    struct {
> +        GPEXHost gpex;
> +        MemoryRegion mmio_alias;
> +        MemoryRegion mmio_high_alias;
> +    } pci;
> +
>      struct {
>          uint64_t ram_size;
>          uint32_t max_cpus;
>          uint32_t virtio_mmio_num;
>          uint32_t virtio_mmio_irq_base;
> +        uint32_t pci_intx_irq_base;
>          struct {
>              uint64_t base;
>              uint64_t size;
>          } ram_low, ram_high,
>            virtio_mmio,
> -          tpm;
> +          tpm,
> +          ecam, mmio, mmio_high;
>      } cfg;
>  } XenPVHCommonState;
>  #endif
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 01:49:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 01:49:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775858.1186063 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgev-0006p2-Rq; Tue, 13 Aug 2024 01:49:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775858.1186063; Tue, 13 Aug 2024 01:49:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgev-0006ot-Lv; Tue, 13 Aug 2024 01:49:13 +0000
Received: by outflank-mailman (input) for mailman id 775858;
 Tue, 13 Aug 2024 01:49:13 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jgOn=PM=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sdgev-0004dr-8y
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 01:49:13 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3c35e2f7-5916-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 03:49:11 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 0A7D3602BF;
 Tue, 13 Aug 2024 01:49:10 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B9FCC4AF0D;
 Tue, 13 Aug 2024 01:49:08 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3c35e2f7-5916-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723513749;
	bh=ZRmOJq5hRHTEKtPFJV0GBl+YFUXJeHYluIT7QrSEQrU=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=J8MkLBDuS20gYPoBTbHMj61jyWLS0NE+biTu+uJ+rEZV6hwc7WL4pDEHc2xEDU5Uh
	 DMfMZXw1HCt3nz/XqGLf2g66IVqXfdcOiw+kbj+UeWigIPLUHFHLDsXBqLbixlYRwo
	 ht/Ai/QKUiw3mtFhQmBsxKubYufBrtP5kNoXdSLBn82u1h4/CPJwTKqTLiDQv/N3DK
	 maEEw2sjJ/jqUsFM05obzXV0pPVc4NIV1xCuQuByRiV/ZYuyXPtY3cvCIUGLu5i199
	 mPOMUz5HzC2UJ56KkvftsqLXxDtj2WxAo6g9bp0vFrmD+ud1ynutR+gsWJfe0yNC7a
	 Cxn+qJFw7WCog==
Date: Mon, 12 Aug 2024 18:49:07 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony@xenproject.org, 
    paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
    xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, 
    xen-devel@lists.xenproject.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v1 10/10] docs/system/i386: xenpvh: Add a basic
 description
In-Reply-To: <20240812130606.90410-11-edgar.iglesias@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408121848590.298534@ubuntu-linux-20-04-desktop>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com> <20240812130606.90410-11-edgar.iglesias@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>


Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  MAINTAINERS                 |  1 +
>  docs/system/i386/xenpvh.rst | 49 +++++++++++++++++++++++++++++++++++++
>  docs/system/target-i386.rst |  1 +
>  3 files changed, 51 insertions(+)
>  create mode 100644 docs/system/i386/xenpvh.rst
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index a24c2e14d9..da4c9d4d46 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -560,6 +560,7 @@ F: include/sysemu/xen.h
>  F: include/sysemu/xen-mapcache.h
>  F: stubs/xen-hw-stub.c
>  F: docs/system/arm/xenpvh.rst
> +F: docs/system/i386/xenpvh.rst
>  
>  Guest CPU Cores (NVMM)
>  ----------------------
> diff --git a/docs/system/i386/xenpvh.rst b/docs/system/i386/xenpvh.rst
> new file mode 100644
> index 0000000000..354250f073
> --- /dev/null
> +++ b/docs/system/i386/xenpvh.rst
> @@ -0,0 +1,49 @@
> +Xen PVH machine (``xenpvh``)
> +=========================================
> +
> +Xen supports a spectrum of types of guests that vary in how they depend
> +on HW virtualization features, emulation models and paravirtualization.
> +PVH is a mode that uses HW virtualization features (like HVM) but tries
> +to avoid emulation models and instead use passthrough or
> +paravirtualized devices.
> +
> +QEMU can be used to provide PV virtio devices on an emulated PCIe controller.
> +That is the purpose of this minimal machine.
> +
> +Supported devices
> +-----------------
> +
> +The x86 Xen PVH QEMU machine provide the following devices:
> +
> +- RAM
> +- GPEX host bridge
> +- virtio-pci devices
> +
> +The idea is to only connect virtio-pci devices but in theory any compatible
> +PCI device model will work depending on Xen and guest support.
> +
> +Running
> +-------
> +
> +The Xen tools will typically construct a command-line and launch QEMU
> +for you when needed. But here's an example of what it can look like in
> +case you need to construct one manually:
> +
> +.. code-block:: console
> +
> +    qemu-system-i386 -xen-domid 3 -no-shutdown        \
> +      -chardev socket,id=libxl-cmd,path=/var/run/xen/qmp-libxl-3,server=on,wait=off \
> +      -mon chardev=libxl-cmd,mode=control             \
> +      -chardev socket,id=libxenstat-cmd,path=/var/run/xen/qmp-libxenstat-3,server=on,wait=off \
> +      -mon chardev=libxenstat-cmd,mode=control        \
> +      -nodefaults                                     \
> +      -no-user-config                                 \
> +      -xen-attach -name g0                            \
> +      -vnc none                                       \
> +      -display none                                   \
> +      -device virtio-net-pci,id=nic0,netdev=net0,mac=00:16:3e:5c:81:78 \
> +      -netdev type=tap,id=net0,ifname=vif3.0-emu,br=xenbr0,script=no,downscript=no \
> +      -smp 4,maxcpus=4                                \
> +      -nographic                                      \
> +      -machine xenpvh,ram-low-base=0,ram-low-size=2147483648,ram-high-base=4294967296,ram-high-size=2147483648,pci-ecam-base=824633720832,pci-ecam-size=268435456,pci-mmio-base=4026531840,pci-mmio-size=33554432,pci-mmio-high-base=824902156288,pci-mmio-high-size=68719476736 \
> +      -m 4096
> diff --git a/docs/system/target-i386.rst b/docs/system/target-i386.rst
> index 1b8a1f248a..23e84e3ba7 100644
> --- a/docs/system/target-i386.rst
> +++ b/docs/system/target-i386.rst
> @@ -26,6 +26,7 @@ Architectural features
>     i386/cpu
>     i386/hyperv
>     i386/xen
> +   i386/xenpvh
>     i386/kvm-pv
>     i386/sgx
>     i386/amd-memory-encryption
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 01:57:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 01:57:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775876.1186072 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgn3-0000pe-HU; Tue, 13 Aug 2024 01:57:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775876.1186072; Tue, 13 Aug 2024 01:57:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdgn3-0000pX-EK; Tue, 13 Aug 2024 01:57:37 +0000
Received: by outflank-mailman (input) for mailman id 775876;
 Tue, 13 Aug 2024 01:57:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jgOn=PM=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sdgei-0004Ab-6D
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 01:49:00 +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 34470c8a-5916-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 03:48:59 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id A8E57CE1098;
 Tue, 13 Aug 2024 01:48:56 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id D283BC4AF0D;
 Tue, 13 Aug 2024 01:48:53 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 34470c8a-5916-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723513735;
	bh=w8vlPPtODSw90+pIoQfmtnrCRRyHr5wjswxQko6T8mI=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=rDoU1HSpXyr5PS2/vrk44E8rfd91Rkv9HimR5BfNA3XLSVeeml4JyeV4Fj3u2j9Ri
	 4RzsyGnIuwaP/3byeB5pshu7bj70M0sHdIHJGLWh7bVDuYr/9U5nk5R9WevIVaW7jW
	 OtJMnyPeZMbQID9OQcONtz/CTdmqfmp2vU8KGji9NIMxfIU1DSc+v/0f0lrgWjIOHs
	 I2694k81jPSwrjiRq/NnQtsqVdaWxlXlZcZQSMJKlYonOxjYHCDUra/UWphSJXa6iv
	 Xdu+EAYBa/CKj1CJOSwuU68/M5Ql+8p5Fxa7/Xx4hOgFteGGwfQgodZt3TII/MuiHq
	 VzitMcQMMTOvA==
Date: Mon, 12 Aug 2024 18:48:52 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony@xenproject.org, 
    paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
    xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, 
    xen-devel@lists.xenproject.org, "Michael S. Tsirkin" <mst@redhat.com>, 
    Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, 
    Paolo Bonzini <pbonzini@redhat.com>, 
    Richard Henderson <richard.henderson@linaro.org>, 
    Eduardo Habkost <eduardo@habkost.net>
Subject: Re: [PATCH v1 09/10] hw/i386/xen: Add a Xen PVH x86 machine
In-Reply-To: <20240812130606.90410-10-edgar.iglesias@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408121840230.298534@ubuntu-linux-20-04-desktop>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com> <20240812130606.90410-10-edgar.iglesias@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> 
> This adds a Xen PVH x86 machine based on the PVH Common
> module used by the ARM PVH machine.
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> ---
>  hw/i386/xen/meson.build |   1 +
>  hw/i386/xen/xen-pvh.c   | 196 ++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 197 insertions(+)
>  create mode 100644 hw/i386/xen/xen-pvh.c
> 
> diff --git a/hw/i386/xen/meson.build b/hw/i386/xen/meson.build
> index 3f0df8bc07..c73c62b8e3 100644
> --- a/hw/i386/xen/meson.build
> +++ b/hw/i386/xen/meson.build
> @@ -4,6 +4,7 @@ i386_ss.add(when: 'CONFIG_XEN', if_true: files(
>  ))
>  i386_ss.add(when: ['CONFIG_XEN', xen], if_true: files(
>    'xen-hvm.c',
> +  'xen-pvh.c',
>  ))
>  
>  i386_ss.add(when: 'CONFIG_XEN_BUS', if_true: files(
> diff --git a/hw/i386/xen/xen-pvh.c b/hw/i386/xen/xen-pvh.c
> new file mode 100644
> index 0000000000..9c3d3fc58d
> --- /dev/null
> +++ b/hw/i386/xen/xen-pvh.c
> @@ -0,0 +1,196 @@
> +/*
> + * QEMU Xen PVH x86 Machine
> + *
> + * Copyright (c) 2024 Advanced Micro Devices, Inc.
> + * Written by Edgar E. Iglesias <edgar.iglesias@amd.com>
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
> +#include "qemu/osdep.h"
> +#include "qapi/error.h"
> +#include "qapi/visitor.h"
> +#include "qemu/error-report.h"
> +#include "hw/boards.h"
> +#include "sysemu/sysemu.h"
> +#include "hw/xen/arch_hvm.h"
> +#include "hw/xen/xen.h"
> +#include "hw/xen/xen-pvh-common.h"
> +
> +#define TYPE_XEN_PVH_X86  MACHINE_TYPE_NAME("xenpvh")
> +OBJECT_DECLARE_SIMPLE_TYPE(XenPVHx86State, XEN_PVH_X86)
> +
> +#define PVH_MAX_CPUS 128
> +
> +struct XenPVHx86State {
> +    /*< private >*/
> +    MachineState parent;
> +
> +    DeviceState *cpu[PVH_MAX_CPUS];
> +    XenPVHCommonState pvh;
> +
> +    /*
> +     * We provide these properties to allow Xen to move things to other
> +     * addresses for example when users need to accomodate the memory-map
> +     * for 1:1 mapped devices/memory.
> +     */
> +    struct {
> +        MemMapEntry ram_low, ram_high;
> +        MemMapEntry pci_ecam, pci_mmio, pci_mmio_high;

Can we use the same properties already present under XenPVHCommonState?



> +    } cfg;
> +};
> +
> +static void xenpvh_cpu_new(MachineState *ms,
> +                           XenPVHx86State *xp,
> +                           int cpu_idx,
> +                           int64_t apic_id)
> +{
> +    Object *cpu = object_new(ms->cpu_type);
> +
> +    object_property_add_child(OBJECT(ms), "cpu[*]", cpu);
> +    object_property_set_uint(cpu, "apic-id", apic_id, &error_fatal);
> +    qdev_realize(DEVICE(cpu), NULL, &error_fatal);
> +    object_unref(cpu);
> +
> +    xp->cpu[cpu_idx] = DEVICE(cpu);


Why do we need to create CPU devices in QEMU given that we are only
doing device emulation? I guess it is because ....



> +}
> +
> +static void xenpvh_init(MachineState *ms)
> +{
> +    XenPVHx86State *xp = XEN_PVH_X86(ms);
> +    const struct {
> +        const char *name;
> +        MemMapEntry *map;
> +    } map[] = {
> +        { "ram-low", &xp->cfg.ram_low },
> +        { "ram-high", &xp->cfg.ram_high },
> +        { "pci-ecam", &xp->cfg.pci_ecam },
> +        { "pci-mmio", &xp->cfg.pci_mmio },
> +        { "pci-mmio-high", &xp->cfg.pci_mmio_high },
> +    };
> +    int i;
> +
> +    object_initialize_child(OBJECT(ms), "pvh", &xp->pvh, TYPE_XEN_PVH_COMMON);
> +    object_property_set_int(OBJECT(&xp->pvh), "max-cpus", ms->smp.max_cpus,
> +                            &error_abort);
> +    object_property_set_int(OBJECT(&xp->pvh), "ram-size", ms->ram_size,
> +                            &error_abort);
> +
> +    for (i = 0; i < ARRAY_SIZE(map); i++) {
> +        g_autofree char *base_name = g_strdup_printf("%s-base", map[i].name);
> +        g_autofree char *size_name = g_strdup_printf("%s-size", map[i].name);
> +
> +        object_property_set_int(OBJECT(&xp->pvh), base_name, map[i].map->base,
> +                                 &error_abort);
> +        object_property_set_int(OBJECT(&xp->pvh), size_name, map[i].map->size,
> +                                 &error_abort);
> +    }
> +
> +    /* GSI's 16 - 20 are used for legacy PCIe INTX IRQs.  */
> +    object_property_set_int(OBJECT(&xp->pvh), "pci-intx-irq-base", 16,
> +                            &error_abort);
> +
> +    sysbus_realize(SYS_BUS_DEVICE(&xp->pvh), &error_abort);
> +
> +    /* Create dummy cores. This will indirectly create the APIC MSI window.  */

... of the APIC MSI window ?



> +    for (i = 0; i < ms->smp.cpus; i++) {
> +        xenpvh_cpu_new(ms, xp, i, i);
> +    }
> +}
> +
> +#define XENPVH_PROP_MEMMAP_SETTER(n, f)                                    \
> +static void xenpvh_set_ ## n ## _ ## f(Object *obj, Visitor *v,            \
> +                                       const char *name, void *opaque,     \
> +                                       Error **errp)                       \
> +{                                                                          \
> +    XenPVHx86State *xp = XEN_PVH_X86(obj);                                 \
> +    uint64_t value;                                                        \
> +                                                                           \
> +    if (!visit_type_size(v, name, &value, errp)) {                         \
> +        return;                                                            \
> +    }                                                                      \
> +    xp->cfg.n.f = value;                                                   \
> +}
> +
> +#define XENPVH_PROP_MEMMAP_GETTER(n, f)                                    \
> +static void xenpvh_get_ ## n ## _ ## f(Object *obj, Visitor *v,            \
> +                                       const char *name, void *opaque,     \
> +                                       Error **errp)                       \
> +{                                                                          \
> +    XenPVHx86State *xp = XEN_PVH_X86(obj);                                 \
> +    uint64_t value = xp->cfg.n.f;                                          \
> +                                                                           \
> +    visit_type_uint64(v, name, &value, errp);                              \
> +}
> +
> +#define XENPVH_PROP_MEMMAP(n)              \
> +    XENPVH_PROP_MEMMAP_SETTER(n, base)     \
> +    XENPVH_PROP_MEMMAP_SETTER(n, size)     \
> +    XENPVH_PROP_MEMMAP_GETTER(n, base)     \
> +    XENPVH_PROP_MEMMAP_GETTER(n, size)
> +
> +
> +XENPVH_PROP_MEMMAP(ram_low)
> +XENPVH_PROP_MEMMAP(ram_high)
> +XENPVH_PROP_MEMMAP(pci_ecam)
> +XENPVH_PROP_MEMMAP(pci_mmio)
> +XENPVH_PROP_MEMMAP(pci_mmio_high)

I would make all of these common with ARM. It wouldn't hurt to make them
configurable on ARM too, in fact we might need it for 1:1 mapped guests



> +static void xenpvh_instance_init(Object *obj)
> +{
> +    XenPVHx86State *xp = XEN_PVH_X86(obj);
> +
> +    /* Default memmap.  */
> +    xp->cfg.ram_low.base = 0x0;
> +    xp->cfg.ram_low.size = 0x80000000U;
> +    xp->cfg.ram_high.base = 0xC000000000ULL;
> +    xp->cfg.ram_high.size = 0x4000000000ULL;
> +}
> +
> +static void xenpvh_machine_class_init(ObjectClass *oc, void *data)
> +{
> +    MachineClass *mc = MACHINE_CLASS(oc);
> +
> +    mc->desc = "Xen PVH x86 machine";
> +    mc->init = xenpvh_init;
> +    mc->max_cpus = PVH_MAX_CPUS;
> +    mc->default_cpu_type = TARGET_DEFAULT_CPU_TYPE;
> +    mc->default_machine_opts = "accel=xen";
> +    /* Set explicitly here to make sure that real ram_size is passed */
> +    mc->default_ram_size = 0;
> +
> +#define OC_MEMMAP_PROP(c, prop_name, name)                               \
> +do {                                                                     \
> +    object_class_property_add(c, prop_name "-base", "uint64_t",          \
> +                              xenpvh_get_ ## name ## _base,              \
> +                              xenpvh_set_ ## name ## _base, NULL, NULL); \
> +    object_class_property_set_description(oc, prop_name "-base",         \
> +                              prop_name " base address");                \
> +    object_class_property_add(c, prop_name "-size", "uint64_t",          \
> +                              xenpvh_get_ ## name ## _size,              \
> +                              xenpvh_set_ ## name ## _size, NULL, NULL); \
> +    object_class_property_set_description(oc, prop_name "-size",         \
> +                              prop_name " size of memory region");       \
> +} while (0)
> +
> +    OC_MEMMAP_PROP(oc, "ram-low", ram_low);
> +    OC_MEMMAP_PROP(oc, "ram-high", ram_high);
> +    OC_MEMMAP_PROP(oc, "pci-ecam", pci_ecam);
> +    OC_MEMMAP_PROP(oc, "pci-mmio", pci_mmio);
> +    OC_MEMMAP_PROP(oc, "pci-mmio-high", pci_mmio_high);
> +}
> +
> +static const TypeInfo xenpvh_machine_type = {
> +    .name = TYPE_XEN_PVH_X86,
> +    .parent = TYPE_MACHINE,
> +    .class_init = xenpvh_machine_class_init,
> +    .instance_init = xenpvh_instance_init,
> +    .instance_size = sizeof(XenPVHx86State),
> +};
> +
> +static void xenpvh_machine_register_types(void)
> +{
> +    type_register_static(&xenpvh_machine_type);
> +}
> +
> +type_init(xenpvh_machine_register_types)
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 02:22:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 02:22:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775909.1186082 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdhAq-0007Um-FE; Tue, 13 Aug 2024 02:22:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775909.1186082; Tue, 13 Aug 2024 02:22:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdhAq-0007Uf-C0; Tue, 13 Aug 2024 02:22:12 +0000
Received: by outflank-mailman (input) for mailman id 775909;
 Tue, 13 Aug 2024 02:22:11 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=elVi=PM=amd.com=stefano.stabellini@srs-se1.protection.inumbo.net>)
 id 1sdhAp-0007UZ-Bo
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 02:22:11 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on20619.outbound.protection.outlook.com
 [2a01:111:f403:2412::619])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d547fe9c-591a-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 04:22:07 +0200 (CEST)
Received: from BY3PR05CA0046.namprd05.prod.outlook.com (2603:10b6:a03:39b::21)
 by PH7PR12MB9173.namprd12.prod.outlook.com (2603:10b6:510:2ee::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Tue, 13 Aug
 2024 02:22:00 +0000
Received: from CO1PEPF000042AB.namprd03.prod.outlook.com
 (2603:10b6:a03:39b:cafe::1) by BY3PR05CA0046.outlook.office365.com
 (2603:10b6:a03:39b::21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.15 via Frontend
 Transport; Tue, 13 Aug 2024 02:21:59 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1PEPF000042AB.mail.protection.outlook.com (10.167.243.40) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Tue, 13 Aug 2024 02:21:58 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 12 Aug
 2024 21:21:56 -0500
Received: from smtp.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Mon, 12 Aug 2024 21:21:56 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d547fe9c-591a-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=PuKtq5ziYzWMEkMHEADKD6BvCr/94jYBIkpn2QblOlQFpqkFY0Lkxerix/dRo6rlaedGroR1/Vbir02sObbu8ztXyAw6OD9Pq0ybzgmpA/2LYzfETo31NGrTBOrbyOTgjXaU3Ku6Zrej0VAJnDA9tV4AMwfuRY0pGLDjXpgpxowz+vx4yPwlcVoAcmc5jmy6sfu1iyA3RcnnyLgADeRifJP3zab2c9lilbZbiJVCD+7j1SGAbKMZ2NgKOCI6InSTFyZqYoydad7ekbcy8F6sYefkds10PYq3ILwmTXySpPwnXNrq9jItKkvD3XqZJO6jPXA+va+NeH2M21PMV4vRjw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=aEK2Yp6JSBett6EwEG8/jNCCCT7ZqlAIhyHAGLRVgNY=;
 b=zNSjA8PnyLchc38RI/1hcZj5YTIJBGl3Q0a5+jwQY/tfE+kCvvd0Sp0huOPw6JqPvv5u40TOefybKPWsIpJF6jwpH1WZ0pSctGzNLqBt/087o3IBmoidcuru+2GhfzG2D+UK4ARzigaoWUjn4iFAAmhWY9DFhcEWZfjjb/TyiRk4MLkcmxhejBv1rYdvTrt9WvktRpTGA6LtxKNgA4XuleKEfif4+nhStpzft/xBT2CK46wlI+BBZDsJuwt4HZrjO6mDdY145+aEkVzm3dt1PzmcUEW5K23YxbB/XxTmeho+bph2OZKmoOiGNTtkfagfGqpf+oeN30LJ9d8RdZKDaA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=aEK2Yp6JSBett6EwEG8/jNCCCT7ZqlAIhyHAGLRVgNY=;
 b=ZGWs4gp4ZrhsldbghDaFiOYIjpE9Xt5Y4kxSN19HU1bxUp8N5gbcVdb5Pnqe4fsCq2zvdjJFLDKcZ/hm/gjyirHkC76FpY3TJ2JgrtbA25040pD28Jxbm0pN7VzJDRISkgR+IFQpyg2FOB4yyLLgxgRd2qykc/k+jKr7Tw7poPM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Stefano Stabellini <stefano.stabellini@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: <sstabellini@kernel.org>, <michal.orzel@amd.com>, <cardoe@cardoe.com>,
	Stefano Stabellini <stefano.stabellini@amd.com>
Subject: [PATCH v2] automation: use expect to run QEMU
Date: Mon, 12 Aug 2024 19:21:53 -0700
Message-ID: <20240813022153.1246072-1-stefano.stabellini@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB04.amd.com: stefano.stabellini@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000042AB:EE_|PH7PR12MB9173:EE_
X-MS-Office365-Filtering-Correlation-Id: f5e8534c-c1d0-4bd8-aa51-08dcbb3eb582
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?EFjFl6ToBZl1BaN6nJicITYmxMhGUk5cgK8+FIwlz7EEkIQAD7qKCzaQYK00?=
 =?us-ascii?Q?9oq5dNkAgGvVdQoRdM7kTizv73qeBAudVm6Qc8ha9XoSwldcMWbDHEWLZd4p?=
 =?us-ascii?Q?NRSIcriLME1dZ/BD3zspe1uipNx81kMz6HuZnfnlXJT4OP1Lr//d8qQC5Mol?=
 =?us-ascii?Q?yT0KBS4+dDOQ2vCiQ/t/7Lq+vYHf92Gc4aW6A/gUbTASKbcdx+8SSBBLk90D?=
 =?us-ascii?Q?sncblQly+74MeKfRIgKFsvC9ib1N+sfpvT3ACDtmC1zjci01TPW2es5vIKgb?=
 =?us-ascii?Q?lzWxy55OBo+Z6hgQ/r6IFVHiCpAYjhSc2buHCeh3znr3+Xtaqde78D6phUJy?=
 =?us-ascii?Q?Ee8/rTnqtS3Ou3lkV3T5nxyzjLC0IUI0eKaeR7qb+CvMK9e95jbAhYqc2jQV?=
 =?us-ascii?Q?s3ocYYCO2tOtMcfTPvn9Gysd8ZlIiatZpLc+557Iz/mVPo+VK8h0waIjmlE+?=
 =?us-ascii?Q?SG6/XFWuObwNEG0K5Eg6Lwe2LvdOdI5yZCBhVlTeOAUVPGCO3Fldrf7MsE6X?=
 =?us-ascii?Q?c2u4/QDv+YeOpezrESBniCtmUw0rjqry+ELi4vZje8H96TJrZQ+nc0Y22zzO?=
 =?us-ascii?Q?+U/OSn/yPzGrrCvqagAi3fqE4uRxvXuwJ83omJHwWI/eBVQK7B6U9HU96T/f?=
 =?us-ascii?Q?ZbSYkI5E+wJuZaVLQ8GvE8fYJcladn5Knhv/lLhmP+f+M/w9YWalUcXjk6E5?=
 =?us-ascii?Q?KvbMNUsVfgaOjGbwloctmly7beKcSrlvvJonUMyciLwZS8HHzTbYEsl6Hppl?=
 =?us-ascii?Q?2xEpnMelatZVyQS2cL4neItaon37pYphh7PE44ooyUXPesNiB5iDLxk3xAyC?=
 =?us-ascii?Q?sGxLeCUvuX5Y8aKLgPn7EG3cu6CXeXnXs//e2/FnFtSLsibi0cLnnDV6P1hk?=
 =?us-ascii?Q?exlFxGMhW/Wmak6toZ8uhORi95lOE/QBLilSloIm3OissRkh+04SN8p9HfG6?=
 =?us-ascii?Q?4wEgvU6B1of3QCVPN7AT2pQc9fXFNi82woSBfd6nP3+2NLEbT56VKVyyShyM?=
 =?us-ascii?Q?+EjnGSzFJfU0HV7RQzd71YbZSFsfB5OfrnrlYWcq9hcg/pATXyPJOpYuSZNm?=
 =?us-ascii?Q?WIkk6rCzx94UuQggRzJAkGtM7G0+OLvlsvUmrFLnnL4jKMCQB2uELxSmkGQP?=
 =?us-ascii?Q?YX8yv7j45gYPkO8rmjP54S5H9t7aGqATEem1EugEa2ZR0nRJJ4mJhLe45qVK?=
 =?us-ascii?Q?xKYggwh5U6iB5Leo03+grPfvLVLLlJlMtoDHledV1VcTJhdolkVm1yR0dedq?=
 =?us-ascii?Q?wk9qKShhF03crGtMEsiK/Qu3RxZ6qzTmuPR44lJyxvX7HfClqKdk0Xc+urGF?=
 =?us-ascii?Q?9uR80Qa3C7SyROzUWan2w12ZThHii6UcyPXR34e35JQDrFZDYdHG03Jv1vR/?=
 =?us-ascii?Q?2K1Ih55xjdxAgiPFP30EhoagdpZGsne8Ui5Pa1e+4mdhUWgYvuyWMKpH0QJi?=
 =?us-ascii?Q?IjMZxMZ2W8aFXt7esbqjnUgZUNHXImZA?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 02:21:58.5811
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: f5e8534c-c1d0-4bd8-aa51-08dcbb3eb582
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000042AB.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB9173

Use expect to invoke QEMU so that we can terminate the test as soon as
we get the right string in the output instead of waiting until the
final timeout.

For timeout, instead of an hardcoding the value, use a Gitlab CI
variable "QEMU_TIMEOUT" that can be changed depending on the latest
status of the Gitlab CI runners.

Note that for simplicity in the case of dom0less test, the script only
checks for the $PASSED string. That is because the dom0 prompt and the
$PASSED string could happen in any order making it difficult to check
with expect which checks for strings in a specific order.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>

---
Changes in v2:
- add empty lines for readability
- changes qemu-key file extension to exp
- drop xen_msg that is unused
- use capital letters for exported variables
- check for both dom0 and domU message on dom0less tests

https://gitlab.com/xen-project/people/sstabellini/xen/-/pipelines/1410820286
---
 automation/scripts/qemu-alpine-x86_64.sh      | 16 +++---
 automation/scripts/qemu-key.exp               | 51 +++++++++++++++++++
 automation/scripts/qemu-smoke-dom0-arm32.sh   | 15 +++---
 automation/scripts/qemu-smoke-dom0-arm64.sh   | 15 +++---
 .../scripts/qemu-smoke-dom0less-arm32.sh      | 17 +++----
 .../scripts/qemu-smoke-dom0less-arm64.sh      | 15 +++---
 automation/scripts/qemu-smoke-ppc64le.sh      | 12 ++---
 automation/scripts/qemu-smoke-riscv64.sh      | 12 ++---
 automation/scripts/qemu-smoke-x86-64.sh       | 14 ++---
 automation/scripts/qemu-xtf-dom0less-arm64.sh | 14 +++--
 10 files changed, 110 insertions(+), 71 deletions(-)
 create mode 100755 automation/scripts/qemu-key.exp

diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 8e398dcea3..5359e0820b 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -77,18 +77,16 @@ EOF
 # Run the test
 rm -f smoke.serial
 set +e
-timeout -k 1 720 \
-qemu-system-x86_64 \
+export QEMU_CMD="qemu-system-x86_64 \
     -cpu qemu64,+svm \
     -m 2G -smp 2 \
     -monitor none -serial stdio \
     -nographic \
     -device virtio-net-pci,netdev=n0 \
-    -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0 |& \
-        # Remove carriage returns from the stdout output, as gitlab
-        # interface chokes on them
-        tee smoke.serial | sed 's/\r//'
+    -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0"
 
-set -e
-(grep -q "Domain-0" smoke.serial && grep -q "BusyBox" smoke.serial) || exit 1
-exit 0
+export QEMU_LOG="smoke.serial"
+export LOG_MSG="Domain-0"
+export PASSED="BusyBox"
+
+./automation/scripts/qemu-key.exp
diff --git a/automation/scripts/qemu-key.exp b/automation/scripts/qemu-key.exp
new file mode 100755
index 0000000000..9f3a3364fa
--- /dev/null
+++ b/automation/scripts/qemu-key.exp
@@ -0,0 +1,51 @@
+#!/usr/bin/expect -f
+
+set timeout $env(QEMU_TIMEOUT)
+
+log_file -a $env(QEMU_LOG)
+
+match_max 10000
+
+eval spawn $env(QEMU_CMD)
+
+expect_after {
+    -re "(.*)\r" {
+        exp_continue
+    }
+    timeout {send_user "ERROR-Timeout!\n"; exit 1}
+    eof {send_user "ERROR-EOF!\n"; exit 1}
+}
+
+if {[info exists env(UBOOT_CMD)]} {
+    expect "=>"
+
+    send "$env(UBOOT_CMD)\r"
+}
+
+if {[info exists env(LOG_MSG)] && [info exists env(PASSED)]} {
+    expect {
+        "$env(PASSED)" {
+            expect "$env(LOG_MSG)"
+            exit 0
+        }
+        "$env(LOG_MSG)" {
+            expect "$env(PASSED)"
+            exit 0
+        }
+    }
+}
+
+if {[info exists env(LOG_MSG)]} {
+    expect "$env(LOG_MSG)"
+}
+
+if {[info exists env(PASSED)]} {
+    expect {
+        "$env(PASSED)" {
+            exit 0
+        }
+    }
+}
+
+expect eof
+
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index eaaea5a982..b235b1476a 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -78,9 +78,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
 
 rm -f ${serial_log}
 set +e
-echo "  virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
-timeout -k 1 720 \
-./qemu-system-arm \
+export QEMU_CMD="./qemu-system-arm \
    -machine virt \
    -machine virtualization=true \
    -smp 4 \
@@ -91,9 +89,10 @@ timeout -k 1 720 \
    -no-reboot \
    -device virtio-net-pci,netdev=n0 \
    -netdev user,id=n0,tftp=./ \
-   -bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& \
-      tee ${serial_log} | sed 's/\r//'
+   -bios /usr/lib/u-boot/qemu_arm/u-boot.bin"
 
-set -e
-(grep -q "Domain-0" ${serial_log} && grep -q "^/ #" ${serial_log}) || exit 1
-exit 0
+export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export QEMU_LOG="${serial_log}"
+export LOG_MSG="Domain-0"
+export PASSED="/ #"
+../automation/scripts/qemu-key.exp
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 352963a741..5e12b136d5 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -94,9 +94,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
 # Run the test
 rm -f smoke.serial
 set +e
-echo "  virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
-timeout -k 1 720 \
-./binaries/qemu-system-aarch64 \
+export QEMU_CMD="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
     -m 2048 -monitor none -serial stdio \
@@ -104,9 +102,10 @@ timeout -k 1 720 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=binaries \
-    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& \
-        tee smoke.serial | sed 's/\r//'
+    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
 
-set -e
-(grep -q "Domain-0" smoke.serial && grep -q "BusyBox" smoke.serial) || exit 1
-exit 0
+export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export QEMU_LOG="smoke.serial"
+export LOG_MSG="Domain-0"
+export PASSED="BusyBox"
+./automation/scripts/qemu-key.exp
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index c027c8c5c8..5cdf9c4365 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -5,7 +5,7 @@ set -ex
 test_variant=$1
 
 # Prompt to grep for to check if dom0 booted successfully
-dom0_prompt="^/ #"
+dom0_prompt="/ #"
 
 serial_log="$(pwd)/smoke.serial"
 
@@ -131,9 +131,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
 # Run the test
 rm -f ${serial_log}
 set +e
-echo "  virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
-timeout -k 1 240 \
-./qemu-system-arm \
+export QEMU_CMD="./qemu-system-arm \
     -machine virt \
     -machine virtualization=true \
     -smp 4 \
@@ -144,9 +142,10 @@ timeout -k 1 240 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=./ \
-    -bios /usr/lib/u-boot/qemu_arm/u-boot.bin |& \
-        tee ${serial_log} | sed 's/\r//'
+    -bios /usr/lib/u-boot/qemu_arm/u-boot.bin"
 
-set -e
-(grep -q "${dom0_prompt}" ${serial_log} && grep -q "${passed}" ${serial_log}) || exit 1
-exit 0
+export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export QEMU_LOG="${serial_log}"
+export LOG_MSG="${dom0_prompt}"
+export PASSED="${passed}"
+../automation/scripts/qemu-key.exp
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index 15258692d5..1290ac95a6 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -205,9 +205,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
 # Run the test
 rm -f smoke.serial
 set +e
-echo "  virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
-timeout -k 1 240 \
-./binaries/qemu-system-aarch64 \
+export QEMU_CMD="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt,gic-version=$gic_version \
     -m 2048 -monitor none -serial stdio \
@@ -215,9 +213,10 @@ timeout -k 1 240 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=binaries \
-    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& \
-        tee smoke.serial | sed 's/\r//'
+    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
 
-set -e
-(grep -q "^Welcome to Alpine Linux" smoke.serial && grep -q "${passed}" smoke.serial) || exit 1
-exit 0
+export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export QEMU_LOG="smoke.serial"
+export LOG_MSG="Welcome to Alpine Linux"
+export PASSED="${passed}"
+./automation/scripts/qemu-key.exp
diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/scripts/qemu-smoke-ppc64le.sh
index 9088881b73..e411a6a504 100755
--- a/automation/scripts/qemu-smoke-ppc64le.sh
+++ b/automation/scripts/qemu-smoke-ppc64le.sh
@@ -11,8 +11,7 @@ machine=$1
 rm -f ${serial_log}
 set +e
 
-timeout -k 1 20 \
-qemu-system-ppc64 \
+export QEMU_CMD="qemu-system-ppc64 \
     -bios skiboot.lid \
     -M $machine \
     -m 2g \
@@ -21,9 +20,8 @@ qemu-system-ppc64 \
     -monitor none \
     -nographic \
     -serial stdio \
-    -kernel binaries/xen \
-    |& tee ${serial_log} | sed 's/\r//'
+    -kernel binaries/xen"
 
-set -e
-(grep -q "Hello, ppc64le!" ${serial_log}) || exit 1
-exit 0
+export QEMU_LOG="${serial_log}"
+export PASSED="Hello, ppc64le!"
+./automation/scripts/qemu-key.exp
diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
index f90df3c051..1b1f5b3bf2 100755
--- a/automation/scripts/qemu-smoke-riscv64.sh
+++ b/automation/scripts/qemu-smoke-riscv64.sh
@@ -6,15 +6,13 @@ set -ex
 rm -f smoke.serial
 set +e
 
-timeout -k 1 2 \
-qemu-system-riscv64 \
+export QEMU_CMD="qemu-system-riscv64 \
     -M virt \
     -smp 1 \
     -nographic \
     -m 2g \
-    -kernel binaries/xen \
-    |& tee smoke.serial | sed 's/\r//'
+    -kernel binaries/xen"
 
-set -e
-(grep -q "All set up" smoke.serial) || exit 1
-exit 0
+export QEMU_LOG="smoke.serial"
+export PASSED="All set up"
+./automation/scripts/qemu-key.exp
diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
index 3014d07314..c7fcf0ff6e 100755
--- a/automation/scripts/qemu-smoke-x86-64.sh
+++ b/automation/scripts/qemu-smoke-x86-64.sh
@@ -16,11 +16,11 @@ esac
 
 rm -f smoke.serial
 set +e
-timeout -k 1 30 \
-qemu-system-x86_64 -nographic -kernel binaries/xen \
+export QEMU_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
         -initrd xtf/tests/example/$k \
-        -append "loglvl=all console=com1 noreboot console_timestamps=boot $extra" \
-        -m 512 -monitor none -serial file:smoke.serial
-set -e
-grep -q 'Test result: SUCCESS' smoke.serial || exit 1
-exit 0
+        -append \"loglvl=all console=com1 noreboot console_timestamps=boot $extra\" \
+        -m 512 -monitor none -serial stdio"
+
+export QEMU_LOG="smoke.serial"
+export PASSED="Test result: SUCCESS"
+./automation/scripts/qemu-key.exp
diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
index b08c2d44fb..9659adee2b 100755
--- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
+++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
@@ -51,9 +51,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
 # Run the test
 rm -f smoke.serial
 set +e
-echo "  virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"| \
-timeout -k 1 120 \
-./binaries/qemu-system-aarch64 \
+export QEMU_CMD="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
     -m 2048 -monitor none -serial stdio \
@@ -61,9 +59,9 @@ timeout -k 1 120 \
     -no-reboot \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=binaries \
-    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin |& \
-        tee smoke.serial | sed 's/\r//'
+    -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
 
-set -e
-(grep -q "${passed}" smoke.serial) || exit 1
-exit 0
+export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
+export QEMU_LOG="smoke.serial"
+export PASSED="${passed}"
+./automation/scripts/qemu-key.exp
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 03:04:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 03:04:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775924.1186091 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdhpq-0007ut-5p; Tue, 13 Aug 2024 03:04:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775924.1186091; Tue, 13 Aug 2024 03:04:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdhpq-0007um-2z; Tue, 13 Aug 2024 03:04:34 +0000
Received: by outflank-mailman (input) for mailman id 775924;
 Tue, 13 Aug 2024 03:04:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdhpp-0007uc-59; Tue, 13 Aug 2024 03:04:33 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdhpp-0003Fe-2h; Tue, 13 Aug 2024 03:04:33 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdhpo-0001BO-Gk; Tue, 13 Aug 2024 03:04:32 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sdhpo-0000uF-Eg; Tue, 13 Aug 2024 03:04:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=b+uAdriwrkH9SY9QQHSOrdmYjC5NJbdSESCbJGFx73w=; b=I3pYKexP3IkS5VD3UGNhAH/ved
	b1i52d+6/gqylVqpsB2OuRGjh7dONy+ONZbV9twLxS8meDP9QyB8aISAofg10ETSw9K8mSYcscZ6h
	ycLzJBW+1rMgptTkmHWs+L1hriR7hRazijO4Ou/QL+z4PEjMCdxHfcpxAytmmKwEg1GU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187219-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187219: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=98a462f8b169f93ab7463023f0ed94575f8225b4
X-Osstest-Versions-That:
    xen=d61248b0fa2cdfc0be1d806c43d1b211a72b5d49
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 13 Aug 2024 03:04:32 +0000

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

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  98a462f8b169f93ab7463023f0ed94575f8225b4
baseline version:
 xen                  d61248b0fa2cdfc0be1d806c43d1b211a72b5d49

Last test of basis   187203  2024-08-10 01:02:14 Z    3 days
Testing same since   187219  2024-08-12 23:00:28 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   d61248b0fa..98a462f8b1  98a462f8b169f93ab7463023f0ed94575f8225b4 -> smoke


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 05:42:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 05:42:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775936.1186101 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdkIO-0007FK-Tn; Tue, 13 Aug 2024 05:42:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775936.1186101; Tue, 13 Aug 2024 05:42:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdkIO-0007FD-R1; Tue, 13 Aug 2024 05:42:12 +0000
Received: by outflank-mailman (input) for mailman id 775936;
 Tue, 13 Aug 2024 05:42:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdkIN-0007F3-KP; Tue, 13 Aug 2024 05:42:11 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdkIN-0006Qe-D5; Tue, 13 Aug 2024 05:42:11 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdkIM-0000Cw-Qo; Tue, 13 Aug 2024 05:42:10 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sdkIM-0000Tg-QL; Tue, 13 Aug 2024 05:42:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=yfC8AYOrnnbHbFJ1+sbJ1R8ouJWO/jWFdpl+ytsHxgc=; b=qjuAF5cAVbGCvbGk1OdjJJCkyd
	AavJyObkZIkDjroe/ZGA49NgUtqjp1Uy2S0XzQ5tqnjI32MwHLfO8dyo98UHph/jUHAQSVZeWrzfz
	jWCAUt5MLnV2cqQrs+/xv680lex2QZhuMJje+EfRDFKyhjK4BvyhLz+STLRk9lZMrYGE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187218-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187218: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=d74da846046aeec9333e802f5918bd3261fb5509
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 13 Aug 2024 05:42:10 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827

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

version targeted for testing:
 linux                d74da846046aeec9333e802f5918bd3261fb5509
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   27 days
Failing since        186925  2024-07-20 09:44:52 Z   23 days   52 attempts
Testing same since   187218  2024-08-12 21:12:09 Z    0 days    1 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 06:41:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 06:41:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775960.1186112 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdlDp-0007nW-7p; Tue, 13 Aug 2024 06:41:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775960.1186112; Tue, 13 Aug 2024 06:41:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdlDp-0007nP-4s; Tue, 13 Aug 2024 06:41:33 +0000
Received: by outflank-mailman (input) for mailman id 775960;
 Tue, 13 Aug 2024 06:41:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdlDo-0007nB-Fu; Tue, 13 Aug 2024 06:41:32 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdlDo-0007UC-Cx; Tue, 13 Aug 2024 06:41:32 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdlDo-0002Cb-0F; Tue, 13 Aug 2024 06:41:32 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sdlDn-0003Ya-Vu; Tue, 13 Aug 2024 06:41:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=cWuijIoHNUobMFrmgpEtNPdbsYmOef5ZvpzFKe6IF+o=; b=w2/lFFkSVa+ivR0gmOs7xuPMYO
	sZ4gyttCmE5lQYE3VH2oycg1bzz0kYVRl7PG37hd84BJaMlYSILJVlV9nBXS6m98goHueBatDXRAf
	twr7jc68S3BaoNFoCMSwQr6RLIKYz5FmOQsQRkGM6epN11v4PFzPw7jdtaK5HdZ8QOvw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187222-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187222: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=b158dad150bf02879668f72ce306445250838201
X-Osstest-Versions-That:
    ovmf=b0f43dd3fdec2363e3548ec31eb455dc1c4ac761
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 13 Aug 2024 06:41:31 +0000

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

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

Last test of basis   187187  2024-08-08 01:56:57 Z    5 days
Testing same since   187222  2024-08-13 05:11:34 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Ashraf Ali <ashraf.ali.s@intel.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   b0f43dd3fd..b158dad150  b158dad150bf02879668f72ce306445250838201 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 06:55:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 06:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775971.1186122 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdlQj-0001KF-B5; Tue, 13 Aug 2024 06:54:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775971.1186122; Tue, 13 Aug 2024 06:54:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdlQj-0001K8-8Y; Tue, 13 Aug 2024 06:54:53 +0000
Received: by outflank-mailman (input) for mailman id 775971;
 Tue, 13 Aug 2024 06:54:52 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=nDAI=PM=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sdlQh-0001K2-TB
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 06:54:51 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on2062c.outbound.protection.outlook.com
 [2a01:111:f403:2412::62c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eeb3f70a-5940-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 08:54:49 +0200 (CEST)
Received: from BN8PR16CA0015.namprd16.prod.outlook.com (2603:10b6:408:4c::28)
 by CH3PR12MB7594.namprd12.prod.outlook.com (2603:10b6:610:140::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Tue, 13 Aug
 2024 06:54:44 +0000
Received: from MN1PEPF0000F0E4.namprd04.prod.outlook.com
 (2603:10b6:408:4c:cafe::c4) by BN8PR16CA0015.outlook.office365.com
 (2603:10b6:408:4c::28) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend
 Transport; Tue, 13 Aug 2024 06:54:44 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 MN1PEPF0000F0E4.mail.protection.outlook.com (10.167.242.42) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Tue, 13 Aug 2024 06:54:43 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug
 2024 01:54:43 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Tue, 13 Aug 2024 01:54:41 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eeb3f70a-5940-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=V/nn03kclu5uom/r2nQ9RSzQ/dk38p3+fo5C4CzkYwk86/JAQyFwufFwmaPILD+DXmonBaIJDiM26a3VNyBfX4zQ5V/stlldHFeZJ16pH0Rlx8CjyVC0+WM76ezbaNM6n23sM8jSYfQfcPmpNY9B2u8PBHHc+fUieqlCsHNUJ1oRcwiTF2U4d7NmKnvlwrgwVhE8rqUhifT6A9MUx1s7dCZLBzrl/47UVwqv0wQ9nAUt6/fC2/a1Abbh6LKLuF+MWx3hagowxy04XafCe9FlySCyajro0TwHIDE/WMzu5X6vUgvPMNO0ONMsCJnMKOfpGpVno4sqdZT/Z8O+ad4zXw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5gEYzC4p7lmbhOVOKCWSfZsWmeQH6WoFt/UELB7HY/U=;
 b=exU3PDNqHkJfiC07XaZJV/HgJ/hxPO2+5WC4XwsilFmoRrSaEwcJ9Zj+hzVTJQ36nqXrCo/WdIELTR/XIArdVptxdDCxRQAUIZIoJJpJc5om++VHjeIa6QDbJBJlpFRtubuePVkXqNMj7RUsv1crg36FKoz9XqNBWDgY0riE1CzNnMyASZYv7f8X77d9h4Ey/0xZ+HNexvWIqHYs6wnNolZlUNNjtQSglpwYPasX/QBhPoBIrJ0NGOYnrVVwzlMbX7AwoLEVD9DIhgw2qnuRipLYCHSsQBlVJdkTc+nxu98LgW7azVsO5JfFQ6nS56yGE8E/B8xJuib/DZFHK99yOA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5gEYzC4p7lmbhOVOKCWSfZsWmeQH6WoFt/UELB7HY/U=;
 b=FHVy6Zk8uvT62SK0Ay9DpwLeacK2mncCUlb5g1JIfmTkpMtOXn+Zj4l4QAdpqWyd88W+P42/WtO39J11U+Pr0l0vhABVfOxLc/hzJIGZyR7CVsnXp+bCbUDnlFvSFtn7XjAkNAUiWG13qnFkb0ME8ZwEgkHTwVFmsJ1wDLIh3CY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <6742a2b7-e987-4171-aff0-37f29159636e@amd.com>
Date: Tue, 13 Aug 2024 08:54:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] automation: use expect to run QEMU
To: Stefano Stabellini <stefano.stabellini@amd.com>,
	<xen-devel@lists.xenproject.org>
CC: <sstabellini@kernel.org>, <cardoe@cardoe.com>
References: <20240813022153.1246072-1-stefano.stabellini@amd.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240813022153.1246072-1-stefano.stabellini@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB04.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0E4:EE_|CH3PR12MB7594:EE_
X-MS-Office365-Filtering-Correlation-Id: 33a647d1-a91b-4bf0-eac2-08dcbb64cfe6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?Z1BpR0pqQXlZODVpcTlQMnJQcXl6SG5idm01Wi9sa1dUbm5MM2N4YllvV2p5?=
 =?utf-8?B?WG5FOXNHc09CRVkwVVdWbXU3SFBBZGhqSnQxVGJnYkYvU2J4dnVXTk9HQTN0?=
 =?utf-8?B?bGJpOFBmdkIyK1dmQUJaRlVaenZmUWZQWmFIeC9WMTdqWTF6bkxBQ2JYZkxZ?=
 =?utf-8?B?THRHTC8zejE0dTczM0J6K3BRc1lxYUhrZFcyRUNYY0doU3VIcnE3TnQ3VGJM?=
 =?utf-8?B?bWc4SVRGWU9qQ1paMERyNDJwbkdKOUxjNnRKbU41U1lNb3puQkhzWkRNSGZr?=
 =?utf-8?B?MjZCTk1YL2J4a05lSGNqbkxFSGJGdWVDV3NmVmtZWWF4RWZENEFLRmNUSTNN?=
 =?utf-8?B?ZFFEQWNPL2ZQcENkV0h1emhRZGl1ZWJha2dLRmIxblJ1bVNLZVNDWDAxV1NU?=
 =?utf-8?B?NmpGc3pObFAzNnZPbnFPODE3b0dwVGl4TDZpaTNUcWxGRjhBQWNJeG5ua1J2?=
 =?utf-8?B?Rjl1MWVUbXdJQ0dzd3lYMi9uV0hJWTdBZW4wNzdKcmhJU2VjUzNmaG1NbEQw?=
 =?utf-8?B?ODlGYmQ5MHdpWDdPUnBuaGZOdXRvZUs3YzQ5SHZrWFR1M09LbVgvZVlRamwz?=
 =?utf-8?B?cm1keWxtQWFHejFERHpOK05UWk5JemVOMVIxUTArZHVzUmtQL2xCcUlvSFJj?=
 =?utf-8?B?d3Nhc3VxNFgzcGtEOFRQV3h6d2c2bkJmN0dYVWEzUXpaelRKeW1ZdTNMR1Bl?=
 =?utf-8?B?S0t1anVLL0o5RmpUU2g2RG8yMWFMMSt1SmJCaytjQjJOR0hlODBzZ0hsVzRN?=
 =?utf-8?B?V1hqMU80YnFSZFBJV1pyQnNtNkdmYTEydGY2NjVVVThUa1JOcnpZQlBhc1lF?=
 =?utf-8?B?YmRXT0xjNlJER3I3dnJTSisvWGNuNHRwQ1BZRGpvR1pOc0d5TkZNUmpHK0FW?=
 =?utf-8?B?akQ4aG1wZ2VwZVpOS2NCMVJzTVUwZ2JILzEwb3d0MWJENnMrNzFGUnNiK2lx?=
 =?utf-8?B?T0R2c2NWU3R6MzlscEU2RDRCSVRTZ254Mk9ReS9NejBNbWJtY1dTM3lWYTV0?=
 =?utf-8?B?dndpZVVwUjdHYXltZ0docDZtOG5rTXRTRjZXVDdaSk5XL0RET1o3WGtuaFIx?=
 =?utf-8?B?akpvWm9Ua0NIdlRWNEFGWThFbjU0RnZxMXN5VjBmcWR6dVptZUVMWFhodFZq?=
 =?utf-8?B?ckpQTHE4aWFFSEc2a3dnQUN0VUpDVVlrY1FaNk5zV25pZndRaFYxeDdCVUFK?=
 =?utf-8?B?ZGx6aDJ1SUZ3Zm44MG9NblErWTF5VGtJNElFdnNBUnRzNzVYb3FLZUtSZGhU?=
 =?utf-8?B?RHBBcmhYUURZYUE2MndvZDlTNTVVQU1ZcytuTEEvZmZQTktsa05SMUlGZzVG?=
 =?utf-8?B?UkwyZEVHYkp0cVdiOUJZeTZMOXpIbXljK1M2bWZQdTFIY1ZvNjl4bEU5V3Ry?=
 =?utf-8?B?NkxxeGJKQlhuRXoxZWhPRVdCaU1HMk1ZMlRsQ1JvMERweHBRNGVTZSsrY1Uz?=
 =?utf-8?B?cHVvSjNocmUzejFTU0hiU2VGeTNRbnJoREkxdXQ4cktsdDQzR2VGSnZNalBa?=
 =?utf-8?B?Zit6SXBQMU40TEFQbGNxVlA0bnlvd1FUaFkwRy9taXZIM1VsWk1mb2dIVkZQ?=
 =?utf-8?B?WkZOU0tUK2xRaTJZRUR5R0xiNzVaSHBKbEZHRjRrbmZsUWpibjRabTJGbHRr?=
 =?utf-8?B?ZS9SSVh3b2s3WnVaK2U3bVZCQ3JKb3NJKy9tYUxOaklpWG45dUJjRXNtVEtK?=
 =?utf-8?B?enRhR2gzOTRqSVFRT2dWT2pyS3RhZFZRL1UyM2V0WitxSDI0VGRQekNLYW5X?=
 =?utf-8?B?ZVJBYkxqQ3o0Z3VYTXkrQ1BWTWtISGJMeU9WR1poVTVSQnpOZ042bmdOS25Z?=
 =?utf-8?B?TldmZzlKVFdINlhwQVZwRVovcmpBZVdkaWVVRzlNcEhRM2F0My9QWFRwTFk5?=
 =?utf-8?B?Tk5wNm1PTWlLT3dBdDJJOFNiVENaT2NMTkJGY1gwOForOXc9PQ==?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 06:54:43.8127
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 33a647d1-a91b-4bf0-eac2-08dcbb64cfe6
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	MN1PEPF0000F0E4.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7594

Hi Stefano,

On 13/08/2024 04:21, Stefano Stabellini wrote:
> 
> 
> Use expect to invoke QEMU so that we can terminate the test as soon as
> we get the right string in the output instead of waiting until the
> final timeout.
> 
> For timeout, instead of an hardcoding the value, use a Gitlab CI
> variable "QEMU_TIMEOUT" that can be changed depending on the latest
> status of the Gitlab CI runners.
> 
> Note that for simplicity in the case of dom0less test, the script only
> checks for the $PASSED string. That is because the dom0 prompt and the
> $PASSED string could happen in any order making it difficult to check
> with expect which checks for strings in a specific order.
I think this comment is no longer true and needs to be removed.

> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
> 
> ---
> Changes in v2:
> - add empty lines for readability
I can only see it being done for one script.

> - changes qemu-key file extension to exp
> - drop xen_msg that is unused
> - use capital letters for exported variables
> - check for both dom0 and domU message on dom0less tests
> 
> https://gitlab.com/xen-project/people/sstabellini/xen/-/pipelines/1410820286
> ---
>  automation/scripts/qemu-alpine-x86_64.sh      | 16 +++---
>  automation/scripts/qemu-key.exp               | 51 +++++++++++++++++++
>  automation/scripts/qemu-smoke-dom0-arm32.sh   | 15 +++---
>  automation/scripts/qemu-smoke-dom0-arm64.sh   | 15 +++---
>  .../scripts/qemu-smoke-dom0less-arm32.sh      | 17 +++----
>  .../scripts/qemu-smoke-dom0less-arm64.sh      | 15 +++---
>  automation/scripts/qemu-smoke-ppc64le.sh      | 12 ++---
>  automation/scripts/qemu-smoke-riscv64.sh      | 12 ++---
>  automation/scripts/qemu-smoke-x86-64.sh       | 14 ++---
>  automation/scripts/qemu-xtf-dom0less-arm64.sh | 14 +++--
>  10 files changed, 110 insertions(+), 71 deletions(-)
>  create mode 100755 automation/scripts/qemu-key.exp
> 
> diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
> index 8e398dcea3..5359e0820b 100755
> --- a/automation/scripts/qemu-alpine-x86_64.sh
> +++ b/automation/scripts/qemu-alpine-x86_64.sh
> @@ -77,18 +77,16 @@ EOF
>  # Run the test
>  rm -f smoke.serial
>  set +e
> -timeout -k 1 720 \
> -qemu-system-x86_64 \
> +export QEMU_CMD="qemu-system-x86_64 \
>      -cpu qemu64,+svm \
>      -m 2G -smp 2 \
>      -monitor none -serial stdio \
>      -nographic \
>      -device virtio-net-pci,netdev=n0 \
> -    -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0 |& \
> -        # Remove carriage returns from the stdout output, as gitlab
> -        # interface chokes on them
> -        tee smoke.serial | sed 's/\r//'
> +    -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0"
> 
> -set -e
> -(grep -q "Domain-0" smoke.serial && grep -q "BusyBox" smoke.serial) || exit 1
> -exit 0
> +export QEMU_LOG="smoke.serial"
> +export LOG_MSG="Domain-0"
> +export PASSED="BusyBox"
> +
> +./automation/scripts/qemu-key.exp
> diff --git a/automation/scripts/qemu-key.exp b/automation/scripts/qemu-key.exp
> new file mode 100755
> index 0000000000..9f3a3364fa
> --- /dev/null
> +++ b/automation/scripts/qemu-key.exp
> @@ -0,0 +1,51 @@
> +#!/usr/bin/expect -f
> +
> +set timeout $env(QEMU_TIMEOUT)
> +
> +log_file -a $env(QEMU_LOG)
> +
> +match_max 10000
> +
> +eval spawn $env(QEMU_CMD)
> +
> +expect_after {
> +    -re "(.*)\r" {
> +        exp_continue
> +    }
> +    timeout {send_user "ERROR-Timeout!\n"; exit 1}
It should be send_error to send the string to stderr

> +    eof {send_user "ERROR-EOF!\n"; exit 1}
> +}
> +
> +if {[info exists env(UBOOT_CMD)]} {
> +    expect "=>"
> +
> +    send "$env(UBOOT_CMD)\r"
> +}
> +
> +if {[info exists env(LOG_MSG)] && [info exists env(PASSED)]} {
> +    expect {
> +        "$env(PASSED)" {
> +            expect "$env(LOG_MSG)"
> +            exit 0
> +        }
> +        "$env(LOG_MSG)" {
> +            expect "$env(PASSED)"
> +            exit 0
> +        }
> +    }
> +}
> +
> +if {[info exists env(LOG_MSG)]} {
> +    expect "$env(LOG_MSG)"
> +}
> +
> +if {[info exists env(PASSED)]} {
> +    expect {
> +        "$env(PASSED)" {
> +            exit 0
> +        }
> +    }
> +}
Given that this script treats both LOG_MSG and PASSED as optional, if a script
does not define PASSED, it will just continue until timeout. Might be worth making
PASSED mandatory. Something like:

if {[info exists env(LOG_MSG)]} {
    expect {
        "$env(PASSED)" {
            expect "$env(LOG_MSG)"
            exit 0
        }
        "$env(LOG_MSG)" {
            expect "$env(PASSED)"
            exit 0
        }
    }
}

expect {
    "$env(PASSED)" {
        exit 0
    }
}

In any case, you can do the changes on commit:
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 07:02:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 07:02:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775983.1186132 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdlY0-0003L7-2M; Tue, 13 Aug 2024 07:02:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775983.1186132; Tue, 13 Aug 2024 07:02:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdlXz-0003L0-Vx; Tue, 13 Aug 2024 07:02:23 +0000
Received: by outflank-mailman (input) for mailman id 775983;
 Tue, 13 Aug 2024 07:02:22 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdlXy-0003KW-UY
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 07:02:22 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fc0922e2-5941-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 09:02:20 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-5b5b67d0024so5849944a12.0
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 00:02:20 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f3fb069dsm43339466b.80.2024.08.13.00.02.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 00:02:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fc0922e2-5941-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723532540; x=1724137340; 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=XF2r7HyMcvp3Zgz62HvJXzBMQ9YQZbDu6pAbWtOV6Kc=;
        b=fHoHP/kILzhMNHOm/awSuXYatUDbsyArRnxrRXHnNusjj3+7TJVNqwJALUFV+y5oTe
         nGeTZXJjP0+XQBvRZwNwcor47hrnFz59fYd6VVXOwChlshk0cipz0wxhot9+yVmsUdAJ
         TCmgLMEXe8p9HCLFMJa5ayc3fkKEKekYaSFTow6q7L87XlLeblSOnmAs9n88hwrEA8tJ
         Ux9wbQCZdVrvnTpiA8nwanI7YGARTkenzR/cUwhG0ccGS5O4T6pTprMCLKtXuIGa+mDc
         rcBWuO+oDQqBWJV80G+W5uNMLhT0wHt4CEO8lhKoLlyfMsyIOTydk1ZwT+0nICo9IStj
         kvFQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723532540; x=1724137340;
        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=XF2r7HyMcvp3Zgz62HvJXzBMQ9YQZbDu6pAbWtOV6Kc=;
        b=dI137tvn0DrF509M7AwenBBwMXmUVQdSZK1d6Dm4CmF8QkzroYxrR3bzDL+JLSTD1L
         OW95sG7U2RlNPuVZIFqsbhqt4KbYynO02P1LJsLiS2qMEFyoA0Db6Ef+y1IAtBK9lYyQ
         OeQEgN256WtSnWRPDiffHBH7GzcV59AnGuvqxDObdPcLKOjSrcuzgU2rIOayQsUlJDVm
         NQSdfFH5ubokroA1DGRLJY6f+zyOLkbt1cO4wrmgrx1xq3ptAV7yShc8cjX2cxJuPBbe
         iL849wth6/jHJN3q9HXvDVbS6rDwQ2ZgFceztP39kL6oXJmcghNpvwzsx/uBfzLzO/FA
         QwDQ==
X-Forwarded-Encrypted: i=1; AJvYcCU9Omv6AC6/dxSVns0i00Gk3GEZtpxs7Vle9CSuRlmiTbZ/Jec0HU69eQVdrKRjpJ7N4XAmEM8usWmu+dubmbe1oUqOCIg8rMVPqbmMbXI=
X-Gm-Message-State: AOJu0YybiACWdw45S80nvLNitv+jrmgAyMIUUldqteAjHkSh+0OPpceN
	v9Hom+AE738ykgjvlBvpJNOf973K8vXb6C+q6KaD+0GgGvhBAYJ5NL2XHouo+8iADU5H4HK149U
	=
X-Google-Smtp-Source: AGHT+IFzMLxbVH0sFLPqDUMWPTZ23/p5ZpCK/ryWaU88t9tcMPyfZeTAREl5U0yDFskqqYL9hYUhOA==
X-Received: by 2002:a17:907:f1e1:b0:a7a:aa35:408e with SMTP id a640c23a62f3a-a80ed2055f4mr179618666b.27.1723532540127;
        Tue, 13 Aug 2024 00:02:20 -0700 (PDT)
Message-ID: <2fe91be6-c7be-4d61-ab71-ca6cfdd5ffd9@suse.com>
Date: Tue, 13 Aug 2024 09:02:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86: slightly simplify MB2/EFI "magic" check
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <f2186827-62e6-4b24-8a6c-0c2a9499c232@suse.com>
 <18701bb3-7aa3-4f46-8071-be4cf75a2e76@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <18701bb3-7aa3-4f46-8071-be4cf75a2e76@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 12.08.2024 23:40, Andrew Cooper wrote:
> On 08/08/2024 9:49 am, Jan Beulich wrote:
>> --- a/xen/arch/x86/boot/head.S
>> +++ b/xen/arch/x86/boot/head.S
>> @@ -233,13 +233,11 @@ __efi64_mb2_start:
>>  
>>          /* Check for Multiboot2 bootloader. */
>>          cmp     $MULTIBOOT2_BOOTLOADER_MAGIC,%eax
>> -        je      .Lefi_multiboot2_proto
>>  
>>          /* Jump to .Lnot_multiboot after switching CPU to x86_32 mode. */
>>          lea     .Lnot_multiboot(%rip), %r15
>> -        jmp     x86_32_switch
>> +        jne     x86_32_switch
>>  
>> -.Lefi_multiboot2_proto:
>>          /* Zero EFI SystemTable, EFI ImageHandle addresses and cmdline. */
>>          xor     %esi,%esi
>>          xor     %edi,%edi
> 
> 
> You've split the logical in two, and now the comment is in the wrong
> position.
> 
> If you're going to make this change, it wants to end up reading:
> 
>     /* Jump to .Lnot_multiboot after switching CPU to x86_32 mode. */
>     lea     .Lnot_multiboot(%rip), %r15
> 
>     /* Check for Multiboot2 bootloader. */
>     cmp     $MULTIBOOT2_BOOTLOADER_MAGIC,%eax
>     jne     x86_32_switch
> 
> 
> Not that it's really relevant, but this form also macrofuses nicely.

All true, yet I'm sure you also read my response to Alejandro: Then we
ought to also change the other similar instances. The goal of this simple
change, after all, is to get all similar pieces of code into consistent
shape.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 07:09:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 07:09:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.775992.1186141 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdley-0004Wk-Pb; Tue, 13 Aug 2024 07:09:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 775992.1186141; Tue, 13 Aug 2024 07:09:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdley-0004Wd-N5; Tue, 13 Aug 2024 07:09:36 +0000
Received: by outflank-mailman (input) for mailman id 775992;
 Tue, 13 Aug 2024 07:09:35 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdlex-0004WX-Aq
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 07:09:35 +0000
Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com
 [2a00:1450:4864:20::632])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fde43289-5942-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 09:09:33 +0200 (CEST)
Received: by mail-ej1-x632.google.com with SMTP id
 a640c23a62f3a-a80eab3945eso118956266b.1
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 00:09:33 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f411b585sm43846566b.104.2024.08.13.00.09.32
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 00:09:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fde43289-5942-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723532973; x=1724137773; 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=UV5mHkDTbnPd/5WYuAL/5+XZ21L5I9EqLcQecmX8Qf0=;
        b=I3djPK91nBBP3bXG3yhwy+km9Vqvq4YyND2/8c8fbUhXMe60NZmRlR82+P5aNUZC4j
         LId9h/fQippTEADsQhpmmJjVOrXw+QCY7iTSYqSKQ4+Kxxfpz6ukQUTfDw4HbgkypIqB
         se2hpjMsONsruF68zwkinRq6dP3S6im5R8zvz2bYXVSDLrm0v6ot3oq6ApJfM/rKOriM
         BFwcK64sVh3uFjRuJZSsT7RrCDD578ETAJgsr/UuYosNEw0aToOnLiAXYKukj8fk4V7/
         C16ZRPhSnm+lZ/iw61z8htoI9DuohaG2LngN3Nr9dNjicFiF9pva5Pvu6uLXJe44fclw
         DvRA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723532973; x=1724137773;
        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=UV5mHkDTbnPd/5WYuAL/5+XZ21L5I9EqLcQecmX8Qf0=;
        b=MJNkIlbl2BDNpaAHCvbRlk5C6RxGHqOkL7gGYUYS/asShCS5GQsLu1UOuipu36M+kG
         COyxYeix7r2i4WSas9G1s2e+QepsXLwsBEiccmhVvPwEcP++svB7UdUHNmn82Uo87ttl
         lS+bipGecoBXH8KAlVmhU13EpsDgTwASY4vaLwmGO8SZbvahmOvS1F2sZAt9vz2b+VTU
         LoWXFHoyc3q0Z2cG8s/8O8OdC0S3h4yk+3wXyFYTqzXW4nkWN3I0SVOQZ39TZbGPPCUR
         WiyiyrcmBuqrZwaqLMQfQA1CBntPj8106xfOYqeqBqJJBnVDvflgZ/9UkRYYAoaGZNgr
         hldA==
X-Gm-Message-State: AOJu0Yzcq860g3U4/NQ6ijo703dVVW0MxvDOOnIW1uTjzFQuAkPaM5Nf
	QqQVIJeKJBQrUrGGtWSXnHpodW5ZQd02+oIfHB96ARDUxo4/ybgQd5+oT0A9Xw==
X-Google-Smtp-Source: AGHT+IHYBiATnoh5UuoUZZfJpHTOPT2dFlyWs0DTROvngLxBySoeHSFUX0jQ15hP1kPXJYWIlbPNiQ==
X-Received: by 2002:a17:907:3f9e:b0:a7d:2bf7:5619 with SMTP id a640c23a62f3a-a80ed2d811cmr130227666b.58.1723532972682;
        Tue, 13 Aug 2024 00:09:32 -0700 (PDT)
Message-ID: <5fe3ddc4-8317-4129-a06b-73671ef15655@suse.com>
Date: Tue, 13 Aug 2024 09:09:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/4] xen: arm: make VMAP only support in MMU system
To: Ayan Kumar Halder <ayankuma@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com,
 julien@xen.org
References: <20240808120936.3299937-1-ayan.kumar.halder@amd.com>
 <20240808120936.3299937-3-ayan.kumar.halder@amd.com>
 <bc643306-a41a-41bb-b7b7-b7c67f9e5bdf@suse.com>
 <3c491d8f-6180-46d7-a996-049df88a023e@amd.com>
 <724aa3bd-26a0-4a01-8be5-69fa838ee9ba@suse.com>
 <c5c0a198-97ca-4779-8d1e-91d01b3650ff@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <c5c0a198-97ca-4779-8d1e-91d01b3650ff@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 12.08.2024 18:02, Ayan Kumar Halder wrote:
> Hi Jan,
> 
> On 09/08/2024 10:34, Jan Beulich wrote:
>> On 08.08.2024 17:50, Ayan Kumar Halder wrote:
>>> On 08/08/2024 13:49, Jan Beulich wrote:
>>>> On 08.08.2024 14:09, Ayan Kumar Halder wrote:
>>>>> @@ -58,9 +58,13 @@ config PADDR_BITS
>>>>>    	default 40 if ARM_PA_BITS_40
>>>>>    	default 48 if ARM_64
>>>>>    
>>>>> +config HAS_VMAP
>>>>> +	def_bool y
>>>> With this being always enabled, ...
>>> I had to define the config somewhere. It seemed this is the correct
>>> place to define as HAS_VMAP will be turned off when MPU is introduced.
>>>
>>> So, it will be
>>>
>>> config HAS_VMAP
>>>
>>>              def_bool n
>>>
>>> At that time, only MMU will select HAS_VMAP.
>> Well, but why is it not simply
>>
>> config HAS_VMAP
>> 	bool
>>
>> from the very beginning? (There should never be "def_bool n" imo, btw.)
>>
>>>>> --- a/xen/include/xen/vmap.h
>>>>> +++ b/xen/include/xen/vmap.h
>>>>> @@ -141,7 +141,9 @@ void *arch_vmap_virt_end(void);
>>>>>    /* Initialises the VMAP_DEFAULT virtual range */
>>>>>    static inline void vm_init(void)
>>>>>    {
>>>>> +#ifdef CONFIG_MMU
>>>>>        vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end());
>>>>> +#endif
>>>>>    }
>>>> What about non-Arm, which all have MMUs but no corresponding Kconfig
>>>> setting?
>>> AFAICS , the only file that is of our concern xen/common/vmap.c It is
>>> enclosed with VMAP_VIRT_START which is defined in mmu specific file
>>> (xen/arch/arm/include/asm/mmu/layout.h).
>>>
>>> So, it will not be compiled for Arm MPU arch.
>> Yet that wasn't my question. I asked about non-Arm, for all of which it
>> looks like you're changing behavior of vm_init() (by suddenly making it
>> do nothing).
> 
> Oh now I see what you mean. There is no CONFIG_MMU is x86 , yet it is 
> used to enclose a common code which is a mistake.
> 
> So, we should introduce HAS_VMAP in xen/common/Kconfig and select it 
> from X86, X86_64 and Arm.
> 
> Is my understanding correct ?

Almost. On Arm the select would be conditional, depending on (or simply
from) MMU.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 07:20:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 07:20:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776003.1186152 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdlpU-0007bs-SK; Tue, 13 Aug 2024 07:20:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776003.1186152; Tue, 13 Aug 2024 07:20:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdlpU-0007bl-PP; Tue, 13 Aug 2024 07:20:28 +0000
Received: by outflank-mailman (input) for mailman id 776003;
 Tue, 13 Aug 2024 07:20: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=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdlpU-0007bf-5q
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 07:20:28 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 82f3ef34-5944-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 09:20:26 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-52efbb55d24so9022968e87.1
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 00:20:26 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f3fb0692sm44737766b.76.2024.08.13.00.20.24
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 00:20:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 82f3ef34-5944-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723533625; x=1724138425; 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=ZvjhYcFx2EC+2Kc5gul4JEuzdc6rcRyxzA6o+cUaad8=;
        b=TjNhFY1SEt3iyQsW6/+R+vKGr3sw0h2LruzR5CKTZi/F2CmuX0znkpuB3/raQ9OTTF
         /rRDQTpQBpt9Cqy3pjPTrCbX2+MQghSIsKr5UO+S5/lukqL89i7pDpr5ysqBgR7gFtDo
         tR+tY1bIN24z8LW2NEd14uNuTpNN4W6babgwnYEb9NAsD9J/nqrbJ0YV+n0azxXFZj+3
         AYl1LitO/XpY2ShCpMMpxf1N7Zc9LNYNu5de8d9z2GiX17NJdWvOaIn/0lBgf4YrRNYa
         n2FI3gK5R1GOVIYeNCH6ruBp6SnLnJ+O/yIj07kwNJgpGlXEcLD7/89144cwbrWl7T+w
         FMzQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723533625; x=1724138425;
        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=ZvjhYcFx2EC+2Kc5gul4JEuzdc6rcRyxzA6o+cUaad8=;
        b=fMAJCaUWzKRb9mQYYFkEMYOQ9K5aFqdUlOamvglAKeX0dpCOCIMA1zBE7lasEF5Go1
         BPk+V63tXoyT1cJU3ZdM73czkGaaY/NXQAKYWv/B8Ok5gG64E2P2noDcsV2aFIfD86KU
         vQq3uJG1bv5oSFuRjXv1i8I5K4jN0mtVl/0xVwq4WLGb518UVm3esM4/MpowoqhywUSR
         NriKlFkeTt0yBpt6RfWQKB3wViFU9WxQf3oCKEHXH+pip+fRnf1Onz/xGIjborsoVtKk
         epJr59EIoZMLeJlJfkzQe0RkebdLQO2Ha7zXKLsBufedE85t1P9NxT/VEE6npSF6U8Ro
         6j5A==
X-Forwarded-Encrypted: i=1; AJvYcCUJJizphboKUtcuyfEnhHcpiLUmq5mnxHN70wrCt+rz9dqtxRl75MIAPE3dtxtmhCb8KHLRqfG2SrcmDkTBE8+JMKqJd1XuNIYvrD7JSzc=
X-Gm-Message-State: AOJu0YxJmlYVuOAqjntX85Sc29IuzGTCGXLEYTZPD2ypBYQDSORPwdaP
	BIg4sVlUEotyk5LxuYP/zgjdjMAXJXMq9GU2vKBrBWLDvCvjMK1V01hfsYORtw==
X-Google-Smtp-Source: AGHT+IFGZ2kT+65QVQSLPNYWh342bovHTyn7P+R+YGqoXEpgSnn48jjsdgR4jstmxYKpxz/fS0PNIQ==
X-Received: by 2002:a05:6512:687:b0:52e:716a:1898 with SMTP id 2adb3069b0e04-5321369aaf5mr2053975e87.58.1723533625310;
        Tue, 13 Aug 2024 00:20:25 -0700 (PDT)
Message-ID: <771870c8-375c-41be-91fd-998dad4befb5@suse.com>
Date: Tue, 13 Aug 2024 09:20:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v6 1/3] x86/vmx: guard access to cpu_has_vmx_* in
 common code
To: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>, Paul Durrant <paul@xen.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <cover.1723110344.git.Sergiy_Kibrik@epam.com>
 <6486b627fd3bdcca3ad877ed6c97ca5cbc51d8e3.1723110344.git.Sergiy_Kibrik@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <6486b627fd3bdcca3ad877ed6c97ca5cbc51d8e3.1723110344.git.Sergiy_Kibrik@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 08.08.2024 12:08, Sergiy Kibrik wrote:
> There're several places in common code, outside of arch/x86/hvm/vmx,
> where cpu_has_vmx_* get accessed without checking whether VMX supported first.
> These macros rely on global variables defined in vmx code, so when VMX support
> is disabled accesses to these variables turn into build failures.
> 
> To overcome these failures, build-time check is done before accessing global
> variables, so that DCE would remove these variables.
> 
> Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
> Acked-by: Paul Durrant <paul@xen.org>

I can accept this is being kind of complete, so
Acked-by: Jan Beulich <jbeulich@suse.com>
Howver, ...

> ---
> changes in v6:
>  - guard all of cpu_has_vmx_* macros

... this clearly isn't the case. For one ...
> --- a/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
> +++ b/xen/arch/x86/include/asm/hvm/vmx/vmcs.h
> @@ -298,69 +298,99 @@ extern u64 vmx_ept_vpid_cap;
>  #define VMX_TSC_MULTIPLIER_MAX                  0xffffffffffffffffULL
>  
>  #define cpu_has_wbinvd_exiting \
> -    (vmx_secondary_exec_control & SECONDARY_EXEC_WBINVD_EXITING)
> +    (IS_ENABLED(CONFIG_INTEL_VMX) && \
> +     vmx_secondary_exec_control & SECONDARY_EXEC_WBINVD_EXITING)

... a few lines up from here there is cpu_has_vmx_virt_spec_ctrl. And
there are quite a few more in vmx.h (don't ask me why things are split
like this). Yet on the grounds that at least this one block of code
now is consistent, I think we can leave further adjustments to possible
later commits.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 07:31:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 07:31:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776013.1186163 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdm0M-0001OM-R2; Tue, 13 Aug 2024 07:31:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776013.1186163; Tue, 13 Aug 2024 07:31:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdm0M-0001OF-N1; Tue, 13 Aug 2024 07:31:42 +0000
Received: by outflank-mailman (input) for mailman id 776013;
 Tue, 13 Aug 2024 07:31:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdm0L-0001O6-AB
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 07:31:41 +0000
Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com
 [2a00:1450:4864:20::230])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 14888071-5946-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 09:31:40 +0200 (CEST)
Received: by mail-lj1-x230.google.com with SMTP id
 38308e7fff4ca-2ef248ab2aeso80458161fa.0
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 00:31: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-a80f3fa7093sm46118766b.63.2024.08.13.00.31.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 00:31:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 14888071-5946-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723534299; x=1724139099; 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=6sGnAI8AGsF2NkuD50HKhnOzbAnW4OkzrQb2qfJ7fSc=;
        b=gZ2TpSranIcM/bStLmw+KeGVOQ5QdiDUWfeJ6dzHkxjfUg7kopO5QrvTwpIFqbEZ+P
         aI5b6xmkFe3nbo0QUr8UkNwkDjHfEuA4TEMPgxY+vMKIdh/m0+RtBK10tgF56vH1jX1j
         +pp8fMLaWmnO/gKAXLdDLE3wBUrMkUyCuprAHCvOugGie6A+aIGrUiHikYRppQK7KqGe
         m0HjhOhQHG+veCkia7N3AS2tvd750DYEE2FlPoidUbrhQ0ZmLifN5Q6hiK6jTAQ9TI5w
         BzR65tuub7/Jyssu3j77QKYWo6syravr/aXIATFS+mkg9SjMMAe/I4KAkN/jpL97dwJt
         A4xg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723534299; x=1724139099;
        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=6sGnAI8AGsF2NkuD50HKhnOzbAnW4OkzrQb2qfJ7fSc=;
        b=fMPlYkfvP1xW6jMxYT4CkV/UjEW4RxK7ZFrjv6XHIXnfnDBEysvcN+jJppusCyUZ6h
         HAHwDUgZM1xIBDpytCX8Wfht+gQfdleYa9HbwiYcYPk2l1yX1kb7zSOyT1MS1U8gsJmn
         Sqk520AyNmMMq0iaAW95uGywLzcFK2HQSjlsos6v9i5RKCPyQZElcvj8+2Qbu+biuYSz
         pTxJsyPJM5pDM8HzsRhbS6JXXa1GJWJe4SYflz1wzCA+8x+PDHrosCcLYdk7J9BTs2l0
         2CT7kIK8djpbn+gxsqMZ+cyxyii1pgh5zdwJhKYelL8uGI+9FjRJka9MH5xwDV+ms9GB
         vtcw==
X-Forwarded-Encrypted: i=1; AJvYcCUneMHjp8ABiuo9zppBpCp/3PEKerB+unZ2Kr+vf9YGKlEKWMuXrt/BK+QerEHwbOezbf2zEj3PP9LcraJwt/oMNxcIMA1VAsSHYmHTnbY=
X-Gm-Message-State: AOJu0YymxZMG0KMu01bbfNStyMQUH0e0AT8GH2qmyDniCpVpu+2ooutU
	jNy1Cy5CeAi2KY8YDezEz53hy4UlwTWNBk1eCx1eKQPjZZpd2XnOGgeXKRPAXg==
X-Google-Smtp-Source: AGHT+IEI18awnUhq0TsLY3XBRWpvGinAFr5d11Gff+gPY1DAgM7ryR7PRl0JL/jMmvyv59G+TkajxQ==
X-Received: by 2002:a2e:3216:0:b0:2f2:9df8:e64e with SMTP id 38308e7fff4ca-2f2b714e6aamr20541241fa.11.1723534299153;
        Tue, 13 Aug 2024 00:31:39 -0700 (PDT)
Message-ID: <952701cd-83d8-4c1f-9f38-ee63ba582d66@suse.com>
Date: Tue, 13 Aug 2024 09:31:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v6 2/3] ioreq: do not build
 arch_vcpu_ioreq_completion() for non-VMX configurations
To: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Cc: Xenia Ragiadakou <burzalodowa@gmail.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xenia Ragiadakou <xenia.ragiadakou@amd.com>, Julien Grall <julien@xen.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723110344.git.Sergiy_Kibrik@epam.com>
 <04e5397ecfcdb4d5680c7d36f71c4b471004ccd0.1723110344.git.Sergiy_Kibrik@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <04e5397ecfcdb4d5680c7d36f71c4b471004ccd0.1723110344.git.Sergiy_Kibrik@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 08.08.2024 12:10, Sergiy Kibrik wrote:
> From: Xenia Ragiadakou <burzalodowa@gmail.com>
> 
> VIO_realmode_completion is specific to vmx realmode and thus the function
> arch_vcpu_ioreq_completion() has actual handling work only in VMX-enabled build,
> as for the rest x86 and ARM build configurations it is basically a stub.
> 
> Here a separate configuration option ARCH_IOREQ_COMPLETION introduced that tells

Nit: The rename of the option wants to be reflected here, too.

> --- a/xen/Kconfig
> +++ b/xen/Kconfig
> @@ -95,4 +95,10 @@ config LTO
>  config ARCH_SUPPORTS_INT128
>  	bool
>  
> +#
> +# For platforms that require specific handling of ioreq completion events
> +#
> +config ARCH_VCPU_IOREQ_COMPLETION
> +	bool

If already you add a comment here, then it similarly wants to disambiguate
things by saying "per-vCPU ioreq completion events" or something along these
lines.

> --- a/xen/include/xen/ioreq.h
> +++ b/xen/include/xen/ioreq.h
> @@ -111,7 +111,17 @@ void ioreq_domain_init(struct domain *d);
>  int ioreq_server_dm_op(struct xen_dm_op *op, struct domain *d, bool *const_op);
>  
>  bool arch_ioreq_complete_mmio(void);
> +
> +#ifdef CONFIG_VCPU_ARCH_IOREQ_COMPLETION
>  bool arch_vcpu_ioreq_completion(enum vio_completion completion);
> +#else
> +static inline bool arch_vcpu_ioreq_completion(enum vio_completion completion)
> +{
> +    ASSERT_UNREACHABLE();
> +    return true;
> +}

My prior comment here remains: Despite pre-existing behavior being to return
"true" here, I question that to be in line with coding-best-practices.pandoc.
Imo the generalization of the stub is a good opportunity to adjust that. But
yes, it could also be done in a separate change. If you really don't want to
do so right here, then
Acked-by: Jan Beulich <jbeulich@suse.com>
with the two cosmetic adjustments (which likely could also be done while
committing).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 07:40:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 07:40:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776021.1186172 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdm8g-0003Sg-Jo; Tue, 13 Aug 2024 07:40:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776021.1186172; Tue, 13 Aug 2024 07:40:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdm8g-0003SZ-Gu; Tue, 13 Aug 2024 07:40:18 +0000
Received: by outflank-mailman (input) for mailman id 776021;
 Tue, 13 Aug 2024 07:40:17 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdm8f-0003ST-F0
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 07:40:17 +0000
Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com
 [2a00:1450:4864:20::635])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 47e5214c-5947-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 09:40:15 +0200 (CEST)
Received: by mail-ej1-x635.google.com with SMTP id
 a640c23a62f3a-a7a9cf7d3f3so601022766b.1
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 00:40:15 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f411b4e3sm45263166b.126.2024.08.13.00.40.13
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 00:40:14 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 47e5214c-5947-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723534815; x=1724139615; 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=F68ubw53LZI2jL3telJkywVWNadBzNJB5N+2hKuEjQU=;
        b=Jmhubhd71KYMmYCULxBwyH7hzfp16LZjS0OpEGyP+YS1Z9Mog8NGovr/Z223iDxw5n
         u8xnOHgAbLab8As//Zj3oaToiTYAKyywNTim+ov2EZFKQDbQ/WEbd0TuWW2OOt3YOZ1r
         9p/RPo+CxEnFpgP0QRqP33glxhaxwNJCTeDCmB5h5beisUNKtoxLAWJXVfLZm5pZW4dJ
         coXe2SgLCSgJAaGdnSwQ8rYISD51YVWclK4dB6itPiaT7YS8H5u9Fsr9tG65rtRkdLfG
         9DelVF5jFLlgPd4mrOWKgo35SP4pkCjgpf7TN0tOWE+Gd4cZPdcrJ/39ali8/dmaypWq
         /16g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723534815; x=1724139615;
        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=F68ubw53LZI2jL3telJkywVWNadBzNJB5N+2hKuEjQU=;
        b=IRcHd8xOcBavQ7DlQaz5KH1Abik8IMq3U14sWJd0pnQL5xEzq9qEiHRx3qCqt2fDoW
         rBQFj7tpnz//qRqRlyVjVvY4TGlKFYyOVmIJ0Uxa1yB5b9gRggHUBIj+TPF0AEMEWY5R
         4gvCjN4GCiK0kwCU8LiqK7DY0wy2LbyTLLj7Fv2904MgFxE4fwNTJP/+S3G8TCOJ7nGV
         /npGt/d03aNc5GSDPVk3875GlZiu1i1Zmp5g3JlkdS50hlvjPFoTdiYOhqbpyy1r5Xtx
         AuT9gZl/S2dJiL6KQrvf/EBP3CLc4e11crr5kVN4/DCfkUzyf3XiNE0mX59LUn5SkTVF
         OYQw==
X-Forwarded-Encrypted: i=1; AJvYcCULzgqi2X0ScmB9eABJW9ruAnEiXZ2KyRikn0AauOX45BfvbdgrqMGYtRSxbKAxAapfkIzzF/2mixuhbB+KmlP3J9elHwNVc3OMcNzejcM=
X-Gm-Message-State: AOJu0YxmT4wuCLwSXLNXZk8cLPJKJH5uNcWwXh7ue9PS1ApWKhdJ5L4f
	Whi3ITflnrc68ufTLTYQJP4xekZLExgfPoaYtIuvKdkAFRK2bDgyjj1z/1vr4A==
X-Google-Smtp-Source: AGHT+IFvVSbjXv5zfDnR6nG8sl7fAYkkrhUdwocf4kSXSPnsBLHgjRTG7CR97aQKft9XsdlSpOpM0w==
X-Received: by 2002:a17:907:9411:b0:a7a:c106:3640 with SMTP id a640c23a62f3a-a80ed2d4853mr164475066b.66.1723534814810;
        Tue, 13 Aug 2024 00:40:14 -0700 (PDT)
Message-ID: <7d390391-4ae2-442e-90a3-d8d242d7ae6f@suse.com>
Date: Tue, 13 Aug 2024 09:40:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v1 1/2] x86/intel: optional build of intel.c
To: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1723196909.git.Sergiy_Kibrik@epam.com>
 <25e80b9271607da56abf9d4193e4d91b3d00bd9c.1723196909.git.Sergiy_Kibrik@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <25e80b9271607da56abf9d4193e4d91b3d00bd9c.1723196909.git.Sergiy_Kibrik@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 09.08.2024 12:09, Sergiy Kibrik wrote:
> With specific config option INTEL in place and most of the code that depends
> on intel.c now can be optionally enabled/disabled it's now possible to put
> the whole intel.c under INTEL option as well. This will allow for a Xen build
> without Intel CPU support.
> 
> Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
> ---
>  xen/arch/x86/cpu/Makefile            | 6 +++---
>  xen/arch/x86/cpu/common.c            | 4 +++-
>  xen/arch/x86/include/asm/processor.h | 7 ++++---
>  3 files changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/xen/arch/x86/cpu/Makefile b/xen/arch/x86/cpu/Makefile
> index eafce5f204..020c86bda3 100644
> --- a/xen/arch/x86/cpu/Makefile
> +++ b/xen/arch/x86/cpu/Makefile
> @@ -6,10 +6,10 @@ obj-y += amd.o
>  obj-y += centaur.o
>  obj-y += common.o
>  obj-y += hygon.o
> -obj-y += intel.o
> -obj-y += intel_cacheinfo.o
> +obj-$(CONFIG_INTEL) += intel.o
> +obj-$(CONFIG_INTEL) += intel_cacheinfo.o
>  obj-y += mwait-idle.o
> -obj-y += shanghai.o
> +obj-$(CONFIG_INTEL) += shanghai.o
>  obj-y += vpmu.o
>  obj-$(CONFIG_AMD) += vpmu_amd.o
>  obj-$(CONFIG_INTEL) += vpmu_intel.o
> diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
> index ff4cd22897..50ce13f81c 100644
> --- a/xen/arch/x86/cpu/common.c
> +++ b/xen/arch/x86/cpu/common.c
> @@ -336,11 +336,13 @@ void __init early_cpu_init(bool verbose)
>  
>  	c->x86_vendor = x86_cpuid_lookup_vendor(ebx, ecx, edx);
>  	switch (c->x86_vendor) {
> +#ifdef CONFIG_INTEL
>  	case X86_VENDOR_INTEL:    intel_unlock_cpuid_leaves(c);
>  				  actual_cpu = intel_cpu_dev;    break;
> +	case X86_VENDOR_SHANGHAI: actual_cpu = shanghai_cpu_dev; break;
> +#endif
>  	case X86_VENDOR_AMD:      actual_cpu = amd_cpu_dev;      break;
>  	case X86_VENDOR_CENTAUR:  actual_cpu = centaur_cpu_dev;  break;
> -	case X86_VENDOR_SHANGHAI: actual_cpu = shanghai_cpu_dev; break;
>  	case X86_VENDOR_HYGON:    actual_cpu = hygon_cpu_dev;    break;
>  	default:
>  		actual_cpu = default_cpu;
> diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/asm/processor.h
> index 66463f6a6d..a88d45252b 100644
> --- a/xen/arch/x86/include/asm/processor.h
> +++ b/xen/arch/x86/include/asm/processor.h
> @@ -507,15 +507,16 @@ static inline uint8_t get_cpu_family(uint32_t raw, uint8_t *model,
>  extern int8_t opt_tsx;
>  extern bool rtm_disabled;
>  void tsx_init(void);
> +void update_mcu_opt_ctrl(void);
> +void set_in_mcu_opt_ctrl(uint32_t mask, uint32_t val);
>  #else
>  #define opt_tsx      0     /* explicitly indicate TSX is off */
>  #define rtm_disabled false /* RTM was not force-disabled */
>  static inline void tsx_init(void) {}
> +static inline void update_mcu_opt_ctrl(void) {}
> +static inline void set_in_mcu_opt_ctrl(uint32_t mask, uint32_t val) {}
>  #endif
>  
> -void update_mcu_opt_ctrl(void);
> -void set_in_mcu_opt_ctrl(uint32_t mask, uint32_t val);

I'm okay-ish with the simple stubbing out for update_mcu_opt_ctrl(), but
set_in_mcu_opt_ctrl() imo requires more work. The call sites in spec_ctrl.c
shouldn't give the wrong impression of having some effect. Imo in
init_speculation_mitigations() an #endif wants to move down, while all of
gds_calculations() wants to be compiled out. And that likely extends to
further Intel-only functions there (with an early bail-out keyed to
boot_cpu_data.x86_vendor != X86_VENDOR_INTEL). Which overall likely means
there wants to be another separate patch dealing with that. (And then
maybe a counterpart one for AMD.)

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 07:50:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 07:50:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776030.1186182 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdmIS-0005dK-GG; Tue, 13 Aug 2024 07:50:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776030.1186182; Tue, 13 Aug 2024 07:50:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdmIS-0005dD-DX; Tue, 13 Aug 2024 07:50:24 +0000
Received: by outflank-mailman (input) for mailman id 776030;
 Tue, 13 Aug 2024 07:50:23 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdmIR-0005d7-58
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 07:50:23 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b0eed6cd-5948-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 09:50:21 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a7a975fb47eso53349766b.3
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 00:50:21 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f3f4d20dsm46422766b.7.2024.08.13.00.50.20
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 00:50:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b0eed6cd-5948-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723535421; x=1724140221; 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=iU16W9vrjcNSJGiegNTNZzPvUXM7To+t+VTlQLrW9mU=;
        b=ZcB3VC/ZD6pL2MBo491/jOS9WEtiUIeprYWynM+9sfzH89wxPeOLpEJgxlFbZ663pj
         H8UPC2LQv8CIIpa9uxO1A6Ps51+LEQ5//u5ysvVVmD3jtQCgEdy0L4cIBVcHd5CJ/6tx
         TPGz5DCu1E29DS+zQ9ddDBH4svFE6YA5NDv2qZR4kK6OT2b6cloqgwJPWKpjnBk/LWHz
         CBW3av3gimJXjZHAYQj9ODLfZc/D8f8kUsusPLg5s2wP7So8wIO6amADIyuCdpsMcT/b
         lT97J4T8Mq4IfQEWbUMMs6gWFen0l3l3I8FxyW4nWaTZbltfHm7gX9saLTRiSKzV4fOR
         LJbA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723535421; x=1724140221;
        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=iU16W9vrjcNSJGiegNTNZzPvUXM7To+t+VTlQLrW9mU=;
        b=bsBE5fYEubzayHtWPiWbDbW51meJL/yTajofpI+KTsNqDhibgRq2INGKis/OEv7K/Q
         vaMbqhUACVcTN7Kni8q6HVuAduS4UfWLhOh/TD4+TAyVe4pYAs09b0aYYr2Dpi0r0D6q
         h/lMFKsRAnS1QvAQmVuwOeyWPLDFfLkssloBeblAAxWk0y/hV2ZWPnTSweDe+UtIia28
         +ZdA7e6Lh9NRWcIfl9Gc7hpwU+4ThfRQ8NH4iL35uI+jrQrjKhdjDBRONQEFVw8sZ9lW
         sjVrx3dc4tqwPDap+uhuZc2kWCc73KUB/iZVm7rMHOmtC1uS5QkiLti0vQxsEtAaMn+r
         ZHvA==
X-Forwarded-Encrypted: i=1; AJvYcCVuK0gcusXQAXMHgWxkPp8gRPNgDIIfsAme2Vy6lEn8nY72675eO7GqeZHBMGQbyZaWneGgQAsSoeY48XlhAzbm+l3gdFa9KwbpVd1k8i8=
X-Gm-Message-State: AOJu0Yw5V5+lHuApCvwr30BKgqk0KbyLQIaF6gjig61/5QJaaL3aRrVt
	EZgf0ye9v33elX187YxaZkh531QFqYMfqkCb+w5KW+aLr4Tlpaffc47ta3VWdw==
X-Google-Smtp-Source: AGHT+IGvCAgRnWyZF4QJnS+ktMfHnZIMGIjjnPqFA2h7vfrG/ZtJLLTdsfk5Rklatab0Yy0Ecp5KNA==
X-Received: by 2002:a17:907:2d8f:b0:a80:f7db:3e7 with SMTP id a640c23a62f3a-a80f7db06e0mr70556166b.5.1723535420538;
        Tue, 13 Aug 2024 00:50:20 -0700 (PDT)
Message-ID: <abdac4dc-b8e4-46ad-bd4b-c39caa868a9f@suse.com>
Date: Tue, 13 Aug 2024 09:50:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v1 2/2] x86/amd: optional build of amd.c
To: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1723196909.git.Sergiy_Kibrik@epam.com>
 <5632b05e993cca78a58b800dd37165ccd80b944f.1723196909.git.Sergiy_Kibrik@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <5632b05e993cca78a58b800dd37165ccd80b944f.1723196909.git.Sergiy_Kibrik@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 09.08.2024 12:11, Sergiy Kibrik wrote:
> --- a/xen/arch/x86/include/asm/amd.h
> +++ b/xen/arch/x86/include/asm/amd.h
> @@ -158,13 +158,21 @@
>  #define is_zen4_uarch()   boot_cpu_has(X86_FEATURE_AUTO_IBRS)
>  
>  struct cpuinfo_x86;
> +#ifdef CONFIG_AMD
>  int cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu, int osvw_id, ...);
> +#else
> +static inline int cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu, int osvw_id, ...)

Nit: Too long line.

> +{
> +    return false;

I wouldn't mind if you consistently changed the function to return
bool, but as long as it returns int I don't think it should be returning
false.

> @@ -173,5 +181,19 @@ extern bool amd_virt_spec_ctrl;
>  bool amd_setup_legacy_ssbd(void);
>  void amd_set_legacy_ssbd(bool enable);
>  void amd_set_cpuid_user_dis(bool enable);
> +#else
> +static inline void amd_set_cpuid_user_dis(bool enable) {}
> +static inline void amd_set_legacy_ssbd(bool enable) {}
> +static inline bool amd_setup_legacy_ssbd(void)
> +{
> +    return false;
> +}

Nit: Would be a little nicer if these were in the same order as their
corresponding declarations. However, along the lines of one of my
comments on the Intel counterpart patch ...

> +#define amd_acpi_c1e_quirk (false)
> +#define amd_virt_spec_ctrl (false)
> +#define amd_legacy_ssbd (false)
> +
> +static inline void amd_check_disable_c1e(unsigned int port, u8 value) {}
> +#endif

... question overall is how many of these stubs are really required,
once clearly AMD-only code is properly taken care of (perhaps not just
in spec_ctrl.c).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 08:22:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 08:22:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776043.1186191 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdmnA-00033G-TU; Tue, 13 Aug 2024 08:22:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776043.1186191; Tue, 13 Aug 2024 08:22:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdmnA-000339-R1; Tue, 13 Aug 2024 08:22:08 +0000
Received: by outflank-mailman (input) for mailman id 776043;
 Tue, 13 Aug 2024 08:22: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=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdmn9-000333-Dm
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 08:22:07 +0000
Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com
 [2a00:1450:4864:20::52a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 201b7f0b-594d-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 10:22:06 +0200 (CEST)
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-5bd1a9bdce4so3294520a12.3
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 01:22:06 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f414e1c1sm49264166b.171.2024.08.13.01.22.04
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 01:22:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 201b7f0b-594d-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723537325; x=1724142125; 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=ZU+iJbV0mDtYpEiwtH4San+Tbr7mMkd0jWfaumuGKEc=;
        b=QI/TDJOmKdkG4ZFTkdVaG0woo9GV0sW9eU1tORDFZLsZq8wy9S06edAp0+GlLmP3X0
         kz8DoeGwF7gtDDNy1T9pQzDRl8/vs0/GRlPZfhV8/flhKJUDYRQQqD4TAmWZZHxY+90c
         QaF3IsjdR6x+is8yl7sEjyyilPDOXerzNgNdqFi13wiIAeP6qqGNoiF78TqzvEoFctMa
         FDMpuHcJNpAaoEdtvIw9/a1H73E/fHiM8PPzc5hlY7J/tQ0z0k/w4dOkR3bJVi4M+ab4
         6fQfpJo2s8WSOQppdBmuqeAqkSmqL/TWaSI0Z+Fp0GF1ISDh2wS6RYbogbPDzPnOF760
         0lAg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723537325; x=1724142125;
        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=ZU+iJbV0mDtYpEiwtH4San+Tbr7mMkd0jWfaumuGKEc=;
        b=HnCTz0irsVKr3jIQw5tYNFsrd42EqdrTaHXmnBMjjW4yukxORJ4s+DJcYbsIhBXSv4
         xkkPbP+M6K7tp9MjyVNID1oRfQ+qIZwq0jVYoNIFA0lA7IO7R/URIy1bFzrxTEje5lAL
         qnH21Sdg2gDhB5DCVPyA22wXlYBULelem6y3neD6AHOeGMpbS6Ds1xGVQSC9X1MBs0EZ
         5t+owGDWqcDAyNuTqYp5/HJ5/qq4Q7Da7H3/6nC4qwlxCftbFdYHcdZkSS0GtD0xk8HX
         cvpaRJMWaVGhaZb+XsdP1o8e4bWZh9UocWKhgBcZ2npfV+PHZLQl9mfa6VUkA+LmYF7b
         ySwA==
X-Forwarded-Encrypted: i=1; AJvYcCUCQxF4Lbv6Vf4v++OFGM7bIKxDq8Dc/BdwU7k1PA3eV1DEFKZpJA3L7+bQdK7PICxFyE1b1Iog9B4lKc1mvh1DT5Sho9UxyrdubhrTZSE=
X-Gm-Message-State: AOJu0YxLGO97yEyYqs8DyUof4OKzNPw72qyyJzNnRGlKa4WehZTdUbLL
	82ZDS1d0uwxHoZ4k1eX2E7mpiA6Z+UsKBTIyAs+6uVHsXVyl8mnnlOrOuoxpLw==
X-Google-Smtp-Source: AGHT+IG87xwq6QTNVjirV8RYJikk3tuWsqy2AghRQMbFq6AI3UXQsOUpwd+rug0PT5kvAp8Ca/2bhw==
X-Received: by 2002:a17:907:608a:b0:a7d:391f:17af with SMTP id a640c23a62f3a-a80ed2c4690mr168617466b.51.1723537325132;
        Tue, 13 Aug 2024 01:22:05 -0700 (PDT)
Message-ID: <07f19bb5-bd76-4158-875e-48f74e427a89@suse.com>
Date: Tue, 13 Aug 2024 10:22:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 2/7] xen/riscv: set up fixmap mappings
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <1c1c0f912a9abbb542baa1ce92e75d64ec8043e9.1723214540.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1c1c0f912a9abbb542baa1ce92e75d64ec8043e9.1723214540.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 09.08.2024 18:19, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/include/asm/config.h
> +++ b/xen/arch/riscv/include/asm/config.h
> @@ -74,6 +74,14 @@
>  #error "unsupported RV_STAGE1_MODE"
>  #endif
>  
> +#define XEN_VIRT_SIZE           MB(2)
> +
> +#define BOOT_FDT_VIRT_START     (XEN_VIRT_START + XEN_VIRT_SIZE)
> +#define BOOT_FDT_VIRT_SIZE      MB(4)
> +
> +#define FIXMAP_BASE             (BOOT_FDT_VIRT_START + BOOT_FDT_VIRT_SIZE)
> +#define FIXMAP_ADDR(n)          (FIXMAP_BASE + (n) * PAGE_SIZE)

Just to confirm: Did you consider leaving gaps between the regions, but
then discarded that idea for whatever reason? It's not like you're tight
on address space.

As to FIXMAP_ADDR() - wouldn't that be a better fit in fixmap.h?

> --- /dev/null
> +++ b/xen/arch/riscv/include/asm/fixmap.h
> @@ -0,0 +1,44 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * fixmap.h: compile-time virtual memory allocation
> + */
> +#ifndef ASM_FIXMAP_H
> +#define ASM_FIXMAP_H
> +
> +#include <xen/bug.h>
> +#include <xen/page-size.h>
> +#include <xen/pmap.h>
> +
> +#include <asm/page.h>
> +
> +/* Fixmap slots */
> +#define FIX_PMAP_BEGIN (0) /* Start of PMAP */
> +#define FIX_PMAP_END (FIX_PMAP_BEGIN + NUM_FIX_PMAP - 1) /* End of PMAP */
> +#define FIX_MISC (FIX_PMAP_END + 1)  /* Ephemeral mappings of hardware */
> +
> +#define FIX_LAST (FIX_MISC + 1) /* +1 means a guard slot */

As per my comment on the earlier version: No, I don't think this arranges
for a guard slot. It merely arranges for FIX_MISC to not trigger the
BUG_ON() in virt_to_fix().

> --- a/xen/arch/riscv/include/asm/page.h
> +++ b/xen/arch/riscv/include/asm/page.h
> @@ -81,6 +81,12 @@ static inline void flush_page_to_ram(unsigned long mfn, bool sync_icache)
>      BUG_ON("unimplemented");
>  }
>  
> +/* Write a pagetable entry. */
> +static inline void write_pte(pte_t *p, pte_t pte)
> +{
> +    *p = pte;
> +}

No use of write_atomic() here? And no read_pte() counterpart right away (then
also properly using read_atomic())?

> @@ -191,6 +195,45 @@ static bool __init check_pgtbl_mode_support(struct mmu_desc *mmu_desc,
>      return is_mode_supported;
>  }
>  
> +void __init setup_fixmap_mappings(void)
> +{
> +    pte_t *pte, tmp;
> +    unsigned int i;
> +
> +    BUILD_BUG_ON(FIX_LAST >= PAGETABLE_ENTRIES);
> +
> +    pte = &stage1_pgtbl_root[pt_index(HYP_PT_ROOT_LEVEL, FIXMAP_ADDR(0))];
> +
> +    /*
> +     * In RISC-V page table levels are numbered from Lx to L0 where
> +     * x is the highest page table level for currect  MMU mode ( for example,
> +     * for Sv39 has 3 page tables so the x = 2 (L2 -> L1 -> L0) ).
> +     *
> +     * In this cycle we want to find L1 page table because as L0 page table
> +     * xen_fixmap[] will be used.
> +     */
> +    for ( i = HYP_PT_ROOT_LEVEL; i-- > 1; )
> +    {
> +        BUG_ON(!pte_is_valid(*pte));
> +
> +        pte = (pte_t *)LOAD_TO_LINK(pte_to_paddr(*pte));
> +        pte = &pte[pt_index(i, FIXMAP_ADDR(0))];
> +    }
> +
> +    BUG_ON(pte_is_valid(*pte));
> +
> +    tmp = paddr_to_pte(LINK_TO_LOAD((unsigned long)&xen_fixmap), PTE_TABLE);
> +    write_pte(pte, tmp);
> +
> +    RISCV_FENCE(rw, rw);

In the changes section you say "r,r", and I was wondering about that. I
take it that "rw,rw" is really what's needed here.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 08:36:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 08:36:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776053.1186202 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdn0q-00059Z-2j; Tue, 13 Aug 2024 08:36:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776053.1186202; Tue, 13 Aug 2024 08:36:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdn0p-00059S-W2; Tue, 13 Aug 2024 08:36:15 +0000
Received: by outflank-mailman (input) for mailman id 776053;
 Tue, 13 Aug 2024 08:36: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=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdn0o-00059M-PE
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 08:36:14 +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 19642e71-594f-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 10:36:13 +0200 (CEST)
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-a7a9a369055so404898866b.3
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 01:36:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f414bef2sm49913966b.143.2024.08.13.01.36.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 01:36:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 19642e71-594f-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723538173; x=1724142973; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=sVjJTxOBX7geMbT7t4pB/xLxxc6TKA81wDXedEbM3k0=;
        b=UbHKGWLmZbKOL5AeuJjL4cUw5bj0FW7nCI0PeVaXVGNyqdFpkY0dn9MGhXmoYlmNBC
         jn3PPHkE2GD/64mP3fK+DE48Bq4sdkQdtXClLva4g8uxu4Oh4MdCGOkEbswPM8ty5ejh
         zskqTIXVykL5i7EqyszHBwErUvxhy4RLYDFSMYWD9f5Q7XRz1Or2kFxHT5KpsJP92vmw
         w/1dXy2Jb7gqPvusn5UVBGbQwqiWKQAqyo09QFs8anjiIfpa9R5k8KH74wgNw5XIFoyA
         IMTf7al04mxj0pGYjTIDQKXI35d1lErjDhaXuT/GjUfG9BzrsH/51UFtV03tyQw47sy9
         F1uw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723538173; x=1724142973;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=sVjJTxOBX7geMbT7t4pB/xLxxc6TKA81wDXedEbM3k0=;
        b=cJE+0WobZPc4ni4IFPBY4EOCiOqsA65G9LD0rhlDT9VMmfJBHOSlNa3SXIWePuJrxP
         EfPejYnE+CNIYB0GQuyddTiBZmQ6crIt0rYuCTaYEg1JKAhfP0/Te/lSkFkFF30QxObP
         dtOeauKVF8bjZ5yokxubRIUXuma4CrYn9FfRAR8Ahc2qFyZ54s5pNqnhM8o7fk1xH1qw
         mwY/aykyOZxnGbfmTBnejQNhyrYX4EW/2nZfL+JBHMHN2HEraqabgBu2sqNSpIPspT3z
         Vws1aexFTjkNPThm1E5ohs4KSFFOPXK1VUlwmY+K4YuqwV8ppHm8taP+E5wBrvoKokfp
         AinA==
X-Gm-Message-State: AOJu0Yw/w2vlg2IRpYIi3lrtImUikW8HH3EtcN+RFCHpFkSn1irKXS8i
	oz3aGaUWn34VxHKjlRnnkRj2lnal3Gq8P7iUJogc+kbtcw0uy4WQj7FmYULFinqKI7mJVSYlP5c
	=
X-Google-Smtp-Source: AGHT+IGtdeZoEoyFVwnqMHDkn0kH4ag7oua/d0DTtb5BFPdtt8jnPjRdq3orm6hh3N/IlZ1XIhPrPg==
X-Received: by 2002:a17:907:1c85:b0:a7a:9f0f:ab14 with SMTP id a640c23a62f3a-a80ed25893fmr182542066b.33.1723538173009;
        Tue, 13 Aug 2024 01:36:13 -0700 (PDT)
Message-ID: <ad60ded1-5feb-4fd9-8cf8-6dee2e153d11@suse.com>
Date: Tue, 13 Aug 2024 10:36:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Julien Grall <julien@xen.org>, Stefano Stabellini
 <sstabellini@kernel.org>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] Arm: correct FIX_LAST
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

While reviewing a RISC-V patch cloning the Arm code, I noticed an
off-by-1 here: FIX_PMAP_{BEGIN,END} being an inclusive range, FIX_LAST
cannot be the same as FIX_PMAP_END, or else the BUG_ON() in
virt_to_fix() would trigger if FIX_PMAP_END ended up being used.

Fixes: 4f17357b52f6 ("xen/arm: add Persistent Map (PMAP) infrastructure")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Alternatively the definition of FIXADDR_TOP could be changed, if "last"
should retain its strict meaning. Possibly a guard page also wants
having at the end of the fixmap range, which could be effected by
changing both #define-s at the same time.

--- a/xen/arch/arm/include/asm/fixmap.h
+++ b/xen/arch/arm/include/asm/fixmap.h
@@ -15,7 +15,7 @@
 #define FIX_PMAP_BEGIN (FIX_ACPI_END + 1) /* Start of PMAP */
 #define FIX_PMAP_END (FIX_PMAP_BEGIN + NUM_FIX_PMAP - 1) /* End of PMAP */
 
-#define FIX_LAST FIX_PMAP_END
+#define FIX_LAST (FIX_PMAP_END + 1)
 
 #define FIXADDR_START FIXMAP_ADDR(0)
 #define FIXADDR_TOP FIXMAP_ADDR(FIX_LAST)


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 08:41:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 08:41:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776063.1186212 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdn5b-00075j-L0; Tue, 13 Aug 2024 08:41:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776063.1186212; Tue, 13 Aug 2024 08:41:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdn5b-00075c-H6; Tue, 13 Aug 2024 08:41:11 +0000
Received: by outflank-mailman (input) for mailman id 776063;
 Tue, 13 Aug 2024 08:41:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdn5a-00075W-4s
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 08:41:10 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c691c27c-594f-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 10:41:04 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-a7a8a4f21aeso560387166b.2
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 01:41:04 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f411bdc0sm50082166b.118.2024.08.13.01.41.02
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 01:41:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c691c27c-594f-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723538464; x=1724143264; 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=acoNRe3G/vhn1uXVYzhdFT5TIlUsChnSlM3vT1sP/oY=;
        b=U8olnw1RwHZVKXjkAiSiDdjDnn57wzihxJ2vG0dIfGajtA54iPgTgyk26kKDlhklhD
         7gfeq4tr7SS6YExto3FvVFsXweNOKZrbpDhuILo42UGi82VfAlPAeg//+nOnDuoF+xfb
         bzLW6Qr3hhJUyoeX+RtF1nfjWBMrC/iVVmaiRCZZcpLC7rJevKl+jKGaND9K0f5DjHm8
         EstjSiJCtZwxmlQC298LNL1b/VU2tYO+0mrZDGimm9X2OssrAFahGJKzEb/OCLcdU11X
         L4MUfbjjTBLDI5HN/PCTjgdiCbtHxKXNVdj3f1ibWTZhHePPSS3zx9r8MKFfXFBAMtT7
         pKoA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723538464; x=1724143264;
        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=acoNRe3G/vhn1uXVYzhdFT5TIlUsChnSlM3vT1sP/oY=;
        b=WgfIE0SynRR2qcDm+Q8QdE+4lpS5/oqrNVIZQUf1AwJtRjbjTOZXdO8hrDq4L0FnDA
         VQmWhDEI4juZzm2RuNZRe878TgWR94dbCMzkE2Wmc9/33RChgc02NLsqT20pktyTTUGh
         vxbUugzKt2JClvJyekAHsGbzH5TFE/NHzB/+gqC5uj0TXrYowkdRo0GRRnkSeNtqOU9Q
         6zslG0wncZ4x3Tkv765kAT+LKljQXqz6i51L05qLJpq6xZlkE1Fwm38v4emwIo9s0OXS
         flvmVulHNA2x8zqOEiSxvRvE3Gui4VvBL0wdCq+lgm0cb5l54DNRWggm7xA8MtL0Rhhx
         F8pw==
X-Forwarded-Encrypted: i=1; AJvYcCVml6F61vEMksoPrjcr9IzGvpwxTKZOso2bUFTFVvDe055UNpKiLNw13FMbRHLwRjeEu7mo0VsNnb8CncklAfNiMjl2OrK1B5NanuZWU5M=
X-Gm-Message-State: AOJu0YzzwWw55p2YivDWQvWZHEcH0A3O7YIQEH6cxgvnuXOp8oTxOg/q
	0+u/qgYIgixqHKAgW5P+QBLY9VJZNemxABwKVKMhrdBacKybDeSkjqqIcME3gQ==
X-Google-Smtp-Source: AGHT+IGz6ajwaY3wAezNqo18Usbmf7A4MqtSKdDAHzl6aExf/QmycG+rWvQhnXwvyzrKCv99tf3hBA==
X-Received: by 2002:a17:907:efe5:b0:a7a:aa35:408d with SMTP id a640c23a62f3a-a80ed1d679dmr212640766b.20.1723538463462;
        Tue, 13 Aug 2024 01:41:03 -0700 (PDT)
Message-ID: <441f2f8c-28ff-4f79-b812-aa7b8df6a53b@suse.com>
Date: Tue, 13 Aug 2024 10:41:02 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 3/7] xen/riscv: introduce asm/pmap.h header
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <2b4481a52aa260a95df9eaef3cd249a274699809.1723214540.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <2b4481a52aa260a95df9eaef3cd249a274699809.1723214540.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 09.08.2024 18:19, Oleksii Kurochko wrote:
> Introduce arch_pmap_{un}map functions and select HAS_PMAP for CONFIG_RISCV.
> 
> Add pte_from_mfn() for use in arch_pmap_map().
> 
> Introduce flush_xen_tlb_one_local() and use it in arch_pmap_{un}map().
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

> ---
> Changes in V4:
>  - mark arch_pmap_{un}map() as __init: documentation purpose and
>    a necessary (but not sufficient) condition here, to validly
>    use local TLB flushes only.
>  - add flush_xen_tlb_one_local() to arch_pmap_map() as absense of
>    "negative" TLB entrues will be guaranted only in the case
>    when Svvptc extension is present.
>  - s/mfn_from_pte/pte_from_mfn
>  - drop flush_xen_tlb_range_va_local() as it isn't used in this patch

Just as a remark: This and ...

>  - drop mfn_to_xen_entry() as pte_from_mfn() does the same thing
>  - add flags argument to pte_from_mfn().
>  - update the commit message.
>  - s/flush_xen_tlb_range_va_local/flush_tlb_range_va_local

... this don't go together very well.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 08:54:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 08:54:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776073.1186222 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdnIG-0000oe-MO; Tue, 13 Aug 2024 08:54:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776073.1186222; Tue, 13 Aug 2024 08:54:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdnIG-0000oX-Iv; Tue, 13 Aug 2024 08:54:16 +0000
Received: by outflank-mailman (input) for mailman id 776073;
 Tue, 13 Aug 2024 08:54:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdnIF-0000oB-1D
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 08:54:15 +0000
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com
 [2a00:1450:4864:20::52d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9cfdf8eb-5951-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 10:54:13 +0200 (CEST)
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-5b8c2a611adso6150122a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 01:54:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd1a5df843sm2789607a12.73.2024.08.13.01.54.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 01:54:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9cfdf8eb-5951-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723539253; x=1724144053; 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=AOBUvD3OMc0VHS5L27ULzk7dlY/S8+Su/4Gmbu6759g=;
        b=L6zhF3ePHwPn5XuQGjkwUyjvvTFesNdfFGe+jpXEdcP+xr0M6i6oOeZqZxjAV2Cv3s
         uMS6EsKB3abwgemUvnb50Hnf2jJvlDigMUspnQS29KAOk78Hd7kTsFpNmiEnK+DLej2o
         DyfOCeNuk5Xt60RCFoT65LiMdtsvsQn/t+lLnMT8Z7V8yN1mPwtYvqHZbVtuyCjxdAz6
         ZUJQ8B4jx4JBbcW4gdkiZ/zUoBnduPq3gKT3VWTVGedzlgCsG0vJPZFC1sHmbCrsbBvR
         MMVKOOPKztlCBt5jKBw1x7wAmo9AQprDGV9lFfUYlkEIf0MYKruCzq3y1h1KuyHVZ/ic
         IXHg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723539253; x=1724144053;
        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=AOBUvD3OMc0VHS5L27ULzk7dlY/S8+Su/4Gmbu6759g=;
        b=Q04WSBEZfnJIOtOfJYve+5uXfxMkjS45RtjawH/pzXH57LpMHnPN2VZD+Z+mfj4EhQ
         aKBRceAcWTKl6Rbh6dGef4RW/HyCY+l9DDi1zSbYxz2bYigApjy7Y+aYEh9VS20is8jI
         ZNDcyLC3O+dVQurSLqqV5L0q6YHl1pwoD3xPOUMeW3U4V5A9otsQfsOKQ7EnmmPIoAec
         i36qYBJV5SwHkB06TspgXSGpE+PksVcbfS1nadGs/K9kHeHuN/75waWASmw+QS/n4jLQ
         zTAn8dVcUazArmYpMW0e09EX4on/bUQYoCrgnzFtIbbRvOXyuHcVGoddVuRJmTnAWyj+
         ZrDw==
X-Forwarded-Encrypted: i=1; AJvYcCUWXdY8p0dj05y0SnT0a0Jw6ETX2JFaLZiDcnp555e0x05WQp1oYmPrWE0Pf466xyoUOXzeZIBetv+eeym1BQtMIjoXrheS9DGJTevMG2s=
X-Gm-Message-State: AOJu0Ywc/pSAlftL9N4OHSlB75MTMZtlOXkmUi2xDqrMcobiyNsrbDlY
	btPWvXKPVhEiLCd9FKVxLxaKyY9WWWINcx8GPiMuHA67TJY+nzW5qcaOTtryMA==
X-Google-Smtp-Source: AGHT+IFH/VsQtL/RDrWkpGWAyXGefw4nSD8P7mZ1QN62yx708ZCC1eh4Wj1wuX4EMe6LXkXV1dG2gw==
X-Received: by 2002:a05:6402:d06:b0:5a2:2654:7fd1 with SMTP id 4fb4d7f45d1cf-5bd44c78c9bmr1573150a12.36.1723539252687;
        Tue, 13 Aug 2024 01:54:12 -0700 (PDT)
Message-ID: <e0285026-40c5-4316-8129-d07801a9c233@suse.com>
Date: Tue, 13 Aug 2024 10:54:10 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 4/7] xen/riscv: introduce functionality to work with
 CPU info
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <452e2960d1f064a2e3abcaae1ac354f48aafd24c.1723214540.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <452e2960d1f064a2e3abcaae1ac354f48aafd24c.1723214540.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 09.08.2024 18:19, Oleksii Kurochko wrote:
> Introduce struct pcpu_info to store pCPU-related information.
> Initially, it includes only processor_id, but it will be extended
> to include guest CPU information and temporary variables for
> saving/restoring vCPU registers.
> 
> Add set_processor_id() and get_processor_id() functions to set
> and retrieve the processor_id stored in pcpu_info.
> 
> Introduce cpuid_to_hartid_map[NR_CPUS] to map Xen logical CPUs to
> hart IDs (physical CPU IDs). Add auxiliary macros cpuid_to_hartid()
> for convenient access to this mapping.
> 
> Define smp_processor_id() to provide accurate information,
> replacing the previous "dummy" value of 0.
> 
> Initialize tp registers to point to pcpu_info[0].
> Set processor_id to 0 for logical CPU 0 and store the physical CPU ID
> for the current logical CPU in cpuid_to_hartid_map[].
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
> Changes in V4:
>  - wrap id with () inside set_processor_id().
>  - code style fixes
>  - update BUG_ON(id > NR_CPUS) in smp_processor_id() and drop the comment
>    above BUG_ON().
>  - s/__cpuid_to_hartid_map/cpuid_to_hartid_map
>  - s/cpuid_to_hartid_map/cpuid_to_harti ( here cpuid_to_hartid_map is the name
>    of the macros ).
>  - update the commit message above the code of TP register initialization in
>    start_xen().

I guess that's once again "comment", not "commit message"?

> --- a/xen/arch/riscv/include/asm/processor.h
> +++ b/xen/arch/riscv/include/asm/processor.h
> @@ -12,8 +12,32 @@
>  
>  #ifndef __ASSEMBLY__
>  
> -/* TODO: need to be implemeted */
> -#define smp_processor_id() 0
> +#include <xen/bug.h>
> +
> +register struct pcpu_info *tp asm ("tp");
> +
> +struct pcpu_info {
> +    unsigned int processor_id;
> +};
> +
> +/* tp points to one of these */
> +extern struct pcpu_info pcpu_info[NR_CPUS];
> +
> +#define get_processor_id()      (tp->processor_id)
> +#define set_processor_id(id)    do { \
> +    tp->processor_id = (id);         \
> +} while (0)
> +
> +static inline unsigned int smp_processor_id(void)
> +{
> +    unsigned int id;
> +
> +    id = get_processor_id();
> +
> +    BUG_ON(id > NR_CPUS);

>= ?

> --- a/xen/arch/riscv/include/asm/smp.h
> +++ b/xen/arch/riscv/include/asm/smp.h
> @@ -5,6 +5,8 @@
>  #include <xen/cpumask.h>
>  #include <xen/percpu.h>
>  
> +#define INVALID_HARTID UINT_MAX
> +
>  DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
>  DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
>  
> @@ -14,6 +16,14 @@ DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
>   */
>  #define park_offline_cpus false
>  
> +void smp_set_bootcpu_id(unsigned long boot_cpu_hartid);
> +
> +/*
> + * Mapping between linux logical cpu index and hartid.
> + */
> +extern unsigned long cpuid_to_hartid_map[NR_CPUS];
> +#define cpuid_to_hartid(cpu) cpuid_to_hartid_map[cpu]

How wide can hart IDs be? Wider than 32 bits? If not, why unsigned long?
If so, what about RV32 (which generally you at least try cover where
easily possible)?

Is there a reason this needs to be a separate array, rather than being
part of struct pcpu_info?

> @@ -40,6 +41,19 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
>  {
>      remove_identity_mapping();
>  
> +    /*
> +     * tp register contains an address of physical cpu information.
> +     * So write physical CPU info of boot cpu to tp register
> +     * It will be used later by get_processor_id() ( look at
> +     * <asm/processor.h> ):
> +     *   #define get_processor_id()    (tp->processor_id)
> +     */
> +    asm volatile ( "mv tp, %0" : : "r"((unsigned long)&pcpu_info[0]) );

Perhaps be on the safe side and also add a memory barrier?

Perhaps be on the safe side and do this absolutely first in the function,
or even in assembly (such that initializers of future variables declared
at the top of the function end up safe, too)?

Also nit: Blank please between closing quote and opening parenthesis.
(Otoh you could omit the blank between the two colons.)

> --- /dev/null
> +++ b/xen/arch/riscv/smp.c
> @@ -0,0 +1,4 @@
> +#include <xen/smp.h>
> +
> +/* tp points to one of these per cpu */
> +struct pcpu_info pcpu_info[NR_CPUS];

And they all need setting up statically? Is there a plan to make this
dynamic (which could be recorded in a "fixme" in the comment)?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 09:34:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 09:34:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776083.1186232 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdnv2-0007hD-Mw; Tue, 13 Aug 2024 09:34:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776083.1186232; Tue, 13 Aug 2024 09:34:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdnv2-0007h6-KI; Tue, 13 Aug 2024 09:34:20 +0000
Received: by outflank-mailman (input) for mailman id 776083;
 Tue, 13 Aug 2024 09:34:19 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdnv1-0007h0-5s
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 09:34:19 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 357ff488-5957-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 11:34:16 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a728f74c23dso572575866b.1
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 02:34:16 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f414eb8dsm53028366b.162.2024.08.13.02.34.15
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 02:34:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 357ff488-5957-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723541656; x=1724146456; 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=G8wybzRGFdKpIOBRe95VVLGzFGfNLS3qQPmWIc2HwnU=;
        b=QmNeUglEM+Vq6+ccH23uYdjZK0a8i4cvN69f3WG49jiERizycouNeslEt9S36DGMck
         kJv1moiM9G0/SN+lV/THEY31ZErIJUiHv/lUZF8dcA7XPmr+WikbkPSCQN74ysQaQWV2
         ctBt3rT3t9ZzEsZq9pYuIJ2G/npbn89hSdsxAb9peF1bqPmk3IihGI4S6H//c+VvjCwF
         Q/Lx9ty45v6OGtqSXZygHjrvujsXTbwPsd/pXXv3KLqLVURZ03PII5Fu4gHOeJSMaa5n
         t5uPJd7xLVUPtZPqg9N4HI4wALOsm5JE4sb/2ewroveTEZ+lR1GLBuFHjS+X5hG5Tp1S
         sTuQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723541656; x=1724146456;
        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=G8wybzRGFdKpIOBRe95VVLGzFGfNLS3qQPmWIc2HwnU=;
        b=RXDr5I6dppWCJBz0cgPS1hKBh2+c5r3oYc37a2753KrXISsCE/fMyF9G3NkcHi8N78
         82TA8g6xToLUKtadBDJCJjbA3Cyt6yL8JyqsTfXkbljJyU90DCpxjJ7CaVikfClx5CrB
         OWq4eCJYv1yrkNWKdaGSdpKbckoPgQ3xZ0te6JE3daYDoAWUCRWHREMvvlpTqJjJ1Z/i
         qaYdIYhIv90d/Eltf0oRrgiXg+RjG7vroyK7jU/kUL/GkTTtme1B11mYUGAgnOeJCqY4
         7Ls2eLvkEuxTT41+dn8Zc/Ql6x2wjTYn6qvGt4osKuwX3jqyFFCtnoJLv95AgKi6zCB3
         uHcw==
X-Forwarded-Encrypted: i=1; AJvYcCViiwDa68k6yGteqDsuioh3f7f29YNPvQvuM5ozWA+M6gejxuI7oUNZ6YAVoggbXa5ZMW3szDESwGlY7EvG4x9E7Zy5qVSX+NkFNKc7VDU=
X-Gm-Message-State: AOJu0Yyg6+Nc1LSAiDImZ8o1vkGHnpkFEqTjz0OVQ3FZEdvjbAwNwJnR
	ksaGm8AWalUDEsGbboYEJ03PhqL5x59BygUBmi77KsDyezAYCnHEHzu20oYrmg==
X-Google-Smtp-Source: AGHT+IHfx2G38wPxq7Ln01VTZJE/koAc88/7XoLtJWjyOn5GPOdxJVjj8v1dTj8WlQAaPcJWDqw0OQ==
X-Received: by 2002:a17:906:6a12:b0:a80:bf0f:2256 with SMTP id a640c23a62f3a-a80ed1b4edbmr244313966b.8.1723541655916;
        Tue, 13 Aug 2024 02:34:15 -0700 (PDT)
Message-ID: <77ff59d1-b158-4603-bdbd-67c079ce87c9@suse.com>
Date: Tue, 13 Aug 2024 11:34:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 5/7] xen/riscv: introduce and initialize SBI RFENCE
 extension
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <1a863d06866f86761d23e6da3f4a6ee58c474473.1723214540.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1a863d06866f86761d23e6da3f4a6ee58c474473.1723214540.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 09.08.2024 18:19, Oleksii Kurochko wrote:
> @@ -31,4 +65,34 @@ struct sbiret sbi_ecall(unsigned long ext, unsigned long fid,
>   */
>  void sbi_console_putchar(int ch);
>  
> +/*
> + * Check underlying SBI implementation has RFENCE
> + *
> + * @return 1 for supported AND 0 for not-supported
> + */
> +bool sbi_has_rfence(void);

Nit: With bool return type, true and false in the comment?

> +/*
> + * Instructs the remote harts to execute one or more SFENCE.VMA
> + * instructions, covering the range of virtual addresses between
> + * start_addr and start_addr + size.

It's relatively clear what is meant here, but maybe still better to
make things explicit by using a mathematical range:
[start_addr, start_addr + size).

> + * Returns 0 if IPI was sent to all the targeted harts successfully
> + * or negative value if start_addr or size is not valid.
> + *
> + * @hart_mask a cpu mask containing all the target harts.
> + * @param start virtual address start
> + * @param size virtual address range size
> + */
> +int sbi_remote_sfence_vma(cpumask_t *cpu_mask,

pointer-to-const?

> --- a/xen/arch/riscv/sbi.c
> +++ b/xen/arch/riscv/sbi.c
> @@ -7,11 +7,23 @@
>   * Modified by Bobby Eshleman (bobby.eshleman@gmail.com).
>   *
>   * Copyright (c) 2019 Western Digital Corporation or its affiliates.
> - * Copyright (c) 2021-2023 Vates SAS.
> + * Copyright (c) 2021-2024 Vates SAS.
>   */
>  
> +#include <xen/compiler.h>
> +#include <xen/const.h>
> +#include <xen/cpumask.h>
> +#include <xen/errno.h>
> +#include <xen/init.h>
> +#include <xen/lib.h>
> +#include <xen/smp.h>
> +
> +#include <asm/processor.h>
>  #include <asm/sbi.h>
>  
> +static unsigned long sbi_spec_version = SBI_SPEC_VERSION_DEFAULT;
> +static unsigned long sbi_fw_id, sbi_fw_version;

__ro_after_init for perhaps all three of them?

Considering SBI_SPEC_VERSION_{MAJOR,MINOR}_MASK, at least the first
of them also doesn't need to be unsigned long, but could be unsigned
int?

> @@ -38,7 +50,245 @@ struct sbiret sbi_ecall(unsigned long ext, unsigned long fid,
>      return ret;
>  }
>  
> +static int sbi_err_map_xen_errno(int err)
> +{
> +    switch ( err )
> +    {
> +    case SBI_SUCCESS:
> +        return 0;
> +    case SBI_ERR_DENIED:
> +        return -EACCES;
> +    case SBI_ERR_INVALID_PARAM:
> +        return -EINVAL;
> +    case SBI_ERR_INVALID_ADDRESS:
> +        return -EFAULT;
> +    case SBI_ERR_NOT_SUPPORTED:
> +        return -EOPNOTSUPP;
> +    case SBI_ERR_FAILURE:
> +        fallthrough;
> +    default:
> +        return -ENOSYS;
> +    };
> +}
> +
>  void sbi_console_putchar(int ch)
>  {
>      sbi_ecall(SBI_EXT_0_1_CONSOLE_PUTCHAR, 0, ch, 0, 0, 0, 0, 0);
>  }
> +
> +static unsigned long sbi_major_version(void)
> +{
> +    return (sbi_spec_version >> SBI_SPEC_VERSION_MAJOR_SHIFT) &
> +        SBI_SPEC_VERSION_MAJOR_MASK;
> +}

Can you use MASK_EXTR() here, allowing to even drop the separate
SBI_SPEC_VERSION_MAJOR_SHIFT?

> +static unsigned long sbi_minor_version(void)
> +{
> +    return sbi_spec_version & SBI_SPEC_VERSION_MINOR_MASK;
> +}

For consistency here then, too.

> +static long sbi_ext_base_func(long fid)
> +{
> +    struct sbiret ret;
> +
> +    ret = sbi_ecall(SBI_EXT_BASE, fid, 0, 0, 0, 0, 0, 0);
> +    if ( !ret.error )
> +        return ret.value;
> +    else
> +        return ret.error;

With the folding of two distinct values, how is the caller going to
tell failure from success?

> +}
> +
> +static int __sbi_rfence_v02_real(unsigned long fid,

Are the double leading underscores really necessary here? (Same again
further down.)

> +                                 unsigned long hmask, unsigned long hbase,
> +                                 unsigned long start, unsigned long size,
> +                                 unsigned long arg4)
> +{
> +    struct sbiret ret = {0};
> +    int result = 0;
> +
> +    switch ( fid )
> +    {
> +    case SBI_EXT_RFENCE_REMOTE_FENCE_I:
> +        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
> +                0, 0, 0, 0);
> +        break;
> +    case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA:
> +        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
> +                start, size, 0, 0);
> +        break;
> +    case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID:
> +        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
> +                start, size, arg4, 0);
> +        break;
> +    case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA:
> +        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
> +                start, size, 0, 0);
> +        break;

How is e.g. this different from SBI_EXT_RFENCE_REMOTE_SFENCE_VMA
handling? To ease recognition, I think you want to fold cases with
identical handling.

> +    case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID:
> +        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
> +                start, size, arg4, 0);
> +        break;
> +    case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA:
> +        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
> +                start, size, 0, 0);
> +        break;
> +    case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID:
> +        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
> +                start, size, arg4, 0);
> +        break;
> +
> +    default:

Nit: Just like you have it here, blank lines please between any non-
fallthrough case blocks.

> +        printk("%s: unknown function ID [%lu]\n",
> +               __func__, fid);
> +        result = -EINVAL;
> +        break;
> +    };
> +
> +    if ( ret.error )
> +    {
> +        result = sbi_err_map_xen_errno(ret.error);
> +        printk("%s: hbase=%lu hmask=%#lx failed (error %d)\n",
> +               __func__, hbase, hmask, result);
> +    }
> +
> +    return result;
> +}
> +
> +static int __sbi_rfence_v02(unsigned long fid,

This has its address taken for storing in a function pointer. I'd like
to suggest that from the very beginning you mark such functions cf_check.

> +                            const cpumask_t *cpu_mask,
> +                            unsigned long start, unsigned long size,
> +                            unsigned long arg4, unsigned long arg5)
> +{
> +    unsigned long hartid, cpuid, hmask = 0, hbase = 0, htop = 0;
> +    int result;
> +
> +    /*
> +     * hart_mask_base can be set to -1 to indicate that hart_mask can be
> +     * ignored and all available harts must be considered.
> +     */
> +    if ( !cpu_mask )
> +        return __sbi_rfence_v02_real(fid, 0UL, -1UL, start, size, arg4);
> +
> +    for_each_cpu( cpuid, cpu_mask )

Nit: Either

    for_each_cpu ( cpuid, cpu_mask )

(if you deem for_each_cpu a pseudo-keyword) or

    for_each_cpu(cpuid, cpu_mask)

(if you don't).

> +    {
> +        hartid = cpuid_to_hartid(cpuid);
> +        if ( hmask )
> +        {
> +            if ( hartid + BITS_PER_LONG <= htop ||
> +                 hbase + BITS_PER_LONG <= hartid )
> +            {
> +                result = __sbi_rfence_v02_real(fid, hmask, hbase,
> +                                               start, size, arg4);
> +                if ( result )
> +                    return result;
> +                hmask = 0;
> +            }
> +            else if ( hartid < hbase )
> +            {
> +                /* shift the mask to fit lower hartid */
> +                hmask <<= hbase - hartid;
> +                hbase = hartid;
> +            }
> +        }
> +
> +        if ( !hmask )
> +        {
> +            hbase = hartid;
> +            htop = hartid;
> +        } else if ( hartid > htop )

Nit: Closing brace on its own line please.

> +            htop = hartid;
> +
> +        hmask |= BIT(hartid - hbase, UL);
> +    }

I can see how you will successfully batch for certain configurations
this way. When hart ID mapping is something like (0,64,1,65,2,66,...)
you won't batch at all though. Which may be fine at least for now, but
then I think a comment wants to state what is or is not intended to be
covered. It is only this way that people will know that certain
shortcomings aren't bugs.

> +    if ( hmask )
> +    {
> +        result = __sbi_rfence_v02_real(fid, hmask, hbase,
> +                                       start, size, arg4);
> +        if ( result )
> +            return result;
> +    }
> +
> +    return 0;
> +}
> +
> +static int (*__sbi_rfence)(unsigned long fid,
> +                           const cpumask_t *cpu_mask,
> +                           unsigned long start, unsigned long size,
> +                           unsigned long arg4, unsigned long arg5) = NULL;

__ro_after_init and no need for an initializer.

> +int sbi_remote_sfence_vma(cpumask_t *cpu_mask,
> +                          unsigned long start_addr,
> +                          unsigned long size)
> +{
> +    return __sbi_rfence(SBI_EXT_RFENCE_REMOTE_SFENCE_VMA,
> +                        cpu_mask, start_addr, size, 0, 0);

No check (not even an assertion) here for __sbi_rfence still being NULL?

> +int __init sbi_init(void)
> +{
> +    int ret;
> +
> +    ret = sbi_get_spec_version();
> +    if ( ret > 0 )
> +        sbi_spec_version = ret;

Truncation from long to int is not an issue here?

> +    printk("SBI specification v%lu.%lu detected\n",
> +            sbi_major_version(), sbi_minor_version());
> +
> +    if ( !sbi_spec_is_0_1() )
> +    {
> +        sbi_fw_id = sbi_get_firmware_id();
> +        sbi_fw_version = sbi_get_firmware_version();

These cannot return errors?

> +        printk("SBI implementation ID=%#lx Version=%#lx\n",
> +            sbi_fw_id, sbi_fw_version);
> +
> +        if ( sbi_probe_extension(SBI_EXT_RFENCE) > 0 )
> +        {
> +            __sbi_rfence = __sbi_rfence_v02;
> +            printk("SBI v0.2 RFENCE extension detected\n");
> +        }
> +    } else {

Nit: Style (and I think I said so before).

> +        BUG_ON("Ooops. SBI spec veriosn 0.1 detected. Need to add support");

Besides the typo (version) here and ...

> +    }
> +
> +    if ( !sbi_has_rfence() )
> +    {
> +        BUG_ON("At the moment flush_xen_tlb_range_va() uses SBI rfence to "
> +               "flush TLB for all CPUS!");

... here better panic()? A call trace doesn't really add any value for these.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 09:50:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 09:50:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776092.1186242 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdoAe-0002k5-0d; Tue, 13 Aug 2024 09:50:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776092.1186242; Tue, 13 Aug 2024 09:50:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdoAd-0002jy-UE; Tue, 13 Aug 2024 09:50:27 +0000
Received: by outflank-mailman (input) for mailman id 776092;
 Tue, 13 Aug 2024 09:50:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=nDAI=PM=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sdoAc-0002js-4M
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 09:50:26 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20602.outbound.protection.outlook.com
 [2a01:111:f403:2416::602])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7576c8ec-5959-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 11:50:24 +0200 (CEST)
Received: from LV3P220CA0020.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:234::7)
 by SA1PR12MB7224.namprd12.prod.outlook.com (2603:10b6:806:2bb::20) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Tue, 13 Aug
 2024 09:50:19 +0000
Received: from BN3PEPF0000B06C.namprd21.prod.outlook.com
 (2603:10b6:408:234:cafe::e1) by LV3P220CA0020.outlook.office365.com
 (2603:10b6:408:234::7) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend
 Transport; Tue, 13 Aug 2024 09:50:18 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 BN3PEPF0000B06C.mail.protection.outlook.com (10.167.243.71) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.4 via Frontend Transport; Tue, 13 Aug 2024 09:50:18 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug
 2024 04:50:18 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug
 2024 04:50:18 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Tue, 13 Aug 2024 04:50:16 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7576c8ec-5959-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=RPRpTPuiTvvJAKaye5HBwiSJBirSYR+gAqtkNsS76qEL+tVAwq8lS8wv4qSeri91Qxog0NEPoxM3XnvHL4Ohb7jjl2pJjPIUwUTO1ID6yhNSxhGxU+EzsThyfm/5VdgiXlIUpHuCW1wHNZYhtpX8uY21FryLoqad1O+yuoP3U8z5NdWZBKUH+jgMFtCRbifkxkC1yfNBvxQxH96oGI4PRpSdxxFK69WsY9N0Qk1kXnlTAOq3e4FF2uUntmtkwY7rzw0q6X8W1kLR5pHUYP5TUgwze1ZTcitMsKZ9R+rtA0GeJg4OIdIY7taIkKtWzGgU0t/QnrUNOFxBtSZSTp3aKg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=YJ/LvH3zV8PEFWrbfGmZ8AE8YfMQ1Ai3D24Nvr6WKhM=;
 b=CjrFxTd+sMrV4FHtplolOBKWw2bEQ8QQ8t8pr7vTNo4nkfa4OGgkfLLiqgj/gmMFGwGqskKx9gzQdUNFpho3HEK/KcEhdlkjTcjcrv/FhsVJRzoJTn9TbXrkjCSaFWgBypm+cUl4zHNgaF4tK7vAPvznN15rvN4luxPERoPPvKJ+gaLO4tZiSadUofnvgj5BKSs/LpIo+bKwxZPA8aRc/TR2uDlhURyJ40h/KDYtyx2WhMYKA9XhUBR0lvD8FDIIs4JDXsl+mPxThXYdng/Ap9Esq0XWJ6NNlIEsbeDzwWEaAH/bZcIxRndBmM8LC0qUeRVja8/LnBB9dYBQou2b+w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=YJ/LvH3zV8PEFWrbfGmZ8AE8YfMQ1Ai3D24Nvr6WKhM=;
 b=qugBoLUBNvLj7/kpgiL98l7soPnnsR+Z2VsG1Gjd4NyhhYhCes6azRCenwKKD9jFoqsjmFW59zmxxUC+IzCaoC1mEgPJy38SLjDlSgdMM+MHvr15lR6NHqi/iY+NpKmSzZUarQcWkgFvjZPxSj/zg6aPuQwwb/0jBpNrgkA3VjQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <ed6f6b1b-cab3-4369-901f-80907af8e7c2@amd.com>
Date: Tue, 13 Aug 2024 11:50:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] Arm: correct FIX_LAST
To: Jan Beulich <jbeulich@suse.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
CC: Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>, Oleksii Kurochko
	<oleksii.kurochko@gmail.com>
References: <ad60ded1-5feb-4fd9-8cf8-6dee2e153d11@suse.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <ad60ded1-5feb-4fd9-8cf8-6dee2e153d11@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06C:EE_|SA1PR12MB7224:EE_
X-MS-Office365-Filtering-Correlation-Id: a4f5310a-0945-4647-e773-08dcbb7d5731
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|36860700013|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?emI3TTRKOTIwb3RKQmd2d05BckpLbEV3amlJbEFzQWR2TWpEMmtHaU9VRC9U?=
 =?utf-8?B?MC8yZ0NHWFhvK1ByU3VzdFMrNFBLTUhQNW4vbEppZ3M4VkFXRFloMTZSS250?=
 =?utf-8?B?QVA1dmJsU3FBOHN1SmM1YUhGcyttZlVmcElFVnlGL3daM0RGMVcyaFd1V3Fi?=
 =?utf-8?B?WmgxOWdLd3RlQktXaE4va0JXZTdsRHFEdGV0KzVxMDlyYWpZbFVQQnRIQU1r?=
 =?utf-8?B?Tkw5UW0vU0RaWm5yTmZObnNpV2Q2VkY3eWNxOTR5a0x1bW40Zjl3dnBZOERS?=
 =?utf-8?B?dlIrYTh1emYxeUh0WWh4aGdGRTJtT3dydko4R1BBOE1LVERGYUNwK1BZRVRC?=
 =?utf-8?B?T05KdXNnRXUxRlhOWWIxcmhlYWFMZysweVJrQVNVM0tNUDd2TEtKNkdkK0N2?=
 =?utf-8?B?d2tzTmVhK3BZNzNwREZVaTI1a0FNSHpPRUNZNWdJWXp1eVg1SkJhcjh0aW1Y?=
 =?utf-8?B?YUJkMWE1Z0JsSkhkVGxJbFRXTW1DaW1tN1NKZThMczZ1T2FIcElySE9TNm5D?=
 =?utf-8?B?U285Q0FzMTJmbTZNSjFnUlRWWFdsWTlZMzVxbmVwMFFwaSsxWmk0QVZHVy9Y?=
 =?utf-8?B?K1YrQWp4MkZDOFp6cWxINFVvWUJzbEIyKzBUZUNaeXlWL041YzNuR3dRY0pt?=
 =?utf-8?B?WnFSdllpZ0w0WHp5MjN6QkdyRWRFektjTHlGQkI4MTI3cTJPd29nSzBBSGlx?=
 =?utf-8?B?cWlMZno5RUhKZWhzZFkwL09TN0plRkZuUmxsbUxTZTdwVjV2WkRybkp0VEJt?=
 =?utf-8?B?aVYxSTVNZXhUSjFTYng2RG9DWmFBLy9kU3pCSFpOMTVubXJTSnZIdkJwMUJT?=
 =?utf-8?B?Mk5YSVBoWDZTNmlRbjMzandoOFBCdTk3YXdJZ3VtYXJPMmhLTlJaRU9ZK01a?=
 =?utf-8?B?dEd0eVpWZzArVWY3UWt5Qy9XUFhiYmZkWXV6NFBCNzZwaXRVRGQreDcwWU40?=
 =?utf-8?B?cGRMMzUxSUtGVFVoYmhRMC9kZHgvaHZWcktycVdhZWFncXlXdnBIbTdoQ0I4?=
 =?utf-8?B?enpqNjY3QmhpamxMT1FBNi96VzZKdksvdWo1V2ZJVWthL3RVeWplWUI4NUxi?=
 =?utf-8?B?VlllVkhtbjFnODNCZW1xNVdqRWhKTXhySC9jbzM5bUljTDdaQm1NM1FGbW9w?=
 =?utf-8?B?QmVaUjdrK2tHdzB3dzM2WkN6bkVPNjc4SnRadWo2djI0OVZ3VGQrSVVwek5h?=
 =?utf-8?B?WElRQjJCb1BtV21DNWVvS21pOGpEUnQzUC9JL3VTS0lMTXVLeXZNdFU1YVJL?=
 =?utf-8?B?dmkyOGUxK3FySjlKVVprVmpCM292ZkVkQitaNlc4OVFIL1M0b0ZWcmVCUHgz?=
 =?utf-8?B?ampTNFNBUjYxM2hQSWxJTDEwRDhpbEJpK2RRRS94NzJDOGxDcDhjNE5FMGJD?=
 =?utf-8?B?bExGdjFQSnpwVnAzVXU0WVprb1JLTEp6RTNma1lVZW1zb1lJVXl1QU16MWts?=
 =?utf-8?B?bGlDVjkrR0JGMkdKbVFEQjN6SGFRazFqcnNmdXJpcjg2bTdtL0pGYWNNbVBl?=
 =?utf-8?B?K01KTzNsbFFLOGRVamt4R2grcjB4T2Y1eDVuSGhERjVFZGN1aHYvUzVucTdI?=
 =?utf-8?B?OEVsWFpib2xBQ0xVREFOMTd3Z3A5Z1hEMFQwN01kTFR6K2h3RnByZ1VBT0xj?=
 =?utf-8?B?cS9wbkt2QmxWNnJkT2ZsYUx2UXJKcjB1NCtFMnpEMlFjVzEreHJKUXVvU0dl?=
 =?utf-8?B?TDVHSEw4TUYvNDhXWWd5MCtjZHIwR3BhdlZKSjIxYkhuSkk0MmRJN2dOVTFM?=
 =?utf-8?B?TTZ5dm9IeXVyeVJFbUp3T0ZrQ3FTemZwZXRlR0x0bVNOZ0Z5QWQzcC9ub2h5?=
 =?utf-8?B?aXN1NVRNQlg2YXRYQ2FyZUx1bC8zSUNCbjRqQS85WGlGZGRBOFJOR2ZnNitL?=
 =?utf-8?B?Tm5nenJNK3pvTmc4Lys0ZnBEMEhmdGtMWitkcmlBT1B5SHE3azBkS3lyL01m?=
 =?utf-8?Q?nwjfNRV6rh4UWWN2ej8fZMGsjQqTwipT?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 09:50:18.7337
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: a4f5310a-0945-4647-e773-08dcbb7d5731
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B06C.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7224



On 13/08/2024 10:36, Jan Beulich wrote:
> 
> 
> While reviewing a RISC-V patch cloning the Arm code, I noticed an
> off-by-1 here: FIX_PMAP_{BEGIN,END} being an inclusive range, FIX_LAST
> cannot be the same as FIX_PMAP_END, or else the BUG_ON() in
> virt_to_fix() would trigger if FIX_PMAP_END ended up being used.
> 
> Fixes: 4f17357b52f6 ("xen/arm: add Persistent Map (PMAP) infrastructure")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> Alternatively the definition of FIXADDR_TOP could be changed, if "last"
> should retain its strict meaning. Possibly a guard page also wants
> having at the end of the fixmap range, which could be effected by
> changing both #define-s at the same time.
I understand FIX_LAST as the last slot used, so in this regard it should retain its definition.
That said, I realized that we don't even check that the highest slot is still within the max number
of fixmap slots (today we have 512 slots). IMO we should gain a BUILD_BUG_ON to catch it.

With:
#define FIXADDR_TOP FIXMAP_ADDR(FIX_LAST + 1)
and sth like:
BUILD_BUG_ON(FIXADDR_TOP >= BOOT_FDT_VIRT_START);
possibly in build_assertions() in setup.c, we would:
 - fix off-by-1 issue
 - catch out-of-slot issue
 - gain a guard page

~Michal


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 09:53:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 09:53:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776099.1186252 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdoDc-0003Hs-EJ; Tue, 13 Aug 2024 09:53:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776099.1186252; Tue, 13 Aug 2024 09:53:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdoDc-0003Hl-BT; Tue, 13 Aug 2024 09:53:32 +0000
Received: by outflank-mailman (input) for mailman id 776099;
 Tue, 13 Aug 2024 09:53: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=tqRM=PM=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sdoDb-0003Hf-Ld
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 09:53:31 +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 e54339bc-5959-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 11:53:30 +0200 (CEST)
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-a7d26c2297eso604151166b.2
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 02:53:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e54339bc-5959-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723542810; x=1724147610; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=SAfJZaiUMefJ2qlSYDOVvyNgZLULawJJLqsegllNfuw=;
        b=eMcbV/0yo5aQ35Y19GFiMc8eLyDf4bjbykIhaI/8VMT3S7hJODPNAsIbkqPj8TmTMh
         RPb21fVY14aUIDs7v/1sv5qunVUtx110oaioUtSLHHnAkEZzOFZt5Dlg71C+O7g0HWpn
         PkH2W+0Ai78rWQVT2UHForrMjO3/uwyFazri8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723542810; x=1724147610;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=SAfJZaiUMefJ2qlSYDOVvyNgZLULawJJLqsegllNfuw=;
        b=o/WUiIBKXA8AFlJ2A/Mje6dtgB87shueLECvMXWkeuPFZnCp31J1XzjXF1YAfxpCAQ
         GnXemlgs9mK9OJXxLt2EQFgf4twfxWvNX1yxRD8VzS801dd3XV1r+NcHlu4/Nh9rWvtw
         R5wKqs8bY/ckndkb3xeoch1iF23GhW0YgecGdZUrjTeCaxdt1Dv7vSaljev8mPtR9M1j
         yLAC+to4RbIqQtjfRaNQBBLiP8gE+9FLLGVk6RS+Hy1Wmitt7gh6Aa71yMmuM7CX5LiQ
         pI5a6/4CuQlDePoP95w84Tq4tXx512LGllEsbc/3oU/UFiyQx1YIKhUInLGJ2PcIH+Zo
         3W6g==
X-Gm-Message-State: AOJu0Yy/sUTCGfZI9OKldHCqE9xaHgYtubnOXHrL1Ru9ogXo1DNE6Jfx
	/g3P/IS3ehUI5XctCiu0sezrgipBcVv4Vqt5HnujZ4651o1ufFXiZ6HOTJed9viG3lL+H4Ikb4/
	4cILOS/yzY97HCgEG6WoKEjBH7KAm44SyXqho1w==
X-Google-Smtp-Source: AGHT+IG6PH6g+jl+oZl842zhhqt0Vt8HkLSKibaZYD/YQlh4APjANkBl1uufn8uasHYkUdEY1hJokrbVS+t95v6IZbU=
X-Received: by 2002:a17:907:e68d:b0:a6f:dc17:500a with SMTP id
 a640c23a62f3a-a80ed1cef94mr212197266b.23.1723542809928; Tue, 13 Aug 2024
 02:53:29 -0700 (PDT)
MIME-Version: 1.0
References: <20240809130418.10431-1-alejandro.vallejo@cloud.com>
In-Reply-To: <20240809130418.10431-1-alejandro.vallejo@cloud.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Tue, 13 Aug 2024 10:53:15 +0100
Message-ID: <CACHz=Zg=CDv=rmsmYCSvQ7GbaXyXCt0vXNDoBChiOXYucE7w4w@mail.gmail.com>
Subject: Re: [RFC PATCH] xen: Remove -Wdeclaration-after-statement
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
	Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Aug 9, 2024 at 2:04=E2=80=AFPM Alejandro Vallejo
<alejandro.vallejo@cloud.com> wrote:
>
> This warning only makes sense when developing using a compiler with C99
> support on a codebase meant to be built with C89 compilers too, and
> that's no longer the case (nor should it be, as it's been 25 years since
> C99 came out already).
>
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> ---
> Yes, I'm opening this can of worms. I'd like to hear others people's
> thoughts on this and whether this is something MISRA has views on. If
> there's an ulterior non-obvious reason besides stylistic preference I
> think it should be documented somewhere, but I haven't seen such an
> explanation.
>
> IMO, the presence of this warning causes several undesirable effects:
>
>   1. Small functions are hampered by the preclusion of check+declare
>      patterns that improve readability via concision. e.g: Consider a
>      silly example like:
>
>      /* with warning */                     /* without warning */
>      void foo(uint8_t *p)                   void foo(uint8_t *p)
>      {                                      {
>          uint8_t  tmp1;                         if ( !p )
>          uint16_t tmp2;                             return;
>          uint32_t tmp3;
>                                                 uint8_t  tmp1 =3D OFFSET1=
 + *p;
>          if ( !p )                              uint16_t tmp2 =3D OFFSET2=
 + *p;
>              return;                            uint32_t tmp3 =3D OFFSET3=
 + *p;
>
>          tmp1 =3D OFFSET1 + *p;                   /* Lots of uses of `tmp=
X` */
>          tmp2 =3D OFFSET2 + *p;               }
>          tmp2 =3D OFFSET2 + *p;
>
>          /* Lots of uses of tmpX */
>      }
>
>   2. Promotes scope-creep. On small functions it doesn't matter much,
>      but on bigger ones to prevent declaring halfway through the body
>      needlessly increases variable scope to the full scope in which they
>      are defined rather than the subscope of point-of-declaration to
>      end-of-current-scope. In cases in which they can be trivially
>      defined at that point, it also means they can be trivially misused
>      before they are meant to. i.e: On the example in (1) assume the
>      conditional in "with warning" is actually a large switch statement.
>
>   3. It facilitates a disconnect between time-of-declaration and
>      time-of-use that lead very easily to "use-before-init" bugs.
>      While a modern compiler can alleviate the most egregious cases of
>      this, there's cases it simply cannot cover. A conditional
>      initialization on anything with external linkage combined with a
>      conditional use on something else with external linkage will squash
>      the warning of using an uninitialised variable. Things are worse
>      where the variable in question is preinitialised to something
>      credible (e.g: a pointer to NULL), as then that can be misused
>      between its declaration and its original point of intended use.
>
> So... thoughts? yay or nay?

Hi,
   I personally agree with this change. Even compiler is stating that
this is just C89 compatibility.
Yes, it's question of style and surely having all declaration at the
beginning reduce the options however there are technical reason why
having mixed declarations can help
- you can use "const" to tell compiler (and code editor) that
something should not be changed;
- in many cases reduces commit changes;

> ---
>  xen/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/Makefile b/xen/Makefile
> index 2e1a925c8417..288b7ac8bb2d 100644
> --- a/xen/Makefile
> +++ b/xen/Makefile
> @@ -394,7 +394,7 @@ CFLAGS-$(CONFIG_CC_SPLIT_SECTIONS) +=3D -ffunction-se=
ctions -fdata-sections
>
>  CFLAGS +=3D -nostdinc -fno-builtin -fno-common
>  CFLAGS +=3D -Werror -Wredundant-decls -Wwrite-strings -Wno-pointer-arith
> -CFLAGS +=3D -Wdeclaration-after-statement -Wuninitialized
> +CFLAGS +=3D -Wuninitialized
>  $(call cc-option-add,CFLAGS,CC,-Wvla)
>  $(call cc-option-add,CFLAGS,CC,-Wflex-array-member-not-at-end)
>  $(call cc-option-add,CFLAGS,CC,-Winit-self)

Frediano


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 09:59:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 09:59:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776110.1186263 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdoJE-0004Z9-64; Tue, 13 Aug 2024 09:59:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776110.1186263; Tue, 13 Aug 2024 09:59:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdoJE-0004Z2-1a; Tue, 13 Aug 2024 09:59:20 +0000
Received: by outflank-mailman (input) for mailman id 776110;
 Tue, 13 Aug 2024 09:59:18 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdoJC-0004Ys-DG; Tue, 13 Aug 2024 09:59:18 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdoJC-0002ux-9t; Tue, 13 Aug 2024 09:59:18 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdoJB-0001bb-P4; Tue, 13 Aug 2024 09:59:17 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sdoJB-0004wG-OG; Tue, 13 Aug 2024 09:59:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=1ya/3EDFosqpFLtjZ/4gp3xrVMPlqJabJuuE2HtDKWY=; b=LylsVET6vw4P7PmqxEm8Gintid
	XxdFOXPVZffGL+EhDIqc3PPayHnMCvu1z1SuyGZeiwq/5RvfQQCkCELZkXmhBubUuzckjOnYAptas
	9Mj2n7pCBoqslpJK+rxgdZoLCSjRIxtM7f+Y+zYQfORqbMuvQVtZQXO7arjGcnpdwjIo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187220-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187220: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=d61248b0fa2cdfc0be1d806c43d1b211a72b5d49
X-Osstest-Versions-That:
    xen=d61248b0fa2cdfc0be1d806c43d1b211a72b5d49
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 13 Aug 2024 09:59:17 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 xen                  d61248b0fa2cdfc0be1d806c43d1b211a72b5d49
baseline version:
 xen                  d61248b0fa2cdfc0be1d806c43d1b211a72b5d49

Last test of basis   187220  2024-08-13 01:54:17 Z    0 days
Testing same since                          (not found)         0 attempts

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


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

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

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

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


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 10:31:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 10:31:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776125.1186271 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdooV-0002DN-In; Tue, 13 Aug 2024 10:31:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776125.1186271; Tue, 13 Aug 2024 10:31:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdooV-0002DG-Fn; Tue, 13 Aug 2024 10:31:39 +0000
Received: by outflank-mailman (input) for mailman id 776125;
 Tue, 13 Aug 2024 10:31:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdooU-0002DA-AO
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 10:31:38 +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 37f9ecba-595f-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 12:31:37 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5b8c2a611adso6252520a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 03:31:37 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd1a60181csm2807547a12.81.2024.08.13.03.31.35
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 03:31:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 37f9ecba-595f-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723545096; x=1724149896; 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=PV28B8RaXKQCe4JeltUcrGnKhAKd3yyYoz/77j1uA/Y=;
        b=W9vxD1sgIyxIDoRfPgTL32rcS3mBzIz37fUN9tVUzijuPvZm9AlsZmJukoWlgE9iwX
         URv720kqbRfNzctxLIyef/kUR3bVhV7q6lkM420326Lwc9jan1QLkHYxuI6inEaJXixx
         DgJ0jrhBLrTxOvviyu5APiUb6KTJitzy6gvs0L5KIea1Bz5tzMnmnfHLgNqzPwb8byfI
         jqO0VnPN8EVqkmQD5Xl71db8C3G04LApvBh9RkuO8V2zOEarN89bY8uA8ksGzBdztdJ2
         EiWw9LrPVgNIsyVMF+M/ceGw/iVNZHEXdUDY9KxMgMvhEj3Gp5MMOkQqN83qYojWoxZY
         O8HA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723545096; x=1724149896;
        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=PV28B8RaXKQCe4JeltUcrGnKhAKd3yyYoz/77j1uA/Y=;
        b=BDDMgX8M9BN1OUIxKsCMPmo88ORXm8Z/STuUCBTKZuvN/CHOGEDyKJSg2Nlh9C5k74
         27X29LKhChH0YHSzc0mKcte7kZj7idcUm9K6mVwEFKWeQychwANenhpqKzbYOrpXQhj4
         GuoqdxP3wjmElBweZeHEoB1oC5u1Row8BTOwUEHNuayomr3Upgba55eP73P3b4bzecbU
         ybp0vUKzwS7FWKduzLuAJxBqbd9vzG1YN9JEGxD5rWQjDk6MZ+4YskzFI+1rgcRhewYW
         ZpWYitrpntn11ocskZgJfWflVrqgqlpHkGJ+INukZatNj7dFG0/iTfbyvaXu0Zzi1LR6
         BZUw==
X-Forwarded-Encrypted: i=1; AJvYcCUqTYEAhMUcdbRrnfpM7zPL+0LRvR7fpLHoiJv/Te0oRW0jnHmk+OVQrCrIl6ZRvQAZvfJvXwuFfGgHcbWBXwb9o/HvdDAcv7RkWfgc4po=
X-Gm-Message-State: AOJu0Yzlrp82MzSaNGKcAjDvf+NovZp3xyMTSUOucYt5yJ0u9y/jYxpG
	ASblBQx/xTPjoXNOyZF7ncX8Go9SxkqxMEqRRem0uTUsZBFMNGqqXW7/vy49/Na9WQNWAULGfEc
	=
X-Google-Smtp-Source: AGHT+IEdIzy0nvCNlVo7jp8tApjDwmdHf6Uz3JX0iXPVP3yrii+FkZy5KhqFw8Q2W/44Hx1KZBk6QA==
X-Received: by 2002:a05:6402:1d49:b0:5b8:34a9:7fd8 with SMTP id 4fb4d7f45d1cf-5bd44c66d27mr2086198a12.29.1723545096089;
        Tue, 13 Aug 2024 03:31:36 -0700 (PDT)
Message-ID: <85a4e760-07af-42bd-ac27-12a4fa5172cc@suse.com>
Date: Tue, 13 Aug 2024 12:31:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 6/7] xen/riscv: page table handling
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <8362795280a48702bef6f01d41d148edcf299935.1723214540.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <8362795280a48702bef6f01d41d148edcf299935.1723214540.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 09.08.2024 18:19, Oleksii Kurochko wrote:
> Implement map_pages_to_xen() which requires several
> functions to manage page tables and entries:
> - pt_update()
> - pt_mapping_level()
> - pt_update_entry()
> - pt_next_level()
> - pt_check_entry()
> 
> To support these operations, add functions for creating,
> mapping, and unmapping Xen tables:
> - create_xen_table()
> - xen_map_table()
> - xen_unmap_table()

I think I commented on this before: Everything is "Xen" in hypervisor
code. What I think you mean is to map/unmap Xen's own page tables.
Naming-wise that would be {,un}map_xen_table(), though. Since they
are static, just {,un}map_table() ought to be unambiguous, too.

> Introduce internal macros starting with PTE_* for convenience.
> These macros closely resemble PTE bits, with the exception of
> PTE_BLOCK, which indicates that a page larger than 4KB is
> needed.

I did comment on this too, iirc: Is there going to be any case where
large pages are going to be "needed", i.e. not just preferred? If not,
giving the caller control over things the other way around (requesting
4k mappings are needed, as we have it in x86) may be preferable.

Hmm, but then ...

> RISC-V detects superpages using `pte.x` and `pte.r`, as there
> is no specific bit in the PTE for this purpose. From the RISC-V spec:
> ```
>   ...
>   4. Otherwise, the PTE is valid. If pte.r = 1 or pte.x = 1, go to step 5.
>      Otherwise, this PTE is a pointer to the next level of the page table.
>      ... .
>   5. A leaf PTE has been found.
>      ...
>   ...
> ```
> 
> The code doesn’t support super page shattering so 4KB pages are used as
> default.

... you have this. Yet still callers expecting re-mapping in the (large)
range they map can request small-page mappings right away.

> --- a/xen/arch/riscv/include/asm/flushtlb.h
> +++ b/xen/arch/riscv/include/asm/flushtlb.h
> @@ -5,12 +5,25 @@
>  #include <xen/bug.h>
>  #include <xen/cpumask.h>
>  
> +#include <asm/sbi.h>
> +
>  /* Flush TLB of local processor for address va. */
>  static inline void flush_tlb_one_local(vaddr_t va)
>  {
>      asm volatile ( "sfence.vma %0" :: "r" (va) : "memory" );
>  }
>  
> +/*
> + * Flush a range of VA's hypervisor mappings from the TLB of all
> + * processors in the inner-shareable domain.
> + */
> +static inline void flush_tlb_range_va(vaddr_t va,
> +                                      size_t size)

No need for line wrapping here?

> @@ -33,15 +38,72 @@
>  #define PTE_LEAF_DEFAULT            (PTE_VALID | PTE_READABLE | PTE_WRITABLE)
>  #define PTE_TABLE                   (PTE_VALID)
>  
> +#define PAGE_HYPERVISOR_RO          (PTE_VALID | PTE_READABLE)
>  #define PAGE_HYPERVISOR_RW          (PTE_VALID | PTE_READABLE | PTE_WRITABLE)
> +#define PAGE_HYPERVISOR_RX          (PTE_VALID | PTE_READABLE | PTE_EXECUTABLE)
>  
>  #define PAGE_HYPERVISOR             PAGE_HYPERVISOR_RW
>  
> +
> +/*

Nit: As before, no double blank lines please.

> + * There are no such bits in PTE format for RISC-V.

This is an odd way to start a comment: There's nothing for "such" to refer
to.

> + * The code doesn’t support super page shattering so at the moment superpages
> + * can't be used as a default so PTE_BLOCK is introduced to have ability to
> + * tell that superpage should be allocated.
> + * Additionaly as mentioed in RISC-V priviliged spec:
> + * ```
> + *  After much deliberation, we have settled on a conventional page size of
> + *  4 KiB for both RV32 and RV64. We expect this decision to ease the porting
> + *  of low-level runtime software and device drivers.
> + *
> + *  The TLB reach problem is ameliorated by transparent superpage support in
> + *  modern operating systems [2]. Additionally, multi-level TLB hierarchies
> + *  are quite inexpensive relative to the multi-level cache hierarchies whose
> + *  address space they map.
> + *
> + *  [2] Juan Navarro, Sitaram Iyer, Peter Druschel, and Alan Cox. Practical,
> + *      transparent operating system support for superpages.
> + *      SIGOPS Oper. Syst. Rev., 36(SI):89–104, December 2002.
> + * ```
> + *
> + * PTE_POPULATE is introduced to have ability to tell that page tables
> + * shoud be populated.
> + */
> +#define PTE_BLOCK       BIT(10, UL)
> +#define PTE_POPULATE    BIT(11, UL)
> +
> +#define PTE_R_MASK(x)   ((x) & PTE_READABLE)
> +#define PTE_W_MASK(x)   ((x) & PTE_WRITABLE)
> +#define PTE_X_MASK(x)   ((x) & PTE_EXECUTABLE)
> +
> +#define PTE_RWX_MASK(x) ((x) & (PTE_READABLE | PTE_WRITABLE | PTE_EXECUTABLE))
> +
>  /* Calculate the offsets into the pagetables for a given VA */
>  #define pt_linear_offset(lvl, va)   ((va) >> XEN_PT_LEVEL_SHIFT(lvl))
>  
>  #define pt_index(lvl, va) (pt_linear_offset((lvl), (va)) & VPN_MASK)
>  
> +#define TABLE_OFFSET(offs) (_AT(unsigned int, offs) & ((_AC(1, U) << PAGETABLE_ORDER) - 1))

Not: Too long line.

> +#if RV_STAGE1_MODE > SATP_MODE_SV48

SV48? Isn't ...

> +#error "need to to update DECLARE_OFFSETS macros"
> +#else
> +
> +#define l0_table_offset(va) TABLE_OFFSET(pt_linear_offset(0, va))
> +#define l1_table_offset(va) TABLE_OFFSET(pt_linear_offset(1, va))
> +#define l2_table_offset(va) TABLE_OFFSET(pt_linear_offset(2, va))
> +
> +/* Generate an array @var containing the offset for each level from @addr */
> +#define DECLARE_OFFSETS(var, addr)          \
> +    const unsigned int var[] = {            \
> +        l0_table_offset(addr),              \
> +        l1_table_offset(addr),              \
> +        l2_table_offset(addr),              \
> +    }

... this for SV39?

> @@ -67,6 +129,20 @@ static inline bool pte_is_valid(pte_t p)
>      return p.pte & PTE_VALID;
>  }
>  
> +inline bool pte_is_table(const pte_t p)
> +{
> +    return ((p.pte & (PTE_VALID |
> +                      PTE_READABLE |
> +                      PTE_WRITABLE |
> +                      PTE_EXECUTABLE)) == PTE_VALID);
> +}
> +
> +static inline bool pte_is_mapping(const pte_t p)
> +{
> +    return (p.pte & PTE_VALID) &&
> +           ((p.pte & PTE_WRITABLE) || (p.pte & PTE_EXECUTABLE));

Shorter as (p.pte & (PTE_WRITABLE | PTE_EXECUTABLE)) ?

> --- /dev/null
> +++ b/xen/arch/riscv/pt.c
> @@ -0,0 +1,408 @@
> +#include <xen/bug.h>
> +#include <xen/domain_page.h>
> +#include <xen/errno.h>
> +#include <xen/mm.h>
> +#include <xen/mm-frame.h>
> +#include <xen/pmap.h>
> +#include <xen/spinlock.h>
> +
> +#include <asm/flushtlb.h>
> +#include <asm/page.h>
> +
> +static inline const mfn_t get_root_page(void)
> +{
> +    unsigned long root_maddr =

maddr_t or paddr_t?

> +        (csr_read(CSR_SATP) & SATP_PPN_MASK) << PAGE_SHIFT;
> +
> +    return maddr_to_mfn(root_maddr);
> +}
> +
> +/*
> + * Sanity check of the entry
> + * mfn is not valid and we are not populating page table. This means

How does this fit with ...

> + * we either modify entry or remove an entry.
> + */
> +static bool pt_check_entry(pte_t entry, mfn_t mfn, unsigned int flags)
> +{
> +    /* Sanity check when modifying an entry. */
> +    if ( (flags & PTE_VALID) && mfn_eq(mfn, INVALID_MFN) )

... the MFN check here? And why is (valid,INVALID_MFN) an indication
of a modification? But then ...

> +    {
> +        /* We don't allow modifying an invalid entry. */
> +        if ( !pte_is_valid(entry) )
> +        {
> +            printk("Modifying invalid entry is not allowed.\n");
> +            return false;
> +        }

... I also don't understand what this is about. IOW I'm afraid I'm
still confused about the purpose of this function as well as the
transitions you want to permit / reject. I wonder whether the
flags & PTE_VALID and pte_is_valid(entry) aren't in need of swapping.

> +/* Update an entry at the level @target. */
> +static int pt_update_entry(mfn_t root, unsigned long virt,
> +                           mfn_t mfn, unsigned int target,
> +                           unsigned int flags)
> +{
> +    int rc;
> +    unsigned int level = HYP_PT_ROOT_LEVEL;
> +    pte_t *table;
> +    /*
> +     * The intermediate page tables are read-only when the MFN is not valid
> +     * and we are not populating page table.

The way flags are handled in PTEs, how can page tables be read-only?

> +     * This means we either modify permissions or remove an entry.

>From all I can determine we also get here when making brand new entries.
What am I overlooking?

> +     */
> +    bool alloc_only = mfn_eq(mfn, INVALID_MFN) && !(flags & PTE_POPULATE);
> +    pte_t pte, *entry;
> +
> +    /* convenience aliases */
> +    DECLARE_OFFSETS(offsets, virt);
> +
> +    table = xen_map_table(root);
> +    for ( ; level > target; level-- )
> +    {
> +        rc = pt_next_level(alloc_only, &table, offsets[level]);
> +        if ( rc == XEN_TABLE_MAP_FAILED )
> +        {
> +            rc = 0;
> +
> +            /*
> +             * We are here because pt_next_level has failed to map
> +             * the intermediate page table (e.g the table does not exist
> +             * and the pt is read-only). It is a valid case when
> +             * removing a mapping as it may not exist in the page table.
> +             * In this case, just ignore it.
> +             */
> +            if ( flags & PTE_VALID )
> +            {
> +                printk("%s: Unable to map level %u\n", __func__, level);
> +                rc = -ENOENT;
> +            }
> +
> +            goto out;
> +        }
> +        else if ( rc != XEN_TABLE_NORMAL )
> +            break;
> +    }
> +
> +    if ( level != target )
> +    {
> +        printk("%s: Shattering superpage is not supported\n", __func__);
> +        rc = -EOPNOTSUPP;
> +        goto out;
> +    }
> +
> +    entry = table + offsets[level];
> +
> +    rc = -EINVAL;
> +    if ( !pt_check_entry(*entry, mfn, flags) )
> +        goto out;
> +
> +    /* We are removing the page */
> +    if ( !(flags & PTE_VALID) )
> +        memset(&pte, 0x00, sizeof(pte));
> +    else
> +    {
> +        /* We are inserting a mapping => Create new pte. */
> +        if ( !mfn_eq(mfn, INVALID_MFN) )
> +            pte = pte_from_mfn(mfn, PTE_VALID);
> +        else /* We are updating the permission => Copy the current pte. */
> +            pte = *entry;
> +
> +        /* update permission according to the flags */
> +        pte.pte |= PTE_RWX_MASK(flags) | PTE_ACCESSED | PTE_DIRTY;
> +    }
> +
> +    write_pte(entry, pte);
> +
> +    rc = 0;
> +
> + out:
> +    xen_unmap_table(table);
> +
> +    return rc;
> +}
> +
> +static DEFINE_SPINLOCK(xen_pt_lock);

If you put this in the middle of the file (which is fine), I think it
wants putting immediately ahead of the (first) function using it, not
at some seemingly random place.

> +/*
> + * If `mfn` equals `INVALID_MFN`, it indicates that the following page table
> + * update operation might be related to either populating the table,
> + * destroying a mapping, or modifying an existing mapping.
> + */
> +static int pt_update(unsigned long virt,
> +                     mfn_t mfn,
> +                     unsigned long nr_mfns,
> +                     unsigned int flags)
> +{
> +    int rc = 0;
> +    unsigned long vfn = virt >> PAGE_SHIFT;
> +    unsigned long left = nr_mfns;
> +
> +    const mfn_t root = get_root_page();
> +
> +    /*
> +     * It is bad idea to have mapping both writeable and
> +     * executable.
> +     * When modifying/creating mapping (i.e PTE_VALID is set),
> +     * prevent any update if this happen.
> +     */
> +    if ( (flags & PTE_VALID) && PTE_W_MASK(flags) && PTE_X_MASK(flags) )
> +    {
> +        printk("Mappings should not be both Writeable and Executable.\n");
> +        return -EINVAL;
> +    }
> +
> +    if ( !IS_ALIGNED(virt, PAGE_SIZE) )
> +    {
> +        printk("The virtual address is not aligned to the page-size.\n");
> +        return -EINVAL;
> +    }
> +
> +    spin_lock(&xen_pt_lock);
> +
> +    while ( left )
> +    {
> +        unsigned int order, level;
> +
> +        level = pt_mapping_level(vfn, mfn, left, flags);
> +        order = XEN_PT_LEVEL_ORDER(level);
> +
> +        ASSERT(left >= BIT(order, UL));
> +
> +        rc = pt_update_entry(root, vfn << PAGE_SHIFT, mfn, level,
> +                                    flags);

Indentation.

> +        if ( rc )
> +            break;
> +
> +        vfn += 1U << order;
> +        if ( !mfn_eq(mfn, INVALID_MFN) )
> +            mfn = mfn_add(mfn, 1U << order);
> +
> +        left -= (1U << order);

To be on thje safe side, 1UL everywhere?

> +        if ( rc )
> +            break;

There was such a check already a few lines up from here.

> +    }
> +
> +
> +    /* ensure that PTEs are all updated before flushing */

Again: No double blank lines please.

> +    RISCV_FENCE(rw, rw);
> +
> +    /*
> +     * always flush TLB at the end of the function as non-present entries
> +     * can be put in the TLB
> +     */
> +    flush_tlb_range_va(virt, PAGE_SIZE * nr_mfns);

Coming back to "negative" TLB entries: Assuming RISC-V, just like other
architectures, also permits intermediate page table entries to be cached,
the affected VA range may be much larger than the original request, if
intermediate page tables needed creating.

> +    spin_unlock(&xen_pt_lock);

Does this really need to come after fence and flush?

> +    return rc;
> +}
> +
> +int map_pages_to_xen(unsigned long virt,
> +                     mfn_t mfn,
> +                     unsigned long nr_mfns,
> +                     unsigned int flags)
> +{
> +    /*
> +     * Ensure that we have a valid MFN before proceeding.
> +     *
> +     * If the MFN is invalid, pt_update() might misinterpret the operation,
> +     * treating it as either a population, a mapping destruction,
> +     * or a mapping modification.
> +     */
> +    ASSERT(!mfn_eq(mfn, INVALID_MFN));

But flags with PTE_VALID not set are fine to come into here?

> +    return pt_update(virt, mfn, nr_mfns, flags);
> +}

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 11:06:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 11:06:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776140.1186282 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdpLW-0007VV-4E; Tue, 13 Aug 2024 11:05:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776140.1186282; Tue, 13 Aug 2024 11:05:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdpLW-0007VO-0u; Tue, 13 Aug 2024 11:05:46 +0000
Received: by outflank-mailman (input) for mailman id 776140;
 Tue, 13 Aug 2024 11:05:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=k7wN=PM=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sdpLT-0007VI-UK
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 11:05:43 +0000
Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com
 [2a00:1450:4864:20::541])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fa56174b-5963-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 13:05:41 +0200 (CEST)
Received: by mail-ed1-x541.google.com with SMTP id
 4fb4d7f45d1cf-5afa207b8bfso5604854a12.0
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 04:05:40 -0700 (PDT)
Received: from ?IPV6:2003:e5:8741:4a00:60e5:7bee:fc48:e85c?
 (p200300e587414a0060e57beefc48e85c.dip0.t-ipconnect.de.
 [2003:e5:8741:4a00:60e5:7bee:fc48:e85c])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd190acec1sm2876417a12.31.2024.08.13.04.05.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 04:05:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fa56174b-5963-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723547140; x=1724151940; 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=5cBuzogpd8gMkbixAeAjusMFpgm6dK1chnhfZEM0Y4U=;
        b=CbgJ1vFc35rEgkCIIWsuA0F3cKn6cTiiYuitYf3SMfSWYRYMtMfrMsQrYciI9fBo19
         Dtx8nvMfJhCWhWB8PghrZtVim88VCEDTcf+VVG+01083J4ZbRRc4YVxFX2AieMPUvkHc
         r//JC0hje4pZSY+GcNRPzd1SHE3nt7B2KAeJnHUeAHGM6gXwKKGTSLXhnGQ88QkKU7yY
         L5Z5O4bBzBW7cxlK6XIrnhjxRmk9ragOwQcHUBiQnB+u3WdNkjjfX1RW5V+fdch/fhOK
         TZ94uyDrOQomTQd6brvTq6Ittv3v0yP32EbBB3DayiBqChCnDvmv6425/aMS04x2Mz46
         2uWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723547140; x=1724151940;
        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=5cBuzogpd8gMkbixAeAjusMFpgm6dK1chnhfZEM0Y4U=;
        b=FI93ric4kseBeaD0pu14rJhxynIsG4j73yaS0QZUXV1sZRkxNSFbgBZEM4xxBUA+iu
         GG5wLY7mLYMQliqzr2BT+u5ePt2hbFXU4GPRGHTGpdMRriFX7XAX/M/ma+i7beX7mNsB
         ajwXPabdgLp0I9540X+Ikef9qSYm5G4ObhD5zMRutGJgHhr4342YGlmhY8s1AzFbrRj5
         rjQmi/iXlHrmX+bfBp99PftRvle63H2S3Xm7I5pUsXhaBRzKuUsYUk3VSAMfYFKW40Dh
         /IIaGsTIEVNNomGWKWHZgFNkFIPV0IHa57N1Ku3mcHUxUx0TmaHnQbKj/qkqtnUi33VV
         XxDw==
X-Forwarded-Encrypted: i=1; AJvYcCV++S7mL2D9dWqJH2nJdADwHmytxbkqLFt1b3o19ogxnPA0deQvIxlcVBcNoKy7XHHj0DoR2NEv+UtBZG/GVZXshEUw1XUsmGnzNvCp+Po=
X-Gm-Message-State: AOJu0Yz+wIArD37oWtgU+UzOHT+VG+9OKugABJpKpP4CFdqU0OIV5wIt
	iU/rWkLTXeasjaAWEFmrfXkdNtqH+xW7NkWirlw0YxPY2fesW/ormDxHAWl06hQ=
X-Google-Smtp-Source: AGHT+IFiZTH9j5mdKPKn39rAs6+/KYQhEGjUFUmWzvbDURkbTzeVB5FHM6jC9YjWe34y5y9qua4MsQ==
X-Received: by 2002:a05:6402:510c:b0:5bb:9ae0:4a3e with SMTP id 4fb4d7f45d1cf-5bd44c65ae6mr1844917a12.29.1723547140178;
        Tue, 13 Aug 2024 04:05:40 -0700 (PDT)
Message-ID: <9e17891e-2c5b-4fcf-b02e-45ccf24c0524@suse.com>
Date: Tue, 13 Aug 2024 13:05:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [REGRESSION] kernel NULL pointer dereference in xen-balloon with
 mem hotplug
To: =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 regressions@lists.linux.dev
References: <ZrSecpuTN9zgtqYu@mail-itl>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <ZrSecpuTN9zgtqYu@mail-itl>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 08.08.24 12:31, Marek Marczykowski-Górecki wrote:
> Hi,
> 
> When testing Linux 6.11-rc2, I've got the crash like below. It's a PVH
> guest started with 400MB memory, and then extended via mem hotplug (I
> don't know to what exact size it was at this time, but up to 4GB), it
> was quite early in the domU boot process, I suspect it could be the
> first mem hotplug even happening there.
> Unfortunately I don't have reliable reproducer, it crashed only once
> over several test runs. I don't remember seeing such crash before, so it
> looks like a regression in 6.11. I'm not sure if that matters, but it's
> on ADL, very similar to the qubes-hw2 gitlab runner.
> 
> The crash message:
> 
>      [    3.606538] BUG: kernel NULL pointer dereference, address: 0000000000000000
>      [    3.606556] #PF: supervisor read access in kernel mode
>      [    3.606568] #PF: error_code(0x0000) - not-present page
>      [    3.606580] PGD 0 P4D 0
>      [    3.606590] Oops: Oops: 0000 [#1] PREEMPT SMP NOPTI
>      [    3.606603] CPU: 1 UID: 0 PID: 45 Comm: xen-balloon Not tainted 6.11.0-0.rc2.1.qubes.1.fc37.x86_64 #1
>      [    3.606623] RIP: 0010:phys_pmd_init+0x96/0x500
>      [    3.606636] Code: 89 ed 48 c1 e8 12 48 81 e7 00 00 e0 ff 25 f8 0f 00 00 4c 8d af 00 00 20 00 4c 8d 24 03 48 8b 1c 24 4c 39 fd 0f 83 89 02 00 00 <49> 8b 0c 24 48 f7 c1 9f ff ff ff 0f 84 b6 01 00 00 48 8b 05 d2 99
>      [    3.606680] RSP: 0018:ffffc90000987b90 EFLAGS: 00010287
>      [    3.606695] RAX: 0000000000000000 RBX: 8000000000000163 RCX: 0000000000000004
>      [    3.606713] RDX: 0000000090000000 RSI: 0000000080000000 RDI: 0000000080000000
>      [    3.606729] RBP: 0000000080000000 R08: 8000000000000163 R09: 0000000000000001
>      [    3.606748] R10: 0000000000000000 R11: 0000000000ffff0a R12: 0000000000000000
>      [    3.606766] R13: 0000000080200000 R14: 0000000000000000 R15: 0000000090000000
>      [    3.606784] FS:  0000000000000000(0000) GS:ffff888018500000(0000) knlGS:0000000000000000
>      [    3.606802] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>      [    3.606819] CR2: 0000000000000000 CR3: 00000000107bc000 CR4: 0000000000750ef0
>      [    3.606840] PKRU: 55555554
>      [    3.606847] Call Trace:
>      [    3.606854]  <TASK>
>      [    3.606862]  ? __die+0x23/0x70
>      [    3.606876]  ? page_fault_oops+0x95/0x190
>      [    3.606887]  ? exc_page_fault+0x76/0x190
>      [    3.606900]  ? asm_exc_page_fault+0x26/0x30
>      [    3.606917]  ? phys_pmd_init+0x96/0x500
>      [    3.606927]  phys_pud_init+0xe8/0x4f0
>      [    3.606940]  __kernel_physical_mapping_init+0x1d5/0x380
>      [    3.606955]  ? synchronize_rcu_normal.part.0+0x45/0x70
>      [    3.606971]  init_memory_mapping+0xb0/0x1f0
>      [    3.606983]  arch_add_memory+0x2f/0x50
>      [    3.606997]  add_memory_resource+0xff/0x2c0
>      [    3.607008]  reserve_additional_memory+0x162/0x1d0
>      [    3.607026]  balloon_thread+0xe4/0x490
>      [    3.607041]  ? __pfx_autoremove_wake_function+0x10/0x10
>      [    3.607060]  ? __pfx_balloon_thread+0x10/0x10
>      [    3.607076]  kthread+0xcf/0x100
>      [    3.607090]  ? __pfx_kthread+0x10/0x10
>      [    3.607101]  ret_from_fork+0x31/0x50
>      [    3.607112]  ? __pfx_kthread+0x10/0x10
>      [    3.607123]  ret_from_fork_asm+0x1a/0x30
>      [    3.607135]  </TASK>
>      [    3.607141] Modules linked in: xenfs binfmt_misc nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables nfnetlink intel_rapl_msr intel_rapl_common intel_uncore_frequency_common crct10dif_pclmul crc32_pclmul crc32c_intel polyval_clmulni polyval_generic ghash_clmulni_intel sha512_ssse3 sha256_ssse3 sha1_ssse3 xen_netfront xen_privcmd xen_gntdev xen_gntalloc xen_blkback xen_evtchn loop fuse ip_tables overlay xen_blkfront
>      [    3.607266] CR2: 0000000000000000
>      [    3.607277] ---[ end trace 0000000000000000 ]---
>      [    3.607291] RIP: 0010:phys_pmd_init+0x96/0x500
>      [    3.607307] Code: 89 ed 48 c1 e8 12 48 81 e7 00 00 e0 ff 25 f8 0f 00 00 4c 8d af 00 00 20 00 4c 8d 24 03 48 8b 1c 24 4c 39 fd 0f 83 89 02 00 00 <49> 8b 0c 24 48 f7 c1 9f ff ff ff 0f 84 b6 01 00 00 48 8b 05 d2 99
>      [    3.607356] RSP: 0018:ffffc90000987b90 EFLAGS: 00010287
>      [    3.607371] RAX: 0000000000000000 RBX: 8000000000000163 RCX: 0000000000000004
>      [    3.607389] RDX: 0000000090000000 RSI: 0000000080000000 RDI: 0000000080000000
>      [    3.607406] RBP: 0000000080000000 R08: 8000000000000163 R09: 0000000000000001
>      [    3.607428] R10: 0000000000000000 R11: 0000000000ffff0a R12: 0000000000000000
>      [    3.607449] R13: 0000000080200000 R14: 0000000000000000 R15: 0000000090000000
>      [    3.607469] FS:  0000000000000000(0000) GS:ffff888018500000(0000) knlGS:0000000000000000
>      [    3.607488] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>      [    3.607504] CR2: 0000000000000000 CR3: 00000000107bc000 CR4: 0000000000750ef0
>      [    3.607525] PKRU: 55555554
>      [    3.607533] Kernel panic - not syncing: Fatal exception
>      [    3.607599] Kernel Offset: disabled
> 
> Full domU log:
> https://openqa.qubes-os.org/tests/108883/file/system_tests-qubes.tests.integ.vm_qrexec_gui.TC_20_NonAudio_whonix-workstation-17.test_105.guest-test-inst-vm2.log
> Other logs, including dom0 and Xen messages:
> https://openqa.qubes-os.org/tests/108883#downloads
> 
> Kernel config is build from merging
> https://github.com/QubesOS/qubes-linux-kernel/blob/005ae1ac3819d957379e48fb2cfd33f511a47275/config-base
> with
> https://github.com/QubesOS/qubes-linux-kernel/blob/005ae1ac3819d957379e48fb2cfd33f511a47275/config-qubes
> (options set in the latter takes precedence)
> Especially, it has:
> CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y
> CONFIG_XEN_UNPOPULATED_ALLOC=y
> 
> #regzbot introduced: v6.10..v6.11-rc2
> 

Not sure this is Xen code related. There have been several patches
to mm/memory_hotplug.c in the 6.11 merge window.


Juergen


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 11:16:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 11:16:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776148.1186292 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdpVa-00013h-0V; Tue, 13 Aug 2024 11:16:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776148.1186292; Tue, 13 Aug 2024 11:16:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdpVZ-00013a-Tn; Tue, 13 Aug 2024 11:16:09 +0000
Received: by outflank-mailman (input) for mailman id 776148;
 Tue, 13 Aug 2024 11:16:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=k7wN=PM=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sdpVZ-00013U-F1
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 11:16:09 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 704ee7eb-5965-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 13:16:08 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5bd13ea7604so3763294a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 04:16:08 -0700 (PDT)
Received: from ?IPV6:2003:e5:8741:4a00:60e5:7bee:fc48:e85c?
 (p200300e587414a0060e57beefc48e85c.dip0.t-ipconnect.de.
 [2003:e5:8741:4a00:60e5:7bee:fc48:e85c])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f3f4592esm62124566b.26.2024.08.13.04.16.07
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 04:16:07 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 704ee7eb-5965-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723547768; x=1724152568; 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=EoP0tRVfzxJeZMfFko5q/tlhB7DnyQb+0Eu7OPUZLYk=;
        b=SpuN6U53jGs6DjFHYpN29L7hDXZWFSFyukraIFoJ8LWwL61DjqSGEpT+dh08zNOIXA
         bodxkHmdfYGtx7z9q0zOwfMfFb8Kfu9fgpN4PNCUd6/LCamMNBvFsQLsHhUTnKBVOM6n
         nojEb3krYPxaOXaaEt7NjjCNTNYFa49hmKioqww7x/1jL2W95zPenvjECRK56xEKEfZD
         xn0Xo6gUnS1hg7sxTal00ACeTAJTZQw0GvXxHvV7VPPoDGAI68J+UDZ5vP/DFjuDu866
         bPNyluGvhyqWjvXIFAM4b2V7WoJe27O8eb9wEBH20G7+d+XzljwMeiQXH9o79+EPtgk9
         jJ5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723547768; x=1724152568;
        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=EoP0tRVfzxJeZMfFko5q/tlhB7DnyQb+0Eu7OPUZLYk=;
        b=josBg+w09Cxoz6pOuxxSTj+W3cOy7NYtSH3m3IwKcrU2rDJsIQSSM66EyZ1ZqoiBAH
         cilLtpULlk/y50G88Oxwy6WTTPJR302LuFkhX0tWAB4JuxapZjigeJiMQ5EiAIzMQ8IC
         l42bhTiOju7jT/SG5020Ven9REqCH5ZD7n9b8Ph2Fdmv8+cco+ZQXGzHg+q6BfR1pEe5
         /WxnzYS8ymUo3WlH5Hyqj2UHiD8aWjVhPkyFOV1Bs6cDdybAZSsMGOBvwRIPLCU5t8Wl
         lX5MoXM51R11KNQFrwVV9rWmRg7RIeD9brhBVYATOGVj2fg33LMVVcS8/9lTCMBHxfNf
         6EzQ==
X-Forwarded-Encrypted: i=1; AJvYcCVSfYoIlrBcJwRvuyS+aw+Z3SpZkutNbn4CH1PrFAnAtI767bCcoob3Rxs1CMsABk5dlMhdIr/RqG0VzpZVvexWnBjMKhW9WLYwshz9m4w=
X-Gm-Message-State: AOJu0YxlC6BImrtEoGNJd1GpEPVsuXH2rziOL9YqXAxDnq22Xy2l2vBY
	SlFK3JtGvLrVKWZ+efBSibcpEfPHkRhU0CndvP1B3q/X720pxxOBy2VPTigEDoY=
X-Google-Smtp-Source: AGHT+IFOBdcCjM5lmvme4GWY5MzakbZGHggm4WjCZgZ24kzqM4XwWxPKUvAnJ2PYZctfxZRJ46WQSg==
X-Received: by 2002:a17:907:c0f:b0:a7a:c812:36bb with SMTP id a640c23a62f3a-a80ed1aa7bcmr246643366b.8.1723547767685;
        Tue, 13 Aug 2024 04:16:07 -0700 (PDT)
Message-ID: <ab4ca68e-ec1b-467f-9b89-38f63cc19b7c@suse.com>
Date: Tue, 13 Aug 2024 13:16:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: AMD EPYC virtual network performances
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: Andrei Semenov <andrei.semenov@vates.tech>,
 xen-devel@lists.xenproject.org, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <959bbf84-24da-4da3-a059-dc1aa32b27ef@vates.tech>
 <352bba40-27fc-416b-985f-20e66c0c4b72@suse.com>
 <Zrqykdarr7JHaeOZ@mattapan.m5p.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <Zrqykdarr7JHaeOZ@mattapan.m5p.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 13.08.24 03:10, Elliott Mitchell wrote:
> On Tue, Jul 09, 2024 at 11:37:07AM +0200, Jürgen Groß wrote:
>>
>> In both directories you can see the number of spurious events by looking
>> into the spurious_events file.
>>
>> In the end the question is why so many spurious events are happening. Finding
>> the reason might be hard, though.
> 
> Hopefully my comments on this drew your attention, yet lack of response
> suggests otherwise.  I'm wondering whether this is an APIC misprogramming
> issue, similar to the x2APIC issue which was causing trouble with recent
> AMD processors.
> 
> Trying to go after the Linux software RAID1, my current attempt is
> "iommu=debug iommu=no-intremap".  I'm seeing *lots* of messages from
> spurious events in `xl dmesg`.  So many I have a difficult time believing
> they are related to hardware I/O.

Seeing them in `xl dmesg` means those spurious events are seen by the
hypervisor, not by the Linux kernel.

So IMHO this is not a kernel issue.

> In which case could the performance problem observed by Andrei Semenov
> be due to misprogramming of [x2]APIC triggering spurious events?

I don't see a connection here, as spurious interrupts (as seen by the
hypervisor in your case) and spurious events (as seen by Andrei) are
completely different (hardware vs. software level).


Juergen


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 11:48:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 11:48:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776159.1186302 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdq0b-0006lv-Dw; Tue, 13 Aug 2024 11:48:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776159.1186302; Tue, 13 Aug 2024 11:48:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdq0b-0006lo-Ay; Tue, 13 Aug 2024 11:48:13 +0000
Received: by outflank-mailman (input) for mailman id 776159;
 Tue, 13 Aug 2024 11:48:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdq0a-0006le-5D; Tue, 13 Aug 2024 11:48:12 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdq0a-0004sw-3d; Tue, 13 Aug 2024 11:48:12 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdq0Z-00051Q-G4; Tue, 13 Aug 2024 11:48:11 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sdq0Z-0000wQ-Fb; Tue, 13 Aug 2024 11:48:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=XLnBxHuqMRBrovOuGePvxcrrCLW1kOiW5SmyEVIS9Dw=; b=jd9ZIi8NRiJhVw2bdhS+jhfHx3
	YYmA1TZZOv5GjPZOr8BYn7ODzdbEVJ5H27BbHjbz7CgR6DyylKGN6Oydbp7EiNpfnY6ZxPukUcpZ+
	TPfsErOVRCikIjyA/Ji+ZniLg6IFrLXxkptguL6PrvbJRdRsUxJNaBIBlo4tatqkhZMU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187221-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187221: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=1b797e64218b088467c104122a52e84e2062a351
X-Osstest-Versions-That:
    libvirt=71f14351f9b6ef3294c86df22751a7eaf019b4e2
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 13 Aug 2024 11:48:11 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 libvirt              1b797e64218b088467c104122a52e84e2062a351
baseline version:
 libvirt              71f14351f9b6ef3294c86df22751a7eaf019b4e2

Last test of basis   187204  2024-08-10 04:20:32 Z    3 days
Testing same since   187221  2024-08-13 04:22:42 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Daniel P. Berrangé <berrange@redhat.com>
  Göran Uddeborg <goeran@uddeborg.se>
  Michal Privoznik <mprivozn@redhat.com>
  Weblate <noreply-mt-weblate@weblate.org>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   71f14351f9..1b797e6421  1b797e64218b088467c104122a52e84e2062a351 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 11:49:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 11:49:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776167.1186312 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdq24-0007Jn-Qa; Tue, 13 Aug 2024 11:49:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776167.1186312; Tue, 13 Aug 2024 11:49:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdq24-0007Jg-N6; Tue, 13 Aug 2024 11:49:44 +0000
Received: by outflank-mailman (input) for mailman id 776167;
 Tue, 13 Aug 2024 11:49:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdq23-0007JY-DU
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 11:49:43 +0000
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com
 [2a00:1450:4864:20::529])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2024c93b-596a-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 13:49:41 +0200 (CEST)
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5b8c2a61386so6159637a12.2
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 04:49:41 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f414e3basm63498266b.164.2024.08.13.04.49.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 04:49:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2024c93b-596a-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723549781; x=1724154581; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=+hkf4y+gpixNGnjs6JeKccrNDQA3i4qzSsHd16s5Lpg=;
        b=Uu1qq+Aqh3+IsFEo33s5ZyfmGo769d6/FsgfyjGN7s7lrzLedq4TN6onTX0SQZzxw5
         e+M6WoJamJrFgjhNxpgdqMoCxYyCyNNjB5eQ/EKEIKmJM5Q/JZKQJxoLAlIUOjtLL+gt
         rDpME7q+WE/Mt6VoNwrO/QzfXiINW1ONzfZz0u/TxnUniSEPXHYFdcXnUpEEYtdxIQmw
         XUPn14K3PeKCY5Tau/f1eNZrnFjtnjTz98vKBWgSPtu+WNpGPOVCzU3uqeeqK0kP6qu7
         /jfcWWj6v07R9yCmqf0cvcYcHuP3E2/xR9r0cTEZ1uGE9oOgVFwYNJckVKlLcth7wOJN
         lYzQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723549781; x=1724154581;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=+hkf4y+gpixNGnjs6JeKccrNDQA3i4qzSsHd16s5Lpg=;
        b=lBAeGoD1+/9uTO/WA3unqXcC1D84S2r8q2cMQqtR0bTEECjqNYcDHsBskO9Qvlwks8
         7Om0JtztfhurImAzqXdndRUaP2oti2B4m6CQn6zxL8MJfbWET4vTNq9vr+HSQOyXIOh/
         cYUD4ykA++DFwyr1UCEuXjcTtSqUCvQLGlYHzuz0H+JEb19U4Myp7BJ1grnHRCusn3AY
         Czb3EmlEC8lgm6osbFp5UNOcgnqtnnUYxFL25SwFyySg09Hbo8rFKyufDUWPyfN890Wg
         U/wDGngAvsgjDyAbjE6YbShHt/Nrr7DulbXX8lsT/0qxkkCTiN0yI4nRh1FRNES0pcyI
         m9Cg==
X-Gm-Message-State: AOJu0YzMpj4oDNrBZdYSGIKgX/Qnkv1ijWDbslrhjLZ/ay3LLQ/c0MTu
	iglx0zA4mNJ/DzI5tc3lekfw7uZVc6N79DwLeLeg7zxvdJa7fEztPdVP7HhBYmvE1Cb1UnHEOI8
	=
X-Google-Smtp-Source: AGHT+IFS4/5paSEhcDIDoSpuyx6/P2Ua++MbMsbnTk8oRa+7TrYJwRu8qOms77yo1eS/J7hRjwpGXA==
X-Received: by 2002:a17:907:9801:b0:a7a:ab8a:386 with SMTP id a640c23a62f3a-a80ed2d496bmr222874166b.63.1723549780563;
        Tue, 13 Aug 2024 04:49:40 -0700 (PDT)
Message-ID: <5b097aa2-7ced-4971-bd6e-96618bb6f2df@suse.com>
Date: Tue, 13 Aug 2024 13:49:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2] Arm: correct FIXADDR_TOP
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Julien Grall <julien@xen.org>, Stefano Stabellini
 <sstabellini@kernel.org>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

While reviewing a RISC-V patch cloning the Arm code, I noticed an
off-by-1 here: FIX_PMAP_{BEGIN,END} being an inclusive range and
FIX_LAST being the same as FIX_PMAP_END, FIXADDR_TOP cannot derive from
FIX_LAST alone, or else the BUG_ON() in virt_to_fix() would trigger if
FIX_PMAP_END ended up being used.

While touching this area also add a check for fixmap and boot FDT area
to not only not overlap, but to have at least one (unmapped) page in
between.

Fixes: 4f17357b52f6 ("xen/arm: add Persistent Map (PMAP) infrastructure")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Adjust FIXADDR_TOP instead. Add BUILD_BUG_ON() as suggested by
    Michal.

--- a/xen/arch/arm/include/asm/fixmap.h
+++ b/xen/arch/arm/include/asm/fixmap.h
@@ -18,7 +18,7 @@
 #define FIX_LAST FIX_PMAP_END
 
 #define FIXADDR_START FIXMAP_ADDR(0)
-#define FIXADDR_TOP FIXMAP_ADDR(FIX_LAST)
+#define FIXADDR_TOP FIXMAP_ADDR(FIX_LAST + 1)
 
 #ifndef __ASSEMBLY__
 
--- a/xen/arch/arm/mmu/setup.c
+++ b/xen/arch/arm/mmu/setup.c
@@ -128,6 +128,12 @@ static void __init __maybe_unused build_
 
 #undef CHECK_SAME_SLOT
 #undef CHECK_DIFFERENT_SLOT
+
+    /*
+     * Fixmaps must not overlap with boot FDT mapping area. Make sure there's
+     * at least one guard page in between.
+     */
+    BUILD_BUG_ON(FIXADDR_TOP >= BOOT_FDT_VIRT_START);
 }
 
 lpae_t __init pte_of_xenaddr(vaddr_t va)


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 11:57:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 11:57:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776179.1186322 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdq9k-0000zJ-Mw; Tue, 13 Aug 2024 11:57:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776179.1186322; Tue, 13 Aug 2024 11:57:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdq9k-0000zC-J6; Tue, 13 Aug 2024 11:57:40 +0000
Received: by outflank-mailman (input) for mailman id 776179;
 Tue, 13 Aug 2024 11:57:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=nDAI=PM=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sdq9j-0000z5-0F
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 11:57:39 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on20616.outbound.protection.outlook.com
 [2a01:111:f403:2418::616])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3b9693d2-596b-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 13:57:37 +0200 (CEST)
Received: from DM6PR07CA0129.namprd07.prod.outlook.com (2603:10b6:5:330::23)
 by SA0PR12MB7089.namprd12.prod.outlook.com (2603:10b6:806:2d5::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Tue, 13 Aug
 2024 11:57:29 +0000
Received: from DS3PEPF000099D6.namprd04.prod.outlook.com
 (2603:10b6:5:330:cafe::50) by DM6PR07CA0129.outlook.office365.com
 (2603:10b6:5:330::23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.23 via Frontend
 Transport; Tue, 13 Aug 2024 11:57:29 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 DS3PEPF000099D6.mail.protection.outlook.com (10.167.17.7) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Tue, 13 Aug 2024 11:57:29 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug
 2024 06:57:29 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug
 2024 06:57:28 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Tue, 13 Aug 2024 06:57:27 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3b9693d2-596b-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=jymJ+4Tyy5dIsAMswQlh7hFPvz4hQcWUGFR3sa+uQ69RcL+ucmkrc/zHx53ENjp3gWfUheyElN7reB4lL969870CegQpZiTQCVxh2PJtZc/5+h7Y3L54wCeJ9SGBB2sc6LlaLoLJlT54JDPNJzdK/1f9sbkTY+Y4umu15l+ICl50KpcX2vvso2tzfspyUCkyfAxGr5XFG36jCs+Qo7j7nrVSb7Yj0Pb2oPtXUYRmh7+pPT45DioZK51Jynu8YHGnmQ2IFW9sVdWjmaXtrdasGH0TEZd7XwcOM+SlWhIiwfANpmjGX3O5lasVlfjobe6QpWn/d5t7mmF9gLgCWQuTCQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KmZoc6IWSHgbKkmrw1x+dETeDdHC6oQl8M2amGDWB1g=;
 b=iSkHpUkf6V66HKWQaRexd3sJddc7Nq1Nn1etHPtJv39KuwQEfDE/7CDm57bryKdRlzuh5ake74blBZgLJObzBbrprEB8pbpqaKfgWMMFCWQ/OGL19BMK4ARWT9W9XmiEC30UrFrW4qhRpPGM7W+zyhr4BnDm5cZYIV+AyCRttWYiUSWui53G1S6DRfE7dMPHuFzO+eWBOkCY8jAb7eSLlnLiDaUIhYVLQZcr06q1EIrfFikClqahi1WAw4YLDd1qnkRJMISKoOp4agW+1eefT/C02P6Cy6/f57DVGs8PZQwp1yIF6/OVzqhm/LH6Bfryv218RePxlBojnJzTKXr0Jg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KmZoc6IWSHgbKkmrw1x+dETeDdHC6oQl8M2amGDWB1g=;
 b=33nzKOdbDBaPEiZnSkJJo2V+1yT8rFk1qs2HwlLTK/x5xGF1JoXeT739F9T76xYV/XCdV8RKNP3wkVcHaXLn6TT8/fjGmU8hWR41lbx7v0zVUguDHCPUWpiTiMq8tPyxpHBgmcdeNbGaFnlY9rX9pPnRjv09Xj8JwDDorfTmbvc=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <42b02774-c941-4903-be74-d58bf6b93b81@amd.com>
Date: Tue, 13 Aug 2024 13:57:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] Arm: correct FIXADDR_TOP
To: Jan Beulich <jbeulich@suse.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
CC: Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>, Oleksii Kurochko
	<oleksii.kurochko@gmail.com>
References: <5b097aa2-7ced-4971-bd6e-96618bb6f2df@suse.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <5b097aa2-7ced-4971-bd6e-96618bb6f2df@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS3PEPF000099D6:EE_|SA0PR12MB7089:EE_
X-MS-Office365-Filtering-Correlation-Id: 8615068e-ca2e-4fcf-0f5c-08dcbb8f1ba4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?L1ZhZVlub3VCR29VVFp3WGlISU5WY1ZZL3JaTFdaRnQxZmw5TnJpc3R6Sk9j?=
 =?utf-8?B?QUpYUldNRDJkRE9kWUtvbUdXMnU4R3N3RHhmc1FyazlINjA0cFV5b211VHJX?=
 =?utf-8?B?NWRtakhSUEZmUUVWZHpLNWF4V1pNakxLa0pkMFFTWkRUQjVJNW9XS2pjdWZx?=
 =?utf-8?B?Q0g5Z3NzcUtFT09TRGMra0RraE9QbVBvaTJMMk50SWpzYU5pOGlVQVZvRFBO?=
 =?utf-8?B?cTJSbXhKQ3hoS0pKQWVQWXB1N3Nlem10eWtreWRnQVRtY0VBelNBNkUxZmVp?=
 =?utf-8?B?Zyt0cXZ0dVY3TXd6OUxPSHg0N29NVktmbmFTQVRHcmttaGFYL0xEZi9uYldz?=
 =?utf-8?B?akNCLzJ1bVJpcWkyME5ITmM1T3dYM2pIa0VYVlFRWXg3a01YbmlsL1JHbTBn?=
 =?utf-8?B?K1ZITnlCYmZVR1ZwVWNQVk1peVNlbStVR3hKckUybkY0S2VSaE5sc0JSbi9h?=
 =?utf-8?B?NFpVaHZtb3c3SmppMEhSVmNBeWNUNUFqU0VuSWNyVEJNNTdkODdDaVNHbmEz?=
 =?utf-8?B?ZVhvdE02dGkzeFZmTXBFVlJPc2MwQlppZEV5VitELytxd2pPSmlNSVArYUxB?=
 =?utf-8?B?c3d1WGZlYkhXbk0vQWNucUNvY3Fib2dhQU43ZEZzd0lHL0RVaTRTRWY2T3Ns?=
 =?utf-8?B?eUZ2MTZQRXlzN2luUkFDcWFDZElwTUZkRkpsYWcxSEhwemJLbk1uRk9aVFJR?=
 =?utf-8?B?MnEzWVZYWHJvVWJXVDZZTkpMVUJDam1PN1VOVTFJdTdNTTdFak8rTkdPdHBX?=
 =?utf-8?B?YUdwMFI4VlJ0eGRxbTA0TCtxeko2WjRSOVFXUEFIZTZPMTVFT0ZnNit1S2xy?=
 =?utf-8?B?WTJ2YXJFRlFFTnFBeU9kRkFnVmxtZjN0SmlueDhKZDNxV29nV0lGMUVUMlda?=
 =?utf-8?B?WEJBMGZONDR5d09rRVlZNG8zUGRDR2dlWmNuZTU3Q3lzdnJuZlF3Y1NLeG9m?=
 =?utf-8?B?VzFDUXpaRlRicFIrdTBROFExeW91YkNseFo2UEhUYXcyaU5NYjJ3b0xuWm5l?=
 =?utf-8?B?TDlTa2o0Rk9UdU9tb1lFeFJ4ZWtPVStxNll5V1BFUHFJM253OWRncnJ4M2lF?=
 =?utf-8?B?b21FaVlLbGRlTU5nbGlTU1lYK0J5eG9MRG9UbzBLMjVlYWMxWTViZitPWUlJ?=
 =?utf-8?B?U3JzOGV4UC9TT05JMCtlYWpEMGJTdS9uMi9uTlVFTG9Yc1g3Z05hTVdGekNM?=
 =?utf-8?B?Y1cvMHRGUllGNldFaGx5NnI1YXdkZFg3UWE1TDBsRGlFRHh4TmVNOXdaa3hJ?=
 =?utf-8?B?dmNqeWI0MmFLYzJtUklpUXd4eUl6Z1drUmlJNXhnOGZ4ZUFyV3ZweWI0UDZy?=
 =?utf-8?B?OGx5T3FMazZFYXExMVJ3MUhWK0VDd2ZySG1zb0dxOTZnTStqQjc5UlRwTjBo?=
 =?utf-8?B?UkZCR1k3b2J5cDFmTTgwaDVDa3YxS2Nxa2ZkaFF5MFpJUzUzanFLK3d4NlRL?=
 =?utf-8?B?ZlhIL2hDdE1aeGYydkxTNHUyUUtxYkxXYXE4SlRHQTJEcEtGUFBidDR5NUIr?=
 =?utf-8?B?dkJySUtKSXJCSTlzRklmTFZSUjhEYUpvYlRkQ1JFRkdMTEJSM21CdWZWdUQ4?=
 =?utf-8?B?N2NhbE1RN0NETmErRHdHNUV0V3hhVU1ud2V0YWZpaWdtaGFaMnJDc0hZZEQ1?=
 =?utf-8?B?TXpMUUViekZXNlEva1BXUGZTSnhDRmNqME9KMjFhVVUxL0VRYkxMOTEreWhw?=
 =?utf-8?B?RnNEKzdoWmlyTWsyejBaZjlJNkcyemVpdElaME9pRk1wRS92VEh1SDRuTTJy?=
 =?utf-8?B?SHlJKzR1OFJNU2hQVVoyci81VE5OL01JT0NIV2JodERUbzY2YURQZnhrc3Nw?=
 =?utf-8?B?WTNveFExNnlNRnJDclR6dlF3bXoxWjNoUU5uZHJLaWxyRERXNkFsdlJuQW5M?=
 =?utf-8?B?dVAzb1NsaXp5NmdMWEFndE1UMURXVjVBZ283T0hLbDBPS2lDb3VKdWF5UVRT?=
 =?utf-8?Q?rJh6LOtKFAUqfTueKeErhVLq72swZ/Xv?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 11:57:29.7128
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 8615068e-ca2e-4fcf-0f5c-08dcbb8f1ba4
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS3PEPF000099D6.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB7089



On 13/08/2024 13:49, Jan Beulich wrote:
> 
> 
> While reviewing a RISC-V patch cloning the Arm code, I noticed an
> off-by-1 here: FIX_PMAP_{BEGIN,END} being an inclusive range and
> FIX_LAST being the same as FIX_PMAP_END, FIXADDR_TOP cannot derive from
> FIX_LAST alone, or else the BUG_ON() in virt_to_fix() would trigger if
> FIX_PMAP_END ended up being used.
> 
> While touching this area also add a check for fixmap and boot FDT area
> to not only not overlap, but to have at least one (unmapped) page in
> between.
> 
> Fixes: 4f17357b52f6 ("xen/arm: add Persistent Map (PMAP) infrastructure")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 12:31:51 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 12:31:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776199.1186331 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdqgc-0007Dz-BN; Tue, 13 Aug 2024 12:31:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776199.1186331; Tue, 13 Aug 2024 12:31:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdqgc-0007Ds-8P; Tue, 13 Aug 2024 12:31:38 +0000
Received: by outflank-mailman (input) for mailman id 776199;
 Tue, 13 Aug 2024 12:31:37 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=EOoy=PM=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sdqgb-0007Dm-Oy
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 12:31:37 +0000
Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com
 [2a00:1450:4864:20::12c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id faafe315-596f-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 14:31:35 +0200 (CEST)
Received: by mail-lf1-x12c.google.com with SMTP id
 2adb3069b0e04-52fc4388a64so7474339e87.1
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 05:31:35 -0700 (PDT)
Received: from localhost ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f414e18csm66916366b.177.2024.08.13.05.31.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 05:31:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: faafe315-596f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723552295; x=1724157095; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=aqxFx2xYlPbcAkqwCPuJRovNTvAAd1SNvXbnyzGNs4E=;
        b=aqaeDxii5g658v0NdfoLEhQHRLfH1cF03mY6VqiQkugUmUv2UKzrZdnIWNVtC+sriA
         zv8eAg3RXRzXLuxnBZdHSmkkQezL7wbCqX6bmuGrcf1EnrIolpbdKlgTGchM+3/3UuRE
         GaV+7vG1TYVxCU09/eGOrxC1zBibC+va6/qSs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723552295; x=1724157095;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=aqxFx2xYlPbcAkqwCPuJRovNTvAAd1SNvXbnyzGNs4E=;
        b=V3FstXoDPd6/EgR445uC88SwEYbl3G98AzsSQdUgleEjb/JjjXJw3JuB1EEm6L+/Th
         GBujOS6yOYHRh34LBMOlc7UZKKOgMqNxCuscmTXIrm2Mu+M0SbDoss3aTAAk/1y4MntZ
         gxO/dkH6xXTLEGOv0w/SywMO+5ybjM6WOQX9xoJMvNoN6NNHHET/s3NkT0Y162Bn/814
         2wTezOvTvHLfppMlJ16/sMLdSNt8IbafoEgIDKznIw6aFDFHLIr6mq5i5g7ULMZfX5J7
         Cw2vj99bM6w8m7hq8p/5JlmwMoyABTRbgC30UTelmsbTx4TvV721K9bC6QU+hF55KVDV
         fa/w==
X-Forwarded-Encrypted: i=1; AJvYcCV21tE0SICrxPoY9HlKbxJQiABHbR9aisLDx+SsQfuXqPL+RNne017Tm4o7+c0GKg2fB8Z69ost0I/KFr2XkCzQdYP8x9bvs2l5C/nsBLA=
X-Gm-Message-State: AOJu0YzNVj1Ss5B/T87r8ob+2Tb9YfZYfYVWNihzXmvtdcfo8be9gzd2
	LHpLs9bD2sK4qG85exfIXczmCWJf7oLE8IHYuTcPVh19JMFrhWtU8VCh97xBgOs=
X-Google-Smtp-Source: AGHT+IG4C9b2ZDzPM4rPGQ4ZG+GoLFNp97e4Uq7Nbzug96+phMPF/HvYZKlyKPUt40A2yuz1bqROOw==
X-Received: by 2002:ac2:4c42:0:b0:52f:c13f:23d2 with SMTP id 2adb3069b0e04-5321365c5ffmr2234627e87.25.1723552294502;
        Tue, 13 Aug 2024 05:31:34 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Tue, 13 Aug 2024 13:31:32 +0100
Message-Id: <D3ESAOBEGK86.32U215K3WTTM2@cloud.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
 =?utf-8?q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, "Xen-devel"
 <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2 1/2] x86/fpu: Combine fpu_ctxt and xsave_area in
 arch_vcpu
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Jan Beulich" <jbeulich@suse.com>
X-Mailer: aerc 0.17.0
References: <20240808134150.29927-1-alejandro.vallejo@cloud.com>
 <20240808134150.29927-2-alejandro.vallejo@cloud.com>
 <dea252cf-e853-4eab-a71a-9575f32e9381@suse.com>
In-Reply-To: <dea252cf-e853-4eab-a71a-9575f32e9381@suse.com>

On Mon Aug 12, 2024 at 4:16 PM BST, Jan Beulich wrote:
> On 08.08.2024 15:41, Alejandro Vallejo wrote:
> > --- a/xen/arch/x86/domctl.c
> > +++ b/xen/arch/x86/domctl.c
> > @@ -1344,7 +1344,10 @@ void arch_get_info_guest(struct vcpu *v, vcpu_gu=
est_context_u c)
> >  #define c(fld) (c.nat->fld)
> >  #endif
> > =20
> > -    memcpy(&c.nat->fpu_ctxt, v->arch.fpu_ctxt, sizeof(c.nat->fpu_ctxt)=
);
> > +    memcpy(&c.nat->fpu_ctxt, &v->arch.xsave_area->fpu_sse,
> > +           sizeof(c.nat->fpu_ctxt));
> > +    BUILD_BUG_ON(sizeof(c.nat->fpu_ctxt) !=3D sizeof(fpusse_t));
>
> While it may seem unlikely that it would change going forward, I think
> that such build-time checks should make no implications at all. I.e.
> here the right side ought to be sizeof(v->arch.xsave_area->fpu_sse)
> even if that's longer.

Sounds sensible.

>
> Personally I also think that BUILD_BUG_ON(), just like BUG_ON(), would
> better live ahead of the construct they're for.
>
> Same again in at least one more place.
>
> Jan

Ack, sure.

Cheers,
Alejandro


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 12:40:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 12:40:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776208.1186343 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdqp8-0000pz-74; Tue, 13 Aug 2024 12:40:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776208.1186343; Tue, 13 Aug 2024 12:40:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdqp8-0000ps-1Y; Tue, 13 Aug 2024 12:40:26 +0000
Received: by outflank-mailman (input) for mailman id 776208;
 Tue, 13 Aug 2024 12:40:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=EOoy=PM=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sdqp7-0000pT-8X
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 12:40:25 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 35e2b92a-5971-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 14:40:24 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-5b8c2a6135dso6276787a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 05:40:24 -0700 (PDT)
Received: from localhost ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5be9a0946easm409939a12.55.2024.08.13.05.40.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 05:40:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 35e2b92a-5971-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723552824; x=1724157624; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=wQEBnOfKllVY+kVrofMMNPEdDjB5AuMAdrl5+DwXEus=;
        b=d1OOpDkhmB0++kVnI4Uo9u5ECjgIYNF/7w1jGJpf946Zsbo5PyeW7Oy5pRccYMU3Sm
         AgYfvR3mhp0TCwW89sJs7PWtcIIBqcgWcKKPw9VT45S/UOQRLmBZOyWE8Xl7HnpMOOsK
         9w5Wgo52b6iAbRvic5MgbX1AgzHZ3qeom0UuY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723552824; x=1724157624;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=wQEBnOfKllVY+kVrofMMNPEdDjB5AuMAdrl5+DwXEus=;
        b=rtvqvYy1k54+kr0oJjf8H108vEeS4y7fpOmkGrEkdmPMUMRjwkvzfIcSDlpGHrRTFZ
         YCTZSHyoXEsCR2/1NY5eJiRTEglcjy7diap6dELbyOh/Ze6k4ofLsievjIf4eLwQ626X
         rw+zaQtxkAzwMOCVVlxNQHy4yzPHgyL3k8XxWgWDNMIEfLYyQX7OCbIoTQwBWCwmYe0q
         qI3qWJQm/tTp4SRdC9HsdIEayGU9ahuvkvU+m42LRYn8k+sSOKpjfQrhexfDgFPtMdZD
         g8zGlDhGCRphpwDpUoEIXARrz3vYO9DsX691aaZnC9iPifrLpv4DqB0KZ1bLJsFE+1Dd
         qXOw==
X-Forwarded-Encrypted: i=1; AJvYcCVPDrV17rpo2jHHlkPbGoEqFgFATf9uEF7p7GwXdCULfA2zVDGW/vWJc3+2mm+veRsNJOCOLwF+Tpio891enZtF2N02cQ4iS7ZVqF3KIwU=
X-Gm-Message-State: AOJu0YyBpyd61WVE9ULG3IJMZPBcyyNEV0iNlueF5XOkG/1RxO9RsVAt
	Wm6zvC+ea77eye7n4Gj0WiMTf4/7OXnJb6r7da9ag1EJWd+cMZH9Nz33jNNGlgU=
X-Google-Smtp-Source: AGHT+IHMciy8q1FOxet9Zm1VGxcEGjGy4cxaAipK70SV/z04ihtp/s0sfXxxTg7OkulFDKicVdSbHw==
X-Received: by 2002:a05:6402:35c8:b0:5a2:6e1c:91e9 with SMTP id 4fb4d7f45d1cf-5bd44c14c71mr2626804a12.7.1723552823602;
        Tue, 13 Aug 2024 05:40:23 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Tue, 13 Aug 2024 13:40:21 +0100
Message-Id: <D3ESHFJW8P2L.1YUEIVC4C77KJ@cloud.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
 =?utf-8?q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, "Xen-devel"
 <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2 2/2] x86/fpu: Split fpu_setup_fpu() in two
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Jan Beulich" <jbeulich@suse.com>
X-Mailer: aerc 0.17.0
References: <20240808134150.29927-1-alejandro.vallejo@cloud.com>
 <20240808134150.29927-3-alejandro.vallejo@cloud.com>
 <7f001aa8-ee42-4617-8fc4-e4a45d4228e2@suse.com>
In-Reply-To: <7f001aa8-ee42-4617-8fc4-e4a45d4228e2@suse.com>

On Mon Aug 12, 2024 at 4:23 PM BST, Jan Beulich wrote:
> On 08.08.2024 15:41, Alejandro Vallejo wrote:
> > --- a/xen/arch/x86/hvm/hvm.c
> > +++ b/xen/arch/x86/hvm/hvm.c
> > @@ -1164,10 +1164,25 @@ static int cf_check hvm_load_cpu_ctxt(struct do=
main *d, hvm_domain_context_t *h)
> >      seg.attr =3D ctxt.ldtr_arbytes;
> >      hvm_set_segment_register(v, x86_seg_ldtr, &seg);
> > =20
> > -    /* Cover xsave-absent save file restoration on xsave-capable host.=
 */
> > -    vcpu_setup_fpu(v, xsave_enabled(v) ? NULL : v->arch.xsave_area,
> > -                   ctxt.flags & XEN_X86_FPU_INITIALISED ? ctxt.fpu_reg=
s : NULL,
> > -                   FCW_RESET);
> > +    /*
> > +     * On Xen 4.1 and later the FPU state is restored on later HVM con=
text in
> > +     * the migrate stream, so what we're doing here is initialising th=
e FPU
> > +     * state for guests from even older versions of Xen.
> > +     *
> > +     * In particular:
> > +     *   1. If there's an XSAVE context later in the stream what we do=
 here for
> > +     *      the FPU doesn't matter because it'll be overriden later.
> > +     *   2. If there isn't and the guest didn't use extended states it=
's still
> > +     *      fine because we have all the information we need here.
> > +     *   3. If there isn't and the guest DID use extended states (coul=
d've
> > +     *      happened prior to Xen 4.1) then we're in a pickle because =
we have
> > +     *      to make up non-existing state. For this case we initialise=
 the FPU
> > +     *      as using x87/SSE only because the rest of the state is gon=
e.
>
> Was this really possible to happen? Guests wouldn't have been able to
> turn on CR4.OSXSAVE, would they?
>
> Jan

You may be right, but my reading of the comment and the code was that
xsave_enabled(v) might be set and the XSAVE hvm context might be missing in=
 the
stream. The archives didn't shed a lot more light than what the code alread=
y
gives away.

Otherwise it would've been far simpler to unconditionally pass
v->arch.xsave_area to the second parameter and let the xsave area to be
overriden by the follow-up HVM context with its actual state.

If my understanding is wrong, I'm happy to remove (3), as I don't think it
affects the code anyway. I thought however that it was a relevant data poin=
t
to leave paper trail for.

Cheers,
Alejandro


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 12:43:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 12:43:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776215.1186352 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdqs6-0001O7-IR; Tue, 13 Aug 2024 12:43:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776215.1186352; Tue, 13 Aug 2024 12:43:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdqs6-0001O0-EZ; Tue, 13 Aug 2024 12:43:30 +0000
Received: by outflank-mailman (input) for mailman id 776215;
 Tue, 13 Aug 2024 12:43:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdqs4-0001Nu-W7
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 12:43:28 +0000
Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com
 [2a00:1450:4864:20::22a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a34cfe82-5971-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 14:43:27 +0200 (CEST)
Received: by mail-lj1-x22a.google.com with SMTP id
 38308e7fff4ca-2f16d2f2b68so76132911fa.3
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 05:43:27 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f4184ebesm66520666b.207.2024.08.13.05.43.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 05:43:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a34cfe82-5971-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723553007; x=1724157807; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=bBFlkNqdIcaDTKI7Hj0DnxlgQqUGJhNIkJ18JFeV0Bo=;
        b=JRr+lGeXSuU95pTC5Mr+orj4Ry4bzEiZCzqWZIBJtwdzmj+GKIEqt31V74vg8+4Oa7
         2n0J09+iGyJcaT26lUYyqVI6AEt7avS1+/ZftC9kwsDfJWf92PaFynmJQRI18PRjj/p7
         X4yTpom+UFOgsH1kuhysm3m7h/3E4pkEh84qPVqZsnPtcRc/43q3R0bK0QqrkldMgyKD
         l0CCacaqUCSfJftwTe/iOvDt+yJ42TLRzIHiZBDUe2v5hM2Ya8qAgVJXQ0fQpOR7//P4
         WHOtPEK+r3E45jsOzM6lVjNu0mFFFBQna08e1SPvcgjQSm76LxBSoec9Vf1S/Tk2S8IE
         pc8w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723553007; x=1724157807;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=bBFlkNqdIcaDTKI7Hj0DnxlgQqUGJhNIkJ18JFeV0Bo=;
        b=sGPAqJYOrTHW5tyrtnqErBBuXefa9QqBSEhwejgrdqvnAQwzcJACyOPw87RCa7YIoq
         vBt6JnlxT1yPP8/F2fIRX33ac1iCrrnEP5Oa9xe/LKYKBp/c8wTNlsPP6I8wYsKd9uO5
         A98NjaMau67ItGQZGxOd/4IyIJWdAlxX5L1O2Efj7y5ZJHSVUObrLBOJK+ommgzn0Pig
         5uHxE+xjSbY8SSB2N/bvDu7/nHtZ5Q15ZmLbIM2fpSl4MS94jtYG/Lj7ld3MDaTRshKs
         hsnSIBuhZO8dwUihX5IK/jGW+7+TNe62M0i0FrH3e0xdh/DdoZANXAtLcRATxVkiKu+F
         x4Mw==
X-Gm-Message-State: AOJu0YycxOijHi6yzCbWnNFqZMVybfr2YEkkLOIKpNsILnBS/CcNZ9WK
	CwVlCNATBYMcopa5mzkB5qjMtuQEXQuo/DOzKmEQm9ZlxAkb8c+uHq5unTg2ddoXJ032tOFWUHE
	=
X-Google-Smtp-Source: AGHT+IHUh4Rh34TvvE4e+LI0ah55p+cV38rlYwp+hW8d31tGgvp+ztqWu1J0aKV+O9rGWgmxXrSFBA==
X-Received: by 2002:a2e:9e57:0:b0:2f0:1f15:5a16 with SMTP id 38308e7fff4ca-2f2b714f489mr27958471fa.13.1723553007037;
        Tue, 13 Aug 2024 05:43:27 -0700 (PDT)
Message-ID: <7c4cb0ee-cddf-434a-95d9-58cec0efd976@suse.com>
Date: Tue, 13 Aug 2024 14:43:25 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86emul: fix UB multiplications in S/G handling
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The conversion of the shifts to multiplications by the commits tagged
below still wasn't quite right: The multiplications (of signed values)
can overflow, too. As of 298556c7b5f8 ("x86emul: correct 32-bit address
handling for AVX2 gathers") signed multiplication wasn't necessary
anymore, though: The necessary sign-extension (if any) will happen as
well when using intermediate variables of unsigned long types, and
excess address bits are chopped off by truncate_ea().

Fixes: b6a907f8c83d ("x86emul: replace UB shifts")
Fixes: 21de9680eb59 ("x86emul: replace further UB shifts")
Oss-fuzz: 71138
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -6369,11 +6369,11 @@ x86_emulate(
         {
             if ( (vex.w ? mask.qw[i] : mask.dw[i]) < 0 )
             {
-                signed long idx = b & 1 ? index.qw[i] : index.dw[i];
+                unsigned long idx = b & 1 ? index.qw[i] : index.dw[i];
 
                 rc = ops->read(ea.mem.seg,
                                truncate_ea(ea.mem.off +
-                                           idx * (1 << state->sib_scale)),
+                                           (idx << state->sib_scale)),
                                (void *)mmvalp + i * op_bytes, op_bytes, ctxt);
                 if ( rc != X86EMUL_OKAY )
                 {
@@ -6489,14 +6489,14 @@ x86_emulate(
 
         for ( i = 0; op_mask; ++i )
         {
-            long idx = b & 1 ? index.qw[i] : index.dw[i];
+            unsigned long idx = b & 1 ? index.qw[i] : index.dw[i];
 
             if ( !(op_mask & (1 << i)) )
                 continue;
 
             rc = ops->read(ea.mem.seg,
                            truncate_ea(ea.mem.off +
-                                       idx * (1 << state->sib_scale)),
+                                       (idx << state->sib_scale)),
                            (void *)mmvalp + i * op_bytes, op_bytes, ctxt);
             if ( rc != X86EMUL_OKAY )
             {
@@ -6643,9 +6643,9 @@ x86_emulate(
 
         for ( i = 0; op_mask; ++i )
         {
-            long idx = (b & 1 ? index.qw[i]
-                              : index.dw[i]) * (1 << state->sib_scale);
-            unsigned long offs = truncate_ea(ea.mem.off + idx);
+            unsigned long idx = b & 1 ? index.qw[i] : index.dw[i];
+            unsigned long offs = truncate_ea(ea.mem.off +
+                                             (idx << state->sib_scale));
             unsigned int j, slot;
 
             if ( !(op_mask & (1 << i)) )
@@ -6663,11 +6663,10 @@ x86_emulate(
              */
             for ( j = (slot = i) + 1; j < n; ++j )
             {
-                long idx2 = (b & 1 ? index.qw[j]
-                                   : index.dw[j]) * (1 << state->sib_scale);
-
+                idx = b & 1 ? index.qw[j] : index.dw[j];
                 if ( (op_mask & (1 << j)) &&
-                     truncate_ea(ea.mem.off + idx2) == offs )
+                     truncate_ea(ea.mem.off +
+                                 (idx << state->sib_scale)) == offs )
                     slot = j;
             }
 


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 12:47:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 12:47:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776225.1186362 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdqw6-0002ds-1U; Tue, 13 Aug 2024 12:47:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776225.1186362; Tue, 13 Aug 2024 12:47:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdqw5-0002dl-Ub; Tue, 13 Aug 2024 12:47:37 +0000
Received: by outflank-mailman (input) for mailman id 776225;
 Tue, 13 Aug 2024 12:47:36 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdqw4-0002df-On
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 12:47:36 +0000
Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com
 [2a00:1450:4864:20::234])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 36731963-5972-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 14:47:34 +0200 (CEST)
Received: by mail-lj1-x234.google.com with SMTP id
 38308e7fff4ca-2f029e9c9cfso83552111fa.2
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 05:47:34 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f3fb0acesm67866366b.89.2024.08.13.05.47.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 05:47:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 36731963-5972-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723553254; x=1724158054; 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=WBw8gwpjENpUOK0qposFMMPs6PXJMHDw5kLROU93bfU=;
        b=dRKm0Ytbyc4YJacK4jQuBr8skSVGNVgARovd+TzrSrhq/1aS06D+Dyy2gBtggKLK60
         1tYgMwxyoGuqWmNAGKD0/LAfXMCD1WZisLR/iFesuCJqpUAo639jARZLtToot44GDD/z
         +TFaEuhGBNvPF8iNQMJf/Z3dKcJWvrvlB9eIcm/PmuLrDqpImrcJnrsnivtdC/1YTGjD
         99X/fARNsiiDT79P+tn+jTJL9SzVgjaqRjTTmWTfInbvItxrWxuLzEkdrlwtl1fyJhzj
         X6daVUpIQKldFDSE22eLfLYDgpKbAvB+ONAmYap3Hj2Ec4X2M6bJmTB/7kNlnLFAaYz1
         vfug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723553254; x=1724158054;
        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=WBw8gwpjENpUOK0qposFMMPs6PXJMHDw5kLROU93bfU=;
        b=RW0gRzc82ifdl+aQnaWMdMt3SJ0bFdNilvbzEQ1NhrmH4Y+gZ2BjiekHzpJ8ZXIQsg
         TqM0rxzXToCZrs3TxxxB5+yr8KaGBWMrrmzQ/bFBEuI2a9vq2O9Vp1wKg+CCllrTPbmc
         Oh1bX4ZmQ4cXPPA3+30bWITA11VEOVhrur7GtaO5dsdxqq83lU4XEB/0+Z8UHh3COpnQ
         1M0btk2ZyjMsQUOqlql0gsqsX+7WRIPKGmUuO9Ttrhbp9LUA5TjMsNQSk6FIY+TeXJKk
         +Yl3D7qLllh804ME0s0zlnCXgwgSH7zEPplVogpUiAN4AHtnam0smJUHD7JZSMBJCyfV
         EWrw==
X-Forwarded-Encrypted: i=1; AJvYcCWyUmev83PRXpe2zqHo7/sdyWdZkkaocNc/lnjmzsZIFQXwelnGxZMzyas0VSQ5FltlSaL5CYE4aH7SSw9tpY8Fpf0O9+S5iun008d0Iog=
X-Gm-Message-State: AOJu0YzH8WhieK+J0zb/lSmzBLuNMpwJ6zXPie9/2kUSRZndnJeKDr1R
	6uqOu9kUdVTdYcI2tsT8Ki5Ex5kijMKDb8VBZFlGF4WmdN57+OkGYRpTLsnUPA==
X-Google-Smtp-Source: AGHT+IFQer+DEwoVXFc8sk/UYHEek+okl+6415jFTS6NWtW+xwn2CM0SbNAEq1etUYc10NiULCNJ3A==
X-Received: by 2002:a2e:be93:0:b0:2ef:2dbe:7455 with SMTP id 38308e7fff4ca-2f2b7146633mr29923851fa.1.1723553253927;
        Tue, 13 Aug 2024 05:47:33 -0700 (PDT)
Message-ID: <b4968a15-176d-4de2-9b51-dd22aa943495@suse.com>
Date: Tue, 13 Aug 2024 14:47:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/2] x86/fpu: Split fpu_setup_fpu() in two
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240808134150.29927-1-alejandro.vallejo@cloud.com>
 <20240808134150.29927-3-alejandro.vallejo@cloud.com>
 <7f001aa8-ee42-4617-8fc4-e4a45d4228e2@suse.com>
 <D3ESHFJW8P2L.1YUEIVC4C77KJ@cloud.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: <D3ESHFJW8P2L.1YUEIVC4C77KJ@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 13.08.2024 14:40, Alejandro Vallejo wrote:
> On Mon Aug 12, 2024 at 4:23 PM BST, Jan Beulich wrote:
>> On 08.08.2024 15:41, Alejandro Vallejo wrote:
>>> --- a/xen/arch/x86/hvm/hvm.c
>>> +++ b/xen/arch/x86/hvm/hvm.c
>>> @@ -1164,10 +1164,25 @@ static int cf_check hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
>>>      seg.attr = ctxt.ldtr_arbytes;
>>>      hvm_set_segment_register(v, x86_seg_ldtr, &seg);
>>>  
>>> -    /* Cover xsave-absent save file restoration on xsave-capable host. */
>>> -    vcpu_setup_fpu(v, xsave_enabled(v) ? NULL : v->arch.xsave_area,
>>> -                   ctxt.flags & XEN_X86_FPU_INITIALISED ? ctxt.fpu_regs : NULL,
>>> -                   FCW_RESET);
>>> +    /*
>>> +     * On Xen 4.1 and later the FPU state is restored on later HVM context in
>>> +     * the migrate stream, so what we're doing here is initialising the FPU
>>> +     * state for guests from even older versions of Xen.
>>> +     *
>>> +     * In particular:
>>> +     *   1. If there's an XSAVE context later in the stream what we do here for
>>> +     *      the FPU doesn't matter because it'll be overriden later.
>>> +     *   2. If there isn't and the guest didn't use extended states it's still
>>> +     *      fine because we have all the information we need here.
>>> +     *   3. If there isn't and the guest DID use extended states (could've
>>> +     *      happened prior to Xen 4.1) then we're in a pickle because we have
>>> +     *      to make up non-existing state. For this case we initialise the FPU
>>> +     *      as using x87/SSE only because the rest of the state is gone.
>>
>> Was this really possible to happen? Guests wouldn't have been able to
>> turn on CR4.OSXSAVE, would they?
> 
> You may be right, but my reading of the comment and the code was that
> xsave_enabled(v) might be set and the XSAVE hvm context might be missing in the
> stream. The archives didn't shed a lot more light than what the code already
> gives away.
> 
> Otherwise it would've been far simpler to unconditionally pass
> v->arch.xsave_area to the second parameter and let the xsave area to be
> overriden by the follow-up HVM context with its actual state.
> 
> If my understanding is wrong, I'm happy to remove (3), as I don't think it
> affects the code anyway. I thought however that it was a relevant data point
> to leave paper trail for.

I would certainly agree - as long as it describes (past) reality. If it
doesn't, I consider it misleading.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 13:16:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 13:16:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776241.1186371 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdrOJ-00088W-3O; Tue, 13 Aug 2024 13:16:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776241.1186371; Tue, 13 Aug 2024 13:16:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdrOJ-00088P-0P; Tue, 13 Aug 2024 13:16:47 +0000
Received: by outflank-mailman (input) for mailman id 776241;
 Tue, 13 Aug 2024 13:16:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdrOH-00088H-7y
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 13:16:45 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 493523a1-5976-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 15:16:44 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-a83597ce5beso19049866b.1
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 06:16:44 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f4181439sm69072966b.190.2024.08.13.06.16.43
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 06:16:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 493523a1-5976-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723555004; x=1724159804; 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=nE+YjaYB3HW2xH+wnCXmqLaiWuAx7sHzGq0lrBqgqAU=;
        b=QeVXpkx3Py8iefqcULYlMXHvX6PJL09At0Fy9aFwQY5eUW60o7gah6gDinAzshLiFD
         n+jDxGQYNiVp9ChBYWZGwjrxra+PVHdPz+OZRxWX4zMKqz+RbXSdU9tmNS1OrQHlIKja
         XoYJ68ecPSBYCi0ypEzwGIbDQTwOKVQoElark+oD7duGz92PihewmHwPw80XkTjNxdAs
         EO8gGphi4rnMQ+CChs/bxkuNM28jlGEBUZh0UxnO97LwdHKppjtOig9qmvduTtj8qGMI
         KxUJeM2m1n9+gdZqtCtUX06Fi1ZteRzBpeF6cP/Y8sq5TScMF8S+OJfo3A3JHvsPrZos
         /8hg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723555004; x=1724159804;
        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=nE+YjaYB3HW2xH+wnCXmqLaiWuAx7sHzGq0lrBqgqAU=;
        b=AkQ4aohz+qdCzY9UitPyxBBoJnnpPQBIBEYP++cCO8OHJG36gn1QFG7PHGhb+DxabQ
         zpSBvsm6LoaIPRB9rMyPx2zqG41LU7CJFTCEo7xd4nt0Tyb/MZxhEoEDdY7dpMeqbhqk
         UXp946/I3/rUcL70q9HWR79b7HkQZ01LACIqYPyYo5SM8NvWHjv6mX1YgS0evCHlBRWC
         eq5184r9q6LQJLQbV10XnRqs5VrCkg7CmTJsehqoE5p7NXKE0BUWJhJfJ9PtcHl2E9vy
         1ARovFDrIeUFtRS3W9+gfTUbYRn4518fW3nb3RCLyKC4rFLdN8OnVVvQ3n1Htz5BP3VH
         qbfQ==
X-Forwarded-Encrypted: i=1; AJvYcCUSAgN7PuO+HyU1GIO2ucJuQtJZvgM/+KRCrV5YCcovAWLOj3p79z6Nu4HjMXNidB7l9dy0PGWkFzFVAaWCR1R1UTFngpgC71xJYeBqpN8=
X-Gm-Message-State: AOJu0YzVqfhZGIUNvzu4yuOSOcg6scavMm4TK6rxJU8+BvodEqWkvkcP
	UWNWsN5vK6z0W2JIt5zyXudGw7YQuZ2UPmgyff+fbGLh9aPk9oBhyGas4lz88VHdSx3H6W14HMo
	=
X-Google-Smtp-Source: AGHT+IEoT7q882fVPIeSSScO1d/bcfk0JtfFJKzU3hhckYJ3ZexJyRUlTK4J+J5y9A4VsmnkigfNTw==
X-Received: by 2002:a17:906:bc0c:b0:a7d:a453:dba1 with SMTP id a640c23a62f3a-a80f0b3c9bdmr285726866b.20.1723555003475;
        Tue, 13 Aug 2024 06:16:43 -0700 (PDT)
Message-ID: <e442389f-a1f7-4719-9486-ebbf51225a89@suse.com>
Date: Tue, 13 Aug 2024 15:16:42 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 22/22] x86/mm: zero stack on stack switch or reset
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: alejandro.vallejo@cloud.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20240726152206.28411-1-roger.pau@citrix.com>
 <20240726152206.28411-23-roger.pau@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240726152206.28411-23-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 26.07.2024 17:22, Roger Pau Monne wrote:
> With the stack mapped on a per-CPU basis there's no risk of other CPUs being
> able to read the stack contents, but vCPUs running on the current pCPU could
> read stack rubble from operations of previous vCPUs.
> 
> The #DF stack is not zeroed because handling of #DF results in a panic.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
>  xen/arch/x86/include/asm/current.h | 30 +++++++++++++++++++++++++++++-
>  1 file changed, 29 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/arch/x86/include/asm/current.h b/xen/arch/x86/include/asm/current.h
> index 75b9a341f814..02b4118b03ef 100644
> --- a/xen/arch/x86/include/asm/current.h
> +++ b/xen/arch/x86/include/asm/current.h
> @@ -177,6 +177,14 @@ unsigned long get_stack_dump_bottom (unsigned long sp);
>  # define SHADOW_STACK_WORK ""
>  #endif
>  
> +#define ZERO_STACK                                              \
> +    "test %[stk_size], %[stk_size];"                            \
> +    "jz .L_skip_zeroing.%=;"                                    \
> +    "std;"                                                      \
> +    "rep stosb;"                                                \
> +    "cld;"                                                      \

Is ERMS actually helping with backwards copies? I didn't think so, and hence
it may be that REP STOSQ might be more efficient here?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 13:19:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 13:19:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776249.1186381 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdrRJ-0000Kl-Jp; Tue, 13 Aug 2024 13:19:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776249.1186381; Tue, 13 Aug 2024 13:19:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdrRJ-0000Ke-H7; Tue, 13 Aug 2024 13:19:53 +0000
Received: by outflank-mailman (input) for mailman id 776249;
 Tue, 13 Aug 2024 13:19:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ynFR=PM=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sdrRI-0000KL-Cq
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 13:19:52 +0000
Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com
 [2a00:1450:4864:20::42a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b904f994-5976-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 15:19:51 +0200 (CEST)
Received: by mail-wr1-x42a.google.com with SMTP id
 ffacd0b85a97d-3685a5e7d3cso3377758f8f.1
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 06:19:51 -0700 (PDT)
Received: from [192.168.1.10] (host-92-26-98-202.as13285.net. [92.26.98.202])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-36e4e51ea09sm10316883f8f.71.2024.08.13.06.19.50
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 06:19:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b904f994-5976-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723555191; x=1724159991; 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=iXq0FZaxLS8fBo5VP3e6v28l2ksqZQmOtTFla/QAhpM=;
        b=nqiwrSTcArUXpd+/iyYYY6k5cwYppdmzNWJGCvkY1KfnSfg37GEkwPmS6K3lSIbQD2
         PKO0qHHDDWKEH8K5A87lhIRJR4AjrY7BnSTeTZSdw15EXCVpnCuPhmY+WS8j2G9hNUYA
         Lzsi12wsFe43d0lHx2vyibs+UmhHzdNB0uNWc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723555191; x=1724159991;
        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=iXq0FZaxLS8fBo5VP3e6v28l2ksqZQmOtTFla/QAhpM=;
        b=doDICVfBbw2FdhvweLIEQndY6qSiwgzd8mxSocuf5CQ2y1wferjvFjMoQ/dtxcZ7tq
         3R6U64pgtlF6BbaZm8puU4oLkwYH+xIA9hiwXKPYbJ0+Kr9p/ZHl+ipnsefGh1hiwa/T
         W71frgAiAN8TIBAP6MxM/fcmumHEor3VgQJTxZ21L1QNtcYktTo30w8SOogc0Zf7iDIR
         PvrUk20zsFVKz9LOvrNe1I7scM2WPWqdzTYcCzDcYeki6Rp9ph67R5W9NptinECJXFhY
         wIw8ewmrV6AS0/bSiujIQzLm/6Mw/CgqDidZZw5VhzWJ7amd9J/lFB1Od6CmRPABYWNp
         XTLA==
X-Forwarded-Encrypted: i=1; AJvYcCWCChpJLTO2ZzAh3Vae9lPCPezYu2kP1qJAsVAdZhsycNO9UfgfDFK5SleBLxzkciIi7HocuFcLd0GdM6EZuZ0YVViBv1PnDi945ykznPw=
X-Gm-Message-State: AOJu0Yxu+tp0BDVOAwYYm3Sq+E+AxWne05rpAhIr+PRNttRuVObV5HzP
	nlls3vsHf4MgMuB9PG9VX/MEvMEagZsO1RxpGxeptzH1fEigBkm1opDPoLtPUuluF5ZVvYkPR+t
	2
X-Google-Smtp-Source: AGHT+IF0c83vosnZbSOjTN3Q4FRK7kfJk6TY7NzfdDxlbCLu6gsrRoP/C47gBfY2sKumhVjDMv0nWw==
X-Received: by 2002:a05:6000:c8b:b0:368:3789:1a2 with SMTP id ffacd0b85a97d-3716ccfb728mr2436107f8f.21.1723555191167;
        Tue, 13 Aug 2024 06:19:51 -0700 (PDT)
Message-ID: <56e05b29-0fad-426b-bfec-60080e83b3ca@citrix.com>
Date: Tue, 13 Aug 2024 14:19:49 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: fix UB multiplications in S/G handling
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <7c4cb0ee-cddf-434a-95d9-58cec0efd976@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <7c4cb0ee-cddf-434a-95d9-58cec0efd976@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 13/08/2024 1:43 pm, Jan Beulich wrote:
> The conversion of the shifts to multiplications by the commits tagged
> below still wasn't quite right: The multiplications (of signed values)
> can overflow, too. As of 298556c7b5f8 ("x86emul: correct 32-bit address
> handling for AVX2 gathers") signed multiplication wasn't necessary
> anymore, though: The necessary sign-extension (if any) will happen as
> well when using intermediate variables of unsigned long types, and
> excess address bits are chopped off by truncate_ea().
>
> Fixes: b6a907f8c83d ("x86emul: replace UB shifts")
> Fixes: 21de9680eb59 ("x86emul: replace further UB shifts")
> Oss-fuzz: 71138
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

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


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 13:42:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 13:42:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776266.1186396 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdrmo-00050O-C0; Tue, 13 Aug 2024 13:42:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776266.1186396; Tue, 13 Aug 2024 13:42:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdrmo-00050H-9P; Tue, 13 Aug 2024 13:42:06 +0000
Received: by outflank-mailman (input) for mailman id 776266;
 Tue, 13 Aug 2024 13:42:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=k7wN=PM=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sdrmm-0004yQ-N1
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 13:42:04 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de
 [2a07:de40:b251:101:10:150:64:2])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d1972db3-5979-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 15:42:03 +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 E2046203BA;
 Tue, 13 Aug 2024 13:42:00 +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 A01B013ABD;
 Tue, 13 Aug 2024 13:42:00 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id 4sCUJahiu2bCGQAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 13 Aug 2024 13:42:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d1972db3-5979-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723556521; 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=hF+OGWJrQJvuR+qcRSbi6yy6oljPmXgdG1p+2bNu0eg=;
	b=GlUkpc+SDQ8DoviphByThx8I8B2T1hO1mCT76kq7+K7bLQpoyJn4pmoEsB17n7srnT+YSB
	a+/0QieDUpXNfjPX4eUlZJ8Ff25buIi58r4deV52FtxV+joqmUsngnwe2s4IaOxD0S/qXe
	ZiOzUaC/UCStSWEnCRpNMD47y809yMA=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=Ub51uOEJ
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723556520; 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=hF+OGWJrQJvuR+qcRSbi6yy6oljPmXgdG1p+2bNu0eg=;
	b=Ub51uOEJtCDkXW8U4f1enhb5aNfKJFBW7MzbiECWmBv5h+6N3mEvSKkBLkuaD05I5E1r9s
	+hZ3O78PTPt9/19atlxE/oYPFUGj5qt8AddaTIjCYqTfLmdfIMc6ZyILANYR2lV45NEQxT
	uJNZARn4E22UWDIAKtimA0sGhbiVyrA=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v2 0/3] mini-os: mm: use a generic page table walker
Date: Tue, 13 Aug 2024 15:41:55 +0200
Message-ID: <20240813134158.580-1-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -3.01
X-Rspamd-Queue-Id: E2046203BA
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	MID_CONTAINS_FROM(1.00)[];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	MIME_TRACE(0.00)[0:+];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	TO_DN_SOME(0.00)[];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	FROM_HAS_DN(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo];
	RCVD_TLS_ALL(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	RCPT_COUNT_THREE(0.00)[4];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Action: no action
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-Spam-Level: 
X-Spam-Flag: NO

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.

Changes in V2:
- addressed comments

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 | 353 +++++++++++++++++++++++++++++---------------------
 1 file changed, 204 insertions(+), 149 deletions(-)

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 13:42:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 13:42:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776268.1186409 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdrmr-0005GL-JM; Tue, 13 Aug 2024 13:42:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776268.1186409; Tue, 13 Aug 2024 13:42:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdrmr-0005GE-Gq; Tue, 13 Aug 2024 13:42:09 +0000
Received: by outflank-mailman (input) for mailman id 776268;
 Tue, 13 Aug 2024 13:42: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=k7wN=PM=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sdrmp-0004yQ-Nu
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 13:42:07 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de
 [2a07:de40:b251:101:10:150:64:2])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d4b803e6-5979-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 15:42:06 +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 79751203BB;
 Tue, 13 Aug 2024 13:42:06 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 44F0913ABD;
 Tue, 13 Aug 2024 13:42: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 3ThgD65iu2bHGQAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 13 Aug 2024 13:42:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d4b803e6-5979-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723556526; 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=T2ja3qLrlfWYFIuKdqgrD+R8mxMYKKUsy9OjHCkfDZI=;
	b=cGK2g0PLJmOAji6VVsgOSbX82iVbZWaAwDqkYGdvguJo/BGjkNqCiyCcIIDLqG+fET3OXl
	vfkyuYDZWZm2BJVTBdhKDkFD5M61viF0HUaoBazvXcftWhvC5J1aSFVcj+HyqVzu8RZ8DE
	4iECH6NLKtFYKVVPyaDPcZN/Fc+LHEo=
Authentication-Results: smtp-out2.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723556526; 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=T2ja3qLrlfWYFIuKdqgrD+R8mxMYKKUsy9OjHCkfDZI=;
	b=cGK2g0PLJmOAji6VVsgOSbX82iVbZWaAwDqkYGdvguJo/BGjkNqCiyCcIIDLqG+fET3OXl
	vfkyuYDZWZm2BJVTBdhKDkFD5M61viF0HUaoBazvXcftWhvC5J1aSFVcj+HyqVzu8RZ8DE
	4iECH6NLKtFYKVVPyaDPcZN/Fc+LHEo=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v2 1/3] mini-os: mm: introduce generic page table walk function
Date: Tue, 13 Aug 2024 15:41:56 +0200
Message-ID: <20240813134158.580-2-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240813134158.580-1-jgross@suse.com>
References: <20240813134158.580-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.80
X-Spamd-Result: default: False [-2.80 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MIME_TRACE(0.00)[0:+];
	TO_DN_SOME(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	RCPT_COUNT_THREE(0.00)[4];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:mid,suse.com:email,imap1.dmz-prg2.suse.org:helo];
	RCVD_TLS_ALL(0.00)[]
X-Spam-Flag: NO
X-Spam-Level: 

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>
---
V2:
- add idx_from_va_lvl() helper (Samuel Thibault)
---
 arch/x86/mm.c | 157 +++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 118 insertions(+), 39 deletions(-)

diff --git a/arch/x86/mm.c b/arch/x86/mm.c
index 7ddf16e4..9849b985 100644
--- a/arch/x86/mm.c
+++ b/arch/x86/mm.c
@@ -125,20 +125,30 @@ 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
+};
+
+static inline unsigned int idx_from_va_lvl(unsigned long va, unsigned int lvl)
+{
+    return (va >> ptdata[lvl].shift) & (ptdata[lvl].entries - 1);
+}
+
 /*
  * 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 +180,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 +193,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 +202,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 +212,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 (it is either at
+ *          level 1, or invalid, or has its PSE bit set)
+ * 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] = idx_from_va_lvl(va, lvl);
+
+    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] = idx_from_va_lvl(va, lvl);
+        }
+    }
+
+    return 0;
+}
+
 /*
  * Build the initial pagetable.
  */
@@ -407,36 +493,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 xen-devel-bounces@lists.xenproject.org Tue Aug 13 13:42:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 13:42:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776270.1186424 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdrn0-0005cR-TZ; Tue, 13 Aug 2024 13:42:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776270.1186424; Tue, 13 Aug 2024 13:42:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdrn0-0005cK-QM; Tue, 13 Aug 2024 13:42:18 +0000
Received: by outflank-mailman (input) for mailman id 776270;
 Tue, 13 Aug 2024 13:42:17 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=k7wN=PM=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sdrmy-0005YO-Uj
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 13:42:16 +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 d813d5c8-5979-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 15:42:13 +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 0E7B0203B9;
 Tue, 13 Aug 2024 13:42:12 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D699513ABD;
 Tue, 13 Aug 2024 13:42:11 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id E+DcMrNiu2bUGQAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 13 Aug 2024 13:42:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d813d5c8-5979-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723556532; 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=mSPiqOW7akL0nRnyX8VpLZ5Z1GRvi01pTr8QTeeTzVI=;
	b=IMcdZoJ2H/dtByOc/sPV/fLdIor8zw/ZlNS0Drsh1zShfE85oWIC3Ase3eGraVcMxTpNu1
	5JW0P2J1KSzJJ2l9GI1qLTz/Y5ihm9o//Lgyk2AztbZJYdXqDpOUuaRMtOgCUe/tKpCV//
	zQP2bWdRQ1v8YA6VmVMO4/CDJv2gDD0=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=IMcdZoJ2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723556532; 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=mSPiqOW7akL0nRnyX8VpLZ5Z1GRvi01pTr8QTeeTzVI=;
	b=IMcdZoJ2H/dtByOc/sPV/fLdIor8zw/ZlNS0Drsh1zShfE85oWIC3Ase3eGraVcMxTpNu1
	5JW0P2J1KSzJJ2l9GI1qLTz/Y5ihm9o//Lgyk2AztbZJYdXqDpOUuaRMtOgCUe/tKpCV//
	zQP2bWdRQ1v8YA6VmVMO4/CDJv2gDD0=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v2 2/3] mini-os: mm: switch need_pgt() to use walk_pt()
Date: Tue, 13 Aug 2024 15:41:57 +0200
Message-ID: <20240813134158.580-3-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240813134158.580-1-jgross@suse.com>
References: <20240813134158.580-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -3.01
X-Rspamd-Queue-Id: 0E7B0203B9
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	MID_CONTAINS_FROM(1.00)[];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	MIME_TRACE(0.00)[0:+];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	TO_DN_SOME(0.00)[];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	FROM_HAS_DN(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:email,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo];
	RCVD_TLS_ALL(0.00)[];
	FROM_EQ_ENVFROM(0.00)[];
	RCPT_COUNT_THREE(0.00)[4];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Action: no action
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-Spam-Level: 
X-Spam-Flag: NO

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

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- add comment and ASSERT() (Samuel Thibault)
---
 arch/x86/mm.c | 72 +++++++++++++++++++++------------------------------
 1 file changed, 30 insertions(+), 42 deletions(-)

diff --git a/arch/x86/mm.c b/arch/x86/mm.c
index 9849b985..84a6d7f0 100644
--- a/arch/x86/mm.c
+++ b/arch/x86/mm.c
@@ -523,57 +523,45 @@ 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);
+        /*
+         * The PTE is not addressing a page table (is_leaf is true). If we are
+         * either at the lowest level or we have a valid large page, we don't
+         * need to allocate a page table.
+         */
+        ASSERT(lvl == L1_FRAME || (*pte & _PAGE_PSE));
+        *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 = idx_from_va_lvl(va, lvl);
+    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 xen-devel-bounces@lists.xenproject.org Tue Aug 13 13:42:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 13:42:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776271.1186434 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdrn2-0005sM-8L; Tue, 13 Aug 2024 13:42:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776271.1186434; Tue, 13 Aug 2024 13:42:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdrn2-0005sB-5F; Tue, 13 Aug 2024 13:42:20 +0000
Received: by outflank-mailman (input) for mailman id 776271;
 Tue, 13 Aug 2024 13:42:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=k7wN=PM=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sdrn0-0004yQ-Sh
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 13:42:18 +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 db783807-5979-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 15:42:18 +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 9DF50227F2;
 Tue, 13 Aug 2024 13:42:17 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 71D5113ABD;
 Tue, 13 Aug 2024 13:42:17 +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 4odAGrliu2bcGQAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 13 Aug 2024 13:42:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: db783807-5979-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723556537; 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=WNUXKUrwLG6oWojlY/a5gaayfmUKTp/EVDucqgND6/g=;
	b=RCaHpQhbdwAQB+BWDqRXK5sPErDQgbeCf5c9+8uhLu+szl9StsyrD0m9ajm7gIpZr4ROGY
	Wt5t7qSdSgjkXjvGUO+AYjB8owPF6rSQJNUslMpuXaF9J36IxYYKWeJ33bHf/faLMjehUf
	PMHfwQw/r2L28gTvaMft0OSfI3tfRM0=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=RCaHpQhb
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723556537; 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=WNUXKUrwLG6oWojlY/a5gaayfmUKTp/EVDucqgND6/g=;
	b=RCaHpQhbdwAQB+BWDqRXK5sPErDQgbeCf5c9+8uhLu+szl9StsyrD0m9ajm7gIpZr4ROGY
	Wt5t7qSdSgjkXjvGUO+AYjB8owPF6rSQJNUslMpuXaF9J36IxYYKWeJ33bHf/faLMjehUf
	PMHfwQw/r2L28gTvaMft0OSfI3tfRM0=
From: Juergen Gross <jgross@suse.com>
To: minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Cc: samuel.thibault@ens-lyon.org,
	Juergen Gross <jgross@suse.com>
Subject: [PATCH v2 3/3] mini-os: mm: convert set_readonly() to use walk_pt()
Date: Tue, 13 Aug 2024 15:41:58 +0200
Message-ID: <20240813134158.580-4-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240813134158.580-1-jgross@suse.com>
References: <20240813134158.580-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 9DF50227F2
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	MIME_TRACE(0.00)[0:+];
	ARC_NA(0.00)[];
	TO_DN_SOME(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	RCVD_TLS_ALL(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCPT_COUNT_THREE(0.00)[4];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:mid,suse.com:email,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]
X-Spam-Score: -3.01
X-Rspamd-Action: no action
X-Spam-Flag: NO
X-Spam-Level: 

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>
---
V2:
- clear count after doing an mmu_update call (Samuel Thibault)
- do final mmu_update call from set_readonly() if needed (Samuel Thibault)
---
 arch/x86/mm.c | 124 +++++++++++++++++++++++---------------------------
 1 file changed, 56 insertions(+), 68 deletions(-)

diff --git a/arch/x86/mm.c b/arch/x86/mm.c
index 84a6d7f0..85827d93 100644
--- a/arch/x86/mm.c
+++ b/arch/x86/mm.c
@@ -402,92 +402,80 @@ 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 )
+    {
+         ro->count = 0;
+         if ( HYPERVISOR_mmu_update(mmu_updates, ro->count, NULL,
+                                    DOMID_SELF) < 0 )
+             BUG();
+    }
 #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;
-        }
+static void tlb_flush(void)
+{
+    mmuext_op_t op = { .cmd = MMUEXT_TLB_FLUSH_ALL };
+    int count;
+
+    HYPERVISOR_mmuext_op(&op, 1, &count, DOMID_SELF);
+}
 #else
-        if ( start_address == (1UL << L2_PAGETABLE_SHIFT) )
-            page_size = 1UL << L2_PAGETABLE_SHIFT;
+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);
 
 #ifdef CONFIG_PARAVIRT
-    {
-        mmuext_op_t op = {
-            .cmd = MMUEXT_TLB_FLUSH_ALL,
-        };
-        int count;
-        HYPERVISOR_mmuext_op(&op, 1, &count, DOMID_SELF);
-    }
-#else
-    write_cr3((unsigned long)pt_base);
+    if ( setro.count &&
+         HYPERVISOR_mmu_update(mmu_updates, setro.count, NULL, DOMID_SELF) < 0)
+        BUG();
 #endif
+
+    tlb_flush();
 }
 
 /*
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 14:01:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 14:01:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776322.1186448 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sds5a-0002kA-Sa; Tue, 13 Aug 2024 14:01:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776322.1186448; Tue, 13 Aug 2024 14:01:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sds5a-0002k3-Pp; Tue, 13 Aug 2024 14:01:30 +0000
Received: by outflank-mailman (input) for mailman id 776322;
 Tue, 13 Aug 2024 14:01:29 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sds5Z-0002jx-G7
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 14:01:29 +0000
Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com
 [2a00:1450:4864:20::233])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 884d7266-597c-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 16:01:27 +0200 (CEST)
Received: by mail-lj1-x233.google.com with SMTP id
 38308e7fff4ca-2f1798eaee6so52990131fa.0
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 07:01:27 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd196a7b29sm2982709a12.56.2024.08.13.07.01.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 07:01:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 884d7266-597c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723557686; x=1724162486; 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=X1eSclQ2lPG1v/tyz4BC45xToY1RW2r4Zy/KO0O9PIc=;
        b=gQKW8dBPkYSbauq6uGlZ1vckJfeoGWW9JVEcYPM6DHhl5uxCheDsJk2CXpFiiBHRjL
         RhuimsmJlOTCoky0crOqBe6nhJYr3PKWf1n3uSUXNJRb28f4Q4cP4RCeIPsQ+jtxZKd+
         u5fEy/fBlpsuGxXV9pmxDH6yIDWRu0xrJMUBVISigVi/ObZrgoFU9VxjsOeQ2PH0SHRE
         Fra0K4zDHe8R0FsqxjGYcPhfyfMqa/Ol/lI8HskQm8H7mRrRcLx+jJyDKXAUoGccD8fh
         11zVlD1HJaui5y9pqNz+fk0eKzjzoiqtxTLJMPkggNSLb1dcFK0bBjBvASA0v2tw+fyh
         oSuA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723557686; x=1724162486;
        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=X1eSclQ2lPG1v/tyz4BC45xToY1RW2r4Zy/KO0O9PIc=;
        b=Yb4de12G+VrpbW9aru9bThUOnySAfaqF8ejhE4d1qflP+pZ2VtvAKg31Y39uwlbu/Z
         696jxtY/8kWR28ROOreJEuKnflb2ysYIf2RQwo+A6GFCQpmBUE2G2V3KVhJNewNIzvKh
         ZDioLm8hDUfMEOh8xI2fV39MeXwxaYZFT3ciu+9F/WQ4EvE7hYern/Qqltx7GrAAHPSB
         RrAEMF1zgCSjTX6VF3y2XtFRsx6+1ViL1ejjZzpLXAn0RCidQedupXH9HKj6Cl/70YnP
         5l+JcavlS2skg9WR7KYkL1e4GbXDYDO5tNgknPSKmJJj7CVSa0QTKEf09tiiJQOMMbpG
         PhQw==
X-Forwarded-Encrypted: i=1; AJvYcCVM2DRPaFMRq8oWVY4IVXwckHwIREoQuquK945Om/++kMNY2r9eYgPU7M+fa4D0dyRi2H5GQ/9bojO/JjGJSZhovFyt0iLNS6nwU1Di2xA=
X-Gm-Message-State: AOJu0Yxy2bFCG1Cxh6EiaPIrgN6WcNb9g0RBgvR+tHOtsxzbO/wsqMAo
	U5L0KRHpIwmVC9Re/+RhnHmVAgYgVkSCpo0aiKkx3Q94xok3ZzmhulnuZ0Mx0Q==
X-Google-Smtp-Source: AGHT+IGm5LXC+abpifOmChOcax9ircJfl7s+zmeaDALG3WoSVo/zfdg99EE/mpvBiWwQNiwtTaO8zg==
X-Received: by 2002:a05:651c:2228:b0:2ec:1810:e50a with SMTP id 38308e7fff4ca-2f2b717811emr32658521fa.32.1723557686181;
        Tue, 13 Aug 2024 07:01:26 -0700 (PDT)
Message-ID: <74f88a45-a632-4ca6-9cee-95f52370b397@suse.com>
Date: Tue, 13 Aug 2024 16:01:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/msi: fix locking for SR-IOV devices
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <20240812203938.981588-1-stewart.hildebrand@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240812203938.981588-1-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 12.08.2024 22:39, Stewart Hildebrand wrote:
> In commit 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci
> structure") a lock moved from allocate_and_map_msi_pirq() to the caller
> and changed from pcidevs_lock() to read_lock(&d->pci_lock). However, one
> call path wasn't updated to reflect the change, leading to a failed
> assertion observed under the following conditions:
> 
> * PV dom0
> * Debug build (debug=y) of Xen
> * There is an SR-IOV device in the system with one or more VFs enabled
> * Dom0 has loaded the driver for the VF and enabled MSI-X
> 
> (XEN) Assertion 'd || pcidevs_locked()' failed at drivers/passthrough/pci.c:535
> (XEN) ----[ Xen-4.20-unstable  x86_64  debug=y  Not tainted ]----
> ...
> (XEN) Xen call trace:
> (XEN)    [<ffff82d040284da8>] R pci_get_pdev+0x4c/0xab
> (XEN)    [<ffff82d040344f5c>] F arch/x86/msi.c#read_pci_mem_bar+0x58/0x272
> (XEN)    [<ffff82d04034530e>] F arch/x86/msi.c#msix_capability_init+0x198/0x755
> (XEN)    [<ffff82d040345dad>] F arch/x86/msi.c#__pci_enable_msix+0x82/0xe8
> (XEN)    [<ffff82d0403463e5>] F pci_enable_msi+0x3f/0x78
> (XEN)    [<ffff82d04034be2b>] F map_domain_pirq+0x2a4/0x6dc
> (XEN)    [<ffff82d04034d4d5>] F allocate_and_map_msi_pirq+0x103/0x262
> (XEN)    [<ffff82d04035da5d>] F physdev_map_pirq+0x210/0x259
> (XEN)    [<ffff82d04035e798>] F do_physdev_op+0x9c3/0x1454
> (XEN)    [<ffff82d040329475>] F pv_hypercall+0x5ac/0x6af
> (XEN)    [<ffff82d0402012d3>] F lstar_enter+0x143/0x150
> 
> In read_pci_mem_bar(), the VF obtains the struct pci_dev pointer for its
> associated PF to access the vf_rlen array. This array is initialized in
> pci_add_device() and is only populated in the associated PF's struct
> pci_dev.
> 
> Add a link from the VF's struct pci_dev to the associated PF struct
> pci_dev, ensuring the PF's struct doesn't get deallocated until all its
> VFs have gone away. Access the vf_rlen array via the new link to the PF,
> and remove the troublesome call to pci_get_pdev().
> 
> Add a call to pci_get_pdev() inside the pcidevs_lock()-locked section of
> pci_add_device() to set up the link from VF to PF. In case the new
> pci_add_device() invocation fails to find the associated PF (returning
> NULL), we are no worse off than before: read_pci_mem_bar() will still
> return 0 in that case.
> 
> Note that currently the only way for Xen to know if a device is a VF is
> if the toolstack tells Xen about it. Using PHYSDEVOP_manage_pci_add for
> a VF is not a case that Xen handles.

How does the toolstack come into play here? It's still the Dom0 kernel to
tell Xen, via PHYSDEVOP_pci_device_add (preferred) or
PHYSDEVOP_manage_pci_add_ext (kind of deprecated; PHYSDEVOP_manage_pci_add
is even more kind of deprecated).

> --- a/xen/arch/x86/msi.c
> +++ b/xen/arch/x86/msi.c
> @@ -662,34 +662,32 @@ static int msi_capability_init(struct pci_dev *dev,
>      return 0;
>  }
>  
> -static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
> +static u64 read_pci_mem_bar(struct pf_info *pf_info, u16 seg, u8 bus, u8 slot,
> +                            u8 func, u8 bir, int vf)
>  {
> +    pci_sbdf_t sbdf = PCI_SBDF(seg, bus, slot, func);
>      u8 limit;
>      u32 addr, base = PCI_BASE_ADDRESS_0;
>      u64 disp = 0;
>  
>      if ( vf >= 0 )
>      {
> -        struct pci_dev *pdev = pci_get_pdev(NULL,
> -                                            PCI_SBDF(seg, bus, slot, func));
>          unsigned int pos;
>          uint16_t ctrl, num_vf, offset, stride;
>  
> -        if ( !pdev )
> -            return 0;
> -
> -        pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_SRIOV);
> -        ctrl = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_CTRL);
> -        num_vf = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_NUM_VF);
> -        offset = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_OFFSET);
> -        stride = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_STRIDE);
> +        pos = pci_find_ext_capability(sbdf, PCI_EXT_CAP_ID_SRIOV);
> +        ctrl = pci_conf_read16(sbdf, pos + PCI_SRIOV_CTRL);
> +        num_vf = pci_conf_read16(sbdf, pos + PCI_SRIOV_NUM_VF);
> +        offset = pci_conf_read16(sbdf, pos + PCI_SRIOV_VF_OFFSET);
> +        stride = pci_conf_read16(sbdf, pos + PCI_SRIOV_VF_STRIDE);
>  
>          if ( !pos ||
>               !(ctrl & PCI_SRIOV_CTRL_VFE) ||
>               !(ctrl & PCI_SRIOV_CTRL_MSE) ||
>               !num_vf || !offset || (num_vf > 1 && !stride) ||
>               bir >= PCI_SRIOV_NUM_BARS ||
> -             !pdev->vf_rlen[bir] )
> +             !pf_info ||

See further down - I think it would be nice if we didn't need this new
check.

> @@ -813,6 +811,7 @@ static int msix_capability_init(struct pci_dev *dev,
>          int vf;
>          paddr_t pba_paddr;
>          unsigned int pba_offset;
> +        struct pf_info *pf_info = NULL;

Pointer-to-const?

> @@ -827,9 +826,12 @@ static int msix_capability_init(struct pci_dev *dev,
>              pslot = PCI_SLOT(dev->info.physfn.devfn);
>              pfunc = PCI_FUNC(dev->info.physfn.devfn);
>              vf = dev->sbdf.bdf;
> +            if ( dev->virtfn.pf_pdev )
> +                pf_info = &dev->virtfn.pf_pdev->physfn;
>          }
>  
> -        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
> +        table_paddr = read_pci_mem_bar(pf_info, seg, pbus, pslot, pfunc, bir,
> +                                       vf);

I don't think putting the new arg first is very nice. SBDF should remain
first imo. Between the latter arguments I'm not as fussed.

> @@ -446,7 +448,27 @@ static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
>  
>      list_del(&pdev->alldevs_list);
>      pdev_msi_deinit(pdev);
> -    xfree(pdev);
> +
> +    if ( pdev->info.is_virtfn )
> +    {
> +        struct pci_dev *pf_pdev = pdev->virtfn.pf_pdev;
> +
> +        if ( pf_pdev )
> +        {
> +            list_del(&pdev->virtfn.next);
> +            if ( pf_pdev->physfn.dealloc_pending &&
> +                 list_empty(&pf_pdev->physfn.vf_list) )
> +                xfree(pf_pdev);
> +        }
> +        xfree(pdev);
> +    }
> +    else
> +    {
> +        if ( list_empty(&pdev->physfn.vf_list) )
> +            xfree(pdev);
> +        else
> +            pdev->physfn.dealloc_pending = true;
> +    }

Could I talk you into un-indenting the last if/else by a level, by making
the earlier else and "else if()"?

One aspect I didn't properly consider when making the suggestion: What if,
without all VFs having gone away, the PF is re-added? In that case we
would better recycle the existing structure. That's getting a little
complicated, so maybe a better approach is to refuse the request (in
pci_remove_device()) when the list isn't empty?

> @@ -700,10 +722,22 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>           * extended function.
>           */
>          if ( pdev->info.is_virtfn )
> +        {
> +            struct pci_dev *pf_pdev;
> +
>              pdev->info.is_extfn = pf_is_extfn;
> +            pf_pdev = pci_get_pdev(NULL,
> +                                   PCI_SBDF(seg, info->physfn.bus,
> +                                            info->physfn.devfn));
> +            if ( pf_pdev )
> +            {
> +                pdev->virtfn.pf_pdev = pf_pdev;
> +                list_add(&pdev->virtfn.next, &pf_pdev->physfn.vf_list);
> +            }
> +        }

Hmm, yes, we can't really use the result of the earlier pci_get_pdev(), as
we drop the lock intermediately. I wonder though if we wouldn't better fail
the function if we can't find the PF instance.

> --- a/xen/include/xen/pci.h
> +++ b/xen/include/xen/pci.h
> @@ -150,7 +150,17 @@ struct pci_dev {
>          unsigned int count;
>  #define PT_FAULT_THRESHOLD 10
>      } fault;
> -    u64 vf_rlen[6];
> +    struct pf_info {
> +        /* Only populated for PFs (info.is_virtfn == false) */
> +        uint64_t vf_rlen[PCI_SRIOV_NUM_BARS];
> +        struct list_head vf_list;             /* List head */
> +        bool dealloc_pending;
> +    } physfn;
> +    struct {
> +        /* Only populated for VFs (info.is_virtfn == true) */
> +        struct pci_dev *pf_pdev;              /* Link from VF to PF */
> +        struct list_head next;                /* Entry in vf_list */

For doubly-linked lists "next" isn't really a good name. Since both struct
variants need such a member, why not use vf_list uniformly? That'll then
also lower the significance of my other question:

> +    } virtfn;

Should the two new struct-s perhaps be a union?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 14:21:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 14:21:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776347.1186458 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdsP9-0006nM-ES; Tue, 13 Aug 2024 14:21:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776347.1186458; Tue, 13 Aug 2024 14:21:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdsP9-0006nF-Bs; Tue, 13 Aug 2024 14:21:43 +0000
Received: by outflank-mailman (input) for mailman id 776347;
 Tue, 13 Aug 2024 14:21:41 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=EOoy=PM=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sdsP7-0006mt-QO
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 14:21:41 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5aed7fec-597f-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 16:21:39 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-5b3fff87e6bso6344047a12.0
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 07:21:39 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f414e3basm73540966b.164.2024.08.13.07.21.37
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 13 Aug 2024 07:21:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5aed7fec-597f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723558898; x=1724163698; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=FB17vxpkPLnVIAPOyxuWHy0rTxGUCVJLIDc0oScZHuo=;
        b=M/zR7TOUFswYVCIyZvxg5ZNa+eg1CaalRmVZQypSt0IVDldryQqfOcHG6bKezBfy9M
         JGWcLnnS7UlEzw0wKeo7d/UGGbXj8eGAY/jkaao9fL1jAFc1mXhQO4sN2MWIjx7FYY3T
         UcVj7Y3V95/Z5L96/h6k7uNXcYrfTcAlEGSag=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723558898; x=1724163698;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=FB17vxpkPLnVIAPOyxuWHy0rTxGUCVJLIDc0oScZHuo=;
        b=te8jtFndnRQ+SGurB1qVu4WX45GP5/AWUKIf6xD5ixelYlzQvlLU33Rx5l/tbr6bHl
         qCcX2i/s1wIsD8y+KC6Tn5r0ou4slQTuWmhA1aObC6ztPuUhwXly7B1uc++GXwk0Nbwb
         0p+6ljPufxBfhxITsHOMMVvsFG7+lJEG9D+eFlNYdgLwzMVGPsjhWO+ORMQYJ3ay9RKe
         Bggw5PEddHVmVs00B34lupOjbaqzEAWNjx5ei+rYU2GdmLvn0zJ/PxW9QKruIhL32ya+
         /h+8gZivmVBxhzd/UDNNUXa8lW+T41H69qBMEYuLEgbtjBxw5dgtp5gYg5qrdXSVAQBS
         TPXw==
X-Gm-Message-State: AOJu0Yzmi5UNAgJgD9cw5umPLx3aOs6/3ULyfszllQIoslZ6P5JDm6b5
	i11ZGJ2uTGAvtl+XQJBVYjmgMiqzSj76RkTKXNdS2THxj5wQSffjqmxHxxgcLz3ODwKhD8+ld9y
	z
X-Google-Smtp-Source: AGHT+IGqJ+NrqhBTZmysQlfdhvjxmlxHPJepVaoEO6LRnmWyQwqe2UZx5qIh+3w0Ja6Ru04AWNxHDg==
X-Received: by 2002:a17:907:efd5:b0:a7a:929f:c0cf with SMTP id a640c23a62f3a-a80ed1efeedmr286956366b.21.1723558898504;
        Tue, 13 Aug 2024 07:21:38 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v3 0/2] x86: FPU handling cleanup
Date: Tue, 13 Aug 2024 15:21:17 +0100
Message-ID: <20240813142119.29012-1-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

v2: https://lore.kernel.org/xen-devel/20240808134150.29927-1-alejandro.vallejo@cloud.com/T/#t
v2 -> v3: Cosmetic changes and wiped big comment about missing data in the
          migration stream. Details in each patch.

v1: https://lore.kernel.org/xen-devel/cover.1720538832.git.alejandro.vallejo@cloud.com/T/#t
v1 -> v2: v1/patch1 and v1/patch2 are already in staging.

=============================== Original cover letter =========================
I want to eventually reach a position in which the FPU state can be allocated
from the domheap and hidden via the same core mechanism proposed in Elias'
directmap removal series. Doing so is complicated by the presence of 2 aliased
pointers (v->arch.fpu_ctxt and v->arch.xsave_area) and the rather complicated
semantics of vcpu_setup_fpu(). This series tries to simplify the code so moving
to a "map/modify/unmap" model is more tractable.

Patches 1 and 2 are trivial refactors.

Patch 3 unifies FPU state so an XSAVE area is allocated per vCPU regardless of
the host supporting it or not. The rationale is that the memory savings are
negligible and not worth the extra complexity.

Patch 4 is a non-trivial split of the vcpu_setup_fpu() into 2 separate
functions. One to override x87/SSE state, and another to set a reset state.
===============================================================================

Alejandro Vallejo (2):
  x86/fpu: Combine fpu_ctxt and xsave_area in arch_vcpu
  x86/fpu: Split fpu_setup_fpu() in three

 xen/arch/x86/domain.c             |   7 +-
 xen/arch/x86/domctl.c             |   6 +-
 xen/arch/x86/hvm/emulate.c        |   4 +-
 xen/arch/x86/hvm/hvm.c            |  18 +++---
 xen/arch/x86/i387.c               | 103 ++++++++++--------------------
 xen/arch/x86/include/asm/domain.h |   8 +--
 xen/arch/x86/include/asm/i387.h   |  28 ++++++--
 xen/arch/x86/include/asm/xstate.h |   1 +
 xen/arch/x86/x86_emulate/blk.c    |   3 +-
 xen/arch/x86/xstate.c             |  13 +++-
 10 files changed, 95 insertions(+), 96 deletions(-)

-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 14:21:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 14:21:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776349.1186471 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdsPA-0006zb-3X; Tue, 13 Aug 2024 14:21:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776349.1186471; Tue, 13 Aug 2024 14:21:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdsP9-0006yF-U4; Tue, 13 Aug 2024 14:21:43 +0000
Received: by outflank-mailman (input) for mailman id 776349;
 Tue, 13 Aug 2024 14:21:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=EOoy=PM=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sdsP8-0006n1-Ky
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 14:21:42 +0000
Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com
 [2a00:1450:4864:20::22e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5c17444c-597f-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 16:21:41 +0200 (CEST)
Received: by mail-lj1-x22e.google.com with SMTP id
 38308e7fff4ca-2ef2cce8be8so61023001fa.1
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 07:21:41 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f414e3basm73540966b.164.2024.08.13.07.21.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 13 Aug 2024 07:21:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5c17444c-597f-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723558900; x=1724163700; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=4n7JOAgAvzp22GAaCkId27lvQiwRgN36BGS4UVLvykI=;
        b=B3Y6AZee0SAm2jaBkA4AkAbJZjf4AO5d0fcfaGuxMa4QcYXa35GwxK9HWv644hXXsM
         RGbgJRSmlRYzAS6r0Fi1HlOxhLAzhZXp6yJY81hDjb3IIMkU4hXtPUmvzGFB08Uip+Fc
         sQw8SutBAKjZfE32ERhLu/RMOgCjA1kvSbGnc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723558900; x=1724163700;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=4n7JOAgAvzp22GAaCkId27lvQiwRgN36BGS4UVLvykI=;
        b=hH8GUNXmg5rXU38DyE0DBtRzzK7nV5n8mYYXn7xikMjv2eN97j7IygpJ02BqgSejMQ
         Ab9f3KQ/pY0DmglJJgpiMSaCnBao4Nbck0hD0cpk0G/+GAdfM5I5T+a6/IRTPfagl4C+
         CFXjcyQFyL7TmPUKMIX+paErSKgailT1vnO8GWW7/4MaTMCl85nReojYpMrssoLP+UcJ
         ZRNz6OChH53Avu09jtJ9kZi6p68dSyFYcez0cMgmgZlrgFhjQJ1x0IObVwhnxymQ6xdj
         QSBtY6KFWVD7yLHsRmvoEqPuOHRX1edzzv9eq2J9hbEqprh2EYnXUC+yXbXBpEu6BnZk
         KPHQ==
X-Gm-Message-State: AOJu0Yye+63LNbxOQCldjdE0Cc8/9CNmXDWUFvMllUxCNflCDRWbLi5m
	5gRb67Fmh8oMss+j9PgT93Wec2vJVKUgKxp7qFKWZt0MgCJU7/uposylYp/XWlJXjcUjx18ydOw
	L
X-Google-Smtp-Source: AGHT+IFy/X5/v3ozuiXP4cvcVNRmyGBu6v4bwyM0c9pQMAhQj+cf9IIljyFMvMqOQbmgiFKizIMJqw==
X-Received: by 2002:a2e:6e14:0:b0:2ef:2b06:b686 with SMTP id 38308e7fff4ca-2f2b714d248mr24973211fa.17.1723558900012;
        Tue, 13 Aug 2024 07:21:40 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v3 2/2] x86/fpu: Split fpu_setup_fpu() in three
Date: Tue, 13 Aug 2024 15:21:19 +0100
Message-ID: <20240813142119.29012-3-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240813142119.29012-1-alejandro.vallejo@cloud.com>
References: <20240813142119.29012-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

It was trying to do too many things at once and there was no clear way of
defining what it was meant to do. This commit splits the function in three.

  1. A function to return the FPU to power-on reset values.
  2. A function to return the FPU to default values.
  3. A x87/SSE state loader (equivalent to the old function when it took a data
     pointer).

While at it, make sure the abridged tag is consistent with the manuals and
start as 0xFF.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v3:
  * Adjust commit message, as the split is now in 3.
  * Remove bulky comment, as the rationale for it turned out to be
    unsubstantiated. I can't find proof in xen-devel of the stream
    operating the way I claimed, and at that point having the comment
    at all is pointless

I suspect the rationale for xsave_vcpu(v) was merely to skip writing the XSAVE
header when it would be rewritten later on. Whatever it might be the current
logic does the right thing and is several orders of magnitude clearer about its
objective and its intent.

---
 xen/arch/x86/domain.c             |  7 ++--
 xen/arch/x86/hvm/hvm.c            | 12 +++----
 xen/arch/x86/i387.c               | 60 +++++++++++++++----------------
 xen/arch/x86/include/asm/i387.h   | 28 ++++++++++++---
 xen/arch/x86/include/asm/xstate.h |  1 +
 5 files changed, 62 insertions(+), 46 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index d977ec71ca20..5af9e3e7a8b4 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1186,9 +1186,10 @@ int arch_set_info_guest(
          is_pv_64bit_domain(d) )
         v->arch.flags &= ~TF_kernel_mode;
 
-    vcpu_setup_fpu(v, v->arch.xsave_area,
-                   flags & VGCF_I387_VALID ? &c.nat->fpu_ctxt : NULL,
-                   FCW_DEFAULT);
+    if ( flags & VGCF_I387_VALID )
+        vcpu_setup_fpu(v, &c.nat->fpu_ctxt);
+    else
+        vcpu_default_fpu(v);
 
     if ( !compat )
     {
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 76bbb645b77a..95d66e68a849 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1165,10 +1165,10 @@ static int cf_check hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
     seg.attr = ctxt.ldtr_arbytes;
     hvm_set_segment_register(v, x86_seg_ldtr, &seg);
 
-    /* Cover xsave-absent save file restoration on xsave-capable host. */
-    vcpu_setup_fpu(v, xsave_enabled(v) ? NULL : v->arch.xsave_area,
-                   ctxt.flags & XEN_X86_FPU_INITIALISED ? ctxt.fpu_regs : NULL,
-                   FCW_RESET);
+    if ( ctxt.flags & XEN_X86_FPU_INITIALISED )
+        vcpu_setup_fpu(v, &ctxt.fpu_regs);
+    else
+        vcpu_reset_fpu(v);
 
     v->arch.user_regs.rax = ctxt.rax;
     v->arch.user_regs.rbx = ctxt.rbx;
@@ -4008,9 +4008,7 @@ void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip)
         v->arch.guest_table = pagetable_null();
     }
 
-    if ( v->arch.xsave_area )
-        v->arch.xsave_area->xsave_hdr.xstate_bv = 0;
-    vcpu_setup_fpu(v, v->arch.xsave_area, NULL, FCW_RESET);
+    vcpu_reset_fpu(v);
 
     arch_vcpu_regs_init(v);
     v->arch.user_regs.rip = ip;
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index fbb9d3584a3d..f7a9dcd162ba 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -303,41 +303,37 @@ int vcpu_init_fpu(struct vcpu *v)
     return xstate_alloc_save_area(v);
 }
 
-void vcpu_setup_fpu(struct vcpu *v, struct xsave_struct *xsave_area,
-                    const void *data, unsigned int fcw_default)
+void vcpu_reset_fpu(struct vcpu *v)
 {
-    fpusse_t *fpu_sse = &v->arch.xsave_area->fpu_sse;
-
-    ASSERT(!xsave_area || xsave_area == v->arch.xsave_area);
-
-    v->fpu_initialised = !!data;
+    v->fpu_initialised = false;
+    *v->arch.xsave_area = (struct xsave_struct) {
+        .fpu_sse = {
+            .mxcsr = MXCSR_DEFAULT,
+            .fcw = FCW_RESET,
+            .ftw = FTW_RESET,
+        },
+        .xsave_hdr.xstate_bv = X86_XCR0_X87,
+    };
+}
 
-    if ( data )
-    {
-        memcpy(fpu_sse, data, sizeof(*fpu_sse));
-        if ( xsave_area )
-            xsave_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
-    }
-    else if ( xsave_area && fcw_default == FCW_DEFAULT )
-    {
-        xsave_area->xsave_hdr.xstate_bv = 0;
-        fpu_sse->mxcsr = MXCSR_DEFAULT;
-    }
-    else
-    {
-        memset(fpu_sse, 0, sizeof(*fpu_sse));
-        fpu_sse->fcw = fcw_default;
-        fpu_sse->mxcsr = MXCSR_DEFAULT;
-        if ( v->arch.xsave_area )
-        {
-            v->arch.xsave_area->xsave_hdr.xstate_bv &= ~XSTATE_FP_SSE;
-            if ( fcw_default != FCW_DEFAULT )
-                v->arch.xsave_area->xsave_hdr.xstate_bv |= X86_XCR0_X87;
-        }
-    }
+void vcpu_default_fpu(struct vcpu *v)
+{
+    v->fpu_initialised = false;
+    *v->arch.xsave_area = (struct xsave_struct) {
+        .fpu_sse = {
+            .mxcsr = MXCSR_DEFAULT,
+            .fcw = FCW_DEFAULT,
+        },
+    };
+}
 
-    if ( xsave_area )
-        xsave_area->xsave_hdr.xcomp_bv = 0;
+void vcpu_setup_fpu(struct vcpu *v, const void *data)
+{
+    v->fpu_initialised = true;
+    *v->arch.xsave_area = (struct xsave_struct) {
+        .fpu_sse = *(const fpusse_t*)data,
+        .xsave_hdr.xstate_bv = XSTATE_FP_SSE,
+    };
 }
 
 /* Free FPU's context save area */
diff --git a/xen/arch/x86/include/asm/i387.h b/xen/arch/x86/include/asm/i387.h
index a783549db991..7a69577de45b 100644
--- a/xen/arch/x86/include/asm/i387.h
+++ b/xen/arch/x86/include/asm/i387.h
@@ -31,10 +31,30 @@ void vcpu_restore_fpu_nonlazy(struct vcpu *v, bool need_stts);
 void vcpu_restore_fpu_lazy(struct vcpu *v);
 void vcpu_save_fpu(struct vcpu *v);
 void save_fpu_enable(void);
-
 int vcpu_init_fpu(struct vcpu *v);
-struct xsave_struct;
-void vcpu_setup_fpu(struct vcpu *v, struct xsave_struct *xsave_area,
-                    const void *data, unsigned int fcw_default);
 void vcpu_destroy_fpu(struct vcpu *v);
+
+/*
+ * Restore v's FPU to power-on reset values
+ *
+ * @param v vCPU containing the FPU
+ */
+void vcpu_reset_fpu(struct vcpu *v);
+
+/*
+ * Restore v's FPU to default values
+ *
+ * @param v vCPU containing the FPU
+ */
+void vcpu_default_fpu(struct vcpu *v);
+
+/*
+ * Load x87/SSE state into v's FPU
+ *
+ * Overrides the XSAVE header to set the state components to be x87 and SSE.
+ *
+ * @param v    vCPU containing the FPU
+ * @param data 512-octet blob for x87/SSE state
+ */
+void vcpu_setup_fpu(struct vcpu *v, const void *data);
 #endif /* __ASM_I386_I387_H */
diff --git a/xen/arch/x86/include/asm/xstate.h b/xen/arch/x86/include/asm/xstate.h
index ebeb2a3dcaf9..6144ed6f8551 100644
--- a/xen/arch/x86/include/asm/xstate.h
+++ b/xen/arch/x86/include/asm/xstate.h
@@ -14,6 +14,7 @@
 
 #define FCW_DEFAULT               0x037f
 #define FCW_RESET                 0x0040
+#define FTW_RESET                 0xFF
 #define MXCSR_DEFAULT             0x1f80
 
 extern uint32_t mxcsr_mask;
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 14:21:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 14:21:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776348.1186463 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdsP9-0006q9-Mc; Tue, 13 Aug 2024 14:21:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776348.1186463; Tue, 13 Aug 2024 14:21:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdsP9-0006oy-Hh; Tue, 13 Aug 2024 14:21:43 +0000
Received: by outflank-mailman (input) for mailman id 776348;
 Tue, 13 Aug 2024 14:21:42 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=EOoy=PM=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sdsP8-0006mt-FM
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 14:21:42 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5b718e29-597f-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 16:21:40 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5af51684d52so5999063a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 07:21:40 -0700 (PDT)
Received: from EMEAENGAAD19049.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f414e3basm73540966b.164.2024.08.13.07.21.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 13 Aug 2024 07:21:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5b718e29-597f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723558899; x=1724163699; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=fHqLGGO5tY3MJJjvPDYymgHnYwN09knhW+0e175iaHo=;
        b=f8wby6C/BCHMLhiHO+xuxsX02fp+IwsPkTrFNuA1LKFmNHDiaG+jUCbitHZo3wSTd5
         NTnkveyes4ZHlMgwpBRH9OGDEq0koOSki93Vp+fDRiFmZBLVh5/YZOJbZaUz6Zy08nNi
         p79hLeO0//a8g74lN4gSL2T483Kyn6I6LHrDE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723558899; x=1724163699;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=fHqLGGO5tY3MJJjvPDYymgHnYwN09knhW+0e175iaHo=;
        b=d7pD/TxaBO2C/NUadU0M+0QOUDN+ebyMqnW3WQfA8nf0v+DAPlCtsE5M5ILysJJ1C9
         RvcwaJs5Gb8Uy4HNDZ5BsvZ/iGI2U3QZyLDlEuq2QG8A0KUSEFo+HSNEBFSEqRtjNLcj
         27k0I3olHn132Tga0ckIn3dHd4tlpxJHJ8cPcAu87Cp61SerBdwxGksETs9pYoOOfeVJ
         TMwl+oNQYJumRhJC4lC57FpCHxRjw9btij/DAwLkM+s+QkOvD3G7u6sNEQl5Z7glc2uq
         QzkPKntqaNBxq0Ui6Tmuwqg+4EdkpxICzzn7rmimcZXZr0ZvUkfGMnBCi6DZw04JzWQk
         X1fg==
X-Gm-Message-State: AOJu0Yw5JZQFIZ9UKFW8tP6tbi1O9X7Lx5yr+fXwh6zvFevB/4C0WY+o
	OM/otMbCmfe1sPV9qh91A0HWunT45m++6XWXNP8wg3qzHZtc3jSvUFSBds4lGP3SLuCOVLzpdm2
	K
X-Google-Smtp-Source: AGHT+IGtQFYWG4HZWjMh3SD3M9MAmsCh41T4WNpZlCfbgbn6BaHtGEgS/xhAxs3gi6VVnjG2dn5S4Q==
X-Received: by 2002:a17:907:efe5:b0:a7a:aa35:408d with SMTP id a640c23a62f3a-a80ed1d679dmr289106766b.20.1723558899234;
        Tue, 13 Aug 2024 07:21:39 -0700 (PDT)
From: Alejandro Vallejo <alejandro.vallejo@cloud.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v3 1/2] x86/fpu: Combine fpu_ctxt and xsave_area in arch_vcpu
Date: Tue, 13 Aug 2024 15:21:18 +0100
Message-ID: <20240813142119.29012-2-alejandro.vallejo@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <20240813142119.29012-1-alejandro.vallejo@cloud.com>
References: <20240813142119.29012-1-alejandro.vallejo@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

fpu_ctxt is either a pointer to the legacy x87/SSE save area (used by FXSAVE) or
a pointer aliased with xsave_area that points to its fpu_sse subfield. Such
subfield is at the base and is identical in size and layout to the legacy
buffer.

This patch merges the 2 pointers in the arch_vcpu into a single XSAVE area. In
the very rare case in which the host doesn't support XSAVE all we're doing is
wasting a tiny amount of memory and trading those for a lot more simplicity in
the code.

Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
---
v3:
  * Reverse memcpy() and BUILD_BUG_ON()
  * Use sizeof(arg) rather than sizeof(type)
---
 xen/arch/x86/domctl.c             |  6 ++++-
 xen/arch/x86/hvm/emulate.c        |  4 +--
 xen/arch/x86/hvm/hvm.c            |  6 ++++-
 xen/arch/x86/i387.c               | 45 +++++--------------------------
 xen/arch/x86/include/asm/domain.h |  8 +++---
 xen/arch/x86/x86_emulate/blk.c    |  3 ++-
 xen/arch/x86/xstate.c             | 13 ++++++---
 7 files changed, 34 insertions(+), 51 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 68b5b46d1a83..63fbceac0911 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1344,7 +1344,11 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c)
 #define c(fld) (c.nat->fld)
 #endif
 
-    memcpy(&c.nat->fpu_ctxt, v->arch.fpu_ctxt, sizeof(c.nat->fpu_ctxt));
+    BUILD_BUG_ON(sizeof(c.nat->fpu_ctxt) !=
+                 sizeof(v->arch.xsave_area->fpu_sse));
+    memcpy(&c.nat->fpu_ctxt, &v->arch.xsave_area->fpu_sse,
+           sizeof(c.nat->fpu_ctxt));
+
     if ( is_pv_domain(d) )
         c(flags = v->arch.pv.vgc_flags & ~(VGCF_i387_valid|VGCF_in_kernel));
     else
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index feb4792cc567..03020542c3ba 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -2363,7 +2363,7 @@ static int cf_check hvmemul_get_fpu(
         alternative_vcall(hvm_funcs.fpu_dirty_intercept);
     else if ( type == X86EMUL_FPU_fpu )
     {
-        const fpusse_t *fpu_ctxt = curr->arch.fpu_ctxt;
+        const fpusse_t *fpu_ctxt = &curr->arch.xsave_area->fpu_sse;
 
         /*
          * Latch current register state so that we can back out changes
@@ -2403,7 +2403,7 @@ static void cf_check hvmemul_put_fpu(
 
     if ( aux )
     {
-        fpusse_t *fpu_ctxt = curr->arch.fpu_ctxt;
+        fpusse_t *fpu_ctxt = &curr->arch.xsave_area->fpu_sse;
         bool dval = aux->dval;
         int mode = hvm_guest_x86_mode(curr);
 
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index f49e29faf753..76bbb645b77a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -916,7 +916,11 @@ static int cf_check hvm_save_cpu_ctxt(struct vcpu *v, hvm_domain_context_t *h)
 
     if ( v->fpu_initialised )
     {
-        memcpy(ctxt.fpu_regs, v->arch.fpu_ctxt, sizeof(ctxt.fpu_regs));
+        BUILD_BUG_ON(sizeof(ctxt.fpu_regs) !=
+                     sizeof(v->arch.xsave_area->fpu_sse));
+        memcpy(ctxt.fpu_regs, &v->arch.xsave_area->fpu_sse,
+               sizeof(ctxt.fpu_regs));
+
         ctxt.flags = XEN_X86_FPU_INITIALISED;
     }
 
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 134e0bece519..fbb9d3584a3d 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -39,7 +39,7 @@ static inline void fpu_xrstor(struct vcpu *v, uint64_t mask)
 /* Restore x87 FPU, MMX, SSE and SSE2 state */
 static inline void fpu_fxrstor(struct vcpu *v)
 {
-    const fpusse_t *fpu_ctxt = v->arch.fpu_ctxt;
+    const fpusse_t *fpu_ctxt = &v->arch.xsave_area->fpu_sse;
 
     /*
      * Some CPUs don't save/restore FDP/FIP/FOP unless an exception
@@ -151,7 +151,7 @@ static inline void fpu_xsave(struct vcpu *v)
 /* Save x87 FPU, MMX, SSE and SSE2 state */
 static inline void fpu_fxsave(struct vcpu *v)
 {
-    fpusse_t *fpu_ctxt = v->arch.fpu_ctxt;
+    fpusse_t *fpu_ctxt = &v->arch.xsave_area->fpu_sse;
     unsigned int fip_width = v->domain->arch.x87_fip_width;
 
     if ( fip_width != 4 )
@@ -212,7 +212,7 @@ void vcpu_restore_fpu_nonlazy(struct vcpu *v, bool need_stts)
      * above) we also need to restore full state, to prevent subsequently
      * saving state belonging to another vCPU.
      */
-    if ( v->arch.fully_eager_fpu || (v->arch.xsave_area && xstate_all(v)) )
+    if ( v->arch.fully_eager_fpu || xstate_all(v) )
     {
         if ( cpu_has_xsave )
             fpu_xrstor(v, XSTATE_ALL);
@@ -299,44 +299,14 @@ void save_fpu_enable(void)
 /* Initialize FPU's context save area */
 int vcpu_init_fpu(struct vcpu *v)
 {
-    int rc;
-
     v->arch.fully_eager_fpu = opt_eager_fpu;
-
-    if ( (rc = xstate_alloc_save_area(v)) != 0 )
-        return rc;
-
-    if ( v->arch.xsave_area )
-        v->arch.fpu_ctxt = &v->arch.xsave_area->fpu_sse;
-    else
-    {
-        BUILD_BUG_ON(__alignof(v->arch.xsave_area->fpu_sse) < 16);
-        v->arch.fpu_ctxt = _xzalloc(sizeof(v->arch.xsave_area->fpu_sse),
-                                    __alignof(v->arch.xsave_area->fpu_sse));
-        if ( v->arch.fpu_ctxt )
-        {
-            fpusse_t *fpu_sse = v->arch.fpu_ctxt;
-
-            fpu_sse->fcw = FCW_DEFAULT;
-            fpu_sse->mxcsr = MXCSR_DEFAULT;
-        }
-        else
-            rc = -ENOMEM;
-    }
-
-    return rc;
+    return xstate_alloc_save_area(v);
 }
 
 void vcpu_setup_fpu(struct vcpu *v, struct xsave_struct *xsave_area,
                     const void *data, unsigned int fcw_default)
 {
-    /*
-     * For the entire function please note that vcpu_init_fpu() (above) points
-     * v->arch.fpu_ctxt into v->arch.xsave_area when XSAVE is available. Hence
-     * accesses through both pointers alias one another, and the shorter form
-     * is used here.
-     */
-    fpusse_t *fpu_sse = v->arch.fpu_ctxt;
+    fpusse_t *fpu_sse = &v->arch.xsave_area->fpu_sse;
 
     ASSERT(!xsave_area || xsave_area == v->arch.xsave_area);
 
@@ -373,10 +343,7 @@ void vcpu_setup_fpu(struct vcpu *v, struct xsave_struct *xsave_area,
 /* Free FPU's context save area */
 void vcpu_destroy_fpu(struct vcpu *v)
 {
-    if ( v->arch.xsave_area )
-        xstate_free_save_area(v);
-    else
-        xfree(v->arch.fpu_ctxt);
+    xstate_free_save_area(v);
 }
 
 /*
diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index bca3258d69ac..3da60af2a44a 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -592,11 +592,11 @@ struct pv_vcpu
 struct arch_vcpu
 {
     /*
-     * guest context (mirroring struct vcpu_guest_context) common
-     * between pv and hvm guests
+     * Guest context common between PV and HVM guests. Includes general purpose
+     * registers, segment registers and other parts of the exception frame.
+     *
+     * It doesn't contain FPU state, as that lives in xsave_area instead.
      */
-
-    void              *fpu_ctxt;
     struct cpu_user_regs user_regs;
 
     /* Debug registers. */
diff --git a/xen/arch/x86/x86_emulate/blk.c b/xen/arch/x86/x86_emulate/blk.c
index e790f4f90056..28b54f26fe29 100644
--- a/xen/arch/x86/x86_emulate/blk.c
+++ b/xen/arch/x86/x86_emulate/blk.c
@@ -11,7 +11,8 @@
     !defined(X86EMUL_NO_SIMD)
 # ifdef __XEN__
 #  include <asm/xstate.h>
-#  define FXSAVE_AREA current->arch.fpu_ctxt
+#  define FXSAVE_AREA ((struct x86_fxsr *) \
+                           (void *)&current->arch.xsave_area->fpu_sse)
 # else
 #  define FXSAVE_AREA get_fpu_save_area()
 # endif
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 5c4144d55e89..850ee31bd18c 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -507,9 +507,16 @@ int xstate_alloc_save_area(struct vcpu *v)
     unsigned int size;
 
     if ( !cpu_has_xsave )
-        return 0;
-
-    if ( !is_idle_vcpu(v) || !cpu_has_xsavec )
+    {
+        /*
+         * This is bigger than FXSAVE_SIZE by 64 bytes, but it helps treating
+         * the FPU state uniformly as an XSAVE buffer even if XSAVE is not
+         * available in the host. Note the alignment restriction of the XSAVE
+         * area are stricter than those of the FXSAVE area.
+         */
+        size = XSTATE_AREA_MIN_SIZE;
+    }
+    else if ( !is_idle_vcpu(v) || !cpu_has_xsavec )
     {
         size = xsave_cntxt_size;
         BUG_ON(size < XSTATE_AREA_MIN_SIZE);
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 14:33:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 14:33:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776375.1186488 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdsZy-0001kn-V6; Tue, 13 Aug 2024 14:32:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776375.1186488; Tue, 13 Aug 2024 14:32:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdsZy-0001kg-SV; Tue, 13 Aug 2024 14:32:54 +0000
Received: by outflank-mailman (input) for mailman id 776375;
 Tue, 13 Aug 2024 14:32:53 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdsZx-0001ka-Mc
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 14:32:53 +0000
Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com
 [2a00:1450:4864:20::62c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eb9125c2-5980-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 16:32:51 +0200 (CEST)
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-a7a843bef98so92292366b.2
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 07:32:51 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f411bdc0sm74254166b.118.2024.08.13.07.32.50
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 07:32:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eb9125c2-5980-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723559571; x=1724164371; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=Q+jIfCnMul7T+8VekLcYK+HUC6tkq529KeTfF6Amox4=;
        b=LlSnu3rJrFJCNa5J8CqDUgoLZ0Cqpglfx6lQDIBKHh9eymr6pXZ5a754miwDXAOsga
         u3yDH69PJlEZ3PSbcksNLsZASv8jtN4Ms5zAa/VCLwNY9WJ5O82oXqZx4KcHUAKsV4Bv
         y+OPlwqvQXaiPIyC5yc+NagSMMFW5BRQyC/n1uAt6yoqrapnMCi8o+ldBx2nSdQKCYmp
         FduwsogIjWeTjX8Ho05ZPXbZ7LTQSDsmEQWBfbxhHn68VU8og3ymRzMuySs73Bk5yzxR
         kfc8Z/1hRRybSkEXULo3CLCpPSsZ+HtiEJtMlFerg6L6z8fWmHgHufTuo1tHa47liOhR
         Zhvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723559571; x=1724164371;
        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=Q+jIfCnMul7T+8VekLcYK+HUC6tkq529KeTfF6Amox4=;
        b=gW645jrXHoY2Aav0gibdngaYknAfRdN6el1FsPdAikWO9W79jgx4gGPC28me8hJ1vt
         pJQ0PZ+tZUZ9X5BzNV74wWfplxl+p9x5nCJL8QRoaylUnqRcfPe4FOp5f79ARQeNMe17
         1stjMqjfO07HTsoEDHq1OpjRb5aJjD4KHLkz5LNBEd691YYDkVF0MAyQlU+3i00PnLfE
         4xgxm5N6P04Ao5xNLk7DW7VRKC0lclM3BhIwqwByh63ILyNPtTUr90Jgm96QOoIL6uSn
         f1pdEwVuDt8z41f2xyFEAL27f/qMD3dNDi9wtyHUyKWGspE4o7klwOSpC+YYIvlroKtB
         +DDA==
X-Forwarded-Encrypted: i=1; AJvYcCWbjg3UVUKnPSGXks8+1LIoOv9KPhIsQAgnQL6Bbo3inF/uYQ1diLE08ZZSr+RMNf4D3RoseWIERKP8vG6KUp52amkkj3HdPANAu6VFx2Y=
X-Gm-Message-State: AOJu0YwhYsSodaoy4Jhj3MMC8gAKcGpPp3Sikipxw9nbEbiZ56Lhie2b
	Zs3kcP1wz61sav/N3Q+5lYjEwWacS+UMRAtYr0sVewU7Uw6D4prrs+jmakk2Aw==
X-Google-Smtp-Source: AGHT+IHw67pHD1kmhjEOD75xGZJMRUJNpiGLniNKfCxcMKh9uDk0EivYwq3ZEBYC/fcEwu/2ih5sFw==
X-Received: by 2002:a17:907:efc8:b0:a80:7193:bd88 with SMTP id a640c23a62f3a-a80ed258a0fmr299388066b.36.1723559570943;
        Tue, 13 Aug 2024 07:32:50 -0700 (PDT)
Message-ID: <c83942d9-bb55-45c2-9a44-314266ce14c0@suse.com>
Date: Tue, 13 Aug 2024 16:32:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/2] x86/fpu: Split fpu_setup_fpu() in three
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240813142119.29012-1-alejandro.vallejo@cloud.com>
 <20240813142119.29012-3-alejandro.vallejo@cloud.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: <20240813142119.29012-3-alejandro.vallejo@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 13.08.2024 16:21, Alejandro Vallejo wrote:
> It was trying to do too many things at once and there was no clear way of
> defining what it was meant to do. This commit splits the function in three.
> 
>   1. A function to return the FPU to power-on reset values.
>   2. A function to return the FPU to default values.
>   3. A x87/SSE state loader (equivalent to the old function when it took a data
>      pointer).
> 
> While at it, make sure the abridged tag is consistent with the manuals and
> start as 0xFF.
> 
> Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

> ---
> v3:
>   * Adjust commit message, as the split is now in 3.
>   * Remove bulky comment, as the rationale for it turned out to be
>     unsubstantiated. I can't find proof in xen-devel of the stream
>     operating the way I claimed, and at that point having the comment
>     at all is pointless

So you deliberately removed the comment altogether, not just point 3 of it?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 15:17:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 15:17:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776405.1186558 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdtGl-0001b8-RM; Tue, 13 Aug 2024 15:17:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776405.1186558; Tue, 13 Aug 2024 15:17:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdtGl-0001b1-OH; Tue, 13 Aug 2024 15:17:07 +0000
Received: by outflank-mailman (input) for mailman id 776405;
 Tue, 13 Aug 2024 15:17: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=ynFR=PM=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sdtGk-0001av-Jy
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 15:17:06 +0000
Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com
 [2a00:1450:4864:20::12c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 15de13c6-5987-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 17:16:59 +0200 (CEST)
Received: by mail-lf1-x12c.google.com with SMTP id
 2adb3069b0e04-52efc60a6e6so7455340e87.1
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 08:16:59 -0700 (PDT)
Received: from [192.168.1.10] (host-92-26-98-202.as13285.net. [92.26.98.202])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-429c7fab973sm139802975e9.43.2024.08.13.08.16.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 08:16:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 15de13c6-5987-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723562219; x=1724167019; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=P/6wPJg8aqBR+MdWID8Uj7flyU4c/Mk7eHRI0AvcN2U=;
        b=c6ih0Zn0w9udjoJeQuc5R4p6PS/lzyByIXoLAxnhsa/94NZ7WjBkCtk4MI+/246yR9
         SMMu1WS2JS7b9I6sgT+Y8A7lMaWSXJerOiOEkTaGpmi8r/RmdigDJiXyV8pSvLeLZLLj
         d1gevl2X5i8xMuFNx3RzAFDXapFv7whg7IIB4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723562219; x=1724167019;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=P/6wPJg8aqBR+MdWID8Uj7flyU4c/Mk7eHRI0AvcN2U=;
        b=d0k0faoN2o204ji9d7tlVK2WfWW/1hWURMKCwPSfuK5iN/Kjdn4fLMgqXIM6j4tWMI
         6qK9CEBsnyUSaRngQ7h2u87qKNXnuLegRiOPOscPTIEsXy+47P4h2B6tuZFhG5BEUg3j
         fAHhkKuEz2ekTSboP/WzCAcEOk8HY06OpOSdDIJ4TaZ0V3YhygS+EyLnFvG9yIZrZ7Kt
         KSo3jyriHWQJQOb60TlLLU+7WIN5g17oqZQ49d7H6F6676AcicrI06sSeksOIJe+QHho
         nfxEZBqFQDpK4LYuaZpRfEtXD+YygKdEodZ1IGlsDpUhsTUeLduaju/M8UGMXKNjOscU
         Ot5g==
X-Forwarded-Encrypted: i=1; AJvYcCVtCG8hTI8GbvjD+GBOlWRkK58lsDblSqrkzEFBm7ZixTLWX5M9rhfwDliDZtY7fdJ5/MASn0JGE539Ii/KkhnlPnrw3Sg1OTO7WBBuoUM=
X-Gm-Message-State: AOJu0YxGQ3w+Y16edsRbdhDRkFoK4BJn5cCPPaokppnyE9r1xPSuS9t7
	s1ICDeCalNrlqh7YEAZp2mvaw+r+DW4GJOY/G1MjjugJw1rZU8uFot66Vd0G3DU=
X-Google-Smtp-Source: AGHT+IHEpXOthdbTqmOZyH+h7Xc/lrvYXocF95uysip0fR8mJ1LDsm96ua4rrhVIwcFUc1Z/fFM4Gw==
X-Received: by 2002:a05:6512:b94:b0:52c:dba6:b4cb with SMTP id 2adb3069b0e04-53213657bc6mr2499399e87.13.1723562218734;
        Tue, 13 Aug 2024 08:16:58 -0700 (PDT)
Message-ID: <e4f923c9-5b30-4876-bcf1-7a229b59fb21@citrix.com>
Date: Tue, 13 Aug 2024 16:16:57 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: fix UB multiplications in S/G handling
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <7c4cb0ee-cddf-434a-95d9-58cec0efd976@suse.com>
 <56e05b29-0fad-426b-bfec-60080e83b3ca@citrix.com>
Content-Language: en-GB
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <56e05b29-0fad-426b-bfec-60080e83b3ca@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 13/08/2024 2:19 pm, Andrew Cooper wrote:
> On 13/08/2024 1:43 pm, Jan Beulich wrote:
>> The conversion of the shifts to multiplications by the commits tagged
>> below still wasn't quite right: The multiplications (of signed values)
>> can overflow, too. As of 298556c7b5f8 ("x86emul: correct 32-bit address
>> handling for AVX2 gathers") signed multiplication wasn't necessary
>> anymore, though: The necessary sign-extension (if any) will happen as
>> well when using intermediate variables of unsigned long types, and
>> excess address bits are chopped off by truncate_ea().
>>
>> Fixes: b6a907f8c83d ("x86emul: replace UB shifts")
>> Fixes: 21de9680eb59 ("x86emul: replace further UB shifts")
>> Oss-fuzz: 71138

It's too late on this one, but it occurs to me that we probably want

Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=71138

rather than an abstract Oss-fuzz number.  The bugtracker entry becomes
public after 90d or when ClusterFuzz thinks we've fixed the bug, and the
full link will be more useful to anyone interested.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 15:19:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 15:19:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776411.1186568 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdtIf-00027J-4j; Tue, 13 Aug 2024 15:19:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776411.1186568; Tue, 13 Aug 2024 15:19:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdtIf-00027C-1w; Tue, 13 Aug 2024 15:19:05 +0000
Received: by outflank-mailman (input) for mailman id 776411;
 Tue, 13 Aug 2024 15:19:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdtIe-000276-I7
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 15:19:04 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5f250aff-5987-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 17:19:02 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5b9d48d1456so2364492a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 08:19:02 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd190ad278sm2979959a12.25.2024.08.13.08.19.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 08:19:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5f250aff-5987-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723562342; x=1724167142; 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=eZ/5L892y3kunmVjf8Ugby3F+fwY654SOA/cA+W8thY=;
        b=AIHIbwkD4nfQvnozxmevoilZmHKrSxBmRmsK9PljIB2N+tuxoOTljUc4ZzgCw0DwbM
         iNtTrf4lIZB2CFN6eva6SqMfRHl2nXOGlZWK9Zt6BnOSLrZM4j8mc7qhfWk6YFwCYD/S
         f4OwDEc9dcmNDyMYCwT7CMHRY/YmpQpavxyMzwcbYNR3Lihe+3eRE5VEn74mRuXavXmM
         JJDuyo0gkg+w3NUDjj+mzt1uSpXrv5sVHTPQcI5zQGR7ziaHCy662CXT21nO+qyIkzOB
         iTczaHn7ljCGn2Er0zX6EyQeUFuavlE/xrHO5EUEDBC7LfQrWXllnYWpanyGK8nQvIqR
         BjJQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723562342; x=1724167142;
        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=eZ/5L892y3kunmVjf8Ugby3F+fwY654SOA/cA+W8thY=;
        b=o0XTAR76b/1oCGhcKcvj/O5BfTdNSaF524/YR4J7i55imkIub/N2qI2IxYLKM0Ul7S
         c8I0gDFS9eD2WuS9PjepWgr6PV7HocoEf+8g5e53irlD0KYkXutUPCxYYK8ikqo0AcPm
         jT5xylT42uMPwvF37xVqGDXy7K+QVM3UJqGQUd/ACI/HER8R9+qx6N+tG06bsGERr1fg
         LnrLWoeP4R3i2UJOh3daRp5e5rNVyYtqL6mTlVeMHKpRJ+lYM0ppcsbef1ewkYRo3B7F
         ypjB576mhHhCcVhErvQXFbcZeuGKRFbxd0vwY+pC6LfSOQVmuprURwocLyVCh7OoHTcC
         jOQA==
X-Forwarded-Encrypted: i=1; AJvYcCUVTB83/s8T37sJ787xRfAwD3BcYAkTyXP6B/zH9YEEJAueypZ3bXMVpzHCH19+CZ4vcGMRUHXsvzZRkahaN1YtqcWDDrc35e9Em5rrMuQ=
X-Gm-Message-State: AOJu0Yz4Lkt2iAduwjUQnTjJufGPdSfVp+YTj72scxZUkYTw4V32qRl5
	1VZX8E20sSaNvV3q1SvpTLX43Iwx/yNeDNbF4FrhIlf3ZV7vAttDWl5g2/HUlw==
X-Google-Smtp-Source: AGHT+IF1tA5UubjX5AWzIoy8z2Yk3PqurQgRzJTY9GD/pe3Ei9t0E7T8dZr0hScfDEfCZQUueMewZQ==
X-Received: by 2002:a05:6402:354a:b0:5a1:4ca9:c667 with SMTP id 4fb4d7f45d1cf-5bea1467722mr39589a12.11.1723562341857;
        Tue, 13 Aug 2024 08:19:01 -0700 (PDT)
Message-ID: <4be03d64-ad6b-4367-b1b7-d54c3ac5ca37@suse.com>
Date: Tue, 13 Aug 2024 17:19:00 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: fix UB multiplications in S/G handling
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <7c4cb0ee-cddf-434a-95d9-58cec0efd976@suse.com>
 <56e05b29-0fad-426b-bfec-60080e83b3ca@citrix.com>
 <e4f923c9-5b30-4876-bcf1-7a229b59fb21@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <e4f923c9-5b30-4876-bcf1-7a229b59fb21@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 13.08.2024 17:16, Andrew Cooper wrote:
> On 13/08/2024 2:19 pm, Andrew Cooper wrote:
>> On 13/08/2024 1:43 pm, Jan Beulich wrote:
>>> The conversion of the shifts to multiplications by the commits tagged
>>> below still wasn't quite right: The multiplications (of signed values)
>>> can overflow, too. As of 298556c7b5f8 ("x86emul: correct 32-bit address
>>> handling for AVX2 gathers") signed multiplication wasn't necessary
>>> anymore, though: The necessary sign-extension (if any) will happen as
>>> well when using intermediate variables of unsigned long types, and
>>> excess address bits are chopped off by truncate_ea().
>>>
>>> Fixes: b6a907f8c83d ("x86emul: replace UB shifts")
>>> Fixes: 21de9680eb59 ("x86emul: replace further UB shifts")
>>> Oss-fuzz: 71138
> 
> It's too late on this one, but it occurs to me that we probably want
> 
> Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=71138
> 
> rather than an abstract Oss-fuzz number.  The bugtracker entry becomes
> public after 90d or when ClusterFuzz thinks we've fixed the bug, and the
> full link will be more useful to anyone interested.

I can try to remember doing so going forward. Let me adjust the one that's
still pending right away.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 15:50:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 15:50:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776426.1186578 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdtnN-0008Db-AM; Tue, 13 Aug 2024 15:50:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776426.1186578; Tue, 13 Aug 2024 15:50:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdtnN-0008DU-7J; Tue, 13 Aug 2024 15:50:49 +0000
Received: by outflank-mailman (input) for mailman id 776426;
 Tue, 13 Aug 2024 15:50:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdtnM-0008DK-9c; Tue, 13 Aug 2024 15:50:48 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdtnM-0000gI-63; Tue, 13 Aug 2024 15:50:48 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdtnL-00067Z-Kh; Tue, 13 Aug 2024 15:50:47 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sdtnL-0003gM-K5; Tue, 13 Aug 2024 15:50:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=m3woQuJZOsTr9WFJV3sm1xZ+b4/aymYKM53xOmRsy/8=; b=HyAH/nfWzh570hcgrG1zM2yAej
	kVwVs3L0DCSKsQGV59iJ508DqfEa8ePkhlpHWJQOFXw0b3fU0LLPv7fERDQM6ELgMPEMWErxAHND6
	RZRFjBK6C4gK3pUSL8je4TOpB3gn+uYXEnCIXwX6Af68uR4Mc52XeQSIjvi0R9e8rRPE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187223-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187223: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-examine:reboot:fail:regression
    linux-linus:test-arm64-arm64-xl-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-xsm:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-vhd:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit2:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-credit1:xen-boot:fail:regression
    linux-linus:test-arm64-arm64-xl-thunderx:xen-boot:fail:regression
    linux-linus:test-armhf-armhf-xl-qcow2:host-ping-check-xen:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=d74da846046aeec9333e802f5918bd3261fb5509
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 13 Aug 2024 15:50:47 +0000

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

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-examine      8 reboot                   fail REGR. vs. 186827
 test-arm64-arm64-xl-xsm       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-xsm  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-vhd       8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit2   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl           8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-libvirt-raw  8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-credit1   8 xen-boot                 fail REGR. vs. 186827
 test-arm64-arm64-xl-thunderx  8 xen-boot                 fail REGR. vs. 186827

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-qcow2    10 host-ping-check-xen        fail pass in 187218

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

version targeted for testing:
 linux                d74da846046aeec9333e802f5918bd3261fb5509
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   27 days
Failing since        186925  2024-07-20 09:44:52 Z   24 days   53 attempts
Testing same since   187218  2024-08-12 21:12:09 Z    0 days    2 attempts

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

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


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

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

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

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


Not pushing.

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


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 15:54:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 15:54:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776437.1186588 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdtrN-0000Rj-Vo; Tue, 13 Aug 2024 15:54:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776437.1186588; Tue, 13 Aug 2024 15:54:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdtrN-0000Rc-SY; Tue, 13 Aug 2024 15:54:57 +0000
Received: by outflank-mailman (input) for mailman id 776437;
 Tue, 13 Aug 2024 15:54: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=Wdkt=PM=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sdtrN-0000RM-4s
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 15:54:57 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6305f7a4-598c-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 17:54:56 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-530ae4ef29dso10401022e87.3
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 08:54:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f3f4c443sm79348966b.3.2024.08.13.08.54.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 08:54:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6305f7a4-598c-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723564496; x=1724169296; 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=/4h7H3HtJRtg+3PNRDxCsr1WajvrUoqmTVHdGiWOvXk=;
        b=WqcmtWRKqUqj7/w0LDiY0WnNkWpo4PNIdBf5vykid3Xjbbzbwc3s2wSiJdsG8lgbIk
         3mEwaoBys0mkrGb66Gpmw7k/8Tn/kGlHN8iQLzB7TUJlUKIw5RyZIlFnB5s/Fi0HfbFd
         FrD7p6MSeAz+cYa97SMEOP9+WwKZ6vtBwKoPyLGdBTPgRm6US+QzWDk1Lp7ls2OlvcWZ
         P/wh3wxBhbj7IJD2FS7x9DP1b+VeJEhZueJI12rGSPUHjyIqlaCvnb3eNqQKu5+eN7O7
         f5ZArYDUGVV6/iwj5M0XemustZvWAiu9hOGmGzx1gQ2Wpet3kcYvB61+MivlUiptV8mL
         kdAg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723564496; x=1724169296;
        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=/4h7H3HtJRtg+3PNRDxCsr1WajvrUoqmTVHdGiWOvXk=;
        b=P00QQCLKYVV0OtsDrGHetAtRZ0f1NBEBIYMNoLdoIu3+mxtEBsezUPu5MKI/SOO6fk
         H7gNGwBL3V9lGgU3J2cIUmDyPEcrBfcEl/n7bhi27lrOlPVWw4zhhflI7eRcE6S+B9d3
         +AnUa9PwdvKoo1qmMQzUASdnbBYTwMSu5/j4dg6oczO9D6AKv8heYQ4LjsTem67qvm9k
         0KoUSEWzXFRZilPdKYvhaRc7zUajXGKzRmwY9ql3y0W0JqqdPDha7U45TX4kq9ugMw8E
         4maqhTYcW4OaWOn3h1qVzl+HAvWAvV7K9ENHh9I87rPj5V1FpMqevkUsLWuE7rsVyDuJ
         olyQ==
X-Forwarded-Encrypted: i=1; AJvYcCXW6hofryuT6pzOSCrOI0detfv082WrIOnbvPCcb8VGc3IBJV6BnRsmXadBnqrEMqiSEtjywtxOF426Uy1mEfM++j6zbSCjroIdtRo86WM=
X-Gm-Message-State: AOJu0YzgDIUo3T0SclQHnCeweSXCTL01iklXQVTzOZOJPupzhMfIhwHq
	kb61l0Zut1IOrcUgKuOjN7VpdULOBG598Rco3WwtM1WuJWI5Eh00RgFp8fR3jg==
X-Google-Smtp-Source: AGHT+IE8kRTDO8fU5MX/cPTia1WhwQV6gmJM3nPP12UKR0LYNRcuhWzlluGH7ixbkMSXnBbJj/Adeg==
X-Received: by 2002:a05:6512:1190:b0:530:da96:a990 with SMTP id 2adb3069b0e04-53213659a4amr2976968e87.32.1723564495597;
        Tue, 13 Aug 2024 08:54:55 -0700 (PDT)
Message-ID: <550c6f14-228d-45b4-9146-8d950082b574@suse.com>
Date: Tue, 13 Aug 2024 17:54:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 04/22] x86/mm: ensure L4 idle_pg_table is not modified
 past boot
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: alejandro.vallejo@cloud.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20240726152206.28411-1-roger.pau@citrix.com>
 <20240726152206.28411-5-roger.pau@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240726152206.28411-5-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 26.07.2024 17:21, Roger Pau Monne wrote:
> The idle_pg_table L4 is cloned to create all the other L4 Xen uses, and hence
> it shouldn't be modified once further L4 are created.

Yes, but the window between moving into SYS_STATE_smp_boot and Dom0 having
its initial page tables created is quite large. If the justification was
relative to AP bringup, that may be all fine. But when related to cloning,
I think that would then truly want keying to there being any non-system
domain(s).

> --- a/xen/arch/x86/mm.c
> +++ b/xen/arch/x86/mm.c
> @@ -5023,6 +5023,12 @@ static l3_pgentry_t *virt_to_xen_l3e(unsigned long v)
>          mfn_t l3mfn;
>          l3_pgentry_t *l3t = alloc_mapped_pagetable(&l3mfn);
>  
> +        /*
> +         * dom0 is build at smp_boot, at which point we already create new L4s
> +         * based on idle_pg_table.
> +         */
> +        BUG_ON(system_state >= SYS_STATE_smp_boot);

Which effectively means most of this function could become __init (e.g. by
moving into a helper). We'd then hit the BUG_ON() prior to init_done()
destroying the .init.* mappings, and we'd simply #PF afterwards. That's
not so much for the space savings in .text, but to document the limited
lifetime of the (helper) function directly in its function head.

I further wonder whether in such a case the enclosing if() wouldn't want
to gain unlikely() at the same time.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 16:34:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 16:34:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776450.1186597 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sduT6-0007Pc-Q5; Tue, 13 Aug 2024 16:33:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776450.1186597; Tue, 13 Aug 2024 16:33:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sduT6-0007PV-NC; Tue, 13 Aug 2024 16:33:56 +0000
Received: by outflank-mailman (input) for mailman id 776450;
 Tue, 13 Aug 2024 16:33:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=EOoy=PM=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sduT5-0007PP-A4
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 16:33:55 +0000
Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com
 [2a00:1450:4864:20::52f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d312d730-5991-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 18:33:52 +0200 (CEST)
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5bb8e62575eso2222236a12.3
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 09:33:52 -0700 (PDT)
Received: from localhost ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd343e484esm1913466a12.95.2024.08.13.09.33.50
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 09:33:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d312d730-5991-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723566831; x=1724171631; darn=lists.xenproject.org;
        h=in-reply-to:references:cc:to:from:subject:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=x0qShhTQymlQRj8RBJVu0uLqhFXz8Uwy5O32YELhPXE=;
        b=cafDcfhZstKOJUOvIMvIGFNQm1A2im4qDtu4hk3H9aCuaZZSPw/G9aqciIDAXKjOec
         XhDgeHxMSTOIV+tMwnMkebo4DQPLQENXELIqTOSvPCiGNeucVq0ltxgm2tQf1fJhCxbS
         OGcb0UT03G2XboE5091SaxEpD2QfidnlSzSsA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723566831; x=1724171631;
        h=in-reply-to:references:cc:to:from:subject:message-id:date
         :content-transfer-encoding:mime-version:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=x0qShhTQymlQRj8RBJVu0uLqhFXz8Uwy5O32YELhPXE=;
        b=lMj+9/0El180kr3k+n4k2y+8CAOHmLyv98ioLHOX9AQNdo5A4eSwCx26hhZHKRgYR9
         I4sKagSQRNbHVL3A5tMVD87GOxukPolI2O5i8cagPaaLLzVTKazx6eP6BLd+UofdCHBL
         bgj9mR1uyHZQCA+gcB/nU+cDSZwE6LHzzTEFKVhUR65Z1bVkejV5Z/GDnFIhgIse6xs6
         5ynijc5Z1I8u5ePKF7qB4pdHr9nqlvZY/ZOL1sMf+IIwksM6Uhm+Hb+8Qw5Gl2CRpTEu
         xYGcJ7yYDKX3Nq0pqTHJBgT62/5BiuR8Me6UQLVjDXw9rIL5qkGmu9naR5huGmQgFHXL
         I9ow==
X-Forwarded-Encrypted: i=1; AJvYcCWGyjk1wFZoAAs7IOFITD2F3Ayh4yYNOr0AvBTkDGM+xTVjlKakamvcUwjMnIwDJTT9hreX2pvLitPhSc4z/nMngs2bLxuTFkHoKiuSmIY=
X-Gm-Message-State: AOJu0YxpPzqgc3+bilzk89Ffv0ACegX8UMKjs8riMGBbcDVBV8scuXPu
	Gr6R8ELD4U860QVOLL5V7SjukEHkVb/y+N7zQFvQjlqDl/FOn6vk2QK8XJ24YZ4=
X-Google-Smtp-Source: AGHT+IFiwaiEFXirdC6Wt6fyVq8saqaXmZU64ekcG7onN50GsIleC7SyfbgnWMvHzFIAUfV5Xw3C7w==
X-Received: by 2002:a05:6402:2549:b0:5a2:3df7:bb6a with SMTP id 4fb4d7f45d1cf-5bea1cb38f1mr48200a12.31.1723566831161;
        Tue, 13 Aug 2024 09:33:51 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Tue, 13 Aug 2024 17:33:49 +0100
Message-Id: <D3EXG6HDKMYR.15275C42NLLBL@cloud.com>
Subject: Re: [PATCH v3 2/2] x86/fpu: Split fpu_setup_fpu() in three
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Jan Beulich" <jbeulich@suse.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
 =?utf-8?q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, "Xen-devel"
 <xen-devel@lists.xenproject.org>
X-Mailer: aerc 0.17.0
References: <20240813142119.29012-1-alejandro.vallejo@cloud.com>
 <20240813142119.29012-3-alejandro.vallejo@cloud.com>
 <c83942d9-bb55-45c2-9a44-314266ce14c0@suse.com>
In-Reply-To: <c83942d9-bb55-45c2-9a44-314266ce14c0@suse.com>

On Tue Aug 13, 2024 at 3:32 PM BST, Jan Beulich wrote:
> On 13.08.2024 16:21, Alejandro Vallejo wrote:
> > It was trying to do too many things at once and there was no clear way =
of
> > defining what it was meant to do. This commit splits the function in th=
ree.
> >=20
> >   1. A function to return the FPU to power-on reset values.
> >   2. A function to return the FPU to default values.
> >   3. A x87/SSE state loader (equivalent to the old function when it too=
k a data
> >      pointer).
> >=20
> > While at it, make sure the abridged tag is consistent with the manuals =
and
> > start as 0xFF.
> >=20
> > Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>
> > ---
> > v3:
> >   * Adjust commit message, as the split is now in 3.
> >   * Remove bulky comment, as the rationale for it turned out to be
> >     unsubstantiated. I can't find proof in xen-devel of the stream
> >     operating the way I claimed, and at that point having the comment
> >     at all is pointless
>
> So you deliberately removed the comment altogether, not just point 3 of i=
t?
>
> Jan

Yes. The other two cases can be deduced pretty trivially from the condition=
al,
I reckon. I commented them more heavily in order to properly introduce (3),=
 but
seeing how it was all a midsummer dream might as well reduce clutter.

I got as far as the original implementation of XSAVE in Xen and it seems to
have been tested against many combinations of src and dst, none of which wa=
s
that ficticious "xsave enabled + xsave context missing". I suspect the
xsave_enabled(v) was merely avoiding writing to the XSAVE buffer just for
efficiency (however minor effect it might have had). I just reverse enginee=
ring
it wrong.

Which reminds me. Thanks for mentioning that, because it was really just
guesswork on my part.

Cheers,
Alejandro


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 16:58:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 16:58:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776461.1186607 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdurA-000350-Kn; Tue, 13 Aug 2024 16:58:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776461.1186607; Tue, 13 Aug 2024 16:58:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdurA-00034t-IG; Tue, 13 Aug 2024 16:58:48 +0000
Received: by outflank-mailman (input) for mailman id 776461;
 Tue, 13 Aug 2024 16:58:46 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tv38=PM=bounce.vates.tech=bounce-md_30504962.66bb90c2.v1-9abbdabd518f480499dff21353c628dc@srs-se1.protection.inumbo.net>)
 id 1sdur8-00034n-CH
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 16:58:46 +0000
Received: from mail135-13.atl141.mandrillapp.com
 (mail135-13.atl141.mandrillapp.com [198.2.135.13])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4c34b996-5995-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 18:58:44 +0200 (CEST)
Received: from pmta14.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail135-13.atl141.mandrillapp.com (Mailchimp) with ESMTP id
 4WjyJf3BtvzNCdJ0M
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 16:58:42 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 9abbdabd518f480499dff21353c628dc; Tue, 13 Aug 2024 16:58:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4c34b996-5995-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1723568322; x=1723828822;
	bh=vt0yScILe+G19ItC5DM4FFHAC7hnaAPVRlzZV5ULaWg=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=C2YJ/qJNjXRyPbhlX0QZPwTIDgZwvgb63oY29O8RQifEpPuZqJL5U2claiLcP+N7s
	 HlE0t31KmJ8+8JixW2VJVvwQuYxdsQUwSeaTAaPtJZt87RX+ZwmByEdGWQ7CspJSIF
	 wTvdtPZvWUc10OJ55g+yXTatHGMxBIF6fJo+dHZo7TwMFzWF81MeUf6wF8PEVS0bYn
	 1xpmVz0w9SWUgz/jHkC+XbNEFHOpBaxRX+HahopVjPLQHdaKgfXkZbyWh5QSPS5ME6
	 /TSc0lnrptsVlFNuX+dRVhovENPCj6keD6L6x1Ttyx3k3hJgmh9z72sL4QQX4fzY9v
	 T3ERfsiU2OC7A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1723568322; x=1723828822; i=anthony.perard@vates.tech;
	bh=vt0yScILe+G19ItC5DM4FFHAC7hnaAPVRlzZV5ULaWg=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=lMY5XBG2vmA6S2cvtTN1Mu9z6mtM+OOv9vFqj8xa6cIo2rwKqMAObrFY4ITAC7OBB
	 aU/zP+TzpCSWqS96EPVptE+cqVGFE9rCyFwMO+2eKf+5PPX3xbqgs12CIlR2n4ceIV
	 gaouul+fzPmY4U8uhy7S86fov9qO3lLGgBOTBapQjv9jSVKy9mHEmZIStsOsU+wuia
	 s39MEyf7Etqfb/7zO3BBcmyhetN1z0sGkSWzkc2b4DhjqUGdtQdQl/kekaCOIzFij9
	 /K3KeR0LBsEpSKydP7kCzgy/yaJQpQijrDueiHKAFvxDnlv7FkPxPl1VhFXQlaRzgj
	 aUcR22JbyU+bg==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH]=20libxl/disk:=20avoid=20aliasing=20of=20abs()?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1723568321404
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Juergen Gross <jgross@suse.com>, Jason Andryuk <jason.andryuk@amd.com>
Message-Id: <ZruQwD2bh7cOADfL@l14>
References: <ad3b9873-b478-4448-8395-498399040324@suse.com>
In-Reply-To: <ad3b9873-b478-4448-8395-498399040324@suse.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.9abbdabd518f480499dff21353c628dc?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240813:md
Date: Tue, 13 Aug 2024 16:58:42 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Tue, Aug 06, 2024 at 10:40:14AM +0200, Jan Beulich wrote:
> Tool chains with -Wshadow enabled by default won't like the function
> parameter name "abs", for aliasing stdlib.h's abs(). Rename the
> parameter to what other similar functions use.
> 
> Fixes: a18b50614d97 ("libxl: Enable stubdom cdrom changing")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Anthony PERARD <anthony.perard@vates.tech>

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 17:01:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 17:01:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776467.1186618 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdutT-0004Y7-1K; Tue, 13 Aug 2024 17:01:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776467.1186618; Tue, 13 Aug 2024 17:01:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdutS-0004Y0-Ul; Tue, 13 Aug 2024 17:01:10 +0000
Received: by outflank-mailman (input) for mailman id 776467;
 Tue, 13 Aug 2024 17:01:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=NddN=PM=bounce.vates.tech=bounce-md_30504962.66bb9150.v1-9dc6e5e91a9343d197bad6794c309536@srs-se1.protection.inumbo.net>)
 id 1sdutR-0004Xu-Qy
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 17:01:09 +0000
Received: from mail135-25.atl141.mandrillapp.com
 (mail135-25.atl141.mandrillapp.com [198.2.135.25])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a07d4101-5995-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 19:01:05 +0200 (CEST)
Received: from pmta14.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail135-25.atl141.mandrillapp.com (Mailchimp) with ESMTP id
 4WjyMN54FSz4f3k4w
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 17:01:04 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 9dc6e5e91a9343d197bad6794c309536; Tue, 13 Aug 2024 17:01:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a07d4101-5995-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1723568464; x=1723828964;
	bh=8msjE1uYcHOgMsjwb0WcL/eRD1wMP1aYn+7I4QHETYU=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=GNRiVkOkDXXmC7/s2JTHlnQP07zCbLYLKmdI97mseU66NLBtiR7f38Xon3Iu5Zn0/
	 ryml44wq9VhsJtlZegnA4X9jVKMqMqqHCis1MFyYDdJqNTFhwqNF97kpGILNpYlUps
	 1ws+gpwLG7D+aISYqdyZvfTvui63vx5RcgzZZVQ8pv2AGXtpgC8G9wFDajPAYVbvnf
	 rDIIo2KHfNfQBjszN+pZfw1CUu7Movfo4qzEDPXnliYyVNexRx5TKY6DCsvb2T7zgK
	 VR1zwqFfantlYtBzCpgsn6wB9lEJuGV+Us4SDSYwzOQl3zt5u1+ou9QUxxLxo23Vir
	 dMasFzZiv4Qrg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1723568464; x=1723828964; i=anthony.perard@vates.tech;
	bh=8msjE1uYcHOgMsjwb0WcL/eRD1wMP1aYn+7I4QHETYU=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=0Ca/ft5ezmuZwVfELgsrwKGLTF+Y//aavkIka/B4fY19RY4Zsf6cnY7EuG/N+uJws
	 bvyKoKAmGzhJU/5D3j7RWFmRdllZEw9LI5IBpZ6B/1zT4sNm+LikwdjADbeem01X4k
	 GiTc9B442DB+nFa2eWWzX016rZhxBQYFV0G+Ym4Jqr0LIavTEpefhrZbzhv3TACqHL
	 Wk5HDCMUy98460H5gRTZPQ+zIUqjLEzbM2/866k1W4MBUN51KzAV29jvrXMFXDOyg/
	 VB400Cf+8SBG1uLMhQms9sh6YiDqe+co+8pIKVcVxeb2Zl7UOnXavxU0tCP7muKEKr
	 0ag7NqxZkUOoA==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH]=20Fixed=20incorrect=20output=20in=20xl's=20"help"=20command.?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1723568463876
To: Juergen Gross <jgross@suse.com>
Cc: "John E. Krokes" <mag@netherworld.org>, xen-devel@lists.xenproject.org
Message-Id: <ZruRTzGtNxxvRPq2@l14>
References: <20240805141159.21872-1-mag@netherworld.org> <9988e590-e992-4d3e-b77b-5bde8c80d1cf@suse.com>
In-Reply-To: <9988e590-e992-4d3e-b77b-5bde8c80d1cf@suse.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.9dc6e5e91a9343d197bad6794c309536?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240813:md
Date: Tue, 13 Aug 2024 17:01:04 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Mon, Aug 05, 2024 at 04:14:34PM +0200, Juergen Gross wrote:
> On 05.08.24 16:11, John E. Krokes wrote:
> > In "xl help", the output includes this line:
> > 
> >   vsnd-list           List virtual display devices for a domain
> > 
> > This should obviously say "sound devices" instead of "display devices".
> > 
> > Signed-off-by: John E. Krokes <mag@netherworld.org>
> 
> Reviewed-by: Juergen Gross <jgross@suse.com>

Acked-by: Anthony PERARD <anthony.perard@vates.tech>

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 17:02:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 17:02:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776473.1186628 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sduuf-00054n-A8; Tue, 13 Aug 2024 17:02:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776473.1186628; Tue, 13 Aug 2024 17:02:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sduuf-00054g-7G; Tue, 13 Aug 2024 17:02:25 +0000
Received: by outflank-mailman (input) for mailman id 776473;
 Tue, 13 Aug 2024 17:02:24 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=RJb4=PM=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sduue-00054Y-IZ
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 17:02:24 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ceb8286d-5995-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 19:02:22 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-52efd8807aaso7623888e87.3
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 10:02:22 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f29203d817sm11755511fa.99.2024.08.13.10.02.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 13 Aug 2024 10:02:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ceb8286d-5995-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723568542; x=1724173342; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=JGJpkmzwhAHPEBfWQMTLg/zF6IPgm68M3yUmp2d77TM=;
        b=fLyyc+M8iuIjYKNkHmxRWOUEqWXnTH3rvAtnzg7HM01d3/X+mS/o+Xh3WkRpIwpZiz
         z1vABSn4woy8t2YyZoErE/1WnGfxJW7RdI2sVv4a20r0Nz/vuAp5Y9Ycr9caWv9BDdkj
         1zANWYlYYC/LAxMaXUcXPnboe+9rGCZuV0v3rNmYKPTFyfOiNg7qVDSKXnwToNhlO4dl
         xlWwGwHoYmO9i2JcggEgpHzXhdf9ALRrRg290Leq6zKRmPKYjugCKeQ/SuGdxzjJBhqK
         cGbPUmoneZQ1B5MFKqr89oAhryKrS2SXYgtK4a5XEUdohQfzKOz3YQemQGp1b1hGGbx2
         X5mA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723568542; x=1724173342;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=JGJpkmzwhAHPEBfWQMTLg/zF6IPgm68M3yUmp2d77TM=;
        b=odNB/veGX9gMk0ZXRhKHecDBuvV12Y28JwomqgFI0IQOp1ZlQxOWU8hU3IKjLW6Rce
         H1TZU/xERVpjkArIrJFklnHEPIziQx5qFf9u1HUZJTB0sovUtcDj8PZHBv7ookJ0aK3w
         szOEi2W+elOHbRB7Cu8/h3wyneryeLAs3hcEZkxR8vYcDLhdlEjlOxgmczeQXInEqIBy
         Qo4PTmldohnu9hWSF5vCxElk3zkAsTJIZH33l6F0GJ3ZV8HzMGdSI6iSy1jxdj7XyVnH
         emCYJPCerypSr8WWIlx3IOMu/YHSQobz+hfePqdBBwfMTmo9euIaBMYO2hMH3aFPgq9w
         pGCQ==
X-Forwarded-Encrypted: i=1; AJvYcCXfade5JlcsHyP8YxVtshOz5P8Dt7MVP9+n4tiWz+9S/9pOKH987VTOzqY/5ab/mkEM4ie81HlH15b+YevygXtKvDGzKdH9fwSdXIHSjpo=
X-Gm-Message-State: AOJu0YyvrE40YbdK92Jk8HFzZZ4pg6+Gfrbrr+wn6eMh200fUGvIhguu
	HNGjArfn4+/CD3aFY0fNlz/IOSrn1ORfZ5wZi2SrvvKNvNHcNHLB
X-Google-Smtp-Source: AGHT+IHZuurj1sUG8YFtdeInfXPdWplweffYruWCp+QQjqA/XiC02As6mGM3q9lJSfLX6jrUtjaRPw==
X-Received: by 2002:a2e:90cd:0:b0:2f1:585b:f326 with SMTP id 38308e7fff4ca-2f3aa1fe856mr50841fa.45.1723568541128;
        Tue, 13 Aug 2024 10:02:21 -0700 (PDT)
Date: Tue, 13 Aug 2024 19:02:19 +0200
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: qemu-devel@nongnu.org, anthony@xenproject.org, paul@xen.org,
	peter.maydell@linaro.org, alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com, jason.andryuk@amd.com,
	edgar.iglesias@amd.com, xen-devel@lists.xenproject.org,
	qemu-arm@nongnu.org
Subject: Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests
Message-ID: <ZruRm34zIMtUm7oH@zapote>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
 <20240812130606.90410-5-edgar.iglesias@gmail.com>
 <alpine.DEB.2.22.394.2408121650590.298534@ubuntu-linux-20-04-desktop>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.22.394.2408121650590.298534@ubuntu-linux-20-04-desktop>

On Mon, Aug 12, 2024 at 06:47:17PM -0700, Stefano Stabellini wrote:
> On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> > 
> > Add SMP support for Xen PVH ARM guests. Create max_cpus ioreq
> > servers to handle hotplug.
> > 
> > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> > ---
> >  hw/arm/xen_arm.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
> > index 5f75cc3779..ef8315969c 100644
> > --- a/hw/arm/xen_arm.c
> > +++ b/hw/arm/xen_arm.c
> > @@ -173,7 +173,7 @@ static void xen_arm_init(MachineState *machine)
> >  
> >      xen_init_ram(machine);
> >  
> > -    xen_register_ioreq(xam->state, machine->smp.cpus, &xen_memory_listener);
> > +    xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener);
> >  
> >      xen_create_virtio_mmio_devices(xam);
> >  
> > @@ -218,7 +218,8 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
> >      MachineClass *mc = MACHINE_CLASS(oc);
> >      mc->desc = "Xen PVH ARM machine";
> >      mc->init = xen_arm_init;
> > -    mc->max_cpus = 1;
> > +    /* MAX number of vcpus supported by Xen.  */
> > +    mc->max_cpus = GUEST_MAX_VCPUS;
> 
> Will this cause allocations of data structures with 128 elements?
> Looking at hw/xen/xen-hvm-common.c:xen_do_ioreq_register it seems
> possible? Or hw/xen/xen-hvm-common.c:xen_do_ioreq_register is called

Yes, in theory there's probably overhead with this but as you correctly
noted below, a PVH aware xl will set the max_cpus option to a lower value.

With a non-pvh aware xl, I was a little worried about the overhead
but I couldn't see any visible slow-down on ARM neither in boot or in network
performance (I didn't run very sophisticated benchmarks).


> later on with the precise vCPU value which should be provided to QEMU
> via the -smp command line option
> (tools/libs/light/libxl_dm.c:libxl__build_device_model_args_new)?

Yes, a pvh aware xl will for example pass -smp 2,maxcpus=4 based on
values from the xl.cfg. If the user doesn't set maxvcpus in xl.cfg, xl
will set maxvcpus to the same value as vcpus.

Best regards,
Edgar


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 17:14:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 17:14:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776484.1186638 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdv63-0007JZ-Ai; Tue, 13 Aug 2024 17:14:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776484.1186638; Tue, 13 Aug 2024 17:14:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdv63-0007JS-6z; Tue, 13 Aug 2024 17:14:11 +0000
Received: by outflank-mailman (input) for mailman id 776484;
 Tue, 13 Aug 2024 17:14:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Rcsl=PM=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sdv61-0007JM-Tg
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 17:14:09 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20614.outbound.protection.outlook.com
 [2a01:111:f403:2416::614])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 729b05fa-5997-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 19:14:08 +0200 (CEST)
Received: from CH0PR03CA0020.namprd03.prod.outlook.com (2603:10b6:610:b0::25)
 by DM6PR12MB4153.namprd12.prod.outlook.com (2603:10b6:5:212::22) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Tue, 13 Aug
 2024 17:14:03 +0000
Received: from CH1PEPF0000AD7C.namprd04.prod.outlook.com
 (2603:10b6:610:b0:cafe::9) by CH0PR03CA0020.outlook.office365.com
 (2603:10b6:610:b0::25) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.33 via Frontend
 Transport; Tue, 13 Aug 2024 17:14:03 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CH1PEPF0000AD7C.mail.protection.outlook.com (10.167.244.84) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Tue, 13 Aug 2024 17:14:03 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug
 2024 12:14:02 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug
 2024 12:14:02 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Tue, 13 Aug 2024 12:14:01 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 729b05fa-5997-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=PakLdZ/BcDisqXdADFYwPW8WUabJZUiZtSH23FZkuffZSJGpJTA3a0+Ib/ue8JVDPMTKFm/oDTt8CPhOVL9SLn5ydNO+/Ct80od1Q5OTcWRapKptI/MFbphwE0x8DDh7cqEniuk+YQvK5eLgeyDB7OKMjjK/gINsS6ZS66aycLA4uoPtjK0dFwKnHv5c//zmw+qWwPkmUmsnh/WGlyifPy5BYZ4hHgjxPGkTd28ToWZ1OLaqoGxE5pEW4KNS375DiFAF40taaTNhWqeIrtOz7J9fIzVNnuCuVFdTpU0/QEbrR7kDa0HyXSLdlYejB+veMjzyjJKLMqkKiPBIg7rU0Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KT6j/B5Nn8jiMhkUoj66gNweNhytDsgexPuGVpNobdY=;
 b=JLiXHLeKSrSVCKDvl65DosdHbLj+i2O05ufXh8czkzT0zodCx4wVA6AJGkbBCwtxQhWHeaPdz590UG5ZV4jCaSRpYjomRyIX7DxgLmjts2/XmgTLB+GiACqj4z2MSX1kEEjcw3eWAYiST5gAINb8zSIwJagJ5ui40TCQz/MpPXBaajxZ3H9vC46okpCsZjgHBAIxC/zGqe0fjWXNcyLDeVIv9ssUN1dxXdXknD4kbIi91JKcR7MyQJzdsuQLfu2bdvHYD3kYaUpKWjbG/vkpUTbL2Wf3ctbcAO9ySBLB2Qok/wX6EbWl0lI90BwqPeUhe1joschYBTUU3sCI3j70Bg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KT6j/B5Nn8jiMhkUoj66gNweNhytDsgexPuGVpNobdY=;
 b=CVa8PFiuHHJMRrYxCDkXuY9JDzf7xre+5DyL3sPyUYF0wzZTB+0HAeaciCXij4jEJpEuERNAmxFGFySTOYCjIxqx3Y5WyAZ+9Tbw3XmSgIUGHUqPVHqFv6RR2rqdZPW6iN1A53Im/LkEZ8tvJfhYSTEUG6qh6zMHQSPsh/5lQ18=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<Volodymyr_Babchuk@epam.com>, <julien@xen.org>, <jbeulich@suse.com>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v3 0/4] xen: arm: Split MMU code in preparation for MPU work (part 2)
Date: Tue, 13 Aug 2024 18:13:52 +0100
Message-ID: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD7C:EE_|DM6PR12MB4153:EE_
X-MS-Office365-Filtering-Correlation-Id: b0270a2e-ecd6-40d8-5742-08dcbbbb5497
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?hESJIyGZoB4hEvlqQHBBW/Y7rxBEPLajOaJKfl6hMi55H15VyKDxY32jxRN1?=
 =?us-ascii?Q?CzdFNEdZ0kmx2tmXWVX0TKjsqP2C7qhoLJiaVL1JIpCN5YQAMkATQY1ZWEnn?=
 =?us-ascii?Q?EnYw0Qx3qQpC38saLRJjL5U2bROr/eimotN6SX+7vYYB+qsNCzkErXxiNdyu?=
 =?us-ascii?Q?zbP/Y/pFvu7bbzMAT2TmEYwtq8EsJhLWeD3MMC9KrajolvUSOIpuc6T75jKA?=
 =?us-ascii?Q?WJKcLKXR8M75XL53jyMfaTJA0yeqHO5oCBcoCIfwKq5LhCRsb0CzfPjwJ9KD?=
 =?us-ascii?Q?1z1mZOmBc+LH1Un6YmQ75/WWA43oGRMIaMAWE7dxYSfp0ZB7JSQtpnSIOQIg?=
 =?us-ascii?Q?QHXUZzmRMp8BH+BaloFxhiLoUM2Vn8R3wMGVDlzvbGrvgIASoo6rVPpq00Ls?=
 =?us-ascii?Q?vVb3Z0GGfG+HPL0D51oPXIDI4nZaeabVLiYflv9fBpT6nEDhSLgc05TaHvvm?=
 =?us-ascii?Q?E9L6jsnY2jM1u47guwhwNclGAt7oR9YsXwjd2p5kOwHKri9RTQZIv7neT76Z?=
 =?us-ascii?Q?cX4EdZ5xbIJDQBkXsZlFMH4w0V/0cCoaIHLJPUxetTRKcG/FEK0KRcVSV9Ji?=
 =?us-ascii?Q?R8NHZs3lsmsdulO1kBRjM/kiT0To+v1DVweJYIMvbRQoPXMHX24KQxppmFsA?=
 =?us-ascii?Q?SDitHWMPp2Wvdoz+xYP2G7DEDOU6ct0IOS5exA+m1dGEXzkVxUs7q4NMpF+o?=
 =?us-ascii?Q?m1Uw0p8c5qZdVME+AzIwigPVnOeI0WiaCqaA3g4REwJo01EpDHrCXVkC/y/F?=
 =?us-ascii?Q?WyMdEzbPgbr9LIOOEUe/7h8d9KvO05VEysxr7VCILyQGmRqbhG7tfutyTzz/?=
 =?us-ascii?Q?OptXJlAQb/cfn9KOAcm0yxuRaqXtCZDMzmwBSgz/ZL0xlOnn9vDlYWFZ+o18?=
 =?us-ascii?Q?HKVnpLJcDX7zPj+0eky1Txsdf90d91RBalDOk1ukorYMSgRq7o607Ei/9InD?=
 =?us-ascii?Q?TAFRZq6pkfFRRZmtgT/4H9ZyocHlrq0F8PukAG36H9mc3W8cDTyCtDL0U5KP?=
 =?us-ascii?Q?2CSrKphiyjCx1SxijaVJrl3jeWBOdEUYlREs5deXmTSTfAJ3x3MCyr72Nrqs?=
 =?us-ascii?Q?qnMRCNEQ++audLnRcdVQWcF0IAqPppCGNRih7FuK3x2tjgyT62wG12Xwjatt?=
 =?us-ascii?Q?u4EC8MN82NijMEyFOymWrBg2xwpYvPmKE7E4vB6gVrcJu/bv76W5R1TpIkSs?=
 =?us-ascii?Q?AHORi8yq8oTDGRaJuPM8973uoUUT4y8E+TbN2nKsSAZmYX2Vw7tppdMbE3OL?=
 =?us-ascii?Q?zBPVQp9PWLD9+w/8me6t2dtd4XUDRVtNJiyNtN5Rwqb/qdoXANLN2tZ5z1Vj?=
 =?us-ascii?Q?E2CguYEetgz3gdQCTjBVGKHR5HAGRPk7h3m3/vtmA5D88Mt8RLm2cMDYJscv?=
 =?us-ascii?Q?5nc/ZrQAei+woQcD4Qh0lXhH1VlZ?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 17:14:03.1313
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b0270a2e-ecd6-40d8-5742-08dcbbbb5497
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH1PEPF0000AD7C.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4153

Hi,

In https://patchew.org/Xen/20231116145032.1651305-1-Henry.Wang@arm.com/, Henry has
reorganized some of the code between the MMU specific and generic files.

In this patch serie, we address the remaining code reorg so that MMU specific
code is cleanly separated and we have added stubs wherever necessary to avoid
introducing if-def.

Ayan Kumar Halder (4):
  xen: arm: Add a new helper update_boot_mapping()
  xen: make VMAP only support in MMU system
  xen: arm: Move the functions of domain_page to MMU specific
  xen: arm: Enclose access to EL2 MMU specific registers under
    CONFIG_MMU

 xen/arch/arm/Kconfig                 |  4 +++-
 xen/arch/arm/Makefile                |  1 -
 xen/arch/arm/arm64/mmu/mm.c          |  7 ++++++-
 xen/arch/arm/arm64/smpboot.c         |  6 +++---
 xen/arch/arm/include/asm/arm64/mm.h  |  2 +-
 xen/arch/arm/mmu/Makefile            |  1 +
 xen/arch/arm/{ => mmu}/domain_page.c |  0
 xen/arch/arm/setup.c                 |  2 ++
 xen/arch/arm/traps.c                 | 10 ++++++++++
 xen/arch/x86/Kconfig                 |  2 ++
 xen/common/Kconfig                   |  3 +++
 xen/include/xen/vmap.h               |  2 ++
 12 files changed, 33 insertions(+), 7 deletions(-)
 rename xen/arch/arm/{ => mmu}/domain_page.c (100%)

-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 17:14:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 17:14:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776485.1186648 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdv69-0007ak-KV; Tue, 13 Aug 2024 17:14:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776485.1186648; Tue, 13 Aug 2024 17:14:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdv69-0007ad-HY; Tue, 13 Aug 2024 17:14:17 +0000
Received: by outflank-mailman (input) for mailman id 776485;
 Tue, 13 Aug 2024 17:14:15 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Rcsl=PM=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sdv67-0007Zn-QD
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 17:14:15 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on2060c.outbound.protection.outlook.com
 [2a01:111:f403:2418::60c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 75cc493a-5997-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 19:14:13 +0200 (CEST)
Received: from BN0PR04CA0074.namprd04.prod.outlook.com (2603:10b6:408:ea::19)
 by SA1PR12MB8988.namprd12.prod.outlook.com (2603:10b6:806:38e::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Tue, 13 Aug
 2024 17:14:08 +0000
Received: from MN1PEPF0000ECDA.namprd02.prod.outlook.com
 (2603:10b6:408:ea:cafe::3e) by BN0PR04CA0074.outlook.office365.com
 (2603:10b6:408:ea::19) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend
 Transport; Tue, 13 Aug 2024 17:14:07 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 MN1PEPF0000ECDA.mail.protection.outlook.com (10.167.242.134) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Tue, 13 Aug 2024 17:14:07 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug
 2024 12:14:05 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Tue, 13 Aug 2024 12:14:04 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 75cc493a-5997-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=TnB88TVG1wAJSbR3kgkN+4E6krQLOT5mgZ+ZNXukmgfyFe1ncuFA0JpvQg8ANUsckJO8o2i+Lh72MVDe9YXT1AnZ9lRQ7tpONzdrqtwFMYeMf0EYjVZafdsyUUSGDRFXONdfUiROMQ76UqcrBmbH7Deb3ve1l7xJlRwXH4hhEfYrI9W2vHGE9lDGvDE1eA+2OPnn9fitT2s4E578kvrWpyj9UkKIcpIHCizGZ040z85bHZ8kXHHdKqlfGC867qxGihuMili1iouyHdqSTDWWf4cTDtztfyH/xvd7GvkiefTlWlF++yaNuGgRwRF4/l7YlrjOCpPOf5/V3dTIrOh36A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=GExeTyZpqmeGMzyUHWrGW/i414l2COxtQTsLu5JBV2E=;
 b=ocntKJiLjyUr+JnSd5hqJgkbrrsDTJ7qNIOAGmx3RErVrhu2CVAb0VM96+zIzducStVuYi94S4Rgk/zSZoG7MBa4xVAU3s7M/v8JyrlD6GaRrkgzEnNCcQc2CgwkjTO7XdheQdUQ923kWCfFaSQVqo7dbL/5ZlvjGYpumoZXodiDy/LU+cpFyVJ0enBHbQ9GZx0ER78IsZnfEnNRVWObZVoT69FN3i4nAJ5Dyxa4BiyJuhHq1CK9jvphOwbh1oVU0e+BCAuXs01bkx7zmF0RK5uA8oLvrIN8no5tqfU3Hvxa+38qH+AhzbESNJwyMttJ4hfNEW+5Zi1OdnxENF4oGg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=GExeTyZpqmeGMzyUHWrGW/i414l2COxtQTsLu5JBV2E=;
 b=Fz+zX/gh6RJHOdXYA7B1u4WTJYP8CTiGTvBVZ4yhtAJDf0KyHp2G6/bBRCx47rOWEYC+9B3gVFOoQszra4ty3IsDfFPENosaDFG5IDD+am362b2Qo8QqvcmbW6fgY5+VK6RvQPwmy3Atq73XZymE68WKXrZ+WpuRNxdxVYlLrhs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<Volodymyr_Babchuk@epam.com>, <julien@xen.org>, <jbeulich@suse.com>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v3 1/4] xen: arm: Add a new helper update_boot_mapping()
Date: Tue, 13 Aug 2024 18:13:53 +0100
Message-ID: <20240813171356.46760-2-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB03.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECDA:EE_|SA1PR12MB8988:EE_
X-MS-Office365-Filtering-Correlation-Id: b4587ca2-d72a-4139-0076-08dcbbbb5733
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?fbNwL5IKGHiu8quXXxlV3ux/ZxBEMDn9R6OMNo+eJpj2X3ynvn/zHENB/Yc0?=
 =?us-ascii?Q?ltL8eYuAlgT3x5oVA/suqgCVGKQmBL+ml5qOrOmQOn8wd6FmU/kVuqPofb0+?=
 =?us-ascii?Q?ikjZSPzvpI8HFlf5iNAGonbOgWwYLSPsdqh2l82B4Fp4NvfSG6NXEl7NreST?=
 =?us-ascii?Q?o+ItZEvGBQquKPEBEmhZRLpTdO0OYYaVZZVch77ncfhpkc0xZYktwGLSAsyH?=
 =?us-ascii?Q?FORgjyHVTCDWccWM6py4Bv0296R6S8jWoBjz9JUoCgD17I3r//EWJCGVkXbU?=
 =?us-ascii?Q?e98ZeKVGCLnEzLRwL14g3nFtfhhzQoErnDvqZFHQNosJ2GMIPlUBdR+r7G35?=
 =?us-ascii?Q?/K+GiMH2T4QxIpGs2Vbu3/9fAvB1xjiy9oXQhynwfYP4WkhEiMg6qvuOgQRJ?=
 =?us-ascii?Q?z4swakWNBbEKUdGxHM/Tp5ujsa9HKaWgXiiX/7jbpgL8TQ6Zf8eCtc3uGjHl?=
 =?us-ascii?Q?nH0Sf6EXtDhMXRGHlULgoYJ8Nbn9gM5aB/F30kzvRHUB9V6aUtzrT8+bG7Tq?=
 =?us-ascii?Q?oeuRqJfsCuSAH5jV7YRZZCdO6Nnvk5m1pjTkPeSxPvFBN6EMjZbD3weJoJyy?=
 =?us-ascii?Q?oq5rCM97ryv0gLzTX6R5PxCrffruu6ELGINapAIf+Vc6Zv1/ak2NSrrh+QPI?=
 =?us-ascii?Q?wsJlVNc1jr8DdC6AgSkoqGEtUziqNUCLijkU3l0sjOJ/usNhLrZSABdt7hSZ?=
 =?us-ascii?Q?xYRNy+HPZE1jC9sPZ9wLR5ikEDJkpR1qKvC96Gk6PEFLODHvWSnOt0l6I0K3?=
 =?us-ascii?Q?76x+Ww/pvLvuXqXmFZK9bDc5Pixuz8XzjLguJfJqRcO9R0GjsyjJPzqxyfVh?=
 =?us-ascii?Q?F6VMPfi7Pwluhqkiu4pSEgKxmM3fmUUSO6kTmAvNBdPafbinjItAtm+DrAcA?=
 =?us-ascii?Q?E0ENP9/G6XiZvRF84JvQQQX2N3uKd7SSwa4hI/VPMcJ1Dl2eArof3S8Gcigl?=
 =?us-ascii?Q?DfEgJdsSbIv/PvgIy0s7U03dW5DMAG0mDHzoyi80bdnxNB1m3tLNBLylquZi?=
 =?us-ascii?Q?JUPpHGnL+s+l8hW/WJfqO1vf+jljUAGzjWxNQeMfTVmdd930JBSIWNh1NNDz?=
 =?us-ascii?Q?OfVXE7EAlHYdNZKigeLOluw9H6kYSljVAjZmuScwhAIcEC6fCyxoR2fVSIzx?=
 =?us-ascii?Q?8ZVVUy84/0LPTJyRoUxfmEmXfiqkhqI0BWoGOLepyBldlaJxYig87H8ShZb8?=
 =?us-ascii?Q?ATy2fEyqmAp8Ea9o0pFjyAnlr4nUvEz4Zr2JAElOoasyFoQxPrNjSrSGyQgD?=
 =?us-ascii?Q?CFKlk9Pj+fbaNDs9Q40T+bj6VBwgahHPF/a/sZ+HT8tBw9BRfALb/HZqtt6c?=
 =?us-ascii?Q?i8TcKGS+i9hAKtXIKG9LKiICo0v3adh2hwdhgvQcIjWdW650SuEMluGagU6U?=
 =?us-ascii?Q?RVq6vwWyHCjTK45/+QgcnyqhKad6sLa9bxYgipr83p0UWjjdmg=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 17:14:07.5381
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b4587ca2-d72a-4139-0076-08dcbbbb5733
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	MN1PEPF0000ECDA.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8988

update_boot_mapping() invokes update_identity_mapping() for the MMU specific
code.
Later when the MPU code is added, update_boot_mapping() would invoke the
equivalent.

The common code now invokes update_boot_mapping() instead of
update_identity_mapping(). So, that there is clear abstraction between the
common and MMU/MPU specific logic.

This is in continuation to commit
f661a20aa880: "Extract MMU-specific MM code".

update_identity_mapping() is now marked as static as it is called within
xen/arch/arm/arm64/mmu/mm.c only. Also, updated the prototype to
update_boot_mapping() which is now invoked from other files.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
Changes from :-

v1 - 1. Introduced update_boot_mapping() which invokes
update_identity_mapping() in MMU specific code.

v2 - 1. Make update_identity_mapping() static and update the prototype.

 xen/arch/arm/arm64/mmu/mm.c         | 7 ++++++-
 xen/arch/arm/arm64/smpboot.c        | 6 +++---
 xen/arch/arm/include/asm/arm64/mm.h | 2 +-
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/arm64/mmu/mm.c b/xen/arch/arm/arm64/mmu/mm.c
index 293acb67e0..1afbbeda5a 100644
--- a/xen/arch/arm/arm64/mmu/mm.c
+++ b/xen/arch/arm/arm64/mmu/mm.c
@@ -111,7 +111,7 @@ void __init arch_setup_page_tables(void)
     prepare_runtime_identity_mapping();
 }
 
-void update_identity_mapping(bool enable)
+static void update_identity_mapping(bool enable)
 {
     paddr_t id_addr = virt_to_maddr(_start);
     int rc;
@@ -125,6 +125,11 @@ void update_identity_mapping(bool enable)
     BUG_ON(rc);
 }
 
+void update_boot_mapping(bool enable)
+{
+    update_identity_mapping(enable);
+}
+
 extern void switch_ttbr_id(uint64_t ttbr);
 
 typedef void (switch_ttbr_fn)(uint64_t ttbr);
diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
index a225fae64d..789f352ab6 100644
--- a/xen/arch/arm/arm64/smpboot.c
+++ b/xen/arch/arm/arm64/smpboot.c
@@ -112,18 +112,18 @@ int arch_cpu_up(int cpu)
     if ( !smp_enable_ops[cpu].prepare_cpu )
         return -ENODEV;
 
-    update_identity_mapping(true);
+    update_boot_mapping(true);
 
     rc = smp_enable_ops[cpu].prepare_cpu(cpu);
     if ( rc )
-        update_identity_mapping(false);
+        update_boot_mapping(false);
 
     return rc;
 }
 
 void arch_cpu_up_finish(void)
 {
-    update_identity_mapping(false);
+    update_boot_mapping(false);
 }
 
 /*
diff --git a/xen/arch/arm/include/asm/arm64/mm.h b/xen/arch/arm/include/asm/arm64/mm.h
index e0bd23a6ed..ac8d1f5c78 100644
--- a/xen/arch/arm/include/asm/arm64/mm.h
+++ b/xen/arch/arm/include/asm/arm64/mm.h
@@ -21,7 +21,7 @@ void arch_setup_page_tables(void);
  * Note that nested call (e.g. enable=true, enable=true) is not
  * supported.
  */
-void update_identity_mapping(bool enable);
+void update_boot_mapping(bool enable);
 
 #endif /* __ARM_ARM64_MM_H__ */
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 17:14:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 17:14:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776486.1186657 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdv6B-0007r7-Sc; Tue, 13 Aug 2024 17:14:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776486.1186657; Tue, 13 Aug 2024 17:14:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdv6B-0007qw-PR; Tue, 13 Aug 2024 17:14:19 +0000
Received: by outflank-mailman (input) for mailman id 776486;
 Tue, 13 Aug 2024 17:14:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Rcsl=PM=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sdv6A-0007JM-7z
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 17:14:18 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on2061e.outbound.protection.outlook.com
 [2a01:111:f403:2412::61e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 77edf91e-5997-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 19:14:17 +0200 (CEST)
Received: from CH0PR03CA0057.namprd03.prod.outlook.com (2603:10b6:610:b3::32)
 by SN7PR12MB6791.namprd12.prod.outlook.com (2603:10b6:806:268::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Tue, 13 Aug
 2024 17:14:10 +0000
Received: from CH1PEPF0000AD80.namprd04.prod.outlook.com
 (2603:10b6:610:b3:cafe::10) by CH0PR03CA0057.outlook.office365.com
 (2603:10b6:610:b3::32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.33 via Frontend
 Transport; Tue, 13 Aug 2024 17:14:10 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CH1PEPF0000AD80.mail.protection.outlook.com (10.167.244.90) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Tue, 13 Aug 2024 17:14:10 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug
 2024 12:14:09 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug
 2024 12:14:09 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Tue, 13 Aug 2024 12:14:07 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 77edf91e-5997-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=YCAyRdf3T9u/L9pQSSavjL4LC8u0F1E/Lt57eyCzxN09hL6ssS0Ls8kH9SCB3ruwyAifSJpIsN8bJw+OlhWQn8UZDM/iSw8qVCBV49FUoKyw+uxl0pxzeYy6LW4yLjc1PkAdIUU3LR+nkXYMeCpYhQ0EI3bDTr0akgH9EdSfckGo+V1+ayoQbGkVpQBKz4sD2cVtXJRF+eKigC1CLD7KQiO4OZyHAIv1YwOj1p8MB237oLcT0cIOAhsuHYDScUTVO/7ZutkOAnDTc/Xvni/NBJg3t+1VrgcgbWu3eDM3RiuQGq5H98Mr+XWH7kMFOtrHUquQd2rEmoas4Aof1g6NXQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5t/nB18k33JmikWIsTZUH9Fi3nu8O21bDaKGSgVj5HY=;
 b=W9u3LWuc1P2cqNLvApvRgU87/HsFAJOvNkl8a6zCAciISLZYkvWC+mr8gLDRAGXPEM/UEFnf3QD5jnjdxDAZpvl/vXQ4BIG6C8ELIZ/oKTS5rPcIrxoCFxuFTGDcxoyI54TI6ULGsybviILfEF+1X1tZUP688sSBsU68UxSh4XyBgxaSQg9yGbRECovabm1VasAdVliweORSEbb3wBRg4pNgr+tVC7gS91JSiCV/Boyqcy2JV9PNhxqselKnJ+PG5mHmNlID0oRNMejLsQJcOIdDvKzV8xaMTyDHsA3zwROC/RSxNwYFkcBxz6jnNfqq8wayNTKt2J0gO9KESxZVeg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5t/nB18k33JmikWIsTZUH9Fi3nu8O21bDaKGSgVj5HY=;
 b=LlLAA4L29tPB1d3hoELRaLuLwJQxhNOIFQ0PR0LzYBqU7OHFLKF5VER2NY+aRqKfTRl5GLv/rdfJLZ1H9LvRqAKm6orClvRPliayN+/VNcs1QwGBoNN2tJ33OvzQc9918+BKRR/j6Ily3rhpxgpPAyV5Z3VsJyFbt3U/ptOt59w=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<Volodymyr_Babchuk@epam.com>, <julien@xen.org>, <jbeulich@suse.com>
CC: <xen-devel@lists.xenproject.org>, Penny Zheng <penny.zheng@arm.com>, "Wei
 Chen" <wei.chen@arm.com>
Subject: [PATCH v3 2/4] xen: make VMAP only support in MMU system
Date: Tue, 13 Aug 2024 18:13:54 +0100
Message-ID: <20240813171356.46760-3-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD80:EE_|SN7PR12MB6791:EE_
X-MS-Office365-Filtering-Correlation-Id: 554ff9d2-33f5-4a54-ccdb-08dcbbbb58d6
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?aLcuU0YyPYlq67p48ejlMr/PmVKoXUeEu/ME9g00DeNX8PE9AkPD40vewb6f?=
 =?us-ascii?Q?KVfI0KUf4QziX5f5imAZk6b9Pzpv1SLdMNSOGojlrHkn+/IbVXCanAJoEdQI?=
 =?us-ascii?Q?sLrFX3yUScL1X+wFWPnKugMpBLIGG9rstLttLlgIvtpZ39aYqoqGXAxRGDZs?=
 =?us-ascii?Q?jK6GHAUyWgH00n8vcD2dPUAmkHTSXwp6mDapvMhNxV6zXo8mfy1mWHVYmbfg?=
 =?us-ascii?Q?1aFZGwSgUyl98Zk4JUsHdrN7iiT0AhThqdFNcXPtcD3rynGR2eOt1S9kMw9W?=
 =?us-ascii?Q?7/q1SeRx1ZZW9UxLYgFwyr79JfsS9LirAuEurAA7nBFZJ+zHIp3uz22mR2UO?=
 =?us-ascii?Q?103dWrt8wB17YdNOeBK9yhjAUUVCW2uX+UIMLWa7D/74xM7sJ8DS/xzW/jnG?=
 =?us-ascii?Q?yJZoOF0anqZVCZj9ccOLmWWJp0HiA9J1Xpc07ZwTgrqmFNfoGBw7TiyrfCdY?=
 =?us-ascii?Q?kNq0wYls12yleWek8OUzMF//OTZI0fEog5zUXNwU60dArKUeOEOEbr4GsO2S?=
 =?us-ascii?Q?Vo370TQZzTPaHsGTBo1SzBdhtBhTuFXYdSlVOcNEW/RwtGd6yef5sGI4n+pe?=
 =?us-ascii?Q?bfbgTFkuMWJ41mTRAkCz0HSz7YsO1fdJpReeua4ChxsIgZqZkKdlDxjk/Y+/?=
 =?us-ascii?Q?8/Sfo4WMgV1zV9qT1g3/3gMiMjr6Tty3DGZbY7jWQM58V8gwMHOKc6VBPfiD?=
 =?us-ascii?Q?YT5XcuD3mHG43eBKZHxvvIznzWm+k5/Jy1Q0EMjhiABI92NJTJd2kNzi8IJ1?=
 =?us-ascii?Q?9v0145rZv3oEd//fqpdCzRekmtRMsXiUNzCDg+1zgsXUXQ0OnhjjhJotHHmF?=
 =?us-ascii?Q?QARiEw4B4Vpqh8zdGxhTZ82rEQCVYFSZmI4f5Y19buoZWAnkcdIveyvOzXxr?=
 =?us-ascii?Q?pocW5h6YYhPokxMxNCFhUa7CM1ZAPUECN3irxCjOOLzfZX2yzDCKTmifmMVW?=
 =?us-ascii?Q?gWI/kWCr2+t4c/UdNf46xn8X1M/OJz04n+66o/Mxu4baFvPGqpaUPcK2QHEW?=
 =?us-ascii?Q?Y0b1qPAwh1qKfh54czQoSV7LHhPbuYeGFpP0HLV08sqcPTpaOm6seeS+/H8B?=
 =?us-ascii?Q?Sfeot7/KN3rT83AVoK7M0CZxAyQGJfuvC5+WN522MGPSLFktRiJd2BY5Z7Nd?=
 =?us-ascii?Q?f2b4mpZJimxektPbJ8dD7zhhxJHEaA5pP+/fcZnUDU5gbaiIq/65GFhk/QtD?=
 =?us-ascii?Q?gMNmx45Zoljax9kWxKTK30IEx/zqYvEyBxglcwqmYoxOthpHoJIvzTwQ12Fa?=
 =?us-ascii?Q?3/pBYPvJPWLSMqW/CGyedBvBxLbgE3uKkkTJNBKnOXYqR1MhaJ/VlyOMO7jW?=
 =?us-ascii?Q?1jdzv4OfFCODKkHkMBSmXan14CD8KUwtlhRBqE6Q530hwGBEYyo7YHYPu58O?=
 =?us-ascii?Q?ZpE5rIyo2I5sFsQLLLFIq5d14CM47CbynEOAVz1gFFPO4EnzRQ=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 17:14:10.2580
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 554ff9d2-33f5-4a54-ccdb-08dcbbbb58d6
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH1PEPF0000AD80.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6791

From: Penny Zheng <penny.zheng@arm.com>

Introduced CONFIG_VMAP which is selected by the architectures that use
MMU. vm_init() does not do anything if CONFIG_VMAP is not enabled.

VMAP is widely used in ALTERNATIVE feature to remap a range of memory
with new memory attributes. Since this is highly dependent on virtual
address translation, we choose to fold VMAP in MMU system.

In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
only support in MMU system on ARM architecture. And ALTERNATIVE now
depends on VMAP.

HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP as speculative
attacks are not possible on non MMU based systems (ie Cortex-R52, R82).
See https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability.

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Signed-off-by: Wei Chen <wei.chen@arm.com>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
Changes from :-

v1 - 1. HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP.
2. cpuerrata.c is not gated on HAS_VMAP.

v2 - 1. Introduced CONFIG_VMAP in common/Kconfig.
2. Architectures using MMU select this config.
3. vm_init() now uses CONFIG_VMAP.

 xen/arch/arm/Kconfig   | 4 +++-
 xen/arch/arm/setup.c   | 2 ++
 xen/arch/x86/Kconfig   | 2 ++
 xen/common/Kconfig     | 3 +++
 xen/include/xen/vmap.h | 2 ++
 5 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 21d03d9f44..e30a7da186 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -12,7 +12,7 @@ config ARM_64
 config ARM
 	def_bool y
 	select FUNCTION_ALIGNMENT_4B
-	select HAS_ALTERNATIVE
+	select HAS_ALTERNATIVE if HAS_VMAP
 	select HAS_DEVICE_TREE
 	select HAS_PASSTHROUGH
 	select HAS_UBSAN
@@ -61,6 +61,7 @@ config PADDR_BITS
 config MMU
 	def_bool y
 	select HAS_PMAP
+	select HAS_VMAP
 
 source "arch/Kconfig"
 
@@ -171,6 +172,7 @@ config ARM_SSBD
 
 config HARDEN_BRANCH_PREDICTOR
 	bool "Harden the branch predictor against aliasing attacks" if EXPERT
+	depends on HAS_VMAP
 	default y
 	help
 	  Speculation attacks against some high-performance processors rely on
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index cb2c0a16b8..7f686d2cca 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -447,7 +447,9 @@ void asmlinkage __init start_xen(unsigned long boot_phys_offset,
      * It needs to be called after do_initcalls to be able to use
      * stop_machine (tasklets initialized via an initcall).
      */
+#ifdef CONFIG_HAS_ALTERNATIVE
     apply_alternatives_all();
+#endif
     enable_errata_workarounds();
     enable_cpu_features();
 
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 7ef5c8bc48..32be057978 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -1,6 +1,7 @@
 config X86_64
 	def_bool y
 	select 64BIT
+	select HAS_VMAP
 
 config X86
 	def_bool y
@@ -31,6 +32,7 @@ config X86
 	select HAS_UBSAN
 	select HAS_VPCI if HVM
 	select NEEDS_LIBELF
+	select HAS_VMAP
 
 config ARCH_DEFCONFIG
 	string
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 565ceda741..188918ec5c 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -77,6 +77,9 @@ config HAS_PIRQ
 config HAS_PMAP
 	bool
 
+config HAS_VMAP
+	bool
+
 config HAS_SCHED_GRANULARITY
 	bool
 
diff --git a/xen/include/xen/vmap.h b/xen/include/xen/vmap.h
index fdae37e950..c1dd7ac22f 100644
--- a/xen/include/xen/vmap.h
+++ b/xen/include/xen/vmap.h
@@ -141,7 +141,9 @@ void *arch_vmap_virt_end(void);
 /* Initialises the VMAP_DEFAULT virtual range */
 static inline void vm_init(void)
 {
+#ifdef CONFIG_HAS_VMAP
     vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end());
+#endif
 }
 
 #endif /* __XEN_VMAP_H__ */
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 17:14:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 17:14:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776504.1186668 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdv6c-0000Lk-4C; Tue, 13 Aug 2024 17:14:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776504.1186668; Tue, 13 Aug 2024 17:14:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdv6c-0000Ld-1J; Tue, 13 Aug 2024 17:14:46 +0000
Received: by outflank-mailman (input) for mailman id 776504;
 Tue, 13 Aug 2024 17:14:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Rcsl=PM=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sdv6b-0007JM-3g
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 17:14:45 +0000
Received: from NAM10-BN7-obe.outbound.protection.outlook.com
 (mail-bn7nam10on20601.outbound.protection.outlook.com
 [2a01:111:f403:2009::601])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 87d21fa2-5997-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 19:14:44 +0200 (CEST)
Received: from MN2PR22CA0017.namprd22.prod.outlook.com (2603:10b6:208:238::22)
 by IA1PR12MB6162.namprd12.prod.outlook.com (2603:10b6:208:3ea::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Tue, 13 Aug
 2024 17:14:38 +0000
Received: from MN1PEPF0000ECD8.namprd02.prod.outlook.com
 (2603:10b6:208:238:cafe::7d) by MN2PR22CA0017.outlook.office365.com
 (2603:10b6:208:238::22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend
 Transport; Tue, 13 Aug 2024 17:14:38 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 MN1PEPF0000ECD8.mail.protection.outlook.com (10.167.242.137) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Tue, 13 Aug 2024 17:14:38 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug
 2024 12:14:38 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Tue, 13 Aug 2024 12:14:37 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 87d21fa2-5997-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=PSySvNV3VQ66/7hxddt4h+Q/o+jwuZhNjZzSqfXh2Eskf4RlDf7eB3d0TVIokVUOPtxV9TtSvdigmDe1xA6NM2WWvyxdzcbdi1g1abbItB+dtvuFD1wIs3OuC6JfKq8HAbBrQ6C8VsmbTELAXlG2JUgHzeFjn7EknNnDx6OF2+8fNpLtv2tWdQVcyvXpsBFDbWf3m0OpJPdOErwqZrieYeQ+69OxtQFnlKMU4KW9DIOYS1nVExuT5t+2aDgUUirbjdITNT9j5uK+GgdEQEe7db1nXFkegELnIgTjY+FOQmy5eLPdieOUYkUVqmjI7IUWYfmchdhlCjcsQjju6b2qKg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Iv/mcdKWSyDFQyeXlKdWpa5s6Ph01vN5ht4yXXGmCFM=;
 b=vEXvWDv9ncWLuhLLbDt3bCQ+ypu8E9gGOpiTMfHT1CjtJ2Fxwe9H3D9rV+n7zaHN5ODcHfagtD3FETW9gwXACWOE4Ws+y8FKy8mmXm/IEW3L3nJCW8Q9XrkFh9kk0OcGGx8oe0TZBCsYZXtcbbNhobhQGq3qGRLyYhO40zQ6f+uFMzq9SOKdytseyt7A0SF+2NYXj4/xRt4mfGKmWkdFK1aGOfbG//gJPM4oQ1UjoMC4ZaH26ELEvQ1YGU5ubUFlPdUR6xM0riqZA0csnjV/+vHqe93uU3PwrbzgT2rabbGbSagOOHfuVXzsOBpmZ5YxpnUlCnyxzjprnqFmRSqXag==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Iv/mcdKWSyDFQyeXlKdWpa5s6Ph01vN5ht4yXXGmCFM=;
 b=KIizFa56O55nH0yBVEK0TfUAY5I9CPc/zXI/hDJzVGfGvcw0VpgerGsRvD4Nm9dAKi0ikhC4+v2Vaamz9ye5gmkwcQLrInvPrMOlaR4dao9t96wJDNURV6FCDjM0TXl7J58sOOV3DdomeiEiRSGA5tnvPlQFg53QdbpEVo8x0KU=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<Volodymyr_Babchuk@epam.com>, <julien@xen.org>, <jbeulich@suse.com>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v3 3/4] xen: arm: Move the functions of domain_page to MMU specific
Date: Tue, 13 Aug 2024 18:13:55 +0100
Message-ID: <20240813171356.46760-4-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB03.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD8:EE_|IA1PR12MB6162:EE_
X-MS-Office365-Filtering-Correlation-Id: d887ab63-09d0-49a0-b601-08dcbbbb69ca
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|376014|82310400026|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?fWQ8ovHk+DDNxOWEUV6oCXVGSEaDnYfiQnsTEdnJmaTBZ4lriwbz9eLzYzdl?=
 =?us-ascii?Q?TPKHrt1QpiDPlBbqw6KRih2Fk6LU7A182Jt64uH8306v4ATVcFg3mM5Uu1K2?=
 =?us-ascii?Q?wK63mYLuo9zOTA5R8wP0k0EQLOnMmHdyAK4h+TktFnwKOUTw/lr7kIl2Umhe?=
 =?us-ascii?Q?MFY/E+isr2+12sRvkWAzwl9D7jkONNEmLBvfIHx4kZlmQqiegeWGrXn6xkGr?=
 =?us-ascii?Q?cNFbBot/jLg4f+j6E9k+WLA5y69P2SY47tTSE+av9228tQUv6z+VBDpbhgSA?=
 =?us-ascii?Q?atHaFtM06vbtE+/eTTi11QnVeSV4A9ORnV88FjiRxJiZfWMVf+40wFC5TzCQ?=
 =?us-ascii?Q?CkLznhwE1RkLlc5BdIptNIZCaKEtYDUgRgSYTBuInfrF1krenIPTIwVEGRvE?=
 =?us-ascii?Q?mGHbkqIUFZGbBENCNMxNd4GPpU6t3ACjKcVzP2WKXyfGzxg8J5RWlC7pLQEy?=
 =?us-ascii?Q?4Ye0pLdF83xxMPlwHXlMaGEka2lzNM7k7yFJZ+LtINK6khl4hnfwDD8fqxyb?=
 =?us-ascii?Q?5XssYZJAD27yINgRyL/m5seCcaj1C39J5zPJNZV+KCIC5lXhnfcUZ49ITCge?=
 =?us-ascii?Q?1VX9+acmpqUZXFlN/ljWcSJBHHFFqqGzr5rRKbZcLREolm/+XOfADlKvoOdP?=
 =?us-ascii?Q?o/SYJj//l6XwuEJnyfcrUD4uHKe1axgR/DPh/BdnSEJ4/u0r1b4A715waKHR?=
 =?us-ascii?Q?Qx24Y9kwdJGQSBrjE+aehJJlt7VSXCsWzvInOx82ZlODyQsLRN8kK/PV9vg4?=
 =?us-ascii?Q?ZEvMBGjlQwSrXAkAJ+SOXa8fLzD37BxreU15SUKm1R85o7KqPJ8aIq7Ph4Nk?=
 =?us-ascii?Q?BAO9Wk9HN56tHrvFM+doZmoDkXHGqOR04Wj3qkkV9VMnjuQ/pfYajhVghZE3?=
 =?us-ascii?Q?M6XgFHxEEe/mz5zcNIb+pQKKQgrAeN6AKMueNjw0Tlk/q7thA7vXv3jdKcat?=
 =?us-ascii?Q?5TuhVNifhFknjE6YR85d0kl/4CH1H0o0J/PeCsFH4TglCRdNVLIuWzKzU+mQ?=
 =?us-ascii?Q?zXbcftufrZYsau/VsmLEbICfyTvvOrzEtabF/cvwhPd5Wj8ajBNPXUJ/KPNs?=
 =?us-ascii?Q?7CZEhMVMj1pxoN0Hey8SBWrutzhQzqJ8X8r60WmPRjZe96im1JYim1wlKnpR?=
 =?us-ascii?Q?orLFw0i0fe3Jvll4/4kUjbYVJ5e4pegUvtPY85o/SBmAlymVwP3fT6HwcvOq?=
 =?us-ascii?Q?bzMIqPWIFfu8KMiSQrgj7CNsDJ3n+jUMxAl5kODqJs2iloM4v9rErRdxCdKx?=
 =?us-ascii?Q?AkY79gqKG72In/iP7BaOB7QNkLJX7V0Yq4rlSKA8Psu+zWMFsSuKy2zALC4z?=
 =?us-ascii?Q?HLB5nAzUXcoB/QDdt1KnceJ/L/0iBSsAXScJnb4ngQWDFouNy9KYVoaxitrx?=
 =?us-ascii?Q?HPISerzqC02r1FM+5xPXOPGjL/y9xcfFhY+XCvJP9TqtRyA+yXlTFXX/M8iZ?=
 =?us-ascii?Q?WHGNye5Tgb+D12AE82hR5/Da0krSaZDd?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(376014)(82310400026)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 17:14:38.7313
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d887ab63-09d0-49a0-b601-08dcbbbb69ca
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	MN1PEPF0000ECD8.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6162

Moved init_domheap_mappings(), map_domain_page_global(),
unmap_domain_page_global(), map_domain_page(), unmap_domain_page(),
domain_page_map_to_mfn() to MMU specific folder.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
Changes from :-

v1 - Moved domain_page.c to mmu/domain_page.c.

v2 - Updated arm/Makefile.

 xen/arch/arm/Makefile                | 1 -
 xen/arch/arm/mmu/Makefile            | 1 +
 xen/arch/arm/{ => mmu}/domain_page.c | 0
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename xen/arch/arm/{ => mmu}/domain_page.c (100%)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index da9c979dc4..7792bff597 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -18,7 +18,6 @@ obj-$(CONFIG_IOREQ_SERVER) += dm.o
 obj-$(CONFIG_DOM0LESS_BOOT) += dom0less-build.init.o
 obj-y += domain.o
 obj-y += domain_build.init.o
-obj-$(CONFIG_ARCH_MAP_DOMAIN_PAGE) += domain_page.o
 obj-y += domctl.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += efi/
diff --git a/xen/arch/arm/mmu/Makefile b/xen/arch/arm/mmu/Makefile
index 67475fcd80..2cb44b857d 100644
--- a/xen/arch/arm/mmu/Makefile
+++ b/xen/arch/arm/mmu/Makefile
@@ -2,3 +2,4 @@ obj-y += p2m.o
 obj-y += pt.o
 obj-y += setup.o
 obj-y += smpboot.o
+obj-$(CONFIG_ARCH_MAP_DOMAIN_PAGE) += domain_page.o
diff --git a/xen/arch/arm/domain_page.c b/xen/arch/arm/mmu/domain_page.c
similarity index 100%
rename from xen/arch/arm/domain_page.c
rename to xen/arch/arm/mmu/domain_page.c
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 17:14:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 17:14:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776505.1186678 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdv6e-0000cs-FJ; Tue, 13 Aug 2024 17:14:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776505.1186678; Tue, 13 Aug 2024 17:14:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdv6e-0000cj-BF; Tue, 13 Aug 2024 17:14:48 +0000
Received: by outflank-mailman (input) for mailman id 776505;
 Tue, 13 Aug 2024 17:14:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Rcsl=PM=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sdv6d-0007JM-Q5
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 17:14:47 +0000
Received: from NAM10-BN7-obe.outbound.protection.outlook.com
 (mail-bn7nam10on20608.outbound.protection.outlook.com
 [2a01:111:f403:2009::608])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 89ff0956-5997-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 19:14:47 +0200 (CEST)
Received: from MN2PR02CA0005.namprd02.prod.outlook.com (2603:10b6:208:fc::18)
 by LV2PR12MB5824.namprd12.prod.outlook.com (2603:10b6:408:176::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.23; Tue, 13 Aug
 2024 17:14:41 +0000
Received: from MN1PEPF0000ECD7.namprd02.prod.outlook.com
 (2603:10b6:208:fc:cafe::e0) by MN2PR02CA0005.outlook.office365.com
 (2603:10b6:208:fc::18) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend
 Transport; Tue, 13 Aug 2024 17:14:41 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 MN1PEPF0000ECD7.mail.protection.outlook.com (10.167.242.136) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Tue, 13 Aug 2024 17:14:41 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 13 Aug
 2024 12:14:41 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Tue, 13 Aug 2024 12:14:40 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 89ff0956-5997-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=mdVWLAXevRfVGlGb8wEf5fDNL1SL4AId9PAuSe+xj9UGHsJOXWj0Qeq79cTAAOmeFANEr471CywhQWFw3mfH3Ilvj7UGDQcU43lV/aVnptlD/IoVkymJPMWUCap8922fo0+lecKX4GpPLu7n7JTIXnZ51DSa7xWb3DNY+bWN2DFd3jdMuHY7G0BytdnB2N+QSt8EobzGJc7aYUnCqHmNZq7qXmJRiMfwSxM8mEd3QC/i+Ncp4P/F5Ov7Us6Q4cwqlKi9+ZDJS/eeEojJO0eanbvd2fp00TEeYMvLOx6Bk7LTsh8onJDFHE5Mr7adMqz+0Qkv74fB4pgL3sT9RcIGfg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=y8syEudjqafW5Qhsj5GpdRFapDEC7fYWqSfZZMYCnLc=;
 b=AjbMOxaVsGdqEY3gMUX+ZZzZn3c76+m3JGz8j5/eIUq7Rg+C7D2cMqN4Y/VuGea+aZ5SBSWxsnHnyeXTqf4agviHwgS3ozAOH2unwW6XDDpZ44YCHYKw80zxliM3H0ovHWgx6pY2fuki/x6JmT4rzB6Big+JD9eNor8bExeWAvPtnuO0SJh6hpVr31kNMstR4cPs2P+YGEcc+1+7Y9D4SapFE5ORw+904ahKdWILiAIVaEb8V7eULaOtsVR+/l+UJV/Y1h6WMXMHpenDc+VF9o8oNDp8CtHV8qcqjihClK+/Og2MO5ioI+7Gz05Adp9GYmtHWYvzFlMyVxVby+Dphw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=y8syEudjqafW5Qhsj5GpdRFapDEC7fYWqSfZZMYCnLc=;
 b=WYKr+BVcPAeHrkEDj8a4SjXu/DE3ILT+Y1/gEuYL3jpa8gehr5JIP36xmPBtqBbDcdAnWWvAD2DB5z9u42fse6fRQJv+gXv0VifGG8xLjy6s9o5aB3BecKGj/ygKnhJO0dPYMWi2nURzaDg6fTopb3xh6Lr3N/aoxVcpakIZyZ4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <sstabellini@kernel.org>, <bertrand.marquis@arm.com>,
	<michal.orzel@amd.com>, <ayan.kumar.halder@amd.com>,
	<Volodymyr_Babchuk@epam.com>, <julien@xen.org>, <jbeulich@suse.com>
CC: <xen-devel@lists.xenproject.org>
Subject: [PATCH v3 4/4] xen: arm: Enclose access to EL2 MMU specific registers under CONFIG_MMU
Date: Tue, 13 Aug 2024 18:13:56 +0100
Message-ID: <20240813171356.46760-5-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB03.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MN1PEPF0000ECD7:EE_|LV2PR12MB5824:EE_
X-MS-Office365-Filtering-Correlation-Id: d9072e21-ecc6-4c95-a3a9-08dcbbbb6ba2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|82310400026|376014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?JervzM7SJYMxSror9GyoOpUDbtkJjSrwghk2bLnl/B7HHrsPkvAkas+217gF?=
 =?us-ascii?Q?ngQU06ZdNs0fhKIDMD72wf3697z0++3UiNIdciW8/Oap0H11tmizyqiU3JxR?=
 =?us-ascii?Q?9BxxsqIJ1rjsDubw4l6Qa2OSfTG9ehq5Z3FxK27pFTI7iD5A2I+tvjYQC7+l?=
 =?us-ascii?Q?CnKUbog0hlqMhpDWT/ThC3lay4j6nCX8uE94aQKZAOBr02sBqNiW9xGpAalj?=
 =?us-ascii?Q?C5aejsecMtVfALKUbV1lP0wynn3GOM7mH039NUTPfinx5iFiz37vGAC7eoIh?=
 =?us-ascii?Q?UR97EvFhzUCRt1nxV5xcGX122nAPcKS/KdZN9VCUD++g14NHEFnJRw3OHRks?=
 =?us-ascii?Q?V97u34R+Z7KjzR6fMt/ciLO8vkghbtwF36kNd8bJs7pNPvmKxbRgTTbU9DxL?=
 =?us-ascii?Q?oXuBOj6Po9BGaj0MUjB31H6h5/iyWJZEwcrGXSgvo7jZ+Tgbc/n/XBHxkJET?=
 =?us-ascii?Q?VT72Pz8uaeBZJsjhT4DvBSDZ24c2uW40kfSYGmXwni4ud7Bl7DgAuorjryZg?=
 =?us-ascii?Q?2W9YsFnwT/7by/OTfHZwJn/QXPbrLtVQLVd4kbSKtNzxk3HMH7Y4N9MFc0C4?=
 =?us-ascii?Q?I7Lzj0VAMeYtFAxu/ndwJMRabLRKlvtq4Bvd3JTC26osqW+nYyAa84/AFMKp?=
 =?us-ascii?Q?unpRXRt5lTytrF9ArCFIX9qJZmFIC37y+JstA0JYbKk1Dm+j9doOeauafi5i?=
 =?us-ascii?Q?5CI2gVAEEs8wyGi4CiygvzrFStmjAGf8QM7fxWj55EpLRY6gGFTP8x84ry9l?=
 =?us-ascii?Q?cfVvaSHmtvFzqfD120sL/psRgE/hINgHgFkBnjvgfqjzoR4in3QhPHP2NyI9?=
 =?us-ascii?Q?JAgNadlY1dIXftFPZDM9cbRgFJ+bqm5IuFRAeBIKXn07VR8GXIN8BjAEwsws?=
 =?us-ascii?Q?grsoUs6u2gT4+tEgGk5T7RtOqNnZpYjCG8XfDFnD98bOGnPZbHdHYKa2DQad?=
 =?us-ascii?Q?A2v0/F8UIiulDga4p8V6ifwBpkzUnqv3vsA13AB31CorD8qXBemqj97eUgil?=
 =?us-ascii?Q?F4KSmLUyr01obPSUlo5PYPHxnpSkPD7yihbKTUO5DKInvUedhtqOw9HY2QEv?=
 =?us-ascii?Q?P41K8Dgn6whtf7+jgrAzXNjxe5Cu2oFwmPW2isb0js42/bhFSjZGGmzk2HnU?=
 =?us-ascii?Q?JnsvOCtoNjgF1Js8Q1oP2vJqBmzZaUJRdjRTUbLPSY/TsmrRhqgB5dyT/zvK?=
 =?us-ascii?Q?6TkMCjR9gf/kjNajpdMY5u675sOCLT9w7NoSZxGFYvoJ4flW567s7XdVCRpq?=
 =?us-ascii?Q?ry/0petoxFKatbuZKVgaucSCQRxTMLuiKM8c9h6TRkEu2mz3MrMkTMBlquQY?=
 =?us-ascii?Q?Trm3UKO4WnZAX3B2qRdMbkGdpbujZITSkCiIXCLCdk/qJehr5nyPxzGgJDmz?=
 =?us-ascii?Q?QH5KiPb9QAQHkOOlRzdRpZQcGMsS/r/fN7hVrJrqSgxOy2qevnpleEicNhBD?=
 =?us-ascii?Q?OdxeZBk7DphCYTj+mT2G2ITrqomTdRWz?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(376014)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 17:14:41.8085
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d9072e21-ecc6-4c95-a3a9-08dcbbbb6ba2
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	MN1PEPF0000ECD7.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5824

All the EL2 MMU specific registers are enclosed within CONFIG_MMU.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
Changes from :

v1 -
1. 'vttbr_el2' field is enclosed with ifdef.
2. No movement of code.

v2 -
1. Enclosed 'vttbr_el2' access in show_registers() and vcpu_show_registers().

 xen/arch/arm/traps.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index aac6c599f8..737f4d65e3 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -720,8 +720,10 @@ struct reg_ctxt {
     uint32_t ifsr32_el2;
 #endif
 
+#ifdef CONFIG_MMU
     /* Hypervisor-side state */
     uint64_t vttbr_el2;
+#endif
 };
 
 static const char *mode_string(register_t cpsr)
@@ -919,12 +921,16 @@ static void _show_registers(const struct cpu_user_regs *regs,
 #endif
     }
     printk("  VTCR_EL2: %"PRIregister"\n", READ_SYSREG(VTCR_EL2));
+#ifdef CONFIG_MMU
     printk(" VTTBR_EL2: %016"PRIx64"\n", ctxt->vttbr_el2);
+#endif
     printk("\n");
 
     printk(" SCTLR_EL2: %"PRIregister"\n", READ_SYSREG(SCTLR_EL2));
     printk("   HCR_EL2: %"PRIregister"\n", READ_SYSREG(HCR_EL2));
+#ifdef CONFIG_MMU
     printk(" TTBR0_EL2: %016"PRIx64"\n", READ_SYSREG64(TTBR0_EL2));
+#endif
     printk("\n");
     printk("   ESR_EL2: %"PRIregister"\n", regs->hsr);
     printk(" HPFAR_EL2: %"PRIregister"\n", READ_SYSREG(HPFAR_EL2));
@@ -956,7 +962,9 @@ void show_registers(const struct cpu_user_regs *regs)
     if ( guest_mode(regs) && is_32bit_domain(current->domain) )
         ctxt.ifsr32_el2 = READ_SYSREG(IFSR32_EL2);
 #endif
+#ifdef CONFIG_MMU
     ctxt.vttbr_el2 = READ_SYSREG64(VTTBR_EL2);
+#endif
 
     _show_registers(regs, &ctxt, guest_mode(regs), current);
 }
@@ -979,7 +987,9 @@ void vcpu_show_registers(const struct vcpu *v)
     ctxt.ifsr32_el2 = v->arch.ifsr;
 #endif
 
+#ifdef CONFIG_MMU
     ctxt.vttbr_el2 = v->domain->arch.p2m.vttbr;
+#endif
 
     _show_registers(&v->arch.cpu_info->guest_cpu_user_regs, &ctxt, 1, v);
 }
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 17:20:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 17:20:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776526.1186688 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdvBs-0003Y6-Vb; Tue, 13 Aug 2024 17:20:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776526.1186688; Tue, 13 Aug 2024 17:20:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdvBs-0003Xz-SS; Tue, 13 Aug 2024 17:20:12 +0000
Received: by outflank-mailman (input) for mailman id 776526;
 Tue, 13 Aug 2024 17:20:11 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ynFR=PM=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sdvBr-0003Xt-N9
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 17:20:11 +0000
Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com
 [2a00:1450:4864:20::429])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4ac4ea4c-5998-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 19:20:09 +0200 (CEST)
Received: by mail-wr1-x429.google.com with SMTP id
 ffacd0b85a97d-368440b073bso70676f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 10:20:09 -0700 (PDT)
Received: from [192.168.1.10] (host-92-26-98-202.as13285.net. [92.26.98.202])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-36e4e51e876sm10981474f8f.73.2024.08.13.10.20.08
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 10:20:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4ac4ea4c-5998-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723569609; x=1724174409; 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=84sx66JI+FulYoVmyiqu6uT4YzhJNSXXhPlav9Qus3U=;
        b=GY1L+0z0+izYPr2Am8PZmvFZ3w2CKgbsZtsUEUiBbdQDs8ocNAlb/NSPL6iUxrlQYU
         9oxiEUYaqTPA/IgDByqxO3TOEnOmAAhsIjWiC70JuUBE40v/NxiJW3lJjtL5YUtgQTyH
         Iab2GU62HqkV6YmRPi1gM0alScvr4/jNLc4ig=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723569609; x=1724174409;
        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=84sx66JI+FulYoVmyiqu6uT4YzhJNSXXhPlav9Qus3U=;
        b=js+g0z4l1UXCDAUrf9IeyoZoKA1TOCyFvys9uOChJatgxc6pcddLkO2Hr1AQqiEKz7
         dxvmhyDiWTDefIY3dCegnFYLVO9Yr+oSoLf+F57I00z1WMa/iVMVcwATCKKm22KWUs6h
         iNv6gNpfd26qwAALwSchbTaUknoXROUBEdbQdbybDb+dV9Gg2Jozyejcpd3LI+9+8B6M
         zcYPQtARyWPvWlIwl7lL7t6Us3uUf8P6H1EwHIpWU6QGZDUfv4104hVkUZv0eQIY93ek
         wg4JarqEgELYVeSn81VyQ7htT1zD4LF7ZQ01rgOVe9TsfbDjrogCyRpaA5JaiWGeNJXW
         JM5A==
X-Forwarded-Encrypted: i=1; AJvYcCVyEjFsozlEwgcRNE1n0l2caXsYurTjiI6oMAUR4LBfvqQMBX9O3W29UCJ5K9HZsxQsGqMxigXiThr24v2seWW6I76qJVwBPg7qw3Z0ZoU=
X-Gm-Message-State: AOJu0Yx8DO3Ff1xyFWXu0lVbzgxmcVecJ1zRpIDF6NC6J4ZSm3PKVfp7
	kvPEUDJP1JaSdsUTUdvJmJaLcA/Md5tQbEcFpbhDQSr3pnauR7a6T2Hc+MXCaqA=
X-Google-Smtp-Source: AGHT+IFTGC62jSGYkGCBeBoI9MiD8GQfXOo+KENKk3RMxfPXu/2PblHRt3RsejLkmmxd/OqMpwzjUw==
X-Received: by 2002:adf:ebca:0:b0:362:ad01:5435 with SMTP id ffacd0b85a97d-371775c6b2bmr355964f8f.29.1723569608962;
        Tue, 13 Aug 2024 10:20:08 -0700 (PDT)
Message-ID: <a93b9398-9cc3-48ed-9570-47204ab80d5f@citrix.com>
Date: Tue, 13 Aug 2024 18:20:07 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
 Stefano Stabellini <sstabellini@kernel.org>
Cc: qemu-devel@nongnu.org, anthony@xenproject.org, paul@xen.org,
 peter.maydell@linaro.org, alex.bennee@linaro.org, xenia.ragiadakou@amd.com,
 jason.andryuk@amd.com, edgar.iglesias@amd.com,
 xen-devel@lists.xenproject.org, qemu-arm@nongnu.org
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
 <20240812130606.90410-5-edgar.iglesias@gmail.com>
 <alpine.DEB.2.22.394.2408121650590.298534@ubuntu-linux-20-04-desktop>
 <ZruRm34zIMtUm7oH@zapote>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <ZruRm34zIMtUm7oH@zapote>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 13/08/2024 6:02 pm, Edgar E. Iglesias wrote:
> On Mon, Aug 12, 2024 at 06:47:17PM -0700, Stefano Stabellini wrote:
>> On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
>>> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
>>>
>>> Add SMP support for Xen PVH ARM guests. Create max_cpus ioreq
>>> servers to handle hotplug.
>>>
>>> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
>>> ---
>>>  hw/arm/xen_arm.c | 5 +++--
>>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
>>> index 5f75cc3779..ef8315969c 100644
>>> --- a/hw/arm/xen_arm.c
>>> +++ b/hw/arm/xen_arm.c
>>> @@ -173,7 +173,7 @@ static void xen_arm_init(MachineState *machine)
>>>  
>>>      xen_init_ram(machine);
>>>  
>>> -    xen_register_ioreq(xam->state, machine->smp.cpus, &xen_memory_listener);
>>> +    xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener);
>>>  
>>>      xen_create_virtio_mmio_devices(xam);
>>>  
>>> @@ -218,7 +218,8 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
>>>      MachineClass *mc = MACHINE_CLASS(oc);
>>>      mc->desc = "Xen PVH ARM machine";
>>>      mc->init = xen_arm_init;
>>> -    mc->max_cpus = 1;
>>> +    /* MAX number of vcpus supported by Xen.  */
>>> +    mc->max_cpus = GUEST_MAX_VCPUS;

The only suitable number here is the one you get back from XEN_DMOP_nr_vcpus

GUEST_MAX_VCPUS is and has always been bogus as a compile time constant
in the Xen public headers (yes, ARM inherited it from x86, but it should
have never been copied to start with).  Please do not introduce any
further uses of it.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 17:49:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 17:49:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776538.1186698 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdve6-0000Bj-2G; Tue, 13 Aug 2024 17:49:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776538.1186698; Tue, 13 Aug 2024 17:49:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdve5-0000Bc-VV; Tue, 13 Aug 2024 17:49:21 +0000
Received: by outflank-mailman (input) for mailman id 776538;
 Tue, 13 Aug 2024 17:49: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=nBzl=PM=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1sdve4-0000BW-U2
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 17:49:20 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5c925054-599c-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 19:49:19 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.18.1/8.17.1) with ESMTPS id 47DHn7tw031758
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Tue, 13 Aug 2024 13:49:13 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.18.1/8.15.2/Submit) id 47DHn6gB031757;
 Tue, 13 Aug 2024 10:49:06 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5c925054-599c-11ef-a505-bb4a2ccca743
Date: Tue, 13 Aug 2024 10:49:06 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: =?iso-8859-1?Q?J=FCrgen_Gro=DF?= <jgross@suse.com>
Cc: Andrei Semenov <andrei.semenov@vates.tech>, xen-devel@lists.xenproject.org,
        Andrew Cooper <andrew.cooper3@citrix.com>,
        Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Subject: Re: AMD EPYC virtual network performances
Message-ID: <ZruckufSjT0GkpJt@mattapan.m5p.com>
References: <959bbf84-24da-4da3-a059-dc1aa32b27ef@vates.tech>
 <352bba40-27fc-416b-985f-20e66c0c4b72@suse.com>
 <Zrqykdarr7JHaeOZ@mattapan.m5p.com>
 <ab4ca68e-ec1b-467f-9b89-38f63cc19b7c@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ab4ca68e-ec1b-467f-9b89-38f63cc19b7c@suse.com>
X-Spam-Status: No, score=0.3 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=4.0.1
X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on mattapan.m5p.com

On Tue, Aug 13, 2024 at 01:16:06PM +0200, Jrgen Gro wrote:
> On 13.08.24 03:10, Elliott Mitchell wrote:
> > On Tue, Jul 09, 2024 at 11:37:07AM +0200, Jrgen Gro wrote:
> > > 
> > > In both directories you can see the number of spurious events by looking
> > > into the spurious_events file.
> > > 
> > > In the end the question is why so many spurious events are happening. Finding
> > > the reason might be hard, though.
> > 
> > Hopefully my comments on this drew your attention, yet lack of response
> > suggests otherwise.  I'm wondering whether this is an APIC misprogramming
> > issue, similar to the x2APIC issue which was causing trouble with recent
> > AMD processors.
> > 
> > Trying to go after the Linux software RAID1, my current attempt is
> > "iommu=debug iommu=no-intremap".  I'm seeing *lots* of messages from
> > spurious events in `xl dmesg`.  So many I have a difficult time believing
> > they are related to hardware I/O.
> 
> Seeing them in `xl dmesg` means those spurious events are seen by the
> hypervisor, not by the Linux kernel.

Indeed.  Yet this seems to be pointing at a problem, whereas most other
information sources merely indicate there is a problem.

I'm unable to resolve those to hardware.  This could mean those are being
synthesized by software and when crossing some interface they get
reinterpreted as hardware events.  This could mean those are hardware
events, but somewhere inside Xen information is being corrupted and the
information displayed is unrelated to the original event (x2APIC
misinterpretation?).


> > In which case could the performance problem observed by Andrei Semenov
> > be due to misprogramming of [x2]APIC triggering spurious events?
> 
> I don't see a connection here, as spurious interrupts (as seen by the
> hypervisor in your case) and spurious events (as seen by Andrei) are
> completely different (hardware vs. software level).

The entries seem to appear at an average of about 1/hour.  Could be most
events are being dropped and 10x that number are occuring.  If so, those
extras could be turning into spurious events seen by various domains.

There is a possibility spurious interrupts are being turned into spurious
events by the back-end drivers.

Jrgen Gro, what is the performance impact of "iommu=debug"?  Seems to
mostly cause more reporting and have minimal/no performance effect.


Andrei Semenov, if you're allowed to release information about your
systems:  What is your mix of guest types (<1% PV, 90% PVH, 9% HVM?)?

Is there any pattern of PIC type and driver on effected/uneffected
systems?  I would suspect most/all of your systems to have a x2APIC.
Which of, cluster mode, mixed mode, physical mode, or other do they use?
("Using APIC driver x2apic_mixed" => x2APIC, mixed-mode)

Assuming Jrgen Gro confirms "iommu=debug" has minimal/no performance
impact;  Would it be possible to try booting one or more effected systems
with "iommu=debug" on Xen's command-line?  I'm wondering whether you
observe lines of "No irq handler for vector" or spurious interrupt lines
in Xen's dmesg.


The pattern of events in `xl dmesg` seems to better match spurious events
being sent to/from my single HVM domain, rather than the RAID1 issue.  In
particular there are too many distinct interrupt numberss to match the
hardware used for RAID.  Whereas there aren't enough distinct interrupt
numbers to account for every single event channel with spurious events
(several PVH domains).


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Tue Aug 13 18:56:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 18:56:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776553.1186708 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdwgN-0002LB-QF; Tue, 13 Aug 2024 18:55:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776553.1186708; Tue, 13 Aug 2024 18:55:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdwgN-0002L4-MY; Tue, 13 Aug 2024 18:55:47 +0000
Received: by outflank-mailman (input) for mailman id 776553;
 Tue, 13 Aug 2024 18:55:46 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=k7wN=PM=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sdwgM-0002Kv-5E
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 18:55:46 +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 a4d88cc6-59a5-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 20:55:44 +0200 (CEST)
Received: by mail-lj1-x22c.google.com with SMTP id
 38308e7fff4ca-2eeb1ba040aso80323531fa.1
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 11:55:44 -0700 (PDT)
Received: from ?IPV6:2003:e5:8741:4a00:60e5:7bee:fc48:e85c?
 (p200300e587414a0060e57beefc48e85c.dip0.t-ipconnect.de.
 [2003:e5:8741:4a00:60e5:7bee:fc48:e85c])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5be9feb7528sm209603a12.82.2024.08.13.11.55.42
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 11:55:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a4d88cc6-59a5-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723575343; x=1724180143; 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=CL0U3SDUUykaULDpOU7zUo+SXuvTE2F0sAePe1MfE+Y=;
        b=Yi0b+qgHySeXxffGi0RthD8/JSYsmzKIrFo+eGRWdfdMa3LLP4HdKNIPB3VWY8/TuT
         AVFnyi1o62gwHOArqmFP/mL8AFAzz9C/bA71Vvg9QvLwagckYRK+jRDFMDaD4OQiDSL/
         CjMIqrCN2BxAe1UxPyrt2nJxThVZkBiv4qf156qAk8n4TjyQFX86bW4I7Yr5sffnm3wl
         LiNBGFgpv+J3TouwmTKQ61aXNYdu80YSmbdwlRW8uOfonvjzApTVHP0xsRnEF/ZqC6V4
         i10sRHASpSgVAfnM0YoRN3+FxzC/+Aloju2xkSG1wUlr+kLHkJeXkEi+Nb9t2UG8iFWX
         x+Lg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723575343; x=1724180143;
        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=CL0U3SDUUykaULDpOU7zUo+SXuvTE2F0sAePe1MfE+Y=;
        b=M+Ptw22TNRSUvxYz18+8G6w6htO6iNR3Vrgmu70h+QA/nyoMiH7alSD533yiAttQNV
         0itho75JDlwHHxVD7bD9pYKKeFDQHR4qt7LAarutaqPaY0f1TFInlobfKBmmbjUB7v0E
         XPcFZYNC1Bjo0n/AA8IJWlYyCoxFEUqelL9jVQeLyO585kH3W7ILobXwU5QvmaBaLZ0k
         UuKmUMg2GbhiVHEiuzg0vro+NNpJXaouSNoNdFk02JAeLKkq9XByBWeZR7PAOcpogCOl
         wDpMBwii4GJ2GSDViUGIwv7xEDjHDGC7vyRrDGy2gOwsl9Os/hviT99YmVUe+kQzDUC0
         2W+Q==
X-Forwarded-Encrypted: i=1; AJvYcCV7O5mpnEDxOGueHC2GHW+j9vvLXycaWGTVQtKw42pUV6MAFTyBi45i+fW8vDcQuyVI40DsWjH97Oc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwXuyJlQiuX+fkpPeW+gLCyBTWF09BjGt2YBqCUc3jh73qFJqA5
	FXouDM6tJVtw7In8BEdPRlLbnPzurGZ1zF8I/dRMfPXocSk/IwdXljVvlDZzOG8=
X-Google-Smtp-Source: AGHT+IEN22P0n1AiwoAkSfZ9sdK0oQ4xnnzmFNoelj7AMOyQIB/xDEaYJqcydLVz8KcpeZtTOyC8bA==
X-Received: by 2002:a2e:bc1a:0:b0:2ef:2472:41c7 with SMTP id 38308e7fff4ca-2f3aa1c9518mr2509901fa.7.1723575343317;
        Tue, 13 Aug 2024 11:55:43 -0700 (PDT)
Message-ID: <d556e168-8542-4b93-81a9-a7054b5b69ba@suse.com>
Date: Tue, 13 Aug 2024 20:55:42 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: AMD EPYC virtual network performances
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: Andrei Semenov <andrei.semenov@vates.tech>,
 xen-devel@lists.xenproject.org, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <959bbf84-24da-4da3-a059-dc1aa32b27ef@vates.tech>
 <352bba40-27fc-416b-985f-20e66c0c4b72@suse.com>
 <Zrqykdarr7JHaeOZ@mattapan.m5p.com>
 <ab4ca68e-ec1b-467f-9b89-38f63cc19b7c@suse.com>
 <ZruckufSjT0GkpJt@mattapan.m5p.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <ZruckufSjT0GkpJt@mattapan.m5p.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 13.08.24 19:49, Elliott Mitchell wrote:
> On Tue, Aug 13, 2024 at 01:16:06PM +0200, Jürgen Groß wrote:
>> On 13.08.24 03:10, Elliott Mitchell wrote:
>>> On Tue, Jul 09, 2024 at 11:37:07AM +0200, Jürgen Groß wrote:
>>>>
>>>> In both directories you can see the number of spurious events by looking
>>>> into the spurious_events file.
>>>>
>>>> In the end the question is why so many spurious events are happening. Finding
>>>> the reason might be hard, though.
>>>
>>> Hopefully my comments on this drew your attention, yet lack of response
>>> suggests otherwise.  I'm wondering whether this is an APIC misprogramming
>>> issue, similar to the x2APIC issue which was causing trouble with recent
>>> AMD processors.
>>>
>>> Trying to go after the Linux software RAID1, my current attempt is
>>> "iommu=debug iommu=no-intremap".  I'm seeing *lots* of messages from
>>> spurious events in `xl dmesg`.  So many I have a difficult time believing
>>> they are related to hardware I/O.
>>
>> Seeing them in `xl dmesg` means those spurious events are seen by the
>> hypervisor, not by the Linux kernel.
> 
> Indeed.  Yet this seems to be pointing at a problem, whereas most other
> information sources merely indicate there is a problem.
> 
> I'm unable to resolve those to hardware.  This could mean those are being
> synthesized by software and when crossing some interface they get
> reinterpreted as hardware events.  This could mean those are hardware
> events, but somewhere inside Xen information is being corrupted and the
> information displayed is unrelated to the original event (x2APIC
> misinterpretation?).
> 
> 
>>> In which case could the performance problem observed by Andrei Semenov
>>> be due to misprogramming of [x2]APIC triggering spurious events?
>>
>> I don't see a connection here, as spurious interrupts (as seen by the
>> hypervisor in your case) and spurious events (as seen by Andrei) are
>> completely different (hardware vs. software level).
> 
> The entries seem to appear at an average of about 1/hour.  Could be most
> events are being dropped and 10x that number are occuring.  If so, those
> extras could be turning into spurious events seen by various domains.

Even 10 spurious events per hour should not have a measurable impact
on performance.

> There is a possibility spurious interrupts are being turned into spurious
> events by the back-end drivers.

No, I don't think so.

> Jürgen Groß, what is the performance impact of "iommu=debug"?  Seems to
> mostly cause more reporting and have minimal/no performance effect.

I guess you are referring to the Xen option? I'm no expert in this
area.


Juergen



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 19:00:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 19:00:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776561.1186718 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdwkW-0003qp-En; Tue, 13 Aug 2024 19:00:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776561.1186718; Tue, 13 Aug 2024 19:00:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdwkW-0003qO-Bo; Tue, 13 Aug 2024 19:00:04 +0000
Received: by outflank-mailman (input) for mailman id 776561;
 Tue, 13 Aug 2024 19:00:03 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=MCJY=PM=bounce.vates.tech=bounce-md_30504962.66bbad2d.v1-15a93eaf01c345ee8cefb9544269e0db@srs-se1.protection.inumbo.net>)
 id 1sdwkV-0003ct-HZ
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 19:00:03 +0000
Received: from mail135-25.atl141.mandrillapp.com
 (mail135-25.atl141.mandrillapp.com [198.2.135.25])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3da94242-59a6-11ef-8776-851b0ebba9a2;
 Tue, 13 Aug 2024 21:00:01 +0200 (CEST)
Received: from pmta14.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail135-25.atl141.mandrillapp.com (Mailchimp) with ESMTP id
 4Wk10Y352Rz4f3k3f
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 18:59:57 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 15a93eaf01c345ee8cefb9544269e0db; Tue, 13 Aug 2024 18:59:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3da94242-59a6-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1723575597; x=1723836097;
	bh=jApk1oSyqSGAleIrGQXOfYFF3DlJnkMxjXzHJyQS17g=;
	h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From;
	b=pJ1EaBZdZRqygP9lp2cEOUH4PqFZxUbx3BWVWOgItZv63aLaoDPpk3DbZciBfbnRx
	 ejy+Q0w+z06gMlPMrBzaqi5sipeTgx/9Roy8JXOJ7rWnz+0A1nJzel2b/L5udU+BLp
	 WV51hm9sdhsdq0LT1HvtgB9nfCHxWTa5q8srXe218vNSCBk7k9kpsh4dqKliAUlEcd
	 6U2niuwOYDQV6yVZGj3nfESW+/lm62/LGWazk+RufCqTy1sTFpoA6tEg04grtBbK6K
	 7+EwMMCr8unR1Yu9GAkVTzx6lyoFbZhNVLoiWLlwg+Az+Z5yM77n8OKrA0d078xNnn
	 IeNBw7oBVNckw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1723575597; x=1723836097; i=vaishali.thakkar@vates.tech;
	bh=jApk1oSyqSGAleIrGQXOfYFF3DlJnkMxjXzHJyQS17g=;
	h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From;
	b=ZL6B1es2q/o/fvZxJ3L4X2kMB3PB6LW8mwS6wfvsoKOkGYm/IIh4FA1sjwzNikrs2
	 5u8QSvkKGn5PW/RW9zpYZMZl0ITvgbvUwuUl4bCqIrCnGN6MC/1m5/2RnHCoXIh/hh
	 JE/peRP5DmyqHVRVkBSUtqlVG8RlL0fn4v3qfk7iibsbG+12o6/1/kn+2V+p46VC67
	 nVDdGLedwaBjn85pHTE5fkOsJi/xYeH+DNOSpBoqUCKYncbRqJ4w0sy/sXg8YlcO8b
	 00CLbpz4ScO3+FLbyBnh2/qmoxwWR6Byi02GeIqmuk398pgn9Ri7Tnpr0YdNGcUCwm
	 ZZEZdoU72FhSw==
From: Vaishali Thakkar <vaishali.thakkar@vates.tech>
Subject: =?utf-8?Q?[RFC-for-4.20=20v2=200/1]=20x86/hvm:=20Introduce=20Xen-wide=20ASID=20allocator?=
X-Mailer: git-send-email 2.46.0
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1723575596514
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Vaishali Thakkar <vaishali.thakkar@vates.tech>
Message-Id: <cover.1723574652.git.vaishali.thakkar@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.15a93eaf01c345ee8cefb9544269e0db?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240813:md
Date: Tue, 13 Aug 2024 18:59:57 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Motivation:
-----------
This is part of the effort to enable AMD SEV technologies in Xen. For
AMD SEV support, we need a fixed ASID associated with all vcpus of the
same domain throughout the domain's lifetime. This is because for SEV/
SEV-{ES,SNP} VM, the ASID is the index which is associated with the
encryption key.

Currently, ASID generation and management is done per-PCPU in Xen. And
at the time of each VMENTER, the ASID associated with vcpus of the
domain is changed. This implementation is incompatible with SEV
technologies for the above mentioned reasons. In a discussion with
Andrew Cooper, it came up that it=E2=80=99ll be nice to have fixed ASIDs no=
t
only for SEV VMs but also for all VMs. Because it opens up the
opportunity to use instructions like TLBSYNC and INVLPGB (Section
5.5.3 in AMD Architecture manual[0]) for broadcasting the TLB
Invalidations.

Changes since v1:
-----------------
As discussed in v1 and at the Xen summit, this version changes the
flow of the asid assignment. I initialize asids by calling CPUID
on each cpu during the __start_xen. The assignment of the asid
happens at the domain creation time at HVM level and later it is
mapped to individual hardware fields ASID/VPID at the VMRUN. ASID
is flushed when the domain is destroyed. Please check the comment in
xen/arch/x86/hvm/asid.c to check the implemenmtation flow. Detailed
list of changes is mentioned in the patch.

Few questions I have:
---------------------
1. While in this version I keep using hvm_asid_flush_domain in svm_invlpg,
I'm wondering if we need to do hvm_asid_flush_vcpu in this case? If so,
what would be the preferred way to flush vcpu specific TLB entries here?
2. Currently I assign asid at the VCPU level at VMRUN. But is there any
way to do it more early in the process? I tried to do it after the
hvm_vcpu_initialize and hvm_vcpu_up but wasn't really successfull in
doing so.
3. While there is a plan to use TLBSYNC in the future. My understanding
is intel doesn't have an equivalent instruction. Do we need a separate
function that is able to do it?
4. How is the freeing of resources done when Xen is destroyed? I couldn't
find something equivalent of svm_hardware_unsetup in linux kernel.

Notes:
------
1. As discussed at Xen Summit, changes related to demonstrating the use
of TLBSYNC and INVLPGB won't be part of this patchset.
2. Changes are tested on AMD EPYC Genoa at the moment.

Vaishali Thakkar (1):
  x86/hvm: Introduce Xen-wide ASID allocator

 xen/arch/x86/domain.c                  |   7 ++
 xen/arch/x86/flushtlb.c                |   4 -
 xen/arch/x86/hvm/asid.c                | 136 +++++++++++++------------
 xen/arch/x86/hvm/hvm.c                 |   6 +-
 xen/arch/x86/hvm/nestedhvm.c           |   4 +-
 xen/arch/x86/hvm/svm/asid.c            |  37 ++++---
 xen/arch/x86/hvm/svm/nestedsvm.c       |   5 +-
 xen/arch/x86/hvm/svm/svm.c             |  32 ++----
 xen/arch/x86/hvm/svm/svm.h             |   3 -
 xen/arch/x86/hvm/vmx/vmcs.c            |   2 -
 xen/arch/x86/hvm/vmx/vmx.c             |  37 ++-----
 xen/arch/x86/hvm/vmx/vvmx.c            |   7 +-
 xen/arch/x86/include/asm/hvm/asid.h    |  24 ++---
 xen/arch/x86/include/asm/hvm/domain.h  |   7 ++
 xen/arch/x86/include/asm/hvm/hvm.h     |  11 --
 xen/arch/x86/include/asm/hvm/svm/svm.h |   2 +
 xen/arch/x86/include/asm/hvm/vcpu.h    |   9 --
 xen/arch/x86/include/asm/hvm/vmx/vmx.h |   3 +-
 xen/arch/x86/mm/hap/hap.c              |   5 +-
 xen/arch/x86/mm/p2m.c                  |   6 +-
 xen/arch/x86/mm/paging.c               |   3 +-
 xen/arch/x86/pv/domain.c               |   1 +
 xen/arch/x86/setup.c                   |  10 ++
 23 files changed, 173 insertions(+), 188 deletions(-)

-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 13 19:01:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 19:01:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776568.1186728 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdwlh-0004qp-Pc; Tue, 13 Aug 2024 19:01:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776568.1186728; Tue, 13 Aug 2024 19:01:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdwlh-0004qi-LH; Tue, 13 Aug 2024 19:01:17 +0000
Received: by outflank-mailman (input) for mailman id 776568;
 Tue, 13 Aug 2024 19:01: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=HaGR=PM=bounce.vates.tech=bounce-md_30504962.66bbad79.v1-ac86e6d5a56745c1ad2a54c7a0e9a345@srs-se1.protection.inumbo.net>)
 id 1sdwlg-0004qZ-Lq
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 19:01:16 +0000
Received: from mail135-13.atl141.mandrillapp.com
 (mail135-13.atl141.mandrillapp.com [198.2.135.13])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 693d84bf-59a6-11ef-a505-bb4a2ccca743;
 Tue, 13 Aug 2024 21:01:14 +0200 (CEST)
Received: from pmta14.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail135-13.atl141.mandrillapp.com (Mailchimp) with ESMTP id
 4Wk1213L7xzNCdGPp
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 19:01:13 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 ac86e6d5a56745c1ad2a54c7a0e9a345; Tue, 13 Aug 2024 19:01:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 693d84bf-59a6-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1723575673; x=1723836173;
	bh=WcP49SarpCpuQDmycLb8IX7agYmIUvzKnX+BNQO34CI=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=PhcavI3yJsnchHC8jGz5zq5ILlyR22t88zSlCUuaTz48zZOalTfJHNN3CqFki6xXz
	 mKd42eRq8G1JUzpY2dawPpFqYDJLmOvnlA8pR3iOB+D58zxsduBQ2dWsVTuLipJKJK
	 OB5HTwTHus0xbEYV1gPrqb2jzIktPJYgo6/aP43BIN8gKvzw3X3DQm22q/YYItygBJ
	 80m61/Fta0sQ8L001TaDk5zmOM50cVfLk3zlr5HaESI8uocb+10TeLMperzLDFwoEZ
	 0qlsVvEL9+2YWdXJwKjoLzkcUkv0s3NVu8mMoFWpN+JjyqKZSsZj7gamlfjomdTl5m
	 0zPsKuDIJ3aRg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1723575673; x=1723836173; i=vaishali.thakkar@vates.tech;
	bh=WcP49SarpCpuQDmycLb8IX7agYmIUvzKnX+BNQO34CI=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=P3jHhzR9gnOYRBNG4t3T+tmuDWZHec/du0rUj77zwvMcTjgYqPIe7YKLY//D9M9cu
	 wQtyh06OVjG+SSc8RfnTvjMHETodstXAWzW3mGl6+NTqF0tMJ/grxht/KQqIh+hTf4
	 /GxSM5NtqYUUNHuWGIQVGkXBfhZkl/q/Hn67QQLJWlD7o8XhGOfPi7CDSIiaveHBK0
	 PD0ahe6SDzVvkrif9GU7XjHfurNW+g1GyfdJDUVgtyIJE2KuVBpK/DmfyDrIt5h5e5
	 k2frI1G8QP222Uc3FoyVUcYel/3ThHYNVbT5HUjDl6B4o72ylYHGP7GUw2jxvN3V3f
	 OJKe4cUrgcPIA==
From: Vaishali Thakkar <vaishali.thakkar@vates.tech>
Subject: =?utf-8?Q?[RFC-for-4.20=20v2=201/1]=20x86/hvm:=20Introduce=20Xen-wide=20ASID=20allocator?=
X-Mailer: git-send-email 2.46.0
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1723575671884
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com, andrew.cooper3@citrix.com, roger.pau@citrix.com, Vaishali Thakkar <vaishali.thakkar@vates.tech>
Message-Id: <8512ff4c4d78fcd59e6f3185d8a5abd9ef3168b8.1723574652.git.vaishali.thakkar@vates.tech>
In-Reply-To: <cover.1723574652.git.vaishali.thakkar@vates.tech>
References: <cover.1723574652.git.vaishali.thakkar@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.ac86e6d5a56745c1ad2a54c7a0e9a345?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240813:md
Date: Tue, 13 Aug 2024 19:01:13 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Currently ASID generation and management is done per-PCPU. This
scheme is incompatible with SEV technologies as SEV VMs need to
have a fixed ASID associated with all vcpus of the VM throughout
it's lifetime.

This commit introduces a Xen-wide allocator which initializes
the asids at the start of xen and allows to have a fixed asids
throughout the lifecycle of all domains. Having a fixed asid
for non-SEV domains also presents us with the opportunity to
further take use of AMD instructions like TLBSYNC and INVLPGB
for broadcasting the TLB invalidations.

Signed-off-by: Vaishali Thakkar <vaishali.thakkar@vates.tech>
---
Changes since v1:
        - Introudce hvm_asid_bitmap as discussed at Xen-summit
        - Introduce hvm_reclaim_bitmap for reusing ASIDs
        - Assign the asid to the domain at the domain creation via
          hvm_asid_domain_create
        - Corrected the use of CPUID in the svm_asid_init function
        - Adjusted the code in nested virtualization related files
          to use new scheme. As discussed at the Xen-summit, this
          is not tested.
        - Addressed Jan's comments about using uniform style for
          accessing domains via v->domain
        - Allow to flush at the vcpu level in HAP code
        - Documented the sketch of implementation for the new scheme
        - Remove min_asid as for this patch, we are not demonstarting
          it's usecase
        - Arrange includes in multiple files as per Jan's feedback
---
 xen/arch/x86/domain.c                  |   7 ++
 xen/arch/x86/flushtlb.c                |   4 -
 xen/arch/x86/hvm/asid.c                | 136 +++++++++++++------------
 xen/arch/x86/hvm/hvm.c                 |   6 +-
 xen/arch/x86/hvm/nestedhvm.c           |   4 +-
 xen/arch/x86/hvm/svm/asid.c            |  37 ++++---
 xen/arch/x86/hvm/svm/nestedsvm.c       |   5 +-
 xen/arch/x86/hvm/svm/svm.c             |  32 ++----
 xen/arch/x86/hvm/svm/svm.h             |   3 -
 xen/arch/x86/hvm/vmx/vmcs.c            |   2 -
 xen/arch/x86/hvm/vmx/vmx.c             |  37 ++-----
 xen/arch/x86/hvm/vmx/vvmx.c            |   7 +-
 xen/arch/x86/include/asm/hvm/asid.h    |  24 ++---
 xen/arch/x86/include/asm/hvm/domain.h  |   7 ++
 xen/arch/x86/include/asm/hvm/hvm.h     |  11 --
 xen/arch/x86/include/asm/hvm/svm/svm.h |   2 +
 xen/arch/x86/include/asm/hvm/vcpu.h    |   9 --
 xen/arch/x86/include/asm/hvm/vmx/vmx.h |   3 +-
 xen/arch/x86/mm/hap/hap.c              |   5 +-
 xen/arch/x86/mm/p2m.c                  |   6 +-
 xen/arch/x86/mm/paging.c               |   3 +-
 xen/arch/x86/pv/domain.c               |   1 +
 xen/arch/x86/setup.c                   |  10 ++
 23 files changed, 173 insertions(+), 188 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index d977ec71ca..75868a2063 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -52,6 +52,7 @@
 #include <asm/ldt.h>
 #include <asm/hvm/hvm.h>
 #include <asm/hvm/nestedhvm.h>
+#include <asm/hvm/asid.h>
 #include <asm/hvm/svm/svm.h>
 #include <asm/hvm/viridian.h>
 #include <asm/debugreg.h>
@@ -784,6 +785,7 @@ int arch_domain_create(struct domain *d,
                        unsigned int flags)
 {
     bool paging_initialised = false;
+    struct hvm_domain_asid *p_asid;
     uint32_t emflags;
     int rc;
 
@@ -898,6 +900,11 @@ int arch_domain_create(struct domain *d,
 
     spec_ctrl_init_domain(d);
 
+    if ( is_hvm_domain(d) ) {
+        p_asid = &d->arch.hvm.n1asid;
+        hvm_asid_domain_create(p_asid);
+    }
+
     return 0;
 
  fail:
diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index 18748b2bc8..7316b177d7 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -124,7 +124,6 @@ void switch_cr3_cr4(unsigned long cr3, unsigned long cr4)
 
     if ( tlb_clk_enabled )
         t = pre_flush();
-    hvm_flush_guest_tlbs();
 
     old_cr4 = read_cr4();
     ASSERT(!(old_cr4 & X86_CR4_PCIDE) || !(old_cr4 & X86_CR4_PGE));
@@ -229,9 +228,6 @@ unsigned int flush_area_local(const void *va, unsigned int flags)
             do_tlb_flush();
     }
 
-    if ( flags & FLUSH_HVM_ASID_CORE )
-        hvm_flush_guest_tlbs();
-
     if ( flags & FLUSH_CACHE )
     {
         const struct cpuinfo_x86 *c = &current_cpu_data;
diff --git a/xen/arch/x86/hvm/asid.c b/xen/arch/x86/hvm/asid.c
index 8d27b7dba1..a916cb865b 100644
--- a/xen/arch/x86/hvm/asid.c
+++ b/xen/arch/x86/hvm/asid.c
@@ -11,51 +11,66 @@
 #include <xen/sched.h>
 #include <xen/smp.h>
 #include <xen/percpu.h>
+
+#include <asm/bitops.h>
 #include <asm/hvm/asid.h>
 
 /* Xen command-line option to enable ASIDs */
 static bool __read_mostly opt_asid_enabled = true;
 boolean_param("asid", opt_asid_enabled);
 
+unsigned long *hvm_asid_bitmap;
+unsigned long *hvm_reclaim_asid_bitmap;
+static DEFINE_SPINLOCK(hvm_asid_lock);
+
 /*
- * ASIDs partition the physical TLB.  In the current implementation ASIDs are
- * introduced to reduce the number of TLB flushes.  Each time the guest's
- * virtual address space changes (e.g. due to an INVLPG, MOV-TO-{CR3, CR4}
- * operation), instead of flushing the TLB, a new ASID is assigned.  This
- * reduces the number of TLB flushes to at most 1/#ASIDs.  The biggest
- * advantage is that hot parts of the hypervisor's code and data retain in
- * the TLB.
- *
  * Sketch of the Implementation:
- *
- * ASIDs are a CPU-local resource.  As preemption of ASIDs is not possible,
- * ASIDs are assigned in a round-robin scheme.  To minimize the overhead of
- * ASID invalidation, at the time of a TLB flush,  ASIDs are tagged with a
- * 64-bit generation.  Only on a generation overflow the code needs to
- * invalidate all ASID information stored at the VCPUs with are run on the
- * specific physical processor.  This overflow appears after about 2^80
- * host processor cycles, so we do not optimize this case, but simply disable
- * ASID useage to retain correctness.
+ * ASIDs are assigned in a round-robin scheme per domain as part of
+ * global allocator scheme and doesn't change during the lifecycle of
+ * the domain. Once vcpus are initialized and are up, we assign the
+ * same ASID to all vcpus of that domain at the first VMRUN. With the
+ * new scheme, we don't need to assign the new ASID during MOV-TO-{CR3,
+ * CR4}. In the case of INVLPG, we flush the TLB entries belonging to
+ * the vcpu and do the reassignment of the ASID belonging to the given
+ * domain.  Currently we do not do anything special for flushing guest
+ * TLBs in flush_area_local as wbinvd() should able to handle this. In
+ * the future Xen should be able to take an advantage of TLBSYNC and
+ * INVLPGB (AMD SVM) with this scheme.
+
+ * When the domain is destroyed, ASID goes to the reclaimable ASID pool
+ * for the reuse. We only go for checking in the reclaimable ASID pool
+ * when we run out of ASIDs in the hvm_asid_bitmap.
  */
 
-/* Per-CPU ASID management. */
+/* Xen-wide ASID management */
 struct hvm_asid_data {
-   uint64_t core_asid_generation;
    uint32_t next_asid;
    uint32_t max_asid;
    bool disabled;
 };
 
-static DEFINE_PER_CPU(struct hvm_asid_data, hvm_asid_data);
+static struct hvm_asid_data asid_data;
 
-void hvm_asid_init(int nasids)
+int hvm_asid_init(int nasids)
 {
+    struct hvm_asid_data *data = &asid_data;
     static int8_t g_disabled = -1;
-    struct hvm_asid_data *data = &this_cpu(hvm_asid_data);
 
     data->max_asid = nasids - 1;
     data->disabled = !opt_asid_enabled || (nasids <= 1);
 
+    hvm_asid_bitmap = xzalloc_array(unsigned long,
+                                    BITS_TO_LONGS(data->max_asid));
+    if ( !hvm_asid_bitmap )
+        return -ENOMEM;
+
+    hvm_reclaim_asid_bitmap = xzalloc_array(unsigned long,
+                                            BITS_TO_LONGS(data->max_asid));
+    if ( !hvm_reclaim_asid_bitmap ) {
+        xfree(hvm_asid_bitmap);
+        hvm_asid_bitmap = NULL;
+    }
+
     if ( g_disabled != data->disabled )
     {
         printk("HVM: ASIDs %sabled.\n", data->disabled ? "dis" : "en");
@@ -63,74 +78,67 @@ void hvm_asid_init(int nasids)
             g_disabled = data->disabled;
     }
 
-    /* Zero indicates 'invalid generation', so we start the count at one. */
-    data->core_asid_generation = 1;
+    /* ASID 0 is reserved, so we start the counting from 1 */
+    data->next_asid = find_first_zero_bit(hvm_asid_bitmap, data->max_asid ) + 1;
 
-    /* Zero indicates 'ASIDs disabled', so we start the count at one. */
-    data->next_asid = 1;
+    return 0;
 }
 
-void hvm_asid_flush_vcpu_asid(struct hvm_vcpu_asid *asid)
+void hvm_asid_flush_domain_asid(struct hvm_domain_asid *asid)
 {
     write_atomic(&asid->generation, 0);
 }
 
-void hvm_asid_flush_vcpu(struct vcpu *v)
+void hvm_asid_flush_domain(struct domain *d)
 {
-    hvm_asid_flush_vcpu_asid(&v->arch.hvm.n1asid);
-    hvm_asid_flush_vcpu_asid(&vcpu_nestedhvm(v).nv_n2asid);
+    hvm_asid_flush_domain_asid(&d->arch.hvm.n1asid);
+    hvm_asid_flush_domain_asid(&d->arch.hvm.nv_n2asid);
 }
 
-void hvm_asid_flush_core(void)
+/* We still allow flushing on vcpu level for non-SEV domain */
+void hvm_asid_flush_vcpu(struct vcpu *v)
 {
-    struct hvm_asid_data *data = &this_cpu(hvm_asid_data);
-
-    if ( data->disabled )
-        return;
-
-    if ( likely(++data->core_asid_generation != 0) )
-        return;
-
-    /*
-     * ASID generations are 64 bit.  Overflow of generations never happens.
-     * For safety, we simply disable ASIDs, so correctness is established; it
-     * only runs a bit slower.
-     */
-    printk("HVM: ASID generation overrun. Disabling ASIDs.\n");
-    data->disabled = 1;
+    hvm_asid_flush_domain_asid(&v->domain->arch.hvm.n1asid);
+    hvm_asid_flush_domain_asid(&v->domain->arch.hvm.nv_n2asid);
 }
 
-bool hvm_asid_handle_vmenter(struct hvm_vcpu_asid *asid)
+/* This function is called while creating a new domain */
+bool hvm_asid_domain_create(struct hvm_domain_asid *asid)
 {
-    struct hvm_asid_data *data = &this_cpu(hvm_asid_data);
+    struct hvm_asid_data *data = &asid_data;
 
     /* On erratum #170 systems we must flush the TLB. 
      * Generation overruns are taken here, too. */
     if ( data->disabled )
         goto disabled;
 
-    /* Test if VCPU has valid ASID. */
-    if ( read_atomic(&asid->generation) == data->core_asid_generation )
-        return 0;
+    spin_lock(&hvm_asid_lock);
+
+    /* We assume that next_asid > max_asid is unlikely at this point*/
+    arch__test_and_set_bit(data->next_asid, hvm_asid_bitmap);
+
+    /* Find the next available asid to assign to the domain*/
+    data->next_asid = find_next_zero_bit(hvm_asid_bitmap, data->next_asid,
+                                         data->max_asid) + 1;
+
+    /* Check if there are any ASIDs to reclaim */
+    if ( data->next_asid > data->max_asid ) {
+        data->next_asid = find_next_bit(hvm_reclaim_asid_bitmap, 0,
+                                             data->max_asid+1);
+        spin_unlock(&hvm_asid_lock);
 
-    /* If there are no free ASIDs, need to go to a new generation */
-    if ( unlikely(data->next_asid > data->max_asid) )
-    {
-        hvm_asid_flush_core();
-        data->next_asid = 1;
         if ( data->disabled )
             goto disabled;
+
+        if ( data->next_asid > data->max_asid )
+            return -EBUSY;
     }
 
-    /* Now guaranteed to be a free ASID. */
-    asid->asid = data->next_asid++;
-    write_atomic(&asid->generation, data->core_asid_generation);
+    spin_unlock(&hvm_asid_lock);
 
-    /*
-     * When we assign ASID 1, flush all TLB entries as we are starting a new
-     * generation, and all old ASID allocations are now stale. 
-     */
-    return (asid->asid == 1);
+    asid->asid = data->next_asid;
+
+    return 0;
 
  disabled:
     asid->asid = 0;
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index f49e29faf7..fbcceb374e 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -777,6 +777,10 @@ void hvm_domain_destroy(struct domain *d)
     }
 
     destroy_vpci_mmcfg(d);
+
+    /* Clear the asid and put it in the reclaimable ASID pool */
+    clear_bit(d->arch.hvm.n1asid.asid, hvm_asid_bitmap);
+    set_bit(d->arch.hvm.n1asid.asid, hvm_reclaim_asid_bitmap);
 }
 
 static int cf_check hvm_save_tsc_adjust(struct vcpu *v, hvm_domain_context_t *h)
@@ -1585,8 +1589,6 @@ int hvm_vcpu_initialise(struct vcpu *v)
     int rc;
     struct domain *d = v->domain;
 
-    hvm_asid_flush_vcpu(v);
-
     spin_lock_init(&v->arch.hvm.tm_lock);
     INIT_LIST_HEAD(&v->arch.hvm.tm_list);
 
diff --git a/xen/arch/x86/hvm/nestedhvm.c b/xen/arch/x86/hvm/nestedhvm.c
index bddd77d810..f1d17becd6 100644
--- a/xen/arch/x86/hvm/nestedhvm.c
+++ b/xen/arch/x86/hvm/nestedhvm.c
@@ -41,8 +41,6 @@ nestedhvm_vcpu_reset(struct vcpu *v)
     nv->stale_np2m = false;
     nv->np2m_generation = 0;
 
-    hvm_asid_flush_vcpu_asid(&nv->nv_n2asid);
-
     alternative_vcall(hvm_funcs.nhvm_vcpu_reset, v);
 
     /* vcpu is in host mode */
@@ -86,7 +84,7 @@ static void cf_check nestedhvm_flushtlb_ipi(void *info)
      * This is cheaper than flush_tlb_local() and has
      * the same desired effect.
      */
-    hvm_asid_flush_core();
+    hvm_asid_flush_domain(d);
     vcpu_nestedhvm(v).nv_p2m = NULL;
     vcpu_nestedhvm(v).stale_np2m = true;
 }
diff --git a/xen/arch/x86/hvm/svm/asid.c b/xen/arch/x86/hvm/svm/asid.c
index 7977a8e86b..63f4d15a15 100644
--- a/xen/arch/x86/hvm/svm/asid.c
+++ b/xen/arch/x86/hvm/svm/asid.c
@@ -4,16 +4,23 @@
  * Copyright (c) 2007, Advanced Micro Devices, Inc.
  */
 
+#include <xen/cpumask.h>
+
+#include <asm/processor.h>
 #include <asm/amd.h>
 #include <asm/hvm/nestedhvm.h>
 #include <asm/hvm/svm/svm.h>
 
 #include "svm.h"
 
-void svm_asid_init(const struct cpuinfo_x86 *c)
+void __init svm_asid_init(void)
 {
+    unsigned int cpu = smp_processor_id();
+    const struct cpuinfo_x86 *c;
     int nasids = 0;
 
+    c = &cpu_data[cpu];
+
     /* Check for erratum #170, and leave ASIDs disabled if it's present. */
     if ( !cpu_has_amd_erratum(c, AMD_ERRATUM_170) )
         nasids = cpuid_ebx(0x8000000aU);
@@ -22,33 +29,31 @@ void svm_asid_init(const struct cpuinfo_x86 *c)
 }
 
 /*
- * Called directly before VMRUN.  Checks if the VCPU needs a new ASID,
- * assigns it, and if required, issues required TLB flushes.
+ * Called directly at the VMRUN of a domain to assign
+ * the asid to all associated vcpus of that domain
  */
-void svm_asid_handle_vmrun(void)
+void svm_vcpu_assign_asid(struct vcpu *v)
 {
-    struct vcpu *curr = current;
-    struct vmcb_struct *vmcb = curr->arch.hvm.svm.vmcb;
-    struct hvm_vcpu_asid *p_asid =
-        nestedhvm_vcpu_in_guestmode(curr)
-        ? &vcpu_nestedhvm(curr).nv_n2asid : &curr->arch.hvm.n1asid;
-    bool need_flush = hvm_asid_handle_vmenter(p_asid);
+    struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
+    struct hvm_domain_asid *p_asid = &v->domain->arch.hvm.n1asid;
 
     /* ASID 0 indicates that ASIDs are disabled. */
     if ( p_asid->asid == 0 )
     {
         vmcb_set_asid(vmcb, true);
         vmcb->tlb_control =
-            cpu_has_svm_flushbyasid ? TLB_CTRL_FLUSH_ASID : TLB_CTRL_FLUSH_ALL;
+            cpu_has_svm_flushbyasid ? TLB_CTRL_FLUSH_ASID :
+            TLB_CTRL_FLUSH_ALL;
         return;
     }
 
-    if ( vmcb_get_asid(vmcb) != p_asid->asid )
+    if ( vmcb_get_asid(vmcb) != p_asid->asid ) {
         vmcb_set_asid(vmcb, p_asid->asid);
-
-    vmcb->tlb_control =
-        !need_flush ? TLB_CTRL_NO_FLUSH :
-        cpu_has_svm_flushbyasid ? TLB_CTRL_FLUSH_ASID : TLB_CTRL_FLUSH_ALL;
+        vmcb->tlb_control = cpu_has_svm_flushbyasid ? TLB_CTRL_FLUSH_ASID :
+                            TLB_CTRL_FLUSH_ALL;
+    }
+    else
+        return;
 }
 
 /*
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 35a2cbfd7d..102b1a9328 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -486,7 +486,7 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs)
     if ( rc )
         return rc;
 
-    /* ASID - Emulation handled in hvm_asid_handle_vmenter() */
+    /* ASID - Emulation handled in hvm_asid_domain_create */
 
     /* TLB control */
     n2vmcb->tlb_control = ns_vmcb->tlb_control;
@@ -681,6 +681,7 @@ nsvm_vcpu_vmentry(struct vcpu *v, struct cpu_user_regs *regs,
     struct nestedvcpu *nv = &vcpu_nestedhvm(v);
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
     struct vmcb_struct *ns_vmcb;
+    struct domain *d = v->domain;
 
     ns_vmcb = nv->nv_vvmcx;
     ASSERT(ns_vmcb != NULL);
@@ -699,7 +700,7 @@ nsvm_vcpu_vmentry(struct vcpu *v, struct cpu_user_regs *regs,
     if ( svm->ns_asid != vmcb_get_asid(ns_vmcb))
     {
         nv->nv_flushp2m = 1;
-        hvm_asid_flush_vcpu_asid(&vcpu_nestedhvm(v).nv_n2asid);
+        hvm_asid_flush_domain_asid(&d->arch.hvm.nv_n2asid);
         svm->ns_asid = vmcb_get_asid(ns_vmcb);
     }
 
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 92bb10c504..49fac7782f 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -25,6 +25,7 @@
 #include <asm/hvm/monitor.h>
 #include <asm/hvm/nestedhvm.h>
 #include <asm/hvm/support.h>
+#include <asm/hvm/asid.h>
 #include <asm/hvm/svm/svm.h>
 #include <asm/hvm/svm/svmdebug.h>
 #include <asm/hvm/svm/vmcb.h>
@@ -179,17 +180,7 @@ static void cf_check svm_update_guest_cr(
         break;
     case 3:
         vmcb_set_cr3(vmcb, v->arch.hvm.hw_cr[3]);
-        if ( !nestedhvm_enabled(v->domain) )
-        {
-            if ( !(flags & HVM_UPDATE_GUEST_CR3_NOFLUSH) )
-                hvm_asid_flush_vcpu(v);
-        }
-        else if ( nestedhvm_vmswitch_in_progress(v) )
-            ; /* CR3 switches during VMRUN/VMEXIT do not flush the TLB. */
-        else if ( !(flags & HVM_UPDATE_GUEST_CR3_NOFLUSH) )
-            hvm_asid_flush_vcpu_asid(
-                nestedhvm_vcpu_in_guestmode(v)
-                ? &vcpu_nestedhvm(v).nv_n2asid : &v->arch.hvm.n1asid);
+        /* Do not flush during the CR3 switch */
         break;
     case 4:
         value = HVM_CR4_HOST_MASK;
@@ -989,8 +980,6 @@ static void noreturn cf_check svm_do_resume(void)
         v->arch.hvm.svm.launch_core = smp_processor_id();
         hvm_migrate_timers(v);
         hvm_migrate_pirqs(v);
-        /* Migrating to another ASID domain.  Request a new ASID. */
-        hvm_asid_flush_vcpu(v);
     }
 
     if ( !vcpu_guestmode && !vlapic_hw_disabled(vlapic) )
@@ -1017,7 +1006,7 @@ void asmlinkage svm_vmenter_helper(void)
 
     ASSERT(hvmemul_cache_disabled(curr));
 
-    svm_asid_handle_vmrun();
+    svm_vcpu_assign_asid(curr);
 
     TRACE_TIME(TRC_HVM_VMENTRY |
                (nestedhvm_vcpu_in_guestmode(curr) ? TRC_HVM_NESTEDFLAG : 0));
@@ -1571,9 +1560,6 @@ static int _svm_cpu_up(bool bsp)
     /* check for erratum 383 */
     svm_init_erratum_383(c);
 
-    /* Initialize core's ASID handling. */
-    svm_asid_init(c);
-
     /* Initialize OSVW bits to be used by guests */
     svm_host_osvw_init();
 
@@ -2333,12 +2319,12 @@ static void svm_vmexit_do_invalidate_cache(struct cpu_user_regs *regs,
 }
 
 static void svm_invlpga_intercept(
-    struct vcpu *v, unsigned long linear, uint32_t asid)
+    struct domain *d, unsigned long linear, uint32_t asid)
 {
     svm_invlpga(linear,
                 (asid == 0)
-                ? v->arch.hvm.n1asid.asid
-                : vcpu_nestedhvm(v).nv_n2asid.asid);
+                ? d->arch.hvm.n1asid.asid
+                : d->arch.hvm.nv_n2asid.asid);
 }
 
 static void svm_invlpg_intercept(unsigned long linear)
@@ -2359,8 +2345,8 @@ static bool cf_check is_invlpg(
 
 static void cf_check svm_invlpg(struct vcpu *v, unsigned long linear)
 {
-    /* Safe fallback. Take a new ASID. */
-    hvm_asid_flush_vcpu(v);
+    /* Flush the TLB entries belonging to the vcpu and reassign the asid. */
+    hvm_asid_flush_domain(v->domain);
 }
 
 static bool cf_check svm_get_pending_event(
@@ -2929,7 +2915,7 @@ void asmlinkage svm_vmexit_handler(void)
         }
         if ( (insn_len = svm_get_insn_len(v, INSTR_INVLPGA)) == 0 )
             break;
-        svm_invlpga_intercept(v, regs->rax, regs->ecx);
+        svm_invlpga_intercept(v->domain, regs->rax, regs->ecx);
         __update_guest_eip(regs, insn_len);
         break;
 
diff --git a/xen/arch/x86/hvm/svm/svm.h b/xen/arch/x86/hvm/svm/svm.h
index 8dbf37ff49..b285e3c7d9 100644
--- a/xen/arch/x86/hvm/svm/svm.h
+++ b/xen/arch/x86/hvm/svm/svm.h
@@ -15,9 +15,6 @@ struct cpu_user_regs;
 struct cpuinfo_x86;
 struct vcpu;
 
-void svm_asid_init(const struct cpuinfo_x86 *c);
-void svm_asid_handle_vmrun(void);
-
 unsigned long *svm_msrbit(unsigned long *msr_bitmap, uint32_t msr);
 void __update_guest_eip(struct cpu_user_regs *regs, unsigned int inst_len);
 
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 5787110a56..5585f2c4b3 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1957,8 +1957,6 @@ void cf_check vmx_do_resume(void)
          * but the action of another VMCS is deferred till it is switched in.
          */
         v->arch.hvm.vmx.hostenv_migrated = 1;
-
-        hvm_asid_flush_vcpu(v);
     }
 
     debug_state = v->domain->debugger_attached
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 2f7add834a..382b35595a 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1463,7 +1463,7 @@ static void cf_check vmx_handle_cd(struct vcpu *v, unsigned long value)
             vmx_set_msr_intercept(v, MSR_IA32_CR_PAT, VMX_MSR_RW);
 
             wbinvd();               /* flush possibly polluted cache */
-            hvm_asid_flush_vcpu(v); /* invalidate memory type cached in TLB */
+            hvm_asid_flush_domain(v->domain); /* invalidate memory type cached in TLB */
             v->arch.hvm.cache_mode = NO_FILL_CACHE_MODE;
         }
         else
@@ -1472,7 +1472,7 @@ static void cf_check vmx_handle_cd(struct vcpu *v, unsigned long value)
             vmx_set_guest_pat(v, *pat);
             if ( !is_iommu_enabled(v->domain) || iommu_snoop )
                 vmx_clear_msr_intercept(v, MSR_IA32_CR_PAT, VMX_MSR_RW);
-            hvm_asid_flush_vcpu(v); /* no need to flush cache */
+            hvm_asid_flush_domain(v->domain);
         }
     }
 }
@@ -1832,8 +1832,6 @@ static void cf_check vmx_update_guest_cr(
 
         __vmwrite(GUEST_CR3, v->arch.hvm.hw_cr[3]);
 
-        if ( !(flags & HVM_UPDATE_GUEST_CR3_NOFLUSH) )
-            hvm_asid_flush_vcpu(v);
         break;
 
     default:
@@ -4809,9 +4807,8 @@ bool asmlinkage vmx_vmenter_helper(const struct cpu_user_regs *regs)
 {
     struct vcpu *curr = current;
     struct domain *currd = curr->domain;
-    u32 new_asid, old_asid;
-    struct hvm_vcpu_asid *p_asid;
-    bool need_flush;
+    u32 asid;
+    struct hvm_domain_asid *p_asid;
 
     ASSERT(hvmemul_cache_disabled(curr));
 
@@ -4825,36 +4822,22 @@ bool asmlinkage vmx_vmenter_helper(const struct cpu_user_regs *regs)
     if ( !cpu_has_vmx_vpid )
         goto out;
     if ( nestedhvm_vcpu_in_guestmode(curr) )
-        p_asid = &vcpu_nestedhvm(curr).nv_n2asid;
+        p_asid = &currd->arch.hvm.nv_n2asid;
     else
-        p_asid = &curr->arch.hvm.n1asid;
+        p_asid = &currd->arch.hvm.n1asid;
 
-    old_asid = p_asid->asid;
-    need_flush = hvm_asid_handle_vmenter(p_asid);
-    new_asid = p_asid->asid;
-
-    if ( unlikely(new_asid != old_asid) )
+    if ( unlikely(asid = p_asid->asid) )
     {
-        __vmwrite(VIRTUAL_PROCESSOR_ID, new_asid);
-        if ( !old_asid && new_asid )
+        __vmwrite(VIRTUAL_PROCESSOR_ID, asid);
+        if (!asid) 
         {
-            /* VPID was disabled: now enabled. */
+            /* VPID was disabled: now enabled */
             curr->arch.hvm.vmx.secondary_exec_control |=
                 SECONDARY_EXEC_ENABLE_VPID;
             vmx_update_secondary_exec_control(curr);
         }
-        else if ( old_asid && !new_asid )
-        {
-            /* VPID was enabled: now disabled. */
-            curr->arch.hvm.vmx.secondary_exec_control &=
-                ~SECONDARY_EXEC_ENABLE_VPID;
-            vmx_update_secondary_exec_control(curr);
-        }
     }
 
-    if ( unlikely(need_flush) )
-        vpid_sync_all();
-
     if ( paging_mode_hap(curr->domain) )
     {
         struct ept_data *ept = &p2m_get_hostp2m(currd)->ept;
diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index c05e0e9326..facd7c3a47 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1254,7 +1254,7 @@ static void virtual_vmentry(struct cpu_user_regs *regs)
 
         if ( nvmx->guest_vpid != new_vpid )
         {
-            hvm_asid_flush_vcpu_asid(&vcpu_nestedhvm(v).nv_n2asid);
+            hvm_asid_flush_domain_asid(&v->domain->arch.hvm.nv_n2asid);
             nvmx->guest_vpid = new_vpid;
         }
     }
@@ -2044,6 +2044,7 @@ static int nvmx_handle_invvpid(struct cpu_user_regs *regs)
 {
     struct vmx_inst_decoded decode;
     unsigned long vpid;
+    struct domain *currd = current->domain; 
     int ret;
 
     if ( (ret = decode_vmx_inst(regs, &decode, &vpid)) != X86EMUL_OKAY )
@@ -2055,8 +2056,8 @@ static int nvmx_handle_invvpid(struct cpu_user_regs *regs)
     case INVVPID_INDIVIDUAL_ADDR:
     case INVVPID_SINGLE_CONTEXT:
     case INVVPID_ALL_CONTEXT:
-        hvm_asid_flush_vcpu_asid(&vcpu_nestedhvm(current).nv_n2asid);
-        break;
+        hvm_asid_flush_domain_asid(&currd->arch.hvm.nv_n2asid);
+      break;
     default:
         vmfail(regs, VMX_INSN_INVEPT_INVVPID_INVALID_OP);
         return X86EMUL_OKAY;
diff --git a/xen/arch/x86/include/asm/hvm/asid.h b/xen/arch/x86/include/asm/hvm/asid.h
index 17c58353d1..c71d17209a 100644
--- a/xen/arch/x86/include/asm/hvm/asid.h
+++ b/xen/arch/x86/include/asm/hvm/asid.h
@@ -8,25 +8,25 @@
 #ifndef __ASM_X86_HVM_ASID_H__
 #define __ASM_X86_HVM_ASID_H__
 
+struct hvm_domain_asid;
+extern unsigned long *hvm_asid_bitmap;
+extern unsigned long *hvm_reclaim_asid_bitmap;
 
-struct vcpu;
-struct hvm_vcpu_asid;
 
-/* Initialise ASID management for the current physical CPU. */
-void hvm_asid_init(int nasids);
+/* Initialise ASID management distributed across all CPUs. */
+int hvm_asid_init(int nasids);
 
 /* Invalidate a particular ASID allocation: forces re-allocation. */
-void hvm_asid_flush_vcpu_asid(struct hvm_vcpu_asid *asid);
+void hvm_asid_flush_domain_asid(struct hvm_domain_asid *asid);
 
-/* Invalidate all ASID allocations for specified VCPU: forces re-allocation. */
-void hvm_asid_flush_vcpu(struct vcpu *v);
+/* Invalidate all ASID allocations for specified domain */
+void hvm_asid_flush_domain(struct domain *d);
 
-/* Flush all ASIDs on this processor core. */
-void hvm_asid_flush_core(void);
+/* Invalidate ASID allocation for the specified vcpu */
+void hvm_asid_flush_vcpu(struct vcpu *v);
 
-/* Called before entry to guest context. Checks ASID allocation, returns a
- * boolean indicating whether all ASIDs must be flushed. */
-bool hvm_asid_handle_vmenter(struct hvm_vcpu_asid *asid);
+/* Called while creating a domain to assign an ASID */
+bool hvm_asid_domain_create(struct hvm_domain_asid *asid);
 
 #endif /* __ASM_X86_HVM_ASID_H__ */
 
diff --git a/xen/arch/x86/include/asm/hvm/domain.h b/xen/arch/x86/include/asm/hvm/domain.h
index dd9d837e84..4d12bafcd1 100644
--- a/xen/arch/x86/include/asm/hvm/domain.h
+++ b/xen/arch/x86/include/asm/hvm/domain.h
@@ -50,6 +50,11 @@ struct hvm_pi_ops {
     void (*vcpu_block)(struct vcpu *v);
 };
 
+struct hvm_domain_asid {
+    uint64_t generation;
+    uint32_t asid;
+};
+
 struct hvm_domain {
     /* Guest page range used for non-default ioreq servers */
     struct {
@@ -141,6 +146,8 @@ struct hvm_domain {
     } write_map;
 
     struct hvm_pi_ops pi_ops;
+    struct hvm_domain_asid n1asid;
+    struct hvm_domain_asid nv_n2asid;
 
     union {
         struct vmx_domain vmx;
diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/hvm/hvm.h
index 518ba5319b..afd0e580ca 100644
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -466,17 +466,6 @@ static inline void hvm_set_tsc_offset(struct vcpu *v, uint64_t offset,
     alternative_vcall(hvm_funcs.set_tsc_offset, v, offset, at_tsc);
 }
 
-/*
- * Called to ensure than all guest-specific mappings in a tagged TLB are 
- * flushed; does *not* flush Xen's TLB entries, and on processors without a 
- * tagged TLB it will be a noop.
- */
-static inline void hvm_flush_guest_tlbs(void)
-{
-    if ( hvm_enabled )
-        hvm_asid_flush_core();
-}
-
 static inline unsigned int
 hvm_get_cpl(struct vcpu *v)
 {
diff --git a/xen/arch/x86/include/asm/hvm/svm/svm.h b/xen/arch/x86/include/asm/hvm/svm/svm.h
index 4eeeb25da9..aeeae6c86c 100644
--- a/xen/arch/x86/include/asm/hvm/svm/svm.h
+++ b/xen/arch/x86/include/asm/hvm/svm/svm.h
@@ -21,6 +21,8 @@ bool svm_load_segs(unsigned int ldt_ents, unsigned long ldt_base,
                    unsigned long fs_base, unsigned long gs_base,
                    unsigned long gs_shadow);
 
+extern void svm_asid_init(void);
+extern void svm_vcpu_assign_asid(struct vcpu *v);
 extern u32 svm_feature_flags;
 
 #define SVM_FEATURE_NPT            0 /* Nested page table support */
diff --git a/xen/arch/x86/include/asm/hvm/vcpu.h b/xen/arch/x86/include/asm/hvm/vcpu.h
index 64c7a6fede..b951e5f1dd 100644
--- a/xen/arch/x86/include/asm/hvm/vcpu.h
+++ b/xen/arch/x86/include/asm/hvm/vcpu.h
@@ -17,11 +17,6 @@
 #include <asm/mtrr.h>
 #include <public/hvm/ioreq.h>
 
-struct hvm_vcpu_asid {
-    uint64_t generation;
-    uint32_t asid;
-};
-
 /*
  * We may read or write up to m512 as a number of device-model
  * transactions.
@@ -90,8 +85,6 @@ struct nestedvcpu {
     bool stale_np2m; /* True when p2m_base in VMCx02 is no longer valid */
     uint64_t np2m_generation;
 
-    struct hvm_vcpu_asid nv_n2asid;
-
     bool nv_vmentry_pending;
     bool nv_vmexit_pending;
     bool nv_vmswitch_in_progress; /* true during vmentry/vmexit emulation */
@@ -152,8 +145,6 @@ struct hvm_vcpu {
     /* (MFN) hypervisor page table */
     pagetable_t         monitor_table;
 
-    struct hvm_vcpu_asid n1asid;
-
     u64                 msr_tsc_adjust;
 
     union {
diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index f0ec459622..87bf7f8e0f 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -525,6 +525,7 @@ void ept_sync_domain(struct p2m_domain *p2m);
 
 static inline void vpid_sync_vcpu_gva(struct vcpu *v, unsigned long gva)
 {
+    struct domain *d = v->domain;
     int type = INVVPID_INDIVIDUAL_ADDR;
 
     /*
@@ -544,7 +545,7 @@ static inline void vpid_sync_vcpu_gva(struct vcpu *v, unsigned long gva)
         type = INVVPID_ALL_CONTEXT;
 
 execute_invvpid:
-    __invvpid(type, v->arch.hvm.n1asid.asid, (u64)gva);
+    __invvpid(type, d->arch.hvm.n1asid.asid, (u64)gva);
 }
 
 static inline void vpid_sync_all(void)
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index d2011fde24..d52af69160 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -739,13 +739,14 @@ static bool cf_check flush_tlb(const unsigned long *vcpu_bitmap)
         if ( !flush_vcpu(v, vcpu_bitmap) )
             continue;
 
-        hvm_asid_flush_vcpu(v);
-
         cpu = read_atomic(&v->dirty_cpu);
         if ( cpu != this_cpu && is_vcpu_dirty_cpu(cpu) && v->is_running )
             __cpumask_set_cpu(cpu, mask);
     }
 
+    printk(XENLOG_INFO "hvm_asid_flush_vcpu called in HAP code");
+    hvm_asid_flush_vcpu(v);
+
     /*
      * Trigger a vmexit on all pCPUs with dirty vCPU state in order to force an
      * ASID/VPID change and hence accomplish a guest TLB flush. Note that vCPUs
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 1739133fc2..c13d1dd080 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -1395,7 +1395,8 @@ p2m_flush(struct vcpu *v, struct p2m_domain *p2m)
     ASSERT(v->domain == p2m->domain);
     vcpu_nestedhvm(v).nv_p2m = NULL;
     p2m_flush_table(p2m);
-    hvm_asid_flush_vcpu(v);
+    printk(XENLOG_INFO "hvm_asid_flush_domain called in p2m_flush");
+    hvm_asid_flush_domain(v->domain);
 }
 
 void
@@ -1573,8 +1574,7 @@ void np2m_schedule(int dir)
         {
             if ( !np2m_valid )
             {
-                /* This vCPU's np2m was flushed while it was not runnable */
-                hvm_asid_flush_core();
+                /* This vCPU's np2m was flushed while it was not runnable */ 
                 vcpu_nestedhvm(curr).nv_p2m = NULL;
             }
             else
diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index dd47bde5ce..96ce752439 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -964,7 +964,8 @@ void paging_update_nestedmode(struct vcpu *v)
     else
         /* TODO: shadow-on-shadow */
         v->arch.paging.nestedmode = NULL;
-    hvm_asid_flush_vcpu(v);
+    printk(XENLOG_INFO "hvm_flush_doamin called in paging_update_nestedmode");
+    hvm_asid_flush_domain(v->domain);
 }
 
 int __init paging_set_allocation(struct domain *d, unsigned int pages,
diff --git a/xen/arch/x86/pv/domain.c b/xen/arch/x86/pv/domain.c
index 2a445bb17b..4d3b67eb32 100644
--- a/xen/arch/x86/pv/domain.c
+++ b/xen/arch/x86/pv/domain.c
@@ -305,6 +305,7 @@ int pv_vcpu_initialise(struct vcpu *v)
     struct domain *d = v->domain;
     int rc;
 
+    printk(XENLOG_INFO "pv_vcpu_initialise called for domain %u", d->domain_id);
     ASSERT(!is_idle_domain(d));
 
     rc = pv_create_gdt_ldt_l1tab(v);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index eee20bb175..f8b1c2548e 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -59,6 +59,7 @@
 #include <asm/microcode.h>
 #include <asm/prot-key.h>
 #include <asm/pv/domain.h>
+#include <asm/hvm/svm/svm.h>
 
 /* opt_nosmp: If true, secondary processors are ignored. */
 static bool __initdata opt_nosmp;
@@ -2015,6 +2016,15 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
         printk(XENLOG_INFO "Parked %u CPUs\n", num_parked);
     smp_cpus_done();
 
+    /* Initialize xen-wide ASID handling */
+    #ifdef CONFIG_HVM
+    for_each_present_cpu ( i )
+    {
+        if ( cpu_has_svm )
+            svm_asid_init();
+    }
+    #endif
+
     do_initcalls();
 
     if ( opt_watchdog ) 
-- 
2.46.0


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 20:16:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 20:16:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776587.1186738 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdxvq-0007am-4j; Tue, 13 Aug 2024 20:15:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776587.1186738; Tue, 13 Aug 2024 20:15:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdxvq-0007af-12; Tue, 13 Aug 2024 20:15:50 +0000
Received: by outflank-mailman (input) for mailman id 776587;
 Tue, 13 Aug 2024 20:15:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdxvo-0007aV-66; Tue, 13 Aug 2024 20:15:48 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdxvn-0006Iq-Sw; Tue, 13 Aug 2024 20:15:47 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdxvn-0001fj-CC; Tue, 13 Aug 2024 20:15:47 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sdxvn-0008BE-Bp; Tue, 13 Aug 2024 20:15:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=z1UMGoz8HdW2VBR1J0lF9L9ZiJDABOHB7zaLpQfI/zo=; b=K9jit+J6l2UkCeJcVMon5eiayP
	ozP6UtRW9OFx18aHvTMrg/CKMTAT6btst1vcrkfENzZ1X2YkXXuoAFa7klAkukwu6bDJLyqkapEwk
	EQh9C4RaLuMGiEA5cN+D9//6J1C+sOovM716ktc5f4wsZEDo8pa0T9RZvErvD9QZ9a5g=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187224-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187224: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=98a462f8b169f93ab7463023f0ed94575f8225b4
X-Osstest-Versions-That:
    xen=d61248b0fa2cdfc0be1d806c43d1b211a72b5d49
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 13 Aug 2024 20:15:47 +0000

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

Failures :-/ but no regressions.

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

version targeted for testing:
 xen                  98a462f8b169f93ab7463023f0ed94575f8225b4
baseline version:
 xen                  d61248b0fa2cdfc0be1d806c43d1b211a72b5d49

Last test of basis   187220  2024-08-13 01:54:17 Z    0 days
Testing same since   187224  2024-08-13 10:11:02 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Stefano Stabellini <stefano.stabellini@amd.com>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   d61248b0fa..98a462f8b1  98a462f8b169f93ab7463023f0ed94575f8225b4 -> master


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 20:17:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 20:17:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776596.1186748 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdxwy-0008Vw-Dr; Tue, 13 Aug 2024 20:17:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776596.1186748; Tue, 13 Aug 2024 20: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 <xen-devel-bounces@lists.xenproject.org>)
	id 1sdxwy-0008Vp-B2; Tue, 13 Aug 2024 20:17:00 +0000
Received: by outflank-mailman (input) for mailman id 776596;
 Tue, 13 Aug 2024 20:16:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdxwx-0008Vd-II; Tue, 13 Aug 2024 20:16:59 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdxwx-0006Jf-GD; Tue, 13 Aug 2024 20:16:59 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sdxwx-0001h3-0F; Tue, 13 Aug 2024 20:16:59 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sdxww-0000Dk-W7; Tue, 13 Aug 2024 20:16:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ujFOVNeJeftoQ2oVFiuNSEn45IL1sq5zZwx1aDemO+I=; b=13ql+1e28jHOYjsAFHau1rDmyz
	AIKRQnYuXWnwAmJMNibsibX6tomuFoeM7d0E9BGHVDQmruR3Ta906NqF/RcgqjWvnhN/To6GIwHBe
	HZ2W4QfkDZ+HFwPgo9Ly5c6J6CNjsQggfongRmt/MTQlJd62FiwLS3mGYV2lKODVCloo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187227-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187227: regressions - FAIL
X-Osstest-Failures:
    xen-unstable-smoke:test-armhf-armhf-xl:debian-install:fail:regression
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=69e99b5d4b087cfe508b4776703c5a9380cfb6d8
X-Osstest-Versions-That:
    xen=98a462f8b169f93ab7463023f0ed94575f8225b4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 13 Aug 2024 20:16:58 +0000

flight 187227 xen-unstable-smoke real [real]
flight 187232 xen-unstable-smoke real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187227/
http://logs.test-lab.xenproject.org/osstest/logs/187232/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-xl          12 debian-install           fail REGR. vs. 187219

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  69e99b5d4b087cfe508b4776703c5a9380cfb6d8
baseline version:
 xen                  98a462f8b169f93ab7463023f0ed94575f8225b4

Last test of basis   187219  2024-08-12 23:00:28 Z    0 days
Testing same since   187227  2024-08-13 15:04:06 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alejandro Vallejo <alejandro.vallejo@cloud.com>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Paul Durrant <paul@xen.org>
  Sergiy Kibrik <Sergiy_Kibrik@epam.com>
  Teddy Astie <teddy.astie@vates.tech>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


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

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

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

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


Not pushing.

------------------------------------------------------------
commit 69e99b5d4b087cfe508b4776703c5a9380cfb6d8
Author: Jan Beulich <jbeulich@suse.com>
Date:   Tue Aug 13 16:41:25 2024 +0200

    x86emul: fix UB multiplications in S/G handling
    
    The conversion of the shifts to multiplications by the commits tagged
    below still wasn't quite right: The multiplications (of signed values)
    can overflow, too. As of 298556c7b5f8 ("x86emul: correct 32-bit address
    handling for AVX2 gathers") signed multiplication wasn't necessary
    anymore, though: The necessary sign-extension (if any) will happen as
    well when using intermediate variables of unsigned long types, and
    excess address bits are chopped off by truncate_ea().
    
    Fixes: b6a907f8c83d ("x86emul: replace UB shifts")
    Fixes: 21de9680eb59 ("x86emul: replace further UB shifts")
    Oss-fuzz: 71138
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

commit 8fb49f2697f74886742096e84193c4c7496def4a
Author: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Date:   Tue Aug 13 16:39:43 2024 +0200

    xen/riscv: enable CONFIG_HAS_DEVICE_TREE
    
    Enable build of generic functionality for working with device
    tree for RISC-V.
    Also, a collection of functions for parsing memory map and other
    boot information from a device tree are available now.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>

commit cc47813c4a2c07a5c6c6a1491b98f3f8549835a7
Author: Alejandro Vallejo <alejandro.vallejo@cloud.com>
Date:   Tue Aug 13 16:39:10 2024 +0200

    tools/hvmloader: Fix non-deterministic cpuid()
    
    hvmloader's cpuid() implementation deviates from Xen's in that the value
    passed on ecx is unspecified. This means that when used on leaves that
    implement subleaves it's unspecified which one you get; though it's more
    than likely an invalid one.
    
    Import Xen's implementation so there are no surprises.
    
    Fixes: 318ac791f9f9 ("Add utilities needed for SMBIOS generation to hvmloader")
    Signed-off-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>

commit b2e8c8f42083afcac8b4720c50680d7c9eaaf90a
Author: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Date:   Tue Aug 13 16:38:40 2024 +0200

    x86/vmx: guard access to cpu_has_vmx_* in common code
    
    There're several places in common code, outside of arch/x86/hvm/vmx,
    where cpu_has_vmx_* get accessed without checking whether VMX supported first.
    These macros rely on global variables defined in vmx code, so when VMX support
    is disabled accesses to these variables turn into build failures.
    
    To overcome these failures, build-time check is done before accessing global
    variables, so that DCE would remove these variables.
    
    Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
    Acked-by: Paul Durrant <paul@xen.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>

commit a8d9b750458f7e91fbb8ab63b5b9341ffb6f6bed
Author: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Date:   Tue Aug 13 16:38:15 2024 +0200

    xen/riscv: enable GENERIC_BUG_FRAME
    
    Enable GENERIC_BUG_FRAME to support BUG(), WARN(), ASSERT,
    and run_in_exception_handler().
    
    "UNIMP" is used for BUG_INSTR, which, when macros from <xen/bug.h>
    are used, triggers an exception with the ILLEGAL_INSTRUCTION cause.
    This instruction is encoded as a 2-byte instruction when
    CONFIG_RISCV_ISA_C is enabled:
      ffffffffc0046ba0:       0000                    unimp
    and is encoded as a 4-byte instruction when CONFIG_RISCV_ISA_C
    ins't enabled:
      ffffffffc005a460:       c0001073                unimp
    
    Using 'ebreak' as BUG_INSTR does not guarantee proper handling of macros
    from <xen/bug.h>. If a debugger inserts a breakpoint (using the 'ebreak'
    instruction) at a location where Xen already uses 'ebreak', it
    creates ambiguity. Xen cannot distinguish whether the 'ebreak'
    instruction is inserted by the debugger or is part of Xen's own code.
    
    Remove BUG_INSN_32 and BUG_INSN_16 macros as they encode the ebreak
    instruction, which is no longer used for BUG_INSN.
    
    Update the comment above the definition of INS_LENGTH_MASK as instead of
    'ebreak' instruction 'unimp' instruction is used.
    
    <xen/lib.h> is included for the reason that panic() and printk() are
    used in common/bug.c and RISC-V fails if it is not included.
    
    Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>

commit 9c94eda1e3790820699a6de3f6a7c959ecf30600
Author: Jan Beulich <jbeulich@suse.com>
Date:   Tue Aug 13 16:37:25 2024 +0200

    x86/pass-through: documents as security-unsupported when sharing resources
    
    When multiple devices share resources and one of them is to be passed
    through to a guest, security of the entire system and of respective
    guests individually cannot really be guaranteed without knowing
    internals of any of the involved guests.  Therefore such a configuration
    cannot really be security-supported, yet making that explicit was so far
    missing.
    
    This is XSA-461 / CVE-2024-31146.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Juergen Gross <jgross@suse.com>

commit beadd68b5490ada053d72f8a9ce6fd696d626596
Author: Teddy Astie <teddy.astie@vates.tech>
Date:   Tue Aug 13 16:36:40 2024 +0200

    x86/IOMMU: move tracking in iommu_identity_mapping()
    
    If for some reason xmalloc() fails after having mapped the reserved
    regions, an error is reported, but the regions remain mapped in the P2M.
    
    Similarly if an error occurs during set_identity_p2m_entry() (except on
    the first call), the partial mappings of the region would be retained
    without being tracked anywhere, and hence without there being a way to
    remove them again from the domain's P2M.
    
    Move the setting up of the list entry ahead of trying to map the region.
    In cases other than the first mapping failing, keep record of the full
    region, such that a subsequent unmapping request can be properly torn
    down.
    
    To compensate for the potentially excess unmapping requests, don't log a
    warning from p2m_remove_identity_entry() when there really was nothing
    mapped at a given GFN.
    
    This is XSA-460 / CVE-2024-31145.
    
    Fixes: 2201b67b9128 ("VT-d: improve RMRR region handling")
    Fixes: c0e19d7c6c42 ("IOMMU: generalize VT-d's tracking of mapped RMRR regions")
    Signed-off-by: Teddy Astie <teddy.astie@vates.tech>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 20:51:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 20:51:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776612.1186769 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdyUj-0005wZ-3s; Tue, 13 Aug 2024 20:51:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776612.1186769; Tue, 13 Aug 2024 20:51:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdyUj-0005wS-0I; Tue, 13 Aug 2024 20:51:53 +0000
Received: by outflank-mailman (input) for mailman id 776612;
 Tue, 13 Aug 2024 20:51:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sdyUi-0005wM-98
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 20:51:52 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sdyUg-0006u5-U3; Tue, 13 Aug 2024 20:51:50 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.244])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sdyUg-0006dp-MM; Tue, 13 Aug 2024 20:51:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=kTfvASH6EAdkYsieFrVr8PxoW0IWuVb+/uvg/w1zBy4=; b=Kw0i9KQrewbGGMWGObKm1gBUzt
	wXDBo9QAVGGRcVytzlUBRZjqxxVeXcne7nmXcNixJb0Ju1kMxBhOiLUQ2UbLPXNA5tZTYwSBvRhjH
	/5/SIQl/fYVaCiWX5yKjjvkfnMozmcVBRV46JyU2P32a0YsQ+I9uav5RMIv7GYzRIEb4=;
Message-ID: <53f4c996-0034-47b5-ac7b-5fcf6d966012@xen.org>
Date: Tue, 13 Aug 2024 21:51:49 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] Arm: correct FIXADDR_TOP
To: Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <5b097aa2-7ced-4971-bd6e-96618bb6f2df@suse.com>
 <42b02774-c941-4903-be74-d58bf6b93b81@amd.com>
Content-Language: en-GB
From: Julien Grall <julien@xen.org>
In-Reply-To: <42b02774-c941-4903-be74-d58bf6b93b81@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 13/08/2024 12:57, Michal Orzel wrote:
> 
> 
> On 13/08/2024 13:49, Jan Beulich wrote:
>>
>>
>> While reviewing a RISC-V patch cloning the Arm code, I noticed an
>> off-by-1 here: FIX_PMAP_{BEGIN,END} being an inclusive range and
>> FIX_LAST being the same as FIX_PMAP_END, FIXADDR_TOP cannot derive from
>> FIX_LAST alone, or else the BUG_ON() in virt_to_fix() would trigger if
>> FIX_PMAP_END ended up being used.
>>
>> While touching this area also add a check for fixmap and boot FDT area
>> to not only not overlap, but to have at least one (unmapped) page in
>> between.
>>
>> Fixes: 4f17357b52f6 ("xen/arm: add Persistent Map (PMAP) infrastructure")
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Reviewed-by: Michal Orzel <michal.orzel@amd.com>

Committed.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 20:55:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 20:55:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776619.1186778 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdyXm-0006a1-JA; Tue, 13 Aug 2024 20:55:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776619.1186778; Tue, 13 Aug 2024 20:55:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdyXm-0006Zu-G4; Tue, 13 Aug 2024 20:55:02 +0000
Received: by outflank-mailman (input) for mailman id 776619;
 Tue, 13 Aug 2024 20:55:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sdyXk-0006Zo-Vy
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 20:55:00 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sdyXk-0006xI-Jx; Tue, 13 Aug 2024 20:55:00 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.244])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sdyXk-0007Fz-Ej; Tue, 13 Aug 2024 20:55:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=BTSkmmXoHpxz587FYUrWx6H+rO+zEqa/nSDJfmmGTvI=; b=MXMWFTEyxpMdLuJL/cuZaVIXcT
	ydgggFBFAuffOBuayH213EWqziuUw9aRN4WlKwBr1KG/bWsAWxZL3ybVqQRfxG0b94AYfPHtPKLwz
	ozYp7X8Vxg4CtLsrqyemJ2JoiAhT54GoRWESltWMKbyHSaBAiyS9r08VToxuX20eU1Y4=;
Message-ID: <a5df7b93-71dc-451d-ae9f-6afd4649a954@xen.org>
Date: Tue, 13 Aug 2024 21:54:58 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 1/1] xen/arm: smmuv3: Mark more init-only functions
 with __init
Content-Language: en-GB
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
 Rahul Singh <Rahul.Singh@arm.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <Bertrand.Marquis@arm.com>,
 "michal.orzel@amd.com" <michal.orzel@amd.com>,
 "Volodymyr_Babchuk@epam.com" <Volodymyr_Babchuk@epam.com>,
 "edgar.iglesias@amd.com" <edgar.iglesias@amd.com>
References: <20240522132829.1278625-1-edgar.iglesias@gmail.com>
 <20240522132829.1278625-2-edgar.iglesias@gmail.com>
 <7AA016AF-03B0-4321-B0B9-FBDD60B24557@arm.com>
 <CAJy5ezqz8oHfv_an9DtoGwJK2M6d_HO_QhUVvwd7k8wdmibG4w@mail.gmail.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <CAJy5ezqz8oHfv_an9DtoGwJK2M6d_HO_QhUVvwd7k8wdmibG4w@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Edgar,

On 09/08/2024 11:23, Edgar E. Iglesias wrote:
> On Wed, Jun 5, 2024 at 11:55 AM Rahul Singh <Rahul.Singh@arm.com 
> <mailto:Rahul.Singh@arm.com>> wrote:
> 
>     Hi Edgar,
> 
>      > On 22 May 2024, at 2:28 PM, Edgar E. Iglesias
>     <edgar.iglesias@gmail.com <mailto:edgar.iglesias@gmail.com>> wrote:
>      >
>      > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com
>     <mailto:edgar.iglesias@amd.com>>
>      >
>      > Move more functions that are only called at init to
>      > the .init.text section.
>      >
>      > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com
>     <mailto:edgar.iglesias@amd.com>>
> 
>     Acked-by: Rahul Singh <rahul.singh@arm.com <mailto:rahul.singh@arm.com>>
>     Tested-by: Rahul Singh <rahul.singh@arm.com
>     <mailto:rahul.singh@arm.com>>
> 
>     Regards,
>     Rahul
> 
> 
> Ping!

Thanks for the ping and sorry this fell through the cracks.

> 
> This still rebases cleanly on top of master but let me know if I should 
> resend.


This is now committed.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 20:59:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 20:59:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776631.1186796 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdybs-0007nO-5n; Tue, 13 Aug 2024 20:59:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776631.1186796; Tue, 13 Aug 2024 20:59:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdybs-0007nH-2g; Tue, 13 Aug 2024 20:59:16 +0000
Received: by outflank-mailman (input) for mailman id 776631;
 Tue, 13 Aug 2024 20:59:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sdybq-0007nA-Q0
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 20:59:14 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sdybq-00071a-5r; Tue, 13 Aug 2024 20:59:14 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.244])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sdybq-0007fY-0h; Tue, 13 Aug 2024 20:59:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:
	References:Cc:To:From:Subject:MIME-Version:Date:Message-ID;
	bh=6LcHDRfMqWcsVyiSNUhdYyYZ9aYRRqYrxG/vj9VEXAQ=; b=YeRtOz005qCvGo05gC+jMWMeVw
	6ZwlI08BbwrzfqL2f/rv84raA7MoWZbA1fXW8ans5KGJrL5P91+lzPEMHN40X8AtN7f4GM34TXxez
	k46Fs+igdK56yPcDUsd5v28RSHpfnf0A7Pommo5RP/gxt0+l9HIXMFeMrAFGwQFjV6eE=;
Message-ID: <308c6067-0d0d-4dc2-85fe-4bc956f99e16@xen.org>
Date: Tue, 13 Aug 2024 21:59:12 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/arm64: entry: Actually skip do_trap_*() when an
 SError is triggered
Content-Language: en-GB
From: Julien Grall <julien@xen.org>
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Julien Grall <jgrall@amazon.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240806124815.53492-1-julien@xen.org>
 <a27a865a-8a23-4185-9b31-d5fc6e362812@amd.com>
 <c1178d7a-ac95-4022-82d5-8da5901b6f43@xen.org>
In-Reply-To: <c1178d7a-ac95-4022-82d5-8da5901b6f43@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 06/08/2024 14:30, Julien Grall wrote:
> 
> 
> On 06/08/2024 14:26, Michal Orzel wrote:
>> Hi Julien,
>>
>> On 06/08/2024 14:48, Julien Grall wrote:
>>>
>>>
>>> From: Julien Grall <jgrall@amazon.com>
>>>
>>> For SErrors, we support two configurations:
>>>    * Every SErrors will result to a panic in Xen
>>>    * We will forward SErrors triggered by a VM back to itself
>>>
>>> For the latter case, we want to skip the call to do_trap_*() because 
>>> the PC
>>> was already adjusted.
>>>
>>> However, the alternative used to decide between the two configurations
>>> is inverted. This would result to the VM corrupting itself if:
>>>    * x19 is non-zero in the panic case
>>>    * advance PC too much in the second case
>>>
>>> Solve the issue by switch from alternative_if to alternative_if_not.
>>>
>>> Fixes: a458d3bd0d25 ("xen/arm: entry: Ensure the guest state is 
>>> synced when receiving a vSError")
>>> Signed-off-by: Julien Grall <jgrall@amazon.com>
>> Acked-by: Michal Orzel <michal.orzel@amd.com>
>>
>>>
>>> ----
>> 3 instead of 4 dashes
> 
> I will fixed it.
> 
> The patchqueue tool I am using will strip anything after "---". So I am 
> using ---- to version changelog... I tend to forget that I need to 
> manually call sed -i 's/^----/---/' *.patch before sending every patch.

This is now committed.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 21:02:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 21:02:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776639.1186810 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdyfK-0000tE-M0; Tue, 13 Aug 2024 21:02:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776639.1186810; Tue, 13 Aug 2024 21:02:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdyfK-0000t7-JB; Tue, 13 Aug 2024 21:02:50 +0000
Received: by outflank-mailman (input) for mailman id 776639;
 Tue, 13 Aug 2024 21:02:50 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sdyfK-0000t1-0L
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 21:02:50 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sdyfJ-00078u-Ir; Tue, 13 Aug 2024 21:02:49 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.244])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sdyfJ-0008BF-E5; Tue, 13 Aug 2024 21:02:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=ecsivWuiDBHCZCG209lFjyMnxbqzt05UtU0c470VEYg=; b=hR1NQV7FKNJzEtkBogT9bh6HiQ
	PV9b3QXMuTlqwSmse89dVAcQ1YRT9maY4FGNP9xFJemcVoNwtmYocjXDW5rnzR8q9Fvkymc5oDUF1
	LxUCnmSF/cRyVa2MpKLncJpaGVBxuxFrB//IjSh1JAniGop9VT6tIcfrqhBxcKkC4QzE=;
Message-ID: <2912b3cc-813d-43e5-bcf3-8e3182592776@xen.org>
Date: Tue, 13 Aug 2024 22:02:48 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] drivers: char: omap-uart: add "clock-hz" option
Content-Language: en-GB
To: Amneesh Singh <a-singh21@ti.com>
Cc: xen-devel@lists.xenproject.org,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <20240719113313.145587-1-a-singh21@ti.com>
 <b7ef34fe-f6eb-45e8-8f6a-0e2c4bd0175b@xen.org>
 <njlq7laeswww46izwpkzuvnvu3lcycv7kc6dt2urbrpimj6uej@tzjuwwhwwqmp>
 <8c12dc98-bc9f-49bf-bc18-ddae99fa7312@xen.org>
 <csvohhbfi7ilqjzmozhb7u75jp7kfncpyj335hz5vksjw7lr46@57puayor4b4r>
 <ff6a7077-efbb-4002-9426-a9f05760f8f8@xen.org>
 <pm2tulzvwuexw6stt2gx6nxbhnmqy36tbswde7j26wtq3x6wob@hyxxarp32or5>
From: Julien Grall <julien@xen.org>
In-Reply-To: <pm2tulzvwuexw6stt2gx6nxbhnmqy36tbswde7j26wtq3x6wob@hyxxarp32or5>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Amneesh,

Sorry for the late answer.

On 06/08/2024 12:50, Amneesh Singh wrote:
>> need to specify the clockspeed on the command line. I think we should
>> investigate other approaches such as implementing partially
>> clk_get_rate() (if this is how Linux manage to retrieve the clock speed
>> without any command line option).
> I guess, we can just ditch the entire idea, and just use the a default
> fallback and just print a message informing the user that there is no
> frequency in the DT. I do not think implementing clk_get_rate (or any
> clock API) is feasible or worth the effort to be completely honest.
> What do you think? I do not particularly have any issues with that. I
> feel like this is a niche case (at least now) anyway.

Michal, Stefano and I had a chat. We agree that implementing 
clk_get_rate() may be too complex. So the best next solution is to ask 
the user to update the DT and read the property from Xen.

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 21:10:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 21:10:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776648.1186822 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdymG-00028H-Db; Tue, 13 Aug 2024 21:10:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776648.1186822; Tue, 13 Aug 2024 21:10:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdymG-00028A-9I; Tue, 13 Aug 2024 21:10:00 +0000
Received: by outflank-mailman (input) for mailman id 776648;
 Tue, 13 Aug 2024 21:09:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sdymF-000284-66
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 21:09:59 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sdymF-0007IT-2Z; Tue, 13 Aug 2024 21:09:59 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.244])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sdymE-0000CF-Th; Tue, 13 Aug 2024 21:09:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=HN3tCutRKJE3N+b77+6BXWcLwy9YemPGnaaCRBIAD5M=; b=iHGOrQOgOksIZFjVWvvUqlVI8K
	CPvETSSk1neZgmHZyWnKB+Tq3oCYteakeUVXTWE1NPPOAr7XQQnLCxCC4xNCOnjCOwdIj7xMhJ6QK
	lX9DaEBHvq8olCtAPbcjGKvdWSylkPuK+vrIcIgA0/TXLq/QThfifYMLTDM7UXl4YbpQ=;
Message-ID: <7954d119-68da-445a-8030-709cc58354e0@xen.org>
Date: Tue, 13 Aug 2024 22:09:56 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] tools/xenstored: switch stubdom live update to use file
 for state
Content-Language: en-GB
To: Juergen Gross <jgross@suse.com>, xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>
References: <20240731142156.10723-1-jgross@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20240731142156.10723-1-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Juergen,

On 31/07/2024 15:21, Juergen Gross wrote:
> With the introduction of 9pfs for Xenstore-stubdom it is now possible
> to use a file for saving the state when doing live update.
> 
> This allows to move some environment specific actions back to the
> common source file lu.c.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 21:54:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 21:54:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776661.1186830 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdzTE-0001ZA-Jt; Tue, 13 Aug 2024 21:54:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776661.1186830; Tue, 13 Aug 2024 21:54:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sdzTE-0001Z3-HK; Tue, 13 Aug 2024 21:54:24 +0000
Received: by outflank-mailman (input) for mailman id 776661;
 Tue, 13 Aug 2024 21:54:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sdzTC-0001Yx-SW
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 21:54:22 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sdzTC-000845-Ni; Tue, 13 Aug 2024 21:54:22 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.244])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sdzTC-0003M8-GA; Tue, 13 Aug 2024 21:54:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=9yjWaBUzIYYpLIC9M6S+4PyjyVfmBd5yhRGPIT5E1Rk=; b=XrVDIWHNUE0cofEeqyMbyCUrxK
	8yglafKV38fhWqqklo7PbmBIUvWwLXuyqNqyW0POk3OdczMFx37RqkKKfzNeDr5+ODUl1LYNpJGDl
	g6G/XlBxaCF8RkAhLE2JBoCWPc/18OVcZnoqYS1urRKDWSIf93VthmX4qKuvOfmHicIg=;
Message-ID: <c369efed-6607-461f-a76e-049d6bf28ae5@xen.org>
Date: Tue, 13 Aug 2024 22:54:21 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4] mm: introduce xvmalloc() et al and use for grant table
 allocations
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <300f7bb3-3ab6-44ec-9663-b9934c3e123c@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <300f7bb3-3ab6-44ec-9663-b9934c3e123c@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jan,

On 01/08/2024 07:30, Jan Beulich wrote:
> All of the array allocations in grant_table_init() can exceed a page's
> worth of memory, which xmalloc()-based interfaces aren't really suitable
> for after boot. We also don't need any of these allocations to be
> physically contiguous. Introduce interfaces dynamically switching
> between xmalloc() et al and vmalloc() et al, based on requested size,
> and use them instead.
> 
> All the wrappers in the new header are cloned mostly verbatim from
> xmalloc.h, with the sole adjustment to switch unsigned long to size_t
> for sizes and to unsigned int for alignments, and with the cloning of
> x[mz]alloc_bytes() avoided. The exception is xvmemdup(), where the
> const related comment on xmemdup() is actually addressed and hence
> dropped.
> 
> While adjusting grant_table_destroy() also move ahead the clearing of
> the struct domain field.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Tue Aug 13 22:36:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 22:36:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776676.1186841 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se087-0008R6-Ln; Tue, 13 Aug 2024 22:36:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776676.1186841; Tue, 13 Aug 2024 22:36:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se087-0008Qz-Ir; Tue, 13 Aug 2024 22:36:39 +0000
Received: by outflank-mailman (input) for mailman id 776676;
 Tue, 13 Aug 2024 22:36:37 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=nBzl=PM=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1se085-0008Qt-P5
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 22:36:37 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7dae220e-59c4-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 00:36:34 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:8ac4:0:0:0:0:f7])
 by mailhost.m5p.com (8.18.1/8.17.1) with ESMTPS id 47DMaNHg032427
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Tue, 13 Aug 2024 18:36:29 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.18.1/8.15.2/Submit) id 47DMaNsm032426;
 Tue, 13 Aug 2024 15:36:23 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7dae220e-59c4-11ef-8776-851b0ebba9a2
Date: Tue, 13 Aug 2024 15:36:23 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: =?iso-8859-1?Q?J=FCrgen_Gro=DF?= <jgross@suse.com>
Cc: Andrei Semenov <andrei.semenov@vates.tech>, xen-devel@lists.xenproject.org,
        Andrew Cooper <andrew.cooper3@citrix.com>,
        Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Subject: Re: AMD EPYC virtual network performances
Message-ID: <Zrvf5wgm6xEI63x2@mattapan.m5p.com>
References: <959bbf84-24da-4da3-a059-dc1aa32b27ef@vates.tech>
 <352bba40-27fc-416b-985f-20e66c0c4b72@suse.com>
 <Zrqykdarr7JHaeOZ@mattapan.m5p.com>
 <ab4ca68e-ec1b-467f-9b89-38f63cc19b7c@suse.com>
 <ZruckufSjT0GkpJt@mattapan.m5p.com>
 <d556e168-8542-4b93-81a9-a7054b5b69ba@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <d556e168-8542-4b93-81a9-a7054b5b69ba@suse.com>
X-Spam-Status: No, score=0.3 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=4.0.1
X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on mattapan.m5p.com

On Tue, Aug 13, 2024 at 08:55:42PM +0200, Jrgen Gro wrote:
> On 13.08.24 19:49, Elliott Mitchell wrote:
> > On Tue, Aug 13, 2024 at 01:16:06PM +0200, Jrgen Gro wrote:
> > > 
> > > I don't see a connection here, as spurious interrupts (as seen by the
> > > hypervisor in your case) and spurious events (as seen by Andrei) are
> > > completely different (hardware vs. software level).
> > 
> > The entries seem to appear at an average of about 1/hour.  Could be most
> > events are being dropped and 10x that number are occuring.  If so, those
> > extras could be turning into spurious events seen by various domains.
> 
> Even 10 spurious events per hour should not have a measurable impact
> on performance.

Come to think of it, depending upon time that domain is sometimes low
activity (build so it is either pegging or idle).  The 1/hour was during
idle times, so during busy times it might be much worse.  I haven't been
tracking `xl dmesg` as carefully recently.

Do the maintainers ever run machines with "iommu=debug"?  I'm actually
rather concerned *anything* spurious is showing up as I'm left suspecting
there may have been something lurking for some time.

> > There is a possibility spurious interrupts are being turned into spurious
> > events by the back-end drivers.
> 
> No, I don't think so.
> 
> > Jrgen Gro, what is the performance impact of "iommu=debug"?  Seems to
> > mostly cause more reporting and have minimal/no performance effect.
> 
> I guess you are referring to the Xen option? I'm no expert in this
> area.

Drat.  I haven't noticed much, which would match with simply enabling a
bunch of debugging printk()s (alas I'm not monitoring performance closely
enough to be sure).  Guess I wait for Andrei Semenov to state a comfort
level with trying "iommu=debug".


My guess is Andrei Semenov's issue is quite widespread.  I hadn't noticed
the issue until trying `find /sys/devices -name spurious_events -print`.

If you don't know where to look, Linux is apparently pretty good at
hiding this sort of issue.  The impact may not seem too severe if your
baseline was infected.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Tue Aug 13 22:52:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Aug 2024 22:52:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776686.1186852 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se0Nd-00030T-V8; Tue, 13 Aug 2024 22:52:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776686.1186852; Tue, 13 Aug 2024 22:52:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se0Nd-00030M-RE; Tue, 13 Aug 2024 22:52:41 +0000
Received: by outflank-mailman (input) for mailman id 776686;
 Tue, 13 Aug 2024 22:52:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jgOn=PM=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1se0Nc-00030F-9E
 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2024 22:52:40 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bbf4147b-59c6-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 00:52:38 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id C4AFB61903;
 Tue, 13 Aug 2024 22:52:35 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id E19E9C32782;
 Tue, 13 Aug 2024 22:52:33 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bbf4147b-59c6-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723589555;
	bh=/9E0bV+7de54mixbbQS3JvL8Qj9PklPehoTxAy+Sxcs=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=B8dh8xal5x36LJnouHDGBoZOprSPE9UDE4eH0Q/ZwWwldb5GrwYDoTu3tOERwkW+Z
	 zald+nejF3aLYlmCP16dQnesfsPyW4n7lDlpBSNRwEK0QAoltX1DZKJUJGeM+/EfDQ
	 1yR9keeLxcHP6j+DHnJpN3JxuuT9o0tx4qgEnrGZ9ywn7X+w7SvT6dT3CcQYqGni/a
	 a69w5E7GxY600EBu0uRdpwZMungKU3eOAfu9iIqnSj9A5cMM+XCDeQZ+i6875UpKkZ
	 UkNPVmVjO5hAlOjmqnco2uKDtyYYxwdVBGbHhL2Ur2kwM+JP83XC0JC2jWkmncBK5H
	 hTgdDZva1rHfg==
Date: Tue, 13 Aug 2024 15:52:32 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, qemu-devel@nongnu.org, 
    anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, 
    alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, 
    edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, 
    qemu-arm@nongnu.org
Subject: Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests
In-Reply-To: <ZruRm34zIMtUm7oH@zapote>
Message-ID: <alpine.DEB.2.22.394.2408131550080.298534@ubuntu-linux-20-04-desktop>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com> <20240812130606.90410-5-edgar.iglesias@gmail.com> <alpine.DEB.2.22.394.2408121650590.298534@ubuntu-linux-20-04-desktop> <ZruRm34zIMtUm7oH@zapote>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 13 Aug 2024, Edgar E. Iglesias wrote:
> On Mon, Aug 12, 2024 at 06:47:17PM -0700, Stefano Stabellini wrote:
> > On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> > > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> > > 
> > > Add SMP support for Xen PVH ARM guests. Create max_cpus ioreq
> > > servers to handle hotplug.
> > > 
> > > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> > > ---
> > >  hw/arm/xen_arm.c | 5 +++--
> > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
> > > index 5f75cc3779..ef8315969c 100644
> > > --- a/hw/arm/xen_arm.c
> > > +++ b/hw/arm/xen_arm.c
> > > @@ -173,7 +173,7 @@ static void xen_arm_init(MachineState *machine)
> > >  
> > >      xen_init_ram(machine);
> > >  
> > > -    xen_register_ioreq(xam->state, machine->smp.cpus, &xen_memory_listener);
> > > +    xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener);
> > >  
> > >      xen_create_virtio_mmio_devices(xam);
> > >  
> > > @@ -218,7 +218,8 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
> > >      MachineClass *mc = MACHINE_CLASS(oc);
> > >      mc->desc = "Xen PVH ARM machine";
> > >      mc->init = xen_arm_init;
> > > -    mc->max_cpus = 1;
> > > +    /* MAX number of vcpus supported by Xen.  */
> > > +    mc->max_cpus = GUEST_MAX_VCPUS;
> > 
> > Will this cause allocations of data structures with 128 elements?
> > Looking at hw/xen/xen-hvm-common.c:xen_do_ioreq_register it seems
> > possible? Or hw/xen/xen-hvm-common.c:xen_do_ioreq_register is called
> 
> Yes, in theory there's probably overhead with this but as you correctly
> noted below, a PVH aware xl will set the max_cpus option to a lower value.
> 
> With a non-pvh aware xl, I was a little worried about the overhead
> but I couldn't see any visible slow-down on ARM neither in boot or in network
> performance (I didn't run very sophisticated benchmarks).
 
What do you mean by "non-pvh aware xl"? All useful versions of xl
support pvh?

> > later on with the precise vCPU value which should be provided to QEMU
> > via the -smp command line option
> > (tools/libs/light/libxl_dm.c:libxl__build_device_model_args_new)?
> 
> Yes, a pvh aware xl will for example pass -smp 2,maxcpus=4 based on
> values from the xl.cfg. If the user doesn't set maxvcpus in xl.cfg, xl
> will set maxvcpus to the same value as vcpus.

OK good. In that case if this is just an initial value meant to be
overwritten, I think it is best to keep it as 1.


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 02:39:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 02:39:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776715.1186870 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se3up-0002k2-QX; Wed, 14 Aug 2024 02:39:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776715.1186870; Wed, 14 Aug 2024 02:39:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se3up-0002jv-Nr; Wed, 14 Aug 2024 02:39:11 +0000
Received: by outflank-mailman (input) for mailman id 776715;
 Wed, 14 Aug 2024 02:39:10 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1se3uo-0002jl-Tj; Wed, 14 Aug 2024 02:39:10 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1se3uo-0004hX-P9; Wed, 14 Aug 2024 02:39:10 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1se3uo-0002CX-Ae; Wed, 14 Aug 2024 02:39:10 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1se3uo-0001q1-A2; Wed, 14 Aug 2024 02:39:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=1L5duiEXaLg7TG2FsRehcUbOp0R87SRohfkdeRFsdKM=; b=0APeLB057lryGW+7gGlbjDj6cA
	oETSjbizh2nfDByaL0j/FKqr0R/i4gcJjBb5TWpouhTxvMic56pBoUV0sNQsX8yu+js0bUH16YY/j
	Isevfz+shohAo5hssJeFlGLqAhIdpTB5tkWed+iVDoNp2oJTo7ObwV3A3dsXUdDGbMyA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187228-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.16-testing test] 187228: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.16-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.16-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=638f21616a7a9e94ebae134573ca42d977a65063
X-Osstest-Versions-That:
    xen=9fe713202e4ef4ff0264d6ecfaea26bc4e50705b
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 14 Aug 2024 02:39:10 +0000

flight 187228 xen-4.16-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187228/

Failures :-/ but no regressions.

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

version targeted for testing:
 xen                  638f21616a7a9e94ebae134573ca42d977a65063
baseline version:
 xen                  9fe713202e4ef4ff0264d6ecfaea26bc4e50705b

Last test of basis   186876  2024-07-18 07:41:07 Z   26 days
Testing same since   187228  2024-08-13 15:06:39 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Teddy Astie <teddy.astie@vates.tech>

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


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

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

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

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


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   9fe713202e..638f21616a  638f21616a7a9e94ebae134573ca42d977a65063 -> stable-4.16


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 03:23:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 03:23:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776731.1186889 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se4bb-0001h5-Ax; Wed, 14 Aug 2024 03:23:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776731.1186889; Wed, 14 Aug 2024 03:23:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se4bb-0001gy-70; Wed, 14 Aug 2024 03:23:23 +0000
Received: by outflank-mailman (input) for mailman id 776731;
 Wed, 14 Aug 2024 03:23:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1se4bZ-0001go-DO; Wed, 14 Aug 2024 03:23:21 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1se4bZ-0005TF-7s; Wed, 14 Aug 2024 03:23:21 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1se4bY-00045Q-SC; Wed, 14 Aug 2024 03:23:20 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1se4bY-0007vw-Re; Wed, 14 Aug 2024 03:23:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=/03Htl0fJVqsg9XdmZNMy9/fZAbKxD/pWOJspNeCPxA=; b=rxAKjocejeeLVwVdH0Y8xCFY05
	xl1BHZPHBisN0c1OvnyCsbRXNfOPg3yzkU6Nj09SAJFMCHpPflpGXFfi1dn3Gxk5XUs5sb1dTPUsy
	1+SyoIwN15/BC74r+sN3m6NShGibbnrPhzFcdjoSKPXE7/KpqwOM7EOFTaZeZvdRyuR4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187234-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187234: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=35c64c3dce01c2d0689a8c13240bf48a10cef783
X-Osstest-Versions-That:
    xen=98a462f8b169f93ab7463023f0ed94575f8225b4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 14 Aug 2024 03:23:20 +0000

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

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  35c64c3dce01c2d0689a8c13240bf48a10cef783
baseline version:
 xen                  98a462f8b169f93ab7463023f0ed94575f8225b4

Last test of basis   187219  2024-08-12 23:00:28 Z    1 days
Failing since        187227  2024-08-13 15:04:06 Z    0 days    2 attempts
Testing same since   187234  2024-08-13 21:00:27 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alejandro Vallejo <alejandro.vallejo@cloud.com>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Edgar E. Iglesias <edgar.iglesias@amd.com>
  Jan Beulich <jbeulich@suse.com>
  Julien Grall <jgrall@amazon.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Paul Durrant <paul@xen.org>
  Rahul Singh <rahul.singh@arm.com>
  Sergiy Kibrik <Sergiy_Kibrik@epam.com>
  Teddy Astie <teddy.astie@vates.tech>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


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

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

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

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   98a462f8b1..35c64c3dce  35c64c3dce01c2d0689a8c13240bf48a10cef783 -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 06:16:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 06:16:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776746.1186899 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se7IN-0001jX-2e; Wed, 14 Aug 2024 06:15:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776746.1186899; Wed, 14 Aug 2024 06:15:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se7IM-0001jQ-Vc; Wed, 14 Aug 2024 06:15:42 +0000
Received: by outflank-mailman (input) for mailman id 776746;
 Wed, 14 Aug 2024 06:15:42 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=cRlh=PN=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1se7IM-0001jK-2z
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 06:15:42 +0000
Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com
 [2a00:1450:4864:20::531])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a0cdae48-5a04-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 08:15:39 +0200 (CEST)
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5b5b67d0024so7141420a12.0
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 23:15:39 -0700 (PDT)
Received: from ?IPV6:2003:e5:8741:4a00:60e5:7bee:fc48:e85c?
 (p200300e587414a0060e57beefc48e85c.dip0.t-ipconnect.de.
 [2003:e5:8741:4a00:60e5:7bee:fc48:e85c])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd187f5671sm3541898a12.3.2024.08.13.23.15.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 23:15:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a0cdae48-5a04-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723616139; x=1724220939; 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=3chlWl+1x3+Shb73mTBLzYcM2aTWa0hMrJt3FPlTnr0=;
        b=ZfAKGar55huzgVFfHmMzlAJqGmMvnsSq96oAD2NGlDfbsWK41n1o6Xz6XS7mbLxVrR
         wWBugpbgWvfdlvjSXFFv+YD2DMMJ5O2AcxkspB7sLsna4EwV6pPt/SHx0xwtTQegr6z1
         6AJyC7/1PI9J3ezkKA1+8yYJPOAqTpzC186NpQFhqB0qqNvxJ5cjYppfvCpgKjF1qjdM
         gsqkNgdQRP4OIv34RNzI/Wqj5qa0GEqXiGkjnpVDh+IRAozyKp1Pwqz/6z0M8K+vN3Pk
         D5bY9Wuq1Yq+1rSpvHOO/Sqw/eGolaSFNcxN+x0BSLhrMeqcHMupCId/d+UYyN8exlFA
         F4cA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723616139; x=1724220939;
        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=3chlWl+1x3+Shb73mTBLzYcM2aTWa0hMrJt3FPlTnr0=;
        b=qGB2MmFGSmKAD6hehuRsdE+6S4lMY7PHjlp66KeTbqckIJ05atHNYxuYMVkFUmczcT
         99Et79xaoDuojfn8AtEt93vmC70YS7+E26Mufoyq5QTh/Ep4NEuEBrle/KL+xrHhht7+
         U4GlEMGzDVdhJ7Of2TXwn1bUysNPH8RIpKPSyOBQhx9BD+EjlVV0IEtgxAZbOWN+AVxZ
         YS1PqsWlGPM6IyZZ0jcmg4ObgOG95VxJnk87aRTI7G12wFnvNGjyS7fMGk/wsfA5K8Fu
         G8M7CdDR53gDkCW12W1xLEJckmXJauVWXVt05ixE7YTMMiNOXOM/Gc5QMxskKKVMa0lN
         qLxw==
X-Forwarded-Encrypted: i=1; AJvYcCU+9TuaXwbPP95U1M7SpW5/ht4hwCnHcwnET8rwwab4UhPPQiG2Lu/grUAsM0XL58dgRA+062/Eq88Wo/C23oP11jhi9NWTLiOetLW+Ml0=
X-Gm-Message-State: AOJu0Yw/LxyNrNm/gFAX2aI7RPmQRcoD5jTYYB+OmWLIhiQ8jxJWdCyc
	QX0Rwg4Z8L2BSqBRhFARCnfitjBuC81k/7ku/ROa2onTCA4xEgeca+Rc4/HYpGg=
X-Google-Smtp-Source: AGHT+IHzbR4VeJvIvZY0IgemNCUA0e3NYt/exS1BM2wN5LiN1xatG/kB8wYT0cHX82SZt/pNJorN3w==
X-Received: by 2002:a05:6402:51cd:b0:5bb:9b22:68f4 with SMTP id 4fb4d7f45d1cf-5bea1c7bc00mr1002969a12.18.1723616139053;
        Tue, 13 Aug 2024 23:15:39 -0700 (PDT)
Message-ID: <e95ab71d-b985-4ab7-994b-1c562efd5f9f@suse.com>
Date: Wed, 14 Aug 2024 08:15:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: AMD EPYC virtual network performances
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: Andrei Semenov <andrei.semenov@vates.tech>,
 xen-devel@lists.xenproject.org, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <959bbf84-24da-4da3-a059-dc1aa32b27ef@vates.tech>
 <352bba40-27fc-416b-985f-20e66c0c4b72@suse.com>
 <Zrqykdarr7JHaeOZ@mattapan.m5p.com>
 <ab4ca68e-ec1b-467f-9b89-38f63cc19b7c@suse.com>
 <ZruckufSjT0GkpJt@mattapan.m5p.com>
 <d556e168-8542-4b93-81a9-a7054b5b69ba@suse.com>
 <Zrvf5wgm6xEI63x2@mattapan.m5p.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <Zrvf5wgm6xEI63x2@mattapan.m5p.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 14.08.24 00:36, Elliott Mitchell wrote:
> On Tue, Aug 13, 2024 at 08:55:42PM +0200, Jürgen Groß wrote:
>> On 13.08.24 19:49, Elliott Mitchell wrote:
>>> On Tue, Aug 13, 2024 at 01:16:06PM +0200, Jürgen Groß wrote:
>>>>
>>>> I don't see a connection here, as spurious interrupts (as seen by the
>>>> hypervisor in your case) and spurious events (as seen by Andrei) are
>>>> completely different (hardware vs. software level).
>>>
>>> The entries seem to appear at an average of about 1/hour.  Could be most
>>> events are being dropped and 10x that number are occuring.  If so, those
>>> extras could be turning into spurious events seen by various domains.
>>
>> Even 10 spurious events per hour should not have a measurable impact
>> on performance.
> 
> Come to think of it, depending upon time that domain is sometimes low
> activity (build so it is either pegging or idle).  The 1/hour was during
> idle times, so during busy times it might be much worse.  I haven't been
> tracking `xl dmesg` as carefully recently.
> 
> Do the maintainers ever run machines with "iommu=debug"?  I'm actually
> rather concerned *anything* spurious is showing up as I'm left suspecting
> there may have been something lurking for some time.
> 
>>> There is a possibility spurious interrupts are being turned into spurious
>>> events by the back-end drivers.
>>
>> No, I don't think so.
>>
>>> Jürgen Groß, what is the performance impact of "iommu=debug"?  Seems to
>>> mostly cause more reporting and have minimal/no performance effect.
>>
>> I guess you are referring to the Xen option? I'm no expert in this
>> area.
> 
> Drat.  I haven't noticed much, which would match with simply enabling a
> bunch of debugging printk()s (alas I'm not monitoring performance closely
> enough to be sure).  Guess I wait for Andrei Semenov to state a comfort
> level with trying "iommu=debug".

You didn't answer my question.

Please send the Xen and dom0 command line options you are using.


Juergen



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 06:37:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 06:37:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776753.1186908 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se7dT-0005ji-Nl; Wed, 14 Aug 2024 06:37:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776753.1186908; Wed, 14 Aug 2024 06:37:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se7dT-0005jb-Kv; Wed, 14 Aug 2024 06:37:31 +0000
Received: by outflank-mailman (input) for mailman id 776753;
 Wed, 14 Aug 2024 06:37:30 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se7dS-0005jV-9m
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 06:37:30 +0000
Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com
 [2a00:1450:4864:20::62d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id acae42a6-5a07-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 08:37:28 +0200 (CEST)
Received: by mail-ej1-x62d.google.com with SMTP id
 a640c23a62f3a-a7ad02501c3so751014166b.2
 for <xen-devel@lists.xenproject.org>; Tue, 13 Aug 2024 23:37:28 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f3f4973dsm134998066b.20.2024.08.13.23.37.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 13 Aug 2024 23:37:27 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: acae42a6-5a07-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723617448; x=1724222248; 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=DYwiFc8GFPvY8am+eVOY7srueHTmaEp6Q+sfVsPVAlA=;
        b=H87gqGOXYLgYpo1dMwZ+fPL8l8EXQByW/iPFsoU198k8sNFK0Ftu5Z0vZ3qLLhQnUJ
         7uPtlZ4n3zCSfh4dsip4O8SdJaf2s7akGkx5exOHMrw2eCYIQGFBbfTnqfvdA+d/qbNk
         2KJfBJVNCEH/LMZHuz/GhW/Oq8mstdCCquvFGvoLOrLKeaL7jmJJEB4qMtrDLisdXct3
         ParBublyLG/xk8crX/PUvR+fNLMT2mC+2OSqfakbCfzH69xfwhBVU96YuXa4xNEzufJ6
         jW9eriEULprsLZ+YwnG/SOuIVOfB0rN5B6UZkBeBA/S9lWxCGDIg475pQlKN6A0n63Ed
         la/A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723617448; x=1724222248;
        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=DYwiFc8GFPvY8am+eVOY7srueHTmaEp6Q+sfVsPVAlA=;
        b=p0JmtJC0zDilWwFM0dH9GA3lU298pP9+jINeUTqlMiWezCoCLEsT+wa+vqukGYT8N+
         2N9ap+cg6ja5hUqrBJ1o5xXKPqILZkPlQuo2I7U4STIcHEGEy0eX9HIRCeCHHKBUTuLw
         j0WFs8RUQB3vvEFuqHsbRIpSd9nKL8JhXh/j+PvvRA8MDlXTWNR8Dxp0DyJTInbtaed/
         miGxQXzmoTMbDLrP5OXeEUZM57LDLSx/BhKzJfYnBDtEuZpuedEJZqT4CQWtxaO0oH11
         7fUS64YX3EaY6sL1Zfv2l49r/HfO88R6SwPgKvNLOH9AzQetEkITekNeNQ7Vm9HiLzTP
         3E1Q==
X-Gm-Message-State: AOJu0YwO+rjF/eVR3AZjF1IsW2zZJj6USkVEk6CZ6UfHbRCQ+zPKWBS3
	XIGw6nONAnTF1aczB7HOfsHqSifriau88Ndpno/xHR6F2HYGlm7OyQWa8zLSeg==
X-Google-Smtp-Source: AGHT+IHK4ClJ3B4G+KqNKlofXJTD62WhkuoidqH90c5X5tlwwwXgJNEodaIEPyL7bvBCZYjksVZCdw==
X-Received: by 2002:a17:907:1b19:b0:a7a:a7b8:adae with SMTP id a640c23a62f3a-a8366c1e778mr131227966b.4.1723617447447;
        Tue, 13 Aug 2024 23:37:27 -0700 (PDT)
Message-ID: <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
Date: Wed, 14 Aug 2024 08:37:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com,
 julien@xen.org
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240813171356.46760-3-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 13.08.2024 19:13, Ayan Kumar Halder wrote:
> From: Penny Zheng <penny.zheng@arm.com>
> 
> Introduced CONFIG_VMAP which is selected by the architectures that use
> MMU. vm_init() does not do anything if CONFIG_VMAP is not enabled.
> 
> VMAP is widely used in ALTERNATIVE feature to remap a range of memory
> with new memory attributes. Since this is highly dependent on virtual
> address translation, we choose to fold VMAP in MMU system.
> 
> In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
> only support in MMU system on ARM architecture. And ALTERNATIVE now
> depends on VMAP.
> 
> HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP as speculative
> attacks are not possible on non MMU based systems (ie Cortex-R52, R82).
> See https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability.

While I'm not an Arm expert and hence I'm likely missing aspects, I question
the one (Spectre-BHB) vulnerability there to be sufficient to draw a
conclusion towards the usefulness of branch hardening. I would advise
against encoding such a connection in the Kconfig dependencies.

> --- a/xen/arch/x86/Kconfig
> +++ b/xen/arch/x86/Kconfig
> @@ -1,6 +1,7 @@
>  config X86_64
>  	def_bool y
>  	select 64BIT
> +	select HAS_VMAP
>  
>  config X86
>  	def_bool y
> @@ -31,6 +32,7 @@ config X86
>  	select HAS_UBSAN
>  	select HAS_VPCI if HVM
>  	select NEEDS_LIBELF
> +	select HAS_VMAP

Why in two places? Also please respect alphabetic sorting here (if this
hunk is kept, which may be the more consistent approach) ...

> --- a/xen/common/Kconfig
> +++ b/xen/common/Kconfig
> @@ -77,6 +77,9 @@ config HAS_PIRQ
>  config HAS_PMAP
>  	bool
>  
> +config HAS_VMAP
> +	bool
> +
>  config HAS_SCHED_GRANULARITY
>  	bool

... and here.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 07:43:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 07:43:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776774.1186937 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se8ei-0007vU-KB; Wed, 14 Aug 2024 07:42:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776774.1186937; Wed, 14 Aug 2024 07:42:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se8ei-0007vN-Hb; Wed, 14 Aug 2024 07:42:52 +0000
Received: by outflank-mailman (input) for mailman id 776774;
 Wed, 14 Aug 2024 07:42: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=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se8eg-0007vE-RB
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 07:42:50 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cc58bb0d-5a10-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 09:42:46 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5b01af9b0c9so6621850a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 00:42:48 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f3f49748sm138175566b.4.2024.08.14.00.42.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 00:42:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cc58bb0d-5a10-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723621368; x=1724226168; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=y/gyX1MM3nNF8bRTN/QZSJAiytvPzO3GDCG2xKUr4Mw=;
        b=ZPjh86OMlYFDwy1/dg8TlyJW+pby38pLcDNTTlSPSy8O0IWsMbm/O0VkwxurOXeuYP
         P2pNo+AlkYfDgkhhYamAa7CwX3/KrYI5Jnc+Uh3aZXBNy6gRllJGets2n7ok+yJfvJDC
         iw+TgV6MUq0WClfSGaqs1FV0jxWnIBmVEbqK0VsQWjK63VyUpjE4UoHctBfYaO/wUyb1
         54CtqhyADc4nRODlDifBiRnunKBzWZDLdsH1lJftC3StsZZ4i0NeF8m3cdoeWjUfYj+z
         JLoPlBofTJCEMoFc/i4Cxn2xCRwO8QethIHJOF3XkCUUQE4DVgiZh1qEn1wsymfDBWbC
         e1lg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723621368; x=1724226168;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=y/gyX1MM3nNF8bRTN/QZSJAiytvPzO3GDCG2xKUr4Mw=;
        b=sv41nucyIs/hnAeqClnSHjy6vUwOAGy3ITVZK800XZiFuxLkGSlbCm09RRltiJeO3q
         JignBnA9VoA5kcH21A5q4fa3EoQku1nW+GgqX93FAo9xAXkDHP4f2f+ato9mTYyBaG3b
         3zEw0Tn+PQwj/9naN/mO6zjLVt9xBkMU2nbt5inav7/PFAhPSeVy8f0xUVBGHf1qw3Yp
         hAzF6V50ZjLlV2J2CI0uVDxC+jnpWc+ErCuYlxBdsPHxbEvJOngmbyL+84eo1FUrmvGJ
         PM9bekwu9VcaiIDyAUZk9E6WqXzOX7U3dZ1r0IJpaDbsD/3FtvxY6Ga1GR0E3R7ssUxK
         uoqw==
X-Gm-Message-State: AOJu0YxNpyNV5SITb1bp8MwICS98nUCbIpE44LrZmzzxxxU9YbGH7JRh
	KcR30ivagYoyasO1uUu2KnKjew+ehYW0lv1gjSiqoAzmipmi60EWxDze0oylEoRc0cxxbRNYY6M
	=
X-Google-Smtp-Source: AGHT+IEkTUg7rrTpins5N+V8LrVxYNViyw9829GXS1IMeeKwdbw+qf84rkJVeuF6A0z9KlOnqoXf7A==
X-Received: by 2002:a17:907:1b19:b0:a7a:b9dd:7757 with SMTP id a640c23a62f3a-a8366c1ecb1mr118482666b.12.1723621368079;
        Wed, 14 Aug 2024 00:42:48 -0700 (PDT)
Message-ID: <5d8c1cf6-71cc-4c1b-b2cc-2b9ff4829c04@suse.com>
Date: Wed, 14 Aug 2024 09:42:46 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2] mktarball: only archive Xen
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony Perard <anthony@xenproject.org>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

As was basically decided already a while ago, remove - in the simplest
possible way - the archiving of both qemu-s and mini-os from tarball
generation.

With this the subtree-force-update-all prereq isn't needed anymore in
the top level Makefile. That goal the also is unreferenced and hence is
being dropped, too.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
This is the simplistic approach; I'm sure this could now be done quite a
bit more efficiently. I also expect there's no longer a need to run
./configure ahead of the invocation of this script, but since I have no
idea why it was needed earlier on, I'm not removing that here from the
doc. IOW all cleanup that's probably better done separately, by someone
actually using all of that machinery.
---
v2: Drop subtree-force-update-all prereqs from ./Makefile.

--- a/Makefile
+++ b/Makefile
@@ -200,10 +200,6 @@ rpmball: dist
 subtree-force-update: mini-os-dir-force-update
 	$(MAKE) -C tools subtree-force-update
 
-.PHONY: subtree-force-update-all
-subtree-force-update-all: mini-os-dir-force-update
-	$(MAKE) -C tools subtree-force-update-all
-
 # Make a source tarball, including qemu sub-trees.
 #
 # src-tarball will use "git describe" for the version number.  This
@@ -214,11 +210,11 @@ subtree-force-update-all: mini-os-dir-fo
 # src-tarball-release will use "make xenversion" as the version
 # number.  This is suitable for release tarballs.
 .PHONY: src-tarball-release
-src-tarball-release: subtree-force-update-all
+src-tarball-release:
 	bash ./tools/misc/mktarball $(XEN_ROOT) $$($(MAKE) -C xen xenversion --no-print-directory)
 
 .PHONY: src-tarball
-src-tarball: subtree-force-update-all
+src-tarball:
 	bash ./tools/misc/mktarball $(XEN_ROOT) $$(git describe)
 
 .PHONY: clean
--- a/tools/misc/mktarball
+++ b/tools/misc/mktarball
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# mktarball: Make a release tarball (including xen, qemu, and qemu-traditional)
+# mktarball: Make a release tarball (including just xen)
 #
 # Takes 2 arguments, the path to the dist directory and the version
 set -ex
@@ -29,26 +29,6 @@ mkdir -p $tdir
 
 git_archive_into $xen_root $tdir/xen-$desc
 
-# We can't use git_archive_into with qemu upstream because it uses
-# git-submodules.  git-submodules are an inherently broken git feature
-# which should never be used in any circumstance.  Unfortunately, qemu
-# upstream uses them.  Relevantly for us, git archive does not work
-# properly when there are submodules.
-(
-    cd $xen_root/tools/qemu-xen-dir-remote
-    # if it's not clean, the qemu script will call `git stash' !
-    git --no-pager diff --stat HEAD
-    scripts/archive-source.sh $tdir/xen-$desc/tools/qemu-xen.tar
-    cd $tdir/xen-$desc/tools
-    mkdir qemu-xen
-    tar <qemu-xen.tar Cxf qemu-xen -
-    rm qemu-xen.tar
-)
-
-git_archive_into $xen_root/tools/qemu-xen-traditional-dir-remote $tdir/xen-$desc/tools/qemu-xen-traditional
-
-git_archive_into $xen_root/extras/mini-os-remote $tdir/xen-$desc/extras/mini-os
-
 GZIP=-9v tar cz -f $xen_root/dist/xen-$desc.tar.gz -C $tdir xen-$desc
 
 echo "Source tarball in $xen_root/dist/xen-$desc.tar.gz"


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 07:44:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 07:44:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776781.1186948 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se8g2-0008RU-VM; Wed, 14 Aug 2024 07:44:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776781.1186948; Wed, 14 Aug 2024 07:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se8g2-0008RN-Rd; Wed, 14 Aug 2024 07:44:14 +0000
Received: by outflank-mailman (input) for mailman id 776781;
 Wed, 14 Aug 2024 07:44:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se8g1-0008Q9-Pq
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 07:44:13 +0000
Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com
 [2a00:1450:4864:20::536])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ffbac252-5a10-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 09:44:12 +0200 (CEST)
Received: by mail-ed1-x536.google.com with SMTP id
 4fb4d7f45d1cf-5b8c2a6135eso1065187a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 00:44:12 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd1a601dfdsm3591917a12.83.2024.08.14.00.44.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 00:44:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ffbac252-5a10-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723621452; x=1724226252; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=R1wvKf6AjB5NsuELrr485XrHZsWeVGAqsKXNC7ny5v4=;
        b=QWUd8+dHOVIe5al/xaSGhlXw8dROZmnam20fVttttt03j+FzQW5mrpN3URvz9Aa3C1
         F1BZTu+Qob1krQVU43TPQD3F6W0ViCmd0LujMcfX4PLlUOogB4uxMLVAar2S+T4b7Kgy
         jpzJ4fsmdoj0rI+eAcrLPxD1yd9D7DDsKaSt4WHGe0YGqUkLuRWnh5+TulxqRyHgaR+b
         KAEY0evaPy7DNDSaN/+qWkF58lWP78IZVx3DO+R9nAzFCKi8nXfwKC1UbIghSnp9TF7b
         2gpZn4oK7H52QFFq87oVG2Xi4seIPz5vzLDk5Zg8tNL7n8eHqX0BOTiNzKGUalGor8rZ
         m0ag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723621452; x=1724226252;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=R1wvKf6AjB5NsuELrr485XrHZsWeVGAqsKXNC7ny5v4=;
        b=La+AGjfoBQajH+xKMr4Y/yICCgRwm8kLIhgupkz1ZZENO1k57ehx2TpwNEhkBGRuQL
         VJ/CfnGmOrNd/sL5pbBbN3ecnunWp8XBVtt3/INucYN9e9Qk0Jlhqdvad2CMtqpaaAV8
         OlYWn+TNWZkjXEps0K+RxPCUvU2nHuomPfMf+JtPnb1lOrgHHmbp8oE6+rb5Hg7Rl56D
         SRS3D2MldjSI52QtEBIEtFSgx1LqHnnSTYkeuay3pvZz+R8ysCU/emRO8ggr+BVr/1H6
         cp3put3sizn3KIoN0NiLR4iVKiCfy95xoc8JjMlKImIN9kBVuJ4lM7pVYroFeMiqE3eB
         z0OQ==
X-Gm-Message-State: AOJu0YxQQliiBC7LHdZ7Az/prgKVgyZUY+vWgL9ZuStmpXyuby1S3/Gs
	lYBxxnqjd0lhzV1e9WBhmz2GMrMzfYa/vN54s3rWdUN5aSxkA40rSjg3otBjC/XPBL085QivOOk
	=
X-Google-Smtp-Source: AGHT+IHVwzLkxbtm5iznwSA+MDN9soiS9AlQ6W14u0vx3DDvGfftbXuZ8bad3/aZaYHbWX5Rr9AxPw==
X-Received: by 2002:a05:6402:1d55:b0:585:5697:b882 with SMTP id 4fb4d7f45d1cf-5bd4616ac6amr4977691a12.3.1723621452242;
        Wed, 14 Aug 2024 00:44:12 -0700 (PDT)
Message-ID: <c648bfe1-6ab0-4429-ab8a-b452ad2359ff@suse.com>
Date: Wed, 14 Aug 2024 09:44:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v3] SUPPORT.md: split XSM from Flask
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Daniel Smith <dpsmith@apertussolutions.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

XSM is a generic framework, which in particular is also used by SILO.
With this it can't really be experimental: Arm mandates SILO for having
a security supported configuration.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v3: Add explanations. Another terminology adjustment.
v2: Terminology adjustments. Stronger description.

--- a/SUPPORT.md
+++ b/SUPPORT.md
@@ -769,13 +769,21 @@ Compile time disabled for ARM by default
 
     Status, x86: Supported, not security supported
 
-### XSM & FLASK
+### XSM (Xen Security Module) Framework
+
+XSM is a security policy framework.  The dummy implementation is covered by this
+statement, and implements a policy whereby dom0 is all powerful.  See below for
+alternative modules (FLASK, SILO).
+
+    Status: Supported
+
+### FLASK XSM Module
 
     Status: Experimental
 
 Compile time disabled by default.
 
-Also note that using XSM
+Also note that using FLASK
 to delegate various domain control hypercalls
 to particular other domains, rather than only permitting use by dom0,
 is also specifically excluded from security support for many hypercalls.
@@ -788,6 +796,13 @@ Please see XSA-77 for more details.
 The default policy includes FLASK labels and roles for a "typical" Xen-based system
 with dom0, driver domains, stub domains, domUs, and so on.
 
+### SILO XSM Module
+
+SILO implements a policy whereby DomU-s can only communicate with Dom0, yet not
+with each other.
+
+    Status: Supported
+
 ## Virtual Hardware, Hypervisor
 
 ### x86/Nested PV


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:01:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:01:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776795.1186958 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se8wi-0004HE-Ha; Wed, 14 Aug 2024 08:01:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776795.1186958; Wed, 14 Aug 2024 08:01:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se8wi-0004H7-ED; Wed, 14 Aug 2024 08:01:28 +0000
Received: by outflank-mailman (input) for mailman id 776795;
 Wed, 14 Aug 2024 08:01:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1se8wh-0004Gx-0B; Wed, 14 Aug 2024 08:01:27 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1se8wg-0003Ol-Sb; Wed, 14 Aug 2024 08:01:26 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1se8wg-0005tq-DO; Wed, 14 Aug 2024 08:01:26 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1se8wg-0000T2-Cr; Wed, 14 Aug 2024 08:01:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=YbuaTXQJficffs1CzLhO9Hc+zhJ8WPOPh8qmtjMMJNY=; b=bSwdb52/Ws09hpbWyKj67yxSNg
	IQZ1YQ5WkMANPVXkbvIxy3OUiU0d77t8tYpOwJu+1L06qNPrAKenorkF4rqX9guyHMoDgZ+uW4ifk
	QtwEZeFwN3wwKVLa66RbkDUOnBJSlMF7RfhXbV96yZh4MAooV2gwgG0IywRJHeixZP3Y=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187237-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187237: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=c36efb7fcea6ef9f31a20e60ec79ed3ae293feee
X-Osstest-Versions-That:
    xen=35c64c3dce01c2d0689a8c13240bf48a10cef783
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 14 Aug 2024 08:01:26 +0000

flight 187237 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187237/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  c36efb7fcea6ef9f31a20e60ec79ed3ae293feee
baseline version:
 xen                  35c64c3dce01c2d0689a8c13240bf48a10cef783

Last test of basis   187234  2024-08-13 21:00:27 Z    0 days
Testing same since   187237  2024-08-14 04:02:21 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   35c64c3dce..c36efb7fce  c36efb7fcea6ef9f31a20e60ec79ed3ae293feee -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:06:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:06:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776805.1186968 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se91u-0005Jh-4t; Wed, 14 Aug 2024 08:06:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776805.1186968; Wed, 14 Aug 2024 08:06:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se91u-0005J8-23; Wed, 14 Aug 2024 08:06:50 +0000
Received: by outflank-mailman (input) for mailman id 776805;
 Wed, 14 Aug 2024 08:06: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=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se91s-000545-84
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:06:48 +0000
Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com
 [2a00:1450:4864:20::52c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 256197ce-5a14-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 10:06:44 +0200 (CEST)
Received: by mail-ed1-x52c.google.com with SMTP id
 4fb4d7f45d1cf-5bb477e3a6dso6187323a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:06:46 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd196a82cesm3633721a12.58.2024.08.14.01.06.45
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 01:06:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 256197ce-5a14-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723622806; x=1724227606; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=I79eO9TCWK956QNgk+vrMtrj9fe/jcJEZ7S1Xjtke50=;
        b=aB36BrtRLcDoLVpa2f79Sfi1qX00GoMjjDi/3HFG7eXlIISyBAIyHjgq1c+c8Lc0h4
         wcSMg2kPXbeH0JXIFNTSvHUeA60SttXVwOwa0OwkoIdGFCBUp6AV6IphGTCVRxZw5gD6
         bRH9BU1C/t0d9RHG4y2I9ZcJmk6txQ5RVVIUJ01Mg2PkjlEuXCTeGcDWO2i3BdTm07LW
         ffyZ7ulvWngwNz4WPcPHLBTIUWeTHLXWwDFgJ3u4/YR8subWXQvJOH5K1TrjuIxVw+vl
         wVqzETlapoEkt0we2pbwfjupYUPIO3ND8qcIb7LFX8iG6dTvZdEniCjuHVig79pvrrQi
         pWew==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723622806; x=1724227606;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=I79eO9TCWK956QNgk+vrMtrj9fe/jcJEZ7S1Xjtke50=;
        b=AyAmaY/3kDYyk9v6p38EF8ZUiFG960JmBj5p30TuFqXh02RXKIgNyCWwGBQ/HWuXbe
         le/18Ts4a+JMltZPKFrGrRfXGxIwUyFGnaObCGkXiKc4XW3nn9Bpvbfz5hGgSoVOg9dD
         8gc0Ojb6jUt90dgZ74RGZvu4oC0rlL91GvWRadRZyAmtpfrbfNNCGUbnjwRRSXBCcom9
         QbQpsMqmG4TzHlktRBhUcVm8znfjuKN3u8S9NkLkybvdSfzDt6RLGkyMVHhPlOOzbTeI
         cWbDoyMAC67iamwLbjypP4UDzf2lTufJalaYSoRriyLEJdzU2vQO1OwyMYT6PaDmPegp
         vbWw==
X-Gm-Message-State: AOJu0YyHGCMAyYK7kWoLG8+/gSydtFbL+Eq/jM27UoTMWZnVOa4eE6bp
	w3v2MJPBqX1d5Tz4tpDeACALixlTrfUmClWj6EF7k/5pRe2Wa/7GaSbNfOCMyrmv5YoG7eFc3UQ
	=
X-Google-Smtp-Source: AGHT+IFSCy2PeKrGRy0EMkPA+t7dcRoibYN0pvGFO+qPlambEGLJrGJdCLFCgWLJVqBxZI6y3POz4Q==
X-Received: by 2002:a05:6402:5204:b0:5a3:af31:9ae4 with SMTP id 4fb4d7f45d1cf-5bea1c6aa4cmr1237414a12.5.1723622805982;
        Wed, 14 Aug 2024 01:06:45 -0700 (PDT)
Message-ID: <02755b04-844b-464c-966f-d4fa6068315e@suse.com>
Date: Wed, 14 Aug 2024 10:06:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] xvmalloc: please Misra C:2012 Rule 8.2
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

The cloning from xmalloc.h happened long before Misra work started in
earnest, leading to the missing parameter name having been overlooked
later on.

Fixes: 9102fcd9579f ("mm: introduce xvmalloc() et al and use for grant table allocations")
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xen/xvmalloc.h
+++ b/xen/include/xen/xvmalloc.h
@@ -41,7 +41,7 @@
                              __alignof__(typeof(*(ptr)))))
 
 /* Free any of the above. */
-void xvfree(void *);
+void xvfree(void *va);
 
 /* Free an allocation, and zero the pointer to it. */
 #define XVFREE(p) do { \


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:12:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:12:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776813.1186985 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se97K-0006yO-Po; Wed, 14 Aug 2024 08:12:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776813.1186985; Wed, 14 Aug 2024 08:12:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se97K-0006yH-N3; Wed, 14 Aug 2024 08:12:26 +0000
Received: by outflank-mailman (input) for mailman id 776813;
 Wed, 14 Aug 2024 08:12:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1se97J-0006y7-Bn; Wed, 14 Aug 2024 08:12:25 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1se97J-0003Za-9o; Wed, 14 Aug 2024 08:12:25 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1se97I-0006EO-TR; Wed, 14 Aug 2024 08:12:24 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1se97I-0003kq-T2; Wed, 14 Aug 2024 08:12:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=QsQrTvI4kOPw6j79/NdNGEJQJcy1Sp6ucgKrFF9fUL8=; b=rq6GrJOU8/wP0zRa1N3/DgTUX7
	ojkuXnxJ6ynn7xXCt+nNj6A9ZZGSusQhonO3gGfcdJtvKd9l08JinMRKw5L4NIR3qxWa7oQYIhgCO
	GUmgJDt0805XfzMUtp9WBRdbcI48/1QFUedPrG7WCLNFQ4MRD1VQrCZRLzHqLvzQE4qs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187229-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.17-testing test] 187229: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.17-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=f95a6b010b9a2633d5186f7a53e4607bbe56f618
X-Osstest-Versions-That:
    xen=72db7ba7dbd1287101b9533cd7e4c877f31a0764
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 14 Aug 2024 08:12:24 +0000

flight 187229 xen-4.17-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187229/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187191
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187191
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187191
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187191
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187191
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187191
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  f95a6b010b9a2633d5186f7a53e4607bbe56f618
baseline version:
 xen                  72db7ba7dbd1287101b9533cd7e4c877f31a0764

Last test of basis   187191  2024-08-08 12:09:39 Z    5 days
Testing same since   187229  2024-08-13 15:06:52 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Teddy Astie <teddy.astie@vates.tech>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   72db7ba7db..f95a6b010b  f95a6b010b9a2633d5186f7a53e4607bbe56f618 -> stable-4.17


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:28:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:28:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776826.1186996 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9N1-0001M5-2j; Wed, 14 Aug 2024 08:28:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776826.1186996; Wed, 14 Aug 2024 08:28:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9N0-0001Ly-W0; Wed, 14 Aug 2024 08:28:38 +0000
Received: by outflank-mailman (input) for mailman id 776826;
 Wed, 14 Aug 2024 08:28:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se9N0-0001LZ-2E
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:28:38 +0000
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com
 [2a00:1450:4864:20::529])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3384169a-5a17-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 10:28:36 +0200 (CEST)
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5af326eddb2so1042612a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:28:36 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd1968af77sm3591110a12.40.2024.08.14.01.28.35
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 01:28:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3384169a-5a17-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723624116; x=1724228916; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=6Nu4pPZi5zBW3bAq5eXnFW4GeiCLLJkowiSjAPbXk0A=;
        b=LMuN1ofZSaGI3Qx+e2hw8ywfqqOhuEJb+BMPkG47mFDX1Bl5rXXsNx46FCRZ/CZgbY
         U+Lx+CnCFXDH5OumfI1uHY7gbWiDDiv0aZPuE7FB2RRMoNDYfyBhFbwLJrEQukv3/4dr
         QrVp0PLTDE8/t1bM6nLQrZqa0+VOas93AjZR1shg8hsYU5fSgozY9JzHxHK/62mQoGOV
         xvJpcUn3ZuLMvUmsUcOHTEwYrFtoKOWx7IOSFOgPcmm1D1eG6KWxgpAFMs295QHXOgj6
         BOFlH/aEiydoSccP3eryLXJwSbP94CgN7vwiyLsVwxEv3bC0taT0gRAK6M705lxjHBvd
         2yKA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723624116; x=1724228916;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=6Nu4pPZi5zBW3bAq5eXnFW4GeiCLLJkowiSjAPbXk0A=;
        b=r3Y/rqwHu4Sxoy6lX7LealSH/K9U+1LFORQyMRqMdX+B3njNJqPkLYus3GCaSGKg2H
         5eAH8FZgsuB2uRKzIzqVR0Vka1YFDQhlm8DV8T82GOjGr3Zm3Xhpo5vuoB1SKOSZ5wrb
         ANS719XCkD7otbGEhxDJ3VFQTZ/TBTiLB+4gY4TI/m2x5tuVz3BcN9hAKDpOkSMyjoCA
         wv2a8KpGl5hh9bLX6E3/d/Ug4k1zbt/J8dkbMzWt+hPnt/Iud6tZpmlfFp4a9gQQPwfL
         AFWIVg8MOuPSYcUE2S+v7ZHr8zOjIAvmPguzMc0rFy2xXZLid5RzipXblqJKC11dGJ3k
         4AmA==
X-Gm-Message-State: AOJu0YxO/M8jisZMScfS5PuJ8hIZwlt1d5L6gZpGlm/0ejt8g9CKOZa9
	TkBeGKjrExGllxw9WuSR/5e7VMCENyNwnuCywUFrscTSJwC2fPw/a8uhfJMgWfkozQqiFarE7cE
	=
X-Google-Smtp-Source: AGHT+IFMiNfmATHueVOy0wRe/gQPpD2yaHzdlrEzRRIs6B2fvPRGiRKwTikAKXEvEZEPVCOrRdD6Ow==
X-Received: by 2002:a05:6402:2742:b0:5a1:5c0c:cbd6 with SMTP id 4fb4d7f45d1cf-5bea5e53c6cmr1216959a12.8.1723624116048;
        Wed, 14 Aug 2024 01:28:36 -0700 (PDT)
Message-ID: <2500a119-1734-44c2-9868-640bcc8ead2d@suse.com>
Date: Wed, 14 Aug 2024 10:28:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v5 0/3] x86/CPUID: leaf pruning
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

These three related patches were previously part of the AMX series.
For AVX10 some of this is going to be needed (or at least wanted) too,
though, hence I'm now refreshing these separately. Neither of the
three is strictly a functional prereq, but two of the three introduce
new functions which then are further altered while adding AVX10 (and
AMX) logic. Presumably none of these would be necessary anymore once
toolstack side work planned by Andrew gets carried out.

All taken together: Until it is clear that one or more of these are
strictly not needed / wanted (in this or another form), having these
ahead of the actual work seems preferable over accidentally losing
adjustments done for AVX10 / AMX (and down the road perhaps others).

1: adjust extended leaves out of range clearing
2: shrink max_{,sub}leaf fields according to actual leaf contents
3: move bounding of max_{,sub}leaf fields to library code

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:34:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:34:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776833.1187006 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9SR-0002tw-NH; Wed, 14 Aug 2024 08:34:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776833.1187006; Wed, 14 Aug 2024 08:34:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9SR-0002tp-KZ; Wed, 14 Aug 2024 08:34:15 +0000
Received: by outflank-mailman (input) for mailman id 776833;
 Wed, 14 Aug 2024 08:34: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=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se9SQ-0002t1-Nk
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:34:14 +0000
Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com
 [2a00:1450:4864:20::52a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fc3a8ba9-5a17-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 10:34:13 +0200 (CEST)
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-5a79df5af51so1103265a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:34:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f4183aa5sm145182266b.211.2024.08.14.01.34.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 01:34:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fc3a8ba9-5a17-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723624453; x=1724229253; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=0p4AvId7LsdumQhFUTANpZvFp9Wi6kOxkHUOGtjN1Vo=;
        b=c+eE5GozafZHEnwXB+M6Qys2iFXMju698+NV+r7hUh6Bh3w4H0KdsXGY8TR+Fau+ZA
         uUH8D4B8GaSj02LCvYbR8eowxHX6Vtb6gG1Zos9FwDsNzLyTwcxHawiXTJ6UivTJ6miG
         922bp3x8/c9ZBpQfjeF/1UDdul6OsewZ3XqE8o+yiTXBelk1hlj7eihglf91D437n6E+
         XbI/bnOcPdHeUxYArYODw4GJBqefhgl1JLIKAXzC9fio4DRqOgEYKp/BRlHFOuROynP1
         nE667yEpa08/hu2TdWliQJZGf2VWbtmg8jEsWKEh26tmOnW3g72BVjPjp/nNI42tZMdA
         UYrA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723624453; x=1724229253;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=0p4AvId7LsdumQhFUTANpZvFp9Wi6kOxkHUOGtjN1Vo=;
        b=kygENiHppVlDeTcOLtDOHGnOQU4gX6uUpRIE01UeJw00coctovt3p0RTZ+orDdAVcJ
         QYRST3j2ijy8U0jpRou0Gy5wOUDyOKf6S4pkSp0auvlNuzNWlrV0uQN5Jhi/jiTyjLW6
         HgDuWWiTEzFFFxefUQAutC6R8MAiYZbwQ8ussvB6unuohdAQA9cztqHHQi2Th9JPziAe
         mV1z+WbazscchyQK2BO1eIRMsPcV+kg55/Dcj6bT6in9HBTZpTdYOr4j8I62J/zWu1AR
         fdPQXp+K09dKn74I8qREHkimlAzSbfWaqqZZ8xlCi6VkuwpUG8jUk7F1kk7XJ8ZEM4F2
         R0tQ==
X-Gm-Message-State: AOJu0YygM8glkHEgyMN7WJ9MzJLtDaTYJ5o58h4Prjg/n46/lqsPXbSj
	5B9gkl7uAzKNJ4BRI1AnWz5vZnrAvn5P7Tp50ELW+RZlugn1hJl5lLrNsy8R+lY/4YrMSSCBifU
	=
X-Google-Smtp-Source: AGHT+IHCfMpdstRu/v5hw1srj/M07bk/9QhvLIxwlBwAzcQHH0K5rtJ0DcGPTFre5wHNnCe1FUAzmA==
X-Received: by 2002:a17:907:9814:b0:a7d:89ac:9539 with SMTP id a640c23a62f3a-a80f0a77484mr557770966b.7.1723624452906;
        Wed, 14 Aug 2024 01:34:12 -0700 (PDT)
Message-ID: <1512c261-dad4-472d-b6a7-aafd2cb5171b@suse.com>
Date: Wed, 14 Aug 2024 10:34:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v5 1/3] x86/CPUID: adjust extended leaves out of range
 clearing
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <2500a119-1734-44c2-9868-640bcc8ead2d@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <2500a119-1734-44c2-9868-640bcc8ead2d@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

A maximum extended leaf input value with the high half different from
0x8000 should not be considered valid - all leaves should be cleared in
this case.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
TBD: Andrew suggested to drop this patch, but that sub-thread still has
     a loose end. Hence, until I'm convinced otherwise, I've retained
     this patch here. I don't think it conflicts with any of the
     subsequent ones.
---
v2: Integrate into series.

--- a/tools/tests/cpu-policy/test-cpu-policy.c
+++ b/tools/tests/cpu-policy/test-cpu-policy.c
@@ -528,11 +528,22 @@ static void test_cpuid_out_of_range_clea
             },
         },
         {
+            .name = "no extd",
+            .nr_markers = 0,
+            .p = {
+                /* Clears all markers. */
+                .extd.max_leaf = 0,
+
+                .extd.vendor_ebx = 0xc2,
+                .extd.raw_fms = 0xc2,
+            },
+        },
+        {
             .name = "extd",
             .nr_markers = 1,
             .p = {
                 /* Retains marker in leaf 0.  Clears others. */
-                .extd.max_leaf = 0,
+                .extd.max_leaf = 0x80000000,
                 .extd.vendor_ebx = 0xc2,
 
                 .extd.raw_fms = 0xc2,
--- a/xen/lib/x86/cpuid.c
+++ b/xen/lib/x86/cpuid.c
@@ -285,7 +285,9 @@ void x86_cpu_policy_clear_out_of_range_l
                     ARRAY_SIZE(p->xstate.raw) - 1);
     }
 
-    zero_leaves(p->extd.raw, (p->extd.max_leaf & 0xffff) + 1,
+    zero_leaves(p->extd.raw,
+                ((p->extd.max_leaf >> 16) == 0x8000
+                 ? (p->extd.max_leaf & 0xffff) + 1 : 0),
                 ARRAY_SIZE(p->extd.raw) - 1);
 }
 



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:34:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:34:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776838.1187016 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9Sm-0003KI-VS; Wed, 14 Aug 2024 08:34:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776838.1187016; Wed, 14 Aug 2024 08:34:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9Sm-0003KB-Rj; Wed, 14 Aug 2024 08:34:36 +0000
Received: by outflank-mailman (input) for mailman id 776838;
 Wed, 14 Aug 2024 08:34:35 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se9Sl-0002t1-J4
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:34:35 +0000
Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com
 [2a00:1450:4864:20::52c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 08e01e7f-5a18-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 10:34:34 +0200 (CEST)
Received: by mail-ed1-x52c.google.com with SMTP id
 4fb4d7f45d1cf-5b01af9b0c9so6675055a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:34:34 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f411d937sm145127666b.111.2024.08.14.01.34.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 01:34:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 08e01e7f-5a18-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723624474; x=1724229274; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=LD7RVoUrYY1rDlKvCdkTHU6WjFnBT4YHFAlrub8IVO4=;
        b=LeNGtusjJsDaGNOCKgMOZKx48z4JIhnNpVYiwTiTlmLNk+BRWM2dstePziFT2ZNCS5
         ceM7YHQIaBeTJDiol5SLOi1N+ITC2VXF0PbzpAYe8w8hha8rV2sEdEq3iF6Pbtdcg7Xx
         6LFdRSrV/5NGqk7riZo3nqDhpgUiTY9ZYN1PkdhSbSvQZU/6aEAc0F7t0RiJI5QSb2lI
         qUA+maaj9BBg5WpYg+GIpZKPiCnWFj7mkSUxBOt7AMFPf/EJ9AW3rI05AACqPm2kScZm
         LC9c4VCls9/TUszbFj+dEQPXP996x0JY6GcAdahZmM8G4tqTJ8cXdQe75PJECTU7A4+O
         2UBg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723624474; x=1724229274;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=LD7RVoUrYY1rDlKvCdkTHU6WjFnBT4YHFAlrub8IVO4=;
        b=jzaLJmKMdcsfVyt6AHE/cKWT+L4vG4d2TjLYyd5UCNJOEiJkSH2Pxza7ZEly2hwU9S
         3xCq3/nOct7ccu4b7mraNUUTDaBCvBwWZqHTWgN2Qb1TuOTGRPqduoVSbQXR5ci57eEk
         emFykdxPHhlvozcneZ9JgyAwB8NinBJZa7HHFTmugf25qzSe7hzLeGJXrykx5HVp+MrG
         5hKCrPU3if2NhgkSYU9ys5JEKgUYz++He/KEuegJ1UHFl53qZZOZ4zohZTHdkyP53yHg
         xgxH9062zv//rzObhlZCFKN9UNMWdLOqsaWk7cwdHZoAGENpDfFu2QMPcc5FLpKayYDY
         P2Xg==
X-Gm-Message-State: AOJu0YygwmBhFf0leNQyRay3K87KPMP1eW9hPWWQmixsWpGyDAN6t76F
	10D52GNJUxOY0bs3tf/D5T1avnckScgepLHCBIWCasm/KIsQWPIlwWOdf5hE13swQI3TayA8eP8
	=
X-Google-Smtp-Source: AGHT+IHWUaziJt40slXYLfx/zS5l1+3OfS3Z5OEo1sRZe3QlOAtQ2/mTjjFrEby006NjocinUX1CmA==
X-Received: by 2002:a17:907:f765:b0:a7a:c256:3cf with SMTP id a640c23a62f3a-a8366d38ec6mr156646666b.24.1723624474076;
        Wed, 14 Aug 2024 01:34:34 -0700 (PDT)
Message-ID: <44d9ae81-14e4-4ade-adda-32f453e32f87@suse.com>
Date: Wed, 14 Aug 2024 10:34:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v5 2/3] x86/CPUID: shrink max_{,sub}leaf fields according to
 actual leaf contents
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <2500a119-1734-44c2-9868-640bcc8ead2d@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <2500a119-1734-44c2-9868-640bcc8ead2d@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Zapping leaf data for out of range leaves is just one half of it: To
avoid guests (bogusly or worse) inferring information from mere leaf
presence, also shrink maximum indicators such that the respective
trailing entry is not all blank (unless of course it's the initial
subleaf of a leaf that's not the final one).

This is also in preparation of bumping the maximum basic leaf we
support, to ensure guests not getting exposed related features won't
observe a change in behavior.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
TBD: The use in xc_cpuid_apply_policy() supposedly needs to further
     respect user (or migration source) max (sub)leaf values (i.e. the
     function needs calling unconditionally and then higher inputs need
     putting back); question is where those original values would be
     recorded / come from. (Supposedly there was a patch from Roger
     under similar or even the same title, which should have eliminated
     the need for the patch here, but upon searching I can't find such a
     patch.)
---
v5: Re-base.
v4: Re-instate with default policy shrinking dropped, and with
    81da2b544cbb folded in. Re-base.
v3: Record the actual non-empty subleaf in p->basic.raw[0x7], rather
    than subleaf 0. Re-base over Viridian leaf 40000005 addition.
v2: New.

--- a/tools/libs/guest/xg_cpuid_x86.c
+++ b/tools/libs/guest/xg_cpuid_x86.c
@@ -783,6 +783,13 @@ int xc_cpuid_apply_policy(xc_interface *
         }
     }
 
+    /*
+     * Do not try to shrink the policy if restoring, as that could cause
+     * guest visible changes in the maximum leaf fields.
+     */
+    if ( !restore )
+        x86_cpu_policy_shrink_max_leaves(&p->policy);
+
     nr_leaves = ARRAY_SIZE(p->leaves);
     rc = x86_cpuid_copy_to_buffer(&p->policy, p->leaves, &nr_leaves);
     if ( rc )
--- a/tools/tests/cpu-policy/test-cpu-policy.c
+++ b/tools/tests/cpu-policy/test-cpu-policy.c
@@ -8,10 +8,13 @@
 #include <err.h>
 
 #include <xen-tools/common-macros.h>
+#include <xen/asm/x86-defns.h>
 #include <xen/asm/x86-vendors.h>
 #include <xen/lib/x86/cpu-policy.h>
 #include <xen/domctl.h>
 
+#define XSTATE_FP_SSE  (X86_XCR0_X87 | X86_XCR0_SSE)
+
 static unsigned int nr_failures;
 #define fail(fmt, ...)                          \
 ({                                              \
@@ -576,6 +579,103 @@ static void test_cpuid_out_of_range_clea
     }
 }
 
+static void test_cpuid_maximum_leaf_shrinking(void)
+{
+    static const struct test {
+        const char *name;
+        struct cpu_policy p;
+    } tests[] = {
+        {
+            .name = "basic",
+            .p = {
+                /* Very basic information only. */
+                .basic.max_leaf = 1,
+                .basic.raw_fms = 0xc2,
+            },
+        },
+        {
+            .name = "cache",
+            .p = {
+                /* Cache subleaves present. */
+                .basic.max_leaf = 4,
+                .cache.subleaf[0].type = 1,
+            },
+        },
+        {
+            .name = "feat#0",
+            .p = {
+                /* Subleaf 0 only with some valid bit. */
+                .basic.max_leaf = 7,
+                .feat.max_subleaf = 0,
+                .feat.fsgsbase = 1,
+            },
+        },
+        {
+            .name = "feat#1",
+            .p = {
+                /* Subleaf 1 only with some valid bit. */
+                .basic.max_leaf = 7,
+                .feat.max_subleaf = 1,
+                .feat.avx_vnni = 1,
+            },
+        },
+        {
+            .name = "topo",
+            .p = {
+                /* Topology subleaves present. */
+                .basic.max_leaf = 0xb,
+                .topo.subleaf[0].type = 1,
+            },
+        },
+        {
+            .name = "xstate",
+            .p = {
+                /* First subleaf always valid (and then non-zero). */
+                .basic.max_leaf = 0xd,
+                .xstate.xcr0_low = XSTATE_FP_SSE,
+            },
+        },
+        {
+            .name = "extd",
+            .p = {
+                /* Commonly available information only. */
+                .extd.max_leaf = 0x80000008,
+                .extd.maxphysaddr = 0x28,
+                .extd.maxlinaddr = 0x30,
+            },
+        },
+    };
+
+    printf("Testing CPUID maximum leaf shrinking:\n");
+
+    for ( size_t i = 0; i < ARRAY_SIZE(tests); ++i )
+    {
+        const struct test *t = &tests[i];
+        struct cpu_policy *p = memdup(&t->p);
+
+        p->basic.max_leaf = ARRAY_SIZE(p->basic.raw) - 1;
+        p->feat.max_subleaf = ARRAY_SIZE(p->feat.raw) - 1;
+        p->extd.max_leaf = 0x80000000 | (ARRAY_SIZE(p->extd.raw) - 1);
+
+        x86_cpu_policy_shrink_max_leaves(p);
+
+        /* Check the the resulting max (sub)leaf values against expecations. */
+        if ( p->basic.max_leaf != t->p.basic.max_leaf )
+             fail("  Test %s basic fail - expected %#x, got %#x\n",
+                  t->name, t->p.basic.max_leaf, p->basic.max_leaf);
+
+        if ( p->extd.max_leaf != t->p.extd.max_leaf )
+             fail("  Test %s extd fail - expected %#x, got %#x\n",
+                  t->name, t->p.extd.max_leaf, p->extd.max_leaf);
+
+        if ( p->feat.max_subleaf != t->p.feat.max_subleaf )
+             fail("  Test %s feat fail - expected %#x, got %#x\n",
+                  t->name, t->p.feat.max_subleaf, p->feat.max_subleaf);
+
+        free(p);
+    }
+}
+
 static void test_is_compatible_success(void)
 {
     static struct test {
@@ -671,6 +771,7 @@ int main(int argc, char **argv)
     test_cpuid_serialise_success();
     test_cpuid_deserialise_failure();
     test_cpuid_out_of_range_clearing();
+    test_cpuid_maximum_leaf_shrinking();
 
     test_msr_serialise_success();
     test_msr_deserialise_failure();
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -383,6 +383,8 @@ static void __init calculate_host_policy
     if ( vpmu_mode == XENPMU_MODE_OFF )
         p->basic.raw[0xa] = EMPTY_LEAF;
 
+    x86_cpu_policy_shrink_max_leaves(p);
+
     /* 0x000000ce  MSR_INTEL_PLATFORM_INFO */
     /* probe_cpuid_faulting() sanity checks presence of MISC_FEATURES_ENABLES */
     p->platform_info.cpuid_faulting = cpu_has_cpuid_faulting;
@@ -576,12 +578,6 @@ static void __init calculate_pv_max_poli
 
     *p = host_cpu_policy;
 
-    /*
-     * Some VMs may have a larger-than-necessary feat max_subleaf.  Allow them
-     * to migrate in.
-     */
-    p->feat.max_subleaf = ARRAY_SIZE(p->feat.raw) - 1;
-
     x86_cpu_policy_to_featureset(p, fs);
 
     for ( i = 0; i < ARRAY_SIZE(fs); ++i )
@@ -613,6 +609,14 @@ static void __init calculate_pv_max_poli
     recalculate_xstate(p);
 
     p->extd.raw[0xa] = EMPTY_LEAF; /* No SVM for PV guests. */
+
+    x86_cpu_policy_shrink_max_leaves(p);
+
+    /*
+     * Some VMs may have a larger-than-necessary feat max_subleaf.  Allow them
+     * to migrate in.
+     */
+    p->feat.max_subleaf = ARRAY_SIZE(p->feat.raw) - 1;
 }
 
 static void __init calculate_pv_def_policy(void)
@@ -663,12 +667,6 @@ static void __init calculate_hvm_max_pol
 
     *p = host_cpu_policy;
 
-    /*
-     * Some VMs may have a larger-than-necessary feat max_subleaf.  Allow them
-     * to migrate in.
-     */
-    p->feat.max_subleaf = ARRAY_SIZE(p->feat.raw) - 1;
-
     x86_cpu_policy_to_featureset(p, fs);
 
     mask = hvm_hap_supported() ?
@@ -774,6 +772,14 @@ static void __init calculate_hvm_max_pol
     x86_cpu_featureset_to_policy(fs, p);
     recalculate_xstate(p);
 
+    x86_cpu_policy_shrink_max_leaves(p);
+
+    /*
+     * Some VMs may have a larger-than-necessary feat max_subleaf.  Allow them
+     * to migrate in.
+     */
+    p->feat.max_subleaf = ARRAY_SIZE(p->feat.raw) - 1;
+
     /* It's always possible to emulate CPUID faulting for HVM guests */
     p->platform_info.cpuid_faulting = true;
 }
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1060,13 +1060,15 @@ void cpuid_hypervisor_leaves(const struc
     uint32_t base = is_viridian_domain(d) ? 0x40000100 : 0x40000000;
     uint32_t idx  = leaf - base;
     unsigned int limit = is_viridian_domain(d) ? p->hv2_limit : p->hv_limit;
+    unsigned int dflt = is_pv_domain(d) ? XEN_CPUID_MAX_PV_NUM_LEAVES
+                                        : XEN_CPUID_MAX_HVM_NUM_LEAVES;
 
     if ( limit == 0 )
         /* Default number of leaves */
-        limit = XEN_CPUID_MAX_NUM_LEAVES;
+        limit = dflt;
     else
         /* Clamp toolstack value between 2 and MAX_NUM_LEAVES. */
-        limit = min(max(limit, 2u), XEN_CPUID_MAX_NUM_LEAVES + 0u);
+        limit = min(max(limit, 2u), dflt);
 
     if ( idx > limit )
         return;
--- a/xen/include/public/arch-x86/cpuid.h
+++ b/xen/include/public/arch-x86/cpuid.h
@@ -117,6 +117,10 @@
 /* Max. address width in bits taking memory hotplug into account. */
 #define XEN_CPUID_MACHINE_ADDRESS_WIDTH_MASK (0xffu << 0)
 
-#define XEN_CPUID_MAX_NUM_LEAVES 5
+#define XEN_CPUID_MAX_PV_NUM_LEAVES 5
+#define XEN_CPUID_MAX_HVM_NUM_LEAVES 4
+#define XEN_CPUID_MAX_NUM_LEAVES \
+    (XEN_CPUID_MAX_PV_NUM_LEAVES > XEN_CPUID_MAX_HVM_NUM_LEAVES ? \
+     XEN_CPUID_MAX_PV_NUM_LEAVES : XEN_CPUID_MAX_HVM_NUM_LEAVES)
 
 #endif /* __XEN_PUBLIC_ARCH_X86_CPUID_H__ */
--- a/xen/include/xen/lib/x86/cpu-policy.h
+++ b/xen/include/xen/lib/x86/cpu-policy.h
@@ -438,6 +438,13 @@ void x86_cpu_policy_fill_native(struct c
  */
 void x86_cpu_policy_clear_out_of_range_leaves(struct cpu_policy *p);
 
+/**
+ * Shrink max leaf/subleaf values such that the last respective valid entry
+ * isn't all blank.  While permitted by the spec, such extraneous leaves may
+ * provide undue "hints" to guests.
+ */
+void x86_cpu_policy_shrink_max_leaves(struct cpu_policy *p);
+
 #ifdef __XEN__
 #include <public/xen.h>
 typedef XEN_GUEST_HANDLE_64(xen_cpuid_leaf_t) cpuid_leaf_buffer_t;
--- a/xen/lib/x86/cpuid.c
+++ b/xen/lib/x86/cpuid.c
@@ -291,6 +291,45 @@ void x86_cpu_policy_clear_out_of_range_l
                 ARRAY_SIZE(p->extd.raw) - 1);
 }
 
+void x86_cpu_policy_shrink_max_leaves(struct cpu_policy *p)
+{
+    unsigned int i;
+
+    p->basic.raw[0x4] = p->cache.raw[0];
+
+    for ( i = p->feat.max_subleaf; i; --i )
+        if ( p->feat.raw[i].a | p->feat.raw[i].b |
+             p->feat.raw[i].c | p->feat.raw[i].d )
+            break;
+    p->feat.max_subleaf = i;
+    p->basic.raw[0x7] = p->feat.raw[i];
+
+    p->basic.raw[0xb] = p->topo.raw[0];
+
+    /*
+     * Due to the way xstate gets handled in the hypervisor (see
+     * recalculate_xstate()) there is (for now at least) no need to fiddle
+     * with the xstate subleaves (IOW we assume they're already in consistent
+     * shape, for coming from either hardware or recalculate_xstate()).
+     */
+    p->basic.raw[0xd] = p->xstate.raw[0];
+
+    for ( i = p->basic.max_leaf; i; --i )
+        if ( p->basic.raw[i].a | p->basic.raw[i].b |
+             p->basic.raw[i].c | p->basic.raw[i].d )
+            break;
+    p->basic.max_leaf = i;
+
+    for ( i = p->extd.max_leaf & 0xffff; i; --i )
+        if ( p->extd.raw[i].a | p->extd.raw[i].b |
+             p->extd.raw[i].c | p->extd.raw[i].d )
+            break;
+    if ( i | p->extd.raw[0].b | p->extd.raw[0].c | p->extd.raw[0].d )
+        p->extd.max_leaf = 0x80000000U | i;
+    else
+        p->extd.max_leaf = 0;
+}
+
 const uint32_t *x86_cpu_policy_lookup_deep_deps(uint32_t feature)
 {
     static const uint32_t deep_features[] = INIT_DEEP_FEATURES;



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:34:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:34:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776847.1187025 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9T9-0003po-5v; Wed, 14 Aug 2024 08:34:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776847.1187025; Wed, 14 Aug 2024 08:34:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9T9-0003pe-3J; Wed, 14 Aug 2024 08:34:59 +0000
Received: by outflank-mailman (input) for mailman id 776847;
 Wed, 14 Aug 2024 08: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=jxPN=PN=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1se9T7-0003IY-Pv
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:34:57 +0000
Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com
 [2607:f8b0:4864:20::72c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 15637184-5a18-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 10:34:56 +0200 (CEST)
Received: by mail-qk1-x72c.google.com with SMTP id
 af79cd13be357-7a1df0a9281so397778685a.1
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:34:56 -0700 (PDT)
Received: from fziglio-xenia-fedora.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a4c7e05595sm407786785a.122.2024.08.14.01.34.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 Aug 2024 01:34:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 15637184-5a18-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723624495; x=1724229295; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=BZa9e6Ro4WdFyS/CD9RCAzzR7cxVkwW0r40u2r8Z0Ts=;
        b=bCTxZZM0tH4jjaWWvIUs2t2QyxygGWtLeyz1+Ld09kf0Bs54hlvtvt9f9X7g7mffVU
         HLip8qHQ35T+wz05l/LEh4/j6biOgpXQvRHaDelmUYUHyn2c1OtbUlfYN6evCEKCO0zG
         PS9HpKNO67MG4sUwRAhisGvzVEHwh7BthWuzs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723624495; x=1724229295;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=BZa9e6Ro4WdFyS/CD9RCAzzR7cxVkwW0r40u2r8Z0Ts=;
        b=o8Oh+MJTBLqy+rdvrO3IKRXKkGXILqzdMHwR8gC/Eme5+wllF2BXJAwdzdQBnCb1fQ
         Qtk2FdH3nx4XUGaAsIgVki4q+4fKpi/rY+08d5nsUpvaMRlSyB9C+iL/w+TTBCtfp//2
         Pr/Nu7RqhfAn9MaVqXww7fLvadlaJn703VtmSaVjn8pju61QGsn+A6eGqGc3Bucl9ncJ
         ffa95t0umHOjvb4IvKKc9LRMGDa0y+FO2SoQc+OgDWWRXjg2s7jtMg26e7BJ7WAd+ImM
         v8Sj+86Yx5+zmycaOCeZi1wdC18xCFnyA0FUk7fefCWqLkjgWELJ4RQVkaN9BiFTj8AX
         pZuA==
X-Gm-Message-State: AOJu0YzxsR32o3qM9/naUV0x/LY1Y9fz6AiQ9ef7s9ZFrXXjC/naN54m
	L3LyrLSpBofk8+0AxZc+cFRM4PXB5W2qyJo72gF43RTHh+TJWwIhdsuvkLG8Qxj+oJuKF6pWkFK
	z
X-Google-Smtp-Source: AGHT+IHabNrK44XvtF/+KU+rjUBwIe7O6mvUvG0svDszGSSuxM2iKcMD2fTnLWR2xukTKk8gkmQ2pw==
X-Received: by 2002:a05:620a:19a9:b0:79f:947:8915 with SMTP id af79cd13be357-7a4ee33e7b2mr298596085a.29.1723624494854;
        Wed, 14 Aug 2024 01:34:54 -0700 (PDT)
From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH v2 0/5] Support EFI multiboot loading using PE binary
Date: Wed, 14 Aug 2024 09:34:09 +0100
Message-ID: <20240814083428.3012-1-frediano.ziglio@cloud.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Testing this feature in preparation for UEFI CA memory mitigation
requirements I found some issues causing the loading to fail and
other minor issues.
Details in series commit messages.
This is adding an additional way to boot Xen, using GrUB2+EFI
(xen.efi:__efi64_mb2_start).

Changes since v1:
- Changed title, apparently this is a kind of new mode;
- address lot of comments (see "Changes" in other messages).

Frediano Ziglio (5):
  x86: Put trampoline in .init.data section
  x86: Set xen_phys_start and trampoline_xen_phys_start earlier
  x86: Force proper gdt_boot_base setting
  x86: Compensate relocation in case of EFI
  x86: Rollback relocation in case of EFI multiboot

 xen/arch/x86/boot/Makefile          |  2 +-
 xen/arch/x86/boot/efi-reloc-image.c | 40 ++++++++++++++
 xen/arch/x86/boot/efi-reloc-image.h | 85 +++++++++++++++++++++++++++++
 xen/arch/x86/boot/head.S            | 72 ++++++++++++++++++------
 xen/arch/x86/efi/efi-boot.h         | 64 ++--------------------
 5 files changed, 187 insertions(+), 76 deletions(-)
 create mode 100644 xen/arch/x86/boot/efi-reloc-image.c
 create mode 100644 xen/arch/x86/boot/efi-reloc-image.h

-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:35:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:35:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776848.1187036 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9TA-00044j-FH; Wed, 14 Aug 2024 08:35:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776848.1187036; Wed, 14 Aug 2024 08:35:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9TA-00044a-C1; Wed, 14 Aug 2024 08:35:00 +0000
Received: by outflank-mailman (input) for mailman id 776848;
 Wed, 14 Aug 2024 08:34: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=jxPN=PN=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1se9T8-0002t1-MZ
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:34:58 +0000
Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com
 [2607:f8b0:4864:20::730])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 160e20d9-5a18-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 10:34:57 +0200 (CEST)
Received: by mail-qk1-x730.google.com with SMTP id
 af79cd13be357-7a1d067d5bbso416764485a.3
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:34:57 -0700 (PDT)
Received: from fziglio-xenia-fedora.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a4c7e05595sm407786785a.122.2024.08.14.01.34.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 Aug 2024 01:34:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 160e20d9-5a18-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723624496; x=1724229296; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=gz57YRc5BprGPTvdYo9SU35adCn77Ws3eV4wwb5cJIk=;
        b=M7LwU/cRPzolVj+d1NoK/05YuxazJIyRsktCHWXfG8FMeuG9e7NjtKipy7UpEnG0Ob
         lidRiThI9unKGfYG0pvcE7AUTRWPqSLlVGxc0mLcPSSbpVJNuBLyGF2Xo8HQHOX3Q9cz
         8DboQc8GJ2k5faSB5h9+G6FzoHp8lFufSATlg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723624496; x=1724229296;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=gz57YRc5BprGPTvdYo9SU35adCn77Ws3eV4wwb5cJIk=;
        b=gjbaQBWYTl35dDsJ4l+PhrJNQaLpRjaN+G5HX8vovGbOd9Xb1EiM1+562MSaY39R5r
         yNBtDE3s0AxxWGPCVhqHxv/MMUbTn7FXg2/7cgu3cVDCNYkjdZMHjrQX2TcBtySm+A2I
         CJ74GqHnroBbUp8QTAswvM9OMR+W8Dcb77dWmlYbS64cpWVULSohjsxX12zQfRlZG0KC
         nobQWCiAh9GZtVxU+CpHJAf88XIGH063yx2WrQE01oA+ZBZ3fS60g7+Gv11mptUYaFUw
         /KlK2mghN0ph5+MVsO7V1Y3c+9w91UgA8Z6FmlHROXLzxS0aKBnk196Yr6KkhfH11YAG
         y25g==
X-Gm-Message-State: AOJu0YwoYpn84edwH4UT0T+o7D1ZW5obwDcm4et1oaMlYQPvsvO5eM4a
	5QorccwcgDz0ji9HL480hn5Z2YBXPA3MhuZNdjmxgVUIYeYMXNvfQeGgZyOobaQI2l5uh9q4+jT
	y
X-Google-Smtp-Source: AGHT+IEVCJQeVFkZOhco5FcI3nGMRX2zjGWj3Gwlx3oxDXdB2Rk7Mq7EaVpIZTamEuWTOGgtNoJUVQ==
X-Received: by 2002:a05:620a:24d4:b0:79e:fbef:d23e with SMTP id af79cd13be357-7a4ee335132mr231733185a.17.1723624495972;
        Wed, 14 Aug 2024 01:34:55 -0700 (PDT)
From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v2 1/5] x86: Put trampoline in .init.data section
Date: Wed, 14 Aug 2024 09:34:10 +0100
Message-ID: <20240814083428.3012-2-frediano.ziglio@cloud.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240814083428.3012-1-frediano.ziglio@cloud.com>
References: <20240814083428.3012-1-frediano.ziglio@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This change allows to put the trampoline in a separate, not executable
section. The trampoline contains a mix of code and data (data which
is modified from C code during early start so must be writable).
This is in preparation for W^X patch in order to satisfy UEFI CA
memory mitigation requirements.
At the moment .init.text and .init.data in EFI mode are put together
so they will be in the same final section as before this patch.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/head.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index d8ac0f0494..16830f636f 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -870,6 +870,8 @@ cmdline_parse_early:
 reloc:
         .incbin "reloc.bin"
 
+        .section .init.data, "aw", @progbits
+
 ENTRY(trampoline_start)
 #include "trampoline.S"
 ENTRY(trampoline_end)
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:35:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:35:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776849.1187043 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9TB-0004D0-1L; Wed, 14 Aug 2024 08:35:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776849.1187043; Wed, 14 Aug 2024 08:35:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9TA-0004CO-S7; Wed, 14 Aug 2024 08:35:00 +0000
Received: by outflank-mailman (input) for mailman id 776849;
 Wed, 14 Aug 2024 08:35:00 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jxPN=PN=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1se9TA-0003IY-2G
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:35:00 +0000
Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com
 [2607:f8b0:4864:20::1130])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 16bf59dd-5a18-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 10:34:58 +0200 (CEST)
Received: by mail-yw1-x1130.google.com with SMTP id
 00721157ae682-690af536546so63569377b3.3
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:34:58 -0700 (PDT)
Received: from fziglio-xenia-fedora.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a4c7e05595sm407786785a.122.2024.08.14.01.34.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 Aug 2024 01:34:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 16bf59dd-5a18-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723624497; x=1724229297; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=9liPXw8F8uWc1T2M5e5K9juxcl/gQEIllOyVhjRgClo=;
        b=YZuTbeCi/FYg66M3taI8SEwHanJvd8Hx+Kqafh0DrF6FR5XeQi0iHXZguxdTN4wYtg
         ilT1QxuJDth8LjAMJJkbjElrTpq3T5r9ilp2ZEqsZT3HbczaHj4jzqI42yrxRZX/QAqZ
         jYJq5ByXGFQlPdz0+uuRMFr3LGqd6W4eodr10=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723624497; x=1724229297;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=9liPXw8F8uWc1T2M5e5K9juxcl/gQEIllOyVhjRgClo=;
        b=cT1p6z05tWzlCXlHvUrWfgcKHAfFEk1DS9gMy0pHEE929Fqbfy4njXt8hkSJ3WZvje
         WjKJauE2+BVnPopvdXPbMbV5H3KcgMhQkZr6Wt9vh25Kav2xXkxH19J4x0z45dFbJOVq
         7tn/Uw+2HbgH8Xf8IzeBu+G1lpk2rfq5+iaSMT5YNdCJHDOypJzT6uzz6b6afM2xOnlI
         I9pNBL+CkoI1M+A6ARUF8lCiOOhO3T3z8PZ2VASdwIOgguqS3IG3VuHla2Eq65OQqUcn
         Bg4wxcCtWUOuE3Dd2nG5zQBbfK8DD4CpT6ZmD3ZdiIjLCDjOTopeBZpalt+NLV8uYgLR
         vZJw==
X-Gm-Message-State: AOJu0Yz/uNKJO0RnpqZnmyiPqq8uZt9NmAmy4cHrZkKdVCimaSBuf/oz
	sjKOSDLo3i+MW7VjCF8fjHLA3EagGrFuQzIVRM2xdP55sypNnwOo5dgB+XQeqRoPs2KCKE0Cm5q
	W
X-Google-Smtp-Source: AGHT+IGMUyQiPtuxz+T1VQxDgT44hXZVi7vkaynauzor/OZHJNJzRTZJWR2TZztIUfw3xi2fMzeBPA==
X-Received: by 2002:a05:690c:2512:b0:648:3fb2:753b with SMTP id 00721157ae682-6ac976454c9mr21427057b3.24.1723624497101;
        Wed, 14 Aug 2024 01:34:57 -0700 (PDT)
From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v2 2/5] x86: Set xen_phys_start and trampoline_xen_phys_start earlier
Date: Wed, 14 Aug 2024 09:34:11 +0100
Message-ID: <20240814083428.3012-3-frediano.ziglio@cloud.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240814083428.3012-1-frediano.ziglio@cloud.com>
References: <20240814083428.3012-1-frediano.ziglio@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

No reason to wait, if Xen image is loaded by EFI (not multiboot
EFI path) these are set in efi_arch_load_addr_check, but
not in the multiboot EFI code path.
This change makes the 2 EFI code paths more similar and allows
the usage of these variables if needed.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/head.S | 5 +++++
 1 file changed, 5 insertions(+)
---
Changes since v1:
- Do not remove other hunk, used for BIOS;
- Slightly improved commit message.

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 16830f636f..af598a60bf 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -240,6 +240,11 @@ __efi64_mb2_start:
         jmp     x86_32_switch
 
 .Lefi_multiboot2_proto:
+        /* Save Xen image load base address for later use. */
+        lea     __image_base__(%rip), %esi
+        mov     %rsi, xen_phys_start(%rip)
+        mov     %esi, trampoline_xen_phys_start(%rip)
+
         /* Zero EFI SystemTable, EFI ImageHandle addresses and cmdline. */
         xor     %esi,%esi
         xor     %edi,%edi
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:35:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:35:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776850.1187049 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9TB-0004H2-DA; Wed, 14 Aug 2024 08:35:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776850.1187049; Wed, 14 Aug 2024 08:35:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9TB-0004G8-4t; Wed, 14 Aug 2024 08:35:01 +0000
Received: by outflank-mailman (input) for mailman id 776850;
 Wed, 14 Aug 2024 08:35:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jxPN=PN=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1se9TA-0002t1-3f
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:35:00 +0000
Received: from mail-vs1-xe2e.google.com (mail-vs1-xe2e.google.com
 [2607:f8b0:4864:20::e2e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 175b8caa-5a18-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 10:34:59 +0200 (CEST)
Received: by mail-vs1-xe2e.google.com with SMTP id
 ada2fe7eead31-492a01bce97so2246922137.2
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:34:59 -0700 (PDT)
Received: from fziglio-xenia-fedora.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a4c7e05595sm407786785a.122.2024.08.14.01.34.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 Aug 2024 01:34:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 175b8caa-5a18-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723624498; x=1724229298; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=hx6AIwlEbMHavC5DjEjakTrNbCVEjBb0SKVNkWMFXTc=;
        b=hN5Oh2eW3WaDyDtMkMUKMYqhlwsaIHHRbPiZFw1qmF8JftzGcJ30bax86QiFXOG4sW
         x2pJkGIlTsv5lfb/NDrJgUhMx5SqswPWpEfUiNE+9LlkID12mXA350jl59UbgKy+ytWD
         xkXSqfCUeczJYMi+2B1HME+acSCyJovlXJn/o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723624498; x=1724229298;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=hx6AIwlEbMHavC5DjEjakTrNbCVEjBb0SKVNkWMFXTc=;
        b=j6IktMvRA45hviFyWD9sPur/l+oA/6BMKCHA8OIM8+3YMsD8MK+BG9Zw/21HoqF0oF
         30YAA3eL3e0oP92EF7bUb6HHrufGvb5JlRKGyfYUb59g99Dt6wEi8m/A0ch47njjdUYv
         2kayIYQuSvLq9IK0xo9xRFtIqQjnTIFjNfvuCnDrdQFrgSf3BS76LiYiAeD7NeM4/1UK
         /PHqyY+TvFcpxPjbavorYzmeeAtz5wLTtM+nuKmrgQ/ZSlB5Gw+1l4jzkK0yIVPNTx+f
         NuZH7AZ2hUTp9qVpT46eqIP5ffWYxhZO3Y5jyTAcOzWu2a3cnLAWLScE6JNojrJdRFs8
         FqCQ==
X-Gm-Message-State: AOJu0YyqjeHFMYwAtJTHMcTepqFN5Qj2R8nwI2Po8rXPvvGyyOKNQgXC
	sBhEKC1GkuT0cqonOI0Idu0rjFErLoX93okUynAIbpekd34uwQycSBofuzoLfdfykMx57wrmwYp
	K
X-Google-Smtp-Source: AGHT+IFL70GY1qUxURIAZQ+mo6txlE+c+ln237y0PC4cC3hmxTtF9rJyDjIROcbYWReJ7g4d9xoUaQ==
X-Received: by 2002:a05:6102:3593:b0:48f:89cc:dd2b with SMTP id ada2fe7eead31-4975992d5efmr2467012137.11.1723624498219;
        Wed, 14 Aug 2024 01:34:58 -0700 (PDT)
From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v2 3/5] x86: Force proper gdt_boot_base setting
Date: Wed, 14 Aug 2024 09:34:12 +0100
Message-ID: <20240814083428.3012-4-frediano.ziglio@cloud.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240814083428.3012-1-frediano.ziglio@cloud.com>
References: <20240814083428.3012-1-frediano.ziglio@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Instead of relocate the value at that position compute it
entirely and write it.
During EFI boots sym_offs(SYMBOL) are potentially relocated
causing the values to be corrupted.
For PVH and BIOS the change won't be necessary but keep the
code consistent.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/head.S | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index af598a60bf..666e341bc5 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -132,8 +132,7 @@ multiboot2_header:
 gdt_boot_descr:
         .word   .Ltrampoline_gdt_end - trampoline_gdt - 1
 gdt_boot_base:
-        .long   sym_offs(trampoline_gdt)
-        .long   0 /* Needed for 64-bit lgdt */
+        .quad   0 /* Needed for 64-bit lgdt */
 
 vga_text_buffer:
         .long   0xb8000
@@ -373,15 +372,16 @@ __efi64_mb2_start:
 x86_32_switch:
         mov     %r15,%rdi
 
-        /* Store Xen image load base address in place accessible for 32-bit code. */
-        lea     __image_base__(%rip),%esi
-
         cli
 
         /* Initialize GDTR. */
-        add     %esi,gdt_boot_base(%rip)
+        lea     trampoline_gdt(%rip), %esi
+        mov     %esi, gdt_boot_base(%rip)
         lgdt    gdt_boot_descr(%rip)
 
+        /* Store Xen image load base address in place accessible for 32-bit code. */
+        lea     __image_base__(%rip),%esi
+
         /* Reload code selector. */
         pushq   $BOOT_CS32
         lea     cs32_switch(%rip),%edx
@@ -439,7 +439,8 @@ __pvh_start:
         movb    $-1, sym_esi(opt_console_xen)
 
         /* Prepare gdt and segments */
-        add     %esi, sym_esi(gdt_boot_base)
+        lea     sym_esi(trampoline_gdt), %ecx
+        mov     %ecx, sym_esi(gdt_boot_base)
         lgdt    sym_esi(gdt_boot_descr)
 
         mov     $BOOT_DS, %ecx
@@ -543,7 +544,8 @@ trampoline_bios_setup:
          *
          * Initialize GDTR and basic data segments.
          */
-        add     %esi,sym_esi(gdt_boot_base)
+        lea     sym_esi(trampoline_gdt), %ecx
+        mov     %ecx, sym_esi(gdt_boot_base)
         lgdt    sym_esi(gdt_boot_descr)
 
         mov     $BOOT_DS,%ecx
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:35:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:35:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776851.1187066 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9TD-0004qh-LH; Wed, 14 Aug 2024 08:35:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776851.1187066; Wed, 14 Aug 2024 08:35:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9TD-0004qW-HB; Wed, 14 Aug 2024 08:35:03 +0000
Received: by outflank-mailman (input) for mailman id 776851;
 Wed, 14 Aug 2024 08:35: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=jxPN=PN=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1se9TC-0002t1-1Q
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:35:02 +0000
Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com
 [2607:f8b0:4864:20::72c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 18748825-5a18-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 10:35:01 +0200 (CEST)
Received: by mail-qk1-x72c.google.com with SMTP id
 af79cd13be357-7a1dac7f0b7so433371885a.0
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:35:01 -0700 (PDT)
Received: from fziglio-xenia-fedora.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a4c7e05595sm407786785a.122.2024.08.14.01.34.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 Aug 2024 01:34:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 18748825-5a18-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723624500; x=1724229300; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=8cx+yFVCJfgxWpnsCCMINuRQ/ctq1Ga1ijOLJ+Mk9mo=;
        b=az8blai454zBbhhrTHV6Kk0zNQXleVGKjhEpAfDMNQ4gOaR3TyIDLIewHInPiL+MMz
         sIv5m1zqwWNfq4AxeRGinH8Ji7zv5kbhX1oDtsKpdxUNNWXyVUpfVmFNp8etNIBX7U0E
         /aoUBk4aRC69/GiPlCb7/ubwAuZ7n3Rt8awDY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723624500; x=1724229300;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=8cx+yFVCJfgxWpnsCCMINuRQ/ctq1Ga1ijOLJ+Mk9mo=;
        b=sC0NKDKJq+QC1mbucCmP6D1yLegdb28k8Ot9aWRpjyz2ErKCTkTqxJtU8aQ06ELg9z
         cOqxqMpEWWdH4iGIjDpx2XNSuygyjj80k4g8KJ91NK1BqgAOXw+1r0dJrD8UyXZsxNBh
         0K3/Qr2KhxoDZBBeChsImpHMVT17t/hezRBGhck4jqE7SyosYOVLvlh6UThV2lZmHntN
         DmIhr16Knnjkmj3xSrJwnlAAQR9klVwpxsOnBLtT7BIOENtEdkvGEZhNPe31152ZXItd
         tEzQkmlnbqD2VKtO2zKxOr2giXUGEkdfQSN9ZrdWcpFttbQzRlFHvIlhSwyn7Asjn0jR
         z+MQ==
X-Gm-Message-State: AOJu0YxAFTt81phoaOMmR8fKfxsS23Hfb4PgT9zaMjVz/JNHwkqD2pya
	fipAP3OwEaL86HMQWwh+iLDN/NLj/INacItRBHbRtAZbX36gWXvBWoKuf4lOUzqB9fx0AwdwAjQ
	/
X-Google-Smtp-Source: AGHT+IH9FUz7tjCeqZVLYlglNRnjlEx+UsjubjRMdy3lW/lyF98I7fqJhsyulPcCyllSixJ04vyVjA==
X-Received: by 2002:a05:620a:28c1:b0:79f:9b5:ff78 with SMTP id af79cd13be357-7a4ee33c969mr246582985a.34.1723624500146;
        Wed, 14 Aug 2024 01:35:00 -0700 (PDT)
From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v2 4/5] x86: Compensate relocation in case of EFI
Date: Wed, 14 Aug 2024 09:34:13 +0100
Message-ID: <20240814083428.3012-5-frediano.ziglio@cloud.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240814083428.3012-1-frediano.ziglio@cloud.com>
References: <20240814083428.3012-1-frediano.ziglio@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

If code is loaded by EFI the loader will relocate the image
under 4GB. This causes offsets in x86 code generated by
sym_offs(SYMBOL) to be relocated too (basically they won't be
offsets from image base). In order to get wanted address
when using sym_offs an sym_esi compensate the difference
in %esi.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/head.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
Changes since v1:
- Completely different way to cope with the issue, much more easier.

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 666e341bc5..86805389f9 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -380,7 +380,8 @@ x86_32_switch:
         lgdt    gdt_boot_descr(%rip)
 
         /* Store Xen image load base address in place accessible for 32-bit code. */
-        lea     __image_base__(%rip),%esi
+        lea     __image_base__(%rip), %esi
+        sub     $sym_offs(__image_base__), %esi
 
         /* Reload code selector. */
         pushq   $BOOT_CS32
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:35:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:35:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776852.1187076 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9TE-00057u-Up; Wed, 14 Aug 2024 08:35:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776852.1187076; Wed, 14 Aug 2024 08:35:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9TE-00057f-QW; Wed, 14 Aug 2024 08:35:04 +0000
Received: by outflank-mailman (input) for mailman id 776852;
 Wed, 14 Aug 2024 08:35: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=jxPN=PN=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1se9TD-0002t1-KE
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:35:03 +0000
Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com
 [2607:f8b0:4864:20::b31])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 194a8861-5a18-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 10:35:02 +0200 (CEST)
Received: by mail-yb1-xb31.google.com with SMTP id
 3f1490d57ef6-e0e88873825so6295835276.2
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:35:02 -0700 (PDT)
Received: from fziglio-xenia-fedora.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a4c7e05595sm407786785a.122.2024.08.14.01.35.00
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 Aug 2024 01:35:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 194a8861-5a18-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723624501; x=1724229301; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=C3RLkkdEw+WvOJ6h0uz0D93wDr/BTPYuQooWwQucVfo=;
        b=Jm05QScSbdxb7nUlMX+0piRorKZwHiGH3zsUozIEigTxKg24CVYfX9puy2e+rfBfgr
         vxQHrpzNz3fhGzbt7r2oMCI40eH1iXC08B2f8Yq1G1KHjaViIBel3/t7YPqu5BooxjTR
         gSSDH7foo7nir5C99Lg9LiefxW3ZAg9oDcCWM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723624501; x=1724229301;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=C3RLkkdEw+WvOJ6h0uz0D93wDr/BTPYuQooWwQucVfo=;
        b=B49CzAUgQhsZ4GZfU8c0lKYkIIihKQseP1kI41McEm5vbLirq9h9QngYvZGmdwGOMW
         SNqiaA47XqHRii+xFEe1W7SspVaH/8NJ+FcPhanCxihX0UAUn6wSsv42JL/fp1y93CDZ
         FSBk9dREmVkyhJ+//YYoRTASVjL70jXo+gF35P/dAIq0ou+7wYDRONhaE/uJtqW8/zyP
         E1xUoiQwCDHhR+K/f66the3JsN3Q++NKppAY1aOhBmpGhZdmH2S4s9EDCH8oPbfqFFxd
         1AlB/o0pSB9rj7PvXW9yDSqX06iQ5D7lMAOuSqBCBYVOZdsFwWl4UBqHzs+l3fkTy4gy
         vutg==
X-Gm-Message-State: AOJu0YyipzgSXuD2WcTJuRzMm8aGFhuipESf5ye8D/oA8HvAr0XyNiko
	7Frq8Ke0FefR22k8NhKQd2phED2u/6wFltpKzeJRZ1ldmyhr7xkc3zpEFyyU0QQWOJHV505viXh
	v
X-Google-Smtp-Source: AGHT+IGKNHJUKcuFo4EaeLXlmE5TDLQ5CU7BIa/3jgXJownF0st8Fk8SKovg0rOsFbAmrWJAlwJQ0A==
X-Received: by 2002:a05:690c:3405:b0:62f:945a:7bb1 with SMTP id 00721157ae682-6ac9a478546mr20841897b3.42.1723624501462;
        Wed, 14 Aug 2024 01:35:01 -0700 (PDT)
From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH v2 5/5] x86: Rollback relocation in case of EFI multiboot
Date: Wed, 14 Aug 2024 09:34:14 +0100
Message-ID: <20240814083428.3012-6-frediano.ziglio@cloud.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240814083428.3012-1-frediano.ziglio@cloud.com>
References: <20240814083428.3012-1-frediano.ziglio@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In case EFI not multiboot rolling back relocation is done in
efi_arch_post_exit_boot, called by efi_start however this is
not done in multiboot code path.
Do it also for this path to make it work correctly.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/Makefile          |  2 +-
 xen/arch/x86/boot/efi-reloc-image.c | 40 ++++++++++++++
 xen/arch/x86/boot/efi-reloc-image.h | 85 +++++++++++++++++++++++++++++
 xen/arch/x86/boot/head.S            | 44 ++++++++++++---
 xen/arch/x86/efi/efi-boot.h         | 64 ++--------------------
 5 files changed, 168 insertions(+), 67 deletions(-)
 create mode 100644 xen/arch/x86/boot/efi-reloc-image.c
 create mode 100644 xen/arch/x86/boot/efi-reloc-image.h
---
Changes since v1:
- many style updates;
- split file for 32 bit relocation;
- reuse code from header avoiding duplication;
- add some more comment to assembly code;

diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile
index 03d8ce3a9e..49792e0acf 100644
--- a/xen/arch/x86/boot/Makefile
+++ b/xen/arch/x86/boot/Makefile
@@ -1,6 +1,6 @@
 obj-bin-y += head.o
 
-head-bin-objs := cmdline.o reloc.o
+head-bin-objs := cmdline.o reloc.o efi-reloc-image.o
 
 nocov-y   += $(head-bin-objs)
 noubsan-y += $(head-bin-objs)
diff --git a/xen/arch/x86/boot/efi-reloc-image.c b/xen/arch/x86/boot/efi-reloc-image.c
new file mode 100644
index 0000000000..b103e37cd7
--- /dev/null
+++ b/xen/arch/x86/boot/efi-reloc-image.c
@@ -0,0 +1,40 @@
+/*
+ * efi-reloc-image.c
+ *
+ * 32-bit flat memory-map routines for relocating back PE executable.
+ * This is done with paging disabled to avoid permission issues.
+ *
+ * Copyright (c) 2024, Citrix Systems, Inc.
+ */
+
+/*
+ * This entry point is entered from xen/arch/x86/boot/head.S with:
+ *   - 0x04(%esp) = __XEN_VIRT_START - xen_phys_start
+ *   - 0x0c(%esp) = xen_phys_start
+ *   - 0x10(%esp) = __base_relocs_start
+ *   - 0x14(%esp) = __base_relocs_end
+ */
+asm (
+    "    .text                         \n"
+    "    .globl _start                 \n"
+    "_start:                           \n"
+    "    jmp    reloc_pe_back          \n"
+    );
+
+#include "defs.h"
+
+/* Do not patch page tables. */
+#define in_page_tables(v) false
+
+#define EFI_RELOC_IMAGE_EARLY 1
+#include "efi-reloc-image.h"
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/boot/efi-reloc-image.h b/xen/arch/x86/boot/efi-reloc-image.h
new file mode 100644
index 0000000000..999dd2d2c8
--- /dev/null
+++ b/xen/arch/x86/boot/efi-reloc-image.h
@@ -0,0 +1,85 @@
+/*
+ * efi-reloc-image.h
+ *
+ * Code for relocating back PE executable.
+ * This code is common between 64 bit and 32 bit.
+ *
+ * Copyright (c) 2024, Citrix Systems, Inc.
+ */
+
+#if EFI_RELOC_IMAGE_EARLY != 0 && EFI_RELOC_IMAGE_EARLY != 1
+#error EFI_RELOC_IMAGE_EARLY must be defined either 0 or 1
+#endif
+
+typedef struct pe_base_relocs {
+    uint32_t rva;
+    uint32_t size;
+    uint16_t entries[];
+} pe_base_relocs;
+
+#define PE_BASE_RELOC_ABS      0
+#define PE_BASE_RELOC_HIGHLOW  3
+#define PE_BASE_RELOC_DIR64   10
+
+#if EFI_RELOC_IMAGE_EARLY
+bool __stdcall
+#else
+static bool
+#endif
+reloc_pe_back(long long delta,
+              unsigned long xen_phys_start,
+              const pe_base_relocs *__base_relocs_start,
+              const pe_base_relocs *__base_relocs_end)
+{
+    const struct pe_base_relocs *base_relocs;
+
+    for ( base_relocs = __base_relocs_start; base_relocs < __base_relocs_end; )
+    {
+        unsigned int i = 0, n;
+
+        n = (base_relocs->size - sizeof(*base_relocs)) /
+            sizeof(*base_relocs->entries);
+
+        for ( ; i < n; ++i )
+        {
+            unsigned long addr = xen_phys_start + base_relocs->rva +
+                                 (base_relocs->entries[i] & 0xfff);
+
+            switch ( base_relocs->entries[i] >> 12 )
+            {
+            case PE_BASE_RELOC_ABS:
+                break;
+            case PE_BASE_RELOC_HIGHLOW:
+                if ( delta )
+                {
+                    *(uint32_t *)addr += delta;
+                    if ( in_page_tables(addr) )
+                        *(uint32_t *)addr += xen_phys_start;
+                }
+                break;
+            case PE_BASE_RELOC_DIR64:
+                if ( delta )
+                {
+                    *(uint64_t *)addr += delta;
+                    if ( in_page_tables(addr) )
+                        *(uint64_t *)addr += xen_phys_start;
+                }
+                break;
+            default:
+                return false;
+            }
+        }
+        base_relocs = (const void *)(base_relocs->entries + i + (i & 1));
+    }
+    return true;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index 86805389f9..dd3600c14b 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -332,7 +332,8 @@ __efi64_mb2_start:
          */
         and     $~15,%rsp
 
-        /* Save Multiboot2 magic on the stack. */
+        /* Save Multiboot2 magic on the stack for a later 32bit call */
+        shl     $32, %rax
         push    %rax
 
         /* Save EFI ImageHandle on the stack. */
@@ -363,11 +364,25 @@ __efi64_mb2_start:
         /* Just pop an item from the stack. */
         pop     %rax
 
-        /* Restore Multiboot2 magic. */
-        pop     %rax
+        /*
+         * Prepare stack for relocation call.
+         * Note that we are in 64bit mode but we are going to call a
+         * function in 32bit mode so the stack is not written with
+         * push instructions.
+         */
+        sub     $16, %rsp
+        lea     __base_relocs_end(%rip), %ecx
+        mov     %ecx, 16(%rsp)
+        lea     __base_relocs_start(%rip), %ecx
+        mov     %ecx, 12(%rsp)
+        lea     __image_base__(%rip), %esi
+        mov     %esi, 8(%rsp)
+        movabs  $__XEN_VIRT_START, %rcx
+        sub     %rsi, %rcx
+        mov     %rcx, (%rsp)
 
-        /* Jump to trampoline_setup after switching CPU to x86_32 mode. */
-        lea     trampoline_setup(%rip),%r15
+        /* Jump to trampoline_efi_setup after switching CPU to x86_32 mode. */
+        lea     trampoline_efi_setup(%rip), %r15
 
 x86_32_switch:
         mov     %r15,%rdi
@@ -539,6 +554,17 @@ __start:
         and     $~(MULTIBOOT2_TAG_ALIGN-1),%ecx
         jmp     .Lmb2_tsize
 
+trampoline_efi_setup:
+        call    reloc_pe_back
+        pop     %eax
+
+        /* Calculate the load base address again, adjusting to sym_esi needs */
+        call    1f
+1:      pop     %esi
+        sub     $sym_offs(1b), %esi
+
+        jmp     trampoline_setup
+
 trampoline_bios_setup:
         /*
          * Called on legacy BIOS platforms only.
@@ -867,8 +893,8 @@ trampoline_setup:
         lret
 
         /*
-         * cmdline and reloc are written in C, and linked to be 32bit PIC with
-         * entrypoints at 0 and using the stdcall convention.
+         * cmdline, reloc and reloc_pe_back are written in C, and linked to be
+         * 32bit PIC with entrypoints at 0 and using the stdcall convention.
          */
         ALIGN
 cmdline_parse_early:
@@ -878,6 +904,10 @@ cmdline_parse_early:
 reloc:
         .incbin "reloc.bin"
 
+        ALIGN
+reloc_pe_back:
+        .incbin "efi-reloc-image.bin"
+
         .section .init.data, "aw", @progbits
 
 ENTRY(trampoline_start)
diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h
index f282358435..4f473a287e 100644
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -36,69 +36,15 @@ extern const intpte_t __page_tables_start[], __page_tables_end[];
 #define in_page_tables(v) ((intpte_t *)(v) >= __page_tables_start && \
                            (intpte_t *)(v) < __page_tables_end)
 
-#define PE_BASE_RELOC_ABS      0
-#define PE_BASE_RELOC_HIGHLOW  3
-#define PE_BASE_RELOC_DIR64   10
+#define EFI_RELOC_IMAGE_EARLY 0
+#include "../boot/efi-reloc-image.h"
 
-extern const struct pe_base_relocs {
-    u32 rva;
-    u32 size;
-    u16 entries[];
-} __base_relocs_start[], __base_relocs_end[];
+extern pe_base_relocs __base_relocs_start[], __base_relocs_end[];
 
 static void __init efi_arch_relocate_image(unsigned long delta)
 {
-    const struct pe_base_relocs *base_relocs;
-
-    for ( base_relocs = __base_relocs_start; base_relocs < __base_relocs_end; )
-    {
-        unsigned int i = 0, n;
-
-        n = (base_relocs->size - sizeof(*base_relocs)) /
-            sizeof(*base_relocs->entries);
-
-        /*
-         * Relevant l{2,3}_bootmap entries get initialized explicitly in
-         * efi_arch_memory_setup(), so we must not apply relocations there.
-         * l2_directmap's first slot, otoh, should be handled normally, as
-         * efi_arch_memory_setup() won't touch it (xen_phys_start should
-         * never be zero).
-         */
-        if ( xen_phys_start + base_relocs->rva == (unsigned long)l3_bootmap ||
-             xen_phys_start + base_relocs->rva == (unsigned long)l2_bootmap )
-            i = n;
-
-        for ( ; i < n; ++i )
-        {
-            unsigned long addr = xen_phys_start + base_relocs->rva +
-                                 (base_relocs->entries[i] & 0xfff);
-
-            switch ( base_relocs->entries[i] >> 12 )
-            {
-            case PE_BASE_RELOC_ABS:
-                break;
-            case PE_BASE_RELOC_HIGHLOW:
-                if ( delta )
-                {
-                    *(u32 *)addr += delta;
-                    if ( in_page_tables(addr) )
-                        *(u32 *)addr += xen_phys_start;
-                }
-                break;
-            case PE_BASE_RELOC_DIR64:
-                if ( delta )
-                {
-                    *(u64 *)addr += delta;
-                    if ( in_page_tables(addr) )
-                        *(u64 *)addr += xen_phys_start;
-                }
-                break;
-            default:
-                blexit(L"Unsupported relocation type");
-            }
-        }
-        base_relocs = (const void *)(base_relocs->entries + i + (i & 1));
-    }
+    if (!reloc_pe_back(delta, xen_phys_start, __base_relocs_start, __base_relocs_end))
+        blexit(L"Unsupported relocation type");
 }
 
 extern const s32 __trampoline_rel_start[], __trampoline_rel_stop[];
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:36:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:36:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776881.1187086 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9UR-0007T7-It; Wed, 14 Aug 2024 08:36:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776881.1187086; Wed, 14 Aug 2024 08:36:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9UR-0007Sx-Ej; Wed, 14 Aug 2024 08:36:19 +0000
Received: by outflank-mailman (input) for mailman id 776881;
 Wed, 14 Aug 2024 08:36:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se9TH-0002t1-Kv
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:35:07 +0000
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [2a00:1450:4864:20::534])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1c247907-5a18-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 10:35:07 +0200 (CEST)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5a156557029so7292163a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:35:07 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f411af30sm144642066b.131.2024.08.14.01.35.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 01:35:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1c247907-5a18-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723624506; x=1724229306; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=YimU2DNm3SD/n5KZvLqPxRgRTpILHAbZb+waNB5GDPc=;
        b=CgNeta0OvPBrOlhDLB+50K8C5bN31WjtG/GGLh2BTheD+kBO0aw2w3cKw2zwW//706
         dH/yrYqeSMqmZFaXyphSH9GtEN+aqIl+C1srQK60m5EdsrKoE8THA1nmk26v8LxAPq3I
         7xJ8JoDGtv8P2o4ebNcD9qgIiMd9dCa6YgkNxX17ziXlLq9mGRN4EfLr+3oJ6CnMZ/5Q
         6iHHOWx2OGXWR7o+bR17YvyNyW788iM68gXYoy46kjNyI/kheA9lF08f9BlMNQfp8xgk
         L4Hj5tdgUZkp/kEMFrA13zzt7Cm7kQ7DR/uEHM2yM1oYeVXp+PnlAjXDyTee1odFqkQr
         b2fw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723624506; x=1724229306;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=YimU2DNm3SD/n5KZvLqPxRgRTpILHAbZb+waNB5GDPc=;
        b=ZeqY/3w+m0MbPTZcD8mYyVZ8Qp77fsTrJDv55dyB0eKc0aZAGRF0dfgezA8HNNd2Cy
         rWbnqa2j+A3DQbYvjJcFxxcTRplQWgK0O8PW4jHhlOiL4CC7l7p79Qb5DIg00tvapTHp
         +mohsjw7OAjsr+qi6Bb4AbJ0CCFzNRUCVtdPvVjfbUgW5a85JNBhjS9wl4q0+S+K863J
         uG/0oKvuOok2BHZXs6ThPRoDIk82nI1J8PYazgdC6qVMsZ1KhvDex0abMNnYKseItUIq
         UdKB7b3bTtCn2p9BWH/HXl0hujBhJWdByytVl9cdqtSIIK3gI5Bwi6baXGdDqt2Gyi5N
         DNng==
X-Gm-Message-State: AOJu0YxvcqPMSkXygyyO92MxqJqS258cQOjVf7siISbipOjIwk/BGz+j
	c5zjBwlEE0X24pqyH42dgIAEOe9dzn/+IquacItRVVbZ70kylR7wzqHqLK7r7MutblBSwtIaG3s
	=
X-Google-Smtp-Source: AGHT+IEsGlrcIkp7EAHWdqWTAEUSM/4OCYOArwJwNmmWsFV1hWybwF7FnokKqc1ffFKqyQxpYwlvEA==
X-Received: by 2002:a17:907:3f07:b0:a7a:b561:3564 with SMTP id a640c23a62f3a-a836704a180mr137822866b.61.1723624506315;
        Wed, 14 Aug 2024 01:35:06 -0700 (PDT)
Message-ID: <9653c288-abec-4185-babd-0c197fc249ee@suse.com>
Date: Wed, 14 Aug 2024 10:35:04 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v5 3/3] x86/CPUID: move bounding of max_{,sub}leaf fields to
 library code
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <2500a119-1734-44c2-9868-640bcc8ead2d@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <2500a119-1734-44c2-9868-640bcc8ead2d@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Break out this logic from calculate_host_policy() to also use it in the
x86 emulator harness, where subsequently we'll want to avoid open-coding
AMX maximum palette bounding as well as AVX10 sub-feature pruning.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v4: Mark x86_cpu_policy_bound_max_leaves() __init. Add U suffixes.
    Re-base.
v2: New.

--- a/tools/tests/x86_emulator/x86-emulate.c
+++ b/tools/tests/x86_emulator/x86-emulate.c
@@ -76,6 +76,7 @@ bool emul_test_init(void)
     unsigned long sp;
 
     x86_cpu_policy_fill_native(&cp);
+    x86_cpu_policy_bound_max_leaves(&cp);
 
     /*
      * The emulator doesn't use these instructions, so can always emulate
@@ -88,6 +89,8 @@ bool emul_test_init(void)
     cp.feat.wrmsrns = true;
     cp.extd.clzero = true;
 
+    x86_cpu_policy_shrink_max_leaves(&cp);
+
     if ( cpu_has_xsave )
     {
         unsigned int tmp, ebx;
--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -352,28 +352,19 @@ void calculate_raw_cpu_policy(void)
 static void __init calculate_host_policy(void)
 {
     struct cpu_policy *p = &host_cpu_policy;
-    unsigned int max_extd_leaf;
 
     *p = raw_cpu_policy;
 
-    p->basic.max_leaf =
-        min_t(uint32_t, p->basic.max_leaf,   ARRAY_SIZE(p->basic.raw) - 1);
-    p->feat.max_subleaf =
-        min_t(uint32_t, p->feat.max_subleaf, ARRAY_SIZE(p->feat.raw) - 1);
-
-    max_extd_leaf = p->extd.max_leaf;
-
     /*
      * For AMD/Hygon hardware before Zen3, we unilaterally modify LFENCE to be
      * dispatch serialising for Spectre mitigations.  Extend max_extd_leaf
      * beyond what hardware supports, to include the feature leaf containing
      * this information.
      */
-    if ( cpu_has_lfence_dispatch )
-        max_extd_leaf = max(max_extd_leaf, 0x80000021U);
+    if ( cpu_has_lfence_dispatch && p->extd.max_leaf < 0x80000021U )
+        p->extd.max_leaf = 0x80000021U;
 
-    p->extd.max_leaf = 0x80000000U | min_t(uint32_t, max_extd_leaf & 0xffff,
-                                           ARRAY_SIZE(p->extd.raw) - 1);
+    x86_cpu_policy_bound_max_leaves(p);
 
     x86_cpu_featureset_to_policy(boot_cpu_data.x86_capability, p);
     recalculate_xstate(p);
--- a/xen/include/xen/lib/x86/cpu-policy.h
+++ b/xen/include/xen/lib/x86/cpu-policy.h
@@ -439,6 +439,12 @@ void x86_cpu_policy_fill_native(struct c
 void x86_cpu_policy_clear_out_of_range_leaves(struct cpu_policy *p);
 
 /**
+ * Bound max leaf/subleaf values according to the capacity of the respective
+ * arrays in struct cpu_policy.
+ */
+void x86_cpu_policy_bound_max_leaves(struct cpu_policy *p);
+
+/**
  * Shrink max leaf/subleaf values such that the last respective valid entry
  * isn't all blank.  While permitted by the spec, such extraneous leaves may
  * provide undue "hints" to guests.
--- a/xen/lib/x86/cpuid.c
+++ b/xen/lib/x86/cpuid.c
@@ -291,6 +291,16 @@ void x86_cpu_policy_clear_out_of_range_l
                 ARRAY_SIZE(p->extd.raw) - 1);
 }
 
+void __init x86_cpu_policy_bound_max_leaves(struct cpu_policy *p)
+{
+    p->basic.max_leaf =
+        min_t(uint32_t, p->basic.max_leaf, ARRAY_SIZE(p->basic.raw) - 1);
+    p->feat.max_subleaf =
+        min_t(uint32_t, p->feat.max_subleaf, ARRAY_SIZE(p->feat.raw) - 1);
+    p->extd.max_leaf = 0x80000000U | min_t(uint32_t, p->extd.max_leaf & 0xffff,
+                                           ARRAY_SIZE(p->extd.raw) - 1);
+}
+
 void x86_cpu_policy_shrink_max_leaves(struct cpu_policy *p)
 {
     unsigned int i;
--- a/xen/lib/x86/private.h
+++ b/xen/lib/x86/private.h
@@ -5,6 +5,7 @@
 
 #include <xen/bitops.h>
 #include <xen/guest_access.h>
+#include <xen/init.h>
 #include <xen/kernel.h>
 #include <xen/lib.h>
 #include <xen/nospec.h>
@@ -28,6 +29,11 @@
 
 #include <xen-tools/common-macros.h>
 
+#define __init
+#define __initdata
+#define __initconst
+#define __initconstrel
+
 static inline bool test_bit(unsigned int bit, const void *vaddr)
 {
     const char *addr = vaddr;



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:50:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:50:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776910.1187096 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9ht-0003Tg-Mv; Wed, 14 Aug 2024 08:50:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776910.1187096; Wed, 14 Aug 2024 08:50:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9ht-0003TZ-JH; Wed, 14 Aug 2024 08:50:13 +0000
Received: by outflank-mailman (input) for mailman id 776910;
 Wed, 14 Aug 2024 08:50:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se9hs-0003TT-FJ
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:50:12 +0000
Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com
 [2a00:1450:4864:20::52f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 372fd2d1-5a1a-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 10:50:11 +0200 (CEST)
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5a156556fb4so7496911a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:50:11 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd187f4fe2sm3647534a12.9.2024.08.14.01.50.10
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 01:50:10 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 372fd2d1-5a1a-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723625411; x=1724230211; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=7hLxkBxMMzkiBCwdwoQ+smbiR9BM8Nnccc5v7YtMhc4=;
        b=N/Ge2nZD7er923msD75jemeRT81juTWazVP2X3twrJirp/wwV0t4tLnUg1pqUgpFzF
         R4shkiKTX9QhNc3XXXBo7Qps3Civpm/e4zIoN9R/PbLVQjygvpKy7/Tt/W0EjVh+IL9j
         e3wgG6YhpP+lNken2Vq7+lp+Mra5nKroOUcWvZhrs7dfqXk06wzC5VJVs1a6d9nmtRnp
         FH7dnYT+2Uc5sMEzBjO/B5+Eht+JkjECxdivmbKG06WI1Vcg1K7y3j3il+yX3F8TNTFe
         plHLgg0/3NZUDp8zD/19258RTLO12/AlcVHo3QV17SMBJhSpCf5ZT473yZGt4FKKluZO
         pp1g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723625411; x=1724230211;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=7hLxkBxMMzkiBCwdwoQ+smbiR9BM8Nnccc5v7YtMhc4=;
        b=S+WvQpcueiL21nwyWp1sDZHY+uWFH5zVzw8IRq+IzahmBKwTxgHgWywdivF7eBX1td
         Oy/vxqV+T7My6dpj8XLgLTYDB/lk0g16BVncr3XDdlDo5V8nRTbC+Sk5q9ZCHWNFV1Qx
         o/ZTLAEQQiSeGKX5Bz077fX8iSU0BSncwssP421ZFLwhdWy3fWZt0NI/I0GHUtwIfqPn
         MadcUU4wG+OepjV+PgtUdOjc8BBoAzpDTT4FFDhQsF0kAFW/Nfy/2apIAOIgkCPnMMTi
         hJrm3rx508md98Q9j718KlT5FholpJ0fYTO1jfoD5lkXRmAXFjkeZAGC9usZBLtMa+wW
         pZlQ==
X-Gm-Message-State: AOJu0YwJNME0WS36c+4FaSeKhiCNlz4d2/aa8s+lTcXK6mrILY6Jx7KB
	hO8MNh7a4J9NHLtVY48XbzolD3un2oxJYXgxpOyNGTt3/AOMYNAN7rVbWsxfbie5RWSI4xjVNK8
	=
X-Google-Smtp-Source: AGHT+IGFYN7ca9CPjRnjpz5/qBpgucjG/0mTwoA++Uor+985PHG6j1Whe85l42qWpq8iCtJz/MfGNA==
X-Received: by 2002:a05:6402:5205:b0:5be:9bc5:f6b3 with SMTP id 4fb4d7f45d1cf-5bea1c6a749mr1270245a12.2.1723625410733;
        Wed, 14 Aug 2024 01:50:10 -0700 (PDT)
Message-ID: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Date: Wed, 14 Aug 2024 10:50:09 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2 0/9] x86: support AVX10
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

AVX10.1 is just a re-branding of certain AVX512 (sub)features, i.e.
adds no new instructions. Therefore it's mostly relaxation that needs
doing, plus dealing with the 256-bit-only case that AVX512 itself
does not allow for. Luckily an unnecessary restriction on the mask
register insns was taken out again, simplifying the actual emulator
adjustments quite a bit.

AVX10.2 is going to require quite a bit more work; the new patch in
v2 is merely the relatively simple start thereof.

While it probably can be rebased ahead, the series in this form
depends on the previously submitted "[PATCH v5 0/3] x86/CPUID: leaf
pruning".

I've tried to be very careful in rebasing ahead of other emulator
patches I've been carrying, but almost all testing I've done is with
all of those collectively in place.

1: x86/CPUID: enable AVX10 leaf
2: x86emul/test: rename "cp"
3: x86emul: introduce a struct cpu_policy * local in x86_emulate()
4: x86emul: support AVX10.1
5: x86emul/test: use simd_check_avx512*() in main()
6: x86emul/test: drop cpu_has_avx512vl
7: x86emul: AVX10.1 testing
8: x86emul/test: engage AVX512VL via command line option
9: x86emul: support AVX10.2 256-bit embedded rounding / SAE

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:51:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:51:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776916.1187106 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9j4-0003yh-WC; Wed, 14 Aug 2024 08:51:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776916.1187106; Wed, 14 Aug 2024 08:51:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9j4-0003ya-T2; Wed, 14 Aug 2024 08:51:26 +0000
Received: by outflank-mailman (input) for mailman id 776916;
 Wed, 14 Aug 2024 08:51:24 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se9j2-0003yE-Op
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:51:24 +0000
Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com
 [2a00:1450:4864:20::635])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 61b2a581-5a1a-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 10:51:22 +0200 (CEST)
Received: by mail-ej1-x635.google.com with SMTP id
 a640c23a62f3a-a7a843bef98so182210366b.2
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:51:22 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f414e18csm148065366b.177.2024.08.14.01.51.21
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 01:51:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 61b2a581-5a1a-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723625482; x=1724230282; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=7NIzDq8nKrmgupkcpKHhiCNLWhQt61fPrxdoZjP5mbI=;
        b=hGjtcdz+ZME3jQx0LtWNOhZb/DeFqSAriHOw9xDzpY29ve2ZRwX65kVTsh6URLECKS
         nw+NqcrjIbO13uPvhwtXckdgLFWoEAwQcjPXyZhot2f3fbHisRBPNXPnAIvEwhWngONK
         DFFE6CttElWq4PWzDOKDgAZDF+Y6mAuo4WNjsep3+UBJNaQX4gAo4a/mtlSled+oj86N
         aqvqSlbtNWv/g+4ah7YzqZnaqD6HvmjrVT4GVZ/VVpszW3DZC2jKJtwxhJ7ZfZ7fgZhh
         HgkCkgoOgMilp9KlO+yoReTzGI1hMbnEYBuYBY4zZ+a2nUx4ApXIzj69u9TNvm4MrsDa
         nS2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723625482; x=1724230282;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=7NIzDq8nKrmgupkcpKHhiCNLWhQt61fPrxdoZjP5mbI=;
        b=nk/ZV6YrYOWcGBq91rR/CHU5QPGv6eUcYS+UUws0pDWrJdumX8+IuQrJHCs7E92oLe
         BkrFU0qdLx43m7Y4In/05XYKW7CZkc7T+KMj8+uCoWWfAQaGWqrAhcCbr51ns9/fIVNR
         BJgJ/bhbOH4VDGb9koOeIrR+Rpr/wkFY5MEATvvksjjPYTNL5cyx6XH9r/lA2eHVmKVh
         7BorUEbV14kVTd9GNlX22bBwPuPPXa48gFqbLW4hk59XQPuRQwI7nqMRB9oUJf/ROgXZ
         1Pc/vYJu/WFGftC8SPoCmoRiHbfDHQ7pdYMVdyPQC4d0R1qWUww6F/w7zg6EpTxZB6fY
         +nGQ==
X-Gm-Message-State: AOJu0YxjAIkqiZpj2f+/SK3rwVa0YLxt5TYxtcbQZ0Q7Gdl+Kyw8Wo8Q
	bti1YvBqv2TyDA9CJskdyyTsDBs9k94JVfdS75lh3pWUvIvILvWIxHfHfiEuXUra8FgvNgLuP80
	=
X-Google-Smtp-Source: AGHT+IEyNycA81jEG7Xdtj8sKMuH1EZpK8J8nnKiiyCc/6KwL+CW5qeZuVsBs9CSb8EVTYowZcEbfQ==
X-Received: by 2002:a17:907:e88:b0:a79:7ec8:f3f3 with SMTP id a640c23a62f3a-a83670c01c0mr104292466b.58.1723625481977;
        Wed, 14 Aug 2024 01:51:21 -0700 (PDT)
Message-ID: <27866cd1-495f-4b86-986d-31003dad9c23@suse.com>
Date: Wed, 14 Aug 2024 10:51:20 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 1/9] x86/CPUID: enable AVX10 leaf
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

This requires bumping the number of basic leaves we support. Apart from
this the logic is modeled as closely as possible after that of leaf 7
handling.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
The gen-cpuid.py adjustment is merely the minimum needed. It's not
really clear to me whether someone turning off e.g. AVX512BW might then
also validly expect AVX10 to be turned off.

Spec version 2 leaves unclear what the xstate components are which would
need enabling for AVX10/256. recalculate_{xstate,misc}() are therefore
conservative for now.

Do we want to synthesize AVX10 in the policy when all necessary AVX512*
features are available, thus allowing migration from an AVX10 host to a
suitable non-AVX10 one?

How a toolstack side equivalent (if any) of the init_dom0_cpuid_policy()
change would look like is entirely unclear to me. How much should we
take from the max policy, and how much should we require the user to
specify (and how would the latter look like)?
---
v2: Add logic to init_dom0_cpuid_policy(). Drop vsz128 field. Re-base.

--- a/xen/arch/x86/cpu-policy.c
+++ b/xen/arch/x86/cpu-policy.c
@@ -210,7 +210,7 @@ static void recalculate_xstate(struct cp
     if ( p->feat.mpx )
         xstates |= X86_XCR0_BNDREGS | X86_XCR0_BNDCSR;
 
-    if ( p->feat.avx512f )
+    if ( p->feat.avx512f || (p->feat.avx10 && p->avx10.vsz512) )
         xstates |= X86_XCR0_OPMASK | X86_XCR0_ZMM | X86_XCR0_HI_ZMM;
 
     if ( p->feat.pku )
@@ -268,6 +268,16 @@ static void recalculate_misc(struct cpu_
 
     p->basic.raw[0xc] = EMPTY_LEAF;
 
+    zero_leaves(p->basic.raw, 0xe, 0x23);
+
+    p->avx10.raw[0].b &= 0x000700ff;
+    p->avx10.raw[0].c = p->avx10.raw[0].d = 0;
+    if ( !p->feat.avx10 || !p->avx10.version || !p->avx10.vsz512 )
+    {
+        p->feat.avx10 = false;
+        memset(p->avx10.raw, 0, sizeof(p->avx10.raw));
+    }
+
     p->extd.e1d &= ~CPUID_COMMON_1D_FEATURES;
 
     /* Most of Power/RAS hidden from guests. */
@@ -885,6 +895,7 @@ void recalculate_cpuid_policy(struct dom
 
     p->basic.max_leaf   = min(p->basic.max_leaf,   max->basic.max_leaf);
     p->feat.max_subleaf = min(p->feat.max_subleaf, max->feat.max_subleaf);
+    p->avx10.max_subleaf = min(p->avx10.max_subleaf, max->avx10.max_subleaf);
     p->extd.max_leaf    = 0x80000000U | min(p->extd.max_leaf & 0xffff,
                                             ((p->x86_vendor & (X86_VENDOR_AMD |
                                                                X86_VENDOR_HYGON))
@@ -931,6 +942,8 @@ void recalculate_cpuid_policy(struct dom
 
     if ( p->basic.max_leaf < XSTATE_CPUID )
         __clear_bit(X86_FEATURE_XSAVE, fs);
+    if ( p->basic.max_leaf < 0x24 )
+        __clear_bit(X86_FEATURE_AVX10, fs);
 
     sanitise_featureset(fs);
 
@@ -1000,9 +1013,18 @@ void __init init_dom0_cpuid_policy(struc
     /* Apply dom0-cpuid= command line settings, if provided. */
     if ( dom0_cpuid_cmdline )
     {
+        const struct cpu_policy *max = is_pv_domain(d)
+            ? (IS_ENABLED(CONFIG_PV)  ?  &pv_max_cpu_policy : NULL)
+            : (IS_ENABLED(CONFIG_HVM) ? &hvm_max_cpu_policy : NULL);
         uint32_t fs[FSCAPINTS];
         unsigned int i;
 
+        if ( !max )
+        {
+            ASSERT_UNREACHABLE();
+            return;
+        }
+
         x86_cpu_policy_to_featureset(p, fs);
 
         for ( i = 0; i < ARRAY_SIZE(fs); ++i )
@@ -1012,6 +1034,13 @@ void __init init_dom0_cpuid_policy(struc
         }
 
         x86_cpu_featureset_to_policy(fs, p);
+
+        /*
+         * Default-off features with their own leaves need those leaves
+         * re-populated from the max policy.
+         */
+        if ( p->feat.avx10 )
+            p->avx10 = max->avx10;
     }
 
     /*
@@ -1044,6 +1073,8 @@ static void __init __maybe_unused build_
                  sizeof(raw_cpu_policy.feat.raw));
     BUILD_BUG_ON(sizeof(raw_cpu_policy.xstate) !=
                  sizeof(raw_cpu_policy.xstate.raw));
+    BUILD_BUG_ON(sizeof(raw_cpu_policy.avx10) !=
+                 sizeof(raw_cpu_policy.avx10.raw));
     BUILD_BUG_ON(sizeof(raw_cpu_policy.extd) !=
                  sizeof(raw_cpu_policy.extd.raw));
 }
--- a/xen/arch/x86/cpuid.c
+++ b/xen/arch/x86/cpuid.c
@@ -87,6 +87,15 @@ void guest_cpuid(const struct vcpu *v, u
             *res = array_access_nospec(p->xstate.raw, subleaf);
             break;
 
+        case 0x24:
+            ASSERT(p->avx10.max_subleaf < ARRAY_SIZE(p->avx10.raw));
+            if ( subleaf > min_t(uint32_t, p->avx10.max_subleaf,
+                                 ARRAY_SIZE(p->avx10.raw) - 1) )
+                return;
+
+            *res = array_access_nospec(p->avx10.raw, subleaf);
+            break;
+
         default:
             *res = array_access_nospec(p->basic.raw, leaf);
             break;
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -334,6 +334,7 @@ XEN_CPUFEATURE(AVX_NE_CONVERT,     15*32
 XEN_CPUFEATURE(AVX_VNNI_INT16,     15*32+10) /*A  AVX-VNNI-INT16 Instructions */
 XEN_CPUFEATURE(PREFETCHI,          15*32+14) /*A  PREFETCHIT{0,1} Instructions */
 XEN_CPUFEATURE(CET_SSS,            15*32+18) /*   CET Supervisor Shadow Stacks safe to use */
+XEN_CPUFEATURE(AVX10,              15*32+19) /*   AVX10 Converged Vector ISA */
 
 /* Intel-defined CPU features, MSR_ARCH_CAPS 0x10a.eax, word 16 */
 XEN_CPUFEATURE(RDCL_NO,            16*32+ 0) /*A  No Rogue Data Cache Load (Meltdown) */
--- a/xen/include/xen/lib/x86/cpu-policy.h
+++ b/xen/include/xen/lib/x86/cpu-policy.h
@@ -85,11 +85,12 @@ unsigned int x86_cpuid_lookup_vendor(uin
  */
 const char *x86_cpuid_vendor_to_str(unsigned int vendor);
 
-#define CPUID_GUEST_NR_BASIC      (0xdu + 1)
+#define CPUID_GUEST_NR_BASIC      (0x24u + 1)
 #define CPUID_GUEST_NR_CACHE      (5u + 1)
 #define CPUID_GUEST_NR_FEAT       (2u + 1)
 #define CPUID_GUEST_NR_TOPO       (1u + 1)
 #define CPUID_GUEST_NR_XSTATE     (62u + 1)
+#define CPUID_GUEST_NR_AVX10      (0u + 1)
 #define CPUID_GUEST_NR_EXTD_INTEL (0x8u + 1)
 #define CPUID_GUEST_NR_EXTD_AMD   (0x21u + 1)
 #define CPUID_GUEST_NR_EXTD       MAX(CPUID_GUEST_NR_EXTD_INTEL, \
@@ -255,6 +256,19 @@ struct cpu_policy
         } comp[CPUID_GUEST_NR_XSTATE];
     } xstate;
 
+    /* Structured AVX10 information leaf: 0x000000024[xx] */
+    union {
+        struct cpuid_leaf raw[CPUID_GUEST_NR_AVX10];
+        struct {
+            /* Subleaf 0. */
+            uint32_t max_subleaf;
+            uint32_t version:8, :9;
+            bool vsz256:1, vsz512:1;
+            uint32_t :13;
+            uint32_t /* c */:32, /* d */:32;
+        };
+    } avx10;
+
     /* Extended leaves: 0x800000xx */
     union {
         struct cpuid_leaf raw[CPUID_GUEST_NR_EXTD];
--- a/xen/lib/x86/cpuid.c
+++ b/xen/lib/x86/cpuid.c
@@ -123,6 +123,7 @@ void x86_cpu_policy_fill_native(struct c
         switch ( i )
         {
         case 0x4: case 0x7: case 0xb: case 0xd:
+        case 0x24:
             /* Multi-invocation leaves.  Deferred. */
             continue;
         }
@@ -216,6 +217,15 @@ void x86_cpu_policy_fill_native(struct c
         }
     }
 
+    if ( p->basic.max_leaf >= 0x24 )
+    {
+        cpuid_count_leaf(0x24, 0, &p->avx10.raw[0]);
+
+        for ( i = 1; i <= MIN(p->avx10.max_subleaf,
+                              ARRAY_SIZE(p->avx10.raw) - 1); ++i )
+            cpuid_count_leaf(0x24, i, &p->avx10.raw[i]);
+    }
+
     /* Extended leaves. */
     cpuid_leaf(0x80000000U, &p->extd.raw[0]);
     for ( i = 1; i <= MIN(p->extd.max_leaf & 0xffffU,
@@ -285,6 +295,9 @@ void x86_cpu_policy_clear_out_of_range_l
                     ARRAY_SIZE(p->xstate.raw) - 1);
     }
 
+    if ( p->basic.max_leaf < 0x24 )
+        memset(p->avx10.raw, 0, sizeof(p->avx10.raw));
+
     zero_leaves(p->extd.raw,
                 ((p->extd.max_leaf >> 16) == 0x8000
                  ? (p->extd.max_leaf & 0xffff) + 1 : 0),
@@ -297,6 +310,8 @@ void __init x86_cpu_policy_bound_max_lea
         min_t(uint32_t, p->basic.max_leaf, ARRAY_SIZE(p->basic.raw) - 1);
     p->feat.max_subleaf =
         min_t(uint32_t, p->feat.max_subleaf, ARRAY_SIZE(p->feat.raw) - 1);
+    p->avx10.max_subleaf =
+        min_t(uint32_t, p->avx10.max_subleaf, ARRAY_SIZE(p->avx10.raw) - 1);
     p->extd.max_leaf = 0x80000000U | min_t(uint32_t, p->extd.max_leaf & 0xffff,
                                            ARRAY_SIZE(p->extd.raw) - 1);
 }
@@ -324,6 +339,8 @@ void x86_cpu_policy_shrink_max_leaves(st
      */
     p->basic.raw[0xd] = p->xstate.raw[0];
 
+    p->basic.raw[0x24] = p->avx10.raw[0];
+
     for ( i = p->basic.max_leaf; i; --i )
         if ( p->basic.raw[i].a | p->basic.raw[i].b |
              p->basic.raw[i].c | p->basic.raw[i].d )
@@ -457,6 +474,13 @@ int x86_cpuid_copy_to_buffer(const struc
             break;
         }
 
+        case 0x24:
+            for ( subleaf = 0;
+                  subleaf <= MIN(p->avx10.max_subleaf,
+                                 ARRAY_SIZE(p->avx10.raw) - 1); ++subleaf )
+                COPY_LEAF(leaf, subleaf, &p->avx10.raw[subleaf]);
+            break;
+
         default:
             COPY_LEAF(leaf, XEN_CPUID_NO_SUBLEAF, &p->basic.raw[leaf]);
             break;
@@ -549,6 +573,13 @@ int x86_cpuid_copy_from_buffer(struct cp
                 array_access_nospec(p->xstate.raw, data.subleaf) = l;
                 break;
 
+            case 0x24:
+                if ( data.subleaf >= ARRAY_SIZE(p->avx10.raw) )
+                    goto out_of_range;
+
+                array_access_nospec(p->avx10.raw, data.subleaf) = l;
+                break;
+
             default:
                 if ( data.subleaf != XEN_CPUID_NO_SUBLEAF )
                     goto out_of_range;
--- a/xen/lib/x86/policy.c
+++ b/xen/lib/x86/policy.c
@@ -21,6 +21,12 @@ int x86_cpu_policies_are_compatible(cons
     if ( guest->feat.max_subleaf > host->feat.max_subleaf )
         FAIL_CPUID(7, 0);
 
+    if ( guest->avx10.version > host->avx10.version ||
+         (guest->avx10.vsz512
+          ? !host->avx10.vsz512
+          : guest->avx10.vsz256 && !host->avx10.vsz256 && !host->avx10.vsz512) )
+        FAIL_CPUID(0x24, 0);
+
     if ( guest->extd.max_leaf > host->extd.max_leaf )
         FAIL_CPUID(0x80000000U, NA);
 
--- a/xen/tools/gen-cpuid.py
+++ b/xen/tools/gen-cpuid.py
@@ -285,7 +285,7 @@ def crunch_numbers(state):
         # enabled.  Certain later extensions, acting on 256-bit vectors of
         # integers, better depend on AVX2 than AVX.
         AVX2: [AVX512F, VAES, VPCLMULQDQ, AVX_VNNI, AVX_IFMA, AVX_VNNI_INT8,
-               AVX_VNNI_INT16, SHA512, SM4],
+               AVX_VNNI_INT16, SHA512, SM4, AVX10],
 
         # AVX512F is taken to mean hardware support for 512bit registers
         # (which in practice depends on the EVEX prefix to encode) as well



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:51:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:51:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776923.1187116 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9jW-0004Vu-BS; Wed, 14 Aug 2024 08:51:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776923.1187116; Wed, 14 Aug 2024 08:51:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9jW-0004Vn-7U; Wed, 14 Aug 2024 08:51:54 +0000
Received: by outflank-mailman (input) for mailman id 776923;
 Wed, 14 Aug 2024 08:51:53 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se9jU-0003yE-Vm
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:51:53 +0000
Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com
 [2a00:1450:4864:20::22e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 72bd90d2-5a1a-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 10:51:51 +0200 (CEST)
Received: by mail-lj1-x22e.google.com with SMTP id
 38308e7fff4ca-2ef2cce8be8so70276551fa.1
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:51:51 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd1a5dfdbbsm3627397a12.69.2024.08.14.01.51.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 01:51:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 72bd90d2-5a1a-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723625511; x=1724230311; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=dG2vMvLcW/CKv3B8uTWG6y9mz8h5Sex7Ma69J4j6IRs=;
        b=fPsF4k5PqZFFoeZSoT0urYHtRKEJSvg+8wTm19+ZecYnsOvwicPpEvGrNNQcn6CD5Y
         KDBh7oViXp27nc0PjXVgB5K42FasYqMaBZzGaSgxN0pK0nYSM9G+vf595bOzVuKFhSjJ
         CCl5+wPPOgl97mOvfFfbgdhDi+suZ1clQBPL7gz2pxN+H+FFhvPHSpyVgZmfT+UzfYGf
         B5x9ktKa1ESN3X0macMB//mfnJoSlse+Z+PQyJBK+oDy7x8PaiYHem+yuIE7DZYIX+9W
         iNMHJWKQ3bs33FIfY2cwk9AePOw6lk/ua1wTYfeMrl2gL/uBBrux3OHkbHva3MjNTGv9
         1odg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723625511; x=1724230311;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=dG2vMvLcW/CKv3B8uTWG6y9mz8h5Sex7Ma69J4j6IRs=;
        b=dhZQgOyDx8fdJiu/hgaVTCoGT1CI6XzhvZP8g6O9UDa4S7utDuHwU72UoIFeqbkPcb
         J17sySq0+NERkZrCACHDmQVabym+OpbEVAhRwYbAzpUUW1xE9W4S7vf/RZTcTiCKaF9m
         44eAvHzqjNkuHWUKut2Mbdi4hn0yykt35j6AvJVXkGhSO4hYQbtgbZ+/EUlK+ultWd6W
         gl3hmiQG68xIeTrfdPa9UpqMT3C7Y5Ubdw9Ruagmo2FRe4gaTbtgduQa0yEud4VN21lM
         FOvWMss4u0a1gqa8Ik1nA4BDewiTYr48n/IDtyUfs5L1lBuymlZVoZi9H+fJ5UL4m+FU
         a+ZA==
X-Gm-Message-State: AOJu0YwVjd+eVVnfffdlawtaqVRBo+1s4WyfQ+vV34ZbKRD3rBC7XYlS
	GtfbqR4R1lLf1PgZJ3XJeP/XIYW7mJdEKJIHmrekHHvjvMqOGM/B7ipdoooJoFmjJzWKiIdZJGA
	=
X-Google-Smtp-Source: AGHT+IH1ClCcbXutHY4znaus4vLnl67NAk0QPYuj/ezD5b1l8gJbxbjCLOZj9uGbIeLgXvdq0LIx/Q==
X-Received: by 2002:a2e:8185:0:b0:2f3:a06a:4c5 with SMTP id 38308e7fff4ca-2f3aa1c945fmr12984971fa.29.1723625510404;
        Wed, 14 Aug 2024 01:51:50 -0700 (PDT)
Message-ID: <fb9e2081-16d5-4dc4-92f5-fb55f313304b@suse.com>
Date: Wed, 14 Aug 2024 10:51:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 2/9] x86emul/test: rename "cp"
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

In preparation of introducing a const struct cpu_policy * local in
x86_emulate(), rename that global variable to something more suitable:
"cp" is our commonly used name for function parameters or local
variables of type struct cpu_policy *, and the present name of the
global could hence have interfered already.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Re-base over dropping of Xeon Phi support.

--- a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
+++ b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c
@@ -899,7 +899,7 @@ int LLVMFuzzerTestOneInput(const uint8_t
     int rc;
 
     /* Not part of the initializer, for old gcc to cope. */
-    ctxt.cpu_policy = &cp;
+    ctxt.cpu_policy = &cpu_policy;
 
     /* Reset all global state variables */
     memset(&input, 0, sizeof(input));
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -779,7 +779,8 @@ static void zap_fpsel(unsigned int *env,
         env[3] &= ~0xffff;
     }
 
-    if ( cp.x86_vendor != X86_VENDOR_AMD && cp.x86_vendor != X86_VENDOR_HYGON )
+    if ( cpu_policy.x86_vendor != X86_VENDOR_AMD &&
+         cpu_policy.x86_vendor != X86_VENDOR_HYGON )
         return;
 
     if ( is_32bit )
@@ -913,7 +914,7 @@ int main(int argc, char **argv)
 
     ctxt.regs = &regs;
     ctxt.force_writeback = 0;
-    ctxt.cpu_policy = &cp;
+    ctxt.cpu_policy = &cpu_policy;
     ctxt.lma       = sizeof(void *) == 8;
     ctxt.addr_size = 8 * sizeof(void *);
     ctxt.sp_size   = 8 * sizeof(void *);
@@ -1487,11 +1488,11 @@ int main(int argc, char **argv)
         goto fail;
     printf("okay\n");
 
-    vendor_native = cp.x86_vendor;
-    for ( cp.x86_vendor = X86_VENDOR_AMD; ; )
+    vendor_native = cpu_policy.x86_vendor;
+    for ( cpu_policy.x86_vendor = X86_VENDOR_AMD; ; )
     {
-        unsigned int v = cp.x86_vendor == X86_VENDOR_INTEL;
-        const char *vendor = cp.x86_vendor == X86_VENDOR_INTEL ? "Intel" : "AMD";
+        unsigned int v = cpu_policy.x86_vendor == X86_VENDOR_INTEL;
+        const char *vendor = cpu_policy.x86_vendor == X86_VENDOR_INTEL ? "Intel" : "AMD";
         uint64_t *stk = (void *)res + MMAP_SZ - 16;
 
         regs.rcx = 2;
@@ -1527,11 +1528,11 @@ int main(int argc, char **argv)
             printf("okay\n");
         }
 
-        if ( cp.x86_vendor == X86_VENDOR_INTEL )
+        if ( cpu_policy.x86_vendor == X86_VENDOR_INTEL )
             break;
-        cp.x86_vendor = X86_VENDOR_INTEL;
+        cpu_policy.x86_vendor = X86_VENDOR_INTEL;
     }
-    cp.x86_vendor = vendor_native;
+    cpu_policy.x86_vendor = vendor_native;
 #endif /* x86-64 */
 
     printf("%-40s", "Testing shld $1,%ecx,(%edx)...");
--- a/tools/tests/x86_emulator/x86-emulate.c
+++ b/tools/tests/x86_emulator/x86-emulate.c
@@ -25,7 +25,7 @@
 #endif
 
 uint32_t mxcsr_mask = 0x0000ffbf;
-struct cpu_policy cp;
+struct cpu_policy cpu_policy;
 
 static char fpu_save_area[0x4000] __attribute__((__aligned__((64))));
 static bool use_xsave;
@@ -75,21 +75,21 @@ bool emul_test_init(void)
 
     unsigned long sp;
 
-    x86_cpu_policy_fill_native(&cp);
-    x86_cpu_policy_bound_max_leaves(&cp);
+    x86_cpu_policy_fill_native(&cpu_policy);
+    x86_cpu_policy_bound_max_leaves(&cpu_policy);
 
     /*
      * The emulator doesn't use these instructions, so can always emulate
      * them.
      */
-    cp.basic.movbe = true;
-    cp.feat.invpcid = true;
-    cp.feat.adx = true;
-    cp.feat.rdpid = true;
-    cp.feat.wrmsrns = true;
-    cp.extd.clzero = true;
+    cpu_policy.basic.movbe = true;
+    cpu_policy.feat.invpcid = true;
+    cpu_policy.feat.adx = true;
+    cpu_policy.feat.rdpid = true;
+    cpu_policy.feat.wrmsrns = true;
+    cpu_policy.extd.clzero = true;
 
-    x86_cpu_policy_shrink_max_leaves(&cp);
+    x86_cpu_policy_shrink_max_leaves(&cpu_policy);
 
     if ( cpu_has_xsave )
     {
--- a/tools/tests/x86_emulator/x86-emulate.h
+++ b/tools/tests/x86_emulator/x86-emulate.h
@@ -69,7 +69,7 @@
 #define is_canonical_address(x) (((int64_t)(x) >> 47) == ((int64_t)(x) >> 63))
 
 extern uint32_t mxcsr_mask;
-extern struct cpu_policy cp;
+extern struct cpu_policy cpu_policy;
 
 #define MMAP_SZ 16384
 bool emul_test_init(void);
@@ -123,7 +123,7 @@ static inline uint64_t xgetbv(uint32_t x
 }
 
 /* Intentionally checking OSXSAVE here. */
-#define cpu_has_xsave     (cp.basic.raw[1].c & (1u << 27))
+#define cpu_has_xsave     (cpu_policy.basic.raw[1].c & (1u << 27))
 
 static inline bool xcr0_mask(uint64_t mask)
 {
@@ -133,63 +133,63 @@ static inline bool xcr0_mask(uint64_t ma
 unsigned int rdpkru(void);
 void wrpkru(unsigned int val);
 
-#define cache_line_size() (cp.basic.clflush_size * 8)
-#define cpu_has_fpu        cp.basic.fpu
-#define cpu_has_mmx        cp.basic.mmx
-#define cpu_has_fxsr       cp.basic.fxsr
-#define cpu_has_sse        cp.basic.sse
-#define cpu_has_sse2       cp.basic.sse2
-#define cpu_has_sse3       cp.basic.sse3
-#define cpu_has_pclmulqdq  cp.basic.pclmulqdq
-#define cpu_has_ssse3      cp.basic.ssse3
-#define cpu_has_fma       (cp.basic.fma && xcr0_mask(6))
-#define cpu_has_sse4_1     cp.basic.sse4_1
-#define cpu_has_sse4_2     cp.basic.sse4_2
-#define cpu_has_popcnt     cp.basic.popcnt
-#define cpu_has_aesni      cp.basic.aesni
-#define cpu_has_avx       (cp.basic.avx  && xcr0_mask(6))
-#define cpu_has_f16c      (cp.basic.f16c && xcr0_mask(6))
-
-#define cpu_has_avx2      (cp.feat.avx2 && xcr0_mask(6))
-#define cpu_has_bmi1       cp.feat.bmi1
-#define cpu_has_bmi2       cp.feat.bmi2
-#define cpu_has_avx512f   (cp.feat.avx512f  && xcr0_mask(0xe6))
-#define cpu_has_avx512dq  (cp.feat.avx512dq && xcr0_mask(0xe6))
-#define cpu_has_avx512_ifma (cp.feat.avx512_ifma && xcr0_mask(0xe6))
-#define cpu_has_avx512cd  (cp.feat.avx512cd && xcr0_mask(0xe6))
-#define cpu_has_sha        cp.feat.sha
-#define cpu_has_avx512bw  (cp.feat.avx512bw && xcr0_mask(0xe6))
-#define cpu_has_avx512vl  (cp.feat.avx512vl && xcr0_mask(0xe6))
-#define cpu_has_avx512_vbmi (cp.feat.avx512_vbmi && xcr0_mask(0xe6))
-#define cpu_has_avx512_vbmi2 (cp.feat.avx512_vbmi2 && xcr0_mask(0xe6))
-#define cpu_has_gfni       cp.feat.gfni
-#define cpu_has_vaes      (cp.feat.vaes && xcr0_mask(6))
-#define cpu_has_vpclmulqdq (cp.feat.vpclmulqdq && xcr0_mask(6))
-#define cpu_has_avx512_vnni (cp.feat.avx512_vnni && xcr0_mask(0xe6))
-#define cpu_has_avx512_bitalg (cp.feat.avx512_bitalg && xcr0_mask(0xe6))
-#define cpu_has_avx512_vpopcntdq (cp.feat.avx512_vpopcntdq && xcr0_mask(0xe6))
-#define cpu_has_movdiri    cp.feat.movdiri
-#define cpu_has_movdir64b  cp.feat.movdir64b
-#define cpu_has_avx512_vp2intersect (cp.feat.avx512_vp2intersect && xcr0_mask(0xe6))
-#define cpu_has_serialize  cp.feat.serialize
-#define cpu_has_avx512_fp16 (cp.feat.avx512_fp16 && xcr0_mask(0xe6))
-#define cpu_has_sha512     (cp.feat.sha512 && xcr0_mask(6))
-#define cpu_has_sm3        (cp.feat.sm3 && xcr0_mask(6))
-#define cpu_has_sm4        (cp.feat.sm4 && xcr0_mask(6))
-#define cpu_has_avx_vnni   (cp.feat.avx_vnni && xcr0_mask(6))
-#define cpu_has_avx512_bf16 (cp.feat.avx512_bf16 && xcr0_mask(0xe6))
-#define cpu_has_avx_ifma   (cp.feat.avx_ifma && xcr0_mask(6))
-#define cpu_has_avx_vnni_int8 (cp.feat.avx_vnni_int8 && xcr0_mask(6))
-#define cpu_has_avx_ne_convert (cp.feat.avx_ne_convert && xcr0_mask(6))
-#define cpu_has_avx_vnni_int16 (cp.feat.avx_vnni_int16 && xcr0_mask(6))
-
-#define cpu_has_xgetbv1   (cpu_has_xsave && cp.xstate.xgetbv1)
-
-#define cpu_has_3dnow_ext  cp.extd._3dnowext
-#define cpu_has_sse4a      cp.extd.sse4a
-#define cpu_has_xop       (cp.extd.xop  && xcr0_mask(6))
-#define cpu_has_fma4      (cp.extd.fma4 && xcr0_mask(6))
-#define cpu_has_tbm        cp.extd.tbm
+#define cache_line_size() (cpu_policy.basic.clflush_size * 8)
+#define cpu_has_fpu        cpu_policy.basic.fpu
+#define cpu_has_mmx        cpu_policy.basic.mmx
+#define cpu_has_fxsr       cpu_policy.basic.fxsr
+#define cpu_has_sse        cpu_policy.basic.sse
+#define cpu_has_sse2       cpu_policy.basic.sse2
+#define cpu_has_sse3       cpu_policy.basic.sse3
+#define cpu_has_pclmulqdq  cpu_policy.basic.pclmulqdq
+#define cpu_has_ssse3      cpu_policy.basic.ssse3
+#define cpu_has_fma       (cpu_policy.basic.fma && xcr0_mask(6))
+#define cpu_has_sse4_1     cpu_policy.basic.sse4_1
+#define cpu_has_sse4_2     cpu_policy.basic.sse4_2
+#define cpu_has_popcnt     cpu_policy.basic.popcnt
+#define cpu_has_aesni      cpu_policy.basic.aesni
+#define cpu_has_avx       (cpu_policy.basic.avx  && xcr0_mask(6))
+#define cpu_has_f16c      (cpu_policy.basic.f16c && xcr0_mask(6))
+
+#define cpu_has_avx2      (cpu_policy.feat.avx2 && xcr0_mask(6))
+#define cpu_has_bmi1       cpu_policy.feat.bmi1
+#define cpu_has_bmi2       cpu_policy.feat.bmi2
+#define cpu_has_avx512f   (cpu_policy.feat.avx512f  && xcr0_mask(0xe6))
+#define cpu_has_avx512dq  (cpu_policy.feat.avx512dq && xcr0_mask(0xe6))
+#define cpu_has_avx512_ifma (cpu_policy.feat.avx512_ifma && xcr0_mask(0xe6))
+#define cpu_has_avx512cd  (cpu_policy.feat.avx512cd && xcr0_mask(0xe6))
+#define cpu_has_sha        cpu_policy.feat.sha
+#define cpu_has_avx512bw  (cpu_policy.feat.avx512bw && xcr0_mask(0xe6))
+#define cpu_has_avx512vl  (cpu_policy.feat.avx512vl && xcr0_mask(0xe6))
+#define cpu_has_avx512_vbmi (cpu_policy.feat.avx512_vbmi && xcr0_mask(0xe6))
+#define cpu_has_avx512_vbmi2 (cpu_policy.feat.avx512_vbmi2 && xcr0_mask(0xe6))
+#define cpu_has_gfni       cpu_policy.feat.gfni
+#define cpu_has_vaes      (cpu_policy.feat.vaes && xcr0_mask(6))
+#define cpu_has_vpclmulqdq (cpu_policy.feat.vpclmulqdq && xcr0_mask(6))
+#define cpu_has_avx512_vnni (cpu_policy.feat.avx512_vnni && xcr0_mask(0xe6))
+#define cpu_has_avx512_bitalg (cpu_policy.feat.avx512_bitalg && xcr0_mask(0xe6))
+#define cpu_has_avx512_vpopcntdq (cpu_policy.feat.avx512_vpopcntdq && xcr0_mask(0xe6))
+#define cpu_has_movdiri    cpu_policy.feat.movdiri
+#define cpu_has_movdir64b  cpu_policy.feat.movdir64b
+#define cpu_has_avx512_vp2intersect (cpu_policy.feat.avx512_vp2intersect && xcr0_mask(0xe6))
+#define cpu_has_serialize  cpu_policy.feat.serialize
+#define cpu_has_avx512_fp16 (cpu_policy.feat.avx512_fp16 && xcr0_mask(0xe6))
+#define cpu_has_sha512     (cpu_policy.feat.sha512 && xcr0_mask(6))
+#define cpu_has_sm3        (cpu_policy.feat.sm3 && xcr0_mask(6))
+#define cpu_has_sm4        (cpu_policy.feat.sm4 && xcr0_mask(6))
+#define cpu_has_avx_vnni   (cpu_policy.feat.avx_vnni && xcr0_mask(6))
+#define cpu_has_avx512_bf16 (cpu_policy.feat.avx512_bf16 && xcr0_mask(0xe6))
+#define cpu_has_avx_ifma   (cpu_policy.feat.avx_ifma && xcr0_mask(6))
+#define cpu_has_avx_vnni_int8 (cpu_policy.feat.avx_vnni_int8 && xcr0_mask(6))
+#define cpu_has_avx_ne_convert (cpu_policy.feat.avx_ne_convert && xcr0_mask(6))
+#define cpu_has_avx_vnni_int16 (cpu_policy.feat.avx_vnni_int16 && xcr0_mask(6))
+
+#define cpu_has_xgetbv1   (cpu_has_xsave && cpu_policy.xstate.xgetbv1)
+
+#define cpu_has_3dnow_ext  cpu_policy.extd._3dnowext
+#define cpu_has_sse4a      cpu_policy.extd.sse4a
+#define cpu_has_xop       (cpu_policy.extd.xop  && xcr0_mask(6))
+#define cpu_has_fma4      (cpu_policy.extd.fma4 && xcr0_mask(6))
+#define cpu_has_tbm        cpu_policy.extd.tbm
 
 int emul_test_cpuid(
     uint32_t leaf,



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:52:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:52:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776928.1187125 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9jr-0004yF-IH; Wed, 14 Aug 2024 08:52:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776928.1187125; Wed, 14 Aug 2024 08:52:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9jr-0004y8-Fd; Wed, 14 Aug 2024 08:52:15 +0000
Received: by outflank-mailman (input) for mailman id 776928;
 Wed, 14 Aug 2024 08:52:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se9jp-0004KL-Ty
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:52:13 +0000
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com
 [2a00:1450:4864:20::52d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7fe3f71e-5a1a-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 10:52:13 +0200 (CEST)
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-5af6a1afa63so7488325a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:52:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f411b51esm146202866b.134.2024.08.14.01.52.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 01:52:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7fe3f71e-5a1a-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723625533; x=1724230333; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=epU0ZOLYsb2TVwBzTh4j8VJ21d047ETTJ0/sMnsI36o=;
        b=euev4sRlzvo/3U1B0Z6J5hcm8elyNt+fN7cKd3SIpVXO5A68F71nka9bIbWST+BIbw
         8ds1Uw7+vmWV6QdgXD9ubUdvMsY0ll0DaMCiW6bhaGkjf5yCiOxRuXxxBsKfo7SQLj1k
         bkHrd6dpnTqbnpUFDzxJArXVfH7ilQYWrsltCqI3srm9D+v1GUTHuSdtgWbc7tdVYwjg
         XA7MFGe8VX6nIqR7QGfAsnrdpt++/dYz6GHDMj8PdBPXC1ik87wIYA06Pr1R6CJ2bF8E
         wVJQU30eAtI241sbAcK2bx7F2YE/KunTvo9EhirvsBGV0asLVFVtZSbfjcFMRMFTc4Xg
         7PCA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723625533; x=1724230333;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=epU0ZOLYsb2TVwBzTh4j8VJ21d047ETTJ0/sMnsI36o=;
        b=HCOlXFCmsuaWX7PYliVozewsR1LmnTJKunrmOf2b5LDPzLXXDW0Me0mC/F0E9ODGfh
         xrGQaVM0oQUbweBvw09y9c+DPviaAxbvzMwuVs6FwazjqvuJ6xmzDEjY64nN19o8Kn/L
         9vHn1wpfSvOmuSDqv88cbk/qIo+kobv2II9YWGdMxDLwSNCdVb9znoEoltE3PZCMQlGr
         rCa4l5RgDPwO/0rts6NJl7VvbAhCiPacgxCeOQoBIt/v5B7NFQJJ36Rol8ixpjYJQ4Ld
         3U+ofZlXt24n2UGHvVq1ICKSJO17DsHHm43eJ5rgWAJYX+DPA4ZZ8b8MrnRxaoSsM7dM
         6mRw==
X-Gm-Message-State: AOJu0YyVzyjFRLc+5O1qrCb5wSFOHIIx3TF81S8udPX/kNJ+EokeQmXf
	3lpPRU+LsoSjigjvE2//1HMzAuZb1fuECPmsuqOD2sAgvo8FszIT3E2EsZKaIfhR2FML+1mH5z8
	=
X-Google-Smtp-Source: AGHT+IEMzoReuqi0utbQg5qkXqyHBm3v6Ltb9DfmhfM32yKkfb6Qx7OyLw8wcUlhaIBG8tUm7K+XYw==
X-Received: by 2002:a17:907:e6aa:b0:a77:c583:4f78 with SMTP id a640c23a62f3a-a8366d8c571mr136222666b.39.1723625532791;
        Wed, 14 Aug 2024 01:52:12 -0700 (PDT)
Message-ID: <f6b15171-a49e-4d85-a605-8770077249d7@suse.com>
Date: Wed, 14 Aug 2024 10:52:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 3/9] x86emul: introduce a struct cpu_policy * local in
 x86_emulate()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

While of little effect right here, future patches (AVX10, AMX,
KeyLocker) will benefit more significantly.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1232,6 +1232,7 @@ x86_emulate(
 {
     /* Shadow copy of register state. Committed on successful emulation. */
     struct cpu_user_regs _regs = *ctxt->regs;
+    const struct cpu_policy *cp = ctxt->cpu_policy;
     struct x86_emulate_state state;
     int rc;
     uint8_t b, d, *opc = NULL;
@@ -3074,7 +3075,7 @@ x86_emulate(
          * in fact risking to make guest OSes vulnerable to the equivalent of
          * XSA-7 (CVE-2012-0217).
          */
-        generate_exception_if(ctxt->cpuid->x86_vendor == X86_VENDOR_INTEL &&
+        generate_exception_if(cp->x86_vendor == X86_VENDOR_INTEL &&
                               op_bytes == 8 && !is_canonical_address(_regs.rcx),
                               X86_EXC_GP, 0);
 #endif



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:52:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:52:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776937.1187135 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9kF-0005YS-PY; Wed, 14 Aug 2024 08:52:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776937.1187135; Wed, 14 Aug 2024 08:52:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9kF-0005YL-Mh; Wed, 14 Aug 2024 08:52:39 +0000
Received: by outflank-mailman (input) for mailman id 776937;
 Wed, 14 Aug 2024 08:52:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se9kD-0004KL-N1
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:52:38 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8d3c3a56-5a1a-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 10:52:35 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-5a15692b6f6so7261844a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:52:35 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f411b110sm147393266b.109.2024.08.14.01.52.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 01:52:34 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8d3c3a56-5a1a-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723625555; x=1724230355; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=azFeXUFYL/HqKu6YZuXLAM4CTGgPPTsfBxGQiHIqQA8=;
        b=XAC0ri+CFd3FEvrwZrQEyabERjsznJK8zTxPIhrtxX1oV/pYaMzj2/5+FPwwbCYkN3
         fcj6hZR5uwIJgxRTTUWdKHoSauWW0FrQ9QGZiVRjWF4m69iR1Ew6Il23ZArR63UMF4av
         bOT8p16NGPzWw0zxtr8LF9swnHfpPTytfgVO2SNyjBruwI3lsw1BzsfeDBRXKLqpLNP2
         lpvM/vhL2KAZpFW9nAi2hfMqIBtJ8V4Q00Piu3W20kmGRWrMRR693v9p9vEfGImEOV3F
         Cq95SJxvFevxYIm5PyuuVTtEvwo2yei9QycxM40jClirw7tpfDOQT9h5eFeeWZNnbCyL
         x7lQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723625555; x=1724230355;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=azFeXUFYL/HqKu6YZuXLAM4CTGgPPTsfBxGQiHIqQA8=;
        b=QOvg+lxGeArdu+kie7p3nc2eMGmEJnZqCvXp/0f/fN7vsrgRue6q37ZL34nZnLmlFh
         kH7gicHINSmOtmuDybDljsbWa2wl8T5W1OMwx6rvKVfytY99g7ya+1BhAVdqtmcX8VFC
         pXXqVtMrogugTfBIHKqz2NrCxMpnsxtFO+JubTIbpLFhnSAMr3H7Hv33wzx1Rz1esy4C
         yGPIUMAfBbIegRsM4ADDgJLsmhWhRtvHXQzqGgMOWUVE7YkylcVNeLZ6/V88sVyqCn0X
         IgQXa5mSO2dtkyLfBZexFtY6vF1qI2tQkSHLsOCv6+ORlD5biOUuDs5zRRAt2iJI9WY9
         Kzsw==
X-Gm-Message-State: AOJu0YxU4ZjaMIzNYLpDe56+AJ0E37dXVKbVq0+QsL55E1UlYnh62JKW
	+RChZjDLmL0A7zj3k5lEwck8h6fBizuEzKDCfYpQb/jwzOdpBIpcammCtDLZlpKkiY5/A2S0afs
	=
X-Google-Smtp-Source: AGHT+IGvLi/8j1/GY+IuVDvvHlw9TaDIm56vbvIOe570XLGqyh0Iso4c/B/ccRFhfnnDqXOnTifAXA==
X-Received: by 2002:a17:907:3205:b0:a7a:847d:63b7 with SMTP id a640c23a62f3a-a83670700f1mr137910766b.59.1723625554895;
        Wed, 14 Aug 2024 01:52:34 -0700 (PDT)
Message-ID: <59e1de8d-af41-416c-9dbb-555539a20ff0@suse.com>
Date: Wed, 14 Aug 2024 10:52:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 4/9] x86emul: support AVX10.1
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

This requires relaxing various pre-existing AVX512* checks, as AVX10.1
covers all AVX512* except PF, ER, 4FMAPS, 4VNNIW (support for all of
which was removed meanwhile anyway), and VP2INTERSECT. Yet potentially
with only less than 512-bit vector width, while otoh guaranteeing more
narrow widths being available when wider are (i.e. unlike AVX512VL being
an add-on feature on top of AVX512F).

Note that visa_check(), replacing host_and_vcpu_must_have() uses, checks
only the guest capability: We wouldn't expose AVX512* (nor AVX10)
without the hardware supporting it. Similarly in vlen_check() the
original host_and_vcpu_must_have() is reduced to the equivalent of just
vcpu_must_have(). This also simplifies (resulting) code in the test and
fuzzing harnesses, as there the XCR0 checks that are part of
cpu_has_avx512* are only needed in local code, not in the emulator
itself (where respective checking occurs elsewhere anyway, utilizing
emul_test_read_xcr()).

While in most cases the changes to x86_emulate() are entirely
mechanical, for opmask insns earlier unconditional AVX512F checks are
converted into "else" clauses to existing if/else-if ones.

To be certain that no uses remain, also drop respective cpu_has_avx512*
(except in the test harness) and vcpu_has_avx512*().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Probably avx512_vlen_check() should have the avx512_ prefix dropped, now
that it also covers AVX10. But if so that wants to be either a prereq or
a follow-on patch.

visa_check() won't cover AVX10.2 and higher, but probably we will want
independent checking logic for that anyway.

Spec version 2 still leaves unclear what the xstate components are which
would need enabling for AVX10/256. x86emul_get_fpu() is therefore
untouched for now.

Since it'll be reducing code size, we may want to further convert
host_and_vcpu_must_have() to just vcpu_must_have() where appropriate
(should be [almost?] everywhere).
---
v2: Drop use of vsz128 field. Re-base, in particular over dropping of
    Xeon Phi support.

--- a/xen/arch/x86/include/asm/cpufeature.h
+++ b/xen/arch/x86/include/asm/cpufeature.h
@@ -133,29 +133,18 @@ static inline bool boot_cpu_has(unsigned
 #define cpu_has_pqe             boot_cpu_has(X86_FEATURE_PQE)
 #define cpu_has_fpu_sel         (!boot_cpu_has(X86_FEATURE_NO_FPU_SEL))
 #define cpu_has_mpx             boot_cpu_has(X86_FEATURE_MPX)
-#define cpu_has_avx512f         boot_cpu_has(X86_FEATURE_AVX512F)
-#define cpu_has_avx512dq        boot_cpu_has(X86_FEATURE_AVX512DQ)
 #define cpu_has_rdseed          boot_cpu_has(X86_FEATURE_RDSEED)
 #define cpu_has_smap            boot_cpu_has(X86_FEATURE_SMAP)
-#define cpu_has_avx512_ifma     boot_cpu_has(X86_FEATURE_AVX512_IFMA)
 #define cpu_has_clflushopt      boot_cpu_has(X86_FEATURE_CLFLUSHOPT)
 #define cpu_has_clwb            boot_cpu_has(X86_FEATURE_CLWB)
-#define cpu_has_avx512cd        boot_cpu_has(X86_FEATURE_AVX512CD)
 #define cpu_has_proc_trace      boot_cpu_has(X86_FEATURE_PROC_TRACE)
 #define cpu_has_sha             boot_cpu_has(X86_FEATURE_SHA)
-#define cpu_has_avx512bw        boot_cpu_has(X86_FEATURE_AVX512BW)
-#define cpu_has_avx512vl        boot_cpu_has(X86_FEATURE_AVX512VL)
 
 /* CPUID level 0x00000007:0.ecx */
-#define cpu_has_avx512_vbmi     boot_cpu_has(X86_FEATURE_AVX512_VBMI)
 #define cpu_has_pku             boot_cpu_has(X86_FEATURE_PKU)
-#define cpu_has_avx512_vbmi2    boot_cpu_has(X86_FEATURE_AVX512_VBMI2)
 #define cpu_has_gfni            boot_cpu_has(X86_FEATURE_GFNI)
 #define cpu_has_vaes            boot_cpu_has(X86_FEATURE_VAES)
 #define cpu_has_vpclmulqdq      boot_cpu_has(X86_FEATURE_VPCLMULQDQ)
-#define cpu_has_avx512_vnni     boot_cpu_has(X86_FEATURE_AVX512_VNNI)
-#define cpu_has_avx512_bitalg   boot_cpu_has(X86_FEATURE_AVX512_BITALG)
-#define cpu_has_avx512_vpopcntdq boot_cpu_has(X86_FEATURE_AVX512_VPOPCNTDQ)
 #define cpu_has_rdpid           boot_cpu_has(X86_FEATURE_RDPID)
 #define cpu_has_movdiri         boot_cpu_has(X86_FEATURE_MOVDIRI)
 #define cpu_has_movdir64b       boot_cpu_has(X86_FEATURE_MOVDIR64B)
@@ -180,7 +169,6 @@ static inline bool boot_cpu_has(unsigned
 #define cpu_has_tsx_force_abort boot_cpu_has(X86_FEATURE_TSX_FORCE_ABORT)
 #define cpu_has_serialize       boot_cpu_has(X86_FEATURE_SERIALIZE)
 #define cpu_has_hybrid          boot_cpu_has(X86_FEATURE_HYBRID)
-#define cpu_has_avx512_fp16     boot_cpu_has(X86_FEATURE_AVX512_FP16)
 #define cpu_has_arch_caps       boot_cpu_has(X86_FEATURE_ARCH_CAPS)
 
 /* CPUID level 0x00000007:1.eax */
@@ -188,7 +176,6 @@ static inline bool boot_cpu_has(unsigned
 #define cpu_has_sm3             boot_cpu_has(X86_FEATURE_SM3)
 #define cpu_has_sm4             boot_cpu_has(X86_FEATURE_SM4)
 #define cpu_has_avx_vnni        boot_cpu_has(X86_FEATURE_AVX_VNNI)
-#define cpu_has_avx512_bf16     boot_cpu_has(X86_FEATURE_AVX512_BF16)
 #define cpu_has_avx_ifma        boot_cpu_has(X86_FEATURE_AVX_IFMA)
 
 /* CPUID level 0x00000007:1.edx */
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -556,26 +556,15 @@ amd_like(const struct x86_emulate_ctxt *
 #define vcpu_has_invpcid()     (ctxt->cpuid->feat.invpcid)
 #define vcpu_has_rtm()         (ctxt->cpuid->feat.rtm)
 #define vcpu_has_mpx()         (ctxt->cpuid->feat.mpx)
-#define vcpu_has_avx512f()     (ctxt->cpuid->feat.avx512f)
-#define vcpu_has_avx512dq()    (ctxt->cpuid->feat.avx512dq)
 #define vcpu_has_rdseed()      (ctxt->cpuid->feat.rdseed)
 #define vcpu_has_adx()         (ctxt->cpuid->feat.adx)
 #define vcpu_has_smap()        (ctxt->cpuid->feat.smap)
-#define vcpu_has_avx512_ifma() (ctxt->cpuid->feat.avx512_ifma)
 #define vcpu_has_clflushopt()  (ctxt->cpuid->feat.clflushopt)
 #define vcpu_has_clwb()        (ctxt->cpuid->feat.clwb)
-#define vcpu_has_avx512cd()    (ctxt->cpuid->feat.avx512cd)
 #define vcpu_has_sha()         (ctxt->cpuid->feat.sha)
-#define vcpu_has_avx512bw()    (ctxt->cpuid->feat.avx512bw)
-#define vcpu_has_avx512vl()    (ctxt->cpuid->feat.avx512vl)
-#define vcpu_has_avx512_vbmi() (ctxt->cpuid->feat.avx512_vbmi)
-#define vcpu_has_avx512_vbmi2() (ctxt->cpuid->feat.avx512_vbmi2)
 #define vcpu_has_gfni()        (ctxt->cpuid->feat.gfni)
 #define vcpu_has_vaes()        (ctxt->cpuid->feat.vaes)
 #define vcpu_has_vpclmulqdq()  (ctxt->cpuid->feat.vpclmulqdq)
-#define vcpu_has_avx512_vnni() (ctxt->cpuid->feat.avx512_vnni)
-#define vcpu_has_avx512_bitalg() (ctxt->cpuid->feat.avx512_bitalg)
-#define vcpu_has_avx512_vpopcntdq() (ctxt->cpuid->feat.avx512_vpopcntdq)
 #define vcpu_has_rdpid()       (ctxt->cpuid->feat.rdpid)
 #define vcpu_has_movdiri()     (ctxt->cpuid->feat.movdiri)
 #define vcpu_has_movdir64b()   (ctxt->cpuid->feat.movdir64b)
@@ -583,12 +572,10 @@ amd_like(const struct x86_emulate_ctxt *
 #define vcpu_has_avx512_vp2intersect() (ctxt->cpuid->feat.avx512_vp2intersect)
 #define vcpu_has_serialize()   (ctxt->cpuid->feat.serialize)
 #define vcpu_has_tsxldtrk()    (ctxt->cpuid->feat.tsxldtrk)
-#define vcpu_has_avx512_fp16() (ctxt->cpuid->feat.avx512_fp16)
 #define vcpu_has_sha512()      (ctxt->cpuid->feat.sha512)
 #define vcpu_has_sm3()         (ctxt->cpuid->feat.sm3)
 #define vcpu_has_sm4()         (ctxt->cpuid->feat.sm4)
 #define vcpu_has_avx_vnni()    (ctxt->cpuid->feat.avx_vnni)
-#define vcpu_has_avx512_bf16() (ctxt->cpuid->feat.avx512_bf16)
 #define vcpu_has_wrmsrns()     (ctxt->cpuid->feat.wrmsrns)
 #define vcpu_has_avx_ifma()    (ctxt->cpuid->feat.avx_ifma)
 #define vcpu_has_avx_vnni_int8() (ctxt->cpuid->feat.avx_vnni_int8)
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1125,19 +1125,40 @@ static unsigned long *decode_vex_gpr(
     return decode_gpr(regs, ~vex_reg & (mode_64bit() ? 0xf : 7));
 }
 
-#define avx512_vlen_check(lig) do { \
-    switch ( evex.lr ) \
-    { \
-    default: \
-        generate_exception(X86_EXC_UD); \
-    case 2: \
-        break; \
-    case 0: case 1: \
-        if ( !(lig) ) \
-            host_and_vcpu_must_have(avx512vl); \
-        break; \
-    } \
-} while ( false )
+#define visa_check(subfeat) \
+        generate_exception_if(!cp->feat.avx512 ## subfeat && !cp->feat.avx10, \
+                              X86_EXC_UD)
+
+static bool _vlen_check(
+    const struct x86_emulate_state *s,
+    const struct cpu_policy *cp,
+    bool lig)
+{
+    if ( s->evex.lr > 2 )
+        return false;
+
+    if ( lig )
+        return true;
+
+    if ( cp->feat.avx10 )
+        switch ( s->evex.lr )
+        {
+        case 0:
+        case 1:
+            if ( cp->avx10.vsz256 )
+                return true;
+            /* fall through */
+        case 2:
+            if ( cp->avx10.vsz512 )
+                return true;
+            break;
+        }
+
+    return s->evex.lr == 2 || cp->feat.avx512vl;
+}
+
+#define avx512_vlen_check(lig) \
+        generate_exception_if(!_vlen_check(state, cp, lig), X86_EXC_UD)
 
 static bool is_branch_step(struct x86_emulate_ctxt *ctxt,
                            const struct x86_emulate_ops *ops)
@@ -1369,7 +1390,9 @@ x86_emulate(
         /* KMOV{W,Q} %k<n>, (%rax) */
         stb[0] = 0xc4;
         stb[1] = 0xe1;
-        stb[2] = cpu_has_avx512bw ? 0xf8 : 0x78;
+        stb[2] = cp->feat.avx512bw || cp->feat.avx10
+                 ? 0xf8 /* L0.NP.W1 - kmovq */
+                 : 0x78 /* L0.NP.W0 - kmovw */;
         stb[3] = 0x91;
         stb[4] = evex.opmsk << 3;
         insn_bytes = 5;
@@ -3365,7 +3388,7 @@ x86_emulate(
                                (ea.type != OP_REG && evex.brs &&
                                 (evex.pfx & VEX_PREFIX_SCALAR_MASK))),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(evex.pfx & VEX_PREFIX_SCALAR_MASK);
     simd_zmm:
@@ -3421,7 +3444,7 @@ x86_emulate(
         generate_exception_if((evex.lr || evex.opmsk || evex.brs ||
                                evex.w != (evex.pfx & VEX_PREFIX_DOUBLE_MASK)),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         if ( (d & DstMask) != DstMem )
             d &= ~TwoOp;
         op_bytes = 8;
@@ -3448,7 +3471,7 @@ x86_emulate(
         generate_exception_if((evex.brs ||
                                evex.w != (evex.pfx & VEX_PREFIX_DOUBLE_MASK)),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         avx512_vlen_check(false);
         d |= TwoOp;
         op_bytes = !(evex.pfx & VEX_PREFIX_DOUBLE_MASK) || evex.lr
@@ -3485,7 +3508,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x64): /* vpblendm{d,q} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x65): /* vblendmp{s,d} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     avx512f_no_sae:
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         generate_exception_if(ea.type != OP_MEM && evex.brs, X86_EXC_UD);
         avx512_vlen_check(false);
         goto simd_zmm;
@@ -3565,13 +3588,13 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_F3(5, 0x2a):      /* vcvtsi2sh r/m,xmm,xmm */
     case X86EMUL_OPC_EVEX_F3(5, 0x7b):      /* vcvtusi2sh r/m,xmm,xmm */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         /* fall through */
     CASE_SIMD_SCALAR_FP(_EVEX, 0x0f, 0x2a): /* vcvtsi2s{s,d} r/m,xmm,xmm */
     CASE_SIMD_SCALAR_FP(_EVEX, 0x0f, 0x7b): /* vcvtusi2s{s,d} r/m,xmm,xmm */
         generate_exception_if(evex.opmsk || (ea.type != OP_REG && evex.brs),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         if ( !evex.brs )
             avx512_vlen_check(true);
         get_fpu(X86EMUL_FPU_zmm);
@@ -3681,7 +3704,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_F3(5, 0x2d):      /* vcvtsh2si xmm/mem,reg */
     case X86EMUL_OPC_EVEX_F3(5, 0x78):      /* vcvttsh2usi xmm/mem,reg */
     case X86EMUL_OPC_EVEX_F3(5, 0x79):      /* vcvtsh2usi xmm/mem,reg */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         /* fall through */
     CASE_SIMD_SCALAR_FP(_EVEX, 0x0f, 0x2c): /* vcvtts{s,d}2si xmm/mem,reg */
     CASE_SIMD_SCALAR_FP(_EVEX, 0x0f, 0x2d): /* vcvts{s,d}2si xmm/mem,reg */
@@ -3691,7 +3714,7 @@ x86_emulate(
                                evex.opmsk ||
                                (ea.type != OP_REG && evex.brs)),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         if ( !evex.brs )
             avx512_vlen_check(true);
         get_fpu(X86EMUL_FPU_zmm);
@@ -3757,7 +3780,7 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX(5, 0x2e): /* vucomish xmm/m16,xmm */
     case X86EMUL_OPC_EVEX(5, 0x2f): /* vcomish xmm/m16,xmm */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         /* fall through */
     CASE_SIMD_PACKED_FP(_EVEX, 0x0f, 0x2e): /* vucomis{s,d} xmm/mem,xmm */
@@ -3766,7 +3789,7 @@ x86_emulate(
                                (ea.type != OP_REG && evex.brs) ||
                                evex.w != evex.pfx),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         if ( !evex.brs )
             avx512_vlen_check(true);
         get_fpu(X86EMUL_FPU_zmm);
@@ -3910,7 +3933,7 @@ x86_emulate(
 
     case X86EMUL_OPC_VEX(0x0f, 0x4a):    /* kadd{w,q} k,k,k */
         if ( !vex.w )
-            host_and_vcpu_must_have(avx512dq);
+            visa_check(dq);
         /* fall through */
     case X86EMUL_OPC_VEX(0x0f, 0x41):    /* kand{w,q} k,k,k */
     case X86EMUL_OPC_VEX_66(0x0f, 0x41): /* kand{b,d} k,k,k */
@@ -3926,11 +3949,12 @@ x86_emulate(
         generate_exception_if(!vex.l, X86_EXC_UD);
     opmask_basic:
         if ( vex.w )
-            host_and_vcpu_must_have(avx512bw);
+            visa_check(bw);
         else if ( vex.pfx )
-            host_and_vcpu_must_have(avx512dq);
+            visa_check(dq);
+        else
+            visa_check(f);
     opmask_common:
-        host_and_vcpu_must_have(avx512f);
         generate_exception_if(!vex.r || (mode_64bit() && !(vex.reg & 8)) ||
                               ea.type != OP_REG, X86_EXC_UD);
 
@@ -3953,13 +3977,14 @@ x86_emulate(
         generate_exception_if(vex.l || vex.reg != 0xf, X86_EXC_UD);
         goto opmask_basic;
 
-    case X86EMUL_OPC_VEX(0x0f, 0x4b):    /* kunpck{w,d}{d,q} k,k,k */
+    case X86EMUL_OPC_VEX(0x0f, 0x4b):    /* kunpck{wd,dq} k,k,k */
         generate_exception_if(!vex.l, X86_EXC_UD);
-        host_and_vcpu_must_have(avx512bw);
+        visa_check(bw);
         goto opmask_common;
 
     case X86EMUL_OPC_VEX_66(0x0f, 0x4b): /* kunpckbw k,k,k */
         generate_exception_if(!vex.l || vex.w, X86_EXC_UD);
+        visa_check(f);
         goto opmask_common;
 
 #endif /* X86EMUL_NO_SIMD */
@@ -4027,7 +4052,7 @@ x86_emulate(
         generate_exception_if((evex.w != (evex.pfx & VEX_PREFIX_DOUBLE_MASK) ||
                                (ea.type != OP_MEM && evex.brs)),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512dq);
+        visa_check(dq);
         avx512_vlen_check(false);
         goto simd_zmm;
 
@@ -4066,12 +4091,12 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_F2(0x0f, 0x7a): /* vcvtudq2ps [xyz]mm/mem,[xyz]mm{k} */
                                           /* vcvtuqq2ps [xyz]mm/mem,{x,y}mm{k} */
         if ( evex.w )
-            host_and_vcpu_must_have(avx512dq);
+            visa_check(dq);
         else
         {
     case X86EMUL_OPC_EVEX(0x0f, 0x78):    /* vcvttp{s,d}2udq [xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX(0x0f, 0x79):    /* vcvtp{s,d}2udq [xyz]mm/mem,[xyz]mm{k} */
-            host_and_vcpu_must_have(avx512f);
+            visa_check(f);
         }
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(false);
@@ -4288,7 +4313,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x0b): /* vpmulhrsw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x1c): /* vpabsb [xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x1d): /* vpabsw [xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512bw);
+        visa_check(bw);
         generate_exception_if(evex.brs, X86_EXC_UD);
         elem_bytes = 1 << (b & 1);
         goto avx512f_no_sae;
@@ -4320,7 +4345,7 @@ x86_emulate(
             generate_exception_if(b != 0x27 && evex.w != (b & 1), X86_EXC_UD);
             goto avx512f_no_sae;
         }
-        host_and_vcpu_must_have(avx512bw);
+        visa_check(bw);
         generate_exception_if(evex.brs, X86_EXC_UD);
         elem_bytes = 1 << (ext == ext_0f ? b & 1 : evex.w);
         avx512_vlen_check(false);
@@ -4393,7 +4418,7 @@ x86_emulate(
             dst.bytes = 2;
         /* fall through */
     case X86EMUL_OPC_EVEX_66(5, 0x6e): /* vmovw r/m16,xmm */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f, 0x6e): /* vmov{d,q} r/m,xmm */
@@ -4401,7 +4426,7 @@ x86_emulate(
         generate_exception_if((evex.lr || evex.opmsk || evex.brs ||
                                evex.reg != 0xf || !evex.RX),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         get_fpu(X86EMUL_FPU_zmm);
 
         opc = init_evex(stub);
@@ -4459,7 +4484,7 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_F2(0x0f, 0x6f): /* vmovdqu{8,16} [xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_F2(0x0f, 0x7f): /* vmovdqu{8,16} [xyz]mm,[xyz]mm/mem{k} */
-        host_and_vcpu_must_have(avx512bw);
+        visa_check(bw);
         elem_bytes = 1 << evex.w;
         goto vmovdqa;
 
@@ -4552,7 +4577,7 @@ x86_emulate(
             generate_exception_if(evex.w, X86_EXC_UD);
         else
         {
-            host_and_vcpu_must_have(avx512bw);
+            visa_check(bw);
             generate_exception_if(evex.brs, X86_EXC_UD);
         }
         d = (d & ~SrcMask) | SrcMem | TwoOp;
@@ -4800,7 +4825,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_F3(0x0f, 0xe6):   /* vcvtdq2pd {x,y}mm/mem,[xyz]mm{k} */
                                             /* vcvtqq2pd [xyz]mm/mem,[xyz]mm{k} */
         if ( evex.pfx != vex_f3 )
-            host_and_vcpu_must_have(avx512f);
+            visa_check(f);
         else if ( evex.w )
         {
     case X86EMUL_OPC_EVEX_66(0x0f, 0x78):   /* vcvttps2uqq {x,y}mm/mem,[xyz]mm{k} */
@@ -4811,11 +4836,11 @@ x86_emulate(
                                             /* vcvttpd2qq [xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f, 0x7b):   /* vcvtps2qq {x,y}mm/mem,[xyz]mm{k} */
                                             /* vcvtpd2qq [xyz]mm/mem,[xyz]mm{k} */
-            host_and_vcpu_must_have(avx512dq);
+            visa_check(dq);
         }
         else
         {
-            host_and_vcpu_must_have(avx512f);
+            visa_check(f);
             generate_exception_if(ea.type != OP_MEM && evex.brs, X86_EXC_UD);
         }
         if ( ea.type != OP_REG || !evex.brs )
@@ -4853,7 +4878,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f, 0xd6): /* vmovq xmm,xmm/m64 */
         generate_exception_if(evex.lr || !evex.w || evex.opmsk || evex.brs,
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         d |= TwoOp;
         op_bytes = 8;
         goto simd_zmm;
@@ -4879,19 +4904,21 @@ x86_emulate(
     case X86EMUL_OPC_VEX(0x0f, 0x90):    /* kmov{w,q} k/mem,k */
     case X86EMUL_OPC_VEX_66(0x0f, 0x90): /* kmov{b,d} k/mem,k */
         generate_exception_if(vex.l || !vex.r, X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
         if ( vex.w )
         {
-            host_and_vcpu_must_have(avx512bw);
+            visa_check(bw);
             op_bytes = 4 << !vex.pfx;
         }
         else if ( vex.pfx )
         {
-            host_and_vcpu_must_have(avx512dq);
+            visa_check(dq);
             op_bytes = 1;
         }
         else
+        {
+            visa_check(f);
             op_bytes = 2;
+        }
 
         get_fpu(X86EMUL_FPU_opmask);
 
@@ -4913,14 +4940,15 @@ x86_emulate(
         generate_exception_if(vex.l || !vex.r || vex.reg != 0xf ||
                               ea.type != OP_REG, X86_EXC_UD);
 
-        host_and_vcpu_must_have(avx512f);
         if ( vex.pfx == vex_f2 )
-            host_and_vcpu_must_have(avx512bw);
+            visa_check(bw);
         else
         {
             generate_exception_if(vex.w, X86_EXC_UD);
             if ( vex.pfx )
-                host_and_vcpu_must_have(avx512dq);
+                visa_check(dq);
+            else
+                visa_check(f);
         }
 
         get_fpu(X86EMUL_FPU_opmask);
@@ -4952,10 +4980,9 @@ x86_emulate(
         dst = ea;
         dst.reg = decode_gpr(&_regs, modrm_reg);
 
-        host_and_vcpu_must_have(avx512f);
         if ( vex.pfx == vex_f2 )
         {
-            host_and_vcpu_must_have(avx512bw);
+            visa_check(bw);
             dst.bytes = 4 << (mode_64bit() && vex.w);
         }
         else
@@ -4963,7 +4990,9 @@ x86_emulate(
             generate_exception_if(vex.w, X86_EXC_UD);
             dst.bytes = 4;
             if ( vex.pfx )
-                host_and_vcpu_must_have(avx512dq);
+                visa_check(dq);
+            else
+                visa_check(f);
         }
 
         get_fpu(X86EMUL_FPU_opmask);
@@ -4985,20 +5014,18 @@ x86_emulate(
         ASSERT(!state->simd_size);
         break;
 
-    case X86EMUL_OPC_VEX(0x0f, 0x99):    /* ktest{w,q} k,k */
-        if ( !vex.w )
-            host_and_vcpu_must_have(avx512dq);
-        /* fall through */
     case X86EMUL_OPC_VEX(0x0f, 0x98):    /* kortest{w,q} k,k */
     case X86EMUL_OPC_VEX_66(0x0f, 0x98): /* kortest{b,d} k,k */
+    case X86EMUL_OPC_VEX(0x0f, 0x99):    /* ktest{w,q} k,k */
     case X86EMUL_OPC_VEX_66(0x0f, 0x99): /* ktest{b,d} k,k */
         generate_exception_if(vex.l || !vex.r || vex.reg != 0xf ||
                               ea.type != OP_REG, X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
         if ( vex.w )
-            host_and_vcpu_must_have(avx512bw);
-        else if ( vex.pfx )
-            host_and_vcpu_must_have(avx512dq);
+            visa_check(bw);
+        else if ( vex.pfx || (b & 1) )
+            visa_check(dq);
+        else
+            visa_check(f);
 
         get_fpu(X86EMUL_FPU_opmask);
 
@@ -5336,7 +5363,7 @@ x86_emulate(
                                 (evex.pfx & VEX_PREFIX_SCALAR_MASK)) ||
                                !evex.r || !evex.R || evex.z),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(evex.pfx & VEX_PREFIX_SCALAR_MASK);
     simd_imm8_zmm:
@@ -5380,9 +5407,9 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x22): /* vpinsr{d,q} $imm8,r/m,xmm,xmm */
         generate_exception_if(evex.lr || evex.opmsk || evex.brs, X86_EXC_UD);
         if ( b & 2 )
-            host_and_vcpu_must_have(avx512dq);
+            visa_check(dq);
         else
-            host_and_vcpu_must_have(avx512bw);
+            visa_check(bw);
         if ( !mode_64bit() )
             evex.w = 0;
         memcpy(mmvalp, &src.val, src.bytes);
@@ -5419,7 +5446,7 @@ x86_emulate(
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x25): /* vpternlog{d,q} $imm8,[xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     avx512f_imm8_no_sae:
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         generate_exception_if(ea.type != OP_MEM && evex.brs, X86_EXC_UD);
         avx512_vlen_check(false);
         goto simd_imm8_zmm;
@@ -5518,7 +5545,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f, 0xe4): /* vpmulhuw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f, 0xea): /* vpminsw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f, 0xee): /* vpmaxsw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512bw);
+        visa_check(bw);
         generate_exception_if(evex.brs, X86_EXC_UD);
         elem_bytes = b & 0x10 ? 1 : 2;
         goto avx512f_no_sae;
@@ -5743,7 +5770,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x10): /* vpsrlvw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x11): /* vpsravw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x12): /* vpsllvw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512bw);
+        visa_check(bw);
         generate_exception_if(!evex.w || evex.brs, X86_EXC_UD);
         elem_bytes = 2;
         goto avx512f_no_sae;
@@ -5753,7 +5780,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_F3(0x0f38, 0x20): /* vpmovswb [xyz]mm,{x,y}mm/mem{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x30): /* vpmovzxbw {x,y}mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_F3(0x0f38, 0x30): /* vpmovwb [xyz]mm,{x,y}mm/mem{k} */
-        host_and_vcpu_must_have(avx512bw);
+        visa_check(bw);
         if ( evex.pfx != vex_f3 )
         {
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x21): /* vpmovsxbd xmm/mem,[xyz]mm{k} */
@@ -5801,7 +5828,7 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x13): /* vcvtph2ps {x,y}mm/mem,[xyz]mm{k} */
         generate_exception_if(evex.w || (ea.type != OP_REG && evex.brs), X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         if ( !evex.brs )
             avx512_vlen_check(false);
         op_bytes = 8 << evex.lr;
@@ -5855,7 +5882,7 @@ x86_emulate(
             op_bytes = 8;
         generate_exception_if(evex.brs, X86_EXC_UD);
         if ( !evex.w )
-            host_and_vcpu_must_have(avx512dq);
+            visa_check(dq);
         goto avx512_broadcast;
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x1a): /* vbroadcastf32x4 m128,{y,z}mm{k} */
@@ -5865,7 +5892,7 @@ x86_emulate(
         generate_exception_if(ea.type != OP_MEM || !evex.lr || evex.brs,
                               X86_EXC_UD);
         if ( evex.w )
-            host_and_vcpu_must_have(avx512dq);
+            visa_check(dq);
         goto avx512_broadcast;
 
     case X86EMUL_OPC_VEX_66(0x0f38, 0x20): /* vpmovsxbw xmm/mem,{x,y}mm */
@@ -5890,9 +5917,9 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_F3(0x0f38, 0x28): /* vpmovm2{b,w} k,[xyz]mm */
     case X86EMUL_OPC_EVEX_F3(0x0f38, 0x38): /* vpmovm2{d,q} k,[xyz]mm */
         if ( b & 0x10 )
-            host_and_vcpu_must_have(avx512dq);
+            visa_check(dq);
         else
-            host_and_vcpu_must_have(avx512bw);
+            visa_check(bw);
         generate_exception_if(evex.opmsk || ea.type != OP_REG, X86_EXC_UD);
         d |= TwoOp;
         op_bytes = 16 << evex.lr;
@@ -5934,7 +5961,7 @@ x86_emulate(
         fault_suppression = false;
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x44): /* vplzcnt{d,q} [xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512cd);
+        visa_check(cd);
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_VEX_66(0x0f38, 0x2c): /* vmaskmovps mem,{x,y}mm,{x,y}mm */
@@ -6010,7 +6037,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xba): /* vfmsub231p{s,d} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xbc): /* vfnmadd231p{s,d} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xbe): /* vfnmsub231p{s,d} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(false);
         goto simd_zmm;
@@ -6029,7 +6056,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xbb): /* vfmsub231s{s,d} xmm/mem,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xbd): /* vfnmadd231s{s,d} xmm/mem,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xbf): /* vfnmsub231s{s,d} xmm/mem,xmm,xmm{k} */
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         generate_exception_if(ea.type != OP_REG && evex.brs, X86_EXC_UD);
         if ( !evex.brs )
             avx512_vlen_check(true);
@@ -6043,14 +6070,14 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x3a): /* vpminuw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x3c): /* vpmaxsb [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x3e): /* vpmaxuw [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512bw);
+        visa_check(bw);
         generate_exception_if(evex.brs, X86_EXC_UD);
         elem_bytes = b & 2 ?: 1;
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x40): /* vpmull{d,q} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
         if ( evex.w )
-            host_and_vcpu_must_have(avx512dq);
+            visa_check(dq);
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_66(0x0f38, 0xdb):     /* aesimc xmm/m128,xmm */
@@ -6089,7 +6116,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x51): /* vpdpbusds [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x52): /* vpdpwssd [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x53): /* vpdpwssds [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_vnni);
+        visa_check(_vnni);
         generate_exception_if(evex.w, X86_EXC_UD);
         goto avx512f_no_sae;
 
@@ -6101,7 +6128,7 @@ x86_emulate(
             d |= TwoOp;
         /* fall through */
     case X86EMUL_OPC_EVEX_F3(0x0f38, 0x52): /* vdpbf16ps [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_bf16);
+        visa_check(_bf16);
         generate_exception_if(evex.w, X86_EXC_UD);
         op_bytes = 16 << evex.lr;
         goto avx512f_no_sae;
@@ -6118,7 +6145,7 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x4d): /* vrcp14s{s,d} xmm/mem,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x4f): /* vrsqrt14s{s,d} xmm/mem,xmm,xmm{k} */
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         generate_exception_if(evex.brs, X86_EXC_UD);
         avx512_vlen_check(true);
         goto simd_zmm;
@@ -6127,16 +6154,16 @@ x86_emulate(
         generate_exception_if(evex.w || !evex.r || !evex.R || evex.z, X86_EXC_UD);
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x54): /* vpopcnt{b,w} [xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_bitalg);
+        visa_check(_bitalg);
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x66): /* vpblendm{b,w} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512bw);
+        visa_check(bw);
         generate_exception_if(evex.brs, X86_EXC_UD);
         elem_bytes = 1 << evex.w;
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x55): /* vpopcnt{d,q} [xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_vpopcntdq);
+        visa_check(_vpopcntdq);
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_VEX_66(0x0f38, 0x5a): /* vbroadcasti128 m128,ymm */
@@ -6145,14 +6172,14 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x62): /* vpexpand{b,w} [xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x63): /* vpcompress{b,w} [xyz]mm,[xyz]mm/mem{k} */
-        host_and_vcpu_must_have(avx512_vbmi2);
+        visa_check(_vbmi2);
         elem_bytes = 1 << evex.w;
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x88): /* vexpandp{s,d} [xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x89): /* vpexpand{d,q} [xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x8a): /* vcompressp{s,d} [xyz]mm,[xyz]mm/mem{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x8b): /* vpcompress{d,q} [xyz]mm,[xyz]mm/mem{k} */
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         generate_exception_if(evex.brs, X86_EXC_UD);
         avx512_vlen_check(false);
         /*
@@ -6186,7 +6213,7 @@ x86_emulate(
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x71): /* vpshldv{d,q} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x73): /* vpshrdv{d,q} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_vbmi2);
+        visa_check(_vbmi2);
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_VEX   (0x0f38, 0xb0): /* vcvtneoph2ps mem,[xy]mm */
@@ -6206,16 +6233,16 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x7d): /* vpermt2{b,w} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x8d): /* vperm{b,w} [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
         if ( !evex.w )
-            host_and_vcpu_must_have(avx512_vbmi);
+            visa_check(_vbmi);
         else
-            host_and_vcpu_must_have(avx512bw);
+            visa_check(bw);
         generate_exception_if(evex.brs, X86_EXC_UD);
         fault_suppression = false;
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x78): /* vpbroadcastb xmm/m8,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x79): /* vpbroadcastw xmm/m16,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512bw);
+        visa_check(bw);
         generate_exception_if(evex.w || evex.brs, X86_EXC_UD);
         op_bytes = elem_bytes = 1 << (b & 1);
         /* See the comment at the avx512_broadcast label. */
@@ -6224,14 +6251,14 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x7a): /* vpbroadcastb r32,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x7b): /* vpbroadcastw r32,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512bw);
+        visa_check(bw);
         generate_exception_if(evex.w, X86_EXC_UD);
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x7c): /* vpbroadcast{d,q} reg,[xyz]mm{k} */
         generate_exception_if((ea.type != OP_REG || evex.brs ||
                                evex.reg != 0xf || !evex.RX),
                               X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         avx512_vlen_check(false);
         get_fpu(X86EMUL_FPU_zmm);
 
@@ -6300,7 +6327,7 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0x83): /* vpmultishiftqb [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
         generate_exception_if(!evex.w, X86_EXC_UD);
-        host_and_vcpu_must_have(avx512_vbmi);
+        visa_check(_vbmi);
         fault_suppression = false;
         goto avx512f_no_sae;
 
@@ -6448,8 +6475,8 @@ x86_emulate(
                                evex.reg != 0xf ||
                                modrm_reg == state->sib_index),
                               X86_EXC_UD);
+        visa_check(f);
         avx512_vlen_check(false);
-        host_and_vcpu_must_have(avx512f);
         get_fpu(X86EMUL_FPU_zmm);
 
         /* Read destination and index registers. */
@@ -6610,8 +6637,8 @@ x86_emulate(
                                evex.reg != 0xf ||
                                modrm_reg == state->sib_index),
                               X86_EXC_UD);
+        visa_check(f);
         avx512_vlen_check(false);
-        host_and_vcpu_must_have(avx512f);
         get_fpu(X86EMUL_FPU_zmm);
 
         /* Read source and index registers. */
@@ -6727,7 +6754,7 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xb4): /* vpmadd52luq [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xb5): /* vpmadd52huq [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_ifma);
+        visa_check(_ifma);
         generate_exception_if(!evex.w, X86_EXC_UD);
         goto avx512f_no_sae;
 
@@ -7090,7 +7117,7 @@ x86_emulate(
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x08): /* vrndscaleps $imm8,[xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x09): /* vrndscalepd $imm8,[xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         generate_exception_if(evex.w != (b & 1), X86_EXC_UD);
         avx512_vlen_check(b & 2);
         goto simd_imm8_zmm;
@@ -7099,7 +7126,7 @@ x86_emulate(
         generate_exception_if(ea.type != OP_REG && evex.brs, X86_EXC_UD);
         /* fall through */
     case X86EMUL_OPC_EVEX(0x0f3a, 0x08): /* vrndscaleph $imm8,[xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         avx512_vlen_check(b & 2);
         goto simd_imm8_zmm;
@@ -7212,11 +7239,11 @@ x86_emulate(
                                evex.opmsk || evex.brs),
                               X86_EXC_UD);
         if ( !(b & 2) )
-            host_and_vcpu_must_have(avx512bw);
+            visa_check(bw);
         else if ( !(b & 1) )
-            host_and_vcpu_must_have(avx512dq);
+            visa_check(dq);
         else
-            host_and_vcpu_must_have(avx512f);
+            visa_check(f);
         get_fpu(X86EMUL_FPU_zmm);
         opc = init_evex(stub);
         goto pextr;
@@ -7230,7 +7257,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x39): /* vextracti32x4 $imm8,{y,z}mm,xmm/m128{k} */
                                             /* vextracti64x2 $imm8,{y,z}mm,xmm/m128{k} */
         if ( evex.w )
-            host_and_vcpu_must_have(avx512dq);
+            visa_check(dq);
         generate_exception_if(evex.brs, X86_EXC_UD);
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x23): /* vshuff32x4 $imm8,{y,z}mm/mem,{y,z}mm,{y,z}mm{k} */
@@ -7250,7 +7277,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x3b): /* vextracti32x8 $imm8,zmm,ymm/m256{k} */
                                             /* vextracti64x4 $imm8,zmm,ymm/m256{k} */
         if ( !evex.w )
-            host_and_vcpu_must_have(avx512dq);
+            visa_check(dq);
         generate_exception_if(evex.lr != 2 || evex.brs, X86_EXC_UD);
         fault_suppression = false;
         goto avx512f_imm8_no_sae;
@@ -7266,7 +7293,7 @@ x86_emulate(
             generate_exception_if((evex.w || evex.reg != 0xf || !evex.RX ||
                                    (ea.type != OP_REG && (evex.z || evex.brs))),
                                   X86_EXC_UD);
-            host_and_vcpu_must_have(avx512f);
+            visa_check(f);
             avx512_vlen_check(false);
             opc = init_evex(stub);
         }
@@ -7358,7 +7385,7 @@ x86_emulate(
         if ( !(b & 0x20) )
             goto avx512f_imm8_no_sae;
     avx512bw_imm:
-        host_and_vcpu_must_have(avx512bw);
+        visa_check(bw);
         generate_exception_if(evex.brs, X86_EXC_UD);
         elem_bytes = 1 << evex.w;
         avx512_vlen_check(false);
@@ -7397,7 +7424,7 @@ x86_emulate(
         goto simd_0f_imm8_avx;
 
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x21): /* vinsertps $imm8,xmm/m32,xmm,xmm */
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         generate_exception_if(evex.lr || evex.w || evex.opmsk || evex.brs,
                               X86_EXC_UD);
         op_bytes = 4;
@@ -7405,18 +7432,18 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x50): /* vrangep{s,d} $imm8,[xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x56): /* vreducep{s,d} $imm8,[xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512dq);
+        visa_check(dq);
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x26): /* vgetmantp{s,d} $imm8,[xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x54): /* vfixupimmp{s,d} $imm8,[xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(false);
         goto simd_imm8_zmm;
 
     case X86EMUL_OPC_EVEX(0x0f3a, 0x26): /* vgetmantph $imm8,[xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX(0x0f3a, 0x56): /* vreduceph $imm8,[xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(false);
@@ -7424,11 +7451,11 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x51): /* vranges{s,d} $imm8,xmm/mem,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x57): /* vreduces{s,d} $imm8,xmm/mem,xmm,xmm{k} */
-        host_and_vcpu_must_have(avx512dq);
+        visa_check(dq);
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x27): /* vgetmants{s,d} $imm8,xmm/mem,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x55): /* vfixupimms{s,d} $imm8,xmm/mem,xmm,xmm{k} */
-        host_and_vcpu_must_have(avx512f);
+        visa_check(f);
         generate_exception_if(ea.type != OP_REG && evex.brs, X86_EXC_UD);
         if ( !evex.brs )
             avx512_vlen_check(true);
@@ -7436,7 +7463,7 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX(0x0f3a, 0x27): /* vgetmantsh $imm8,xmm/mem,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX(0x0f3a, 0x57): /* vreducesh $imm8,xmm/mem,xmm,xmm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         if ( !evex.brs )
             avx512_vlen_check(true);
@@ -7447,18 +7474,19 @@ x86_emulate(
     case X86EMUL_OPC_VEX_66(0x0f3a, 0x30): /* kshiftr{b,w} $imm8,k,k */
     case X86EMUL_OPC_VEX_66(0x0f3a, 0x32): /* kshiftl{b,w} $imm8,k,k */
         if ( !vex.w )
-            host_and_vcpu_must_have(avx512dq);
+            visa_check(dq);
+        else
+            visa_check(f);
     opmask_shift_imm:
         generate_exception_if(vex.l || !vex.r || vex.reg != 0xf ||
                               ea.type != OP_REG, X86_EXC_UD);
-        host_and_vcpu_must_have(avx512f);
         get_fpu(X86EMUL_FPU_opmask);
         op_bytes = 1; /* Any non-zero value will do. */
         goto simd_0f_imm8;
 
     case X86EMUL_OPC_VEX_66(0x0f3a, 0x31): /* kshiftr{d,q} $imm8,k,k */
     case X86EMUL_OPC_VEX_66(0x0f3a, 0x33): /* kshiftl{d,q} $imm8,k,k */
-        host_and_vcpu_must_have(avx512bw);
+        visa_check(bw);
         goto opmask_shift_imm;
 
     case X86EMUL_OPC_66(0x0f3a, 0x44):     /* pclmulqdq $imm8,xmm/m128,xmm */
@@ -7599,7 +7627,7 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x66): /* vfpclassp{s,d} $imm8,[xyz]mm/mem,k{k} */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x67): /* vfpclasss{s,d} $imm8,xmm/mem,k{k} */
-        host_and_vcpu_must_have(avx512dq);
+        visa_check(dq);
         generate_exception_if(!evex.r || !evex.R || evex.z, X86_EXC_UD);
         if ( !(b & 1) )
             goto avx512f_imm8_no_sae;
@@ -7609,7 +7637,7 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX(0x0f3a, 0x66): /* vfpclassph $imm8,[xyz]mm/mem,k{k} */
     case X86EMUL_OPC_EVEX(0x0f3a, 0x67): /* vfpclasssh $imm8,xmm/mem,k{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         generate_exception_if(evex.w || !evex.r || !evex.R || evex.z, X86_EXC_UD);
         if ( !(b & 1) )
             goto avx512f_imm8_no_sae;
@@ -7624,14 +7652,14 @@ x86_emulate(
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x71): /* vpshld{d,q} $imm8,[xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(0x0f3a, 0x73): /* vpshrd{d,q} $imm8,[xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_vbmi2);
+        visa_check(_vbmi2);
         goto avx512f_imm8_no_sae;
 
     case X86EMUL_OPC_EVEX_F3(0x0f3a, 0xc2): /* vcmpsh $imm8,xmm/mem,xmm,k{k} */
         generate_exception_if(ea.type != OP_REG && evex.brs, X86_EXC_UD);
         /* fall through */
     case X86EMUL_OPC_EVEX(0x0f3a, 0xc2): /* vcmpph $imm8,[xyz]mm/mem,[xyz]mm,k{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         generate_exception_if(evex.w || !evex.r || !evex.R || evex.z, X86_EXC_UD);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(evex.pfx & VEX_PREFIX_SCALAR_MASK);
@@ -7712,13 +7740,13 @@ x86_emulate(
     CASE_SIMD_SINGLE_FP(_EVEX, 5, 0x5d): /* vmin{p,s}h [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     CASE_SIMD_SINGLE_FP(_EVEX, 5, 0x5e): /* vdiv{p,s}h [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     CASE_SIMD_SINGLE_FP(_EVEX, 5, 0x5f): /* vmax{p,s}h [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         goto avx512f_all_fp;
 
     CASE_SIMD_ALL_FP(_EVEX, 5, 0x5a):  /* vcvtp{h,d}2p{h,d} [xyz]mm/mem,[xyz]mm{k} */
                                        /* vcvts{h,d}2s{h,d} xmm/mem,xmm,xmm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         if ( vex.pfx & VEX_PREFIX_SCALAR_MASK )
             d &= ~TwoOp;
         op_bytes = 2 << (((evex.pfx & VEX_PREFIX_SCALAR_MASK) ? 0 : 1 + evex.lr) +
@@ -7729,7 +7757,7 @@ x86_emulate(
                                        /* vcvtqq2ph [xyz]mm/mem,xmm{k} */
     case X86EMUL_OPC_EVEX_F2(5, 0x7a): /* vcvtudq2ph [xyz]mm/mem,[xy]mm{k} */
                                        /* vcvtuqq2ph [xyz]mm/mem,xmm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(false);
         op_bytes = 16 << evex.lr;
@@ -7739,7 +7767,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_F3(5, 0x5b): /* vcvttph2dq [xy]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX   (5, 0x78): /* vcvttph2udq [xy]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX   (5, 0x79): /* vcvtph2udq [xy]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(false);
@@ -7750,7 +7778,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(5, 0x79): /* vcvtph2uqq xmm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(5, 0x7a): /* vcvttph2qq xmm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(5, 0x7b): /* vcvtph2qq xmm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(false);
@@ -7787,7 +7815,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(6, 0xba): /* vfmsub231ph [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(6, 0xbc): /* vfnmadd231ph [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(6, 0xbe): /* vfnmsub231ph [xyz]mm/mem,[xyz]mm,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         if ( ea.type != OP_REG || !evex.brs )
             avx512_vlen_check(false);
@@ -7809,7 +7837,7 @@ x86_emulate(
     case X86EMUL_OPC_EVEX_66(6, 0xbb): /* vfmsub231sh xmm/m16,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX_66(6, 0xbd): /* vfnmadd231sh xmm/m16,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX_66(6, 0xbf): /* vfnmsub231sh xmm/m16,xmm,xmm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         generate_exception_if(evex.w || (ea.type != OP_REG && evex.brs),
                               X86_EXC_UD);
         if ( !evex.brs )
@@ -7818,13 +7846,13 @@ x86_emulate(
 
     case X86EMUL_OPC_EVEX_66(6, 0x4c): /* vrcpph [xyz]mm/mem,[xyz]mm{k} */
     case X86EMUL_OPC_EVEX_66(6, 0x4e): /* vrsqrtph [xyz]mm/mem,[xyz]mm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         generate_exception_if(evex.w, X86_EXC_UD);
         goto avx512f_no_sae;
 
     case X86EMUL_OPC_EVEX_66(6, 0x4d): /* vrcpsh xmm/m16,xmm,xmm{k} */
     case X86EMUL_OPC_EVEX_66(6, 0x4f): /* vrsqrtsh xmm/m16,xmm,xmm{k} */
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         generate_exception_if(evex.w || evex.brs, X86_EXC_UD);
         avx512_vlen_check(true);
         goto simd_zmm;
@@ -7842,7 +7870,7 @@ x86_emulate(
     {
         unsigned int src1 = ~evex.reg;
 
-        host_and_vcpu_must_have(avx512_fp16);
+        visa_check(_fp16);
         generate_exception_if(evex.w || ((b & 1) && ea.type != OP_REG && evex.brs),
                               X86_EXC_UD);
         if ( mode_64bit() )
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -787,7 +787,7 @@ static void __init noinline xstate_check
     if ( cpu_has_mpx )
         check_new_xstate(&s, X86_XCR0_BNDCSR | X86_XCR0_BNDREGS);
 
-    if ( cpu_has_avx512f )
+    if ( boot_cpu_has(X86_FEATURE_AVX512F) || boot_cpu_has(X86_FEATURE_AVX10) )
         check_new_xstate(&s, X86_XCR0_HI_ZMM | X86_XCR0_ZMM | X86_XCR0_OPMASK);
 
     /*
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -334,7 +334,7 @@ XEN_CPUFEATURE(AVX_NE_CONVERT,     15*32
 XEN_CPUFEATURE(AVX_VNNI_INT16,     15*32+10) /*A  AVX-VNNI-INT16 Instructions */
 XEN_CPUFEATURE(PREFETCHI,          15*32+14) /*A  PREFETCHIT{0,1} Instructions */
 XEN_CPUFEATURE(CET_SSS,            15*32+18) /*   CET Supervisor Shadow Stacks safe to use */
-XEN_CPUFEATURE(AVX10,              15*32+19) /*   AVX10 Converged Vector ISA */
+XEN_CPUFEATURE(AVX10,              15*32+19) /*a  AVX10 Converged Vector ISA */
 
 /* Intel-defined CPU features, MSR_ARCH_CAPS 0x10a.eax, word 16 */
 XEN_CPUFEATURE(RDCL_NO,            16*32+ 0) /*A  No Rogue Data Cache Load (Meltdown) */



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:53:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:53:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776941.1187146 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9ka-00061Z-7g; Wed, 14 Aug 2024 08:53:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776941.1187146; Wed, 14 Aug 2024 08:53:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9ka-00061Q-4F; Wed, 14 Aug 2024 08:53:00 +0000
Received: by outflank-mailman (input) for mailman id 776941;
 Wed, 14 Aug 2024 08:52: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=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se9kX-0004KL-SZ
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:52:57 +0000
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com
 [2a00:1450:4864:20::529])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 99f0b1bc-5a1a-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 10:52:57 +0200 (CEST)
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5ba482282d3so7908450a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:52:57 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd187f3306sm3671889a12.17.2024.08.14.01.52.56
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 01:52:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 99f0b1bc-5a1a-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723625576; x=1724230376; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=ZnNv/Ji9QwDXDDtnpehfNwAdKNqWREph7EusWegGIOY=;
        b=VFsOG1NfkhtDRjWb2Hdhu3yz8v6KkNbvoWwZxwOQjQ7LbC/uOEX0hcEBEWclvBCBZB
         QPVdRyUH6SO7PQ2fCpZvEsj0BHeqWPKhWRnJACAz/3cDEAdDm0Y5Cw1zcGSj6cGk5dsE
         G1QpqQhHxtT+OQjl1fTDvdzBL2KbFc6FkEGArD4NCl7sOuA3O9JGuGv0/e64uZPTcyLl
         HU7hOjsoLrqnsRMX2F/9FbIWma5RIevaGFpM2P+HfDL/2/7oXBwWM5oxXsG2xNfhSkH1
         ky9aT1fgIqi9zWb/4QusyGwRExDgQOaWo9iB2eT5x48A5vAKlKsNtp5jT8MpY/VeE0dV
         YaYg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723625576; x=1724230376;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=ZnNv/Ji9QwDXDDtnpehfNwAdKNqWREph7EusWegGIOY=;
        b=SzWPpoFvnAyUEcUXBpUFpQ87wS6HkxqmvrnRSd41ZPLvA1XX/E5HoErdeycJEHA9TZ
         mHNtXn9APyxq7AvA60ryonW2RS/hxGH1IMDy3g0etJLt6hjwSgcCIDugjHTJxkZWwe/0
         0CZ2SB9vbv7i7qUt6FpPeDm1+ubcxqgV94cChly11h0roBEtyRtVCXxnf4K9Jk5X75Py
         HLAAFfASJWnncsr43rCWckCVHzzQT7mOc2JnnVuPmxL3/k+AFyVzh4LVGuqnNvqXu9MX
         gM0vlKMSrdf+MNbwouf1zYdfwJHuYH+oQBZ2RHTJua0i9Y8rvoNVy3tVZrvmlW35ZVFT
         eaCw==
X-Gm-Message-State: AOJu0Yy/MbFTILtTYAD+R9Y1tqhxWNmGbASD3RgzOTdpM8y5e/ZyVgGs
	9dCSnWtH28sRoG/pvZBmeKHaNpRcac3hIwT4tlZ2+S/fKsCVt33y4vGCpZzH2DCl0B5HA2CID5Y
	=
X-Google-Smtp-Source: AGHT+IFSX9nfFHp2Nmtb5zXDICfD7E8j/0oPb7tJYbK+SldtJqquczrLewxcZ48Qwnec6LtqNgJiog==
X-Received: by 2002:a05:6402:2811:b0:5a2:68a2:ae57 with SMTP id 4fb4d7f45d1cf-5bea1cb2b95mr1220347a12.31.1723625576496;
        Wed, 14 Aug 2024 01:52:56 -0700 (PDT)
Message-ID: <e173ccd6-7bd2-4bea-a4af-bc2b4d442c0c@suse.com>
Date: Wed, 14 Aug 2024 10:52:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 5/9] x86emul/test: use simd_check_avx512*() in main()
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

In preparation for having these also cover AVX10, use the helper
functions in preference of open-coded cpu_has_avx512* for those features
that AVX10 includes. Introduce a couple further helper functions where
they weren't previously needed.

Note that this way simd_check_avx512f_sha_vl() gains an AVX512F check
(which is likely benign) and simd_check_avx512bw_gf_vl() gains an
AVX512BW check (which was clearly missing). 

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Re-base over dropping of Xeon Phi support.

--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -167,6 +167,11 @@ static bool simd_check_avx512vbmi_vl(voi
     return cpu_has_avx512_vbmi && cpu_has_avx512vl;
 }
 
+static bool simd_check_avx512vbmi2(void)
+{
+    return cpu_has_avx512_vbmi2;
+}
+
 static bool simd_check_sse4_sha(void)
 {
     return cpu_has_sha && cpu_has_sse4_2;
@@ -179,7 +184,7 @@ static bool simd_check_avx_sha(void)
 
 static bool simd_check_avx512f_sha_vl(void)
 {
-    return cpu_has_sha && cpu_has_avx512vl;
+    return cpu_has_sha && simd_check_avx512f_vl();
 }
 
 static bool simd_check_avx2_vaes(void)
@@ -189,13 +194,13 @@ static bool simd_check_avx2_vaes(void)
 
 static bool simd_check_avx512bw_vaes(void)
 {
-    return cpu_has_aesni && cpu_has_vaes && cpu_has_avx512bw;
+    return cpu_has_aesni && cpu_has_vaes && simd_check_avx512bw();
 }
 
 static bool simd_check_avx512bw_vaes_vl(void)
 {
     return cpu_has_aesni && cpu_has_vaes &&
-           cpu_has_avx512bw && cpu_has_avx512vl;
+           simd_check_avx512bw_vl();
 }
 
 static bool simd_check_avx2_vpclmulqdq(void)
@@ -205,22 +210,22 @@ static bool simd_check_avx2_vpclmulqdq(v
 
 static bool simd_check_avx512bw_vpclmulqdq(void)
 {
-    return cpu_has_vpclmulqdq && cpu_has_avx512bw;
+    return cpu_has_vpclmulqdq && simd_check_avx512bw();
 }
 
 static bool simd_check_avx512bw_vpclmulqdq_vl(void)
 {
-    return cpu_has_vpclmulqdq && cpu_has_avx512bw && cpu_has_avx512vl;
+    return cpu_has_vpclmulqdq && simd_check_avx512bw_vl();
 }
 
 static bool simd_check_avx512vbmi2_vpclmulqdq(void)
 {
-    return cpu_has_avx512_vbmi2 && simd_check_avx512bw_vpclmulqdq();
+    return simd_check_avx512vbmi2() && simd_check_avx512bw_vpclmulqdq();
 }
 
 static bool simd_check_avx512vbmi2_vpclmulqdq_vl(void)
 {
-    return cpu_has_avx512_vbmi2 && simd_check_avx512bw_vpclmulqdq_vl();
+    return simd_check_avx512vbmi2() && simd_check_avx512bw_vpclmulqdq_vl();
 }
 
 static bool simd_check_sse2_gf(void)
@@ -235,12 +240,17 @@ static bool simd_check_avx2_gf(void)
 
 static bool simd_check_avx512bw_gf(void)
 {
-    return cpu_has_gfni && cpu_has_avx512bw;
+    return cpu_has_gfni && simd_check_avx512bw();
 }
 
 static bool simd_check_avx512bw_gf_vl(void)
 {
-    return cpu_has_gfni && cpu_has_avx512vl;
+    return cpu_has_gfni && simd_check_avx512bw_vl();
+}
+
+static bool simd_check_avx512vnni(void)
+{
+    return cpu_has_avx512_vnni;
 }
 
 static bool simd_check_avx512fp16(void)
@@ -2800,7 +2810,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing {evex} vmovq %xmm1,32(%edx)...");
-    if ( stack_exec && cpu_has_avx512f )
+    if ( stack_exec && simd_check_avx512f() )
     {
         decl_insn(evex_vmovq_to_mem);
 
@@ -2824,7 +2834,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing {evex} vmovq 32(%edx),%xmm0...");
-    if ( stack_exec && cpu_has_avx512f )
+    if ( stack_exec && simd_check_avx512f() )
     {
         decl_insn(evex_vmovq_from_mem);
 
@@ -2947,7 +2957,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing vmovdqu32 %zmm2,(%ecx){%k1}...");
-    if ( stack_exec && cpu_has_avx512f )
+    if ( stack_exec && simd_check_avx512f() )
     {
         decl_insn(vmovdqu32_to_mem);
 
@@ -2977,7 +2987,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing vmovdqu32 64(%edx),%zmm2{%k2}...");
-    if ( stack_exec && cpu_has_avx512f )
+    if ( stack_exec && simd_check_avx512f() )
     {
         decl_insn(vmovdqu32_from_mem);
 
@@ -3002,7 +3012,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing vmovdqu16 %zmm3,(%ecx){%k1}...");
-    if ( stack_exec && cpu_has_avx512bw )
+    if ( stack_exec && simd_check_avx512bw() )
     {
         decl_insn(vmovdqu16_to_mem);
 
@@ -3034,7 +3044,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing vmovdqu16 64(%edx),%zmm3{%k2}...");
-    if ( stack_exec && cpu_has_avx512bw )
+    if ( stack_exec && simd_check_avx512bw() )
     {
         decl_insn(vmovdqu16_from_mem);
 
@@ -3162,7 +3172,7 @@ int main(int argc, char **argv)
     printf("%-40s", "Testing vmovsd %xmm5,16(%ecx){%k3}...");
     memset(res, 0x88, 128);
     memset(res + 20, 0x77, 8);
-    if ( stack_exec && cpu_has_avx512f )
+    if ( stack_exec && simd_check_avx512f() )
     {
         decl_insn(vmovsd_masked_to_mem);
 
@@ -3197,7 +3207,7 @@ int main(int argc, char **argv)
     }
 
     printf("%-40s", "Testing vmovaps (%edx),%zmm7{%k3}{z}...");
-    if ( stack_exec && cpu_has_avx512f )
+    if ( stack_exec && simd_check_avx512f() )
     {
         decl_insn(vmovaps_masked_from_mem);
 
@@ -3380,7 +3390,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing {evex} vmovd %xmm3,32(%ecx)...");
-    if ( stack_exec && cpu_has_avx512f )
+    if ( stack_exec && simd_check_avx512f() )
     {
         decl_insn(evex_vmovd_to_mem);
 
@@ -3405,7 +3415,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing {evex} vmovd 32(%ecx),%xmm4...");
-    if ( stack_exec && cpu_has_avx512f )
+    if ( stack_exec && simd_check_avx512f() )
     {
         decl_insn(evex_vmovd_from_mem);
 
@@ -3595,7 +3605,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing {evex} vmovd %xmm2,%ebx...");
-    if ( stack_exec && cpu_has_avx512f )
+    if ( stack_exec && simd_check_avx512f() )
     {
         decl_insn(evex_vmovd_to_reg);
 
@@ -3621,7 +3631,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing {evex} vmovd %ebx,%xmm1...");
-    if ( stack_exec && cpu_has_avx512f )
+    if ( stack_exec && simd_check_avx512f() )
     {
         decl_insn(evex_vmovd_from_reg);
 
@@ -3723,7 +3733,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing {evex} vmovq %xmm11,32(%ecx)...");
-    if ( stack_exec && cpu_has_avx512f )
+    if ( stack_exec && simd_check_avx512f() )
     {
         decl_insn(evex_vmovq_to_mem2);
 
@@ -3813,7 +3823,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing vmovq %xmm22,%rbx...");
-    if ( stack_exec && cpu_has_avx512f )
+    if ( stack_exec && simd_check_avx512f() )
     {
         decl_insn(evex_vmovq_to_reg);
 
@@ -4006,7 +4016,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing vmovntdqa 64(%ecx),%zmm4...");
-    if ( stack_exec && cpu_has_avx512f )
+    if ( stack_exec && simd_check_avx512f() )
     {
         decl_insn(evex_vmovntdqa);
 
@@ -4602,7 +4612,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing vcvtph2ps 32(%ecx),%zmm7{%k4}...");
-    if ( stack_exec && cpu_has_avx512f )
+    if ( stack_exec && simd_check_avx512f() )
     {
         decl_insn(evex_vcvtph2ps);
         decl_insn(evex_vcvtps2ph);
@@ -4645,7 +4655,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing vfixupimmpd $0,8(%edx){1to8},%zmm3,%zmm4...");
-    if ( stack_exec && cpu_has_avx512f )
+    if ( stack_exec && simd_check_avx512f() )
     {
         decl_insn(vfixupimmpd);
         static const struct {
@@ -4684,7 +4694,7 @@ int main(int argc, char **argv)
 
 
     printf("%-40s", "Testing vfpclasspsz $0x46,64(%edx),%k2...");
-    if ( stack_exec && cpu_has_avx512dq )
+    if ( stack_exec && simd_check_avx512dq() )
     {
         decl_insn(vfpclassps);
 
@@ -4716,7 +4726,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing vfpclassphz $0x46,128(%ecx),%k3...");
-    if ( stack_exec && cpu_has_avx512_fp16 )
+    if ( stack_exec && simd_check_avx512fp16() )
     {
         decl_insn(vfpclassph);
 
@@ -4759,7 +4769,7 @@ int main(int argc, char **argv)
      * on the mapping boundaries) that elements controlled by clear mask
      * bits don't get accessed.
      */
-    if ( stack_exec && cpu_has_avx512f )
+    if ( stack_exec && simd_check_avx512f() )
     {
         decl_insn(vpcompressd);
         decl_insn(vpcompressq);
@@ -4861,7 +4871,7 @@ int main(int argc, char **argv)
     }
 
 #if __GNUC__ > 7 /* can't check for __AVX512VBMI2__ here */
-    if ( stack_exec && cpu_has_avx512_vbmi2 )
+    if ( stack_exec && simd_check_avx512vbmi2() )
     {
         decl_insn(vpcompressb);
         decl_insn(vpcompressw);
@@ -5049,7 +5059,7 @@ int main(int argc, char **argv)
     }
 
     printf("%-40s", "Testing vpdpwssd (%ecx),%{y,z}mmA,%{y,z}mmB...");
-    if ( stack_exec && cpu_has_avx512_vnni && cpu_has_avx_vnni )
+    if ( stack_exec && simd_check_avx512vnni() && cpu_has_avx_vnni )
     {
         /* Do the same operation two ways and compare the results. */
         decl_insn(vpdpwssd_vex1);
@@ -5104,7 +5114,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing vmovsh 8(%ecx),%xmm5...");
-    if ( stack_exec && cpu_has_avx512_fp16 )
+    if ( stack_exec && simd_check_avx512fp16() )
     {
         decl_insn(vmovsh_from_mem);
         decl_insn(vmovw_to_gpr);



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:54:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:54:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776951.1187155 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9m4-0006nm-Hw; Wed, 14 Aug 2024 08:54:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776951.1187155; Wed, 14 Aug 2024 08:54:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9m4-0006nf-FL; Wed, 14 Aug 2024 08:54:32 +0000
Received: by outflank-mailman (input) for mailman id 776951;
 Wed, 14 Aug 2024 08:54:31 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se9m3-0006nV-51
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:54:31 +0000
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [2a00:1450:4864:20::534])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d0cd9e20-5a1a-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 10:54:29 +0200 (CEST)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5bd13ea7604so5082465a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:54:29 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5beadd60ca1sm253121a12.8.2024.08.14.01.54.28
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 01:54:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d0cd9e20-5a1a-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723625669; x=1724230469; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=VEMbn57k+IX3mUL6ZJ4mDTAe8F4l+MGuoPMbxvAr1xg=;
        b=AFJ3j9yqajvsLThckgbYyCkpMTUiTwrgjLHrmpnUmNECObAc9z5mxDvITljwjoohtx
         Rvg1LL/wE0ILSNJx0lJ2iGNl1yvyLD2Q52E4Kbwz6vMAPbDwtQAVrRc/MKKVYKKxyyFg
         i/49M/BD6qTilMmtdAgtxuul+1WhmhZtWYG/spZJPPhtJyXkGL2HGjPQ1WgN1YuXQpyX
         AN5BNg2rkBMXa3ob1GQnK3gccZhNTKS6J3s5qJ4O5UUHC9yTp/1xofCI0GmvhzOlO3VT
         X0WLJOk9/TIQeWnLxoB1QYqZ5SSalYBKV0chEm2h+hBglX/oZeNveg7HlU/Gw6K9pNew
         /+bw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723625669; x=1724230469;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=VEMbn57k+IX3mUL6ZJ4mDTAe8F4l+MGuoPMbxvAr1xg=;
        b=wnJECOVOEEyTkOzBjtb4bVnT2Vc1O2N8LRpOTXkGiprra8OfHWix3bs8UbmksVCr2f
         OOy1V2G3BQ3eUUYuvAD9/XEBZ49s0jfo2IgtziREb1QukwndsqxYTZii/Ugfjbhzxg3v
         CQVYgDQsNdroQa0GuNi3IFPSDxFvEZzW4UEU4NiK/QCfwU2vTIVXoa02Q2v/6QBmQXEj
         5p6zNvflnHHwBJ8927HMi69NA8QUCKsnNgjOct+hlF0NjBCtZUaCXibbwoW1uYKhT0xs
         lSPztz3IH1fDII+CcyN2GpLheRLJWZqfQUXrPZ4fHdQpU5dmDk7y/L2+yL6musLQ8NRJ
         B+zQ==
X-Gm-Message-State: AOJu0YxzlUXnFy2WR6tltiAmqyiilQ+dd9YrhsfdB5abX7en5hZNp7mv
	hLOc/jQ0Ob+cmE/wayPK5B5iqn7JlfGds/lctWStjlubzEYIwVtTLZ4K9s5dDyQTqZQTAocgZ8E
	=
X-Google-Smtp-Source: AGHT+IFBudeW5U9jWYxBouE8CiPLodiB68nvHdXzAUYvXOmhVFSI3KqW4rHDceWL0EOFvSBGurXgbg==
X-Received: by 2002:a05:6402:34d2:b0:5a0:e4a6:b3c9 with SMTP id 4fb4d7f45d1cf-5bea1c6ab94mr1303154a12.7.1723625668549;
        Wed, 14 Aug 2024 01:54:28 -0700 (PDT)
Message-ID: <3a72e8f6-926f-4492-b310-df96f279a2b7@suse.com>
Date: Wed, 14 Aug 2024 10:54:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 9/9] x86emul: support AVX10.2 256-bit embedded rounding /
 SAE
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

AVX10.2 (along with APX) assigns new meaning to the bit that previsouly
distinguished EVEX from the Phi co-processor's MVEX. Therefore
evex_encoded() now needs to key off of something else: Use the opcode
mapping field for this, leveraging that map 0 has no assigned opcodes
(and appears unlikely to gain any).

Place the check of EVEX.U such that it'll cover all insns. EVEX.b is
being checked for individual insns as applicable - whenever that's valid
for (register-only) 512-bit forms, it becomes valid for 256-bit forms as
well when AVX10.2 is permitted for a guest.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
To raise the question early: It is entirely unclear to me how we want to
allow control over the AVX10 minor version number from guest configs, as
that's not a boolean field and hence not suitable for simple bit-wise
masking of feature sets.
---
v2: New.

--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -16,7 +16,7 @@
 # define ERR_PTR(val) NULL
 #endif
 
-#define evex_encoded() (s->evex.mbs)
+#define evex_encoded() (s->evex.opcx)
 
 struct x86_emulate_state *
 x86_decode_insn(
@@ -1179,8 +1179,15 @@ int x86emul_decode(struct x86_emulate_st
                         s->evex.raw[1] = s->vex.raw[1];
                         s->evex.raw[2] = insn_fetch_type(uint8_t);
 
-                        generate_exception_if(!s->evex.mbs || s->evex.mbz, X86_EXC_UD);
-                        generate_exception_if(!s->evex.opmsk && s->evex.z, X86_EXC_UD);
+                        /*
+                         * .opcx is being checked here just to be on the safe
+                         * side, especially as long as evex_encoded() uses
+                         * this field.
+                         */
+                        generate_exception_if(s->evex.mbz || !s->evex.opcx,
+                                              X86_EXC_UD);
+                        generate_exception_if(!s->evex.opmsk && s->evex.z,
+                                              X86_EXC_UD);
 
                         if ( !mode_64bit() )
                             s->evex.R = 1;
@@ -1758,6 +1765,12 @@ int x86emul_decode(struct x86_emulate_st
     if ( override_seg != x86_seg_none )
         s->ea.mem.seg = override_seg;
 
+    generate_exception_if((evex_encoded() &&
+                           !s->evex.u &&
+                           (s->modrm_mod != 3 ||
+                            !vcpu_has_avx10(2) || !s->evex.brs)),
+                          X86_EXC_UD);
+
     /* Fetch the immediate operand, if present. */
     switch ( d & SrcMask )
     {
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -221,7 +221,7 @@ union evex {
         uint8_t x:1;     /* X */
         uint8_t r:1;     /* R */
         uint8_t pfx:2;   /* pp */
-        uint8_t mbs:1;
+        uint8_t u:1;     /* U */
         uint8_t reg:4;   /* vvvv */
         uint8_t w:1;     /* W */
         uint8_t opmsk:3; /* aaa */
@@ -582,6 +582,8 @@ amd_like(const struct x86_emulate_ctxt *
 #define vcpu_has_avx_ne_convert() (ctxt->cpuid->feat.avx_ne_convert)
 #define vcpu_has_avx_vnni_int16() (ctxt->cpuid->feat.avx_vnni_int16)
 
+#define vcpu_has_avx10(minor)  (ctxt->cpuid->avx10.version >= (minor))
+
 #define vcpu_must_have(feat) \
     generate_exception_if(!vcpu_has_##feat(), X86_EXC_UD)
 
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -1240,7 +1240,7 @@ int cf_check x86emul_unhandleable_rw(
 #define lock_prefix (state->lock_prefix)
 #define vex (state->vex)
 #define evex (state->evex)
-#define evex_encoded() (evex.mbs)
+#define evex_encoded() (evex.opcx)
 #define ea (state->ea)
 
 /* Undo DEBUG wrapper. */



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:57:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:57:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776965.1187167 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9pJ-0008Ed-1A; Wed, 14 Aug 2024 08:57:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776965.1187167; Wed, 14 Aug 2024 08:57:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9pI-0008EW-Sc; Wed, 14 Aug 2024 08:57:52 +0000
Received: by outflank-mailman (input) for mailman id 776965;
 Wed, 14 Aug 2024 08:57:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se9lW-0004KL-BY
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:53:58 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id be14fb1c-5a1a-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 10:53:57 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5a1337cfbb5so8321049a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:53:57 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd187f3306sm3672671a12.17.2024.08.14.01.53.56
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 01:53:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: be14fb1c-5a1a-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723625637; x=1724230437; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=VGSyTsew86/TrCcru/Rk7R/2beYcoXHkI1pXLpAyXsw=;
        b=cFwoTxsJOf6h//TszOXsk553mQ7qFbylgD6q9a1XeuNTqO9221CN6Ua6/NuLoy5+Jo
         1t6VWwXsThdhhRiYGq5l1MZLzhf9uQqqYVn21id9gJFxexNOFDLVbAw+JNwbD12dR7S9
         9lIDDV5nSOS2Z1OmKBtieTCrD4aKgMc7vFVel2VcWoPxTL6yUpXF0E2Dln9D4dG8kNeL
         SDZyqBtyRMXSXvF+3VtXYrduKQ+hM+6iGRZLrQ+NonNPqs/mr5qnUZy2ERCIBsdieay1
         c1Nxd5nZfTM/2J1SLDsMeS9QF7816y+9RKN3wL9GWolQYz/ZBoE6ByfJP9A1RIXxO81l
         rVBw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723625637; x=1724230437;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=VGSyTsew86/TrCcru/Rk7R/2beYcoXHkI1pXLpAyXsw=;
        b=AUEMv/o88rWTLYvkt2zQ3EdGR4RBIhmhRYTK/Uf4pjAdNRx+nYI0fFWc1eMfsWaVNJ
         xc5paLw4Hx/GlTsbmAbR4gi78IhLDSajnlmBoSE6wIgmZUvGvCutsLJwUQt662UulJxc
         Dc8kkvxuE9IOMD8JD32lldym7SAwmyiVPXAhJwKZv2zPakP9KgJG8wbVtbxKq5BZ6Clu
         9mWjWmFP641X03viIc9jkPGou9b0xQtTGMWLTZZ5Vuu7TKEzO/AsCbggzsW0gPcemigG
         GZbWBwzLKVOxB1xa5PEUsWZJ2bUuvNh8j8a5crT6K4HPyaeVyJli4l1ec5RmyhM/DX6G
         yahA==
X-Gm-Message-State: AOJu0YyX0LsV4jyWUGdFfneuAlKClZDCaeWhK/UoruvkfEN0iOn1Ai60
	KoA4VOK1e9urnJMWX92h4eJwBbftT8xrst6e0MWfC+wSnebav43bYoYkyz3FRgMXKbzEJB+ZGK4
	=
X-Google-Smtp-Source: AGHT+IE68HR9zPeYJqpC26k+G87WcAmTROyAjMQ85LwKkgJVPau3FH01EvgH8hL4JVtRtVOGkObRrQ==
X-Received: by 2002:a05:6402:1e91:b0:5a3:a4d7:caf5 with SMTP id 4fb4d7f45d1cf-5bea1cb3857mr1555308a12.36.1723625637144;
        Wed, 14 Aug 2024 01:53:57 -0700 (PDT)
Message-ID: <1791dda8-694b-4ef9-b8f7-86f1eeca7719@suse.com>
Date: Wed, 14 Aug 2024 10:53:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 8/9] x86emul/test: engage AVX512VL via command line option
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Now that we have machinery in testcase.mk to set vector length dependent
flags for AVX512 tests, let's avoid using a pragma to enable AVX512VL
insns for the compiler. This way, correct settings are in place from the
very beginning of compilation.

No change to the generated test blobs, and hence no functional change.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/tools/tests/x86_emulator/simd.h
+++ b/tools/tests/x86_emulator/simd.h
@@ -215,10 +215,6 @@ DECL_OCTET(half);
 # define __builtin_ia32_shuf_i32x4_512_mask __builtin_ia32_shuf_i32x4_mask
 # define __builtin_ia32_shuf_i64x2_512_mask __builtin_ia32_shuf_i64x2_mask
 
-# if VEC_SIZE > ELEM_SIZE && (defined(VEC_MAX) ? VEC_MAX : VEC_SIZE) < 64
-#  pragma GCC target ( "avx512vl" )
-# endif
-
 # define REN(insn, old, new)                     \
     asm ( ".macro v" #insn #old " o:vararg \n\t" \
           "v" #insn #new " \\o             \n\t" \
--- a/tools/tests/x86_emulator/testcase.mk
+++ b/tools/tests/x86_emulator/testcase.mk
@@ -7,8 +7,8 @@ $(call cc-options-add,CFLAGS,CC,$(EMBEDD
 ifneq ($(filter -mavx512%,$($(TESTCASE)-cflags)),)
 
 cflags-vsz64 :=
-cflags-vsz32 := -mprefer-vector-width=256
-cflags-vsz16 := -mprefer-vector-width=128
+cflags-vsz32 := -mavx512vl -mprefer-vector-width=256
+cflags-vsz16 := -mavx512vl -mprefer-vector-width=128
 # Scalar tests don't set VEC_SIZE (and VEC_MAX is used by S/G ones only)
 cflags-vsz   := -mprefer-vector-width=128
 



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:58:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:58:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776972.1187176 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9pb-0000RO-BF; Wed, 14 Aug 2024 08:58:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776972.1187176; Wed, 14 Aug 2024 08:58:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9pb-0000RH-8R; Wed, 14 Aug 2024 08:58:11 +0000
Received: by outflank-mailman (input) for mailman id 776972;
 Wed, 14 Aug 2024 08:58:09 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se9kt-0003yE-OB
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:53:19 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a684e2b0-5a1a-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 10:53:18 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-a7a8553db90so756743566b.2
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:53:18 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f3f4981dsm149376566b.18.2024.08.14.01.53.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 01:53:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a684e2b0-5a1a-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723625598; x=1724230398; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=D2/zh/bchaIimR3ZyxsWSS2VxTLjlJtCdjnQQPFRqsU=;
        b=H8sp6iE16iq4oO+XVI9PfmMfNjOTT5eluwBGWOsHUtS09QxEWQhuTPFWqp9+kkkop+
         whTTInR+T6T6C6r2QliK7KqQHy34eopKF2gLt8dCVLfaeBvO49JRwqQvonn0fIR8Po3r
         woOHYCQZqcWUYHrkNxkrfF5+UqjHH8LNvX9U8O0zkvUTGBiPwVLdIIMYkERAA4XJeerX
         +6L6D4GiGtb46ezUvQXLK4eGmVtN7h4PWCNW9CT5xVasNgwn4AMoX8FeRwVi0OHitWlZ
         xSBbShN/IFVonFbo4L5v6v5EpK47PVmddymCUHxGTQYRXjzxbNEfSWko6xSZwbKIUujP
         UVcQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723625598; x=1724230398;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=D2/zh/bchaIimR3ZyxsWSS2VxTLjlJtCdjnQQPFRqsU=;
        b=RHjYUcVFwmixC9smjJR/5HB4jqzWCSGTY6BgYg+7n3Ked7fa2Zy49b5jnQeXyd05LT
         q5M5SnDuPqRroAzGPencay22hPH4FoRhfbEYbQGh+0VzUXE0njVDcCDC5AopipzVqNvc
         kgovv28E53JsK9i4t/hFhiQBkU6+HJ2BJ41XWaPW+TNjfH2KP12ZVjsGAORVCEkngp0S
         x0V5KybXS4G2QYe9F7+I7wuJInPaZZmcsmZg87xh0lc/b3zvWJhzSptOTaw+UZPBEhh/
         wI0/Jzs0KOe8LvLg/fIk/6R29fKLtJulVsRgmJLZTgvNLblMVdMDrkp3mp2r8XXMohza
         xkMQ==
X-Gm-Message-State: AOJu0YxzTwpkU7cbld4Wj3Vm/t7WCZyM7y3TVOnRjyYYQ5u6YM47Jhnt
	2RLr6b32tnGrmiIF6yRv6l4TlC/gC5jWVE+N5deWrMITz6Bi2GzzrR2NLlar6is5pfwWTC9pvKY
	=
X-Google-Smtp-Source: AGHT+IFgKj7V+kkgDhundAx9tQO+8VFSUIZ1P2ZCmJTPRhypVFYeDCV/UpjyI6VC3XW0M+lR87vQgg==
X-Received: by 2002:a17:907:e20f:b0:a7a:9144:e256 with SMTP id a640c23a62f3a-a8366c388bamr133984966b.6.1723625597464;
        Wed, 14 Aug 2024 01:53:17 -0700 (PDT)
Message-ID: <4480c5c4-9b97-4fee-b086-22fc1006b7ac@suse.com>
Date: Wed, 14 Aug 2024 10:53:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 6/9] x86emul/test: drop cpu_has_avx512vl
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

AVX512VL not being a standalone feature anyway, but always needing
to be combined with some other AVX512*, replace uses of
cpu_has_avx512vl by just the feature bit check.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
v2: Re-base over dropping of Xeon Phi support.

--- a/tools/tests/x86_emulator/evex-disp8.c
+++ b/tools/tests/x86_emulator/evex-disp8.c
@@ -1000,7 +1000,8 @@ static void test_group(const struct test
     {
         for ( j = 0; j < nr_vl; ++j )
         {
-            if ( vl[0] == VL_512 && vl[j] != VL_512 && !cpu_has_avx512vl )
+            if ( vl[0] == VL_512 && vl[j] != VL_512 &&
+                 !cpu_policy.feat.avx512vl )
                 continue;
 
             switch ( tests[i].esz )
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -131,7 +131,7 @@ static bool simd_check_avx512f(void)
 
 static bool simd_check_avx512f_vl(void)
 {
-    return cpu_has_avx512f && cpu_has_avx512vl;
+    return cpu_has_avx512f && cpu_policy.feat.avx512vl;
 }
 #define simd_check_avx512vl_sg simd_check_avx512f_vl
 
@@ -143,7 +143,7 @@ static bool simd_check_avx512dq(void)
 
 static bool simd_check_avx512dq_vl(void)
 {
-    return cpu_has_avx512dq && cpu_has_avx512vl;
+    return cpu_has_avx512dq && cpu_policy.feat.avx512vl;
 }
 
 static bool simd_check_avx512bw(void)
@@ -154,7 +154,7 @@ static bool simd_check_avx512bw(void)
 
 static bool simd_check_avx512bw_vl(void)
 {
-    return cpu_has_avx512bw && cpu_has_avx512vl;
+    return cpu_has_avx512bw && cpu_policy.feat.avx512vl;
 }
 
 static bool simd_check_avx512vbmi(void)
@@ -164,7 +164,7 @@ static bool simd_check_avx512vbmi(void)
 
 static bool simd_check_avx512vbmi_vl(void)
 {
-    return cpu_has_avx512_vbmi && cpu_has_avx512vl;
+    return cpu_has_avx512_vbmi && cpu_policy.feat.avx512vl;
 }
 
 static bool simd_check_avx512vbmi2(void)
@@ -260,7 +260,7 @@ static bool simd_check_avx512fp16(void)
 
 static bool simd_check_avx512fp16_vl(void)
 {
-    return cpu_has_avx512_fp16 && cpu_has_avx512vl;
+    return cpu_has_avx512_fp16 && cpu_policy.feat.avx512vl;
 }
 
 static void simd_set_regs(struct cpu_user_regs *regs)
--- a/tools/tests/x86_emulator/x86-emulate.h
+++ b/tools/tests/x86_emulator/x86-emulate.h
@@ -159,7 +159,6 @@ void wrpkru(unsigned int val);
 #define cpu_has_avx512cd  (cpu_policy.feat.avx512cd && xcr0_mask(0xe6))
 #define cpu_has_sha        cpu_policy.feat.sha
 #define cpu_has_avx512bw  (cpu_policy.feat.avx512bw && xcr0_mask(0xe6))
-#define cpu_has_avx512vl  (cpu_policy.feat.avx512vl && xcr0_mask(0xe6))
 #define cpu_has_avx512_vbmi (cpu_policy.feat.avx512_vbmi && xcr0_mask(0xe6))
 #define cpu_has_avx512_vbmi2 (cpu_policy.feat.avx512_vbmi2 && xcr0_mask(0xe6))
 #define cpu_has_gfni       cpu_policy.feat.gfni



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 08:58:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 08:58:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.776995.1187186 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9q8-0001JN-JC; Wed, 14 Aug 2024 08:58:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 776995.1187186; Wed, 14 Aug 2024 08:58:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1se9q8-0001JG-Fd; Wed, 14 Aug 2024 08:58:44 +0000
Received: by outflank-mailman (input) for mailman id 776995;
 Wed, 14 Aug 2024 08:58: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=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1se9lE-0004KL-GL
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 08:53:40 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b31c3d8b-5a1a-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 10:53:39 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a7a8caef11fso728775266b.0
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 01:53:39 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f417fc88sm146204066b.188.2024.08.14.01.53.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 01:53:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b31c3d8b-5a1a-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723625619; x=1724230419; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=qi/Fm+9B9f9VMuCLNtTiSs7SNFkgAwLJFrGTpFHQGfc=;
        b=WeFppuigx2sTq1xiUX7zNHyo0cjs5TBuV87jg7UBPpmjZ2gyBJjqM3FJ8t12CgyXBn
         3iiQmawyCwcPiERin4ciNm00Q5UbBIC/VtIz75V2jfC2wJ9YMJgXcWdWoWUc4UQ/ZdH2
         BDXSDO+k21IueB5YfYxOjRnoelvYqEVQVrMZRv+5BlArkGLmHOhhnnda+6R8ZHSxFhDP
         rA0inMeZ8LF/FaHhBr5X56xzgwsg5XPVxTBRwdlCfZ9R0aW+c7RtSnpTYpcFLJZXNm0O
         NK8xBroAFodZbdJUCrxU9iV9w/KhQ3IDYtDUgSOeAjCl4whP1Ei2xc1ZRlfIpGE08mUa
         2+Sw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723625619; x=1724230419;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=qi/Fm+9B9f9VMuCLNtTiSs7SNFkgAwLJFrGTpFHQGfc=;
        b=QRyLvRhpgTq74mwCn3KeX3mRS6l0lOBBMUPq/zoG9HJJHqKdz7eTnhcfCVRkjwigk1
         TIvbOCFjho5+zY7R254cSzJW0rOgQ8C6hIlHFZQIsZUD3WLhf3lZIKMAWSXiRYBsuvU1
         G7kbz7sMA5y+SxWn3gzguRNlO7QYaYhV1yHB7gYp/8NwMFtIlXw09Xa/SmGufNDkiyPt
         4vx1eSp5IZJtN++DLuPNIpIdKr/MbT0vP8Adkt04iY7rvhjZLwzM9glJhhfNvtJoj4hh
         2sbDTFieQc4FvmtKbBFkHNk6f/e4QbfHhXhqzuYx6itOrAvEyvIruFerJ3CYCeU3GtoQ
         tyYQ==
X-Gm-Message-State: AOJu0YyO31/N1eIesS0MD/zmYFsIC0V/mnRzCR+58ZGLejQyFVFnSmPU
	SSncnd9HXQtGz8viNAwz+QilcqJ8OaUsQusozNzrrRL118hb14VwkG9+0JRHXcTIegJ5SXJYXsk
	=
X-Google-Smtp-Source: AGHT+IFgGkn6PNSTmOfTJA+DMN7NFjVSFGH0DV+Xhp2z61yYXHoUhT8dxqNBwJEveRcFniM3w17EBA==
X-Received: by 2002:a17:907:d3d2:b0:a7a:aa35:4089 with SMTP id a640c23a62f3a-a8366c34018mr159528866b.24.1723625618616;
        Wed, 14 Aug 2024 01:53:38 -0700 (PDT)
Message-ID: <c55ead21-270f-48c7-8db6-6ca734e1fd7c@suse.com>
Date: Wed, 14 Aug 2024 10:53:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH v2 7/9] x86emul: AVX10.1 testing
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Re-use respective AVX512 tests, by suitably adjusting the predicate
functions. This leaves test names ("Testing ... NN-bit code sequence")
somewhat misleading, but I think we can live with that.

Note that the AVX512{BW,DQ} opmask tests cannot be run as-is for the
AVX10/256 case, as they include 512-bit vector <-> opmask insn tests.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
SDE: -gnr / -gnr256
---
TBD: For AVX10.1/256 need to somehow guarantee that the generated blobs
     really don't use 512-bit insns (it's uncertain whether passing
     -mprefer-vector-width= is enough). Right now according to my
     testing on SDE this is all fine. May need to probe for support of
     the new -mno-evex512 compiler option.

The AVX512{BW,DQ} opmask tests could of course be cloned (i.e. rebuilt
another time with -mavx512vl passed) accordingly, but the coverage gain
wouldbe pretty marginal.
---
v2: Drop SDE 9.27.0 workaround. Re-base over dropping of Xeon Phi
    support.

--- a/tools/tests/x86_emulator/evex-disp8.c
+++ b/tools/tests/x86_emulator/evex-disp8.c
@@ -1001,7 +1001,11 @@ static void test_group(const struct test
         for ( j = 0; j < nr_vl; ++j )
         {
             if ( vl[0] == VL_512 && vl[j] != VL_512 &&
-                 !cpu_policy.feat.avx512vl )
+                 !cpu_policy.feat.avx512vl && !cpu_policy.feat.avx10 )
+                continue;
+
+            if ( vl[j] == VL_512 && !cpu_policy.feat.avx512f &&
+                 !cpu_policy.avx10.vsz512 )
                 continue;
 
             switch ( tests[i].esz )
@@ -1052,6 +1056,27 @@ static void test_group(const struct test
     }
 }
 
+/* AVX512 (sub)features implied by AVX10. */
+#define avx10_has_avx512f             true
+#define avx10_has_avx512bw            true
+#define avx10_has_avx512cd            true
+#define avx10_has_avx512dq            true
+#define avx10_has_avx512_bf16         true
+#define avx10_has_avx512_bitalg       true
+#define avx10_has_avx512_fp16         true
+#define avx10_has_avx512_ifma         true
+#define avx10_has_avx512_vbmi         true
+#define avx10_has_avx512_vbmi2        true
+#define avx10_has_avx512_vnni         true
+#define avx10_has_avx512_vpopcntdq    true
+
+/* AVX512 sub-features /not/ implied by AVX10. */
+#define avx10_has_avx512er            false
+#define avx10_has_avx512pf            false
+#define avx10_has_avx512_4fmaps       false
+#define avx10_has_avx512_4vnniw       false
+#define avx10_has_avx512_vp2intersect false
+
 void evex_disp8_test(void *instr, struct x86_emulate_ctxt *ctxt,
                      const struct x86_emulate_ops *ops)
 {
@@ -1059,8 +1084,8 @@ void evex_disp8_test(void *instr, struct
     emulops.read = read;
     emulops.write = write;
 
-#define RUN(feat, vl) do { \
-    if ( cpu_has_##feat ) \
+#define run(cond, feat, vl) do { \
+    if ( cond ) \
     { \
         printf("%-40s", "Testing " #feat "/" #vl " disp8 handling..."); \
         test_group(feat ## _ ## vl, ARRAY_SIZE(feat ## _ ## vl), \
@@ -1069,6 +1094,12 @@ void evex_disp8_test(void *instr, struct
     } \
 } while ( false )
 
+#define RUN(feat, vl) \
+    run(cpu_has_ ## feat || \
+        (cpu_has_avx10_1 && cpu_policy.avx10.vsz256 && avx10_has_ ## feat && \
+         (ARRAY_SIZE(vl_ ## vl) > 1 || &vl_ ## vl[0] != &vl_512[0])), \
+       feat, vl)
+
     RUN(avx512f, all);
     RUN(avx512f, 128);
     RUN(avx512f, no128);
@@ -1091,10 +1122,15 @@ void evex_disp8_test(void *instr, struct
     RUN(avx512_fp16, all);
     RUN(avx512_fp16, 128);
 
-    if ( cpu_has_avx512f )
+#undef RUN
+
+    if ( cpu_has_avx512f || cpu_has_avx10_1 )
     {
+#define RUN(feat, vl) run(cpu_has_ ## feat, feat, vl)
         RUN(gfni, all);
         RUN(vaes, all);
         RUN(vpclmulqdq, all);
+#undef RUN
     }
+#undef run
 }
--- a/tools/tests/x86_emulator/testcase.mk
+++ b/tools/tests/x86_emulator/testcase.mk
@@ -4,7 +4,27 @@ include $(XEN_ROOT)/tools/Rules.mk
 
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 
-CFLAGS += -fno-builtin -g0 $($(TESTCASE)-cflags)
+ifneq ($(filter -mavx512%,$($(TESTCASE)-cflags)),)
+
+cflags-vsz64 :=
+cflags-vsz32 := -mprefer-vector-width=256
+cflags-vsz16 := -mprefer-vector-width=128
+# Scalar tests don't set VEC_SIZE (and VEC_MAX is used by S/G ones only)
+cflags-vsz   := -mprefer-vector-width=128
+
+ifneq ($(filter -DVEC_SIZE=%,$($(TESTCASE)-cflags)),)
+CFLAGS-VSZ := $(cflags-vsz$(patsubst -DVEC_SIZE=%,%,$(filter -DVEC_SIZE=%,$($(TESTCASE)-cflags))))
+else
+CFLAGS-VSZ := $(cflags-vsz$(patsubst -DVEC_MAX=%,%,$(filter -DVEC_MAX=%,$($(TESTCASE)-cflags))))
+endif
+
+else
+
+CFLAGS-VSZ :=
+
+endif
+
+CFLAGS += -fno-builtin -g0 $($(TESTCASE)-cflags) $(CFLAGS-VSZ)
 
 LDFLAGS_DIRECT += $(shell { $(LD) -v --warn-rwx-segments; } >/dev/null 2>&1 && echo --no-warn-rwx-segments)
 
--- a/tools/tests/x86_emulator/test_x86_emulator.c
+++ b/tools/tests/x86_emulator/test_x86_emulator.c
@@ -124,52 +124,61 @@ static bool simd_check_avx_pclmul(void)
 
 static bool simd_check_avx512f(void)
 {
-    return cpu_has_avx512f;
+    return cpu_has_avx512f || cpu_has_avx10_1_512;
 }
-#define simd_check_avx512f_opmask simd_check_avx512f
 #define simd_check_avx512f_sg simd_check_avx512f
 
+static bool simd_check_avx512f_sc(void)
+{
+    return cpu_has_avx512f || cpu_has_avx10_1;
+}
+#define simd_check_avx512f_opmask simd_check_avx512f_sc
+
 static bool simd_check_avx512f_vl(void)
 {
-    return cpu_has_avx512f && cpu_policy.feat.avx512vl;
+    return (cpu_has_avx512f && cpu_policy.feat.avx512vl) ||
+           cpu_has_avx10_1_256;
 }
 #define simd_check_avx512vl_sg simd_check_avx512f_vl
 
 static bool simd_check_avx512dq(void)
 {
-    return cpu_has_avx512dq;
+    return cpu_has_avx512dq || cpu_has_avx10_1_512;
 }
 #define simd_check_avx512dq_opmask simd_check_avx512dq
 
 static bool simd_check_avx512dq_vl(void)
 {
-    return cpu_has_avx512dq && cpu_policy.feat.avx512vl;
+    return (cpu_has_avx512dq && cpu_policy.feat.avx512vl) ||
+           cpu_has_avx10_1_256;
 }
 
 static bool simd_check_avx512bw(void)
 {
-    return cpu_has_avx512bw;
+    return cpu_has_avx512bw || cpu_has_avx10_1_512;
 }
 #define simd_check_avx512bw_opmask simd_check_avx512bw
 
 static bool simd_check_avx512bw_vl(void)
 {
-    return cpu_has_avx512bw && cpu_policy.feat.avx512vl;
+    return (cpu_has_avx512bw && cpu_policy.feat.avx512vl) ||
+           cpu_has_avx10_1_256;
 }
 
 static bool simd_check_avx512vbmi(void)
 {
-    return cpu_has_avx512_vbmi;
+    return cpu_has_avx512_vbmi || cpu_has_avx10_1_512;
 }
 
 static bool simd_check_avx512vbmi_vl(void)
 {
-    return cpu_has_avx512_vbmi && cpu_policy.feat.avx512vl;
+    return (cpu_has_avx512_vbmi && cpu_policy.feat.avx512vl) ||
+           cpu_has_avx10_1_256;
 }
 
 static bool simd_check_avx512vbmi2(void)
 {
-    return cpu_has_avx512_vbmi2;
+    return cpu_has_avx512_vbmi2 || cpu_has_avx10_1_512;
 }
 
 static bool simd_check_sse4_sha(void)
@@ -250,17 +259,23 @@ static bool simd_check_avx512bw_gf_vl(vo
 
 static bool simd_check_avx512vnni(void)
 {
-    return cpu_has_avx512_vnni;
+    return cpu_has_avx512_vnni || cpu_has_avx10_1_512;
 }
 
 static bool simd_check_avx512fp16(void)
 {
-    return cpu_has_avx512_fp16;
+    return cpu_has_avx512_fp16 || cpu_has_avx10_1_512;
+}
+
+static bool simd_check_avx512fp16_sc(void)
+{
+    return cpu_has_avx512_fp16 || cpu_has_avx10_1;
 }
 
 static bool simd_check_avx512fp16_vl(void)
 {
-    return cpu_has_avx512_fp16 && cpu_policy.feat.avx512vl;
+    return (cpu_has_avx512_fp16 && cpu_policy.feat.avx512vl) ||
+           cpu_has_avx10_1_256;
 }
 
 static void simd_set_regs(struct cpu_user_regs *regs)
@@ -433,9 +448,13 @@ static const struct {
     SIMD(OPMASK+DQ/w, avx512dq_opmask,         2),
     SIMD(OPMASK+BW/d, avx512bw_opmask,         4),
     SIMD(OPMASK+BW/q, avx512bw_opmask,         8),
-    SIMD(AVX512F f32 scalar,  avx512f,        f4),
+#define avx512f_sc_x86_32_D_f4 avx512f_x86_32_D_f4
+#define avx512f_sc_x86_64_D_f4 avx512f_x86_64_D_f4
+    SIMD(AVX512F f32 scalar,  avx512f_sc,     f4),
     SIMD(AVX512F f32x16,      avx512f,      64f4),
-    SIMD(AVX512F f64 scalar,  avx512f,        f8),
+#define avx512f_sc_x86_32_D_f8 avx512f_x86_32_D_f8
+#define avx512f_sc_x86_64_D_f8 avx512f_x86_64_D_f8
+    SIMD(AVX512F f64 scalar,  avx512f_sc,     f8),
     SIMD(AVX512F f64x8,       avx512f,      64f8),
     SIMD(AVX512F s32x16,      avx512f,      64i4),
     SIMD(AVX512F u32x16,      avx512f,      64u4),
@@ -523,7 +542,9 @@ static const struct {
     AVX512VL(_VBMI+VL u16x8, avx512vbmi,    16u2),
     AVX512VL(_VBMI+VL s16x16, avx512vbmi,   32i2),
     AVX512VL(_VBMI+VL u16x16, avx512vbmi,   32u2),
-    SIMD(AVX512_FP16 f16 scal,avx512fp16,     f2),
+#define avx512fp16_sc_x86_32_D_f2 avx512fp16_x86_32_D_f2
+#define avx512fp16_sc_x86_64_D_f2 avx512fp16_x86_64_D_f2
+    SIMD(AVX512_FP16 f16 scal,avx512fp16_sc,  f2),
     SIMD(AVX512_FP16 f16x32, avx512fp16,    64f2),
     AVX512VL(_FP16+VL f16x8, avx512fp16,    16f2),
     AVX512VL(_FP16+VL f16x16,avx512fp16,    32f2),
@@ -2810,7 +2831,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing {evex} vmovq %xmm1,32(%edx)...");
-    if ( stack_exec && simd_check_avx512f() )
+    if ( stack_exec && simd_check_avx512f_sc() )
     {
         decl_insn(evex_vmovq_to_mem);
 
@@ -2834,7 +2855,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing {evex} vmovq 32(%edx),%xmm0...");
-    if ( stack_exec && simd_check_avx512f() )
+    if ( stack_exec && simd_check_avx512f_sc() )
     {
         decl_insn(evex_vmovq_from_mem);
 
@@ -2846,11 +2867,22 @@ int main(int argc, char **argv)
         rc = x86_emulate(&ctxt, &emulops);
         if ( rc != X86EMUL_OKAY || !check_eip(evex_vmovq_from_mem) )
             goto fail;
-        asm ( "vmovq %1, %%xmm1\n\t"
-              "vpcmpeqq %%zmm0, %%zmm1, %%k0\n"
-              "kmovw %%k0, %0" : "=r" (rc) : "m" (res[8]) );
-        if ( rc != 0xff )
-            goto fail;
+        if ( simd_check_avx512f() )
+        {
+            asm ( "vmovq %1, %%xmm1\n\t"
+                  "vpcmpeqq %%zmm0, %%zmm1, %%k0\n"
+                  "kmovw %%k0, %0" : "=r" (rc) : "m" (res[8]) );
+            if ( rc != 0x00ff )
+                goto fail;
+        }
+        else
+        {
+            asm ( "vmovq %1, %%xmm1\n\t"
+                  "vpcmpeqq %%xmm0, %%xmm1, %%k0\n"
+                  "kmovb %%k0, %0" : "=r" (rc) : "m" (res[8]) );
+            if ( rc != 0x03 )
+                goto fail;
+        }
         printf("okay\n");
     }
     else
@@ -3172,7 +3204,7 @@ int main(int argc, char **argv)
     printf("%-40s", "Testing vmovsd %xmm5,16(%ecx){%k3}...");
     memset(res, 0x88, 128);
     memset(res + 20, 0x77, 8);
-    if ( stack_exec && simd_check_avx512f() )
+    if ( stack_exec && simd_check_avx512f_sc() )
     {
         decl_insn(vmovsd_masked_to_mem);
 
@@ -3390,7 +3422,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing {evex} vmovd %xmm3,32(%ecx)...");
-    if ( stack_exec && simd_check_avx512f() )
+    if ( stack_exec && simd_check_avx512f_sc() )
     {
         decl_insn(evex_vmovd_to_mem);
 
@@ -3415,7 +3447,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing {evex} vmovd 32(%ecx),%xmm4...");
-    if ( stack_exec && simd_check_avx512f() )
+    if ( stack_exec && simd_check_avx512f_sc() )
     {
         decl_insn(evex_vmovd_from_mem);
 
@@ -3428,11 +3460,22 @@ int main(int argc, char **argv)
         rc = x86_emulate(&ctxt, &emulops);
         if ( rc != X86EMUL_OKAY || !check_eip(evex_vmovd_from_mem) )
             goto fail;
-        asm ( "vmovd %1, %%xmm0\n\t"
-              "vpcmpeqd %%zmm4, %%zmm0, %%k0\n\t"
-              "kmovw %%k0, %0" : "=r" (rc) : "m" (res[8]) );
-        if ( rc != 0xffff )
-            goto fail;
+        if ( simd_check_avx512f() )
+        {
+            asm ( "vmovd %1, %%xmm0\n\t"
+                  "vpcmpeqd %%zmm4, %%zmm0, %%k0\n\t"
+                  "kmovw %%k0, %0" : "=r" (rc) : "m" (res[8]) );
+            if ( rc != 0xffff )
+                goto fail;
+        }
+        else
+        {
+            asm ( "vmovd %1, %%xmm0\n\t"
+                  "vpcmpeqd %%xmm4, %%xmm0, %%k0\n\t"
+                  "kmovb %%k0, %0" : "=r" (rc) : "m" (res[8]) );
+            if ( rc != 0x0f )
+                goto fail;
+        }
         printf("okay\n");
     }
     else
@@ -3605,7 +3648,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing {evex} vmovd %xmm2,%ebx...");
-    if ( stack_exec && simd_check_avx512f() )
+    if ( stack_exec && simd_check_avx512f_sc() )
     {
         decl_insn(evex_vmovd_to_reg);
 
@@ -3631,7 +3674,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing {evex} vmovd %ebx,%xmm1...");
-    if ( stack_exec && simd_check_avx512f() )
+    if ( stack_exec && simd_check_avx512f_sc() )
     {
         decl_insn(evex_vmovd_from_reg);
 
@@ -3645,11 +3688,22 @@ int main(int argc, char **argv)
         rc = x86_emulate(&ctxt, &emulops);
         if ( (rc != X86EMUL_OKAY) || !check_eip(evex_vmovd_from_reg) )
             goto fail;
-        asm ( "vmovd %1, %%xmm0\n\t"
-              "vpcmpeqd %%zmm1, %%zmm0, %%k0\n\t"
-              "kmovw %%k0, %0" : "=r" (rc) : "m" (res[8]) );
-        if ( rc != 0xffff )
-            goto fail;
+        if ( simd_check_avx512f() )
+        {
+            asm ( "vmovd %1, %%xmm0\n\t"
+                  "vpcmpeqd %%zmm1, %%zmm0, %%k0\n\t"
+                  "kmovw %%k0, %0" : "=r" (rc) : "m" (res[8]) );
+            if ( rc != 0xffff )
+                goto fail;
+        }
+        else
+        {
+            asm ( "vmovd %1, %%xmm0\n\t"
+                  "vpcmpeqd %%xmm1, %%xmm0, %%k0\n\t"
+                  "kmovb %%k0, %0" : "=r" (rc) : "m" (res[8]) );
+            if ( rc != 0x0f )
+                goto fail;
+        }
         printf("okay\n");
     }
     else
@@ -3733,7 +3787,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing {evex} vmovq %xmm11,32(%ecx)...");
-    if ( stack_exec && simd_check_avx512f() )
+    if ( stack_exec && simd_check_avx512f_sc() )
     {
         decl_insn(evex_vmovq_to_mem2);
 
@@ -3823,7 +3877,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing vmovq %xmm22,%rbx...");
-    if ( stack_exec && simd_check_avx512f() )
+    if ( stack_exec && simd_check_avx512f_sc() )
     {
         decl_insn(evex_vmovq_to_reg);
 
@@ -5114,7 +5168,7 @@ int main(int argc, char **argv)
         printf("skipped\n");
 
     printf("%-40s", "Testing vmovsh 8(%ecx),%xmm5...");
-    if ( stack_exec && simd_check_avx512fp16() )
+    if ( stack_exec && simd_check_avx512fp16_sc() )
     {
         decl_insn(vmovsh_from_mem);
         decl_insn(vmovw_to_gpr);
@@ -5132,14 +5186,28 @@ int main(int argc, char **argv)
         rc = x86_emulate(&ctxt, &emulops);
         if ( (rc != X86EMUL_OKAY) || !check_eip(vmovsh_from_mem) )
             goto fail;
-        asm volatile ( "kmovw     %2, %%k1\n\t"
-                       "vmovdqu16 %1, %%zmm4%{%%k1%}%{z%}\n\t"
-                       "vpcmpeqw  %%zmm4, %%zmm5, %%k0\n\t"
-                       "kmovw     %%k0, %0"
-                       : "=g" (rc)
-                       : "m" (res[2]), "r" (1) );
-        if ( rc != 0xffff )
-            goto fail;
+        if ( simd_check_avx512fp16() )
+        {
+            asm volatile ( "kmovw     %2, %%k1\n\t"
+                           "vmovdqu16 %1, %%zmm4%{%%k1%}%{z%}\n\t"
+                           "vpcmpeqw  %%zmm4, %%zmm5, %%k0\n\t"
+                           "kmovw     %%k0, %0"
+                           : "=g" (rc)
+                           : "m" (res[2]), "r" (1) );
+            if ( rc != 0xffff )
+                goto fail;
+        }
+        else
+        {
+            asm volatile ( "kmovb     %2, %%k1\n\t"
+                           "vmovdqu16 %1, %%xmm4%{%%k1%}%{z%}\n\t"
+                           "vpcmpeqw  %%xmm4, %%xmm5, %%k0\n\t"
+                           "kmovb     %%k0, %0"
+                           : "=g" (rc)
+                           : "m" (res[2]), "r" (1) );
+            if ( rc != 0xff )
+                goto fail;
+        }
         printf("okay\n");
 
         printf("%-40s", "Testing vmovsh %xmm4,2(%eax){%k3}...");
--- a/tools/tests/x86_emulator/x86-emulate.c
+++ b/tools/tests/x86_emulator/x86-emulate.c
@@ -240,7 +240,7 @@ int emul_test_get_fpu(
             break;
     case X86EMUL_FPU_opmask:
     case X86EMUL_FPU_zmm:
-        if ( cpu_has_avx512f )
+        if ( cpu_has_avx512f || cpu_has_avx10_1 )
             break;
     default:
         return X86EMUL_UNHANDLEABLE;
--- a/tools/tests/x86_emulator/x86-emulate.h
+++ b/tools/tests/x86_emulator/x86-emulate.h
@@ -181,6 +181,12 @@ void wrpkru(unsigned int val);
 #define cpu_has_avx_vnni_int8 (cpu_policy.feat.avx_vnni_int8 && xcr0_mask(6))
 #define cpu_has_avx_ne_convert (cpu_policy.feat.avx_ne_convert && xcr0_mask(6))
 #define cpu_has_avx_vnni_int16 (cpu_policy.feat.avx_vnni_int16 && xcr0_mask(6))
+                           /* TBD: Is bit 6 (ZMM_Hi256) really needed here? */
+#define cpu_has_avx10_1    (cpu_policy.feat.avx10 && xcr0_mask(0xe6))
+#define cpu_has_avx10_1_256 (cpu_has_avx10_1 && \
+                             (cpu_policy.avx10.vsz256 || \
+                              cpu_policy.avx10.vsz512))
+#define cpu_has_avx10_1_512 (cpu_has_avx10_1 && cpu_policy.avx10.vsz512)
 
 #define cpu_has_xgetbv1   (cpu_has_xsave && cpu_policy.xstate.xgetbv1)
 



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 09:19:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 09:19:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777011.1187200 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seA9l-0006lH-B9; Wed, 14 Aug 2024 09:19:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777011.1187200; Wed, 14 Aug 2024 09:19:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seA9l-0006lA-8M; Wed, 14 Aug 2024 09:19:01 +0000
Received: by outflank-mailman (input) for mailman id 777011;
 Wed, 14 Aug 2024 09:19:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=xu2o=PN=bounce.vates.tech=bounce-md_30504962.66bc7680.v1-b8355132978a4a7087759d98b47c2ae2@srs-se1.protection.inumbo.net>)
 id 1seA9j-0006l4-Uq
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 09:19:00 +0000
Received: from mail135-13.atl141.mandrillapp.com
 (mail135-13.atl141.mandrillapp.com [198.2.135.13])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3c0be893-5a1e-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 11:18:58 +0200 (CEST)
Received: from pmta14.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail135-13.atl141.mandrillapp.com (Mailchimp) with ESMTP id
 4WkN3h3XVGzNCd90D
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 09:18:56 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 b8355132978a4a7087759d98b47c2ae2; Wed, 14 Aug 2024 09:18:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3c0be893-5a1e-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1723627136; x=1723887636;
	bh=Z4n6LJLCL+mJrXsNz9PY039uuwcbFos8lsyc9UNb5xE=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=S3HeCTfpG4gsCCTCNJoFCHFmJ7EWDScX7d5vPMlGOXLPpFn76adOsBLy+PRRvtyCj
	 iLRLlo9e9yQhqRUkOUu1ZNDNrjo+d37EfTLxQ++fX8OCpdVmlV4Oyk7X5OVppHU4cF
	 Uk0kqJ7QVFd5bkpVb12HZWKx2p+uWmI42PxykqgEsU9tfiLSANfU12eA/pOF3cHl/4
	 u1Q+yhpyoI3qCCglyiHuyMkvtF0l1ohm3CPEI+BntSwpNhYNi2fF9k6z7Jul1+J1H3
	 4FFWiY83mZHc24ceGjWXsVz+n9EzPa6PMn3HVDYb9qzGJy6M2A1IeTnSsU2TvDLWVM
	 PyGFaBClHbFLA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1723627136; x=1723887636; i=anthony.perard@vates.tech;
	bh=Z4n6LJLCL+mJrXsNz9PY039uuwcbFos8lsyc9UNb5xE=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=MiAXp8Yws5cDVpVfJfBIqtIiZ0zJL6yQRjWS2PJPrEsBh/ktuX8leZoEIGfDJ/1N+
	 x3DbmFz9BihrN/XZm5QGChWZnLRPIm6nCrTB4A6LXyVUuTdU0qK6KOM98WMsuBMPAY
	 NTGjqPv9aDaTzSI2UUor/VOH2um4gFbljhzvH8YbBsXzvg+24xK7vAwE4iQg7fv1lm
	 fMSIJAblVkS2gt2tb+S9lZDr4n6luLj9AvpfhXnbz55vZou/keQ5z/hF+exWOIgfWr
	 60Z5OAJKu+RIMhOFb4+pWjUgrcanT/nzEwHObgVl/v1gtEx3HJUALdECUatvtKWvw9
	 4S616xdVw40lw==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH]=20tools/helpers/init-dom0less:=20fix=20vcpu=20availability?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1723627135748
To: Amneesh Singh <a-singh21@ti.com>
Cc: xen-devel@lists.xenproject.org
Message-Id: <Zrx2f7Y2EXBKYThf@l14>
References: <20240802075823.116920-1-a-singh21@ti.com>
In-Reply-To: <20240802075823.116920-1-a-singh21@ti.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.b8355132978a4a7087759d98b47c2ae2?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240814:md
Date: Wed, 14 Aug 2024 09:18:56 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Hi Amneesh,

On Fri, Aug 02, 2024 at 01:28:25PM +0530, Amneesh Singh wrote:
> diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c
> index fee9345..a8cdc6d 100644
> --- a/tools/helpers/init-dom0less.c
> +++ b/tools/helpers/init-dom0less.c
> @@ -300,7 +301,7 @@ int main(int argc, char **argv)
>  {
>      libxl_dominfo *info = NULL;
>      libxl_ctx *ctx;
> -    int nb_vm = 0, rc = 0, i;
> +    int nb_vm = 0, nb_vcpu = 0, nr_cpus = 0, rc = 0, i;
>      struct xs_handle *xsh = NULL;
>      struct xc_interface_core *xch = NULL;
>      xenforeignmemory_handle *xfh = NULL;
> @@ -330,14 +331,17 @@ int main(int argc, char **argv)
>  
>      for (i = 0; i < nb_vm; i++) {
>          domid_t domid = info[i].domid;
> +        libxl_vcpuinfo *vcpuinfo;
>  
>          /* Don't need to check for Dom0 */
>          if (!domid)
>              continue;
>  
> +        vcpuinfo = libxl_list_vcpu(ctx, domid, &nb_vcpu, &nr_cpus);

You should check that libxl_list_vcpu() didn't return an error. If it
did, `vcpuinfo` would be NULL, and `nb_vcpu` would be an outdated value.


>          printf("Checking domid: %u\n", domid);
>          if (!domain_exists(xsh, domid)) {
> -            rc = init_domain(xsh, xch, xfh, &info[i]);
> +            rc = init_domain(xsh, xch, xfh, &info[i], vcpuinfo);
>              if (rc < 0) {
>                  fprintf(stderr, "init_domain failed.\n");
>                  goto out;
> @@ -345,6 +349,8 @@ int main(int argc, char **argv)
>          } else {
>              printf("Domain %u has already been initialized\n", domid);
>          }
> +
> +        libxl_vcpuinfo_list_free(vcpuinfo, nb_vcpu);
>      }
>  out:
>      libxl_dominfo_list_free(info, nb_vm);


The rest of the patch looks fine.

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 09:43:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 09:43:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777024.1187221 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seAXG-0003ol-B3; Wed, 14 Aug 2024 09:43:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777024.1187221; Wed, 14 Aug 2024 09:43:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seAXG-0003oe-5w; Wed, 14 Aug 2024 09:43:18 +0000
Received: by outflank-mailman (input) for mailman id 777024;
 Wed, 14 Aug 2024 09:43:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DSq6=PN=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1seAXF-0003ca-Fw
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 09:43:17 +0000
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on2060a.outbound.protection.outlook.com
 [2a01:111:f400:7e88::60a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a171d51f-5a21-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 11:43:16 +0200 (CEST)
Received: from SN7PR04CA0097.namprd04.prod.outlook.com (2603:10b6:806:122::12)
 by SJ2PR12MB7848.namprd12.prod.outlook.com (2603:10b6:a03:4ca::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.24; Wed, 14 Aug
 2024 09:43:12 +0000
Received: from SA2PEPF00003AE6.namprd02.prod.outlook.com
 (2603:10b6:806:122:cafe::f0) by SN7PR04CA0097.outlook.office365.com
 (2603:10b6:806:122::12) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.24 via Frontend
 Transport; Wed, 14 Aug 2024 09:43:12 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SA2PEPF00003AE6.mail.protection.outlook.com (10.167.248.6) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Wed, 14 Aug 2024 09:43:11 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 04:43:10 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 04:43:10 -0500
Received: from XIR-MICHALO-L1.xilinx.com (10.180.168.240) by
 SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39
 via Frontend Transport; Wed, 14 Aug 2024 04:43:09 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a171d51f-5a21-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=s0qpplCp1mi4XpRKzFq6WeIk9QJSrmHnTXHtWiq1moQhl5gxT16O2MNT05DCqc1x2muXbKmai86BevbC/av2YzARGezSDgDNU0Se5HGygUNumbpbMs4R5LiMMHmusHV3UjVCNPNGOXfJoa0yFnY2HMPwk23LBULrLWxW83d0gfPVdBn0Xm1KMFvKAv9Pb7pGJs+Y04M7EM9k9ku41XfAfLrrg9Ht60iK71+KBP2lEGXzLu2SjGfRQ27WDyxwirWOfZ5JIB2SatkZtYuyrsV+CbB6MNLWKZQzPYGuSa5fwvQymuzQ490Mm+vT15bUfQoWqKjuM7QmYSPiSIFrJ4R4KA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=orGz9J979LxEriGwI1+0fdMAD1Fr4iF2kav9HAlL6Qs=;
 b=tUPKdumYV4OpEnMeq++83RZhlmJmO2cgHr5Xkhdq1aYI9g2K9r1rTbIliSMwf130oSXYAzzUgIuIIpKYV9inpX2kAiLkTVSRuMjj8zxCaJcPWg5JBm6Vg7tHDouM7hkBKFJnzMbE5kLPiSGtOc4tgm63OvqU3U+ImJIWf4Xke7DYNoC8k9P9o6sryz5whvFlenQD9shRZTxE0LcfoH7xrt7QNSHYbbB16YNL71rp6/SaUGTr8lCDwOD28w8PrfheXbP3pZRn0eBlo8f44E8nFH/pROS/OS3okzVSITWmE045w+zSjozpw34vvHoFoXx7pZTOaKiJcvtVo3fYRwwumA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=orGz9J979LxEriGwI1+0fdMAD1Fr4iF2kav9HAlL6Qs=;
 b=aRUoEUY695z0czFU50zs1OT8u3NeMqek/m+vgRwKGw2OAIRcdsDw9hvgtJm5MIDa2DzJuNX7AKFL3WfnGke1fUGn2XohD6x/WNIV1Ci6I6eAWD3U7vIomld4L/w1FhDoXtD9zEsXgHH8vYoWI7cH4wDM+zjG0vR0gPvlwZ1UpUg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Michal Orzel <michal.orzel@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Michal Orzel <michal.orzel@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH 1/2] xen/arm: Drop {boot_}phys_offset usage
Date: Wed, 14 Aug 2024 11:43:02 +0200
Message-ID: <20240814094303.23611-2-michal.orzel@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240814094303.23611-1-michal.orzel@amd.com>
References: <20240814094303.23611-1-michal.orzel@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SA2PEPF00003AE6:EE_|SJ2PR12MB7848:EE_
X-MS-Office365-Filtering-Correlation-Id: c9c49482-f50c-4d68-7074-08dcbc4582ec
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?fE4ENF/VFDH3P8YrIJDMdYn6IZpYyw51jY5jmQjt8lU6ScQ5melR8Vdx7IQT?=
 =?us-ascii?Q?ymx5R1r1rXqUAu6PGBoPgICdO2RYMYkL4QNPh8glZw5g/JFBrEOvzHcxbK9a?=
 =?us-ascii?Q?sJd2yIrYtj3G2fk7a4Sy2MYqoGYZumpmkI0/xhamvhPx4UwPZiJZo+oTpx+7?=
 =?us-ascii?Q?aIgMjmmZGxzY5nEfYEM3tsDicvyX3p/c98YiAfIOAwfMjtO/lkqd6N/JyApA?=
 =?us-ascii?Q?MUo2OLVkT/fT2nWur9a77Z+i9XZ/cNRgM7zUIQRCTTxYa14/NTcDINb5dLRa?=
 =?us-ascii?Q?J6ay1ETbBB3vuJcbAC50odTU7BPnI6U5a58kP2eseJrIgCCpEl7ffY8lXWM+?=
 =?us-ascii?Q?c+2Z1gI5GzW1xR+G4cq+t06et8hcyS9IGqbRzP3R5LhgEf0t/LwEDEq9GMcz?=
 =?us-ascii?Q?MB1PV9j8+rLfQ5Ohcj0qaYDyaHGL1NehPIqseGVo1A3rI+39PHePDUVcF/ph?=
 =?us-ascii?Q?unpxxfzzZQluCFlo5mQUk53Ux+0gJtt2pL9wOj5UhEVnTQVmyGeh34HfiRDQ?=
 =?us-ascii?Q?xyGZXFy+4AcvznQTSnTzrS+ZfVrHCmgGFNNl37lpSA4TfPmTzgByE0hAxWZC?=
 =?us-ascii?Q?BDP2qZ6YFu9qDudKoG76SiiTUva1wqRkbxfMAnRTZouQXy4HQuiGy8XYcvr5?=
 =?us-ascii?Q?rJwx1w8gtGG0IcrPhxe6ZDDE2KdSsvLEL6IvxU4E9bOZ8s8I824Yp221jnYG?=
 =?us-ascii?Q?Re6gCTAUFaMqNyiRQr3mWxBry4YNp67F5ZaYEKty+jPY9g6/wNlzrnGjxeeZ?=
 =?us-ascii?Q?acsML01pISeJtczXDNV9QNlBlZWF2UAqNRFHxJnBWHrw0g27brTdgBUUqjdf?=
 =?us-ascii?Q?Vl/ciloo72FBenc7pLeuSgCDXhX+kRkHEDdiVd1EApxKRV5h4GR8wdmAEYwK?=
 =?us-ascii?Q?EN+1+hsvJfmblia2V7YvWvXAx+M/LpKb3R6K1bEj2BxFZj3LhMMMFFYMv9XQ?=
 =?us-ascii?Q?6hyj/texoZIrpECf40FCTK3An5i0kzWePAS29O1eS9WkXppr2WBxXZf71jpL?=
 =?us-ascii?Q?P+Txv6LCMkBtz2DWuwE5oOmOMJxlMDMWOaLFTSuoqrSmlWKrXVy8MNWrdVAv?=
 =?us-ascii?Q?L9rnSft4EwU2cEY3rSFm/JUsZxOHPfA863/5A54qN7s3S3liGvnYJEpW9qMx?=
 =?us-ascii?Q?Udt3liV4QJqWngzutcFmZOxTjvdPF/ermZ4Jgf1573k86ia2DHTVQ6wLW7dh?=
 =?us-ascii?Q?yNo/w9KWQI9FK0AJEqb95b9Rclz6MtlzY4yUUdF1++q3vQBdCYYj9aBtySZS?=
 =?us-ascii?Q?US0CaeSMWT/67jVrgyGj3yRcoct3dChkMVkIPiitB/bvACoF1lK/jGfGO84f?=
 =?us-ascii?Q?kmeGXQ0DOjMpiDDYnm/Wsp9ivicmUVp+BlByw686WOABp1sLsc0zS0dSa3ec?=
 =?us-ascii?Q?p9JGYJ8jaoFrkcuPgENdjSmu3Lg/0AqNFgo3wUjJebz2EjzM2w=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 09:43:11.4128
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: c9c49482-f50c-4d68-7074-08dcbc4582ec
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SA2PEPF00003AE6.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB7848

boot_phys_offset stores the physical offset (PA-VA), is calculated in
the startup head.S code and passed to start_xen() as a first argument.
There is no point in using it given that we can ask MMU to translate
a VA for us using e.g. virt_to_{mfn,maddr}. Drop usage of these
variables from the C world.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
It should also simplify the LLC coloring last patch:
https://lore.kernel.org/xen-devel/20240502165533.319988-14-carlo.nonato@minervasys.tech/
---
 xen/arch/arm/include/asm/mm.h |  2 +-
 xen/arch/arm/mmu/setup.c      | 16 ++++++----------
 xen/arch/arm/setup.c          |  2 +-
 3 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h
index f6ba611f01f7..5abd4b0d1c73 100644
--- a/xen/arch/arm/include/asm/mm.h
+++ b/xen/arch/arm/include/asm/mm.h
@@ -199,7 +199,7 @@ extern unsigned long frametable_base_pdx;
 #define PDX_GROUP_SHIFT SECOND_SHIFT
 
 /* Boot-time pagetable setup */
-extern void setup_pagetables(unsigned long boot_phys_offset);
+extern void setup_pagetables(void);
 /* Map FDT in boot pagetable */
 extern void *early_fdt_map(paddr_t fdt_paddr);
 /* Remove early mappings */
diff --git a/xen/arch/arm/mmu/setup.c b/xen/arch/arm/mmu/setup.c
index 57042ed57b4a..9664e85ee6c0 100644
--- a/xen/arch/arm/mmu/setup.c
+++ b/xen/arch/arm/mmu/setup.c
@@ -17,6 +17,8 @@
 /* Override macros from asm/page.h to make them work with mfn_t */
 #undef mfn_to_virt
 #define mfn_to_virt(mfn) __mfn_to_virt(mfn_x(mfn))
+#undef virt_to_mfn
+#define virt_to_mfn(va) _mfn(__virt_to_mfn(va))
 
 /* Main runtime page tables */
 
@@ -52,8 +54,6 @@ DEFINE_BOOT_PAGE_TABLE(xen_fixmap);
  */
 static DEFINE_PAGE_TABLES(xen_xenmap, XEN_NR_ENTRIES(2));
 
-static paddr_t phys_offset;
-
 /* Limits of the Xen heap */
 mfn_t directmap_mfn_start __read_mostly = INVALID_MFN_INITIALIZER;
 mfn_t directmap_mfn_end __read_mostly;
@@ -138,9 +138,7 @@ static void __init __maybe_unused build_assertions(void)
 
 lpae_t __init pte_of_xenaddr(vaddr_t va)
 {
-    paddr_t ma = va + phys_offset;
-
-    return mfn_to_xen_entry(maddr_to_mfn(ma), MT_NORMAL);
+    return mfn_to_xen_entry(virt_to_mfn(va), MT_NORMAL);
 }
 
 void * __init early_fdt_map(paddr_t fdt_paddr)
@@ -228,14 +226,12 @@ static void xen_pt_enforce_wnx(void)
  * Boot-time pagetable setup.
  * Changes here may need matching changes in head.S
  */
-void __init setup_pagetables(unsigned long boot_phys_offset)
+void __init setup_pagetables(void)
 {
     uint64_t ttbr;
     lpae_t pte, *p;
     int i;
 
-    phys_offset = boot_phys_offset;
-
     arch_setup_page_tables();
 
 #ifdef CONFIG_ARM_64
@@ -290,9 +286,9 @@ void __init setup_pagetables(unsigned long boot_phys_offset)
     xen_second[second_table_offset(FIXMAP_ADDR(0))] = pte;
 
 #ifdef CONFIG_ARM_64
-    ttbr = (uintptr_t) xen_pgtable + phys_offset;
+    ttbr = virt_to_maddr(xen_pgtable);
 #else
-    ttbr = (uintptr_t) cpu0_pgtable + phys_offset;
+    ttbr = virt_to_maddr(cpu0_pgtable);
 #endif
 
     switch_ttbr(ttbr);
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index cb2c0a16b824..cfe19e15b0be 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -304,7 +304,7 @@ void asmlinkage __init start_xen(unsigned long boot_phys_offset,
     /* Initialize traps early allow us to get backtrace when an error occurred */
     init_traps();
 
-    setup_pagetables(boot_phys_offset);
+    setup_pagetables();
 
     smp_clear_cpu_maps();
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 09:43:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 09:43:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777023.1187209 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seAXF-0003aZ-2g; Wed, 14 Aug 2024 09:43:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777023.1187209; Wed, 14 Aug 2024 09:43:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seAXE-0003aS-WF; Wed, 14 Aug 2024 09:43:17 +0000
Received: by outflank-mailman (input) for mailman id 777023;
 Wed, 14 Aug 2024 09:43:16 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DSq6=PN=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1seAXE-0003aM-5R
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 09:43:16 +0000
Received: from NAM10-BN7-obe.outbound.protection.outlook.com
 (mail-bn7nam10on20609.outbound.protection.outlook.com
 [2a01:111:f403:2009::609])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9f84727e-5a21-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 11:43:13 +0200 (CEST)
Received: from CH0PR03CA0102.namprd03.prod.outlook.com (2603:10b6:610:cd::17)
 by MN2PR12MB4487.namprd12.prod.outlook.com (2603:10b6:208:264::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.24; Wed, 14 Aug
 2024 09:43:10 +0000
Received: from CH1PEPF0000AD7A.namprd04.prod.outlook.com
 (2603:10b6:610:cd:cafe::bd) by CH0PR03CA0102.outlook.office365.com
 (2603:10b6:610:cd::17) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.33 via Frontend
 Transport; Wed, 14 Aug 2024 09:43:10 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CH1PEPF0000AD7A.mail.protection.outlook.com (10.167.244.59) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Wed, 14 Aug 2024 09:43:09 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 04:43:09 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 04:43:08 -0500
Received: from XIR-MICHALO-L1.xilinx.com (10.180.168.240) by
 SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39
 via Frontend Transport; Wed, 14 Aug 2024 04:43:07 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9f84727e-5a21-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ZuodEWA1N1VBPHTM+lV6ixtdDXfPrcsSi6URCj+Cve8OV/5XznKbu5tBmd4ZCi2QjuB3nw8yo2HrLSdXM0Y6CvPtc1RYJlVDyEF8IXiyJ63utwgdtVUS2yBsXoNKMhd6Qu3TSut0RPVrwVHC6Kq6B1RgVdpKrM/ZoLCbmobKereo3ruylsLLc052QN/aJ6YFkwBE7BstIiS5Nm9g+0jAVlCLuhA7a6dh9DpXlM2OexzZDGZsgK9uZ4fZxQ7gIeeWDKHOhr+gAPm5KE2V0uOdOKTYqTu9F6uMi8NhdSD2G8/ZdXnbpAjDNzI8ZkhcQupTY0bArPBXfd40wT7W92x0nQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=uos8zMu1BmcwVbRQ0zFt1JSjeMAYJea2OU/jPcTq+Hs=;
 b=QM0p3EWyZxprH9UvhEEak0Rkwm/vbseMITzBnDtS7hN+H8atdlAWUI5IcnobWWBDJVApzEzsv0HlVgOkrJtofAFWerWC/8lmkxZWiSY69iSidxnY7b24FQ/VLZX9tA+mtFrCcWr+OZFk1wtoBBoHNekXp2j/9GDPTqlpfLnVLj+Uod7M0As4wcHw09QTBbyChiY/wLq/3q9wxX2Pgu/92BuqSRCrP6RiymytQ4n27aFN/pN9MiBqlURxDD/6UsSTR3SlKiq3KwS73niAAzpi6WJ2qcUToUgYDu1apeYSGwYHsslaR+5W036x8kpjHLLnPZqp33psFlwOrtMJQGLDiA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=uos8zMu1BmcwVbRQ0zFt1JSjeMAYJea2OU/jPcTq+Hs=;
 b=giFMDy+60DzTf1F7Ixs3+DUJnxQfsmlrnd5AzayW9F+nx+FiaW3LVxSiD7tP6AlERiZaDx7Xqg16yzHP2x6Rq0yGdLbHIA/n2AKTq3nCN5p1fBNQbEB/S2khNCbY4zjb0WXNy6qAgvKZPSbDrEPjlC7JHUK0LhdyWvt1xCbFKZ4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Michal Orzel <michal.orzel@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Michal Orzel <michal.orzel@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH 0/2] xen/arm: drop {boot_}phys_offset
Date: Wed, 14 Aug 2024 11:43:01 +0200
Message-ID: <20240814094303.23611-1-michal.orzel@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD7A:EE_|MN2PR12MB4487:EE_
X-MS-Office365-Filtering-Correlation-Id: 151a9787-73f7-4c2e-f33d-08dcbc4581f7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?abFsuiYVN//kwXBVUswm/oFGcvtr5ACZ5+N7M6l7GsaKaetPtGimFTkCrzKv?=
 =?us-ascii?Q?z9H74S5j2fHB857cGfT2jcDCX3f9OSLzBSRs0MTFqHYFYfJqZyZJnfxbmdj4?=
 =?us-ascii?Q?rHvrYIee/mDYpW88elaG8dtNgAoUSQsoYeS2+nDnA+WMDMK+/mbdIUoJiG9c?=
 =?us-ascii?Q?WFYRmSb5FLgeHJ5Emjx+FNOWwwevDsWtxeQXbT3RZ0VByxwtCJ9WNc2HQiPB?=
 =?us-ascii?Q?dfqJvj06Suw1ZboQGQ3muSZv1KKauGhsLU6CtKRHsKMP72M1gWEr5ucuuoSo?=
 =?us-ascii?Q?iSitNmE4PHuD9vw5Ywr+jGRWDzp1Rzs5iLmdN9h5sOqcO0AY4js3mcMwEmCN?=
 =?us-ascii?Q?8YVAYTVLIzjyeFQ9Vdcj75Pz8GeBwUkDghmdrmyOuj6e35m8LPf2EX2GXno6?=
 =?us-ascii?Q?gXhABFwIED6MtUSx5l+/zq4szmpBBkuzuB5TBPnSh8C1yF38Ov622H/uGgTJ?=
 =?us-ascii?Q?67bjY5ReDsNwyND0pGosVz6vMICkjRaPHaEpfIufgfSnFQQlCX7+kSsNReXn?=
 =?us-ascii?Q?ITSmm5RKk+YqOSlMrS9+WKlzQ3p4S6XvbOCGFBzkPq/NtOMob3HC1FMR3q6k?=
 =?us-ascii?Q?lYDQzlBfvrVS/z8yjjm3kt98yd//0cVI2svlM28TkE4qGUPREICSnjR9gvj7?=
 =?us-ascii?Q?FQVA6GAwhlZPMnLIEtLdQ4LL86eY5xk3/PY7m4XBvUt53Q2vM5nJH1yFX6dh?=
 =?us-ascii?Q?xXgnZjbG+oqJU9A9N76gjAXwAeNtpenaZKsGe2KO/k1uG1mt8QUv6z2jhtSE?=
 =?us-ascii?Q?OHeQ5IpAVdpL0GM+sxdfQOxU1unkKozgGsBFSp0rnFODgfEtuQ0u9ivIM1Dt?=
 =?us-ascii?Q?gsirG5IJSjr2xeKKDDc8iYMGaMOFGnAqcWBmuL6i+7jL3mGbclBNh1tkZLMY?=
 =?us-ascii?Q?OeuLURVzWoxeSPyWnXi7ldcmT41tn5o5kevNDFeJEd2vpYjkMVDkM9sZ0g1a?=
 =?us-ascii?Q?Ym8Dxxtw3AY3T1alASFzEzM5XsZiyOokdVOyUKdd4OCWgf20wxBZ8MmuauyW?=
 =?us-ascii?Q?u2dfVqjCc1GeSgD0Pka791yP2vXEAECTvSXPhcKLF+rwj6YyRnld16LmRVTN?=
 =?us-ascii?Q?EIu/Rz9mwDxEhNnQtXr7lKohOUo5WCfEB3nnDI2iAN4NqEqg9D5rWSRYV/y2?=
 =?us-ascii?Q?ZsFf4C4S/pJ++krhd9fAFezEGWNmg9nvpepyad4B75vwSNIOyzDfnhPniiCh?=
 =?us-ascii?Q?XzRVIF572/GjVoFfyXVnU0821q6XiIuKjnRu2vUbQpNcdqKGpWG825PvQnGX?=
 =?us-ascii?Q?wWp8entfQDzwO16NcnUiAWbjMkftrfFYDnxz3AlK0y27tFIwqLIzztSyZ0RS?=
 =?us-ascii?Q?NAq0xVXrUvpmTvLKH0xdVjz9/75twrFqRQ97dbKIYrCp9A2GPrSITN3JXG68?=
 =?us-ascii?Q?XJ6hbRFvJacHcCUxr+pPB7p28hX6WewjiaI1yjNGtmycRVH8hvntmx3o2z1s?=
 =?us-ascii?Q?TTYzLTuP12f/abfPfBDbaZ5ubLHXj+hb?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 09:43:09.8106
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 151a9787-73f7-4c2e-f33d-08dcbc4581f7
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH1PEPF0000AD7A.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4487

This has been on a TODO list for quite some time now. There is no real need
for these variables since we can ask the MMU to do the virt->maddr translation.

Michal Orzel (2):
  xen/arm: Drop {boot_}phys_offset usage
  xen/arm: head: Do not pass physical offset to start_xen

 xen/arch/arm/arm32/head.S     | 12 +++++-------
 xen/arch/arm/arm64/head.S     | 12 +++++-------
 xen/arch/arm/include/asm/mm.h |  2 +-
 xen/arch/arm/mmu/setup.c      | 16 ++++++----------
 xen/arch/arm/setup.c          |  5 ++---
 5 files changed, 19 insertions(+), 28 deletions(-)

-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 09:43:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 09:43:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777025.1187231 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seAXI-00043c-Hy; Wed, 14 Aug 2024 09:43:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777025.1187231; Wed, 14 Aug 2024 09:43:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seAXI-00043V-D1; Wed, 14 Aug 2024 09:43:20 +0000
Received: by outflank-mailman (input) for mailman id 777025;
 Wed, 14 Aug 2024 09:43:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DSq6=PN=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1seAXH-0003ca-80
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 09:43:19 +0000
Received: from NAM04-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam04on20600.outbound.protection.outlook.com
 [2a01:111:f403:2409::600])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a2e36b3b-5a21-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 11:43:18 +0200 (CEST)
Received: from CH0PR03CA0019.namprd03.prod.outlook.com (2603:10b6:610:b0::24)
 by DM4PR12MB6182.namprd12.prod.outlook.com (2603:10b6:8:a8::15) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Wed, 14 Aug
 2024 09:43:13 +0000
Received: from CH1PEPF0000AD74.namprd04.prod.outlook.com
 (2603:10b6:610:b0:cafe::82) by CH0PR03CA0019.outlook.office365.com
 (2603:10b6:610:b0::24) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.33 via Frontend
 Transport; Wed, 14 Aug 2024 09:43:13 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CH1PEPF0000AD74.mail.protection.outlook.com (10.167.244.52) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Wed, 14 Aug 2024 09:43:12 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 04:43:12 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 04:43:12 -0500
Received: from XIR-MICHALO-L1.xilinx.com (10.180.168.240) by
 SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39
 via Frontend Transport; Wed, 14 Aug 2024 04:43:10 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a2e36b3b-5a21-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=dWOqeU1nAq+2cvtQX5tRnE/zITUXXT2NzSLWFyMqhBXe1GCrD5HZDgXPe4wjwPWMQlSwcV600B/NsNo7qsWtcW8PYujwpOX+Yo6eR0gK8SAdUm7r0eTVStzraLSZKMr8f69v/VtELxO3oaRXKwZKzkQ6IBMzFJjZ8c9hbMY/FJgGYBsy6n0B9L0LyNsWS5tdjkze7IhuvCYzKiyoOPvnRc86yMbomgH5iQeDbgqcC5nbT410hjBNU1h6Rmr/PqvodN9EsXivHpucLBFi+MKT6eqY0YlxB/vl7+Tovd7fBA/4ce+WrQZmOJqqPTcVU6SrinVPdlgLbVjfDz440dSfww==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/KSw71JxdXit9FabNCWRoEsweJcGEQpXx+neZF5JHpw=;
 b=wk/BisZmXFd1rRG5KLiRA03+9ryeUeN6+mMudxeAqf4OxkW5GaWymoZAVbEGwwG6fi1eBaejCgSRXFf7267fRRqbyu6vmF/TwAMCIYBi1e1AYQ0wYNUmKe4vKN+7P/u/Ll8enuz1TWbYhIBjsxMRAtcBFMoM7tqQCadJg65LyypBejasgiLOhjMMmTxM/0h7jH0jUEMpEcQhtCFDjJ7ZUGvQYkB1EO8j8RnWVNsya7SuCQ5ZJhILND3Wp+W5JC1fQwYFD+giH3SEblReUMn2cQjbNCgBIte0YYDw7JH8SYDVlAG/Vhwu/jKYqshfIGQHmh2yLWmvAruRcQ5lUPZc6Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/KSw71JxdXit9FabNCWRoEsweJcGEQpXx+neZF5JHpw=;
 b=Fq/redV3mqWGjtlIjb1g+BSnJwgAZyZioPMZ0CrppCZzUb7a1fpLcZDlGOly8pMIgXXnMYJgYOCJzu7eNQIgzFqdiQHatPENQjgVotGJfULgrD9g4lrmP+ubwwW+kbabIeUWyRC6+RDmrbOD9wXlE/sabikN0c4JzY6G0SEzVYk=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Michal Orzel <michal.orzel@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Michal Orzel <michal.orzel@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH 2/2] xen/arm: head: Do not pass physical offset to start_xen
Date: Wed, 14 Aug 2024 11:43:03 +0200
Message-ID: <20240814094303.23611-3-michal.orzel@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240814094303.23611-1-michal.orzel@amd.com>
References: <20240814094303.23611-1-michal.orzel@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD74:EE_|DM4PR12MB6182:EE_
X-MS-Office365-Filtering-Correlation-Id: ee0edfc1-42ce-494b-15ec-08dcbc4583d4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?Jo4kmQBdWLqLq/OQ8nOBkZtPFo78CRZyRkahpHOnONZrd7jVaSBeG6uC/+M8?=
 =?us-ascii?Q?HhZkeO3FMzqUk0VPFXaaqA24ivELb/2pq1Wb0/mlynKg6HXiEIyciIMnJiPE?=
 =?us-ascii?Q?MWVTtFdx01NAYUI/PCpZHT6dAtDW2BUR1T+v9pUVG7ssk3gSokFtUWaMlhhi?=
 =?us-ascii?Q?hIAQDviejcPaAp8e4k8YYs5Ds5OeNl4Iev4B9ZE2rOQ0asawnX9MqPBmr7H/?=
 =?us-ascii?Q?lvy7w66c26deRJ21kSrW7wT+BU/2g3ZkkrVW6YPKwSXuaaqa44PUxc9e65QZ?=
 =?us-ascii?Q?GBfjZcWOcK2q3N8RT/LP4XVY1t1Xha9EpNA3GXvuxgMsRVMtb92r/yjG7cVO?=
 =?us-ascii?Q?s4OXzasRxoKslDBfKBEHnejlvM6YHnCUzC+GVB9Q+2/6/UeZDcujyQpj/fe5?=
 =?us-ascii?Q?Uft9yWhTRemnpHNmBCJ3gZGtf3B9mtSyeg5WBLN/cqonP/NFQftO1QE76u1p?=
 =?us-ascii?Q?AQ6se16GT6pL513INB+vKMUFge1cz3V22s3ENbRc0Unge8e7YV/1RhCcdkTt?=
 =?us-ascii?Q?ghDvx/vTYLwHx6lCcE2lbk65lT2x9GoUHoiEldYe7U6w5Wt8gYg7cJh03Exu?=
 =?us-ascii?Q?rzhGNO6r0QwDNQFLlxo5Y76o/SddqSWcZPnhp7UJPsJ6JtydnCY7Dwwc3NrB?=
 =?us-ascii?Q?+zPZjhijtIBVcoR5ST3yAF3pPysbUBJ0MtqH+YhMAmuPWhh/Nqy/3EQucaM1?=
 =?us-ascii?Q?RtgZB6KH8PntlBGK5VUC1mhtVcQsmqs8eEc3QlSAqNcqCzFC8Vhgam8dl+g5?=
 =?us-ascii?Q?7g9uL5MKkbJW7gfJNR9tTzRk2+4DdlrnpTkn+Cpp/LAKLl1Tl48iCpGt/QmZ?=
 =?us-ascii?Q?7QFknugGqKkjlZf/Jg7cRzMQiFMpyRvDClZBN2baqCrqFjoKtxpjdUxK3Z+K?=
 =?us-ascii?Q?M0RWyBKKijSYkYQziSjql1j/TtrxO5gWwyM8lLSBVYMMILman/HeLLK0rLFM?=
 =?us-ascii?Q?NdrZg/8mXDH5NyPXQ7aFpxBEl562tUqFfBHoZOEL3i1G4XL0IL6Vskpbvsut?=
 =?us-ascii?Q?n1F1lYDV5JC+WUXVkSP1an61nAcFh8dfU+yC3SPBGsCpE6+ufj6dJdtgBBW/?=
 =?us-ascii?Q?5f7nH8U4aGNgFT3/lTfnun/t5XA4//hdWQTdK8Pt0+er7MCYo4BSpfdqGoBT?=
 =?us-ascii?Q?ftAbkw4G0LLUoqPbukoSTxCByTmp8czrX0Pp/4nVeV1wGHUu04/W0xthZkLq?=
 =?us-ascii?Q?qaAtjsjK+2r+vUF7k9l8e7zbv9b2hg+0SEBf5fmRQdL4DFifTrk/vX93aUzZ?=
 =?us-ascii?Q?cAftUSKBA0foa1uJNh1jhQJO4lchljLj4Fh2m/l2TBLfRgqhrrr2fJx+8Cpd?=
 =?us-ascii?Q?e+CdK8uyqtI+9UJG+RKsV6mTtjSH47SZJGkV1do6DZFvWUUAWIDPrZkB4uFG?=
 =?us-ascii?Q?37BJ5Zqcg8TWo57Pr8JYxYYMveLxzzbxTRtN/BMEDeX2DVUMdfvzQ+j3lZqx?=
 =?us-ascii?Q?OGOMKZrRJr/OZ62mitz73su76EwmEM4w?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 09:43:12.9466
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ee0edfc1-42ce-494b-15ec-08dcbc4583d4
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH1PEPF0000AD74.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6182

Given no further use in C world of boot_phys_offset, drop it from the
argument list of start_xen() and do the necessary changes in the startup
code head.S (most notably modifying launch not to expect 2 arguments to
pass to C entry point).

Both on arm64 and arm32, phys offset (stored in x20 or r10 respectively)
is still needed, so that it can be used in e.g. create_table_entry,
therefore keep it on the list of common register usage.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/arm32/head.S | 12 +++++-------
 xen/arch/arm/arm64/head.S | 12 +++++-------
 xen/arch/arm/setup.c      |  3 +--
 3 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S
index b488a21a71ba..a96d5d35038f 100644
--- a/xen/arch/arm/arm32/head.S
+++ b/xen/arch/arm/arm32/head.S
@@ -101,9 +101,8 @@ primary_switched:
         bl    zero_bss
         PRINT("- Ready -\r\n")
         /* Setup the arguments for start_xen and jump to C world */
-        mov   r0, r10                /* r0 := Physical offset */
-        mov   r1, r8                 /* r1 := paddr(FDT) */
-        mov_w r2, start_xen
+        mov   r0, r8                 /* r0 := paddr(FDT) */
+        mov_w r1, start_xen
         b     launch
 ENDPROC(start)
 
@@ -141,7 +140,7 @@ GLOBAL(init_secondary)
 secondary_switched:
         PRINT("- Ready -\r\n")
         /* Jump to C world */
-        mov_w r2, start_secondary
+        mov_w r1, start_secondary
         b     launch
 ENDPROC(init_secondary)
 
@@ -243,8 +242,7 @@ ENDPROC(cpu_init)
  *
  * Inputs:
  *   r0 : Argument 0 of the C function to call
- *   r1 : Argument 1 of the C function to call
- *   r2 : C entry point
+ *   r1 : C entry point
  *
  * Clobbers r3
  */
@@ -256,7 +254,7 @@ launch:
         sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
 
         /* Jump to C world */
-       bx    r2
+       bx    r1
 ENDPROC(launch)
 
 /* Fail-stop */
diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S
index 2fa07dc3a04b..14c3720d80f8 100644
--- a/xen/arch/arm/arm64/head.S
+++ b/xen/arch/arm/arm64/head.S
@@ -260,9 +260,8 @@ primary_switched:
         bl    zero_bss
         PRINT("- Ready -\r\n")
         /* Setup the arguments for start_xen and jump to C world */
-        mov   x0, x20                /* x0 := Physical offset */
-        mov   x1, x21                /* x1 := paddr(FDT) */
-        ldr   x2, =start_xen
+        mov   x0, x21                /* x0 := paddr(FDT) */
+        ldr   x1, =start_xen
         b     launch
 END(real_start)
 
@@ -303,7 +302,7 @@ FUNC(init_secondary)
 secondary_switched:
         PRINT("- Ready -\r\n")
         /* Jump to C world */
-        ldr   x2, =start_secondary
+        ldr   x1, =start_secondary
         b     launch
 END(init_secondary)
 
@@ -407,8 +406,7 @@ END(cpu_init)
  *
  * Inputs:
  *   x0 : Argument 0 of the C function to call
- *   x1 : Argument 1 of the C function to call
- *   x2 : C entry point
+ *   x1 : C entry point
  *
  * Clobbers x3
  */
@@ -421,7 +419,7 @@ FUNC_LOCAL(launch)
         mov   sp, x3
 
         /* Jump to C world */
-        br    x2
+        br    x1
 END(launch)
 
 /* Fail-stop */
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index cfe19e15b0be..961d3ea6700b 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -287,8 +287,7 @@ void __init init_pdx(void)
 size_t __read_mostly dcache_line_bytes;
 
 /* C entry point for boot CPU */
-void asmlinkage __init start_xen(unsigned long boot_phys_offset,
-                                 unsigned long fdt_paddr)
+void asmlinkage __init start_xen(unsigned long fdt_paddr)
 {
     size_t fdt_size;
     const char *cmdline;
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 09:47:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 09:47:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777047.1187240 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seAbU-0006Ex-7X; Wed, 14 Aug 2024 09:47:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777047.1187240; Wed, 14 Aug 2024 09:47:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seAbU-0006Eq-3R; Wed, 14 Aug 2024 09:47:40 +0000
Received: by outflank-mailman (input) for mailman id 777047;
 Wed, 14 Aug 2024 09:47:38 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seAbS-0006EU-Eu
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 09:47:38 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3c7cb5e8-5a22-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 11:47:36 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a7a9cf7d3f3so748596966b.1
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 02:47:36 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f3fafb6csm151261066b.75.2024.08.14.02.47.35
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 02:47:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3c7cb5e8-5a22-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723628856; x=1724233656; 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=tEWrG0yJSV0lsbIWcLYAH6LHncjvBTeQVVMZSuHvuX4=;
        b=Yp2ftz1runx9pppgUSAz9I3XGC1q6ugs3eulkrwqWdrc5NeAaRK+EyGbsnZeJ0RpEa
         N8aicBWFD43ORQ6ZIp4VY+Ze5PHNj0AFwJx5zCxBSSBj5ub4lHhZK8fpitRZCy9LARWZ
         7RqQZe/dWsNIjv5HnM4lBPJaP9oE00UoAOcLHmMXtXqe7gqvQq/bvryyZS3mOLDj5xqK
         CpfmvmVi41apLdp1Sk44PWvNyJhZCQ7MUzspvfT0eNWpEm22j6JWDpqvoUO3QCLS/rV4
         n4t88X3uxShqE6Le1c9lylBijdrc//M8qE7gDmTtCP3RhhcemJcoEbJlrrBL9fALgp4f
         CS9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723628856; x=1724233656;
        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=tEWrG0yJSV0lsbIWcLYAH6LHncjvBTeQVVMZSuHvuX4=;
        b=Nyk0krclBBkZbCNxXmjYAFcj1o9xLanjf1uKIhpxFXRsDuOQEglrlM2N8eEkl6guYh
         u6Xthu33OSHHaYWtjsEJfpIoGSPdwaSDhONjIVIvV/rMeeQTpnvWpeyq5hZzAqj1wD+o
         M0UwknPPN3dx2Cd3Swey4Ugp5CLdyCOZPvzj5Ei0q0aS8vaJvPUuTNBV3DmrnEAKR/5m
         c/qKh3f7G3T0w8doOaKuUxru9bYhTigM+RXG9c6XDJkBs3IgqtU3YqGdSQq12kWFH1iu
         clLKGNbC6d1c1ISTUBPLW+7BOTf1JBlLrHyyTB3nNK/8e6tUOatkapql+Mpmkz8gMPza
         CMdQ==
X-Forwarded-Encrypted: i=1; AJvYcCUrhkdvDF122DToGVGQKNGu1qBgEgtrm3rk6By270O2urhTYKI1rKzEwB/yKOZyhuyH8kACoQ5Ze58YX0xk1KAoy3Qt7ht899pIdFJR7eM=
X-Gm-Message-State: AOJu0Yx9bRjEJusM7VGGEY8M+mdZGmGIon+k2FZv/b/WuyJHRz+ZBnDo
	nHgsAsz9S2KlUhISkCkCSM7QNUjjhoQSVdoGWA3ASpLA08M2uV3gcrNr7DiWqA==
X-Google-Smtp-Source: AGHT+IFmdNh0QU2C7A6lIprrBYYYs+pt0Xq11izAErFR+U+shXYdMK2Ft/CDWSfyIHV/Zh+135D8IQ==
X-Received: by 2002:a17:907:d3dd:b0:a7a:a06b:eecd with SMTP id a640c23a62f3a-a8366c388f2mr156741666b.5.1723628855628;
        Wed, 14 Aug 2024 02:47:35 -0700 (PDT)
Message-ID: <a4294b19-8b5b-47cf-8d64-431757b696e0@suse.com>
Date: Wed, 14 Aug 2024 11:47:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 07/22] x86/spec-ctrl: initialize per-domain XPTI in
 spec_ctrl_init_domain()
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: alejandro.vallejo@cloud.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20240726152206.28411-1-roger.pau@citrix.com>
 <20240726152206.28411-8-roger.pau@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240726152206.28411-8-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 26.07.2024 17:21, Roger Pau Monne wrote:
> XPTI being a speculation mitigation feels better to be initialized in
> spec_ctrl_init_domain().
> 
> No functional change intended, although the call to spec_ctrl_init_domain() in
> arch_domain_create() needs to be moved ahead of pv_domain_initialise() for
> d->->arch.pv.xpti to be correctly set.
> 
> Move it ahead of most of the initialization functions, since
> spec_ctrl_init_domain() doesn't depend on any member in the struct domain being
> set.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Wed Aug 14 10:11:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 10:11:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777057.1187250 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seAy3-000350-VZ; Wed, 14 Aug 2024 10:10:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777057.1187250; Wed, 14 Aug 2024 10:10:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seAy3-00034t-SZ; Wed, 14 Aug 2024 10:10:59 +0000
Received: by outflank-mailman (input) for mailman id 777057;
 Wed, 14 Aug 2024 10:10: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=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seAy3-00034n-C5
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 10:10:59 +0000
Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com
 [2a00:1450:4864:20::22c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 802eec8b-5a25-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 12:10:58 +0200 (CEST)
Received: by mail-lj1-x22c.google.com with SMTP id
 38308e7fff4ca-2f16d2f2b68so90807951fa.3
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 03:10:58 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f411b456sm153539966b.110.2024.08.14.03.10.56
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 03:10:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 802eec8b-5a25-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723630258; x=1724235058; 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=K+FH+YWHbPk3t/NqchlDj/yfYjS42TFfSK9xdeXyxDY=;
        b=IJJ2n4Z7vcZKXgatqIc+U+/Xzxjb2vv3eJBQ9GTZ7u0TmDsXkEzRKIf/fIJuwCKIiO
         XpgcAbtFf8M8VhMmvC4k+S7wMwRdXQL+z9W3miVJPU0bya9E70CVfFadik1IPWulUJef
         8QATD/UvZbc2rRaS8CPnquanh2X+i7x89MpN4Np9eIDQgG1Bw45CHg5e2tGBr9H2K2hp
         F25bPHqttw/0bwTbJNuK26lpgHNFq5oj7fOCkuy8F8luJaK09VUQb0Qm91eQu8Azo7NU
         XwhL1k6OFJdR6Tq5S1oIvplM82ED6nUwDJYyfGM86cO5VIelNiXlyJR+daFyZtolKjmH
         v6rg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723630258; x=1724235058;
        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=K+FH+YWHbPk3t/NqchlDj/yfYjS42TFfSK9xdeXyxDY=;
        b=feFHCPd6uOJOPLP7a4ZXB86b/DubW5pAKAj+HmVTCJBC/N+nUW19wBdh2M9MwLAkAR
         alwWYbTeSZRelynrj5t+04i67yPDaAKVUHYfEWId1wTu0Rulk8lYV2vbHAI2OZ8fg2KU
         8hy73hIMN9mJLLZXgFhEx+NsSRK721u1gQxqCN23p+JWqsqi2T0jF+vokpYQN3erOYL7
         0RKeT1bFAVVutm8NeDBHC4dyb/TzBLzittJuEMedZ/ULKDxtUPKc6FQXdv14r/UlK2zn
         DIi4YGcIlmV6iVXcbHhYcz+D6htlhF88vZ+jfso2s0djyGrttHDn/SSIgTbVeqnNuwjX
         Gsqw==
X-Forwarded-Encrypted: i=1; AJvYcCVQdkjeRZpy81wHI6ufqM7E1wARuC7drlLXCWnVAHXRTAtHAHSWr01eKSSoWfCPFB08gqSlNoDXDg/NL2bmcqA9MldBAkUgclR3QXiqCrY=
X-Gm-Message-State: AOJu0Yw3QoSgbJJ2AbY487Y/c15RLPIAhKutz5s3XJA5I7KPVJ0csTir
	UcYv13IZVKFcLXjmHhBYfhAhrLTIUzVqIY1p6N1U8vHdcJqpBX/ReIryzc9CV2yd56vj1m5xSsI
	=
X-Google-Smtp-Source: AGHT+IGz94GaoyjhQ0pPklHMoDjde16ZqwINZ/t3wanl65xBFh/ZjSD1shNTfZwR1Y/QUBRTRJ4KLA==
X-Received: by 2002:a2e:f1a:0:b0:2ef:c8a1:ff4 with SMTP id 38308e7fff4ca-2f3aa1d8149mr17552051fa.7.1723630257470;
        Wed, 14 Aug 2024 03:10:57 -0700 (PDT)
Message-ID: <c30b14a4-3fb2-4e2f-bdcc-81f587540811@suse.com>
Date: Wed, 14 Aug 2024 12:10:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 12/22] x86/spec-ctrl: introduce Address Space Isolation
 command line option
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: alejandro.vallejo@cloud.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <20240726152206.28411-1-roger.pau@citrix.com>
 <20240726152206.28411-13-roger.pau@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240726152206.28411-13-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 26.07.2024 17:21, Roger Pau Monne wrote:
> --- a/docs/misc/xen-command-line.pandoc
> +++ b/docs/misc/xen-command-line.pandoc
> @@ -2387,7 +2387,7 @@ By default SSBD will be mitigated at runtime (i.e `ssbd=runtime`).
>  
>  ### spec-ctrl (x86)
>  > `= List of [ <bool>, xen=<bool>, {pv,hvm}=<bool>,
> ->              {msr-sc,rsb,verw,{ibpb,bhb}-entry}=<bool>|{pv,hvm}=<bool>,
> +>              {msr-sc,rsb,verw,{ibpb,bhb}-entry,asi}=<bool>|{pv,hvm}=<bool>,

Is it really appropriate to hide this underneath an x86-only option? Even
of other architectures won't support it right away, they surely will want
to down the road? In which case making as much of this common right away
is probably the best we can do. This goes along with the question whether,
like e.g. "xpti", this should be a top-level option.

> @@ -2414,10 +2414,10 @@ in place for guests to use.
>  
>  Use of a positive boolean value for either of these options is invalid.
>  
> -The `pv=`, `hvm=`, `msr-sc=`, `rsb=`, `verw=`, `ibpb-entry=` and `bhb-entry=`
> -options offer fine grained control over the primitives by Xen.  These impact
> -Xen's ability to protect itself, and/or Xen's ability to virtualise support
> -for guests to use.
> +The `pv=`, `hvm=`, `msr-sc=`, `rsb=`, `verw=`, `ibpb-entry=`, `bhb-entry=` and
> +`asi=` options offer fine grained control over the primitives by Xen.  These

Here, ahead of "by Xen", it looks like "used" was missing. Maybe a good
opportunity to add it?

> @@ -2449,6 +2449,11 @@ for guests to use.
>    is not available (see `bhi-dis-s`).  The choice of scrubbing sequence can be
>    selected using the `bhb-seq=` option.  If it is necessary to protect dom0
>    too, boot with `spec-ctrl=bhb-entry`.
> +* `asi=` offers control over whether the hypervisor will engage in Address
> +  Space Isolation, by not having sensitive information mapped in the VMM
> +  page-tables.  Not having sensitive information on the page-tables avoids
> +  having to perform some mitigations for speculative attacks when
> +  context-switching to the hypervisor.

Is "not having" and ...

> --- a/xen/arch/x86/include/asm/domain.h
> +++ b/xen/arch/x86/include/asm/domain.h
> @@ -458,6 +458,9 @@ struct arch_domain
>      /* Don't unconditionally inject #GP for unhandled MSRs. */
>      bool msr_relaxed;
>  
> +    /* Run the guest without sensitive information in the VMM page-tables. */
> +    bool asi;

... "without" really going to be fully true? Wouldn't we better say "as little
as possible" or alike?

> @@ -143,6 +148,10 @@ static int __init cf_check parse_spec_ctrl(const char *s)
>              opt_unpriv_mmio = false;
>              opt_gds_mit = 0;
>              opt_div_scrub = 0;
> +
> +            opt_asi_pv = 0;
> +            opt_asi_hwdom = 0;
> +            opt_asi_hvm = 0;
>          }
>          else if ( val > 0 )
>              rc = -EINVAL;

I'm frequently in trouble when deciding where the split between "=no" and
"=xen" should be. opt_xpti_* are cleared ahead of the disable_common label;
considering the similarity I wonder whether the same should be true for ASI
(as this is also or even mainly about protecting guests from one another),
or whether the XPTI placement is actually wrong.

> @@ -378,6 +410,13 @@ int8_t __ro_after_init opt_xpti_domu = -1;
>  
>  static __init void xpti_init_default(void)
>  {
> +    ASSERT(opt_asi_pv >= 0 && opt_asi_hwdom >= 0);
> +    if ( (opt_xpti_hwdom == 1 || opt_xpti_domu == 1) && opt_asi_pv == 1 )

There is a separate opt_asi_hwdom which isn't used here, but only ...

> +    {
> +        printk(XENLOG_ERR
> +               "XPTI is incompatible with Address Space Isolation - disabling ASI\n");
> +        opt_asi_pv = 0;
> +    }
>      if ( (boot_cpu_data.x86_vendor & (X86_VENDOR_AMD | X86_VENDOR_HYGON)) ||
>           cpu_has_rdcl_no )
>      {
> @@ -389,9 +428,9 @@ static __init void xpti_init_default(void)
>      else
>      {
>          if ( opt_xpti_hwdom < 0 )
> -            opt_xpti_hwdom = 1;
> +            opt_xpti_hwdom = !opt_asi_hwdom;
>          if ( opt_xpti_domu < 0 )
> -            opt_xpti_domu = 1;
> +            opt_xpti_domu = !opt_asi_pv;
>      }

... here?

It would further seem desirable to me if opt_asi_hwdom had its default set
later, when we know the kind of Dom0, such that it could be defaulted to
what opt_asi_{hvm,pv} are set to. This, however, wouldn't be compatible
with the use here. Perhaps the invocation of xpti_init_default() would
need deferring, too.

> @@ -643,22 +683,24 @@ static void __init print_details(enum ind_thunk thunk)
>             opt_eager_fpu                             ? " EAGER_FPU"     : "",
>             opt_verw_hvm                              ? " VERW"          : "",
>             boot_cpu_has(X86_FEATURE_IBPB_ENTRY_HVM)  ? " IBPB-entry"    : "",
> -           opt_bhb_entry_hvm                         ? " BHB-entry"     : "");
> +           opt_bhb_entry_hvm                         ? " BHB-entry"     : "",
> +           opt_asi_hvm                               ? " ASI"           : "");
>  
>  #endif
>  #ifdef CONFIG_PV
> -    printk("  Support for PV VMs:%s%s%s%s%s%s%s\n",
> +    printk("  Support for PV VMs:%s%s%s%s%s%s%s%s\n",
>             (boot_cpu_has(X86_FEATURE_SC_MSR_PV) ||
>              boot_cpu_has(X86_FEATURE_SC_RSB_PV) ||
>              boot_cpu_has(X86_FEATURE_IBPB_ENTRY_PV) ||
> -            opt_bhb_entry_pv ||
> +            opt_bhb_entry_pv || opt_asi_pv ||
>              opt_eager_fpu || opt_verw_pv)            ? ""               : " None",
>             boot_cpu_has(X86_FEATURE_SC_MSR_PV)       ? " MSR_SPEC_CTRL" : "",
>             boot_cpu_has(X86_FEATURE_SC_RSB_PV)       ? " RSB"           : "",
>             opt_eager_fpu                             ? " EAGER_FPU"     : "",
>             opt_verw_pv                               ? " VERW"          : "",
>             boot_cpu_has(X86_FEATURE_IBPB_ENTRY_PV)   ? " IBPB-entry"    : "",
> -           opt_bhb_entry_pv                          ? " BHB-entry"     : "");
> +           opt_bhb_entry_pv                          ? " BHB-entry"     : "",
> +           opt_asi_pv                                ? " ASI"           : "");
>  
>      printk("  XPTI (64-bit PV only): Dom0 %s, DomU %s (with%s PCID)\n",
>             opt_xpti_hwdom ? "enabled" : "disabled",

Should this printk() perhaps be suppressed when ASI is in use?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 10:25:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 10:25:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777065.1187260 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seBBW-0005Ma-53; Wed, 14 Aug 2024 10:24:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777065.1187260; Wed, 14 Aug 2024 10:24:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seBBW-0005MT-16; Wed, 14 Aug 2024 10:24:54 +0000
Received: by outflank-mailman (input) for mailman id 777065;
 Wed, 14 Aug 2024 10:24:53 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seBBV-0005MN-AM
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 10:24:53 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7121145f-5a27-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 12:24:52 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-a7aac70e30dso718609366b.1
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 03:24:52 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f3f47b80sm154700166b.8.2024.08.14.03.24.50
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 03:24:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7121145f-5a27-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723631091; x=1724235891; 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=0lxduDBAJwajVDY+FbcGHidnrz+X89rVLTqDuLp3OAo=;
        b=DG7i3AZL7IAYR39HgIoN1KutmZI+n0LNtul4Y03hyIRKKxbY1WEEHgwpRoddrqTPtR
         OQJsg2mlsT6qXKEj97yEMGK7Q1SxOpJcy1j3RRTJIdUlAKbHgUw17zZOJ3cKf9sDGX5a
         eZtEOCwm8Maq841DrUov1TKynuBPqFPbqOXESPEj1Zg/hNIcFmT9uT2Tl5fuaxNkn+mb
         YriP23ACUU9rcq7xc7k35b4djlXfvUH1O00eX3d9qhoVbeNiecmh2Oj5YFfCzngRApEl
         H+5TAkNGv38fRgm+mUXxjmdbLFb5xlTZEwGmncadYh5XMuTRMwp7QqrsaUApXp5svwl5
         Y4rA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723631091; x=1724235891;
        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=0lxduDBAJwajVDY+FbcGHidnrz+X89rVLTqDuLp3OAo=;
        b=d3rJ+AFSGxW6PHFBZrfEpb+HyoO388zGLfrwepm1QJukrE3/kbbmTkLmx7lG7JK1Q0
         3Vkm4sHY+qBnuqzKWqARHLqbgF6shwv0SWZMzwy1i/JCxJnjgzQFKkZIBXvksUXUfZ8w
         HCOVDZZn2z3e/cfGG4av/qf1x6GAU+IPRN7jDLDPY5374MG5H5E1CvJ2JgDnJ6FGo4MY
         BV/jFUgMASOkJhQ7E8VwV8UaoUHrW8p3guUc0wS6c0cMj0fzx3Bv7+s7d8P8KNYsVFYZ
         naeo9W45sTUAzj1ILdG8uB+7/QS1WqHN0/WebcsPwDargHMpq7ACK1jQsfqeGP17eAKu
         fJCQ==
X-Forwarded-Encrypted: i=1; AJvYcCXJy8b1iclcEf9ceeWuhB+zTp4Y+YrKZbKBETY/jwpOWWF+5lA8xnAPMeUIZ+9XZayjU+/uQTrNR4l4ui3X9aTcan13+GztBh0FkBx61tw=
X-Gm-Message-State: AOJu0Yw1c7p2YJ3VEN/fF4tCY9yDFebc58zUbitxGxBOJA0aJuNClqtG
	imQ3YxH6xfzxyIhySdI/6d0fer18iB9bmNHaxgnFaldNvPZZMVd6KtRAMq3WXg==
X-Google-Smtp-Source: AGHT+IFSGYwGlc2eQFy+kAri+y8RjbeDVBOdXYYq6SoesJudZ0wmRJDMRuuB/MC3lD/Rnq3TzCPzyw==
X-Received: by 2002:a17:907:c0d:b0:a7a:ab1a:2d71 with SMTP id a640c23a62f3a-a83670956a2mr146905566b.59.1723631091428;
        Wed, 14 Aug 2024 03:24:51 -0700 (PDT)
Message-ID: <2d8902c6-49df-4149-bbc6-e9a1e728450f@suse.com>
Date: Wed, 14 Aug 2024 12:24:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 08/22] x86/mm: avoid passing a domain parameter to L4 init
 function
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: alejandro.vallejo@cloud.com, Andrew Cooper <andrew.cooper3@citrix.com>,
 Tim Deegan <tim@xen.org>, xen-devel@lists.xenproject.org
References: <20240726152206.28411-1-roger.pau@citrix.com>
 <20240726152206.28411-9-roger.pau@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240726152206.28411-9-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 26.07.2024 17:21, Roger Pau Monne wrote:
> @@ -1673,13 +1668,14 @@ void init_xen_l4_slots(l4_pgentry_t *l4t, mfn_t l4mfn,
>          l4e_from_mfn(sl4mfn, __PAGE_HYPERVISOR_RW);
>  
>      /* Slot 260: Per-domain mappings. */
> -    l4t[l4_table_offset(PERDOMAIN_VIRT_START)] =
> -        l4e_from_page(d->arch.perdomain_l3_pg, __PAGE_HYPERVISOR_RW);
> +    if ( perdomain_l3 )
> +        l4t[l4_table_offset(PERDOMAIN_VIRT_START)] =
> +            l4e_from_page(perdomain_l3, __PAGE_HYPERVISOR_RW);
>  
>      /* Slot 4: Per-domain mappings mirror. */
>      BUILD_BUG_ON(IS_ENABLED(CONFIG_PV32) &&
>                   !l4_table_offset(PERDOMAIN_ALT_VIRT_START));
> -    if ( !is_pv_64bit_domain(d) )
> +    if ( perdomain_l3 && maybe_compat )
>          l4t[l4_table_offset(PERDOMAIN_ALT_VIRT_START)] =
>              l4t[l4_table_offset(PERDOMAIN_VIRT_START)];

I think it would be nice if the description could clarify why we need checks
of perdomain_l3 twice here. I assume going forward you want to be able to
pass in NULL. Therefore, if the conditionals are required, I think it would
make sense to have just one, enclosing both (related) writes.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 10:55:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 10:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777078.1187270 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seBf5-0002UF-Da; Wed, 14 Aug 2024 10:55:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777078.1187270; Wed, 14 Aug 2024 10:55:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seBf5-0002U8-Al; Wed, 14 Aug 2024 10:55:27 +0000
Received: by outflank-mailman (input) for mailman id 777078;
 Wed, 14 Aug 2024 10:55:26 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hw+B=PN=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1seBf4-0002U2-Ec
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 10:55:26 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on20627.outbound.protection.outlook.com
 [2a01:111:f403:2412::627])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b2e00016-5a2b-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 12:55:21 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by CY5PR12MB6624.namprd12.prod.outlook.com (2603:10b6:930:40::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Wed, 14 Aug
 2024 10:55:17 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7849.021; Wed, 14 Aug 2024
 10:55:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b2e00016-5a2b-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=CZwC/WLiZg8pcapwRDK1mpCgq7Fq7LP8NLkBmqe8qpoEirNc/e4VOlqmVJJkjYXQnq/umJkFWhTaq2o4IOlPlzfnL1iG79jxktEaMu34JX0Xt90n8qcYDCn0PJygivt8U1VNqZNQFD+7NJRGwPNVH4w+ef1qUHsS50rXy4aREDSH/b5wVJadVph4OzB/gQNxP2DuSKZDoInxMy7PB7kOwl/kcTzBUGZ0K1ADQcQdslEDBdgbHgkAHf1GuelgfMGz8d1NIrLSby6aUMIC9te2LH90pimTVqCpybF5LP92x8A3vSn432w7Au5jmw5AC40TELZZk9jP40Vi8COr6I04qw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=IZ6aYQCSSeWAEmnwaJqeYdqgFbYEQBBfmwZFCKA+SJg=;
 b=SEt2uI1fpaq2xC6l8uJDYqMxJZdSkdPoWDwmroM8yECWq6I5vyQG+qYzucKHBCmjLKdCCf81Qpr6v6aULKS8XPBq6vBiP4dTCzFdybOCC2pC/DoV92vOjSt/7Eys5C8dZwzTIEiqh2qwPdZj16Tedd2waeG6NOK8Bg1yLw8yGGK6IPKWowJXMwLk3i3F5kzRzGnRPw+0FhC2JfnCdICNeFJm9k+TTcJXzgqTT//CZQTS50rvvGON5XjW8/wphkVoD5/A6buWUuRgOaSAvueOi300bhJ9We4tFRaX2g8YOso47XIiJeIkwFB1PmFr5GLyRjlSgHUy28CKmdhngWGihQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=IZ6aYQCSSeWAEmnwaJqeYdqgFbYEQBBfmwZFCKA+SJg=;
 b=x7ACRslS0Q9v/HkY1y+5RBjO6zjDypA4Cdd7jE3ghIzw4jSpkpAa9+txbEJtWouhqCfqaONuenmKhWMrMCcm+V/1sxUMGij2JbGAzq4q1HSwKlgzyxSnTZzCKWsGQiyWjDcPFvU/j7axgQt8ZV/40ds7Q603VaQZGk8FAACg9Do=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
Date: Wed, 14 Aug 2024 11:55:10 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com,
 julien@xen.org
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
 <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR4P281CA0301.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:f6::13) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|CY5PR12MB6624:EE_
X-MS-Office365-Filtering-Correlation-Id: de5e0c70-47e7-4cdb-1690-08dcbc4f94e5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?Y0RQWkFjekZjam10VFcvd3F1dy9xNXl2VHk1Q0JFbnNWSlNZN0xOcEZPYlVs?=
 =?utf-8?B?N3ZNY0p3YUc2VzluTWplMEFWZFhpbUtGSERTVXBmajIzMEdEaWwxWmx4SlZw?=
 =?utf-8?B?UWErRm9jdVUzZzJITzJSYTdVUjlwYTliWjJRdUZJcy9oMGUxbmp0SUFDcjBF?=
 =?utf-8?B?OGZxbWd1YytGemZ1MmFWZVBLZFNIT0JMcWw4ODY2OHFTM1VYd2k5V0RGbFVY?=
 =?utf-8?B?RHN0Z2tJQ3JWZS9KUlo0VDg1YzdwRDM3blpkVFZ0QmZNSlpFSDNCaGc4Sjh1?=
 =?utf-8?B?enYycmpwcHUvUDljSWNiTmlFdWJTT0FYZm5NeDJQMDlTcndvajZ3U1ArR2xs?=
 =?utf-8?B?TmFkQlVoeE1IRlNLalNhdDlVUnpvNUJtSFd0QjFyQ3RraEhkYjIvbUlGRHNV?=
 =?utf-8?B?dldSM1duVkhuZDhaY0lDd3lscW8vdG0rSnB2YmFOSXpKWVA4YmR4endtaWRj?=
 =?utf-8?B?K0RLQWFpWUYrNkF6bWttUVhSc3EvQXJudmJpdlR6d1pPUHhqb0ZJNGE0TUJ4?=
 =?utf-8?B?dnc4RFVOVFdXOWJrb1FvMHVKbnN3NVJMNDRXc0ZmbkN5cFphcGQ5Q3FqcERk?=
 =?utf-8?B?VzYwMWhubWFuTXM0M1YzUElJdnl2MHNCVFdLZDF1WWZ2Sm84dnZtTXB0bVg1?=
 =?utf-8?B?L05zQllqNjcvOGI5clpMb2xNRlhCUEJIUmwvRzRNbXVBZzBYbG5GY05PY0kx?=
 =?utf-8?B?WUNCSUtLM3BWbEhwM2xGczBJMDlFMXRNNEhtOGV1d1hhY1BCOFlKQ0ZlRzNU?=
 =?utf-8?B?YUdYdkQ5L1U3ME52M2JkU3hNYjE2UElENUkzUTZmQ2tUdGtuNW5yQ0VVMkhB?=
 =?utf-8?B?MXZvV2xVR3RDenh5emowa2xZYmdoK1NlaUo2SmszVjhvMnIyTmx4SGR1aWsv?=
 =?utf-8?B?eUNSSlBEaGo0RXhjaFcydzI4RUlGbHZ0V3dYSSs4R3l5TDhpQzN2eWlJV2Yy?=
 =?utf-8?B?SzJWc1libXFIL3RZdzIyakhFWFlON1hwNkZEaitJRzd0cTBhSEphTFMzYWZ0?=
 =?utf-8?B?TnFqUXBRUTVIdnhiOFk4SnVjTGNyanNocXJrT0hhT1FodUdTQUYyZTBTa0Q2?=
 =?utf-8?B?dDFPYURHOVIyek5FV1FBdmprcThPSFp5VmttamUvNzByQ0wzUm4xWWJtcXp3?=
 =?utf-8?B?VUFHREJmK1IyMkcwUVM3Rno4akxZU3RVcHZKUm9GQWNtbTJQRmFKRFRVU2NO?=
 =?utf-8?B?UCtYVUwzQ1J4dVRPMEhYWW5mZ2J0ZG50bXdTYlFUOTVxcWRjOWZmK2Z4aUtz?=
 =?utf-8?B?ZElmVU1YTEd6Z3hjRHlNaXh2ZCtrOTgvdFU3QSs1S0FpMlNXZVU0SkFWK0Rj?=
 =?utf-8?B?Y0k2MFBqMy9PK25tVTRqNVptTlRKa1AwRE81czl3SUNyOURRdHAzYnFseWlM?=
 =?utf-8?B?ajdlOU1BdGp3TmhwTS9SdTZVSDViTVI0ZGZ5NXBteldNMnhUMW9UTGY0NjB3?=
 =?utf-8?B?b0Y5dW0vd3lpL0VONEt0U25ydkRvTER2S3VIUEZLV3JTY2gxQzFxVk10SFRj?=
 =?utf-8?B?WHJDQTUxODRwcUlyUUROSm1JWXJ6RzlmYWxCMGp0dXQ3dnEyTkVDOWdlNGND?=
 =?utf-8?B?bUExZFh3eHBob1l4bzJqdnltcGsvamNKekdCYzJpUnJlTVB6K2ZqYkdEaTl5?=
 =?utf-8?B?aUpoZThXTWM0MGpabEJoWTJhVHZUNUEyeTdkVkRwalNTUjRuOXRSc055SEdI?=
 =?utf-8?B?S1FiSHdDMlA3YlQ2WnVIN2tuSTA0RlZXRmF4UVlza2xSak9Gb1NGdEVSM1VR?=
 =?utf-8?Q?IJMJZQyHKhcotGty7k=3D?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eUd1MmdwWU1VOHVuekl5WFJpUVBqYlVDSjllVG8yVjYwV2twZC9KL1o2eUFl?=
 =?utf-8?B?Sk13T2pjMWwrYU9HVTlvUC90U2R3bEZOZTZ4UjN2NlcrK09EMnFrRXl2c0FG?=
 =?utf-8?B?VXo5Mzk2aWFTSVJkdnc4VVB6OXlxZHNscWxZY0ZwUmJIUktFR0FqL0tJUndn?=
 =?utf-8?B?S3llVEVDeGNkckdlWmFrenFOTDNqZFoyWi96b29DaFFjbmpYTmtLQjFSKzR5?=
 =?utf-8?B?QjB1Q2o0QkFmd2lJQ05sRzk2eXFxSVcxbExka1MrTWRpU2VrT21jdVN6UENB?=
 =?utf-8?B?ZlpTcUQxVVpLbCtMb045NFloa1hJQWJjcWR0SXNpTksybFErN1BCNHdVZVhR?=
 =?utf-8?B?bHdrWm1MemNvRzhLcnc2aFQzYXkvOWl0QTZyaDBmYXBva2J2R09VTFZUbHpp?=
 =?utf-8?B?OHlydndScGlxL0s5UmYxQlB2QUQrNkxOR2NjOUJ0OTRSVjZENWZidGE5NEl3?=
 =?utf-8?B?MGlPWEluSlRsNXdlVklIditUQWJEZHhDQXB2QXZCUytPRWJYc2tIZlIzSTRt?=
 =?utf-8?B?SlhEMHNyMmtSVDQ3MStlS25oOUkvZXlyMWRjNHZwdXhtRTFqVFBHdGxDbTZE?=
 =?utf-8?B?ZVZMRDFPRjc2RGVuTEhpZGRRQ2VadzhTVVU0TlFBTEdWMEJobEZ3djNscHBX?=
 =?utf-8?B?VFJaTkw5RnZ0OFFVVWxSWU5rQURrOGlOU0VZKzV2VWhkd3BBZTBYVExzZ0I1?=
 =?utf-8?B?Wk1sTExSY3ROdVdoQjJjMjlKQ2dRekdLbEx0by9FclRGRndYN2YwT3BVZjN1?=
 =?utf-8?B?WXQxN0lPN2xXOHozWHFWS2ZSemk5aVJzU2EyemkwSXFxYUdFWGpvRm9nY3Bi?=
 =?utf-8?B?TndMT1lTQ2hwRDhqaGliZFZoUXFQUFh6ZmJjY3dHZW1VQ1o5UGJwMFE0cEJ0?=
 =?utf-8?B?c2VaM1hOZlBaanVyQzlYLzY1ZjJsbnllZytzMWdvOG93QnRqR0tDWmRqVVlG?=
 =?utf-8?B?UUxRRGpRaGwxSDIxSGlXTVFTRXM1eE1lQVhJakZhREZmQVZ3SFEweHVuNjNH?=
 =?utf-8?B?SVdHVHZuamtMVE90RDd6Vm9wOVc1N1g5bldWeUhPRGJjRHZienNVelU4T041?=
 =?utf-8?B?Y2pGSmtjSEw5SmZnajJpT0oyOFMwV0RVbW0vYzg4UzNSU3VNQndUcllORUMw?=
 =?utf-8?B?Ry9xOGw3UU9tdDlhYStHS2VQVnZTUFpTU0ZBdS9qdllXM1RlZGtIWDJyeVc1?=
 =?utf-8?B?eEhkek9kTVQrWHhHS3pkUytVeWhPMjQyTzJtdXBNS0oyd3RsajBOYzl6OFJr?=
 =?utf-8?B?OWV0SlZ6c0lZRVhiVWxXSFY4VUlLbzlpczhOYzJBT1Uyd3B0ZlZzbklkYUJJ?=
 =?utf-8?B?S3c2YVZvMmhtSHh6NDJ1UHBNU3N3RTZhSC9iTWE2K2RHSFNMbGRPbFdVL0dS?=
 =?utf-8?B?S3dQRmlYYzVhdU84QTRMVURnSXR1MmlmOGRtNDJKcWV1OFJQUFhRQi81TDYw?=
 =?utf-8?B?M0czeE9rbVVFRlJKRjM4ekJGYXk5VTV1Z1o0ZElaME0vMXhQOXpyNUtreFlj?=
 =?utf-8?B?U1NvU0sxUHpoV2VjeGk2MmppaktXNlNscGp5TEpNakpGK016Qzk3QjdvTlZF?=
 =?utf-8?B?ZTU0VEVnU09ZVTVNVnh2d0w4aS8vaW15UXFTTWFhLy9OMGFIeGlYWnEzUlBO?=
 =?utf-8?B?YnhSOGg1Y0NpdmhnWFJwRE45aVFGc29KTUxhYlBBdEFsUjRKMG9waDhOazlL?=
 =?utf-8?B?MzZUSzNDMnpuY0RGcGpQTzhyM2lFcVpaRTVWQTAreHZCdmF5VytqUXJFRFBV?=
 =?utf-8?B?U2JyV0Q4eDA2QnZ6Vmp6NDNMQ2xlQ2pLWkNaWEMvTlFHOHd3Vzl5V0VKVWxX?=
 =?utf-8?B?WlNKd1YvUkVGZnBESnk0Q3JCQS9EWjNPRVdXbEJwdmlpd1l2N1FYVWEzVFdY?=
 =?utf-8?B?L2xHbWdxVWVZS1lFejdML3VNK2x0Qi9TVG1LMmg3Y05LZWVlMmJSZ3BudFNo?=
 =?utf-8?B?QWpTU1BES1ZzS2pWS3pRY0dVKzFkejk4MEdNWlJkQzA5QVlvS2tVTlk4YUs5?=
 =?utf-8?B?YXlLWElQdWU5Tjlscnc1azBUOGptNzhyODlCYTF2R3pTK1NSUlVtS0k3NWpP?=
 =?utf-8?B?SmJOZ0ZGWTlLRnFEMWJqMEE3cUhMRG1xeDBKRUZFOE9uR2FYNi9GbWFrSEJj?=
 =?utf-8?Q?hTB2OWjCiwyVAn1I+bm79Bi/8?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: de5e0c70-47e7-4cdb-1690-08dcbc4f94e5
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 10:55:16.8510
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 1TucBlWT198FDzMqOFalY3mp17Jowh0ki93sz3VJpEuNMM/KpTzl7wzOlnOQSDh29pBM890kj/eBiH/TxxkeaQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6624

Hi Jan,

On 14/08/2024 07:37, Jan Beulich wrote:
> On 13.08.2024 19:13, Ayan Kumar Halder wrote:
>> From: Penny Zheng <penny.zheng@arm.com>
>>
>> Introduced CONFIG_VMAP which is selected by the architectures that use
>> MMU. vm_init() does not do anything if CONFIG_VMAP is not enabled.
>>
>> VMAP is widely used in ALTERNATIVE feature to remap a range of memory
>> with new memory attributes. Since this is highly dependent on virtual
>> address translation, we choose to fold VMAP in MMU system.
>>
>> In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
>> only support in MMU system on ARM architecture. And ALTERNATIVE now
>> depends on VMAP.
>>
>> HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP as speculative
>> attacks are not possible on non MMU based systems (ie Cortex-R52, R82).
>> See https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability.
> While I'm not an Arm expert and hence I'm likely missing aspects, I question
> the one (Spectre-BHB) vulnerability there to be sufficient to draw a
> conclusion towards the usefulness of branch hardening. I would advise
> against encoding such a connection in the Kconfig dependencies.

AFAIU, to address 'Spectre' like vulnerabilities 'branch hardening' was 
added.

See https://lore.kernel.org/all/E1fNadD-0000fz-9r@rmk-PC.armlinux.org.uk/

And from 
https://lists.linaro.org/archives/list/linux-stable-mirror@lists.linaro.org/message/F4MGL4WT2R7T54NLRDGKFRQNSXF3DZGD/

Spectre is valid on MMU based systems.

Thus, I would make 'branch hardenining' valid on MMU based systems only.

Let me know your thoughts.

>
>> --- a/xen/arch/x86/Kconfig
>> +++ b/xen/arch/x86/Kconfig
>> @@ -1,6 +1,7 @@
>>   config X86_64
>>   	def_bool y
>>   	select 64BIT
>> +	select HAS_VMAP
>>   
>>   config X86
>>   	def_bool y
>> @@ -31,6 +32,7 @@ config X86
>>   	select HAS_UBSAN
>>   	select HAS_VPCI if HVM
>>   	select NEEDS_LIBELF
>> +	select HAS_VMAP
> Why in two places? Also please respect alphabetic sorting here (if this
> hunk is kept, which may be the more consistent approach) ...

My mistake. I initially thought user could select one of the two. 
However, "vm_init()" is invoked only from xen/arch/x86/setup.c.

Thus, keeping 'HAS_VMAP' under 'config X86' is dufficient.

I agree that HAS_VMAP needs to go before HAS_VPCI.

>
>> --- a/xen/common/Kconfig
>> +++ b/xen/common/Kconfig
>> @@ -77,6 +77,9 @@ config HAS_PIRQ
>>   config HAS_PMAP
>>   	bool
>>   
>> +config HAS_VMAP
>> +	bool
>> +
>>   config HAS_SCHED_GRANULARITY
>>   	bool
> ... and here.

Yes, it needs to go after HAS_UBSAN.

- Ayan

>
> Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 11:35:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 11:35:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777094.1187280 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seCHW-0000sC-C6; Wed, 14 Aug 2024 11:35:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777094.1187280; Wed, 14 Aug 2024 11:35:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seCHW-0000s4-91; Wed, 14 Aug 2024 11:35:10 +0000
Received: by outflank-mailman (input) for mailman id 777094;
 Wed, 14 Aug 2024 11:35:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seCHU-0000ry-Hl
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 11:35:08 +0000
Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com
 [2a00:1450:4864:20::62d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 41b6f454-5a31-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 13:35:07 +0200 (CEST)
Received: by mail-ej1-x62d.google.com with SMTP id
 a640c23a62f3a-a7a8553db90so774325366b.2
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 04:35:07 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f414f059sm160390366b.158.2024.08.14.04.35.06
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 04:35:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 41b6f454-5a31-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723635307; x=1724240107; 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=TdcdNZ0L1cdf/nzueErIj9aMhdMrYc9i/EhAHBZuZBU=;
        b=fsN2qAMeTuSBxurAqJfykkxiMZ2AEQUsLCxL9g5u8reUID+DPMl0DIZwYlqDlzZcMy
         ue42bJZU2DEpjycjM33kjavXJk8Z1bVzfETH+APQz7HL8n2GwIXRX2btbuswuPlc+zT9
         rv9IrsSi+ErhD5b9KMqK9G2BHNn2bQcgDfvNnWFzM8ZVLhsUkOJRE+neu7NPOaH99Ld2
         q0dSkn3T/X/mvCKXpjh1HTcKQLoVSIz5ipbBMcvuD+ulEwbU9+saS6FB/rbx04j+rawO
         5KBT2pemNgh+e7AhkeF/iMtDgC+QF7JWty95DTocmuaKDbmwCDwW15kjvfQtqDZZDTMJ
         xoEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723635307; x=1724240107;
        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=TdcdNZ0L1cdf/nzueErIj9aMhdMrYc9i/EhAHBZuZBU=;
        b=cpwyvXQV+s/yDyQEWbJ5aU3glQOjwNlNBb4ufi532LqrtNTGb/36KYJAYD78P+2DPy
         Z3x1rM/HMQUTjWH/gPAFLR7lT36F4dc8wRF/giBPZcGGNpW3hmdciTJMPEV07/lXFkaV
         ZcNl8LFFb5TMSQtuuRLj9frn6i/tEAm/myv1aPqHkybyLSB8hBuPdpvGt+3pLqdAAZ+S
         n6S9ZYgPOkWuz42nVtnMHQxCEKztSyzxrJ2qt0Nn1gLMG8LDD3c2Ti6nICmA72vEtWBt
         BPH8N1F3s97cbi4swxxZh7NeXIKuv7T2Y9/wWCm1s1WWhnXjtQ+kYRxnjGVfOXk/Rh51
         GRXg==
X-Gm-Message-State: AOJu0YyOLWD5u6lc85xGB9dUx59o/ICHTALFj7HUS5S4apX5nyeYkFIN
	cnRtMfRVlQHwY57e/8iMp8oBIFJy5OrSb02S59JBBt9kp3PyrnqJZHXKHtYnEw==
X-Google-Smtp-Source: AGHT+IFCvoZ+VQlkGYWYdFJQsx7naoy5m9vu2Llx69Wj63dkO9LJi0FoEA+CscJaqwi9XkBQWe/O4w==
X-Received: by 2002:a17:907:c7d7:b0:a77:e48d:bc3 with SMTP id a640c23a62f3a-a8366d507f5mr167665766b.19.1723635306793;
        Wed, 14 Aug 2024 04:35:06 -0700 (PDT)
Message-ID: <dad27ab7-3cbd-4a8e-8200-adea52b26e55@suse.com>
Date: Wed, 14 Aug 2024 13:35:05 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
To: Ayan Kumar Halder <ayankuma@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com,
 julien@xen.org
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
 <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
 <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 14.08.2024 12:55, Ayan Kumar Halder wrote:
> Hi Jan,
> 
> On 14/08/2024 07:37, Jan Beulich wrote:
>> On 13.08.2024 19:13, Ayan Kumar Halder wrote:
>>> From: Penny Zheng <penny.zheng@arm.com>
>>>
>>> Introduced CONFIG_VMAP which is selected by the architectures that use
>>> MMU. vm_init() does not do anything if CONFIG_VMAP is not enabled.
>>>
>>> VMAP is widely used in ALTERNATIVE feature to remap a range of memory
>>> with new memory attributes. Since this is highly dependent on virtual
>>> address translation, we choose to fold VMAP in MMU system.
>>>
>>> In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
>>> only support in MMU system on ARM architecture. And ALTERNATIVE now
>>> depends on VMAP.
>>>
>>> HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP as speculative
>>> attacks are not possible on non MMU based systems (ie Cortex-R52, R82).
>>> See https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability.
>> While I'm not an Arm expert and hence I'm likely missing aspects, I question
>> the one (Spectre-BHB) vulnerability there to be sufficient to draw a
>> conclusion towards the usefulness of branch hardening. I would advise
>> against encoding such a connection in the Kconfig dependencies.
> 
> AFAIU, to address 'Spectre' like vulnerabilities 'branch hardening' was 
> added.
> 
> See https://lore.kernel.org/all/E1fNadD-0000fz-9r@rmk-PC.armlinux.org.uk/
> 
> And from 
> https://lists.linaro.org/archives/list/linux-stable-mirror@lists.linaro.org/message/F4MGL4WT2R7T54NLRDGKFRQNSXF3DZGD/
> 
> Spectre is valid on MMU based systems.

Since then various other issues / flavors were found. I've been focusing
on the x86 side of things, but I'd be very surprised if some didn't
affect other architectures as well. Plus branch hardening can be a pre-
cautionary measure, too, I think.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 11:49:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 11:49:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777102.1187290 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seCVL-0003ZG-Gg; Wed, 14 Aug 2024 11:49:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777102.1187290; Wed, 14 Aug 2024 11:49:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seCVL-0003Z9-Ds; Wed, 14 Aug 2024 11:49:27 +0000
Received: by outflank-mailman (input) for mailman id 777102;
 Wed, 14 Aug 2024 11:49:25 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lR0F=PN=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1seCVJ-0003Z3-CF
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 11:49:25 +0000
Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com
 [2a00:1450:4864:20::22a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3fb2da3f-5a33-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 13:49:23 +0200 (CEST)
Received: by mail-lj1-x22a.google.com with SMTP id
 38308e7fff4ca-2ef248ab2aeso101778921fa.0
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 04:49:23 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f291ddbaedsm14068641fa.18.2024.08.14.04.49.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 Aug 2024 04:49:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3fb2da3f-5a33-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723636163; x=1724240963; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=dp0L+GamiTI78LaNXUI0L+8bA2ZqatuVzlZrQCRiNiI=;
        b=mZhkzZ/L1Ebhbxuxz7NcZc5jPjiysQ8/aVc3Wr1cxUnZotIYvmQjSen9gxOz6kIi7T
         dKayuZVU839wROByrxq56jseJkl1uhdDNGGzPVTB4M3gTRJyqnLHHRcWZDHpXjl8xYtW
         H++AnTQiT2wcYOZJnj5egnvdU6lVq8ig9/KkEuDEzml40EwqHrw7mb+U7UkSMTjt1i2y
         U0xJjbRhmSRY90uamMrThkmNRa0k5oomBfQ83UdhH0aTSQvWU9Fs3Z4bo0iKqTshIPlA
         Z0DjaIzH8BOIV0mYyhJSEsIN+DRMqVyoBR/fSRUiMhmEOa6GkagB+U9SPJbvj+8q3aqd
         DWtA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723636163; x=1724240963;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=dp0L+GamiTI78LaNXUI0L+8bA2ZqatuVzlZrQCRiNiI=;
        b=bVJo2mPPRXusc7ruoyHSSDOc2/Kn1pwezbCOaNU+KZpJNRwJC9mAdB9SOIBXorZ2PL
         3PhCxcyBwaHrb+pgqz9oT086yIaz98/Cmga3xDNQYtJLL3uHcQB2iTaRQLdJEbOithtS
         u7DVUZyr2lK58YFyXjQUb/GWy72LsYJEiHywP7cI3e0Z3rur7n7hTEYIlauPSL4K2JcB
         ypjd/7QlVKRY/uZYxf8JAU2M7zV0koqPAQvV5t1RlXxMVr5qCOUcSvvBJUudic+lYmdN
         GjH6oAOcYtOZ1xToGP1ZgexVGuhs5keS0EL8oKZJ20iJXuHt24PrcmBHqSDn3O2eLaEd
         CDVw==
X-Forwarded-Encrypted: i=1; AJvYcCUP2G0XhImqftICXbC76aJKYBKPXgJqO4Xs5zRYWhnRO3eKKt/ZVMlJcNLwnXHc+kxzexXaKgYMNJk=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy3zSHz9qxgPCT1tYkgXVyoMv7xavSuYiMex2o5r41Ab3WACMBR
	vJYgfTxdm5WPz5pysHXId21hproylmhV1BsSILYKuWaptyIS48bE
X-Google-Smtp-Source: AGHT+IFMKxXSID3krkFoZ71TRri2uuaWjn55H1yF6EWyj543s/obDY84Jsw9e73Y36BCyYIts5LDiQ==
X-Received: by 2002:a05:651c:1079:b0:2ef:26f2:d3ec with SMTP id 38308e7fff4ca-2f3aa1df0e5mr17466981fa.12.1723636161891;
        Wed, 14 Aug 2024 04:49:21 -0700 (PDT)
Date: Wed, 14 Aug 2024 13:49:20 +0200
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: qemu-devel@nongnu.org, anthony@xenproject.org, paul@xen.org,
	peter.maydell@linaro.org, alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com, jason.andryuk@amd.com,
	edgar.iglesias@amd.com, xen-devel@lists.xenproject.org,
	qemu-arm@nongnu.org, andrew.cooper3@citrix.com
Subject: Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests
Message-ID: <ZryZwOoadeb1UWK8@zapote>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
 <20240812130606.90410-5-edgar.iglesias@gmail.com>
 <alpine.DEB.2.22.394.2408121650590.298534@ubuntu-linux-20-04-desktop>
 <ZruRm34zIMtUm7oH@zapote>
 <alpine.DEB.2.22.394.2408131550080.298534@ubuntu-linux-20-04-desktop>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.22.394.2408131550080.298534@ubuntu-linux-20-04-desktop>

On Tue, Aug 13, 2024 at 03:52:32PM -0700, Stefano Stabellini wrote:
> On Tue, 13 Aug 2024, Edgar E. Iglesias wrote:
> > On Mon, Aug 12, 2024 at 06:47:17PM -0700, Stefano Stabellini wrote:
> > > On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> > > > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> > > > 
> > > > Add SMP support for Xen PVH ARM guests. Create max_cpus ioreq
> > > > servers to handle hotplug.
> > > > 
> > > > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> > > > ---
> > > >  hw/arm/xen_arm.c | 5 +++--
> > > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
> > > > index 5f75cc3779..ef8315969c 100644
> > > > --- a/hw/arm/xen_arm.c
> > > > +++ b/hw/arm/xen_arm.c
> > > > @@ -173,7 +173,7 @@ static void xen_arm_init(MachineState *machine)
> > > >  
> > > >      xen_init_ram(machine);
> > > >  
> > > > -    xen_register_ioreq(xam->state, machine->smp.cpus, &xen_memory_listener);
> > > > +    xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener);
> > > >  
> > > >      xen_create_virtio_mmio_devices(xam);
> > > >  
> > > > @@ -218,7 +218,8 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
> > > >      MachineClass *mc = MACHINE_CLASS(oc);
> > > >      mc->desc = "Xen PVH ARM machine";
> > > >      mc->init = xen_arm_init;
> > > > -    mc->max_cpus = 1;
> > > > +    /* MAX number of vcpus supported by Xen.  */
> > > > +    mc->max_cpus = GUEST_MAX_VCPUS;
> > > 
> > > Will this cause allocations of data structures with 128 elements?
> > > Looking at hw/xen/xen-hvm-common.c:xen_do_ioreq_register it seems
> > > possible? Or hw/xen/xen-hvm-common.c:xen_do_ioreq_register is called
> > 
> > Yes, in theory there's probably overhead with this but as you correctly
> > noted below, a PVH aware xl will set the max_cpus option to a lower value.
> > 
> > With a non-pvh aware xl, I was a little worried about the overhead
> > but I couldn't see any visible slow-down on ARM neither in boot or in network
> > performance (I didn't run very sophisticated benchmarks).
>  
> What do you mean by "non-pvh aware xl"? All useful versions of xl
> support pvh?


I mean an xl without our PVH patches merged.
xl in upstream doesn't know much about PVH yet.
Even for ARM, we're still carrying significant patches in our tree.


> > > later on with the precise vCPU value which should be provided to QEMU
> > > via the -smp command line option
> > > (tools/libs/light/libxl_dm.c:libxl__build_device_model_args_new)?
> > 
> > Yes, a pvh aware xl will for example pass -smp 2,maxcpus=4 based on
> > values from the xl.cfg. If the user doesn't set maxvcpus in xl.cfg, xl
> > will set maxvcpus to the same value as vcpus.
> 
> OK good. In that case if this is just an initial value meant to be
> overwritten, I think it is best to keep it as 1.

Sorry but that won't work. I think the confusion here may be that
it's easy to mix up mc->max_cpus and machine->smp.max_cpus, these are
not the same. They have different purposes.

I'll try to clarify the 3 values in play.

machine-smp.cpus:
Number of guest vcpus active at boot.
Passed to QEMU via the -smp command-line option.
We don't use this value in QEMU's ARM PVH machines.

machine->smp.max_cpus:
Max number of vcpus that the guest can use (equal or larger than machine-smp.cpus).
Will be set by xl via the "-smp X,maxcpus=Y" command-line option to QEMU.
Taken from maxvcpus from xl.cfg, same as XEN_DMOP_nr_vcpus.
This is what we use for xen_register_ioreq().

mc->max_cpus:
Absolute MAX in QEMU used to cap the -smp command-line options.
If xl tries to set -smp (machine->smp.max_cpus) larger than this, QEMU will bail out.
Used to setup xen_register_ioreq() ONLY if -smp maxcpus was NOT set (i.e by a non PVH aware xl).
Cannot be 1 because that would limit QEMU to MAX 1 vcpu.

I guess we could set mc->max_cpus to what XEN_DMOP_nr_vcpus returns but I'll
have to check if we can even issue that hypercall this early in QEMU since
mc->max_cpus is setup before we even parse the machine options. We may
not yet know what domid we're attaching to yet.

Cheers,
Edgar


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 12:03:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 12:03:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777112.1187300 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seCii-0006h4-QX; Wed, 14 Aug 2024 12:03:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777112.1187300; Wed, 14 Aug 2024 12:03:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seCii-0006gx-Me; Wed, 14 Aug 2024 12:03:16 +0000
Received: by outflank-mailman (input) for mailman id 777112;
 Wed, 14 Aug 2024 12:03: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=lR0F=PN=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1seCih-0006gr-Ux
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 12:03:16 +0000
Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com
 [2a00:1450:4864:20::22a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2e7e5717-5a35-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 14:03:13 +0200 (CEST)
Received: by mail-lj1-x22a.google.com with SMTP id
 38308e7fff4ca-2f029e9c9cfso100292771fa.2
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 05:03:13 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f2920511d0sm14080291fa.113.2024.08.14.05.03.10
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 Aug 2024 05:03:10 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2e7e5717-5a35-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723636993; x=1724241793; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=pLWlOhX7IA1D60QAMmJx/e3m5tenDd37UlQuuePJAH8=;
        b=eO3OvcI5VTNiQyp+fTimo0Kq1MyEDuy68H7L5GFHXIPtZABTmlf6cuab3F8qQbOlck
         Nq9qopTbaEJRQyFRZ8aQcKkGlX8xCOdN7bNcaNF9aWXhNjv77txO2n23rOjkFYrqS6lZ
         pG9QEUxp51X8WIbuboYoJKskCMd7D99bGFHhttUEBeKqQ7dnr/F7hS5y+u8aZ++lcyBT
         BEJY5oiyXQ7YWKHOhpzoAPm3umnw19SphOlMN1EO0S1zwwladHVRcwHTAAJJNF5ZM/zd
         dIp3N3/fSlhPp78AadmBp1jbIDucqurk8SS9ohmPIfeVP0PQ+qXyNV5CwjrO4KB6+06w
         6ANA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723636993; x=1724241793;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=pLWlOhX7IA1D60QAMmJx/e3m5tenDd37UlQuuePJAH8=;
        b=vdEr35nu9OXqd4hq4/6bD2NvJ9IAUg4S3uh1bpuyyW6DR8ajzC8H8jGhn+OoIWox9d
         HzmXu7T7QPxncpcy6CFC/5L6VVSgdlyuIAbjjXgu63vQFrxHYjtkAibcsSEM/EIhNdb4
         qrGzzMhV+kc77pEXK6Y7Z2TnMvvTO5fgcsbvjb8+9AQGRGUEgIr1VYsx2WxasCyEXxk3
         xgJcSXnnEGrimYmk8PlmTxWZRwH9oDeaEWJG1e+pRXH+WmUtQAcQes/y+//mhOPCwPeB
         Pj7lLA0pZmos9xHpZ1NWrPBp2BKbJy7+eCGZRQDU8LdaTb/ecOWq54HrdQG1wkdI1BWo
         bZuQ==
X-Forwarded-Encrypted: i=1; AJvYcCVLfyoH0J1sw0FLaaYr4SGIAQpQqEFkY0vTLEBw/Lw/6278ZHyeqAwf1y/3bH4FDYg1ej3IiKfRwcM983b+ZwsrUVig3v0oAwfyVb1DOgA=
X-Gm-Message-State: AOJu0YypIOn6ulT/C8y3cGqL6sk32o6vN54bToJOqdBk7NomWp3iMdoo
	qASFe02TzLOvVZXNJqShPGR2Kg1ouBoDLhesE3p2AJeAVpGfjh7T
X-Google-Smtp-Source: AGHT+IFpGmYJLf5ZDi74BUV7AvcFD/4rB5wLJWAUAT0SVtzs0jlSIzfJAaZ9CKeogM3VI9No7by5Jw==
X-Received: by 2002:a2e:e09:0:b0:2ef:17ee:62a2 with SMTP id 38308e7fff4ca-2f3aa1df04emr17339101fa.14.1723636991778;
        Wed, 14 Aug 2024 05:03:11 -0700 (PDT)
Date: Wed, 14 Aug 2024 14:03:10 +0200
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: qemu-devel@nongnu.org, anthony@xenproject.org, paul@xen.org,
	peter.maydell@linaro.org, alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com, jason.andryuk@amd.com,
	edgar.iglesias@amd.com, xen-devel@lists.xenproject.org,
	qemu-arm@nongnu.org
Subject: Re: [PATCH v1 05/10] hw/arm: xenpvh: Break out a common PVH module
Message-ID: <Zryc_gna9c4XNX9c@zapote>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
 <20240812130606.90410-6-edgar.iglesias@gmail.com>
 <alpine.DEB.2.22.394.2408121720290.298534@ubuntu-linux-20-04-desktop>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.22.394.2408121720290.298534@ubuntu-linux-20-04-desktop>

On Mon, Aug 12, 2024 at 06:47:51PM -0700, Stefano Stabellini wrote:
> On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> > 
> > Break out a common Xen PVH module in preparation for
> > adding a x86 Xen PVH Machine.
> > 
> > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> > ---
> >  hw/arm/trace-events             |   5 -
> >  hw/arm/xen_arm.c                | 154 ++++++--------------------
> >  hw/xen/meson.build              |   1 +
> >  hw/xen/trace-events             |   4 +
> >  hw/xen/xen-pvh-common.c         | 185 ++++++++++++++++++++++++++++++++
> >  include/hw/xen/xen-pvh-common.h |  45 ++++++++
> >  6 files changed, 269 insertions(+), 125 deletions(-)
> >  create mode 100644 hw/xen/xen-pvh-common.c
> >  create mode 100644 include/hw/xen/xen-pvh-common.h
> > 
> > diff --git a/hw/arm/trace-events b/hw/arm/trace-events
> > index be6c8f720b..c64ad344bd 100644
> > --- a/hw/arm/trace-events
> > +++ b/hw/arm/trace-events
> > @@ -68,10 +68,5 @@ z2_aer915_send_too_long(int8_t msg) "message too long (%i bytes)"
> >  z2_aer915_send(uint8_t reg, uint8_t value) "reg %d value 0x%02x"
> >  z2_aer915_event(int8_t event, int8_t len) "i2c event =0x%x len=%d bytes"
> >  
> > -# xen_arm.c
> > -xen_create_virtio_mmio_devices(int i, int irq, uint64_t base) "Created virtio-mmio device %d: irq %d base 0x%"PRIx64
> > -xen_init_ram(uint64_t machine_ram_size) "Initialized xen ram with size 0x%"PRIx64
> > -xen_enable_tpm(uint64_t addr) "Connected tpmdev at address 0x%"PRIx64
> > -
> >  # bcm2838.c
> >  bcm2838_gic_set_irq(int irq, int level) "gic irq:%d lvl:%d"
> > diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
> > index ef8315969c..b8a5c09bdf 100644
> > --- a/hw/arm/xen_arm.c
> > +++ b/hw/arm/xen_arm.c
> > @@ -12,40 +12,25 @@
> >  #include "hw/irq.h"
> >  #include "hw/sysbus.h"
> >  #include "sysemu/block-backend.h"
> > -#include "sysemu/tpm_backend.h"
> >  #include "sysemu/sysemu.h"
> > -#include "hw/xen/xen-hvm-common.h"
> > +#include "hw/xen/xen-pvh-common.h"
> >  #include "sysemu/tpm.h"
> >  #include "hw/xen/arch_hvm.h"
> > -#include "trace.h"
> >  
> >  #define TYPE_XEN_ARM  MACHINE_TYPE_NAME("xenpvh")
> >  OBJECT_DECLARE_SIMPLE_TYPE(XenArmState, XEN_ARM)
> >  
> > -static const MemoryListener xen_memory_listener = {
> > -    .region_add = xen_region_add,
> > -    .region_del = xen_region_del,
> > -    .log_start = NULL,
> > -    .log_stop = NULL,
> > -    .log_sync = NULL,
> > -    .log_global_start = NULL,
> > -    .log_global_stop = NULL,
> > -    .priority = MEMORY_LISTENER_PRIORITY_ACCEL,
> > -};
> > -
> >  struct XenArmState {
> >      /*< private >*/
> >      MachineState parent;
> >  
> > -    XenIOState *state;
> > +    XenPVHCommonState pvh;
> >  
> >      struct {
> >          uint64_t tpm_base_addr;
> >      } cfg;
> >  };
> >  
> > -static MemoryRegion ram_lo, ram_hi;
> > -
> >  /*
> >   * VIRTIO_MMIO_DEV_SIZE is imported from tools/libs/light/libxl_arm.c under Xen
> >   * repository.
> > @@ -57,64 +42,6 @@ static MemoryRegion ram_lo, ram_hi;
> >  #define NR_VIRTIO_MMIO_DEVICES   \
> >     (GUEST_VIRTIO_MMIO_SPI_LAST - GUEST_VIRTIO_MMIO_SPI_FIRST)
> >  
> > -static void xen_set_irq(void *opaque, int irq, int level)
> > -{
> > -    if (xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level)) {
> > -        error_report("xendevicemodel_set_irq_level failed");
> > -    }
> > -}
> > -
> > -static void xen_create_virtio_mmio_devices(XenArmState *xam)
> > -{
> > -    int i;
> > -
> > -    for (i = 0; i < NR_VIRTIO_MMIO_DEVICES; i++) {
> > -        hwaddr base = GUEST_VIRTIO_MMIO_BASE + i * VIRTIO_MMIO_DEV_SIZE;
> > -        qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL,
> > -                                         GUEST_VIRTIO_MMIO_SPI_FIRST + i);
> > -
> > -        sysbus_create_simple("virtio-mmio", base, irq);
> > -
> > -        trace_xen_create_virtio_mmio_devices(i,
> > -                                             GUEST_VIRTIO_MMIO_SPI_FIRST + i,
> > -                                             base);
> > -    }
> > -}
> 
> There are 4 trivial functions in this file:
> 
> void arch_handle_ioreq(XenIOState *state, ioreq_t *req)
> void arch_xen_set_memory(XenIOState *state, MemoryRegionSection *section,
>                          bool add)
> void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length)
> void qmp_xen_set_global_dirty_log(bool enable, Error **errp)
> 
> Do you think it would make sense to move these too to xen-pvh-common.c ?


Yes, it would be nice to at least provide some sort of default
implementation for these that archs like x86 can override. I'll look
into it for v2.


> 
> 
> > -
> > -static void xen_init_ram(MachineState *machine)
> > -{
> > -    MemoryRegion *sysmem = get_system_memory();
> > -    ram_addr_t block_len, ram_size[GUEST_RAM_BANKS];
> > -
> > -    trace_xen_init_ram(machine->ram_size);
> > -    if (machine->ram_size <= GUEST_RAM0_SIZE) {
> > -        ram_size[0] = machine->ram_size;
> > -        ram_size[1] = 0;
> > -        block_len = GUEST_RAM0_BASE + ram_size[0];
> > -    } else {
> > -        ram_size[0] = GUEST_RAM0_SIZE;
> > -        ram_size[1] = machine->ram_size - GUEST_RAM0_SIZE;
> > -        block_len = GUEST_RAM1_BASE + ram_size[1];
> > -    }
> > -
> > -    memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len,
> > -                           &error_fatal);
> > -
> > -    memory_region_init_alias(&ram_lo, NULL, "xen.ram.lo", &xen_memory,
> > -                             GUEST_RAM0_BASE, ram_size[0]);
> > -    memory_region_add_subregion(sysmem, GUEST_RAM0_BASE, &ram_lo);
> > -    if (ram_size[1] > 0) {
> > -        memory_region_init_alias(&ram_hi, NULL, "xen.ram.hi", &xen_memory,
> > -                                 GUEST_RAM1_BASE, ram_size[1]);
> > -        memory_region_add_subregion(sysmem, GUEST_RAM1_BASE, &ram_hi);
> > -    }
> > -
> > -    /* Setup support for grants.  */
> > -    memory_region_init_ram(&xen_grants, NULL, "xen.grants", block_len,
> > -                           &error_fatal);
> > -    memory_region_add_subregion(sysmem, XEN_GRANT_ADDR_OFF, &xen_grants);
> > -}
> > -
> >  void arch_handle_ioreq(XenIOState *state, ioreq_t *req)
> >  {
> >      hw_error("Invalid ioreq type 0x%x\n", req->type);
> > @@ -135,55 +62,42 @@ void qmp_xen_set_global_dirty_log(bool enable, Error **errp)
> >  {
> >  }
> >  
> > -#ifdef CONFIG_TPM
> > -static void xen_enable_tpm(XenArmState *xam)
> > -{
> > -    Error *errp = NULL;
> > -    DeviceState *dev;
> > -    SysBusDevice *busdev;
> > -
> > -    TPMBackend *be = qemu_find_tpm_be("tpm0");
> > -    if (be == NULL) {
> > -        error_report("Couldn't find tmp0 backend");
> > -        return;
> > -    }
> > -    dev = qdev_new(TYPE_TPM_TIS_SYSBUS);
> > -    object_property_set_link(OBJECT(dev), "tpmdev", OBJECT(be), &errp);
> > -    object_property_set_str(OBJECT(dev), "tpmdev", be->id, &errp);
> > -    busdev = SYS_BUS_DEVICE(dev);
> > -    sysbus_realize_and_unref(busdev, &error_fatal);
> > -    sysbus_mmio_map(busdev, 0, xam->cfg.tpm_base_addr);
> > -
> > -    trace_xen_enable_tpm(xam->cfg.tpm_base_addr);
> > -}
> > -#endif
> > -
> > -static void xen_arm_init(MachineState *machine)
> > +static void xen_arm_init(MachineState *ms)
> >  {
> > -    XenArmState *xam = XEN_ARM(machine);
> > -
> > -    xam->state =  g_new0(XenIOState, 1);
> > +    XenArmState *xam = XEN_ARM(ms);
> > +    const struct {
> > +        const char *name;
> > +        MemMapEntry map;
> > +    } map[] = {
> > +        { "ram-low", { GUEST_RAM0_BASE, GUEST_RAM0_SIZE } },
> > +        { "ram-high", { GUEST_RAM1_BASE, GUEST_RAM1_SIZE } },
> > +        { "virtio-mmio", { GUEST_VIRTIO_MMIO_BASE, VIRTIO_MMIO_DEV_SIZE } },
> > +        { "tpm", { xam->cfg.tpm_base_addr, 0x1000 } },
> > +    };
> > +    int i;
> >  
> > -    if (machine->ram_size == 0) {
> > -        warn_report("%s non-zero ram size not specified. QEMU machine started"
> > -                    " without IOREQ (no emulated devices including virtio)",
> > -                    MACHINE_CLASS(object_get_class(OBJECT(machine)))->desc);
> > -        return;
> > +    object_initialize_child(OBJECT(ms), "pvh", &xam->pvh, TYPE_XEN_PVH_COMMON);
> > +
> > +    object_property_set_int(OBJECT(&xam->pvh), "max-cpus", ms->smp.max_cpus,
> > +                            &error_abort);
> 
> Is ms->smp.max_cpus updated according to the QEMU command line option?
> If so, that would solve the problem of the static initialization of
> max_cpus to GUEST_MAX_VCPUS in xen_arm_machine_class_init.

Yes, it kind of solves it but I'll leave that discussion to the other
thread.

> 
> 
> > +    object_property_set_int(OBJECT(&xam->pvh), "ram-size", ms->ram_size,
> > +                            &error_abort);
> > +    object_property_set_int(OBJECT(&xam->pvh), "virtio-mmio-num",
> > +                            NR_VIRTIO_MMIO_DEVICES, &error_abort);
> > +    object_property_set_int(OBJECT(&xam->pvh), "virtio-mmio-irq-base",
> > +                            GUEST_VIRTIO_MMIO_SPI_FIRST, &error_abort);
> > +
> > +    for (i = 0; i < ARRAY_SIZE(map); i++) {
> > +        g_autofree char *base_name = g_strdup_printf("%s-base", map[i].name);
> > +        g_autofree char *size_name = g_strdup_printf("%s-size", map[i].name);
> > +
> > +        object_property_set_int(OBJECT(&xam->pvh), base_name, map[i].map.base,
> > +                                &error_abort);
> > +        object_property_set_int(OBJECT(&xam->pvh), size_name, map[i].map.size,
> > +                                &error_abort);
> >      }
> >  
> > -    xen_init_ram(machine);
> > -
> > -    xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener);
> > -
> > -    xen_create_virtio_mmio_devices(xam);
> > -
> > -#ifdef CONFIG_TPM
> > -    if (xam->cfg.tpm_base_addr) {
> > -        xen_enable_tpm(xam);
> 
> Do you think it makes sense also to move xen_arm_get_tpm_base_addr and
> xen_arm_set_tpm_base_addr to xen-pvh-common.c ?
>

Yes, perhaps we should create an abstract PVH machine. We could probably
reuse more code between x86/ARM and future PVH support. I can have a
look at it for v2.

> 
> 
> > -    } else {
> > -        warn_report("tpm-base-addr is not provided. TPM will not be enabled");
> > -    }
> > -#endif
> > +    sysbus_realize(SYS_BUS_DEVICE(&xam->pvh), &error_abort);
> >  }
> >  
> >  #ifdef CONFIG_TPM
> > diff --git a/hw/xen/meson.build b/hw/xen/meson.build
> > index d887fa9ba4..4a486e3673 100644
> > --- a/hw/xen/meson.build
> > +++ b/hw/xen/meson.build
> > @@ -15,6 +15,7 @@ xen_specific_ss = ss.source_set()
> >  xen_specific_ss.add(files(
> >    'xen-mapcache.c',
> >    'xen-hvm-common.c',
> > +  'xen-pvh-common.c',
> >  ))
> >  if have_xen_pci_passthrough
> >    xen_specific_ss.add(files(
> > diff --git a/hw/xen/trace-events b/hw/xen/trace-events
> > index d1b27f6c11..a07fe41c6d 100644
> > --- a/hw/xen/trace-events
> > +++ b/hw/xen/trace-events
> > @@ -64,6 +64,10 @@ destroy_hvm_domain_cannot_acquire_handle(void) "Cannot acquire xenctrl handle"
> >  destroy_hvm_domain_failed_action(const char *action, int sts, char *errno_s) "xc_domain_shutdown failed to issue %s, sts %d, %s"
> >  destroy_hvm_domain_action(int xen_domid, const char *action) "Issued domain %d %s"
> >  
> > +# xen-pvh-common.c
> > +xen_create_virtio_mmio_devices(int i, int irq, uint64_t base) "Created virtio-mmio device %d: irq %d base 0x%"PRIx64
> > +xen_enable_tpm(uint64_t addr) "Connected tpmdev at address 0x%"PRIx64
> > +
> >  # xen-mapcache.c
> >  xen_map_cache(uint64_t phys_addr) "want 0x%"PRIx64
> >  xen_remap_bucket(uint64_t index) "index 0x%"PRIx64
> > diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
> > new file mode 100644
> > index 0000000000..0d368398d0
> > --- /dev/null
> > +++ b/hw/xen/xen-pvh-common.c
> > @@ -0,0 +1,185 @@
> > +/*
> > + * Common Xen PVH code.
> > + *
> > + * Copyright (c) 2024 Advanced Micro Devices, Inc.
> > + *
> > + * SPDX-License-Identifier: GPL-2.0-or-later
> > + */
> > +
> > +#include "qemu/osdep.h"
> > +#include "qemu/error-report.h"
> > +#include "qapi/error.h"
> > +#include "hw/boards.h"
> > +#include "hw/irq.h"
> > +#include "hw/sysbus.h"
> > +#include "sysemu/sysemu.h"
> > +#include "sysemu/tpm.h"
> > +#include "sysemu/tpm_backend.h"
> > +#include "hw/xen/xen-pvh-common.h"
> > +#include "trace.h"
> > +
> > +static const MemoryListener xen_memory_listener = {
> > +    .region_add = xen_region_add,
> > +    .region_del = xen_region_del,
> > +    .log_start = NULL,
> > +    .log_stop = NULL,
> > +    .log_sync = NULL,
> > +    .log_global_start = NULL,
> > +    .log_global_stop = NULL,
> > +    .priority = MEMORY_LISTENER_PRIORITY_ACCEL,
> > +};
> > +
> > +static void xen_pvh_init_ram(XenPVHCommonState *s,
> > +                             MemoryRegion *sysmem)
> > +{
> > +    ram_addr_t block_len, ram_size[2];
> > +
> > +    if (s->cfg.ram_size <= s->cfg.ram_low.size) {
> > +        ram_size[0] = s->cfg.ram_size;
> > +        ram_size[1] = 0;
> > +        block_len = s->cfg.ram_low.base + ram_size[0];
> > +    } else {
> > +        ram_size[0] = s->cfg.ram_low.size;
> > +        ram_size[1] = s->cfg.ram_size - s->cfg.ram_low.size;
> > +        block_len = s->cfg.ram_high.base + ram_size[1];
> > +    }
> > +
> > +    memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len,
> > +                           &error_fatal);
> > +
> > +    memory_region_init_alias(&s->ram.low, NULL, "xen.ram.lo", &xen_memory,
> > +                             s->cfg.ram_low.base, ram_size[0]);
> > +    memory_region_add_subregion(sysmem, s->cfg.ram_low.base, &s->ram.low);
> > +    if (ram_size[1] > 0) {
> > +        memory_region_init_alias(&s->ram.high, NULL, "xen.ram.hi", &xen_memory,
> > +                                 s->cfg.ram_high.base, ram_size[1]);
> > +        memory_region_add_subregion(sysmem, s->cfg.ram_high.base, &s->ram.high);
> > +    }
> > +
> > +    /* Setup support for grants.  */
> > +    memory_region_init_ram(&xen_grants, NULL, "xen.grants", block_len,
> > +                           &error_fatal);
> > +    memory_region_add_subregion(sysmem, XEN_GRANT_ADDR_OFF, &xen_grants);
> > +}
> > +
> > +static void xen_set_irq(void *opaque, int irq, int level)
> > +{
> > +    if (xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level)) {
> > +        error_report("xendevicemodel_set_irq_level failed");
> > +    }
> > +}
> > +
> > +static void xen_create_virtio_mmio_devices(XenPVHCommonState *s)
> > +{
> > +    int i;
> > +
> > +    for (i = 0; i < s->cfg.virtio_mmio_num; i++) {
> > +        hwaddr base = s->cfg.virtio_mmio.base + i * s->cfg.virtio_mmio.size;
> > +        qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL,
> > +                                         s->cfg.virtio_mmio_irq_base + i);
> > +
> > +        sysbus_create_simple("virtio-mmio", base, irq);
> > +
> > +        trace_xen_create_virtio_mmio_devices(i,
> > +                                             s->cfg.virtio_mmio_irq_base + i,
> > +                                             base);
> > +    }
> > +}
> > +
> > +#ifdef CONFIG_TPM
> > +static void xen_enable_tpm(XenPVHCommonState *s)
> > +{
> > +    Error *errp = NULL;
> > +    DeviceState *dev;
> > +    SysBusDevice *busdev;
> > +
> > +    TPMBackend *be = qemu_find_tpm_be("tpm0");
> > +    if (be == NULL) {
> > +        error_report("Couldn't find tmp0 backend");
> > +        return;
> > +    }
> > +    dev = qdev_new(TYPE_TPM_TIS_SYSBUS);
> > +    object_property_set_link(OBJECT(dev), "tpmdev", OBJECT(be), &errp);
> > +    object_property_set_str(OBJECT(dev), "tpmdev", be->id, &errp);
> > +    busdev = SYS_BUS_DEVICE(dev);
> > +    sysbus_realize_and_unref(busdev, &error_fatal);
> > +    sysbus_mmio_map(busdev, 0, s->cfg.tpm.base);
> > +
> > +    trace_xen_enable_tpm(s->cfg.tpm.base);
> > +}
> > +#endif
> > +
> > +static void xen_pvh_realize(DeviceState *dev, Error **errp)
> > +{
> > +    XenPVHCommonState *s = XEN_PVH_COMMON(dev);
> > +    MemoryRegion *sysmem = get_system_memory();
> > +
> > +    if (s->cfg.ram_size == 0) {
> > +        /* FIXME: Prefix with object path and consider bailing out.  */
> 
> I am not sure about these two FIXME
> 
> 
> > +        warn_report("non-zero ram size not specified. QEMU machine started"
> > +                    " without IOREQ (no emulated devices including virtio)");
> 
> Also the warn message has a double negative?


Yeah, I forgot to fix these up before posting. Will fix for v2.


> 
> 
> > +        return;
> > +    }
> > +
> > +    if (s->cfg.max_cpus == 0) {
> > +        /* FIXME: Prefix with object path and bail out.  */
> > +        warn_report("max-cpus not specified. QEMU machine started");
> > +        return;
> > +    }
> > +
> > +    xen_pvh_init_ram(s, sysmem);
> > +    xen_register_ioreq(&s->ioreq, s->cfg.max_cpus, &xen_memory_listener);
> > +
> > +    if (s->cfg.virtio_mmio_num) {
> > +        xen_create_virtio_mmio_devices(s);
> > +    }
> > +
> > +#ifdef CONFIG_TPM
> > +    if (s->cfg.tpm.base) {
> > +        xen_enable_tpm(s);
> > +    } else {
> > +        warn_report("tpm-base-addr is not provided. TPM will not be enabled");
> > +    }
> > +#endif
> > +}
> > +
> > +#define DEFINE_PROP_MEMMAP(n, f) \
> > +    DEFINE_PROP_UINT64(n "-base", XenPVHCommonState, cfg.f.base, 0), \
> > +    DEFINE_PROP_UINT64(n "-size", XenPVHCommonState, cfg.f.size, 0)
> > +
> > +static Property xen_pvh_properties[] = {
> > +    DEFINE_PROP_UINT32("max-cpus", XenPVHCommonState, cfg.max_cpus, 0),
> > +    DEFINE_PROP_UINT64("ram-size", XenPVHCommonState, cfg.ram_size, 0),
> > +    DEFINE_PROP_MEMMAP("ram-low", ram_low),
> > +    DEFINE_PROP_MEMMAP("ram-high", ram_high),
> > +    DEFINE_PROP_MEMMAP("virtio-mmio", virtio_mmio),
> > +    DEFINE_PROP_MEMMAP("tpm", tpm),
> > +    DEFINE_PROP_UINT32("virtio-mmio-num", XenPVHCommonState,
> > +                       cfg.virtio_mmio_num, 0),
> > +    DEFINE_PROP_UINT32("virtio-mmio-irq-base", XenPVHCommonState,
> > +                       cfg.virtio_mmio_irq_base, 0),
> > +    DEFINE_PROP_END_OF_LIST()
> > +};
> > +
> > +static void xen_pvh_class_init(ObjectClass *klass, void *data)
> > +{
> > +    DeviceClass *dc = DEVICE_CLASS(klass);
> > +
> > +    dc->realize = xen_pvh_realize;
> > +    device_class_set_props(dc, xen_pvh_properties);
> > +    /* No VMSD since we haven't got any top-level SoC state to save.  */
> > +}
> > +
> > +static const TypeInfo xen_pvh_info = {
> > +    .name = TYPE_XEN_PVH_COMMON,
> > +    .parent = TYPE_SYS_BUS_DEVICE,
> > +    .instance_size = sizeof(XenPVHCommonState),
> > +    .class_init = xen_pvh_class_init,
> > +};
> > +
> > +static void xen_pvh_register_types(void)
> > +{
> > +    type_register_static(&xen_pvh_info);
> > +}
> > +
> > +type_init(xen_pvh_register_types);
> > diff --git a/include/hw/xen/xen-pvh-common.h b/include/hw/xen/xen-pvh-common.h
> > new file mode 100644
> > index 0000000000..e958b441fd
> > --- /dev/null
> > +++ b/include/hw/xen/xen-pvh-common.h
> > @@ -0,0 +1,45 @@
> > +/*
> > + * QEMU Xen PVH machine - common code.
> > + *
> > + * Copyright (c) 2024 Advanced Micro Devices, Inc.
> > + *
> > + * SPDX-License-Identifier: GPL-2.0-or-later
> > + */
> > +
> > +#ifndef XEN_PVH_COMMON_H__
> > +#define XEN_PVH_COMMON_H__
> > +
> > +#include <assert.h>
> > +#include "hw/sysbus.h"
> > +#include "hw/hw.h"
> > +#include "hw/xen/xen-hvm-common.h"
> > +#include "hw/pci-host/gpex.h"
> > +
> > +#define TYPE_XEN_PVH_COMMON "xen-pvh-common"
> > +OBJECT_DECLARE_SIMPLE_TYPE(XenPVHCommonState, XEN_PVH_COMMON)
> > +
> > +typedef struct XenPVHCommonState {
> > +    /*< private >*/
> > +    SysBusDevice parent_obj;
> > +
> > +    XenIOState ioreq;
> > +
> > +    struct {
> > +        MemoryRegion low;
> > +        MemoryRegion high;
> > +    } ram;
> > +
> > +    struct {
> > +        uint64_t ram_size;
> > +        uint32_t max_cpus;
> > +        uint32_t virtio_mmio_num;
> > +        uint32_t virtio_mmio_irq_base;
> > +        struct {
> > +            uint64_t base;
> > +            uint64_t size;
> > +        } ram_low, ram_high,
> > +          virtio_mmio,
> > +          tpm;
> > +    } cfg;
> > +} XenPVHCommonState;
> > +#endif
> > -- 
> > 2.43.0
> > 


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 12:34:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 12:34:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777121.1187310 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDCi-0003kz-3V; Wed, 14 Aug 2024 12:34:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777121.1187310; Wed, 14 Aug 2024 12:34:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDCi-0003ks-0u; Wed, 14 Aug 2024 12:34:16 +0000
Received: by outflank-mailman (input) for mailman id 777121;
 Wed, 14 Aug 2024 12:34:14 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Hw+B=PN=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1seDCg-0003kS-Jn
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 12:34:14 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on20616.outbound.protection.outlook.com
 [2a01:111:f403:2412::616])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 81ace692-5a39-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 14:34:12 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by CYXPR12MB9338.namprd12.prod.outlook.com (2603:10b6:930:e5::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Wed, 14 Aug
 2024 12:34:04 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7849.021; Wed, 14 Aug 2024
 12:34:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 81ace692-5a39-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=gG/F8oEy17Y6uSk0Oy/6tOwr/k8EC0d6zP364o4j+SRrzuESOczn4ttbOZgrjHEIDHe7ZbtYuZ/yOQkHZh4815RcZVxC8Hk9DUk+ggfn68n1zthlPhsrulw5+BOL21lGkh83WuioeZxgM4cnhciWUsZHaUAo4P4XgibHW80ouhQmPOFLpda1AKOGlPuFiiFdXwuWfo6IJ6PZEalkiSAMOmVygZCx/94ixhBBaubwxl7uzItNnxp/ZCiIBE/aIOBdcoSwEN2iiL/NIIbrooDza+ej+zZnTvQdHZiauiLHLbOLFgxceV0W5tcRZvin/y74n0pOtRYhhQJ+TK5/XGTl4g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=q5snA7ZoC6kSUKdod4jCSgSuYwWX4lWrMbduH3a0BNQ=;
 b=cY2zO5pX/pKeSB9YXMZMA+M06Wikc+dad5xOGnn1BZmYpRujrEewqNxSLJOv785eZeF+5PDNUkOdl68Vx6uB8i2yb70Rilb7I7vIP1jgMGEuKsx3UBDBZDG3UCCvAG54/zEWITTdHKRaMHYkEErCzJxnPL3vw+GF5PDdomqc8AuGBSYDVTg/PQb1we7vf8kGFCIqZFseRHBWTpLFGZzZU2oJBCxSQRLEB4KWEfipcdm75wkRwx+qoPOv6JH0owACZU2k/5ZldFGo2Ave+s7D0ATXtOagDiTWVSUpa+WVmumB5Vwl8tBdwRVGVAz9EjB4c2BsKoktv9MRGMaU/7rT2A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=q5snA7ZoC6kSUKdod4jCSgSuYwWX4lWrMbduH3a0BNQ=;
 b=iDG1QQ6fvtxuUddUs8J+v+qKNWpkasvUMmHgaH0QVoRFB8Aq9h/12WmpSkng/iLT+p/sOd+RZaD4TzO98dWQebl4fwV+wFmbX843s/l3pW6RnsmHSoTfA/mQ9Omh9ue64jy7bTeFj2PqzNYRABi/rvb0R6MwZMg9aVW6h+xtbJ0=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
Date: Wed, 14 Aug 2024 13:33:58 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com,
 julien@xen.org
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
 <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
 <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
 <dad27ab7-3cbd-4a8e-8200-adea52b26e55@suse.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <dad27ab7-3cbd-4a8e-8200-adea52b26e55@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: FR3P281CA0041.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:d10:4a::17) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|CYXPR12MB9338:EE_
X-MS-Office365-Filtering-Correlation-Id: e1b8d334-7a7e-4780-05bd-08dcbc5d61d5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?dENhMXYvT0hhSFN1dStVNkxudHhUQmNhTVY4TjFac1V3L3lOMXdPRVMxVkV2?=
 =?utf-8?B?ZEFXUUVWVGlLRHZBQk8xdk94eVZLSHZ0VVN1VFB5b3hSU3lEaDk5WTJGVzZF?=
 =?utf-8?B?eldXdFlYSjE4L3pjbmpudTE2WCtVbUVYQkdKYXlWOGY0YzZIcEZZa2dTMWZI?=
 =?utf-8?B?M0hSQzRXcXkreldoTnVPZU9vb3l4ek9vWHVDb1kvbFBVZFJuNG9iZXpJRlhW?=
 =?utf-8?B?ODdRcHhEVEg1L1JHT1h1cVVwY2JqWDVMaGxTMWs2RzV3c0Z2YklISWlrcXBC?=
 =?utf-8?B?WG5GLzVxVllrVUxYR2hqL2hnN2NESTJWSW9EMUxqdUR0bDNJZ1dVeFFnRVlY?=
 =?utf-8?B?YkhRa3FIb3VFNTJOU2pCWU9Zd2lwUlhYZXRDenBqT0ZQdUhMaGZwR21Pakp1?=
 =?utf-8?B?L2pydFg2Vmh0YmFydENvZHVyTTR0eVBJVmxXYUVzMFlFeWtESmVQZ0ozN05j?=
 =?utf-8?B?emgxZ1drNlVVczNqMlloZTJQVU11Mm4yVzI4V0hnTlhQdUNtbzVqVjNtS2Na?=
 =?utf-8?B?cDE0dzVCSmVoR2x0ZEpzSlhXL2ZOWUhSbnNpZGtQWVkzdE1ud2xGQ0pBampm?=
 =?utf-8?B?T0NWOVdpLzlqYXI3Q0hYbTJseFBZZGYzOXNlRlBGZHRyRnRPcytlN3pPYk1J?=
 =?utf-8?B?L1Y3b1hzNFVWWTJ1QVoxMzFXTXRoVGtWUzlXUlNlMFoyQU1JV0hxR3NRV2lk?=
 =?utf-8?B?bDdYS0wwb29NRXllT3hZbUdwLzBYRTVQNEVXZlU0eW9mc2xkbDcxRE1rbEE4?=
 =?utf-8?B?Q2RBbVNLYngxdkdQUG44WUZHYmV0VXMzUzlxemFJWTE1SjVSL0o1d2pNM1RT?=
 =?utf-8?B?OVlrSm5mc0FGTXNkdGF4Ymt1U0ErdUJ5MEVMeU5RWVh3VnN3dGJGMm5vVFI1?=
 =?utf-8?B?SHEza3RHdHBiY2ZweGp4ZVhiL0lUOVUyMHRRaFJtNHYyTTVlWjYwRnRxclZB?=
 =?utf-8?B?SlNTR2xqYitQdlpaWk1yWlhQSFJvT282aFZCMW5FcldvUmwvdnVaU090SExu?=
 =?utf-8?B?RUl6RC9kQy9LUnJNWFU1UzhoOWgvODFDeVB0MENURGw0bjMxMDVBaGk3Q2pp?=
 =?utf-8?B?Z1QwQ3BzSmR0RGhULzkzM29uSGNPeDJJL2p6U0dNa2V5VER2TTVYQjlnMTE0?=
 =?utf-8?B?QlljMDdIRUxUUVJ4RTVwTGNXb3k3WituOVEva29vT2dDaitDL0Eyb2diVC9X?=
 =?utf-8?B?NXlGT1dERVNwaDNlZUxyblo2dVVEQzdaUmdvTjBFaFZ6L05qSUNmZGplbitG?=
 =?utf-8?B?cUlibllWK1owQTZTL0ZLUGJzejdoelh4MjRUN2ZBdkFtL2dGTmgxZC9BTWVB?=
 =?utf-8?B?eUwycVVwbjNXU1pIQkdUSU83alpoaGZsL3IwY1g3YkdWaFlkVmdXMHd5dDBR?=
 =?utf-8?B?bmQyUXJibjFrdUx2VkJRVWZyMmgyZXhqVXFkTTJzd3VpYVg3RVc4YlZyVVhX?=
 =?utf-8?B?U1VSKzJkU3p4aVl6My9YQVppMmtLVmZicXcyeFZxbnpIVHFIT1lZcndxYzY3?=
 =?utf-8?B?ZXI2MnNheTZFWXAveU5xZDJsdE0rbExIV0M2ZVd3NytxaTR2VlhLMTNKV2N0?=
 =?utf-8?B?SG5aOWlEYU5sd0xJMnFwMW1jVXY5ZThMVm1BR3VPRlhNNFo4UWlNQVIzMjZG?=
 =?utf-8?B?WmRINGlhSFhITVc1TTdtcitkaTZtSm5hcDFjaUFRTG9teE5UMGRpVUk4R3hX?=
 =?utf-8?B?dzMyV2FVU3VSRDhUeUxnSngyMGZjS3BnUEwxTXpDelpwOTBPUmZhWWtjVyt0?=
 =?utf-8?Q?oI1olLHgyYdmJka47c=3D?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?WDNBTGhNdGpIQytrOHhCT1RzR05yRDVsaG1RT3VkNXEwNmVTWTNRNUNoOFg2?=
 =?utf-8?B?ckZYWHgxUEhPaGxMNzVWTHhUZ3dweFdGSmdCSnpuWmx3MC82L2tKRTNIRUln?=
 =?utf-8?B?N0hjdWN1VG9vOUh6YWVjR1pYeGNHTXdCcHZlc2ZFM3dQNnBGSE9ob1JLR3Ux?=
 =?utf-8?B?WVYrWENOYkdkNSthejR2UEY1bFd2bzJDaXQ3UU9OSXMwSjhpS1VRMCszQ1dM?=
 =?utf-8?B?ZmJnZ1BIRXh5UG5ueGJCbkJIVUJUTFJCT2RiOFl0b2R3U0lFa3VySGQrUzQ4?=
 =?utf-8?B?UVBWY2IwNHBXaEFuRDlTemtsQXEzZ0l2dk45Ymp6VGkrWG5Oc2VmbzZlSVVG?=
 =?utf-8?B?dFl6NFh2M0Y5RWxSU3RUU3lDOVdITzNpZHJaQnowT1NvTkp0YUVJelQwdEJY?=
 =?utf-8?B?bEVNclgyWkcxSzRJRmQwK0Z1U3luS2tWcVZ1Z0UxUXRoWXl6RE95cUZGRXAz?=
 =?utf-8?B?MGgxLzUwclE5cUpDNXZyUkYxZXB5RDc4Z1dhcjh3ZjQxaGNlOURMK1dVbnF1?=
 =?utf-8?B?Z1I1L0Y1Um5YeWtmc09PZk5ldWI4enJiNjIrd204VVY3MEJ2OUtQcUhNNktn?=
 =?utf-8?B?R1NqTiszQ3BoSThIcXN6L1pPV3pmbzZRN3doaHpPT2U4ZENzcmptdHM2SjVC?=
 =?utf-8?B?a0o0SVZWcWhxQXFUV0hlNkVvUm4wd01nZlJQVHJWam1jTTMxUnZ3Z2hicVh3?=
 =?utf-8?B?b0hXcjdrQ3pZOVN5SE80WXg1NFN5YVdhN2phNHNvSWNzMmlwR0hSbUl4WjNG?=
 =?utf-8?B?NS96eEpIVUttV29RSUJjMkNndk1Oak8vVkFxdyt2eGx5MFZWOEhyeVd4TkF5?=
 =?utf-8?B?aXlzemdHSVV2cm5XekdRczlpRmNIS002Q29OK2l5QkpOVjZyR2ZpUnpFN3Vp?=
 =?utf-8?B?N1FONEdqTUFkQ3lKSHRJYzBnR3FUcDBpWlFvU0FGbEY4KythbDNKYnU1VUta?=
 =?utf-8?B?dmdsMXBWaDk0OVdEWkJFc2dyclcrN29Yc2ZnUG45WnNOMUs1U2VCdE1iUFA1?=
 =?utf-8?B?QkhiUW5qWi9TbVh3T3BtZldEcDhRLzNCanYzZmt3Nk56bFJ1NWc3Zk5zbkdU?=
 =?utf-8?B?TWc3RXREUGROZ1l6OUFqTnpadTNHd3QxWlRRTVA1RjYvc09WbE51L1ArazRH?=
 =?utf-8?B?U2tNVXEyRTdlQWVnMDlWZUZhL25ydHptVlo0SFRRRGd4bDI4ZUZyZXlLS2Zw?=
 =?utf-8?B?TldzbkFLdHV0cUJUdW52V3NEcmh5YXRWNHo0czlqTVdLT2ZEdlc1NGtqalJo?=
 =?utf-8?B?M01JeFdKZCtTZDAyRzNvSTBBOUY2U2xMeW9ESHRWVDN1RW1Ed2l4OGZwNnpM?=
 =?utf-8?B?eHgrTldEajEyZTJrdW1lcDZTWXBiTG1TZVRhZWdEYmZkZzZWdTlsaWQzekF3?=
 =?utf-8?B?QXdNU0o1UUs3QUlYZENQTkdaUlFmQ0FVcHN2WGxoT2hPZU5laE5oU2ZTNkZl?=
 =?utf-8?B?L1JPSEtMOXJmOUl6VDFXaVFKdHJFYzFqZmh3L1ZrVDlsZVRidWZhdnkyR2h5?=
 =?utf-8?B?ZmtXTkRjYUo4NktzR1luamd2aWZlVGZLc3hHYXNGQjBlUnFEL0RIamZlVnN6?=
 =?utf-8?B?WjlCK2Q1QzRZUVI3Ry9mMnhmcHhPRjl2cWM3NE8wc1VMZ0FhVzZkOFFGcURj?=
 =?utf-8?B?ajNMQVFsQThLZ2swd05IVlcvVmlFdmtoM1pZdTY3T0s5M2lxK0xjNWFSUmRX?=
 =?utf-8?B?ZFgrNmhEVFU1NGw2QWNqRDVsSnh3MFBaUHJjeDBNZk9FdHJRR01uSHB2K2k3?=
 =?utf-8?B?L2RSTmpBWnV6UEZkU3YwNFRuYjIzUk5Rc2VvTmc0ODZVNTVJSVh6TkgzSmx0?=
 =?utf-8?B?RmVYbSt2b0ZtcG1jYXBWNEFWMUNXM1laQVJ5b3h5Yk5NZEkrYWo5ditvRmhU?=
 =?utf-8?B?QXBOa053MTZvQml2czVhYkl6YU90Um5GdWtZT1kxd1VPK050S3FDZHdvbGg4?=
 =?utf-8?B?RU1CVjRTdHZYYkJtWDlIMWVtVEt4SVJWTkdSNCtxSmNrSUJ5SUM1YXRHVDlW?=
 =?utf-8?B?MXBCY0VCeFZrejFhVG5QTWFxZk1xSTlFek1jWXlwQWxuLzgzQ1pmNlRNK0JP?=
 =?utf-8?B?TVVteWhmYnhMMTB1MkhaN0tZRHJleU90NHcvZ0JzYXN6ZUNWaEk5ZDN4YlFP?=
 =?utf-8?Q?sKzzLmSu4i+Z/z5xJw2Bx3Q/Q?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: e1b8d334-7a7e-4780-05bd-08dcbc5d61d5
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 12:34:04.1943
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Dd4tYomSRvFu0OMc6+Q/N981UVFyKmvg7bR/tzrOC+ZpjYDkXftWMGElf6E8nEcNGESnXX3ST49cQuYiBHm7tg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYXPR12MB9338

Hi Jan,

On 14/08/2024 12:35, Jan Beulich wrote:
> On 14.08.2024 12:55, Ayan Kumar Halder wrote:
>> Hi Jan,
>>
>> On 14/08/2024 07:37, Jan Beulich wrote:
>>> On 13.08.2024 19:13, Ayan Kumar Halder wrote:
>>>> From: Penny Zheng <penny.zheng@arm.com>
>>>>
>>>> Introduced CONFIG_VMAP which is selected by the architectures that use
>>>> MMU. vm_init() does not do anything if CONFIG_VMAP is not enabled.
>>>>
>>>> VMAP is widely used in ALTERNATIVE feature to remap a range of memory
>>>> with new memory attributes. Since this is highly dependent on virtual
>>>> address translation, we choose to fold VMAP in MMU system.
>>>>
>>>> In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
>>>> only support in MMU system on ARM architecture. And ALTERNATIVE now
>>>> depends on VMAP.
>>>>
>>>> HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP as speculative
>>>> attacks are not possible on non MMU based systems (ie Cortex-R52, R82).
>>>> See https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability.
>>> While I'm not an Arm expert and hence I'm likely missing aspects, I question
>>> the one (Spectre-BHB) vulnerability there to be sufficient to draw a
>>> conclusion towards the usefulness of branch hardening. I would advise
>>> against encoding such a connection in the Kconfig dependencies.
>> AFAIU, to address 'Spectre' like vulnerabilities 'branch hardening' was
>> added.
>>
>> See https://lore.kernel.org/all/E1fNadD-0000fz-9r@rmk-PC.armlinux.org.uk/
>>
>> And from
>> https://lists.linaro.org/archives/list/linux-stable-mirror@lists.linaro.org/message/F4MGL4WT2R7T54NLRDGKFRQNSXF3DZGD/
>>
>> Spectre is valid on MMU based systems.
> Since then various other issues / flavors were found. I've been focusing
> on the x86 side of things, but I'd be very surprised if some didn't
> affect other architectures as well.

We are talking about Arm here as "HARDEN_BRANCH_PREDICTOR" is specific 
to Arm.

https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability 
covers all the flavours and it does not include Cortex-R82 or R52.

It says the following :-

"Cortex-R cores typically use a closed software stack. In those 
environments, applications or processes are strictly controlled, and 
therefore not exploitable"

> Plus branch hardening can be a pre-
> cautionary measure, too, I think.

The first two Arm non MMU cores that we wish to support in the 
forthcoming series is Cortex-R82 and R52.

As seen in https://developer.arm.com/documentation/ka005109/latest/, it 
explicitly states the following about R82

The Cortex-R82 implements the faulting feature (FEAT_FPAC) but is not 
vulnerable. The Cortex-R82 behaves differently than vulnerable A-class 
CPUs when speculatively executing past an instruction that authenticates 
PAC, and that behavior does not allow the attack software to create the 
"oracle".

We can re-enable branch hardening if we know there is a valid non MMU 
Arm core which is vulnerable.

Let me know if you are ok with the rationale.

- Ayan

>
> Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 12:50:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 12:50:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777136.1187320 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDRj-0006Xl-ER; Wed, 14 Aug 2024 12:49:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777136.1187320; Wed, 14 Aug 2024 12:49:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDRj-0006Xe-BY; Wed, 14 Aug 2024 12:49:47 +0000
Received: by outflank-mailman (input) for mailman id 777136;
 Wed, 14 Aug 2024 12:49:45 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=2uER=PN=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1seDRh-0006XY-Gb
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 12:49:45 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ad8181ae-5a3b-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 14:49:43 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-52efdf02d13so10797457e87.2
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 05:49:43 -0700 (PDT)
Received: from [192.168.1.10] (host-92-26-98-202.as13285.net. [92.26.98.202])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f411af30sm168575866b.131.2024.08.14.05.49.41
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 05:49:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ad8181ae-5a3b-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723639783; x=1724244583; 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=/Ihh9xfJPtNhFhVgEd6wT1qY+qAbVQWArqaQag1gA9g=;
        b=KBKPXjk/gPRgmu1ppBo7w+Xd/vw9cJKsoZuSz/W+Zn21v0cvFrvhfRr1DR+1KKtuJq
         GFBC7Y0d7F7Rs5RB/0uiiTcV5uo4vkRP5a4hbf1556dy9aBYvG3FGW3l1dQrG3gDwNwb
         MmjN8VMAmMi89GbJZwh4hJz+S2oR+FGfCI1yk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723639783; x=1724244583;
        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=/Ihh9xfJPtNhFhVgEd6wT1qY+qAbVQWArqaQag1gA9g=;
        b=epotqNZQLDUaQRSCGVJwhzvbZZjlXZ6UBJidjwRfrHqFJ8GPCbGfKZizzr9c9+3jnV
         G7ta5Wj6TYJjKpHVSYgkPjTLLrN3GTkLf7whjp1msDqV+CsKr+Wv8d5/+5TVTN5V6VT7
         gD4ltGmcn+lHMo9A+4JoPc6d5ZDmRBCqrkFdXfQzSNBa7+XrOrLu0L0cSKF+hb1aO3Fk
         /7H5VrjucV+Ar5E91FXObdT2jpvr7rsqyynVlL0E98ENdWIRXP5EccK9Mj+IHQ0mv918
         OYEDyDlHMLse3VEtLV7TEUJ3qVYyIPBxoxfuGMv8ScsoMQHk0gJNBXBplG8+7WJb4CFQ
         08aA==
X-Forwarded-Encrypted: i=1; AJvYcCWccd73H4/t1W5OfuvdKHS5zIaGxTFHqtMIyBo+LqFxROW0W8VWPaWwVrU1esII5XmrIvv2JZACAbqlzB6C5agfNJ9ijJiwkjvzAc72KgI=
X-Gm-Message-State: AOJu0YzgHDs0Vr8HIEKogpCBCi3hIMt//K5yrAmtA8uJ2Oy8WS+HsKr7
	oxcahZu9pNg08dkeThEs+TElpyio0Heg4Tu0SjvnbSbPHJt6ApHQdn4me5cB/Ug=
X-Google-Smtp-Source: AGHT+IGzNqm67ZjgSW6Z8Ai9vIW9UaZkOT+hZnU3FyM73+FBo6tPy9wdv+xNSDySJZaU++dp6ziaMQ==
X-Received: by 2002:a05:6512:3f24:b0:52e:9808:3f48 with SMTP id 2adb3069b0e04-532eda7a549mr2139574e87.21.1723639782460;
        Wed, 14 Aug 2024 05:49:42 -0700 (PDT)
Message-ID: <3cc3f16b-bdc2-45e7-9a6b-fd6270e952c2@citrix.com>
Date: Wed, 14 Aug 2024 13:49:41 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: don't call ->read_segment() with x86_seg_none
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <81ae365f-98b4-4bb6-bbb6-c5423dfda038@suse.com>
 <a7d15429-ce49-43b1-9bbd-7b0129094388@citrix.com>
 <e0081fc2-c631-45a0-a847-edc8dcc3988e@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <e0081fc2-c631-45a0-a847-edc8dcc3988e@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 12/08/2024 3:05 pm, Jan Beulich wrote:
> On 12.08.2024 15:04, Andrew Cooper wrote:
>> On 05/08/2024 2:26 pm, Jan Beulich wrote:
>>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>>> @@ -839,7 +839,8 @@ protmode_load_seg(
>>>          case x86_seg_tr:
>>>              goto raise_exn;
>>>          }
>>> -        if ( !_amd_like(cp) || vcpu_has_nscb() || !ops->read_segment ||
>>> +        if ( seg == x86_seg_none || !_amd_like(cp) || vcpu_has_nscb() ||
>>> +             !ops->read_segment ||
>>>               ops->read_segment(seg, sreg, ctxt) != X86EMUL_OKAY )
>>>              memset(sreg, 0, sizeof(*sreg));
>>>          else
>> While this fixes the crash, I'm not sure it will behave correctly for
>> VERR/VERW.
>>
>> protmode_load_seg() is unconditionally X86EMUL_OKAY for a NULL selector,
>> and VERW checks for type != 0x8 which an empty attr will pass.
> That's past an sreg.s check, which will have failed (for sreg coming back
> all clear).

Oh, so it is.

Any chance I could talk you into folding this hunk in too?

diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c
b/xen/arch/x86/x86_emulate/x86_emulate.c
index 902538267051..d4d02c3e2eb3 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -2852,7 +2852,7 @@ x86_emulate(
                                             &sreg, ctxt, ops) )
             {
             case X86EMUL_OKAY:
-                if ( sreg.s &&
+                if ( sreg.s /* Excludes NULL selector too */ &&
                      ((modrm_reg & 1) ? ((sreg.type & 0xa) == 0x2)
                                       : ((sreg.type & 0xa) != 0x8)) )
                     _regs.eflags |= X86_EFLAGS_ZF;


because it is relevant to judging whether the subsequent logic is
correct or not.

>
> Also if there was a concern here, it would be orthogonal to the adding of
> the seg_none check: It would then have been similarly an issue for all
> possibilities of taking the memset() path.
>
>> Interestingly, both Intel and AMD state that the NULL selector is
>> neither readable nor writeable.
> Which makes sense, doesn't it? A nul selector is really more like a
> system segment in this regard (for VERR/VERW).

In the 32bit days, yes, the NULL selector was entirely unusable, but
that changed in 64bit.

So IMO it really depends on whether VERR/VERW means "can I use this
selector for $X", or "what does the GDT/LDT say about $X".

AMD say "Verifies whether a code or data segment specified by the
segment selector in the 16-bit register or memory operand is readable
from the current privilege level."

Intel say "Verifies whether the code or data segment specified with the
source operand is readable (VERR) or writable[sic] (VERW) from the
current privilege level (CPL)."

So that's clearly the former meaning rather than the latter meaning.

Nevertheless, AMD clearly decided it wasn't worth changing the behaviour
of the instruction in a 64bit mode, probably for the same reason that
Intel reused VERW for scrubbing; that no-one had really bought into
x86's segmented memory model since the 386 replaced the 286.

I just found it odd, that was all.

>
>> Also, looking at the emulator logic, we're missing the DPL vs
>> CPL/RPL/Conforming checks.
> There's surely nothing "conforming" for a nul selector. Hence perhaps you
> refer to something entirely unrelated?

Sorry, yes.  I think this is a general bug in how we emulate VERW/VERR,
unrelated to this specific OSS-fuzz report.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 12:50:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 12:50:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777143.1187331 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDSF-0007rY-NM; Wed, 14 Aug 2024 12:50:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777143.1187331; Wed, 14 Aug 2024 12:50:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDSF-0007rR-J7; Wed, 14 Aug 2024 12:50:19 +0000
Received: by outflank-mailman (input) for mailman id 777143;
 Wed, 14 Aug 2024 12:50:18 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DSq6=PN=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1seDSE-0006XY-GW
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 12:50:18 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20607.outbound.protection.outlook.com
 [2a01:111:f403:2416::607])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c092f3d7-5a3b-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 14:50:16 +0200 (CEST)
Received: from BY3PR04CA0016.namprd04.prod.outlook.com (2603:10b6:a03:217::21)
 by CYYPR12MB8871.namprd12.prod.outlook.com (2603:10b6:930:c2::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.23; Wed, 14 Aug
 2024 12:50:11 +0000
Received: from MWH0EPF000971E9.namprd02.prod.outlook.com
 (2603:10b6:a03:217:cafe::81) by BY3PR04CA0016.outlook.office365.com
 (2603:10b6:a03:217::21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend
 Transport; Wed, 14 Aug 2024 12:50:11 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 MWH0EPF000971E9.mail.protection.outlook.com (10.167.243.71) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Wed, 14 Aug 2024 12:50:10 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 07:50:09 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 07:50:09 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 14 Aug 2024 07:50:07 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c092f3d7-5a3b-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=g/DIrhf8fgFn4hpqE6RWcgazj361lo85RKXsHU66ZUUaifdkK3aNsbb6kWC66yTeg3HkiVsdJhTt/8CtwOoEoPdbY+Qw18V/2ajngslgcxZebiKwpAQ9r6tOPx33XO0yF5cPS71xbVlXhsAuJtBReltvhln3QnVNhAwjU8pQAKNelhVa9p4lRcBWlzFQpyxQ9RjEfCMzoNLp3XqACGfWaoKNnbF4rrLG9DmjRIKTtFzthUVxzdLrc9PElaA8hAdXB1drUmEOYhDDHyYRjDDRVSMb7socoITvWKonSpTLaIdaMBy7l/sizZTDOwi9DBAfEvVMMp4hyFbVvnju2as1tg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=EDT/PTe6Y5fTipC6iRJxvSsn50WTw1GGRwK8lw6qSPU=;
 b=GO0kCrssnWCjlDcQHbn03LICvEjw5q0yNLFfNoj2/aFj0IpQSW8pOv+4oYkXVl5JZskCbeiNWonq3mBVf0ZMqD6dd3lch/cjsqdW2YI1U3qhgXpLrg+pytqlrnilAvn1U9kbjHCt9cpLAQJPeMzmUsia9iIMBxIYDCjqzzxOzvf8Uam0iBOSSJQfm1advaXmIWlCFX33gxrmdkkkdlHCXMYJOgzWI6/Mf5Xcgpwi7LG3IyH917Q7t6BLGiagq/owiYZsuSp0ea0iqooHWkb+cpCHU+hr5HB0R4lLIQ95ycpUFr2HB6ltn+1T8VEmHMTv6uIqwx+LmLqoC9wRdjD4cg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=EDT/PTe6Y5fTipC6iRJxvSsn50WTw1GGRwK8lw6qSPU=;
 b=rTiJp1pWRaSdmeYV5kbweCTuy/e1yMNpqIj7v+yYkozDYMMwuaeky/myXxZxsqYpttbMW++hkWjri+6PvSHY80kcxXD1WXZxa1k1rU1BPm/ebd3eAw3aUP2l6y0k6do9eapff6DaQlpAMGdRxCTjRMLEb2FCjcCJDiRS1o3AHQg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <d1144ab4-a342-452b-bd03-a67409657fa7@amd.com>
Date: Wed, 14 Aug 2024 14:50:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 1/4] xen: arm: Add a new helper update_boot_mapping()
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, <sstabellini@kernel.org>,
	<bertrand.marquis@arm.com>, <Volodymyr_Babchuk@epam.com>, <julien@xen.org>,
	<jbeulich@suse.com>
CC: <xen-devel@lists.xenproject.org>
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-2-ayan.kumar.halder@amd.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240813171356.46760-2-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MWH0EPF000971E9:EE_|CYYPR12MB8871:EE_
X-MS-Office365-Filtering-Correlation-Id: 7b0d00ce-23cc-4ab8-75da-08dcbc5fa246
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?MWN6T3d3OC9xanN1Qm1sTm1taFdpUGdwcXhLc2kzc0RqSTMvUDJIOE5aTjU3?=
 =?utf-8?B?UGxPQUNzQmZvci9kaWdCL3ROL1dxVUlJQlhJZm9uanBWNk9kK3BpYTBINVpz?=
 =?utf-8?B?dzhPMFlVSTBEY2dXdUtEdW5WcGVTUkRjU1lmaVlTSkV6MHFrWlpKbEdUOVA0?=
 =?utf-8?B?U05sVi9oNTdWK1JyN1VIU3BLSXU4YTZCUFV4RnJUN2JESVRMbHAzaVlWWk5Z?=
 =?utf-8?B?SUtmTGVLMVhlU2FiVll2NFI2MmZtQWFrWllWaFVsdnZuS0MzMjlFa0JTZmZT?=
 =?utf-8?B?R04vM2h6YXV3Q0VDZTV1TmsvZDRUc1JKZW15aHh4WWlQbWtUcWUzNGNrSGpr?=
 =?utf-8?B?Yzkrc1lORGI3dDdobVdPSkpWYTBTT1EwcEtWVXlHdUZpZURja1JlVzlyeTZ2?=
 =?utf-8?B?aDlnVHUxRnpLS2o5cUNEWnJPYm1mQ1ZmUnhMWnJWZEZnWVdUTEJZSUJreW1q?=
 =?utf-8?B?RnpybWJ4R1pTN2ZZYVh2cUtDMk1EbGs5eTl4YmRKem9GQksrMFAyTXA5azdo?=
 =?utf-8?B?dStSa0tzaGNxYUMweCt1MFhaTzA0ZFBuVVJDUGVwdGZwOC9XektlcHk3L21M?=
 =?utf-8?B?b3FBeTBaZXM3N0lWTzNqYm1hdlRxRG11YmgyVjlWYUVPUkQrS2lmU3NKblRh?=
 =?utf-8?B?MFlhUDVEL1FKaTZLck1FRS9BcERRSWxLTE9HWWxTVE0vZTRwaTZFYUtmZ2h5?=
 =?utf-8?B?ck9WTWF3YzQrdEptKzRSQkhLK0QvY1hnNTdsTkpPb1NaaWdWdHNpZjlrZW1v?=
 =?utf-8?B?WExPTTdsWEpJTDVwakprYVhnVkcvdUJPQUs1S0VMUmZncHA4dnJLTFVrcmZM?=
 =?utf-8?B?aVhhZTNSTDlyaklmM3ZNSGFNalFXdjJjYXg3Sk1RSlkxeWVHb0VnL1NvdE53?=
 =?utf-8?B?dFpVYzFuZnRrRVIxQVFSeC9OVW9jL3BuM2JPa016Wm1pUWxERHdPeGt3OVVm?=
 =?utf-8?B?bjRHQU5mWVJrRDgrRkVodVJ6VzNNVEJmZTJmWTBRdC9iRXBnRFhEdUkvd0ph?=
 =?utf-8?B?ZE42azUwYnV1TlBiSXJuMW5rUHhxUUE1WHRkRXRvVWh2eENJMlFmVzhER0Vk?=
 =?utf-8?B?SHZack0vOU5YRjZTd0pRMDk2cFN4WGcwbzhyM1pFVExxNzJOUlZsTEdVNE1o?=
 =?utf-8?B?NHNkdG1nZjlmc1pHUzNrdHFwZnJzVnNISU9udmZWcU5RS0Nxa05EbTdIdWFm?=
 =?utf-8?B?QnJDN0lhRzZZVmpnZGNlQlk5bHlXVXgxNU5XT1VLcklreDJ2WmJXK0RMdGs4?=
 =?utf-8?B?SytwZnN4emJGcEdQODJGUnBGaTdTZFJQVzFqR1k5T3RlN1pLRUpwNldqT0t1?=
 =?utf-8?B?Qnp6UzlTOVNVVit5bmpNUzQ3aE95K2paMERsWGpxZmNtV3BmR05mdk1tWjh2?=
 =?utf-8?B?MXVnNkVKQjkwUGlVeGZiclVNSWpyUjh6NGhmUFM0SEpwTTdmbmR5YjBFWGlz?=
 =?utf-8?B?TzBLTS94cS82dUdJSEF3MldYWWh1eXdGS3c3alNDWjRzU1F1VlpIVnBNRFJq?=
 =?utf-8?B?dzZzdlRZNndaa09rd0wzV2lCcUp1ZXVIeFBWdlZCTVVaSEVhZCtaZHBCZit6?=
 =?utf-8?B?d3c1aTlxRUZpZTRRZzg1NS9iRkQ0R0dtSFoydzJsYUE3SHR3QmxSYUdyUEFF?=
 =?utf-8?B?WU9aSkdpRDQ4SWY0ZXAreTd1aGNuektJY3hBNjJDUHBqZlJWdFZYMDZoTFNy?=
 =?utf-8?B?M0FmNFpjSlV1MVZJOXFqd0liV3lmRTNhMnJKS0FqcnNVZXUzaDFRekRaZFhs?=
 =?utf-8?B?UStnNXNIMVJNYnNUUXB0RDI1d1dDcjduMzJWMmY2RHkrMWZRZFM4Wks5b2dL?=
 =?utf-8?B?eVlHMy9sQnlTZGJVQ2h5QmRFVEtRTzN1V2luSEtwTXpwdGh0UXR0MjYxVm9S?=
 =?utf-8?B?ZFZqUmIyYkxlUUdVS0w0SGtobmphcWFJVEFaRXJDL1N6aHFWeGFWTDRxNVZZ?=
 =?utf-8?Q?aRnbtxSoI1MJ6YEOvD7pM7tUuCQJqVt6?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 12:50:10.9115
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 7b0d00ce-23cc-4ab8-75da-08dcbc5fa246
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	MWH0EPF000971E9.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8871

Hi Ayan,

On 13/08/2024 19:13, Ayan Kumar Halder wrote:
> update_boot_mapping() invokes update_identity_mapping() for the MMU specific
> code.
> Later when the MPU code is added, update_boot_mapping() would invoke the
> equivalent.
> 
> The common code now invokes update_boot_mapping() instead of
> update_identity_mapping(). So, that there is clear abstraction between the
> common and MMU/MPU specific logic.
> 
> This is in continuation to commit
> f661a20aa880: "Extract MMU-specific MM code".
> 
> update_identity_mapping() is now marked as static as it is called within
> xen/arch/arm/arm64/mmu/mm.c only. Also, updated the prototype to
> update_boot_mapping() which is now invoked from other files.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
> Changes from :-
> 
> v1 - 1. Introduced update_boot_mapping() which invokes
> update_identity_mapping() in MMU specific code.
> 
> v2 - 1. Make update_identity_mapping() static and update the prototype.
> 
>  xen/arch/arm/arm64/mmu/mm.c         | 7 ++++++-
>  xen/arch/arm/arm64/smpboot.c        | 6 +++---
>  xen/arch/arm/include/asm/arm64/mm.h | 2 +-
>  3 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/xen/arch/arm/arm64/mmu/mm.c b/xen/arch/arm/arm64/mmu/mm.c
> index 293acb67e0..1afbbeda5a 100644
> --- a/xen/arch/arm/arm64/mmu/mm.c
> +++ b/xen/arch/arm/arm64/mmu/mm.c
> @@ -111,7 +111,7 @@ void __init arch_setup_page_tables(void)
>      prepare_runtime_identity_mapping();
>  }
>  
> -void update_identity_mapping(bool enable)
> +static void update_identity_mapping(bool enable)
>  {
>      paddr_t id_addr = virt_to_maddr(_start);
>      int rc;
> @@ -125,6 +125,11 @@ void update_identity_mapping(bool enable)
>      BUG_ON(rc);
>  }
>  
> +void update_boot_mapping(bool enable)
> +{
> +    update_identity_mapping(enable);
> +}
> +
>  extern void switch_ttbr_id(uint64_t ttbr);
>  
>  typedef void (switch_ttbr_fn)(uint64_t ttbr);
> diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
> index a225fae64d..789f352ab6 100644
> --- a/xen/arch/arm/arm64/smpboot.c
> +++ b/xen/arch/arm/arm64/smpboot.c
> @@ -112,18 +112,18 @@ int arch_cpu_up(int cpu)
>      if ( !smp_enable_ops[cpu].prepare_cpu )
>          return -ENODEV;
>  
> -    update_identity_mapping(true);
> +    update_boot_mapping(true);
>  
>      rc = smp_enable_ops[cpu].prepare_cpu(cpu);
>      if ( rc )
> -        update_identity_mapping(false);
> +        update_boot_mapping(false);
>  
>      return rc;
>  }
>  
>  void arch_cpu_up_finish(void)
>  {
> -    update_identity_mapping(false);
> +    update_boot_mapping(false);
>  }
>  
>  /*
> diff --git a/xen/arch/arm/include/asm/arm64/mm.h b/xen/arch/arm/include/asm/arm64/mm.h
> index e0bd23a6ed..ac8d1f5c78 100644
> --- a/xen/arch/arm/include/asm/arm64/mm.h
> +++ b/xen/arch/arm/include/asm/arm64/mm.h
> @@ -21,7 +21,7 @@ void arch_setup_page_tables(void);
>   * Note that nested call (e.g. enable=true, enable=true) is not
>   * supported.
>   */
> -void update_identity_mapping(bool enable);
> +void update_boot_mapping(bool enable);
The whole point of adding a wrapper was to avoid ambiguity \wrt identity mapping and MPU.
You changed the name of a function but left the comment which is pretty MMU specific. I think
it should be moved to update_identity_mapping.

Apart from that:
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 13:00:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 13:00:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777154.1187340 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDbk-0001hP-Iz; Wed, 14 Aug 2024 13:00:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777154.1187340; Wed, 14 Aug 2024 13:00:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDbk-0001hI-Ev; Wed, 14 Aug 2024 13:00:08 +0000
Received: by outflank-mailman (input) for mailman id 777154;
 Wed, 14 Aug 2024 13:00:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DSq6=PN=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1seDbi-0001c0-Oi
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 13:00:06 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on20600.outbound.protection.outlook.com
 [2a01:111:f403:2415::600])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1ff8b59b-5a3d-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 15:00:05 +0200 (CEST)
Received: from BN9PR03CA0082.namprd03.prod.outlook.com (2603:10b6:408:fc::27)
 by IA1PR12MB6188.namprd12.prod.outlook.com (2603:10b6:208:3e4::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Wed, 14 Aug
 2024 13:00:01 +0000
Received: from BN2PEPF0000449F.namprd02.prod.outlook.com
 (2603:10b6:408:fc:cafe::23) by BN9PR03CA0082.outlook.office365.com
 (2603:10b6:408:fc::27) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.33 via Frontend
 Transport; Wed, 14 Aug 2024 13:00:01 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 BN2PEPF0000449F.mail.protection.outlook.com (10.167.243.150) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Wed, 14 Aug 2024 13:00:01 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 08:00:01 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 08:00:00 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 14 Aug 2024 07:59:59 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1ff8b59b-5a3d-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=qtU5wuigAjecn2L6EkzsXmba5EprJawz4PmfZ3XrdqWP//aMPwJlQa61IfI/PkEIXIO25jS+GgOGTUUvrhpwhHHeq+Tsk9xrp/qZ9mYT5zqcqF4azeiC5p/tFNmLDpcKHYvltupVETRsU8XIbkcNtukCr/PsS3edEkem4te4tVjotfzWwttXXLxOSrntI5IA9shmKGahprCBSej3sHgLjUumK3w1TvLHbewo5PflQrrLk6Hk5kO6rbIyP+//BV4zVTM0ZNF/OsVBTL6lskWUpyVXgYv831XBhaR84Wd//lE81cJTpi/0+1sH7g84Q6sGcizs/qQ1Oma/QtCu/yNosQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=AhNIUO9vBkPVQxb8J5KNnZujQc1BlrgUWDnwnkizL1A=;
 b=zEPg6OhtLgXjCmQqYd58OFaMRDbnvoGjfPyC8rsVRLayAijLsPdh3LsWQN12kP4z5XVktXGERtvqPKrjv609APH2gy2f1mjSyTKW82rS/qJHmaqhbcDj5LxECSz6g6f5m1sAECVTa78OfFxhC8nqBXgNhq3ew8+Q69Ut78uebjZ0fS/MtgLgfIjlY+YQoLtlvldBFbP1u22drNRmg4YT1Bp3ZYWx5F/u4I7mEdTpz3uFL2gxAtoa0NWs+OiH2M0Cn0/COeptdABJINitAld292mF4t0nthMQrqbHyW7GzS8KpQRlzhZHhUaOKD5xL+uR5KXeRwqh16c4HtzPj9pOQg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=AhNIUO9vBkPVQxb8J5KNnZujQc1BlrgUWDnwnkizL1A=;
 b=ues1gmSHszSdlJp2LD3jhv89jBDV9O7FaDmrV5KE1QnQTlKuynMEeKsrj2NQZAzoM1wXgGQ7iulHfnk0rDgtyCsvWo14u8cx7OXLQWpVHNlqBnNTqklwdBF5KiJ4mmjS11NVSO6ZZHBb2Llnd26inRf+9LAhDB9/tkLQdVIVYj4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <dd7948b5-070a-4c9f-8e10-b51f1490ca09@amd.com>
Date: Wed, 14 Aug 2024 14:59:59 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 3/4] xen: arm: Move the functions of domain_page to MMU
 specific
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, <sstabellini@kernel.org>,
	<bertrand.marquis@arm.com>, <Volodymyr_Babchuk@epam.com>, <julien@xen.org>,
	<jbeulich@suse.com>
CC: <xen-devel@lists.xenproject.org>
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-4-ayan.kumar.halder@amd.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240813171356.46760-4-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN2PEPF0000449F:EE_|IA1PR12MB6188:EE_
X-MS-Office365-Filtering-Correlation-Id: 0a0b4845-5fda-43f2-31ad-08dcbc61025b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?Vm1ackVDNTd1TURmWHFJcVl2R1lKMGIrdmo1VUlEZmNsN0RxNXZRaEVlbHE4?=
 =?utf-8?B?blhEQU16cjJvRitxUlIxc3lpVEY3OFZ2dmdibUh0ZkdQTGhZT1JoNUp6Tnox?=
 =?utf-8?B?UmZ4Y0h5Z3dFRmxnbnh2bGFCam85WmhlejR1bDBaOC9ZZlF4SlpkR3draDg4?=
 =?utf-8?B?a0FhanJFRTI2THZ5M291RlpmQkx3NHRKb2dMODA0VWtnOUdrMldYY2Z3c0Ez?=
 =?utf-8?B?ZHpEcGQvMkl6aExYL296SW1RQlJLd241d1U1SlFmUkdUek5jcmQ2cmZwc0ht?=
 =?utf-8?B?aVdoREV2K1hxTFI5NUlTVUUvV3phOFNmRWtGMXdHdzZkem5xYzBTWFJ3UjhL?=
 =?utf-8?B?ZVNxK2NTdkMyWTkzVTV1bERadjRlYnRmQzB3MHBZeUlyMWVvVHRSaEI4Y1Y0?=
 =?utf-8?B?aGpRQ3RhR2xKbmY0M1NhNDUvUlVNNlhpSTlvZTRQYmpKb21NUFVsTXZCbE5N?=
 =?utf-8?B?R2ttMzJDZnVLNDA0bTg5RFVtNW9naTcyUmEwSHBtNFYzVUNSV2J3Nk1XVlBT?=
 =?utf-8?B?WVgxNEJoSm54cTFqeHFnZjBRMTVQNWVQWFBTR0htc0pyY2FMRlZMN0p1TVA5?=
 =?utf-8?B?eENxS2FYL3NlaUNzYnNPRk90ajJCell1WGsrVEYyWEl3bDdGeitEdEpLWVBT?=
 =?utf-8?B?aDVYbklZeTYrM0RaOU9DYVJqL21LcGdhSktXZFRybXVWeWQ3cEVaY2xCcGJK?=
 =?utf-8?B?Z2RkazN1Sm9RdC9iQVRmelF0bXV4aWhhck1Db1BVRTVoQ1VrNUpWZmZwaVdm?=
 =?utf-8?B?UnBINk1BdXBqYkFpUXo2ekZxMHRNdkwwNzNGOStWS0VtRWlDYVMvNThMTjd6?=
 =?utf-8?B?bnNVNkRTcUtxSkt1ekk1VERUcFlCVXphclVISWNUQmd0emFhK05vVGIwUTVu?=
 =?utf-8?B?dlBZVHpuOXNUOEYxU21jR3gwazJndHpUeVlkaHNhKysvMWJBZ29KTjhTdmVY?=
 =?utf-8?B?c3J4Y1ZRYnRpakNFaVE5MzNZcEltYUpKUTdBc2tBS3FqcHFJNHZxQko0S3ZN?=
 =?utf-8?B?MFZsZ0xwTWhkbUhiUXlZNHA5RnlqOXFkNVN3d0xYT2FxZWJHejg2K1VTVUZu?=
 =?utf-8?B?LzllWjlOOHpneVVJR3BWZ2ZGdjJoNnR1NlNOeXA4Vml6dUZRaVJRSUNFQTJi?=
 =?utf-8?B?d1FXa3VQYmJSVWovM0dTVCtyWW95cUllR243YW9qNGhIbURGUFpmeTF5ZTIw?=
 =?utf-8?B?V1dwN1AxQWVjZmtPVDAvbGpGUk9ySWluZTNHZjJWeDRwOTVBam42TEh4SjF2?=
 =?utf-8?B?NWpMalphekJPbE5qS096RTgvT1pka2w1ZDVHL2dlUUUxUmVUWE5yVnNvZjIy?=
 =?utf-8?B?YVkyWGZZTlFvYWQyeG1NT0o4TVBTdTR5bDVtczhRcjJDZW1aOWwyaUhFZitm?=
 =?utf-8?B?Rm11Zk03RzZWak1XUUdEQ2VTWUNsTUY4VU9wdlZxM2VXZHQrekFYR2VNbmZD?=
 =?utf-8?B?ckxKTk45WUROdnZkK2pvejExMnZJSkZ3aEpqc0hmNjBXWmY2YkVCbVE4REpG?=
 =?utf-8?B?bkhFc3VFOGFjNFY4MWwxUmVCaXZHN1Jnam04bUV1QnpUZWt2RHNSNzIxVDM0?=
 =?utf-8?B?VjkvSHZxZ2FCNjI3UGxkUTFqV3ZncmU4MFIxaGhrUkQ2WnNYWlBaNlZENFZw?=
 =?utf-8?B?U2hMMkF4eGNldlF0ckxKV0FTWmhnN0t3KzlhbmVpalBlb3BDUitwZW9GR0pC?=
 =?utf-8?B?RGFDMjJ5RS84TnNPNmk3QXk2RndtQ2d4YUZDZXNGWUxYdE90U0VQM0J4RWZq?=
 =?utf-8?B?UUVjRHE5cGJQdytseVdIMDFrRjBEd21CZk9WZ0ZvSngyK2ZUQUpnK0dBazI0?=
 =?utf-8?B?WVdqNVJZSkkzMTEvRXNUamJ0cnE2cG5YQWhBMmlwQi9BcXMwMGQxOGJCbXVM?=
 =?utf-8?B?VHppQ1RWS0lMM0ZqaXlWRXFTSmV1T0h6czBUUGg0YVdLRWgwT25aOTJZYXNy?=
 =?utf-8?Q?V47j+hOpzgVVO2m3rym4ZfvUHOT7wh9O?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 13:00:01.6523
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 0a0b4845-5fda-43f2-31ad-08dcbc61025b
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN2PEPF0000449F.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6188

Hi Ayan,

On 13/08/2024 19:13, Ayan Kumar Halder wrote:
> Moved init_domheap_mappings(), map_domain_page_global(),
> unmap_domain_page_global(), map_domain_page(), unmap_domain_page(),
> domain_page_map_to_mfn() to MMU specific folder.
Both the commit title and msg seem incorrect (you took them from v1, instead of v2).

With that changed (i.e. title and msg taken from v2):
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 13:04:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 13:04:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777162.1187350 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDfv-0002L2-5b; Wed, 14 Aug 2024 13:04:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777162.1187350; Wed, 14 Aug 2024 13:04:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDfv-0002Kv-2q; Wed, 14 Aug 2024 13:04:27 +0000
Received: by outflank-mailman (input) for mailman id 777162;
 Wed, 14 Aug 2024 13:04:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seDft-0002Km-W7
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 13:04:25 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bab29f77-5a3d-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 15:04:24 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-a7aa4ca9d72so799623966b.0
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 06:04:24 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f414e069sm171809366b.178.2024.08.14.06.04.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 06:04:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bab29f77-5a3d-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723640664; x=1724245464; 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=v/IJYD1EyEk7jcVWEg2Wzk668lwUCheNZ0SMeFsc9Ys=;
        b=F/7MjmxT57Lw5cbBj2QTfmSdBJgjAI+yapXQvqnf3H9Qe/WyPXRma2m4TWIwJMCeks
         3xSNeQqH6H/3maZ4TslRjjwhvkpZ+t9HlFldSQqpsKG0S2R5qJWrVqVf4pl1tqfcc2KO
         fyGlg9LeFgCPwuyAD53SIeCmug2iJLfqnzzFI5NTjoixAX1FqN36k0vZpSC3FkgtbHXG
         uNLF7KmlGRe8bZmKcpPA+/alxW9HzX595BksMAzuXyQk2I5FBuRiNlTBA2lOQkAaVNJY
         RO7+e4iqNt9GJ1aFZZnw/xxRlrG75rENIkVSvBMzjxYlGYTFSkGnZ8bfJ1DXwWl7XVI6
         bxbw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723640664; x=1724245464;
        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=v/IJYD1EyEk7jcVWEg2Wzk668lwUCheNZ0SMeFsc9Ys=;
        b=cy6SH/W2BELmCXrC9Z98BUgyV+VSggfGimUFjM9vcWGkuPutQLAW9pUEVe2t+auYJq
         3xo8GjYfgPAFj+ikHrDhTYCNVg/7FH7z7OE5pjEt9Mc9vvq0lA9b9OiNpMK2fGw3G8wU
         Fe/IT/jiSaCum0mL5oZArYfFA+5ZEBqUHYBOn7hGS6wgD8K43VCPDP5R4mlU6NhsoZ8c
         nbka5q5hKLT6+9qn0kZ+lv73mO50XgVcG+6I7Rl9V8Z0RrenVltVWzFgE2AwcMRC+9Rb
         9MN6Gl71wRC7cTGtuAHK74LymNEzirppLUpC7m0Q1gGlBGmVfApILog/5yTxvcPlxMGH
         4KSA==
X-Gm-Message-State: AOJu0YwG97Ratj0JGDl1mB7HSsngbUtMAmLnAm6FGmRYSDAlVBEx5ggX
	eF/ngakygStYUWAWDaatChU8iVdDqUFs7ufKAgZRemPvrEcrDpMNoecRg5WG7g==
X-Google-Smtp-Source: AGHT+IGv2wocqvhsd6bnRlLLycPovY5DGcRN8nkXt9LniFO+csXthUyI//hbe9mTfYgkk41E5f5gIA==
X-Received: by 2002:a17:907:efcb:b0:a7a:b643:654b with SMTP id a640c23a62f3a-a8366ff3f92mr173225866b.50.1723640663667;
        Wed, 14 Aug 2024 06:04:23 -0700 (PDT)
Message-ID: <d68440cd-32b4-4221-a569-ba1b7530781c@suse.com>
Date: Wed, 14 Aug 2024 15:04:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
To: Ayan Kumar Halder <ayankuma@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com,
 julien@xen.org
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
 <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
 <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
 <dad27ab7-3cbd-4a8e-8200-adea52b26e55@suse.com>
 <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 14.08.2024 14:33, Ayan Kumar Halder wrote:
> On 14/08/2024 12:35, Jan Beulich wrote:
>> On 14.08.2024 12:55, Ayan Kumar Halder wrote:
>>> On 14/08/2024 07:37, Jan Beulich wrote:
>>>> On 13.08.2024 19:13, Ayan Kumar Halder wrote:
>>>>> From: Penny Zheng <penny.zheng@arm.com>
>>>>>
>>>>> Introduced CONFIG_VMAP which is selected by the architectures that use
>>>>> MMU. vm_init() does not do anything if CONFIG_VMAP is not enabled.
>>>>>
>>>>> VMAP is widely used in ALTERNATIVE feature to remap a range of memory
>>>>> with new memory attributes. Since this is highly dependent on virtual
>>>>> address translation, we choose to fold VMAP in MMU system.
>>>>>
>>>>> In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
>>>>> only support in MMU system on ARM architecture. And ALTERNATIVE now
>>>>> depends on VMAP.
>>>>>
>>>>> HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP as speculative
>>>>> attacks are not possible on non MMU based systems (ie Cortex-R52, R82).
>>>>> See https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability.
>>>> While I'm not an Arm expert and hence I'm likely missing aspects, I question
>>>> the one (Spectre-BHB) vulnerability there to be sufficient to draw a
>>>> conclusion towards the usefulness of branch hardening. I would advise
>>>> against encoding such a connection in the Kconfig dependencies.
>>> AFAIU, to address 'Spectre' like vulnerabilities 'branch hardening' was
>>> added.
>>>
>>> See https://lore.kernel.org/all/E1fNadD-0000fz-9r@rmk-PC.armlinux.org.uk/
>>>
>>> And from
>>> https://lists.linaro.org/archives/list/linux-stable-mirror@lists.linaro.org/message/F4MGL4WT2R7T54NLRDGKFRQNSXF3DZGD/
>>>
>>> Spectre is valid on MMU based systems.
>> Since then various other issues / flavors were found. I've been focusing
>> on the x86 side of things, but I'd be very surprised if some didn't
>> affect other architectures as well.
> 
> We are talking about Arm here as "HARDEN_BRANCH_PREDICTOR" is specific 
> to Arm.
> 
> https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability 
> covers all the flavours and it does not include Cortex-R82 or R52.
> 
> It says the following :-
> 
> "Cortex-R cores typically use a closed software stack. In those 
> environments, applications or processes are strictly controlled, and 
> therefore not exploitable"
> 
>> Plus branch hardening can be a pre-
>> cautionary measure, too, I think.
> 
> The first two Arm non MMU cores that we wish to support in the 
> forthcoming series is Cortex-R82 and R52.
> 
> As seen in https://developer.arm.com/documentation/ka005109/latest/, it 
> explicitly states the following about R82
> 
> The Cortex-R82 implements the faulting feature (FEAT_FPAC) but is not 
> vulnerable. The Cortex-R82 behaves differently than vulnerable A-class 
> CPUs when speculatively executing past an instruction that authenticates 
> PAC, and that behavior does not allow the attack software to create the 
> "oracle".
> 
> We can re-enable branch hardening if we know there is a valid non MMU 
> Arm core which is vulnerable.
> 
> Let me know if you are ok with the rationale.

I'm okay with any rationale. As indicated, I'm likely missing (large) parts
of the picture here. The connection between the two Kconfig settings merely
seemed questionable to me, hence the comment.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 13:07:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 13:07:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777172.1187361 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDiu-0003a9-Lt; Wed, 14 Aug 2024 13:07:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777172.1187361; Wed, 14 Aug 2024 13:07:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDiu-0003a2-Gv; Wed, 14 Aug 2024 13:07:32 +0000
Received: by outflank-mailman (input) for mailman id 777172;
 Wed, 14 Aug 2024 13:07:31 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DSq6=PN=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1seDit-0003Zw-33
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 13:07:31 +0000
Received: from NAM02-BN1-obe.outbound.protection.outlook.com
 (mail-bn1nam02on20626.outbound.protection.outlook.com
 [2a01:111:f403:2407::626])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 280c4346-5a3e-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 15:07:28 +0200 (CEST)
Received: from BL1PR13CA0207.namprd13.prod.outlook.com (2603:10b6:208:2be::32)
 by SN7PR12MB8601.namprd12.prod.outlook.com (2603:10b6:806:26e::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Wed, 14 Aug
 2024 13:07:24 +0000
Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com
 (2603:10b6:208:2be:cafe::b4) by BL1PR13CA0207.outlook.office365.com
 (2603:10b6:208:2be::32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.17 via Frontend
 Transport; Wed, 14 Aug 2024 13:07:24 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Wed, 14 Aug 2024 13:07:23 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 08:07:23 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 14 Aug 2024 08:07:22 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 280c4346-5a3e-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=wsybrNecJ1gIVmqmm/lG1GEaI7ImQVhfrRW+0/j2quLE1F5A37PYyb4Vaja4qWz4H2C40uChMuL/qW8bT5Ou9DkG6OD6/OgpZkavYhSl8LGYNa/pmazCMnDTOOpkJF7C1NGnACQQubqDorMjDv9GWxu1iPNI8sOpytHJyYnpXx/Po4rCI8UsNsnUFPjWnyhbKZc5izM9UuIRzP5uL6rEuu2fLpqQXDIfESqbmsOzEovYTcAoNfEk8OcZtbyA4nD49eZfSgopnkzPuHrl3wcH2ShQiZkjSV6jISymcbxrejvFAUHjSKsAVfQbUIQ/5PWXPhIuNJooZuFWxpe2Eu9V2g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KPwj/vChWsenE7tFkQiMk4xYMbIBjXb1wFHjj+tYQ/0=;
 b=sxsUOmD/c+b164+Wnl7PAzhUY6dB4pZl7OP8r6MreZNHyE/ZyvqjUas0vsZWRzMTm8T16wxOfEVndIFywL7t5wSFot/s6ZHd/kiwBpsiwzt8k1rb8+AtIXeAsmzcXTIrpKniVzgs5LCuY3c+nL7uRnu8Jk873lDzgaxpf0tAP7mJIaDP+yHdHOxryFt1+5pBLgUZdsXte1yBR8X7E5rIl8wWujVYUjB+OnG7A8U3EDmGCbGpo/AwrrRpiWekAS7Dblsr/0MNSDbUlT9fSgIADxc+itrT2W3zNOVy4LzxC9O7QY+4TrlbxuuQAdt/mfxQE+z4suf39fW5zT+LnnXTfQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KPwj/vChWsenE7tFkQiMk4xYMbIBjXb1wFHjj+tYQ/0=;
 b=YCyXMmntItCNHn2Er14YQvfiA7DybKWivgkGSf74tNzeQ3lDs4FmrAEHRbkHFOEFw0jpL5wafBQTDBrVHvQxcGkYzCVr5uGIeSjWWp3a3lG/jmCcOqF3OoM2HhpzP4Fkg8stdjweCJB+/I3PyyUl1chl++oQhJfqzZhs5OljAo4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <4582dfd9-32d8-4135-acd1-568256141af2@amd.com>
Date: Wed, 14 Aug 2024 15:07:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 4/4] xen: arm: Enclose access to EL2 MMU specific
 registers under CONFIG_MMU
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, <sstabellini@kernel.org>,
	<bertrand.marquis@arm.com>, <Volodymyr_Babchuk@epam.com>, <julien@xen.org>,
	<jbeulich@suse.com>
CC: <xen-devel@lists.xenproject.org>
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-5-ayan.kumar.halder@amd.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240813171356.46760-5-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB03.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4B:EE_|SN7PR12MB8601:EE_
X-MS-Office365-Filtering-Correlation-Id: 2890cdbe-a7f9-41d4-495d-08dcbc6209fe
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|82310400026|376014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?SW1aanNmaVhuTS9mZkpkSnNDUUp4OXRuc0luVStGb09Bdldid3ZSempJQnpp?=
 =?utf-8?B?aTBFSEVQY1N1ZU40Z0ZXVDI1bGxuZjF2cTJzd0RNMDh3RlhFcHRUSlhHUHpw?=
 =?utf-8?B?dlhkbjM1bHpBOE56dExYYTNobGFJUk1GWFlkMWtobDlKekVpcUt4d1lWZUEz?=
 =?utf-8?B?bStEakhKNk40Z1NKMjdMczZEcklXUDB6dXc4RlZhaTh0VGdXVDY2Rjl3b3hu?=
 =?utf-8?B?WEpoTE1uVnNGMVZ1aWFYU2VGcHlPS2N4Z2tQdVJXK0dPZ0VFbnBJNkNtZ1A5?=
 =?utf-8?B?MmpZQTVEMktyQkdXUit3ZlBlR2drcnp2K0ZlRXUxUGJNaWFWZUM5MVAxR3dO?=
 =?utf-8?B?a3JqYm80eW5NZDBxN2grVWlsanQzSlIvMW5tbFhuQnI2dURBY0xPSTNZL0RK?=
 =?utf-8?B?cFp4VU9pS1VwaXBwekkvdzI2TnNPakdGZlZ4Ukt5NG1Vc0p5NFNOUHl4QzNm?=
 =?utf-8?B?SmVEc281cy94eExBK0YyQjh6THNKaWw0dXFzZ25HWDQyYVFKRU9SR3BpYVpS?=
 =?utf-8?B?MUZqMFNZTXpHdU9zTFppd3NhOWtyMmp4dGJla3BCckR6VTRWOGRranpjMUdO?=
 =?utf-8?B?bW1NTWZMV0lHaUZVbTdudmgyVjZUY1RkcWtkOHNuMFZiV3BxOGhYUXVNZGVK?=
 =?utf-8?B?dEJzemZDTHUxMERndXo3UzJlQVB4d0owYzVVZEprTkpvZTFtYmRuZlB1ZEFj?=
 =?utf-8?B?MmZ0NDVEZHMxTGFiTnZaSDRQNDBoMHBuYzZGK1BiK2YySmFUQWZ4UGwxRk9h?=
 =?utf-8?B?dGlOU2lrN2JlcGgxaERDbUZhOHpqZVMycGNVS3FKRG04L3c3YjVHODN2N0ZI?=
 =?utf-8?B?dzNhT1ZSaWd2WFRlaDZkME5NNE5Xc3dqQU9VeWxkT3I2TVlCcTBaMU9OMzJw?=
 =?utf-8?B?TDdNTk1yeVh1QWF1bXZPYkdYb1J5UjNsNVYzTnZpWnZtTHpUdWZFdnB4V2xK?=
 =?utf-8?B?dEZPU25VRkMvaklBd1hxQVZDcVdaQXFkWjY2NFJXdzJzdFlDcDByNUxPNWdC?=
 =?utf-8?B?WmlMUWI1TmpFcnltR1Q3UndFM0NsQzlSUFcrdk1VVmwzL2ZFR3hVam1xYjlG?=
 =?utf-8?B?RW9BbnVDUDc4VEVoUDRBNkllckMrMVFtTnJWdUFQNFhmRStPem1oMlhNU3NX?=
 =?utf-8?B?UUE1WDRhY3JjVG1BL0l5cWVNZUlEdjFQUEFLdDdsNndqNGNuUm1ucE0xcVRt?=
 =?utf-8?B?d1lSbU9IbC9jcHcrdVpwS1FoWVdsbXhOVEtOTXNxaFNrci95OEtpM2NVR2tF?=
 =?utf-8?B?UmFoTStnL3FldlR6amNzWm54VG1mSjhpMjBneDhlUjk0YVA3TStWY2hINjZF?=
 =?utf-8?B?Qit1WVJlSlptSTZvS0pCVEowVWdVZWpqWXUyYkpZaWZOSEQ0UDNOdEdlRUJr?=
 =?utf-8?B?WEF1NGt0bG1iMXNyR2xLY3VnSWVjNGtYWjhyMWwxODYzZkRUV01SenVpb1Fw?=
 =?utf-8?B?WTBQR3VFM0RyWk5RSS9oYzBPeGhkQXRvcHREazlHcXgzZ1FQRm54cEsxbC9w?=
 =?utf-8?B?Ym9RaUVRUm5tVnVtTS9ad1J3QkFpZ0FTbUdDN0tkbDlTRjk3bHpWSktoQ1dV?=
 =?utf-8?B?SEZGQ1daSmU1WG1yQ0llQ1NBUndQa0hFV3gxcSt6disxdm1wMXF5UDU3cExl?=
 =?utf-8?B?NG8rK0ZjUlhHRDJuTHVCemJEMVNJUmlDdHkrVDZSNG9naUJkaUpuMTFJM3o4?=
 =?utf-8?B?TEQyR2JhUTZVemMyUFBiNStwMkRJc2M4em1jZERoaUkyRWQyYi9lWU1rUUlq?=
 =?utf-8?B?ZEg0U29qd2xKT1pBQVpBZnEvbC9HWFk1RElRSnpNTWlwTTFvR2JkMG4wV1RH?=
 =?utf-8?B?bnFoZG5RRkdpb2NvTm1wSTE5U3c3WnkwbUFJdFNuN3J0Z25VOVhmVE8rQVFH?=
 =?utf-8?B?S08xTE42ckFhbmt1aEhsY3FNU0pVcEcwNXprVks5eDE2WTRVeFFZWkdZamYy?=
 =?utf-8?Q?vuZxscFc1L8Tc2DL+xSVR+ITK3yIhdP3?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(376014)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 13:07:23.9463
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 2890cdbe-a7f9-41d4-495d-08dcbc6209fe
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL6PEPF0001AB4B.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8601

Hi Ayan,

On 13/08/2024 19:13, Ayan Kumar Halder wrote:
> All the EL2 MMU specific registers are enclosed within CONFIG_MMU.
"Also, protect vttbr_el2 field of struct reg_ctxt and accesses to it."

> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>

Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 13:10:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 13:10:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777179.1187369 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDlx-00052J-0P; Wed, 14 Aug 2024 13:10:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777179.1187369; Wed, 14 Aug 2024 13:10:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDlw-00052C-Ts; Wed, 14 Aug 2024 13:10:40 +0000
Received: by outflank-mailman (input) for mailman id 777179;
 Wed, 14 Aug 2024 13:10: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=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seDlv-000526-2v
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 13:10:39 +0000
Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com
 [2a00:1450:4864:20::52b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 982fc555-5a3e-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 15:10:36 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5a1c49632deso7281341a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 06:10:36 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd1a602115sm3810151a12.96.2024.08.14.06.10.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 06:10:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 982fc555-5a3e-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723641035; x=1724245835; 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=FeI75yeiARCn/mSaXsunSQAiUZWCKF8aMBhS201F18Y=;
        b=elPWQFXI/R5tv8qv00tMFx04HcDethJHfWzDy4W2/nrduK3zlnFuIiFepy42kTJ/w2
         6n/7e4drzIv+rV/KlBjPCUveYeuYB+5Ig9QY/5lqBX5HFsFst1yfxaWdbdGXFkBNUbkN
         NSpidwCMcX2KTxaDI49sISQ0QYNGeBWDUF0uwoBcjbEN2QwoG+cNQUmw6+Pe+J8D444u
         G0O2/IYaXuP9qZoNgw/6eeeTcoK+YxcIkftoSaytk1NPKKe3N8Zy3JWswZIoGT9h2sMs
         geBvRFXJhD0Xy3tJ8K0SmLbyBxGCP2qPTpgE3IjPx4A2srZkFPCaOhlJuXqgRAIjeVEk
         lR2w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723641035; x=1724245835;
        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=FeI75yeiARCn/mSaXsunSQAiUZWCKF8aMBhS201F18Y=;
        b=T7MlflVeU88zrNMHaQmqxeUOwrWKioMgF7lgNvx0YCVK/Ax4cWD7UorttMid2ZSfm4
         6c9vPOCnFZXrHg9578iSGpqMIHD6K6Gv1MhplUEnOfSMKPBEX8GRxC11O/ngBCuIZ2/W
         oxUGmAMPpxB/zGrLB9VhHQ/8La6Ua1HLFZhSKvoezfk7rSh3szfdhJXrlavh45/YCO5d
         ypVLueEN9bE0kuwf8MbDrhPEJXmFE6/d90RzMxyiKeqRbEwi/AJGEKinQSu5/Otp0iVp
         8ltoCW4ZbQKwKfbCO3hnHAaTZbWwCoIYvistjRf6GgJqmMWumvcgqotUAiyNClmY4R4c
         eo2w==
X-Forwarded-Encrypted: i=1; AJvYcCVXVtYSbQM7K/FMlhfkU9tmp5CCVdtGAWxMOJCG88tOezYyJyIDZvu0M5L30ccI0Oi2sAZ31VKckRiiBielD1Xshizr8raVrXWfksNi8no=
X-Gm-Message-State: AOJu0YxOtCwj3fiujugvoxEHP06iHeYIxQkXJOMMreZCfLIyR+TN2RGL
	SfTaR/iJ4JGm4DZSl5JZGsf+TodOLxc+2yCPuDPI1ZJ5AGEi315sQMumymsjXA==
X-Google-Smtp-Source: AGHT+IFBy3pXOAFh5OudBhfQn9A2gpUMD2IbGOBx15I4vUIEfobzVX33Z3HKuczUkjZA0KJnuCraRQ==
X-Received: by 2002:a05:6402:34cc:b0:59e:686b:1874 with SMTP id 4fb4d7f45d1cf-5bea1c6cc31mr2245084a12.6.1723641035363;
        Wed, 14 Aug 2024 06:10:35 -0700 (PDT)
Message-ID: <111eb480-2aed-4a9c-b9f8-8657a9cb1c36@suse.com>
Date: Wed, 14 Aug 2024 15:10:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: don't call ->read_segment() with x86_seg_none
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <81ae365f-98b4-4bb6-bbb6-c5423dfda038@suse.com>
 <a7d15429-ce49-43b1-9bbd-7b0129094388@citrix.com>
 <e0081fc2-c631-45a0-a847-edc8dcc3988e@suse.com>
 <3cc3f16b-bdc2-45e7-9a6b-fd6270e952c2@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <3cc3f16b-bdc2-45e7-9a6b-fd6270e952c2@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 14.08.2024 14:49, Andrew Cooper wrote:
> On 12/08/2024 3:05 pm, Jan Beulich wrote:
>> On 12.08.2024 15:04, Andrew Cooper wrote:
>>> On 05/08/2024 2:26 pm, Jan Beulich wrote:
>>>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>>>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>>>> @@ -839,7 +839,8 @@ protmode_load_seg(
>>>>          case x86_seg_tr:
>>>>              goto raise_exn;
>>>>          }
>>>> -        if ( !_amd_like(cp) || vcpu_has_nscb() || !ops->read_segment ||
>>>> +        if ( seg == x86_seg_none || !_amd_like(cp) || vcpu_has_nscb() ||
>>>> +             !ops->read_segment ||
>>>>               ops->read_segment(seg, sreg, ctxt) != X86EMUL_OKAY )
>>>>              memset(sreg, 0, sizeof(*sreg));
>>>>          else
>>> While this fixes the crash, I'm not sure it will behave correctly for
>>> VERR/VERW.
>>>
>>> protmode_load_seg() is unconditionally X86EMUL_OKAY for a NULL selector,
>>> and VERW checks for type != 0x8 which an empty attr will pass.
>> That's past an sreg.s check, which will have failed (for sreg coming back
>> all clear).
> 
> Oh, so it is.
> 
> Any chance I could talk you into folding this hunk in too?
> 
> diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c
> b/xen/arch/x86/x86_emulate/x86_emulate.c
> index 902538267051..d4d02c3e2eb3 100644
> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> @@ -2852,7 +2852,7 @@ x86_emulate(
>                                              &sreg, ctxt, ops) )
>              {
>              case X86EMUL_OKAY:
> -                if ( sreg.s &&
> +                if ( sreg.s /* Excludes NULL selector too */ &&
>                       ((modrm_reg & 1) ? ((sreg.type & 0xa) == 0x2)
>                                        : ((sreg.type & 0xa) != 0x8)) )
>                      _regs.eflags |= X86_EFLAGS_ZF;
> 
> 
> because it is relevant to judging whether the subsequent logic is
> correct or not.

No problem at all. Am I okay to commit then, with Stefano's R-b?

>> Also if there was a concern here, it would be orthogonal to the adding of
>> the seg_none check: It would then have been similarly an issue for all
>> possibilities of taking the memset() path.
>>
>>> Interestingly, both Intel and AMD state that the NULL selector is
>>> neither readable nor writeable.
>> Which makes sense, doesn't it? A nul selector is really more like a
>> system segment in this regard (for VERR/VERW).
> 
> In the 32bit days, yes, the NULL selector was entirely unusable, but
> that changed in 64bit.
> 
> So IMO it really depends on whether VERR/VERW means "can I use this
> selector for $X", or "what does the GDT/LDT say about $X".
> 
> AMD say "Verifies whether a code or data segment specified by the
> segment selector in the 16-bit register or memory operand is readable
> from the current privilege level."
> 
> Intel say "Verifies whether the code or data segment specified with the
> source operand is readable (VERR) or writable[sic] (VERW) from the
> current privilege level (CPL)."
> 
> So that's clearly the former meaning rather than the latter meaning.

Not really. There's no "code or data segment" specified with a nul
selector. The use of GDT/LDT is implicit in this wording, but imo
it is there.

>>> Also, looking at the emulator logic, we're missing the DPL vs
>>> CPL/RPL/Conforming checks.
>> There's surely nothing "conforming" for a nul selector. Hence perhaps you
>> refer to something entirely unrelated?
> 
> Sorry, yes.  I think this is a general bug in how we emulate VERW/VERR,
> unrelated to this specific OSS-fuzz report.

I'll check that later and reply separately (here or with a patch).

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 13:12:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 13:12:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777187.1187380 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDo1-0005aJ-C6; Wed, 14 Aug 2024 13:12:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777187.1187380; Wed, 14 Aug 2024 13:12:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDo1-0005aC-9C; Wed, 14 Aug 2024 13:12:49 +0000
Received: by outflank-mailman (input) for mailman id 777187;
 Wed, 14 Aug 2024 13:12: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=2uER=PN=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1seDnz-0005a2-DH
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 13:12:47 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e554c99f-5a3e-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 15:12:45 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a7aac70e30dso737597466b.1
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 06:12:45 -0700 (PDT)
Received: from [192.168.1.10] (host-92-26-98-202.as13285.net. [92.26.98.202])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f3f49755sm172376066b.28.2024.08.14.06.12.44
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 06:12:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e554c99f-5a3e-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723641165; x=1724245965; 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=QRnO04ls6IdcK3sY/OonZh8ZNn0C6EQZvENtQtlXoVs=;
        b=kM/KTTkA9TeBtr8jg/nLHaT2RF/nPWcacmRkcLuav7ZX4s3WshkteNoo5jqtREoy61
         /RVMJpa9cbd4KhO4RkN2TOJJmcrMBPZAejpXdBHipZnQbhU3NgEDkBuXFSj+xbjFjoJL
         8IMR9n4nV+WwKZDw/E2uE0w4T0XnoaJXEZuAY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723641165; x=1724245965;
        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=QRnO04ls6IdcK3sY/OonZh8ZNn0C6EQZvENtQtlXoVs=;
        b=xC2Isf4kszwiv+Bl+1iaytePHqOYnfKqPBKuaDDYAaltk83IZeQ9VY8+jzPPuZ92kb
         vv565+br0ZiCAmZxqeE3RM3Z0KF5MLCBN0JXLn9B9VROEjj2a13xaVEqKVehgiahaLuS
         ijT61dvRvw+aYHSveVCNAm4isj8bUTJakg/8Mj+ejWH2zqYDy8+8Yn3rtGgoE7iyxBQO
         NoHh910rhRJaH6G2lGMjG9eqkluJX8D/TI0dvz2W1je1dFD6Lj/dwscadAf7L9qxV5o6
         FfNGPBuIvFL/Ig3gYsiR4776k6QElSnqdJwoBEWYCFyvfO2mERnjgDfr9FiPQ5P6Gkbf
         qoKg==
X-Forwarded-Encrypted: i=1; AJvYcCUV9DjuvBSdKAHELhPMNI3T7+8oFyUmPn2OchyFRUEMiMOTgsnxBojZKCbexYTwmXABBq9P6WqX234VCpUXs6ddkPQj7uF4nPzhSnGW7iY=
X-Gm-Message-State: AOJu0YxnzCyauJJXH94KnnXezOGEUiQoRjTJtGlMJBSzMvluCOz0MLeC
	G+KWnXxFbRehkfT9WzfeCPnWDifZV1g1KEJ6gkJKrxarhpr2Non7GTXoP/htLV4=
X-Google-Smtp-Source: AGHT+IFOvMwz8sBhSuwopCHIDI6HyCXGJ6ZOGsIGQun1aP8xZ6ZcUPjqu8IhSQJJy6FtjxuiH2N+tg==
X-Received: by 2002:a17:906:6a09:b0:a7d:e84c:a9ed with SMTP id a640c23a62f3a-a83670b074emr198754666b.65.1723641164752;
        Wed, 14 Aug 2024 06:12:44 -0700 (PDT)
Message-ID: <087a64da-a3a0-42be-b4d4-8f28396336db@citrix.com>
Date: Wed, 14 Aug 2024 14:12:43 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: don't call ->read_segment() with x86_seg_none
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <81ae365f-98b4-4bb6-bbb6-c5423dfda038@suse.com>
 <a7d15429-ce49-43b1-9bbd-7b0129094388@citrix.com>
 <e0081fc2-c631-45a0-a847-edc8dcc3988e@suse.com>
 <3cc3f16b-bdc2-45e7-9a6b-fd6270e952c2@citrix.com>
 <111eb480-2aed-4a9c-b9f8-8657a9cb1c36@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <111eb480-2aed-4a9c-b9f8-8657a9cb1c36@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 14/08/2024 2:10 pm, Jan Beulich wrote:
> On 14.08.2024 14:49, Andrew Cooper wrote:
>> On 12/08/2024 3:05 pm, Jan Beulich wrote:
>>> On 12.08.2024 15:04, Andrew Cooper wrote:
>>>> On 05/08/2024 2:26 pm, Jan Beulich wrote:
>>>>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>>>>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>>>>> @@ -839,7 +839,8 @@ protmode_load_seg(
>>>>>          case x86_seg_tr:
>>>>>              goto raise_exn;
>>>>>          }
>>>>> -        if ( !_amd_like(cp) || vcpu_has_nscb() || !ops->read_segment ||
>>>>> +        if ( seg == x86_seg_none || !_amd_like(cp) || vcpu_has_nscb() ||
>>>>> +             !ops->read_segment ||
>>>>>               ops->read_segment(seg, sreg, ctxt) != X86EMUL_OKAY )
>>>>>              memset(sreg, 0, sizeof(*sreg));
>>>>>          else
>>>> While this fixes the crash, I'm not sure it will behave correctly for
>>>> VERR/VERW.
>>>>
>>>> protmode_load_seg() is unconditionally X86EMUL_OKAY for a NULL selector,
>>>> and VERW checks for type != 0x8 which an empty attr will pass.
>>> That's past an sreg.s check, which will have failed (for sreg coming back
>>> all clear).
>> Oh, so it is.
>>
>> Any chance I could talk you into folding this hunk in too?
>>
>> diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c
>> b/xen/arch/x86/x86_emulate/x86_emulate.c
>> index 902538267051..d4d02c3e2eb3 100644
>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>> @@ -2852,7 +2852,7 @@ x86_emulate(
>>                                              &sreg, ctxt, ops) )
>>              {
>>              case X86EMUL_OKAY:
>> -                if ( sreg.s &&
>> +                if ( sreg.s /* Excludes NULL selector too */ &&
>>                       ((modrm_reg & 1) ? ((sreg.type & 0xa) == 0x2)
>>                                        : ((sreg.type & 0xa) != 0x8)) )
>>                      _regs.eflags |= X86_EFLAGS_ZF;
>>
>>
>> because it is relevant to judging whether the subsequent logic is
>> correct or not.
> No problem at all. Am I okay to commit then, with Stefano's R-b?

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

and don't forget the conversion to

Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=70918

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 13:22:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 13:22:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777201.1187389 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDxR-0007v0-CT; Wed, 14 Aug 2024 13:22:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777201.1187389; Wed, 14 Aug 2024 13:22:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDxR-0007ut-9x; Wed, 14 Aug 2024 13:22:33 +0000
Received: by outflank-mailman (input) for mailman id 777201;
 Wed, 14 Aug 2024 13:22:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seDxQ-0007un-QW
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 13:22:32 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 42c98bc4-5a40-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 15:22:31 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5af6a1afa7bso7694191a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 06:22:31 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f411b536sm170627266b.137.2024.08.14.06.22.30
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 06:22:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 42c98bc4-5a40-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723641751; x=1724246551; 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=jLeNxn7AJ1sMXGbcOCfVV+yHbJrURsaNatRZLeQ1ddo=;
        b=Ht4vR1Pr9GfCngfe+5RPevR/a+KwmMEEuOaqPLiyCaKakSOCTClMb6K9bkpUdv5d+j
         56EJkoOssjwz9pwk9mlF0tCDRKAlmLq5V/T/k5+jm+CCzE+UG36+OfOc8cbdfsh9dJm5
         rk1b2zdXzUVrIOLVRqX1oDT01KgtIRWHV+Tgy8QjhFUFspOquIvzdVgr/HHDu4GpAdRD
         ezv8w+lac0YyGyOZM0NQtrgXA3+9215BUIelBuw5fF8+iBf7T5w4Ndtrv2BhBDLIVd+M
         aJrE2+pk0v8HSj3PmqgLUHplTZVZFo1PpHsMK1oBSwAVbHPHA0ILHIB9JwKxVZdxOuGz
         zxjQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723641751; x=1724246551;
        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=jLeNxn7AJ1sMXGbcOCfVV+yHbJrURsaNatRZLeQ1ddo=;
        b=D64WBtSGR7JWAp99zfnLJNPEZ4VOIogFr43Wtl3BBjEZe1Fu3q2U3wyh6EPy9BKyJY
         Emb0AUa+o+AOrh/uaycH23lV/T/FzSTv04yEhe9kuSrdUgReKDZ6GiTMoqJu/SxnnHsG
         48WcirML7B3ACLolbk4G6Se++Iam27le0qH4iYgRGye7Fa9SML02MWHc4y/LENFTywAm
         LQaSY9BLmydkpTgcT0MsZlD77lZb2QLIM0ULz2FXVJ5X9pTFp5j5Hu8gtwdtZv3Yc5ta
         g9ghX2DFfqJd/kKjfD4L8AAn8zteUg1PcZbPEnxBsfn6//wPjfRkhcHQPDXSz+LAOtfr
         VC9A==
X-Forwarded-Encrypted: i=1; AJvYcCVpys6LvUkHWT1e2v7DGiEXyNGXbdxGv/zTNxfl0DIQjXGMxp23J66gFQIhK2c8YhLsSz7FjTN9GilToJXnNoccxZ6Z1+KTZyVR7/d5CgE=
X-Gm-Message-State: AOJu0Yztw6Q9c8dCxxISne6bt+nTZmQ32hq9c6kdcC3o6vDQe0pZJC+l
	wZJhRjjzgORjueaFsTkzyqUsJob31nUxTRZVn9RLGKsa8KKWOf4jofOYL+GdKg==
X-Google-Smtp-Source: AGHT+IEENYskvceH3ssTqCxMfqDSJkfBSfs2dgpk/DoGRP8rZiXeLlwHsPTWkMs7IiABaM7qnvavGw==
X-Received: by 2002:a17:907:f143:b0:a7a:8e0f:aaed with SMTP id a640c23a62f3a-a8366fefc47mr187774366b.50.1723641751182;
        Wed, 14 Aug 2024 06:22:31 -0700 (PDT)
Message-ID: <022a142d-0d0f-4183-a89d-bcf10ce75689@suse.com>
Date: Wed, 14 Aug 2024 15:22:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: don't call ->read_segment() with x86_seg_none
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <81ae365f-98b4-4bb6-bbb6-c5423dfda038@suse.com>
 <a7d15429-ce49-43b1-9bbd-7b0129094388@citrix.com>
 <e0081fc2-c631-45a0-a847-edc8dcc3988e@suse.com>
 <3cc3f16b-bdc2-45e7-9a6b-fd6270e952c2@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <3cc3f16b-bdc2-45e7-9a6b-fd6270e952c2@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 14.08.2024 14:49, Andrew Cooper wrote:
> On 12/08/2024 3:05 pm, Jan Beulich wrote:
>> On 12.08.2024 15:04, Andrew Cooper wrote:
>>> Also, looking at the emulator logic, we're missing the DPL vs
>>> CPL/RPL/Conforming checks.
>> There's surely nothing "conforming" for a nul selector. Hence perhaps you
>> refer to something entirely unrelated?
> 
> Sorry, yes.  I think this is a general bug in how we emulate VERW/VERR,
> unrelated to this specific OSS-fuzz report.

In protmode_load_seg() we have

    case x86_seg_none:
        /* Non-conforming segment: check DPL against RPL and CPL. */
        if ( ((desc.b & (0x1c << 8)) != (0x1c << 8)) &&
             ((dpl < cpl) || (dpl < rpl)) )
            return X86EMUL_EXCEPTION;
        a_flag = 0;
        break;

Is there anything else you think is needed?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 13:24:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 13:24:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777207.1187400 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDzW-0008Ts-O8; Wed, 14 Aug 2024 13:24:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777207.1187400; Wed, 14 Aug 2024 13:24:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seDzW-0008Tl-La; Wed, 14 Aug 2024 13:24:42 +0000
Received: by outflank-mailman (input) for mailman id 777207;
 Wed, 14 Aug 2024 13:24:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seDzV-0008TI-6B; Wed, 14 Aug 2024 13:24:41 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seDzV-00012v-3d; Wed, 14 Aug 2024 13:24:41 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seDzU-000096-NO; Wed, 14 Aug 2024 13:24:40 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1seDzU-0000RE-MN; Wed, 14 Aug 2024 13:24:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ctjVKJT4j9gGCiqB3I26tKKb3hqMxDW0k6lF8UUcnQg=; b=2PMACbQ2HIr1pLOOCOrCZTpkfz
	RMorvb9eH9ODWELHz5Terf2Nm29sl+mPcadspFfaCxiAXiIPx+LnEcn3OK4YFTQU3mHqj/Yy9yYXa
	WBRhxZ6GLVafTe00lCQk9VEgt0vopNp2KFtxchkoAS7lBzeUBQ3UzmaIvhsO0Rar0BwA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187239-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187239: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=a73f8d19445a70b72701a7a95b6c3e274168918a
X-Osstest-Versions-That:
    xen=c36efb7fcea6ef9f31a20e60ec79ed3ae293feee
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 14 Aug 2024 13:24:40 +0000

flight 187239 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187239/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  a73f8d19445a70b72701a7a95b6c3e274168918a
baseline version:
 xen                  c36efb7fcea6ef9f31a20e60ec79ed3ae293feee

Last test of basis   187237  2024-08-14 04:02:21 Z    0 days
Testing same since   187239  2024-08-14 09:04:04 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Anthony PERARD <anthony.perard@vates.tech>
  Jan Beulich <jbeulich@suse.com>
  John E. Krokes <mag@netherworld.org>
  Juergen Gross <jgross@suse.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   c36efb7fce..a73f8d1944  a73f8d19445a70b72701a7a95b6c3e274168918a -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 13:25:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 13:25:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777227.1187410 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seE0V-0000ab-2D; Wed, 14 Aug 2024 13:25:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777227.1187410; Wed, 14 Aug 2024 13:25:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seE0U-0000aU-V1; Wed, 14 Aug 2024 13:25:42 +0000
Received: by outflank-mailman (input) for mailman id 777227;
 Wed, 14 Aug 2024 13:25:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=glz1=PN=xenbits.xen.org=julieng@srs-se1.protection.inumbo.net>)
 id 1seE0T-0000Zz-CW
 for xen-devel@lists.xen.org; Wed, 14 Aug 2024 13:25:41 +0000
Received: from mail.xenproject.org (mail.xenproject.org [104.130.215.37])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b19b2799-5a40-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 15:25:40 +0200 (CEST)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julieng@xenbits.xen.org>)
 id 1seE0L-00015O-PH; Wed, 14 Aug 2024 13:25:33 +0000
Received: from julieng by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <julieng@xenbits.xen.org>)
 id 1seE0L-0001xk-NV; Wed, 14 Aug 2024 13:25:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b19b2799-5a40-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:CC:From:To:MIME-Version:
	Content-Transfer-Encoding:Content-Type;
	bh=Y7PBCM24upHm5ZQZt2uHvLuBCEM77iHd0QNUm65etq8=; b=mHpuv4VPDxFyMpp5QLnhLZfZQ7
	zZxypwhs+Wncl8rjU9e3yNhADBYP/MWTdj8JpuUSS/CoVyyfyk+6s9qUBMVg1w0yFYkBbPu29/daN
	rPW8xu1ZQzISF1heFn2tEmJMPD0D8dj/TYVlQQhBkiPTQD/DrL8tnWShSMxOWkOl//sc=;
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.509 (Entity 5.509)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
 xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
CC: Xen.org security team <security-team-members@xen.org>
Subject: Xen Security Advisory 460 v2 (CVE-2024-31145) - error handling in
 x86 IOMMU identity mapping
Message-Id: <E1seE0L-0001xk-NV@xenbits.xenproject.org>
Date: Wed, 14 Aug 2024 13:25:33 +0000

--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

            Xen Security Advisory CVE-2024-31145 / XSA-460
                               version 2

             error handling in x86 IOMMU identity mapping

UPDATES IN VERSION 2
====================

Wording updated. Public release.

ISSUE DESCRIPTION
=================

Certain PCI devices in a system might be assigned Reserved Memory
Regions (specified via Reserved Memory Region Reporting, "RMRR") for
Intel VT-d or Unity Mapping ranges for AMD-Vi.  These are typically used
for platform tasks such as legacy USB emulation.

Since the precise purpose of these regions is unknown, once a device
associated with such a region is active, the mappings of these regions
need to remain continuouly accessible by the device.  In the logic
establishing these mappings, error handling was flawed, resulting in
such mappings to potentially remain in place when they should have been
removed again.  Respective guests would then gain access to memory
regions which they aren't supposed to have access to.

IMPACT
======

The precise impact is system specific.  Denial of Service (DoS)
affecting the entire host or individual guests, privilege escalation,
and information leaks cannot be ruled out.

VULNERABLE SYSTEMS
==================

Only x86 systems passing PCI devices with RMRR/Unity regions through to
guests are potentially affected.

PCI devices listed in a vm.cfg file have error handling which causes `xl
create` to abort and tear down the domain, and is thus believed to be
safe.

PCI devices attached using `xl pci-attach` will result in the command
returning nonzero, but will not tear down the domain.  VMs which
continue to run after `xl pci-attach` has failed expose the
vulnerability.

For x86 Intel hardware, Xen versions 4.0 and later are affected.

For all x86 hardware, Xen versions having the XSA-378 fixes applied /
backported are affected.

MITIGATION
==========

Assigning devices using the vm.cfg file for attachment at boot avoids
the vulnerability.

CREDITS
=======

This issue was discovered by Teddy Astie of Vates and diagnosed as a
security issue by Jan Beulich of SUSE.

RESOLUTION
==========

Applying the attached patch resolves this issue.

Note that patches for released versions are generally prepared to
apply to the stable branches, and may not apply cleanly to the most
recent release tarball.  Downstreams are encouraged to update to the
tip of the respective stable branch before applying these patches.

xsa460.patch           xen-unstable - Xen 4.16.x

$ sha256sum xsa460*
f4ca598f71e9ef6b9bc50803df2996b92d2e69afd8e36d9544823d7e56ec1819  xsa460.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of the patches and/or mitigations described above (or
others which are substantially similar) is permitted during the
embargo, even on public-facing systems with untrusted guest users and
administrators.

But: Distribution of updated software is prohibited (except to other
members of the predisclosure list).

Predisclosure list members who wish to deploy significantly different
patches and/or mitigations, please contact the Xen Project Security
Team.

(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAma8sCIMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZiSUIAMFWxhjNzhsuUGbrUVsO6oDIs7gOcVEsC3BlcsIp
LqetutOWHwR8B9jHeOjewZjgL/q1031qX+nCCcU/ilZtA7cAiVhPNrh4PSD/D9S5
RqUG3oSsFjSTtGwVl2JlqlHoE90tXOqLBhZFCJixQzaW3kbCfhDZdmufj8TQYBCQ
N3ioNAGwvmSeV8QPh8l3P7TRRsMwr0OTWQYtj7r4QuW+dDPJaKzbCpmWVaCPVeI2
uKUxwwIxSE9J9L1mUR34HIJR/clCFNqlcpc/MmQVz0qprBOh4jNDunN+JNDY1VXR
3P+N50ZnHCK5w1z+vjeVvZRyp9JDt2LDUj6XJ6G9IdvN1xA=
=vNzh
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa460.patch"
Content-Disposition: attachment; filename="xsa460.patch"
Content-Transfer-Encoding: base64

RnJvbTogVGVkZHkgQXN0aWUgPHRlZGR5LmFzdGllQHZhdGVzLnRlY2g+ClN1
YmplY3Q6IHg4Ni9JT01NVTogbW92ZSB0cmFja2luZyBpbiBpb21tdV9pZGVu
dGl0eV9tYXBwaW5nKCkKCklmIGZvciBzb21lIHJlYXNvbiB4bWFsbG9jKCkg
ZmFpbHMgYWZ0ZXIgaGF2aW5nIG1hcHBlZCB0aGUgcmVzZXJ2ZWQKcmVnaW9u
cywgYW4gZXJyb3IgaXMgcmVwb3J0ZWQsIGJ1dCB0aGUgcmVnaW9ucyByZW1h
aW4gbWFwcGVkIGluIHRoZSBQMk0uCgpTaW1pbGFybHkgaWYgYW4gZXJyb3Ig
b2NjdXJzIGR1cmluZyBzZXRfaWRlbnRpdHlfcDJtX2VudHJ5KCkgKGV4Y2Vw
dCBvbgp0aGUgZmlyc3QgY2FsbCksIHRoZSBwYXJ0aWFsIG1hcHBpbmdzIG9m
IHRoZSByZWdpb24gd291bGQgYmUgcmV0YWluZWQKd2l0aG91dCBiZWluZyB0
cmFja2VkIGFueXdoZXJlLCBhbmQgaGVuY2Ugd2l0aG91dCB0aGVyZSBiZWlu
ZyBhIHdheSB0bwpyZW1vdmUgdGhlbSBhZ2FpbiBmcm9tIHRoZSBkb21haW4n
cyBQMk0uCgpNb3ZlIHRoZSBzZXR0aW5nIHVwIG9mIHRoZSBsaXN0IGVudHJ5
IGFoZWFkIG9mIHRyeWluZyB0byBtYXAgdGhlIHJlZ2lvbi4KSW4gY2FzZXMg
b3RoZXIgdGhhbiB0aGUgZmlyc3QgbWFwcGluZyBmYWlsaW5nLCBrZWVwIHJl
Y29yZCBvZiB0aGUgZnVsbApyZWdpb24sIHN1Y2ggdGhhdCBhIHN1YnNlcXVl
bnQgdW5tYXBwaW5nIHJlcXVlc3QgY2FuIGJlIHByb3Blcmx5IHRvcm4KZG93
bi4KClRvIGNvbXBlbnNhdGUgZm9yIHRoZSBwb3RlbnRpYWxseSBleGNlc3Mg
dW5tYXBwaW5nIHJlcXVlc3RzLCBkb24ndCBsb2cgYQp3YXJuaW5nIGZyb20g
cDJtX3JlbW92ZV9pZGVudGl0eV9lbnRyeSgpIHdoZW4gdGhlcmUgcmVhbGx5
IHdhcyBub3RoaW5nCm1hcHBlZCBhdCBhIGdpdmVuIEdGTi4KClRoaXMgaXMg
WFNBLTQ2MCAvIENWRS0yMDI0LTMxMTQ1LgoKRml4ZXM6IDIyMDFiNjdiOTEy
OCAoIlZULWQ6IGltcHJvdmUgUk1SUiByZWdpb24gaGFuZGxpbmciKQpGaXhl
czogYzBlMTlkN2M2YzQyICgiSU9NTVU6IGdlbmVyYWxpemUgVlQtZCdzIHRy
YWNraW5nIG9mIG1hcHBlZCBSTVJSIHJlZ2lvbnMiKQpTaWduZWQtb2ZmLWJ5
OiBUZWRkeSBBc3RpZSA8dGVkZHkuYXN0aWVAdmF0ZXMudGVjaD4KU2lnbmVk
LW9mZi1ieTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpSZXZp
ZXdlZC1ieTogUm9nZXIgUGF1IE1vbm7DqSA8cm9nZXIucGF1QGNpdHJpeC5j
b20+CgotLS0gYS94ZW4vYXJjaC94ODYvbW0vcDJtLmMKKysrIGIveGVuL2Fy
Y2gveDg2L21tL3AybS5jCkBAIC0xMjY3LDkgKzEyNjcsMTEgQEAgaW50IHAy
bV9yZW1vdmVfaWRlbnRpdHlfZW50cnkoc3RydWN0IGRvbQogICAgIGVsc2UK
ICAgICB7CiAgICAgICAgIGdmbl91bmxvY2socDJtLCBnZm4sIDApOwotICAg
ICAgICBwcmludGsoWEVOTE9HX0dfV0FSTklORwotICAgICAgICAgICAgICAg
Im5vbi1pZGVudGl0eSBtYXAgZCVkOiVseCBub3QgY2xlYXJlZCAobWFwcGVk
IHRvICVseClcbiIsCi0gICAgICAgICAgICAgICBkLT5kb21haW5faWQsIGdm
bl9sLCBtZm5feChtZm4pKTsKKyAgICAgICAgaWYgKCAocDJtdCAhPSBwMm1f
aW52YWxpZCAmJiBwMm10ICE9IHAybV9tbWlvX2RtKSB8fAorICAgICAgICAg
ICAgIGEgIT0gcDJtX2FjY2Vzc19uIHx8ICFtZm5fZXEobWZuLCBJTlZBTElE
X01GTikgKQorICAgICAgICAgICBwcmludGsoWEVOTE9HX0dfV0FSTklORwor
ICAgICAgICAgICAgICAgICAgIm5vbi1pZGVudGl0eSBtYXAgJXBkOiVseCBu
b3QgY2xlYXJlZCAobWFwcGVkIHRvICVseClcbiIsCisgICAgICAgICAgICAg
ICAgICBkLCBnZm5fbCwgbWZuX3gobWZuKSk7CiAgICAgICAgIHJldCA9IDA7
CiAgICAgfQogCi0tLSBhL3hlbi9kcml2ZXJzL3Bhc3N0aHJvdWdoL3g4Ni9p
b21tdS5jCisrKyBiL3hlbi9kcml2ZXJzL3Bhc3N0aHJvdWdoL3g4Ni9pb21t
dS5jCkBAIC0yNjcsMjQgKzI2NywzNiBAQCBpbnQgaW9tbXVfaWRlbnRpdHlf
bWFwcGluZyhzdHJ1Y3QgZG9tYWluCiAgICAgaWYgKCBwMm1hID09IHAybV9h
Y2Nlc3NfeCApCiAgICAgICAgIHJldHVybiAtRU5PRU5UOwogCi0gICAgd2hp
bGUgKCBiYXNlX3BmbiA8IGVuZF9wZm4gKQotICAgIHsKLSAgICAgICAgaW50
IGVyciA9IHNldF9pZGVudGl0eV9wMm1fZW50cnkoZCwgYmFzZV9wZm4sIHAy
bWEsIGZsYWcpOwotCi0gICAgICAgIGlmICggZXJyICkKLSAgICAgICAgICAg
IHJldHVybiBlcnI7Ci0gICAgICAgIGJhc2VfcGZuKys7Ci0gICAgfQotCiAg
ICAgbWFwID0geG1hbGxvYyhzdHJ1Y3QgaWRlbnRpdHlfbWFwKTsKICAgICBp
ZiAoICFtYXAgKQogICAgICAgICByZXR1cm4gLUVOT01FTTsKKwogICAgIG1h
cC0+YmFzZSA9IGJhc2U7CiAgICAgbWFwLT5lbmQgPSBlbmQ7CiAgICAgbWFw
LT5hY2Nlc3MgPSBwMm1hOwogICAgIG1hcC0+Y291bnQgPSAxOworCisgICAg
LyoKKyAgICAgKiBJbnNlcnQgaW50byBsaXN0IGFoZWFkIG9mIG1hcHBpbmcs
IHNvIHRoZSByYW5nZSBjYW4gYmUgZm91bmQgd2hlbgorICAgICAqIHRyeWlu
ZyB0byBjbGVhbiB1cC4KKyAgICAgKi8KICAgICBsaXN0X2FkZF90YWlsKCZt
YXAtPmxpc3QsICZoZC0+YXJjaC5pZGVudGl0eV9tYXBzKTsKIAorICAgIGZv
ciAoIDsgYmFzZV9wZm4gPCBlbmRfcGZuOyArK2Jhc2VfcGZuICkKKyAgICB7
CisgICAgICAgIGludCBlcnIgPSBzZXRfaWRlbnRpdHlfcDJtX2VudHJ5KGQs
IGJhc2VfcGZuLCBwMm1hLCBmbGFnKTsKKworICAgICAgICBpZiAoICFlcnIg
KQorICAgICAgICAgICAgY29udGludWU7CisKKyAgICAgICAgaWYgKCAobWFw
LT5iYXNlID4+IFBBR0VfU0hJRlRfNEspID09IGJhc2VfcGZuICkKKyAgICAg
ICAgeworICAgICAgICAgICAgbGlzdF9kZWwoJm1hcC0+bGlzdCk7CisgICAg
ICAgICAgICB4ZnJlZShtYXApOworICAgICAgICB9CisgICAgICAgIHJldHVy
biBlcnI7CisgICAgfQorCiAgICAgcmV0dXJuIDA7CiB9CiAK

--=separator--


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 13:26:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 13:26:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777239.1187448 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seE0s-0001sK-QN; Wed, 14 Aug 2024 13:26:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777239.1187448; Wed, 14 Aug 2024 13:26:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seE0s-0001sD-Nk; Wed, 14 Aug 2024 13:26:06 +0000
Received: by outflank-mailman (input) for mailman id 777239;
 Wed, 14 Aug 2024 13:26:05 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=glz1=PN=xenbits.xen.org=julieng@srs-se1.protection.inumbo.net>)
 id 1seE0r-0001rP-GZ
 for xen-devel@lists.xen.org; Wed, 14 Aug 2024 13:26:05 +0000
Received: from mail.xenproject.org (mail.xenproject.org [104.130.215.37])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bd711bdb-5a40-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 15:25:59 +0200 (CEST)
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julieng@xenbits.xen.org>)
 id 1seE0f-000169-Qj; Wed, 14 Aug 2024 13:25:53 +0000
Received: from julieng by xenbits.xenproject.org with local (Exim 4.92)
 (envelope-from <julieng@xenbits.xen.org>)
 id 1seE0f-0001zO-Nj; Wed, 14 Aug 2024 13:25:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bd711bdb-5a40-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Date:Message-Id:Subject:CC:From:To:MIME-Version:
	Content-Transfer-Encoding:Content-Type;
	bh=0cESxM2Nc/a1Y9sxbNz5glxIoFXz8cls7TNWojCBKls=; b=QRt+ev77BYIZc3zRSzK7lN7N7h
	HtQFzrEO7QlN1w5asF6q6/a+tsplonxv2w6lQDu2hj6XlRrjC9VJ6InRPccnGALUSZ7pRneaDFQpU
	uhhzSGScqu2jyBQJfeC+RxJLxt9JoZHNCFB1TIYuwsIZZfTbgAehsdTUzllPIMQVtKBg=;
Content-Type: multipart/mixed; boundary="=separator"; charset="utf-8"
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.509 (Entity 5.509)
To: xen-announce@lists.xen.org, xen-devel@lists.xen.org,
 xen-users@lists.xen.org, oss-security@lists.openwall.com
From: Xen.org security team <security@xen.org>
CC: Xen.org security team <security-team-members@xen.org>
Subject: Xen Security Advisory 461 v2 (CVE-2024-31146) - PCI device
 pass-through with shared resources
Message-Id: <E1seE0f-0001zO-Nj@xenbits.xenproject.org>
Date: Wed, 14 Aug 2024 13:25:53 +0000

--=separator
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

            Xen Security Advisory CVE-2024-31146 / XSA-461
                               version 2

             PCI device pass-through with shared resources

UPDATES IN VERSION 2
====================

Public release.

ISSUE DESCRIPTION
=================

When multiple devices share resources and one of them is to be passed
through to a guest, security of the entire system and of respective
guests individually cannot really be guaranteed without knowing
internals of any of the involved guests.  Therefore such a configuration
cannot really be security-supported, yet making that explicit was so far
missing.

Resources the sharing of which is known to be problematic include, but
are not limited to
- - PCI Base Address Registers (BARs) of multiple devices mapping to the
  same page (4k on x86),
- - INTx lines.

IMPACT
======

The precise effects when shared resources are in use are system, device,
guest, and resource specific.  None of privilege escalation, information
leaks, or Denial of Service (DoS) can be ruled out.

VULNERABLE SYSTEMS
==================

All systems making use of PCI pass-through are in principle vulnerable,
when any kind of resource is shared.  Just to re-iterate, even in the
absence of resource sharing caveats apply to passing through of PCI
devices to entirely untrusted guests.

MITIGATION
==========

Passing through only SR-IOV virtual functions or devices with well-
separated resources will avoid this particular vulnerability.  Passing
through all devices sharing a given resource to the same guest will also
avoid this particular vulnerability.

RESOLUTION
==========

Applying the appropriate attached patch documents this issue.

Note that patches for released versions are generally prepared to
apply to the stable branches, and may not apply cleanly to the most
recent release tarball.  Downstreams are encouraged to update to the
tip of the stable branch before applying these patches.

xsa461.patch           xen-unstable - Xen 4.16.x

$ sha256sum xsa461*
2415504496508ad87c306aa7257e836d7c2f0bd8849656de5b586f0ab93fd17f  xsa461.patch
$

DEPLOYMENT DURING EMBARGO
=========================

Deployment of patches or mitigations is NOT permitted (except where
all the affected systems and VMs are administered and used only by
organisations which are members of the Xen Project Security Issues
Predisclosure List).  Specifically, deployment on public cloud systems
is NOT permitted.

This is because changing the nature of devices being passed through is
very likely noticeable by the guest.

Deployment is permitted only AFTER the embargo ends.

(Note: this during-embargo deployment notice is retained in
post-embargo publicly released Xen Project advisories, even though it
is then no longer applicable.  This is to enable the community to have
oversight of the Xen Project Security Team's decisionmaking.)

For more information about permissible uses of embargoed information,
consult the Xen Project community's agreed Security Policy:
  http://www.xenproject.org/security-policy.html
-----BEGIN PGP SIGNATURE-----

iQFABAEBCAAqFiEEI+MiLBRfRHX6gGCng/4UyVfoK9kFAma8sCkMHHBncEB4ZW4u
b3JnAAoJEIP+FMlX6CvZLDkH/i6esACkik7iglEESFgCj0x6fc3KdpVzsCPznmsn
uWZzBO9xuggoPOONJ70Or7tsIdaYDAkealZrBGreXlPEgd0MOtozLYrvB2IIqJEj
cKyC4Y04VpBkynaOiLraFvUs0xyC0cew1NZdE/cxr9ewRvvrHVcyBI5GBAMKworh
g4hjIDOR9ohhvxN2P7Yz59OY+Ojo57t+IlpvPPm+c53bARYR6H/cxyUDLYVlfrk2
iNPif7Wpi1PU/Sjz5XqBF5mXW+LLsLnbyw8Iyhnjqv1zC/tUdzl1INUBd24eHSjP
aXnrlExoGAuvUcf/6YVfU0u2dB7iISGYAs2ESeYuxpJnZ8E=
=LkWz
-----END PGP SIGNATURE-----

--=separator
Content-Type: application/octet-stream; name="xsa461.patch"
Content-Disposition: attachment; filename="xsa461.patch"
Content-Transfer-Encoding: base64

RnJvbTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPgpTdWJqZWN0
OiB4ODYvcGFzcy10aHJvdWdoOiBkb2N1bWVudHMgYXMgc2VjdXJpdHktdW5z
dXBwb3J0ZWQgd2hlbiBzaGFyaW5nIHJlc291cmNlcwoKV2hlbiBtdWx0aXBs
ZSBkZXZpY2VzIHNoYXJlIHJlc291cmNlcyBhbmQgb25lIG9mIHRoZW0gaXMg
dG8gYmUgcGFzc2VkCnRocm91Z2ggdG8gYSBndWVzdCwgc2VjdXJpdHkgb2Yg
dGhlIGVudGlyZSBzeXN0ZW0gYW5kIG9mIHJlc3BlY3RpdmUKZ3Vlc3RzIGlu
ZGl2aWR1YWxseSBjYW5ub3QgcmVhbGx5IGJlIGd1YXJhbnRlZWQgd2l0aG91
dCBrbm93aW5nCmludGVybmFscyBvZiBhbnkgb2YgdGhlIGludm9sdmVkIGd1
ZXN0cy4gIFRoZXJlZm9yZSBzdWNoIGEgY29uZmlndXJhdGlvbgpjYW5ub3Qg
cmVhbGx5IGJlIHNlY3VyaXR5LXN1cHBvcnRlZCwgeWV0IG1ha2luZyB0aGF0
IGV4cGxpY2l0IHdhcyBzbyBmYXIKbWlzc2luZy4KClRoaXMgaXMgWFNBLTQ2
MSAvIENWRS0yMDI0LTMxMTQ2LgoKU2lnbmVkLW9mZi1ieTogSmFuIEJldWxp
Y2ggPGpiZXVsaWNoQHN1c2UuY29tPgpSZXZpZXdlZC1ieTogSnVlcmdlbiBH
cm9zcyA8amdyb3NzQHN1c2UuY29tPgotLS0KVEJEOiBPZiBjb3Vyc2UgdGhl
IHN5c3RlbSBidXMoZXMpIGlzIGEgLyBhcmUgc2hhcmVkIHJlc291cmNlKHMp
LCB0b28uCiAgICAgSSdtIGFmcmFpZCBJIGRvbid0IGtub3cgdGhlIGxvdyBs
ZXZlbCBkZXRhaWxzIG9mIFBDSSB0byBiZSBhYmxlIHRvCiAgICAgdGVsbCB3
aGV0aGVyIHRoZXJlIGFyZSBhbnkgZmFpcm5lc3MgZ3VhcmFudGVlcyB0aGVy
ZS4KCi0tLSBhL1NVUFBPUlQubWQKKysrIGIvU1VQUE9SVC5tZApAQCAtODQx
LDYgKzg0MSwxMSBAQCBUaGlzIGZlYXR1cmUgaXMgbm90IHNlY3VyaXR5IHN1
cHBvcnRlZDoKIAogT25seSBzeXN0ZW1zIHVzaW5nIElPTU1VcyBhcmUgc3Vw
cG9ydGVkLgogCitQYXNzaW5nIHRocm91Z2ggb2YgZGV2aWNlcyBzaGFyaW5n
IHJlc291cmNlcyB3aXRoIGFub3RoZXIgZGV2aWNlIGlzIG5vdAorc2VjdXJp
dHkgc3VwcG9ydGVkLiAgU3VjaCBzaGFyaW5nIGNvdWxkIGUuZy4gYmUgdGhl
IHNhbWUgbGluZSBpbnRlcnJ1cHQgYmVpbmcKK3VzZWQgYnkgbXVsdGlwbGUg
ZGV2aWNlcywgb25lIG9mIHdoaWNoIGlzIHRvIGJlIHBhc3NlZCB0aHJvdWdo
LCBvciB0d28gc3VjaAorZGV2aWNlcyBoYXZpbmcgbWVtb3J5IEJBUnMgd2l0
aGluIHRoZSBzYW1lIDRrIHBhZ2UuCisKIE5vdCBjb21wYXRpYmxlIHdpdGgg
bWlncmF0aW9uLCBwb3B1bGF0ZS1vbi1kZW1hbmQsIGFsdHAybSwKIGludHJv
c3BlY3Rpb24sIG1lbW9yeSBzaGFyaW5nLCBvciBtZW1vcnkgcGFnaW5nLgog
Cg==

--=separator--


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 13:35:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 13:35:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777292.1187492 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seE9p-00078j-F0; Wed, 14 Aug 2024 13:35:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777292.1187492; Wed, 14 Aug 2024 13:35:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seE9p-00078c-Aw; Wed, 14 Aug 2024 13:35:21 +0000
Received: by outflank-mailman (input) for mailman id 777292;
 Wed, 14 Aug 2024 13:35:20 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DSq6=PN=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1seE9o-00078W-8R
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 13:35:20 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on2062d.outbound.protection.outlook.com
 [2a01:111:f403:2414::62d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0af9f933-5a42-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 15:35:18 +0200 (CEST)
Received: from CH0PR03CA0230.namprd03.prod.outlook.com (2603:10b6:610:e7::25)
 by CYXPR12MB9387.namprd12.prod.outlook.com (2603:10b6:930:e6::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Wed, 14 Aug
 2024 13:35:13 +0000
Received: from CH1PEPF0000AD7A.namprd04.prod.outlook.com
 (2603:10b6:610:e7:cafe::aa) by CH0PR03CA0230.outlook.office365.com
 (2603:10b6:610:e7::25) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.33 via Frontend
 Transport; Wed, 14 Aug 2024 13:35:13 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CH1PEPF0000AD7A.mail.protection.outlook.com (10.167.244.59) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Wed, 14 Aug 2024 13:35:12 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 08:35:11 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 14 Aug 2024 08:35:10 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0af9f933-5a42-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Tr5hZkEyuLJOHKabb5IYU6yLGkrFEmQuMyLxDPK6G3reE3O5r3UazwDD818GLoTt2ZD15/MXKpoN9HoSunVvTn4d9+/fWXfTawtgr3q6AcMmARhq2po3O2ZmxBmUdwMb5kTJaUhvp34T52XDRCcDjdVWNrUflNblYb1slWB1P7jpqNG4pKh8LwZjK42Z54Z49uVXKM348oTbd24gCGG2bNzYhoLPcAbFuZVGq0gpn7c2vSMGECWvbJb0ceNhi1IxNQVbmTdBrIRtKXEjry3XcAfINT8NR5bwyxKyLHrsk4sxusvN9Fjx6y0xzKxJhFXqmtMAP88Fj5GkGRZ11vrhzA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ZNkXIvgK4aoQrNLQB2bNRdH50rKwGgafH7apV9x0rNw=;
 b=J89PU4sai9LhQnx3D4e4MgDQ8ulXgiZxQDihNGDYJ+BVKl2AqVFEVrYd65Smg8P9VdJHH5+Eem+fAg2Cpdf/w/VUhm8+myXvjTRAmXJ/KWy6ZYQBPPwPSjmgS3mstiW0YhozR9NHEj8F6Wzyr7jVfIHPExdxJhb/W+yS1BnJ69dv6aqLvj/vbn/77z8wyh9+VTePJi2YBp4I/jXcqbh5Zb+uZnJmQdn7uvdaK8GDJgOsUozzeRZcxKxfzf4yaC+aup8LGs50fcajnb2XLBEhaEjvp0SGgcdEqHFkMC07oRvUHEul1CwV3flGry93H/011RgnTIyRNY7/+1z9hRWVXg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ZNkXIvgK4aoQrNLQB2bNRdH50rKwGgafH7apV9x0rNw=;
 b=vSbh1agSG9ZyH8xHsDkQ1le1sjsjV+8I84u/ciIZHSm/rpdyoKjRuTjFkKrR2OoTazEVysWSK50LnH6+MKBlmsMH2VCiC4vJ7I7nqtX6JPsh4cNoANb3dDGOy3nSJELZgPBdQS6eGYOu5IPsQVO0olPuDXF0OylY87CEXfwN2/s=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <4302bda1-2441-4cc7-9bd4-9810ee62a497@amd.com>
Date: Wed, 14 Aug 2024 15:35:10 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xvmalloc: please Misra C:2012 Rule 8.2
To: Jan Beulich <jbeulich@suse.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
References: <02755b04-844b-464c-966f-d4fa6068315e@suse.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <02755b04-844b-464c-966f-d4fa6068315e@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB03.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD7A:EE_|CYXPR12MB9387:EE_
X-MS-Office365-Filtering-Correlation-Id: ee4b5720-90ce-4df1-6fce-08dcbc65ecc3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|376014|1800799024|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?QVdLSnV1c2tEY3FTSEVtK3NjRVdVQ3FLcmxSOTNuM3pDOXp3UjQ2UHZQeXBT?=
 =?utf-8?B?OWkxOGUwZFp3YnZ0Z0syZXdwTHdjd29lQUpMVSs2dndTN3FCWURaMHlncE9W?=
 =?utf-8?B?cFNpMzhucHQ2cVJLaks1T015SkM2ZVFXWW9MZUMva01HRDB6QkJERFVvZ01Z?=
 =?utf-8?B?bUxvZjJCczN5NnFnbTB4d3ovU3pYU2hhZ3V3MG1Sa2RqOHpWZEJ2TEY2L0Jx?=
 =?utf-8?B?RDFwMTduSzJkRVZEOCs2anhaMjZacGFmZ0ZmNlBkbnVqRWZscXllaiszZEQz?=
 =?utf-8?B?ZVNyaE5ReGtDTnB3QWQydFdKWGRrdTV2eDFQQTVIY090ck5xenZCaHFyK25S?=
 =?utf-8?B?d1FZTDVJYmp0TjBHYm01alFNd2pSQUYyZVB5dmdHd3RidVpRQ2QzWDZJcU5J?=
 =?utf-8?B?UkYxWmVMZGtaek56YisybllqN1o4aDBldTMvT0VGeTJhMjUvSVdMdGlqZUJ5?=
 =?utf-8?B?N3E1QzZGZjgxd2U2QjB6V29wcEw4VnZxeCs4VVpkbTN5U3NmNlNsWlZDRjh0?=
 =?utf-8?B?UmxrelN6K1ZTaHNNMCtmUHdFeERSQ1VDQzFjK05rcDF5bHhPYkpkb2NFeVBw?=
 =?utf-8?B?dXhDZlVGek42MmdiZU5RSWJWdEk1NHpjOVJFRkRVVWluQm10T2Y5bzBJblhS?=
 =?utf-8?B?ZDBLdi8vcTFzNTA2c0JwV01SZzFMd3RlREZPWnI4UFdrdVNDSGZEMmVDZW5J?=
 =?utf-8?B?V0R5ekVhRnhUZlE5bWw3d3FKeENJQ3hOTTB5OE9iVHRIMTFuMEV0OTMzWENN?=
 =?utf-8?B?K1dTMjI3a28vNUd2U1Y0Zm1kYUFkeFhadFdCZ29IWnFNUkNTaWFvbFZVeEQz?=
 =?utf-8?B?TTlGVW82WUY1VXlRRzl1STNjeDEzUFU1elBHTXJyUmlzOGFweTB5Q2FQanRR?=
 =?utf-8?B?d3BJaW5Vd3kyRmMzc3J3Vy9lT2FBRHdoQmszOWdhSFdWVlkwWEtibzRVdUpJ?=
 =?utf-8?B?cE9CTStsNUhNWi8vT0l1ZVNLd1ZXWXdLbDVZRjU1clZnU2JZMktRZmRPM0Fs?=
 =?utf-8?B?RWxDWFdhczZ0Zi8zZmh0bnRxbk5EQXdTa3lRS1J5bjdSREs4SjZvTjFlY2c0?=
 =?utf-8?B?TTdLK25NRWRmWlY4MC9iOUFWeE5XTjJoUkdBd1krNUFuYnl5NVE2TlZVNnht?=
 =?utf-8?B?MDBldzNhU0w0L1FqcXVQQnVCOVFETmF3SUJudTZKYVN5Nk14akxPREQvaWpt?=
 =?utf-8?B?YlFzUHpOVk9meng0MkJ2QVJOVmthM0l5djJRbVBPQUdsVmJIRmYwNG83SExH?=
 =?utf-8?B?VDFEZ1A4aytMY2paRW05UGhPL2h5SkpFaTNodkMwblBCV2h3R3pnajRFVkpG?=
 =?utf-8?B?REJ2ckdFSDdJcU5oa0sxeE8vd0lIMm1OMkQwSmNHOWgzQXdyOVRacGFpdDI3?=
 =?utf-8?B?YVNFbUFXMnZOZnpsUkxHeUthRHp1d0pFcGNmOEsrMExmbVllcjhqUUoxTFhK?=
 =?utf-8?B?RHhkOXREZFVES2FQYytvREhBRHNvNlp1a3J4RTBNamwwNEhIYVdBL3hBUzQz?=
 =?utf-8?B?cXZ6TkJsZis1b0pINlhUV0Iyc1RvRDFTemxLSWpBNURRKzg4R0RMZlJubmNE?=
 =?utf-8?B?TW5BRjdUd1VlUmVKeW41SldQZW92YklqZnJHUmlWU2lqL3M3WCtJY2owZ2RE?=
 =?utf-8?B?WnVrazJHRHp1YlFxRG5LWUpLSTJLeVZQUkE3bXp2cFhublN2bi9GK3NVOUZm?=
 =?utf-8?B?Vk43NnN2Y0JvWG9qeWhVQzF1eGp3U3dkbFlyb0tBN3p0a2llSzM1VUtjSHdY?=
 =?utf-8?B?UHl1MmdTQkFlUTZGdFdwNUZDY1Jya2ltTzluSGI1ekJ3TW5tNEFBWnE0T1Ux?=
 =?utf-8?B?ZEtWdUdPbk1PQ0R4Z2VqQklQbXA4U09vU0dvUmlhclhHVzRDN3NJZmFjdjdv?=
 =?utf-8?B?Zml4SFNqSmEzdnBXSjJGanQvejQrbVpiOHE4M1hpdk85YzR1YSsvZTUwd2lC?=
 =?utf-8?Q?fRKFOP2IHmm6RkFB8QLA8Etk0r5TtRCq?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(1800799024)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 13:35:12.7686
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ee4b5720-90ce-4df1-6fce-08dcbc65ecc3
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH1PEPF0000AD7A.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYXPR12MB9387



On 14/08/2024 10:06, Jan Beulich wrote:
> 
> 
> The cloning from xmalloc.h happened long before Misra work started in
> earnest, leading to the missing parameter name having been overlooked
> later on.
> 
> Fixes: 9102fcd9579f ("mm: introduce xvmalloc() et al and use for grant table allocations")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Michal Orzel <michal.orzel@amd.com>

~Michal



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 13:36:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 13:36:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777298.1187502 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seEAd-0007cU-My; Wed, 14 Aug 2024 13:36:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777298.1187502; Wed, 14 Aug 2024 13:36:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seEAd-0007cN-K7; Wed, 14 Aug 2024 13:36:11 +0000
Received: by outflank-mailman (input) for mailman id 777298;
 Wed, 14 Aug 2024 13:36:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=2uER=PN=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1seEAc-0007bg-UK
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 13:36:11 +0000
Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com
 [2607:f8b0:4864:20::72c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 28432cb0-5a42-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 15:36:06 +0200 (CEST)
Received: by mail-qk1-x72c.google.com with SMTP id
 af79cd13be357-7a1dcc7bc05so434593785a.0
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 06:36:06 -0700 (PDT)
Received: from [192.168.1.10] (host-92-26-98-202.as13285.net. [92.26.98.202])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a4c7d71236sm435732985a.37.2024.08.14.06.36.04
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 06:36:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 28432cb0-5a42-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723642565; x=1724247365; 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=PH78K9d9cr70SCfLmfIzOytI4txY6UmIeUJh/9bDcpw=;
        b=ImjnoznBTVUN+cpGxvXbyWzR4E2NoMe0Uoiu4lM0xZmv3w6uxsVG9zolAA2kxG6N1G
         VMiUw3qEGMwPisvJJDo7DqEEkp5RxG6UvM7cHF19OtjDA50eagb5wAsuLFUKwjslbl6Y
         wQXWTlvlSsDOmcMXARfHCEXuiTW8R4V0GFXnQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723642565; x=1724247365;
        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=PH78K9d9cr70SCfLmfIzOytI4txY6UmIeUJh/9bDcpw=;
        b=qgyb40EsSvLmGQIto3Tz8dFbMQaGxgyV4+9xJS62gnH4Ve0z+DMBwkAB+uI6EVJd8V
         xwQzh+1oeNC47EvnnHHe9sKR3wW+t/lY1GBrz4pab5mBGwrxhTWtnJl7OFcf4/kzQW9H
         Q3d+YT0pfOXxqldOYtXqzNlgyD6a8k5ULDLgEByUAWPT8dOzHepLrEy5axUTjlmOBZPt
         Qwmp8qDFWTRAFrXUL/1KwmaPbOn8gHiW6b/bUFOw6Wf7Rze7xQUR9NeAf0dIfq3Amq5G
         5lMhNmBdieP9E2C57HLTisIURe5tM0nwzI9yFhmXvGM1YWVs1mo7LoDXpms/IDoVKWNk
         Neuw==
X-Forwarded-Encrypted: i=1; AJvYcCXXVMLFo4Gf1/kYa/Z7NC6f6MZw2Zkg2BDpFP8J1hfGWlPr4DYWxYI//6cGl+Sg59oJApIEqqlDQ9M=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxpmO9DaiRR0Iep5ocmWawj8JhKlJrZgeTIguIHpoqwF+UjOZUS
	sQktjixybE+YLbld+zKUDTHOUU+YW6Iu7HexFdhzqKLKvA+B87QjhUknnTUaswIfE2YL/2Oy/n1
	W
X-Google-Smtp-Source: AGHT+IF2OR1uep8iVBOVXj4Yy4jRNGg3qrgIQHLE5qxqtTztzb7NzebwZHRKaQGtnTslOkMiDE9Uog==
X-Received: by 2002:a05:620a:244a:b0:79f:a82:51aa with SMTP id af79cd13be357-7a4ee3e50d7mr299348385a.59.1723642565613;
        Wed, 14 Aug 2024 06:36:05 -0700 (PDT)
Message-ID: <8da6a8b4-1ba9-4594-90fd-df5500e18b64@citrix.com>
Date: Wed, 14 Aug 2024 14:36:03 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xvmalloc: please Misra C:2012 Rule 8.2
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
References: <02755b04-844b-464c-966f-d4fa6068315e@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <02755b04-844b-464c-966f-d4fa6068315e@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 14/08/2024 9:06 am, Jan Beulich wrote:
> The cloning from xmalloc.h happened long before Misra work started in
> earnest, leading to the missing parameter name having been overlooked
> later on.
>
> Fixes: 9102fcd9579f ("mm: introduce xvmalloc() et al and use for grant table allocations")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 13:42:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 13:42:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777363.1187511 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seEGW-0002Ct-9y; Wed, 14 Aug 2024 13:42:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777363.1187511; Wed, 14 Aug 2024 13:42:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seEGW-0002Cm-7H; Wed, 14 Aug 2024 13:42:16 +0000
Received: by outflank-mailman (input) for mailman id 777363;
 Wed, 14 Aug 2024 13:42:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seEGV-0002Cc-Fq; Wed, 14 Aug 2024 13:42:15 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seEGV-0001OT-Cl; Wed, 14 Aug 2024 13:42:15 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seEGU-0000y4-VF; Wed, 14 Aug 2024 13:42:15 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1seEGU-0002f8-Ua; Wed, 14 Aug 2024 13:42:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=vCP1jpvEkgqT5AtE8mfN83N7rZ0nFojHuraAC/k/pWU=; b=FT06/L/rf8oz9LA4wgYSbcCGrA
	Ow9D5JqaSNWwSynwhTlgMDNyjd+0qH8sSSw+zOTsfSWOLkoaf37xPCSSl4PM/jINeCXkn4Kn6hZE7
	zzkdB7V0y056Zm44gLp6taZL9iJlKQQUkMir51AYCZW2eStQ/2js08WxHW/8tjtEJRt8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187230-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.18-testing test] 187230: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.18-testing:test-amd64-amd64-dom0pvh-xl-intel:guest-localmigrate/x10:fail:heisenbug
    xen-4.18-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=c70619e2b758f2c9c2c7a8683ab7897d01461cd0
X-Osstest-Versions-That:
    xen=d446b472cc5051c2ef4eaf5f895d96d7a458c8a1
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 14 Aug 2024 13:42:14 +0000

flight 187230 xen-4.18-testing real [real]
flight 187242 xen-4.18-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187230/
http://logs.test-lab.xenproject.org/osstest/logs/187242/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-dom0pvh-xl-intel 20 guest-localmigrate/x10 fail pass in 187242-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187192
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187192
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187192
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187192
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187192
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187192
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  c70619e2b758f2c9c2c7a8683ab7897d01461cd0
baseline version:
 xen                  d446b472cc5051c2ef4eaf5f895d96d7a458c8a1

Last test of basis   187192  2024-08-08 12:10:09 Z    6 days
Testing same since   187230  2024-08-13 15:07:06 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Teddy Astie <teddy.astie@vates.tech>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            fail    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   d446b472cc..c70619e2b7  c70619e2b758f2c9c2c7a8683ab7897d01461cd0 -> stable-4.18


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 14:21:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 14:21:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777392.1187550 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seEsZ-0003A3-Ko; Wed, 14 Aug 2024 14:21:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777392.1187550; Wed, 14 Aug 2024 14:21:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seEsZ-00039w-HK; Wed, 14 Aug 2024 14:21:35 +0000
Received: by outflank-mailman (input) for mailman id 777392;
 Wed, 14 Aug 2024 14:21:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0xrl=PN=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1seEsX-00039q-QK
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 14:21:33 +0000
Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com
 [2a00:1450:4864:20::233])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 815a4617-5a48-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 16:21:32 +0200 (CEST)
Received: by mail-lj1-x233.google.com with SMTP id
 38308e7fff4ca-2f040733086so66064891fa.1
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 07:21:32 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f292067fa1sm14543551fa.127.2024.08.14.07.21.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 Aug 2024 07:21:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 815a4617-5a48-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723645292; x=1724250092; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=7F3XpokfdlFhkd0C1Je0HU0iCTbCSVVLb+E70u1qm0U=;
        b=N/+py8H44wAso/RE7ZEnsnn4zV6zwq2h3ftxv5Ux+cCyLX9Z741lrVoWQHLBCzAVAe
         4K4/LT8UWyvcR204jTf5O91Mgkp5UgUMBzc+X1Ruy7xyoSAfvbMpNmEeJUz0esJPID1c
         AVs2SpN8v+LD/07sy3z+9H+xNQk6lIQSt7SV2M7enjP9jpL8RvppgKQdDLaC5D2CNpRc
         qBoA8DRwZriznHkcNtw+DXV9yLpj3rIS4Rg6thOu4E6XxjC2/TTQE5wVK+oZwt7aXebA
         t+Ce0Njy0fxFxOEHm3BSOt7Vj6X/cggguhKlDg1TPEFHERNclJYhAXcgrRPJuDAQlK6t
         caVQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723645292; x=1724250092;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=7F3XpokfdlFhkd0C1Je0HU0iCTbCSVVLb+E70u1qm0U=;
        b=JkBXAz71jvaI1cjFSaFIXAOYWfxXAAeBBJPPSvXxYUnj9FFpxxIJkxg6/Z16MunqdF
         J1AGw0InaxgOx457pTp7+72VD4R5Rgb70YcNAkcIBc2ybKIBQgs67qW7WW9dFMwtWx+u
         mntvrt7iUhhoUew2D5yfvXwX5A4rzMuNRALP2m8rriuIBsYAY93ch0hBQMMXsC53arjK
         p0QoaShPpF5R1S13HCI697dZuuS0qY4BOmLrnlDQJXEWj3PNHm2Mdyyky/zTchs/zYXK
         fECWzzccFvrTV46Wh75wYIUV+uJJ4kuAdNq100e3cqZ5APPoYpsmBGqERijkz07okB2G
         V/sg==
X-Forwarded-Encrypted: i=1; AJvYcCVWqccZICxzxf3RTwVEBni5DJRQL3SpyM/suJ+jC+7MUSFpPByEoqnC5ie/AdGudJztQJO4v8fE8Rf6LPA1TN4Ce3v/T4IOvWzaW42B1Bs=
X-Gm-Message-State: AOJu0YzgXEWxkHAp1Tr0sxzhZU9F1OsM9darY2MvDF90Kd/dSogr56CE
	uwmqIWpLL7DH+Kwv17kgBPUU2NHvRz5ALmhksutIeWIx1zZP1RkV
X-Google-Smtp-Source: AGHT+IGa/WVWSzadAk0qahlBAdJV+FYJ8WWibBg0KbY2vHG2Dvfw/hMaOC7t+VCODEBxgLVb3kL1jw==
X-Received: by 2002:a2e:9683:0:b0:2ef:2617:8952 with SMTP id 38308e7fff4ca-2f3aa1c10c3mr20011521fa.18.1723645291633;
        Wed, 14 Aug 2024 07:21:31 -0700 (PDT)
Message-ID: <9361b63712bffc7bb0cb6bb1fc5954ade18314d2.camel@gmail.com>
Subject: Re: [PATCH v4 2/7] xen/riscv: set up fixmap mappings
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Wed, 14 Aug 2024 16:21:30 +0200
In-Reply-To: <07f19bb5-bd76-4158-875e-48f74e427a89@suse.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
	 <1c1c0f912a9abbb542baa1ce92e75d64ec8043e9.1723214540.git.oleksii.kurochko@gmail.com>
	 <07f19bb5-bd76-4158-875e-48f74e427a89@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Tue, 2024-08-13 at 10:22 +0200, Jan Beulich wrote:
> On 09.08.2024 18:19, Oleksii Kurochko wrote:
> > --- a/xen/arch/riscv/include/asm/config.h
> > +++ b/xen/arch/riscv/include/asm/config.h
> > @@ -74,6 +74,14 @@
> > =C2=A0#error "unsupported RV_STAGE1_MODE"
> > =C2=A0#endif
> > =C2=A0
> > +#define XEN_VIRT_SIZE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 MB(2)
> > +
> > +#define BOOT_FDT_VIRT_START=C2=A0=C2=A0=C2=A0=C2=A0 (XEN_VIRT_START + =
XEN_VIRT_SIZE)
> > +#define BOOT_FDT_VIRT_SIZE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 MB(4)
> > +
> > +#define FIXMAP_BASE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 (BOOT_FDT_VIRT_START +
> > BOOT_FDT_VIRT_SIZE)
> > +#define FIXMAP_ADDR(n)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 (FIXMAP_BASE + (n) * PAGE_SIZE)
>=20
> Just to confirm: Did you consider leaving gaps between the regions,
> but
> then discarded that idea for whatever reason? It's not like you're
> tight
> on address space.
No, I would like to leave gaps between the regions. I have a slot gap
where it is possible, inside a slot I decided just not to add this gap
without any specific reason TBH. I can add some gap ( for example,
0x100000 ) if it would be better and consistent.

>=20
> As to FIXMAP_ADDR() - wouldn't that be a better fit in fixmap.h?
Sure, it would more correct place for this macros.

>=20
> > --- /dev/null
> > +++ b/xen/arch/riscv/include/asm/fixmap.h
> > @@ -0,0 +1,44 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +/*
> > + * fixmap.h: compile-time virtual memory allocation
> > + */
> > +#ifndef ASM_FIXMAP_H
> > +#define ASM_FIXMAP_H
> > +
> > +#include <xen/bug.h>
> > +#include <xen/page-size.h>
> > +#include <xen/pmap.h>
> > +
> > +#include <asm/page.h>
> > +
> > +/* Fixmap slots */
> > +#define FIX_PMAP_BEGIN (0) /* Start of PMAP */
> > +#define FIX_PMAP_END (FIX_PMAP_BEGIN + NUM_FIX_PMAP - 1) /* End of
> > PMAP */
> > +#define FIX_MISC (FIX_PMAP_END + 1)=C2=A0 /* Ephemeral mappings of
> > hardware */
> > +
> > +#define FIX_LAST (FIX_MISC + 1) /* +1 means a guard slot */
>=20
> As per my comment on the earlier version: No, I don't think this
> arranges
> for a guard slot. It merely arranges for FIX_MISC to not trigger the
> BUG_ON() in virt_to_fix().
>=20
> > --- a/xen/arch/riscv/include/asm/page.h
> > +++ b/xen/arch/riscv/include/asm/page.h
> > @@ -81,6 +81,12 @@ static inline void flush_page_to_ram(unsigned
> > long mfn, bool sync_icache)
> > =C2=A0=C2=A0=C2=A0=C2=A0 BUG_ON("unimplemented");
> > =C2=A0}
> > =C2=A0
> > +/* Write a pagetable entry. */
> > +static inline void write_pte(pte_t *p, pte_t pte)
> > +{
> > +=C2=A0=C2=A0=C2=A0 *p =3D pte;
> > +}
>=20
> No use of write_atomic() here? And no read_pte() counterpart right
> away (then
> also properly using read_atomic())?
I wanted to avoid the fence before "*p=3Dpte" which in case of
write_atomic() will be present. Won't it be enough to use here
WRITE_ONCE()?


>=20
> > @@ -191,6 +195,45 @@ static bool __init
> > check_pgtbl_mode_support(struct mmu_desc *mmu_desc,
> > =C2=A0=C2=A0=C2=A0=C2=A0 return is_mode_supported;
> > =C2=A0}
> > =C2=A0
> > +void __init setup_fixmap_mappings(void)
> > +{
> > +=C2=A0=C2=A0=C2=A0 pte_t *pte, tmp;
> > +=C2=A0=C2=A0=C2=A0 unsigned int i;
> > +
> > +=C2=A0=C2=A0=C2=A0 BUILD_BUG_ON(FIX_LAST >=3D PAGETABLE_ENTRIES);
> > +
> > +=C2=A0=C2=A0=C2=A0 pte =3D &stage1_pgtbl_root[pt_index(HYP_PT_ROOT_LEV=
EL,
> > FIXMAP_ADDR(0))];
> > +
> > +=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * In RISC-V page table levels are numbered fr=
om Lx to L0
> > where
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * x is the highest page table level for curre=
ct=C2=A0 MMU mode (
> > for example,
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * for Sv39 has 3 page tables so the x =3D 2 (=
L2 -> L1 -> L0) ).
> > +=C2=A0=C2=A0=C2=A0=C2=A0 *
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * In this cycle we want to find L1 page table=
 because as L0
> > page table
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * xen_fixmap[] will be used.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0 for ( i =3D HYP_PT_ROOT_LEVEL; i-- > 1; )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BUG_ON(!pte_is_valid(*pte))=
;
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pte =3D (pte_t *)LOAD_TO_LI=
NK(pte_to_paddr(*pte));
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pte =3D &pte[pt_index(i, FI=
XMAP_ADDR(0))];
> > +=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0 BUG_ON(pte_is_valid(*pte));
> > +
> > +=C2=A0=C2=A0=C2=A0 tmp =3D paddr_to_pte(LINK_TO_LOAD((unsigned long)&x=
en_fixmap),
> > PTE_TABLE);
> > +=C2=A0=C2=A0=C2=A0 write_pte(pte, tmp);
> > +
> > +=C2=A0=C2=A0=C2=A0 RISCV_FENCE(rw, rw);
>=20
> In the changes section you say "r,r", and I was wondering about that.
> I
> take it that "rw,rw" is really what's needed here.
It was typo. I will update the change log.

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 14:46:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 14:46:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777409.1187560 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seFGG-0008Ic-I3; Wed, 14 Aug 2024 14:46:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777409.1187560; Wed, 14 Aug 2024 14:46:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seFGG-0008IV-En; Wed, 14 Aug 2024 14:46:04 +0000
Received: by outflank-mailman (input) for mailman id 777409;
 Wed, 14 Aug 2024 14:46: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=0xrl=PN=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1seFGE-0008IN-Sc
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 14:46:02 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ed010192-5a4b-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 16:46:01 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-52efe4c7c16so3406904e87.0
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 07:46:01 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-53200f124f4sm1338296e87.123.2024.08.14.07.46.00
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 Aug 2024 07:46:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ed010192-5a4b-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723646761; x=1724251561; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=iyk8oPomjymhHSTmmcIRzawLy1Pqsm4WoNBz95bfB1c=;
        b=L7v3S4ZU/EpsB92p0Qagc91WTxYrkXRthPmOPhTPFyO11Bt4gJXaHbPkYRJQ2sZ8Y3
         ODfQgStHRBryRYO+JF8oCGUiXg/Z47OGPKS5arr+F7TWGhCte3PgP1OtHXK43WFbxgng
         usIcYganV74r4iUQu8HMVhudXs3FZJu9k4MlpW01ow3wvaYAx3LmOn/Is2HBMC5Zu4dv
         QF5hpxOFxKldvFuMVMwh9Jep8hlnobTGSVMaZ1rNAhcKQaqQbu9eZLhgNeC9hdmWsNUc
         aqLa9AnyX/zzu+HKEpvRATYa6SZfnTPRXP3FsbeOYSJBl69Zt5rOmastxW/w78dFMXGa
         R3Ig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723646761; x=1724251561;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=iyk8oPomjymhHSTmmcIRzawLy1Pqsm4WoNBz95bfB1c=;
        b=aZ1q9SBEeXgukItcpSeceUxKu8bE1f/Fr32k0ZfyBpfrTEA4sScOz1imThlFOMWuWy
         gl3ECa7qOGHSsRY3UJAIDrpuciYQriTNXBpNeePWjUqYBEm9cHnzB+uD4wCq6xHnJyCp
         v4RAQXRGl8yGPm4wKaZ1worvY6Vag3mFajoexf/7i1t8JGfKhDC4TIV3euf1Bft+BMS8
         lCts2HLUvPSUwXv8fh3GeWZ0YQP8ttyK1O8yAuwYuxHsBW6nzTST+B5FUheCGYh/d40C
         9x0W6LQY0Fs/PZPhY+pM6TgIKUbvR8AJuUqaR5bu8UHZ7vIAGbywo+6uZlYKvNIXSf1/
         Yy4A==
X-Forwarded-Encrypted: i=1; AJvYcCW1ipinraXV1uh0WroUqkhXn+Iw4qP16be+Qi3IdYyyhNDVU2kOSyay5wI1fRT5cYKimOF2o17lb+Vcgv7JIKNl1gZjpHZRa7mXGX7s8R8=
X-Gm-Message-State: AOJu0YxNFVngiRg8KVTrrOXJeqqeBqEc9s9Ej564SxwGb3H/IXp6Mslf
	4FHhWnhByd3Yjbrz4qH1jeWV99IgINmTb+0G73L3RZT/te48xqbq
X-Google-Smtp-Source: AGHT+IF1mnIvpZhUMzQLgRyVrOl7HyZeDW2wfQf7p1lnBVPmW55E6rvHu8aldajqrsA1qkO0xndhug==
X-Received: by 2002:a05:6512:2216:b0:52c:cc2e:1c45 with SMTP id 2adb3069b0e04-532eda6bda2mr1992359e87.15.1723646760863;
        Wed, 14 Aug 2024 07:46:00 -0700 (PDT)
Message-ID: <ee3a2e61435e860f1ddb6022fbb712a8d890ae3e.camel@gmail.com>
Subject: Re: [PATCH v4 4/7] xen/riscv: introduce functionality to work with
 CPU info
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Wed, 14 Aug 2024 16:45:59 +0200
In-Reply-To: <e0285026-40c5-4316-8129-d07801a9c233@suse.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
	 <452e2960d1f064a2e3abcaae1ac354f48aafd24c.1723214540.git.oleksii.kurochko@gmail.com>
	 <e0285026-40c5-4316-8129-d07801a9c233@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Tue, 2024-08-13 at 10:54 +0200, Jan Beulich wrote:
> On 09.08.2024 18:19, Oleksii Kurochko wrote:
> > Introduce struct pcpu_info to store pCPU-related information.
> > Initially, it includes only processor_id, but it will be extended
> > to include guest CPU information and temporary variables for
> > saving/restoring vCPU registers.
> >=20
> > Add set_processor_id() and get_processor_id() functions to set
> > and retrieve the processor_id stored in pcpu_info.
> >=20
> > Introduce cpuid_to_hartid_map[NR_CPUS] to map Xen logical CPUs to
> > hart IDs (physical CPU IDs). Add auxiliary macros cpuid_to_hartid()
> > for convenient access to this mapping.
> >=20
> > Define smp_processor_id() to provide accurate information,
> > replacing the previous "dummy" value of 0.
> >=20
> > Initialize tp registers to point to pcpu_info[0].
> > Set processor_id to 0 for logical CPU 0 and store the physical CPU
> > ID
> > for the current logical CPU in cpuid_to_hartid_map[].
> >=20
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > ---
> > Changes in V4:
> > =C2=A0- wrap id with () inside set_processor_id().
> > =C2=A0- code style fixes
> > =C2=A0- update BUG_ON(id > NR_CPUS) in smp_processor_id() and drop the
> > comment
> > =C2=A0=C2=A0 above BUG_ON().
> > =C2=A0- s/__cpuid_to_hartid_map/cpuid_to_hartid_map
> > =C2=A0- s/cpuid_to_hartid_map/cpuid_to_harti ( here cpuid_to_hartid_map
> > is the name
> > =C2=A0=C2=A0 of the macros ).
> > =C2=A0- update the commit message above the code of TP register
> > initialization in
> > =C2=A0=C2=A0 start_xen().
>=20
> I guess that's once again "comment", not "commit message"?
Yes, sorry for confusion. It should be comment.

>=20
> > --- a/xen/arch/riscv/include/asm/processor.h
> > +++ b/xen/arch/riscv/include/asm/processor.h
> > @@ -12,8 +12,32 @@
> > =C2=A0
> > =C2=A0#ifndef __ASSEMBLY__
> > =C2=A0
> > -/* TODO: need to be implemeted */
> > -#define smp_processor_id() 0
> > +#include <xen/bug.h>
> > +
> > +register struct pcpu_info *tp asm ("tp");
> > +
> > +struct pcpu_info {
> > +=C2=A0=C2=A0=C2=A0 unsigned int processor_id;
> > +};
> > +
> > +/* tp points to one of these */
> > +extern struct pcpu_info pcpu_info[NR_CPUS];
> > +
> > +#define get_processor_id()=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (tp->processo=
r_id)
> > +#define set_processor_id(id)=C2=A0=C2=A0=C2=A0 do { \
> > +=C2=A0=C2=A0=C2=A0 tp->processor_id =3D (id);=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0 \
> > +} while (0)
> > +
> > +static inline unsigned int smp_processor_id(void)
> > +{
> > +=C2=A0=C2=A0=C2=A0 unsigned int id;
> > +
> > +=C2=A0=C2=A0=C2=A0 id =3D get_processor_id();
> > +
> > +=C2=A0=C2=A0=C2=A0 BUG_ON(id > NR_CPUS);
>=20
> > =3D ?
>=20
> > --- a/xen/arch/riscv/include/asm/smp.h
> > +++ b/xen/arch/riscv/include/asm/smp.h
> > @@ -5,6 +5,8 @@
> > =C2=A0#include <xen/cpumask.h>
> > =C2=A0#include <xen/percpu.h>
> > =C2=A0
> > +#define INVALID_HARTID UINT_MAX
> > +
> > =C2=A0DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
> > =C2=A0DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
> > =C2=A0
> > @@ -14,6 +16,14 @@ DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
> > =C2=A0 */
> > =C2=A0#define park_offline_cpus false
> > =C2=A0
> > +void smp_set_bootcpu_id(unsigned long boot_cpu_hartid);
> > +
> > +/*
> > + * Mapping between linux logical cpu index and hartid.
> > + */
> > +extern unsigned long cpuid_to_hartid_map[NR_CPUS];
> > +#define cpuid_to_hartid(cpu) cpuid_to_hartid_map[cpu]
>=20
> How wide can hart IDs be? Wider than 32 bits? If not, why unsigned
> long?
According to the spec:
```
The mhartid CSR is an MXLEN-bit read-only register containing the
integer ID of the hardware thread running the code
```
where MXLEN can bit 32 and 64.

> If so, what about RV32 (which generally you at least try cover where
> easily possible)?
On RV32 MXLEN will be 32 and unsigned long will be 32-bit too.

>=20
> Is there a reason this needs to be a separate array, rather than
> being
> part of struct pcpu_info?
>=20
> > @@ -40,6 +41,19 @@ void __init noreturn start_xen(unsigned long
> > bootcpu_id,
> > =C2=A0{
> > =C2=A0=C2=A0=C2=A0=C2=A0 remove_identity_mapping();
> > =C2=A0
> > +=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * tp register contains an address of physical=
 cpu
> > information.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * So write physical CPU info of boot cpu to t=
p register
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * It will be used later by get_processor_id()=
 ( look at
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * <asm/processor.h> ):
> > +=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0 #define get_processor_id()=C2=
=A0=C2=A0=C2=A0 (tp->processor_id)
> > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0 asm volatile ( "mv tp, %0" : : "r"((unsigned
> > long)&pcpu_info[0]) );
>=20
> Perhaps be on the safe side and also add a memory barrier?
Do you mean compiler barrier? ( asm volatile ( "..." :: ... : "memory"
)? )

>=20
> Perhaps be on the safe side and do this absolutely first in the
> function,
> or even in assembly (such that initializers of future variables
> declared
> at the top of the function end up safe, too)?
I am not sure that I am following your part related to put this code in
assembler ( instructions in assembly code still code be re-ordered what
can affect a time when tp will be set with correct value ) and what do
you mean by "initializers of future variables declared at the top of
the function end up safe"
>=20
> Also nit: Blank please between closing quote and opening parenthesis.
> (Otoh you could omit the blank between the two colons.)
>=20
> > --- /dev/null
> > +++ b/xen/arch/riscv/smp.c
> > @@ -0,0 +1,4 @@
> > +#include <xen/smp.h>
> > +
> > +/* tp points to one of these per cpu */
> > +struct pcpu_info pcpu_info[NR_CPUS];
>=20
> And they all need setting up statically? Is there a plan to make this
> dynamic (which could be recorded in a "fixme" in the comment)?
I didn't plan to make allocation of this array dynamic. I don't expect
that NR_CPUS will be big. I can add "fixme" but I am not really
understand what will be advantages if pcpu_info[] will be allocated
dynamically.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 15:08:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 15:08:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777424.1187570 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seFc3-0004YG-8n; Wed, 14 Aug 2024 15:08:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777424.1187570; Wed, 14 Aug 2024 15:08:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seFc3-0004Y9-5r; Wed, 14 Aug 2024 15:08:35 +0000
Received: by outflank-mailman (input) for mailman id 777424;
 Wed, 14 Aug 2024 15:08:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seFc2-0004Y3-2S
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 15:08:34 +0000
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [2a00:1450:4864:20::534])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 12234260-5a4f-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 17:08:32 +0200 (CEST)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5bb8e62575eso7012a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 08:08:32 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bd1a5e0030sm4017375a12.65.2024.08.14.08.08.30
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 08:08:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 12234260-5a4f-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723648112; x=1724252912; 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=InZA3udHyAMwCEcT7duDMzUbFiwvcQVmCDEYk8ZDAa0=;
        b=P0WSRCHT9sBmnV5ZD3XJUJRj8EPNy/LOKR+jwtZD5yGCPTh75ApK/ysH5yxioS09Rk
         i1lE/ZHIpsKENAhVKPpRh1hdLOQeytvi1TZmDtdhbqYN/XI0EtVV8h6NPUQS0JIZor4A
         v7SX4ZnutC8ZQsQYcPOVCzopkzG+WQddHdxnX68AMDcHsGhkZCGktF0NPWrUQhWZ5xn9
         9Q1VsB/ZvcV2UUsur7dC5YBTpoeEtCJ0k5AGaMQmoW0DD+RTyb2WQ3ho64JwlfiMQpuy
         4MhopugYX70INju0XbptEcq9bJThYFQZMMCmrv06qYHYl/YHos+i5z4QlLIInMjmAIkC
         mFrw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723648112; x=1724252912;
        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=InZA3udHyAMwCEcT7duDMzUbFiwvcQVmCDEYk8ZDAa0=;
        b=PtPMlFWV60LFdOTJIaCEnNrkWrGqUaEUYOXzIkN7nW6ChJXmjvr0F+QhiqNKhSLpQx
         w4pyW7FKMX5A4gSrKOKpKQwYCbNl9J5lb1K4xZMx+fhWO2OC+Cxe8rdeAps6+cyQqVvl
         kCJNVl8cpcYi9CPVGg1WXF/xRUmXqmNeCQLf34pxbP+sJQhG8VA1Ktpr/7YtnmAKVsUv
         nNTalSbxkRZNfELnz1weGkhgAFYKyh9tXqpO066l5Smr+6Jw0wNuhFw/K4mUOnX3nubA
         jdODhPX0pohCoh4AsnDbPSz9lxEN26qmsVem9DrqeTpGVU1Ud+cJbWvo2Rqiq4OtjyIo
         KzGA==
X-Forwarded-Encrypted: i=1; AJvYcCVuL1JipMqpY5T2FcjNnWX86dieerGSUbZPt2xQUnBr1GzYXkgQPP7TQOdLeWslhQ3dlhekgtEM4oMbCmeO3JOz5l9LSto7dJ/ymFnwPV8=
X-Gm-Message-State: AOJu0YwHtRH0GJGXs4FFQg6AOVZcXcEHWPBc8SYHtdmAC9PIPkwXSVEO
	sDKdLu7ga7TStj2CoZr8hbqDnE+CTWOSvEwM8dmMWP9dv7NVanB8M5sm861E3Q==
X-Google-Smtp-Source: AGHT+IH3BxPjvY5h1TT95scpEvLAQqY6I9Q2P9FLxdpzHFvmVVbddVrocwZUCG+RdGhFAmLEI9XB3w==
X-Received: by 2002:a05:6402:34d1:b0:579:73b7:b4cc with SMTP id 4fb4d7f45d1cf-5bea1c6ac1bmr2856981a12.2.1723648111865;
        Wed, 14 Aug 2024 08:08:31 -0700 (PDT)
Message-ID: <bede9f51-0278-4c97-9c0d-ee3478373d72@suse.com>
Date: Wed, 14 Aug 2024 17:08:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 2/7] xen/riscv: set up fixmap mappings
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <1c1c0f912a9abbb542baa1ce92e75d64ec8043e9.1723214540.git.oleksii.kurochko@gmail.com>
 <07f19bb5-bd76-4158-875e-48f74e427a89@suse.com>
 <9361b63712bffc7bb0cb6bb1fc5954ade18314d2.camel@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: <9361b63712bffc7bb0cb6bb1fc5954ade18314d2.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 14.08.2024 16:21, oleksii.kurochko@gmail.com wrote:
> On Tue, 2024-08-13 at 10:22 +0200, Jan Beulich wrote:
>> On 09.08.2024 18:19, Oleksii Kurochko wrote:
>>> --- a/xen/arch/riscv/include/asm/page.h
>>> +++ b/xen/arch/riscv/include/asm/page.h
>>> @@ -81,6 +81,12 @@ static inline void flush_page_to_ram(unsigned
>>> long mfn, bool sync_icache)
>>>      BUG_ON("unimplemented");
>>>  }
>>>  
>>> +/* Write a pagetable entry. */
>>> +static inline void write_pte(pte_t *p, pte_t pte)
>>> +{
>>> +    *p = pte;
>>> +}
>>
>> No use of write_atomic() here? And no read_pte() counterpart right
>> away (then
>> also properly using read_atomic())?
> I wanted to avoid the fence before "*p=pte" which in case of
> write_atomic() will be present.

Well, this goes back to write_atomic() resolving to write{b,w,l,q}() for
unclear reasons; even the comment in our atomic.h says "For some reason".
The fence there is of course getting in the way here. I keep forgetting
about that aspect, because neither x86 nor Arm has anything similar
afaics.

> Won't it be enough to use here WRITE_ONCE()?

Maybe. I'm not entirely sure.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 15:22:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 15:22:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777436.1187580 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seFpF-0000RB-EG; Wed, 14 Aug 2024 15:22:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777436.1187580; Wed, 14 Aug 2024 15:22:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seFpF-0000R4-Ad; Wed, 14 Aug 2024 15:22:13 +0000
Received: by outflank-mailman (input) for mailman id 777436;
 Wed, 14 Aug 2024 15:22:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seFpD-0000Qy-Dn
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 15:22:11 +0000
Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com
 [2a00:1450:4864:20::531])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f97a0717-5a50-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 17:22:10 +0200 (CEST)
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5a309d1a788so35437a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 08:22:10 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f3fa43f9sm185977866b.53.2024.08.14.08.22.08
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 08:22:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f97a0717-5a50-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723648930; x=1724253730; 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=sXY2qYSi5ScBM9veJIF83xeLBE3lDb/YHp+U6rSilUk=;
        b=Cchlir952PH0tVJiurO4uesClFRq6SdY5a0niKV/Z2hjpI9qpTWa7G6dANy9GgHvW5
         vkVYRx6GpSpqhGvES4Xb8wCvedmiFhI7MyYfeslfaX7KKy65APkO8g+E+8PPbDuKoya8
         7qOg1lQbZFfhbcggyXsIKHICchpbwZOShWeMIaquhVhJwNRsO79Hqxt1ENIfdehAzrZQ
         SJcTpWLvHSQWdglItj89kZafwSNGm6AdSUnvSEvBnKw7hLALtjJE4ywFUOUsmnh7/bt+
         ftgUDuiA4rg9PYCxmadEJtyQZLhyNTG1/UadMwt4aVj7k4M9gWD4533oibvM7IIPwhF4
         M95w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723648930; x=1724253730;
        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=sXY2qYSi5ScBM9veJIF83xeLBE3lDb/YHp+U6rSilUk=;
        b=p2+QvBrpxtS+hWWyYMdvG8Z/WDvi98YgDNvohO2ieQIXPWzaDTqOwoTzhaTbv2w7U9
         oTC+f3pVDsC/3yoFS2Uhx9dkECba0wKP4F5Q95TKxkUg93zVZeOazjD09+jAdIEqkuRX
         utLPCwb2pmEDV3dqA2dPB7Y/5Pxg7fIi59ZFxuqxqH4VGfXgwV9xvRjjd7xKaffHLhIW
         VY2QHsrS1D2y+GLwckW7Oh8XJBKdztjuzUP1JGOZ1l+R3cB0AKsr3zCPu845A66l8wH2
         r6OkaMCPIRXl9i1MLrAFj807n64fhSjmNB+D8YXgAizGx5ePkR0BNZCHyOknH5+UM/oL
         NheQ==
X-Forwarded-Encrypted: i=1; AJvYcCUsL/9xX77nk2iX70Xi2czRG+5vRhHt3ZRwRygMnq8L96gaUIVaM2M+GoZwNgpZyQpIvSjOdvSD6cIClDNjbwJCK6z2R3wtXxoLxh1MmS0=
X-Gm-Message-State: AOJu0Yzcebf/dnHlo66wd7uL11zkWKml1ALgobHEZEaVKJisNL6AsJNK
	Mn6FINC5lX9R7Gcg005npnxtlra9uhyRF/Lm8R2DzBTWZ8sHwnOqdKKOHVxa2Q==
X-Google-Smtp-Source: AGHT+IGKnikD5uhOpS8Qz+KJdWvevlDwdz+2IBTMqXhUZzvn/1ANIUV+sFLzZMIuvEuD7ycqDlHFgg==
X-Received: by 2002:a17:907:7f0c:b0:a7a:ab8a:384 with SMTP id a640c23a62f3a-a8367058086mr236262566b.64.1723648929537;
        Wed, 14 Aug 2024 08:22:09 -0700 (PDT)
Message-ID: <dfb4678f-0b2d-4d1c-be02-10c4720e57b2@suse.com>
Date: Wed, 14 Aug 2024 17:22:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 4/7] xen/riscv: introduce functionality to work with
 CPU info
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <452e2960d1f064a2e3abcaae1ac354f48aafd24c.1723214540.git.oleksii.kurochko@gmail.com>
 <e0285026-40c5-4316-8129-d07801a9c233@suse.com>
 <ee3a2e61435e860f1ddb6022fbb712a8d890ae3e.camel@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: <ee3a2e61435e860f1ddb6022fbb712a8d890ae3e.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 14.08.2024 16:45, oleksii.kurochko@gmail.com wrote:
> On Tue, 2024-08-13 at 10:54 +0200, Jan Beulich wrote:
>> On 09.08.2024 18:19, Oleksii Kurochko wrote:
>>> --- a/xen/arch/riscv/include/asm/smp.h
>>> +++ b/xen/arch/riscv/include/asm/smp.h
>>> @@ -5,6 +5,8 @@
>>>  #include <xen/cpumask.h>
>>>  #include <xen/percpu.h>
>>>  
>>> +#define INVALID_HARTID UINT_MAX
>>> +
>>>  DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
>>>  DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
>>>  
>>> @@ -14,6 +16,14 @@ DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
>>>   */
>>>  #define park_offline_cpus false
>>>  
>>> +void smp_set_bootcpu_id(unsigned long boot_cpu_hartid);
>>> +
>>> +/*
>>> + * Mapping between linux logical cpu index and hartid.
>>> + */
>>> +extern unsigned long cpuid_to_hartid_map[NR_CPUS];
>>> +#define cpuid_to_hartid(cpu) cpuid_to_hartid_map[cpu]
>>
>> How wide can hart IDs be? Wider than 32 bits? If not, why unsigned
>> long?
> According to the spec:
> ```
> The mhartid CSR is an MXLEN-bit read-only register containing the
> integer ID of the hardware thread running the code
> ```
> where MXLEN can bit 32 and 64.

Hmm, okay. If the full MXLEN bits can be used, then using unsigned long
is indeed the right thing here.

>>> @@ -40,6 +41,19 @@ void __init noreturn start_xen(unsigned long
>>> bootcpu_id,
>>>  {
>>>      remove_identity_mapping();
>>>  
>>> +    /*
>>> +     * tp register contains an address of physical cpu
>>> information.
>>> +     * So write physical CPU info of boot cpu to tp register
>>> +     * It will be used later by get_processor_id() ( look at
>>> +     * <asm/processor.h> ):
>>> +     *   #define get_processor_id()    (tp->processor_id)
>>> +     */
>>> +    asm volatile ( "mv tp, %0" : : "r"((unsigned
>>> long)&pcpu_info[0]) );
>>
>> Perhaps be on the safe side and also add a memory barrier?
> Do you mean compiler barrier? ( asm volatile ( "..." :: ... : "memory"
> )? )

Yes.

>> Perhaps be on the safe side and do this absolutely first in the
>> function,
>> or even in assembly (such that initializers of future variables
>> declared
>> at the top of the function end up safe, too)?
> I am not sure that I am following your part related to put this code in
> assembler ( instructions in assembly code still code be re-ordered what
> can affect a time when tp will be set with correct value )

I'm afraid I don't understand this. Instructions can be re-ordered, sure,
but later instructions are guaranteed to observe the effects on register
state that earlier instructions caused.

> and what do
> you mean by "initializers of future variables declared at the top of
> the function end up safe"

With

void start_xen()
{
    int var = func();

    asm volatile ( "mv tp, %0" :: ...);
    ...

you end up with the requirement that func() must not use anything that
depends on tp being set. In this simple example it may be easy to say
"don't use an initializer and call the function afterwards". But that is
going to be a risky game to play. Look at x86'es __start_xen(). An
insertion into such a big set of declarations may not pay attention to
tp not being set yet, when _all_ other C code may reasonably assume tp
is set.

>>> --- /dev/null
>>> +++ b/xen/arch/riscv/smp.c
>>> @@ -0,0 +1,4 @@
>>> +#include <xen/smp.h>
>>> +
>>> +/* tp points to one of these per cpu */
>>> +struct pcpu_info pcpu_info[NR_CPUS];
>>
>> And they all need setting up statically? Is there a plan to make this
>> dynamic (which could be recorded in a "fixme" in the comment)?
> I didn't plan to make allocation of this array dynamic. I don't expect
> that NR_CPUS will be big.

What is this expectation of yours based on? Other architectures permit
systems with hundreds or even thousands of CPUs; why would RISC-V be
different there?

> I can add "fixme" but I am not really
> understand what will be advantages if pcpu_info[] will be allocated
> dynamically.

Where possible it's better to avoid static allocations, of which on
some systems only a very small part may be used. Even if you put yourself
on the position that many take - memory being cheap - you then still
waste cache and TLB bandwidth. Furthermore as long as struct pcpu_info
isn't big enough (and properly aligned) for two successive array entries
to not share cache lines, you may end up playing cacheline ping-pong
when a CPU writes to its own array slot.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 15:26:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 15:26:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777445.1187589 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seFt7-00015b-06; Wed, 14 Aug 2024 15:26:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777445.1187589; Wed, 14 Aug 2024 15:26:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seFt6-00015U-To; Wed, 14 Aug 2024 15:26:12 +0000
Received: by outflank-mailman (input) for mailman id 777445;
 Wed, 14 Aug 2024 15:26:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lR0F=PN=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1seFt6-00015O-9m
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 15:26:12 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 893fb369-5a51-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 17:26:11 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-52f00ad303aso9049762e87.2
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 08:26:11 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-53200f42734sm1303062e87.290.2024.08.14.08.26.09
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 Aug 2024 08:26:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 893fb369-5a51-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723649171; x=1724253971; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=cYmZmpJgLLQrHUQazIqEoQJSKSP9xtHfcufNHThOFxA=;
        b=Xd1/qYc77Z/SPZfvm2foeM6XhNai7qGCxki7jw+KZnVZQh0TB+BRj4vX8uZQHsVIqf
         DrtFsrxw9Qljg24f3vjuR6R6vIuGd62zMJAYKsm5PFDnPjI23Oa6V5/KQs+L/LbwYqzD
         W1Gei6L72VV3WIv2nzZsEpzEhJXRx2R1CY7N1YO7A9CxSKqmXotUb40O8lSyMtECClfi
         Yzsb8TsHf7UmARu9sf41lf34iLDVJXNZe/0K5tQuXR5EucFlHAhyJFDlhWEnBvKwrrrC
         zB/O79csU/Vt9TgF4kIwe36no3Gq4m9rHLTozZlAEbFDT6v5ppWuSilUOJ7tAcD+9tB4
         tTlA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723649171; x=1724253971;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=cYmZmpJgLLQrHUQazIqEoQJSKSP9xtHfcufNHThOFxA=;
        b=sMOL3f5eEzBKlnPcvIXF0Ql2goc/jwLu/+NBaP+yBfqsF7l4WYQNHSWTlYURSqeZmI
         eykCSggcXwyuMi6P0/rb2kJFag+NWTwmcLFIKM3q4eQLIpiJkGMuOuH/hf7I8f2wId5I
         zGqPxVfy/zYc+Ol8ViOSKYMhlAxdKKf8c/l3f51PgOYveu0x3YoWBggVRxLN1TjVB14p
         RvrPYIkAx0HvYENzFoAQnsPpvaD3jr/ZlrQ71D26N0Q9GjFutI1FB/FfmBDyXLM4iqSy
         EF4IM+H64gFG9VaE2MH3wkBY66MTQKYkhvL0v/59GjTc3bmlIayqVdg9XOf24m2k5XQ/
         M4NQ==
X-Forwarded-Encrypted: i=1; AJvYcCXjVqfEdPTvPRNZGawh8sn+RkRSCjeYkDt8Yn9o2EpoeF+kMoro9ahjOY8p+k+hpOlY6uqVWMchOzJSEJQnuKdd5tyvtoow9pA8zYsETKw=
X-Gm-Message-State: AOJu0YwvwzF4z5MhFB01aSW4MNvIwjGzsAlt+04y5T11Dth5QTYojhZx
	2huZ9FVHla16fLHGpFHEJnSm9Xu2peziqy/GXiqRspVHOZ6IA61p
X-Google-Smtp-Source: AGHT+IG1Tnr3tLyBrgc/O5GzweCTeGDL9nfPEC8VxaJ8ErG8oekcC7nHueShqJcul+pp0L8HwsIUhw==
X-Received: by 2002:a05:6512:33cf:b0:52e:9619:e26a with SMTP id 2adb3069b0e04-532eda81a21mr2049698e87.26.1723649169776;
        Wed, 14 Aug 2024 08:26:09 -0700 (PDT)
Date: Wed, 14 Aug 2024 17:26:08 +0200
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: qemu-devel@nongnu.org, anthony@xenproject.org, paul@xen.org,
	peter.maydell@linaro.org, alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com, jason.andryuk@amd.com,
	edgar.iglesias@amd.com, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v1 08/10] hw/xen: pvh-common: Add support for creating
 PCIe/GPEX
Message-ID: <ZrzMkI5jGUtXU2qA@zapote>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
 <20240812130606.90410-9-edgar.iglesias@gmail.com>
 <alpine.DEB.2.22.394.2408121822370.298534@ubuntu-linux-20-04-desktop>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.22.394.2408121822370.298534@ubuntu-linux-20-04-desktop>

On Mon, Aug 12, 2024 at 06:48:37PM -0700, Stefano Stabellini wrote:
> On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> > 
> > Add support for optionally creating a PCIe/GPEX controller.
> > 
> > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> > ---
> >  hw/xen/xen-pvh-common.c         | 66 +++++++++++++++++++++++++++++++++
> >  include/hw/xen/xen-pvh-common.h | 10 ++++-
> >  2 files changed, 75 insertions(+), 1 deletion(-)
> > 
> > diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
> > index 69a2dbdb6d..b1432e4bd9 100644
> > --- a/hw/xen/xen-pvh-common.c
> > +++ b/hw/xen/xen-pvh-common.c
> > @@ -120,6 +120,59 @@ static void xen_enable_tpm(XenPVHCommonState *s)
> >  }
> >  #endif
> >  
> > +static void xen_set_pci_intx_irq(void *opaque, int irq, int level)
> > +{
> > +    if (xen_set_pci_intx_level(xen_domid, 0, 0, 0, irq, level)) {
> 
> Looking at the implementation of XEN_DMOP_set_pci_intx_level in
> xen/arch/x86/hvm/dm.c, it looks like the device parameter of
> xen_set_pci_intx_level is required?

Yes, by setting device = 0, we're bypassing the irq swizzling in Xen.
I'll try to clarify below.


> 
> 
> > +        error_report("xendevicemodel_set_pci_intx_level failed");
> > +    }
> > +}
> > +
> > +static inline void xenpvh_gpex_init(XenPVHCommonState *s,
> > +                                    MemoryRegion *sysmem,
> > +                                    hwaddr ecam_base, hwaddr ecam_size,
> > +                                    hwaddr mmio_base, hwaddr mmio_size,
> > +                                    hwaddr mmio_high_base,
> > +                                    hwaddr mmio_high_size,
> > +                                    int intx_irq_base)
> > +{
> > +    MemoryRegion *ecam_reg;
> > +    MemoryRegion *mmio_reg;
> > +    DeviceState *dev;
> > +    int i;
> > +
> > +    object_initialize_child(OBJECT(s), "gpex", &s->pci.gpex,
> > +                            TYPE_GPEX_HOST);
> > +    dev = DEVICE(&s->pci.gpex);
> > +    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
> > +
> > +    ecam_reg = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
> > +    memory_region_add_subregion(sysmem, ecam_base, ecam_reg);
> 
> I notice we don't use ecam_size anywhere? Is that because the size is
> standard?

Yes. we could remove the size property, having it slightly simplifies the
prop setting code (keeping these memmap prop-pairs alike) but it's not a big deal.

> 
> 
> > +    mmio_reg = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1);
> > +
> > +    if (mmio_size) {
> > +        memory_region_init_alias(&s->pci.mmio_alias, OBJECT(dev), "pcie-mmio",
> > +                                 mmio_reg, mmio_base, mmio_size);
> > +        memory_region_add_subregion(sysmem, mmio_base, &s->pci.mmio_alias);
> > +    }
> > +
> > +    if (mmio_high_size) {
> > +        memory_region_init_alias(&s->pci.mmio_high_alias, OBJECT(dev),
> > +                "pcie-mmio-high",
> > +                mmio_reg, mmio_high_base, mmio_high_size);
> > +        memory_region_add_subregion(sysmem, mmio_high_base,
> > +                &s->pci.mmio_high_alias);
> > +    }
> > +
> > +    for (i = 0; i < GPEX_NUM_IRQS; i++) {
> > +        qemu_irq irq = qemu_allocate_irq(xen_set_pci_intx_irq, s, i);
> > +
> > +        sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, irq);
> > +        gpex_set_irq_num(GPEX_HOST(dev), i, intx_irq_base + i);
> > +        xen_set_pci_link_route(i, intx_irq_base + i);
> 
> xen_set_pci_link_route is not currently implemented on ARM?
> 
> Looking at hw/i386/pc_piix.c:piix_intx_routing_notifier_xen it seems
> that the routing is much more complex over there. But looking at other
> machines that use GPEX such as hw/arm/virt.c it looks like the routing
> is straightforward the same way as in this patch.
> 
> I thought that PCI interrupt pin swizzling was required, but maybe not ?
> 
> It is totally fine if we do something different, simpler, than
> hw/i386/pc_piix.c:piix_intx_routing_notifier_xen. I just want to make
> sure that things remain consistent between ARM and x86, and also between
> Xen and QEMU view of virtual PCI interrupt routing.
>

Good questions. The following is the way I understand things but I may
ofcourse be wrong.

Yes, we're doing things differently than hw/i386/pc_piix.c mainly
because we're using the GPEX PCIe host bridge with it's internal
standard swizzling down to 4 INTX interrupts. Similar to microvm and
the ARM virt machine.

The swizzling for the GPEX is done inside the GPEX model and it's
described by xl in the ACPI tables for PVH guests. We don't want
Xen to do any additional swizzling in xen_set_pci_intx_level(), hence
device=0.

I haven't plumbed the GPEX connectinos for ARM yet but I think we could
simply call xendevicemodel_set_irq_level() and not use the pci_intx
calls that aren't implement (we wouldn't need them).

For x86/pvh, I wonder if we should be using xen_set_pci_intx_level() /
xen_set_pci_link_route() or some other API? since we're basically
bypassing things?
In one of the first implementations we used set_isa_irq_level() but
that call only reaches into irqs < 16 so it messed things up.

Does any one have any better ideas or suggestions?

Cheers,
Edgar


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 15:42:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 15:42:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777456.1187600 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seG8I-0005NW-9z; Wed, 14 Aug 2024 15:41:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777456.1187600; Wed, 14 Aug 2024 15:41:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seG8I-0005NP-6E; Wed, 14 Aug 2024 15:41:54 +0000
Received: by outflank-mailman (input) for mailman id 777456;
 Wed, 14 Aug 2024 15:41: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=0xrl=PN=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1seG8H-0005NJ-M8
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 15:41:53 +0000
Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com
 [2a00:1450:4864:20::131])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ba284c56-5a53-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 17:41:52 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-52f025ab3a7so3959251e87.2
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 08:41:52 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-53200f12044sm1337044e87.159.2024.08.14.08.41.50
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 Aug 2024 08:41:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ba284c56-5a53-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723650112; x=1724254912; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=dGEExJE+a9Kh7KeMLmLpQLfOl2+BmWRAle4bkT1qqt0=;
        b=ko1rxoo58nBDZQssqMkkip9OKIeJgVsoSEEdA8FbxhHv39IFOlRQkeio/jjRqWNQR2
         jVRLO8BQWH/Zcmhj00CJrBTS4lliQxeEyOE8Qpj69MJ7+Zr70TLhdjrVD/LXJeq0B0Nl
         CtD5GwYwY08rfO3NIQi05m8Z92e/A8KHhwOL+233dLqesfLiBMUuZjBvb0Iyxa9lEDIS
         /EN5bVsWmUs+KtCh9gJi6hET//pn2txOqtBtyicVxbiHYbK96AT4ex2sYwxjORzlZJft
         q1Xbi99BEG77Z8AbDM4lj+E+A+2n93XXxFnbNeZ7gxXnAdxTCCgg2BJNG0sJKCgeJlhw
         5HdQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723650112; x=1724254912;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=dGEExJE+a9Kh7KeMLmLpQLfOl2+BmWRAle4bkT1qqt0=;
        b=BvH72/dqG/X4ns20K1FMhY9LCZeCkU4CblAA1cMm67j0ygVlV+w09yUqyHRHeS/32C
         fOWtnqZFUdlNKYB/m4x27C3z/x16sDPZX8R9Uq3DtR2sfUY/02pPBVPcvPB7DCSIF4yk
         M3CAPyk8AgQKm2bmv04Oy959qFo/boWsOAlMPpG853qA+kGX2RYii4d+tyCtF8y2NeE5
         8g2Ar1IkBXn2lWTHNUJUNfBTaH/deiErfcckPix28v9kvBZpLlQkuaIFRc861zKSdhdj
         MaY/ZpmskLRGxbcVQYd3iwjXf/cVln+6jQ3+NtTwi9LygfGCozsr/pzrJ+oOVCgZmc2R
         rKjQ==
X-Forwarded-Encrypted: i=1; AJvYcCXU0kVKTyBuAiOnndgwWZbA4+94D8AQT1jXBFbgseCaF/EeT3hNerknsCakE42kENnd0mwp91NOD4pRxfGnW/oESi+NNfbf8GvUDvqYScQ=
X-Gm-Message-State: AOJu0Ywc6Q6/Fp5oNbGHckzXzZOD8VzoZV7XvwMrb+zJsZlOtfcKqsNE
	wV8NUO3nQLmPfsGc/Owyb8MPr2G7/FkehdGulQeXy3KSmS2Z478/
X-Google-Smtp-Source: AGHT+IFMTnmt86hiTPWfs5hO5m2ak3dY7KYLVoc0nP+cfPQHWNnFHXn1hDM3QxY+lFFtpqJGatYb4A==
X-Received: by 2002:a05:6512:3196:b0:52f:c833:861a with SMTP id 2adb3069b0e04-532edbbe9eemr2347804e87.51.1723650111492;
        Wed, 14 Aug 2024 08:41:51 -0700 (PDT)
Message-ID: <34cbaff323d9619f8d4cb1d2b8ed12584037ee0d.camel@gmail.com>
Subject: Re: [PATCH v4 5/7] xen/riscv: introduce and initialize SBI RFENCE
 extension
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Wed, 14 Aug 2024 17:41:50 +0200
In-Reply-To: <77ff59d1-b158-4603-bdbd-67c079ce87c9@suse.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
	 <1a863d06866f86761d23e6da3f4a6ee58c474473.1723214540.git.oleksii.kurochko@gmail.com>
	 <77ff59d1-b158-4603-bdbd-67c079ce87c9@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Tue, 2024-08-13 at 11:34 +0200, Jan Beulich wrote:
> On 09.08.2024 18:19, Oleksii Kurochko wrote:
>=20
> > --- a/xen/arch/riscv/sbi.c
> > +++ b/xen/arch/riscv/sbi.c
> > @@ -7,11 +7,23 @@
> > =C2=A0 * Modified by Bobby Eshleman (bobby.eshleman@gmail.com).
> > =C2=A0 *
> > =C2=A0 * Copyright (c) 2019 Western Digital Corporation or its
> > affiliates.
> > - * Copyright (c) 2021-2023 Vates SAS.
> > + * Copyright (c) 2021-2024 Vates SAS.
> > =C2=A0 */
> > =C2=A0
> > +#include <xen/compiler.h>
> > +#include <xen/const.h>
> > +#include <xen/cpumask.h>
> > +#include <xen/errno.h>
> > +#include <xen/init.h>
> > +#include <xen/lib.h>
> > +#include <xen/smp.h>
> > +
> > +#include <asm/processor.h>
> > =C2=A0#include <asm/sbi.h>
> > =C2=A0
> > +static unsigned long sbi_spec_version =3D SBI_SPEC_VERSION_DEFAULT;
> > +static unsigned long sbi_fw_id, sbi_fw_version;
>=20
> __ro_after_init for perhaps all three of them?
>=20
> Considering SBI_SPEC_VERSION_{MAJOR,MINOR}_MASK, at least the first
> of them also doesn't need to be unsigned long, but could be unsigned
> int?
It could be unsigned int, this part is declared as unsigned long in
Linux kernel so was taken as is. But based on the possible values for
these variables we can go with unsigned long.

>=20
> > @@ -38,7 +50,245 @@ struct sbiret sbi_ecall(unsigned long ext,
> > unsigned long fid,
> > =C2=A0=C2=A0=C2=A0=C2=A0 return ret;
> > =C2=A0}
> > =C2=A0
> > +static int sbi_err_map_xen_errno(int err)
> > +{
> > +=C2=A0=C2=A0=C2=A0 switch ( err )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0 case SBI_SUCCESS:
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return 0;
> > +=C2=A0=C2=A0=C2=A0 case SBI_ERR_DENIED:
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EACCES;
> > +=C2=A0=C2=A0=C2=A0 case SBI_ERR_INVALID_PARAM:
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EINVAL;
> > +=C2=A0=C2=A0=C2=A0 case SBI_ERR_INVALID_ADDRESS:
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EFAULT;
> > +=C2=A0=C2=A0=C2=A0 case SBI_ERR_NOT_SUPPORTED:
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EOPNOTSUPP;
> > +=C2=A0=C2=A0=C2=A0 case SBI_ERR_FAILURE:
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fallthrough;
> > +=C2=A0=C2=A0=C2=A0 default:
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -ENOSYS;
> > +=C2=A0=C2=A0=C2=A0 };
> > +}
> > +
> > =C2=A0void sbi_console_putchar(int ch)
> > =C2=A0{
> > =C2=A0=C2=A0=C2=A0=C2=A0 sbi_ecall(SBI_EXT_0_1_CONSOLE_PUTCHAR, 0, ch, =
0, 0, 0, 0, 0);
> > =C2=A0}
> > +
> > +static unsigned long sbi_major_version(void)
> > +{
> > +=C2=A0=C2=A0=C2=A0 return (sbi_spec_version >> SBI_SPEC_VERSION_MAJOR_=
SHIFT) &
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SBI_SPEC_VERSION_MAJOR_MASK=
;
> > +}
>=20
> Can you use MASK_EXTR() here, allowing to even drop the separate
> SBI_SPEC_VERSION_MAJOR_SHIFT?
I am not sure that:
(sbi_spec_version >> SBI_SPEC_VERSION_MAJOR_SHIFT) &=20
SBI_SPEC_VERSION_MAJOR_MASK =3D=3D MASK_EXTR(sbi_spec_version,
SBI_SPEC_VERSION_MAJOR_MASK)

>=20
> > +static unsigned long sbi_minor_version(void)
> > +{
> > +=C2=A0=C2=A0=C2=A0 return sbi_spec_version & SBI_SPEC_VERSION_MINOR_MA=
SK;
> > +}
>=20
> For consistency here then, too.
Here we can use MASK_EXTR.

>=20
> > +static long sbi_ext_base_func(long fid)
> > +{
> > +=C2=A0=C2=A0=C2=A0 struct sbiret ret;
> > +
> > +=C2=A0=C2=A0=C2=A0 ret =3D sbi_ecall(SBI_EXT_BASE, fid, 0, 0, 0, 0, 0,=
 0);
> > +=C2=A0=C2=A0=C2=A0 if ( !ret.error )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return ret.value;
> > +=C2=A0=C2=A0=C2=A0 else
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return ret.error;
>=20
> With the folding of two distinct values, how is the caller going to
> tell failure from success?
By checking if the return value is < 0.
According to the SBI spec [
https://github.com/riscv-non-isa/riscv-sbi-doc/blob/master/src/binary-encod=
ing.adoc?plain=3D1#L32
] ret.error can be or 0 ( which means success ) or something < 0 if it
was a failure.

>=20
> > +}
> > +
> > +static int __sbi_rfence_v02_real(unsigned long fid,
>=20
> Are the double leading underscores really necessary here? (Same again
> further down.)
No at all, I'll drop it.

>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long hmask, unsig=
ned
> > long hbase,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long start, unsig=
ned
> > long size,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long arg4)
> > +{
> > +=C2=A0=C2=A0=C2=A0 struct sbiret ret =3D {0};
> > +=C2=A0=C2=A0=C2=A0 int result =3D 0;
> > +
> > +=C2=A0=C2=A0=C2=A0 switch ( fid )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0 case SBI_EXT_RFENCE_REMOTE_FENCE_I:
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret =3D sbi_ecall(SBI_EXT_R=
FENCE, fid, hmask, hbase,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 0, 0, 0, 0);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break;
> > +=C2=A0=C2=A0=C2=A0 case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA:
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret =3D sbi_ecall(SBI_EXT_R=
FENCE, fid, hmask, hbase,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 start, size, 0, 0);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break;
> > +=C2=A0=C2=A0=C2=A0 case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID:
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret =3D sbi_ecall(SBI_EXT_R=
FENCE, fid, hmask, hbase,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 start, size, arg4, 0);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break;
> > +=C2=A0=C2=A0=C2=A0 case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA:
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret =3D sbi_ecall(SBI_EXT_R=
FENCE, fid, hmask, hbase,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 start, size, 0, 0);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 break;
>=20
> How is e.g. this different from SBI_EXT_RFENCE_REMOTE_SFENCE_VMA
> handling? To ease recognition, I think you want to fold cases with
> identical handling.
Agree, it could be folded for some cases.

>=20
> > +int sbi_remote_sfence_vma(cpumask_t *cpu_mask,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 unsigned long start_addr,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 unsigned long size)
> > +{
> > +=C2=A0=C2=A0=C2=A0 return __sbi_rfence(SBI_EXT_RFENCE_REMOTE_SFENCE_VM=
A,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cpu_m=
ask, start_addr, size, 0, 0);
>=20
> No check (not even an assertion) here for __sbi_rfence still being
> NULL?
I thought that it would be enough to have BUG_ON() in sbi_init() but
then probably would be better to update the message inside BUG_ON():
   int __init sbi_init(void)
   {
   ....
  =20
       if ( !sbi_has_rfence() )
       {
           BUG_ON("At the moment flush_xen_tlb_range_va() uses SBI rfence
   to "
                  "flush TLB for all CPUS!");
       }
  =20
       return 0;
   }
>=20
> > +int __init sbi_init(void)
> > +{
> > +=C2=A0=C2=A0=C2=A0 int ret;
> > +
> > +=C2=A0=C2=A0=C2=A0 ret =3D sbi_get_spec_version();
> > +=C2=A0=C2=A0=C2=A0 if ( ret > 0 )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sbi_spec_version =3D ret;
>=20
> Truncation from long to int is not an issue here?
No, spec_version doesn't have such big numbers, the latest version is
v2.0.

>=20
> > +=C2=A0=C2=A0=C2=A0 printk("SBI specification v%lu.%lu detected\n",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sbi=
_major_version(), sbi_minor_version());
> > +
> > +=C2=A0=C2=A0=C2=A0 if ( !sbi_spec_is_0_1() )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sbi_fw_id =3D sbi_get_firmw=
are_id();
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sbi_fw_version =3D sbi_get_=
firmware_version();
>=20
> These cannot return errors?
At least, SBI specs don't tell that directly:
https://github.com/riscv-non-isa/riscv-sbi-doc/blob/master/src/ext-base.ado=
c?plain=3D1#L31

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 15:46:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 15:46:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777464.1187610 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seGCQ-0005yB-QS; Wed, 14 Aug 2024 15:46:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777464.1187610; Wed, 14 Aug 2024 15:46:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seGCQ-0005y4-Me; Wed, 14 Aug 2024 15:46:10 +0000
Received: by outflank-mailman (input) for mailman id 777464;
 Wed, 14 Aug 2024 15:46: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=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seGCP-0005xy-5b
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 15:46:09 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4ee6d501-5a54-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 17:46:02 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a7a83a968ddso6366166b.0
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 08:46:02 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f414e3acsm189708166b.172.2024.08.14.08.46.00
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 08:46:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4ee6d501-5a54-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723650361; x=1724255161; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=cBKYeZKyES1ScXVUTtKnzmfhTTDYTTLOrVKImIz6K9E=;
        b=LL/x2E25U0QYJamCpWclU+d7WFzjOqYa6Yn7iIcE5PPFcYwVI5bMoULn6vPQscLfh+
         H0Gdlahmpt95eqH9yHfwoVQZpg/t2FFcXO/bcG/L5BvEDhCE924yT33zYJzkUW6gNBK/
         DvIrxVoD0g4lR3pt+vigmBSqePnryFvmbHql8DkNuWFnur3t3eqW+lzaqJL5ghfBupFz
         2OWdqIzguAj8i23bqR2o5Qq2sJgQviBB3/Yz1Nfz9gZw2qe4KYqOrYSveoe6w1qGwoUe
         UplaC4GuTYoT31cyXs4tyD13XOTT4IulK+4OgpkYQvpoXlw9ymlIww5+0YOQMnFOLE49
         yQiQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723650361; x=1724255161;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=cBKYeZKyES1ScXVUTtKnzmfhTTDYTTLOrVKImIz6K9E=;
        b=UcUWm8nEdcRnPUgShXAl0mOP0wHtwx5JV7P0tXe+S1WUebzLU9CtBoEqabk4RYr6rb
         Yn73XZPHAfk2ZCxWde4s74T1XSZwlK0Amg5SpOlKTQP9HN+fmeCJWGAnD1XbvLEbbRNp
         SY2Oj1KUXsdvevuI5zMo6Ed/crPYdildt6zc+O/W/kble9vZbhdX4uX/5zMWP4s7CUxd
         1EEKAGdC+8twI4YFFM1AoWDMaWbbbf8IJq0sH+cZ1cju7JtwhXZPEIwkpkZC7n5eQWHB
         YfKbCMSLehE0/V2ORU3t4jJqPoSY0Bi+sYM+J26LZZU9av6qr0HuOkYaiWgD9VDC+YGg
         6v3g==
X-Gm-Message-State: AOJu0YxSSLjSTiaE6meLU2Y+KPRikN3++SqiMlwlSL1zRHEcSYYZor7D
	/A7jmSL4kkIRBAeoohSDGBKg0jhAszFtXoixXPmD+LK+Bh7lQzvraymD8erABHgt9LPkbIPx8gE
	=
X-Google-Smtp-Source: AGHT+IHp7Mxvd6d9LuVkrJRoNRz7X8IgAm4ITrt9uSOWhoAQ/qhemoME9BjxSgty1rlk8FBCZ/PRcQ==
X-Received: by 2002:a17:907:e695:b0:a7b:baea:892c with SMTP id a640c23a62f3a-a8366fefcf6mr215676566b.54.1723650361375;
        Wed, 14 Aug 2024 08:46:01 -0700 (PDT)
Message-ID: <a40bd7ed-c30e-43b6-9005-e02fe1572eb5@suse.com>
Date: Wed, 14 Aug 2024 17:45:59 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 9/9] x86emul: support AVX10.2 256-bit embedded rounding
 / SAE
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
 <3a72e8f6-926f-4492-b310-df96f279a2b7@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <3a72e8f6-926f-4492-b310-df96f279a2b7@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 14.08.2024 10:54, Jan Beulich wrote:
> AVX10.2 (along with APX) assigns new meaning to the bit that previsouly
> distinguished EVEX from the Phi co-processor's MVEX. Therefore
> evex_encoded() now needs to key off of something else: Use the opcode
> mapping field for this, leveraging that map 0 has no assigned opcodes
> (and appears unlikely to gain any).
> 
> Place the check of EVEX.U such that it'll cover all insns. EVEX.b is
> being checked for individual insns as applicable - whenever that's valid
> for (register-only) 512-bit forms, it becomes valid for 256-bit forms as
> well when AVX10.2 is permitted for a guest.

This isn't quite right: For scalar insns EVEX.U needs to be consistently
set[1]. There's no pattern though to easily identify them all, so it'll be
tedious / error prone to add checks in all necessary places.

Jan

[1] That's my expectation at least. The spec lacks the necessary details.
(The exception classes say "EVEX.b encoding #UD conditions not met." Yet
an update to the respective table in the SDM isn't provided.) But in the
absence of a clear statement that the bit would be ignore for scalar
insns, we need to assume that it being wrongly clear would / should cause
#UD.


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 15:50:39 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 15:50:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777473.1187620 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seGGf-0007Uk-Ag; Wed, 14 Aug 2024 15:50:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777473.1187620; Wed, 14 Aug 2024 15:50:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seGGf-0007Ud-8C; Wed, 14 Aug 2024 15:50:33 +0000
Received: by outflank-mailman (input) for mailman id 777473;
 Wed, 14 Aug 2024 15:50:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lR0F=PN=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1seGGe-0007UX-0Y
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 15:50:32 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ef337f63-5a54-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 17:50:30 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-52f01b8738dso6114641e87.1
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 08:50:30 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-53200f3daaesm1308152e87.241.2024.08.14.08.50.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 Aug 2024 08:50:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ef337f63-5a54-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723650630; x=1724255430; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=e/gYLaKPeQFOpje6uLnnz3IMiblJW7rg/lR5EngKbeg=;
        b=LpCq4CIiO4JZdKBz0m3CnVpKEjj8yzEL98I4/eZHk0Xn8sudz/6fkwOf1HT7xWIZYB
         6VEaFjvGbxKmdDiIaKoJl2eZd1Kip22gVBjyjMi0zWc5NkqUv/peWLqV0CmfNjo1wXbm
         psc5b5prKd3LbWLxq+n9s6x4cTyUer7SdAQU5oaT/78YkDD9o1gSrVlWN+RZkX/UZ99F
         RYkbZeyOwJarrHBnktI/jAww0c3RboBAy4RHAO1Qv9zeDU8AbwjKlZk6Z1abByl1UgaX
         tEkjQTLSLUxNkTJ7aHH62yG6wlAgyZfqQUodXzcS21QXWz3Y8FUZTvn+R8D3Ze7rsoBd
         escw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723650630; x=1724255430;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=e/gYLaKPeQFOpje6uLnnz3IMiblJW7rg/lR5EngKbeg=;
        b=NRXZl6Pr+PbenA6xJGVtzQ+rDBneR1BQS1xuIxHSHotqQaVDLM/ZWAiKn+q0C7geic
         rj2W2OMP++ec4VNjl9tcxWBP2RLZ38ltnUeJ9kmyiEk7hlOvLjsBJPKsO4sAfvJTrKxd
         FM8PZaOt9cjFlhHzyLQeSNR/GRyLVF6gxgbOLSw4WSq5PAiRT9oHlXqhO+qZUAgR7DI5
         RAbp44rLKKysPTN93dMOkAdSkWLpvmgR5eqAk9sDuc6CWDta4Z7vnQiC6Yjzw8ITNq11
         dQIbENOdXn0rum2SrFrv1gI4tNL2lz0AhY6q63oAsWF3rvp+lf3GQ9lhOvEr7sy5gc6X
         ZQrQ==
X-Forwarded-Encrypted: i=1; AJvYcCVN71nTHEBqgXGlz0f1s2JJHQzbtb+0RAsDb50MQ0Q2zYjetRej7Je7i3abA0QZN2v8qFyipA1IA3prpZuf76hn0oOt4H9l015uXPxLErM=
X-Gm-Message-State: AOJu0YwbFYUzmzkQayKS+075RizNQuqlZ/Jd6QsqVSc/AKKfpo86C+wl
	V3zl7fM6SgYBJs7iGboUMIfky+5MpkCM83OjItcGgmU4ma26uwsp
X-Google-Smtp-Source: AGHT+IHcVkvxyTJG9ipRaZHZ+21NOa0KrthTySBhaf/jwCY7RrKJlzsfNGbJbbK5/xKyDBn6ddqmMQ==
X-Received: by 2002:a05:6512:138b:b0:52c:cc38:592c with SMTP id 2adb3069b0e04-532ed729715mr2265346e87.0.1723650629740;
        Wed, 14 Aug 2024 08:50:29 -0700 (PDT)
Date: Wed, 14 Aug 2024 17:50:28 +0200
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: qemu-devel@nongnu.org, anthony@xenproject.org, paul@xen.org,
	peter.maydell@linaro.org, alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com, jason.andryuk@amd.com,
	edgar.iglesias@amd.com, xen-devel@lists.xenproject.org,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Eduardo Habkost <eduardo@habkost.net>
Subject: Re: [PATCH v1 09/10] hw/i386/xen: Add a Xen PVH x86 machine
Message-ID: <ZrzSRPPNYxeh98J4@zapote>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
 <20240812130606.90410-10-edgar.iglesias@gmail.com>
 <alpine.DEB.2.22.394.2408121840230.298534@ubuntu-linux-20-04-desktop>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <alpine.DEB.2.22.394.2408121840230.298534@ubuntu-linux-20-04-desktop>

On Mon, Aug 12, 2024 at 06:48:52PM -0700, Stefano Stabellini wrote:
> On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> > 
> > This adds a Xen PVH x86 machine based on the PVH Common
> > module used by the ARM PVH machine.
> > 
> > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> > ---
> >  hw/i386/xen/meson.build |   1 +
> >  hw/i386/xen/xen-pvh.c   | 196 ++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 197 insertions(+)
> >  create mode 100644 hw/i386/xen/xen-pvh.c
> > 
> > diff --git a/hw/i386/xen/meson.build b/hw/i386/xen/meson.build
> > index 3f0df8bc07..c73c62b8e3 100644
> > --- a/hw/i386/xen/meson.build
> > +++ b/hw/i386/xen/meson.build
> > @@ -4,6 +4,7 @@ i386_ss.add(when: 'CONFIG_XEN', if_true: files(
> >  ))
> >  i386_ss.add(when: ['CONFIG_XEN', xen], if_true: files(
> >    'xen-hvm.c',
> > +  'xen-pvh.c',
> >  ))
> >  
> >  i386_ss.add(when: 'CONFIG_XEN_BUS', if_true: files(
> > diff --git a/hw/i386/xen/xen-pvh.c b/hw/i386/xen/xen-pvh.c
> > new file mode 100644
> > index 0000000000..9c3d3fc58d
> > --- /dev/null
> > +++ b/hw/i386/xen/xen-pvh.c
> > @@ -0,0 +1,196 @@
> > +/*
> > + * QEMU Xen PVH x86 Machine
> > + *
> > + * Copyright (c) 2024 Advanced Micro Devices, Inc.
> > + * Written by Edgar E. Iglesias <edgar.iglesias@amd.com>
> > + *
> > + * SPDX-License-Identifier: GPL-2.0-or-later
> > + */
> > +
> > +#include "qemu/osdep.h"
> > +#include "qapi/error.h"
> > +#include "qapi/visitor.h"
> > +#include "qemu/error-report.h"
> > +#include "hw/boards.h"
> > +#include "sysemu/sysemu.h"
> > +#include "hw/xen/arch_hvm.h"
> > +#include "hw/xen/xen.h"
> > +#include "hw/xen/xen-pvh-common.h"
> > +
> > +#define TYPE_XEN_PVH_X86  MACHINE_TYPE_NAME("xenpvh")
> > +OBJECT_DECLARE_SIMPLE_TYPE(XenPVHx86State, XEN_PVH_X86)
> > +
> > +#define PVH_MAX_CPUS 128
> > +
> > +struct XenPVHx86State {
> > +    /*< private >*/
> > +    MachineState parent;
> > +
> > +    DeviceState *cpu[PVH_MAX_CPUS];
> > +    XenPVHCommonState pvh;
> > +
> > +    /*
> > +     * We provide these properties to allow Xen to move things to other
> > +     * addresses for example when users need to accomodate the memory-map
> > +     * for 1:1 mapped devices/memory.
> > +     */
> > +    struct {
> > +        MemMapEntry ram_low, ram_high;
> > +        MemMapEntry pci_ecam, pci_mmio, pci_mmio_high;
> 
> Can we use the same properties already present under XenPVHCommonState?
> 
> 
> 
> > +    } cfg;
> > +};
> > +
> > +static void xenpvh_cpu_new(MachineState *ms,
> > +                           XenPVHx86State *xp,
> > +                           int cpu_idx,
> > +                           int64_t apic_id)
> > +{
> > +    Object *cpu = object_new(ms->cpu_type);
> > +
> > +    object_property_add_child(OBJECT(ms), "cpu[*]", cpu);
> > +    object_property_set_uint(cpu, "apic-id", apic_id, &error_fatal);
> > +    qdev_realize(DEVICE(cpu), NULL, &error_fatal);
> > +    object_unref(cpu);
> > +
> > +    xp->cpu[cpu_idx] = DEVICE(cpu);
> 
> 
> Why do we need to create CPU devices in QEMU given that we are only
> doing device emulation? I guess it is because ....
> 
> 
> 
> > +}
> > +
> > +static void xenpvh_init(MachineState *ms)
> > +{
> > +    XenPVHx86State *xp = XEN_PVH_X86(ms);
> > +    const struct {
> > +        const char *name;
> > +        MemMapEntry *map;
> > +    } map[] = {
> > +        { "ram-low", &xp->cfg.ram_low },
> > +        { "ram-high", &xp->cfg.ram_high },
> > +        { "pci-ecam", &xp->cfg.pci_ecam },
> > +        { "pci-mmio", &xp->cfg.pci_mmio },
> > +        { "pci-mmio-high", &xp->cfg.pci_mmio_high },
> > +    };
> > +    int i;
> > +
> > +    object_initialize_child(OBJECT(ms), "pvh", &xp->pvh, TYPE_XEN_PVH_COMMON);
> > +    object_property_set_int(OBJECT(&xp->pvh), "max-cpus", ms->smp.max_cpus,
> > +                            &error_abort);
> > +    object_property_set_int(OBJECT(&xp->pvh), "ram-size", ms->ram_size,
> > +                            &error_abort);
> > +
> > +    for (i = 0; i < ARRAY_SIZE(map); i++) {
> > +        g_autofree char *base_name = g_strdup_printf("%s-base", map[i].name);
> > +        g_autofree char *size_name = g_strdup_printf("%s-size", map[i].name);
> > +
> > +        object_property_set_int(OBJECT(&xp->pvh), base_name, map[i].map->base,
> > +                                 &error_abort);
> > +        object_property_set_int(OBJECT(&xp->pvh), size_name, map[i].map->size,
> > +                                 &error_abort);
> > +    }
> > +
> > +    /* GSI's 16 - 20 are used for legacy PCIe INTX IRQs.  */
> > +    object_property_set_int(OBJECT(&xp->pvh), "pci-intx-irq-base", 16,
> > +                            &error_abort);
> > +
> > +    sysbus_realize(SYS_BUS_DEVICE(&xp->pvh), &error_abort);
> > +
> > +    /* Create dummy cores. This will indirectly create the APIC MSI window.  */
> 
> ... of the APIC MSI window ?


Yes, exactly. I did have a first version without the CPUs that only had
the MSI window but there was a bit of disentanglement needed and some
other issue that I forgot. Note that with TCG disabled, this doesn't
have the any CPU emulation so it doesn't affect our small PVH config
very much. I could look into the MSI windows again though.


> 
> 
> 
> > +    for (i = 0; i < ms->smp.cpus; i++) {
> > +        xenpvh_cpu_new(ms, xp, i, i);
> > +    }
> > +}
> > +
> > +#define XENPVH_PROP_MEMMAP_SETTER(n, f)                                    \
> > +static void xenpvh_set_ ## n ## _ ## f(Object *obj, Visitor *v,            \
> > +                                       const char *name, void *opaque,     \
> > +                                       Error **errp)                       \
> > +{                                                                          \
> > +    XenPVHx86State *xp = XEN_PVH_X86(obj);                                 \
> > +    uint64_t value;                                                        \
> > +                                                                           \
> > +    if (!visit_type_size(v, name, &value, errp)) {                         \
> > +        return;                                                            \
> > +    }                                                                      \
> > +    xp->cfg.n.f = value;                                                   \
> > +}
> > +
> > +#define XENPVH_PROP_MEMMAP_GETTER(n, f)                                    \
> > +static void xenpvh_get_ ## n ## _ ## f(Object *obj, Visitor *v,            \
> > +                                       const char *name, void *opaque,     \
> > +                                       Error **errp)                       \
> > +{                                                                          \
> > +    XenPVHx86State *xp = XEN_PVH_X86(obj);                                 \
> > +    uint64_t value = xp->cfg.n.f;                                          \
> > +                                                                           \
> > +    visit_type_uint64(v, name, &value, errp);                              \
> > +}
> > +
> > +#define XENPVH_PROP_MEMMAP(n)              \
> > +    XENPVH_PROP_MEMMAP_SETTER(n, base)     \
> > +    XENPVH_PROP_MEMMAP_SETTER(n, size)     \
> > +    XENPVH_PROP_MEMMAP_GETTER(n, base)     \
> > +    XENPVH_PROP_MEMMAP_GETTER(n, size)
> > +
> > +
> > +XENPVH_PROP_MEMMAP(ram_low)
> > +XENPVH_PROP_MEMMAP(ram_high)
> > +XENPVH_PROP_MEMMAP(pci_ecam)
> > +XENPVH_PROP_MEMMAP(pci_mmio)
> > +XENPVH_PROP_MEMMAP(pci_mmio_high)
> 
> I would make all of these common with ARM. It wouldn't hurt to make them
> configurable on ARM too, in fact we might need it for 1:1 mapped guests
> 


Yes, that was the plan in future patches.


> 
> 
> > +static void xenpvh_instance_init(Object *obj)
> > +{
> > +    XenPVHx86State *xp = XEN_PVH_X86(obj);
> > +
> > +    /* Default memmap.  */
> > +    xp->cfg.ram_low.base = 0x0;
> > +    xp->cfg.ram_low.size = 0x80000000U;
> > +    xp->cfg.ram_high.base = 0xC000000000ULL;
> > +    xp->cfg.ram_high.size = 0x4000000000ULL;
> > +}
> > +
> > +static void xenpvh_machine_class_init(ObjectClass *oc, void *data)
> > +{
> > +    MachineClass *mc = MACHINE_CLASS(oc);
> > +
> > +    mc->desc = "Xen PVH x86 machine";
> > +    mc->init = xenpvh_init;
> > +    mc->max_cpus = PVH_MAX_CPUS;
> > +    mc->default_cpu_type = TARGET_DEFAULT_CPU_TYPE;
> > +    mc->default_machine_opts = "accel=xen";
> > +    /* Set explicitly here to make sure that real ram_size is passed */
> > +    mc->default_ram_size = 0;
> > +
> > +#define OC_MEMMAP_PROP(c, prop_name, name)                               \
> > +do {                                                                     \
> > +    object_class_property_add(c, prop_name "-base", "uint64_t",          \
> > +                              xenpvh_get_ ## name ## _base,              \
> > +                              xenpvh_set_ ## name ## _base, NULL, NULL); \
> > +    object_class_property_set_description(oc, prop_name "-base",         \
> > +                              prop_name " base address");                \
> > +    object_class_property_add(c, prop_name "-size", "uint64_t",          \
> > +                              xenpvh_get_ ## name ## _size,              \
> > +                              xenpvh_set_ ## name ## _size, NULL, NULL); \
> > +    object_class_property_set_description(oc, prop_name "-size",         \
> > +                              prop_name " size of memory region");       \
> > +} while (0)
> > +
> > +    OC_MEMMAP_PROP(oc, "ram-low", ram_low);
> > +    OC_MEMMAP_PROP(oc, "ram-high", ram_high);
> > +    OC_MEMMAP_PROP(oc, "pci-ecam", pci_ecam);
> > +    OC_MEMMAP_PROP(oc, "pci-mmio", pci_mmio);
> > +    OC_MEMMAP_PROP(oc, "pci-mmio-high", pci_mmio_high);
> > +}
> > +
> > +static const TypeInfo xenpvh_machine_type = {
> > +    .name = TYPE_XEN_PVH_X86,
> > +    .parent = TYPE_MACHINE,
> > +    .class_init = xenpvh_machine_class_init,
> > +    .instance_init = xenpvh_instance_init,
> > +    .instance_size = sizeof(XenPVHx86State),
> > +};
> > +
> > +static void xenpvh_machine_register_types(void)
> > +{
> > +    type_register_static(&xenpvh_machine_type);
> > +}
> > +
> > +type_init(xenpvh_machine_register_types)
> > -- 
> > 2.43.0
> > 


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 15:53:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 15:53:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777495.1187630 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seGJJ-0000Xk-Ra; Wed, 14 Aug 2024 15:53:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777495.1187630; Wed, 14 Aug 2024 15:53:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seGJJ-0000Xc-Oc; Wed, 14 Aug 2024 15:53:17 +0000
Received: by outflank-mailman (input) for mailman id 777495;
 Wed, 14 Aug 2024 15:53:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seGJH-0000XU-TJ
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 15:53:15 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 50e8761b-5a55-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 17:53:14 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-5a156557026so79583a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 08:53:14 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5beae5fa625sm553348a12.93.2024.08.14.08.53.13
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 08:53:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 50e8761b-5a55-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723650794; x=1724255594; 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=A2IeALN3Vrq3vvrJcYopiAMEOi+iZY1Mf62fXq4DCts=;
        b=fa5qcn+8MFjunQwA6OxTeUSlP2evgham8hOIAoxeiTG9E1o9LI4Ji26FBYw8P/B4gf
         Rowawv05Gk0S3T04gW3j4cFPT7P8XUMegD5EiBoKUSitVjYp1T7yEiAtaxNlD/5XQD0+
         2eFNImH7LLlKI1Iz9Y2QZi5vzNYUTkiMqrLuwFMXPoxtHA+EjHSc2IbwIqjhXDzQWO5x
         T0Fs1J34Y+35cvm1NHFbOBvWhHPEvh1WpHd1fr7BK3gnsfGkxBsSCzckhyEQMqp9Necw
         0chiYMMwl9BQ3j5ehJSRTXKDLZv+u88LSTZ3nkx++FxpA2MYho1BK5m8Aa32fJjt9B7f
         Btiw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723650794; x=1724255594;
        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=A2IeALN3Vrq3vvrJcYopiAMEOi+iZY1Mf62fXq4DCts=;
        b=uRDXo/nl8O5qZlLtPLk71Kqj0fvPKkLuuHi97cWPsCtA02HdiSClCa9NDFUpRPw2eI
         bJoIixgBuxEN8soZl7VbFkI+K2em3naBgjx0G/Gd0CbRi3sRRld20CoBIoPbWiTvYhWr
         720h7g06pQF+gXG3zlbXQOoUJXhYEcxZuOf63n6r4b9pI0Hv9hiKB2v/OHJwdpDiRxE5
         SWfHkU2+WyIvObF4vWs1IJeSyCZYzSdayHCT+YOIcGJGWv4+nYMbPIPXOkE7wzjZpQHv
         kz56PldxaGjIr+9DLWJJNZ3oBRWNoxY6472bihPQ5o9zIC7zHJ/t/n8gaAtqhKZf5H49
         vDmw==
X-Forwarded-Encrypted: i=1; AJvYcCW0/BQUJH8sZWGbMHon0BGcMdXhtE/J15i6qNj9PEh+9k6umd8mlik9FTsUiYU+Ly0pOseNjGfQntyfrm56tJi0YGsvdJM02+i6Ez2YMxc=
X-Gm-Message-State: AOJu0YxmdPaIJvHWyaQ5hHP3nKudUTCSomIXNduWKdbj2TogoBvf+zPZ
	iSqllEccvVQCe5bO4s0G7J3MIfBvUmu7nxYwg31gOXrake6ORExy5jk06eEuSA==
X-Google-Smtp-Source: AGHT+IG8pSUDu6nVhZUcf19kE/vFyNTJcWLuViHUe8M0v9g0B+jJaGlkaR4B01K01XxASFY+kE8YGA==
X-Received: by 2002:a05:6402:11c6:b0:5a3:27bd:e264 with SMTP id 4fb4d7f45d1cf-5bea1c7724amr2815632a12.9.1723650794217;
        Wed, 14 Aug 2024 08:53:14 -0700 (PDT)
Message-ID: <959f33b6-3649-45b3-8f31-ec494e60fd80@suse.com>
Date: Wed, 14 Aug 2024 17:53:12 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 5/7] xen/riscv: introduce and initialize SBI RFENCE
 extension
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <1a863d06866f86761d23e6da3f4a6ee58c474473.1723214540.git.oleksii.kurochko@gmail.com>
 <77ff59d1-b158-4603-bdbd-67c079ce87c9@suse.com>
 <34cbaff323d9619f8d4cb1d2b8ed12584037ee0d.camel@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: <34cbaff323d9619f8d4cb1d2b8ed12584037ee0d.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 14.08.2024 17:41, oleksii.kurochko@gmail.com wrote:
> On Tue, 2024-08-13 at 11:34 +0200, Jan Beulich wrote:
>> On 09.08.2024 18:19, Oleksii Kurochko wrote:
>>> +static unsigned long sbi_major_version(void)
>>> +{
>>> +    return (sbi_spec_version >> SBI_SPEC_VERSION_MAJOR_SHIFT) &
>>> +        SBI_SPEC_VERSION_MAJOR_MASK;
>>> +}
>>
>> Can you use MASK_EXTR() here, allowing to even drop the separate
>> SBI_SPEC_VERSION_MAJOR_SHIFT?
> I am not sure that:
> (sbi_spec_version >> SBI_SPEC_VERSION_MAJOR_SHIFT) & 
> SBI_SPEC_VERSION_MAJOR_MASK == MASK_EXTR(sbi_spec_version,
> SBI_SPEC_VERSION_MAJOR_MASK)

How come you're not sure? That's precisely what MASK_EXTR() is for.

>>> +static long sbi_ext_base_func(long fid)
>>> +{
>>> +    struct sbiret ret;
>>> +
>>> +    ret = sbi_ecall(SBI_EXT_BASE, fid, 0, 0, 0, 0, 0, 0);
>>> +    if ( !ret.error )
>>> +        return ret.value;
>>> +    else
>>> +        return ret.error;
>>
>> With the folding of two distinct values, how is the caller going to
>> tell failure from success?
> By checking if the return value is < 0.
> According to the SBI spec [
> https://github.com/riscv-non-isa/riscv-sbi-doc/blob/master/src/binary-encoding.adoc?plain=1#L32
> ] ret.error can be or 0 ( which means success ) or something < 0 if it
> was a failure.

Right. And what if ret.error was 0, but ret.value was negative?

>>> +int sbi_remote_sfence_vma(cpumask_t *cpu_mask,
>>> +                          unsigned long start_addr,
>>> +                          unsigned long size)
>>> +{
>>> +    return __sbi_rfence(SBI_EXT_RFENCE_REMOTE_SFENCE_VMA,
>>> +                        cpu_mask, start_addr, size, 0, 0);
>>
>> No check (not even an assertion) here for __sbi_rfence still being
>> NULL?
> I thought that it would be enough to have BUG_ON() in sbi_init() but
> then probably would be better to update the message inside BUG_ON():
>    int __init sbi_init(void)
>    {
>    ....
>    
>        if ( !sbi_has_rfence() )
>        {
>            BUG_ON("At the moment flush_xen_tlb_range_va() uses SBI rfence
>    to "
>                   "flush TLB for all CPUS!");

I never really liked this kind of BUG_ON(). I leave it uncommented in
code which clearly is only temporary. Plus imo such BUG_ON()s want to
be next to where the risk is, i.e. in this case ahead of the possible
NULL deref. Then again, without PV guests and without anything mapped
at VA 0, you'll crash cleanly anyway. So perhaps my request to add a
check went too far.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 15:54:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 15:54:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777502.1187639 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seGK4-000135-3z; Wed, 14 Aug 2024 15:54:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777502.1187639; Wed, 14 Aug 2024 15:54:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seGK4-00012y-16; Wed, 14 Aug 2024 15:54:04 +0000
Received: by outflank-mailman (input) for mailman id 777502;
 Wed, 14 Aug 2024 15:54:03 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=W8Zn=PN=cloud.com=matthew.barnes@srs-se1.protection.inumbo.net>)
 id 1seGK3-0000wO-7L
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 15:54:03 +0000
Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com
 [2607:f8b0:4864:20::729])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6c5ea128-5a55-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 17:54:01 +0200 (CEST)
Received: by mail-qk1-x729.google.com with SMTP id
 af79cd13be357-7a3375015f8so466626085a.1
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 08:54:01 -0700 (PDT)
Received: from mbarnes-x-u.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a4c7e05db8sm449388285a.124.2024.08.14.08.53.58
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 Aug 2024 08:53:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6c5ea128-5a55-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723650840; x=1724255640; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=QG/M0V684VfpYQYWG1KSktx6rzyoliVsgiAOZUPbgck=;
        b=QHfikBeUTIAC6atWM1hCEmdTLxfhUio/uIQivo6oEsUY5901D1Bf63hmjVKFCtlX2h
         Ynd6MC90isehY1l5lldsvl91whz82NOBY6To5DnPk2rF45oBAhQRt5vW04JDnVHmBBC3
         JE/rgHCvUEELxxu/ioXheDp02SHx0MjAz3Kd8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723650840; x=1724255640;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=QG/M0V684VfpYQYWG1KSktx6rzyoliVsgiAOZUPbgck=;
        b=t2oql0rs2NWP7g17gotTKNzgykyBMU+I2fuS3HYO47MKUt5bhfrz6zJgPINT65BE/G
         7mL7waXeuNzFhnVf4r+5XFiEsPz0xlhssVbDSSyXElGghRQdl/tGDOIjyG8SOCWOixNk
         HdSC1ZCkmyEdLPrNXZ0E0DQjNEv5slBZYqgHlSNCFv6hHzUSskHNbFHrUZYtB3eGpumP
         OMAf7VFHmouc+GIQnKWbwWByOMekGiXEnT0Va/nWFFk7Ght42NnVMHucmWZh42XI3nK2
         S7C8wxK8s/tTXJQQJgbhMRq8EQ/D4o8y9jpFncQ/S1B4QEkUxF4oYJIVIYy/GTjmJn0v
         N74Q==
X-Gm-Message-State: AOJu0YyjYGkIf/ZUtP/f6enA2tBT1snfitDFywe8swMhEYSlt+EimWqt
	i/C2bdS3Tpf80a2PCxO71yv5xKHgOclOeJF15feocnX8jCWFVqv44HYWHlFvnHMUMuxSRMj2KiL
	X
X-Google-Smtp-Source: AGHT+IE7puL+/qymNHfKF/aQ9f3ZVfT4VU4D/MNvgjPHZCbelsZJz8yCegkmfxE2DxoJGNsay3Z7mA==
X-Received: by 2002:a05:620a:4152:b0:7a1:e271:ee37 with SMTP id af79cd13be357-7a4ee32ddb9mr387198785a.16.1723650839719;
        Wed, 14 Aug 2024 08:53:59 -0700 (PDT)
From: Matthew Barnes <matthew.barnes@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Matthew Barnes <matthew.barnes@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Alejandro Vallejo <alejandro.vallejo@cloud.com>
Subject: [PATCH] x86/cpufeatures: Add new cpuid features in SPR to featureset
Date: Wed, 14 Aug 2024 16:52:54 +0100
Message-Id: <09353a67d79b12f2ff2a9be797866902bcd71825.1723650205.git.matthew.barnes@cloud.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Bcc: Matthew Barnes <matthew.barnes@cloud.com>
Content-Transfer-Encoding: 8bit

Upon running `xen-cpuid -d` on a host machine with Sapphire Rapids
within Dom0, there exist unrecognised features.

This patch adds these features as macros to the CPU featureset,
disabled by default.

Signed-off-by: Matthew Barnes <matthew.barnes@cloud.com>
---
 xen/include/public/arch-x86/cpufeatureset.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h
index abab78fa86db..db633bd5c128 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -121,6 +121,7 @@ XEN_CPUFEATURE(SMX,           1*32+ 6) /*   Safer Mode Extensions */
 XEN_CPUFEATURE(EIST,          1*32+ 7) /*   Enhanced SpeedStep */
 XEN_CPUFEATURE(TM2,           1*32+ 8) /*   Thermal Monitor 2 */
 XEN_CPUFEATURE(SSSE3,         1*32+ 9) /*A  Supplemental Streaming SIMD Extensions-3 */
+XEN_CPUFEATURE(SDGB,          1*32+11) /*   Silicon Debugging */
 XEN_CPUFEATURE(FMA,           1*32+12) /*A  Fused Multiply Add */
 XEN_CPUFEATURE(CX16,          1*32+13) /*A  CMPXCHG16B */
 XEN_CPUFEATURE(XTPR,          1*32+14) /*   Send Task Priority Messages */
@@ -181,6 +182,7 @@ XEN_CPUFEATURE(XSAVEOPT,      4*32+ 0) /*A  XSAVEOPT instruction */
 XEN_CPUFEATURE(XSAVEC,        4*32+ 1) /*A  XSAVEC/XRSTORC instructions */
 XEN_CPUFEATURE(XGETBV1,       4*32+ 2) /*A  XGETBV with %ecx=1 */
 XEN_CPUFEATURE(XSAVES,        4*32+ 3) /*S  XSAVES/XRSTORS instructions */
+XEN_CPUFEATURE(XFD,           4*32+ 4) /*   Extended Feature Disable */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0.ebx, word 5 */
 XEN_CPUFEATURE(FSGSBASE,      5*32+ 0) /*A  {RD,WR}{FS,GS}BASE instructions */
@@ -221,6 +223,7 @@ XEN_CPUFEATURE(AVX512_VBMI,   6*32+ 1) /*A  AVX-512 Vector Byte Manipulation Ins
 XEN_CPUFEATURE(UMIP,          6*32+ 2) /*S  User Mode Instruction Prevention */
 XEN_CPUFEATURE(PKU,           6*32+ 3) /*H  Protection Keys for Userspace */
 XEN_CPUFEATURE(OSPKE,         6*32+ 4) /*!  OS Protection Keys Enable */
+XEN_CPUFEATURE(WAITPKG,       6*32+ 5) /*   User-level monitoring support */
 XEN_CPUFEATURE(AVX512_VBMI2,  6*32+ 6) /*A  Additional AVX-512 Vector Byte Manipulation Instrs */
 XEN_CPUFEATURE(CET_SS,        6*32+ 7) /*   CET - Shadow Stacks */
 XEN_CPUFEATURE(GFNI,          6*32+ 8) /*A  Galois Field Instrs */
@@ -228,13 +231,16 @@ XEN_CPUFEATURE(VAES,          6*32+ 9) /*A  Vector AES Instrs */
 XEN_CPUFEATURE(VPCLMULQDQ,    6*32+10) /*A  Vector Carry-less Multiplication Instrs */
 XEN_CPUFEATURE(AVX512_VNNI,   6*32+11) /*A  Vector Neural Network Instrs */
 XEN_CPUFEATURE(AVX512_BITALG, 6*32+12) /*A  Support for VPOPCNT[B,W] and VPSHUFBITQMB */
+XEN_CPUFEATURE(TME_EN,        6*32+13) /*   TME MSR support */
 XEN_CPUFEATURE(AVX512_VPOPCNTDQ, 6*32+14) /*A  POPCNT for vectors of DW/QW */
+XEN_CPUFEATURE(LA57,          6*32+16) /*   57-bit linear addressing and five-level paging */
 XEN_CPUFEATURE(RDPID,         6*32+22) /*A  RDPID instruction */
 XEN_CPUFEATURE(BLD,           6*32+24) /*   BusLock Detect (#DB trap) support */
 XEN_CPUFEATURE(CLDEMOTE,      6*32+25) /*A  CLDEMOTE instruction */
 XEN_CPUFEATURE(MOVDIRI,       6*32+27) /*a  MOVDIRI instruction */
 XEN_CPUFEATURE(MOVDIR64B,     6*32+28) /*a  MOVDIR64B instruction */
 XEN_CPUFEATURE(ENQCMD,        6*32+29) /*   ENQCMD{,S} instructions */
+XEN_CPUFEATURE(SGX_LC,        6*32+30) /*   SGX Launch Configuration */
 XEN_CPUFEATURE(PKS,           6*32+31) /*H  Protection Key for Supervisor */
 
 /* AMD-defined CPU features, CPUID level 0x80000007.edx, word 7 */
@@ -264,6 +270,7 @@ XEN_CPUFEATURE(BTC_NO,        8*32+29) /*A  Hardware not vulnerable to Branch Ty
 XEN_CPUFEATURE(IBPB_RET,      8*32+30) /*A  IBPB clears RSB/RAS too. */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0.edx, word 9 */
+XEN_CPUFEATURE(SGX_KEYS,      9*32+ 1) /*   Attestation Services for Intel SGX */
 XEN_CPUFEATURE(AVX512_4VNNIW, 9*32+ 2) /*   Xeon Phi AVX512 Neural Network Instructions */
 XEN_CPUFEATURE(AVX512_4FMAPS, 9*32+ 3) /*   Xeon Phi AVX512 Multiply Accumulation Single Precision */
 XEN_CPUFEATURE(FSRM,          9*32+ 4) /*A  Fast Short REP MOVS */
@@ -276,10 +283,13 @@ XEN_CPUFEATURE(TSX_FORCE_ABORT, 9*32+13) /* MSR_TSX_FORCE_ABORT.RTM_ABORT */
 XEN_CPUFEATURE(SERIALIZE,     9*32+14) /*A  SERIALIZE insn */
 XEN_CPUFEATURE(HYBRID,        9*32+15) /*   Heterogeneous platform */
 XEN_CPUFEATURE(TSXLDTRK,      9*32+16) /*a  TSX load tracking suspend/resume insns */
+XEN_CPUFEATURE(PCONFIG,       9*32+18) /*   Platform configuration support */
 XEN_CPUFEATURE(ARCH_LBR,      9*32+19) /*   Architectural Last Branch Record */
 XEN_CPUFEATURE(CET_IBT,       9*32+20) /*   CET - Indirect Branch Tracking */
+XEN_CPUFEATURE(AMX_BF16,      9*32+22) /*   Tile computational operations on bfloat16 numbers */
 XEN_CPUFEATURE(AVX512_FP16,   9*32+23) /*A  AVX512 FP16 instructions */
 XEN_CPUFEATURE(AMX_TILE,      9*32+24) /*   AMX Tile architecture */
+XEN_CPUFEATURE(AMX_INT8,      9*32+25) /*   Tile computational operations on 8-bit integers */
 XEN_CPUFEATURE(IBRSB,         9*32+26) /*A  IBRS and IBPB support (used by Intel) */
 XEN_CPUFEATURE(STIBP,         9*32+27) /*A  STIBP */
 XEN_CPUFEATURE(L1D_FLUSH,     9*32+28) /*S  MSR_FLUSH_CMD and L1D flush. */
@@ -363,6 +373,8 @@ XEN_CPUFEATURE(GDS_CTRL,           16*32+25) /*   MCU_OPT_CTRL.GDS_MIT_{DIS,LOCK
 XEN_CPUFEATURE(GDS_NO,             16*32+26) /*A  No Gather Data Sampling */
 XEN_CPUFEATURE(RFDS_NO,            16*32+27) /*A  No Register File Data Sampling */
 XEN_CPUFEATURE(RFDS_CLEAR,         16*32+28) /*!A| Register File(s) cleared by VERW */
+XEN_CPUFEATURE(IGN_UMONITOR_SUPPORT, 16*32+29) /*  UMONITOR Ignore support */
+XEN_CPUFEATURE(MON_UMON_MITG_SUPPORT, 16*32+30) /*  (U)MONITOR Mitigation support */
 
 /* Intel-defined CPU features, MSR_ARCH_CAPS 0x10a.edx, word 17 */
 
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 15:58:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 15:58:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777516.1187650 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seGOO-0002aH-Lg; Wed, 14 Aug 2024 15:58:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777516.1187650; Wed, 14 Aug 2024 15:58:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seGOO-0002aA-Hi; Wed, 14 Aug 2024 15:58:32 +0000
Received: by outflank-mailman (input) for mailman id 777516;
 Wed, 14 Aug 2024 15:58:32 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NhoJ=PN=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seGOO-0002a4-0M
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 15:58:32 +0000
Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com
 [2a00:1450:4864:20::531])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0c97dd7a-5a56-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 17:58:29 +0200 (CEST)
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5a1337cfbb5so106194a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 08:58:29 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f4184ec9sm187785466b.219.2024.08.14.08.58.28
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 08:58:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0c97dd7a-5a56-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723651109; x=1724255909; 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=HgLhLx0ki4Prcn8cg+ZnAMezOZadSVby5sGVEOp17Qo=;
        b=eBTfqJa9TOwLTjLOv92wcx8yApM6C+g6fP45+aERmtc/9glrLJesz40ljWNdUkcnXb
         frYwjOtXo70P+zrGfZK5xsuSKJnPlYVxNoFA8qKkqwNrYo9Q6urwWPhrCY8I8v+nFQdp
         4vCW9HtXB0T8BvJr2HKw7wjWKDliF+9M0yb876eV2Zesnem92sGQl1gs7dhi79T2AWxh
         AzmgrLjOnzl3gifX4SdPmTCVcaf4jmjc82IgxsPFJVktlVUO6xOrVJi7qpQ1P27yAXbn
         scVv/1ft1fhi3Az6K35Xd3Ca9ZSJkRVsgd9rnJinCfC1ss8PrKwzeUXrPfqNEXxnraRN
         pX6Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723651109; x=1724255909;
        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=HgLhLx0ki4Prcn8cg+ZnAMezOZadSVby5sGVEOp17Qo=;
        b=HLMd9cX7j2Mdn1tGHCco4HfjRqpgbfyldag4jIS7hI4Hy7hVate1Uk8xJUJlEyOhBl
         +NrohxcoiYrEL02yCx8gzgP06DPL3Vr1RYzeEE+of0axBhw9zJ4XqHGq6D8dP3opHre7
         Cb5P7bkXTg7MZ8BjSV2Dd+SasGYT8dBk2xFyMawimvy41NAnZiQp0PRQBhXLXfgI8NUu
         PPVSJbEQg7aJ6HqaoI7fOBHr2H3A3ZUdyYDb3WQiE+iQEWUNMYpLLLZgHW+rL8dig8i5
         js7TEUgO9KdPwQlOnNhJ0AwoA8oOftazKBDqHAg0YIeE/38tn+uu7lBgH26Cl9oepDeB
         d2Vw==
X-Forwarded-Encrypted: i=1; AJvYcCWoe7ZVyP9D0zNivvSp2UmhfCK1KG0cFBIEYmQHpLfohF9m8lndhYlYo01ezm25E9lOuOC7x1KLbtlWjvAX9Cm0bXEsjVbKlwxPIok70Mc=
X-Gm-Message-State: AOJu0Yz0QDKeDBDUu42LnZPzpxV5ALwtksMqNuBj4GkIy0BZTykkMGs6
	wEAbvSTpindwkF1+bGcYanjxpegoj3OmHQdsaJAG8WP0wjc3P41nGonQMPT0lg==
X-Google-Smtp-Source: AGHT+IGyHXwPNydQfyoM/ym/picSbK18+Z+SyvrNMQRDIxoROY7xifgr8jmHnB/YSfjJgduV0coZxw==
X-Received: by 2002:a17:906:dc93:b0:a80:d683:4d23 with SMTP id a640c23a62f3a-a8367070e5cmr224765866b.62.1723651109093;
        Wed, 14 Aug 2024 08:58:29 -0700 (PDT)
Message-ID: <d2a71d20-d3c5-45cc-9e3e-10a0773508a0@suse.com>
Date: Wed, 14 Aug 2024 17:58:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/cpufeatures: Add new cpuid features in SPR to
 featureset
To: Matthew Barnes <matthew.barnes@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 xen-devel@lists.xenproject.org
References: <09353a67d79b12f2ff2a9be797866902bcd71825.1723650205.git.matthew.barnes@cloud.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: <09353a67d79b12f2ff2a9be797866902bcd71825.1723650205.git.matthew.barnes@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 14.08.2024 17:52, Matthew Barnes wrote:
> Upon running `xen-cpuid -d` on a host machine with Sapphire Rapids
> within Dom0, there exist unrecognised features.

Without looking at the particular bits yet, just a question up front:
Why SPR? There's newer hardware available with presumably yet more newly
used bits. If the goal is to cover everything that's known, this is only
one step in the right direction. Which would be okay if expressed that
way, ideally with a plan to subsequently go further.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 16:28:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 16:28:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777544.1187660 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seGrT-0001DO-Rh; Wed, 14 Aug 2024 16:28:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777544.1187660; Wed, 14 Aug 2024 16:28:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seGrT-0001DH-Nt; Wed, 14 Aug 2024 16:28:35 +0000
Received: by outflank-mailman (input) for mailman id 777544;
 Wed, 14 Aug 2024 16:28:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seGrS-0001D7-72; Wed, 14 Aug 2024 16:28:34 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seGrS-0004tr-1Z; Wed, 14 Aug 2024 16:28:34 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seGrR-0002JI-IY; Wed, 14 Aug 2024 16:28:33 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1seGrR-0000u7-Hl; Wed, 14 Aug 2024 16:28:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=uBr4UkeofcImp8yOofrtqsl9hcid+7+DVUpFEXL8Yd8=; b=BcXsR9Jtn0NM/E3NqKVNfO5Usg
	ys4IRy4cy3+bsnaRPYQXC/WbL9+CHw/Z2q+hMxbA9ngT8jA6E6nRyIZC8RvMI+W2TPnPMfJTTsXnm
	dJUGH6ODIZlqOy95aGDO/drW8ulVyzJKHwwpl+LVjwdNsSt0ELWQsmM1YJV+QY/Nnim4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187231-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.19-testing test] 187231: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.19-testing:test-armhf-armhf-xl-credit2:xen-boot:fail:heisenbug
    xen-4.19-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=3e8a2217f211d49dd771f7918d72df057121109f
X-Osstest-Versions-That:
    xen=033060ee6e05f9e86ef1a51674864b55dc15e62c
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 14 Aug 2024 16:28:33 +0000

flight 187231 xen-4.19-testing real [real]
flight 187245 xen-4.19-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187231/
http://logs.test-lab.xenproject.org/osstest/logs/187245/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-credit2   8 xen-boot            fail pass in 187245-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-credit2 15 migrate-support-check fail in 187245 never pass
 test-armhf-armhf-xl-credit2 16 saverestore-support-check fail in 187245 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187193
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187193
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187193
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187193
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187193
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187193
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  3e8a2217f211d49dd771f7918d72df057121109f
baseline version:
 xen                  033060ee6e05f9e86ef1a51674864b55dc15e62c

Last test of basis   187193  2024-08-08 12:10:23 Z    6 days
Testing same since   187231  2024-08-13 15:07:12 Z    1 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>
  Teddy Astie <teddy.astie@vates.tech>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   033060ee6e..3e8a2217f2  3e8a2217f211d49dd771f7918d72df057121109f -> stable-4.19


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 16:47:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 16:47:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777566.1187677 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seH95-0005Rx-GI; Wed, 14 Aug 2024 16:46:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777566.1187677; Wed, 14 Aug 2024 16:46:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seH95-0005Rp-Dh; Wed, 14 Aug 2024 16:46:47 +0000
Received: by outflank-mailman (input) for mailman id 777566;
 Wed, 14 Aug 2024 16:46:45 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=2uER=PN=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1seH93-0005QO-NM
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 16:46:45 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c97a2514-5a5c-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 18:46:43 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5a79df5af51so1929658a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 09:46:43 -0700 (PDT)
Received: from [192.168.1.10] (host-92-26-98-202.as13285.net. [92.26.98.202])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f3f48e67sm192662866b.40.2024.08.14.09.46.42
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 09:46:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c97a2514-5a5c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723654003; x=1724258803; 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=YtFreksT9WIQZ/GkQ4jaJFT6y2/YGzTl84/ksGEKBOM=;
        b=scMI7uKpAgpiciRsZsfe54cbAnnBRIHr27tnzLnEKhtAoLLqjsvBkW55Gta34ISR61
         Q5S8//PYyXPjthggGUeZkbI/cORoj9pUro2HODEoJIO2RATkzc3wlOViGELwMbPL9dJD
         IkaqQt4U36QlLGNMezJZh91WRRxiSjAtju6wM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723654003; x=1724258803;
        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=YtFreksT9WIQZ/GkQ4jaJFT6y2/YGzTl84/ksGEKBOM=;
        b=YM7g9h7CimbPV7puxrYwOejijW0kHEnOtJe6ut1CyJWs14UA4X96ngcw3ulwo2TJTZ
         n6fkOlrfCaf3jIYF4uDyV6rFeuQlFB5uAEd/Yz0BsWRVEF5bZmP6nhmccghSASXTChnn
         3IRLS7L+aoUlHnH041NOJ6X5z/v+dswqNfzu0ipGEKg84zdZTf71y0qrexVGRpsr6wS5
         fEjf02MXJtvby/tEkClLt5WCYb7DDqD2+yHrMpcAzIxc5R34iqUYBrAyNGSzldpG2Lkg
         9UhSfzZYoYE5znuizZkfz+YspWBvL5uo6X/drV3bPtmq4FiYWTCIcTYZ5pel1JUR5uMs
         rZHw==
X-Forwarded-Encrypted: i=1; AJvYcCX0mWm0nud5dVVjHEliSb1vWPDLJUKhBMFIRk5T2MHG/4Fa4sExsn4DUEdHGUpbCInEP3NOIk6o+1VSKOLc6TjBlyIox/c50VcJjg0dBi0=
X-Gm-Message-State: AOJu0YwIWrn3Lv5ibwqWebRpPqfrXqqIedUNQI2Gxyhn5Xu4dy/obghW
	5Ed2TIaj30tw+0wBmt6caayzxMRDaDnmNGdAR8mAvR2Vf2PZoy4Kv3lWx/uaAus=
X-Google-Smtp-Source: AGHT+IEj0Z261BtvEkCqYgfyUsutbo12UlZOoEp6gR67kYs6p1EVuRmZJ44N+XwL+MlIMF4fI3gm7A==
X-Received: by 2002:a17:906:db08:b0:a77:ab9e:9202 with SMTP id a640c23a62f3a-a837cbccdcfmr22165866b.4.1723654003023;
        Wed, 14 Aug 2024 09:46:43 -0700 (PDT)
Message-ID: <9dec870a-5bdc-4539-afe9-228afb40249a@citrix.com>
Date: Wed, 14 Aug 2024 17:46:42 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/cpufeatures: Add new cpuid features in SPR to
 featureset
To: Jan Beulich <jbeulich@suse.com>, Matthew Barnes <matthew.barnes@cloud.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 xen-devel@lists.xenproject.org
References: <09353a67d79b12f2ff2a9be797866902bcd71825.1723650205.git.matthew.barnes@cloud.com>
 <d2a71d20-d3c5-45cc-9e3e-10a0773508a0@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <d2a71d20-d3c5-45cc-9e3e-10a0773508a0@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 14/08/2024 4:58 pm, Jan Beulich wrote:
> On 14.08.2024 17:52, Matthew Barnes wrote:
>> Upon running `xen-cpuid -d` on a host machine with Sapphire Rapids
>> within Dom0, there exist unrecognised features.
> Without looking at the particular bits yet, just a question up front:
> Why SPR?

Because it's what we have easily to hand right now.

I veto'd doing this based on pre-release hardware, because they often
contain NDA content which we shouldn't be publishing, or at least
"publishing yet".

We should be getting production EMR soon.

>  There's newer hardware available with presumably yet more newly
> used bits. If the goal is to cover everything that's known, this is only
> one step in the right direction.

Correct, but it is *a* step, and that's fine.

We anticipate doing patches like this for every new generation, as part
of our own checks to support the CPU.  Right now there's a bit of a backlog.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 16:50:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 16:50:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777572.1187688 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seHCe-0006vK-VA; Wed, 14 Aug 2024 16:50:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777572.1187688; Wed, 14 Aug 2024 16:50:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seHCe-0006vD-SD; Wed, 14 Aug 2024 16:50:28 +0000
Received: by outflank-mailman (input) for mailman id 777572;
 Wed, 14 Aug 2024 16:50:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0xrl=PN=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1seHCc-0006v7-TT
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 16:50:27 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4d9cbf07-5a5d-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 18:50:25 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2ef2fccca2cso1142211fa.1
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 09:50:25 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f29203d91fsm14650071fa.75.2024.08.14.09.50.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 14 Aug 2024 09:50:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4d9cbf07-5a5d-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723654225; x=1724259025; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=jQR72WMZPvn20RiqCGzoSu3A2DlQLWElPxEI3Ve7zSM=;
        b=LfE+gT9aL5Y2ghfYUGre3RpxBlqd31i53ye0V+V2tZclirTXBmtNNI6ZImxzZRs/eW
         SbrbfTWCwLh0iISSwSXwjNCQhywuUF+hlaDWFYUxsIlSftb3o44zmRrkztbXbpV7jSZV
         UJXRR3L3xuEEkGPwQYQGM5xZ+gQAVa991MWV141fgMh0F1Exvo2GT5/Z+3zjyR0KMlPg
         fLgdWRdRibLkUwNCKgXvMJidjN1LmlZGztJIO3Nxlv+gBSgFqY/mleGbxEEiVz+FlEdR
         VCW2ZhuS1L10WsKRhxOrjNVJ53hPfRC+3dxhLeyLJ2ac9IBr1w7DE0fUgyIxeMYYYDiP
         otRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723654225; x=1724259025;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=jQR72WMZPvn20RiqCGzoSu3A2DlQLWElPxEI3Ve7zSM=;
        b=wvryluJfIBIKZfZ1ym9m1gbX7DmzOUqqvESAn3xi9vyEY1nZEOpkRvK0plW/Y4gD2c
         GZ5rzvMF64yVFk5TMEC62lRnsgH0MFnDAXxhs7pB3E3l0IuQRPSKx4bSoFsO7AR9XTJG
         pVYE5cXloT6DWp1LiTN9bnr6B4OQgZnnMrnHI1WjZRhiqsUxtzhzmAELW6mg+KM64aFE
         lpH342D/TlOvGm3fcd4vAlkwCE985ScdO7k+aTVfLC01jvqo0gjIdq+Qkkkf+dDFiKTb
         OF5QmVAE8tvA6acnEVlmQiO7YWg3mEMZ1pSH5FH3lLw74ne2wIaPn9dOgBxgNw3CbwnV
         Dn4g==
X-Forwarded-Encrypted: i=1; AJvYcCVFSn3tHtelC+SuHVj9nJqOyKaAinHsD1ksQKphbL+eUKAU2irkCXhMMiTjSvw4OWtyIn8w92vlfeJ13ueY/8/AV0W8Sh0vL0sXVSFqArQ=
X-Gm-Message-State: AOJu0Yz87sDlDPAFMhmiGcKDYE8ywN0x1FR1fxY3q+ibbwWRF4li83KC
	f9OrqCm8Q/1zpIG22sQ5FXvNj1p/JipLGw8cEaMBczAZrQkc0TLo
X-Google-Smtp-Source: AGHT+IFm61ScQ+Adr0dVrYHsWiPYY+PIrpuTvFYD68saHs/LyT8qrinP9SvF42T0hmnbpR7TGc3Zvg==
X-Received: by 2002:a05:651c:19ac:b0:2ef:1db2:c02a with SMTP id 38308e7fff4ca-2f3aa1a5766mr24921641fa.6.1723654224155;
        Wed, 14 Aug 2024 09:50:24 -0700 (PDT)
Message-ID: <1e83981cff0b6c47aa941e7ffee0ce658aefef22.camel@gmail.com>
Subject: Re: [PATCH v4 6/7] xen/riscv: page table handling
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Wed, 14 Aug 2024 18:50:22 +0200
In-Reply-To: <85a4e760-07af-42bd-ac27-12a4fa5172cc@suse.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
	 <8362795280a48702bef6f01d41d148edcf299935.1723214540.git.oleksii.kurochko@gmail.com>
	 <85a4e760-07af-42bd-ac27-12a4fa5172cc@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Tue, 2024-08-13 at 12:31 +0200, Jan Beulich wrote:
> On 09.08.2024 18:19, Oleksii Kurochko wrote:
> > Implement map_pages_to_xen() which requires several
> > functions to manage page tables and entries:
> > - pt_update()
> > - pt_mapping_level()
> > - pt_update_entry()
> > - pt_next_level()
> > - pt_check_entry()
> >=20
> > To support these operations, add functions for creating,
> > mapping, and unmapping Xen tables:
> > - create_xen_table()
> > - xen_map_table()
> > - xen_unmap_table()
>=20
> I think I commented on this before: Everything is "Xen" in hypervisor
> code. What I think you mean is to map/unmap Xen's own page tables.
> Naming-wise that would be {,un}map_xen_table(), though. Since they
> are static, just {,un}map_table() ought to be unambiguous, too.
I thought that your comment was about pt_*() functions but thanks for
explanation again.

>=20
> > Introduce internal macros starting with PTE_* for convenience.
> > These macros closely resemble PTE bits, with the exception of
> > PTE_BLOCK, which indicates that a page larger than 4KB is
> > needed.
>=20
> I did comment on this too, iirc: Is there going to be any case where
> large pages are going to be "needed", i.e. not just preferred? If
> not,
> giving the caller control over things the other way around
> (requesting
> 4k mappings are needed, as we have it in x86) may be preferable.
Yes, you did the comment but I thought that it will be enough to
mention that shattering isn't supported now and  also since
pt_update_entry()is used to unmap as well, there could be a need to
unmap e.g. 4K page from 2M block mapping what will a little bit harder
then just having 4k by default.

>=20
> Hmm, but then ...
>=20
> > RISC-V detects superpages using `pte.x` and `pte.r`, as there
> > is no specific bit in the PTE for this purpose. From the RISC-V
> > spec:
> > ```
> > =C2=A0 ...
> > =C2=A0 4. Otherwise, the PTE is valid. If pte.r =3D 1 or pte.x =3D 1, g=
o to
> > step 5.
> > =C2=A0=C2=A0=C2=A0=C2=A0 Otherwise, this PTE is a pointer to the next l=
evel of the page
> > table.
> > =C2=A0=C2=A0=C2=A0=C2=A0 ... .
> > =C2=A0 5. A leaf PTE has been found.
> > =C2=A0=C2=A0=C2=A0=C2=A0 ...
> > =C2=A0 ...
> > ```
> >=20
> > The code doesn=E2=80=99t support super page shattering so 4KB pages are
> > used as
> > default.
>=20
> ... you have this. Yet still callers expecting re-mapping in the
> (large)
> range they map can request small-page mappings right away.
I am not sure that I fully understand what do you mean by "expcting re-
mapping".

>=20
> > --- a/xen/arch/riscv/include/asm/flushtlb.h
> > +++ b/xen/arch/riscv/include/asm/flushtlb.h
> > @@ -5,12 +5,25 @@
> > =C2=A0#include <xen/bug.h>
> > =C2=A0#include <xen/cpumask.h>
> > =C2=A0
> > +#include <asm/sbi.h>
> > +
> > =C2=A0/* Flush TLB of local processor for address va. */
> > =C2=A0static inline void flush_tlb_one_local(vaddr_t va)
> > =C2=A0{
> > =C2=A0=C2=A0=C2=A0=C2=A0 asm volatile ( "sfence.vma %0" :: "r" (va) : "=
memory" );
> > =C2=A0}
> > =C2=A0
> > +/*
> > + * Flush a range of VA's hypervisor mappings from the TLB of all
> > + * processors in the inner-shareable domain.
> > + */
> > +static inline void flush_tlb_range_va(vaddr_t va,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 size_t size)
>=20
> No need for line wrapping here?
What is line wrapping here? Do you mean that size_t size should be on
the previous line?

>=20
> > @@ -33,15 +38,72 @@
> > =C2=A0#define PTE_LEAF_DEFAULT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0 (PTE_VALID | PTE_READABLE |
> > PTE_WRITABLE)
> > =C2=A0#define PTE_TABLE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (PTE_VALID)
> > =C2=A0
> > +#define PAGE_HYPERVISOR_RO=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 (PTE_VALID | PTE_READABLE)
> > =C2=A0#define PAGE_HYPERVISOR_RW=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 (PTE_VALID | PTE_READABLE |
> > PTE_WRITABLE)
> > +#define PAGE_HYPERVISOR_RX=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 (PTE_VALID | PTE_READABLE |
> > PTE_EXECUTABLE)
> > =C2=A0
> > =C2=A0#define PAGE_HYPERVISOR=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PAGE_HYPERVISOR_RW
> > =C2=A0
> > +
> > +/*
>=20
> Nit: As before, no double blank lines please.
>=20
> > + * There are no such bits in PTE format for RISC-V.
>=20
> This is an odd way to start a comment: There's nothing for "such" to
> refer
> to.
>=20
> > + * The code doesn=E2=80=99t support super page shattering so at the mo=
ment
> > superpages
> > + * can't be used as a default so PTE_BLOCK is introduced to have
> > ability to
> > + * tell that superpage should be allocated.
> > + * Additionaly as mentioed in RISC-V priviliged spec:
> > + * ```
> > + *=C2=A0 After much deliberation, we have settled on a conventional
> > page size of
> > + *=C2=A0 4 KiB for both RV32 and RV64. We expect this decision to ease
> > the porting
> > + *=C2=A0 of low-level runtime software and device drivers.
> > + *
> > + *=C2=A0 The TLB reach problem is ameliorated by transparent superpage
> > support in
> > + *=C2=A0 modern operating systems [2]. Additionally, multi-level TLB
> > hierarchies
> > + *=C2=A0 are quite inexpensive relative to the multi-level cache
> > hierarchies whose
> > + *=C2=A0 address space they map.
> > + *
> > + *=C2=A0 [2] Juan Navarro, Sitaram Iyer, Peter Druschel, and Alan Cox.
> > Practical,
> > + *=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 transparent operating system support =
for superpages.
> > + *=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SIGOPS Oper. Syst. Rev., 36(SI):89=E2=
=80=93104, December 2002.
> > + * ```
> > + *
> > + * PTE_POPULATE is introduced to have ability to tell that page
> > tables
> > + * shoud be populated.
> > + */
> > +#define PTE_BLOCK=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BIT(10, UL)
> > +#define PTE_POPULATE=C2=A0=C2=A0=C2=A0 BIT(11, UL)
> > +
> > +#define PTE_R_MASK(x)=C2=A0=C2=A0 ((x) & PTE_READABLE)
> > +#define PTE_W_MASK(x)=C2=A0=C2=A0 ((x) & PTE_WRITABLE)
> > +#define PTE_X_MASK(x)=C2=A0=C2=A0 ((x) & PTE_EXECUTABLE)
> > +
> > +#define PTE_RWX_MASK(x) ((x) & (PTE_READABLE | PTE_WRITABLE |
> > PTE_EXECUTABLE))
> > +
> > =C2=A0/* Calculate the offsets into the pagetables for a given VA */
> > =C2=A0#define pt_linear_offset(lvl, va)=C2=A0=C2=A0 ((va) >>
> > XEN_PT_LEVEL_SHIFT(lvl))
> > =C2=A0
> > =C2=A0#define pt_index(lvl, va) (pt_linear_offset((lvl), (va)) &
> > VPN_MASK)
> > =C2=A0
> > +#define TABLE_OFFSET(offs) (_AT(unsigned int, offs) & ((_AC(1, U)
> > << PAGETABLE_ORDER) - 1))
>=20
> Not: Too long line.
>=20
> > +#if RV_STAGE1_MODE > SATP_MODE_SV48
>=20
> SV48? Isn't ...
>=20
> > +#error "need to to update DECLARE_OFFSETS macros"
> > +#else
> > +
> > +#define l0_table_offset(va) TABLE_OFFSET(pt_linear_offset(0, va))
> > +#define l1_table_offset(va) TABLE_OFFSET(pt_linear_offset(1, va))
> > +#define l2_table_offset(va) TABLE_OFFSET(pt_linear_offset(2, va))
> > +
> > +/* Generate an array @var containing the offset for each level
> > from @addr */
> > +#define DECLARE_OFFSETS(var, addr)=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 \
> > +=C2=A0=C2=A0=C2=A0 const unsigned int var[] =3D {=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 \
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 l0_table_offset(addr),=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 \
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 l1_table_offset(addr),=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 \
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 l2_table_offset(addr),=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 \
> > +=C2=A0=C2=A0=C2=A0 }
>=20
> ... this for SV39?
Agree, the check above isn't correct. It should be "RV_STAGE1_MODE >
SATP_MODE_SV39".


>=20
> > --- /dev/null
> > +++ b/xen/arch/riscv/pt.c
> > @@ -0,0 +1,408 @@
> > +#include <xen/bug.h>
> > +#include <xen/domain_page.h>
> > +#include <xen/errno.h>
> > +#include <xen/mm.h>
> > +#include <xen/mm-frame.h>
> > +#include <xen/pmap.h>
> > +#include <xen/spinlock.h>
> > +
> > +#include <asm/flushtlb.h>
> > +#include <asm/page.h>
> > +
> > +static inline const mfn_t get_root_page(void)
> > +{
> > +=C2=A0=C2=A0=C2=A0 unsigned long root_maddr =3D
>=20
> maddr_t or paddr_t?
>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (csr_read(CSR_SATP) & SATP_=
PPN_MASK) << PAGE_SHIFT;
> > +
> > +=C2=A0=C2=A0=C2=A0 return maddr_to_mfn(root_maddr);
> > +}
> > +
> > +/*
> > + * Sanity check of the entry
> > + * mfn is not valid and we are not populating page table. This
> > means
>=20
> How does this fit with ...
>=20
> > + * we either modify entry or remove an entry.
> > + */
> > +static bool pt_check_entry(pte_t entry, mfn_t mfn, unsigned int
> > flags)
> > +{
> > +=C2=A0=C2=A0=C2=A0 /* Sanity check when modifying an entry. */
> > +=C2=A0=C2=A0=C2=A0 if ( (flags & PTE_VALID) && mfn_eq(mfn, INVALID_MFN=
) )
>=20
> ... the MFN check here?
The comment is incorrect and should be corrected:
" if mfn is valid or ... "

>  And why is (valid,INVALID_MFN) an indication
> of a modification? But then ...
the explanation is in the comment to pt_update():
   /*
    * If `mfn` equals `INVALID_MFN`, it indicates that the following page
   table
    * update operation might be related to either populating the table,
    * destroying a mapping, or modifying an existing mapping.
    */
   static int pt_update(unsigned long virt,

>=20
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* We don't allow modifying=
 an invalid entry. */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( !pte_is_valid(entry) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pri=
ntk("Modifying invalid entry is not allowed.\n");
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret=
urn false;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
>=20
> ... I also don't understand what this is about. IOW I'm afraid I'm
> still confused about the purpose of this function as well as the
> transitions you want to permit / reject. I wonder whether the
> flags & PTE_VALID and pte_is_valid(entry) aren't in need of swapping.
>=20
> > +/* Update an entry at the level @target. */
> > +static int pt_update_entry(mfn_t root, unsigned long virt,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 mfn_t mfn, unsigned int target,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 unsigned int flags)
> > +{
> > +=C2=A0=C2=A0=C2=A0 int rc;
> > +=C2=A0=C2=A0=C2=A0 unsigned int level =3D HYP_PT_ROOT_LEVEL;
> > +=C2=A0=C2=A0=C2=A0 pte_t *table;
> > +=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * The intermediate page tables are read-only =
when the MFN is
> > not valid
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * and we are not populating page table.
>=20
> The way flags are handled in PTEs, how can page tables be read-only?
I started to be confused. Probably I have to re-write some code and
also drop almost the whole function xen_pt_check_entry().

>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * This means we either modify permissions or =
remove an entry.
>=20
> From all I can determine we also get here when making brand new
> entries.
> What am I overlooking?
Nothing. then it means intermidiate page table won't be read-only.

>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0 bool alloc_only =3D mfn_eq(mfn, INVALID_MFN) && !(f=
lags &
> > PTE_POPULATE);
> > +=C2=A0=C2=A0=C2=A0 pte_t pte, *entry;
> > +
> > +=C2=A0=C2=A0=C2=A0 /* convenience aliases */
> > +=C2=A0=C2=A0=C2=A0 DECLARE_OFFSETS(offsets, virt);
> > +
> > +=C2=A0=C2=A0=C2=A0 table =3D xen_map_table(root);
> > +=C2=A0=C2=A0=C2=A0 for ( ; level > target; level-- )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rc =3D pt_next_level(alloc_=
only, &table, offsets[level]);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( rc =3D=3D XEN_TABLE_MA=
P_FAILED )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rc =
=3D 0;
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 * We are here because pt_next_level has failed to map
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 * the intermediate page table (e.g the table does not
> > exist
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 * and the pt is read-only). It is a valid case when
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 * removing a mapping as it may not exist in the page
> > table.
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 * In this case, just ignore it.
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if =
( flags & PTE_VALID )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 printk("%s: Unable to map level %u\n", __func__,
> > level);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 rc =3D -ENOENT;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 got=
o out;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else if ( rc !=3D XEN_TABLE=
_NORMAL )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bre=
ak;
> > +=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0 if ( level !=3D target )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printk("%s: Shattering supe=
rpage is not supported\n",
> > __func__);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rc =3D -EOPNOTSUPP;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto out;
> > +=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0 entry =3D table + offsets[level];
> > +
> > +=C2=A0=C2=A0=C2=A0 rc =3D -EINVAL;
> > +=C2=A0=C2=A0=C2=A0 if ( !pt_check_entry(*entry, mfn, flags) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto out;
> > +
> > +=C2=A0=C2=A0=C2=A0 /* We are removing the page */
> > +=C2=A0=C2=A0=C2=A0 if ( !(flags & PTE_VALID) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 memset(&pte, 0x00, sizeof(p=
te));
> > +=C2=A0=C2=A0=C2=A0 else
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* We are inserting a mappi=
ng =3D> Create new pte. */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( !mfn_eq(mfn, INVALID_M=
FN) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pte=
 =3D pte_from_mfn(mfn, PTE_VALID);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else /* We are updating the=
 permission =3D> Copy the current
> > pte. */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pte=
 =3D *entry;
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* update permission accord=
ing to the flags */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pte.pte |=3D PTE_RWX_MASK(f=
lags) | PTE_ACCESSED | PTE_DIRTY;
> > +=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0 write_pte(entry, pte);
> > +
> > +=C2=A0=C2=A0=C2=A0 rc =3D 0;
> > +
> > + out:
> > +=C2=A0=C2=A0=C2=A0 xen_unmap_table(table);
> > +
> > +=C2=A0=C2=A0=C2=A0 return rc;
> > +}
> > +
> > +static DEFINE_SPINLOCK(xen_pt_lock);
>=20
> If you put this in the middle of the file (which is fine), I think it
> wants putting immediately ahead of the (first) function using it, not
> at some seemingly random place.
>=20
> > +/*
> > + * If `mfn` equals `INVALID_MFN`, it indicates that the following
> > page table
> > + * update operation might be related to either populating the
> > table,
> > + * destroying a mapping, or modifying an existing mapping.
> > + */
> > +static int pt_update(unsigned long virt,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mfn_t mfn,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long nr_mfns,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned int flags)
> > +{
> > +=C2=A0=C2=A0=C2=A0 int rc =3D 0;
> > +=C2=A0=C2=A0=C2=A0 unsigned long vfn =3D virt >> PAGE_SHIFT;
> > +=C2=A0=C2=A0=C2=A0 unsigned long left =3D nr_mfns;
> > +
> > +=C2=A0=C2=A0=C2=A0 const mfn_t root =3D get_root_page();
> > +
> > +=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * It is bad idea to have mapping both writeab=
le and
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * executable.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * When modifying/creating mapping (i.e PTE_VA=
LID is set),
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * prevent any update if this happen.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0 if ( (flags & PTE_VALID) && PTE_W_MASK(flags) &&
> > PTE_X_MASK(flags) )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printk("Mappings should not=
 be both Writeable and
> > Executable.\n");
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EINVAL;
> > +=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0 if ( !IS_ALIGNED(virt, PAGE_SIZE) )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printk("The virtual address=
 is not aligned to the page-
> > size.\n");
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EINVAL;
> > +=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0 spin_lock(&xen_pt_lock);
> > +
> > +=C2=A0=C2=A0=C2=A0 while ( left )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned int order, level;
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 level =3D pt_mapping_level(=
vfn, mfn, left, flags);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 order =3D XEN_PT_LEVEL_ORDE=
R(level);
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ASSERT(left >=3D BIT(order,=
 UL));
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rc =3D pt_update_entry(root=
, vfn << PAGE_SHIFT, mfn, level,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 flags);
>=20
> Indentation.
>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( rc )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bre=
ak;
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 vfn +=3D 1U << order;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( !mfn_eq(mfn, INVALID_M=
FN) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mfn=
 =3D mfn_add(mfn, 1U << order);
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 left -=3D (1U << order);
>=20
> To be on thje safe side, 1UL everywhere?
>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( rc )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bre=
ak;
>=20
> There was such a check already a few lines up from here.
>=20
> > +=C2=A0=C2=A0=C2=A0 }
> > +
> > +
> > +=C2=A0=C2=A0=C2=A0 /* ensure that PTEs are all updated before flushing=
 */
>=20
> Again: No double blank lines please.
>=20
> > +=C2=A0=C2=A0=C2=A0 RISCV_FENCE(rw, rw);
> > +
> > +=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * always flush TLB at the end of the function=
 as non-present
> > entries
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * can be put in the TLB
> > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0 flush_tlb_range_va(virt, PAGE_SIZE * nr_mfns);
>=20
> Coming back to "negative" TLB entries: Assuming RISC-V, just like
> other
> architectures, also permits intermediate page table entries to be
> cached,
> the affected VA range may be much larger than the original request,
> if
> intermediate page tables needed creating.
It could be an issue. Could we some how  to calculate the proper range
or the only option we have is to flush all.
   And for some reason it isn't an issue for Arm:
  =20
       /*
        * The TLBs flush can be safely skipped when a mapping is
   inserted
        * as we don't allow mapping replacement (see
   xen_pt_check_entry()).
        * Although we still need an ISB to ensure any DSB in
        * write_pte() will complete because the mapping may be used
   soon
        * after.
        *
        * For all the other cases, the TLBs will be flushed
   unconditionally
        * even if the mapping has failed. This is because we may have
        * partially modified the PT. This will prevent any unexpected
        * behavior afterwards.
        */
       if ( !((flags & _PAGE_PRESENT) && !mfn_eq(mfn, INVALID_MFN)) )
           flush_xen_tlb_range_va(virt, PAGE_SIZE * nr_mfns);
       else
           isb();
  =20

>=20
> > +=C2=A0=C2=A0=C2=A0 spin_unlock(&xen_pt_lock);
>=20
> Does this really need to come after fence and flush?
I think yes, as page table should be updated only by 1 CPU at the same
time. And before give ability to other CPU to update page table we have
to finish a work on current CPU.

>=20
> > +=C2=A0=C2=A0=C2=A0 return rc;
> > +}
> > +
> > +int map_pages_to_xen(unsigned long virt,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mfn_t mfn,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long nr_mfns,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned int flags)
> > +{
> > +=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * Ensure that we have a valid MFN before proc=
eeding.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 *
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * If the MFN is invalid, pt_update() might mi=
sinterpret the
> > operation,
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * treating it as either a population, a mappi=
ng destruction,
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * or a mapping modification.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0 ASSERT(!mfn_eq(mfn, INVALID_MFN));
>=20
> But flags with PTE_VALID not set are fine to come into here?
It is fine for pt_update() but I don't know if it is fine for
map_pages_to_xen(). I see that other architectures don't check that.

~ Oleksii

>=20
> > +=C2=A0=C2=A0=C2=A0 return pt_update(virt, mfn, nr_mfns, flags);
> > +}
>=20
> Jan



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 17:26:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 17:26:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777585.1187698 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seHlK-0004Sg-N3; Wed, 14 Aug 2024 17:26:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777585.1187698; Wed, 14 Aug 2024 17:26:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seHlK-0004SZ-KM; Wed, 14 Aug 2024 17:26:18 +0000
Received: by outflank-mailman (input) for mailman id 777585;
 Wed, 14 Aug 2024 17:26:17 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seHlJ-0004Qb-E9; Wed, 14 Aug 2024 17:26:17 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seHlJ-0005xZ-Cg; Wed, 14 Aug 2024 17:26:17 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seHlJ-0004gn-0m; Wed, 14 Aug 2024 17:26:17 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1seHlJ-000220-04; Wed, 14 Aug 2024 17:26:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=CfC3OvRWWj9Zr2OSpA1/Z0xaZFpfbOHhQ7jBfDtYA8M=; b=o1tNLD9BU9uYxS954hZUSCOCj6
	gnSU7dDgyR9VIN49wY+lhhrnhqHDoYLBAwmy27Wnb4FCCWHZO29M1J7hrbKQg5n5uiXF6Kc1169vm
	maczdyeWYakKNtSZubsmzfo2dNUd56UsB3sayY/ZKVEp/2S4iY20jEqdJFncjEFCGkl0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187243-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187243: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=cbe73b848286f1e6b855c0ba328d56e0014d19e6
X-Osstest-Versions-That:
    xen=a73f8d19445a70b72701a7a95b6c3e274168918a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 14 Aug 2024 17:26:17 +0000

flight 187243 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187243/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  cbe73b848286f1e6b855c0ba328d56e0014d19e6
baseline version:
 xen                  a73f8d19445a70b72701a7a95b6c3e274168918a

Last test of basis   187239  2024-08-14 09:04:04 Z    0 days
Testing same since   187243  2024-08-14 14:02:16 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Jan Beulich <jbeulich@suse.com>
  Michal Orzel <michal.orzel@amd.com>
  Roger Pau Monné <roger.pau@citrix.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   a73f8d1944..cbe73b8482  cbe73b848286f1e6b855c0ba328d56e0014d19e6 -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 17:41:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 17:41:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777598.1187708 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seHzv-00089s-W6; Wed, 14 Aug 2024 17:41:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777598.1187708; Wed, 14 Aug 2024 17:41:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seHzv-00089l-Rd; Wed, 14 Aug 2024 17:41:23 +0000
Received: by outflank-mailman (input) for mailman id 777598;
 Wed, 14 Aug 2024 17:41: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=2uER=PN=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1seHzu-00089e-Ol
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 17:41:22 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6a62fbb4-5a64-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 19:41:20 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a7a81bd549eso13351566b.3
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 10:41:20 -0700 (PDT)
Received: from [192.168.1.10] (host-92-26-98-202.as13285.net. [92.26.98.202])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a80f414e0e4sm196401866b.165.2024.08.14.10.41.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 10:41:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6a62fbb4-5a64-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723657279; x=1724262079; 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=HAxl4KeHMZmAhh8dL7a9JS0Cebxnd4F5pXcRV1lUPAI=;
        b=Acwh+kUejf+QTIbNvRSEbJlqRp4iHGpLKd/rWVcRSmzIDmmr3mU6EwmtS//BW3UcC1
         AvSNDzx/vCWdQ93z0GY/wN6DqcpsOdnPB0w+IoB211F+5KOw9avWUPX7ixumFY/dtDSm
         RMm7cblI9pInWXb6wYpAvjmJbsCwd9YyqHwcE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723657279; x=1724262079;
        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=HAxl4KeHMZmAhh8dL7a9JS0Cebxnd4F5pXcRV1lUPAI=;
        b=fGGtqBufeIz7fc+BYb44+Oe0YcVO2iSMAgIf3BXtHq+1kUzAqx43CIrrC87yq63IW6
         jaPSgxcaf70nEjxJj8rcK15kyHSZo0ED+Hv3J7jA4oYpWTP/EGpG9rkCYEj7HwDTEscx
         oTrRMH5XJ8oA7AuQQsXuSYNc/jKICVFUFT7wFCgF4pMP7JbQ5Yu+nzmZja0Oq3fw+s6Y
         fqrqDA4/wEKCkRvIQV0O+yvbEawoGQS9pmXoGvgrTOClMJGT3lbZVtAXjpNXB9xrS6KJ
         mCWP3wWAwjp5KgBXChDhP03ftd9FSX28VoojSm0Jx0WMAqddYEueok36SaqSZNXttkny
         +Agg==
X-Forwarded-Encrypted: i=1; AJvYcCXNH8/PJmotx84oWaAOrBhLkEHLNpKCBscn2Yn5k2VvPeLZFeXZXwW1ri/m92jr/F+vrulObDR6Gca5BPu0Y5Q8nrOPftb4E8reQmMzw7Q=
X-Gm-Message-State: AOJu0YzfOJgwcs5UKk0x6bBF7WLus10eCmn+IWXrCGKX/49ptAeIEpwb
	S8xpwcr2L0SmB1Ojzkl7bBZZdGMgSfaQC8ICbd8e5LBoSG+Gjq/vSj7RVnY0Buw=
X-Google-Smtp-Source: AGHT+IERX3Mj//Gw8DhjPQ7wvn76n+sKI/nG2jntPx8fYB9X8qr9pZWmljM4qBzoyVBYiRL4yKGfRA==
X-Received: by 2002:a17:907:d5a4:b0:a72:40b4:c845 with SMTP id a640c23a62f3a-a8367006615mr250999666b.51.1723657279361;
        Wed, 14 Aug 2024 10:41:19 -0700 (PDT)
Message-ID: <92e8407c-4f49-4393-bb58-07a8410b6ee0@citrix.com>
Date: Wed, 14 Aug 2024 18:41:17 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/cpufeatures: Add new cpuid features in SPR to
 featureset
To: Matthew Barnes <matthew.barnes@cloud.com>, xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Alejandro Vallejo <alejandro.vallejo@cloud.com>
References: <09353a67d79b12f2ff2a9be797866902bcd71825.1723650205.git.matthew.barnes@cloud.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <09353a67d79b12f2ff2a9be797866902bcd71825.1723650205.git.matthew.barnes@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 14/08/2024 4:52 pm, Matthew Barnes wrote:
> Upon running `xen-cpuid -d` on a host machine with Sapphire Rapids

I presume you mean -v ?

> within Dom0, there exist unrecognised features.
>
> This patch adds these features as macros to the CPU featureset,
> disabled by default.
>
> Signed-off-by: Matthew Barnes <matthew.barnes@cloud.com>
> ---
>  xen/include/public/arch-x86/cpufeatureset.h | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h
> index abab78fa86db..db633bd5c128 100644
> --- a/xen/include/public/arch-x86/cpufeatureset.h
> +++ b/xen/include/public/arch-x86/cpufeatureset.h
> @@ -121,6 +121,7 @@ XEN_CPUFEATURE(SMX,           1*32+ 6) /*   Safer Mode Extensions */
>  XEN_CPUFEATURE(EIST,          1*32+ 7) /*   Enhanced SpeedStep */
>  XEN_CPUFEATURE(TM2,           1*32+ 8) /*   Thermal Monitor 2 */
>  XEN_CPUFEATURE(SSSE3,         1*32+ 9) /*A  Supplemental Streaming SIMD Extensions-3 */
> +XEN_CPUFEATURE(SDGB,          1*32+11) /*   Silicon Debugging */
>  XEN_CPUFEATURE(FMA,           1*32+12) /*A  Fused Multiply Add */
>  XEN_CPUFEATURE(CX16,          1*32+13) /*A  CMPXCHG16B */
>  XEN_CPUFEATURE(XTPR,          1*32+14) /*   Send Task Priority Messages */
> @@ -181,6 +182,7 @@ XEN_CPUFEATURE(XSAVEOPT,      4*32+ 0) /*A  XSAVEOPT instruction */
>  XEN_CPUFEATURE(XSAVEC,        4*32+ 1) /*A  XSAVEC/XRSTORC instructions */
>  XEN_CPUFEATURE(XGETBV1,       4*32+ 2) /*A  XGETBV with %ecx=1 */
>  XEN_CPUFEATURE(XSAVES,        4*32+ 3) /*S  XSAVES/XRSTORS instructions */
> +XEN_CPUFEATURE(XFD,           4*32+ 4) /*   Extended Feature Disable */

/* MSR_XFD{,_ERR} (eXtended Feature Disable) */

>  
>  /* Intel-defined CPU features, CPUID level 0x00000007:0.ebx, word 5 */
>  XEN_CPUFEATURE(FSGSBASE,      5*32+ 0) /*A  {RD,WR}{FS,GS}BASE instructions */
> @@ -221,6 +223,7 @@ XEN_CPUFEATURE(AVX512_VBMI,   6*32+ 1) /*A  AVX-512 Vector Byte Manipulation Ins
>  XEN_CPUFEATURE(UMIP,          6*32+ 2) /*S  User Mode Instruction Prevention */
>  XEN_CPUFEATURE(PKU,           6*32+ 3) /*H  Protection Keys for Userspace */
>  XEN_CPUFEATURE(OSPKE,         6*32+ 4) /*!  OS Protection Keys Enable */
> +XEN_CPUFEATURE(WAITPKG,       6*32+ 5) /*   User-level monitoring support */

UMONITOR/UMWAIT/TPAUSE

It's more than just monitoring support.

>  XEN_CPUFEATURE(AVX512_VBMI2,  6*32+ 6) /*A  Additional AVX-512 Vector Byte Manipulation Instrs */
>  XEN_CPUFEATURE(CET_SS,        6*32+ 7) /*   CET - Shadow Stacks */
>  XEN_CPUFEATURE(GFNI,          6*32+ 8) /*A  Galois Field Instrs */
> @@ -228,13 +231,16 @@ XEN_CPUFEATURE(VAES,          6*32+ 9) /*A  Vector AES Instrs */
>  XEN_CPUFEATURE(VPCLMULQDQ,    6*32+10) /*A  Vector Carry-less Multiplication Instrs */
>  XEN_CPUFEATURE(AVX512_VNNI,   6*32+11) /*A  Vector Neural Network Instrs */
>  XEN_CPUFEATURE(AVX512_BITALG, 6*32+12) /*A  Support for VPOPCNT[B,W] and VPSHUFBITQMB */
> +XEN_CPUFEATURE(TME_EN,        6*32+13) /*   TME MSR support */

Just TME as a name.  We don't tend to have suffixes like
enabled/supported because they're just line-noise.

As a comment, go for Total Memory Encryption.  It's more than just an MSR.

>  XEN_CPUFEATURE(AVX512_VPOPCNTDQ, 6*32+14) /*A  POPCNT for vectors of DW/QW */
> +XEN_CPUFEATURE(LA57,          6*32+16) /*   57-bit linear addressing and five-level paging */

"5-level paging (57-bit linear addresses)" is more concise.

>  XEN_CPUFEATURE(RDPID,         6*32+22) /*A  RDPID instruction */
>  XEN_CPUFEATURE(BLD,           6*32+24) /*   BusLock Detect (#DB trap) support */
>  XEN_CPUFEATURE(CLDEMOTE,      6*32+25) /*A  CLDEMOTE instruction */
>  XEN_CPUFEATURE(MOVDIRI,       6*32+27) /*a  MOVDIRI instruction */
>  XEN_CPUFEATURE(MOVDIR64B,     6*32+28) /*a  MOVDIR64B instruction */
>  XEN_CPUFEATURE(ENQCMD,        6*32+29) /*   ENQCMD{,S} instructions */
> +XEN_CPUFEATURE(SGX_LC,        6*32+30) /*   SGX Launch Configuration */

This is an irritating case where the SDM disagrees with all the
whitepapers on the name.  Everywhere else calls it Control, not
Configuration (and technically, "Flexible" at that).

I doubt the difference matters in practice.

>  XEN_CPUFEATURE(PKS,           6*32+31) /*H  Protection Key for Supervisor */
>  
>  /* AMD-defined CPU features, CPUID level 0x80000007.edx, word 7 */
> @@ -264,6 +270,7 @@ XEN_CPUFEATURE(BTC_NO,        8*32+29) /*A  Hardware not vulnerable to Branch Ty
>  XEN_CPUFEATURE(IBPB_RET,      8*32+30) /*A  IBPB clears RSB/RAS too. */
>  
>  /* Intel-defined CPU features, CPUID level 0x00000007:0.edx, word 9 */
> +XEN_CPUFEATURE(SGX_KEYS,      9*32+ 1) /*   Attestation Services for Intel SGX */

Again, "SGX Attestation Service" is more concise.

>  XEN_CPUFEATURE(AVX512_4VNNIW, 9*32+ 2) /*   Xeon Phi AVX512 Neural Network Instructions */
>  XEN_CPUFEATURE(AVX512_4FMAPS, 9*32+ 3) /*   Xeon Phi AVX512 Multiply Accumulation Single Precision */
>  XEN_CPUFEATURE(FSRM,          9*32+ 4) /*A  Fast Short REP MOVS */
> @@ -276,10 +283,13 @@ XEN_CPUFEATURE(TSX_FORCE_ABORT, 9*32+13) /* MSR_TSX_FORCE_ABORT.RTM_ABORT */
>  XEN_CPUFEATURE(SERIALIZE,     9*32+14) /*A  SERIALIZE insn */
>  XEN_CPUFEATURE(HYBRID,        9*32+15) /*   Heterogeneous platform */
>  XEN_CPUFEATURE(TSXLDTRK,      9*32+16) /*a  TSX load tracking suspend/resume insns */
> +XEN_CPUFEATURE(PCONFIG,       9*32+18) /*   Platform configuration support */

"PCONFIG insn".  That's a lot more meaningful to someone glancing at
this file.  "platform configuration" is a functionally infinite set of
things.

>  XEN_CPUFEATURE(ARCH_LBR,      9*32+19) /*   Architectural Last Branch Record */
>  XEN_CPUFEATURE(CET_IBT,       9*32+20) /*   CET - Indirect Branch Tracking */
> +XEN_CPUFEATURE(AMX_BF16,      9*32+22) /*   Tile computational operations on bfloat16 numbers */
>  XEN_CPUFEATURE(AVX512_FP16,   9*32+23) /*A  AVX512 FP16 instructions */
>  XEN_CPUFEATURE(AMX_TILE,      9*32+24) /*   AMX Tile architecture */
> +XEN_CPUFEATURE(AMX_INT8,      9*32+25) /*   Tile computational operations on 8-bit integers */
>  XEN_CPUFEATURE(IBRSB,         9*32+26) /*A  IBRS and IBPB support (used by Intel) */
>  XEN_CPUFEATURE(STIBP,         9*32+27) /*A  STIBP */
>  XEN_CPUFEATURE(L1D_FLUSH,     9*32+28) /*S  MSR_FLUSH_CMD and L1D flush. */
> @@ -363,6 +373,8 @@ XEN_CPUFEATURE(GDS_CTRL,           16*32+25) /*   MCU_OPT_CTRL.GDS_MIT_{DIS,LOCK
>  XEN_CPUFEATURE(GDS_NO,             16*32+26) /*A  No Gather Data Sampling */
>  XEN_CPUFEATURE(RFDS_NO,            16*32+27) /*A  No Register File Data Sampling */
>  XEN_CPUFEATURE(RFDS_CLEAR,         16*32+28) /*!A| Register File(s) cleared by VERW */
> +XEN_CPUFEATURE(IGN_UMONITOR_SUPPORT, 16*32+29) /*  UMONITOR Ignore support */
> +XEN_CPUFEATURE(MON_UMON_MITG_SUPPORT, 16*32+30) /*  (U)MONITOR Mitigation support */

These two want splitting out into separate patch, which does more than
just this.

Read the whitepaper:
https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/monitor-umonitor-performance-guidance.html

and we want all 5 new enumerations, even the new CPUID bit (because it
will start existing on GNR/CWF I believe).  Also, ARCH_CAPS is special
because it's duplicated here and in msr-index.h

Finally, somewhere in the Intel bringup code, if we see
ARCH_CAPS.IGN_UMON then we want to force MCU_OPT.IGN_UMON (because we
don't support UMONITOR) and clear MCU_OPT.MON_MITG.

The ucode-load defaults are safe for Xen (this is why we didn't XSA it
on the embargo date), but there's a corner case if something earlier in
the boot chain decided to activate the less-safe mode.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 19:51:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 19:51:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777632.1187732 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seK1Y-0003oa-Dw; Wed, 14 Aug 2024 19:51:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777632.1187732; Wed, 14 Aug 2024 19:51:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seK1Y-0003nZ-8y; Wed, 14 Aug 2024 19:51:12 +0000
Received: by outflank-mailman (input) for mailman id 777632;
 Wed, 14 Aug 2024 19:51:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gOS0=PN=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1seK1W-0003Wx-WE
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 19:51:11 +0000
Received: from NAM04-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam04on20626.outbound.protection.outlook.com
 [2a01:111:f403:240a::626])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8af13289-5a76-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 21:51:07 +0200 (CEST)
Received: from MW4PR04CA0091.namprd04.prod.outlook.com (2603:10b6:303:83::6)
 by CY5PR12MB6384.namprd12.prod.outlook.com (2603:10b6:930:3c::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Wed, 14 Aug
 2024 19:51:02 +0000
Received: from CO1PEPF000044F7.namprd21.prod.outlook.com
 (2603:10b6:303:83:cafe::4e) by MW4PR04CA0091.outlook.office365.com
 (2603:10b6:303:83::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.23 via Frontend
 Transport; Wed, 14 Aug 2024 19:51:02 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1PEPF000044F7.mail.protection.outlook.com (10.167.241.197) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.4 via Frontend Transport; Wed, 14 Aug 2024 19:51:02 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 14:51:01 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 14:51:01 -0500
Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 14 Aug 2024 14:51:00 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8af13289-5a76-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ClUctrHiLeeVxjjlO3I5JV86fvfIbOoDHdcHf3381Ur5XhNHPIRYuHFJ48xvtICSS6lIeYb7QvXT1ijbsIHwirVKe+le3o93sEhVy0bWDhWIIAG5t81S+oS3L1ExH0/J3DkBbBmbXUEVHIxtIwE04zwAYVLlDco2gs88k0EoVh06NJcNK2DaDbB8v9u4Yi2AmnDh0pPCcuxV1Q+EUDJW4I0pm0JtaCQIDBUz6htB7SIaIaAaVooUl2OdFWejYWepTI/ut/hSK3K9iE5qvYDhkbzlGyVqZKfy3TALsWSwwQnM5/+gxctSaeZKqERTUOchE4Q5uUBRZR/YCpEY033f9A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=726QpRcn+lvf4rCuApM2KwRHNgakfInv/OKNIzKT6VQ=;
 b=N/OCJHenfd8GrkLCGyVvzqUQtgI7qm+DkJVVnrOKEKZ7IOW7O8bTdwfd9zH7oYhJQsYeLtbx3iJae1OyaPPbQGwiPZV25IxgKZzsRGrzYFjXTXqlgPvJMKdbY1AFpA4ABxABIR8QsU7Cx81N5ZbhZkbNpbnRGVHGWleSMQQjHLT0fExX8NxDMHPNocxOW03it69nQ3HuH1bXsa+Znsvi5ZrBmIbbWipZqb+1zFkrWnlLaesfCuA6PxUlfaFvNDUjwq2w5d/fjrYBqZcDuIIHFHM3WfPzwxFGahHW97hoC3SgOp2EHdpUFxpBpE7JTIl2zzpsA7j4DoMpNA4qJHanHQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=726QpRcn+lvf4rCuApM2KwRHNgakfInv/OKNIzKT6VQ=;
 b=hASncvI7nC6ehjU+hsWeU46XeP/bmnEZQt1s0MdgmZ6YAsB3bu4WdvKT1im/ytH1B2h2yCOCPYyOt76PE/A18n35Vwk9NTyyWGG2f+Ie78T7fstOsl58OmwJaegt+axtoHLegtdXIH2MMEqm+GgbEgzBFfg52rvgZzZJaqrfpYM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jason Andryuk <jason.andryuk@amd.com>
To: Juergen Gross <jgross@suse.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Thomas Gleixner <tglx@linutronix.de>, "Ingo
 Molnar" <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, "H. Peter Anvin"
	<hpa@zytor.com>, Stefano Stabellini <sstabellini@kernel.org>, "Oleksandr
 Tyshchenko" <oleksandr_tyshchenko@epam.com>, Paolo Bonzini
	<pbonzini@redhat.com>, Brian Gerst <brgerst@gmail.com>
CC: <xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>, "Jason
 Andryuk" <jason.andryuk@amd.com>
Subject: [PATCH v2 2/5] x86/pvh: Make PVH entrypoint PIC for x86-64
Date: Wed, 14 Aug 2024 15:50:50 -0400
Message-ID: <20240814195053.5564-3-jason.andryuk@amd.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240814195053.5564-1-jason.andryuk@amd.com>
References: <20240814195053.5564-1-jason.andryuk@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000044F7:EE_|CY5PR12MB6384:EE_
X-MS-Office365-Filtering-Correlation-Id: f8d40ee4-e912-4ded-44d1-08dcbc9a6d40
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|1800799024|82310400026|7416014|376014|921020;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?b5fG4thVHpJa8UBCnUBBURbKKrtZ9+8rNhat9p7NjhKvaO0QpxDzmCEIH0ez?=
 =?us-ascii?Q?bRop2WDvuY5lOBZTNOu2KqnHDR0vc5bZNGJW15cv7tn+iP0WfUD//eUBnNQ+?=
 =?us-ascii?Q?kpLIAgr0fkX9SGXMgReCz5vCfl89zsrahxHS6j7vD6paZXRa90Rh4RBZEgjG?=
 =?us-ascii?Q?RZrnihOOwXFbIG87amymTi3cAhZTwCkSJ/RbIxbCLRBZh59cjlFi2IpNSdD7?=
 =?us-ascii?Q?Jrj90dKr476tys7q4tDFl9h+aIK4sOFXYZa4YAW0XcZNU8ejBJAWRfMCRNdd?=
 =?us-ascii?Q?SjviAZlkGH9qjLfZ1PtmZHeoh3FPlnpIz/crQp5IQecQbEWTKNKNZbxSzlzw?=
 =?us-ascii?Q?vl7e93yzk4op+ZJhx65DvRCzAAwxFMQgUk3o9HqrC1rP5cJzOatlHiAhAM2z?=
 =?us-ascii?Q?watF7tqEAem8bg34/8zg4g0CzT4RHWD9J49JGHs8LGSUFWhAl3XcUT00eZFF?=
 =?us-ascii?Q?ryWrCYNzPTTqfEvlp93fpCmwwLh4Avus7pJHuSxnx5xpJ1f5FISR4na+aGwj?=
 =?us-ascii?Q?uCAvze4MdGlyIB+dbabjigQ813WoSPsi1/gcb3Vs2DZyV148N6PMJzsrGG2T?=
 =?us-ascii?Q?VxQ6zg1pzT0XCIWdmsYGPOp4bERQPDiczsAENmwUA+RCFCSaJDJFXmB12Tbm?=
 =?us-ascii?Q?hlJDAaoQLZDsUapt5IhTxithiXSqYo3lcyYORMs9TrfddWVlV3etu2SFlKtw?=
 =?us-ascii?Q?K4WgFUtTbsYdBwfuNoradvKbriUHKPoNf1N0rZ2Wl9UF/1ZhV/CylbJUPWiQ?=
 =?us-ascii?Q?ieFmbCdXlUX3gv1rz6MBGvSdSZyzjgcAoDsDjtMP83Andl20RxRmMp67Oeyz?=
 =?us-ascii?Q?+AeM+AZYa2rgfW8VfFimumvJ0bHyrIRilnH4XBdaeT8Ch1C/dm7gWWRJQC7D?=
 =?us-ascii?Q?XDMJQWsjHk7/ZZd51bmsIWDdkQMxupzYbySzU+17FLA6QY/j9zbNEfAd1owW?=
 =?us-ascii?Q?5+oiyifA4bVmHHgdHJ4kp27VXTDJyvWLLNJDfnKXm8QhfwO42D2MgSAT4hYt?=
 =?us-ascii?Q?+3OhnjTBwqEGYGKaP4VcJWj/DC4iel3kIWX0949Hhv2MYz6xkHbM8aST2W+x?=
 =?us-ascii?Q?ml/Lh0HvO1UWAdxVHoOL+DKwCynjsaPGADLfbB9ri5DGZqkkcrIQEq3N6e+n?=
 =?us-ascii?Q?5sgfrgYehQCvdn+kp5tK6QnSxpGTcfA+Cxy3/H+7D2Wd5CAj5/SRt5GHM/s5?=
 =?us-ascii?Q?EE9JNoYu5RZR0L08nJvNfMLZf4V3CERfssJsmNlQySpSfhNvyL3AQRSdl7qR?=
 =?us-ascii?Q?Ouimx3pY40hB63zfD+nOFSWSrHOkp6d3CfgK/SQqzCACqsDK2yyfOdy1g/oj?=
 =?us-ascii?Q?yYg+TrTN0LWwqx8+Fh6tvBpJby03OyyfS/U/EHuTNDqDjw1ybdne6qhDcN4x?=
 =?us-ascii?Q?rVkr/p6x0/rsWaD94w44s5qaPECeBlk1ln/G9PXNdelkA1OsC7ecfVK7lNpV?=
 =?us-ascii?Q?zV3liZNppTISEHEScOAvWXhalipSRoYUPu5suOlW5rPJlEOrjGZnOQ=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(82310400026)(7416014)(376014)(921020);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 19:51:02.1650
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: f8d40ee4-e912-4ded-44d1-08dcbc9a6d40
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000044F7.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6384

The PVH entrypoint is 32bit non-PIC code running the uncompressed
vmlinux at its load address CONFIG_PHYSICAL_START - default 0x1000000
(16MB).  The kernel is loaded at that physical address inside the VM by
the VMM software (Xen/QEMU).

When running a Xen PVH Dom0, the host reserved addresses are mapped 1-1
into the PVH container.  There exist system firmwares (Coreboot/EDK2)
with reserved memory at 16MB.  This creates a conflict where the PVH
kernel cannot be loaded at that address.

Modify the PVH entrypoint to be position-indepedent to allow flexibility
in load address.  Only the 64bit entry path is converted.  A 32bit
kernel is not PIC, so calling into other parts of the kernel, like
xen_prepare_pvh() and mk_pgtable_32(), don't work properly when
relocated.

This makes the code PIC, but the page tables need to be updated as well
to handle running from the kernel high map.

The UNWIND_HINT_END_OF_STACK is to silence:
vmlinux.o: warning: objtool: pvh_start_xen+0x7f: unreachable instruction
after the lret into 64bit code.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
---
v2:
Use rip-relative loads in 64bit mode
Direct jmp to startup_64
---
 arch/x86/platform/pvh/head.S | 46 ++++++++++++++++++++++++++----------
 1 file changed, 34 insertions(+), 12 deletions(-)

diff --git a/arch/x86/platform/pvh/head.S b/arch/x86/platform/pvh/head.S
index f7235ef87bc3..ba4d0eab4436 100644
--- a/arch/x86/platform/pvh/head.S
+++ b/arch/x86/platform/pvh/head.S
@@ -7,6 +7,7 @@
 	.code32
 	.text
 #define _pa(x)          ((x) - __START_KERNEL_map)
+#define rva(x)          ((x) - pvh_start_xen)
 
 #include <linux/elfnote.h>
 #include <linux/init.h>
@@ -54,7 +55,25 @@ SYM_CODE_START_LOCAL(pvh_start_xen)
 	UNWIND_HINT_END_OF_STACK
 	cld
 
-	lgdt (_pa(gdt))
+	/*
+	 * See the comment for startup_32 for more details.  We need to
+	 * execute a call to get the execution address to be position
+	 * independent, but we don't have a stack.  Save and restore the
+	 * magic field of start_info in ebx, and use that as the stack.
+	 */
+	mov  (%ebx), %eax
+	leal 4(%ebx), %esp
+	ANNOTATE_INTRA_FUNCTION_CALL
+	call 1f
+1:	popl %ebp
+	mov  %eax, (%ebx)
+	subl $rva(1b), %ebp
+	movl $0, %esp
+
+	leal rva(gdt)(%ebp), %eax
+	leal rva(gdt_start)(%ebp), %ecx
+	movl %ecx, 2(%eax)
+	lgdt (%eax)
 
 	mov $PVH_DS_SEL,%eax
 	mov %eax,%ds
@@ -62,14 +81,14 @@ SYM_CODE_START_LOCAL(pvh_start_xen)
 	mov %eax,%ss
 
 	/* Stash hvm_start_info. */
-	mov $_pa(pvh_start_info), %edi
+	leal rva(pvh_start_info)(%ebp), %edi
 	mov %ebx, %esi
-	mov _pa(pvh_start_info_sz), %ecx
+	movl rva(pvh_start_info_sz)(%ebp), %ecx
 	shr $2,%ecx
 	rep
 	movsl
 
-	mov $_pa(early_stack_end), %esp
+	leal rva(early_stack_end)(%ebp), %esp
 
 	/* Enable PAE mode. */
 	mov %cr4, %eax
@@ -84,30 +103,33 @@ SYM_CODE_START_LOCAL(pvh_start_xen)
 	wrmsr
 
 	/* Enable pre-constructed page tables. */
-	mov $_pa(init_top_pgt), %eax
+	leal rva(init_top_pgt)(%ebp), %eax
 	mov %eax, %cr3
 	mov $(X86_CR0_PG | X86_CR0_PE), %eax
 	mov %eax, %cr0
 
 	/* Jump to 64-bit mode. */
-	ljmp $PVH_CS_SEL, $_pa(1f)
+	pushl $PVH_CS_SEL
+	leal  rva(1f)(%ebp), %eax
+	pushl %eax
+	lretl
 
 	/* 64-bit entry point. */
 	.code64
 1:
+	UNWIND_HINT_END_OF_STACK
+
 	/* Set base address in stack canary descriptor. */
 	mov $MSR_GS_BASE,%ecx
-	mov $_pa(canary), %eax
+	leal canary(%rip), %eax
 	xor %edx, %edx
 	wrmsr
 
 	call xen_prepare_pvh
 
 	/* startup_64 expects boot_params in %rsi. */
-	mov $_pa(pvh_bootparams), %rsi
-	mov $_pa(startup_64), %rax
-	ANNOTATE_RETPOLINE_SAFE
-	jmp *%rax
+	lea pvh_bootparams(%rip), %rsi
+	jmp startup_64
 
 #else /* CONFIG_X86_64 */
 
@@ -143,7 +165,7 @@ SYM_CODE_END(pvh_start_xen)
 	.balign 8
 SYM_DATA_START_LOCAL(gdt)
 	.word gdt_end - gdt_start
-	.long _pa(gdt_start)
+	.long _pa(gdt_start) /* x86-64 will overwrite if relocated. */
 	.word 0
 SYM_DATA_END(gdt)
 SYM_DATA_START_LOCAL(gdt_start)
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 19:51:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 19:51:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777630.1187718 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seK1W-0003XF-PD; Wed, 14 Aug 2024 19:51:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777630.1187718; Wed, 14 Aug 2024 19:51:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seK1W-0003X8-MS; Wed, 14 Aug 2024 19:51:10 +0000
Received: by outflank-mailman (input) for mailman id 777630;
 Wed, 14 Aug 2024 19:51:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gOS0=PN=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1seK1V-0003Wx-Bp
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 19:51:09 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on20622.outbound.protection.outlook.com
 [2a01:111:f403:2418::622])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8966eb9f-5a76-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 21:51:03 +0200 (CEST)
Received: from MW3PR05CA0003.namprd05.prod.outlook.com (2603:10b6:303:2b::8)
 by DS0PR12MB7801.namprd12.prod.outlook.com (2603:10b6:8:140::10) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.23; Wed, 14 Aug
 2024 19:50:58 +0000
Received: from CO1PEPF000044FC.namprd21.prod.outlook.com
 (2603:10b6:303:2b:cafe::c3) by MW3PR05CA0003.outlook.office365.com
 (2603:10b6:303:2b::8) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.15 via Frontend
 Transport; Wed, 14 Aug 2024 19:50:57 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1PEPF000044FC.mail.protection.outlook.com (10.167.241.202) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.4 via Frontend Transport; Wed, 14 Aug 2024 19:50:57 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 14:50:56 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 14:50:56 -0500
Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 14 Aug 2024 14:50:55 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8966eb9f-5a76-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=EnDHcebIiKZBckRdlaBcqOO0aBzOYgsPDMoRRLuZ3c03hB9Xi6e/avmXmOXWZacJLyOeM18ZtZmGMIrDTBGKJQTtaIeMW+GM08Ydh1Qn+CwbikwRF2e9nWbrnmXx38t5MMh38Dg0dZn/Fd5CHLlADo6VV2m2ZnijOTb5eY05MROTxFbNLAoxcJ6ENLsttjfbWQ0kuYlJjf18SvVCRfCrzIko1LXzJVL6e1YhxF9eKGlp1X47k9I99Lpr7OPXwWsSwKe//rwfhVSkwWwpT9fQHP2PNATiBxNsNX3yBnudpsTYNfq3WT9/UChUdr1EZtYaX6lwIl35Jsd+yEvfUpXtyg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=VPive7oFSpF3kUon9qB7Mth2EU8W7EIwN3zy7ldimdI=;
 b=KjmBqgB/plvnu5KDgtcPzfNFdqEeeMhRlhbCU7JZVDz3iXHNqrj3ugshqqrw7co3QWdmzFB5FBpd3bfxg1DIpMffOJ+3dK5GTKwuM7kWS9aibcMATuUcIPoJBMU7NwLui5NIWnFI1EEPxamV5L7q/yV/ZkXzROso7q1raHwAhtIz1JUoCm8WfRm8zSkhO+hMpxLErbf/+kiN4LrZ1z00dRIxaGmMVVt4olvh6NQd0SB3thzcFQd+k66W0/XMTOhzQoMaBanrwlzn7Xg5we8uiyIMXGonyiZe5/5ojnPKX8h96fcAWq2NLgrjd73QcufHox56qPIZYjm2IJyepb0vjA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=VPive7oFSpF3kUon9qB7Mth2EU8W7EIwN3zy7ldimdI=;
 b=v34jRRKOCjRC5v7S3MmvOiVbPu+RwUM5UPxTftYUQV4sy4/ODao7fwqp2lfpteEPQbq2XwYE2BOx/9NqvZPUKL8OUvyqyo/5sbdf/CHvnhO1qkaE4pEqD3j3mkggp3fh7FWWOL1OV3dBsZxN1LU/d2bK4ToxQSHucvW77oPP1lM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jason Andryuk <jason.andryuk@amd.com>
To: Juergen Gross <jgross@suse.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Thomas Gleixner <tglx@linutronix.de>, "Ingo
 Molnar" <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, "H. Peter Anvin"
	<hpa@zytor.com>, Stefano Stabellini <sstabellini@kernel.org>, "Oleksandr
 Tyshchenko" <oleksandr_tyshchenko@epam.com>, Paolo Bonzini
	<pbonzini@redhat.com>, Brian Gerst <brgerst@gmail.com>
CC: <xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>, "Jason
 Andryuk" <jason.andryuk@amd.com>
Subject: [PATCH v2 0/5] x86/pvh: Make 64bit PVH entry relocatable
Date: Wed, 14 Aug 2024 15:50:48 -0400
Message-ID: <20240814195053.5564-1-jason.andryuk@amd.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: jason.andryuk@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000044FC:EE_|DS0PR12MB7801:EE_
X-MS-Office365-Filtering-Correlation-Id: 787b21a3-a69f-4238-9fd7-08dcbc9a6a80
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|7416014|376014|82310400026|36860700013|1800799024|921020;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?ZASMzansHKLokB6q3tiCnaMpuPt7J6tEWSHVH8xzQQznqyddxrdLoTuqm3ZT?=
 =?us-ascii?Q?LgB40USElUboNIpKtbLW7tdHak53NesaovCIjZRg8oxqHZqpOIU+OueOmfEb?=
 =?us-ascii?Q?lh/3gXD6i/Mc9f27Ix4FE9tzH3TdnbM7ubN6iLqqvEbhgAepk0G5S5l3miIo?=
 =?us-ascii?Q?ZHZZcuArGbOnk5VBurXjB7dL/Y7apn/rx4Md5dap8cAklURNEFvBqVshu7jZ?=
 =?us-ascii?Q?jDO/Lq0iaadjG6iTOGE/171a6M9K/emtfNJWLu/7lfEDsBgFS4vIctvdkzbP?=
 =?us-ascii?Q?owcR5kdHkXj4U7RfGdYr9K0j1KHfgzrArrkMxCWFum7oUueHioilf6Nl/NJ5?=
 =?us-ascii?Q?wqTfZIS9JU9W6lw6LY8t8fB6Eyj+1abA6S3HoI6e4jykO+s0I8xSXeN1hn1+?=
 =?us-ascii?Q?WBfggd/GjSt5kv/lIPTvmDHmtC8e9Gs40lGJlj6+IFZSOe9Hj/++kRkiYNuX?=
 =?us-ascii?Q?yrL3eZcSh1ZyrbxqHA2tfp6OWXJZe1WIzvAzL+O/BAggg+6aZk4cHIfJomFe?=
 =?us-ascii?Q?BVymehb20BPtil33HvtDk7sqOxFP/rVMi/44JPmliYW49Mxa4JYWAkIxvQlw?=
 =?us-ascii?Q?NKRS3rPUSBRCfbJcwXX6nzYqYwG/dGoSk1zUR6/CgrUVo71YVMN4KPFuhvyy?=
 =?us-ascii?Q?bJJB4sWAFZH5NbZAH56pSUB7jjLciAAlqhLRctewydY1jclaEjrLdsZyzAvo?=
 =?us-ascii?Q?C1hl9R+2214MmRLrgnnY7VYmWud8VZW3JRBMszyP8+XQ/AUALoXmuiTuYJrS?=
 =?us-ascii?Q?5F14tTkdf430Xtj6Eo5bjg1K7yC6kDwCmFK1tMXIcqwLUi176eQVJtgstCO0?=
 =?us-ascii?Q?B1LSSeHMZ7BZhCyAdMUSTKX0v60rQpCnEFMDOacYyvgCXl25BDzuUL9FlhAP?=
 =?us-ascii?Q?IWU1W3lKGypQRE7jft8w+0Ifj4OWKFxpxuvkWdZWbbnvUyFxVFe9tJKKxlgf?=
 =?us-ascii?Q?FdXeDLViRg0PkWFKs4bKdH44GEenNueOUb3D4wxTayS7Y82FYh4+/u4HYPDf?=
 =?us-ascii?Q?fu2ghXQ5+SLFjEPecN68OL3kBB3KFMbdALh3md8PaOnHnfBjbnvRXUQaQaHo?=
 =?us-ascii?Q?kQ/wtTE9qZehI9bgAHq8ila3/Lh1WFaKUMKYFXyH+Dq1UnksYEwfGpom0Kys?=
 =?us-ascii?Q?jYsMbuNZrQPzwGekFNmLyC7gwublv+bCNiDnPRWPVORo93eubvY+CUY13ez4?=
 =?us-ascii?Q?MwBjXhqveKLssvyJo060y+SyFXyOUbodGbdFJIAGKPxwIPFfau8j2zVyh+pO?=
 =?us-ascii?Q?/6KYb4Zmc0jNOc0Ajq907T4Sr5jAKdujwI/F9xUZxvlBRXQ0WC5XbL6d2ydA?=
 =?us-ascii?Q?EwElog1lwoG2bUvl4/S7yasOQYDIIcP/20nCJyB0r5JNApUjxy41jr/8o6Yd?=
 =?us-ascii?Q?7uPP4+ZExEel9OpRUIU5ysMxR3nrfdFPDhAW0uJkGjXA0gZ+RSXxIqT3MTEn?=
 =?us-ascii?Q?1kR+pFIJcaoWihOh64WdVf+pxSWh/CLAlL2uZACUIBDWYIR9jxuI0w=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(7416014)(376014)(82310400026)(36860700013)(1800799024)(921020);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 19:50:57.5692
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 787b21a3-a69f-4238-9fd7-08dcbc9a6a80
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000044FC.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7801

Using the PVH entry point, the uncompressed vmlinux is loaded at
LOAD_PHYSICAL_ADDR, and execution starts in 32bit mode at the
address in XEN_ELFNOTE_PHYS32_ENTRY, pvh_start_xen, with paging
disabled.

Loading at LOAD_PHYSICAL_ADDR has not been a problem in the past as
virtual machines don't have conflicting memory maps.  But Xen now
supports a PVH dom0, which uses the host memory map, and there are
Coreboot/EDK2 firmwares that have reserved regions conflicting with
LOAD_PHYSICAL_ADDR.  Xen recently added XEN_ELFNOTE_PHYS32_RELOC to
specify an alignment, minimum and maximum load address when
LOAD_PHYSICAL_ADDR cannot be used.  This patch series makes the PVH
entry path PIC to support relocation.

Only x86-64 is converted.  The 32bit entry path calling into vmlinux,
which is not PIC, will not support relocation.

The entry path needs pages tables to switch to 64bit mode.  A new
pvh_init_top_pgt is added to make the transition into the startup_64
when the regular init_top_pgt pagetables are setup.  This duplication is
unfortunate, but it keeps the changes simpler.  __startup_64() can't be
used to setup init_top_pgt for PVH entry because it is 64bit code - the
32bit entry code doesn't have page tables to use.

This is the straight forward implementation to make it work.  Other
approaches could be pursued.

checkpatch.pl gives an error: "ERROR: Macros with multiple statements
should be enclosed in a do - while loop" about the moved PMDS macro.
But PMDS is an assembler macro, so its not applicable.  There are some
false positive warnings "WARNING: space prohibited between function name
and open parenthesis '('" about the macro, too.

v2 addresses review feedback.  It also replace LOAD_PHYSICAL_ADDR with
_pa(pvh_start_xen) in some offset calculations.  They happened to be
equal in my original builds.  When the two values differ,
_pa(pvh_start_xen) is the correct one to use.

Jason Andryuk (5):
  xen: sync elfnote.h from xen tree
  x86/pvh: Make PVH entrypoint PIC for x86-64
  x86/pvh: Set phys_base when calling xen_prepare_pvh()
  x86/kernel: Move page table macros to header
  x86/pvh: Add 64bit relocation page tables

 arch/x86/include/asm/pgtable_64.h |  23 ++++-
 arch/x86/kernel/head_64.S         |  20 ----
 arch/x86/platform/pvh/head.S      | 161 +++++++++++++++++++++++++++---
 include/xen/interface/elfnote.h   |  93 ++++++++++++++++-
 4 files changed, 259 insertions(+), 38 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 19:51:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 19:51:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777635.1187768 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seK1d-0004m8-AN; Wed, 14 Aug 2024 19:51:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777635.1187768; Wed, 14 Aug 2024 19:51:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seK1d-0004lv-6Q; Wed, 14 Aug 2024 19:51:17 +0000
Received: by outflank-mailman (input) for mailman id 777635;
 Wed, 14 Aug 2024 19:51:15 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gOS0=PN=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1seK1b-0004UM-C2
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 19:51:15 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20618.outbound.protection.outlook.com
 [2a01:111:f403:2416::618])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8d9081b7-5a76-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 21:51:12 +0200 (CEST)
Received: from MW3PR05CA0020.namprd05.prod.outlook.com (2603:10b6:303:2b::25)
 by CY5PR12MB6624.namprd12.prod.outlook.com (2603:10b6:930:40::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Wed, 14 Aug
 2024 19:51:06 +0000
Received: from CO1PEPF000044FC.namprd21.prod.outlook.com
 (2603:10b6:303:2b:cafe::6b) by MW3PR05CA0020.outlook.office365.com
 (2603:10b6:303:2b::25) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.15 via Frontend
 Transport; Wed, 14 Aug 2024 19:51:06 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1PEPF000044FC.mail.protection.outlook.com (10.167.241.202) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.4 via Frontend Transport; Wed, 14 Aug 2024 19:51:05 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 14:51:05 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 14:51:04 -0500
Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 14 Aug 2024 14:51:03 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8d9081b7-5a76-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=F0la5UQPm76PK5TA657KnPdmtWCWGuPqv2HH5SnUjf1h5k6sSKN+BZ55onhEkhopR1Kq6qIjt1Re2qFz319NQRomvrb6W2/RVKUsgrvgyUSNnrc0BMlPVnB3zK3ozoSFhl4ICi+QXkdu3ONq1sszvTgPlcY0QFr2CHCDrGBlZHv5/ARScCqcKzvgDKCg+hnuktwqoLDBAhiD2SdEIlPvRxqCsWrTwIfc/ctQjWf8fCkKJP88XIzYSErFIChI1TzedE3WNz90Jf8ENtvZsvjNqXfqPoTPyBwkBGkGaQs8+MbvsMD9e2Yyxq2SYPO+SxvsfmIvmR5DZkICNpnhnzq64A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QOPcfC2cX70PP2HugDLaOnmeNk4w9wVC9RUQJaISFRw=;
 b=uoz1RtmRFyZgHxUoq4+Geo6AmYkTRyyVdVdtBsUj+8xyVAH5hTaA+TiIsL98v34cvAGz44TZ1P8l7BktAG2Ngbt9KnW/QRxdunaoz3d2Do8OTdtOegD5GP2oxitMeV35qqRiIBbfS+BGZ9F2nVoBOEMX+J+g5lJHm+yDAlT1Vorlr4p75fLE5745Va7GpZwgccehRFkjny/6l1pAdLJP83sr/Ng2sXZ0wQDasX7vXSpQcpC5Zz/UvUN9p2DN9N4UUk9VXXOsueyZqOqKUUV9CbyLDnGx68zUGn0NnSKsQ+avYG9PT8XnIhGGon2YT5axYK5iTtLLgY8l6SugDyqGfw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QOPcfC2cX70PP2HugDLaOnmeNk4w9wVC9RUQJaISFRw=;
 b=2DGrPoUVgMFM/2KzUkBxr9iKsw3XgUWXUzAO6iGifrYo8Qq1jRiHEUkhnLZ9PwOajfkYy/1XtoMbaQfZ82OcnpQSci7eZLo4TUZ/JaR3d9kFFK14zZQ9Rs1e7Y9/l/Jpw7HTm3ttPrfVd2kMBCDKv+Qm4aEPJUMtsQJai6xKhUA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jason Andryuk <jason.andryuk@amd.com>
To: Juergen Gross <jgross@suse.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Thomas Gleixner <tglx@linutronix.de>, "Ingo
 Molnar" <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, "H. Peter Anvin"
	<hpa@zytor.com>, Stefano Stabellini <sstabellini@kernel.org>, "Oleksandr
 Tyshchenko" <oleksandr_tyshchenko@epam.com>, Paolo Bonzini
	<pbonzini@redhat.com>, Brian Gerst <brgerst@gmail.com>
CC: <xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>, "Jason
 Andryuk" <jason.andryuk@amd.com>
Subject: [PATCH v2 4/5] x86/kernel: Move page table macros to header
Date: Wed, 14 Aug 2024 15:50:52 -0400
Message-ID: <20240814195053.5564-5-jason.andryuk@amd.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240814195053.5564-1-jason.andryuk@amd.com>
References: <20240814195053.5564-1-jason.andryuk@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: jason.andryuk@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000044FC:EE_|CY5PR12MB6624:EE_
X-MS-Office365-Filtering-Correlation-Id: a0d3049f-b2fe-4b09-3ddb-08dcbc9a6f70
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|7416014|376014|36860700013|1800799024|921020;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?fzZe6rDlwFXHQtLVjW4ntm4/xf4q6PcJU1WGpb4zVyUBtLtJpNVVvew6x8rU?=
 =?us-ascii?Q?CPQx5r6hXAIGK4JLlCJKwr48lAOwfWMtUNd3jauikv+c4lji1az7Piqhq7wm?=
 =?us-ascii?Q?80sM2pJOMQGVkgltchumsHaWIod6+eBH+RRs3Pt4PmSdZ3W7isLj3mAGabWc?=
 =?us-ascii?Q?hsSv4mEYXuItsdnWnwY1c9eL8I7pGQ/mGHGWYpFMr6SVAkJs9FLR5qNH15f7?=
 =?us-ascii?Q?9TUak8AtFnZshpb5w1tiULvfTIlI4+MsDd+kJzdYnRLCHHIgG1W/d0bNCIIT?=
 =?us-ascii?Q?mc7geTsVlqhKN7on07FRYwpXYc4HVHm8XsX1sckwj09qHh+g4sOO5xNS9KXi?=
 =?us-ascii?Q?ONcH17EkBCG24zkntbgkwl2LTj1rTadvep05DuvJJF2GjFQswwvZQ5CD4SHW?=
 =?us-ascii?Q?8StgLa+9QgP5eBrH8AhZgns185Og1CbaimId6t8joCY7qTDnXwygiiG0Cf3I?=
 =?us-ascii?Q?1TCrHA3Flig9ZDIlLs90btBvpmEkLy7DaORVYkO1vYHP/ubXM91llnuYpO+u?=
 =?us-ascii?Q?RZBLeJbXsT37NQbzGgy51R7ECRA5CU1DgaGkDxi+k2qPee1SlNh80di3xDdU?=
 =?us-ascii?Q?WWPVsstvpC861xsVm4xbWhijP/XyvNFg2K3Me3rfFnuBikNWBUcbGBKuP9mb?=
 =?us-ascii?Q?XpB7YPEZtV2wJ7lhym34XH8hqhQYgX/Yhyyo4GiIwd688m9hETOOKzZenOqv?=
 =?us-ascii?Q?fMaQ6/NGFKPh2zGQ0iGzMaysYsaN5LV67RAoSa7aYTPzmSnURwWf8ZckT+oI?=
 =?us-ascii?Q?mDnJd4MGJH9fr+7i3i+7EBwj/WgG0WfFQo85o8/5G5OvvN7mqnPl/XjCY5Ja?=
 =?us-ascii?Q?Q+tlj99EpnzhvkNHnx0pPcrzzHLWOAm7FbeP8WXexPA7Mn11nb3kHA2GPqMb?=
 =?us-ascii?Q?1KinMjPrPt4krZZMsx+GXEaAw+SKfdeQlXft5sYYhd/qUe+JaExBoJZCcA/p?=
 =?us-ascii?Q?5Vb6U/3oUmD40q3oDZ0fs+QMAwJOdm7FXMm9knJ9vpP3cvXauu9r3/F+T+3o?=
 =?us-ascii?Q?NIhh6rLWARemGkny6ouGjIFNYvwFM7dNeeyC/Ou99MApIqzH7vPoDqtWUxOE?=
 =?us-ascii?Q?7dmvpVlDKleYzyFyIeLIpmsqJ/2awfKZTjRLWeeLNaNWOR6goRA+big2Vr2M?=
 =?us-ascii?Q?xKcKXo7ZCh2D6W9fNncjVhy6pa2FyoqJb0EdcEtI5B9hmqPnu357f1rH6wHq?=
 =?us-ascii?Q?YDJhPO44VodbvSS+nKXDhOun2ri5IYAzdYZ+r2NGLagR6JqoyNCAiVi3VZwp?=
 =?us-ascii?Q?4mKNft7gs+Mp2ybh+Im0WrIji5vGtz8QKe9Cs3BWaHzHmXX7uz4UvY0Qbz9v?=
 =?us-ascii?Q?KkfAyt2GJSfCdpFQX7rpgzVpvprQtPegpKZtkofs8SVvMdbjnOUrkwUV4pcM?=
 =?us-ascii?Q?2x9BUbfHUfEvoDHMfueqGLuGlU2e2F5zZaEOH0aLYVXQGmu5jHug0t0pBZ9e?=
 =?us-ascii?Q?AmXh4Y5vinOt8jvcp/NEGbsRpSrH3S7cymsOGG0eBD3YX1NtcWloKw=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(7416014)(376014)(36860700013)(1800799024)(921020);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 19:51:05.8505
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: a0d3049f-b2fe-4b09-3ddb-08dcbc9a6f70
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000044FC.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6624

The PVH entry point will need an additional set of prebuild page tables.
Move the macros and defines to pgtable_64.h, so they can be re-used.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
---
v2:
Use existing pgtable_64.h
s/-/ - / in pud_index()
Did not add Juergen's R-b in case the header movement matters
---
 arch/x86/include/asm/pgtable_64.h | 23 ++++++++++++++++++++++-
 arch/x86/kernel/head_64.S         | 20 --------------------
 2 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index 3c4407271d08..72912b8edfdf 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -271,5 +271,26 @@ static inline bool gup_fast_permitted(unsigned long start, unsigned long end)
 
 #include <asm/pgtable-invert.h>
 
-#endif /* !__ASSEMBLY__ */
+#else /* __ASSEMBLY__ */
+
+#define l4_index(x)	(((x) >> 39) & 511)
+#define pud_index(x)	(((x) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))
+
+L4_PAGE_OFFSET = l4_index(__PAGE_OFFSET_BASE_L4)
+L4_START_KERNEL = l4_index(__START_KERNEL_map)
+
+L3_START_KERNEL = pud_index(__START_KERNEL_map)
+
+#define SYM_DATA_START_PAGE_ALIGNED(name)			\
+	SYM_START(name, SYM_L_GLOBAL, .balign PAGE_SIZE)
+
+/* Automate the creation of 1 to 1 mapping pmd entries */
+#define PMDS(START, PERM, COUNT)			\
+	i = 0 ;						\
+	.rept (COUNT) ;					\
+	.quad	(START) + (i << PMD_SHIFT) + (PERM) ;	\
+	i = i + 1 ;					\
+	.endr
+
+#endif /* __ASSEMBLY__ */
 #endif /* _ASM_X86_PGTABLE_64_H */
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 330922b328bf..16752b8dfa89 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -32,13 +32,6 @@
  * We are not able to switch in one step to the final KERNEL ADDRESS SPACE
  * because we need identity-mapped pages.
  */
-#define l4_index(x)	(((x) >> 39) & 511)
-#define pud_index(x)	(((x) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
-
-L4_PAGE_OFFSET = l4_index(__PAGE_OFFSET_BASE_L4)
-L4_START_KERNEL = l4_index(__START_KERNEL_map)
-
-L3_START_KERNEL = pud_index(__START_KERNEL_map)
 
 	__HEAD
 	.code64
@@ -577,9 +570,6 @@ SYM_CODE_START_NOALIGN(vc_no_ghcb)
 SYM_CODE_END(vc_no_ghcb)
 #endif
 
-#define SYM_DATA_START_PAGE_ALIGNED(name)			\
-	SYM_START(name, SYM_L_GLOBAL, .balign PAGE_SIZE)
-
 #ifdef CONFIG_MITIGATION_PAGE_TABLE_ISOLATION
 /*
  * Each PGD needs to be 8k long and 8k aligned.  We do not
@@ -601,14 +591,6 @@ SYM_CODE_END(vc_no_ghcb)
 #define PTI_USER_PGD_FILL	0
 #endif
 
-/* Automate the creation of 1 to 1 mapping pmd entries */
-#define PMDS(START, PERM, COUNT)			\
-	i = 0 ;						\
-	.rept (COUNT) ;					\
-	.quad	(START) + (i << PMD_SHIFT) + (PERM) ;	\
-	i = i + 1 ;					\
-	.endr
-
 	__INITDATA
 	.balign 4
 
@@ -708,8 +690,6 @@ SYM_DATA_START_PAGE_ALIGNED(level1_fixmap_pgt)
 	.endr
 SYM_DATA_END(level1_fixmap_pgt)
 
-#undef PMDS
-
 	.data
 	.align 16
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 19:51:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 19:51:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777634.1187758 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seK1b-0004UC-1g; Wed, 14 Aug 2024 19:51:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777634.1187758; Wed, 14 Aug 2024 19:51:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seK1a-0004U5-Ug; Wed, 14 Aug 2024 19:51:14 +0000
Received: by outflank-mailman (input) for mailman id 777634;
 Wed, 14 Aug 2024 19:51:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gOS0=PN=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1seK1Z-0003Wx-03
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 19:51:13 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on2060f.outbound.protection.outlook.com
 [2a01:111:f403:2412::60f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8deaaf9b-5a76-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 21:51:11 +0200 (CEST)
Received: from MW4PR03CA0008.namprd03.prod.outlook.com (2603:10b6:303:8f::13)
 by MW4PR12MB6949.namprd12.prod.outlook.com (2603:10b6:303:208::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Wed, 14 Aug
 2024 19:51:08 +0000
Received: from CO1PEPF000044F8.namprd21.prod.outlook.com
 (2603:10b6:303:8f:cafe::4f) by MW4PR03CA0008.outlook.office365.com
 (2603:10b6:303:8f::13) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.33 via Frontend
 Transport; Wed, 14 Aug 2024 19:51:07 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1PEPF000044F8.mail.protection.outlook.com (10.167.241.198) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.4 via Frontend Transport; Wed, 14 Aug 2024 19:51:07 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 14:51:06 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 14:51:06 -0500
Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 14 Aug 2024 14:51:05 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8deaaf9b-5a76-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=unFpCT3m6Y3JVMv0vah3nxgNKFtwCXVTogf+Vv/R9XT1ZZUug0WqFwSvzfAE3kfDJdWOXOph4jGE+1b2DugxF0ISCebP86cwEGX5M6D2WsB4vetnuDlVhUjY72+1eEXJnK4wpz3CirG8q+er2lU9K7bAQ2+kvTabr2ldvVP3zsc40nzBAH2BiRzwuxBVgpj6poQ1+H0VRSgbSZawg6ueMcecH2vWp+jDYQS1sMh0eOIoNwxhVHQnkK6ayEniGrbjyT2tFBOF99dpGuiaJWF73VhGicL7cKy/S7hTTRfPtEItZxNEtCp6KVIEyRR+poJ+sPDDm27CvIGSDLxend5dyA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=HC/ZgKM1sNnirwUIzOYUrUnoB4T1UGuhE4FPq7nsUVM=;
 b=cFxDRR8j/zRFD3XkRCEHPrL9UZJQC1XgUHI+mzLznLHTxU/mFOLrM/R1B0GKFWDag2TwGuJh263lVXbsnwE0Y/9AKULpkr425efWAFj9JguE7wEWYVXYXS+1OTiulyyoiZAlJ0QEIkVKmTxgajlViGUQQOOTPhKFh9UFl356kPcPamxtzv3t4f7lbUbY8j0jpx/YJGHyaKzmZS+4VhfQX0c22TaYnxTNA/0xJMgQFfglxAMLkCcyOqnMDqIdICvb7dSun7b7wX89Z7OVsS8eueJ3jQGQ8UeeqnWOgtFSrV4Gib/rv5Orr/6JpvkzVcdfWcTLqHOWfZrBex2nGVyroA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=HC/ZgKM1sNnirwUIzOYUrUnoB4T1UGuhE4FPq7nsUVM=;
 b=K/ZOyqyGzBXWcPuvjdEhiU6bwc84Gen2NgSvh1ZXtdMtreiF7cI+8CsA6/dxw9dbH4aOeePPb8qczm/04cYLZIMiVFsmklC+lEBThCtuiFO6Y92WEki/GBG/LWLcZ/x3YQxKz3Y8wkncximqax3zqcsZkswdiBX5FQR/I/s/4LY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jason Andryuk <jason.andryuk@amd.com>
To: Juergen Gross <jgross@suse.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Thomas Gleixner <tglx@linutronix.de>, "Ingo
 Molnar" <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, "H. Peter Anvin"
	<hpa@zytor.com>, Stefano Stabellini <sstabellini@kernel.org>, "Oleksandr
 Tyshchenko" <oleksandr_tyshchenko@epam.com>, Paolo Bonzini
	<pbonzini@redhat.com>, Brian Gerst <brgerst@gmail.com>
CC: <xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>, "Jason
 Andryuk" <jason.andryuk@amd.com>
Subject: [PATCH v2 5/5] x86/pvh: Add 64bit relocation page tables
Date: Wed, 14 Aug 2024 15:50:53 -0400
Message-ID: <20240814195053.5564-6-jason.andryuk@amd.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240814195053.5564-1-jason.andryuk@amd.com>
References: <20240814195053.5564-1-jason.andryuk@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: jason.andryuk@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000044F8:EE_|MW4PR12MB6949:EE_
X-MS-Office365-Filtering-Correlation-Id: 654818fb-f78b-496e-9fa0-08dcbc9a7095
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|36860700013|7416014|376014|921020;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?izBEj8tOuyf48lDIrwaZjYcEg5WsLVapYQRRyEGh+vLcoMoKahMuLtVNYmGL?=
 =?us-ascii?Q?Pjz4xndpLAieuCjK/9c8o0bCmcVMU8SkentwAE+Z4Nak3el+J9/YicvccF8z?=
 =?us-ascii?Q?/z5tlQNDIf7EGotgb73sfZ/BF9CwxLkG+RVno/NqZu/IizE1d51nVTXe537a?=
 =?us-ascii?Q?NqqbIsWJjXtQqKStJTxyL7CJPSAkfMou2H79M/RAyD7Hpdls5SGjxAzod7p1?=
 =?us-ascii?Q?twJZF8Vc4QsdAOxjrAE1OXTzrUwCfzc5DwJnHEFOhKQS4CHWYs1ASM0eSA9z?=
 =?us-ascii?Q?yEnmOqbqNVx86kh/xxFO2c8tOVU5ky70X+y/lMKz+v7sFv/FOXcodn3D7wuw?=
 =?us-ascii?Q?e3iG1oftRkyRRpau9yphQVgkn3N0Q4HZqPiaWfMMgM1LFAMWbhjf9klLOKeJ?=
 =?us-ascii?Q?uIc+lphxiXOB33oG5om01fnQkhYti1ky+YqVEBwWDoHPZhIuNNhjD+PHh1pP?=
 =?us-ascii?Q?ey0YRh1sUnUP8+dIp9nyH/1werFfCW0lf3JGs9PFp4Os7e1iZ0euPgn2BUgr?=
 =?us-ascii?Q?WA6YnLRNa8Tu+b7ljwxkOtWfDI8/gQhxE6AIFZbzrTjKeFel7n1ySKivo885?=
 =?us-ascii?Q?QRb/nof0JF7YbmvPYw0cH/cmknZmHd7e1tvHL3jM2ZpPOrB9csyhQcuPAS58?=
 =?us-ascii?Q?aFkf1NNnBJ+fsjqVE36boV2kShcT9ef5fPnihpPUFxEdpMSpBbekkqLSuYR5?=
 =?us-ascii?Q?f6CSLTJWTemZZfvMbVaGCeclZzXNnXz/RvW2Ab9Xo3FPIZSgiMvbLn0uKFLu?=
 =?us-ascii?Q?WBEaOpPju0DEmoaI4p2da6jjjBkmi6M3TYdDkbX/+pfzdppGJ8SniOnAJ8H4?=
 =?us-ascii?Q?LyLcPaLe5u2f34AhYMHLePwIaKvu0iJ5iNt/o3Z0txz6gXSL6KV77kpje3Ae?=
 =?us-ascii?Q?HFl8TJ+tj/c96nUzCBD9HIUApsZYzUysqgc20PZOFw914aFRJFfS8rCyaBkd?=
 =?us-ascii?Q?/yzsbR5ZzaxL3C1TPLp8CFYUg8o9fPMz/uftTQ1BsuMR8QUEf6W+DJ5xLjJS?=
 =?us-ascii?Q?0PplwSh6m9zwpA5DfNFbqbv4NRxYMrzzt+mWZiySne9QhdPhmuFFs9pkrgpH?=
 =?us-ascii?Q?5CW/n+oIeJsNUlaqeGg72SBln0KGabqjKod3GeVxBK2ARYX/UZHJ96K9NH6Z?=
 =?us-ascii?Q?3RZUPSzMiydN7UgcUmDfy4yYs29QKMCuhxm3c9wGUwUTKZu9ZWk2gDDakCid?=
 =?us-ascii?Q?+0YghZoD3vF1G55WC3yT0sGEMJ+z6irBomiDrFdIdkcuXbWLRA0PRufkJ7Eq?=
 =?us-ascii?Q?AMoHLgUS1b0vYBpF1eZMrH6Srk1On+jrk/t1hsSxgDO4YLfO7f89Mz9CRTp5?=
 =?us-ascii?Q?FyFjPtU4eE9yNlidy0fBMsoo2Ic1jAdHAk+NJUrhbpg1mzx4+MKwBn6TZOnb?=
 =?us-ascii?Q?Juyx2zVD0F46+3znzFHoO+ySsOnkZVcLCwr+KC2IasZkoJgVfmMThOefTtK8?=
 =?us-ascii?Q?I72lwduyKxfQFYE6QnAgHv+Njslf4TDV?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(7416014)(376014)(921020);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 19:51:07.7732
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 654818fb-f78b-496e-9fa0-08dcbc9a7095
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000044F8.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6949

The PVH entry point is 32bit.  For a 64bit kernel, the entry point must
switch to 64bit mode, which requires a set of page tables.  In the past,
PVH used init_top_pgt.

This works fine when the kernel is loaded at LOAD_PHYSICAL_ADDR, as the
page tables are prebuilt for this address.  If the kernel is loaded at a
different address, they need to be adjusted.

__startup_64() adjusts the prebuilt page tables for the physical load
address, but it is 64bit code.  The 32bit PVH entry code can't call it
to adjust the page tables, so it can't readily be re-used.

64bit PVH entry needs page tables set up for identity map, the kernel
high map and the direct map.  pvh_start_xen() enters identity mapped.
Inside xen_prepare_pvh(), it jumps through a pv_ops function pointer
into the highmap.  The direct map is used for __va() on the initramfs
and other guest physical addresses.

Add a dedicated set of prebuild page tables for PVH entry.  They are
adjusted in assembly before loading.

Add XEN_ELFNOTE_PHYS32_RELOC to indicate support for relocation
along with the kernel's loading constraints.  The maximum load address,
KERNEL_IMAGE_SIZE - 1, is determined by a single pvh_level2_ident_pgt
page.  It could be larger with more pages.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
---
v2:
Use some defines: PTRS_PER_PGD, PTRS_PER_PMD, PAGE_SIZE
Add some spaces around operators and after commas
Include asm/pgtable_64.h
s/LOAD_PHYSICAL_ADDR/_pa(pvh_start_xen)/ in case they differ
---
 arch/x86/platform/pvh/head.S | 104 ++++++++++++++++++++++++++++++++++-
 1 file changed, 103 insertions(+), 1 deletion(-)

diff --git a/arch/x86/platform/pvh/head.S b/arch/x86/platform/pvh/head.S
index 14b4345d9bae..cab168428d94 100644
--- a/arch/x86/platform/pvh/head.S
+++ b/arch/x86/platform/pvh/head.S
@@ -16,6 +16,7 @@
 #include <asm/segment.h>
 #include <asm/asm.h>
 #include <asm/boot.h>
+#include <asm/pgtable_64.h>
 #include <asm/processor-flags.h>
 #include <asm/msr.h>
 #include <asm/nospec-branch.h>
@@ -102,8 +103,47 @@ SYM_CODE_START_LOCAL(pvh_start_xen)
 	btsl $_EFER_LME, %eax
 	wrmsr
 
+	mov %ebp, %ebx
+	subl $_pa(pvh_start_xen), %ebx /* offset */
+	jz .Lpagetable_done
+
+	/* Fixup page-tables for relocation. */
+	leal rva(pvh_init_top_pgt)(%ebp), %edi
+	movl $PTRS_PER_PGD, %ecx
+2:
+	testl $_PAGE_PRESENT, 0x00(%edi)
+	jz 1f
+	addl %ebx, 0x00(%edi)
+1:
+	addl $8, %edi
+	decl %ecx
+	jnz 2b
+
+	/* L3 ident has a single entry. */
+	leal rva(pvh_level3_ident_pgt)(%ebp), %edi
+	addl %ebx, 0x00(%edi)
+
+	leal rva(pvh_level3_kernel_pgt)(%ebp), %edi
+	addl %ebx, (PAGE_SIZE - 16)(%edi)
+	addl %ebx, (PAGE_SIZE - 8)(%edi)
+
+	/* pvh_level2_ident_pgt is fine - large pages */
+
+	/* pvh_level2_kernel_pgt needs adjustment - large pages */
+	leal rva(pvh_level2_kernel_pgt)(%ebp), %edi
+	movl $PTRS_PER_PMD, %ecx
+2:
+	testl $_PAGE_PRESENT, 0x00(%edi)
+	jz 1f
+	addl %ebx, 0x00(%edi)
+1:
+	addl $8, %edi
+	decl %ecx
+	jnz 2b
+
+.Lpagetable_done:
 	/* Enable pre-constructed page tables. */
-	leal rva(init_top_pgt)(%ebp), %eax
+	leal rva(pvh_init_top_pgt)(%ebp), %eax
 	mov %eax, %cr3
 	mov $(X86_CR0_PG | X86_CR0_PE), %eax
 	mov %eax, %cr0
@@ -198,5 +238,67 @@ SYM_DATA_START_LOCAL(early_stack)
 	.fill BOOT_STACK_SIZE, 1, 0
 SYM_DATA_END_LABEL(early_stack, SYM_L_LOCAL, early_stack_end)
 
+#ifdef CONFIG_X86_64
+/*
+ * Xen PVH needs a set of identity mapped and kernel high mapping
+ * page tables.  pvh_start_xen starts running on the identity mapped
+ * page tables, but xen_prepare_pvh calls into the high mapping.
+ * These page tables need to be relocatable and are only used until
+ * startup_64 transitions to init_top_pgt.
+ */
+SYM_DATA_START_PAGE_ALIGNED(pvh_init_top_pgt)
+	.quad   pvh_level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
+	.org    pvh_init_top_pgt + L4_PAGE_OFFSET * 8, 0
+	.quad   pvh_level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
+	.org    pvh_init_top_pgt + L4_START_KERNEL * 8, 0
+	/* (2^48-(2*1024*1024*1024))/(2^39) = 511 */
+	.quad   pvh_level3_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE_NOENC
+SYM_DATA_END(pvh_init_top_pgt)
+
+SYM_DATA_START_PAGE_ALIGNED(pvh_level3_ident_pgt)
+	.quad	pvh_level2_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
+	.fill	511, 8, 0
+SYM_DATA_END(pvh_level3_ident_pgt)
+SYM_DATA_START_PAGE_ALIGNED(pvh_level2_ident_pgt)
+	/*
+	 * Since I easily can, map the first 1G.
+	 * Don't set NX because code runs from these pages.
+	 *
+	 * Note: This sets _PAGE_GLOBAL despite whether
+	 * the CPU supports it or it is enabled.  But,
+	 * the CPU should ignore the bit.
+	 */
+	PMDS(0, __PAGE_KERNEL_IDENT_LARGE_EXEC, PTRS_PER_PMD)
+SYM_DATA_END(pvh_level2_ident_pgt)
+SYM_DATA_START_PAGE_ALIGNED(pvh_level3_kernel_pgt)
+	.fill	L3_START_KERNEL, 8, 0
+	/* (2^48-(2*1024*1024*1024)-((2^39)*511))/(2^30) = 510 */
+	.quad	pvh_level2_kernel_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
+	.quad	0 /* no fixmap */
+SYM_DATA_END(pvh_level3_kernel_pgt)
+
+SYM_DATA_START_PAGE_ALIGNED(pvh_level2_kernel_pgt)
+	/*
+	 * Kernel high mapping.
+	 *
+	 * The kernel code+data+bss must be located below KERNEL_IMAGE_SIZE in
+	 * virtual address space, which is 1 GiB if RANDOMIZE_BASE is enabled,
+	 * 512 MiB otherwise.
+	 *
+	 * (NOTE: after that starts the module area, see MODULES_VADDR.)
+	 *
+	 * This table is eventually used by the kernel during normal runtime.
+	 * Care must be taken to clear out undesired bits later, like _PAGE_RW
+	 * or _PAGE_GLOBAL in some cases.
+	 */
+	PMDS(0, __PAGE_KERNEL_LARGE_EXEC, KERNEL_IMAGE_SIZE / PMD_SIZE)
+SYM_DATA_END(pvh_level2_kernel_pgt)
+
+	ELFNOTE(Xen, XEN_ELFNOTE_PHYS32_RELOC,
+		     .long CONFIG_PHYSICAL_ALIGN;
+		     .long LOAD_PHYSICAL_ADDR;
+		     .long KERNEL_IMAGE_SIZE - 1)
+#endif
+
 	ELFNOTE(Xen, XEN_ELFNOTE_PHYS32_ENTRY,
 	             _ASM_PTR (pvh_start_xen - __START_KERNEL_map))
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 19:51:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 19:51:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777631.1187728 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seK1Y-0003lm-53; Wed, 14 Aug 2024 19:51:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777631.1187728; Wed, 14 Aug 2024 19:51:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seK1Y-0003lc-1A; Wed, 14 Aug 2024 19:51:12 +0000
Received: by outflank-mailman (input) for mailman id 777631;
 Wed, 14 Aug 2024 19:51:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gOS0=PN=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1seK1V-0003Wx-W4
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 19:51:09 +0000
Received: from NAM04-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam04on2062f.outbound.protection.outlook.com
 [2a01:111:f403:2408::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8a244780-5a76-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 21:51:05 +0200 (CEST)
Received: from BYAPR11CA0105.namprd11.prod.outlook.com (2603:10b6:a03:f4::46)
 by MW3PR12MB4379.namprd12.prod.outlook.com (2603:10b6:303:5e::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.17; Wed, 14 Aug
 2024 19:51:00 +0000
Received: from CO1PEPF000075ED.namprd03.prod.outlook.com
 (2603:10b6:a03:f4:cafe::ce) by BYAPR11CA0105.outlook.office365.com
 (2603:10b6:a03:f4::46) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.33 via Frontend
 Transport; Wed, 14 Aug 2024 19:51:00 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1PEPF000075ED.mail.protection.outlook.com (10.167.249.36) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Wed, 14 Aug 2024 19:50:59 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 14:50:59 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 14:50:58 -0500
Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 14 Aug 2024 14:50:57 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8a244780-5a76-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=M4S+Tkg64189qPdFpgyID5/1HMzHppMhJdtuM2ResspSVMuI11W0/XUw6giq1Hq3waGpTGJGVZpeHjikERB3f7W/S6D+4IacxwuaA0a35Dj9sQKncXzWDgurLIIp42+sKJg11sKjHE0KctflSv3pqTKWS/5hrWcYxBmXKiBDlZ6Ix3+7YNun4G9mFMZEsNSTy/LshzOKDi85t3muEkcGIaX4kGCmYcu6RRNdIvCM7vuwfuMz9qzMj7awmOn/NmciiVUM5VzWHS6hEOXiVVMPSj40OK85PUvGLzq5Mefa8fFLgXnS99v8IqOWePQD4+6RUfoEN1Gc2xXLf6SASVNolQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=55nJnnKdgeDx4oUSXrJ9Q+OVSfhHt48p1gn05H5VmsQ=;
 b=ENS3QAfIq8F4Q1ilItiUfhLZkMxOnFj/FHLt0ZuRPu3XpU/lfNg9dKgAPBoRwx82Jb9Wz0Q1kVLmpqbaijQUngj4NLx4n+k81XySKmhzl1iODZX+XKHU/lm1f7lrYvy0vWnit+efHcgIuGd5qUSzPn6C6M0ilfdPbpkZFKYTk3bhyaw2sXnmjO0Q/73dZtCUIQUpEOknFYFTQu86u8DiDJx7nvM8HgUHZVKnSwGGrNwFKDg/hSvk77yI3SLQqJ9M9nEyqznTWBxzi95MuvqY/SFFP34agF3Y2C1408Kk9FOSu/xhhLXRNBVG9CVgt32o+icGksw8f7EVFzUlkQkM0w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=55nJnnKdgeDx4oUSXrJ9Q+OVSfhHt48p1gn05H5VmsQ=;
 b=PFOjQH4E+C7uqEJ9h9uGQTswKzZLLXvvUvvitFu8upS8RaUmsKU52uZFchBLgMCmHuGra/Em2aSUKYTx3QElEg308twoi1hJ62a63zCgG9RB2dSS3hmuJDJXzNnHyiyX6TQUdQ1tSGdpvf6IBMdFj0+5TnYXT4mf6Itl9FL5h7I=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Jason Andryuk <jason.andryuk@amd.com>
To: Juergen Gross <jgross@suse.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Thomas Gleixner <tglx@linutronix.de>, "Ingo
 Molnar" <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, "H. Peter Anvin"
	<hpa@zytor.com>, Stefano Stabellini <sstabellini@kernel.org>, "Oleksandr
 Tyshchenko" <oleksandr_tyshchenko@epam.com>, Paolo Bonzini
	<pbonzini@redhat.com>, Brian Gerst <brgerst@gmail.com>
CC: <xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>, "Jason
 Andryuk" <jason.andryuk@amd.com>
Subject: [PATCH v2 1/5] xen: sync elfnote.h from xen tree
Date: Wed, 14 Aug 2024 15:50:49 -0400
Message-ID: <20240814195053.5564-2-jason.andryuk@amd.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240814195053.5564-1-jason.andryuk@amd.com>
References: <20240814195053.5564-1-jason.andryuk@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000075ED:EE_|MW3PR12MB4379:EE_
X-MS-Office365-Filtering-Correlation-Id: 1f6ea837-02f2-4b07-c4a1-08dcbc9a6bf5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|36860700013|7416014|376014|921020;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?Lmso1Vq4UOfkPrGq12SvOcPpaE1YAAUg90xVFr0cxmnmBUMC6DvTjqgoQo0y?=
 =?us-ascii?Q?jnW1I1E/lMYYuVrvU67Bt+azdbm+CHQE9v90QUnKfdPiG6Rq1nD9fKcK8WE7?=
 =?us-ascii?Q?pcYo3pwjgDDFg7QCEOVaNK3bO+D0VBVNjT7WhZHB/f6fg86TdnnzcL0sy30o?=
 =?us-ascii?Q?qVKKuEZ8qcTMk9t78p74B7yxMimPq/49/+wObE4BN/rTex4rVRcGBqGJVAXK?=
 =?us-ascii?Q?3EEsC6an8Pm3gtWHQEHqO1yWiliVDULLWIfnwmRVlnDiIp/VsdP571xTveOE?=
 =?us-ascii?Q?SboaboIjBpDRqBqFBVrzA6PHUCh1H4wF+LyIqihq//DzStbVX7Q8fQU12iLt?=
 =?us-ascii?Q?GSySyw5XxVScDRs7GZvOH/i63vSeICtGjTnJ9fTxX168YPdn3oeWs2X3ll1M?=
 =?us-ascii?Q?4ANdLvgpCNwfl264HZK1XXbSoGarcGgsroMZXqt2DNXL/Qkn0rSkmX0gSxms?=
 =?us-ascii?Q?Z7Kn4GAKHn807F5pXO9zqgIwZ1D+zDHHO+Ep4fXIYar9AK7BvtW7hs3OyD7g?=
 =?us-ascii?Q?LUVzIRcmr9jXZAlrUHYRJ7V8uB3QGf2EEisCxJ0qsm73ntg5MCXdwa41PoVl?=
 =?us-ascii?Q?4nlSu3Rn05ya+RVoTmgYSGF2VQjx0JbjB4gcS+cSxyr5BzNY+fQcu1aaJm2h?=
 =?us-ascii?Q?mXIQAqjjgCU9ymv0sqAwkTO6QKOpLyEFSY4wtMpMMC6BfRhGdV1sxStiAac7?=
 =?us-ascii?Q?7A5g2o4nCBrpX0GP97eASOAA21gd2bRRcIdMkg+NhiBsvn42xhrPAWGEKXH6?=
 =?us-ascii?Q?/mK5sKyRt0ZkkUGyWZ45OTnbtT8gjdReqSizPI6kJFN/EFZWrvI02fYWN4cp?=
 =?us-ascii?Q?yaTJyYj6a+PwpOl9XJjEX00L0ykfA261A5QVaMzYNyjK/DV1SXpKRW7mvQDd?=
 =?us-ascii?Q?xENXVGNg1LDpz44tzCQlKxFCbusprBeuHKMriTc5RROElWwzfZDT2ilvFoBR?=
 =?us-ascii?Q?ZEPj6/rJC4gYvykDN+vcvs1oMr70I4JNMVf8S6Mt6rgpZ+nQspuvucpLs+E+?=
 =?us-ascii?Q?YleGC0rLcGaWJ3wpNoQ7lrxSczNiESaSy7f38qW2AmeidHe5Z6IOQs6JdtQP?=
 =?us-ascii?Q?b+vLXhmBxYIh8F3EEFqnRfNeCHFF43KVYiYVvYkp+JGvZHnpxmuQeBe6JJe3?=
 =?us-ascii?Q?6x9d7pb9mSiZuNQ07oyz2QQocOGVfAZch2w8K+kkkbRAbwgW6mySw4UK0+u1?=
 =?us-ascii?Q?O9HcF9zGh5WPm0OLM608Xsx+5ebnA67sRug86k7EKtLyNNH/COMydhLPhoO/?=
 =?us-ascii?Q?A+oG9LHSFCktJemuTC/nMeKFMv6rCCugHI8qUOsibnHsk2FUWzGrV4j0p/9c?=
 =?us-ascii?Q?5v+WOCUwHzi1VH+WnMGgHzmPgdmXE6l959F3VhetowMqnjqh+SO8/josSh73?=
 =?us-ascii?Q?YnC4+T3BQB370QETus6zZ51Wkyvq+135jv232iTH7N9H1La5k6Ar65upTMBE?=
 =?us-ascii?Q?9rrbE0XT+b9rd6wTDQYcMudYIZ1UnHRijzA2GnSPwBKpkqU9PfBUhQ=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(7416014)(376014)(921020);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 19:50:59.9990
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 1f6ea837-02f2-4b07-c4a1-08dcbc9a6bf5
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000075ED.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4379

Sync Xen's elfnote.h header from xen.git to pull in the
XEN_ELFNOTE_PHYS32_RELOC define.

xen commit dfc9fab00378 ("x86/PVH: Support relocatable dom0 kernels")

This is a copy except for the removal of the emacs editor config at the
end of the file.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
 include/xen/interface/elfnote.h | 93 +++++++++++++++++++++++++++++++--
 1 file changed, 88 insertions(+), 5 deletions(-)

diff --git a/include/xen/interface/elfnote.h b/include/xen/interface/elfnote.h
index 38deb1214613..918f47d87d7a 100644
--- a/include/xen/interface/elfnote.h
+++ b/include/xen/interface/elfnote.h
@@ -11,7 +11,9 @@
 #define __XEN_PUBLIC_ELFNOTE_H__
 
 /*
- * The notes should live in a SHT_NOTE segment and have "Xen" in the
+ * `incontents 200 elfnotes ELF notes
+ *
+ * The notes should live in a PT_NOTE segment and have "Xen" in the
  * name field.
  *
  * Numeric types are either 4 or 8 bytes depending on the content of
@@ -22,6 +24,8 @@
  *
  * String values (for non-legacy) are NULL terminated ASCII, also known
  * as ASCIZ type.
+ *
+ * Xen only uses ELF Notes contained in x86 binaries.
  */
 
 /*
@@ -52,7 +56,7 @@
 #define XEN_ELFNOTE_VIRT_BASE      3
 
 /*
- * The offset of the ELF paddr field from the acutal required
+ * The offset of the ELF paddr field from the actual required
  * pseudo-physical address (numeric).
  *
  * This is used to maintain backwards compatibility with older kernels
@@ -92,7 +96,12 @@
 #define XEN_ELFNOTE_LOADER         8
 
 /*
- * The kernel supports PAE (x86/32 only, string = "yes" or "no").
+ * The kernel supports PAE (x86/32 only, string = "yes", "no" or
+ * "bimodal").
+ *
+ * For compatibility with Xen 3.0.3 and earlier the "bimodal" setting
+ * may be given as "yes,bimodal" which will cause older Xen to treat
+ * this kernel as PAE.
  *
  * LEGACY: PAE (n.b. The legacy interface included a provision to
  * indicate 'extended-cr3' support allowing L3 page tables to be
@@ -149,7 +158,9 @@
  * The (non-default) location the initial phys-to-machine map should be
  * placed at by the hypervisor (Dom0) or the tools (DomU).
  * The kernel must be prepared for this mapping to be established using
- * large pages, despite such otherwise not being available to guests.
+ * large pages, despite such otherwise not being available to guests. Note
+ * that these large pages may be misaligned in PFN space (they'll obviously
+ * be aligned in MFN and virtual address spaces).
  * The kernel must also be able to handle the page table pages used for
  * this mapping not being accessible through the initial mapping.
  * (Only x86-64 supports this at present.)
@@ -185,9 +196,81 @@
  */
 #define XEN_ELFNOTE_PHYS32_ENTRY 18
 
+/*
+ * Physical loading constraints for PVH kernels
+ *
+ * The presence of this note indicates the kernel supports relocating itself.
+ *
+ * The note may include up to three 32bit values to place constraints on the
+ * guest physical loading addresses and alignment for a PVH kernel.  Values
+ * are read in the following order:
+ *  - a required start alignment (default 0x200000)
+ *  - a minimum address for the start of the image (default 0; see below)
+ *  - a maximum address for the last byte of the image (default 0xffffffff)
+ *
+ * When this note specifies an alignment value, it is used.  Otherwise the
+ * maximum p_align value from loadable ELF Program Headers is used, if it is
+ * greater than or equal to 4k (0x1000).  Otherwise, the default is used.
+ */
+#define XEN_ELFNOTE_PHYS32_RELOC 19
+
 /*
  * The number of the highest elfnote defined.
  */
-#define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_ENTRY
+#define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_RELOC
+
+/*
+ * System information exported through crash notes.
+ *
+ * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_INFO
+ * note in case of a system crash. This note will contain various
+ * information about the system, see xen/include/xen/elfcore.h.
+ */
+#define XEN_ELFNOTE_CRASH_INFO 0x1000001
+
+/*
+ * System registers exported through crash notes.
+ *
+ * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_REGS
+ * note per cpu in case of a system crash. This note is architecture
+ * specific and will contain registers not saved in the "CORE" note.
+ * See xen/include/xen/elfcore.h for more information.
+ */
+#define XEN_ELFNOTE_CRASH_REGS 0x1000002
+
+
+/*
+ * xen dump-core none note.
+ * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_NONE
+ * in its dump file to indicate that the file is xen dump-core
+ * file. This note doesn't have any other information.
+ * See tools/libxc/xc_core.h for more information.
+ */
+#define XEN_ELFNOTE_DUMPCORE_NONE               0x2000000
+
+/*
+ * xen dump-core header note.
+ * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_HEADER
+ * in its dump file.
+ * See tools/libxc/xc_core.h for more information.
+ */
+#define XEN_ELFNOTE_DUMPCORE_HEADER             0x2000001
+
+/*
+ * xen dump-core xen version note.
+ * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_XEN_VERSION
+ * in its dump file. It contains the xen version obtained via the
+ * XENVER hypercall.
+ * See tools/libxc/xc_core.h for more information.
+ */
+#define XEN_ELFNOTE_DUMPCORE_XEN_VERSION        0x2000002
+
+/*
+ * xen dump-core format version note.
+ * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION
+ * in its dump file. It contains a format version identifier.
+ * See tools/libxc/xc_core.h for more information.
+ */
+#define XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION     0x2000003
 
 #endif /* __XEN_PUBLIC_ELFNOTE_H__ */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 19:51:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 19:51:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777633.1187748 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seK1Z-0004EN-Lw; Wed, 14 Aug 2024 19:51:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777633.1187748; Wed, 14 Aug 2024 19:51:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seK1Z-0004EG-Ij; Wed, 14 Aug 2024 19:51:13 +0000
Received: by outflank-mailman (input) for mailman id 777633;
 Wed, 14 Aug 2024 19:51:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gOS0=PN=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1seK1Y-0003Wx-01
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 19:51:12 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on20622.outbound.protection.outlook.com
 [2a01:111:f403:2418::622])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8dd6a284-5a76-11ef-a505-bb4a2ccca743;
 Wed, 14 Aug 2024 21:51:11 +0200 (CEST)
Received: from MW2PR16CA0046.namprd16.prod.outlook.com (2603:10b6:907:1::23)
 by SA1PR12MB8743.namprd12.prod.outlook.com (2603:10b6:806:37c::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Wed, 14 Aug
 2024 19:51:04 +0000
Received: from CO1PEPF000075F0.namprd03.prod.outlook.com
 (2603:10b6:907:1:cafe::ad) by MW2PR16CA0046.outlook.office365.com
 (2603:10b6:907:1::23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend
 Transport; Wed, 14 Aug 2024 19:51:04 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1PEPF000075F0.mail.protection.outlook.com (10.167.249.39) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7828.19 via Frontend Transport; Wed, 14 Aug 2024 19:51:04 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 14:51:03 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 14:51:03 -0500
Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 14 Aug 2024 14:51:02 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8dd6a284-5a76-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=fZ6is2OKSqdYNpys3d1K7VBgqyyAY67MfnY0PjwU3IgcO4WJLdbjIcINGGBAJSc8IqdIGJowJ24vtXJguPj2kVP2WAKFMN8vxAe7sxw6C+kXz7R/ZrXIZnEBqg3NcVyqtOB47+iNfEpd3N87W7+WLdL+xsX+X1od1R1Nsci2USHrlRe/sv7ueRTVdJw0AaEfzfy48ZCRFLO+Xyf/w4Yfy5O0sPVbCz4ZTzlTwYOCUWa9cI6whQRYGUiwLBTxFi/i2pjiSPu6F0hYd4Sz+bP0kNcEgDh0ofdNYh4ei5x7jgxK60ptPAzk3ExzC4FgI1G7erLY8pjnYkIZq3GnbGPsmg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=87Cir7MUe+90Zd8HQRFVV15Z21B672vcEXroWazgwgg=;
 b=ZeAeS989OLttb6QlmfBvI/WoYi0U1R6mMrb0fOEB8YcBjW9VEBVEQCYKkoLHZWT8sQuXa0fYbL4ECr/VZvUV0tM0KB7zCbVEoHpiCf+QDTkNW2qTThSl/Lpd4cOrHACEqE5my7Xq7hVFe+nrqpXIGTJAaTlnHet24eXHxvhq3y94N6uG/TYAG9aaJZ44t6AGbLZpKAE+m0lSgPc6+SXF5hb8NcmHaXLo1BXVHM/ZBBNJ1rPEbyxV05zOS+P4OI/2Cg9egO/JTQ0y+mk+25mD4UleVFCAVlZ9TQ6pUwvRNN8FvrcPbAEOCVcT64T091nzumwuApflbIz+eVYXpCAHIg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=87Cir7MUe+90Zd8HQRFVV15Z21B672vcEXroWazgwgg=;
 b=2N0BS+dlpm/JXu2SbD0i3UpV0TCtpAwk6BYxRwB6S8dgg4+FQypxeHyfcEy7+c3zMcKoTed3iPWweCN/pwDVT13flMK8g+fJcRsO+7KuMxIn5KIbKu5wu0ycfFB4Hkw4LJXt6TVRdyuabXOlwyPdbv0DTKB2b9eW55taluIGNL8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Jason Andryuk <jason.andryuk@amd.com>
To: Juergen Gross <jgross@suse.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Thomas Gleixner <tglx@linutronix.de>, "Ingo
 Molnar" <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, "H. Peter Anvin"
	<hpa@zytor.com>, Stefano Stabellini <sstabellini@kernel.org>, "Oleksandr
 Tyshchenko" <oleksandr_tyshchenko@epam.com>, Paolo Bonzini
	<pbonzini@redhat.com>, Brian Gerst <brgerst@gmail.com>
CC: <xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>, "Jason
 Andryuk" <jason.andryuk@amd.com>
Subject: [PATCH v2 3/5] x86/pvh: Set phys_base when calling xen_prepare_pvh()
Date: Wed, 14 Aug 2024 15:50:51 -0400
Message-ID: <20240814195053.5564-4-jason.andryuk@amd.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240814195053.5564-1-jason.andryuk@amd.com>
References: <20240814195053.5564-1-jason.andryuk@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: jason.andryuk@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000075F0:EE_|SA1PR12MB8743:EE_
X-MS-Office365-Filtering-Correlation-Id: 1bc7d726-6511-4f2d-7f26-08dcbc9a6e6a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|376014|7416014|82310400026|36860700013|921020;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?0vzejcCUK6r8Y8Ulc57rWd6+7qNtKC9BzVRWN4QujDn2uG0Yv8w4aK/9J/RV?=
 =?us-ascii?Q?W6mnTPXhoJcG+AC6Owoojcb/2apBtIhiSZnr2ntiZRMmE35IgLLH9SDXJFs6?=
 =?us-ascii?Q?6A+zVevCfwpbLTQKzWAH0mTjqMxJ1Kf10Fe8NvwaSusmqZQE/iv/RkiloABj?=
 =?us-ascii?Q?C9q7zBuo4h8N9Zm8dmTPIgCUQV7gZlOiKIJBocfCCW4N+kk86Wx/O8KrZlz0?=
 =?us-ascii?Q?H+h0uGIxfp0rR88a4aXZeB+U4J1tCQykfZU6tzf+eepjVh7hgpHQNTmwlEwY?=
 =?us-ascii?Q?shBWVWzzRvTf9hIbp0Bj3tb4OygaO9Wt+PSaHpvkijd9qa8MA5ScPDBfaW5Z?=
 =?us-ascii?Q?O9rBhpANAcJZVg3NPLKVMRi3PvtRokxWFm2TWE6YmRu0odDVWv4o8PpdUNW1?=
 =?us-ascii?Q?i1Fu7c7lLPLuaVwFamgU0XhEilny+WXBglGq5/LtMFPUZV+E3M0RB8z5t3Lc?=
 =?us-ascii?Q?rRUv2hswC0A7ckbW4cNpgh5ofVKUnIAjtH/sJ0Tq36gjfsLZPvma3qeysZvt?=
 =?us-ascii?Q?xZRTMDKDKQQmF+I+LYsKP3aW/mq7eLhx2XQN3ISidIQ3AaLRvp+fJT32pzmj?=
 =?us-ascii?Q?4GTfAkLmlEGhBK9zWSVd6+ZjRiOUspx2wf4qxdIj9PsmLeWyXfkrTaWiRF/b?=
 =?us-ascii?Q?aHRdwl9lzAcpe2S7dSaAT3ecO08+q4N9Ex71FJ7dyKwGYCNa1s8xzL2stIHe?=
 =?us-ascii?Q?R5F9hwg8KKcQqUCcMXc384Ah9oyTdwdOyPTLNNlTfORJzDEyKZuqllRPYi4i?=
 =?us-ascii?Q?AMRZA+Sj4su5jcNflKbRvj4BsGvGyh1kI8sfrO+6nZSytl3Oa/ziGkDqkxVl?=
 =?us-ascii?Q?NNdY542kA+KSPzZUvMP9bOMcCBytTQHfbnAPAuVbcKQxmrCG6pbfk6Q2qNyb?=
 =?us-ascii?Q?pxA6jXXs9b371UkZXnVfFbVe+Kw+1XAIIk2oEcMednC78m6YxqAWEeSfLcL2?=
 =?us-ascii?Q?LRox1gTaRdpcKdlxFpew9LckrF7J7RdHVqBIXMwA98nKTDQ/D03gXtOy1LoT?=
 =?us-ascii?Q?SUkvObYkNo7mi3aV4fiXrNpWXrlJMEtDviabVDB0aLbnarIopUicKoQjG2SQ?=
 =?us-ascii?Q?nWhMTXZtJPx30Jl5BNb2jHvkGqQ5RMtLSCLszCq9yZTYpPOMgBn+8mQ3AIUQ?=
 =?us-ascii?Q?IeICBRZA1bV30ufoY+3uNTkLUtpVMm4It2J0KTIzoJk4/aXEVtMxbWFkC6cn?=
 =?us-ascii?Q?aXdIgFks5h3yD8Lk83AJ+TZLD+cVmwAHsD4dlRQS6gwX0L2rU17QpjYPba4W?=
 =?us-ascii?Q?Ao20vOrjv9f3A0ryCQ/t7sh1owFjVm+z7dSU5iMN0IjCEvqo0dDdp82jO+V5?=
 =?us-ascii?Q?jlG3+/qMF7LABquaQpOls3aOF8AaY9L75Ldyxk2FXfK84OznW9WzagABqc0E?=
 =?us-ascii?Q?GCf1dfJN95Cmfp4wG2qLFWU3FKVqUYHUqm38J4TBJ1BUEOadT/0VEYm8poQJ?=
 =?us-ascii?Q?Uu0jHFi5NZh71/cQmcvKgyaMvRubiD7O?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(82310400026)(36860700013)(921020);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2024 19:51:04.1351
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 1bc7d726-6511-4f2d-7f26-08dcbc9a6e6a
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000075F0.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8743

phys_base needs to be set for __pa() to work in xen_pvh_init() when
finding the hypercall page.  Set it before calling into
xen_prepare_pvh(), which calls xen_pvh_init().  Clear it afterward to
avoid __startup_64() adding to it and creating an incorrect value.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
v2:
Fix comment style
Add Juergen's R-b
s/LOAD_PHYSICAL_ADDR/_pa(pvh_start_xen)/ in case they differ
---
 arch/x86/platform/pvh/head.S | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/x86/platform/pvh/head.S b/arch/x86/platform/pvh/head.S
index ba4d0eab4436..14b4345d9bae 100644
--- a/arch/x86/platform/pvh/head.S
+++ b/arch/x86/platform/pvh/head.S
@@ -125,7 +125,20 @@ SYM_CODE_START_LOCAL(pvh_start_xen)
 	xor %edx, %edx
 	wrmsr
 
+	/*
+	 * Calculate load offset and store in phys_base.  __pa() needs
+	 * phys_base set to calculate the hypercall page in xen_pvh_init().
+	 */
+	movq %rbp, %rbx
+	subq $_pa(pvh_start_xen), %rbx
+	movq %rbx, phys_base(%rip)
 	call xen_prepare_pvh
+	/*
+	 * Clear phys_base.  __startup_64 will *add* to its value,
+	 * so reset to 0.
+	 */
+	xor  %rbx, %rbx
+	movq %rbx, phys_base(%rip)
 
 	/* startup_64 expects boot_params in %rsi. */
 	lea pvh_bootparams(%rip), %rsi
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 20:26:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 20:26:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777683.1187777 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seKa3-0004Py-TN; Wed, 14 Aug 2024 20:26:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777683.1187777; Wed, 14 Aug 2024 20:26:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seKa3-0004Pr-QQ; Wed, 14 Aug 2024 20:26:51 +0000
Received: by outflank-mailman (input) for mailman id 777683;
 Wed, 14 Aug 2024 20:26: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=sQPB=PN=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1seKa2-0004Pl-NY
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 20:26:50 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 86cc453f-5a7b-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 22:26:47 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:1f07:15ff:0:0:0:f7])
 by mailhost.m5p.com (8.18.1/8.17.1) with ESMTPS id 47EKQaWC036496
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Wed, 14 Aug 2024 16:26:42 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.18.1/8.15.2/Submit) id 47EKQZ9p036495;
 Wed, 14 Aug 2024 13:26:35 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 86cc453f-5a7b-11ef-8776-851b0ebba9a2
Date: Wed, 14 Aug 2024 13:26:35 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: =?iso-8859-1?Q?J=FCrgen_Gro=DF?= <jgross@suse.com>
Cc: Andrei Semenov <andrei.semenov@vates.tech>, xen-devel@lists.xenproject.org,
        Andrew Cooper <andrew.cooper3@citrix.com>,
        Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Subject: Re: AMD EPYC virtual network performances
Message-ID: <Zr0S-2QBf3lkBkfS@mattapan.m5p.com>
References: <959bbf84-24da-4da3-a059-dc1aa32b27ef@vates.tech>
 <352bba40-27fc-416b-985f-20e66c0c4b72@suse.com>
 <Zrqykdarr7JHaeOZ@mattapan.m5p.com>
 <ab4ca68e-ec1b-467f-9b89-38f63cc19b7c@suse.com>
 <ZruckufSjT0GkpJt@mattapan.m5p.com>
 <d556e168-8542-4b93-81a9-a7054b5b69ba@suse.com>
 <Zrvf5wgm6xEI63x2@mattapan.m5p.com>
 <e95ab71d-b985-4ab7-994b-1c562efd5f9f@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <e95ab71d-b985-4ab7-994b-1c562efd5f9f@suse.com>
X-Spam-Status: No, score=0.3 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=4.0.1
X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on mattapan.m5p.com

On Wed, Aug 14, 2024 at 08:15:38AM +0200, Jrgen Gro wrote:
> On 14.08.24 00:36, Elliott Mitchell wrote:
> > On Tue, Aug 13, 2024 at 08:55:42PM +0200, Jrgen Gro wrote:
> > > On 13.08.24 19:49, Elliott Mitchell wrote:
> > > > 
> > > > There is a possibility spurious interrupts are being turned into spurious
> > > > events by the back-end drivers.
> > > 
> > > No, I don't think so.
> > > 
> > > > Jrgen Gro, what is the performance impact of "iommu=debug"?  Seems to
> > > > mostly cause more reporting and have minimal/no performance effect.
> > > 
> > > I guess you are referring to the Xen option? I'm no expert in this
> > > area.
> > 
> > Drat.  I haven't noticed much, which would match with simply enabling a
> > bunch of debugging printk()s (alas I'm not monitoring performance closely
> > enough to be sure).  Guess I wait for Andrei Semenov to state a comfort
> > level with trying "iommu=debug".
> 
> You didn't answer my question.

I guess I did not explicitly do so.  I was referring to the Xen
command-line option.  I was asking in the hope it might be reasonable
for Andrei Semenov to run with it on for some time.


Come to think of it, I now wonder whether "iommu=no-intremap" is part of
the recipe for having the messages I've seen show up.

I can now state they appear to correlate with activity in the HVM domain
(which is associated with network/vif activity) which also increases
Linux's spurious interrupt counters.
I cannot yet state the HVM domain is the exclusive source of these
messages.  I am able to run with that domain shutdown, so I've done so.
If no new messages show up that will seem to attribute those to the HVM
domain.

The other interesting bit is "iommu=no-intremap" seems to have made the
messages associated with the software RAID1 issue disappear (possibly
partially, but not fully mitigated it too).  My observations seem
insufficient to indicate whether or not these are distinct issues
though.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Wed Aug 14 21:01:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 21:01:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777704.1187788 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seL76-0002ch-HU; Wed, 14 Aug 2024 21:01:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777704.1187788; Wed, 14 Aug 2024 21:01:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seL76-0002ca-ED; Wed, 14 Aug 2024 21:01:00 +0000
Received: by outflank-mailman (input) for mailman id 777704;
 Wed, 14 Aug 2024 21:00:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1seL75-0002cU-Cb
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 21:00:59 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1seL74-0001pQ-Q9; Wed, 14 Aug 2024 21:00:58 +0000
Received: from 54-240-197-224.amazon.com ([54.240.197.224]
 helo=dev-dsk-jgrall-1b-035652ec.eu-west-1.amazon.com)
 by xenbits.xenproject.org with esmtpsa
 (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1seL74-0006gF-Dc; Wed, 14 Aug 2024 21:00:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:
	Subject:Cc:To:From; bh=2S8P9lWhk8bwnpOkGtCpc7nBvi39fV4oVc25z4uXCpA=; b=Nxz7WK
	GydekKWdML94vt3St26CbHKb6TajgC2t67drbUdDMuzd4ZS2p61D4YJq6Gl0uNWf66P2xcwl6Mh9m
	nNA657KDnc6QwWKKOX/MRStIfiDl3IBEgFhGRarzDFL2hqO7MZJKus6/kI12DZ/uZJhUr3sdEEz2s
	1E5RbSwVI/k=;
From: Julien Grall <julien@xen.org>
To: xen-devel@lists.xenproject.org
Cc: julien@xen.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: [PATCH] xen/arm64: Hide FEAT_SME
Date: Wed, 14 Aug 2024 22:00:54 +0100
Message-Id: <20240814210054.67520-1-julien@xen.org>
X-Mailer: git-send-email 2.40.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Newer hardware may support FEAT_SME. Xen doesn't have any knowledge but
it will still expose the feature to the VM. If the OS is trying to use
SME, then it will crash.

Solve by hiding FEAT_SME.

Signed-off-by: Julien Grall <julien@xen.org>

---

The current approach used to create the domain cpuinfo is to hide
(i.e. a denylist) what we know Xen is not supporting. The drawback
with this approach is for newly introduced feature, Xen will expose it
by default.

If a kernel is trying to use it then it will crash. I can't really
make my mind whether it would be better to expose only what we support
(i.e. use an allowlist).

AFAICT, there is no security concerns with the current approach because
ID_* registers are not a way to tell the kernel which features are
supported. A guest kernel could still try to access the new registers.

So the most annoying bits is that booting Xen on a new HW may lead to
an OS crashing.
---
 xen/arch/arm/cpufeature.c             | 3 +++
 xen/arch/arm/include/asm/cpufeature.h | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/cpufeature.c b/xen/arch/arm/cpufeature.c
index ef77473bf8e3..b45dbe3c668d 100644
--- a/xen/arch/arm/cpufeature.c
+++ b/xen/arch/arm/cpufeature.c
@@ -208,6 +208,9 @@ static int __init create_domain_cpuinfo(void)
     domain_cpuinfo.pfr64.sve = 0;
     domain_cpuinfo.zfr64.bits[0] = 0;
 
+    /* Hide SMT support as Xen does not support it */
+    domain_cpuinfo.pfr64.sme = 0;
+
     /* Hide MTE support as Xen does not support it */
     domain_cpuinfo.pfr64.mte = 0;
 
diff --git a/xen/arch/arm/include/asm/cpufeature.h b/xen/arch/arm/include/asm/cpufeature.h
index c95582044a8a..969e043f5bda 100644
--- a/xen/arch/arm/include/asm/cpufeature.h
+++ b/xen/arch/arm/include/asm/cpufeature.h
@@ -207,7 +207,9 @@ struct cpuinfo_arm {
             unsigned long mte:4;
             unsigned long ras_frac:4;
             unsigned long mpam_frac:4;
-            unsigned long __res1:44;
+            unsigned long __res1:4;
+            unsigned long sme:4;
+            unsigned long __res2:36;
         };
     } pfr64;
 
-- 
2.40.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 21:14:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 21:14:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777715.1187799 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seLKD-00051d-LE; Wed, 14 Aug 2024 21:14:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777715.1187799; Wed, 14 Aug 2024 21:14:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seLKD-00051W-GH; Wed, 14 Aug 2024 21:14:33 +0000
Received: by outflank-mailman (input) for mailman id 777715;
 Wed, 14 Aug 2024 21:14:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seLKC-00051M-DR; Wed, 14 Aug 2024 21:14:32 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seLKC-00023J-AK; Wed, 14 Aug 2024 21:14:32 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seLKB-0002w0-PI; Wed, 14 Aug 2024 21:14:31 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1seLKB-0002kY-Ou; Wed, 14 Aug 2024 21:14:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Ks3PxoZRrfX7gVkyXvFXSIeOPr9GQu7sk6tcjv7O0ZY=; b=ABESJuwU3IDt0SktOneUAymjbZ
	Il5ovJQhwluyeGfospl/iKww25N4flxPFH0G+1KWdNAZKGyiAVOZ2yCO4dGhvrqLpVYHcyQSLkI0e
	Zh9wAapckWWBA3/SILbsQCpkMdeCQxCu6J0PEN2E77XW/IPpUBx+zan214UR0cvX/tGQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187235-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187235: trouble: broken/fail/pass
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-libvirt-vhd:<job status>:broken:regression
    xen-unstable:test-armhf-armhf-libvirt-vhd:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:guest-start.2:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=98a462f8b169f93ab7463023f0ed94575f8225b4
X-Osstest-Versions-That:
    xen=98a462f8b169f93ab7463023f0ed94575f8225b4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 14 Aug 2024 21:14:31 +0000

flight 187235 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187235/

Failures and problems with tests :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-libvirt-vhd    <job status>                 broken

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-libvirt-vhd  5 host-install(5)          broken pass in 187224
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 187224
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 21 guest-start.2 fail pass in 187224

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check fail in 187224 never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check fail in 187224 never pass
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187224
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187224
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187224
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187224
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187224
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187224
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  98a462f8b169f93ab7463023f0ed94575f8225b4
baseline version:
 xen                  98a462f8b169f93ab7463023f0ed94575f8225b4

Last test of basis   187235  2024-08-14 01:53:53 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             fail    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 broken  
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-armhf-armhf-libvirt-vhd broken
broken-step test-armhf-armhf-libvirt-vhd host-install(5)

Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Wed Aug 14 21:31:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 21:31:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777726.1187807 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seLay-0000Ac-VV; Wed, 14 Aug 2024 21:31:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777726.1187807; Wed, 14 Aug 2024 21:31:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seLay-0000AV-SV; Wed, 14 Aug 2024 21:31:52 +0000
Received: by outflank-mailman (input) for mailman id 777726;
 Wed, 14 Aug 2024 21:31:51 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=2uER=PN=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1seLax-0000AO-J0
 for xen-devel@lists.xenproject.org; Wed, 14 Aug 2024 21:31:51 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9d1d439f-5a84-11ef-8776-851b0ebba9a2;
 Wed, 14 Aug 2024 23:31:49 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a77ec5d3b0dso51254966b.0
 for <xen-devel@lists.xenproject.org>; Wed, 14 Aug 2024 14:31:49 -0700 (PDT)
Received: from [192.168.1.10] (host-92-26-98-202.as13285.net. [92.26.98.202])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83839356besm3569766b.99.2024.08.14.14.31.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 14 Aug 2024 14:31:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9d1d439f-5a84-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723671108; x=1724275908; 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=cCAs+flEzkMP9uMnoIeWTlCC7oMnvigbN/95tJC6SAg=;
        b=FL40m3valZhOu0Bmj6dNWt5O0Nno+LAf9KAbzn29WuqjYFfp4sDewBBWzTB2wejeoE
         NwOggiOL65mrl1mX/kJWOee+pT+GfXmJTFpkuMoEsNnFI9CyNIfB6xfCgFE84tDYJPk4
         38hw9dcNMA8kU5whubxxu9DT1C4ESZaOFlghc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723671108; x=1724275908;
        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=cCAs+flEzkMP9uMnoIeWTlCC7oMnvigbN/95tJC6SAg=;
        b=H8zUR0UGAtLRZTIGBSgAWZBffYMGtcUiU2C3qJTf5eWAkC2EbjZ49yeE1wY8W+HhI+
         vNuW2tEIDHsdIdHVetQ81jMwMTmsAC+tGHsiTMGrLY6QBkMqqSQAeeGeWI591TIvpLKo
         owRNyvsFwrM//+9pTUlXmmK20Gh1He+KkcnJgOFtWAxtwtRkB7UtImDSdMAGZytpGCwk
         MgJuWdhuundjh4kMaXjtAouGPh+p8d+7UurrwNZZwLy79FusHL1BJCIzgdfH5Bjq4NOW
         ylO8/SGjHk8dxiXQOTJz1w7WySbezXuuJ2b1GyusNcvtZjK+TC39Z/7rD9JjAYhx08yn
         WuTw==
X-Forwarded-Encrypted: i=1; AJvYcCVllVhQ5xpUqxUwv1WmERSZKYmIpmEnfT2nYUBFeNdJm7Gilgphz7o3cDlD8xY09DA7tly4sff4otq5u86oCrSM005F3G1+1lwHvuwHbkU=
X-Gm-Message-State: AOJu0YxN9VazFB4LtXdsHOEAkjpxmA6hXk7yaNCgtR/t0whd166VY4f+
	epS3t6YUoDDpCGXm9MxtJW57RzKqLtLnbOIf0eW+M+v3a3ch4TxJSKo3crzYVNA=
X-Google-Smtp-Source: AGHT+IFED6irtT9uAvufe9/SeOnEhI+28U4dIRi8bMvuBHjnxZSgj/tvcIDHOgDyhEqBIE2VenO+BA==
X-Received: by 2002:a17:907:7e8e:b0:a77:af6b:d1a8 with SMTP id a640c23a62f3a-a83670889b9mr267591366b.64.1723671108370;
        Wed, 14 Aug 2024 14:31:48 -0700 (PDT)
Message-ID: <2d0f0c05-1ee5-4972-868d-c94e45f71044@citrix.com>
Date: Wed, 14 Aug 2024 22:31:47 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 0/5] Support EFI multiboot loading using PE binary
To: Frediano Ziglio <frediano.ziglio@cloud.com>,
 xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
References: <20240814083428.3012-1-frediano.ziglio@cloud.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20240814083428.3012-1-frediano.ziglio@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 14/08/2024 9:34 am, Frediano Ziglio wrote:
> Testing this feature in preparation for UEFI CA memory mitigation
> requirements I found some issues causing the loading to fail and
> other minor issues.
> Details in series commit messages.
> This is adding an additional way to boot Xen, using GrUB2+EFI
> (xen.efi:__efi64_mb2_start).
>
> Changes since v1:
> - Changed title, apparently this is a kind of new mode;
> - address lot of comments (see "Changes" in other messages).
>
> Frediano Ziglio (5):
>   x86: Put trampoline in .init.data section
>   x86: Set xen_phys_start and trampoline_xen_phys_start earlier
>   x86: Force proper gdt_boot_base setting
>   x86: Compensate relocation in case of EFI
>   x86: Rollback relocation in case of EFI multiboot

Patch 1 is one part of supporting NX_COMPAT in the PE header, which is a
requirement from Microsoft in order to be signed.

It has nothing to do with the rest of the series, which is about making
the EFI+MB2 entry point work.

It would have helped a lot to not have mixed these together in a series
claiming to only be about the latter.


Now, as indicated in our documentation (yes - this is one of the very
few I have managed to get committed),
https://xenbits.xen.org/docs/latest/hypervisor-guide/x86/how-xen-boots.html#xen-efi

The MB2 tags existing in xen.efi is a known thing but came as a surprise
to some.  It exists because xen.efi is a strict superset of xen.gz,
including head.S which contains the MB1/MB2 tags.

Nevertheless, if we want to make EFI+MB2 work, that's fine, but the
final patch in the series needs to be one updating the docs to reflect
the new behaviour of Xen.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 14 22:39:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Aug 2024 22:39:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777741.1187818 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seMeG-0001vP-T4; Wed, 14 Aug 2024 22:39:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777741.1187818; Wed, 14 Aug 2024 22:39:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seMeG-0001vI-PL; Wed, 14 Aug 2024 22:39:20 +0000
Received: by outflank-mailman (input) for mailman id 777741;
 Wed, 14 Aug 2024 22:39:19 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seMeF-0001v8-6V; Wed, 14 Aug 2024 22:39:19 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seMeF-0003V7-0V; Wed, 14 Aug 2024 22:39:19 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seMeE-0004x5-KE; Wed, 14 Aug 2024 22:39:18 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1seMeE-0006Rd-Jh; Wed, 14 Aug 2024 22:39:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=uG/AlpT+vvi7l+dWYD5iNOC25udsJh6/Bs8MKKKxqJw=; b=l91RB9yG5pVAfT/nYlzPY21p3C
	LHsfimNttvSjKHHo9lgvmeR62cj1Orx3EbsFHHQ+MVntoTsMQEdoxB97RHdTRClzYspQ1IMjJquz+
	zMkQzsaMlJZue3r2G19apRmt7s/49PG4s7ZlomCMDLJz2IUIqXVmu2Vl8yCCNW+aG9LE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187238-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187238: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=03852c85af3c531d1459573341537d1cc8e4b3c6
X-Osstest-Versions-That:
    libvirt=1b797e64218b088467c104122a52e84e2062a351
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 14 Aug 2024 22:39:18 +0000

flight 187238 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187238/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187221
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 libvirt              03852c85af3c531d1459573341537d1cc8e4b3c6
baseline version:
 libvirt              1b797e64218b088467c104122a52e84e2062a351

Last test of basis   187221  2024-08-13 04:22:42 Z    1 days
Testing same since   187238  2024-08-14 04:19:02 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Peter Krempa <pkrempa@redhat.com>
  Tim Wiederhake <twiederh@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   1b797e6421..03852c85af  03852c85af3c531d1459573341537d1cc8e4b3c6 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 00:19:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 00:19:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777753.1187827 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seODN-0000Wq-HJ; Thu, 15 Aug 2024 00:19:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777753.1187827; Thu, 15 Aug 2024 00:19:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seODN-0000Wj-EY; Thu, 15 Aug 2024 00:19:41 +0000
Received: by outflank-mailman (input) for mailman id 777753;
 Thu, 15 Aug 2024 00:19:40 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7zbS=PO=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1seODL-0000Wd-Kr
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 00:19:39 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0cd04e24-5a9c-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 02:19:36 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id B45DDCE1B04;
 Thu, 15 Aug 2024 00:19:31 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E260C116B1;
 Thu, 15 Aug 2024 00:19:28 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0cd04e24-5a9c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723681170;
	bh=9IHO+IHlt+Bd47+QggcZMinljdOBWoC9h40/wIqMC3Q=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=XPFlIutVOqaRrr2IAnjhalrqcHb28oShUtLiBvz3nfby2tNneHmk9qHlJ5Mf3X4Eb
	 AaR8unaUKM855Yuy6diNyiFCh/VX76I8MytwSWhGUYSHN6kBvKU0BOwC+E/Z+wRAZW
	 /E+qDqkGayTP/xIRtNgQj5Uu0B5Xv5s5zHcLl3nF1vud4Ta/4DnhelOkrgXsJdt7Rk
	 iMXX2etVZna7PdcEcceBxk7nLJYHQugvzhB9cC7Khy+wJX7DRdKblR1iU5xmgPaDnk
	 7hAib7vMmXl6cBwk8lpP8zqsK0xlfgixqqtwn8QirijW1Orl6D8uuVXgK3c7bGEOcw
	 xHqJIIjzdzVhQ==
Date: Wed, 14 Aug 2024 17:19:28 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, qemu-devel@nongnu.org, 
    anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, 
    alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, 
    edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, 
    "Michael S. Tsirkin" <mst@redhat.com>, 
    Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, 
    Paolo Bonzini <pbonzini@redhat.com>, 
    Richard Henderson <richard.henderson@linaro.org>, 
    Eduardo Habkost <eduardo@habkost.net>
Subject: Re: [PATCH v1 09/10] hw/i386/xen: Add a Xen PVH x86 machine
In-Reply-To: <ZrzSRPPNYxeh98J4@zapote>
Message-ID: <alpine.DEB.2.22.394.2408141718510.298534@ubuntu-linux-20-04-desktop>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com> <20240812130606.90410-10-edgar.iglesias@gmail.com> <alpine.DEB.2.22.394.2408121840230.298534@ubuntu-linux-20-04-desktop> <ZrzSRPPNYxeh98J4@zapote>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 14 Aug 2024, Edgar E. Iglesias wrote:
> On Mon, Aug 12, 2024 at 06:48:52PM -0700, Stefano Stabellini wrote:
> > On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> > > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> > > 
> > > This adds a Xen PVH x86 machine based on the PVH Common
> > > module used by the ARM PVH machine.
> > > 
> > > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> > > ---
> > >  hw/i386/xen/meson.build |   1 +
> > >  hw/i386/xen/xen-pvh.c   | 196 ++++++++++++++++++++++++++++++++++++++++
> > >  2 files changed, 197 insertions(+)
> > >  create mode 100644 hw/i386/xen/xen-pvh.c
> > > 
> > > diff --git a/hw/i386/xen/meson.build b/hw/i386/xen/meson.build
> > > index 3f0df8bc07..c73c62b8e3 100644
> > > --- a/hw/i386/xen/meson.build
> > > +++ b/hw/i386/xen/meson.build
> > > @@ -4,6 +4,7 @@ i386_ss.add(when: 'CONFIG_XEN', if_true: files(
> > >  ))
> > >  i386_ss.add(when: ['CONFIG_XEN', xen], if_true: files(
> > >    'xen-hvm.c',
> > > +  'xen-pvh.c',
> > >  ))
> > >  
> > >  i386_ss.add(when: 'CONFIG_XEN_BUS', if_true: files(
> > > diff --git a/hw/i386/xen/xen-pvh.c b/hw/i386/xen/xen-pvh.c
> > > new file mode 100644
> > > index 0000000000..9c3d3fc58d
> > > --- /dev/null
> > > +++ b/hw/i386/xen/xen-pvh.c
> > > @@ -0,0 +1,196 @@
> > > +/*
> > > + * QEMU Xen PVH x86 Machine
> > > + *
> > > + * Copyright (c) 2024 Advanced Micro Devices, Inc.
> > > + * Written by Edgar E. Iglesias <edgar.iglesias@amd.com>
> > > + *
> > > + * SPDX-License-Identifier: GPL-2.0-or-later
> > > + */
> > > +
> > > +#include "qemu/osdep.h"
> > > +#include "qapi/error.h"
> > > +#include "qapi/visitor.h"
> > > +#include "qemu/error-report.h"
> > > +#include "hw/boards.h"
> > > +#include "sysemu/sysemu.h"
> > > +#include "hw/xen/arch_hvm.h"
> > > +#include "hw/xen/xen.h"
> > > +#include "hw/xen/xen-pvh-common.h"
> > > +
> > > +#define TYPE_XEN_PVH_X86  MACHINE_TYPE_NAME("xenpvh")
> > > +OBJECT_DECLARE_SIMPLE_TYPE(XenPVHx86State, XEN_PVH_X86)
> > > +
> > > +#define PVH_MAX_CPUS 128
> > > +
> > > +struct XenPVHx86State {
> > > +    /*< private >*/
> > > +    MachineState parent;
> > > +
> > > +    DeviceState *cpu[PVH_MAX_CPUS];
> > > +    XenPVHCommonState pvh;
> > > +
> > > +    /*
> > > +     * We provide these properties to allow Xen to move things to other
> > > +     * addresses for example when users need to accomodate the memory-map
> > > +     * for 1:1 mapped devices/memory.
> > > +     */
> > > +    struct {
> > > +        MemMapEntry ram_low, ram_high;
> > > +        MemMapEntry pci_ecam, pci_mmio, pci_mmio_high;
> > 
> > Can we use the same properties already present under XenPVHCommonState?
> > 
> > 
> > 
> > > +    } cfg;
> > > +};
> > > +
> > > +static void xenpvh_cpu_new(MachineState *ms,
> > > +                           XenPVHx86State *xp,
> > > +                           int cpu_idx,
> > > +                           int64_t apic_id)
> > > +{
> > > +    Object *cpu = object_new(ms->cpu_type);
> > > +
> > > +    object_property_add_child(OBJECT(ms), "cpu[*]", cpu);
> > > +    object_property_set_uint(cpu, "apic-id", apic_id, &error_fatal);
> > > +    qdev_realize(DEVICE(cpu), NULL, &error_fatal);
> > > +    object_unref(cpu);
> > > +
> > > +    xp->cpu[cpu_idx] = DEVICE(cpu);
> > 
> > 
> > Why do we need to create CPU devices in QEMU given that we are only
> > doing device emulation? I guess it is because ....
> > 
> > 
> > 
> > > +}
> > > +
> > > +static void xenpvh_init(MachineState *ms)
> > > +{
> > > +    XenPVHx86State *xp = XEN_PVH_X86(ms);
> > > +    const struct {
> > > +        const char *name;
> > > +        MemMapEntry *map;
> > > +    } map[] = {
> > > +        { "ram-low", &xp->cfg.ram_low },
> > > +        { "ram-high", &xp->cfg.ram_high },
> > > +        { "pci-ecam", &xp->cfg.pci_ecam },
> > > +        { "pci-mmio", &xp->cfg.pci_mmio },
> > > +        { "pci-mmio-high", &xp->cfg.pci_mmio_high },
> > > +    };
> > > +    int i;
> > > +
> > > +    object_initialize_child(OBJECT(ms), "pvh", &xp->pvh, TYPE_XEN_PVH_COMMON);
> > > +    object_property_set_int(OBJECT(&xp->pvh), "max-cpus", ms->smp.max_cpus,
> > > +                            &error_abort);
> > > +    object_property_set_int(OBJECT(&xp->pvh), "ram-size", ms->ram_size,
> > > +                            &error_abort);
> > > +
> > > +    for (i = 0; i < ARRAY_SIZE(map); i++) {
> > > +        g_autofree char *base_name = g_strdup_printf("%s-base", map[i].name);
> > > +        g_autofree char *size_name = g_strdup_printf("%s-size", map[i].name);
> > > +
> > > +        object_property_set_int(OBJECT(&xp->pvh), base_name, map[i].map->base,
> > > +                                 &error_abort);
> > > +        object_property_set_int(OBJECT(&xp->pvh), size_name, map[i].map->size,
> > > +                                 &error_abort);
> > > +    }
> > > +
> > > +    /* GSI's 16 - 20 are used for legacy PCIe INTX IRQs.  */
> > > +    object_property_set_int(OBJECT(&xp->pvh), "pci-intx-irq-base", 16,
> > > +                            &error_abort);
> > > +
> > > +    sysbus_realize(SYS_BUS_DEVICE(&xp->pvh), &error_abort);
> > > +
> > > +    /* Create dummy cores. This will indirectly create the APIC MSI window.  */
> > 
> > ... of the APIC MSI window ?
> 
> 
> Yes, exactly. I did have a first version without the CPUs that only had
> the MSI window but there was a bit of disentanglement needed and some
> other issue that I forgot. Note that with TCG disabled, this doesn't
> have the any CPU emulation so it doesn't affect our small PVH config
> very much. I could look into the MSI windows again though.

no, I think this is OK, especially if the number of CPUs is accurate


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 00:29:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 00:29:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777764.1187838 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seOMf-00024c-D5; Thu, 15 Aug 2024 00:29:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777764.1187838; Thu, 15 Aug 2024 00:29:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seOMf-00024V-AC; Thu, 15 Aug 2024 00:29:17 +0000
Received: by outflank-mailman (input) for mailman id 777764;
 Thu, 15 Aug 2024 00:29:16 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7zbS=PO=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1seOMe-00024P-UQ
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 00:29:16 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 65a082fe-5a9d-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 02:29:14 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id AEDD261291;
 Thu, 15 Aug 2024 00:29:12 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02AB3C116B1;
 Thu, 15 Aug 2024 00:29:10 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 65a082fe-5a9d-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723681752;
	bh=h9FXGgG9EJcZD/S0va3nNedGjOMTJFMu5BAD+EEQ1jI=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=EIdtPxXvMVu3OPwhWOlXrPnJP6qsS7qYf/M87i08dFyo4izAf8uiLShZsoL/oXLpw
	 Es0Z9SSdXpC0/X6q3kx92tdl+ZkZguEcGZlE/UYmjwKuw16EzRWsdIj1KaXfwSFsFK
	 al9+lzRx8dgRhlQONee93rsV7uQeC6Z6YToQL4CnLK6RujgjzEBk7XnV/H7Dc9xK34
	 X9LEgvLDtYKP1fhJ3+14jl1HNDWCWS4VO8ZJv/c9kCUsqKfolzpOhEzO4gAuf8MosJ
	 /R9/YKfnfyC5u7mFEOfF1OpkGFrFdMu4YQ/dFsGW3tI5NpS0HJT2f2QKbl4QLus+8E
	 puiEK8DgFs4Xw==
Date: Wed, 14 Aug 2024 17:29:10 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, qemu-devel@nongnu.org, 
    anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, 
    alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, 
    edgar.iglesias@amd.com, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v1 08/10] hw/xen: pvh-common: Add support for creating
 PCIe/GPEX
In-Reply-To: <ZrzMkI5jGUtXU2qA@zapote>
Message-ID: <alpine.DEB.2.22.394.2408141717300.298534@ubuntu-linux-20-04-desktop>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com> <20240812130606.90410-9-edgar.iglesias@gmail.com> <alpine.DEB.2.22.394.2408121822370.298534@ubuntu-linux-20-04-desktop> <ZrzMkI5jGUtXU2qA@zapote>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 14 Aug 2024, Edgar E. Iglesias wrote:
> On Mon, Aug 12, 2024 at 06:48:37PM -0700, Stefano Stabellini wrote:
> > On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> > > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> > > 
> > > Add support for optionally creating a PCIe/GPEX controller.
> > > 
> > > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> > > ---
> > >  hw/xen/xen-pvh-common.c         | 66 +++++++++++++++++++++++++++++++++
> > >  include/hw/xen/xen-pvh-common.h | 10 ++++-
> > >  2 files changed, 75 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
> > > index 69a2dbdb6d..b1432e4bd9 100644
> > > --- a/hw/xen/xen-pvh-common.c
> > > +++ b/hw/xen/xen-pvh-common.c
> > > @@ -120,6 +120,59 @@ static void xen_enable_tpm(XenPVHCommonState *s)
> > >  }
> > >  #endif
> > >  
> > > +static void xen_set_pci_intx_irq(void *opaque, int irq, int level)
> > > +{
> > > +    if (xen_set_pci_intx_level(xen_domid, 0, 0, 0, irq, level)) {
> > 
> > Looking at the implementation of XEN_DMOP_set_pci_intx_level in
> > xen/arch/x86/hvm/dm.c, it looks like the device parameter of
> > xen_set_pci_intx_level is required?
> 
> Yes, by setting device = 0, we're bypassing the irq swizzling in Xen.
> I'll try to clarify below.
> 
> 
> > 
> > 
> > > +        error_report("xendevicemodel_set_pci_intx_level failed");
> > > +    }
> > > +}
> > > +
> > > +static inline void xenpvh_gpex_init(XenPVHCommonState *s,
> > > +                                    MemoryRegion *sysmem,
> > > +                                    hwaddr ecam_base, hwaddr ecam_size,
> > > +                                    hwaddr mmio_base, hwaddr mmio_size,
> > > +                                    hwaddr mmio_high_base,
> > > +                                    hwaddr mmio_high_size,
> > > +                                    int intx_irq_base)
> > > +{
> > > +    MemoryRegion *ecam_reg;
> > > +    MemoryRegion *mmio_reg;
> > > +    DeviceState *dev;
> > > +    int i;
> > > +
> > > +    object_initialize_child(OBJECT(s), "gpex", &s->pci.gpex,
> > > +                            TYPE_GPEX_HOST);
> > > +    dev = DEVICE(&s->pci.gpex);
> > > +    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
> > > +
> > > +    ecam_reg = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
> > > +    memory_region_add_subregion(sysmem, ecam_base, ecam_reg);
> > 
> > I notice we don't use ecam_size anywhere? Is that because the size is
> > standard?
> 
> Yes. we could remove the size property, having it slightly simplifies the
> prop setting code (keeping these memmap prop-pairs alike) but it's not a big deal.

Not a big deal either way, up to you


> > > +    mmio_reg = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1);
> > > +
> > > +    if (mmio_size) {
> > > +        memory_region_init_alias(&s->pci.mmio_alias, OBJECT(dev), "pcie-mmio",
> > > +                                 mmio_reg, mmio_base, mmio_size);
> > > +        memory_region_add_subregion(sysmem, mmio_base, &s->pci.mmio_alias);
> > > +    }
> > > +
> > > +    if (mmio_high_size) {
> > > +        memory_region_init_alias(&s->pci.mmio_high_alias, OBJECT(dev),
> > > +                "pcie-mmio-high",
> > > +                mmio_reg, mmio_high_base, mmio_high_size);
> > > +        memory_region_add_subregion(sysmem, mmio_high_base,
> > > +                &s->pci.mmio_high_alias);
> > > +    }
> > > +
> > > +    for (i = 0; i < GPEX_NUM_IRQS; i++) {
> > > +        qemu_irq irq = qemu_allocate_irq(xen_set_pci_intx_irq, s, i);
> > > +
> > > +        sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, irq);
> > > +        gpex_set_irq_num(GPEX_HOST(dev), i, intx_irq_base + i);
> > > +        xen_set_pci_link_route(i, intx_irq_base + i);
> > 
> > xen_set_pci_link_route is not currently implemented on ARM?
> > 
> > Looking at hw/i386/pc_piix.c:piix_intx_routing_notifier_xen it seems
> > that the routing is much more complex over there. But looking at other
> > machines that use GPEX such as hw/arm/virt.c it looks like the routing
> > is straightforward the same way as in this patch.
> > 
> > I thought that PCI interrupt pin swizzling was required, but maybe not ?
> > 
> > It is totally fine if we do something different, simpler, than
> > hw/i386/pc_piix.c:piix_intx_routing_notifier_xen. I just want to make
> > sure that things remain consistent between ARM and x86, and also between
> > Xen and QEMU view of virtual PCI interrupt routing.
> >
> 
> Good questions. The following is the way I understand things but I may
> ofcourse be wrong.
> 
> Yes, we're doing things differently than hw/i386/pc_piix.c mainly
> because we're using the GPEX PCIe host bridge with it's internal
> standard swizzling down to 4 INTX interrupts. Similar to microvm and
> the ARM virt machine.
> 
> The swizzling for the GPEX is done inside the GPEX model and it's
> described by xl in the ACPI tables for PVH guests. We don't want
> Xen to do any additional swizzling in xen_set_pci_intx_level(), hence
> device=0.

OK


> I haven't plumbed the GPEX connectinos for ARM yet but I think we could
> simply call xendevicemodel_set_irq_level() and not use the pci_intx
> calls that aren't implement (we wouldn't need them).
> 
> For x86/pvh, I wonder if we should be using xen_set_pci_intx_level() /
> xen_set_pci_link_route() or some other API? since we're basically
> bypassing things?
> In one of the first implementations we used set_isa_irq_level() but
> that call only reaches into irqs < 16 so it messed things up.
> 
> Does any one have any better ideas or suggestions?

I think QEMU is free to call or not call any API at setup time. Given
that the PVH interrupt controller is emulated by Xen, the important
thing is that when QEMU raises an interrupt or an MSI with
xen_set_isa_irq_level, xen_inject_msi and xen_set_pci_intx_level, Xen
injects it into the guest as expected and the guest receives it
appropriately.

To oversimplify things, I was worried that QEMU tries to inject INTA but
the guest receives INTD instead. Or QEMU tries to raise a level
interrupt and Xen injects an edge interrupt instead.

Also I think we should try to do things the same way between the PVH
machine on ARM and X86. But we can (should?) do things differently from
hw/i386/pc_piix.c.


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 00:31:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 00:31:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777771.1187848 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seOOM-0003xs-NZ; Thu, 15 Aug 2024 00:31:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777771.1187848; Thu, 15 Aug 2024 00:31:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seOOM-0003xl-KY; Thu, 15 Aug 2024 00:31:02 +0000
Received: by outflank-mailman (input) for mailman id 777771;
 Thu, 15 Aug 2024 00:31:01 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7zbS=PO=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1seOOL-0003xd-RW
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 00:31:01 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a3d4e271-5a9d-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 02:30:58 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 6493061D28;
 Thu, 15 Aug 2024 00:30:57 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95437C116B1;
 Thu, 15 Aug 2024 00:30:55 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a3d4e271-5a9d-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723681857;
	bh=ecw7tX4Vobo53DUaAja97qvW/PTv+6irWz+Rprva9Ck=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=ovhf8xU5CW4LqYFoLqv7te1xkr4Li2A0iIF/GEO9jwbT4ymYQvUkx9471wi+YWjEo
	 mmcJ02kD4yDxS1fgDQ3SA2a41v19c9PmrT6qOWEPy+jnay54HH9RzsrM550e0G709P
	 A1P0I4AlaJfmxTkDqL1ARYo2ABdicA0ABHEyvG459RuiPpD0u4mnWCkB8u6LxJ7zv0
	 grn2J4V4W9uQzFsH5oEzqQJru5fV2GsLyLhZlG8NP1J6efvB2jAG35/78AZSGWZn1t
	 lVFf3+QVpDPcf14aZXOEKcbmwK59xr3laKGVzh/0p73YWGfUgwBu4L1skzkTVw0jS+
	 YucdMaN6N7oiQ==
Date: Wed, 14 Aug 2024 17:30:54 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, qemu-devel@nongnu.org, 
    anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, 
    alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, 
    edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, 
    qemu-arm@nongnu.org, andrew.cooper3@citrix.com
Subject: Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests
In-Reply-To: <ZryZwOoadeb1UWK8@zapote>
Message-ID: <alpine.DEB.2.22.394.2408141719400.298534@ubuntu-linux-20-04-desktop>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com> <20240812130606.90410-5-edgar.iglesias@gmail.com> <alpine.DEB.2.22.394.2408121650590.298534@ubuntu-linux-20-04-desktop> <ZruRm34zIMtUm7oH@zapote> <alpine.DEB.2.22.394.2408131550080.298534@ubuntu-linux-20-04-desktop>
 <ZryZwOoadeb1UWK8@zapote>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 14 Aug 2024, Edgar E. Iglesias wrote:
> On Tue, Aug 13, 2024 at 03:52:32PM -0700, Stefano Stabellini wrote:
> > On Tue, 13 Aug 2024, Edgar E. Iglesias wrote:
> > > On Mon, Aug 12, 2024 at 06:47:17PM -0700, Stefano Stabellini wrote:
> > > > On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> > > > > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> > > > > 
> > > > > Add SMP support for Xen PVH ARM guests. Create max_cpus ioreq
> > > > > servers to handle hotplug.
> > > > > 
> > > > > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> > > > > ---
> > > > >  hw/arm/xen_arm.c | 5 +++--
> > > > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > > > 
> > > > > diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
> > > > > index 5f75cc3779..ef8315969c 100644
> > > > > --- a/hw/arm/xen_arm.c
> > > > > +++ b/hw/arm/xen_arm.c
> > > > > @@ -173,7 +173,7 @@ static void xen_arm_init(MachineState *machine)
> > > > >  
> > > > >      xen_init_ram(machine);
> > > > >  
> > > > > -    xen_register_ioreq(xam->state, machine->smp.cpus, &xen_memory_listener);
> > > > > +    xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener);
> > > > >  
> > > > >      xen_create_virtio_mmio_devices(xam);
> > > > >  
> > > > > @@ -218,7 +218,8 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
> > > > >      MachineClass *mc = MACHINE_CLASS(oc);
> > > > >      mc->desc = "Xen PVH ARM machine";
> > > > >      mc->init = xen_arm_init;
> > > > > -    mc->max_cpus = 1;
> > > > > +    /* MAX number of vcpus supported by Xen.  */
> > > > > +    mc->max_cpus = GUEST_MAX_VCPUS;
> > > > 
> > > > Will this cause allocations of data structures with 128 elements?
> > > > Looking at hw/xen/xen-hvm-common.c:xen_do_ioreq_register it seems
> > > > possible? Or hw/xen/xen-hvm-common.c:xen_do_ioreq_register is called
> > > 
> > > Yes, in theory there's probably overhead with this but as you correctly
> > > noted below, a PVH aware xl will set the max_cpus option to a lower value.
> > > 
> > > With a non-pvh aware xl, I was a little worried about the overhead
> > > but I couldn't see any visible slow-down on ARM neither in boot or in network
> > > performance (I didn't run very sophisticated benchmarks).
> >  
> > What do you mean by "non-pvh aware xl"? All useful versions of xl
> > support pvh?
> 
> 
> I mean an xl without our PVH patches merged.
> xl in upstream doesn't know much about PVH yet.
> Even for ARM, we're still carrying significant patches in our tree.
 
Oh I see. In that case, I don't think we need to support "non-pvh aware xl".

 
> > > > later on with the precise vCPU value which should be provided to QEMU
> > > > via the -smp command line option
> > > > (tools/libs/light/libxl_dm.c:libxl__build_device_model_args_new)?
> > > 
> > > Yes, a pvh aware xl will for example pass -smp 2,maxcpus=4 based on
> > > values from the xl.cfg. If the user doesn't set maxvcpus in xl.cfg, xl
> > > will set maxvcpus to the same value as vcpus.
> > 
> > OK good. In that case if this is just an initial value meant to be
> > overwritten, I think it is best to keep it as 1.
> 
> Sorry but that won't work. I think the confusion here may be that
> it's easy to mix up mc->max_cpus and machine->smp.max_cpus, these are
> not the same. They have different purposes.
> 
> I'll try to clarify the 3 values in play.
> 
> machine-smp.cpus:
> Number of guest vcpus active at boot.
> Passed to QEMU via the -smp command-line option.
> We don't use this value in QEMU's ARM PVH machines.
> 
> machine->smp.max_cpus:
> Max number of vcpus that the guest can use (equal or larger than machine-smp.cpus).
> Will be set by xl via the "-smp X,maxcpus=Y" command-line option to QEMU.
> Taken from maxvcpus from xl.cfg, same as XEN_DMOP_nr_vcpus.
> This is what we use for xen_register_ioreq().
> 
> mc->max_cpus:
> Absolute MAX in QEMU used to cap the -smp command-line options.
> If xl tries to set -smp (machine->smp.max_cpus) larger than this, QEMU will bail out.
> Used to setup xen_register_ioreq() ONLY if -smp maxcpus was NOT set (i.e by a non PVH aware xl).
> Cannot be 1 because that would limit QEMU to MAX 1 vcpu.
> 
> I guess we could set mc->max_cpus to what XEN_DMOP_nr_vcpus returns but I'll
> have to check if we can even issue that hypercall this early in QEMU since
> mc->max_cpus is setup before we even parse the machine options. We may
> not yet know what domid we're attaching to yet.
 
If mc->max_cpus is the absolute max and it will not be used if -smp is
passed to QEMU, then I think it is OK to use GUEST_MAX_VCPUS


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 01:28:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 01:28:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777788.1187858 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sePI2-0004PW-Pb; Thu, 15 Aug 2024 01:28:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777788.1187858; Thu, 15 Aug 2024 01:28:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sePI2-0004PP-Mu; Thu, 15 Aug 2024 01:28:34 +0000
Received: by outflank-mailman (input) for mailman id 777788;
 Thu, 15 Aug 2024 01:28:33 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=OWDR=PO=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1sePI1-0004PJ-OQ
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 01:28:33 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on20601.outbound.protection.outlook.com
 [2a01:111:f403:2417::601])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ad3b6069-5aa5-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 03:28:30 +0200 (CEST)
Received: from SN7PR04CA0199.namprd04.prod.outlook.com (2603:10b6:806:126::24)
 by SJ1PR12MB6241.namprd12.prod.outlook.com (2603:10b6:a03:458::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Thu, 15 Aug
 2024 01:28:22 +0000
Received: from SA2PEPF00001508.namprd04.prod.outlook.com
 (2603:10b6:806:126:cafe::10) by SN7PR04CA0199.outlook.office365.com
 (2603:10b6:806:126::24) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.23 via Frontend
 Transport; Thu, 15 Aug 2024 01:28:21 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SA2PEPF00001508.mail.protection.outlook.com (10.167.242.40) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Thu, 15 Aug 2024 01:28:21 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 14 Aug
 2024 20:28:21 -0500
Received: from [172.23.60.101] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 14 Aug 2024 20:28:20 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ad3b6069-5aa5-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=y1yrR/LdoGWZ5SZj2mm7VnLnFSX/qvetE9xGVjybM2HT08WdeZiRV1/k+TlgYvglSr23lMjdzM67TOCJp+ZS9rOyPXaRtDfIGCdmpB+d8FG5X3B+qwChBCrI8SGFcCtpeCiDI6MmQPSMpj77moS0g551pY5l2T5kc0+iGiZYBY9Vmyynf6A4UwzpsqEsCCwRHxEVkZwqY6ACRjAgEYTZcaSXsdNaVfte9ATWbDkEclOxBnf65ItmexyZGDb0Ss1JJOfnq9WVS1uDsCp45YfCFU1k0G0qxbDQAA0lNVMhMH1jTJj6woZyzC+5eU0KOE7ffPsc9G9imLm7nXMXgKKYRw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=B0l3Hu/nacDiYCFoeaN96Ca9/rly+kx6EWAp7kHpDLA=;
 b=Dr3CzZfkJThA58fM0oMd/WaBHZB2vJRi9quh4ygRPy48/+LmS9xeCK3wEFfm8331FCl6Wa2oIaG06IaHuh2iIYr7ATtcWwf6rDiFYiVseVF3JGtcjxxCnbknNGV4LONo8Zx5mCsOnDtOnQrzjZQzwMxSSwO1dri6A8Sgfu0b3YYOkvWjxsCCo4ULNBQqvGm2TzhXQGKRXhmbhoU6hgzaCslS0XB2O68XWcvbkGVUofHvSbl5t7rIF9QjH3NHRSJ9tyYSTjNr6BG0HD8x0Pc0gAyGoVCpFDzPm/FisbqCdZ3dGhWW6+63mExcH90d1IPOn5PgJbNdMWwhPz4IpNG6xA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=B0l3Hu/nacDiYCFoeaN96Ca9/rly+kx6EWAp7kHpDLA=;
 b=Y4LtoCUbKhqzryFB7kDC7sEksH9IucJ5Rhm8HzcLPVg2CAdnO1GpUN9K+oG7q6+4LligryHynkdbzwrtMsy9oWR1N4SKh7BJiCARcBPxIzho565hgmFK+lelQ6JwiYN5Ep7wCv2elnxtlfJPuEwmJkVHjztIGQwFl0Scxg0iPak=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <c05c9312-e729-48fb-942f-fbb378cd097a@amd.com>
Date: Wed, 14 Aug 2024 21:28:19 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/msi: fix locking for SR-IOV devices
To: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Teddy Astie
	<teddy.astie@vates.tech>, <xen-devel@lists.xenproject.org>
References: <20240812203938.981588-1-stewart.hildebrand@amd.com>
 <74f88a45-a632-4ca6-9cee-95f52370b397@suse.com>
Content-Language: en-US
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
In-Reply-To: <74f88a45-a632-4ca6-9cee-95f52370b397@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB03.amd.com: stewart.hildebrand@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SA2PEPF00001508:EE_|SJ1PR12MB6241:EE_
X-MS-Office365-Filtering-Correlation-Id: 6ad42edf-8cc7-4eae-3ab7-08dcbcc98cd4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?Q09vTEF4TzJ3UnRSSm1xS1FxZE5UMnEyWXEwWERDZzB2bXdpZEhsVVptaDFH?=
 =?utf-8?B?Q09tNi9Ta1hIdkszN29OQTdDcDFGZFRkbVhlaHNTS0w5dUQ1OXFMZi8zdVlr?=
 =?utf-8?B?WnFCZDdjdm9WU25hZnVZOUJ1ZkdncHZrZ2VEWmx0ck5ycmhzcDQ4SmNJMmd5?=
 =?utf-8?B?MjN2cWdIQVZEOHFKQWltTml1RGZ3RXhlMHN1L0NDMVNGMVh6ZThQUklTaHhB?=
 =?utf-8?B?NTF6WFBZYVBXTlp0QXlXdXRxbmJKbjA0S29KdjRTTDA4ZTkrOEJYSzBWOGw1?=
 =?utf-8?B?ZkZrLzFjZ25HVzFNKzBsZkQyTm5zWXBnSkhHNWlVOUkrWUJxd2tRV2VMdFMw?=
 =?utf-8?B?RlVGd2lhQ0lTZUdzZ1VKaXRJejFqNTB2UDlXeTdxQ1E5eXpvbnBwWEcwakg4?=
 =?utf-8?B?R01GMzhmYndNQzNLZ2k4eGhvUDhsRU9UQnRLVzZQM09CemRkSVFQdCtRaXcw?=
 =?utf-8?B?UGc0NHNzZUhtMFA0NllwSTBXZzNqcE5yaFFxMDMyVnkzTWp6WkxsTnpWL0xq?=
 =?utf-8?B?blNiUlFxOXRwOGxpZkloRkJJL3UzQmNybFZMMVQxcDUxaXdSUlZtL1hFdGs3?=
 =?utf-8?B?MnRycTExRUZlT0xxQmdYSkFjMWgxZGRXODY3V0xnSUtCZnVrbEZ3R1E0YytH?=
 =?utf-8?B?U3dYT3lmcVNLRldUZDhqbkZXdjRDWE1RZVkvOEJTai9nNWl0RDJadGJRWmJ3?=
 =?utf-8?B?Q3VsZFlsMkgwNTJDYTIxMlBaVEo5RGtPV0xJM3JKZU50bnRnSnVINHNaeFJr?=
 =?utf-8?B?R2JSK25iUG9PbHlvTDZ3b2swSi9VV294SThMNHlhSHJMRWRWNTRBdkN0bUNS?=
 =?utf-8?B?N1d6bUZMa2YzOWFkOGkwWW5JUCt1QndGekRJVER3N1d1R0dwV0VFTVBPSk1L?=
 =?utf-8?B?d3craWFDbzJmZDZMNzJqZG9ac3RZSnIvdGF2VmRMd1Y2ejV0Q1dFU2VpbGJF?=
 =?utf-8?B?WDVHRWNtK1h6VWlLdFdWd3VZWnBWVTlvejZzOGp5ZEwyKzU4cGVvNXpydlFI?=
 =?utf-8?B?d2hhZGZ5ZmlSeWV6N0NXRC8xNkc0OUp5eUtUMDRodmQ1SWNYK0JwaVR5RkFB?=
 =?utf-8?B?SHYvdkIxTlpiRytSQkVUWkNyOXZXaEdab2FBL1F2OEpzUnZLQ1RRTVRoY1M5?=
 =?utf-8?B?eW5xdVZWR0t0QTVxZmtqUFlmc3VKblRwakcySWpXek8reEh5TW5wZkpxaGU2?=
 =?utf-8?B?L3dvTi95VnBybDdSWnpQdE80enF2dGdnbFpLaG16QTliRWpkODF0d3AycDNV?=
 =?utf-8?B?TVROWFVaUVlPZGZXSmozdHdQeXVpZ1FzMGNKOWRzV1Z4VUR2b2dORUh4aGgr?=
 =?utf-8?B?UHV2M2I3RzRpZXQ5ZzQ3UkFNVThkUEE2U3JBRnBIdlFoY3V3VUtQMEFsSkVy?=
 =?utf-8?B?enF6UE56Smp2S1pIcHhMaHV1R3pPOXlrOXdSZ0dqUHNsYk55WnNwa0NEcXda?=
 =?utf-8?B?alppS1lOMDFGOVo4ZjRUZGNhUW9VaUp3cm9PcWIrZGhhdVp3Z0tDL05ydDdt?=
 =?utf-8?B?d3RBbktqSTliUlVIa29HdGN2cFV1UkZaQUpycTQ0ZnBpK2FRS3hvWHRyWjFq?=
 =?utf-8?B?YjBBeGVZSHltMGtzRnlqa1E1YXQrVWtaY1pBVXdyeTRpQUNIWmY4UzNra2tV?=
 =?utf-8?B?M2dzLys4TFZqLzZ3dkR2N0V0Uk5EYmtrWWFoeGQyZ1NqWERQNjNYZzlJeEtL?=
 =?utf-8?B?Y2N2NzVxSUFYYnN0MUxORW5zRm1md281cWFnbGJhQllXSG1oYTk5R0RKUjZ4?=
 =?utf-8?B?L25weUJocnJzYUJuZUQwZWlhNGVhaXZhTlFjMFp4OENNQ1pwZk5RblVSUnZw?=
 =?utf-8?B?Z0FoZlg0ZTZIVno4em1uemNaTm5CZDA4ekg4ei9TclkzcXo4d0N4d2ZnbnJr?=
 =?utf-8?B?MVpFcHN2cmExUE4wL1I2Q3pDa0ZDdDlkdlZRUUpZcy94R1hIaDQvNFNwSnZo?=
 =?utf-8?Q?mnfD9tUe5WGecsbvlEKT5cKg7dPM56Ow?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2024 01:28:21.6155
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 6ad42edf-8cc7-4eae-3ab7-08dcbcc98cd4
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SA2PEPF00001508.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6241

On 8/13/24 10:01, Jan Beulich wrote:
> On 12.08.2024 22:39, Stewart Hildebrand wrote:
>> In commit 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci
>> structure") a lock moved from allocate_and_map_msi_pirq() to the caller
>> and changed from pcidevs_lock() to read_lock(&d->pci_lock). However, one
>> call path wasn't updated to reflect the change, leading to a failed
>> assertion observed under the following conditions:
>>
>> * PV dom0
>> * Debug build (debug=y) of Xen
>> * There is an SR-IOV device in the system with one or more VFs enabled
>> * Dom0 has loaded the driver for the VF and enabled MSI-X
>>
>> (XEN) Assertion 'd || pcidevs_locked()' failed at drivers/passthrough/pci.c:535
>> (XEN) ----[ Xen-4.20-unstable  x86_64  debug=y  Not tainted ]----
>> ...
>> (XEN) Xen call trace:
>> (XEN)    [<ffff82d040284da8>] R pci_get_pdev+0x4c/0xab
>> (XEN)    [<ffff82d040344f5c>] F arch/x86/msi.c#read_pci_mem_bar+0x58/0x272
>> (XEN)    [<ffff82d04034530e>] F arch/x86/msi.c#msix_capability_init+0x198/0x755
>> (XEN)    [<ffff82d040345dad>] F arch/x86/msi.c#__pci_enable_msix+0x82/0xe8
>> (XEN)    [<ffff82d0403463e5>] F pci_enable_msi+0x3f/0x78
>> (XEN)    [<ffff82d04034be2b>] F map_domain_pirq+0x2a4/0x6dc
>> (XEN)    [<ffff82d04034d4d5>] F allocate_and_map_msi_pirq+0x103/0x262
>> (XEN)    [<ffff82d04035da5d>] F physdev_map_pirq+0x210/0x259
>> (XEN)    [<ffff82d04035e798>] F do_physdev_op+0x9c3/0x1454
>> (XEN)    [<ffff82d040329475>] F pv_hypercall+0x5ac/0x6af
>> (XEN)    [<ffff82d0402012d3>] F lstar_enter+0x143/0x150
>>
>> In read_pci_mem_bar(), the VF obtains the struct pci_dev pointer for its
>> associated PF to access the vf_rlen array. This array is initialized in
>> pci_add_device() and is only populated in the associated PF's struct
>> pci_dev.
>>
>> Add a link from the VF's struct pci_dev to the associated PF struct
>> pci_dev, ensuring the PF's struct doesn't get deallocated until all its
>> VFs have gone away. Access the vf_rlen array via the new link to the PF,
>> and remove the troublesome call to pci_get_pdev().
>>
>> Add a call to pci_get_pdev() inside the pcidevs_lock()-locked section of
>> pci_add_device() to set up the link from VF to PF. In case the new
>> pci_add_device() invocation fails to find the associated PF (returning
>> NULL), we are no worse off than before: read_pci_mem_bar() will still
>> return 0 in that case.
>>
>> Note that currently the only way for Xen to know if a device is a VF is
>> if the toolstack tells Xen about it. Using PHYSDEVOP_manage_pci_add for
>> a VF is not a case that Xen handles.
> 
> How does the toolstack come into play here? It's still the Dom0 kernel to
> tell Xen, via PHYSDEVOP_pci_device_add (preferred) or
> PHYSDEVOP_manage_pci_add_ext (kind of deprecated; PHYSDEVOP_manage_pci_add
> is even more kind of deprecated).

I guess I meant to say Dom0 kernel, not toolstack. I'm actually
questioning how much value this last portion of the commit description
is really adding. Maybe it would be better to just remove this bit.

>> --- a/xen/arch/x86/msi.c
>> +++ b/xen/arch/x86/msi.c
>> @@ -662,34 +662,32 @@ static int msi_capability_init(struct pci_dev *dev,
>>      return 0;
>>  }
>>  
>> -static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
>> +static u64 read_pci_mem_bar(struct pf_info *pf_info, u16 seg, u8 bus, u8 slot,
>> +                            u8 func, u8 bir, int vf)
>>  {
>> +    pci_sbdf_t sbdf = PCI_SBDF(seg, bus, slot, func);
>>      u8 limit;
>>      u32 addr, base = PCI_BASE_ADDRESS_0;
>>      u64 disp = 0;
>>  
>>      if ( vf >= 0 )
>>      {
>> -        struct pci_dev *pdev = pci_get_pdev(NULL,
>> -                                            PCI_SBDF(seg, bus, slot, func));
>>          unsigned int pos;
>>          uint16_t ctrl, num_vf, offset, stride;
>>  
>> -        if ( !pdev )
>> -            return 0;
>> -
>> -        pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_SRIOV);
>> -        ctrl = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_CTRL);
>> -        num_vf = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_NUM_VF);
>> -        offset = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_OFFSET);
>> -        stride = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_STRIDE);
>> +        pos = pci_find_ext_capability(sbdf, PCI_EXT_CAP_ID_SRIOV);
>> +        ctrl = pci_conf_read16(sbdf, pos + PCI_SRIOV_CTRL);
>> +        num_vf = pci_conf_read16(sbdf, pos + PCI_SRIOV_NUM_VF);
>> +        offset = pci_conf_read16(sbdf, pos + PCI_SRIOV_VF_OFFSET);
>> +        stride = pci_conf_read16(sbdf, pos + PCI_SRIOV_VF_STRIDE);
>>  
>>          if ( !pos ||
>>               !(ctrl & PCI_SRIOV_CTRL_VFE) ||
>>               !(ctrl & PCI_SRIOV_CTRL_MSE) ||
>>               !num_vf || !offset || (num_vf > 1 && !stride) ||
>>               bir >= PCI_SRIOV_NUM_BARS ||
>> -             !pdev->vf_rlen[bir] )
>> +             !pf_info ||
> 
> See further down - I think it would be nice if we didn't need this new
> check.
> 
>> @@ -813,6 +811,7 @@ static int msix_capability_init(struct pci_dev *dev,
>>          int vf;
>>          paddr_t pba_paddr;
>>          unsigned int pba_offset;
>> +        struct pf_info *pf_info = NULL;
> 
> Pointer-to-const?
> 
>> @@ -827,9 +826,12 @@ static int msix_capability_init(struct pci_dev *dev,
>>              pslot = PCI_SLOT(dev->info.physfn.devfn);
>>              pfunc = PCI_FUNC(dev->info.physfn.devfn);
>>              vf = dev->sbdf.bdf;
>> +            if ( dev->virtfn.pf_pdev )
>> +                pf_info = &dev->virtfn.pf_pdev->physfn;
>>          }
>>  
>> -        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
>> +        table_paddr = read_pci_mem_bar(pf_info, seg, pbus, pslot, pfunc, bir,
>> +                                       vf);
> 
> I don't think putting the new arg first is very nice. SBDF should remain
> first imo. Between the latter arguments I'm not as fussed.
> 
>> @@ -446,7 +448,27 @@ static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
>>  
>>      list_del(&pdev->alldevs_list);
>>      pdev_msi_deinit(pdev);
>> -    xfree(pdev);
>> +
>> +    if ( pdev->info.is_virtfn )
>> +    {
>> +        struct pci_dev *pf_pdev = pdev->virtfn.pf_pdev;
>> +
>> +        if ( pf_pdev )
>> +        {
>> +            list_del(&pdev->virtfn.next);
>> +            if ( pf_pdev->physfn.dealloc_pending &&
>> +                 list_empty(&pf_pdev->physfn.vf_list) )
>> +                xfree(pf_pdev);
>> +        }
>> +        xfree(pdev);
>> +    }
>> +    else
>> +    {
>> +        if ( list_empty(&pdev->physfn.vf_list) )
>> +            xfree(pdev);
>> +        else
>> +            pdev->physfn.dealloc_pending = true;
>> +    }
> 
> Could I talk you into un-indenting the last if/else by a level, by making
> the earlier else and "else if()"?
> 
> One aspect I didn't properly consider when making the suggestion: What if,
> without all VFs having gone away, the PF is re-added? In that case we
> would better recycle the existing structure. That's getting a little
> complicated, so maybe a better approach is to refuse the request (in
> pci_remove_device()) when the list isn't empty?

Hm. Right. The growing complexity of maintaining these PF<->VF links
(introduced on a hunch that they may be useful in the future) is making
me favor the previous approach from v2 of simply copying the vf_len
array. So unless there are any objections I'll go back to that approach
for v4.

>> @@ -700,10 +722,22 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>>           * extended function.
>>           */
>>          if ( pdev->info.is_virtfn )
>> +        {
>> +            struct pci_dev *pf_pdev;
>> +
>>              pdev->info.is_extfn = pf_is_extfn;
>> +            pf_pdev = pci_get_pdev(NULL,
>> +                                   PCI_SBDF(seg, info->physfn.bus,
>> +                                            info->physfn.devfn));
>> +            if ( pf_pdev )
>> +            {
>> +                pdev->virtfn.pf_pdev = pf_pdev;
>> +                list_add(&pdev->virtfn.next, &pf_pdev->physfn.vf_list);
>> +            }
>> +        }
> 
> Hmm, yes, we can't really use the result of the earlier pci_get_pdev(), as
> we drop the lock intermediately. I wonder though if we wouldn't better fail
> the function if we can't find the PF instance.
> 
>> --- a/xen/include/xen/pci.h
>> +++ b/xen/include/xen/pci.h
>> @@ -150,7 +150,17 @@ struct pci_dev {
>>          unsigned int count;
>>  #define PT_FAULT_THRESHOLD 10
>>      } fault;
>> -    u64 vf_rlen[6];
>> +    struct pf_info {
>> +        /* Only populated for PFs (info.is_virtfn == false) */
>> +        uint64_t vf_rlen[PCI_SRIOV_NUM_BARS];
>> +        struct list_head vf_list;             /* List head */
>> +        bool dealloc_pending;
>> +    } physfn;
>> +    struct {
>> +        /* Only populated for VFs (info.is_virtfn == true) */
>> +        struct pci_dev *pf_pdev;              /* Link from VF to PF */
>> +        struct list_head next;                /* Entry in vf_list */
> 
> For doubly-linked lists "next" isn't really a good name. Since both struct
> variants need such a member, why not use vf_list uniformly? That'll then
> also lower the significance of my other question:
> 
>> +    } virtfn;
> 
> Should the two new struct-s perhaps be a union?
> 
> Jan



From xen-devel-bounces@lists.xenproject.org Thu Aug 15 03:56:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 03:56:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777802.1187872 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seRbM-0002Ub-34; Thu, 15 Aug 2024 03:56:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777802.1187872; Thu, 15 Aug 2024 03:56:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seRbL-0002UU-V5; Thu, 15 Aug 2024 03:56:39 +0000
Received: by outflank-mailman (input) for mailman id 777802;
 Thu, 15 Aug 2024 03:56:39 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seRbL-0002UK-IX; Thu, 15 Aug 2024 03:56:39 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seRbL-0000oB-Gt; Thu, 15 Aug 2024 03:56:39 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seRbK-0008Kp-S1; Thu, 15 Aug 2024 03:56:38 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1seRbK-0003Fi-R4; Thu, 15 Aug 2024 03:56:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=rn9UGA4/ER0TmrePrmTmm29b7k6qLsdq1bfclbMusCs=; b=QM49KS5rvccDZupRq/AxiOisMG
	m3za8umAikv37X377PtbfG6zVEQFshnyie1J2BhGtQPMrd/j7z+cMuaiQCSEDFM3yAIln3YeUETM/
	nyRegIwxWTcq/Lfq+VUt5yaoDJtQjmywvCfEf3mHthA9sVfDPxiIbf2jc6D+300442Y0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187240-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.17-testing test] 187240: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.17-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=430ce6cd936546ad883ecd1c85ddea32d790604b
X-Osstest-Versions-That:
    xen=f95a6b010b9a2633d5186f7a53e4607bbe56f618
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 15 Aug 2024 03:56:38 +0000

flight 187240 xen-4.17-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187240/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187229
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187229
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187229
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187229
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187229
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187229
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  430ce6cd936546ad883ecd1c85ddea32d790604b
baseline version:
 xen                  f95a6b010b9a2633d5186f7a53e4607bbe56f618

Last test of basis   187229  2024-08-13 15:06:52 Z    1 days
Testing same since   187240  2024-08-14 09:06:43 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   f95a6b010b..430ce6cd93  430ce6cd936546ad883ecd1c85ddea32d790604b -> stable-4.17


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 07:07:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 07:07:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777824.1187882 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seUZe-0005rF-BD; Thu, 15 Aug 2024 07:07:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777824.1187882; Thu, 15 Aug 2024 07:07:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seUZe-0005r8-8C; Thu, 15 Aug 2024 07:07:06 +0000
Received: by outflank-mailman (input) for mailman id 777824;
 Thu, 15 Aug 2024 07:07:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=oSYy=PO=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1seUZc-0005r2-L5
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 07:07:04 +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 f932b0e6-5ad4-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 09:07:03 +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 B8ACD1FD07;
 Thu, 15 Aug 2024 07:07:02 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4C73913983;
 Thu, 15 Aug 2024 07:07:02 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id +6YkERapvWbaZQAAD6G6ig
 (envelope-from <jgross@suse.com>); Thu, 15 Aug 2024 07:07:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f932b0e6-5ad4-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723705622; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references:autocrypt:autocrypt;
	bh=hzBbYoGpQPV/xRpJCJp6A4iUzrkdNxXoEj4uvZqcUno=;
	b=BzMcF/XbEYkfl1cO2Acawm2oQ2m9pMFhQNrxjyNvcPP2xSDeFv2xTahCI5asg5rj9qZQ6e
	a8TAIIYmQYsO5WJsdtuSb9zV+uWQexHfjo1HF4hoq+LNn1OYBk1/sTGr8wbD23A+GqT4b2
	FzvxSw/EyvAX4NHtmunwyoPYUOVcbp8=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b="BzMcF/Xb"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723705622; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references:autocrypt:autocrypt;
	bh=hzBbYoGpQPV/xRpJCJp6A4iUzrkdNxXoEj4uvZqcUno=;
	b=BzMcF/XbEYkfl1cO2Acawm2oQ2m9pMFhQNrxjyNvcPP2xSDeFv2xTahCI5asg5rj9qZQ6e
	a8TAIIYmQYsO5WJsdtuSb9zV+uWQexHfjo1HF4hoq+LNn1OYBk1/sTGr8wbD23A+GqT4b2
	FzvxSw/EyvAX4NHtmunwyoPYUOVcbp8=
Message-ID: <c0a3e981-2555-4a66-aacb-dbfa4985d4a8@suse.com>
Date: Thu, 15 Aug 2024 09:07:01 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 4/5] x86/kernel: Move page table macros to header
To: Jason Andryuk <jason.andryuk@amd.com>,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Paolo Bonzini <pbonzini@redhat.com>, Brian Gerst <brgerst@gmail.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
References: <20240814195053.5564-1-jason.andryuk@amd.com>
 <20240814195053.5564-5-jason.andryuk@amd.com>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <20240814195053.5564-5-jason.andryuk@amd.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------0aYKTIJj0VNBOMw0Id1Im1Ij"
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-Spamd-Result: default: False [-7.41 / 50.00];
	BAYES_HAM(-3.00)[99.98%];
	SIGNED_PGP(-2.00)[];
	DWL_DNSWL_MED(-2.00)[suse.com:dkim];
	MIME_BASE64_TEXT_BOGUS(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain];
	NEURAL_HAM_SHORT(-0.20)[-1.000];
	MIME_BASE64_TEXT(0.10)[];
	MIME_UNKNOWN(0.10)[application/pgp-keys];
	MX_GOOD(-0.01)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RCPT_COUNT_TWELVE(0.00)[14];
	FREEMAIL_TO(0.00)[amd.com,oracle.com,linutronix.de,redhat.com,alien8.de,linux.intel.com,kernel.org,zytor.com,epam.com,gmail.com];
	MIME_TRACE(0.00)[0:+,1:+,2:+,3:+,4:~,5:~];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	ARC_NA(0.00)[];
	FREEMAIL_ENVRCPT(0.00)[gmail.com];
	TO_DN_SOME(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	MID_RHS_MATCH_FROM(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	HAS_ATTACHMENT(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:mid,suse.com:email]
X-Rspamd-Queue-Id: B8ACD1FD07
X-Spam-Flag: NO
X-Rspamd-Action: no action
X-Spam-Level: 
X-Spam-Score: -7.41

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------0aYKTIJj0VNBOMw0Id1Im1Ij
Content-Type: multipart/mixed; boundary="------------jD1KDkAa5dCfy0NMR7NH0wns";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: Jason Andryuk <jason.andryuk@amd.com>,
 Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
 Paolo Bonzini <pbonzini@redhat.com>, Brian Gerst <brgerst@gmail.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Message-ID: <c0a3e981-2555-4a66-aacb-dbfa4985d4a8@suse.com>
Subject: Re: [PATCH v2 4/5] x86/kernel: Move page table macros to header
References: <20240814195053.5564-1-jason.andryuk@amd.com>
 <20240814195053.5564-5-jason.andryuk@amd.com>
In-Reply-To: <20240814195053.5564-5-jason.andryuk@amd.com>

--------------jD1KDkAa5dCfy0NMR7NH0wns
Content-Type: multipart/mixed; boundary="------------ws9m8X6YiIkI1H2zqh22XEZV"

--------------ws9m8X6YiIkI1H2zqh22XEZV
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMTQuMDguMjQgMjE6NTAsIEphc29uIEFuZHJ5dWsgd3JvdGU6DQo+IFRoZSBQVkggZW50
cnkgcG9pbnQgd2lsbCBuZWVkIGFuIGFkZGl0aW9uYWwgc2V0IG9mIHByZWJ1aWxkIHBhZ2Ug
dGFibGVzLg0KPiBNb3ZlIHRoZSBtYWNyb3MgYW5kIGRlZmluZXMgdG8gcGd0YWJsZV82NC5o
LCBzbyB0aGV5IGNhbiBiZSByZS11c2VkLg0KPiANCj4gU2lnbmVkLW9mZi1ieTogSmFzb24g
QW5kcnl1ayA8amFzb24uYW5kcnl1a0BhbWQuY29tPg0KDQpSZXZpZXdlZC1ieTogSnVlcmdl
biBHcm9zcyA8amdyb3NzQHN1c2UuY29tPg0KDQoNCkp1ZXJnZW4NCg==
--------------ws9m8X6YiIkI1H2zqh22XEZV
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-----

--------------ws9m8X6YiIkI1H2zqh22XEZV--

--------------jD1KDkAa5dCfy0NMR7NH0wns--

--------------0aYKTIJj0VNBOMw0Id1Im1Ij
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/Ey8FAma9qRUFAwAAAAAACgkQsN6d1ii/Ey8a
igf9E+nu0O68jG1WjVrGpdjyF+Xb2TfBr75eQk6hleBWTaa5FO45k7L0eHklImShb8YIlEMELDd1
+D6xyf2RBhE6n9fIsVofalJLE+8ERtC4sT3JISHhVWClsI4T4pjyf8AZLK7I6ryESRZsFHKQdksC
ae8ip5kLiRZHDGvL9w+tOFw6NPDvGw14HlEss1HeIqgLtico41HVNotrTAJoQBe+OnD+rpfLf9/+
7uaRICYjZ22BozhSlspnYJRyU8+PyZ+kajiBx9iPBj+uey3NIm9fD/QTWgj4VhFJpIjx6KLFRZH7
hInhQEIRigF+IbwwQofDekgpX5h2YbgZtLKc6isvNw==
=Vz17
-----END PGP SIGNATURE-----

--------------0aYKTIJj0VNBOMw0Id1Im1Ij--


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 07:44:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 07:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777838.1187891 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seV9c-0003Lj-2y; Thu, 15 Aug 2024 07:44:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777838.1187891; Thu, 15 Aug 2024 07:44:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seV9c-0003Lc-0G; Thu, 15 Aug 2024 07:44:16 +0000
Received: by outflank-mailman (input) for mailman id 777838;
 Thu, 15 Aug 2024 07:44:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seV9a-0003LR-UA; Thu, 15 Aug 2024 07:44:14 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seV9a-0005aK-Qs; Thu, 15 Aug 2024 07:44:14 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seV9a-0005lB-6o; Thu, 15 Aug 2024 07:44:14 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1seV9a-0006IY-6O; Thu, 15 Aug 2024 07:44:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=yhbHQWbVTpiNkd4e8GpNLv9ubCsjB6lJCmcesDNa7HQ=; b=niqyQhmlz3shaB8K1D0/sjwuVi
	QiJlauYPjWMwB9YjmNBuv4+DqFiC3wiG8IC9CBhJWaJPDmXZbx7zcEqO96h6OudWimCcyHs1TbZGF
	CDkJedfo4sxkobnOwn5zc+TG0rbMSjp/E5Cutfc3yzNWocuoHnTtkN7yzY98vWkMyOaU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187241-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-6.1 test] 187241: regressions - trouble: broken/fail/pass
X-Osstest-Failures:
    linux-6.1:test-armhf-armhf-xl-credit2:<job status>:broken:regression
    linux-6.1:test-armhf-armhf-xl-credit2:host-install(5):broken:regression
    linux-6.1:test-armhf-armhf-libvirt-vhd:guest-start/debian.repeat:fail:regression
    linux-6.1:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=117ac406ba904da738fb79a3b2c96d4a385292c1
X-Osstest-Versions-That:
    linux=36790ef5e00b69ccb92817f95ba1928eea24eebb
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 15 Aug 2024 07:44:14 +0000

flight 187241 linux-6.1 real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187241/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-xl-credit2     <job status>                 broken
 test-armhf-armhf-xl-credit2   5 host-install(5)        broken REGR. vs. 187211
 test-armhf-armhf-libvirt-vhd 17 guest-start/debian.repeat fail REGR. vs. 187211

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187211
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187211
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187211
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187211
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187211
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187211
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                117ac406ba904da738fb79a3b2c96d4a385292c1
baseline version:
 linux                36790ef5e00b69ccb92817f95ba1928eea24eebb

Last test of basis   187211  2024-08-11 10:42:52 Z    3 days
Testing same since   187241  2024-08-14 12:15:39 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alex Deucher <alexander.deucher@amd.com>
  Alex Hung <alex.hung@amd.com>
  Alexander Gordeev <agordeev@linux.ibm.com>
  Andi Kleen <ak@linux.intel.com>
  Andi Shyti <andi.shyti@kernel.org>
  Andrew Morton <akpm@linux-foundation.org>
  Andrey Konovalov <andreyknvl@gmail.com>
  Anna Schumaker <Anna.Schumaker@Netapp.com>
  Anton Khirnov <anton@khirnov.net>
  Arnaldo Carvalho de Melo <acme@redhat.com>
  Arseniy Krasnov <avkrasnov@salutedevices.com>
  Bart Van Assche <bvanassche@acm.org>
  Benjamin Coddington <bcodding@redhat.com>
  Besar Wicaksono <bwicaksono@nvidia.com>
  Bharath SM <bharathsm@microsoft.com>
  Bjorn Helgaas <bhelgaas@google.com>
  Bjørn Mork <bjorn@mork.no>
  Bob Zhou <bob.zhou@amd.com>
  Boqun Feng <boqun.feng@gmail.com>
  Catalin Marinas <catalin.marinas@arm.com>
  Chandan Babu R <chandanbabu@kernel.org>
  Cheng-Jui Wang <cheng-jui.wang@mediatek.com>
  Chi Zhiling <chizhiling@kylinos.cn>
  Chris Wulff <crwulff@gmail.com>
  Christoph Hellwig <hch@lst.de>
  ChromeOS CQ Test <chromeos-kernel-stable-merge@google.com>
  Csókás, Bence <csokas.bence@prolan.hu>
  Curtis Malainey <cujomalainey@chromium.org>
  Damien Le Moal <dlemoal@kernel.org>
  Dan Williams <dan.j.williams@intel.com>
  Daniel Borkmann <daniel@iogearbox.net>
  Daniel Lezcano <daniel.lezcano@linaro.org>
  Daniel Wheeler <daniel.wheeler@amd.com>
  Daniele Palmas <dnlplm@gmail.com>
  Darrick J. Wong <djwong@kernel.org>
  David Hildenbrand <david@redhat.com>
  David S. Miller <davem@davemloft.net>
  David Sterba <dsterba@suse.com>
  Dmitry Antipov <dmantipov@yandex.ru>
  Dragan Simic <dsimic@manjaro.org>
  Dragos Tatulea <dtatulea@nvidia.com>
  Dustin L. Howett <dustin@howett.net>
  Eric Dumazet <edumazet@google.com>
  Fangzhi Zuo <Jerry.Zuo@amd.com>
  Feng Tang <feng.tang@intel.com>
  Filipe Manana <fdmanana@suse.com>
  Florian Fainelli <florian.fainelli@broadcom.com>
  Florian Westphal <fw@strlen.de>
  Frederic Weisbecker <frederic@kernel.org>
  FUJITA Tomonori <fujita.tomonori@gmail.com>
  Gaosheng Cui <cuigaosheng1@huawei.com>
  Geert Uytterhoeven <geert+renesas@glider.be>
  Geliang Tang <geliang.tang@suse.com>
  George Kennedy <george.kennedy@oracle.com>
  George Zhang <George.zhang@amd.com>
  Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  Guenter Roeck <linux@roeck-us.net>
  Hamza Mahfooz <hamza.mahfooz@amd.com>
  Hanna Czenczek <hreitz@redhat.com>
  Hans de Goede <hdegoede@redhat.com>
  Hans Verkuil <hverkuil-cisco@xs4all.nl>
  Huacai Chen <chenhuacai@loongson.cn>
  HungNien Chen <hn.chen@sunplusit.com>
  Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
  Ivan Lipski <ivlipski@amd.com>
  Jakub Kicinski <kuba@kernel.org>
  James Chapman <jchapman@katalix.com>
  Jan Kara <jack@suse.cz>
  Jason Wang <jasowang@redhat.com>
  Jens Axboe <axboe@kernel.dk>
  Jerome Brunet <jbrunet@baylibre.com>
  Jin Wang <jin1.wang@intel.com>
  Jiri Olsa <jolsa@kernel.org>
  Jithu Joseph <jithu.joseph@intel.com>
  Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
  Johan Hovold <johan@kernel.org>
  Johannes Berg <johannes.berg@intel.com>
  Jon Hunter <jonathanh@nvidia.com>
  Justin Stitt <justinstitt@google.com>
  Kemeng Shi <shikemeng@huaweicloud.com>
  Kevin Berry <kpberry@google.com>
  Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
  Kuniyuki Iwashima <kuniyu@amazon.com>
  Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
  Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  Li Nan <linan122@huawei.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Linux Kernel Functional Testing <lkft@linaro.org>
  Lucas Stach <l.stach@pengutronix.de>
  Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  Lyude Paul <lyude@redhat.com>
  Ma Jun <Jun.Ma2@amd.com>
  Ma Ke <make24@iscas.ac.cn>
  Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
  Marc Kleine-Budde <mkl@pengutronix.de>
  Marco Elver <elver@google.com>
  Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
  Mark Brown <broonie@kernel.org>
  Mark Rutland <mark.rutland@arm.com>
  Martin K. Petersen <martin.petersen@oracle.com>
  Masami Hiramatsu (Google) <mhiramat@kernel.org>
  Matthieu Baerts (NGI0) <matttbe@kernel.org>
  Matthieu Baerts <matthieu.baerts@tessares.net>
  Menglong Dong <dongml2@chinatelecom.cn>
  Menglong Dong <menglong8.dong@gmail.com>
  Miaohe Lin <linmiaohe@huawei.com>
  Michael S. Tsirkin <mst@redhat.com>
  Michal Pecio <michal.pecio@gmail.com>
  Mikulas Patocka <mpatocka@redhat.com>
  Ming Qian <ming.qian@nxp.com>
  Muchun Song <muchun.song@linux.dev>
  Neil Armstrong <neil.armstrong@linaro.org>
  Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK
  Nicolas Dichtel <nicolas.dichtel@6wind.com>
  Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
  Nikolay Aleksandrov <razor@blackwall.org>
  Oliver Neukum <oneukum@suse.com>
  Pablo Neira Ayuso <pablo@netfilter.org>
  Paolo Abeni <pabeni@redhat.com>
  Paul E. McKenney <paulmck@kernel.org>
  Pavel Machek (CIP) <pavel@denx.de>
  Pengfei Xu <pengfei.xu@intel.com>
  Peter Oberparleiter <oberpar@linux.ibm.com>
  Peter Zijlstra (Intel) <peterz@infradead.org>
  Peter Zijlstra <peterz@infradead.org>
  Prashanth K <quic_prashk@quicinc.com>
  Qiang Yu <yuq825@gmail.com>
  Qu Wenruo <wqu@suse.com>
  Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
  Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  Ricardo Ribalda <ribalda@chromium.org>
  Robert Foss <rfoss@kernel.org>
  Roman Smirnov <r.smirnov@omp.ru>
  Ron Economos <re@w6rz.net>
  Salvatore Bonaccorso <carnil@debian.org>
  Sasha Levin <sashal@kernel.org>
  Sebastian Fricke <sebastian.fricke@collabora.com>
  Sebastian Reichel <sebastian.reichel@collabora.com>
  Shay Drory <shayd@nvidia.com>
  Shuah Khan <skhan@linuxfoundation.org>
  Song Liu <song@kernel.org>
  Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
  Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
  Stefan Wahren <wahrenst@gmx.net>
  Steve French <stfrench@microsoft.com>
  Steven 'Steve' Kendall <skend@chromium.org>
  Steven Rostedt (Google) <rostedt@goodmis.org>
  syzbot+e6979a5d2f10ecb700e4@syzkaller.appspotmail.com
  Takashi Iwai <tiwai@suse.de>
  Tariq Toukan <tariqt@nvidia.com>
  Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
  Theodore Ts'o <tytso@mit.edu>
  Thomas Gleixner <tglx@linutronix.de>
  Thomas Weißschuh <linux@weissschuh.net>
  Thomas Zimmermann <tzimmermann@suse.de>
  Tom Parkin <tparkin@katalix.com>
  Tze-nan Wu <Tze-nan.Wu@mediatek.com>
  Vamshi Gajjela <vamshigajjela@google.com>
  Victor Skvortsov <victor.skvortsov@amd.com>
  Waiman Long <longman@redhat.com>
  Wayne Lin <wayne.lin@amd.com>
  Will Deacon <will@kernel.org>
  Wolfram Sang <wsa+renesas@sang-engineering.com>
  Wolfram Sang <wsa@kernel.org>
  Xiaxi Shen <shenxiaxi26@gmail.com>
  Xin Long <lucien.xin@gmail.com>
  Yang Shi <yang@os.amperecomputing.com>
  Yang Wang<kevinyang.wang@amd.com>
  Yang Yingliang <yangyingliang@huawei.com>
  Yann Sionneau <ysionneau@kalrayinc.com>
  Yipeng Zou <zouyipeng@huawei.com>
  Yonghong Song <yonghong.song@linux.dev>
  Yu Kuai <yukuai3@huawei.com>
  Yu Liao <liaoyu15@huawei.com>
  Yves-Alexis Perez <corsac@debian.org>
  Zheng Zucheng <zhengzucheng@huawei.com>
  Zhiguo Niu <zhiguo.niu@unisoc.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  broken  
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 fail    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-armhf-armhf-xl-credit2 broken
broken-step test-armhf-armhf-xl-credit2 host-install(5)

Not pushing.

(No revision log; it would be 4909 lines long.)


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 08:10:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 08:10:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777850.1187902 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seVYS-0007rl-9u; Thu, 15 Aug 2024 08:09:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777850.1187902; Thu, 15 Aug 2024 08:09:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seVYS-0007re-5q; Thu, 15 Aug 2024 08:09:56 +0000
Received: by outflank-mailman (input) for mailman id 777850;
 Thu, 15 Aug 2024 08:09:54 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/2Vq=PO=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seVYQ-0007rI-PX
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 08:09:54 +0000
Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com
 [2a00:1450:4864:20::536])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id beb873b9-5add-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 10:09:50 +0200 (CEST)
Received: by mail-ed1-x536.google.com with SMTP id
 4fb4d7f45d1cf-5b7b6a30454so1012872a12.2
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 01:09:50 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bebc081db4sm557062a12.88.2024.08.15.01.09.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 01:09:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: beb873b9-5add-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723709390; x=1724314190; 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=j3squo8FcuBTyG4Qp7HX2d+/QnPP8p5VEq8m5MomKCs=;
        b=XsRDaFalPNQvKKW9RnITsEKE+Cn8dtS8DHCUSFFZlChraqQW3Cc8vv2630348YKYLg
         4C3zPGXDWBNlmzMdFrbjHvApQP1x/Z/xth99lnUOkuBBJKh/PelKRKENsk6+yR0vz9h3
         kuK9ATFdf8lUlEY6fAk05d/MS1Pl1Am2DP/3NCm325ff9+N+02OjAlZ8YYn+6EIe32y6
         jXKymJvd7dzfvmQp6HQTb+ssso+LI5sfXaP3YNdFpY/zpRe8sz0T/Q4NOBPYrJmH3sfe
         atoR94MRPkblQgtyFMcezyB7koCS+8wsbK4TmHn7d6eyKk1U7VdQGaH5CRDV0EMiSZO4
         yxpw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723709390; x=1724314190;
        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=j3squo8FcuBTyG4Qp7HX2d+/QnPP8p5VEq8m5MomKCs=;
        b=vaJ3yIe9jGmAIhFKaGFFJS7SIkjUpFKgeDzcY88xour5wxJBYQimmJYhJ1cSkjPs6o
         4fzGZV9TRaWFYkaJh8ePELC/59vnEaiNeoniR6YFHVdH9j2gKjS4tI9P9GPZ1mmRlq5A
         4ywpSJGiZTw9+p111K+fRb2e7xDgl5tWk6b1kp2om/eUYCMGF7512B8HfpDe+7qFlYbl
         /gG0NpbLOmD+MI1vrZklukl4VtFr18YjCyejqQp8He0Qhw4rXqxbC0zRrjdP727xszW5
         L3cWJ+GYBkQnLiju23RdXI5E5ZIkQR1UA6sjes1fyrinLykX1pNF6qlkTArtoxAtKi/u
         nLHQ==
X-Forwarded-Encrypted: i=1; AJvYcCVxRGtG49cX7X93y7EQ6dgafV18RRarrc/NKr5srRcxHbF4OWLRGpReNzGjuB+S5ba4XVrpbTjLNRU2kdUR9FndGKIHAPkTImc2ypb1ZFk=
X-Gm-Message-State: AOJu0Yxs32YT4SgdNJY4ZVu1rn4ryixdR9BaHPWlsD59WVWwYbUKKtit
	+z0OvpTp/uvWfrXhbzw1CE5sEQWd8G0kq//N/RjgV2MEhtXSkwZ1CpiwigsECw==
X-Google-Smtp-Source: AGHT+IHEfO9vT1MnMPVTD50+Aw6ODrHY4Z3N7X8+pqiG0RAUr6UxLQ3miIBHrfYHl62XeNqDYSqsiQ==
X-Received: by 2002:a05:6402:274b:b0:5bb:9ae0:4a41 with SMTP id 4fb4d7f45d1cf-5bea1cb05c4mr3236425a12.28.1723709389951;
        Thu, 15 Aug 2024 01:09:49 -0700 (PDT)
Message-ID: <d41f3027-14c8-4716-9444-d8bc109bb2b7@suse.com>
Date: Thu, 15 Aug 2024 10:09:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 6/7] xen/riscv: page table handling
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <8362795280a48702bef6f01d41d148edcf299935.1723214540.git.oleksii.kurochko@gmail.com>
 <85a4e760-07af-42bd-ac27-12a4fa5172cc@suse.com>
 <1e83981cff0b6c47aa941e7ffee0ce658aefef22.camel@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: <1e83981cff0b6c47aa941e7ffee0ce658aefef22.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 14.08.2024 18:50, oleksii.kurochko@gmail.com wrote:
> On Tue, 2024-08-13 at 12:31 +0200, Jan Beulich wrote:
>> On 09.08.2024 18:19, Oleksii Kurochko wrote:
>>> Introduce internal macros starting with PTE_* for convenience.
>>> These macros closely resemble PTE bits, with the exception of
>>> PTE_BLOCK, which indicates that a page larger than 4KB is
>>> needed.
>>
>> I did comment on this too, iirc: Is there going to be any case where
>> large pages are going to be "needed", i.e. not just preferred? If
>> not,
>> giving the caller control over things the other way around
>> (requesting
>> 4k mappings are needed, as we have it in x86) may be preferable.
> Yes, you did the comment but I thought that it will be enough to
> mention that shattering isn't supported now and  also since
> pt_update_entry()is used to unmap as well, there could be a need to
> unmap e.g. 4K page from 2M block mapping what will a little bit harder
> then just having 4k by default.

Shattering isn't supported now, but that's going to change at some point,
I suppose. Where possible the long-term behavior wants taking into account
right away, to avoid having to e.g. touch all callers again later on.

>> Hmm, but then ...
>>
>>> RISC-V detects superpages using `pte.x` and `pte.r`, as there
>>> is no specific bit in the PTE for this purpose. From the RISC-V
>>> spec:
>>> ```
>>>   ...
>>>   4. Otherwise, the PTE is valid. If pte.r = 1 or pte.x = 1, go to
>>> step 5.
>>>      Otherwise, this PTE is a pointer to the next level of the page
>>> table.
>>>      ... .
>>>   5. A leaf PTE has been found.
>>>      ...
>>>   ...
>>> ```
>>>
>>> The code doesn’t support super page shattering so 4KB pages are
>>> used as
>>> default.
>>
>> ... you have this. Yet still callers expecting re-mapping in the
>> (large)
>> range they map can request small-page mappings right away.
> I am not sure that I fully understand what do you mean by "expcting re-
> mapping".

Right now you have callers pass PTE_BLOCK when they know that no small
page re-mappings are going to occur for an area. What I'm suggesting is
that you invert this logic: Have callers pass PTE_SMALL when there is
a possibility that re-mapping requests may be issued later. Then,
later, by simply grep-ing for PTE_SMALL you'll be able to easily find
all candidates that possibly can be relaxed when super-page shattering
starts being supported. That's going to be easier than finding all
instances where PTE_BLOCK is _not_used.

>>> --- a/xen/arch/riscv/include/asm/flushtlb.h
>>> +++ b/xen/arch/riscv/include/asm/flushtlb.h
>>> @@ -5,12 +5,25 @@
>>>  #include <xen/bug.h>
>>>  #include <xen/cpumask.h>
>>>  
>>> +#include <asm/sbi.h>
>>> +
>>>  /* Flush TLB of local processor for address va. */
>>>  static inline void flush_tlb_one_local(vaddr_t va)
>>>  {
>>>      asm volatile ( "sfence.vma %0" :: "r" (va) : "memory" );
>>>  }
>>>  
>>> +/*
>>> + * Flush a range of VA's hypervisor mappings from the TLB of all
>>> + * processors in the inner-shareable domain.
>>> + */
>>> +static inline void flush_tlb_range_va(vaddr_t va,
>>> +                                      size_t size)
>>
>> No need for line wrapping here?
> What is line wrapping here? Do you mean that size_t size should be on
> the previous line?

Yes. Everything will fit on one line quite nicely.

>>> --- /dev/null
>>> +++ b/xen/arch/riscv/pt.c
>>> @@ -0,0 +1,408 @@
>>> +#include <xen/bug.h>
>>> +#include <xen/domain_page.h>
>>> +#include <xen/errno.h>
>>> +#include <xen/mm.h>
>>> +#include <xen/mm-frame.h>
>>> +#include <xen/pmap.h>
>>> +#include <xen/spinlock.h>
>>> +
>>> +#include <asm/flushtlb.h>
>>> +#include <asm/page.h>
>>> +
>>> +static inline const mfn_t get_root_page(void)
>>> +{
>>> +    unsigned long root_maddr =
>>
>> maddr_t or paddr_t?
>>
>>> +        (csr_read(CSR_SATP) & SATP_PPN_MASK) << PAGE_SHIFT;
>>> +
>>> +    return maddr_to_mfn(root_maddr);
>>> +}
>>> +
>>> +/*
>>> + * Sanity check of the entry
>>> + * mfn is not valid and we are not populating page table. This
>>> means
>>
>> How does this fit with ...
>>
>>> + * we either modify entry or remove an entry.
>>> + */
>>> +static bool pt_check_entry(pte_t entry, mfn_t mfn, unsigned int
>>> flags)
>>> +{
>>> +    /* Sanity check when modifying an entry. */
>>> +    if ( (flags & PTE_VALID) && mfn_eq(mfn, INVALID_MFN) )
>>
>> ... the MFN check here?
> The comment is incorrect and should be corrected:
> " if mfn is valid or ... "
> 
>>  And why is (valid,INVALID_MFN) an indication
>> of a modification? But then ...
> the explanation is in the comment to pt_update():
>    /*
>     * If `mfn` equals `INVALID_MFN`, it indicates that the following page
>    table
>     * update operation might be related to either populating the table,
>     * destroying a mapping, or modifying an existing mapping.
>     */
>    static int pt_update(unsigned long virt,

And how do readers know that comments in pt_update() are crucial for
understanding what pt_check_entry() does? You certainly don't need to
have the same comment in two places, but you at least want to refer
to a relevant comment when that lives elsewhere.

>>> +static int pt_update(unsigned long virt,
>>> +                     mfn_t mfn,
>>> +                     unsigned long nr_mfns,
>>> +                     unsigned int flags)
>>> +{
>>> +    int rc = 0;
>>> +    unsigned long vfn = virt >> PAGE_SHIFT;
>>> +    unsigned long left = nr_mfns;
>>> +
>>> +    const mfn_t root = get_root_page();
>>> +
>>> +    /*
>>> +     * It is bad idea to have mapping both writeable and
>>> +     * executable.
>>> +     * When modifying/creating mapping (i.e PTE_VALID is set),
>>> +     * prevent any update if this happen.
>>> +     */
>>> +    if ( (flags & PTE_VALID) && PTE_W_MASK(flags) &&
>>> PTE_X_MASK(flags) )
>>> +    {
>>> +        printk("Mappings should not be both Writeable and
>>> Executable.\n");
>>> +        return -EINVAL;
>>> +    }
>>> +
>>> +    if ( !IS_ALIGNED(virt, PAGE_SIZE) )
>>> +    {
>>> +        printk("The virtual address is not aligned to the page-
>>> size.\n");
>>> +        return -EINVAL;
>>> +    }
>>> +
>>> +    spin_lock(&xen_pt_lock);
>>> +
>>> +    while ( left )
>>> +    {
>>> +        unsigned int order, level;
>>> +
>>> +        level = pt_mapping_level(vfn, mfn, left, flags);
>>> +        order = XEN_PT_LEVEL_ORDER(level);
>>> +
>>> +        ASSERT(left >= BIT(order, UL));
>>> +
>>> +        rc = pt_update_entry(root, vfn << PAGE_SHIFT, mfn, level,
>>> +                                    flags);
>>
>> Indentation.
>>
>>> +        if ( rc )
>>> +            break;
>>> +
>>> +        vfn += 1U << order;
>>> +        if ( !mfn_eq(mfn, INVALID_MFN) )
>>> +            mfn = mfn_add(mfn, 1U << order);
>>> +
>>> +        left -= (1U << order);
>>
>> To be on thje safe side, 1UL everywhere?
>>
>>> +        if ( rc )
>>> +            break;
>>
>> There was such a check already a few lines up from here.
>>
>>> +    }
>>> +
>>> +
>>> +    /* ensure that PTEs are all updated before flushing */
>>
>> Again: No double blank lines please.
>>
>>> +    RISCV_FENCE(rw, rw);
>>> +
>>> +    /*
>>> +     * always flush TLB at the end of the function as non-present
>>> entries
>>> +     * can be put in the TLB
>>> +     */
>>> +    flush_tlb_range_va(virt, PAGE_SIZE * nr_mfns);
>>
>> Coming back to "negative" TLB entries: Assuming RISC-V, just like
>> other
>> architectures, also permits intermediate page table entries to be
>> cached,
>> the affected VA range may be much larger than the original request,
>> if
>> intermediate page tables needed creating.
> It could be an issue. Could we some how  to calculate the proper range
> or the only option we have is to flush all.

Right - either you maintain state to know the biggest possible range
that can be affected, or you flush all when a new intermediate page
table needed inserting.

>>> +    spin_unlock(&xen_pt_lock);
>>
>> Does this really need to come after fence and flush?
> I think yes, as page table should be updated only by 1 CPU at the same
> time. And before give ability to other CPU to update page table we have
> to finish a work on current CPU.

Can you then explain to me, perhaps by way of an example, what will go
wrong if the unlock is ahead of the flush? (I'm less certain about the
fence, and that's also less expensive.)

>>> +int map_pages_to_xen(unsigned long virt,
>>> +                     mfn_t mfn,
>>> +                     unsigned long nr_mfns,
>>> +                     unsigned int flags)
>>> +{
>>> +    /*
>>> +     * Ensure that we have a valid MFN before proceeding.
>>> +     *
>>> +     * If the MFN is invalid, pt_update() might misinterpret the
>>> operation,
>>> +     * treating it as either a population, a mapping destruction,
>>> +     * or a mapping modification.
>>> +     */
>>> +    ASSERT(!mfn_eq(mfn, INVALID_MFN));
>>
>> But flags with PTE_VALID not set are fine to come into here?
> It is fine for pt_update() but I don't know if it is fine for
> map_pages_to_xen(). I see that other architectures don't check that.

That's not my point here. It's rather along the lines of an earlier
that I gave here: Since pte_update() is a pretty generic function, will
flags not having PTE_VALID set perhaps result in pte_update() doing
something that's not what the caller might expect?

And yes, there's a special case of map_pages_to_xen() being called with
_PAGE_NONE (if an arch defines such). That special case plays into here:
If an arch doesn't define it, unmap requests ought to exclusively come
through destroy_xen_mappings().

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 08:16:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 08:16:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777858.1187912 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seVep-0001PT-Vj; Thu, 15 Aug 2024 08:16:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777858.1187912; Thu, 15 Aug 2024 08:16:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seVep-0001PM-S4; Thu, 15 Aug 2024 08:16:31 +0000
Received: by outflank-mailman (input) for mailman id 777858;
 Thu, 15 Aug 2024 08:16:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=qQtD=PO=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1seVeo-0001PG-KJ
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 08:16:30 +0000
Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com
 [2a00:1450:4864:20::22d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ac8603aa-5ade-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 10:16:29 +0200 (CEST)
Received: by mail-lj1-x22d.google.com with SMTP id
 38308e7fff4ca-2f1a7faa4d4so6122261fa.0
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 01:16:29 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f3b7703337sm1291101fa.95.2024.08.15.01.16.28
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 15 Aug 2024 01:16:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ac8603aa-5ade-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723709789; x=1724314589; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=JXzI3bPd2VCOBlBwqFGePKfao7CFS/n+ifVD1NkoPFI=;
        b=Ld9KHvfzYG5jl+Mi5JD5TLi9LynleOzZ1QJA6Sro6XVJ+AT+JXpw7WH6QrtaOqDywJ
         EQjBhGIdDXai1nwujuXECeI6LSlcYzmVm6SwrL+8e7fHy9QlgNedhCnIQS3ootNEksv3
         JWDKis7SLo11E47pgvyPwaAGwUte962r23DpoOTnkokcncAXk3LQuepMWGOUKpl7R82+
         zhQZV1hFPLsoBLJjlk1ioycQgwZPCanHF4p2hFQPAOoxswGLNbG8XyHGHccnf0nhrL/o
         KhL5d/2whhRn9m0guWs4pPHdMtPYQsS7OAO8diQu90Taby3gqDvbboqxi+PXwcloKgpf
         GoUw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723709789; x=1724314589;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=JXzI3bPd2VCOBlBwqFGePKfao7CFS/n+ifVD1NkoPFI=;
        b=cxmp/uIbY4UYFwrPiLTMu7HSUk6yyS3AS4bgGM6Ofp2BXFRIYcGQHOtTK6rYPz4NeP
         /jqf5zjlTuQNfWuMpOXCnAliemDQgMpt/ksdqpc9q2Sdo7DwjTmah7ojc1SSvLtE8mtf
         ITG24QvcCtWSyVIBjSTuC/Bdd4qirlK1Yg1fIqgLlCte88g8b2jH583VPahjS5rtD1Zs
         2rgZ7KyHc5ksIW4m9dPgpM45D/IHbvigeF9SOdw/3VZFObMj2FF/FGtnww+6zHLCyGqW
         ZjYIsge0Z28v+o6K12/QDWaNSuaIZOD1dM9jASo4bj8U4Cd/WfWZORatZJQgyOGMI1dh
         AzSw==
X-Forwarded-Encrypted: i=1; AJvYcCX7CWMJrSYXEmCiUvV6Z9OxvQ+2DiK6VuRev6Ong1U5nfpK6eo1QawEqKSnRk1msWntR8dVoVpR3WcKSE6wQcC/DiLMbJtEc/m90iZ5kuQ=
X-Gm-Message-State: AOJu0YwCK40NjAuJz1ix852pB8M7q63xOYue9XrOzp7V/V1NQMitiVxu
	p0q12jJft/dNNflzL/piqLetSoqYXuDGJ1uNY5L/8DztT9CBYCe7
X-Google-Smtp-Source: AGHT+IGm0m4VYILV0AC5bthO3p6Y+hxcXgAaPAVuNMJI9Ng11y+/9jxzguiZYgx/iu8VmQ7b37cDlw==
X-Received: by 2002:a2e:4e09:0:b0:2ef:290e:4a30 with SMTP id 38308e7fff4ca-2f3b3bb7d19mr4711581fa.16.1723709788577;
        Thu, 15 Aug 2024 01:16:28 -0700 (PDT)
Message-ID: <06100e9d45d63b98c8fa4efacdc0a73f88690de0.camel@gmail.com>
Subject: Re: [PATCH v4 2/7] xen/riscv: set up fixmap mappings
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Thu, 15 Aug 2024 10:16:27 +0200
In-Reply-To: <bede9f51-0278-4c97-9c0d-ee3478373d72@suse.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
	 <1c1c0f912a9abbb542baa1ce92e75d64ec8043e9.1723214540.git.oleksii.kurochko@gmail.com>
	 <07f19bb5-bd76-4158-875e-48f74e427a89@suse.com>
	 <9361b63712bffc7bb0cb6bb1fc5954ade18314d2.camel@gmail.com>
	 <bede9f51-0278-4c97-9c0d-ee3478373d72@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Wed, 2024-08-14 at 17:08 +0200, Jan Beulich wrote:
> On 14.08.2024 16:21, oleksii.kurochko@gmail.com=C2=A0wrote:
> > On Tue, 2024-08-13 at 10:22 +0200, Jan Beulich wrote:
> > > On 09.08.2024 18:19, Oleksii Kurochko wrote:
> > > > --- a/xen/arch/riscv/include/asm/page.h
> > > > +++ b/xen/arch/riscv/include/asm/page.h
> > > > @@ -81,6 +81,12 @@ static inline void
> > > > flush_page_to_ram(unsigned
> > > > long mfn, bool sync_icache)
> > > > =C2=A0=C2=A0=C2=A0=C2=A0 BUG_ON("unimplemented");
> > > > =C2=A0}
> > > > =C2=A0
> > > > +/* Write a pagetable entry. */
> > > > +static inline void write_pte(pte_t *p, pte_t pte)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 *p =3D pte;
> > > > +}
> > >=20
> > > No use of write_atomic() here? And no read_pte() counterpart
> > > right
> > > away (then
> > > also properly using read_atomic())?
> > I wanted to avoid the fence before "*p=3Dpte" which in case of
> > write_atomic() will be present.
>=20
> Well, this goes back to write_atomic() resolving to write{b,w,l,q}()
> for
> unclear reasons; even the comment in our atomic.h says "For some
> reason".
> The fence there is of course getting in the way here. I keep
> forgetting
> about that aspect, because neither x86 nor Arm has anything similar
> afaics.
Good point. I overlooked something here ( and misinterpreted your
comments regarding that write_atomic() implementation ) but I think it
would be better to use write{b,w,l,q}_cpu() for write_atomic.

~ Oleksii

>=20
> > Won't it be enough to use here WRITE_ONCE()?
>=20
> Maybe. I'm not entirely sure.
>=20
> Jan



From xen-devel-bounces@lists.xenproject.org Thu Aug 15 08:31:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 08:31:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777866.1187921 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seVst-0004SR-3t; Thu, 15 Aug 2024 08:31:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777866.1187921; Thu, 15 Aug 2024 08:31:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seVst-0004SK-1G; Thu, 15 Aug 2024 08:31:03 +0000
Received: by outflank-mailman (input) for mailman id 777866;
 Thu, 15 Aug 2024 08:31:01 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/2Vq=PO=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seVsr-0004SC-5G
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 08:31:01 +0000
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com
 [2a00:1450:4864:20::52d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b2ae61e9-5ae0-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 10:30:59 +0200 (CEST)
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-5a156557029so893075a12.2
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 01:30:59 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838eeedasm66156866b.94.2024.08.15.01.30.57
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 01:30:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b2ae61e9-5ae0-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723710658; x=1724315458; 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=KqhNUKWzkX3Hsi9auKRVSa8W8ju7kY0xwhZtcv9t7vU=;
        b=QJc236j2eQPU7LRE19TO1D8Ck2lrVWWFUxQvkbKJfJ8ZPv+vvga2azbkyOXv+HsBI1
         iqxNmYatPtPFHLZ1xaFPxFPhA4tUCCpsPPiPIrj8/RXEWkEvh2uxDQ49DCo3OItRgYBV
         S5Vi54QG7l6lZh3vnECrxmnxkd3Qx90ZLkVVyDvYdIPQ3jUPqjln3u/L6qZfVezQ7xDt
         A8wlzsdu8FiRayWDnsGi1yX4m4XF2PYRfMBnb6IKzryYsKeRp8Iz3J/01tYqArIuBAxh
         4/T4GZnGrBj5K1Ks/+taGH4JJlEyHvJcHxdtZS3vqOpPdrW2J3jc1geDu6RnNLFmzRJn
         eRVw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723710658; x=1724315458;
        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=KqhNUKWzkX3Hsi9auKRVSa8W8ju7kY0xwhZtcv9t7vU=;
        b=Hhy94Qi1YCMZsWpn1MZ3LdcdgOW8UKhtP8tUrSHVnBVPscW41o0XI5tC0eQ/XXD+uY
         G4uG3y4WPdHbVQAULUPTSAyjbs52XfDP4FGfeRicIoKNwvg3/lox8pMQtkuMBUcnYR2J
         Pzv4sREuK5dSx7MSbK9fIjDujlUEg9oysxndzNItkV9XseZXLt9ED9t0Tf7Ac1iF6yAa
         0IWZVVqc+x+1asjIQfb6IcP/TYASpS2tq+Eozdo9UlwNU2g3fqT57iWscxLgs1xqibyV
         iLIMUpxxJZPKVkJqRIWlLwvubAWBKBpy/mVjP1hEa/n+NWvwqnXp2FU9SzxlHuZsGd/Z
         Loyg==
X-Forwarded-Encrypted: i=1; AJvYcCVc5MnszNut8yc8EOGcvC1lgT+brrB9fWahjmrNsYOyNxnlWlZArEQkn60g9XxcUMRhf/IcRMZR7zLBQzFgFll6bCTvdvkpEdT5hzFcYtM=
X-Gm-Message-State: AOJu0Yx4YFdj2+Z9IJFQR8fjr+zhTk7d8KXh4JibkasjjtycAOWdl6by
	GhgXEtaq4710DsEJU8UJRp/sE4u+PAdeqOEIyQ907LbYcCh0wy85Uvg6yfNy/w==
X-Google-Smtp-Source: AGHT+IHHan37+3OyJBa+8vyR/+kSxbcoKZqvQ36DMIkHxcyLiExWC/VU6EJiUU6znXLwiIy+P4dR+Q==
X-Received: by 2002:a17:907:f704:b0:a7d:a00a:a9fe with SMTP id a640c23a62f3a-a8366c3130dmr357437566b.17.1723710658326;
        Thu, 15 Aug 2024 01:30:58 -0700 (PDT)
Message-ID: <ca41d1d0-a1b7-481b-ab80-f8dc79ea95b1@suse.com>
Date: Thu, 15 Aug 2024 10:30:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/cpufeatures: Add new cpuid features in SPR to
 featureset
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 xen-devel@lists.xenproject.org, Matthew Barnes <matthew.barnes@cloud.com>
References: <09353a67d79b12f2ff2a9be797866902bcd71825.1723650205.git.matthew.barnes@cloud.com>
 <d2a71d20-d3c5-45cc-9e3e-10a0773508a0@suse.com>
 <9dec870a-5bdc-4539-afe9-228afb40249a@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <9dec870a-5bdc-4539-afe9-228afb40249a@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 14.08.2024 18:46, Andrew Cooper wrote:
> On 14/08/2024 4:58 pm, Jan Beulich wrote:
>> On 14.08.2024 17:52, Matthew Barnes wrote:
>>> Upon running `xen-cpuid -d` on a host machine with Sapphire Rapids
>>> within Dom0, there exist unrecognised features.
>> Without looking at the particular bits yet, just a question up front:
>> Why SPR?
> 
> Because it's what we have easily to hand right now.
> 
> I veto'd doing this based on pre-release hardware, because they often
> contain NDA content which we shouldn't be publishing, or at least
> "publishing yet".
> 
> We should be getting production EMR soon.

Surely I didn't ask for anything not public yet. Yet what about Alder
Lake? That looks to have KeyLocker (patches for which I didn't even
post yet, for multiple reasons) and 7:1.eax[22] (whatever that is) on
top of what SPR has.

>>  There's newer hardware available with presumably yet more newly
>> used bits. If the goal is to cover everything that's known, this is only
>> one step in the right direction.
> 
> Correct, but it is *a* step, and that's fine.
> 
> We anticipate doing patches like this for every new generation, as part
> of our own checks to support the CPU.  Right now there's a bit of a backlog.

Right. What you stripped of my earlier reply is "Which would be okay if
expressed that way, ideally with a plan to subsequently go further."

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 08:33:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 08:33:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777873.1187932 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seVvh-000513-Hi; Thu, 15 Aug 2024 08:33:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777873.1187932; Thu, 15 Aug 2024 08:33:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seVvh-00050w-F2; Thu, 15 Aug 2024 08:33:57 +0000
Received: by outflank-mailman (input) for mailman id 777873;
 Thu, 15 Aug 2024 08:33:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=oSYy=PO=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1seVvf-00050o-Tr
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 08:33:55 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1af7394b-5ae1-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 10:33:54 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-53310adb4c3so261909e87.3
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 01:33:54 -0700 (PDT)
Received: from ?IPV6:2003:e5:8741:4a00:60e5:7bee:fc48:e85c?
 (p200300e587414a0060e57beefc48e85c.dip0.t-ipconnect.de.
 [2003:e5:8741:4a00:60e5:7bee:fc48:e85c])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a838396c682sm65477466b.196.2024.08.15.01.33.52
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 01:33:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1af7394b-5ae1-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723710833; x=1724315633; 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=/fewEhSihwMs4ydWbbFvlM4BIxeK1PRq9egoOjfLoXg=;
        b=a3F5onFK4at9N5338LefehjEWrmT5YmZ4vp/diuRcA2B9tzDpYM36QRJrTsOckSqB6
         soel8dJiTqH7FExgLq+6JAQuHg5Uyq79+rPx6JmqdVoVu6JN2PLQC4bZo+VqacRpk5Fr
         cu1LLj1t4MxJoYoo1e6FvnAR6emcpNE1Ru8+wWG4BLfoE/KCkfWo0/3WJM01DWcBBVb9
         9CMm5Zb8nwj1R3EtYEa7c2kbLtu4jfDmJ4OUVrhov7EFoHlIfgZ/NhBKLD/i5Ng4+PpB
         ZEOqLdq6fEcj/x2T9KTyENLrFCqick56X2gT1P0eBW2FsFMXF0qlJf06wdKjh/OeOcus
         6c0A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723710833; x=1724315633;
        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=/fewEhSihwMs4ydWbbFvlM4BIxeK1PRq9egoOjfLoXg=;
        b=hXcQLw2QsBgPU59VkzYx4NgMajQ1vpAtuuu9aek89YzB/5/sP7hdEqK3LBEkfWInam
         LflRWoRaYXyMPvmgPeVbuGoItnZwRblWZ4WSWi2aVul3Ldzol4avMnA7aI6O0F8afEJB
         O6jUsk0XfdUuO9S+SYnrwzJS5Uld6tWzKBXljZyZUssKhe+6jurvCLiCaqDLS9agu9DF
         +KQ85IqSnOxMsdPEC9ehyQ9FVLL0422Tmq3Ym7SY6GOTKbye5LIzmY/YrnS+FzT1EVtg
         moe/VEAeNBY6qJvZeyj3rc8Ui9yI4INgpUmh1Xvm3PVZlYBNR1Vmrq3s7VRCyQjSzSfD
         cxCw==
X-Forwarded-Encrypted: i=1; AJvYcCVi4EsPDKYqBh8U0e5bPG9kng/Qd9F3mjqAY0ZBYcXf+GqftU2deACE4d/2KykhjLuvYYoOnZG3O9+ibDkJ1LrZsPboTrX80Gjr3lFbUUE=
X-Gm-Message-State: AOJu0Yyq0+KKY+uLL0wyeqgGAehZnzPw9zg72vjF+JZjnzyvpHNXdvdz
	WGFx/COeLgk1x9tG2PnHTWvyqcz49zRXNjM1KVwY/2pUtavsbnGlVau1AYZ+3rI=
X-Google-Smtp-Source: AGHT+IGhQsbZdJEnIBq4LM1umZZofaHed6HYN1mmlrp65h77hIhD2GbpUlRz1nIr9GkqCgknBd9Tug==
X-Received: by 2002:a05:6512:3b91:b0:530:aa05:eb7c with SMTP id 2adb3069b0e04-532edba8734mr3573302e87.38.1723710833194;
        Thu, 15 Aug 2024 01:33:53 -0700 (PDT)
Message-ID: <07396e04-1def-447a-b83b-ffe3a5b01fbe@suse.com>
Date: Thu, 15 Aug 2024 10:33:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: AMD EPYC virtual network performances
To: Elliott Mitchell <ehem+xen@m5p.com>
Cc: Andrei Semenov <andrei.semenov@vates.tech>,
 xen-devel@lists.xenproject.org, Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <959bbf84-24da-4da3-a059-dc1aa32b27ef@vates.tech>
 <352bba40-27fc-416b-985f-20e66c0c4b72@suse.com>
 <Zrqykdarr7JHaeOZ@mattapan.m5p.com>
 <ab4ca68e-ec1b-467f-9b89-38f63cc19b7c@suse.com>
 <ZruckufSjT0GkpJt@mattapan.m5p.com>
 <d556e168-8542-4b93-81a9-a7054b5b69ba@suse.com>
 <Zrvf5wgm6xEI63x2@mattapan.m5p.com>
 <e95ab71d-b985-4ab7-994b-1c562efd5f9f@suse.com>
 <Zr0S-2QBf3lkBkfS@mattapan.m5p.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
In-Reply-To: <Zr0S-2QBf3lkBkfS@mattapan.m5p.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 14.08.24 22:26, Elliott Mitchell wrote:
> On Wed, Aug 14, 2024 at 08:15:38AM +0200, Jürgen Groß wrote:
>> On 14.08.24 00:36, Elliott Mitchell wrote:
>>> On Tue, Aug 13, 2024 at 08:55:42PM +0200, Jürgen Groß wrote:
>>>> On 13.08.24 19:49, Elliott Mitchell wrote:
>>>>>
>>>>> There is a possibility spurious interrupts are being turned into spurious
>>>>> events by the back-end drivers.
>>>>
>>>> No, I don't think so.
>>>>
>>>>> Jürgen Groß, what is the performance impact of "iommu=debug"?  Seems to
>>>>> mostly cause more reporting and have minimal/no performance effect.
>>>>
>>>> I guess you are referring to the Xen option? I'm no expert in this
>>>> area.
>>>
>>> Drat.  I haven't noticed much, which would match with simply enabling a
>>> bunch of debugging printk()s (alas I'm not monitoring performance closely
>>> enough to be sure).  Guess I wait for Andrei Semenov to state a comfort
>>> level with trying "iommu=debug".
>>
>> You didn't answer my question.
> 
> I guess I did not explicitly do so.  I was referring to the Xen
> command-line option.

And again you didn't supply the information I asked for (command line
options of Xen and dom0).

Did you consider that asking for help while not supplying data which has
been asked for is going to result in no help at all? You are wasting the
time of volunteers, which will reduce the motivation to look into your
issue a lot.

That said, I won't look into your problems any longer, as I have a job
to do and I can spend my time much better than trying to help someone who
isn't willing to answer even the simplest questions.


Juergen


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 08:37:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 08:37:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777887.1187942 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seVyb-0006Hf-0z; Thu, 15 Aug 2024 08:36:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777887.1187942; Thu, 15 Aug 2024 08:36:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seVya-0006HY-UP; Thu, 15 Aug 2024 08:36:56 +0000
Received: by outflank-mailman (input) for mailman id 777887;
 Thu, 15 Aug 2024 08:36:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/2Vq=PO=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seVyZ-0006HS-Hk
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 08:36:55 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 85e9a88a-5ae1-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 10:36:53 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a7a94aa5080so86700166b.3
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 01:36:53 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838c66e2sm66790566b.3.2024.08.15.01.36.52
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 01:36:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 85e9a88a-5ae1-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723711013; x=1724315813; 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=bk8zEpm1lmyf8bdGBPSlDNf3UdBO3B2Frzfb44sdbPw=;
        b=MGHh5/I1ErqBW5vHvVpDqXbD/tdPRd8qraFpm/O+ExPP+4gRKwMzGpdXruQARgdGHC
         mY6HYhhzmPi1aMZV3X4keSUz/8Rv/Ocnvz0qZF9y43xiD4F+Mxa9ol9zYoaNFgnCk63H
         MPwJlEgRoIfvFruOb/HzlPHBFJTVGyqg/WlkzPpgxRJ6tVc8iUOtB/bH93+aLP9WEB1w
         PK3JiGgPnBZ/Z+iCNOUjAbhDxKt/sz+iJ+CPRHajj/6Kwzi02K7DhaB4anS+C61l/Y4q
         7EMqWwYxZzk7lSVxRMJz+GgX8+vePzjSyE0GOORlnmwm12DAtEwfaqZGTEE2siAhqEWS
         qMeA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723711013; x=1724315813;
        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=bk8zEpm1lmyf8bdGBPSlDNf3UdBO3B2Frzfb44sdbPw=;
        b=mQmp3HYv4EXfPNETSZgWcrdlNZ0bGJZCrA+NJEM8TXf3su31E82tj2ADPccn6brdy6
         BgS5SO3ymcdxEFIV55QbCtsNGDyaSSoJEndKxNHt7FjUyFa8ymkIaTsTzCulUewd1t2f
         Ag6dEJjjbPQUpTbUDEP/oMDMsTROHVASqHtYShNjnWtv/DoLVOTRUnqteJDNLqixktX2
         Xt5wXhK3xfzBFdx85GispRxJ/kdDMmCz2WHIZHVTfT/ilkw9F1mflP95RqWKdtkL/aJp
         +3/yeeunALMIHeanOC7XE9r+O4BR2/5aAd1U7qL1Mrr6gnt2R1Nq5A16rIL5oSTEazVO
         eg0Q==
X-Forwarded-Encrypted: i=1; AJvYcCVZqUuILL1FzUxoU2iH8GtUj905xZVYVyqk0e6rsVMXQpjva2ZaA3HLksjYEy4W3CM6WR4zn4ffFV4fjqgsaVl+FOkO8XmHp/FHUp33J9k=
X-Gm-Message-State: AOJu0Yyvp7S7CsJKQ/b6YNXe3BG71Luvt+ag304cq5Z3apu7vwM5dtH9
	jpjp60bBG4GGZdUriKQWX7kc31ilF/U7SR37q3TfYl+X44qJxMhrZC+rX6fLow==
X-Google-Smtp-Source: AGHT+IEpLY2uWUJUtjt0JXrjRlOfiljfZHuC6Bod/bcsR7vfACArXKpW6n9k4p7C5Ykd7+qgtXVFLA==
X-Received: by 2002:a17:907:c891:b0:a7a:bb54:c858 with SMTP id a640c23a62f3a-a8366d39467mr360479066b.26.1723711012652;
        Thu, 15 Aug 2024 01:36:52 -0700 (PDT)
Message-ID: <8c0d428f-5122-4ec7-ab3b-3f61f6322211@suse.com>
Date: Thu, 15 Aug 2024 10:36:51 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/msi: fix locking for SR-IOV devices
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <20240812203938.981588-1-stewart.hildebrand@amd.com>
 <74f88a45-a632-4ca6-9cee-95f52370b397@suse.com>
 <c05c9312-e729-48fb-942f-fbb378cd097a@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <c05c9312-e729-48fb-942f-fbb378cd097a@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 15.08.2024 03:28, Stewart Hildebrand wrote:
> On 8/13/24 10:01, Jan Beulich wrote:
>> On 12.08.2024 22:39, Stewart Hildebrand wrote:
>>> In commit 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci
>>> structure") a lock moved from allocate_and_map_msi_pirq() to the caller
>>> and changed from pcidevs_lock() to read_lock(&d->pci_lock). However, one
>>> call path wasn't updated to reflect the change, leading to a failed
>>> assertion observed under the following conditions:
>>>
>>> * PV dom0
>>> * Debug build (debug=y) of Xen
>>> * There is an SR-IOV device in the system with one or more VFs enabled
>>> * Dom0 has loaded the driver for the VF and enabled MSI-X
>>>
>>> (XEN) Assertion 'd || pcidevs_locked()' failed at drivers/passthrough/pci.c:535
>>> (XEN) ----[ Xen-4.20-unstable  x86_64  debug=y  Not tainted ]----
>>> ...
>>> (XEN) Xen call trace:
>>> (XEN)    [<ffff82d040284da8>] R pci_get_pdev+0x4c/0xab
>>> (XEN)    [<ffff82d040344f5c>] F arch/x86/msi.c#read_pci_mem_bar+0x58/0x272
>>> (XEN)    [<ffff82d04034530e>] F arch/x86/msi.c#msix_capability_init+0x198/0x755
>>> (XEN)    [<ffff82d040345dad>] F arch/x86/msi.c#__pci_enable_msix+0x82/0xe8
>>> (XEN)    [<ffff82d0403463e5>] F pci_enable_msi+0x3f/0x78
>>> (XEN)    [<ffff82d04034be2b>] F map_domain_pirq+0x2a4/0x6dc
>>> (XEN)    [<ffff82d04034d4d5>] F allocate_and_map_msi_pirq+0x103/0x262
>>> (XEN)    [<ffff82d04035da5d>] F physdev_map_pirq+0x210/0x259
>>> (XEN)    [<ffff82d04035e798>] F do_physdev_op+0x9c3/0x1454
>>> (XEN)    [<ffff82d040329475>] F pv_hypercall+0x5ac/0x6af
>>> (XEN)    [<ffff82d0402012d3>] F lstar_enter+0x143/0x150
>>>
>>> In read_pci_mem_bar(), the VF obtains the struct pci_dev pointer for its
>>> associated PF to access the vf_rlen array. This array is initialized in
>>> pci_add_device() and is only populated in the associated PF's struct
>>> pci_dev.
>>>
>>> Add a link from the VF's struct pci_dev to the associated PF struct
>>> pci_dev, ensuring the PF's struct doesn't get deallocated until all its
>>> VFs have gone away. Access the vf_rlen array via the new link to the PF,
>>> and remove the troublesome call to pci_get_pdev().
>>>
>>> Add a call to pci_get_pdev() inside the pcidevs_lock()-locked section of
>>> pci_add_device() to set up the link from VF to PF. In case the new
>>> pci_add_device() invocation fails to find the associated PF (returning
>>> NULL), we are no worse off than before: read_pci_mem_bar() will still
>>> return 0 in that case.
>>>
>>> Note that currently the only way for Xen to know if a device is a VF is
>>> if the toolstack tells Xen about it. Using PHYSDEVOP_manage_pci_add for
>>> a VF is not a case that Xen handles.
>>
>> How does the toolstack come into play here? It's still the Dom0 kernel to
>> tell Xen, via PHYSDEVOP_pci_device_add (preferred) or
>> PHYSDEVOP_manage_pci_add_ext (kind of deprecated; PHYSDEVOP_manage_pci_add
>> is even more kind of deprecated).
> 
> I guess I meant to say Dom0 kernel, not toolstack. I'm actually
> questioning how much value this last portion of the commit description
> is really adding. Maybe it would be better to just remove this bit.

+1

>>> @@ -446,7 +448,27 @@ static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
>>>  
>>>      list_del(&pdev->alldevs_list);
>>>      pdev_msi_deinit(pdev);
>>> -    xfree(pdev);
>>> +
>>> +    if ( pdev->info.is_virtfn )
>>> +    {
>>> +        struct pci_dev *pf_pdev = pdev->virtfn.pf_pdev;
>>> +
>>> +        if ( pf_pdev )
>>> +        {
>>> +            list_del(&pdev->virtfn.next);
>>> +            if ( pf_pdev->physfn.dealloc_pending &&
>>> +                 list_empty(&pf_pdev->physfn.vf_list) )
>>> +                xfree(pf_pdev);
>>> +        }
>>> +        xfree(pdev);
>>> +    }
>>> +    else
>>> +    {
>>> +        if ( list_empty(&pdev->physfn.vf_list) )
>>> +            xfree(pdev);
>>> +        else
>>> +            pdev->physfn.dealloc_pending = true;
>>> +    }
>>
>> Could I talk you into un-indenting the last if/else by a level, by making
>> the earlier else and "else if()"?
>>
>> One aspect I didn't properly consider when making the suggestion: What if,
>> without all VFs having gone away, the PF is re-added? In that case we
>> would better recycle the existing structure. That's getting a little
>> complicated, so maybe a better approach is to refuse the request (in
>> pci_remove_device()) when the list isn't empty?
> 
> Hm. Right. The growing complexity of maintaining these PF<->VF links
> (introduced on a hunch that they may be useful in the future) is making
> me favor the previous approach from v2 of simply copying the vf_len
> array. So unless there are any objections I'll go back to that approach
> for v4.

I continue to consider the earlier approach at least undesirable. The
vf_len[] array shouldn't be copied around, risking for it to be / go
stale. There should be one central place for every bit of information,
unless there are very good reasons to duplicate something.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 08:48:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 08:48:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777898.1187952 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seW99-0008WM-Vn; Thu, 15 Aug 2024 08:47:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777898.1187952; Thu, 15 Aug 2024 08:47:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seW99-0008WF-SW; Thu, 15 Aug 2024 08:47:51 +0000
Received: by outflank-mailman (input) for mailman id 777898;
 Thu, 15 Aug 2024 08:47:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/2Vq=PO=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seW98-0008W9-AJ
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 08:47:50 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0cc323a3-5ae3-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 10:47:49 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5ba43b433beso986186a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 01:47:49 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838cf0c4sm68081366b.51.2024.08.15.01.47.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 01:47:48 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0cc323a3-5ae3-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723711668; x=1724316468; 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=F944DroWBmv6b8y45tlawqP+JI0ZJYRiFEdbDFYeIrk=;
        b=HTyXaOdjetHQ9IfAkyBYhIf4lA90tqW90LR7bVeeVnRsI4g/VaJgB3mBmvYJmVfD1R
         FZbUwU+3usyVRe+/NCm1mKO99Z4SYKeUHWNhq0IVs+ELNxF8HEHfpl2SRCpFHohXjvQJ
         B4Hw8OO0kHmodRhf1hbYB1ENmqcpBMpKTQ7IUjG+X3i0GDMloMIcSomyHteHE7QZHUT1
         z6aEoPtq9htztnPKVOcnK80zGmnqfkWbDB7DlT7qKB4+DHFFWerHKxQ2C+7NTOL740JR
         i8ry+J7HEYCrHW/2X+buRtieelJK3dhDt7Aj18kw4HGlfu/tEZn9yIiJrT6FcHtHC0dF
         /jTQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723711668; x=1724316468;
        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=F944DroWBmv6b8y45tlawqP+JI0ZJYRiFEdbDFYeIrk=;
        b=MGWkJDicy+fCDY7gx+rYVHCNpfgdNz0jwKHsCnSIxceUGeYd0DcWFn2zdFjVub2O/t
         bu0/KKv2m2373PAkTsAsy+QE+jqNNIWknzcgKtem8fpgjjGlUC0Kn93+nJzpk3OMq2QZ
         YoV+PQNT/J7GcBbsb1FSP77oZEbi9p98CfBdxTSu6DolliInBFL+tNNDVP4sDO6Cmawa
         9NNIUskHSGt8xBewvGFKP9KDre+OCAw4fZ3e8cl/enPzt2uBtnxNR48pIKQJAY5J0i+G
         ndr33GIh28O4xGJxHctVbFH0nWWEyeE6k4uFoteR49dacq61KMS8juK8OFYKVVhkz3bp
         GK0A==
X-Forwarded-Encrypted: i=1; AJvYcCW0reOFQdmpxmnOfJQT4ArJmRNtWpElVhUiMOa7eF9vC4k2XjK/Rty3RJUmRqlTHlw91LBZh9XTspaNhm8ZcisTfIBxBQEsTf29Tv8GgQM=
X-Gm-Message-State: AOJu0Yzev5pWPH56HF6OjEK+3jtx8zzyKGDbfwjH4jQTdMvzEQ6fjrhd
	4gFBKVdRQsmb5TogvPN1+DftmATiJ/vsVfHeguf0w6pway9Nf98LyQbH6EWGyA==
X-Google-Smtp-Source: AGHT+IE/WMiDEw+8bjhICHvJfRp6lhHz3YAmmumSiZ0OkL2JNMV4DMlaUVJL0CQRVyjsufnnXhTT2g==
X-Received: by 2002:a17:907:c7e4:b0:a72:44d8:3051 with SMTP id a640c23a62f3a-a8366c421b6mr382524666b.16.1723711668449;
        Thu, 15 Aug 2024 01:47:48 -0700 (PDT)
Message-ID: <5dd50f94-6d0a-4a78-ae80-a6105ce57d62@suse.com>
Date: Thu, 15 Aug 2024 10:47:46 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 0/5] Support EFI multiboot loading using PE binary
To: Andrew Cooper <andrew.cooper3@citrix.com>,
 Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <20240814083428.3012-1-frediano.ziglio@cloud.com>
 <2d0f0c05-1ee5-4972-868d-c94e45f71044@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <2d0f0c05-1ee5-4972-868d-c94e45f71044@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 14.08.2024 23:31, Andrew Cooper wrote:
> On 14/08/2024 9:34 am, Frediano Ziglio wrote:
>> Testing this feature in preparation for UEFI CA memory mitigation
>> requirements I found some issues causing the loading to fail and
>> other minor issues.
>> Details in series commit messages.
>> This is adding an additional way to boot Xen, using GrUB2+EFI
>> (xen.efi:__efi64_mb2_start).
>>
>> Changes since v1:
>> - Changed title, apparently this is a kind of new mode;
>> - address lot of comments (see "Changes" in other messages).
>>
>> Frediano Ziglio (5):
>>   x86: Put trampoline in .init.data section
>>   x86: Set xen_phys_start and trampoline_xen_phys_start earlier
>>   x86: Force proper gdt_boot_base setting
>>   x86: Compensate relocation in case of EFI
>>   x86: Rollback relocation in case of EFI multiboot
> 
> Patch 1 is one part of supporting NX_COMPAT in the PE header, which is a
> requirement from Microsoft in order to be signed.
> 
> It has nothing to do with the rest of the series, which is about making
> the EFI+MB2 entry point work.
> 
> It would have helped a lot to not have mixed these together in a series
> claiming to only be about the latter.
> 
> 
> Now, as indicated in our documentation (yes - this is one of the very
> few I have managed to get committed),
> https://xenbits.xen.org/docs/latest/hypervisor-guide/x86/how-xen-boots.html#xen-efi
> 
> The MB2 tags existing in xen.efi is a known thing but came as a surprise
> to some.  It exists because xen.efi is a strict superset of xen.gz,
> including head.S which contains the MB1/MB2 tags.

Which in turn so far was just to keep build machinery as uniform as possible.
IOW I'd rather call the tags being there a side effect, not something that
was intentional. And for MB1 I don't think that's going to change with the
effort made now.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 08:55:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 08:55:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777907.1187962 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seWGr-0001bm-NZ; Thu, 15 Aug 2024 08:55:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777907.1187962; Thu, 15 Aug 2024 08:55:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seWGr-0001bf-JS; Thu, 15 Aug 2024 08:55:49 +0000
Received: by outflank-mailman (input) for mailman id 777907;
 Thu, 15 Aug 2024 08:55: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=qQtD=PO=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1seWGq-0001bR-K5
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 08:55:48 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2907367a-5ae4-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 10:55:46 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2ef25511ba9so14255111fa.0
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 01:55:46 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f3b7703301sm1396101fa.87.2024.08.15.01.55.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 15 Aug 2024 01:55:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2907367a-5ae4-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723712145; x=1724316945; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=7mrSkYK4uXXwog8EAyCTl9aZpwWR0PwqYgBxBBHzYDY=;
        b=ktscVWr85kFoAFPK4SBK24R6rJ2NTGsBw3kAHqQUtyT/Z8I+jO3IV1oLYd2CSWJ0BK
         Kn9kvQuWaLh7NBhaRJq/MIGQTMTAjC1XBxtYzkd+/PEAFVluL3l3diNg3T2WpMWwintG
         0SdwrDg1epQkEiEqge9fNiYAyq1qwT5dVAzGdTblwrj973d/btD0mEwnOEDMp9evD3+D
         tIFhJPzsVVE7HYrqxb9cMWk1UDZyokf5kHDP12OyUExfgM26bI+xjWMA65SMZhDQ+qR/
         3crAeyhUh2wbUB6dphVkkIkGt9asNZzqq8J0gZJqB4TzHHmr9h2Vnm+wz76rT0/gskFJ
         G/Ag==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723712145; x=1724316945;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=7mrSkYK4uXXwog8EAyCTl9aZpwWR0PwqYgBxBBHzYDY=;
        b=Vl9YvBrZOJwcgG8+WwDTEYTKkN3+DlWx570zso89nQsr+Il4+KJLq8j9KZnzci1HAl
         2uZHeHDFzi5oJKZRWu5dTbvYqmnJ+oxUyLpNyzl0VkW+dILgaFHdKQvjGZklRaJI8Q2D
         kJ3X2yWeSUNQsX17p8uPNK3qew4xm4cyw8KfKZPmfeFrkRHnS8SqBn7YT3e1lv8hvHR1
         6BE7MjGUsdEkGk+7JI33gsFTTh3CsrGYrrRTZQ3lolqW11fXqiobQYod5Ek4gNEDJyfZ
         IQUPBIEho3U0pt+yuovKPbJGl2HJnuh2d1YDyMo9oSt8i41vPDlc8i5EPywWWU4Qpsqe
         dv1A==
X-Forwarded-Encrypted: i=1; AJvYcCXurcSuy+MCsJar4vQ8qYufibClZ0NR3tX7a81GcJoPZq5lutb6eUW0Is16J4oluGjAxOXUmN8HZqJpx4pRZfRqnanGNOZrWfEALiZDh3Y=
X-Gm-Message-State: AOJu0YznF7qPmzWzjy48oo8ugaRBNMRjj2LaYap4mOsT37JecN7xrTlg
	GG7NJpeMjQbma6UTJ+NGPLAm/TW03NdkiMGYvhBCSQDw6Pdom352
X-Google-Smtp-Source: AGHT+IEur516owWdc+SxJJlq88vE9ubJzz0Fq7XFmfR3i7do9BVSq+cSmeeohvSi5DXz9VMH16T3kw==
X-Received: by 2002:a05:651c:b29:b0:2ef:2fa1:954f with SMTP id 38308e7fff4ca-2f3b3bc2361mr6590911fa.18.1723712145113;
        Thu, 15 Aug 2024 01:55:45 -0700 (PDT)
Message-ID: <2184097c00f84f707fabadff240f977827a3c927.camel@gmail.com>
Subject: Re: [PATCH v4 4/7] xen/riscv: introduce functionality to work with
 CPU info
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Thu, 15 Aug 2024 10:55:43 +0200
In-Reply-To: <dfb4678f-0b2d-4d1c-be02-10c4720e57b2@suse.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
	 <452e2960d1f064a2e3abcaae1ac354f48aafd24c.1723214540.git.oleksii.kurochko@gmail.com>
	 <e0285026-40c5-4316-8129-d07801a9c233@suse.com>
	 <ee3a2e61435e860f1ddb6022fbb712a8d890ae3e.camel@gmail.com>
	 <dfb4678f-0b2d-4d1c-be02-10c4720e57b2@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Wed, 2024-08-14 at 17:22 +0200, Jan Beulich wrote:
> On 14.08.2024 16:45, oleksii.kurochko@gmail.com=C2=A0wrote:
> > On Tue, 2024-08-13 at 10:54 +0200, Jan Beulich wrote:
> > > On 09.08.2024 18:19, Oleksii Kurochko wrote:
> > > > --- a/xen/arch/riscv/include/asm/smp.h
> > > > +++ b/xen/arch/riscv/include/asm/smp.h
> > > > @@ -5,6 +5,8 @@
> > > > =C2=A0#include <xen/cpumask.h>
> > > > =C2=A0#include <xen/percpu.h>
> > > > =C2=A0
> > > > +#define INVALID_HARTID UINT_MAX
> > > > +
> > > > =C2=A0DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
> > > > =C2=A0DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
> > > > =C2=A0
> > > > @@ -14,6 +16,14 @@ DECLARE_PER_CPU(cpumask_var_t,
> > > > cpu_core_mask);
> > > > =C2=A0 */
> > > > =C2=A0#define park_offline_cpus false
> > > > =C2=A0
> > > > +void smp_set_bootcpu_id(unsigned long boot_cpu_hartid);
> > > > +
> > > > +/*
> > > > + * Mapping between linux logical cpu index and hartid.
> > > > + */
> > > > +extern unsigned long cpuid_to_hartid_map[NR_CPUS];
> > > > +#define cpuid_to_hartid(cpu) cpuid_to_hartid_map[cpu]
> > >=20
> > > How wide can hart IDs be? Wider than 32 bits? If not, why
> > > unsigned
> > > long?
> > According to the spec:
> > ```
> > The mhartid CSR is an MXLEN-bit read-only register containing the
> > integer ID of the hardware thread running the code
> > ```
> > where MXLEN can bit 32 and 64.
>=20
> Hmm, okay. If the full MXLEN bits can be used, then using unsigned
> long
> is indeed the right thing here.
>=20
> > > > @@ -40,6 +41,19 @@ void __init noreturn start_xen(unsigned long
> > > > bootcpu_id,
> > > > =C2=A0{
> > > > =C2=A0=C2=A0=C2=A0=C2=A0 remove_identity_mapping();
> > > > =C2=A0
> > > > +=C2=A0=C2=A0=C2=A0 /*
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * tp register contains an address of phys=
ical cpu
> > > > information.
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * So write physical CPU info of boot cpu =
to tp register
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * It will be used later by get_processor_=
id() ( look at
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * <asm/processor.h> ):
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0 #define get_processor_id()=
=C2=A0=C2=A0=C2=A0 (tp->processor_id)
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > > > +=C2=A0=C2=A0=C2=A0 asm volatile ( "mv tp, %0" : : "r"((unsigned
> > > > long)&pcpu_info[0]) );
> > >=20
> > > Perhaps be on the safe side and also add a memory barrier?
> > Do you mean compiler barrier? ( asm volatile ( "..." :: ... :
> > "memory"
> > )? )
>=20
> Yes.
>=20
> > > Perhaps be on the safe side and do this absolutely first in the
> > > function,
> > > or even in assembly (such that initializers of future variables
> > > declared
> > > at the top of the function end up safe, too)?
> > I am not sure that I am following your part related to put this
> > code in
> > assembler ( instructions in assembly code still code be re-ordered
> > what
> > can affect a time when tp will be set with correct value )
>=20
> I'm afraid I don't understand this. Instructions can be re-ordered,
> sure,
> but later instructions are guaranteed to observe the effects on
> register
> state that earlier instructions caused.
>=20
> > and what do
> > you mean by "initializers of future variables declared at the top
> > of
> > the function end up safe"
>=20
> With
>=20
> void start_xen()
> {
> =C2=A0=C2=A0=C2=A0 int var =3D func();
>=20
> =C2=A0=C2=A0=C2=A0 asm volatile ( "mv tp, %0" :: ...);
> =C2=A0=C2=A0=C2=A0 ...
>=20
> you end up with the requirement that func() must not use anything
> that
> depends on tp being set. In this simple example it may be easy to say
> "don't use an initializer and call the function afterwards". But that
> is
> going to be a risky game to play. Look at x86'es __start_xen(). An
> insertion into such a big set of declarations may not pay attention
> to
> tp not being set yet, when _all_ other C code may reasonably assume
> tp
> is set.
Thanks for the clarification. I missed the possibility that someone
might accidentally use tp before it is set. In this case, I agree that
it would be better to create a setup_tp() function and call it before
start_xen().

>=20
> > > > --- /dev/null
> > > > +++ b/xen/arch/riscv/smp.c
> > > > @@ -0,0 +1,4 @@
> > > > +#include <xen/smp.h>
> > > > +
> > > > +/* tp points to one of these per cpu */
> > > > +struct pcpu_info pcpu_info[NR_CPUS];
> > >=20
> > > And they all need setting up statically? Is there a plan to make
> > > this
> > > dynamic (which could be recorded in a "fixme" in the comment)?
> > I didn't plan to make allocation of this array dynamic. I don't
> > expect
> > that NR_CPUS will be big.
>=20
> What is this expectation of yours based on? Other architectures
> permit
> systems with hundreds or even thousands of CPUs; why would RISC-V be
> different there?
Based on available dev boards. ( what isn't really strong argument )

I checked other architectures and they are using static allocation too:
   struct cpuinfo_x86 cpu_data[NR_CPUS];
  =20
   u32 x86_cpu_to_apicid[NR_CPUS] __read_mostly =3D
   	{ [0 ... NR_CPUS-1] =3D BAD_APICID };
  =20
   ... /* Arm */
  =20
   struct cpuinfo_arm cpu_data[NR_CPUS];

I wanted to check to understand which one API should be used to
allocate this array dynamically. xmalloc?

And I am curious how I can use xmalloc() at this stage if page
allocator (?) should be initialized what isn't true now.
Or just to allocate pcpu_info only for boot cpu and for other then use
xmalloc()?

>=20
> > I can add "fixme" but I am not really
> > understand what will be advantages if pcpu_info[] will be allocated
> > dynamically.
>=20
> Where possible it's better to avoid static allocations, of which on
> some systems only a very small part may be used. Even if you put
> yourself
> on the position that many take - memory being cheap - you then still
> waste cache and TLB bandwidth. Furthermore as long as struct
> pcpu_info
> isn't big enough (and properly aligned) for two successive array
> entries
> to not share cache lines, you may end up playing cacheline ping-pong
> when a CPU writes to its own array slot.
Why the mentioned issues aren't work for dynamic memory? We still
allocating memory for sizeof(pcpu_info) * NR_CPUS and when this
allocated memory access it will go to cache, CPU/MMU still will use TLB
for address translation for this region and without a proper alignment
of pcpu_info size it still could be an issue with cache line sharing.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Thu Aug 15 08:58:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 08:58:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777916.1187972 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seWJM-0002pV-3V; Thu, 15 Aug 2024 08:58:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777916.1187972; Thu, 15 Aug 2024 08:58:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seWJM-0002pO-08; Thu, 15 Aug 2024 08:58:24 +0000
Received: by outflank-mailman (input) for mailman id 777916;
 Thu, 15 Aug 2024 08:58:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=2AJB=PO=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1seWJK-0002pI-8o
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 08:58:22 +0000
Received: from NAM02-SN1-obe.outbound.protection.outlook.com
 (mail-sn1nam02on2061d.outbound.protection.outlook.com
 [2a01:111:f400:7ea9::61d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 857fe005-5ae4-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 10:58:21 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by IA1PR12MB8240.namprd12.prod.outlook.com (2603:10b6:208:3f2::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Thu, 15 Aug
 2024 08:58:17 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7875.018; Thu, 15 Aug 2024
 08:58:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 857fe005-5ae4-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=IKeMgatSC2yVxZEKfZ4ZoQHDe5R5ulLNJ+9iFFHY7xKRMosBMjxcbY7p5OLp8V4FPUFojqXCu/9GpeR5hWyeKMoZP31x10TCQ6JzIXT06bbw+FNxpLCBiSTuCBNKzhY3WjtnZOkfzvVV3zHOIuCeB8HKqau5gp0R7F3b0ZbKrKdF3OiLju6UKgHJE44QIWwMAm80Yiz9QPUkdvZjfzlqcaOejy7vVum1WruHqWb+HVKz5azyD72zhjrDLSiz3vKryoptp3xcHHF2+/vJQp3mk6ZOQdbmHGVpqRFl33ERdFk1jZVrZXuon6jmmTv+5vJoiuGa2KfhYZ5VUmuwRzbWRg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=FFnrv9fbL7ZUs+Z2t4Wb/IGZdm7n0CDTN16K0+B4ekk=;
 b=Bxay4vmD46PW/pp/KSYN6eDcS+Hqv/eHF5fwc4yJmkpdao8WReUVFB7gkD/bNfYlyuZmJZ85OkSPmgTpTB/Xe7uVlI7abZxPHR5Lw9oIgeoOQzLeaHLJhuTdocyTbiEL8frBqkQT8HxvyOl+fDhdAFtknDr24agw7ZoCBnmNbsWM71vfkKo02trL4But+8874yQf/8Yiti5BUeZf2HeXWt5BEUX3uYto+FCgxUW8UBF/qIVtn/ax9lEL/mnMjZ3C8+bj3jPzmR2aVyVEO9mICBTurAHK5Bi0QbERg/9mY4mHtz+8EvFmS6FOSoX5penaMbXQZEOsM0Wr9hcYzdblOw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=FFnrv9fbL7ZUs+Z2t4Wb/IGZdm7n0CDTN16K0+B4ekk=;
 b=0UjZxlhI3Ri4X72+B8mQxJgaqy2IPgZ/b0v3K747NzbHYd1wPT6U0JvKvaxNWhFPt3WDHhhmqHQ2pyv1Tpzg6Z9hSY/qvoBRVa2KzI3ecQrABft8lHTY/fEYB0tEf2JCSttNkH5DAy6XZ2zs6H9e+0KGic8NW/v5tBes8R7yhOo=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <22dcdbbf-5000-4b92-b746-5e01c0160776@amd.com>
Date: Thu, 15 Aug 2024 09:58:11 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/arm64: Hide FEAT_SME
Content-Language: en-GB
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240814210054.67520-1-julien@xen.org>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <20240814210054.67520-1-julien@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0184.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a4::9) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|IA1PR12MB8240:EE_
X-MS-Office365-Filtering-Correlation-Id: 4aee1947-b9d4-4266-51f2-08dcbd08670d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?OEx6TTF5NFl4OHNnbWlBb3F3K3dFVnBQQXRMNGh1THZQTjZvMFZseUIzZXJ3?=
 =?utf-8?B?Qkg2Z3p4NGdxcTNtRWFBQzJTc01SQUNuMUFCeEVraWxZVy9IUWJHUG9VZG9q?=
 =?utf-8?B?NUw5Y2lYOWFuUEk2VlRvdnd1UlhQRWhSNzRQZFZCU0NwYnF0c3o4dVMvekFT?=
 =?utf-8?B?QVJhWW55TER2UGpwRUdSY2hsVzJvemI0OEo5S0J1b25iZW1zSzh1ZnhDb05T?=
 =?utf-8?B?bVBaZm5tUWJGQUkzdERCVSs3Z2k0ZFNLTExsTmExZElIOG9XZEMrMFZuWk9B?=
 =?utf-8?B?QWtnUFpCcGxDS0N2Z0huZkVkOE5FZkt0YjNXYk9vK0dXUkw3eDdzbk5ydWlU?=
 =?utf-8?B?NjliTEloUHdwVUtGdWlRMUNkTW56RUFWREhJZlRlSWdxMU9JbXR0TUhuMmVW?=
 =?utf-8?B?YmE4emZiTm1lRnZVRC9mdm9EeDQvR0F0eWpvMXJSNVVUeDJwbDFtblpNaXpt?=
 =?utf-8?B?NUNJL21JTFpjdnUrTVlZaU9MZ044UkU4VWJFMCtLMWpNNmsyVGtsL3RvRUhz?=
 =?utf-8?B?MytqOFJiSGFEblFEeXJvbFBLOEZzWEVwNFVMOEllSWhucXh3Rk0vekhpRVlL?=
 =?utf-8?B?ZGhYUzBLeHAxQnpPSjhNbjloajloZ0c2K1BCVHBQVHlRRzhPU1JpSGpUYWFT?=
 =?utf-8?B?L2VBZEZWSkh3blVkSlRQOGxuNkpNNjFybmJlcG1oUXdubHoyWi9LRS9XYVJw?=
 =?utf-8?B?SFNsdWNVYitZSGgrUk9kK051TUlTREFmSW1JeldRT0grL0RpUlo0RGxoRFdi?=
 =?utf-8?B?em90NTNCOVVWNlBYL0orQlZjRzYwQlFxY2JNa0cxY2NCMVdBZzdkemRKcU1E?=
 =?utf-8?B?a1NPN0taZStyVGllOTJ2QndBQkVIZ05FbG1RbUpJYk1hUVJ6N1ZxanBWWGo5?=
 =?utf-8?B?NS9Rbm1FcDdjTzEvUGRVdkdsTlU5Z2hXKzE1OHhyWmVnR242OThoenBpZ0Rv?=
 =?utf-8?B?cnEydS9oS3hTNEFyOHBjUExLVVNVdktLT0JzR1JjcWxqeFl0UjFIcDdNaHYw?=
 =?utf-8?B?NXdJZWtjSEVRRWNHSlh0M3FPM3kzRVFidHJDODVZL3lkeXVzNS9tank1ZWlh?=
 =?utf-8?B?UDkyTnBGcnB0S1lBMjFucjhlZkRwNWJ6NFZGcDNkSloza0JDdVI5cVowNDVy?=
 =?utf-8?B?YTRhTjJpRzhuS1VJNy9EMkNEaEpVWHU3ZStBZ1REOHBOazlBdUlJR0t0bjJX?=
 =?utf-8?B?Mm5tbTA1QXJ3WGdlRTVPaWNIdXg4dmRURjFocWhaM3JVaUwrTEFZSUZJQTJi?=
 =?utf-8?B?ZXJVUW5rOWRmb0dIc2xUVDg0WEtaSEV1ZjNsdmoyMkdmUVcyWUREVkNlY0RR?=
 =?utf-8?B?ZC9CWlNmNUtiQmJwdEd0cE8wekVPdE5US09VSzhreTR5dk9LWjdZZzBpbGhO?=
 =?utf-8?B?TVliQlRJbEx6SFh2aG56ZXlvZG1oZHdrTmpreUVJRkJvS1ZWc1EwaXQ4bWVv?=
 =?utf-8?B?YWZpcFlOQ2FSamk5bnkwNW9LR1BJdDl5UlBxbmIyN3lYcnRSWFVIWFAyYXJ5?=
 =?utf-8?B?aElxd0pPTTJ2WTFwOWpwVE8ya0Q3UXlZTXVCNFhWajlob09xcU5idzZuRHJS?=
 =?utf-8?B?eTZzMzl0bjY1aHZPM093TWFiaW53NU5jT2FLaU14SElsZ1lCc2dSbUkyMEhu?=
 =?utf-8?B?dU5kR242VE94SGNWTDY1RUpBcnJHWXp3RGRQa0paZHZJbGMvTjVWaElmeXNs?=
 =?utf-8?B?WVl0QTk4VXFQZ01zVkpJVXNndkNHaGRNY0t4Zys3Mjl5YkppTWVscjBXcjNL?=
 =?utf-8?B?cEJ6Z2NTaGpraUt2MENHSEZGYzZzVkl4MkxFdFVnc1BQREZOOFByNHQ5Njcw?=
 =?utf-8?B?UjB5alF3djAyc1gvVXFJQT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?eGdHRXVaODZwOEc3TXJhWFNiSFA0SHpTbWNZRmJ1RzVOTW52Um5KLzlrMkg3?=
 =?utf-8?B?a1pIa3hmWlhOTTNKQXJFTlZYUWFJWlBmRzZZLzNrdDNweVhndmk2TlJDSTBj?=
 =?utf-8?B?VzJ2aklqc0lBSjZYSXNwaGRZMm16MmNrbEc0dy9WZy9hQ0VVZ240TlRVd0tl?=
 =?utf-8?B?WVJORzBVak9ZZklJL1JFdVZNaHpTWkhrVzNyREtxUzdHMkk1dGc0SkIzdDh2?=
 =?utf-8?B?NEhpMW9wSlVWYU84SjZKTC9RQjlKYVRTV3VlTmczVllDdHZRUkhFYmgvaHdr?=
 =?utf-8?B?ekw1bWcvck1sRGt1QWJyd2x0WjZUU3g2RTFBNVIrQzNBaFNWb1BSSlBPZksx?=
 =?utf-8?B?U1FkN05hZkY3U0xLdFRKbEpqb0U4VGxTaCtMcUNDRklPc0Z1R2pIRlhsR1pi?=
 =?utf-8?B?cHVQTmZMamxab3JPU20ycjRWWk9mc01vWGJ1Wk5QYTliOVVYT2hNT3FJWkta?=
 =?utf-8?B?U1BFNWI5MXM4VElHd0VOdzNGK012MjFyR2pmVC81L0lLV3hwN2JaRnJydUpB?=
 =?utf-8?B?bGgrU2U3Vzd3Yi9KdGVYU3lmRExQb0VIa01tMm84YVJLdS9KNDhtaU1SS3hF?=
 =?utf-8?B?NFRLZnVSSndzUGQ4ZGlKR2UyQnE0QlRtYVR0R2FUdnBHMEFERHIwQytxTGU0?=
 =?utf-8?B?ZzBFTGxBWXJtMTZvWmRiL04rUFJXTVE5M1F4c3dSbDM0My9TZ1JPdE9aYzJo?=
 =?utf-8?B?bGovVHRXUWs2dmNybDRXeDJWQmViSytMRHhnRDlyUnJ6SFNtU2M3QjZ0OXlU?=
 =?utf-8?B?aVNhaTNkMlMwcnc0YjN4RkpIVTFPRkR6ZWY5czFFNUJBbC9OQ0RwMlp4S2Fa?=
 =?utf-8?B?b0NoenVNZTAyQkFrc01ObFJTbmxGT25Kbys3M2lvZHAzMDI1aE5OdjJpOW1z?=
 =?utf-8?B?WS9Xd2pNSmw5WEQ5bHA2Z0grN0hSYndNUjdJN2QvUDFsVDlqK2M2STUxa0Zr?=
 =?utf-8?B?UFRFT05UWGpiK0tjRi9ZQ1N0UlYyWG4vTExvaDZCT1dtYWNETlkyWEprTkhL?=
 =?utf-8?B?VjdmQXlERVhnUkczd1IrSDZTMy9sWDRoN3VHeENTeVo4ZDZPaE42a0oya0gr?=
 =?utf-8?B?K2g1K0VRWjlQYkU4ejJGVTNRdFBXWHNvYTJMNjFaUzI0MVZrMjNQV3N3NlY2?=
 =?utf-8?B?ZDRjbE9odzl1WURIcS9Qbk91UGxBT2luc3YwVEdKQkZlQkUyZHl4ejRnTWhB?=
 =?utf-8?B?aVhDaURFMFhDekZKSXZ2bVY4MHZlL2tyOTJrS1QxUE44OFJneUNxSElEQkhu?=
 =?utf-8?B?d1gzbjBDUW9iVlNKNitMcGxtNnJwUEZETHRXNFRza0lXblFoS3c2ZEJLMEFm?=
 =?utf-8?B?SVkvZWdtOHNKd1pqbWpZK01TTjhJWHNjV2FlNUFKOFk3S0hBemxmaVBVTmE5?=
 =?utf-8?B?K3JCYjU0eEtzdjJpMG4rL0xBb3pqRzRpcDNnVThhWlFKelNxM0tKUXdWNlYr?=
 =?utf-8?B?Tk9XQnB6eTZTMnRCcUdoNjRvVWFCK29DY2M4SHFQSDBuZ3BLeVAzQmxGL1lv?=
 =?utf-8?B?cHliOWFiMko2TlNBckNVMGFtSm9OdGs4OE9uNTI5bmdmWkk4RUZUQVBOUGJn?=
 =?utf-8?B?VFM2VjM3RXdNd3hlUFl5MUlObXJiVUJCMlNxdVp0VXpSWHZFeU93VjNrVUxK?=
 =?utf-8?B?QlF4eklLaVJIcG9xUmlzUWN6QjJCNGkwUUcxWGk4SEFJbDJ5cjJiamg5ZjNy?=
 =?utf-8?B?c3NnK2h4T1hnVlpnajloUmVDazc0SjhiS2RwcUVJTitJWE14MVBUdnNrcmsv?=
 =?utf-8?B?SGY2RFhJTFpWc2JGUjI3c05hMm1VelpveldmaWFlcUhzbG4ydk5OSmNRbHp3?=
 =?utf-8?B?REgrMjAwVlJlRVNKNjJ1UkdBWTY0d0g1ZWppdUU3R0FlaFhCMHVWbCsyVTZn?=
 =?utf-8?B?RFVaQmtoeS93WmJuMG9PZ3NjbUhLOVhIUnZnWGRVb281N2hMNHVVZEhzSW9n?=
 =?utf-8?B?TzFlYXByZUdvV205ajlqQzZPL2RKYWFxQllaV0pZanJUdnlJRVc0ZHNON1RC?=
 =?utf-8?B?TWorWExGdGJhdUl3ZHpMb3lkeE9kWWxVb3pQa3VCVnBNNmRUa01oV2FPMG9y?=
 =?utf-8?B?clNORG5NSEVvak9nMlM4Y0lrTWVxWDlveWQ5TUFGcjlVSVRjM1lFSGV6dmJL?=
 =?utf-8?Q?q0UqdrTXAVjSrVSzURDcAk8QM?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4aee1947-b9d4-4266-51f2-08dcbd08670d
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2024 08:58:16.8825
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 7BpsfM5d+R3QY6QHOPZOj09fPFwVKVpB+TF/ojwF5+ojB9xuof57H2ZNhHbIJFhi9JDA8xUKdCngpn7m+1Ie0Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8240

Hi Julien,

On 14/08/2024 22:00, Julien Grall wrote:
> CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
>
>
> Newer hardware may support FEAT_SME. Xen doesn't have any knowledge but
> it will still expose the feature to the VM. If the OS is trying to use
> SME, then it will crash.
>
> Solve by hiding FEAT_SME.
>
> Signed-off-by: Julien Grall <julien@xen.org>
>
> ---
>
> The current approach used to create the domain cpuinfo is to hide
> (i.e. a denylist) what we know Xen is not supporting. The drawback
> with this approach is for newly introduced feature, Xen will expose it
> by default.
>
> If a kernel is trying to use it then it will crash. I can't really
> make my mind whether it would be better to expose only what we support
> (i.e. use an allowlist).
>
> AFAICT, there is no security concerns with the current approach because
> ID_* registers are not a way to tell the kernel which features are
> supported. A guest kernel could still try to access the new registers.
>
> So the most annoying bits is that booting Xen on a new HW may lead to
> an OS crashing.
> ---
>   xen/arch/arm/cpufeature.c             | 3 +++
>   xen/arch/arm/include/asm/cpufeature.h | 4 +++-
>   2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/cpufeature.c b/xen/arch/arm/cpufeature.c
> index ef77473bf8e3..b45dbe3c668d 100644
> --- a/xen/arch/arm/cpufeature.c
> +++ b/xen/arch/arm/cpufeature.c
> @@ -208,6 +208,9 @@ static int __init create_domain_cpuinfo(void)
>       domain_cpuinfo.pfr64.sve = 0;
>       domain_cpuinfo.zfr64.bits[0] = 0;
>
> +    /* Hide SMT support as Xen does not support it */
> +    domain_cpuinfo.pfr64.sme = 0;

Instead of this, can we do the following :-

domain_cpuinfo.pfr64.res1 = 0;
This would imply that SME, RNDR_trap, CSV2_frac, NMI, etc are not supported.

If later Xen decides to support any of these, then they can be selectively turned on for a domain in do_sysreg() (Similar to SVE).

- Ayan



From xen-devel-bounces@lists.xenproject.org Thu Aug 15 09:02:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 09:02:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777926.1187982 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seWN7-0004No-Ls; Thu, 15 Aug 2024 09:02:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777926.1187982; Thu, 15 Aug 2024 09:02:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seWN7-0004Nh-Id; Thu, 15 Aug 2024 09:02:17 +0000
Received: by outflank-mailman (input) for mailman id 777926;
 Thu, 15 Aug 2024 09: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=/2Vq=PO=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seWN6-0004Nb-5k
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 09:02:16 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1007e140-5ae5-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 11:02:13 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a7a9e25008aso105698166b.0
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 02:02:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383935a8bsm69447366b.103.2024.08.15.02.02.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 02:02:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1007e140-5ae5-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723712533; x=1724317333; 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=8rK+u4xaq5WQKdSHelH5gnA/txa0Bz1Jt6EvrQupLg4=;
        b=DJCOhR/yJlbls6JUEs7GLnGKgaj7Sxl3FCnwu2RIDNzTRB69iZcdhrPyWiBZGpeNme
         /ceDZsh456Nfh0uWeixM2u3QvCxXTYaS6xFGLr9x5CfMHhaqLJHlBpUlpmnMWeTb6beJ
         9Aa4qcJU+bDOKCB1OvgQCp0uj7CAQxq7H6/nkN41pxuvxaRHYfjc5aPzOo2PgQmcdDAJ
         Y+deUlHIGt4OD9nvLVR4f6k+fOV+ODUpifGeCRIeXowP0hPraFd9+xhnVg6gHrhR86E1
         JiU04abJavQxC/8f7rvngqYCTDFDz9u3330LU2//VD9SqS71Nqn5X2iW6No9gi5UxDEM
         Ibzg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723712533; x=1724317333;
        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=8rK+u4xaq5WQKdSHelH5gnA/txa0Bz1Jt6EvrQupLg4=;
        b=eglma9D8mmvEKEfOIyizzVZKxjlDdyJqu5ejwLO//lDMH1IHSg3pnXMA7a9wLAE1E2
         6Q7hCmsxcb4tqkeQMMQmMcT84BuF9a+wv8cECRfoTF9l8JTuAvbB54HbNKM0ryVlz4z2
         yBLNoHVI3Si17gpQ1oOkI7sfKRU/2QWFE9vFq6OJ6UTXdtjXJSCaeyL/wQHYqCUpv9+T
         C0sKMNNo35sl+khur4ZoXNniPvax3SkWmtii8NKHF91t6DuTapqN0ICXUImWXGEpVZqa
         TFfhR9skwFP3YxuNJ1aVQa2SopQ8yqP+3y0sditlYo9qlG9BzGiXddC5WkFTrjtr+X9H
         bbbw==
X-Forwarded-Encrypted: i=1; AJvYcCWamp5pmdBBG1oXMq+b5KJHHdJCkYl4rHIlpV2UPhgR+w2bNtMgg6mkC3smo38VcbNSo4uHDoNtaJiSoeO25lo8VJkQN1Cbw4OuVORgBsQ=
X-Gm-Message-State: AOJu0Yz6tCFVuRoAgFrRHEGiP+gx35YyxQv7XTDCOK0DLVo/E94FPLn1
	3+CZfuMD5hXPsFYNSW07876HQiz50H8+VASd8Nn1qre5c5tOZy6XIFMF2k2CcA==
X-Google-Smtp-Source: AGHT+IHVNoakDpK+X3aM42kkBHcwXpksi15uhPFG0DWn9WhIQbxYjR151gncuwIVANyEGNL2Aljxrw==
X-Received: by 2002:a17:906:6a1e:b0:a7a:bbbb:623d with SMTP id a640c23a62f3a-a83670c0032mr351414066b.66.1723712532806;
        Thu, 15 Aug 2024 02:02:12 -0700 (PDT)
Message-ID: <94a72d20-07c8-4fd6-9759-5bf31d56c860@suse.com>
Date: Thu, 15 Aug 2024 11:02:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 4/7] xen/riscv: introduce functionality to work with
 CPU info
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <452e2960d1f064a2e3abcaae1ac354f48aafd24c.1723214540.git.oleksii.kurochko@gmail.com>
 <e0285026-40c5-4316-8129-d07801a9c233@suse.com>
 <ee3a2e61435e860f1ddb6022fbb712a8d890ae3e.camel@gmail.com>
 <dfb4678f-0b2d-4d1c-be02-10c4720e57b2@suse.com>
 <2184097c00f84f707fabadff240f977827a3c927.camel@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: <2184097c00f84f707fabadff240f977827a3c927.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 15.08.2024 10:55, oleksii.kurochko@gmail.com wrote:
> On Wed, 2024-08-14 at 17:22 +0200, Jan Beulich wrote:
>> On 14.08.2024 16:45, oleksii.kurochko@gmail.com wrote:
>>> On Tue, 2024-08-13 at 10:54 +0200, Jan Beulich wrote:
>>>> On 09.08.2024 18:19, Oleksii Kurochko wrote:
>>>>> --- /dev/null
>>>>> +++ b/xen/arch/riscv/smp.c
>>>>> @@ -0,0 +1,4 @@
>>>>> +#include <xen/smp.h>
>>>>> +
>>>>> +/* tp points to one of these per cpu */
>>>>> +struct pcpu_info pcpu_info[NR_CPUS];
>>>>
>>>> And they all need setting up statically? Is there a plan to make
>>>> this
>>>> dynamic (which could be recorded in a "fixme" in the comment)?
>>> I didn't plan to make allocation of this array dynamic. I don't
>>> expect
>>> that NR_CPUS will be big.
>>
>> What is this expectation of yours based on? Other architectures
>> permit
>> systems with hundreds or even thousands of CPUs; why would RISC-V be
>> different there?
> Based on available dev boards. ( what isn't really strong argument )
> 
> I checked other architectures and they are using static allocation too:
>    struct cpuinfo_x86 cpu_data[NR_CPUS];
>    
>    u32 x86_cpu_to_apicid[NR_CPUS] __read_mostly =
>    	{ [0 ... NR_CPUS-1] = BAD_APICID };
>    
>    ... /* Arm */
>    
>    struct cpuinfo_arm cpu_data[NR_CPUS];
> 
> I wanted to check to understand which one API should be used to
> allocate this array dynamically. xmalloc?

As of a few days ago xvmalloc() (or friends thereof), as long as ...

> And I am curious how I can use xmalloc() at this stage if page
> allocator (?) should be initialized what isn't true now.

... this happens late enough in the boot process. Indeed ...

> Or just to allocate pcpu_info only for boot cpu and for other then use
> xmalloc()?

... statically allocating space for the boot CPU only is another option.

>>> I can add "fixme" but I am not really
>>> understand what will be advantages if pcpu_info[] will be allocated
>>> dynamically.
>>
>> Where possible it's better to avoid static allocations, of which on
>> some systems only a very small part may be used. Even if you put
>> yourself
>> on the position that many take - memory being cheap - you then still
>> waste cache and TLB bandwidth. Furthermore as long as struct
>> pcpu_info
>> isn't big enough (and properly aligned) for two successive array
>> entries
>> to not share cache lines, you may end up playing cacheline ping-pong
>> when a CPU writes to its own array slot.
> Why the mentioned issues aren't work for dynamic memory? We still
> allocating memory for sizeof(pcpu_info) * NR_CPUS

Why NR_CPUS? At runtime you know how may CPUs the system has you're
running on. You only need to allocate as much then. Just like e.g.
dynamically allocated CPU mask variables (cpumask_var_t) deliberately
use less than NR_CPUS bits unless on really big iron.

Jan

> and when this
> allocated memory access it will go to cache, CPU/MMU still will use TLB
> for address translation for this region and without a proper alignment
> of pcpu_info size it still could be an issue with cache line sharing.
> 
> ~ Oleksii
> 



From xen-devel-bounces@lists.xenproject.org Thu Aug 15 09:17:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 09:17:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777934.1187991 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seWc1-0007Oz-UG; Thu, 15 Aug 2024 09:17:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777934.1187991; Thu, 15 Aug 2024 09:17:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seWc1-0007Os-RU; Thu, 15 Aug 2024 09:17:41 +0000
Received: by outflank-mailman (input) for mailman id 777934;
 Thu, 15 Aug 2024 09:17:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/2Vq=PO=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seWc0-0007Om-Pj
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 09:17:40 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 380cf3f2-5ae7-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 11:17:39 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-52efd530a4eso1128605e87.0
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 02:17:39 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838c6975sm71285866b.41.2024.08.15.02.17.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 02:17:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 380cf3f2-5ae7-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723713459; x=1724318259; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=5bra8rjb95+ueMB0cvBzqmH+3dQ6+Ym0f0ObvjUpgnI=;
        b=G/HP+6+ud2AyByC4JLIGfZSS0gtCCZYdedcIK2ZB7mmnpdWXB3ZosJBqIJ42D/1OaH
         aYEeqONEVPoTdxmOpuHlZDmtoP1JyTV3GbrVAvONuhaS8zZ0jaHkRqpWQgdJ0K77aeKK
         QsYeRMA3GZk6p0x/bfxE6+HrtsSvWGPedWeF/iYMjxiRwGCwoszyuLzTSN0JOytiEfxk
         hwtN6bfbDZ1jSyRiEzUimJcyLcIzGRUZOgmiAofXKbu4XJFKDZRU435caM/NdOHS2p6A
         FjIbV+ZawGT2+hfMgAvLIf6TEsg6c/5RnGbJFpaELe64pZN/ldVjMRWpTLHQM5w/cs3b
         usqA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723713459; x=1724318259;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=5bra8rjb95+ueMB0cvBzqmH+3dQ6+Ym0f0ObvjUpgnI=;
        b=biBzYdcH20oH2Do6DU+mANOnAS2712/MaIKGQNmp0ccKzrHzSNhjxvR/a913h6C6HF
         1Qkv1Xc+8pSPuToT1JOvvoCVwgRW74qR5rgglOsJsP11lL5tzvv3CtUjD/thC2amdyeM
         54udNBMvd24M5EBB9KmB0Lpr48wzpLFxj05b7LXprcrwjn59Pm2pqp2+iTWGEtQ1yHkv
         4nGQI/XBqwA2iNnQWxSrCE+Io6jBGk6on8WhdTtgVER2urfR14eqSRS9dqqaCKwngpUW
         KyBxtIls8BblDAqd5L8B8LDRwwV5U5P1FSov7HzkCAHlwfB2DKSHEBYPzvcJ64qhkrWO
         Edng==
X-Gm-Message-State: AOJu0YyuYssyWPYsJzyUGv8I/zJug3reFfycWyCT97Z97jdZ2EieHpuw
	Nr3Tw2KXTD7ZKNdGu9a5b9+1y/E4P7HSFOFJ4dXEbDOeSzv6Pl+XWdG1t1HoX5x+SuU/OdthsSo
	=
X-Google-Smtp-Source: AGHT+IG0xLI4jWW0FLxAxGNfMsT2guS42sQzS7hUEKI1EwOSAuHr1QcklvJev1sgtuADaMrE/EL3ZA==
X-Received: by 2002:ac2:4e01:0:b0:52f:44b:7d42 with SMTP id 2adb3069b0e04-532edbe9a2dmr3673175e87.58.1723713458888;
        Thu, 15 Aug 2024 02:17:38 -0700 (PDT)
Message-ID: <7702a8a6-bd83-4390-bd02-cae77c763560@suse.com>
Date: Thu, 15 Aug 2024 11:17:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86emul: correct #UD check for AVX512-FP16 complex
 multiplications
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

avx512_vlen_check()'s argument was inverted, while the surrounding
conditional wrongly forced the EVEX.L'L check for the scalar forms when
embedded rounding was in effect.

Fixes: d14c52cba0f5 ("x86emul: handle AVX512-FP16 complex multiplication insns")
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -7852,8 +7852,8 @@ x86_emulate(
         generate_exception_if(modrm_reg == src1 ||
                               (ea.type != OP_MEM && modrm_reg == modrm_rm),
                               X86_EXC_UD);
-        if ( ea.type != OP_REG || (b & 1) || !evex.brs )
-            avx512_vlen_check(!(b & 1));
+        if ( ea.type != OP_REG || !evex.brs )
+            avx512_vlen_check(b & 1);
         goto simd_zmm;
     }
 


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 09:38:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 09:38:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777942.1188002 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seWvc-0002g7-GN; Thu, 15 Aug 2024 09:37:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777942.1188002; Thu, 15 Aug 2024 09:37:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seWvc-0002g0-DO; Thu, 15 Aug 2024 09:37:56 +0000
Received: by outflank-mailman (input) for mailman id 777942;
 Thu, 15 Aug 2024 09:37:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1seWvb-0002fu-9a
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 09:37:55 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1seWva-0008Ri-PF; Thu, 15 Aug 2024 09:37:54 +0000
Received: from [15.248.2.30] (helo=[10.24.67.22])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1seWva-0000lL-GC; Thu, 15 Aug 2024 09:37:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=705oB4eS7SZ+UL02j5hdaY1NYF1bUTjLWCb7xfXaGNo=; b=TmmbXtnoh2oLTApzPv2FClN6OT
	PXvNHSaOhQKJfKj1A/KDKzfyvMSRq5FkiKGnYP1WO2N5SA4H3u4S0Me5Dc+KgTtRd72Bx9QovOLen
	ZcVWtoVm4vQFKTkEKQf+lhpMWbJqOklgdI+vc7i16z0UOK/XKIZSiB+0S7IrEJhXpr0U=;
Message-ID: <7612e207-7eff-436a-b884-3a0227aababa@xen.org>
Date: Thu, 15 Aug 2024 10:37:52 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/arm64: Hide FEAT_SME
Content-Language: en-GB
To: Ayan Kumar Halder <ayankuma@amd.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240814210054.67520-1-julien@xen.org>
 <22dcdbbf-5000-4b92-b746-5e01c0160776@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <22dcdbbf-5000-4b92-b746-5e01c0160776@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 15/08/2024 09:58, Ayan Kumar Halder wrote:
> Hi Julien,

Hi Ayan,

> On 14/08/2024 22:00, Julien Grall wrote:
>> CAUTION: This message has originated from an External Source. Please 
>> use proper judgment and caution when opening attachments, clicking 
>> links, or responding to this email.
>>
>>
>> Newer hardware may support FEAT_SME. Xen doesn't have any knowledge but
>> it will still expose the feature to the VM. If the OS is trying to use
>> SME, then it will crash.
>>
>> Solve by hiding FEAT_SME.
>>
>> Signed-off-by: Julien Grall <julien@xen.org>
>>
>> ---
>>
>> The current approach used to create the domain cpuinfo is to hide
>> (i.e. a denylist) what we know Xen is not supporting. The drawback
>> with this approach is for newly introduced feature, Xen will expose it
>> by default.
>>
>> If a kernel is trying to use it then it will crash. I can't really
>> make my mind whether it would be better to expose only what we support
>> (i.e. use an allowlist).
>>
>> AFAICT, there is no security concerns with the current approach because
>> ID_* registers are not a way to tell the kernel which features are
>> supported. A guest kernel could still try to access the new registers.
>>
>> So the most annoying bits is that booting Xen on a new HW may lead to
>> an OS crashing.
>> ---
>>   xen/arch/arm/cpufeature.c             | 3 +++
>>   xen/arch/arm/include/asm/cpufeature.h | 4 +++-
>>   2 files changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/cpufeature.c b/xen/arch/arm/cpufeature.c
>> index ef77473bf8e3..b45dbe3c668d 100644
>> --- a/xen/arch/arm/cpufeature.c
>> +++ b/xen/arch/arm/cpufeature.c
>> @@ -208,6 +208,9 @@ static int __init create_domain_cpuinfo(void)
>>       domain_cpuinfo.pfr64.sve = 0;
>>       domain_cpuinfo.zfr64.bits[0] = 0;
>>
>> +    /* Hide SMT support as Xen does not support it */
>> +    domain_cpuinfo.pfr64.sme = 0;
> 
> Instead of this, can we do the following :-
> 
> domain_cpuinfo.pfr64.res1 = 0;
> This would imply that SME, RNDR_trap, CSV2_frac, NMI, etc are not 
> supported.

I could but I haven't done it for two reasons:
   * AFAICT, there are no issue to expose RNDR_trap to the guest. Also 
not all the bits in the field res1 are defined yet. So effectively, we 
would be implementing an allowlist like.
   * In the future, we could split res1 in two. If we are not careful, 
we would expose the feature again.

So I find this approach rather risky. There is also a more general 
question on how the features should be handled (see what I wrote after 
--- and below).

> 
> If later Xen decides to support any of these, then they can be 
> selectively turned on for a domain in do_sysreg() 

do_sysreg() is just returning the ID registers. This only helps the OS 
to discover the features at runtime and it is free to ignore them. What 
matter is the configuration in of the trap registers (such as HCR_EL2).

If a feature is not gated by a trap register, then it could be enabled 
everywhere. So effectively, the decision will depend on the feature. In 
the future, we may have to take care of suspend/resume or live-migration 
between two Xen versions. At that point the feature may need to be 
per-domain.

 > (Similar to SVE).

The main reason SVE is enabled per-domain is because of the large state. 
But if we have feature that doesn't have an impact on the memory usage, 
then they could be enabled everywhere.

Anyway, the first decision we need to take is whether we want to change 
to an allowlist. There are pros and cons with both of them (see what I 
wrote above). At the moment, I am still leaning towards the existing 
model which is expose everything by default but hide features when they 
appear and Xen needs more handling.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Thu Aug 15 09:43:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 09:43:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777949.1188011 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seX0i-00048y-2x; Thu, 15 Aug 2024 09:43:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777949.1188011; Thu, 15 Aug 2024 09:43:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seX0i-00048r-02; Thu, 15 Aug 2024 09:43:12 +0000
Received: by outflank-mailman (input) for mailman id 777949;
 Thu, 15 Aug 2024 09:43:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=aZnf=PO=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1seX0g-00048l-GX
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 09:43:10 +0000
Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com
 [2a00:1450:4864:20::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c7a5f7b2-5aea-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 11:43:09 +0200 (CEST)
Received: by mail-ej1-x630.google.com with SMTP id
 a640c23a62f3a-a8384008482so49164566b.2
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 02:43:09 -0700 (PDT)
Received: from [192.168.1.10] (host-92-26-98-202.as13285.net. [92.26.98.202])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838cff50sm75282666b.63.2024.08.15.02.43.07
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 02:43:07 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c7a5f7b2-5aea-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723714988; x=1724319788; 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=d7BAxXD/O1vpzYVVl8nxgV/dswYqwYtwXqqmNf4m/DA=;
        b=M/PgmIZSm/Uv6C4QV6TrI5dVkFg1r4zHoTsoAmUBpneMl6YmHUSUnDuykJjN9A57EV
         l4rrNHV5y9mCnk6CK8xjc/MZY7d2o6TbwZz0/c2tkI0GKyyiZDizprjdVutGnwiZMvUZ
         nbiAP7EKZJiB6i4BDsj8T2D+zRPQ1RkfQYQWA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723714988; x=1724319788;
        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=d7BAxXD/O1vpzYVVl8nxgV/dswYqwYtwXqqmNf4m/DA=;
        b=FGQDbv6fah6COTm2llH0a1nnkcIFaA3NkfULtY+FK+M5IB4qfuUUK7pKrP+nZI7jqT
         pehsJgQnK3ZVlKQ7d0i56Pv0ujQiaMKbq6hKE5jpxqidcivUawAf/u+O8WI3gEFQji60
         QX/lOeM9hgF7c9UKVXfzTTDYDEpeVVwfwLvQ3G4cINLd4uEIgMlEpnzBLMoRVvQxyrOu
         dYFZwbU+CvyMEkTa3Y5/qvkX9KTMl85Rac2TW5KmXP8TuRAPhprQsgpxfLTJUjvhYAN5
         S9uGzoxwngnNEbRjCW4i9REJMtnRqZYXKVbhpNgICzMhc+hEqQmssAAXOfjzg5mb4ZSl
         pN0A==
X-Forwarded-Encrypted: i=1; AJvYcCWOo40Z7nWZVITEyoVYcWLb+GDk7xptqtX4eb9ArpQ9CGtkCBpGXVdhxAjH8XRGafHLyZEChhE1T54z47HkBYKwx39vEhOTN/cw1Qc769w=
X-Gm-Message-State: AOJu0Yx3UEsgbUm78LNerIhoh5JdncZvtysC9GdaiguTcP5jl1xsDZjg
	YLIp65F0gyUkq4DUr0Z5SetVuDpjrdwcWL+70ducB3bqobtU9uYeOUFwDYd703vSyC803VLVqHD
	2
X-Google-Smtp-Source: AGHT+IEQ1ckJevw/4ClqoNA/kK+BSLvEC9FtwACxO7MgCdQcT+bXXcODm/clBDcTlNwWJ/bZRRVTcQ==
X-Received: by 2002:a17:907:e65f:b0:a77:cdaa:88a3 with SMTP id a640c23a62f3a-a8366d552ecmr399856166b.27.1723714988455;
        Thu, 15 Aug 2024 02:43:08 -0700 (PDT)
Message-ID: <e9fe602e-21b2-4dfe-8279-4d63824d34cd@citrix.com>
Date: Thu, 15 Aug 2024 10:43:07 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: correct #UD check for AVX512-FP16 complex
 multiplications
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <7702a8a6-bd83-4390-bd02-cae77c763560@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <7702a8a6-bd83-4390-bd02-cae77c763560@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 15/08/2024 10:17 am, Jan Beulich wrote:
> avx512_vlen_check()'s argument was inverted, while the surrounding
> conditional wrongly forced the EVEX.L'L check for the scalar forms when
> embedded rounding was in effect.
>
> Fixes: d14c52cba0f5 ("x86emul: handle AVX512-FP16 complex multiplication insns")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 10:00:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 10:00:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777957.1188022 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seXHP-00082W-Ej; Thu, 15 Aug 2024 10:00:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777957.1188022; Thu, 15 Aug 2024 10:00:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seXHP-00082P-B1; Thu, 15 Aug 2024 10:00:27 +0000
Received: by outflank-mailman (input) for mailman id 777957;
 Thu, 15 Aug 2024 10:00:26 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=qQtD=PO=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1seXHO-00082J-AQ
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 10:00:26 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 30463ed4-5aed-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 12:00:23 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2ef2cb7d562so9907261fa.3
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 03:00:23 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f3b746cd19sm1586201fa.24.2024.08.15.03.00.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 15 Aug 2024 03:00:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 30463ed4-5aed-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723716023; x=1724320823; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=x1TWozIkPnj7zjENZ/yfuGdZRU6BVRmhcSV3R0ftWQc=;
        b=bbvvnP3QKGnpBIBtiOKUgOBQOWRlmQCJsYd8oy2I8pvW24iCXsXzMZgYoxyfDXDoVn
         lPHoWFNxDoxx8VjZomydy+/Cijgnno/brpBo5JQ8+tz8Gq3AkFg+AW2l/EPcYNIPhmnD
         Htyif5S8JTqNOGEzTOYIr3rYIpYjhDoOjOcw9kqDOF/0N0uyB7BoPi+6n1XhrE2r70OI
         OmvAspHTCgpwcokK5gy0AdlcuV7zCj4C1zzfAuitdc3w3S8ycjKiHer7zPedR+D3Yf2i
         3PuZ3ICH0CT7eGByEDHv7t09jG8H/uaAkPvuUQ/rgIn7maBUsk+o/U6GSYpmge8fSbHI
         hMJg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723716023; x=1724320823;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=x1TWozIkPnj7zjENZ/yfuGdZRU6BVRmhcSV3R0ftWQc=;
        b=TzAdUO/tHQwmJVL/Sl93iarpqnWWe45867CUVXBiR0plUoiAq9QkIl99vxQUBnbzU7
         MfCOHEbTG8A82KvEzvaDFLtYYq5O9iHLBGCqE7SciXQCNaLsQFd6tEUc41Sd9IAQTuMR
         xBZ4dXo5w8E6NvekiUIEOOmATzj7EW0wMGwrNZ87KIUlU/FtCriOn3ynS47U3BrZbh7i
         W/pQAFUoVndHcggcPB9A53qnLiLbwGDTJMOWLI223lsN6+HyuHKKUOX/rQraDZjZWSxE
         CosVSP/KXQ/e6uK71xq1Jsq+58RAWhIuPZ8czPMR9jP2wz08B/O9AW+7+/uqQJp1QGo6
         ss9Q==
X-Forwarded-Encrypted: i=1; AJvYcCVG7vJH6RARoCGAVK7+m+EwJA6q0frIoRdE8c5Kxw6gTus6/7g3ErJFstFuJpw9skMpClfnQHtsM/AeHnMhEPpCBeisFg9fMdizqHtQK1A=
X-Gm-Message-State: AOJu0YynIopYPDZk1klBjXlW52dZJ+a5zu8w/RlDtTYqr3VabnHGQ2s5
	/HW6UT/yvLCDRNkMiNgsQdn9XzoQt4BMgPBXisWpJ2D/OGVY7qpx
X-Google-Smtp-Source: AGHT+IFpLQOpCKgS3Os0xrAzU9u+ro/Hgw9Z3WbqwaN5max879pMF5Am0ATtFzo8nhvs0W15uiYQ7w==
X-Received: by 2002:a2e:b895:0:b0:2ee:5ec1:1838 with SMTP id 38308e7fff4ca-2f3aa1de8b9mr44243591fa.30.1723716022574;
        Thu, 15 Aug 2024 03:00:22 -0700 (PDT)
Message-ID: <f23aadf93c41b6045cfc5879b5b287ada7c9ef7b.camel@gmail.com>
Subject: Re: [PATCH v4 5/7] xen/riscv: introduce and initialize SBI RFENCE
 extension
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Thu, 15 Aug 2024 12:00:21 +0200
In-Reply-To: <959f33b6-3649-45b3-8f31-ec494e60fd80@suse.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
	 <1a863d06866f86761d23e6da3f4a6ee58c474473.1723214540.git.oleksii.kurochko@gmail.com>
	 <77ff59d1-b158-4603-bdbd-67c079ce87c9@suse.com>
	 <34cbaff323d9619f8d4cb1d2b8ed12584037ee0d.camel@gmail.com>
	 <959f33b6-3649-45b3-8f31-ec494e60fd80@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Wed, 2024-08-14 at 17:53 +0200, Jan Beulich wrote:
> On 14.08.2024 17:41, oleksii.kurochko@gmail.com=C2=A0wrote:
> > On Tue, 2024-08-13 at 11:34 +0200, Jan Beulich wrote:
> > > On 09.08.2024 18:19, Oleksii Kurochko wrote:
> > > > +static unsigned long sbi_major_version(void)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 return (sbi_spec_version >> SBI_SPEC_VERSION_MA=
JOR_SHIFT)
> > > > &
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SBI_SPEC_VERSION_MAJOR_=
MASK;
> > > > +}
> > >=20
> > > Can you use MASK_EXTR() here, allowing to even drop the separate
> > > SBI_SPEC_VERSION_MAJOR_SHIFT?
> > I am not sure that:
> > (sbi_spec_version >> SBI_SPEC_VERSION_MAJOR_SHIFT) &=20
> > SBI_SPEC_VERSION_MAJOR_MASK =3D=3D MASK_EXTR(sbi_spec_version,
> > SBI_SPEC_VERSION_MAJOR_MASK)
>=20
> How come you're not sure? That's precisely what MASK_EXTR() is for.
As the order matter here. First should be shift then applying
SBI_SPEC_VERSION_MAJOR_MASK, as SBI_SPEC_VERSION_MAJOR_MASK is defined
now as 7f. If SBI_SPEC_VERSION_MAJOR_MASK set to 0x7F000000 then it
will work.

>=20
> > > > +static long sbi_ext_base_func(long fid)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 struct sbiret ret;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 ret =3D sbi_ecall(SBI_EXT_BASE, fid, 0, 0, 0, 0=
, 0, 0);
> > > > +=C2=A0=C2=A0=C2=A0 if ( !ret.error )
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return ret.value;
> > > > +=C2=A0=C2=A0=C2=A0 else
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return ret.error;
> > >=20
> > > With the folding of two distinct values, how is the caller going
> > > to
> > > tell failure from success?
> > By checking if the return value is < 0.
> > According to the SBI spec [
> > https://github.com/riscv-non-isa/riscv-sbi-doc/blob/master/src/binary-e=
ncoding.adoc?plain=3D1#L32
> > ] ret.error can be or 0 ( which means success ) or something < 0 if
> > it
> > was a failure.
>=20
> Right. And what if ret.error was 0, but ret.value was negative?
I wasn't able to find a case in the SBI spec where sbiret.value could
be negative. Unfortunately, the spec does not specify the possible
values of sbiret.value, but based on the description of the SBI
function, it only returns a negative value in the case of an error.
Otherwise, ret.value is always greater than or equal to 0.

>=20
> > > > +int sbi_remote_sfence_vma(cpumask_t *cpu_mask,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 unsigned long start_addr,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 unsigned long size)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 return __sbi_rfence(SBI_EXT_RFENCE_REMOTE_SFENC=
E_VMA,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 cp=
u_mask, start_addr, size, 0, 0);
> > >=20
> > > No check (not even an assertion) here for __sbi_rfence still
> > > being
> > > NULL?
> > I thought that it would be enough to have BUG_ON() in sbi_init()
> > but
> > then probably would be better to update the message inside
> > BUG_ON():
> > =C2=A0=C2=A0 int __init sbi_init(void)
> > =C2=A0=C2=A0 {
> > =C2=A0=C2=A0 ....
> > =C2=A0=C2=A0=20
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( !sbi_has_rfence() )
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BUG_ON("At=
 the moment flush_xen_tlb_range_va() uses SBI
> > rfence
> > =C2=A0=C2=A0 to "
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "flush TLB for all CPUS!");
>=20
> I never really liked this kind of BUG_ON(). I leave it uncommented in
> code which clearly is only temporary. Plus imo such BUG_ON()s want to
> be next to where the risk is, i.e. in this case ahead of the possible
> NULL deref. Then again, without PV guests and without anything mapped
> at VA 0, you'll crash cleanly anyway. So perhaps my request to add a
> check went too far.
But then there is not big difference whether BUG_ON() or ASSERT()
inside sbi_remote_sfence_vma() is present. Even none of the check
present it will be a crash anyway.

And the other reason why I thought it would be better to have BUG_ON()
in sbi_init() as it will be need only one BUG_ON() instead of having
ASSERT() in each function which will use __sbi_rfence().

And according to coding-best-practices.pandoc:
```
 * Programmers can use ASSERT(), which will cause the check to be
   executed in DEBUG builds, and cause the hypervisor to crash if it's
   violated
 * Programmers can use BUG_ON(), which will cause the check to be
   executed in both DEBUG and non-DEBUG builds, and cause the
hypervisor
   to crash if it's violated.
```
The difference between them is only the check is working only in DEBUG
build or both in DEBUG and non-DEBUG.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 10:14:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 10:14:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777967.1188032 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seXUa-0001zY-Jr; Thu, 15 Aug 2024 10:14:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777967.1188032; Thu, 15 Aug 2024 10:14:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seXUa-0001zR-Gw; Thu, 15 Aug 2024 10:14:04 +0000
Received: by outflank-mailman (input) for mailman id 777967;
 Thu, 15 Aug 2024 10:14:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KwPb=PO=epam.com=prvs=49579c5ae1=sergiy_kibrik@srs-se1.protection.inumbo.net>)
 id 1seXUa-0001zL-7B
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 10:14:04 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 17c7fb93-5aef-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 12:14:02 +0200 (CEST)
Received: from pps.filterd (m0174680.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47F9ZgRs023439;
 Thu, 15 Aug 2024 10:13:52 GMT
Received: from db3pr0202cu003.outbound.protection.outlook.com
 (mail-northeuropeazlp17011017.outbound.protection.outlook.com [40.93.64.17])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 410tdwugyq-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 15 Aug 2024 10:13:52 +0000 (GMT)
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com (2603:10a6:20b:5c0::11)
 by AM7PR03MB6468.eurprd03.prod.outlook.com (2603:10a6:20b:1bc::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Thu, 15 Aug
 2024 10:13:50 +0000
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d]) by AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d%4]) with mapi id 15.20.7849.021; Thu, 15 Aug 2024
 10:13:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 17c7fb93-5aef-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=om8u9pm+dY0houmDq+AreZzG3xNRsyCad7wnktecoiWbrnFDOIb0mH2pafXOIv4ibaqaxwPdg1BQpc0Ir9xpJwDxlv7+M/mpe/boj3p2fjXs4+WahsUObkqssI8f+hy1gcuZgrRpg4f/qiaa8ZUtYFo9B+O4aZwSdiFtircIzyhyajwL8qBjZ3nUBu5r/JhjLMU+SzIBsewkx2zKXQ5fys+WCuEBpOkSli2LzAz5ehDj0+iwp4WvTcWcs7zmycWjtxqsiF6PIlbuF0fT5dn/bu00ECMrpbgMq68mxaBvKXVo6tl7oXjUDBY7j2fONFMVj9BMSL24SgjUdNci1uybOw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KA9utaxHJXkM8L3oh6OBEMf86CJfyD1O7lD4HEeri0g=;
 b=pgWub1WTBrJ85bF0kToFuva5JXAV5IUQGykCrWfl8ySSQYmO+gAdaQSCKinHxmAMtAf0fm262hskLuhc5tKFeIgSHOu27a1BNuioo3M+YSHXbfgqIF4aJTSonDTktfvHdPUd2xehiaBLetnZw6qeaCj0Hpku7B8tWFJd+ZIHw2vGZ+NK3lDt4Nl8hGaCj9u0IhAuGcFRM4Q4DXCWH4oIBovpywPHYctcrRaZIoIfK99zcaKZ1mKxvOLQQYZ4BWpYyYCJwA5dtdUIPmlRKhRGU9zJ0ZqV8C397wlre3+f34dEFMcoB/hGw4n08tXdzgQqy6tPLTZQbZNI41zfJTdiWA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KA9utaxHJXkM8L3oh6OBEMf86CJfyD1O7lD4HEeri0g=;
 b=CVE1zot1/fA2OsIHYUnamrjmox+rM7ofSD8HBAaE37SxCqo+YHth6WFBhNqJcYaSpxAuhSBL3FCDOWbeObzwkdk63e+A3gGkroSRRZQwoUvQnuXCThu8x5hJrakSZRZwnI+oAyEgboouRhW61ntz31bzKNZGAhTsWHRdq3RbvGB5MzC6q6W49thrYn4Y/JlLkwvVRvauG01aC99V2mRlz1h6I5zOVKxgBIKrAI4W7/V0XQFgJ1LaQ5ApjS280yRqslC2X50qD2oVMGVihbhHL7p8mc07Ao1bJzykFDeW+UpDj7Np5TObMoFS5na2CEWPI/8A5KwEjgXo3HKNfLtb8A==
Message-ID: <ffef234e-8b9b-4564-a33c-15e606c2e63a@epam.com>
Date: Thu, 15 Aug 2024 13:13:48 +0300
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v1 2/2] x86/amd: optional build of amd.c
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
        =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        xen-devel@lists.xenproject.org
References: <cover.1723196909.git.Sergiy_Kibrik@epam.com>
 <5632b05e993cca78a58b800dd37165ccd80b944f.1723196909.git.Sergiy_Kibrik@epam.com>
 <abdac4dc-b8e4-46ad-bd4b-c39caa868a9f@suse.com>
Content-Language: en-US
From: Sergiy Kibrik <sergiy_kibrik@epam.com>
In-Reply-To: <abdac4dc-b8e4-46ad-bd4b-c39caa868a9f@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: WA2P291CA0031.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d0:1f::12) To AS8PR03MB9192.eurprd03.prod.outlook.com
 (2603:10a6:20b:5c0::11)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9192:EE_|AM7PR03MB6468:EE_
X-MS-Office365-Filtering-Correlation-Id: bfdcb51c-1bb6-4b3e-6588-08dcbd12f4fe
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?V202MmJyTEZ0YWkxdDdXN1JMK0dVMEEyRC9zOHZ5ZXovdTY4dEVQT3pFVitQ?=
 =?utf-8?B?dk1DWVRBbDJISkF0dzBrWk5SRllPY1ZFTWxlamhVQWNzZzRMQmZkMU1TREZF?=
 =?utf-8?B?REdDbnp0eHhkY1Q2QnBZUnpDbFBRckYzZHJ4RHBqd3VOcjh3NnhEZmsrZ0Uw?=
 =?utf-8?B?L29QYWw2cEVtZzNwUUFrdDZsVlN3Mm1STnpxdHFORG1BKzhaTjh4TVhiYjM1?=
 =?utf-8?B?MVZKTXlQSmhBNC9iZGJzcEMwYWxESHBPQ1hhRUthTlZ2UEdNNWN2SzJLYlNM?=
 =?utf-8?B?U1lnWDJDUC9NUENrNDRFSWJvM2R3dEptSE55bkROVHU2N2tIank1OU5WMHRw?=
 =?utf-8?B?WWx6UFdFb21CTXd4dWV5dldPOUpBZDBIbmNndVZQSDhudS9YZFliYkNsNEdN?=
 =?utf-8?B?QVF6RENob2k5UXVjTllJd3I3RnlWemVycVE3dDR2ZXlvVW5ERzFQSC9zd2VD?=
 =?utf-8?B?Tm1tM3hudXluRGI0aGt3ankrUm1DM2xaNUZnZDd2aWVqUnh2K0d5RHo0Zk9s?=
 =?utf-8?B?VG92Sko1d1FWb29DWU5hN1RzUWd2RXVkRUFQeXJJbUxUcjJYY0ZubVk2VVp6?=
 =?utf-8?B?TG5XMkQvUjh2SUZZcVdJSTlKWjJIQnhadWRvYjF3RTZJT0l0dllZZmcreHdY?=
 =?utf-8?B?UzRVZ21aQk5kQ25Qa254OWx0M3JyQWNTUUtMWmVDWUxDTEx0S24zS2FXM2R6?=
 =?utf-8?B?UHNQRHd3TXdvU2hkSEJtNUYzZStZSzRsRWhBMFhoSkdhZEZPelFDQlJWTTd2?=
 =?utf-8?B?Q0VPSVBrU0JYNFVmK2w2bjJVVm5ycU1xT1NRamdkaEl4blBseUhxZXBuR2tZ?=
 =?utf-8?B?bXArdEpCS0NMMktIeEl0am92OXNEd0VlVHoxQVJDNUdZOG8zcU4vZGJnRjdY?=
 =?utf-8?B?bDNQSWhlVkxTL2puOEtXb0lyb2pTWWUxOUZoejk3NVVTZ3VvcHVJdjRxcDZ0?=
 =?utf-8?B?NENpYm1JMFJ0Zjh1SWsxSkZ5OTlRcUJDZC9EUVZiUXp0TWFYSnd5RDYwa0dB?=
 =?utf-8?B?RURHU1hnb05iRzIzZkR6TXdhS3hsaGYwYmVPSmZnVG1XcXBORnVQSHVNM2ph?=
 =?utf-8?B?ZGxzcU96UmpPNnZqMVlrQ0VOQ3B4RVZtWkhlQmlyMXpsc1lSaURHVXpTekFz?=
 =?utf-8?B?MVFoUkFaT2wySnlVRThXNmtGWTV1ZTc0UnprcDM4a2lBSTJPV0dCcS9GVWVJ?=
 =?utf-8?B?MSs3L3llUmlqbURqZkp6RXAyNlBBR2FCVzIvSVhlanp6cDBxeW5GYmxIMEp3?=
 =?utf-8?B?bmdqdGdPODZHTG02OWRVZkMwVE5lMG1tbmdWd2NxdVZic2psOXBCaXhGTlEy?=
 =?utf-8?B?RlJxYUQxUVNqNG8zWUhabGVTenVxK0MxVlBHQjM1U25EN2g4YmE2TWpzekpC?=
 =?utf-8?B?Ly90VGY5aHAyTVlRS0szbytPdm1OamR1QTROMjM5QzZ3MktYL1M2YVd6RXI5?=
 =?utf-8?B?WEhaRElTSWpwZHdSRGR2UUNTUE45ZzJCTzBhdFdQZkxORWFleCtzcVhRY0wx?=
 =?utf-8?B?akJTVU5QR2g3NU5GUUNPR1IvU0xLM3ZIbVYwaGYzTTY0cVBackhJQXg1TjdR?=
 =?utf-8?B?WU9CZTZOTTRxdHIrdytqK1o3N1RsSXNsRi9EdFhOUXVOODZTdUNaSFpYUC9z?=
 =?utf-8?B?TXFTankxb0E5L0xBZnhveGZwYzFYSDhxcnF1UktEdERkcXFwYWF6anlMamI0?=
 =?utf-8?B?STQrVzJacktkM0tGcktSRkdrdU9zN3YxNEEzQTBUUUdoMkcwZW8zVkJOTDJl?=
 =?utf-8?B?R0huMmEwbVNSSlU4TWFiTjU1azJaVUZwc04vZ3d4RzNCdHUxZ1NhMHBZSmdB?=
 =?utf-8?B?ckNZemNJVDVhbURycCtqZz09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9192.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?OVdrTnJmYVdka2NTQzZZb0JEVDRrOEdHZnk5dWpGb0NWK3J1YmVYZWRtZzZN?=
 =?utf-8?B?WElTdlZqQS94QW84UFFWaERSSExyeHV6TThSekxwbXJRQjlQM0tJaG9PNTRy?=
 =?utf-8?B?WVh4RlYzcmZPY0FuVlFDYTBBYThoYUpXK1lXLzBadzBmTVdBeUtBNUhENFRF?=
 =?utf-8?B?NmhUNXlNT3EyRHV0ZU1rSTZCdDZNeU96UExiWmM5bzFWcTY4NEUwZGx1TGpo?=
 =?utf-8?B?aTVMdkRSQ3pqc09TZzIvVlowTUdmR0xyY01GWkxJMnRoYVROUjAzWGErUVNI?=
 =?utf-8?B?a1BqRFJFSVdYbzRMckM1NnBWazVkTVRiRUIvVmJscEJ4dlpDcXc0WVg1a25z?=
 =?utf-8?B?dlE1U3dUcDg5QTNGQjJBVVkvR2Mza3pkMW92bDRaVXJpMlUzQllQLzJEYWc1?=
 =?utf-8?B?eHR5bis1ZzYzcmYyb09CY3dTc2ZhalNkUDhMWTg5ZFMzMVIwbU5nTWlkY3hZ?=
 =?utf-8?B?QU9aU3lrQkN5dTZmWGhBZjdFZDFlRmZFMU42NmhadXYyaUJMeDR2eGxyVXh0?=
 =?utf-8?B?YVQ3RGJKY01UWDJpSXBsWUNMMWEzVWIvNmluek81bmVhQ0VHaHZpTjJWMXNa?=
 =?utf-8?B?dWs0aGQ1RjBqQkJIdFEyWVRMYUppUDArMk1XczN4QjVCWEVUaHdiV0wzRG1S?=
 =?utf-8?B?aE00VHNSem80VW4rNXFPcTQ4Y0F4YWxNZ2FKak1tMklqeXIrQXhyRUlrMGRl?=
 =?utf-8?B?SEk5SlVvbFpPR2NUMzFEenpKQ0lXS1NYTXpTbWpaaTR4eUJ0ZmI0cEZwMjJ2?=
 =?utf-8?B?M3NHa3d0TzFmdGQxVGVYb2VCV1NTZHZYMnNhNWNqTDFwanZpQi9ua0ZxeG43?=
 =?utf-8?B?T1B0QW1jMWxGSzBjd0hwdGd1VUZxMk01VmZ0Q1lvajVZRkdsWnBGdVBOaGkv?=
 =?utf-8?B?czc0UzZVWkh6ejhPZ1c2emZKWmVSOHdOZ05UbEVKYklCSXd5aVF3VEhweTVH?=
 =?utf-8?B?cWxBNitaVGFiLzY1NkRDTHQ0TWVqWm5qVGpBNk9QMWY4b255NUw4NzZRZGxC?=
 =?utf-8?B?TFJLV2JjTnh3RkpvcG5YSlFIU080THkyZkN3bHFhUzh5SjdWMTNBd1hyZ056?=
 =?utf-8?B?NEhCNjNCRHV3S3picUJPTWVnVTVzZ1hLend0S0w5QUxKcUVBVVM3UHZ5OU1s?=
 =?utf-8?B?U3cyYlZrZ3dtRjZGSWpHcElhdXpsR05kU0xmN1VCYTBuc2xBcGt4bWRlYlZj?=
 =?utf-8?B?dVRwazl3OVNkMDFIdjJYSzNEbS9Vdjh6NDFEdlF2V0k0R0UraDd5cFVMK0JT?=
 =?utf-8?B?TG9EaXBQQ3dpVWQ0WnA2eEdhcU90UkVwOE9NWkRvZVhKYk5XdGt0OXZxblV2?=
 =?utf-8?B?TUtXaUVyNnBKL0FqNWU1U0xnYVhyTWJ4TlM1SGFoTW1FVFpJMEZ6ZGlaWjFH?=
 =?utf-8?B?WjhrRlF4N1pYelVXQTdGOWFZeUJTbjNQQTkvMXZUcUpJUElRTjF6azkrWExL?=
 =?utf-8?B?NWR6Wlc4U0dQNnFGb3JHOVh1R2ZqZ0J2QmNlaWFqVjF2WXpCR2V3Q3hNVk1v?=
 =?utf-8?B?aUZyaExMRHdXMWJXSDNrYnZJS2ZvL0tKTklMMlpOd2ozT0habVpWeVlLSS84?=
 =?utf-8?B?Z2tpV2laa2NpMTVDVFFMcGZ6cEJJZC83NlpRV3QxUlF3aUVKRDlscFkyclgv?=
 =?utf-8?B?VXl3OHhhckp5bzNxTm1OdTZHMU4xOVVhMitDdkVYbzNhbGpydnFjZFBnV1p4?=
 =?utf-8?B?cHpOeDc1bEZPcWNSeFRBTzZnclQwOW9JUEk5TERFY3BNZTczSGp4VVJaTXhk?=
 =?utf-8?B?WGtNaTh5T2VUcFJHdXM0dXJQWTZpTlBZWmJPeG82azNaSG1kUGNMOWxhVVZH?=
 =?utf-8?B?bnJTZUxEZ25RR3pvWnBVNDVuNmllZjVreHZwTDIrQlJMalNQOWhBQnlicXp4?=
 =?utf-8?B?K2lWVXYySUt4azVCSWVlWGFDYithZm9jM0NuOG9qd3RsdGlJWWFiSS9FS0Ru?=
 =?utf-8?B?VWRWNjd0R29WOVRqMzl5NHdmcUl1QTRnSnFDQnBVdi9KZm1IYjdDczc2VHVp?=
 =?utf-8?B?SSsrNDY3a1lLTGdocldkVEtGRG02SzlicHBkaFQrNDRvMTF2T3BtSzdPajdC?=
 =?utf-8?B?N1dlZW5jSlVDcHZwZUdJa2RsbjkxL3RCaGxTZExCK0M2aDFobVc5WWxDYi9C?=
 =?utf-8?Q?nRgDxm4xbyz+eXzGiNmyRGQHV?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bfdcb51c-1bb6-4b3e-6588-08dcbd12f4fe
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9192.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2024 10:13:49.8767
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 4LnRvq+bqWFHIreodS2GEJZE/14P5AQ41RbmHRhiWPvkAZ8NnA2ttWMVIyXqQxhHSEBe5UIY8DuG8pXOGry/Zg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR03MB6468
X-Proofpoint-GUID: KcVgHf1pUDsq5Zlk5sc416I228EqBMBo
X-Proofpoint-ORIG-GUID: KcVgHf1pUDsq5Zlk5sc416I228EqBMBo
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16
 definitions=2024-08-15_02,2024-08-13_02,2024-05-17_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501
 phishscore=0 adultscore=0 malwarescore=0 clxscore=1015 mlxscore=0
 suspectscore=0 impostorscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0
 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.19.0-2407110000 definitions=main-2408150073

13.08.24 10:50, Jan Beulich:
> On 09.08.2024 12:11, Sergiy Kibrik wrote:
>> --- a/xen/arch/x86/include/asm/amd.h
>> +++ b/xen/arch/x86/include/asm/amd.h
>> @@ -158,13 +158,21 @@
>>   #define is_zen4_uarch()   boot_cpu_has(X86_FEATURE_AUTO_IBRS)
>>   
>>   struct cpuinfo_x86;
>> +#ifdef CONFIG_AMD
>>   int cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu, int osvw_id, ...);
>> +#else
>> +static inline int cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu, int osvw_id, ...)
> 
> Nit: Too long line.
> 
>> +{
>> +    return false;
> 
> I wouldn't mind if you consistently changed the function to return
> bool, but as long as it returns int I don't think it should be returning
> false.
> 

indeed, it should return 0

>> @@ -173,5 +181,19 @@ extern bool amd_virt_spec_ctrl;
>>   bool amd_setup_legacy_ssbd(void);
>>   void amd_set_legacy_ssbd(bool enable);
>>   void amd_set_cpuid_user_dis(bool enable);
>> +#else
>> +static inline void amd_set_cpuid_user_dis(bool enable) {}
>> +static inline void amd_set_legacy_ssbd(bool enable) {}
>> +static inline bool amd_setup_legacy_ssbd(void)
>> +{
>> +    return false;
>> +}
> 
> Nit: Would be a little nicer if these were in the same order as their
> corresponding declarations. However, along the lines of one of my
> comments on the Intel counterpart patch ...
> 
>> +#define amd_acpi_c1e_quirk (false)
>> +#define amd_virt_spec_ctrl (false)
>> +#define amd_legacy_ssbd (false)
>> +
>> +static inline void amd_check_disable_c1e(unsigned int port, u8 value) {}
>> +#endif
> 
> ... question overall is how many of these stubs are really required,
> once clearly AMD-only code is properly taken care of (perhaps not just
> in spec_ctrl.c).
> 

most of these functions-stubs can go away, though it'll require more 
CONFIG_AMD checks at call sites, and more patches probably.

   -Sergiy


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 10:19:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 10:19:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777975.1188041 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seXZq-0003IH-5c; Thu, 15 Aug 2024 10:19:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777975.1188041; Thu, 15 Aug 2024 10:19:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seXZq-0003IA-38; Thu, 15 Aug 2024 10:19:30 +0000
Received: by outflank-mailman (input) for mailman id 777975;
 Thu, 15 Aug 2024 10:19:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=2AJB=PO=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1seXZo-0003I4-Vw
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 10:19:29 +0000
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on20615.outbound.protection.outlook.com
 [2a01:111:f400:7e88::615])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d97ce659-5aef-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 12:19:27 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by DM4PR12MB6374.namprd12.prod.outlook.com (2603:10b6:8:a3::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19; Thu, 15 Aug
 2024 10:19:22 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7875.018; Thu, 15 Aug 2024
 10:19:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d97ce659-5aef-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=PBmq1uPzCmqkjjJnl6j7elu5IL6+wI957UUOceusXKFS6USR3aO5/LcSpgYM5eMQRXDu5U7LW2NxE0/anairGhgD+9+VlVO+cENHSBM5KHzayYf72QEw8J4TObWd+cNlqFvAP+xAM4otSiKOxYckxS28bv4hKe/uyNikfpA0VlVLS/LQH1losT9KbKyjwNwJoX2iIsfbvMnDghk1fw4HVj8jS7QH+rFDZzxyx2n7qSL7QE4XYUfa5115b/inb1ZwsZjcw26wteokeq2S1Lyf7H5njXjuA8GYh4jwLsuNiZr+LudH0yHbM4EIra72w3BIYwo1Sxq7gTtnXO2ARl10Ww==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=kDq+aa1b/tTy5PKA4RYeHTiQ1wnB1oMO2F5Fw9ngVqg=;
 b=NzESjjjOtfYGlEOypzYhWJnRG4IEwKCRgSDN/wXVLRJchzxeLo6M7FJ3Vu9EAcY53aq2jwSkaKQyoh2OvP8ZKeL+ndDaFAFFtk0xeHH1IWOlKi52IzGFGItAqPUz3Fob4D2cRQt5KWudc0EE54wVhnunP5AfO3pCsjRococi+ucF0igNqbaRVGTeiQM6AbLhcJuiMdUJjk+AbGmOCQaT3c4/BqouOGqK4uF+Kb/EWv4cznP+mZsrBnI//MkWciLYARNfoUUMiwnINX0x+K1yeHlind44KPy7L5rTjop6Nyqwb9piWrBeZomaO9bYt161amK1WBcns/warvt6JQj19g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kDq+aa1b/tTy5PKA4RYeHTiQ1wnB1oMO2F5Fw9ngVqg=;
 b=OmuaFSQWjNaQisPUlgTg1VahMIBMyFktzuxf9vw3weyaG1w2hLvrNgTGZlisYYBnxdqsfeMUT9M4TmOs1EuUGQIwXQ+g5oO3H+ImG14V6VLNWLmPVtuGrMQm7ZnonaCRjvYYCNtjHdzNAMfgUWTSae7pHrdxTner6wxCCf5ahQc=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <49a1c722-e6d1-4f26-b8bf-71651661d0db@amd.com>
Date: Thu, 15 Aug 2024 11:19:17 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/arm64: Hide FEAT_SME
Content-Language: en-GB
To: Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240814210054.67520-1-julien@xen.org>
 <22dcdbbf-5000-4b92-b746-5e01c0160776@amd.com>
 <7612e207-7eff-436a-b884-3a0227aababa@xen.org>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <7612e207-7eff-436a-b884-3a0227aababa@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: DUZPR01CA0175.eurprd01.prod.exchangelabs.com
 (2603:10a6:10:4b3::19) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|DM4PR12MB6374:EE_
X-MS-Office365-Filtering-Correlation-Id: ce62aa6c-8f27-4b0e-824b-08dcbd13bb51
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?TGl2bkxVV1pKajUveDlnT2VUeXB5WFlUcEV5aFVtSi9FdWVYdmZUTk1qdjZZ?=
 =?utf-8?B?NGZwU0pIRldCWFVIdHFxcDE3VTB5eVBjNW5Bc3M3Q2xiRklUSUIzMkxxYWJ5?=
 =?utf-8?B?UWZrZWVHdG1pTEpWRlY4MUpuUmMyTi9oVXN1VEZNQ0VXQUlSSnhqaDFOWjFw?=
 =?utf-8?B?VitjV1BoUm1wMkZhd2JkRUtaVUdKcXRobEw5d2NKL3JtMnJ5ZEZYWnROeUNS?=
 =?utf-8?B?ZW5zUzYzUTVqS2FTSTBsYTI5T0ZObDh0UUY2VVJEeURFeEJSb0czQysvbmZM?=
 =?utf-8?B?SVVRN3ladStHRUZBclBPZFJrQU90RkxBMXVyb1BBUW81RW13SUtXRzdMWXo2?=
 =?utf-8?B?cm4xWUNxSENoR3FXbWhwMUdJT1hTS2plMG53NUxWamNGTWR2NTZEOEtQWjYr?=
 =?utf-8?B?RXk3YWtkbDcwTlZXaDdtaTkwTW9FM1pkK3ZUVzFSQ3JNNUt2VG9JTGY1c0lh?=
 =?utf-8?B?TlJqajZoRGN3Si9DMUprajdjb3BicFlJOGQ1Rk9FRXVtUmJmS3BlMGZnR0Zx?=
 =?utf-8?B?dzlIUUllZjNhS2JxOTAxSk5YVXRHYTJtdXgrc09KZ2VZUERLaGRMMHZNSk1y?=
 =?utf-8?B?ZmJPVWIwMlE2RkR4eG1hSXF0bWZlQVUxSG5WT2tMckxhRlBOdWV6WW9SOElL?=
 =?utf-8?B?bXFGUXhwR1NORTNEck52ai9hUlU1Mi9oUXdEREVZRUpFc0lzUWNxZGNlaGJP?=
 =?utf-8?B?NHRjdUJkOEdFdU8xWENsWTdhRVp0UHRRekdWQmcwK2srQUZ2YnVuYTVoMGJH?=
 =?utf-8?B?Kzd2c05SNzBmM2E0elpBUjQ0QzNjVkwremFjRzVFQk9SV1lMaHkxbGFaRm9I?=
 =?utf-8?B?Y1pYdDVsNG5nTmhxWWJCdFM1NGVPckZyTlpoeFJoTHNBVG8xcGNuSFBaMTM1?=
 =?utf-8?B?OTBaWlJHN0dPODR4c2FCZ0ZxWEFzeEtBWEhDMWs4Q05YTzRKTUVwQjFROHJC?=
 =?utf-8?B?anN6VHdVZ0xHeG91ZHBRU0hnRGczcHV0WG13WDlkS1ZiaFkvUWdQZ3pLLzlX?=
 =?utf-8?B?anZyc1hrcUdiSnozekF4enorMHVkbGptaEMreUlSZWZsWG1oSzFQck1MWFNZ?=
 =?utf-8?B?TTNsT0lvMGxkZkFWYStRV214bnkyTWdMcjFXZlpqTDN6Y0czblhtTVRTRTVB?=
 =?utf-8?B?S3JMdDhqRFVRK3BBNzJrYlhVS09oeDlaeTdZTVRkeU83dkdFNFQ4U3VSL1Nl?=
 =?utf-8?B?VytzQThreFRCbWdXMzcwUnZzY0tCemJZOXNrVzA2ZGNzL1BSTU9BMThEc1Nt?=
 =?utf-8?B?SnM0TXVZaitxd3BUSmlNOVR5dk9QWU1DQTFIbWs0bUlzZnpReldOSFRFd0Ez?=
 =?utf-8?B?TGxSMXcrNGZaRXZZVkR5UkxKQ0FFZXJCelNqN09GMm1hMkIwdUdMR3M1WTNW?=
 =?utf-8?B?Z285Y1YzTE1wb2NseENGTzl3a0tHN2Z1ZVJFMGVUSEh1YXMxdFpkdDJ1V1hq?=
 =?utf-8?B?aExaWWZ2dkdmcWNVNEpqRlpRbHVBbXNBd1gzNkd3NWEzbnIyUWc0RVM4d3VP?=
 =?utf-8?B?a2hXenJpaUEvcWhXMXVjT01UbUFTdHZqNlVNWVhHRHVqMG5WWklCNXY5a3RU?=
 =?utf-8?B?WUNEUFJtOUdvSkNtVFVzR0dhSmlRSEhKTVAzeFpkNGw4Mmttc0c1SkNHbUZN?=
 =?utf-8?B?VENBbHVLVlRDa2JIblZCVjhoeXBKNlVSQnd2VW1HdmIycWs1U2J2OVNubWZU?=
 =?utf-8?B?cjdQQUM3L3JoTTFPeUcrMGl1TWkwUk4ybFgzUjI0QUYvZTExUGdQYlVQOHhB?=
 =?utf-8?B?WkovaDFnVFlDc3FWKzgxMmtDeUU4T2F5dFNqanVmZEpkZjdHa2hGWTU2Z1o1?=
 =?utf-8?B?VzNMWXMwKzhZYTBLTnNsQT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Q1pWZldyTjQxSGR0RTNjRktCYnkydnFralBlWFlMR3RNREtQS3RFVTAyWXFO?=
 =?utf-8?B?SnF0a2t5bkp2Y1dwSVd0RFgyT05RekVSNEwxdWwrVUVDS0hKRGRyS1U2c05O?=
 =?utf-8?B?eE45MWNtYWtqVHJtWGJ0c0JqQ2NCSnppU3kxSE13czVXQU9TN1Uzenhsd2tu?=
 =?utf-8?B?U2phSEV4MEMzbjhyWHZqUWhQbCs1dVMxVXBoY1RWNGZqYVU1Z0V5aGU5V1dL?=
 =?utf-8?B?aWkwTFlURCtNSTBleDdhTUVQTEZKbHg0K2hhd0tVRlFTK2t6eWJZYSs4VUFQ?=
 =?utf-8?B?MkJQSFk5ZllXejg3VXZlR0tRVVVYcnVLTjdFeXd2WUdxOGVEOWw0L1BoNkhw?=
 =?utf-8?B?dWFGWmtXRVI0dVZVR2hlemdvbFAyOXpCQjJUYnpYSGJtd09kQzNDVEtpMFNO?=
 =?utf-8?B?eGdSb2pHOE1DSS9MZVA3ZHBza0dKZ3RNR2psaWQ5cXNtTGFaZ3piSFZuazBv?=
 =?utf-8?B?RzZDVmVuKzdmU2gyVGl0dEhXZDVYdzhOSkgrS3g0U01uOVJONWIyWXlXVTRE?=
 =?utf-8?B?aUYzZERXL2FlNmdnQXF3NXFpWCszZk5DeVk1RFA5eU9wcVpyMWJudlk5V295?=
 =?utf-8?B?NGZ4dnBoOGN6MG5YMmxEcDRRUURwbEVKbW1IODRubFh6a2VNcFl0QW9tU09O?=
 =?utf-8?B?VG4vUThtTlVvNW91SXpNc3hSVjlmeEtHN2t6aGI5dnVFTjUzb1ZtWHBneVdr?=
 =?utf-8?B?K2sxeG13ZWxhY2RyU0wrT21EZDJpVXMxc1BGTzdyNWMrSVlOVC94UWd4MWdr?=
 =?utf-8?B?WHJETU1aTWxmT0tqaEp3NXFld0dnUm1Pbk9YR0E1a0Jocmt3ZmZmN0c5NkJ2?=
 =?utf-8?B?a1E5K1g4U0IxNWNFMVVHNUJhNFNjWlVKbjJBcVBJVVpMbmdNU2F3Mm10UE5J?=
 =?utf-8?B?Z0hGUytmdE1sOFJVellvNzhzWVYxRXBWTERRNVUyblhRNHErbi9QK0NZWVN6?=
 =?utf-8?B?MXN4b2l0clhnN2hnYXZIa0dMYzludUhoNU5UWjFxVTlBWm5YSzdDZnJEbU1R?=
 =?utf-8?B?Wmc1NEFGRHJ0ZHRWYlhFS3ZCV1BzUmdRZ1RUM1NBRktFV1dzaTF6QmVHdmtG?=
 =?utf-8?B?V3oraUQrc3cxM3hkMDBrOUlXZENJZkRONkw2VkxnNnZZK2YrdTFuTmxGbTha?=
 =?utf-8?B?VG1XZGNmNUNMeGNmZG9kdmViUFJDOG94dzVDbjlrbGx0cTlhQWViY2cvSUE0?=
 =?utf-8?B?M2NlYTljb05PM3RaWGxLVlhuZDlVc3gwNVRURFhMK2k3a2NtWm5ySXhLaDVj?=
 =?utf-8?B?UHZENDJxNU95aDZxb0xLNXpkYS8xb1pESXQxTUc0dWpvbSttZWVHRi95TzlT?=
 =?utf-8?B?dUp0NVg4dFlZNzZkL2NZSUpaNGQvSlNtbkRITlVUL0lZNjVpczc2MkMxbUc4?=
 =?utf-8?B?ODc0MER2NS8xZnJNajEwOGt6RXdUc1Rma2NDRWcrTTFBMk1DZlpoaDV3WW1a?=
 =?utf-8?B?RGk1ckJnRjh6NEg3bEhwSUROZzZRWTdjTSswU29WOTlyT1hSK09OV2JJcTdC?=
 =?utf-8?B?NlFYNVk2cWtGVkRDNUJSUGxxa1o3UGlFQmZyNGFxK1E4YlhPd0NDeHVmSytT?=
 =?utf-8?B?TlpmQ2NPRWY5UnNjR0tKWjZITUhDZm9XNVFKNnZjcW02bzJVcHJGcDJCanFT?=
 =?utf-8?B?WGJzMkpablFmSzNkcHIybC9Qd244dFBCdzU5NzRaTldTd2Z5ZmFLVWFXWGdE?=
 =?utf-8?B?VGtaQXBkbUlwRDgxUU5hbHZYVjB2YUlqamlvbUFjT0NxdkpzR01WUW12Ym5v?=
 =?utf-8?B?THlEWDlxWE95UzNNZ0FEbUxHdGN3NHJISmVYRjlqaWpFRG1OUUpQakRoS0Vh?=
 =?utf-8?B?L1JzTjBPaGVkb0s5RXk3QURIaWJES0FZcDNRaGpMUWJUajdwTmpET3N1M2tL?=
 =?utf-8?B?ckFOZ2tTaUVQU3hUUVdrREh4eksxL1ZTTnhWb0FIZzhBWWpnQjR4dm01SkRw?=
 =?utf-8?B?TkU5dy9Nc0V4aVRyUDZwWFBUa01weVJsUkcvMUMxc2J4Smw0Q0lRakN2dnBP?=
 =?utf-8?B?cVpjaWRRYnpxN1JESllYcEFCcXljeXJ0cm1TVWlsejYvdjZFMGkxRzJwb1RK?=
 =?utf-8?B?TlFYaGpEUjh0aWk5a2o1aEJrdEY2RTIvQUNmMWcxNkJBam1PSDJOVGZwSERF?=
 =?utf-8?Q?efrK8QfbrO/SEJF9lssiHjchF?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ce62aa6c-8f27-4b0e-824b-08dcbd13bb51
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2024 10:19:22.5872
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: x/dQJaGVdwf7/z3LZfvGvjh/qzicOFcKBg9wkStURn2ucVaRrHGuQPLCPoZ+ETkbcdxOVOSyQ/n+E/L+4cD/rA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6374


On 15/08/2024 10:37, Julien Grall wrote:
>
>
> On 15/08/2024 09:58, Ayan Kumar Halder wrote:
>> Hi Julien,
>
> Hi Ayan,
Hi Julien,
>
>> On 14/08/2024 22:00, Julien Grall wrote:
>>> CAUTION: This message has originated from an External Source. Please 
>>> use proper judgment and caution when opening attachments, clicking 
>>> links, or responding to this email.
>>>
>>>
>>> Newer hardware may support FEAT_SME. Xen doesn't have any knowledge but
>>> it will still expose the feature to the VM. If the OS is trying to use
>>> SME, then it will crash.
>>>
>>> Solve by hiding FEAT_SME.
>>>
>>> Signed-off-by: Julien Grall <julien@xen.org>
>>>
>>> ---
>>>
>>> The current approach used to create the domain cpuinfo is to hide
>>> (i.e. a denylist) what we know Xen is not supporting. The drawback
>>> with this approach is for newly introduced feature, Xen will expose it
>>> by default.
>>>
>>> If a kernel is trying to use it then it will crash. I can't really
>>> make my mind whether it would be better to expose only what we support
>>> (i.e. use an allowlist).
>>>
>>> AFAICT, there is no security concerns with the current approach because
>>> ID_* registers are not a way to tell the kernel which features are
>>> supported. A guest kernel could still try to access the new registers.
>>>
>>> So the most annoying bits is that booting Xen on a new HW may lead to
>>> an OS crashing.
>>> ---
>>>   xen/arch/arm/cpufeature.c             | 3 +++
>>>   xen/arch/arm/include/asm/cpufeature.h | 4 +++-
>>>   2 files changed, 6 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/xen/arch/arm/cpufeature.c b/xen/arch/arm/cpufeature.c
>>> index ef77473bf8e3..b45dbe3c668d 100644
>>> --- a/xen/arch/arm/cpufeature.c
>>> +++ b/xen/arch/arm/cpufeature.c
>>> @@ -208,6 +208,9 @@ static int __init create_domain_cpuinfo(void)
>>>       domain_cpuinfo.pfr64.sve = 0;
>>>       domain_cpuinfo.zfr64.bits[0] = 0;
>>>
>>> +    /* Hide SMT support as Xen does not support it */
>>> +    domain_cpuinfo.pfr64.sme = 0;
>>
>> Instead of this, can we do the following :-
>>
>> domain_cpuinfo.pfr64.res1 = 0;
>> This would imply that SME, RNDR_trap, CSV2_frac, NMI, etc are not 
>> supported.
>
> I could but I haven't done it for two reasons:
>   * AFAICT, there are no issue to expose RNDR_trap to the guest. Also 
> not all the bits in the field res1 are defined yet. So effectively, we 
> would be implementing an allowlist like.
>   * In the future, we could split res1 in two. If we are not careful, 
> we would expose the feature again.
I see your point.
>
> So I find this approach rather risky. There is also a more general 
> question on how the features should be handled (see what I wrote after 
> --- and below).
>
>>
>> If later Xen decides to support any of these, then they can be 
>> selectively turned on for a domain in do_sysreg() 
>
> do_sysreg() is just returning the ID registers. This only helps the OS 
> to discover the features at runtime and it is free to ignore them. 
> What matter is the configuration in of the trap registers (such as 
> HCR_EL2).
>
> If a feature is not gated by a trap register, then it could be enabled 
> everywhere. So effectively, the decision will depend on the feature. 
> In the future, we may have to take care of suspend/resume or 
> live-migration between two Xen versions. At that point the feature may 
> need to be per-domain.
>
> > (Similar to SVE).
>
> The main reason SVE is enabled per-domain is because of the large 
> state. But if we have feature that doesn't have an impact on the 
> memory usage, then they could be enabled everywhere.
>
> Anyway, the first decision we need to take is whether we want to 
> change to an allowlist. There are pros and cons with both of them (see 
> what I wrote above). At the moment, I am still leaning towards the 
> existing model which is expose everything by default but hide features 
> when they appear and Xen needs more handling.

This makes sense. The existing model is simple.

Reviewed-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>



From xen-devel-bounces@lists.xenproject.org Thu Aug 15 10:32:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 10:32:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777983.1188051 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seXm7-0006Rh-8F; Thu, 15 Aug 2024 10:32:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777983.1188051; Thu, 15 Aug 2024 10:32:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seXm7-0006Qh-5l; Thu, 15 Aug 2024 10:32:11 +0000
Received: by outflank-mailman (input) for mailman id 777983;
 Thu, 15 Aug 2024 10:32:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/2Vq=PO=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seXm6-0006Qb-2a
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 10:32:10 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9ffea4af-5af1-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 12:32:09 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-52f01b8738dso663775e87.1
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 03:32:09 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a838396d375sm79711666b.221.2024.08.15.03.32.07
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 03:32:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9ffea4af-5af1-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723717928; x=1724322728; 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=EGsjvC942kx9kp0whsx4H5yJiPjZMLgP8DFO/iTkuM8=;
        b=I2mT3fRjTSs0neZdhw7tNKeNh93pq1SvgFkw8sovwxoSCnrDZX94ECNfzNCkSqmZCW
         cbJlK7sSrnpycB0IwaScT2mDVYsu2fd9m4wCQK4RuVczzYn03wZI17iTrHJDvUdK+CI5
         Jt3jBTI6t8tcPVUifTsdrgKdQv5e6AHhbk2d1a2UrCwnY+L2TywIRWhxSs1qqq4Ufrfd
         Rpma2QxUZPnxfzGV3+KBODQuMZOIay7XyaxYoqr4LzBDUPH02qW/buKw6Df54cDGjAJb
         0NFpragoOXAPXwiO4TNluzvfgNJroiWq035bcC1p/tuDjcD5auTDZ/+rUWL0zDU4ioA5
         RRhw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723717928; x=1724322728;
        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=EGsjvC942kx9kp0whsx4H5yJiPjZMLgP8DFO/iTkuM8=;
        b=AuExzfphGInw0wtg9Dk+bATv7M936kARD83NXnADYoFM5ZlzYSjxcE0IBLvzkYDvaB
         ckLA+PRoNAVJECs3gjxMy+RLMTEYJgajDEgw9GSQGlIbigvba0jIxDNZ69TSbNxNpbgK
         TQqYZMZuUD9JnG6WRGqScCpaEHS4iYgxUGRV2EeleDZX38APcfpaL3mdn/0ecXKKdIfu
         0xz/ORrCFA9Vur+y1d1jhuVAcwvYTTLZxkwYU+43ATiV3KlUxfSFiMgdmGYT99WpcTCH
         HF/K5lg/5UjKq1PrKiwkKxhBKD8BhuKptrqj8/m/NlKQqnrWV4IPeXG3gegYDtlu8tGG
         1kGA==
X-Forwarded-Encrypted: i=1; AJvYcCXjliEaIO5ZTYiqHoXOLP0V+PyKlnJo/6naaB401ZWgD4CpiiD1ht1e10nYtC3RLb0hucaMWgmVfCQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxgKcwoQzkvfNBp8YjQ7mK9s/81s1XcybAY3SaPVNm+PHlZsLaB
	qo0+sZCu/scW6VYd0iklT/1tH8KOQAlGXlK0YVKkNX0tNHyLSy38TbQN1ZRMPQ==
X-Google-Smtp-Source: AGHT+IGcJ6jjmA9EOrE5v78bCNWVAZyjyp6gihc/kKxloWVqxwBL2MsnG8bXirYP5g8ULIrsQex2Wg==
X-Received: by 2002:a05:6512:3b2b:b0:52e:99fd:d386 with SMTP id 2adb3069b0e04-532edbbee60mr3601374e87.50.1723717928315;
        Thu, 15 Aug 2024 03:32:08 -0700 (PDT)
Message-ID: <023bb28d-1acd-4988-a8a2-110bcb43da63@suse.com>
Date: Thu, 15 Aug 2024 12:32:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 5/7] xen/riscv: introduce and initialize SBI RFENCE
 extension
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <1a863d06866f86761d23e6da3f4a6ee58c474473.1723214540.git.oleksii.kurochko@gmail.com>
 <77ff59d1-b158-4603-bdbd-67c079ce87c9@suse.com>
 <34cbaff323d9619f8d4cb1d2b8ed12584037ee0d.camel@gmail.com>
 <959f33b6-3649-45b3-8f31-ec494e60fd80@suse.com>
 <f23aadf93c41b6045cfc5879b5b287ada7c9ef7b.camel@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: <f23aadf93c41b6045cfc5879b5b287ada7c9ef7b.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 15.08.2024 12:00, oleksii.kurochko@gmail.com wrote:
> On Wed, 2024-08-14 at 17:53 +0200, Jan Beulich wrote:
>> On 14.08.2024 17:41, oleksii.kurochko@gmail.com wrote:
>>> On Tue, 2024-08-13 at 11:34 +0200, Jan Beulich wrote:
>>>> On 09.08.2024 18:19, Oleksii Kurochko wrote:
>>>>> +static unsigned long sbi_major_version(void)
>>>>> +{
>>>>> +    return (sbi_spec_version >> SBI_SPEC_VERSION_MAJOR_SHIFT)
>>>>> &
>>>>> +        SBI_SPEC_VERSION_MAJOR_MASK;
>>>>> +}
>>>>
>>>> Can you use MASK_EXTR() here, allowing to even drop the separate
>>>> SBI_SPEC_VERSION_MAJOR_SHIFT?
>>> I am not sure that:
>>> (sbi_spec_version >> SBI_SPEC_VERSION_MAJOR_SHIFT) & 
>>> SBI_SPEC_VERSION_MAJOR_MASK == MASK_EXTR(sbi_spec_version,
>>> SBI_SPEC_VERSION_MAJOR_MASK)
>>
>> How come you're not sure? That's precisely what MASK_EXTR() is for.
> As the order matter here. First should be shift then applying
> SBI_SPEC_VERSION_MAJOR_MASK, as SBI_SPEC_VERSION_MAJOR_MASK is defined
> now as 7f. If SBI_SPEC_VERSION_MAJOR_MASK set to 0x7F000000 then it
> will work.

The assumption was of course that you'd adjust SBI_SPEC_VERSION_MAJOR_MASK.
That's the underlying idea after all: When the mask is shifted to its
appropriate position, the shift amount needed can be calculated from it.
Hence the lack of a need for SBI_SPEC_VERSION_MAJOR_SHIFT (and alike).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 10:58:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 10:58:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.777994.1188062 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seYBk-0002oT-AW; Thu, 15 Aug 2024 10:58:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 777994.1188062; Thu, 15 Aug 2024 10:58:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seYBk-0002oM-6e; Thu, 15 Aug 2024 10:58:40 +0000
Received: by outflank-mailman (input) for mailman id 777994;
 Thu, 15 Aug 2024 10:58: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=KwPb=PO=epam.com=prvs=49579c5ae1=sergiy_kibrik@srs-se1.protection.inumbo.net>)
 id 1seYBj-0002oG-9R
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 10:58:39 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 51e057fd-5af5-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 12:58:36 +0200 (CEST)
Received: from pps.filterd (m0174681.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47F7Kfgh000656;
 Thu, 15 Aug 2024 10:58:32 GMT
Received: from as8pr04cu009.outbound.protection.outlook.com
 (mail-westeuropeazlp17011024.outbound.protection.outlook.com [40.93.65.24])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 411d6xrta0-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 15 Aug 2024 10:58:32 +0000 (GMT)
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com (2603:10a6:20b:5c0::11)
 by GVXPR03MB10248.eurprd03.prod.outlook.com (2603:10a6:150:14f::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Thu, 15 Aug
 2024 10:58:29 +0000
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d]) by AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d%4]) with mapi id 15.20.7849.021; Thu, 15 Aug 2024
 10:58:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 51e057fd-5af5-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=WHQ/K8qlIePHYe82M2hs5bqXapyeGBk2j5PDKHrhPhhUmLaiLV6qfHkI2xm6NJ1uJrD1V8CUPUqM2VLUVoOjWj18Tsdah2Ib9MMgGUE/aRwa0C6xdFwByHZKCqFMPkH0hsrjMRmjPeYxzpkeTbp+uhXok6ntQBFp/+dSGhmmT2oMX5XM+jBKHoJyJb+Jb30/pIGD3PBdufUZAEAvJ3SKdE6Qkz8XR1DKXAoIqw6QZ9UfJbASAPvIFNpOQ/uNVidalMixvgg/Avk8qt+oPORNTd3MMkpYqgWvm2j9k53VhivhI92WC7Og/NQq0I0vof9pgD190S+AHyFayNk0Kv29lg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MKxH7aa2GrKVRhD1ZvHaoi4ab6IDzGSaKTdodVbDS6A=;
 b=DDe9njKuzJaN8h3g+O6d6KwqhQmWHtAF2FTQf8qfkE7c2oulgO5Bzgk0jDbmRTpyUNNM0lWKQMVmQYzOdMJp1PN4feL0Rg9m+VRu6t+0GZsz8hE9m8bCY0rG7k+5mDOmEgSlfKTQUdFQXCnRSdQRP+PyRj/pFrYNr0zICUEigVOAwUfxVseseCKSxKp1L4rb9BrxEFORe3Amu1J3ItKhyvbrO2T6RSZS7FJFzuDHkaO971lb6s3kqGUfwEi7NuHRjW0Ka3BNkkYXnFc70fYMJABNMX3f6Py9jnnEtPLZ4AG3WfZQNBLa6Umwi3Om5RDoFlgy9+o7Ns0tuhdHPivShQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MKxH7aa2GrKVRhD1ZvHaoi4ab6IDzGSaKTdodVbDS6A=;
 b=I3s9V3aQXUynajj8k/SK7xNe503lhwCksusd7gHsGCCJM+TS8FHF8Qn7+REWFfC3ObhZSwpe2uPlQMz1AnlfxIKK91btxbUfQLyZKTCSd3yYVfLMB/p6mMhFsr9gmT8ep6Ka0cQe1LDkMMcDloDFX2VWZBNh0M4SVjguSKQclbJt+YIf85PdSGjS/TrCNq5HXqZ8A2n2Ram8vIdWcx+H/xGbame38zjHvmIFX1T0rm3raCItt1gMJzn6W8HxHtCwxH+G/QwmqqxkEDtmsvrinIk7cYL/WjONVf7YuavxFojunZOXcIPV39VmvHD3QmtnR5Hm52TxDCMwkyScESs7vw==
Message-ID: <f7d80727-93f8-44d9-ba5b-8c5d6b63351e@epam.com>
Date: Thu, 15 Aug 2024 13:58:27 +0300
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v1 1/2] x86/intel: optional build of intel.c
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
        =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        xen-devel@lists.xenproject.org
References: <cover.1723196909.git.Sergiy_Kibrik@epam.com>
 <25e80b9271607da56abf9d4193e4d91b3d00bd9c.1723196909.git.Sergiy_Kibrik@epam.com>
 <7d390391-4ae2-442e-90a3-d8d242d7ae6f@suse.com>
Content-Language: en-US
From: Sergiy Kibrik <sergiy_kibrik@epam.com>
In-Reply-To: <7d390391-4ae2-442e-90a3-d8d242d7ae6f@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: WA2P291CA0031.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d0:1f::12) To AS8PR03MB9192.eurprd03.prod.outlook.com
 (2603:10a6:20b:5c0::11)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9192:EE_|GVXPR03MB10248:EE_
X-MS-Office365-Filtering-Correlation-Id: 423aae7d-20d2-4f9b-e34c-08dcbd1931cb
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?RHphOHIwWkg5MmFMYTdPeHhNcFJwUFk2ajNnWjltUWVsQVhNb29lTTV6amgr?=
 =?utf-8?B?T1BYUXZNWHgrL0lMT2ZLWlF3NlNDTHlPTWFFOUFzd1VsVTIxYTY1Y2FXV1V6?=
 =?utf-8?B?am85THlJdW85dm1NWit0cjZnUnM3WWlIQXRLNkVLa04vbmMzYXFIaXRGemNV?=
 =?utf-8?B?RVZSWlBIUzlaYVlPNmdEMlB0WVIrSXcwL1FtU0FycW1zcW5CREJRdGkyS1Na?=
 =?utf-8?B?ZVdiVUJSSVZxcTNGT0RHUUdlZmw5Ums4dHMrcXJIUkVSUjBiTXkrdnZrL3VF?=
 =?utf-8?B?Z1Ywd0FoUEF5YzllNlpVZzF4d28xYnFKVXR5Yyt6c2s5akRobTF2U2IwbHNH?=
 =?utf-8?B?Y1N6THdpTlN5YUhwenJSMGhiNlNjZW1JUmdaVGpKRThuejRnOVhCcFFzM0tu?=
 =?utf-8?B?cFVlZ2tHY25MdDk1QjNJbGh4bGdPS2dDNStwdnpEcHkyQ3VmZ2JjVWh1d0N6?=
 =?utf-8?B?Ni8wblFaSFhScGZBbXhwR0VsSDgxT0xONkxVVEFuZFl1NENOT3ozL1JDak0w?=
 =?utf-8?B?R0xuRGF1ZkYzbHI0MDE5clhyTjJSYkRabDJlYUNyb1RranV6elFwdUNmcEYx?=
 =?utf-8?B?MlE0TXB6MWw5T2NwMTNjSVZIOThtTWtVWlI1bTNwVDNZQm9ZNDAyczE4cVky?=
 =?utf-8?B?c3ZzUXovclMyT3V4OUpnYURpYjF1d0kreEx3b3MwS3V2MDBWalpzVWR0b2s0?=
 =?utf-8?B?TWY5aVFEWVdqS3hkNmNBZFZnWHhhOUZSTnZhbmxNNVM5c0YxWEwzaU9JMW1J?=
 =?utf-8?B?d3JFTTA1RmlVVlFNSldiMGU5ZjZVWUhwV2hYYXpYanlNeUFOWWFmVjdZNkFq?=
 =?utf-8?B?dkkvWmV5d1k1aFdSbkJDLzZJRnVsZzNBU1hQQlh1NU5rWW0zVWRwM0ZkSzJY?=
 =?utf-8?B?bzhFUjU5cTBMUU5Md2F6MjRsRm1RWWlrUjdCVUJtMytZVTlNMHVha2Y4Mlkw?=
 =?utf-8?B?UHFaZU5xVXJqbzdmc2U1bnlOU1NRR1FtdVZCbU8rY29nc0tNQ0lSSWVObGQ5?=
 =?utf-8?B?b2VSL3hKRDJqNlR2QWY2MmplbUtaaHhaczdVSW5FMGRDN1lsQSt3L1Rsd0No?=
 =?utf-8?B?TUE2NG4yUUJyek1BMnpsNkpPVG1lR3dIaGFlN2o3eGNxM2dKSkJOQXBqMHQz?=
 =?utf-8?B?LzE0Y0QrVjkwQkppazlKU3BhWWZWaXVDQlN1clo5SzRXR1F6VXVGa1VvKzg3?=
 =?utf-8?B?Y1V6ODhGUmFxM1lFTTU4RExCYUZVZDlBaGQ0UkU2aFRtNTJFUXQrRWxkTm9w?=
 =?utf-8?B?TFR4UHNMMFkwa1V2aWg0dDYvMG5wTlA0bDJTaGxIRUkvMnlHdDcxNVFmMHc4?=
 =?utf-8?B?eTd0cW1VR1ArLyt5U05rWFg5akRZdFQ5MEJKM2hpSGNIcFRML04yWkpZd0pC?=
 =?utf-8?B?QzN4LzRQZ0FVZkhkWDN4cWY3cXY4OVAxR0ZEOTZhRXQya2M5NDFKTzFsT1Zm?=
 =?utf-8?B?MzMvMmJHK1orYmljWFJYdGtFNFR5MmdtUFoxUGxuUHRnRmJzNDAzTS8ySEdI?=
 =?utf-8?B?WmVEZXZ4Qm96MEViLzlHZ3JIZE9MZThjczV5ejM1YXlKU3J1c3dSQUIwSHRC?=
 =?utf-8?B?cmMwL0ZMdUY1Q0luUzJOQ21ac0kra2tFZE5EcjBWdHNtcEdCY25Na3kvU3Bj?=
 =?utf-8?B?c0lNSmMzL2NzRWQvUHhzWVFwT1ZycHE4NGIyL2Y3N0NoSmRKTkxsUjQyV0th?=
 =?utf-8?B?QStibUlVWU5BRnd5K2t4OUNaWVRBWGZLRlhqTG5uOHpBa1VQUDVrd2ZsNmY3?=
 =?utf-8?B?RytoM1NFK1k1SDBYMExPamVtNW5ubkFQcGhXVEM5dzZZOVROWUxpR1N5WW82?=
 =?utf-8?B?RTdYUUd0aUxEWC9tK2k4UT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9192.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cyswNE9TWEkxS3AzMm1QSlJHcnJ5TmdsYzBWbDBLeVZPQ21MVUdkK2RuRzhB?=
 =?utf-8?B?cUJ5S1lWbzdiQXlEbTQ4a3c5T0h6SUYwVFp2Ky8vU2VuM3puTjJrR0ZIRmFk?=
 =?utf-8?B?bmJTSlQ3VmhSWDRJdVlMWGtJczdObmJyZWZDUGxTeWhCSncydEZEajFOb2E5?=
 =?utf-8?B?QTRRRmQrbC8vbWwxV0dqbFE2QkxscEtqNzZ1ay9qSkxGcXhUcXdsbEtsOXgy?=
 =?utf-8?B?MEVyTW8rU3B0b1ZwdVpkQ2k0cnVHa3ByUVVGcExlVkFOUWZJRFh2cjdvaVpa?=
 =?utf-8?B?YjVQVWN0WFlpSmxYb3JoQzU1bE1xVzh4aTNBV01sNWJpTWd6NnIzWk1qNzlz?=
 =?utf-8?B?WXo5ckRhdWRiNzUrand0M2VxeUZnSm44ZDZtNC9LUUVuVHk0d3hBd1dYbFlp?=
 =?utf-8?B?NTR5b1JIcEVzbTJWMmJ5NlNNKzFseW1USFlNczNHVVFEVUZQa1JjbzJscGgy?=
 =?utf-8?B?RGI4aXlyYzVNbStzU3VleHZWSmpzN3BROU1VdmppMFFyMTZ0Mjg4K3lEajVV?=
 =?utf-8?B?ZXBwNmlyT0tmaXJEdldEalpZbzRsRlhOWnVUcTdnZy9VS25aK2F2VEdkUFV0?=
 =?utf-8?B?YVpIVlpHNXQyS0w2dU43dFBsNS8yYmlWcUFZcTJZM005VmxGQWhNQlZpZjVr?=
 =?utf-8?B?MjVhb3d5WjU1YnE3cDB2Qit3Zmt5S3hXMFlGQUdtZldvTjNyVE9lekZ5K0RF?=
 =?utf-8?B?b1I5VDFXazRDaHFGSnRSQ3dMVXd2cFNkeXZCM3JqVTV3aDEydkpldXJBU212?=
 =?utf-8?B?K1ptMFBxQkYxenJXTGxGeGNZTGVLV1FNRi9JRDJzSTFhUkw2YWxva00xYzAw?=
 =?utf-8?B?QWx6dlJ0TjdvdFAvYWZFUTE2WHVIa2tnbzdkZDdidjE1NFVaRDM4MDM4ems3?=
 =?utf-8?B?RTd5OVk0Rm5ub3htSkdLWm1XOW5Vb1AwNWlKZ0xLSmVoLzliZ3pOd0ptVXhE?=
 =?utf-8?B?SG5IWVJ2QW1rdHRONmdxN24wY2dFTStBdlNSTHJuVkh4a0Q1eDRIRnJ5NUk2?=
 =?utf-8?B?V3V3SGxaczVITEk3Q2Y1K2o4QlcvTkJxY08wV3hFR1ZCcFhyTUN5Vlpxdm83?=
 =?utf-8?B?ZC9BVFdBdG1pZ2gyVXI5YVZsS01tSkcvaEd3L3J1MVA4MVhlUHZmTW8waG51?=
 =?utf-8?B?elpBbVgzZGlUVkdLT1RweCtyYU92Ukg5dngwN3Zqb2Z5U0drejRSdHBsRWFL?=
 =?utf-8?B?amVWQmRFSllsMUlpdkFNWVhlUmJDTElyMUZWZmxkWUx6OXQ1NDdOV0QwYWtE?=
 =?utf-8?B?Sk5hdlZRODBjakp2cUF1b3Q5K2ZEUWJPWkZ5aEthempwbnlZZEdQTG4rNC8x?=
 =?utf-8?B?bXZlVkR5Y3R6Q0d5SG9nNTRRYmVLMHl4WDhkS0JWNzgxdkJIZHNWQklIbVY3?=
 =?utf-8?B?aFNiQmI2cEJPTUY3MWE3ajJKNTlSVU9BS2VwOXo0L21seWdycnhjTVVPZ1Jw?=
 =?utf-8?B?Y2E0d1oxZjFvQUJZc0lLOHIxVnljZWJzODhLRUMxOEJpQXFiNk5nMURBMzBB?=
 =?utf-8?B?WHlBM3NwdWNncDN5VkxtWjRNMzQ4M1QxMG9LeU9NazYvTHJFeDFWcnlJVDhl?=
 =?utf-8?B?ZTNNUGl4MGJwMUp6RkthOURsVHowUDFDLzd4RHhKMkJxbWJodzdLcHBqQzQ2?=
 =?utf-8?B?ZlhPSEJyTzJjZXVvdEhILzRRT1RxK1NHNnZ6bjB3dXRYbHp5bXZFTmluK2Jm?=
 =?utf-8?B?US93bHZqOWovMWRlZTN4NjhsNDVZNTdxM3owTHJIaGNrUFdDdTVKVXpuWkdt?=
 =?utf-8?B?NGUvR2ZhdGNlRFgrNE5PWGZLREc4Q2NoWjJlaVFZbGJIYmIveWMxM3NybkYx?=
 =?utf-8?B?VlRlZmdYMlIyUkQxMG5FQUZ6bFlBVWhKZWhFTVVUMDg2eVR1TXBJMzMxZ3VK?=
 =?utf-8?B?MGg4ZEdzWGEvbGFoUWZpbnRwQlF0Vml0RUhZNmdtYmxyblpJVFY4enhWZGlO?=
 =?utf-8?B?RnFNbXE2ZVFpSTBJOWFRK1dEVjArL3E1cTZmdy9WaER2cXU5aW1hNnVtQ21Y?=
 =?utf-8?B?d0k4NmJTWDBmNEFpNzBreTdhZm1lKzhFbUF6Q296bm5oa2R0cGRrOU5NeVY1?=
 =?utf-8?B?Y29FUW9WZ2lBdlkvckZhM0pGMmlxcEl5ZFM0c0I4U25SaUN4SmdkK3ZDejVi?=
 =?utf-8?B?YlVYc3l5bzJlN045d3J3bVhkQTd4NnBsT3ZKWHgyUERibnRhaVdmSzdJQjIx?=
 =?utf-8?B?V1E9PQ==?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 423aae7d-20d2-4f9b-e34c-08dcbd1931cb
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9192.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2024 10:58:28.8489
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: g9Q9XXn2yNr6QLkJFDqfFveX+FhQVu1jScaJidnpI4cTef4SmaoFLrVWWzVJyJTcmdlCpuxmmjybBwFADVsAmw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR03MB10248
X-Proofpoint-GUID: 9wRPWBnnSx2vtveBxpnZkK4PaXBOkaqZ
X-Proofpoint-ORIG-GUID: 9wRPWBnnSx2vtveBxpnZkK4PaXBOkaqZ
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16
 definitions=2024-08-15_03,2024-08-13_02,2024-05-17_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0
 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 spamscore=0
 clxscore=1015 phishscore=0 adultscore=0 priorityscore=1501 mlxscore=0
 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.19.0-2407110000 definitions=main-2408150079

13.08.24 10:40, Jan Beulich:
> I'm okay-ish with the simple stubbing out for update_mcu_opt_ctrl(), but
> set_in_mcu_opt_ctrl() imo requires more work. The call sites in spec_ctrl.c
> shouldn't give the wrong impression of having some effect. Imo in
> init_speculation_mitigations() an #endif wants to move down, while all of
> gds_calculations() wants to be compiled out. And that likely extends to
> further Intel-only functions there (with an early bail-out keyed to
> boot_cpu_data.x86_vendor != X86_VENDOR_INTEL). Which overall likely means
> there wants to be another separate patch dealing with that. (And then
> maybe a counterpart one for AMD.)

Thanks for a suggestion, indeed there are many routines there that can 
be put under CONFIG_{AMD,INTEL}.

   -Sergiy


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 11:02:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 11:02:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778001.1188076 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seYF8-0004LP-PT; Thu, 15 Aug 2024 11:02:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778001.1188076; Thu, 15 Aug 2024 11:02:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seYF8-0004LI-L6; Thu, 15 Aug 2024 11:02:10 +0000
Received: by outflank-mailman (input) for mailman id 778001;
 Thu, 15 Aug 2024 11:02:09 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seYF7-0004L8-2N; Thu, 15 Aug 2024 11:02:09 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seYF6-0001U6-WD; Thu, 15 Aug 2024 11:02:09 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seYF6-00058N-Fs; Thu, 15 Aug 2024 11:02:08 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1seYF6-0003Zb-FK; Thu, 15 Aug 2024 11:02:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=l3JIY+IZaCY8DXAaIvGbTvpPX6augRXVWNzpgNKcJas=; b=7CAlQhmv0nM6W4roo6yCFdbW6U
	dO/5up/V007JOlOzU3HlBh8jONpj0ZLFYF8F4mfyeseLBmJ31eM/qxpmktG3kK7DTVKQmO5rfdb1S
	npD0FCISauTtRFF5gL9nLaQ+qfaet1xBvFRpKTK7XhTYrfFw/ARK/eh+AzFpUrIxppX4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187244-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.18-testing test] 187244: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.18-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=bd51e573a730efc569646379cd59ccba967cde97
X-Osstest-Versions-That:
    xen=c70619e2b758f2c9c2c7a8683ab7897d01461cd0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 15 Aug 2024 11:02:08 +0000

flight 187244 xen-4.18-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187244/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187230
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187230
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187230
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187230
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187230
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187230
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  bd51e573a730efc569646379cd59ccba967cde97
baseline version:
 xen                  c70619e2b758f2c9c2c7a8683ab7897d01461cd0

Last test of basis   187230  2024-08-13 15:07:06 Z    1 days
Testing same since   187244  2024-08-14 14:06:46 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jan Beulich <jbeulich@suse.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   c70619e2b7..bd51e573a7  bd51e573a730efc569646379cd59ccba967cde97 -> stable-4.18


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 11:21:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 11:21:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778012.1188086 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seYXb-00089w-6e; Thu, 15 Aug 2024 11:21:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778012.1188086; Thu, 15 Aug 2024 11:21:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seYXb-00089p-3d; Thu, 15 Aug 2024 11:21:15 +0000
Received: by outflank-mailman (input) for mailman id 778012;
 Thu, 15 Aug 2024 11:21:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=qQtD=PO=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1seYXZ-00089j-37
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 11:21:13 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7a03bb8e-5af8-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 13:21:11 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-52f01613acbso2213462e87.1
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 04:21:11 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5330d3b97c2sm171710e87.117.2024.08.15.04.21.09
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 15 Aug 2024 04:21:10 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7a03bb8e-5af8-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723720871; x=1724325671; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=j3uagsZLL9tvmC9Eh57RDKrml1Wp1q97m4stz+UKhis=;
        b=JrmOl9i2U/XokA5SUkWFY+089v9KSUHi+9kSjtQNkllMNm4ttp4W503Af5dlLKp7RE
         kuxoIxpJJsr5NHpDLgw1dfSNmzMMuV0UKNSZY3p5ufCnXpnHb6cYNExsXu2F1R5yEPXx
         fxprk3l+R80d47BZmlxb5OXSc86/9/aSb+lOboZV/eHAdC/Ob0j1DCGm5ejlAt30BLJK
         00RnXPtCvYDtVIvH2R8pKWZ3wzq3++F9T70N3DZ+T9Vad/9zs/+b1e9FyjONkvAYCZHB
         ustJzhAV/RHNRS56bL8W0kg5PtzNx61DQiJ0rVGdawDMTEXxNurwPsDit2BtqFbHugaf
         Rayg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723720871; x=1724325671;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=j3uagsZLL9tvmC9Eh57RDKrml1Wp1q97m4stz+UKhis=;
        b=RjglI5Kb/UcQ9LqxkEORGHCqRTBWFZNcUXNNejvMX/+Lxwjd1mTNdc2tl6aPalzKfu
         Lmg03PlX08HBi0JIfUOpsb9EP0uiQoFAmcYQaiBXf0WiKpEVbCw+3JEKQZ2BS4PEuapl
         UcMuKcG5tZLxWNqNheNH8mUemX6Ce2GtNX2o1tK1tKoPd/IXdMe0FwcGTXT1m+JHKQOp
         f26Fqf7NCPWDULtIYJx22stJ16ZD6KfSpOjEeoHljn21oUwBUUIak2B1vi5fM5UBrMpp
         hr6a6dDfaL2eG1OBTsbQtQbjCn0cD/phUq1QLkVxr8whcCS+3Ypp/ffwA63Oo0DMR9Xj
         Q6vg==
X-Forwarded-Encrypted: i=1; AJvYcCUl5J3Zp9uXmrG++hJL4nvMS0F0XlvTaJiQK4y8AfL76AgaIEg3+ySnObXKAE9PhnBcZaY3/OfxUniaHW8dRqPFTaRl4aXfprk+Du7XiL4=
X-Gm-Message-State: AOJu0Yy6KgoJMKl3D2R3qA0MU9OKwH0Qxup/OyeiKS7b4UUoHI8qLg0B
	ho42GNRbCQXuP8zFJlJKG7ZIFly9nRGULA5AhpyHNjnwSZkwXejd
X-Google-Smtp-Source: AGHT+IG2N6JQbyC7QdSRAaK/f6XNRX4CcwORpC/t7qt1W20hEyMIgGnQKqCb8boLWpvz/RmDmCQIvw==
X-Received: by 2002:a05:6512:3056:b0:52f:260:c459 with SMTP id 2adb3069b0e04-533080910c3mr656347e87.22.1723720870574;
        Thu, 15 Aug 2024 04:21:10 -0700 (PDT)
Message-ID: <be47249638cbae5e057279acd9a3464c218fbac8.camel@gmail.com>
Subject: Re: [PATCH v4 6/7] xen/riscv: page table handling
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Thu, 15 Aug 2024 13:21:09 +0200
In-Reply-To: <d41f3027-14c8-4716-9444-d8bc109bb2b7@suse.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
	 <8362795280a48702bef6f01d41d148edcf299935.1723214540.git.oleksii.kurochko@gmail.com>
	 <85a4e760-07af-42bd-ac27-12a4fa5172cc@suse.com>
	 <1e83981cff0b6c47aa941e7ffee0ce658aefef22.camel@gmail.com>
	 <d41f3027-14c8-4716-9444-d8bc109bb2b7@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Thu, 2024-08-15 at 10:09 +0200, Jan Beulich wrote:
> On 14.08.2024 18:50, oleksii.kurochko@gmail.com=C2=A0wrote:
> > On Tue, 2024-08-13 at 12:31 +0200, Jan Beulich wrote:
> > > On 09.08.2024 18:19, Oleksii Kurochko wrote:
> > > > Introduce internal macros starting with PTE_* for convenience.
> > > > These macros closely resemble PTE bits, with the exception of
> > > > PTE_BLOCK, which indicates that a page larger than 4KB is
> > > > needed.
> > >=20
> > > I did comment on this too, iirc: Is there going to be any case
> > > where
> > > large pages are going to be "needed", i.e. not just preferred? If
> > > not,
> > > giving the caller control over things the other way around
> > > (requesting
> > > 4k mappings are needed, as we have it in x86) may be preferable.
> > Yes, you did the comment but I thought that it will be enough to
> > mention that shattering isn't supported now and=C2=A0 also since
> > pt_update_entry()is used to unmap as well, there could be a need to
> > unmap e.g. 4K page from 2M block mapping what will a little bit
> > harder
> > then just having 4k by default.
>=20
> Shattering isn't supported now, but that's going to change at some
> point,
> I suppose. Where possible the long-term behavior wants taking into
> account
> right away, to avoid having to e.g. touch all callers again later on.
Arm still leaves without shattering support for Xen pages:
https://gitlab.com/xen-project/xen/-/blob/staging/xen/arch/arm/mmu/pt.c?ref=
_type=3Dheads#L454

So it can be pretty long-term behaviour.

>=20
> > > Hmm, but then ...
> > >=20
> > > > RISC-V detects superpages using `pte.x` and `pte.r`, as there
> > > > is no specific bit in the PTE for this purpose. From the RISC-V
> > > > spec:
> > > > ```
> > > > =C2=A0 ...
> > > > =C2=A0 4. Otherwise, the PTE is valid. If pte.r =3D 1 or pte.x =3D =
1, go
> > > > to
> > > > step 5.
> > > > =C2=A0=C2=A0=C2=A0=C2=A0 Otherwise, this PTE is a pointer to the ne=
xt level of the
> > > > page
> > > > table.
> > > > =C2=A0=C2=A0=C2=A0=C2=A0 ... .
> > > > =C2=A0 5. A leaf PTE has been found.
> > > > =C2=A0=C2=A0=C2=A0=C2=A0 ...
> > > > =C2=A0 ...
> > > > ```
> > > >=20
> > > > The code doesn=E2=80=99t support super page shattering so 4KB pages=
 are
> > > > used as
> > > > default.
> > >=20
> > > ... you have this. Yet still callers expecting re-mapping in the
> > > (large)
> > > range they map can request small-page mappings right away.
> > I am not sure that I fully understand what do you mean by "expcting
> > re-
> > mapping".
>=20
> Right now you have callers pass PTE_BLOCK when they know that no
> small
> page re-mappings are going to occur for an area. What I'm suggesting
> is
> that you invert this logic: Have callers pass PTE_SMALL when there is
> a possibility that re-mapping requests may be issued later. Then,
> later, by simply grep-ing for PTE_SMALL you'll be able to easily find
> all candidates that possibly can be relaxed when super-page
> shattering
> starts being supported. That's going to be easier than finding all
> instances where PTE_BLOCK is _not_used.
So if I understand correctly. Actually nothing will change in algorithm
of pt_update() and only PTE_SMALL should be introduced instead of
PTE_BLOCK. And if I will know that something will be better to map as
PTE_SMALL to not face shattering in case of unmap (for example) I just
can map this memory as PTE_SMALL and that is it?

> > > > --- /dev/null
> > > > +++ b/xen/arch/riscv/pt.c
> > > > @@ -0,0 +1,408 @@
> > > > +#include <xen/bug.h>
> > > > +#include <xen/domain_page.h>
> > > > +#include <xen/errno.h>
> > > > +#include <xen/mm.h>
> > > > +#include <xen/mm-frame.h>
> > > > +#include <xen/pmap.h>
> > > > +#include <xen/spinlock.h>
> > > > +
> > > > +#include <asm/flushtlb.h>
> > > > +#include <asm/page.h>
> > > > +
> > > > +static inline const mfn_t get_root_page(void)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 unsigned long root_maddr =3D
> > >=20
> > > maddr_t or paddr_t?
> > >=20
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (csr_read(CSR_SATP) & S=
ATP_PPN_MASK) << PAGE_SHIFT;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 return maddr_to_mfn(root_maddr);
> > > > +}
> > > > +
> > > > +/*
> > > > + * Sanity check of the entry
> > > > + * mfn is not valid and we are not populating page table. This
> > > > means
> > >=20
> > > How does this fit with ...
> > >=20
> > > > + * we either modify entry or remove an entry.
> > > > + */
> > > > +static bool pt_check_entry(pte_t entry, mfn_t mfn, unsigned
> > > > int
> > > > flags)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 /* Sanity check when modifying an entry. */
> > > > +=C2=A0=C2=A0=C2=A0 if ( (flags & PTE_VALID) && mfn_eq(mfn, INVALID=
_MFN) )
> > >=20
> > > ... the MFN check here?
> > The comment is incorrect and should be corrected:
> > " if mfn is valid or ... "
> >=20
> > > =C2=A0And why is (valid,INVALID_MFN) an indication
> > > of a modification? But then ...
> > the explanation is in the comment to pt_update():
> > =C2=A0=C2=A0 /*
> > =C2=A0=C2=A0=C2=A0 * If `mfn` equals `INVALID_MFN`, it indicates that t=
he
> > following page
> > =C2=A0=C2=A0 table
> > =C2=A0=C2=A0=C2=A0 * update operation might be related to either popula=
ting the
> > table,
> > =C2=A0=C2=A0=C2=A0 * destroying a mapping, or modifying an existing map=
ping.
> > =C2=A0=C2=A0=C2=A0 */
> > =C2=A0=C2=A0 static int pt_update(unsigned long virt,
>=20
> And how do readers know that comments in pt_update() are crucial for
> understanding what pt_check_entry() does? You certainly don't need to
> have the same comment in two places, but you at least want to refer
> to a relevant comment when that lives elsewhere.
Sure, I will update the comment in pt_check_entry() properly if this
function still makes any sense.

>=20
> > > > +static int pt_update(unsigned long virt,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mfn_t mfn,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long nr_mfn=
s,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned int flags)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 int rc =3D 0;
> > > > +=C2=A0=C2=A0=C2=A0 unsigned long vfn =3D virt >> PAGE_SHIFT;
> > > > +=C2=A0=C2=A0=C2=A0 unsigned long left =3D nr_mfns;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 const mfn_t root =3D get_root_page();
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 /*
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * It is bad idea to have mapping both wri=
teable and
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * executable.
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * When modifying/creating mapping (i.e PT=
E_VALID is set),
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * prevent any update if this happen.
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > > > +=C2=A0=C2=A0=C2=A0 if ( (flags & PTE_VALID) && PTE_W_MASK(flags) &=
&
> > > > PTE_X_MASK(flags) )
> > > > +=C2=A0=C2=A0=C2=A0 {
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printk("Mappings should=
 not be both Writeable and
> > > > Executable.\n");
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EINVAL;
> > > > +=C2=A0=C2=A0=C2=A0 }
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 if ( !IS_ALIGNED(virt, PAGE_SIZE) )
> > > > +=C2=A0=C2=A0=C2=A0 {
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printk("The virtual add=
ress is not aligned to the
> > > > page-
> > > > size.\n");
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return -EINVAL;
> > > > +=C2=A0=C2=A0=C2=A0 }
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 spin_lock(&xen_pt_lock);
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 while ( left )
> > > > +=C2=A0=C2=A0=C2=A0 {
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned int order, lev=
el;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 level =3D pt_mapping_le=
vel(vfn, mfn, left, flags);
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 order =3D XEN_PT_LEVEL_=
ORDER(level);
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ASSERT(left >=3D BIT(or=
der, UL));
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rc =3D pt_update_entry(=
root, vfn << PAGE_SHIFT, mfn,
> > > > level,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 flags=
);
> > >=20
> > > Indentation.
> > >=20
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( rc )
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 break;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 vfn +=3D 1U << order;
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( !mfn_eq(mfn, INVAL=
ID_MFN) )
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 mfn =3D mfn_add(mfn, 1U << order);
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 left -=3D (1U << order)=
;
> > >=20
> > > To be on thje safe side, 1UL everywhere?
> > >=20
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( rc )
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 break;
> > >=20
> > > There was such a check already a few lines up from here.
> > >=20
> > > > +=C2=A0=C2=A0=C2=A0 }
> > > > +
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 /* ensure that PTEs are all updated before flus=
hing */
> > >=20
> > > Again: No double blank lines please.
> > >=20
> > > > +=C2=A0=C2=A0=C2=A0 RISCV_FENCE(rw, rw);
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 /*
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * always flush TLB at the end of the func=
tion as non-
> > > > present
> > > > entries
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * can be put in the TLB
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > > > +=C2=A0=C2=A0=C2=A0 flush_tlb_range_va(virt, PAGE_SIZE * nr_mfns);
> > >=20
> > > Coming back to "negative" TLB entries: Assuming RISC-V, just like
> > > other
> > > architectures, also permits intermediate page table entries to be
> > > cached,
> > > the affected VA range may be much larger than the original
> > > request,
> > > if
> > > intermediate page tables needed creating.
> > It could be an issue. Could we some how=C2=A0 to calculate the proper
> > range
> > or the only option we have is to flush all.
>=20
> Right - either you maintain state to know the biggest possible range
> that can be affected, or you flush all when a new intermediate page
> table needed inserting.
I think that the second one option will be easier to implement in the
current implementation. It is not issue for now as fixmap, fdt and xen
are in the same slot so no new intermediate page tables are needed.

>=20
> > > > +=C2=A0=C2=A0=C2=A0 spin_unlock(&xen_pt_lock);
> > >=20
> > > Does this really need to come after fence and flush?
> > I think yes, as page table should be updated only by 1 CPU at the
> > same
> > time. And before give ability to other CPU to update page table we
> > have
> > to finish a work on current CPU.
>=20
> Can you then explain to me, perhaps by way of an example, what will
> go
> wrong if the unlock is ahead of the flush? (I'm less certain about
> the
> fence, and that's also less expensive.)
pt_update() will be called for interleaved region, for example, by
different CPUs:

                     pt_update():
CPU1:                                    CPU2:
 ...                                spin_lock(&xen_pt_lock);
RISCV_FENCE(rw, rw);                 ....

/* After this function will be
   executed the following thing
   can happen ------------------>  start to update page table
*/                                 entries which was partially     =20
spin_unlock(&xen_pt_lock);         created during CPU1 but CPU2      =20
....                               doesn't know about them yet       =20
....                               because flush_tlb() ( sfence.vma )=20
....                               wasn't done     =C2=A0
....                                                                 =20
flush_tlb_range_va();

And it can be an issue if I understand correctly.
>=20
> > > > +int map_pages_to_xen(unsigned long virt,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mfn_t mfn,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long nr_mfn=
s,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned int flags)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 /*
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * Ensure that we have a valid MFN before =
proceeding.
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 *
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * If the MFN is invalid, pt_update() migh=
t misinterpret
> > > > the
> > > > operation,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * treating it as either a population, a m=
apping
> > > > destruction,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * or a mapping modification.
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > > > +=C2=A0=C2=A0=C2=A0 ASSERT(!mfn_eq(mfn, INVALID_MFN));
> > >=20
> > > But flags with PTE_VALID not set are fine to come into here?
> > It is fine for pt_update() but I don't know if it is fine for
> > map_pages_to_xen(). I see that other architectures don't check
> > that.
>=20
> That's not my point here. It's rather along the lines of an earlier
> that I gave here: Since pte_update() is a pretty generic function,
> will
> flags not having PTE_VALID set perhaps result in pte_update() doing
> something that's not what the caller might expect?
I think that everything will be okay, if PTE_VALID is set then it means
that pt_update() should update ( modify/remove/insert ) page table
entry and all the cases which isn't expected by the logic should be
covered by pt_check_entry().

and the case if when page table couldn't be mapped:
```
           rc =3D pt_next_level(alloc_only, &table, offsets[level]);
           if ( rc =3D=3D XEN_TABLE_MAP_FAILED )
           {
               rc =3D 0;
  =20
               /*
                * We are here because pt_next_level has failed to map
                * the intermediate page table (e.g the table does not
   exist
                * and the pt is read-only). It is a valid case when
                * removing a mapping as it may not exist in the page
   table.
                * In this case, just ignore it.
                */
               if ( flags & PTE_VALID )
               {
                   printk("%s: Unable to map level %u\n", __func__,
   level);
                   rc =3D -ENOENT;
               }
```
>=20
> And yes, there's a special case of map_pages_to_xen() being called
> with
> _PAGE_NONE (if an arch defines such). That special case plays into
> here:
> If an arch doesn't define it, unmap requests ought to exclusively
> come
> through destroy_xen_mappings().
I thought that it should always done through destroy_xen_mappings().

Arm doesn't introduce _PAGE_NONE and pt_update() is based on Arm's
version of xen_pt_update() so this special case should be covered
properly.

And it seems to me (if I am not confusing something ) that if it is
necessary to unmap pages mapped by map_pages_to_xen() they are using
destroy_xen_mappings() which is defined using xen_pt_update():
   int modify_xen_mappings(unsigned long s, unsigned long e, unsigned
   int nf)
   {
       ASSERT(IS_ALIGNED(s, PAGE_SIZE));
       ASSERT(IS_ALIGNED(e, PAGE_SIZE));
       ASSERT(s <=3D e);
       return xen_pt_update(s, INVALID_MFN, (e - s) >> PAGE_SHIFT, nf);
   }

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 12:16:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 12:16:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778039.1188096 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seZOy-0000La-Ev; Thu, 15 Aug 2024 12:16:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778039.1188096; Thu, 15 Aug 2024 12:16:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seZOy-0000LT-CD; Thu, 15 Aug 2024 12:16:24 +0000
Received: by outflank-mailman (input) for mailman id 778039;
 Thu, 15 Aug 2024 12:16:23 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/2Vq=PO=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seZOx-0000LN-1E
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 12:16:23 +0000
Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com
 [2a00:1450:4864:20::235])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2e3a8b3e-5b00-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 14:16:20 +0200 (CEST)
Received: by mail-lj1-x235.google.com with SMTP id
 38308e7fff4ca-2f3b8eb3df5so5874591fa.1
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 05:16:20 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bebbe7f92dsm813454a12.60.2024.08.15.05.16.18
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 05:16:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2e3a8b3e-5b00-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723724180; x=1724328980; 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=GsR8ZL78tB2dFaI1XI1FBjlIiJxvI9ZB1N762qE70eo=;
        b=GjAUIXSbVMa07QiMcj7WdDsysuMV1LFjIwFkQpVpHCpQNIWEdGBdaFJG7AvApTB0aT
         hQXUmxpoDybUog4bMazB8UKl9YPOhm/9Kt5K0Q7Ng9nhfE47rEf7Er50gF4uKB3u4GN0
         97h43QPtfiLFTFuIWlHEk1jyicEjK2mpsjEBj5LO/rQHDLjvMuWH2/oqpAuACENT9MZ3
         vY/i8rNVaYfepoONtVIzdH0JE8YGTh0agEYDwGlxgR9VVkyV95mphTjDNoFzJNlM7ic7
         wwH5RbxW5fFXO8zpAJNJaVHRSd/klFyj84X0fzWcSyxiTNUfpSHYkPYThoYLGaujYUKS
         auMg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723724180; x=1724328980;
        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=GsR8ZL78tB2dFaI1XI1FBjlIiJxvI9ZB1N762qE70eo=;
        b=MjK9dAfbYJPhy/Bdwz2bD587hGtdDNTvalq0sF1uS0JbOwtDzaITO+RF3PYrdwMnZy
         QOowVbsBLLrErexE287FQtGQKpn5nwv80ApOfxLm5VfQPRGc65u9DXahKVngTT2BRGUn
         a7mGYrsg3OZ5BpJO4CHu0wY2VE7t1WlAhaYAAyFw1ola7KsMWGppSBcwwh4g4bTDVerq
         n1Md0HEAEwgtcrwIaD6YUFyHnFj70DcOxP5WIM3FjZ0IHADddlHhsXi8DkGi2cXHS5db
         s+2SXf/MRmhMaUi9GZQ3rPy2KaUhpHprCGE70iN+ygZ/r/PaprTD9ETjB53jQdY+ci5J
         i3hg==
X-Forwarded-Encrypted: i=1; AJvYcCVpiCx+izANdfQmFAgpKqUFu+zKlhPKw0Hv2PGWrBBrN8by/Sa99dh6YMOS7lMYbBVd5CpabtNpOZuZBfrJae16i4T9MW46M/u/eMEDqx0=
X-Gm-Message-State: AOJu0Yz5yF6wK4lNASED47Sun7WvhhYS/HJ4ZuoVAZ91bc1LZ1KDyJhV
	FEL/Nvhe2FIxBckBGDA9Znsmgetp8q+awbVtnKKO8lezNUkvXXPkEWtrNYrNEA==
X-Google-Smtp-Source: AGHT+IE4LsrnJ4MYvocKdfbqpxMTxdeZuuNcXyKeTA1PdPi0TcG+1ayUrLnHBwtznCYjbTbIm/UKjw==
X-Received: by 2002:a05:651c:4ca:b0:2f3:b76c:25c4 with SMTP id 38308e7fff4ca-2f3b76c2731mr10676201fa.37.1723724179807;
        Thu, 15 Aug 2024 05:16:19 -0700 (PDT)
Message-ID: <2ded848e-f2a5-4005-b4c6-09014a92122c@suse.com>
Date: Thu, 15 Aug 2024 14:16:17 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 6/7] xen/riscv: page table handling
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <8362795280a48702bef6f01d41d148edcf299935.1723214540.git.oleksii.kurochko@gmail.com>
 <85a4e760-07af-42bd-ac27-12a4fa5172cc@suse.com>
 <1e83981cff0b6c47aa941e7ffee0ce658aefef22.camel@gmail.com>
 <d41f3027-14c8-4716-9444-d8bc109bb2b7@suse.com>
 <be47249638cbae5e057279acd9a3464c218fbac8.camel@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: <be47249638cbae5e057279acd9a3464c218fbac8.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 15.08.2024 13:21, oleksii.kurochko@gmail.com wrote:
> On Thu, 2024-08-15 at 10:09 +0200, Jan Beulich wrote:
>> On 14.08.2024 18:50, oleksii.kurochko@gmail.com wrote:
>>> On Tue, 2024-08-13 at 12:31 +0200, Jan Beulich wrote:
>>>> On 09.08.2024 18:19, Oleksii Kurochko wrote:
>>>>> RISC-V detects superpages using `pte.x` and `pte.r`, as there
>>>>> is no specific bit in the PTE for this purpose. From the RISC-V
>>>>> spec:
>>>>> ```
>>>>>   ...
>>>>>   4. Otherwise, the PTE is valid. If pte.r = 1 or pte.x = 1, go
>>>>> to
>>>>> step 5.
>>>>>      Otherwise, this PTE is a pointer to the next level of the
>>>>> page
>>>>> table.
>>>>>      ... .
>>>>>   5. A leaf PTE has been found.
>>>>>      ...
>>>>>   ...
>>>>> ```
>>>>>
>>>>> The code doesn’t support super page shattering so 4KB pages are
>>>>> used as
>>>>> default.
>>>>
>>>> ... you have this. Yet still callers expecting re-mapping in the
>>>> (large)
>>>> range they map can request small-page mappings right away.
>>> I am not sure that I fully understand what do you mean by "expcting
>>> re-
>>> mapping".
>>
>> Right now you have callers pass PTE_BLOCK when they know that no
>> small
>> page re-mappings are going to occur for an area. What I'm suggesting
>> is
>> that you invert this logic: Have callers pass PTE_SMALL when there is
>> a possibility that re-mapping requests may be issued later. Then,
>> later, by simply grep-ing for PTE_SMALL you'll be able to easily find
>> all candidates that possibly can be relaxed when super-page
>> shattering
>> starts being supported. That's going to be easier than finding all
>> instances where PTE_BLOCK is _not_used.
> So if I understand correctly. Actually nothing will change in algorithm
> of pt_update() and only PTE_SMALL should be introduced instead of
> PTE_BLOCK. And if I will know that something will be better to map as
> PTE_SMALL to not face shattering in case of unmap (for example) I just
> can map this memory as PTE_SMALL and that is it?

That is it.

>>>>> +    spin_unlock(&xen_pt_lock);
>>>>
>>>> Does this really need to come after fence and flush?
>>> I think yes, as page table should be updated only by 1 CPU at the
>>> same
>>> time. And before give ability to other CPU to update page table we
>>> have
>>> to finish a work on current CPU.
>>
>> Can you then explain to me, perhaps by way of an example, what will
>> go
>> wrong if the unlock is ahead of the flush? (I'm less certain about
>> the
>> fence, and that's also less expensive.)
> pt_update() will be called for interleaved region, for example, by
> different CPUs:
> 
>                      pt_update():
> CPU1:                                    CPU2:
>  ...                                spin_lock(&xen_pt_lock);
> RISCV_FENCE(rw, rw);                 ....
> 
> /* After this function will be
>    executed the following thing
>    can happen ------------------>  start to update page table
> */                                 entries which was partially      
> spin_unlock(&xen_pt_lock);         created during CPU1 but CPU2       
> ....                               doesn't know about them yet        
> ....                               because flush_tlb() ( sfence.vma ) 
> ....                               wasn't done      
> ....                                                                  
> flush_tlb_range_va();

Not exactly: CPU2 knows about them as far as the memory used / modified
goes, and that's all that matters for further page table modifications.
CPU2 only doesn't know about the new page table entries yet when it comes
to using them for a translation (by the hardware page walker). Yet this
aspect is irrelevant here, if I'm not mistaken.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 13:16:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 13:16:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778062.1188126 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seaKt-0001dA-5G; Thu, 15 Aug 2024 13:16:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778062.1188126; Thu, 15 Aug 2024 13:16:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seaKt-0001cW-1I; Thu, 15 Aug 2024 13:16:15 +0000
Received: by outflank-mailman (input) for mailman id 778062;
 Thu, 15 Aug 2024 13:16:13 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=aZnf=PO=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1seaKq-0000wd-W5
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 13:16:12 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8a0060eb-5b08-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 15:16:10 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a7a81bd549eso88666866b.3
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 06:16:10 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383947151sm100868666b.161.2024.08.15.06.16.08
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 15 Aug 2024 06:16:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8a0060eb-5b08-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723727769; x=1724332569; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=9tKJRp+XTy2g8P71m3miHWyYMM1xvQ876gmk/7YMzdE=;
        b=kkHMg/wKYI7u+77Z9pyvXCQ7Ua1Wvy2sH7QI8MkFuH6GIxe7Pdeb+XEXNlwZ5HqCVw
         4o2z28rep87dIJRiwYFuLfEFm7u9LK2quGxlUdsI02VV4xZjmbC7gU/DeNVgOn52SM/G
         Z4LxKE22qHwsNGQ15K7qT6S1tybfSTbJG+WzY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723727769; x=1724332569;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=9tKJRp+XTy2g8P71m3miHWyYMM1xvQ876gmk/7YMzdE=;
        b=mMsE2AWh8ehhvDJrvaDw30EaIIeyflL9Ylo1tFXxFTi7mgOLBTRZtXXecACjg50ur1
         f6tt9jNYOpfu7M7skoA4RY9n0KvWdSnvkdevqf3KqVYvgSj2la3cgsc7mOk0DK88RBZL
         WcKFUyffGEQ1W1fTIinYiTTqp0feFvuLGcWoViyLqZbq2L5ClSt0I/e7nJRGLEYEL+rg
         acQUWpXd02gt9uDC0FA+VwbSk9MUmaXlAZ8fhZqRo8gIV32hMr0OUVge8YR9n3HlWKKT
         KQgyENuOWqTbbLkVzSf5r0Af0plLSmJdQJvTbALsiiduU2WpECzYoN+CwupzS+XtnoPm
         fX4w==
X-Gm-Message-State: AOJu0Yx45pM54tB5Z7cU2VjQbG2ur1/DYWKPqx067gIB6dPL+gbf197J
	L4LsGGsEf4n9mhV3/TUZ7LgzyIA1/SDHF0fyOoOO+8tui2mL0VCJoiLRoduE5hhCfHrLKMlRu28
	r
X-Google-Smtp-Source: AGHT+IFC2pxB3ToqW0cMxLgozW3zl6w8bhllIPKTxNCmtTNehROADP+qNKSEMriajnZOgj0y5Q1qEQ==
X-Received: by 2002:a17:907:f1de:b0:a7a:b43e:86cf with SMTP id a640c23a62f3a-a8366c359cemr467716966b.27.1723727769460;
        Thu, 15 Aug 2024 06:16:09 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2 2/3] x86/pv: Fix merging of new status bits into %dr6
Date: Thu, 15 Aug 2024 14:15:59 +0100
Message-Id: <20240815131600.4037415-3-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240815131600.4037415-1-andrew.cooper3@citrix.com>
References: <20240815131600.4037415-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

All #DB exceptions result in an update of %dr6, but this isn't captured in
Xen's handling, and is buggy everywhere.

To begin resolving this issue, add a new pending_dbg field to x86_event
(unioned with cr2 to avoid taking any extra space), and introduce
pv_inject_debug_exn() helpers to replace the current callers using
pv_inject_hw_exception().

Push the adjustment of v->arch.dr6 into pv_inject_event(), and use the new
x86_merge_dr6() rather than the current incorrect logic.

A key property is that pending_dbg is taken with positive polarity to deal
with RTM/BLD sensibly.  Most callers pass in a constant, but callers passing
in a hardware %dr6 value need to XOR the value with X86_DR6_DEFAULT to flip to
positive polarity.

This fixes the behaviour of the breakpoint status bits; specifically that any
left pending are discarded when a new #DB is raised.  In principle it would
fix RTM/BLD too, except PV guests can't turn these capabilities on to start
with.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
v2:
 * Rebase (~6y worth)
 * Split PV changes out of joint HVM patch.
---
 xen/arch/x86/include/asm/domain.h      | 12 ++++++++++++
 xen/arch/x86/pv/emul-priv-op.c         |  5 +----
 xen/arch/x86/pv/emulate.c              |  6 ++----
 xen/arch/x86/pv/ro-page-fault.c        |  2 +-
 xen/arch/x86/pv/traps.c                | 16 ++++++++++++----
 xen/arch/x86/traps.c                   |  2 +-
 xen/arch/x86/x86_emulate/x86_emulate.h |  5 ++++-
 7 files changed, 33 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/include/asm/domain.h b/xen/arch/x86/include/asm/domain.h
index bca3258d69ac..90c959996914 100644
--- a/xen/arch/x86/include/asm/domain.h
+++ b/xen/arch/x86/include/asm/domain.h
@@ -731,6 +731,18 @@ static inline void pv_inject_hw_exception(unsigned int vector, int errcode)
     pv_inject_event(&event);
 }
 
+static inline void pv_inject_debug_exn(unsigned int pending_dbg)
+{
+    struct x86_event event = {
+        .vector      = X86_EXC_DB,
+        .type        = X86_EVENTTYPE_HW_EXCEPTION,
+        .error_code  = X86_EVENT_NO_EC,
+        .pending_dbg = pending_dbg,
+    };
+
+    pv_inject_event(&event);
+}
+
 static inline void pv_inject_page_fault(int errcode, unsigned long cr2)
 {
     const struct x86_event event = {
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index aa11ecadaac0..3be02d85f2fe 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -1366,10 +1366,7 @@ int pv_emulate_privileged_op(struct cpu_user_regs *regs)
             ctxt.bpmatch |= DR_STEP;
 
         if ( ctxt.bpmatch )
-        {
-            curr->arch.dr6 |= ctxt.bpmatch | DR_STATUS_RESERVED_ONE;
-            pv_inject_hw_exception(X86_EXC_DB, X86_EVENT_NO_EC);
-        }
+            pv_inject_debug_exn(ctxt.bpmatch);
 
         /* fall through */
     case X86EMUL_RETRY:
diff --git a/xen/arch/x86/pv/emulate.c b/xen/arch/x86/pv/emulate.c
index e7a1c0a2cc4f..aa8af96c30f3 100644
--- a/xen/arch/x86/pv/emulate.c
+++ b/xen/arch/x86/pv/emulate.c
@@ -71,11 +71,9 @@ void pv_emul_instruction_done(struct cpu_user_regs *regs, unsigned long rip)
 {
     regs->rip = rip;
     regs->eflags &= ~X86_EFLAGS_RF;
+
     if ( regs->eflags & X86_EFLAGS_TF )
-    {
-        current->arch.dr6 |= DR_STEP | DR_STATUS_RESERVED_ONE;
-        pv_inject_hw_exception(X86_EXC_DB, X86_EVENT_NO_EC);
-    }
+        pv_inject_debug_exn(X86_DR6_BS);
 }
 
 uint64_t pv_get_reg(struct vcpu *v, unsigned int reg)
diff --git a/xen/arch/x86/pv/ro-page-fault.c b/xen/arch/x86/pv/ro-page-fault.c
index cad28ef928ad..73c9f7578a87 100644
--- a/xen/arch/x86/pv/ro-page-fault.c
+++ b/xen/arch/x86/pv/ro-page-fault.c
@@ -390,7 +390,7 @@ int pv_ro_page_fault(unsigned long addr, struct cpu_user_regs *regs)
         /* Fallthrough */
     case X86EMUL_OKAY:
         if ( ctxt.retire.singlestep )
-            pv_inject_hw_exception(X86_EXC_DB, X86_EVENT_NO_EC);
+            pv_inject_debug_exn(X86_DR6_BS);
 
         /* Fallthrough */
     case X86EMUL_RETRY:
diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index 83e84e276233..5a7341abf068 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -12,6 +12,7 @@
 #include <xen/lib.h>
 #include <xen/softirq.h>
 
+#include <asm/debugreg.h>
 #include <asm/pv/trace.h>
 #include <asm/shared.h>
 #include <asm/traps.h>
@@ -50,9 +51,9 @@ void pv_inject_event(const struct x86_event *event)
     tb->cs    = ti->cs;
     tb->eip   = ti->address;
 
-    if ( event->type == X86_EVENTTYPE_HW_EXCEPTION &&
-         vector == X86_EXC_PF )
+    switch ( vector | -(event->type == X86_EVENTTYPE_SW_INTERRUPT) )
     {
+    case X86_EXC_PF:
         curr->arch.pv.ctrlreg[2] = event->cr2;
         arch_set_cr2(curr, event->cr2);
 
@@ -62,9 +63,16 @@ void pv_inject_event(const struct x86_event *event)
             error_code |= PFEC_user_mode;
 
         trace_pv_page_fault(event->cr2, error_code);
-    }
-    else
+        break;
+
+    case X86_EXC_DB:
+        curr->arch.dr6 = x86_merge_dr6(curr->domain->arch.cpu_policy,
+                                       curr->arch.dr6, event->pending_dbg);
+        fallthrough;
+    default:
         trace_pv_trap(vector, regs->rip, use_error_code, error_code);
+        break;
+    }
 
     if ( use_error_code )
     {
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 521ed4dd816d..06e4e3e9af90 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2030,7 +2030,7 @@ void asmlinkage do_debug(struct cpu_user_regs *regs)
         return;
     }
 
-    pv_inject_hw_exception(X86_EXC_DB, X86_EVENT_NO_EC);
+    pv_inject_debug_exn(0 /* N/A, already merged */);
 }
 
 void asmlinkage do_entry_CP(struct cpu_user_regs *regs)
diff --git a/xen/arch/x86/x86_emulate/x86_emulate.h b/xen/arch/x86/x86_emulate/x86_emulate.h
index d92be69d84d9..e8a0e572284c 100644
--- a/xen/arch/x86/x86_emulate/x86_emulate.h
+++ b/xen/arch/x86/x86_emulate/x86_emulate.h
@@ -78,7 +78,10 @@ struct x86_event {
     uint8_t       type;         /* X86_EVENTTYPE_* */
     uint8_t       insn_len;     /* Instruction length */
     int32_t       error_code;   /* X86_EVENT_NO_EC if n/a */
-    unsigned long cr2;          /* Only for X86_EXC_PF h/w exception */
+    union {
+        unsigned long cr2;         /* #PF */
+        unsigned long pending_dbg; /* #DB (new DR6 bits, positive polarity) */
+    };
 };
 
 /*
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 15 13:16:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 13:16:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778060.1188105 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seaKq-0000wb-Ms; Thu, 15 Aug 2024 13:16:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778060.1188105; Thu, 15 Aug 2024 13:16:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seaKq-0000wU-K5; Thu, 15 Aug 2024 13:16:12 +0000
Received: by outflank-mailman (input) for mailman id 778060;
 Thu, 15 Aug 2024 13:16:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=aZnf=PO=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1seaKp-0000wG-FR
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 13:16:11 +0000
Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com
 [2a00:1450:4864:20::632])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 88a93964-5b08-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 15:16:08 +0200 (CEST)
Received: by mail-ej1-x632.google.com with SMTP id
 a640c23a62f3a-a7aada2358fso305550366b.0
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 06:16:08 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383947151sm100868666b.161.2024.08.15.06.16.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 15 Aug 2024 06:16:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 88a93964-5b08-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723727767; x=1724332567; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=MT5Jtu8/bT2qy49tYsdXvgJt2x74cDF3t6xAZwYF8D8=;
        b=hgqkH/KA7r4rLmTZ1/pqFddBCsxQm+Zhz/qWtZGd7Pnd5atHaj1dMhftEL3srAITfX
         fjgblc6IF4bzhDBdOyN4ESHTL6cq8HUtzSAGuF9Ivr1UM502a4YIta8IeShJIBE6+Enz
         06THo8BeRs+KO0w3UxTmIYb8DjAH7psnp6Ubw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723727767; x=1724332567;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=MT5Jtu8/bT2qy49tYsdXvgJt2x74cDF3t6xAZwYF8D8=;
        b=f0WHzA4O9rHP8K5tkwCsFksMrwCJaoPzFxp8RdTsjF/PG3aKqRHliKWFG3oaA3Zstj
         w0LI81KWR4yuWiRfKqT8w97xRJLRv3giyiC94h9EcKCjKAmb3yEQwVP0Qs6P+/DhALJp
         oMPsYeGrdQSFfXOBm2/ERAWBBDvvTGuQMynH51PL1rtMDWJbrfxcofqgMzuG4J9a87ly
         M/mNjjpoU7S02/8p3fOpX2a2jV2uI60SpiZmRdmavCkp8s5W5Dvorif3ee7NE1oHE9p5
         8/FEuvneLWYY9wgTiKoc5XE7bZqFbmSxtuN1tSSpByaL7xCgbT0Nh0ajbKYUgu1U3sQS
         cKBw==
X-Gm-Message-State: AOJu0Yzsrd7rb0cJN8vz9BvGF0NpEz6Wq8iQBjNbgA4XVykNsjhXLeGf
	yDz1oWx4n/9ZWEhn2wf05rn6yLMiy6rxjfv0GZysUWociki9nPPy7KY+vIVt9/Dkkmk3Ozb9WTz
	6
X-Google-Smtp-Source: AGHT+IGlLgbfNL8+Heo8QvpukDUBqtGLbCM/biLJaLLkZ8+7/Qi9W0XmkYWfcgP0DQ/Wne1FvPjT6w==
X-Received: by 2002:a17:907:7ea4:b0:a7a:acae:340b with SMTP id a640c23a62f3a-a837cd61afemr275384466b.31.1723727767254;
        Thu, 15 Aug 2024 06:16:07 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Matthew Barnes <matthew.barnes@cloud.com>
Subject: [PATCH v2 0/3] x86/pv: More debugging fixes
Date: Thu, 15 Aug 2024 14:15:57 +0100
Message-Id: <20240815131600.4037415-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Patches 1 and 2 already reviewed, and split out of a larger series covering
HVM too.  However, as it's been 6 years (yes really), I've reposed them just
in case.

Patch 3 fixes a Coverity complaint, highlighted by Matt's recent change to fix
IO breakpoint recognition.

Andrew Cooper (3):
  x86/pv: Introduce x86_merge_dr6() and fix do_debug()
  x86/pv: Fix merging of new status bits into %dr6
  x86/pv: Address Coverity complaint in check_guest_io_breakpoint()

 xen/arch/x86/debug.c                   | 20 +++++++++++++++
 xen/arch/x86/include/asm/debugreg.h    | 34 ++++++++++++++++++++++++++
 xen/arch/x86/include/asm/domain.h      | 12 +++++++++
 xen/arch/x86/include/asm/x86-defns.h   |  7 ++++++
 xen/arch/x86/pv/emul-priv-op.c         | 26 ++++++--------------
 xen/arch/x86/pv/emulate.c              |  6 ++---
 xen/arch/x86/pv/ro-page-fault.c        |  2 +-
 xen/arch/x86/pv/traps.c                | 16 +++++++++---
 xen/arch/x86/traps.c                   | 12 ++++++---
 xen/arch/x86/x86_emulate/x86_emulate.h |  5 +++-
 10 files changed, 107 insertions(+), 33 deletions(-)

-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 15 13:16:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 13:16:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778061.1188116 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seaKr-0001Az-T9; Thu, 15 Aug 2024 13:16:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778061.1188116; Thu, 15 Aug 2024 13:16:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seaKr-0001Ar-QK; Thu, 15 Aug 2024 13:16:13 +0000
Received: by outflank-mailman (input) for mailman id 778061;
 Thu, 15 Aug 2024 13:16:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=aZnf=PO=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1seaKq-0000wG-56
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 13:16:12 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 89ae9865-5b08-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 15:16:10 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a7ab5fc975dso104308166b.1
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 06:16:10 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383947151sm100868666b.161.2024.08.15.06.16.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 15 Aug 2024 06:16:07 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 89ae9865-5b08-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723727769; x=1724332569; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=JXB1cqrzG0ayFT32zCt0qauALpoTTusQsO7LDnR/lNA=;
        b=Z/MsgLYWPjzZ1Plho9muooR44K3I4F551VxDnLBo112Aktlk3aZnhKhcSW9C3EUxTX
         D349vCmTTVXAYkGTbW5/7EpR0CLGmhWncfZcXSHHNjrNV6dZf5HFMSL6dRLuWqxdqoc5
         j+gQ6Oqdh26j9iyxSN44rhwy+nwnm1snYRk2k=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723727769; x=1724332569;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=JXB1cqrzG0ayFT32zCt0qauALpoTTusQsO7LDnR/lNA=;
        b=RhRQG0uujQnwVDKee1uKbUsoEXKctJ5OtlMvLdIwnqd6weMB6wyXn4UffRKLtnFBkA
         U0ZwRwKJ2vmbfEf+PBuiUrcazLOIAN/oP2vyAOuxgiSptnkF2GK8Z3V/wfJzx6GoF0BB
         yryRBvi2UDlENG7Yo478sBAsq5noRZnt2kIU9rJP80G7BLnk9UpLmTJf38aamApILtQJ
         r3VsxNwqQBKCbQt0WCpow521zewB6Ekv9RgZlR7so18Iu9Xc7beegEtfljYiKEy1FRtD
         1Cx5VORHrkgUMfb87pR8vkdSfzvFJGRxRHivhKhwF/x3iRc6O/gPZxhrsTC7B/y4ofQO
         Dwfw==
X-Gm-Message-State: AOJu0YzfO6wdQIWPcjnoMN+XccDTwGuiHF7iDWedxfeka4D3VUzBTWec
	aypFENemmYR/HRw0jrH8MEV3kkjRb2NP/AJ4jeiw0pWDbWMmqcxRTDP2vtNVVOKRyRiFML6+GFH
	f
X-Google-Smtp-Source: AGHT+IFV5dX+MwhHd9oJRxpgf4lcz7LQU+DGTGIlc1EoxXfzjmfYx+hQ6/uhXhOpJYI63eiyg2w88Q==
X-Received: by 2002:a17:907:f71a:b0:a7a:a46e:dc37 with SMTP id a640c23a62f3a-a8367049c2emr439509166b.57.1723727768739;
        Thu, 15 Aug 2024 06:16:08 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Jan Beulich <JBeulich@suse.com>
Subject: [PATCH v2 1/3] x86/pv: Introduce x86_merge_dr6() and fix do_debug()
Date: Thu, 15 Aug 2024 14:15:58 +0100
Message-Id: <20240815131600.4037415-2-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240815131600.4037415-1-andrew.cooper3@citrix.com>
References: <20240815131600.4037415-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Pretty much everywhere in Xen the logic to update %dr6 when injecting #DB is
buggy.  The architectural behaviour is to overwrite B{0..3} (rather than
accumulate) and accumulate all other bits.

Introduce a new x86_merge_dr6() helper, and start fixing the mess by adjusting
the dr6 merge in do_debug().  Also correct the comment.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>

v2:
 * Rebase (~6y worth)
 * Split PV changes out of joint HVM patch.

In some theoretical future where deubgging is implemented in terms of
introspection even for PV guests, the TODO will complete itself.
---
 xen/arch/x86/debug.c                 | 20 ++++++++++++++++++++
 xen/arch/x86/include/asm/debugreg.h  |  8 ++++++++
 xen/arch/x86/include/asm/x86-defns.h |  7 +++++++
 xen/arch/x86/traps.c                 | 10 +++++++---
 4 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/debug.c b/xen/arch/x86/debug.c
index 127fe83021cd..429752b8cc83 100644
--- a/xen/arch/x86/debug.c
+++ b/xen/arch/x86/debug.c
@@ -2,12 +2,32 @@
 /*
  * Copyright (C) 2023 XenServer.
  */
+#include <xen/bug.h>
 #include <xen/kernel.h>
 
 #include <xen/lib/x86/cpu-policy.h>
 
 #include <asm/debugreg.h>
 
+unsigned int x86_merge_dr6(const struct cpu_policy *p, unsigned int dr6,
+                           unsigned int pending_dbg)
+{
+    /* Flip dr6 to have positive polarity. */
+    dr6 ^= X86_DR6_DEFAULT;
+
+    /* Sanity check that only known values are passed in. */
+    ASSERT(!(dr6 & ~X86_DR6_KNOWN_MASK));
+    ASSERT(!(pending_dbg & ~X86_DR6_KNOWN_MASK));
+
+    /* Breakpoints 0-3 overridden.  Others accumulate. */
+    dr6 = (dr6 & ~X86_DR6_BP_MASK) | pending_dbg;
+
+    /* Flip dr6 back to having default polarity. */
+    dr6 ^= X86_DR6_DEFAULT;
+
+    return x86_adj_dr6_rsvd(p, dr6);
+}
+
 unsigned int x86_adj_dr6_rsvd(const struct cpu_policy *p, unsigned int dr6)
 {
     unsigned int ones = X86_DR6_DEFAULT;
diff --git a/xen/arch/x86/include/asm/debugreg.h b/xen/arch/x86/include/asm/debugreg.h
index 96c406ad53c8..969f2697aee1 100644
--- a/xen/arch/x86/include/asm/debugreg.h
+++ b/xen/arch/x86/include/asm/debugreg.h
@@ -108,4 +108,12 @@ struct cpu_policy;
 unsigned int x86_adj_dr6_rsvd(const struct cpu_policy *p, unsigned int dr6);
 unsigned int x86_adj_dr7_rsvd(const struct cpu_policy *p, unsigned int dr7);
 
+/*
+ * Merging new status bits into dr6 is far from simple.  Breakpoints override,
+ * while others accumulate.  New bits to be merged are taken with positive
+ * polarity.
+ */
+unsigned int x86_merge_dr6(const struct cpu_policy *p, unsigned int dr6,
+                           unsigned int pending_dbg);
+
 #endif /* _X86_DEBUGREG_H */
diff --git a/xen/arch/x86/include/asm/x86-defns.h b/xen/arch/x86/include/asm/x86-defns.h
index 3bcdbaccd3aa..caa92829eaa9 100644
--- a/xen/arch/x86/include/asm/x86-defns.h
+++ b/xen/arch/x86/include/asm/x86-defns.h
@@ -132,6 +132,13 @@
 #define X86_DR6_ZEROS           _AC(0x00001000, UL)  /* %dr6 bits forced to 0       */
 #define X86_DR6_DEFAULT         _AC(0xffff0ff0, UL)  /* Default %dr6 value          */
 
+#define X86_DR6_BP_MASK                                 \
+    (X86_DR6_B0 | X86_DR6_B1 | X86_DR6_B2 | X86_DR6_B3)
+
+#define X86_DR6_KNOWN_MASK                                              \
+    (X86_DR6_BP_MASK | X86_DR6_BLD | X86_DR6_BD | X86_DR6_BS |          \
+     X86_DR6_BT | X86_DR6_RTM)
+
 /*
  * Debug control flags in DR7.
  */
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 552a07e6aa56..521ed4dd816d 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -2016,9 +2016,13 @@ void asmlinkage do_debug(struct cpu_user_regs *regs)
         return;
     }
 
-    /* Save debug status register where guest OS can peek at it */
-    v->arch.dr6 |= (dr6 & ~X86_DR6_DEFAULT);
-    v->arch.dr6 &= (dr6 | ~X86_DR6_DEFAULT);
+    /*
+     * Update the guest's dr6 so the debugger can peek at it.
+     * TODO: This should be passed out-of-bad to the debugger, so guest state
+     * is not corrupted by debugging actions completed behind it's back.
+     */
+    v->arch.dr6 = x86_merge_dr6(v->domain->arch.cpu_policy,
+                                v->arch.dr6, dr6 ^ X86_DR6_DEFAULT);
 
     if ( guest_kernel_mode(v, regs) && v->domain->debugger_attached )
     {
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 15 13:16:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 13:16:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778063.1188132 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seaKt-0001hz-Fu; Thu, 15 Aug 2024 13:16:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778063.1188132; Thu, 15 Aug 2024 13:16:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seaKt-0001gR-87; Thu, 15 Aug 2024 13:16:15 +0000
Received: by outflank-mailman (input) for mailman id 778063;
 Thu, 15 Aug 2024 13:16:13 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=aZnf=PO=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1seaKr-0000wd-LN
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 13:16:13 +0000
Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com
 [2a00:1450:4864:20::62d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8adec34a-5b08-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 15:16:12 +0200 (CEST)
Received: by mail-ej1-x62d.google.com with SMTP id
 a640c23a62f3a-a7a843bef98so114859766b.2
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 06:16:12 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383947151sm100868666b.161.2024.08.15.06.16.09
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 15 Aug 2024 06:16:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8adec34a-5b08-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723727771; x=1724332571; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=CLsIM2SrmEtD0ssvz4LyTonhrI43hpVd0ZLSJTvcNo0=;
        b=Iwx1MM08A0E7ivqMBNQJylYgAFX285e8HONfRqjLtKCE4bl2ViKaDUemEAVxagEa5m
         Fm+/kVVchGx5jBbjkUv+jJioW+Jx1F+ftlKSNQx8V9if4omJqqSqXeZ8dmCimDAvbq6F
         vQKn8DXrH2MWyfrhzWsDIlBoZ/vNknZOQ0QDg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723727771; x=1724332571;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=CLsIM2SrmEtD0ssvz4LyTonhrI43hpVd0ZLSJTvcNo0=;
        b=ReDOTMXcefPHqCzK+2O8vE7WS50xcVXaVwsaQNMmh1aHK2gDVAVwtJpsTSKFsfrcoe
         +0zRcXaInlldwrknZbmNd+UHj8V6+UGQU6tCkubIJ1qtV2tU91zLVvrqZ6l0yBT9AEnt
         6MnnNnIu3WPxuCp2k8lG+j39flGiZ6t9fVrMhnxmTS1NHhWNS7ycxfwxXUIJRWz+Hi5f
         iW7LrwxEBITxBIBNJU+/iZ10n6qoInCrSsogd9obXL/OxTgtzmiexPdA8FuJiMddty9N
         m51axwsi/ul9A91cSBYkLocsMEOrhTkYR/yf9A7fdUyqZ91MoEAvL+YqJOBHU4Xr0KZT
         FWZA==
X-Gm-Message-State: AOJu0YwE2BsAPQw/HZ+zb90SEWBFwlZJjwtPHDQdKDduxXoAGqU24b84
	c4dGMgxL/DV6g3xyokSrTXxhUKYSIK4INlVkfh0pBosyg1kUXD5Su9SRdIWqq0UGuqTH302nhAC
	N
X-Google-Smtp-Source: AGHT+IHORPxKwJdvktruJ61rJ3DOVaOKCkr9ECGxsH86WeIUZqjJ1Bop13+JWn+OI2b8ZILOtFetfg==
X-Received: by 2002:a17:907:e2a4:b0:a7a:b43e:86d4 with SMTP id a640c23a62f3a-a8366c4268dmr390450366b.15.1723727770979;
        Thu, 15 Aug 2024 06:16:10 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Matthew Barnes <matthew.barnes@cloud.com>
Subject: [PATCH v2 3/3] x86/pv: Address Coverity complaint in check_guest_io_breakpoint()
Date: Thu, 15 Aug 2024 14:16:00 +0100
Message-Id: <20240815131600.4037415-4-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240815131600.4037415-1-andrew.cooper3@citrix.com>
References: <20240815131600.4037415-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Commit 08aacc392d86 ("x86/emul: Fix misaligned IO breakpoint behaviour in PV
guests") caused a Coverity INTEGER_OVERFLOW complaint based on the reasoning
that width could be 0.

It can't, but digging into the code generation, GCC 8 and later (bisected on
gotbolt) choose to emit a CSWITCH lookup table, and because the range (bottom
2 bits clear), it's a 16-entry lookup table.

So Coverity is correct, given that GCC did emit a (dead) logic path where
width stayed 0.

Rewrite the logic.  Introduce x86_bp_width() which compiles to a single basic
block, which replaces the switch() statement.  Take the opportunity to also
make start and width be loop-scope variables.

No practical change, but it should compile better and placate Coverity.

Fixes: 08aacc392d86 ("x86/emul: Fix misaligned IO breakpoint behaviour in PV guests")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Matthew Barnes <matthew.barnes@cloud.com>
---
 xen/arch/x86/include/asm/debugreg.h | 26 ++++++++++++++++++++++++++
 xen/arch/x86/pv/emul-priv-op.c      | 21 ++++++---------------
 2 files changed, 32 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/include/asm/debugreg.h b/xen/arch/x86/include/asm/debugreg.h
index 969f2697aee1..cbcc3e83c3d2 100644
--- a/xen/arch/x86/include/asm/debugreg.h
+++ b/xen/arch/x86/include/asm/debugreg.h
@@ -116,4 +116,30 @@ unsigned int x86_adj_dr7_rsvd(const struct cpu_policy *p, unsigned int dr7);
 unsigned int x86_merge_dr6(const struct cpu_policy *p, unsigned int dr6,
                            unsigned int pending_dbg);
 
+/*
+ * Calculate the width of a breakpoint from its dr7 encoding.
+ *
+ * The LEN encoding in dr7 is 2 bits wide per breakpoint and encoded a mask
+ * (0, 1 and 3) for widths of 1, 2 and 4 respectively in the 32bit days.
+ *
+ * In 64bit, the unused value (2) was specified to mean a width of 8, which is
+ * great for encoding efficiency but less great for nicely calculating the
+ * width.
+ */
+static inline unsigned int x86_bp_width(unsigned int dr7, unsigned int bp)
+{
+    unsigned int raw = (dr7 >> (DR_CONTROL_SHIFT +
+                                DR_CONTROL_SIZE * bp + 2)) & 3;
+
+    /*
+     * If the top bit is set (i.e. we've got a 4 or 8), flip the bottom to
+     * reverse their order, making them sorted properly.  Then it's a simple
+     * shift to calculate the width.
+     */
+    if ( raw & 2 )
+        raw ^= 1;
+
+    return 1U << raw;
+}
+
 #endif /* _X86_DEBUGREG_H */
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index 3be02d85f2fe..c89727da43ee 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -323,30 +323,21 @@ static unsigned int check_guest_io_breakpoint(struct vcpu *v,
                                               unsigned int port,
                                               unsigned int len)
 {
-    unsigned int width, i, match = 0;
-    unsigned long start;
+    unsigned int i, match = 0;
 
     if ( !v->arch.pv.dr7_emul || !(v->arch.pv.ctrlreg[4] & X86_CR4_DE) )
         return 0;
 
     for ( i = 0; i < 4; i++ )
     {
+        unsigned long start;
+        unsigned int width;
+
         if ( !(v->arch.pv.dr7_emul & (3 << (i * DR_ENABLE_SIZE))) )
             continue;
 
-        start = v->arch.dr[i];
-        width = 0;
-
-        switch ( (v->arch.dr7 >>
-                  (DR_CONTROL_SHIFT + i * DR_CONTROL_SIZE)) & 0xc )
-        {
-        case DR_LEN_1: width = 1; break;
-        case DR_LEN_2: width = 2; break;
-        case DR_LEN_4: width = 4; break;
-        case DR_LEN_8: width = 8; break;
-        }
-
-        start &= ~(width - 1UL);
+        width = x86_bp_width(v->arch.dr7, i);
+        start = v->arch.dr[i] & ~(width - 1UL);
 
         if ( (start < (port + len)) && ((start + width) > port) )
             match |= 1u << i;
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 15 13:17:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 13:17:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778089.1188145 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seaM1-0003Qg-OK; Thu, 15 Aug 2024 13:17:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778089.1188145; Thu, 15 Aug 2024 13:17:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seaM1-0003QZ-LX; Thu, 15 Aug 2024 13:17:25 +0000
Received: by outflank-mailman (input) for mailman id 778089;
 Thu, 15 Aug 2024 13:17:24 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=aZnf=PO=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1seaM0-0003QN-G8
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 13:17:24 +0000
Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com
 [2607:f8b0:4864:20::72d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b498346a-5b08-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 15:17:22 +0200 (CEST)
Received: by mail-qk1-x72d.google.com with SMTP id
 af79cd13be357-7a501dd544eso29197685a.2
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 06:17:22 -0700 (PDT)
Received: from [192.168.1.10] (host-92-26-98-202.as13285.net. [92.26.98.202])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a4ff02aefbsm62639085a.6.2024.08.15.06.17.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 06:17:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b498346a-5b08-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723727840; x=1724332640; 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=tMJFIt8HmP7fZbDGOO5bUf+hxHbPK2mz3KIdTfPwmA4=;
        b=sGYRco9jyBMEWhFkCyh1f/G/f3f05nxpGsL5kHyBEbwcNXLJFTeAc+9hHNEFXYAKrh
         GGJeJbcBCh5eUIh65wC59aEiL1DjOIe98Rtzyf0js/09INXjRAv2Kl0ZLa26hr6vDM/0
         qJSUIMmB33DWz6Ri3mv55g2Ah1IO7yJxvXzjA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723727840; x=1724332640;
        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=tMJFIt8HmP7fZbDGOO5bUf+hxHbPK2mz3KIdTfPwmA4=;
        b=Y/IPsJGNrGdtRDiC+WW2R47CxZ9aqTq6UQ5R4ehPrubY4A9B4VkU13eFRVCr6P7qRD
         nQqL2nZk2ON5TUggg33cyuS0TJr2Mrv60SREHdkqakxTnkFI0CEUYfz5gpspGtxhZV6S
         Jx1HyZoVDltZH87oriEX4g+Y4Sq10ZdTXTpMI64A2LAD4NR0XKKfF9d2tvWa3Qi/RQba
         waoKm3Uwun/mtUioNE7yNaVZeg89cINjzGNGq0nl3v61HbvukKqzcdHSH7baOvkzLiRp
         56GpWUWtNw7sXpL/CDfwJ9MuGMf7tgYededAQFb/ferT52eQTEV3R9veE6CpTfQLUAAp
         Palg==
X-Gm-Message-State: AOJu0YxZVFQGzq5z29z4fjIzfOt3XuqgDWBvVPTd047I0WyzHu4U0ay1
	EIZZPlztKLaSHrnTG0jRPeS2w+u5tuiF0uWjBF75Dom5bVCwkl09JtPfGbaigMqPgw3uKAjsltT
	z
X-Google-Smtp-Source: AGHT+IHk0QzWnGe0Z/Nvsmoz/jBkSYJTsLwTU52glOmspkWl8RL1saEdz3WpjYsgwQ2Q0phlLMt/Vg==
X-Received: by 2002:a05:620a:404b:b0:79f:515:e211 with SMTP id af79cd13be357-7a4ee3abf8emr762831185a.46.1723727840519;
        Thu, 15 Aug 2024 06:17:20 -0700 (PDT)
Message-ID: <5030e672-c9fe-40cb-ac9d-68aaf311745d@citrix.com>
Date: Thu, 15 Aug 2024 14:17:18 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 3/3] x86/pv: Address Coverity complaint in
 check_guest_io_breakpoint()
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Jan Beulich <JBeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Matthew Barnes <matthew.barnes@cloud.com>
References: <20240815131600.4037415-1-andrew.cooper3@citrix.com>
 <20240815131600.4037415-4-andrew.cooper3@citrix.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20240815131600.4037415-4-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 15/08/2024 2:16 pm, Andrew Cooper wrote:
> Commit 08aacc392d86 ("x86/emul: Fix misaligned IO breakpoint behaviour in PV
> guests") caused a Coverity INTEGER_OVERFLOW complaint based on the reasoning
> that width could be 0.
>
> It can't, but digging into the code generation, GCC 8 and later (bisected on
> gotbolt) choose to emit a CSWITCH lookup table, and because the range (bottom
> 2 bits clear), it's a 16-entry lookup table.
>
> So Coverity is correct, given that GCC did emit a (dead) logic path where
> width stayed 0.
>
> Rewrite the logic.  Introduce x86_bp_width() which compiles to a single basic
> block, which replaces the switch() statement.  Take the opportunity to also
> make start and width be loop-scope variables.
>
> No practical change, but it should compile better and placate Coverity.
>
> Fixes: 08aacc392d86 ("x86/emul: Fix misaligned IO breakpoint behaviour in PV guests")

I forgot Coverity-ID: 1616152, fixed locally.

> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 13:29:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 13:29:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778108.1188156 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seaXh-0005rp-NX; Thu, 15 Aug 2024 13:29:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778108.1188156; Thu, 15 Aug 2024 13:29:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seaXh-0005ri-Jd; Thu, 15 Aug 2024 13:29:29 +0000
Received: by outflank-mailman (input) for mailman id 778108;
 Thu, 15 Aug 2024 13:29: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=qQtD=PO=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1seaXg-0005rc-0Z
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 13:29:28 +0000
Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com
 [2a00:1450:4864:20::234])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 649e131e-5b0a-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 15:29:26 +0200 (CEST)
Received: by mail-lj1-x234.google.com with SMTP id
 38308e7fff4ca-2f3b8eb3df5so6737841fa.1
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 06:29:26 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f3b748dd43sm2129311fa.49.2024.08.15.06.29.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 15 Aug 2024 06:29:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 649e131e-5b0a-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723728566; x=1724333366; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=39rUEMRstKgiiC8AlPUO2jOdoWsSYSHLR/AbgfCLZqg=;
        b=QRx54s1tw5biF63CMLnCvFzmsX7o3FCbkmR7GSMpOq2ah0W12cyk3paeTXi6TXDhjy
         6Y0I8jKh+SuAfl7nrBYkO6uvnMndOCo2DSlBRKNrRtavehi2FLV+b8CKC8iR7OreSUBk
         y95SgMIHw/hK/r4M5cHnKg0eDpnywkmAwe5mozaqRMHxtNcNbqn6vJoN5mj4K/xw/M+j
         +8kOtzKLIvbv6JDF7iIRvr4saGuxhzcxNm7UakXM/BzUDTp0UXLG2xC0kD0thUd4WyPP
         ZFFfTAQedzE6+SkKf9Bh5QtMHuK/4hUfOoJU2eB2jHlzJoNCw8QbF81E248ZZOFPZRve
         VjzQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723728566; x=1724333366;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=39rUEMRstKgiiC8AlPUO2jOdoWsSYSHLR/AbgfCLZqg=;
        b=Zd7qneBOOVrNsO8XsELQ+pfOkPixwtcmSkjZrtxzE0vbqur99T8h0rsByQONbvSBi5
         lbyVrN2cz/g26sH3LwXp1T90FqZLUA0mN2fm8Bt/Wcq2h6gec6mtyZ6pTrkhj4giBSEL
         axKboIunUO80h7K5ZUYOWOCaiDuayAkZ94ShLVNCpph9J353sJ4pRlyKJbutVGPeLTpj
         3XG2yoOi3LpLm6m/zJSc6/xGssxnRZa2MUe0ohzh9hWOXwA+2rnpTwuwfBwdKl0DlQXs
         u33ObdB/hDR0DWPwhGxxPTcZIfpJ9zvb9vA5aQFlH7pMB2DRiROZaCMuZvHjCHF895Qd
         qtHg==
X-Forwarded-Encrypted: i=1; AJvYcCWC/OtkkFbFbHfj2hae+Prwdcb0jfn4eivSQju+aZYdw8l9K80NkVtnr/rACkTiYa6pbRTSLy1IIYQvsBwAK3PQwyQghWFWyEEooJp8jsU=
X-Gm-Message-State: AOJu0YzQSt6J3a2TjzppO4bRheNzxtFoAFsBqAQRXnewgUpl0BDd9EwX
	jEwwKAguSwLmWZDCcy7HWYO2mBSD2u8jYVGGoUccCsocDhrNZMy6
X-Google-Smtp-Source: AGHT+IGhiAw2mqEYGQRqpWHxiVmtT9OvjmPpWtRLaV+/LQxzYuZM9V6Sdmz2wAYnZZ52uZNVV5P4nw==
X-Received: by 2002:a2e:4c11:0:b0:2ef:2e6b:4102 with SMTP id 38308e7fff4ca-2f3aa2fcc00mr34889611fa.43.1723728565762;
        Thu, 15 Aug 2024 06:29:25 -0700 (PDT)
Message-ID: <a3c60570bfe4a29e2b3cfa5ab572fb505038a6d3.camel@gmail.com>
Subject: Re: [PATCH v4 4/7] xen/riscv: introduce functionality to work with
 CPU info
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Thu, 15 Aug 2024 15:29:24 +0200
In-Reply-To: <94a72d20-07c8-4fd6-9759-5bf31d56c860@suse.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
	 <452e2960d1f064a2e3abcaae1ac354f48aafd24c.1723214540.git.oleksii.kurochko@gmail.com>
	 <e0285026-40c5-4316-8129-d07801a9c233@suse.com>
	 <ee3a2e61435e860f1ddb6022fbb712a8d890ae3e.camel@gmail.com>
	 <dfb4678f-0b2d-4d1c-be02-10c4720e57b2@suse.com>
	 <2184097c00f84f707fabadff240f977827a3c927.camel@gmail.com>
	 <94a72d20-07c8-4fd6-9759-5bf31d56c860@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Thu, 2024-08-15 at 11:02 +0200, Jan Beulich wrote:
> On 15.08.2024 10:55, oleksii.kurochko@gmail.com=C2=A0wrote:
> > On Wed, 2024-08-14 at 17:22 +0200, Jan Beulich wrote:
> > > On 14.08.2024 16:45, oleksii.kurochko@gmail.com=C2=A0wrote:
> > > > On Tue, 2024-08-13 at 10:54 +0200, Jan Beulich wrote:
> > > > > On 09.08.2024 18:19, Oleksii Kurochko wrote:
> > > > > > --- /dev/null
> > > > > > +++ b/xen/arch/riscv/smp.c
> > > > > > @@ -0,0 +1,4 @@
> > > > > > +#include <xen/smp.h>
> > > > > > +
> > > > > > +/* tp points to one of these per cpu */
> > > > > > +struct pcpu_info pcpu_info[NR_CPUS];
> > > > >=20
> > > > > And they all need setting up statically? Is there a plan to
> > > > > make
> > > > > this
> > > > > dynamic (which could be recorded in a "fixme" in the
> > > > > comment)?
> > > > I didn't plan to make allocation of this array dynamic. I don't
> > > > expect
> > > > that NR_CPUS will be big.
> > >=20
> > > What is this expectation of yours based on? Other architectures
> > > permit
> > > systems with hundreds or even thousands of CPUs; why would RISC-V
> > > be
> > > different there?
> > Based on available dev boards. ( what isn't really strong argument
> > )
> >=20
> > I checked other architectures and they are using static allocation
> > too:
> > =C2=A0=C2=A0 struct cpuinfo_x86 cpu_data[NR_CPUS];
> > =C2=A0=C2=A0=20
> > =C2=A0=C2=A0 u32 x86_cpu_to_apicid[NR_CPUS] __read_mostly =3D
> > =C2=A0=C2=A0=C2=A0	{ [0 ... NR_CPUS-1] =3D BAD_APICID };
> > =C2=A0=C2=A0=20
> > =C2=A0=C2=A0 ... /* Arm */
> > =C2=A0=C2=A0=20
> > =C2=A0=C2=A0 struct cpuinfo_arm cpu_data[NR_CPUS];
> >=20
> > I wanted to check to understand which one API should be used to
> > allocate this array dynamically. xmalloc?
>=20
> As of a few days ago xvmalloc() (or friends thereof), as long as ...
>=20
> > And I am curious how I can use xmalloc() at this stage if page
> > allocator (?) should be initialized what isn't true now.
>=20
> ... this happens late enough in the boot process. Indeed ...
>=20
> > Or just to allocate pcpu_info only for boot cpu and for other then
> > use
> > xmalloc()?
>=20
> ... statically allocating space for the boot CPU only is another
> option.
>=20
> > > > I can add "fixme" but I am not really
> > > > understand what will be advantages if pcpu_info[] will be
> > > > allocated
> > > > dynamically.
> > >=20
> > > Where possible it's better to avoid static allocations, of which
> > > on
> > > some systems only a very small part may be used. Even if you put
> > > yourself
> > > on the position that many take - memory being cheap - you then
> > > still
> > > waste cache and TLB bandwidth. Furthermore as long as struct
> > > pcpu_info
> > > isn't big enough (and properly aligned) for two successive array
> > > entries
> > > to not share cache lines, you may end up playing cacheline ping-
> > > pong
> > > when a CPU writes to its own array slot.
> > Why the mentioned issues aren't work for dynamic memory? We still
> > allocating memory for sizeof(pcpu_info) * NR_CPUS
>=20
> Why NR_CPUS? At runtime you know how may CPUs the system has you're
> running on. You only need to allocate as much then. Just like e.g.
> dynamically allocated CPU mask variables (cpumask_var_t) deliberately
> use less than NR_CPUS bits unless on really big iron.
I thought that NR_CPUS tells me how many CPU the system has.

The other option is to read that from DTB but then pcpu_info[] can be
allocated only after DTB will be mapped.

~ Oleksii

>=20
> > and when this
> > allocated memory access it will go to cache, CPU/MMU still will use
> > TLB
> > for address translation for this region and without a proper
> > alignment
> > of pcpu_info size it still could be an issue with cache line
> > sharing.
> >=20
> > ~ Oleksii
> >=20
>=20



From xen-devel-bounces@lists.xenproject.org Thu Aug 15 13:34:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 13:34:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778116.1188165 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seacq-0007MV-7X; Thu, 15 Aug 2024 13:34:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778116.1188165; Thu, 15 Aug 2024 13:34:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seacq-0007MO-4S; Thu, 15 Aug 2024 13:34:48 +0000
Received: by outflank-mailman (input) for mailman id 778116;
 Thu, 15 Aug 2024 13:34:46 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=qQtD=PO=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1seaco-0007MI-Ud
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 13:34:46 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 222d6a73-5b0b-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 15:34:44 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-5320d8155b4so1298845e87.3
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 06:34:44 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5330d3ff73esm204618e87.167.2024.08.15.06.34.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 15 Aug 2024 06:34:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 222d6a73-5b0b-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723728884; x=1724333684; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=78ZstunvS/dHT0J6tQFgdJEmQzQGRS2Kk/vfbPAJg8I=;
        b=DusMcjHcBXUbBp/ycd6pZYBa2VMB2oHlbRsE0WRmcM+dyEswBN719+F0AgmJeMZiP8
         J8M/8yilHdsF4C2K9Qh6r/GheNiMIQD4h/ZyvXT6DjnjPVaDrq95bJ1uVx3iH5YpV7CY
         vOJXKVDdQyWTmtduqdQMrA2Uh2Q90zrZGgeUkRfAQzxnZi2qNnLba1TrgYKTRIQthu+A
         E77dOeWa/+Ht2ot/hnEF6eetJ9qBjIiNOZjeMT2ihr2cNzauycFX5Hmj3qn/Ccfpyjjl
         9hJaOM7ZnqWXwnyzlUdYFQmI1lHS85quD+QbbIwKG0Kuw+h762zS2w7MpYED9fmLUpmO
         YNNQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723728884; x=1724333684;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=78ZstunvS/dHT0J6tQFgdJEmQzQGRS2Kk/vfbPAJg8I=;
        b=hPT2fUumJB/mxac6Hkfbl7goCh0SSuYWmF0uUcZ9cHRuC5y6/94UGIuIh78De7pyLi
         PPdHLTGaf+Uw+GOzk33MyUM9djmzSKhn5iC+f8/XZYWWNca7gdqzMQLreUWLFZKt5R80
         ZQO/nhwbz/Sza6YkwE9MOq/o3g0rWmNhaFr2ecO5wDRJ5hhHLQIq0k1Oo11lpUGtunZ3
         sALtaFCQNHXJ3Lt16JlgEuIwIrWno3un171f3ZZFPPcru4xlzLrq1rBfN83FCHFUnMXG
         dWD6ZY9gCZV8notk4QAEFVL6sFSHmD9nkXKAbVV1YiRbvDzYsJQ1w6NrXrJSzHxKRnfO
         Kzbw==
X-Forwarded-Encrypted: i=1; AJvYcCUJDL5ZpXYqw5PnKH1JjqCqbk7RfmaQYMg9SyfgyYvMeq4JNZd/HE7B8dWzGAWcCfv3fBQXCS6/gyQUiMc1Vw3wgZCnqapWSMowd0SBadE=
X-Gm-Message-State: AOJu0Yy7ea1OhqGv05K88Eve1OqjfwsFsMVYub8QWy+rTYH1Ca10lBMQ
	IX6agVn82Z6kzCpUSBS78YDPzeQ2dDifUtk1x0AZpRHoWXNpWJGh
X-Google-Smtp-Source: AGHT+IG/8/QYzRTa271TYIlqTEAGXscJvwOy4A7gEjcl7xDUgXpsr9S1OJCg8k2maPwiZxxr+RSomw==
X-Received: by 2002:a05:6512:39c5:b0:530:e323:b1d0 with SMTP id 2adb3069b0e04-532eda5e98dmr4196883e87.9.1723728883827;
        Thu, 15 Aug 2024 06:34:43 -0700 (PDT)
Message-ID: <48fc698708a87fed986cbb6526a6422bae488823.camel@gmail.com>
Subject: Re: [PATCH v4 6/7] xen/riscv: page table handling
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Thu, 15 Aug 2024 15:34:42 +0200
In-Reply-To: <2ded848e-f2a5-4005-b4c6-09014a92122c@suse.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
	 <8362795280a48702bef6f01d41d148edcf299935.1723214540.git.oleksii.kurochko@gmail.com>
	 <85a4e760-07af-42bd-ac27-12a4fa5172cc@suse.com>
	 <1e83981cff0b6c47aa941e7ffee0ce658aefef22.camel@gmail.com>
	 <d41f3027-14c8-4716-9444-d8bc109bb2b7@suse.com>
	 <be47249638cbae5e057279acd9a3464c218fbac8.camel@gmail.com>
	 <2ded848e-f2a5-4005-b4c6-09014a92122c@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Thu, 2024-08-15 at 14:16 +0200, Jan Beulich wrote:
> On 15.08.2024 13:21, oleksii.kurochko@gmail.com=C2=A0wrote:
> > On Thu, 2024-08-15 at 10:09 +0200, Jan Beulich wrote:
> > > On 14.08.2024 18:50, oleksii.kurochko@gmail.com=C2=A0wrote:
> > > > On Tue, 2024-08-13 at 12:31 +0200, Jan Beulich wrote:
> > > > > On 09.08.2024 18:19, Oleksii Kurochko wrote:
> > > > > > RISC-V detects superpages using `pte.x` and `pte.r`, as
> > > > > > there
> > > > > > is no specific bit in the PTE for this purpose. From the
> > > > > > RISC-V
> > > > > > spec:
> > > > > > ```
> > > > > > =C2=A0 ...
> > > > > > =C2=A0 4. Otherwise, the PTE is valid. If pte.r =3D 1 or pte.x =
=3D
> > > > > > 1, go
> > > > > > to
> > > > > > step 5.
> > > > > > =C2=A0=C2=A0=C2=A0=C2=A0 Otherwise, this PTE is a pointer to th=
e next level of
> > > > > > the
> > > > > > page
> > > > > > table.
> > > > > > =C2=A0=C2=A0=C2=A0=C2=A0 ... .
> > > > > > =C2=A0 5. A leaf PTE has been found.
> > > > > > =C2=A0=C2=A0=C2=A0=C2=A0 ...
> > > > > > =C2=A0 ...
> > > > > > ```
> > > > > >=20
> > > > > > The code doesn=E2=80=99t support super page shattering so 4KB p=
ages
> > > > > > are
> > > > > > used as
> > > > > > default.
> > > > >=20
> > > > > ... you have this. Yet still callers expecting re-mapping in
> > > > > the
> > > > > (large)
> > > > > range they map can request small-page mappings right away.
> > > > I am not sure that I fully understand what do you mean by
> > > > "expcting
> > > > re-
> > > > mapping".
> > >=20
> > > Right now you have callers pass PTE_BLOCK when they know that no
> > > small
> > > page re-mappings are going to occur for an area. What I'm
> > > suggesting
> > > is
> > > that you invert this logic: Have callers pass PTE_SMALL when
> > > there is
> > > a possibility that re-mapping requests may be issued later. Then,
> > > later, by simply grep-ing for PTE_SMALL you'll be able to easily
> > > find
> > > all candidates that possibly can be relaxed when super-page
> > > shattering
> > > starts being supported. That's going to be easier than finding
> > > all
> > > instances where PTE_BLOCK is _not_used.
> > So if I understand correctly. Actually nothing will change in
> > algorithm
> > of pt_update() and only PTE_SMALL should be introduced instead of
> > PTE_BLOCK. And if I will know that something will be better to map
> > as
> > PTE_SMALL to not face shattering in case of unmap (for example) I
> > just
> > can map this memory as PTE_SMALL and that is it?
>=20
> That is it.
>=20
> > > > > > +=C2=A0=C2=A0=C2=A0 spin_unlock(&xen_pt_lock);
> > > > >=20
> > > > > Does this really need to come after fence and flush?
> > > > I think yes, as page table should be updated only by 1 CPU at
> > > > the
> > > > same
> > > > time. And before give ability to other CPU to update page table
> > > > we
> > > > have
> > > > to finish a work on current CPU.
> > >=20
> > > Can you then explain to me, perhaps by way of an example, what
> > > will
> > > go
> > > wrong if the unlock is ahead of the flush? (I'm less certain
> > > about
> > > the
> > > fence, and that's also less expensive.)
> > pt_update() will be called for interleaved region, for example, by
> > different CPUs:
> >=20
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pt_update():
> > CPU1:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CPU2:
> > =C2=A0...=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 spin_lock(&xen_pt_lock)=
;
> > RISCV_FENCE(rw, rw);=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ....
> >=20
> > /* After this function will be
> > =C2=A0=C2=A0 executed the following thing
> > =C2=A0=C2=A0 can happen ------------------>=C2=A0 start to update page =
table
> > */=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 entries which was partiall=
y=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
> > spin_unlock(&xen_pt_lock);=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 created during CPU1 but
> > CPU2=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=20
> > ....=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 doesn't know about them
> > yet=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=20
> > ....=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 because flush_tlb() ( sfence.vma
> > )=20
> > ....=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 wasn't done=C2=A0=C2=A0=C2=A0=C2=A0=
 =C2=A0
> > ....=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0
> > =C2=A0=C2=A0=20
> > flush_tlb_range_va();
>=20
> Not exactly: CPU2 knows about them as far as the memory used /
> modified
> goes, and that's all that matters for further page table
> modifications.
> CPU2 only doesn't know about the new page table entries yet when it
> comes
> to using them for a translation (by the hardware page walker). Yet
> this
> aspect is irrelevant here, if I'm not mistaken.
And it isn't an issue that CPU2 will add these new page table entries
again during execution of CPU2's pt_update()?

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 14:34:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 14:34:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778139.1188175 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sebYT-0001av-IT; Thu, 15 Aug 2024 14:34:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778139.1188175; Thu, 15 Aug 2024 14:34:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sebYT-0001ao-Fy; Thu, 15 Aug 2024 14:34:21 +0000
Received: by outflank-mailman (input) for mailman id 778139;
 Thu, 15 Aug 2024 14:34:19 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=oSYy=PO=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sebYR-0001ai-LG
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 14:34:19 +0000
Received: from smtp-out2.suse.de (smtp-out2.suse.de
 [2a07:de40:b251:101:10:150:64:2])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 72bcc188-5b13-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 16:34:16 +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 2D9EF20022;
 Thu, 15 Aug 2024 14:34:14 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 86D1413983;
 Thu, 15 Aug 2024 14:34:13 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id mjXiGuURvmaxfAAAD6G6ig
 (envelope-from <jgross@suse.com>); Thu, 15 Aug 2024 14:34:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 72bcc188-5b13-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723732455; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references:autocrypt:autocrypt;
	bh=XLxlHyTh2163LXHFl5TkBhrvYFWDAmfmmQ4NCe5R6Ts=;
	b=ktLtFZNcy4XdGsgu/tzdSvtqomBqE0z94Orgo1o8UodT1eXqM7aUQE+TuwgVx5O2dDd/Vx
	NJPYLgsnpCWIHXJHQGhWxCAm2nCY4XwhZ5CDSkkuTTknro/b1n5A+YiS1v9Q6UWbWUpnvQ
	I7CfloNsgKlkkeFFBrX6jjrGPR6EzGo=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=KHIpwhCQ
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1723732454; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references:autocrypt:autocrypt;
	bh=XLxlHyTh2163LXHFl5TkBhrvYFWDAmfmmQ4NCe5R6Ts=;
	b=KHIpwhCQPRgSgIN6zEuZWk38WTsjKBEQAcSlglSEy6svHaziq3CYPUEI9t9Dq9jL2b3ROj
	Xivnw2Ha1mDhFKFHz2T7cSzIyAx3wM4hZMzqzukWx8jppIigPu2Rp/YoK9dpidUr8ISitP
	3m8FE/HzXwUcQbk7WG3fvc7w1prwR5M=
Message-ID: <0ac7b89a-cdcc-4097-8e53-806bf455f288@suse.com>
Date: Thu, 15 Aug 2024 16:34:12 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/5] xen: fix dom0 PV boot on some AMD machines
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Anthony PERARD <anthony.perard@citrix.com>
References: <20240807104110.18117-1-jgross@suse.com>
Content-Language: en-US
From: Juergen Gross <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <20240807104110.18117-1-jgross@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------GaB6Nfi5M70Qtpoe7dWkcG2D"
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Action: no action
X-Spamd-Result: default: False [-7.41 / 50.00];
	BAYES_HAM(-3.00)[99.99%];
	SIGNED_PGP(-2.00)[];
	DWL_DNSWL_MED(-2.00)[suse.com:dkim];
	MIME_BASE64_TEXT_BOGUS(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain];
	NEURAL_HAM_SHORT(-0.20)[-0.998];
	MIME_UNKNOWN(0.10)[application/pgp-keys];
	MIME_BASE64_TEXT(0.10)[];
	MX_GOOD(-0.01)[];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	MIME_TRACE(0.00)[0:+,1:+,2:+,3:+,4:~,5:~];
	ARC_NA(0.00)[];
	TO_DN_SOME(0.00)[];
	FROM_HAS_DN(0.00)[];
	RCPT_COUNT_FIVE(0.00)[5];
	MID_RHS_MATCH_FROM(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	DKIM_TRACE(0.00)[suse.com:+];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RCVD_TLS_ALL(0.00)[];
	HAS_ATTACHMENT(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.com:dkim,suse.com:mid]
X-Spam-Flag: NO
X-Spam-Score: -7.41
X-Spam-Level: 
X-Rspamd-Queue-Id: 2D9EF20022

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------GaB6Nfi5M70Qtpoe7dWkcG2D
Content-Type: multipart/mixed; boundary="------------30etkxsR0g4oSn85uB6B3bdZ";
 protected-headers="v1"
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Anthony PERARD <anthony.perard@citrix.com>
Message-ID: <0ac7b89a-cdcc-4097-8e53-806bf455f288@suse.com>
Subject: Re: [PATCH 0/5] xen: fix dom0 PV boot on some AMD machines
References: <20240807104110.18117-1-jgross@suse.com>
In-Reply-To: <20240807104110.18117-1-jgross@suse.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJ3BBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AAIQkQoDSui/t3IH4WIQQ+pJkfkcoLMCa4X6CgNK6L+3cgfgn7AJ9DmMd0SMJE
 ePbc7/m22D2v04iu7ACffXTdZQhNl557tJuDXZSBxDmW/tLOwU0EWTecRBAIAIK5OMKMU5R2
 Lk2bbjgX7vyQuCFFyKf9rC/4itNwhYWFSlKzVj3WJBDsoi2KvPm7AI+XB6NIkNAkshL5C0kd
 pcNd5Xo0jRR5/WE/bT7LyrJ0OJWS/qUit5eNNvsO+SxGAk28KRa1ieVLeZi9D03NL0+HIAtZ
 tecfqwgl3Y72UpLUyt+r7LQhcI/XR5IUUaD4C/chB4Vq2QkDKO7Q8+2HJOrFIjiVli4lU+Sf
 OBp64m//Y1xys++Z4ODoKh7tkh5DxiO3QBHG7bHK0CSQsJ6XUvPVYubAuy1XfSDzSeSBl//C
 v78Fclb+gi9GWidSTG/4hsEzd1fY5XwCZG/XJJY9M/sAAwUH/09Ar9W2U1Qm+DwZeP2ii3Ou
 14Z9VlVVPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------30etkxsR0g4oSn85uB6B3bdZ
Content-Type: multipart/mixed; boundary="------------D2rK9vYKqoF5RAgZy39OYVWb"

--------------D2rK9vYKqoF5RAgZy39OYVWb
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMDcuMDguMjQgMTI6NDEsIEp1ZXJnZW4gR3Jvc3Mgd3JvdGU6DQo+IFRoZXJlIGhhdmUg
YmVlbiByZXBvcnRzIG9mIGZhaWxlZCBib290cyB3aXRoIFhlbiBkdWUgdG8gYW4gb3Zlcmxh
cCBvZg0KPiB0aGUga2VybmVsJ3MgbWVtb3J5IHdpdGggQUNQSSBOVlMgcmVwb3J0ZWQgaW4g
dGhlIEU4MjAgbWFwIG9mIHRoZSBob3N0Lg0KPiANCj4gVGhpcyBzZXJpZXMgZml4ZXMgdGhp
cyBpc3N1ZSBieSBtb3ZpbmcgdGhlIE5WUyBhcmVhIGluIGRvbTAgdG8gc29tZQ0KPiBoaWdo
ZXIgYWRkcmVzcy4NCj4gDQo+IEp1ZXJnZW4gR3Jvc3MgKDUpOg0KPiAgICB4ZW46IHVzZSBj
b3JyZWN0IGVuZCBhZGRyZXNzIG9mIGtlcm5lbCBmb3IgY29uZmxpY3QgY2hlY2tpbmcNCj4g
ICAgeGVuOiBpbnRyb2R1Y2UgZ2VuZXJpYyBoZWxwZXIgY2hlY2tpbmcgZm9yIG1lbW9yeSBt
YXAgY29uZmxpY3RzDQo+ICAgIHhlbjogbW92ZSBjaGVja3MgZm9yIGU4MjAgY29uZmxpY3Rz
IGZ1cnRoZXIgdXANCj4gICAgeGVuOiBtb3ZlIG1heF9wZm4gaW4geGVuX21lbW9yeV9zZXR1
cCgpIG91dCBvZiBmdW5jdGlvbiBzY29wZQ0KPiAgICB4ZW46IHRvbGVyYXRlIEFDUEkgTlZT
IG1lbW9yeSBvdmVybGFwcGluZyB3aXRoIFhlbiBhbGxvY2F0ZWQgbWVtb3J5DQo+IA0KPiAg
IGFyY2gveDg2L3hlbi9tbXVfcHYuYyAgfCAgIDUgKy0NCj4gICBhcmNoL3g4Ni94ZW4vc2V0
dXAuYyAgIHwgMjQyICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKy0tLS0tLS0t
DQo+ICAgYXJjaC94ODYveGVuL3hlbi1vcHMuaCB8ICAgMyArLQ0KPiAgIDMgZmlsZXMgY2hh
bmdlZCwgMjAxIGluc2VydGlvbnMoKyksIDQ5IGRlbGV0aW9ucygtKQ0KPiANCg0KV2hpbGUg
dGVzdGluZyBWMiBvZiB0aGlzIHNlcmllcyBhbm90aGVyIHRob3VnaHQgY2FtZSB0byBteSBt
aW5kOg0KDQpXaGF0IGFib3V0IFBWIGd1ZXN0cyBvbiBzdWNoIGEgc3lzdGVtIHdpdGggZTgy
MF9ob3N0PTE/IEkgZ3Vlc3MgdGhvc2UNCndpbGwgaGF2ZSBhIHNpbWlsYXIgcHJvYmxlbSBh
cyBhIFBWIGRvbTAsIGFzIHRoZSBBQ1BJIE5WUyBlbnRyeSBpbiB0aGUNCm1lbW9yeSBtYXAg
d2lsbCBiZSBhdCB0aGUgc2FtZSBwb3NpdGlvbiBhcyBvbiB0aGUgaG9zdC4NCg0KU2hvdWxk
bid0IHdlIGdldCByaWQgb2YgdGhlIEFDUEkgcmVsYXRlZCBlODIwIGVudHJpZXMgaW4gdGhl
IGd1ZXN0cz8NCg0KDQpKdWVyZ2VuDQo=
--------------D2rK9vYKqoF5RAgZy39OYVWb
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-----

--------------D2rK9vYKqoF5RAgZy39OYVWb--

--------------30etkxsR0g4oSn85uB6B3bdZ--

--------------GaB6Nfi5M70Qtpoe7dWkcG2D
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/Ey8FAma+EeQFAwAAAAAACgkQsN6d1ii/Ey9e
MAf+Jj4+2Jaczqx0mVinaRMhxd4ek2EgCaWjOcVNe8Tl9HSvC2d8FBKbAvFOMxVl08vNONyC+X1H
FuHGn8sm5DXg/6aHtBEhw84dDmGxQ+olxU8xQLO2GdpneAQoKdozC2xn9purAqnoaLb8a+tVnTnt
MKEHwP2ScW8Q1eiWJHxn5jaRDK38Ic20oecz1pOa6weIfxbCSvGtteQzMomI4wrHWNv/FNNbxSAC
V+MD1ifQtL2jdaJJ+s+Bm4F6vkxLaM9nVYqZWMmpinCziSI0SbLmhduH/fjhC4v1FDhtMwa0ISZ2
15CtQr3UBxfn/ECXD29UDCOvpmKNkaqgSWZubmxJGQ==
=Y5pF
-----END PGP SIGNATURE-----

--------------GaB6Nfi5M70Qtpoe7dWkcG2D--


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 15:25:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 15:25:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778154.1188185 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1secLU-0001Cx-6b; Thu, 15 Aug 2024 15:25:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778154.1188185; Thu, 15 Aug 2024 15:25:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1secLU-0001Cq-3b; Thu, 15 Aug 2024 15:25:00 +0000
Received: by outflank-mailman (input) for mailman id 778154;
 Thu, 15 Aug 2024 15:24: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=/2Vq=PO=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1secLS-0001CH-SB
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 15:24:58 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 87603dec-5b1a-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 17:24:57 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a83597ce5beso153014266b.1
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 08:24:57 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a838396c695sm115651866b.201.2024.08.15.08.24.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 08:24:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 87603dec-5b1a-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723735496; x=1724340296; 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=FzT6iUaKspeW1WldLkRAw60hO311ITga+/GOoLem5Es=;
        b=BpniIajvn5KWQHWUfrdpqM3GSfKDpo5czCemPnel1xdgv6h2dsf6VSTvK8wakxYX1a
         BGnpJhWaHsW846FAi2tcSY9fpKJQf9mdANjcE9yk7UGbhpFoRAVyHA9oinAeMIq7akEM
         e4kkOU+KtcTfpKICGkvzTlSRCgUKwSooahWwdXGs3l5dnwchb/NRNgprnYDEA/vRm2GX
         IuABU2klgUh9bRiqJ+AHCj0YG+CeDUfp1FQ9n0huEuQbEKq5n1z2zXTedpjxzC9bakzc
         PdetkwqrPR2KxHn/n9Qsqk5cpGUlJsuSsmYWJ7bFBAxYLcRIwDE3B79DbKYNOfFXZegz
         WZYw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723735496; x=1724340296;
        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=FzT6iUaKspeW1WldLkRAw60hO311ITga+/GOoLem5Es=;
        b=O9x42g1ytYWr8zjLOv9i8xqVUPiNdRRbNKpSqkHH1oiIBh1/3dRKPFnTSsgD9sNTC2
         9BJBPhdN9yJfDSTz38l9liDV5QHooHm/KBEcTFwYbkbAK16LcQjL/+p09ec+bA/nQH0V
         NGYlh779JYc7pCCKytRQAfCHVpp6a8YzkEh7DCQ6SYnaO6oi5tnOe7G4KCyUgaV2No8l
         e4e1YY7gjt3Ztvg4xrdo31fqIB/GC7EHdL2h82tz1D6fCvYvhRnVFfXH/IZ1FfaG8AKt
         wXAe8SL1mPm81kJ6UxZuwABbR7/6ltefgwFp04eq4aMUv/uAvgbov52KyXVZAcazPF3O
         pXcw==
X-Forwarded-Encrypted: i=1; AJvYcCWGve4qc8TgHRHjyiPINoCz6vhzM+9YZkZNK3l2zy2owDfIGLPfeZlCeJfnBUrWFzWEE7f7zK1Rx9g=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy8f3k7gF4/IIe31DbZpko1I/41RyJUWk/72oBMysfOq2MUT0G4
	t7nSuLk5Pp8Pa3OVL++YT5vvpUoDo0wFy2MUbVwgDm288FTKa3YILBYAH9j7Rg==
X-Google-Smtp-Source: AGHT+IGLYTWRZTfi459e3oxLie8w69DrItn6LEuVRp0fwBhmt9qw12KuKDHRiUD6Np7dmXSFk2UGHw==
X-Received: by 2002:a17:907:2cc6:b0:a7c:d284:4f1d with SMTP id a640c23a62f3a-a837cd582d8mr276887766b.28.1723735496431;
        Thu, 15 Aug 2024 08:24:56 -0700 (PDT)
Message-ID: <989cb6e1-553f-4de6-9808-21194c6f1acd@suse.com>
Date: Thu, 15 Aug 2024 17:24:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 4/7] xen/riscv: introduce functionality to work with
 CPU info
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <452e2960d1f064a2e3abcaae1ac354f48aafd24c.1723214540.git.oleksii.kurochko@gmail.com>
 <e0285026-40c5-4316-8129-d07801a9c233@suse.com>
 <ee3a2e61435e860f1ddb6022fbb712a8d890ae3e.camel@gmail.com>
 <dfb4678f-0b2d-4d1c-be02-10c4720e57b2@suse.com>
 <2184097c00f84f707fabadff240f977827a3c927.camel@gmail.com>
 <94a72d20-07c8-4fd6-9759-5bf31d56c860@suse.com>
 <a3c60570bfe4a29e2b3cfa5ab572fb505038a6d3.camel@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: <a3c60570bfe4a29e2b3cfa5ab572fb505038a6d3.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 15.08.2024 15:29, oleksii.kurochko@gmail.com wrote:
> On Thu, 2024-08-15 at 11:02 +0200, Jan Beulich wrote:
>> On 15.08.2024 10:55, oleksii.kurochko@gmail.com wrote:
>>> On Wed, 2024-08-14 at 17:22 +0200, Jan Beulich wrote:
>>>> On 14.08.2024 16:45, oleksii.kurochko@gmail.com wrote:
>>>>> On Tue, 2024-08-13 at 10:54 +0200, Jan Beulich wrote:
>>>>>> On 09.08.2024 18:19, Oleksii Kurochko wrote:
>>>>>>> --- /dev/null
>>>>>>> +++ b/xen/arch/riscv/smp.c
>>>>>>> @@ -0,0 +1,4 @@
>>>>>>> +#include <xen/smp.h>
>>>>>>> +
>>>>>>> +/* tp points to one of these per cpu */
>>>>>>> +struct pcpu_info pcpu_info[NR_CPUS];
>>>>>>
>>>>>> And they all need setting up statically? Is there a plan to
>>>>>> make
>>>>>> this
>>>>>> dynamic (which could be recorded in a "fixme" in the
>>>>>> comment)?
>>>>> I didn't plan to make allocation of this array dynamic. I don't
>>>>> expect
>>>>> that NR_CPUS will be big.
>>>>
>>>> What is this expectation of yours based on? Other architectures
>>>> permit
>>>> systems with hundreds or even thousands of CPUs; why would RISC-V
>>>> be
>>>> different there?
>>> Based on available dev boards. ( what isn't really strong argument
>>> )
>>>
>>> I checked other architectures and they are using static allocation
>>> too:
>>>    struct cpuinfo_x86 cpu_data[NR_CPUS];
>>>    
>>>    u32 x86_cpu_to_apicid[NR_CPUS] __read_mostly =
>>>    	{ [0 ... NR_CPUS-1] = BAD_APICID };
>>>    
>>>    ... /* Arm */
>>>    
>>>    struct cpuinfo_arm cpu_data[NR_CPUS];
>>>
>>> I wanted to check to understand which one API should be used to
>>> allocate this array dynamically. xmalloc?
>>
>> As of a few days ago xvmalloc() (or friends thereof), as long as ...
>>
>>> And I am curious how I can use xmalloc() at this stage if page
>>> allocator (?) should be initialized what isn't true now.
>>
>> ... this happens late enough in the boot process. Indeed ...
>>
>>> Or just to allocate pcpu_info only for boot cpu and for other then
>>> use
>>> xmalloc()?
>>
>> ... statically allocating space for the boot CPU only is another
>> option.
>>
>>>>> I can add "fixme" but I am not really
>>>>> understand what will be advantages if pcpu_info[] will be
>>>>> allocated
>>>>> dynamically.
>>>>
>>>> Where possible it's better to avoid static allocations, of which
>>>> on
>>>> some systems only a very small part may be used. Even if you put
>>>> yourself
>>>> on the position that many take - memory being cheap - you then
>>>> still
>>>> waste cache and TLB bandwidth. Furthermore as long as struct
>>>> pcpu_info
>>>> isn't big enough (and properly aligned) for two successive array
>>>> entries
>>>> to not share cache lines, you may end up playing cacheline ping-
>>>> pong
>>>> when a CPU writes to its own array slot.
>>> Why the mentioned issues aren't work for dynamic memory? We still
>>> allocating memory for sizeof(pcpu_info) * NR_CPUS
>>
>> Why NR_CPUS? At runtime you know how may CPUs the system has you're
>> running on. You only need to allocate as much then. Just like e.g.
>> dynamically allocated CPU mask variables (cpumask_var_t) deliberately
>> use less than NR_CPUS bits unless on really big iron.
> I thought that NR_CPUS tells me how many CPU the system has.

Oh, no, that not what it says (and it really can't, being a compile time
constant) - it says how many CPUs the specific build of Xen is going to
support at most.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 15:26:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 15:26:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778162.1188196 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1secMr-0002Gp-H1; Thu, 15 Aug 2024 15:26:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778162.1188196; Thu, 15 Aug 2024 15:26:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1secMr-0002Gi-Ds; Thu, 15 Aug 2024 15:26:25 +0000
Received: by outflank-mailman (input) for mailman id 778162;
 Thu, 15 Aug 2024 15:26: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=/2Vq=PO=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1secMq-0002GT-IZ
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 15:26:24 +0000
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com
 [2a00:1450:4864:20::52d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bb196198-5b1a-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 17:26:23 +0200 (CEST)
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-5a156556fb4so1350773a12.3
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 08:26:23 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bebbe7f05dsm1010345a12.78.2024.08.15.08.26.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 08:26:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bb196198-5b1a-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723735583; x=1724340383; 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=pqfl20bKXAXhb/ludWp+7Qy3i76y1mV2/EVnviux2DE=;
        b=Bz3JpoRgaeUX70OnkFX+aEdv4yocFAw4BhYCy5Qn/+cWDUPBraHjJHXa0k4jRUnCsD
         VkI3Oisb+SnCd9txBtpsTB54F5IaV7oFjN2bJlsfxWPABnQAGjnQlZofTCfXh1rQ/dUQ
         Yw7LILx3A9moYx81K+Vk6HnEKN2Qd/cqELpzHIZXxCL+jXte6OsYh/boWcnsmZCpbMMj
         CSp22gqXxUA+7f1dG9pfUnvNjd4toaaoptX6D2JORQZn7wteLFRhc1m+SeLzsKDXNpo1
         osWkwYwmhFwS/N4UE+8ncrI4bMhKjp71c26CM0BdIAbTwKg3KqiMVw10AXo+RbgJMjkw
         6K5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723735583; x=1724340383;
        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=pqfl20bKXAXhb/ludWp+7Qy3i76y1mV2/EVnviux2DE=;
        b=N2YWyOnod3Gv2ZPNQSu/hXuR3pkJIx2DaIOl6ysej3crnWlBmaENdbkace74oKLDJf
         JWLxQ5g6/mE2KB71nRkPD6/T8RHFr5s9czHTfCVAtIfOX27lbt2+1c8CQ/ctRVNMmthV
         QiePrijCp/+IEt8P/M7IZ47QdlV3eE0JFPcyul3j1s9fF2IazP6LMOdoGlksL+tg590l
         zBZ5gORxxHQX6kFJmdColDscC0EnCMergBJiUrG/3B8XUnjAKhdAEBzrWTSONhOvqH5Q
         8GcQOq0YeWx5vNPgHyK1XfxZU9/+jBNLnUX97WCJeG5npcm7m6xSeqEh6oVx1mI7RJD5
         w5Jg==
X-Forwarded-Encrypted: i=1; AJvYcCXBnGe1K02DmNRdirbgLY8HtGvrJyzR1gYYxzV8kdEKKL+YIkRjD9NztgfKYdOQSSv3y/RLGkjYKw2B5eQy0yi7oHsEEJON0Xlnk20BkWE=
X-Gm-Message-State: AOJu0Yy6AKdVrY2q9tYMLf8N8hVmTfn/EzkpspyNW8mCG1X2ylR7lNw7
	YaSnGvC4/PJxOyX+QDnzVBf9ZoFnotARhkXO8pu7t43IyaWWFWxQme/7KCkF4w==
X-Google-Smtp-Source: AGHT+IFteGmoDPDgtq4H6FSpkf2a6WeQPwxSmR4CzjuhjnXYcAYH3ogip/PUM2SURvIb293Hz8mPFQ==
X-Received: by 2002:a05:6402:34cc:b0:5a3:e652:d59 with SMTP id 4fb4d7f45d1cf-5bea1beaa8dmr4725103a12.0.1723735583189;
        Thu, 15 Aug 2024 08:26:23 -0700 (PDT)
Message-ID: <63af73be-d95e-47d5-bfbe-7f0304118a17@suse.com>
Date: Thu, 15 Aug 2024 17:26:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 6/7] xen/riscv: page table handling
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <8362795280a48702bef6f01d41d148edcf299935.1723214540.git.oleksii.kurochko@gmail.com>
 <85a4e760-07af-42bd-ac27-12a4fa5172cc@suse.com>
 <1e83981cff0b6c47aa941e7ffee0ce658aefef22.camel@gmail.com>
 <d41f3027-14c8-4716-9444-d8bc109bb2b7@suse.com>
 <be47249638cbae5e057279acd9a3464c218fbac8.camel@gmail.com>
 <2ded848e-f2a5-4005-b4c6-09014a92122c@suse.com>
 <48fc698708a87fed986cbb6526a6422bae488823.camel@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: <48fc698708a87fed986cbb6526a6422bae488823.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 15.08.2024 15:34, oleksii.kurochko@gmail.com wrote:
> On Thu, 2024-08-15 at 14:16 +0200, Jan Beulich wrote:
>> On 15.08.2024 13:21, oleksii.kurochko@gmail.com wrote:
>>> On Thu, 2024-08-15 at 10:09 +0200, Jan Beulich wrote:
>>>> On 14.08.2024 18:50, oleksii.kurochko@gmail.com wrote:
>>>>> On Tue, 2024-08-13 at 12:31 +0200, Jan Beulich wrote:
>>>>>> On 09.08.2024 18:19, Oleksii Kurochko wrote:
>>>>>>> RISC-V detects superpages using `pte.x` and `pte.r`, as
>>>>>>> there
>>>>>>> is no specific bit in the PTE for this purpose. From the
>>>>>>> RISC-V
>>>>>>> spec:
>>>>>>> ```
>>>>>>>   ...
>>>>>>>   4. Otherwise, the PTE is valid. If pte.r = 1 or pte.x =
>>>>>>> 1, go
>>>>>>> to
>>>>>>> step 5.
>>>>>>>      Otherwise, this PTE is a pointer to the next level of
>>>>>>> the
>>>>>>> page
>>>>>>> table.
>>>>>>>      ... .
>>>>>>>   5. A leaf PTE has been found.
>>>>>>>      ...
>>>>>>>   ...
>>>>>>> ```
>>>>>>>
>>>>>>> The code doesn’t support super page shattering so 4KB pages
>>>>>>> are
>>>>>>> used as
>>>>>>> default.
>>>>>>
>>>>>> ... you have this. Yet still callers expecting re-mapping in
>>>>>> the
>>>>>> (large)
>>>>>> range they map can request small-page mappings right away.
>>>>> I am not sure that I fully understand what do you mean by
>>>>> "expcting
>>>>> re-
>>>>> mapping".
>>>>
>>>> Right now you have callers pass PTE_BLOCK when they know that no
>>>> small
>>>> page re-mappings are going to occur for an area. What I'm
>>>> suggesting
>>>> is
>>>> that you invert this logic: Have callers pass PTE_SMALL when
>>>> there is
>>>> a possibility that re-mapping requests may be issued later. Then,
>>>> later, by simply grep-ing for PTE_SMALL you'll be able to easily
>>>> find
>>>> all candidates that possibly can be relaxed when super-page
>>>> shattering
>>>> starts being supported. That's going to be easier than finding
>>>> all
>>>> instances where PTE_BLOCK is _not_used.
>>> So if I understand correctly. Actually nothing will change in
>>> algorithm
>>> of pt_update() and only PTE_SMALL should be introduced instead of
>>> PTE_BLOCK. And if I will know that something will be better to map
>>> as
>>> PTE_SMALL to not face shattering in case of unmap (for example) I
>>> just
>>> can map this memory as PTE_SMALL and that is it?
>>
>> That is it.
>>
>>>>>>> +    spin_unlock(&xen_pt_lock);
>>>>>>
>>>>>> Does this really need to come after fence and flush?
>>>>> I think yes, as page table should be updated only by 1 CPU at
>>>>> the
>>>>> same
>>>>> time. And before give ability to other CPU to update page table
>>>>> we
>>>>> have
>>>>> to finish a work on current CPU.
>>>>
>>>> Can you then explain to me, perhaps by way of an example, what
>>>> will
>>>> go
>>>> wrong if the unlock is ahead of the flush? (I'm less certain
>>>> about
>>>> the
>>>> fence, and that's also less expensive.)
>>> pt_update() will be called for interleaved region, for example, by
>>> different CPUs:
>>>
>>>                      pt_update():
>>> CPU1:                                    CPU2:
>>>  ...                                spin_lock(&xen_pt_lock);
>>> RISCV_FENCE(rw, rw);                 ....
>>>
>>> /* After this function will be
>>>    executed the following thing
>>>    can happen ------------------>  start to update page table
>>> */                                 entries which was partially     
>>> spin_unlock(&xen_pt_lock);         created during CPU1 but
>>> CPU2       
>>> ....                               doesn't know about them
>>> yet        
>>> ....                               because flush_tlb() ( sfence.vma
>>> ) 
>>> ....                               wasn't done      
>>> ....                                                               
>>>    
>>> flush_tlb_range_va();
>>
>> Not exactly: CPU2 knows about them as far as the memory used /
>> modified
>> goes, and that's all that matters for further page table
>> modifications.
>> CPU2 only doesn't know about the new page table entries yet when it
>> comes
>> to using them for a translation (by the hardware page walker). Yet
>> this
>> aspect is irrelevant here, if I'm not mistaken.
> And it isn't an issue that CPU2 will add these new page table entries
> again during execution of CPU2's pt_update()?

Add these page table entries again? That's only going to happen due to
another bug somewhere, I suppose. And it would be as much (or as little)
of an issue if that happened right after dropping the lock.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 15:41:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 15:41:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778171.1188206 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1secbO-0005SB-RJ; Thu, 15 Aug 2024 15:41:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778171.1188206; Thu, 15 Aug 2024 15:41:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1secbO-0005S4-Og; Thu, 15 Aug 2024 15:41:26 +0000
Received: by outflank-mailman (input) for mailman id 778171;
 Thu, 15 Aug 2024 15:41:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/2Vq=PO=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1secbN-0005Ry-8a
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 15:41:25 +0000
Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com
 [2a00:1450:4864:20::52c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d3bc0845-5b1c-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 17:41:24 +0200 (CEST)
Received: by mail-ed1-x52c.google.com with SMTP id
 4fb4d7f45d1cf-5bec4e00978so518882a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 08:41:24 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bebbde3eedsm1014606a12.22.2024.08.15.08.41.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 08:41:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d3bc0845-5b1c-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723736483; x=1724341283; 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=D/ly9PjWzn7OCKemxIOsBpmm4awnIvpmOMr2PNFcB5k=;
        b=etdixekH6GGeFu2pwcjYU5vWlW8bQnKoX0qMjYVYbBlfRbKJuSrayff+P3ZFFxq/RQ
         TYU4TvfgWPtpAp4kE2+DkvRzYYWObsfBPuqD/mkqx1YBGkN1clp+/Izb4tlAmIZQt7xX
         kyAh0YlB31R6WuOneHJ0HvEerVem8QRQA1MXU1H35Xzu2t2zVn6R/7+DxopR/2iDTTUF
         iOOFR6xvBzQGqoFEMiSUdey8JsAeMsPoAe/z/EdgLv74y30Hil6tPH15uLfSXVD262Jt
         0ngEBrhebGvNX30if0dwRZvd7OZSYECxc8BTWR/LBrHE5YLI0yYxhd3v/wro0rluBBRn
         EB4Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723736484; x=1724341284;
        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=D/ly9PjWzn7OCKemxIOsBpmm4awnIvpmOMr2PNFcB5k=;
        b=n16z3nuIXc21i3DWPNonIHSiVjvGNYTC0nDG257UaeCfcPDoFQfGi/PkQn0XJ4fJ/l
         oYEvwntICZ8Bp7m7NdKKAqFBko9koQm20F7hENPvqcvhev/is1ynIyoDm2P/U3bpbc8b
         EP83BCBjKpLYnoc4aH4bjT2auYBNBx8sa9QW4uoMGTFDIiZ/t3ozTDeHMBCAwM4Z0lVK
         wHb6tAWtqgMNwSMF9YP93Do88VAtoDjbpNRX820E/u/svqOvgnBvaNWlon163WFVMviA
         pyae3g1FDTlvzowEf3GeX3OGxbMjqPDAO5NNR6Eea1uC3VsA9MXDQy/icx234II6Qto9
         NaFw==
X-Forwarded-Encrypted: i=1; AJvYcCXk68hlJ/IRZ5S6ooT+JPRyXAWdI4JkG06EM7RoOiOzIRpfMVmfU4PX1Z91j70Lum55fiPDE+ag6qH5yOSLvoBAun/E7Dju2OLsRQsvYMQ=
X-Gm-Message-State: AOJu0YxCBZLUrmqbRMbjC6WTIT+c1HL0MkmrqlHXkJyWDGdsbYsRqk4w
	N+a9k7drb1k4LB5CWCYwrIz8pcGOzcKz1RacTGrHoFHPfQxYKPKbjSUB3Q2g0Q==
X-Google-Smtp-Source: AGHT+IH66YCCoywVaXztktMMeARko3T2vGcaFZAScw3WqLPi/9csXn5HtPHs1yfCrpweZ0VQQnmgdg==
X-Received: by 2002:a05:6402:d0b:b0:5a2:ec88:de7a with SMTP id 4fb4d7f45d1cf-5bea1cb20e9mr5203461a12.33.1723736483522;
        Thu, 15 Aug 2024 08:41:23 -0700 (PDT)
Message-ID: <82f78de2-3d93-4e51-a845-5bb96559a4cf@suse.com>
Date: Thu, 15 Aug 2024 17:41:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/3] x86/pv: Introduce x86_merge_dr6() and fix
 do_debug()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240815131600.4037415-1-andrew.cooper3@citrix.com>
 <20240815131600.4037415-2-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240815131600.4037415-2-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 15.08.2024 15:15, Andrew Cooper wrote:
> Pretty much everywhere in Xen the logic to update %dr6 when injecting #DB is
> buggy.  The architectural behaviour is to overwrite B{0..3} (rather than
> accumulate) and accumulate all other bits.

Just to double check (after 6 years I clearly don't recall anything that isn't
written down in the description): The SDM pretty vaguely says "Certain debug
exceptions may clear bits 0-3." What other information sources are there to
make this less uncertain? (Picking an old hardcopy from the shelf, that
confirms that long ago DR6 was indeed documented as all sticky.)

Jan



From xen-devel-bounces@lists.xenproject.org Thu Aug 15 15:45:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 15:45:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778180.1188216 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1secfc-000623-CQ; Thu, 15 Aug 2024 15:45:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778180.1188216; Thu, 15 Aug 2024 15:45:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1secfc-00061w-8Z; Thu, 15 Aug 2024 15:45:48 +0000
Received: by outflank-mailman (input) for mailman id 778180;
 Thu, 15 Aug 2024 15:45:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/2Vq=PO=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1secfa-00061n-G2
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 15:45:46 +0000
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com
 [2a00:1450:4864:20::529])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6f888297-5b1d-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 17:45:45 +0200 (CEST)
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5a10835487fso1637103a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 08:45:45 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bebbbe5a74sm1029510a12.16.2024.08.15.08.45.44
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 08:45:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6f888297-5b1d-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723736745; x=1724341545; 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=v9UHmhzgadTs0ncnwXKJLRaITtMt8CBWojav1t41wjY=;
        b=fP1TrlZWyQazOfjAabyhoB4nrDgFslqs/ZAhqWbu/cYYEh90Eddfi6DsD1JKtn54F7
         akEtIgg0OZXcm8q0UnqcMnHBmvFK4EWAbi3jhRehAqLLc4DES295HGSVNHzQDjAkD2Oi
         06sVGK7z/1xbj0Rfn1rDA1XsyUBMnDRWWmTyYC0K/U+7CSz6mMlkGCcz1BLCLWSkp1tm
         zEuFnyFE7G+L43YqB0G5g0Ctarto9LMa1aSJti3AfnK/Fugt7OqMQuNvCR85QDroarqt
         Cq2Y2EjdbLfMfHxKMe6P4cLgLr1OfnmXofp9oR7L+lRo2uJ++LweRJMsQceS09rm0H/K
         WPfA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723736745; x=1724341545;
        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=v9UHmhzgadTs0ncnwXKJLRaITtMt8CBWojav1t41wjY=;
        b=q7Ho+aNtddLfX2p6isyrkGx/yIMBiyNSUN4wmupbdQAne9UMzQgiZdw3LSioq5GdTw
         EeqEwCQREq4yr6VJLvqW48u9EIDgium2TccUyzUzZVV+F0M71MqD9YTgZS9HfmgsCgsC
         /ums7rhxl2aR27aKKUDZiOzHvFmJIyZ1pG2pNBi885/Xs7p/yhO+AfrgvTukOl8my7XQ
         C7grNvKhZ5X/0dHZfPQNR03M4Gw8nOx/WmODYkMf8xVXBlGpDZ19xU8yQ6BVmPjwsJLC
         hR7D47cjaHyTk6S/G9TR0nU4ElE7VnHcuFXtohRmZzvwjmULAPDJAdJyASLWmNOS+3ne
         380A==
X-Forwarded-Encrypted: i=1; AJvYcCUKQnBRbucbttBNAPqxu/380wE5uz7o/A8/WOF7efMmz6wYKNRbEU6m4uOiQOikD6tcBKu6nddVV2gOU3GOJoRyrB9htHeNDeSv/DqDTzc=
X-Gm-Message-State: AOJu0YxEyPQEHBBqcyDEsUeHVzQ9gCZG4wyyMk7kyPd9kZQkkAdG5A5X
	y8dnp76OTMLUp2kM/oithexTNmJjrvVsUUaxMVfkuLC3q8Jgl/f7J4yYAccXkg==
X-Google-Smtp-Source: AGHT+IEqlwHWKhsOY7A+LLM4puFB9HT/QgSy48V0S5rMNEEzfWLXo1PBdsGkokTHvsILyH3vhKMguw==
X-Received: by 2002:a05:6402:26ce:b0:5a2:6350:75ac with SMTP id 4fb4d7f45d1cf-5bea1c69951mr4596057a12.8.1723736744981;
        Thu, 15 Aug 2024 08:45:44 -0700 (PDT)
Message-ID: <7a5c6c8c-701e-436e-9e76-afc6fa59a886@suse.com>
Date: Thu, 15 Aug 2024 17:45:43 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 3/3] x86/pv: Address Coverity complaint in
 check_guest_io_breakpoint()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Matthew Barnes <matthew.barnes@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240815131600.4037415-1-andrew.cooper3@citrix.com>
 <20240815131600.4037415-4-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 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: <20240815131600.4037415-4-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 15.08.2024 15:16, Andrew Cooper wrote:
> Commit 08aacc392d86 ("x86/emul: Fix misaligned IO breakpoint behaviour in PV
> guests") caused a Coverity INTEGER_OVERFLOW complaint based on the reasoning
> that width could be 0.
> 
> It can't, but digging into the code generation, GCC 8 and later (bisected on
> gotbolt) choose to emit a CSWITCH lookup table, and because the range (bottom
> 2 bits clear), it's a 16-entry lookup table.
> 
> So Coverity is correct, given that GCC did emit a (dead) logic path where
> width stayed 0.
> 
> Rewrite the logic.  Introduce x86_bp_width() which compiles to a single basic
> block, which replaces the switch() statement.  Take the opportunity to also
> make start and width be loop-scope variables.
> 
> No practical change, but it should compile better and placate Coverity.
> 
> Fixes: 08aacc392d86 ("x86/emul: Fix misaligned IO breakpoint behaviour in PV guests")
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Thu Aug 15 16:07:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 16:07:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778193.1188225 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sed0A-0002by-06; Thu, 15 Aug 2024 16:07:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778193.1188225; Thu, 15 Aug 2024 16:07:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sed09-0002br-T6; Thu, 15 Aug 2024 16:07:01 +0000
Received: by outflank-mailman (input) for mailman id 778193;
 Thu, 15 Aug 2024 16:07:01 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=/2Vq=PO=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sed09-0002bk-7y
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 16:07:01 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 668f18c1-5b20-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 18:06:59 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5a108354819so1565111a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 09:06:59 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838c73e6sm123125466b.11.2024.08.15.09.06.57
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 09:06:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 668f18c1-5b20-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723738018; x=1724342818; 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=jp7o1v79sFfIfoN/jQ1NeqSfppz7IEEWYb14Sx2Xics=;
        b=bUrdRpws/D6WrdtSJ0ghP3eHzW2fynurz8wSLHq+vJqJ2q+fVbco55agmxcsyRVC1i
         wlJY761lBCACa/47CqznLbUx64b9oTo7Lwt5EzWxB3vjgBIXFeo/+u8FOgsd4rkgXdBe
         iLroFaN4ZZMDBEx+43vIWcYeRtjRlZOJkyA3w5y30rbPFgw33/x7UiNWy1Iyh06/saPt
         RV0+/hcNPsmcYYU9yvwGHX11WMni8im+kJv4Jv1HLSiOX/xvWU+7t7F0BkyspmnnC+tG
         iFBD6vQbArTmgbgdSeZnh3v1wHRuDoVxAoCflDt7rknKqI+jqjb8jF94SJLM1WF1qNlm
         nsZA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723738018; x=1724342818;
        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=jp7o1v79sFfIfoN/jQ1NeqSfppz7IEEWYb14Sx2Xics=;
        b=n0BJop2JeP5M0ADsp3EQTx1e3SugF9FXW20j85HjbasxAhlilCO+6xtnyUZaYqREqX
         cFqWyghznXNOTZiGXu1Dp5JXn9xr2Qw2yCKBigHHD9X4VqgjVER1hmiYGxfr2YPq+ldq
         +2OVPxAmMa0+k/k72LFwIutdF2MWlHolhsqCFDd3d1FCfoD1AKiWyK4wO1HmhOTRuVGm
         MckY4ws+p6QdhnqYwLkxZpRkGARZV6o+L7nMwJfWdZ+yQ4iNaKTbht6RZ+WikkG3Ae3i
         fSXEQfM63m8/qCT8egGRaN07Gub4K3CiKfJRKI49vuQePxSSpoutDRhittSl36Vc8j8N
         5Ovg==
X-Forwarded-Encrypted: i=1; AJvYcCVayjGbneASUsgNz6xrxpFWnOx0ZbyJYpKb8DmVoKCYOQM88Xr/M7hGB2Pr6NsJmjRnDwcL/b+gqCc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YySvCf8E95pWlyjXgtgRHox4exS++qylizP8QqyKUoxtQtbiZLM
	grXK+hjJ2rJDADQPeDBUqA16aY1qbvtYSRjg5XSQatWQ/5UYNXLXQuGwLJJahA==
X-Google-Smtp-Source: AGHT+IE9kbhfrLs4LxRHd7jBOEn1wOulw52u69q/iEFLzTlgKlXbCdPFsCisx/NRJwIX64veLWInLw==
X-Received: by 2002:a17:907:e87:b0:a7a:af5d:f313 with SMTP id a640c23a62f3a-a83928d438bmr4925666b.22.1723738018327;
        Thu, 15 Aug 2024 09:06:58 -0700 (PDT)
Message-ID: <896cb71c-f760-4ce9-a3bc-98c984a572cc@suse.com>
Date: Thu, 15 Aug 2024 18:06:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/cpufeatures: Add new cpuid features in SPR to
 featureset
To: Matthew Barnes <matthew.barnes@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 xen-devel@lists.xenproject.org
References: <09353a67d79b12f2ff2a9be797866902bcd71825.1723650205.git.matthew.barnes@cloud.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: <09353a67d79b12f2ff2a9be797866902bcd71825.1723650205.git.matthew.barnes@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 14.08.2024 17:52, Matthew Barnes wrote:
> --- a/xen/include/public/arch-x86/cpufeatureset.h
> +++ b/xen/include/public/arch-x86/cpufeatureset.h
> @@ -121,6 +121,7 @@ XEN_CPUFEATURE(SMX,           1*32+ 6) /*   Safer Mode Extensions */
>  XEN_CPUFEATURE(EIST,          1*32+ 7) /*   Enhanced SpeedStep */
>  XEN_CPUFEATURE(TM2,           1*32+ 8) /*   Thermal Monitor 2 */
>  XEN_CPUFEATURE(SSSE3,         1*32+ 9) /*A  Supplemental Streaming SIMD Extensions-3 */
> +XEN_CPUFEATURE(SDGB,          1*32+11) /*   Silicon Debugging */

There looks to be a typo here - SDBG is what the SDM says. I also think the
comment might better mention the MSR this controls (IA32_DEBUG_INTERFACE),
as "Silocon Debugging" may mean a lot of different things.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 16:34:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 16:34:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778201.1188236 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sedQs-0007PJ-3t; Thu, 15 Aug 2024 16:34:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778201.1188236; Thu, 15 Aug 2024 16:34:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sedQr-0007PC-WB; Thu, 15 Aug 2024 16:34:37 +0000
Received: by outflank-mailman (input) for mailman id 778201;
 Thu, 15 Aug 2024 16:34:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=aZnf=PO=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sedQr-0007P6-9J
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 16:34:37 +0000
Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com
 [2a00:1450:4864:20::12c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 41a216c4-5b24-11ef-a505-bb4a2ccca743;
 Thu, 15 Aug 2024 18:34:35 +0200 (CEST)
Received: by mail-lf1-x12c.google.com with SMTP id
 2adb3069b0e04-52efd855adbso1414578e87.2
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 09:34:35 -0700 (PDT)
Received: from [192.168.1.10] (host-92-26-98-202.as13285.net. [92.26.98.202])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5330d41ebcfsm249614e87.210.2024.08.15.09.34.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 09:34:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 41a216c4-5b24-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1723739674; x=1724344474; 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=+iEOz9MicmZ03FK4UPErL66CN7WBu644q2pc4XhEk+A=;
        b=TOOrzV76B+hKG+vASymg7dzhELhjaQbhDdUBhb0nR+7cwkVD5apoHimkNlKHujVamY
         SLj2/Fr4T82oNbXphCXXnAmhZfHBkneANm0ZEAsqMa0X7PzHfmDHKb5f7jAzUwJ1Kn3s
         URGzcY2Jnp7d7vOnXePuVSqUuuG0CZcovy0D0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723739674; x=1724344474;
        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=+iEOz9MicmZ03FK4UPErL66CN7WBu644q2pc4XhEk+A=;
        b=jS5uGKLdJ92WM9idpTsenrqtCf5gfv+A9nk32w218BU7TE3vk98qHbIUZiqpEIEa9H
         rAqdQj5Skaj8//eV1D8hyZpFCTuhbiOAGCcCG98sAGNuQCk1F+nua1iJF8XObuKoU+2D
         sLH8jAMIsGyvvcEbzWpB2VrLwhPgaAJnf21ONyvKlcdH+2el5ZjCBtWLk5lmP8sUtraf
         tJVHRY9VCq6NXzyiSqYvanhM3oSqHcI9vAFbtF12zeUnq8/lCtbd2LQcUX5vnptnmT+7
         00HFK6Fde0gouZmn3wlfy9RbSqd1lI1LtMOzfluwVy3y89jztwVjNs7+15rcvAAX3QaS
         QrPg==
X-Forwarded-Encrypted: i=1; AJvYcCU4QSnZDIW3eB25OTfeEo5T6DPIjwCzW5nqDmlkbRScGKaGFL/4YMvdsaiPW3euGlcSh7p+9qz+krfhC8WATplKCaQx0ezq8UgLX/jlmAo=
X-Gm-Message-State: AOJu0YznDl+MV3H4yA65pMg6TRXUul3giQbVvId+EZ/vbtVkS1PTy7O1
	R5rtJNcqZ4upR0fFhtXjughntFUtxXGvd6JzUtkzzppOorq1mp6F/z87VKRoyBY=
X-Google-Smtp-Source: AGHT+IHJ3/3nukS+NoXJmG54wXF5NODRBmR84fNJJ450h1zGbdraLNaWqkGqJllUBQwXneYmDhzhqA==
X-Received: by 2002:a05:6512:224e:b0:533:c9d:a01b with SMTP id 2adb3069b0e04-5331c6b0b39mr8984e87.29.1723739674339;
        Thu, 15 Aug 2024 09:34:34 -0700 (PDT)
Message-ID: <c02c15d6-9f59-41ff-aaf5-499bfffe4b8e@citrix.com>
Date: Thu, 15 Aug 2024 17:34:31 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/3] x86/pv: Introduce x86_merge_dr6() and fix
 do_debug()
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240815131600.4037415-1-andrew.cooper3@citrix.com>
 <20240815131600.4037415-2-andrew.cooper3@citrix.com>
 <82f78de2-3d93-4e51-a845-5bb96559a4cf@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <82f78de2-3d93-4e51-a845-5bb96559a4cf@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 15/08/2024 4:41 pm, Jan Beulich wrote:
> On 15.08.2024 15:15, Andrew Cooper wrote:
>> Pretty much everywhere in Xen the logic to update %dr6 when injecting #DB is
>> buggy.  The architectural behaviour is to overwrite B{0..3} (rather than
>> accumulate) and accumulate all other bits.
> Just to double check (after 6 years I clearly don't recall anything that isn't
> written down in the description): The SDM pretty vaguely says "Certain debug
> exceptions may clear bits 0-3." What other information sources are there to
> make this less uncertain? (Picking an old hardcopy from the shelf, that
> confirms that long ago DR6 was indeed documented as all sticky.)

Well, "talking with the architects", but as always "it's complicated".

The debug infrastructure has had several breaking changes in it over the
years (e.g. the reserved bits didn't use to be f's), and this one
probably changed with the introduction of superscalar pipelines.  That
said, I don't think I've ever found a Spec Update / Revision Guide that
doesn't have one "oops we don't do breakpoints properly in this case"
erratum listed.

I'm informed it's "most going on all exceptions" these days, and the
behaviour here did come mostly from my discussions about XSA-308 (or
rather, the pre-security angle where it was just a bugfix) with Intel.

A guest that does clear the status bits every #DB won't notice, and one
that doesn't will have problems on real hardware.

But I can reword if if you'd prefer?

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 18:02:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 18:02:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778226.1188298 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seenV-0005UP-FR; Thu, 15 Aug 2024 18:02:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778226.1188298; Thu, 15 Aug 2024 18:02:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seenV-0005UI-Ch; Thu, 15 Aug 2024 18:02:05 +0000
Received: by outflank-mailman (input) for mailman id 778226;
 Thu, 15 Aug 2024 18:02:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seenT-0005Sf-H6; Thu, 15 Aug 2024 18:02:03 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seenT-00016u-FP; Thu, 15 Aug 2024 18:02:03 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seenS-0007gn-Vi; Thu, 15 Aug 2024 18:02:03 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1seenS-0000jB-V6; Thu, 15 Aug 2024 18:02:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=/MSWDKOKBabYUgvWUYagLvhgnOiJXdeQ17QADdPUoII=; b=S0FnXqi85WVwOmgyoJchzGdiMb
	FCSJoIIHDYle1f9ZlDr8ifU+QEHj7hCfNQK7A7SG9GHiROEmKBGYCbeQ8/5+JgoYzpJFlVS2ymzq6
	KZKsDy6OYJYaq68brqLt48kLdn3LHHSZZuh2E7tLX3ZyqqWRSyLSee3LqswDUknswFPc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187246-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187246: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:guest-start/debianhvm.repeat:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=cbe73b848286f1e6b855c0ba328d56e0014d19e6
X-Osstest-Versions-That:
    xen=98a462f8b169f93ab7463023f0ed94575f8225b4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 15 Aug 2024 18:02:02 +0000

flight 187246 xen-unstable real [real]
flight 187249 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187246/
http://logs.test-lab.xenproject.org/osstest/logs/187249/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 20 guest-start/debianhvm.repeat fail pass in 187249-retest

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187235
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187235
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187235
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187235
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187235
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187235
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  cbe73b848286f1e6b855c0ba328d56e0014d19e6
baseline version:
 xen                  98a462f8b169f93ab7463023f0ed94575f8225b4

Last test of basis   187235  2024-08-14 01:53:53 Z    1 days
Testing same since   187246  2024-08-14 21:40:56 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alejandro Vallejo <alejandro.vallejo@cloud.com>
  Andrew Cooper <andrew.cooper3@citrix.com>
  Anthony PERARD <anthony.perard@vates.tech>
  Edgar E. Iglesias <edgar.iglesias@amd.com>
  Jan Beulich <jbeulich@suse.com>
  John E. Krokes <mag@netherworld.org>
  Juergen Gross <jgross@suse.com>
  Julien Grall <jgrall@amazon.com>
  Michal Orzel <michal.orzel@amd.com>
  Oleksii Kurochko <oleksii.kurochko@gmail.com>
  Paul Durrant <paul@xen.org>
  Rahul Singh <rahul.singh@arm.com>
  Roger Pau Monné <roger.pau@citrix.com>
  Sergiy Kibrik <Sergiy_Kibrik@epam.com>
  Stefano Stabellini <stefano.stabellini@amd.com>
  Teddy Astie <teddy.astie@vates.tech>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   98a462f8b1..cbe73b8482  cbe73b848286f1e6b855c0ba328d56e0014d19e6 -> master


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 18:12:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 18:12:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778248.1188332 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seexN-0007rM-P2; Thu, 15 Aug 2024 18:12:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778248.1188332; Thu, 15 Aug 2024 18:12:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seexN-0007rF-L1; Thu, 15 Aug 2024 18:12:17 +0000
Received: by outflank-mailman (input) for mailman id 778248;
 Thu, 15 Aug 2024 18:12:16 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seexM-0007r5-Aj; Thu, 15 Aug 2024 18:12:16 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seexM-0001Ip-7E; Thu, 15 Aug 2024 18:12:16 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seexL-0007us-KP; Thu, 15 Aug 2024 18:12:15 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1seexL-0004eI-Jr; Thu, 15 Aug 2024 18:12:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=25J8XLUHd4yQ23kLR05whGPPEl3CHH00jAZiBC27cWM=; b=KtYIz4aHPvNLT89sfPYYpN9i+i
	hru7sHYjJfjEObZ1RkDNk37D/74kxdMfenkF03oTpZ8ZBswfn1kY3+zroN0rp6RAhdlTHHFdzWmZv
	ziUtMF3gAsl08whLMyyO4YMmfGpwTs1nQyLHUlz3Cuzcs2wLGaHkbCYuc+GKvYPq00UA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187247-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187247: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=f547c76bc53d676949ac44e17c311c33c7a74d3f
X-Osstest-Versions-That:
    libvirt=03852c85af3c531d1459573341537d1cc8e4b3c6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 15 Aug 2024 18:12:15 +0000

flight 187247 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187247/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187238
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 libvirt              f547c76bc53d676949ac44e17c311c33c7a74d3f
baseline version:
 libvirt              03852c85af3c531d1459573341537d1cc8e4b3c6

Last test of basis   187238  2024-08-14 04:19:02 Z    1 days
Testing same since   187247  2024-08-15 04:22:24 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Göran Uddeborg <goeran@uddeborg.se>
  Peter Krempa <pkrempa@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   03852c85af..f547c76bc5  f547c76bc53d676949ac44e17c311c33c7a74d3f -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 20:08:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 20:08:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778266.1188342 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seglv-00006o-Ol; Thu, 15 Aug 2024 20:08:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778266.1188342; Thu, 15 Aug 2024 20:08:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seglv-00006h-M5; Thu, 15 Aug 2024 20:08:35 +0000
Received: by outflank-mailman (input) for mailman id 778266;
 Thu, 15 Aug 2024 20:08:34 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=l8AG=PO=m5p.com=ehem@srs-se1.protection.inumbo.net>)
 id 1seglu-00006b-Nu
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 20:08:34 +0000
Received: from mailhost.m5p.com (mailhost.m5p.com [74.104.188.4])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 23c166e8-5b42-11ef-8776-851b0ebba9a2;
 Thu, 15 Aug 2024 22:08:32 +0200 (CEST)
Received: from m5p.com (mailhost.m5p.com [IPv6:2001:470:8ac4:0:0:0:0:f7])
 by mailhost.m5p.com (8.18.1/8.17.1) with ESMTPS id 47FK8Kd2040787
 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO);
 Thu, 15 Aug 2024 16:08:25 -0400 (EDT) (envelope-from ehem@m5p.com)
Received: (from ehem@localhost)
 by m5p.com (8.18.1/8.15.2/Submit) id 47FK8JXf040786;
 Thu, 15 Aug 2024 13:08:19 -0700 (PDT) (envelope-from ehem)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 23c166e8-5b42-11ef-8776-851b0ebba9a2
Date: Thu, 15 Aug 2024 13:08:19 -0700
From: Elliott Mitchell <ehem+xen@m5p.com>
To: =?iso-8859-1?Q?J=FCrgen_Gro=DF?= <jgross@suse.com>
Cc: Andrei Semenov <andrei.semenov@vates.tech>, xen-devel@lists.xenproject.org,
        Andrew Cooper <andrew.cooper3@citrix.com>,
        Roger Pau =?iso-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>
Subject: Re: AMD EPYC virtual network performances
Message-ID: <Zr5gMxp0zKC8cCwO@mattapan.m5p.com>
References: <959bbf84-24da-4da3-a059-dc1aa32b27ef@vates.tech>
 <352bba40-27fc-416b-985f-20e66c0c4b72@suse.com>
 <Zrqykdarr7JHaeOZ@mattapan.m5p.com>
 <ab4ca68e-ec1b-467f-9b89-38f63cc19b7c@suse.com>
 <ZruckufSjT0GkpJt@mattapan.m5p.com>
 <d556e168-8542-4b93-81a9-a7054b5b69ba@suse.com>
 <Zrvf5wgm6xEI63x2@mattapan.m5p.com>
 <e95ab71d-b985-4ab7-994b-1c562efd5f9f@suse.com>
 <Zr0S-2QBf3lkBkfS@mattapan.m5p.com>
 <07396e04-1def-447a-b83b-ffe3a5b01fbe@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <07396e04-1def-447a-b83b-ffe3a5b01fbe@suse.com>
X-Spam-Status: No, score=0.3 required=10.0 tests=KHOP_HELO_FCRDNS autolearn=no
	autolearn_force=no version=4.0.1
X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on mattapan.m5p.com

On Thu, Aug 15, 2024 at 10:33:52AM +0200, Jrgen Gro wrote:
> On 14.08.24 22:26, Elliott Mitchell wrote:
> > On Wed, Aug 14, 2024 at 08:15:38AM +0200, Jrgen Gro wrote:
> > > On 14.08.24 00:36, Elliott Mitchell wrote:
> > > > 
> > > > Drat.  I haven't noticed much, which would match with simply enabling a
> > > > bunch of debugging printk()s (alas I'm not monitoring performance closely
> > > > enough to be sure).  Guess I wait for Andrei Semenov to state a comfort
> > > > level with trying "iommu=debug".
> > > 
> > > You didn't answer my question.
> > 
> > I guess I did not explicitly do so.  I was referring to the Xen
> > command-line option.
> 
> And again you didn't supply the information I asked for (command line
> options of Xen and dom0).

I had thought that was aimed at the initial reporter, Andrei Semenov.
I've already supplied all options which could plausibly effect this.

Xen: placeholder watchdog=true loglvl=info iommu=debug iommu=no-intremap cpuidle dom0_mem=... no-real-mode edd=off

Linux; placeholder root=... ro concurrency=none vga=normal xen_pciback.hide=... net.ifname=1 nomodeset blacklist=...

Somehow the others really don't seem likely to effect either issue as
they don't effect interrupts (okay some drivers don't get loaded, but
those drivers would render the problem irreproduceable).

> Did you consider that asking for help while not supplying data which has
> been asked for is going to result in no help at all? You are wasting the
> time of volunteers, which will reduce the motivation to look into your
> issue a lot.

Sorry about being a bit inconsistent, but there is little I can do in
the short-term about that.  I would *strongly* prefer to keep information
protected (PGP).  Large commercial installations have a rather different
risk/privacy threshold.

It is also notable that I am not the sole reporter of any of these
issues.


My speculation was wrong, the "CPU*: No irq handler for vector..."
messages are not strictly tied to the HVM domain.  I think I'm simply
reproducing what Andrei Semenov observed, HVM domains are more severely
effected by this issue.

I think I need to repeat an earlier observation of mine.  It is NOT just
vifs being effected by this, event channels associated with virtual
block-devices are also seeing spurious interrupts though at a lower rate.

What comes to mind is vifs would generate interrupts at a much greater
rate than vbds.  I kind of suspect a timing issue involving closely
spaced interrupt.  I wonder if there is a simple timing issue with the
vif/vbd protocol.  Problem is how would these turn into spurious
interrupts observed by Xen?  (I had suspected Qemu for the HVM domain,
but that was disproven)


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445




From xen-devel-bounces@lists.xenproject.org Thu Aug 15 22:51:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 22:51:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778287.1188352 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sejIv-0007rt-Rt; Thu, 15 Aug 2024 22:50:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778287.1188352; Thu, 15 Aug 2024 22:50:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sejIv-0007rm-O7; Thu, 15 Aug 2024 22:50:49 +0000
Received: by outflank-mailman (input) for mailman id 778287;
 Thu, 15 Aug 2024 22:50:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sejIu-0007rc-Hz; Thu, 15 Aug 2024 22:50:48 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sejIu-0006WV-As; Thu, 15 Aug 2024 22:50:48 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sejIt-0001db-Og; Thu, 15 Aug 2024 22:50:47 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sejIt-0002A0-O3; Thu, 15 Aug 2024 22:50:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=RMLIbj5MoInxzRjAItYCx5iDUIB9fPBqF5h1ccyTtv8=; b=fpd7P+lbfOva3fA0xwhSe4SCxq
	VLabMEA0VJX4Byr1CHHZUC+u5GTf7rSfHfyemyLWzTAIdHYjxgTu52ujbweqwGkgKpoq45xz06vVA
	1JFPi77aiXG+DmGwu4Fl248KgbSJVQ/O4CULodQpe1C5kD23ObjIi0tiYEYG2EfpokGU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187248-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-6.1 test] 187248: FAIL
X-Osstest-Failures:
    linux-6.1:test-armhf-armhf-xl-credit2:<job status>:broken:regression
    linux-6.1:test-armhf-armhf-xl-credit2:host-install(5):broken:heisenbug
    linux-6.1:test-armhf-armhf-libvirt-vhd:guest-start/debian.repeat:fail:heisenbug
    linux-6.1:test-armhf-armhf-xl-arndale:xen-boot:fail:heisenbug
    linux-6.1:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=117ac406ba904da738fb79a3b2c96d4a385292c1
X-Osstest-Versions-That:
    linux=36790ef5e00b69ccb92817f95ba1928eea24eebb
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 15 Aug 2024 22:50:47 +0000

flight 187248 linux-6.1 real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187248/

Failures and problems with tests :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-xl-credit2     <job status>                 broken  in 187241

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-credit2  5 host-install(5) broken in 187241 pass in 187248
 test-armhf-armhf-libvirt-vhd 17 guest-start/debian.repeat fail in 187241 pass in 187248
 test-armhf-armhf-xl-arndale   8 xen-boot                   fail pass in 187241

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-arndale 15 migrate-support-check fail in 187241 never pass
 test-armhf-armhf-xl-arndale 16 saverestore-support-check fail in 187241 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187211
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187211
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187211
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187211
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187211
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187211
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                117ac406ba904da738fb79a3b2c96d4a385292c1
baseline version:
 linux                36790ef5e00b69ccb92817f95ba1928eea24eebb

Last test of basis   187211  2024-08-11 10:42:52 Z    4 days
Testing same since   187241  2024-08-14 12:15:39 Z    1 days    2 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alex Deucher <alexander.deucher@amd.com>
  Alex Hung <alex.hung@amd.com>
  Alexander Gordeev <agordeev@linux.ibm.com>
  Andi Kleen <ak@linux.intel.com>
  Andi Shyti <andi.shyti@kernel.org>
  Andrew Morton <akpm@linux-foundation.org>
  Andrey Konovalov <andreyknvl@gmail.com>
  Anna Schumaker <Anna.Schumaker@Netapp.com>
  Anton Khirnov <anton@khirnov.net>
  Arnaldo Carvalho de Melo <acme@redhat.com>
  Arseniy Krasnov <avkrasnov@salutedevices.com>
  Bart Van Assche <bvanassche@acm.org>
  Benjamin Coddington <bcodding@redhat.com>
  Besar Wicaksono <bwicaksono@nvidia.com>
  Bharath SM <bharathsm@microsoft.com>
  Bjorn Helgaas <bhelgaas@google.com>
  Bjørn Mork <bjorn@mork.no>
  Bob Zhou <bob.zhou@amd.com>
  Boqun Feng <boqun.feng@gmail.com>
  Catalin Marinas <catalin.marinas@arm.com>
  Chandan Babu R <chandanbabu@kernel.org>
  Cheng-Jui Wang <cheng-jui.wang@mediatek.com>
  Chi Zhiling <chizhiling@kylinos.cn>
  Chris Wulff <crwulff@gmail.com>
  Christoph Hellwig <hch@lst.de>
  ChromeOS CQ Test <chromeos-kernel-stable-merge@google.com>
  Csókás, Bence <csokas.bence@prolan.hu>
  Curtis Malainey <cujomalainey@chromium.org>
  Damien Le Moal <dlemoal@kernel.org>
  Dan Williams <dan.j.williams@intel.com>
  Daniel Borkmann <daniel@iogearbox.net>
  Daniel Lezcano <daniel.lezcano@linaro.org>
  Daniel Wheeler <daniel.wheeler@amd.com>
  Daniele Palmas <dnlplm@gmail.com>
  Darrick J. Wong <djwong@kernel.org>
  David Hildenbrand <david@redhat.com>
  David S. Miller <davem@davemloft.net>
  David Sterba <dsterba@suse.com>
  Dmitry Antipov <dmantipov@yandex.ru>
  Dragan Simic <dsimic@manjaro.org>
  Dragos Tatulea <dtatulea@nvidia.com>
  Dustin L. Howett <dustin@howett.net>
  Eric Dumazet <edumazet@google.com>
  Fangzhi Zuo <Jerry.Zuo@amd.com>
  Feng Tang <feng.tang@intel.com>
  Filipe Manana <fdmanana@suse.com>
  Florian Fainelli <florian.fainelli@broadcom.com>
  Florian Westphal <fw@strlen.de>
  Frederic Weisbecker <frederic@kernel.org>
  FUJITA Tomonori <fujita.tomonori@gmail.com>
  Gaosheng Cui <cuigaosheng1@huawei.com>
  Geert Uytterhoeven <geert+renesas@glider.be>
  Geliang Tang <geliang.tang@suse.com>
  George Kennedy <george.kennedy@oracle.com>
  George Zhang <George.zhang@amd.com>
  Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  Guenter Roeck <linux@roeck-us.net>
  Hamza Mahfooz <hamza.mahfooz@amd.com>
  Hanna Czenczek <hreitz@redhat.com>
  Hans de Goede <hdegoede@redhat.com>
  Hans Verkuil <hverkuil-cisco@xs4all.nl>
  Huacai Chen <chenhuacai@loongson.cn>
  HungNien Chen <hn.chen@sunplusit.com>
  Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
  Ivan Lipski <ivlipski@amd.com>
  Jakub Kicinski <kuba@kernel.org>
  James Chapman <jchapman@katalix.com>
  Jan Kara <jack@suse.cz>
  Jason Wang <jasowang@redhat.com>
  Jens Axboe <axboe@kernel.dk>
  Jerome Brunet <jbrunet@baylibre.com>
  Jin Wang <jin1.wang@intel.com>
  Jiri Olsa <jolsa@kernel.org>
  Jithu Joseph <jithu.joseph@intel.com>
  Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
  Johan Hovold <johan@kernel.org>
  Johannes Berg <johannes.berg@intel.com>
  Jon Hunter <jonathanh@nvidia.com>
  Justin Stitt <justinstitt@google.com>
  Kemeng Shi <shikemeng@huaweicloud.com>
  Kevin Berry <kpberry@google.com>
  Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
  Kuniyuki Iwashima <kuniyu@amazon.com>
  Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
  Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  Li Nan <linan122@huawei.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Linux Kernel Functional Testing <lkft@linaro.org>
  Lucas Stach <l.stach@pengutronix.de>
  Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  Lyude Paul <lyude@redhat.com>
  Ma Jun <Jun.Ma2@amd.com>
  Ma Ke <make24@iscas.ac.cn>
  Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
  Marc Kleine-Budde <mkl@pengutronix.de>
  Marco Elver <elver@google.com>
  Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
  Mark Brown <broonie@kernel.org>
  Mark Rutland <mark.rutland@arm.com>
  Martin K. Petersen <martin.petersen@oracle.com>
  Masami Hiramatsu (Google) <mhiramat@kernel.org>
  Matthieu Baerts (NGI0) <matttbe@kernel.org>
  Matthieu Baerts <matthieu.baerts@tessares.net>
  Menglong Dong <dongml2@chinatelecom.cn>
  Menglong Dong <menglong8.dong@gmail.com>
  Miaohe Lin <linmiaohe@huawei.com>
  Michael S. Tsirkin <mst@redhat.com>
  Michal Pecio <michal.pecio@gmail.com>
  Mikulas Patocka <mpatocka@redhat.com>
  Ming Qian <ming.qian@nxp.com>
  Muchun Song <muchun.song@linux.dev>
  Neil Armstrong <neil.armstrong@linaro.org>
  Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK
  Nicolas Dichtel <nicolas.dichtel@6wind.com>
  Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
  Nikolay Aleksandrov <razor@blackwall.org>
  Oliver Neukum <oneukum@suse.com>
  Pablo Neira Ayuso <pablo@netfilter.org>
  Paolo Abeni <pabeni@redhat.com>
  Paul E. McKenney <paulmck@kernel.org>
  Pavel Machek (CIP) <pavel@denx.de>
  Pengfei Xu <pengfei.xu@intel.com>
  Peter Oberparleiter <oberpar@linux.ibm.com>
  Peter Zijlstra (Intel) <peterz@infradead.org>
  Peter Zijlstra <peterz@infradead.org>
  Prashanth K <quic_prashk@quicinc.com>
  Qiang Yu <yuq825@gmail.com>
  Qu Wenruo <wqu@suse.com>
  Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
  Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  Ricardo Ribalda <ribalda@chromium.org>
  Robert Foss <rfoss@kernel.org>
  Roman Smirnov <r.smirnov@omp.ru>
  Ron Economos <re@w6rz.net>
  Salvatore Bonaccorso <carnil@debian.org>
  Sasha Levin <sashal@kernel.org>
  Sebastian Fricke <sebastian.fricke@collabora.com>
  Sebastian Reichel <sebastian.reichel@collabora.com>
  Shay Drory <shayd@nvidia.com>
  Shuah Khan <skhan@linuxfoundation.org>
  Song Liu <song@kernel.org>
  Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
  Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
  Stefan Wahren <wahrenst@gmx.net>
  Steve French <stfrench@microsoft.com>
  Steven 'Steve' Kendall <skend@chromium.org>
  Steven Rostedt (Google) <rostedt@goodmis.org>
  syzbot+e6979a5d2f10ecb700e4@syzkaller.appspotmail.com
  Takashi Iwai <tiwai@suse.de>
  Tariq Toukan <tariqt@nvidia.com>
  Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
  Theodore Ts'o <tytso@mit.edu>
  Thomas Gleixner <tglx@linutronix.de>
  Thomas Weißschuh <linux@weissschuh.net>
  Thomas Zimmermann <tzimmermann@suse.de>
  Tom Parkin <tparkin@katalix.com>
  Tze-nan Wu <Tze-nan.Wu@mediatek.com>
  Vamshi Gajjela <vamshigajjela@google.com>
  Victor Skvortsov <victor.skvortsov@amd.com>
  Waiman Long <longman@redhat.com>
  Wayne Lin <wayne.lin@amd.com>
  Will Deacon <will@kernel.org>
  Wolfram Sang <wsa+renesas@sang-engineering.com>
  Wolfram Sang <wsa@kernel.org>
  Xiaxi Shen <shenxiaxi26@gmail.com>
  Xin Long <lucien.xin@gmail.com>
  Yang Shi <yang@os.amperecomputing.com>
  Yang Wang<kevinyang.wang@amd.com>
  Yang Yingliang <yangyingliang@huawei.com>
  Yann Sionneau <ysionneau@kalrayinc.com>
  Yipeng Zou <zouyipeng@huawei.com>
  Yonghong Song <yonghong.song@linux.dev>
  Yu Kuai <yukuai3@huawei.com>
  Yu Liao <liaoyu15@huawei.com>
  Yves-Alexis Perez <corsac@debian.org>
  Zheng Zucheng <zhengzucheng@huawei.com>
  Zhiguo Niu <zhiguo.niu@unisoc.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-armhf-armhf-xl-credit2 broken

Not pushing.

(No revision log; it would be 4909 lines long.)


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 22:56:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 22:56:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778299.1188362 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sejOY-0000XZ-KN; Thu, 15 Aug 2024 22:56:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778299.1188362; Thu, 15 Aug 2024 22:56:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sejOY-0000XS-Hu; Thu, 15 Aug 2024 22:56:38 +0000
Received: by outflank-mailman (input) for mailman id 778299;
 Thu, 15 Aug 2024 22:56:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=pCfw=PO=intel.com=lkp@srs-se1.protection.inumbo.net>)
 id 1sejOX-0000XM-FB
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 22:56:38 +0000
Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9dae165b-5b59-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 00:56:34 +0200 (CEST)
Received: from fmviesa001.fm.intel.com ([10.60.135.141])
 by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 15 Aug 2024 15:56:32 -0700
Received: from lkp-server01.sh.intel.com (HELO 9a732dc145d3) ([10.239.97.150])
 by fmviesa001.fm.intel.com with ESMTP; 15 Aug 2024 15:56:28 -0700
Received: from kbuild by 9a732dc145d3 with local (Exim 4.96)
 (envelope-from <lkp@intel.com>) id 1sejOM-0005hO-03;
 Thu, 15 Aug 2024 22:56:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9dae165b-5b59-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1723762594; x=1755298594;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=DnWQIIqu3hNQSN2Nb1clnrON51RvUjFBm/tcymd+D00=;
  b=Nd9Lj64AKn3LHlZA4uHO6gW4uSsMk4ts/oPDxyzCdkM7JrF3ipzzxIAv
   wEvRwWECQ/CLTzPjQpZ9u1Tnv/1xSz1R6KufLscY2LhJHGPL+tgHSEFiv
   RmNSHcFFFky7TZ++LakyKcRsvhl0onwr4xnYZFlSg1Vkd4rwjwlpE/sVb
   VwcBFBriZ/CTKbkMR+GLiN72plV0Rtk2wY7WGl1Hg+c9sYIFXpg+wj4O8
   +U3ZpfT82gQlKyzlvZLkDSYJ8P6p2q1hrtzFyITDTxAseAgo4lGk98A+W
   B2hp7ZDc+RejA6FsJaFw6Z5wZ0toZ3RIxNZOZE8RvtterAWLVTncX7C9o
   g==;
X-CSE-ConnectionGUID: s3OV9UGsQjqQ27gq91/ZBw==
X-CSE-MsgGUID: dFZUgE+pT/qRnYzh1zg3TQ==
X-IronPort-AV: E=McAfee;i="6700,10204,11165"; a="32718290"
X-IronPort-AV: E=Sophos;i="6.10,150,1719903600"; 
   d="scan'208";a="32718290"
X-CSE-ConnectionGUID: pNnSBi+4QnuPB1Eg0n47TA==
X-CSE-MsgGUID: 0pMppDA9RwGuvV5skoCVoA==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.10,150,1719903600"; 
   d="scan'208";a="90275308"
Date: Fri, 16 Aug 2024 06:55:30 +0800
From: kernel test robot <lkp@intel.com>
To: Jason Andryuk <jason.andryuk@amd.com>, Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
	"H. Peter Anvin" <hpa@zytor.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Brian Gerst <brgerst@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev, xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org, Jason Andryuk <jason.andryuk@amd.com>
Subject: Re: [PATCH v2 5/5] x86/pvh: Add 64bit relocation page tables
Message-ID: <202408160603.fDLxZmqp-lkp@intel.com>
References: <20240814195053.5564-6-jason.andryuk@amd.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240814195053.5564-6-jason.andryuk@amd.com>

Hi Jason,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tip/x86/core]
[also build test WARNING on xen-tip/linux-next tip/master linus/master v6.11-rc3 next-20240815]
[cannot apply to tip/auto-latest]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Jason-Andryuk/xen-sync-elfnote-h-from-xen-tree/20240815-035238
base:   tip/x86/core
patch link:    https://lore.kernel.org/r/20240814195053.5564-6-jason.andryuk%40amd.com
patch subject: [PATCH v2 5/5] x86/pvh: Add 64bit relocation page tables
config: i386-randconfig-052-20240815 (https://download.01.org/0day-ci/archive/20240816/202408160603.fDLxZmqp-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240816/202408160603.fDLxZmqp-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408160603.fDLxZmqp-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from arch/x86/include/asm/pgtable_64.h:6,
                    from arch/x86/platform/pvh/head.S:19:
   arch/x86/include/asm/pgtable_64_types.h:75: warning: "PGDIR_SHIFT" redefined
      75 | #define PGDIR_SHIFT             39
         | 
   In file included from arch/x86/include/asm/pgtable_32_types.h:15,
                    from arch/x86/include/asm/pgtable_types.h:275,
                    from arch/x86/include/asm/boot.h:6,
                    from arch/x86/platform/pvh/head.S:18:
   arch/x86/include/asm/pgtable-2level_types.h:29: note: this is the location of the previous definition
      29 | #define PGDIR_SHIFT     22
         | 
   arch/x86/include/asm/pgtable_64_types.h:76: warning: "PTRS_PER_PGD" redefined
      76 | #define PTRS_PER_PGD            512
         | 
   arch/x86/include/asm/pgtable-2level_types.h:30: note: this is the location of the previous definition
      30 | #define PTRS_PER_PGD    1024
         | 
>> arch/x86/include/asm/pgtable_64_types.h:97: warning: "PTRS_PER_PTE" redefined
      97 | #define PTRS_PER_PTE    512
         | 
   arch/x86/include/asm/pgtable-2level_types.h:38: note: this is the location of the previous definition
      38 | #define PTRS_PER_PTE    1024
         | 
   arch/x86/include/asm/pgtable_64_types.h:103: warning: "PGDIR_SIZE" redefined
     103 | #define PGDIR_SIZE      (_AC(1, UL) << PGDIR_SHIFT)
         | 
   arch/x86/include/asm/pgtable_32_types.h:20: note: this is the location of the previous definition
      20 | #define PGDIR_SIZE      (1UL << PGDIR_SHIFT)
         | 
   arch/x86/include/asm/pgtable_64_types.h:210: warning: "PGD_KERNEL_START" redefined
     210 | #define PGD_KERNEL_START        ((PAGE_SIZE / 2) / sizeof(pgd_t))
         | 
   arch/x86/include/asm/pgtable-2level_types.h:41: note: this is the location of the previous definition
      41 | #define PGD_KERNEL_START        (CONFIG_PAGE_OFFSET >> PGDIR_SHIFT)
         | 
   arch/x86/include/asm/pgtable_64.h: Assembler messages:
   arch/x86/include/asm/pgtable_64.h:279: Error: invalid operands (*UND* and *ABS* sections) for `>>'


vim +/PTRS_PER_PTE +97 arch/x86/include/asm/pgtable_64_types.h

b8504058a06bd1 Kirill A. Shutemov  2017-03-30  71  
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  72  /*
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  73   * PGDIR_SHIFT determines what a top-level page table entry can map
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  74   */
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  75  #define PGDIR_SHIFT		39
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08 @76  #define PTRS_PER_PGD		512
c65e774fb3f6af Kirill A. Shutemov  2018-02-14  77  #define MAX_PTRS_PER_P4D	1
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  78  
b8504058a06bd1 Kirill A. Shutemov  2017-03-30  79  #endif /* CONFIG_X86_5LEVEL */
b8504058a06bd1 Kirill A. Shutemov  2017-03-30  80  
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  81  /*
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  82   * 3rd level page
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  83   */
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  84  #define PUD_SHIFT	30
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  85  #define PTRS_PER_PUD	512
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  86  
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  87  /*
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  88   * PMD_SHIFT determines the size of the area a middle-level
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  89   * page table can map
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  90   */
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  91  #define PMD_SHIFT	21
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  92  #define PTRS_PER_PMD	512
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  93  
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  94  /*
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  95   * entries per page directory level
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  96   */
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08 @97  #define PTRS_PER_PTE	512
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  98  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


From xen-devel-bounces@lists.xenproject.org Thu Aug 15 23:53:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Aug 2024 23:53:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778309.1188372 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sekHA-0001F4-Pa; Thu, 15 Aug 2024 23:53:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778309.1188372; Thu, 15 Aug 2024 23:53:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sekHA-0001Ex-LM; Thu, 15 Aug 2024 23:53:04 +0000
Received: by outflank-mailman (input) for mailman id 778309;
 Thu, 15 Aug 2024 23:53:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=z0f6=PO=hack.org=omni@srs-se1.protection.inumbo.net>)
 id 1sekHA-0001EY-3x
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 23:53:04 +0000
Received: from mail.hack.org (mail.hack.org [2a03:1b20:1:f203::2:3])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 81fdb4ca-5b61-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 01:53:02 +0200 (CEST)
Received: from authenticated user by mail.hack.org 
 for xen-devel@lists.xenproject.org; Thu, 15 Aug 2024 23:53:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 81fdb4ca-5b61-11ef-a505-bb4a2ccca743
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Thu, 15 Aug 2024 23:53:00 +0000
Message-Id: <D3GW1J7SK5O4.2RRN5IZG3B3M5@hack.org>
Subject: issues building qemu-xen (8.0.4) with musl 1.2.5 and gcc 14
From: "omni" <omni+xen-devel@hack.org>
To: <xen-devel@lists.xenproject.org>
X-Mailer: aerc 0.18.2

Hi list!

Trying to apply patches to our xen aport I found issues building
tools/qemu-xen (qemu 8.0.4) with musl 1.2.5 and gcc 14 for the
alpinelinux rolling release branch "edge".

The insignificantly different build for our latest stable release,
3.20-stable with musl 1.2.5 but gcc 13.2.1_git20240309, seems to work
fine.

I also tried a rebuild of our separate qemu aport, at version 9.0.2, in
edge, as that had had no rebuild since the gcc upgrade, and it went
fine.


Please see my build attempts and CI pipeline outputs in our gitlab,

  https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/70515

Patching tools/qemu-xen/hw/vfio/pci.c with #include <libgen.h> made
builds succeed for aarch64 & armv7 but x86_64 ran into other issues.


Issue referenced in above MR,

  https://gitlab.alpinelinux.org/alpine/aports/-/issues/16106

musl change referenced in above issue,

  https://git.musl-libc.org/cgit/musl/commit/?id=3D725e17ed6dff4d0cd22487bb=
64470881e86a92e7

The latest qemu releases are 8.2.6 and 9.0.2, both released 240716,

  https://www.qemu.org/download/


cheers
--=20
omni


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 01:01:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 01:01:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778334.1188381 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1selKi-0004ye-QW; Fri, 16 Aug 2024 01:00:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778334.1188381; Fri, 16 Aug 2024 01:00:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1selKi-0004y0-NY; Fri, 16 Aug 2024 01:00:48 +0000
Received: by outflank-mailman (input) for mailman id 778334;
 Fri, 16 Aug 2024 01:00: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=gTDq=PP=amd.com=stefano.stabellini@srs-se1.protection.inumbo.net>)
 id 1selKh-0004Dj-80
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 01:00:47 +0000
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on20606.outbound.protection.outlook.com
 [2a01:111:f400:7e88::606])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f6d348b9-5b6a-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 03:00:44 +0200 (CEST)
Received: from DM6PR08CA0010.namprd08.prod.outlook.com (2603:10b6:5:80::23) by
 PH7PR12MB6936.namprd12.prod.outlook.com (2603:10b6:510:1ba::7) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.7875.19; Fri, 16 Aug 2024 01:00:37 +0000
Received: from DS2PEPF00003446.namprd04.prod.outlook.com
 (2603:10b6:5:80:cafe::2c) by DM6PR08CA0010.outlook.office365.com
 (2603:10b6:5:80::23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.23 via Frontend
 Transport; Fri, 16 Aug 2024 01:00:37 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 DS2PEPF00003446.mail.protection.outlook.com (10.167.17.73) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Fri, 16 Aug 2024 01:00:36 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 15 Aug
 2024 20:00:36 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 15 Aug
 2024 20:00:36 -0500
Received: from smtp.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Thu, 15 Aug 2024 20:00:35 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f6d348b9-5b6a-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=pQ7MGXkFj7fTIW7P+R/QaAh46jNPY98lwH9mT06oSsUNYWe8JkAiZkwEpzejoV4DooZk1T4KbkXXEAxYTjGXfeSSpF/KGQ/H4wM8kamL3xTb69NNskcazqmmUC2pJsF/24rWGaO46e3+qJlJqGoCV8Af93Gxbry5D/kdaI50tOLXPQd7SAzGH7AxNVdbtTEtqyvXnxCqz/b/2AVg70O8rm7kgh4MPJS60MPB+PgXvBeNbHCT2oRg2MJgHvb/lk8yPqQik5s9hFX3cNFtFgEYtZ8ptWYQRwIcCXteOe0X4o50+JfM6jeZss/bC1iiuGUwxVB7EGLMJcOx03h0eGBPpQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=gkbsKAQ/YfMSYzGIs1nV6lSw/u0yO2EDs5ryQTixoJw=;
 b=GN0LSkNwtOsQRPa5RvOnKwqNvGdiiUFVmAqaeQYHvlm8C1e3ILJR+M7Dh4wtGlFB50gJoiDv21yGGb+oYujm6FpPQaWfg9AGPRBRLWo5aiNHLRlt+a9dXqWfiwOksbhfHTJQMJQddA8unbY6QOMa/uYQJuxcuAzuEejqRgSYjZ6/jas4ElFwnisVe4Q0FOqAA+b8rgKWiZ95jfWk6S/oAl7NpWam/AyUE+PmGe7FKr/odUKfKrA+Im2tVDNyWPAOi4LMqf0wPECOjdDCaeDRsvnWS7yXEVkcEGRlzqrsJWN49V2p5lTGTNzhwMyLZJJMTWUZTmqj0sidLdarw8UHMA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=gkbsKAQ/YfMSYzGIs1nV6lSw/u0yO2EDs5ryQTixoJw=;
 b=yLmC1NOeu6jvCMJiyrESzybiljmz9cxMQ77Uwu0Uw3eT7dlVKp3TTqszZU8s2jGzFbRouBeRCyNJ52MA5cOLPAbYyP3U1W4VBiQ3HxlmnzHPOxoPOx/HFLchE9ivRyuhcKuSeSkjbhGfEZRgj/Sw7FaK10P5MsvRsJA7FG4KHyw=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Stefano Stabellini <stefano.stabellini@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: <sstabellini@kernel.org>, Doug Goldstein <cardoe@cardoe.com>, "Andrew
 Cooper" <andrew.cooper3@citrix.com>, Michal Orzel <michal.orzel@amd.com>,
	Stefano Stabellini <stefano.stabellini@amd.com>
Subject: [PATCH] automation: add default QEMU_TIMEOUT value if not already set
Date: Thu, 15 Aug 2024 18:00:34 -0700
Message-ID: <20240816010034.2199142-1-stefano.stabellini@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS2PEPF00003446:EE_|PH7PR12MB6936:EE_
X-MS-Office365-Filtering-Correlation-Id: dd87c0d7-ef46-42e0-1df1-08dcbd8ed6f3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?gPbiGwkDS+EvR5EoaDz3/k+CvFRYS3oaqMNujuocYAESG9afbbQgVO25Dv1X?=
 =?us-ascii?Q?AUWfpZQKXy131l+NGQ48EnHOkdVlslBNhh/XpNOI3hbVK9C5ZEiGBnqO1YTO?=
 =?us-ascii?Q?sbPhdAlxLl10sQrmLsPoQzjq4hKJJDr2pOw9iqH0Bn3db+RVR+FGyoxdD9RT?=
 =?us-ascii?Q?HpHfQIQARhGRvOUKcgNntekxCvbK0pC/NE8NJOdhiqATTcIFyZQjSpTT8VuR?=
 =?us-ascii?Q?DHB7qc0uiFWY2p8hVHqdNv7WwUIjKL+YwfGyBop4LTNA00CqQUMsi0hFzBTq?=
 =?us-ascii?Q?Id+nj9NcReH2yGG5/vCeYyfr+mfOHvrlJNQfGISlXcb5AR0OKPJk9tuW4Ejg?=
 =?us-ascii?Q?PSDr0/uI5V+9ta9J2X8i6W6njGG0JG/O0xZDpuZAMHqZkfxt6wkvIjEmI8CX?=
 =?us-ascii?Q?c6EC/UhIGi9i4csIpNXSwJKDRDCxsV5rOWQuoQi2xaJxnx/4dWhRz62USYTv?=
 =?us-ascii?Q?dX2TQQsuXKlbjBVl8pyMAXMqYLJ7DcXBBiSybLGHlVQxqyRK4R6NxDRCJkzl?=
 =?us-ascii?Q?fQx//FnKzeAONSB05VfcQBOIK1QWdHBIEk3x62uBsuRgX1CpXfy5JNYeyHM2?=
 =?us-ascii?Q?smaPgBJn4P3aY0s7o709DU+KLeUlDgmxE99Y988M3hTBEhr38flSam1Pnggx?=
 =?us-ascii?Q?hCPxM1tRFYpOTTeLhIpxpxXG9ffoJ9cAqRmXAPc4O7YeUcTU5TVKoR4jdpj+?=
 =?us-ascii?Q?dE7GxPeiovglaQspvWh5jD2jdDgtN5LZhmrLm9wesLXcCkIGhAss2mG4endT?=
 =?us-ascii?Q?xfKf7s+3m9ERdP+timw+K1If4g5SVRS+f9XDLR9sRwnbPg7blWP5szXEjXWv?=
 =?us-ascii?Q?2X71ljx8dT4UHBTlXkwKppdBgTxLjrsggUMMNHQIpQW2OKssTKUc+S4IqYVg?=
 =?us-ascii?Q?T1S9bnWguo++cu+6TrWee0sJTBZYLZPFgiz4Zsgzjw4Zis22l63SdI9wGpZB?=
 =?us-ascii?Q?OkI/8Q9CYfA5L0NgUfG+kbAfw0rkclOJkPzlwXMAbH+0u2kpVddk68vnKzw4?=
 =?us-ascii?Q?iXFL7OIPZPcAwR09Py/s91e0hSLIMTTcs7OnvHzqgJAohiJGKHtEv1bwcr1d?=
 =?us-ascii?Q?2VNFHTppWlzkvk2GR6OptbA9iLpumJb4iP/AlJ2tAlo6QRT/5GEb2lPMaEQl?=
 =?us-ascii?Q?16FUg9hQ5jHJ0Av5Q7z4BDeL/5GVh38A7F29Xv5U2i1atyo/7qnQAm4tCuzR?=
 =?us-ascii?Q?TUGJtplxOSGWivgb5OO7pBCFyZbSqUcg870lWG8OovMXd2comauhdmpSJJNM?=
 =?us-ascii?Q?xChj3q+LvOgpYq3+yFQpIG2kgpUlur0T8/a9nT0R4lf5hqH3U3hzD2Qxbaun?=
 =?us-ascii?Q?2koqRT8Z7/2ZSxKQFz0krXpyU4hIIwA8bZRQcm4/zjW5yzGxvceo25FuCk0l?=
 =?us-ascii?Q?CkJjf4DRGU/Tz18E095k6M0LO2CiYSVMtCVP4H7olSGyxpRiyUEsFeYj3/79?=
 =?us-ascii?Q?+tYgQ4rDLyyQlFaKCLDyidb+8o7ShA1P?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2024 01:00:36.8093
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: dd87c0d7-ef46-42e0-1df1-08dcbd8ed6f3
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS2PEPF00003446.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6936

The expectation is that QEMU_TIMEOUT should be set as a Gitlab CI/CD
variable but if not we should be able to run the pipeline anyway.

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
 automation/scripts/qemu-key.exp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/automation/scripts/qemu-key.exp b/automation/scripts/qemu-key.exp
index 35eb903a31..787f1f08cb 100755
--- a/automation/scripts/qemu-key.exp
+++ b/automation/scripts/qemu-key.exp
@@ -1,6 +1,10 @@
 #!/usr/bin/expect -f
 
-set timeout $env(QEMU_TIMEOUT)
+if {[info exists env(QEMU_TIMEOUT)]} {
+    set timeout $env(QEMU_TIMEOUT)
+} else {
+    set timeout 1500
+}
 
 log_file -a $env(QEMU_LOG)
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 01:40:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 01:40:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778343.1188391 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1selxN-0001hR-M9; Fri, 16 Aug 2024 01:40:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778343.1188391; Fri, 16 Aug 2024 01:40:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1selxN-0001hK-JW; Fri, 16 Aug 2024 01:40:45 +0000
Received: by outflank-mailman (input) for mailman id 778343;
 Fri, 16 Aug 2024 01:40:45 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m3Oh=PP=intel.com=lkp@srs-se1.protection.inumbo.net>)
 id 1selxM-0001hE-TR
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 01:40:45 +0000
Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8ad91460-5b70-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 03:40:41 +0200 (CEST)
Received: from orviesa004.jf.intel.com ([10.64.159.144])
 by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 15 Aug 2024 18:40:39 -0700
Received: from lkp-server01.sh.intel.com (HELO 9a732dc145d3) ([10.239.97.150])
 by orviesa004.jf.intel.com with ESMTP; 15 Aug 2024 18:40:33 -0700
Received: from kbuild by 9a732dc145d3 with local (Exim 4.96)
 (envelope-from <lkp@intel.com>) id 1selx8-0005n0-2f;
 Fri, 16 Aug 2024 01:40:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8ad91460-5b70-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1723772442; x=1755308442;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=FHJRwW+7bRBSKWk7JuaJ+Xkom00qKybRQe8ByoTp8xM=;
  b=fOJ7Y8C2ZW/br6Z4CE7KJL/1Jfguc5MsH949/3loZi3TsNHhl2JPlHlv
   kq2Y1944ksCz+gGevdXS3YnapwIOIfub6KTYNd5ekOLvHcwjm+6pDwBAV
   brns2uhmQ9wf6edHjnlQs3hr+sZ5gaOQ1FlDVxrtDSVVBipIpwQ9s+TJk
   w+PXnKJtZJE0x1izfsfO00uEDVBhtkn0T7BjZaTgqkoXAZ18eHZim0o9I
   zNkd3d5HQsCml5W3crHyq2qlF35V0TgeFRFzOwv2pfRCLSmXQFqz3Hiyj
   93mvHbt46JUbcuhNAEHkygx+4wTOGrbVVtZusfofSqm36vm3evbMPjtAf
   g==;
X-CSE-ConnectionGUID: CmmcSg66TyueHiO6x2JAxQ==
X-CSE-MsgGUID: rfQg69dvQzmTt5V9+/pBCw==
X-IronPort-AV: E=McAfee;i="6700,10204,11165"; a="32730640"
X-IronPort-AV: E=Sophos;i="6.10,150,1719903600"; 
   d="scan'208";a="32730640"
X-CSE-ConnectionGUID: okgIv29iR2C0m373nz4+0A==
X-CSE-MsgGUID: lgC3fOkuQpWCFIwLNk6d5g==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.10,150,1719903600"; 
   d="scan'208";a="64472897"
Date: Fri, 16 Aug 2024 09:39:40 +0800
From: kernel test robot <lkp@intel.com>
To: Jason Andryuk <jason.andryuk@amd.com>, Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
	"H. Peter Anvin" <hpa@zytor.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Brian Gerst <brgerst@gmail.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
	Jason Andryuk <jason.andryuk@amd.com>
Subject: Re: [PATCH v2 5/5] x86/pvh: Add 64bit relocation page tables
Message-ID: <202408160955.iKtoU4kP-lkp@intel.com>
References: <20240814195053.5564-6-jason.andryuk@amd.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240814195053.5564-6-jason.andryuk@amd.com>

Hi Jason,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tip/x86/core]
[also build test WARNING on xen-tip/linux-next tip/master linus/master v6.11-rc3 next-20240815]
[cannot apply to tip/auto-latest]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Jason-Andryuk/xen-sync-elfnote-h-from-xen-tree/20240815-035238
base:   tip/x86/core
patch link:    https://lore.kernel.org/r/20240814195053.5564-6-jason.andryuk%40amd.com
patch subject: [PATCH v2 5/5] x86/pvh: Add 64bit relocation page tables
config: i386-randconfig-011-20240815 (https://download.01.org/0day-ci/archive/20240816/202408160955.iKtoU4kP-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240816/202408160955.iKtoU4kP-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408160955.iKtoU4kP-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from arch/x86/platform/pvh/head.S:19:
   In file included from arch/x86/include/asm/pgtable_64.h:6:
>> arch/x86/include/asm/pgtable_64_types.h:49:9: warning: 'SHARED_KERNEL_PMD' macro redefined [-Wmacro-redefined]
      49 | #define SHARED_KERNEL_PMD       0
         |         ^
   arch/x86/include/asm/pgtable-3level_types.h:30:9: note: previous definition is here
      30 | #define SHARED_KERNEL_PMD       (!static_cpu_has(X86_FEATURE_PTI))
         |         ^
   In file included from arch/x86/platform/pvh/head.S:19:
   In file included from arch/x86/include/asm/pgtable_64.h:6:
   arch/x86/include/asm/pgtable_64_types.h:75:9: warning: 'PGDIR_SHIFT' macro redefined [-Wmacro-redefined]
      75 | #define PGDIR_SHIFT             39
         |         ^
   arch/x86/include/asm/pgtable-3level_types.h:37:9: note: previous definition is here
      37 | #define PGDIR_SHIFT     30
         |         ^
   In file included from arch/x86/platform/pvh/head.S:19:
   In file included from arch/x86/include/asm/pgtable_64.h:6:
>> arch/x86/include/asm/pgtable_64_types.h:76:9: warning: 'PTRS_PER_PGD' macro redefined [-Wmacro-redefined]
      76 | #define PTRS_PER_PGD            512
         |         ^
   arch/x86/include/asm/pgtable-3level_types.h:38:9: note: previous definition is here
      38 | #define PTRS_PER_PGD    4
         |         ^
   In file included from arch/x86/platform/pvh/head.S:19:
   In file included from arch/x86/include/asm/pgtable_64.h:6:
   arch/x86/include/asm/pgtable_64_types.h:99:9: warning: 'PMD_SIZE' macro redefined [-Wmacro-redefined]
      99 | #define PMD_SIZE        (_AC(1, UL) << PMD_SHIFT)
         |         ^
   arch/x86/include/asm/pgtable_32_types.h:12:10: note: previous definition is here
      12 | # define PMD_SIZE       (1UL << PMD_SHIFT)
         |          ^
   In file included from arch/x86/platform/pvh/head.S:19:
   In file included from arch/x86/include/asm/pgtable_64.h:6:
   arch/x86/include/asm/pgtable_64_types.h:103:9: warning: 'PGDIR_SIZE' macro redefined [-Wmacro-redefined]
     103 | #define PGDIR_SIZE      (_AC(1, UL) << PGDIR_SHIFT)
         |         ^
   arch/x86/include/asm/pgtable_32_types.h:20:9: note: previous definition is here
      20 | #define PGDIR_SIZE      (1UL << PGDIR_SHIFT)
         |         ^
   In file included from arch/x86/platform/pvh/head.S:19:
   In file included from arch/x86/include/asm/pgtable_64.h:6:
>> arch/x86/include/asm/pgtable_64_types.h:210:9: warning: 'PGD_KERNEL_START' macro redefined [-Wmacro-redefined]
     210 | #define PGD_KERNEL_START        ((PAGE_SIZE / 2) / sizeof(pgd_t))
         |         ^
   arch/x86/include/asm/pgtable-3level_types.h:53:9: note: previous definition is here
      53 | #define PGD_KERNEL_START        (CONFIG_PAGE_OFFSET >> PGDIR_SHIFT)
         |         ^
   6 warnings generated.
   /tmp/head-582305.s:252:51: error: expression could not be evaluated
   L4_PAGE_OFFSET = (((__PAGE_OFFSET_BASE_L4) >> 39) & 511)
                                                     ^


vim +/PTRS_PER_PGD +76 arch/x86/include/asm/pgtable_64_types.h

54321d947ae9d6 Jeremy Fitzhardinge 2009-02-11   48  
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  @49  #define SHARED_KERNEL_PMD	0
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   50  
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   51  #ifdef CONFIG_X86_5LEVEL
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   52  
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   53  /*
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   54   * PGDIR_SHIFT determines what a top-level page table entry can map
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   55   */
c65e774fb3f6af Kirill A. Shutemov  2018-02-14   56  #define PGDIR_SHIFT	pgdir_shift
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   57  #define PTRS_PER_PGD	512
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   58  
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   59  /*
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   60   * 4th level page in 5-level paging case
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   61   */
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   62  #define P4D_SHIFT		39
c65e774fb3f6af Kirill A. Shutemov  2018-02-14   63  #define MAX_PTRS_PER_P4D	512
c65e774fb3f6af Kirill A. Shutemov  2018-02-14   64  #define PTRS_PER_P4D		ptrs_per_p4d
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   65  #define P4D_SIZE		(_AC(1, UL) << P4D_SHIFT)
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   66  #define P4D_MASK		(~(P4D_SIZE - 1))
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   67  
02390b87a94599 Kirill A. Shutemov  2018-02-14   68  #define MAX_POSSIBLE_PHYSMEM_BITS	52
02390b87a94599 Kirill A. Shutemov  2018-02-14   69  
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   70  #else /* CONFIG_X86_5LEVEL */
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   71  
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   72  /*
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   73   * PGDIR_SHIFT determines what a top-level page table entry can map
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   74   */
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   75  #define PGDIR_SHIFT		39
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  @76  #define PTRS_PER_PGD		512
c65e774fb3f6af Kirill A. Shutemov  2018-02-14   77  #define MAX_PTRS_PER_P4D	1
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   78  
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   79  #endif /* CONFIG_X86_5LEVEL */
b8504058a06bd1 Kirill A. Shutemov  2017-03-30   80  
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   81  /*
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   82   * 3rd level page
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   83   */
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   84  #define PUD_SHIFT	30
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   85  #define PTRS_PER_PUD	512
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   86  
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   87  /*
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   88   * PMD_SHIFT determines the size of the area a middle-level
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   89   * page table can map
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   90   */
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   91  #define PMD_SHIFT	21
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   92  #define PTRS_PER_PMD	512
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   93  
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   94  /*
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   95   * entries per page directory level
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   96   */
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   97  #define PTRS_PER_PTE	512
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   98  
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08   99  #define PMD_SIZE	(_AC(1, UL) << PMD_SHIFT)
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  100  #define PMD_MASK	(~(PMD_SIZE - 1))
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  101  #define PUD_SIZE	(_AC(1, UL) << PUD_SHIFT)
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  102  #define PUD_MASK	(~(PUD_SIZE - 1))
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  103  #define PGDIR_SIZE	(_AC(1, UL) << PGDIR_SHIFT)
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  104  #define PGDIR_MASK	(~(PGDIR_SIZE - 1))
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  105  
1dddd25125112b Thomas Gleixner     2018-01-04  106  /*
ff61f0791ce969 Jonathan Corbet     2023-03-14  107   * See Documentation/arch/x86/x86_64/mm.rst for a description of the memory map.
1dddd25125112b Thomas Gleixner     2018-01-04  108   *
1dddd25125112b Thomas Gleixner     2018-01-04  109   * Be very careful vs. KASLR when changing anything here. The KASLR address
1dddd25125112b Thomas Gleixner     2018-01-04  110   * range must not overlap with anything except the KASAN shadow area, which
1dddd25125112b Thomas Gleixner     2018-01-04  111   * is correct as KASAN disables KASLR.
1dddd25125112b Thomas Gleixner     2018-01-04  112   */
162434e7f58b21 Kirill A. Shutemov  2018-02-14  113  #define MAXMEM			(1UL << MAX_PHYSMEM_BITS)
92a0f81d89571e Thomas Gleixner     2017-12-20  114  
16877a5570e0c5 Kirill A. Shutemov  2018-11-30  115  #define GUARD_HOLE_PGD_ENTRY	-256UL
16877a5570e0c5 Kirill A. Shutemov  2018-11-30  116  #define GUARD_HOLE_SIZE		(16UL << PGDIR_SHIFT)
16877a5570e0c5 Kirill A. Shutemov  2018-11-30  117  #define GUARD_HOLE_BASE_ADDR	(GUARD_HOLE_PGD_ENTRY << PGDIR_SHIFT)
16877a5570e0c5 Kirill A. Shutemov  2018-11-30  118  #define GUARD_HOLE_END_ADDR	(GUARD_HOLE_BASE_ADDR + GUARD_HOLE_SIZE)
16877a5570e0c5 Kirill A. Shutemov  2018-11-30  119  
d52888aa2753e3 Kirill A. Shutemov  2018-10-26  120  #define LDT_PGD_ENTRY		-240UL
5c7919bb1994f8 Kirill A. Shutemov  2018-02-14  121  #define LDT_BASE_ADDR		(LDT_PGD_ENTRY << PGDIR_SHIFT)
8195d869d118bc Joerg Roedel        2018-07-18  122  #define LDT_END_ADDR		(LDT_BASE_ADDR + PGDIR_SIZE)
5c7919bb1994f8 Kirill A. Shutemov  2018-02-14  123  
14d12bb8582e15 Jiri Kosina         2018-04-12  124  #define __VMALLOC_BASE_L4	0xffffc90000000000UL
14d12bb8582e15 Jiri Kosina         2018-04-12  125  #define __VMALLOC_BASE_L5 	0xffa0000000000000UL
a7412546d8cb5a Kirill A. Shutemov  2018-02-14  126  
a7412546d8cb5a Kirill A. Shutemov  2018-02-14  127  #define VMALLOC_SIZE_TB_L4	32UL
a7412546d8cb5a Kirill A. Shutemov  2018-02-14  128  #define VMALLOC_SIZE_TB_L5	12800UL
a7412546d8cb5a Kirill A. Shutemov  2018-02-14  129  
14d12bb8582e15 Jiri Kosina         2018-04-12  130  #define __VMEMMAP_BASE_L4	0xffffea0000000000UL
14d12bb8582e15 Jiri Kosina         2018-04-12  131  #define __VMEMMAP_BASE_L5	0xffd4000000000000UL
92a0f81d89571e Thomas Gleixner     2017-12-20  132  
eedb92abb9bb03 Kirill A. Shutemov  2018-02-14  133  #ifdef CONFIG_DYNAMIC_MEMORY_LAYOUT
a95ae27c2ee1cb Thomas Garnier      2016-06-21  134  # define VMALLOC_START		vmalloc_base
ed7588d5dc6f5e Kirill A. Shutemov  2018-05-18  135  # define VMALLOC_SIZE_TB	(pgtable_l5_enabled() ? VMALLOC_SIZE_TB_L5 : VMALLOC_SIZE_TB_L4)
25dfe478533272 Thomas Garnier      2016-07-27  136  # define VMEMMAP_START		vmemmap_base
a95ae27c2ee1cb Thomas Garnier      2016-06-21  137  #else
a7412546d8cb5a Kirill A. Shutemov  2018-02-14  138  # define VMALLOC_START		__VMALLOC_BASE_L4
a7412546d8cb5a Kirill A. Shutemov  2018-02-14  139  # define VMALLOC_SIZE_TB	VMALLOC_SIZE_TB_L4
9b46a051e43461 Kirill A. Shutemov  2018-02-14  140  # define VMEMMAP_START		__VMEMMAP_BASE_L4
eedb92abb9bb03 Kirill A. Shutemov  2018-02-14  141  #endif /* CONFIG_DYNAMIC_MEMORY_LAYOUT */
92a0f81d89571e Thomas Gleixner     2017-12-20  142  
1a167ddd3c561b Alexander Potapenko 2022-09-15  143  /*
1a167ddd3c561b Alexander Potapenko 2022-09-15  144   * End of the region for which vmalloc page tables are pre-allocated.
1a167ddd3c561b Alexander Potapenko 2022-09-15  145   * For non-KMSAN builds, this is the same as VMALLOC_END.
1a167ddd3c561b Alexander Potapenko 2022-09-15  146   * For KMSAN builds, VMALLOC_START..VMEMORY_END is 4 times bigger than
1a167ddd3c561b Alexander Potapenko 2022-09-15  147   * VMALLOC_START..VMALLOC_END (see below).
1a167ddd3c561b Alexander Potapenko 2022-09-15  148   */
1a167ddd3c561b Alexander Potapenko 2022-09-15  149  #define VMEMORY_END		(VMALLOC_START + (VMALLOC_SIZE_TB << 40) - 1)
1a167ddd3c561b Alexander Potapenko 2022-09-15  150  
1a167ddd3c561b Alexander Potapenko 2022-09-15  151  #ifndef CONFIG_KMSAN
1a167ddd3c561b Alexander Potapenko 2022-09-15  152  #define VMALLOC_END		VMEMORY_END
1a167ddd3c561b Alexander Potapenko 2022-09-15  153  #else
1a167ddd3c561b Alexander Potapenko 2022-09-15  154  /*
1a167ddd3c561b Alexander Potapenko 2022-09-15  155   * In KMSAN builds vmalloc area is four times smaller, and the remaining 3/4
1a167ddd3c561b Alexander Potapenko 2022-09-15  156   * are used to keep the metadata for virtual pages. The memory formerly
1a167ddd3c561b Alexander Potapenko 2022-09-15  157   * belonging to vmalloc area is now laid out as follows:
1a167ddd3c561b Alexander Potapenko 2022-09-15  158   *
1a167ddd3c561b Alexander Potapenko 2022-09-15  159   * 1st quarter: VMALLOC_START to VMALLOC_END - new vmalloc area
1a167ddd3c561b Alexander Potapenko 2022-09-15  160   * 2nd quarter: KMSAN_VMALLOC_SHADOW_START to
1a167ddd3c561b Alexander Potapenko 2022-09-15  161   *              VMALLOC_END+KMSAN_VMALLOC_SHADOW_OFFSET - vmalloc area shadow
1a167ddd3c561b Alexander Potapenko 2022-09-15  162   * 3rd quarter: KMSAN_VMALLOC_ORIGIN_START to
1a167ddd3c561b Alexander Potapenko 2022-09-15  163   *              VMALLOC_END+KMSAN_VMALLOC_ORIGIN_OFFSET - vmalloc area origins
1a167ddd3c561b Alexander Potapenko 2022-09-15  164   * 4th quarter: KMSAN_MODULES_SHADOW_START to KMSAN_MODULES_ORIGIN_START
1a167ddd3c561b Alexander Potapenko 2022-09-15  165   *              - shadow for modules,
1a167ddd3c561b Alexander Potapenko 2022-09-15  166   *              KMSAN_MODULES_ORIGIN_START to
1a167ddd3c561b Alexander Potapenko 2022-09-15  167   *              KMSAN_MODULES_ORIGIN_START + MODULES_LEN - origins for modules.
1a167ddd3c561b Alexander Potapenko 2022-09-15  168   */
1a167ddd3c561b Alexander Potapenko 2022-09-15  169  #define VMALLOC_QUARTER_SIZE	((VMALLOC_SIZE_TB << 40) >> 2)
1a167ddd3c561b Alexander Potapenko 2022-09-15  170  #define VMALLOC_END		(VMALLOC_START + VMALLOC_QUARTER_SIZE - 1)
1a167ddd3c561b Alexander Potapenko 2022-09-15  171  
1a167ddd3c561b Alexander Potapenko 2022-09-15  172  /*
1a167ddd3c561b Alexander Potapenko 2022-09-15  173   * vmalloc metadata addresses are calculated by adding shadow/origin offsets
1a167ddd3c561b Alexander Potapenko 2022-09-15  174   * to vmalloc address.
1a167ddd3c561b Alexander Potapenko 2022-09-15  175   */
1a167ddd3c561b Alexander Potapenko 2022-09-15  176  #define KMSAN_VMALLOC_SHADOW_OFFSET	VMALLOC_QUARTER_SIZE
1a167ddd3c561b Alexander Potapenko 2022-09-15  177  #define KMSAN_VMALLOC_ORIGIN_OFFSET	(VMALLOC_QUARTER_SIZE << 1)
1a167ddd3c561b Alexander Potapenko 2022-09-15  178  
1a167ddd3c561b Alexander Potapenko 2022-09-15  179  #define KMSAN_VMALLOC_SHADOW_START	(VMALLOC_START + KMSAN_VMALLOC_SHADOW_OFFSET)
1a167ddd3c561b Alexander Potapenko 2022-09-15  180  #define KMSAN_VMALLOC_ORIGIN_START	(VMALLOC_START + KMSAN_VMALLOC_ORIGIN_OFFSET)
1a167ddd3c561b Alexander Potapenko 2022-09-15  181  
1a167ddd3c561b Alexander Potapenko 2022-09-15  182  /*
1a167ddd3c561b Alexander Potapenko 2022-09-15  183   * The shadow/origin for modules are placed one by one in the last 1/4 of
1a167ddd3c561b Alexander Potapenko 2022-09-15  184   * vmalloc space.
1a167ddd3c561b Alexander Potapenko 2022-09-15  185   */
1a167ddd3c561b Alexander Potapenko 2022-09-15  186  #define KMSAN_MODULES_SHADOW_START	(VMALLOC_END + KMSAN_VMALLOC_ORIGIN_OFFSET + 1)
1a167ddd3c561b Alexander Potapenko 2022-09-15  187  #define KMSAN_MODULES_ORIGIN_START	(KMSAN_MODULES_SHADOW_START + MODULES_LEN)
1a167ddd3c561b Alexander Potapenko 2022-09-15  188  #endif /* CONFIG_KMSAN */
92a0f81d89571e Thomas Gleixner     2017-12-20  189  
6145cfe394a7f1 Kees Cook           2013-10-10  190  #define MODULES_VADDR		(__START_KERNEL_map + KERNEL_IMAGE_SIZE)
f06bdd4001c257 Thomas Garnier      2017-03-14  191  /* The module sections ends with the start of the fixmap */
14df3267029158 Thomas Gleixner     2020-11-18  192  #ifndef CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP
f5a40711fa58f1 Andrey Ryabinin     2017-12-28  193  # define MODULES_END		_AC(0xffffffffff000000, UL)
14df3267029158 Thomas Gleixner     2020-11-18  194  #else
14df3267029158 Thomas Gleixner     2020-11-18  195  # define MODULES_END		_AC(0xfffffffffe000000, UL)
14df3267029158 Thomas Gleixner     2020-11-18  196  #endif
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  197  #define MODULES_LEN		(MODULES_END - MODULES_VADDR)
92a0f81d89571e Thomas Gleixner     2017-12-20  198  
3891a04aafd668 H. Peter Anvin      2014-04-29  199  #define ESPFIX_PGD_ENTRY	_AC(-2, UL)
1d33b219563fb9 Kirill A. Shutemov  2017-03-30  200  #define ESPFIX_BASE_ADDR	(ESPFIX_PGD_ENTRY << P4D_SHIFT)
92a0f81d89571e Thomas Gleixner     2017-12-20  201  
f2078904810373 Thomas Gleixner     2018-01-04  202  #define CPU_ENTRY_AREA_PGD	_AC(-4, UL)
92a0f81d89571e Thomas Gleixner     2017-12-20  203  #define CPU_ENTRY_AREA_BASE	(CPU_ENTRY_AREA_PGD << P4D_SHIFT)
92a0f81d89571e Thomas Gleixner     2017-12-20  204  
8266e31ed0fedb Mathias Krause      2014-09-21  205  #define EFI_VA_START		( -4 * (_AC(1, UL) << 30))
8266e31ed0fedb Mathias Krause      2014-09-21  206  #define EFI_VA_END		(-68 * (_AC(1, UL) << 30))
fb3551491b2044 Jeremy Fitzhardinge 2009-02-08  207  
8170e6bed465b4 H. Peter Anvin      2013-01-24  208  #define EARLY_DYNAMIC_PAGE_TABLES	64
8170e6bed465b4 H. Peter Anvin      2013-01-24  209  
76e258add7b653 Joerg Roedel        2018-07-18 @210  #define PGD_KERNEL_START	((PAGE_SIZE / 2) / sizeof(pgd_t))
76e258add7b653 Joerg Roedel        2018-07-18  211  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 02:12:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 02:12:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778357.1188402 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1semRR-0007DN-3o; Fri, 16 Aug 2024 02:11:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778357.1188402; Fri, 16 Aug 2024 02:11:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1semRR-0007DG-0o; Fri, 16 Aug 2024 02:11:49 +0000
Received: by outflank-mailman (input) for mailman id 778357;
 Fri, 16 Aug 2024 02:11:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=m3Oh=PP=intel.com=lkp@srs-se1.protection.inumbo.net>)
 id 1semRQ-0007DA-0I
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 02:11:48 +0000
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e030f989-5b74-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 04:11:45 +0200 (CEST)
Received: from orviesa006.jf.intel.com ([10.64.159.146])
 by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 15 Aug 2024 19:11:40 -0700
Received: from lkp-server01.sh.intel.com (HELO 9a732dc145d3) ([10.239.97.150])
 by orviesa006.jf.intel.com with ESMTP; 15 Aug 2024 19:11:36 -0700
Received: from kbuild by 9a732dc145d3 with local (Exim 4.96)
 (envelope-from <lkp@intel.com>) id 1semRB-0005rE-1y;
 Fri, 16 Aug 2024 02:11:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e030f989-5b74-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1723774306; x=1755310306;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=OOX2cGxCVM34YKQyi56frg88mnAg+Wq/NAETYLvmLkY=;
  b=Ss6abMsfvb7EmaNRTdbWdqqdTvyoduTWqfwGmgKBVvb/0kBtVdLnFxVs
   ze5mEvkigH4WYktoyOtm146DA+zZwu2WjsxqKoL+mpiAIqDgHcCdzqHBH
   ScTZSuianzbpiDFsWd8BzVnML1JxrVA4vd66t8/b0evnzxsT3w1a05KHx
   Ru8VG1p8Rs061lsOk1lRPfqicTZdJl5Kcbw3fTD9fUKzgOnxGIDlUaoVi
   CeomNyjdOcmJHdu+WOs3GY2sS5AkAEDtda9Pit/RoKd7ryXZrQg3HfTLS
   YLhL9X1SoHKYVGQC4ACjz3UlJiwY64zip/Ra6JSZ42hsxXu6qrL49BZZl
   Q==;
X-CSE-ConnectionGUID: mAFspmlITRyT+V/cRS7ctg==
X-CSE-MsgGUID: hso4ktRgQxms5crWfzldEQ==
X-IronPort-AV: E=McAfee;i="6700,10204,11165"; a="32636680"
X-IronPort-AV: E=Sophos;i="6.10,150,1719903600"; 
   d="scan'208";a="32636680"
X-CSE-ConnectionGUID: WwZsS+P0TomZpW046Balqg==
X-CSE-MsgGUID: axJ7B6N6Skal0/Hc4Tm5rw==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.10,150,1719903600"; 
   d="scan'208";a="59821404"
Date: Fri, 16 Aug 2024 10:10:59 +0800
From: kernel test robot <lkp@intel.com>
To: Jason Andryuk <jason.andryuk@amd.com>, Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>, x86@kernel.org,
	"H. Peter Anvin" <hpa@zytor.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Brian Gerst <brgerst@gmail.com>
Cc: oe-kbuild-all@lists.linux.dev, xen-devel@lists.xenproject.org,
	linux-kernel@vger.kernel.org, Jason Andryuk <jason.andryuk@amd.com>
Subject: Re: [PATCH v2 5/5] x86/pvh: Add 64bit relocation page tables
Message-ID: <202408160915.PcKFvj8w-lkp@intel.com>
References: <20240814195053.5564-6-jason.andryuk@amd.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240814195053.5564-6-jason.andryuk@amd.com>

Hi Jason,

kernel test robot noticed the following build errors:

[auto build test ERROR on tip/x86/core]
[also build test ERROR on xen-tip/linux-next tip/master linus/master v6.11-rc3 next-20240815]
[cannot apply to tip/auto-latest]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Jason-Andryuk/xen-sync-elfnote-h-from-xen-tree/20240815-035238
base:   tip/x86/core
patch link:    https://lore.kernel.org/r/20240814195053.5564-6-jason.andryuk%40amd.com
patch subject: [PATCH v2 5/5] x86/pvh: Add 64bit relocation page tables
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20240816/202408160915.PcKFvj8w-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240816/202408160915.PcKFvj8w-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408160915.PcKFvj8w-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   In file included from arch/x86/include/asm/pgtable_64.h:6,
                    from arch/x86/platform/pvh/head.S:19:
>> arch/x86/include/asm/pgtable_64_types.h:49: warning: "SHARED_KERNEL_PMD" redefined
      49 | #define SHARED_KERNEL_PMD       0
         | 
   In file included from arch/x86/include/asm/pgtable_32_types.h:11,
                    from arch/x86/include/asm/pgtable_types.h:275,
                    from arch/x86/include/asm/boot.h:6,
                    from arch/x86/platform/pvh/head.S:18:
   arch/x86/include/asm/pgtable-3level_types.h:30: note: this is the location of the previous definition
      30 | #define SHARED_KERNEL_PMD       (!static_cpu_has(X86_FEATURE_PTI))
         | 
   arch/x86/include/asm/pgtable_64_types.h:75: warning: "PGDIR_SHIFT" redefined
      75 | #define PGDIR_SHIFT             39
         | 
   arch/x86/include/asm/pgtable-3level_types.h:37: note: this is the location of the previous definition
      37 | #define PGDIR_SHIFT     30
         | 
>> arch/x86/include/asm/pgtable_64_types.h:76: warning: "PTRS_PER_PGD" redefined
      76 | #define PTRS_PER_PGD            512
         | 
   arch/x86/include/asm/pgtable-3level_types.h:38: note: this is the location of the previous definition
      38 | #define PTRS_PER_PGD    4
         | 
   arch/x86/include/asm/pgtable_64_types.h:99: warning: "PMD_SIZE" redefined
      99 | #define PMD_SIZE        (_AC(1, UL) << PMD_SHIFT)
         | 
   arch/x86/include/asm/pgtable_32_types.h:12: note: this is the location of the previous definition
      12 | # define PMD_SIZE       (1UL << PMD_SHIFT)
         | 
   arch/x86/include/asm/pgtable_64_types.h:103: warning: "PGDIR_SIZE" redefined
     103 | #define PGDIR_SIZE      (_AC(1, UL) << PGDIR_SHIFT)
         | 
   arch/x86/include/asm/pgtable_32_types.h:20: note: this is the location of the previous definition
      20 | #define PGDIR_SIZE      (1UL << PGDIR_SHIFT)
         | 
>> arch/x86/include/asm/pgtable_64_types.h:210: warning: "PGD_KERNEL_START" redefined
     210 | #define PGD_KERNEL_START        ((PAGE_SIZE / 2) / sizeof(pgd_t))
         | 
   arch/x86/include/asm/pgtable-3level_types.h:53: note: this is the location of the previous definition
      53 | #define PGD_KERNEL_START        (CONFIG_PAGE_OFFSET >> PGDIR_SHIFT)
         | 
   arch/x86/include/asm/pgtable_64.h: Assembler messages:
>> arch/x86/include/asm/pgtable_64.h:279: Error: invalid operands (*UND* and *ABS* sections) for `>>'


vim +279 arch/x86/include/asm/pgtable_64.h

09ef8f8e864fcb Jason Andryuk 2024-08-14  278  
09ef8f8e864fcb Jason Andryuk 2024-08-14 @279  L4_PAGE_OFFSET = l4_index(__PAGE_OFFSET_BASE_L4)
09ef8f8e864fcb Jason Andryuk 2024-08-14  280  L4_START_KERNEL = l4_index(__START_KERNEL_map)
09ef8f8e864fcb Jason Andryuk 2024-08-14  281  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 02:43:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 02:43:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778369.1188412 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1semwA-0003t5-Jn; Fri, 16 Aug 2024 02:43:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778369.1188412; Fri, 16 Aug 2024 02:43:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1semwA-0003sy-Gp; Fri, 16 Aug 2024 02:43:34 +0000
Received: by outflank-mailman (input) for mailman id 778369;
 Fri, 16 Aug 2024 02:43:32 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1semw8-0003so-JP; Fri, 16 Aug 2024 02:43:32 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1semw8-0002Gj-Cu; Fri, 16 Aug 2024 02:43:32 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1semw7-0002h9-KX; Fri, 16 Aug 2024 02:43:31 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1semw7-0003qj-JV; Fri, 16 Aug 2024 02:43:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=DPkBzWRmpHbPjz8xKv/jAVPb+ftFhP2xBZGcvd3fel8=; b=uGIiK7hMn+PZt1JHnFheFKMriL
	K396h/A1T2qNhMswhwOzbn5aYVHw5ot+W4kzDiQQEaoaoBBXOBFLyduw+Znls5RdshcTcxgZOebSP
	zRa+S/Ijw4etkPOjViWLdK6hJa0Cu98VUCl7k9PoSYziREbOvN1VjmTdp+1d8sfW94XQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187250-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187250: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=cbe73b848286f1e6b855c0ba328d56e0014d19e6
X-Osstest-Versions-That:
    xen=cbe73b848286f1e6b855c0ba328d56e0014d19e6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 16 Aug 2024 02:43:31 +0000

flight 187250 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187250/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187246
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187246
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187246
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187246
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187246
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187246
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  cbe73b848286f1e6b855c0ba328d56e0014d19e6
baseline version:
 xen                  cbe73b848286f1e6b855c0ba328d56e0014d19e6

Last test of basis   187250  2024-08-15 18:04:25 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 06:12:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 06:12:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778386.1188423 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seqBZ-0001wf-Rr; Fri, 16 Aug 2024 06:11:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778386.1188423; Fri, 16 Aug 2024 06:11:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seqBZ-0001wY-N5; Fri, 16 Aug 2024 06:11:41 +0000
Received: by outflank-mailman (input) for mailman id 778386;
 Fri, 16 Aug 2024 06:11: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=yoBP=PP=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1seqBX-0001wS-Oz
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 06:11:39 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 646e0212-5b96-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 08:11:36 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5bed72ff443so248a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 15 Aug 2024 23:11:36 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838eee8bsm206505966b.92.2024.08.15.23.11.27
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 15 Aug 2024 23:11:27 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 646e0212-5b96-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723788688; x=1724393488; 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=T6eIWBP3KkooutfeP1FxtFPBsUDuYmn9030CgneZzjQ=;
        b=S7dM/+ZrUI+SgcR8YHfXYvVvGf97uqk6+P0f8pWKzqxr6tFTODl+0JB2hcU8V4dtOv
         ci5/y/kviDjXDZSI2mUyTfvdafmGey1FwRjLzgucynv71PWDgXehGc1bGbWpdyPMdt+4
         9DHhcLhEAjv2lyiR3l8mH4X+C/HAP1f0E/Q13ncu1f7hfrDy4MCVBO/SZ9voby5Iwi0n
         r6K0kdo0hrnhes2J1bmS5mvnl0WPtjfmWqLGF3iL8kxpz3i3fbB8XpZNKPmCoTkhiyg9
         uxauSjkFq+ktrTUitGwWCYWRmzmbGLXaOsDrUtZSM09J9GE8FxKq2Yf+UtLw2IHWIogN
         j7aw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723788688; x=1724393488;
        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=T6eIWBP3KkooutfeP1FxtFPBsUDuYmn9030CgneZzjQ=;
        b=RG/dB0kZd4CaJGaAea6GDnH4AuXIhipBxTpbMQhZDASyozso6q2KyMjPpmp+sTXACp
         3uUYWWAUYIY1deuzLjZdi4VmvUvZZGXlBpQ2tdcwEhi0mDgOjFScs7IysC6HT6i5OQmp
         DCWAf3IjFGBkNjE5a4V9TRahQixwUcE8+mDVRj3lIHel9gRHuNEUySOAXte/O5cO48ZF
         rFzlb/nRfhJaaOKGtmXnSZbTnTfGOlsRQ+xFjJ4pQG9XmdO6zsKmAaQ45U0PDew/sqmi
         eq+KhhAdtnQXhI9zaJT0uu13g9j9WCv9KA+/RNj7kab/cPWzNlJIM6gJfnzk6V3irflN
         UJ2A==
X-Forwarded-Encrypted: i=1; AJvYcCXa7YVxGcr01nyyCd5poWSbNFaTrs7klLOT2IcemhpWEV8I3cFzCjbBaFcVWpxrO/Sc5uk6zT/R3JXCupwJ4h3hO6HVm2WSExJaVy324BM=
X-Gm-Message-State: AOJu0YzEwb6LIFCQO2ynMTw1fwK4+VYEnSpWl/x1mo7mIltoTTIIrY8X
	s38Jm1IqJURs9/ysmLS5l7/6w5XJ9jtVyvmnsOejBTl49/a+jeZEIcwuRwS2oQ==
X-Google-Smtp-Source: AGHT+IFEwZn0+PQXboCoU1N8NU3WXC0yMG/ExvjZl3pCkoNUfL5Wczvj0j3KFjMRKHoQTQprZ1wCqg==
X-Received: by 2002:a17:907:d85d:b0:a7a:83f8:cfd2 with SMTP id a640c23a62f3a-a839292e6f4mr136129066b.17.1723788688137;
        Thu, 15 Aug 2024 23:11:28 -0700 (PDT)
Message-ID: <89137a5a-4d7d-469e-a60c-3c6f649ee4f5@suse.com>
Date: Fri, 16 Aug 2024 08:11:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/3] x86/pv: Introduce x86_merge_dr6() and fix
 do_debug()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240815131600.4037415-1-andrew.cooper3@citrix.com>
 <20240815131600.4037415-2-andrew.cooper3@citrix.com>
 <82f78de2-3d93-4e51-a845-5bb96559a4cf@suse.com>
 <c02c15d6-9f59-41ff-aaf5-499bfffe4b8e@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <c02c15d6-9f59-41ff-aaf5-499bfffe4b8e@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 15.08.2024 18:34, Andrew Cooper wrote:
> On 15/08/2024 4:41 pm, Jan Beulich wrote:
>> On 15.08.2024 15:15, Andrew Cooper wrote:
>>> Pretty much everywhere in Xen the logic to update %dr6 when injecting #DB is
>>> buggy.  The architectural behaviour is to overwrite B{0..3} (rather than
>>> accumulate) and accumulate all other bits.
>> Just to double check (after 6 years I clearly don't recall anything that isn't
>> written down in the description): The SDM pretty vaguely says "Certain debug
>> exceptions may clear bits 0-3." What other information sources are there to
>> make this less uncertain? (Picking an old hardcopy from the shelf, that
>> confirms that long ago DR6 was indeed documented as all sticky.)
> 
> Well, "talking with the architects", but as always "it's complicated".
> 
> The debug infrastructure has had several breaking changes in it over the
> years (e.g. the reserved bits didn't use to be f's), and this one
> probably changed with the introduction of superscalar pipelines.  That
> said, I don't think I've ever found a Spec Update / Revision Guide that
> doesn't have one "oops we don't do breakpoints properly in this case"
> erratum listed.
> 
> I'm informed it's "most going on all exceptions" these days, and the
> behaviour here did come mostly from my discussions about XSA-308 (or
> rather, the pre-security angle where it was just a bugfix) with Intel.
> 
> A guest that does clear the status bits every #DB won't notice, and one
> that doesn't will have problems on real hardware.
> 
> But I can reword if if you'd prefer?

If I may ask, I'd like it to at least be clarified that documentation isn't
quite precise here. Kind of to soften "architectural behaviour" a little.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 07:12:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 07:12:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778398.1188432 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1ser83-00031v-9G; Fri, 16 Aug 2024 07:12:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778398.1188432; Fri, 16 Aug 2024 07:12:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1ser83-00031o-5t; Fri, 16 Aug 2024 07:12:07 +0000
Received: by outflank-mailman (input) for mailman id 778398;
 Fri, 16 Aug 2024 07:12:05 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=JmuG=PP=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1ser81-00031i-Qg
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 07:12:05 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on20630.outbound.protection.outlook.com
 [2a01:111:f403:2417::630])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d5dbfb09-5b9e-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 09:12:02 +0200 (CEST)
Received: from BL0PR01CA0020.prod.exchangelabs.com (2603:10b6:208:71::33) by
 CY8PR12MB7313.namprd12.prod.outlook.com (2603:10b6:930:53::17) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.7875.19; Fri, 16 Aug 2024 07:11:56 +0000
Received: from BL02EPF0001A108.namprd05.prod.outlook.com
 (2603:10b6:208:71:cafe::27) by BL0PR01CA0020.outlook.office365.com
 (2603:10b6:208:71::33) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend
 Transport; Fri, 16 Aug 2024 07:11:54 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BL02EPF0001A108.mail.protection.outlook.com (10.167.241.138) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Fri, 16 Aug 2024 07:11:53 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 16 Aug
 2024 02:11:38 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Fri, 16 Aug 2024 02:11:37 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d5dbfb09-5b9e-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=dB1WdUaX/yhvTdYLy/1W3A37jCGu2qSZWVhJBeJ+lhIH+2LwVf/aHckVSmL7/NckDg1FyhoSVTDPtGA8LVJW+cWns4ew4CV6VTbjhWxhXV9Ct7BKp2sALbyHhLKe3BvDMpIN5jJh7tG3Fom/Y851TZ4i/XIQdm6TwdeBlykQDQLUw5Xp5MPCas4n/fi7/aKItaimjHMQQM8hu48xf5frNSA9i/IwmQ3Y2dLxVTE0y8v+wMYw4aFDveDhAmtF5aK1jJE5BduFrW9e+daMgyySxr8Z5lNLKCf6xf0i5qnXpzt3EuRkSLSSiR9lwYfHeV3gwV6fktMjKgPDJKuUfY/f/A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=0FEyTELotu+c1MkQ841FkxFnA8pIZ1DEe1XapuEt3bs=;
 b=mFBBX+AslPYLnLhYnMZmQUXVi9uG2KgJeTGjR2GhA1AFBoSa8m9Y5XVKAfycVco86z4z0t2IxIUROlahBWCKgvlTf7aeSz5ihAk2Tq0KRkq9jgtc4jDmBnJx0/RUyIFYH8+H/vIXWF6ETPYu0A+GBHWbM9UE8sKKgGt3rZBfT1VaiKWoYrrG1q/wTjx/aAXV6sG/o9PXYueCCNaBf31MwNFaqxwXE+BnoTlv0s6iPPpaGMx9XJJ6ubyly9YWMX7qVEW+jGAdyLtOfFCn263l9DsIq1vx5b95qxZdc1nQ1clTFNnXAwKUCGyeynXu9iwtLALt7/c7jyycWmLFpKpcwA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=0FEyTELotu+c1MkQ841FkxFnA8pIZ1DEe1XapuEt3bs=;
 b=o/eCtVLiGSYo/OXK/pkI6P51hK9zhNt8k7qzGxPf4+ORpu3XUxgmhEFJozVZkUExDtBkmzHNbtdDGm4Ah/sWwOyuWFoEneIvNoH1GspSUO9uYgUFi6/g4RqXnla1nthLu7DroSoVjU1BGFgEC6n01bpcYFM0rhqAq8Wzp8460FQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <96e6d11c-aec3-4114-9956-011a431b9ad4@amd.com>
Date: Fri, 16 Aug 2024 09:11:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] automation: add default QEMU_TIMEOUT value if not already
 set
To: Stefano Stabellini <stefano.stabellini@amd.com>,
	<xen-devel@lists.xenproject.org>
CC: <sstabellini@kernel.org>, Doug Goldstein <cardoe@cardoe.com>, "Andrew
 Cooper" <andrew.cooper3@citrix.com>
References: <20240816010034.2199142-1-stefano.stabellini@amd.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240816010034.2199142-1-stefano.stabellini@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB04.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL02EPF0001A108:EE_|CY8PR12MB7313:EE_
X-MS-Office365-Filtering-Correlation-Id: b278b2f3-25ee-4289-a421-08dcbdc2b4e3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?RXZaOHRZRzlLOWJyWTRiWXkrTFZRVUhUUVZveVFKWCtaMjZIaTZQQUY5UGc0?=
 =?utf-8?B?eXRZMWFoTThrZGJ1dHlnRDVvNmh0OTFib2JSSmc4T29NKzBPYkRodDhtMS95?=
 =?utf-8?B?WmNOM2ZTdDhGL1lJbkxwZGpHZFlTV1BwdmhZdUF0SFYzYWNsRnByQloxWngy?=
 =?utf-8?B?b3BHakExdVMyeEJlUFAweTdGb0tDbEM2TXNCTmpENTFFYTg0R2x3c09FUWRu?=
 =?utf-8?B?NWlRcWNJTWRCMklpTDRjTC9GZTl0cGpicXgvTlVnZndVdnVoNHBTRmJXcUhI?=
 =?utf-8?B?TElDbXBGWWE0YUpPcUFxWGovYmxTUDlJekJESi9uNDZYUjdoZkVMM3dReG03?=
 =?utf-8?B?Z2RNamtYS2xMZTh3Q2dPQjdYZSt0ZmtWK25hYzlpK2labjR6aFFOZm5UYmln?=
 =?utf-8?B?TGVFU1FEZnRvM2ZyYVA4MWFLMGJTWkN5eFBUdERjbkNoY0Y5UmNiOFJwakoz?=
 =?utf-8?B?bDMvREtaVlhNRGFrV3YyWHhJZ0VQaXU1MnhwVlpqYXNxKzIxREdPUmtnRVo3?=
 =?utf-8?B?NHBqdmdicDB1WGRyZ1p0UkZaNzR5eTJSWnFQRmcvcktFdHcwRWk2V1pNMmpV?=
 =?utf-8?B?S0FFZlAvK1kwNENXRkdPK09oektzNVhDSGw2bkM4THk2S3BjN2RnbzlIMjBo?=
 =?utf-8?B?NmdBSXkrL3JrM3l5cjhEMjlKMmE5OVJrTmQ5MnhOd3Y4bUdFOE10V09XYXo3?=
 =?utf-8?B?d3d4SCswZlFacDZtcHVYcVcxUUhwSlNOTTlFTm5ZSW9DK2VESWVLaFZUeUt4?=
 =?utf-8?B?ZWs1YmlaQUFLT0IxZG1ST0psRUQraUdmdkk5cFpkWDR3dzVWN21aZFNxZ0RY?=
 =?utf-8?B?WExSeFFJSlM3cHlrQWU0SGhBVUQ4MFdNYjlyYllkT0ZwUStadmlqakFrRzJy?=
 =?utf-8?B?ckN1ZFZqay9LUVlqcVdvOUJvYisvMWdLL0VNcGNlY2hvcXFFZkZrdk5hS09y?=
 =?utf-8?B?QTlqeHR0MGV0V3BzNDNza0VJNU9KaVdLZHMxcXYzZDZwNk1zaFRPWVJ0T25w?=
 =?utf-8?B?cjRad1FacHJLdWVmSWdmQS9WMmU3b29pMDEvaUF2ZFJRTmhmMmdmN216UFNy?=
 =?utf-8?B?ZTJ0RDFXWXRyMk1MaC9RV205OVc3L3NYazN1MGlBRVVHL1VicitwcG5jMkhQ?=
 =?utf-8?B?d2lIRk9XdTVDeWJycXpnNEgyNTJrTzhWZ2hqeXllTVMwdWFKbFg1SU5uandO?=
 =?utf-8?B?YWtQYWdGM3VmWlpKd0U5NXg3T29vREdCVHZlWFJPWWw0TSs3dVp6YWJ5ckV0?=
 =?utf-8?B?cnZ5SHF4bE5kdFdpbUw3YXlHSVB0ckRwdHBTVGRPK09WTGduaFZ0UFN4UWYx?=
 =?utf-8?B?ckV0MnAxK2k2NU83MTdDWktyNGxOTk04VGFTYmx2a1R0ak9OcjB1alpBWEY1?=
 =?utf-8?B?K2dpRmFpNFRhWkp2NWJsb3pldDZTMHJGaTRZc284K0phVDVURWNkeEdKQnRO?=
 =?utf-8?B?blhFYmxqRGtDcGM2TkIxRW0rVnhKallnSzNLNTg3d2k0RE5FcFozVVRYeGhx?=
 =?utf-8?B?M1E5K0QxdGFvbTlQclJ4Q3hkYmZKY0FWT2VvZTZKeDNpcmJFS0gxZjUvcFhm?=
 =?utf-8?B?WCs0R2pGejExUEdraVdPT0JXYnBucG5NcXdtME1neUxFc2dxa2FHWjFVOFZp?=
 =?utf-8?B?c1NOSER4RXY0QndhTlhjTnU0djh5cDI4YW5hUXJKOXJYenlqbkd6V1JEdjB4?=
 =?utf-8?B?aXNvb0svaGZYR3h2TlFhQXlCaXVtTzhlV2h4enRicVEwb0ZlNmN5dEpwSGRZ?=
 =?utf-8?B?b1k4MGpTR1lJZlNxZ2lLMGVDdTZpOG5rQzY0RkVYNkc2NVdPdUlVMUtQY3pT?=
 =?utf-8?B?ZGtpQWI2OWxJUE5TMnUxQTNIYmxUZzk2OWpOOTU4dUhOZXRva3d0Y293Nk1Q?=
 =?utf-8?B?WExWYlVUcDI4R1FueWFxU2I2cUUxeEVyY1hubjlzdXBrZ0lIY0xhaURHQTVi?=
 =?utf-8?Q?5HuX7fCrabEPN/Y89Obd/Kge/1Ju2CvF?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2024 07:11:53.5265
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b278b2f3-25ee-4289-a421-08dcbdc2b4e3
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL02EPF0001A108.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7313



On 16/08/2024 03:00, Stefano Stabellini wrote:
> The expectation is that QEMU_TIMEOUT should be set as a Gitlab CI/CD
> variable but if not we should be able to run the pipeline anyway.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
> ---
>  automation/scripts/qemu-key.exp | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/automation/scripts/qemu-key.exp b/automation/scripts/qemu-key.exp
> index 35eb903a31..787f1f08cb 100755
> --- a/automation/scripts/qemu-key.exp
> +++ b/automation/scripts/qemu-key.exp
> @@ -1,6 +1,10 @@
>  #!/usr/bin/expect -f
>  
> -set timeout $env(QEMU_TIMEOUT)
> +if {[info exists env(QEMU_TIMEOUT)]} {
> +    set timeout $env(QEMU_TIMEOUT)
> +} else {
> +    set timeout 1500
> +}
>  
>  log_file -a $env(QEMU_LOG)
>  

Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 07:15:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 07:15:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778405.1188442 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1serBU-0003bW-Pb; Fri, 16 Aug 2024 07:15:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778405.1188442; Fri, 16 Aug 2024 07:15:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1serBU-0003bP-L6; Fri, 16 Aug 2024 07:15:40 +0000
Received: by outflank-mailman (input) for mailman id 778405;
 Fri, 16 Aug 2024 07:15:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=JmuG=PP=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1serBT-0003bJ-Ki
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 07:15:39 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on20619.outbound.protection.outlook.com
 [2a01:111:f403:2418::619])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 56087842-5b9f-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 09:15:38 +0200 (CEST)
Received: from BL1PR13CA0223.namprd13.prod.outlook.com (2603:10b6:208:2bf::18)
 by SJ0PR12MB6944.namprd12.prod.outlook.com (2603:10b6:a03:47b::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19; Fri, 16 Aug
 2024 07:15:33 +0000
Received: from BL02EPF0001A104.namprd05.prod.outlook.com
 (2603:10b6:208:2bf:cafe::df) by BL1PR13CA0223.outlook.office365.com
 (2603:10b6:208:2bf::18) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.10 via Frontend
 Transport; Fri, 16 Aug 2024 07:15:33 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BL02EPF0001A104.mail.protection.outlook.com (10.167.241.135) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Fri, 16 Aug 2024 07:15:33 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 16 Aug
 2024 02:15:32 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Fri, 16 Aug 2024 02:15:31 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 56087842-5b9f-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=SnxE28zwlMCFeQxuRrqGMWJ63ikBd0YKLCDiYxwGhVivdXUdNYUyQO3YqkN1IhlhY7xjZqbU/vn6H+yWYCukGbpm9KVUUGuzZugGVdrNJWf4jWJMMKYw94anEyWe4rPEdU8InjH0ZLgpCIBYp5bkVFnSE7EkLKMid5cEPiVIVflZ2q2d/1eXFk8mFvO/3tcXp+/FrMrsFGhQiSEi8wWZqiqnghiKbX2QcQPdkzONFPNHPOcPzY8T7nHOZtfLfe1oUvogJstZ8GD2FfE3QDj30NKaQkhn/LI6pFq1a/uaszwW+cFJTj+lk0oqaPuMz7hXXqII5nHEZNRyyeGEuPNPDA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=V8/B28iADeTcy5vexkMVL7Ck4XrfaH1ucAq2Vs70CK0=;
 b=GHA6ls7cEQTE6rB8SXLQbzyT2089dat+OIGZET2YvAqyMQIxJ9ZqE637HHfYy5KL2LGxlJ0C5pBWIu9lLmTDU5qEMPKpTv3wIm8Mbx72RQT2gjVSBtEyeAnzQo/430VJVyV+xRrYV/h9ec70JK+p6i4BahINO05Y9s8UgIZASCGVYD+RrV8AgdiICVO0CxyagXDASAxEcQw7fQvYRX51/F64udkZbiMXpv3jl/G/ohr+EZt1pb6qP1amh55hTKEOzV/xmZPMkuJFuvzIedZxbENIie6sN+oZPIkBHkhAfoKqdIYsuA3U3ZS1GNXrQoAby+sKo1oz9Hh8DdXkNpVzqw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=V8/B28iADeTcy5vexkMVL7Ck4XrfaH1ucAq2Vs70CK0=;
 b=rEbKWGYkGd2s/aphE955RVyORo8zMoostWm0WDKzd94odohwJwRH0QcIj49312np5iZz5ZH7SF4IS/QRR8GiPZXvItLU/eHsDgjm9slg1iY53pJsDb0hhhz8/cqoReGaaTxrXeSV11Vy3/sxDdDw/mVkGkbi8sNr0c3k97mKzGw=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <b306e03e-17d4-4d09-aa8c-78e44dacacca@amd.com>
Date: Fri, 16 Aug 2024 09:15:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/arm64: Hide FEAT_SME
To: Julien Grall <julien@xen.org>, <xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240814210054.67520-1-julien@xen.org>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240814210054.67520-1-julien@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB04.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL02EPF0001A104:EE_|SJ0PR12MB6944:EE_
X-MS-Office365-Filtering-Correlation-Id: db8762b4-623d-4260-a566-08dcbdc337e0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?aVBkbFFIbnUzSFc0NWxLaFZnYllhSFlHRFdMWm10TGRHYmw5RzBYQUp5WVdy?=
 =?utf-8?B?UTdocFJkRUJ5eUZJL0RTVHFtNG5TS29iMVlzR0l1Z2haQzk1KzV4bWNmZHB0?=
 =?utf-8?B?bE9FcWg1cTFuS2RaLzNONjdvckJYak11Sk5tc0ZycGpxOHptWFZ5V050Smtl?=
 =?utf-8?B?TlN0TG1DdUxmd1ZIcWJ1MUUzVUR2TU00NTZJcWRTRHRTZWVDTzlRYy9jdWZl?=
 =?utf-8?B?WUxDUytVcUJrNiszQ3BrZHBaR2p1dnVhOHdlVHRHY0VFN2dEQjRJaTFLenV5?=
 =?utf-8?B?NExnNGRadkZncFRPWWEvZmNJSnJENWYwaVFUclkrQkdzSmRTMVRTQlpyMTBm?=
 =?utf-8?B?WThDRGNBMFJqL2hTZFhGTlpBZ3k4V1c2RTdYTGRrbDVYZ3hINEN4QTIzWG9h?=
 =?utf-8?B?R1JXOG9Td0hjcEJyMWEzZE5HdWlWRSsvZWF3M01oNXBOUXd3WDJ1dGJoZVNh?=
 =?utf-8?B?aW8xalJGK2NJMkhuNXNvanVYdnhIcHpFVWJOai9SVGVJelpvVTl6eVBlT2Nx?=
 =?utf-8?B?WEVxVTlHV2VJeENqWGl4bW5rb2hxelRHZSszeEM5V0RtMFlCVlVNYUxoOEZr?=
 =?utf-8?B?dXNsS2FXZ3NPVmFoVlN3U3lJeUdRZVQ1TXVROEtSTlFkbnU0T05WaHJnU0tB?=
 =?utf-8?B?bkxEUVdqNis1YzVyVUUvelpKb1BWUFlhYnExaVBaZDhLaVhSZ0N1Z3d2R1Z0?=
 =?utf-8?B?V05ydjY2WFF0bURITHdnTHJRakdXcXIwSXQ0WFFOQzI3TkFvZlJFZlVHcHh6?=
 =?utf-8?B?aU96NFFqREpTREd4STZ2dUdNa21PdkEveVB3NTVCR05tNWMzOFhDK1dueTRF?=
 =?utf-8?B?bjBKNCtOR2RjeVRQa3lHeGJuSnQrOFgwUHVwQmFIYzRMZmFQaTRvS0MzWFQr?=
 =?utf-8?B?SjdNNWxaU3hhdHVCV1phSzF3eCtWWVdLUytkTFlmcFFQcmhjSkRyWlkxUklI?=
 =?utf-8?B?b0FNNGJwKzl4Ym9mOUR6SUR5SlU0cTZobWJKa05td0E3bmdIRzRJUjZBdlJj?=
 =?utf-8?B?RElweXdFRWI2d0Y2WDl0eWgyUVRGUjcydFZDN2ROcm9aMWl4aUI2ZlFhai9F?=
 =?utf-8?B?dmlucWFNWUlDQ3lmWG1pZHp5bEtCNjlFZFBpTzdUNWI4MnpBOUVZZEUvazFp?=
 =?utf-8?B?dlBWeWZpdWVqUXVxeFQ0SitYSU1hUDNDV2xvc0NUWDFjMDJhQjU5Nlk0Yjg4?=
 =?utf-8?B?YUt0K3JobXkyU09JcmV0WlBWTlJ4MW5SMVhnNENnd2M1d00vQUlDd0dscTMz?=
 =?utf-8?B?TjQzeXFLNGVaZTR3NEtGNXNXRER5V0M5cWZQc0U3UkpTZzh0cXVLM1ZhV1ZX?=
 =?utf-8?B?S3ZyUk5xSmszTG1FbXZYTFJETFJXd0JwbVJpcXRDZWo4N21HMlhFSzI3WFFI?=
 =?utf-8?B?YWNzeWgzUktibndUbEVtZ25YbU5mZUJrWUpyaC9qWU5RTHB1RVpFTE5uOThI?=
 =?utf-8?B?ckorWTk4U3RTUGtzR3I2R0tIdW1RMURrK0RiK3hoc2wxT0dIb0lmbFgwTUpj?=
 =?utf-8?B?L1I2SHVjQkN3VlFOZEsvSDFKRmUzT0crMGI0UUN2WFBEZGFRblVjYVRYS0p1?=
 =?utf-8?B?SkxMb0w5dHJqY1dqekZsMXJjSXBXc2VwRGg1aHVjUXNQU0ZjN05kUlJKS0tG?=
 =?utf-8?B?QWZDVi80d1RJMi90NmtKYVFDa1UrejVyb25IbG16R1FBTHRpdVA1N1lvWVpi?=
 =?utf-8?B?U0liQTh1dVhnSFhJZ2JYS1A0ZmhVUVUvdVA0Snd4azJFUTRiWG1mSzVaUEs3?=
 =?utf-8?B?V1ZZUVlaNk91cjFTbFZZNENNSW1XYkkwdjBVdTJ2RkFCLzVCdi9DNmFJdHF6?=
 =?utf-8?B?YzdHQUpyNTFEM0RpbUNDMXlydEROeEdVU0tyRjZhbm9GeUtzZHZDNjNPUGQr?=
 =?utf-8?B?TUxVN0JZWTQ4L1dETEhIZDBUYjZMR3gyc0lxSG83bWExSUZFTGNOdkZVcDhl?=
 =?utf-8?Q?04jlAizSi0YWK67Nd9XtaS001n1bzFKe?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2024 07:15:33.2884
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: db8762b4-623d-4260-a566-08dcbdc337e0
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL02EPF0001A104.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6944

Hi Julien,

On 14/08/2024 23:00, Julien Grall wrote:
> 
> 
> Newer hardware may support FEAT_SME. Xen doesn't have any knowledge but
> it will still expose the feature to the VM. If the OS is trying to use
> SME, then it will crash.
> 
> Solve by hiding FEAT_SME.
> 
> Signed-off-by: Julien Grall <julien@xen.org>
Acked-by: Michal Orzel <michal.orzel@amd.com>

> 
> ---
> 
> The current approach used to create the domain cpuinfo is to hide
> (i.e. a denylist) what we know Xen is not supporting. The drawback
> with this approach is for newly introduced feature, Xen will expose it
> by default.
> 
> If a kernel is trying to use it then it will crash. I can't really
> make my mind whether it would be better to expose only what we support
> (i.e. use an allowlist).
> 
> AFAICT, there is no security concerns with the current approach because
> ID_* registers are not a way to tell the kernel which features are
> supported. A guest kernel could still try to access the new registers.
I agree with the security aspect but the part of the sentence in the middle is a bit misleading.
ID_ registers *are* a way of informing the kernel about implemented PE features. It's just that
the kernel could still access the features. That said, it should be considered an incorrect behavior
and definitely not something we should worry about.

~Michal


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 08:55:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 08:55:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778424.1188451 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sesjN-0002tC-Io; Fri, 16 Aug 2024 08:54:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778424.1188451; Fri, 16 Aug 2024 08:54:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sesjN-0002t5-GK; Fri, 16 Aug 2024 08:54:45 +0000
Received: by outflank-mailman (input) for mailman id 778424;
 Fri, 16 Aug 2024 08:54:44 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=yjix=PP=bounce.vates.tech=bounce-md_30504962.66bf13d0.v1-ac3bf4db3f7c4d75accfe4bc309cd023@srs-se1.protection.inumbo.net>)
 id 1sesjL-0002sz-SQ
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 08:54:44 +0000
Received: from mail186-11.suw21.mandrillapp.com
 (mail186-11.suw21.mandrillapp.com [198.2.186.11])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2cd02b76-5bad-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 10:54:41 +0200 (CEST)
Received: from pmta10.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail186-11.suw21.mandrillapp.com (Mailchimp) with ESMTP id
 4WlbQm43DyzLfHCqG
 for <xen-devel@lists.xenproject.org>; Fri, 16 Aug 2024 08:54:40 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 ac3bf4db3f7c4d75accfe4bc309cd023; Fri, 16 Aug 2024 08:54:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2cd02b76-5bad-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1723798480; x=1724058980;
	bh=8kQsH7eQyW6rWZBoG8iP9iO2Zo0stjNNaGsUaLDbesU=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=qtM8t06+2Vx9a7/oYWV9IHruM9vq5Fgq/jJb6n4+xNUiG1TT2oeTTLYTZaQKjQs1q
	 JuyalRXPVWX76qL2iiEBegXq6VBQkrKTQIwpIdVwk74Rz1uFplAeP67eWxDBEFKsRr
	 TYnCD3z+PamSn/vnXbmQ/G2aOosPGJdjl9yMNLee63HbEcPvAfVzln3W2gDRo+qNsO
	 TBOjZZSmMN5ZiuossOlXaSjD4MS5bKWIzKB99uEnZ6YXgNKQUtGpzdR8R0xx1vNCUv
	 a8u5GPyYFzPgHG4E5kkVT6z3evQw8IjjX1dMfQaLxKkNZe/eTWSD9gndcCzptVtSi+
	 9719e+kuaKvnQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1723798480; x=1724058980; i=anthony.perard@vates.tech;
	bh=8kQsH7eQyW6rWZBoG8iP9iO2Zo0stjNNaGsUaLDbesU=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=ARPvptkTbmQYj9Il/BYxwSIqNlAAgD8cLPS1U3VhtGB3TOcZOJnZUGXFG1zbws/BL
	 7MrpmvuW7bBr0TGbHjiM2z0EVM2uOWyP/BG7EyxU1+wyYMTrEuOlbeAnaE+i7OZDn1
	 EUlU7j/InSx2obFdsTN2Cp1bUgPfLMpGrEamEmM5D8geP+xGsqbZQMA6+hfgKNzai+
	 HefK8HtBxncs+0Xc8DHLlK4ZNJHqqc+P1YqZCHiUi8WxCK4Y8QvBhtCYmBQgUmE0zw
	 0DfAIKOz/CpKI2zlxzjefjthf6tTDGj2WIEL8z7V29ydKoSWsQ2pK9cYxiML7KCRi5
	 HPDslA9D8le3w==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=20v2]=20mktarball:=20only=20archive=20Xen?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1723798479578
To: Jan Beulich <jbeulich@suse.com>
Cc: xen-devel@lists.xenproject.org, Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
Message-Id: <Zr8TzofOZ4ul0Uu1@l14>
References: <5d8c1cf6-71cc-4c1b-b2cc-2b9ff4829c04@suse.com>
In-Reply-To: <5d8c1cf6-71cc-4c1b-b2cc-2b9ff4829c04@suse.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.ac3bf4db3f7c4d75accfe4bc309cd023?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240816:md
Date: Fri, 16 Aug 2024 08:54:40 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Wed, Aug 14, 2024 at 09:42:46AM +0200, Jan Beulich wrote:
> --- a/Makefile
> +++ b/Makefile
> @@ -200,10 +200,6 @@ rpmball: dist
>  subtree-force-update: mini-os-dir-force-update
>  	$(MAKE) -C tools subtree-force-update
>  
> -.PHONY: subtree-force-update-all
> -subtree-force-update-all: mini-os-dir-force-update
> -	$(MAKE) -C tools subtree-force-update-all

If this rule is removed, the one in tools/Makefile and the one in
tools/firmware/Makefile should be removed as well. (Also remove that
string from $(no-configure-targets) in tools/Rules.mk.)

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 09:10:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 09:10:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778432.1188461 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sesy6-0005Sd-R5; Fri, 16 Aug 2024 09:09:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778432.1188461; Fri, 16 Aug 2024 09:09:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sesy6-0005SW-OY; Fri, 16 Aug 2024 09:09:58 +0000
Received: by outflank-mailman (input) for mailman id 778432;
 Fri, 16 Aug 2024 09:09:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=6pmz=PP=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sesy5-0005SQ-1O
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 09:09:57 +0000
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com
 [2a00:1450:4864:20::132])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4e03f29e-5baf-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 11:09:55 +0200 (CEST)
Received: by mail-lf1-x132.google.com with SMTP id
 2adb3069b0e04-52efd530a4eso2866905e87.0
 for <xen-devel@lists.xenproject.org>; Fri, 16 Aug 2024 02:09:55 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5330d3afb37sm489003e87.20.2024.08.16.02.09.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 16 Aug 2024 02:09:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4e03f29e-5baf-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723799395; x=1724404195; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=vUEZdaXsro3QmbQ+m7qaUpgvb6+JGU58LOwr5bfWnVc=;
        b=gzt4OAYmpa8viJX6V/0wxR94G6cVPz6WeStt/zraVf+qjrcrW1W/Lg3n6cexb5X8Z1
         LS2iWX/SeqKQlB/K3xCGfzYSJG+NXvCE28p3lfeN9Xzbgi6Xe1Q83r8uqPjMpkzEm1dV
         Aof6yKNOaHLAZHx8MGzqFl+tTOyu7OSF+wVuhkpanDKt90IdOKLJh/DsLArXy+CawWpj
         5KBi4CG1TQ+RRsFEMeUlxyygHqFBgjncyXvvM9k61Tw0AinpztJe4IN6HUEFFRJZAAzE
         Fbg1ao+HynH2vrLbG5TPcLbwsYd0oytNaJ+Zn/dp3jumSODWTPsECbrL5L9NFQBrwiD9
         J9iw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723799395; x=1724404195;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=vUEZdaXsro3QmbQ+m7qaUpgvb6+JGU58LOwr5bfWnVc=;
        b=K4l1O1PQGRUJMDUWTKDMKxkx/DgkoIJm2FbcHNpCCaGgTzm4Yqij3lvwLwDhHxaUVw
         3BN+lEQrkbKDdjxvFn9cbJNrkzR3qZbRJctiDoWyZH+IW5PM31rkYnVkL5FXoZdt73M6
         LZbP3cBJDSfkBY7L5KrvC7MgK226hHpn/s1fry8NFxkQyYMpgx3oxHWzyhXV3oFLfoWv
         SsxiCIQJa2IkvDHGxfdIW7OvJjXm56wj+95AICeon+GLmkquepriV99nTqGoKJX00hGC
         gvFRYmQ+FKo3UC4YGTz8R9b8wT/LR+tOmLsuLSsMeeuH9msBr00ZWZvpAJSp4L7l12cg
         ZdGg==
X-Forwarded-Encrypted: i=1; AJvYcCWPiegzwEEkKbXySJzqAKeX5K/1/DQ4JTkYSGbhHzTzigcVg1THa9+x1L1lwlRnAecr/pfsnuupIztv1Jegndrf/3lfd+WjjDPhKwveesw=
X-Gm-Message-State: AOJu0Yyo3JHSG03OpnJL4NjOZdt5mM/kqfbUW09+LtYaMmDudKfAeE1g
	flyLQULssddNFDwlaFxTFV8mTnv6SE7chZ6rNz+7AgeimA1hUqGJ
X-Google-Smtp-Source: AGHT+IGXm96dJ30fnCB3CUOQf4N+vfPiwX1Mzss78YvORz+wp1vxsuf8wWJtORxgUNtUrKXToxSUow==
X-Received: by 2002:a05:6512:280a:b0:52c:e11e:d493 with SMTP id 2adb3069b0e04-5331c6b1d27mr1352635e87.26.1723799394831;
        Fri, 16 Aug 2024 02:09:54 -0700 (PDT)
Message-ID: <337a2fe952b7e81c27fae67c23154eefa2f7ae42.camel@gmail.com>
Subject: Re: [PATCH v4 6/7] xen/riscv: page table handling
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Fri, 16 Aug 2024 11:09:53 +0200
In-Reply-To: <63af73be-d95e-47d5-bfbe-7f0304118a17@suse.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
	 <8362795280a48702bef6f01d41d148edcf299935.1723214540.git.oleksii.kurochko@gmail.com>
	 <85a4e760-07af-42bd-ac27-12a4fa5172cc@suse.com>
	 <1e83981cff0b6c47aa941e7ffee0ce658aefef22.camel@gmail.com>
	 <d41f3027-14c8-4716-9444-d8bc109bb2b7@suse.com>
	 <be47249638cbae5e057279acd9a3464c218fbac8.camel@gmail.com>
	 <2ded848e-f2a5-4005-b4c6-09014a92122c@suse.com>
	 <48fc698708a87fed986cbb6526a6422bae488823.camel@gmail.com>
	 <63af73be-d95e-47d5-bfbe-7f0304118a17@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Thu, 2024-08-15 at 17:26 +0200, Jan Beulich wrote:
> On 15.08.2024 15:34, oleksii.kurochko@gmail.com=C2=A0wrote:
> > On Thu, 2024-08-15 at 14:16 +0200, Jan Beulich wrote:
> > > On 15.08.2024 13:21, oleksii.kurochko@gmail.com=C2=A0wrote:
> > > > On Thu, 2024-08-15 at 10:09 +0200, Jan Beulich wrote:
> > > > > On 14.08.2024 18:50, oleksii.kurochko@gmail.com=C2=A0wrote:
> > > > > > On Tue, 2024-08-13 at 12:31 +0200, Jan Beulich wrote:
> > > > > > > On 09.08.2024 18:19, Oleksii Kurochko wrote:
> > > > > > > > RISC-V detects superpages using `pte.x` and `pte.r`, as
> > > > > > > > there
> > > > > > > > is no specific bit in the PTE for this purpose. From
> > > > > > > > the
> > > > > > > > RISC-V
> > > > > > > > spec:
> > > > > > > > ```
> > > > > > > > =C2=A0 ...
> > > > > > > > =C2=A0 4. Otherwise, the PTE is valid. If pte.r =3D 1 or pt=
e.x
> > > > > > > > =3D
> > > > > > > > 1, go
> > > > > > > > to
> > > > > > > > step 5.
> > > > > > > > =C2=A0=C2=A0=C2=A0=C2=A0 Otherwise, this PTE is a pointer t=
o the next level
> > > > > > > > of
> > > > > > > > the
> > > > > > > > page
> > > > > > > > table.
> > > > > > > > =C2=A0=C2=A0=C2=A0=C2=A0 ... .
> > > > > > > > =C2=A0 5. A leaf PTE has been found.
> > > > > > > > =C2=A0=C2=A0=C2=A0=C2=A0 ...
> > > > > > > > =C2=A0 ...
> > > > > > > > ```
> > > > > > > >=20
> > > > > > > > The code doesn=E2=80=99t support super page shattering so 4=
KB
> > > > > > > > pages
> > > > > > > > are
> > > > > > > > used as
> > > > > > > > default.
> > > > > > >=20
> > > > > > > ... you have this. Yet still callers expecting re-mapping
> > > > > > > in
> > > > > > > the
> > > > > > > (large)
> > > > > > > range they map can request small-page mappings right
> > > > > > > away.
> > > > > > I am not sure that I fully understand what do you mean by
> > > > > > "expcting
> > > > > > re-
> > > > > > mapping".
> > > > >=20
> > > > > Right now you have callers pass PTE_BLOCK when they know that
> > > > > no
> > > > > small
> > > > > page re-mappings are going to occur for an area. What I'm
> > > > > suggesting
> > > > > is
> > > > > that you invert this logic: Have callers pass PTE_SMALL when
> > > > > there is
> > > > > a possibility that re-mapping requests may be issued later.
> > > > > Then,
> > > > > later, by simply grep-ing for PTE_SMALL you'll be able to
> > > > > easily
> > > > > find
> > > > > all candidates that possibly can be relaxed when super-page
> > > > > shattering
> > > > > starts being supported. That's going to be easier than
> > > > > finding
> > > > > all
> > > > > instances where PTE_BLOCK is _not_used.
> > > > So if I understand correctly. Actually nothing will change in
> > > > algorithm
> > > > of pt_update() and only PTE_SMALL should be introduced instead
> > > > of
> > > > PTE_BLOCK. And if I will know that something will be better to
> > > > map
> > > > as
> > > > PTE_SMALL to not face shattering in case of unmap (for example)
> > > > I
> > > > just
> > > > can map this memory as PTE_SMALL and that is it?
> > >=20
> > > That is it.
> > >=20
> > > > > > > > +=C2=A0=C2=A0=C2=A0 spin_unlock(&xen_pt_lock);
> > > > > > >=20
> > > > > > > Does this really need to come after fence and flush?
> > > > > > I think yes, as page table should be updated only by 1 CPU
> > > > > > at
> > > > > > the
> > > > > > same
> > > > > > time. And before give ability to other CPU to update page
> > > > > > table
> > > > > > we
> > > > > > have
> > > > > > to finish a work on current CPU.
> > > > >=20
> > > > > Can you then explain to me, perhaps by way of an example,
> > > > > what
> > > > > will
> > > > > go
> > > > > wrong if the unlock is ahead of the flush? (I'm less certain
> > > > > about
> > > > > the
> > > > > fence, and that's also less expensive.)
> > > > pt_update() will be called for interleaved region, for example,
> > > > by
> > > > different CPUs:
> > > >=20
> > > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pt_update():
> > > > CPU1:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 CPU2:
> > > > =C2=A0...=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 spin_lock(&xen_pt_lo=
ck);
> > > > RISCV_FENCE(rw, rw);=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ....
> > > >=20
> > > > /* After this function will be
> > > > =C2=A0=C2=A0 executed the following thing
> > > > =C2=A0=C2=A0 can happen ------------------>=C2=A0 start to update p=
age table
> > > > */=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 entries which was
> > > > partially=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
> > > > spin_unlock(&xen_pt_lock);=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 created during CPU1 but
> > > > CPU2=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=20
> > > > ....=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 doesn't know about them
> > > > yet=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=20
> > > > ....=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 because flush_tlb() (
> > > > sfence.vma
> > > > )=20
> > > > ....=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 wasn't done=C2=A0=C2=A0=C2=A0=C2=
=A0 =C2=A0
> > > > ....=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
> > > > =C2=A0=C2=A0=C2=A0=C2=A0
> > > > =C2=A0=C2=A0=20
> > > > flush_tlb_range_va();
> > >=20
> > > Not exactly: CPU2 knows about them as far as the memory used /
> > > modified
> > > goes, and that's all that matters for further page table
> > > modifications.
> > > CPU2 only doesn't know about the new page table entries yet when
> > > it
> > > comes
> > > to using them for a translation (by the hardware page walker).
> > > Yet
> > > this
> > > aspect is irrelevant here, if I'm not mistaken.
> > And it isn't an issue that CPU2 will add these new page table
> > entries
> > again during execution of CPU2's pt_update()?
>=20
> Add these page table entries again? That's only going to happen due
> to
> another bug somewhere, I suppose. And it would be as much (or as
> little)
> of an issue if that happened right after dropping the lock.
Yes, agree, it sounds more like a bug. Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 09:28:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 09:28:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778442.1188472 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1setFp-0000gr-DU; Fri, 16 Aug 2024 09:28:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778442.1188472; Fri, 16 Aug 2024 09:28:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1setFp-0000gk-Aa; Fri, 16 Aug 2024 09:28:17 +0000
Received: by outflank-mailman (input) for mailman id 778442;
 Fri, 16 Aug 2024 09:28: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=JmuG=PP=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1setFo-0000ge-48
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 09:28:16 +0000
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on20601.outbound.protection.outlook.com
 [2a01:111:f400:7e88::601])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dbfd898d-5bb1-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 11:28:14 +0200 (CEST)
Received: from DS7PR03CA0245.namprd03.prod.outlook.com (2603:10b6:5:3b3::10)
 by DM4PR12MB6565.namprd12.prod.outlook.com (2603:10b6:8:8c::14) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19; Fri, 16 Aug
 2024 09:28:09 +0000
Received: from CH3PEPF00000012.namprd21.prod.outlook.com
 (2603:10b6:5:3b3:cafe::84) by DS7PR03CA0245.outlook.office365.com
 (2603:10b6:5:3b3::10) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19 via Frontend
 Transport; Fri, 16 Aug 2024 09:28:09 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CH3PEPF00000012.mail.protection.outlook.com (10.167.244.117) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.4 via Frontend Transport; Fri, 16 Aug 2024 09:28:08 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 16 Aug
 2024 04:28:08 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 16 Aug
 2024 04:28:08 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Fri, 16 Aug 2024 04:28:06 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dbfd898d-5bb1-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=xXbITgBc6smELDw8AZD0zkv+RgwiEbq1CdGOkD1C5oYBn5MTqWCSZagP7Yu3VGocYER4q+6Sv6+Z2Zyena7NbC9ZMKhN+C2L9t0ydHX5soak/m9l/970MqvX/k14T1q7SC5JrZLHTv1+PNffKyYdM1TtJAEQbHf3yccenGvLvpvOgpyFD4HmWrcU7SkAzU2QzkTftfQJ5mKqrZSNwLSRP/uFjunZkrGQD+tq1b25e/BBLJ8W5q2/H6yZP4N4KWEUI97WPVfLfRo3qU7MAKjDFI2Wq+fz1rfLiWHnsrsGZE6B7VEtsNV8Eb11iM8myOAt7/mpebsiIT6ce2eqhs0oQQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=bra6CCrp3DnE2rw0HNPS4yYAQIPTe+xVNSb3Rx+LVXM=;
 b=pMgePXrR0GRgK67fxaiR9Khb1Jij0QdcHIGo0cSaBeCwrVEs8Y/oroT5IsqnHjKg8iRND5Ee422GKJHhNAc5wRMnvRk527CdaJdijWQFJEqFubXGLsjwY29nguS0Ba8TqfpBwQsJFuaDjl6tHoNbLPWIJVeBNNapB+onrYJV+mVGPI07hGq5cnbMQP45QhdnebOdOkspG6ujZCVlFKk+LZHkCXx/gIjTYsQYZXkBx2buwFQSkxfu+qsMC9JDn64TBnl5WM39nvpPY3dcjI8styVaptIqC4pqsQeRdm452gXJGQ6RiX0eWSUqW1JrDrkB0HKVLjg3GX+rA3adKFCGjQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=bra6CCrp3DnE2rw0HNPS4yYAQIPTe+xVNSb3Rx+LVXM=;
 b=Fegc/7ZUqUH5NHg1O4tq1vPnQGo6X0rWqIEqgKhmGOPNaRdEHv7v8ddh+UHSIKqeH9v0vQYzz8dqqpfnIsYPVeC/WqLTfXTZeI19Sugtt+x/zVNp4k46Vgw4Mxr9mYJqL+vnbgQlBizkXQiWObdjobMaMJP8XoqCxmwv1VtQwYY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <03682a1f-f4d1-4d07-ba86-8e9fc6ed044c@amd.com>
Date: Fri, 16 Aug 2024 11:28:05 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
To: Ayan Kumar Halder <ayankuma@amd.com>, Jan Beulich <jbeulich@suse.com>,
	Ayan Kumar Halder <ayan.kumar.halder@amd.com>
CC: <xen-devel@lists.xenproject.org>, Penny Zheng <penny.zheng@arm.com>, "Wei
 Chen" <wei.chen@arm.com>, <sstabellini@kernel.org>,
	<bertrand.marquis@arm.com>, <Volodymyr_Babchuk@epam.com>, <julien@xen.org>
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
 <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
 <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
 <dad27ab7-3cbd-4a8e-8200-adea52b26e55@suse.com>
 <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH3PEPF00000012:EE_|DM4PR12MB6565:EE_
X-MS-Office365-Filtering-Correlation-Id: 8d584732-037c-42a6-e88f-08dcbdd5bdd9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?NWkrOUtuS3dTY1ZaM1hUbUp5V2d6NWtuWVV0UjNvUWdyVndwcW5OelRZSzdo?=
 =?utf-8?B?eldXSUkyQjdCb1dXYjhXb2l3dU82Sk9KM0Y4amJVZ0Nzc2E3c2Vkanp0T3FF?=
 =?utf-8?B?c3RGT1lDWnQ3QmhRWWZCQzVONnNnQ29pTWlkT0xuaU5Kb1I0WEcrQnpmSW0r?=
 =?utf-8?B?WEZIdElIVW1DaENoOUFVV1ZFNmJuK2I4OXExSldud3VISS9OU1luVjVIYnhh?=
 =?utf-8?B?aTFGMGhha1VVMzZMKzA3NmN4V3BFaXlFR0Vic1AwS2YwY1V0NXBWcTV5NlZ0?=
 =?utf-8?B?TWhqRnd3TVpZUVFKUkJheXE4aXRHNXR5OUVlbW1QZlhzNFpoTWdxSllvTlQ3?=
 =?utf-8?B?K3lOZDNSaHFEYWNNVFVFYnh2TVVEdXYvcUxvdk80dzl1U1dWTGZwTGdSRkFF?=
 =?utf-8?B?Q1g0R294UEdpK0twQVFMVUk1cFBVQUhFajZPaVpaNXFqOTNSQ1AwZU1MZFJF?=
 =?utf-8?B?cWROSzVEcWwwQXZpUk5LdURQeTYyb2cra0dnTTZTS1BHVGhJZzRDSFVYaWFl?=
 =?utf-8?B?VHNnQ3JxNi9QTWsrbkFOemdqU2NpRGMrMGpjS2RMR2dCQ3dJaUd3NklQeU40?=
 =?utf-8?B?Mjg5b0dIWjZhS2wwRWJpVEtKQ3FjUkk3bXdOVlUwcGlxa1U0L3oycFppQmZv?=
 =?utf-8?B?eTBRYnBvaTVTbzJpOVNuOE94NExyR3pSU3dxaDdzRXFxMDkzOVEzUkxSVkF6?=
 =?utf-8?B?QzFRdVIvTFExeHVUdFZNQ0Y4UTdQOWZnb0JCT1BISnVWejlyclNQbk5aWWt3?=
 =?utf-8?B?dDlnT3o2eUVCYUNmN0JWZ0FINXVudkdHNWNubUpnSk4rMk5TdFlvcE5BcFpp?=
 =?utf-8?B?OHdacmNYUnRDa3pqM05PM3RKWk1yeUFzZnlaQ3N1dDVSMFE1M0J2RGE2U2or?=
 =?utf-8?B?YXZiYnpQRFJ5eXZrOS9sMklSMGs3ZTEyQlAvb0dJUnRlcjI0dXU2MjJxdXR2?=
 =?utf-8?B?dVBIQmQrRWh4M3RKSVgxc0RmcTBTSG83Wkh5Ny9ZNDBRYUR1TjNRL0pRd3hR?=
 =?utf-8?B?Nmh6cVZjSHZtK3FkeW1nUWl6SXkvRm5WanRPdUZqL0RNbi9pSjBSdDE3MHUx?=
 =?utf-8?B?dmU1M0oyaXo3VU5OMmcxT0EyRjN6VVJoUWRiWm8vRzJCbXVBRDhaLzM4QjRY?=
 =?utf-8?B?L0dyZmNaN2xjc1U1TmRSbCs2VVRkZ2ljQ1NScDlRK05HcDVCRXVCV1RrSnAv?=
 =?utf-8?B?bVorcmdod1JlUzJPZXFkWWV2YzdPYklyT05ub1ZMc1daY3VDTUpQdHI3ckx2?=
 =?utf-8?B?ajBKQkI3ZWpoa0k3ZWg3ZzFza3MzYVNnS3hSOWVzWDJQOXd5d2dETFYyWExn?=
 =?utf-8?B?R0xIdGVvclJvcDA3MldLekpyOFNoOE5CR2xTTU9DM1ZHMVVnckIzNzRvTmJB?=
 =?utf-8?B?aXNJS2pZK1J6NDdtTDNkaFYwUWhyQzBtUmw3N2dGVzVSWVM0bjFibVRTK0g3?=
 =?utf-8?B?alZzY0R0L0VPQzdWVkp5K28ycGRjb25kVFVQLzBpNW0vdVMxRFNoTWRZUTUv?=
 =?utf-8?B?U0R4NVhGSTRHQmozZHkwY3Rxdnl6ZW9jeUlLQ29Sb2JMaFFVMWFnbC8rcTc5?=
 =?utf-8?B?ZWhSU09pblNlcU84K2FvVld6czNLeDIrQzZ2N2QzMTF4RVhURk0zSHJrNWFT?=
 =?utf-8?B?Tk5rSnVzaUxVVkozbjg5VzYzeEpRTkdHYW1WUUlFbWQ3WU9uTFEwSFZwVnNJ?=
 =?utf-8?B?encvNGlwOE01ejh2SFZ2ekRHYmtjR21hQ25vU05Pci9VN2lCTEtNakY3aUJS?=
 =?utf-8?B?dXlwTE9VbFFJTVlnRys3VktQSU1COTZoVlo2ZTZsd0NvZnlsZlNuSGxMRWdV?=
 =?utf-8?B?UVZlWm9acnVhZTlISmEzS2lITkRnN0hwVFd1NFJab3oxd3VFaHhXWVBDblMv?=
 =?utf-8?B?dVpxeXA0M0x2akZJYStnRzJOWGFhOXBCdG5Bd3pGSWE2WkE9PQ==?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2024 09:28:08.9688
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 8d584732-037c-42a6-e88f-08dcbdd5bdd9
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH3PEPF00000012.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6565

Hi Ayan,

On 14/08/2024 14:33, Ayan Kumar Halder wrote:
> Hi Jan,
> 
> On 14/08/2024 12:35, Jan Beulich wrote:
>> On 14.08.2024 12:55, Ayan Kumar Halder wrote:
>>> Hi Jan,
>>>
>>> On 14/08/2024 07:37, Jan Beulich wrote:
>>>> On 13.08.2024 19:13, Ayan Kumar Halder wrote:
>>>>> From: Penny Zheng <penny.zheng@arm.com>
>>>>>
>>>>> Introduced CONFIG_VMAP which is selected by the architectures that use
>>>>> MMU. vm_init() does not do anything if CONFIG_VMAP is not enabled.
>>>>>
>>>>> VMAP is widely used in ALTERNATIVE feature to remap a range of memory
>>>>> with new memory attributes. Since this is highly dependent on virtual
>>>>> address translation, we choose to fold VMAP in MMU system.
>>>>>
>>>>> In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
>>>>> only support in MMU system on ARM architecture. And ALTERNATIVE now
>>>>> depends on VMAP.
>>>>>
>>>>> HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP as speculative
>>>>> attacks are not possible on non MMU based systems (ie Cortex-R52, R82).
>>>>> See https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability.
>>>> While I'm not an Arm expert and hence I'm likely missing aspects, I question
>>>> the one (Spectre-BHB) vulnerability there to be sufficient to draw a
>>>> conclusion towards the usefulness of branch hardening. I would advise
>>>> against encoding such a connection in the Kconfig dependencies.
>>> AFAIU, to address 'Spectre' like vulnerabilities 'branch hardening' was
>>> added.
>>>
>>> See https://lore.kernel.org/all/E1fNadD-0000fz-9r@rmk-PC.armlinux.org.uk/
>>>
>>> And from
>>> https://lists.linaro.org/archives/list/linux-stable-mirror@lists.linaro.org/message/F4MGL4WT2R7T54NLRDGKFRQNSXF3DZGD/
>>>
>>> Spectre is valid on MMU based systems.
>> Since then various other issues / flavors were found. I've been focusing
>> on the x86 side of things, but I'd be very surprised if some didn't
>> affect other architectures as well.
> 
> We are talking about Arm here as "HARDEN_BRANCH_PREDICTOR" is specific 
> to Arm.
> 
> https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability 
> covers all the flavours and it does not include Cortex-R82 or R52.
> 
> It says the following :-
> 
> "Cortex-R cores typically use a closed software stack. In those 
> environments, applications or processes are strictly controlled, and 
> therefore not exploitable"
> 
>> Plus branch hardening can be a pre-
>> cautionary measure, too, I think.
> 
> The first two Arm non MMU cores that we wish to support in the 
> forthcoming series is Cortex-R82 and R52.
> 
> As seen in https://developer.arm.com/documentation/ka005109/latest/, it 
> explicitly states the following about R82
> 
> The Cortex-R82 implements the faulting feature (FEAT_FPAC) but is not 
> vulnerable. The Cortex-R82 behaves differently than vulnerable A-class 
> CPUs when speculatively executing past an instruction that authenticates 
> PAC, and that behavior does not allow the attack software to create the 
> "oracle".
> 
> We can re-enable branch hardening if we know there is a valid non MMU 
> Arm core which is vulnerable.
> 
> Let me know if you are ok with the rationale.
I'm ok with your rationale.

I have one question for this patch. Why can't we use CONFIG_HAS_VMAP to conditionally compile vmap.c, like:
obj-$(CONFIG_HAS_VMAP) += vmap.o
and get rid of VMAP_VIRT_START guard on an entire file?
With this config in place, it seems strange to use VMAP_VIRT_START as a guard.

~Michal



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 10:05:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 10:05:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778454.1188481 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1setpX-0006rs-3x; Fri, 16 Aug 2024 10:05:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778454.1188481; Fri, 16 Aug 2024 10:05:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1setpX-0006rl-1M; Fri, 16 Aug 2024 10:05:11 +0000
Received: by outflank-mailman (input) for mailman id 778454;
 Fri, 16 Aug 2024 10:05: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=jRqj=PP=epam.com=prvs=4958420f8a=sergiy_kibrik@srs-se1.protection.inumbo.net>)
 id 1setpV-0006rM-PZ
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 10:05:09 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 037ca5eb-5bb7-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 12:05:07 +0200 (CEST)
Received: from pps.filterd (m0174680.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47G9LVcQ002533;
 Fri, 16 Aug 2024 10:05:00 GMT
Received: from as8pr04cu009.outbound.protection.outlook.com
 (mail-westeuropeazlp17011025.outbound.protection.outlook.com [40.93.65.25])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 411sxn1bck-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Fri, 16 Aug 2024 10:04:59 +0000 (GMT)
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com (2603:10a6:20b:5c0::11)
 by PAWPR03MB9010.eurprd03.prod.outlook.com (2603:10a6:102:338::16)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Fri, 16 Aug
 2024 10:04:56 +0000
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d]) by AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d%4]) with mapi id 15.20.7875.018; Fri, 16 Aug 2024
 10:04:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 037ca5eb-5bb7-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=r+IXf6F9WpfejS1C3u5w2KMlCXs5J36ADS1Gt9/DA6Eo4bCHaMAc93pIMNd/YkfxM/KJlKzUUWlv3pe1PmI5RFSBIO4sgdCDcnP/GZ8tb08E7AH8vKIwT14g4X4kg/7oENGGX+ZRboqHq3rH7Lg8rZeIdaxY/eNyoee5H6eklynwSNpuLIleOn9EvY7YNHireBan99ia7jVuI5NxFnD+eRswcSu4Jyd+QfAMRO7dOg8i316lFIuB/OKA1JcsHlAfsdv/Mz2PbsiM5r5DVGcK3zdTlhkhEOixq43DKvjjF9IaQ4q1/C39HZ3J1wKZGdAZMFbxbnxc45LKfsit6ba4dA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=MhXL0oaIJGettiklgm2AZOji3swPxQIyIWGgItFMpFE=;
 b=DpI5PxJHisrdeh9f0/S9cPCyPDvd98Tpj/iU+Nph1o67/6Z+vmDtkoBwgwpNiEVVznXyxpVDrVY/dSZFzKis3DphIPBQEbemOu6M9/g1G6gtYRqp4HpD4jI8w/saPPfH3O9qtz3TB456RZ4ii//fwA/8netNIfW48/LD5od5ahkidN+JXqjhaWL9/ohndJ9+IosqM4vYWmMkES0ERHZgwdQsifx/DLQvj8Ge0DQbOWW/mWoVCa2EBFjcXSyqD77+iyZgM98VLidgkPrvuaCok8p30idiHeaPrp2q5Ho0fXoHRnUkl1PCCJoNDxkQi9ZrkuGqaR35lUaeVuridYrCgg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=MhXL0oaIJGettiklgm2AZOji3swPxQIyIWGgItFMpFE=;
 b=jc7pVM4Z4KOFMfGm9Xnc6xY8Iycrw75XCtlwZ66sIOk61siN64hTv36PFaBLhN4mFWKy77L21q70bjhqhcmCuNC7znsO4marHVuKuaJktVzZtaidpDIFT4OoFETH2/YOU1wQ/iid7h9tjnGrykhSNm5cemAmvHWwLucTq5PKVIEq+HYMDobVP7Y/y/mDPxEGNnVScFmho31NtV/+0a2aNeUgBC6QrApDExdBSAipr0HFKWt5OGNFiMBzcBls18hczFGIFyS2Q5mbK7iyy76Sljnpgbm8oEll2pGrEZFsroehRoG4hv1xqP63sh2WJ1VTcb+7zqCbSeZ1oUf2rdHkGg==
Message-ID: <2f9b2355-1073-4d55-81d4-28d7dd245d83@epam.com>
Date: Fri, 16 Aug 2024 13:04:54 +0300
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v6 2/3] ioreq: do not build
 arch_vcpu_ioreq_completion() for non-VMX configurations
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Bertrand Marquis <bertrand.marquis@arm.com>,
        Michal Orzel <michal.orzel@amd.com>,
        Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
        =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
        Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
        Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
References: <cover.1723110344.git.Sergiy_Kibrik@epam.com>
 <04e5397ecfcdb4d5680c7d36f71c4b471004ccd0.1723110344.git.Sergiy_Kibrik@epam.com>
 <952701cd-83d8-4c1f-9f38-ee63ba582d66@suse.com>
Content-Language: en-US
From: Sergiy Kibrik <sergiy_kibrik@epam.com>
In-Reply-To: <952701cd-83d8-4c1f-9f38-ee63ba582d66@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: WA2P291CA0024.POLP291.PROD.OUTLOOK.COM
 (2603:10a6:1d0:1e::15) To AS8PR03MB9192.eurprd03.prod.outlook.com
 (2603:10a6:20b:5c0::11)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9192:EE_|PAWPR03MB9010:EE_
X-MS-Office365-Filtering-Correlation-Id: c76606ee-c339-4da8-19de-08dcbddae185
X-LD-Processed: b41b72d0-4e9f-4c26-8a69-f949f367c91d,ExtAddr
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?ekQ2enpkN0tVbnZyc0RYN3ZRTTNrNFZHSGFSZHlNNHd1RXdUZ3VhN2hRR1lu?=
 =?utf-8?B?TitKSmJIaXlSZjd6K3hWeGJ1emZkdk9adU9ZRWFJSXQzUjQxYU1TU0lYZWtt?=
 =?utf-8?B?dmU1OU9wbVhnNmhQaG9Rd3JVbUpxWEV5ZzFwWldGV1RiTktla1R2L2hiY2Vm?=
 =?utf-8?B?b0ZtWVh5a3MvT082Vzl1dUlmb2Q0Q0tpanYvdnJ2TUVSQjFmRGVqV1BlVGZG?=
 =?utf-8?B?QjFhMjQxQWFTTDdDOVJpdDVOdWt1cDBNTFcweFIrQ3c5MitWTUcvYTNNYk1H?=
 =?utf-8?B?SW9EeDM4aUwvQ1Z2dGVHVlkwUEFUN3pmK1JERldPbjFTVVcvcDZVM01BY1Fu?=
 =?utf-8?B?VTVDUFJHeGd4TzFmS1N2Njk4SkVyYTdKNkhBVjUwcWUyTUZhRHFsWWwvNHl4?=
 =?utf-8?B?d0NreStTUTgwR1NhRkRBSlRqNm5UaWdhTndFd0J5b0c0R0lPR05xU3oyUjU2?=
 =?utf-8?B?RHc2Q0NkdG5wdjhpM09ISllBeVU0QytUbTdYS2tRbzJVbkpobmdnemNWNnhI?=
 =?utf-8?B?eG91bGNGdkZ3WktlMGI2SHpTbitwZ1lSMzNYUmJsQzh1YUdYVVduSEF3ekw0?=
 =?utf-8?B?NEJLYnJ0U1R3T2c3MUhPNVFLUzRONGVDcEg5VTJrb3l1S205MUFxU1RKaHdk?=
 =?utf-8?B?YW5haFdSN0FRZXRrTmVHUTFtMmJobXhhWmxrWm9DU2lOY2JNK2hkYTN4OC92?=
 =?utf-8?B?UmRFN3JUYmdzQm9YSkhKMEJjRS9ieUxqeExUWUY0UnR3SUVQNXdDcmdXQnps?=
 =?utf-8?B?V0NITzA5ZGd2VWRVWVdvQlJNcVZiWDlTbTBNay9VeDNZSmJyaytqVmNndW1H?=
 =?utf-8?B?T0hRT0ZBRjhvM29vMVVQek56Nlh5eXUyNmVXa2J0VzN6ekRqemFNb0hIbjE0?=
 =?utf-8?B?MkR6ZjhuOS9uMmh2K2JCWFVpVndXZ0VEREtkcmd6b1krMVZyQTBleTEwVEtI?=
 =?utf-8?B?cmdDM1BucllIZEQwSUdzTS9wUFFuc1hTTmt3MXhWLzA1eWJQOHBoektqamV5?=
 =?utf-8?B?ZCtzRzFKYlVSMDFVa0t3T3A3MUd2Z2k2MkZqNDIvUW5RUlBjRWVOZXN3bzJU?=
 =?utf-8?B?NzNCcnkxZWVydVRJZ1U4T3Naa2VNS2diQ3oyN0phNEkwLzRUOFkwZW05WW1s?=
 =?utf-8?B?QXhuaTE5U1ZFWld2Z0k0RlBvOWFWd2FJV2I2QVNNY0RDTDV2Vk5PYmtSWU9z?=
 =?utf-8?B?bmJFT3JPaWd6ZHU3aFBQOVVJVXJ2YXoyMnRZUTdjNDdCQmhnZkRJa3NQbFNU?=
 =?utf-8?B?SlJocWRPT2xocTFKR3l4M3gwRHBnaXU3RWxUK1lQMVl3YTl5b3dDTlpzRThC?=
 =?utf-8?B?WHF6U3NkS1c5Q2c4ajk4UzcwZ3pySkl2RXJ3ellsdDIzODJ5c2JhZ3hRVkNR?=
 =?utf-8?B?dkxmODhHMWM2V2IreVQvVnFzQU5tK3hVSXVZQ2NzODNIRmplQ0lqTTFoTStl?=
 =?utf-8?B?aXJvZWhIUWFxcVNtRkFnTjdadmM3SnZRSEdFekZSa2RvdWI0ZjVVby9icW9D?=
 =?utf-8?B?WVZmc3pwWnBxdGpXZk1sdUJ6VTVWb25JZDRGUHA5amdkWXd3QzNiaGNsM2VG?=
 =?utf-8?B?QXlnSk1QOXAzMDZUTFU0UmpxQnMzZ0I2dWtFYmMxYjZyUVRwZUJzcEVheUQv?=
 =?utf-8?B?eGhsQnFITmxRUXU0K1FiMml1T3ZzS3pUeGtVNlVETTFZMXdYclJlcGo5VjI2?=
 =?utf-8?B?bGlIczZjR3BtMy9ONXQ2U3ZjSXBGYUM0blB0U1N3YjlWMlRrb1d2TzdvYmFs?=
 =?utf-8?B?cjRBZVJQTnBaQnpFaGtvaG5LeGFUeE9BbFo2T1h6Zk9vb1BUc2xCcGpmcCtS?=
 =?utf-8?B?N09ER1NsbkFTOVAxVGZTUT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9192.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?UFlFb2JhemxrZ3QwMTUwK1R6MVJyMCtKK01UTWVrdlZidmxoenVnd3o5Q2Fp?=
 =?utf-8?B?RzFBTnVSUmZ3RkovY1RoeVlhL3diNnFscHJLcHg3dEtKUG9YMnY3K3FJRm02?=
 =?utf-8?B?cE8xckZJSnY2Y1VnRUEyTFJGNFRBZWlnWFZpQmZzTUlEMHZiMjZrMEdSWHA2?=
 =?utf-8?B?M3lUS1JPT3JVWGVocGtiTDJlQlVDY0JmWDRKTzRDZEQ5K3paWCt2bEFFRTBw?=
 =?utf-8?B?KzBUcEhMVFNwTnYyNTVFdTVubkdiajBuVFdBODdncUM0d3RyRVR5UU9wdVBS?=
 =?utf-8?B?Vk5LU1JXMFdKSUVBcWMwYkRXU0VncUZmY05YQWRCdHJHZ2VTMjZhZ2pMYmpD?=
 =?utf-8?B?Qk9Fa0hDc2NBeTk4YVU4K3pGMkVMM3RtMTNFRG9iaFBNTjVUV3pIY05BVlBz?=
 =?utf-8?B?a0ZQWVdjNnRIaVZ2cFVRelZIR1BjSFNZQ29XNTQybXk2M1dOWm9vQXRsdFdM?=
 =?utf-8?B?VFl6SHE0M0tHV1NRcXRvdXVIVDA5VDRpckdoMDI3L0M1cE5Qb2x5amk1R2xy?=
 =?utf-8?B?OU5iUGtKV0wwZWR2dk9MVTQwcC9oczZKdWpFbnI4YnQwRTlVMzd2c1ZQaVBN?=
 =?utf-8?B?ZUwzLzdTNW02R1FPd09tRWoyZXlONlhoSHRQejZXbEg2Q1diU1JrMi9WUlgw?=
 =?utf-8?B?YnZwSzUvYkhzSVJlNGxWOTVsVjhaU2VwNCtXcTNVRXNXUzZaRnVEQjc5cGRk?=
 =?utf-8?B?RVRuekl4d0VPNlFuUUpxTThXNU14VXE3bjZRRmNqZTRWbjgySklSTEMrald3?=
 =?utf-8?B?WFlYZFBZL1o2d2xMWVZlRWdWRmtzdXJ3cXRiK05LbC9qWmhjY3Y5UVlmZ1JO?=
 =?utf-8?B?cDIvUUNuZDJhd21mTUsxMEdsbTMyRStYNktQQkV5SXZQRUJJWFc4ekFRc0JG?=
 =?utf-8?B?ODNRanRCaW00eDBXdWhmOENtVW1uNUgxWWtCdHgyRFAvczlINmlHczBaSkpX?=
 =?utf-8?B?SW5QUzNneHgzUVo2MGFKcVE3Q0xEbk1VM0VleUVtRU52NkNrWkJ2Tml5YXUz?=
 =?utf-8?B?d0xEV0c0TmsrVXdhdkluOU00YXhaTlpXTTZEQnFLeW9lSVVERjRaR2psdnNL?=
 =?utf-8?B?TloxUHppUUw2VkdPd0ZXL0sxQ2tETjEzVGdHT2VQTU5xSU1XNVJIa2dMZTdQ?=
 =?utf-8?B?RUd4eGZrZlk1a3hCOFAyQUVGcm1wRnJUSmtOdHFHTEtRNWIrOTJiV2Z2aUM4?=
 =?utf-8?B?MHViMW4zdjQ3SGJIMVdGOW1pWnZkVHVrVWdtblF6QjZuR2RCdGxlbkY0ZGVX?=
 =?utf-8?B?L3Z4dG5sK295QWR3cFEzM2dBTURyWHl5dDQ5UkY2cVJEcFUrTE5Ydm1HTzdr?=
 =?utf-8?B?TEJOWUlGSCtudGYxMm1XSkNuSVc4YUVHZmk4elZsQjNiYS9aYTVyd1h5WlF5?=
 =?utf-8?B?NDlYa2FYY1ptWmhxYWRRd2lLV08yVFdBWmJNYzQwR0xBRjI2aDhMWlY1MWtz?=
 =?utf-8?B?SWpWaVV4MjZDMUdBQW9odkZFVXB4eGM3bS9lK0EzL1U1b1FXZ205U2ZRTUxs?=
 =?utf-8?B?b3NOZHlIdlA4aUttNEtwQ250NkRtQ3pvQU4vQmdSUTZCVG04WWQ4d0F3NXJZ?=
 =?utf-8?B?dTc1eWtqYU01RmF0cTUzb09jN2Irc1lxck50dnF6eWFTUjREZ2tjWlhCOVBi?=
 =?utf-8?B?UTNMbTVHc1RjbUovZW5vaHA2eTkreTU5TGxuTjBqUm9hSWlGMjNvNFkvRnhD?=
 =?utf-8?B?N2ZmS05QQjJOOFF3VkUzTXU1bGoyckpXMVdyZnVSYnBtTXdZUXJMaTFRcHVZ?=
 =?utf-8?B?UVhJMGU0MnVTdzNwbG4xTVFnMGlIcGFyalBRSjNjY3JqRXpCbzF4UUdkVHUw?=
 =?utf-8?B?V2V2VTV5a0hFaW1pNkFyR1JwMzc4RWFZYURPM3F2NXBtRTQzRjZsTXdTZmZL?=
 =?utf-8?B?WGhOWS9qY3A3aFJWTk9lWnFkcE5XbUJaaTFod0F5dHVBRHZhdjdnTm40Unhl?=
 =?utf-8?B?MmxBVFkwUWtqWDhxaVpLUjBVUk5vS04rbkVBMUFMVXdiYUJzbUV6SXd4UjdJ?=
 =?utf-8?B?LzNUQ1JCU0piQXp1M0JsejZtR1JWaTlFZGtTaWVqeWdZblR2ZHdMUHlmdnRW?=
 =?utf-8?B?NWtPV3NZWHo3YkJqZjYrTFBaL0k0L05QaVVxYnJMakU1cnNBbS9ndlo2bXlj?=
 =?utf-8?Q?jqEfyum2YOqffZDYWknSkuZ4W?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c76606ee-c339-4da8-19de-08dcbddae185
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9192.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2024 10:04:56.5113
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: o3vYv9TEdgclvjSr/Z5OP4xZthF+D5vTpgGORX+1y5Z4c+RmWhdoOjx42itt7vb/VWHd00Hv/d1HmeeRfUL+1g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR03MB9010
X-Proofpoint-GUID: 6EQVGg55vce0vnH68nefENrDpsSE4FZ1
X-Proofpoint-ORIG-GUID: 6EQVGg55vce0vnH68nefENrDpsSE4FZ1
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16
 definitions=2024-08-16_01,2024-08-15_01,2024-05-17_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0
 impostorscore=0 mlxlogscore=944 mlxscore=0 adultscore=0 priorityscore=1501
 suspectscore=0 spamscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0
 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.19.0-2407110000 definitions=main-2408160073

13.08.24 10:31, Jan Beulich:
>> --- a/xen/include/xen/ioreq.h
>> +++ b/xen/include/xen/ioreq.h
>> @@ -111,7 +111,17 @@ void ioreq_domain_init(struct domain *d);
>>   int ioreq_server_dm_op(struct xen_dm_op *op, struct domain *d, bool *const_op);
>>   
>>   bool arch_ioreq_complete_mmio(void);
>> +
>> +#ifdef CONFIG_VCPU_ARCH_IOREQ_COMPLETION
>>   bool arch_vcpu_ioreq_completion(enum vio_completion completion);
>> +#else
>> +static inline bool arch_vcpu_ioreq_completion(enum vio_completion completion)
>> +{
>> +    ASSERT_UNREACHABLE();
>> +    return true;
>> +}
> My prior comment here remains: Despite pre-existing behavior being to return
> "true" here, I question that to be in line with coding-best-practices.pandoc.
> Imo the generalization of the stub is a good opportunity to adjust that. But
> yes, it could also be done in a separate change. If you really don't want to
> do so right here, then
> Acked-by: Jan Beulich<jbeulich@suse.com>
> with the two cosmetic adjustments (which likely could also be done while
> committing).

I'm inclined to do a separate patch, that changes return value of 
arch_vcpu_ioreq_completion() depending on completion being handled on 
not. Such change has little to do with this patch series, and also 
probably should have its own separate discussion.

   -Sergiy


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 10:40:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 10:40:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778465.1188492 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seuMy-000468-MT; Fri, 16 Aug 2024 10:39:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778465.1188492; Fri, 16 Aug 2024 10:39:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seuMy-000461-Is; Fri, 16 Aug 2024 10:39:44 +0000
Received: by outflank-mailman (input) for mailman id 778465;
 Fri, 16 Aug 2024 10:39:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=LMSQ=PP=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1seuMx-00045v-8E
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 10:39:43 +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 d84f040c-5bbb-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 12:39:42 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5ba482282d3so2322136a12.2
 for <xen-devel@lists.xenproject.org>; Fri, 16 Aug 2024 03:39:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d84f040c-5bbb-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723804781; x=1724409581; 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=HxaT/G/a9C9d36zMJfUOotU5H2JIbQHX2nL8czHz2/8=;
        b=PdO5TW80ey40kZBG8zh5YYPdAFJ6CCDe+Jg04fx5dNc7/MZivEHxyhxj1lxjL66Gjv
         FJx1YJzl+9JM9+yBYEIjDgO58Saqy9iirrzkUuQ7TH9ooYvh8i6Pj+TRqG32W5+/inu+
         tkBUhp4QwexuQe9yC1ngR08Rg7hbu5NdhHFyTXsxIbT23lrhSt6q98seUdM8MaBg/pju
         +kneD6jnOBV5LEWfadSb3vB1isnamIXvH11T5atE/8XdxOzyy0ogZw9PFvLQWGouWKJl
         typCo8neU7k9UtRASRdmuCZKPffg0IYZSqTO7mG2DnYQl86Q3OuHpSpz2/PespavCL7g
         1j0A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723804781; x=1724409581;
        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=HxaT/G/a9C9d36zMJfUOotU5H2JIbQHX2nL8czHz2/8=;
        b=tAQW/KQT0l0tfCxv0Cm0vQIFMr0NBeNztczfRktR42UN1wxfhTrtWnp8dRySvba9Bg
         rSSpYhfu55OaE0vdRZOYxt+E5ZDtxxuJuXZLk0x7hRzrNT1zJU+/81xn76IN9tBDwoC+
         FtBLQ1wu0b4ZVdYYnmpe8PVE0sOQTAvFrugNMjBSEII6qmpjpBluuS6rPJwp7WZsWiA3
         OWkJ9LURckl/LYgRuKS8rnCskE/MMuxqrsELX3uFwMrtU8Jk9zpqlm1ejxVtFHPf1Abu
         qOTom878yd0Smgb8djKt1w/WhoMNLp+ASYGv17+uo1dF9Bh/7FQXw/NXXFqsUPXubQwY
         nw/g==
X-Forwarded-Encrypted: i=1; AJvYcCVqJnQXJHcKX3xEqYHJljQwDWMwQYAPHpXaqMwx3bEnLjbJVmurllx/p929cTZsItMzGDgoF7TKb1k=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yyo4bdyT39oAnrV0Z0jG/oP1IOg280qhkPhejR+PBMT9rhb5ikg
	q4hRIZM5TPluulIJGvfJi5WURtWtBmgAKE9wj757VuKBSN9fAk8w/CB9tLpnOpNLq6zk/G8I8FD
	KOSZKQ8zgWs7YJs7/ToLoOwAZBb0=
X-Google-Smtp-Source: AGHT+IFe/aw2okEbnHGGh2K6rt+9/+4BQBHsFxWSaNJv2/16ZXE9cadhwAxXurr0h1HWpgjn9PaKtCpCdDlbRj0J9JQ=
X-Received: by 2002:a05:6402:5206:b0:5a2:1f7b:e017 with SMTP id
 4fb4d7f45d1cf-5beca4da60dmr1723171a12.4.1723804780681; Fri, 16 Aug 2024
 03:39:40 -0700 (PDT)
MIME-Version: 1.0
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
 <20240812130606.90410-5-edgar.iglesias@gmail.com> <alpine.DEB.2.22.394.2408121650590.298534@ubuntu-linux-20-04-desktop>
 <ZruRm34zIMtUm7oH@zapote> <alpine.DEB.2.22.394.2408131550080.298534@ubuntu-linux-20-04-desktop>
 <ZryZwOoadeb1UWK8@zapote> <alpine.DEB.2.22.394.2408141719400.298534@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2408141719400.298534@ubuntu-linux-20-04-desktop>
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Date: Fri, 16 Aug 2024 12:39:28 +0200
Message-ID: <CAJy5ezrUbGZCaF=HiYhyLCoXRL3d=t-QbmLeKvu7ByWksV888g@mail.gmail.com>
Subject: Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: qemu-devel@nongnu.org, anthony@xenproject.org, paul@xen.org, 
	peter.maydell@linaro.org, alex.bennee@linaro.org, xenia.ragiadakou@amd.com, 
	jason.andryuk@amd.com, edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, 
	qemu-arm@nongnu.org, andrew.cooper3@citrix.com
Content-Type: multipart/alternative; boundary="0000000000009d62ae061fca9383"

--0000000000009d62ae061fca9383
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Aug 15, 2024 at 2:30=E2=80=AFAM Stefano Stabellini <sstabellini@ker=
nel.org>
wrote:

> On Wed, 14 Aug 2024, Edgar E. Iglesias wrote:
> > On Tue, Aug 13, 2024 at 03:52:32PM -0700, Stefano Stabellini wrote:
> > > On Tue, 13 Aug 2024, Edgar E. Iglesias wrote:
> > > > On Mon, Aug 12, 2024 at 06:47:17PM -0700, Stefano Stabellini wrote:
> > > > > On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> > > > > > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> > > > > >
> > > > > > Add SMP support for Xen PVH ARM guests. Create max_cpus ioreq
> > > > > > servers to handle hotplug.
> > > > > >
> > > > > > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
> > > > > > ---
> > > > > >  hw/arm/xen_arm.c | 5 +++--
> > > > > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > > > >
> > > > > > diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
> > > > > > index 5f75cc3779..ef8315969c 100644
> > > > > > --- a/hw/arm/xen_arm.c
> > > > > > +++ b/hw/arm/xen_arm.c
> > > > > > @@ -173,7 +173,7 @@ static void xen_arm_init(MachineState
> *machine)
> > > > > >
> > > > > >      xen_init_ram(machine);
> > > > > >
> > > > > > -    xen_register_ioreq(xam->state, machine->smp.cpus,
> &xen_memory_listener);
> > > > > > +    xen_register_ioreq(xam->state, machine->smp.max_cpus,
> &xen_memory_listener);
> > > > > >
> > > > > >      xen_create_virtio_mmio_devices(xam);
> > > > > >
> > > > > > @@ -218,7 +218,8 @@ static void
> xen_arm_machine_class_init(ObjectClass *oc, void *data)
> > > > > >      MachineClass *mc =3D MACHINE_CLASS(oc);
> > > > > >      mc->desc =3D "Xen PVH ARM machine";
> > > > > >      mc->init =3D xen_arm_init;
> > > > > > -    mc->max_cpus =3D 1;
> > > > > > +    /* MAX number of vcpus supported by Xen.  */
> > > > > > +    mc->max_cpus =3D GUEST_MAX_VCPUS;
> > > > >
> > > > > Will this cause allocations of data structures with 128 elements?
> > > > > Looking at hw/xen/xen-hvm-common.c:xen_do_ioreq_register it seems
> > > > > possible? Or hw/xen/xen-hvm-common.c:xen_do_ioreq_register is
> called
> > > >
> > > > Yes, in theory there's probably overhead with this but as you
> correctly
> > > > noted below, a PVH aware xl will set the max_cpus option to a lower
> value.
> > > >
> > > > With a non-pvh aware xl, I was a little worried about the overhead
> > > > but I couldn't see any visible slow-down on ARM neither in boot or
> in network
> > > > performance (I didn't run very sophisticated benchmarks).
> > >
> > > What do you mean by "non-pvh aware xl"? All useful versions of xl
> > > support pvh?
> >
> >
> > I mean an xl without our PVH patches merged.
> > xl in upstream doesn't know much about PVH yet.
> > Even for ARM, we're still carrying significant patches in our tree.
>
> Oh I see. In that case, I don't think we need to support "non-pvh aware
> xl".
>
>
> > > > > later on with the precise vCPU value which should be provided to
> QEMU
> > > > > via the -smp command line option
> > > > > (tools/libs/light/libxl_dm.c:libxl__build_device_model_args_new)?
> > > >
> > > > Yes, a pvh aware xl will for example pass -smp 2,maxcpus=3D4 based =
on
> > > > values from the xl.cfg. If the user doesn't set maxvcpus in xl.cfg,
> xl
> > > > will set maxvcpus to the same value as vcpus.
> > >
> > > OK good. In that case if this is just an initial value meant to be
> > > overwritten, I think it is best to keep it as 1.
> >
> > Sorry but that won't work. I think the confusion here may be that
> > it's easy to mix up mc->max_cpus and machine->smp.max_cpus, these are
> > not the same. They have different purposes.
> >
> > I'll try to clarify the 3 values in play.
> >
> > machine-smp.cpus:
> > Number of guest vcpus active at boot.
> > Passed to QEMU via the -smp command-line option.
> > We don't use this value in QEMU's ARM PVH machines.
> >
> > machine->smp.max_cpus:
> > Max number of vcpus that the guest can use (equal or larger than
> machine-smp.cpus).
> > Will be set by xl via the "-smp X,maxcpus=3DY" command-line option to Q=
EMU.
> > Taken from maxvcpus from xl.cfg, same as XEN_DMOP_nr_vcpus.
> > This is what we use for xen_register_ioreq().
> >
> > mc->max_cpus:
> > Absolute MAX in QEMU used to cap the -smp command-line options.
> > If xl tries to set -smp (machine->smp.max_cpus) larger than this, QEMU
> will bail out.
> > Used to setup xen_register_ioreq() ONLY if -smp maxcpus was NOT set (i.=
e
> by a non PVH aware xl).
> > Cannot be 1 because that would limit QEMU to MAX 1 vcpu.
> >
> > I guess we could set mc->max_cpus to what XEN_DMOP_nr_vcpus returns but
> I'll
> > have to check if we can even issue that hypercall this early in QEMU
> since
> > mc->max_cpus is setup before we even parse the machine options. We may
> > not yet know what domid we're attaching to yet.
>
> If mc->max_cpus is the absolute max and it will not be used if -smp is
> passed to QEMU, then I think it is OK to use GUEST_MAX_VCPUS
>


Looking at this a little more. If users (xl) don't pass an -smp option we
actually default to smp.max_cpus=3D1.
So, another option is to simply remove the upper limit in QEMU (e.g we can
set mc->max_cpus to something very large like UINT32_MAX).
That would avoid early hypercalls, avoid using GUEST_MAX_VCPUS and always
let xl dictate the max_cpus value using the -smp cmdline option.

--0000000000009d62ae061fca9383
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Thu, Aug 15, 2024 at 2:30=E2=80=AFAM S=
tefano Stabellini &lt;<a href=3D"mailto:sstabellini@kernel.org">sstabellini=
@kernel.org</a>&gt; wrote:<br></div><div class=3D"gmail_quote"><blockquote =
class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px sol=
id rgb(204,204,204);padding-left:1ex">On Wed, 14 Aug 2024, Edgar E. Iglesia=
s wrote:<br>
&gt; On Tue, Aug 13, 2024 at 03:52:32PM -0700, Stefano Stabellini wrote:<br=
>
&gt; &gt; On Tue, 13 Aug 2024, Edgar E. Iglesias wrote:<br>
&gt; &gt; &gt; On Mon, Aug 12, 2024 at 06:47:17PM -0700, Stefano Stabellini=
 wrote:<br>
&gt; &gt; &gt; &gt; On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:<br>
&gt; &gt; &gt; &gt; &gt; From: &quot;Edgar E. Iglesias&quot; &lt;<a href=3D=
"mailto:edgar.iglesias@amd.com" target=3D"_blank">edgar.iglesias@amd.com</a=
>&gt;<br>
&gt; &gt; &gt; &gt; &gt; <br>
&gt; &gt; &gt; &gt; &gt; Add SMP support for Xen PVH ARM guests. Create max=
_cpus ioreq<br>
&gt; &gt; &gt; &gt; &gt; servers to handle hotplug.<br>
&gt; &gt; &gt; &gt; &gt; <br>
&gt; &gt; &gt; &gt; &gt; Signed-off-by: Edgar E. Iglesias &lt;<a href=3D"ma=
ilto:edgar.iglesias@amd.com" target=3D"_blank">edgar.iglesias@amd.com</a>&g=
t;<br>
&gt; &gt; &gt; &gt; &gt; ---<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 hw/arm/xen_arm.c | 5 +++--<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 1 file changed, 3 insertions(+), 2 deletions=
(-)<br>
&gt; &gt; &gt; &gt; &gt; <br>
&gt; &gt; &gt; &gt; &gt; diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c<b=
r>
&gt; &gt; &gt; &gt; &gt; index 5f75cc3779..ef8315969c 100644<br>
&gt; &gt; &gt; &gt; &gt; --- a/hw/arm/xen_arm.c<br>
&gt; &gt; &gt; &gt; &gt; +++ b/hw/arm/xen_arm.c<br>
&gt; &gt; &gt; &gt; &gt; @@ -173,7 +173,7 @@ static void xen_arm_init(Machi=
neState *machine)<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 <br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 xen_init_ram(machine);<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 <br>
&gt; &gt; &gt; &gt; &gt; -=C2=A0 =C2=A0 xen_register_ioreq(xam-&gt;state, m=
achine-&gt;smp.cpus, &amp;xen_memory_listener);<br>
&gt; &gt; &gt; &gt; &gt; +=C2=A0 =C2=A0 xen_register_ioreq(xam-&gt;state, m=
achine-&gt;smp.max_cpus, &amp;xen_memory_listener);<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 <br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 xen_create_virtio_mmio_devices=
(xam);<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 <br>
&gt; &gt; &gt; &gt; &gt; @@ -218,7 +218,8 @@ static void xen_arm_machine_cl=
ass_init(ObjectClass *oc, void *data)<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 MachineClass *mc =3D MACHINE_C=
LASS(oc);<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 mc-&gt;desc =3D &quot;Xen PVH =
ARM machine&quot;;<br>
&gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 mc-&gt;init =3D xen_arm_init;<=
br>
&gt; &gt; &gt; &gt; &gt; -=C2=A0 =C2=A0 mc-&gt;max_cpus =3D 1;<br>
&gt; &gt; &gt; &gt; &gt; +=C2=A0 =C2=A0 /* MAX number of vcpus supported by=
 Xen.=C2=A0 */<br>
&gt; &gt; &gt; &gt; &gt; +=C2=A0 =C2=A0 mc-&gt;max_cpus =3D GUEST_MAX_VCPUS=
;<br>
&gt; &gt; &gt; &gt; <br>
&gt; &gt; &gt; &gt; Will this cause allocations of data structures with 128=
 elements?<br>
&gt; &gt; &gt; &gt; Looking at hw/xen/xen-hvm-common.c:xen_do_ioreq_registe=
r it seems<br>
&gt; &gt; &gt; &gt; possible? Or hw/xen/xen-hvm-common.c:xen_do_ioreq_regis=
ter is called<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; Yes, in theory there&#39;s probably overhead with this but a=
s you correctly<br>
&gt; &gt; &gt; noted below, a PVH aware xl will set the max_cpus option to =
a lower value.<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; With a non-pvh aware xl, I was a little worried about the ov=
erhead<br>
&gt; &gt; &gt; but I couldn&#39;t see any visible slow-down on ARM neither =
in boot or in network<br>
&gt; &gt; &gt; performance (I didn&#39;t run very sophisticated benchmarks)=
.<br>
&gt; &gt;=C2=A0 <br>
&gt; &gt; What do you mean by &quot;non-pvh aware xl&quot;? All useful vers=
ions of xl<br>
&gt; &gt; support pvh?<br>
&gt; <br>
&gt; <br>
&gt; I mean an xl without our PVH patches merged.<br>
&gt; xl in upstream doesn&#39;t know much about PVH yet.<br>
&gt; Even for ARM, we&#39;re still carrying significant patches in our tree=
.<br>
<br>
Oh I see. In that case, I don&#39;t think we need to support &quot;non-pvh =
aware xl&quot;.<br>
<br>
<br>
&gt; &gt; &gt; &gt; later on with the precise vCPU value which should be pr=
ovided to QEMU<br>
&gt; &gt; &gt; &gt; via the -smp command line option<br>
&gt; &gt; &gt; &gt; (tools/libs/light/libxl_dm.c:libxl__build_device_model_=
args_new)?<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt; Yes, a pvh aware xl will for example pass -smp 2,maxcpus=3D4=
 based on<br>
&gt; &gt; &gt; values from the xl.cfg. If the user doesn&#39;t set maxvcpus=
 in xl.cfg, xl<br>
&gt; &gt; &gt; will set maxvcpus to the same value as vcpus.<br>
&gt; &gt; <br>
&gt; &gt; OK good. In that case if this is just an initial value meant to b=
e<br>
&gt; &gt; overwritten, I think it is best to keep it as 1.<br>
&gt; <br>
&gt; Sorry but that won&#39;t work. I think the confusion here may be that<=
br>
&gt; it&#39;s easy to mix up mc-&gt;max_cpus and machine-&gt;smp.max_cpus, =
these are<br>
&gt; not the same. They have different purposes.<br>
&gt; <br>
&gt; I&#39;ll try to clarify the 3 values in play.<br>
&gt; <br>
&gt; machine-smp.cpus:<br>
&gt; Number of guest vcpus active at boot.<br>
&gt; Passed to QEMU via the -smp command-line option.<br>
&gt; We don&#39;t use this value in QEMU&#39;s ARM PVH machines.<br>
&gt; <br>
&gt; machine-&gt;smp.max_cpus:<br>
&gt; Max number of vcpus that the guest can use (equal or larger than machi=
ne-smp.cpus).<br>
&gt; Will be set by xl via the &quot;-smp X,maxcpus=3DY&quot; command-line =
option to QEMU.<br>
&gt; Taken from maxvcpus from xl.cfg, same as XEN_DMOP_nr_vcpus.<br>
&gt; This is what we use for xen_register_ioreq().<br>
&gt; <br>
&gt; mc-&gt;max_cpus:<br>
&gt; Absolute MAX in QEMU used to cap the -smp command-line options.<br>
&gt; If xl tries to set -smp (machine-&gt;smp.max_cpus) larger than this, Q=
EMU will bail out.<br>
&gt; Used to setup xen_register_ioreq() ONLY if -smp maxcpus was NOT set (i=
.e by a non PVH aware xl).<br>
&gt; Cannot be 1 because that would limit QEMU to MAX 1 vcpu.<br>
&gt; <br>
&gt; I guess we could set mc-&gt;max_cpus to what XEN_DMOP_nr_vcpus returns=
 but I&#39;ll<br>
&gt; have to check if we can even issue that hypercall this early in QEMU s=
ince<br>
&gt; mc-&gt;max_cpus is setup before we even parse the machine options. We =
may<br>
&gt; not yet know what domid we&#39;re attaching to yet.<br>
<br>
If mc-&gt;max_cpus is the absolute max and it will not be used if -smp is<b=
r>
passed to QEMU, then I think it is OK to use GUEST_MAX_VCPUS<br></blockquot=
e><div><br></div><div><br></div><div>Looking at this a little more. If user=
s (xl) don&#39;t pass an -smp option we actually default to smp.max_cpus=3D=
1.</div><div>So, another option is to simply remove the upper limit in QEMU=
 (e.g we can set mc-&gt;max_cpus to something very large like UINT32_MAX).<=
/div><div>That would avoid early hypercalls, avoid using GUEST_MAX_VCPUS an=
d always let xl dictate the max_cpus value using the -smp cmdline option.=
=C2=A0</div></div></div>

--0000000000009d62ae061fca9383--


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 10:57:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 10:57:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778475.1188501 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seue0-0007jw-6s; Fri, 16 Aug 2024 10:57:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778475.1188501; Fri, 16 Aug 2024 10:57:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seue0-0007jp-4J; Fri, 16 Aug 2024 10:57:20 +0000
Received: by outflank-mailman (input) for mailman id 778475;
 Fri, 16 Aug 2024 10:57:18 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seudy-0007jf-AM; Fri, 16 Aug 2024 10:57:18 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seudy-0004Ji-5I; Fri, 16 Aug 2024 10:57:18 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1seudx-0005y1-Ml; Fri, 16 Aug 2024 10:57:17 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1seudx-0000zu-Le; Fri, 16 Aug 2024 10:57:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=IHdSNEL+KgoQd+ahYiXTBpcEREXLsIemwyCIJ267whw=; b=xE+UaA6tfDYR3Am4qfO5lGMjsx
	0PtWhylHaMwRFweRREZTjwFrhiivi8/jhdNIRywK7+AGVMReNs2YeX7jldsfiwH1AdEFfaEIxTsiq
	xkO4oZckw3LN/8JpsGP+raplcfe066mBy44CUEo75kT6gWYcKbkX11T/0g8lhOHbJv5A=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187251-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187251: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=e724918b3786252b985b0c2764c16a57d1937707
X-Osstest-Versions-That:
    linux=f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 16 Aug 2024 10:57:17 +0000

flight 187251 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187251/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 186827
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 186827
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 186827
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 186827
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                e724918b3786252b985b0c2764c16a57d1937707
baseline version:
 linux                f83e38fc9f1092f8a7a65ff2ea6a1ea6502efaf0

Last test of basis   186827  2024-07-16 19:43:06 Z   30 days
Failing since        186925  2024-07-20 09:44:52 Z   27 days   54 attempts
Testing same since   187251  2024-08-15 23:14:47 Z    0 days    1 attempts

------------------------------------------------------------
2160 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   f83e38fc9f10..e724918b3786  e724918b3786252b985b0c2764c16a57d1937707 -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 11:08:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 11:08:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778486.1188512 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seup1-0001Op-72; Fri, 16 Aug 2024 11:08:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778486.1188512; Fri, 16 Aug 2024 11:08:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seup1-0001Oi-4C; Fri, 16 Aug 2024 11:08:43 +0000
Received: by outflank-mailman (input) for mailman id 778486;
 Fri, 16 Aug 2024 11:08:42 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0eKx=PP=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1seup0-0001Oc-KO
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 11:08:42 +0000
Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e3871937-5bbf-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 13:08:40 +0200 (CEST)
Received: from pb-smtp1.pobox.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id 22AEA27830;
 Fri, 16 Aug 2024 07:08:38 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id 199842782F;
 Fri, 16 Aug 2024 07:08:38 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [185.130.54.120])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp1.pobox.com (Postfix) with ESMTPSA id F1EFE2782E;
 Fri, 16 Aug 2024 07:08:36 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e3871937-5bbf-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:mime-version:content-transfer-encoding;
	 s=sasl; bh=6amzTM1Zuwycn82X5gGukLcTmcXTY8X+13zqceSKBQo=; b=NDEz
	HyprqY8K2sk/y4mP/2mO/Hbe4yz8AokKn8cUCQ4kLbiNX6t7uxo8Gwm0dY++PuzO
	a1CL0sF5HFY0otDYVVHNVymLkAANoe0MzRP0sSMsUWImCDVeLIgmGeeJ/oCtr3Vs
	oEcTy6suPqnML0LLXmgGwJsOaOotSoFzQf6vgbI=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [XEN PATCH v2 0/5] x86/CPU: optional build of Intel/AMD CPUs support
Date: Fri, 16 Aug 2024 14:08:34 +0300
Message-Id: <cover.1723805717.git.Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
X-Pobox-Relay-ID:
 E2963234-5BBF-11EF-9452-2BAEEB2EC81B-90055647!pb-smtp1.pobox.com
Content-Transfer-Encoding: quoted-printable

This series is one more step towards separation of Intel/AMD support in X=
en.
With all preparation work is mostly done now, it becomes possible to make=
 build
of arch/x86/cpu/{amd.c,intel.c} files optional, depending on whether
CONFIG_{AMD,INTEL} are enabled or not.

This can be useful for builds tuned for specific platform -- by reducing =
dead
code that won't ever be executed on that platform anyway.

Note: this series (namely its Intel part) depends on optional PSR support=
 patch:
https://lore.kernel.org/xen-devel/20240801084453.1163506-1-Sergiy_Kibrik@=
epam.com/

v1 series' discussion here:
https://lore.kernel.org/xen-devel/cover.1723196909.git.Sergiy_Kibrik@epam=
.com/

Changelogs are provided per-patch.

  -Sergiy
=20
Sergiy Kibrik (5):
  x86/Kconfig: introduce CENTAUR, HYGON & SHANGHAI config options
  x86/amd: configurable handling of AMD-specific MSRs access
  x86/spec-ctrl: configurable Intlel/AMD-specific calculations
  x86/intel: optional build of intel.c
  x86/amd: optional build of amd.c

 xen/arch/x86/Kconfig.cpu             | 29 ++++++++++++++++++++++++++++
 xen/arch/x86/cpu/Makefile            | 12 ++++++------
 xen/arch/x86/cpu/common.c            | 12 +++++++++++-
 xen/arch/x86/hvm/svm/svm.c           |  6 ++++--
 xen/arch/x86/include/asm/amd.h       | 23 +++++++++++++++++++---
 xen/arch/x86/include/asm/processor.h |  3 ++-
 xen/arch/x86/msr.c                   |  4 ++++
 xen/arch/x86/spec_ctrl.c             | 19 ++++++++++++++----
 8 files changed, 91 insertions(+), 17 deletions(-)

--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 11:08:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 11:08:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778488.1188532 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seup8-0001u6-PS; Fri, 16 Aug 2024 11:08:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778488.1188532; Fri, 16 Aug 2024 11:08:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seup8-0001tx-MM; Fri, 16 Aug 2024 11:08:50 +0000
Received: by outflank-mailman (input) for mailman id 778488;
 Fri, 16 Aug 2024 11:08: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=uc/1=PP=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1seup7-0001dU-8l
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 11:08:49 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on20618.outbound.protection.outlook.com
 [2a01:111:f403:2414::618])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e80a6c5e-5bbf-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 13:08:47 +0200 (CEST)
Received: from BL1PR13CA0002.namprd13.prod.outlook.com (2603:10b6:208:256::7)
 by CYYPR12MB8732.namprd12.prod.outlook.com (2603:10b6:930:c8::9) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Fri, 16 Aug
 2024 11:08:41 +0000
Received: from BN3PEPF0000B06B.namprd21.prod.outlook.com
 (2603:10b6:208:256:cafe::90) by BL1PR13CA0002.outlook.office365.com
 (2603:10b6:208:256::7) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.17 via Frontend
 Transport; Fri, 16 Aug 2024 11:08:41 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BN3PEPF0000B06B.mail.protection.outlook.com (10.167.243.70) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.4 via Frontend Transport; Fri, 16 Aug 2024 11:08:41 +0000
Received: from cjq-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 16 Aug
 2024 06:08:37 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e80a6c5e-5bbf-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=xHu3I9i469r2xga5Dumc3PV8+yxHIvLwK5eAg9Oi7B49rB4aFT/LcjEt7Pu7LGtu3OS/Z+Oe/TruRhX2YJ45LhR0qugs42eu7LpwfELRwAwVzsuG47KBRPs8NIat3lJTW7Nm0qQCzJb6kWbArlYSUUws7dx4PMta/Kh6aoAI1RnxEqClw/w2PiGT6ZeElgvPYnvdfGcoJ4dK6oiCt/otjHCwso3Bhq9RZLv0gU1ebQ8n0RKhFgBIhmfPyaHWBX5TK+uVCRbLyU9nBNBmu3L7fWpm6FnK+bD8cXqiu0jIsTa9+gEgcIXonuk+LadvHtLFtDA7jS2hC7pTpVYkK51ayg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=XyXanb/U7Jt+W/lUhXCnanELwNqOqGwqpo+XIrtjkes=;
 b=Sdw9hRZTThmZkSr+AQuNSSZ9mxSXmZVwBu20SruJceCVGoRF2HYDzObIARt/PMf8khq03LmIqJYsGcM5O8mgyjNBD0fYu26jeZw6D4EOK2Sv9JCoGCogQ2YN0sqdvSRuUiHwjMLzO6Ktf4UmOwqGCw2naRWDnXR/zy45FkvNi/nZI2EEMAPXVbolyM3RBiJWeINQZdjlqspcwQXRale744UsLxbrXiH1ye5KqNBTgQTjOYpDqIgkR833dAJbJyKXxhuZQMeAdIJWsTDHCEqa+qKEQuq62QqXCWDsKn9I3fVcR0xZ8Z0/5v4O1Ei47JcxfrsKh0YR7PYpdzKh4xwOMQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=XyXanb/U7Jt+W/lUhXCnanELwNqOqGwqpo+XIrtjkes=;
 b=XUkl0Glodxx/ishz0iK7lFJ+F2M93lC3NGioghtZv8kRs+eWPZopWeM5oQrT+tdJ0p6aFB/9VXaVQ4OQ+L7t9+6R5YaVhg8VlnEtTn7flDo9VQ9Uuiez1Cmn8HLv0vAml1liRPH7j6UqsRRmrKnCF/xTpeVDcR+4g/4TKhFOglY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jiqian Chen <Jiqian.Chen@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>, George Dunlap
	<gwd@xenproject.org>, Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, "Juergen
 Gross" <jgross@suse.com>, "Daniel P . Smith" <dpsmith@apertussolutions.com>,
	Stewart Hildebrand <Stewart.Hildebrand@amd.com>, Jiqian Chen
	<Jiqian.Chen@amd.com>, Huang Rui <ray.huang@amd.com>
Subject: [XEN PATCH v13 1/6] xen/pci: Add hypercall to support reset of pcidev
Date: Fri, 16 Aug 2024 19:08:15 +0800
Message-ID: <20240816110820.75672-2-Jiqian.Chen@amd.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240816110820.75672-1-Jiqian.Chen@amd.com>
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com
 (10.181.40.145)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06B:EE_|CYYPR12MB8732:EE_
X-MS-Office365-Filtering-Correlation-Id: 301c08eb-8243-44f4-f4e6-08dcbde3c95e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014|7416014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?daac0cXhmaJOBBkeO8RgZhNCkqQW00sqqVtKk2nuqJp8c3vA8jzSXn1w5qKN?=
 =?us-ascii?Q?lVn2H3aKK/yDhzu2zSnfKdmj5ut4qmfN0898xJ+s9mitma/H4fNTGzR44NL/?=
 =?us-ascii?Q?IS5m1LoAevKrLTS0XNL0SzQYhl0aKRn7e4uMPe2219nB5aNVwffG94AUC/YN?=
 =?us-ascii?Q?jj8+8SEWsOl7V30uQe7zADL//TRqDxp9BSrV/0WwDPihDoFYyxXQYdadGEKt?=
 =?us-ascii?Q?ODQfMF8MFafZCINlunBZ5yRZ0Sm69rhwF6LnKzZFGE9g/6OOrXeGGn8lXBFO?=
 =?us-ascii?Q?Y24fp5//oWOwbl4phOG1+KS+mFAHfRUtvyR2PT1zLTAy1Qy9zpJCyALdWkDQ?=
 =?us-ascii?Q?YUVV+DnLWyuX4Hx82waNLEqmip3Z7ZPeLzc3P4HlazOwWxrd+pFBBBv1L9wS?=
 =?us-ascii?Q?iJxfZSKUNWERzd7Lq0ngJ6zCQyIZPPnukqbW+Po1hAmtBgRuO6UJ6o1LA/t9?=
 =?us-ascii?Q?w+E/yYqd9VD5j9FYDdv/xr971R9lCA0anjyr8c3CdgMEZFbNNB4e8qzolrMS?=
 =?us-ascii?Q?lQalck8QluK5Gc4Iwjd1QjLsBZwwZD+HSu77L5gwr3LZj4N7f9sRORdOczFf?=
 =?us-ascii?Q?lc3+1LVVLNSOu5/fJariWGs25bCKbMM25LNDfTtaoeCOnmftrOri0fU17lQr?=
 =?us-ascii?Q?X68VE+r3saSMugqTeDoGkqtHL6ES5H/39rnkRxScYkw6bOWld8ZyBzr3i/DG?=
 =?us-ascii?Q?LG+c2Ao3y4/IUnRS8rSblQ3e/rSOJiNiNs0QsXp6AE1Q39HgAdS+aSCpuObw?=
 =?us-ascii?Q?lxl9u7525oCpwQ3OIdhqXG8ZJEX3SuQsVendmy5ZB7fl4fR1V3wttPk1z5pB?=
 =?us-ascii?Q?FEgC3DckBD9iVKzsMZmeCYlZAoAAriGu4IDJMuvh63NJgTFYaQDN1v4jXjiT?=
 =?us-ascii?Q?OYVODqtx53pjiTMlONpnm6zZ5XceZko3Geij62WhEKIhXJ7YEV5xtN4mtquj?=
 =?us-ascii?Q?TS8gaXdbnnLj2x8o8cZ8E6AJlFJO2tKcWpGP62cmimcdKc69MpM54AtD21G4?=
 =?us-ascii?Q?8QCnTzrotRCVXhKe66XDPYW46U+uT8kYmQJQ51q8ry+Y7LfJ0U30G0WA9n9D?=
 =?us-ascii?Q?BBhmbd/UPh6o88I+1Q9LJZhP8nl1ZDLz7JW55XYWxzKJwR4KDP6y67Qvt+fY?=
 =?us-ascii?Q?3ppb+8pdGm+oe6Mc02QIyYYg31wDvr6IxKjzv4H7O2zQr05CVA3IXkWlRFHo?=
 =?us-ascii?Q?UV2EvKg/y6R9TvpjWzN0BmIu4Av81dJbBP7ryaZh5jZkY+U0L++G9X0DVJ7Z?=
 =?us-ascii?Q?6FiFxrKXfPv2WuEcA9FEJvsk8Q25/kfwIdQG/flMmMD0duR9Ssi/3swbL4Jg?=
 =?us-ascii?Q?9Yvg2KA0v8+2oSAjk4CFmNLhAc1KVkhlnjuerEDfXYpQnSEub3E2pmVOJF9S?=
 =?us-ascii?Q?No/bef6BEot1BLtaiNDuOHkkvM78PZ3dX2Gym31+2x1b2/aXqWl5J5ZGRRMR?=
 =?us-ascii?Q?NnW/uMbPAJQJJhY3kV92nX5mKuS8+Xa5?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014)(7416014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2024 11:08:41.2655
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 301c08eb-8243-44f4-f4e6-08dcbde3c95e
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B06B.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8732

When a device has been reset on dom0 side, the Xen hypervisor
doesn't get notification, so the cached state in vpci is all
out of date compare with the real device state.

To solve that problem, add a new hypercall to support the reset
of pcidev and clear the vpci state of device. So that once the
state of device is reset on dom0 side, dom0 can call this
hypercall to notify hypervisor.

The behavior of different reset types may be different in the
future, so divide them now so that they can be easily modified
in the future without affecting the hypercall interface.

Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
---
v12->v13 changes:
Deleted all "state" words in new code, because it is not necessary.
Deleted unnecessary parameter reset_type of function vpci_reset_device, and changed this function to inline function
Added description to commit message to indicate that the classification of reset types is for possible different behaviors in the future
Renamed reset_type of struct pci_device_reset to flags, and modified the value of macro definition of reset, let them occupy two lowest bits.
Change the function vpci_reset_device to an inline function and delete the ASSERT(rw_is_write_locked(&pdev->domain->pci_lock)); because this call exists in subsequent functions and it accesses domain and pci_lock, which will affect the compilation process.

v11->v12 changes:
Change the title of this patch(Add hypercall to support reset of pcidev).
Remove unnecessary notes, erroneous stamps, and #define.

v10->v11 changes:
Move the curly braces of "case PHYSDEVOP_pci_device_state_reset" to the next line.
Delete unnecessary local variables "struct physdev_pci_device *dev".
Downgrade printk to dprintk.
Moved struct pci_device_state_reset to the public header file.
Delete enum pci_device_state_reset_type, and use macro definitions to represent different reset types.
Delete pci_device_state_reset_method, and add switch cases in PHYSDEVOP_pci_device_state_reset to handle different reset functions.
Add reset type as a function parameter for vpci_reset_device_state for possible future use.

v9->v10 changes:
Nothing.

v8->v9 changes:
Move pcidevs_unlock below write_lock, and remove "ASSERT(pcidevs_locked());" from vpci_reset_device_state;
Add pci_device_state_reset_type to distinguish the reset types.

v7->v8 changes:
Nothing.

v6->v7 changes:
Nothing.

v5->v6 changes:
Rebase code and change old function vpci_remove_device, vpci_add_handlers to vpci_deassign_device, vpci_assign_device.

v4->v5 changes:
Add pci_lock wrap function vpci_reset_device_state.

v3->v4 changes:
Change the comment of PHYSDEVOP_pci_device_state_reset;
Move printings behind pcidevs_unlock.

v2->v3 changes:
Move the content out of pci_reset_device_state and delete pci_reset_device_state;
Add xsm_resource_setup_pci check for PHYSDEVOP_pci_device_state_reset;
Add description for PHYSDEVOP_pci_device_state_reset;
---
 xen/arch/x86/hvm/hypercall.c |  1 +
 xen/drivers/pci/physdev.c    | 52 ++++++++++++++++++++++++++++++++++++
 xen/include/public/physdev.h | 17 ++++++++++++
 xen/include/xen/vpci.h       |  6 +++++
 4 files changed, 76 insertions(+)

diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index c1bd17571e47..68815b03eb25 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen/arch/x86/hvm/hypercall.c
@@ -83,6 +83,7 @@ long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     case PHYSDEVOP_pci_mmcfg_reserved:
     case PHYSDEVOP_pci_device_add:
     case PHYSDEVOP_pci_device_remove:
+    case PHYSDEVOP_pci_device_reset:
     case PHYSDEVOP_dbgp_op:
         if ( !is_hardware_domain(currd) )
             return -ENOSYS;
diff --git a/xen/drivers/pci/physdev.c b/xen/drivers/pci/physdev.c
index 42db3e6d133c..980ff1ba3d07 100644
--- a/xen/drivers/pci/physdev.c
+++ b/xen/drivers/pci/physdev.c
@@ -2,6 +2,7 @@
 #include <xen/guest_access.h>
 #include <xen/hypercall.h>
 #include <xen/init.h>
+#include <xen/vpci.h>
 
 #ifndef COMPAT
 typedef long ret_t;
@@ -67,6 +68,57 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
         break;
     }
 
+    case PHYSDEVOP_pci_device_reset:
+    {
+        struct pci_device_reset dev_reset;
+        struct pci_dev *pdev;
+        pci_sbdf_t sbdf;
+
+        ret = -EOPNOTSUPP;
+        if ( !is_pci_passthrough_enabled() )
+            break;
+
+        ret = -EFAULT;
+        if ( copy_from_guest(&dev_reset, arg, 1) != 0 )
+            break;
+
+        sbdf = PCI_SBDF(dev_reset.dev.seg,
+                        dev_reset.dev.bus,
+                        dev_reset.dev.devfn);
+
+        ret = xsm_resource_setup_pci(XSM_PRIV, sbdf.sbdf);
+        if ( ret )
+            break;
+
+        pcidevs_lock();
+        pdev = pci_get_pdev(NULL, sbdf);
+        if ( !pdev )
+        {
+            pcidevs_unlock();
+            ret = -ENODEV;
+            break;
+        }
+
+        write_lock(&pdev->domain->pci_lock);
+        pcidevs_unlock();
+        switch ( dev_reset.flags & PCI_DEVICE_RESET_MASK )
+        {
+        case PCI_DEVICE_RESET_COLD:
+        case PCI_DEVICE_RESET_WARM:
+        case PCI_DEVICE_RESET_HOT:
+        case PCI_DEVICE_RESET_FLR:
+            ret = vpci_reset_device(pdev);
+            break;
+
+        default:
+            ret = -EOPNOTSUPP;
+            break;
+        }
+        write_unlock(&pdev->domain->pci_lock);
+
+        break;
+    }
+
     default:
         ret = -ENOSYS;
         break;
diff --git a/xen/include/public/physdev.h b/xen/include/public/physdev.h
index f0c0d4727c0b..3902723ce1db 100644
--- a/xen/include/public/physdev.h
+++ b/xen/include/public/physdev.h
@@ -296,6 +296,13 @@ DEFINE_XEN_GUEST_HANDLE(physdev_pci_device_add_t);
  */
 #define PHYSDEVOP_prepare_msix          30
 #define PHYSDEVOP_release_msix          31
+/*
+ * Notify the hypervisor that a PCI device has been reset, so that any
+ * internally cached state is regenerated.  Should be called after any
+ * device reset performed by the hardware domain.
+ */
+#define PHYSDEVOP_pci_device_reset 32
+
 struct physdev_pci_device {
     /* IN */
     uint16_t seg;
@@ -305,6 +312,16 @@ struct physdev_pci_device {
 typedef struct physdev_pci_device physdev_pci_device_t;
 DEFINE_XEN_GUEST_HANDLE(physdev_pci_device_t);
 
+struct pci_device_reset {
+    physdev_pci_device_t dev;
+#define PCI_DEVICE_RESET_COLD 0x0
+#define PCI_DEVICE_RESET_WARM 0x1
+#define PCI_DEVICE_RESET_HOT  0x2
+#define PCI_DEVICE_RESET_FLR  0x3
+#define PCI_DEVICE_RESET_MASK 0x3
+    uint32_t flags;
+};
+
 #define PHYSDEVOP_DBGP_RESET_PREPARE    1
 #define PHYSDEVOP_DBGP_RESET_DONE       2
 
diff --git a/xen/include/xen/vpci.h b/xen/include/xen/vpci.h
index da8d0f41e6f4..41e7c3bc2791 100644
--- a/xen/include/xen/vpci.h
+++ b/xen/include/xen/vpci.h
@@ -304,6 +304,12 @@ static inline bool __must_check vpci_process_pending(struct vcpu *v)
 }
 #endif
 
+static inline int __must_check vpci_reset_device(struct pci_dev *pdev)
+{
+    vpci_deassign_device(pdev);
+    return vpci_assign_device(pdev);
+}
+
 #endif
 
 /*
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 11:08:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 11:08:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778487.1188521 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seup7-0001dy-E2; Fri, 16 Aug 2024 11:08:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778487.1188521; Fri, 16 Aug 2024 11:08:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seup7-0001dr-B2; Fri, 16 Aug 2024 11:08:49 +0000
Received: by outflank-mailman (input) for mailman id 778487;
 Fri, 16 Aug 2024 11:08:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=uc/1=PP=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1seup6-0001dU-K7
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 11:08:48 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on20629.outbound.protection.outlook.com
 [2a01:111:f403:2412::629])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e7a8a47e-5bbf-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 13:08:46 +0200 (CEST)
Received: from BL1PR13CA0008.namprd13.prod.outlook.com (2603:10b6:208:256::13)
 by CY8PR12MB7537.namprd12.prod.outlook.com (2603:10b6:930:94::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19; Fri, 16 Aug
 2024 11:08:38 +0000
Received: from BN3PEPF0000B06B.namprd21.prod.outlook.com
 (2603:10b6:208:256:cafe::8c) by BL1PR13CA0008.outlook.office365.com
 (2603:10b6:208:256::13) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.10 via Frontend
 Transport; Fri, 16 Aug 2024 11:08:38 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BN3PEPF0000B06B.mail.protection.outlook.com (10.167.243.70) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.4 via Frontend Transport; Fri, 16 Aug 2024 11:08:37 +0000
Received: from cjq-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 16 Aug
 2024 06:08:34 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e7a8a47e-5bbf-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=kh9udFJlQ1+p9ZpA/KZer5o9UdKwYbwDWVapZSqWkpS/5PNRCk1q7j1CcdMnWLt6eCpupEUe/C6tIJysL2FQPUiwWPsKDAFVslHwA8wQUoD8Mglh6UusVEsPsHRRxM3niiqrBPVqj76nksAVS+TKrZXlz75XMc9Tc8ZJJUv2ZaTpCe8G1r6aQ152Xh3RiOPgAlA8PTrzl4qpipmIqLZsIaugO6+Yg/wWmpp/EB4kFE96U2i8x5xuBgswA5Gb4P5xhYg9Zu44YjHY3gtM4I0u4KmbflPIp+xaDJZjjW1tiLyvABQrje7rHERef1GcUo02kbPmgc+dygJFuBCyhgKx2g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=W6JAyUOR4ikKmEJAap9Df9OCxRRl6f8/VfXe2M+1P/M=;
 b=UTJQoFYxp0UCjO8x4ZbSH/Y5pxREZg4yb22P36//RtRLHP95y+0W5gp70vnKrScsUIwj17gTfF5ASSDMbOTsI+rIoQMVQ4o6bMfj9bQQJUkH4DsK21b7LrT24czSMHCVkffZ2jqpkNJUsFiX2oRcAPsSpwtyBOC5NCn1SP89DB9VtKqvZSSCk650kV69vUdwLYy5jsQ/4so6WSvmvUBs0OiWy0cb2BFshRC6w4pVJP86OHSlwMzHtpZFg01jVYwHGzYiBITVFxlTG/xnylyEA2UbSVy5w0VlM1v7hzSOWZuVyvmN+ydFNdr5qNBPnk5aBzn06W+zqZweVW1DYt8blQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=W6JAyUOR4ikKmEJAap9Df9OCxRRl6f8/VfXe2M+1P/M=;
 b=IC6t0h05PbWrkZ4GGhLPE0pVe2tycBmv+jng1G3QvRLtkeyAUQOl05Ypav3TSMR5AM2ujw7RvHsvgdFo0UvgI1gb69Q9OB7H45b7fHEcLaVnzg7Wbq14OdbTzEngmhLUCT8dDgdobcAtH2C6i9F+jxrjrCKttbKSTYz92iHfqmE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jiqian Chen <Jiqian.Chen@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>, George Dunlap
	<gwd@xenproject.org>, Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, "Juergen
 Gross" <jgross@suse.com>, "Daniel P . Smith" <dpsmith@apertussolutions.com>,
	Stewart Hildebrand <Stewart.Hildebrand@amd.com>, Jiqian Chen
	<Jiqian.Chen@amd.com>, Huang Rui <ray.huang@amd.com>
Subject: [XEN PATCH v13 0/6] Support device passthrough when dom0 is PVH on Xen
Date: Fri, 16 Aug 2024 19:08:14 +0800
Message-ID: <20240816110820.75672-1-Jiqian.Chen@amd.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com
 (10.181.40.145)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06B:EE_|CY8PR12MB7537:EE_
X-MS-Office365-Filtering-Correlation-Id: dcca9897-f776-4c5b-355d-08dcbde3c738
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|1800799024|7416014|376014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?TOvZmr1kWQCaxCmEAdqZNWtzCOasmkblbwVdQ3fKALEp9vtSPh/GroJl+ktB?=
 =?us-ascii?Q?gzFzU3occKyjXK3V79T0PctH262/oEAW/b7ZhjDFv3u+IRDNmerTrOC0CzvK?=
 =?us-ascii?Q?kzVsmAjrIe7QaSOruSsRx7OJdONFel5bkYJPMduGYu8qT1tLYNURIZ8+wAnW?=
 =?us-ascii?Q?vVwsP/kEYhyzTR8/iiC/207pdvC7DyPUkBwjTVyzX0lp5VXFh+hUUi4br9dH?=
 =?us-ascii?Q?cLRyIquDaaPZQercxINFumRyUOX3tUR2i2Qraeavc2M0D4nEeZNE8ZkS2Lqi?=
 =?us-ascii?Q?4zj76qjacc1tds1aDUf7zfePeOLjM9BexQ+x/0Fa3BUL85BSrM+0nQhovY2Z?=
 =?us-ascii?Q?G6Wi2wQrntmvKe2kBs3qmPU1FINhFrVh/rxrEkj1Le99xQMbR+Kf2vAK34q6?=
 =?us-ascii?Q?t3EwCnYw93mGo/f8YZTneVdvJCO5BUmz05/vglqZEE16d7GZfSDixhd5ufs9?=
 =?us-ascii?Q?8KKxM4q9bo/quAAURtw6W7myf3/is+VkeWPBqv46fcJTiseeuHjD//OBVxuI?=
 =?us-ascii?Q?MtYhwuY3vdK1b9ROGWpEY4hQaOC2UuM34Ah+r6UqROkOPo3p4BV9zc2XZm0O?=
 =?us-ascii?Q?WjMTRxdQhV6rcNBKslQxkQoM42mE/bAe/TN1XYP3F7Kgy2XZUixjjbnahXwA?=
 =?us-ascii?Q?Nl/neCs2DK9YTRZcDSdWAQnp+rzGjvZdUuUUAVB5v0a/kBymSIgz2lY3GMqB?=
 =?us-ascii?Q?gkK4WsnetbQuK0KCsLp/c9vhYy/YyGPVfMyqDnzH0djOx2o7d5m03A5mLnZV?=
 =?us-ascii?Q?LS6sM7aBisU0b/jZodLWJPdlLDiDGyg3gHBSA2WhCWDKWycDBfBcmRc5r69m?=
 =?us-ascii?Q?+8LpEa9xK5hh7bpgF5nKetEWRFuUrG2dketfh6GFG9FfhWLdOBDLmZ46/FTW?=
 =?us-ascii?Q?Bezcgj93Pdml67l61Zl2iqzmU4AvF0djHdt4GjfZ7m4LSOBWUpnj3/EtkfHs?=
 =?us-ascii?Q?xJHg9ZpD1bbPFg9rhm3BP0RTpc8oG7ocfBxzbgUujBpS0S/SyO8t+15MifLu?=
 =?us-ascii?Q?3D4nap+UKBtwB1sYyaoliuh8cEBjBIOUopQlGIK7BInreJa0ctgmFPz1d/G0?=
 =?us-ascii?Q?Dr3UwxZgkyB76gcZJiHdKzmub7Nz7scxT94iToFsP3De6PdR3k9Bj1l5tNzz?=
 =?us-ascii?Q?AcYoFHub1wfzYSG95sfMpuqWAoS8TIT5eAosedsksBekeyVDNVYwknO0wvlU?=
 =?us-ascii?Q?prMymqMnMw4A8T82w4V0/J28WWnRSE5bmYsHXK0RCyLo2wWnT7sfL7fI4nMJ?=
 =?us-ascii?Q?/Hh5OU/0dnsJHpH0ENz8PpT7ixrvxPnmg4uwep3IZETefA/17u3Am68fTM4s?=
 =?us-ascii?Q?JxhZSIPrPWyVNhgnzX/614/ms7Z1qF1Er4yOZhkQRx9EYXzoiI16rB0Kp40v?=
 =?us-ascii?Q?HOlQKnABVL3HPMeLR90RjWJOJ+0IRJg1VK/dIkJlFTDGJHHAeA=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(7416014)(376014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2024 11:08:37.6249
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: dcca9897-f776-4c5b-355d-08dcbde3c738
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B06B.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7537

Hi All,
This is v13 series to support passthrough when dom0 is PVH
The expected merge order of this series is the first three patches in this series, then patches on
kernel side, then the last three patches in this series.

v12->v13 changes:
Due to major changes in the codes, all the Reviewed-by received before have been removed.
Please review them again.
* patch#1: Delete all "state" words in new code, because it is not necessary.
           Delete unnecessary parameter reset_type of function vpci_reset_device, and changed this
           function to inline function.
           Add description to commit message to indicate that the classification of reset types is
           for possible different behaviors in the future.
           Rename reset_type of struct pci_device_reset to flags, and modified the value of macro
           definition of reset, let them occupy two lowest bits.
           Change the function vpci_reset_device to an inline function and delete the
           "ASSERT(rw_is_write_locked(&pdev->domain->pci_lock))"; because this exists in subsequent
           functions and it accesses domain and pci_lock, which will affect the compilation process.
* patch#2: Remove the PHYSDEVOP_(un)map_pirq restriction check for pvh domU and added a corresponding
           description in the commit message.
* patch#3: Add more detailed descriptions into commit message not just callstack.
* patch#4: For struct xen_domctl_gsi_permission, rename "access_flag" to "flags", change its type from
           uint8_t to uint32_t, delete "pad", add XEN_DOMCTL_GSI_REVOKE and XEN_DOMCTL_GSI_GRANT macros.
           Move "gsi > highest_gsi()" into function gsi_2_irq.
           Modify parameter gsi in function gsi_2_irq and mp_find_ioapic to unsigned int type.
           Delete unnecessary spaces and brackets around "~XEN_DOMCTL_GSI_ACTION_MASK".
           Delete unnecessary goto statements and change to direct break.
           Add description in commit message to explain how gsi to irq is converted.
* patch#5: Rename the function xc_physdev_gsi_from_pcidev to xc_pcidev_get_gsi to avoid confusion with
           physdev namesapce.
           Move the implementation of xc_pcidev_get_gsi into xc_linux.c.
           Directly use xencall_fd(xch->xcall) in the function xc_pcidev_get_gsi instead of opening
           "privcmd".
* patch#6: Delete patch #6 of v12, and added function xc_physdev_map_pirq_gsi to map pirq for gsi.
           For functions that generate libxl error, changed the return value from -1 to ERROR_*.
           Instead of declaring "ctx", use the macro "CTX".
           Add the function libxl__arch_local_romain_ has_pirq_notion to determine if there is a concept
           of pirq in the domain where xl is located.
           In the function libxl__arch_hvm_unmap_gsi, before unmap_pirq, use map_pirq to obtain the pirq
           corresponding to gsi.

Best regards,
Jiqian Chen



v11->v12 changes:
* patch#1: Change the title of this patch.
           Remove unnecessary notes, erroneous stamps, and #define.
* patch#2: Avoid using return, set error code instead when (un)map is not allowed.
           Due to functional change in v11, remove the Reviewed-by of Stefano.
* patch#3: Add more detailed descriptions into commit message not just callstack.

patch#4 in v11: remove from this series and upstream individually.

* patch#4: is patch#5 of v11, change nr_irqs_gsi to highest_gsi() to check gsi boundary, then need to
           remove "__init" of highest_gsi function.
           Change the check of irq boundary from <0 to <=0, and remove unnecessary space.
           Add #define XEN_DOMCTL_GSI_PERMISSION_MASK 1 to get lowest bit.
* patch#5: Add explanation of whether the caller of xc_physdev_map_pirq is affected.


v10->v11 changes:
* patch#1: Move the curly braces of "case PHYSDEVOP_pci_device_state_reset" to the next line.
           Delete unnecessary local variables "struct physdev_pci_device *dev".
           Downgrade printk to dprintk.
           Moved struct pci_device_state_reset to the public header file.
           Delete enum pci_device_state_reset_type, and use macro definitions to represent different
           reset types.
           Delete pci_device_state_reset_method, and add switch cases in PHYSDEVOP_pci_device_state_reset
           to handle different reset functions.
           Add reset type as a function parameter for vpci_reset_device_state for possible future use
* patch#2: Delete the judgment of "d==currd", so that we can prevent physdev_(un)map_pirq from being
           executed when domU has no pirq, instead of just preventing self-mapping; and modify the
           description of the commit message accordingly.
* patch#3: Modify the commit message to explain why the gsi of normal devices can work in PVH dom0 and why
           the passthrough device does not work in PVH dom0.
* patch#4: New patch, modification of allocate_pirq function, return the allocated pirq when there is
           already an allocated pirq and the caller has no specific requirements for pirq, and make it
           successful.
* patch#5: Modification on the hypervisor side proposed from patch#5 of v10.
           Add non-zero judgment for other bits of allow_access.
           Delete unnecessary judgment "if ( is_pv_domain(currd) || has_pirq(currd) )".
           Change the error exit path identifier "out" to "gsi_permission_out".
           Use ARRAY_SIZE() instead of open coed.
* patch#6: New patch, modification of xc_physdev_map_pirq to support mapping gsi to an idle pirq.
* patch#7: Patch#4 of v10, directly open "/dev/xen/privcmd" in the function xc_physdev_gsi_from_dev
           instead of adding unnecessary functions to libxencall.
           Change the type of gsi in the structure privcmd_gsi_from_dev from int to u32.
* patch#8: Modification of the tools part of patches#4 and #5 of v10, use privcmd_gsi_from_dev to get
           gsi, and use XEN_DOMCTL_gsi_permission to grant gsi.
           Change the hard-coded 0 to use LIBXL_TOOLSTACK_DOMID.
           Add libxl__arch_hvm_map_gsi to distinguish x86 related implementations.
           Add a list pcidev_pirq_list to record the relationship between sbdf and pirq, which can be
           used to obtain the corresponding pirq when unmap PIRQ.


v9->v10 changes:
* patch#2: Indent the comments above PHYSDEVOP_map_pirq according to the code style.
* patch#3: Modified the description in the commit message, changing "it calls" to "it will need to call",
           indicating that there will be new codes on the kernel side that will call PHYSDEVOP_setup_gsi.
           Also added an explanation of why the interrupt of passthrough device does not work if gsi is not
           registered.
* patch#4: Added define for CONFIG_X86 in tools/libs/light/Makefile to isolate x86 code in libxl_pci.c.
* patch#5: Modified the commit message to further describe the purpose of adding XEN_DOMCTL_gsi_permission.
           Deleted pci_device_set_gsi and called XEN_DOMCTL_gsi_permission directly in pci_add_dm_done.
           Added a check for all zeros in the padding field in XEN_DOMCTL_gsi_permission, and used currd
           instead of current->domain.
           In the function gsi_2_irq, apic_pin_2_gsi_irq was used instead of the original new code, and
           error handling for irq0 was added.
           Deleted the extra spaces in the upper and lower lines of the struct xen_domctl_gsi_permission
           definition.
All patches have modified signatures as follows:
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com> means I am the author.
Signed-off-by: Huang Rui <ray.huang@amd.com> means Rui sent them to upstream firstly.
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com> means I take continue to upstream.


v8->v9 changes:
* patch#1: Move pcidevs_unlock below write_lock, and remove "ASSERT(pcidevs_locked());"
           from vpci_reset_device_state;
           Add pci_device_state_reset_type to distinguish the reset types.
* patch#2: Add a comment above PHYSDEVOP_map_pirq to describe why need this hypercall.
           Change "!is_pv_domain(d)" to "is_hvm_domain(d)", and "map.domid == DOMID_SELF" to
           "d == current->domian".
* patch#3: Remove the check of PHYSDEVOP_setup_gsi, since there is same checke in below.Although their return
           values are different, this difference is acceptable for the sake of code consistency
           if ( !is_hardware_domain(currd) )
		       return -ENOSYS;
           break;
* patch#5: Change the commit message to describe more why we need this new hypercall.
           Add comment above "if ( is_pv_domain(current->domain) || has_pirq(current->domain) )" to explain
           why we need this check.
           Add gsi_2_irq to transform gsi to irq, instead of considering gsi == irq.
           Add explicit padding to struct xen_domctl_gsi_permission.


v7->v8 changes:
* patch#2: Add the domid check(domid == DOMID_SELF) to prevent self map when guest doesn't use pirq.
           That check was missed in the previous version.
* patch#4: Due to changes in the implementation of obtaining gsi in the kernel. Change to add a new function
           to get gsi by passing in the sbdf of pci device.
* patch#5: Remove the parameter "is_gsi", when there exist gsi, in pci_add_dm_done use a new function
           pci_device_set_gsi to do map_pirq and grant permission. That gets more intuitive code logic.


v6->v7 changes:
* patch#4: Due to changes in the implementation of obtaining gsi in the kernel. Change to add a new function
           to get gsi from irq, instead of gsi sysfs.
* patch#5: Fix the issue with variable usage, rc->r.


v5->v6 changes:
* patch#1: Add Reviewed-by Stefano and Stewart. Rebase code and change old function vpci_remove_device,
           vpci_add_handlers to vpci_deassign_device, vpci_assign_device
* patch#2: Add Reviewed-by Stefano
* patch#3: Remove unnecessary "ASSERT(!has_pirq(currd));"
* patch#4: Fix some coding style issues below directory tools
* patch#5: Modified some variable names and code logic to make code easier to be understood, which to use
           gsi by default and be compatible with older kernel versions to continue to use irq


v4->v5 changes:
* patch#1: add pci_lock wrap function vpci_reset_device_state
* patch#2: move the check of self map_pirq to physdev.c, and change to check if the caller has PIRQ flag, and
           just break for PHYSDEVOP_(un)map_pirq in hvm_physdev_op
* patch#3: return -EOPNOTSUPP instead, and use ASSERT(!has_pirq(currd));
* patch#4: is the patch#5 in v4 because patch#5 in v5 has some dependency on it. And add the handling of errno
           and add the Reviewed-by Stefano
* patch#5: is the patch#4 in v4. New implementation to add new hypercall XEN_DOMCTL_gsi_permission to grant gsi


v3->v4 changes:
* patch#1: change the comment of PHYSDEVOP_pci_device_state_reset; move printings behind pcidevs_unlock
* patch#2: add check to prevent PVH self map
* patch#3: new patch, The implementation of adding PHYSDEVOP_setup_gsi for PVH is treated as a separate patch
* patch#4: new patch to solve the map_pirq problem of PVH dom0. use gsi to grant irq permission in
           XEN_DOMCTL_irq_permission.
* patch#5: to be compatible with previous kernel versions, when there is no gsi sysfs, still use irq
v4 link:
https://lore.kernel.org/xen-devel/20240105070920.350113-1-Jiqian.Chen@amd.com/T/#t

v2->v3 changes:
* patch#1: move the content out of pci_reset_device_state and delete pci_reset_device_state; add
           xsm_resource_setup_pci check for PHYSDEVOP_pci_device_state_reset; add description for
		   PHYSDEVOP_pci_device_state_reset;
* patch#2: du to changes in the implementation of the second patch on kernel side(that it will do setup_gsi and
           map_pirq when assigning a device to passthrough), add PHYSDEVOP_setup_gsi for PVH dom0, and we need
		   to support self mapping.
* patch#3: du to changes in the implementation of the second patch on kernel side(that adds a new sysfs for gsi
           instead of a new syscall), so read gsi number from the sysfs of gsi.
v3 link:
https://lore.kernel.org/xen-devel/20231210164009.1551147-1-Jiqian.Chen@amd.com/T/#t

v2 link:
https://lore.kernel.org/xen-devel/20231124104136.3263722-1-Jiqian.Chen@amd.com/T/#t
Below is the description of v2 cover letter:
This series of patches are the v2 of the implementation of passthrough when dom0 is PVH on Xen.
We sent the v1 to upstream before, but the v1 had so many problems and we got lots of suggestions.
I will introduce all issues that these patches try to fix and the differences between v1 and v2.

Issues we encountered:
1. pci_stub failed to write bar for a passthrough device.
Problem: when we run \u201csudo xl pci-assignable-add <sbdf>\u201d to assign a device, pci_stub will call
pcistub_init_device() -> pci_restore_state() -> pci_restore_config_space() ->
pci_restore_config_space_range() -> pci_restore_config_dword() -> pci_write_config_dword()\u201d, the pci config
write will trigger an io interrupt to bar_write() in the xen, but the
bar->enabled was set before, the write is not allowed now, and then when 
bar->Qemu config the
passthrough device in xen_pt_realize(), it gets invalid bar values.

Reason: the reason is that we don't tell vPCI that the device has been reset, so the current cached state in
pdev->vpci is all out of date and is different from the real device state.

Solution: to solve this problem, the first patch of kernel(xen/pci: Add xen_reset_device_state
function) and the fist patch of xen(xen/vpci: Clear all vpci status of device) add a new hypercall to reset the
state stored in vPCI when the state of real device has changed.
Thank Roger for the suggestion of this v2, and it is different from
v1 (https://lore.kernel.org/xen-devel/20230312075455.450187-3-ray.huang@amd.com/), v1 simply allow domU to write
pci bar, it does not comply with the design principles of vPCI.

2. failed to do PHYSDEVOP_map_pirq when dom0 is PVH
Problem: HVM domU will do PHYSDEVOP_map_pirq for a passthrough device by using gsi. See
xen_pt_realize->xc_physdev_map_pirq and pci_add_dm_done->xc_physdev_map_pirq. Then xc_physdev_map_pirq will call
into Xen, but in hvm_physdev_op(), PHYSDEVOP_map_pirq is not allowed.

Reason: In hvm_physdev_op(), the variable "currd" is PVH dom0 and PVH has no X86_EMU_USE_PIRQ flag, it will fail
at has_pirq check.

Solution: I think we may need to allow PHYSDEVOP_map_pirq when "currd" is dom0 (at present dom0 is PVH). The
second patch of xen(x86/pvh: Open PHYSDEVOP_map_pirq for PVH dom0) allow PVH dom0 do PHYSDEVOP_map_pirq. This v2
patch is better than v1, v1 simply remove the has_pirq check
(xen https://lore.kernel.org/xen-devel/20230312075455.450187-4-ray.huang@amd.com/).

3. the gsi of a passthrough device doesn't be unmasked
 3.1 failed to check the permission of pirq
 3.2 the gsi of passthrough device was not registered in PVH dom0

Problem:
3.1 callback function pci_add_dm_done() will be called when qemu config a passthrough device for domU.
This function will call xc_domain_irq_permission()-> pirq_access_permitted() to check if the gsi has corresponding
mappings in dom0. But it didn\u2019t, so failed. See XEN_DOMCTL_irq_permission->pirq_access_permitted, "current"
is PVH dom0 and it return irq is 0.
3.2 it's possible for a gsi (iow: vIO-APIC pin) to never get registered on PVH dom0, because the devices of PVH
are using MSI(-X) interrupts. However, the IO-APIC pin must be configured for it to be able to be mapped into a domU.

Reason: After searching codes, I find "map_pirq" and "register_gsi" will be done in function
vioapic_write_redirent->vioapic_hwdom_map_gsi when the gsi(aka ioapic's pin) is unmasked in PVH dom0.
So the two problems can be concluded to that the gsi of a passthrough device doesn't be unmasked.

Solution: to solve these problems, the second patch of kernel(xen/pvh: Unmask irq for passthrough device in PVH dom0)
call the unmask_irq() when we assign a device to be passthrough. So that passthrough devices can have the mapping of
gsi on PVH dom0 and gsi can be registered. This v2 patch is different from the
v1( kernel https://lore.kernel.org/xen-devel/20230312120157.452859-5-ray.huang@amd.com/,
kernel https://lore.kernel.org/xen-devel/20230312120157.452859-5-ray.huang@amd.com/ and
xen https://lore.kernel.org/xen-devel/20230312075455.450187-5-ray.huang@amd.com/),
v1 performed "map_pirq" and "register_gsi" on all pci devices on PVH dom0, which is unnecessary and may cause
multiple registration.

4. failed to map pirq for gsi
Problem: qemu will call xc_physdev_map_pirq() to map a passthrough device\u2019s gsi to pirq in function
xen_pt_realize(). But failed.

Reason: According to the implement of xc_physdev_map_pirq(), it needs gsi instead of irq, but qemu pass irq to it and
treat irq as gsi, it is got from file /sys/bus/pci/devices/xxxx:xx:xx.x/irq in function xen_host_pci_device_get().
But actually the gsi number is not equal with irq. On PVH dom0, when it allocates irq for a gsi in
function acpi_register_gsi_ioapic(), allocation is dynamic, and follow the principle of applying first, distributing
first. And if you debug the kernel codes(see function __irq_alloc_descs), you will find the irq number is allocated
from small to large by order, but the applying gsi number is not, gsi 38 may come before gsi 28, that causes gsi 38
get a smaller irq number than gsi 28, and then gsi != irq.

Solution: we can record the relation between gsi and irq, then when userspace(qemu) want to use gsi, we can do a
translation. The third patch of kernel(xen/privcmd: Add new syscall to get gsi from irq) records all the relations
in acpi_register_gsi_xen_pvh() when dom0 initialize pci devices, and provide a syscall for userspace to get the gsi
from irq. The third patch of xen(tools: Add new function to get gsi from irq) add a new function
xc_physdev_gsi_from_irq() to call the new syscall added on kernel side.
And then userspace can use that function to get gsi. Then xc_physdev_map_pirq() will success. This v2 patch is the
same as v1( kernel https://lore.kernel.org/xen-devel/20230312120157.452859-6-ray.huang@amd.com/ and
xen https://lore.kernel.org/xen-devel/20230312075455.450187-6-ray.huang@amd.com/)

About the v2 patch of qemu, just change an included head file, other are similar to the
v1 ( qemu https://lore.kernel.org/xen-devel/20230312092244.451465-19-ray.huang@amd.com/), just call
xc_physdev_gsi_from_irq() to get gsi from irq.

Jiqian Chen (6):
  xen/pci: Add hypercall to support reset of pcidev
  x86/pvh: Allow (un)map_pirq when dom0 is PVH
  x86/pvh: Add PHYSDEVOP_setup_gsi for PVH dom0
  x86/domctl: Add hypercall to set the access of x86 gsi
  tools: Add new function to get gsi from dev
  tools: Add new function to do PIRQ (un)map on PVH dom0

 tools/include/xen-sys/Linux/privcmd.h |   7 ++
 tools/include/xenctrl.h               |  12 +++
 tools/libs/ctrl/xc_domain.c           |  15 ++++
 tools/libs/ctrl/xc_freebsd.c          |   6 ++
 tools/libs/ctrl/xc_linux.c            |  20 +++++
 tools/libs/ctrl/xc_minios.c           |   6 ++
 tools/libs/ctrl/xc_netbsd.c           |   6 ++
 tools/libs/ctrl/xc_physdev.c          |  27 +++++++
 tools/libs/ctrl/xc_solaris.c          |   6 ++
 tools/libs/light/libxl_arch.h         |   6 ++
 tools/libs/light/libxl_arm.c          |  15 ++++
 tools/libs/light/libxl_pci.c          | 112 +++++++++++++++-----------
 tools/libs/light/libxl_x86.c          |  72 +++++++++++++++++
 xen/arch/x86/domctl.c                 |  29 +++++++
 xen/arch/x86/hvm/hypercall.c          |   4 +
 xen/arch/x86/include/asm/io_apic.h    |   2 +
 xen/arch/x86/io_apic.c                |  21 +++++
 xen/arch/x86/mpparse.c                |   7 +-
 xen/drivers/pci/physdev.c             |  52 ++++++++++++
 xen/include/public/domctl.h           |  10 +++
 xen/include/public/physdev.h          |  17 ++++
 xen/include/xen/vpci.h                |   6 ++
 xen/xsm/flask/hooks.c                 |   1 +
 23 files changed, 410 insertions(+), 49 deletions(-)

-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 11:08:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 11:08:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778489.1188542 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seupA-00029A-3I; Fri, 16 Aug 2024 11:08:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778489.1188542; Fri, 16 Aug 2024 11:08:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seup9-00028z-VG; Fri, 16 Aug 2024 11:08:51 +0000
Received: by outflank-mailman (input) for mailman id 778489;
 Fri, 16 Aug 2024 11:08:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=uc/1=PP=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1seup8-0001dU-8m
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 11:08:50 +0000
Received: from NAM04-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam04on2060b.outbound.protection.outlook.com
 [2a01:111:f403:240a::60b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e939a468-5bbf-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 13:08:49 +0200 (CEST)
Received: from BL1PR13CA0026.namprd13.prod.outlook.com (2603:10b6:208:256::31)
 by CH0PR12MB8552.namprd12.prod.outlook.com (2603:10b6:610:18e::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.17; Fri, 16 Aug
 2024 11:08:44 +0000
Received: from BN3PEPF0000B06B.namprd21.prod.outlook.com
 (2603:10b6:208:256:cafe::c8) by BL1PR13CA0026.outlook.office365.com
 (2603:10b6:208:256::31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.10 via Frontend
 Transport; Fri, 16 Aug 2024 11:08:44 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BN3PEPF0000B06B.mail.protection.outlook.com (10.167.243.70) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.4 via Frontend Transport; Fri, 16 Aug 2024 11:08:44 +0000
Received: from cjq-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 16 Aug
 2024 06:08:41 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e939a468-5bbf-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=TimHHGckCdCnqkPOd+819TWZqyRgz7zp7zDGwKU5wBLivYHtBKKsV7U4ouN5FjvBH4vbofwUaQCkKi8ny86RDbn9Kn2l7R2y//LjfjJj9ZIqYRk77lczXGfXjAADQ1ogQtr2fCwOPSZ3r+vHZrs57MQUBQJRXiMxIq0XL+VffsG7crMvm/ZK2KJ/rss+P9/rEtd7hbl4PbzMZfVcvi00dVa4gttshVyeNzHLpAVE7gtyv/lK4jaefbMW4wlGvASka+GnqMSf201lRPezokQn8BI2jDiSOzwdVSh2WxBmQjibt5OWOEemjVWuWubDJqOuyM8ltYfm2/iQSG/lEfuVHQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=P2Kh0oS3w0hJmzs1gUO8zu7HPWkBa8kExEr9EreyX/M=;
 b=AB+a08wkhc8qgNm41yZh6TtKM3qLjTNd/jFsSz6kS1CWbMBilgwGQtfhS/rNFxba4N9oFEpX4Ptzyn49Peqrk4FocgbSzBRKq1CCFmNWy94yZpw3SeRMx3c9RGHFZkwcZ4fbehCKWVv+LnWNu4YLtuVBba9ieD30B7aPKTaetztkbms3RdAPXCBjya7n46nKwwToNCMK4vZs1YQlUe70t6cWWwmGgIkp6a1n2/lnkXq7NPS8rR/4bqfsZ0rMDe2BgaJsNoS4r6Je9WHJggYAyzqBSFDkjBXE8f1d6vHfYKbKqW8DSTY1DRb+eyODrkQyU9D4jplcKVjtcUP979hduA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=P2Kh0oS3w0hJmzs1gUO8zu7HPWkBa8kExEr9EreyX/M=;
 b=x8FDEDL0oYUF5xAVSjUa/RSWgbFLpJz42koa7I5sxQXhyobQszPc39kkQE1oB+3MBlev+q6D65mEcZEUerNJzt21j+zDLOQ/Zk+QFM0/OAt7OiBirVLcx0IGTFA/C+IBT7ScpCpR9YLwgiAyQVXDUknyL1Jf6qnEoD6KpTO3S8k=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jiqian Chen <Jiqian.Chen@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>, George Dunlap
	<gwd@xenproject.org>, Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, "Juergen
 Gross" <jgross@suse.com>, "Daniel P . Smith" <dpsmith@apertussolutions.com>,
	Stewart Hildebrand <Stewart.Hildebrand@amd.com>, Jiqian Chen
	<Jiqian.Chen@amd.com>, Huang Rui <ray.huang@amd.com>
Subject: [XEN PATCH v13 2/6] x86/pvh: Allow (un)map_pirq when dom0 is PVH
Date: Fri, 16 Aug 2024 19:08:16 +0800
Message-ID: <20240816110820.75672-3-Jiqian.Chen@amd.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240816110820.75672-1-Jiqian.Chen@amd.com>
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com
 (10.181.40.145)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06B:EE_|CH0PR12MB8552:EE_
X-MS-Office365-Filtering-Correlation-Id: 54c187cd-78f4-4756-c9bb-08dcbde3cb5a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|36860700013|7416014|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?tu3Jm9nEg3LtFbx8a/fOOLx2jKTNmqAzAPM60wO4wrmvwKi1yv2Nx/yoUiIa?=
 =?us-ascii?Q?sC1qw+4G3TtxlwgRD3XJ/6rKEDf9JshQhCrgn5OmJROz+/pRMYsHuqbcrqk9?=
 =?us-ascii?Q?EHjF8Cl4fH82C6MD7iSqkQlBADJfBEGsq61+rc4Xeccm5fz76yzPSVev40q9?=
 =?us-ascii?Q?CfjbbyvpIZ5ITs1J/iyy97WToMVmu9dp/UkW3AsYWwam1DH3aof8AxdlOeCL?=
 =?us-ascii?Q?hjPNBVE7gNf/NlH+9jAiyqxH2v0IoGizuEMXVpTHFoAcMyW3hR0w+htPTcaG?=
 =?us-ascii?Q?wVWWzFV/eQohYMWlExGMRz5RdN3JAOa3vNJWFzSbCoHU6MzHmWRDRMKAuWIJ?=
 =?us-ascii?Q?cOquZswRPoiCv7WprsA59njBsgXOQx6Acsle30q+KvLjNRHvgapkSwnfHIDg?=
 =?us-ascii?Q?cteSFSd87cCoIj7o656H/sMjiH13kE3ewmBVbYygPxJzZ+NaElB1lNPwoo6e?=
 =?us-ascii?Q?96YrLWrErYLqy+RVggiJrau4pDj+c/pcahMQVihU1nYCQqWTcfn3UGqOV2Vt?=
 =?us-ascii?Q?sM6Xf3ItRMGM1Bv5hw4Bh65AeInlgerwxPafNKlevodtuGcMwMHdAs+f6Hy+?=
 =?us-ascii?Q?/ENmXA0iByiyxVvduV0cnZeil+i5xLA5tv8ZA5upq8KeV9Ltx11/J1FS+dBq?=
 =?us-ascii?Q?DpVaayA9KXnSuIXbbXw7A/GtoqtI25UVHrCYdppoIu/YC3+sFptwlxKhAtWk?=
 =?us-ascii?Q?q5xkTuf1RHGhXufSFuA3pb3E8THjRauOZN1WfLU4FLAqxdMcsG4Q2pDaO1KK?=
 =?us-ascii?Q?lssplSnN/ZvtigDnkwqm61TuuxQ4floBmKLKecM0YqQpU7ko57Dhr2xKSf5w?=
 =?us-ascii?Q?qUzaq8XRnE9nhA32Aytr6QEVokVfpXSjPua35FEQjqDcJHtL/eN1p7HVDOJW?=
 =?us-ascii?Q?eao2A6L1w/X5ASgTtpBtrj1yjkX55jHdFRbEk6hsgQ5Tcm/CZzhShKSUiCk5?=
 =?us-ascii?Q?E7RKmr6B+pA8aEjul8NcCke6mbDGGZjvWCIlZ2z6eBBxt/BSjk/GOfMDCW1H?=
 =?us-ascii?Q?x9No7ukbB6atdBH8cNcieH3UZl16BXAJcoGoN98kq821yV59nLzBPhcBDs2l?=
 =?us-ascii?Q?N9wCvH4SkGezF3m91CbGUNruTW+7P/63ZDpoaaBMFmaTVpd3u+i+F6HOGzxR?=
 =?us-ascii?Q?DqoZ4kILHNcQIep+2P1tfzpFK9i8HRzg8cvYlmhe/Oi0bmVdOGa/Ztr/oWPM?=
 =?us-ascii?Q?Lx7qW/kkMcF7T1Pxh/StJHoCYKwohejAruqgH+J7uAybedzQX2bUcw8jl+v9?=
 =?us-ascii?Q?XRby+uG9FVYRPocPA2+YBcTQvdwyABdUCcCbwwa1LYRdbl/ZsUjXsh4gdBH9?=
 =?us-ascii?Q?12JGB3xTu9u3R3KKrO4QxzYDAx0MvpGyhuzZZTfCqA9r42tOomZsqvL/Ba3l?=
 =?us-ascii?Q?9r9IzKzCKxjbtmED/IETdAxDUF7GpVyBD/aqjyiBB/YaEPrKhPO08VslpAiF?=
 =?us-ascii?Q?myR8dcYXwITmkbpoe6FVCn8Q4DgceFzM?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(7416014)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2024 11:08:44.5937
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 54c187cd-78f4-4756-c9bb-08dcbde3cb5a
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B06B.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB8552

If run Xen with PVH dom0 and hvm domU, hvm will map a pirq for
a passthrough device by using gsi, see qemu code
xen_pt_realize->xc_physdev_map_pirq and libxl code
pci_add_dm_done->xc_physdev_map_pirq. Then xc_physdev_map_pirq
will call into Xen, but in hvm_physdev_op, PHYSDEVOP_map_pirq
is not allowed because currd is PVH dom0 and PVH has no
X86_EMU_USE_PIRQ flag, it will fail at has_pirq check.

So, allow PHYSDEVOP_map_pirq when dom0 is PVH and also allow
iPHYSDEVOP_unmap_pirq for the removal device path to unmap pirq.
So that the interrupt of a passthrough device can be successfully
mapped to pirq for domU with a notion of PIRQ when dom0 is PVH.

To exposing the functionality to wider than (presently) necessary
audience(like PVH domU), so it doesn't add any futher restrictions.
And there already are some senarios for domains without
X86_EMU_USE_PIRQ to use these functions.

Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
---
v12->v13 changes:
Removed the PHYSDEVOP_(un)map_pirq restriction check for pvh domU and added a corresponding description in the commit message.

v11->v12 changes:
Avoid using return, set error code instead when (un)map is not allowed.

v10->v11 changes:
Delete the judgment of "d==currd", so that we can prevent physdev_(un)map_pirq from being executed when domU has no pirq, instead of just preventing self-mapping.
And modify the description of the commit message accordingly.

v9->v10 changes:
Indent the comments above PHYSDEVOP_map_pirq according to the code style.

v8->v9 changes:
Add a comment above PHYSDEVOP_map_pirq to describe why need this hypercall.
Change "!is_pv_domain(d)" to "is_hvm_domain(d)", and "map.domid == DOMID_SELF" to "d == current->domian".

v7->v8 changes:
Add the domid check(domid == DOMID_SELF) to prevent self map when guest doesn't use pirq.
That check was missed in the previous version.

v6->v7 changes:
Nothing.

v5->v6 changes:
Nothing.

v4->v5 changes:
Move the check of self map_pirq to physdev.c, and change to check if the caller has PIRQ flag, and just break for PHYSDEVOP_(un)map_pirq in hvm_physdev_op.

v3->v4 changes:
add check to prevent PVH self map.

v2->v3 changes:
Du to changes in the implementation of the second patch on kernel side(that it will do setup_gsi and map_pirq when assigning a device to passthrough), add PHYSDEVOP_setup_gsi for PVH dom0, and we need to support self mapping.
---
 xen/arch/x86/hvm/hypercall.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 68815b03eb25..0b7fc060b4e2 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen/arch/x86/hvm/hypercall.c
@@ -73,6 +73,8 @@ long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
     {
     case PHYSDEVOP_map_pirq:
     case PHYSDEVOP_unmap_pirq:
+        break;
+
     case PHYSDEVOP_eoi:
     case PHYSDEVOP_irq_status_query:
     case PHYSDEVOP_get_free_pirq:
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 11:08:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 11:08:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778490.1188552 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seupG-0002WG-CJ; Fri, 16 Aug 2024 11:08:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778490.1188552; Fri, 16 Aug 2024 11:08:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seupG-0002W3-97; Fri, 16 Aug 2024 11:08:58 +0000
Received: by outflank-mailman (input) for mailman id 778490;
 Fri, 16 Aug 2024 11:08:57 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=uc/1=PP=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1seupF-0001Oc-92
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 11:08:57 +0000
Received: from NAM12-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam12on20610.outbound.protection.outlook.com
 [2a01:111:f403:200a::610])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ec9afd98-5bbf-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 13:08:55 +0200 (CEST)
Received: from BN9P221CA0005.NAMP221.PROD.OUTLOOK.COM (2603:10b6:408:10a::28)
 by CYYPR12MB8750.namprd12.prod.outlook.com (2603:10b6:930:be::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20; Fri, 16 Aug
 2024 11:08:49 +0000
Received: from BN3PEPF0000B069.namprd21.prod.outlook.com
 (2603:10b6:408:10a:cafe::4a) by BN9P221CA0005.outlook.office365.com
 (2603:10b6:408:10a::28) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.23 via Frontend
 Transport; Fri, 16 Aug 2024 11:08:49 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BN3PEPF0000B069.mail.protection.outlook.com (10.167.243.68) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.4 via Frontend Transport; Fri, 16 Aug 2024 11:08:48 +0000
Received: from cjq-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 16 Aug
 2024 06:08:44 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ec9afd98-5bbf-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Fp/dq7IrhwiDsx/qUTdgRxH4Nqmdm8q/w5WTnN+n3sJgQw95LC9Y25ZkDZ6gH3TgGTUtCXmgVZkqw82lCA6EaGrYMJCnQzELO0njQxFVmP1hK+nM4ydLmvR6Vi/ay1kh596EcfLZOSUiCz7u0riQZq5O34SDdiR4rOA41HvWE4PZDRKUoXNS2HpOxsEnb8muf8aIZR3fk+oFrPX0IRplUTDIXDesDteY4i6+2C6mGuGMxf5M7olfTq8j6t+2tjLomNyyvEwfoJS/UfQ2wkFVTAeAIARKnhZFQ3dPd0qKfvHXCz2hLrEEIOEAcauGe0dsXOo9FjNC8jajCwMt0mJGcw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QEmijQKrvaaonY0ryNFeoICShxLiMC7FhSWe8KUC0mg=;
 b=VPcTrTBgQ2G+7E0KiDIhL2kIfTx+0L7KW4snaC5FYsLhMsEF8ioJ5NahXjktUkefZlo0Mej1wgg96FUjIPoo9gGqp3ZHsXPcomGxfzj9PfFnIiM9XwMHNixvAfQSaJfQl9Y8X/hi11GU87NXUS/uv4RPjFt3xW2vAGxcxpL7vonLTKRZQaEubBHr8ljHztsuicsGCv7vrdd0/i+AfNUj+/MaMdo+u0PXeFFaGdkvufOtYf3OZzxPQM7QtMhO2MBEtNScd5J9OXZ6LX1NTajQbi9ljXM6LIf/QHbTYRF8//4bzFHj56+MzlvlBvAaT1D76nNcACWfPrKLr3i+iLRv5w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QEmijQKrvaaonY0ryNFeoICShxLiMC7FhSWe8KUC0mg=;
 b=zeNgXRolwhjky5XuvT27UfM8gPkhwPgxHlJDW1CT0K8DKO43/zCcl26/lcHq1xehdhc5avKkEWPQkgX3Kg2wRHcnivwCW+dpduEb8C6SsEOvp7z8fYvtTK+fLspfpIrGlhDG4OoDhsJakBojUfY8x5NGgcPbKNX51xVebesDVk4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jiqian Chen <Jiqian.Chen@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>, George Dunlap
	<gwd@xenproject.org>, Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, "Juergen
 Gross" <jgross@suse.com>, "Daniel P . Smith" <dpsmith@apertussolutions.com>,
	Stewart Hildebrand <Stewart.Hildebrand@amd.com>, Jiqian Chen
	<Jiqian.Chen@amd.com>, Huang Rui <ray.huang@amd.com>
Subject: [XEN PATCH v13 3/6] x86/pvh: Add PHYSDEVOP_setup_gsi for PVH dom0
Date: Fri, 16 Aug 2024 19:08:17 +0800
Message-ID: <20240816110820.75672-4-Jiqian.Chen@amd.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240816110820.75672-1-Jiqian.Chen@amd.com>
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com
 (10.181.40.145)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B069:EE_|CYYPR12MB8750:EE_
X-MS-Office365-Filtering-Correlation-Id: 91041b6b-1b0e-4d14-68d8-08dcbde3cd64
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700013|1800799024|7416014|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?wL+0lLg6AKsqXM1d+3yJcRlTxYamDeEiureb6JxOJTEtELTaMrOudw5NOunJ?=
 =?us-ascii?Q?5gcs5iimbCrovCEGXjm7+6RKLpBcgA2HLUDDNnATASs3ADN80zEykhVimZXy?=
 =?us-ascii?Q?xNTZZ1jAqZ+KIekExBaDF+WeHXVfXQ2BE/DDahmaNaFkI3bFCBNyEsGQbrRZ?=
 =?us-ascii?Q?/Ki2BRY2Lcu0pi2KrcYUlE/yU4cy6c3bbbyY0EpFAMP+mzZg5qcW8FXFXqH0?=
 =?us-ascii?Q?zYx0TThTCA3XuInlxRuuLiYprNvODz/7RkZtUj/TGqjwJW5X1BNrcSn/ss/G?=
 =?us-ascii?Q?pO/EblPb2RCH8GlfLwNZqcbC3dfRO//saMM/Onkgg5ViwFtPo31bH+XZWYKO?=
 =?us-ascii?Q?OjRvhV0ClV6l62xwnmqI+VhijwATQwKDR/A/2yl3UoqWzbLD5xLO5m7cpiZ7?=
 =?us-ascii?Q?OQrMRbGD9D171BrZEIojI+XkgzJqurqlYU51QZPvDCNhXa9pcayZtfn6wQ4a?=
 =?us-ascii?Q?GwAXle/5djZHjWvP40Awvi2t7m1I56GxUPdmutDwUo/RGYI4s60FT6ucXsrr?=
 =?us-ascii?Q?umDE3h+Bdzrnzl0v+HMKDpQq5q1k3N8rhbFcFMjUSxdjtFylvH6HbWf1qk5G?=
 =?us-ascii?Q?ZtFjlyDws3Ni5rv4gnZTh3ipqWnxzYa31903ir7npVbbuhpchohghLxegJgc?=
 =?us-ascii?Q?D9um/jSmzlCnS1cfKHjXd6z7tf35XsXgI9BC/SFZmTXRbRDyt4P2jD7pigJm?=
 =?us-ascii?Q?t19yJHqBTYXA+gRnaylD+v2Ouoq2/bp8eN0tZq51tRC/BBgNPXkZSveC+0z6?=
 =?us-ascii?Q?ghRruoAgSsIwDm+VqLxEWshO0NAsg0ZhUn/dGGILcJPVI2d2A7KabXlVT4zx?=
 =?us-ascii?Q?s9LO1vKgS4aGWcMnp0yuI6w/7remxtQwH2B/kYZdeVrkDmDRFrFvdmTI0j7W?=
 =?us-ascii?Q?InoZvVX3/MyopDdySujRhKHN4XgVu1w7ty0SdFz2+sk+1Sl4SL8T+XoYG2vJ?=
 =?us-ascii?Q?BEEiO0c2DqQWrXbqq1f+0PS1ZeCgeEBUvblvP71FcHIxbi8Q5+PKNQz2By+u?=
 =?us-ascii?Q?IaUGYLEMi/zTyouj4icWmAGi5d/GMKj+TDCcdbQWnFgZmGlb/+gr1XPrmh88?=
 =?us-ascii?Q?FP1NPZDUWhWD3rHCZARdbU6uRDVAFY/W5idjDEiDAGYzdDZQtsUxeH5ZX606?=
 =?us-ascii?Q?FmZZf8UHzVEjk+LER1p/5Emug5RE4KoYOD4hAbSrpg0eb9AennGPulN/5XPr?=
 =?us-ascii?Q?cQK0w2M3v259jKBjH4dyfM3SZPb6KRlVZIgN2ttpk2CYa3W5b1YTj+Qv3WLs?=
 =?us-ascii?Q?FINxustum0pmApA5gQs10OKsCgAQYhxPeapZwGxrpnwhFCFX7pkJtq0sF8a+?=
 =?us-ascii?Q?JSsLIe06SrJ7yy3yyT2BnondfMhXw/9T63yNDyrK/uFDCeAeslLO4HjwLFFC?=
 =?us-ascii?Q?P0psOzY50FgD7C6bPr3Nfw8eT5whPIa4tM22054BXg3Gqc64NQ=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2024 11:08:48.0122
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 91041b6b-1b0e-4d14-68d8-08dcbde3cd64
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B069.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8750

The gsi of a passthrough device must be configured for it to be
able to be mapped into a hvm domU.
But When dom0 is PVH, the gsis may not get registered(see below
clarification), it causes the info of apic, pin and irq not be
added into irq_2_pin list, and the handler of irq_desc is not set,
then when passthrough a device, setting ioapic affinity and vector
will fail.

To fix above problem, on Linux kernel side, a new code will
need to call PHYSDEVOP_setup_gsi for passthrough devices to
register gsi when dom0 is PVH.

So, add PHYSDEVOP_setup_gsi into hvm_physdev_op for above
purpose.

Clarify two questions:
First, why the gsi of devices belong to PVH dom0 can work?
Because when probe a driver to a normal device, it uses the normal
probe function of pci device, in its callstack, it requests irq
and unmask corresponding ioapic of gsi, then trap into xen and
register gsi finally.
Callstack is(on linux kernel side) pci_device_probe->
request_threaded_irq-> irq_startup-> __unmask_ioapic->
io_apic_write, then trap into xen hvmemul_do_io->
hvm_io_intercept-> hvm_process_io_intercept->
vioapic_write_indirect-> vioapic_hwdom_map_gsi-> mp_register_gsi.
So that the gsi can be registered.

Second, why the gsi of passthrough device can't work when dom0
is PVH?
Because when assign a device to passthrough, it uses the specific
probe function of pciback, in its callstack, it doesn't install a
fake irq handler due to the ISR is not running. So that
mp_register_gsi on Xen side is never called, then the gsi is not
registered.
Callstack is(on linux kernel side) pcistub_probe->pcistub_seize->
pcistub_init_device-> xen_pcibk_reset_device->
xen_pcibk_control_isr->isr_on==0.

Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
---
 xen/arch/x86/hvm/hypercall.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index 0b7fc060b4e2..81883c8d4f60 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen/arch/x86/hvm/hypercall.c
@@ -82,6 +82,7 @@ long hvm_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
             return -ENOSYS;
         break;
 
+    case PHYSDEVOP_setup_gsi:
     case PHYSDEVOP_pci_mmcfg_reserved:
     case PHYSDEVOP_pci_device_add:
     case PHYSDEVOP_pci_device_remove:
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 11:09:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 11:09:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778493.1188562 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seupJ-0002st-Qp; Fri, 16 Aug 2024 11:09:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778493.1188562; Fri, 16 Aug 2024 11:09:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seupJ-0002sk-My; Fri, 16 Aug 2024 11:09:01 +0000
Received: by outflank-mailman (input) for mailman id 778493;
 Fri, 16 Aug 2024 11:09:00 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=uc/1=PP=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1seupI-0001Oc-Cl
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 11:09:00 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on20618.outbound.protection.outlook.com
 [2a01:111:f403:2414::618])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eee73b25-5bbf-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 13:08:58 +0200 (CEST)
Received: from BN9P221CA0005.NAMP221.PROD.OUTLOOK.COM (2603:10b6:408:10a::28)
 by SA0PR12MB4493.namprd12.prod.outlook.com (2603:10b6:806:72::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20; Fri, 16 Aug
 2024 11:08:52 +0000
Received: from BN3PEPF0000B069.namprd21.prod.outlook.com
 (2603:10b6:408:10a:cafe::42) by BN9P221CA0005.outlook.office365.com
 (2603:10b6:408:10a::28) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.23 via Frontend
 Transport; Fri, 16 Aug 2024 11:08:52 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BN3PEPF0000B069.mail.protection.outlook.com (10.167.243.68) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.4 via Frontend Transport; Fri, 16 Aug 2024 11:08:51 +0000
Received: from cjq-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 16 Aug
 2024 06:08:48 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eee73b25-5bbf-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Qgd8BIPxS3E37iV3X9XYhiLJShr4gyCvYg5c0s9tJacPQqA7KXJ161Payx6202qJK619f/Y+42FGLAj0tJf9iccRpeK5JoxtPEbMdOWK3qC1rYO5bdmRm146WwCKaJLpLYG9Tbd9ALL1iqEsyMtsyycYjRGWzRSlZOTqNCWVGdt6KOZ1jCMmlyHivtV9YvIJabdV6tdx+RIAWOdX/glHH2nkrXyrjjG9GA9XcsD4irtFbi60M/PisccfRtOLQ8KldcIKCBywABhCQT554YVNXhtXtx4Qmq3NBRig+hegb8daqM5fy5Q6Y8cwUOdRuJ8WGLVKVqHdr1VTDmjGmkogOA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Kbo5f+6yaKRR0HDxkNq97Qgqo1a26fSHS6Hkqz1R/2w=;
 b=yZqmgSWzcPk0/se63zYlgeLunsT6Puji+RW52cw7uTDwBKAWYdOcj7rdyMAkPZ/OwtfS+6/uU5lVYcLANy2QVbWvT8BwtG+Xa33ylUGfKx0nljfbmT2G0WETmNWuWqoLXNf5axWU4dvtvTwvZhAVfs3QpeJ9nzSWpGeyWBwfjKJEY7HpEm/G0l+LLFyZgv51WJjVt1UbTPAsULoXgl74rBYVRKHRVkzXdMkt9vezYY2jFVBay/TfjykwLrGJHyyu51ItT0TZdQR8rr9KTAuksbtl5MAktGx4VE/AFyeidQW29zTf6YVWa1iJvKw6Lx8viQ+qPw21+vQ1eL+E2+OATA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Kbo5f+6yaKRR0HDxkNq97Qgqo1a26fSHS6Hkqz1R/2w=;
 b=nJVB8lIdkqzdsKoPY0A3+ft27xMOaJLJCdUirUkVn85VKGMrmfipGgGhW/t2NzJQ8bp3qHJe81mztVwM5pWQVoIXlZChy3y1U9uuoNIK37X3w/ThuAwp4p679DzXkkN83Hi/m/tc2/EeyZ6Q7k13hwyVu03vjiFLbqhGwiNvyAk=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jiqian Chen <Jiqian.Chen@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>, George Dunlap
	<gwd@xenproject.org>, Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, "Juergen
 Gross" <jgross@suse.com>, "Daniel P . Smith" <dpsmith@apertussolutions.com>,
	Stewart Hildebrand <Stewart.Hildebrand@amd.com>, Jiqian Chen
	<Jiqian.Chen@amd.com>, Huang Rui <ray.huang@amd.com>
Subject: [XEN PATCH v13 4/6] x86/domctl: Add hypercall to set the access of x86 gsi
Date: Fri, 16 Aug 2024 19:08:18 +0800
Message-ID: <20240816110820.75672-5-Jiqian.Chen@amd.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240816110820.75672-1-Jiqian.Chen@amd.com>
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com
 (10.181.40.145)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B069:EE_|SA0PR12MB4493:EE_
X-MS-Office365-Filtering-Correlation-Id: 64dbaae4-2342-4785-d4c1-08dcbde3cfba
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|376014|7416014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?3+RRkz2tvkLib2uIdS5eL+Iv+tDdgJs++78C8ohwD5mwqOwI0OguDefoHbB4?=
 =?us-ascii?Q?cQv9eodf6AOv6Yp1YqXS2RzWn4l+Ujb5X031bO9tG0FqWSDEBAODQR7KCmps?=
 =?us-ascii?Q?mjf9zn/v55ed1dRqo8qW45GMGpo5tI/6M1cq8HYYWaGu9vXaM2Jx7dLrLRDr?=
 =?us-ascii?Q?elmMgONXgUoK3JaIoi1OmI9pg48YfnDaTCYz2hfCJ+D795hOcUjP11bjeqcT?=
 =?us-ascii?Q?iTuUXi6qR/NDK/B9BmI68+N66XxGubjORyES+gpZNW632yhRFflGzStVLIuw?=
 =?us-ascii?Q?Zg0dhnVbiq+bFUOIXxGC1/JlEGHMAP6za6eVH8sIEARTib8la1QwcEEVByaF?=
 =?us-ascii?Q?0ctxrvXBhYfiDdoGORUBvtwvXWFQ5i8IimAjVcA8BoiPvWuqfLNRo7EXufR7?=
 =?us-ascii?Q?SrQnMLUjjjN3r7CAXsTj+ng0+NjwyMPEN+Eedr1YDrQqqmEBDxO98x5QyvTv?=
 =?us-ascii?Q?7Q9hEr0kIxNcfQO7tLEeIVXysswLvU6YLAvLA9flCW4kEcfx2N9uRxe5lSsM?=
 =?us-ascii?Q?otWS7vbuLrPGA1+QzNwGPKTPKvDKoG5PbRT0O1PAX7QXvlqTEfC1YhKjoS69?=
 =?us-ascii?Q?GV13J+RfJi1zXNf+SX4GqneXfrzeYjcMPPPsncjNm3ARi2pjL0klNLn3ruYP?=
 =?us-ascii?Q?cRh48wLo3h8eT6vpaybn8/lP+w4s++bIecl0W6kbJA3oP0bRbtA8w4DRUfwE?=
 =?us-ascii?Q?vh5Ozhot/a3K+gtCvDqeLLF8vdFkbP+UQt28COUhJXmL3JYxAU31cbqmUgII?=
 =?us-ascii?Q?BfRguWhQ7uTDj4AWT6sDBKb8c8WCvRDQ7RzTdnYwpOSwJkzq3DYccjrDFB1x?=
 =?us-ascii?Q?JFcXIkVYxpmpw7r65EJwymlE1X1vfdLv/IO3+IekjfC/07AsLxz1xr/2yA/G?=
 =?us-ascii?Q?3V98UYlcjSYBtltcD4rDqumU1K2kew9ORp8E5x95su/R5sHJ2A03fBlxe0mj?=
 =?us-ascii?Q?dF6bhS++yMmVYjz3glqVZnRrQp1EWxkdvDNcS/lQ/6IhMCp2PkqyeZQ7d2g3?=
 =?us-ascii?Q?tJVbr8fOCXsedeIcLeu8SxKem7djoWOQjksS+mDxkr/l/60M8eC3NvxkYgdd?=
 =?us-ascii?Q?KrraLuOunV1p3zFx386Mmi45dTFilga8NWpWQLDGnr7vMYVPjBoxjt1/Lw+Y?=
 =?us-ascii?Q?vE2Nglpfprn2Tq8UzEUhJN6/B9nA1M4dR/T5IrnafzlcSRUPzMewYsaaEqHc?=
 =?us-ascii?Q?xXjH0m0bxMpuoB8JhvdkoQ1ziZDHSDJu6J/qVoccDxTViBnu6J2qapnyDAXs?=
 =?us-ascii?Q?Ag2s71CxzdNb7VxsOLw/l69bOJRveMiyv6nzi+Odqs4UNXVNoEiDcHupu3x/?=
 =?us-ascii?Q?MHM+kBAumbglw1BMsownIo7v94cgMLSenfODTDcR5LN4mrEeGdWytNfsaV+f?=
 =?us-ascii?Q?7VR3uffWM/vmmKeqeBDIr+JKBeNkQ2c8aBzmO2KcOuJ2sJqzRw=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(7416014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2024 11:08:51.9496
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 64dbaae4-2342-4785-d4c1-08dcbde3cfba
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B069.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4493

Some type of domains don't have PIRQs, like PVH, it doesn't do
PHYSDEVOP_map_pirq for each gsi. When passthrough a device
to guest base on PVH dom0, callstack
pci_add_dm_done->XEN_DOMCTL_irq_permission will fail at function
domain_pirq_to_irq, because PVH has no mapping of gsi, pirq and
irq on Xen side.
What's more, current hypercall XEN_DOMCTL_irq_permission requires
passing in pirq to set the access of irq, it is not suitable for
dom0 that doesn't have PIRQs.

So, add a new hypercall XEN_DOMCTL_gsi_permission to grant/revoke
the permission of irq (translated from x86 gsi) to dumU when dom0
has no PIRQs.

Regarding the translation from gsi to irq, it is that if there are
ACPI overrides entries then get translation from them, if not gsi
are identity mapped into irq.

Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
---
CC: Daniel P . Smith <dpsmith@apertussolutions.com>
Remaining comment @Daniel P . Smith:
+        ret = -EPERM;
+        if ( !irq_access_permitted(currd, irq) ||
+             xsm_irq_permission(XSM_HOOK, d, irq, flags) )
+            break;
Is it okay to issue the XSM check using the translated value(irq),
not the one(gsi) that was originally passed into the hypercall?
---
v12->v13 changes:
For struct xen_domctl_gsi_permission, rename "access_flag" to "flags", change its type from uint8_t to uint32_t, delete "pad", add XEN_DOMCTL_GSI_REVOKE and XEN_DOMCTL_GSI_GRANT macros.
Move "gsi > highest_gsi()" into function gsi_2_irq.
Modify parameter gsi in function gsi_2_irq and mp_find_ioapic to unsigned int type.
Delete unnecessary spaces and brackets around "~XEN_DOMCTL_GSI_ACTION_MASK".
Delete unnecessary goto statements and change to direct break.
Add description in commit message to explain how gsi to irq isconverted.

v11->v12 changes:
Change nr_irqs_gsi to highest_gsi() to check gsi boundary, then need to remove "__init" of highest_gsi function.
Change the check of irq boundary from <0 to <=0, and remove unnecessary space.
Add #define XEN_DOMCTL_GSI_PERMISSION_MASK 1 to get lowest bit.

v10->v11 changes:
Extracted from patch#5 of v10 into a separate patch.
Add non-zero judgment for other bits of allow_access.
Delete unnecessary judgment "if ( is_pv_domain(currd) || has_pirq(currd) )".
Change the error exit path identifier "out" to "gsi_permission_out".
Use ARRAY_SIZE() instead of open coed.

v9->v10 changes:
Modified the commit message to further describe the purpose of adding XEN_DOMCTL_gsi_permission.
Added a check for all zeros in the padding field in XEN_DOMCTL_gsi_permission, and used currd instead of current->domain.
In the function gsi_2_irq, apic_pin_2_gsi_irq was used instead of the original new code, and error handling for irq0 was added.
Deleted the extra spaces in the upper and lower lines of the struct xen_domctl_gsi_permission definition.

v8->v9 changes:
Change the commit message to describe more why we need this new hypercall.
Add comment above "if ( is_pv_domain(current->domain) || has_pirq(current->domain) )" to explain why we need this check.
Add gsi_2_irq to transform gsi to irq, instead of considering gsi == irq.
Add explicit padding to struct xen_domctl_gsi_permission.

v5->v8 changes:
Nothing.

v4->v5 changes:
New implementation to add new hypercall XEN_DOMCTL_gsi_permission to grant gsi.
---
 xen/arch/x86/domctl.c              | 29 +++++++++++++++++++++++++++++
 xen/arch/x86/include/asm/io_apic.h |  2 ++
 xen/arch/x86/io_apic.c             | 21 +++++++++++++++++++++
 xen/arch/x86/mpparse.c             |  7 +++----
 xen/include/public/domctl.h        | 10 ++++++++++
 xen/xsm/flask/hooks.c              |  1 +
 6 files changed, 66 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 68b5b46d1a83..60b5578c47f8 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -36,6 +36,7 @@
 #include <asm/xstate.h>
 #include <asm/psr.h>
 #include <asm/cpu-policy.h>
+#include <asm/io_apic.h>
 
 static int update_domain_cpu_policy(struct domain *d,
                                     xen_domctl_cpu_policy_t *xdpc)
@@ -237,6 +238,34 @@ long arch_do_domctl(
         break;
     }
 
+    case XEN_DOMCTL_gsi_permission:
+    {
+        int irq;
+        unsigned int gsi = domctl->u.gsi_permission.gsi;
+        uint32_t flags = domctl->u.gsi_permission.flags;
+
+        /* Check all bits are zero except lowest bit */
+        ret = -EINVAL;
+        if ( flags & ~XEN_DOMCTL_GSI_ACTION_MASK )
+            break;
+
+        ret = irq = gsi_2_irq(gsi);
+        if ( ret <= 0 )
+            break;
+
+        ret = -EPERM;
+        if ( !irq_access_permitted(currd, irq) ||
+             xsm_irq_permission(XSM_HOOK, d, irq, flags) )
+            break;
+
+        if ( flags )
+            ret = irq_permit_access(d, irq);
+        else
+            ret = irq_deny_access(d, irq);
+
+        break;
+    }
+
     case XEN_DOMCTL_getpageframeinfo3:
     {
         unsigned int num = domctl->u.getpageframeinfo3.num;
diff --git a/xen/arch/x86/include/asm/io_apic.h b/xen/arch/x86/include/asm/io_apic.h
index 78268ea8f666..62456806c7af 100644
--- a/xen/arch/x86/include/asm/io_apic.h
+++ b/xen/arch/x86/include/asm/io_apic.h
@@ -213,5 +213,7 @@ unsigned highest_gsi(void);
 
 int ioapic_guest_read( unsigned long physbase, unsigned int reg, u32 *pval);
 int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val);
+int mp_find_ioapic(unsigned int gsi);
+int gsi_2_irq(unsigned int gsi);
 
 #endif
diff --git a/xen/arch/x86/io_apic.c b/xen/arch/x86/io_apic.c
index 772700584639..5859484875cc 100644
--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -955,6 +955,27 @@ static int pin_2_irq(int idx, int apic, int pin)
     return irq;
 }
 
+int gsi_2_irq(unsigned int gsi)
+{
+    int ioapic, irq;
+    unsigned int pin;
+
+    if ( gsi > highest_gsi() )
+        return -ERANGE;
+
+    ioapic = mp_find_ioapic(gsi);
+    if ( ioapic < 0 )
+        return -EINVAL;
+
+    pin = gsi - io_apic_gsi_base(ioapic);
+
+    irq = apic_pin_2_gsi_irq(ioapic, pin);
+    if ( irq <= 0 )
+        return -EINVAL;
+
+    return irq;
+}
+
 static inline int IO_APIC_irq_trigger(int irq)
 {
     int apic, idx, pin;
diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c
index 306d8ed97a83..e13b83bbe9dd 100644
--- a/xen/arch/x86/mpparse.c
+++ b/xen/arch/x86/mpparse.c
@@ -842,8 +842,7 @@ static struct mp_ioapic_routing {
 } mp_ioapic_routing[MAX_IO_APICS];
 
 
-static int mp_find_ioapic (
-	int			gsi)
+int mp_find_ioapic(unsigned int gsi)
 {
 	unsigned int		i;
 
@@ -854,7 +853,7 @@ static int mp_find_ioapic (
 			return i;
 	}
 
-	printk(KERN_ERR "ERROR: Unable to locate IOAPIC for GSI %d\n", gsi);
+	printk(KERN_ERR "ERROR: Unable to locate IOAPIC for GSI %u\n", gsi);
 
 	return -1;
 }
@@ -915,7 +914,7 @@ void __init mp_register_ioapic (
 	return;
 }
 
-unsigned __init highest_gsi(void)
+unsigned highest_gsi(void)
 {
 	unsigned x, res = 0;
 	for (x = 0; x < nr_ioapics; x++)
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 2a49fe46ce25..e1028fc524cf 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -464,6 +464,14 @@ struct xen_domctl_irq_permission {
     uint8_t pad[3];
 };
 
+/* XEN_DOMCTL_gsi_permission */
+struct xen_domctl_gsi_permission {
+    uint32_t gsi;
+#define XEN_DOMCTL_GSI_REVOKE      0
+#define XEN_DOMCTL_GSI_GRANT       1
+#define XEN_DOMCTL_GSI_ACTION_MASK 1
+    uint32_t flags;
+};
 
 /* XEN_DOMCTL_iomem_permission */
 struct xen_domctl_iomem_permission {
@@ -1306,6 +1314,7 @@ struct xen_domctl {
 #define XEN_DOMCTL_get_paging_mempool_size       85
 #define XEN_DOMCTL_set_paging_mempool_size       86
 #define XEN_DOMCTL_dt_overlay                    87
+#define XEN_DOMCTL_gsi_permission                88
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -1328,6 +1337,7 @@ struct xen_domctl {
         struct xen_domctl_setdomainhandle   setdomainhandle;
         struct xen_domctl_setdebugging      setdebugging;
         struct xen_domctl_irq_permission    irq_permission;
+        struct xen_domctl_gsi_permission    gsi_permission;
         struct xen_domctl_iomem_permission  iomem_permission;
         struct xen_domctl_ioport_permission ioport_permission;
         struct xen_domctl_hypercall_init    hypercall_init;
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index 278ad38c2af3..dfa23738cd8a 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -695,6 +695,7 @@ static int cf_check flask_domctl(struct domain *d, unsigned int cmd,
     case XEN_DOMCTL_shadow_op:
     case XEN_DOMCTL_ioport_permission:
     case XEN_DOMCTL_ioport_mapping:
+    case XEN_DOMCTL_gsi_permission:
 #endif
 #ifdef CONFIG_HAS_PASSTHROUGH
     /*
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 11:09:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 11:09:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778495.1188572 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seupM-0003Eb-56; Fri, 16 Aug 2024 11:09:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778495.1188572; Fri, 16 Aug 2024 11:09:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seupM-0003Dn-1J; Fri, 16 Aug 2024 11:09:04 +0000
Received: by outflank-mailman (input) for mailman id 778495;
 Fri, 16 Aug 2024 11:09:02 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=uc/1=PP=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1seupK-0001Oc-FU
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 11:09:02 +0000
Received: from NAM04-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam04on20629.outbound.protection.outlook.com
 [2a01:111:f403:2408::629])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f05456ec-5bbf-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 13:09:00 +0200 (CEST)
Received: from BN9P221CA0014.NAMP221.PROD.OUTLOOK.COM (2603:10b6:408:10a::19)
 by LV2PR12MB5822.namprd12.prod.outlook.com (2603:10b6:408:179::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19; Fri, 16 Aug
 2024 11:08:55 +0000
Received: from BN3PEPF0000B069.namprd21.prod.outlook.com
 (2603:10b6:408:10a:cafe::e0) by BN9P221CA0014.outlook.office365.com
 (2603:10b6:408:10a::19) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.23 via Frontend
 Transport; Fri, 16 Aug 2024 11:08:55 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BN3PEPF0000B069.mail.protection.outlook.com (10.167.243.68) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.4 via Frontend Transport; Fri, 16 Aug 2024 11:08:54 +0000
Received: from cjq-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 16 Aug
 2024 06:08:51 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f05456ec-5bbf-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=rf6NK+uDqciD4+FVL0kooHFRBOgOFCPHsTQ0w4glt1Rod0fPPtw30fh5wCGFRUDCnSBr01jTAsSXZMPCoPzZYBHW5Jt1Q4sgUrL7UfnQ9v5DQKv776Tl6HKB3+ZO3tSbF837IuJhO755GE2A7RCqn9iwWAEbaPxW7YnuCB9sWFC+teYXy3RPT1tau6hKnV+69fK0vVEBvxvqsWIWKTKKMOAWCUNClkKT6mPDpPvZoLAAeau2dqc20NPvnCkd/UTMjKjVAYIOQCxzzgtqdhEpcWQQZ3VGmoAg+4cc8wi2KWpl3aBMBx2kVtjklDWyBxe19kmUK+weDq36ncI8ai74ug==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=2q0e1DukKo3wUcVPM7NjkIVTk+D+YR5G+Cd5OTV+f3Y=;
 b=DvrtlV4Gu+u2T/hbw9Og+iDtlSf4wby+YX6uu3zFTnsocCBCKpdzLsrUAzPHPacgzvseBVgOxOkAgiilvw6jfQ/lxrfUtucU5AkhgMdJAhBI3PQq1cqnNdqp+x1kx2wTNC+2jvPismISXLnptJaBhYbmPGQ26JOIvQyIH5gVB7UcDEf6HXVKft7qLwYiB4pMkz+d/p8jYEmKI7Sa/63R/LMCTHquL7kvwZ6oFZysMXXsWefxcADxvbPcNWT+viVVkG5WqvqRGSjWNZUQMUHYEiQs9TPJdG37E625KD1gr9HlByfjh9TVewMZjm8Nam5TznAfsdhj/rmw+wfUrKOAcw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=2q0e1DukKo3wUcVPM7NjkIVTk+D+YR5G+Cd5OTV+f3Y=;
 b=VYxp4SReaBBWfUBmr2CqDnHDpvAGRrRbbuP+i4lvXoHBh65BRzp+HBzJXRP1sQRnh/TWl6lWQQPRJF7p9JTS4fwsjrW/Ad4Y9vufRZbRshxwyek849XPTOsrKrJKnUaECuuBQ4viFhvOVh0qLLbxEn2EFMiYw+ecqRCmwnQ7tUo=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jiqian Chen <Jiqian.Chen@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>, George Dunlap
	<gwd@xenproject.org>, Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, "Juergen
 Gross" <jgross@suse.com>, "Daniel P . Smith" <dpsmith@apertussolutions.com>,
	Stewart Hildebrand <Stewart.Hildebrand@amd.com>, Jiqian Chen
	<Jiqian.Chen@amd.com>, Huang Rui <ray.huang@amd.com>
Subject: [RFC XEN PATCH v13 5/6] tools: Add new function to get gsi from dev
Date: Fri, 16 Aug 2024 19:08:19 +0800
Message-ID: <20240816110820.75672-6-Jiqian.Chen@amd.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240816110820.75672-1-Jiqian.Chen@amd.com>
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com
 (10.181.40.145)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B069:EE_|LV2PR12MB5822:EE_
X-MS-Office365-Filtering-Correlation-Id: 71663f5a-01f0-4762-bd44-08dcbde3d18b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|7416014|36860700013|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?/+9tS5bJ6J0aMXjrRgww9AFJDeV8hexjKotOPXiKNnzRwMlHuZWtRE7g3ADF?=
 =?us-ascii?Q?cfvA4mmmOw/oAt7Q2CAQ99Vrv7O+r/DXrINHxQyjT9Yuoq0jO4PdVorsrnWD?=
 =?us-ascii?Q?7e6yVBp35xQEh9TOKxF0Ci0JmWwHDCtQF7XwN4mt01IMt+X649IL1eHiTDtx?=
 =?us-ascii?Q?eFa2NWNh8jzWBCEpgq9gf6GQDGVXfXhrfV8jFgNOua9voTSZ147g/qzmbjHy?=
 =?us-ascii?Q?MtekZOy2V52ohhUY3ElJzke0tmfWD/ndFcgItBpG0iWCfoikajY+v92x4TTU?=
 =?us-ascii?Q?aksFSsr/sZGZ02gvc1YeN2MW9lUP1DMXqfaCblXQWBaU+Y9eD5gQAO4zZf68?=
 =?us-ascii?Q?5X/H8KlwjaPv8ZBxvJIHjb605yaADtSC3uYsnO5DcNC+NvdnACUXERZH8OFW?=
 =?us-ascii?Q?jUFLV52VO8Ca9C7vq1lnRIpqv1emDAJbJehjCHXyDRwvv7hiPqgK5N+JXUvL?=
 =?us-ascii?Q?t9S42p1dcoUVYTxu4ctI23mYdR7N8ID2MgaRzQ0by6QF2IzHGjzjuso28Uat?=
 =?us-ascii?Q?ksDIvjjIEObsCELweF2zzLKwjLg88Ve+WWNVlJSDJbGPRAK3r3eljAuyqerE?=
 =?us-ascii?Q?zyFvPMNcH6HNnrritg8N/gpltzCmhnm+aK2GZmY5GNq7RcMb/Ulgv4pNMfrJ?=
 =?us-ascii?Q?YoLX9isUcSGYFY1E5lxEMotpBm/gy989UNd3PIJX8jtRz3I401gEcOwVtAjK?=
 =?us-ascii?Q?slhUmeYuPxKS4wEoU3ulo8/MuKYktx6WS8wjmYxRBZK7TSfenC2Ymu8IzBF+?=
 =?us-ascii?Q?Ct2aildqiN0SCJg4kpQNb1wQVVJkdCsBAnWds3sri+daN3DGoiLuNHEnLE2+?=
 =?us-ascii?Q?n4iaoG7SzEMsxeXTdrY4hJMNpIQnr5Cu26+n4BpDX0IsE/4tiL1FKgjj/e6p?=
 =?us-ascii?Q?926DG/Nyf8eSn71DY78BEmFnH8P6DLOu447QLY/2qO455gZsevDvjO011pCv?=
 =?us-ascii?Q?340AgNG3kiz+sJm0IjzXfEhhMjqYwJi/v6hbQ4qBxUuySx3U7aUdJrp1hiKE?=
 =?us-ascii?Q?h0vymmv/liyxEU7ZKywSnnI/mK90XVGJvwoR+At2BhTO4BullNlk4sQZ147X?=
 =?us-ascii?Q?Gqzdvm/KidH7HzxUZPHNqmxUfFHdv7EUavwe8pW0d0J29ZYcJDykpV2C0R0X?=
 =?us-ascii?Q?IR7BHkg6HNg7x3apHmrX3Qxk5O6Q0166kgZQxZBWoGXjkVDXtlkHa3yltM7b?=
 =?us-ascii?Q?xXhgOfiLmlRRG7aZeOYb0EhaZ28qw+CyLYxj6sXbHcZbxFJhuf9oC0y7Bssi?=
 =?us-ascii?Q?vwi6Nu6t9phroJLR/MkMXzqo8CrNrxZZGC8KcPLZNyaJFK+DFuNMdtnqbS9V?=
 =?us-ascii?Q?9L5mOMKnkkY1HRYr9wbGqMoAZHXzx1T2xiePwaOF8wugl5AMAZZSKWvNL9lI?=
 =?us-ascii?Q?OExF4s4=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(7416014)(36860700013)(1800799024)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2024 11:08:54.9964
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 71663f5a-01f0-4762-bd44-08dcbde3d18b
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B069.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5822

When passthrough a device to domU, QEMU and xl tools use its gsi
number to do pirq mapping, see QEMU code
xen_pt_realize->xc_physdev_map_pirq, and xl code
pci_add_dm_done->xc_physdev_map_pirq, but the gsi number is got
from file /sys/bus/pci/devices/<sbdf>/irq, that is wrong, because
irq is not equal with gsi, they are in different spaces, so pirq
mapping fails.

And in current codes, there is no method to get gsi for userspace.
For above purpose, add new function to get gsi, and the
corresponding ioctl is implemented on linux kernel side.

Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Chen Jiqian <Jiqian.Chen@amd.com>
---
RFC: it needs to wait for the corresponding third patch on linux kernel side to be merged.
https://lore.kernel.org/xen-devel/20240607075109.126277-4-Jiqian.Chen@amd.com/
---
v12->v13 changes:
Rename the function xc_physdev_gsi_from_pcidev to xc_pcidev_get_gsi to avoid confusion with physdev namesapce.
Move the implementation of xc_pcidev_get_gsi into xc_linux.c.
Directly use xencall_fd(xch->xcall) in the function xc_pcidev_get_gsi instead of opening "privcmd".

v11->v12 changes:
Nothing.

v10->v11 changes:
Patch#4 of v10, directly open "/dev/xen/privcmd" in the function xc_physdev_gsi_from_dev instead of adding unnecessary functions to libxencall.
Change the type of gsi in the structure privcmd_gsi_from_dev from int to u32.

v9->v10 changes:
Extract the implementation of xc_physdev_gsi_from_dev to be a new patch.
---
 tools/include/xen-sys/Linux/privcmd.h |  7 +++++++
 tools/include/xenctrl.h               |  2 ++
 tools/libs/ctrl/xc_freebsd.c          |  6 ++++++
 tools/libs/ctrl/xc_linux.c            | 20 ++++++++++++++++++++
 tools/libs/ctrl/xc_minios.c           |  6 ++++++
 tools/libs/ctrl/xc_netbsd.c           |  6 ++++++
 tools/libs/ctrl/xc_solaris.c          |  6 ++++++
 7 files changed, 53 insertions(+)

diff --git a/tools/include/xen-sys/Linux/privcmd.h b/tools/include/xen-sys/Linux/privcmd.h
index bc60e8fd55eb..607dfa2287bc 100644
--- a/tools/include/xen-sys/Linux/privcmd.h
+++ b/tools/include/xen-sys/Linux/privcmd.h
@@ -95,6 +95,11 @@ typedef struct privcmd_mmap_resource {
 	__u64 addr;
 } privcmd_mmap_resource_t;
 
+typedef struct privcmd_pcidev_get_gsi {
+	__u32 sbdf;
+	__u32 gsi;
+} privcmd_pcidev_get_gsi_t;
+
 /*
  * @cmd: IOCTL_PRIVCMD_HYPERCALL
  * @arg: &privcmd_hypercall_t
@@ -114,6 +119,8 @@ typedef struct privcmd_mmap_resource {
 	_IOC(_IOC_NONE, 'P', 6, sizeof(domid_t))
 #define IOCTL_PRIVCMD_MMAP_RESOURCE				\
 	_IOC(_IOC_NONE, 'P', 7, sizeof(privcmd_mmap_resource_t))
+#define IOCTL_PRIVCMD_PCIDEV_GET_GSI			\
+	_IOC(_IOC_NONE, 'P', 10, sizeof(privcmd_pcidev_get_gsi_t))
 #define IOCTL_PRIVCMD_UNIMPLEMENTED				\
 	_IOC(_IOC_NONE, 'P', 0xFF, 0)
 
diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index 9ceca0cffc2f..82de6748f7a7 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1641,6 +1641,8 @@ int xc_physdev_unmap_pirq(xc_interface *xch,
                           uint32_t domid,
                           int pirq);
 
+int xc_pcidev_get_gsi(xc_interface *xch, uint32_t sbdf);
+
 /*
  *  LOGGING AND ERROR REPORTING
  */
diff --git a/tools/libs/ctrl/xc_freebsd.c b/tools/libs/ctrl/xc_freebsd.c
index 9dd48a3a08bb..9019fc663361 100644
--- a/tools/libs/ctrl/xc_freebsd.c
+++ b/tools/libs/ctrl/xc_freebsd.c
@@ -60,6 +60,12 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
     return ptr;
 }
 
+int xc_pcidev_get_gsi(xc_interface *xch, uint32_t sbdf)
+{
+    errno = ENOSYS;
+    return -1;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/ctrl/xc_linux.c b/tools/libs/ctrl/xc_linux.c
index c67c71c08be3..92591e49a1c8 100644
--- a/tools/libs/ctrl/xc_linux.c
+++ b/tools/libs/ctrl/xc_linux.c
@@ -66,6 +66,26 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
     return ptr;
 }
 
+int xc_pcidev_get_gsi(xc_interface *xch, uint32_t sbdf)
+{
+    int ret;
+    privcmd_pcidev_get_gsi_t dev_gsi = {
+        .sbdf = sbdf,
+        .gsi = 0,
+    };
+
+    ret = ioctl(xencall_fd(xch->xcall),
+                IOCTL_PRIVCMD_PCIDEV_GET_GSI, &dev_gsi);
+
+    if (ret < 0) {
+        PERROR("Failed to get gsi from dev");
+    } else {
+        ret = dev_gsi.gsi;
+    }
+
+    return ret;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/ctrl/xc_minios.c b/tools/libs/ctrl/xc_minios.c
index 3dea7a78a576..462af827b33c 100644
--- a/tools/libs/ctrl/xc_minios.c
+++ b/tools/libs/ctrl/xc_minios.c
@@ -47,6 +47,12 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
     return memalign(alignment, size);
 }
 
+int xc_pcidev_get_gsi(xc_interface *xch, uint32_t sbdf)
+{
+    errno = ENOSYS;
+    return -1;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/ctrl/xc_netbsd.c b/tools/libs/ctrl/xc_netbsd.c
index 31979937621e..1318d4d90608 100644
--- a/tools/libs/ctrl/xc_netbsd.c
+++ b/tools/libs/ctrl/xc_netbsd.c
@@ -63,6 +63,12 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
     return valloc(size);
 }
 
+int xc_pcidev_get_gsi(xc_interface *xch, uint32_t sbdf)
+{
+    errno = ENOSYS;
+    return -1;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/ctrl/xc_solaris.c b/tools/libs/ctrl/xc_solaris.c
index 5128f3f0f490..049e28d55ccd 100644
--- a/tools/libs/ctrl/xc_solaris.c
+++ b/tools/libs/ctrl/xc_solaris.c
@@ -32,6 +32,12 @@ void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
     return memalign(alignment, size);
 }
 
+int xc_pcidev_get_gsi(xc_interface *xch, uint32_t sbdf)
+{
+    errno = ENOSYS;
+    return -1;
+}
+
 /*
  * Local variables:
  * mode: C
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 11:09:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 11:09:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778509.1188582 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seupS-0003zM-Mg; Fri, 16 Aug 2024 11:09:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778509.1188582; Fri, 16 Aug 2024 11:09:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seupS-0003zD-I5; Fri, 16 Aug 2024 11:09:10 +0000
Received: by outflank-mailman (input) for mailman id 778509;
 Fri, 16 Aug 2024 11:09:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=uc/1=PP=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1seupR-0001dU-FU
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 11:09:09 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on2060a.outbound.protection.outlook.com
 [2a01:111:f403:2417::60a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f3e4befa-5bbf-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 13:09:07 +0200 (CEST)
Received: from BL0PR02CA0053.namprd02.prod.outlook.com (2603:10b6:207:3d::30)
 by CH3PR12MB8233.namprd12.prod.outlook.com (2603:10b6:610:129::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19; Fri, 16 Aug
 2024 11:08:59 +0000
Received: from BN3PEPF0000B06A.namprd21.prod.outlook.com
 (2603:10b6:207:3d:cafe::94) by BL0PR02CA0053.outlook.office365.com
 (2603:10b6:207:3d::30) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22 via Frontend
 Transport; Fri, 16 Aug 2024 11:08:59 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BN3PEPF0000B06A.mail.protection.outlook.com (10.167.243.69) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.4 via Frontend Transport; Fri, 16 Aug 2024 11:08:59 +0000
Received: from cjq-desktop.amd.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 16 Aug
 2024 06:08:55 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f3e4befa-5bbf-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=eH6BuZ+ExgZK/hER10eJY0XhegRz4fyygNk/Daj0ZfnGJPkzxyHKA0lFfaVDW7sfBj5ObM+RjIfRPIVI8ip4COTN2Dy2WD5tU57BsIhci9rGxL6mT3++hzhFpT8yx/cSZIdxTyErFwrl3/Se2+0rTQetmCc4bXu+VzZER3NqbuRI3JZ3t7MKGPkdWzspWzSf67x7Basy11ipBlXIaWCCSlZoZ7uximcj2W9+E/EpVYIV4dCii+eUf5Tvmdw78vUT+VN0gGtuXArnhFD6LtERzQHCTt/LU0hVj8ia+4f15U4JCMGCaE9sWIoZrpWbRp3rDaK1qN+l8mo+uboaNI4kjg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Bu5Qz9WFGKymDn26KEbzd9h2r23enFrhojTi0ypkn/U=;
 b=VdBbbRreQBIcvqImzQKLNiUBY2DH4jCVzRFTre8hX6SyIDqUCqXtv8JyNzFlHy2x/Tl5ZdhLBQ2iBpNU9dYfWv973kwsBoOiZM7bijJYIs92EuTqUS7wVspTC5lldhj4wxvXDdIRtX+3xBqEl3EI1JpagnTMszidzJWIWyAZO5kppdktTgtUPE0xqSlzBergfYTC41WVYmhCq0JrYNhiMPMqGfhaEqilj4pMCdpuOgfBWJ5MnViq58wdoDNH2v6qZu0OcTEQ6gfqVbsyRpIYWPXxq6SZITmDBQjJc6xclxRejA3NoxhBe2WvRG4EoQcG+AmSnFm4AjBKAlrGfRHFZw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Bu5Qz9WFGKymDn26KEbzd9h2r23enFrhojTi0ypkn/U=;
 b=aOookuMGajrnUHkXV4V1bAsL5V3q/BLR4J3WwUcePNpX7e/yVr04NJ+KrPp84ZJW/NMcuhNI5LnHEgJ9mDYoLcjdtPJLZJywp4jzV4ILMIUDW83FVCeO/P4TPDpGsSWSlwz5LlzsiAKUIm0T06WZMU4ScpcWxP6flUWWm+Wr4IE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jiqian Chen <Jiqian.Chen@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>, George Dunlap
	<gwd@xenproject.org>, Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, "Juergen
 Gross" <jgross@suse.com>, "Daniel P . Smith" <dpsmith@apertussolutions.com>,
	Stewart Hildebrand <Stewart.Hildebrand@amd.com>, Jiqian Chen
	<Jiqian.Chen@amd.com>, Huang Rui <ray.huang@amd.com>
Subject: [RFC XEN PATCH v13 6/6] tools: Add new function to do PIRQ (un)map on PVH dom0
Date: Fri, 16 Aug 2024 19:08:20 +0800
Message-ID: <20240816110820.75672-7-Jiqian.Chen@amd.com>
X-Mailer: git-send-email 2.34.1
In-Reply-To: <20240816110820.75672-1-Jiqian.Chen@amd.com>
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.180.168.240]
X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com
 (10.181.40.145)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06A:EE_|CH3PR12MB8233:EE_
X-MS-Office365-Filtering-Correlation-Id: e4a13c71-18f9-43dc-f35c-08dcbde3d41a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014|7416014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?M3RMgYltroc2QiHlmkQv2U29IYla6ChUOs3AcZXiSivwXo8Tv0RF7C/qWT3V?=
 =?us-ascii?Q?taCiN9i1nH9CPCVt2VCPOaKH9ZH3TJ2cEKb3RjUz8aALGZGlMy4CiMomOq4N?=
 =?us-ascii?Q?aMX6J3/caPNtvk7HiuOXhVq0bjq9QaYZNQMv73pU3T5c6CV/XlrTW8vb7f/+?=
 =?us-ascii?Q?HQClRurjvFmPFTg2EZKEPrkPBV2qBOgaH5vFrZWd7UUHRiCS5VIra5KtY0n/?=
 =?us-ascii?Q?ECSDMEOfqGDdGTzltzRXJcUP3wx3jP33iuclj8u/+P6KNVnNPG4Dd0GdXk18?=
 =?us-ascii?Q?SKPoFeiiHAdnGv9JfrNsoAh07F0kWq86V0OJzqNa0THR7czYZPrpDnNLjk00?=
 =?us-ascii?Q?I49AKLqh8uElcmzFVwwyZZLxdi6GKl99INDT1ceUlcOYzMzo05Dbw++KhoYx?=
 =?us-ascii?Q?l1nImMfmSMRux8psucQYDkQTqP6PXtvUO+CCpQHEWk5N2czNn6pMqfR91upa?=
 =?us-ascii?Q?pzBWpLPHSGGNAfzeS1spw4KWzSz0gEAmqbj9p451C41fOiqz1k+0dAFp5lgI?=
 =?us-ascii?Q?Kf91vyRIsgiG5ndGx+CNZPXAszWoiOswlDGkObCMJzD+GYBzrsw6RvbFQLCB?=
 =?us-ascii?Q?H0XEVk/Y4Pk3tsYGaaKnlFb53fuYvuXfvhaS21s6hUsf7uXp0yiAhlq7Rfpi?=
 =?us-ascii?Q?FGh4WSfG4UFQl58Fcas72ZT5cNeRhFQLhsnujQ0MW4Fbs8XkiTC2qx8MBJ6+?=
 =?us-ascii?Q?dxEcXthzsYzmAJGc2XcxFXt9ZdFdhizXdtOr8hrgYx6+KoFpig1n1zPl75PB?=
 =?us-ascii?Q?L3gkds1/+TeLRZ2wZypPAGtkZDqwn4WpnoRU82gHaFIzWXUDUxP9qL4LnM5U?=
 =?us-ascii?Q?5dUZisN/cLE83WVZh3QUC2ZKbOfWzMJr5hQKIjgDWe13QFEBpQ0AywnCpnRk?=
 =?us-ascii?Q?7AriQ1BHDrSdlE2Kt9OaiX1Im/PU1KkCnYGGcZ180Ul/OvHPtYP8HAhRG41X?=
 =?us-ascii?Q?Pa0KRvPmj7r/3jEA2SyhIqnuzmGkByMjM1hmTFVTvmAC+2QY0H7yuKOPKJCi?=
 =?us-ascii?Q?gPX7DkiINSGoXN4LJNx0x8H/bY8y9dIs3XRoxeqYKPgXLfRvOZPOg028SmLD?=
 =?us-ascii?Q?19MPa+VrmrJOf+YSCCBzXgyhWxexfok16Jow8S3n30HO58ziuoHVhqCDBgHo?=
 =?us-ascii?Q?Up2NS21gkJJCb+/xu+EnDeK4PLuA3Y6I1dTHkU/qDZ7VTw3MHjtLq45kkg3o?=
 =?us-ascii?Q?3cEG9WurOqWJyTptkO+nRVd0MoQmI+BfPBTRVVd9Hxj7agJ4RoLQHRzDP5Nk?=
 =?us-ascii?Q?3afz8fQCBdQRpD1GNzLf6r30x3ijxqOiHvm4ubHQp5NgIoBg0eP99M19N+X+?=
 =?us-ascii?Q?wJCJ9FN1Go82snhhnWXOTDu3CX1YyKTAkkiMfGimH+5P8w=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014)(7416014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2024 11:08:59.2904
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: e4a13c71-18f9-43dc-f35c-08dcbde3d41a
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B06A.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8233

When dom0 is PVH, and passthrough a device to dumU, xl will
use the gsi number of device to do a pirq mapping, see
pci_add_dm_done->xc_physdev_map_pirq, but the gsi number is
got from file /sys/bus/pci/devices/<sbdf>/irq, that confuses
irq and gsi, they are in different space and are not equal,
so it will fail when mapping.
To solve this issue, use xc_physdev_gsi_from_dev to get the
real gsi and add a new function xc_physdev_map_pirq_gsi to get
a free pirq for gsi(why not use current function
xc_physdev_map_pirq, because it doesn't support to allocate a
free pirq, what's more, to prevent changing it and affecting
its callers, so add xc_physdev_map_pirq_gsi).

Besides, PVH dom0 doesn't have PIRQ flag, it doesn't do
PHYSDEVOP_map_pirq for each gsi. So grant function callstack
pci_add_dm_done->XEN_DOMCTL_irq_permission will fail at function
domain_pirq_to_irq. And old hypercall XEN_DOMCTL_irq_permission
requires passing in pirq, it is not suitable for dom0 that
doesn't have PIRQs to grant irq permission.
To solve this issue, use the new hypercall
XEN_DOMCTL_gsi_permission to grant the permission of irq(
translate from gsi) to dumU when dom0 has no PIRQs.

Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Chen Jiqian <Jiqian.Chen@amd.com>
---
RFC: it needs to wait for the corresponding third patch on linux kernel side to be merged.
https://lore.kernel.org/xen-devel/20240607075109.126277-4-Jiqian.Chen@amd.com/
---
v12->v13 changes:
Deleted patch #6 of v12, and added function xc_physdev_map_pirq_gsi to map pirq for gsi.
For functions that generate libxl error, changed the return value from -1 to ERROR_*.
Instead of declaring "ctx", use the macro "CTX".
Add the function libxl__arch_local_romain_ has_pirq_notion to determine if there is a concept of pirq in the domain where xl is located.
In the function libxl__arch_hvm_unmap_gsi, before unmap_pirq, use map_pirq to obtain the pirq corresponding to gsi.

v11->v12 changes:
Nothing.

v10->v11 changes:
New patch
Modification of the tools part of patches#4 and #5 of v10, use privcmd_gsi_from_dev to get gsi, and use XEN_DOMCTL_gsi_permission to grant gsi.
Change the hard-coded 0 to use LIBXL_TOOLSTACK_DOMID.
Add libxl__arch_hvm_map_gsi to distinguish x86 related implementations.
Add a list pcidev_pirq_list to record the relationship between sbdf and pirq, which can be used to obtain the corresponding pirq when unmap PIRQ.
---
 tools/include/xenctrl.h       |  10 +++
 tools/libs/ctrl/xc_domain.c   |  15 +++++
 tools/libs/ctrl/xc_physdev.c  |  27 ++++++++
 tools/libs/light/libxl_arch.h |   6 ++
 tools/libs/light/libxl_arm.c  |  15 +++++
 tools/libs/light/libxl_pci.c  | 112 ++++++++++++++++++++--------------
 tools/libs/light/libxl_x86.c  |  72 ++++++++++++++++++++++
 7 files changed, 212 insertions(+), 45 deletions(-)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index 82de6748f7a7..c798472995f7 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1382,6 +1382,11 @@ int xc_domain_irq_permission(xc_interface *xch,
                              uint32_t pirq,
                              bool allow_access);
 
+int xc_domain_gsi_permission(xc_interface *xch,
+                             uint32_t domid,
+                             uint32_t gsi,
+                             uint32_t flags);
+
 int xc_domain_iomem_permission(xc_interface *xch,
                                uint32_t domid,
                                unsigned long first_mfn,
@@ -1637,6 +1642,11 @@ int xc_physdev_map_pirq_msi(xc_interface *xch,
                             int entry_nr,
                             uint64_t table_base);
 
+int xc_physdev_map_pirq_gsi(xc_interface *xch,
+                            uint32_t domid,
+                            int gsi,
+                            int *pirq);
+
 int xc_physdev_unmap_pirq(xc_interface *xch,
                           uint32_t domid,
                           int pirq);
diff --git a/tools/libs/ctrl/xc_domain.c b/tools/libs/ctrl/xc_domain.c
index f2d9d14b4d9f..e3538ec0ba80 100644
--- a/tools/libs/ctrl/xc_domain.c
+++ b/tools/libs/ctrl/xc_domain.c
@@ -1394,6 +1394,21 @@ int xc_domain_irq_permission(xc_interface *xch,
     return do_domctl(xch, &domctl);
 }
 
+int xc_domain_gsi_permission(xc_interface *xch,
+                             uint32_t domid,
+                             uint32_t gsi,
+                             uint32_t flags)
+{
+    struct xen_domctl domctl = {
+        .cmd = XEN_DOMCTL_gsi_permission,
+        .domain = domid,
+        .u.gsi_permission.gsi = gsi,
+        .u.gsi_permission.flags = flags,
+    };
+
+    return do_domctl(xch, &domctl);
+}
+
 int xc_domain_iomem_permission(xc_interface *xch,
                                uint32_t domid,
                                unsigned long first_mfn,
diff --git a/tools/libs/ctrl/xc_physdev.c b/tools/libs/ctrl/xc_physdev.c
index 460a8e779ce8..c752cd1f4410 100644
--- a/tools/libs/ctrl/xc_physdev.c
+++ b/tools/libs/ctrl/xc_physdev.c
@@ -95,6 +95,33 @@ int xc_physdev_map_pirq_msi(xc_interface *xch,
     return rc;
 }
 
+int xc_physdev_map_pirq_gsi(xc_interface *xch,
+                            uint32_t domid,
+                            int gsi,
+                            int *pirq)
+{
+    int rc;
+    struct physdev_map_pirq map;
+
+    if ( !pirq )
+    {
+        errno = EINVAL;
+        return -1;
+    }
+    memset(&map, 0, sizeof(struct physdev_map_pirq));
+    map.domid = domid;
+    map.type = MAP_PIRQ_TYPE_GSI;
+    map.index = gsi;
+    map.pirq = *pirq;
+
+    rc = do_physdev_op(xch, PHYSDEVOP_map_pirq, &map, sizeof(map));
+
+    if ( !rc )
+        *pirq = map.pirq;
+
+    return rc;
+}
+
 int xc_physdev_unmap_pirq(xc_interface *xch,
                           uint32_t domid,
                           int pirq)
diff --git a/tools/libs/light/libxl_arch.h b/tools/libs/light/libxl_arch.h
index f88f11d6de1d..c8ef52ddbe7f 100644
--- a/tools/libs/light/libxl_arch.h
+++ b/tools/libs/light/libxl_arch.h
@@ -91,6 +91,12 @@ void libxl__arch_update_domain_config(libxl__gc *gc,
                                       libxl_domain_config *dst,
                                       const libxl_domain_config *src);
 
+_hidden
+int libxl__arch_hvm_map_gsi(libxl__gc *gc, uint32_t sbdf, uint32_t domid);
+_hidden
+int libxl__arch_hvm_unmap_gsi(libxl__gc *gc, uint32_t sbdf, uint32_t domid);
+_hidden
+bool libxl__arch_local_domain_has_pirq_notion(libxl__gc *gc);
 #if defined(__i386__) || defined(__x86_64__)
 
 #define LAPIC_BASE_ADDRESS  0xfee00000
diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index a4029e3ac810..5a9db5e85f6f 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -1774,6 +1774,21 @@ void libxl__arch_update_domain_config(libxl__gc *gc,
 {
 }
 
+int libxl__arch_hvm_map_gsi(libxl__gc *gc, uint32_t sbdf, uint32_t domid)
+{
+    return ERROR_INVAL;
+}
+
+int libxl__arch_hvm_unmap_gsi(libxl__gc *gc, uint32_t sbdf, uint32_t domid)
+{
+    return ERROR_INVAL;
+}
+
+bool libxl__arch_local_domain_has_pirq_notion(libxl__gc *gc)
+{
+    return true;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libs/light/libxl_pci.c b/tools/libs/light/libxl_pci.c
index 96cb4da0794e..2014a67e6e56 100644
--- a/tools/libs/light/libxl_pci.c
+++ b/tools/libs/light/libxl_pci.c
@@ -17,6 +17,7 @@
 #include "libxl_osdeps.h" /* must come before any other headers */
 
 #include "libxl_internal.h"
+#include "libxl_arch.h"
 
 #define PCI_BDF                "%04x:%02x:%02x.%01x"
 #define PCI_BDF_SHORT          "%02x:%02x.%01x"
@@ -1478,32 +1479,43 @@ static void pci_add_dm_done(libxl__egc *egc,
     fclose(f);
     if (!pci_supp_legacy_irq())
         goto out_no_irq;
-    sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/irq", pci->domain,
-                                pci->bus, pci->dev, pci->func);
-    f = fopen(sysfs_path, "r");
-    if (f == NULL) {
-        LOGED(ERROR, domainid, "Couldn't open %s", sysfs_path);
-        goto out_no_irq;
-    }
-    if ((fscanf(f, "%u", &irq) == 1) && irq) {
-        r = xc_physdev_map_pirq(ctx->xch, domid, irq, &irq);
-        if (r < 0) {
-            LOGED(ERROR, domainid, "xc_physdev_map_pirq irq=%d (error=%d)",
-                  irq, r);
-            fclose(f);
-            rc = ERROR_FAIL;
+
+    /* When dom0 is PVH, should use gsi to map pirq and grant permission */
+    rc = libxl__arch_local_domain_has_pirq_notion(gc);
+    if (!rc) {
+        rc = libxl__arch_hvm_map_gsi(gc, pci_encode_bdf(pci), domid);
+        if (rc) {
+            LOGED(ERROR, domainid, "libxl__arch_hvm_map_gsi failed");
             goto out;
         }
-        r = xc_domain_irq_permission(ctx->xch, domid, irq, 1);
-        if (r < 0) {
-            LOGED(ERROR, domainid,
-                  "xc_domain_irq_permission irq=%d (error=%d)", irq, r);
-            fclose(f);
-            rc = ERROR_FAIL;
-            goto out;
+    } else {
+        sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/irq", pci->domain,
+                                    pci->bus, pci->dev, pci->func);
+        f = fopen(sysfs_path, "r");
+        if (f == NULL) {
+            LOGED(ERROR, domainid, "Couldn't open %s", sysfs_path);
+            goto out_no_irq;
+        }
+        if ((fscanf(f, "%u", &irq) == 1) && irq) {
+            r = xc_physdev_map_pirq(ctx->xch, domid, irq, &irq);
+            if (r < 0) {
+                LOGED(ERROR, domainid, "xc_physdev_map_pirq irq=%d (error=%d)",
+                    irq, r);
+                fclose(f);
+                rc = ERROR_FAIL;
+                goto out;
+            }
+            r = xc_domain_irq_permission(ctx->xch, domid, irq, 1);
+            if (r < 0) {
+                LOGED(ERROR, domainid,
+                    "xc_domain_irq_permission irq=%d (error=%d)", irq, r);
+                fclose(f);
+                rc = ERROR_FAIL;
+                goto out;
+            }
         }
+        fclose(f);
     }
-    fclose(f);
 
     /* Don't restrict writes to the PCI config space from this VM */
     if (pci->permissive) {
@@ -2229,33 +2241,43 @@ skip_bar:
     if (!pci_supp_legacy_irq())
         goto skip_legacy_irq;
 
-    sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/irq", pci->domain,
-                           pci->bus, pci->dev, pci->func);
-
-    f = fopen(sysfs_path, "r");
-    if (f == NULL) {
-        LOGED(ERROR, domid, "Couldn't open %s", sysfs_path);
-        goto skip_legacy_irq;
-    }
+    /* When dom0 is PVH, should use gsi to unmap pirq and deny permission */
+    rc = libxl__arch_local_domain_has_pirq_notion(gc);
+    if (!rc) {
+        rc = libxl__arch_hvm_unmap_gsi(gc, pci_encode_bdf(pci), domid);
+        if (rc) {
+            LOGED(ERROR, domid, "libxl__arch_hvm_unmap_gsi failed");
+            goto out;
+        }
+    } else {
+        sysfs_path = GCSPRINTF(SYSFS_PCI_DEV"/"PCI_BDF"/irq", pci->domain,
+                            pci->bus, pci->dev, pci->func);
 
-    if ((fscanf(f, "%u", &irq) == 1) && irq) {
-        rc = xc_physdev_unmap_pirq(ctx->xch, domid, irq);
-        if (rc < 0) {
-            /*
-             * QEMU may have already unmapped the IRQ. So the error
-             * may be spurious. For now, still print an error message as
-             * it is not easy to distinguished between valid and
-             * spurious error.
-             */
-            LOGED(ERROR, domid, "xc_physdev_unmap_pirq irq=%d", irq);
+        f = fopen(sysfs_path, "r");
+        if (f == NULL) {
+            LOGED(ERROR, domid, "Couldn't open %s", sysfs_path);
+            goto skip_legacy_irq;
         }
-        rc = xc_domain_irq_permission(ctx->xch, domid, irq, 0);
-        if (rc < 0) {
-            LOGED(ERROR, domid, "xc_domain_irq_permission irq=%d", irq);
+
+        if ((fscanf(f, "%u", &irq) == 1) && irq) {
+            rc = xc_physdev_unmap_pirq(ctx->xch, domid, irq);
+            if (rc < 0) {
+                /*
+                * QEMU may have already unmapped the IRQ. So the error
+                * may be spurious. For now, still print an error message as
+                * it is not easy to distinguished between valid and
+                * spurious error.
+                */
+                LOGED(ERROR, domid, "xc_physdev_unmap_pirq irq=%d", irq);
+            }
+            rc = xc_domain_irq_permission(ctx->xch, domid, irq, 0);
+            if (rc < 0) {
+                LOGED(ERROR, domid, "xc_domain_irq_permission irq=%d", irq);
+            }
         }
-    }
 
-    fclose(f);
+        fclose(f);
+    }
 
 skip_legacy_irq:
 
diff --git a/tools/libs/light/libxl_x86.c b/tools/libs/light/libxl_x86.c
index 60643d6f5376..20e3956f09b8 100644
--- a/tools/libs/light/libxl_x86.c
+++ b/tools/libs/light/libxl_x86.c
@@ -879,6 +879,78 @@ void libxl__arch_update_domain_config(libxl__gc *gc,
                                  libxl_defbool_val(src->b_info.u.hvm.pirq));
 }
 
+bool libxl__arch_local_domain_has_pirq_notion(libxl__gc *gc)
+{
+    int r;
+    xc_domaininfo_t info;
+
+    r = xc_domain_getinfo_single(CTX->xch, LIBXL_TOOLSTACK_DOMID, &info);
+    if (r == 0) {
+        if (!(info.flags & XEN_DOMINF_hvm_guest) ||
+            (info.arch_config.emulation_flags & XEN_X86_EMU_USE_PIRQ))
+            return true;
+    } else {
+        LOGE(ERROR, "getdomaininfo failed ret=%d", r);
+    }
+
+    return false;
+}
+
+int libxl__arch_hvm_map_gsi(libxl__gc *gc, uint32_t sbdf, uint32_t domid)
+{
+    int pirq = -1, gsi, r;
+
+    gsi = xc_pcidev_get_gsi(CTX->xch, sbdf);
+    if (gsi < 0) {
+        return ERROR_FAIL;
+    }
+
+    r = xc_physdev_map_pirq_gsi(CTX->xch, domid, gsi, &pirq);
+    if (r < 0) {
+        LOGED(ERROR, domid, "xc_physdev_map_pirq_gsi gsi=%d ret=%d", gsi, r);
+        return ERROR_FAIL;
+    }
+
+    r = xc_domain_gsi_permission(CTX->xch, domid, gsi, XEN_DOMCTL_GSI_GRANT);
+    if (r < 0) {
+        LOGED(ERROR, domid, "xc_domain_gsi_permission gsi=%d ret=%d", gsi, r);
+        return ERROR_FAIL;
+    }
+
+    return 0;
+}
+
+int libxl__arch_hvm_unmap_gsi(libxl__gc *gc, uint32_t sbdf, uint32_t domid)
+{
+    int pirq = -1, gsi, r;
+
+    gsi = xc_pcidev_get_gsi(CTX->xch, sbdf);
+    if (gsi < 0) {
+        return ERROR_FAIL;
+    }
+
+    /* Before unmapping, use mapping to get the already mapped pirq first */
+    r = xc_physdev_map_pirq_gsi(CTX->xch, domid, gsi, &pirq);
+    if (r < 0) {
+        LOGED(ERROR, domid, "xc_physdev_map_pirq_gsi gsi=%d ret=%d", gsi, r);
+        return ERROR_FAIL;
+    }
+
+    r = xc_physdev_unmap_pirq(CTX->xch, domid, pirq);
+    if (r < 0) {
+        LOGED(ERROR, domid, "xc_physdev_unmap_pirq gsi=%d ret=%d", gsi, r);
+        return ERROR_FAIL;
+    }
+
+    r = xc_domain_gsi_permission(CTX->xch, domid, gsi, XEN_DOMCTL_GSI_REVOKE);
+    if (r < 0) {
+        LOGED(ERROR, domid, "xc_domain_gsi_permission gsi=%d ret=%d", gsi, r);
+        return ERROR_FAIL;
+    }
+
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 11:10:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 11:10:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778530.1188592 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seur4-0006bR-Vw; Fri, 16 Aug 2024 11:10:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778530.1188592; Fri, 16 Aug 2024 11:10:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seur4-0006bK-TP; Fri, 16 Aug 2024 11:10:50 +0000
Received: by outflank-mailman (input) for mailman id 778530;
 Fri, 16 Aug 2024 11:10: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=0eKx=PP=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1seur3-0006aw-KN
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 11:10:49 +0000
Received: from pb-smtp21.pobox.com (pb-smtp21.pobox.com [173.228.157.53])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2f9b20fb-5bc0-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 13:10:47 +0200 (CEST)
Received: from pb-smtp21.pobox.com (unknown [127.0.0.1])
 by pb-smtp21.pobox.com (Postfix) with ESMTP id 10C581AD20;
 Fri, 16 Aug 2024 07:10:45 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1])
 by pb-smtp21.pobox.com (Postfix) with ESMTP id 092211AD1F;
 Fri, 16 Aug 2024 07:10:45 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [185.130.54.120])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 9F7F61AD1E;
 Fri, 16 Aug 2024 07:10:41 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2f9b20fb-5bc0-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:in-reply-to:references:mime-version
	:content-transfer-encoding; s=sasl; bh=jlgPaY/GIjAxFDl/srIa2LTto
	2punK5EfkiByCImD2s=; b=qW7qseu1JtMjy76Gb8GMh6hfOPq6GzFCzEpW1kdSx
	OmnuYkkYYOYtyy0Yox8ubVan40i537yAmDQrcgDup06oRL37yaXVxcdtyED1PacF
	tB/O3HUSmTxlHP5W9zMDGDihZu8wF3hBZOTdWp3MCkWomw4b9b9rJZUtvjU9txbk
	XE=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [XEN PATCH v2 1/5] x86/Kconfig: introduce CENTAUR, HYGON & SHANGHAI config options
Date: Fri, 16 Aug 2024 14:10:37 +0300
Message-Id: <2a217c9602e92f92050cb4894bb9a42ee99a84ea.1723806405.git.Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
References: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
MIME-Version: 1.0
X-Pobox-Relay-ID:
 2CE33EEA-5BC0-11EF-A193-E92ED1CD468F-90055647!pb-smtp21.pobox.com
Content-Transfer-Encoding: quoted-printable

These options aim to represent what's currently supported by Xen, and lat=
er
to allow tuning for specific platform(s) only.

HYGON and SHANGHAI options depend on AMD and INTEL as there're build
dependencies on support code for AMD and Intel CPUs respectively.

Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
CC: Alejandro Vallejo <alejandro.vallejo@cloud.com>
CC: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/Kconfig.cpu  | 29 +++++++++++++++++++++++++++++
 xen/arch/x86/cpu/Makefile |  6 +++---
 xen/arch/x86/cpu/common.c |  6 ++++++
 3 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/Kconfig.cpu b/xen/arch/x86/Kconfig.cpu
index 5fb18db1aa..ac8f41d464 100644
--- a/xen/arch/x86/Kconfig.cpu
+++ b/xen/arch/x86/Kconfig.cpu
@@ -10,6 +10,25 @@ config AMD
 	  May be turned off in builds targetting other vendors.  Otherwise,
 	  must be enabled for Xen to work suitably on AMD platforms.
=20
+config CENTAUR
+	bool "Support Centaur CPUs"
+	default y
+	help
+	  Detection, tunings and quirks for VIA platforms.
+
+	  May be turned off in builds targeting other vendors. Otherwise, must
+          be enabled for Xen to work suitably on VIA platforms.
+
+config HYGON
+	bool "Support Hygon CPUs"
+	depends on AMD
+	default y
+	help
+	  Detection, tunings and quirks for Hygon platforms.
+
+	  May be turned off in builds targeting other vendors. Otherwise, must
+          be enabled for Xen to work suitably on Hygon platforms.
+
 config INTEL
 	bool "Support Intel CPUs"
 	default y
@@ -19,4 +38,14 @@ config INTEL
 	  May be turned off in builds targetting other vendors.  Otherwise,
 	  must be enabled for Xen to work suitably on Intel platforms.
=20
+config SHANGHAI
+	bool "Support Shanghai CPUs"
+	depends on INTEL
+	default y
+	help
+	  Detection, tunings and quirks for Zhaoxin platforms.
+
+	  May be turned off in builds targeting other vendors. Otherwise, must
+          be enabled for Xen to work suitably on Zhaoxin platforms.
+
 endmenu
diff --git a/xen/arch/x86/cpu/Makefile b/xen/arch/x86/cpu/Makefile
index eafce5f204..80739d0256 100644
--- a/xen/arch/x86/cpu/Makefile
+++ b/xen/arch/x86/cpu/Makefile
@@ -3,13 +3,13 @@ obj-y +=3D microcode/
 obj-y +=3D mtrr/
=20
 obj-y +=3D amd.o
-obj-y +=3D centaur.o
+obj-$(CONFIG_CENTAUR) +=3D centaur.o
 obj-y +=3D common.o
-obj-y +=3D hygon.o
+obj-$(CONFIG_HYGON) +=3D hygon.o
 obj-y +=3D intel.o
 obj-y +=3D intel_cacheinfo.o
 obj-y +=3D mwait-idle.o
-obj-y +=3D shanghai.o
+obj-$(CONFIG_SHANGHAI) +=3D shanghai.o
 obj-y +=3D vpmu.o
 obj-$(CONFIG_AMD) +=3D vpmu_amd.o
 obj-$(CONFIG_INTEL) +=3D vpmu_intel.o
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index ff4cd22897..dcc2753212 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -339,9 +339,15 @@ void __init early_cpu_init(bool verbose)
 	case X86_VENDOR_INTEL:    intel_unlock_cpuid_leaves(c);
 				  actual_cpu =3D intel_cpu_dev;    break;
 	case X86_VENDOR_AMD:      actual_cpu =3D amd_cpu_dev;      break;
+#ifdef CONFIG_CENTAUR
 	case X86_VENDOR_CENTAUR:  actual_cpu =3D centaur_cpu_dev;  break;
+#endif
+#ifdef CONFIG_SHANGHAI
 	case X86_VENDOR_SHANGHAI: actual_cpu =3D shanghai_cpu_dev; break;
+#endif
+#ifdef CONFIG_HYGON
 	case X86_VENDOR_HYGON:    actual_cpu =3D hygon_cpu_dev;    break;
+#endif
 	default:
 		actual_cpu =3D default_cpu;
 		if (!verbose)
--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 11:12:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 11:12:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778547.1188602 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seut7-0007FT-AB; Fri, 16 Aug 2024 11:12:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778547.1188602; Fri, 16 Aug 2024 11:12:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seut7-0007FM-74; Fri, 16 Aug 2024 11:12:57 +0000
Received: by outflank-mailman (input) for mailman id 778547;
 Fri, 16 Aug 2024 11:12:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0eKx=PP=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1seut5-0007FE-Ri
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 11:12:55 +0000
Received: from pb-smtp21.pobox.com (pb-smtp21.pobox.com [173.228.157.53])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7b37e106-5bc0-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 13:12:54 +0200 (CEST)
Received: from pb-smtp21.pobox.com (unknown [127.0.0.1])
 by pb-smtp21.pobox.com (Postfix) with ESMTP id B5CB31AE7F;
 Fri, 16 Aug 2024 07:12:52 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1])
 by pb-smtp21.pobox.com (Postfix) with ESMTP id AECE81AE7E;
 Fri, 16 Aug 2024 07:12:52 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [185.130.54.120])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 2D6301AE7D;
 Fri, 16 Aug 2024 07:12:48 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7b37e106-5bc0-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:in-reply-to:references:mime-version
	:content-transfer-encoding; s=sasl; bh=jjmqvyUqyJfIGrS4f+TrQFvun
	Q78NoLP29D4JepiAmo=; b=shUH7MPAYLzOTjQiHky6yVpIBMv11b4GqhQh0zHYl
	44mLjLb75TqVpnPW7FxaXxLgVA1AkvkS49UUik4syQsmi8zea7hdCwTMT3zXvul2
	CddQspko9iXte9cxRCPhsrlt9ijiTLPQdWvNz9Ksxnb+6Vu+JD32crOMoNc0fgs/
	Ng=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [XEN PATCH v2 2/5] x86/amd: configurable handling of AMD-specific MSRs access
Date: Fri, 16 Aug 2024 14:12:44 +0300
Message-Id: <917d2186db56c6f4c820f6b9e26b29fbe93301d6.1723806405.git.Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
References: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
MIME-Version: 1.0
X-Pobox-Relay-ID:
 784DA14A-5BC0-11EF-81D0-E92ED1CD468F-90055647!pb-smtp21.pobox.com
Content-Transfer-Encoding: quoted-printable

Do not compile handlers of guest access to AMD-specific MSRs when CONFIG_=
AMD=3Dn.

Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
CC: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/msr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 289cf10b78..4567de7fc8 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -219,6 +219,7 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_=
t *val)
         *val =3D msrs->tsc_aux;
         break;
=20
+#ifdef CONFIG_AMD
     case MSR_K8_SYSCFG:
     case MSR_K8_TOP_MEM1:
     case MSR_K8_TOP_MEM2:
@@ -281,6 +282,7 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_=
t *val)
                                    ? 0 : (msr - MSR_AMD64_DR1_ADDRESS_MA=
SK + 1),
                                    ARRAY_SIZE(msrs->dr_mask))];
         break;
+#endif /* CONFIG_AMD */
=20
         /*
          * TODO: Implement when we have better topology representation.
@@ -552,6 +554,7 @@ int guest_wrmsr(struct vcpu *v, uint32_t msr, uint64_=
t val)
             wrmsr_tsc_aux(val);
         break;
=20
+#ifdef CONFIG_AMD
     case MSR_VIRT_SPEC_CTRL:
         if ( !cp->extd.virt_ssbd )
             goto gp_fault;
@@ -598,6 +601,7 @@ int guest_wrmsr(struct vcpu *v, uint32_t msr, uint64_=
t val)
         if ( v =3D=3D curr && (curr->arch.dr7 & DR7_ACTIVE_MASK) )
             wrmsrl(msr, val);
         break;
+#endif /* CONFIG_AMD */
=20
     default:
         return X86EMUL_UNHANDLEABLE;
--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 11:15:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 11:15:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778555.1188611 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seuvF-0007s2-P3; Fri, 16 Aug 2024 11:15:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778555.1188611; Fri, 16 Aug 2024 11:15:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seuvF-0007rv-MI; Fri, 16 Aug 2024 11:15:09 +0000
Received: by outflank-mailman (input) for mailman id 778555;
 Fri, 16 Aug 2024 11:15: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=0eKx=PP=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1seuvE-0007rp-Bj
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 11:15:08 +0000
Received: from pb-smtp21.pobox.com (pb-smtp21.pobox.com [173.228.157.53])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ca007d53-5bc0-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 13:15:06 +0200 (CEST)
Received: from pb-smtp21.pobox.com (unknown [127.0.0.1])
 by pb-smtp21.pobox.com (Postfix) with ESMTP id 4A9DA1AE93;
 Fri, 16 Aug 2024 07:15:04 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1])
 by pb-smtp21.pobox.com (Postfix) with ESMTP id 320161AE92;
 Fri, 16 Aug 2024 07:15:04 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [185.130.54.120])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 85F981AE8E;
 Fri, 16 Aug 2024 07:15:00 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ca007d53-5bc0-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:in-reply-to:references:mime-version
	:content-transfer-encoding; s=sasl; bh=SImZJDa/oxwFzFRYOBx72eonr
	TZPtSmDNOl28smcrN4=; b=W5GAoZqVvANw8VMDmkR8LKn9oLIJKvQ04wCU9ocs6
	aP3eA5UnByYIn0h5IeATBNHlr510pSfxazBe/tnaFYbyXwWhwNvp7pVOnhqvxcaR
	ZlIve0cLYYu1UzZVofENQElpHkSXjnk58nDtshhERb/lsK9STNb4P1W8jS4u0FHv
	5c=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [XEN PATCH v2 3/5] x86/spec-ctrl: configurable Intlel/AMD-specific calculations
Date: Fri, 16 Aug 2024 14:14:52 +0300
Message-Id: <b789679a7edd41c88eca41d3c703d2292cfcce0e.1723806405.git.Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
References: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
MIME-Version: 1.0
X-Pobox-Relay-ID:
 C7331240-5BC0-11EF-94DE-E92ED1CD468F-90055647!pb-smtp21.pobox.com
Content-Transfer-Encoding: quoted-printable

Put platforms-specific code under #ifdef CONFIG_{AMD,INTEL} so that when
corresponding CPU support is disabled by configuration less dead code wil=
l end
up in the build.

This includes re-ordering of calls to ibpb_calculations() & div_calculati=
ons(),
but since they don't access common variables or feature bits it should be
safe to do.

Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
CC: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/spec_ctrl.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index 75a4177a75..ba6c3e80d2 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -1012,6 +1012,7 @@ static bool __init should_use_eager_fpu(void)
     }
 }
=20
+#ifdef CONFIG_AMD
 /*
  * https://www.amd.com/content/dam/amd/en/documents/corporate/cr/specula=
tive-return-stack-overflow-whitepaper.pdf
  */
@@ -1110,6 +1111,7 @@ static void __init div_calculations(bool hw_smt_ena=
bled)
             "enabled.  Please assess your configuration and choose an\n"
             "explicit 'smt=3D<bool>' setting.  See XSA-439.\n");
 }
+#endif /* CONFIG_AMD */
=20
 static void __init ibpb_calculations(void)
 {
@@ -1319,6 +1321,7 @@ static __init void l1tf_calculations(void)
                                             : (3UL << (paddr_bits - 2)))=
);
 }
=20
+#ifdef CONFIG_INTEL
 /* Calculate whether this CPU is vulnerable to MDS. */
 static __init void mds_calculations(void)
 {
@@ -1730,6 +1733,8 @@ static void __init bhi_calculations(void)
     }
 }
=20
+#endif /* CONFIG_INTEL */
+
 void spec_ctrl_init_domain(struct domain *d)
 {
     bool pv =3D is_pv_domain(d);
@@ -2025,11 +2030,13 @@ void __init init_speculation_mitigations(void)
             default_scf |=3D SCF_ist_rsb;
     }
=20
+#ifdef CONFIG_AMD
     srso_calculations(hw_smt_enabled);
=20
-    ibpb_calculations();
-
     div_calculations(hw_smt_enabled);
+#endif
+
+    ibpb_calculations();
=20
     /* Check whether Eager FPU should be enabled by default. */
     if ( opt_eager_fpu =3D=3D -1 )
@@ -2136,9 +2143,10 @@ void __init init_speculation_mitigations(void)
      * - March 2023, for RFDS.  Enumerate RFDS_CLEAR to mean that VERW n=
ow
      *   scrubs non-architectural entries from certain register files.
      */
+#ifdef CONFIG_INTEL
     mds_calculations();
     rfds_calculations();
-
+#endif
     /*
      * Parts which enumerate FB_CLEAR are those with now-updated microco=
de
      * which weren't susceptible to the original MFBDS (and therefore di=
dn't
@@ -2255,7 +2263,6 @@ void __init init_speculation_mitigations(void)
         opt_tsx =3D 0;
         tsx_init();
     }
-#endif
=20
     /*
      * On some SRBDS-affected hardware, it may be safe to relax srb-lock=
 by
@@ -2286,6 +2293,8 @@ void __init init_speculation_mitigations(void)
=20
     bhi_calculations();
=20
+#endif /* CONFIG_INTEL */
+
     print_details(thunk);
=20
     /*
--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 11:17:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 11:17:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778578.1188623 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seuxF-0001ES-69; Fri, 16 Aug 2024 11:17:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778578.1188623; Fri, 16 Aug 2024 11:17:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seuxF-0001EL-1p; Fri, 16 Aug 2024 11:17:13 +0000
Received: by outflank-mailman (input) for mailman id 778578;
 Fri, 16 Aug 2024 11:17:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0eKx=PP=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1seuxD-0000sM-Rl
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 11:17:11 +0000
Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 12eb44ea-5bc1-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 13:17:10 +0200 (CEST)
Received: from pb-smtp1.pobox.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id 47DFF27A4F;
 Fri, 16 Aug 2024 07:17:07 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id 2F8E927A4E;
 Fri, 16 Aug 2024 07:17:07 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [185.130.54.120])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 4F14E27A4D;
 Fri, 16 Aug 2024 07:17:06 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 12eb44ea-5bc1-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:in-reply-to:references:mime-version
	:content-transfer-encoding; s=sasl; bh=0sUZEfq34Jce26Uo7t070vVwu
	CBDfAUvgjTre/OP4Yc=; b=IVOGs9bG+DjAJ2zbS6AfIdx+jBRUgAfr9RkT6v8dJ
	6s9qqB8rE/GWW5x0V7M/k/tuQjc1rzM8vxEqeS95MHPRWs4/tNWrRNMN2dW8JvM/
	V58MiOOqUzDkianP/8rqDT/9A4BBYzZfHSyrIzmn6vCKmmeEEtyeyITXVOh3+I0i
	Rg=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Alejandro Vallejo <alejandro.vallejo@cloud.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: [XEN PATCH v2 4/5] x86/intel: optional build of intel.c
Date: Fri, 16 Aug 2024 14:17:03 +0300
Message-Id: <ce06eff2060c94ebf659d11f7390c577a3c6a24e.1723806405.git.Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
References: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
MIME-Version: 1.0
X-Pobox-Relay-ID:
 122BD1E2-5BC1-11EF-B11F-2BAEEB2EC81B-90055647!pb-smtp1.pobox.com
Content-Transfer-Encoding: quoted-printable

With specific config option INTEL in place and most of the code that depe=
nds
on intel.c now can be optionally enabled/disabled it's now possible to pu=
t
the whole intel.c under INTEL option as well. This will allow for a Xen b=
uild
without Intel CPU support.

Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
CC: Alejandro Vallejo <alejandro.vallejo@cloud.com>
CC: Jan Beulich <jbeulich@suse.com>
---
changes in v2:
  - drop set_in_mcu_opt_ctrl() stub
---
 xen/arch/x86/cpu/Makefile            | 4 ++--
 xen/arch/x86/cpu/common.c            | 2 ++
 xen/arch/x86/include/asm/processor.h | 3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/Makefile b/xen/arch/x86/cpu/Makefile
index 80739d0256..eeb9ebe562 100644
--- a/xen/arch/x86/cpu/Makefile
+++ b/xen/arch/x86/cpu/Makefile
@@ -6,8 +6,8 @@ obj-y +=3D amd.o
 obj-$(CONFIG_CENTAUR) +=3D centaur.o
 obj-y +=3D common.o
 obj-$(CONFIG_HYGON) +=3D hygon.o
-obj-y +=3D intel.o
-obj-y +=3D intel_cacheinfo.o
+obj-$(CONFIG_INTEL) +=3D intel.o
+obj-$(CONFIG_INTEL) +=3D intel_cacheinfo.o
 obj-y +=3D mwait-idle.o
 obj-$(CONFIG_SHANGHAI) +=3D shanghai.o
 obj-y +=3D vpmu.o
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index dcc2753212..580b01d6d5 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -336,8 +336,10 @@ void __init early_cpu_init(bool verbose)
=20
 	c->x86_vendor =3D x86_cpuid_lookup_vendor(ebx, ecx, edx);
 	switch (c->x86_vendor) {
+#ifdef CONFIG_INTEL
 	case X86_VENDOR_INTEL:    intel_unlock_cpuid_leaves(c);
 				  actual_cpu =3D intel_cpu_dev;    break;
+#endif
 	case X86_VENDOR_AMD:      actual_cpu =3D amd_cpu_dev;      break;
 #ifdef CONFIG_CENTAUR
 	case X86_VENDOR_CENTAUR:  actual_cpu =3D centaur_cpu_dev;  break;
diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/=
asm/processor.h
index 66463f6a6d..a52f8b0a83 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -507,13 +507,14 @@ static inline uint8_t get_cpu_family(uint32_t raw, =
uint8_t *model,
 extern int8_t opt_tsx;
 extern bool rtm_disabled;
 void tsx_init(void);
+void update_mcu_opt_ctrl(void);
 #else
 #define opt_tsx      0     /* explicitly indicate TSX is off */
 #define rtm_disabled false /* RTM was not force-disabled */
 static inline void tsx_init(void) {}
+static inline void update_mcu_opt_ctrl(void) {}
 #endif
=20
-void update_mcu_opt_ctrl(void);
 void set_in_mcu_opt_ctrl(uint32_t mask, uint32_t val);
=20
 enum ap_boot_method {
--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 11:19:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 11:19:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778584.1188631 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seuzC-0001nv-FW; Fri, 16 Aug 2024 11:19:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778584.1188631; Fri, 16 Aug 2024 11:19:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1seuzC-0001no-Cn; Fri, 16 Aug 2024 11:19:14 +0000
Received: by outflank-mailman (input) for mailman id 778584;
 Fri, 16 Aug 2024 11:19:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0eKx=PP=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1seuzB-0001mN-3h
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 11:19:13 +0000
Received: from pb-smtp2.pobox.com (pb-smtp2.pobox.com [64.147.108.71])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5c64582a-5bc1-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 13:19:11 +0200 (CEST)
Received: from pb-smtp2.pobox.com (unknown [127.0.0.1])
 by pb-smtp2.pobox.com (Postfix) with ESMTP id 8C5B82B8AD;
 Fri, 16 Aug 2024 07:19:10 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-smtp2.pobox.com (Postfix) with ESMTP id 830592B8AC;
 Fri, 16 Aug 2024 07:19:10 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [185.130.54.120])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 912E72B8AB;
 Fri, 16 Aug 2024 07:19:09 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5c64582a-5bc1-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:in-reply-to:references:mime-version
	:content-transfer-encoding; s=sasl; bh=PjnMO2z53AIZ819k6PFRrFgWX
	6KC8ZTHVSlS1GFYRHg=; b=RJz3lELjHQkcdAJIiw2+DyP48jnGSsN1JYu3eQHWc
	jtU59lDyc4nd30jCzlyT8o6C/gaDivwYg3gGIPjKH7Jl4EXigYR9aB8MVrLNZeru
	9RC6cNsNRIRQWU38oFmQM09dQ9eyiLCF63HfhlnHNs0AfX+PRu+oOyt32eXLluIA
	aM=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [XEN PATCH v2 5/5] x86/amd: optional build of amd.c
Date: Fri, 16 Aug 2024 14:19:07 +0300
Message-Id: <3c641433fa7cfe1f7fdc918ab32086835a2e13eb.1723806405.git.Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
References: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
MIME-Version: 1.0
X-Pobox-Relay-ID:
 5BA4DA1C-5BC1-11EF-AEDC-9B0F950A682E-90055647!pb-smtp2.pobox.com
Content-Transfer-Encoding: quoted-printable

Similar to making Intel CPU support optional -- as we've got CONFIG_AMD o=
ption
now, we can put arch/x86/cpu/amd.c under it and make it possible to build
Xen without AMD CPU support. One possible use case is to dispose of dead =
code
in Intel-only systems.

Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
CC: Jan Beulich <jbeulich@suse.com>
---
changes in v2:
 - drop routines-stubs in amd.h, handle call sites instead
 - cpu_has_amd_erratum() return int instead of bool
---
 xen/arch/x86/cpu/Makefile      |  2 +-
 xen/arch/x86/cpu/common.c      |  4 +++-
 xen/arch/x86/hvm/svm/svm.c     |  6 ++++--
 xen/arch/x86/include/asm/amd.h | 20 ++++++++++++++++++--
 xen/arch/x86/spec_ctrl.c       |  2 ++
 5 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/cpu/Makefile b/xen/arch/x86/cpu/Makefile
index eeb9ebe562..2c34597136 100644
--- a/xen/arch/x86/cpu/Makefile
+++ b/xen/arch/x86/cpu/Makefile
@@ -2,7 +2,7 @@ obj-y +=3D mcheck/
 obj-y +=3D microcode/
 obj-y +=3D mtrr/
=20
-obj-y +=3D amd.o
+obj-$(CONFIG_AMD) +=3D amd.o
 obj-$(CONFIG_CENTAUR) +=3D centaur.o
 obj-y +=3D common.o
 obj-$(CONFIG_HYGON) +=3D hygon.o
diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
index 580b01d6d5..5930b712bf 100644
--- a/xen/arch/x86/cpu/common.c
+++ b/xen/arch/x86/cpu/common.c
@@ -194,7 +194,7 @@ void ctxt_switch_levelling(const struct vcpu *next)
=20
 		if (cpu_has_cpuid_faulting)
 			set_cpuid_faulting(enable_cpuid_faulting);
-		else
+		else if ( IS_ENABLED(CONFIG_AMD) )
 			amd_set_cpuid_user_dis(enable_cpuid_faulting);
=20
 		return;
@@ -340,7 +340,9 @@ void __init early_cpu_init(bool verbose)
 	case X86_VENDOR_INTEL:    intel_unlock_cpuid_leaves(c);
 				  actual_cpu =3D intel_cpu_dev;    break;
 #endif
+#ifdef CONFIG_AMD
 	case X86_VENDOR_AMD:      actual_cpu =3D amd_cpu_dev;      break;
+#endif
 #ifdef CONFIG_CENTAUR
 	case X86_VENDOR_CENTAUR:  actual_cpu =3D centaur_cpu_dev;  break;
 #endif
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 92bb10c504..88902e2d3a 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -919,7 +919,8 @@ static void cf_check svm_ctxt_switch_from(struct vcpu=
 *v)
      * Possibly clear previous guest selection of SSBD if set.  Note tha=
t
      * SPEC_CTRL.SSBD is already handled by svm_vmexit_spec_ctrl.
      */
-    if ( v->arch.msrs->virt_spec_ctrl.raw & SPEC_CTRL_SSBD )
+    if ( IS_ENABLED(CONFIG_AMD) &&
+         v->arch.msrs->virt_spec_ctrl.raw & SPEC_CTRL_SSBD )
     {
         ASSERT(v->domain->arch.cpuid->extd.virt_ssbd);
         amd_set_legacy_ssbd(false);
@@ -953,7 +954,8 @@ static void cf_check svm_ctxt_switch_to(struct vcpu *=
v)
         wrmsr_tsc_aux(v->arch.msrs->tsc_aux);
=20
     /* Load SSBD if set by the guest. */
-    if ( v->arch.msrs->virt_spec_ctrl.raw & SPEC_CTRL_SSBD )
+    if ( IS_ENABLED(CONFIG_AMD) &&
+         v->arch.msrs->virt_spec_ctrl.raw & SPEC_CTRL_SSBD )
     {
         ASSERT(v->domain->arch.cpuid->extd.virt_ssbd);
         amd_set_legacy_ssbd(true);
diff --git a/xen/arch/x86/include/asm/amd.h b/xen/arch/x86/include/asm/am=
d.h
index fa4e0fc766..da35b82d5a 100644
--- a/xen/arch/x86/include/asm/amd.h
+++ b/xen/arch/x86/include/asm/amd.h
@@ -158,20 +158,36 @@
 #define is_zen4_uarch()   boot_cpu_has(X86_FEATURE_AUTO_IBRS)
=20
 struct cpuinfo_x86;
+#ifdef CONFIG_AMD
 int cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu, int osvw_id, ...)=
;
+#else
+static inline int cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu,
+                                      int osvw_id, ...)
+{
+    return 0;
+}
+#endif
=20
 extern s8 opt_allow_unsafe;
=20
 void fam10h_check_enable_mmcfg(void);
 void check_enable_amd_mmconf_dmi(void);
=20
-extern bool amd_acpi_c1e_quirk;
 void amd_check_disable_c1e(unsigned int port, u8 value);
=20
 extern bool amd_legacy_ssbd;
-extern bool amd_virt_spec_ctrl;
 bool amd_setup_legacy_ssbd(void);
 void amd_set_legacy_ssbd(bool enable);
 void amd_set_cpuid_user_dis(bool enable);
=20
+#ifdef CONFIG_AMD
+extern bool amd_acpi_c1e_quirk;
+extern bool amd_virt_spec_ctrl;
+#else
+
+#define amd_acpi_c1e_quirk (false)
+#define amd_virt_spec_ctrl (false)
+
+#endif
+
 #endif /* __AMD_H__ */
diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c
index ba6c3e80d2..1964a417de 100644
--- a/xen/arch/x86/spec_ctrl.c
+++ b/xen/arch/x86/spec_ctrl.c
@@ -1893,10 +1893,12 @@ void __init init_speculation_mitigations(void)
             setup_force_cpu_cap(X86_FEATURE_SC_MSR_HVM);
     }
=20
+#ifdef CONFIG_AMD
     /* Support VIRT_SPEC_CTRL.SSBD if AMD_SSBD is not available. */
     if ( opt_msr_sc_hvm && !cpu_has_amd_ssbd &&
          (cpu_has_virt_ssbd || (amd_legacy_ssbd && amd_setup_legacy_ssbd=
())) )
         amd_virt_spec_ctrl =3D true;
+#endif
=20
     /* Figure out default_xen_spec_ctrl. */
     if ( has_spec_ctrl && ibrs )
--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 12:06:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 12:06:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778601.1188642 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sevie-0003Qw-Ur; Fri, 16 Aug 2024 12:06:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778601.1188642; Fri, 16 Aug 2024 12:06:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sevie-0003Qp-SI; Fri, 16 Aug 2024 12:06:12 +0000
Received: by outflank-mailman (input) for mailman id 778601;
 Fri, 16 Aug 2024 12:06:11 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=6pmz=PP=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sevid-0003Q5-Dk
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 12:06:11 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ec73a8fb-5bc7-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 14:06:09 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-530e22878cfso1925489e87.2
 for <xen-devel@lists.xenproject.org>; Fri, 16 Aug 2024 05:06:09 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5330d424d77sm529521e87.280.2024.08.16.05.06.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 16 Aug 2024 05:06:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ec73a8fb-5bc7-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1723809969; x=1724414769; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=DGS2FlQzoejqcN5y+ZcOUrUjGggoEVLsPK9AEbgKgJw=;
        b=RJnC7RhjEgXEM4QkBpd4Q/dorjVqRxXMwnC5nIMNTa+yRf/Dzo9lD/3b/wvmtDtgWi
         WwDB94Ktj5KbpyeP2uRRvLCl3K5bqMM1hK5xBlxJ2qzgs+P+LInkAZSCodSvdoVL+vmi
         twrcfFAVmPK5C/frGLEkAgivX04VM0wtWUiAqIorCFNuXXv677uWP3hlTETTy/Gqx5Lq
         Md7a32nRIneiF5NDwXsTbj5XRo7chASF1TVmaYvSlPl/bJJBwzr8LTYUgjb26W7vZDcU
         QSTN1EsIgOOQig0e0V33qcvb+C3SZYUJC/x17WQCcVIi7cbLNc4gTRne6VGoETQ279F+
         mdVA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723809969; x=1724414769;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=DGS2FlQzoejqcN5y+ZcOUrUjGggoEVLsPK9AEbgKgJw=;
        b=InhcLRdLR0RTLaKolKaKclyLZ+QbgLpS9FNMK+Y1x/ZiJnuUZEWPqBdTL79OkGu8Oc
         fRthO1SyqK9cWWGX8jdyyK/FEnGil0RX+Ua0mt/cyxRTk7EkcBfe8nVRpF/IDhy4+wn0
         mk1lDwyAVHZJ2r3HGX/tuGK7ozDr0WpRlU+9BdxgS4WrwnXhDujSzEgB0+p0uj+Adu+3
         +4iZwjS9esWogsoRJT+WAMobja+7JM3L/+QUvSqPD21Bvu4FXkHIkO96rCiWxoY8fiwH
         IVd2AncasxGh15RgmQovuVhH4+oNWK6rCvdLDmteJDPhHqtNxkMLGsPszJ1zkwX8v/Q0
         AO2A==
X-Forwarded-Encrypted: i=1; AJvYcCU6h52UlaJM/DAtpgm4RvBBXSBulqLN1i2CiUsf2TViuYPxWX+i8TkuGFk2TrvlwxdegdC2FAC/orXqYn98fd1TPyFKL0FLAW0S36y55ww=
X-Gm-Message-State: AOJu0YyWC8UXrbYfbrpxo6FLACOLkWebad2aWJdGiK7G9ZhxQ+uTkimp
	pl0XdxSgJgXqFbTPcjqPjtQiUym3Taw2LcUV0cseVX6rAKdZKMDN
X-Google-Smtp-Source: AGHT+IGIv24Zla4qUba8fy6dY+72K21eimFOfTorFzVl2lMnHAp9WclVx8XGbBQu5ig5GGE1nm/uug==
X-Received: by 2002:a05:6512:12cc:b0:530:c323:46a8 with SMTP id 2adb3069b0e04-5331c6a4577mr1648779e87.23.1723809968408;
        Fri, 16 Aug 2024 05:06:08 -0700 (PDT)
Message-ID: <9e3bfd3afdee65f913fe418e2f6e061c4c39aaf9.camel@gmail.com>
Subject: Re: [PATCH v4 5/7] xen/riscv: introduce and initialize SBI RFENCE
 extension
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Fri, 16 Aug 2024 14:06:06 +0200
In-Reply-To: <77ff59d1-b158-4603-bdbd-67c079ce87c9@suse.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
	 <1a863d06866f86761d23e6da3f4a6ee58c474473.1723214540.git.oleksii.kurochko@gmail.com>
	 <77ff59d1-b158-4603-bdbd-67c079ce87c9@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Tue, 2024-08-13 at 11:34 +0200, Jan Beulich wrote:
> > =C2=A0=20
> > +static unsigned long sbi_spec_version =3D SBI_SPEC_VERSION_DEFAULT;
> > +static unsigned long sbi_fw_id, sbi_fw_version;
>=20
> __ro_after_init for perhaps all three of them?
>=20
> Considering SBI_SPEC_VERSION_{MAJOR,MINOR}_MASK, at least the first
> of them also doesn't need to be unsigned long, but could be unsigned
> int?

sbi_spec_version can be really unsigned int as according to the spec
only 32 bits are used:
```
   struct sbiret sbi_get_spec_version(void);
   Returns the current SBI specification version. This function must
   always succeed. The minor number
   of the SBI specification is encoded in the low 24 bits, with the
   major number encoded in the next 7
   bits. Bit 31 must be 0 and is reserved for future expansion.
```

For sbi_fw_id, sbi_fw_version it is not mentioned the same thing, so we
can just assume ( despite of the fact that now this values are very
small and it is unlikely to be bigger the UINT_MAX ) that it will be
always fit in uint32_t.

But I think it would be better to leave unsigned long for everyone as
according to the specification this functions returns sbiret structure
which consist of 2 longs ( error and value ) and it is good idea to
follow the specification.

~ Oleksii





From xen-devel-bounces@lists.xenproject.org Fri Aug 16 12:32:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 12:32:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778610.1188651 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sew8D-0000jB-Vw; Fri, 16 Aug 2024 12:32:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778610.1188651; Fri, 16 Aug 2024 12:32:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sew8D-0000j4-TH; Fri, 16 Aug 2024 12:32:37 +0000
Received: by outflank-mailman (input) for mailman id 778610;
 Fri, 16 Aug 2024 12:32:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=yoBP=PP=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sew8C-0000iy-2Y
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 12:32:36 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9d35b12a-5bcb-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 14:32:34 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-52f0277daa5so2596122e87.0
 for <xen-devel@lists.xenproject.org>; Fri, 16 Aug 2024 05:32:35 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a838393566fsm247319266b.104.2024.08.16.05.32.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 16 Aug 2024 05:32:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9d35b12a-5bcb-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1723811554; x=1724416354; 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=gphdtdL9Rqu44KfG8IipZg0tMS7RgLwEBzoRq/G1nU4=;
        b=WA8A2rfPTyjHVG5FaoKF9i1gFPTard5p6lh2ED7SRybnICTu8xdDrnUc7sCmWepJI8
         phlDaog1YwFEEVXS5sNlxqFrWOYKNBxw1KEKKcU8rVTCZiCamiPWCz9BXG8ow2/8JEfD
         HmKOG6E5BcV1RvafIj0USetSRz3R/JkZYkyNrv3ebNeXWRsSVg4hojAxQWMMJNlZBFNw
         DRNPqFgu9WrDkcBGjmziJhAUeBxiCYaBgyh6fWXWSAPoXr8+130him++gCymunIcOWJx
         JYm+xucZBgRD7mcKYKAuwcdRPDoqoopwmgQpd8SK7cMtpvqT1gE1UF8V+LOzE0CgXCB3
         yTWg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723811554; x=1724416354;
        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=gphdtdL9Rqu44KfG8IipZg0tMS7RgLwEBzoRq/G1nU4=;
        b=Sm6YI6iOR3iVH4yOGGmc0RlqxJm//YsLPM6sQATEHnuKXgRsbyO+U5u3q1f3dbZ84n
         B/aHvFOARWIDOajHQI6q3bE/wo5VvapKnLNRpBEyZN2DTO9RUFH3QOPJwJHsxdi093gQ
         u6jfTUiN638zFZV4ol5kwq5jBCKjALYN5C24NTyoYEc1vE7eJVlsdhRLnUqf1xZ6XPKE
         Xi8iPwLIcPS9VdK0xscRk8Ybd1n5D/hYX+Mwtp0vssIK6kV/6abduCqH2nDeYEtekkcc
         2d0KHsYso9LnhwaS10Q2FqlGoutmIlF+Xo9pMfvIRGdGOqLq1TK8OcpGPGWPYMBLQQxP
         Lu+w==
X-Forwarded-Encrypted: i=1; AJvYcCWi0hQ7DeR8lKIh0iysIjkxuqF7IJb7aNAtDDjv6D5oVvexQlcaQtu9hln5bLLwxT1K4bcr+DN5jakc2ah9Urlc7ejM4pD3yc2JHvTfogw=
X-Gm-Message-State: AOJu0Yz3IoeYhvGGIOmVsE56T8LSGoiuX7nPtTT906lR8fXhscQfrR+t
	Nm25PDN/YZPjszX7JQleY/NYFLMynkCvCwo7Q4ddliOAiqsL7A11mbXwQvPybw==
X-Google-Smtp-Source: AGHT+IFYWKWs+TxFQghPuEuymzeEx+DGhtV8uTnEubGQBSKN8l+CDAPYBYlR8PfQL1Z9nevJaP8Fww==
X-Received: by 2002:a05:6512:33d5:b0:530:e228:276f with SMTP id 2adb3069b0e04-5331c6ba93dmr2026632e87.36.1723811554172;
        Fri, 16 Aug 2024 05:32:34 -0700 (PDT)
Message-ID: <253638c4-2256-4bdd-9f12-7f99e373355e@suse.com>
Date: Fri, 16 Aug 2024 14:32:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 5/7] xen/riscv: introduce and initialize SBI RFENCE
 extension
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <1a863d06866f86761d23e6da3f4a6ee58c474473.1723214540.git.oleksii.kurochko@gmail.com>
 <77ff59d1-b158-4603-bdbd-67c079ce87c9@suse.com>
 <9e3bfd3afdee65f913fe418e2f6e061c4c39aaf9.camel@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: <9e3bfd3afdee65f913fe418e2f6e061c4c39aaf9.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 16.08.2024 14:06, oleksii.kurochko@gmail.com wrote:
> On Tue, 2024-08-13 at 11:34 +0200, Jan Beulich wrote:
>>>   
>>> +static unsigned long sbi_spec_version = SBI_SPEC_VERSION_DEFAULT;
>>> +static unsigned long sbi_fw_id, sbi_fw_version;
>>
>> __ro_after_init for perhaps all three of them?
>>
>> Considering SBI_SPEC_VERSION_{MAJOR,MINOR}_MASK, at least the first
>> of them also doesn't need to be unsigned long, but could be unsigned
>> int?
> 
> sbi_spec_version can be really unsigned int as according to the spec
> only 32 bits are used:
> ```
>    struct sbiret sbi_get_spec_version(void);
>    Returns the current SBI specification version. This function must
>    always succeed. The minor number
>    of the SBI specification is encoded in the low 24 bits, with the
>    major number encoded in the next 7
>    bits. Bit 31 must be 0 and is reserved for future expansion.
> ```
> 
> For sbi_fw_id, sbi_fw_version it is not mentioned the same thing, so we
> can just assume ( despite of the fact that now this values are very
> small and it is unlikely to be bigger the UINT_MAX ) that it will be
> always fit in uint32_t.
> 
> But I think it would be better to leave unsigned long for everyone as
> according to the specification this functions returns sbiret structure
> which consist of 2 longs ( error and value ) and it is good idea to
> follow the specification.

Okay with me (for these two) then.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 13:02:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 13:02:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778619.1188663 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sewai-00060d-6m; Fri, 16 Aug 2024 13:02:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778619.1188663; Fri, 16 Aug 2024 13:02:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sewai-00060W-1d; Fri, 16 Aug 2024 13:02:04 +0000
Received: by outflank-mailman (input) for mailman id 778619;
 Fri, 16 Aug 2024 13:02:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sewah-00060M-DF; Fri, 16 Aug 2024 13:02:03 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sewah-0006lD-4X; Fri, 16 Aug 2024 13:02:03 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sewag-00023B-En; Fri, 16 Aug 2024 13:02:02 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sewag-0000sJ-EH; Fri, 16 Aug 2024 13:02:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=T/mGRIEslAAgTsIo5bcFwGeB2ORxDFQXJ2PYc/y+vVA=; b=yGvFUOy43dGWCxrK29sd2gTn3b
	uDk+JO2U7VW4QsW2vYmjzRjN5Qj+BSjrBikJl9gLzRDz4i13/+xKAyTRSHVkJfY37XFoB4RAbUTnj
	R7tIzwaj+b9Nbb2o2YE94kARQ7JMi8NSLcKdKCyfW9oCAgD6ZIc+6d3A9kc9Zo0wtYLY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187252-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-6.1 test] 187252: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-6.1:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=117ac406ba904da738fb79a3b2c96d4a385292c1
X-Osstest-Versions-That:
    linux=36790ef5e00b69ccb92817f95ba1928eea24eebb
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 16 Aug 2024 13:02:02 +0000

flight 187252 linux-6.1 real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187252/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187211
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187211
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187211
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187211
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187211
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187211
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                117ac406ba904da738fb79a3b2c96d4a385292c1
baseline version:
 linux                36790ef5e00b69ccb92817f95ba1928eea24eebb

Last test of basis   187211  2024-08-11 10:42:52 Z    5 days
Testing same since   187241  2024-08-14 12:15:39 Z    2 days    3 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alex Deucher <alexander.deucher@amd.com>
  Alex Hung <alex.hung@amd.com>
  Alexander Gordeev <agordeev@linux.ibm.com>
  Andi Kleen <ak@linux.intel.com>
  Andi Shyti <andi.shyti@kernel.org>
  Andrew Morton <akpm@linux-foundation.org>
  Andrey Konovalov <andreyknvl@gmail.com>
  Anna Schumaker <Anna.Schumaker@Netapp.com>
  Anton Khirnov <anton@khirnov.net>
  Arnaldo Carvalho de Melo <acme@redhat.com>
  Arseniy Krasnov <avkrasnov@salutedevices.com>
  Bart Van Assche <bvanassche@acm.org>
  Benjamin Coddington <bcodding@redhat.com>
  Besar Wicaksono <bwicaksono@nvidia.com>
  Bharath SM <bharathsm@microsoft.com>
  Bjorn Helgaas <bhelgaas@google.com>
  Bjørn Mork <bjorn@mork.no>
  Bob Zhou <bob.zhou@amd.com>
  Boqun Feng <boqun.feng@gmail.com>
  Catalin Marinas <catalin.marinas@arm.com>
  Chandan Babu R <chandanbabu@kernel.org>
  Cheng-Jui Wang <cheng-jui.wang@mediatek.com>
  Chi Zhiling <chizhiling@kylinos.cn>
  Chris Wulff <crwulff@gmail.com>
  Christoph Hellwig <hch@lst.de>
  ChromeOS CQ Test <chromeos-kernel-stable-merge@google.com>
  Csókás, Bence <csokas.bence@prolan.hu>
  Curtis Malainey <cujomalainey@chromium.org>
  Damien Le Moal <dlemoal@kernel.org>
  Dan Williams <dan.j.williams@intel.com>
  Daniel Borkmann <daniel@iogearbox.net>
  Daniel Lezcano <daniel.lezcano@linaro.org>
  Daniel Wheeler <daniel.wheeler@amd.com>
  Daniele Palmas <dnlplm@gmail.com>
  Darrick J. Wong <djwong@kernel.org>
  David Hildenbrand <david@redhat.com>
  David S. Miller <davem@davemloft.net>
  David Sterba <dsterba@suse.com>
  Dmitry Antipov <dmantipov@yandex.ru>
  Dragan Simic <dsimic@manjaro.org>
  Dragos Tatulea <dtatulea@nvidia.com>
  Dustin L. Howett <dustin@howett.net>
  Eric Dumazet <edumazet@google.com>
  Fangzhi Zuo <Jerry.Zuo@amd.com>
  Feng Tang <feng.tang@intel.com>
  Filipe Manana <fdmanana@suse.com>
  Florian Fainelli <florian.fainelli@broadcom.com>
  Florian Westphal <fw@strlen.de>
  Frederic Weisbecker <frederic@kernel.org>
  FUJITA Tomonori <fujita.tomonori@gmail.com>
  Gaosheng Cui <cuigaosheng1@huawei.com>
  Geert Uytterhoeven <geert+renesas@glider.be>
  Geliang Tang <geliang.tang@suse.com>
  George Kennedy <george.kennedy@oracle.com>
  George Zhang <George.zhang@amd.com>
  Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  Guenter Roeck <linux@roeck-us.net>
  Hamza Mahfooz <hamza.mahfooz@amd.com>
  Hanna Czenczek <hreitz@redhat.com>
  Hans de Goede <hdegoede@redhat.com>
  Hans Verkuil <hverkuil-cisco@xs4all.nl>
  Huacai Chen <chenhuacai@loongson.cn>
  HungNien Chen <hn.chen@sunplusit.com>
  Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
  Ivan Lipski <ivlipski@amd.com>
  Jakub Kicinski <kuba@kernel.org>
  James Chapman <jchapman@katalix.com>
  Jan Kara <jack@suse.cz>
  Jason Wang <jasowang@redhat.com>
  Jens Axboe <axboe@kernel.dk>
  Jerome Brunet <jbrunet@baylibre.com>
  Jin Wang <jin1.wang@intel.com>
  Jiri Olsa <jolsa@kernel.org>
  Jithu Joseph <jithu.joseph@intel.com>
  Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
  Johan Hovold <johan@kernel.org>
  Johannes Berg <johannes.berg@intel.com>
  Jon Hunter <jonathanh@nvidia.com>
  Justin Stitt <justinstitt@google.com>
  Kemeng Shi <shikemeng@huaweicloud.com>
  Kevin Berry <kpberry@google.com>
  Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
  Kuniyuki Iwashima <kuniyu@amazon.com>
  Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
  Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  Li Nan <linan122@huawei.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Linux Kernel Functional Testing <lkft@linaro.org>
  Lucas Stach <l.stach@pengutronix.de>
  Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  Lyude Paul <lyude@redhat.com>
  Ma Jun <Jun.Ma2@amd.com>
  Ma Ke <make24@iscas.ac.cn>
  Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
  Marc Kleine-Budde <mkl@pengutronix.de>
  Marco Elver <elver@google.com>
  Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
  Mark Brown <broonie@kernel.org>
  Mark Rutland <mark.rutland@arm.com>
  Martin K. Petersen <martin.petersen@oracle.com>
  Masami Hiramatsu (Google) <mhiramat@kernel.org>
  Matthieu Baerts (NGI0) <matttbe@kernel.org>
  Matthieu Baerts <matthieu.baerts@tessares.net>
  Menglong Dong <dongml2@chinatelecom.cn>
  Menglong Dong <menglong8.dong@gmail.com>
  Miaohe Lin <linmiaohe@huawei.com>
  Michael S. Tsirkin <mst@redhat.com>
  Michal Pecio <michal.pecio@gmail.com>
  Mikulas Patocka <mpatocka@redhat.com>
  Ming Qian <ming.qian@nxp.com>
  Muchun Song <muchun.song@linux.dev>
  Neil Armstrong <neil.armstrong@linaro.org>
  Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK
  Nicolas Dichtel <nicolas.dichtel@6wind.com>
  Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
  Nikolay Aleksandrov <razor@blackwall.org>
  Oliver Neukum <oneukum@suse.com>
  Pablo Neira Ayuso <pablo@netfilter.org>
  Paolo Abeni <pabeni@redhat.com>
  Paul E. McKenney <paulmck@kernel.org>
  Pavel Machek (CIP) <pavel@denx.de>
  Pengfei Xu <pengfei.xu@intel.com>
  Peter Oberparleiter <oberpar@linux.ibm.com>
  Peter Zijlstra (Intel) <peterz@infradead.org>
  Peter Zijlstra <peterz@infradead.org>
  Prashanth K <quic_prashk@quicinc.com>
  Qiang Yu <yuq825@gmail.com>
  Qu Wenruo <wqu@suse.com>
  Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
  Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  Ricardo Ribalda <ribalda@chromium.org>
  Robert Foss <rfoss@kernel.org>
  Roman Smirnov <r.smirnov@omp.ru>
  Ron Economos <re@w6rz.net>
  Salvatore Bonaccorso <carnil@debian.org>
  Sasha Levin <sashal@kernel.org>
  Sebastian Fricke <sebastian.fricke@collabora.com>
  Sebastian Reichel <sebastian.reichel@collabora.com>
  Shay Drory <shayd@nvidia.com>
  Shuah Khan <skhan@linuxfoundation.org>
  Song Liu <song@kernel.org>
  Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
  Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
  Stefan Wahren <wahrenst@gmx.net>
  Steve French <stfrench@microsoft.com>
  Steven 'Steve' Kendall <skend@chromium.org>
  Steven Rostedt (Google) <rostedt@goodmis.org>
  syzbot+e6979a5d2f10ecb700e4@syzkaller.appspotmail.com
  Takashi Iwai <tiwai@suse.de>
  Tariq Toukan <tariqt@nvidia.com>
  Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
  Theodore Ts'o <tytso@mit.edu>
  Thomas Gleixner <tglx@linutronix.de>
  Thomas Weißschuh <linux@weissschuh.net>
  Thomas Zimmermann <tzimmermann@suse.de>
  Tom Parkin <tparkin@katalix.com>
  Tze-nan Wu <Tze-nan.Wu@mediatek.com>
  Vamshi Gajjela <vamshigajjela@google.com>
  Victor Skvortsov <victor.skvortsov@amd.com>
  Waiman Long <longman@redhat.com>
  Wayne Lin <wayne.lin@amd.com>
  Will Deacon <will@kernel.org>
  Wolfram Sang <wsa+renesas@sang-engineering.com>
  Wolfram Sang <wsa@kernel.org>
  Xiaxi Shen <shenxiaxi26@gmail.com>
  Xin Long <lucien.xin@gmail.com>
  Yang Shi <yang@os.amperecomputing.com>
  Yang Wang<kevinyang.wang@amd.com>
  Yang Yingliang <yangyingliang@huawei.com>
  Yann Sionneau <ysionneau@kalrayinc.com>
  Yipeng Zou <zouyipeng@huawei.com>
  Yonghong Song <yonghong.song@linux.dev>
  Yu Kuai <yukuai3@huawei.com>
  Yu Liao <liaoyu15@huawei.com>
  Yves-Alexis Perez <corsac@debian.org>
  Zheng Zucheng <zhengzucheng@huawei.com>
  Zhiguo Niu <zhiguo.niu@unisoc.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   36790ef5e00b..117ac406ba90  117ac406ba904da738fb79a3b2c96d4a385292c1 -> tested/linux-6.1


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 13:16:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 13:16:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778630.1188672 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sewow-0000Aa-HU; Fri, 16 Aug 2024 13:16:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778630.1188672; Fri, 16 Aug 2024 13:16:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sewow-0000AT-Dr; Fri, 16 Aug 2024 13:16:46 +0000
Received: by outflank-mailman (input) for mailman id 778630;
 Fri, 16 Aug 2024 13:16:45 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=J2/C=PP=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sewov-0000AI-Pp
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 13:16:45 +0000
Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com
 [2a00:1450:4864:20::62c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c8176830-5bd1-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 15:16:43 +0200 (CEST)
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-a7a8caef11fso246122966b.0
 for <xen-devel@lists.xenproject.org>; Fri, 16 Aug 2024 06:16:43 -0700 (PDT)
Received: from localhost ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383946c05sm256782566b.183.2024.08.16.06.16.42
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 16 Aug 2024 06:16:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c8176830-5bd1-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723814203; x=1724419003; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=npjEpHkGzFsvzPRtGPIXxuZnLDrk2ZKiYkrynPx5u2c=;
        b=D0q/ZnInZzSvldvGzoEb2exc5Et4dvFtvZBYpgmyDwKWfkoLy9S2UJg/4qTyPfGdXE
         3cxpzRmgiU9rzZPMMCiDRhf7i4X1dP/6K/iiQJj1vyP+uV2qUuqT8xxYnJKqE6334pBQ
         f7/NKjKWs30ova4GCVha+6QqAd9E5IlhVnyro=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723814203; x=1724419003;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=npjEpHkGzFsvzPRtGPIXxuZnLDrk2ZKiYkrynPx5u2c=;
        b=JybqTJfp3kWfXB2p5ohKugBJyDwkdQBIPnHQKsNpau5PX3307ZHpKyeeMXdXBgAyA8
         dKmPpq0u09AHtlv1hp+mW+sKY0mX5k6yH5JJBheOrzHTFvdnU2VcFc1Frqefpu55fotj
         2VdmeYTQ1dKFJSmohTsEkSkOaZcMOTQH2C0qx3AVfeSXPoreh98H/CswYmYFECiXTCah
         oH5w+VzthamBQnu6p4vuwPpTuW72hk98f1memEvJQYI1sWR1pLUTBVuW30scCBocRUQz
         j0thXIXVdr1MEWG9HqoHsUzRmwfLoPZ3b9O6RNFY63OAsS2AcN/IKA1CiDs5AuPyl7h5
         0H5Q==
X-Forwarded-Encrypted: i=1; AJvYcCXdUOaRZKqGua5bCE3FjW1B7xZFY+35uyzWWgIa+Whdn6AaC1CrMElxjiG84ZggrJFlyLpKY2X2EHS5hyScYexKcNDtQ1u80/24IlVaqoc=
X-Gm-Message-State: AOJu0YxnpZBim0+aFS/hzxufCGxCl8kX91QfrTDivW+A/LKGiGbC+qdS
	FT4EPOCdrhXvGA9P2B5Z6pZd0BxIgk3nDNXSac6IM0wKl7EnWvFKfW6eVjAFj4A=
X-Google-Smtp-Source: AGHT+IFfkgqDL9uItnTkW5omak1DW+UYMu1s9voasHJa2HSg2T7HqTA8g99fpgtGF3s/SMHAhUxx2A==
X-Received: by 2002:a17:907:e266:b0:a7d:c46b:2241 with SMTP id a640c23a62f3a-a8392950874mr242149166b.29.1723814202901;
        Fri, 16 Aug 2024 06:16:42 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Fri, 16 Aug 2024 14:16:40 +0100
Message-Id: <D3HD4V65CEC4.L5Z3L6Z056H4@cloud.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
 =?utf-8?q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, "Stefano
 Stabellini" <sstabellini@kernel.org>, "Jan Beulich" <jbeulich@suse.com>
Subject: Re: [XEN PATCH v2 1/5] x86/Kconfig: introduce CENTAUR, HYGON &
 SHANGHAI config options
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Sergiy Kibrik" <Sergiy_Kibrik@epam.com>,
 <xen-devel@lists.xenproject.org>
X-Mailer: aerc 0.17.0
References: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
 <2a217c9602e92f92050cb4894bb9a42ee99a84ea.1723806405.git.Sergiy_Kibrik@epam.com>
In-Reply-To: <2a217c9602e92f92050cb4894bb9a42ee99a84ea.1723806405.git.Sergiy_Kibrik@epam.com>

On Fri Aug 16, 2024 at 12:10 PM BST, Sergiy Kibrik wrote:
> These options aim to represent what's currently supported by Xen, and lat=
er
> to allow tuning for specific platform(s) only.
>
> HYGON and SHANGHAI options depend on AMD and INTEL as there're build
> dependencies on support code for AMD and Intel CPUs respectively.
>
> Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
> CC: Alejandro Vallejo <alejandro.vallejo@cloud.com>
> CC: Jan Beulich <jbeulich@suse.com>
> ---
>  xen/arch/x86/Kconfig.cpu  | 29 +++++++++++++++++++++++++++++
>  xen/arch/x86/cpu/Makefile |  6 +++---
>  xen/arch/x86/cpu/common.c |  6 ++++++
>  3 files changed, 38 insertions(+), 3 deletions(-)
>
> diff --git a/xen/arch/x86/Kconfig.cpu b/xen/arch/x86/Kconfig.cpu
> index 5fb18db1aa..ac8f41d464 100644
> --- a/xen/arch/x86/Kconfig.cpu
> +++ b/xen/arch/x86/Kconfig.cpu
> @@ -10,6 +10,25 @@ config AMD
>  	  May be turned off in builds targetting other vendors.  Otherwise,
>  	  must be enabled for Xen to work suitably on AMD platforms.
> =20
> +config CENTAUR
> +	bool "Support Centaur CPUs"
> +	default y
> +	help
> +	  Detection, tunings and quirks for VIA platforms.
> +
> +	  May be turned off in builds targeting other vendors. Otherwise, must
> +          be enabled for Xen to work suitably on VIA platforms.
> +
> +config HYGON
> +	bool "Support Hygon CPUs"
> +	depends on AMD
> +	default y
> +	help
> +	  Detection, tunings and quirks for Hygon platforms.
> +
> +	  May be turned off in builds targeting other vendors. Otherwise, must
> +          be enabled for Xen to work suitably on Hygon platforms.
> +
>  config INTEL
>  	bool "Support Intel CPUs"
>  	default y
> @@ -19,4 +38,14 @@ config INTEL
>  	  May be turned off in builds targetting other vendors.  Otherwise,
>  	  must be enabled for Xen to work suitably on Intel platforms.
> =20
> +config SHANGHAI
> +	bool "Support Shanghai CPUs"
> +	depends on INTEL
> +	default y
> +	help
> +	  Detection, tunings and quirks for Zhaoxin platforms.
> +
> +	  May be turned off in builds targeting other vendors. Otherwise, must
> +          be enabled for Xen to work suitably on Zhaoxin platforms.
> +
>  endmenu
> diff --git a/xen/arch/x86/cpu/Makefile b/xen/arch/x86/cpu/Makefile
> index eafce5f204..80739d0256 100644
> --- a/xen/arch/x86/cpu/Makefile
> +++ b/xen/arch/x86/cpu/Makefile
> @@ -3,13 +3,13 @@ obj-y +=3D microcode/
>  obj-y +=3D mtrr/
> =20
>  obj-y +=3D amd.o
> -obj-y +=3D centaur.o
> +obj-$(CONFIG_CENTAUR) +=3D centaur.o
>  obj-y +=3D common.o
> -obj-y +=3D hygon.o
> +obj-$(CONFIG_HYGON) +=3D hygon.o
>  obj-y +=3D intel.o
>  obj-y +=3D intel_cacheinfo.o
>  obj-y +=3D mwait-idle.o
> -obj-y +=3D shanghai.o
> +obj-$(CONFIG_SHANGHAI) +=3D shanghai.o
>  obj-y +=3D vpmu.o
>  obj-$(CONFIG_AMD) +=3D vpmu_amd.o
>  obj-$(CONFIG_INTEL) +=3D vpmu_intel.o
> diff --git a/xen/arch/x86/cpu/common.c b/xen/arch/x86/cpu/common.c
> index ff4cd22897..dcc2753212 100644
> --- a/xen/arch/x86/cpu/common.c
> +++ b/xen/arch/x86/cpu/common.c
> @@ -339,9 +339,15 @@ void __init early_cpu_init(bool verbose)
>  	case X86_VENDOR_INTEL:    intel_unlock_cpuid_leaves(c);
>  				  actual_cpu =3D intel_cpu_dev;    break;
>  	case X86_VENDOR_AMD:      actual_cpu =3D amd_cpu_dev;      break;
> +#ifdef CONFIG_CENTAUR
>  	case X86_VENDOR_CENTAUR:  actual_cpu =3D centaur_cpu_dev;  break;
> +#endif
> +#ifdef CONFIG_SHANGHAI
>  	case X86_VENDOR_SHANGHAI: actual_cpu =3D shanghai_cpu_dev; break;
> +#endif
> +#ifdef CONFIG_HYGON
>  	case X86_VENDOR_HYGON:    actual_cpu =3D hygon_cpu_dev;    break;
> +#endif
>  	default:
>  		actual_cpu =3D default_cpu;
>  		if (!verbose)

Reviewed-by: Alejandro Vallejo <alejandro.vallejo@cloud.com>

Cheers,
Alejandro


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 14:26:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 14:26:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778644.1188681 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sexu3-0002LD-EN; Fri, 16 Aug 2024 14:26:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778644.1188681; Fri, 16 Aug 2024 14:26:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sexu3-0002L6-BK; Fri, 16 Aug 2024 14:26:07 +0000
Received: by outflank-mailman (input) for mailman id 778644;
 Fri, 16 Aug 2024 14:26:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=sI+L=PP=cloud.com=kelly.choi@srs-se1.protection.inumbo.net>)
 id 1sexu1-0002Kw-Fc
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 14:26:05 +0000
Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com
 [2a00:1450:4864:20::635])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 76e41a6f-5bdb-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 16:26:02 +0200 (CEST)
Received: by mail-ej1-x635.google.com with SMTP id
 a640c23a62f3a-a7a9a369055so235741766b.3
 for <xen-devel@lists.xenproject.org>; Fri, 16 Aug 2024 07:26:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 76e41a6f-5bdb-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723818361; x=1724423161; darn=lists.xenproject.org;
        h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject
         :date:message-id:reply-to;
        bh=Xbi7dqEqdd2u3TwxekB4Gc0/AJ4Lwz6c08gnuwlOWKE=;
        b=ZsgCxBxVSwax6IMLL6HzMnHakiKRaDULHEVwGQlRyD0HbMGKjTA9YURV6O1BLGyN53
         G6wBu99jfNlmTy0nOcfvaQ2Q+X69Y3ZrvWLz0MnYamLQw4YNhQjNOVT9Ix3B3H5cDysv
         JnusD1NpX6mVuUD5BOCGHE02vwnHJL4wbM29o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723818361; x=1724423161;
        h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=Xbi7dqEqdd2u3TwxekB4Gc0/AJ4Lwz6c08gnuwlOWKE=;
        b=arL1lFaKHo/bZq3UJREBii4gLUYHz31wfudh5B6N2MiKUAUEknQWtWGdTvSRzMLeyw
         sSwaL6f2UtqNuLA/tiYklrzYNU9pvSe3eZQ3EMgc0yoKOEZUT9bGfBWIM1lQX83NM2Zc
         V3SUzXJGsXJ3Ng1h98mZKCChrePl5OZi3UEY5VgLE/YPPS7cFxYSOpaqXu6s7YyfifZG
         an0BDdufPa6ERPsE6dRIBBv2iN1QnJXi4lkVKGZUZTENXqnavgByguLpFnFByNFx9bJx
         n9k8XYsmHuKErKN9HMgfz6oWzk3T+z++enZX5m/YBkxaQWroiUlPjy/hTm8VQK/phU6Y
         BPTA==
X-Gm-Message-State: AOJu0YxUEqacQmfxmYtd05uepfqH3HWts10snaVpzOo3t6509UX1jz3B
	AGhLfpSgH0gJp2EG4kLtRg082JqicxNlfctqzEyd7YWckvod/DhWwNl/BqHIQGVonh8Gv62ADNj
	DucFXaiIlH8lbijlskpaedIHWKQrYElsU6IMjL+Ac8VQKA/MyYTw=
X-Google-Smtp-Source: AGHT+IH8jcgWbPryZHcOIGi7Gvc3xZzN+vKDxWduQ3fF4PAl8wIJO4RWG+A3oXn/zd9VGwycpvBGQF+aDBwlGLQgvTY=
X-Received: by 2002:a17:906:d54c:b0:a7d:e956:ad51 with SMTP id
 a640c23a62f3a-a839293010dmr255650066b.21.1723818360963; Fri, 16 Aug 2024
 07:26:00 -0700 (PDT)
MIME-Version: 1.0
From: Kelly Choi <kelly.choi@cloud.com>
Date: Fri, 16 Aug 2024 15:25:25 +0100
Message-ID: <CAO-mL=zWYsDGkBoDtc8erGfAFnaR1y+FaLKsx3pEJ3MgxKAy0Q@mail.gmail.com>
Subject: Xen Project statistics help
To: xen-devel <xen-devel@lists.xenproject.org>
Cc: committers@xenproject.org
Content-Type: multipart/alternative; boundary="000000000000102deb061fcdbd20"

--000000000000102deb061fcdbd20
Content-Type: text/plain; charset="UTF-8"

Hi all,

I'm looking for a way to gather some statistics around our project, that
would help monitor the health of the community and show our progress so
far.

AFAIK, there used to be a dashboard on https://xen.biterg.io/ (
https://wiki.xenproject.org/wiki/Code_Review_Dashboard) which no longer
exists.

Examples of monthly data required:

   - Number of commits, reviews, authors, etc per month/release
   - Number of contributions per individual and company (we'd need to do
   some mapping of names for those with multiple email addresses)
   - Data to help identify imbalances between reviewers and contributors
   - Number of emails on xen-devel

Linux Foundation does have a dashboard
<https://insights.lfx.linuxfoundation.org/> that we're not set up on yet,
but I'm looking at possibilities to see if we can.

If there is an automated process or script that someone has or would be
able to create, that would be hugely beneficial. Open to other ideas here
too.

Many thanks,
Kelly Choi

Community Manager
Xen Project

--000000000000102deb061fcdbd20
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi all,<div><br></div><div>I&#39;m looking for a way to ga=
ther some statistics around our project, that would help monitor the health=
 of the community and show our progress so far.=C2=A0</div><div><br></div><=
div>AFAIK, there used to be a dashboard on=C2=A0<a href=3D"https://xen.bite=
rg.io/">https://xen.biterg.io/</a> (<a href=3D"https://wiki.xenproject.org/=
wiki/Code_Review_Dashboard">https://wiki.xenproject.org/wiki/Code_Review_Da=
shboard</a>) which no longer exists.=C2=A0</div><div><br></div><div>Example=
s of monthly data required:</div><div><ul><li>Number of commits, reviews, a=
uthors, etc per month/release</li><li>Number of contributions per individua=
l and company (we&#39;d need to do some mapping of names for those with mul=
tiple email addresses)</li><li>Data to help identify imbalances between rev=
iewers and contributors</li><li>Number of emails on xen-devel</li></ul><div=
>Linux Foundation does have a <a href=3D"https://insights.lfx.linuxfoundati=
on.org/">dashboard</a>=C2=A0that we&#39;re not set up on yet, but I&#39;m l=
ooking at possibilities to see if we can.</div><div><br></div><div>If there=
 is an automated process or script that=C2=A0someone has or would be able t=
o create, that would be hugely beneficial. Open to other ideas here too.=C2=
=A0</div><div><br></div><div><div dir=3D"ltr" class=3D"gmail_signature" dat=
a-smartmail=3D"gmail_signature"><div dir=3D"ltr"><div>Many thanks,</div><di=
v>Kelly Choi</div><div><br></div><div><div style=3D"color:rgb(136,136,136)"=
>Community Manager</div><div style=3D"color:rgb(136,136,136)">Xen Project=
=C2=A0<br></div></div></div></div></div></div></div>

--000000000000102deb061fcdbd20--


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 16:01:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 16:01:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778673.1188692 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sezO5-0001c4-Vj; Fri, 16 Aug 2024 16:01:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778673.1188692; Fri, 16 Aug 2024 16:01:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sezO5-0001bx-SI; Fri, 16 Aug 2024 16:01:13 +0000
Received: by outflank-mailman (input) for mailman id 778673;
 Fri, 16 Aug 2024 16:01:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mcFh=PP=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sezO4-0001br-IX
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 16:01:12 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on20611.outbound.protection.outlook.com
 [2a01:111:f403:2415::611])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bee23389-5be8-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 18:01:07 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by MW3PR12MB4377.namprd12.prod.outlook.com (2603:10b6:303:55::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19; Fri, 16 Aug
 2024 16:01:03 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7875.018; Fri, 16 Aug 2024
 16:01:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bee23389-5be8-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=gue+l80SKepldVdFtOkjLspbrWdiKLBMGO88Z1Pz5K7k68BxwPP2LvesRqgiJ1qZK7lkEm6izRziid2WkezJZDrJVIfDyCu4LO+N9w6UcTUv/fVZw2hzhu09oukj6PCXJsWPi0bmNeVYF0bb130rSH2ZuMFeCO/mdGNafrXfwwnLChiDrIPnF2VY4Ma1zeSjO8gRtqcRty/3IWLvOpNQzxks5mnOuPFVmDWrJynvMFu7/UQMJur6RpIKYKAMYJ26ltzg+5D5jaBvDksOUdSnKfl4JXeSsPNnpvDhKqimfhVC+L8kCazPB28/eLHSgS+pSkJgeyMBLP3kNqzBTPkhjw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3SHU9WNyOkSYSpHfKUEpB0REoIKC3j2WHA2NzXdmE/Q=;
 b=DpZNr26FWMZfxGZNQsgN/bP38MX1lCRemkbemAghyDPmqSpNQHq5aRuQ31yTH0Z3Jx6mP+vx4AEC6KP6JsocM6Kav3MOdn0i2AUnDxs3ZuqvIebnm4clMpHNjoE4+RSwM/z3wUHv3ZLIGkWTLjuKXf7Amf1X1t0KIbCONIboM7vGYjKduy0+e9a8KSFsOchY/nc3UaaBzyvPW6cH0vRDJw2Y7HnqDQUmAuG/8vOJJN3+qxQC0V9+tCV+xCqwbOtSOmbJajHOVKNYByV2V2h8++ESN2gPIz6oM5fD3odfSjhmWht10JGFV6S5aSEQu/xPs8GemZfWbjIYk8PttwQlwA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3SHU9WNyOkSYSpHfKUEpB0REoIKC3j2WHA2NzXdmE/Q=;
 b=Kw7E0vfkRhKzCNddzHDr38nfFVyluAZQGHsl0AYrxhYYf7EI2OL9LqLAsm6TsNBnW+Vr1dhWX8Pcnn0gY5Cgvr6EMsQXENncGjoQjRV+L+RSYXJ3vD4NNwoLVN8bgX16pO2PZeP99jNAvLoQuGI8BbUcBLdsTqoW5Vl1G8dGnC8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <12e89d43-09bd-45de-9f44-80819ccaab18@amd.com>
Date: Fri, 16 Aug 2024 17:00:57 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
To: Michal Orzel <michal.orzel@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, Volodymyr_Babchuk@epam.com, julien@xen.org
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
 <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
 <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
 <dad27ab7-3cbd-4a8e-8200-adea52b26e55@suse.com>
 <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
 <03682a1f-f4d1-4d07-ba86-8e9fc6ed044c@amd.com>
Content-Language: en-GB
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <03682a1f-f4d1-4d07-ba86-8e9fc6ed044c@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P265CA0220.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:33a::18) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|MW3PR12MB4377:EE_
X-MS-Office365-Filtering-Correlation-Id: 4ea34b6f-5611-48c7-59b2-08dcbe0ca11e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?QzY2Z0NqcVVKSzR0RFI2a1pJL0dncmtyY1ljZytTenduM2lPYXd0UlVENm5H?=
 =?utf-8?B?RGUyblZTV2pka1RsZ0pNaUNVQnppcnUrUUsreGQyUWM5NDNjWlMyTHllZERu?=
 =?utf-8?B?Y0V5Si9EY1U5N1JNTlZIZmlSL0MxTmlBZHhKR1NoOTZvT0ZHRlJHVGM3QzUv?=
 =?utf-8?B?QWhDMG9iNUVwdExwMmVHbWNUUG9qaGlKc0w4OFQxZWtySVlscXRxaURuYm1j?=
 =?utf-8?B?aHpEcUZXb2JJa1kxdUlsMlY0S2VYY3JVeDFRTzFJMUFrTWdqeCtPK0ppdlZK?=
 =?utf-8?B?cHNidFF3Zy9oM25NUnNQcWlERzZSTFQvR2paeFBzUUpuZDlOMjYzMUpLSlI2?=
 =?utf-8?B?ckVoZEpZQjc0SVdBdUlUM3gwWE10bE1GY09XR0YvMW5oTHdGdWc0c2JBaXVJ?=
 =?utf-8?B?MmZkU3RRcUxKenBGQ0FmcE5NWVBKUUhxNXdzUEM0ZjlRTXY1SysyOVpBdUZK?=
 =?utf-8?B?VTBlYnV4ZXZDZmRCTlY4MjE5ZXBvZWcvWStWUGMyVGR1T242eGdxdWh3ZTcr?=
 =?utf-8?B?MmRpUTUyWVpRMEM1WEt6dzJLeEhISzRqenhrT2pwbHgyNElCajFnTE9VS0pn?=
 =?utf-8?B?clBEK09TWUQvSFVxeC9KZk56bXM3ek02NFRvUGNFMU1yNnk2K2VrMitqMjhW?=
 =?utf-8?B?Zk9BWGF6SE1LV0w5UGpqZ0V4ajlXbjdkZDFjRk5vVzJUVUxhbFdFNy9Bd2dE?=
 =?utf-8?B?L2xOMmNGbTE4Nm5SaU50ZmpCSTY5Z1RQdmV2SDB5eGxZN2w5VGpSRloxdWVJ?=
 =?utf-8?B?WlA3QVdTZGM0dmdESXVqNk0zQk04M3lBSnVacERRQ1VUZWp6M3hHMjZlblFm?=
 =?utf-8?B?V08xRVByeDZGNTFxQ2JoL25FeE43M0NXTlZQeGxLMWxlY2FNMXV5aHVpZEhJ?=
 =?utf-8?B?RHBObmx6UlVwVi92dnNXc0UvYmlMTEphejJxcmhBc3l5Y3FUK29XN0Z0ZVVx?=
 =?utf-8?B?bE0yYi9kYnpsSVhnREVLT1I2ZnNzdVFYZnozaHEydkFwN0J3aUIrdDhRQzRE?=
 =?utf-8?B?VGo0ek5GbjJJUFZRL3ZKVURKeFJBYWs4d0E1UWZmK1hSaTd2L0dqSmNpdm9F?=
 =?utf-8?B?TEN6clRPVkpKUDRUM1dOYkdLY1dMTTNRSUtzSURuREtDaW9aTzBxUG12U201?=
 =?utf-8?B?VDBLUU1WOFZuTkNNeDNUSGNUeEQ5VmFoVDBLU21VOGV5S1JpTXA4MEkxa2l3?=
 =?utf-8?B?YkIvNmxLVnNoUGd2emV1RjV1d0M4OUZTL2duUzBTOTZqelZTdU1jbmhhWWdR?=
 =?utf-8?B?ckdPR0NrUWJjelY5SW5vZHI5eTdGekFkR3hoZTZNbXNzYWdRNEVBWFlwbmMw?=
 =?utf-8?B?M2xIS0NSNnhDUmgzRUc2VnFwcUVQRy8yT1FQZlZMMjBFamNOTVdqUnlTemUv?=
 =?utf-8?B?cVZETFNWRHVXdFNGZmFnWGpBUVdHWU9wSEZmcXNSQXExOXJ2elRXQXhOeXlr?=
 =?utf-8?B?NzduS09RV1R0K29DZWIveWhDQlpkL2lmMkpPaCtNY0ppUHhsVWFSWkhUdWFN?=
 =?utf-8?B?dnRSME12c2xTU0JQOG5RTG5ELzNMelJDN0F2K1JESUZLWEU4R29pV2pGTzVm?=
 =?utf-8?B?QU9JdW9NVzRrVi9vRmNmamN6Q2dFMVhuOEhIbWd1SW5jR1JSRjJmV2dya0FC?=
 =?utf-8?B?L1BGNlBEM3hxUjd6dnROSVBKQ1hjK3pyVDlFNFF6ajRKZitDUjE4eHpxWS9N?=
 =?utf-8?B?T0F1MW4veEMyTnZ6L1JnVytXOHJDb1BLRCt6RE9XZzdzSkVUNzZJSno3cXp1?=
 =?utf-8?Q?3zbk1IjUi6NmFYG0Y4=3D?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?R2dPcDJoU21qL2hwNUpCZHhXRVZJNnBzNGJ5dFdjQml3WkxzUFEvbHNONllk?=
 =?utf-8?B?c1d5UGxHbGNFY1NIdmJZR2VRODJXdDE5clByU1N3VTdZSWJpOHF5M1k4d0p3?=
 =?utf-8?B?OVBCdDVDeDQwKzl0WS95ZEZPVlJXMkxEbEhQTXRmbUxOZTJRSWcwNC8rU3Er?=
 =?utf-8?B?MGh4Z2dzeVVLcmoxL3hzb3Y1bElxMXBvTDFwT1JoeURlcEpzdDhSMThZODlF?=
 =?utf-8?B?OU5vcDNnWnFXVHJEdHdwYmQwU0Ruc1NXcStqNlc2dFljbTRkb1pERWUyaU5F?=
 =?utf-8?B?TDM5Zlc4elNEY0JhTjNCeG9keWxMTmJobkluS0podTdxeS8zMnc5QVR0bDRI?=
 =?utf-8?B?eGk1M2RqM3RHOVhaUnQ1U3NzSUp3OWYyQy9zcmtBYXV2TmV6TTFUYWx6ME1v?=
 =?utf-8?B?TzhpRzNHVWhFbTNEOS9yMkNzanBNWndUMHlHZi9jdDhKT1B0ZVNCaTRCTGVG?=
 =?utf-8?B?M1NYak5jcjVuL3d0SFoxRlVUM2VWVTF5eVlxNmp3TDhxMVZLbUlxdVlZQUk5?=
 =?utf-8?B?cU1WZXdZeG9mZTc5dlZCZkZpQTd0clpDelUxaWFPMjZWWHEyR1hBUkttS2lO?=
 =?utf-8?B?eTFlUTdqYUZXVDVuZnZtZFl1MzhGWWQ1QU1oeTNoOXROVnBVa2VheC9NYTFS?=
 =?utf-8?B?ak4xSmNSQWVkeDJMaVJxMWI3SjdMeE0yeWlUN2RlMzdENjBkSzUvNTFxdU1Y?=
 =?utf-8?B?a3RZSmpmb1dQb2liek5hZk1tWUZuelJTUGY4SUNyUm9HRFRKTHFxTDRmQ1Vy?=
 =?utf-8?B?UmxTMTNaQXZUSDJlWmFLSmlWbmpBbXFPVTdTT1k5eVo1YkZOU0VLUitaRldw?=
 =?utf-8?B?VTYwck9kYk5sZVlaTXJNTnQvL0ZkbDRpQWxKdDd3V0xHQ0VRbHl6UHZQdG1m?=
 =?utf-8?B?dFlUcEptK3VnblVrOFZzZTFTYWZMOGw4NElMNzA2R1dYQUcvOTN2dzBFUnN2?=
 =?utf-8?B?cU9hL3gxamtkMEpDNVhtV1AwWnJMQnlLSEErc0FuRkRmdnlKMjdzK281M1k0?=
 =?utf-8?B?UGt2VkVBckZDMVNHNzV5UHk1RlQydU1RR0VMbWo0dFRyMTZTNER5dXBvNmpi?=
 =?utf-8?B?aGpUaFpiSTg5S0lpU09ocjJMQ1pYbEt1SnFNU0FsOUxMSzNDa3pwSXZsbzNu?=
 =?utf-8?B?WXkyYmdQZVVEYktxK3RNc0xOdlgrNjZ1YlV5c1ZpUHNiRXR4SnJrak1hNjd0?=
 =?utf-8?B?dnNZL1YxcE1oYVhHanEzaW4rRGpUcmovcWdROVUvaWpUdGU2THEza0hER2NU?=
 =?utf-8?B?cW5aR1pMVDFkTnExNU9PZkZSZEhreGxTZjNId0dGSXNnajFONUJ1RVdpZDhZ?=
 =?utf-8?B?NUpLUjZEQkluWjBBOGNDeDNHYTE4YU1ISmFWZ21RaldzOEV4Y0Y4TUx5RXc3?=
 =?utf-8?B?QW16T0dmd3hBSUFlOS9BOUFQd2M2bmpVd1VWTDZRMVJPSlc2alFva1RvSWVW?=
 =?utf-8?B?djBaRE1qRkxueXkxWkVzTFVPdzZ5dWZRa0tTM1ZYZVpTY05wVGRrS2o5WEhT?=
 =?utf-8?B?TjltaXlWa01nTmZ6TWx6RThzYkRHNXBLR2hrY3VtVldSeWl1WnRhQnEvMktI?=
 =?utf-8?B?aVFtOUNSdW4wMkJHcDErZm9nQ3h1NmNRWVdRc1ZVd2JlNUZiUUtTYVdCUTNP?=
 =?utf-8?B?RnY1ZDArSVNvWDlsSVRkZEQ5ZVBHaFVjYnQxYXQzaUZteUROTTcyOFFtN2ky?=
 =?utf-8?B?aVJDcGlxYWlLZXZ1Z3FndkdreGgrM1R2b29mTjRyZUx1VHhHOXAweFFnUm5G?=
 =?utf-8?B?VTNGQWlKNENZZ3ZTcy90QTZsUWQwNzltL3VmRWN3QjY3bEhaempRZW5HSlBs?=
 =?utf-8?B?MXczaGhFMG9ZeTBqR0RuZWQxSkZQQjRtQ1ZWVkJwbmU3cHZ3amR0WitiRGNs?=
 =?utf-8?B?MjdqUDBremt4YVdmSEZqd0w0eFR0b1VaVEdLMUFibk5QZExZcWYra1pBWlg0?=
 =?utf-8?B?UGRJelV5WndKdlhhNCszNE51MlF3NUNXQTJ5ZHpZOWVZTTUyekQzS2pwVEJi?=
 =?utf-8?B?dnk2WmRWbE4zd04wT0p4bk9PTk9jTDEzbktBcXJYTjk3QUxQMVFNbWVyMDNP?=
 =?utf-8?B?VlZMWVRwak5Sd2NtRUoxeWJRNnUxaThpa1d1clkydXlTUzZRL055VTNSVUEy?=
 =?utf-8?Q?5wU+sqLNG5CICA8iQ79hzDbAv?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4ea34b6f-5611-48c7-59b2-08dcbe0ca11e
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2024 16:01:03.3154
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: uyLVBiJqMdmdJOi9xzVevL7/rPlz8KGWLnoD3zFkI3CrPSBGvvjxPBZ/NxipFjfNeJM9EeWr72qaK79WfnQ+0w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4377


On 16/08/2024 10:28, Michal Orzel wrote:
> Hi Ayan,
Hi Michal,
>
> On 14/08/2024 14:33, Ayan Kumar Halder wrote:
>> Hi Jan,
>>
>> On 14/08/2024 12:35, Jan Beulich wrote:
>>> On 14.08.2024 12:55, Ayan Kumar Halder wrote:
>>>> Hi Jan,
>>>>
>>>> On 14/08/2024 07:37, Jan Beulich wrote:
>>>>> On 13.08.2024 19:13, Ayan Kumar Halder wrote:
>>>>>> From: Penny Zheng <penny.zheng@arm.com>
>>>>>>
>>>>>> Introduced CONFIG_VMAP which is selected by the architectures that use
>>>>>> MMU. vm_init() does not do anything if CONFIG_VMAP is not enabled.
>>>>>>
>>>>>> VMAP is widely used in ALTERNATIVE feature to remap a range of memory
>>>>>> with new memory attributes. Since this is highly dependent on virtual
>>>>>> address translation, we choose to fold VMAP in MMU system.
>>>>>>
>>>>>> In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
>>>>>> only support in MMU system on ARM architecture. And ALTERNATIVE now
>>>>>> depends on VMAP.
>>>>>>
>>>>>> HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP as speculative
>>>>>> attacks are not possible on non MMU based systems (ie Cortex-R52, R82).
>>>>>> See https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability.
>>>>> While I'm not an Arm expert and hence I'm likely missing aspects, I question
>>>>> the one (Spectre-BHB) vulnerability there to be sufficient to draw a
>>>>> conclusion towards the usefulness of branch hardening. I would advise
>>>>> against encoding such a connection in the Kconfig dependencies.
>>>> AFAIU, to address 'Spectre' like vulnerabilities 'branch hardening' was
>>>> added.
>>>>
>>>> See https://lore.kernel.org/all/E1fNadD-0000fz-9r@rmk-PC.armlinux.org.uk/
>>>>
>>>> And from
>>>> https://lists.linaro.org/archives/list/linux-stable-mirror@lists.linaro.org/message/F4MGL4WT2R7T54NLRDGKFRQNSXF3DZGD/
>>>>
>>>> Spectre is valid on MMU based systems.
>>> Since then various other issues / flavors were found. I've been focusing
>>> on the x86 side of things, but I'd be very surprised if some didn't
>>> affect other architectures as well.
>> We are talking about Arm here as "HARDEN_BRANCH_PREDICTOR" is specific
>> to Arm.
>>
>> https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability
>> covers all the flavours and it does not include Cortex-R82 or R52.
>>
>> It says the following :-
>>
>> "Cortex-R cores typically use a closed software stack. In those
>> environments, applications or processes are strictly controlled, and
>> therefore not exploitable"
>>
>>> Plus branch hardening can be a pre-
>>> cautionary measure, too, I think.
>> The first two Arm non MMU cores that we wish to support in the
>> forthcoming series is Cortex-R82 and R52.
>>
>> As seen in https://developer.arm.com/documentation/ka005109/latest/, it
>> explicitly states the following about R82
>>
>> The Cortex-R82 implements the faulting feature (FEAT_FPAC) but is not
>> vulnerable. The Cortex-R82 behaves differently than vulnerable A-class
>> CPUs when speculatively executing past an instruction that authenticates
>> PAC, and that behavior does not allow the attack software to create the
>> "oracle".
>>
>> We can re-enable branch hardening if we know there is a valid non MMU
>> Arm core which is vulnerable.
>>
>> Let me know if you are ok with the rationale.
> I'm ok with your rationale.
>
> I have one question for this patch. Why can't we use CONFIG_HAS_VMAP to conditionally compile vmap.c, like:
> obj-$(CONFIG_HAS_VMAP) += vmap.o
> and get rid of VMAP_VIRT_START guard on an entire file?
> With this config in place, it seems strange to use VMAP_VIRT_START as a guard.

I am fine with your suggestion.

However, this implies HAS_VMAP needs to be selected by "config PPC" as 
well (as it defines VMAP_VIRT_START in xen/arch/ppc/include/asm/config.h ).

This is fine as I could see PPC uses MMU as well.

- Ayan



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 16:17:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 16:17:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778685.1188702 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sezdb-0004FV-8U; Fri, 16 Aug 2024 16:17:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778685.1188702; Fri, 16 Aug 2024 16:17:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sezdb-0004FO-5u; Fri, 16 Aug 2024 16:17:15 +0000
Received: by outflank-mailman (input) for mailman id 778685;
 Fri, 16 Aug 2024 16:17:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sezda-0004Ev-2a; Fri, 16 Aug 2024 16:17:14 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sezdZ-0002VI-UI; Fri, 16 Aug 2024 16:17:13 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sezdZ-000418-Kx; Fri, 16 Aug 2024 16:17:13 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sezdZ-0001Xn-KP; Fri, 16 Aug 2024 16:17:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=lVL5eNazTi6iErScf58KnxzQShYPkRIMnNQFpeoLsgs=; b=Qlxj5S3EqPgSSUS0R2hknWVPP1
	zMY9ZYTSUBuG/XGYfV9CQFbbnJuieyEyPSUoF/kP33G+87Vrzl8+RhB9NyPRSEL7OBbyC3Pal0Ayq
	ZU1DnYXJFaTFrIVTjPOGaZKk+b5JOavErMybRawHJxIDriLBBzYCKkd7KF0OQpfLJ6Os=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187253-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187253: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=cbe73b848286f1e6b855c0ba328d56e0014d19e6
X-Osstest-Versions-That:
    xen=cbe73b848286f1e6b855c0ba328d56e0014d19e6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 16 Aug 2024 16:17:13 +0000

flight 187253 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187253/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187250
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187250
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187250
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187250
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187250
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187250
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  cbe73b848286f1e6b855c0ba328d56e0014d19e6
baseline version:
 xen                  cbe73b848286f1e6b855c0ba328d56e0014d19e6

Last test of basis   187253  2024-08-16 02:48:02 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 16:40:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 16:40:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778697.1188712 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sezzk-0000OV-4j; Fri, 16 Aug 2024 16:40:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778697.1188712; Fri, 16 Aug 2024 16:40:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sezzk-0000OO-1q; Fri, 16 Aug 2024 16:40:08 +0000
Received: by outflank-mailman (input) for mailman id 778697;
 Fri, 16 Aug 2024 16:40:07 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sezzj-0000OI-76
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 16:40:07 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sezzi-0002sS-Jx; Fri, 16 Aug 2024 16:40:06 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sezzi-0001ru-Bt; Fri, 16 Aug 2024 16:40:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=5MzqIK/eCn4E+CRib19EJGsAPzzCbbeOK8Ip3geiqTQ=; b=q5Os4PCwkWdvYE1htZu0/tC2Eq
	zVP8mWtIT8VRZNWRYqi20Yhec5OV2CgBQq2462k/63xH6noV1cjUuDPF86uHl0IqVfqdszBR5IT9L
	QTIcar1NRWjMdRt9oxPcu0MEqpDB2EmA8EdPjNDXjIEbYDmRcxYlIjcIpL+JSIo8V/YY=;
Message-ID: <9fd1801c-1460-44e5-b066-f6da1167543b@xen.org>
Date: Fri, 16 Aug 2024 17:40:04 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
Content-Language: en-GB
To: Ayan Kumar Halder <ayankuma@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
 <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
 <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
 <dad27ab7-3cbd-4a8e-8200-adea52b26e55@suse.com>
 <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Ayan,

On 14/08/2024 13:33, Ayan Kumar Halder wrote:
> Hi Jan,
> 
> On 14/08/2024 12:35, Jan Beulich wrote:
>> On 14.08.2024 12:55, Ayan Kumar Halder wrote:
>>> Hi Jan,
>>>
>>> On 14/08/2024 07:37, Jan Beulich wrote:
>>>> On 13.08.2024 19:13, Ayan Kumar Halder wrote:
>>>>> From: Penny Zheng <penny.zheng@arm.com>
>>>>>
>>>>> Introduced CONFIG_VMAP which is selected by the architectures that use
>>>>> MMU. vm_init() does not do anything if CONFIG_VMAP is not enabled.
>>>>>
>>>>> VMAP is widely used in ALTERNATIVE feature to remap a range of memory
>>>>> with new memory attributes. Since this is highly dependent on virtual
>>>>> address translation, we choose to fold VMAP in MMU system.
>>>>>
>>>>> In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
>>>>> only support in MMU system on ARM architecture. And ALTERNATIVE now
>>>>> depends on VMAP.
>>>>>
>>>>> HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP as speculative
>>>>> attacks are not possible on non MMU based systems (ie Cortex-R52, 
>>>>> R82).
>>>>> See https://developer.arm.com/Arm%20Security%20Center/ 
>>>>> Speculative%20Processor%20Vulnerability.
>>>> While I'm not an Arm expert and hence I'm likely missing aspects, I 
>>>> question
>>>> the one (Spectre-BHB) vulnerability there to be sufficient to draw a
>>>> conclusion towards the usefulness of branch hardening. I would advise
>>>> against encoding such a connection in the Kconfig dependencies.
>>> AFAIU, to address 'Spectre' like vulnerabilities 'branch hardening' was
>>> added.
>>>
>>> See https://lore.kernel.org/all/E1fNadD-0000fz-9r@rmk- 
>>> PC.armlinux.org.uk/
>>>
>>> And from
>>> https://lists.linaro.org/archives/list/linux-stable- 
>>> mirror@lists.linaro.org/message/F4MGL4WT2R7T54NLRDGKFRQNSXF3DZGD/
>>>
>>> Spectre is valid on MMU based systems.
>> Since then various other issues / flavors were found. I've been focusing
>> on the x86 side of things, but I'd be very surprised if some didn't
>> affect other architectures as well.
> 
> We are talking about Arm here as "HARDEN_BRANCH_PREDICTOR" is specific 
> to Arm.
> 
> https://developer.arm.com/Arm%20Security%20Center/ 
> Speculative%20Processor%20Vulnerability covers all the flavours and it 
> does not include Cortex-R82 or R52.
> 
> It says the following :-
> 
> "Cortex-R cores typically use a closed software stack. In those 
> environments, applications or processes are strictly controlled, and 
> therefore not exploitable"
> 
>> Plus branch hardening can be a pre-
>> cautionary measure, too, I think.
> 
> The first two Arm non MMU cores that we wish to support in the 
> forthcoming series is Cortex-R82 and R52.
> 
> As seen in https://developer.arm.com/documentation/ka005109/latest/, it 
> explicitly states the following about R82
> 
> The Cortex-R82 implements the faulting feature (FEAT_FPAC) but is not 
> vulnerable. The Cortex-R82 behaves differently than vulnerable A-class 
> CPUs when speculatively executing past an instruction that authenticates 
> PAC, and that behavior does not allow the attack software to create the 
> "oracle".

I am confused. This is describing why R82 is not affected by PACMAN. But 
the Kconfig HARDEN_BRANCH_PREDICTOR is not for that (Xen doesn't yet use 
Pointer Authentification Codes). The Kconfig was introduced with XSA-254 
which predates PACMAN by nearly 4 years.

> 
> We can re-enable branch hardening if we know there is a valid non MMU 
> Arm core which is vulnerable.

Re-quoting what you wrote earlier:

"Cortex-R cores typically use a closed software stack. In those
environments, applications or processes are strictly controlled, and
therefore not exploitable"

It is quite subtle. This wording doesn't imply the cores are not 
vulnerable. It says that if they are, then it would be difficult to 
exploit because the software should be tightly controlled.

Now this would be really up to the user to decide whether they want to 
be extra cautious/futureproof or not.

As we are at the beginning of the MPU support, then I don't think we 
need to resolve issue right now. And it would be fine to gate it. But 
maybe ARCH_VMAP was an incorrect suggestion. It might be better to gate 
with the !MMU (IIRC this would imply MPU).

But before the feature can be marked as security support. We will need 
to agree on how the hypervisor is intended to be used on ARMv8-R. Maybe 
it would need a caveat "only trusted software can be run" which means we 
don't have to worry about speculation on Cortex-R. Although, it would be 
nice to have some defense in-depth :).

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Fri Aug 16 16:53:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 16:53:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778705.1188723 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf0Cs-0002Xf-85; Fri, 16 Aug 2024 16:53:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778705.1188723; Fri, 16 Aug 2024 16:53:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf0Cs-0002XY-3h; Fri, 16 Aug 2024 16:53:42 +0000
Received: by outflank-mailman (input) for mailman id 778705;
 Fri, 16 Aug 2024 16:53:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7RMc=PP=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sf0Cq-0002XQ-H3
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 16:53:40 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 156a48a5-5bf0-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 18:53:39 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 6258462117;
 Fri, 16 Aug 2024 16:53:37 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DDCFC32782;
 Fri, 16 Aug 2024 16:53:35 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 156a48a5-5bf0-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723827217;
	bh=05FqKFiDp1obCU8IVAX68BZqgenFk4qV0Beo1Yu69iI=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=k/LHvJhpaspNwG/e3/BBfVQljbSO8JQivzWeF4Uxz45RMPAEC9E3KvFr+YNcCfmZ5
	 WryYmXyz3cN3Lp4NW/tJjAK2W45HAYHTN5ayPNkXp56F9Lgs/1CJFoxOlgupGgU8q2
	 7tL+jGtoY8p/CHy36L5B7d3FgExilUr587zCy8j2sXeAtD+3rvRXve4M+M81TiZCbp
	 lr7ZNXO6JzvYELT2B4q5HHnKocwAxiER/oo8IT/VwD+Phl5/XdnUAXI0AeuDgMxO/2
	 1gzKn2T8HN/HMU4MB/rRNbcba14q1TCcxZJ801HM6NLlYy+3N7KRMCOnS/2pMdXJrs
	 9citVOSJqzZuA==
Date: Fri, 16 Aug 2024 09:53:34 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: Stefano Stabellini <sstabellini@kernel.org>, qemu-devel@nongnu.org, 
    anthony@xenproject.org, paul@xen.org, peter.maydell@linaro.org, 
    alex.bennee@linaro.org, xenia.ragiadakou@amd.com, jason.andryuk@amd.com, 
    edgar.iglesias@amd.com, xen-devel@lists.xenproject.org, 
    qemu-arm@nongnu.org, andrew.cooper3@citrix.com
Subject: Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests
In-Reply-To: <CAJy5ezrUbGZCaF=HiYhyLCoXRL3d=t-QbmLeKvu7ByWksV888g@mail.gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408160949320.298534@ubuntu-linux-20-04-desktop>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com> <20240812130606.90410-5-edgar.iglesias@gmail.com> <alpine.DEB.2.22.394.2408121650590.298534@ubuntu-linux-20-04-desktop> <ZruRm34zIMtUm7oH@zapote> <alpine.DEB.2.22.394.2408131550080.298534@ubuntu-linux-20-04-desktop>
 <ZryZwOoadeb1UWK8@zapote> <alpine.DEB.2.22.394.2408141719400.298534@ubuntu-linux-20-04-desktop> <CAJy5ezrUbGZCaF=HiYhyLCoXRL3d=t-QbmLeKvu7ByWksV888g@mail.gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-1147340740-1723827217=:298534"

  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-1147340740-1723827217=:298534
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

On Fri, 16 Aug 2024, Edgar E. Iglesias wrote:
> On Thu, Aug 15, 2024 at 2:30 AM Stefano Stabellini <sstabellini@kernel.org> wrote:
>       On Wed, 14 Aug 2024, Edgar E. Iglesias wrote:
>       > On Tue, Aug 13, 2024 at 03:52:32PM -0700, Stefano Stabellini wrote:
>       > > On Tue, 13 Aug 2024, Edgar E. Iglesias wrote:
>       > > > On Mon, Aug 12, 2024 at 06:47:17PM -0700, Stefano Stabellini wrote:
>       > > > > On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
>       > > > > > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
>       > > > > >
>       > > > > > Add SMP support for Xen PVH ARM guests. Create max_cpus ioreq
>       > > > > > servers to handle hotplug.
>       > > > > >
>       > > > > > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
>       > > > > > ---
>       > > > > >  hw/arm/xen_arm.c | 5 +++--
>       > > > > >  1 file changed, 3 insertions(+), 2 deletions(-)
>       > > > > >
>       > > > > > diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
>       > > > > > index 5f75cc3779..ef8315969c 100644
>       > > > > > --- a/hw/arm/xen_arm.c
>       > > > > > +++ b/hw/arm/xen_arm.c
>       > > > > > @@ -173,7 +173,7 @@ static void xen_arm_init(MachineState *machine)
>       > > > > > 
>       > > > > >      xen_init_ram(machine);
>       > > > > > 
>       > > > > > -    xen_register_ioreq(xam->state, machine->smp.cpus, &xen_memory_listener);
>       > > > > > +    xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener);
>       > > > > > 
>       > > > > >      xen_create_virtio_mmio_devices(xam);
>       > > > > > 
>       > > > > > @@ -218,7 +218,8 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
>       > > > > >      MachineClass *mc = MACHINE_CLASS(oc);
>       > > > > >      mc->desc = "Xen PVH ARM machine";
>       > > > > >      mc->init = xen_arm_init;
>       > > > > > -    mc->max_cpus = 1;
>       > > > > > +    /* MAX number of vcpus supported by Xen.  */
>       > > > > > +    mc->max_cpus = GUEST_MAX_VCPUS;
>       > > > >
>       > > > > Will this cause allocations of data structures with 128 elements?
>       > > > > Looking at hw/xen/xen-hvm-common.c:xen_do_ioreq_register it seems
>       > > > > possible? Or hw/xen/xen-hvm-common.c:xen_do_ioreq_register is called
>       > > >
>       > > > Yes, in theory there's probably overhead with this but as you correctly
>       > > > noted below, a PVH aware xl will set the max_cpus option to a lower value.
>       > > >
>       > > > With a non-pvh aware xl, I was a little worried about the overhead
>       > > > but I couldn't see any visible slow-down on ARM neither in boot or in network
>       > > > performance (I didn't run very sophisticated benchmarks).
>       > > 
>       > > What do you mean by "non-pvh aware xl"? All useful versions of xl
>       > > support pvh?
>       >
>       >
>       > I mean an xl without our PVH patches merged.
>       > xl in upstream doesn't know much about PVH yet.
>       > Even for ARM, we're still carrying significant patches in our tree.
> 
>       Oh I see. In that case, I don't think we need to support "non-pvh aware xl".
> 
> 
>       > > > > later on with the precise vCPU value which should be provided to QEMU
>       > > > > via the -smp command line option
>       > > > > (tools/libs/light/libxl_dm.c:libxl__build_device_model_args_new)?
>       > > >
>       > > > Yes, a pvh aware xl will for example pass -smp 2,maxcpus=4 based on
>       > > > values from the xl.cfg. If the user doesn't set maxvcpus in xl.cfg, xl
>       > > > will set maxvcpus to the same value as vcpus.
>       > >
>       > > OK good. In that case if this is just an initial value meant to be
>       > > overwritten, I think it is best to keep it as 1.
>       >
>       > Sorry but that won't work. I think the confusion here may be that
>       > it's easy to mix up mc->max_cpus and machine->smp.max_cpus, these are
>       > not the same. They have different purposes.
>       >
>       > I'll try to clarify the 3 values in play.
>       >
>       > machine-smp.cpus:
>       > Number of guest vcpus active at boot.
>       > Passed to QEMU via the -smp command-line option.
>       > We don't use this value in QEMU's ARM PVH machines.
>       >
>       > machine->smp.max_cpus:
>       > Max number of vcpus that the guest can use (equal or larger than machine-smp.cpus).
>       > Will be set by xl via the "-smp X,maxcpus=Y" command-line option to QEMU.
>       > Taken from maxvcpus from xl.cfg, same as XEN_DMOP_nr_vcpus.
>       > This is what we use for xen_register_ioreq().
>       >
>       > mc->max_cpus:
>       > Absolute MAX in QEMU used to cap the -smp command-line options.
>       > If xl tries to set -smp (machine->smp.max_cpus) larger than this, QEMU will bail out.
>       > Used to setup xen_register_ioreq() ONLY if -smp maxcpus was NOT set (i.e by a non PVH aware xl).
>       > Cannot be 1 because that would limit QEMU to MAX 1 vcpu.
>       >
>       > I guess we could set mc->max_cpus to what XEN_DMOP_nr_vcpus returns but I'll
>       > have to check if we can even issue that hypercall this early in QEMU since
>       > mc->max_cpus is setup before we even parse the machine options. We may
>       > not yet know what domid we're attaching to yet.
> 
>       If mc->max_cpus is the absolute max and it will not be used if -smp is
>       passed to QEMU, then I think it is OK to use GUEST_MAX_VCPUS
> 
> Looking at this a little more. If users (xl) don't pass an -smp option we actually default to smp.max_cpus=1.
> So, another option is to simply remove the upper limit in QEMU (e.g we can set mc->max_cpus to something very large like UINT32_MAX).
> That would avoid early hypercalls, avoid using GUEST_MAX_VCPUS and always let xl dictate the max_cpus value using the -smp cmdline option. 

As the expectation is that there will be always a smp.max_cpus option
passed to QEMU, I would avoid an extra early hypercall.

For the initial value, I would use something static and large, but not
unreasonably large as UINT32_MAX to be more resilient in (erroneous)
cases where smp.max_cpus is not passed.

So I would initialize it to GUEST_MAX_VCPUS, or if we don't want to use
GUEST_MAX_VCPUS, something equivalent in the 64-256 range.

Alternative we can have a runtime check and exit with a warning if
smp.max_cpus is not set.
--8323329-1147340740-1723827217=:298534--


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 18:03:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 18:03:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778722.1188732 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf1Hw-0005X6-TI; Fri, 16 Aug 2024 18:03:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778722.1188732; Fri, 16 Aug 2024 18:03:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf1Hw-0005Wz-QD; Fri, 16 Aug 2024 18:03:00 +0000
Received: by outflank-mailman (input) for mailman id 778722;
 Fri, 16 Aug 2024 18:02: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=J2/C=PP=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sf1Hv-0005Wg-5G
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 18:02:59 +0000
Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com
 [2a00:1450:4864:20::22e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c51696ab-5bf9-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 20:02:58 +0200 (CEST)
Received: by mail-lj1-x22e.google.com with SMTP id
 38308e7fff4ca-2f16d2f2b68so33777261fa.3
 for <xen-devel@lists.xenproject.org>; Fri, 16 Aug 2024 11:02:58 -0700 (PDT)
Received: from localhost ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383934559sm287708966b.130.2024.08.16.11.02.56
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 16 Aug 2024 11:02:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c51696ab-5bf9-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723831378; x=1724436178; darn=lists.xenproject.org;
        h=in-reply-to:references:from:subject:cc:to:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=NzuwvrSR4boSz0LtUOoTzVVt3IV5wBEFG8HEkBgpKf4=;
        b=K/fXUmbyo9qhYCEfOZ6Llu+xdSK1hELv5y7DyCNtgW+1b99OU7oHEsSqPD+M1Mn03R
         bkm4AtResDq1hIUzH5tSIcAhaPMgl3XKPapjbRGntq7/JlUnE9l22YTAn9iMJNN1wTDu
         sWXNfl8VS46Gg876ebrGwGPYYOzyxO2AAmGBc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723831378; x=1724436178;
        h=in-reply-to:references:from:subject:cc:to:message-id:date
         :content-transfer-encoding:mime-version:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=NzuwvrSR4boSz0LtUOoTzVVt3IV5wBEFG8HEkBgpKf4=;
        b=nQnKjL0t3AIAsQdMXlJMp9BAZvILfloQl5odMO1JlE9b8qYTv4krEC0BlRuobvZCBq
         aG5TaY50fs5UFTjkvg/j7frfXPiGVjGAituw6jnpmXLlKKlbk2QbgzZhaqFDDfKqjXoo
         KCims8rYs/qJaEDm+4WGJPm7fdRUdRLW7yUen6kQgzieTigf3OGARUZDpN3OkxT3E/D8
         WGKETPh4gogukDhUzThVJiOTi9sWC8dzJhgwNDBF52SrrXitFQJ2wbdLLkCqzkotha5/
         TeNi9meekcbCVar9GnA3v3UXpMD1yndXjTkolK4Zdr9toiIy8YVduYi43yGvGLsggTLM
         sl6w==
X-Forwarded-Encrypted: i=1; AJvYcCUqSbCBjobriolZj1i7drb9eT3jLg9yXhx7skKbYn97+X87qllbj2+sk8DwGqHE5JraCM5YyshZxzizRd6OFZJKSwz3+ZOQ7lRwVprogoI=
X-Gm-Message-State: AOJu0YyVQOPLfOznc5g/t2IFI7PmAv5xa7wyrEpOxVgEwU5pjXyfRU5H
	5GbbrHYm39f4/0vWLaf16rmscsL0Y6M80k16azCGfsB0sPa8S/CziFdzt/QjoIo=
X-Google-Smtp-Source: AGHT+IFcd4bVp+IhRU+w8Fq2N0hvYZzVZ+texPBSgeNjmVXd1mkHU/N+OacwzlFV1PwAzhElNR6IrQ==
X-Received: by 2002:a2e:868d:0:b0:2ef:2905:f36d with SMTP id 38308e7fff4ca-2f3be583b5cmr30799561fa.16.1723831377600;
        Fri, 16 Aug 2024 11:02:57 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Fri, 16 Aug 2024 19:02:54 +0100
Message-Id: <D3HJ80ZGO0MR.2JCGJIV5JPYQP@cloud.com>
To: "Roger Pau Monne" <roger.pau@citrix.com>,
 <xen-devel@lists.xenproject.org>
Cc: "Jan Beulich" <jbeulich@suse.com>, "Andrew Cooper"
 <andrew.cooper3@citrix.com>
Subject: Re: [PATCH 13/22] x86/hvm: use a per-pCPU monitor table in HAP mode
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
X-Mailer: aerc 0.17.0
References: <20240726152206.28411-1-roger.pau@citrix.com>
 <20240726152206.28411-14-roger.pau@citrix.com>
In-Reply-To: <20240726152206.28411-14-roger.pau@citrix.com>

On Fri Jul 26, 2024 at 4:21 PM BST, Roger Pau Monne wrote:
> Instead of allocating a monitor table for each vCPU when running in HVM H=
AP
> mode, use a per-pCPU monitor table, which gets the per-domain slot update=
d on
> guest context switch.
>
> This limits the amount of memory used for HVM HAP monitor tables to the a=
mount
> of active pCPUs, rather than to the number of vCPUs.  It also simplifies =
vCPU
> allocation and teardown, since the monitor table handling is removed from
> there.
>
> Note the switch to using a per-CPU monitor table is done regardless of wh=
ether

s/per-CPU/per-pCPU/

> Address Space Isolation is enabled or not.  Partly for the memory usage
> reduction, and also because it allows to simplify the VM tear down path b=
y not
> having to cleanup the per-vCPU monitor tables.
>
> Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
> ---
> Note the monitor table is not made static because uses outside of the fil=
e
> where it's defined will be added by further patches.
> ---
>  xen/arch/x86/hvm/hvm.c             | 60 ++++++++++++++++++++++++
>  xen/arch/x86/hvm/svm/svm.c         |  5 ++
>  xen/arch/x86/hvm/vmx/vmcs.c        |  1 +
>  xen/arch/x86/hvm/vmx/vmx.c         |  4 ++
>  xen/arch/x86/include/asm/hap.h     |  1 -
>  xen/arch/x86/include/asm/hvm/hvm.h |  8 ++++
>  xen/arch/x86/mm.c                  |  8 ++++
>  xen/arch/x86/mm/hap/hap.c          | 75 ------------------------------
>  xen/arch/x86/mm/paging.c           |  4 +-
>  9 files changed, 87 insertions(+), 79 deletions(-)
>
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index 7f4b627b1f5f..3f771bc65677 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -104,6 +104,54 @@ static const char __initconst warning_hvm_fep[] =3D
>  static bool __initdata opt_altp2m_enabled;
>  boolean_param("altp2m", opt_altp2m_enabled);
> =20
> +DEFINE_PER_CPU(root_pgentry_t *, monitor_pgt);
> +
> +static int allocate_cpu_monitor_table(unsigned int cpu)

To avoid ambiguity, could we call these *_pcpu_*() instead?

> +{
> +    root_pgentry_t *pgt =3D alloc_xenheap_page();
> +
> +    if ( !pgt )
> +        return -ENOMEM;
> +
> +    clear_page(pgt);
> +
> +    init_xen_l4_slots(pgt, _mfn(virt_to_mfn(pgt)), INVALID_MFN, NULL,
> +                      false, true, false);
> +
> +    ASSERT(!per_cpu(monitor_pgt, cpu));
> +    per_cpu(monitor_pgt, cpu) =3D pgt;
> +
> +    return 0;
> +}
> +
> +static void free_cpu_monitor_table(unsigned int cpu)
> +{
> +    root_pgentry_t *pgt =3D per_cpu(monitor_pgt, cpu);
> +
> +    if ( !pgt )
> +        return;
> +
> +    per_cpu(monitor_pgt, cpu) =3D NULL;
> +    free_xenheap_page(pgt);
> +}
> +
> +void hvm_set_cpu_monitor_table(struct vcpu *v)
> +{
> +    root_pgentry_t *pgt =3D this_cpu(monitor_pgt);
> +
> +    ASSERT(pgt);
> +
> +    setup_perdomain_slot(v, pgt);

Why not modify them as part of write_ptbase() instead? As it stands, it app=
ears
to be modifying the PTEs of what may very well be our current PT, which mak=
es
the perdomain slot be in a $DEITY-knows-what state until the next flush
(presumably the write to cr3 in write_ptbase()?; assuming no PCIDs).

Setting the slot up right before the cr3 change should reduce the potential=
 for
misuse.

> +
> +    make_cr3(v, _mfn(virt_to_mfn(pgt)));
> +}
> +
> +void hvm_clear_cpu_monitor_table(struct vcpu *v)
> +{
> +    /* Poison %cr3, it will be updated when the vCPU is scheduled. */
> +    make_cr3(v, INVALID_MFN);

I think this would benefit from more exposition in the comment. If I'm gett=
ing
this right, after descheduling this vCPU we can't assume it'll be reschedul=
ed
on the same pCPU, and if it's not it'll end up using a different monitor ta=
ble.
This poison value is meant to highlight forgetting to set cr3 in the
"ctxt_switch_to()" path.=20

All of that can be deduced from what you wrote and sufficient headscratchin=
g
but seeing how this is invoked from the context switch path it's not incred=
ibly
clear wether you meant the perdomain slot would be updated by the next vCPU=
 or
what I stated in the previous paragraph.

Assuming it is as I mentioned, maybe hvm_forget_cpu_monitor_table() would
convey what it does better? i.e: the vCPU forgets/unbinds the monitor table
from its internal state.

Cheers,
Alejandro


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 18:25:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 18:25:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778736.1188741 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf1dg-0000lV-Ku; Fri, 16 Aug 2024 18:25:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778736.1188741; Fri, 16 Aug 2024 18:25:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf1dg-0000lO-IK; Fri, 16 Aug 2024 18:25:28 +0000
Received: by outflank-mailman (input) for mailman id 778736;
 Fri, 16 Aug 2024 18:25:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7RMc=PP=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sf1df-0000lI-D8
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 18:25:27 +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 e714b754-5bfc-11ef-a505-bb4a2ccca743;
 Fri, 16 Aug 2024 20:25:25 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 7761ECE1887;
 Fri, 16 Aug 2024 18:25:19 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D7CEC32782;
 Fri, 16 Aug 2024 18:25:18 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e714b754-5bfc-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723832718;
	bh=X274vmehy+T0cLBkq9DlcymZt0NxKv91nDcKkuR2PyA=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=JjdENcGzU45yijBpVOE9fv4Mt9HqoWwFsb2zgiN3QxPQcGLkxVwDLDfwh7Co+/jn8
	 ku67G7dyoaCIjXRR+QIoi3APK5fvcE4CS5BGpXSF5+2cYaf5Emmfg6qH8+jyJgX4OJ
	 lXwfiA6vwWr+/if3zA2z4SZj1aCWJ/XFYF65bg4IFxWI0ERBs+/zr5mxLRYCAgUoNk
	 aTq2Ivqz1+n0SbHWyltAmGqVTrp85MR9fxw1l/D7rpEdZ5i0hkXAloCGi8DPrEddxG
	 1Hdhf872R2etpPxH8zp+z4mNWKVcPqRZ3w/eSnyUFF3SRTg/NKVyuYp9/ftwB24Ert
	 n8bBwjdeOJ6+g==
Date: Fri, 16 Aug 2024 11:25:17 -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>, committers@xenproject.org
Subject: Re: Xen Project statistics help
In-Reply-To: <CAO-mL=zWYsDGkBoDtc8erGfAFnaR1y+FaLKsx3pEJ3MgxKAy0Q@mail.gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408161111160.298534@ubuntu-linux-20-04-desktop>
References: <CAO-mL=zWYsDGkBoDtc8erGfAFnaR1y+FaLKsx3pEJ3MgxKAy0Q@mail.gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="8323329-859555006-1723832719=:298534"

  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-859555006-1723832719=:298534
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8BIT

Hi Kelly,

xen.biterg.io was created by a company called Bitergia. Bitergia was
later contracted by the Linux Foundation to create a generic dashboard
for all their Open Source projects. Getting access to the Linux
Foundation dashboard is the best way to go (if it comes to no cost to
our project).

I have used scripts like these in the past to get some data out of a
release. You can copy/paste the output to an Excel datasheet to do
further calculations there.

# List of contributors by name (using the commit "Author" tag) for the
# 4.19 release. One name per commit.
git log 4.18.0-rc4...4.19.0-rc4 --format='%aN' | sort | uniq -c | sort -rn

# List of reviewers (using the Reviewed-by and Acked-by tags) for the
# 4.19 release. One name per review.
git log 4.18.0-rc4...4.19.0-rc4 --pretty=format:%b | grep -E "Reviewed-by|Acked-by" | sed -E 's/.*(Reviewed-by|Acked-by):\s*(.*)\s*<.*/\2/' | sort | uniq -c | sort -rn

# Sorted list of commits by company (using email address in the commit
# "Author" tag) for the 4.19 release.
git log 4.18.0-rc4...4.19.0-rc4 --pretty=format:%b | grep "Signed-off-by" | awk -F '<|@|>' '{print $3}' | sort | uniq -c | sort -rn

You need to run these commands on xen.git on a Linux machine.

Cheers,

Stefano

On Fri, 16 Aug 2024, Kelly Choi wrote:
> Hi all,
> I'm looking for a way to gather some statistics around our project, that would help monitor the health of the community and show our
> progress so far. 
> 
> AFAIK, there used to be a dashboard on https://xen.biterg.io/ (https://wiki.xenproject.org/wiki/Code_Review_Dashboard) which no longer
> exists. 
> 
> Examples of monthly data required:
>  *  Number of commits, reviews, authors, etc per month/release
>  *  Number of contributions per individual and company (we'd need to do some mapping of names for those with multiple email addresses)
>  *  Data to help identify imbalances between reviewers and contributors
>  *  Number of emails on xen-devel
> Linux Foundation does have a dashboard that we're not set up on yet, but I'm looking at possibilities to see if we can.
> 
> If there is an automated process or script that someone has or would be able to create, that would be hugely beneficial. Open to other
> ideas here too. 
> 
> Many thanks,
> Kelly Choi
> 
> Community Manager
> Xen Project 
> 
> 
--8323329-859555006-1723832719=:298534--


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 18:31:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 18:31:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778744.1188751 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf1jD-0002tu-BS; Fri, 16 Aug 2024 18:31:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778744.1188751; Fri, 16 Aug 2024 18:31:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf1jD-0002tn-8Z; Fri, 16 Aug 2024 18:31:11 +0000
Received: by outflank-mailman (input) for mailman id 778744;
 Fri, 16 Aug 2024 18:31:10 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7RMc=PP=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sf1jC-0002th-AA
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 18:31:10 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org
 [2604:1380:40e1:4800::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b24c9f24-5bfd-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 20:31:06 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id D7E97CE1ED4;
 Fri, 16 Aug 2024 18:31:03 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77DA2C32782;
 Fri, 16 Aug 2024 18:31:02 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b24c9f24-5bfd-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723833063;
	bh=JM20CNNznA3RKNBxbl+OMOBOsVx9+lJdaf6HB0ubt6I=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=UjT0HPtubHP4/Vy3MAGghXD5lwwx3bVWLWyQVFd6i8xju09q3LxuOvebWsx7UTAeC
	 6c68fMPw5Me1sHQyDtvn5qZcAkRyqvKiPa1/yFFM1OUzC2fE/g0Czd8M/UtWE5Bs/h
	 QcI0N7JrmOA+lN7848dYwR6MmBsUWZzFW8NxuAMPvcx/rhmnf6wptFvmY3mYKy5NSA
	 PjN/1dzcpIpcNI6AkQilhRG9qKhQzQ/IYaumhRIzmStm1A++CSS3ZQcNt13BpDMY+s
	 9z+Vs0OxKTurt2nm/mSERrg0twkeeRxUTwmJn59wklkL4Na1tGwbaGhzae3CUnHC4+
	 VYuiVnD5Uv2Mw==
Date: Fri, 16 Aug 2024 11:31:01 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Stefano Stabellini <sstabellini@kernel.org>
cc: Kelly Choi <kelly.choi@cloud.com>, 
    xen-devel <xen-devel@lists.xenproject.org>, committers@xenproject.org
Subject: Re: Xen Project statistics help
In-Reply-To: <alpine.DEB.2.22.394.2408161111160.298534@ubuntu-linux-20-04-desktop>
Message-ID: <alpine.DEB.2.22.394.2408161130040.298534@ubuntu-linux-20-04-desktop>
References: <CAO-mL=zWYsDGkBoDtc8erGfAFnaR1y+FaLKsx3pEJ3MgxKAy0Q@mail.gmail.com> <alpine.DEB.2.22.394.2408161111160.298534@ubuntu-linux-20-04-desktop>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 16 Aug 2024, Stefano Stabellini wrote:
> Hi Kelly,
> 
> xen.biterg.io was created by a company called Bitergia. Bitergia was
> later contracted by the Linux Foundation to create a generic dashboard
> for all their Open Source projects. Getting access to the Linux
> Foundation dashboard is the best way to go (if it comes to no cost to
> our project).
> 
> I have used scripts like these in the past to get some data out of a
> release. You can copy/paste the output to an Excel datasheet to do
> further calculations there.
> 
> # List of contributors by name (using the commit "Author" tag) for the
> # 4.19 release. One name per commit.
> git log 4.18.0-rc4...4.19.0-rc4 --format='%aN' | sort | uniq -c | sort -rn
> 
> # List of reviewers (using the Reviewed-by and Acked-by tags) for the
> # 4.19 release. One name per review.
> git log 4.18.0-rc4...4.19.0-rc4 --pretty=format:%b | grep -E "Reviewed-by|Acked-by" | sed -E 's/.*(Reviewed-by|Acked-by):\s*(.*)\s*<.*/\2/' | sort | uniq -c | sort -rn

Sorry both of these are the aggregate numbers, not one per commit. To
get one per commit remove the last part "sort | uniq -c | sort -rn" like
this:

git log 4.18.0-rc4...4.19.0-rc4 --pretty=format:%b | grep -E "Reviewed-by|Acked-by" | sed -E 's/.*(Reviewed-by|Acked-by):\s*(.*)\s*<.*/\2/'


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 18:40:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 18:40:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778753.1188761 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf1sV-0004jA-5B; Fri, 16 Aug 2024 18:40:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778753.1188761; Fri, 16 Aug 2024 18:40:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf1sV-0004j3-2a; Fri, 16 Aug 2024 18:40:47 +0000
Received: by outflank-mailman (input) for mailman id 778753;
 Fri, 16 Aug 2024 18:40:46 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=J2/C=PP=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sf1sU-0004ix-1Z
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 18:40:46 +0000
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com
 [2a00:1450:4864:20::130])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0b5ea376-5bff-11ef-8776-851b0ebba9a2;
 Fri, 16 Aug 2024 20:40:43 +0200 (CEST)
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-52f04b4abdcso2876855e87.2
 for <xen-devel@lists.xenproject.org>; Fri, 16 Aug 2024 11:40:43 -0700 (PDT)
Received: from localhost ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838eeedasm292198966b.94.2024.08.16.11.40.42
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 16 Aug 2024 11:40:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0b5ea376-5bff-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1723833643; x=1724438443; darn=lists.xenproject.org;
        h=in-reply-to:references:subject:cc:to:from:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=txNU6K5Z94jOa7kGMNFjkKteyqZwZ1+WnjUo52dlHnI=;
        b=DLw9VKm0cTlRO9lcasAHtliJu2fdR6sLqMzYgdqxi0M60y+6YoMWFyS7zYePSaGVlC
         4mcFw6HeDL4hP6E3U7pj1dePiSTBQxyiK9spx9Donb95oAFqGo2nBCNvUpFygU4v6/v3
         Mk3FM0NrH9LF4HCUOJ/8UYmHX25PoWFP0ArIc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1723833643; x=1724438443;
        h=in-reply-to:references:subject:cc:to:from:message-id:date
         :content-transfer-encoding:mime-version:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=txNU6K5Z94jOa7kGMNFjkKteyqZwZ1+WnjUo52dlHnI=;
        b=M3AWb4rkg4EXw9wEAhCntZWBBi8TjiherTdyahECdlm7qOyD3m8CKviIHjcIziDydG
         gxQd/sbrq6Ieyh7JsAqLkFVSNs+YnvzVUsa45JBPn4he/WVT+xi5YKDx9uZzLFef8Hg9
         PLR+N81DSA7yD3UFalaWv12jwX+eXv5MKFV4+Fm3Ek/QCerHqPRKR1stpfl2xxK8YgEa
         ngQJDPvoYQkgCU/1wFiRr0kjZzm0+LgArEUiORmFmuivYaR77gpxAXEo0Nd1L5av2GdG
         aVHIRGWrdN23QNKxzQHcOovbZ5A/spVG1pozjXEBdb2e3FHXtF4gtMOvrQb7s2VAaZFG
         Zv1Q==
X-Forwarded-Encrypted: i=1; AJvYcCXl6Gq00+/DSlNaznJ4BUUTJ//TOV0TxCtnC7xGhmTL6iYyZUV3MMZXLg/z8rRjMrQQZOcmK0c9gzQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwZgnnA2yfGrX9B8yHvliyttSQrCZx3zExfFuDFidZMVrqsUguT
	WwMdu4y4eULlsRXBUxJEGWdx3a0tao9nxRC+9XHtX1rQJROyVMlv0G2twcrRFtI=
X-Google-Smtp-Source: AGHT+IHFpOp2NvrWKrkf2baSt+dWZuQ3GgoiTu8U54rKCb10A8hcm9G0D9PWN+SnNiixPqmNSrZx6g==
X-Received: by 2002:a05:6512:3082:b0:52f:cd03:a847 with SMTP id 2adb3069b0e04-5331c6f47f1mr2061371e87.61.1723833643109;
        Fri, 16 Aug 2024 11:40:43 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Fri, 16 Aug 2024 19:40:40 +0100
Message-Id: <D3HK0XQWARJS.F66A01YC9WXY@cloud.com>
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Roger Pau Monne" <roger.pau@citrix.com>,
 <xen-devel@lists.xenproject.org>
Cc: "Jan Beulich" <jbeulich@suse.com>, "Andrew Cooper"
 <andrew.cooper3@citrix.com>
Subject: Re: [PATCH 16/22] x86/mm: introduce a per-CPU L3 table for the
 per-domain slot
X-Mailer: aerc 0.17.0
References: <20240726152206.28411-1-roger.pau@citrix.com>
 <20240726152206.28411-17-roger.pau@citrix.com>
In-Reply-To: <20240726152206.28411-17-roger.pau@citrix.com>

On Fri Jul 26, 2024 at 4:22 PM BST, Roger Pau Monne wrote:
> So far L4 slot 260 has always been per-domain, in other words: all vCPUs =
of a
> domain share the same L3 entry.  Currently only 3 slots are used in that =
L3
> table, which leaves plenty of room.
>
> Introduce a per-CPU L3 that's used the the domain has Address Space Isola=
tion
> enabled.  Such per-CPU L3 gets currently populated using the same L3 entr=
ies
> present on the per-domain L3 (d->arch.perdomain_l3_pg).
>
> No functional change expected, as the per-CPU L3 is always a copy of the
> contents of d->arch.perdomain_l3_pg.
>
> Note that all the per-domain L3 entries are populated at domain create, a=
nd
> hence there's no need to sync the state of the per-CPU L3 as the domain w=
on't
> yet be running when the L3 is modified.
>
> Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>

Still scratching my head with the details on this, but in general I'm utter=
ly
confused whenever I read per-CPU in the series because it's not obvious whi=
ch
CPU (p or v) I should be thinking about. A general change that would help a=
 lot
is to replace every instance of per-CPU with per-vCPU or per-pCPU as needed=
.

Cheers,
Alejandro


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 23:01:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 23:01:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778776.1188772 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf5wN-0002YS-0w; Fri, 16 Aug 2024 23:01:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778776.1188772; Fri, 16 Aug 2024 23:01:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf5wM-0002YL-Tw; Fri, 16 Aug 2024 23:01:02 +0000
Received: by outflank-mailman (input) for mailman id 778776;
 Fri, 16 Aug 2024 23:01:00 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sf5wK-0002Y9-Oq; Fri, 16 Aug 2024 23:01:00 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sf5wK-0002IM-LF; Fri, 16 Aug 2024 23:01:00 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sf5wK-0005Iz-2t; Fri, 16 Aug 2024 23:01:00 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sf5wK-0007Rj-2N; Fri, 16 Aug 2024 23:01:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ptDaOILWXaGZEFc4faz+fwF+FVquUqmqABX3RRVjUdU=; b=Y02wV0RprQqmx+UNSnJ5nRD/yl
	shdggY/kCaZrxqQ6aG5iPKYXrmvPeYGkkWhK+9PANM+f+NgZpRTwWSoUmVKr+CbGpWnQ71gI1Hh9F
	T2GOHEwDU6r4Hwyfsddrg7hVMIW/hjDuZFawMZ4eOaI8ngrRE1XMnbYN5olJDzr7avAg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187254-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187254: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:regression
    linux-linus:test-armhf-armhf-libvirt-vhd:xen-boot:fail:heisenbug
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=d7a5aa4b3c007fae50405ca75c40258d90300e96
X-Osstest-Versions-That:
    linux=e724918b3786252b985b0c2764c16a57d1937707
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 16 Aug 2024 23:01:00 +0000

flight 187254 linux-linus real [real]
flight 187256 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187254/
http://logs.test-lab.xenproject.org/osstest/logs/187256/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail REGR. vs. 187251

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-libvirt-vhd  8 xen-boot            fail pass in 187256-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check fail in 187256 never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check fail in 187256 never pass
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187251
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187251
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187251
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187251
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187251
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187251
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                d7a5aa4b3c007fae50405ca75c40258d90300e96
baseline version:
 linux                e724918b3786252b985b0c2764c16a57d1937707

Last test of basis   187251  2024-08-15 23:14:47 Z    0 days
Testing same since   187254  2024-08-16 11:03:05 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Arnaldo Carvalho de Melo <acme@redhat.com>
  Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Namhyung Kim <namhyung@kernel.org>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 fail    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 331 lines long.)


From xen-devel-bounces@lists.xenproject.org Fri Aug 16 23:46:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Aug 2024 23:46:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778821.1188798 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf6eH-00022d-Kx; Fri, 16 Aug 2024 23:46:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778821.1188798; Fri, 16 Aug 2024 23:46:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf6eH-00022W-HH; Fri, 16 Aug 2024 23:46:25 +0000
Received: by outflank-mailman (input) for mailman id 778821;
 Fri, 16 Aug 2024 23:46:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=7RMc=PP=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sf6eF-00022Q-TB
 for xen-devel@lists.xenproject.org; Fri, 16 Aug 2024 23:46:23 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bd3aa345-5c29-11ef-a505-bb4a2ccca743;
 Sat, 17 Aug 2024 01:46:22 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 853236223C;
 Fri, 16 Aug 2024 23:46:20 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D6D9C32782;
 Fri, 16 Aug 2024 23:46:19 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bd3aa345-5c29-11ef-a505-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1723851980;
	bh=PLhVGxtx1jNthxuKNX16DF938ypPE0BLHSf5R10Cfu8=;
	h=Date:From:To:cc:Subject:From;
	b=g9ZgpBDSpFjWz/GpiawfrAcDDN4SkL36saOPg9o/iysSBuSjfzCqQYclNSQeZtA91
	 CFn5a1Cn6DkffKmDoVVg1bnDo8dqMkjY+qGHyoQLtt11vxNhjS5mCbmiIiimmcMx+h
	 Z+lVBqo+T3x2e8mYS6dPszaEpfFc0dcxplAaEIpOFIOS18AS5Df815kinOeyCIuZ1Q
	 5CnmhFEOALVP3R3CWzc8/MpIOsTPEJXPdImgvC4L4KmPd8UVam3pp4W52fpZ6YKUTJ
	 9gpe9ZII3Dh4mKlSlDrjG/W2TSFWjEcIrLp33PMwyvYVgF7S7ZDfMPnkIjiEgKePKi
	 zpESDOXWGPr5w==
Date: Fri, 16 Aug 2024 16:46:18 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: xen-devel@lists.xenproject.org
cc: sstabellini@kernel.org, Doug Goldstein <cardoe@cardoe.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, 
    Michal Orzel <michal.orzel@amd.com>
Subject: [PATCH] automation: restore CR filtering
Message-ID: <alpine.DEB.2.22.394.2408161642220.298534@ubuntu-linux-20-04-desktop>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

After commit c36efb7fcea6 ("automation: use expect to run QEMU") we lost
the \r filtering introduced by b576497e3b7d ("automation: remove CR
characters from serial output"). This patch reintroduced it.

Fixes: c36efb7fcea6 ("automation: use expect to run QEMU") 
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>

diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 5359e0820b..343b71d5ac 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -89,4 +89,4 @@ export QEMU_LOG="smoke.serial"
 export LOG_MSG="Domain-0"
 export PASSED="BusyBox"
 
-./automation/scripts/qemu-key.exp
+./automation/scripts/qemu-key.exp | sed 's/\r//'
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index bbdcb39f1a..a3ccbbd7f4 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -96,4 +96,4 @@ export QEMU_LOG="${serial_log}"
 export LOG_MSG="Domain-0"
 export PASSED="/ #"
 
-../automation/scripts/qemu-key.exp
+../automation/scripts/qemu-key.exp | sed 's/\r//'
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 0094bfc8e1..a781022d48 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -109,4 +109,4 @@ export QEMU_LOG="smoke.serial"
 export LOG_MSG="Domain-0"
 export PASSED="BusyBox"
 
-./automation/scripts/qemu-key.exp
+./automation/scripts/qemu-key.exp | sed 's/\r//'
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index 68ffbabdb8..3c32a676ff 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -149,4 +149,4 @@ export QEMU_LOG="${serial_log}"
 export LOG_MSG="${dom0_prompt}"
 export PASSED="${passed}"
 
-../automation/scripts/qemu-key.exp
+../automation/scripts/qemu-key.exp | sed 's/\r//'
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index eb25c4af4b..a13bd8ee04 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -220,4 +220,4 @@ export QEMU_LOG="smoke.serial"
 export LOG_MSG="Welcome to Alpine Linux"
 export PASSED="${passed}"
 
-./automation/scripts/qemu-key.exp
+./automation/scripts/qemu-key.exp | sed 's/\r//'
diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/scripts/qemu-smoke-ppc64le.sh
index ccb4a576f4..3c02771914 100755
--- a/automation/scripts/qemu-smoke-ppc64le.sh
+++ b/automation/scripts/qemu-smoke-ppc64le.sh
@@ -25,4 +25,4 @@ export QEMU_CMD="qemu-system-ppc64 \
 export QEMU_LOG="${serial_log}"
 export PASSED="Hello, ppc64le!"
 
-./automation/scripts/qemu-key.exp
+./automation/scripts/qemu-key.exp | sed 's/\r//'
diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
index 0355c075b7..7ede5a5d8a 100755
--- a/automation/scripts/qemu-smoke-riscv64.sh
+++ b/automation/scripts/qemu-smoke-riscv64.sh
@@ -16,4 +16,4 @@ export QEMU_CMD="qemu-system-riscv64 \
 export QEMU_LOG="smoke.serial"
 export PASSED="All set up"
 
-./automation/scripts/qemu-key.exp
+./automation/scripts/qemu-key.exp | sed 's/\r//'
diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
index 37ac10e068..81e7dba329 100755
--- a/automation/scripts/qemu-smoke-x86-64.sh
+++ b/automation/scripts/qemu-smoke-x86-64.sh
@@ -24,4 +24,4 @@ export QEMU_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
 export QEMU_LOG="smoke.serial"
 export PASSED="Test result: SUCCESS"
 
-./automation/scripts/qemu-key.exp
+./automation/scripts/qemu-key.exp | sed 's/\r//'
diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
index 0666f6363e..ed44aab0f0 100755
--- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
+++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
@@ -65,4 +65,4 @@ export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x4000000
 export QEMU_LOG="smoke.serial"
 export PASSED="${passed}"
 
-./automation/scripts/qemu-key.exp
+./automation/scripts/qemu-key.exp | sed 's/\r//'


From xen-devel-bounces@lists.xenproject.org Sat Aug 17 00:46:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Aug 2024 00:46:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778844.1188852 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf7Zz-0003s0-BM; Sat, 17 Aug 2024 00:46:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778844.1188852; Sat, 17 Aug 2024 00:46:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf7Zz-0003rt-7Z; Sat, 17 Aug 2024 00:46:03 +0000
Received: by outflank-mailman (input) for mailman id 778844;
 Sat, 17 Aug 2024 00:46:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=QUm3=PQ=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1sf7Zx-0003rl-M7
 for xen-devel@lists.xenproject.org; Sat, 17 Aug 2024 00:46:01 +0000
Received: from NAM10-BN7-obe.outbound.protection.outlook.com
 (mail-bn7nam10on20612.outbound.protection.outlook.com
 [2a01:111:f403:2009::612])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 124d0921-5c32-11ef-a505-bb4a2ccca743;
 Sat, 17 Aug 2024 02:45:59 +0200 (CEST)
Received: from BN9PR03CA0709.namprd03.prod.outlook.com (2603:10b6:408:ef::24)
 by LV3PR12MB9412.namprd12.prod.outlook.com (2603:10b6:408:211::18)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20; Sat, 17 Aug
 2024 00:45:53 +0000
Received: from BL6PEPF00020E63.namprd04.prod.outlook.com
 (2603:10b6:408:ef:cafe::3c) by BN9PR03CA0709.outlook.office365.com
 (2603:10b6:408:ef::24) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19 via Frontend
 Transport; Sat, 17 Aug 2024 00:45:53 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 BL6PEPF00020E63.mail.protection.outlook.com (10.167.249.24) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7849.8 via Frontend Transport; Sat, 17 Aug 2024 00:45:53 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 16 Aug
 2024 19:45:48 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 16 Aug
 2024 19:45:45 -0500
Received: from [172.24.94.179] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Fri, 16 Aug 2024 19:45:45 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 124d0921-5c32-11ef-a505-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=F8vrRC7roj99wmz41J6BY5Y2/SHa85GIugxghpM64KHak6LADmf7INUNpMCe0ntQU//bLG19qT8j/deMG0cHAphj6uDeUxpTY9LkJCWugau/WYukJ6JlEWQcGNDhHyw6Eb3XZ6eV8fgv7OcF7OCZZYy42Y4+p27qwGHO7FlY7EzqHtTtajvuxZwl8nunpPGmekS006W+RsgybZnkHsL7R6ABraH4Quw5T5jMufNDz4GJHXrHjHey71PdakVd1yIB6R3lTbdH7lDWt+tRVqirmCwu2scYzmaghJpZOfwFTiUVtrrtf+AV6uYwYRkeF93sGOXDCagXwD/2WP0OOHRoXA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=m4SVgnne9erkuAhrAeM3VCVOKRFMY2Is89F35hd+2Sk=;
 b=cPfOm+jmZ25g1hPXYcCsoWQGD7wSYrL6ypUPgO0k/Pb+1acw4OVQaMn4ViQxVVkpoMXZ54T5JeQlHP1Lmcrjasvuo+7jsaWKQCGQjQrlsBdKnlWUo8JPUNiw1+cm1JHFL4dVndkqTue87rJsKEwwQPoXgJ+hwXNSV/JMl10K1ERpjx0oWQvfSOShYm49cBSrqWKM8qR/HbvlBSzwuRJmkhG7GseIXWxOF/3AyVQcUyRJm3Fq57c0BasdNPa6w+SlqU9yzPiOUbOZEEzplbRk1/kBryBRdCLijKqROJ3nbTELfGxly9kWm9VN/TKaDnliDtq1vAsprzYW44TomNNjhQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=m4SVgnne9erkuAhrAeM3VCVOKRFMY2Is89F35hd+2Sk=;
 b=yyKe+f4OwTp3AbVgJbDKlFsVXBIeDFU4JTkfv34I+I96d0YRfxFOc6iQzyqW5B02vYhnbBJ6dBXjoSWqWgwADYjYkg0BokTQmOYEwgpspcB0YXITk4Guv8N9T4keFnmdBDRZiBKLZO1r5U4YfdiiI9vg0F1FVvbetqx0wo6IgXE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <93de8d6d-6123-4038-a566-d134206ba608@amd.com>
Date: Fri, 16 Aug 2024 18:58:26 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests
To: Stefano Stabellini <sstabellini@kernel.org>, "Edgar E. Iglesias"
	<edgar.iglesias@gmail.com>
CC: <qemu-devel@nongnu.org>, <anthony@xenproject.org>, <paul@xen.org>,
	<peter.maydell@linaro.org>, <alex.bennee@linaro.org>,
	<xenia.ragiadakou@amd.com>, <edgar.iglesias@amd.com>,
	<xen-devel@lists.xenproject.org>, <qemu-arm@nongnu.org>,
	<andrew.cooper3@citrix.com>
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
 <20240812130606.90410-5-edgar.iglesias@gmail.com>
 <alpine.DEB.2.22.394.2408121650590.298534@ubuntu-linux-20-04-desktop>
 <ZruRm34zIMtUm7oH@zapote>
 <alpine.DEB.2.22.394.2408131550080.298534@ubuntu-linux-20-04-desktop>
 <ZryZwOoadeb1UWK8@zapote>
 <alpine.DEB.2.22.394.2408141719400.298534@ubuntu-linux-20-04-desktop>
 <CAJy5ezrUbGZCaF=HiYhyLCoXRL3d=t-QbmLeKvu7ByWksV888g@mail.gmail.com>
 <alpine.DEB.2.22.394.2408160949320.298534@ubuntu-linux-20-04-desktop>
Content-Language: en-US
From: Jason Andryuk <jason.andryuk@amd.com>
In-Reply-To: <alpine.DEB.2.22.394.2408160949320.298534@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL6PEPF00020E63:EE_|LV3PR12MB9412:EE_
X-MS-Office365-Filtering-Correlation-Id: ba8e23ee-e94c-44f2-3cd6-08dcbe55f2a5
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|7416014|36860700013|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?OXBSTWZPd2lwZ3FaZWh2Tk9UZXo3VnVSeXkvMWl5cngwNWZOZXErQSt4Nmo5?=
 =?utf-8?B?Q0ozNXhaM1VoTkFsS0tYcTYyVTh4dnh0Slpoa3p5K29BMVJ5OVVrVHl6RGtl?=
 =?utf-8?B?VXU1MkRvdGM5ZW5lalFwR3d5MzYzZDByRXFtQTE2UjI2V0tleVQ5eFA5RytI?=
 =?utf-8?B?d1VyT2VYemxxSGtta0NTaXREZzVkdS90eTZvaGprUFZHdUgrd04yT0ZuQ0N3?=
 =?utf-8?B?U1prSCtRVyttanBaMlkycFo1dVp2UW0xY0c4RGZhOHM5YUVJTjJQY2FJLzVW?=
 =?utf-8?B?NnY5S3NUdEVyMGVVMkxlN0MzN29HMm9INnpuZ3F6c1NmV1F0aUxvQUJlb3dx?=
 =?utf-8?B?UndiMU9sOG82d0RrdDZlb0hKZmpKRWxoM1hpZmpOSGZHa0hleithd1JremZN?=
 =?utf-8?B?NG5WcnRkcE1RYlVYSmZsL1dJREtBaGwyWkhJd1FJb1pmbnJDSnVzRXZvMUZ5?=
 =?utf-8?B?b3ZFNll0cEoxUHFDQlk1YXJrNnJxSzFhNmlib2lLK1AycTVTVHBNandDcW15?=
 =?utf-8?B?cHhpc3NTMUpia29XQ1JPSzQrSmhqaFcwVTZzRHFXQzlpeUFBbndUNUJlY2Y0?=
 =?utf-8?B?UmM5cnAzeFBzYThoTnAzNm1pUW1aZGdVWVVqRE15OVdYRXVVbitPakxORlpQ?=
 =?utf-8?B?c1dMaVRmbkw4NUhFQ1ZQSnVwUFlBcDJYcE1zREloSjY5dkdjS3E0dkt1Y0hW?=
 =?utf-8?B?YWVvYXhNYVRmc0JoRXBrcW9HUGY5WWNMUjR2RmozdGdmNTlZU3dYd3hoODFK?=
 =?utf-8?B?UXAvWjdHSUJoRzdURGgyajY3bGVMaGptUVIxUGZ5d3FUa05ydllIWGN2NFNE?=
 =?utf-8?B?YWd6dzRaODN3UllRTG9CNjgxUUVEcEdkMHJYeVpaUUpUYnZlZVRHY04xS3c3?=
 =?utf-8?B?VXBEcFAxN3FZVWU1SFZ3U1o2bWV5SzJxRzBnM1g4b05zamk3M29WcnRmNmwv?=
 =?utf-8?B?UjRXcEJxcWVVczFOTXZJelhzRWV3QjZ2Mm9UKzg3eHV2WmsvaTFNaEMwc2x0?=
 =?utf-8?B?SjAwUG84UmVObmsvUXhyeFUydDAyaVdNcVpldE5qNDlQU3hpTHZ3OXYxMUxp?=
 =?utf-8?B?enNSWTNtMWZ1Q2pCcmMzdVpXMUppOXRQOE9HRmdDVyt4VTUvdURielFTR2Zx?=
 =?utf-8?B?c1I5aEpCbEFnODNRdU1KUU5IWnY2L01zSjVUQ0tkOXo4YnF3cHNKVzBnamFo?=
 =?utf-8?B?MVpFdEdML0UycUR6NEYvYS95azVKR04zZ0x5YU0xUDJXV2JObGh2NG0yeDd1?=
 =?utf-8?B?MStRS0xpcUJGc25nRFUydTZtZkJnSzZJSFZidysxaExOSTVzenlCU3FoUC9B?=
 =?utf-8?B?K0VTTXpxdlFaZmk3WlZnYTdoSWdwZGtiSHBXNXVzL3JNZzB3OUh6VGw1TFNr?=
 =?utf-8?B?VUhyOENnVmw2UXhod0NxRTRySzhkK3JyZTlncUJYeXlYcWFBOGx5K05IczhQ?=
 =?utf-8?B?dEhpVzBQdUdiWVdwSUF4ME5YaElmMnoxVzZGcVl0aGhLdElvdVZkTVZzN2tW?=
 =?utf-8?B?aFVNb0x4K0dIeFZabklKcmROYVlvZzhiVTg4bms4QnpIaVFmYkVCU0NueTNK?=
 =?utf-8?B?M2xLbmtkMVBMcWVpODlYYlB2SFhSZnlCUm5JOVRhNFlDK1FmQWEzelFOdDYy?=
 =?utf-8?B?dmRjUHBLeHNMSHVHYnNsOUZpQTZ0cmlIa29rWDNvTFdSaHJDZDJRcXJmaG1y?=
 =?utf-8?B?ZWZKMFBYc1J1VW03MW13eFpKTVVOODV4NmtVd1BTaEZ1dGV3L2gvOEQ4cExG?=
 =?utf-8?B?MWxKTkxCZmdIbko0QVBQdklkMTA4a21WWnI4UWdkaHlzU0FJdE9OSmFWN21J?=
 =?utf-8?B?eGZxYjdkNld6cEVWQlc5K3NLeU1DV3RZdDdYUEt5dllpTDYxcXJETDIyTkpS?=
 =?utf-8?B?N1F4WWc3ZXZsams2MVM1RlBEUWxmMWwyV21YbzVOOER0RHFGRXZaN0gvZVRq?=
 =?utf-8?Q?20ss47yP/frVMvZbzfb+u/lvoXVO/JWk?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(7416014)(36860700013)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2024 00:45:53.1399
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ba8e23ee-e94c-44f2-3cd6-08dcbe55f2a5
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL6PEPF00020E63.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9412

On 2024-08-16 12:53, Stefano Stabellini wrote:
> On Fri, 16 Aug 2024, Edgar E. Iglesias wrote:
>> On Thu, Aug 15, 2024 at 2:30 AM Stefano Stabellini <sstabellini@kernel.org> wrote:
>>        On Wed, 14 Aug 2024, Edgar E. Iglesias wrote:
>>        > On Tue, Aug 13, 2024 at 03:52:32PM -0700, Stefano Stabellini wrote:
>>        > > On Tue, 13 Aug 2024, Edgar E. Iglesias wrote:
>>        > > > On Mon, Aug 12, 2024 at 06:47:17PM -0700, Stefano Stabellini wrote:
>>        > > > > On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
>>        > > > > > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
>>        > > > > >
>>        > > > > > Add SMP support for Xen PVH ARM guests. Create max_cpus ioreq
>>        > > > > > servers to handle hotplug.
>>        > > > > >
>>        > > > > > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
>>        > > > > > ---
>>        > > > > >  hw/arm/xen_arm.c | 5 +++--
>>        > > > > >  1 file changed, 3 insertions(+), 2 deletions(-)
>>        > > > > >
>>        > > > > > diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
>>        > > > > > index 5f75cc3779..ef8315969c 100644
>>        > > > > > --- a/hw/arm/xen_arm.c
>>        > > > > > +++ b/hw/arm/xen_arm.c
>>        > > > > > @@ -173,7 +173,7 @@ static void xen_arm_init(MachineState *machine)
>>        > > > > >
>>        > > > > >      xen_init_ram(machine);
>>        > > > > >
>>        > > > > > -    xen_register_ioreq(xam->state, machine->smp.cpus, &xen_memory_listener);
>>        > > > > > +    xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener);
>>        > > > > >
>>        > > > > >      xen_create_virtio_mmio_devices(xam);
>>        > > > > >
>>        > > > > > @@ -218,7 +218,8 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
>>        > > > > >      MachineClass *mc = MACHINE_CLASS(oc);
>>        > > > > >      mc->desc = "Xen PVH ARM machine";
>>        > > > > >      mc->init = xen_arm_init;
>>        > > > > > -    mc->max_cpus = 1;
>>        > > > > > +    /* MAX number of vcpus supported by Xen.  */
>>        > > > > > +    mc->max_cpus = GUEST_MAX_VCPUS;
>>        > > > >
>>        > > > > Will this cause allocations of data structures with 128 elements?
>>        > > > > Looking at hw/xen/xen-hvm-common.c:xen_do_ioreq_register it seems
>>        > > > > possible? Or hw/xen/xen-hvm-common.c:xen_do_ioreq_register is called
>>        > > >
>>        > > > Yes, in theory there's probably overhead with this but as you correctly
>>        > > > noted below, a PVH aware xl will set the max_cpus option to a lower value.
>>        > > >
>>        > > > With a non-pvh aware xl, I was a little worried about the overhead
>>        > > > but I couldn't see any visible slow-down on ARM neither in boot or in network
>>        > > > performance (I didn't run very sophisticated benchmarks).
>>        > >
>>        > > What do you mean by "non-pvh aware xl"? All useful versions of xl
>>        > > support pvh?
>>        >
>>        >
>>        > I mean an xl without our PVH patches merged.
>>        > xl in upstream doesn't know much about PVH yet.
>>        > Even for ARM, we're still carrying significant patches in our tree.
>>
>>        Oh I see. In that case, I don't think we need to support "non-pvh aware xl".
>>
>>
>>        > > > > later on with the precise vCPU value which should be provided to QEMU
>>        > > > > via the -smp command line option
>>        > > > > (tools/libs/light/libxl_dm.c:libxl__build_device_model_args_new)?
>>        > > >
>>        > > > Yes, a pvh aware xl will for example pass -smp 2,maxcpus=4 based on
>>        > > > values from the xl.cfg. If the user doesn't set maxvcpus in xl.cfg, xl
>>        > > > will set maxvcpus to the same value as vcpus.
>>        > >
>>        > > OK good. In that case if this is just an initial value meant to be
>>        > > overwritten, I think it is best to keep it as 1.
>>        >
>>        > Sorry but that won't work. I think the confusion here may be that
>>        > it's easy to mix up mc->max_cpus and machine->smp.max_cpus, these are
>>        > not the same. They have different purposes.
>>        >
>>        > I'll try to clarify the 3 values in play.
>>        >
>>        > machine-smp.cpus:
>>        > Number of guest vcpus active at boot.
>>        > Passed to QEMU via the -smp command-line option.
>>        > We don't use this value in QEMU's ARM PVH machines.
>>        >
>>        > machine->smp.max_cpus:
>>        > Max number of vcpus that the guest can use (equal or larger than machine-smp.cpus).
>>        > Will be set by xl via the "-smp X,maxcpus=Y" command-line option to QEMU.
>>        > Taken from maxvcpus from xl.cfg, same as XEN_DMOP_nr_vcpus.
>>        > This is what we use for xen_register_ioreq().
>>        >
>>        > mc->max_cpus:
>>        > Absolute MAX in QEMU used to cap the -smp command-line options.
>>        > If xl tries to set -smp (machine->smp.max_cpus) larger than this, QEMU will bail out.
>>        > Used to setup xen_register_ioreq() ONLY if -smp maxcpus was NOT set (i.e by a non PVH aware xl).
>>        > Cannot be 1 because that would limit QEMU to MAX 1 vcpu.
>>        >
>>        > I guess we could set mc->max_cpus to what XEN_DMOP_nr_vcpus returns but I'll
>>        > have to check if we can even issue that hypercall this early in QEMU since
>>        > mc->max_cpus is setup before we even parse the machine options. We may
>>        > not yet know what domid we're attaching to yet.
>>
>>        If mc->max_cpus is the absolute max and it will not be used if -smp is
>>        passed to QEMU, then I think it is OK to use GUEST_MAX_VCPUS
>>
>> Looking at this a little more. If users (xl) don't pass an -smp option we actually default to smp.max_cpus=1.
>> So, another option is to simply remove the upper limit in QEMU (e.g we can set mc->max_cpus to something very large like UINT32_MAX).
>> That would avoid early hypercalls, avoid using GUEST_MAX_VCPUS and always let xl dictate the max_cpus value using the -smp cmdline option.
> 
> As the expectation is that there will be always a smp.max_cpus option
> passed to QEMU, I would avoid an extra early hypercall.
> 
> For the initial value, I would use something static and large, but not
> unreasonably large as UINT32_MAX to be more resilient in (erroneous)
> cases where smp.max_cpus is not passed.
> 
> So I would initialize it to GUEST_MAX_VCPUS, or if we don't want to use
> GUEST_MAX_VCPUS, something equivalent in the 64-256 range.
> 
> Alternative we can have a runtime check and exit with a warning if
> smp.max_cpus is not set.

FYI, xl only passes a -smp option when the domU has more than 1 vcpu. 
Though that implies only a single vcpu.

Regards,
Jason


From xen-devel-bounces@lists.xenproject.org Sat Aug 17 02:31:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Aug 2024 02:31:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778853.1188862 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf9DO-0004Ap-Jd; Sat, 17 Aug 2024 02:30:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778853.1188862; Sat, 17 Aug 2024 02:30:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sf9DO-0004Ai-FR; Sat, 17 Aug 2024 02:30:50 +0000
Received: by outflank-mailman (input) for mailman id 778853;
 Sat, 17 Aug 2024 02:30:49 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sf9DN-0004AY-Ft; Sat, 17 Aug 2024 02:30:49 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sf9DN-0005n8-BD; Sat, 17 Aug 2024 02:30:49 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sf9DM-0005RC-PS; Sat, 17 Aug 2024 02:30:48 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sf9DM-0007Ce-Oc; Sat, 17 Aug 2024 02:30:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Ne3Kyg0FQUyiteWmrYtmMzpuGg0sppz8aCx7VFLGu1M=; b=RB9Xjj2YsHgq2J5wx2eZPB+E7Q
	NZjaZD96JrZXJTPyq6t6KzSzutdWMg/u3Re+8V5VuEhxyDZ06bB62f7UyUyX4TJe8Pfxvh1I339Ma
	ELYW4sGteUsJuO3tTGJHRGEfVvY3g1U8X3YNrWp9cqs736Axgz9GeGarf/JDwCUE1unE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187255-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187255: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-libvirt-vhd:leak-check/check:fail:regression
    qemu-mainline:test-armhf-armhf-xl-credit1:host-ping-check-xen:fail:heisenbug
    qemu-mainline:test-amd64-amd64-qemuu-freebsd11-amd64:guest-start/freebsd.repeat:fail:heisenbug
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=ecdfa31beb1f7616091bedba79dfdf9ee525ed9d
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 17 Aug 2024 02:30:48 +0000

flight 187255 qemu-mainline real [real]
flight 187262 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187255/
http://logs.test-lab.xenproject.org/osstest/logs/187262/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707
 test-amd64-amd64-libvirt-vhd 22 leak-check/check         fail REGR. vs. 182707

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-credit1  10 host-ping-check-xen fail pass in 187262-retest
 test-amd64-amd64-qemuu-freebsd11-amd64 21 guest-start/freebsd.repeat fail pass in 187262-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-credit1 15 migrate-support-check fail in 187262 never pass
 test-armhf-armhf-xl-credit1 16 saverestore-support-check fail in 187262 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 qemuu                ecdfa31beb1f7616091bedba79dfdf9ee525ed9d
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  345 days
Failing since        182723  2023-09-07 18:19:05 Z  344 days   20 attempts
Testing same since   187255  2024-08-16 12:08:31 Z    0 days    1 attempts

------------------------------------------------------------
619 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       fail    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 179377 lines long.)


From xen-devel-bounces@lists.xenproject.org Sat Aug 17 04:25:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Aug 2024 04:25:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778868.1188871 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfB0V-0004Oc-Ll; Sat, 17 Aug 2024 04:25:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778868.1188871; Sat, 17 Aug 2024 04:25:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfB0V-0004OV-J5; Sat, 17 Aug 2024 04:25:39 +0000
Received: by outflank-mailman (input) for mailman id 778868;
 Sat, 17 Aug 2024 04:25:38 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfB0U-0004OL-T2; Sat, 17 Aug 2024 04:25:38 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfB0U-0007kR-QZ; Sat, 17 Aug 2024 04:25:38 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfB0U-0003SC-D7; Sat, 17 Aug 2024 04:25:38 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sfB0U-0006an-An; Sat, 17 Aug 2024 04:25:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=+U8ZJ+hDLLJLnagoy4D5ZKzQgRL1eO1pCpGRe9Toz3k=; b=LjQZyVL2EpYf8XtpJXA+aIzT6C
	NShuS2YzAiwTIetou8DelzD7H/n8UiTE2zXAxqALU+ZZ7dP9hKj1DBrDI0mlYL7Uz64YakVCKGQmM
	MMZl4EkL3CQJ0AvQ0kOrVRaRwS00cwAqmmRep/cPjF4Ud4hYGqhV29G880TA14piywQw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187258-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187258: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=1e2a5f991f86979b89aa9a60ca3ba8106ee7d987
X-Osstest-Versions-That:
    xen=cbe73b848286f1e6b855c0ba328d56e0014d19e6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 17 Aug 2024 04:25:38 +0000

flight 187258 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187258/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  1e2a5f991f86979b89aa9a60ca3ba8106ee7d987
baseline version:
 xen                  cbe73b848286f1e6b855c0ba328d56e0014d19e6

Last test of basis   187243  2024-08-14 14:02:16 Z    2 days
Testing same since   187258  2024-08-17 00:00:24 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   cbe73b8482..1e2a5f991f  1e2a5f991f86979b89aa9a60ca3ba8106ee7d987 -> smoke


From xen-devel-bounces@lists.xenproject.org Sat Aug 17 09:31:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Aug 2024 09:31:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778936.1188897 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfFlo-0002Ji-GE; Sat, 17 Aug 2024 09:30:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778936.1188897; Sat, 17 Aug 2024 09:30:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfFlo-0002Jb-Cl; Sat, 17 Aug 2024 09:30:48 +0000
Received: by outflank-mailman (input) for mailman id 778936;
 Sat, 17 Aug 2024 09:30:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfFln-0002JO-FU; Sat, 17 Aug 2024 09:30:47 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfFln-0005SB-AY; Sat, 17 Aug 2024 09:30:47 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfFlm-0005gH-I3; Sat, 17 Aug 2024 09:30:46 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sfFlm-0006cf-HP; Sat, 17 Aug 2024 09:30:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Hk7p/5pNrAuD4Ifqw7FkQKKYUJXpbpYJZFt8OzYIysU=; b=K0uskW/TGiciEENIpRZ0/kfCJB
	SKTuuaol1SjQ41liD/HSnBi4yd3KVe0RAQjV/B82OYA13b1sx2MRsXA08Bldok00taRrfTnfebR5b
	EC9MiV3zTBOMdYr4lS9MPC87jyl+PwOWIyj48x/GxCmHjSyPr2z+iDWWPV4bBxc0jPZw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187257-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187257: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-armhf-armhf-libvirt:host-ping-check-xen:fail:heisenbug
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=85652baa895b59b94bea29c77cb9b51cf7120deb
X-Osstest-Versions-That:
    linux=e724918b3786252b985b0c2764c16a57d1937707
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 17 Aug 2024 09:30:46 +0000

flight 187257 linux-linus real [real]
flight 187266 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187257/
http://logs.test-lab.xenproject.org/osstest/logs/187266/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-libvirt     10 host-ping-check-xen fail pass in 187266-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt 16 saverestore-support-check fail in 187266 like 187251
 test-armhf-armhf-libvirt    15 migrate-support-check fail in 187266 never pass
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187251
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187251
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187251
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187251
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187251
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                85652baa895b59b94bea29c77cb9b51cf7120deb
baseline version:
 linux                e724918b3786252b985b0c2764c16a57d1937707

Last test of basis   187251  2024-08-15 23:14:47 Z    1 days
Failing since        187254  2024-08-16 11:03:05 Z    0 days    2 attempts
Testing same since   187257  2024-08-16 23:12:36 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alex Bee <knaerzche@gmail.com>
  Alex Deucher <alexander.deucher@amd.com>
  Alexandre Ghiti <alexghiti@rivosinc.com>
  Alice Ryhl <aliceryhl@google.com>
  Alison Schofield <alison.schofield@intel.com>
  AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
  Arnaldo Carvalho de Melo <acme@redhat.com>
  Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
  Asmaa Mnebhi <asmaa@nvidia.com>
  Baojun Xu <baojun.xu@ti.com>
  Barak Biber <bbiber@nvidia.com>
  Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
  Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
  Benno Lossin <benno.lossin@proton.me>
  Boqun Feng <boqun.feng@gmail.com>
  Bouke Sybren Haarsma <boukehaarsma23@gmail.com>
  Caleb Sander Mateos <csander@purestorage.com>
  Celeste Liu <CoelacanthusHex@gmail.com>
  Chun-Kuang Hu <chunkuang.hu@kernel.org>
  Dan Carpenter <dan.carpenter@linaro.org>
  Daniel Wheeler <daniel.wheeler@amd.com>
  Daniel Yang <danielyangkang@gmail.com>
  Dave Airlie <airlied@redhat.com>
  David (Ming Qiang) Wu <David.Wu3@amd.com>
  David Gstir <david@sigma-star.at>
  Dirk Behme <dirk.behme@de.bosch.com>
  Douglas Anderson <dianders@chromium.org>
  Eric Farman <farman@linux.ibm.com>
  Evan Green <evan@rivosinc.com>
  Fangzhi Zuo <Jerry.Zuo@amd.com>
  Fei Shao <fshao@chromium.org>
  Francesco Dolcini <francesco.dolcini@toradex.com>
  Haibo Xu <haibo1.xu@intel.com>
  Hamza Mahfooz <hamza.mahfooz@amd.com>
  Hans de Goede <hdegoede@redhat.com>
  Heiko Stuebner <heiko@sntech.de>
  Ira Weiny <ira.weiny@intel.com>
  Jack Xiao <Jack.Xiao@amd.com>
  Jarkko Sakkinen <jarkko@kernel.org>
  Jason Gunthorpe <jgg@nvidia.com>
  Jens Axboe <axboe@kernel.dk>
  Joerg Roedel <jroedel@suse.de>
  Juan José Arboleda <soyjuanarbol@gmail.com>
  Kenneth Feng <kenneth.feng@amd.com>
  Khazhismel Kumykov <khazhy@google.com>
  Konrad Dybcio <konrad.dybcio@linaro.org>
  Konrad Dybcio <konradybcio@kernel.org>
  Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
  Li Lingfeng <lilingfeng3@huawei.com>
  Lianqin Hu <hulianqin@vivo.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Loan Chen <lo-an.chen@amd.com>
  Lucas De Marchi <lucas.demarchi@intel.com>
  Mark Brown <broonie@kernel.org>
  Masahiro Yamada <masahiroy@kernel.org>
  Matthew Brost <matthew.brost@intel.com>
  Maxime Ripard <mripard@kernel.org>
  Maíra Canal <mcanal@igalia.com>
  Melissa Wen <mwen@igalia.com>
  Michal Wajdeczko <michal.wajdeczko@intel.com>
  Miguel Ojeda <ojeda@kernel.org>
  Mikulas Patocka <mpatocka@redhat.com>
  Nam Cao <namcao@linutronix.de>
  Namhyung Kim <namhyung@kernel.org>
  Olivier Langlois <olivier@trillion01.com>
  Palmer Dabbelt <palmer@rivosinc.com>
  Parsa Poorshikhian <parsa.poorsh@gmail.com>
  Peter Kästle <peter@piie.net>
  Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  Richard Fitzgerald <rf@opensource.cirrus.com>
  Rob Herring (Arm) <robh@kernel.org>
  Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
  Rodrigo Vivi <rodrigo.vivi@intel.com>
  Sarthak Singh <sarthak.singh99@gmail.com>
  Shibu kumar <shibukumar.bit@gmail.com>
  Simon Trimmer <simont@opensource.cirrus.com>
  Song Liu <song@kernel.org>
  Stefan Haberland <sth@linux.ibm.com>
  Stefan Wiehler <stefan.wiehler@nokia.com>
  Steven Rostedt (Google) <rostedt@goodmis.org>
  Steven Rostedt <rostedt@goodmis.org>
  Takashi Iwai <tiwai@suse.de>
  Thomas Zimmermann <tzimmermann@suse.de>
  Tom Chung <chiahsuan.chung@amd.com>
  Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
  Wayne Lin <wayne.lin@amd.com>
  Yinjie Yao <yinjie.yao@amd.com>
  Yu Kuai <yukuai3@huawei.com>
  Yue Haibing <yuehaibing@huawei.com>
  Zehui Xu <zehuixu@whu.edu.cn>
  Zhihao Cheng <chengzhihao1@huawei.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   e724918b3786..85652baa895b  85652baa895b59b94bea29c77cb9b51cf7120deb -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Sat Aug 17 13:19:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Aug 2024 13:19:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.778973.1188908 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfJKa-0002Gi-CN; Sat, 17 Aug 2024 13:18:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 778973.1188908; Sat, 17 Aug 2024 13:18:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfJKa-0002Gb-9Y; Sat, 17 Aug 2024 13:18:56 +0000
Received: by outflank-mailman (input) for mailman id 778973;
 Sat, 17 Aug 2024 13:18:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfJKZ-0002GR-JJ; Sat, 17 Aug 2024 13:18:55 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfJKZ-0000zS-DJ; Sat, 17 Aug 2024 13:18:55 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfJKY-0000sK-SZ; Sat, 17 Aug 2024 13:18:54 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sfJKY-0005UD-S2; Sat, 17 Aug 2024 13:18:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=S4cIYWIMzFcYVKKLb8uFJsx91p9yhYuz52XsW7giQsg=; b=y7w0WON4msXxxNrl/BS32NqU8v
	1sYDEL4ZmqrqmA0X67SKWsukcuMzBnopqPTq2gk8eqCHNoijkpmWtWBKo5iwMhT732td0CbcTLTwf
	nv9wR+XXVnauV7f31GozFbY050uiCT7ozLq4/PKEiZqbQqFlsxf8ZONs0nOH9qxaystk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187259-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.17-testing test] 187259: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.17-testing:test-amd64-coresched-amd64-xl:guest-localmigrate:fail:heisenbug
    xen-4.17-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.17-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=1db6ce307b2ded04aa1f97cada1512c4395f7b51
X-Osstest-Versions-That:
    xen=430ce6cd936546ad883ecd1c85ddea32d790604b
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 17 Aug 2024 13:18:54 +0000

flight 187259 xen-4.17-testing real [real]
flight 187268 xen-4.17-testing real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187259/
http://logs.test-lab.xenproject.org/osstest/logs/187268/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-coresched-amd64-xl 18 guest-localmigrate fail pass in 187268-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187240
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187240
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187240
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187240
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187240
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187240
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  1db6ce307b2ded04aa1f97cada1512c4395f7b51
baseline version:
 xen                  430ce6cd936546ad883ecd1c85ddea32d790604b

Last test of basis   187240  2024-08-14 09:06:43 Z    3 days
Testing same since   187259  2024-08-17 00:06:46 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Roger Pau Monne <roger.pau@citrix.com>
  Roger Pau Monné <roger.pau@citrix.com>
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                fail    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   430ce6cd93..1db6ce307b  1db6ce307b2ded04aa1f97cada1512c4395f7b51 -> stable-4.17


From xen-devel-bounces@lists.xenproject.org Sat Aug 17 15:24:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Aug 2024 15:24:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779022.1188949 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfLHl-0004yw-Ez; Sat, 17 Aug 2024 15:24:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779022.1188949; Sat, 17 Aug 2024 15:24:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfLHl-0004yp-CQ; Sat, 17 Aug 2024 15:24:09 +0000
Received: by outflank-mailman (input) for mailman id 779022;
 Sat, 17 Aug 2024 15:24:07 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfLHj-0004ye-OS; Sat, 17 Aug 2024 15:24:07 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfLHj-00035h-Mh; Sat, 17 Aug 2024 15:24:07 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfLHj-0004SY-73; Sat, 17 Aug 2024 15:24:07 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sfLHj-0004py-6g; Sat, 17 Aug 2024 15:24:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=gcUUxEm2Qd7J94CKnoI0OAXt5RJGp6NRaU8qr7NrrSA=; b=t2qCMaL6M95r90q/bFVzdVTkuC
	7H/fGYKVBul5FIjh7yivkvsXtlwNg61JnWdtf+RGCHcSnB8vwL+15tbnzEZjkVyM9PlPhyIei7oGM
	ZBBg5Lpe+vueNJBFeA/SnQAh/W9QSf6F+YILlWP7Y+nTv1ka6qBKiE0o+8TWInL9DkkE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187260-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.18-testing test] 187260: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.18-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.18-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=781c25126117f664b3ac42643b832d9ff98cc03a
X-Osstest-Versions-That:
    xen=bd51e573a730efc569646379cd59ccba967cde97
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 17 Aug 2024 15:24:07 +0000

flight 187260 xen-4.18-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187260/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187244
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187244
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187244
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187244
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187244
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187244
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  781c25126117f664b3ac42643b832d9ff98cc03a
baseline version:
 xen                  bd51e573a730efc569646379cd59ccba967cde97

Last test of basis   187244  2024-08-14 14:06:46 Z    3 days
Testing same since   187260  2024-08-17 00:06:55 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Roger Pau Monne <roger.pau@citrix.com>
  Roger Pau Monné <roger.pau@citrix.com>
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   bd51e573a7..781c251261  781c25126117f664b3ac42643b832d9ff98cc03a -> stable-4.18


From xen-devel-bounces@lists.xenproject.org Sat Aug 17 18:45:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Aug 2024 18:45:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779053.1188968 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfOQM-0001zu-6O; Sat, 17 Aug 2024 18:45:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779053.1188968; Sat, 17 Aug 2024 18:45:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfOQM-0001zn-3N; Sat, 17 Aug 2024 18:45:14 +0000
Received: by outflank-mailman (input) for mailman id 779053;
 Sat, 17 Aug 2024 18:45:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfOQK-0001zd-QC; Sat, 17 Aug 2024 18:45:12 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfOQK-0006zt-OX; Sat, 17 Aug 2024 18:45:12 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfOQK-00012U-4G; Sat, 17 Aug 2024 18:45:12 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sfOQK-0000Wl-3i; Sat, 17 Aug 2024 18:45:12 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=cK68uNWh+AWy2k9NWUANPZroWynlVQQmvC7tn081HSs=; b=P3xT/UoN7avtY9e2RuSCU3KvSH
	KCRb2ejRgYP06pfbgDylMIfVggHNf4tsVMP8vUjam9mbO6H8++fHlhybaf+dKQU5tHK1vo8mrM1vI
	ZfW34ekIJ8aRxvcB9akBTOBqTDe99ftqZcWFU0uGUbwvI2XOIeiY7BKvVZ2bLysl6FRo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187261-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-4.19-testing test] 187261: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-4.19-testing:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-4.19-testing:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=0918434e0fbee48c9dccc5fe262de5a81e380c15
X-Osstest-Versions-That:
    xen=3e8a2217f211d49dd771f7918d72df057121109f
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 17 Aug 2024 18:45:12 +0000

flight 187261 xen-4.19-testing real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187261/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187231
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187231
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187231
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187231
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187231
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187231
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  0918434e0fbee48c9dccc5fe262de5a81e380c15
baseline version:
 xen                  3e8a2217f211d49dd771f7918d72df057121109f

Last test of basis   187231  2024-08-13 15:07:12 Z    4 days
Testing same since   187261  2024-08-17 00:07:07 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   3e8a2217f2..0918434e0f  0918434e0fbee48c9dccc5fe262de5a81e380c15 -> stable-4.19


From xen-devel-bounces@lists.xenproject.org Sat Aug 17 23:12:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Aug 2024 23:12:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779075.1188978 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfSaI-0008Ug-Ba; Sat, 17 Aug 2024 23:11:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779075.1188978; Sat, 17 Aug 2024 23:11:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfSaI-0008UZ-8F; Sat, 17 Aug 2024 23:11:46 +0000
Received: by outflank-mailman (input) for mailman id 779075;
 Sat, 17 Aug 2024 23:11:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfSaG-0008UP-7c; Sat, 17 Aug 2024 23:11:44 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfSaF-00031u-Vq; Sat, 17 Aug 2024 23:11:44 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfSaF-0007Zm-EJ; Sat, 17 Aug 2024 23:11:43 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sfSaF-00079E-Dm; Sat, 17 Aug 2024 23:11:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=T3lkX6SbXp/AGBYXZtjNJJi1pubW1+vnFaS+8WZMNhw=; b=pETKsuJ5XnkxEvLIi9fq0WIJes
	1VqwYAkTo5kR0/Hwl3DdyJJ1pOiBwtJDd2T4bbVbTUB+RqoJeYDlb826NVoFH4GibNWrYd6kaL76x
	sWFSBlFVv6CxqA1y0206/AwyunXxppxtmnB2feASHTSJoWH5vN134FjbAJ8iV0Ay2SQg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187263-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187263: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-xl-credit2:host-ping-check-xen:fail:heisenbug
    xen-unstable:test-armhf-armhf-xl-rtds:host-ping-check-xen:fail:heisenbug
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=cbe73b848286f1e6b855c0ba328d56e0014d19e6
X-Osstest-Versions-That:
    xen=cbe73b848286f1e6b855c0ba328d56e0014d19e6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 17 Aug 2024 23:11:43 +0000

flight 187263 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187263/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-credit2  10 host-ping-check-xen        fail pass in 187253
 test-armhf-armhf-xl-rtds     10 host-ping-check-xen        fail pass in 187253

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-credit2 15 migrate-support-check fail in 187253 never pass
 test-armhf-armhf-xl-credit2 16 saverestore-support-check fail in 187253 never pass
 test-armhf-armhf-xl-rtds    15 migrate-support-check fail in 187253 never pass
 test-armhf-armhf-xl-rtds 16 saverestore-support-check fail in 187253 never pass
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187253
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187253
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187253
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187253
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187253
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187253
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  cbe73b848286f1e6b855c0ba328d56e0014d19e6
baseline version:
 xen                  cbe73b848286f1e6b855c0ba328d56e0014d19e6

Last test of basis   187263  2024-08-17 01:54:12 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Sun Aug 18 03:06:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Aug 2024 03:06:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779106.1188987 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfWEn-0001Jy-FG; Sun, 18 Aug 2024 03:05:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779106.1188987; Sun, 18 Aug 2024 03:05:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfWEn-0001Jr-CZ; Sun, 18 Aug 2024 03:05:49 +0000
Received: by outflank-mailman (input) for mailman id 779106;
 Sun, 18 Aug 2024 03:05:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfWEm-0001Jh-Sy; Sun, 18 Aug 2024 03:05:48 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfWEm-0006ym-OE; Sun, 18 Aug 2024 03:05:48 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfWEm-0007bI-3b; Sun, 18 Aug 2024 03:05:48 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sfWEm-0002Yf-2J; Sun, 18 Aug 2024 03:05:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=a4b0OBXpd2Uu9m27LOfudHu7Y3dVE9yD7U00Fn68uaY=; b=GxfNuDfRNvsNeznTjAb4t7hvrj
	qOEzveZbUbRQpUWo9OruLnn4KbtVxBmcyBlyuARy6YbAQooyX78B1JYaBW7o5u8smT+fYfyu6qF2R
	5FkOdBKjg02xrkqteiTr5fw8bzMiYKLQV6G3zjAWYB+2iA1Rxz9bEPyRKl/MkSBCoIzM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187264-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187264: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-armhf-armhf-xl-credit1:host-ping-check-xen:fail:heisenbug
    qemu-mainline:test-amd64-amd64-qemuu-freebsd11-amd64:guest-start/freebsd.repeat:fail:heisenbug
    qemu-mainline:test-amd64-amd64-libvirt-vhd:leak-check/check:fail:heisenbug
    qemu-mainline:test-armhf-armhf-xl-multivcpu:xen-boot:fail:heisenbug
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=ecdfa31beb1f7616091bedba79dfdf9ee525ed9d
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 18 Aug 2024 03:05:48 +0000

flight 187264 qemu-mainline real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187264/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-credit1 10 host-ping-check-xen fail in 187255 pass in 187264
 test-amd64-amd64-qemuu-freebsd11-amd64 21 guest-start/freebsd.repeat fail in 187255 pass in 187264
 test-amd64-amd64-libvirt-vhd 22 leak-check/check fail in 187255 pass in 187264
 test-armhf-armhf-xl-multivcpu  8 xen-boot                  fail pass in 187255

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check fail in 187255 never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check fail in 187255 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 qemuu                ecdfa31beb1f7616091bedba79dfdf9ee525ed9d
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  346 days
Failing since        182723  2023-09-07 18:19:05 Z  345 days   21 attempts
Testing same since   187255  2024-08-16 12:08:31 Z    1 days    2 attempts

------------------------------------------------------------
619 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 179377 lines long.)


From xen-devel-bounces@lists.xenproject.org Sun Aug 18 04:57:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Aug 2024 04:57:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779120.1188997 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfXyp-0001ow-Bi; Sun, 18 Aug 2024 04:57:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779120.1188997; Sun, 18 Aug 2024 04:57:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfXyp-0001op-96; Sun, 18 Aug 2024 04:57:27 +0000
Received: by outflank-mailman (input) for mailman id 779120;
 Sun, 18 Aug 2024 04:57:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfXyn-0001of-NV; Sun, 18 Aug 2024 04:57:25 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfXyn-0000b8-Jf; Sun, 18 Aug 2024 04:57:25 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfXyn-00038L-6z; Sun, 18 Aug 2024 04:57:25 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sfXyn-0001oq-6V; Sun, 18 Aug 2024 04:57:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=/4DRPCX/Ss0+Yauzia5gtclL9ZkAMStVpckAFApI880=; b=UCPgK9Nq1XzAhCxpgal6r60uAY
	mpwWexrftPDZRo1zrXDjhCOZJFbWWkmaH88xRjueOlvUZgJmczbEAMTCM+kkzpborjoM3gYaW39Yu
	Qhwr0e3EL4ME2w6XUjKmOJCunAGDAfiGLFHs0arpgB9GwhaxSCCZMAWURixVyXlwMZ8M=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187265-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187265: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=b1524a3efce306338f3435188c0c682d6f439e9c
X-Osstest-Versions-That:
    libvirt=f547c76bc53d676949ac44e17c311c33c7a74d3f
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 18 Aug 2024 04:57:25 +0000

flight 187265 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187265/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187247
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 libvirt              b1524a3efce306338f3435188c0c682d6f439e9c
baseline version:
 libvirt              f547c76bc53d676949ac44e17c311c33c7a74d3f

Last test of basis   187247  2024-08-15 04:22:24 Z    3 days
Testing same since   187265  2024-08-17 04:20:57 Z    1 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  jianqing yan <yanjianqing@kylinos.cn>
  Ján Tomko <jtomko@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   f547c76bc5..b1524a3efc  b1524a3efce306338f3435188c0c682d6f439e9c -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sun Aug 18 10:35:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Aug 2024 10:35:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779161.1189008 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfdFw-0002NW-9G; Sun, 18 Aug 2024 10:35:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779161.1189008; Sun, 18 Aug 2024 10:35:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfdFw-0002NP-6V; Sun, 18 Aug 2024 10:35:28 +0000
Received: by outflank-mailman (input) for mailman id 779161;
 Sun, 18 Aug 2024 10:35:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfdFu-0002NF-Uy; Sun, 18 Aug 2024 10:35:26 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfdFu-0007iR-QT; Sun, 18 Aug 2024 10:35:26 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfdFu-0006Xu-8L; Sun, 18 Aug 2024 10:35:26 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sfdFu-0003ZH-7p; Sun, 18 Aug 2024 10:35:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=uhSTI0F8pLQ/PV8CG6HSst+fdyUvIek9lxrZVRxQifU=; b=mXqYGPWmUwpJXusvTGcXLw0HUe
	VycDZHgulJgPLC2jrzfi6uZxZZ5+OaW9fcAi+S50fAMJQab/iIAHGxsYusGDQOAnqyuY/uEUUVBLn
	VOJXibHCcwiYDIMTJoIkDUpfYIy0JXqvpvGGa6LnP/irjTAkERwvSuS78pXVYQn5DdNU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187267-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187267: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=e5fa841af679cb830da6c609c740a37bdc0b8b35
X-Osstest-Versions-That:
    linux=85652baa895b59b94bea29c77cb9b51cf7120deb
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 18 Aug 2024 10:35:26 +0000

flight 187267 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187267/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt   16 saverestore-support-check fail blocked in 187257
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187257
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187257
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187257
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187257
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187257
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                e5fa841af679cb830da6c609c740a37bdc0b8b35
baseline version:
 linux                85652baa895b59b94bea29c77cb9b51cf7120deb

Last test of basis   187257  2024-08-16 23:12:36 Z    1 days
Testing same since   187267  2024-08-17 09:34:13 Z    1 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Al Viro <viro@zeniv.linux.org.uk>
  Catalin Marinas <catalin.marinas@arm.com>
  Drew Fustini <drew@pdp7.com>
  Haibo Xu <haibo1.xu@intel.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Lorenzo Pieralisi <lpieralisi@kernel.org>
  Mark Rutland <mark.rutland@arm.com>
  Michal Hocko <mhocko@suse.com>
  Samuel Holland <samuel.holland@sifive.com>
  Stephen Boyd <sboyd@kernel.org>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   85652baa895b..e5fa841af679  e5fa841af679cb830da6c609c740a37bdc0b8b35 -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Sun Aug 18 15:09:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Aug 2024 15:09:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779209.1189017 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfhWO-0001RR-0d; Sun, 18 Aug 2024 15:08:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779209.1189017; Sun, 18 Aug 2024 15:08:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfhWN-0001RK-U3; Sun, 18 Aug 2024 15:08:43 +0000
Received: by outflank-mailman (input) for mailman id 779209;
 Sun, 18 Aug 2024 15:08:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfhWN-0001RA-FH; Sun, 18 Aug 2024 15:08:43 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfhWN-0003ym-DF; Sun, 18 Aug 2024 15:08:43 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfhWM-0008Cc-Rf; Sun, 18 Aug 2024 15:08:42 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sfhWM-00068z-RC; Sun, 18 Aug 2024 15:08:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=+z2eTyvd6vKO+kPLDikp5UKIeSQiAnu5IgdmxQkhjpQ=; b=Yy5WUUDm4f1kiTSb7Q5zgvdbEX
	kc2eWsu3cbTcmeIdrytliZORg91wLbJTbJ7zxBiR1L0jf8Sd/1BNDzs+qt9g24YNeWIUF3zQ93ziq
	G3NgfQfpJJ0+YR0R0CVuzTMNyjS7rXzNxFSiTV7IGJqhZICQkGd3D1u1wGJa5TYnPy/Y=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187269-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187269: regressions - FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:regression
    xen-unstable:test-armhf-armhf-libvirt-vhd:guest-start/debian.repeat:fail:regression
    xen-unstable:test-armhf-armhf-libvirt-vhd:host-ping-check-xen:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=1e2a5f991f86979b89aa9a60ca3ba8106ee7d987
X-Osstest-Versions-That:
    xen=cbe73b848286f1e6b855c0ba328d56e0014d19e6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 18 Aug 2024 15:08:42 +0000

flight 187269 xen-unstable real [real]
flight 187272 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187269/
http://logs.test-lab.xenproject.org/osstest/logs/187272/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail REGR. vs. 187263
 test-armhf-armhf-libvirt-vhd 17 guest-start/debian.repeat fail in 187272 REGR. vs. 187263

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-libvirt-vhd 10 host-ping-check-xen fail pass in 187272-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check fail in 187272 never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check fail in 187272 never pass
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187263
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187263
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187263
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187263
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187263
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187263
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  1e2a5f991f86979b89aa9a60ca3ba8106ee7d987
baseline version:
 xen                  cbe73b848286f1e6b855c0ba328d56e0014d19e6

Last test of basis   187263  2024-08-17 01:54:12 Z    1 days
Testing same since   187269  2024-08-17 23:41:00 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 fail    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 1e2a5f991f86979b89aa9a60ca3ba8106ee7d987
Author: Stefano Stabellini <stefano.stabellini@amd.com>
Date:   Thu Aug 15 18:00:34 2024 -0700

    automation: add default QEMU_TIMEOUT value if not already set
    
    The expectation is that QEMU_TIMEOUT should be set as a Gitlab CI/CD
    variable but if not we should be able to run the pipeline anyway.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
    Reviewed-by: Michal Orzel <michal.orzel@amd.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Sun Aug 18 19:24:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Aug 2024 19:24:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779255.1189042 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sflVQ-0006aa-93; Sun, 18 Aug 2024 19:24:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779255.1189042; Sun, 18 Aug 2024 19:24:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sflVQ-0006aT-69; Sun, 18 Aug 2024 19:24:00 +0000
Received: by outflank-mailman (input) for mailman id 779255;
 Sun, 18 Aug 2024 19:23:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sflVP-0006aJ-EI; Sun, 18 Aug 2024 19:23:59 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sflVP-0000tE-8L; Sun, 18 Aug 2024 19:23:59 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sflVO-0001eo-Rc; Sun, 18 Aug 2024 19:23:58 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sflVO-00070R-RI; Sun, 18 Aug 2024 19:23:58 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=mUWyQwTacNRW14ywNOpOk5gUmpUn7UNlHpJSQ1IgxXY=; b=1MBWyWYCA+UaqVkwxF7kjkIF2g
	gCLmSO4cF1oyUvAnk1wFD4l74cKN88AupYTt7wzUi6R42HfSLtwlZ+ESjPE9skaGgWXO5PLt4H+Mp
	6UGwTkBnaFO8Qt1i5MyF/Kc9VW26kmIMDwI91GUj371ZxDXFPDqKD5gcqXFCybNwrtQ4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187270-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187270: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-libvirt:debian-fixup:fail:heisenbug
    qemu-mainline:test-amd64-amd64-xl-credit1:guest-start/debian.repeat:fail:heisenbug
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=2eefd4fcec4b8fe41ceee2a8f00cdec1fe81b75c
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 18 Aug 2024 19:23:58 +0000

flight 187270 qemu-mainline real [real]
flight 187276 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187270/
http://logs.test-lab.xenproject.org/osstest/logs/187276/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-libvirt     13 debian-fixup        fail pass in 187276-retest
 test-amd64-amd64-xl-credit1 22 guest-start/debian.repeat fail pass in 187276-retest

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt    15 migrate-support-check fail in 187276 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 qemuu                2eefd4fcec4b8fe41ceee2a8f00cdec1fe81b75c
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  346 days
Failing since        182723  2023-09-07 18:19:05 Z  346 days   22 attempts
Testing same since   187270  2024-08-18 03:11:04 Z    0 days    1 attempts

------------------------------------------------------------
619 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     fail    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 179836 lines long.)


From xen-devel-bounces@lists.xenproject.org Sun Aug 18 21:57:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 18 Aug 2024 21:57:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779276.1189053 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfntc-0004Su-Jm; Sun, 18 Aug 2024 21:57:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779276.1189053; Sun, 18 Aug 2024 21:57:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfntc-0004Sn-Gc; Sun, 18 Aug 2024 21:57:08 +0000
Received: by outflank-mailman (input) for mailman id 779276;
 Sun, 18 Aug 2024 21:57:07 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfntb-0004Sd-BJ; Sun, 18 Aug 2024 21:57:07 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfntb-0003Za-8x; Sun, 18 Aug 2024 21:57:07 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfnta-0008VW-Sw; Sun, 18 Aug 2024 21:57:07 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sfnta-00015i-SP; Sun, 18 Aug 2024 21:57:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=gQGV8fxsyYcKWHQixid7MMDK/7cGKilqF6TyoXuC+DE=; b=oNKhe9ej0b/cUB9MJr0exhnREG
	eilZ58umJklRjYfwcH7UYgI3k6V1WeD7AegxBOxkUhGI8qSHQKsYDXZJ7Bk2UgYras/fUxqNKQMid
	rYN3Ij5dVkKe/Gjlb/kXj21s2e27TM26PrzvYbX7ZASHeWzy6s5K5MD6LHzHTRbg0uyM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187271-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187271: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=c3f2d783a459980eafd24c5af94ccd56a615961f
X-Osstest-Versions-That:
    linux=e5fa841af679cb830da6c609c740a37bdc0b8b35
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 18 Aug 2024 21:57:06 +0000

flight 187271 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187271/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187267
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187267
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187267
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187267
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187267
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187267
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                c3f2d783a459980eafd24c5af94ccd56a615961f
baseline version:
 linux                e5fa841af679cb830da6c609c740a37bdc0b8b35

Last test of basis   187267  2024-08-17 09:34:13 Z    1 days
Testing same since   187271  2024-08-18 10:40:58 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alison Schofield <alison.schofield@intel.com>
  Andi Shyti <andi.shyti@kernel.org>
  Andrew Morton <akpm@linux-foundation.org>
  Baolin Wang <baolin.wang@linux.alibaba.com>
  Baoquan He <bhe@redhat.com>
  Barry Song <baohua@kernel.org>
  Breno Leitao <leitao@debian.org>
  Chandan Babu R <chandanbabu@kernel.org>
  Christophe Leroy <christophe.leroy@csgroup.eu>
  Dan Carpenter <dan.carpenter@linaro.org>
  Dan Williams <dan.j.williams@intel.com>
  Darrick J. Wong <djwong@kernel.org>
  David Hildenbrand <david@redhat.com>
  David Rientjes <rientjes@google.com>
  Dr. David Alan Gilbert <linux@treblig.org>
  Gao Xiang <hsiangkao@linux.alibaba.com>
  Guenter Roeck <linux@roeck-us.net>
  Gustavo A. R. Silva <gustavoars@kernel.org>
  Hailong Liu <hailong.liu@oppo.com>
  Jeff Xu <jeffxu@chromium.org>
  Jianxiong Gao <jxgao@google.com>
  Jinjie Ruan <ruanjinjie@huawei.com>
  Kent Overstreet <kent.overstreet@linux.dev>
  Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Martin K. Petersen <martin.petersen@oracle.com>
  Miaohe Lin <linmiaohe@huawei.com>
  Michael Ellerman <mpe@ellerman.id.au>
  Michael van der Westhuizen <rmikey@meta.com>
  Michal Hocko <mhocko@suse.com>
  Mike Rapoport (Microsoft) <rppt@kernel.org>
  Muhammad Usama Anjum <usama.anjum@collabora.com>
  Namjae Jeon <linkinjeon@kernel.org>
  Nysal Jan K.A <nysal@linux.ibm.com>
  Pasha Tatashin <pasha.tatashin@soleen.com>
  Pedro Falcato <pedro.falcato@gmail.com>
  Peter Xu <peterx@redhat.com>
  Richard Fitzgerald <rf@opensource.cirrus.com>
  Sathya Prakash Veerichetty <sathya.prakash@broadcom.com>
  Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
  Steve French <stfrench@microsoft.com>
  Su Hui <suhui@nfschina.com>
  Suren Baghdasaryan <surenb@google.com>
  Waiman Long <longman@redhat.com>
  Wolfram Sang <wsa+renesas@sang-engineering.com>
  Yi Zhang <yi.zhang@redhat.com>
  Zi Yan <ziy@nvidia.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   e5fa841af679..c3f2d783a459  c3f2d783a459980eafd24c5af94ccd56a615961f -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 03:41:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 03:41:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779308.1189063 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sftGS-0005XN-RW; Mon, 19 Aug 2024 03:41:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779308.1189063; Mon, 19 Aug 2024 03:41:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sftGS-0005XG-Oa; Mon, 19 Aug 2024 03:41:04 +0000
Received: by outflank-mailman (input) for mailman id 779308;
 Mon, 19 Aug 2024 03:41:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sftGQ-0005X6-Nw; Mon, 19 Aug 2024 03:41:02 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sftGQ-0001Wv-IL; Mon, 19 Aug 2024 03:41:02 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sftGQ-00047e-1O; Mon, 19 Aug 2024 03:41:02 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sftGQ-0005bm-0P; Mon, 19 Aug 2024 03:41:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=GE+LPk3f9dN2Zyyl/hrX8thcLAWRZIcK+tyarLaGYDc=; b=luYAjbF4jRcPwzloZNlCUgnwrJ
	D9CZmUuiDQriQA3S4ryC/R6pBeet/pDRkSibhO2sWGxStY7rXgJX00QbQIwp+OEicobRKbE9CGqCj
	YCyyrHhLcxtA6u+yVBJwzdh8sdRgEh604HkO5dmgJ7+h1d7pu9nbO+zDXDEDLkqxjhvo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187274-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187274: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=1e2a5f991f86979b89aa9a60ca3ba8106ee7d987
X-Osstest-Versions-That:
    xen=cbe73b848286f1e6b855c0ba328d56e0014d19e6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 19 Aug 2024 03:41:02 +0000

flight 187274 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187274/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187263
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187263
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187263
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187263
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187263
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187263
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  1e2a5f991f86979b89aa9a60ca3ba8106ee7d987
baseline version:
 xen                  cbe73b848286f1e6b855c0ba328d56e0014d19e6

Last test of basis   187263  2024-08-17 01:54:12 Z    2 days
Testing same since   187269  2024-08-17 23:41:00 Z    1 days    2 attempts

------------------------------------------------------------
People who touched revisions under test:
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   cbe73b8482..1e2a5f991f  1e2a5f991f86979b89aa9a60ca3ba8106ee7d987 -> master


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 07:21:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 07:21:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779334.1189076 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfwhr-00056M-Tt; Mon, 19 Aug 2024 07:21:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779334.1189076; Mon, 19 Aug 2024 07:21:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfwhr-00056F-RN; Mon, 19 Aug 2024 07:21:35 +0000
Received: by outflank-mailman (input) for mailman id 779334;
 Mon, 19 Aug 2024 07:21:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=GkhL=PS=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sfwhq-000569-9G
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 07:21:34 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on20613.outbound.protection.outlook.com
 [2a01:111:f403:2415::613])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a89d0883-5dfb-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 09:21:32 +0200 (CEST)
Received: from MW4PR03CA0173.namprd03.prod.outlook.com (2603:10b6:303:8d::28)
 by DS0PR12MB7512.namprd12.prod.outlook.com (2603:10b6:8:13a::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Mon, 19 Aug
 2024 07:21:27 +0000
Received: from SJ1PEPF00002320.namprd03.prod.outlook.com
 (2603:10b6:303:8d:cafe::15) by MW4PR03CA0173.outlook.office365.com
 (2603:10b6:303:8d::28) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20 via Frontend
 Transport; Mon, 19 Aug 2024 07:21:27 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SJ1PEPF00002320.mail.protection.outlook.com (10.167.242.86) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Mon, 19 Aug 2024 07:21:26 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 19 Aug
 2024 02:21:24 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Mon, 19 Aug 2024 02:21:23 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a89d0883-5dfb-11ef-a506-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=DOPwQKYM5Y+KF1jwzZVmWt9fc88W7sgr0KSzowFu0vQcH14f3yIfaIHOaiBfdB9GTkcEMHvwiGsG9BOrkLW6/VOl0qKfolfPGHBZV+E1LFhN1FpzTIwCHJrRHAwuGTDP9Nyxt87+5tx1BCC0ScOgtc42Cdm+BEkGb3YbgJlkmvokP0xh98f3EIRo+Mfp0GWkpmLSuAqJSfoe1trzcIKTSqlTJGSSw4VwqsqxOJvJly4JfykNx04e//87BKZ0D1h4/Td7uQgrbdreI5nF1jAKyoUdCu9Ot+C4tzigGXK54Ok1hGDPZ99NVSTIU80f/CQ/fqYG7yV3tRJpiVwORY8s6w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=owSHQt++GDUIzcfbaQOyKqgXTC8RTfyyNb8huWdpvrc=;
 b=mZSeO2MHHSDK68Cuo5Rbt6Po9Aax6+8OIrN9K0eV1Mi1cCmNFhNiNABZ9SRbIotuRrX799ntScaRPMGCWpY1sVDc3L2ShBVlOOoVwpKWpYR32oHMg3pAL+SYjm30UQGpVwaDXfA2A1mCjA6Fy9FjD0xRmxxMcWsFeHE/PPvAP52+PnWzyXZ4uXiO89Lf5BpY/Gx889usttaB85rskMeMdRt7ECbZy29dg51Ynq/Q1kvmSAMt9qt3emulJl1FytlyuLJvW0WQOExFzm/CkOWci68Ubrnv/nong2FYM95AjlRsfQo1oeIi2wtAUwNBdKp689eZj3JkDAVf85KuSHyQnQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=owSHQt++GDUIzcfbaQOyKqgXTC8RTfyyNb8huWdpvrc=;
 b=uZ7cnPGFCs1DVfm/gRzrWFwQ8VpXtTzWuruDTXOCU0GDJr/9sHSIODdiBzyDnolGv+utTVcnXmFBxOU93/qYi77pyncmKgfrLrumQvpdisP8JjB7/ap4TN14kXYcZcdQdjC3jowci2SpsfSbDqJPEXbYfUOwqh1rLfNY3ODDb+g=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <6d2fbe22-8866-4769-95d0-a5a8613a5936@amd.com>
Date: Mon, 19 Aug 2024 09:21:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] automation: restore CR filtering
To: Stefano Stabellini <sstabellini@kernel.org>,
	<xen-devel@lists.xenproject.org>
CC: Doug Goldstein <cardoe@cardoe.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>
References: <alpine.DEB.2.22.394.2408161642220.298534@ubuntu-linux-20-04-desktop>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <alpine.DEB.2.22.394.2408161642220.298534@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB03.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF00002320:EE_|DS0PR12MB7512:EE_
X-MS-Office365-Filtering-Correlation-Id: 96df61d8-bfac-4bd2-c0ae-08dcc01f89df
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?cXZEV1VkTmRON2pQamhJSk80ZUYydEFaK0FhSnVFaVJ0Z096ZVBYaG5OY1NJ?=
 =?utf-8?B?Nkc4VG13WUd4YTBBWTI5b1NDbzNoaUhYS1VpYVBGM2FERmYyNHZlbjUyRk5Z?=
 =?utf-8?B?S3hnTm5TNXljcGVhbUdyUmVnaVdvemI0aW9OQTN3RXBraERCVnBUcFpFMGZl?=
 =?utf-8?B?ZHNnMzR6RTRoZ0xBams1ZWdBQ3czcnA0NXFGeXYvTkZuMTBWd0dQY0kzSUpS?=
 =?utf-8?B?cWdOSlFhSTNCeFRhNGpkcXFOWm5tK2RwMVlSUG9CdlQrUjExaWJJZW15U240?=
 =?utf-8?B?ZXVKaG5yUFUwYUdEWkVPbEwxTXpHb0EwNFNGT0pMOXBvRGJZbWxYM2lSODJv?=
 =?utf-8?B?aHh5b0t6UnBRV2w0RjlWMFN6clVKb3cvVmUvSmVhSkhWYVFFM3J1UTcyQkJx?=
 =?utf-8?B?SFdSQ1ZRWEpEQUc4ZGc3amZIdUM1bnhKM0xVbGVvRzAvR0V2U1BBMFhoQTN4?=
 =?utf-8?B?OWRwc0dZVnN6ZXpKS2NsdEJBT3hqeVQxcVpGWXFsaTNZRnEzTTdIc2hzSWRP?=
 =?utf-8?B?SGlCdmdQYk9YZ05QNVFlNDlBWU56NkRyRklrWHlSald2aHQ3amZKaUs5YTkr?=
 =?utf-8?B?R0t2bVNvQXJjR0puQTdFUWlUVHoxbVFjeWNhTEdMYWg4dXYwZDJIVExJSWFL?=
 =?utf-8?B?VTFRak5PeC96YTRSNkpvc1VCcGwxY3JJNDJ1UmhySlhhRGFOVEFsMDEyNkpG?=
 =?utf-8?B?cm5RWU1qL0pxei9MT3FMTFh2SGRhZnkyL3psdGJBdVhkYkNMdEx5Qm9VSnVV?=
 =?utf-8?B?dlcya2pQL0FLY0FGd3J1VHkraGtDVUdtSHIrMVFSV2VSKzFRaWhjTVRtMFlU?=
 =?utf-8?B?WUg0QUpwSE9VYVNKQXdqNHRuTEVEV2ZIZTl5eHJDd1k0Y0tvNG14UzU1QXpN?=
 =?utf-8?B?OHFhb2swTlA4UnRocGd1VUNHaDJyMVZleWY1YjlmbjdiNUhaRXVHUjYwemEv?=
 =?utf-8?B?NkRsUUFraHVySWpiS01QZGw5TGZnQklLS3NkZXF2alRLN2liOTIyQlVMQlAv?=
 =?utf-8?B?TUhIV3JxcCtIMys0a2h2RHMrOTJzTWo0QnJjaUVwc3BTamh4UVJTOHBzR0Jr?=
 =?utf-8?B?dyttcWdjTGRmT0IyK1BzNzRTRmg4YWozWWs5eDJDZko3L2poTjRCVGhmb3hJ?=
 =?utf-8?B?d3pNK1NqSElBc3ZrckxscWlvdCtqN0ZLdDVRSFkwU0pXS2xVR0lOT0xacnZw?=
 =?utf-8?B?MGo0RjFNOEtXMmdFaEVTTEhGTlNBQlNhWXpxY0lKNWF5Z3pyeWdqTGduUENI?=
 =?utf-8?B?TXIzcGp5OCtRQ05VbHVxc2RrUGx5THpDM2pRdXhiMW5uN2xvWUExUEtjendR?=
 =?utf-8?B?UFM2TlE2RnV6ejhKV05ET3hTTXRZYmlIaEgyeGJScTZPcGNxcE1rb1pzeFlL?=
 =?utf-8?B?UGRydW1KUlp2OFBqSTd6VlRPNXFKaUNPNkV2RWZJaDRkckl4a2lwMkRGcUt1?=
 =?utf-8?B?UG5uSjB6cW45U1B2Q05aVXdsRHcvWkZ5a2V3TmNDeHdmYThPRlBQa1c5YU9S?=
 =?utf-8?B?eHRUVW1tdGgwTk1JOVdCS3Y2L3JsSHRBZzBBZXAvOU82UGxLRXkzclVPUTBX?=
 =?utf-8?B?d2hHRnlOSi83WWIyTXRQZktxMVp6bFhKOGlIaldrOUxRdllDZXlZTUJNVTk2?=
 =?utf-8?B?U1YvcTlsSThnR0lzSmp3SXlUT01sR3FZU0hRQkxlL2dxRUNLaXQ0OHVyTlNU?=
 =?utf-8?B?ZnNWd0JJZXZldWQ3Y25xSERZd2t5TXc3Zm45WEJNZkR2cUtteTlNMWtKc3Vq?=
 =?utf-8?B?ejZGTVhGcVhwR2c2bnZDdWlMNUdhNlpBRG16dk12ekM1bThDUHdPUUxocjVW?=
 =?utf-8?B?MnNIT2xhQ3ZzRmg5dTVMdWI2ajZGUFcxRDZUTyt3N3RVZVZqVjhiQjNXK2xq?=
 =?utf-8?B?Z1V1dXNPQ2FnVU1PU0hTQ1V2QUVZUlFHbWlmUnRadkQzR0M4N2JuRHhRQnpy?=
 =?utf-8?B?ZitzV0ZXOGR4T2NVOFFTV3NsTmU5YWJicUlQSHE1NXZETlpxaEZtLzlZZTMw?=
 =?utf-8?B?Wjk2UVRLZzFRPT0=?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Aug 2024 07:21:26.8023
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 96df61d8-bfac-4bd2-c0ae-08dcc01f89df
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF00002320.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7512

Hi Stefano,

On 17/08/2024 01:46, Stefano Stabellini wrote:
> 
> 
> After commit c36efb7fcea6 ("automation: use expect to run QEMU") we lost
> the \r filtering introduced by b576497e3b7d ("automation: remove CR
> characters from serial output"). This patch reintroduced it.
> 
> Fixes: c36efb7fcea6 ("automation: use expect to run QEMU")
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
> 
> diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
> index 5359e0820b..343b71d5ac 100755
> --- a/automation/scripts/qemu-alpine-x86_64.sh
> +++ b/automation/scripts/qemu-alpine-x86_64.sh
> @@ -89,4 +89,4 @@ export QEMU_LOG="smoke.serial"
>  export LOG_MSG="Domain-0"
>  export PASSED="BusyBox"
> 
> -./automation/scripts/qemu-key.exp
> +./automation/scripts/qemu-key.exp | sed 's/\r//'
> diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
> index bbdcb39f1a..a3ccbbd7f4 100755
> --- a/automation/scripts/qemu-smoke-dom0-arm32.sh
> +++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
> @@ -96,4 +96,4 @@ export QEMU_LOG="${serial_log}"
>  export LOG_MSG="Domain-0"
>  export PASSED="/ #"
> 
> -../automation/scripts/qemu-key.exp
> +../automation/scripts/qemu-key.exp | sed 's/\r//'
> diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
> index 0094bfc8e1..a781022d48 100755
> --- a/automation/scripts/qemu-smoke-dom0-arm64.sh
> +++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
> @@ -109,4 +109,4 @@ export QEMU_LOG="smoke.serial"
>  export LOG_MSG="Domain-0"
>  export PASSED="BusyBox"
> 
> -./automation/scripts/qemu-key.exp
> +./automation/scripts/qemu-key.exp | sed 's/\r//'
> diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> index 68ffbabdb8..3c32a676ff 100755
> --- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
> +++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> @@ -149,4 +149,4 @@ export QEMU_LOG="${serial_log}"
>  export LOG_MSG="${dom0_prompt}"
>  export PASSED="${passed}"
> 
> -../automation/scripts/qemu-key.exp
> +../automation/scripts/qemu-key.exp | sed 's/\r//'
> diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> index eb25c4af4b..a13bd8ee04 100755
> --- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
> +++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> @@ -220,4 +220,4 @@ export QEMU_LOG="smoke.serial"
>  export LOG_MSG="Welcome to Alpine Linux"
>  export PASSED="${passed}"
> 
> -./automation/scripts/qemu-key.exp
> +./automation/scripts/qemu-key.exp | sed 's/\r//'
> diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/scripts/qemu-smoke-ppc64le.sh
> index ccb4a576f4..3c02771914 100755
> --- a/automation/scripts/qemu-smoke-ppc64le.sh
> +++ b/automation/scripts/qemu-smoke-ppc64le.sh
> @@ -25,4 +25,4 @@ export QEMU_CMD="qemu-system-ppc64 \
>  export QEMU_LOG="${serial_log}"
>  export PASSED="Hello, ppc64le!"
> 
> -./automation/scripts/qemu-key.exp
> +./automation/scripts/qemu-key.exp | sed 's/\r//'
> diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
> index 0355c075b7..7ede5a5d8a 100755
> --- a/automation/scripts/qemu-smoke-riscv64.sh
> +++ b/automation/scripts/qemu-smoke-riscv64.sh
> @@ -16,4 +16,4 @@ export QEMU_CMD="qemu-system-riscv64 \
>  export QEMU_LOG="smoke.serial"
>  export PASSED="All set up"
> 
> -./automation/scripts/qemu-key.exp
> +./automation/scripts/qemu-key.exp | sed 's/\r//'
> diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
> index 37ac10e068..81e7dba329 100755
> --- a/automation/scripts/qemu-smoke-x86-64.sh
> +++ b/automation/scripts/qemu-smoke-x86-64.sh
> @@ -24,4 +24,4 @@ export QEMU_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
>  export QEMU_LOG="smoke.serial"
>  export PASSED="Test result: SUCCESS"
> 
> -./automation/scripts/qemu-key.exp
> +./automation/scripts/qemu-key.exp | sed 's/\r//'
> diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> index 0666f6363e..ed44aab0f0 100755
> --- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
> +++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> @@ -65,4 +65,4 @@ export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x4000000
>  export QEMU_LOG="smoke.serial"
>  export PASSED="${passed}"
> 
> -./automation/scripts/qemu-key.exp
> +./automation/scripts/qemu-key.exp | sed 's/\r//'

I compared 3 pipelines:
1) one before c36efb7fcea6 (https://gitlab.com/xen-project/hardware/xen/-/jobs/7566986885)
2) one after c36efb7fcea6 (https://gitlab.com/xen-project/hardware/xen/-/jobs/7603830706)
3) one with this fix (https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7603783403)

In 1), there is Xen log + Linux log in Gitlab web page
In 2), there is no log at all
In 3), there is only Xen log visible

I think we should aim at restoring the original behavior i.e. all logs visible.

~Michal


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 07:55:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 07:55:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779342.1189087 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfxEf-0001kt-Dh; Mon, 19 Aug 2024 07:55:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779342.1189087; Mon, 19 Aug 2024 07:55:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfxEf-0001km-Ap; Mon, 19 Aug 2024 07:55:29 +0000
Received: by outflank-mailman (input) for mailman id 779342;
 Mon, 19 Aug 2024 07:55:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfxEd-0001kc-K1; Mon, 19 Aug 2024 07:55:27 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfxEd-0006UB-9C; Mon, 19 Aug 2024 07:55:27 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sfxEc-0007Sa-PQ; Mon, 19 Aug 2024 07:55:26 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sfxEc-0008Ht-Oz; Mon, 19 Aug 2024 07:55:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=nEwUhAB6tZKQ8SmMqyaWUIYZbe6bt18uolpCwuOdgDA=; b=tU65I9Nr8k/e88LToJWlTkDD4I
	OKrD4LkpmvgiTUsAIkpiDexHpsby5cAZOFRBENVJV4lNEfurqSLMpyXUMT5GTNxZ2HUjecw5OizDg
	cylfoOUhEREbpoYmwgPZ2WKwSIIlcIN3cbNyfWn4sgZk11NxKaK6LI9urMuQak37cs2E=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187278-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187278: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-libvirt:debian-fixup:fail:heisenbug
    qemu-mainline:test-amd64-amd64-xl-credit1:guest-start/debian.repeat:fail:heisenbug
    qemu-mainline:test-amd64-amd64-libvirt-vhd:leak-check/check:fail:heisenbug
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=2eefd4fcec4b8fe41ceee2a8f00cdec1fe81b75c
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 19 Aug 2024 07:55:26 +0000

flight 187278 qemu-mainline real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187278/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-libvirt     13 debian-fixup     fail in 187270 pass in 187278
 test-amd64-amd64-xl-credit1 22 guest-start/debian.repeat fail in 187270 pass in 187278
 test-amd64-amd64-libvirt-vhd 22 leak-check/check           fail pass in 187270

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 qemuu                2eefd4fcec4b8fe41ceee2a8f00cdec1fe81b75c
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  347 days
Failing since        182723  2023-09-07 18:19:05 Z  346 days   23 attempts
Testing same since   187270  2024-08-18 03:11:04 Z    1 days    2 attempts

------------------------------------------------------------
619 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 179836 lines long.)


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 08:30:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 08:30:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779362.1189097 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfxm4-0007u9-3E; Mon, 19 Aug 2024 08:30:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779362.1189097; Mon, 19 Aug 2024 08:30:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfxm4-0007u2-0M; Mon, 19 Aug 2024 08:30:00 +0000
Received: by outflank-mailman (input) for mailman id 779362;
 Mon, 19 Aug 2024 08:29: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=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sfxm2-0007tw-Dz
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 08:29:58 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 366a3372-5e05-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 10:29:55 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a7aa4bf4d1eso547819766b.0
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 01:29:55 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838c6975sm606113366b.41.2024.08.19.01.29.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 01:29:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 366a3372-5e05-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724056195; x=1724660995; 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=HhK5LmhLJrjxqPJMGiybz52HfegyVbi8scbd5zKGW9w=;
        b=Z7RlrH6dgr6p5BmnoFOdQRyk8aeDZrgKP3sw21RIL8RTXEreo0IpcaLo+4PyJOTFIz
         gu0Wkrd6lcTgWR6xC+t7nyO01U3AG2AqrU/LayoReUVUVzBxuQrMHLSM5GXHY6jADkRS
         byqGIRVJe0DdMyM8lwlqco43NJW/VSSQ2AbylJ5xnZcjo0RoEDCIEEG69aRc5oP9kcJ/
         GT3lMyp3Qs1DoCEcnH/AQo3qsYQl/4sZ+HxGwGQhBKyMVYOr411JPcnAQIv3kV+yc+ch
         OZDgUbEzSANrnC7pUizp8MXNpgiiKpkKClqtGm9CEW6ToZiygfutY02xj4rRywbvHIzV
         dp7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724056195; x=1724660995;
        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=HhK5LmhLJrjxqPJMGiybz52HfegyVbi8scbd5zKGW9w=;
        b=ESw+x/XCZizOOy/TqW5r/IXyWeo262gUtXDS3QCwhfaaCagMdGKTMj57Zmcg55ZcKS
         2IMdFv+Upr+/0x9VXNgt0o395OXjrAdemc9VvZMx4R1Ay67tNzFKUXrIzjI4KApsqLwX
         UwZt4D0JldRSmXHjxwSRtOemUqXVNiwFPBighhqCdlhG+7VirDJdXDuN8T4X4W0XD3R0
         4zIk3h+hiJODqt9OJjSQ+hm/dHKzvK0YyA4GthO597XVpHlXx7M5m4oTTvbsTdJlAvFL
         Ff/6iZ6D14UxXaLLM5dYce12VWnj+debCUoyBBwRgPecmTZ9Kb0xoSx8ntZG//pMQP9z
         RDEw==
X-Forwarded-Encrypted: i=1; AJvYcCX/ShyBw57naEfRJvfvRSOIO+0hR5CzeggDBbwWoQNkH7QqpyUbZeK1pE/1TKH2pvA4LPGl7lUJByI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzU1gXTZLUaIg3MC8PMn+oLnVJUyvf2/WqK0a6zsSDloGf+9x54
	eTNbsbR+XhWwHtXZCRKnrUrMaCF1n8p81jFoN5oQipab2QDXrkC7gJ8nPU/qkQ==
X-Google-Smtp-Source: AGHT+IFcnvCPLLYA6YkTVzTK+K6pSWLhYBs/S9v7rxRHWxNlzIY3tiuK90KQ1hgn+n+R8bw1S4WfEQ==
X-Received: by 2002:a17:907:d2cf:b0:a7a:9f78:fef with SMTP id a640c23a62f3a-a83929f1229mr788493166b.45.1724056194692;
        Mon, 19 Aug 2024 01:29:54 -0700 (PDT)
Message-ID: <3f216f24-f89c-4060-9fbe-045bfd6a90ee@suse.com>
Date: Mon, 19 Aug 2024 10:29:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 13/22] x86/hvm: use a per-pCPU monitor table in HAP mode
To: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <20240726152206.28411-1-roger.pau@citrix.com>
 <20240726152206.28411-14-roger.pau@citrix.com>
 <D3HJ80ZGO0MR.2JCGJIV5JPYQP@cloud.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: <D3HJ80ZGO0MR.2JCGJIV5JPYQP@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 16.08.2024 20:02, Alejandro Vallejo wrote:
> On Fri Jul 26, 2024 at 4:21 PM BST, Roger Pau Monne wrote:
>> Instead of allocating a monitor table for each vCPU when running in HVM HAP
>> mode, use a per-pCPU monitor table, which gets the per-domain slot updated on
>> guest context switch.
>>
>> This limits the amount of memory used for HVM HAP monitor tables to the amount
>> of active pCPUs, rather than to the number of vCPUs.  It also simplifies vCPU
>> allocation and teardown, since the monitor table handling is removed from
>> there.
>>
>> Note the switch to using a per-CPU monitor table is done regardless of whether
> 
> s/per-CPU/per-pCPU/

While this adjustment is probably fine (albeit I wouldn't insist), ...

>> --- a/xen/arch/x86/hvm/hvm.c
>> +++ b/xen/arch/x86/hvm/hvm.c
>> @@ -104,6 +104,54 @@ static const char __initconst warning_hvm_fep[] =
>>  static bool __initdata opt_altp2m_enabled;
>>  boolean_param("altp2m", opt_altp2m_enabled);
>>  
>> +DEFINE_PER_CPU(root_pgentry_t *, monitor_pgt);
>> +
>> +static int allocate_cpu_monitor_table(unsigned int cpu)
> 
> To avoid ambiguity, could we call these *_pcpu_*() instead?

... I can spot only very few functions with "pcpu" in their names, and I
think we're also pretty clear in distinguishing vcpu from cpu. Therefore
I'd rather not see any p-s added to function names.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 08:38:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 08:38:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779372.1189107 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfxtr-0001Wd-SN; Mon, 19 Aug 2024 08:38:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779372.1189107; Mon, 19 Aug 2024 08:38:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfxtr-0001WW-Pc; Mon, 19 Aug 2024 08:38:03 +0000
Received: by outflank-mailman (input) for mailman id 779372;
 Mon, 19 Aug 2024 08:38: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=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sfxtq-0001WO-Oi
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 08:38:02 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5869012f-5e06-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 10:38:01 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a80eab3945eso396483966b.1
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 01:38:01 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383935663sm609614266b.121.2024.08.19.01.38.00
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 01:38:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5869012f-5e06-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724056681; x=1724661481; 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=Po6rIQYyY7nYjtZw4+yf/KTdeRab1+PujHa8aubR1is=;
        b=TTdUKxTe80TlGZQASrjYeR+d3cT3ZhIIB7ieCqc71RuWNrXUHx/kVqj0K441wDTF5w
         YnpMQRxuPEge+DlJI8G/APMIsMpMauiLexPClifTDxRvoT0rZRiCZoG7TpetMXa+QfKX
         hORlk7Dr8D4ldrmEt4++gEzuAYeJ+l0UxsOKgwrB3++omHCidnuvpi9Csyh7jJk9KeOp
         fIg7EJYZuriREuHnXqgRwLhNt6hHgwLAWJRWZDZxNx4gOV6D7vNSVGVK0EHJDZTE1HzR
         Hi4PBfp1aJta9riXKszOE5lH9Hzh6jSLAvK9W006KknNRo4xka5qfzP2JcTpw7hGZf5u
         bN4w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724056681; x=1724661481;
        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=Po6rIQYyY7nYjtZw4+yf/KTdeRab1+PujHa8aubR1is=;
        b=gES06naX2ADOgwM5jMlI2YCAHgk0xVNYGyb+ls2btU8Q2nsl7T36GbDMAwO9ZRAvx2
         T4l39p7/oFxCMKMbUIu6LIhxHZp9wXJFwzdnTDyi8Hcb/pKLZPWZuo1BZrgMFtKS/KMa
         Lj3/1zKg8BCMOVcbAgbuwiAEzDrgf75PSCB98MTnn9iBFVg5JQyKuhEzSWoZuaI5P8oh
         h1XvQpDlpTV8hkq6aS7G7vJCgEAOtS5OaUhZsChHG61X1ZELwhWTNb40AkQE1PZaEsIE
         +Q0IjB+06QjeJO0D8qj/ksnt1iV+pLroRyAe7i6nKb9kVwDGwx7nMF9g4M8K37QIrsBU
         wFRw==
X-Gm-Message-State: AOJu0YyyAPlWRXn/CuH4jfIlBnRn9xZS1Ltc9egsZeePwliQ3uCIJWTg
	ETJscdKztuM5xkMCjeZm8OAOb75fxJ8/ZMpkFQqPaxb81eHIc7Li4N3+1rADQw==
X-Google-Smtp-Source: AGHT+IGtXTB04zKH+dBSwjgzTfDxcR+QE9Z24GUFUx3kJBs9f7WbJOj6izsuo5pPjrvMkVjMTJNm1A==
X-Received: by 2002:a17:906:f595:b0:a77:dd1c:6273 with SMTP id a640c23a62f3a-a83928a9930mr764928666b.12.1724056681132;
        Mon, 19 Aug 2024 01:38:01 -0700 (PDT)
Message-ID: <c5e23ad4-5415-4ea9-9b9d-806cd93fd742@suse.com>
Date: Mon, 19 Aug 2024 10:38:00 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: Xen Project statistics help
To: Stefano Stabellini <sstabellini@kernel.org>,
 Kelly Choi <kelly.choi@cloud.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, committers@xenproject.org
References: <CAO-mL=zWYsDGkBoDtc8erGfAFnaR1y+FaLKsx3pEJ3MgxKAy0Q@mail.gmail.com>
 <alpine.DEB.2.22.394.2408161111160.298534@ubuntu-linux-20-04-desktop>
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: <alpine.DEB.2.22.394.2408161111160.298534@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 16.08.2024 20:25, Stefano Stabellini wrote:
> xen.biterg.io was created by a company called Bitergia. Bitergia was
> later contracted by the Linux Foundation to create a generic dashboard
> for all their Open Source projects. Getting access to the Linux
> Foundation dashboard is the best way to go (if it comes to no cost to
> our project).
> 
> I have used scripts like these in the past to get some data out of a
> release. You can copy/paste the output to an Excel datasheet to do
> further calculations there.
> 
> # List of contributors by name (using the commit "Author" tag) for the
> # 4.19 release. One name per commit.
> git log 4.18.0-rc4...4.19.0-rc4 --format='%aN' | sort | uniq -c | sort -rn
> 
> # List of reviewers (using the Reviewed-by and Acked-by tags) for the
> # 4.19 release. One name per review.
> git log 4.18.0-rc4...4.19.0-rc4 --pretty=format:%b | grep -E "Reviewed-by|Acked-by" | sed -E 's/.*(Reviewed-by|Acked-by):\s*(.*)\s*<.*/\2/' | sort | uniq -c | sort -rn

Just to mention it: Going by tags here doesn't come anywhere close to the
actual work put into reviewing, even when leaving aside the obvious
difference between small, large but mechanical, and large+intrusive
changes. Imo unlike commit stats, review stats would better be collected
from the mailing list.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 08:53:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 08:53:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779381.1189116 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfy92-0004cV-4l; Mon, 19 Aug 2024 08:53:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779381.1189116; Mon, 19 Aug 2024 08:53:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfy92-0004cO-2A; Mon, 19 Aug 2024 08:53:44 +0000
Received: by outflank-mailman (input) for mailman id 779381;
 Mon, 19 Aug 2024 08:53:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sfy90-0004cI-WE
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 08:53:43 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 87e63b3b-5e08-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 10:53:40 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a7a9cf7d3f3so512612966b.1
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 01:53: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-a83838cf97dsm607421466b.72.2024.08.19.01.53.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 01:53:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 87e63b3b-5e08-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724057620; x=1724662420; 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=PdCgoZv8il/gZtXvoe9qTIOAToZ6EcDXhQUYj6AcUak=;
        b=Hj0vYLs1+iyKI71BTEzs1abaIy2cB43NdfCRf7EMu/5Uho0SnOCrmEt2fnRrVTH2Pv
         8ZqqQbO8YqFHvH6D4Jxluy5RJ+vcKWAlUhhRUnYBpj3mT1C27UXp3VWgNs2K9gXfgWWX
         sBBW2SgI0aM1IaQaSoq9Hcy66uSatZrh20l42AdiKjGA4zX2zdQUVNb7Ifwkq++nQwJr
         IFFMnyRvdDJ/U32MbpwmiouRHiTVHkzZklwmb3Gbq7HroZraoXINBHyRrKehG/eqA1Je
         EyxkQ3KtuHOgQ3cs9Z2uuYer6MC1Dam8COIvQ678iwJ5BSP3t6Ite05VbIL1erdderLp
         fGTQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724057620; x=1724662420;
        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=PdCgoZv8il/gZtXvoe9qTIOAToZ6EcDXhQUYj6AcUak=;
        b=H9NXAH4jbTeeCphxx8S2CaAyu+RIkSkNt4klkXXPEn4nCqDN+bSk6RdaJeG+BuQO2g
         oiHLNLsdqF4ts2ya6ImfHhF7jlk3+d3NYgzVOvHRMXzSChMyOCdf0NAnfOIi4O4Hz6kr
         dGI73E6icvscl0HqG2nlf7JRJl/WJCSo7ELZXkxgKSzz1xfppZ0Yj0S7IXGpSoks6Rem
         R7hMYc8lci+VTsMr9baQDds3sxK/NCRmfLcTWt7KEkvHYvT2jFrW0avSgZsmVgO9/oGx
         vEh6K8zWz1c589POzd8W/Kc/uZNxowe2E9BM0qMicG8KTMjQGSDq262jiYhpr+6JKBh1
         k46g==
X-Forwarded-Encrypted: i=1; AJvYcCUDT52fmwJp6KROOKZ5787oMak7tYvMDK+YK5pr5FMil+idY5yRoVw9u+QlPTolc87I7hXaKVOjwjTeZf955mpADTo76qDUI3cHWir0+1k=
X-Gm-Message-State: AOJu0YzATPMs8BPX/Y4nPvSo0cXvKyn92gpS7qKaa9YI7uMrP59y4ZR/
	fQsS78LRF8moZE+wiJCLe+jFcVpdRNpS4ng9NmQR5VfBeZsfl//yVlmfvYfScg==
X-Google-Smtp-Source: AGHT+IFGBjJkr3iczjpGpPg3vgRyLWCBZEwqxr+YKqeRuKMOa7xHDtxeffAl/3IcpaPHFcuer9zt4w==
X-Received: by 2002:a17:907:da5:b0:a77:c314:d621 with SMTP id a640c23a62f3a-a83a9fb91c1mr568665366b.13.1724057619805;
        Mon, 19 Aug 2024 01:53:39 -0700 (PDT)
Message-ID: <5cd1fac5-bf4f-4a5b-b02f-e971d36581b0@suse.com>
Date: Mon, 19 Aug 2024 10:53:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v2 1/5] x86/Kconfig: introduce CENTAUR, HYGON &
 SHANGHAI config options
To: Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 xen-devel@lists.xenproject.org
References: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
 <2a217c9602e92f92050cb4894bb9a42ee99a84ea.1723806405.git.Sergiy_Kibrik@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <2a217c9602e92f92050cb4894bb9a42ee99a84ea.1723806405.git.Sergiy_Kibrik@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 16.08.2024 13:10, Sergiy Kibrik wrote:
> --- a/xen/arch/x86/Kconfig.cpu
> +++ b/xen/arch/x86/Kconfig.cpu
> @@ -10,6 +10,25 @@ config AMD
>  	  May be turned off in builds targetting other vendors.  Otherwise,
>  	  must be enabled for Xen to work suitably on AMD platforms.
>  
> +config CENTAUR
> +	bool "Support Centaur CPUs"
> +	default y
> +	help
> +	  Detection, tunings and quirks for VIA platforms.
> +
> +	  May be turned off in builds targeting other vendors. Otherwise, must
> +          be enabled for Xen to work suitably on VIA platforms.
> +
> +config HYGON
> +	bool "Support Hygon CPUs"
> +	depends on AMD
> +	default y
> +	help
> +	  Detection, tunings and quirks for Hygon platforms.
> +
> +	  May be turned off in builds targeting other vendors. Otherwise, must
> +          be enabled for Xen to work suitably on Hygon platforms.
> +
>  config INTEL
>  	bool "Support Intel CPUs"
>  	default y
> @@ -19,4 +38,14 @@ config INTEL
>  	  May be turned off in builds targetting other vendors.  Otherwise,
>  	  must be enabled for Xen to work suitably on Intel platforms.
>  
> +config SHANGHAI
> +	bool "Support Shanghai CPUs"
> +	depends on INTEL
> +	default y
> +	help
> +	  Detection, tunings and quirks for Zhaoxin platforms.
> +
> +	  May be turned off in builds targeting other vendors. Otherwise, must
> +          be enabled for Xen to work suitably on Zhaoxin platforms.
> +
>  endmenu

Imo this re-raises the question of whether it is a good idea to leave out
"CPU" from the names: The more names there are, the more likely it'll become
that going forward we'll run into a naming collision. Andrew, iirc you
were the main proponent for omitting "CPU" - may I ask that you re-consider?

Furthermore I wonder whether "depends on" is appropriate here. This way one
won't be offered e.g. SHANGHAI if earlier on one de-selected INTEL.

Plus it is mere luck that the alphabetic ordering ends up with the dependents
after their dependencies (things would be somewhat odd the other way around).

Finally please check indentation of help text - there is one inconsistency
repeated for all three entries being added.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 08:56:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 08:56:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779399.1189128 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyBr-0005mx-JM; Mon, 19 Aug 2024 08:56:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779399.1189128; Mon, 19 Aug 2024 08:56:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyBr-0005mq-F3; Mon, 19 Aug 2024 08:56:39 +0000
Received: by outflank-mailman (input) for mailman id 779399;
 Mon, 19 Aug 2024 08:56:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mhAH=PS=cloud.com=fouad.hilly@srs-se1.protection.inumbo.net>)
 id 1sfyBq-0005fE-BV
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 08:56:38 +0000
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com
 [2a00:1450:4864:20::130])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f19d6a77-5e08-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 10:56:37 +0200 (CEST)
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-52f01b8738dso3271222e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 01:56:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f19d6a77-5e08-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724057797; x=1724662597; 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=w30or32qPiF9VehZnxi9A0McTv8fX6oUg17NoQL8QW8=;
        b=ILJx5JCxZxjy39YXkwqW2f6la7Tj8j8lb7tWR/k2XRLyYkd4xK3dTAxdHWGmDDBvCA
         bAsMxtCfxtMmYsdFAVBomk1QMUldSHPRb7XgzHA5Kxop2wXrMlNUL+9sS1epFsIA5/P/
         kcMx0Vuy8DE+JAmJ6YFMMzh/MHfHKqnEo2nBE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724057797; x=1724662597;
        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=w30or32qPiF9VehZnxi9A0McTv8fX6oUg17NoQL8QW8=;
        b=Ag2Z6693p2dubc8pDIsPObzcsXv1+o1vJ2jDjfFJ7rneQZKmaw/K7WFEIU7fnbVqwr
         vZQMD4skoqTYFF2RomixWhu8gaECTzGg7aU/OaMqevJYf4ZMAh3RsSDMyEK1HK/IvwTv
         uGs09bzI3usPEZgp9aGGVUX8HZUKutSb629rHhKRdnHk8qSOnNRAuQblvpoUwJpqq+Z/
         fY5o3dmqzypdnSIsOzi28+neZyFWccxS+Midbx+FOpOHC6dVUMK7f+QYbyaGyjvEkno2
         w8dnaS5FMofJyj4XLd66tsiVkMfTdQRnM2Ckm2KUSdi05pZNVvXF3gI1HVecBHXTCoCk
         Qn/w==
X-Gm-Message-State: AOJu0YwV9tfTs6N7KFlyGChxi4xUZl87p068tho1Y4JcfSB+/+sIcY3Y
	78Nu54IkatXM++uKOR89sYM+MGtHb0atEr6tVRyr94wYRrAeDC5iQL6GDWVGTWnEKsMw27t/V5e
	bdCFUjrYOu0hfe/lo598CC+Yzx+2UI1/4fRuumQ==
X-Google-Smtp-Source: AGHT+IHfVgPO9cVZfYmekq2Lr1wxkHaU/VKK8RuubjlPmPrajFBFD/c6ro8vLRq5jPX2AKy7Eyh9NgkQ1L56F5irw7E=
X-Received: by 2002:a05:6512:1244:b0:52c:9725:b32b with SMTP id
 2adb3069b0e04-5331c6a219emr5762581e87.17.1724057796352; Mon, 19 Aug 2024
 01:56:36 -0700 (PDT)
MIME-Version: 1.0
References: <20240712130749.1272741-1-fouad.hilly@cloud.com>
 <20240712130749.1272741-3-fouad.hilly@cloud.com> <ZqEyGD4wgL/z9nn5@l14>
In-Reply-To: <ZqEyGD4wgL/z9nn5@l14>
From: Fouad Hilly <fouad.hilly@cloud.com>
Date: Mon, 19 Aug 2024 09:56:25 +0100
Message-ID: <CAJKAvHY_mJnx0SsOpALtCNXMXppt=UrKMwiDSHzVjLzawq5rSQ@mail.gmail.com>
Subject: Re: [PATCH v5 2/4] x86/ucode: refactor xen-ucode to utilize getopt
To: Anthony PERARD <anthony.perard@vates.tech>
Cc: xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000863d330620057c12"

--000000000000863d330620057c12
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 24, 2024 at 5:55=E2=80=AFPM Anthony PERARD <anthony.perard@vate=
s.tech>
wrote:

> On Fri, Jul 12, 2024 at 02:07:47PM +0100, Fouad Hilly wrote:
> > diff --git a/tools/misc/xen-ucode.c b/tools/misc/xen-ucode.c
> > index 390969db3d1c..8de82e5b8a10 100644
> > --- a/tools/misc/xen-ucode.c
> > +++ b/tools/misc/xen-ucode.c
> > @@ -71,12 +72,29 @@ static void show_curr_cpu(FILE *f)
> >      }
> >  }
> >
> > +static void usage(FILE *stream, const char *name)
> > +{
> > +    fprintf(stream,
> > +            "%s: Xen microcode updating tool\n"
> > +            "options:\n"
> > +            "  -h, --help            display this help\n"
> > +            "  -s, --show-cpu-info   show CPU information\n"
> > +            "Usage: %s [microcode file] [options]\n", name, name);
>
> FYI, I disagree with Andy about the order of this message. First is
> "Usage:" which explain where the option (dash-prefixed) can go, and
> which are the mandatory arguments, sometime having all the single-letter
> option in this line as well. Then there's an explanation of what the
> options are. I've check `bash`, `cat`, `xl`, `gcc`.
>
> I wonder which CLI program would print the minimum amount of information
> on how to run the program as the last line of the help message.
>

My Bad, I misinterpreted Andy's comment, will fix in v7:
static void usage(FILE *stream, const char *name)
{
    fprintf(stream,
            "%s: Xen microcode updating tool\n"
            "Usage: %s [options | microcode-file]\n"
            "options:\n"
            "  -h, --help            display this help\n"
            "  -s, --show-cpu-info   show CPU information\n",
            name, name);
    show_curr_cpu(stream);
}

>
> > @@ -86,22 +104,34 @@ int main(int argc, char *argv[])
> >          exit(1);
> >      }
> >
> > -    if ( argc < 2 )
> > +    while ( (opt =3D getopt_long(argc, argv, "hs", options, NULL)) !=
=3D -1 )
> >      {
> > -        fprintf(stderr,
> > -                "xen-ucode: Xen microcode updating tool\n"
> > -                "Usage: %s [<microcode file> | show-cpu-info]\n",
> argv[0]);
> > -        show_curr_cpu(stderr);
> > -        exit(2);
> > +        switch (opt)
> > +        {
> > +        case 'h':
> > +            usage(stdout, argv[0]);
> > +            exit(EXIT_SUCCESS);
> > +
> > +        case 's':
> > +            show_curr_cpu(stdout);
> > +            exit(EXIT_SUCCESS);
> > +
> > +        default:
> > +            goto ext_err;
> > +        }
> >      }
> >
> > -    if ( !strcmp(argv[1], "show-cpu-info") )
> > +    if ( optind =3D=3D argc )
> > +        goto ext_err;
> > +
> > +    /* For backwards compatibility to the pre-getopt() cmdline handlin=
g
> */
> > +    if ( !strcmp(argv[optind], "show-cpu-info") )
> >      {
> >          show_curr_cpu(stdout);
> >          return 0;
> >      }
> >
> > -    filename =3D argv[1];
> > +    filename =3D argv[optind];
> >      fd =3D open(filename, O_RDONLY);
> >      if ( fd < 0 )
> >      {
> > @@ -146,4 +176,10 @@ int main(int argc, char *argv[])
> >      close(fd);
> >
> >      return 0;
> > +
> > + ext_err:
> > +    fprintf(stderr,
> > +            "%s: unable to process command line arguments\n", argv[0])=
;
>
> A nice to have would be to have a better error message to point out
> what's wrong with the arguments. For that you could print the error
> message before "goto ext_err". One would be "unknown option" for the
> first goto, and "missing microcode file" for the second goto, that is
> instead of printing this more generic error message.
>

Sure, I will have specific error messages instead of generic one in v7

>
> Cheers,
>
> --
>
> Anthony Perard | Vates XCP-ng Developer
>
> XCP-ng & Xen Orchestra - Vates solutions
>
> web: https://vates.tech


Thanks,

Fouad

--000000000000863d330620057c12
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Wed, Jul 24, 2024 at 5:55=E2=80=AF=
PM Anthony PERARD &lt;anthony.perard@vates.tech&gt; wrote:<br></div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1p=
x solid rgb(204,204,204);padding-left:1ex">On Fri, Jul 12, 2024 at 02:07:47=
PM +0100, Fouad Hilly wrote:<br>
&gt; diff --git a/tools/misc/xen-ucode.c b/tools/misc/xen-ucode.c<br>
&gt; index 390969db3d1c..8de82e5b8a10 100644<br>
&gt; --- a/tools/misc/xen-ucode.c<br>
&gt; +++ b/tools/misc/xen-ucode.c<br>
&gt; @@ -71,12 +72,29 @@ static void show_curr_cpu(FILE *f)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; +static void usage(FILE *stream, const char *name)<br>
&gt; +{<br>
&gt; +=C2=A0 =C2=A0 fprintf(stream,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;%s: Xen microcode upd=
ating tool\n&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;options:\n&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0 -h, --help=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 display this help\n&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0 -s, --show-cpu=
-info=C2=A0 =C2=A0show CPU information\n&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Usage: %s [microcode =
file] [options]\n&quot;, name, name);<br>
<br>
FYI, I disagree with Andy about the order of this message. First is<br>
&quot;Usage:&quot; which explain where the option (dash-prefixed) can go, a=
nd<br>
which are the mandatory arguments, sometime having all the single-letter<br=
>
option in this line as well. Then there&#39;s an explanation of what the<br=
>
options are. I&#39;ve check `bash`, `cat`, `xl`, `gcc`.<br>
<br>
I wonder which CLI program would print the minimum amount of information<br=
>
on how to run the program as the last line of the help message.<br></blockq=
uote><div><br></div><div>My Bad, I misinterpreted Andy&#39;s comment, will =
fix in v7:</div><div><div style=3D"color:rgb(204,204,204);background-color:=
rgb(31,31,31);font-family:Consolas,&quot;Courier New&quot;,monospace;font-s=
ize:14px;line-height:19px;white-space:pre-wrap"><div><span style=3D"color:r=
gb(86,156,214)">static</span> <span style=3D"color:rgb(86,156,214)">void</s=
pan> <span style=3D"color:rgb(220,220,170)">usage</span>(FILE <span style=
=3D"color:rgb(212,212,212)">*</span><span style=3D"color:rgb(156,220,254)">=
stream</span>, <span style=3D"color:rgb(86,156,214)">const</span> <span sty=
le=3D"color:rgb(86,156,214)">char</span> <span style=3D"color:rgb(212,212,2=
12)">*</span><span style=3D"color:rgb(156,220,254)">name</span>)</div><div>=
{</div><div>=C2=A0 =C2=A0 <span style=3D"color:rgb(220,220,170)">fprintf</s=
pan>(stream,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span styl=
e=3D"color:rgb(206,145,120)">&quot;</span><span style=3D"color:rgb(156,220,=
254)">%s</span><span style=3D"color:rgb(206,145,120)">: Xen microcode updat=
ing tool</span><span style=3D"color:rgb(215,186,125)">\n</span><span style=
=3D"color:rgb(206,145,120)">&quot;</span></div><div>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 <span style=3D"color:rgb(206,145,120)">&quot;Usage: </=
span><span style=3D"color:rgb(156,220,254)">%s</span><span style=3D"color:r=
gb(206,145,120)"> [options | microcode-file]</span><span style=3D"color:rgb=
(215,186,125)">\n</span><span style=3D"color:rgb(206,145,120)">&quot;</span=
></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span style=3D"color:=
rgb(206,145,120)">&quot;options:</span><span style=3D"color:rgb(215,186,125=
)">\n</span><span style=3D"color:rgb(206,145,120)">&quot;</span></div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span style=3D"color:rgb(206,145,=
120)">&quot; =C2=A0-h, --help =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0disp=
lay this help</span><span style=3D"color:rgb(215,186,125)">\n</span><span s=
tyle=3D"color:rgb(206,145,120)">&quot;</span></div><div>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 <span style=3D"color:rgb(206,145,120)">&quot; =C2=
=A0-s, --show-cpu-info =C2=A0 show CPU information</span><span style=3D"col=
or:rgb(215,186,125)">\n</span><span style=3D"color:rgb(206,145,120)">&quot;=
</span>,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 name, name);</=
div><div>=C2=A0 =C2=A0 <span style=3D"color:rgb(220,220,170)">show_curr_cpu=
</span>(stream);</div><div>}</div></div></div><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex">
<br>
&gt; @@ -86,22 +104,34 @@ int main(int argc, char *argv[])<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit(1);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 if ( argc &lt; 2 )<br>
&gt; +=C2=A0 =C2=A0 while ( (opt =3D getopt_long(argc, argv, &quot;hs&quot;=
, options, NULL)) !=3D -1 )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 {<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 fprintf(stderr,<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;xen-uco=
de: Xen microcode updating tool\n&quot;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Usage: =
%s [&lt;microcode file&gt; | show-cpu-info]\n&quot;, argv[0]);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 show_curr_cpu(stderr);<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 exit(2);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 switch (opt)<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 {<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 case &#39;h&#39;:<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 usage(stdout, argv[0]);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit(EXIT_SUCCESS);<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 case &#39;s&#39;:<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 show_curr_cpu(stdout);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit(EXIT_SUCCESS);<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 default:<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 goto ext_err;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 if ( !strcmp(argv[1], &quot;show-cpu-info&quot;) )<br>
&gt; +=C2=A0 =C2=A0 if ( optind =3D=3D argc )<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 goto ext_err;<br>
&gt; +<br>
&gt; +=C2=A0 =C2=A0 /* For backwards compatibility to the pre-getopt() cmdl=
ine handling */<br>
&gt; +=C2=A0 =C2=A0 if ( !strcmp(argv[optind], &quot;show-cpu-info&quot;) )=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 show_curr_cpu(stdout);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return 0;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 filename =3D argv[1];<br>
&gt; +=C2=A0 =C2=A0 filename =3D argv[optind];<br>
&gt;=C2=A0 =C2=A0 =C2=A0 fd =3D open(filename, O_RDONLY);<br>
&gt;=C2=A0 =C2=A0 =C2=A0 if ( fd &lt; 0 )<br>
&gt;=C2=A0 =C2=A0 =C2=A0 {<br>
&gt; @@ -146,4 +176,10 @@ int main(int argc, char *argv[])<br>
&gt;=C2=A0 =C2=A0 =C2=A0 close(fd);<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 return 0;<br>
&gt; +<br>
&gt; + ext_err:<br>
&gt; +=C2=A0 =C2=A0 fprintf(stderr,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;%s: unable to process=
 command line arguments\n&quot;, argv[0]);<br>
<br>
A nice to have would be to have a better error message to point out<br>
what&#39;s wrong with the arguments. For that you could print the error<br>
message before &quot;goto ext_err&quot;. One would be &quot;unknown option&=
quot; for the<br>
first goto, and &quot;missing microcode file&quot; for the second goto, tha=
t is<br>
instead of printing this more generic error message.<br></blockquote><div><=
br></div><div>Sure, I will have specific error messages instead of generic =
one in v7=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px =
0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Cheers,<br>
<br>
-- <br>
<br>
Anthony Perard | Vates XCP-ng Developer<br>
<br>
XCP-ng &amp; Xen Orchestra - Vates solutions<br>
<br>
web: <a href=3D"https://vates.tech" rel=3D"noreferrer" target=3D"_blank">ht=
tps://vates.tech</a></blockquote><div><br></div><div>Thanks,</div><div><br>=
</div><div>Fouad=C2=A0=C2=A0</div></div></div>

--000000000000863d330620057c12--


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 08:56:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 08:56:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779401.1189137 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyC6-00068o-Sk; Mon, 19 Aug 2024 08:56:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779401.1189137; Mon, 19 Aug 2024 08:56:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyC6-00068f-Pw; Mon, 19 Aug 2024 08:56:54 +0000
Received: by outflank-mailman (input) for mailman id 779401;
 Mon, 19 Aug 2024 08:56: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=mhAH=PS=cloud.com=fouad.hilly@srs-se1.protection.inumbo.net>)
 id 1sfyC5-0005fE-Av
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 08:56:53 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id faa498f2-5e08-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 10:56:53 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-53301d46c54so5342401e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 01:56:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: faa498f2-5e08-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724057812; x=1724662612; 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=YEmuqgTAZOeKu0aCS9k5lKEaCh4b2NLQOiXLT8kpyEw=;
        b=NUIZ+yhgJ105XcgQm8l4t8Lek4VySfpzf9EWdNRaCL+Kvvmn/ogvSfql2xqXTmTtT6
         Dt07B1uFIBeIA0fjA1qj0iSrPuEZx5ZK+csHrJQ6cwp7uAwtX33hRmwIXmSxfzmWs1zy
         Au93DZO2JhhIkfucMxvhPKITIF8A33xBW9tD0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724057812; x=1724662612;
        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=YEmuqgTAZOeKu0aCS9k5lKEaCh4b2NLQOiXLT8kpyEw=;
        b=k+CEsHvTPPmWAUQxt/fUtOSPNqrO9JdLnQVjhg2NAKjxui4siAfMKF1M2n951fLpLf
         2Gf2vb/Xe4hpINaRpA8tTzErzjuiORuKIF407b5mWauwI+LvqeHp4A9fUdywNDet4VKi
         oWAYiK9Zo8Fgu5hBiSeP67Lk6IWPODCmo1lJonFviNEt6QA4uy+E3THXSZmIn+SoA8KK
         aQqTv/L+pJCF9IXhVXyHLRzw19kjQ3BFed1tvasHD9eGXSBgJHIoPcPOU+CHnYFnGZbd
         JIp2r9jYzZrnr02cNO1xGhHqqpgod2re2h+Z3nfDPZpV1i2eLFz4n4OIy3RHxeC5zMfv
         gvpQ==
X-Forwarded-Encrypted: i=1; AJvYcCVXgA+ltmESjuC7P1oJHYiUy2/IGrkZyUY+3e8IK+6SoypuPTSy9fd0V/sbXoMRFZuYzthiDfQRBs7jA5vILfusnmkiw0mq4JshvjynceM=
X-Gm-Message-State: AOJu0YzsYf1stsS0hMZuwrb+JJQ/u8NCXEFts9IGYhXXRN+3RWUEnvwU
	DLOU3gAuyglTrmlC/ZuFiSDFYEcNQcNBunBXpScfTw1jgJ+wVMGrunu6lP6LsE+PABU3NhHgWUX
	jCdz1miKNkpzjjUFxBLCRWcFhsT3Ci97HeLQGqQ==
X-Google-Smtp-Source: AGHT+IF+2/AgU4qLDtZHbQgRW/DBOL1dYXJHxW+FlHuDCg5Tee+c2sSOES3lv3MW/m2g+B1/rvXLYBqwnwI2TnsxLag=
X-Received: by 2002:a05:6512:3d0a:b0:52e:ff2a:217 with SMTP id
 2adb3069b0e04-5331c6effe2mr6388590e87.50.1724057811859; Mon, 19 Aug 2024
 01:56:51 -0700 (PDT)
MIME-Version: 1.0
References: <20240725082725.2685481-1-fouad.hilly@cloud.com>
 <20240725082725.2685481-3-fouad.hilly@cloud.com> <e2d2244d-66ac-46bd-b047-044c9860c955@suse.com>
In-Reply-To: <e2d2244d-66ac-46bd-b047-044c9860c955@suse.com>
From: Fouad Hilly <fouad.hilly@cloud.com>
Date: Mon, 19 Aug 2024 09:56:41 +0100
Message-ID: <CAJKAvHZx-fQ6McT8q5NSFzgN3FtHKbF_m1DdhFtTKXgHrNx0BA@mail.gmail.com>
Subject: Re: [PATCH v6 2/4] x86/ucode: refactor xen-ucode to utilize getopt
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>, xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="00000000000072e0990620057d31"

--00000000000072e0990620057d31
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 25, 2024 at 9:41=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wro=
te:

> On 25.07.2024 10:27, Fouad Hilly wrote:
> > @@ -71,12 +72,29 @@ static void show_curr_cpu(FILE *f)
> >      }
> >  }
> >
> > +static void usage(FILE *stream, const char *name)
> > +{
> > +    fprintf(stream,
> > +            "%s: Xen microcode updating tool\n"
> > +            "options:\n"
> > +            "  -h, --help            display this help\n"
> > +            "  -s, --show-cpu-info   show CPU information\n"
> > +            "Usage: %s [microcode file | options]\n", name, name);
>
> Oh, and: While I gave this precise layout as an outline, it wasn't really
> meant to be used literally. Note how "microcode" and "file" now suggest
> there need to be two separate command line elements. Perhaps using
> "microcode-file" instead may already make this less ambiguous.
>

Yes indeed, I will fix in v7:
  static void usage(FILE *stream, const char *name)
{
    fprintf(stream,
            "%s: Xen microcode updating tool\n"
            "Usage: %s [options | microcode-file]\n"
            "options:\n"
            "  -h, --help                       display this help\n"
            "  -s, --show-cpu-info              show CPU information\n"
            "  -f, --force <microcode-file>     skip certain checks; do not
\n"
            "                                   use unless you know exactly
\n"
            "                                   what you are doing\n",
            name, name);
    show_curr_cpu(stream);
}

>
> Jan
>

Thanks,

Fouad

--00000000000072e0990620057d31
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jul 25, 2024 at 9:41=E2=80=AF=
AM Jan Beulich &lt;<a href=3D"mailto:jbeulich@suse.com" target=3D"_blank">j=
beulich@suse.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" =
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex">On 25.07.2024 10:27, Fouad Hilly wrote:<br>
&gt; @@ -71,12 +72,29 @@ static void show_curr_cpu(FILE *f)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 }<br>
&gt;=C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; +static void usage(FILE *stream, const char *name)<br>
&gt; +{<br>
&gt; +=C2=A0 =C2=A0 fprintf(stream,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;%s: Xen microcode upd=
ating tool\n&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;options:\n&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0 -h, --help=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 display this help\n&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0 -s, --show-cpu=
-info=C2=A0 =C2=A0show CPU information\n&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Usage: %s [microcode =
file | options]\n&quot;, name, name);<br>
<br>
Oh, and: While I gave this precise layout as an outline, it wasn&#39;t real=
ly<br>
meant to be used literally. Note how &quot;microcode&quot; and &quot;file&q=
uot; now suggest<br>
there need to be two separate command line elements. Perhaps using<br>
&quot;microcode-file&quot; instead may already make this less ambiguous.<br=
></blockquote><div><br></div><div>Yes indeed, I will fix in v7:</div><div>=
=C2=A0=C2=A0<span style=3D"background-color:rgb(31,31,31);font-family:Conso=
las,&quot;Courier New&quot;,monospace;font-size:14px;white-space:pre-wrap;c=
olor:rgb(86,156,214)">static</span><span style=3D"background-color:rgb(31,3=
1,31);color:rgb(204,204,204);font-family:Consolas,&quot;Courier New&quot;,m=
onospace;font-size:14px;white-space:pre-wrap"> </span><span style=3D"backgr=
ound-color:rgb(31,31,31);font-family:Consolas,&quot;Courier New&quot;,monos=
pace;font-size:14px;white-space:pre-wrap;color:rgb(86,156,214)">void</span>=
<span style=3D"background-color:rgb(31,31,31);color:rgb(204,204,204);font-f=
amily:Consolas,&quot;Courier New&quot;,monospace;font-size:14px;white-space=
:pre-wrap"> </span><span style=3D"background-color:rgb(31,31,31);font-famil=
y:Consolas,&quot;Courier New&quot;,monospace;font-size:14px;white-space:pre=
-wrap;color:rgb(220,220,170)">usage</span><span style=3D"background-color:r=
gb(31,31,31);color:rgb(204,204,204);font-family:Consolas,&quot;Courier New&=
quot;,monospace;font-size:14px;white-space:pre-wrap">(FILE </span><span sty=
le=3D"background-color:rgb(31,31,31);font-family:Consolas,&quot;Courier New=
&quot;,monospace;font-size:14px;white-space:pre-wrap;color:rgb(212,212,212)=
">*</span><span style=3D"background-color:rgb(31,31,31);font-family:Consola=
s,&quot;Courier New&quot;,monospace;font-size:14px;white-space:pre-wrap;col=
or:rgb(156,220,254)">stream</span><span style=3D"background-color:rgb(31,31=
,31);color:rgb(204,204,204);font-family:Consolas,&quot;Courier New&quot;,mo=
nospace;font-size:14px;white-space:pre-wrap">, </span><span style=3D"backgr=
ound-color:rgb(31,31,31);font-family:Consolas,&quot;Courier New&quot;,monos=
pace;font-size:14px;white-space:pre-wrap;color:rgb(86,156,214)">const</span=
><span style=3D"background-color:rgb(31,31,31);color:rgb(204,204,204);font-=
family:Consolas,&quot;Courier New&quot;,monospace;font-size:14px;white-spac=
e:pre-wrap"> </span><span style=3D"background-color:rgb(31,31,31);font-fami=
ly:Consolas,&quot;Courier New&quot;,monospace;font-size:14px;white-space:pr=
e-wrap;color:rgb(86,156,214)">char</span><span style=3D"background-color:rg=
b(31,31,31);color:rgb(204,204,204);font-family:Consolas,&quot;Courier New&q=
uot;,monospace;font-size:14px;white-space:pre-wrap"> </span><span style=3D"=
background-color:rgb(31,31,31);font-family:Consolas,&quot;Courier New&quot;=
,monospace;font-size:14px;white-space:pre-wrap;color:rgb(212,212,212)">*</s=
pan><span style=3D"background-color:rgb(31,31,31);font-family:Consolas,&quo=
t;Courier New&quot;,monospace;font-size:14px;white-space:pre-wrap;color:rgb=
(156,220,254)">name</span><span style=3D"background-color:rgb(31,31,31);col=
or:rgb(204,204,204);font-family:Consolas,&quot;Courier New&quot;,monospace;=
font-size:14px;white-space:pre-wrap">)</span><br></div><div style=3D"color:=
rgb(204,204,204);background-color:rgb(31,31,31);font-family:Consolas,&quot;=
Courier New&quot;,monospace;font-size:14px;line-height:19px;white-space:pre=
-wrap"><div>{</div><div>=C2=A0 =C2=A0 <span style=3D"color:rgb(220,220,170)=
">fprintf</span>(stream,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 <span style=3D"color:rgb(206,145,120)">&quot;</span><span style=3D"colo=
r:rgb(156,220,254)">%s</span><span style=3D"color:rgb(206,145,120)">: Xen m=
icrocode updating tool</span><span style=3D"color:rgb(215,186,125)">\n</spa=
n><span style=3D"color:rgb(206,145,120)">&quot;</span></div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span style=3D"color:rgb(206,145,120)">&quo=
t;Usage: </span><span style=3D"color:rgb(156,220,254)">%s</span><span style=
=3D"color:rgb(206,145,120)"> [options | microcode-file]</span><span style=
=3D"color:rgb(215,186,125)">\n</span><span style=3D"color:rgb(206,145,120)"=
>&quot;</span></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span st=
yle=3D"color:rgb(206,145,120)">&quot;options:</span><span style=3D"color:rg=
b(215,186,125)">\n</span><span style=3D"color:rgb(206,145,120)">&quot;</spa=
n></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span style=3D"color=
:rgb(206,145,120)">&quot; =C2=A0-h, --help =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 display this help</span><span=
 style=3D"color:rgb(215,186,125)">\n</span><span style=3D"color:rgb(206,145=
,120)">&quot;</span></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <s=
pan style=3D"color:rgb(206,145,120)">&quot; =C2=A0-s, --show-cpu-info =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0show CPU information</span><sp=
an style=3D"color:rgb(215,186,125)">\n</span><span style=3D"color:rgb(206,1=
45,120)">&quot;</span></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
<span style=3D"color:rgb(206,145,120)">&quot; =C2=A0-f, --force &lt;microco=
de-file&gt; =C2=A0 =C2=A0 skip certain checks; do not</span><span style=3D"=
color:rgb(215,186,125)">\n</span><span style=3D"color:rgb(206,145,120)">&qu=
ot;</span></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span style=
=3D"color:rgb(206,145,120)">&quot; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 use unless you know exactly</span><span style=3D"color:rgb(215,186,1=
25)">\n</span><span style=3D"color:rgb(206,145,120)">&quot;</span></div><di=
v>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span style=3D"color:rgb(206,14=
5,120)">&quot; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 what you are do=
ing</span><span style=3D"color:rgb(215,186,125)">\n</span><span style=3D"co=
lor:rgb(206,145,120)">&quot;</span>,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 name, name);</div><div>=C2=A0 =C2=A0 <span style=3D"color:rgb=
(220,220,170)">show_curr_cpu</span>(stream);</div><div>}</div></div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1p=
x solid rgb(204,204,204);padding-left:1ex">
<br>
Jan<br></blockquote><div><br></div><div>Thanks,</div><div><br></div><div>Fo=
uad=C2=A0</div></div></div>

--00000000000072e0990620057d31--


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 08:57:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 08:57:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779408.1189147 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyCO-0006dM-3r; Mon, 19 Aug 2024 08:57:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779408.1189147; Mon, 19 Aug 2024 08:57:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyCO-0006dF-0o; Mon, 19 Aug 2024 08:57:12 +0000
Received: by outflank-mailman (input) for mailman id 779408;
 Mon, 19 Aug 2024 08:57:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mhAH=PS=cloud.com=fouad.hilly@srs-se1.protection.inumbo.net>)
 id 1sfyCM-0005fE-Lh
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 08:57:10 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 04e346f4-5e09-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 10:57:10 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2f025b94e07so45650841fa.0
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 01:57:10 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 04e346f4-5e09-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724057830; x=1724662630; 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=1FYMsk7TEsbmJN7jxn5NfCREsiyNySqeYW4WZR8Xrlo=;
        b=kXxxsjjU/TiC1kGLKDH4lmKZuFNuQmgpHFptArFLhaimjvT53RSLX0cAd/XNMVyxQo
         X0r711fCKcS8CZ48186XTGA8wfaKq9Nv0L99D0ys9ppP0EV5wU5m3nR2eFXSkQXmpgXP
         2GjWZNjHnuiFLRAUVULdupy77ktGed99nKjEE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724057830; x=1724662630;
        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=1FYMsk7TEsbmJN7jxn5NfCREsiyNySqeYW4WZR8Xrlo=;
        b=H+QQNF9KYi7qkY7ujdaAcL4DizcTqxTgqFcm38CYYSU+US9x6JJtnuOKXS4mN0FXCA
         UDgrv4UG/o6Acc3VeWSNyp2AvJJ9wrvqIQ70gElmSz9VjdMC7eCsOMMeyGjH38gYZB7v
         MxG7qBlEDG58kpY7a6mVQFuYvMdGhU2iT2+glFD78MaomwidvTui0z4h0/66DfaKnkp4
         NfyF9jTS6TkfmmRrpKIrun1VQKglsX0L1f6Nr/yzU/qQHefflHfPI0UOcWAFgHY5u0W3
         Su0Awy3iSFN7eUuJTIvvZKjr9NnqtQ7e745/HDRcKh2Uov9QU2k9ARIIGwMFArf9MRVO
         FJog==
X-Forwarded-Encrypted: i=1; AJvYcCWiBG6eFt8Y3+4uivOzk2EPIwq4B7TqfwkZuzg6egIFCcANonfxjuBnx1yDOo8LVfKk05daA6TJ3XG/xgxlvG5eP/kT3V8esTjruK33cOU=
X-Gm-Message-State: AOJu0YyWK9LFo7nU2NYRll12LhF59jJ9wqKQQntBtCvDf/cKnsFJAi7K
	2jRi+S85n55XhQqoJxjajADHD8+ZDyO0vSeHec4oyuu+GnqefjeG1i+ZpkZI4+/9jx72nTiLd1p
	TvsCBIlb4x02FBDzewYr3rguYPdaBgjUUKILiXA==
X-Google-Smtp-Source: AGHT+IHCN7WapRzkg4OaxXWKThPzcwODCHtxX2D5KQ4oDFOMVjbKdkvEur16UAlPQmMl6S+It3pVV5P0K54YQwLDTg8=
X-Received: by 2002:a2e:4a12:0:b0:2f3:c033:d2e3 with SMTP id
 38308e7fff4ca-2f3c033d35emr60914241fa.15.1724057828733; Mon, 19 Aug 2024
 01:57:08 -0700 (PDT)
MIME-Version: 1.0
References: <20240725082725.2685481-1-fouad.hilly@cloud.com>
 <20240725082725.2685481-4-fouad.hilly@cloud.com> <d26bc29f-3ceb-4fe4-af58-c188f9bbf097@suse.com>
In-Reply-To: <d26bc29f-3ceb-4fe4-af58-c188f9bbf097@suse.com>
From: Fouad Hilly <fouad.hilly@cloud.com>
Date: Mon, 19 Aug 2024 09:56:57 +0100
Message-ID: <CAJKAvHbM=Dhi=VRuaKKGMgoyOP9PHyF=Q50wfezpxs=mkRTZug@mail.gmail.com>
Subject: Re: [PATCH v6 3/4] x86/ucode: Introduce --force option to xen-ucode
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>, Juergen Gross <jgross@suse.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="0000000000007456600620057e8b"

--0000000000007456600620057e8b
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 25, 2024 at 9:44=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wro=
te:

> On 25.07.2024 10:27, Fouad Hilly wrote:
> > Introduce --force option to xen-ucode to force skipping microcode
> version check, which
> > allows the user to update x86 microcode even if both versions are the
> same or downgrade.
> > xc_microcode_update() refactored to accept flags and utilize
> xenpf_microcode_update2.
> >
> > Signed-off-by: Fouad Hilly <fouad.hilly@cloud.com>
> > Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > ---
> > [v6]
> > 1- Fix usage() output for -f option to be explicitly wrapped for 80
> character width
> > [v5]
> > 1- Update commit message.
> > 2- Re-phrase --force option description.
> > [v4]
> > 1- Add --force to xen-ucode options.
> > 2- Update xc_microcode_update() to accept and handle flags.
> > ---
> >  tools/include/xenctrl.h   |  3 ++-
> >  tools/libs/ctrl/xc_misc.c | 12 +++++++-----
> >  tools/misc/xen-ucode.c    | 15 ++++++++++++---
> >  3 files changed, 21 insertions(+), 9 deletions(-)
> >
> > diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
> > index 9ceca0cffc2f..2c4608c09ab0 100644
> > --- a/tools/include/xenctrl.h
> > +++ b/tools/include/xenctrl.h
> > @@ -1171,7 +1171,8 @@ typedef uint32_t xc_node_to_node_dist_t;
> >  int xc_physinfo(xc_interface *xch, xc_physinfo_t *info);
> >  int xc_cputopoinfo(xc_interface *xch, unsigned *max_cpus,
> >                     xc_cputopo_t *cputopo);
> > -int xc_microcode_update(xc_interface *xch, const void *buf, size_t len=
);
> > +int xc_microcode_update(xc_interface *xch, const void *buf,
> > +                        size_t len, unsigned int flags);
> >  int xc_get_cpu_version(xc_interface *xch, struct xenpf_pcpu_version
> *cpu_ver);
> >  int xc_get_ucode_revision(xc_interface *xch,
> >                            struct xenpf_ucode_revision *ucode_rev);
> > diff --git a/tools/libs/ctrl/xc_misc.c b/tools/libs/ctrl/xc_misc.c
> > index 50282fd60dcc..6a60216bda03 100644
> > --- a/tools/libs/ctrl/xc_misc.c
> > +++ b/tools/libs/ctrl/xc_misc.c
> > @@ -203,11 +203,12 @@ int xc_physinfo(xc_interface *xch,
> >      return 0;
> >  }
> >
> > -int xc_microcode_update(xc_interface *xch, const void *buf, size_t len=
)
> > +int xc_microcode_update(xc_interface *xch, const void *buf,
> > +                        size_t len, unsigned int flags)
> >  {
> >      int ret;
> >      struct xen_platform_op platform_op =3D {};
> > -    DECLARE_HYPERCALL_BUFFER(struct xenpf_microcode_update, uc);
> > +    DECLARE_HYPERCALL_BUFFER(struct xenpf_microcode_update2, uc);
> >
> >      uc =3D xc_hypercall_buffer_alloc(xch, uc, len);
> >      if ( uc =3D=3D NULL )
> > @@ -215,9 +216,10 @@ int xc_microcode_update(xc_interface *xch, const
> void *buf, size_t len)
> >
> >      memcpy(uc, buf, len);
> >
> > -    platform_op.cmd =3D XENPF_microcode_update;
> > -    platform_op.u.microcode.length =3D len;
> > -    set_xen_guest_handle(platform_op.u.microcode.data, uc);
> > +    platform_op.cmd =3D XENPF_microcode_update2;
> > +    platform_op.u.microcode2.length =3D len;
> > +    platform_op.u.microcode2.flags =3D flags;
> > +    set_xen_guest_handle(platform_op.u.microcode2.data, uc);
> >
> >      ret =3D do_platform_op(xch, &platform_op);
> >
> > diff --git a/tools/misc/xen-ucode.c b/tools/misc/xen-ucode.c
> > index 2c9f337b86cb..688e540943b1 100644
> > --- a/tools/misc/xen-ucode.c
> > +++ b/tools/misc/xen-ucode.c
> > @@ -13,6 +13,8 @@
> >  #include <xenctrl.h>
> >  #include <getopt.h>
> >
> > +#include <xen/platform.h>
> > +
> >  static xc_interface *xch;
> >
> >  static const char intel_id[] =3D "GenuineIntel";
> > @@ -79,7 +81,9 @@ static void usage(FILE *stream, const char *name)
> >              "options:\n"
> >              "  -h, --help            display this help\n"
> >              "  -s, --show-cpu-info   show CPU information\n"
> > -            "Usage: %s [microcode file | options]\n", name, name);
> > +            "  -f, --force           skip certain checks; do not use
> unless\n"
> > +            "you know exactly what you are doing\n"
>
> Did you look at the produced output? Imo you want to have
>
>             "  -f, --force           skip certain checks; do not use
> unless\n"
>             "                        you know exactly what you are doing\=
n"
>
> > +            "Usage: %s [microcode file [-f,--force] | options]\n",
> name, name);
>
> At least
>
>             "Usage: %s [microcode file [-f|--force] | options]\n", name,
> name);
>
> But: "options" now includes -f / --force, yet that on its own makes no
> sense.
> I think this needs further textual clarification to properly indicate wha=
t
> is
> valid to use and what is not.
>

Will be fixed in v7:
static void usage(FILE *stream, const char *name)
{
    fprintf(stream,
            "%s: Xen microcode updating tool\n"
            "Usage: %s [options | microcode-file]\n"
            "options:\n"
            "  -h, --help                       display this help\n"
            "  -s, --show-cpu-info              show CPU information\n"
            "  -f, --force <microcode-file>     skip certain checks; do not
\n"
            "                                   use unless you know exactly
\n"
            "                                   what you are doing\n",
            name, name);
    show_curr_cpu(stream);
}

>
> Jan
>

Thanks,

Fouad

--0000000000007456600620057e8b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jul 25, 2024 at 9:44=E2=80=AF=
AM Jan Beulich &lt;<a href=3D"mailto:jbeulich@suse.com" target=3D"_blank">j=
beulich@suse.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" =
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex">On 25.07.2024 10:27, Fouad Hilly wrote:<br>
&gt; Introduce --force option to xen-ucode to force skipping microcode vers=
ion check, which<br>
&gt; allows the user to update x86 microcode even if both versions are the =
same or downgrade.<br>
&gt; xc_microcode_update() refactored to accept flags and utilize xenpf_mic=
rocode_update2.<br>
&gt; <br>
&gt; Signed-off-by: Fouad Hilly &lt;<a href=3D"mailto:fouad.hilly@cloud.com=
" target=3D"_blank">fouad.hilly@cloud.com</a>&gt;<br>
&gt; Reviewed-by: Andrew Cooper &lt;<a href=3D"mailto:andrew.cooper3@citrix=
.com" target=3D"_blank">andrew.cooper3@citrix.com</a>&gt;<br>
&gt; ---<br>
&gt; [v6]<br>
&gt; 1- Fix usage() output for -f option to be explicitly wrapped for 80 ch=
aracter width<br>
&gt; [v5]<br>
&gt; 1- Update commit message.<br>
&gt; 2- Re-phrase --force option description.<br>
&gt; [v4]<br>
&gt; 1- Add --force to xen-ucode options.<br>
&gt; 2- Update xc_microcode_update() to accept and handle flags.<br>
&gt; ---<br>
&gt;=C2=A0 tools/include/xenctrl.h=C2=A0 =C2=A0|=C2=A0 3 ++-<br>
&gt;=C2=A0 tools/libs/ctrl/xc_misc.c | 12 +++++++-----<br>
&gt;=C2=A0 tools/misc/xen-ucode.c=C2=A0 =C2=A0 | 15 ++++++++++++---<br>
&gt;=C2=A0 3 files changed, 21 insertions(+), 9 deletions(-)<br>
&gt; <br>
&gt; diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h<br>
&gt; index 9ceca0cffc2f..2c4608c09ab0 100644<br>
&gt; --- a/tools/include/xenctrl.h<br>
&gt; +++ b/tools/include/xenctrl.h<br>
&gt; @@ -1171,7 +1171,8 @@ typedef uint32_t xc_node_to_node_dist_t;<br>
&gt;=C2=A0 int xc_physinfo(xc_interface *xch, xc_physinfo_t *info);<br>
&gt;=C2=A0 int xc_cputopoinfo(xc_interface *xch, unsigned *max_cpus,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0xc_cputopo_t *cputopo);<br>
&gt; -int xc_microcode_update(xc_interface *xch, const void *buf, size_t le=
n);<br>
&gt; +int xc_microcode_update(xc_interface *xch, const void *buf,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 size_t len, unsigned int flags);<br>
&gt;=C2=A0 int xc_get_cpu_version(xc_interface *xch, struct xenpf_pcpu_vers=
ion *cpu_ver);<br>
&gt;=C2=A0 int xc_get_ucode_revision(xc_interface *xch,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct xenpf_ucode_revision *ucode_rev);<br>
&gt; diff --git a/tools/libs/ctrl/xc_misc.c b/tools/libs/ctrl/xc_misc.c<br>
&gt; index 50282fd60dcc..6a60216bda03 100644<br>
&gt; --- a/tools/libs/ctrl/xc_misc.c<br>
&gt; +++ b/tools/libs/ctrl/xc_misc.c<br>
&gt; @@ -203,11 +203,12 @@ int xc_physinfo(xc_interface *xch,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 return 0;<br>
&gt;=C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; -int xc_microcode_update(xc_interface *xch, const void *buf, size_t le=
n)<br>
&gt; +int xc_microcode_update(xc_interface *xch, const void *buf,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 size_t len, unsigned int flags)<br>
&gt;=C2=A0 {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 int ret;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 struct xen_platform_op platform_op =3D {};<br>
&gt; -=C2=A0 =C2=A0 DECLARE_HYPERCALL_BUFFER(struct xenpf_microcode_update,=
 uc);<br>
&gt; +=C2=A0 =C2=A0 DECLARE_HYPERCALL_BUFFER(struct xenpf_microcode_update2=
, uc);<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 uc =3D xc_hypercall_buffer_alloc(xch, uc, len);<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 if ( uc =3D=3D NULL )<br>
&gt; @@ -215,9 +216,10 @@ int xc_microcode_update(xc_interface *xch, const =
void *buf, size_t len)<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 memcpy(uc, buf, len);<br>
&gt;=C2=A0 <br>
&gt; -=C2=A0 =C2=A0 platform_op.cmd =3D XENPF_microcode_update;<br>
&gt; -=C2=A0 =C2=A0 platform_op.u.microcode.length =3D len;<br>
&gt; -=C2=A0 =C2=A0 set_xen_guest_handle(platform_op.u.microcode.data, uc);=
<br>
&gt; +=C2=A0 =C2=A0 platform_op.cmd =3D XENPF_microcode_update2;<br>
&gt; +=C2=A0 =C2=A0 platform_op.u.microcode2.length =3D len;<br>
&gt; +=C2=A0 =C2=A0 platform_op.u.microcode2.flags =3D flags;<br>
&gt; +=C2=A0 =C2=A0 set_xen_guest_handle(platform_op.u.microcode2.data, uc)=
;<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 ret =3D do_platform_op(xch, &amp;platform_op);<br>
&gt;=C2=A0 <br>
&gt; diff --git a/tools/misc/xen-ucode.c b/tools/misc/xen-ucode.c<br>
&gt; index 2c9f337b86cb..688e540943b1 100644<br>
&gt; --- a/tools/misc/xen-ucode.c<br>
&gt; +++ b/tools/misc/xen-ucode.c<br>
&gt; @@ -13,6 +13,8 @@<br>
&gt;=C2=A0 #include &lt;xenctrl.h&gt;<br>
&gt;=C2=A0 #include &lt;getopt.h&gt;<br>
&gt;=C2=A0 <br>
&gt; +#include &lt;xen/platform.h&gt;<br>
&gt; +<br>
&gt;=C2=A0 static xc_interface *xch;<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 static const char intel_id[] =3D &quot;GenuineIntel&quot;;<br>
&gt; @@ -79,7 +81,9 @@ static void usage(FILE *stream, const char *name)<br=
>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;options:\n&quot;=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0 -h, --hel=
p=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 display this help\n&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0 -s, --sho=
w-cpu-info=C2=A0 =C2=A0show CPU information\n&quot;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Usage: %s [microcode =
file | options]\n&quot;, name, name);<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0 -f, --force=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0skip certain checks; do not use unles=
s\n&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;you know exactly what=
 you are doing\n&quot;<br>
<br>
Did you look at the produced output? Imo you want to have<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0 -f, --force=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0skip certain checks; do not use unless\n&=
quot;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 you know exactly w=
hat you are doing\n&quot;<br>
<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Usage: %s [microcode =
file [-f,--force] | options]\n&quot;, name, name);<br>
<br>
At least<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Usage: %s [microcode file [=
-f|--force] | options]\n&quot;, name, name);<br>
<br>
But: &quot;options&quot; now includes -f / --force, yet that on its own mak=
es no sense.<br>
I think this needs further textual clarification to properly indicate what =
is<br>
valid to use and what is not.<br></blockquote><div><br></div><div>Will be f=
ixed in v7:</div><div style=3D"color:rgb(204,204,204);background-color:rgb(=
31,31,31);font-family:Consolas,&quot;Courier New&quot;,monospace;font-size:=
14px;line-height:19px;white-space:pre-wrap"><div><span style=3D"color:rgb(8=
6,156,214)">static</span> <span style=3D"color:rgb(86,156,214)">void</span>=
 <span style=3D"color:rgb(220,220,170)">usage</span>(FILE <span style=3D"co=
lor:rgb(212,212,212)">*</span><span style=3D"color:rgb(156,220,254)">stream=
</span>, <span style=3D"color:rgb(86,156,214)">const</span> <span style=3D"=
color:rgb(86,156,214)">char</span> <span style=3D"color:rgb(212,212,212)">*=
</span><span style=3D"color:rgb(156,220,254)">name</span>)</div><div>{</div=
><div>=C2=A0 =C2=A0 <span style=3D"color:rgb(220,220,170)">fprintf</span>(s=
tream,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span style=3D"c=
olor:rgb(206,145,120)">&quot;</span><span style=3D"color:rgb(156,220,254)">=
%s</span><span style=3D"color:rgb(206,145,120)">: Xen microcode updating to=
ol</span><span style=3D"color:rgb(215,186,125)">\n</span><span style=3D"col=
or:rgb(206,145,120)">&quot;</span></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 <span style=3D"color:rgb(206,145,120)">&quot;Usage: </span><s=
pan style=3D"color:rgb(156,220,254)">%s</span><span style=3D"color:rgb(206,=
145,120)"> [options | microcode-file]</span><span style=3D"color:rgb(215,18=
6,125)">\n</span><span style=3D"color:rgb(206,145,120)">&quot;</span></div>=
<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span style=3D"color:rgb(206=
,145,120)">&quot;options:</span><span style=3D"color:rgb(215,186,125)">\n</=
span><span style=3D"color:rgb(206,145,120)">&quot;</span></div><div>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span style=3D"color:rgb(206,145,120)">&=
quot; =C2=A0-h, --help =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 display this help</span><span style=3D"color:rgb(2=
15,186,125)">\n</span><span style=3D"color:rgb(206,145,120)">&quot;</span><=
/div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span style=3D"color:rg=
b(206,145,120)">&quot; =C2=A0-s, --show-cpu-info =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0show CPU information</span><span style=3D"color:rgb=
(215,186,125)">\n</span><span style=3D"color:rgb(206,145,120)">&quot;</span=
></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span style=3D"color:=
rgb(206,145,120)">&quot; =C2=A0-f, --force &lt;microcode-file&gt; =C2=A0 =
=C2=A0 skip certain checks; do not</span><span style=3D"color:rgb(215,186,1=
25)">\n</span><span style=3D"color:rgb(206,145,120)">&quot;</span></div><di=
v>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span style=3D"color:rgb(206,14=
5,120)">&quot; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 use unless you =
know exactly</span><span style=3D"color:rgb(215,186,125)">\n</span><span st=
yle=3D"color:rgb(206,145,120)">&quot;</span></div><div>=C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 <span style=3D"color:rgb(206,145,120)">&quot; =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 what you are doing</span><span style=
=3D"color:rgb(215,186,125)">\n</span><span style=3D"color:rgb(206,145,120)"=
>&quot;</span>,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 name, n=
ame);</div><div>=C2=A0 =C2=A0 <span style=3D"color:rgb(220,220,170)">show_c=
urr_cpu</span>(stream);</div></div><div><span style=3D"background-color:rgb=
(31,31,31);color:rgb(204,204,204);font-family:Consolas,&quot;Courier New&qu=
ot;,monospace;font-size:14px;white-space:pre-wrap">}</span>=C2=A0</div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left=
:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Jan<br></blockquote><div><br></div><div>Thanks,</div><div><br></div><div>Fo=
uad=C2=A0</div></div></div>

--0000000000007456600620057e8b--


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 08:57:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 08:57:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779413.1189156 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyCV-000749-Ek; Mon, 19 Aug 2024 08:57:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779413.1189156; Mon, 19 Aug 2024 08:57:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyCV-000742-Bt; Mon, 19 Aug 2024 08:57:19 +0000
Received: by outflank-mailman (input) for mailman id 779413;
 Mon, 19 Aug 2024 08:57:18 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mhAH=PS=cloud.com=fouad.hilly@srs-se1.protection.inumbo.net>)
 id 1sfyCU-0006TG-6q
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 08:57:18 +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 08967104-5e09-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 10:57:16 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-52f025bc147so4901489e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 01:57:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 08967104-5e09-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724057836; x=1724662636; 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=rTHPhbrvA8ByK/HwQ7kpAhg4dkZhSLBjuawHVSKUq3w=;
        b=exljJ+EGOuV+xtQWVDQfq5MeZbBXdkAV9v3zGB9rF+F7IlThM7i/NTdJWnX0PMPgJW
         4lVSgONCzYHtokRSVTcveeF5/gbcLVhOHIox66p9YRwEHy5jnZo45OHgcaRaR66oATy7
         JCq7gJmk+l5MV54KLfENzCEWdOXN4Fzx957QA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724057836; x=1724662636;
        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=rTHPhbrvA8ByK/HwQ7kpAhg4dkZhSLBjuawHVSKUq3w=;
        b=XmzXkJ8DA8QOhXjkCUnSgnI6hdcYaTmT1ats4B/sPBkIMTgHeJQpV9JkoW6iRX/dTC
         2GndzSeceZtnQgdYJT03ZayaWKXsdCgNUDODne4yCImifvHdM5WLkhQUE6I4atQoQEF2
         uVwje0JGgId10/sZ6EHPLYS4QyfeJG8g3e3ZOaCQKPGpDXXx5Qxmf9Dbtnns6QBGBHC/
         0xbeYwlzZmlgNekthiQ0U/5H3mrxspkcL6MkNMrZsgA3eFg3vYOm5jHWbP8P6onWs/b1
         YV1YYTGKonCbrB6GgpnbjKN1E3ufDML4coL6k5j1/YbKc8fNFqgSgApRDwg/b6Rc3PFc
         GKlw==
X-Forwarded-Encrypted: i=1; AJvYcCVvQ+WrZdV20UQB0pyRhz6z3xGCnRc6x4dZ+PGpCevrGKzhmzJKjkQTUiDBvUiBAVIy+OARMKGSE4m4E0mHJ0fgM02vw45lFUDqLDneEIs=
X-Gm-Message-State: AOJu0Yzg5Mz0/Ekkd5GDjzItVl/Di67Y2N0CuCn5mwZcIZx3y17ToXxa
	t1OLXTHeDUH1a3IDUx8Zz4AiE40jpt7A11v6rf0IC/A8RJNMZ7CqLDwu11UQwxaMWQN/5SYKBwU
	gAWHS4vlkqXAyS6BgmMDno7A7AVEMwi7SlhE5UQ==
X-Google-Smtp-Source: AGHT+IGkd2R7on/PGIfDvHhwRb+DbX9+W2mM7e/ISWTjVz5eVrxzuHOb7c5TGRlxXNLVDrKM8CdqfKNYjWx8Euxdryg=
X-Received: by 2002:a05:6512:68c:b0:532:ef03:a72c with SMTP id
 2adb3069b0e04-5331c6b5ac3mr5764326e87.32.1724057835411; Mon, 19 Aug 2024
 01:57:15 -0700 (PDT)
MIME-Version: 1.0
References: <20240725082725.2685481-1-fouad.hilly@cloud.com>
 <20240725082725.2685481-5-fouad.hilly@cloud.com> <f0925d77-db8d-410c-873f-0bf38727aca9@suse.com>
In-Reply-To: <f0925d77-db8d-410c-873f-0bf38727aca9@suse.com>
From: Fouad Hilly <fouad.hilly@cloud.com>
Date: Mon, 19 Aug 2024 09:57:04 +0100
Message-ID: <CAJKAvHY1CiXM+S1TNLrasPFZZPrdZo5QsJvhxCbptJFPyBqtqA@mail.gmail.com>
Subject: Re: [PATCH v6 4/4] x86/ucode: Utilize ucode_force and remove opt_ucode_allow_same
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, 
	Stefano Stabellini <sstabellini@kernel.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000da303e0620057eef"

--000000000000da303e0620057eef
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Jul 29, 2024 at 12:30=E2=80=AFPM Jan Beulich <jbeulich@suse.com> wr=
ote:

> On 25.07.2024 10:27, Fouad Hilly wrote:
> > --- a/docs/misc/xen-command-line.pandoc
> > +++ b/docs/misc/xen-command-line.pandoc
> > @@ -2650,7 +2650,7 @@ performance.
> >     Alternatively, selecting `tsx=3D1` will re-enable TSX at the users =
own
> risk.
> >
> >  ### ucode
> > -> `=3D List of [ <integer> | scan=3D<bool>, nmi=3D<bool>, allow-same=
=3D<bool> ]`
> > +> `=3D List of [ <integer> | scan=3D<bool>, nmi=3D<bool> ]`
> >
> >      Applicability: x86
> >      Default: `nmi`
> > @@ -2682,11 +2682,6 @@ precedence over `scan`.
> >  stop_machine context. In NMI handler, even NMIs are blocked, which is
> >  considered safer. The default value is `true`.
> >
> > -'allow-same' alters the default acceptance policy for new microcode to
> permit
> > -trying to reload the same version.  Many CPUs will actually reload
> microcode
> > -of the same version, and this allows for easy testing of the late
> microcode
> > -loading path.
>
> The removal of a command line (sub)option should come with a CHANGELOG.md
> entry.
>

Will be fixed in v7

>
> > --- a/xen/arch/x86/cpu/microcode/core.c
> > +++ b/xen/arch/x86/cpu/microcode/core.c
> > @@ -90,6 +90,11 @@ struct ucode_mod_blob {
> >      size_t size;
> >  };
> >
> > +struct patch_with_flags {
> > +    unsigned int flags;
> > +    struct microcode_patch *patch;
>
> Pointer-to-const? If the const was omitted here just because of
> microcode_free_patch(), then I think the issue should be taken care
> of there.
>

This struct is required as is, I initially added a similar struct with
const (which was removed in v6).
updated control_thread_fn()
-static int control_thread_fn(const struct microcode_patch *patch)
+static int control_thread_fn(struct microcode_patch *patch,
+                             unsigned int flags)

> @@ -237,7 +238,11 @@ static DEFINE_PER_CPU(int, loading_err);
> >   */
> >  static cpumask_t cpu_callin_map;
> >  static atomic_t cpu_out, cpu_updated;
> > -static const struct microcode_patch *nmi_patch =3D ZERO_BLOCK_PTR;
> > +static struct patch_with_flags nmi_patch_with_flags =3D
>
> Could the variable name perhaps continue to be "nmi_patch"? Or be
> simply "nmi_arg" or some such?
>

Sure, will keep it as nmi_patch

>
> > +{
> > +    .flags  =3D 0,
>
> Nit: This isn't really needed.
>
> > @@ -379,7 +386,8 @@ static int secondary_nmi_work(void)
> >      return wait_for_state(LOADING_EXIT) ? 0 : -EBUSY;
> >  }
> >
> > -static int primary_thread_work(const struct microcode_patch *patch)
> > +static int primary_thread_work(struct microcode_patch *patch,
> > +                               unsigned int flags)
> >  {
>
> Why is this change needed?
>
This will be reverted in v7

>
> > @@ -446,7 +455,8 @@ static int secondary_thread_fn(void)
> >      return this_cpu(loading_err);
> >  }
> >
> > -static int primary_thread_fn(const struct microcode_patch *patch)
> > +static int primary_thread_fn(struct microcode_patch *patch,
> > +                             unsigned int flags)
>
> Same here.
>

 This will be reverted in v7

>
> Jan
>

Thanks,

Fouad

--000000000000da303e0620057eef
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Mon, Jul 29, 2024 at 12:30=E2=80=
=AFPM Jan Beulich &lt;<a href=3D"mailto:jbeulich@suse.com" target=3D"_blank=
">jbeulich@suse.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)=
;padding-left:1ex">On 25.07.2024 10:27, Fouad Hilly wrote:<br>
&gt; --- a/docs/misc/xen-command-line.pandoc<br>
&gt; +++ b/docs/misc/xen-command-line.pandoc<br>
&gt; @@ -2650,7 +2650,7 @@ performance.<br>
&gt;=C2=A0 =C2=A0 =C2=A0Alternatively, selecting `tsx=3D1` will re-enable T=
SX at the users own risk.<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 ### ucode<br>
&gt; -&gt; `=3D List of [ &lt;integer&gt; | scan=3D&lt;bool&gt;, nmi=3D&lt;=
bool&gt;, allow-same=3D&lt;bool&gt; ]`<br>
&gt; +&gt; `=3D List of [ &lt;integer&gt; | scan=3D&lt;bool&gt;, nmi=3D&lt;=
bool&gt; ]`<br>
&gt;=C2=A0 <br>
&gt;=C2=A0 =C2=A0 =C2=A0 Applicability: x86<br>
&gt;=C2=A0 =C2=A0 =C2=A0 Default: `nmi`<br>
&gt; @@ -2682,11 +2682,6 @@ precedence over `scan`.<br>
&gt;=C2=A0 stop_machine context. In NMI handler, even NMIs are blocked, whi=
ch is<br>
&gt;=C2=A0 considered safer. The default value is `true`.<br>
&gt;=C2=A0 <br>
&gt; -&#39;allow-same&#39; alters the default acceptance policy for new mic=
rocode to permit<br>
&gt; -trying to reload the same version.=C2=A0 Many CPUs will actually relo=
ad microcode<br>
&gt; -of the same version, and this allows for easy testing of the late mic=
rocode<br>
&gt; -loading path.<br>
<br>
The removal of a command line (sub)option should come with a CHANGELOG.md<b=
r>
entry.<br></blockquote><div><br></div><div>Will be fixed in v7=C2=A0</div><=
blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l=
eft:1px solid rgb(204,204,204);padding-left:1ex">
<br>
&gt; --- a/xen/arch/x86/cpu/microcode/core.c<br>
&gt; +++ b/xen/arch/x86/cpu/microcode/core.c<br>
&gt; @@ -90,6 +90,11 @@ struct ucode_mod_blob {<br>
&gt;=C2=A0 =C2=A0 =C2=A0 size_t size;<br>
&gt;=C2=A0 };<br>
&gt;=C2=A0 <br>
&gt; +struct patch_with_flags {<br>
&gt; +=C2=A0 =C2=A0 unsigned int flags;<br>
&gt; +=C2=A0 =C2=A0 struct microcode_patch *patch;<br>
<br>
Pointer-to-const? If the const was omitted here just because of<br>
microcode_free_patch(), then I think the issue should be taken care<br>
of there.<br></blockquote><div><br></div><div>This struct is required as is=
, I initially added a similar struct with const (which was removed in v6).<=
/div><div>updated control_thread_fn()</div><div>-static int control_thread_=
fn(const struct microcode_patch *patch)<br>+static int control_thread_fn(st=
ruct microcode_patch *patch,<br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 unsigned int flags=
)<br></div><div><br></div><blockquote class=3D"gmail_quote" style=3D"margin=
:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"=
>
&gt; @@ -237,7 +238,11 @@ static DEFINE_PER_CPU(int, loading_err);<br>
&gt;=C2=A0 =C2=A0*/<br>
&gt;=C2=A0 static cpumask_t cpu_callin_map;<br>
&gt;=C2=A0 static atomic_t cpu_out, cpu_updated;<br>
&gt; -static const struct microcode_patch *nmi_patch =3D ZERO_BLOCK_PTR;<br=
>
&gt; +static struct patch_with_flags nmi_patch_with_flags =3D<br>
<br>
Could the variable name perhaps continue to be &quot;nmi_patch&quot;? Or be=
<br>
simply &quot;nmi_arg&quot; or some such?<br></blockquote><div><br></div><di=
v>Sure, will keep it as nmi_patch=C2=A0</div><blockquote class=3D"gmail_quo=
te" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204=
);padding-left:1ex">
<br>
&gt; +{<br>
&gt; +=C2=A0 =C2=A0 .flags=C2=A0 =3D 0,<br>
<br>
Nit: This isn&#39;t really needed.<br>
<br>
&gt; @@ -379,7 +386,8 @@ static int secondary_nmi_work(void)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 return wait_for_state(LOADING_EXIT) ? 0 : -EBUSY;<=
br>
&gt;=C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; -static int primary_thread_work(const struct microcode_patch *patch)<b=
r>
&gt; +static int primary_thread_work(struct microcode_patch *patch,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned int flags)<br>
&gt;=C2=A0 {<br>
<br>
Why is this change needed?<br></blockquote><div>This will be reverted in v7=
=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
&gt; @@ -446,7 +455,8 @@ static int secondary_thread_fn(void)<br>
&gt;=C2=A0 =C2=A0 =C2=A0 return this_cpu(loading_err);<br>
&gt;=C2=A0 }<br>
&gt;=C2=A0 <br>
&gt; -static int primary_thread_fn(const struct microcode_patch *patch)<br>
&gt; +static int primary_thread_fn(struct microcode_patch *patch,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned int flags)<br>
<br>
Same here.<br></blockquote><div><br></div><div>=C2=A0This will be reverted =
in v7</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>
Jan<br></blockquote><div><br></div><div>Thanks,</div><div><br></div><div>Fo=
uad=C2=A0</div></div></div>

--000000000000da303e0620057eef--


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 09:05:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 09:05:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779429.1189167 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyJw-0000c7-5K; Mon, 19 Aug 2024 09:05:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779429.1189167; Mon, 19 Aug 2024 09:05:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyJw-0000c0-2R; Mon, 19 Aug 2024 09:05:00 +0000
Received: by outflank-mailman (input) for mailman id 779429;
 Mon, 19 Aug 2024 09:04:58 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sfyJu-0000bu-Nk
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 09:04:58 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1abb22d9-5e0a-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 11:04:56 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-530e22878cfso4297138e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 02:04:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838cfe4csm607975666b.89.2024.08.19.02.04.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 02:04:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1abb22d9-5e0a-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724058296; x=1724663096; 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=SgWNNx0pHGj0z/32joGY12heTbKPpL+13ciTvbZYpH0=;
        b=fwMkH4fmez6QsnbbkRkCZwxg/MtpMTIIX+mX6OqrFf/oqzPvZVuCSR1ny6YuasFxdp
         iH2ZfqWC8fUN5yiJK1DRmwuuflMFqOC/lkVN2ShibsWyL0XBPQJNpewB1qxsYM1phOBC
         gBQj8MBEqC9NSKQOxFS+vTz7C0pwb5RuPIt9BC9PZyn7wkqqTcHYHWK2ACZGLkth2NZC
         gHdrgO+KFG7cPcM+cS0reILduAq1sVaZpxamcbhGakqPIfAsrCWNqjsSXjuS0doVjxrW
         7y8RDulVZtNbXzppC9VvIeHZRxmzPWKcyOsXK9u4XNmEScVcnjBAZ8mKIwO3vJM6p/IQ
         h8Hw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724058296; x=1724663096;
        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=SgWNNx0pHGj0z/32joGY12heTbKPpL+13ciTvbZYpH0=;
        b=n1UxXh6rNUwkOjhiQoEy3L0xZwPlYlQ28A0b3kWl7ek12qgkCIQlEY+2ilEhWAD3Lo
         +qFOds/YgSe4OvcoGPpxwKWVOC2/tGzk7r1ooLcErifx3wtSHwh3Axw3Sq2A67Pnsed8
         QxZluLB9aGzaFv4SEiawh2/BiCb2klOwbi+8dvPA/C1k37Qjp/NC8M88W68DXwpWmCgv
         wHDtVGUs0yhnumt39gqiB/psdzM7gBWfwbFJj879ltqccK3fZ83nnswaHmSNdR2CEtsC
         io66selHvZIw8NSbeDyuJwrjordRrkmbillhN7fPntDgKFiF3gWs6imwKu5/Hda8MHHx
         Gagw==
X-Forwarded-Encrypted: i=1; AJvYcCVohPqihOrDEoQEanLW3ODDwSNiyYlVL8ZE4qQLh1zrGXqnugf52DdQU5CJn4BRR5puASTCTEQPFD9DPuGQ2509DCIZGXSw9VypuQMbwEc=
X-Gm-Message-State: AOJu0YzV/7/ldQguL/PvszL1HgxZ2QCRMHMOH/gXkeGfhGe4dsvqCn5I
	jLAjd8wl72yhZS5f0XjlWlc4XR1rvK+5RIc8U/TfwSQ1sNe6kqiyFQQRyDgV2Q==
X-Google-Smtp-Source: AGHT+IEhZU3Ys4CGKahs6+r55DjcQxsjE0fp/CpoGcICKD1Z0m14Iqlhd/H6Ov/Rmd8TgG3O9VaScg==
X-Received: by 2002:a05:6512:3d86:b0:530:e228:77ae with SMTP id 2adb3069b0e04-5331c6dca0dmr6304888e87.40.1724058295420;
        Mon, 19 Aug 2024 02:04:55 -0700 (PDT)
Message-ID: <50717151-3098-491f-9dfb-71ebaff4b684@suse.com>
Date: Mon, 19 Aug 2024 11:04:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v13 1/6] xen/pci: Add hypercall to support reset of
 pcidev
To: Jiqian Chen <Jiqian.Chen@amd.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <gwd@xenproject.org>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>, Juergen Gross <jgross@suse.com>,
 "Daniel P . Smith" <dpsmith@apertussolutions.com>,
 Stewart Hildebrand <Stewart.Hildebrand@amd.com>,
 Huang Rui <ray.huang@amd.com>, xen-devel@lists.xenproject.org
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
 <20240816110820.75672-2-Jiqian.Chen@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240816110820.75672-2-Jiqian.Chen@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 16.08.2024 13:08, Jiqian Chen wrote:
> @@ -67,6 +68,57 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>          break;
>      }
>  
> +    case PHYSDEVOP_pci_device_reset:
> +    {
> +        struct pci_device_reset dev_reset;
> +        struct pci_dev *pdev;
> +        pci_sbdf_t sbdf;
> +
> +        ret = -EOPNOTSUPP;
> +        if ( !is_pci_passthrough_enabled() )
> +            break;

It occurs to me (only now, sorry): Does this case really need to be an
error? I.e. do we really need to bother callers by having them find out
whether pass-through is supported in the underlying Xen?

> +        ret = -EFAULT;
> +        if ( copy_from_guest(&dev_reset, arg, 1) != 0 )
> +            break;
> +
> +        sbdf = PCI_SBDF(dev_reset.dev.seg,
> +                        dev_reset.dev.bus,
> +                        dev_reset.dev.devfn);
> +
> +        ret = xsm_resource_setup_pci(XSM_PRIV, sbdf.sbdf);
> +        if ( ret )
> +            break;
> +
> +        pcidevs_lock();
> +        pdev = pci_get_pdev(NULL, sbdf);
> +        if ( !pdev )
> +        {
> +            pcidevs_unlock();
> +            ret = -ENODEV;
> +            break;
> +        }
> +
> +        write_lock(&pdev->domain->pci_lock);
> +        pcidevs_unlock();
> +        switch ( dev_reset.flags & PCI_DEVICE_RESET_MASK )
> +        {
> +        case PCI_DEVICE_RESET_COLD:
> +        case PCI_DEVICE_RESET_WARM:
> +        case PCI_DEVICE_RESET_HOT:
> +        case PCI_DEVICE_RESET_FLR:
> +            ret = vpci_reset_device(pdev);
> +            break;
> +
> +        default:
> +            ret = -EOPNOTSUPP;

EINVAL

But: What about the other flag bits? You don't check them (anymore; I
thought there was a check there before).

> --- a/xen/include/public/physdev.h
> +++ b/xen/include/public/physdev.h
> @@ -296,6 +296,13 @@ DEFINE_XEN_GUEST_HANDLE(physdev_pci_device_add_t);
>   */
>  #define PHYSDEVOP_prepare_msix          30
>  #define PHYSDEVOP_release_msix          31
> +/*
> + * Notify the hypervisor that a PCI device has been reset, so that any
> + * internally cached state is regenerated.  Should be called after any
> + * device reset performed by the hardware domain.
> + */
> +#define PHYSDEVOP_pci_device_reset 32

Nit: Please pad the 32 to align with the 30 and 31 in context.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 09:08:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 09:08:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779443.1189176 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyMw-00023Q-H4; Mon, 19 Aug 2024 09:08:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779443.1189176; Mon, 19 Aug 2024 09:08:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyMw-00023J-ED; Mon, 19 Aug 2024 09:08:06 +0000
Received: by outflank-mailman (input) for mailman id 779443;
 Mon, 19 Aug 2024 09:08:05 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sfyMv-00023D-85
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 09:08:05 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8a01bc0a-5e0a-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 11:08:03 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-a83869373b6so398298966b.2
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 02:08:03 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383969e05sm608666966b.191.2024.08.19.02.08.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 02:08:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8a01bc0a-5e0a-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724058482; x=1724663282; 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=dufbDC2txZUeklQxKtc0XhQk4l09UB+er7K2xQuzkAY=;
        b=JSHhNrseZEfPFzOdpRjIPKItNGFj5p2ypHXZt2e15lp9VduqxXhD2Qu7PflTd042Dw
         9HMDfEGD2qePr1uqH6V7wubRnnZDf/y6bnydi1kSkBbBPRkdlM77vR4DmDpczN4328+z
         x6rojQ59F6PmqgrBkEpQuyLA0DBfZV233RU4/fZP5bc2eZIDx4z2E8GL8AK/ytIjbtDq
         DyngLHOpdpec228edWw7UvbT70UKkONjMPv74DNzRIshUmjCfTzVBXFErgzawFEAQG9n
         ksei255AEt9SoJuDv9H1e7W1Mdw8ggND5WbGwggFHy8vKY2W5FwNHndsggHobAGYmOci
         KjMg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724058482; x=1724663282;
        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=dufbDC2txZUeklQxKtc0XhQk4l09UB+er7K2xQuzkAY=;
        b=HmktVLYm/ecdU0OyhdvjIz/Nspd63t67NTmNrRtsySn6/uEb+lhrhlP7MW9ORKqVhz
         eY3JCECO5bQCIS4xmZunjZXEwywsANb6scewOlM0olc2b01OQvslJP/KX6zqk66i/M7Y
         gXFoCA4hT4GiH+qHv7cppB1fJYgwJ1sObXBvy29PUXOQ7sbeJVtuycopDiKeA0VuWmjC
         8ZQ99wnE+gt4ha2yxkiKhesfk1R3M/8CxcN+iFIg8/mVbir4eY7IoeCvGlshXMwJGspN
         V5upFBc88heGEEpxk2D6wh77sUDyaMWgJhWaW+kDfXETOPR5p5c7qHKfKjHxhIknVOUn
         BqGg==
X-Forwarded-Encrypted: i=1; AJvYcCXGSx9tRQe4whLq/5yOJu4Avp+99EY+9V/u0TydDVJgdfKQB21nqeJzrJPY0XV0Db6CzVXGgm2F2kYTZkYCXT7XUfj8jqxNWdkpnm53DVw=
X-Gm-Message-State: AOJu0Yz0wVnHWFGsJLeZsEn32pupx0kZ35Vxhp7Hwz2JzapFQ2GeABc3
	n95gPH8EKImiPThChx7SnA5nnhRksGPZTCBqhnBYJ+GzykYHrlk1zvQjAqK3Xg==
X-Google-Smtp-Source: AGHT+IGKOkpK4ItdHsM8t0AOLbPyAiaFZHl/S3n3iAHr2UBNNydiaRIY4KOEVtEs0P/cnHaCz3MRHA==
X-Received: by 2002:a17:907:e29e:b0:a7d:c696:76ee with SMTP id a640c23a62f3a-a839292f15bmr773210566b.17.1724058482394;
        Mon, 19 Aug 2024 02:08:02 -0700 (PDT)
Message-ID: <4a421c07-d8a0-4af9-816f-5d76d39fe31f@suse.com>
Date: Mon, 19 Aug 2024 11:08:01 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v13 2/6] x86/pvh: Allow (un)map_pirq when dom0 is PVH
To: Jiqian Chen <Jiqian.Chen@amd.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <gwd@xenproject.org>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>, Juergen Gross <jgross@suse.com>,
 "Daniel P . Smith" <dpsmith@apertussolutions.com>,
 Stewart Hildebrand <Stewart.Hildebrand@amd.com>,
 Huang Rui <ray.huang@amd.com>, xen-devel@lists.xenproject.org
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
 <20240816110820.75672-3-Jiqian.Chen@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240816110820.75672-3-Jiqian.Chen@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 16.08.2024 13:08, Jiqian Chen wrote:
> If run Xen with PVH dom0 and hvm domU, hvm will map a pirq for
> a passthrough device by using gsi, see qemu code
> xen_pt_realize->xc_physdev_map_pirq and libxl code
> pci_add_dm_done->xc_physdev_map_pirq. Then xc_physdev_map_pirq
> will call into Xen, but in hvm_physdev_op, PHYSDEVOP_map_pirq
> is not allowed because currd is PVH dom0 and PVH has no
> X86_EMU_USE_PIRQ flag, it will fail at has_pirq check.
> 
> So, allow PHYSDEVOP_map_pirq when dom0 is PVH and also allow
> iPHYSDEVOP_unmap_pirq for the removal device path to unmap pirq.
> So that the interrupt of a passthrough device can be successfully
> mapped to pirq for domU with a notion of PIRQ when dom0 is PVH.
> 
> To exposing the functionality to wider than (presently) necessary
> audience(like PVH domU), so it doesn't add any futher restrictions.

The code change is fine, but I'm struggling with this sentence. I can't
really derive what you're trying to say.

> And there already are some senarios for domains without
> X86_EMU_USE_PIRQ to use these functions.

Are there? If so, pointing out an example may help.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 09:16:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 09:16:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779458.1189188 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyV1-0003dN-Bc; Mon, 19 Aug 2024 09:16:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779458.1189188; Mon, 19 Aug 2024 09:16:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyV1-0003cV-78; Mon, 19 Aug 2024 09:16:27 +0000
Received: by outflank-mailman (input) for mailman id 779458;
 Mon, 19 Aug 2024 09:16:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sfyV0-0003cP-9v
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 09:16:26 +0000
Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com
 [2a00:1450:4864:20::22d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b53efed3-5e0b-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 11:16:25 +0200 (CEST)
Received: by mail-lj1-x22d.google.com with SMTP id
 38308e7fff4ca-2f15dd0b489so57520331fa.3
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 02:16:24 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bebbdfad42sm5402554a12.47.2024.08.19.02.16.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 02:16:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b53efed3-5e0b-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724058984; x=1724663784; 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=xqfXXQo+VGUr7CPyfLola7XWo/mf5CNCWV5+/4hOBck=;
        b=W1V6GbM7fnKTqLjOe9UFtBibkVF7fYDMVIYxPpWZ4soK8yLQmYaqvsNhMKtz3cIIbQ
         QyrM342+3ghqT66T/lcxaGAWJQms0Kr2HQk5epOITDtmLpeXM4XEcb/Sz88wMqD5pvyp
         yuB1ZSYugrm+ynVY2/48zRvYnacncPbm+hneMc3wwMaATKPvrJkV7GBtUuj8SAv8CG80
         saWkvNHBjn09hdbDVaYRhlVniXDZnX9bqiJd9Oyt+ppdRlnWTFRo9D9aC9f/wnzlglsx
         M8m14gwW3YqPDXA2AZJibBYoGF9moQM5ZGNugRQMWVHhKiLuBoyGr5ZUJdlmBU5br7yY
         10Hg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724058984; x=1724663784;
        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=xqfXXQo+VGUr7CPyfLola7XWo/mf5CNCWV5+/4hOBck=;
        b=vagma6buyTk3VPdiOiL8o4D4niRgFZ4t0ebkhqrtNREQEY4y5Vq9lZ+aVLykmG3jmm
         k08PAFVLJYReRuyc7wgKXd7ryJDYv2CWijpXB0K8PzrLnN6+Oc+k91b3Po7Vsy7Y8ITn
         qNnH5R42ATPigGED1p9HuOuRgewCGNeTKdURGSInhMGVndfJcH0/T84r0mA9TcEgzsR4
         mqyGk3OWLOpYdy4s3X7h0oMQvihGEE7CDqrMoyR0RUcL9Ukx5wZKd77w5AiTUAMFjm17
         5Ai+Bt6NObGSWgO5BPsQgArsLAHAbn9mAcxJh6062hKmFz9/2l1gp71nTIWEZxfOMz2H
         4zvw==
X-Forwarded-Encrypted: i=1; AJvYcCWVbOYbCBVNI7WPxirKEYBg0o6G3aqDKiN0ux+cMN6NSGG5dYY6x+VECy9INGHbO04onj/nxk/eXqhOAa8sRctYh9kUfJDvpBEu9IaMgvw=
X-Gm-Message-State: AOJu0YyJXGtx4gz8XJMPt/caJAr6KWx5AwCFCUKUd2cTWGY3nBUNWKfE
	7Pd7aG/Nj+Rpe6BPzwwFjXqDjWy/HoUz60qDObx8UblGASD7F3r411jM7VQyTQ==
X-Google-Smtp-Source: AGHT+IEeBsoX96eikzTpVNLBBSCeMBfzYwyCdNvQNhgNJpIdgvP+8VQ6GW4WCxIgrp9tCk6vOVgpQA==
X-Received: by 2002:a05:651c:a0a:b0:2f3:cbc3:b093 with SMTP id 38308e7fff4ca-2f3cf4caf48mr38860681fa.43.1724058984180;
        Mon, 19 Aug 2024 02:16:24 -0700 (PDT)
Message-ID: <745cd8cc-59c2-44b8-b42b-1e5e0b3026ca@suse.com>
Date: Mon, 19 Aug 2024 11:16:23 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v13 3/6] x86/pvh: Add PHYSDEVOP_setup_gsi for PVH dom0
To: Jiqian Chen <Jiqian.Chen@amd.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <gwd@xenproject.org>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>, Juergen Gross <jgross@suse.com>,
 "Daniel P . Smith" <dpsmith@apertussolutions.com>,
 Stewart Hildebrand <Stewart.Hildebrand@amd.com>,
 Huang Rui <ray.huang@amd.com>, xen-devel@lists.xenproject.org
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
 <20240816110820.75672-4-Jiqian.Chen@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240816110820.75672-4-Jiqian.Chen@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 16.08.2024 13:08, Jiqian Chen wrote:
> The gsi of a passthrough device must be configured for it to be
> able to be mapped into a hvm domU.
> But When dom0 is PVH, the gsis may not get registered(see below
> clarification), it causes the info of apic, pin and irq not be
> added into irq_2_pin list, and the handler of irq_desc is not set,
> then when passthrough a device, setting ioapic affinity and vector
> will fail.
> 
> To fix above problem, on Linux kernel side, a new code will
> need to call PHYSDEVOP_setup_gsi for passthrough devices to
> register gsi when dom0 is PVH.
> 
> So, add PHYSDEVOP_setup_gsi into hvm_physdev_op for above
> purpose.
> 
> Clarify two questions:
> First, why the gsi of devices belong to PVH dom0 can work?
> Because when probe a driver to a normal device, it uses the normal
> probe function of pci device, in its callstack, it requests irq
> and unmask corresponding ioapic of gsi, then trap into xen and
> register gsi finally.
> Callstack is(on linux kernel side) pci_device_probe->
> request_threaded_irq-> irq_startup-> __unmask_ioapic->
> io_apic_write, then trap into xen hvmemul_do_io->
> hvm_io_intercept-> hvm_process_io_intercept->
> vioapic_write_indirect-> vioapic_hwdom_map_gsi-> mp_register_gsi.
> So that the gsi can be registered.
> 
> Second, why the gsi of passthrough device can't work when dom0
> is PVH?
> Because when assign a device to passthrough, it uses the specific
> probe function of pciback, in its callstack, it doesn't install a
> fake irq handler due to the ISR is not running. So that
> mp_register_gsi on Xen side is never called, then the gsi is not
> registered.
> Callstack is(on linux kernel side) pcistub_probe->pcistub_seize->
> pcistub_init_device-> xen_pcibk_reset_device->
> xen_pcibk_control_isr->isr_on==0.

So: Underlying XSA-461 was the observation that the very limited set of
cases where this fake IRQ handler is installed is an issue. The problem
of dealing with "false" IRQs when a line-based interrupt is shared
between devices affects all parties, not just Dom0 and not just PV
guests. Therefore an alternative to the introduction of a new hypercall
would be to simply leverage that the installation of such a handler
will need widening anyway.

However, the installation of said handler presently also occurs in
cases where it's not really needed - when the line isn't shared. Thus,
if the handler registration would also be eliminated when it's not
really needed, we'd be back to needing a separate hypercall.

So I think first of all it needs deciding what is going to be done in
Linux, at least in pciback (as here we care about the Dom0 case only).

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 09:23:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 09:23:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779488.1189197 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfybJ-00060a-3r; Mon, 19 Aug 2024 09:22:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779488.1189197; Mon, 19 Aug 2024 09:22:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfybJ-00060T-0t; Mon, 19 Aug 2024 09:22:57 +0000
Received: by outflank-mailman (input) for mailman id 779488;
 Mon, 19 Aug 2024 09:22:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sfybH-000607-PN
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 09:22:55 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9ce12ac9-5e0c-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 11:22:53 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5bf068aebe5so147006a12.0
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 02:22:53 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838d001fsm610619466b.84.2024.08.19.02.22.52
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 02:22:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9ce12ac9-5e0c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724059373; x=1724664173; 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=TiZrJCg3oByHdETQZAoNBJWOB6MWW/UFvhhA0Wkz8w0=;
        b=aIuYTx9vgEvMD1BzehlUK0WXZ7pbBNN5qIAtE8jQdDp60elspexpOGi4aRoi5LHm+P
         3wWX18fkrMr1XoALPyHzytIUX+1lJIpQFSem0HVA5KBeDY8J5AirPSgvHITLesgRTAUY
         UFp6U3ewnaRkQ9i6HMrYbUe7o691h0nMTDHTewog9jImWp5dIpqHpYVZCvCHjR1SbtWv
         ybCI4XV99k07mzbdvStfiAseJxGOSCaSInCo9VPnc9GWkeRNqpY5CFOj4DR+INdBmanL
         rxQ13awEJhuIn6bTBE+saxwnN0ol/2DyjGMXhrsVICaaj0wV/CStSFiCO3Ob/MRBJu2i
         tfmA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724059373; x=1724664173;
        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=TiZrJCg3oByHdETQZAoNBJWOB6MWW/UFvhhA0Wkz8w0=;
        b=TZz1BBp7K3jLZgMpX+WFs6D91QsNdrMaVERomE9Bn/IJg5LK6hsL+KVN/tr5vns4qf
         ggjEStUCUBCCC0ZBsrhuQWD8Tt1WdIDJcellxCU1hZAfUeDG1QZuZmsdqXofn3LrJt8h
         BUJcPif2hyXlwbvP2NqdrHwv3sE5siZDj1cWZxuJFzFFydbrFa4zHtdTOe31n8o14m5r
         xrx2Kdo9wO8DBQBr4JUT4c/Yjr3gaaJMssW4DV+bcKoR2/o6C24xK21IZgI5C95TMwof
         QcgHjtrw2XuzgPc/wT0uj3KQzbRkaqUNU+qTMam0XT3gO29Wfms+Plblp3bjO1yTM6Q1
         FVJA==
X-Forwarded-Encrypted: i=1; AJvYcCWakCd4A9MY8tRBh9tFhFPfDhF+2IRRDwG6PqB//sXBjq4Du8ijKMSxqLiwdJj/vondurgqNLqhhOBSYr+It2rUKAxj/55CI7JEwfaHPuc=
X-Gm-Message-State: AOJu0YxEwlNBUSmggVvE76L0o7bB6q4OHlPaR+g2p32xG93PJq4xiW/3
	L3j0YXfzxrm2I4pWivgHYVmfKG8o4Zw7oq4Xamwwlzggdw1PhZHBViwqc6GFPg==
X-Google-Smtp-Source: AGHT+IHHIOgPq3ZWNozzUwnF3NpuWg0psKGdLqG/A+ES7HK+IJ4VGIMMuHmu70/TifI+aPc7sXbeog==
X-Received: by 2002:a17:907:3f0f:b0:a7a:9d70:82b9 with SMTP id a640c23a62f3a-a8392930c5dmr717029866b.17.1724059373197;
        Mon, 19 Aug 2024 02:22:53 -0700 (PDT)
Message-ID: <0f17e8ff-caef-4494-8478-c8203992c1df@suse.com>
Date: Mon, 19 Aug 2024 11:22:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6 4/4] x86/ucode: Utilize ucode_force and remove
 opt_ucode_allow_same
To: Fouad Hilly <fouad.hilly@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20240725082725.2685481-1-fouad.hilly@cloud.com>
 <20240725082725.2685481-5-fouad.hilly@cloud.com>
 <f0925d77-db8d-410c-873f-0bf38727aca9@suse.com>
 <CAJKAvHY1CiXM+S1TNLrasPFZZPrdZo5QsJvhxCbptJFPyBqtqA@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: <CAJKAvHY1CiXM+S1TNLrasPFZZPrdZo5QsJvhxCbptJFPyBqtqA@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 19.08.2024 10:57, Fouad Hilly wrote:
> On Mon, Jul 29, 2024 at 12:30 PM Jan Beulich <jbeulich@suse.com> wrote:
>> On 25.07.2024 10:27, Fouad Hilly wrote:
>>> --- a/xen/arch/x86/cpu/microcode/core.c
>>> +++ b/xen/arch/x86/cpu/microcode/core.c
>>> @@ -90,6 +90,11 @@ struct ucode_mod_blob {
>>>      size_t size;
>>>  };
>>>
>>> +struct patch_with_flags {
>>> +    unsigned int flags;
>>> +    struct microcode_patch *patch;
>>
>> Pointer-to-const? If the const was omitted here just because of
>> microcode_free_patch(), then I think the issue should be taken care
>> of there.
> 
> This struct is required as is, I initially added a similar struct with
> const (which was removed in v6).
> updated control_thread_fn()
> -static int control_thread_fn(const struct microcode_patch *patch)
> +static int control_thread_fn(struct microcode_patch *patch,
> +                             unsigned int flags)

And why's that change necessary, other than to cater for the omitted const
in the struct?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 09:45:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 09:45:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779498.1189206 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyxD-0001te-SQ; Mon, 19 Aug 2024 09:45:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779498.1189206; Mon, 19 Aug 2024 09:45:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyxD-0001tX-PR; Mon, 19 Aug 2024 09:45:35 +0000
Received: by outflank-mailman (input) for mailman id 779498;
 Mon, 19 Aug 2024 09:45: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=BCRv=PS=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sfyxD-0001tR-7q
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 09:45:35 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on2061f.outbound.protection.outlook.com
 [2a01:111:f403:2418::61f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c70f0a94-5e0f-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 11:45:33 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by DM4PR12MB6614.namprd12.prod.outlook.com (2603:10b6:8:bb::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Mon, 19 Aug
 2024 09:45:29 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7875.019; Mon, 19 Aug 2024
 09:45:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c70f0a94-5e0f-11ef-a506-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ujhzAY5MobEcxlEz6mOMgapD5rJ2IYq41aFrJ42mDsfO5fKA4qB9akwIQk/aG8JG9Z9Rhc/sL8HihFkIvHEvPjpInWBQzR/ouuFu0aDOfShOneCcf/73BPeYk4o46fOmv85WRvNGaoXozeea4s7RjztBZsMJtnt3Bk1e9KQI1IrIw4AIAxluNS6GqH6TaMm1EQN5AhNnmSu3MAUTHjtzHaW0PcxMepppj8yAjfC9hUA6YAPut4liSC7ini72thPQcEx054WQ/mieoPCbx9vlDacAoYY0pT2rDt8Rhd2afY4WDjngJwFskerbufsLAzHdJVk/bZHhIDDHSUnfM9aMnA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=GBrY/EcFVpUobYfk85vY4+phwDYtscNFa03Fpu2nuic=;
 b=KB6flnyWBmiEhZ73dxUpzB9ProqNXPdRvgo6Z0PJ+RrusDfY+cA304yOGX1sTRpVreI9/UKtNhWumTnbR8ETQpWkThQd/Jn7ohLvBv3u3tmNlbSSv5v4O8PBoFjHRBvfwSJO4veztaBL4t+zVVkHZjM13voC91Zz/Zf6JcwTt4p+R2RUwssaQQaKzOkkc940Ed5h+1T/bnmJ3vEesWKYuo3yHzklS2QdZeB2SmVTfKgFobAIJdb8iwcYYu7yNlIKsXTK+0CAsTMkfoIaQUSi3UulHm4GUBlrqqkA+TWBylIj5/QMHPupyydqj2+cNrsPL9GrKm33jR8h6+snxRr4dA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=GBrY/EcFVpUobYfk85vY4+phwDYtscNFa03Fpu2nuic=;
 b=wPNjfEwk6BBfmE93Cthmngi/EogGAyfbeVNfNzk02s9imvqVicnu98Y6WTvR5ZGKbwQdhs+FWDPuFQnpGIigIa2Ii8qLNrTHFZWfafTkTIpK+rIXWRA8omQk91xWhtHJRXBieh8pjOEZrDM42cyF5Xm+SZ0XcKHNb+VI3VP3aq8=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <1a328f00-3b0d-4e9c-856c-97c3a80dfdef@amd.com>
Date: Mon, 19 Aug 2024 10:45:22 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
To: Julien Grall <julien@xen.org>, Jan Beulich <jbeulich@suse.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
 <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
 <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
 <dad27ab7-3cbd-4a8e-8200-adea52b26e55@suse.com>
 <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
 <9fd1801c-1460-44e5-b066-f6da1167543b@xen.org>
Content-Language: en-GB
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <9fd1801c-1460-44e5-b066-f6da1167543b@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0441.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a9::14) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|DM4PR12MB6614:EE_
X-MS-Office365-Filtering-Correlation-Id: a5c39b60-42ba-49f2-e437-08dcc033a7f4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?YnV1UnY2em0wTTBNWFZod0JEV05QeDJDSzFMMjdXcGIrem9UZUNxVENaZDRm?=
 =?utf-8?B?citCNXhUdk9jbkEyZXJFTzBYOU9SQ1A2VFQ1STgwZTF2YUZ6dFRxcUxuY2pH?=
 =?utf-8?B?K0FMK1NuQkw5UVF0WURsaDVzcmlSWitXU0FqYUc1Y0NQRG45ZE5CY2ZUcVIv?=
 =?utf-8?B?SjgzOEJ5SGF3dVpTMGMwbldpV3pidmgxV1FybjhuTkdLZTVreXpRL2k1MktQ?=
 =?utf-8?B?bzdIK29XQU9iY3lTYmVRSXcxbldPZWpINTBBT3NBbFZoQVhVV2FSWXRjRFVJ?=
 =?utf-8?B?OGVxVVQ5ak41Nmp3cC9mMXluRmtDRlEreGpRYzhrZFpNcEJtUHB1ZlYyU0I3?=
 =?utf-8?B?VTJIb0FvMmVYelhkY1RpNGw0cWZBTjZGdkFQZUE2elhUVzJ2VG5UYzIzVkw5?=
 =?utf-8?B?ajRVNVM2d1ZvQVl6ZWE0eG4vV0I2anU3VVRGcTFvVVdqNUFzaGtqRFRoNy83?=
 =?utf-8?B?cnpEYkhML1ovNDczV2p6K3JyMVV6Ym5sYTRHUUlwWGhQSjhOam5tMUtSMkhl?=
 =?utf-8?B?U1A3WXJCMGp0bzZkb2F3TWVibUt0Vk9sRnhnV2pDb3JVaDlIWm1CRHI3ZUdV?=
 =?utf-8?B?RGtnNXF0eGVDTjJpWVFTQWlSZCtJNEkyZ0ZZbEdqTk5GWGRGbU53Z0RYQlhU?=
 =?utf-8?B?Y3dwVXZiOU1vaUxDMnRkZ0tQQnNWUFpTUHZVV1hrdHl6bmRJOWRlMXBzeTd4?=
 =?utf-8?B?TENUUmZlekE4NWNFM3IwTWZXZW9RMGJra25Ka09MM2hOc0x1b28yMi95emxU?=
 =?utf-8?B?ZjZjb3JEY0hWekJDL29aMzN3RGg0R3BtUmFLNjIyc0FqNFFxM3E4Und3SmFP?=
 =?utf-8?B?QXZKM3huWXlNZ1NvL1o1bDRsbkNyb21ucndnVTc0Z0xtNi80a2FnVE02Y292?=
 =?utf-8?B?VHRSREJ1T1ptT1I2RU1VMUhFNWZHV0JITWhKMlRkeG9ybFQxanhJREVQeVZr?=
 =?utf-8?B?N3pCTWRZQjMyUW9RcGYvR2s1WGhJNVZmbWtzSGpaTmxBRDN1UWw0RkEwMllJ?=
 =?utf-8?B?ajBFVmlIMXA0SU9ibmJUN3F5elVKYS81amFNaGp1UDk2d2NZNC85Ylo2eTkv?=
 =?utf-8?B?MElZZXgxdU1qZzVhKzhocnRKQXFVN20zTFdUanVCRzFHNVVnWGJQNHdaTHJ3?=
 =?utf-8?B?RC9VNEQ4ZjFXeW55NE9rVlFYNmNMY3BZNXJpWEd2dEFraExRbFF4cmh0c1p6?=
 =?utf-8?B?K05NTCt0MHgra0FjU3lkSjdJOUZobXl0Z21sQldXV0U5QjZ6K2ZrRTBqMG1u?=
 =?utf-8?B?OUpmL0dlVzFwUXlEYUdOdm9MY1NybTlPbGpvaUdtT3MxZWpRZzhJWG0zRHdV?=
 =?utf-8?B?bVcxV3dISVJRR1krVE1KLzdMY2VEM1pvb3Q2VWRwT20xOW5DTDRPN3NaNzNS?=
 =?utf-8?B?YjBtUE9WQ2dROXkraXhDOUZyYzQ1K2tzTDNsTTRjZE5KKzBRRzJ6NnMvc3JT?=
 =?utf-8?B?WFZHR2srUG9QNzhlcVVVc3NJNFF2MWxjYTBEOGxCRHE0RVJVaEZpTHcyWWx5?=
 =?utf-8?B?MlgwNXVmdmd5N3hUS1JhR3hHbnNob1I5aTNFOHZIaHRZazlLb3hpcXJBSld1?=
 =?utf-8?B?UnlobFE3ellMNERTOUY3SFY2bm5iMXNvUDlqeXRjR3UxQkpCcmVvRXRrQ0FL?=
 =?utf-8?B?S3VmN1AxRVd6azBQa2xxVGhnZjY2Tkt1TGFkdjBxNWxQbC9uT01kQ1FYSmtS?=
 =?utf-8?B?L2thQzRsdHFNeU1nTytFZWFkQWJQV3pUNmNrSlVKMkdFMWV1SVE2MHBUMU1I?=
 =?utf-8?Q?ZRSjxHNDTenNLBCJkE=3D?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?NWlrK0hHS3JkY21qcFY2ZnQxMTc1QTBTSGJya3k0Tm9JbDlPTmRVL0hmMkpT?=
 =?utf-8?B?VWtUcHlTRHVrQ1Q4Y3VNZ1VZL3dLR2lqVi9UcWhKZDdSZGI4RDhzOEpmU2hM?=
 =?utf-8?B?aGJDSXVzKzVINFBLcW9rVHZyNEQ4Tm8vM3dHOFpTbVJDYkl4Q1pjY1lIdzc2?=
 =?utf-8?B?cWpJYUwwZVBuendKcmNwR1Zobk1HalRFTzBySXdQOGMzRnVxN2dmTHVkRFQx?=
 =?utf-8?B?cWN3ZWdHYk14eGxyRkt2TkVzRm56VE1sNHlQeGVMSXBJN3Z2RnRHb3VBRTdt?=
 =?utf-8?B?NVNpMGgrNXRxVksxc2dLL3pkRFpEdWUwbkRBN2tIZVo4Q2I4eDRYOE9uMEpN?=
 =?utf-8?B?OWlQam9VWGNNMCtkQWtBS3dUYVR3ZVIzWW8yN1lTWVlTRmNQSUdCRU52NXpp?=
 =?utf-8?B?UjROby9jUG83dUMrSi9XQW1xMmY3T3FIaTZTeEVEdnRsMk0rNkRqYk80Wmcx?=
 =?utf-8?B?VWU1VUttLy83NnI0NGxBa01mZ3dqSUNwczE3S1JNclA3WWxseHMwWjFPWHJC?=
 =?utf-8?B?U00zRnc5SW05NExCR2dxU1Z5TGxSQ2g3WkJmM2VPYjl6cVRkVjdBM3lONFFX?=
 =?utf-8?B?TW1XU3NSZVBhM0NNVVJMVHJTekNVbmdBb3Bib2ZmenV1RWNSdldnNllUNHMz?=
 =?utf-8?B?L1hEQ0l6M2g2YytjdUNiYkFEZG5aL3owQ1ByemhBK1NaRFpvY1pCYyszcXBr?=
 =?utf-8?B?YTdGT0RxNlN0ZXR0TG9INDFlZFJ1UTBkQ0ZIMFlHSlhyWkNlUExoc0NESWt3?=
 =?utf-8?B?dnpyc2VQZDJOVXZ3SFhwalNBNjkvNitSUHR5aDFjMWk0dzlVUU4wQ2lzZElC?=
 =?utf-8?B?Yjh5MnZicjlmNFdYZGtzaGtBRDI0QmR3YWE0bGxMTnc3dGswbzNjaVZUWW5W?=
 =?utf-8?B?MGNKcUdIa3dLWHhqY3lGQmljemY3aG9CMC95L1Y0ZW0ydDluK0szMjF1ZlNz?=
 =?utf-8?B?WUg2Z1lPaFhGUVFaUm02UDdLa1k0Kzc0NkZRZERiM1BqN1JoYWEyTmdQbGIx?=
 =?utf-8?B?T2V3N0thMjlsM2hGU1hrSTNKTmFINXZNWVdqVitpZ1dMcWRtNk91WFM0TnJy?=
 =?utf-8?B?ZlNDV0lvT2FVT29wT0JmVGJzUzYxOUx0aGRWK3plSTB5YnVZN2JkK0ZCdnhT?=
 =?utf-8?B?cmR3ekhXMk94UEEwQXRyWi9rOURzOFRwVjVmZW5VVzhuTjRsTWdZSW9mMnpO?=
 =?utf-8?B?d3cySi9URElRMFhFSnJNWWpCNDM2cVU3cHdhRElzeHBjSmh4RTN6ZEk3Q2Zs?=
 =?utf-8?B?eE5ZVXMvSmlmbVl2bWdLRE14dkRJWGdrSjhvZzlyWUROa0hraUpPdlB4ckpL?=
 =?utf-8?B?dFBLb0F4cUtwdjA1Z2R1Y2ZMOU1uKzkzMkxlcExBSTZTeGI1NXQxd0pMNFdN?=
 =?utf-8?B?MzlGWGY0dG8razY0eU9SU0JnWWVSNjlDbFFGZjRSdWRwTkcxVDEveWl5WUtJ?=
 =?utf-8?B?T1g5Qk5TUUpyMnRvZXlkTDBEYlArTXZ6cVROcm13eUxXbFgwTjE5dnlYOHFY?=
 =?utf-8?B?WFBORHR3M2VIYUNpRU9vbmdJZlVLdmhDNG1QVEpZSitDbzdlc055M3JSMXpV?=
 =?utf-8?B?eEROWFBrbXNZWUZleUxKbVd6M2tZT1ozZGJrTDdvSlhHTzR1Qi9kb3RkWUtH?=
 =?utf-8?B?MWU0aGJJQkdjS3hWMW1raFplVFg3ODFlYzlUd3k2NnpyUnRZSi9Hd2x0T2FX?=
 =?utf-8?B?YmtWVDAyZFlpSVFaMkYwbHNXYzBZRFVPc2RaQnYyTitvU0FRRjdDL1VnNXFX?=
 =?utf-8?B?REFGQnRtMmJ1bkZPTGZ4TXNHaGl6MVlaV1hScUZuZXBqZVRHWDRBWWU0SW5S?=
 =?utf-8?B?SG9yRWhlUHl5d0xpYlRjUEVEK3JUK08rMWgxdlgxUjN0VTNjbUlUNHY2ZXox?=
 =?utf-8?B?QnpVSkVLRmFLNGJOeHhIRGJpc292bmM5b1VJMXliQU1ZQmZWbld2cFMzT2N2?=
 =?utf-8?B?R0lha2t0R0UyTHovSWRGVUtBTVcrQ1ZXMTllZWk4YytVL2RkTDRIYmg1aFBo?=
 =?utf-8?B?OXQ0bStudktMVWlCcGRFckFXYm9vSjNFTUVGb1hsNW96dWUzU1RhR3FTQi96?=
 =?utf-8?B?L1R3dExzdU5LUGpMdlk0TWtCY08wejJ2OGJmeXlrUHlzaEpaRzNBUXREUEVE?=
 =?utf-8?Q?iF2+MrxUWxZHB7Kqx7R/7OA7f?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: a5c39b60-42ba-49f2-e437-08dcc033a7f4
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Aug 2024 09:45:27.5987
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: JP0JQaOo7399yVMoXxHba0rjteO20dqb3/ZHJ7IgP+J2vNf0p2y32DJp9g/HBrzFeAToA6aNU6OEllOB13dVlw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6614


On 16/08/2024 17:40, Julien Grall wrote:
> Hi Ayan,
Hi Julien,
>
> On 14/08/2024 13:33, Ayan Kumar Halder wrote:
>> Hi Jan,
>>
>> On 14/08/2024 12:35, Jan Beulich wrote:
>>> On 14.08.2024 12:55, Ayan Kumar Halder wrote:
>>>> Hi Jan,
>>>>
>>>> On 14/08/2024 07:37, Jan Beulich wrote:
>>>>> On 13.08.2024 19:13, Ayan Kumar Halder wrote:
>>>>>> From: Penny Zheng <penny.zheng@arm.com>
>>>>>>
>>>>>> Introduced CONFIG_VMAP which is selected by the architectures 
>>>>>> that use
>>>>>> MMU. vm_init() does not do anything if CONFIG_VMAP is not enabled.
>>>>>>
>>>>>> VMAP is widely used in ALTERNATIVE feature to remap a range of 
>>>>>> memory
>>>>>> with new memory attributes. Since this is highly dependent on 
>>>>>> virtual
>>>>>> address translation, we choose to fold VMAP in MMU system.
>>>>>>
>>>>>> In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and 
>>>>>> make it
>>>>>> only support in MMU system on ARM architecture. And ALTERNATIVE now
>>>>>> depends on VMAP.
>>>>>>
>>>>>> HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP as speculative
>>>>>> attacks are not possible on non MMU based systems (ie Cortex-R52, 
>>>>>> R82).
>>>>>> See https://developer.arm.com/Arm%20Security%20Center/ 
>>>>>> Speculative%20Processor%20Vulnerability.
>>>>> While I'm not an Arm expert and hence I'm likely missing aspects, 
>>>>> I question
>>>>> the one (Spectre-BHB) vulnerability there to be sufficient to draw a
>>>>> conclusion towards the usefulness of branch hardening. I would advise
>>>>> against encoding such a connection in the Kconfig dependencies.
>>>> AFAIU, to address 'Spectre' like vulnerabilities 'branch hardening' 
>>>> was
>>>> added.
>>>>
>>>> See https://lore.kernel.org/all/E1fNadD-0000fz-9r@rmk- 
>>>> PC.armlinux.org.uk/
>>>>
>>>> And from
>>>> https://lists.linaro.org/archives/list/linux-stable- 
>>>> mirror@lists.linaro.org/message/F4MGL4WT2R7T54NLRDGKFRQNSXF3DZGD/
>>>>
>>>> Spectre is valid on MMU based systems.
>>> Since then various other issues / flavors were found. I've been 
>>> focusing
>>> on the x86 side of things, but I'd be very surprised if some didn't
>>> affect other architectures as well.
>>
>> We are talking about Arm here as "HARDEN_BRANCH_PREDICTOR" is 
>> specific to Arm.
>>
>> https://developer.arm.com/Arm%20Security%20Center/ 
>> Speculative%20Processor%20Vulnerability covers all the flavours and 
>> it does not include Cortex-R82 or R52.
>>
>> It says the following :-
>>
>> "Cortex-R cores typically use a closed software stack. In those 
>> environments, applications or processes are strictly controlled, and 
>> therefore not exploitable"
>>
>>> Plus branch hardening can be a pre-
>>> cautionary measure, too, I think.
>>
>> The first two Arm non MMU cores that we wish to support in the 
>> forthcoming series is Cortex-R82 and R52.
>>
>> As seen in https://developer.arm.com/documentation/ka005109/latest/, 
>> it explicitly states the following about R82
>>
>> The Cortex-R82 implements the faulting feature (FEAT_FPAC) but is not 
>> vulnerable. The Cortex-R82 behaves differently than vulnerable 
>> A-class CPUs when speculatively executing past an instruction that 
>> authenticates PAC, and that behavior does not allow the attack 
>> software to create the "oracle".
>
> I am confused. This is describing why R82 is not affected by PACMAN. 
> But the Kconfig HARDEN_BRANCH_PREDICTOR is not for that (Xen doesn't 
> yet use Pointer Authentification Codes). The Kconfig was introduced 
> with XSA-254 which predates PACMAN by nearly 4 years.
Yes, you are correct. I was somehow linking PACMAN to branch prediction 
attacks. So, by mistake I assumed that HARDEN_BRANCH_PREDICTOR is used 
for protection against these attacks.
>
>>
>> We can re-enable branch hardening if we know there is a valid non MMU 
>> Arm core which is vulnerable.
>
> Re-quoting what you wrote earlier:
>
> "Cortex-R cores typically use a closed software stack. In those
> environments, applications or processes are strictly controlled, and
> therefore not exploitable"
>
> It is quite subtle. This wording doesn't imply the cores are not 
> vulnerable. It says that if they are, then it would be difficult to 
> exploit because the software should be tightly controlled.
>
> Now this would be really up to the user to decide whether they want to 
> be extra cautious/futureproof or not.
>
> As we are at the beginning of the MPU support, then I don't think we 
> need to resolve issue right now. And it would be fine to gate it. But 
> maybe ARCH_VMAP was an incorrect suggestion. It might be better to 
> gate with the !MMU (IIRC this would imply MPU).

I am ok with this. This has the benefit that the change can be contained 
within arch/arm if we do the following :-

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index cb2c0a16b8..26f7406278 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -329,7 +329,9 @@ void asmlinkage __init start_xen(unsigned long 
boot_phys_offset,

      setup_mm();

+#ifdef CONFIG_MMU
      vm_init();
+#endif

      /* Parse the ACPI tables for possible boot-time configuration */
      acpi_boot_table_init();

Are we ok with this ?

The definition of vm_init() is in xen/include/xen/vmap.h. If I enclose 
it using any CONFIG_XXX (like I have done in the current patch), then I 
need to introduce it in common/Kconfig and define it for x86 and PPC. I 
would prefer to contain the change within arch/arm only if possible.

>
> But before the feature can be marked as security support. We will need 
> to agree on how the hypervisor is intended to be used on ARMv8-R. 
> Maybe it would need a caveat "only trusted software can be run" which 
> means we don't have to worry about speculation on Cortex-R. Although, 
> it would be nice to have some defense in-depth :).

Yes, the support for ARMv8-R will be 'experimental' for some time. I am 
planning to add the minimal support required to just boot one or more DomUs.

- Ayan



From xen-devel-bounces@lists.xenproject.org Mon Aug 19 09:47:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 09:47:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779510.1189219 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyyn-0003CB-8Q; Mon, 19 Aug 2024 09:47:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779510.1189219; Mon, 19 Aug 2024 09:47:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfyyn-0003C4-5h; Mon, 19 Aug 2024 09:47:13 +0000
Received: by outflank-mailman (input) for mailman id 779510;
 Mon, 19 Aug 2024 09:47:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=hcB8=PS=bounce.vates.tech=bounce-md_30504962.66c3149e.v1-5ea8539928d14061b3928421b7c9ed03@srs-se1.protection.inumbo.net>)
 id 1sfyyl-0002K1-Vk
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 09:47:11 +0000
Received: from mail137-17.atl71.mandrillapp.com
 (mail137-17.atl71.mandrillapp.com [198.2.137.17])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 014e6a7b-5e10-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 11:47:11 +0200 (CEST)
Received: from pmta07.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail137-17.atl71.mandrillapp.com (Mailchimp) with ESMTP id
 4WnSRy259hzPm0QVV
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 09:47:10 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 5ea8539928d14061b3928421b7c9ed03; Mon, 19 Aug 2024 09:47:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 014e6a7b-5e10-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724060830; x=1724321330;
	bh=Hmn02V8tNlrg0T2y7P7nCWJdcFfG/gpDuDkmJVyvpFk=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=oU8T/qynZ04gOre2RiYfb1HVDEHAysipS1GMhSKGK3NAimCoF5n5LhRIFGKGtozHv
	 52KcvbpM6eNBW+1b98auFKbqv7UGy5kLhIaUae2pAeVnxWAVR78usRxi725zGT/Rx2
	 LQEIXqMSNmrI48Rj1qNvcO7G1wN7Ri3TKtbZUsjabbjMG4AxEUfStwjJiTyxxi6/dJ
	 S3L3KI8NeylMhLLx2CNAeO2Cv6IH7Wi075CuSzNQVEVIlhQn9gx85z/RsNUcbEiQql
	 dXmudviyVHuhonratio1INp/0l73Pob9IKbPIDSCHYwncr5naQmlTvQchfgtaY0KqN
	 vdNIqaAnxTBEw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724060830; x=1724321330; i=anthony.perard@vates.tech;
	bh=Hmn02V8tNlrg0T2y7P7nCWJdcFfG/gpDuDkmJVyvpFk=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=g+bcpbv22NbVzTImoWDoBt7Ei5w0gir3q+g2rX3H8VtViw3SGk5ovyzgqL5QrGVjF
	 l+X6szVftoXZVd9pReVOcnAePzXvhSkldUNzMNvSxU4BFRzjmPUcHElkdZcrdpxep3
	 l2Ed4IagSeAKk1LYgnzbMxPWknDy3mgEEbkkvlozYQ9MuA1j+uncfEOJpTmfyGqDef
	 pI5nSn6hxphPbt+kJmpPkKujw3JUqn0n2hcHKHhYzWh9pVGLdy23z+VySYa4HcUK5C
	 QNUy6PW+ALpCi2bjgajGcDuToX9w53cMTceV3yuHklRPc8E3ef1gNa5ExFOsnQJyIk
	 +TFwUbWgIO5eA==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=20v6=203/4]=20x86/ucode:=20Introduce=20--force=20option=20to=20xen-ucode?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724060829325
To: Fouad Hilly <fouad.hilly@cloud.com>
Cc: Jan Beulich <jbeulich@suse.com>, Juergen Gross <jgross@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
Message-Id: <ZsMUnNrxg728eE1J@l14>
References: <20240725082725.2685481-1-fouad.hilly@cloud.com> <20240725082725.2685481-4-fouad.hilly@cloud.com> <d26bc29f-3ceb-4fe4-af58-c188f9bbf097@suse.com> <CAJKAvHbM=Dhi=VRuaKKGMgoyOP9PHyF=Q50wfezpxs=mkRTZug@mail.gmail.com>
In-Reply-To: <CAJKAvHbM=Dhi=VRuaKKGMgoyOP9PHyF=Q50wfezpxs=mkRTZug@mail.gmail.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.5ea8539928d14061b3928421b7c9ed03?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240819:md
Date: Mon, 19 Aug 2024 09:47:10 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 19, 2024 at 09:56:57AM +0100, Fouad Hilly wrote:
> On Thu, Jul 25, 2024 at 9:44=E2=80=AFAM Jan Beulich <jbeulich@suse.com> w=
rote:
> 
> > On 25.07.2024 10:27, Fouad Hilly wrote:
> > > @@ -79,7 +81,9 @@ static void usage(FILE *stream, const char *name)
> > >              "options:\n"
> > >              "  -h, --help            display this help\n"
> > >              "  -s, --show-cpu-info   show CPU information\n"
> > > -            "Usage: %s [microcode file | options]\n", name, name);
> > > +            "  -f, --force           skip certain checks; do not use=
 unless\n"
> > > +            "you know exactly what you are doing\n"
> >
> > Did you look at the produced output? Imo you want to have
> >
> >             "  -f, --force           skip certain checks; do not use un=
less\n"
> >             "                        you know exactly what you are doin=
g\n"
> >
> > > +            "Usage: %s [microcode file [-f,--force] | options]\n", n=
ame, name);
> >
> > At least
> >
> >             "Usage: %s [microcode file [-f|--force] | options]\n", name=
, name);
> >
> > But: "options" now includes -f / --force, yet that on its own makes no =
sense.
> > I think this needs further textual clarification to properly indicate w=
hat is
> > valid to use and what is not.
> >
> 
> Will be fixed in v7:
> static void usage(FILE *stream, const char *name)
> {
>     fprintf(stream,
>             "%s: Xen microcode updating tool\n"
>             "Usage: %s [options | microcode-file]\n"
>             "options:\n"
>             "  -h, --help                       display this help\n"
>             "  -s, --show-cpu-info              show CPU information\n"
>             "  -f, --force <microcode-file>     skip certain checks; do n=
ot
> \n"

If I recall correctly, "--force" doesn't take any argument, so this
usage is misleading. One could be tempted to execute `./xen-ucode
-fmicrocode` or event `./xen-ucode --force -microcode` and expect it to
work with files "microcode" or "-microcode" but instead I think getopt()
is just going to return an error.

Instead of writing "--force <microcode-file>", could you change the help
text, with something like "skip certain checks when applying microcode"?

>             "                                   use unless you know exact=
ly
> \n"
>             "                                   what you are doing\n",
>             name, name);
>     show_curr_cpu(stream);

Cheers,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From xen-devel-bounces@lists.xenproject.org Mon Aug 19 09:55:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 09:55:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779520.1189229 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfz7B-0004qY-4k; Mon, 19 Aug 2024 09:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779520.1189229; Mon, 19 Aug 2024 09:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfz7B-0004qR-1T; Mon, 19 Aug 2024 09:55:53 +0000
Received: by outflank-mailman (input) for mailman id 779520;
 Mon, 19 Aug 2024 09:55:51 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sfz79-0004qL-LF
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 09:55:51 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sfz78-0000ix-PO; Mon, 19 Aug 2024 09:55:50 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sfz78-0005IB-IK; Mon, 19 Aug 2024 09:55:50 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=4TZOcAlEVvtZv36VJJaMzltq4oCXE3YQbOCGzPnK9Bg=; b=4gTb4z/s4LRQiP2c5KbeUAVFCX
	H3L9FTaKAVEk71Vycvq3qn5jIINhQQFlYAsZ6A66yLjSlL8JEZ12KMa8ZRZISh+HfGcQBpkiK99dW
	fWhzuXSJ9DLfdKDP3XJg2+oOVf7RGXyzxkEgRQeyq7trvknqg1JPCo6Tzsco1dolAC0Q=;
Message-ID: <febbaf82-5d9a-4bcd-8be9-93ac86b2c1bb@xen.org>
Date: Mon, 19 Aug 2024 10:55:48 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
Content-Language: en-GB
To: Ayan Kumar Halder <ayankuma@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
 <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
 <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
 <dad27ab7-3cbd-4a8e-8200-adea52b26e55@suse.com>
 <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
 <9fd1801c-1460-44e5-b066-f6da1167543b@xen.org>
 <1a328f00-3b0d-4e9c-856c-97c3a80dfdef@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <1a328f00-3b0d-4e9c-856c-97c3a80dfdef@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi Ayan,

On 19/08/2024 10:45, Ayan Kumar Halder wrote:
> I am ok with this. This has the benefit that the change can be contained 
> within arch/arm if we do the following :-
> 
> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
> index cb2c0a16b8..26f7406278 100644
> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -329,7 +329,9 @@ void asmlinkage __init start_xen(unsigned long 
> boot_phys_offset,
> 
>       setup_mm();
> 
> +#ifdef CONFIG_MMU
>       vm_init();
> +#endif
> 
>       /* Parse the ACPI tables for possible boot-time configuration */
>       acpi_boot_table_init();
> 
> Are we ok with this ?
> 
> The definition of vm_init() is in xen/include/xen/vmap.h. If I enclose 
> it using any CONFIG_XXX (like I have done in the current patch), then I 
> need to introduce it in common/Kconfig and define it for x86 and PPC. I 
> would prefer to contain the change within arch/arm only if possible.

Just to clarify, are you suggesting to just protect the call vm_init(). 
In other word, common/vmap.c would still be included in the final binary 
for the MPU?

If yes, then I think it would be a bit odd... Someone could still call 
vmap() and this would not break until runtime.

So I don't see how we could get away from modifying the common code.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Mon Aug 19 09:58:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 09:58:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779528.1189239 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfz9J-0006FG-F0; Mon, 19 Aug 2024 09:58:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779528.1189239; Mon, 19 Aug 2024 09:58:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sfz9J-0006F9-CK; Mon, 19 Aug 2024 09:58:05 +0000
Received: by outflank-mailman (input) for mailman id 779528;
 Mon, 19 Aug 2024 09:58:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sfz9H-0006F3-LG
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 09:58:03 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sfz9H-0000ks-9A; Mon, 19 Aug 2024 09:58:03 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sfz9H-0005OQ-3g; Mon, 19 Aug 2024 09:58:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:
	References:Cc:To:From:Subject:MIME-Version:Date:Message-ID;
	bh=uVtddXsbk17ADKW3RW5aI8yf8qopmCCwMIfX9HV5hEc=; b=Js9KVARmJxgg3NsHgk9kXG2iTt
	v0/34FmhbkIr89losVI2AhVY19e71jeXdWp5+YZ502Bs0oMfE7L9y/m0P7eYJKT2kLvrbgowPFrGz
	C+3ecaJoo5U9Lv0utkb311Wyv6VbqDs09zLEhSPa70s3KU6mK0nUYgc0sTK3nfZy0mS4=;
Message-ID: <55a91ace-a76f-40b9-bdb2-49f816006612@xen.org>
Date: Mon, 19 Aug 2024 10:58:01 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
Content-Language: en-GB
From: Julien Grall <julien@xen.org>
To: Ayan Kumar Halder <ayankuma@amd.com>, Jan Beulich <jbeulich@suse.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
 <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
 <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
 <dad27ab7-3cbd-4a8e-8200-adea52b26e55@suse.com>
 <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
 <9fd1801c-1460-44e5-b066-f6da1167543b@xen.org>
 <1a328f00-3b0d-4e9c-856c-97c3a80dfdef@amd.com>
 <febbaf82-5d9a-4bcd-8be9-93ac86b2c1bb@xen.org>
In-Reply-To: <febbaf82-5d9a-4bcd-8be9-93ac86b2c1bb@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit



On 19/08/2024 10:55, Julien Grall wrote:
> Hi Ayan,
> 
> On 19/08/2024 10:45, Ayan Kumar Halder wrote:
>> I am ok with this. This has the benefit that the change can be 
>> contained within arch/arm if we do the following :-
>>
>> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
>> index cb2c0a16b8..26f7406278 100644
>> --- a/xen/arch/arm/setup.c
>> +++ b/xen/arch/arm/setup.c
>> @@ -329,7 +329,9 @@ void asmlinkage __init start_xen(unsigned long 
>> boot_phys_offset,
>>
>>       setup_mm();
>>
>> +#ifdef CONFIG_MMU
>>       vm_init();
>> +#endif
>>
>>       /* Parse the ACPI tables for possible boot-time configuration */
>>       acpi_boot_table_init();
>>
>> Are we ok with this ?
>>
>> The definition of vm_init() is in xen/include/xen/vmap.h. If I enclose 
>> it using any CONFIG_XXX (like I have done in the current patch), then 
>> I need to introduce it in common/Kconfig and define it for x86 and 
>> PPC. I would prefer to contain the change within arch/arm only if 
>> possible.
> 
> Just to clarify, are you suggesting to just protect the call vm_init(). 
> In other word, common/vmap.c would still be included in the final binary 
> for the MPU?
> 
> If yes, then I think it would be a bit odd... Someone could still call 
> vmap() and this would not break until runtime.
> 
> So I don't see how we could get away from modifying the common code.

Readying my previous reply again. I think the confusion comes from:

 > But maybe ARCH_VMAP was an incorrect suggestion. It might be better 
to gate with the !MMU (IIRC this would imply MPU).

This was specifically referring to the branch predictor Kconfig. This 
was not a suggestion to avoid introducing ARCH_VMAP.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Mon Aug 19 11:08:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 11:08:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779543.1189250 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg0Em-0001tH-Ci; Mon, 19 Aug 2024 11:07:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779543.1189250; Mon, 19 Aug 2024 11:07:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg0Em-0001tA-9l; Mon, 19 Aug 2024 11:07:48 +0000
Received: by outflank-mailman (input) for mailman id 779543;
 Mon, 19 Aug 2024 11:07:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lvcB=PS=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sg0El-0001t4-Hl
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 11:07:47 +0000
Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com
 [2607:f8b0:4864:20::730])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 42d785eb-5e1b-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 13:07:45 +0200 (CEST)
Received: by mail-qk1-x730.google.com with SMTP id
 af79cd13be357-7a1dd2004e1so273458685a.3
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 04:07:45 -0700 (PDT)
Received: from fziglio-xenia-fedora.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a4ff0523a6sm422551785a.46.2024.08.19.04.07.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 19 Aug 2024 04:07:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 42d785eb-5e1b-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724065664; x=1724670464; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=m5hLKDiIf8PbFnL1WGqPzQt3Tm1PjWyBXlXM01uhQds=;
        b=EKS91nWU9fARSRIeZkMdzrLQGTB7UYyxtpqYV7Lx3fO4k/a2AXu9NKiMPA09HEl2AY
         Bl84xuYjzJLc9PFb77nxb6+aytSyRKQ76e+CtxHbgO9cxuEvVHFH2o3GHpjuVs5BF9Vr
         vfKrRNn7q84QvxY40qHiEE7UEowObA/O9v+OQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724065664; x=1724670464;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=m5hLKDiIf8PbFnL1WGqPzQt3Tm1PjWyBXlXM01uhQds=;
        b=ni0Qojd+ncdN14tW08rihfguLMEiYGKJkDJPxoWs+bhmo3ZN2e6OGhy3zMcyro4NJL
         fU2IKvYV9ratFQMwApYEc8TPYL4G4vbMEo2Hp5Yy+00NMpmOuRbzsMh3UdEh6ak6wcEO
         cYc9rO8UttrB6ChneZcHSds02pupmj7Mz6CARMSf6iX7N4hbq9yM9n9YlDttDkZmG9b1
         nvAqfOwvP8ExhNlFiQFn5atwQMnF5VmxZ1MA52rYPQHMVncvv6lsfjLqXN+z+gYUyENf
         i25tjIdUJ+yGpn+xNWxbjzyGm4ywIJIJ+UhPNE5mhQeM2Ks40bfPWToYi0fOALfPQpQp
         GQzw==
X-Gm-Message-State: AOJu0YyjmsHA+AbQUG44zUJQspccWnFE9hcce6brBolYedcQpewBbMzw
	eAK8M1zG7Dx0ZXWm7X7OaKnxsJ8jffYhqbJUv2w/CuOdrKlvrQSAza3YwLWNQzLoR8/ZFC940e8
	n
X-Google-Smtp-Source: AGHT+IFiYu8NmTurdnjjwALk9gyyAM1B8lKl01Kb2o/S2b2+d1ZJK5to1rjYVboITbPpKWak2/Qe0w==
X-Received: by 2002:a05:620a:150:b0:79f:2cb:86a1 with SMTP id af79cd13be357-7a5069bfbc2mr1163838585a.54.1724065664207;
        Mon, 19 Aug 2024 04:07:44 -0700 (PDT)
From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH] Avoid crash calling PrintErrMesg from efi_multiboot2
Date: Mon, 19 Aug 2024 12:07:19 +0100
Message-ID: <20240819110729.205707-1-frediano.ziglio@cloud.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Although code is compiled with -fpic option data is not position
independent. This causes data pointer to become invalid if
code is not relocated properly which is what happens for
efi_multiboot2 which is called by multiboot entry code.

Code tested adding
   PrintErrMesg(L"Test message", EFI_BUFFER_TOO_SMALL);
in efi_multiboot2 before calling efi_arch_edd (this function
can potentially call PrintErrMesg).

Before the patch (XenServer installation on Qemu, xen replaced
with vanilla xen.gz):
  Booting `XenServer (Serial)'Booting `XenServer (Serial)'
  Test message: !!!! X64 Exception Type - 0E(#PF - Page-Fault)  CPU Apic ID - 00000000 !!!!
  ExceptionData - 0000000000000000  I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX:0
  RIP  - 000000007DC29E46, CS  - 0000000000000038, RFLAGS - 0000000000210246
  RAX  - 0000000000000000, RCX - 0000000000000050, RDX - 0000000000000000
  RBX  - 000000007DAB4558, RSP - 000000007EFA1200, RBP - 0000000000000000
  RSI  - FFFF82D040467A88, RDI - 0000000000000000
  R8   - 000000007EFA1238, R9  - 000000007EFA1230, R10 - 0000000000000000
  R11  - 000000007CF42665, R12 - FFFF82D040467A88, R13 - 000000007EFA1228
  R14  - 000000007EFA1225, R15 - 000000007DAB45A8
  DS   - 0000000000000030, ES  - 0000000000000030, FS  - 0000000000000030
  GS   - 0000000000000030, SS  - 0000000000000030
  CR0  - 0000000080010033, CR2 - FFFF82D040467A88, CR3 - 000000007EC01000
  CR4  - 0000000000000668, CR8 - 0000000000000000
  DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
  DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
  GDTR - 000000007E9E2000 0000000000000047, LDTR - 0000000000000000
  IDTR - 000000007E4E5018 0000000000000FFF,   TR - 0000000000000000
  FXSAVE_STATE - 000000007EFA0E60
  !!!! Find image based on IP(0x7DC29E46) (No PDB)  (ImageBase=000000007DC28000, EntryPoint=000000007DC2B917) !!!!

After the patch:
  Booting `XenServer (Serial)'Booting `XenServer (Serial)'
  Test message: Buffer too small
  BdsDxe: loading Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
  BdsDxe: starting Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/common/efi/boot.c | 45 +++++++++++++++++++++++++++++--------------
 1 file changed, 31 insertions(+), 14 deletions(-)

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index efbec00af9..e6aa9271ed 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -287,19 +287,36 @@ static bool __init match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2)
 /* generic routine for printing error messages */
 static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
 {
-    static const CHAR16* const ErrCodeToStr[] __initconstrel = {
-        [~EFI_ERROR_MASK & EFI_NOT_FOUND]           = L"Not found",
-        [~EFI_ERROR_MASK & EFI_NO_MEDIA]            = L"The device has no media",
-        [~EFI_ERROR_MASK & EFI_MEDIA_CHANGED]       = L"Media changed",
-        [~EFI_ERROR_MASK & EFI_DEVICE_ERROR]        = L"Device error",
-        [~EFI_ERROR_MASK & EFI_VOLUME_CORRUPTED]    = L"Volume corrupted",
-        [~EFI_ERROR_MASK & EFI_ACCESS_DENIED]       = L"Access denied",
-        [~EFI_ERROR_MASK & EFI_OUT_OF_RESOURCES]    = L"Out of resources",
-        [~EFI_ERROR_MASK & EFI_VOLUME_FULL]         = L"Volume is full",
-        [~EFI_ERROR_MASK & EFI_SECURITY_VIOLATION]  = L"Security violation",
-        [~EFI_ERROR_MASK & EFI_CRC_ERROR]           = L"CRC error",
-        [~EFI_ERROR_MASK & EFI_COMPROMISED_DATA]    = L"Compromised data",
-        [~EFI_ERROR_MASK & EFI_BUFFER_TOO_SMALL]    = L"Buffer too small",
+#define ERROR_MESSAGE_LIST \
+    ERROR_MESSAGE(EFI_NOT_FOUND, "Not found") \
+    ERROR_MESSAGE(EFI_NO_MEDIA, "The device has no media") \
+    ERROR_MESSAGE(EFI_MEDIA_CHANGED, "Media changed") \
+    ERROR_MESSAGE(EFI_DEVICE_ERROR, "Device error") \
+    ERROR_MESSAGE(EFI_VOLUME_CORRUPTED, "Volume corrupted") \
+    ERROR_MESSAGE(EFI_ACCESS_DENIED, "Access denied") \
+    ERROR_MESSAGE(EFI_OUT_OF_RESOURCES, "Out of resources") \
+    ERROR_MESSAGE(EFI_VOLUME_FULL, "Volume is full") \
+    ERROR_MESSAGE(EFI_SECURITY_VIOLATION, "Security violation") \
+    ERROR_MESSAGE(EFI_CRC_ERROR, "CRC error") \
+    ERROR_MESSAGE(EFI_COMPROMISED_DATA, "Compromised data") \
+    ERROR_MESSAGE(EFI_BUFFER_TOO_SMALL, "Buffer too small")
+
+    static const struct ErrorStrings {
+        CHAR16 start;
+#undef ERROR_MESSAGE
+#define ERROR_MESSAGE(code, str) CHAR16 msg_ ## code[sizeof(str)];
+        ERROR_MESSAGE_LIST
+    } ErrorStrings __initconst = {
+        0
+#undef ERROR_MESSAGE
+#define ERROR_MESSAGE(code, str) , L ## str
+        ERROR_MESSAGE_LIST
+    };
+    static const uint16_t ErrCodeToStr[] __initconst = {
+#undef ERROR_MESSAGE
+#define ERROR_MESSAGE(code, str) \
+        [~EFI_ERROR_MASK & code] = offsetof(struct ErrorStrings, msg_ ## code),
+        ERROR_MESSAGE_LIST
     };
     EFI_STATUS ErrIdx = ErrCode & ~EFI_ERROR_MASK;
 
@@ -308,7 +325,7 @@ static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
     PrintErr(L": ");
 
     if( (ErrIdx < ARRAY_SIZE(ErrCodeToStr)) && ErrCodeToStr[ErrIdx] )
-        mesg = ErrCodeToStr[ErrIdx];
+        mesg = (CHAR16*) ((char*) &ErrorStrings + ErrCodeToStr[ErrIdx]);
     else
     {
         PrintErr(L"ErrCode: ");
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 19 11:18:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 11:18:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779507.1189260 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg0Oy-0003yP-Ad; Mon, 19 Aug 2024 11:18:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779507.1189260; Mon, 19 Aug 2024 11:18:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg0Oy-0003yI-7V; Mon, 19 Aug 2024 11:18:20 +0000
Received: by outflank-mailman (input) for mailman id 779507;
 Mon, 19 Aug 2024 09:46:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ws91=PS=bounce.vates.tech=bounce-md_30504962.66c31482.v1-fc016af0e3024006b85150e2876adb8d@srs-se1.protection.inumbo.net>)
 id 1sfyyL-0002K1-AD
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 09:46:45 +0000
Received: from mail137-17.atl71.mandrillapp.com
 (mail137-17.atl71.mandrillapp.com [198.2.137.17])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f101b1e4-5e0f-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 11:46:44 +0200 (CEST)
Received: from pmta07.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail137-17.atl71.mandrillapp.com (Mailchimp) with ESMTP id
 4WnSRQ3QlLzPm0Pmj
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 09:46:42 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 fc016af0e3024006b85150e2876adb8d; Mon, 19 Aug 2024 09:46:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f101b1e4-5e0f-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724060802; x=1724321302;
	bh=G8elqKwHsG2cymVfWO0cd3BkZEw7znurCHPirnN0AOs=;
	h=From:Subject:Message-Id:To:Cc:Feedback-ID:Date:MIME-Version:
	 Content-Type:CC:Date:Subject:From;
	b=jWcy9rFgPHgd/7FgB5BNh8YfbrtcuZ6A81EVkArgJoA9mgC2gWeJVnghh1/67/Gdh
	 Z/Ybnb9QvmO5fSNo5gHr9KTGQD5lgI5R7Kp2NNdkCpKBN4XmDxDMt+PtwyFzNfXfPp
	 3BwjacBQ4FNa0OAQ0bXgHRerBDxBszci+mgth7tkF95GghRbZmy3IDr9MS9q8UdpW9
	 SFzoE6oTwaYFP1zfIpBNfim53hGg8Tyfns9jMUmgytnfJZhlkT2mMxLPsaowTFRJKb
	 zTuYvDeNq0eQB/TiPmpZ4iYZFfApYGHMqUMT0eolkNJDnSRuMy2xTiEwFWaL13jHLn
	 kPQH6nPuMY85w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724060802; x=1724321302; i=charles.schulz@vates.tech;
	bh=G8elqKwHsG2cymVfWO0cd3BkZEw7znurCHPirnN0AOs=;
	h=From:Subject:Message-Id:To:Cc:Feedback-ID:Date:MIME-Version:
	 Content-Type:CC:Date:Subject:From;
	b=tEGCzntCu3rGVlRtBFyXJgmGcWJvVAZl7tK9jahJrIvov6JdnIRiPl1R5Enck/u3z
	 aWIABDeKWxw7BAXjJY5Is7j8ymPaEWQ5+rch4fU9EY64tbABKpMfc/dExjli49p4Z3
	 1M5bfamOn1YPVAW480TSwdPo2VLC49KkgLCVS5hrnlcod1BliwYby8JInfrVWHdZAz
	 R0DKMgq5GajoCUgAQD37qTFZdzk6LW7bX4Zr7XvmWEWyT29h7p2yYYsaXimS/AczzK
	 SxJs0TZVKaWtxcLqvLckwrpv9lb7LhXYRPcO5lPT4+ruvmwPtq3gVJU7kPVCCJ6L4J
	 pKYgJN7dMD49Q==
From: "Charles-H. Schulz" <charles.schulz@vates.tech>
Subject: =?utf-8?Q?Setting=20up=20the=20Xen=20Communications=20Team?=
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724060798873
Message-Id: <e56ff82c1a1d7398a5b38784fc84a7adf51ec918.camel@vates.tech>
To: xen-devel <xen-devel@lists.xenproject.org>, Xen Project Advisory Board <advisory-board@lists.xenproject.org>
Cc: Kelly Choi <kelly.choi@cloud.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.fc016af0e3024006b85150e2876adb8d?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240819:md
Date: Mon, 19 Aug 2024 09:46:42 +0000
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="_av-3w5-efQcpESJEyXLgvX8Cw"

--_av-3w5-efQcpESJEyXLgvX8Cw
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello everyone,

Just like any major FOSS project, Xen needs to take care of its
messaging and communication. We are usually focused on software
development, however we'd like to take the opportunity to call on
whoever is interested here to join the small team in charge of
Communications.=C2=A0

We do not expect this to involve a large additional workload. If you
are interested in joining, please send a message to Kelly or reply to
this email.

Thank you,

-- 
Charles-H. Schulz
Chief Strategy Officer
Vates SAS - +33 (0)6 98 65 54 24



--_av-3w5-efQcpESJEyXLgvX8Cw
Content-Type: application/pgp-signature
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="signature.asc"

LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRSXpCQUFCQ0FBZEZp
RUVCcE15NjBzdVV4LzhhVjUxZnFKcldiZVl0T01GQW1iREZIUUFDZ2tRZnFK
cldiZVkKdE9OcitRLy9SS1NyQndVQWtjVG05TDQ2WUJJVUNsdXowNHhlQ01x
aUlQTTY3NWJzZDJYVldyWmw1TVlRUm5wNQpKenZLc2c1VnFVcDEvd1VUbEdr
YkU0dUgvaTdaRUpDQ0NFLzgxTXgrb3VhRE9vYmZVbnB6Zm82VWhGQTlPQ0pO
CmYxdTZhSmErcEpFZXIvWEVUOGpKRm9UeVVValVhakVhUDdEOVdsYmkwUTA3
OUlRMlV5STVVclVVWGExS0JybmUKRmxZUHN5TEJScVlPa1ZWSGxzSjNnVDF5
T3BUYWFQWUNra0dUeThwYk1LaGs1QmkrVFExQy93cGkzUzhaaDBlbwprR3Fq
S2FLSitlRERqWTJUMUozM29YQ3l2Qm8wTjd1M2loUDVya3BXSEY3ZVR6WDZX
RlEwbzN5clZSRGI2KzJJCmpjckpFVk5oRGFtMUtsWjJzeHlMMzNrYjdqa2VB
ZW1hbmViOTdiRCtMaHRnY1dqWlJDOThlQ0srcG1WWElFVE8KaFRGdTc3K1A4
N2hTeXptNytEckxDMHBGRndFOXZDcTlhc1I2RzViQzA0OUNkdTB0WnB4RTda
OTB2Q0RmcGVxawpZTXB4TjdWOHlVVmJvaXRCdzhMYWdIb2tHMithM2dLc3ZF
M21EdUZGTndsZFhCZGNyWkF0YWRrZzlsTm9YVmhsCmVlcDFjLzNkRmlDRCtP
QWVYREp2TVdKeEtzd0gvRnRZM3JoZ01JaU5ucUVVSjNSay85eFZmVklwT0RQ
bDYvSzYKWitUVmUvcjk1RHEwYUhZeFZXai9KSnhFWm5uOWdHU2xyN2daOWV2
Rzk3T3ZFM2RPZXFoT05oeHFDSE5jN3B0ZQpwbmZkenFoTE5LRUNETUIrSE1l
REFVTXZudEJwZUl5bmZCSGhhQy9oeHpBQW9UL3NySm89Cj1sYVgvCi0tLS0t
RU5EIFBHUCBTSUdOQVRVUkUtLS0tLQoK

--_av-3w5-efQcpESJEyXLgvX8Cw--



From xen-devel-bounces@lists.xenproject.org Mon Aug 19 11:35:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 11:35:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779563.1189270 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg0fl-00078I-Mr; Mon, 19 Aug 2024 11:35:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779563.1189270; Mon, 19 Aug 2024 11:35:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg0fl-00078B-K7; Mon, 19 Aug 2024 11:35:41 +0000
Received: by outflank-mailman (input) for mailman id 779563;
 Mon, 19 Aug 2024 11:35:40 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sg0fk-000785-1b
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 11:35:40 +0000
Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com
 [2a00:1450:4864:20::336])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 27431ef7-5e1f-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 13:35:38 +0200 (CEST)
Received: by mail-wm1-x336.google.com with SMTP id
 5b1f17b1804b1-4281d812d3eso46251285e9.3
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 04:35:36 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a838396e0edsm619916766b.222.2024.08.19.04.35.35
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 04:35:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 27431ef7-5e1f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724067336; x=1724672136; 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=2ZSnyPp5I8ZzYOSC8r9y4DICPE+jaj/ujt+3Vx/s5gU=;
        b=TJmH5BwDnFpCl7nGPsTrseQ3v2DIBFpPXvZ8lvebG2CmOKa29NDRdb69aCMdGwnvb5
         lFgioP28Z2c2F484sr/E+MoMU1e444KMdDRl65HNkFkGh6W5ArHctLQpZiLd2BJUnUhA
         /D9R8cPM+Vt18AlgdSoUpx1FKP5yN66WYbDZpqC9vjT6J1gSmv7KW1uNPYgkJz7oSPVL
         PintEomJZ4UJFYHlfg+kyTEIBhj4XwYQUsXtQMRV9O7uQfPJJm7UQKVbK7uW1Ne7g4AC
         1HEUQT9v4BghRQrT9c1wBzg/uuf8N6y5+fFisrRfNomaaufA/CTFy8M/lCerJe+jZ/KI
         +xLQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724067336; x=1724672136;
        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=2ZSnyPp5I8ZzYOSC8r9y4DICPE+jaj/ujt+3Vx/s5gU=;
        b=mshmFF/chtjl1Aj/VLyJ3+pZgI0DIWfSKlO/sITZ/uVxyOWvEZAZma4dLN8vNzeDh6
         K2L19rUSLfhhaTNm5977HJzeME653h7YU/Cyi8noi/PIYrNh/XdoGHjpW13lpEVCzUE7
         H9OmJsIhjDwDGy4Qktr5vOPaTzpZO1SM6FwyRalXIbb0LKECQpkZIriEeuvI9NOt88Gn
         4M6EHXekRygjbsruyG7jGldcGa1+OqtQF1xCvG44+gJSt0g6IZpfydsn0+HetC0tO2YY
         xsHijM4PIkL/OEC0WogusUD0An84G1iApr9eMlihrB539EdjevZFUva3iKQ6a5ZL5ueD
         hnGw==
X-Forwarded-Encrypted: i=1; AJvYcCXXKxXPN0gj0/XBmSxzZGldWvFKXMzhZnibJtGsmuk0NGLPrbTFqNL4MIRyhiSPRRLJB6y5SBXQC8jLRmxoDJeYqkpGiEOMF92kTn+NIIM=
X-Gm-Message-State: AOJu0YwKU1zzVq8YalZqxVDG2rfNcLofTN6JGpHt4mQ2L/kTDg3vbGEj
	FqjktelqlydyYbl4OgFJmA2INC4wWPQ5rhhu2bDymL/3iKlGj7EQgONuY0+Ncw==
X-Google-Smtp-Source: AGHT+IGXfeJuq4efzTUo620nLNM7ozIi/qh46btWrvRqaBwr8OJKrTEuOWfn6emVpsGRCiqMmvqN+w==
X-Received: by 2002:a5d:548c:0:b0:368:3f6a:1dea with SMTP id ffacd0b85a97d-37194315601mr8417703f8f.6.1724067335901;
        Mon, 19 Aug 2024 04:35:35 -0700 (PDT)
Message-ID: <271cf485-c03a-4592-a1fb-d6d201fbe74b@suse.com>
Date: Mon, 19 Aug 2024 13:35:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] Avoid crash calling PrintErrMesg from efi_multiboot2
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <20240819110729.205707-1-frediano.ziglio@cloud.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: <20240819110729.205707-1-frediano.ziglio@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 19.08.2024 13:07, Frediano Ziglio wrote:
> --- a/xen/common/efi/boot.c
> +++ b/xen/common/efi/boot.c
> @@ -287,19 +287,36 @@ static bool __init match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2)
>  /* generic routine for printing error messages */
>  static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
>  {
> -    static const CHAR16* const ErrCodeToStr[] __initconstrel = {
> -        [~EFI_ERROR_MASK & EFI_NOT_FOUND]           = L"Not found",
> -        [~EFI_ERROR_MASK & EFI_NO_MEDIA]            = L"The device has no media",
> -        [~EFI_ERROR_MASK & EFI_MEDIA_CHANGED]       = L"Media changed",
> -        [~EFI_ERROR_MASK & EFI_DEVICE_ERROR]        = L"Device error",
> -        [~EFI_ERROR_MASK & EFI_VOLUME_CORRUPTED]    = L"Volume corrupted",
> -        [~EFI_ERROR_MASK & EFI_ACCESS_DENIED]       = L"Access denied",
> -        [~EFI_ERROR_MASK & EFI_OUT_OF_RESOURCES]    = L"Out of resources",
> -        [~EFI_ERROR_MASK & EFI_VOLUME_FULL]         = L"Volume is full",
> -        [~EFI_ERROR_MASK & EFI_SECURITY_VIOLATION]  = L"Security violation",
> -        [~EFI_ERROR_MASK & EFI_CRC_ERROR]           = L"CRC error",
> -        [~EFI_ERROR_MASK & EFI_COMPROMISED_DATA]    = L"Compromised data",
> -        [~EFI_ERROR_MASK & EFI_BUFFER_TOO_SMALL]    = L"Buffer too small",
> +#define ERROR_MESSAGE_LIST \
> +    ERROR_MESSAGE(EFI_NOT_FOUND, "Not found") \
> +    ERROR_MESSAGE(EFI_NO_MEDIA, "The device has no media") \
> +    ERROR_MESSAGE(EFI_MEDIA_CHANGED, "Media changed") \
> +    ERROR_MESSAGE(EFI_DEVICE_ERROR, "Device error") \
> +    ERROR_MESSAGE(EFI_VOLUME_CORRUPTED, "Volume corrupted") \
> +    ERROR_MESSAGE(EFI_ACCESS_DENIED, "Access denied") \
> +    ERROR_MESSAGE(EFI_OUT_OF_RESOURCES, "Out of resources") \
> +    ERROR_MESSAGE(EFI_VOLUME_FULL, "Volume is full") \
> +    ERROR_MESSAGE(EFI_SECURITY_VIOLATION, "Security violation") \
> +    ERROR_MESSAGE(EFI_CRC_ERROR, "CRC error") \
> +    ERROR_MESSAGE(EFI_COMPROMISED_DATA, "Compromised data") \
> +    ERROR_MESSAGE(EFI_BUFFER_TOO_SMALL, "Buffer too small")
> +
> +    static const struct ErrorStrings {

__initconst?

> +        CHAR16 start;
> +#undef ERROR_MESSAGE
> +#define ERROR_MESSAGE(code, str) CHAR16 msg_ ## code[sizeof(str)];
> +        ERROR_MESSAGE_LIST
> +    } ErrorStrings __initconst = {
> +        0
> +#undef ERROR_MESSAGE
> +#define ERROR_MESSAGE(code, str) , L ## str
> +        ERROR_MESSAGE_LIST
> +    };
> +    static const uint16_t ErrCodeToStr[] __initconst = {
> +#undef ERROR_MESSAGE
> +#define ERROR_MESSAGE(code, str) \
> +        [~EFI_ERROR_MASK & code] = offsetof(struct ErrorStrings, msg_ ## code),
> +        ERROR_MESSAGE_LIST
>      };
>      EFI_STATUS ErrIdx = ErrCode & ~EFI_ERROR_MASK;
>  
> @@ -308,7 +325,7 @@ static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
>      PrintErr(L": ");
>  
>      if( (ErrIdx < ARRAY_SIZE(ErrCodeToStr)) && ErrCodeToStr[ErrIdx] )
> -        mesg = ErrCodeToStr[ErrIdx];
> +        mesg = (CHAR16*) ((char*) &ErrorStrings + ErrCodeToStr[ErrIdx]);

Please never cast away const. Also (nit) please put the blanks at the right
places. Finally instead of casting to char * (something string-like)
intermediately, perhaps better cast to void *? Taken together

        mesg = (const CHAR16 *)((const void *)&ErrorStrings + ErrCodeToStr[ErrIdx]);

(which looks like it'll then also need line-wrapping).

Further please add an appropriate Fixes: tag.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 11:39:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 11:39:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779573.1189279 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg0jL-0008Qe-8y; Mon, 19 Aug 2024 11:39:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779573.1189279; Mon, 19 Aug 2024 11:39:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg0jL-0008QX-6W; Mon, 19 Aug 2024 11:39:23 +0000
Received: by outflank-mailman (input) for mailman id 779573;
 Mon, 19 Aug 2024 11:39:21 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sg0jJ-0008QR-8k
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 11:39:21 +0000
Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com
 [2a00:1450:4864:20::12c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id abfe080d-5e1f-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 13:39:19 +0200 (CEST)
Received: by mail-lf1-x12c.google.com with SMTP id
 2adb3069b0e04-52efdf02d13so5508591e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 04:39:19 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838d023dsm619746966b.64.2024.08.19.04.39.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 04:39:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: abfe080d-5e1f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724067559; x=1724672359; 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=74M02xVp+Xc+oxJDi9RbzCA2XfqS0Zn9U0wGl/0+2Mw=;
        b=YdeoLogfinY8pbMzp5o8X4pqlmEOzmdttnQELUmfJzXioWKcSf5pw62A+Hu8rew3QG
         plvYeV1L8hhVWvkL2L3oEVxD5gw+ntotYK+ovwJ162r2Ft+6Y+MTE/DQm4POthy09rsc
         fAtqdx3WESYXfOwZeChngcXq/kZRXaz3y5ek4NBses+AJoLiIws1kCX5UlDAFNM4C7NE
         +L/bjIpyhgQjgyT3PHO/XhdvCmOl6sOsJ8udVur6DiW/BXIzuYUIgrJU7iqQi7zYAKKj
         JteL2re0dtKtiViMkT05L9ea1MlZ9KEmhdlIImvu75eXdqQ0KU5Kj2f4iznF9wQKvBjf
         QKXw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724067559; x=1724672359;
        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=74M02xVp+Xc+oxJDi9RbzCA2XfqS0Zn9U0wGl/0+2Mw=;
        b=rOfyRwhARfu/JECv3J9sjN2ftVUFKra0XcaW97YePN+Nt3BGSqxAheL+RG+AhNlFTq
         rz0NEBVou5B9X9hCx93GbzxSsKZx8F9JF0uuXCiEfDFrmXroVjGKRMyZeh60ciF1yiVK
         DmeVxbGoJ/S/m4bMHCvXK3k+oDabsaY5j+Vy/0av4UE3YRPgTWuEOPN5P4Jg+IEShDhn
         N0ALo2DC/vkitPiaeetRGBNYPyLo3bOyNPQi4qmHb8dj8P6Alt/D9gd1yPp5QeizATCg
         MW1b7BHHwo84FqzBs9ztJ5O4dhFirTy70MT4lHGOigcDfNncn4mlDhItYYhiSkn8lmQz
         AZmg==
X-Gm-Message-State: AOJu0YypELLC9pdZ+1xcLuOS4rlh8KE+ilTfi8NhoZUx0JMkvbxVo6o3
	sZ9Ibb3aKw7eYL+RGtKtlEB5PYk7G9DEvI9VLd6iqnP44GDNy74S3QxaZGw3wg==
X-Google-Smtp-Source: AGHT+IE45SmaVY5uuiJfX9e4OG7Cr/E0xeWeH0UhRI9v97dRPk3jKrhRHCRY4/yl0L5nKA8MiLObkw==
X-Received: by 2002:a05:6512:684:b0:52f:cd03:a84a with SMTP id 2adb3069b0e04-5331c6dbd0fmr8645101e87.39.1724067558725;
        Mon, 19 Aug 2024 04:39:18 -0700 (PDT)
Message-ID: <ff48fff8-a659-4e63-8e1f-2385a936ad61@suse.com>
Date: Mon, 19 Aug 2024 13:39:17 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
To: Ayan Kumar Halder <ayankuma@amd.com>, Julien Grall <julien@xen.org>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
 <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
 <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
 <dad27ab7-3cbd-4a8e-8200-adea52b26e55@suse.com>
 <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
 <9fd1801c-1460-44e5-b066-f6da1167543b@xen.org>
 <1a328f00-3b0d-4e9c-856c-97c3a80dfdef@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1a328f00-3b0d-4e9c-856c-97c3a80dfdef@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Guys,

On 19.08.2024 11:45, Ayan Kumar Halder wrote:
> On 16/08/2024 17:40, Julien Grall wrote:
>> On 14/08/2024 13:33, Ayan Kumar Halder wrote:

mind me asking why I continue to be on the To: list of this communication
between the two of you?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 12:13:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 12:13:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779588.1189289 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1Fm-0006WF-OL; Mon, 19 Aug 2024 12:12:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779588.1189289; Mon, 19 Aug 2024 12:12:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1Fm-0006W8-Lm; Mon, 19 Aug 2024 12:12:54 +0000
Received: by outflank-mailman (input) for mailman id 779588;
 Mon, 19 Aug 2024 12:12:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sg1Fl-0006W2-QD
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 12:12:53 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sg1Fl-0003BA-4G; Mon, 19 Aug 2024 12:12:53 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sg1Fk-0005zT-T7; Mon, 19 Aug 2024 12:12:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=yBp6PCLGRk39z6uE+CXhCv0rgtlyChLM/gtG7/hAn2s=; b=3fjxxNGzvcWd2DB+Xy3kPbsTGP
	sFfhfxcvrh8G5XgLm//KaEeBvXhS+CWeUAhAFGWRJYjmSQv+wuu+yeYHz++tf97bsfgoP7E7FfVVF
	uLmttfYiqVB1VBKACYmuY3i82ml3rr8YOwvZzzv4OJZ5bSDyhApPz7vYSt/VvsxCFf1U=;
Message-ID: <826532b8-1618-4246-aefb-d5315b877d6b@xen.org>
Date: Mon, 19 Aug 2024 13:12:50 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>, Ayan Kumar Halder <ayankuma@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
 <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
 <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
 <dad27ab7-3cbd-4a8e-8200-adea52b26e55@suse.com>
 <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
 <9fd1801c-1460-44e5-b066-f6da1167543b@xen.org>
 <1a328f00-3b0d-4e9c-856c-97c3a80dfdef@amd.com>
 <ff48fff8-a659-4e63-8e1f-2385a936ad61@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <ff48fff8-a659-4e63-8e1f-2385a936ad61@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 19/08/2024 12:39, Jan Beulich wrote:
> Guys,
> 
> On 19.08.2024 11:45, Ayan Kumar Halder wrote:
>> On 16/08/2024 17:40, Julien Grall wrote:
>>> On 14/08/2024 13:33, Ayan Kumar Halder wrote:
> 
> mind me asking why I continue to be on the To: list of this communication
> between the two of you?

You were involved in the review and AFAICT will still touch the common 
code. I am happy to remove you from the conversation if you are not 
interested :).

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Mon Aug 19 12:21:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 12:21:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779599.1189299 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1O8-0000GD-HH; Mon, 19 Aug 2024 12:21:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779599.1189299; Mon, 19 Aug 2024 12:21:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1O8-0000G6-Ep; Mon, 19 Aug 2024 12:21:32 +0000
Received: by outflank-mailman (input) for mailman id 779599;
 Mon, 19 Aug 2024 12:21:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sg1O7-0000G0-BZ
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 12:21:31 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 902fc922-5e25-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 14:21:29 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-52efd855adbso5250986e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 05:21:30 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383969e05sm628199266b.191.2024.08.19.05.21.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 05:21:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 902fc922-5e25-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724070090; x=1724674890; 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=7Vz8vE/ymJZICUcyrHGy5xrlNpTTvJ67BxOWCKxn3Cg=;
        b=QVrOPxHG8NukukaETD0BCLlpyf0wmA0fQs31iKSfsCrYMK6igpVw3VaOahUMk+NABp
         DKQlGl0Izr9FHr1eV9+BU877URptmOAnLNNyHoIPy4Ee+nNrKRsHZ87wGKolredG6//u
         aC6pZcZ6mzgoiYzcz4ONwXVs+Smzk+hf5CvZtw5jD8+GFNf9NMAf2Myu+75BSSBHKp/E
         ze6p864MUiREyhQf3hprZAjpZK2Kf2Vcba34bR+NM9WekbcNuBAhJwdGvNYByxSpI4cO
         CUJiV34aBVNXoJwiX9pmXAcdwJtsOxEXCdLD+y3FxUSaTk5vmmXsmNfYbsx3DJ0JflPG
         pfHg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724070090; x=1724674890;
        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=7Vz8vE/ymJZICUcyrHGy5xrlNpTTvJ67BxOWCKxn3Cg=;
        b=dULtViGloDXm9iWqg++v7mRV57TRxp95N2tIS1kmOJCn1Wh8WHo8zGlxUrdBXou8xR
         ijxqSApswVYOGQHCWqq+Ewm5mRzRXqUp3ZoURWIZzh7WFTktwN1RZPePrWAjWeVoS3V7
         8/gtLsVH1Ih00kz+DvXzSX4zuMeWfB6qgu979GO7CkTT7OOOd/0xax/ooJXVDcxssCev
         VjOPS45XSb4CAhVmBDQVV0TZvLGndeMS8SNBlmvISctB06e8RiWXeqs/Q8lBVO9jFbrb
         P5JF3GamzagYnxDADp//Oij/+MD1QlDgGeiDMCwgSvAGFBT8c8zpXoth8kaslYO/kCye
         Dz3Q==
X-Forwarded-Encrypted: i=1; AJvYcCUoeEgsGeup+B1nFV+/s5Atpi0NG5KpJHf+WT+eCn0FhvXQ7MCLkTqogb1ilWyVBCWKUJNH2hidwI5+rf2vURgcRxS+4Ytcmgu8K5XMkLE=
X-Gm-Message-State: AOJu0YzL3GgnV31G8bJ9LcupQcxJ9uJmZkX4MpyUYtDwML9FcEF1aWDG
	2qdla0Y779IKfawNAqQ2AhvJwMzyvV3Qip5g9wE1KvnAqC9mNROfb+4FvkHK9w==
X-Google-Smtp-Source: AGHT+IHRzRib003uODeZ67kzaZAcZ232AZ8r60jrcee9EspZzBiFa35k7u+HvaLuQaLftbGY1qjpIQ==
X-Received: by 2002:a05:6512:1086:b0:52e:bf53:1c2b with SMTP id 2adb3069b0e04-5331c692d51mr7534819e87.12.1724070089517;
        Mon, 19 Aug 2024 05:21:29 -0700 (PDT)
Message-ID: <a8de2dc4-24a1-418e-8ad3-2673e008ae96@suse.com>
Date: Mon, 19 Aug 2024 14:21:28 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v2 2/5] x86/amd: configurable handling of AMD-specific
 MSRs access
To: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
 <917d2186db56c6f4c820f6b9e26b29fbe93301d6.1723806405.git.Sergiy_Kibrik@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <917d2186db56c6f4c820f6b9e26b29fbe93301d6.1723806405.git.Sergiy_Kibrik@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 16.08.2024 13:12, Sergiy Kibrik wrote:
> Do not compile handlers of guest access to AMD-specific MSRs when CONFIG_AMD=n.

What I'm missing in the description is clarification on how boundaries were
drawn. In guest_rdmsr() there is, for example, also handling of MSR_AMD_PATCHLEVEL.
Which I'm okay to leave aside for now, as long as it's clear why that is.

> --- a/xen/arch/x86/msr.c
> +++ b/xen/arch/x86/msr.c
> @@ -219,6 +219,7 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
>          *val = msrs->tsc_aux;
>          break;
>  
> +#ifdef CONFIG_AMD
>      case MSR_K8_SYSCFG:
>      case MSR_K8_TOP_MEM1:
>      case MSR_K8_TOP_MEM2:
> @@ -281,6 +282,7 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t *val)
>                                     ? 0 : (msr - MSR_AMD64_DR1_ADDRESS_MASK + 1),
>                                     ARRAY_SIZE(msrs->dr_mask))];
>          break;
> +#endif /* CONFIG_AMD */
>  
>          /*
>           * TODO: Implement when we have better topology representation.
> @@ -552,6 +554,7 @@ int guest_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
>              wrmsr_tsc_aux(val);
>          break;
>  
> +#ifdef CONFIG_AMD
>      case MSR_VIRT_SPEC_CTRL:
>          if ( !cp->extd.virt_ssbd )
>              goto gp_fault;
> @@ -598,6 +601,7 @@ int guest_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
>          if ( v == curr && (curr->arch.dr7 & DR7_ACTIVE_MASK) )
>              wrmsrl(msr, val);
>          break;
> +#endif /* CONFIG_AMD */
>  
>      default:
>          return X86EMUL_UNHANDLEABLE;

Is just adding #ifdef-s actually correct? That results in different behavior on
e.g. Intel hardware, I think, depending on whether AMD=y or AMD=n. In the latter
case the function will now return X86EMUL_UNHANDLEABLE, while in the former case
it would return X86EMUL_EXCEPTION.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 12:25:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 12:25:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779606.1189310 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1RX-0000q7-0q; Mon, 19 Aug 2024 12:25:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779606.1189310; Mon, 19 Aug 2024 12:25:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1RW-0000q0-UV; Mon, 19 Aug 2024 12:25:02 +0000
Received: by outflank-mailman (input) for mailman id 779606;
 Mon, 19 Aug 2024 12:25: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=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sg1RW-0000pu-0x
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 12:25:02 +0000
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com
 [2a00:1450:4864:20::529])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0dca9371-5e26-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 14:25:00 +0200 (CEST)
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5becdf7d36aso2996016a12.1
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 05:25:01 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5beef16a9bbsm1888619a12.57.2024.08.19.05.24.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 05:25:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0dca9371-5e26-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724070300; x=1724675100; 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=IaNKqlOguBm72gTDAQUaaq6VKtkqgB0dJSIk5iGSdrI=;
        b=TGsHBT8968fYysXjI/scTadjCL7ms1HtpYeK9DHDK1HSWYcKjZLKdFChwHCjXxf5oi
         c6gW9LT6GOjB0HbKbsS1j389sYrZk/fZWRmS/UCUiuaLUC8a4oCDBcmstp5lRQMRzmbh
         KFuKmRNk2k6UZG22xzM8LwXdMKOXNJHTrtvoizNLptf1JLbdcLto8LIyhlpfS45CdZm5
         eK91kFPwLVn4mybCShrwgcpLFHZ36XhyezCi3NgT9eQbLl4pDZ4UXbzXU59x1xXDtnZg
         4H9j+DMKCtVzh8IgNOYcLQuEThSxr2tAFLFFycgGSm8di3vt/GcDBa5Ef9ZmQ6tEcWkS
         O7kQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724070300; x=1724675100;
        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=IaNKqlOguBm72gTDAQUaaq6VKtkqgB0dJSIk5iGSdrI=;
        b=J66jufrCbe9z4YlcKzz99BiY6zW4ejgqCZUI0KFv/kFlhkAsyIQN2Mop55gPgqTV0m
         ilq2ZOkrEpfFTygwOT7cdsseOEZJfodN84d9mjZ6Sq8VxwIixMKzm9tkpx6a+xB0UYe+
         FT0o6Ij6cGEDD9+56xTxvC+U8qChe0Qf9ImQPgqOMPsqtbRczXz/Y2lmIowMuQ4X6+06
         RLhHN0xBjTc8ndUFVxFQ07gGpkDm0KjcrPfnH+DxnmrAbkt+K8la4vos4vkhIOduL95P
         y4YIoE3sPaK+udBkoKBKUHY9Y8FX95emhlx3io4kU8fjplbEwH9lLxsb3haNVm7rI/nL
         YiqQ==
X-Gm-Message-State: AOJu0Yz6jwMr6M5UyE5MVwmcMKucELnKtSEKfxZ/MH4/12Hrc8nHw9ut
	9ivWxt54LJpKRVkHCgr1kqmQicURtx8FZO6J/nW95o/fmNgbPxcs2o1fC7LYNQ==
X-Google-Smtp-Source: AGHT+IEg0g7fr1hhWr4ZAd1aEWGIB2G/REpDomPh8AMppDx+8thlR67ab7Yorb3DcyASvESBgWyFRQ==
X-Received: by 2002:a05:6402:5290:b0:5be:c5a1:cc6 with SMTP id 4fb4d7f45d1cf-5beca7959eamr6585334a12.34.1724070300328;
        Mon, 19 Aug 2024 05:25:00 -0700 (PDT)
Message-ID: <759d5d83-b09c-4853-8ec0-63a19faf8af5@suse.com>
Date: Mon, 19 Aug 2024 14:24:59 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
To: Julien Grall <julien@xen.org>, Ayan Kumar Halder <ayankuma@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
 <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
 <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
 <dad27ab7-3cbd-4a8e-8200-adea52b26e55@suse.com>
 <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
 <9fd1801c-1460-44e5-b066-f6da1167543b@xen.org>
 <1a328f00-3b0d-4e9c-856c-97c3a80dfdef@amd.com>
 <ff48fff8-a659-4e63-8e1f-2385a936ad61@suse.com>
 <826532b8-1618-4246-aefb-d5315b877d6b@xen.org>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <826532b8-1618-4246-aefb-d5315b877d6b@xen.org>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 19.08.2024 14:12, Julien Grall wrote:
> On 19/08/2024 12:39, Jan Beulich wrote:
>> Guys,
>>
>> On 19.08.2024 11:45, Ayan Kumar Halder wrote:
>>> On 16/08/2024 17:40, Julien Grall wrote:
>>>> On 14/08/2024 13:33, Ayan Kumar Halder wrote:
>>
>> mind me asking why I continue to be on the To: list of this communication
>> between the two of you?
> 
> You were involved in the review and AFAICT will still touch the common 
> code. I am happy to remove you from the conversation if you are not 
> interested :).

That wasn't my request though. It's fine to keep me Cc-ed.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 12:28:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 12:28:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779614.1189320 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1V9-00028Z-GB; Mon, 19 Aug 2024 12:28:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779614.1189320; Mon, 19 Aug 2024 12:28:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1V9-00028S-DL; Mon, 19 Aug 2024 12:28:47 +0000
Received: by outflank-mailman (input) for mailman id 779614;
 Mon, 19 Aug 2024 12:28:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sg1V7-00028M-Lk
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 12:28:45 +0000
Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com
 [2a00:1450:4864:20::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 931e72f4-5e26-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 14:28:44 +0200 (CEST)
Received: by mail-ej1-x630.google.com with SMTP id
 a640c23a62f3a-a8374e6a6fbso520892766b.3
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 05:28:44 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383935984sm627580766b.116.2024.08.19.05.28.43
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 05:28:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 931e72f4-5e26-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724070524; x=1724675324; 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=2LRTc2ob5i1caEeLOvnQ6KWSCSQ6ADEg4hGUZMcdX4g=;
        b=X5e4vjCdmQbHjSYuSESR4ccRLzSNiT8LOVtkMk24tG19KS/XNZoGcHlPGBrpRxHqqg
         x1p34W4cMIYLB/0wv8oQoJ0WLiumSsM5MPpoaxzN+9dS+n0sObvOuusrdB7yY8S8FJOC
         AHAVTXZx5T1sjwdrTy6Uzr0pNRc9zJVthtBhfLi8ck1nImMivXRviuaOIMYnOZFapkph
         6IhJNTNwlOQOL/9mAQtbqzI04tcSkX/GMqgTtfnOMPrrcQGPIVvcdUsHE+6WIDsIjGU3
         qdEyrz3m0QvDyXne1AvKW0QymEUJppOW0N0Qv+abbZgFP/CCwZlseysMO3j7VFcwFQKl
         z+2g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724070524; x=1724675324;
        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=2LRTc2ob5i1caEeLOvnQ6KWSCSQ6ADEg4hGUZMcdX4g=;
        b=ruNjgEpHe+FqIzFjW7U+qBMMbzZ9tvxCUiNbjz8vAjF5xsMNGH1FDTTlvJDUOT8aXK
         f09UCwK1iHpxp0Q9ZsjxgMaNn2JY3c2pS2i4UPwefwDVhopvSkeeMt7ogE8tIH8FSwPd
         6JUqR0MOoRqnfyZX9QKdtmWJbfqDRetpJLbJRBiAQxPXMRkDl1CoSHd9ieu+xWHf3+Ko
         lQp6KG7JfXr5fbTT07Bu6aPqtV+kNvBYl+4hrfYBnoPjpMghROuLeGQ4iBDbgWr1SV9O
         Joja1exQI9ISdU7SB6mW21l/sq71gD65KfpS5EoeG55iSRC9KvDvPM7L8DoOnwbgS/d4
         /l9Q==
X-Forwarded-Encrypted: i=1; AJvYcCXVwNXJW8OjflTkJB0IB3Dz+vboTBqZiU7JVAUCKOfV9lsGBGtDbDiWLW1d7G/vbUddnM1/qTcoz+jjvXc4/Fm/D8YuFJBWQAszrNvwjeI=
X-Gm-Message-State: AOJu0YyQaAt7/3tJyIdLgc6+WCZUiYkW9ZS44Ti6MwkxxdTC9tHlYYFa
	ErG+5xEUqLSeZiRZXOaRljZJubAJzIcsHtmbFdM/FFhxUh0XRBZsdG7DkhMc9w==
X-Google-Smtp-Source: AGHT+IEHJyIJ9m6UhvWpeWgOKrEhRy1ZS5QpZbqKea8EhJDcP75k8yY7GE/Z4+TGNiuV2tDxrBKmmw==
X-Received: by 2002:a17:907:86a4:b0:a7d:34bf:600e with SMTP id a640c23a62f3a-a8392a4a586mr713043366b.60.1724070523858;
        Mon, 19 Aug 2024 05:28:43 -0700 (PDT)
Message-ID: <94d08e04-041c-448e-a2c3-28b8c00b82ec@suse.com>
Date: Mon, 19 Aug 2024 14:28:42 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v2 3/5] x86/spec-ctrl: configurable
 Intlel/AMD-specific calculations
To: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
 <b789679a7edd41c88eca41d3c703d2292cfcce0e.1723806405.git.Sergiy_Kibrik@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <b789679a7edd41c88eca41d3c703d2292cfcce0e.1723806405.git.Sergiy_Kibrik@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 16.08.2024 13:14, Sergiy Kibrik wrote:
> Put platforms-specific code under #ifdef CONFIG_{AMD,INTEL} so that when
> corresponding CPU support is disabled by configuration less dead code will end
> up in the build.
> 
> This includes re-ordering of calls to ibpb_calculations() & div_calculations(),
> but since they don't access common variables or feature bits it should be
> safe to do.
> 
> Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
> CC: Jan Beulich <jbeulich@suse.com>

For one please consider adding Requested-by: or Suggested-by: tags.

> --- a/xen/arch/x86/spec_ctrl.c
> +++ b/xen/arch/x86/spec_ctrl.c
> @@ -1012,6 +1012,7 @@ static bool __init should_use_eager_fpu(void)
>      }
>  }
>  
> +#ifdef CONFIG_AMD
>  /*
>   * https://www.amd.com/content/dam/amd/en/documents/corporate/cr/speculative-return-stack-overflow-whitepaper.pdf
>   */
> @@ -1110,6 +1111,7 @@ static void __init div_calculations(bool hw_smt_enabled)
>              "enabled.  Please assess your configuration and choose an\n"
>              "explicit 'smt=<bool>' setting.  See XSA-439.\n");
>  }
> +#endif /* CONFIG_AMD */

And then no, I don't think we want to use #ifdef-ary here. IS_ENABLED()
inside the functions (where the vendor checks are) is not only making
sure the compiler will still parse all the code even when either vendor's
support was turned off, but will also help review (by having in context
what the actual vendor checks are in each function).

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 12:31:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 12:31:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779622.1189330 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1Y0-0003ao-TT; Mon, 19 Aug 2024 12:31:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779622.1189330; Mon, 19 Aug 2024 12:31:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1Y0-0003ah-QC; Mon, 19 Aug 2024 12:31:44 +0000
Received: by outflank-mailman (input) for mailman id 779622;
 Mon, 19 Aug 2024 12:31:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sg1Xz-0003ab-6B
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 12:31:43 +0000
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [2a00:1450:4864:20::534])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fd42f0c3-5e26-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 14:31:42 +0200 (CEST)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5bed05c0a2fso3214021a12.3
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 05:31:42 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bebbde7cd4sm5560594a12.39.2024.08.19.05.31.41
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 05:31:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fd42f0c3-5e26-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724070702; x=1724675502; 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=haOCps7ggVu9u+LeYF6RYqtaDJSDRpLps7AkVHNZHUc=;
        b=JW67/XhigM7BcpNtVH4IY5G7gLU1nXcqfODkRYbLmtWYjhlsa536Cdqci/hYFCkL2F
         86U8FbtQEleaYBNq0p2U6qZtsldhU7kdezkM+Lp+BkSxej34Gq7dHl7wf0Z/df7KDEIW
         Ih5QzNNFP1vyiFzQONlzsh3JrwQv+gjxSASF2qdJQfvGAOPIA0xfmIjyPnh7HbpoDdtq
         WP6D3N+sP345WqlVd50iTu64dz44PBxvm5fcbpej/YMjx6pyx8gPUPNY1y2dmHWDIhs0
         dsI24FSLBNsLiJhX8287UhcuA1PjKLEDiKeBg1Q7F8KjdY0RGMUSKK0VwMu8SsKWMYrD
         ZpLA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724070702; x=1724675502;
        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=haOCps7ggVu9u+LeYF6RYqtaDJSDRpLps7AkVHNZHUc=;
        b=WiseuDnzYsJHFu5cq5TsJtJqNxheGbJy1klX5ody8zZRazk5GMF0m7JE9rJz4LIo1u
         g83aQCVbuvI2TaHtfvdkNH/c5PnD5fFGJjxkUxuvb/9sJRBQbZd7lQyn0rwOyvPNdwxo
         Edbj0JVbHhatSbxeSt/XT0Bf8mBYqzl3791Zb4TApmTxNj21RMQgfNmtO/7eSCpNgWsC
         8Jy3H5Q70Sa902MImj9VVHuLTswF+Yry7VVxLmt2g8tf2vPcevucrsdSrhEr/nWknjnO
         Y7Q2fAmPfSVQy3MjsRKe4QcVAxnyrewyP7Gms2ZlPjFqX4iUmj2V13uHWvrMz484CA+r
         WRGw==
X-Forwarded-Encrypted: i=1; AJvYcCUbxUVK7f96xUFEq1VXIBbC46UQyVpf52amoH0T5ZeeRTCkypzUMK4hVvf/i7UkADnWCAffmgXsiGdLHm4WPJBEOVvFszbzwnSiwkZPVDw=
X-Gm-Message-State: AOJu0YxDBiqw6wVc2fJnzUYHKDUcit4toHFqjJTRAtg2QAYU8sq9FBEK
	MdJBvHrmDO6CoN5q1v/Kho5ciFsMYL+0wd4UG/CgS5/bkZhqmPIcLlHgH3rJyQ==
X-Google-Smtp-Source: AGHT+IG3PKCsbNrU/lD0j45YEOuhYTnXvIUwr57MmKLWV7gHa3/tiPLbZgQV7TZcBs+Gytas+N4rrg==
X-Received: by 2002:a05:6402:1ece:b0:5b9:462d:c538 with SMTP id 4fb4d7f45d1cf-5beca4be005mr8392143a12.3.1724070701716;
        Mon, 19 Aug 2024 05:31:41 -0700 (PDT)
Message-ID: <96af19a7-4f0f-457c-bba9-b4678c0bfa1b@suse.com>
Date: Mon, 19 Aug 2024 14:31:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v2 4/5] x86/intel: optional build of intel.c
To: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 xen-devel@lists.xenproject.org
References: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
 <ce06eff2060c94ebf659d11f7390c577a3c6a24e.1723806405.git.Sergiy_Kibrik@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <ce06eff2060c94ebf659d11f7390c577a3c6a24e.1723806405.git.Sergiy_Kibrik@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 16.08.2024 13:17, Sergiy Kibrik wrote:
> With specific config option INTEL in place and most of the code that depends
> on intel.c now can be optionally enabled/disabled it's now possible to put
> the whole intel.c under INTEL option as well. This will allow for a Xen build
> without Intel CPU support.
> 
> Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Mon Aug 19 12:35:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 12:35:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779630.1189339 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1bX-0004Dv-Ej; Mon, 19 Aug 2024 12:35:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779630.1189339; Mon, 19 Aug 2024 12:35:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1bX-0004Do-C5; Mon, 19 Aug 2024 12:35:23 +0000
Received: by outflank-mailman (input) for mailman id 779630;
 Mon, 19 Aug 2024 12:35:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lvcB=PS=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sg1bW-0004Di-O3
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 12:35:22 +0000
Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com
 [2607:f8b0:4864:20::f30])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7f914a73-5e27-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 14:35:21 +0200 (CEST)
Received: by mail-qv1-xf30.google.com with SMTP id
 6a1803df08f44-6bf6ea1d34aso23593816d6.1
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 05:35:21 -0700 (PDT)
Received: from fziglio-xenia-fedora.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6bf6fec61fbsm41530346d6.103.2024.08.19.05.35.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 19 Aug 2024 05:35:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7f914a73-5e27-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724070920; x=1724675720; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=HJGpMDTvKgH/4CK3WqC47Q0qOJyIK4iJaP0Dbsss8Bw=;
        b=ZIxcX88od07Lm4mL8og8rau0Y0ocKJywjrXIEFO2bv4yKJmiWnlhTzsHIXaixL2FYm
         NOceR44qbTfwQMh3tvxWcNmBJQs6Zq244JonwQ6B4oEeH0K0+Y6Ui6Gege6LMyydrjZg
         1vl6ROf7gaReXc+vB80I/Hn8uuoifCLesgS2g=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724070920; x=1724675720;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=HJGpMDTvKgH/4CK3WqC47Q0qOJyIK4iJaP0Dbsss8Bw=;
        b=KY090lV3lPYp3+GCvAjslSD/fAjAFT4ezCsmI8z4i2XeWPVWtlfdWdTBK+FFDFF0dz
         SMLlIEUXa0J81RMv6Kt1FHzb4HXtyxbRt2nAfKNZ9BMciI0VvCgs5k+axVPAW3IcVsfO
         LXaV2voP6Dp1SCJqPqfU08YI8os9QxsUruVuNUm1C8jmSHBjyi8FBI4zpqj+CqRm5s9B
         /EJXqXmhqmFwfGN7BWPsPYzGYwZLjdtkGeHBcM6JHHSnaGGRNhpn2wr2Id9fOA0cakPI
         57Sg8uwSs99lxgUiZ6xhRRU/4m4shAbPLDoo5g7whIe9R5MNOt7qEcQlv6zMrEOxO/cE
         3m7Q==
X-Gm-Message-State: AOJu0YxLf4Pnz9hCNbKg5Miv+rCR/zl0ENUHrw6OyjNHur6j35LdFFC0
	pyJwWRlfZtktNqC7JNgArOQG/5kpPjt+qcQnYR2zMSgs5b4eSUqTftxzplCBqgNMXmBfdetIaWT
	u
X-Google-Smtp-Source: AGHT+IGnnC4tfaF5lPH3GjU8ZKotquTpfKqgVIwKymoa8O3FrAGbvjvRR8j3pAU0SxFFJr1umAlP0A==
X-Received: by 2002:a05:6214:451d:b0:6bb:9b66:f262 with SMTP id 6a1803df08f44-6bf7ce5b492mr114937456d6.41.1724070920094;
        Mon, 19 Aug 2024 05:35:20 -0700 (PDT)
From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v2] Avoid crash calling PrintErrMesg from efi_multiboot2
Date: Mon, 19 Aug 2024 13:35:06 +0100
Message-ID: <20240819123508.217444-1-frediano.ziglio@cloud.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Although code is compiled with -fpic option data is not position
independent. This causes data pointer to become invalid if
code is not relocated properly which is what happens for
efi_multiboot2 which is called by multiboot entry code.

Code tested adding
   PrintErrMesg(L"Test message", EFI_BUFFER_TOO_SMALL);
in efi_multiboot2 before calling efi_arch_edd (this function
can potentially call PrintErrMesg).

Before the patch (XenServer installation on Qemu, xen replaced
with vanilla xen.gz):
  Booting `XenServer (Serial)'Booting `XenServer (Serial)'
  Test message: !!!! X64 Exception Type - 0E(#PF - Page-Fault)  CPU Apic ID - 00000000 !!!!
  ExceptionData - 0000000000000000  I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX:0
  RIP  - 000000007DC29E46, CS  - 0000000000000038, RFLAGS - 0000000000210246
  RAX  - 0000000000000000, RCX - 0000000000000050, RDX - 0000000000000000
  RBX  - 000000007DAB4558, RSP - 000000007EFA1200, RBP - 0000000000000000
  RSI  - FFFF82D040467A88, RDI - 0000000000000000
  R8   - 000000007EFA1238, R9  - 000000007EFA1230, R10 - 0000000000000000
  R11  - 000000007CF42665, R12 - FFFF82D040467A88, R13 - 000000007EFA1228
  R14  - 000000007EFA1225, R15 - 000000007DAB45A8
  DS   - 0000000000000030, ES  - 0000000000000030, FS  - 0000000000000030
  GS   - 0000000000000030, SS  - 0000000000000030
  CR0  - 0000000080010033, CR2 - FFFF82D040467A88, CR3 - 000000007EC01000
  CR4  - 0000000000000668, CR8 - 0000000000000000
  DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
  DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
  GDTR - 000000007E9E2000 0000000000000047, LDTR - 0000000000000000
  IDTR - 000000007E4E5018 0000000000000FFF,   TR - 0000000000000000
  FXSAVE_STATE - 000000007EFA0E60
  !!!! Find image based on IP(0x7DC29E46) (No PDB)  (ImageBase=000000007DC28000, EntryPoint=000000007DC2B917) !!!!

After the patch:
  Booting `XenServer (Serial)'Booting `XenServer (Serial)'
  Test message: Buffer too small
  BdsDxe: loading Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
  BdsDxe: starting Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)

Fixes: 00d5d5ce23e6 ("work around Clang generating .data.rel.ro section for init-only files")
Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/common/efi/boot.c | 45 +++++++++++++++++++++++++++++--------------
 1 file changed, 31 insertions(+), 14 deletions(-)
---
Changes since v1:
- added "Fixes:" tag;
- fixed cast style change.

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index efbec00af9..bbcd9263e1 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -287,19 +287,36 @@ static bool __init match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2)
 /* generic routine for printing error messages */
 static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
 {
-    static const CHAR16* const ErrCodeToStr[] __initconstrel = {
-        [~EFI_ERROR_MASK & EFI_NOT_FOUND]           = L"Not found",
-        [~EFI_ERROR_MASK & EFI_NO_MEDIA]            = L"The device has no media",
-        [~EFI_ERROR_MASK & EFI_MEDIA_CHANGED]       = L"Media changed",
-        [~EFI_ERROR_MASK & EFI_DEVICE_ERROR]        = L"Device error",
-        [~EFI_ERROR_MASK & EFI_VOLUME_CORRUPTED]    = L"Volume corrupted",
-        [~EFI_ERROR_MASK & EFI_ACCESS_DENIED]       = L"Access denied",
-        [~EFI_ERROR_MASK & EFI_OUT_OF_RESOURCES]    = L"Out of resources",
-        [~EFI_ERROR_MASK & EFI_VOLUME_FULL]         = L"Volume is full",
-        [~EFI_ERROR_MASK & EFI_SECURITY_VIOLATION]  = L"Security violation",
-        [~EFI_ERROR_MASK & EFI_CRC_ERROR]           = L"CRC error",
-        [~EFI_ERROR_MASK & EFI_COMPROMISED_DATA]    = L"Compromised data",
-        [~EFI_ERROR_MASK & EFI_BUFFER_TOO_SMALL]    = L"Buffer too small",
+#define ERROR_MESSAGE_LIST \
+    ERROR_MESSAGE(EFI_NOT_FOUND, "Not found") \
+    ERROR_MESSAGE(EFI_NO_MEDIA, "The device has no media") \
+    ERROR_MESSAGE(EFI_MEDIA_CHANGED, "Media changed") \
+    ERROR_MESSAGE(EFI_DEVICE_ERROR, "Device error") \
+    ERROR_MESSAGE(EFI_VOLUME_CORRUPTED, "Volume corrupted") \
+    ERROR_MESSAGE(EFI_ACCESS_DENIED, "Access denied") \
+    ERROR_MESSAGE(EFI_OUT_OF_RESOURCES, "Out of resources") \
+    ERROR_MESSAGE(EFI_VOLUME_FULL, "Volume is full") \
+    ERROR_MESSAGE(EFI_SECURITY_VIOLATION, "Security violation") \
+    ERROR_MESSAGE(EFI_CRC_ERROR, "CRC error") \
+    ERROR_MESSAGE(EFI_COMPROMISED_DATA, "Compromised data") \
+    ERROR_MESSAGE(EFI_BUFFER_TOO_SMALL, "Buffer too small")
+
+    static const struct ErrorStrings {
+        CHAR16 start;
+#undef ERROR_MESSAGE
+#define ERROR_MESSAGE(code, str) CHAR16 msg_ ## code[sizeof(str)];
+        ERROR_MESSAGE_LIST
+    } ErrorStrings __initconst = {
+        0
+#undef ERROR_MESSAGE
+#define ERROR_MESSAGE(code, str) , L ## str
+        ERROR_MESSAGE_LIST
+    };
+    static const uint16_t ErrCodeToStr[] __initconst = {
+#undef ERROR_MESSAGE
+#define ERROR_MESSAGE(code, str) \
+        [~EFI_ERROR_MASK & code] = offsetof(struct ErrorStrings, msg_ ## code),
+        ERROR_MESSAGE_LIST
     };
     EFI_STATUS ErrIdx = ErrCode & ~EFI_ERROR_MASK;
 
@@ -308,7 +325,7 @@ static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
     PrintErr(L": ");
 
     if( (ErrIdx < ARRAY_SIZE(ErrCodeToStr)) && ErrCodeToStr[ErrIdx] )
-        mesg = ErrCodeToStr[ErrIdx];
+        mesg = (const CHAR16 *)((const void *)&ErrorStrings + ErrCodeToStr[ErrIdx]);
     else
     {
         PrintErr(L"ErrCode: ");
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 19 12:36:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 12:36:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779640.1189350 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1cr-0005BG-PB; Mon, 19 Aug 2024 12:36:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779640.1189350; Mon, 19 Aug 2024 12:36:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1cr-0005B9-Lo; Mon, 19 Aug 2024 12:36:45 +0000
Received: by outflank-mailman (input) for mailman id 779640;
 Mon, 19 Aug 2024 12:36:44 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sg1cq-00050u-82
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 12:36:44 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b05b81eb-5e27-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 14:36:42 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5becfd14353so2974869a12.1
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 05:36:42 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a838396bc50sm628134966b.198.2024.08.19.05.36.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 05:36:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b05b81eb-5e27-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724071002; x=1724675802; 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=/sNJW+D9JttMU+LFQe6BNRSUs+MACejWDdGl22/raSg=;
        b=Yman7Kqi0mwPh79O914InVdnj1KypIuMHQVjEpwXFEHFyexRVHvnRZw/yQs+MDgDNB
         XOREO0ZkWULHIOK3BD0TQUqMBwvj7/kVwEqytF3macxFtxGAQ5O8V3UUKNJm3Kq4kSX6
         HfTxQmKthbw8jOjMQ9I+Sf9sKSFLxgFgs7VtzNsIqNw+mAuh6stgYTyP62OkvfWNyjt1
         S2FFp5LQTWmJXP9ksdjLzYYfh4odKGQMR6JEkBwtTwVdWNa4OcicCA5A8lrRI/WRzuGl
         rHvzgyal3BUfgYTniSPnC6oI1vampnu5+B4rio8OakAPRaIoW/WpXV6uBY3xeRIPWqXy
         5KbQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724071002; x=1724675802;
        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=/sNJW+D9JttMU+LFQe6BNRSUs+MACejWDdGl22/raSg=;
        b=Ylwm7e1dapKY07ACBinfntNX4hCOhKp+H6HVfbQl0GsRqKVYOn+oqGVlBeIkE2QnP7
         II7M0nJ84YseWxQO0ntuFraa9YFmsK0e1qRN/ki25qdcxzIc9fA97LdP2WH0FMV0PJwn
         ylkkfvMHY3akSMBXibeK4LcGtJpet1UyKGrEUfXfbpu12PTAko5jvjtELWl4sRcqYSJF
         fWI+aWCztZOJ4PqpECK/El6TFZbPqlF4aMiYZKINtpYiT7kB1UICjavqmLXW6sh3YEC8
         x7XiBfhC6PQN5D+JDw7wVZDvqSvG4Cr05lDWW9YrF5X4rIrro3+J26bJdbIig71jsp+i
         NIzw==
X-Forwarded-Encrypted: i=1; AJvYcCXacdchTvnGV5aijJZ0z2l4DMPnhzWO1ntclLfAI6ZqHy2t7oQ61PdWuI55BXpZOVh/3nCqsbw7xFAJOjBpXlGcDaHThrIiSGyhhxVGKU0=
X-Gm-Message-State: AOJu0YxS3r+NeybrMmm37i0kEAcj+Ocpar57gik0wX/I4brYF6zyjrr2
	gz5LJTDOhZO3ctmdFoR9a34av6g0Mb7troRRI1pctOe8GgYWuvQ8yBs/UoiVqQ==
X-Google-Smtp-Source: AGHT+IFe1OGkA1m6FcrKoVEH8lpj0UvluNDFJxpKYNwS4cReiMu/LsdDkUj861Cg1fZjAZNCK31ObA==
X-Received: by 2002:a17:907:9686:b0:a7d:30d2:28f8 with SMTP id a640c23a62f3a-a8392a3923bmr612783766b.68.1724071001184;
        Mon, 19 Aug 2024 05:36:41 -0700 (PDT)
Message-ID: <5675ea5a-0c14-42e2-b817-d9576a1f64b7@suse.com>
Date: Mon, 19 Aug 2024 14:36:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v2 5/5] x86/amd: optional build of amd.c
To: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
 <3c641433fa7cfe1f7fdc918ab32086835a2e13eb.1723806405.git.Sergiy_Kibrik@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <3c641433fa7cfe1f7fdc918ab32086835a2e13eb.1723806405.git.Sergiy_Kibrik@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 16.08.2024 13:19, Sergiy Kibrik wrote:
> --- a/xen/arch/x86/hvm/svm/svm.c
> +++ b/xen/arch/x86/hvm/svm/svm.c
> @@ -919,7 +919,8 @@ static void cf_check svm_ctxt_switch_from(struct vcpu *v)
>       * Possibly clear previous guest selection of SSBD if set.  Note that
>       * SPEC_CTRL.SSBD is already handled by svm_vmexit_spec_ctrl.
>       */
> -    if ( v->arch.msrs->virt_spec_ctrl.raw & SPEC_CTRL_SSBD )
> +    if ( IS_ENABLED(CONFIG_AMD) &&
> +         v->arch.msrs->virt_spec_ctrl.raw & SPEC_CTRL_SSBD )
>      {
>          ASSERT(v->domain->arch.cpuid->extd.virt_ssbd);
>          amd_set_legacy_ssbd(false);
> @@ -953,7 +954,8 @@ static void cf_check svm_ctxt_switch_to(struct vcpu *v)
>          wrmsr_tsc_aux(v->arch.msrs->tsc_aux);
>  
>      /* Load SSBD if set by the guest. */
> -    if ( v->arch.msrs->virt_spec_ctrl.raw & SPEC_CTRL_SSBD )
> +    if ( IS_ENABLED(CONFIG_AMD) &&
> +         v->arch.msrs->virt_spec_ctrl.raw & SPEC_CTRL_SSBD )
>      {
>          ASSERT(v->domain->arch.cpuid->extd.virt_ssbd);
>          amd_set_legacy_ssbd(true);

Instead of these changes, shouldn't AMD_SVM become dependent upon AMD in
Kconfig?

> +#ifdef CONFIG_AMD
> +extern bool amd_acpi_c1e_quirk;
> +extern bool amd_virt_spec_ctrl;
> +#else
> +
> +#define amd_acpi_c1e_quirk (false)
> +#define amd_virt_spec_ctrl (false)

As a remark, while there's nothing wrong with parenthesizing "false" here,
it also isn't really necessary. Omitting unnecessary parentheses generally
aids readability imo.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 12:42:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 12:42:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779656.1189360 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1i4-0007Cu-Ar; Mon, 19 Aug 2024 12:42:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779656.1189360; Mon, 19 Aug 2024 12:42:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1i4-0007Cn-7o; Mon, 19 Aug 2024 12:42:08 +0000
Received: by outflank-mailman (input) for mailman id 779656;
 Mon, 19 Aug 2024 12:42:07 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lvcB=PS=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sg1i3-0007Ch-7C
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 12:42:07 +0000
Received: from mail-oo1-xc36.google.com (mail-oo1-xc36.google.com
 [2607:f8b0:4864:20::c36])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 701ef715-5e28-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 14:42:05 +0200 (CEST)
Received: by mail-oo1-xc36.google.com with SMTP id
 006d021491bc7-5daa683b298so1556931eaf.0
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 05:42:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 701ef715-5e28-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724071324; x=1724676124; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=p+tVf2xNy46et3wHL5+BrHtoU+KgaWimtz25H6SKN7Y=;
        b=PVIQO3qDITeYSEgRR5hTMiksmxuiEA2G+9mda1uYRRlAYmxg7Ib8yFTZa2LK3ze8QH
         fz0ACqq50+bAUK49R43/74ix/go1vMUYYhhqydgNtKJb/XNhFIQhGEs40Equ1XIY4Xp8
         6zwSBBEztoxmgpJA+zofxfe5uP4vla5FiDOSk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724071324; x=1724676124;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=p+tVf2xNy46et3wHL5+BrHtoU+KgaWimtz25H6SKN7Y=;
        b=EG/bx1SJPWte1gXTKJodxkxE8RyUdj4UDXRWtvDaOnjAKaG0NqWGE/hRTHpnuat2Ff
         SqFJ1fzvzZa2/+CxOWQEUNugcmjcb1tJUpIr0X1U8xLtMwBf1FmBC3EZEkR4Ur7+3i8D
         CLZ5ccgrGN5PmoKAJ+x/QlJuO7KclcZrQWnBozDgUiZDFutOBcfJm7as6/cueGwjoqPe
         iiRNTdy5ZckzYOnC/AvjKWb6ELFOSTw300EFsW8Odtoil/E41atdFFVJHX9YExR+BFI1
         skPvMJlkZNKm13VgITRJYzyPwB+J5f1JsRkt88HLqpYHnutpSxWQryxIeAOZdBRuuq1l
         Mlvg==
X-Forwarded-Encrypted: i=1; AJvYcCWKrOVYFwmaE47Z3rSP+rNEWS6bKl7h9HEHSG+wpbJdO6Hmky/4bdbDNnp06d3A3i9GVo1+NTC9imlfEN/v5ERm0Sc1cXQsWJztT8g12G0=
X-Gm-Message-State: AOJu0YxPJsRhxTBbFckfsqQqqhyXBshJg17Z5jYeRAyj3qiV3tZG41XR
	WioRPSqNcwL3lc+q2FrdLBzJ+eSZqDIIo9tSog6gBDjiULw6UZHKk3+f8vdG9mzxrCcM3nKX38z
	Z6Bc9TamdQdUplXcQzAj0/i65yKFGur9lRf6HOQ==
X-Google-Smtp-Source: AGHT+IEJkhikn9bllTx1OHSe2+paqM+zmUfKdra8px2l9L7rEGliKfaFj2k2yTEmgbbkzYXHgzatlitAZrTie4s+iA4=
X-Received: by 2002:a05:6820:168a:b0:5c6:9320:53a3 with SMTP id
 006d021491bc7-5da9800e818mr11887488eaf.4.1724071323721; Mon, 19 Aug 2024
 05:42:03 -0700 (PDT)
MIME-Version: 1.0
References: <20240819110729.205707-1-frediano.ziglio@cloud.com> <271cf485-c03a-4592-a1fb-d6d201fbe74b@suse.com>
In-Reply-To: <271cf485-c03a-4592-a1fb-d6d201fbe74b@suse.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Mon, 19 Aug 2024 13:41:52 +0100
Message-ID: <CACHz=ZiyjvFhTseesKYVhjc5nYx1c6O_BCiYqoC3BBmuOgkFFA@mail.gmail.com>
Subject: Re: [PATCH] Avoid crash calling PrintErrMesg from efi_multiboot2
To: Jan Beulich <jbeulich@suse.com>
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>, 
	=?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 19, 2024 at 12:35=E2=80=AFPM Jan Beulich <jbeulich@suse.com> wr=
ote:
>
> On 19.08.2024 13:07, Frediano Ziglio wrote:
> > --- a/xen/common/efi/boot.c
> > +++ b/xen/common/efi/boot.c
> > @@ -287,19 +287,36 @@ static bool __init match_guid(const EFI_GUID *gui=
d1, const EFI_GUID *guid2)
> >  /* generic routine for printing error messages */
> >  static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode=
)
> >  {
> > -    static const CHAR16* const ErrCodeToStr[] __initconstrel =3D {
> > -        [~EFI_ERROR_MASK & EFI_NOT_FOUND]           =3D L"Not found",
> > -        [~EFI_ERROR_MASK & EFI_NO_MEDIA]            =3D L"The device h=
as no media",
> > -        [~EFI_ERROR_MASK & EFI_MEDIA_CHANGED]       =3D L"Media change=
d",
> > -        [~EFI_ERROR_MASK & EFI_DEVICE_ERROR]        =3D L"Device error=
",
> > -        [~EFI_ERROR_MASK & EFI_VOLUME_CORRUPTED]    =3D L"Volume corru=
pted",
> > -        [~EFI_ERROR_MASK & EFI_ACCESS_DENIED]       =3D L"Access denie=
d",
> > -        [~EFI_ERROR_MASK & EFI_OUT_OF_RESOURCES]    =3D L"Out of resou=
rces",
> > -        [~EFI_ERROR_MASK & EFI_VOLUME_FULL]         =3D L"Volume is fu=
ll",
> > -        [~EFI_ERROR_MASK & EFI_SECURITY_VIOLATION]  =3D L"Security vio=
lation",
> > -        [~EFI_ERROR_MASK & EFI_CRC_ERROR]           =3D L"CRC error",
> > -        [~EFI_ERROR_MASK & EFI_COMPROMISED_DATA]    =3D L"Compromised =
data",
> > -        [~EFI_ERROR_MASK & EFI_BUFFER_TOO_SMALL]    =3D L"Buffer too s=
mall",
> > +#define ERROR_MESSAGE_LIST \
> > +    ERROR_MESSAGE(EFI_NOT_FOUND, "Not found") \
> > +    ERROR_MESSAGE(EFI_NO_MEDIA, "The device has no media") \
> > +    ERROR_MESSAGE(EFI_MEDIA_CHANGED, "Media changed") \
> > +    ERROR_MESSAGE(EFI_DEVICE_ERROR, "Device error") \
> > +    ERROR_MESSAGE(EFI_VOLUME_CORRUPTED, "Volume corrupted") \
> > +    ERROR_MESSAGE(EFI_ACCESS_DENIED, "Access denied") \
> > +    ERROR_MESSAGE(EFI_OUT_OF_RESOURCES, "Out of resources") \
> > +    ERROR_MESSAGE(EFI_VOLUME_FULL, "Volume is full") \
> > +    ERROR_MESSAGE(EFI_SECURITY_VIOLATION, "Security violation") \
> > +    ERROR_MESSAGE(EFI_CRC_ERROR, "CRC error") \
> > +    ERROR_MESSAGE(EFI_COMPROMISED_DATA, "Compromised data") \
> > +    ERROR_MESSAGE(EFI_BUFFER_TOO_SMALL, "Buffer too small")
> > +
> > +    static const struct ErrorStrings {
>
> __initconst?
>

It's below, attached to the variable, it cannot be attached to a
structure declaration.

> > +        CHAR16 start;
> > +#undef ERROR_MESSAGE
> > +#define ERROR_MESSAGE(code, str) CHAR16 msg_ ## code[sizeof(str)];
> > +        ERROR_MESSAGE_LIST
> > +    } ErrorStrings __initconst =3D {

Here it is.

> > +        0
> > +#undef ERROR_MESSAGE
> > +#define ERROR_MESSAGE(code, str) , L ## str
> > +        ERROR_MESSAGE_LIST
> > +    };
> > +    static const uint16_t ErrCodeToStr[] __initconst =3D {
> > +#undef ERROR_MESSAGE
> > +#define ERROR_MESSAGE(code, str) \
> > +        [~EFI_ERROR_MASK & code] =3D offsetof(struct ErrorStrings, msg=
_ ## code),
> > +        ERROR_MESSAGE_LIST
> >      };
> >      EFI_STATUS ErrIdx =3D ErrCode & ~EFI_ERROR_MASK;
> >
> > @@ -308,7 +325,7 @@ static void __init PrintErrMesg(const CHAR16 *mesg,=
 EFI_STATUS ErrCode)
> >      PrintErr(L": ");
> >
> >      if( (ErrIdx < ARRAY_SIZE(ErrCodeToStr)) && ErrCodeToStr[ErrIdx] )
> > -        mesg =3D ErrCodeToStr[ErrIdx];
> > +        mesg =3D (CHAR16*) ((char*) &ErrorStrings + ErrCodeToStr[ErrId=
x]);
>
> Please never cast away const. Also (nit) please put the blanks at the rig=
ht
> places. Finally instead of casting to char * (something string-like)
> intermediately, perhaps better cast to void *? Taken together
>
>         mesg =3D (const CHAR16 *)((const void *)&ErrorStrings + ErrCodeTo=
Str[ErrIdx]);
>

Done, less portable but it's not portable code.

> (which looks like it'll then also need line-wrapping).
>
> Further please add an appropriate Fixes: tag.
>

Done

> Jan

Frediano


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 12:46:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 12:46:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779664.1189370 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1mD-0007vV-Qx; Mon, 19 Aug 2024 12:46:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779664.1189370; Mon, 19 Aug 2024 12:46:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1mD-0007vO-O2; Mon, 19 Aug 2024 12:46:25 +0000
Received: by outflank-mailman (input) for mailman id 779664;
 Mon, 19 Aug 2024 12:46:24 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sg1mC-0007vI-93
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 12:46:24 +0000
Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com
 [2a00:1450:4864:20::52f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 09c73d59-5e29-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 14:46:22 +0200 (CEST)
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5bed72ff443so3088305a12.1
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 05:46:22 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bebc081afbsm5496258a12.94.2024.08.19.05.46.21
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 05:46:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 09c73d59-5e29-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724071582; x=1724676382; 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=t+hIBbUaZseNvk9sZpDgJCsqGb4kdpZ3CHU8yep+ly4=;
        b=RXDfqL4D9w5r3LbRvyZtaeR5JGkejBmcZdwd/lDNs6R/0BZ1LFPe/zLu39Uw7o4/7K
         epxmkVOrRwlmN7V+gKe99sc2OYyur1Yo7SyJRpAlb17rm2xlB4WKeTM8I9b5Ig374zfm
         0odr8G+QRxxcM+sK41GDc6mpAsE8TMYEIb+10Zktusc6s2pAtHSzkJtgAbo6FmU9zEEa
         7uKS7pD/+3O8SdZE7QWVZRjlW4H9r1N7z3Yrx28ChY/+KMbvZjEbSopJTuuSiG4mE98R
         GD/9pt4GaK1qSExqOqxXjkrqH0JFFmBF0d73Sv5aUeMirqqXQND4x5vg4XQsUR0dnZ4O
         UNDA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724071582; x=1724676382;
        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=t+hIBbUaZseNvk9sZpDgJCsqGb4kdpZ3CHU8yep+ly4=;
        b=MAnfGYZjTMWXTMNN+dDShlbHqhsSvcYcKv4FGerK6D8u7ikiGeSl57XaJP79+3HSVX
         SspZp7tJ0eMnP8ApDbXO7mwx+gix5HMB8YrEXj+1t+lUFnohbewnj8TK24wZXR73b4YJ
         7fa/MUOVUp+oE2knlQqtpJjLTiwCggxxBQFEswbXSupGYsbsB7qLfgSzXgDaydaer48o
         HS7ujWABCVW0a12tOS2ukF3EIrki6RPR1WOJ+TlqM99hdRIINECl9Cn0Lw9wZG56kJ1o
         E+Cbi5THPo4eqZCxAutMCTODtNkXPI5FPinKzp/oeKTygLqnpvxU5S4reWRdORR60PS1
         gokQ==
X-Forwarded-Encrypted: i=1; AJvYcCUrz37t/FcpCbKZ2m8zNNjmaFnRzM93MkzzlsbzYWG/pwnPIua64Q1h4j/WbF3r/lMyjnK0IvcsMbttTiYkPkLAofxPp3jK1GbqNoY0HHQ=
X-Gm-Message-State: AOJu0YzTV5HW9x0pdEp2o4KPRhT8gtDwB2RN+jf2WzzboAC2dVI81jlv
	nBgw6devZwU1634qa+9auP5xiYIkPsFK96zE1EZsZ3bKQmamnUP/izS+pV0qcw==
X-Google-Smtp-Source: AGHT+IE0QSyEGB5XajIdqVhFBJ/6rQEcNRWyyh50SPrGVHVccP1JyFFh2rXKaqLw85Jw4hoL4I0p3A==
X-Received: by 2002:a05:6402:190c:b0:5bf:279:ca09 with SMTP id 4fb4d7f45d1cf-5bf0279ce89mr631071a12.17.1724071581694;
        Mon, 19 Aug 2024 05:46:21 -0700 (PDT)
Message-ID: <5bc2bd73-1698-44d5-ab78-c7b6118709df@suse.com>
Date: Mon, 19 Aug 2024 14:46:20 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] Avoid crash calling PrintErrMesg from efi_multiboot2
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <20240819123508.217444-1-frediano.ziglio@cloud.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: <20240819123508.217444-1-frediano.ziglio@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 19.08.2024 14:35, Frediano Ziglio wrote:
> Although code is compiled with -fpic option data is not position
> independent. This causes data pointer to become invalid if
> code is not relocated properly which is what happens for
> efi_multiboot2 which is called by multiboot entry code.
> 
> Code tested adding
>    PrintErrMesg(L"Test message", EFI_BUFFER_TOO_SMALL);
> in efi_multiboot2 before calling efi_arch_edd (this function
> can potentially call PrintErrMesg).
> 
> Before the patch (XenServer installation on Qemu, xen replaced
> with vanilla xen.gz):
>   Booting `XenServer (Serial)'Booting `XenServer (Serial)'
>   Test message: !!!! X64 Exception Type - 0E(#PF - Page-Fault)  CPU Apic ID - 00000000 !!!!
>   ExceptionData - 0000000000000000  I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX:0
>   RIP  - 000000007DC29E46, CS  - 0000000000000038, RFLAGS - 0000000000210246
>   RAX  - 0000000000000000, RCX - 0000000000000050, RDX - 0000000000000000
>   RBX  - 000000007DAB4558, RSP - 000000007EFA1200, RBP - 0000000000000000
>   RSI  - FFFF82D040467A88, RDI - 0000000000000000
>   R8   - 000000007EFA1238, R9  - 000000007EFA1230, R10 - 0000000000000000
>   R11  - 000000007CF42665, R12 - FFFF82D040467A88, R13 - 000000007EFA1228
>   R14  - 000000007EFA1225, R15 - 000000007DAB45A8
>   DS   - 0000000000000030, ES  - 0000000000000030, FS  - 0000000000000030
>   GS   - 0000000000000030, SS  - 0000000000000030
>   CR0  - 0000000080010033, CR2 - FFFF82D040467A88, CR3 - 000000007EC01000
>   CR4  - 0000000000000668, CR8 - 0000000000000000
>   DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
>   DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
>   GDTR - 000000007E9E2000 0000000000000047, LDTR - 0000000000000000
>   IDTR - 000000007E4E5018 0000000000000FFF,   TR - 0000000000000000
>   FXSAVE_STATE - 000000007EFA0E60
>   !!!! Find image based on IP(0x7DC29E46) (No PDB)  (ImageBase=000000007DC28000, EntryPoint=000000007DC2B917) !!!!
> 
> After the patch:
>   Booting `XenServer (Serial)'Booting `XenServer (Serial)'
>   Test message: Buffer too small
>   BdsDxe: loading Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
>   BdsDxe: starting Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
> 
> Fixes: 00d5d5ce23e6 ("work around Clang generating .data.rel.ro section for init-only files")

I don't think this is right. While this is where the array was introduced,
it was correct at that time afaict. It went wrong when MB2 support was added
about a year later. 9180f5365524 ("x86: add multiboot2 protocol support for
EFI platforms") may be reasonable to blame, albeit I'm not sure that was the
final one, after which MB2 support was considered complete.

> @@ -308,7 +325,7 @@ static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
>      PrintErr(L": ");
>  
>      if( (ErrIdx < ARRAY_SIZE(ErrCodeToStr)) && ErrCodeToStr[ErrIdx] )
> -        mesg = ErrCodeToStr[ErrIdx];
> +        mesg = (const CHAR16 *)((const void *)&ErrorStrings + ErrCodeToStr[ErrIdx]);

As said when suggesting the alternative form in reply to v1: This is now too
long and hence needs wrapping.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 12:54:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 12:54:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779677.1189379 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1to-0001wA-Mk; Mon, 19 Aug 2024 12:54:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779677.1189379; Mon, 19 Aug 2024 12:54:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg1to-0001w3-KA; Mon, 19 Aug 2024 12:54:16 +0000
Received: by outflank-mailman (input) for mailman id 779677;
 Mon, 19 Aug 2024 12:54:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lvcB=PS=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sg1tn-0001vw-Ea
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 12:54:15 +0000
Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com
 [2607:f8b0:4864:20::f2c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 22bcb0ed-5e2a-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 14:54:14 +0200 (CEST)
Received: by mail-qv1-xf2c.google.com with SMTP id
 6a1803df08f44-6bf9ddfc2dcso3785236d6.1
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 05:54:14 -0700 (PDT)
Received: from fziglio-xenia-fedora.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6bf6fec5fdesm42301536d6.99.2024.08.19.05.54.11
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 19 Aug 2024 05:54:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22bcb0ed-5e2a-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724072053; x=1724676853; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=P7/Kd+cvXqdMR5NtH/YCv2IUntSfsIYkr4UaFxzYJVY=;
        b=Shsg8dyXGSnwAHm3Q4JSERSyvcJHzv1SbtrcNnJimwBkAIpDFQBtX38FIPdVSOm/qY
         n6imWSh0uczlWd/tCHaJ8JMbMhWkDH3bIQ1zFzMlqw5/FdPtgQYoOSgcEcL3OESv9pt3
         mctBiciNwlS/7qT4BtjJTeC8d17SDjZOa58O4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724072053; x=1724676853;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=P7/Kd+cvXqdMR5NtH/YCv2IUntSfsIYkr4UaFxzYJVY=;
        b=A5gbWwzcQIlYjntmCznBUgcEY+EDvFFcCK9DnAsTFV1MC2bAXV2HMCQh9pMlK3G+Ac
         EYKtmlv/lmhpnD7l6rmyn/9gMpddVXbrlJoAf9/rDHtq45Z8PzZFji7eeBOxXtrH08Jj
         PS5riaSxp1pLJpWZ4i6A9EE6k1zxugIM7oJ6ufNKXK7NkREJkcdxF3OaCTaR5RDSxBuI
         ZoMHbzLX9Wtc8t2XZ515SIo+r7xMmCWBYQ3AWZjoNi+WpGrFr0w5ZPRPwCUo9VLoW7L/
         y1E9lWZOqB7TYMY0mnPYfbzEjBo4+mYrADtE7Yy90O96fenS/lYkcHxeBm8s/NfPwlYW
         iiow==
X-Gm-Message-State: AOJu0YwMrPuNbZEx3TgSNpFtNQTHslo9vm+gG0gQanUn86IiYvITDoq2
	UCNuD0gJF67Add25fPwnMhIsFsZtyKVcOobFErNQ3f/QEb/1kK++xASGZQhG3KXG9Yzdgef+Gqb
	L
X-Google-Smtp-Source: AGHT+IE28GQb2aRj6rRi3hhG2d0uXzYhFyGpDpxj3nyRFKSL8Pb9s73+hBHH3yAfu9XZxMssTB5kMw==
X-Received: by 2002:a05:6214:5984:b0:6b5:ce93:c3fc with SMTP id 6a1803df08f44-6bf7cd9e505mr137113266d6.18.1724072052832;
        Mon, 19 Aug 2024 05:54:12 -0700 (PDT)
From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v3] Avoid crash calling PrintErrMesg from efi_multiboot2
Date: Mon, 19 Aug 2024 13:54:00 +0100
Message-ID: <20240819125401.218931-1-frediano.ziglio@cloud.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Although code is compiled with -fpic option data is not position
independent. This causes data pointer to become invalid if
code is not relocated properly which is what happens for
efi_multiboot2 which is called by multiboot entry code.

Code tested adding
   PrintErrMesg(L"Test message", EFI_BUFFER_TOO_SMALL);
in efi_multiboot2 before calling efi_arch_edd (this function
can potentially call PrintErrMesg).

Before the patch (XenServer installation on Qemu, xen replaced
with vanilla xen.gz):
  Booting `XenServer (Serial)'Booting `XenServer (Serial)'
  Test message: !!!! X64 Exception Type - 0E(#PF - Page-Fault)  CPU Apic ID - 00000000 !!!!
  ExceptionData - 0000000000000000  I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX:0
  RIP  - 000000007DC29E46, CS  - 0000000000000038, RFLAGS - 0000000000210246
  RAX  - 0000000000000000, RCX - 0000000000000050, RDX - 0000000000000000
  RBX  - 000000007DAB4558, RSP - 000000007EFA1200, RBP - 0000000000000000
  RSI  - FFFF82D040467A88, RDI - 0000000000000000
  R8   - 000000007EFA1238, R9  - 000000007EFA1230, R10 - 0000000000000000
  R11  - 000000007CF42665, R12 - FFFF82D040467A88, R13 - 000000007EFA1228
  R14  - 000000007EFA1225, R15 - 000000007DAB45A8
  DS   - 0000000000000030, ES  - 0000000000000030, FS  - 0000000000000030
  GS   - 0000000000000030, SS  - 0000000000000030
  CR0  - 0000000080010033, CR2 - FFFF82D040467A88, CR3 - 000000007EC01000
  CR4  - 0000000000000668, CR8 - 0000000000000000
  DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
  DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
  GDTR - 000000007E9E2000 0000000000000047, LDTR - 0000000000000000
  IDTR - 000000007E4E5018 0000000000000FFF,   TR - 0000000000000000
  FXSAVE_STATE - 000000007EFA0E60
  !!!! Find image based on IP(0x7DC29E46) (No PDB)  (ImageBase=000000007DC28000, EntryPoint=000000007DC2B917) !!!!

After the patch:
  Booting `XenServer (Serial)'Booting `XenServer (Serial)'
  Test message: Buffer too small
  BdsDxe: loading Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
  BdsDxe: starting Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)

Fixes: 00d5d5ce23e6 ("work around Clang generating .data.rel.ro section for init-only files")
Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/common/efi/boot.c | 46 ++++++++++++++++++++++++++++++-------------
 1 file changed, 32 insertions(+), 14 deletions(-)
---
Changes since v1:
- added "Fixes:" tag;
- fixed cast style change.

Changes since v2:
- wrap long line.

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index efbec00af9..fdbe75005c 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -287,19 +287,36 @@ static bool __init match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2)
 /* generic routine for printing error messages */
 static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
 {
-    static const CHAR16* const ErrCodeToStr[] __initconstrel = {
-        [~EFI_ERROR_MASK & EFI_NOT_FOUND]           = L"Not found",
-        [~EFI_ERROR_MASK & EFI_NO_MEDIA]            = L"The device has no media",
-        [~EFI_ERROR_MASK & EFI_MEDIA_CHANGED]       = L"Media changed",
-        [~EFI_ERROR_MASK & EFI_DEVICE_ERROR]        = L"Device error",
-        [~EFI_ERROR_MASK & EFI_VOLUME_CORRUPTED]    = L"Volume corrupted",
-        [~EFI_ERROR_MASK & EFI_ACCESS_DENIED]       = L"Access denied",
-        [~EFI_ERROR_MASK & EFI_OUT_OF_RESOURCES]    = L"Out of resources",
-        [~EFI_ERROR_MASK & EFI_VOLUME_FULL]         = L"Volume is full",
-        [~EFI_ERROR_MASK & EFI_SECURITY_VIOLATION]  = L"Security violation",
-        [~EFI_ERROR_MASK & EFI_CRC_ERROR]           = L"CRC error",
-        [~EFI_ERROR_MASK & EFI_COMPROMISED_DATA]    = L"Compromised data",
-        [~EFI_ERROR_MASK & EFI_BUFFER_TOO_SMALL]    = L"Buffer too small",
+#define ERROR_MESSAGE_LIST \
+    ERROR_MESSAGE(EFI_NOT_FOUND, "Not found") \
+    ERROR_MESSAGE(EFI_NO_MEDIA, "The device has no media") \
+    ERROR_MESSAGE(EFI_MEDIA_CHANGED, "Media changed") \
+    ERROR_MESSAGE(EFI_DEVICE_ERROR, "Device error") \
+    ERROR_MESSAGE(EFI_VOLUME_CORRUPTED, "Volume corrupted") \
+    ERROR_MESSAGE(EFI_ACCESS_DENIED, "Access denied") \
+    ERROR_MESSAGE(EFI_OUT_OF_RESOURCES, "Out of resources") \
+    ERROR_MESSAGE(EFI_VOLUME_FULL, "Volume is full") \
+    ERROR_MESSAGE(EFI_SECURITY_VIOLATION, "Security violation") \
+    ERROR_MESSAGE(EFI_CRC_ERROR, "CRC error") \
+    ERROR_MESSAGE(EFI_COMPROMISED_DATA, "Compromised data") \
+    ERROR_MESSAGE(EFI_BUFFER_TOO_SMALL, "Buffer too small")
+
+    static const struct ErrorStrings {
+        CHAR16 start;
+#undef ERROR_MESSAGE
+#define ERROR_MESSAGE(code, str) CHAR16 msg_ ## code[sizeof(str)];
+        ERROR_MESSAGE_LIST
+    } ErrorStrings __initconst = {
+        0
+#undef ERROR_MESSAGE
+#define ERROR_MESSAGE(code, str) , L ## str
+        ERROR_MESSAGE_LIST
+    };
+    static const uint16_t ErrCodeToStr[] __initconst = {
+#undef ERROR_MESSAGE
+#define ERROR_MESSAGE(code, str) \
+        [~EFI_ERROR_MASK & code] = offsetof(struct ErrorStrings, msg_ ## code),
+        ERROR_MESSAGE_LIST
     };
     EFI_STATUS ErrIdx = ErrCode & ~EFI_ERROR_MASK;
 
@@ -308,7 +325,8 @@ static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
     PrintErr(L": ");
 
     if( (ErrIdx < ARRAY_SIZE(ErrCodeToStr)) && ErrCodeToStr[ErrIdx] )
-        mesg = ErrCodeToStr[ErrIdx];
+        mesg = (const CHAR16 *)((const void *)&ErrorStrings +
+                                ErrCodeToStr[ErrIdx]);
     else
     {
         PrintErr(L"ErrCode: ");
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 19 13:01:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 13:01:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779687.1189389 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg20X-0004Q5-Bk; Mon, 19 Aug 2024 13:01:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779687.1189389; Mon, 19 Aug 2024 13:01:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg20X-0004Py-9E; Mon, 19 Aug 2024 13:01:13 +0000
Received: by outflank-mailman (input) for mailman id 779687;
 Mon, 19 Aug 2024 13:01:11 +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 1sg20V-0004Ps-P1
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 13:01:11 +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 1sg20U-0003zy-Tf; Mon, 19 Aug 2024 13:01:10 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sg20U-0000sl-LW; Mon, 19 Aug 2024 13:01:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=+VnDYPZKkClqT/JA0a96f1/HE3BvvyWWvPwWbAcoIu8=; b=tfBAZKyOYHmjHeoyO3+EzMueJ9
	TP5aUnGqYJKKBapinx2o7zftROP2UVON5A1us0/gGzuDBoUj6KP8TTYswTTdrEL/JvZneKZmITn+X
	wJS5Dk5rMk01i/vAkOW1PnB2gnDSbu+bjcpJRJDpoiTc2QJvz6uv9Yf7+4YiQpX1XqlA=;
Message-ID: <d0adc2ad-9cfe-4270-bf77-61d0650effb6@xen.org>
Date: Mon, 19 Aug 2024 14:01:08 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
Content-Language: en-GB
To: Jan Beulich <jbeulich@suse.com>, Ayan Kumar Halder <ayankuma@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
 <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
 <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
 <dad27ab7-3cbd-4a8e-8200-adea52b26e55@suse.com>
 <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
 <9fd1801c-1460-44e5-b066-f6da1167543b@xen.org>
 <1a328f00-3b0d-4e9c-856c-97c3a80dfdef@amd.com>
 <ff48fff8-a659-4e63-8e1f-2385a936ad61@suse.com>
 <826532b8-1618-4246-aefb-d5315b877d6b@xen.org>
 <759d5d83-b09c-4853-8ec0-63a19faf8af5@suse.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <759d5d83-b09c-4853-8ec0-63a19faf8af5@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Jan,

On 19/08/2024 13:24, Jan Beulich wrote:
> On 19.08.2024 14:12, Julien Grall wrote:
>> On 19/08/2024 12:39, Jan Beulich wrote:
>>> Guys,
>>>
>>> On 19.08.2024 11:45, Ayan Kumar Halder wrote:
>>>> On 16/08/2024 17:40, Julien Grall wrote:
>>>>> On 14/08/2024 13:33, Ayan Kumar Halder wrote:
>>>
>>> mind me asking why I continue to be on the To: list of this communication
>>> between the two of you?
>>
>> You were involved in the review and AFAICT will still touch the common
>> code. I am happy to remove you from the conversation if you are not
>> interested :).
> 
> That wasn't my request though. It's fine to keep me Cc-ed.

TBH, in this context, the difference between CC and TO is very blur.

For me, CC is for people that may be interested but not involved in the 
conversation. In this case, Ayan was suggesting whether we should use 
ARCH_VMAP or not.

Given you reviewed the rest, I feel you have your say on this decision. 
Hence why the TO makes sense. But I also understand why people may view 
it differently...

Personally, I don't make any filter on "cc" vs "to" because this is a 
matter of opinion whether you think someone should be actively involved 
(or not) in the discussion. So it is best if I look at everything even 
if this is just having a glancing look at on the content.

If you have some clear and unambiguous rules on when you want to be in 
the CC or TO, then I would be happy to follow them.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Mon Aug 19 13:13:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 13:13:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779698.1189400 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg2Bz-0006pE-CM; Mon, 19 Aug 2024 13:13:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779698.1189400; Mon, 19 Aug 2024 13:13:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg2Bz-0006p7-99; Mon, 19 Aug 2024 13:13:03 +0000
Received: by outflank-mailman (input) for mailman id 779698;
 Mon, 19 Aug 2024 13:13:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sg2Bx-0006ox-MR; Mon, 19 Aug 2024 13:13:01 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sg2Bx-0004Bg-BT; Mon, 19 Aug 2024 13:13:01 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sg2Bw-0004T2-PR; Mon, 19 Aug 2024 13:13:00 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sg2Bw-0004vw-Om; Mon, 19 Aug 2024 13:13:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=DV8LTuYxgWt8CHoncPAG+raRjAca97jSmQ6mkvTdvYY=; b=SK/3j/iznCdd9FwqEyPPYUoCtM
	Y0z6xH5YVZ0gRiC6MVMSuxTw8qI15ePtOTtg8WyovdOID+y4jkz/fThFpftg0a7Ig+Ycn2VQn92B9
	mw3+ZO9RNLgbdqtiH7eYHVZptL04cNHoo5q0epfOWjxrdxYxfJ46sMqtm5l7ZjPRixas=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187279-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187279: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-armhf-armhf-xl-multivcpu:xen-boot:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=47ac09b91befbb6a235ab620c32af719f8208399
X-Osstest-Versions-That:
    linux=c3f2d783a459980eafd24c5af94ccd56a615961f
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 19 Aug 2024 13:13:00 +0000

flight 187279 linux-linus real [real]
flight 187283 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187279/
http://logs.test-lab.xenproject.org/osstest/logs/187283/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-multivcpu  8 xen-boot           fail pass in 187283-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check fail in 187283 never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check fail in 187283 never pass
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187271
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187271
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187271
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187271
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187271
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187271
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                47ac09b91befbb6a235ab620c32af719f8208399
baseline version:
 linux                c3f2d783a459980eafd24c5af94ccd56a615961f

Last test of basis   187271  2024-08-18 10:40:58 Z    1 days
Testing same since   187279  2024-08-18 22:14:41 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Aapo Vienamo <aapo.vienamo@linux.intel.com>
  Alexander Dahl <ada@thorsis.com>
  Bart Van Assche <bvanassche@acm.org>
  David Sterba <dsterba@suse.com>
  Eli Billauer <eli.billauer@gmail.com>
  Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  Griffin Kroah-Hartman <griffin@kroah.com>
  Hans de Goede <hdegoede@redhat.com>
  Heikki Krogerus <heikki.krogerus@linux.intel.com>
  Jann Horn <jannh@google.com>
  Jeff Layton <jlayton@kernel.org>
  Linus Torvalds <torvalds@linux-foundation.org>
  Marc Zyngier <maz@kernel.org>
  Masahiro Yamada <masahiroy@kernel.org>
  Mathias Nyman <mathias.nyman@linux.intel.com>
  Mathieu Othacehe <othacehe@gnu.org>
  Mika Westerberg <mika.westerberg@linux.intel.com>
  Naohiro Aota <naohiro.aota@wdc.com>
  Niklas Neronin <niklas.neronin@linux.intel.com>
  Peng Fan <peng.fan@nxp.com>
  Qu Wenruo <wqu@suse.com>
  Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
  Thorsten Blum <thorsten.blum@toblux.com>
  Xu Yang <xu.yang_2@nxp.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   c3f2d783a4599..47ac09b91befb  47ac09b91befbb6a235ab620c32af719f8208399 -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 13:19:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 13:19:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779711.1189410 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg2IS-0008Js-7H; Mon, 19 Aug 2024 13:19:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779711.1189410; Mon, 19 Aug 2024 13:19:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg2IS-0008Jl-41; Mon, 19 Aug 2024 13:19:44 +0000
Received: by outflank-mailman (input) for mailman id 779711;
 Mon, 19 Aug 2024 13:19:42 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sg2IQ-0008Jf-4N
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 13:19:42 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b0789bb5-5e2d-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 15:19:40 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a8385f38fcdso401167666b.3
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 06:19: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-a83839464d1sm640226866b.173.2024.08.19.06.19.38
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 06:19:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b0789bb5-5e2d-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724073580; x=1724678380; 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=cXf3HcKYavlt8ny05uxT/Q4xIvF4t/X2PVpEonyuAeo=;
        b=TDQaSR/j7eizFzAInmDB7bvh4pqagoC4jBRPysuG3NFX6Uy4wx7Yj1NQTrWxKJf77p
         nGGsJGF0QrhygiWkd3kUzpOQVmeLbo+y9IMbFfe65f17ptHVAhbjv15HdJAaHjwqNLK1
         9pytoynfuH2EUVU5rLBQLgFNO5VjIXCW/KGMdFlzKJ5MuRzI16pqYRYJ+GwNd90fhLxJ
         dDwbYqOaKgPL8tkj760k936SLYkzsuBp6lpCGJtJ7Ijv6BMDjYkk6pYVYe4hUGry0MWs
         78aW9jYuZyhCCbjpEZc51eqss47LpCa0h1Veg1AMgZ3n9k1B8aM7s3MGbELVpztgRvfb
         o8uA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724073580; x=1724678380;
        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=cXf3HcKYavlt8ny05uxT/Q4xIvF4t/X2PVpEonyuAeo=;
        b=evB9gf026pKEp7qs+aTwvW1VfhSV+/eGAT7gq3SuXz08/8WOzj6aAMsfJsv5sK27h9
         fG6IiyXNTLch2NJXhEf14fE/0PPT7yEn/+KRe7xemGTRx8anwoxTR3zWF7tNO/mrmi/f
         oaUVqjXYLOblku4pmSM9Io99+dy+N4sOsshgWPvIWXl218SeoM533pM64HCyVol2YRuw
         8U/2J5rImZsWgH9EZw6zaRJiwssL7pMke11doa8Rqq2Uu84VhSJL3z2XAXSTFV5CFYop
         LX9eUm92XUCzVU5RvG991kvHQiwnkpeF9S/UXo98UIMPuW+gPCD2uHckRU99/xb/pYU/
         oFGQ==
X-Forwarded-Encrypted: i=1; AJvYcCW/9qYZEc7wnkuhwtxMWNQ01a1KFWroRlOCMyS/I03zk8RXyHl2sITodRzak5EdCF4AZV3pbf+XwSHmVO6+dNYOFoCHZaZRmvtWTznCo9w=
X-Gm-Message-State: AOJu0YzzrC/UIqgP0VkY8eeH6CAHPk3l+r6sBmwX4GMfvK5nmn79AQiL
	ofWRPq30XkobUN+6F4+vLi0Y18YkixPRIh6qZ3hF5jF3dPqeQDX/r02vvMvjrg==
X-Google-Smtp-Source: AGHT+IF2KZFQdRXYacJp729VuZw2RW9qwVdWmHZE7aKZhzQKnHVphb7xdItgSq0eI/NT0rWa3fx6CQ==
X-Received: by 2002:a17:906:d54e:b0:a77:aa6d:e0c7 with SMTP id a640c23a62f3a-a839293e973mr830396566b.30.1724073579475;
        Mon, 19 Aug 2024 06:19:39 -0700 (PDT)
Message-ID: <edbf5a9d-2a13-4755-80f4-5bab93cb8053@suse.com>
Date: Mon, 19 Aug 2024 15:19:38 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] Avoid crash calling PrintErrMesg from efi_multiboot2
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <20240819125401.218931-1-frediano.ziglio@cloud.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: <20240819125401.218931-1-frediano.ziglio@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 19.08.2024 14:54, Frediano Ziglio wrote:
> Although code is compiled with -fpic option data is not position
> independent. This causes data pointer to become invalid if
> code is not relocated properly which is what happens for
> efi_multiboot2 which is called by multiboot entry code.
> 
> Code tested adding
>    PrintErrMesg(L"Test message", EFI_BUFFER_TOO_SMALL);
> in efi_multiboot2 before calling efi_arch_edd (this function
> can potentially call PrintErrMesg).
> 
> Before the patch (XenServer installation on Qemu, xen replaced
> with vanilla xen.gz):
>   Booting `XenServer (Serial)'Booting `XenServer (Serial)'
>   Test message: !!!! X64 Exception Type - 0E(#PF - Page-Fault)  CPU Apic ID - 00000000 !!!!
>   ExceptionData - 0000000000000000  I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX:0
>   RIP  - 000000007DC29E46, CS  - 0000000000000038, RFLAGS - 0000000000210246
>   RAX  - 0000000000000000, RCX - 0000000000000050, RDX - 0000000000000000
>   RBX  - 000000007DAB4558, RSP - 000000007EFA1200, RBP - 0000000000000000
>   RSI  - FFFF82D040467A88, RDI - 0000000000000000
>   R8   - 000000007EFA1238, R9  - 000000007EFA1230, R10 - 0000000000000000
>   R11  - 000000007CF42665, R12 - FFFF82D040467A88, R13 - 000000007EFA1228
>   R14  - 000000007EFA1225, R15 - 000000007DAB45A8
>   DS   - 0000000000000030, ES  - 0000000000000030, FS  - 0000000000000030
>   GS   - 0000000000000030, SS  - 0000000000000030
>   CR0  - 0000000080010033, CR2 - FFFF82D040467A88, CR3 - 000000007EC01000
>   CR4  - 0000000000000668, CR8 - 0000000000000000
>   DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
>   DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
>   GDTR - 000000007E9E2000 0000000000000047, LDTR - 0000000000000000
>   IDTR - 000000007E4E5018 0000000000000FFF,   TR - 0000000000000000
>   FXSAVE_STATE - 000000007EFA0E60
>   !!!! Find image based on IP(0x7DC29E46) (No PDB)  (ImageBase=000000007DC28000, EntryPoint=000000007DC2B917) !!!!
> 
> After the patch:
>   Booting `XenServer (Serial)'Booting `XenServer (Serial)'
>   Test message: Buffer too small
>   BdsDxe: loading Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
>   BdsDxe: starting Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
> 
> Fixes: 00d5d5ce23e6 ("work around Clang generating .data.rel.ro section for init-only files")
> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
> ---
>  xen/common/efi/boot.c | 46 ++++++++++++++++++++++++++++++-------------
>  1 file changed, 32 insertions(+), 14 deletions(-)
> ---
> Changes since v1:
> - added "Fixes:" tag;
> - fixed cast style change.
> 
> Changes since v2:
> - wrap long line.

And what about the Fixes: tag?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 14:03:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 14:03:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779741.1189423 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg2yQ-0008LS-EZ; Mon, 19 Aug 2024 14:03:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779741.1189423; Mon, 19 Aug 2024 14:03:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg2yQ-0008LL-C3; Mon, 19 Aug 2024 14:03:06 +0000
Received: by outflank-mailman (input) for mailman id 779741;
 Mon, 19 Aug 2024 14:03:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lvcB=PS=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sg2yO-0008LF-QN
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 14:03:04 +0000
Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com
 [2607:f8b0:4864:20::32a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c00410c4-5e33-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 16:03:03 +0200 (CEST)
Received: by mail-ot1-x32a.google.com with SMTP id
 46e09a7af769-70936061d0dso2615247a34.2
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 07:03:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c00410c4-5e33-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724076182; x=1724680982; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=xmL9c/tA2yFVZRXgvEnGZGSU39/eiuu8BuU16309P4Q=;
        b=ldkXBzDC1OVyrB51J4l9krnTyueEzUGymS9J1X4FUdn45454QCX38o7T5MhisaZRW1
         rheKtmXbraTJhdMxAS9j1AyfaciXM/BMqVHMcT8nV9idOeKiC+IyniNGgLNCXnSr/Obe
         YrXo54BZTqFDA+LpNn6SKwhHPvNibXUdXa19g=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724076182; x=1724680982;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=xmL9c/tA2yFVZRXgvEnGZGSU39/eiuu8BuU16309P4Q=;
        b=b6XRYrOoYRSJgwHAZgN1sz83aUZ7uyW8gH8ArMgQqCZR2Y6i8J+D7lwiqc9zMtp2E9
         1o+FybVsUMJT3PDSo8IaaMvcalghRhajqVwaJpR971UqZPbV0gtVRPW9u3WXEcTOtjp5
         FvHgClikWR+6bJIp5KU1d7ELzcVNwBW5SAuyrck8FK1N64MUIKTv1YRorFLiJdXwCxES
         isyW0aFdttNHZft4P+7xCje5RXIUo0RCzhvfAnAo88B7wDytUomK4759O0k8Rb1Y971J
         WBiwQrboy5GCWky2gX0SPxiQC0qhvzhaq5zrate681cEdFqXBkuXz1ibzzkXfJfg/CnF
         D2CQ==
X-Forwarded-Encrypted: i=1; AJvYcCVmbDmWQf6+Jy3NLTri/9nX0WtxLMXd5CKH+m9TX1IhtRF21YP73gA1d8qCG61tJ9RbzD4GQvfWGWkf3Y/HyTH9yqdWTHZSFaWOgcKVv38=
X-Gm-Message-State: AOJu0YxReHi0BrK9Xz0d5PVnVpPe0x824IXAbs6tIZCDmpk5h4YlccRz
	LBtdhozj5cO9ouazAwNTTyM+J1TNTeSlXcz04OR3dWjwb1KHACp4E1jlg6cpOZJqweuU+gLid0G
	srBzp1V4NYPd3FDMGOLrm59t2E5XEKkKcWBtzsw==
X-Google-Smtp-Source: AGHT+IGajrxX6u4cBtC5EitLWeogD9yGyIl5HZxEDAkLezUgE1NNwCrGzexIkZaKR0ot6+pXtCgzjZQfPteBjlI5dp4=
X-Received: by 2002:a05:6830:3708:b0:703:6341:5171 with SMTP id
 46e09a7af769-70cac8567a2mr12734097a34.15.1724076182474; Mon, 19 Aug 2024
 07:03:02 -0700 (PDT)
MIME-Version: 1.0
References: <20240819125401.218931-1-frediano.ziglio@cloud.com> <edbf5a9d-2a13-4755-80f4-5bab93cb8053@suse.com>
In-Reply-To: <edbf5a9d-2a13-4755-80f4-5bab93cb8053@suse.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Mon, 19 Aug 2024 15:02:51 +0100
Message-ID: <CACHz=ZgW4WZkEV6R+2YJbRN8yBNq3rMGgsvHDtaDm4w47=Cwrg@mail.gmail.com>
Subject: Re: [PATCH v3] Avoid crash calling PrintErrMesg from efi_multiboot2
To: Jan Beulich <jbeulich@suse.com>
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>, 
	=?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 19, 2024 at 2:19=E2=80=AFPM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> On 19.08.2024 14:54, Frediano Ziglio wrote:
> > Although code is compiled with -fpic option data is not position
> > independent. This causes data pointer to become invalid if
> > code is not relocated properly which is what happens for
> > efi_multiboot2 which is called by multiboot entry code.
> >
> > Code tested adding
> >    PrintErrMesg(L"Test message", EFI_BUFFER_TOO_SMALL);
> > in efi_multiboot2 before calling efi_arch_edd (this function
> > can potentially call PrintErrMesg).
> >
> > Before the patch (XenServer installation on Qemu, xen replaced
> > with vanilla xen.gz):
> >   Booting `XenServer (Serial)'Booting `XenServer (Serial)'
> >   Test message: !!!! X64 Exception Type - 0E(#PF - Page-Fault)  CPU Api=
c ID - 00000000 !!!!
> >   ExceptionData - 0000000000000000  I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX:0
> >   RIP  - 000000007DC29E46, CS  - 0000000000000038, RFLAGS - 00000000002=
10246
> >   RAX  - 0000000000000000, RCX - 0000000000000050, RDX - 00000000000000=
00
> >   RBX  - 000000007DAB4558, RSP - 000000007EFA1200, RBP - 00000000000000=
00
> >   RSI  - FFFF82D040467A88, RDI - 0000000000000000
> >   R8   - 000000007EFA1238, R9  - 000000007EFA1230, R10 - 00000000000000=
00
> >   R11  - 000000007CF42665, R12 - FFFF82D040467A88, R13 - 000000007EFA12=
28
> >   R14  - 000000007EFA1225, R15 - 000000007DAB45A8
> >   DS   - 0000000000000030, ES  - 0000000000000030, FS  - 00000000000000=
30
> >   GS   - 0000000000000030, SS  - 0000000000000030
> >   CR0  - 0000000080010033, CR2 - FFFF82D040467A88, CR3 - 000000007EC010=
00
> >   CR4  - 0000000000000668, CR8 - 0000000000000000
> >   DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 00000000000000=
00
> >   DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 00000000000004=
00
> >   GDTR - 000000007E9E2000 0000000000000047, LDTR - 0000000000000000
> >   IDTR - 000000007E4E5018 0000000000000FFF,   TR - 0000000000000000
> >   FXSAVE_STATE - 000000007EFA0E60
> >   !!!! Find image based on IP(0x7DC29E46) (No PDB)  (ImageBase=3D000000=
007DC28000, EntryPoint=3D000000007DC2B917) !!!!
> >
> > After the patch:
> >   Booting `XenServer (Serial)'Booting `XenServer (Serial)'
> >   Test message: Buffer too small
> >   BdsDxe: loading Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4=
AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
> >   BdsDxe: starting Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE=
4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
> >
> > Fixes: 00d5d5ce23e6 ("work around Clang generating .data.rel.ro section=
 for init-only files")

^^^^ here ??


> > Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
> > ---
> >  xen/common/efi/boot.c | 46 ++++++++++++++++++++++++++++++-------------
> >  1 file changed, 32 insertions(+), 14 deletions(-)
> > ---
> > Changes since v1:
> > - added "Fixes:" tag;
> > - fixed cast style change.
> >
> > Changes since v2:
> > - wrap long line.
>
> And what about the Fixes: tag?
>
> Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 14:14:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 14:14:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779753.1189433 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg393-00028H-Au; Mon, 19 Aug 2024 14:14:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779753.1189433; Mon, 19 Aug 2024 14:14:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg393-00028A-8L; Mon, 19 Aug 2024 14:14:05 +0000
Received: by outflank-mailman (input) for mailman id 779753;
 Mon, 19 Aug 2024 14:14:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sg392-000284-7c
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 14:14:04 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 49086bd6-5e35-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 16:14:02 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-5320d8155b4so5779679e87.3
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 07:14:02 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383947250sm637669366b.165.2024.08.19.07.14.00
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 07:14:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 49086bd6-5e35-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724076842; x=1724681642; 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=T3ZT7IYQxRPbhL8Mtd2n6SMWVP6spakyaqT9Uci1Mms=;
        b=JjbQeJz7n3hRBRNmazjwM43WzI9H2lp5vcHULOZxLnZ5RIsUHDNeNxw02ZWJu3R/6E
         5FXqZ7ruqqVKwoYcgc4jjTqCv2dOAkq3BAuzWJr6x2IeelO9zqnGmaIwdDsrmZBg6IUi
         w95yJ9l8E0M7USzjSrq5SfjT2zqqQjhFUHEwNs7Lu9u/LD6x4HGg0QE0/4AFQhB0QOrz
         wYwUevRZNMA/g0wnMnJ/5SP7YuoGkk886v4N5Ho10UlMyI+sFpQqdPEBQ78/ozf5NOkU
         dJk48GjM8+FWEMV8DUmJ2p+S2mUU1Oqm/9L6RBZCFj2VWL05w7p/JK4elbo18fKDOPet
         9yOw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724076842; x=1724681642;
        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=T3ZT7IYQxRPbhL8Mtd2n6SMWVP6spakyaqT9Uci1Mms=;
        b=i/V7065lJvbaPyTtzveCoX5ETvJsnO19LiLsa1Ya9xM4rkX8Yq1rKa/FfEp8QdSEgC
         JLIMqoV7eP+pOjwrPdar9CvAMuJ9U7RB2SwWLxfnh5UIYIIhq+xmhpqpuHLTuJ+81vWT
         bmhk/RIu3NLz8w45tgotAm7cFBYFE1Euf30jTim3PAIGHITEePBGr+e5e08qT3wFB1U1
         HOmRHaqTcLdeQqsXiHXqMKyiZ3RUOZ8sh/3zGVOmHH9feaM5OIqnBlwR6LBWoztBxAeW
         FlDAxF4Jry/DUN/kgu8WdrSY+jyeRdhNLqtBnVLdxV6FLb67AOMHc5a5CKHg+CCQ55Wh
         uyUw==
X-Forwarded-Encrypted: i=1; AJvYcCXkJsSuMiYWBju0vMQfYrlxNip/1Z/hFmNPCEfXbOAdEK9n+f6k+pl1oKbdXh19RuAdH9lnSrFM3I+iKQfVtZ4MHjOGsuY5LefcWknmNzg=
X-Gm-Message-State: AOJu0YxQ0Q4JIum5BXEveEYb6dRDojrXfx35ifgs2q5sQqGAx6Lg0+z1
	kSYrZoGpi/bKIl+uDf3kciQJZveN6v7vw0HLWmpOKYq4z55QRogdB52jnYKzTaBWPLynmFTvibg
	=
X-Google-Smtp-Source: AGHT+IGQlO/OZbpEdBGGjMqGyPcmWnbvalL2kKgQaQX3Tgitdyc1ex6/F+kf6Bl1N+9KObA98lbkmA==
X-Received: by 2002:a05:6512:4025:b0:52e:f950:31e9 with SMTP id 2adb3069b0e04-5331c68ffa7mr7171654e87.4.1724076841467;
        Mon, 19 Aug 2024 07:14:01 -0700 (PDT)
Message-ID: <e2e609a8-b27c-4f6d-a7b4-f9d74b69befd@suse.com>
Date: Mon, 19 Aug 2024 16:14:00 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] Avoid crash calling PrintErrMesg from efi_multiboot2
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <20240819125401.218931-1-frediano.ziglio@cloud.com>
 <edbf5a9d-2a13-4755-80f4-5bab93cb8053@suse.com>
 <CACHz=ZgW4WZkEV6R+2YJbRN8yBNq3rMGgsvHDtaDm4w47=Cwrg@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: <CACHz=ZgW4WZkEV6R+2YJbRN8yBNq3rMGgsvHDtaDm4w47=Cwrg@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 19.08.2024 16:02, Frediano Ziglio wrote:
> On Mon, Aug 19, 2024 at 2:19 PM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 19.08.2024 14:54, Frediano Ziglio wrote:
>>> Although code is compiled with -fpic option data is not position
>>> independent. This causes data pointer to become invalid if
>>> code is not relocated properly which is what happens for
>>> efi_multiboot2 which is called by multiboot entry code.
>>>
>>> Code tested adding
>>>    PrintErrMesg(L"Test message", EFI_BUFFER_TOO_SMALL);
>>> in efi_multiboot2 before calling efi_arch_edd (this function
>>> can potentially call PrintErrMesg).
>>>
>>> Before the patch (XenServer installation on Qemu, xen replaced
>>> with vanilla xen.gz):
>>>   Booting `XenServer (Serial)'Booting `XenServer (Serial)'
>>>   Test message: !!!! X64 Exception Type - 0E(#PF - Page-Fault)  CPU Apic ID - 00000000 !!!!
>>>   ExceptionData - 0000000000000000  I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX:0
>>>   RIP  - 000000007DC29E46, CS  - 0000000000000038, RFLAGS - 0000000000210246
>>>   RAX  - 0000000000000000, RCX - 0000000000000050, RDX - 0000000000000000
>>>   RBX  - 000000007DAB4558, RSP - 000000007EFA1200, RBP - 0000000000000000
>>>   RSI  - FFFF82D040467A88, RDI - 0000000000000000
>>>   R8   - 000000007EFA1238, R9  - 000000007EFA1230, R10 - 0000000000000000
>>>   R11  - 000000007CF42665, R12 - FFFF82D040467A88, R13 - 000000007EFA1228
>>>   R14  - 000000007EFA1225, R15 - 000000007DAB45A8
>>>   DS   - 0000000000000030, ES  - 0000000000000030, FS  - 0000000000000030
>>>   GS   - 0000000000000030, SS  - 0000000000000030
>>>   CR0  - 0000000080010033, CR2 - FFFF82D040467A88, CR3 - 000000007EC01000
>>>   CR4  - 0000000000000668, CR8 - 0000000000000000
>>>   DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
>>>   DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
>>>   GDTR - 000000007E9E2000 0000000000000047, LDTR - 0000000000000000
>>>   IDTR - 000000007E4E5018 0000000000000FFF,   TR - 0000000000000000
>>>   FXSAVE_STATE - 000000007EFA0E60
>>>   !!!! Find image based on IP(0x7DC29E46) (No PDB)  (ImageBase=000000007DC28000, EntryPoint=000000007DC2B917) !!!!
>>>
>>> After the patch:
>>>   Booting `XenServer (Serial)'Booting `XenServer (Serial)'
>>>   Test message: Buffer too small
>>>   BdsDxe: loading Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
>>>   BdsDxe: starting Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
>>>
>>> Fixes: 00d5d5ce23e6 ("work around Clang generating .data.rel.ro section for init-only files")
> 
> ^^^^ here ??

Did you not see ...

>>> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
>>> ---
>>>  xen/common/efi/boot.c | 46 ++++++++++++++++++++++++++++++-------------
>>>  1 file changed, 32 insertions(+), 14 deletions(-)
>>> ---
>>> Changes since v1:
>>> - added "Fixes:" tag;
>>> - fixed cast style change.
>>>
>>> Changes since v2:
>>> - wrap long line.
>>
>> And what about the Fixes: tag?

... my respective v2 comment then? There I said:

"I don't think this is right. While this is where the array was introduced,
 it was correct at that time afaict. It went wrong when MB2 support was added
 about a year later. 9180f5365524 ("x86: add multiboot2 protocol support for
 EFI platforms") may be reasonable to blame, albeit I'm not sure that was the
 final one, after which MB2 support was considered complete."

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 14:16:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 14:16:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779762.1189444 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg3Bq-0003M1-Oj; Mon, 19 Aug 2024 14:16:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779762.1189444; Mon, 19 Aug 2024 14:16:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg3Bq-0003Lu-L4; Mon, 19 Aug 2024 14:16:58 +0000
Received: by outflank-mailman (input) for mailman id 779762;
 Mon, 19 Aug 2024 14:16: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=lvcB=PS=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sg3Bp-0003Ln-0n
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 14:16:57 +0000
Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com
 [2607:f8b0:4864:20::331])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b009c1ae-5e35-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 16:16:56 +0200 (CEST)
Received: by mail-ot1-x331.google.com with SMTP id
 46e09a7af769-7092ea69218so2808259a34.1
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 07:16:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b009c1ae-5e35-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724077015; x=1724681815; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=m/pApi+8umoTH5J9AzCFYX9iYJCXMacYCdoA/1DBtPU=;
        b=fJvCsJcx03Of2vNDh9msF8bl/GeKek0GG45b5Zw0FOf8WPwxto1NzATNLDYgvE9RbW
         K3jdBVNC/+IH8AcApLGUdTRFBfZikyuhHIV8NiopmK3F48yP3UBM0mDCJgNHFUbjDF9t
         5d2ouZVNDYZYxgsFvwgGsT30+3ZHkDGfOnxWk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724077015; x=1724681815;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=m/pApi+8umoTH5J9AzCFYX9iYJCXMacYCdoA/1DBtPU=;
        b=VqdZ1VuNkBqQIMvuboWHGJ3m/8WXuhUT6Pzyi4KCwcRj7aHn0UlwsK3VnbeDchbeQr
         /tMcmckGd3T1b6Xu8TMo6/yMjhbWi8EPiBNUoiAtbiB8oCEY2CQTTNtURNYboDah+4wd
         CRdYQ0f1tKutk5BJxucwSD9nskxGFEs8xUk8Jt9V/PysUEFe96H9b4kF4zN5pr3/Hy9I
         ylp9wmqhJ75f+3GJTaqlZfEuQqak7MSSliFHoWl1zOVuZ/mVOQJ4pLOw+bRQaMtXqgm0
         SsC9wfLR8makrzcKrOwKXdBXxjxRb1CA+z9MKP74NMaIz1TMygJq1kIQFrYV3zQOzrlZ
         0x3w==
X-Forwarded-Encrypted: i=1; AJvYcCUx0Zi2F2hs3xvjF35KFNnjWtGQBzmy/+CC02Hzh5ZtDICKP/TdUc/31FwgQ2gPv4p68LZ8P7M3EpCQ77GTzTd/LXVR/GJg1ffb1oCxBcs=
X-Gm-Message-State: AOJu0YzYFRN7bUR7lTieBWiZpmURSP1cD4aRMAm+BjwioPYCLoEn9Lub
	u5mM0LMVEGP/B9h2BlFoztkbKrAJ7TEC5gKrm6lS7TJqnkwVyzmuuepHb8QxPNYJjZplKFMt33l
	Q5Nn/XXTTRL8RAKLNX4xxgppDqS0VKc1URFA8CQ==
X-Google-Smtp-Source: AGHT+IGdB4/gDPvFnGD7YfeGp2XV5S4ND3UDqIrkFNMKGb7VAAgIHG/dkgfRMLeO1wHU2JBEdlHSSEHq3J7ZL0Ynu3M=
X-Received: by 2002:a05:6870:9619:b0:22a:57da:6fec with SMTP id
 586e51a60fabf-26fff646d06mr6458269fac.16.1724077014595; Mon, 19 Aug 2024
 07:16:54 -0700 (PDT)
MIME-Version: 1.0
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-2-alejandro.vallejo@cloud.com> <ad72cc97-b9dd-4e7e-93f6-333805e40785@suse.com>
 <CACHz=Zh7wK58mbB762fnevHEKW9qhp-NRJ6buNe1b-qLxP0qPg@mail.gmail.com> <b9b40658-ff13-4240-98a2-4811411e31b6@suse.com>
In-Reply-To: <b9b40658-ff13-4240-98a2-4811411e31b6@suse.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Mon, 19 Aug 2024 15:16:43 +0100
Message-ID: <CACHz=Zj8h-TeDa2Ey8EKKEOpXJqx9MnL+AGpdTBY1B8PZ0==mA@mail.gmail.com>
Subject: Re: [PATCH 1/5] x86: Put trampoline in .init.data section
To: Jan Beulich <jbeulich@suse.com>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Xen-devel <xen-devel@lists.xenproject.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Aug 8, 2024 at 9:54=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wrot=
e:
>
> On 08.08.2024 10:00, Frediano Ziglio wrote:
> > On Thu, Aug 8, 2024 at 8:34=E2=80=AFAM Jan Beulich <jbeulich@suse.com> =
wrote:
> >>
> >> On 07.08.2024 15:48, Alejandro Vallejo wrote:
> >>> This change allows to put the trampoline in a separate, not executabl=
e
> >>> section. The trampoline contains a mix of code and data (data which
> >>> is modified from C code during early start so must be writable).
> >>> This is in preparation for W^X patch in order to satisfy UEFI CA
> >>> memory mitigation requirements.
> >>
> >> Which, aiui, has the downside of disassembly of the section no longer
> >> happening by default, when using objdump or similar tools, which go fr=
om
> >> section attributes. Why is it being in .init.text (and hence RX) not
> >> appropriate? It should - in principle at least - be possible to avoid
> >> all in-place writing to it, but instead only ever write to its relocat=
ed
> >> copy. Quite a bit more code churn of course.
> >>
> >> I wonder if we shouldn't put the trampoline in its own section, RWX in
> >> the object file, and switched to whatever appropriate in the binary
> >> (which really may be RX, not RW).
> >
> > We cannot have RWX to satisfy UEFI CA memory mitigation, that's why I
> > had to move it, code sections should not be writeable. We can mark
> > either RX or RW but we use the data very early so we are not able to
> > change the permissions (we can try with all complications that this
> > could bring like how to report an error at so early stages).
>
> The early writing could be done away with, as indicated. There's not
> really any strict requirement to write to the trampoline region within
> the Xen image. All updates to it could in principle be done after it
> was copied into low memory. Then (and of course only then) could it be
> part of an RX section in the image, maybe .init.text, maybe a separate
> .trampoline section.
>
> Jan

Hi Jan,
   how strong are you on this? Is this "objdump" thing such a big
issue? The code contains a lot of 16 bit code which would require
additional options anyway. Won't be an assembly listing output more
helpful instead?
I tried to change the code to change only the final copy of the
trampoline but it looks like lot of code assumes it can change the
source of it (that is requiring it to be in a writeable section). For
instance EFI change settings directly and then allocate space for the
copy later. The allocation could be moved but there's a fallback on
code that assumes that early allocation can fail.
The trampoline relocation is done with PC relative addressing which is
helpful if you are changing the source directly, not the copy.
Could I ouput the trampoline in a code section ("ax" instead of "aw")
and then later move it into .init.data section assuring .init.data is
writeable but not executable?

Frediano


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 14:30:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 14:30:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779773.1189454 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg3Od-0006YW-RK; Mon, 19 Aug 2024 14:30:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779773.1189454; Mon, 19 Aug 2024 14:30:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg3Od-0006YP-OV; Mon, 19 Aug 2024 14:30:11 +0000
Received: by outflank-mailman (input) for mailman id 779773;
 Mon, 19 Aug 2024 14:30: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=lvcB=PS=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sg3Ob-0006YJ-R6
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 14:30:09 +0000
Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com
 [2607:f8b0:4864:20::82d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 882bb2f4-5e37-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 16:30:07 +0200 (CEST)
Received: by mail-qt1-x82d.google.com with SMTP id
 d75a77b69052e-44feaa08040so24128291cf.2
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 07:30:07 -0700 (PDT)
Received: from fziglio-xenia-fedora.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 d75a77b69052e-4536a07667fsm39827261cf.93.2024.08.19.07.30.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 19 Aug 2024 07:30:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 882bb2f4-5e37-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724077806; x=1724682606; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=WvhEFpFEZitUDnn8XmXXXarBrCnZ17sXZuHR7Tqwj2w=;
        b=hY24oA/Dc9CXESrV+A+6sqG6Uqc4Fm79h64fXpv2x/sFXVVrrc8ODsy9HvRS2bMiCu
         f/YjVCIiOoU+/UPjgvjBAr0lSa8bQX4I0csOHloBMU68SsZIXir7c9syoaAC3+TdQHXj
         NR/+FKjzaFVslaV+YuSdLmFbyRaq/fUOacKHw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724077806; x=1724682606;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=WvhEFpFEZitUDnn8XmXXXarBrCnZ17sXZuHR7Tqwj2w=;
        b=OXGiYGoC4USOhAQRSLZuXG2hEhilguTw9T3gQET5N8bdA4vAHjlJGXs4RG85iTNcSd
         /MwUE9a7xXYQTen8J623X8fHpxYNX1y56RlcU4sJkACEqZTXrOkkNij1SNkLg2mQtok+
         6Ea1Gsd3JDoPsl4j5Fn9EuYFYlsUePrE7XO62fmDINWRuCFLUL1E7bJBs4wymyU7jtG7
         m0w5BJzFK3uqACM68JitU5eRKUUe3h2s1HeqGyo2mxlhz8c41DBhkpa56yY2qNNOj9sH
         3KKBFofCxJYKk1pQHJer0p+RAH3mT1lhDezQnOmkmrrFr6lSsOs3yaIRS+U5VOVPLbjR
         yCfg==
X-Gm-Message-State: AOJu0Yw/Xtcv6i+Abi/cZxmMIgRK/KxxjcoA6O6ypJhKX9cjbJxL1dnS
	KMJ5cbXMyk6N3M2zww+Hl1MZiSvJ80W76PTKgJYqzZ1gYExkZxQ+pTLJCd9c/YQfFO9AnPZWN0C
	0
X-Google-Smtp-Source: AGHT+IFb90nhZGmi5xzv/yIh5X7R3ga9l7E7Jf+G4mNOa1gORiXdczsJLB8P61B18OxbDjj3zKNzvw==
X-Received: by 2002:ac8:5497:0:b0:453:74cd:a919 with SMTP id d75a77b69052e-45374cdaa8emr92118361cf.1.1724077806246;
        Mon, 19 Aug 2024 07:30:06 -0700 (PDT)
From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v4] Avoid crash calling PrintErrMesg from efi_multiboot2
Date: Mon, 19 Aug 2024 15:29:52 +0100
Message-ID: <20240819142953.415817-1-frediano.ziglio@cloud.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Although code is compiled with -fpic option data is not position
independent. This causes data pointer to become invalid if
code is not relocated properly which is what happens for
efi_multiboot2 which is called by multiboot entry code.

Code tested adding
   PrintErrMesg(L"Test message", EFI_BUFFER_TOO_SMALL);
in efi_multiboot2 before calling efi_arch_edd (this function
can potentially call PrintErrMesg).

Before the patch (XenServer installation on Qemu, xen replaced
with vanilla xen.gz):
  Booting `XenServer (Serial)'Booting `XenServer (Serial)'
  Test message: !!!! X64 Exception Type - 0E(#PF - Page-Fault)  CPU Apic ID - 00000000 !!!!
  ExceptionData - 0000000000000000  I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX:0
  RIP  - 000000007DC29E46, CS  - 0000000000000038, RFLAGS - 0000000000210246
  RAX  - 0000000000000000, RCX - 0000000000000050, RDX - 0000000000000000
  RBX  - 000000007DAB4558, RSP - 000000007EFA1200, RBP - 0000000000000000
  RSI  - FFFF82D040467A88, RDI - 0000000000000000
  R8   - 000000007EFA1238, R9  - 000000007EFA1230, R10 - 0000000000000000
  R11  - 000000007CF42665, R12 - FFFF82D040467A88, R13 - 000000007EFA1228
  R14  - 000000007EFA1225, R15 - 000000007DAB45A8
  DS   - 0000000000000030, ES  - 0000000000000030, FS  - 0000000000000030
  GS   - 0000000000000030, SS  - 0000000000000030
  CR0  - 0000000080010033, CR2 - FFFF82D040467A88, CR3 - 000000007EC01000
  CR4  - 0000000000000668, CR8 - 0000000000000000
  DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
  DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
  GDTR - 000000007E9E2000 0000000000000047, LDTR - 0000000000000000
  IDTR - 000000007E4E5018 0000000000000FFF,   TR - 0000000000000000
  FXSAVE_STATE - 000000007EFA0E60
  !!!! Find image based on IP(0x7DC29E46) (No PDB)  (ImageBase=000000007DC28000, EntryPoint=000000007DC2B917) !!!!

After the patch:
  Booting `XenServer (Serial)'Booting `XenServer (Serial)'
  Test message: Buffer too small
  BdsDxe: loading Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
  BdsDxe: starting Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)

Fixes: 9180f5365524 ("x86: add multiboot2 protocol support for EFI platforms")
Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/common/efi/boot.c | 46 ++++++++++++++++++++++++++++++-------------
 1 file changed, 32 insertions(+), 14 deletions(-)
---
Changes since v1:
- added "Fixes:" tag;
- fixed cast style change.

Changes since v2:
- wrap long line.

Changes since v3:
- fixed "Fixes:" tag.

diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
index efbec00af9..fdbe75005c 100644
--- a/xen/common/efi/boot.c
+++ b/xen/common/efi/boot.c
@@ -287,19 +287,36 @@ static bool __init match_guid(const EFI_GUID *guid1, const EFI_GUID *guid2)
 /* generic routine for printing error messages */
 static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
 {
-    static const CHAR16* const ErrCodeToStr[] __initconstrel = {
-        [~EFI_ERROR_MASK & EFI_NOT_FOUND]           = L"Not found",
-        [~EFI_ERROR_MASK & EFI_NO_MEDIA]            = L"The device has no media",
-        [~EFI_ERROR_MASK & EFI_MEDIA_CHANGED]       = L"Media changed",
-        [~EFI_ERROR_MASK & EFI_DEVICE_ERROR]        = L"Device error",
-        [~EFI_ERROR_MASK & EFI_VOLUME_CORRUPTED]    = L"Volume corrupted",
-        [~EFI_ERROR_MASK & EFI_ACCESS_DENIED]       = L"Access denied",
-        [~EFI_ERROR_MASK & EFI_OUT_OF_RESOURCES]    = L"Out of resources",
-        [~EFI_ERROR_MASK & EFI_VOLUME_FULL]         = L"Volume is full",
-        [~EFI_ERROR_MASK & EFI_SECURITY_VIOLATION]  = L"Security violation",
-        [~EFI_ERROR_MASK & EFI_CRC_ERROR]           = L"CRC error",
-        [~EFI_ERROR_MASK & EFI_COMPROMISED_DATA]    = L"Compromised data",
-        [~EFI_ERROR_MASK & EFI_BUFFER_TOO_SMALL]    = L"Buffer too small",
+#define ERROR_MESSAGE_LIST \
+    ERROR_MESSAGE(EFI_NOT_FOUND, "Not found") \
+    ERROR_MESSAGE(EFI_NO_MEDIA, "The device has no media") \
+    ERROR_MESSAGE(EFI_MEDIA_CHANGED, "Media changed") \
+    ERROR_MESSAGE(EFI_DEVICE_ERROR, "Device error") \
+    ERROR_MESSAGE(EFI_VOLUME_CORRUPTED, "Volume corrupted") \
+    ERROR_MESSAGE(EFI_ACCESS_DENIED, "Access denied") \
+    ERROR_MESSAGE(EFI_OUT_OF_RESOURCES, "Out of resources") \
+    ERROR_MESSAGE(EFI_VOLUME_FULL, "Volume is full") \
+    ERROR_MESSAGE(EFI_SECURITY_VIOLATION, "Security violation") \
+    ERROR_MESSAGE(EFI_CRC_ERROR, "CRC error") \
+    ERROR_MESSAGE(EFI_COMPROMISED_DATA, "Compromised data") \
+    ERROR_MESSAGE(EFI_BUFFER_TOO_SMALL, "Buffer too small")
+
+    static const struct ErrorStrings {
+        CHAR16 start;
+#undef ERROR_MESSAGE
+#define ERROR_MESSAGE(code, str) CHAR16 msg_ ## code[sizeof(str)];
+        ERROR_MESSAGE_LIST
+    } ErrorStrings __initconst = {
+        0
+#undef ERROR_MESSAGE
+#define ERROR_MESSAGE(code, str) , L ## str
+        ERROR_MESSAGE_LIST
+    };
+    static const uint16_t ErrCodeToStr[] __initconst = {
+#undef ERROR_MESSAGE
+#define ERROR_MESSAGE(code, str) \
+        [~EFI_ERROR_MASK & code] = offsetof(struct ErrorStrings, msg_ ## code),
+        ERROR_MESSAGE_LIST
     };
     EFI_STATUS ErrIdx = ErrCode & ~EFI_ERROR_MASK;
 
@@ -308,7 +325,8 @@ static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
     PrintErr(L": ");
 
     if( (ErrIdx < ARRAY_SIZE(ErrCodeToStr)) && ErrCodeToStr[ErrIdx] )
-        mesg = ErrCodeToStr[ErrIdx];
+        mesg = (const CHAR16 *)((const void *)&ErrorStrings +
+                                ErrCodeToStr[ErrIdx]);
     else
     {
         PrintErr(L"ErrCode: ");
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Mon Aug 19 14:30:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 14:30:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779774.1189464 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg3On-0006ol-23; Mon, 19 Aug 2024 14:30:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779774.1189464; Mon, 19 Aug 2024 14:30:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg3Om-0006oc-VJ; Mon, 19 Aug 2024 14:30:20 +0000
Received: by outflank-mailman (input) for mailman id 779774;
 Mon, 19 Aug 2024 14:30:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sg3Ok-0006ns-QJ
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 14:30:18 +0000
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com
 [2a00:1450:4864:20::52d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8e113ee5-5e37-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 16:30:17 +0200 (CEST)
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-5bef295a2b4so360907a12.0
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 07:30:17 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bf004c2ebfsm765018a12.1.2024.08.19.07.29.37
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 07:29:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8e113ee5-5e37-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724077817; x=1724682617; 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=vFziP5HtWjS+iqVsFwy35jW6si/g6fOZTDXfKiREB+E=;
        b=S1/r7e/FDlDufe4xVhZezMUwGf6StnJHETiUfYiuBTpj9idG7VN41xh1voWoGeOXHF
         IckCCUz961smX4VFQCQMsVxOeTPGCfNKoKqd8jaaIb3UccCH5S5fOYm19wizmeNZOTKO
         H7GyCVcA9YVgk4m8HP1N5jqIZ18xPzuWnvxeZNkLZtR1pQoWfcI70JHflgxd79UF/xC2
         lnKBsc/GyIB3n8+IFT72yjIDkN2QZvE/8WU/yGrQ8mN6fao0DjXeYLJR7MJaouURGBZN
         yNHk+6U21o0ddpR3QlrUkCBQ7OtU6vvOXkc6E7MPDBHmOpqlMrlJkAx4ajcdB3I3Qu1O
         QBzg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724077817; x=1724682617;
        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=vFziP5HtWjS+iqVsFwy35jW6si/g6fOZTDXfKiREB+E=;
        b=L/jf5kRvyertIH9O6aEwWp8Kccfi0+Cx/GQcOHPYQF9yB5XUReZ3glVN85A6UPQyVh
         hJHLbnNZJKpivsugtEMeSY8TPgJHpk+nfkwUStzcgHFgbuQOhwV2FnfUITVz6n8WYHc+
         R/y1w5kOza1aD9pO+JAUSObN6O5lyH6msKtZWTNNSWW9wUSrFDqFO7F9ONEoDkYzD5W8
         0suYGsRxQVsU7D9yoClZfISJ0KK5pzuNlvXun7/H+EJ7EWw4Jm5IMMT0Ls3Y7kMqe6D1
         dXa/L5Pv++44nHwWCVKYJkdcyucNkp3p9oYveVMCjOA8cCXPX286neLpOBmISWKNklPt
         6LKg==
X-Forwarded-Encrypted: i=1; AJvYcCVRFaKiMZGKsT6QCuBDs+BV7mn0WlhYsIs8OfHMNMq+1OQxxuiNrNhJxNLSdmcmHhy3T+82qHzXbTiVnWUIrTTJF5hkzw2A54CGJHPIm8w=
X-Gm-Message-State: AOJu0Yw6uV/W3R2ZpZpoom6fhP8V5L+0CSo+8hSk3aJ99ho/UlCMGBeV
	aQMNL3Afk9O03kVO0bXPnuL3kKwbuM0wZkP8leHuYaaCOrAiBrCtRzLvSEMmvQ==
X-Google-Smtp-Source: AGHT+IG2rSH/srQ/zLAHokup5di0Ieswh7Lqd2dHl7+0/JXmWvfHfHhkCZ+xtMos/Nq8jHILKwvAbg==
X-Received: by 2002:a05:6402:26cc:b0:5be:df5e:3c5d with SMTP id 4fb4d7f45d1cf-5bedf5e413fmr6558227a12.14.1724077816636;
        Mon, 19 Aug 2024 07:30:16 -0700 (PDT)
Message-ID: <a3d901f9-0a74-4cef-b616-77d338dda314@suse.com>
Date: Mon, 19 Aug 2024 16:29:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/5] x86: Put trampoline in .init.data section
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-2-alejandro.vallejo@cloud.com>
 <ad72cc97-b9dd-4e7e-93f6-333805e40785@suse.com>
 <CACHz=Zh7wK58mbB762fnevHEKW9qhp-NRJ6buNe1b-qLxP0qPg@mail.gmail.com>
 <b9b40658-ff13-4240-98a2-4811411e31b6@suse.com>
 <CACHz=Zj8h-TeDa2Ey8EKKEOpXJqx9MnL+AGpdTBY1B8PZ0==mA@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: <CACHz=Zj8h-TeDa2Ey8EKKEOpXJqx9MnL+AGpdTBY1B8PZ0==mA@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 19.08.2024 16:16, Frediano Ziglio wrote:
> On Thu, Aug 8, 2024 at 9:54 AM Jan Beulich <jbeulich@suse.com> wrote:
>> On 08.08.2024 10:00, Frediano Ziglio wrote:
>>> On Thu, Aug 8, 2024 at 8:34 AM Jan Beulich <jbeulich@suse.com> wrote:
>>>> On 07.08.2024 15:48, Alejandro Vallejo wrote:
>>>>> This change allows to put the trampoline in a separate, not executable
>>>>> section. The trampoline contains a mix of code and data (data which
>>>>> is modified from C code during early start so must be writable).
>>>>> This is in preparation for W^X patch in order to satisfy UEFI CA
>>>>> memory mitigation requirements.
>>>>
>>>> Which, aiui, has the downside of disassembly of the section no longer
>>>> happening by default, when using objdump or similar tools, which go from
>>>> section attributes. Why is it being in .init.text (and hence RX) not
>>>> appropriate? It should - in principle at least - be possible to avoid
>>>> all in-place writing to it, but instead only ever write to its relocated
>>>> copy. Quite a bit more code churn of course.
>>>>
>>>> I wonder if we shouldn't put the trampoline in its own section, RWX in
>>>> the object file, and switched to whatever appropriate in the binary
>>>> (which really may be RX, not RW).
>>>
>>> We cannot have RWX to satisfy UEFI CA memory mitigation, that's why I
>>> had to move it, code sections should not be writeable. We can mark
>>> either RX or RW but we use the data very early so we are not able to
>>> change the permissions (we can try with all complications that this
>>> could bring like how to report an error at so early stages).
>>
>> The early writing could be done away with, as indicated. There's not
>> really any strict requirement to write to the trampoline region within
>> the Xen image. All updates to it could in principle be done after it
>> was copied into low memory. Then (and of course only then) could it be
>> part of an RX section in the image, maybe .init.text, maybe a separate
>> .trampoline section.
> 
>    how strong are you on this? Is this "objdump" thing such a big
> issue? The code contains a lot of 16 bit code which would require
> additional options anyway. Won't be an assembly listing output more
> helpful instead?

Well. Whether a listing can serve as a stand-in depends on the situation.
Not being able to disassemble code (e.g. also in the final executable)
can be pretty limiting. The need to pass extra options is related, but
not really an argument against.

> I tried to change the code to change only the final copy of the
> trampoline but it looks like lot of code assumes it can change the
> source of it (that is requiring it to be in a writeable section). For
> instance EFI change settings directly and then allocate space for the
> copy later. The allocation could be moved but there's a fallback on
> code that assumes that early allocation can fail.

Right, if there's too much standing in the way then we need to look at
possible alternatives.

> The trampoline relocation is done with PC relative addressing which is
> helpful if you are changing the source directly, not the copy.

I'm afraid I can't make a connection between this and what we're
discussing.

> Could I ouput the trampoline in a code section ("ax" instead of "aw")
> and then later move it into .init.data section assuring .init.data is
> writeable but not executable?

Could you go into a little more detail on what you mean here? At the
first glance my reaction is "yes, sure, why not", but much depends on
what exactly is meant.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 14:31:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 14:31:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779786.1189473 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg3Pb-0007Su-9u; Mon, 19 Aug 2024 14:31:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779786.1189473; Mon, 19 Aug 2024 14:31:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg3Pb-0007Sn-6u; Mon, 19 Aug 2024 14:31:11 +0000
Received: by outflank-mailman (input) for mailman id 779786;
 Mon, 19 Aug 2024 14:31:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lvcB=PS=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sg3Pa-0006ns-Lh
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 14:31:10 +0000
Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com
 [2607:f8b0:4864:20::22c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ab1097ba-5e37-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 16:31:06 +0200 (CEST)
Received: by mail-oi1-x22c.google.com with SMTP id
 5614622812f47-3db1d4dab7fso2346744b6e.1
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 07:31:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ab1097ba-5e37-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724077865; x=1724682665; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=m8ACXTgx7pjAI9HoG5EjJ+PgOQp4yhJ5AQsnfGaII3E=;
        b=DoftXNdjjZdKQoh2htymTH8zokQodKvVzlYKPneuRZHIxd+mv2sw56mG8QHlW/YKez
         Hmnlz03qamDp9YB5NYDHT8a92ilvxPYDedXA5lLdRtXpVBRPl+6tSN25G1C/Vq9G35a9
         1BLJGDVK4XpaIsWI/e+3Tz4wsmbl7CCVIs6wA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724077865; x=1724682665;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=m8ACXTgx7pjAI9HoG5EjJ+PgOQp4yhJ5AQsnfGaII3E=;
        b=Ee2ZxLP3ATPGsoRZKwSBWkyD5q/BsoVGST5QtEbkROHCBc1et9rf4SiqtzNtKqmWpp
         QDL5KJZVdohO5pE18vt+K0HnW1J4ziQk6LnkbzoR4wMvhPVbub8+Igf4IedvE/BXFGrv
         3XYx0Oi4lqtPaVeztiBD5saYtPRuEm6mo8/raXnZqCyn8GO/yWfECRBVAgqCxEuGTRaR
         mQv0WDN7Y6Xb8w6vwxCPe2tnr2k2xykD27c5HcggsHL62Eohr+QRKPwfX/HPaWvmmVOA
         vAHfuzbgoWmL2JPQw71CBGLx+cGg8d9FeQJiEM00RAj/Ps6iyrnG4Ibb99zprHCtlI0f
         mxSw==
X-Forwarded-Encrypted: i=1; AJvYcCUDuGqTTUtGl287rcGT3fTDd+fAL1GIVonoqmkISMMekmrd5Z9BE7rJYPWsv2t7skOpkgh+hJudFfDcMXjEs68dAT/ZkwFGTHpThckEhW4=
X-Gm-Message-State: AOJu0Yz2AEQk4BHT2u6MxCTKf0qizl3jriWWVM9vJuXhRyrJofSpWZ1p
	QRfgkOKik2lbIhBHHW+FShgHrf/PFDNVEJunluhNZfHNmWPcO9h3bV+0ZGp+utzi+w0t4njIGgu
	9zg/gNmwlDXDzqEzmAHL8ooRx3UFq5l4Q8SLi3Q==
X-Google-Smtp-Source: AGHT+IH3GG90n/r67aZuDu1/4yaBiTHCxxC+RFYhir//ShzTTJBnlLIPACiXHbzEbbPRWQTSrczNgtt68fADVG9vUGA=
X-Received: by 2002:a05:6808:3a15:b0:3da:dffb:d22b with SMTP id
 5614622812f47-3dd42eadedbmr9104287b6e.29.1724077865317; Mon, 19 Aug 2024
 07:31:05 -0700 (PDT)
MIME-Version: 1.0
References: <20240819125401.218931-1-frediano.ziglio@cloud.com>
 <edbf5a9d-2a13-4755-80f4-5bab93cb8053@suse.com> <CACHz=ZgW4WZkEV6R+2YJbRN8yBNq3rMGgsvHDtaDm4w47=Cwrg@mail.gmail.com>
 <e2e609a8-b27c-4f6d-a7b4-f9d74b69befd@suse.com>
In-Reply-To: <e2e609a8-b27c-4f6d-a7b4-f9d74b69befd@suse.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Mon, 19 Aug 2024 15:30:54 +0100
Message-ID: <CACHz=Zh43cRULZB21sP8S+tF9cXzYroKwjjdhBxU4iyZyqy_Gw@mail.gmail.com>
Subject: Re: [PATCH v3] Avoid crash calling PrintErrMesg from efi_multiboot2
To: Jan Beulich <jbeulich@suse.com>
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>, 
	=?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 19, 2024 at 3:14=E2=80=AFPM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> On 19.08.2024 16:02, Frediano Ziglio wrote:
> > On Mon, Aug 19, 2024 at 2:19=E2=80=AFPM Jan Beulich <jbeulich@suse.com>=
 wrote:
> >>
> >> On 19.08.2024 14:54, Frediano Ziglio wrote:
> >>> Although code is compiled with -fpic option data is not position
> >>> independent. This causes data pointer to become invalid if
> >>> code is not relocated properly which is what happens for
> >>> efi_multiboot2 which is called by multiboot entry code.
> >>>
> >>> Code tested adding
> >>>    PrintErrMesg(L"Test message", EFI_BUFFER_TOO_SMALL);
> >>> in efi_multiboot2 before calling efi_arch_edd (this function
> >>> can potentially call PrintErrMesg).
> >>>
> >>> Before the patch (XenServer installation on Qemu, xen replaced
> >>> with vanilla xen.gz):
> >>>   Booting `XenServer (Serial)'Booting `XenServer (Serial)'
> >>>   Test message: !!!! X64 Exception Type - 0E(#PF - Page-Fault)  CPU A=
pic ID - 00000000 !!!!
> >>>   ExceptionData - 0000000000000000  I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX=
:0
> >>>   RIP  - 000000007DC29E46, CS  - 0000000000000038, RFLAGS - 000000000=
0210246
> >>>   RAX  - 0000000000000000, RCX - 0000000000000050, RDX - 000000000000=
0000
> >>>   RBX  - 000000007DAB4558, RSP - 000000007EFA1200, RBP - 000000000000=
0000
> >>>   RSI  - FFFF82D040467A88, RDI - 0000000000000000
> >>>   R8   - 000000007EFA1238, R9  - 000000007EFA1230, R10 - 000000000000=
0000
> >>>   R11  - 000000007CF42665, R12 - FFFF82D040467A88, R13 - 000000007EFA=
1228
> >>>   R14  - 000000007EFA1225, R15 - 000000007DAB45A8
> >>>   DS   - 0000000000000030, ES  - 0000000000000030, FS  - 000000000000=
0030
> >>>   GS   - 0000000000000030, SS  - 0000000000000030
> >>>   CR0  - 0000000080010033, CR2 - FFFF82D040467A88, CR3 - 000000007EC0=
1000
> >>>   CR4  - 0000000000000668, CR8 - 0000000000000000
> >>>   DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 000000000000=
0000
> >>>   DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 000000000000=
0400
> >>>   GDTR - 000000007E9E2000 0000000000000047, LDTR - 0000000000000000
> >>>   IDTR - 000000007E4E5018 0000000000000FFF,   TR - 0000000000000000
> >>>   FXSAVE_STATE - 000000007EFA0E60
> >>>   !!!! Find image based on IP(0x7DC29E46) (No PDB)  (ImageBase=3D0000=
00007DC28000, EntryPoint=3D000000007DC2B917) !!!!
> >>>
> >>> After the patch:
> >>>   Booting `XenServer (Serial)'Booting `XenServer (Serial)'
> >>>   Test message: Buffer too small
> >>>   BdsDxe: loading Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3E=
E4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
> >>>   BdsDxe: starting Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3=
EE4AF6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
> >>>
> >>> Fixes: 00d5d5ce23e6 ("work around Clang generating .data.rel.ro secti=
on for init-only files")
> >
> > ^^^^ here ??
>
> Did you not see ...
>
> >>> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
> >>> ---
> >>>  xen/common/efi/boot.c | 46 ++++++++++++++++++++++++++++++-----------=
--
> >>>  1 file changed, 32 insertions(+), 14 deletions(-)
> >>> ---
> >>> Changes since v1:
> >>> - added "Fixes:" tag;
> >>> - fixed cast style change.
> >>>
> >>> Changes since v2:
> >>> - wrap long line.
> >>
> >> And what about the Fixes: tag?
>
> ... my respective v2 comment then? There I said:
>
> "I don't think this is right. While this is where the array was introduce=
d,
>  it was correct at that time afaict. It went wrong when MB2 support was a=
dded
>  about a year later. 9180f5365524 ("x86: add multiboot2 protocol support =
for
>  EFI platforms") may be reasonable to blame, albeit I'm not sure that was=
 the
>  final one, after which MB2 support was considered complete."
>
> Jan

Yes, missed, updated

Frediano


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 15:10:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 15:10:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779803.1189483 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg41o-0006rh-4C; Mon, 19 Aug 2024 15:10:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779803.1189483; Mon, 19 Aug 2024 15:10:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg41o-0006ra-1i; Mon, 19 Aug 2024 15:10:40 +0000
Received: by outflank-mailman (input) for mailman id 779803;
 Mon, 19 Aug 2024 15:10:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sg41m-0006rU-RD
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 15:10:38 +0000
Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com
 [2a00:1450:4864:20::632])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 30c475c7-5e3d-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 17:10:37 +0200 (CEST)
Received: by mail-ej1-x632.google.com with SMTP id
 a640c23a62f3a-a8384008482so462802666b.2
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 08:10:37 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838eeedasm650650466b.94.2024.08.19.08.10.36
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 08:10:36 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 30c475c7-5e3d-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724080237; x=1724685037; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=VMFuda9zSuvIUDUpw+NC7ITh36ow+1ODv7nhP9JG8q8=;
        b=Gy0avxay2kMaxjZSFl+Xd+sGDkxMbsaerxCaBGubVLZciLquDsux840bPHpYcQRGyv
         b0E0TpWsN0mZhx0KX/j+VzI8Ka6/ETiJjN8QnYwy1z244Wg3vSTJFcAqjkSEMcrkiVuM
         r+oJLVgc3xP7sBFx5oqk+9lsK3QZN2OwdoV2Io48TnxTGmuDXZRviqj9ji36aj8NHkR5
         qdtpou+1EiVNWOYXFf8/SQwMw3QpbZya2GYnUqaRLAFKgVki3r5A7kYFkUIjALF0hLED
         glFJGw0bjeWLvosV0yuHgl//iDBN6pns3bJ6QsRjdZGIoYaTWAPe1lTO7R9p4zAzAtUv
         vFFg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724080237; x=1724685037;
        h=content-transfer-encoding:autocrypt:content-language:cc:to:subject
         :from:user-agent:mime-version:date:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=VMFuda9zSuvIUDUpw+NC7ITh36ow+1ODv7nhP9JG8q8=;
        b=Jq6jsP+oE+4Tx0QY+nQKc/9rriZuqsVmAW7QHrrLdCMCYtl+J36xLFJrd7frg9Pcxk
         WWWef1Rv3RYLibBlqKT9J/59n0113D0ZvuSS1dvOgwHoEYuCz86eQrn5Jwx0KMbkU0T/
         Eymg8/HXIx/3TljlVU3cLGcijeDUyL9DU0nXmyZ9o6gwV7NiOti2lLMesOGxjzJfwHsc
         sDN/KnJtnpMqzBiITUz+ecd3OJLMAKN4Sn7F/IpJGmXa5UBgDUG0otpzR3VmvLjU6X3+
         /ZcyW4BU02vGhgj9h2ysY3IB+P9k7mnDHdBxZkPa9bxTSgVs8wx54K6rvqjSpcFzNLNZ
         jtlQ==
X-Gm-Message-State: AOJu0Yyc1Peb1audgvuZSTt43g/J7umgdBTjrz6YRRXoHZqrkxIqpQ69
	phhFewvVzMoWp8yszazbYYM+SiDTYkvZE6pH/kADDfFDysahetY8XtOiRyPV9BnA+xmZk5huXKA
	=
X-Google-Smtp-Source: AGHT+IGq5P4uTORkQU0SG5IiFMwLYIdqcDtbRb5Ak3ghjTIY+p3C1uQoIr9RuSP1H/Ru5GOTk+oJ6w==
X-Received: by 2002:a17:907:2d26:b0:a72:5f9a:159a with SMTP id a640c23a62f3a-a83a9fbd306mr589972766b.2.1724080237041;
        Mon, 19 Aug 2024 08:10:37 -0700 (PDT)
Message-ID: <14f8887b-1f66-428e-8417-f552b8851c71@suse.com>
Date: Mon, 19 Aug 2024 17:10:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v3] mktarball: only archive Xen
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony Perard <anthony@xenproject.org>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

As was basically decided already a while ago, remove - in the simplest
possible way - the archiving of both qemu-s and mini-os from tarball
generation.

With this the subtree-force-update-all prereq isn't needed anymore in
the top level Makefile. That goal, including the respective ones
underneath tools/, then also are unreferenced and hence are being
dropped, too.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
This is the simplistic approach; I'm sure this could now be done quite a
bit more efficiently. I also expect there's no longer a need to run
./configure ahead of the invocation of this script, but since I have no
idea why it was needed earlier on, I'm not removing that here from the
doc. IOW all cleanup that's probably better done separately, by someone
actually using all of that machinery.
---
v3: Drop subtree-force-update-all rules from underneath tools/.
v2: Drop subtree-force-update-all prereqs from ./Makefile.

--- a/Makefile
+++ b/Makefile
@@ -200,10 +200,6 @@ rpmball: dist
 subtree-force-update: mini-os-dir-force-update
 	$(MAKE) -C tools subtree-force-update
 
-.PHONY: subtree-force-update-all
-subtree-force-update-all: mini-os-dir-force-update
-	$(MAKE) -C tools subtree-force-update-all
-
 # Make a source tarball, including qemu sub-trees.
 #
 # src-tarball will use "git describe" for the version number.  This
@@ -214,11 +210,11 @@ subtree-force-update-all: mini-os-dir-fo
 # src-tarball-release will use "make xenversion" as the version
 # number.  This is suitable for release tarballs.
 .PHONY: src-tarball-release
-src-tarball-release: subtree-force-update-all
+src-tarball-release:
 	bash ./tools/misc/mktarball $(XEN_ROOT) $$($(MAKE) -C xen xenversion --no-print-directory)
 
 .PHONY: src-tarball
-src-tarball: subtree-force-update-all
+src-tarball:
 	bash ./tools/misc/mktarball $(XEN_ROOT) $$(git describe)
 
 .PHONY: clean
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -282,8 +282,3 @@ endif
 ifeq ($(CONFIG_X86),y)
 	$(MAKE) -C firmware subtree-force-update
 endif
-
-subtree-force-update-all:
-	$(MAKE) qemu-xen-dir-force-update
-	$(MAKE) qemu-xen-traditional-dir-force-update
-	$(MAKE) -C firmware subtree-force-update-all
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -206,7 +206,7 @@ subdir-all-% subdir-clean-% subdir-insta
 subdir-distclean-%: .phony
 	$(MAKE) -C $* distclean
 
-no-configure-targets := distclean subdir-distclean% clean subdir-clean% subtree-force-update-all %-dir-force-update
+no-configure-targets := distclean subdir-distclean% clean subdir-clean% %-dir-force-update
 ifeq (,$(filter $(no-configure-targets),$(MAKECMDGOALS)))
 $(XEN_ROOT)/config/Tools.mk:
 	$(error You have to run ./configure before building or installing the tools)
--- a/tools/firmware/Makefile
+++ b/tools/firmware/Makefile
@@ -127,9 +127,5 @@ ifeq ($(CONFIG_OVMF),y)
 	$(MAKE) ovmf-dir-force-update
 endif
 
-subtree-force-update-all:
-	$(MAKE) seabios-dir-force-update
-	$(MAKE) ovmf-dir-force-update
-
 subdir-all-seabios-dir: seabios-dir
 	$(MAKE) -C $< CC=$(SEABIOSCC) LD=$(SEABIOSLD) PYTHON=$(PYTHON) EXTRAVERSION=$(SEABIOS_EXTRAVERSION) all;
--- a/tools/misc/mktarball
+++ b/tools/misc/mktarball
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# mktarball: Make a release tarball (including xen, qemu, and qemu-traditional)
+# mktarball: Make a release tarball (including just xen)
 #
 # Takes 2 arguments, the path to the dist directory and the version
 set -ex
@@ -29,26 +29,6 @@ mkdir -p $tdir
 
 git_archive_into $xen_root $tdir/xen-$desc
 
-# We can't use git_archive_into with qemu upstream because it uses
-# git-submodules.  git-submodules are an inherently broken git feature
-# which should never be used in any circumstance.  Unfortunately, qemu
-# upstream uses them.  Relevantly for us, git archive does not work
-# properly when there are submodules.
-(
-    cd $xen_root/tools/qemu-xen-dir-remote
-    # if it's not clean, the qemu script will call `git stash' !
-    git --no-pager diff --stat HEAD
-    scripts/archive-source.sh $tdir/xen-$desc/tools/qemu-xen.tar
-    cd $tdir/xen-$desc/tools
-    mkdir qemu-xen
-    tar <qemu-xen.tar Cxf qemu-xen -
-    rm qemu-xen.tar
-)
-
-git_archive_into $xen_root/tools/qemu-xen-traditional-dir-remote $tdir/xen-$desc/tools/qemu-xen-traditional
-
-git_archive_into $xen_root/extras/mini-os-remote $tdir/xen-$desc/extras/mini-os
-
 GZIP=-9v tar cz -f $xen_root/dist/xen-$desc.tar.gz -C $tdir xen-$desc
 
 echo "Source tarball in $xen_root/dist/xen-$desc.tar.gz"


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 15:30:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 15:30:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779820.1189493 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg4Km-0002LY-S9; Mon, 19 Aug 2024 15:30:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779820.1189493; Mon, 19 Aug 2024 15:30:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg4Km-0002LR-PN; Mon, 19 Aug 2024 15:30:16 +0000
Received: by outflank-mailman (input) for mailman id 779820;
 Mon, 19 Aug 2024 15:30:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lvcB=PS=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sg4Kl-0002LE-ME
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 15:30:15 +0000
Received: from mail-oo1-xc34.google.com (mail-oo1-xc34.google.com
 [2607:f8b0:4864:20::c34])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ee09eebd-5e3f-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 17:30:14 +0200 (CEST)
Received: by mail-oo1-xc34.google.com with SMTP id
 006d021491bc7-5da6865312eso3053052eaf.3
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 08:30:14 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ee09eebd-5e3f-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724081413; x=1724686213; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=90hQxXr1uwL6SWxp9EIIRDdoZE6EuASCWeLnxli+oTI=;
        b=c1bTPK59IV1/pm2fW+w4ijP6WYJVxeiPEqdp5IqH/EBRFRYieydsuiMjgZ4QqHmu1d
         N0b+6BIJV13rBDelZtixLogK5DWSXnd7l7LeB7zwQSxUrUGQhTxXtvG3SrnwhzlzTadO
         xTdX6rFJUu2pj+XaCRPlZFJKbz7yHzWQm3q3Y=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724081413; x=1724686213;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=90hQxXr1uwL6SWxp9EIIRDdoZE6EuASCWeLnxli+oTI=;
        b=iqLpLRNE09QI29/JYSp9mBrJf3pw/YLdSh9PJTnIaxQKoI0XFOiPeQoalPY9aMS31q
         jK6WlSDNO3f7RIxTNwwxXkGxWM2Frx0y8sXdrFLzdCX4BaJUQdRxwIifGu5XbyA7FkUf
         VgoNeHkxdefru8tKZerBncfeYV6VHDH39ktfnj0YTEVGMAq8nOFkGCbdUE66ocwKKUOV
         5tXrxsYTcOmukKCir5e9/Fhiu8Vo88h2m+WzenhZOxZpHCfPfGZ0TJhPpFG3U37Ivzhv
         RO7uHF7fzcSZzoy5IDl7ky13jfick/DcjEuHkqGeLxTw/3qrOBE4UPhFmw96BwFEQQOo
         My7Q==
X-Forwarded-Encrypted: i=1; AJvYcCUEYBzIb51foAE+ISrA2lJg2N6DLdJsveSWwYs2z25Cp0M0zDASp4Vz7hR96CqSB5jUzDL9e6qC1ot83Te2SSufrGYNQShTZgFkcatvv5Q=
X-Gm-Message-State: AOJu0Yy6p3GSUZIqbVd+JmpX8BGIZS3jf0y+XEgILsX0LkPG+zg6I0dF
	uCBHKFp/EWiwzq6R8y+JLnqBBjJzyvgBLQKfaiP7LZnIIiR8CZhBXvuxWSAoIgt7rg4a3ze3DGa
	XMTw050acv+Y5iVn6yT+YgbHKKqr3Z8Ma3RRtsg==
X-Google-Smtp-Source: AGHT+IHblPiAR0Tp2543f0LHyMLWGcj8uW6YWn2KSU+X7Wu4R158Ry069QHTAxqwTi6SSHncJAgEfJKNHuBjB2P1hLc=
X-Received: by 2002:a05:6820:2228:b0:5ba:ec8b:44b5 with SMTP id
 006d021491bc7-5da9800d2e4mr12583377eaf.3.1724081413587; Mon, 19 Aug 2024
 08:30:13 -0700 (PDT)
MIME-Version: 1.0
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-2-alejandro.vallejo@cloud.com> <ad72cc97-b9dd-4e7e-93f6-333805e40785@suse.com>
 <CACHz=Zh7wK58mbB762fnevHEKW9qhp-NRJ6buNe1b-qLxP0qPg@mail.gmail.com>
 <b9b40658-ff13-4240-98a2-4811411e31b6@suse.com> <CACHz=Zj8h-TeDa2Ey8EKKEOpXJqx9MnL+AGpdTBY1B8PZ0==mA@mail.gmail.com>
 <a3d901f9-0a74-4cef-b616-77d338dda314@suse.com>
In-Reply-To: <a3d901f9-0a74-4cef-b616-77d338dda314@suse.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Mon, 19 Aug 2024 16:30:02 +0100
Message-ID: <CACHz=ZgCd81NV7yXZ-Lud-QP8sj05mH9N0c-1z=eBv3pz2ENAw@mail.gmail.com>
Subject: Re: [PATCH 1/5] x86: Put trampoline in .init.data section
To: Jan Beulich <jbeulich@suse.com>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Xen-devel <xen-devel@lists.xenproject.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 19, 2024 at 3:30=E2=80=AFPM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> On 19.08.2024 16:16, Frediano Ziglio wrote:
> > On Thu, Aug 8, 2024 at 9:54=E2=80=AFAM Jan Beulich <jbeulich@suse.com> =
wrote:
> >> On 08.08.2024 10:00, Frediano Ziglio wrote:
> >>> On Thu, Aug 8, 2024 at 8:34=E2=80=AFAM Jan Beulich <jbeulich@suse.com=
> wrote:
> >>>> On 07.08.2024 15:48, Alejandro Vallejo wrote:
> >>>>> This change allows to put the trampoline in a separate, not executa=
ble
> >>>>> section. The trampoline contains a mix of code and data (data which
> >>>>> is modified from C code during early start so must be writable).
> >>>>> This is in preparation for W^X patch in order to satisfy UEFI CA
> >>>>> memory mitigation requirements.
> >>>>
> >>>> Which, aiui, has the downside of disassembly of the section no longe=
r
> >>>> happening by default, when using objdump or similar tools, which go =
from
> >>>> section attributes. Why is it being in .init.text (and hence RX) not
> >>>> appropriate? It should - in principle at least - be possible to avoi=
d
> >>>> all in-place writing to it, but instead only ever write to its reloc=
ated
> >>>> copy. Quite a bit more code churn of course.
> >>>>
> >>>> I wonder if we shouldn't put the trampoline in its own section, RWX =
in
> >>>> the object file, and switched to whatever appropriate in the binary
> >>>> (which really may be RX, not RW).
> >>>
> >>> We cannot have RWX to satisfy UEFI CA memory mitigation, that's why I
> >>> had to move it, code sections should not be writeable. We can mark
> >>> either RX or RW but we use the data very early so we are not able to
> >>> change the permissions (we can try with all complications that this
> >>> could bring like how to report an error at so early stages).
> >>
> >> The early writing could be done away with, as indicated. There's not
> >> really any strict requirement to write to the trampoline region within
> >> the Xen image. All updates to it could in principle be done after it
> >> was copied into low memory. Then (and of course only then) could it be
> >> part of an RX section in the image, maybe .init.text, maybe a separate
> >> .trampoline section.
> >
> >    how strong are you on this? Is this "objdump" thing such a big
> > issue? The code contains a lot of 16 bit code which would require
> > additional options anyway. Won't be an assembly listing output more
> > helpful instead?
>
> Well. Whether a listing can serve as a stand-in depends on the situation.
> Not being able to disassemble code (e.g. also in the final executable)
> can be pretty limiting. The need to pass extra options is related, but
> not really an argument against.
>

If some code is inside some data section (in the final binary) you can
use -D option to disassemble everything, even data. For instance a
"objdump -D xen-syms -m i8086" and look for some "trampoline" symbols.
Yes, the output of -D is surely longer than -d.

> > I tried to change the code to change only the final copy of the
> > trampoline but it looks like lot of code assumes it can change the
> > source of it (that is requiring it to be in a writeable section). For
> > instance EFI change settings directly and then allocate space for the
> > copy later. The allocation could be moved but there's a fallback on
> > code that assumes that early allocation can fail.
>
> Right, if there's too much standing in the way then we need to look at
> possible alternatives.
>
> > The trampoline relocation is done with PC relative addressing which is
> > helpful if you are changing the source directly, not the copy.
>
> I'm afraid I can't make a connection between this and what we're
> discussing.
>

The current C code (EFI, xen/arch/x86/efi/efi-boot.h) to relocate the
trampoline is
    for ( trampoline_ptr =3D __trampoline_rel_start;
          trampoline_ptr < __trampoline_rel_stop;
          ++trampoline_ptr )
        *(u32 *)(*trampoline_ptr + (long)trampoline_ptr) +=3D phys;
the formulae is easy as relative but you would need to change to something =
like
    long trampoline_offset =3D phys - (long)trampoline_start;
    for ( trampoline_ptr =3D __trampoline_rel_start;
          trampoline_ptr < __trampoline_rel_stop;
          ++trampoline_ptr )
        *(u32 *)(*trampoline_ptr + (long)trampoline_ptr +
trampoline_offset) +=3D phys;
which is surely more confusing, probably you want to change
relocations (code in trampoline.S) to offsets from trampoline_start
resulting into
    for ( trampoline_ptr =3D __trampoline_rel_start;
          trampoline_ptr < __trampoline_rel_stop;
          ++trampoline_ptr )
        *(u32 *)(*trampoline_ptr + phys) +=3D phys;

well, not impossible, you will need to change trampoline code, and the
2 code to relocate it.

> > Could I ouput the trampoline in a code section ("ax" instead of "aw")
> > and then later move it into .init.data section assuring .init.data is
> > writeable but not executable?
>
> Could you go into a little more detail on what you mean here? At the
> first glance my reaction is "yes, sure, why not", but much depends on
> what exactly is meant.
>

For instance you could put the trampoline into a
    .section .init.trampoline, "awx", @progbits
section (having the "x" will be disassembled by objdump -d head.o).
Then in xen/arch/x86/xen.lds.S in the .init.data section having something l=
ike
...
  DECL_SECTION(.init.data) {
       *(.init.bss.stack_aligned)
      (.init.trampoline)
   ...
this will put the trampoline in .init.data section of the final
object. At this point the .init.data containing code will have execute
permission that you would have to fix using objcopy command.
The final trampoline will be in a data section not executable so to
use objdump you will need the -D option, but not disassembling head.o.
In theory we could keep the temporary object file before the objcopy
adjustment to avoid the -D but I don't think it would save a lot of
burdain.

> Jan

On a related subject I'm trying to come up to a solution in order to
- write more boot code in C instead of assembly;
- avoid duplication between C and assembly code (like trampoline
relocation or page table initialization);
- avoid having to pass pointers to C code (like we do for
xen/arch/x86/boot/reloc.c);
- avoid having bugs like
https://lists.xenproject.org/archives/html/xen-devel/2024-08/msg00784.html,
I'd prefer if compilation would fail in this case instead a bug hidden
in some code path potentially seldomly exercised;
- making possible to reuse code between 32 bit C code (like code in
copy_string in xen/arch/x86/boot/reloc.c and strlen in
xen/arch/x86/boot/cmdline.c).
I have an idea about it, not sure how easy and nice it could be.

Frediano


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 15:34:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 15:34:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779827.1189505 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg4Oc-0002vu-DO; Mon, 19 Aug 2024 15:34:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779827.1189505; Mon, 19 Aug 2024 15:34:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg4Oc-0002vj-8P; Mon, 19 Aug 2024 15:34:14 +0000
Received: by outflank-mailman (input) for mailman id 779827;
 Mon, 19 Aug 2024 15:34:12 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=63V5=PS=bounce.vates.tech=bounce-md_30504962.66c365f0.v1-927d9a4b488847bd8c2040660a139536@srs-se1.protection.inumbo.net>)
 id 1sg4Oa-0002ug-QD
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 15:34:12 +0000
Received: from mail186-11.suw21.mandrillapp.com
 (mail186-11.suw21.mandrillapp.com [198.2.186.11])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 79dfda96-5e40-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 17:34:09 +0200 (CEST)
Received: from pmta10.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail186-11.suw21.mandrillapp.com (Mailchimp) with ESMTP id
 4Wnc8J0N5czLfH5w0
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 15:34:08 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 927d9a4b488847bd8c2040660a139536; Mon, 19 Aug 2024 15:34:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 79dfda96-5e40-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724081648; x=1724342148;
	bh=qAEVet5HRYVWUvU+lssCbbDMvc9C+3fZjVAjx03oKKY=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=V7FJ4wL1bYKIPyVh4FYCkG2iLCH5JORlu+IeGSk3t8zeV4H6z/rRkB2vnBfAvZb7K
	 KylXPr6WL1DJVRznDkOJezw4InHuRm+H04uMzaPeVTC4sorreaIUIcUCC/jAKZjc38
	 FRKA2YqwYw1YE+ml4vblHIM3AEaW3etFx1UQSIVCL7ey5rILDgR28luFsBsb3zxhPk
	 oVs488dZnb5xuwcBdBITV88HT5aazS6zEuH1TIS2EqjdDOn0g9qNHYhcMKRHM45P4X
	 4rCG7uNvyGvjZdrPta0tUCK1lhpYALXO/BAZHKiduuPoM64SFSDMt/G1KK2hQ41xzZ
	 AZojU6UYT0GNw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724081648; x=1724342148; i=anthony.perard@vates.tech;
	bh=qAEVet5HRYVWUvU+lssCbbDMvc9C+3fZjVAjx03oKKY=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=16phHpn25UTD7JszPFJs2NQHw5QxKZgdi5s8cONIgxx5ePm9mNa2m+4iV3R5R8WX9
	 pHNRAd9S/nBbb+ed7WrBlxERPL4sW2l4G8LKyb54lI+EUPVNlM7mQnhagj/CIojJOw
	 LTyeyp6b+TwDLMmyx9bEsAaqVnsCsAuboJ4dAFBXuovbcO5mkdc+Wh3C4jp92wctej
	 gfgkbnqA1DmqMTt2tJN2Dpc/fmbwIIxrO7LiNil7VmGzORYg7mphzNrUXJ26xbVduF
	 zMyMmPdr5nCV50l40Y50BS+tMsl8yTfkVGN1BzTtGcNX0Pc6kIFY9Sh0v9IWkW07gD
	 wsdXqBHVuNAVg==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH]=20automation:=20restore=20CR=20filtering?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724081646457
To: Michal Orzel <michal.orzel@amd.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org, Doug Goldstein <cardoe@cardoe.com>, Andrew Cooper <andrew.cooper3@citrix.com>
Message-Id: <ZsNl7S1JOYQgQx87@l14>
References: <alpine.DEB.2.22.394.2408161642220.298534@ubuntu-linux-20-04-desktop> <6d2fbe22-8866-4769-95d0-a5a8613a5936@amd.com>
In-Reply-To: <6d2fbe22-8866-4769-95d0-a5a8613a5936@amd.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.927d9a4b488847bd8c2040660a139536?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240819:md
Date: Mon, 19 Aug 2024 15:34:08 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Mon, Aug 19, 2024 at 09:21:22AM +0200, Michal Orzel wrote:
> On 17/08/2024 01:46, Stefano Stabellini wrote:
> > diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> > index 0666f6363e..ed44aab0f0 100755
> > --- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
> > +++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> > @@ -65,4 +65,4 @@ export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x4000000
> >  export QEMU_LOG="smoke.serial"
> >  export PASSED="${passed}"
> > 
> > -./automation/scripts/qemu-key.exp
> > +./automation/scripts/qemu-key.exp | sed 's/\r//'
> 
> I compared 3 pipelines:
> 1) one before c36efb7fcea6 (https://gitlab.com/xen-project/hardware/xen/-/jobs/7566986885)
> 2) one after c36efb7fcea6 (https://gitlab.com/xen-project/hardware/xen/-/jobs/7603830706)
> 3) one with this fix (https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7603783403)
> 
> In 1), there is Xen log + Linux log in Gitlab web page
> In 2), there is no log at all
> In 3), there is only Xen log visible

It's nice that you can select uboot/Xen logs or Linux logs based on the
number of '\r' at the end of a line (output cat -A):
    U-Boot 2023.01+dfsg-2+deb12u1 (Apr 18 2024 - 22:00:21 +0000)^M^M$
    (XEN) [    0.013864] Xen version 4.20-unstable (root@) (gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924) debug=n Sat Aug 17 00:54:57 UTC 2024^M^M$
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd070]^M^M^M$

But to display to GitLab's job logs, we want: sed 's/\r\+$//'

Also, do you have to edit every single script to overcome a shortcoming
from the "expect" script? Can't you write a bit of Tcl and edit the line
in the script instead?

Cheers,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 15:34:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 15:34:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779832.1189514 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg4PC-0003Mj-K9; Mon, 19 Aug 2024 15:34:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779832.1189514; Mon, 19 Aug 2024 15:34:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg4PC-0003Mc-H2; Mon, 19 Aug 2024 15:34:50 +0000
Received: by outflank-mailman (input) for mailman id 779832;
 Mon, 19 Aug 2024 15:34: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=bfyF=PS=gmail.com=milandjokic1995@srs-se1.protection.inumbo.net>)
 id 1sg4PA-0003Kz-FB
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 15:34:48 +0000
Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com
 [2607:f8b0:4864:20::f33])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 90300041-5e40-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 17:34:46 +0200 (CEST)
Received: by mail-qv1-xf33.google.com with SMTP id
 6a1803df08f44-6bf7ba05f75so28627026d6.0
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 08:34:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 90300041-5e40-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724081685; x=1724686485; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=O5ArTXO+cUPJSq5/DoTfh2KgX+f/iX0kdJB/pxog0gc=;
        b=JXib6HE0UsuKDwtFiI8A9YGjU/wNFJT2xy9soZyWXcdmawYwIqdjNOimq9DQUqr8EY
         dNQHhWv4iUM/xPohamXb/Gd/iKmCZ0K5NZClAH8T2QUdRD2eByj059wrSBVutnAko8lf
         y3JmJuXq6iha5dffpAlEl5+yyDh3/ugxtNQfbvOvUUPNf6fgc6AA+cIQ86oaDEK3qiky
         FtWHWjw/lCQE2dmSHoYVb5roMVhBYbMNqnQJnm+lE6/qHBg7TJCtxbef2ixGOKghcM1F
         jqQwb/hqxnVnjsTahF8vwVmMj6ci9QhilE9H6tohoVg/i6dHukTGR5+CNIb9+SD4oETq
         iTQw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724081685; x=1724686485;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=O5ArTXO+cUPJSq5/DoTfh2KgX+f/iX0kdJB/pxog0gc=;
        b=tliPvYtF0WKTdaC1fGJnikoxwAEnneMivbxdmKwLH3Y8QZdBXMEDvecEGTfvE2q6OW
         psv+2BclYU4msg6ztJT8bfIf3lLGEY2Dm67v4EIvA7XsmuytKZITz6Xa/Bi9QwRxjGqY
         wq2np+V5el0nkf6lbUJT3u2e7Gg+ZivBuMN/MrWQJ0ejm/ec3yn8XnxMDxP1E2YoVWtV
         i7kj2tqJtgtOmEqHrBOEuW2KafUEVYHXxAnAOGdyRswz640wqCajTGUYmS+bsZZWKnKQ
         dFSQQ+oA9TNRGJirKgdlvoIOnEX7gfssCSm9tQ3LZsavt/7OR77BdPzc4r8xx2ZX6jCK
         SgXg==
X-Forwarded-Encrypted: i=1; AJvYcCUy3VxeGyzO0j+MsJGiJjslBrmzrZps8xPXLDKLaQ7pULaoa1WclSMfFOH1IZMmg9dzQ0zCWpPFdlYdkKrBmDLdY+nr3RLcL7jLwZFopSk=
X-Gm-Message-State: AOJu0YxOeG+8nT8CQdd+7ECOM4QQ3VKVrM9YOxAWxhjfx4dowCIcFSv3
	cZgUtOhZlqlSrGcSNVIkXggvPtEIqPJH+KDBw57nDhZ5GohNbnMKe0+aiVIFSkO/er8otw5y1ia
	zQU4athA84Tp/2nXdaTF/uDjAcro=
X-Google-Smtp-Source: AGHT+IElojV+Oy0IeWERoJ+hC+Ei2JjYOdmI6eVYEkLIm5YGpXYDRqPBOAh7+bYqCkfdeheZZfe4Ppo3v7lkssiUYzo=
X-Received: by 2002:a05:6214:4287:b0:6bb:8b2e:8e7a with SMTP id
 6a1803df08f44-6bf7d5c47c1mr197599136d6.24.1724081685440; Mon, 19 Aug 2024
 08:34:45 -0700 (PDT)
MIME-Version: 1.0
References: <2b747d672eeadc1150d3b84f0303e1d288311133.1721391876.git.milan.djokic@rt-rk.com>
 <728bb10e944a7ec28a67c2e9e62910632eb2366b.1721758832.git.milandjokic1995@gmail.com>
 <1e898a3c-b881-4ca8-99f0-48f51ed28098@suse.com>
In-Reply-To: <1e898a3c-b881-4ca8-99f0-48f51ed28098@suse.com>
From: =?UTF-8?B?TWlsYW4gxJBva2nEhw==?= <milandjokic1995@gmail.com>
Date: Mon, 19 Aug 2024 17:34:34 +0200
Message-ID: <CAKp59VEM6UWHM1Yu9NToFu9T4GfJpgKiXdAzA096KMVcMRqEsg@mail.gmail.com>
Subject: Re: [PATCH v2] xen: PE/COFF image header
To: Jan Beulich <jbeulich@suse.com>
Cc: oleksii.kurochko@gmail.com, Nikola Jelic <nikola.jelic@rt-rk.com>, 
	"Daniel P. Smith" <dpsmith@apertussolutions.com>, 
	=?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>, 
	Milan Djokic <milan.djokic@rt-rk.com>, xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hello Jan,

On Mon, Jul 29, 2024 at 1:42=E2=80=AFPM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> On 23.07.2024 20:22, Milan Djokic wrote:
> > From: Nikola Jelic <nikola.jelic@rt-rk.com>
> >
> > Added PE/COFF generic image header which shall be used for EFI
> > application format for x86/risc-v. x86 and risc-v source shall be adjus=
ted
> > to use this header in following commits. pe.h header is taken over from
> > linux kernel with minor changes in terms of formatting and structure me=
mber comments.
> > Also, COFF relocation and win cert structures are ommited, since these =
are not relevant for Xen.
> >
> > Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gi=
t 36e4fc57fc16
> >
> > Signed-off-by: Nikola Jelic <nikola.jelic@rt-rk.com>
> > Signed-off-by: Milan Djokic <milan.djokic@rt-rk.com>
>
> This looks okay to me now, but I can't ack it (or more precisely my ack
> wouldn't mean anything). There are a few style issues in comments, but
> leaving them as they are in Linux may be intentional. Just one question,
> more to other maintainers than to you:
>
Are we supposed to CC someone additionally for approval?

> > +#define IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE         0x0040
> > +#define IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY      0x0080
> > +#define IMAGE_DLL_CHARACTERISTICS_NX_COMPAT            0x0100
> > +#define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION          0x0200
> > +#define IMAGE_DLLCHARACTERISTICS_NO_SEH                0x0400
> > +#define IMAGE_DLLCHARACTERISTICS_NO_BIND               0x0800
> > +#define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER            0x2000
> > +#define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000
> > +
> > +#define IMAGE_DLLCHARACTERISTICS_EX_CET_COMPAT         0x0001
> > +#define IMAGE_DLLCHARACTERISTICS_EX_FORWARD_CFI_COMPAT 0x0040
>
> The naming inconsistency (underscore or not after DLL) is somewhat
> unhelpful. Do we maybe want to diverge from what Linux has here? Note
> that e.g. the GNU binutils header has at least a comment there.
>

> What I'm puzzled by is IMAGE_DLLCHARACTERISTICS_EX_FORWARD_CFI_COMPAT
> having the same value as IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE. Are
> these meant to apply to the same field? Or do these values rather
> relate to IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS? Some clarification
> may be needed here, or the two entries may simply want omitting for
> now.
>
These values relate to different fields.
IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE value is related to COFF
optional header, while IMAGE_DLLCHARACTERISTICS_EX_FORWARD_CFI_COMPAT
is related to debug section directory ( when directory type is
IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS as you assumed). Sorry for the
late response on this one, I was off in the past weeks.

BR,
MIlan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 15:39:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 15:39:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779842.1189523 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg4Tu-0004nm-5a; Mon, 19 Aug 2024 15:39:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779842.1189523; Mon, 19 Aug 2024 15:39:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg4Tu-0004nf-2m; Mon, 19 Aug 2024 15:39:42 +0000
Received: by outflank-mailman (input) for mailman id 779842;
 Mon, 19 Aug 2024 15:39:41 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sg4Tt-0004nY-3o
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 15:39:41 +0000
Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com
 [2a00:1450:4864:20::52b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3eddb099-5e41-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 17:39:39 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-58ef19aa69dso4468419a12.3
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 08:39:39 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383947245sm656629566b.179.2024.08.19.08.39.37
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 08:39:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3eddb099-5e41-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724081979; x=1724686779; 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=jp+1se8/GzVkyfESYNKFhWK5PhWBoK/fbmbLbPByNPE=;
        b=f/3iI/ZECpnXYX/yvQsZcJCcnTaot0fgol1tu4o/KhzeuN+Vgrn+SW/tKUcvQYqE8I
         6BGa2/Mt3I1GsZFXeUMO8tbMoa7EE/t1evClFfKrH3dtAlNvK5QcHKFr5fZzmjIXSJEi
         pAGbuk7ucBmfNz2UK2QhETn0RjwD5j6d4PmicdWWEto9y2yQR4REsYdvnhudhOBDZxfO
         1OKO7heiA+4k3rwt+Xd+YKOBeuAFkulin1NSkH77Xg0yg6bBr/TS4MH1W76/zC62hVHa
         apMGL0RhM54K8mg4hl2m08mraMvrlhRvO8h7Ge5KOYEOJ//MqJYvo+Vsctuq2z5dv0zt
         x5AQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724081979; x=1724686779;
        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=jp+1se8/GzVkyfESYNKFhWK5PhWBoK/fbmbLbPByNPE=;
        b=Lev61miUTSoXSm0n/hOdVbqrhgP0kdRQvO7xCRCFmPH5z2lyeCddCwkIC+Ih7yHbA0
         idvI7o0fb1ZM6bHUk92jmGVWG3gQJZ7ubRdaJbB7XirhEOmWpQpTpwNLhuIyfoFM4MwU
         w+6T6uXOhm+Jwp3za2L1HTluUfZRvq/f4PbDL+jEgNPA6tMKjppvQnIdYebkJhBpQ9g+
         Q/RM/lmM+opo2oVwHG+6OwYPr5oDl36whokpVaKjxxIdHUBsGMOC8u5FDur4bK/YCeGY
         J/hZGB4lcHcFk1Tf8aUSWCbkO8qUiIdUJtnPkkdrscRsHkA0Jo4Mot8wUt677WgZUtVd
         aYYg==
X-Forwarded-Encrypted: i=1; AJvYcCUOYWBfmJsuAlVvznpNTd0PW379H4FLqvabvtPEVoLsNQuoqJpqSzOQLVCBmanki19vjrjfEXPRJq2oXp4Fr2r1kZ4MnQ0jX6DKJ77rG+g=
X-Gm-Message-State: AOJu0YwUXcDVh0QP0swgiLX/lHxl/p2NVMo7QNxRer6StoL/U92HunIT
	LXZudQU81KJ4F/tnE1t4ToD525zBn14QBv5qWbcfgkOGMKM6CFHCeH7YNX2F9w==
X-Google-Smtp-Source: AGHT+IF7+xbkgSM5cdBGF06lnO7PYe6rwA8yvHC56n5MRZ73ng+2F0DtNvb5gPNzS5+Jh2MvjoKzLg==
X-Received: by 2002:a17:907:e216:b0:a7a:9f0f:ab17 with SMTP id a640c23a62f3a-a83929544bamr666442266b.32.1724081978464;
        Mon, 19 Aug 2024 08:39:38 -0700 (PDT)
Message-ID: <a84aaeed-6310-42fa-97e9-b391273c0132@suse.com>
Date: Mon, 19 Aug 2024 17:39:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] xen: PE/COFF image header
To: =?UTF-8?B?TWlsYW4gxJBva2nEhw==?= <milandjokic1995@gmail.com>
Cc: oleksii.kurochko@gmail.com, Nikola Jelic <nikola.jelic@rt-rk.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, Milan Djokic <milan.djokic@rt-rk.com>,
 xen-devel@lists.xenproject.org
References: <2b747d672eeadc1150d3b84f0303e1d288311133.1721391876.git.milan.djokic@rt-rk.com>
 <728bb10e944a7ec28a67c2e9e62910632eb2366b.1721758832.git.milandjokic1995@gmail.com>
 <1e898a3c-b881-4ca8-99f0-48f51ed28098@suse.com>
 <CAKp59VEM6UWHM1Yu9NToFu9T4GfJpgKiXdAzA096KMVcMRqEsg@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: <CAKp59VEM6UWHM1Yu9NToFu9T4GfJpgKiXdAzA096KMVcMRqEsg@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 19.08.2024 17:34, Milan Đokić wrote:
> On Mon, Jul 29, 2024 at 1:42 PM Jan Beulich <jbeulich@suse.com> wrote:
>> On 23.07.2024 20:22, Milan Djokic wrote:
>>> From: Nikola Jelic <nikola.jelic@rt-rk.com>
>>>
>>> Added PE/COFF generic image header which shall be used for EFI
>>> application format for x86/risc-v. x86 and risc-v source shall be adjusted
>>> to use this header in following commits. pe.h header is taken over from
>>> linux kernel with minor changes in terms of formatting and structure member comments.
>>> Also, COFF relocation and win cert structures are ommited, since these are not relevant for Xen.
>>>
>>> Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 36e4fc57fc16
>>>
>>> Signed-off-by: Nikola Jelic <nikola.jelic@rt-rk.com>
>>> Signed-off-by: Milan Djokic <milan.djokic@rt-rk.com>
>>
>> This looks okay to me now, but I can't ack it (or more precisely my ack
>> wouldn't mean anything). There are a few style issues in comments, but
>> leaving them as they are in Linux may be intentional. Just one question,
>> more to other maintainers than to you:
>>
> Are we supposed to CC someone additionally for approval?

No, you did Cc the right people afaics. You may want to ping the maintainers,
though.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 15:50:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 15:50:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779855.1189533 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg4e1-00087L-2u; Mon, 19 Aug 2024 15:50:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779855.1189533; Mon, 19 Aug 2024 15:50:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg4e1-00087E-0L; Mon, 19 Aug 2024 15:50:09 +0000
Received: by outflank-mailman (input) for mailman id 779855;
 Mon, 19 Aug 2024 15:50: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=UKSt=PS=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sg4e0-000878-0K
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 15:50:08 +0000
Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com
 [2a00:1450:4864:20::233])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b42428bf-5e42-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 17:50:06 +0200 (CEST)
Received: by mail-lj1-x233.google.com with SMTP id
 38308e7fff4ca-2f3cb747ed7so24909171fa.0
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 08:50:06 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bebbe7f5a7sm5711564a12.76.2024.08.19.08.50.04
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 08:50:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b42428bf-5e42-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724082605; x=1724687405; 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=Po3KThdD7MNVErjQbOPd8Dxie8OQ7fkehxCZAy1gWxM=;
        b=F/asJgNn6nTs+fwH+2u0S4bkn3UY4nJcPkr+lrATQnIXjB4JYrqh2ycK0P9faT0RAA
         cnkymUkoQWabpmahks+OZGot5T3VsVouuOETWcTasRjzgdcOpnkXcn2FZihD7C1z237M
         QM3D6Ih24fkpYf8Mwzo8REzP89TwZHHg173ydSIXUCDoA4ama/fzq9Ioj5O8jxY98E91
         88FObnOzT+O9ieeqx4BuynlyESTZ2Z5B/6mRiCWF2IVJgn5mOAlFuIgjToXx9RNIBCbW
         LPS05/bpGI92y1kTsANBwywqb3617JEkrYDnQrUhmuPHPmo/hgoNKaDC7EoFkhVK5km6
         Cypg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724082605; x=1724687405;
        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=Po3KThdD7MNVErjQbOPd8Dxie8OQ7fkehxCZAy1gWxM=;
        b=rT0gwhwXCE3ZmwKC/vkh2UE5Uc6olrzaX4bsh35pbQBzcQZXzCdvy8HlVEO6q2F4GU
         KfXfaV3GOSwax7NyAOMRXKDQN9difu21f1Ikm4jaIsJZKkmgokpXn5RYcdGItNwLHJ8e
         XPFOURMHXwEmxcHE2gqnXGJfXAux23Gz3820PklriATaZUdlfVNag1aWWQKnfaGkVqmu
         ZDppctBtx77tEsLn0up7/TOhiunAdzqL9/Pu9AVZ8oHzmuVbS64WmBdYrUcOGQGJ3HVy
         6xFe//JCgg/0fO+dhZr0A3wNX4rFKMhwH5mPtlAN5Ud2XUStm49g2SDh0BLw8ZWZUjfX
         LR0Q==
X-Forwarded-Encrypted: i=1; AJvYcCXqGjg2NSeoN7bu3xpPBGMHRfhwQOkYm9m6pyB9JyXpfVUWztdyYX/Poou5/N37YXhx0s7LxHfft20+6XjT1R0jeX5XM6P6Hf7gqxCexI8=
X-Gm-Message-State: AOJu0Yymir8EQkRPPjfP3fKJUOX0E/bdNSfCLUolsnRFKibQ2C4XLkQp
	GSNU9VvrPvTIOWheNOfeK1fFeRZ73bwlkB7pF/WlyZgW47Us+pcLjxHfX/AJcA==
X-Google-Smtp-Source: AGHT+IF87tscRqjFl/EveJoJPLH6RkGRGktHJikUdvVkJPyrxf1XqkKLhZYquT/rFoojBuXvKrDcAQ==
X-Received: by 2002:a05:651c:1063:b0:2f2:9bc2:d573 with SMTP id 38308e7fff4ca-2f3be586baamr69805211fa.15.1724082604647;
        Mon, 19 Aug 2024 08:50:04 -0700 (PDT)
Message-ID: <f5519911-6a3a-468a-98ec-3345339847cd@suse.com>
Date: Mon, 19 Aug 2024 17:50:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/5] x86: Put trampoline in .init.data section
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-2-alejandro.vallejo@cloud.com>
 <ad72cc97-b9dd-4e7e-93f6-333805e40785@suse.com>
 <CACHz=Zh7wK58mbB762fnevHEKW9qhp-NRJ6buNe1b-qLxP0qPg@mail.gmail.com>
 <b9b40658-ff13-4240-98a2-4811411e31b6@suse.com>
 <CACHz=Zj8h-TeDa2Ey8EKKEOpXJqx9MnL+AGpdTBY1B8PZ0==mA@mail.gmail.com>
 <a3d901f9-0a74-4cef-b616-77d338dda314@suse.com>
 <CACHz=ZgCd81NV7yXZ-Lud-QP8sj05mH9N0c-1z=eBv3pz2ENAw@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: <CACHz=ZgCd81NV7yXZ-Lud-QP8sj05mH9N0c-1z=eBv3pz2ENAw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 19.08.2024 17:30, Frediano Ziglio wrote:
> On Mon, Aug 19, 2024 at 3:30 PM Jan Beulich <jbeulich@suse.com> wrote:
>> On 19.08.2024 16:16, Frediano Ziglio wrote:
>>> On Thu, Aug 8, 2024 at 9:54 AM Jan Beulich <jbeulich@suse.com> wrote:
>>>> On 08.08.2024 10:00, Frediano Ziglio wrote:
>>>>> On Thu, Aug 8, 2024 at 8:34 AM Jan Beulich <jbeulich@suse.com> wrote:
>>>>>> On 07.08.2024 15:48, Alejandro Vallejo wrote:
>>>>>>> This change allows to put the trampoline in a separate, not executable
>>>>>>> section. The trampoline contains a mix of code and data (data which
>>>>>>> is modified from C code during early start so must be writable).
>>>>>>> This is in preparation for W^X patch in order to satisfy UEFI CA
>>>>>>> memory mitigation requirements.
>>>>>>
>>>>>> Which, aiui, has the downside of disassembly of the section no longer
>>>>>> happening by default, when using objdump or similar tools, which go from
>>>>>> section attributes. Why is it being in .init.text (and hence RX) not
>>>>>> appropriate? It should - in principle at least - be possible to avoid
>>>>>> all in-place writing to it, but instead only ever write to its relocated
>>>>>> copy. Quite a bit more code churn of course.
>>>>>>
>>>>>> I wonder if we shouldn't put the trampoline in its own section, RWX in
>>>>>> the object file, and switched to whatever appropriate in the binary
>>>>>> (which really may be RX, not RW).
>>>>>
>>>>> We cannot have RWX to satisfy UEFI CA memory mitigation, that's why I
>>>>> had to move it, code sections should not be writeable. We can mark
>>>>> either RX or RW but we use the data very early so we are not able to
>>>>> change the permissions (we can try with all complications that this
>>>>> could bring like how to report an error at so early stages).
>>>>
>>>> The early writing could be done away with, as indicated. There's not
>>>> really any strict requirement to write to the trampoline region within
>>>> the Xen image. All updates to it could in principle be done after it
>>>> was copied into low memory. Then (and of course only then) could it be
>>>> part of an RX section in the image, maybe .init.text, maybe a separate
>>>> .trampoline section.
>>>
>>>    how strong are you on this? Is this "objdump" thing such a big
>>> issue? The code contains a lot of 16 bit code which would require
>>> additional options anyway. Won't be an assembly listing output more
>>> helpful instead?
>>
>> Well. Whether a listing can serve as a stand-in depends on the situation.
>> Not being able to disassemble code (e.g. also in the final executable)
>> can be pretty limiting. The need to pass extra options is related, but
>> not really an argument against.
> 
> If some code is inside some data section (in the final binary) you can
> use -D option to disassemble everything, even data. For instance a
> "objdump -D xen-syms -m i8086" and look for some "trampoline" symbols.
> Yes, the output of -D is surely longer than -d.

Well, no, I surely don't want to disassemble all data. Based on what I've
observed in the past, I also wouldn't be surprised if objdump didn't get
utterly confused by disassembling data, perhaps to the point of crashing.

>>> Could I ouput the trampoline in a code section ("ax" instead of "aw")
>>> and then later move it into .init.data section assuring .init.data is
>>> writeable but not executable?
>>
>> Could you go into a little more detail on what you mean here? At the
>> first glance my reaction is "yes, sure, why not", but much depends on
>> what exactly is meant.
> 
> For instance you could put the trampoline into a
>     .section .init.trampoline, "awx", @progbits
> section (having the "x" will be disassembled by objdump -d head.o).
> Then in xen/arch/x86/xen.lds.S in the .init.data section having something like
> ...
>   DECL_SECTION(.init.data) {
>        *(.init.bss.stack_aligned)
>       (.init.trampoline)
>    ...
> this will put the trampoline in .init.data section of the final
> object. At this point the .init.data containing code will have execute
> permission that you would have to fix using objcopy command.
> The final trampoline will be in a data section not executable so to
> use objdump you will need the -D option, but not disassembling head.o.
> In theory we could keep the temporary object file before the objcopy
> adjustment to avoid the -D but I don't think it would save a lot of
> burdain.

Part of my "want to be able to disassemble" also applies to the final
binaries. Since iirc one can disassemble individual sections, an option
may be to have .trampoline be its own section even in the final (PE)
binary?

In any event, especially as long as there is no really good option, I
think I'd like to have input from Andrew and/or Roger as well.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 16:58:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 16:58:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779875.1189543 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg5hU-0002uu-Oj; Mon, 19 Aug 2024 16:57:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779875.1189543; Mon, 19 Aug 2024 16:57:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg5hU-0002un-M4; Mon, 19 Aug 2024 16:57:48 +0000
Received: by outflank-mailman (input) for mailman id 779875;
 Mon, 19 Aug 2024 16:57:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sg5hT-0002ud-80; Mon, 19 Aug 2024 16:57:47 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sg5hT-0000Lt-0T; Mon, 19 Aug 2024 16:57:47 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sg5hS-0001my-ES; Mon, 19 Aug 2024 16:57:46 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sg5hS-0006tD-E2; Mon, 19 Aug 2024 16:57:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=kai/8VsxY/ZFAry9wGNgQTd0DdH5vtiUmpectufambQ=; b=RLM3sUkzHvxaW5FRsR5jb0ubYq
	LAT0+R9g4+NRaxjHArfeFL/7V3dS+X8NGzR7/Zq2nSP9TjQeaqdhDBM0NRI7KrrdZH3VFAtjvk62E
	7RAM3EgWzVboS2IL/5JqGSFG1sBaXdUqJF1Ghn/xwltNJmAfOHg8ZNhc2TgZajkgY1hk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187284-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187284: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=a30d438ce58b70c5955f5d37f776086ab8f88623
X-Osstest-Versions-That:
    xen=1e2a5f991f86979b89aa9a60ca3ba8106ee7d987
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 19 Aug 2024 16:57:46 +0000

flight 187284 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187284/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  a30d438ce58b70c5955f5d37f776086ab8f88623
baseline version:
 xen                  1e2a5f991f86979b89aa9a60ca3ba8106ee7d987

Last test of basis   187258  2024-08-17 00:00:24 Z    2 days
Testing same since   187284  2024-08-19 14:03:56 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Jan Beulich <jbeulich@suse.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   1e2a5f991f..a30d438ce5  a30d438ce58b70c5955f5d37f776086ab8f88623 -> smoke


From xen-devel-bounces@lists.xenproject.org Mon Aug 19 17:27:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 17:27:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779894.1189554 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg69y-0007su-Vs; Mon, 19 Aug 2024 17:27:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779894.1189554; Mon, 19 Aug 2024 17:27:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg69y-0007sn-Sg; Mon, 19 Aug 2024 17:27:14 +0000
Received: by outflank-mailman (input) for mailman id 779894;
 Mon, 19 Aug 2024 17:27:13 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=tytA=PS=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sg69w-0007sh-Uu
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 17:27:13 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4454ae23-5e50-11ef-8776-851b0ebba9a2;
 Mon, 19 Aug 2024 19:27:10 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-530e2548dfdso5183705e87.1
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 10:27:10 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5330d4202eesm1540951e87.234.2024.08.19.10.27.08
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 19 Aug 2024 10:27:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4454ae23-5e50-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724088430; x=1724693230; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=ePcc3HSkV/+MVCEzTvMEauF8O7zAhXUWwoTUhvISUKU=;
        b=BTgTsS01NpWZjIMfnwlpA+yKvfSChwkue7CSkuRLAXu+OTLt0gem1OipcP3KXyeLey
         +NvpZfr4bgf1q80bRID3f3UOici096FCZyKefT6tRjUh0LpvKXRvaS8B4ekEUPycJOS5
         sBTHDGrRPPTAYQ0mGW07uyXM7FeLBfI/yyZ4tX8Tk0gWttUg1/758H4ga/671F9zfROl
         35td8PDivkBuIuLMP8jLSiidMO1LrOe3+lzLtbIxWF/ns2e2n39tSvuSGuBmrJK+IB+6
         LpRKz5U+9QqfELhv52yj/+hjao19505O2c/7K/lHBzb12AlVB3ZFl8KA4w6l2Fr2UG08
         eUog==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724088430; x=1724693230;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=ePcc3HSkV/+MVCEzTvMEauF8O7zAhXUWwoTUhvISUKU=;
        b=lCVQVnYz/VM/IWH6gpqRwZyYkZ1nHO6x3hnfUjqhSEbZvOT8LJTJO/5j3MJihGGJao
         uJI2KW/e+//+9Y3moBBgvzUAuHcGEDIToLBoilFAQZ53xIx+JZooIbH1bepEuMSHJhzP
         9aUD9RqNbZPHIU4ztD00WXOrUqdnI1IsRjv1SnwbJnsdc0HBjV88ygkuNx2HqG89GurV
         afEbGOEjLNJc1GPB/jbmm3YpEzGQZIfbyTX2KX+vhQotiktJTMZ8qhJPU1U7k8HvwOp5
         Dktg3z08iFVT6rq0Qp1MOslThXtTAN2YI7zSiBYZdd/q1G7JX69P1iBb4pVsFLU8Glvw
         sqZg==
X-Forwarded-Encrypted: i=1; AJvYcCUSvNM8OcpmjARJFFIYHsg1knKbyHavqMXx44Byq9YyU9svTzprFexo1UV175Tr5wktl+1SWGckLQO7kgSZ0OExTIYasilGxaU95Z6AmXg=
X-Gm-Message-State: AOJu0YyX88vtDCWOzyCD8+8EwEoiab5sfjlD8UodbS4tUhGfNkoedyfI
	+bx9SjASOfV8HiKYwK9txNfIUUoawVoFN879IjdRE77OgQCxo/ts
X-Google-Smtp-Source: AGHT+IE52dLgw2Zo8feikyg1YM1nS6oVLorjWAuRXldAx/C55ifaK1TlWL0E6EDqWnqtLLAvCc1rqw==
X-Received: by 2002:a05:6512:1081:b0:52f:eb:aaca with SMTP id 2adb3069b0e04-5332df4e639mr4987141e87.32.1724088429533;
        Mon, 19 Aug 2024 10:27:09 -0700 (PDT)
Message-ID: <b68e99462e76449f9cb7d6fb5384c41518588b4a.camel@gmail.com>
Subject: Re: [PATCH v2] xen: PE/COFF image header
From: oleksii.kurochko@gmail.com
To: Milan Djokic <milandjokic1995@gmail.com>, xen-devel@lists.xenproject.org
Cc: Nikola Jelic <nikola.jelic@rt-rk.com>, "Daniel P. Smith"
 <dpsmith@apertussolutions.com>, Marek
 =?ISO-8859-1?Q?Marczykowski-G=F3recki?= <marmarek@invisiblethingslab.com>,
 Jan Beulich <jbeulich@suse.com>, Milan Djokic <milan.djokic@rt-rk.com>
Date: Mon, 19 Aug 2024 19:27:08 +0200
In-Reply-To: <728bb10e944a7ec28a67c2e9e62910632eb2366b.1721758832.git.milandjokic1995@gmail.com>
References: 
	<2b747d672eeadc1150d3b84f0303e1d288311133.1721391876.git.milan.djokic@rt-rk.com>
	 <728bb10e944a7ec28a67c2e9e62910632eb2366b.1721758832.git.milandjokic1995@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: base64
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

T24gVHVlLCAyMDI0LTA3LTIzIGF0IDIwOjIyICswMjAwLCBNaWxhbiBEam9raWMgd3JvdGU6Cj4g
RnJvbTogTmlrb2xhIEplbGljIDxuaWtvbGEuamVsaWNAcnQtcmsuY29tPgo+IAo+IEFkZGVkIFBF
L0NPRkYgZ2VuZXJpYyBpbWFnZSBoZWFkZXIgd2hpY2ggc2hhbGwgYmUgdXNlZCBmb3IgRUZJCj4g
YXBwbGljYXRpb24gZm9ybWF0IGZvciB4ODYvcmlzYy12LiB4ODYgYW5kIHJpc2MtdiBzb3VyY2Ug
c2hhbGwgYmUKPiBhZGp1c3RlZAo+IHRvIHVzZSB0aGlzIGhlYWRlciBpbiBmb2xsb3dpbmcgY29t
bWl0cy4gcGUuaCBoZWFkZXIgaXMgdGFrZW4gb3Zlcgo+IGZyb20KPiBsaW51eCBrZXJuZWwgd2l0
aCBtaW5vciBjaGFuZ2VzIGluIHRlcm1zIG9mIGZvcm1hdHRpbmcgYW5kIHN0cnVjdHVyZQo+IG1l
bWJlciBjb21tZW50cy4KPiBBbHNvLCBDT0ZGIHJlbG9jYXRpb24gYW5kIHdpbiBjZXJ0IHN0cnVj
dHVyZXMgYXJlIG9tbWl0ZWQsIHNpbmNlCj4gdGhlc2UgYXJlIG5vdCByZWxldmFudCBmb3IgWGVu
Lgo+IAo+IE9yaWdpbjoKPiBnaXQ6Ly9naXQua2VybmVsLm9yZy9wdWIvc2NtL2xpbnV4L2tlcm5l
bC9naXQvdG9ydmFsZHMvbGludXguZ2l0Cj4gMzZlNGZjNTdmYzE2Cj4gCj4gU2lnbmVkLW9mZi1i
eTogTmlrb2xhIEplbGljIDxuaWtvbGEuamVsaWNAcnQtcmsuY29tPgo+IFNpZ25lZC1vZmYtYnk6
IE1pbGFuIERqb2tpYyA8bWlsYW4uZGpva2ljQHJ0LXJrLmNvbT4KTEdUTTogUmV2aWV3ZWQtYnk6
IE9sZWtzaWkgS3Vyb2Noa28gPG9sZWtzaWkua3Vyb2Noa29AZ21haWwuY29tPgoKfiBPbGVrc2lp
Cgo+IC0tLQo+IFRoaXMgaGVhZGVyIGlzIHNwbGl0IGludG8gYSBzZXBhcmF0ZSBjb21taXQgZm9s
bG93aW5nIGRpc2N1c3Npb24KPiBmcm9taHR0cHM6Ly9saXN0cy54ZW5wcm9qZWN0Lm9yZy9hcmNo
aXZlcy9odG1sL3hlbi1kZXZlbC8yMDI0LTA3L21zZzAwMTY2Lmh0bWwKPiBVcGNvbWluZyBjb21t
aXQgc2hhbGwgbW9kaWZ5IHg4NiBpbXBsZW1lbnRhdGlvbiB0byB1c2UgdGhpcyBoZWFkZXIKPiBp
bnN0ZWFkIG9mIGludGVybmFsIHN0cnVjdHVyZXMuCj4gLS0tCj4gQ2hhbmdlcyBpbiBWMjoKPiDC
oCAtIEZpeGVkIGhlYWRlciBmb3JtYXR0aW5nIGFuZCBzb21lIHN0cnVjdHVyZSBtZW1iZXIgbmFt
ZXMvY29tbWVudHMKPiDCoCAtIFJlbW92ZWQgbGludXgga2VybmVsIHNwZWNpZmljIG1hY3JvcyAo
RUZJIHN0dWIgdmVyc2lvbiwgbGludXggcGUKPiBtYWdpYykKPiDCoCAtIFJlbW92ZWQgZHVwbGlj
YXRlZCB2YWx1ZXMKPiDCoCAtIFJlbW92ZWQgQ09GRiByZWxvY2F0aW9uIGFuZCB3aW4gY2VydCBz
dHJ1Y3R1cmVzIHdoaWNoIGFyZSBub3QKPiByZWxldmFudCBmb3IgWGVuCj4gLS0tCj4gwqB4ZW4v
aW5jbHVkZS9lZmkvcGUuaCB8IDI5MQo+ICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr
KysrKysrKysrKysKPiDCoDEgZmlsZSBjaGFuZ2VkLCAyOTEgaW5zZXJ0aW9ucygrKQo+IMKgY3Jl
YXRlIG1vZGUgMTAwNjQ0IHhlbi9pbmNsdWRlL2VmaS9wZS5oCj4gCj4gZGlmZiAtLWdpdCBhL3hl
bi9pbmNsdWRlL2VmaS9wZS5oIGIveGVuL2luY2x1ZGUvZWZpL3BlLmgKPiBuZXcgZmlsZSBtb2Rl
IDEwMDY0NAo+IGluZGV4IDAwMDAwMDAwMDAuLjY0ZTA0N2U4OGIKPiAtLS0gL2Rldi9udWxsCj4g
KysrIGIveGVuL2luY2x1ZGUvZWZpL3BlLmgKPiBAQCAtMCwwICsxLDI5MSBAQAo+ICsvKiBTUERY
LUxpY2Vuc2UtSWRlbnRpZmllcjogR1BMLTIuMC1vbmx5ICovCj4gKy8qCj4gKyAqIENvcHlyaWdo
dCAyMDExIFJlZCBIYXQsIEluYy4KPiArICogQWxsIHJpZ2h0cyByZXNlcnZlZC4KPiArICoKPiAr
ICogQXV0aG9yKHMpOiBQZXRlciBKb25lcyA8cGpvbmVzQHJlZGhhdC5jb20+Cj4gKyAqLwo+ICsj
aWZuZGVmIEVGSV9fUEVfSAo+ICsjZGVmaW5lIEVGSV9fUEVfSAo+ICsKPiArI2RlZmluZSBNWl9N
QUdJQyAweDVhNGQgLyogIk1aIiAqLwo+ICsKPiArI2RlZmluZSBQRV9NQUdJQ8KgwqDCoMKgwqDC
oMKgwqDCoMKgwqDCoMKgIDB4MDAwMDQ1NTAgLyogIlBFXDBcMCIgKi8KPiArI2RlZmluZSBQRV9P
UFRfTUFHSUNfUEUzMsKgwqDCoMKgIDB4MDEwYgo+ICsjZGVmaW5lIFBFX09QVF9NQUdJQ19QRTMy
X1JPTSAweDAxMDcKPiArI2RlZmluZSBQRV9PUFRfTUFHSUNfUEUzMlBMVVMgMHgwMjBiCj4gKwo+
ICsvKiBtYWNoaW5lIHR5cGUgKi8KPiArI2RlZmluZSBJTUFHRV9GSUxFX01BQ0hJTkVfVU5LTk9X
TsKgwqDCoMKgIDB4MDAwMAo+ICsjZGVmaW5lIElNQUdFX0ZJTEVfTUFDSElORV9BTTMzwqDCoMKg
wqDCoMKgwqAgMHgwMWQzCj4gKyNkZWZpbmUgSU1BR0VfRklMRV9NQUNISU5FX0FNRDY0wqDCoMKg
wqDCoMKgIDB4ODY2NAo+ICsjZGVmaW5lIElNQUdFX0ZJTEVfTUFDSElORV9BUk3CoMKgwqDCoMKg
wqDCoMKgIDB4MDFjMAo+ICsjZGVmaW5lIElNQUdFX0ZJTEVfTUFDSElORV9BUk1WN8KgwqDCoMKg
wqDCoCAweDAxYzQKPiArI2RlZmluZSBJTUFHRV9GSUxFX01BQ0hJTkVfQVJNNjTCoMKgwqDCoMKg
wqAgMHhhYTY0Cj4gKyNkZWZpbmUgSU1BR0VfRklMRV9NQUNISU5FX0VCQ8KgwqDCoMKgwqDCoMKg
wqAgMHgwZWJjCj4gKyNkZWZpbmUgSU1BR0VfRklMRV9NQUNISU5FX0kzODbCoMKgwqDCoMKgwqDC
oCAweDAxNGMKPiArI2RlZmluZSBJTUFHRV9GSUxFX01BQ0hJTkVfSUE2NMKgwqDCoMKgwqDCoMKg
IDB4MDIwMAo+ICsjZGVmaW5lIElNQUdFX0ZJTEVfTUFDSElORV9NMzJSwqDCoMKgwqDCoMKgwqAg
MHg5MDQxCj4gKyNkZWZpbmUgSU1BR0VfRklMRV9NQUNISU5FX01JUFMxNsKgwqDCoMKgwqAgMHgw
MjY2Cj4gKyNkZWZpbmUgSU1BR0VfRklMRV9NQUNISU5FX01JUFNGUFXCoMKgwqDCoCAweDAzNjYK
PiArI2RlZmluZSBJTUFHRV9GSUxFX01BQ0hJTkVfTUlQU0ZQVTE2wqDCoCAweDA0NjYKPiArI2Rl
ZmluZSBJTUFHRV9GSUxFX01BQ0hJTkVfUE9XRVJQQ8KgwqDCoMKgIDB4MDFmMAo+ICsjZGVmaW5l
IElNQUdFX0ZJTEVfTUFDSElORV9QT1dFUlBDRlDCoMKgIDB4MDFmMQo+ICsjZGVmaW5lIElNQUdF
X0ZJTEVfTUFDSElORV9SNDAwMMKgwqDCoMKgwqDCoCAweDAxNjYKPiArI2RlZmluZSBJTUFHRV9G
SUxFX01BQ0hJTkVfUklTQ1YzMsKgwqDCoMKgIDB4NTAzMgo+ICsjZGVmaW5lIElNQUdFX0ZJTEVf
TUFDSElORV9SSVNDVjY0wqDCoMKgwqAgMHg1MDY0Cj4gKyNkZWZpbmUgSU1BR0VfRklMRV9NQUNI
SU5FX1JJU0NWMTI4wqDCoMKgIDB4NTEyOAo+ICsjZGVmaW5lIElNQUdFX0ZJTEVfTUFDSElORV9T
SDPCoMKgwqDCoMKgwqDCoMKgIDB4MDFhMgo+ICsjZGVmaW5lIElNQUdFX0ZJTEVfTUFDSElORV9T
SDNEU1DCoMKgwqDCoMKgIDB4MDFhMwo+ICsjZGVmaW5lIElNQUdFX0ZJTEVfTUFDSElORV9TSDNF
wqDCoMKgwqDCoMKgwqAgMHgwMWE0Cj4gKyNkZWZpbmUgSU1BR0VfRklMRV9NQUNISU5FX1NINMKg
wqDCoMKgwqDCoMKgwqAgMHgwMWE2Cj4gKyNkZWZpbmUgSU1BR0VfRklMRV9NQUNISU5FX1NINcKg
wqDCoMKgwqDCoMKgwqAgMHgwMWE4Cj4gKyNkZWZpbmUgSU1BR0VfRklMRV9NQUNISU5FX1RIVU1C
wqDCoMKgwqDCoMKgIDB4MDFjMgo+ICsjZGVmaW5lIElNQUdFX0ZJTEVfTUFDSElORV9XQ0VNSVBT
VjLCoMKgIDB4MDE2OQo+ICsjZGVmaW5lIElNQUdFX0ZJTEVfTUFDSElORV9MT09OR0FSQ0gzMiAw
eDYyMzIKPiArI2RlZmluZSBJTUFHRV9GSUxFX01BQ0hJTkVfTE9PTkdBUkNINjQgMHg2MjY0Cj4g
Kwo+ICsvKiBmbGFncyAqLwo+ICsjZGVmaW5lIElNQUdFX0ZJTEVfUkVMT0NTX1NUUklQUEVEwqDC
oMKgwqDCoMKgwqDCoCAweDAwMDEKPiArI2RlZmluZSBJTUFHRV9GSUxFX0VYRUNVVEFCTEVfSU1B
R0XCoMKgwqDCoMKgwqDCoCAweDAwMDIKPiArI2RlZmluZSBJTUFHRV9GSUxFX0xJTkVfTlVNU19T
VFJJUFBFRMKgwqDCoMKgwqAgMHgwMDA0Cj4gKyNkZWZpbmUgSU1BR0VfRklMRV9MT0NBTF9TWU1T
X1NUUklQUEVEwqDCoMKgwqAgMHgwMDA4Cj4gKyNkZWZpbmUgSU1BR0VfRklMRV9BR0dSRVNTSVZF
X1dTX1RSSU3CoMKgwqDCoMKgIDB4MDAxMAo+ICsjZGVmaW5lIElNQUdFX0ZJTEVfTEFSR0VfQURE
UkVTU19BV0FSRcKgwqDCoMKgIDB4MDAyMAo+ICsjZGVmaW5lIElNQUdFX0ZJTEVfMTZCSVRfTUFD
SElORcKgwqDCoMKgwqDCoMKgwqDCoMKgIDB4MDA0MAo+ICsjZGVmaW5lIElNQUdFX0ZJTEVfQllU
RVNfUkVWRVJTRURfTE/CoMKgwqDCoMKgwqAgMHgwMDgwCj4gKyNkZWZpbmUgSU1BR0VfRklMRV8z
MkJJVF9NQUNISU5FwqDCoMKgwqDCoMKgwqDCoMKgwqAgMHgwMTAwCj4gKyNkZWZpbmUgSU1BR0Vf
RklMRV9ERUJVR19TVFJJUFBFRMKgwqDCoMKgwqDCoMKgwqDCoCAweDAyMDAKPiArI2RlZmluZSBJ
TUFHRV9GSUxFX1JFTU9WQUJMRV9SVU5fRlJPTV9TV0FQIDB4MDQwMAo+ICsjZGVmaW5lIElNQUdF
X0ZJTEVfTkVUX1JVTl9GUk9NX1NXQVDCoMKgwqDCoMKgwqAgMHgwODAwCj4gKyNkZWZpbmUgSU1B
R0VfRklMRV9TWVNURU3CoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIDB4MTAwMAo+
ICsjZGVmaW5lIElNQUdFX0ZJTEVfRExMwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC
oMKgwqDCoCAweDIwMDAKPiArI2RlZmluZSBJTUFHRV9GSUxFX1VQX1NZU1RFTV9PTkxZwqDCoMKg
wqDCoMKgwqDCoMKgIDB4NDAwMAo+ICsjZGVmaW5lIElNQUdFX0ZJTEVfQllURVNfUkVWRVJTRURf
SEnCoMKgwqDCoMKgwqAgMHg4MDAwCj4gKwo+ICsjZGVmaW5lIElNQUdFX1NVQlNZU1RFTV9VTktO
T1dOwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgMAo+ICsjZGVmaW5lIElNQUdFX1NV
QlNZU1RFTV9OQVRJVkXCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIDEKPiArI2Rl
ZmluZSBJTUFHRV9TVUJTWVNURU1fV0lORE9XU19HVUnCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAg
Mgo+ICsjZGVmaW5lIElNQUdFX1NVQlNZU1RFTV9XSU5ET1dTX0NVScKgwqDCoMKgwqDCoMKgwqDC
oMKgwqDCoCAzCj4gKyNkZWZpbmUgSU1BR0VfU1VCU1lTVEVNX1BPU0lYX0NVScKgwqDCoMKgwqDC
oMKgwqDCoMKgwqDCoMKgwqAgNwo+ICsjZGVmaW5lIElNQUdFX1NVQlNZU1RFTV9XSU5ET1dTX0NF
X0dVScKgwqDCoMKgwqDCoMKgwqDCoCA5Cj4gKyNkZWZpbmUgSU1BR0VfU1VCU1lTVEVNX0VGSV9B
UFBMSUNBVElPTsKgwqDCoMKgwqDCoMKgwqAgMTAKPiArI2RlZmluZSBJTUFHRV9TVUJTWVNURU1f
RUZJX0JPT1RfU0VSVklDRV9EUklWRVIgMTEKPiArI2RlZmluZSBJTUFHRV9TVUJTWVNURU1fRUZJ
X1JVTlRJTUVfRFJJVkVSwqDCoMKgwqDCoCAxMgo+ICsjZGVmaW5lIElNQUdFX1NVQlNZU1RFTV9F
RklfUk9NX0lNQUdFwqDCoMKgwqDCoMKgwqDCoMKgwqAgMTMKPiArI2RlZmluZSBJTUFHRV9TVUJT
WVNURU1fWEJPWMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIDE0Cj4gKwo+
ICsjZGVmaW5lIElNQUdFX0RMTF9DSEFSQUNURVJJU1RJQ1NfRFlOQU1JQ19CQVNFwqDCoMKgwqDC
oMKgwqDCoCAweDAwNDAKPiArI2RlZmluZSBJTUFHRV9ETExfQ0hBUkFDVEVSSVNUSUNTX0ZPUkNF
X0lOVEVHUklUWcKgwqDCoMKgwqAgMHgwMDgwCj4gKyNkZWZpbmUgSU1BR0VfRExMX0NIQVJBQ1RF
UklTVElDU19OWF9DT01QQVTCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIDB4MDEwMAo+ICsjZGVmaW5l
IElNQUdFX0RMTENIQVJBQ1RFUklTVElDU19OT19JU09MQVRJT07CoMKgwqDCoMKgwqDCoMKgwqAg
MHgwMjAwCj4gKyNkZWZpbmUgSU1BR0VfRExMQ0hBUkFDVEVSSVNUSUNTX05PX1NFSMKgwqDCoMKg
wqDCoMKgwqDCoMKgwqDCoMKgwqDCoCAweDA0MDAKPiArI2RlZmluZSBJTUFHRV9ETExDSEFSQUNU
RVJJU1RJQ1NfTk9fQklORMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgMHgwODAwCj4gKyNk
ZWZpbmUgSU1BR0VfRExMQ0hBUkFDVEVSSVNUSUNTX1dETV9EUklWRVLCoMKgwqDCoMKgwqDCoMKg
wqDCoMKgIDB4MjAwMAo+ICsjZGVmaW5lIElNQUdFX0RMTENIQVJBQ1RFUklTVElDU19URVJNSU5B
TF9TRVJWRVJfQVdBUkUgMHg4MDAwCj4gKwo+ICsjZGVmaW5lIElNQUdFX0RMTENIQVJBQ1RFUklT
VElDU19FWF9DRVRfQ09NUEFUwqDCoMKgwqDCoMKgwqDCoCAweDAwMDEKPiArI2RlZmluZSBJTUFH
RV9ETExDSEFSQUNURVJJU1RJQ1NfRVhfRk9SV0FSRF9DRklfQ09NUEFUIDB4MDA0MAo+ICsKPiAr
LyogdGhleSBhY3R1YWxseSBkZWZpbmVkIDB4MDAwMDAwMDAgYXMgd2VsbCwgYnV0IEkgdGhpbmsg
d2UnbGwgc2tpcAo+IHRoYXQgb25lLiAqLwo+ICsjZGVmaW5lIElNQUdFX1NDTl9SRVNFUlZFRF8w
wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIDB4MDAwMDAwMDEKPiArI2RlZmluZSBJTUFHRV9TQ05f
UkVTRVJWRURfMcKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCAweDAwMDAwMDAyCj4gKyNkZWZpbmUg
SU1BR0VfU0NOX1JFU0VSVkVEXzLCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgMHgwMDAwMDAwNAo+
ICsjZGVmaW5lIElNQUdFX1NDTl9UWVBFX05PX1BBRMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgMHgw
MDAwMDAwOCAvKiBkb24ndCBwYWQgLQo+IG9ic29sZXRlICovCj4gKyNkZWZpbmUgSU1BR0VfU0NO
X1JFU0VSVkVEXzPCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgMHgwMDAwMDAxMAo+ICsjZGVmaW5l
IElNQUdFX1NDTl9DTlRfQ09ERcKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgMHgwMDAwMDAy
MCAvKiAudGV4dCAqLwo+ICsjZGVmaW5lIElNQUdFX1NDTl9DTlRfSU5JVElBTElaRURfREFUQcKg
wqAgMHgwMDAwMDA0MCAvKiAuZGF0YSAqLwo+ICsjZGVmaW5lIElNQUdFX1NDTl9DTlRfVU5JTklU
SUFMSVpFRF9EQVRBIDB4MDAwMDAwODAgLyogLmJzcyAqLwo+ICsjZGVmaW5lIElNQUdFX1NDTl9M
TktfT1RIRVLCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCAweDAwMDAwMTAwIC8qIHJlc2VydmVk
ICovCj4gKyNkZWZpbmUgSU1BR0VfU0NOX0xOS19JTkZPwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKg
wqDCoCAweDAwMDAwMjAwIC8qIC5kcmVjdHZlCj4gY29tbWVudHMgKi8KPiArI2RlZmluZSBJTUFH
RV9TQ05fUkVTRVJWRURfNMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCAweDAwMDAwNDAwCj4gKyNk
ZWZpbmUgSU1BR0VfU0NOX0xOS19SRU1PVkXCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgMHgwMDAw
MDgwMCAvKiAubyBvbmx5IC0gc2NuCj4gdG8gYmUgcm0nZCovCj4gKyNkZWZpbmUgSU1BR0VfU0NO
X0xOS19DT01EQVTCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgMHgwMDAwMTAwMCAvKiAubyBvbmx5
IC0KPiBDT01EQVQgZGF0YSAqLwo+ICsjZGVmaW5lIElNQUdFX1NDTl9SRVNFUlZFRF81wqDCoMKg
wqDCoMKgwqDCoMKgwqDCoMKgIDB4MDAwMDIwMDAgLyogc3BlYyBvbWl0cwo+IHRoaXMgKi8KPiAr
I2RlZmluZSBJTUFHRV9TQ05fUkVTRVJWRURfNsKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCAweDAw
MDA0MDAwIC8qIHNwZWMgb21pdHMKPiB0aGlzICovCj4gKyNkZWZpbmUgSU1BR0VfU0NOX0dQUkVM
wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCAweDAwMDA4MDAwIC8qIGdsb2JhbAo+
IHBvaW50ZXIgcmVmZXJlbmNlZCBkYXRhICovCj4gKy8qIHNwZWMgbGlzdHMgMHgyMDAwMCB0d2lj
ZSwgSSBzdXNwZWN0IHRoZXkgbWVhbnQgMHgxMDAwMCBmb3Igb25lIG9mCj4gdGhlbSAqLwo+ICsj
ZGVmaW5lIElNQUdFX1NDTl9NRU1fUFVSR0VBQkxFIDB4MDAwMTAwMDAgLyogcmVzZXJ2ZWQgZm9y
ICJmdXR1cmUiCj4gdXNlICovCj4gKyNkZWZpbmUgSU1BR0VfU0NOXzE2QklUwqDCoMKgwqDCoMKg
wqDCoCAweDAwMDIwMDAwIC8qIHJlc2VydmVkIGZvciAiZnV0dXJlIgo+IHVzZSAqLwo+ICsjZGVm
aW5lIElNQUdFX1NDTl9MT0NLRUTCoMKgwqDCoMKgwqDCoCAweDAwMDQwMDAwIC8qIHJlc2VydmVk
IGZvciAiZnV0dXJlIgo+IHVzZSAqLwo+ICsjZGVmaW5lIElNQUdFX1NDTl9QUkVMT0FEwqDCoMKg
wqDCoMKgIDB4MDAwODAwMDAgLyogcmVzZXJ2ZWQgZm9yICJmdXR1cmUiCj4gdXNlICovCj4gKy8q
IGFuZCBoZXJlIHRoZXkganVzdCBzdHVjayBhIDEtbmliYmxlIGludGVnZXIgaW4gdGhlIG1pZGRs
ZSBvZiBhCj4gYml0ZmllbGQgKi8KPiArI2RlZmluZSBJTUFHRV9TQ05fQUxJR05fMUJZVEVTwqDC
oMKgIDB4MDAxMDAwMDAgLyogaXQgZG9lcyB3aGF0IGl0IHNheXMKPiBvbiB0aGUgYm94ICovCj4g
KyNkZWZpbmUgSU1BR0VfU0NOX0FMSUdOXzJCWVRFU8KgwqDCoCAweDAwMjAwMDAwCj4gKyNkZWZp
bmUgSU1BR0VfU0NOX0FMSUdOXzRCWVRFU8KgwqDCoCAweDAwMzAwMDAwCj4gKyNkZWZpbmUgSU1B
R0VfU0NOX0FMSUdOXzhCWVRFU8KgwqDCoCAweDAwNDAwMDAwCj4gKyNkZWZpbmUgSU1BR0VfU0NO
X0FMSUdOXzE2QllURVPCoMKgIDB4MDA1MDAwMDAKPiArI2RlZmluZSBJTUFHRV9TQ05fQUxJR05f
MzJCWVRFU8KgwqAgMHgwMDYwMDAwMAo+ICsjZGVmaW5lIElNQUdFX1NDTl9BTElHTl82NEJZVEVT
wqDCoCAweDAwNzAwMDAwCj4gKyNkZWZpbmUgSU1BR0VfU0NOX0FMSUdOXzEyOEJZVEVTwqAgMHgw
MDgwMDAwMAo+ICsjZGVmaW5lIElNQUdFX1NDTl9BTElHTl8yNTZCWVRFU8KgIDB4MDA5MDAwMDAK
PiArI2RlZmluZSBJTUFHRV9TQ05fQUxJR05fNTEyQllURVPCoCAweDAwYTAwMDAwCj4gKyNkZWZp
bmUgSU1BR0VfU0NOX0FMSUdOXzEwMjRCWVRFUyAweDAwYjAwMDAwCj4gKyNkZWZpbmUgSU1BR0Vf
U0NOX0FMSUdOXzIwNDhCWVRFUyAweDAwYzAwMDAwCj4gKyNkZWZpbmUgSU1BR0VfU0NOX0FMSUdO
XzQwOTZCWVRFUyAweDAwZDAwMDAwCj4gKyNkZWZpbmUgSU1BR0VfU0NOX0FMSUdOXzgxOTJCWVRF
UyAweDAwZTAwMDAwCj4gKyNkZWZpbmUgSU1BR0VfU0NOX0xOS19OUkVMT0NfT1ZGTCAweDAxMDAw
MDAwIC8qIGV4dGVuZGVkIHJlbG9jYXRpb25zCj4gKi8KPiArI2RlZmluZSBJTUFHRV9TQ05fTUVN
X0RJU0NBUkRBQkxFIDB4MDIwMDAwMDAgLyogc2NuIGNhbiBiZSBkaXNjYXJkZWQKPiAqLwo+ICsj
ZGVmaW5lIElNQUdFX1NDTl9NRU1fTk9UX0NBQ0hFRMKgIDB4MDQwMDAwMDAgLyogY2Fubm90IGJl
IGNhY2hlZCAqLwo+ICsjZGVmaW5lIElNQUdFX1NDTl9NRU1fTk9UX1BBR0VEwqDCoCAweDA4MDAw
MDAwIC8qIG5vdCBwYWdlYWJsZSAqLwo+ICsjZGVmaW5lIElNQUdFX1NDTl9NRU1fU0hBUkVEwqDC
oMKgwqDCoCAweDEwMDAwMDAwIC8qIGNhbiBiZSBzaGFyZWQgKi8KPiArI2RlZmluZSBJTUFHRV9T
Q05fTUVNX0VYRUNVVEXCoMKgwqDCoCAweDIwMDAwMDAwIC8qIGNhbiBiZSBleGVjdXRlZCBhcwo+
IGNvZGUgKi8KPiArI2RlZmluZSBJTUFHRV9TQ05fTUVNX1JFQUTCoMKgwqDCoMKgwqDCoCAweDQw
MDAwMDAwIC8qIHJlYWRhYmxlICovCj4gKyNkZWZpbmUgSU1BR0VfU0NOX01FTV9XUklURcKgwqDC
oMKgwqDCoCAweDgwMDAwMDAwIC8qIHdyaXRlYWJsZSAqLwo+ICsKPiArI2RlZmluZSBJTUFHRV9E
RUJVR19UWVBFX0NPREVWSUVXwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgMgo+ICsjZGVmaW5l
IElNQUdFX0RFQlVHX1RZUEVfRVhfRExMQ0hBUkFDVEVSSVNUSUNTIDIwCj4gKwo+ICsjaWZuZGVm
IF9fQVNTRU1CTFlfXwo+ICsKPiArc3RydWN0IG16X2hkciB7Cj4gK8KgwqDCoCB1aW50MTZfdCBt
YWdpYzvCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCAvKiBNWl9NQUdJQyAqLwo+ICvCoMKgwqAg
dWludDE2X3QgbGJzaXplO8KgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCAvKiBzaXplIG9mIGxhc3Qg
dXNlZCBibG9jayAqLwo+ICvCoMKgwqAgdWludDE2X3QgYmxvY2tzO8KgwqDCoMKgwqDCoMKgwqDC
oMKgwqDCoCAvKiBwYWdlcyBpbiBmaWxlLCAweDMgKi8KPiArwqDCoMKgIHVpbnQxNl90IHJlbG9j
czvCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgLyogcmVsb2NhdGlvbnMgKi8KPiArwqDCoMKgIHVp
bnQxNl90IGhkcnNpemU7wqDCoMKgwqDCoMKgwqDCoMKgwqDCoCAvKiBoZWFkZXIgc2l6ZSBpbiAi
cGFyYWdyYXBocyIgKi8KPiArwqDCoMKgIHVpbnQxNl90IG1pbl9leHRyYV9wcHM7wqDCoMKgwqDC
oCAvKiAuYnNzICovCj4gK8KgwqDCoCB1aW50MTZfdCBtYXhfZXh0cmFfcHBzO8KgwqDCoMKgwqAg
LyogcnVudGltZSBsaW1pdCBmb3IgdGhlIGFyZW5hIHNpemUKPiAqLwo+ICvCoMKgwqAgdWludDE2
X3Qgc3M7wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgLyogcmVsYXRpdmUgc3RhY2sg
c2VnbWVudCAqLwo+ICvCoMKgwqAgdWludDE2X3Qgc3A7wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKg
wqDCoMKgwqAgLyogaW5pdGlhbCAlc3AgcmVnaXN0ZXIgKi8KPiArwqDCoMKgIHVpbnQxNl90IGNo
ZWNrc3VtO8KgwqDCoMKgwqDCoMKgwqDCoMKgIC8qIHdvcmQgY2hlY2tzdW0gKi8KPiArwqDCoMKg
IHVpbnQxNl90IGlwO8KgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIC8qIGluaXRpYWwg
JWlwIHJlZ2lzdGVyICovCj4gK8KgwqDCoCB1aW50MTZfdCBjczvCoMKgwqDCoMKgwqDCoMKgwqDC
oMKgwqDCoMKgwqDCoCAvKiBpbml0aWFsICVjcyByZWxhdGl2ZSB0byBsb2FkCj4gc2VnbWVudCAq
Lwo+ICvCoMKgwqAgdWludDE2X3QgcmVsb2NfdGFibGVfb2Zmc2V0OyAvKiBvZmZzZXQgb2YgdGhl
IGZpcnN0IHJlbG9jYXRpb24KPiAqLwo+ICvCoMKgwqAgdWludDE2X3Qgb3ZlcmxheV9udW07wqDC
oMKgwqDCoMKgwqAgLyogb3ZlcmxheSBudW1iZXIuwqAgc2V0IHRvIDAuICovCj4gK8KgwqDCoCB1
aW50MTZfdCByZXNlcnZlZDBbNF07wqDCoMKgwqDCoMKgIC8qIHJlc2VydmVkICovCj4gK8KgwqDC
oCB1aW50MTZfdCBvZW1faWQ7wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIC8qIG9lbSBpZGVudGlm
aWVyICovCj4gK8KgwqDCoCB1aW50MTZfdCBvZW1faW5mbzvCoMKgwqDCoMKgwqDCoMKgwqDCoCAv
KiBvZW0gc3BlY2lmaWMgKi8KPiArwqDCoMKgIHVpbnQxNl90IHJlc2VydmVkMVsxMF07wqDCoMKg
wqDCoCAvKiByZXNlcnZlZCAqLwo+ICvCoMKgwqAgdWludDMyX3QgcGVhZGRyO8KgwqDCoMKgwqDC
oMKgwqDCoMKgwqDCoCAvKiBmaWxlIG9mZnNldCBvZiBQRSBoZWFkZXIgKi8KPiArwqDCoMKgIGNo
YXLCoMKgwqDCoCBtZXNzYWdlW107wqDCoMKgwqDCoMKgwqDCoMKgIC8qIG1lc3NhZ2UgdG8gcHJp
bnQgKi8KPiArfTsKPiArCj4gK3N0cnVjdCBtel9yZWxvYyB7Cj4gK8KgwqDCoCB1aW50MTZfdCBv
ZmZzZXQ7Cj4gK8KgwqDCoCB1aW50MTZfdCBzZWdtZW50Owo+ICt9Owo+ICsKPiArc3RydWN0IHBl
X2hkciB7Cj4gK8KgwqDCoCB1aW50MzJfdCBtYWdpYzvCoMKgwqDCoMKgwqDCoCAvKiBQRSBtYWdp
YyAqLwo+ICvCoMKgwqAgdWludDE2X3QgbWFjaGluZTvCoMKgwqDCoMKgIC8qIG1hY2hpbmUgdHlw
ZSAqLwo+ICvCoMKgwqAgdWludDE2X3Qgc2VjdGlvbnM7wqDCoMKgwqAgLyogbnVtYmVyIG9mIHNl
Y3Rpb25zICovCj4gK8KgwqDCoCB1aW50MzJfdCB0aW1lc3RhbXA7wqDCoMKgIC8qIHRpbWVfdCAq
Lwo+ICvCoMKgwqAgdWludDMyX3Qgc3ltYm9sX3RhYmxlOyAvKiBzeW1ib2wgdGFibGUgb2Zmc2V0
ICovCj4gK8KgwqDCoCB1aW50MzJfdCBzeW1ib2xzO8KgwqDCoMKgwqAgLyogbnVtYmVyIG9mIHN5
bWJvbHMgKi8KPiArwqDCoMKgIHVpbnQxNl90IG9wdF9oZHJfc2l6ZTsgLyogc2l6ZSBvZiBvcHRp
b25hbCBoZWFkZXIgKi8KPiArwqDCoMKgIHVpbnQxNl90IGZsYWdzO8KgwqDCoMKgwqDCoMKgIC8q
IGZsYWdzICovCj4gK307Cj4gKwo+ICsvKgo+ICsgKiB0aGUgZmFjdCB0aGF0IHBlMzIgaXNuJ3Qg
cGFkZGVkIHdoZXJlIHBlMzIrIGlzIDY0LWJpdCBtZWFucyB1bmlvbgo+IHdvbid0Cj4gKyAqIHdv
cmsgcmlnaHQuCj4gKyAqLwo+ICtzdHJ1Y3QgcGUzMl9vcHRfaGRyIHsKPiArwqDCoMKgIC8qICJz
dGFuZGFyZCIgaGVhZGVyICovCj4gK8KgwqDCoCB1aW50MTZfdCBtYWdpYzvCoMKgwqDCoMKgwqAg
LyogZmlsZSB0eXBlICovCj4gK8KgwqDCoCB1aW50OF90wqAgbGRfbWFqb3I7wqDCoMKgIC8qIGxp
bmtlciBtYWpvciB2ZXJzaW9uICovCj4gK8KgwqDCoCB1aW50OF90wqAgbGRfbWlub3I7wqDCoMKg
IC8qIGxpbmtlciBtaW5vciB2ZXJzaW9uICovCj4gK8KgwqDCoCB1aW50MzJfdCB0ZXh0X3NpemU7
wqDCoCAvKiBzaXplIG9mIHRleHQgc2VjdGlvbihzKSAqLwo+ICvCoMKgwqAgdWludDMyX3QgZGF0
YV9zaXplO8KgwqAgLyogc2l6ZSBvZiBkYXRhIHNlY3Rpb24ocykgKi8KPiArwqDCoMKgIHVpbnQz
Ml90IGJzc19zaXplO8KgwqDCoCAvKiBzaXplIG9mIGJzcyBzZWN0aW9uKHMpICovCj4gK8KgwqDC
oCB1aW50MzJfdCBlbnRyeV9wb2ludDsgLyogZmlsZSBvZmZzZXQgb2YgZW50cnkgcG9pbnQgKi8K
PiArwqDCoMKgIHVpbnQzMl90IGNvZGVfYmFzZTvCoMKgIC8qIHJlbGF0aXZlIGNvZGUgYWRkciBp
biByYW0gKi8KPiArwqDCoMKgIHVpbnQzMl90IGRhdGFfYmFzZTvCoMKgIC8qIHJlbGF0aXZlIGRh
dGEgYWRkciBpbiByYW0gKi8KPiArwqDCoMKgIC8qICJ3aW5kb3dzIiBoZWFkZXIgKi8KPiArwqDC
oMKgIHVpbnQzMl90IGltYWdlX2Jhc2U7wqDCoMKgwqAgLyogcHJlZmVycmVkIGxvYWQgYWRkcmVz
cyAqLwo+ICvCoMKgwqAgdWludDMyX3Qgc2VjdGlvbl9hbGlnbjvCoCAvKiBhbGlnbm1lbnQgaW4g
Ynl0ZXMgKi8KPiArwqDCoMKgIHVpbnQzMl90IGZpbGVfYWxpZ247wqDCoMKgwqAgLyogZmlsZSBh
bGlnbm1lbnQgaW4gYnl0ZXMgKi8KPiArwqDCoMKgIHVpbnQxNl90IG9zX21ham9yO8KgwqDCoMKg
wqDCoCAvKiBtYWpvciBPUyB2ZXJzaW9uICovCj4gK8KgwqDCoCB1aW50MTZfdCBvc19taW5vcjvC
oMKgwqDCoMKgwqAgLyogbWlub3IgT1MgdmVyc2lvbiAqLwo+ICvCoMKgwqAgdWludDE2X3QgaW1h
Z2VfbWFqb3I7wqDCoMKgIC8qIG1ham9yIGltYWdlIHZlcnNpb24gKi8KPiArwqDCoMKgIHVpbnQx
Nl90IGltYWdlX21pbm9yO8KgwqDCoCAvKiBtaW5vciBpbWFnZSB2ZXJzaW9uICovCj4gK8KgwqDC
oCB1aW50MTZfdCBzdWJzeXNfbWFqb3I7wqDCoCAvKiBtYWpvciBzdWJzeXN0ZW0gdmVyc2lvbiAq
Lwo+ICvCoMKgwqAgdWludDE2X3Qgc3Vic3lzX21pbm9yO8KgwqAgLyogbWlub3Igc3Vic3lzdGVt
IHZlcnNpb24gKi8KPiArwqDCoMKgIHVpbnQzMl90IHdpbjMyX3ZlcnNpb247wqAgLyogcmVzZXJ2
ZWQsIG11c3QgYmUgMCAqLwo+ICvCoMKgwqAgdWludDMyX3QgaW1hZ2Vfc2l6ZTvCoMKgwqDCoCAv
KiBpbWFnZSBzaXplICovCj4gK8KgwqDCoCB1aW50MzJfdCBoZWFkZXJfc2l6ZTvCoMKgwqAgLyog
aGVhZGVyIHNpemUgcm91bmRlZCB1cCB0byBmaWxlX2FsaWduCj4gKi8KPiArwqDCoMKgIHVpbnQz
Ml90IGNzdW07wqDCoMKgwqDCoMKgwqDCoMKgwqAgLyogY2hlY2tzdW0gKi8KPiArwqDCoMKgIHVp
bnQxNl90IHN1YnN5czvCoMKgwqDCoMKgwqDCoMKgIC8qIHN1YnN5c3RlbSAqLwo+ICvCoMKgwqAg
dWludDE2X3QgZGxsX2ZsYWdzO8KgwqDCoMKgwqAgLyogbW9yZSBmbGFncyEgKi8KPiArwqDCoMKg
IHVpbnQzMl90IHN0YWNrX3NpemVfcmVxOyAvKiBhbXQgb2Ygc3RhY2sgcmVxdWVzdGVkICovCj4g
K8KgwqDCoCB1aW50MzJfdCBzdGFja19zaXplO8KgwqDCoMKgIC8qIGFtdCBvZiBzdGFjayByZXF1
aXJlZCAqLwo+ICvCoMKgwqAgdWludDMyX3QgaGVhcF9zaXplX3JlcTvCoCAvKiBhbXQgb2YgaGVh
cCByZXF1ZXN0ZWQgKi8KPiArwqDCoMKgIHVpbnQzMl90IGhlYXBfc2l6ZTvCoMKgwqDCoMKgIC8q
IGFtdCBvZiBoZWFwIHJlcXVpcmVkICovCj4gK8KgwqDCoCB1aW50MzJfdCBsb2FkZXJfZmxhZ3M7
wqDCoCAvKiByZXNlcnZlZCwgbXVzdCBiZSAwICovCj4gK8KgwqDCoCB1aW50MzJfdCBkYXRhX2Rp
cnM7wqDCoMKgwqDCoCAvKiBudW1iZXIgb2YgZGF0YSBkaXIgZW50cmllcyAqLwo+ICt9Owo+ICsK
PiArc3RydWN0IHBlMzJwbHVzX29wdF9oZHIgewo+ICvCoMKgwqAgdWludDE2X3QgbWFnaWM7wqDC
oMKgwqDCoMKgIC8qIGZpbGUgdHlwZSAqLwo+ICvCoMKgwqAgdWludDhfdMKgIGxkX21ham9yO8Kg
wqDCoCAvKiBsaW5rZXIgbWFqb3IgdmVyc2lvbiAqLwo+ICvCoMKgwqAgdWludDhfdMKgIGxkX21p
bm9yO8KgwqDCoCAvKiBsaW5rZXIgbWlub3IgdmVyc2lvbiAqLwo+ICvCoMKgwqAgdWludDMyX3Qg
dGV4dF9zaXplO8KgwqAgLyogc2l6ZSBvZiB0ZXh0IHNlY3Rpb24ocykgKi8KPiArwqDCoMKgIHVp
bnQzMl90IGRhdGFfc2l6ZTvCoMKgIC8qIHNpemUgb2YgZGF0YSBzZWN0aW9uKHMpICovCj4gK8Kg
wqDCoCB1aW50MzJfdCBic3Nfc2l6ZTvCoMKgwqAgLyogc2l6ZSBvZiBic3Mgc2VjdGlvbihzKSAq
Lwo+ICvCoMKgwqAgdWludDMyX3QgZW50cnlfcG9pbnQ7IC8qIGZpbGUgb2Zmc2V0IG9mIGVudHJ5
IHBvaW50ICovCj4gK8KgwqDCoCB1aW50MzJfdCBjb2RlX2Jhc2U7wqDCoCAvKiByZWxhdGl2ZSBj
b2RlIGFkZHIgaW4gcmFtICovCj4gK8KgwqDCoCAvKiAid2luZG93cyIgaGVhZGVyICovCj4gK8Kg
wqDCoCB1aW50NjRfdCBpbWFnZV9iYXNlO8KgwqDCoMKgIC8qIHByZWZlcnJlZCBsb2FkIGFkZHJl
c3MgKi8KPiArwqDCoMKgIHVpbnQzMl90IHNlY3Rpb25fYWxpZ247wqAgLyogYWxpZ25tZW50IGlu
IGJ5dGVzICovCj4gK8KgwqDCoCB1aW50MzJfdCBmaWxlX2FsaWduO8KgwqDCoMKgIC8qIGZpbGUg
YWxpZ25tZW50IGluIGJ5dGVzICovCj4gK8KgwqDCoCB1aW50MTZfdCBvc19tYWpvcjvCoMKgwqDC
oMKgwqAgLyogbWFqb3IgT1MgdmVyc2lvbiAqLwo+ICvCoMKgwqAgdWludDE2X3Qgb3NfbWlub3I7
wqDCoMKgwqDCoMKgIC8qIG1pbm9yIE9TIHZlcnNpb24gKi8KPiArwqDCoMKgIHVpbnQxNl90IGlt
YWdlX21ham9yO8KgwqDCoCAvKiBtYWpvciBpbWFnZSB2ZXJzaW9uICovCj4gK8KgwqDCoCB1aW50
MTZfdCBpbWFnZV9taW5vcjvCoMKgwqAgLyogbWlub3IgaW1hZ2UgdmVyc2lvbiAqLwo+ICvCoMKg
wqAgdWludDE2X3Qgc3Vic3lzX21ham9yO8KgwqAgLyogbWFqb3Igc3Vic3lzdGVtIHZlcnNpb24g
Ki8KPiArwqDCoMKgIHVpbnQxNl90IHN1YnN5c19taW5vcjvCoMKgIC8qIG1pbm9yIHN1YnN5c3Rl
bSB2ZXJzaW9uICovCj4gK8KgwqDCoCB1aW50MzJfdCB3aW4zMl92ZXJzaW9uO8KgIC8qIHJlc2Vy
dmVkLCBtdXN0IGJlIDAgKi8KPiArwqDCoMKgIHVpbnQzMl90IGltYWdlX3NpemU7wqDCoMKgwqAg
LyogaW1hZ2Ugc2l6ZSAqLwo+ICvCoMKgwqAgdWludDMyX3QgaGVhZGVyX3NpemU7wqDCoMKgIC8q
IGhlYWRlciBzaXplIHJvdW5kZWQgdXAgdG8gZmlsZV9hbGlnbgo+ICovCj4gK8KgwqDCoCB1aW50
MzJfdCBjc3VtO8KgwqDCoMKgwqDCoMKgwqDCoMKgIC8qIGNoZWNrc3VtICovCj4gK8KgwqDCoCB1
aW50MTZfdCBzdWJzeXM7wqDCoMKgwqDCoMKgwqDCoCAvKiBzdWJzeXN0ZW0gKi8KPiArwqDCoMKg
IHVpbnQxNl90IGRsbF9mbGFnczvCoMKgwqDCoMKgIC8qIG1vcmUgZmxhZ3MhICovCj4gK8KgwqDC
oCB1aW50NjRfdCBzdGFja19zaXplX3JlcTsgLyogYW10IG9mIHN0YWNrIHJlcXVlc3RlZCAqLwo+
ICvCoMKgwqAgdWludDY0X3Qgc3RhY2tfc2l6ZTvCoMKgwqDCoCAvKiBhbXQgb2Ygc3RhY2sgcmVx
dWlyZWQgKi8KPiArwqDCoMKgIHVpbnQ2NF90IGhlYXBfc2l6ZV9yZXE7wqAgLyogYW10IG9mIGhl
YXAgcmVxdWVzdGVkICovCj4gK8KgwqDCoCB1aW50NjRfdCBoZWFwX3NpemU7wqDCoMKgwqDCoCAv
KiBhbXQgb2YgaGVhcCByZXF1aXJlZCAqLwo+ICvCoMKgwqAgdWludDMyX3QgbG9hZGVyX2ZsYWdz
O8KgwqAgLyogcmVzZXJ2ZWQsIG11c3QgYmUgMCAqLwo+ICvCoMKgwqAgdWludDMyX3QgZGF0YV9k
aXJzO8KgwqDCoMKgwqAgLyogbnVtYmVyIG9mIGRhdGEgZGlyIGVudHJpZXMgKi8KPiArfTsKPiAr
Cj4gK3N0cnVjdCBkYXRhX2RpcmVudCB7Cj4gK8KgwqDCoCB1aW50MzJfdCBydmE7wqDCoMKgwqDC
oMKgwqDCoMKgwqDCoCAvKiByZWxhdGl2ZSB0byBsb2FkIGFkZHJlc3MgKi8KPiArwqDCoMKgIHVp
bnQzMl90IHNpemU7Cj4gK307Cj4gKwo+ICtzdHJ1Y3QgZGF0YV9kaXJlY3Rvcnkgewo+ICvCoMKg
wqAgc3RydWN0IGRhdGFfZGlyZW50IGV4cG9ydHM7wqDCoMKgwqDCoMKgwqDCoMKgIC8qIC5lZGF0
YSAqLwo+ICvCoMKgwqAgc3RydWN0IGRhdGFfZGlyZW50IGltcG9ydHM7wqDCoMKgwqDCoMKgwqDC
oMKgIC8qIC5pZGF0YSAqLwo+ICvCoMKgwqAgc3RydWN0IGRhdGFfZGlyZW50IHJlc291cmNlczvC
oMKgwqDCoMKgwqDCoCAvKiAucnNyYyAqLwo+ICvCoMKgwqAgc3RydWN0IGRhdGFfZGlyZW50IGV4
Y2VwdGlvbnM7wqDCoMKgwqDCoMKgIC8qIC5wZGF0YSAqLwo+ICvCoMKgwqAgc3RydWN0IGRhdGFf
ZGlyZW50IGNlcnRzO8KgwqDCoMKgwqDCoMKgwqDCoMKgwqAgLyogY2VydHMgKi8KPiArwqDCoMKg
IHN0cnVjdCBkYXRhX2RpcmVudCBiYXNlX3JlbG9jYXRpb25zOyAvKiAucmVsb2MgKi8KPiArwqDC
oMKgIHN0cnVjdCBkYXRhX2RpcmVudCBkZWJ1ZzvCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIC8qIC5k
ZWJ1ZyAqLwo+ICvCoMKgwqAgc3RydWN0IGRhdGFfZGlyZW50IGFyY2g7wqDCoMKgwqDCoMKgwqDC
oMKgwqDCoMKgIC8qIHJlc2VydmVyZWQgKi8KPiArwqDCoMKgIHN0cnVjdCBkYXRhX2RpcmVudCBn
bG9iYWxfcHRyO8KgwqDCoMKgwqDCoCAvKiBnbG9iYWwgcG9pbnRlciByZWcuCj4gU2l6ZT0wICov
Cj4gK8KgwqDCoCBzdHJ1Y3QgZGF0YV9kaXJlbnQgdGxzO8KgwqDCoMKgwqDCoMKgwqDCoMKgwqDC
oMKgIC8qIC50bHMgKi8KPiArwqDCoMKgIHN0cnVjdCBkYXRhX2RpcmVudCBsb2FkX2NvbmZpZzvC
oMKgwqDCoMKgIC8qIGxvYWQgY29uZmlndXJhdGlvbgo+IHN0cnVjdHVyZSAqLwo+ICvCoMKgwqAg
c3RydWN0IGRhdGFfZGlyZW50IGJvdW5kX2ltcG9ydHM7wqDCoMKgIC8qIG5vIGlkZWEgKi8KPiAr
wqDCoMKgIHN0cnVjdCBkYXRhX2RpcmVudCBpbXBvcnRfYWRkcnM7wqDCoMKgwqAgLyogaW1wb3J0
IGFkZHJlc3MgdGFibGUgKi8KPiArwqDCoMKgIHN0cnVjdCBkYXRhX2RpcmVudCBkZWxheV9pbXBv
cnRzO8KgwqDCoCAvKiBkZWxheS1sb2FkIGltcG9ydCB0YWJsZQo+ICovCj4gK8KgwqDCoCBzdHJ1
Y3QgZGF0YV9kaXJlbnQgY2xyX3J1bnRpbWVfaGRyO8KgIC8qIC5jb3IgKG9iamVjdCBvbmx5KSAq
Lwo+ICvCoMKgwqAgc3RydWN0IGRhdGFfZGlyZW50IHJlc2VydmVkOwo+ICt9Owo+ICsKPiArc3Ry
dWN0IHNlY3Rpb25faGVhZGVyIHsKPiArwqDCoMKgIGNoYXLCoMKgwqDCoCBuYW1lWzhdO8KgwqDC
oMKgwqDCoMKgwqAgLyogbmFtZSBvciBzdHJpbmcgdGJsIG9mZnNldCAqLwo+ICvCoMKgwqAgdWlu
dDMyX3QgdmlydHVhbF9zaXplO8KgwqDCoCAvKiBzaXplIG9mIGxvYWRlZCBzZWN0aW9uIGluIHJh
bSAqLwo+ICvCoMKgwqAgdWludDMyX3QgcnZhO8KgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCAvKiBy
ZWxhdGl2ZSB2aXJ0dWFsIGFkZHJlc3MgKi8KPiArwqDCoMKgIHVpbnQzMl90IHJhd19kYXRhX3Np
emU7wqDCoCAvKiBzaXplIG9mIHRoZSBzZWN0aW9uICovCj4gK8KgwqDCoCB1aW50MzJfdCBkYXRh
X2FkZHI7wqDCoMKgwqDCoMKgIC8qIGZpbGUgcG9pbnRlciB0byBmaXJzdCBwYWdlIG9mIHNlYwo+
ICovCj4gK8KgwqDCoCB1aW50MzJfdCByZWxvY3M7wqDCoMKgwqDCoMKgwqDCoMKgIC8qIGZpbGUg
cG9pbnRlciB0byByZWxvY2F0aW9uIGVudHJpZXMKPiAqLwo+ICvCoMKgwqAgdWludDMyX3QgbGlu
ZV9udW1iZXJzO8KgwqDCoCAvKiBsaW5lIG51bWJlcnMgKi8KPiArwqDCoMKgIHVpbnQxNl90IG51
bV9yZWxvY3M7wqDCoMKgwqDCoCAvKiBudW1iZXIgb2YgcmVsb2NhdGlvbnMgKi8KPiArwqDCoMKg
IHVpbnQxNl90IG51bV9saW5fbnVtYmVyczsgLyogQ09GRiBsaW5lIGNvdW50ICovCj4gK8KgwqDC
oCB1aW50MzJfdCBmbGFnczsKPiArfTsKPiArCj4gKyNlbmRpZiAvKiBfX0FTU0VNQkxZX18gKi8K
PiArCj4gKyNlbmRpZiAvKiBFRklfX1BFX0ggKi8KCg==



From xen-devel-bounces@lists.xenproject.org Mon Aug 19 17:50:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 17:50:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779909.1189564 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg6WN-00040L-UJ; Mon, 19 Aug 2024 17:50:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779909.1189564; Mon, 19 Aug 2024 17:50:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg6WN-00040E-R6; Mon, 19 Aug 2024 17:50:23 +0000
Received: by outflank-mailman (input) for mailman id 779909;
 Mon, 19 Aug 2024 17:50:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sg6WM-000404-AC; Mon, 19 Aug 2024 17:50:22 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sg6WM-0001DO-2t; Mon, 19 Aug 2024 17:50:22 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sg6WL-0002z8-H5; Mon, 19 Aug 2024 17:50:21 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sg6WL-0005v9-G3; Mon, 19 Aug 2024 17:50:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=uqVGTxtal5ygPGMjYogzpCoapZIPPi1MjDeSYihQtyA=; b=aKT1KkXvOIkmN9CPikwtLwEdiH
	bGlHwQUpHOXBvGB5rQBxQS0QwUv/LxGmKWE5SwdXlxvgGB5+jAJnBBq4KmjapLoszabAr3Y3wb18U
	2G5SsIYCH4U6U8+PIwc6fkvIQbTB8C9HAC/SsZ3FPQ4ykycl5DSAZUyQnAVBbveO3F6Y=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187280-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187280: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=1e2a5f991f86979b89aa9a60ca3ba8106ee7d987
X-Osstest-Versions-That:
    xen=1e2a5f991f86979b89aa9a60ca3ba8106ee7d987
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 19 Aug 2024 17:50:21 +0000

flight 187280 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187280/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187274
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187274
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187274
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187274
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187274
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187274
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  1e2a5f991f86979b89aa9a60ca3ba8106ee7d987
baseline version:
 xen                  1e2a5f991f86979b89aa9a60ca3ba8106ee7d987

Last test of basis   187280  2024-08-19 03:46:14 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Mon Aug 19 18:22:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 18:22:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779923.1189574 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg71f-0000fr-BE; Mon, 19 Aug 2024 18:22:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779923.1189574; Mon, 19 Aug 2024 18:22:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sg71f-0000fk-8H; Mon, 19 Aug 2024 18:22:43 +0000
Received: by outflank-mailman (input) for mailman id 779923;
 Mon, 19 Aug 2024 18:22: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=/QpF=PS=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sg71e-0000fe-Pl
 for xen-devel@lists.xenproject.org; Mon, 19 Aug 2024 18:22:42 +0000
Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com
 [2a00:1450:4864:20::42e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0560d981-5e58-11ef-a506-bb4a2ccca743;
 Mon, 19 Aug 2024 20:22:41 +0200 (CEST)
Received: by mail-wr1-x42e.google.com with SMTP id
 ffacd0b85a97d-3719f0758c6so1666521f8f.1
 for <xen-devel@lists.xenproject.org>; Mon, 19 Aug 2024 11:22:41 -0700 (PDT)
Received: from localhost (0545937c.skybroadband.com. [5.69.147.124])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-371898aada4sm11046823f8f.94.2024.08.19.11.22.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 19 Aug 2024 11:22:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0560d981-5e58-11ef-a506-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724091761; x=1724696561; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=fuWbQs0LWXXYw+q6Xew4tYaIWLoo1MsbjHSmYsztmx0=;
        b=eMYISJDLpa+sQrUTmbd9kuPhK37RQx2p1z5C26aL6xV+4pi+px9bwvs8YE4uP6VDAF
         yQa6qyW6ACCrO54s/1pZy1Eo5dTlD+GKptWh3NjmgfRaNkQwmlYN3S46++GmcDV0naXs
         heou0H0h1h7aUEDfrB+OCXBdGIgvurYJlCank=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724091761; x=1724696561;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=fuWbQs0LWXXYw+q6Xew4tYaIWLoo1MsbjHSmYsztmx0=;
        b=gVB39OE0+VWpNaDjvaUCfy4FbliilOuNn0PQN+PdtZMdVtsFYQP845SaOFLXMi0W1R
         YvT1mW5wASuH6UJikx1M1McGFSlUHvJdeAxB3lGXA6S//o7ybVSwfpiCmLSYllQQgu0M
         7KXZAb1vt+cbCxqnLYQJOXN9LhyuMsezaQ2uGixpIbMBCGV9saaaAyjfnGxLfXEVuIEA
         AGp8HMBzAJ05wBQ0l9Xf7tSar6edVZ1sOA3P4hrlLF50xJr5Iai8uAXomyIqZ/XS8RNw
         ywl+//sRvPHZSqgzQ7I5A81hvWziHIujn63OiYOo+l85UlCQ/2jYNz4Js19ZemVs+2Ea
         AbZw==
X-Forwarded-Encrypted: i=1; AJvYcCVFCdBc/zil9z/sD3IIrdGiqEu0Gj95XedBXnRSuAyWtjli5p/6KSXJ03jelyzkfDcwM2tNafo2/JvOpQUNFxn581J0hCIu58vaLrZjt/E=
X-Gm-Message-State: AOJu0Ywtgi0nUCN2V/f98sAuOf6hjUgSnpH4TmdnmMjYep3Z1K16Lm8S
	ikpgztsx+NC6htQM5T0lOs+ovQnDvIZe9/dxI209LJVoD/bulszUjCWRki0t1m4=
X-Google-Smtp-Source: AGHT+IHXN4mVBCAXFMVNyjbhtsp6Fa/ZS8zu5efVG+fm6TnCCBE/UaJdwtewTf036w7860CtCUOMQg==
X-Received: by 2002:a5d:6607:0:b0:36d:2941:d531 with SMTP id ffacd0b85a97d-371a746c4a3mr4904733f8f.44.1724091760569;
        Mon, 19 Aug 2024 11:22:40 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Mon, 19 Aug 2024 19:22:36 +0100
Message-Id: <D3K3IQW8N3T4.3SCE11SFGY0ZA@cloud.com>
Cc: "Jan Beulich" <jbeulich@suse.com>, "Andrew Cooper"
 <andrew.cooper3@citrix.com>
Subject: Re: [PATCH 13/22] x86/hvm: use a per-pCPU monitor table in HAP mode
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>, "Roger Pau Monne"
 <roger.pau@citrix.com>, <xen-devel@lists.xenproject.org>
X-Mailer: aerc 0.17.0
References: <20240726152206.28411-1-roger.pau@citrix.com>
 <20240726152206.28411-14-roger.pau@citrix.com>
 <D3HJ80ZGO0MR.2JCGJIV5JPYQP@cloud.com>
In-Reply-To: <D3HJ80ZGO0MR.2JCGJIV5JPYQP@cloud.com>

On Fri Aug 16, 2024 at 7:02 PM BST, Alejandro Vallejo wrote:
> On Fri Jul 26, 2024 at 4:21 PM BST, Roger Pau Monne wrote:
> > Instead of allocating a monitor table for each vCPU when running in HVM=
 HAP
> > mode, use a per-pCPU monitor table, which gets the per-domain slot upda=
ted on
> > guest context switch.
> >
> > This limits the amount of memory used for HVM HAP monitor tables to the=
 amount
> > of active pCPUs, rather than to the number of vCPUs.  It also simplifie=
s vCPU
> > allocation and teardown, since the monitor table handling is removed fr=
om
> > there.
> >
> > Note the switch to using a per-CPU monitor table is done regardless of =
whether
>
> s/per-CPU/per-pCPU/
>
> > Address Space Isolation is enabled or not.  Partly for the memory usage
> > reduction, and also because it allows to simplify the VM tear down path=
 by not
> > having to cleanup the per-vCPU monitor tables.
> >
> > Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
> > ---
> > Note the monitor table is not made static because uses outside of the f=
ile
> > where it's defined will be added by further patches.
> > ---
> >  xen/arch/x86/hvm/hvm.c             | 60 ++++++++++++++++++++++++
> >  xen/arch/x86/hvm/svm/svm.c         |  5 ++
> >  xen/arch/x86/hvm/vmx/vmcs.c        |  1 +
> >  xen/arch/x86/hvm/vmx/vmx.c         |  4 ++
> >  xen/arch/x86/include/asm/hap.h     |  1 -
> >  xen/arch/x86/include/asm/hvm/hvm.h |  8 ++++
> >  xen/arch/x86/mm.c                  |  8 ++++
> >  xen/arch/x86/mm/hap/hap.c          | 75 ------------------------------
> >  xen/arch/x86/mm/paging.c           |  4 +-
> >  9 files changed, 87 insertions(+), 79 deletions(-)
> >
> > diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> > index 7f4b627b1f5f..3f771bc65677 100644
> > --- a/xen/arch/x86/hvm/hvm.c
> > +++ b/xen/arch/x86/hvm/hvm.c
> > @@ -104,6 +104,54 @@ static const char __initconst warning_hvm_fep[] =
=3D
> >  static bool __initdata opt_altp2m_enabled;
> >  boolean_param("altp2m", opt_altp2m_enabled);
> > =20
> > +DEFINE_PER_CPU(root_pgentry_t *, monitor_pgt);
> > +
> > +static int allocate_cpu_monitor_table(unsigned int cpu)
>
> To avoid ambiguity, could we call these *_pcpu_*() instead?
>
> > +{
> > +    root_pgentry_t *pgt =3D alloc_xenheap_page();
> > +
> > +    if ( !pgt )
> > +        return -ENOMEM;
> > +
> > +    clear_page(pgt);
> > +
> > +    init_xen_l4_slots(pgt, _mfn(virt_to_mfn(pgt)), INVALID_MFN, NULL,
> > +                      false, true, false);
> > +
> > +    ASSERT(!per_cpu(monitor_pgt, cpu));
> > +    per_cpu(monitor_pgt, cpu) =3D pgt;
> > +
> > +    return 0;
> > +}
> > +
> > +static void free_cpu_monitor_table(unsigned int cpu)
> > +{
> > +    root_pgentry_t *pgt =3D per_cpu(monitor_pgt, cpu);
> > +
> > +    if ( !pgt )
> > +        return;
> > +
> > +    per_cpu(monitor_pgt, cpu) =3D NULL;
> > +    free_xenheap_page(pgt);
> > +}
> > +
> > +void hvm_set_cpu_monitor_table(struct vcpu *v)
> > +{
> > +    root_pgentry_t *pgt =3D this_cpu(monitor_pgt);
> > +
> > +    ASSERT(pgt);
> > +
> > +    setup_perdomain_slot(v, pgt);
>
> Why not modify them as part of write_ptbase() instead? As it stands, it a=
ppears
> to be modifying the PTEs of what may very well be our current PT, which m=
akes
> the perdomain slot be in a $DEITY-knows-what state until the next flush
> (presumably the write to cr3 in write_ptbase()?; assuming no PCIDs).
>
> Setting the slot up right before the cr3 change should reduce the potenti=
al for
> misuse.
>
> > +
> > +    make_cr3(v, _mfn(virt_to_mfn(pgt)));
> > +}
> > +
> > +void hvm_clear_cpu_monitor_table(struct vcpu *v)
> > +{
> > +    /* Poison %cr3, it will be updated when the vCPU is scheduled. */
> > +    make_cr3(v, INVALID_MFN);
>
> I think this would benefit from more exposition in the comment. If I'm ge=
tting
> this right, after descheduling this vCPU we can't assume it'll be resched=
uled
> on the same pCPU, and if it's not it'll end up using a different monitor =
table.
> This poison value is meant to highlight forgetting to set cr3 in the
> "ctxt_switch_to()" path.=20
>
> All of that can be deduced from what you wrote and sufficient headscratch=
ing
> but seeing how this is invoked from the context switch path it's not incr=
edibly
> clear wether you meant the perdomain slot would be updated by the next vC=
PU or
> what I stated in the previous paragraph.
>
> Assuming it is as I mentioned, maybe hvm_forget_cpu_monitor_table() would
> convey what it does better? i.e: the vCPU forgets/unbinds the monitor tab=
le
> from its internal state.
>
> Cheers,
> Alejandro

After playing with the code for a while I'm becoming increasingly convinced
that we don't want to tie hvm_clear_cpu_monitor_table() to the ctx_switch_t=
o
handlers at all. In __context_switch() we would ideally like to delay resto=
ring
the state until after said state is available in the page tables (i.e: afte=
r
write_ptbase()).

With that division we can do saves and restores with far less headaches as =
we
can assume that the pcpu fixmap always contains the relevant data.

Cheers,
Alejandro




From xen-devel-bounces@lists.xenproject.org Mon Aug 19 22:59:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 19 Aug 2024 22:59:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779958.1189584 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgBL0-0007y1-7R; Mon, 19 Aug 2024 22:58:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779958.1189584; Mon, 19 Aug 2024 22:58:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgBL0-0007xu-4b; Mon, 19 Aug 2024 22:58:58 +0000
Received: by outflank-mailman (input) for mailman id 779958;
 Mon, 19 Aug 2024 22:58:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgBKy-0007xk-Lz; Mon, 19 Aug 2024 22:58:56 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgBKy-0006TE-H1; Mon, 19 Aug 2024 22:58:56 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgBKx-0000yb-V4; Mon, 19 Aug 2024 22:58:56 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sgBKx-0007il-UT; Mon, 19 Aug 2024 22:58:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=kX4k82Ull9+0fQbr8GhOBy61OUMirPFVMq8IZVVT0rI=; b=jPJXhpAm8Ym6LQMsBy9JBAoD/S
	n+3ynYAByvrCGmxbtJW0E9JgtbM2TzbZ7cypCboCXln3Cy0B57puJ32xN82AMtCMxl+tGl3OR6OCW
	fAzYDLCA64utMwLFyAftQlaskCS/AhiPHwgKyKZ3bo+T6fzetLxlUDmwiA6bowj22R/Y=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187281-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-6.1 test] 187281: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-6.1:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    linux-6.1:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=ee5e09825b810498caeaaa3d46a3410768471053
X-Osstest-Versions-That:
    linux=117ac406ba904da738fb79a3b2c96d4a385292c1
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 19 Aug 2024 22:58:55 +0000

flight 187281 linux-6.1 real [real]
flight 187287 linux-6.1 real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187281/
http://logs.test-lab.xenproject.org/osstest/logs/187287/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 187287-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187252
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187252
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187252
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187252
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187252
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187252
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                ee5e09825b810498caeaaa3d46a3410768471053
baseline version:
 linux                117ac406ba904da738fb79a3b2c96d4a385292c1

Last test of basis   187252  2024-08-15 23:14:47 Z    3 days
Testing same since   187281  2024-08-19 04:15:49 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
  Andi Shyti <andi.shyti@linux.intel.com>
  Chris Wilson <chris.p.wilson@linux.intel.com>
  Chuck Lever <chuck.lever@oracle.com>
  Dan Carpenter <dan.carpenter@linaro.org>
  Eric Dumazet <edumazet@google.com>
  Florian Fainelli <florian.fainelli@broadcom.com>
  Geliang Tang <geliang.tang@suse.com>
  Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  Greg Ungerer <gerg@linux-m68k.org>
  hmy <huanglin@uniontech.com>
  Huacai Chen <chenhuacai@loongson.cn>
  Jakub Kicinski <kuba@kernel.org>
  Jeff Layton <jlayton@kernel.org>
  Johannes Berg <johannes.berg@intel.com>
  Jon Hunter <jonathanh@nvidia.com>
  Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
  Josef Bacik <josef@toxicpanda.com>
  Kees Cook <kees@kernel.org>
  Keith Busch <kbusch@kernel.org>
  Linux Kernel Functional Testing <lkft@linaro.org>
  Marco Vanotti <mvanotti@google.com>
  Mark Brown <broonie@kernel.org>
  Matthieu Baerts (NGI0) <matttbe@kernel.org>
  Matthieu Baerts <matthieu.baerts@tessares.net>
  Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  Niklas Cassel <cassel@kernel.org>
  Nirmoy Das <nirmoy.das@intel.com>
  Oliver Upton <oliver.upton@linux.dev>
  Pavel Machek (CIP) <pavel@denx.de>
  Ron Economos <re@w6rz.net>
  Salvatore Bonaccorso <carnil@debian.org>
  Sasha Levin <sashal@kernel.org>
  Sean Young <sean@mess.org>
  Stefan O'Rear <sorear@fastmail.com>
  Tejun Heo <tj@kernel.org>
  Waiman Long <longman@redhat.com>
  WangYuli <wangyuli@uniontech.com>
  Wentao Guan <guanwentao@uniontech.com>
  Will Deacon <will@kernel.org>
  Yafang Shao <laoar.shao@gmail.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   117ac406ba904..ee5e09825b810  ee5e09825b810498caeaaa3d46a3410768471053 -> tested/linux-6.1


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 01:57:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 01:57:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779981.1189594 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgE7O-0000x4-0G; Tue, 20 Aug 2024 01:57:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779981.1189594; Tue, 20 Aug 2024 01:57:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgE7N-0000wx-Ti; Tue, 20 Aug 2024 01:57:05 +0000
Received: by outflank-mailman (input) for mailman id 779981;
 Tue, 20 Aug 2024 01:57:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=bhUh=PT=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sgE7M-0000wr-BM
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 01:57:04 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 791ee140-5e97-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 03:56:56 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id E2C38CE09CB;
 Tue, 20 Aug 2024 01:56:49 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51C58C32782;
 Tue, 20 Aug 2024 01:56:48 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 791ee140-5e97-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724119009;
	bh=zD3MBHISFFNfc9rBOTI82+b1FXm6v8IpE2FKbtznSuw=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=WIqYw1XeNALyeFxJYKlquZ445QVgile/IoCSy4zlgYuhvceqX6B+SOgAx0sgEM+m8
	 lZGGSzOrFM+QIA0m05qsGhABmjX+nCrDLbA4y0Q+yCAODvjHWywtn5UvfivUPEEyXg
	 cx3iuhTzAsWu6pos8R989FKMLsBQCVukz6moSbjS01cuJRxn8K0lqKD4Ec6lLwZX2m
	 McnE8Xqt+62Unvhf6AWHPNkdQ7XqXOdjeZecjnjjWAH3DqiPyOe0DTbp2gF7lVRIQk
	 CSH71ranqUVTLHgGXCJ1x7Q7zwu0pWWwRtFiLHevewF/LwKZbuJhhdxHOpE5qS3Uge
	 lO1rrTp+LoqYA==
Date: Mon, 19 Aug 2024 18:56:47 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Anthony PERARD <anthony.perard@vates.tech>
cc: Michal Orzel <michal.orzel@amd.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    xen-devel@lists.xenproject.org, Doug Goldstein <cardoe@cardoe.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] automation: restore CR filtering
In-Reply-To: <ZsNl7S1JOYQgQx87@l14>
Message-ID: <alpine.DEB.2.22.394.2408191819580.298534@ubuntu-linux-20-04-desktop>
References: <alpine.DEB.2.22.394.2408161642220.298534@ubuntu-linux-20-04-desktop> <6d2fbe22-8866-4769-95d0-a5a8613a5936@amd.com> <ZsNl7S1JOYQgQx87@l14>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 19 Aug 2024, Anthony PERARD wrote:
> On Mon, Aug 19, 2024 at 09:21:22AM +0200, Michal Orzel wrote:
> > On 17/08/2024 01:46, Stefano Stabellini wrote:
> > > diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> > > index 0666f6363e..ed44aab0f0 100755
> > > --- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
> > > +++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> > > @@ -65,4 +65,4 @@ export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x4000000
> > >  export QEMU_LOG="smoke.serial"
> > >  export PASSED="${passed}"
> > > 
> > > -./automation/scripts/qemu-key.exp
> > > +./automation/scripts/qemu-key.exp | sed 's/\r//'
> > 
> > I compared 3 pipelines:
> > 1) one before c36efb7fcea6 (https://gitlab.com/xen-project/hardware/xen/-/jobs/7566986885)
> > 2) one after c36efb7fcea6 (https://gitlab.com/xen-project/hardware/xen/-/jobs/7603830706)
> > 3) one with this fix (https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7603783403)
> > 
> > In 1), there is Xen log + Linux log in Gitlab web page
> > In 2), there is no log at all
> > In 3), there is only Xen log visible
> 
> It's nice that you can select uboot/Xen logs or Linux logs based on the
> number of '\r' at the end of a line (output cat -A):
>     U-Boot 2023.01+dfsg-2+deb12u1 (Apr 18 2024 - 22:00:21 +0000)^M^M$
>     (XEN) [    0.013864] Xen version 4.20-unstable (root@) (gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924) debug=n Sat Aug 17 00:54:57 UTC 2024^M^M$
>     [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd070]^M^M^M$
> 
> But to display to GitLab's job logs, we want: sed 's/\r\+$//'
> 
> Also, do you have to edit every single script to overcome a shortcoming
> from the "expect" script? Can't you write a bit of Tcl and edit the line
> in the script instead?

The sed route is not perfect but it works :-)

I did try using expect but the logs were mangled. I think I missed that
there can be multilple \r. I managed to get close to the wanted behavior
with the below, but the Xen logs are still missing and I don't know why. 

https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7617161552

diff --git a/automation/scripts/qemu-key.exp b/automation/scripts/qemu-key.exp
index 35eb903a31..38061f2deb 100755
--- a/automation/scripts/qemu-key.exp
+++ b/automation/scripts/qemu-key.exp
@@ -9,7 +9,8 @@ match_max 10000
 eval spawn $env(QEMU_CMD)
 
 expect_after {
-    -re "(.*)\r" {
+    -re "(.*)\r+$" {
+        puts $expect_out(1,string)
         exp_continue
     }
     timeout {send_error "ERROR-Timeout!\n"; exit 1}


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 02:33:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 02:33:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.779991.1189605 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgEg3-0007Qc-Qd; Tue, 20 Aug 2024 02:32:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 779991.1189605; Tue, 20 Aug 2024 02:32:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgEg3-0007QV-Lh; Tue, 20 Aug 2024 02:32:55 +0000
Received: by outflank-mailman (input) for mailman id 779991;
 Tue, 20 Aug 2024 02:32:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgEg2-0007QL-Hk; Tue, 20 Aug 2024 02:32:54 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgEg2-0001p0-9k; Tue, 20 Aug 2024 02:32:54 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgEg1-0006Ny-OM; Tue, 20 Aug 2024 02:32:53 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sgEg1-0002Gz-Ns; Tue, 20 Aug 2024 02:32:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=fmkwOLzRedMuu3SqQJdSbzk/XVhzVZpDJipzGZ8T/kY=; b=RMIB3WtUXnwMB1brCk3vOHThDq
	EK1YTuo7Kq+3L4vIuDLqT3IYU+Mt11Mka54yCXUDimP5/I425tHz2ZqoN3kcsnZzS+FoIANRukwQU
	4b5ziw4ph4xZ3jdJmlwBVKC2ZdhVWcjKUpMedpQ5YpL+zo0qFkYOu7sGjMVsNuUrbwQ8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187282-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187282: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-libvirt-vhd:leak-check/check:fail:regression
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=48e4ba59a3756aad743982da16bf9b5120d91a0c
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 20 Aug 2024 02:32:53 +0000

flight 187282 qemu-mainline real [real]
flight 187288 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187282/
http://logs.test-lab.xenproject.org/osstest/logs/187288/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707
 test-amd64-amd64-libvirt-vhd 22 leak-check/check         fail REGR. vs. 182707

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 qemuu                48e4ba59a3756aad743982da16bf9b5120d91a0c
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  348 days
Failing since        182723  2023-09-07 18:19:05 Z  347 days   24 attempts
Testing same since   187282  2024-08-19 07:59:49 Z    0 days    1 attempts

------------------------------------------------------------
619 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 179901 lines long.)


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 06:00:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 06:00:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780026.1189614 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgHut-0005d1-HP; Tue, 20 Aug 2024 06:00:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780026.1189614; Tue, 20 Aug 2024 06:00:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgHut-0005cu-DQ; Tue, 20 Aug 2024 06:00:27 +0000
Received: by outflank-mailman (input) for mailman id 780026;
 Tue, 20 Aug 2024 06:00:25 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=6ZGS=PT=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1sgHur-0005co-P7
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 06:00:25 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on2060a.outbound.protection.outlook.com
 [2a01:111:f403:2416::60a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7b9ed180-5eb9-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 08:00:22 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by SA1PR12MB6702.namprd12.prod.outlook.com (2603:10b6:806:252::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug
 2024 06:00:16 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285%4]) with mapi id 15.20.7875.019; Tue, 20 Aug 2024
 06:00:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7b9ed180-5eb9-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Nde32pXeyt7NMt5NIcY2z7hMWPMQWUuZyjxXdk2hBa+OtgldcSitgpwo09Oew3GXm/CzF2jP7LHwFLPHHO0RsOywCZ3TAoY2GB+llm3YT4qg/uMOVa2uU8BbcFcfwWrB7CJSlG8AeMnR9CwOueQAfBjb96JkTX5u41RkyqBQvE96huSUNXpFkxBhv2WQD6HRxVuFkpD9/gRJm9yUd99VAB/PzQeP/NrXPHDiqL76wVkDsxz6ouO2fLg/yEmuy3SNvY317+CoR78MiCWp9QjQUjbwj9uQp1wu6D4LcZ1xpZitO173hXiSvzhw3dFVnH2uF0tm0k2NFBaT9lywLv/fsg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=ioA6zHhTtvVwAMTBf37mPbsNZ106a3WkxE4VYIDNErE=;
 b=xk2/DpJ4hspWFESWdK7VOuhA1LF9GsQtBQhI9GCxyAfI/yf4hAwMjtQ8CgA0KAT94Cfu+DVGQYumyRHumWhqjExPgwvWiTOUdEouuTXCLmiRJYSPB6o+Rou5Sp91X1WvpnzYiKoF8+Y+6dIxHKkI9mSuhBv1JgAyZdJFcnjgpPmJW6nKrAh0k4VKAanBK5TDooIfetxtULLN6tO0wXGX1a0ZZru3uu+38V4/QHj63XwX9qG3Y7abeXjjghbxtsRbJnzBoqoLpx4wpoBroJARdTyROt/XP3w9e/bYkPDNLU2GstdLktYVXPcK6u1OZYQUsLnno07A6OS34coDSXJjUA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=ioA6zHhTtvVwAMTBf37mPbsNZ106a3WkxE4VYIDNErE=;
 b=l6stKcuc6mkbCoHCvcsBezc3X4lr3tTOZfwPLC5qMMJfi6C9mqqx5qzAJhrgrmMi/vRDStBlHMGc4EUMZWgPlDEhd3YCsXvG8BV56mASyRSE06FkBNpW8tx0hVg5ICJipdckQ5JGzwJNRo+mDt0bD4FK23vI66lXyvTWTWCj+j8=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>, Wei Liu
	<wl@xen.org>, George Dunlap <gwd@xenproject.org>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD
	<anthony@xenproject.org>, Juergen Gross <jgross@suse.com>, "Daniel P . Smith"
	<dpsmith@apertussolutions.com>, "Hildebrand, Stewart"
	<Stewart.Hildebrand@amd.com>, "Huang, Ray" <Ray.Huang@amd.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, "Chen,
 Jiqian" <Jiqian.Chen@amd.com>
Subject: Re: [XEN PATCH v13 1/6] xen/pci: Add hypercall to support reset of
 pcidev
Thread-Topic: [XEN PATCH v13 1/6] xen/pci: Add hypercall to support reset of
 pcidev
Thread-Index: AQHa78yrMx2rme7kLk2Lfq5OhJcOzrIuThwAgAGubYA=
Date: Tue, 20 Aug 2024 06:00:16 +0000
Message-ID:
 <BL1PR12MB58498DC98719ED77DA950478E78D2@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
 <20240816110820.75672-2-Jiqian.Chen@amd.com>
 <50717151-3098-491f-9dfb-71ebaff4b684@suse.com>
In-Reply-To: <50717151-3098-491f-9dfb-71ebaff4b684@suse.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: BL1PR12MB5849.namprd12.prod.outlook.com
 (15.20.7875.019)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|SA1PR12MB6702:EE_
x-ms-office365-filtering-correlation-id: ccb8baeb-09d9-498e-0079-08dcc0dd5d51
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|1800799024|376014|7416014|38070700018;
x-microsoft-antispam-message-info:
 =?utf-8?B?ckdIZXJEZXVrNmVyZmEyc2hqTU9JdDhsM1QwKzdDa3BWRjR1QTFDY09LbUdh?=
 =?utf-8?B?aC9paVkrNFRIRFdCTDhFbVAxV29veElXdjZXeENQU3VxNGNFZG1jVjMrSFNW?=
 =?utf-8?B?MVk2OGxVdXQxdTVsc2x2Q1NaOW9WeTh6OWZ3MFY1NVpUY2RhaGlIZUZmcUFt?=
 =?utf-8?B?QXplMGd0T3AwOTk4OVlidVRDbFF0SUZvQzMyR3Y0QjgrdDhxNDJ4VzZWSG5X?=
 =?utf-8?B?NE5hWHpuWnlNZkZnbVZVY2xFVmltdEpyNGxaZ3VwKzA4dk52NkgvdUhSQlBY?=
 =?utf-8?B?THJsYzVKdmJZTFhwS2hzUm1VWVVUSmtsV3dNbkl5bU9RbWtkYXphcTlEOXRK?=
 =?utf-8?B?MFZLV0V6c0Y3ampHa2hNeHFwUHFmak9ha3NjaTh4blJENFdRb0FiSTl2czVN?=
 =?utf-8?B?R3paWEN2emV1ZnVjalJjdU8rT0Z0ZlBRSUd4MlhnRVludjdXUU41MjZBeUIx?=
 =?utf-8?B?WjdUM2xsdWhNRmxzc3VuVXJOWXdkemtzNUlPKzFPU1BFZHpuYVdBTVRWMFVE?=
 =?utf-8?B?UlJNSEhoN2ZDSkVEN3VvYjl5MFdxOERtaWFPYmVEcEZkMzdEME1vQ0dNOC9D?=
 =?utf-8?B?cUlEbExjQW9DUndyNjlLTFZHUitZTEJQVzIvUTdxNmQxcHlLY0FrME5tRnFW?=
 =?utf-8?B?TjZiYnpJVXRtZDVxSHFSNDUyb3V2YzcxT0YzKzh5YmdQRTJkYTBRNjY4ZnJo?=
 =?utf-8?B?Z3luc3Z0V3hhVmxZNm5LNFFEaDAzYlVvSjl1RzZUVUFVMER1Q2pJZUVlZk1y?=
 =?utf-8?B?RDlsRmNwS01iLzY2Y2RIUDZtaFlTS1RFeWFTRW14eEdWRlRieW9yZkVsRExF?=
 =?utf-8?B?RktpMlpYdGMzVGdQSVhsVkFLbjBVdmxsV3lXeHdXYm5YNEZqa0VxaE5jRVVS?=
 =?utf-8?B?SXVobkpUMUhmTk9XbzlLNWhyK1Z2U0prUmo4UWNzRUpQVWtNSXdCOWs3Rkxv?=
 =?utf-8?B?cXJXcmdDamVhM2lyKzAra2ZSeFJZbGhNdHgwT3BiQlQzZTVnL0s3TFFkOXMz?=
 =?utf-8?B?YVFNbWFtWGx3a1NDNm9kMGpVc1B4cTRCQ1RmVXc1d1NWSFRNSVBoWDJRbTJC?=
 =?utf-8?B?R2l5VkN3WE9NWDVnMFJ3Ny84Yy9wcDlCWHRVQlFlNjV4RzVBdDZqR09kdncz?=
 =?utf-8?B?Skw4MzNhL3h0QUNveU9sM3Q2MFRCZTI4clJWWnVZY1JYWW5WVlVNMm9ZQUJh?=
 =?utf-8?B?UENKMGpwbDlBbGdUaGRnNk9HU0VKNHNrUHVKTWxsSU5KY0ZOdlZhaUt3N0hG?=
 =?utf-8?B?ellxVlh5OU5ydkVnbmJVWURSV2Q5bVVoYzVqdkpOSlhQUUZGRTlkSmdtSzlK?=
 =?utf-8?B?eUp6Sm1WUy9OeDFBamVwYWlVSnl2QjlUZHRhUDc4enVVL1lJOUJvQzB4YWFw?=
 =?utf-8?B?a3g0VTl3RVNUQnNobUVQaXNaanljcGNaUkx3SkxTdnl0TVlTaSt6NUxodmEx?=
 =?utf-8?B?YU9VcUpmT0o1czgxY3pCV0g3NzEyME5jeW04TWZVRzdPM0VTMVJsTitnNEhZ?=
 =?utf-8?B?Y3NETkErMmRtSXhjdDNrd0pBMTFDclY2dSs4RFNWRUYySXRoMkxUd2VoRVhQ?=
 =?utf-8?B?VHMzaUw5S3QzYmxtQ01jK0FiSmhzWVN0ZVYrT0hKdVVSWnl5Rk1wY0Z6M2Va?=
 =?utf-8?B?WnNmM0MyL0xXZEZpSDdhMU4zaXAxYm5nTjl4L3B6L253R3loTm5QZWkybjZm?=
 =?utf-8?B?OStZWG0wTk5sY2sydHlLeFU0WlhnNHhqeEtzS3BwNXFXMEZVVkw4TWkzNm5P?=
 =?utf-8?B?LzFZa2ZPNlhFMDM0SVp5aUJEeTN3dTJ0MjdCR0E0U1N5QVJGbHdHTklZV3ZG?=
 =?utf-8?B?V2xOak1teXkrZUNWWm5Rdit4SVhaQWlsdWJSdjdFdERGU3VPdkcrVmdKdkFG?=
 =?utf-8?B?ZUdtQVE1c29XNlpKbG1kVXIyZlNRUkx6bnF2Q0YxejVVbXc9PQ==?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?QWxxTWFlWStLcHB4a3p6dDhzejdWeEdCYmNXYmptNEY4amFkNXBsbEhMb05W?=
 =?utf-8?B?NlNnOEpwQ0Uwek5jaTVXcEJxOGZkbDE1dnVxTzVweGdEZzN5U2p5OU1leW9v?=
 =?utf-8?B?VGxTTWNWTHdFaUUvd2hCQkllREF0a3hibHRueUhaU0ZjNXpaY205bHN5N0JJ?=
 =?utf-8?B?QUxXWVdwMlYyZUNtemU5LzF0UXF2K255OERUTk5TcldnSjJ0azB0QWozNFha?=
 =?utf-8?B?MTVqWjU0RGtmb0plcUVQa1hWYk1CTVFNbmlmQXRwakljTkl1Ujh3VklLOXFK?=
 =?utf-8?B?NXBObkJvWjBMaUVwcm5QYmxxZVc5UnlSRlUwVjRnNkhvN1ltTnRJNU9lZXI3?=
 =?utf-8?B?aXZwbE02NFR1cUN3RUhKR2JzbFRPWS9PcHRRbWVTLy9JS3lMd3ZsTXZKUGFi?=
 =?utf-8?B?ZWpzWHpmd2Z1WG1CcmdlWVk3YzZMK0RKV1Z1QlRMYi9tNjFyV2xPa0I0NkVT?=
 =?utf-8?B?V2dKb28yU2xGT0xQbCtCMG15UmJIb0hiN0Y3UmM2TmhXSmFuWUZYRW5oaXBx?=
 =?utf-8?B?SSs5Wmh2b1pJRnFUM0s0Z1BRV3R1Y09PUXRka3VDU0J4cGoyNEFqdlE4cGRh?=
 =?utf-8?B?YVgzV3FlMHJEM2hheTkyYWcrMUdlYVFFekdMbW4veHpWYkZBY3UxUWZYekpH?=
 =?utf-8?B?UFNoelhlYm9JL1VDSmtWWlpiVTlJeUhGNVRjc0tWT0wxZGgvUVdPNklPbzRt?=
 =?utf-8?B?N3lyNzFRSGVVNlRPY2UyVXVVV2QwK0pmUDdmU0c2ckZDY21kNUxUcVQzbUQ4?=
 =?utf-8?B?aTIzbWhqSWVudWl4WGRnL0xYdDdWSEpBSkkwODZWbU1kSUhNRDgyMlVvaFhW?=
 =?utf-8?B?RHlqdTVuMm1qTFliS290bCtJRWNNRTdFenVQeHNEaEVaT1ViMlZOZ3gyTkQw?=
 =?utf-8?B?djhiVzE3cm1IRHMrb1dkQmRBMnAxVDZxNTdad3p5M0lac3BlakltS3JNMENj?=
 =?utf-8?B?c20ydzZGRGhUZDRyem9XRDV4UFRtazV6WExMUHUvUnBIa3J6Nkx6VTNXRmQx?=
 =?utf-8?B?ZzNZaVJrVENNdXBVTXlRSlJ4K1ZCY1c2UllmRlFqTysxYURJU0EraFFkSkNn?=
 =?utf-8?B?UHFOMFJSdVN2ajZWNWtoU1FseEtOWHh2VGNndG94Z3k0MCtqSmRTOFpqYWt4?=
 =?utf-8?B?TDlERG5hV29XR0FGcmlHRXYvM2hwUS95RDFDTElqZjNacm1sN2YzcHg1dGR3?=
 =?utf-8?B?T1ArQ2VhS2FrOG1FQVNQcFNmME1rNlAvSVQrbnlRUjduSDJHaG9JYUl5R1U4?=
 =?utf-8?B?NnY2Tis3RDN4VTczUVQvaUg0VHE1WjlZajhURUd4Q2t3c1ZuZUtaL3ptSWYv?=
 =?utf-8?B?ck0zanlVaW4reE9iaGVzanR6NmhYUk9pL0R2UjdDa3NpWnZMYTh2WkdlZUdB?=
 =?utf-8?B?R1FybjM4QUNLUjdjY3o3YUFFaEZQN29KK3drelBrY00wYVlyY1FrZkYrZVRj?=
 =?utf-8?B?TmxhQVpqU3F0cGxXc2lLZm1pS05OaGZHUzN6d3RyY0c2ZXBDR3gyVjhXbVZE?=
 =?utf-8?B?K2E2UjJtZlN0b1BWMFJ4MkxGaEcyeW5WMjYya2w3eVRyWUhBeDdYYVBQblNj?=
 =?utf-8?B?Z0FYekFwZFJqQm41SXZoQXp3TzNlQ2Q0WjVZQzZDVXI1a3NXOStkS0hmemNN?=
 =?utf-8?B?MldvaGxLWmV5M1NDSjZTSVV4WGx4WjhLRkt2M2QvYXI2SjcwZkpEcDlvQTlz?=
 =?utf-8?B?djVkMkkxQ25aNU1kTkNxcmIza0MyVlM0ZisvbG5DZlZtM3dVRzhCM0x2b2NV?=
 =?utf-8?B?S1dpeTZ2ZERWbXExTlJ5ODRtWmNjQ3VjbzFtcjlMZUhwZG4remJyR29MYXlW?=
 =?utf-8?B?QnE0UklsRkc5N1N5dSsyM0ZXV3NWSDYwUytNdFhUZktBV2VDZ1ZSNFFaeVVk?=
 =?utf-8?B?QkRWcURZMldoZHhrMDVlTk0rNGFtcitKOHVaRzlmay8yeHYybjdOaGVFZGNU?=
 =?utf-8?B?YnIvR2ZubU9vQWpFd3hDZmJQZUR2cFdxaGF4S0VUeHk0ZmZ5aDFmTDVSSGZH?=
 =?utf-8?B?ME9HdmJGQWxkRUhXNHVublBBa053eUtiOUphM0JBdnJyMmRobFYwVmE0dDM3?=
 =?utf-8?B?OCtlV21GMy9DYUdBcGovU3dRdHI1aDZYUThPODhGZXB4NnlwSEE5Y0VhbllL?=
 =?utf-8?Q?2FME=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <024BC83DD41BB149A0398C169895AF2B@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: ccb8baeb-09d9-498e-0079-08dcc0dd5d51
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Aug 2024 06:00:16.5175
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: KqQE1m89R4BtFSMwxz9+ZqIdDrpmjerYE+s6tVZMtr/HQcOMv/GMownGXuOprCD/ArfqblZ2Bn5wlHQhqn/66A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6702

T24gMjAyNC84LzE5IDE3OjA0LCBKYW4gQmV1bGljaCB3cm90ZToNCj4gT24gMTYuMDguMjAyNCAx
MzowOCwgSmlxaWFuIENoZW4gd3JvdGU6DQo+PiBAQCAtNjcsNiArNjgsNTcgQEAgcmV0X3QgcGNp
X3BoeXNkZXZfb3AoaW50IGNtZCwgWEVOX0dVRVNUX0hBTkRMRV9QQVJBTSh2b2lkKSBhcmcpDQo+
PiAgICAgICAgICBicmVhazsNCj4+ICAgICAgfQ0KPj4gIA0KPj4gKyAgICBjYXNlIFBIWVNERVZP
UF9wY2lfZGV2aWNlX3Jlc2V0Og0KPj4gKyAgICB7DQo+PiArICAgICAgICBzdHJ1Y3QgcGNpX2Rl
dmljZV9yZXNldCBkZXZfcmVzZXQ7DQo+PiArICAgICAgICBzdHJ1Y3QgcGNpX2RldiAqcGRldjsN
Cj4+ICsgICAgICAgIHBjaV9zYmRmX3Qgc2JkZjsNCj4+ICsNCj4+ICsgICAgICAgIHJldCA9IC1F
T1BOT1RTVVBQOw0KPj4gKyAgICAgICAgaWYgKCAhaXNfcGNpX3Bhc3N0aHJvdWdoX2VuYWJsZWQo
KSApDQo+PiArICAgICAgICAgICAgYnJlYWs7DQo+IA0KPiBJdCBvY2N1cnMgdG8gbWUgKG9ubHkg
bm93LCBzb3JyeSk6IERvZXMgdGhpcyBjYXNlIHJlYWxseSBuZWVkIHRvIGJlIGFuDQo+IGVycm9y
PyBJLmUuIGRvIHdlIHJlYWxseSBuZWVkIHRvIGJvdGhlciBjYWxsZXJzIGJ5IGhhdmluZyB0aGVt
IGZpbmQgb3V0DQo+IHdoZXRoZXIgcGFzcy10aHJvdWdoIGlzIHN1cHBvcnRlZCBpbiB0aGUgdW5k
ZXJseWluZyBYZW4/DQpJIGFtIG5vdCBzdXJlLCBidXQgZm9yIHg4NiwgcGFzc3Rocm91Z2ggaXMg
YWx3YXlzIHRydWUsIGl0IGRvZXNuJ3QgbWF0dGVyLg0KRm9yIGFybSwgdGhpcyBoeXBlcmNhbGwg
aXMgYWxzbyB1c2VkIGZvciBwYXNzdGhyb3VnaCBkZXZpY2VzIGZvciBub3csIHNvIGl0IGlzIGJl
dHRlciB0byBrZWVwIHRoZSBzYW1lIGJlaGF2aW9yIGFzIG90aGVyIFBIWVNERVZPUF9wY2lfZGV2
aWNlXyogb3BlcmF0aW9uPw0KDQo+IA0KPj4gKyAgICAgICAgcmV0ID0gLUVGQVVMVDsNCj4+ICsg
ICAgICAgIGlmICggY29weV9mcm9tX2d1ZXN0KCZkZXZfcmVzZXQsIGFyZywgMSkgIT0gMCApDQo+
PiArICAgICAgICAgICAgYnJlYWs7DQo+PiArDQo+PiArICAgICAgICBzYmRmID0gUENJX1NCREYo
ZGV2X3Jlc2V0LmRldi5zZWcsDQo+PiArICAgICAgICAgICAgICAgICAgICAgICAgZGV2X3Jlc2V0
LmRldi5idXMsDQo+PiArICAgICAgICAgICAgICAgICAgICAgICAgZGV2X3Jlc2V0LmRldi5kZXZm
bik7DQo+PiArDQo+PiArICAgICAgICByZXQgPSB4c21fcmVzb3VyY2Vfc2V0dXBfcGNpKFhTTV9Q
UklWLCBzYmRmLnNiZGYpOw0KPj4gKyAgICAgICAgaWYgKCByZXQgKQ0KPj4gKyAgICAgICAgICAg
IGJyZWFrOw0KPj4gKw0KPj4gKyAgICAgICAgcGNpZGV2c19sb2NrKCk7DQo+PiArICAgICAgICBw
ZGV2ID0gcGNpX2dldF9wZGV2KE5VTEwsIHNiZGYpOw0KPj4gKyAgICAgICAgaWYgKCAhcGRldiAp
DQo+PiArICAgICAgICB7DQo+PiArICAgICAgICAgICAgcGNpZGV2c191bmxvY2soKTsNCj4+ICsg
ICAgICAgICAgICByZXQgPSAtRU5PREVWOw0KPj4gKyAgICAgICAgICAgIGJyZWFrOw0KPj4gKyAg
ICAgICAgfQ0KPj4gKw0KPj4gKyAgICAgICAgd3JpdGVfbG9jaygmcGRldi0+ZG9tYWluLT5wY2lf
bG9jayk7DQo+PiArICAgICAgICBwY2lkZXZzX3VubG9jaygpOw0KPj4gKyAgICAgICAgc3dpdGNo
ICggZGV2X3Jlc2V0LmZsYWdzICYgUENJX0RFVklDRV9SRVNFVF9NQVNLICkNCj4+ICsgICAgICAg
IHsNCj4+ICsgICAgICAgIGNhc2UgUENJX0RFVklDRV9SRVNFVF9DT0xEOg0KPj4gKyAgICAgICAg
Y2FzZSBQQ0lfREVWSUNFX1JFU0VUX1dBUk06DQo+PiArICAgICAgICBjYXNlIFBDSV9ERVZJQ0Vf
UkVTRVRfSE9UOg0KPj4gKyAgICAgICAgY2FzZSBQQ0lfREVWSUNFX1JFU0VUX0ZMUjoNCj4+ICsg
ICAgICAgICAgICByZXQgPSB2cGNpX3Jlc2V0X2RldmljZShwZGV2KTsNCj4+ICsgICAgICAgICAg
ICBicmVhazsNCj4+ICsNCj4+ICsgICAgICAgIGRlZmF1bHQ6DQo+PiArICAgICAgICAgICAgcmV0
ID0gLUVPUE5PVFNVUFA7DQo+IA0KPiBFSU5WQUwNCj4gDQo+IEJ1dDogV2hhdCBhYm91dCB0aGUg
b3RoZXIgZmxhZyBiaXRzPyBZb3UgZG9uJ3QgY2hlY2sgdGhlbSAoYW55bW9yZTsgSQ0KPiB0aG91
Z2h0IHRoZXJlIHdhcyBhIGNoZWNrIHRoZXJlIGJlZm9yZSkuDQpCZWZvcmUgdGhpcyB2ZXJzaW9u
LCBoZXJlIHVzZWQgdmFsdWUobGlrZSBlbnVtKSwgc28gbm8gY2hlY2sgZm9yIG90aGVyIGJpdHMo
c2hvdWxkIGJlIHplcm8pLg0KSSB3aWxsIGFkZCBpbiBuZXh0IHZlcnNpb24uDQo+IA0KPj4gLS0t
IGEveGVuL2luY2x1ZGUvcHVibGljL3BoeXNkZXYuaA0KPj4gKysrIGIveGVuL2luY2x1ZGUvcHVi
bGljL3BoeXNkZXYuaA0KPj4gQEAgLTI5Niw2ICsyOTYsMTMgQEAgREVGSU5FX1hFTl9HVUVTVF9I
QU5ETEUocGh5c2Rldl9wY2lfZGV2aWNlX2FkZF90KTsNCj4+ICAgKi8NCj4+ICAjZGVmaW5lIFBI
WVNERVZPUF9wcmVwYXJlX21zaXggICAgICAgICAgMzANCj4+ICAjZGVmaW5lIFBIWVNERVZPUF9y
ZWxlYXNlX21zaXggICAgICAgICAgMzENCj4+ICsvKg0KPj4gKyAqIE5vdGlmeSB0aGUgaHlwZXJ2
aXNvciB0aGF0IGEgUENJIGRldmljZSBoYXMgYmVlbiByZXNldCwgc28gdGhhdCBhbnkNCj4+ICsg
KiBpbnRlcm5hbGx5IGNhY2hlZCBzdGF0ZSBpcyByZWdlbmVyYXRlZC4gIFNob3VsZCBiZSBjYWxs
ZWQgYWZ0ZXIgYW55DQo+PiArICogZGV2aWNlIHJlc2V0IHBlcmZvcm1lZCBieSB0aGUgaGFyZHdh
cmUgZG9tYWluLg0KPj4gKyAqLw0KPj4gKyNkZWZpbmUgUEhZU0RFVk9QX3BjaV9kZXZpY2VfcmVz
ZXQgMzINCj4gDQo+IE5pdDogUGxlYXNlIHBhZCB0aGUgMzIgdG8gYWxpZ24gd2l0aCB0aGUgMzAg
YW5kIDMxIGluIGNvbnRleHQuDQpXaWxsIGNoYW5nZSBpbiBuZXh0IHZlcnNpb24uDQo+IA0KPiBK
YW4NCg0KLS0gDQpCZXN0IHJlZ2FyZHMsDQpKaXFpYW4gQ2hlbi4NCg==


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 06:13:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 06:13:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780035.1189623 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgI6z-0007h0-O0; Tue, 20 Aug 2024 06:12:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780035.1189623; Tue, 20 Aug 2024 06:12:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgI6z-0007gt-LD; Tue, 20 Aug 2024 06:12:57 +0000
Received: by outflank-mailman (input) for mailman id 780035;
 Tue, 20 Aug 2024 06:12: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=6ZGS=PT=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1sgI6y-0007gn-NU
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 06:12:56 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on2061d.outbound.protection.outlook.com
 [2a01:111:f403:2417::61d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3cd33ce0-5ebb-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 08:12:55 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by PH7PR12MB8593.namprd12.prod.outlook.com (2603:10b6:510:1b1::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug
 2024 06:12:51 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285%4]) with mapi id 15.20.7875.019; Tue, 20 Aug 2024
 06:12:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3cd33ce0-5ebb-11ef-a507-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=l3FJ5Tyxi6yg7ury7RNBOYClLX/tYsfCFeI7z1tMZocXYaLuSo+TK/MbMisrx8TKhk80le1dSH7ZpMC5/iGwM1hL20C0oArLoiJXD704vWTVVvzDedMXjPGy+Zqd/d+UlVknGNLzvZqGBzdqbo/q4LXdbIOECEaWQm2JHldjnwjc8w45k1xFrcJD60Dq4GbPOjMwqQxlTSbvVLi1COTGKuXte03v/yPFapaGLjpEg5XFQqbnyFXRzr/pLIQAJiIH8YwYt8yxt8DVzzhdlvSDZIp4KhCfEzSZezhpm2y9mhPr0OTbGFGd6+uWwsrowuayRb1vngq14BicyE/6LRRdng==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=EOX85DeANSd3PGl8QdSsA882ADmI/bLRfN2SMsCyVJE=;
 b=Vs+abFIfBxg8k0vVCYaV/u7vAYR7/DhVLJDSkn2EFDBRvjkhyTEk4ABGPEIyUtlLTApCqAhGBci45zoN1NIA03oq8oKf1cEG4Ij/LwjNq07MQPZpF2qWknF1krkClTmEDhbCsHf/JnTHZLqlCuU4MBS4BUZQMlKinws2mziBb1r8GyEUmSwx5ASdGc7wiAW5sSBVxQypIW9Hle8uiB+Rlc9ceV7atykM8blryAg3FsrIro1d4WEqHIY52UZy+kAVlZeRZp1fpdGJZfvSF/aFjB26r18cGvoI/ahI1Rf8F8WTt+W9fj+mTZgG/PawDFQgG3mhnkW2N189tncQwgqUtQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=EOX85DeANSd3PGl8QdSsA882ADmI/bLRfN2SMsCyVJE=;
 b=RHJtfT6+H5YsnXhoYf+RSYd56vOGmf5glTT4Y8jjCbM5boIjsxhjj6c30tr8xNdppoxjy5pjfqeorZQVBq+UebYiqNVBSf5wNU514WolXPOIxexlvB7CQ7AERVtgsx++byVOgDblTHYcyS4cjBCf95G1gorvnB3Ps+8uONmaquI=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>, Wei Liu
	<wl@xen.org>, George Dunlap <gwd@xenproject.org>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD
	<anthony@xenproject.org>, Juergen Gross <jgross@suse.com>, "Daniel P . Smith"
	<dpsmith@apertussolutions.com>, "Hildebrand, Stewart"
	<Stewart.Hildebrand@amd.com>, "Huang, Ray" <Ray.Huang@amd.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, "Chen,
 Jiqian" <Jiqian.Chen@amd.com>
Subject: Re: [XEN PATCH v13 2/6] x86/pvh: Allow (un)map_pirq when dom0 is PVH
Thread-Topic: [XEN PATCH v13 2/6] x86/pvh: Allow (un)map_pirq when dom0 is PVH
Thread-Index: AQHa78ytu3Dw7+A5rUaTPQAvAsIAxbIuTvuAgAHk7QA=
Date: Tue, 20 Aug 2024 06:12:51 +0000
Message-ID:
 <BL1PR12MB58492B55B496755585774CB0E78D2@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
 <20240816110820.75672-3-Jiqian.Chen@amd.com>
 <4a421c07-d8a0-4af9-816f-5d76d39fe31f@suse.com>
In-Reply-To: <4a421c07-d8a0-4af9-816f-5d76d39fe31f@suse.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: BL1PR12MB5849.namprd12.prod.outlook.com
 (15.20.7875.019)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|PH7PR12MB8593:EE_
x-ms-office365-filtering-correlation-id: 8042cfd4-fbb7-4afb-321e-08dcc0df1f43
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|376014|7416014|366016|38070700018;
x-microsoft-antispam-message-info:
 =?utf-8?B?WkRONnJiN0pYcUk3NVZWeDBUVFpBSVZiZWdpaGNlanVhaW9YVndMblYwaU5s?=
 =?utf-8?B?VEFQRnByWnVMUTJmb09VM1JINGd6S3ZwVEVmT2RMZGdBZDIzbW45TERESy90?=
 =?utf-8?B?YmdYeVNpMlhuQzJWTjAxWUx1Y0JkSGorcjVFaEFhVW1JUjZVSXg1Yy9IaUhm?=
 =?utf-8?B?eEdkU282Y3YrMUN2VWNNOXpvYS9NU25semxXOHAzYlpaUDV2N3RBb1J3WG1M?=
 =?utf-8?B?MHFjQUxuSlhadlpuR0I5M2hqaFJPd1puK0YwTnZ6T1RNRHNLOGNyTkFCOTYx?=
 =?utf-8?B?cmNFN2l1QkR5bnByaEdrc0ZvY2dWQjcxOWQ4ZWlIQlRoYlNIdFZFU3oyK2lF?=
 =?utf-8?B?cFkzOTZmTmxVQ1hPYlltZXhFb0hlcEpwZm9uR3pvditZV0FnYnpheWZicXAw?=
 =?utf-8?B?WDJwS1JQaDUxalZTR1duTFNLLzhPN3c2WlVTYnBZblREK1dBbFc3dVpZUTky?=
 =?utf-8?B?cVRJS3BXQ2VEWWpRYU9iSmduYjdWbE1Ic3diK0VGY09zbGxpTVAvWDlkaVZJ?=
 =?utf-8?B?eWExR3dNdURwQUNnY2xseS9XSk1sL2xvMDBIZlVQSFl0ZUdIQzhoS2hOMXIv?=
 =?utf-8?B?Wks3N2g0Tkg4ZlFhQ1VPcjIvR0lKaU1oT3NQUXB4aUhKSzZkYm9sdmsxOGhY?=
 =?utf-8?B?d1hxblVSdTNBcjBqWGNpYkNhdnlEclZJNEtMbHBHVXNWUnlHL1NIbEptVTd4?=
 =?utf-8?B?bjk0Rlljdm01c1MzYzg3YTBZbnNvR0xYOWZOcDBZVFU1NEM0cUEvZGFvYmh5?=
 =?utf-8?B?dFNFcFlhV25CSHkvOGUyaCtwMXBZVURZcGF2MUJRZ1B4UUZxTlZKVlZKZFNJ?=
 =?utf-8?B?NHordWJqK0tIY2JiMFJuUmJzUzJNTmk3TUo1TzFDTWVWeFFyN1Z1RTQrTXl3?=
 =?utf-8?B?dTA1WTZsYU1HR0F1azdEazZiQkV4NFlmdGg0Z0M3QVRLRVpYRVVyaWQvYmp6?=
 =?utf-8?B?RWY3eGxZLzBTRys3bHhJaDBsR1pQVE5tMjdob0FLcUw0NmJqNVpjWngwZ3Np?=
 =?utf-8?B?UEZHL1B1MVZUZ1pwUEx5NEx0TVVEcXV6T2Q0OU1PR2dyeWxuY3BCaDVCN0k5?=
 =?utf-8?B?RW9zRU82eG5zNmNZVDd5SDFoUmtqUDUvQ1NjLzFWNzJyL3NQVUgwV2xad0pS?=
 =?utf-8?B?RnU4cG9VMXRRdy9sOHhsdlhWTk9USVRxSjc0YVVUTU9zblllNUZ6VFIxNUgv?=
 =?utf-8?B?dFpnM1h3N1BZMU55NzZWaUw0SlRaSDdrcmF3b28rNW9FM0JVVXFadGpjR0pZ?=
 =?utf-8?B?MzlFK0lPOXdSVG04ODNDbG51SFlMODEySFd5azQzcTJlempMcDFET2xSNjNi?=
 =?utf-8?B?cVZIK3VSU0JVVFA2eEtwYUFhMnFGajhibklueXBUWU5aRkwrdHk5RVRqVTJp?=
 =?utf-8?B?dFR6ZHZ1THFQTXlNaVM0QVdhOCtZUkcwbjZqdy93SFRvdG9PWGFFampMT0h5?=
 =?utf-8?B?SEdQNEVlOEJzNXpRV1hOajhKRldRQ3hqTzJuc1BLT3ErWVhBNFdqei82L2dN?=
 =?utf-8?B?c1dVOWRxdFYyZjB2R3lsR0wza1BVNmdWMzB2V0Y4Z2xQTWdlOCthc2UySXdC?=
 =?utf-8?B?R3VMT2RWSVBhNEpkR2RFN0NKVlhRMVFYeUl1Z3FoOFZsTGxnUmpUQ2FwTmtZ?=
 =?utf-8?B?ZTNheXpDVEp0OFFyem9MZXozMTkrcUt0VkQ0bVZLUDlKT3ZHbWo3TzJ0NlJ6?=
 =?utf-8?B?ZEkxNWJGelNjbEJYTXk3Q3QvV3d1QmM3VmFxaGtlTFNXOHRCeENxU1ppcE1o?=
 =?utf-8?B?alhzakhLQzd4aUpOZHVUTFFCVk9EQzZqUy9DUEQvTzZMb0x2SzdyNTlkWFVO?=
 =?utf-8?B?cU9zVTdMSVNWSzZPQjFXM0gzRDRiRktiN2YrTWdDTktVb1NVY2VZd1QxQ2Q5?=
 =?utf-8?B?d2VmUU9vTkRYZCs3bTV6bWgzS3lYS0krelRqU28vRDl0Tmc9PQ==?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(366016)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?RXFEbHJSek5wbHFFeTN1a2JoajZDVHg3elZzMURMbmRManhzTjkyVTRDcmph?=
 =?utf-8?B?TFdRajEzc1dXZEZnTlBaRkJOZ0FwUUZWMXRFT1ZRVzVRZ0FXSk9ZL1Ywb2xJ?=
 =?utf-8?B?RUtBN0pFTWN5S2JOWVJRdS9vTi9jZy9ZeHljRmpjL3FteXhZRUtKYWtiYy9u?=
 =?utf-8?B?bHJDZ2NNQ0ZMUGkyQzh6b0hKUElobkFCZTRhMjl5TzNCcitsemgxNHJMSGJk?=
 =?utf-8?B?TFhFNDEyRVpVcEdjVjE1Smw5YkxRWUF4ejBaZkVKMlgxNEx3SGtvV1p0bkIw?=
 =?utf-8?B?N3VjbW1HVFdNTzZrQ1E1bU5TOHBCdVBzVU9ZRHVOazArLytYS2pjd2R1a3ND?=
 =?utf-8?B?aWdqNUhDOFRMb3VaTlAvUDJVenE4dnErT3l6QzcxTDVWVjJtN0p4RjBINjlk?=
 =?utf-8?B?MlpMNjFSRGQ0SlNTTWtRb3lEN3FiWk5oNFJpM3ora1JpdHJ4Mys5S2NIdEUw?=
 =?utf-8?B?OFREdFBMeklMQUNxeWZxZ2Z1MVFoLzBpVkU3cFZtTXlHaVhvQzVVRUFlWUNr?=
 =?utf-8?B?UDFKdzl3M3UvOEVia0NuTjdIQld5eTBGWlJOOXJyc1ExRXhGdlBDUkhWMWQy?=
 =?utf-8?B?dExxc2pNa3NTMTBkdlQva3JwTFBSamRmbHdZZ2cwanEvdDN5OUNOQ1dWZXVX?=
 =?utf-8?B?aHI5SHNlcnErSW40U2JRcksxRFAyejNZRUsyWXdzRUtFRzBEc1ZEaGZmQjl5?=
 =?utf-8?B?ZDNNS2FPYS82bkMrWVNEL2JvVWs0TjY3MDNTdFR5WXJuRmwweFFPRGlnVDVs?=
 =?utf-8?B?N0xpRFF2dHRFamx2MC9wL1FyMy83Mk9UYVA2VFd6cjBDNDNObDNSL0hKZHVR?=
 =?utf-8?B?T2Z5M0hmNUFUMnNQOTltcjBLTVVFcTRtajVrR0xjTWVicVpGa2tXRWlCU3lx?=
 =?utf-8?B?Z1puYVVMYlRwdlFvQW9YUXdOOHRwakl1RG1UbjZ2a1lnWjhJOHZ5S0l0bU1G?=
 =?utf-8?B?c0QrcjN1dDB0NXlFbnpXdTd0MWNwMThLWXlpbmtRbVo4NDVQelJFRmR3dHpt?=
 =?utf-8?B?dUp3S1l6ZVdXY1J0NE9ONlR5S25YWGxsbnF3QUFBMDlJK29PVzJyTVNQN1pw?=
 =?utf-8?B?T2lJdjJsM2tqa3c3QnBBeXRsK1VYWEIvbTFIYjBUTlhmSVhpSmtsa1k0U2Fk?=
 =?utf-8?B?U3l0VjRXTEhQclBkME1wdHc4VlNBakRUb0RHSHgwem14M2owYmhDeFZzWGdy?=
 =?utf-8?B?VUpHOWxqc1RIUHhoV3VaR1o4RDRMMDRZRlQ4anpFWG81R2xzR1lHT0lWVXJq?=
 =?utf-8?B?TXMwRnE4cnZGbi9MdDViazdlK3RscUlVb2FKSjNUMnNoMy95cGZ4WXNKWUgw?=
 =?utf-8?B?TXlTZzlpMDNEUzZ3Um1OMERCYlQzUUtLOFVraUd6TW5hcUZaVC9iZEljcEQ2?=
 =?utf-8?B?NFIzUXdUL2JYa1NRZlBqVG92VDBpWTFKR0xURHYydkpQa1lLYkkzWlg0cUV1?=
 =?utf-8?B?VktVN0N2dEltSGpTdERKNGZlYWtFL2VuSkwvWE15K01GdTYyWWVhOUJtWWpn?=
 =?utf-8?B?QVkyamV0bVJTcUM1clJBVXcwQ01HVmdUaGt1bVp1Si9PYUZDb0psaDFTU0NI?=
 =?utf-8?B?R3RTeXgzR2c1Uml3QnMycEpEWlZjMTd0aE5FU1pObGR4anJKZGlDVWJteDRV?=
 =?utf-8?B?VitBTFpLOGphVllYSzVab2JwT3VXTzhncVhtVmI5SDA3ZjhmYTVvZEo4N1dH?=
 =?utf-8?B?TlNYOXhTeFBnZW5qRDZGM29RaGVuNjA3SGc1Tk5TRXVQdFV3Mmc3ZXRhTWVV?=
 =?utf-8?B?MENscDFMYzNaY2JsTVVoYlVZdHZ3TWhrcnozQm5NY0ZiNC9TZTE1a0lYK3pX?=
 =?utf-8?B?MnBYRzlvM0dnNHFySXdva0krL09aUXNoWE93YU1HMkZuY3N2cXI0dFJ0Z2Vs?=
 =?utf-8?B?OHpXRXY0T3cwNkc0a0I4WVltZHo4QklhdHhtTXI2RWl6c0JycFRCcnRqU1E5?=
 =?utf-8?B?T3V2TTJRRXdLVUJOcE13NVF5QWdHOXA5SG1rSis0VmFZSkUzb3RTcGdya1NS?=
 =?utf-8?B?TDhNRk41aitUbWVMWktZRXI2M1JxdWx1Tjh2eDBpQ1UybFluTUpnVDRoeEJC?=
 =?utf-8?B?RDZBakIvYlZYMXArQmhvZzV0Ukp1Z2hFSHRLd1ZWdGRWOUs5cVlodVB4OTNY?=
 =?utf-8?Q?ZsFA=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <8C5F9B67C0E6F3438F733F1EB6678121@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8042cfd4-fbb7-4afb-321e-08dcc0df1f43
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Aug 2024 06:12:51.4320
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: RsdqZ6mjK/xzrLtDRDQSPSXelXCJO5b4xEn12GV5dGGauqn0T47NI6cIcH5vEwbsW9C0F6WUPBhHYf9UPaaXeQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8593

T24gMjAyNC84LzE5IDE3OjA4LCBKYW4gQmV1bGljaCB3cm90ZToNCj4gT24gMTYuMDguMjAyNCAx
MzowOCwgSmlxaWFuIENoZW4gd3JvdGU6DQo+PiBJZiBydW4gWGVuIHdpdGggUFZIIGRvbTAgYW5k
IGh2bSBkb21VLCBodm0gd2lsbCBtYXAgYSBwaXJxIGZvcg0KPj4gYSBwYXNzdGhyb3VnaCBkZXZp
Y2UgYnkgdXNpbmcgZ3NpLCBzZWUgcWVtdSBjb2RlDQo+PiB4ZW5fcHRfcmVhbGl6ZS0+eGNfcGh5
c2Rldl9tYXBfcGlycSBhbmQgbGlieGwgY29kZQ0KPj4gcGNpX2FkZF9kbV9kb25lLT54Y19waHlz
ZGV2X21hcF9waXJxLiBUaGVuIHhjX3BoeXNkZXZfbWFwX3BpcnENCj4+IHdpbGwgY2FsbCBpbnRv
IFhlbiwgYnV0IGluIGh2bV9waHlzZGV2X29wLCBQSFlTREVWT1BfbWFwX3BpcnENCj4+IGlzIG5v
dCBhbGxvd2VkIGJlY2F1c2UgY3VycmQgaXMgUFZIIGRvbTAgYW5kIFBWSCBoYXMgbm8NCj4+IFg4
Nl9FTVVfVVNFX1BJUlEgZmxhZywgaXQgd2lsbCBmYWlsIGF0IGhhc19waXJxIGNoZWNrLg0KPj4N
Cj4+IFNvLCBhbGxvdyBQSFlTREVWT1BfbWFwX3BpcnEgd2hlbiBkb20wIGlzIFBWSCBhbmQgYWxz
byBhbGxvdw0KPj4gaVBIWVNERVZPUF91bm1hcF9waXJxIGZvciB0aGUgcmVtb3ZhbCBkZXZpY2Ug
cGF0aCB0byB1bm1hcCBwaXJxLg0KPj4gU28gdGhhdCB0aGUgaW50ZXJydXB0IG9mIGEgcGFzc3Ro
cm91Z2ggZGV2aWNlIGNhbiBiZSBzdWNjZXNzZnVsbHkNCj4+IG1hcHBlZCB0byBwaXJxIGZvciBk
b21VIHdpdGggYSBub3Rpb24gb2YgUElSUSB3aGVuIGRvbTAgaXMgUFZILg0KPj4NCj4+IFRvIGV4
cG9zaW5nIHRoZSBmdW5jdGlvbmFsaXR5IHRvIHdpZGVyIHRoYW4gKHByZXNlbnRseSkgbmVjZXNz
YXJ5DQo+PiBhdWRpZW5jZShsaWtlIFBWSCBkb21VKSwgc28gaXQgZG9lc24ndCBhZGQgYW55IGZ1
dGhlciByZXN0cmljdGlvbnMuDQo+IA0KPiBUaGUgY29kZSBjaGFuZ2UgaXMgZmluZSwgYnV0IEkn
bSBzdHJ1Z2dsaW5nIHdpdGggdGhpcyBzZW50ZW5jZS4gSSBjYW4ndA0KPiByZWFsbHkgZGVyaXZl
IHdoYXQgeW91J3JlIHRyeWluZyB0byBzYXkuDQpBaCwgSSB3YW50ZWQgdG8gZXhwbGFpbiB3aHkg
dGhpcyBwYXRoIG5vdCBhZGQgYW55IGZ1cnRoZXIgcmVzdHJpY3Rpb25zLCB0aGVuIHVzZWQgeW91
ciBjb21tZW50cyBvZiBsYXN0IHZlcnNpb24uDQpIb3cgZG8gSSBuZWVkIHRvIGNoYW5nZSB0aGlz
IGV4cGxhbmF0aW9uPw0KDQo+IA0KPj4gQW5kIHRoZXJlIGFscmVhZHkgYXJlIHNvbWUgc2VuYXJp
b3MgZm9yIGRvbWFpbnMgd2l0aG91dA0KPj4gWDg2X0VNVV9VU0VfUElSUSB0byB1c2UgdGhlc2Ug
ZnVuY3Rpb25zLg0KPiANCj4gQXJlIHRoZXJlPyBJZiBzbywgcG9pbnRpbmcgb3V0IGFuIGV4YW1w
bGUgbWF5IGhlbHAuDQpJZiBJIHVuZGVyc3RhbmQgY29ycmVjdGx5LCBSb2dlciBtZW50aW9uZWQg
dGhhdCBQSVJRcyBpcyBkaXNhYmxlIGJ5IGRlZmF1bHQgZm9yIEhWTSBndWVzdCgiaHZtX3BpcnE9
MCIpIGFuZCBwYXNzdGhyb3VnaCBkZXZpY2UgdG8gZ3Vlc3QuDQpJbiB0aGlzIHNjZW5lLCBndWVz
dCBkb2Vzbid0IGhhdmUgUElSUXMsIGJ1dCBpdCBzdGlsbCBuZWVkcyB0aGlzIGh5cGVyY2FsbC4N
Cg0KPiANCj4gSmFuDQoNCi0tIA0KQmVzdCByZWdhcmRzLA0KSmlxaWFuIENoZW4uDQo=


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 06:33:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 06:33:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780054.1189634 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgIR2-0002rh-Bf; Tue, 20 Aug 2024 06:33:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780054.1189634; Tue, 20 Aug 2024 06:33:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgIR2-0002ra-8g; Tue, 20 Aug 2024 06:33:40 +0000
Received: by outflank-mailman (input) for mailman id 780054;
 Tue, 20 Aug 2024 06:33:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=6ZGS=PT=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1sgIR1-0002rU-EI
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 06:33:39 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on2060c.outbound.protection.outlook.com
 [2a01:111:f403:2416::60c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 214a907a-5ebe-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 08:33:38 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by LV8PR12MB9359.namprd12.prod.outlook.com (2603:10b6:408:1fe::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug
 2024 06:33:33 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285%4]) with mapi id 15.20.7875.019; Tue, 20 Aug 2024
 06:33:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 214a907a-5ebe-11ef-a507-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=JKSnX0TzAgPXmjJ0Y9bcxUC9o92zvlQFW2Uqla5Hqq6Ij4JHygDgFt60t3KA1alIJaRbnCoGIL58VcGL40a//Gb45nXnoYP4wqvlTaaEctD9R+ssR9QJ4KOUMnUKb68bZGoUMBhFoHUx/NtiJxwcUYR8Qk3jizfmQ9P7NYjTx52rstp36cH+G2kjj80hkw1/6cyofIqkqwc3CR4fCBRV3IHQpVUal0veia30w+/GycIL7lxH7zq8H5tU/JkAQ7xQxHPd+Xb8Nq5MJ/b7wn9y30ZvZRkCy1PN2+HDix+nbsSklaYncm5FffyrsTM4mjrztqF3hGf71DdhU6NOzAwA3w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=kh7cCiK6Ta3Gnc9+wwVgS8cbB8QkdG06mbiynabn1qo=;
 b=o/zVqNZTiCgPK8pYLDiLxlrlYg/bjCLaaT04YhoGjwA3FE24aXcqSjDEoialVcjqNn1n1QaenXqkIEi40hfQjcTlkR9EoxOqB+B17Dnp4olOUipqQ2OtdN16HJHfHIv59vz5l+YgaYx9a7QJh6T8lvubFqIA1zwP+CQ5BnQ+L6t77mItk7MVr+mkZNu6tvuz20NlZbhe7wqWfWavdPeQ/TwBaCbI9CXb9AS/p2wf9HTFzAIRLMDpfRkHpU/9nHSjxD+c5Qkkn1tAt72XXEhog10sllbVQTvYRqhUIbsB1yKmA/fDOBhbsLF0ZJfvnlc01Dy1EeNDwII9B/ZSBiyxcw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=kh7cCiK6Ta3Gnc9+wwVgS8cbB8QkdG06mbiynabn1qo=;
 b=V+oflCUA7/uT7f+o336aJcDjU5LTTO6fWPbihEtJUylpLD+vJM7ZTaGLI1xfnxR5X9JkQOprjjCNxsSmvguXYNjteC7yqyCk7xp0ZHORMVbOLA0uDjkWXJIG14Fx9b1VsfG+yNWXBKO7ALUGpGJoBlwXSOqBFo6w9nxc8JqnW3o=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: Jan Beulich <jbeulich@suse.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Juergen Gross <jgross@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>, Wei Liu
	<wl@xen.org>, George Dunlap <gwd@xenproject.org>, Julien Grall
	<julien@xen.org>, Anthony PERARD <anthony@xenproject.org>, "Daniel P . Smith"
	<dpsmith@apertussolutions.com>, "Hildebrand, Stewart"
	<Stewart.Hildebrand@amd.com>, "Huang, Ray" <Ray.Huang@amd.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, "Chen,
 Jiqian" <Jiqian.Chen@amd.com>
Subject: Re: [XEN PATCH v13 3/6] x86/pvh: Add PHYSDEVOP_setup_gsi for PVH dom0
Thread-Topic: [XEN PATCH v13 3/6] x86/pvh: Add PHYSDEVOP_setup_gsi for PVH
 dom0
Thread-Index: AQHa78yvTwlhsUHkMUeYQ1q1oq6CvbIuUVKAgAHlWYA=
Date: Tue, 20 Aug 2024 06:33:33 +0000
Message-ID:
 <BL1PR12MB58496D2638998EC4DC2572C8E78D2@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
 <20240816110820.75672-4-Jiqian.Chen@amd.com>
 <745cd8cc-59c2-44b8-b42b-1e5e0b3026ca@suse.com>
In-Reply-To: <745cd8cc-59c2-44b8-b42b-1e5e0b3026ca@suse.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: BL1PR12MB5849.namprd12.prod.outlook.com
 (15.20.7875.019)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|LV8PR12MB9359:EE_
x-ms-office365-filtering-correlation-id: 827fa651-bd36-473c-7cbb-08dcc0e20388
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|1800799024|376014|7416014|366016|38070700018;
x-microsoft-antispam-message-info:
 =?utf-8?B?bUVwREFmYVZ2TyszZlBiUUxjYU56WEtLdmNpU01iNEZVTzdsbGZyVVpxZ2JF?=
 =?utf-8?B?WFE0R0JkOTNhREZQb0dEdS95ZzE3Y3BDZVEzb013Snlvc1pzNC9CZ0hINk9S?=
 =?utf-8?B?dEg0aWhCc1h3SGFhMzQ1RG9WN2pJK1crNU55MVpnUlIyeUU5M1dFcjNTSHFN?=
 =?utf-8?B?V1l3bmVGdE9lQ2xub0sveEh4RHNTZmZRL0llalNJV0lmeTJjNW95Nk5yaXI1?=
 =?utf-8?B?c3d2MjJSSjJOVEpicU5vRWlvK1BnU3ZpVkFxN3M1cGlmK3VUdXVQRzNPQVZq?=
 =?utf-8?B?M0hHY3JWb1lNNFkzQ2Q1aElTRTM2TXlIeC9BVlp6ZHdhMjFmeHFiRDN0STVX?=
 =?utf-8?B?SGpwQm5VMTcvSVZ1cVZ5dk9IdlFSWjJLcnBtbUwvTk1KOUdZbXJhTWpWT3BF?=
 =?utf-8?B?dk5NamRMdWxqaHh4eUUyQzVtWFZaL2piUWlGODRQcmo2MWkrVzludEFDTGw4?=
 =?utf-8?B?N2tURHFOdUozUFdpaGhFYjJpWmdtQXRhNTQ1OVFzUzZwOXBEQkhJclNIZ05j?=
 =?utf-8?B?cUZId3NKd2xqM3hiV2VQcjBOOEpndUc1cDM1cWErdWhZcHNuQTYwanpLeFov?=
 =?utf-8?B?dVN2aklENDR0b1ZPUnUyNjBnQWk2YXIzZDR3MkRSbjlnS0JIL0U3N2hjUzhq?=
 =?utf-8?B?NUIrZ2x6OTZLNmkwSkw2b3NUSmJSY3dYa3Yyb1EwTWQzblVNek5xVWVwOGR6?=
 =?utf-8?B?S21ueVo5dXhyd1JnaDNEb25QbTN0bXN2UnJPWTRMdm9GNnZnS3JSUC9tbDBF?=
 =?utf-8?B?MCszYTVtaGplcERiZ2dkcWJScHBUbU1DS0tudzcvYUU1Zi9oOEFsS1dVN0da?=
 =?utf-8?B?U1pOV1lweFFWbkJyckE4ZFBJOTdzR0dYMVRpSE1HZDRiWjNOb20rdHhTVkhL?=
 =?utf-8?B?RENsczY5bmMwUmJpeUx2MkZzNmJveGlYQXBGa1NxT2dSZGFsVjJxR1VxZDV0?=
 =?utf-8?B?ZlYybUkvMU1UTHVqamVSUGtvdEkwZ0FsbmxRazFuM2VtNVJFRC9HemxEY0g3?=
 =?utf-8?B?NlA1bHhGaFI0WENkYUwramN4YnBvc0xQMGJPT3dBdE5qZEZkaTdZL2VwUGw1?=
 =?utf-8?B?eXZwOGZ5TFdBTzN2U3ZZOERFRVdSUnlJS3dJVFFKaGlLRDRocDZNRlRBMzhU?=
 =?utf-8?B?ZHBOTG1LQWtnTENtZ05wM1lCVjdYK0o2NDhiSlBRT3pWNDZDemE3cUxXVzVI?=
 =?utf-8?B?UUhrTG16WDNhdDZQTmtWRlg1em9iVllrenBtWjJDa29VRFZXMVhaNEZKQ2dN?=
 =?utf-8?B?M3VLNVJSTDkySnoyTlV2NHJ1T2RwMlhvQXEwWlVRZkFXWWoxRHlWMGYwakZn?=
 =?utf-8?B?QThzMkJwQUNhTVRxMGFvcUFKMkNBeUNHUUh3V3RrVTd2eVduK3gzY1J0eWt3?=
 =?utf-8?B?QWREWXBNWVJrSUJWQTdZREFPb1ZDQ0ZXMys5VnpNOWIzdG96YmJOMWIrNUJk?=
 =?utf-8?B?Y2IxZkRNaWZKd2xkbUZXVGtQcy9oVTBVVkpHdjJ0eDM4MFVNUzE1QmkrdThL?=
 =?utf-8?B?d29ZV1BDNWNlSS9JMlNCSDZuNWd6L0RIZ1NQejJiK1QrUWlnVEUrMjdsY0NB?=
 =?utf-8?B?OUl2T0Mza0FZUEtleFFxQ3NpR2g1V0FibktpbzVoT0tReDBuSWg2Z1BlNjdK?=
 =?utf-8?B?NllVNTdJbmNlMFRBQUZINm1XamZyVy9Rd1hnMURkZDBaSWx1UVhKZWJYWjBF?=
 =?utf-8?B?VWR0T3NJZ2xmeGRMdS9jTDlEc0VzaWZYZFoyUWxRS2lWd3pJZjRtSmRHUGdY?=
 =?utf-8?B?WHFlVWNVTHpSSDdLU0NUS0w5eWowYU1UVXhWeGV6TXJHRUV4YlpVM0QzTVVD?=
 =?utf-8?B?SG9iQkN3c0Z5ZXpOSTNwNmRsUjVac2hEaGVVUTNnWklMdnVsdXdlazZpN2Vi?=
 =?utf-8?B?eVNnV1I0cGs1ZVI4ZW9QREVnZ3pOK2dSY2JicGlSY3VFMlE9PQ==?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(366016)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?dDJZVVNjRGREbE1ad3BKNkZsaUUvOEFlaDVoSk1oQmIvdzZoRURleXZrbVBp?=
 =?utf-8?B?YXN3a1YwWnQ2STFsNURSUXlxbVpzcDFNdzdNM3kvaERNY0EvZVZ2OWhzWHd4?=
 =?utf-8?B?Yk5PWXJqK2E3T2p1b1dJeXlpUVowTW0yVXdIY1lCM3MwN255Q1RDNHd3QXZL?=
 =?utf-8?B?ODFTaU9qcHVlVk5OeUo0WVVUUmhRNFpwWjhQVStrQlQrbjVJMWticUN1RHpq?=
 =?utf-8?B?QmZuUUoybWVMY3hGWUtvQVlDd0RCTVVONjd3VHduajVCZkxVYm5MaEhoRFlG?=
 =?utf-8?B?bGc1ZjV0SGVFb3IvemI2Nmwvd2VKeng1bzN3cVA2MThpbFBQdlVSS2JoY3dL?=
 =?utf-8?B?RHVqR0FWSTdzeE0yUWNlWGl6TDNmYXBtemNyOE40Vk9PMTZWQ3NkdVB4ZWdG?=
 =?utf-8?B?b2EzeEt4TzNEZWIrVk5Cb01Ka0krR3V4WnpEN0NOaXpDbk1XbUtmV0xaOXpS?=
 =?utf-8?B?NzZpdFc0TEZMUHFWekVEWnhsWGRZN285VnVTZm9kdVB3NWI0RmRoTHkzYTBs?=
 =?utf-8?B?a0dYYmRDNDBoVUI2RCs4Yno2SFZyZDl5aW9MZU1tYk8rWEl5dEJkay91bzFU?=
 =?utf-8?B?Nzh4VzJ5aHg4b0JXQWdmMjdlSDBoVkpzMGRSSThjcVRSUno4YnFDWEgyY3Ay?=
 =?utf-8?B?ZExxUUdPNFFuVnlkTC92ZXZ5Y1p0bmpaVnVrQmZkK05BQkZ0eFlBcWk0WE5D?=
 =?utf-8?B?c2JTcG5KOFNXbk5PYnIwOFRCUVdwVDVacVJxc0V1ZFpMckt5SHhlcFJjc0Rh?=
 =?utf-8?B?RnZFSy80OE00UFhSaVlkUWhveUtwM1NlWnU4Nkt3c3FMV1JSQmtUVk41QkVq?=
 =?utf-8?B?WDE5Y3hkZ1BUd3JpaWZ2R3RpRXVBYytEN0lJN3NYdjFDdjRNY0pkZldZMXlj?=
 =?utf-8?B?WkhOWFBFNHFCR053UU5hQTBka1NpOGlNZUtJaGRsR2p0L2RmSk1NK0U0L2Jx?=
 =?utf-8?B?azRKOEtHZGlXb1d3NDdFYnovWllQK1pveVp5NU1LTFN5MEZHL21vMiszbFRo?=
 =?utf-8?B?dUR0bldtQnlHcS8vOEpEZDM4c245SEpoQUdJU1lNZEpJTTRaSHRGYi9ETUJ4?=
 =?utf-8?B?K00xTDRTTC9YNjl2NWNhRFJFVC9MbUh5SnRNc3ZYWU83YXFGWGhmd1FZWVRI?=
 =?utf-8?B?K1diSHlmRVpiZUVWV01DRG80RDV5NytZWEw5a2tOdmdIUzlvWFZjbEV6dWhu?=
 =?utf-8?B?dmtnckFLMDFDNmlnYnZSTW9Kbzd2VXdmSnFPNWhyeUFZUWlmYnI5bnMwdE9X?=
 =?utf-8?B?QXdoUmNzcW82WW9FQVpPMG9NWkNPeWpLbmZVeTNheDV4WmZZSjB5U3BWbjgy?=
 =?utf-8?B?TkQxVXo5Y0k4TE40M1J5dGJQandmdDhYam84bmR6VXNmRWt2M3lTQXhBK0Nt?=
 =?utf-8?B?REJqVGg3Q3BuSDdhZUR2RHIzL3V6SkNxZkJENExwRmN1eHVnekNwV0NXeVBT?=
 =?utf-8?B?MzZ0MnEzb241WHFnS291M3B5dUxqay9LOW5HL2RHRzVhSUw1QWRQNk42eElW?=
 =?utf-8?B?UkpUTE5jZWdiYjFXZDJuRU15d2NvNnhGbFFiRkhmUlovOHJUVGJNaVkvd3hV?=
 =?utf-8?B?UmxQckNtQXJOZ252eW5aNWFwRHh4UE5LOXpwV2pPZENTdGVUZ2NST00zdTc1?=
 =?utf-8?B?MWRVMWJBTHNDR2RUa3BhS3pkdThFQnRHQ2Q0OUd0YUg4SVN4b3EyUndTVmNE?=
 =?utf-8?B?QVJCbFd3UVVVQ2taTUpITk5OSi9TT3BuUWtVcU1RN1ROalRDSFcxdUdkcC9Y?=
 =?utf-8?B?M0RGa3huMm9FanhYdE9uOWZVaC9oS3picjB4eHkwMWZkNlBTdGdTYTlySGho?=
 =?utf-8?B?TjZyNmRJdnBmZTVKd3p1dVhlWlNnTkdiRXRqMThKd0l1bDBOSHBVZzltQ0Jq?=
 =?utf-8?B?dFNUTkZqSEJ4SzNLV1M2UzczMFdZWktDOHNLcmkxWHdBNkw2VG13WURSclFV?=
 =?utf-8?B?MnA1WEpMdjQzMHNFN3dCcWxTT0ZJV2FqOFEvRy9VVHVVM0JyQ0VZOEU3VERa?=
 =?utf-8?B?NStrcmVWNzZaNlMxWWptTjNTRGZCV3kyMERrNDI5ZDMwWGZFVklHdmpTTjFl?=
 =?utf-8?B?ZGhiKzdDVDFRNk1uN2RkQWozQzR0Qng1anJZbUZKRi85R2ZjcWxGVDJnODVG?=
 =?utf-8?Q?/N2w=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <9790E69F24ADD342941397D5866BC528@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 827fa651-bd36-473c-7cbb-08dcc0e20388
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Aug 2024 06:33:33.4055
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: DV/3F3AVM/bOS/2ZN+i6L07yoxrroCfCJGOD8igDoh1PhndJAn6HCKRiGRSXUGJKDjQoV7xftzOUyor01Sa3Wg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9359

T24gMjAyNC84LzE5IDE3OjE2LCBKYW4gQmV1bGljaCB3cm90ZToNCj4gT24gMTYuMDguMjAyNCAx
MzowOCwgSmlxaWFuIENoZW4gd3JvdGU6DQo+PiBUaGUgZ3NpIG9mIGEgcGFzc3Rocm91Z2ggZGV2
aWNlIG11c3QgYmUgY29uZmlndXJlZCBmb3IgaXQgdG8gYmUNCj4+IGFibGUgdG8gYmUgbWFwcGVk
IGludG8gYSBodm0gZG9tVS4NCj4+IEJ1dCBXaGVuIGRvbTAgaXMgUFZILCB0aGUgZ3NpcyBtYXkg
bm90IGdldCByZWdpc3RlcmVkKHNlZSBiZWxvdw0KPj4gY2xhcmlmaWNhdGlvbiksIGl0IGNhdXNl
cyB0aGUgaW5mbyBvZiBhcGljLCBwaW4gYW5kIGlycSBub3QgYmUNCj4+IGFkZGVkIGludG8gaXJx
XzJfcGluIGxpc3QsIGFuZCB0aGUgaGFuZGxlciBvZiBpcnFfZGVzYyBpcyBub3Qgc2V0LA0KPj4g
dGhlbiB3aGVuIHBhc3N0aHJvdWdoIGEgZGV2aWNlLCBzZXR0aW5nIGlvYXBpYyBhZmZpbml0eSBh
bmQgdmVjdG9yDQo+PiB3aWxsIGZhaWwuDQo+Pg0KPj4gVG8gZml4IGFib3ZlIHByb2JsZW0sIG9u
IExpbnV4IGtlcm5lbCBzaWRlLCBhIG5ldyBjb2RlIHdpbGwNCj4+IG5lZWQgdG8gY2FsbCBQSFlT
REVWT1Bfc2V0dXBfZ3NpIGZvciBwYXNzdGhyb3VnaCBkZXZpY2VzIHRvDQo+PiByZWdpc3RlciBn
c2kgd2hlbiBkb20wIGlzIFBWSC4NCj4+DQo+PiBTbywgYWRkIFBIWVNERVZPUF9zZXR1cF9nc2kg
aW50byBodm1fcGh5c2Rldl9vcCBmb3IgYWJvdmUNCj4+IHB1cnBvc2UuDQo+Pg0KPj4gQ2xhcmlm
eSB0d28gcXVlc3Rpb25zOg0KPj4gRmlyc3QsIHdoeSB0aGUgZ3NpIG9mIGRldmljZXMgYmVsb25n
IHRvIFBWSCBkb20wIGNhbiB3b3JrPw0KPj4gQmVjYXVzZSB3aGVuIHByb2JlIGEgZHJpdmVyIHRv
IGEgbm9ybWFsIGRldmljZSwgaXQgdXNlcyB0aGUgbm9ybWFsDQo+PiBwcm9iZSBmdW5jdGlvbiBv
ZiBwY2kgZGV2aWNlLCBpbiBpdHMgY2FsbHN0YWNrLCBpdCByZXF1ZXN0cyBpcnENCj4+IGFuZCB1
bm1hc2sgY29ycmVzcG9uZGluZyBpb2FwaWMgb2YgZ3NpLCB0aGVuIHRyYXAgaW50byB4ZW4gYW5k
DQo+PiByZWdpc3RlciBnc2kgZmluYWxseS4NCj4+IENhbGxzdGFjayBpcyhvbiBsaW51eCBrZXJu
ZWwgc2lkZSkgcGNpX2RldmljZV9wcm9iZS0+DQo+PiByZXF1ZXN0X3RocmVhZGVkX2lycS0+IGly
cV9zdGFydHVwLT4gX191bm1hc2tfaW9hcGljLT4NCj4+IGlvX2FwaWNfd3JpdGUsIHRoZW4gdHJh
cCBpbnRvIHhlbiBodm1lbXVsX2RvX2lvLT4NCj4+IGh2bV9pb19pbnRlcmNlcHQtPiBodm1fcHJv
Y2Vzc19pb19pbnRlcmNlcHQtPg0KPj4gdmlvYXBpY193cml0ZV9pbmRpcmVjdC0+IHZpb2FwaWNf
aHdkb21fbWFwX2dzaS0+IG1wX3JlZ2lzdGVyX2dzaS4NCj4+IFNvIHRoYXQgdGhlIGdzaSBjYW4g
YmUgcmVnaXN0ZXJlZC4NCj4+DQo+PiBTZWNvbmQsIHdoeSB0aGUgZ3NpIG9mIHBhc3N0aHJvdWdo
IGRldmljZSBjYW4ndCB3b3JrIHdoZW4gZG9tMA0KPj4gaXMgUFZIPw0KPj4gQmVjYXVzZSB3aGVu
IGFzc2lnbiBhIGRldmljZSB0byBwYXNzdGhyb3VnaCwgaXQgdXNlcyB0aGUgc3BlY2lmaWMNCj4+
IHByb2JlIGZ1bmN0aW9uIG9mIHBjaWJhY2ssIGluIGl0cyBjYWxsc3RhY2ssIGl0IGRvZXNuJ3Qg
aW5zdGFsbCBhDQo+PiBmYWtlIGlycSBoYW5kbGVyIGR1ZSB0byB0aGUgSVNSIGlzIG5vdCBydW5u
aW5nLiBTbyB0aGF0DQo+PiBtcF9yZWdpc3Rlcl9nc2kgb24gWGVuIHNpZGUgaXMgbmV2ZXIgY2Fs
bGVkLCB0aGVuIHRoZSBnc2kgaXMgbm90DQo+PiByZWdpc3RlcmVkLg0KPj4gQ2FsbHN0YWNrIGlz
KG9uIGxpbnV4IGtlcm5lbCBzaWRlKSBwY2lzdHViX3Byb2JlLT5wY2lzdHViX3NlaXplLT4NCj4+
IHBjaXN0dWJfaW5pdF9kZXZpY2UtPiB4ZW5fcGNpYmtfcmVzZXRfZGV2aWNlLT4NCj4+IHhlbl9w
Y2lia19jb250cm9sX2lzci0+aXNyX29uPT0wLg0KPiANCj4gU286IFVuZGVybHlpbmcgWFNBLTQ2
MSB3YXMgdGhlIG9ic2VydmF0aW9uIHRoYXQgdGhlIHZlcnkgbGltaXRlZCBzZXQgb2YNCj4gY2Fz
ZXMgd2hlcmUgdGhpcyBmYWtlIElSUSBoYW5kbGVyIGlzIGluc3RhbGxlZCBpcyBhbiBpc3N1ZS4g
VGhlIHByb2JsZW0NCj4gb2YgZGVhbGluZyB3aXRoICJmYWxzZSIgSVJRcyB3aGVuIGEgbGluZS1i
YXNlZCBpbnRlcnJ1cHQgaXMgc2hhcmVkDQo+IGJldHdlZW4gZGV2aWNlcyBhZmZlY3RzIGFsbCBw
YXJ0aWVzLCBub3QganVzdCBEb20wIGFuZCBub3QganVzdCBQVg0KPiBndWVzdHMuIFRoZXJlZm9y
ZSBhbiBhbHRlcm5hdGl2ZSB0byB0aGUgaW50cm9kdWN0aW9uIG9mIGEgbmV3IGh5cGVyY2FsbA0K
PiB3b3VsZCBiZSB0byBzaW1wbHkgbGV2ZXJhZ2UgdGhhdCB0aGUgaW5zdGFsbGF0aW9uIG9mIHN1
Y2ggYSBoYW5kbGVyDQo+IHdpbGwgbmVlZCB3aWRlbmluZyBhbnl3YXkuDQo+IA0KPiBIb3dldmVy
LCB0aGUgaW5zdGFsbGF0aW9uIG9mIHNhaWQgaGFuZGxlciBwcmVzZW50bHkgYWxzbyBvY2N1cnMg
aW4NCj4gY2FzZXMgd2hlcmUgaXQncyBub3QgcmVhbGx5IG5lZWRlZCAtIHdoZW4gdGhlIGxpbmUg
aXNuJ3Qgc2hhcmVkLiBUaHVzLA0KPiBpZiB0aGUgaGFuZGxlciByZWdpc3RyYXRpb24gd291bGQg
YWxzbyBiZSBlbGltaW5hdGVkIHdoZW4gaXQncyBub3QNCj4gcmVhbGx5IG5lZWRlZCwgd2UnZCBi
ZSBiYWNrIHRvIG5lZWRpbmcgYSBzZXBhcmF0ZSBoeXBlcmNhbGwuDQo+IA0KPiBTbyBJIHRoaW5r
IGZpcnN0IG9mIGFsbCBpdCBuZWVkcyBkZWNpZGluZyB3aGF0IGlzIGdvaW5nIHRvIGJlIGRvbmUg
aW4NCj4gTGludXgsIGF0IGxlYXN0IGluIHBjaWJhY2sgKGFzIGhlcmUgd2UgY2FyZSBhYm91dCB0
aGUgRG9tMCBjYXNlIG9ubHkpLg0KQWdyZWUsIHNvIHRoZSBjdXJyZW50IG9wdGlvbnMgYXJlIGVp
dGhlciB0byB1c2UgaHlwZXJjYWxsIChQSFlTREVWT1Bfc2V0dXBfZ3NpKSBvciB0byBpbnN0YWxs
IGZha2UgSVJRIGhhbmRsZXIgaW4gcGNpYmFjay4NClNvLCB3ZSBtYXkgbmVlZCB0aGUgaW5wdXRz
IGZyb20gdGhlIE1haW50YWluZXJzIG9uIExpbnV4IHNpZGUuDQpIaSBTdGVmYW5vIGFuZCBKdWVy
Z2VuLCB3aGF0IGFib3V0IHlvdXIgb3BpbmlvbnM/DQoNCj4gDQo+IEphbg0KDQotLSANCkJlc3Qg
cmVnYXJkcywNCkppcWlhbiBDaGVuLg0K


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 07:02:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 07:02:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780062.1189644 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgIsK-0008Ab-Fj; Tue, 20 Aug 2024 07:01:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780062.1189644; Tue, 20 Aug 2024 07:01:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgIsK-0008AU-Cu; Tue, 20 Aug 2024 07:01:52 +0000
Received: by outflank-mailman (input) for mailman id 780062;
 Tue, 20 Aug 2024 07:01:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgIsI-0008AO-Jn
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 07:01:50 +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 11e62b3a-5ec2-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 09:01:49 +0200 (CEST)
Received: by mail-wm1-x333.google.com with SMTP id
 5b1f17b1804b1-428243f928fso56260265e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 00:01:49 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a838396be1csm722199766b.210.2024.08.20.00.01.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 00:01:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 11e62b3a-5ec2-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724137308; x=1724742108; 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=GLn2a+vpvDXGmWk6iH9PCriGAYCKBXcBzep4QTkXFWU=;
        b=UYylpsGt/QfOIFfWok46moxxGOcrjGEnxkZK+t/mGCda+jTAF89/ou0VO3eg8ENC1j
         U5PfCGmIV8uuHrFo7UCr/Rhb5wpve5m3aEePUSFW+lc310MWK31suenhUlEfjBlxUt5s
         k4ftNCh7AprUHM+LTLPITZH10EHHJ1TuMe3OoMWe8mdkBfWCPVUIcPh1ffZJCTbwxj0o
         cMzcP0YErhc7norwhMO4Llh7Ta9NUv5eQunc128O8+jcYOIUZjB3YD0FPbqI6zix+WDb
         0RnIV/tK1XB0lhtui9vVfekhrkT2CYhIn5NTTe2HAL9z1IuRz7vFZUJrR0xxAFmXX3w2
         tQrQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724137308; x=1724742108;
        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=GLn2a+vpvDXGmWk6iH9PCriGAYCKBXcBzep4QTkXFWU=;
        b=KV3HpPlBHZMY7Li4zYjuX9R8Z6CxSpIRgg3FqeyqTZWZARhWZj3XUMzSXNgtav+eqP
         eb7VmRyc3f3GHxxs6g2nakNptFXNEtbaC9mGsNfp8PsEIpCcAwW8fdoS2bnbrgVfqXwu
         fo1KsHtyhP2JnqbtNQkpGbjruhOZhy/G3TXp6L9BaqahuDWkEnHox3sgbnvWt13jalUA
         y0mjgE0t7f4Gf7CiCY4jVBFAR0pT+px2YCf7uLCfPPQDBFXulmxI2gbpxh8QYyIWnGBm
         F24xjIomG1cVzFYAOnJhUIwZ6zT9KwJCpz0u66YERN/6nZXC/ozlPx6ok3oAKyDZ/o62
         Y7qA==
X-Forwarded-Encrypted: i=1; AJvYcCWVkFYq3hCf6IjFRMX6TUhsNlyPgwPEzcaRc9Ly0/bB/Lzh1C2AIF7iqN+zQwdcYp6j2Ma05fJtnGs=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yyp66V9RgstfLfyXxRhS+TiEkeF+REo1PpYnFM34avnPpQgfXpU
	35Ne79Ax0RrMYDkRGYcq+mlxkHhbwrRQf4MJ5RolsRhfRM8HIGo4WYamgBfmNg==
X-Google-Smtp-Source: AGHT+IH+VvICI8Zen2QppKQo7dYDhF5RMhpzM8pBLrTXGpqEzAlcdn50Dv/G/TZ5AMHVpMYl9J3KXA==
X-Received: by 2002:adf:cc8c:0:b0:367:4d9d:56a1 with SMTP id ffacd0b85a97d-3719468fa6dmr11873647f8f.45.1724137308224;
        Tue, 20 Aug 2024 00:01:48 -0700 (PDT)
Message-ID: <1e0eee6c-0dcd-4ed4-970f-3d7e569cec09@suse.com>
Date: Tue, 20 Aug 2024 09:01:46 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v13 1/6] xen/pci: Add hypercall to support reset of
 pcidev
To: "Chen, Jiqian" <Jiqian.Chen@amd.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>, Julien Grall <julien@xen.org>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Rahul Singh <Rahul.Singh@arm.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <gwd@xenproject.org>,
 Anthony PERARD <anthony@xenproject.org>, Juergen Gross <jgross@suse.com>,
 "Daniel P . Smith" <dpsmith@apertussolutions.com>,
 "Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>,
 "Huang, Ray" <Ray.Huang@amd.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
 <20240816110820.75672-2-Jiqian.Chen@amd.com>
 <50717151-3098-491f-9dfb-71ebaff4b684@suse.com>
 <BL1PR12MB58498DC98719ED77DA950478E78D2@BL1PR12MB5849.namprd12.prod.outlook.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <BL1PR12MB58498DC98719ED77DA950478E78D2@BL1PR12MB5849.namprd12.prod.outlook.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 20.08.2024 08:00, Chen, Jiqian wrote:
> On 2024/8/19 17:04, Jan Beulich wrote:
>> On 16.08.2024 13:08, Jiqian Chen wrote:
>>> @@ -67,6 +68,57 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>>>          break;
>>>      }
>>>  
>>> +    case PHYSDEVOP_pci_device_reset:
>>> +    {
>>> +        struct pci_device_reset dev_reset;
>>> +        struct pci_dev *pdev;
>>> +        pci_sbdf_t sbdf;
>>> +
>>> +        ret = -EOPNOTSUPP;
>>> +        if ( !is_pci_passthrough_enabled() )
>>> +            break;
>>
>> It occurs to me (only now, sorry): Does this case really need to be an
>> error? I.e. do we really need to bother callers by having them find out
>> whether pass-through is supported in the underlying Xen?
> I am not sure, but for x86, passthrough is always true, it doesn't matter.
> For arm, this hypercall is also used for passthrough devices for now, so it is better to keep the same behavior as other PHYSDEVOP_pci_device_* operation?

Despite seeing that I did ack the respective change[1] back at the time, I
(now) view this as grossly misnamed, at best. Imo it makes pretty little
sense for that predicate helper to return true when there are no IOMMUs in
use. Even more so that on an Arm/PCI system without IOMMUs one can use the
command line option and then execution will make it past this check.

I further question the related part of [2]: Why did the stub need moving?
I'm not even sure that part of the change fell under the Suggested-by:
there, but I also can't exclude it (I didn't bother trying to find where
the suggestion was made).

In any event - with [1] PHYSDEVOP_*pci* ended up inconsistent on x86,
even if right now only on the surface. Yet as soon as this predicate is
changed to take IOMMUs into account, the latent inconsistency would
become a real one.

An alternative to changing how the function behaves would be to rename it,
for name and purpose to actually match - is_pci_passthrough_permitted()
maybe?

Thoughts anyone, Arm / SMMU maintainers in particular?

Finally, as to the change here: On an Arm/PCI system where pass-through
isn't enabled, the hypervisor will still need to know about resets when
vPCI is in use for Dom0. IOW I'd like to refine my earlier comment into
suggesting that the conditional be dropped altogether.

Jan

[1] 15517ed61f55 xen/arm: Add cmdline boot option "pci-passthrough = <boolean>"
[2] dec9e02f3190 xen: avoid generation of stub <asm/pci.h> header


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 07:07:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 07:07:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780071.1189653 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgIxa-0000tL-4w; Tue, 20 Aug 2024 07:07:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780071.1189653; Tue, 20 Aug 2024 07:07:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgIxa-0000tE-2Q; Tue, 20 Aug 2024 07:07:18 +0000
Received: by outflank-mailman (input) for mailman id 780071;
 Tue, 20 Aug 2024 07:07:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgIxY-0000t8-G9
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 07:07:16 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d488e68f-5ec2-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 09:07:15 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a7d26c2297eso591046166b.2
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 00:07:15 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838c6a0csm725241866b.22.2024.08.20.00.07.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 00:07:14 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d488e68f-5ec2-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724137635; x=1724742435; 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=F7hlZyphibUfZkTxugUKietLuX0v/KDHkvU0iG/eoGY=;
        b=UsY8X8CSHP7zkL+Q3iXB91r9BaljbJ+zqd6wBgyXn+539Nflwnatut89zESa3vAUAq
         g4jvzL3Zf69pB1k7kR8vL4diccgBlSrCIgGBYnxFjqPTs0hEcdL1HY38Px7Od4kNdFkq
         O3LJn4GdbzlVDQsLIwoizaqmgC0WmcVEsttqqaivp+djVxsKMC/qcXrthoDSUjUkXZlz
         ZnOW3G4bP8LT6qcsvhnvsn/WZJbCJsXhLucPskhTnmuSW9V3YzFQ6VLx3i2M/edLSEQF
         a2/lAJWxTQg2BuJCXALKlFwJjxTxdpwTj3bI0Rg8MNDK+TZtKb9DjFnhcR4YL8QPQU5G
         WjeQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724137635; x=1724742435;
        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=F7hlZyphibUfZkTxugUKietLuX0v/KDHkvU0iG/eoGY=;
        b=H/c3CXkamEaleIeodH/2ORBcvGPP6yTTOlXLqyTu/XTuOicPcHkFk+e82si5j61hdj
         I0fiq/BXagWjXb0MWpzXnZV632VUF6mhQRF2rQhTqjZRUlAFgsKdf5csbWwACd+h/oO+
         77B57NCPJoWlk2+cdOmsZWc6asHMYiOGRDK4UATeo5fPbYBUxqe30/PuFToX0FKkY4TG
         Bk4SFLCvM81obvvW+ZGcYjwXxDjb3qdAYVwwMAm9RPvS6pvr+aOBlCOha6cX/P6H7XK8
         BBkWYjxQ2wweTZrD3CPYtUmyot0NUkokQfVMpH347Jzb83vfMUmFjN9RFbfLVCyTSrlw
         DZhQ==
X-Forwarded-Encrypted: i=1; AJvYcCU4D0JlqJQj7USmNX250ah3006O9jFaFg6IT6pTmkIPEUq1m5vWn/olcLsPcHkH/SCZHVoSRX09nDA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyBBR9YgBY7rQXrvMVszBkBHOvuwApetPO4wP79RsZW8U6qyXUv
	m1/VYzGppRCZ6spGYUd1rJtOAxrJ0Y/vx1zv19Ksfp+GVDMQeiFznuVIxH2qtw==
X-Google-Smtp-Source: AGHT+IEZgXdQ1URHJuTEBmJhl86j6ASawkiNvIxJSldknnzcOZJCZ7a10AURUXWXOsyKclyxhNrACg==
X-Received: by 2002:a17:907:e601:b0:a7a:9447:3e8b with SMTP id a640c23a62f3a-a839292de83mr1082436666b.25.1724137634788;
        Tue, 20 Aug 2024 00:07:14 -0700 (PDT)
Message-ID: <216ebf5e-75d2-40f2-bc79-65fe67e54bed@suse.com>
Date: Tue, 20 Aug 2024 09:07:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v13 2/6] x86/pvh: Allow (un)map_pirq when dom0 is PVH
To: "Chen, Jiqian" <Jiqian.Chen@amd.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <gwd@xenproject.org>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>, Juergen Gross <jgross@suse.com>,
 "Daniel P . Smith" <dpsmith@apertussolutions.com>,
 "Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>,
 "Huang, Ray" <Ray.Huang@amd.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
 <20240816110820.75672-3-Jiqian.Chen@amd.com>
 <4a421c07-d8a0-4af9-816f-5d76d39fe31f@suse.com>
 <BL1PR12MB58492B55B496755585774CB0E78D2@BL1PR12MB5849.namprd12.prod.outlook.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <BL1PR12MB58492B55B496755585774CB0E78D2@BL1PR12MB5849.namprd12.prod.outlook.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 20.08.2024 08:12, Chen, Jiqian wrote:
> On 2024/8/19 17:08, Jan Beulich wrote:
>> On 16.08.2024 13:08, Jiqian Chen wrote:
>>> If run Xen with PVH dom0 and hvm domU, hvm will map a pirq for
>>> a passthrough device by using gsi, see qemu code
>>> xen_pt_realize->xc_physdev_map_pirq and libxl code
>>> pci_add_dm_done->xc_physdev_map_pirq. Then xc_physdev_map_pirq
>>> will call into Xen, but in hvm_physdev_op, PHYSDEVOP_map_pirq
>>> is not allowed because currd is PVH dom0 and PVH has no
>>> X86_EMU_USE_PIRQ flag, it will fail at has_pirq check.
>>>
>>> So, allow PHYSDEVOP_map_pirq when dom0 is PVH and also allow
>>> iPHYSDEVOP_unmap_pirq for the removal device path to unmap pirq.
>>> So that the interrupt of a passthrough device can be successfully
>>> mapped to pirq for domU with a notion of PIRQ when dom0 is PVH.
>>>
>>> To exposing the functionality to wider than (presently) necessary
>>> audience(like PVH domU), so it doesn't add any futher restrictions.
>>
>> The code change is fine, but I'm struggling with this sentence. I can't
>> really derive what you're trying to say.
> Ah, I wanted to explain why this path not add any further restrictions, then used your comments of last version.
> How do I need to change this explanation?

I think you want to take Roger's earlier comments (when he requested
the relaxation) as basis to re-write (combine) both of the latter two
paragraphs above (or maybe even all three of them). It's odd to first
talk about Dom0, as if the operations were to be exposed just there,
and only then add DomU-s.

>>> And there already are some senarios for domains without
>>> X86_EMU_USE_PIRQ to use these functions.
>>
>> Are there? If so, pointing out an example may help.
> If I understand correctly, Roger mentioned that PIRQs is disable by default for HVM guest("hvm_pirq=0") and passthrough device to guest.
> In this scene, guest doesn't have PIRQs, but it still needs this hypercall.

In which case please say so in order to be concrete, not vague.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 07:45:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 07:45:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780080.1189663 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgJYX-0007QI-U3; Tue, 20 Aug 2024 07:45:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780080.1189663; Tue, 20 Aug 2024 07:45:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgJYX-0007QB-RJ; Tue, 20 Aug 2024 07:45:29 +0000
Received: by outflank-mailman (input) for mailman id 780080;
 Tue, 20 Aug 2024 07:45:27 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgJYV-0007Q1-Qt; Tue, 20 Aug 2024 07:45:27 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgJYV-0008Vl-HB; Tue, 20 Aug 2024 07:45:27 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgJYV-0001IM-0z; Tue, 20 Aug 2024 07:45:27 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sgJYV-000434-0V; Tue, 20 Aug 2024 07:45:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=3ddbs/m1ITDb40cscRoOtS4BtbzkT5pCA75TR0KRH08=; b=5PwVABdGy97DHfFHuUqDg4OpUA
	SzZ6MTKKBO3WiHGnaiZUTT1/Da60gdxUEn30bGAg0/+dywAel6GzwTpHmnI3rjg3XammBko54VWW7
	UOfaxZ8qt43PeQC6xqsMAMfNT+TGFaFxBR0LysURZZtn9y723u4P22n9ZASRgXgpU5lA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187285-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187285: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-qemuu-freebsd11-amd64:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=b0da640826ba3b6506b4996a6b23a429235e6923
X-Osstest-Versions-That:
    linux=47ac09b91befbb6a235ab620c32af719f8208399
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 20 Aug 2024 07:45:27 +0000

flight 187285 linux-linus real [real]
flight 187291 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187285/
http://logs.test-lab.xenproject.org/osstest/logs/187291/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-qemuu-freebsd11-amd64 19 guest-localmigrate/x10 fail pass in 187291-retest

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187279
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187279
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187279
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187279
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187279
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187279
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                b0da640826ba3b6506b4996a6b23a429235e6923
baseline version:
 linux                47ac09b91befbb6a235ab620c32af719f8208399

Last test of basis   187279  2024-08-18 22:14:41 Z    1 days
Testing same since   187285  2024-08-19 17:12:38 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Linus Torvalds <torvalds@linux-foundation.org>
  Petr Mladek <pmladek@suse.com>
  Ryo Takakura <takakura@valinux.co.jp>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       fail    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   47ac09b91befb..b0da640826ba3  b0da640826ba3b6506b4996a6b23a429235e6923 -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:03:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:03:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780091.1189674 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgJpT-00034r-CB; Tue, 20 Aug 2024 08:02:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780091.1189674; Tue, 20 Aug 2024 08:02:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgJpT-00034k-8j; Tue, 20 Aug 2024 08:02:59 +0000
Received: by outflank-mailman (input) for mailman id 780091;
 Tue, 20 Aug 2024 08:02: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=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgJpS-00034e-Lu
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:02:58 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 98d01c13-5eca-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 10:02:51 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-5bed83488b3so3818537a12.0
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 01:02:51 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bebc081db4sm6417283a12.88.2024.08.20.01.02.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 01:02:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 98d01c13-5eca-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724140971; x=1724745771; 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=Q1FJt9eAEABnZpwBHrjTH5qZRhZMkcYzlKlXsfayNvI=;
        b=dKgFWgbAteO3ZUo03QKuiXe0Tq0BfiZZeEhaQ15Mzts7JcNy4W+LhRLSDx7c5nk9Qj
         KWFsSRpy89x8WFQ6Uncl1vrNncvmgEwHse5jqgR8iyMzK1rG56m5jSdvZmxvYWFg0bqH
         envmcTe7AXhTq+S1omjyttFloTNlLP4ALh3plJiQ6bWXzqfzUaim44FEZMOzPIqh5nMx
         5daZlHVu4GDbVwkpo27IEWP17904p35wHrbfDa3t6XJAqU5mj6fZ3ZJXlicG0/xDSvI+
         cNjl6suwEmhM7J+Lri4+a35CuZ6cnB5uzR/nO035hK90nYQUUsl4IHuWsk2sD1unKw4d
         gIFA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724140971; x=1724745771;
        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=Q1FJt9eAEABnZpwBHrjTH5qZRhZMkcYzlKlXsfayNvI=;
        b=TTLmof03fcyDMMFYjNKdY+VA5ow3ZdbtzI5lkjOxAQFfHtFZWVaZMac+C8ede3mnk6
         nYaFNVthD6RcZphJakTyVmu+AuOYo5d9VY611OQG3pH2N3Hco5pyDm5aK2ZsfbgNtagk
         cI9ArBMm4ks0nf9v+SJeICGgyy0Ho+rlFcCHCzRZqQx06shg9NfE5ouF81Gc6mQqEzWf
         UONtaL7Tfh2UP+VWTxB065PlzvHl3du4GpO+uawbzSZaphG+l9YgwaQyHCWuRQJCKlgc
         OWDQRUYt2JQoTPMvzaK11JVpS5sL5vjYFINFMRMNDNc6HNkToRCl33HCYJ/0ZhJPnJSS
         T0oA==
X-Forwarded-Encrypted: i=1; AJvYcCVqwnpfpyY+4G/WRiBaPLDBS0lGigJXNXFMK3gaqD69aEPA+4+hKOUhLL/Z42ady7hLfdljf/JDGS0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzDFEw2oS4g2W8hV9Svdaaedprg0ObIUHjub7wzoiQWhB8WYQ7k
	UdM2d/BspgNIupHRJ7PNWxku4nBLImEcj/rlAmcjXMkjCSlpaze+g7Vrbd0lWg==
X-Google-Smtp-Source: AGHT+IFxefm2gVt2u9I63nMfavTQwHp2RZkmlnXqMDx4XNixhmwJ9sCj+14+ww1fBA4JqYnED9tyqQ==
X-Received: by 2002:a05:6402:13d5:b0:5be:ee30:9951 with SMTP id 4fb4d7f45d1cf-5beee309fbemr5662468a12.7.1724140970522;
        Tue, 20 Aug 2024 01:02:50 -0700 (PDT)
Message-ID: <9a0d75a9-bd0b-4caf-83f7-d24cadf80ed8@suse.com>
Date: Tue, 20 Aug 2024 10:02:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/5] x86: Set xen_phys_start and
 trampoline_xen_phys_start earlier
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20240814083428.3012-1-frediano.ziglio@cloud.com>
 <20240814083428.3012-3-frediano.ziglio@cloud.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: <20240814083428.3012-3-frediano.ziglio@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 14.08.2024 10:34, Frediano Ziglio wrote:
> No reason to wait, if Xen image is loaded by EFI (not multiboot
> EFI path) these are set in efi_arch_load_addr_check, but
> not in the multiboot EFI code path.
> This change makes the 2 EFI code paths more similar and allows
> the usage of these variables if needed.

It still remains a just-in-case change this way. It's init-only code,
so the code size increase doesn't really matter, yet having such
redundant code without a good explanation is at risk of being
confusing down the road. Therefore - if this change is needed in a
later patch in this series, please mention the intended use case
here, or perhaps simply fold both patches.

> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
> ---
>  xen/arch/x86/boot/head.S | 5 +++++
>  1 file changed, 5 insertions(+)
> ---
> Changes since v1:
> - Do not remove other hunk, used for BIOS;

As indicated on the v1 thread: The writes simply write 0 in the BIOS
case. It's the PVH case which needs them. With that I see two options:
Move the existing code to ahead of __pvh_start's jump to
trampoline_setup (my preference), or at least make sure that in the
MB2 case we don't write the two variables a 2nd time (else raising
the question of whether the same value is written, or why the value is
okay to change.)

> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -240,6 +240,11 @@ __efi64_mb2_start:
>          jmp     x86_32_switch
>  
>  .Lefi_multiboot2_proto:
> +        /* Save Xen image load base address for later use. */
> +        lea     __image_base__(%rip), %esi
> +        mov     %rsi, xen_phys_start(%rip)
> +        mov     %esi, trampoline_xen_phys_start(%rip)

As iirc also indicated in reply to v1 already: The existing code you
clone uses two 32-bit writes. What's the point of using a mix here?
If the address was really above 4G, we'd have an issue anyway, wouldn't
we? (Leaving aside that the LEA already truncates the value anyway.)

Finally I'd like to recommend to avoid the use of %esi here. It gives
the wrong impression of sym_esi() becoming usable, when in fact %esi is
zeroed ...

>          /* Zero EFI SystemTable, EFI ImageHandle addresses and cmdline. */
>          xor     %esi,%esi

... immediately afterwards.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:07:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:07:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780101.1189684 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgJu9-00046B-10; Tue, 20 Aug 2024 08:07:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780101.1189684; Tue, 20 Aug 2024 08:07:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgJu8-000464-Tl; Tue, 20 Aug 2024 08:07:48 +0000
Received: by outflank-mailman (input) for mailman id 780101;
 Tue, 20 Aug 2024 08:07:47 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=M/mv=PT=ti.com=a-singh21@srs-se1.protection.inumbo.net>)
 id 1sgJu7-00045y-Mb
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:07:47 +0000
Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 46841b26-5ecb-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 10:07:44 +0200 (CEST)
Received: from fllv0034.itg.ti.com ([10.64.40.246])
 by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 47K87fVP115774;
 Tue, 20 Aug 2024 03:07:41 -0500
Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23])
 by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 47K87fSU056773
 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL);
 Tue, 20 Aug 2024 03:07:41 -0500
Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE112.ent.ti.com
 (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 20
 Aug 2024 03:07:41 -0500
Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE107.ent.ti.com
 (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via
 Frontend Transport; Tue, 20 Aug 2024 03:07:41 -0500
Received: from localhost (nightbug.dhcp.ti.com [10.24.72.75])
 by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 47K87der082013;
 Tue, 20 Aug 2024 03:07:40 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 46841b26-5ecb-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com;
	s=ti-com-17Q1; t=1724141261;
	bh=TeBOwM+tXteEQrANYjoamP9LUorPNZlyzsIFVa/Uvrg=;
	h=From:To:CC:Subject:Date;
	b=Edxz/75f3WrPZh1rysl3J3/V/+EggY9lDXzeZrzox9svaGXTIiDElV+o/+zYeBgUt
	 My+NFdkHOh9ClvB23NLXLfVpZVTf9v5hR1YMMDD2T5v82La5ZQYnpKihCvVizOjTUK
	 2yr2Z5IaDosVtMTRsPb3+WNLq3SpsYK5+jOleJTQ=
From: Amneesh Singh <a-singh21@ti.com>
To: <xen-devel@lists.xenproject.org>
CC: <anthony.perard@vates.tech>, Amneesh Singh <a-singh21@ti.com>
Subject: [PATCH v2] tools/helpers/init-dom0less: fix vcpu availability
Date: Tue, 20 Aug 2024 13:34:17 +0530
Message-ID: <20240820080416.323725-1-a-singh21@ti.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180

Currently, writing at cpu/<cpu>/availability in xenstore fails for a
couple of reasons: a trailing slash in the path and the fact that
cpupool isn't a bitmap but the cpupool id. This patch fixes this by
just getting libxl_vcpuinfo for each dom0less domain.

Signed-off-by: Amneesh Singh <a-singh21@ti.com>
---
 tools/helpers/init-dom0less.c | 46 ++++++++++++++++++++++++-----------
 1 file changed, 32 insertions(+), 14 deletions(-)
---
v1 -> v2:
- check for libxl_list_vcpu failure
- skip writing cpu availability to store if the above failure occurs

diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c
index fee9345..722a5af 100644
--- a/tools/helpers/init-dom0less.c
+++ b/tools/helpers/init-dom0less.c
@@ -99,8 +99,8 @@ static bool do_xs_write_vm(struct xs_handle *xsh, xs_transaction_t t,
  * domain started by xl/libxl.
  */
 static int create_xenstore(struct xs_handle *xsh,
-                           libxl_dominfo *info, libxl_uuid uuid,
-                           evtchn_port_t xenstore_port)
+                           libxl_dominfo *info, libxl_vcpuinfo *vcpuinfo,
+                           libxl_uuid uuid, evtchn_port_t xenstore_port)
 {
     domid_t domid;
     unsigned int i;
@@ -167,15 +167,20 @@ retry_transaction:
     /* /domain */
     if (!do_xs_write_dom(xsh, t, domid, "vm", vm_val_str)) goto err;
     if (!do_xs_write_dom(xsh, t, domid, "name", dom_name_str)) goto err;
-    if (!do_xs_write_dom(xsh, t, domid, "cpu", "")) goto err;
-    for (i = 0; i < info->vcpu_max_id; i++) {
-        rc = snprintf(cpu_str, STR_MAX_LENGTH, "cpu/%u/availability/", i);
-        if (rc < 0 || rc >= STR_MAX_LENGTH)
-            goto err;
-        rc = -EIO;
-        if (!do_xs_write_dom(xsh, t, domid, cpu_str,
-                             (info->cpupool & (1 << i)) ? "online" : "offline"))
-            goto err;
+
+    if (!vcpuinfo) {
+        fprintf(stderr, "vcpu information unavailable, proceeding without it\n");
+    } else {
+        if (!do_xs_write_dom(xsh, t, domid, "cpu", "")) goto err;
+        for (i = 0; i <= info->vcpu_max_id; i++) {
+            rc = snprintf(cpu_str, STR_MAX_LENGTH, "cpu/%u/availability", i);
+            if (rc < 0 || rc >= STR_MAX_LENGTH)
+                goto err;
+            rc = -EIO;
+            if (!do_xs_write_dom(xsh, t, domid, cpu_str,
+                                vcpuinfo[i].online ? "online" : "offline"))
+                goto err;
+        }
     }
 
     if (!do_xs_write_dom(xsh, t, domid, "memory", "")) goto err;
@@ -225,7 +230,8 @@ err:
 static int init_domain(struct xs_handle *xsh,
                        struct xc_interface_core *xch,
                        xenforeignmemory_handle *xfh,
-                       libxl_dominfo *info)
+                       libxl_dominfo *info,
+                       libxl_vcpuinfo *vcpuinfo)
 {
     libxl_uuid uuid;
     uint64_t xenstore_evtchn, xenstore_pfn;
@@ -278,7 +284,7 @@ static int init_domain(struct xs_handle *xsh,
     if (rc < 0)
         return rc;
 
-    rc = create_xenstore(xsh, info, uuid, xenstore_evtchn);
+    rc = create_xenstore(xsh, info, vcpuinfo, uuid, xenstore_evtchn);
     if (rc)
         err(1, "writing to xenstore");
 
@@ -330,14 +336,24 @@ int main(int argc, char **argv)
 
     for (i = 0; i < nb_vm; i++) {
         domid_t domid = info[i].domid;
+        libxl_vcpuinfo *vcpuinfo;
+        int nb_vcpu = 0, nr_cpus = 0;
+
 
         /* Don't need to check for Dom0 */
         if (!domid)
             continue;
 
+        vcpuinfo = libxl_list_vcpu(ctx, domid, &nb_vcpu, &nr_cpus);
+
+        if (!vcpuinfo) {
+          fprintf(stderr, "libxl_list_vcpu failed.\n");
+          nb_vcpu = 0;
+        }
+
         printf("Checking domid: %u\n", domid);
         if (!domain_exists(xsh, domid)) {
-            rc = init_domain(xsh, xch, xfh, &info[i]);
+            rc = init_domain(xsh, xch, xfh, &info[i], vcpuinfo);
             if (rc < 0) {
                 fprintf(stderr, "init_domain failed.\n");
                 goto out;
@@ -345,6 +361,8 @@ int main(int argc, char **argv)
         } else {
             printf("Domain %u has already been initialized\n", domid);
         }
+
+        libxl_vcpuinfo_list_free(vcpuinfo, nb_vcpu);
     }
 out:
     libxl_dominfo_list_free(info, nb_vm);
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:19:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:19:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780108.1189695 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK5V-0006Ro-1W; Tue, 20 Aug 2024 08:19:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780108.1189695; Tue, 20 Aug 2024 08:19:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK5U-0006Rh-Tp; Tue, 20 Aug 2024 08:19:32 +0000
Received: by outflank-mailman (input) for mailman id 780108;
 Tue, 20 Aug 2024 08:19: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=sO9k=PT=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1sgK5T-0006Rb-Rg
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:19:31 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ebb96554-5ecc-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 10:19:29 +0200 (CEST)
Received: from truciolo.bugseng.com.homenet.telecomitalia.it
 (host-87-20-207-105.retail.telecomitalia.it [87.20.207.105])
 by support.bugseng.com (Postfix) with ESMTPSA id 5F7C14EE075A;
 Tue, 20 Aug 2024 10:19:28 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ebb96554-5ecc-11ef-8776-851b0ebba9a2
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>
Subject: [XEN PATCH v5] automation/eclair: extend existing deviations of MISRA C Rule 16.3
Date: Tue, 20 Aug 2024 10:19:22 +0200
Message-Id: <4f862eb7f88c0deee86f2f0543f2794cc22a1585.1724138992.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Update ECLAIR configuration to deviate more cases where an
unintentional fallthrough cannot happen.

Tag Rule 16.3 as clean for arm.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
Hi, v4 of this patch has been on hold due to discussion on whether or not
to consider switch clauses ending with ASSERT_UNREACHABLE() as safe;
I propose the patch again to continue the discussion and maybe reach an
agreement.
---
Changes from v4:
- rebase against staging.
---
Changes from v3:
- do not add the rule to the monitored set (it is already there).
---
Changes from v2:
- fixed grammar;
- reprhased deviations regarding do-while-false and ASSERT_UNREACHABLE().
---
 .../eclair_analysis/ECLAIR/deviations.ecl     | 28 +++++++++++++++----
 automation/eclair_analysis/ECLAIR/tagging.ecl |  2 +-
 docs/misra/deviations.rst                     | 28 +++++++++++++++++--
 3 files changed, 48 insertions(+), 10 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 1aa8277066..9051f41602 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -461,14 +461,30 @@ therefore it is deemed better to leave such files as is."
 -config=MC3R1.R16.2,reports+={deliberate, "any_area(any_loc(file(x86_emulate||x86_svm_emulate)))"}
 -doc_end
 
--doc_begin="Switch clauses ending with continue, goto, return statements are
-safe."
--config=MC3R1.R16.3,terminals+={safe, "node(continue_stmt||goto_stmt||return_stmt)"}
+-doc_begin="Statements that change the control flow (i.e., break, continue, goto, return) and calls to functions that do not return the control back are \"allowed terminal statements\"."
+-stmt_selector+={r16_3_allowed_terminal, "node(break_stmt||continue_stmt||goto_stmt||return_stmt)||call(property(noreturn))"}
+-config=MC3R1.R16.3,terminals+={safe, "r16_3_allowed_terminal"}
+-doc_end
+
+-doc_begin="An if-else statement having both branches ending with an allowed terminal statement is itself an allowed terminal statement."
+-stmt_selector+={r16_3_if, "node(if_stmt)&&(child(then,r16_3_allowed_terminal)||child(then,any_stmt(stmt,-1,r16_3_allowed_terminal)))"}
+-stmt_selector+={r16_3_else, "node(if_stmt)&&(child(else,r16_3_allowed_terminal)||child(else,any_stmt(stmt,-1,r16_3_allowed_terminal)))"}
+-stmt_selector+={r16_3_if_else, "r16_3_if&&r16_3_else"}
+-config=MC3R1.R16.3,terminals+={safe, "r16_3_if_else"}
+-doc_end
+
+-doc_begin="An if-else statement having an always true condition and the true branch ending with an allowed terminal statement is itself an allowed terminal statement."
+-stmt_selector+={r16_3_if_true, "r16_3_if&&child(cond,definitely_in(1..))"}
+-config=MC3R1.R16.3,terminals+={safe, "r16_3_if_true"}
+-doc_end
+
+-doc_begin="A switch clause ending with a statement expression which, in turn, ends with an allowed terminal statement is safe."
+-config=MC3R1.R16.3,terminals+={safe, "node(stmt_expr)&&child(stmt,node(compound_stmt)&&any_stmt(stmt,-1,r16_3_allowed_terminal||r16_3_if_else||r16_3_if_true))"}
 -doc_end
 
--doc_begin="Switch clauses ending with a call to a function that does not give
-the control back (i.e., a function with attribute noreturn) are safe."
--config=MC3R1.R16.3,terminals+={safe, "call(property(noreturn))"}
+-doc_begin="A switch clause ending with a do-while-false the body of which, in turn, ends with an allowed terminal statement is safe.
+An exception to that is the macro ASSERT_UNREACHABLE() which is effective in debug build only: a switch clause ending with ASSERT_UNREACHABLE() is not considered safe."
+-config=MC3R1.R16.3,terminals+={safe, "!macro(name(ASSERT_UNREACHABLE))&&node(do_stmt)&&child(cond,definitely_in(0))&&child(body,any_stmt(stmt,-1,r16_3_allowed_terminal||r16_3_if_else||r16_3_if_true))"}
 -doc_end
 
 -doc_begin="Switch clauses ending with pseudo-keyword \"fallthrough\" are
diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/eclair_analysis/ECLAIR/tagging.ecl
index 4d0ac94848..b8448938e6 100644
--- a/automation/eclair_analysis/ECLAIR/tagging.ecl
+++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
@@ -112,7 +112,7 @@ if(string_equal(target,"x86_64"),
 )
 
 if(string_equal(target,"arm64"),
-    service_selector({"additional_clean_guidelines","MC3R1.R16.6||MC3R1.R2.1||MC3R1.R5.3||MC3R1.R7.3"})
+    service_selector({"additional_clean_guidelines","MC3R1.R2.1||MC3R1.R5.3||MC3R1.R7.3||MC3R1.R16.3||MC3R1.R16.6"})
 )
 
 -reports+={clean:added,"service(clean_guidelines_common||additional_clean_guidelines)"}
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index d51aa422b5..b66c271c4e 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -415,12 +415,34 @@ Deviations related to MISRA C:2012 Rules:
      - Tagged as `deliberate` for ECLAIR.
 
    * - R16.3
-     - Switch clauses ending with continue, goto, return statements are safe.
+     - Statements that change the control flow (i.e., break, continue, goto,
+       return) and calls to functions that do not return the control back are
+       \"allowed terminal statements\".
      - Tagged as `safe` for ECLAIR.
 
    * - R16.3
-     - Switch clauses ending with a call to a function that does not give
-       the control back (i.e., a function with attribute noreturn) are safe.
+     - An if-else statement having both branches ending with one of the allowed
+       terminal statemets is itself an allowed terminal statements.
+     - Tagged as `safe` for ECLAIR.
+
+   * - R16.3
+     - An if-else statement having an always true condition and the true
+       branch ending with an allowed terminal statement is itself an allowed
+       terminal statement.
+     - Tagged as `safe` for ECLAIR.
+
+   * - R16.3
+     - A switch clause ending with a statement expression which, in turn, ends
+       with an allowed terminal statement (e.g., the expansion of
+       generate_exception()) is safe.
+     - Tagged as `safe` for ECLAIR.
+
+   * - R16.3
+     - A switch clause ending with a do-while-false the body of which, in turn,
+       ends with an allowed terminal statement (e.g., PARSE_ERR_RET()) is safe.
+       An exception to that is the macro ASSERT_UNREACHABLE() which is
+       effective in debug build only: a switch clause ending with
+       ASSERT_UNREACHABLE() is not considered safe.
      - Tagged as `safe` for ECLAIR.
 
    * - R16.3
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:20:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:20:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780114.1189703 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK6F-0007oM-8J; Tue, 20 Aug 2024 08:20:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780114.1189703; Tue, 20 Aug 2024 08:20:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK6F-0007oF-5N; Tue, 20 Aug 2024 08:20:19 +0000
Received: by outflank-mailman (input) for mailman id 780114;
 Tue, 20 Aug 2024 08:20:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bKv/=PT=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sgK6D-0007ny-99
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:20:17 +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 07881884-5ecd-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 10:20:16 +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 7911F1FFB3;
 Tue, 20 Aug 2024 08:20:15 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1506413A17;
 Tue, 20 Aug 2024 08:20:15 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id ZzuYA79RxGaSKwAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 20 Aug 2024 08:20:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 07881884-5ecd-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1724142015; 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=4KYVEXnC+ZhHA3BCFJAEBnlMKyTINJg9vlBPCcs8xc0=;
	b=YvV/+XCdljrzW8kQlBoIna+DYDrGHvTkBX4owjjkAxCU5Ge1dH2qDBYb/vA4c9x5qCfIb0
	Yd8CSVZ0qGO2zS6I2AIoQH80IBPWssGlyNUfOCICSYZ9k2VtE+oDPg5Zv7k5WMDN6R0VhP
	xcU2jEhVfOSE2v2IS5GMjuTrmqD+A9M=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b="YvV/+XCd"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1724142015; 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=4KYVEXnC+ZhHA3BCFJAEBnlMKyTINJg9vlBPCcs8xc0=;
	b=YvV/+XCdljrzW8kQlBoIna+DYDrGHvTkBX4owjjkAxCU5Ge1dH2qDBYb/vA4c9x5qCfIb0
	Yd8CSVZ0qGO2zS6I2AIoQH80IBPWssGlyNUfOCICSYZ9k2VtE+oDPg5Zv7k5WMDN6R0VhP
	xcU2jEhVfOSE2v2IS5GMjuTrmqD+A9M=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org,
	linux-acpi@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>
Subject: [PATCH v2 0/7] xen: fix dom0 PV boot on some AMD machines
Date: Tue, 20 Aug 2024 10:20:05 +0200
Message-ID: <20240820082012.31316-1-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 7911F1FFB3
X-Spam-Level: 
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-0.999];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	ARC_NA(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FROM_HAS_DN(0.00)[];
	RCPT_COUNT_TWELVE(0.00)[13];
	MIME_TRACE(0.00)[0:+];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	FROM_EQ_ENVFROM(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.com:dkim,suse.com:mid];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCVD_COUNT_TWO(0.00)[2];
	RCVD_TLS_ALL(0.00)[];
	TO_DN_SOME(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Action: no action
X-Spam-Score: -3.01
X-Spam-Flag: NO

There have been reports of failed boots with Xen due to an overlap of
the kernel's memory with ACPI NVS reported in the E820 map of the host.

This series fixes this issue by moving the NVS area in dom0 to some
higher address.

Changes in V2:
- split of v1 patch 5
- new patch 6

Juergen Gross (7):
  xen: use correct end address of kernel for conflict checking
  xen: introduce generic helper checking for memory map conflicts
  xen: move checks for e820 conflicts further up
  xen: move max_pfn in xen_memory_setup() out of function scope
  xen: add capability to remap non-RAM pages to different PFNs
  xen: allow mapping ACPI data using a different physical address
  xen: tolerate ACPI NVS memory overlapping with Xen allocated memory

 arch/x86/include/asm/acpi.h        |   8 ++
 arch/x86/kernel/acpi/boot.c        |  10 ++
 arch/x86/kernel/mmconf-fam10h_64.c |   2 +-
 arch/x86/kernel/x86_init.c         |   2 +-
 arch/x86/xen/mmu_pv.c              |   5 +-
 arch/x86/xen/p2m.c                 |  95 ++++++++++++++
 arch/x86/xen/setup.c               | 203 ++++++++++++++++++++++-------
 arch/x86/xen/xen-ops.h             |   6 +-
 8 files changed, 279 insertions(+), 52 deletions(-)

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:20:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:20:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780115.1189714 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK6L-00085D-Fb; Tue, 20 Aug 2024 08:20:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780115.1189714; Tue, 20 Aug 2024 08:20:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK6L-000853-CN; Tue, 20 Aug 2024 08:20:25 +0000
Received: by outflank-mailman (input) for mailman id 780115;
 Tue, 20 Aug 2024 08:20:23 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bKv/=PT=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sgK6J-0006Rb-B9
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:20:23 +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 0ada07fc-5ecd-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 10:20:21 +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 3D3DD22567;
 Tue, 20 Aug 2024 08:20:21 +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 DDC7513A17;
 Tue, 20 Aug 2024 08:20:20 +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 0Y2wNMRRxGaZKwAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 20 Aug 2024 08:20:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0ada07fc-5ecd-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1724142021; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=FJuWvjcSe6tsIJYyVW0JxH6FOI5pPlkjwRn4JQVX2+8=;
	b=X692QRqTUyWUvASwfCqbrlyDCMMkTuxZItyVLayn+aVrOnjrpHEN4ZrFCt456Q9NQUk0QF
	0Y39pFbdzygoImhvIxBJ15fueFQ7PzFbBsCaInzK45U1x7Jc87L+jIsUSBB0Z2CpPUnUjA
	diQVf+1IW1au9sI+hKptbsuuvgzzJbs=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1724142021; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=FJuWvjcSe6tsIJYyVW0JxH6FOI5pPlkjwRn4JQVX2+8=;
	b=X692QRqTUyWUvASwfCqbrlyDCMMkTuxZItyVLayn+aVrOnjrpHEN4ZrFCt456Q9NQUk0QF
	0Y39pFbdzygoImhvIxBJ15fueFQ7PzFbBsCaInzK45U1x7Jc87L+jIsUSBB0Z2CpPUnUjA
	diQVf+1IW1au9sI+hKptbsuuvgzzJbs=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH v2 1/7] xen: use correct end address of kernel for conflict checking
Date: Tue, 20 Aug 2024 10:20:06 +0200
Message-ID: <20240820082012.31316-2-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820082012.31316-1-jgross@suse.com>
References: <20240820082012.31316-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -3.29
X-Spamd-Result: default: False [-3.29 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.19)[-0.967];
	MIME_GOOD(-0.10)[text/plain];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	MIME_TRACE(0.00)[0:+];
	RCPT_COUNT_SEVEN(0.00)[11];
	RCVD_TLS_ALL(0.00)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	TO_DN_SOME(0.00)[];
	FROM_HAS_DN(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FROM_EQ_ENVFROM(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.com:mid,suse.com:email]
X-Spam-Flag: NO
X-Spam-Level: 

When running as a Xen PV dom0 the kernel is loaded by the hypervisor
using a different memory map than that of the host. In order to
minimize the required changes in the kernel, the kernel adapts its
memory map to that of the host. In order to do that it is checking
for conflicts of its load address with the host memory map.

Unfortunately the tested memory range does not include the .brk
area, which might result in crashes or memory corruption when this
area does conflict withe the memory map of the host.

Fix the test by using the _end label instead of __bss_stop.

Fixes: 808fdb71936c ("xen: check for kernel memory conflicting with memory layout")

Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 arch/x86/xen/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 806ddb2391d9..4bcc70a71b7d 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -825,7 +825,7 @@ char * __init xen_memory_setup(void)
 	 * to relocating (and even reusing) pages with kernel text or data.
 	 */
 	if (xen_is_e820_reserved(__pa_symbol(_text),
-			__pa_symbol(__bss_stop) - __pa_symbol(_text))) {
+				 __pa_symbol(_end) - __pa_symbol(_text))) {
 		xen_raw_console_write("Xen hypervisor allocated kernel memory conflicts with E820 map\n");
 		BUG();
 	}
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:20:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:20:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780116.1189723 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK6P-0008NP-Lm; Tue, 20 Aug 2024 08:20:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780116.1189723; Tue, 20 Aug 2024 08:20:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK6P-0008NI-J5; Tue, 20 Aug 2024 08:20:29 +0000
Received: by outflank-mailman (input) for mailman id 780116;
 Tue, 20 Aug 2024 08:20:29 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bKv/=PT=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sgK6O-0006Rb-Ug
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:20:28 +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 0e404c46-5ecd-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 10:20:27 +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 ECACD2253C;
 Tue, 20 Aug 2024 08:20:26 +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 99E2C13A17;
 Tue, 20 Aug 2024 08:20:26 +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 d6EmJMpRxGagKwAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 20 Aug 2024 08:20:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0e404c46-5ecd-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1724142027; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=LEPD7L+PrX6jbrsj5UZebNb1W2NcisUaeKba9OJ0nRo=;
	b=LQJoYSvAqjAoGFyinwhTwgq3S8sj/wDiPz2icdvxTSP3CTxROBEiI6FggCY3pSX6k0Amcy
	fLNeZM+pQNNg9dsozbfUobZLLtAupncEE35dHlbDI8doRctPinNTq6gnbM0fNLdGMW0cqU
	ak3Nuaaym6ynLkXfylZJyFVRdZxm4UI=
Authentication-Results: smtp-out1.suse.de;
	none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1724142026; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=LEPD7L+PrX6jbrsj5UZebNb1W2NcisUaeKba9OJ0nRo=;
	b=o+KxEiaHdfqHfLAMS5NzzusWDFsCn0RAyu2igcuNF8OOO0Ld46Tk9Afdesj0mYYgBPO+VN
	7Q7NEcUs452TIFHhObeEqWruqdQWFAALX6zaQnzIpScsbYUZ1r4UusJ4eOGL6WLcng5LtK
	54fHjQk8yYI1l3goYUAG4IIfC/DqFqI=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH v2 2/7] xen: introduce generic helper checking for memory map conflicts
Date: Tue, 20 Aug 2024 10:20:07 +0200
Message-ID: <20240820082012.31316-3-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820082012.31316-1-jgross@suse.com>
References: <20240820082012.31316-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Level: 
X-Spamd-Result: default: False [-3.29 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	NEURAL_HAM_SHORT(-0.19)[-0.968];
	MIME_GOOD(-0.10)[text/plain];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	ARC_NA(0.00)[];
	MIME_TRACE(0.00)[0:+];
	RCPT_COUNT_SEVEN(0.00)[11];
	RCVD_TLS_ALL(0.00)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	TO_DN_SOME(0.00)[];
	FROM_HAS_DN(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	FROM_EQ_ENVFROM(0.00)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	RCVD_COUNT_TWO(0.00)[2];
	DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.com:email,suse.com:mid]
X-Spam-Score: -3.29
X-Spam-Flag: NO

When booting as a Xen PV dom0 the memory layout of the dom0 is
modified to match that of the host, as this requires less changes in
the kernel for supporting Xen.

There are some cases, though, which are problematic, as it is the Xen
hypervisor selecting the kernel's load address plus some other data,
which might conflict with the host's memory map.

These conflicts are detected at boot time and result in a boot error.
In order to support handling at least some of these conflicts in
future, introduce a generic helper function which will later gain the
ability to adapt the memory layout when possible.

Add the missing check for the xen_start_info area.

Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 arch/x86/xen/mmu_pv.c  |  5 +----
 arch/x86/xen/setup.c   | 34 ++++++++++++++++++++++++++++------
 arch/x86/xen/xen-ops.h |  3 ++-
 3 files changed, 31 insertions(+), 11 deletions(-)

diff --git a/arch/x86/xen/mmu_pv.c b/arch/x86/xen/mmu_pv.c
index f1ce39d6d32c..839e6613753d 100644
--- a/arch/x86/xen/mmu_pv.c
+++ b/arch/x86/xen/mmu_pv.c
@@ -2018,10 +2018,7 @@ void __init xen_reserve_special_pages(void)
 
 void __init xen_pt_check_e820(void)
 {
-	if (xen_is_e820_reserved(xen_pt_base, xen_pt_size)) {
-		xen_raw_console_write("Xen hypervisor allocated page table memory conflicts with E820 map\n");
-		BUG();
-	}
+	xen_chk_is_e820_usable(xen_pt_base, xen_pt_size, "page table");
 }
 
 static unsigned char dummy_mapping[PAGE_SIZE] __page_aligned_bss;
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 4bcc70a71b7d..96765180514b 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -567,7 +567,7 @@ static void __init xen_ignore_unusable(void)
 	}
 }
 
-bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size)
+static bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size)
 {
 	struct e820_entry *entry;
 	unsigned mapcnt;
@@ -624,6 +624,23 @@ phys_addr_t __init xen_find_free_area(phys_addr_t size)
 	return 0;
 }
 
+/*
+ * Check for an area in physical memory to be usable for non-movable purposes.
+ * An area is considered to usable if the used E820 map lists it to be RAM.
+ * In case the area is not usable, crash the system with an error message.
+ */
+void __init xen_chk_is_e820_usable(phys_addr_t start, phys_addr_t size,
+				   const char *component)
+{
+	if (!xen_is_e820_reserved(start, size))
+		return;
+
+	xen_raw_console_write("Xen hypervisor allocated ");
+	xen_raw_console_write(component);
+	xen_raw_console_write(" memory conflicts with E820 map\n");
+	BUG();
+}
+
 /*
  * Like memcpy, but with physical addresses for dest and src.
  */
@@ -824,11 +841,16 @@ char * __init xen_memory_setup(void)
 	 * Failing now is better than running into weird problems later due
 	 * to relocating (and even reusing) pages with kernel text or data.
 	 */
-	if (xen_is_e820_reserved(__pa_symbol(_text),
-				 __pa_symbol(_end) - __pa_symbol(_text))) {
-		xen_raw_console_write("Xen hypervisor allocated kernel memory conflicts with E820 map\n");
-		BUG();
-	}
+	xen_chk_is_e820_usable(__pa_symbol(_text),
+			       __pa_symbol(_end) - __pa_symbol(_text),
+			       "kernel");
+
+	/*
+	 * Check for a conflict of the xen_start_info memory with the target
+	 * E820 map.
+	 */
+	xen_chk_is_e820_usable(__pa(xen_start_info), sizeof(*xen_start_info),
+			       "xen_start_info");
 
 	/*
 	 * Check for a conflict of the hypervisor supplied page tables with
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index 0cf16fc79e0b..9a27d1d653d3 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -48,7 +48,8 @@ void xen_mm_unpin_all(void);
 void __init xen_relocate_p2m(void);
 #endif
 
-bool __init xen_is_e820_reserved(phys_addr_t start, phys_addr_t size);
+void __init xen_chk_is_e820_usable(phys_addr_t start, phys_addr_t size,
+				   const char *component);
 unsigned long __ref xen_chk_extra_mem(unsigned long pfn);
 void __init xen_inv_extra_mem(void);
 void __init xen_remap_memory(void);
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:20:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:20:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780118.1189734 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK6W-0000MT-4s; Tue, 20 Aug 2024 08:20:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780118.1189734; Tue, 20 Aug 2024 08:20:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK6W-0000MA-1M; Tue, 20 Aug 2024 08:20:36 +0000
Received: by outflank-mailman (input) for mailman id 780118;
 Tue, 20 Aug 2024 08:20:34 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bKv/=PT=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sgK6U-0006Rb-M0
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:20:34 +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 11ae11b1-5ecd-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 10:20:33 +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 B00BA22582;
 Tue, 20 Aug 2024 08:20:32 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 5A63C13A17;
 Tue, 20 Aug 2024 08:20:32 +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 8oeaFNBRxGaoKwAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 20 Aug 2024 08:20:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 11ae11b1-5ecd-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1724142032; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=dWJJMR8rBuh/QPRtNN+RcR8hDqRUcjKWCA7J80NLso8=;
	b=meS4TRYRswhAOiB39pZjWcSFJoprSZGo3M+OJl4N6Yg+AMc4dCI0QGMxJEGQp+JUUA8++V
	KjkFNU5O57jHSnV26KzrRCdKUISJrludarKRuuE0MQ2NY0J6ADLbz4CM44fqu3RydRPBzg
	JhGqz6mCTH3b+3kb0nvEt/mzinJb9es=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=meS4TRYR
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1724142032; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=dWJJMR8rBuh/QPRtNN+RcR8hDqRUcjKWCA7J80NLso8=;
	b=meS4TRYRswhAOiB39pZjWcSFJoprSZGo3M+OJl4N6Yg+AMc4dCI0QGMxJEGQp+JUUA8++V
	KjkFNU5O57jHSnV26KzrRCdKUISJrludarKRuuE0MQ2NY0J6ADLbz4CM44fqu3RydRPBzg
	JhGqz6mCTH3b+3kb0nvEt/mzinJb9es=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH v2 3/7] xen: move checks for e820 conflicts further up
Date: Tue, 20 Aug 2024 10:20:08 +0200
Message-ID: <20240820082012.31316-4-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820082012.31316-1-jgross@suse.com>
References: <20240820082012.31316-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: B00BA22582
X-Spam-Score: -3.51
X-Rspamd-Action: no action
X-Spamd-Result: default: False [-3.51 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-0.997];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	RCVD_TLS_ALL(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	TO_DN_SOME(0.00)[];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	MIME_TRACE(0.00)[0:+];
	ARC_NA(0.00)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	DWL_DNSWL_BLOCKED(0.00)[suse.com:dkim];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	RCPT_COUNT_SEVEN(0.00)[11];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:mid,suse.com:email,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-Spam-Flag: NO
X-Spam-Level: 

Move the checks for e820 memory map conflicts using the
xen_chk_is_e820_usable() helper further up in order to prepare
resolving some of the possible conflicts by doing some e820 map
modifications, which must happen before evaluating the RAM layout.

Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 arch/x86/xen/setup.c | 44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 96765180514b..dba68951ed6b 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -764,6 +764,28 @@ char * __init xen_memory_setup(void)
 	/* Make sure the Xen-supplied memory map is well-ordered. */
 	e820__update_table(&xen_e820_table);
 
+	/*
+	 * Check whether the kernel itself conflicts with the target E820 map.
+	 * Failing now is better than running into weird problems later due
+	 * to relocating (and even reusing) pages with kernel text or data.
+	 */
+	xen_chk_is_e820_usable(__pa_symbol(_text),
+			       __pa_symbol(_end) - __pa_symbol(_text),
+			       "kernel");
+
+	/*
+	 * Check for a conflict of the xen_start_info memory with the target
+	 * E820 map.
+	 */
+	xen_chk_is_e820_usable(__pa(xen_start_info), sizeof(*xen_start_info),
+			       "xen_start_info");
+
+	/*
+	 * Check for a conflict of the hypervisor supplied page tables with
+	 * the target E820 map.
+	 */
+	xen_pt_check_e820();
+
 	max_pages = xen_get_max_pages();
 
 	/* How many extra pages do we need due to remapping? */
@@ -836,28 +858,6 @@ char * __init xen_memory_setup(void)
 
 	e820__update_table(e820_table);
 
-	/*
-	 * Check whether the kernel itself conflicts with the target E820 map.
-	 * Failing now is better than running into weird problems later due
-	 * to relocating (and even reusing) pages with kernel text or data.
-	 */
-	xen_chk_is_e820_usable(__pa_symbol(_text),
-			       __pa_symbol(_end) - __pa_symbol(_text),
-			       "kernel");
-
-	/*
-	 * Check for a conflict of the xen_start_info memory with the target
-	 * E820 map.
-	 */
-	xen_chk_is_e820_usable(__pa(xen_start_info), sizeof(*xen_start_info),
-			       "xen_start_info");
-
-	/*
-	 * Check for a conflict of the hypervisor supplied page tables with
-	 * the target E820 map.
-	 */
-	xen_pt_check_e820();
-
 	xen_reserve_xen_mfnlist();
 
 	/* Check for a conflict of the initrd with the target E820 map. */
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:20:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:20:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780127.1189744 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK6d-0000vG-DY; Tue, 20 Aug 2024 08:20:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780127.1189744; Tue, 20 Aug 2024 08:20:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK6d-0000v7-AW; Tue, 20 Aug 2024 08:20:43 +0000
Received: by outflank-mailman (input) for mailman id 780127;
 Tue, 20 Aug 2024 08:20:41 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bKv/=PT=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sgK6b-0006Rb-HH
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:20:41 +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 15b9e627-5ecd-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 10:20:40 +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 826B12253C;
 Tue, 20 Aug 2024 08:20:38 +0000 (UTC)
Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 21B3613A17;
 Tue, 20 Aug 2024 08:20:38 +0000 (UTC)
Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167])
 by imap1.dmz-prg2.suse.org with ESMTPSA id ax/TBtZRxGa7KwAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 20 Aug 2024 08:20:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 15b9e627-5ecd-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1724142039; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=67Tp86aOVS8QP/GkFPihX/Ae6F141YUARfLRlav5UEw=;
	b=HwgnKm7e5CFWM1JI/OT7ni5GKnzCtISpb8ouRUYnK+8VZJ8Sbeimqgzv1vDURGU5E4zBDt
	ffkyDU9El/x5RqErYarGSzgQvvz3DwH7xtBh4mSZGEXBIzrJbIKXyGfHwxsPvXDdS4PAoM
	H2dJs4E56M8zqIT/WVK65gM4OLOkUHk=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=G5j01DWS
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1724142038; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=67Tp86aOVS8QP/GkFPihX/Ae6F141YUARfLRlav5UEw=;
	b=G5j01DWSfg/ZCcf2JAfWykbQo1DQLIrjppla24VWftoE/kLNsy5CHW2iyvgVvEOHnsomG6
	npt4ot1xC2Mi7t+xfi0bDd3h49KIdDTG7mZ66PLMy3U9kFKepl7Kq4oWBMopDQoCkW6Mfd
	MlDHuDyPCeXLF5d3ScLU/L5VB2eefCg=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH v2 4/7] xen: move max_pfn in xen_memory_setup() out of function scope
Date: Tue, 20 Aug 2024 10:20:09 +0200
Message-ID: <20240820082012.31316-5-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820082012.31316-1-jgross@suse.com>
References: <20240820082012.31316-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 826B12253C
X-Spam-Score: -3.51
X-Rspamd-Action: no action
X-Spamd-Result: default: False [-3.51 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-0.997];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	RCVD_TLS_ALL(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	TO_DN_SOME(0.00)[];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	MIME_TRACE(0.00)[0:+];
	ARC_NA(0.00)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	DWL_DNSWL_BLOCKED(0.00)[suse.com:dkim];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	RCPT_COUNT_SEVEN(0.00)[11];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:mid,suse.com:email,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-Spam-Flag: NO
X-Spam-Level: 

Instead of having max_pfn as a local variable of xen_memory_setup(),
make it a static variable in setup.c instead. This avoids having to
pass it to subfunctions, which will be needed in more cases in future.

Rename it to ini_nr_pages, as the value denotes the currently usable
number of memory pages as passed from the hypervisor at boot time.

Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 arch/x86/xen/setup.c | 53 ++++++++++++++++++++++----------------------
 1 file changed, 27 insertions(+), 26 deletions(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index dba68951ed6b..d678c0330971 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -46,6 +46,9 @@ bool xen_pv_pci_possible;
 /* E820 map used during setting up memory. */
 static struct e820_table xen_e820_table __initdata;
 
+/* Number of initially usable memory pages. */
+static unsigned long ini_nr_pages __initdata;
+
 /*
  * Buffer used to remap identity mapped pages. We only need the virtual space.
  * The physical page behind this address is remapped as needed to different
@@ -212,7 +215,7 @@ static int __init xen_free_mfn(unsigned long mfn)
  * as a fallback if the remapping fails.
  */
 static void __init xen_set_identity_and_release_chunk(unsigned long start_pfn,
-			unsigned long end_pfn, unsigned long nr_pages)
+						      unsigned long end_pfn)
 {
 	unsigned long pfn, end;
 	int ret;
@@ -220,7 +223,7 @@ static void __init xen_set_identity_and_release_chunk(unsigned long start_pfn,
 	WARN_ON(start_pfn > end_pfn);
 
 	/* Release pages first. */
-	end = min(end_pfn, nr_pages);
+	end = min(end_pfn, ini_nr_pages);
 	for (pfn = start_pfn; pfn < end; pfn++) {
 		unsigned long mfn = pfn_to_mfn(pfn);
 
@@ -341,15 +344,14 @@ static void __init xen_do_set_identity_and_remap_chunk(
  * to Xen and not remapped.
  */
 static unsigned long __init xen_set_identity_and_remap_chunk(
-	unsigned long start_pfn, unsigned long end_pfn, unsigned long nr_pages,
-	unsigned long remap_pfn)
+	unsigned long start_pfn, unsigned long end_pfn, unsigned long remap_pfn)
 {
 	unsigned long pfn;
 	unsigned long i = 0;
 	unsigned long n = end_pfn - start_pfn;
 
 	if (remap_pfn == 0)
-		remap_pfn = nr_pages;
+		remap_pfn = ini_nr_pages;
 
 	while (i < n) {
 		unsigned long cur_pfn = start_pfn + i;
@@ -358,19 +360,19 @@ static unsigned long __init xen_set_identity_and_remap_chunk(
 		unsigned long remap_range_size;
 
 		/* Do not remap pages beyond the current allocation */
-		if (cur_pfn >= nr_pages) {
+		if (cur_pfn >= ini_nr_pages) {
 			/* Identity map remaining pages */
 			set_phys_range_identity(cur_pfn, cur_pfn + size);
 			break;
 		}
-		if (cur_pfn + size > nr_pages)
-			size = nr_pages - cur_pfn;
+		if (cur_pfn + size > ini_nr_pages)
+			size = ini_nr_pages - cur_pfn;
 
 		remap_range_size = xen_find_pfn_range(&remap_pfn);
 		if (!remap_range_size) {
 			pr_warn("Unable to find available pfn range, not remapping identity pages\n");
 			xen_set_identity_and_release_chunk(cur_pfn,
-						cur_pfn + left, nr_pages);
+							   cur_pfn + left);
 			break;
 		}
 		/* Adjust size to fit in current e820 RAM region */
@@ -397,18 +399,18 @@ static unsigned long __init xen_set_identity_and_remap_chunk(
 }
 
 static unsigned long __init xen_count_remap_pages(
-	unsigned long start_pfn, unsigned long end_pfn, unsigned long nr_pages,
+	unsigned long start_pfn, unsigned long end_pfn,
 	unsigned long remap_pages)
 {
-	if (start_pfn >= nr_pages)
+	if (start_pfn >= ini_nr_pages)
 		return remap_pages;
 
-	return remap_pages + min(end_pfn, nr_pages) - start_pfn;
+	return remap_pages + min(end_pfn, ini_nr_pages) - start_pfn;
 }
 
-static unsigned long __init xen_foreach_remap_area(unsigned long nr_pages,
+static unsigned long __init xen_foreach_remap_area(
 	unsigned long (*func)(unsigned long start_pfn, unsigned long end_pfn,
-			      unsigned long nr_pages, unsigned long last_val))
+			      unsigned long last_val))
 {
 	phys_addr_t start = 0;
 	unsigned long ret_val = 0;
@@ -436,8 +438,7 @@ static unsigned long __init xen_foreach_remap_area(unsigned long nr_pages,
 				end_pfn = PFN_UP(entry->addr);
 
 			if (start_pfn < end_pfn)
-				ret_val = func(start_pfn, end_pfn, nr_pages,
-					       ret_val);
+				ret_val = func(start_pfn, end_pfn, ret_val);
 			start = end;
 		}
 	}
@@ -700,7 +701,7 @@ static void __init xen_reserve_xen_mfnlist(void)
  **/
 char * __init xen_memory_setup(void)
 {
-	unsigned long max_pfn, pfn_s, n_pfns;
+	unsigned long pfn_s, n_pfns;
 	phys_addr_t mem_end, addr, size, chunk_size;
 	u32 type;
 	int rc;
@@ -712,9 +713,9 @@ char * __init xen_memory_setup(void)
 	int op;
 
 	xen_parse_512gb();
-	max_pfn = xen_get_pages_limit();
-	max_pfn = min(max_pfn, xen_start_info->nr_pages);
-	mem_end = PFN_PHYS(max_pfn);
+	ini_nr_pages = xen_get_pages_limit();
+	ini_nr_pages = min(ini_nr_pages, xen_start_info->nr_pages);
+	mem_end = PFN_PHYS(ini_nr_pages);
 
 	memmap.nr_entries = ARRAY_SIZE(xen_e820_table.entries);
 	set_xen_guest_handle(memmap.buffer, xen_e820_table.entries);
@@ -789,10 +790,10 @@ char * __init xen_memory_setup(void)
 	max_pages = xen_get_max_pages();
 
 	/* How many extra pages do we need due to remapping? */
-	max_pages += xen_foreach_remap_area(max_pfn, xen_count_remap_pages);
+	max_pages += xen_foreach_remap_area(xen_count_remap_pages);
 
-	if (max_pages > max_pfn)
-		extra_pages += max_pages - max_pfn;
+	if (max_pages > ini_nr_pages)
+		extra_pages += max_pages - ini_nr_pages;
 
 	/*
 	 * Clamp the amount of extra memory to a EXTRA_MEM_RATIO
@@ -801,8 +802,8 @@ char * __init xen_memory_setup(void)
 	 * Make sure we have no memory above max_pages, as this area
 	 * isn't handled by the p2m management.
 	 */
-	maxmem_pages = EXTRA_MEM_RATIO * min(max_pfn, PFN_DOWN(MAXMEM));
-	extra_pages = min3(maxmem_pages, extra_pages, max_pages - max_pfn);
+	maxmem_pages = EXTRA_MEM_RATIO * min(ini_nr_pages, PFN_DOWN(MAXMEM));
+	extra_pages = min3(maxmem_pages, extra_pages, max_pages - ini_nr_pages);
 	i = 0;
 	addr = xen_e820_table.entries[0].addr;
 	size = xen_e820_table.entries[0].size;
@@ -885,7 +886,7 @@ char * __init xen_memory_setup(void)
 	 * Set identity map on non-RAM pages and prepare remapping the
 	 * underlying RAM.
 	 */
-	xen_foreach_remap_area(max_pfn, xen_set_identity_and_remap_chunk);
+	xen_foreach_remap_area(xen_set_identity_and_remap_chunk);
 
 	pr_info("Released %ld page(s)\n", xen_released_pages);
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:20:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:20:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780129.1189754 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK6h-0001HA-KE; Tue, 20 Aug 2024 08:20:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780129.1189754; Tue, 20 Aug 2024 08:20:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK6h-0001H3-HF; Tue, 20 Aug 2024 08:20:47 +0000
Received: by outflank-mailman (input) for mailman id 780129;
 Tue, 20 Aug 2024 08:20:46 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bKv/=PT=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sgK6g-0006Rb-7U
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:20:46 +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 188462a5-5ecd-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 10:20: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-out1.suse.de (Postfix) with ESMTPS id 3819222567;
 Tue, 20 Aug 2024 08:20: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 DC18513A17;
 Tue, 20 Aug 2024 08:20: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 /gImNNtRxGbDKwAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 20 Aug 2024 08:20:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 188462a5-5ecd-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1724142044; 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=G5wKq9uWej36pPamlhNBBtzwPiEEwkAyaSi2VMAqres=;
	b=IuHw512q0MOlzyyLPfIIudjDfLAxM3WRlaVwZ041JY6jN40wpybB/smy0dyjAs62CSBhre
	lIzfw8Mv1KGkuPQOcaBF+AkD54Tw7lPk6h8L64WtPxLRrXYZHKu98q3CRLCTYvWik2eese
	kkVivwUSff3GzCWVH6ZwLUhB9Jl4OXk=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=IuHw512q
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1724142044; 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=G5wKq9uWej36pPamlhNBBtzwPiEEwkAyaSi2VMAqres=;
	b=IuHw512q0MOlzyyLPfIIudjDfLAxM3WRlaVwZ041JY6jN40wpybB/smy0dyjAs62CSBhre
	lIzfw8Mv1KGkuPQOcaBF+AkD54Tw7lPk6h8L64WtPxLRrXYZHKu98q3CRLCTYvWik2eese
	kkVivwUSff3GzCWVH6ZwLUhB9Jl4OXk=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH v2 5/7] xen: add capability to remap non-RAM pages to different PFNs
Date: Tue, 20 Aug 2024 10:20:10 +0200
Message-ID: <20240820082012.31316-6-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820082012.31316-1-jgross@suse.com>
References: <20240820082012.31316-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 3819222567
X-Spam-Score: -3.01
X-Rspamd-Action: no action
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-0.999];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	MIME_TRACE(0.00)[0:+];
	ARC_NA(0.00)[];
	TO_DN_SOME(0.00)[];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	RCVD_TLS_ALL(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+];
	RCVD_COUNT_TWO(0.00)[2];
	FROM_EQ_ENVFROM(0.00)[];
	FROM_HAS_DN(0.00)[];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	DWL_DNSWL_BLOCKED(0.00)[suse.com:dkim];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCPT_COUNT_SEVEN(0.00)[10];
	R_RATELIMIT(0.00)[to_ip_from(RLkdkdrsxe9hqhhs5ask8616i6)];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:dkim,suse.com:mid,suse.com:email,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo]
X-Rspamd-Server: rspamd1.dmz-prg2.suse.org
X-Spam-Flag: NO
X-Spam-Level: 

When running as a Xen PV dom0 it can happen that the kernel is being
loaded to a guest physical address conflicting with the host memory
map.

In order to be able to resolve this conflict, add the capability to
remap non-RAM areas to different guest PFNs. A function to use this
remapping information for other purposes than doing the remap will be
added when needed.

As the number of conflicts should be rather low (currently only
machines with max. 1 conflict are known), save the remap data in a
small statically allocated array.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- split off from patch 5 of V1 of the series
- moved to p2m.c
---
 arch/x86/xen/p2m.c     | 65 ++++++++++++++++++++++++++++++++++++++++++
 arch/x86/xen/xen-ops.h |  3 ++
 2 files changed, 68 insertions(+)

diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index 7c735b730acd..bb55e0fe1a04 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -80,6 +80,7 @@
 #include <asm/xen/hypervisor.h>
 #include <xen/balloon.h>
 #include <xen/grant_table.h>
+#include <xen/hvc-console.h>
 
 #include "xen-ops.h"
 
@@ -792,6 +793,70 @@ int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops,
 	return ret;
 }
 
+/* Remapped non-RAM areas */
+#define NR_NONRAM_REMAP 4
+static struct nonram_remap {
+	phys_addr_t maddr;
+	phys_addr_t paddr;
+	unsigned long size;
+} xen_nonram_remap[NR_NONRAM_REMAP];
+static unsigned int nr_nonram_remap;
+
+/*
+ * Do the real remapping of non-RAM regions as specified in the
+ * xen_nonram_remap[] array.
+ * In case of an error just crash the system.
+ */
+void __init xen_do_remap_nonram(void)
+{
+	unsigned int i;
+	unsigned int remapped = 0;
+	struct nonram_remap *remap = xen_nonram_remap;
+	unsigned long pfn, mfn, len;
+
+	if (!nr_nonram_remap)
+		return;
+
+	for (i = 0; i < nr_nonram_remap; i++) {
+		pfn = PFN_DOWN(remap->paddr);
+		mfn = PFN_DOWN(remap->maddr);
+		for (len = 0; len < remap->size; len += PAGE_SIZE) {
+			if (!set_phys_to_machine(pfn, mfn)) {
+				pr_err("Failed to set p2m mapping for pfn=%ld mfn=%ld\n",
+				       pfn, mfn);
+				BUG();
+			}
+
+			pfn++;
+			mfn++;
+			remapped++;
+		}
+
+		remap++;
+	}
+
+	pr_info("Remapped %u non-RAM page(s)\n", remapped);
+}
+
+/*
+ * Add a new non-RAM remap entry.
+ * In case of no free entry found, just crash the system.
+ */
+void __init xen_add_remap_nonram(phys_addr_t maddr, phys_addr_t paddr,
+				 unsigned long size)
+{
+	if (nr_nonram_remap == NR_NONRAM_REMAP) {
+		xen_raw_console_write("Number of required E820 entry remapping actions exceed maximum value\n");
+		BUG();
+	}
+
+	xen_nonram_remap[nr_nonram_remap].maddr = maddr;
+	xen_nonram_remap[nr_nonram_remap].paddr = paddr;
+	xen_nonram_remap[nr_nonram_remap].size = size;
+
+	nr_nonram_remap++;
+}
+
 #ifdef CONFIG_XEN_DEBUG_FS
 #include <linux/debugfs.h>
 static int p2m_dump_show(struct seq_file *m, void *v)
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index 9a27d1d653d3..e1b782e823e6 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -47,6 +47,9 @@ void xen_mm_unpin_all(void);
 #ifdef CONFIG_X86_64
 void __init xen_relocate_p2m(void);
 #endif
+void __init xen_do_remap_nonram(void);
+void __init xen_add_remap_nonram(phys_addr_t maddr, phys_addr_t paddr,
+				 unsigned long size);
 
 void __init xen_chk_is_e820_usable(phys_addr_t start, phys_addr_t size,
 				   const char *component);
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:20:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:20:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780139.1189764 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK6m-0001nE-SN; Tue, 20 Aug 2024 08:20:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780139.1189764; Tue, 20 Aug 2024 08:20:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK6m-0001n5-PN; Tue, 20 Aug 2024 08:20:52 +0000
Received: by outflank-mailman (input) for mailman id 780139;
 Tue, 20 Aug 2024 08:20:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bKv/=PT=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sgK6l-0007ny-PP
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:20:51 +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 1bffdcbf-5ecd-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 10:20:50 +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 17AC32253C;
 Tue, 20 Aug 2024 08:20: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 ABCFB13A17;
 Tue, 20 Aug 2024 08:20:49 +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 EhB9KOFRxGbIKwAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 20 Aug 2024 08:20:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1bffdcbf-5ecd-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1724142050; 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=1k9ZAtPeUmpOdU1rHd9Jn9Q4sZ5l1eGaWrOuL1YLFsk=;
	b=QcZPiNlniKs3SAqJPfQCQX2AUHxnNnLom/mfporth+idthV/6j0mIKq8feTDkjFhM1HacA
	7Eb4p1nl2f+1qHFO1tdL9HFBUiderZDZH0vQEtKRpYN7769wRjV6JUiwAifXcM7KRqnZnL
	CR9WJ+UVehcS1Wm5eLoTbHgPjlqPRJ0=
Authentication-Results: smtp-out1.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=QcZPiNln
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1724142050; 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=1k9ZAtPeUmpOdU1rHd9Jn9Q4sZ5l1eGaWrOuL1YLFsk=;
	b=QcZPiNlniKs3SAqJPfQCQX2AUHxnNnLom/mfporth+idthV/6j0mIKq8feTDkjFhM1HacA
	7Eb4p1nl2f+1qHFO1tdL9HFBUiderZDZH0vQEtKRpYN7769wRjV6JUiwAifXcM7KRqnZnL
	CR9WJ+UVehcS1Wm5eLoTbHgPjlqPRJ0=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org,
	linux-acpi@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	xen-devel@lists.xenproject.org
Subject: [PATCH v2 6/7] xen: allow mapping ACPI data using a different physical address
Date: Tue, 20 Aug 2024 10:20:11 +0200
Message-ID: <20240820082012.31316-7-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820082012.31316-1-jgross@suse.com>
References: <20240820082012.31316-1-jgross@suse.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: 17AC32253C
X-Spam-Level: 
X-Spamd-Result: default: False [-3.01 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_MISSING_CHARSET(0.50)[];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-0.999];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	FUZZY_BLOCKED(0.00)[rspamd.com];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	MIME_TRACE(0.00)[0:+];
	ARC_NA(0.00)[];
	RCPT_COUNT_TWELVE(0.00)[13];
	RCVD_COUNT_TWO(0.00)[2];
	TO_MATCH_ENVRCPT_ALL(0.00)[];
	FROM_HAS_DN(0.00)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	FROM_EQ_ENVFROM(0.00)[];
	R_RATELIMIT(0.00)[to_ip_from(RLkdkdrsxe9hqhhs5ask8616i6)];
	RCVD_TLS_ALL(0.00)[];
	DKIM_TRACE(0.00)[suse.com:+];
	TO_DN_SOME(0.00)[];
	DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.com:dkim,suse.com:mid,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Action: no action
X-Spam-Score: -3.01
X-Spam-Flag: NO

When running as a Xen PV dom0 the system needs to map ACPI data of the
host using host physical addresses, while those addresses can conflict
with the guest physical addresses of the loaded linux kernel.

This conflict can be solved by mapping the ACPI data to a different
guest physical address, but mapping the data via acpi_os_ioremap()
must still be possible using the host physical address, as this
address might be generated by AML when referencing some of the ACPI
data.

When configured to support running as a Xen PV dom0, have an
implementation of acpi_os_ioremap() being aware of the possibility to
need above mentioned translation of a host physical address to the
guest physical address.

This modification requires to fix some #include of asm/acpi.h in x86
code to use linux/acpi.h instead.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch (Jan Beulich)
---
 arch/x86/include/asm/acpi.h        |  8 ++++++++
 arch/x86/kernel/acpi/boot.c        | 10 ++++++++++
 arch/x86/kernel/mmconf-fam10h_64.c |  2 +-
 arch/x86/kernel/x86_init.c         |  2 +-
 arch/x86/xen/p2m.c                 | 30 ++++++++++++++++++++++++++++++
 arch/x86/xen/setup.c               |  2 +-
 6 files changed, 51 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/acpi.h b/arch/x86/include/asm/acpi.h
index 21bc53f5ed0c..42067643e615 100644
--- a/arch/x86/include/asm/acpi.h
+++ b/arch/x86/include/asm/acpi.h
@@ -174,6 +174,14 @@ void acpi_generic_reduced_hw_init(void);
 void x86_default_set_root_pointer(u64 addr);
 u64 x86_default_get_root_pointer(void);
 
+#ifdef CONFIG_XEN_PV_DOM0
+/* A Xen PV dom0 needs a special acpi_os_ioremap() handling. */
+extern void __iomem * (*acpi_os_ioremap)(acpi_physical_address phys,
+					 acpi_size size);
+void __iomem *x86_acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
+#define acpi_os_ioremap acpi_os_ioremap
+#endif
+
 #else /* !CONFIG_ACPI */
 
 #define acpi_lapic 0
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 9f4618dcd704..6dd01d15f277 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -1778,3 +1778,13 @@ u64 x86_default_get_root_pointer(void)
 {
 	return boot_params.acpi_rsdp_addr;
 }
+
+#ifdef CONFIG_XEN_PV_DOM0
+void __iomem *x86_acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
+{
+	return ioremap_cache(phys, size);
+}
+
+void __iomem * (*acpi_os_ioremap)(acpi_physical_address phys, acpi_size size) =
+	x86_acpi_os_ioremap;
+#endif
diff --git a/arch/x86/kernel/mmconf-fam10h_64.c b/arch/x86/kernel/mmconf-fam10h_64.c
index c94dec6a1834..8347a29f9db4 100644
--- a/arch/x86/kernel/mmconf-fam10h_64.c
+++ b/arch/x86/kernel/mmconf-fam10h_64.c
@@ -9,12 +9,12 @@
 #include <linux/pci.h>
 #include <linux/dmi.h>
 #include <linux/range.h>
+#include <linux/acpi.h>
 
 #include <asm/pci-direct.h>
 #include <linux/sort.h>
 #include <asm/io.h>
 #include <asm/msr.h>
-#include <asm/acpi.h>
 #include <asm/mmconfig.h>
 #include <asm/pci_x86.h>
 
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 82b128d3f309..47ef8af23101 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -8,8 +8,8 @@
 #include <linux/ioport.h>
 #include <linux/export.h>
 #include <linux/pci.h>
+#include <linux/acpi.h>
 
-#include <asm/acpi.h>
 #include <asm/bios_ebda.h>
 #include <asm/paravirt.h>
 #include <asm/pci_x86.h>
diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
index bb55e0fe1a04..61aaf066bf3e 100644
--- a/arch/x86/xen/p2m.c
+++ b/arch/x86/xen/p2m.c
@@ -70,6 +70,7 @@
 #include <linux/memblock.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
+#include <linux/acpi.h>
 
 #include <asm/cache.h>
 #include <asm/setup.h>
@@ -838,6 +839,31 @@ void __init xen_do_remap_nonram(void)
 	pr_info("Remapped %u non-RAM page(s)\n", remapped);
 }
 
+/*
+ * Xen variant of acpi_os_ioremap() taking potentially remapped non-RAM
+ * regions into acount.
+ * Any attempt to map an area crossing a remap boundary will produce a
+ * WARN() splat.
+ */
+static void __iomem *xen_acpi_os_ioremap(acpi_physical_address phys,
+					 acpi_size size)
+{
+	unsigned int i;
+	struct nonram_remap *remap = xen_nonram_remap;
+
+	for (i = 0; i < nr_nonram_remap; i++) {
+		if (phys + size > remap->maddr &&
+		    phys < remap->maddr + remap->size) {
+			WARN_ON(phys < remap->maddr ||
+				phys + size > remap->maddr + remap->size);
+			phys = remap->paddr + phys - remap->maddr;
+			break;
+		}
+	}
+
+	return x86_acpi_os_ioremap(phys, size);
+}
+
 /*
  * Add a new non-RAM remap entry.
  * In case of no free entry found, just crash the system.
@@ -850,6 +876,10 @@ void __init xen_add_remap_nonram(phys_addr_t maddr, phys_addr_t paddr,
 		BUG();
 	}
 
+	/* Switch to the Xen acpi_os_ioremap() variant. */
+	if (nr_nonram_remap == 0)
+		acpi_os_ioremap = xen_acpi_os_ioremap;
+
 	xen_nonram_remap[nr_nonram_remap].maddr = maddr;
 	xen_nonram_remap[nr_nonram_remap].paddr = paddr;
 	xen_nonram_remap[nr_nonram_remap].size = size;
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index d678c0330971..88b2ebd23da3 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -15,12 +15,12 @@
 #include <linux/cpuidle.h>
 #include <linux/cpufreq.h>
 #include <linux/memory_hotplug.h>
+#include <linux/acpi.h>
 
 #include <asm/elf.h>
 #include <asm/vdso.h>
 #include <asm/e820/api.h>
 #include <asm/setup.h>
-#include <asm/acpi.h>
 #include <asm/numa.h>
 #include <asm/idtentry.h>
 #include <asm/xen/hypervisor.h>
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:20:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:20:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780140.1189774 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK6s-0002HB-8i; Tue, 20 Aug 2024 08:20:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780140.1189774; Tue, 20 Aug 2024 08:20:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK6s-0002H1-5d; Tue, 20 Aug 2024 08:20:58 +0000
Received: by outflank-mailman (input) for mailman id 780140;
 Tue, 20 Aug 2024 08:20:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bKv/=PT=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sgK6q-0007ny-VB
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:20:56 +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 1f7d8c86-5ecd-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 10:20:56 +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 E5FEF1FFB4;
 Tue, 20 Aug 2024 08:20: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 836BA13A17;
 Tue, 20 Aug 2024 08:20: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 3yl5HudRxGbTKwAAD6G6ig
 (envelope-from <jgross@suse.com>); Tue, 20 Aug 2024 08:20:55 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1f7d8c86-5ecd-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1724142056; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=Uhe1/Za2Rsc+OxMtgPmnbZH7qh+wHOykK24Zu10M3lw=;
	b=Wfr1kIRbJaQ5CYghKSt4ap58FNWgVJdFxoK7j+XScPu3UcYpu+gku6jgbrS3lYhkEgKWCS
	F0Dppshvt2v/wxC1DU3c46+adTiGoCKb/osYRJQKGKoIx8J8py7s2G/jFFk8/1Vt7nJvQt
	DMZ9TnL3jErdWh0Ifj91Hcn0l3uKrMw=
Authentication-Results: smtp-out2.suse.de;
	dkim=pass header.d=suse.com header.s=susede1 header.b=lxdmpQlF
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1;
	t=1724142055; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:
	 mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=Uhe1/Za2Rsc+OxMtgPmnbZH7qh+wHOykK24Zu10M3lw=;
	b=lxdmpQlFs8jFGwiAHLsjDDuMc8HgOKwUptyIR9owTp/+pyEHSVWjSKmT8VgKaRpox8oq6d
	GsetpjmO5vB1xvdy5p7QrMNTm53rOln/XW7ZCN7r24PjpkUjynrr7+pECMFYd1hRA+0Lbn
	SPzt4Y7i2ZuizfoemRrtFeMJnN/Fp+Y=
From: Juergen Gross <jgross@suse.com>
To: linux-kernel@vger.kernel.org,
	x86@kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	xen-devel@lists.xenproject.org,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Subject: [PATCH v2 7/7] xen: tolerate ACPI NVS memory overlapping with Xen allocated memory
Date: Tue, 20 Aug 2024 10:20:12 +0200
Message-ID: <20240820082012.31316-8-jgross@suse.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820082012.31316-1-jgross@suse.com>
References: <20240820082012.31316-1-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Rspamd-Queue-Id: E5FEF1FFB4
X-Spam-Level: 
X-Spamd-Result: default: False [-3.51 / 50.00];
	BAYES_HAM(-3.00)[100.00%];
	MID_CONTAINS_FROM(1.00)[];
	NEURAL_HAM_LONG(-1.00)[-1.000];
	R_DKIM_ALLOW(-0.20)[suse.com:s=susede1];
	NEURAL_HAM_SHORT(-0.20)[-0.997];
	MIME_GOOD(-0.10)[text/plain];
	MX_GOOD(-0.01)[];
	RCVD_VIA_SMTP_AUTH(0.00)[];
	RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	RCVD_TLS_ALL(0.00)[];
	MIME_TRACE(0.00)[0:+];
	ARC_NA(0.00)[];
	SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from];
	TO_DN_SOME(0.00)[];
	RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received];
	RCPT_COUNT_SEVEN(0.00)[11];
	R_RATELIMIT(0.00)[to_ip_from(RLkdkdrsxe9hqhhs5ask8616i6)];
	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)[suse.com:email,suse.com:dkim,suse.com:mid,imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns];
	DKIM_SIGNED(0.00)[suse.com:s=susede1];
	DKIM_TRACE(0.00)[suse.com:+]
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Rspamd-Action: no action
X-Spam-Score: -3.51
X-Spam-Flag: NO

In order to minimize required special handling for running as Xen PV
dom0, the memory layout is modified to match that of the host. This
requires to have only RAM at the locations where Xen allocated memory
is living. Unfortunately there seem to be some machines, where ACPI
NVS is located at 64 MB, resulting in a conflict with the loaded
kernel or the initial page tables built by Xen.

As ACPI NVS needs to be accessed by the kernel only for saving and
restoring it across suspend operations, it can be relocated in the
dom0's memory map by swapping it with unused RAM (this is possible
via modification of the dom0 P2M map).

While the E820 map can (and should) be modified right away, the P2M
map can be updated only after memory allocation is working, as the P2M
map might need to be extended.

Fixes: 808fdb71936c ("xen: check for kernel memory conflicting with memory layout")
Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
V2:
- remap helpers split off into other patch
---
 arch/x86/xen/setup.c | 92 +++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 91 insertions(+), 1 deletion(-)

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 88b2ebd23da3..5697f1cdd6a0 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -495,6 +495,8 @@ void __init xen_remap_memory(void)
 	set_pte_mfn(buf, mfn_save, PAGE_KERNEL);
 
 	pr_info("Remapped %ld page(s)\n", remapped);
+
+	xen_do_remap_nonram();
 }
 
 static unsigned long __init xen_get_pages_limit(void)
@@ -625,14 +627,102 @@ phys_addr_t __init xen_find_free_area(phys_addr_t size)
 	return 0;
 }
 
+/*
+ * Swap a non-RAM E820 map entry with RAM above ini_nr_pages.
+ * Note that the E820 map is modified accordingly, but the P2M map isn't yet.
+ * The adaption of the P2M must be deferred until page allocation is possible.
+ */
+static void __init xen_e820_swap_entry_with_ram(struct e820_entry *swap_entry)
+{
+	struct e820_entry *entry;
+	unsigned int mapcnt;
+	phys_addr_t mem_end = PFN_PHYS(ini_nr_pages);
+	phys_addr_t swap_addr, swap_size, entry_end;
+
+	swap_addr = PAGE_ALIGN_DOWN(swap_entry->addr);
+	swap_size = PAGE_ALIGN(swap_entry->addr - swap_addr + swap_entry->size);
+	entry = xen_e820_table.entries;
+
+	for (mapcnt = 0; mapcnt < xen_e820_table.nr_entries; mapcnt++) {
+		entry_end = entry->addr + entry->size;
+		if (entry->type == E820_TYPE_RAM && entry->size >= swap_size &&
+		    entry_end - swap_size >= mem_end) {
+			/* Reduce RAM entry by needed space (whole pages). */
+			entry->size -= swap_size;
+
+			/* Add new entry at the end of E820 map. */
+			entry = xen_e820_table.entries +
+				xen_e820_table.nr_entries;
+			xen_e820_table.nr_entries++;
+
+			/* Fill new entry (keep size and page offset). */
+			entry->type = swap_entry->type;
+			entry->addr = entry_end - swap_size +
+				      swap_addr - swap_entry->addr;
+			entry->size = swap_entry->size;
+
+			/* Convert old entry to RAM, align to pages. */
+			swap_entry->type = E820_TYPE_RAM;
+			swap_entry->addr = swap_addr;
+			swap_entry->size = swap_size;
+
+			/* Remember PFN<->MFN relation for P2M update. */
+			xen_add_remap_nonram(swap_addr, entry_end - swap_size,
+					     swap_size);
+
+			/* Order E820 table and merge entries. */
+			e820__update_table(&xen_e820_table);
+
+			return;
+		}
+
+		entry++;
+	}
+
+	xen_raw_console_write("No suitable area found for required E820 entry remapping action\n");
+	BUG();
+}
+
+/*
+ * Look for non-RAM memory types in a specific guest physical area and move
+ * those away if possible (ACPI NVS only for now).
+ */
+static void __init xen_e820_resolve_conflicts(phys_addr_t start,
+					      phys_addr_t size)
+{
+	struct e820_entry *entry;
+	unsigned int mapcnt;
+	phys_addr_t end;
+
+	if (!size)
+		return;
+
+	end = start + size;
+	entry = xen_e820_table.entries;
+
+	for (mapcnt = 0; mapcnt < xen_e820_table.nr_entries; mapcnt++) {
+		if (entry->addr >= end)
+			return;
+
+		if (entry->addr + entry->size > start &&
+		    entry->type == E820_TYPE_NVS)
+			xen_e820_swap_entry_with_ram(entry);
+
+		entry++;
+	}
+}
+
 /*
  * Check for an area in physical memory to be usable for non-movable purposes.
- * An area is considered to usable if the used E820 map lists it to be RAM.
+ * An area is considered to usable if the used E820 map lists it to be RAM or
+ * some other type which can be moved to higher PFNs while keeping the MFNs.
  * In case the area is not usable, crash the system with an error message.
  */
 void __init xen_chk_is_e820_usable(phys_addr_t start, phys_addr_t size,
 				   const char *component)
 {
+	xen_e820_resolve_conflicts(start, size);
+
 	if (!xen_is_e820_reserved(start, size))
 		return;
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:23:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:23:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780155.1189784 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK9g-0003lb-LU; Tue, 20 Aug 2024 08:23:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780155.1189784; Tue, 20 Aug 2024 08:23:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgK9g-0003lU-Il; Tue, 20 Aug 2024 08:23:52 +0000
Received: by outflank-mailman (input) for mailman id 780155;
 Tue, 20 Aug 2024 08:23:51 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgK9f-0003lO-0k
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:23:51 +0000
Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com
 [2a00:1450:4864:20::635])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8694954f-5ecd-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 10:23:49 +0200 (CEST)
Received: by mail-ej1-x635.google.com with SMTP id
 a640c23a62f3a-a7a843bef98so582858666b.2
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 01:23:49 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838cfb53sm726564566b.79.2024.08.20.01.23.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 01:23:48 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8694954f-5ecd-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724142229; x=1724747029; 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=7WpmPY1Z9c6A7wRbZvB7T5fS4HEEC46M0iWedMztVgY=;
        b=aRyZzsN5Z5IED6rEFfsMtzMq+EHGKd+EDAv68TngYfkl6fCTLIejaSC89L5UyDR0Ub
         bZgfzineb3XkBkbknGhmphBVdgkh9jrtflQ/f/Jc6OH0ZDbHCvWo5XR8WdAx5AxZOe/5
         YVcwIJYOs1d1Jbcc6gp6XC6lY+8Sb+d4EnmwDwaHpvXWQI6VTjt6g+37p6PIa9wQyXEQ
         v+s6SSd0b1tn34A/Au3hmCR70Lm+NgjuZdNB1XMZIe/NAvqeLfx2cI1jhJ9JK84/NJPu
         9xGaCLIcQhDjUF2OOYrJyiAPgWd4KOpiYlZAG6rAtQnCIBeaqSQQQWqlbBzJHfJqce80
         B/Qw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724142229; x=1724747029;
        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=7WpmPY1Z9c6A7wRbZvB7T5fS4HEEC46M0iWedMztVgY=;
        b=DxzZ/x9gJuRiKQrTs69/ws0xIAhG0SnjYno6heBAkE75mP3v6uMjoAgFfFEIejMqhl
         N8NPJb/A6IVJ2/rrO7xMtry5Av8upRmtacsekRlBDUrrpnO7BuCG0mjwJjeG/zTmqHf7
         E15LTnan/ESBoWyfEcXMzIgf+capoiK6Sk9eQL82ipg3e+0X62STiZaAiXTW5vCvgG49
         vtR/YyQNOyLLubsJOW4+kU+YVrV9t760j/EtV5KbbSdU1XTeRD/T679fE//9TiAsF3nW
         jUb5Jql6lr9MEQ9zVr1CzMQFva//zCaQGXu+hqBq7sTZvdY6wEwJfs23wm85+EAt51Rm
         uFFg==
X-Forwarded-Encrypted: i=1; AJvYcCUyIf+G1wUOHuP4J5tNdV5nd1O4C0tckvAnssxBJpzdomQKPXQ02esgIGyk1nJLwF4qNHQ/NdCDTEQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyIJSbGig5/D7X7EfWa8MLuHYm1IhR7pnPG0GHpzL2dr/iOYMke
	Dz70lwVka9A2otQp+ksbravQ8OKXx8McmTpbU0xGTAPeCQf9TysiR0QFABAyFQ==
X-Google-Smtp-Source: AGHT+IEjyfwzXic/hewZa+0bJ5yvG551Lc1J9WjzGhweV2Kd5Tc/N/VoteigRMJK77QpHWDdkicO/g==
X-Received: by 2002:a17:907:2d88:b0:a7a:c083:8579 with SMTP id a640c23a62f3a-a8392a4b2e0mr974562966b.62.1724142228452;
        Tue, 20 Aug 2024 01:23:48 -0700 (PDT)
Message-ID: <bea70201-55d3-45ed-8f71-65987dd67740@suse.com>
Date: Tue, 20 Aug 2024 10:23:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 3/5] x86: Force proper gdt_boot_base setting
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20240814083428.3012-1-frediano.ziglio@cloud.com>
 <20240814083428.3012-4-frediano.ziglio@cloud.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: <20240814083428.3012-4-frediano.ziglio@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 14.08.2024 10:34, Frediano Ziglio wrote:
> Instead of relocate the value at that position compute it
> entirely and write it.
> During EFI boots sym_offs(SYMBOL) are potentially relocated
> causing the values to be corrupted.

This requires quite a bit more explanation, also to understand why a
lone specific sym_offs() is being dealt with here, leaving others
untouched. I'm specifically puzzled by the two in the MB2 header: If
the GDT one is a problem, why would those not be? Of course similarly
for others, in particular those used to pre-fill page tables. I think
an adjustment here needs to come with the addition of a comment next
to the #define, to clarify where the use is appropriate and where it
needs to be avoided.

> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -132,8 +132,7 @@ multiboot2_header:
>  gdt_boot_descr:
>          .word   .Ltrampoline_gdt_end - trampoline_gdt - 1
>  gdt_boot_base:
> -        .long   sym_offs(trampoline_gdt)
> -        .long   0 /* Needed for 64-bit lgdt */
> +        .quad   0 /* Needed for 64-bit lgdt */

The comment is now somewhat odd: It's no longer the entire line that's
there just because we want to use LGDT from 64-bit code, but just half
of what the .quad produces. Therefore perhaps either keep as two longs
(maybe with a different brief comment put on the former), or adjust
the comment wording.

> @@ -373,15 +372,16 @@ __efi64_mb2_start:
>  x86_32_switch:
>          mov     %r15,%rdi
>  
> -        /* Store Xen image load base address in place accessible for 32-bit code. */
> -        lea     __image_base__(%rip),%esi
> -
>          cli
>  
>          /* Initialize GDTR. */
> -        add     %esi,gdt_boot_base(%rip)
> +        lea     trampoline_gdt(%rip), %esi
> +        mov     %esi, gdt_boot_base(%rip)
>          lgdt    gdt_boot_descr(%rip)
>  
> +        /* Store Xen image load base address in place accessible for 32-bit code. */
> +        lea     __image_base__(%rip),%esi

What's the point in moving this code? Surely you could use another
register for the LEA/MOV pair above? In any event - _if_ you move
the code, please also add the blank missing after the comma.

> @@ -439,7 +439,8 @@ __pvh_start:
>          movb    $-1, sym_esi(opt_console_xen)
>  
>          /* Prepare gdt and segments */
> -        add     %esi, sym_esi(gdt_boot_base)
> +        lea     sym_esi(trampoline_gdt), %ecx
> +        mov     %ecx, sym_esi(gdt_boot_base)
>          lgdt    sym_esi(gdt_boot_descr)
>  
>          mov     $BOOT_DS, %ecx
> @@ -543,7 +544,8 @@ trampoline_bios_setup:
>           *
>           * Initialize GDTR and basic data segments.
>           */
> -        add     %esi,sym_esi(gdt_boot_base)
> +        lea     sym_esi(trampoline_gdt), %ecx
> +        mov     %ecx, sym_esi(gdt_boot_base)
>          lgdt    sym_esi(gdt_boot_descr)
>  
>          mov     $BOOT_DS,%ecx

While you mention that you make these changes for consistency, I'm
afraid I don't really see the point. The paths are all different
anyway - there's nothing wrong with leaving everything except
x86_32_switch untouched. Far less code churn then. All it would take
is extending the comment there a little to mention why the value is
fully overwritten rather than merely adjusted.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:27:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:27:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780177.1189794 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgKDS-0005Gj-4e; Tue, 20 Aug 2024 08:27:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780177.1189794; Tue, 20 Aug 2024 08:27:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgKDS-0005Gc-1b; Tue, 20 Aug 2024 08:27:46 +0000
Received: by outflank-mailman (input) for mailman id 780177;
 Tue, 20 Aug 2024 08:27: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=M/mv=PT=ti.com=a-singh21@srs-se1.protection.inumbo.net>)
 id 1sgKDQ-0005GW-1X
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:27:44 +0000
Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 10b2b315-5ece-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 10:27:42 +0200 (CEST)
Received: from fllv0034.itg.ti.com ([10.64.40.246])
 by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 47K8RWEF120230;
 Tue, 20 Aug 2024 03:27:32 -0500
Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26])
 by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 47K8RWg1071446
 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL);
 Tue, 20 Aug 2024 03:27:32 -0500
Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE115.ent.ti.com
 (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 20
 Aug 2024 03:27:31 -0500
Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE107.ent.ti.com
 (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via
 Frontend Transport; Tue, 20 Aug 2024 03:27:31 -0500
Received: from localhost (nightbug.dhcp.ti.com [10.24.72.75])
 by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 47K8RU3m130710;
 Tue, 20 Aug 2024 03:27:31 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 10b2b315-5ece-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com;
	s=ti-com-17Q1; t=1724142452;
	bh=yIzF3ngTZJQyuB6CBlMow9/583cX6Io7qcEhCzHEFrg=;
	h=From:To:CC:Subject:Date;
	b=f+jt/UTk3iM6OYpx9fxz0nd/JmALR9TcZSJIAE6ezrpbiib44B17pZJ3OVr9q/WXV
	 t1FZdX2v8XSubN4dcizLWf8XGaOM4JyLkHpiGe21st2Qyn++hLWccrN2/PlwCKunRT
	 RbxD4b4QwWXj0ApU6SEdrQOiIpdLvGhK4lejfYNM=
From: Amneesh Singh <a-singh21@ti.com>
To: <xen-devel@lists.xenproject.org>
CC: <julien@xen.org>, <sstabellini@kernel.org>,
        Amneesh Singh
	<a-singh21@ti.com>
Subject: [PATCH v2] drivers: char: omap-uart: provide a default clock frequency
Date: Tue, 20 Aug 2024 13:52:03 +0530
Message-ID: <20240820082202.326644-1-a-singh21@ti.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180

Quite a few TI K3 devices do not have clock-frequency specified in their
respective UART nodes. However hard-coding the frequency is not a
solution as the function clock input can differ between SoCs. So, use a
default frequency of 48MHz if the device tree does not specify one.

Signed-off-by: Amneesh Singh <a-singh21@ti.com>
---
 xen/drivers/char/omap-uart.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
v1: https://lore.kernel.org/all/20240719113313.145587-1-a-singh21@ti.com/T/

v1 -> v2
- Ditch adding a dtuart option
- Use a default value instead

This default is the same one as found in the 8250_omap driver of the
linux tree. Already tested with Xen.

diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
index 1079198..9d3d39c 100644
--- a/xen/drivers/char/omap-uart.c
+++ b/xen/drivers/char/omap-uart.c
@@ -48,6 +48,9 @@
 /* System configuration register */
 #define UART_OMAP_SYSC_DEF_CONF   0x0d   /* autoidle mode, wakeup is enabled */
 
+/* default clock frequency in hz */
+#define UART_OMAP_DEFAULT_CLK_SPEED 48000000
+
 #define omap_read(uart, off)       readl((uart)->regs + ((off) << REG_SHIFT))
 #define omap_write(uart, off, val) writel(val, \
                                           (uart)->regs + ((off) << REG_SHIFT))
@@ -322,8 +325,9 @@ static int __init omap_uart_init(struct dt_device_node *dev,
     res = dt_property_read_u32(dev, "clock-frequency", &clkspec);
     if ( !res )
     {
-        printk("omap-uart: Unable to retrieve the clock frequency\n");
-        return -EINVAL;
+        printk("omap-uart: Unable to retrieve the clock frequency, "
+               "defaulting to %uHz\n", UART_OMAP_DEFAULT_CLK_SPEED);
+        clkspec = UART_OMAP_DEFAULT_CLK_SPEED;
     }
 
     uart->clock_hz = clkspec;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:29:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:29:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780183.1189805 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgKEj-0005mk-Fk; Tue, 20 Aug 2024 08:29:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780183.1189805; Tue, 20 Aug 2024 08:29:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgKEj-0005md-Bd; Tue, 20 Aug 2024 08:29:05 +0000
Received: by outflank-mailman (input) for mailman id 780183;
 Tue, 20 Aug 2024 08:29: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=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgKEh-0005mV-OF
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:29:03 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 419253b5-5ece-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 10:29:02 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5bf009cf4c0so1843674a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 01:29:02 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838c6760sm728733766b.23.2024.08.20.01.29.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 01:29:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 419253b5-5ece-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724142542; x=1724747342; 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=pWmTRf+lqqwdFlkN10eJYZT7w32zxJLaePIz0o/Lf70=;
        b=IkFLIGjE8lKPQhJYDpuiJQjdsWPSOadFz++A2+iM1Q0Kks7XvwjnWz2m/iDSPcO3rt
         sfuF8Oe8WORjRRFObvAUbltc7WjK5Rhtg4GY3D0DNS1KIZ/aU2uCAVIhVd+gvzTfxA0M
         tX0Y3bjnRruU7uD6Pytke5MFA0H0NHV1ktMT9PDg1/VHbqxBtRKOsE0+Fhan38mwqzeS
         Dy/PsG8/sVRCqP9bTH5ZDtejY60oaTO7+Y7mFC1XicdBC8GfxgZcJJ4L0UOWgN2K2BWR
         A6z6vBujcIFfvUTGEDOAPkp1HeDMpAeqlHcAMTuvc0c7QZkgmIJfZoj+nHrhIG8jiO/N
         fubQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724142542; x=1724747342;
        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=pWmTRf+lqqwdFlkN10eJYZT7w32zxJLaePIz0o/Lf70=;
        b=J1OAN/a1mnQYucI0GXZOk8EWIDW9QB1A87uJFeMCIfFHaS75OE1ALkuHjwGcGK1JGI
         APMEycTmApbhDUlkl8LaslTzeJWbrfsAK35OuQEtIXszH/6WS4+7btg8Xp4yyhHc85Oy
         RWPhh2KlcqP1MBF6ecVsLMsCjbAZHuX6oh8xehSLtYTBY3JK7K0zpG373VDsUNB5VfCN
         H2LdU6wIY4YT1bizyx1VG8rTUmwuWKg7xbT3l61wH5RJiJ8i2Qyg3yYtwD7vZFEJWz0m
         wpDNSkLyEvMVnMW0i6FqzlqUq4SQ7NtAH4GLYxtZmFCqxWefHnHrwZmqPyIN2uw/5bC2
         FaHg==
X-Forwarded-Encrypted: i=1; AJvYcCW53gdaCApuewMPcI9wvujw23FMZTe0oDcGgWSHwQ4AKJVl4howNL1muRcnqOlcngfuo8plUYLrj54=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw6FVCJPTylm/ZvIsNXWzlkzTiCyYkchFU/MlYSdB12RB/s1NsA
	mpVp4QjOT5Mvarzjt3wFOB9LWni5rvFZ4thTbEMRw4GES7Dp/UvjAAODhbzA6w==
X-Google-Smtp-Source: AGHT+IE6Q+yumPSaA4yB4wRaKEuNPBZP7rH5pqH/ZrgNa5ZaBHo+1ykUeQjOd02FSeuoP+so/JiYyg==
X-Received: by 2002:a17:907:3fa6:b0:a7a:ba59:3164 with SMTP id a640c23a62f3a-a8392a160d8mr944638266b.53.1724142542132;
        Tue, 20 Aug 2024 01:29:02 -0700 (PDT)
Message-ID: <41837bb1-0251-4250-8f00-23d60cb1d664@suse.com>
Date: Tue, 20 Aug 2024 10:29:00 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/7] xen: use correct end address of kernel for
 conflict checking
To: Juergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, linux-kernel@vger.kernel.org,
 x86@kernel.org
References: <20240820082012.31316-1-jgross@suse.com>
 <20240820082012.31316-2-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: <20240820082012.31316-2-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 20.08.2024 10:20, Juergen Gross wrote:
> When running as a Xen PV dom0 the kernel is loaded by the hypervisor
> using a different memory map than that of the host. In order to
> minimize the required changes in the kernel, the kernel adapts its
> memory map to that of the host. In order to do that it is checking
> for conflicts of its load address with the host memory map.
> 
> Unfortunately the tested memory range does not include the .brk
> area, which might result in crashes or memory corruption when this
> area does conflict withe the memory map of the host.
> 
> Fix the test by using the _end label instead of __bss_stop.
> 
> Fixes: 808fdb71936c ("xen: check for kernel memory conflicting with memory layout")
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:36:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:36:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780195.1189814 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgKLJ-0007dq-9n; Tue, 20 Aug 2024 08:35:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780195.1189814; Tue, 20 Aug 2024 08:35:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgKLJ-0007dj-5x; Tue, 20 Aug 2024 08:35:53 +0000
Received: by outflank-mailman (input) for mailman id 780195;
 Tue, 20 Aug 2024 08:35:52 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgKLI-0007dd-Ji
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:35:52 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 345218a0-5ecf-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 10:35:50 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-a7a8caef11fso615700266b.0
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 01:35:50 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383935600sm736331666b.111.2024.08.20.01.35.48
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 01:35:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 345218a0-5ecf-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724142950; x=1724747750; 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=4JRiL9QfRwrA91a43rlkba0LZJgJJT6qYuSKw8nxb4M=;
        b=cjwA1moR/KJIoce10jO3IbvD6vejS0lCsQUQE4QiHO9Q7a/xUBYQ6VSl+SrgLBsnvX
         RNSN93RQUx6YgJWJIKzGNxw9Y3wqe2JjCyBuEQH65n6b44GNymWrS5GbuAecZwyEiihf
         RfavaJCVPH5ZaZPv1gbbz0YKS9UCxc8Riww3XwyzMWeA2J+CHhICdH0NpRbnE1PP65az
         Bo+VhFELfaqmxPyMU6ftzwYQf4TN+yy35hihx82vjSaAgf57W/k6mQR0iAQpdeDNg9rv
         4dTtjirmTk3pQvbf3zcD3h+ZBwNVOvfdB9uc5tvU1rOzpEd/zntfyGxcfIDHxhcCyZGn
         1F/A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724142950; x=1724747750;
        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=4JRiL9QfRwrA91a43rlkba0LZJgJJT6qYuSKw8nxb4M=;
        b=bBb035OGPmIX2vPGTG+I7UJEsoBhXebWReJWDeUzxBBoAbIkx8owZ6zZnOTltmnQ+H
         uz1V4W+Umx8oBNKME9nwALjoQJ9m0aDj+NOSyNhiGloHhl9w7DY5iVhBoyrgbONVXZ7A
         i+ADKJ8nukQ6BrDQl2iL8LYMT863zFexKQu6Q6ppZ5mnBRDVHXq8s1IH2aa2sPjg5hhp
         mU8YPPLyO101vuP2Jck1MsnyHvL6MyJt+rze0ZlOHF7+u4yefkeSkSwoggcPKQ2ue94V
         U/eRHCD2VroSw5hcvvIeBoS5cvT92jZmdaCJtim8IvvOSDPpHc66LcPKXAHW0nUHRhEb
         3Q5g==
X-Forwarded-Encrypted: i=1; AJvYcCXhXjlCna+VYShW2pbaoCN041cxpzw5muXHmdycNVl/Qhi2syv2mMnHmEmxFUuKg4WVFbDrviX6gl1QokwFIoS4DT8g2KSh5rjrgHUd1F8=
X-Gm-Message-State: AOJu0YxeHFLK/pAs7DtdS6bCxvlkI9Y6/1Z7dVhjnj4GFD3a1xnTokz8
	knKx+C2+jAagFFNZ9dW32GizpSKNasVvEPPQxa0qVcAto0DzbUY9aONQPQcXVQ==
X-Google-Smtp-Source: AGHT+IFdaawlNtR3epLC2KfjMcGlx4S9voLmzaSlkj8QL7rvwRfouEdIYTrEhiOI34tqIlQtR+1i2A==
X-Received: by 2002:a17:907:d3c7:b0:a77:e1fb:7dec with SMTP id a640c23a62f3a-a839292dd54mr1022324966b.17.1724142949444;
        Tue, 20 Aug 2024 01:35:49 -0700 (PDT)
Message-ID: <22961690-14d0-4695-ba93-a68d2517059e@suse.com>
Date: Tue, 20 Aug 2024 10:35:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/7] xen: introduce generic helper checking for memory
 map conflicts
To: Juergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, linux-kernel@vger.kernel.org,
 x86@kernel.org
References: <20240820082012.31316-1-jgross@suse.com>
 <20240820082012.31316-3-jgross@suse.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 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: <20240820082012.31316-3-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 20.08.2024 10:20, Juergen Gross wrote:
> When booting as a Xen PV dom0 the memory layout of the dom0 is
> modified to match that of the host, as this requires less changes in
> the kernel for supporting Xen.
> 
> There are some cases, though, which are problematic, as it is the Xen
> hypervisor selecting the kernel's load address plus some other data,
> which might conflict with the host's memory map.
> 
> These conflicts are detected at boot time and result in a boot error.
> In order to support handling at least some of these conflicts in
> future, introduce a generic helper function which will later gain the
> ability to adapt the memory layout when possible.
> 
> Add the missing check for the xen_start_info area.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

However, since you mention the start_info area it may be worth adding half
a sentence to the description also mentioning why the hypervisor allocated
stack page doesn't need checking. In fact this may want to extend to
initrd and phys-mach map as well, to cover everything Xen sets up on behalf
of the kernel.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:40:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:40:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780204.1189823 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgKPc-0001iV-Q3; Tue, 20 Aug 2024 08:40:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780204.1189823; Tue, 20 Aug 2024 08:40:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgKPc-0001iO-N1; Tue, 20 Aug 2024 08:40:20 +0000
Received: by outflank-mailman (input) for mailman id 780204;
 Tue, 20 Aug 2024 08:40:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgKPb-0001iD-4H
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:40:19 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d4411490-5ecf-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 10:40:18 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a86464934e3so84907066b.3
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 01:40:18 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383946538sm732780666b.151.2024.08.20.01.40.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 01:40:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d4411490-5ecf-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724143218; x=1724748018; 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=UIDfxVhY7fnottjWLC7fDlRPFUbWqgVBnlZeCyzgUPg=;
        b=R0cHUYVSYv+hfVplTZXgg6+AyFevwJpwJsNzAmcNHZdS0flH4AhuUhdbqKc0EPpjvU
         nR+tzEgz1rkDLgBYY2FNAg0GWijCDtPtSGwy8Nf+tvAH7tm/x4lRlYGK6Ul3Qm6Rxrdy
         Gyat5fZvOOy5DdiVK27B/5+HwlKkF16DDyQnlyULcaiX4xcLXlipW4i7G5JagMlGp/yN
         CLviLmbYQTNShcGliaB69EzaABeOuwzyFnGgsB15LNgnUkoxTRtooa2FLtDvmgg2oQI6
         D8+eu+qz1j89eczVg11jbcIVwJFcXjvZx7hbz75/zg7Y/YZx9VJscO/uaA0raEPl6tJu
         z4iQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724143218; x=1724748018;
        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=UIDfxVhY7fnottjWLC7fDlRPFUbWqgVBnlZeCyzgUPg=;
        b=hD95IFF3aEPkOLZu7w9djy01kacT15Ruc5uvbZzs4ifmPMDE9yJkyG4/P3fvnsi6YZ
         /V9s2fHKAHi5niQqPvh/8uMfQA5eNkoah65ceoIoXZrOW0mIPomlplhcudnK8nLhr5Ux
         0KJuaL0/2+hy7ZqmqyNrSRtQIp0inAdzX+8ik8T+nNhP93CHLLEJt1g//yvnQswnZh4M
         FQPPzDW2g7z3TJtwGt8Z/OBADNVZTD2wCkYHIwNQuEi8a8bvBKS138VEfteRG20q2f4D
         WGVe0uKY1oST6DxLrE9r+Fy1/7hPG9dj2j6+sNlMCHtguMkO5AGgJPJDipqHw2JJ3a72
         fXrA==
X-Forwarded-Encrypted: i=1; AJvYcCUMF+Kv5wIgV+9qGnOMohxK4XrrnlC7qVbbxsyHXixva6oCjrgjGAEYtpL6O11kGRkQZh2NtkQovR1nd9aT88dS8mzpzr+RhX/fC86eBBE=
X-Gm-Message-State: AOJu0Yy5yMOucycZ7BEUb2tE68Rvw+YrozpJKiZDh3iq8cDRcKpUsOnf
	1f3e+QorlV+JE71kNwEFp9Wrt6yMrHlC4FHqhqyCB7B+U+1uXbCH/Py8cWAkEQ==
X-Google-Smtp-Source: AGHT+IFKKwbAe4UsLI5P0/ECxxMtGDpjSBVELhqGsnY3Ji1MWH4EqctA+4Uw+oYqt73ir9MQOPbetg==
X-Received: by 2002:a17:907:7e93:b0:a7d:3f4b:fcaa with SMTP id a640c23a62f3a-a8392a38e65mr867605966b.67.1724143217855;
        Tue, 20 Aug 2024 01:40:17 -0700 (PDT)
Message-ID: <e01257b4-e2b2-4b3c-84e7-9b4c17d97baf@suse.com>
Date: Tue, 20 Aug 2024 10:40:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 3/7] xen: move checks for e820 conflicts further up
To: Juergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, linux-kernel@vger.kernel.org,
 x86@kernel.org
References: <20240820082012.31316-1-jgross@suse.com>
 <20240820082012.31316-4-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: <20240820082012.31316-4-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 20.08.2024 10:20, Juergen Gross wrote:
> Move the checks for e820 memory map conflicts using the
> xen_chk_is_e820_usable() helper further up in order to prepare
> resolving some of the possible conflicts by doing some e820 map
> modifications, which must happen before evaluating the RAM layout.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Tue Aug 20 08:45:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 08:45:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780210.1189834 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgKU8-0002Jk-Ah; Tue, 20 Aug 2024 08:45:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780210.1189834; Tue, 20 Aug 2024 08:45:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgKU8-0002Jd-7f; Tue, 20 Aug 2024 08:45:00 +0000
Received: by outflank-mailman (input) for mailman id 780210;
 Tue, 20 Aug 2024 08:44: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=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgKU6-0002JX-Dp
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 08:44:58 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7a9c6252-5ed0-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 10:44:57 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a7aac70e30dso561718666b.1
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 01:44:57 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a838396c682sm729383266b.196.2024.08.20.01.44.56
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 01:44:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7a9c6252-5ed0-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724143497; x=1724748297; 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=6yD8g2KoL50GiIU4H3yhFvykxcp80Bk8XWTn51eVuQw=;
        b=UUYRukFWr2LSMVR83A9voH8Ewl9T52oepVx/oJj0cvvSzw4fd+K2fte9QH3qryZbLz
         OP2cZ/L9QJk/bOlHxeqyJVqXxikXkoJV4d5K9g7PQc7nDmK2rVuCbLscOLEvwWJRMNSO
         j/YwtVlA0VIvDW8pW3j5B69TjHn7QejxwZsHM8OWu3O91Pf6nq9OUieABsr0Sx9AbIII
         QP2vaM2ICkiBAMJnXRc1h5HsKXwpOcF5piXTF4kxCKZGKu9sMtC/nsHjrRZYFRca1f4/
         qa82nDHGcBna64B50Bdp7IjKgd7vVdhuw3vzC/paF8ZMJOhAlgFWqjWoYCW3ErNO6KaE
         xLaw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724143497; x=1724748297;
        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=6yD8g2KoL50GiIU4H3yhFvykxcp80Bk8XWTn51eVuQw=;
        b=i2viZh9ivHMULhDHx3yY2X5Hk+zYbv8E0reJGhP6ivEbWvU7HFOHNWjdcEkFcEi1Hf
         gK7K+W9gMqGQ+FmEbJu0E7e8ehzgi9ciYtQX/nHq4kvGBK1HeWw9bvXD4RD1v5CiHijU
         rH3yWfdl6V6+k9/lT0FmloHFIScOxzw+Fdu1oqAH2UdzzrZWl2zRqPaSurxTBRHysjlr
         8qDDCeKdjUH42Cgm8898E3EBXcqAU1dA93fzGgFlk0zLYHU3uCsOwiIIoDXUc8eLIS05
         5z1h5qesCT98hA8hghwzX+Q0IRD6u0ydOnEQkBwG7JtlDLbPDKozQw1v4vVPN1IDaQOF
         JIQQ==
X-Forwarded-Encrypted: i=1; AJvYcCUE9eTENRqBzar7mPIU89x9x4KdGUqjDRcDy2h9rx4hU++sYeCePld2K1/9Ex14QnhIGBUP2fOa2JBWun/sj4CL8zuVpJKKhOQjFjts0Ow=
X-Gm-Message-State: AOJu0YzDgsEd+aAXIp4ZWFXMVm6CQrvNoWD9eTF8u7HR7ij3H9SNVW7x
	MSuBtHVclikfTg+9Zh58Zl2yMrAzNIS4cip12PEeKMsa+NHI6ii30wufmrXrHzxmDnAvieZ+rME
	=
X-Google-Smtp-Source: AGHT+IGcH1K3GomaOMKnp10Sgh4hRQiaDwKk8MjXeZ4iL6GBsmVD3towt0FsuZ3Mxkev+5PfjgXUHQ==
X-Received: by 2002:a17:907:e29e:b0:a7d:c696:76ee with SMTP id a640c23a62f3a-a839292f15bmr1016706666b.17.1724143497021;
        Tue, 20 Aug 2024 01:44:57 -0700 (PDT)
Message-ID: <b9556863-1536-4310-8005-f92e8948356c@suse.com>
Date: Tue, 20 Aug 2024 10:44:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 4/7] xen: move max_pfn in xen_memory_setup() out of
 function scope
To: Juergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, linux-kernel@vger.kernel.org,
 x86@kernel.org
References: <20240820082012.31316-1-jgross@suse.com>
 <20240820082012.31316-5-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: <20240820082012.31316-5-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 20.08.2024 10:20, Juergen Gross wrote:
> Instead of having max_pfn as a local variable of xen_memory_setup(),
> make it a static variable in setup.c instead. This avoids having to
> pass it to subfunctions, which will be needed in more cases in future.
> 
> Rename it to ini_nr_pages, as the value denotes the currently usable
> number of memory pages as passed from the hypervisor at boot time.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

I wonder though why ...

> @@ -712,9 +713,9 @@ char * __init xen_memory_setup(void)
>  	int op;
>  
>  	xen_parse_512gb();
> -	max_pfn = xen_get_pages_limit();
> -	max_pfn = min(max_pfn, xen_start_info->nr_pages);
> -	mem_end = PFN_PHYS(max_pfn);
> +	ini_nr_pages = xen_get_pages_limit();
> +	ini_nr_pages = min(ini_nr_pages, xen_start_info->nr_pages);

... this can't be just

	ini_nr_pages = min(xen_get_pages_limit(), xen_start_info->nr_pages);

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 09:01:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 09:01:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780220.1189844 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgKja-0006oW-J8; Tue, 20 Aug 2024 09:00:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780220.1189844; Tue, 20 Aug 2024 09:00:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgKja-0006oP-FK; Tue, 20 Aug 2024 09:00:58 +0000
Received: by outflank-mailman (input) for mailman id 780220;
 Tue, 20 Aug 2024 09:00: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=u+i8=PT=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sgKjY-0006oJ-Bb
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 09:00:56 +0000
Received: from NAM04-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam04on2062e.outbound.protection.outlook.com
 [2a01:111:f403:2409::62e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b49e1e27-5ed2-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 11:00:54 +0200 (CEST)
Received: from PH8PR07CA0005.namprd07.prod.outlook.com (2603:10b6:510:2cd::29)
 by LV8PR12MB9418.namprd12.prod.outlook.com (2603:10b6:408:202::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.26; Tue, 20 Aug
 2024 09:00:47 +0000
Received: from SN1PEPF0002BA4F.namprd03.prod.outlook.com
 (2603:10b6:510:2cd:cafe::9e) by PH8PR07CA0005.outlook.office365.com
 (2603:10b6:510:2cd::29) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.18 via Frontend
 Transport; Tue, 20 Aug 2024 09:00:48 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SN1PEPF0002BA4F.mail.protection.outlook.com (10.167.242.72) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Tue, 20 Aug 2024 09:00:47 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 20 Aug
 2024 04:00:46 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 20 Aug
 2024 04:00:46 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Tue, 20 Aug 2024 04:00:45 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b49e1e27-5ed2-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=BfDqjrU8tf1waTNY6BGRZ2d8N22ML8xm2X312as5MkodEnyQLsCtrZUvgv/Y2VHxDq+I3BVYc6mBTn8Rbd8Jhbpod2RQniz9KJo/aPRGLJKGtEh+GWL62M7VDyvl98LX2NWhZgs5xRD6u3f2SRrTmIkqTslNUwCK8bvR3Fzlpmj+HBGrHltrLcfJuoXZHqxOCHoXKqZYB6fFUPbiZ1SvxdVEfAx6T2qhClS+/eUdCrIiJOTwBMD3hvm2kDcZJX3as0Wq5bq7dj7lI2c11q7TSpjF36poWQ5YXLeiA1h7AkwjUPVKScBfesuAShQFnLdEiasyHo/QlkV+eiqgeaV8xg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=hq7eMJacCeYJc2bLXgAFyeAFQUs91jOB/O9Z75cf2I4=;
 b=wWyJZfjZa0BvsC3CutSBtZhtMk34Zi7xRfANCZ5hNJPKrtsE7cvZ7YJa0yQIUYFpiVjyHYG4JM+vI0qVFwdbEC69fn++3OWzPBMZeK5GWSpG7FIxpNkfbb4Fx+78wDhfGxKuVHMkcFd9dExTHEFOv3g2MM86t79PVholK0A1RCA777zxTzR2S2WF79EDoqmYHV/QIG5sVhtBuUfxy3QLl1cV7pRxbmJ01CQg/1j0iVW0vFY4dGu4xWnnDUC9PR5Eql8Bs3tJl5viQqRf5lKffor0eybMqOWy3Qn/ZYaZfRpTV/9zWCci5PqQ1uaU6waqSkArA0wMmKqnd50ggG/b5A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=ti.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hq7eMJacCeYJc2bLXgAFyeAFQUs91jOB/O9Z75cf2I4=;
 b=o+psJGr0HkNzI3lucsFn4UVUd/ikIzAiwRzM7MFfEfHmCDQJEMV8cctaGpLNK178BkDK3BtmZK6RI9isO6NBoBaKvtgTPi19oo8hbdyQe8L8r4+5Wg+YVXFj5RPQ6rt1iQxM6U69RxMQnS3dhPgi4rO04a5E6TbUVTq9cbmiOik=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <a75c4202-1d66-45d0-be57-f29cacb6237c@amd.com>
Date: Tue, 20 Aug 2024 11:00:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] drivers: char: omap-uart: provide a default clock
 frequency
To: Amneesh Singh <a-singh21@ti.com>, <xen-devel@lists.xenproject.org>
CC: <julien@xen.org>, <sstabellini@kernel.org>
References: <20240820082202.326644-1-a-singh21@ti.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240820082202.326644-1-a-singh21@ti.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA4F:EE_|LV8PR12MB9418:EE_
X-MS-Office365-Filtering-Correlation-Id: 34779b93-d5bf-4298-0987-08dcc0f694f9
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700013|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?UVNxempXeUdhMEVYekVMMzRrSTRtbEpXK0FyYzBybFdoZG9PaXJpWGtMdjRI?=
 =?utf-8?B?aGdCT0JtNHlDSXRaVVdHTzVUOFpTSWtnZGZKOFU1ZDJzSWNVelBVUXcyOEJ4?=
 =?utf-8?B?VjVLckhCb1dHLzNSOWU5TDFCUkJpQmx0YlNGRXZWeWlPK094TU5uQ3U1Zm5F?=
 =?utf-8?B?TThHS2t6b2ZoK2tPZHQ5WVJsRFk5bGdLWEZadGVBUW5jTVlCMXBpcytXcDk1?=
 =?utf-8?B?ODlubWpmRUxtQ09pc2czdnk3UDhWSnJnY0cxOXh0T3dlVWo2eFVrbzRQZkdk?=
 =?utf-8?B?RjVweUFQNVZ6L2QrZktwV2EzaS8yek1pbk5EdEJTTjdsMVZwRC9KVVdVWUZY?=
 =?utf-8?B?WFRXS0x1TmpaL1dNcnJVMVdOendZLzJoYnVvTTVuaVZJdTlseTJFcGszOWJu?=
 =?utf-8?B?TGxVWGgvTUszcUFKQ0U1WkVpc0RETm5vTy9ZMkF1OU9lQjM1bTQ5S3plbDF1?=
 =?utf-8?B?ZHdzUmk1MHNGV2EyYVdINlBVNnRuQXdhT3FCaTI2NmdXMlgydW1XVGtOeGdX?=
 =?utf-8?B?aDVBbnRQZFpoa0VHVlJBeTQyTUYvckpJeG9KSGZXSStORWFHM1ZKV3dzQklW?=
 =?utf-8?B?TDhZWnlqMHl3eUc1ZGt3QXdLMzlsL003VWNMcjBNTnZuL0hBWTBpQmhCNStY?=
 =?utf-8?B?SDAySU5IdmErYmtaZmhEMVNDQXdZTEtlVmJqYjJiWGREUE90bVkxMUJhcUs2?=
 =?utf-8?B?Nm5qOUxCb2FZWDlQdG8vMkpxOVNaOHRqbWtvMWlFdGZOSzhYVHR5ZUk2TDhQ?=
 =?utf-8?B?cVlmeWRoNC90RUhObGc2dUhuQkJLeE1wS0c4UmhpY09USTJkdkNHdk1wZVFO?=
 =?utf-8?B?VkQ5Z2pEcGlCcW9VaDA5OFBGNlB1L0pwaWlnVTVlVjM2Qk81anFtREJOR0E4?=
 =?utf-8?B?MUZXMGpnMFlBREJQbXFQOFhnOVVpSVViSmpFTmtsTHFvbmVSZTBvMTJ1bDRo?=
 =?utf-8?B?REVncUluRC82MFh0aHhtaFpMbkNETkh6VUpSNTU2VHNVTEJ1S2JKNDRmYTBB?=
 =?utf-8?B?MS90RGdKTnFOVjd5cTVyaGZ1YU5Ed2JKbHlwaUJ3OXpISXphU2ExL0pIK0ky?=
 =?utf-8?B?VDdMK2NEV3lXRDdudWFWYXh6WW1vNW1icElZVmhMSFFxOU1YWWJob0dpbUF2?=
 =?utf-8?B?b3lwK1JkQmNyOXl4THRQODFJbEZNYVZBM1ZXT041YzdUN1BSQlJKZmRwSnlj?=
 =?utf-8?B?VFEzcmgrei9JbE05MVBzZEwybjZmbEQ5bFg4ZysyS1RFQXdXbXN1LzlqeU5u?=
 =?utf-8?B?dC9pQ2p4OVMvVkNMaTlDQXg5bkF6M2x3OTZWbVQyZCtPR2E3akNkM21OZzY4?=
 =?utf-8?B?ZE1FaEkxczFhMUQ1SGE5T0h6b0djRk9FNlE3Qnh5UFRTeGpISlo2TkFhU2NZ?=
 =?utf-8?B?d0IwQnVzVXJQMnBMMkxYcVlqa2JBdzJESnZMb2FsSGlINm1wMDh3amZidmJP?=
 =?utf-8?B?b0wybjJjYmI4c2Z4RlRRWUM0ZXFYU0llSEtKZ2ozaWxXNGRsUnAvekZvTVp3?=
 =?utf-8?B?cld4OEZMcVg3T3JqeXR3dHl3T0lPNzNJbFRTMkswSm9hanBoVGxQSlNGZXYz?=
 =?utf-8?B?WHhlTmNxUURWLzloZ3pkVUQ1TDlrbDBzMnFNSW0rT2hjemdVYWFla2srYVcr?=
 =?utf-8?B?QVZCOHkveTZrWE9ST0xkdWVpY3AwRXNFdWc1UXpEN0g2Tm5wWkpxVFJmTnF5?=
 =?utf-8?B?Y21PV1BZME9EbHFDWnlPZDJvaUF2SXhwQUZ3U0JyQ2VKdy9rNnY4L1AycEcr?=
 =?utf-8?B?VWtJeUhIOVNkS2pRa2x4bkFzS2JQbi9PZFY0NnFsMFN3MFZPRFlYY3VzSUQw?=
 =?utf-8?B?U1VJQ0tzb0VTaHlLNWlKUHRXTHY0UU01dGJMb2xLcEpTNGZmNG5uY1ZzQVpo?=
 =?utf-8?B?R3Y4cnQ0WlB1R2lTYXNwdlpDSmRDTDlYdkNVRGJWOWZDN2RyOGlvTzh2akRZ?=
 =?utf-8?Q?O+eD9SmUy9VJgFzRJyKBJsU4n8TmZj1A?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(1800799024)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 09:00:47.2823
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 34779b93-d5bf-4298-0987-08dcc0f694f9
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SN1PEPF0002BA4F.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9418



On 20/08/2024 10:22, Amneesh Singh wrote:
> 
> 
> Quite a few TI K3 devices do not have clock-frequency specified in their
> respective UART nodes. However hard-coding the frequency is not a
> solution as the function clock input can differ between SoCs. So, use a
> default frequency of 48MHz if the device tree does not specify one.
I'd mention that this is same as Linux

> 
> Signed-off-by: Amneesh Singh <a-singh21@ti.com>
> ---
>  xen/drivers/char/omap-uart.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> ---
> v1: https://lore.kernel.org/all/20240719113313.145587-1-a-singh21@ti.com/T/
> 
> v1 -> v2
> - Ditch adding a dtuart option
> - Use a default value instead
> 
> This default is the same one as found in the 8250_omap driver of the
> linux tree. Already tested with Xen.
> 
> diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
> index 1079198..9d3d39c 100644
> --- a/xen/drivers/char/omap-uart.c
> +++ b/xen/drivers/char/omap-uart.c
> @@ -48,6 +48,9 @@
>  /* System configuration register */
>  #define UART_OMAP_SYSC_DEF_CONF   0x0d   /* autoidle mode, wakeup is enabled */
> 
> +/* default clock frequency in hz */
> +#define UART_OMAP_DEFAULT_CLK_SPEED 48000000
I think this should have U suffix to please MISRA 7.2

> +
>  #define omap_read(uart, off)       readl((uart)->regs + ((off) << REG_SHIFT))
>  #define omap_write(uart, off, val) writel(val, \
>                                            (uart)->regs + ((off) << REG_SHIFT))
> @@ -322,8 +325,9 @@ static int __init omap_uart_init(struct dt_device_node *dev,
>      res = dt_property_read_u32(dev, "clock-frequency", &clkspec);
>      if ( !res )
>      {
> -        printk("omap-uart: Unable to retrieve the clock frequency\n");
> -        return -EINVAL;
> +        printk("omap-uart: Unable to retrieve the clock frequency, "
> +               "defaulting to %uHz\n", UART_OMAP_DEFAULT_CLK_SPEED);
Even though there is a comma, printk messages should not really be split. In such cases it's fine
to exceed 80 chars limit. Or do:
        printk("omap-uart: Clock frequency not specified, defaulting to %uHz\n",
               UART_OMAP_DEFAULT_CLK_SPEED);

Other than that:
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 09:03:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 09:03:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780228.1189853 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgKmA-0007Pi-1w; Tue, 20 Aug 2024 09:03:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780228.1189853; Tue, 20 Aug 2024 09:03:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgKm9-0007Pb-Vh; Tue, 20 Aug 2024 09:03:37 +0000
Received: by outflank-mailman (input) for mailman id 780228;
 Tue, 20 Aug 2024 09:03:37 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sgKm9-0007PT-17
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 09:03:37 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sgKm6-000230-SN; Tue, 20 Aug 2024 09:03:34 +0000
Received: from [15.248.3.90] (helo=[10.24.67.26])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sgKm6-0001Bq-L7; Tue, 20 Aug 2024 09:03:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=h0cdcyxZ0OiBlsqHYQK0TYfwpiVF/3b+tnIDJwRpZYs=; b=mbxAdwiTMubw4duNhA7EH6o2ZS
	8BwBd7jwweBAlBSwqf/a6z0yYj/h7ouULunjQfk3QX3KN7dNROw5vLRgKVcf2MTMeQ1WzKCYeJS8i
	K40ArP5ZfcW5KLGH74Lce20AQfWLcWw9gNWgPksIdcDVUQY4IaEVTX1BnhBpuLTYowsc=;
Message-ID: <edb52fc6-fc69-4670-a1bd-e3e960a6e408@xen.org>
Date: Tue, 20 Aug 2024 10:03:32 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] drivers: char: omap-uart: provide a default clock
 frequency
Content-Language: en-GB
To: Michal Orzel <michal.orzel@amd.com>, Amneesh Singh <a-singh21@ti.com>,
 xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org
References: <20240820082202.326644-1-a-singh21@ti.com>
 <a75c4202-1d66-45d0-be57-f29cacb6237c@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <a75c4202-1d66-45d0-be57-f29cacb6237c@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 20/08/2024 10:00, Michal Orzel wrote:
> On 20/08/2024 10:22, Amneesh Singh wrote:
>>
>>
>> Quite a few TI K3 devices do not have clock-frequency specified in their
>> respective UART nodes. However hard-coding the frequency is not a
>> solution as the function clock input can differ between SoCs. So, use a
>> default frequency of 48MHz if the device tree does not specify one.
> I'd mention that this is same as Linux
> 
>>
>> Signed-off-by: Amneesh Singh <a-singh21@ti.com>
>> ---
>>   xen/drivers/char/omap-uart.c | 8 ++++++--
>>   1 file changed, 6 insertions(+), 2 deletions(-)
>> ---
>> v1: https://lore.kernel.org/all/20240719113313.145587-1-a-singh21@ti.com/T/
>>
>> v1 -> v2
>> - Ditch adding a dtuart option
>> - Use a default value instead
>>
>> This default is the same one as found in the 8250_omap driver of the
>> linux tree. Already tested with Xen.
>>
>> diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
>> index 1079198..9d3d39c 100644
>> --- a/xen/drivers/char/omap-uart.c
>> +++ b/xen/drivers/char/omap-uart.c
>> @@ -48,6 +48,9 @@
>>   /* System configuration register */
>>   #define UART_OMAP_SYSC_DEF_CONF   0x0d   /* autoidle mode, wakeup is enabled */
>>
>> +/* default clock frequency in hz */
>> +#define UART_OMAP_DEFAULT_CLK_SPEED 48000000
> I think this should have U suffix to please MISRA 7.2
> 
>> +
>>   #define omap_read(uart, off)       readl((uart)->regs + ((off) << REG_SHIFT))
>>   #define omap_write(uart, off, val) writel(val, \
>>                                             (uart)->regs + ((off) << REG_SHIFT))
>> @@ -322,8 +325,9 @@ static int __init omap_uart_init(struct dt_device_node *dev,
>>       res = dt_property_read_u32(dev, "clock-frequency", &clkspec);
>>       if ( !res )
>>       {
>> -        printk("omap-uart: Unable to retrieve the clock frequency\n");
>> -        return -EINVAL;
>> +        printk("omap-uart: Unable to retrieve the clock frequency, "
>> +               "defaulting to %uHz\n", UART_OMAP_DEFAULT_CLK_SPEED);
> Even though there is a comma, printk messages should not really be split. In such cases it's fine
> to exceed 80 chars limit. Or do:

In general, we allow to exceed the limit only for the message. If there 
are arguments then ...

>          printk("omap-uart: Clock frequency not specified, defaulting to %uHz\n",
>                 UART_OMAP_DEFAULT_CLK_SPEED);

... this is the preferred approach. I can do the update on commit if an 
updated commit message is provided.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 09:38:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 09:38:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780241.1189864 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgLJd-0005pk-Jx; Tue, 20 Aug 2024 09:38:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780241.1189864; Tue, 20 Aug 2024 09:38:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgLJd-0005pd-Gn; Tue, 20 Aug 2024 09:38:13 +0000
Received: by outflank-mailman (input) for mailman id 780241;
 Tue, 20 Aug 2024 09:38:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgLJc-0005pE-Dn
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 09:38:12 +0000
Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com
 [2a00:1450:4864:20::633])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e9a3ed67-5ed7-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 11:38:10 +0200 (CEST)
Received: by mail-ej1-x633.google.com with SMTP id
 a640c23a62f3a-a83597ce5beso800241566b.1
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 02:38:10 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838d015asm738899266b.90.2024.08.20.02.38.09
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 02:38:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e9a3ed67-5ed7-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724146690; x=1724751490; 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=+NozY5ZdvAwIajBZmKZXdaHS6vOEqlk/A9b6+fwi6NE=;
        b=SF/ofDOM1fUugmRZjyG0hANampMySqHLxvDrTa9JMzsKaWxZW2sCisdCuI0JJXwhZF
         tOaAuRb2zBKMxc2c/Xo9d6IQgVEnXDEq/daJqDOMd1ldfXCuhMl93VTJws1POw76BnyN
         9yU87W7Fdew5uXWYvX414DjK35+3moStCd/PwPHiU1axXLN9AAMPpzyN6LaVHnO8Q4Sq
         FV97rua37A+0D19KrmVkUtt0Hidwa/zWiv7B6ETOwBuiAgcFrZGLUeBpPt5+16k6xLtk
         ixeDL3YKtqlOGtBiefuA5BnPvf3ixEblw6v2o9nfjQigAewZTX9YhNFmGEmRSWgjH6Sm
         RpCw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724146690; x=1724751490;
        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=+NozY5ZdvAwIajBZmKZXdaHS6vOEqlk/A9b6+fwi6NE=;
        b=S0LhKc0uwO0KHiRHpGsFqE83GI55IAIWZLzgdzfKYUlCFL3zcCIgFIlqGOtPKEwVAf
         noL8GQkLAo6G523veSPcQxnk563hRhQcMVERg2lVIvB6i7z6JeYrBkgq8nTAfieye1f1
         r3KjeTU5/aAfGIhfTcxErvDD/7McX94YKDJXq12F+1+pEdzyy2UdeSoX9Q49uDaYwhy+
         +mDPm7tm6YbhF0CtEPawnVmBrlegLyzk+Wzh7VMgGdOMtdHR3n6qLMxZvOjAZHf5BYNg
         edcPV42IsVDyd5aZNf7nLZxda3KPL6Pf2Ch1eQINQKHsUFNeZqWZg7RHiLc9exSwDaT4
         2CTw==
X-Forwarded-Encrypted: i=1; AJvYcCXVb6JA6vDTx0CDGUu/WzmnumWnqe/pPom6q4gDmnCEUwDYxK6pBLS+wtW4MX1TdjHR2NDr1B35uP4=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz6xb1OwV4Qe+Bm2BvuT23z5Vfipa917vBsN9EBaQ/SC/RYawV8
	4eJlH/W2nymWBE4LZpPziACx2JjnLPScL0vMg5nLWDjCWY/Dj3Z7D0HJZvGz9g==
X-Google-Smtp-Source: AGHT+IEPBH5lFRLcB4lxBgQg9tNKFfBqKQQfsk6wOfQV5ywxbBkGJCylykN/aC4NPHooONPyfH3Fbg==
X-Received: by 2002:a17:907:2d07:b0:a7a:b26d:fb5 with SMTP id a640c23a62f3a-a8643f8115emr239072066b.19.1724146689632;
        Tue, 20 Aug 2024 02:38:09 -0700 (PDT)
Message-ID: <d32735a1-79a9-43c1-b4a6-15ddbc203646@suse.com>
Date: Tue, 20 Aug 2024 11:38:08 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 5/7] xen: add capability to remap non-RAM pages to
 different PFNs
To: Juergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 linux-kernel@vger.kernel.org, x86@kernel.org
References: <20240820082012.31316-1-jgross@suse.com>
 <20240820082012.31316-6-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: <20240820082012.31316-6-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 20.08.2024 10:20, Juergen Gross wrote:
> When running as a Xen PV dom0 it can happen that the kernel is being
> loaded to a guest physical address conflicting with the host memory
> map.
> 
> In order to be able to resolve this conflict, add the capability to
> remap non-RAM areas to different guest PFNs. A function to use this
> remapping information for other purposes than doing the remap will be
> added when needed.
> 
> As the number of conflicts should be rather low (currently only
> machines with max. 1 conflict are known), save the remap data in a
> small statically allocated array.
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> V2:
> - split off from patch 5 of V1 of the series
> - moved to p2m.c
> ---
>  arch/x86/xen/p2m.c     | 65 ++++++++++++++++++++++++++++++++++++++++++
>  arch/x86/xen/xen-ops.h |  3 ++
>  2 files changed, 68 insertions(+)
> 
> diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
> index 7c735b730acd..bb55e0fe1a04 100644
> --- a/arch/x86/xen/p2m.c
> +++ b/arch/x86/xen/p2m.c
> @@ -80,6 +80,7 @@
>  #include <asm/xen/hypervisor.h>
>  #include <xen/balloon.h>
>  #include <xen/grant_table.h>
> +#include <xen/hvc-console.h>
>  
>  #include "xen-ops.h"
>  
> @@ -792,6 +793,70 @@ int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops,
>  	return ret;
>  }
>  
> +/* Remapped non-RAM areas */
> +#define NR_NONRAM_REMAP 4
> +static struct nonram_remap {
> +	phys_addr_t maddr;
> +	phys_addr_t paddr;
> +	unsigned long size;

size_t?

> +} xen_nonram_remap[NR_NONRAM_REMAP];
> +static unsigned int nr_nonram_remap;

Both __initdata? Or, considering patch 6, at least __ro_after_init?

> +/*
> + * Do the real remapping of non-RAM regions as specified in the
> + * xen_nonram_remap[] array.
> + * In case of an error just crash the system.
> + */
> +void __init xen_do_remap_nonram(void)
> +{
> +	unsigned int i;
> +	unsigned int remapped = 0;
> +	struct nonram_remap *remap = xen_nonram_remap;
> +	unsigned long pfn, mfn, len;
> +
> +	if (!nr_nonram_remap)
> +		return;
> +
> +	for (i = 0; i < nr_nonram_remap; i++) {
> +		pfn = PFN_DOWN(remap->paddr);
> +		mfn = PFN_DOWN(remap->maddr);
> +		for (len = 0; len < remap->size; len += PAGE_SIZE) {
> +			if (!set_phys_to_machine(pfn, mfn)) {
> +				pr_err("Failed to set p2m mapping for pfn=%ld mfn=%ld\n",

I'm not convinced that frame numbers logged in decimal are overly useful.

> +				       pfn, mfn);
> +				BUG();
> +			}
> +
> +			pfn++;
> +			mfn++;
> +			remapped++;
> +		}
> +
> +		remap++;
> +	}
> +
> +	pr_info("Remapped %u non-RAM page(s)\n", remapped);

This message may be useful in a log also when nothing was remapped - maybe
drop the initial if()?

> +}
> +
> +/*
> + * Add a new non-RAM remap entry.
> + * In case of no free entry found, just crash the system.
> + */
> +void __init xen_add_remap_nonram(phys_addr_t maddr, phys_addr_t paddr,
> +				 unsigned long size)
> +{
> +	if (nr_nonram_remap == NR_NONRAM_REMAP) {
> +		xen_raw_console_write("Number of required E820 entry remapping actions exceed maximum value\n");
> +		BUG();
> +	}
> +
> +	xen_nonram_remap[nr_nonram_remap].maddr = maddr;
> +	xen_nonram_remap[nr_nonram_remap].paddr = paddr;
> +	xen_nonram_remap[nr_nonram_remap].size = size;
> +
> +	nr_nonram_remap++;
> +}

You don't enforce any constraints on the addresses / size here. With
this the loop in xen_do_remap_nonram() may terminate too early if non-
page-aligned values were passed into here. Both addresses not having
the same offset-into-page may also end up anomalous. Might be worth
switching to frame numbers / number-of-pages for the tracking struct.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 09:56:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 09:56:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780251.1189878 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgLbE-0001EY-2j; Tue, 20 Aug 2024 09:56:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780251.1189878; Tue, 20 Aug 2024 09:56:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgLbD-0001ER-W9; Tue, 20 Aug 2024 09:56:23 +0000
Received: by outflank-mailman (input) for mailman id 780251;
 Tue, 20 Aug 2024 09:56: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=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgLbC-0001AF-OK
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 09:56:22 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7391e67d-5eda-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 11:56:20 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-52f01b8738dso4346805e87.1
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 02:56:20 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838c66e2sm739681766b.3.2024.08.20.02.56.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 02:56:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7391e67d-5eda-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724147780; x=1724752580; 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=O22wnNYOCBxaZUWUifSw34IZJjKrxoUhdzvzmYoIV68=;
        b=PalY9WhcQAx4h56lDLb14/V3v57gOtxKMtKlN+YsrXZcjYo5kfU4ZEk5PZrVJMBoFp
         t6Gdkf/4cFXMVjw7Q8zb34jvsfR0WsJnfhrn341JnabFPkVaHYXRjwRJVq1YZ3/BeSwU
         nDhs7MNky9M2lp+Mna7szNweYG/msnbJnGFvAj8UkMLM3j3kLAabuTADskdxrt5MJ5R7
         wW74b49pAwVR2I9ILNNbxUawsJdpqDjuMHNzrURbBtnAdp3zqA0KSAB9DteE9HaGENlu
         kqHpBoFXo9Xs92qFncOFJhc4kxmPpCZGU4pvEhpmoBRyr3ep4sYe5PQ5/onzQT6DB1vR
         9T5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724147780; x=1724752580;
        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=O22wnNYOCBxaZUWUifSw34IZJjKrxoUhdzvzmYoIV68=;
        b=oujgKaQVt0npvmIEZ7Oimsyu9T1eN9VPpbma9rby1a9h+0t3Yh316MYBPWEhc7ra+l
         ah8jQFSGIB1YFpLzCFVM+FIj4dl/Lq0voZT3dw9JUWB4No1p08YfiQCpeIyjsFZ3p3Sq
         WXu3d/T7Iqma2KtJjm1D7QJFx5TD/bw+aBN20P56OCNynjAxI0+8AH1nzbV9/KB+kWnJ
         xvSOteYX156gLJ4E8P5MiiU+60HZhw/uXhAKGJxQjQQRgMOOtCURcaVw/u//5vWPk2WT
         P963ffYcj2DvyxhynvfvXtiI52Hj+zKelAxzs2C3ci5+tciha3bt47E9sZZLtaj5r5qQ
         7tSQ==
X-Forwarded-Encrypted: i=1; AJvYcCWp3lGAUCH04sbrZ5XMmekFMsV7boVRpKho6EV9E8HkaJ2TptZK1C/2YD1MxccKY8sgy9dkVbUBDOk=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yyrx0opL2b4OCamtZv5SUdBo6JCZU/dAVDIFJGQlRuMT2Ve4H0K
	sgT1nGW00OI/PM8zKGDdnzfvGxmQWsczGtrPiYzlAPhSyikS+ivSGoVvB4mEuA==
X-Google-Smtp-Source: AGHT+IFrsPT4hsY3MVuzsaum359JeocN124iERr4tvRuSUdtykAH993mPaa7xKBT+WQaa6tnUfu4FA==
X-Received: by 2002:a05:6512:3085:b0:533:809:a970 with SMTP id 2adb3069b0e04-5331c6a20e1mr8788954e87.14.1724147779985;
        Tue, 20 Aug 2024 02:56:19 -0700 (PDT)
Message-ID: <607602c3-5199-4326-8676-d28a8b42b4b5@suse.com>
Date: Tue, 20 Aug 2024 11:56:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 6/7] xen: allow mapping ACPI data using a different
 physical address
To: Juergen Gross <jgross@suse.com>
Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, "Rafael J. Wysocki" <rafael@kernel.org>,
 Len Brown <lenb@kernel.org>, Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
 x86@kernel.org, linux-acpi@vger.kernel.org
References: <20240820082012.31316-1-jgross@suse.com>
 <20240820082012.31316-7-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: <20240820082012.31316-7-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 20.08.2024 10:20, Juergen Gross wrote:
> @@ -838,6 +839,31 @@ void __init xen_do_remap_nonram(void)
>  	pr_info("Remapped %u non-RAM page(s)\n", remapped);
>  }
>  
> +/*
> + * Xen variant of acpi_os_ioremap() taking potentially remapped non-RAM
> + * regions into acount.
> + * Any attempt to map an area crossing a remap boundary will produce a
> + * WARN() splat.
> + */
> +static void __iomem *xen_acpi_os_ioremap(acpi_physical_address phys,
> +					 acpi_size size)
> +{
> +	unsigned int i;
> +	struct nonram_remap *remap = xen_nonram_remap;

const (also in one of the functions in patch 5)?

> +	for (i = 0; i < nr_nonram_remap; i++) {
> +		if (phys + size > remap->maddr &&
> +		    phys < remap->maddr + remap->size) {
> +			WARN_ON(phys < remap->maddr ||
> +				phys + size > remap->maddr + remap->size);
> +			phys = remap->paddr + phys - remap->maddr;
> +			break;
> +		}
> +	}
> +
> +	return x86_acpi_os_ioremap(phys, size);
> +}

At least this, perhaps also what patch 5 adds, likely wants to be limited
to the XEN_DOM0 case? Or else I wonder whether ...

> @@ -850,6 +876,10 @@ void __init xen_add_remap_nonram(phys_addr_t maddr, phys_addr_t paddr,
>  		BUG();
>  	}
>  
> +	/* Switch to the Xen acpi_os_ioremap() variant. */
> +	if (nr_nonram_remap == 0)
> +		acpi_os_ioremap = xen_acpi_os_ioremap;

... this would actually build when XEN_DOM0=n.

I'm actually surprised there's no Dom0-only code section in this file,
where the new code could then simply be inserted.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 10:00:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 10:00:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780260.1189887 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgLej-0001vv-Gp; Tue, 20 Aug 2024 10:00:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780260.1189887; Tue, 20 Aug 2024 10:00:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgLej-0001vq-Dl; Tue, 20 Aug 2024 10:00:01 +0000
Received: by outflank-mailman (input) for mailman id 780260;
 Tue, 20 Aug 2024 09:59:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgLeh-0001vg-JP; Tue, 20 Aug 2024 09:59:59 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgLeh-0002xG-H0; Tue, 20 Aug 2024 09:59:59 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgLeh-0005mJ-10; Tue, 20 Aug 2024 09:59:59 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sgLeh-0002Cd-0R; Tue, 20 Aug 2024 09:59:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=yQ71xS9f46nCgggkNV8j8KO7V9qrOfLR8gzvnB41vd0=; b=3TjnIx7khi4NZiYQhZFa0MiCA8
	magBefOBoS4WBmBZkuX+dxNjr60l/KNJf21pn/kV8qrBeb4nYt6W6wx2071ou1SCeQT0NzrkXFQVQ
	mBo2N2s8ELH4oMUZtgNnaApyQd9QODVjymRIAw44enNXO72WhgEoOdKj5AopGLgvd/R0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187286-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187286: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=a30d438ce58b70c5955f5d37f776086ab8f88623
X-Osstest-Versions-That:
    xen=1e2a5f991f86979b89aa9a60ca3ba8106ee7d987
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 20 Aug 2024 09:59:59 +0000

flight 187286 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187286/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187280
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187280
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187280
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187280
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187280
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187280
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  a30d438ce58b70c5955f5d37f776086ab8f88623
baseline version:
 xen                  1e2a5f991f86979b89aa9a60ca3ba8106ee7d987

Last test of basis   187280  2024-08-19 03:46:14 Z    1 days
Testing same since   187286  2024-08-19 18:11:30 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Jan Beulich <jbeulich@suse.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   1e2a5f991f..a30d438ce5  a30d438ce58b70c5955f5d37f776086ab8f88623 -> master


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 10:24:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 10:24:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780276.1189898 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgM1i-0006tU-FW; Tue, 20 Aug 2024 10:23:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780276.1189898; Tue, 20 Aug 2024 10:23:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgM1i-0006tN-Cf; Tue, 20 Aug 2024 10:23:46 +0000
Received: by outflank-mailman (input) for mailman id 780276;
 Tue, 20 Aug 2024 10:23:45 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgM1g-0006tH-Uw
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 10:23:44 +0000
Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com
 [2a00:1450:4864:20::630])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4679f4f6-5ede-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 12:23:43 +0200 (CEST)
Received: by mail-ej1-x630.google.com with SMTP id
 a640c23a62f3a-a8384008482so561592966b.2
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 03:23:43 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83839344cdsm741874266b.114.2024.08.20.03.23.41
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 03:23:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4679f4f6-5ede-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724149422; x=1724754222; 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=jQbU+wmhc9okDK89belLs9mlxFgpOghZ2CbgXLEJ9V0=;
        b=G0MI4zLscbNpHQqXdDL/ZGS6zmXqzGMJNI10m7V902JiZU2Zr2K387j916NsKy/byQ
         FC4QU2T79E6MrDyCxbmNJG2ohJsUTMQFdy8bKuWh3qCG5mV2iArKPMlThpWrltwqugRj
         rm5ZYkWbWxHU9VoWfYglVL0ZY6QidwT0946Ki1J+WkXISOF1+EXIt2tNtMmKr7K4lmND
         bD+owQDmwsT35zXklbQoK711rpwsyBOFwpCbQpaA6GRjTsZs8aTxVLl3zS+sjEIN9A4c
         zD7CCuN6NLKyiea5QudVs0cZhm0y5/wzj5ZaVgXVMBQPste4RREsAx876CRl50D66YI5
         smqg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724149422; x=1724754222;
        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=jQbU+wmhc9okDK89belLs9mlxFgpOghZ2CbgXLEJ9V0=;
        b=RKd38F8Nr7b1uRqVfTvbMTalRGBcwjZIA3ZLDObZvWMtzE35CaM1ky0jFhvozeoBhw
         K9MN7zpviQS4vKZo7uI3ovpFaVARKvO5pT4qrQIL0pm52Dco2xewNjDPX67GqjQdu/xv
         RTC7fhp7Y/O4/D39n3G5oiQebQzoKyVg5PGDrb6wAQfS1HLvbRNaO3jJa27DMWj+g2bJ
         SFJQQbsSFHnkuR+ahCtsxEhVbCR8PKmMkWV2ltZ9qzVFz++ZC045Kb5e0dfWooMfPait
         kByDdB8KSrKqn67Wh/V0rgtuN6Z4MBWz17OaKM1MNPtBDbxG7DKDSEhf2p/Q7UYfOg96
         NHOw==
X-Forwarded-Encrypted: i=1; AJvYcCXqWU85HdBEPT1dhhJhCc0NTqykgQMg7WniZ3RB3nXF8xsESUpu9eyp0qTPhdadsAww9LKgnprvcNWa6eT7UOQJixNQbjJhcHNYgDNPORE=
X-Gm-Message-State: AOJu0YxedWE6T519Sse0xW9nCfbRRy6bp0Qat3p4LlJX8Bx6F4uqVizV
	xp7iyFqjXx7BFPamfjeTAv4sI0gSIOkt9kUIsJ6TRfsH5IoE/MLFUTmPIoya/Q==
X-Google-Smtp-Source: AGHT+IGYY6+/3Hs0Q6u/L07obMsnlHRatKoHFLlhFa/E1FH4GJdX79IJomctjDvK3E1Sp8/0CJuvXg==
X-Received: by 2002:a17:907:8691:b0:a77:c583:4f78 with SMTP id a640c23a62f3a-a8647a1a0eemr101756366b.39.1724149422397;
        Tue, 20 Aug 2024 03:23:42 -0700 (PDT)
Message-ID: <45a43d3c-35a5-49cd-a677-67fde3e5b56b@suse.com>
Date: Tue, 20 Aug 2024 12:23:41 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 7/7] xen: tolerate ACPI NVS memory overlapping with Xen
 allocated memory
To: Juergen Gross <jgross@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, linux-kernel@vger.kernel.org,
 x86@kernel.org
References: <20240820082012.31316-1-jgross@suse.com>
 <20240820082012.31316-8-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: <20240820082012.31316-8-jgross@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 20.08.2024 10:20, Juergen Gross wrote:
> In order to minimize required special handling for running as Xen PV
> dom0, the memory layout is modified to match that of the host. This
> requires to have only RAM at the locations where Xen allocated memory
> is living. Unfortunately there seem to be some machines, where ACPI
> NVS is located at 64 MB, resulting in a conflict with the loaded
> kernel or the initial page tables built by Xen.
> 
> As ACPI NVS needs to be accessed by the kernel only for saving and
> restoring it across suspend operations, it can be relocated in the
> dom0's memory map by swapping it with unused RAM (this is possible
> via modification of the dom0 P2M map).

Shouldn't this paragraph be amended / re-written, as this was what made
me ask for what is now patch 6?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 10:38:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 10:38:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780283.1189908 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgMFz-0001Gk-Lh; Tue, 20 Aug 2024 10:38:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780283.1189908; Tue, 20 Aug 2024 10:38:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgMFz-0001Gd-IY; Tue, 20 Aug 2024 10:38:31 +0000
Received: by outflank-mailman (input) for mailman id 780283;
 Tue, 20 Aug 2024 10:38: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=WGdy=PT=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sgMFy-0001GX-Rh
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 10:38:31 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on20613.outbound.protection.outlook.com
 [2a01:111:f403:2418::613])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 560b86cb-5ee0-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 12:38:29 +0200 (CEST)
Received: from BN9P222CA0004.NAMP222.PROD.OUTLOOK.COM (2603:10b6:408:10c::9)
 by MN0PR12MB6245.namprd12.prod.outlook.com (2603:10b6:208:3c3::21) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug
 2024 10:38:23 +0000
Received: from BN3PEPF0000B070.namprd21.prod.outlook.com
 (2603:10b6:408:10c:cafe::1b) by BN9P222CA0004.outlook.office365.com
 (2603:10b6:408:10c::9) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19 via Frontend
 Transport; Tue, 20 Aug 2024 10:38:23 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BN3PEPF0000B070.mail.protection.outlook.com (10.167.243.75) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.4 via Frontend Transport; Tue, 20 Aug 2024 10:38:22 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 20 Aug
 2024 05:38:22 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 20 Aug
 2024 05:38:22 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Tue, 20 Aug 2024 05:38:21 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 560b86cb-5ee0-11ef-a507-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=gwoAwAByHiH8XACmWSxrBU52tqtquujeZS29n7HzRHLBHL+uSjw8AFmv8DPjxPDbJz8tVbHSOF1cdkxaB9y+JNSgyYVuWnlQKae8wlbehQq3pPPELbhT9+/66/j1BCox6MfjWEQ4AytD/75LZbCt1/TKMDiCsRUzXE+uqsM/VgW2WrnP+Jqb0BoXKo0js2uVAWBqXDmFmRJGCd6rv4qAc3fr0tC5ptLCjOYVrWJOMCa2dbYK5EfgsPSX6CdNvnluHL7fvrOKQZUUswKcHvGQZoyOmSNZlKCkxk/ayQiViABfc8QgLhBQpksBSvHGxI3/WLe73me/lRnTRiHMKkwJpw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Az5G/4Bfjv9tQ7mrCOkdrHnDcMCAXorKTD8BS6sc21s=;
 b=p3cGzoLz/SPM9x2oyrXAiy4/I/DUJVYVAZo6mpJ0psJebULqv5tzuppbhr1vzgkm8xUKe6IbwIUzU22tv7jejefSmBPSxE8aI0HouuGw5h31w9EguxMiBPXMXe5oBxR9B3H2avo8fc6NOvpZJGKxiC69iNc2mWeS7XVWg9e80+g1PGiaJRVM5W0BWVgDTCVTWc5eyRQ9JiGPq9qVOhZPvgQqSXDV3xnAG5nvYm/39JBbxKTm8h6y2B/2fmqn4nIU4z03+V+fijzEIz2Nhs7fzV6sYGSJVAp8DuqpicsDRv0UAG5Y26D/LkIpHc5Z9bswn0OPJz7WioMfN8BbEkKsGA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Az5G/4Bfjv9tQ7mrCOkdrHnDcMCAXorKTD8BS6sc21s=;
 b=5m8KvnNWxulwwUZsH1xi2hnRfgJ31uLl3skI7jxfdW6uV9F4Wj1nmQnccGIFRKeF0+NQsTq7Rw/dcduzMyZSGqfAVrVPjXZ+ZdrIun6vJwMdfKPycva/yhDeCnGdZruyzOtNCHbyL9M29UpqaXI3GtYgtEt74HZNFeq+HtFoNHI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Michal Orzel <michal.orzel@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Bertrand Marquis <bertrand.marquis@arm.com>, "Ayan
 Kumar Halder" <ayan.kumar.halder@amd.com>, Artem Mygaiev
	<artem_mygaiev@epam.com>
Subject: [PATCH] docs: fusa: Add requirements for generic timer
Date: Tue, 20 Aug 2024 11:38:16 +0100
Message-ID: <20240820103816.1661102-1-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B070:EE_|MN0PR12MB6245:EE_
X-MS-Office365-Filtering-Correlation-Id: 4ba6f399-22f7-42be-d28a-08dcc1043731
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?giZTA79JBom3efIiT3o5xNiSvAMiEcm78hj3AeolxUZwP1ES43TyNukqMWyx?=
 =?us-ascii?Q?ZEpjKGdDakvhDtIY215OoINSKvkmJlJeduhc8UCtVkJ8UN29mCphLuTJDAFt?=
 =?us-ascii?Q?19wJPtQgih2pF80RU166E3jVk2Kxmyk/of2TngkZZ0K05lcmhFCu9HSnr1ZD?=
 =?us-ascii?Q?DEfGcTZUEnfVIIbr1IfZ2hmfOmWwJ/eOnbswnoMsMRfllcxiqgwXi3OhXeng?=
 =?us-ascii?Q?2Ur8lJ79GnPlM2M+Pp0RDUr9O8EApss8z23Yc7bWdYOYBdTFcDdiOmdXr13G?=
 =?us-ascii?Q?FD1j6hK60MkH5VCDMnEizaJBJTO9GsFJQDZaYN6x3knzXnCrgSu+xBLAePMB?=
 =?us-ascii?Q?ZR0pL3AZB1U9XBsg7azzX8ljekDFhHTLsREKB2irP2CHUICoj7yoXgTEAI0S?=
 =?us-ascii?Q?I4m4T1SN4L8HyqjcArFPQVzmsnN7treo+xQWW0nE6eXE1JZCUlEo0b6B2Vv0?=
 =?us-ascii?Q?Xifsxy3fO7ycCkfJDZZvHeD0+MHNWhv60cr6RlKV25ryRMxh1BRLUTcHFTcD?=
 =?us-ascii?Q?MdZTq3ndMdajKbuMlgEmjcI3b/VRy4jAeRhmE5cpnnfKHstRKvtIJ/RFKe6G?=
 =?us-ascii?Q?bQHnC1JkQXE3+XtD64GUFFMqemaKcE+5BhDwwq4maj1nr3QsprSfqMrc+0/R?=
 =?us-ascii?Q?aQU5vNeujtMY0MQ6ir4J+9Vl2xlNRDU87l9n4C9+DCiVMA+nnkHhnUyAaxQ/?=
 =?us-ascii?Q?o3Y9sT9M0QF3b0NT0DSMhL9RHPkmlfiGvMW32FIGJp0/C8GLRfTYTt7V3qdB?=
 =?us-ascii?Q?AzFlBfyEp6L91ZCldfvgOxrgdAI9zxe86gyDTzhNwIzTxGRlO3Z3YYq9h7tF?=
 =?us-ascii?Q?mkr9ehDA4fwz2qg1iKQgGSq2W38JUcEQKxV/RKlxx2GcEZjZAMFl9TmECdzZ?=
 =?us-ascii?Q?CpQ7rr8bIWGCNfBoZixUoUvJeIvQcSN9shU8g5ILTqeRo5u8MwQd0fVD4o/5?=
 =?us-ascii?Q?M5pc8UlMLv3iOS9rizTRbeaEZTtR4rkUIfoBY+d6yZhN2UnhKlmPur7sLOtt?=
 =?us-ascii?Q?jf8CekgtGvBTqghZdPOLTRotYFHme6bn/TGwM9IwMuHxanAdzP33FiWLrUGh?=
 =?us-ascii?Q?Kp66a7zVcgykwis6yH6Ty4J9n0aYGZKglf6DO88n8LNCUlZFrb/mYTGRM1ur?=
 =?us-ascii?Q?uHjUrPLQHxzuCZ6AW0wFNCz0i/RcG77VUu8Ub/cnEHQqdnCv7nFTj75dUhqJ?=
 =?us-ascii?Q?2Noi0iaDhmlEfGHkoSgIv3VoMQziRHzkdd817Xy4cfduPxyVetARUAOuIiSo?=
 =?us-ascii?Q?rP6RBROXMOvx4MLe0ucf5dWsOTIgRSkRwNBBYv8z36wbi3u3fOZriDg9CbF6?=
 =?us-ascii?Q?I46XqGFKwUv+BH7e4Qy5/D/YLu4hyoonX77bpuVdwG4OJyT7TYaHMoo4EImQ?=
 =?us-ascii?Q?GCbU0/56WLCaUHBEbt+fAAn2pKX8YxqF0ERO2JnBYnyxtc80rfafctFy83zd?=
 =?us-ascii?Q?rjHm8i5DW+A3K9F/qv+fA1oBnmJ/b680?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 10:38:22.9028
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 4ba6f399-22f7-42be-d28a-08dcc1043731
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B070.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6245

From: Michal Orzel <michal.orzel@amd.com>

Add the requirements for the use of generic timer by a domain

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
 .../reqs/design-reqs/arm64/generic-timer.rst  | 139 ++++++++++++++++++
 docs/fusa/reqs/index.rst                      |   3 +
 docs/fusa/reqs/intro.rst                      |   3 +-
 docs/fusa/reqs/market-reqs/reqs.rst           |  34 +++++
 docs/fusa/reqs/product-reqs/arm64/reqs.rst    |  24 +++
 5 files changed, 202 insertions(+), 1 deletion(-)
 create mode 100644 docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
 create mode 100644 docs/fusa/reqs/market-reqs/reqs.rst
 create mode 100644 docs/fusa/reqs/product-reqs/arm64/reqs.rst

diff --git a/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
new file mode 100644
index 0000000000..bdd4fbf696
--- /dev/null
+++ b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
@@ -0,0 +1,139 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+Generic Timer
+=============
+
+The following are the requirements related to ARM Generic Timer [1] interface
+exposed by Xen to Arm64 domains.
+
+Probe the Generic Timer device tree node from a domain
+------------------------------------------------------
+
+`XenSwdgn~arm64_generic_timer_probe_dt~1`
+
+Description:
+Xen shall generate a device tree node for the Generic Timer (in accordance to
+ARM architected timer device tree binding [2]).
+
+Rationale:
+
+Comments:
+Domains shall probe the Generic Timer device tree node.
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Read system counter frequency
+-----------------------------
+
+`XenSwdgn~arm64_generic_timer_read_freq~1`
+
+Description:
+Xen shall expose the frequency of the system counter to the domains.
+
+Rationale:
+
+Comments:
+Domains shall read it via CNTFRQ_EL0 register or "clock-frequency" device tree
+property.
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Access CNTKCTL_EL1 system register from a domain
+------------------------------------------------
+
+`XenSwdgn~arm64_generic_timer_access_cntkctlel1~1`
+
+Description:
+Xen shall expose counter-timer kernel control register to the domains.
+
+Rationale:
+
+Comments:
+Domains shall access the counter-timer kernel control register to allow
+controlling the access to the timer from userspace (EL0).
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Access virtual timer from a domain
+----------------------------------
+
+`XenSwdgn~arm64_generic_timer_access_virtual_timer~1`
+
+Description:
+Xen shall expose the virtual timer registers to the domains.
+
+Rationale:
+
+Comments:
+Domains shall access and make use of the virtual timer by accessing the
+following system registers:
+CNTVCT_EL0,
+CNTV_CTL_EL0,
+CNTV_CVAL_EL0,
+CNTV_TVAL_EL0.
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Access physical timer from a domain
+-----------------------------------
+
+`XenSwdgn~arm64_generic_timer_access_physical_timer~1`
+
+Description:
+Xen shall expose physical timer registers to the domains.
+
+Rationale:
+
+Comments:
+Domains shall access and make use of the physical timer by accessing the
+following system registers:
+CNTPCT_EL0,
+CNTP_CTL_EL0,
+CNTP_CVAL_EL0,
+CNTP_TVAL_EL0.
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Trigger the virtual timer interrupt from a domain
+-------------------------------------------------
+
+`XenSwdgn~arm64_generic_timer_trigger_virtual_interrupt~1`
+
+Description:
+Xen shall enable the domains to program the virtual timer to generate the
+interrupt. 
+
+Rationale:
+
+Comments:
+Domains shall program the virtual timer to generate the interrupt when the
+asserted condition is met.
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Trigger the physical timer interrupt from a domain
+--------------------------------------------------
+
+`XenSwdgn~arm64_generic_timer_trigger_physical_interrupt~1`
+
+Description:
+Xen shall enable the domains to program the physical timer to generate the
+interrupt
+
+Rationale:
+
+Comments:
+Domains shall program the physical timer to generate the interrupt when the
+asserted condition is met.
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+[1] Arm Architecture Reference Manual for A-profile architecture, Chapter 11
+[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/timer/arm,arch_timer.yaml
diff --git a/docs/fusa/reqs/index.rst b/docs/fusa/reqs/index.rst
index 78c02b1d9b..183f183b1f 100644
--- a/docs/fusa/reqs/index.rst
+++ b/docs/fusa/reqs/index.rst
@@ -7,3 +7,6 @@ Requirements documentation
    :maxdepth: 2
 
    intro
+   market-reqs
+   product-reqs
+   design-reqs/arm64
diff --git a/docs/fusa/reqs/intro.rst b/docs/fusa/reqs/intro.rst
index d67b18dd9f..245a219ff2 100644
--- a/docs/fusa/reqs/intro.rst
+++ b/docs/fusa/reqs/intro.rst
@@ -55,7 +55,8 @@ Title of the requirement
   be 'XenMkt', 'XenProd' or 'XenSwdgn' to denote market, product or design
   requirement.
   name - This denotes name of the requirement. In case of architecture specific
-  requirements, this starts with the architecture type (ie x86_64, arm64).
+  requirements, this starts with the architecture type (eg x86_64, arm64)
+  followed by component name (eg generic_timer) and action (eg read_xxx).
   revision number - This gets incremented each time the requirement is modified.
 
 
diff --git a/docs/fusa/reqs/market-reqs/reqs.rst b/docs/fusa/reqs/market-reqs/reqs.rst
new file mode 100644
index 0000000000..9c98c84a9a
--- /dev/null
+++ b/docs/fusa/reqs/market-reqs/reqs.rst
@@ -0,0 +1,34 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+Functional Requirements
+=======================
+
+Run Arm64 VMs
+-------------
+
+`XenMkt~run_arm64_vms~1`
+
+Description:
+Xen shall run Arm64 VMs.
+
+Rationale:
+
+Comments:
+
+Needs:
+ - XenProd
+
+Provide timer to the VMs
+------------------------
+
+`XenMkt~provide_timer_vms~1`
+
+Description:
+Xen shall provide a timer to a VM.
+
+Rationale:
+
+Comments:
+
+Needs:
+ - XenProd
diff --git a/docs/fusa/reqs/product-reqs/arm64/reqs.rst b/docs/fusa/reqs/product-reqs/arm64/reqs.rst
new file mode 100644
index 0000000000..9b579cc606
--- /dev/null
+++ b/docs/fusa/reqs/product-reqs/arm64/reqs.rst
@@ -0,0 +1,24 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+Domain Creation And Runtime
+===========================
+
+Emulated Timer
+--------------
+
+`XenProd~emulated_timer~1`
+
+Description:
+Xen shall emulate Arm Generic Timer timer on behalf of domains.
+
+Rationale:
+
+Comments:
+Domains shall use it for scheduling and other needs.
+
+Covers:
+ - `XenMkt~run_arm64_vms~1`
+ - `XenMkt~provide_timer_vms~1`
+
+Needs:
+ - XenSwdgn
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 11:28:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 11:28:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780298.1189918 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgN1f-00015P-9Z; Tue, 20 Aug 2024 11:27:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780298.1189918; Tue, 20 Aug 2024 11:27:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgN1f-00015I-5r; Tue, 20 Aug 2024 11:27:47 +0000
Received: by outflank-mailman (input) for mailman id 780298;
 Tue, 20 Aug 2024 11:27:45 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=WGdy=PT=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sgN1d-00015C-P0
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 11:27:45 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on2062d.outbound.protection.outlook.com
 [2a01:111:f403:2417::62d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 36cd74f4-5ee7-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 13:27:43 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by DS7PR12MB5717.namprd12.prod.outlook.com (2603:10b6:8:70::19) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug
 2024 11:27:39 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7875.023; Tue, 20 Aug 2024
 11:27:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 36cd74f4-5ee7-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=p5SHxIt8IZmlab7/wUJtyFoSHjRDBHNaiQy/BO5e6ksdubTd0Yc6pB+JZgW3NzHdbfZ24QvnsDD16rZz5dSeLOHTVzgwmIoOHbxXiQOcdrXAD4+9c2uq/d5bzmJ3mvJXBFLRwxOCORLP3upt+1c9d4pAzg8WYz0ePY4iQopJ14DqkzEpbZ0U6uHYXctI0cy4qJ4PIjYtWvi6j1k/CPi/dStQTszswSIX4T084RG7GpDuIXOAhxUs5s8Nz3iZFk5MrJ7s0x7yXf1sVot5ug0UhQq9LEx4pNH4Qbb3b9OSRuxOHeRYDYwBtUzuU0kzyJDTsUG88MQ6uHLvXkaMsa71hA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Kz+A9DWD3gLs/DhiyLJv/sKBnxgZtchLnyKe4BqpbpE=;
 b=XaQIBMX8s6vnPT1Zz6nvDZHfGUcTl1TMVnizHuYjbWTPfCs/64Y/4e2TEoLj0ZfzoBkVJSlIk9TwS8CM1NWRYZxu91DtjKdhCGHmcDRrR3AdHRs3KYQZ1qHQVW3N5nNwRRZh5v3ncqCTH/yMIko7me4w4uP8YGXarZQsPB1Wk01aPWM74eyIiO5W59YpStq4n0t3S0SZgaeag3MwQnbCQRAKvJwo8F+36bLrHkD3XSAXmmUWHv2gUgkieQz035KQJ5T6wmG9HlAqroWJvP/VgcpwROdahtNSy3Zo4s3T9xl33CVl06OFwoIMBhMNSrPdy+CSm6ZizeF2SkRJyldT0A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Kz+A9DWD3gLs/DhiyLJv/sKBnxgZtchLnyKe4BqpbpE=;
 b=SjtZ8cE4p4h9YPFrHRR3kpP2NX8kDrDshM+zKZae5uOUL3tO5CDldE+Z4LyeJfqlI+bfmEC2K0xS+gMufzOdb2DMWXPB9qMVpoY3mQzttLAuqlesExoa1yhGHwoTWpiMuZwZ9WhyAhK91NWVA0U0kw7K548dYEZrWQoCqMx6c28=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <c7fdf37c-d9af-449f-b02a-b8653e21f0a1@amd.com>
Date: Tue, 20 Aug 2024 12:27:33 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 1/4] xen: arm: Add a new helper update_boot_mapping()
To: Michal Orzel <michal.orzel@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, Volodymyr_Babchuk@epam.com, julien@xen.org,
 jbeulich@suse.com
Cc: xen-devel@lists.xenproject.org
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-2-ayan.kumar.halder@amd.com>
 <d1144ab4-a342-452b-bd03-a67409657fa7@amd.com>
Content-Language: en-GB
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <d1144ab4-a342-452b-bd03-a67409657fa7@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: DU2PR04CA0323.eurprd04.prod.outlook.com
 (2603:10a6:10:2b5::28) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|DS7PR12MB5717:EE_
X-MS-Office365-Filtering-Correlation-Id: 3c67767b-b035-44f2-1b64-08dcc10b1941
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?ZGlhMHkwYkN5UVBGNDRrUXRiR283NmxNOFZhWFFubmxPQUlRNjdQUUhtZlZs?=
 =?utf-8?B?TjhaSWtsUmlBU0dISG0zSXZmcFlYNml3N0pNNVdWUHc0RGo0Z0dJRGdDNGZj?=
 =?utf-8?B?aU5pU1dvVHZLR0lxeGVzS2YzVnlIVzJIb1k1eU5ZK2ROdjFXMzBZT0EzcVB0?=
 =?utf-8?B?T3ZvTCtqeVNUcjRML3VpUENsYkpWUmNlU3VLekpxcUlDMEs0U2phMGV3TnhT?=
 =?utf-8?B?RGd0QjRZNXFTSFFXeEFKUm15RjRhVVNydG1TZnN4QlorTXdvQ3VtLzVjZG9n?=
 =?utf-8?B?WWFTMjE4VS8zZjFxdTZsVEpiaUdNUDExVG5HbEdqNnRaUnhCdW01emhtSWlO?=
 =?utf-8?B?N1Fid2N0NFlnelcrS2hUUmQ4NEdFWmhGdWZlR3RML1VrcUhKRlE3RWgwcjBT?=
 =?utf-8?B?U1hPaDhtUHpZZ1V5d0dhWVhrUEorV0F2VnBxN2doZG5WNjBMNkNFODIrZGtT?=
 =?utf-8?B?dk1Dc291TEhZd3JNZUUwcS9uWHZCcjMyOVZ4Um9RTG5wdFZneGdQK1UrQjdG?=
 =?utf-8?B?bWJ3ZWNvZGdQNHhMbnhKSVRqWElaaXdXMWZFbXJ4Qi9BdDJZQ3oxY1graFps?=
 =?utf-8?B?ZVUwQzJiOHNaYXk4TzhDcmRlUDg2M3FmWHJNSTRnZFZtV0svSnY5aGNYMmdj?=
 =?utf-8?B?M01wK2Q3aVl4RDRaazhNTWtoeEpGVytmenBUbFhHSlZYUmo3N2Z2OExnT3Ru?=
 =?utf-8?B?WC9XUEdVV09KOU15SmNITEFKM0VnOStoSm9pM0U5RzhkcXJOQUxhbHpHM29B?=
 =?utf-8?B?WWt3TUY1clg2RXlWNUdJTk81VGtYY1p1bmo4bjZLcnBCazNUNGF6c3hhaitY?=
 =?utf-8?B?UFR5OEFWTWJ1Mk1KaVBJcnlML2ZiVTlMTjZ0bmRXQ2ZMWlpjdDZBRmdrRito?=
 =?utf-8?B?OFc0MnJuYStrbldEaFdHZ2NndWJHeHJIemdTclptRFRPMlBURjRSNGFxTDMv?=
 =?utf-8?B?MXRBR0hReElGQXVwbnBlMGVjcDNBVnJUVlJDMy9YbHg4WXlIQVBZdmYvbW5w?=
 =?utf-8?B?QUtydkJqNHJTKzBsbitwRjBoZHFTK0xNU2tNcDlaaFMzYVFPbVJ0OFFvS1Q2?=
 =?utf-8?B?bFB2aVFJcXg2aXRRanJSa1h0blZQTE5NelN2aUY0T2hSOExJeFFzMG9ENDFI?=
 =?utf-8?B?OXdUMUVQUXlGclZETDMvdmZyenNFdVVkekVaazhaMEwzeGZueWhsbXcrdm5i?=
 =?utf-8?B?M2tiOGdWU25HR0daT3FBOXM4bUswRHUrTStYYmVpMEo0UEhqeXlNTWpJYkF4?=
 =?utf-8?B?Si9xYnNNNEYwL1YzcWE3azdHOWx1aHVtM3Y5Qk52QVBDUi9qZE9JSEJmY0J6?=
 =?utf-8?B?UFNVVi85eDBid1ZKb3VJdVdTKy9mMm1hcjRmYkVYKzhDTU1VaFhjTk9ZaDVP?=
 =?utf-8?B?ZHNZa28zQmtmU0QzNUtiS1dHamVDTkljekEwejdNckVMbHVLcTBoQ1RWdXlQ?=
 =?utf-8?B?OENKSmx1VW1ESlZDdkhZLzBNenN6VmVDZzZLWlJzQ0FNU3V3ZHl1UGxWNnA5?=
 =?utf-8?B?QVF3R0phaUJ4T1JqNHhwaDVkam5EeWdzb2ZNZ3VYQUlpTFA0QVJCTllDdFdS?=
 =?utf-8?B?SGhXNGdZdXc4cVBjY0tmZGhvSmJIc2VqVmFqVHoyV0RmZ0M0V05UQk1ZaUdz?=
 =?utf-8?B?anhQdGZsN1lwcWNqYUt6WjdKNWd5WXBJenlvWmxQWW1UclRyTFNtNU93Y0FQ?=
 =?utf-8?B?RUNudTNyeXdHMjNuL2w0TVpkMWFGYXU0OVpDcnViMko1cWI2Y0FER0NGU0tx?=
 =?utf-8?B?cTh5OXl4SURyY0ZGdmFYU0dNUmhYWEFLVTAwbXBoaHdzdE15N2RwNjFXQUEv?=
 =?utf-8?B?K0JjZ1J3OHF6YkhkaE9rUT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?cStlY2N4eXhUYnNIR3g1V3duVjM1RlBFeFdWK1NEeU03SlJsNDIzUEliTlNX?=
 =?utf-8?B?MEIwaGx0OEQ0WWZjYzkzQnY2TCtrOEhIY1g0ckpnUzdoLzladWoxLy9MR3Zz?=
 =?utf-8?B?Qm5JdUNWbjVBSEg1NHFjWWpNZEZPaU0ydWF4K0EyNW9qSE0zcXJ2WWFsU3pI?=
 =?utf-8?B?MWZZUElEU1dUQWpMb21hVi96Z291N3BwS0RwcHlVNm0reTVmTlM5ZDZicU5F?=
 =?utf-8?B?a0NrRGk0eXVZcndRa2p1aUNwbks3YjIyN1RMZWpLVHM3UlN4MCs5ZFFNcFFW?=
 =?utf-8?B?NUFYeDF6VGJJR2NaU3dodnBDTXRZWnJoMTMvRlhtY3hzRUg1ZFdQQTBQNDFP?=
 =?utf-8?B?ZVFpZnFQdWlZZ0ZMTDdFbzZkYy9XemQ2L3lTOWxTVXplK04wMUp1ajd3OW5W?=
 =?utf-8?B?S1cwTG1QR0p2azUrSEwycDJyUzNtTXJudThlUWxJc25aM2R4VkczM1FXZVVN?=
 =?utf-8?B?TXNHVzBUanp6OFBtNTV1SFVLVS9qemJvL0JwSWNlS1ZxcitSTnV1eXFBWDQ3?=
 =?utf-8?B?MEJxdkx1RGwrbm9VNExoY1VKNWh0Wk81VjNLa3R4ekpEKy83NnRYSmREV1VH?=
 =?utf-8?B?MjJIcmEzMUJFR1hWYXJhRFZRbTJOZXBBa3oxVEx4QXZGbE03K2VCdE1GQUJH?=
 =?utf-8?B?aUJCdjZHNlF5WTU4R0pQSmV1NzIxaVRzWnlneHRicUpXRGRINy9OeE1sUlBW?=
 =?utf-8?B?VnJXSW94OW5kOHdweVppWEZXc1h4YWxWTHEwaER5Wit1YTBrbGg3S0pydnUz?=
 =?utf-8?B?b1dpWEJPODNxVVJKQWtwNGRXdkZaVnA0T2RaV2Iva2ZRd3NnSGxyVE5sei9w?=
 =?utf-8?B?aStCU2VjdmhieHkybTdUaHk5cHZxUDBlU0NSNHhjWGRES0RDdHNCNVJzSmIx?=
 =?utf-8?B?RFFVSnd1MndhVmdoWUR5c2ZncVIxR05LWTdFbzI5ejZJK2VpazI4YytOYldG?=
 =?utf-8?B?VDNGRW42NXovSkdaU005MzFWcnQzdlBDM0RMbWVwRHBHMUxVVUtCZjMvL1BN?=
 =?utf-8?B?YkRJd0tzUzJ0ZGEwbWdXRXg5L0NNVCtoSEZxWFhqS09VRTdHNC9xQmNrcjA1?=
 =?utf-8?B?QVlQM0dUcFdOOTBYNWR1dFFVY2VHUktRZ3N5ZXBvd1ErNVNvTzNZQzZRQ0N0?=
 =?utf-8?B?WENWcm4zN0NLTkhobUdDcVpzK1Q0UkJzQ1ZoNi9veFlkWHI5djZzbG9IYkRm?=
 =?utf-8?B?Y1RYMDdYLzVnMWtadjM2bWR3U2w3UU11aUZQSE9SdDRWamsxV1poQW95dm1n?=
 =?utf-8?B?aDBOTGk4SDYwNm5sWWNQcko3NFZjb2lXVXVXODBlbGtZbVBYYWFqUTZvR1da?=
 =?utf-8?B?Yys0dzJKWldCajVVRnNXeXltczhvaGlJOFEvd2lJZEpjemUxd2N1cXRObkRa?=
 =?utf-8?B?R1BiZUpBS2Z5RzNJclUrOWxkRElkRnlIM0oxdnJ6ZTc4SDNEN1dldG9LNWpN?=
 =?utf-8?B?ZWp2eGIwbDBTS3BacnFWeUZXS3U2L0VWZEIxdVRrUmRPMGsrQUxIM0xOZ3JQ?=
 =?utf-8?B?OXVodktscmlUMldjM1lZaElUWFVsSVRpTlp4SHdxSjlSY0hjbTRkZ1BCMWtN?=
 =?utf-8?B?TkRtcmUvZlNCNEp1VDJKa0NRb3EyT2UzNXl6d0UwM0tqU011cmhsejFqYWM5?=
 =?utf-8?B?Q1NrMkVLMFJnM2NRODlTaktQU2d3RVhYSGFsZ0xpNkRaR1h6bFhtR1BvNFBN?=
 =?utf-8?B?MVNOYnZYOXpXck9HR2QzZGE5MTEvd0xTYUNsV0pqSlk1cTVhTXZheEJTem9D?=
 =?utf-8?B?RGg3cEdZYmFqdmhnWGxnRHdmaDE2ZlpzQldDeTFCaWlqTUFxRi9UdkJ5cDND?=
 =?utf-8?B?cnF2aWU2bEthYlBhTDg4MENGc2N5Z1Q1K084azZWenVVZHM1WnppQlFjcWdz?=
 =?utf-8?B?aXpWcE1uSUNnZytqSkZKSklXbHFpTXdGbEtad0FQVTFNNDhTVUdqUlhmV3dp?=
 =?utf-8?B?RGw4bCtkNk9iVXBWMFVqWER3YVNneDZwSWxBNWV6YTliUkdLeHlUNy8zMHpK?=
 =?utf-8?B?bnZLUHVWMmJEWXBYclgxeTEvendrUjl5SVRlSzloQmJQbU1pbnRlZGRiZ2hT?=
 =?utf-8?B?M0NaRHFEL2c0WWdCUzdhMkxDV09ueUlxT0VOUzJSeUdEcWVvQURuRng5ajVD?=
 =?utf-8?Q?amUM2CeCmJMDbiSykLkylY8jg?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3c67767b-b035-44f2-1b64-08dcc10b1941
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 11:27:39.4661
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: c5XJeLoguD5MsE1EwZ8Ig9Wb/5FAhi/nqnRkVfDDoDWPoTI3kaFusX0di+AkLMtnXthweogecRDKdamm8nRpyw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5717


On 14/08/2024 13:50, Michal Orzel wrote:
> Hi Ayan,
Hi Michal,
>
> On 13/08/2024 19:13, Ayan Kumar Halder wrote:
>> update_boot_mapping() invokes update_identity_mapping() for the MMU specific
>> code.
>> Later when the MPU code is added, update_boot_mapping() would invoke the
>> equivalent.
>>
>> The common code now invokes update_boot_mapping() instead of
>> update_identity_mapping(). So, that there is clear abstraction between the
>> common and MMU/MPU specific logic.
>>
>> This is in continuation to commit
>> f661a20aa880: "Extract MMU-specific MM code".
>>
>> update_identity_mapping() is now marked as static as it is called within
>> xen/arch/arm/arm64/mmu/mm.c only. Also, updated the prototype to
>> update_boot_mapping() which is now invoked from other files.
>>
>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>> ---
>> Changes from :-
>>
>> v1 - 1. Introduced update_boot_mapping() which invokes
>> update_identity_mapping() in MMU specific code.
>>
>> v2 - 1. Make update_identity_mapping() static and update the prototype.
>>
>>   xen/arch/arm/arm64/mmu/mm.c         | 7 ++++++-
>>   xen/arch/arm/arm64/smpboot.c        | 6 +++---
>>   xen/arch/arm/include/asm/arm64/mm.h | 2 +-
>>   3 files changed, 10 insertions(+), 5 deletions(-)
>>
>> diff --git a/xen/arch/arm/arm64/mmu/mm.c b/xen/arch/arm/arm64/mmu/mm.c
>> index 293acb67e0..1afbbeda5a 100644
>> --- a/xen/arch/arm/arm64/mmu/mm.c
>> +++ b/xen/arch/arm/arm64/mmu/mm.c
>> @@ -111,7 +111,7 @@ void __init arch_setup_page_tables(void)
>>       prepare_runtime_identity_mapping();
>>   }
>>   
>> -void update_identity_mapping(bool enable)
>> +static void update_identity_mapping(bool enable)
>>   {
>>       paddr_t id_addr = virt_to_maddr(_start);
>>       int rc;
>> @@ -125,6 +125,11 @@ void update_identity_mapping(bool enable)
>>       BUG_ON(rc);
>>   }
>>   
>> +void update_boot_mapping(bool enable)
>> +{
>> +    update_identity_mapping(enable);
>> +}
>> +
>>   extern void switch_ttbr_id(uint64_t ttbr);
>>   
>>   typedef void (switch_ttbr_fn)(uint64_t ttbr);
>> diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
>> index a225fae64d..789f352ab6 100644
>> --- a/xen/arch/arm/arm64/smpboot.c
>> +++ b/xen/arch/arm/arm64/smpboot.c
>> @@ -112,18 +112,18 @@ int arch_cpu_up(int cpu)
>>       if ( !smp_enable_ops[cpu].prepare_cpu )
>>           return -ENODEV;
>>   
>> -    update_identity_mapping(true);
>> +    update_boot_mapping(true);
>>   
>>       rc = smp_enable_ops[cpu].prepare_cpu(cpu);
>>       if ( rc )
>> -        update_identity_mapping(false);
>> +        update_boot_mapping(false);
>>   
>>       return rc;
>>   }
>>   
>>   void arch_cpu_up_finish(void)
>>   {
>> -    update_identity_mapping(false);
>> +    update_boot_mapping(false);
>>   }
>>   
>>   /*
>> diff --git a/xen/arch/arm/include/asm/arm64/mm.h b/xen/arch/arm/include/asm/arm64/mm.h
>> index e0bd23a6ed..ac8d1f5c78 100644
>> --- a/xen/arch/arm/include/asm/arm64/mm.h
>> +++ b/xen/arch/arm/include/asm/arm64/mm.h
>> @@ -21,7 +21,7 @@ void arch_setup_page_tables(void);
>>    * Note that nested call (e.g. enable=true, enable=true) is not
>>    * supported.
>>    */
>> -void update_identity_mapping(bool enable);
>> +void update_boot_mapping(bool enable);
> The whole point of adding a wrapper was to avoid ambiguity \wrt identity mapping and MPU.
> You changed the name of a function but left the comment which is pretty MMU specific. I think
> it should be moved to update_identity_mapping.

Yes, you are correct. I will move the comment before

static void update_identity_mapping(bool enable)

{...}

>
> Apart from that:
> Reviewed-by: Michal Orzel <michal.orzel@amd.com>

I will keep your R-b

- Ayan



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 11:48:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 11:48:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780310.1189928 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgNLg-0004lR-0X; Tue, 20 Aug 2024 11:48:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780310.1189928; Tue, 20 Aug 2024 11:48:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgNLf-0004lK-U9; Tue, 20 Aug 2024 11:48:27 +0000
Received: by outflank-mailman (input) for mailman id 780310;
 Tue, 20 Aug 2024 11:48:26 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=WGdy=PT=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sgNLe-0004lE-Pc
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 11:48:26 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on20624.outbound.protection.outlook.com
 [2a01:111:f403:2417::624])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1a1590de-5eea-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 13:48:24 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug
 2024 11:48:18 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7875.023; Tue, 20 Aug 2024
 11:48:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1a1590de-5eea-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Af8gA0DHolEHp/ighUYdHIIYgR/FW7T/sa4GgrI6GCNOBtgicSsvX7DhoV2L4NhkyRR+UOU2Vt/A20ftSw38eIQJoHbrzPLBHDGfHj1k7D05dEbzWJ7TaYrSJVLI1j20f1kkpzzzmLoFGXqilyJInMzJVJEWLlbsQwx1ldMqngeqrgtrXZn85Pl5wxVGEPCoBFusweEj9X2rlMVug6qdNjolG9Lgq6i4o6L3z25CIFV/L+sRQX5msVe5B7ZLKG0jOZaOAK0INQK0TD2+wgVoOR1Ef9JGWRgjPE/cv7MJnzh2uZGoKIVSy+BfTB3/TP/pEd2DoofzeuWjnmKatzbv9w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=xnjWSxH+BV3jaBfhBiZBgKzEHYqQ6mDPDgE62TaengM=;
 b=NrC67s1OnWDZ6HUcuX6zkktH9lIJ+vP0nRKLOlsKOEpFPtIDf0EH2koCNGefILWj82qsbwpHZFoQwIbpGEmPuJx3sLJV8Fa5UQr+lHZ34avOxtkxpkukSptBY1AP8leSt/WJxle8a5QEfqJAnjg6cC/QtrtJc5D+4jWURoFWA6hHzBK30HYEaIy6rNho+zpNd6LUbyofgpr76ECZZoZia8/F3jcx/ShYy9Hu2liT9ZuMaZBbT/W3icblD1XmroH0Oe1Il7cKwIgE8mzZT3BjddWtC+dltOdq6z1nnqv3BLNTv0Gp00Q3hLLYpxY6w7eMOWIGCJ6/i3yvtBZVFCzoRA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=xnjWSxH+BV3jaBfhBiZBgKzEHYqQ6mDPDgE62TaengM=;
 b=yD80Rp640dd38cKvIiNhzhPt9QIw+uUW1DoUnBnFN6++dK9lOiX/ZLwYrm7YTLVM6rXQvlfiSJl0h3omH9OF0472n8k35/OHxfA/JWMjYSZ4Awum8LoDUmvRHBc906WRfMzc4jgJwl+CTqBjPf4Cm/R0LyQX5R8XMc1bDReFiHo=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <e7882491-e916-43c6-ac61-12da83e9c086@amd.com>
Date: Tue, 20 Aug 2024 12:48:13 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
Content-Language: en-GB
To: Julien Grall <julien@xen.org>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com,
 Jan Beulich <jbeulich@suse.com>, Volodymyr_Babchuk@epam.com
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
 <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
 <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
 <dad27ab7-3cbd-4a8e-8200-adea52b26e55@suse.com>
 <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
 <9fd1801c-1460-44e5-b066-f6da1167543b@xen.org>
 <1a328f00-3b0d-4e9c-856c-97c3a80dfdef@amd.com>
 <febbaf82-5d9a-4bcd-8be9-93ac86b2c1bb@xen.org>
 <55a91ace-a76f-40b9-bdb2-49f816006612@xen.org>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <55a91ace-a76f-40b9-bdb2-49f816006612@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO2P265CA0112.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:c::28) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|DS0PR12MB7726:EE_
X-MS-Office365-Filtering-Correlation-Id: 675598e4-811f-40a2-32d6-08dcc10dfbf8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?K2xMNVVKTlVxSzcyYk5uSGlIb0VwNDBxN0tUVDdVTjdvdXZIRkV6WHIyNDhK?=
 =?utf-8?B?MUdERzVZcE8zWFVUZGVKdXQvMWtJL1Zob2VXYW51blU2WjYwNHN2TCtlRnNn?=
 =?utf-8?B?VkplbE1zVmlJZDJrN0pia0dDejFNbzBHVGYxeXFwckVRMlJRL2FuYitCaWlo?=
 =?utf-8?B?WjNzKzNmcGo5OE41MjZQaWVkcHNnelpxVDBSMG45Q3VIS0k2bVNXQ1llRWpY?=
 =?utf-8?B?L3p1eE0xWms4YlNBcFUzYzJyM09ISnVUbDFDL2VIU2E0SDZZUm1pRGd5Vlhl?=
 =?utf-8?B?SHdBejBHUnhBUG5xMlZIb3dsVVpkWC8xZHpGU0YzMGpPRGY5NDQzK0ZNbTBn?=
 =?utf-8?B?V1RHZkJTWW80VVdFNG81MTFZa0J6eitXNEtqZXdoRzdxcWhraVduQ2ZqVE5w?=
 =?utf-8?B?c0tyWkxQUWg3MG5kRUVoVWM1Z3hLSDNWUlZvN2ZwYUd2ZGV5c1I3OFhNK1FT?=
 =?utf-8?B?dXZ4NVZXdzFvRG5OMGZ5NzIxamxNNngxZnhkT3pjOFpsYjdSTkFsMDBnZ244?=
 =?utf-8?B?N3U5ajdPQU1tT2FYL2NPZWJhMEUwZlNZMDA5TzU4MVVncDNnZ05IbHlhMTFu?=
 =?utf-8?B?THROYi9mSHM0VWxCRS9Xd01IeEc4dFcrWTRGZzgwMzkvQUdyVHUzSUgwK1N6?=
 =?utf-8?B?UVlCTndYQnAvSW81emRWdGk0SGM4UVFIRG9NeXR1RWc0RjlBa3Y0eWJxRytR?=
 =?utf-8?B?OVFJMVduSDg3a3ZJMGptOTZQdjJGODdFN1J6SENXUGRNZ21lcS9sVktZUzlu?=
 =?utf-8?B?YlM4ckFxT1dFZjNXaFYxam4zOTQ4SG9ORHFRcVBPaWhaSU5YMXlLS2R0L1JY?=
 =?utf-8?B?RzQrSVVqcVpuTXRnTVZ0bmdmMzZyWVB6SUdESzFObXkzRys2K3FFOGJQRW13?=
 =?utf-8?B?dVVWd3NMTjlERTBuM3BKdWttSEFzWHhtUjZ4TVBHNnYrMW5IQnk2YmdUUnN6?=
 =?utf-8?B?V3YxdnFKaXMxaVBOVUpFbDlKWTlkVHlkTVl5TTVudldpdmtocDluKytENlow?=
 =?utf-8?B?OU9TVWl1YmhBZ1FSaXVSTTZ0dll6VGFTdWFlbU1qaUEwK1dNeTkwa1NkVkxa?=
 =?utf-8?B?TGNBam5Bd0JNNDQ2aFpRYU50QXI2RGVWRk8zSVBGUE9CVHdEOU9zMzlKOFRK?=
 =?utf-8?B?dEc3ZGNxUnlHVnhIcG9HREFGcmI3S2x5eWlKSVh3WXhlWk5pRms1M0FXb0sz?=
 =?utf-8?B?VExQdmdJRnZaUThGdEFLT0lvcGUxUnpLRWkwdS9kN2REL0lKT09ZSm10UkMr?=
 =?utf-8?B?SnZuakVoNkRQWHRCc01wR0hOVTkyNmZERFlyNmdlcnNJU1BlYnV3dXVFRllx?=
 =?utf-8?B?QTRLWjNDMmx4QmJxSmd3RFV4WTk0MnhneDhCYlQxTmZyVlVsUkJ4S3A1SHhF?=
 =?utf-8?B?enlqcFhlVmdCd1BQOURRZXp1b09rTXJkWEVPVkhpT1VBR3Robkw4Mm9EZGIr?=
 =?utf-8?B?QmtWaWdsQTJ3b0w4aUZTcGZIVXNvaVAxLzBpQTlmakx1OGZFU0pZSTBFL0NB?=
 =?utf-8?B?SVh2akMyamIxenBPcWtjWWd2a2pEQjVjekk1V0c3d2tuSHBkZWkyRENIVmpq?=
 =?utf-8?B?M05NNDRoMUJtRkE0UEJqQnZFb2J5MklPdTh2VGlCdG9KK0lLY1R4bmFtMyt5?=
 =?utf-8?B?dis1akhES3RpRytrenJFcTdxZklBaG53NHZHdjR0QVBPZEQ1TUpobHJHakJL?=
 =?utf-8?B?Zit2c3RGS0d2UmEzQnRSL3VpVWZVK1BibDFHUUM2RkhEQW1BL0xjZWNTSWMw?=
 =?utf-8?B?UUkxakd3NTYrNTdXc00wUmRSdEJxSTkvT0QwcEUydG5hWXRpWHhiOUgrS1VI?=
 =?utf-8?B?Nk5RSmNGZjIvbDRBZ2Zydz09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?TXdwNFZicU1hUUJvTUZjT0FtMHZQaUVsNE1qVTlqaWYrZG5UWXIxeGwrNkJv?=
 =?utf-8?B?SWVmV2Q4T1gzZUVJSHBiZFlMSTgyUzlhTllpWnF2dlQ3eno0ZUdCQ21yYnRq?=
 =?utf-8?B?b0dzZlpQNXlzYlMrSFZCdm5xU1o4eXM4d213QW5GZVF6Qmd0YVlnaW9BTnYr?=
 =?utf-8?B?UDFXUXliblhmT3ZwKzdVZWhZY1V1QzdrRWk4TlliWG95KzFOVUlpUVZid0Vy?=
 =?utf-8?B?Q2paZ01wSkVVRnZ6U2NScWJyMmtWN0Ewd3JaLzQzRHBoOW04T2I0TDdBTnR4?=
 =?utf-8?B?QjQ4c0ErdmdXdWwzaEhmUmFCWVl2ajhBVi91WFZFMGlnejdiTVllYm1JejBs?=
 =?utf-8?B?T3I2VTMxMmRuTjRCOURUVTZzUzVTejBoaGJ3SER0ODkzaStMTjRVdTlzaW9k?=
 =?utf-8?B?RnUvaUcyeFd6bXY2VUhma2phR3Zaa25sTzhaeHpLYW11RjBkd09ka1p2a1Fy?=
 =?utf-8?B?Szdid21JVGlPRWlVVEFMbTMxOUFtLzBXeTZwWUY3MTJpUms1Z1ZoblQ3Q01Z?=
 =?utf-8?B?WFV6Q1Nmc3diTW0zcy93SlI0RjNmd2hPNnZiVGN6bEx5RkxWMkFSdGFzeGVK?=
 =?utf-8?B?VVhHYi9tcHExVE9NMkRWUjdQTmZmb1VzaGZQTk9DdnBOY1VTYmtXcXBpUGcv?=
 =?utf-8?B?UUxUN2J1d2NQZXhzTHJXeXNsWnRTdUpPSDkvODRhdEROTlVxbld0dFpXUTMv?=
 =?utf-8?B?d2hvdHNnTk0wekg5WnRXUS9JclBwVTBTMFYweSt6eGduREdicDlvWkp1b3NY?=
 =?utf-8?B?bUp3NmprZFJCR3MvVjVYV0FUaFFJeWRRd0VhdVhYMWJRM25sQnNzdCtYQkZN?=
 =?utf-8?B?UGFINkN3NllMOXcxSGxqMXAzbVN1WmJaWWNzemFSOVdIMDJacG9tcXRIeWZr?=
 =?utf-8?B?Y1ZEUkpNOWxOQWF4dEk5QVlCL1BoK1JjdmlPTjg2eXZRUk1iaDVaSjhkbXEx?=
 =?utf-8?B?VVltbS9RQVpMaS8rT2pMM2ZtOE91VGwzOFdVa0tlYUVIOUZWUnJWM0lBUkgr?=
 =?utf-8?B?dFNQdHVoaEJOeWtJNENYSlJKSHRBbVZXY1hvZENsbHhRYjdnY25KbHI3c0xz?=
 =?utf-8?B?Q1dmVzRuODlkRGE1M05FUVk4eUZXWmIrMnBsd1FUcVBXbFV3RFl4ZmZoSEdI?=
 =?utf-8?B?a0pTMWRBVlFtNDRnRHVuSWpYUGZ2OVYyTWxISDdiUGRBdnBINzVFaWl0VXR0?=
 =?utf-8?B?bml2MlNublNiQkg0YVNCejlvZUNsTzRHU1pLUDlmb3dCRHh0c25nL2I1a3BY?=
 =?utf-8?B?YUk2TXBmMzZIOExHWlZxYW5ka0tJb2thUURwSGFWTkNNbW9UT0JkTktVRWw4?=
 =?utf-8?B?Nm5WZXorc0NxZUsrbmxlZERGR0V0dEFuaG5FbHE5NFM3U3QySnhtT0U5SGM2?=
 =?utf-8?B?NGFIZ2Q4aHZWcHdrVGpWcTR4c1I0LzRNVmpGenBENUp0YW1jRGNXdExTOThH?=
 =?utf-8?B?QnByOGh0ZElBTEsxaEdudnYxeG5mNHlPMUswZXhML3JqQzB6OS9pYXFjaHBD?=
 =?utf-8?B?K09BVzNNdnF6ZkxwZHVnOE1zbzMxTkx3b0VrL1krcEF4TU1COEJCOFBlcW5q?=
 =?utf-8?B?T215Q01sbEhSZ3NObmU0ZjVYM2JMZE52a21LcTFiWjE2YzUyV2JBUjFSR2p2?=
 =?utf-8?B?R05hdGxJUjBjMm5kN0tQdVU4b29Tc0UrUjRJUHVqcm9YQjg2alo4bUFnZ25o?=
 =?utf-8?B?anN2UEFtOWZxS3NPb0RNVWRFdVlsVDlwdzYvcjVobmhwNkJxOE9MMllJUTdq?=
 =?utf-8?B?d2xtbVhvM0YxbE5zc2ZuM0lJMWUraGFGcGYrU2ZRQkRocjduUGVDb2NXTmV1?=
 =?utf-8?B?OGxzK3dNOUt4N1RmbnFnZTZUTXhoR0VmUjhaNGlzdHAwT0E2U0Y3UWpFMis4?=
 =?utf-8?B?K2I1VHU3WVU5V2UzdFkweElnWGVxSkE4bHIrVzV5SzIrNEVmSnV2Q0NRaDcx?=
 =?utf-8?B?OXczWUFJOXJ4SXY4ZGZWSHNCRUpEODJ3R1lUMUF6YytmaHJzTkt4TVBONkFW?=
 =?utf-8?B?dGZOMVVsRTJNZmV6NHFOTkIzU09QeUlidmh0VDFYTkJMQkR5ekF5bnVFN0lD?=
 =?utf-8?B?cnh4eDErVk5VelhmaTByY2dYZmdLdkdqbEc2dzBTRWs0R0Nob2NhUlBZWkda?=
 =?utf-8?Q?u6Htv1V7J/f9Zkl617Hj836FF?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 675598e4-811f-40a2-32d6-08dcc10dfbf8
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 11:48:18.8164
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: PxQx3Grp52zht/cyt11wFnLdEmiCSzz/S1bWoQ8+tcJKnY3klFOnVTU2Uv0uTcplTVbzRBRbpUQTpqdx9MWibw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7726

Hi Julien/Jan,

On 19/08/2024 10:58, Julien Grall wrote:
>
>
> On 19/08/2024 10:55, Julien Grall wrote:
>> Hi Ayan,
>>
>> On 19/08/2024 10:45, Ayan Kumar Halder wrote:
>>> I am ok with this. This has the benefit that the change can be 
>>> contained within arch/arm if we do the following :-
>>>
>>> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
>>> index cb2c0a16b8..26f7406278 100644
>>> --- a/xen/arch/arm/setup.c
>>> +++ b/xen/arch/arm/setup.c
>>> @@ -329,7 +329,9 @@ void asmlinkage __init start_xen(unsigned long 
>>> boot_phys_offset,
>>>
>>>       setup_mm();
>>>
>>> +#ifdef CONFIG_MMU
>>>       vm_init();
>>> +#endif
>>>
>>>       /* Parse the ACPI tables for possible boot-time configuration */
>>>       acpi_boot_table_init();
>>>
>>> Are we ok with this ?
>>>
>>> The definition of vm_init() is in xen/include/xen/vmap.h. If I 
>>> enclose it using any CONFIG_XXX (like I have done in the current 
>>> patch), then I need to introduce it in common/Kconfig and define it 
>>> for x86 and PPC. I would prefer to contain the change within 
>>> arch/arm only if possible.
>>
>> Just to clarify, are you suggesting to just protect the call 
>> vm_init(). In other word, common/vmap.c would still be included in 
>> the final binary for the MPU?
>>
>> If yes, then I think it would be a bit odd... Someone could still 
>> call vmap() and this would not break until runtime.
>>
>> So I don't see how we could get away from modifying the common code.
>
> Readying my previous reply again. I think the confusion comes from:
>
> > But maybe ARCH_VMAP was an incorrect suggestion. It might be better 
> to gate with the !MMU (IIRC this would imply MPU).
>
> This was specifically referring to the branch predictor Kconfig. This 
> was not a suggestion to avoid introducing ARCH_VMAP.

Thanks for clarifying this. Yes, I misunderstood your previous comment. 
So I will do :-

1. HARDEN_BRANCH_PREDICTOR will depend on MMU.

2. ARCH_VMAP will be selected by PPC and RISCV. The reason is below.

3. xen/common/vmap.c will be conditionally compiled on ARCH_VMAP and the 
"#ifdef VMAP_VIRT_START .. endif" will be from removed within the file. 
As VMAP_VIRT_START is defined by RISCV and PPC, thus #2 is needed.

Julien, Jan :- Please let me know if you are ok with #3. This was in 
response to Michal's comment. While his suggestion makes sense, I am not 
sure if extending the changes to other architectures is the correct 
approach. Or do you prefer keeping xen/common/vmap.c unchanged.

Kind regards,

Ayan


>
> Cheers,
>


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 11:52:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 11:52:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780318.1189941 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgNQ0-0006Fv-IP; Tue, 20 Aug 2024 11:52:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780318.1189941; Tue, 20 Aug 2024 11:52:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgNQ0-0006Fo-Fg; Tue, 20 Aug 2024 11:52:56 +0000
Received: by outflank-mailman (input) for mailman id 780318;
 Tue, 20 Aug 2024 11:52:54 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=2WjV=PT=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sgNPy-0006Dx-Kr
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 11:52:54 +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 b9504ca1-5eea-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 13:52:50 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id 7583CA03AE;
 Tue, 20 Aug 2024 13:52:49 +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 UeHk8AajPhZO; Tue, 20 Aug 2024 13:52:49 +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 53747A0345;
 Tue, 20 Aug 2024 13:52:49 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sgNPs-00000000FYr-4Bk7; Tue, 20 Aug 2024 13:52:49 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b9504ca1-5eea-11ef-8776-851b0ebba9a2
Date: Tue, 20 Aug 2024 13:52:48 +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
Subject: Re: [PATCH v2 1/3] mini-os: mm: introduce generic page table walk
 function
Message-ID: <20240820115248.34qg23znyx5qoh37@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
References: <20240813134158.580-1-jgross@suse.com>
 <20240813134158.580-2-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20240813134158.580-2-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Juergen Gross, le mar. 13 août 2024 15:41:56 +0200, a ecrit:
> 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>

Reviewed-by: SAmuel Thibault <samuel.thibault@ens-lyon.org>

> ---
> V2:
> - add idx_from_va_lvl() helper (Samuel Thibault)
> ---
>  arch/x86/mm.c | 157 +++++++++++++++++++++++++++++++++++++-------------
>  1 file changed, 118 insertions(+), 39 deletions(-)
> 
> diff --git a/arch/x86/mm.c b/arch/x86/mm.c
> index 7ddf16e4..9849b985 100644
> --- a/arch/x86/mm.c
> +++ b/arch/x86/mm.c
> @@ -125,20 +125,30 @@ 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
> +};
> +
> +static inline unsigned int idx_from_va_lvl(unsigned long va, unsigned int lvl)
> +{
> +    return (va >> ptdata[lvl].shift) & (ptdata[lvl].entries - 1);
> +}
> +
>  /*
>   * 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 +180,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 +193,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 +202,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 +212,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 (it is either at
> + *          level 1, or invalid, or has its PSE bit set)
> + * 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] = idx_from_va_lvl(va, lvl);
> +
> +    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] = idx_from_va_lvl(va, lvl);
> +        }
> +    }
> +
> +    return 0;
> +}
> +
>  /*
>   * Build the initial pagetable.
>   */
> @@ -407,36 +493,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
> 

-- 
Samuel
<N> je déteste import
<N> parce que lorsque tu fais du python et que tu oublies le #!/bin/env python et que tu mets le fichier exécutable
<N> import est exécuté
 -+- #ens-mim - pourquoi mon script python change le curseur de la souris ?! -+-


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 11:54:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 11:54:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780329.1189956 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgNRg-0006sv-UY; Tue, 20 Aug 2024 11:54:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780329.1189956; Tue, 20 Aug 2024 11:54:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgNRg-0006so-RG; Tue, 20 Aug 2024 11:54:40 +0000
Received: by outflank-mailman (input) for mailman id 780329;
 Tue, 20 Aug 2024 11:54:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=2WjV=PT=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sgNRf-0006qh-UP
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 11:54:39 +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 f941f859-5eea-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 13:54:37 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id CB27CA03AF;
 Tue, 20 Aug 2024 13:54: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 jJVVtPd4cGEY; Tue, 20 Aug 2024 13:54:36 +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 B0A72A03AE;
 Tue, 20 Aug 2024 13:54:36 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sgNRc-00000000FaV-1YWr; Tue, 20 Aug 2024 13:54:36 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f941f859-5eea-11ef-a507-bb4a2ccca743
Date: Tue, 20 Aug 2024 13:54:36 +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
Subject: Re: [PATCH v2 2/3] mini-os: mm: switch need_pgt() to use walk_pt()
Message-ID: <20240820115436.hnrh5abr66rf6hhc@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
References: <20240813134158.580-1-jgross@suse.com>
 <20240813134158.580-3-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20240813134158.580-3-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Juergen Gross, le mar. 13 août 2024 15:41:57 +0200, a ecrit:
> Instead of open coding a page table walk, use walk_pt() in need_pgt().
> 
> Signed-off-by: Juergen Gross <jgross@suse.com>

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
> V2:
> - add comment and ASSERT() (Samuel Thibault)
> ---
>  arch/x86/mm.c | 72 +++++++++++++++++++++------------------------------
>  1 file changed, 30 insertions(+), 42 deletions(-)
> 
> diff --git a/arch/x86/mm.c b/arch/x86/mm.c
> index 9849b985..84a6d7f0 100644
> --- a/arch/x86/mm.c
> +++ b/arch/x86/mm.c
> @@ -523,57 +523,45 @@ 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);
> +        /*
> +         * The PTE is not addressing a page table (is_leaf is true). If we are
> +         * either at the lowest level or we have a valid large page, we don't
> +         * need to allocate a page table.
> +         */
> +        ASSERT(lvl == L1_FRAME || (*pte & _PAGE_PSE));
> +        *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 = idx_from_va_lvl(va, lvl);
> +    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
> 

-- 
Samuel
<N> je déteste import
<N> parce que lorsque tu fais du python et que tu oublies le #!/bin/env python et que tu mets le fichier exécutable
<N> import est exécuté
 -+- #ens-mim - pourquoi mon script python change le curseur de la souris ?! -+-


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 11:57:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 11:57:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780346.1189970 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgNUg-00088U-HR; Tue, 20 Aug 2024 11:57:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780346.1189970; Tue, 20 Aug 2024 11:57:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgNUg-00088K-D0; Tue, 20 Aug 2024 11:57:46 +0000
Received: by outflank-mailman (input) for mailman id 780346;
 Tue, 20 Aug 2024 11:57:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=2WjV=PT=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sgNUf-00087s-JG
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 11:57:45 +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 68b1128b-5eeb-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 13:57:44 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id BF681A0242;
 Tue, 20 Aug 2024 13:57:43 +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 tRsckY0ESDaT; Tue, 20 Aug 2024 13:57:43 +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 A71F4A023C;
 Tue, 20 Aug 2024 13:57:43 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sgNUd-00000000Fg8-1IZG; Tue, 20 Aug 2024 13:57:43 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 68b1128b-5eeb-11ef-a507-bb4a2ccca743
Date: Tue, 20 Aug 2024 13:57:43 +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
Subject: Re: [PATCH v2 3/3] mini-os: mm: convert set_readonly() to use
 walk_pt()
Message-ID: <20240820115743.teyoiov6qx63flna@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
References: <20240813134158.580-1-jgross@suse.com>
 <20240813134158.580-4-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <20240813134158.580-4-jgross@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Juergen Gross, le mar. 13 août 2024 15:41:58 +0200, a ecrit:
> +    if ( ro->count == L1_PAGETABLE_ENTRIES )
> +    {
> +         ro->count = 0;
> +         if ( HYPERVISOR_mmu_update(mmu_updates, ro->count, NULL,
> +                                    DOMID_SELF) < 0 )

You need to set ro->count *after* calling mmu_update.

Apart from this, 

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

Samuel


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 12:30:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 12:30:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780362.1189979 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgO0D-0005zK-3Q; Tue, 20 Aug 2024 12:30:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780362.1189979; Tue, 20 Aug 2024 12:30:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgO0D-0005zD-0l; Tue, 20 Aug 2024 12:30:21 +0000
Received: by outflank-mailman (input) for mailman id 780362;
 Tue, 20 Aug 2024 12:30:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0AKo=PT=bounce.vates.tech=bounce-md_30504962.66c48c57.v1-a8fcbd40c50a4322a4c37c8dee78cac8@srs-se1.protection.inumbo.net>)
 id 1sgO0B-0005z7-BZ
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 12:30:19 +0000
Received: from mail137-17.atl71.mandrillapp.com
 (mail137-17.atl71.mandrillapp.com [198.2.137.17])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f4818ce4-5eef-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 14:30:17 +0200 (CEST)
Received: from pmta07.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail137-17.atl71.mandrillapp.com (Mailchimp) with ESMTP id
 4Wp81g4DVyzPm0ST8
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 12:30:15 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 a8fcbd40c50a4322a4c37c8dee78cac8; Tue, 20 Aug 2024 12:30:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f4818ce4-5eef-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724157015; x=1724417515;
	bh=qR7Xy2ItWL4/6otJdOB50BG1by0/yUDqn9vMIS+HepQ=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=VLjOZ1JEoXDjfPaM1fpIu88QaWMpqLWF0aSPE1Hd/V5Nl1W7AHVKZpxg+UqdIG9kC
	 9VGcs5u5t1HM0FDAMBoZsCRsybf/7ocMIsD9bbLkxUNSff58VL+apndv6Z3H8bWkBT
	 zSIk+qKu5foyrIkHIeZ+WaFg70CXPr5U4CC1JyZUDOUuTAnf0eij6GGhE7Z2iQRj1h
	 SFxWigInw5YffGS1K/7O8VRCI6f4U7OBRfcB8mViuNu4HinYE9RCOz9a3yr1N6bwu4
	 ovYSL3Wn33SHerIqOnWYhlmYMsaFr7as6dnwYgW9iYlVmKb6LHi66GzawvmS5qa1PO
	 lj+ZJROVw91+g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724157015; x=1724417515; i=anthony.perard@vates.tech;
	bh=qR7Xy2ItWL4/6otJdOB50BG1by0/yUDqn9vMIS+HepQ=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=IEbyXgHCb7g7q+qlYLJLF2rvp2GXLHB/nP3cbxTUodKCFgNmKw0IglGO6YCJmmpkA
	 w6R57x14L4NBXiERFvxmTCoT9RRY2IqcJ++F4X7CWZ1QAse8dUKF/dXp1GhXgahhHN
	 ap6Wv+uddFBDNzUiKMcYZZEy5duvehl/sM62CEyOvAf6Nk3BlnXMdQBNFIxD2oXohD
	 sWxzdgA784idCbB7N6Fk7mkE172PZlJCw1R1juu5aUYX6r9AZobTliJpvh5MNIK3Ad
	 H/BohsFtBe18esh64Jxe+hkZYIqc3dfCfIP+Pag+WtN/a5PQKVtul4zSGYZsjj+EpB
	 M1pGL6NZuyMIA==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH]=20automation:=20restore=20CR=20filtering?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724157014219
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org, Doug Goldstein <cardoe@cardoe.com>, Andrew Cooper <andrew.cooper3@citrix.com>
Message-Id: <ZsSMVaoJlR4mn7Ig@l14>
References: <alpine.DEB.2.22.394.2408161642220.298534@ubuntu-linux-20-04-desktop> <6d2fbe22-8866-4769-95d0-a5a8613a5936@amd.com> <ZsNl7S1JOYQgQx87@l14> <alpine.DEB.2.22.394.2408191819580.298534@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2408191819580.298534@ubuntu-linux-20-04-desktop>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.a8fcbd40c50a4322a4c37c8dee78cac8?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240820:md
Date: Tue, 20 Aug 2024 12:30:15 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Mon, Aug 19, 2024 at 06:56:47PM -0700, Stefano Stabellini wrote:
> On Mon, 19 Aug 2024, Anthony PERARD wrote:
> > On Mon, Aug 19, 2024 at 09:21:22AM +0200, Michal Orzel wrote:
> > > On 17/08/2024 01:46, Stefano Stabellini wrote:
> > > > diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> > > > index 0666f6363e..ed44aab0f0 100755
> > > > --- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
> > > > +++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> > > > @@ -65,4 +65,4 @@ export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x4000000
> > > >  export QEMU_LOG="smoke.serial"
> > > >  export PASSED="${passed}"
> > > > 
> > > > -./automation/scripts/qemu-key.exp
> > > > +./automation/scripts/qemu-key.exp | sed 's/\r//'
> > > 
> > > I compared 3 pipelines:
> > > 1) one before c36efb7fcea6 (https://gitlab.com/xen-project/hardware/xen/-/jobs/7566986885)
> > > 2) one after c36efb7fcea6 (https://gitlab.com/xen-project/hardware/xen/-/jobs/7603830706)
> > > 3) one with this fix (https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7603783403)
> > > 
> > > In 1), there is Xen log + Linux log in Gitlab web page
> > > In 2), there is no log at all
> > > In 3), there is only Xen log visible
> > 
> > It's nice that you can select uboot/Xen logs or Linux logs based on the
> > number of '\r' at the end of a line (output cat -A):
> >     U-Boot 2023.01+dfsg-2+deb12u1 (Apr 18 2024 - 22:00:21 +0000)^M^M$
> >     (XEN) [    0.013864] Xen version 4.20-unstable (root@) (gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924) debug=n Sat Aug 17 00:54:57 UTC 2024^M^M$
> >     [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd070]^M^M^M$
> > 
> > But to display to GitLab's job logs, we want: sed 's/\r\+$//'
> > 
> > Also, do you have to edit every single script to overcome a shortcoming
> > from the "expect" script? Can't you write a bit of Tcl and edit the line
> > in the script instead?
> 
> The sed route is not perfect but it works :-)
> 
> I did try using expect but the logs were mangled. I think I missed that
> there can be multilple \r. I managed to get close to the wanted behavior
> with the below, but the Xen logs are still missing and I don't know why. 
> 
> https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7617161552

Well, it just looks like the output is duplicated, if you look at the
raw output:
https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7617161552/raw

So I don't know if it's possible to edit the output before `expect`
prints it. It probably is, but not easy to do.

I did try to edit the command line to change QEMU's output:
    -eval spawn $env(QEMU_CMD)
    +spawn sh -c "$env(QEMU_CMD) | sed s/\\\\r\\\\+//"

But then many failure, probably because expect can't interact with qemu
anymore.

So I guess `sed` the output of `expect` will do. Maybe put that in a
script that also call the expect script? (To avoid duplication, and help
with maintainability of the whole thing.)

Cheers,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 12:51:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 12:51:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780372.1189990 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgOKX-0001Ao-Mq; Tue, 20 Aug 2024 12:51:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780372.1189990; Tue, 20 Aug 2024 12:51:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgOKX-0001Ah-K3; Tue, 20 Aug 2024 12:51:21 +0000
Received: by outflank-mailman (input) for mailman id 780372;
 Tue, 20 Aug 2024 12:51:20 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgOKW-0001Ab-64
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 12:51:20 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e42a393d-5ef2-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 14:51:17 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a8647056026so97608666b.0
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 05:51:18 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383935636sm757116366b.108.2024.08.20.05.51.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 05:51:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e42a393d-5ef2-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724158277; x=1724763077; 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=keNEB41MN/8ddQ5FnQk9UfRStxcvk1+CWRTkPzXpGPw=;
        b=f9qvXS1kjpkvyducRm+AQ9JUTCxDUTxyrV4xHAQMtoFc1yEZcq0l7kIahTWws0LGt4
         wc6LO0T9cHfp9SWdMHV9ID9ROHk9Dhp5YldhNHRqixyPKY8aAgEAL2fY/0r8Sjy4FDQc
         goU3Az4gP61PBcfr/JqMYEEeW9MNNE68NjjgbnO10x84wH45eIUbhgign7NO4HqP+KHs
         SuWPwB4/a2f3GSC7dXewiepSsTJywOb8mYQhiSce/YTFfT8AfRv0Og0vhcvM/9NTwDdv
         Wut+eBiRh3P81m27xfgD5jul23MFQ+WrAEzzF/KhoViS7Ph0a5HIR55Tk1QH5eMSpcH3
         LyKw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724158277; x=1724763077;
        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=keNEB41MN/8ddQ5FnQk9UfRStxcvk1+CWRTkPzXpGPw=;
        b=qQB6qHGsI2RH/Mh+cCmuAjkXHnL+EeEMAQdLTzBJKFFV/5aTQKnehEGyka4lDu3d1N
         /gj7GRrOFQVUoJzyY1RymKLMrh7J2AZQcmtj3ISjNMC16DKA4TpK07u8OtOQyvHIqa7x
         FzuKHEmMaq9x1tmeG254oionSpqPIuq/hAef0jJf+0AClgqRoozlxB8lU5IH3W9KmwXN
         G8qN/tgcFUZpszsnO09jAiJ3phXbs1Lr8wKkFnCl4m+oQmhgTEhjsPHq6zgPXXqycTLU
         R+uH1BCyx+wF2B9w7d0zxH0fDMop4UTqMWlP0JiGorqvn/cT0CxlKADoRUxAxeGsdnuK
         13Mg==
X-Gm-Message-State: AOJu0Yzg7eOuY8FG6uTufmNTpsspLwWYzTmNvT9g5h3RyO52CCk949Iv
	8H77izFQeodsQx/llHgIDCa6Y1U56dhqsTvDZnVY1EuvQECH7pOBR72NLylZkA==
X-Google-Smtp-Source: AGHT+IF18w9ET4OUAyuLQSPcqMx1ue2q4yFv1RTI49cDnqzaCv0xv2XotbOK1MHgTbWHmZOQZnL7ng==
X-Received: by 2002:a17:907:e66a:b0:a7d:d1a6:d943 with SMTP id a640c23a62f3a-a8392956005mr1030984266b.40.1724158277252;
        Tue, 20 Aug 2024 05:51:17 -0700 (PDT)
Message-ID: <5f4d628b-6268-4878-8d87-0174dad818c7@suse.com>
Date: Tue, 20 Aug 2024 14:51:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3 2/4] xen: make VMAP only support in MMU system
To: Ayan Kumar Halder <ayankuma@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: xen-devel@lists.xenproject.org, Penny Zheng <penny.zheng@arm.com>,
 Wei Chen <wei.chen@arm.com>, sstabellini@kernel.org,
 bertrand.marquis@arm.com, michal.orzel@amd.com, Volodymyr_Babchuk@epam.com,
 Julien Grall <julien@xen.org>
References: <20240813171356.46760-1-ayan.kumar.halder@amd.com>
 <20240813171356.46760-3-ayan.kumar.halder@amd.com>
 <6d333d94-80ad-485c-b024-a45a388b96a4@suse.com>
 <ef789757-8c03-4f97-9bfb-8ec2fd2f4ca2@amd.com>
 <dad27ab7-3cbd-4a8e-8200-adea52b26e55@suse.com>
 <597b358e-3b45-4fba-922d-31208b55d15a@amd.com>
 <9fd1801c-1460-44e5-b066-f6da1167543b@xen.org>
 <1a328f00-3b0d-4e9c-856c-97c3a80dfdef@amd.com>
 <febbaf82-5d9a-4bcd-8be9-93ac86b2c1bb@xen.org>
 <55a91ace-a76f-40b9-bdb2-49f816006612@xen.org>
 <e7882491-e916-43c6-ac61-12da83e9c086@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <e7882491-e916-43c6-ac61-12da83e9c086@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 20.08.2024 13:48, Ayan Kumar Halder wrote:
> So I will do :-
> 
> 1. HARDEN_BRANCH_PREDICTOR will depend on MMU.
> 
> 2. ARCH_VMAP will be selected by PPC and RISCV. The reason is below.
> 
> 3. xen/common/vmap.c will be conditionally compiled on ARCH_VMAP and the 
> "#ifdef VMAP_VIRT_START .. endif" will be from removed within the file. 
> As VMAP_VIRT_START is defined by RISCV and PPC, thus #2 is needed.
> 
> Julien, Jan :- Please let me know if you are ok with #3. This was in 
> response to Michal's comment. While his suggestion makes sense, I am not 
> sure if extending the changes to other architectures is the correct 
> approach. Or do you prefer keeping xen/common/vmap.c unchanged.

No, the VMAP_VIRT_START thing was, from all I recall, merely to cover
for the lack of a way to exclude building of the file from Makefile.
After all this pre-dates the introduction of kconfig in Xen.

And yes, suitably covering PPC and RISC-V is The Right Thing To Do (tm);
their maintainers can shout if they disagree.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 12:53:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 12:53:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780378.1190003 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgOMn-0001i1-5H; Tue, 20 Aug 2024 12:53:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780378.1190003; Tue, 20 Aug 2024 12:53:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgOMn-0001hq-1R; Tue, 20 Aug 2024 12:53:41 +0000
Received: by outflank-mailman (input) for mailman id 780378;
 Tue, 20 Aug 2024 12:53:40 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgOMm-0001hO-OB
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 12:53:40 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 37c12bdd-5ef3-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 14:53:37 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-5a10835487fso8302280a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 05:53:38 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383934564sm755321066b.126.2024.08.20.05.53.37
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 05:53:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 37c12bdd-5ef3-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724158418; x=1724763218; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=9tqL6KJwHijGWE8p+gVbOgEAibadQLjqxyFvRKxEk5k=;
        b=JrDK6mKzJopPEkYeyX07VvzJbwd+Neb8Q/ms1IsttyfYCU41ykvcNd1kncpzgj5Di0
         tA8Bb1Cr26U8/7n814J1wfFjQg40AjzZKQRt7iZW8Bxyo+JewZAitwFlvZMRMPUT89HA
         5qds5yn2YTByW0UZjZYSBQ+QnLxlRBzOggmRHBIoJzN5KzqBufDRECltCq9ISGeBxSmf
         znvb9su7/0EMzld35tpC3cCLljku5rRVSfyvKzipU+QBk2G0XiUsZiOLOdHbrLPDFPNK
         TpIGet4NBz1FYjVoeNkKEkkiychL5uV6syjw16/QIU1gDBBG03/8bgFn6g7x6zFppRGj
         1DmA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724158418; x=1724763218;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :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=9tqL6KJwHijGWE8p+gVbOgEAibadQLjqxyFvRKxEk5k=;
        b=FUnw4V2QcUuEyoxOFOOnHd1BNh3Yc1lHI+puRVwkXbCCaKMF49VseZ6+sW489sw8zR
         pa9CVyu6gn51GJ6p3kU/w+MzIY5/ylEPzM7k5gpJvHICzHgU/jYJ8RGdtoD+CR6ZFf/y
         33Uk66WtdYdZPqXkVTh/sdZfGhOeEo/mUNQPm1Vp2O/Tnx4rCuPovHO1xDp0wgoqCIHQ
         /jQGkuSU3KLBl8hBWZMZbTLJQHeaoGc2gcw3rM4dghTywhxh10n57LjkPLbl5IurlKUG
         aaHP2VXG6M8fbN4VbHEJSfxWQcTZH9TtqZcqB18NYSIspQX7ramtmaohoRok0b7v6qsw
         jU0g==
X-Forwarded-Encrypted: i=1; AJvYcCVOWpXaKASRtc1jhFUNaJ56QrA5wxmvuKvik9/ey5LwJ27w59IQ8GfXNJJg9U8y69sZfuc0ke9+NvY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwbzfxfYvTSEs+iGzwKjbVytHMHXfF/Y0mRNRMFeqolrJ1tvDge
	MWioQNz9HvsrUglPiZ2ZWekwak5ObfpvjSMTiUSIkx83gObNNFIVv47QfDQyaw==
X-Google-Smtp-Source: AGHT+IFi1wPUNJcNjE9Zsx5hzbitTRutX9cfgKBtyw1lubV9H01bHFGgxeV0uZMFu3JN84biB5iGvA==
X-Received: by 2002:a17:907:e212:b0:a77:c199:9d01 with SMTP id a640c23a62f3a-a839292deecmr1020809466b.22.1724158417647;
        Tue, 20 Aug 2024 05:53:37 -0700 (PDT)
Message-ID: <fa441335-bb76-462b-b64c-160cb1fa28ac@suse.com>
Date: Tue, 20 Aug 2024 14:53:36 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 3/3] mini-os: mm: convert set_readonly() to use
 walk_pt()
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
 Juergen Gross <jgross@suse.com>
References: <20240813134158.580-1-jgross@suse.com>
 <20240813134158.580-4-jgross@suse.com>
 <20240820115743.teyoiov6qx63flna@begin>
Content-Language: en-US
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+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: <20240820115743.teyoiov6qx63flna@begin>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 20.08.2024 13:57, Samuel Thibault wrote:
> Juergen Gross, le mar. 13 août 2024 15:41:58 +0200, a ecrit:
>> +    if ( ro->count == L1_PAGETABLE_ENTRIES )
>> +    {
>> +         ro->count = 0;
>> +         if ( HYPERVISOR_mmu_update(mmu_updates, ro->count, NULL,
>> +                                    DOMID_SELF) < 0 )
> 
> You need to set ro->count *after* calling mmu_update.

Happy to move the line while committing, so long as Jürgen agrees.

Jan

> Apart from this, 
> 
> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> 
> Samuel
> 



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 13:04:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 13:04:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780391.1190013 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgOX6-00040W-2A; Tue, 20 Aug 2024 13:04:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780391.1190013; Tue, 20 Aug 2024 13:04:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgOX5-00040P-Vn; Tue, 20 Aug 2024 13:04:19 +0000
Received: by outflank-mailman (input) for mailman id 780391;
 Tue, 20 Aug 2024 13:04:19 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgOX5-00040J-CC
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 13:04:19 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b4f3772b-5ef4-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 15:04:17 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a7aa086b077so570331766b.0
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 06:04:17 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838cf05dsm759233866b.53.2024.08.20.06.04.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 06:04:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b4f3772b-5ef4-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724159057; x=1724763857; 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=uhMhLWYWQVu/sP4fsE+nEyTVmqswCs8OSCI5tqcY4Xc=;
        b=Lp+bKs/zSEbVLaLvd4nw8CO8ZqOrx0VZZUidm41wKrQpERxzIJ0fvVShjYyZEcfAGA
         1PqRhGHIR0MqijcrcKHPl6pYuTi6y06sVJlpe8QVM72xT1ibZo45Oj0Dzhdra7/68yXl
         MxH7pkcFS/Qh/1iA/1X1VIVO0QS9Kn9w459TTuHGRglN2nrj9zZ7IQf60fjVkyGwbng/
         lwC3kqOziK+15zXqh/1Uj8iPmZG9nWW+Rq8mSjSI9id4Qj7MyFrxnNxu5aWGPDDVhi+x
         GwjwtwiTD5wIg8ftPbd78APqmS38ASYLrfW5wqlA2SBLu/gRk9aQZYjs+HS9r9u8YVtq
         +L6Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724159057; x=1724763857;
        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=uhMhLWYWQVu/sP4fsE+nEyTVmqswCs8OSCI5tqcY4Xc=;
        b=jPJair6yu36/EnLpzl95SbtWFtLFyseipBv2c0WDu1ZwZ05iSaFaE9DE22VwZc9A2H
         VThp+dmbOmt3Hiu7k+2h1CJJ65NwUBt+z4nwVRhlUK9rzgcRDO2GGfEyTAaAoDZ8F99P
         d3pHVJa7U8+o4UxoYf6WqdC3TM49pbOnTLW7ftQjnTYaoc8PBk65ocJe8lnpigolj3jm
         E4ZOCsRzKgsYD4zd7/iS1kDebtD8DiLh+6sqQrwV8SXl+jQUOTxSeDBqxAPy1cswGY6B
         c/ZbS/lWBA8UrJcGVh0U77v6gX4JN5ovzrkCcyDohLqHvA1r79BxCKdnL0y7uvW+r8zy
         444A==
X-Forwarded-Encrypted: i=1; AJvYcCWdO3EuT045VKim7W4SB7VHaPJFPyeR7Gh6VXQGrnn3gs3hJib2TwA02b3/MNGsgF6dVwPbJ/wUYCJJ3BMcApWDwQsajbPUXjKAlkNm/eI=
X-Gm-Message-State: AOJu0Yzl1K+9qHsObuWDmb5gjqevQMP30oR7+EnIhrjnaMiBYZZAAXAA
	/aWf8PFRvcj2tka0VO9Go2HCfxwmCBNv1ijEdFZhiY07ayK9l7tVMEV9vkHt0Q==
X-Google-Smtp-Source: AGHT+IHKDwiZezHMcEf9hq4xShckH19SbCjgu3b0VykYyCU3cJDmQAm83THF6b/TjcRsDT68A9pwDw==
X-Received: by 2002:a17:906:c103:b0:a77:e55a:9e87 with SMTP id a640c23a62f3a-a8647b0a2afmr124424866b.48.1724159056598;
        Tue, 20 Aug 2024 06:04:16 -0700 (PDT)
Message-ID: <80a934ea-9968-4609-aac9-4790c16af891@suse.com>
Date: Tue, 20 Aug 2024 15:04:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 4/5] x86: Compensate relocation in case of EFI
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20240814083428.3012-1-frediano.ziglio@cloud.com>
 <20240814083428.3012-5-frediano.ziglio@cloud.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: <20240814083428.3012-5-frediano.ziglio@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 14.08.2024 10:34, Frediano Ziglio wrote:
> If code is loaded by EFI the loader will relocate the image
> under 4GB. This causes offsets in x86 code generated by
> sym_offs(SYMBOL) to be relocated too (basically they won't be
> offsets from image base).

In turn meaning that ...

> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -380,7 +380,8 @@ x86_32_switch:
>          lgdt    gdt_boot_descr(%rip)
>  
>          /* Store Xen image load base address in place accessible for 32-bit code. */
> -        lea     __image_base__(%rip),%esi
> +        lea     __image_base__(%rip), %esi
> +        sub     $sym_offs(__image_base__), %esi

... the comment needs updating too then, as %esi won't necessarily hold
the load base address any longer (if I understand correctly what's going
on here).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 13:10:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 13:10:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780407.1190024 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgOdL-0006Br-NP; Tue, 20 Aug 2024 13:10:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780407.1190024; Tue, 20 Aug 2024 13:10:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgOdL-0006Bk-KR; Tue, 20 Aug 2024 13:10:47 +0000
Received: by outflank-mailman (input) for mailman id 780407;
 Tue, 20 Aug 2024 13:10:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=bKv/=PT=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sgOdK-0006AN-WF
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 13:10:47 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9ca803e9-5ef5-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 15:10:46 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-5befe420fc2so2629506a12.3
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 06:10:46 -0700 (PDT)
Received: from ?IPV6:2003:e5:8741:4a00:60e5:7bee:fc48:e85c?
 (p200300e587414a0060e57beefc48e85c.dip0.t-ipconnect.de.
 [2003:e5:8741:4a00:60e5:7bee:fc48:e85c])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83839342f6sm761653966b.137.2024.08.20.06.10.44
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 06:10:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9ca803e9-5ef5-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724159446; x=1724764246; darn=lists.xenproject.org;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=06TrBrNLciHi6+vfpuKN7ddrFMPcoea/z9MTlgnXLXw=;
        b=Nv5fbPqG44IVE9SnRK/6AobzKguPPPheWwMeVJOhyMF0uGUDcPRxWysCCjgIArmdSc
         X5izotDxXNigr335qHP0x7yoU0/O+ir6g4pCEa+tsUDG9xTY0uUtFl9JyvXdC+2iJOqK
         CumSiPOxbrozsdWImNgMSKZkUGOp3Pjtblq2Ein6FRwI6+iDgnJ/VZ7fu3Q8zKT3YaAm
         Yf7dsljyPl5y9mHKmtLEFdbNNQn5xp9EcUaqDvLr+Pt69I0ZatutGbQVM9EYJ3Qn+l4X
         yWZcw13heDEF+dbpSuwXccWmWtEGhGe84BJca/OHcC6pMOA7fZdeD36wWKd+ooUnY3k+
         04XQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724159446; x=1724764246;
        h=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=06TrBrNLciHi6+vfpuKN7ddrFMPcoea/z9MTlgnXLXw=;
        b=Wp5aRcbvL3AVQLu/l3WfEE4aCvleNkCC2KFbIvFok0U80n+lkQr0H4pUAx34KBpN0Y
         oOoN4qRBEuIirRm3l4FyeAilMvuU84tfggBXMYa0HIqvvpo7B79Dw09HdmhHGjD74KiM
         eUzm3eZsDf1ifKObuiq5wHPt/0WpHU7Ne84onVBeS/lPhFUfX/dwc9lo8TS3oAct0SJP
         Uek3YB4D5+PMDTi92mSoLtj+ydHkI2sUSMszlOW39Hf/kqqwWdy2OpTV1Jv6OeMiNeml
         wxiPsxJ8+89/rHuZAKp5R5fhT8FB4hU2tkPx4umcciE2A/4havBQu3B8XbxwuHqND/Nn
         9qGA==
X-Forwarded-Encrypted: i=1; AJvYcCUsTUj3RCDsiWJy4ewxvRMwL7TJKu/EPlypAczWrDrHAS9WL/NgNvLZyufjBIPDrF719gUKTg/Bub0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxOpeuEZlUgQsLIEZE4jw7RKe0oKPIYFT6yWCN/WybhTTIPBZWx
	4k5IZCZa51NQvO5/B3D4tcRF8edvlwv8oiqYBynQI/tENqXcxfVM4Xhe3IjDFSlya5S5m1VQsBA
	FqxI=
X-Google-Smtp-Source: AGHT+IEedr4iw1LWLs4QUWehBKVbDSElzBGPOw6gdDlbK/p6vMuAAkuG0Xa91bi2rWRjb4EK3VnvWg==
X-Received: by 2002:a17:907:97d5:b0:a6f:5150:b807 with SMTP id a640c23a62f3a-a8647a136e1mr134840466b.35.1724159445415;
        Tue, 20 Aug 2024 06:10:45 -0700 (PDT)
Message-ID: <79ab432d-2551-41c0-afd0-4223764ded1e@suse.com>
Date: Tue, 20 Aug 2024 15:10:43 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 3/3] mini-os: mm: convert set_readonly() to use
 walk_pt()
To: Jan Beulich <jbeulich@suse.com>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org
References: <20240813134158.580-1-jgross@suse.com>
 <20240813134158.580-4-jgross@suse.com>
 <20240820115743.teyoiov6qx63flna@begin>
 <fa441335-bb76-462b-b64c-160cb1fa28ac@suse.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <fa441335-bb76-462b-b64c-160cb1fa28ac@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------OQwIt5mfwX76T0mgkJFrSFDr"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------OQwIt5mfwX76T0mgkJFrSFDr
Content-Type: multipart/mixed; boundary="------------hBhs6O40hIWJOFZchOs0wO11";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org
Message-ID: <79ab432d-2551-41c0-afd0-4223764ded1e@suse.com>
Subject: Re: [PATCH v2 3/3] mini-os: mm: convert set_readonly() to use
 walk_pt()
References: <20240813134158.580-1-jgross@suse.com>
 <20240813134158.580-4-jgross@suse.com>
 <20240820115743.teyoiov6qx63flna@begin>
 <fa441335-bb76-462b-b64c-160cb1fa28ac@suse.com>
In-Reply-To: <fa441335-bb76-462b-b64c-160cb1fa28ac@suse.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJ3BBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AAIQkQoDSui/t3IH4WIQQ+pJkfkcoLMCa4X6CgNK6L+3cgfgn7AJ9DmMd0SMJE
 ePbc7/m22D2v04iu7ACffXTdZQhNl557tJuDXZSBxDmW/tLOwU0EWTecRBAIAIK5OMKMU5R2
 Lk2bbjgX7vyQuCFFyKf9rC/4itNwhYWFSlKzVj3WJBDsoi2KvPm7AI+XB6NIkNAkshL5C0kd
 pcNd5Xo0jRR5/WE/bT7LyrJ0OJWS/qUit5eNNvsO+SxGAk28KRa1ieVLeZi9D03NL0+HIAtZ
 tecfqwgl3Y72UpLUyt+r7LQhcI/XR5IUUaD4C/chB4Vq2QkDKO7Q8+2HJOrFIjiVli4lU+Sf
 OBp64m//Y1xys++Z4ODoKh7tkh5DxiO3QBHG7bHK0CSQsJ6XUvPVYubAuy1XfSDzSeSBl//C
 v78Fclb+gi9GWidSTG/4hsEzd1fY5XwCZG/XJJY9M/sAAwUH/09Ar9W2U1Qm+DwZeP2ii3Ou
 14Z9VlVVPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------hBhs6O40hIWJOFZchOs0wO11
Content-Type: multipart/mixed; boundary="------------OSoN7QDx5p5VoSJjpDAr9WS2"

--------------OSoN7QDx5p5VoSJjpDAr9WS2
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjAuMDguMjQgMTQ6NTMsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAyMC4wOC4yMDI0
IDEzOjU3LCBTYW11ZWwgVGhpYmF1bHQgd3JvdGU6DQo+PiBKdWVyZ2VuIEdyb3NzLCBsZSBt
YXIuIDEzIGFvw7t0IDIwMjQgMTU6NDE6NTggKzAyMDAsIGEgZWNyaXQ6DQo+Pj4gKyAgICBp
ZiAoIHJvLT5jb3VudCA9PSBMMV9QQUdFVEFCTEVfRU5UUklFUyApDQo+Pj4gKyAgICB7DQo+
Pj4gKyAgICAgICAgIHJvLT5jb3VudCA9IDA7DQo+Pj4gKyAgICAgICAgIGlmICggSFlQRVJW
SVNPUl9tbXVfdXBkYXRlKG1tdV91cGRhdGVzLCByby0+Y291bnQsIE5VTEwsDQo+Pj4gKyAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERPTUlEX1NFTEYpIDwgMCApDQo+
Pg0KPj4gWW91IG5lZWQgdG8gc2V0IHJvLT5jb3VudCAqYWZ0ZXIqIGNhbGxpbmcgbW11X3Vw
ZGF0ZS4NCj4gDQo+IEhhcHB5IHRvIG1vdmUgdGhlIGxpbmUgd2hpbGUgY29tbWl0dGluZywg
c28gbG9uZyBhcyBKw7xyZ2VuIGFncmVlcy4NCg0KT2ggeWVzLCBvZiBjb3Vyc2UgSSBkby4N
Cg0KVGhhbmtzLA0KDQoNCkp1ZXJnZW4NCg==
--------------OSoN7QDx5p5VoSJjpDAr9WS2
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-----

--------------OSoN7QDx5p5VoSJjpDAr9WS2--

--------------hBhs6O40hIWJOFZchOs0wO11--

--------------OQwIt5mfwX76T0mgkJFrSFDr
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/Ey8FAmbEldQFAwAAAAAACgkQsN6d1ii/Ey8p
zgf/d2JuulLFw2QhJVEm18gWKtiwqOdmK0jxII/lhGdUNZvCJVn//gRk+UnYLuXJfUnWoYw8HDSO
/aD6WYm3+5LEU8zIzPZrN4a3neKvTThAhc7JlJ7ue0S4mvveDAKqY8TE77J3LvxTex5AqMUfdxkM
ZoFdapo0PGrEgKegVxtlmSflezunb7lepKgVX0T1794BIR3YvsckjJUpZm7VH+77QMKnEJ4LTsxu
SRky5tIwt01LU/Qy+DbQ9xMpIVg3w7K4tFZk59t9gNbyRhJPSLbh1QMJscI2MlCQX5IUTSZSWnBQ
ij8gkzVu1yHHF7mmPlF54yZu/ILQfC1eWekOOpcGyA==
=vUTF
-----END PGP SIGNATURE-----

--------------OQwIt5mfwX76T0mgkJFrSFDr--


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 13:18:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 13:18:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780422.1190037 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgOkw-0007hJ-K9; Tue, 20 Aug 2024 13:18:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780422.1190037; Tue, 20 Aug 2024 13:18:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgOkw-0007hC-HP; Tue, 20 Aug 2024 13:18:38 +0000
Received: by outflank-mailman (input) for mailman id 780422;
 Tue, 20 Aug 2024 13:18: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=z0MZ=PT=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sgOkv-0007h6-Eu
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 13:18:37 +0000
Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com
 [2a00:1450:4864:20::131])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b4ea8c9e-5ef6-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 15:18:36 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-52efa16aad9so6806115e87.0
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 06:18:36 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-53335df3f87sm789063e87.244.2024.08.20.06.18.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Aug 2024 06:18:34 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b4ea8c9e-5ef6-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724159916; x=1724764716; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=fXR7VYljGna+zt6ofxbcN6gnAQzndfeuyr1TzdIpJ6s=;
        b=dmfQWQUnWj3DC0MXkmSfEZLe7DGYDYQP0JLvHD7jcTymvo0sVpiNVpUDx20TfUXVYo
         LlkOZlQB0iWhQLDfo1Li3jQ7rHCEcRq3qhamTSQ7C0+16vSoRTyZBgah6eHtrDq+8dc9
         XCM6+bd7pzort6TzCFB3dQ0Q58UDQWZsjd9LBoV7qAZepBRaYxY68ANQYIC63z3M+guA
         qNlq9dPZr1+gQlOCKjYTATHFPGphlQBl078YRxa9kHT64xhyllIFqqLml4kWrxU6njgn
         iBlK6zXJML9sBal5R1zMic7uoqG9lZjfSqkdPBYDXOWf/ZCSjzFAtgoti97QW8nqprGP
         25mQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724159916; x=1724764716;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=fXR7VYljGna+zt6ofxbcN6gnAQzndfeuyr1TzdIpJ6s=;
        b=atCm9z9pAizYzRzKjmWV23ah+YyXnNCZgqOZIXWYqRPMXhsdWlfUAOYI5A46FR3Ztc
         xjVe8kvecCVrir4+xbCiVNfeAN8S3HBMgYcJh86o2o3FQcZzUjS2uMy4GrJR2pxzLzgm
         PMCqmLRLMh1WNQiuAI44eoKhZQHV9zeFKuBYGW9neXoMBwbwvLs8ewfzieb4y4dnpjN1
         ZYNYczoIKML8hC3bZG1rY8bOUAHryEbCIGdmNq+Z/n/U1zglwihveTqSqcUn9aizrRMk
         LtEniVathBy02KM3ah5parCu4RBZdUbUqgP5eYCw+Ob/1OmH2kfQpnz3NrIKrK++IJth
         f5Tw==
X-Forwarded-Encrypted: i=1; AJvYcCU1+x3EmY8DJkBppvQ121n4An8CAPTT6fort6PbkMVIj7kjz0XULQxz/6uIRh0r8QKoz+1ZN+uJDw2vU90awtQ8Ulg0UVce3CaWDExTpR4=
X-Gm-Message-State: AOJu0Yy8fLI+a+xVjQerXexWSQxVSJsHgwqg1i1Z9rnN95RUXGDwdRgr
	PiNlTG8UFB3m/JzcywE9tTmoEju2c9W0gqeEBo3B15D3TxhtAFBo
X-Google-Smtp-Source: AGHT+IGyQS2RCjwaFtfLPuUosEXH+uY5M/Qua7zWIUThOrOinCZTLzFRxnqRDNU6noQcMiyMAGSUzQ==
X-Received: by 2002:a05:6512:68c:b0:532:ef03:a72c with SMTP id 2adb3069b0e04-5331c6b5ac3mr8120583e87.32.1724159915130;
        Tue, 20 Aug 2024 06:18:35 -0700 (PDT)
Message-ID: <1551cd4dd3b5fcf6aea59a972b60fa6b3b06bed6.camel@gmail.com>
Subject: Re: [PATCH v4 6/7] xen/riscv: page table handling
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Tue, 20 Aug 2024 15:18:34 +0200
In-Reply-To: <85a4e760-07af-42bd-ac27-12a4fa5172cc@suse.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
	 <8362795280a48702bef6f01d41d148edcf299935.1723214540.git.oleksii.kurochko@gmail.com>
	 <85a4e760-07af-42bd-ac27-12a4fa5172cc@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Tue, 2024-08-13 at 12:31 +0200, Jan Beulich wrote:
> > + * Sanity check of the entry
> > + * mfn is not valid and we are not populating page table. This
> > means
>=20
> How does this fit with ...
>=20
> > + * we either modify entry or remove an entry.
> > + */
> > +static bool pt_check_entry(pte_t entry, mfn_t mfn, unsigned int
> > flags)
> > +{
> > +=C2=A0=C2=A0=C2=A0 /* Sanity check when modifying an entry. */
> > +=C2=A0=C2=A0=C2=A0 if ( (flags & PTE_VALID) && mfn_eq(mfn, INVALID_MFN=
) )
>=20
> ... the MFN check here? And why is (valid,INVALID_MFN) an indication
> of a modification?
Because as mentioned here:
```
/*
 * If `mfn` equals `INVALID_MFN`, it indicates that the following page
table
 * update operation might be related to either populating the table,
 * destroying a mapping, or modifying an existing mapping.
 */
static int pt_update(unsigned long virt,
```
And so if requested flags are PTE_VALID ( present ) and mfn=3DINVALID it
will mean that we are going to modify an entry.


> But then ...
>=20
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* We don't allow modifying=
 an invalid entry. */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( !pte_is_valid(entry) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pri=
ntk("Modifying invalid entry is not allowed.\n");
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret=
urn false;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
>=20
> ... I also don't understand what this is about. IOW I'm afraid I'm
> still confused about the purpose of this function as well as the
> transitions you want to permit / reject.=C2=A0
In the case if the caller call modify_xen_mappings() on a region that
doesn't exist.

> I wonder whether the
> flags & PTE_VALID and pte_is_valid(entry) aren't in need of swapping.
I am not sure that I understand what you mean.


>=20
> > +/* Update an entry at the level @target. */
> > +static int pt_update_entry(mfn_t root, unsigned long virt,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 mfn_t mfn, unsigned int target,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 unsigned int flags)
> > +{
> > +=C2=A0=C2=A0=C2=A0 int rc;
> > +=C2=A0=C2=A0=C2=A0 unsigned int level =3D HYP_PT_ROOT_LEVEL;
> > +=C2=A0=C2=A0=C2=A0 pte_t *table;
> > +=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * The intermediate page tables are read-only =
when the MFN is
> > not valid
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * and we are not populating page table.
>=20
> The way flags are handled in PTEs, how can page tables be read-only?
This is not needed for everyone case. In case of entry removing an
intermediate page table should be created in case when the user is
trying to remove a mapping that doesn't exist.


>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * This means we either modify permissions or =
remove an entry.
>=20
> From all I can determine we also get here when making brand new
> entries.
> What am I overlooking?
Yes, but in this case an intermediate page tables should be read_only,
so alloc_only will be true and it will be allowed to create new
intermediate page table.


> > +=C2=A0=C2=A0=C2=A0 return rc;
> > +}
> > +
> > +int map_pages_to_xen(unsigned long virt,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mfn_t mfn,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned long nr_mfns,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned int flags)
> > +{
> > +=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * Ensure that we have a valid MFN before proc=
eeding.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 *
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * If the MFN is invalid, pt_update() might mi=
sinterpret the
> > operation,
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * treating it as either a population, a mappi=
ng destruction,
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * or a mapping modification.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0 ASSERT(!mfn_eq(mfn, INVALID_MFN));
>=20
> But flags with PTE_VALID not set are fine to come into here?
Probably not, I will double check again and if it is not okay, I will
update the ASSERT.



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 13:32:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 13:32:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780434.1190048 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgOyF-0002ch-Pf; Tue, 20 Aug 2024 13:32:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780434.1190048; Tue, 20 Aug 2024 13:32:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgOyF-0002ca-M0; Tue, 20 Aug 2024 13:32:23 +0000
Received: by outflank-mailman (input) for mailman id 780434;
 Tue, 20 Aug 2024 13:32: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=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgOyE-0002cU-Fc
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 13:32:22 +0000
Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com
 [2a00:1450:4864:20::230])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a0029009-5ef8-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 15:32:20 +0200 (CEST)
Received: by mail-lj1-x230.google.com with SMTP id
 38308e7fff4ca-2f16767830dso58531091fa.0
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 06:32:20 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bebbe7f92dsm6728908a12.60.2024.08.20.06.32.18
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 06:32:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a0029009-5ef8-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724160740; x=1724765540; 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=0y76zkYnLJmw+MYeZNFktaU+23N9dfOL3NRluxSrdz4=;
        b=Uk5G+CN31sjDuZu46yOm39GcHr5Chmot0tkkKpuV35/IHrOyFEiIWJsH2AWcIoQ1JG
         M2PmDbYacjUMwT81kDtOtPV3vuaG2zMgjI/57Tm2/MG8y2P07wynSv9DloJFMfUf+ejv
         r8kQ+fi1EdVQ2wqGLpmRteRMAJJRmTtLylrC8PTNLO3KR8zKmXLMfCSSRRmBcpoIr/pw
         nKperTdeRtM9QSDD+y821hK/vxLW4aAUSPxuc1zcO4kC5v5hBKO/+cFSPKlLsWQwbTpF
         aHb1Plb4KqsZuJpcG+CiGVpBb9arauN0ts4uiLysIkEWcJZImaKbAACK2FL4xJWMe3YN
         Qn+g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724160740; x=1724765540;
        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=0y76zkYnLJmw+MYeZNFktaU+23N9dfOL3NRluxSrdz4=;
        b=GT28DQUHsWWbdud6ai9ItGB4nbEM1mhumbTjwKQJPQZB9uq/lddHfYwYo6JVuwRSP3
         9KnnirU5Ip07lLZx7S7ibKyTYpjDXdXmcknDyWMjUqDaRRgxdBFmq/DjDDgow759YBh8
         bMCqqUgMGzcQ/00v/AHp9G2wPZ9Tbh+2CDtbqJLCobn5wb2XzpI5x2mKPQvtE+O8/Nzv
         jWKuCUBmLcFan7KNSNoalUNAeX7Bm5EBVWVzHfUprTzbI8LP5/tugI9icLgkYVaEwBhY
         zTfmrbHr7SgqWQAApldsGsPx1uYTu9NuIeLC01MTGKTWPCo6x+sCevabpKvH8Md7Yp/P
         TvHw==
X-Forwarded-Encrypted: i=1; AJvYcCWwRQ4dRCyoCdFRKK4h4t+TUUjDjJyV9eVkDGdzaMZxjljQTp/DzjlsSHOogDwmNhkF1Fd8ROvsHUM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxoXkGlHl0HiWO3DRW8aVEuUGvXeyx+T308Vd9htN8UGYFWhZ0h
	z87LSWVRyeLyIrLT2tEuOtAuP2llrmJXWBy+t9E8M+kISDFAqOsNApYDL1pkTA==
X-Google-Smtp-Source: AGHT+IESaEYjHpCbYVetllFhLLBIgmFdi7HzzA0Cf5Wyz4UNZo7lEKlUr8h4IC6UWKrJp+Gi8XMbHA==
X-Received: by 2002:a2e:a990:0:b0:2ee:7a3a:9969 with SMTP id 38308e7fff4ca-2f3be57219cmr107152171fa.5.1724160739002;
        Tue, 20 Aug 2024 06:32:19 -0700 (PDT)
Message-ID: <d13903d5-d79e-4af2-9449-1a97aeaf03e2@suse.com>
Date: Tue, 20 Aug 2024 15:32:17 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 5/5] x86: Rollback relocation in case of EFI multiboot
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <20240814083428.3012-1-frediano.ziglio@cloud.com>
 <20240814083428.3012-6-frediano.ziglio@cloud.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: <20240814083428.3012-6-frediano.ziglio@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 14.08.2024 10:34, Frediano Ziglio wrote:
> In case EFI not multiboot rolling back relocation is done in
> efi_arch_post_exit_boot, called by efi_start however this is
> not done in multiboot code path.
> Do it also for this path to make it work correctly.
> 
> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
> ---
>  xen/arch/x86/boot/Makefile          |  2 +-
>  xen/arch/x86/boot/efi-reloc-image.c | 40 ++++++++++++++
>  xen/arch/x86/boot/efi-reloc-image.h | 85 +++++++++++++++++++++++++++++
>  xen/arch/x86/boot/head.S            | 44 ++++++++++++---
>  xen/arch/x86/efi/efi-boot.h         | 64 ++--------------------
>  5 files changed, 168 insertions(+), 67 deletions(-)
>  create mode 100644 xen/arch/x86/boot/efi-reloc-image.c
>  create mode 100644 xen/arch/x86/boot/efi-reloc-image.h

Would there be anything wrong with using just efi-reloc.[ch]? I'm sorry, but
I'm a little averse to long names when shorter ones are as unambiguous.

> --- /dev/null
> +++ b/xen/arch/x86/boot/efi-reloc-image.c
> @@ -0,0 +1,40 @@
> +/*
> + * efi-reloc-image.c
> + *
> + * 32-bit flat memory-map routines for relocating back PE executable.
> + * This is done with paging disabled to avoid permission issues.
> + *
> + * Copyright (c) 2024, Citrix Systems, Inc.
> + */

Just curious: Is "Citrix" still the right name to use in places like this one?

> +/*
> + * This entry point is entered from xen/arch/x86/boot/head.S with:
> + *   - 0x04(%esp) = __XEN_VIRT_START - xen_phys_start

This could to with adding "(two slots)" or "(64 bits)".

> + *   - 0x0c(%esp) = xen_phys_start
> + *   - 0x10(%esp) = __base_relocs_start
> + *   - 0x14(%esp) = __base_relocs_end
> + */
> +asm (
> +    "    .text                         \n"
> +    "    .globl _start                 \n"
> +    "_start:                           \n"
> +    "    jmp    reloc_pe_back          \n"
> +    );
> +
> +#include "defs.h"
> +
> +/* Do not patch page tables. */
> +#define in_page_tables(v) false

If you want what the comment says, this can't yield "false" for every
possible input. Didn't you even have page table related logic in v1?

> --- /dev/null
> +++ b/xen/arch/x86/boot/efi-reloc-image.h
> @@ -0,0 +1,85 @@
> +/*
> + * efi-reloc-image.h
> + *
> + * Code for relocating back PE executable.
> + * This code is common between 64 bit and 32 bit.
> + *
> + * Copyright (c) 2024, Citrix Systems, Inc.
> + */
> +
> +#if EFI_RELOC_IMAGE_EARLY != 0 && EFI_RELOC_IMAGE_EARLY != 1
> +#error EFI_RELOC_IMAGE_EARLY must be defined either 0 or 1
> +#endif

Depending on compiler type and version, EFI_RELOC_IMAGE_EARLY simply not
being defined may or may not raise a warning, but would otherwise satisfy
EFI_RELOC_IMAGE_EARLY == 0. I think you want to also guard against
un-defined-ness.

> +typedef struct pe_base_relocs {
> +    uint32_t rva;
> +    uint32_t size;
> +    uint16_t entries[];
> +} pe_base_relocs;
> +
> +#define PE_BASE_RELOC_ABS      0
> +#define PE_BASE_RELOC_HIGHLOW  3
> +#define PE_BASE_RELOC_DIR64   10
> +
> +#if EFI_RELOC_IMAGE_EARLY
> +bool __stdcall
> +#else
> +static bool
> +#endif
> +reloc_pe_back(long long delta,
> +              unsigned long xen_phys_start,
> +              const pe_base_relocs *__base_relocs_start,
> +              const pe_base_relocs *__base_relocs_end)
> +{
> +    const struct pe_base_relocs *base_relocs;
> +
> +    for ( base_relocs = __base_relocs_start; base_relocs < __base_relocs_end; )
> +    {
> +        unsigned int i = 0, n;
> +
> +        n = (base_relocs->size - sizeof(*base_relocs)) /
> +            sizeof(*base_relocs->entries);
> +
> +        for ( ; i < n; ++i )
> +        {
> +            unsigned long addr = xen_phys_start + base_relocs->rva +
> +                                 (base_relocs->entries[i] & 0xfff);
> +
> +            switch ( base_relocs->entries[i] >> 12 )
> +            {
> +            case PE_BASE_RELOC_ABS:
> +                break;
> +            case PE_BASE_RELOC_HIGHLOW:
> +                if ( delta )
> +                {
> +                    *(uint32_t *)addr += delta;
> +                    if ( in_page_tables(addr) )
> +                        *(uint32_t *)addr += xen_phys_start;
> +                }
> +                break;
> +            case PE_BASE_RELOC_DIR64:
> +                if ( delta )
> +                {
> +                    *(uint64_t *)addr += delta;
> +                    if ( in_page_tables(addr) )
> +                        *(uint64_t *)addr += xen_phys_start;
> +                }
> +                break;
> +            default:
> +                return false;
> +            }

As you're moving this code, please put blank lines between case blocks.

> +        }
> +        base_relocs = (const void *)(base_relocs->entries + i + (i & 1));
> +    }
> +    return true;
> +}

Nit: Blank line please ahead of a function's main "return".

> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -332,7 +332,8 @@ __efi64_mb2_start:
>           */
>          and     $~15,%rsp
>  
> -        /* Save Multiboot2 magic on the stack. */
> +        /* Save Multiboot2 magic on the stack for a later 32bit call */
> +        shl     $32, %rax
>          push    %rax

I see you're now extending the comment here. However, ...

> @@ -363,11 +364,25 @@ __efi64_mb2_start:
>          /* Just pop an item from the stack. */
>          pop     %rax
>  
> -        /* Restore Multiboot2 magic. */

... this comment shouldn't be lost (wants to move down), and ...

> -        pop     %rax
> +        /*
> +         * Prepare stack for relocation call.
> +         * Note that we are in 64bit mode but we are going to call a
> +         * function in 32bit mode so the stack is not written with
> +         * push instructions.
> +         */
> +        sub     $16, %rsp
> +        lea     __base_relocs_end(%rip), %ecx
> +        mov     %ecx, 16(%rsp)

... the re-using of half a 64-bit slot here still isn't present in
commentary (in fact the comment is slightly wrong as is, because that
re-used half slot _is_ written by a PUSH, just higher up).

> --- a/xen/arch/x86/efi/efi-boot.h
> +++ b/xen/arch/x86/efi/efi-boot.h
> @@ -36,69 +36,15 @@ extern const intpte_t __page_tables_start[], __page_tables_end[];
>  #define in_page_tables(v) ((intpte_t *)(v) >= __page_tables_start && \
>                             (intpte_t *)(v) < __page_tables_end)
>  
> -#define PE_BASE_RELOC_ABS      0
> -#define PE_BASE_RELOC_HIGHLOW  3
> -#define PE_BASE_RELOC_DIR64   10
> +#define EFI_RELOC_IMAGE_EARLY 0
> +#include "../boot/efi-reloc-image.h"
>  
> -extern const struct pe_base_relocs {
> -    u32 rva;
> -    u32 size;
> -    u16 entries[];
> -} __base_relocs_start[], __base_relocs_end[];
> +extern pe_base_relocs __base_relocs_start[], __base_relocs_end[];

You've lost the const.

>  static void __init efi_arch_relocate_image(unsigned long delta)
>  {
> -    const struct pe_base_relocs *base_relocs;
> -
> -    for ( base_relocs = __base_relocs_start; base_relocs < __base_relocs_end; )
> -    {
> -        unsigned int i = 0, n;
> -
> -        n = (base_relocs->size - sizeof(*base_relocs)) /
> -            sizeof(*base_relocs->entries);
> -
> -        /*
> -         * Relevant l{2,3}_bootmap entries get initialized explicitly in
> -         * efi_arch_memory_setup(), so we must not apply relocations there.
> -         * l2_directmap's first slot, otoh, should be handled normally, as
> -         * efi_arch_memory_setup() won't touch it (xen_phys_start should
> -         * never be zero).
> -         */
> -        if ( xen_phys_start + base_relocs->rva == (unsigned long)l3_bootmap ||
> -             xen_phys_start + base_relocs->rva == (unsigned long)l2_bootmap )
> -            i = n;

I can't spot the replacement for this code.

> -        for ( ; i < n; ++i )
> -        {
> -            unsigned long addr = xen_phys_start + base_relocs->rva +
> -                                 (base_relocs->entries[i] & 0xfff);
> -
> -            switch ( base_relocs->entries[i] >> 12 )
> -            {
> -            case PE_BASE_RELOC_ABS:
> -                break;
> -            case PE_BASE_RELOC_HIGHLOW:
> -                if ( delta )
> -                {
> -                    *(u32 *)addr += delta;
> -                    if ( in_page_tables(addr) )
> -                        *(u32 *)addr += xen_phys_start;
> -                }
> -                break;
> -            case PE_BASE_RELOC_DIR64:
> -                if ( delta )
> -                {
> -                    *(u64 *)addr += delta;
> -                    if ( in_page_tables(addr) )
> -                        *(u64 *)addr += xen_phys_start;
> -                }
> -                break;
> -            default:
> -                blexit(L"Unsupported relocation type");
> -            }
> -        }
> -        base_relocs = (const void *)(base_relocs->entries + i + (i & 1));
> -    }
> +    if (!reloc_pe_back(delta, xen_phys_start, __base_relocs_start, __base_relocs_end))

Nit: Style.

> +        blexit(L"Unsupported relocation type");
>  }
>  
>  extern const s32 __trampoline_rel_start[], __trampoline_rel_stop[];



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 13:35:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 13:35:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780446.1190058 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgP1U-0003D4-6X; Tue, 20 Aug 2024 13:35:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780446.1190058; Tue, 20 Aug 2024 13:35:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgP1U-0003Cx-3M; Tue, 20 Aug 2024 13:35:44 +0000
Received: by outflank-mailman (input) for mailman id 780446;
 Tue, 20 Aug 2024 13:35:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgP1T-0003C9-QF
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 13:35:43 +0000
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [2a00:1450:4864:20::534])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1840e111-5ef9-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 15:35:42 +0200 (CEST)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5becc379f3fso4232981a12.3
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 06:35:42 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bebbdfa6a7sm6842039a12.40.2024.08.20.06.35.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 06:35:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1840e111-5ef9-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724160941; x=1724765741; 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=BlOK/oK0rP2pIWmZiirxeUaxK4WlVuqlEHknliut4TQ=;
        b=CHLw/9M5bmQ9LliULDSrJksZRE9NwTuywgECPHxy2oK3eVZaw/85st3ySE+W1xNfC7
         B44vNAAMZZtK1k9LWbg8QhZTs3d5fiFa439e9aEeu5v2w6sp7Bnhx7S3OvNWKaUwBJHA
         Ak17zp2ColtKHY+cP0Xs0P8AhI796K4xUgA5VHig9pR4LEmgjUzSdebeFPU9gkMkuvh2
         SmemsKaErzaeVZfdm5Ce4m2lLQOSzVpVe25iaYBX9T/awNJ5UwZWBWyGB7xtvVuXfkcy
         4Jn+b/Gxgin/T2HekmZB7vtUkomApGA35KZdCiFuNhXcMB4JJHL6DX2Yt3BTXo5e7LaX
         SuhQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724160941; x=1724765741;
        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=BlOK/oK0rP2pIWmZiirxeUaxK4WlVuqlEHknliut4TQ=;
        b=jyPYzBtnwPHZSxjLHYXFkP5Vv00+cUsNwNFvJhqmA/T5yLigFLsA+siLgzJLyGyv+l
         7lusihNE/vSpemgAqinc4wZcGkEFwGLURzIluJaYBwjT/rdY4K7a+m6MwwMY/qqvcYNh
         eqlDHa0gAwysybVQABr0ibKSt8CxJe5dk8GG8P43dGK6Dst1Gyr26evltBuAyQdmf+Of
         tOjvZqzpa8sNAWyqVtj1ejE9auvx+bfKFGuOX+sLbcP1ZXnHjEuQLneyn11//YITLHLO
         4KCAqNEuNP8O0PcbUjMhEFRqM7tD3l49Sm9S6NlzwKb99psXj0sFUdg8p3t/wF+Z550X
         5q+Q==
X-Forwarded-Encrypted: i=1; AJvYcCURsuIHkk1OL3zKIDvqA/Xgz9iTCohCPqL/JPRhWxyx1Ed9BTJVbC0yT5vZlMAsuK/M3KLKSJ/adlA=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz0/wrfdyNeRRd8iYsmfecic5v7l2eISLKKF+X1b4vI/0/jcC/u
	8c8zwxO6turSdwzEL++qAyMcTymQ4eNQJUpQFhfraEJEF8SCvDeSVNcJWIZjpw==
X-Google-Smtp-Source: AGHT+IHhbJZnrV61k8SZB6zHR0iFBervXEYPr9ErOryPzMFT29XEZGssRAVIijmoujeg/HEC627AKQ==
X-Received: by 2002:a05:6402:e87:b0:5a1:32d1:91a6 with SMTP id 4fb4d7f45d1cf-5beca5d9289mr7306053a12.22.1724160941255;
        Tue, 20 Aug 2024 06:35:41 -0700 (PDT)
Message-ID: <adfa3b73-6b11-4fa9-bcd7-e155a741d401@suse.com>
Date: Tue, 20 Aug 2024 15:35:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 0/5] Support EFI multiboot loading using PE binary
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, xen-devel@lists.xenproject.org
References: <20240814083428.3012-1-frediano.ziglio@cloud.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: <20240814083428.3012-1-frediano.ziglio@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 14.08.2024 10:34, Frediano Ziglio wrote:
> Testing this feature in preparation for UEFI CA memory mitigation
> requirements I found some issues causing the loading to fail and
> other minor issues.
> Details in series commit messages.
> This is adding an additional way to boot Xen, using GrUB2+EFI
> (xen.efi:__efi64_mb2_start).
> 
> Changes since v1:
> - Changed title, apparently this is a kind of new mode;
> - address lot of comments (see "Changes" in other messages).
> 
> Frediano Ziglio (5):
>   x86: Put trampoline in .init.data section
>   x86: Set xen_phys_start and trampoline_xen_phys_start earlier
>   x86: Force proper gdt_boot_base setting
>   x86: Compensate relocation in case of EFI
>   x86: Rollback relocation in case of EFI multiboot

What I'm missing throughout the series (maybe with patch 1 excluded, which
- as Andrew clarified - is really dealing with an independent aspect) is
discussion / clarification of the individual changes not affecting any of
the existing boot modes, first and foremost the EFI+MB2 one using xen.gz.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 13:47:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 13:47:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780455.1190068 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPCT-00066P-AG; Tue, 20 Aug 2024 13:47:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780455.1190068; Tue, 20 Aug 2024 13:47:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPCT-00066I-6H; Tue, 20 Aug 2024 13:47:05 +0000
Received: by outflank-mailman (input) for mailman id 780455;
 Tue, 20 Aug 2024 13:47:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgPCS-00066C-5l
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 13:47:04 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ae258ce3-5efa-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 15:47:03 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a7a975fb47eso631188866b.3
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 06:47: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
 a640c23a62f3a-a838396c178sm759130266b.202.2024.08.20.06.47.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 06:47:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ae258ce3-5efa-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724161622; x=1724766422; 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=qx39jQkVDuFQdAxWBhSWQM9E4QZeP7z6jVAwE7itU24=;
        b=FD2S4hcsjpd0dtvxqVaqiId4ssCOSnlpfLUFmgZX8kOfzi7ZRj7Slih/eEQ+DRssB/
         lcMq+8PqTpBxfPelm+TKusD71QzTmg4xjJCokJfO+E6URow7TavmCMZggHIyNKLzeBcJ
         Gc7/hBJI9FrEvx1fkbEp0BcVkwkFZn+bxlpDxmtswol8PlLBSPILoFLM4DX9e+aijjDW
         ch7renhT4JT6Pl80+vb0LQMUobh+rcWu0n1eFHxxqv4UZOZw5v5ZlqOtWAAOt1NcaYNv
         TlkE9pT5E1HoB3jBjVmbkZE2pSYQ8rEgAjhdyK3ceTJ7XhDnFoRYPn7Oh7nVe/Ixm3u9
         Hg9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724161622; x=1724766422;
        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=qx39jQkVDuFQdAxWBhSWQM9E4QZeP7z6jVAwE7itU24=;
        b=d/PisSVGclWPOIRyOezmWi0nQqvb/efW1tiZLrIn1Pb2SLUipLi89iCgU0POlImBKb
         CQ6m/Mtuilx6iKflY7csykUUHcEdha0ZobIUfCeHqmgbHsaBD0d40Nf17GeVK/C14HXn
         /FlpQw/iaRT/PEGAldnMNQBZmbnK2PVnMdjlED3C09Rd0BEc3mgl+frd4BXsWbGwAYjR
         +j+8fsgS28oJtfTFgRXYucT4FWtaNnfTcIqDdGtzInkYRNBV55Zy+qEeGy5Is34/j1Lj
         dpQkzoSmz6ta4m/yIHBtpMWXUaaCVN8nTWIkUJAh2zROkY0priU6Ot1rvI5qNzpi1Z4X
         wv9A==
X-Forwarded-Encrypted: i=1; AJvYcCU8M83cOKz9EZkYpnT1gdiZzV2VxpBE2GsTYaM6bpi/kJk42cbO+K1ZTAGqF75Y8dcggo4lrGxWl6oiBOTffrQajKumzFP51CooS3FzsAo=
X-Gm-Message-State: AOJu0YxK6Gx4mhe0wYCAZsFRwq5fr8Ppxzu8LL/8vPRFutDvza2YcUx4
	+rf2zpG1DTWy7Tyo60gbD5Y0gZAwwhnGtKH8r454cCvzr2D5eTCezl+WJ900EA==
X-Google-Smtp-Source: AGHT+IFCaxc8u/TwGth0UEf9YVkfa4TGMmnQnPxC0iRifsk3DZbuvCz4xTY20em0sfXiyYHmOdZQTw==
X-Received: by 2002:a17:907:948a:b0:a80:f7db:3e7 with SMTP id a640c23a62f3a-a83928a995cmr966275866b.5.1724161622284;
        Tue, 20 Aug 2024 06:47:02 -0700 (PDT)
Message-ID: <4a7f44ce-e5ba-4a36-9b0b-7cd7c14cc846@suse.com>
Date: Tue, 20 Aug 2024 15:47:01 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 6/7] xen/riscv: page table handling
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <8362795280a48702bef6f01d41d148edcf299935.1723214540.git.oleksii.kurochko@gmail.com>
 <85a4e760-07af-42bd-ac27-12a4fa5172cc@suse.com>
 <1551cd4dd3b5fcf6aea59a972b60fa6b3b06bed6.camel@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: <1551cd4dd3b5fcf6aea59a972b60fa6b3b06bed6.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 20.08.2024 15:18, oleksii.kurochko@gmail.com wrote:
> On Tue, 2024-08-13 at 12:31 +0200, Jan Beulich wrote:
>>> + * Sanity check of the entry
>>> + * mfn is not valid and we are not populating page table. This
>>> means
>>
>> How does this fit with ...
>>
>>> + * we either modify entry or remove an entry.
>>> + */
>>> +static bool pt_check_entry(pte_t entry, mfn_t mfn, unsigned int
>>> flags)
>>> +{
>>> +    /* Sanity check when modifying an entry. */
>>> +    if ( (flags & PTE_VALID) && mfn_eq(mfn, INVALID_MFN) )
>>
>> ... the MFN check here? And why is (valid,INVALID_MFN) an indication
>> of a modification?
> Because as mentioned here:
> ```
> /*
>  * If `mfn` equals `INVALID_MFN`, it indicates that the following page
> table
>  * update operation might be related to either populating the table,
>  * destroying a mapping, or modifying an existing mapping.
>  */
> static int pt_update(unsigned long virt,
> ```

That's in the description of another function. How would one know that
the rules on (mfn,flags) tuples there would apply here as well, without
you saying so explicitly? It may not be necessary to repeat the other
comment, but at least you want to reference it.

> And so if requested flags are PTE_VALID ( present ) and mfn=INVALID it
> will mean that we are going to modify an entry.
> 
> 
>> But then ...
>>
>>> +    {
>>> +        /* We don't allow modifying an invalid entry. */
>>> +        if ( !pte_is_valid(entry) )
>>> +        {
>>> +            printk("Modifying invalid entry is not allowed.\n");
>>> +            return false;
>>> +        }
>>
>> ... I also don't understand what this is about. IOW I'm afraid I'm
>> still confused about the purpose of this function as well as the
>> transitions you want to permit / reject. 
> In the case if the caller call modify_xen_mappings() on a region that
> doesn't exist.

Perhaps. What I think is missing is a clear statement somewhere to describe
what the various combinations of (mfn,flags) mean, in terms of the operation
to be carried out. This may then also help with ...

>> I wonder whether the
>> flags & PTE_VALID and pte_is_valid(entry) aren't in need of swapping.
> I am not sure that I understand what you mean.

... this: It's hard to see what cannot be understood about my earlier
comment. In the code commented on you have a flags & PTE_VALID check and a
pte_is_valid(entry) one. I'm wondering whether the two simply are the wrong
way round.

>>> +/* Update an entry at the level @target. */
>>> +static int pt_update_entry(mfn_t root, unsigned long virt,
>>> +                           mfn_t mfn, unsigned int target,
>>> +                           unsigned int flags)
>>> +{
>>> +    int rc;
>>> +    unsigned int level = HYP_PT_ROOT_LEVEL;
>>> +    pte_t *table;
>>> +    /*
>>> +     * The intermediate page tables are read-only when the MFN is
>>> not valid
>>> +     * and we are not populating page table.
>>
>> The way flags are handled in PTEs, how can page tables be read-only?
> This is not needed for everyone case. In case of entry removing an
> intermediate page table should be created in case when the user is
> trying to remove a mapping that doesn't exist.

I don't follow: For one, how is this related to "read-only"-ness? And
then, why would any kind of removal, whether of a present or non-
present mapping, ever result in page tables being created?

>>> +     * This means we either modify permissions or remove an entry.
>>
>> From all I can determine we also get here when making brand new
>> entries.
>> What am I overlooking?
> Yes, but in this case an intermediate page tables should be read_only,
> so alloc_only will be true and it will be allowed to create new
> intermediate page table.

Hmm, so instead of "read-only" do you maybe mean page tables are not
supposed to be modified? There's a difference here: When they're
read-only, you can't write to them (or a fault will result). Whereas
when in principle they can be modified, there still may be a rule
saying "in this case they shouldn't be altered".

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:13:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:13:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780469.1190077 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPc3-00038r-9T; Tue, 20 Aug 2024 14:13:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780469.1190077; Tue, 20 Aug 2024 14:13:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPc3-00038k-6x; Tue, 20 Aug 2024 14:13:31 +0000
Received: by outflank-mailman (input) for mailman id 780469;
 Tue, 20 Aug 2024 14:13:29 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=prYO=PT=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sgPc1-00038c-LM
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:13:29 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5cfb4c8d-5efe-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 16:13:24 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5bebd3b7c22so7681438a12.0
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:13:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5cfb4c8d-5efe-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724163204; x=1724768004; 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=HqlixZGtnNSdwk9qAJAaBBrZLbKEh4Yudg6Ug8KTXQw=;
        b=nnF/7La0WZMjQSgtg5xZauCnOBjy6mMDSJhhX62XLxMdmCTS+Lgv9NBWaHY3kNvIVM
         xAwiNJWnVipMrIj1IjZuwTehf4QZ0TK8YiGy8RZBm/jd49FAPF6BAvH89g+36odA8mx+
         1iGOm0CoD3OhrRF6IXknig86Fh9EvywQ7L8kkIM3KkUqxdFnLHn/TZYi+BgK/Vn6VGmn
         O8OA+56LIRxEmfv03qxRLfMZJDW3uZUJ5MMzsff9FBHOkIivzxFaX8d4CPMkW5rT+QsN
         +CWckHfbzub0KN//Wtm2BYOa0mp3inUuRA0w0YUgyjIVD+bqNNfge5CF6yk9HPfBowiC
         b38w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724163204; x=1724768004;
        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=HqlixZGtnNSdwk9qAJAaBBrZLbKEh4Yudg6Ug8KTXQw=;
        b=LFlN6xaOzzO497m7ZCnSU9XbH6PryH4JuWoSwFAB6vJE3JJKeQFEt3t4PmFiBNE9g6
         XgzBLwzsOLuumRRuzjV6vgBdvIyTPa9VtuzQCFHBGC40QLV7bTTZiUU7w/mCuXlZMNkf
         /DujvDIqseWDq+sNRzBkY5xEK8uUc/8yyY3UT6gz4SZKnPGAtot6jO8TTJtwV4XGUWge
         Nlxio4v4CKqYJ3NKp8Jq3U3Ho5bgcngKv+4c7b93eeH7MOSASOFlEzLwgcVVnYS1V2VB
         +4jb3Z+hRChjjo/XwN6LzZJPjP+wjeIdY2JHi+HdmL7nkHt6arCwQEdFIuFZAPW50wzI
         rbrw==
X-Forwarded-Encrypted: i=1; AJvYcCXTgdArJhxkwc4k9KYKtTkADnFGhlrv5eWIWiCeONsLOMJVTfezAU4/eBKhpjPaEHPlaKXPaVjcWm8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwBTCvWP3NEUjh69ApYrDHuajMJ+EHDQn9YgG2qf9Ji2YL2Q7ZU
	iIOrpG+zRFX02ULlXTUbmGSn0AvmgYRv3OakAiq60uuxuYYJ+PXRrp9nCl4VAe6Cu1c5stb4oA6
	TF5qj/3DVeTe71yH/aKCz/wO3QrQ=
X-Google-Smtp-Source: AGHT+IFYXoeF3FkeU2yRw9Zo8xB+GajV1hIlPvROdYyo/QgSrD0N91jQzsYOSqk1zJkttdz8EesefwH1O22HjOYezNo=
X-Received: by 2002:a05:6402:1912:b0:5b4:cbba:902a with SMTP id
 4fb4d7f45d1cf-5bf0ac0c9ddmr2867783a12.4.1724163203518; Tue, 20 Aug 2024
 07:13:23 -0700 (PDT)
MIME-Version: 1.0
References: <20240812130606.90410-1-edgar.iglesias@gmail.com>
 <20240812130606.90410-5-edgar.iglesias@gmail.com> <alpine.DEB.2.22.394.2408121650590.298534@ubuntu-linux-20-04-desktop>
 <ZruRm34zIMtUm7oH@zapote> <alpine.DEB.2.22.394.2408131550080.298534@ubuntu-linux-20-04-desktop>
 <ZryZwOoadeb1UWK8@zapote> <alpine.DEB.2.22.394.2408141719400.298534@ubuntu-linux-20-04-desktop>
 <CAJy5ezrUbGZCaF=HiYhyLCoXRL3d=t-QbmLeKvu7ByWksV888g@mail.gmail.com>
 <alpine.DEB.2.22.394.2408160949320.298534@ubuntu-linux-20-04-desktop> <93de8d6d-6123-4038-a566-d134206ba608@amd.com>
In-Reply-To: <93de8d6d-6123-4038-a566-d134206ba608@amd.com>
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Date: Tue, 20 Aug 2024 16:13:10 +0200
Message-ID: <CAJy5ezonjsd95GhkoagrivQy_Vme7wyj1xLvVd9ZxNP_tJyBRA@mail.gmail.com>
Subject: Re: [PATCH v1 04/10] hw/arm: xenpvh: Add support for SMP guests
To: Jason Andryuk <jason.andryuk@amd.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, qemu-devel@nongnu.org, anthony@xenproject.org, 
	paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
	xenia.ragiadakou@amd.com, edgar.iglesias@amd.com, 
	xen-devel@lists.xenproject.org, qemu-arm@nongnu.org, 
	andrew.cooper3@citrix.com
Content-Type: multipart/alternative; boundary="00000000000047d8ac06201e0744"

--00000000000047d8ac06201e0744
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sat, Aug 17, 2024 at 2:45=E2=80=AFAM Jason Andryuk <jason.andryuk@amd.co=
m> wrote:

> On 2024-08-16 12:53, Stefano Stabellini wrote:
> > On Fri, 16 Aug 2024, Edgar E. Iglesias wrote:
> >> On Thu, Aug 15, 2024 at 2:30=E2=80=AFAM Stefano Stabellini <
> sstabellini@kernel.org> wrote:
> >>        On Wed, 14 Aug 2024, Edgar E. Iglesias wrote:
> >>        > On Tue, Aug 13, 2024 at 03:52:32PM -0700, Stefano Stabellini
> wrote:
> >>        > > On Tue, 13 Aug 2024, Edgar E. Iglesias wrote:
> >>        > > > On Mon, Aug 12, 2024 at 06:47:17PM -0700, Stefano
> Stabellini wrote:
> >>        > > > > On Mon, 12 Aug 2024, Edgar E. Iglesias wrote:
> >>        > > > > > From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> >>        > > > > >
> >>        > > > > > Add SMP support for Xen PVH ARM guests. Create
> max_cpus ioreq
> >>        > > > > > servers to handle hotplug.
> >>        > > > > >
> >>        > > > > > Signed-off-by: Edgar E. Iglesias <
> edgar.iglesias@amd.com>
> >>        > > > > > ---
> >>        > > > > >  hw/arm/xen_arm.c | 5 +++--
> >>        > > > > >  1 file changed, 3 insertions(+), 2 deletions(-)
> >>        > > > > >
> >>        > > > > > diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
> >>        > > > > > index 5f75cc3779..ef8315969c 100644
> >>        > > > > > --- a/hw/arm/xen_arm.c
> >>        > > > > > +++ b/hw/arm/xen_arm.c
> >>        > > > > > @@ -173,7 +173,7 @@ static void
> xen_arm_init(MachineState *machine)
> >>        > > > > >
> >>        > > > > >      xen_init_ram(machine);
> >>        > > > > >
> >>        > > > > > -    xen_register_ioreq(xam->state, machine->smp.cpus=
,
> &xen_memory_listener);
> >>        > > > > > +    xen_register_ioreq(xam->state,
> machine->smp.max_cpus, &xen_memory_listener);
> >>        > > > > >
> >>        > > > > >      xen_create_virtio_mmio_devices(xam);
> >>        > > > > >
> >>        > > > > > @@ -218,7 +218,8 @@ static void
> xen_arm_machine_class_init(ObjectClass *oc, void *data)
> >>        > > > > >      MachineClass *mc =3D MACHINE_CLASS(oc);
> >>        > > > > >      mc->desc =3D "Xen PVH ARM machine";
> >>        > > > > >      mc->init =3D xen_arm_init;
> >>        > > > > > -    mc->max_cpus =3D 1;
> >>        > > > > > +    /* MAX number of vcpus supported by Xen.  */
> >>        > > > > > +    mc->max_cpus =3D GUEST_MAX_VCPUS;
> >>        > > > >
> >>        > > > > Will this cause allocations of data structures with 128
> elements?
> >>        > > > > Looking at hw/xen/xen-hvm-common.c:xen_do_ioreq_registe=
r
> it seems
> >>        > > > > possible? Or
> hw/xen/xen-hvm-common.c:xen_do_ioreq_register is called
> >>        > > >
> >>        > > > Yes, in theory there's probably overhead with this but as
> you correctly
> >>        > > > noted below, a PVH aware xl will set the max_cpus option
> to a lower value.
> >>        > > >
> >>        > > > With a non-pvh aware xl, I was a little worried about the
> overhead
> >>        > > > but I couldn't see any visible slow-down on ARM neither i=
n
> boot or in network
> >>        > > > performance (I didn't run very sophisticated benchmarks).
> >>        > >
> >>        > > What do you mean by "non-pvh aware xl"? All useful versions
> of xl
> >>        > > support pvh?
> >>        >
> >>        >
> >>        > I mean an xl without our PVH patches merged.
> >>        > xl in upstream doesn't know much about PVH yet.
> >>        > Even for ARM, we're still carrying significant patches in our
> tree.
> >>
> >>        Oh I see. In that case, I don't think we need to support
> "non-pvh aware xl".
> >>
> >>
> >>        > > > > later on with the precise vCPU value which should be
> provided to QEMU
> >>        > > > > via the -smp command line option
> >>        > > > >
> (tools/libs/light/libxl_dm.c:libxl__build_device_model_args_new)?
> >>        > > >
> >>        > > > Yes, a pvh aware xl will for example pass -smp 2,maxcpus=
=3D4
> based on
> >>        > > > values from the xl.cfg. If the user doesn't set maxvcpus
> in xl.cfg, xl
> >>        > > > will set maxvcpus to the same value as vcpus.
> >>        > >
> >>        > > OK good. In that case if this is just an initial value mean=
t
> to be
> >>        > > overwritten, I think it is best to keep it as 1.
> >>        >
> >>        > Sorry but that won't work. I think the confusion here may be
> that
> >>        > it's easy to mix up mc->max_cpus and machine->smp.max_cpus,
> these are
> >>        > not the same. They have different purposes.
> >>        >
> >>        > I'll try to clarify the 3 values in play.
> >>        >
> >>        > machine-smp.cpus:
> >>        > Number of guest vcpus active at boot.
> >>        > Passed to QEMU via the -smp command-line option.
> >>        > We don't use this value in QEMU's ARM PVH machines.
> >>        >
> >>        > machine->smp.max_cpus:
> >>        > Max number of vcpus that the guest can use (equal or larger
> than machine-smp.cpus).
> >>        > Will be set by xl via the "-smp X,maxcpus=3DY" command-line
> option to QEMU.
> >>        > Taken from maxvcpus from xl.cfg, same as XEN_DMOP_nr_vcpus.
> >>        > This is what we use for xen_register_ioreq().
> >>        >
> >>        > mc->max_cpus:
> >>        > Absolute MAX in QEMU used to cap the -smp command-line option=
s.
> >>        > If xl tries to set -smp (machine->smp.max_cpus) larger than
> this, QEMU will bail out.
> >>        > Used to setup xen_register_ioreq() ONLY if -smp maxcpus was
> NOT set (i.e by a non PVH aware xl).
> >>        > Cannot be 1 because that would limit QEMU to MAX 1 vcpu.
> >>        >
> >>        > I guess we could set mc->max_cpus to what XEN_DMOP_nr_vcpus
> returns but I'll
> >>        > have to check if we can even issue that hypercall this early
> in QEMU since
> >>        > mc->max_cpus is setup before we even parse the machine
> options. We may
> >>        > not yet know what domid we're attaching to yet.
> >>
> >>        If mc->max_cpus is the absolute max and it will not be used if
> -smp is
> >>        passed to QEMU, then I think it is OK to use GUEST_MAX_VCPUS
> >>
> >> Looking at this a little more. If users (xl) don't pass an -smp option
> we actually default to smp.max_cpus=3D1.
> >> So, another option is to simply remove the upper limit in QEMU (e.g we
> can set mc->max_cpus to something very large like UINT32_MAX).
> >> That would avoid early hypercalls, avoid using GUEST_MAX_VCPUS and
> always let xl dictate the max_cpus value using the -smp cmdline option.
> >
> > As the expectation is that there will be always a smp.max_cpus option
> > passed to QEMU, I would avoid an extra early hypercall.
> >
> > For the initial value, I would use something static and large, but not
> > unreasonably large as UINT32_MAX to be more resilient in (erroneous)
> > cases where smp.max_cpus is not passed.
> >
> > So I would initialize it to GUEST_MAX_VCPUS, or if we don't want to use
> > GUEST_MAX_VCPUS, something equivalent in the 64-256 range.
>

Thanks Stefano,

I'm going to send a v2 following this suggestion of using GUEST_MAX_VCPUS.
Will also add comments clarifying that this is a MAX value for the
command-line option
and not what gets passed to register_ioreq.
We can continue the discussion from there to see if we want to change
things,
I don't have a strong opinion here so I'm happy to go either way.



> >
> > Alternative we can have a runtime check and exit with a warning if
> > smp.max_cpus is not set.
>
> FYI, xl only passes a -smp option when the domU has more than 1 vcpu.
> Though that implies only a single vcpu.
>
>
Thanks Jason, yes, in that case the default of cpus=3D1, maxcpus=3D1 gets s=
et.
I was initially under the wrong assumption that without -smp options, the
max would get set.
This is what I was trying to clarify in my previous email:
>> Looking at this a little more. If users (xl) don't pass an -smp option
we actually default to smp.max_cpus=3D1.

Best regards,
Edgar

--00000000000047d8ac06201e0744
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Sat, Aug 17, 2024 at 2:45=E2=80=AFAM J=
ason Andryuk &lt;<a href=3D"mailto:jason.andryuk@amd.com">jason.andryuk@amd=
.com</a>&gt; wrote:<br></div><div class=3D"gmail_quote"><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex">On 2024-08-16 12:53, Stefano Stabellini wr=
ote:<br>
&gt; On Fri, 16 Aug 2024, Edgar E. Iglesias wrote:<br>
&gt;&gt; On Thu, Aug 15, 2024 at 2:30=E2=80=AFAM Stefano Stabellini &lt;<a =
href=3D"mailto:sstabellini@kernel.org" target=3D"_blank">sstabellini@kernel=
.org</a>&gt; wrote:<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 On Wed, 14 Aug 2024, Edgar E. Iglesias =
wrote:<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; On Tue, Aug 13, 2024 at 03:52:32PM=
 -0700, Stefano Stabellini wrote:<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; On Tue, 13 Aug 2024, Edgar E.=
 Iglesias wrote:<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; On Mon, Aug 12, 2024 at =
06:47:17PM -0700, Stefano Stabellini wrote:<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; On Mon, 12 Aug 2024=
, Edgar E. Iglesias wrote:<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt; From: &quot;Ed=
gar E. Iglesias&quot; &lt;<a href=3D"mailto:edgar.iglesias@amd.com" target=
=3D"_blank">edgar.iglesias@amd.com</a>&gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt; Add SMP suppor=
t for Xen PVH ARM guests. Create max_cpus ioreq<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt; servers to han=
dle hotplug.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt; Signed-off-by:=
 Edgar E. Iglesias &lt;<a href=3D"mailto:edgar.iglesias@amd.com" target=3D"=
_blank">edgar.iglesias@amd.com</a>&gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt; ---<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt;=C2=A0 hw/arm/x=
en_arm.c | 5 +++--<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt;=C2=A0 1 file c=
hanged, 3 insertions(+), 2 deletions(-)<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt; diff --git a/h=
w/arm/xen_arm.c b/hw/arm/xen_arm.c<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt; index 5f75cc37=
79..ef8315969c 100644<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt; --- a/hw/arm/x=
en_arm.c<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt; +++ b/hw/arm/x=
en_arm.c<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt; @@ -173,7 +173=
,7 @@ static void xen_arm_init(MachineState *machine)<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =
=C2=A0 xen_init_ram(machine);<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt; -=C2=A0 =C2=A0=
 xen_register_ioreq(xam-&gt;state, machine-&gt;smp.cpus, &amp;xen_memory_li=
stener);<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt; +=C2=A0 =C2=A0=
 xen_register_ioreq(xam-&gt;state, machine-&gt;smp.max_cpus, &amp;xen_memor=
y_listener);<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =
=C2=A0 xen_create_virtio_mmio_devices(xam);<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt; @@ -218,7 +218=
,8 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)<b=
r>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =
=C2=A0 MachineClass *mc =3D MACHINE_CLASS(oc);<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =
=C2=A0 mc-&gt;desc =3D &quot;Xen PVH ARM machine&quot;;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt;=C2=A0 =C2=A0 =
=C2=A0 mc-&gt;init =3D xen_arm_init;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt; -=C2=A0 =C2=A0=
 mc-&gt;max_cpus =3D 1;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt; +=C2=A0 =C2=A0=
 /* MAX number of vcpus supported by Xen.=C2=A0 */<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; &gt; +=C2=A0 =C2=A0=
 mc-&gt;max_cpus =3D GUEST_MAX_VCPUS;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; Will this cause all=
ocations of data structures with 128 elements?<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; Looking at hw/xen/x=
en-hvm-common.c:xen_do_ioreq_register it seems<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; possible? Or hw/xen=
/xen-hvm-common.c:xen_do_ioreq_register is called<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; Yes, in theory there&#39=
;s probably overhead with this but as you correctly<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; noted below, a PVH aware=
 xl will set the max_cpus option to a lower value.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; With a non-pvh aware xl,=
 I was a little worried about the overhead<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; but I couldn&#39;t see a=
ny visible slow-down on ARM neither in boot or in network<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; performance (I didn&#39;=
t run very sophisticated benchmarks).<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; What do you mean by &quot;non=
-pvh aware xl&quot;? All useful versions of xl<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; support pvh?<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; I mean an xl without our PVH patch=
es merged.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; xl in upstream doesn&#39;t know mu=
ch about PVH yet.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; Even for ARM, we&#39;re still carr=
ying significant patches in our tree.<br>
&gt;&gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 Oh I see. In that case, I don&#39;t thi=
nk we need to support &quot;non-pvh aware xl&quot;.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; later on with the p=
recise vCPU value which should be provided to QEMU<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; via the -smp comman=
d line option<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; &gt; (tools/libs/light/l=
ibxl_dm.c:libxl__build_device_model_args_new)?<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; Yes, a pvh aware xl will=
 for example pass -smp 2,maxcpus=3D4 based on<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; values from the xl.cfg. =
If the user doesn&#39;t set maxvcpus in xl.cfg, xl<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; &gt; will set maxvcpus to the=
 same value as vcpus.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; OK good. In that case if this=
 is just an initial value meant to be<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; &gt; overwritten, I think it is be=
st to keep it as 1.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; Sorry but that won&#39;t work. I t=
hink the confusion here may be that<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; it&#39;s easy to mix up mc-&gt;max=
_cpus and machine-&gt;smp.max_cpus, these are<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; not the same. They have different =
purposes.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; I&#39;ll try to clarify the 3 valu=
es in play.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; machine-smp.cpus:<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; Number of guest vcpus active at bo=
ot.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; Passed to QEMU via the -smp comman=
d-line option.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; We don&#39;t use this value in QEM=
U&#39;s ARM PVH machines.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; machine-&gt;smp.max_cpus:<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; Max number of vcpus that the guest=
 can use (equal or larger than machine-smp.cpus).<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; Will be set by xl via the &quot;-s=
mp X,maxcpus=3DY&quot; command-line option to QEMU.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; Taken from maxvcpus from xl.cfg, s=
ame as XEN_DMOP_nr_vcpus.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; This is what we use for xen_regist=
er_ioreq().<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; mc-&gt;max_cpus:<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; Absolute MAX in QEMU used to cap t=
he -smp command-line options.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; If xl tries to set -smp (machine-&=
gt;smp.max_cpus) larger than this, QEMU will bail out.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; Used to setup xen_register_ioreq()=
 ONLY if -smp maxcpus was NOT set (i.e by a non PVH aware xl).<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; Cannot be 1 because that would lim=
it QEMU to MAX 1 vcpu.<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; I guess we could set mc-&gt;max_cp=
us to what XEN_DMOP_nr_vcpus returns but I&#39;ll<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; have to check if we can even issue=
 that hypercall this early in QEMU since<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; mc-&gt;max_cpus is setup before we=
 even parse the machine options. We may<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 &gt; not yet know what domid we&#39;re =
attaching to yet.<br>
&gt;&gt;<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 If mc-&gt;max_cpus is the absolute max =
and it will not be used if -smp is<br>
&gt;&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 passed to QEMU, then I think it is OK t=
o use GUEST_MAX_VCPUS<br>
&gt;&gt;<br>
&gt;&gt; Looking at this a little more. If users (xl) don&#39;t pass an -sm=
p option we actually default to smp.max_cpus=3D1.<br>
&gt;&gt; So, another option is to simply remove the upper limit in QEMU (e.=
g we can set mc-&gt;max_cpus to something very large like UINT32_MAX).<br>
&gt;&gt; That would avoid early hypercalls, avoid using GUEST_MAX_VCPUS and=
 always let xl dictate the max_cpus value using the -smp cmdline option.<br=
>
&gt; <br>
&gt; As the expectation is that there will be always a smp.max_cpus option<=
br>
&gt; passed to QEMU, I would avoid an extra early hypercall.<br>
&gt; <br>
&gt; For the initial value, I would use something static and large, but not=
<br>
&gt; unreasonably large as UINT32_MAX to be more resilient in (erroneous)<b=
r>
&gt; cases where smp.max_cpus is not passed.<br>
&gt; <br>
&gt; So I would initialize it to GUEST_MAX_VCPUS, or if we don&#39;t want t=
o use<br>
&gt; GUEST_MAX_VCPUS, something equivalent in the 64-256 range.<br></blockq=
uote><div><br></div><div>Thanks Stefano,</div><div><br></div><div>I&#39;m g=
oing to send a v2 following this suggestion of using=C2=A0GUEST_MAX_VCPUS.<=
/div><div>Will also add comments clarifying that this is a MAX value for th=
e command-line option</div><div>and not what gets passed to register_ioreq.=
</div><div>We can continue the discussion from there to see if we want to c=
hange things,</div><div>I don&#39;t have a strong opinion here so I&#39;m h=
appy to go either way.</div><div><br></div><div>=C2=A0</div><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid =
rgb(204,204,204);padding-left:1ex">
&gt; <br>
&gt; Alternative we can have a runtime check and exit with a warning if<br>
&gt; smp.max_cpus is not set.<br>
<br>
FYI, xl only passes a -smp option when the domU has more than 1 vcpu. <br>
Though that implies only a single vcpu.<br><br></blockquote><div><br></div>=
<div>Thanks Jason, yes, in that case the default of cpus=3D1, maxcpus=3D1 g=
ets set. I was initially under the wrong assumption that without -smp optio=
ns, the max would get set.</div><div>This is what I was trying to clarify i=
n my previous email:</div><div>&gt;&gt; Looking at this a little more. If u=
sers (xl) don&#39;t pass an -smp option we actually default to smp.max_cpus=
=3D1.</div><div><br></div><div>Best regards,</div><div>Edgar</div></div></d=
iv>

--00000000000047d8ac06201e0744--


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:15:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:15:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780477.1190088 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPdn-0003kA-Px; Tue, 20 Aug 2024 14:15:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780477.1190088; Tue, 20 Aug 2024 14:15:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPdn-0003k3-Ls; Tue, 20 Aug 2024 14:15:19 +0000
Received: by outflank-mailman (input) for mailman id 780477;
 Tue, 20 Aug 2024 14:15:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=z0MZ=PT=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sgPdm-0003ju-Kk
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:15:18 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a04fe85c-5efe-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 16:15:17 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-53345604960so377397e87.3
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:15:17 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-53343326861sm146422e87.71.2024.08.20.07.15.15
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Aug 2024 07:15:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a04fe85c-5efe-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724163317; x=1724768117; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=uzWAAfLKFbsQQ05t2qG5hZcgvC6eXvnDrAFcILhFgM0=;
        b=ZLjvqpsWzOTuwBnpwORU9hN2THkOHNjhgmj4qiNaawtL1h4sN+VqONZlhE2Tm2yYBj
         OadB6WJPWrEjNXRQDTpFgDNr+Mk8ZUrzwTA4V/DvNP75FLuo7HO0W6Ch71KWbf6p6H7j
         DUIHyJeXhWfpHNZ3pa++rvqGhTlNH7AWst0vgiirxYXM11uvbWEBXQtc+KyJs/WCdsc8
         XGP0QN3oDvWXXPUZy1uqJYS+FIssmPpKmX79U0T5AOX886Vb7WPcpJnHe0cThFrOAtd/
         mY2FvIOHNW8L5xi1e3DZA8tq7ZX7EZuNsz/N6flqUbHw0XupbdsH25SylA0suZ90Jcet
         W4PQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724163317; x=1724768117;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=uzWAAfLKFbsQQ05t2qG5hZcgvC6eXvnDrAFcILhFgM0=;
        b=ubLOVQ17mTPDiREzeDQohWsaXAy1cysl+6q3AVCur0wSyaK/dR/iMpaNoOM9/yOABm
         4SlKiAikhoLygmWXa1Ss0+mWhe33CvD963U8Gz6lVNqIGGsIb7x7dRlvfwrY4i0oqaxt
         58vRQomSdN47Li2slF+bXaHQdkfYWCL1GvTvw2s+peIVYA++1VRIb+KpEqRA+TXBQfRW
         3jwtw3pZFqtPyeC+tvxOvjaKv1avDz77of1n33+Nix10ZV3r2SAQ7q/WmIbiR17BhJEk
         oNG5k30/6Le2BzVGxxinjAGGgUhYASzAJ07wRk3hoqkOcvHDQlKDmaao1YgIzhNyAa8l
         AuAg==
X-Forwarded-Encrypted: i=1; AJvYcCWUjHiOovk+xYu1aToUQd9oG62C4rZDMg1azDgVzjBm4tOKekJ17NvjJSMbke8iDxLxojFFJ+iVp7k=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzyAGSHde/X88t3o8z/LFsrUaXRUnfF1l4W2iobsMJFrxGaH6CX
	eV5sR9PTDbDrka3hF/NR6IAJZmdu2sS+IEQZdeAnO1vdPuPYSnxO
X-Google-Smtp-Source: AGHT+IEe3yVfE6cA6k05poEWhZk2WuanYNHRUetMh6XSFY7+ktOx1N7GIt9TCztFNrT5A5Szt/e8rg==
X-Received: by 2002:a05:6512:1086:b0:52e:bf53:1c2b with SMTP id 2adb3069b0e04-5331c692d51mr9954183e87.12.1724163316319;
        Tue, 20 Aug 2024 07:15:16 -0700 (PDT)
Message-ID: <0cd14d64dbaccc75f76c85b1ee248c80bf60d224.camel@gmail.com>
Subject: Re: [XEN PATCH v13 1/6] xen/pci: Add hypercall to support reset of
 pcidev
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>, "Chen, Jiqian" <Jiqian.Chen@amd.com>, 
 Stefano Stabellini <sstabellini@kernel.org>, Bertrand Marquis
 <bertrand.marquis@arm.com>, Julien Grall <julien@xen.org>,  Michal Orzel
 <michal.orzel@amd.com>, Rahul Singh <Rahul.Singh@arm.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Roger Pau
 =?ISO-8859-1?Q?Monn=E9?= <roger.pau@citrix.com>, Wei Liu <wl@xen.org>,
 George Dunlap <gwd@xenproject.org>,  Anthony PERARD
 <anthony@xenproject.org>, Juergen Gross <jgross@suse.com>, "Daniel P .
 Smith" <dpsmith@apertussolutions.com>, "Hildebrand, Stewart"
 <Stewart.Hildebrand@amd.com>, "Huang, Ray" <Ray.Huang@amd.com>, 
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Date: Tue, 20 Aug 2024 16:15:15 +0200
In-Reply-To: <1e0eee6c-0dcd-4ed4-970f-3d7e569cec09@suse.com>
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
	 <20240816110820.75672-2-Jiqian.Chen@amd.com>
	 <50717151-3098-491f-9dfb-71ebaff4b684@suse.com>
	 <BL1PR12MB58498DC98719ED77DA950478E78D2@BL1PR12MB5849.namprd12.prod.outlook.com>
	 <1e0eee6c-0dcd-4ed4-970f-3d7e569cec09@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Tue, 2024-08-20 at 09:01 +0200, Jan Beulich wrote:
> I further question the related part of [2]: Why did the stub need
> moving?
The following stub could be return to Arm's asm/pci.h:
```
static inline bool is_pci_passthrough_enabled(void)
{
    return false;
}
```
As at the moment it used only by common code in physdev.c which is
enabled only in case when CONFIG_HAS_PCI=3Dy so
is_pci_passthrough_enabled() will be anyway defined in arch specific
files when CONFIG_HAS_PCI=3Dy.

The reason why this stub here is that when  CONFIG_HAS_PCI=3Dn then my
understanding is that is_pci_passthrough_enabled can't return any value
except false and not to generate the same stub for each newly
introduced architecture but there are architecture which are using this
stub. As for example, in Arm this stub is used even if CONFIG_HAS_PCI=3Dn
and it will start to fail compilation as <asm/pci.h> is not included by
xen/pci.h anymore.

> I'm not even sure that part of the change fell under the Suggested-
> by:
> there, but I also can't exclude it (I didn't bother trying to find
> where
> the suggestion was made).
IIRC and it is really matters now then Suggested-by: was added because
it was suggested by you to use just ifdef-ing asm/pci.h instead of
arch-specific header or a header in asm-generic.

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:17:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:17:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780485.1190099 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPfv-00053K-5F; Tue, 20 Aug 2024 14:17:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780485.1190099; Tue, 20 Aug 2024 14:17:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPfv-00053D-0q; Tue, 20 Aug 2024 14:17:31 +0000
Received: by outflank-mailman (input) for mailman id 780485;
 Tue, 20 Aug 2024 14:17:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgPft-00052u-8c
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:17:29 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ee0a94d3-5efe-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 16:17:28 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a8643a6bd55so135356466b.3
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:17:28 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383935636sm765467766b.108.2024.08.20.07.17.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 07:17:27 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ee0a94d3-5efe-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724163447; x=1724768247; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=xIFu3eXXC6BZWMtQvTcfkJ9FTyBOmbeQdTdtEp0Sch8=;
        b=cHyT56E3v81oPNBEmkMiUtLE5UQrip47OIPImFRSwI7e5FSpPisRq+v3avlCjmUdNz
         4R0XfgpyRKAykQpOqmubHAg0F3VkJ0bXHdNZyzxZybYEJ9WYJoXqamahJF9BM+igPxLB
         vHJMQ+PW/D32u6Uk8wNsuTIKKPuS+Vo/AKMDKe9QQQ6m8VKeLyULcNo7etgO/0iOiQwh
         8lWnKyC/YHkkuhOGrS9Mdt5eg7KO7G0UzqR2yrGR3Vwq8RwW/smoAIThsUE9G8bMVPsn
         po37Z/V9ZJkxHMC3DpL4J57brJ/Rz5iq9a8r8TWKhVwzn7drznr1qTusV+lmrkWqp2Pt
         EmZQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724163447; x=1724768247;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :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=xIFu3eXXC6BZWMtQvTcfkJ9FTyBOmbeQdTdtEp0Sch8=;
        b=wGwWL6CVKuk2W0tGW7V8iMx7KnWdWTR/2Sfqpmtg9t6vaDymikaoO5lF467IxDWQJY
         KvI5w6Luc4bnkg6Fxd0/ccUlYK4IrKivK5QIFM9uijABXyUzf6ve4WRKjtr2SzLA6OIZ
         cahr19NDdOYacEeEssUZMyzanduVSkSDqBpjEnqF7JJbbcIiMuGJGvH6UHYvjORrsUuU
         yxfKaE/x5ggwBGj/NaM16yDle9nC12AT0RuwqeL2JlcL863QPspXPR8qpjwD3Th5N4Ta
         2+gM8v9kAtDweX0dGrYkQ1/uom164nWw6o7rpjt6PV8DHEUvzFZbn6fsmFxsqyDCfSlc
         m4lw==
X-Forwarded-Encrypted: i=1; AJvYcCUOVLEF5VEhX8mT92eWHGp0Yqs+ELkM3eE6m7pFfLvE/PatiLCKAAV8cSG2eF1mefGf4UwL/JSez4s=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxUmXpY5oK/DXImyNtimTnCDq5uZ4zCtcpZzt8L+QzZy4W7RZUG
	iMT8VLdjLCE+kixrlKmHetLGbR8HrUPDd/T06AJv/q8/QkmQKiYnVcJNm6aeKw==
X-Google-Smtp-Source: AGHT+IFU4QOgvTusAyGVO9nsb/NTDKNuuPSsoNaSykI7s319YjH2juS6on/uTmstZZRx2aczxHfupA==
X-Received: by 2002:a17:907:e663:b0:a72:af8e:15af with SMTP id a640c23a62f3a-a83929f12bcmr1035284266b.49.1724163447406;
        Tue, 20 Aug 2024 07:17:27 -0700 (PDT)
Message-ID: <6e9715ba-7c49-426e-bff4-7569638c0a4b@suse.com>
Date: Tue, 20 Aug 2024 16:17:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/3] mini-os: mm: introduce generic page table walk
 function
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
 Juergen Gross <jgross@suse.com>
References: <20240813134158.580-1-jgross@suse.com>
 <20240813134158.580-2-jgross@suse.com>
 <20240820115248.34qg23znyx5qoh37@begin>
Content-Language: en-US
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+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: <20240820115248.34qg23znyx5qoh37@begin>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 20.08.2024 13:52, Samuel Thibault wrote:
> Juergen Gross, le mar. 13 août 2024 15:41:56 +0200, a ecrit:
>> 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>
> 
> Reviewed-by: SAmuel Thibault <samuel.thibault@ens-lyon.org>

Samuel - I've taken the liberty to convert the odd upper-case A.

Jürgen - looking at the mini-os short-log is quite odd, and increasingly
so. In the mini-os repo surely all commits are about mini-os; the
subject prefixes are kind of pointless. To nevertheless identify such
patches on xen-devel@, may I suggest to use (taking this patch as an
example) "[PATCH MINI-OS] mm: introduce generic page table walk function"
instead (or, of course, whatever variation thereof you may like better)?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:20:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:20:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780496.1190112 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPiq-0006bG-J6; Tue, 20 Aug 2024 14:20:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780496.1190112; Tue, 20 Aug 2024 14:20:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPiq-0006b9-GL; Tue, 20 Aug 2024 14:20:32 +0000
Received: by outflank-mailman (input) for mailman id 780496;
 Tue, 20 Aug 2024 14:20: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=bKv/=PT=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sgPip-0006b2-8T
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:20:31 +0000
Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com
 [2a00:1450:4864:20::332])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5aa41915-5eff-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 16:20:30 +0200 (CEST)
Received: by mail-wm1-x332.google.com with SMTP id
 5b1f17b1804b1-429da8b5feaso61259265e9.2
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:20:30 -0700 (PDT)
Received: from ?IPV6:2003:e5:8741:4a00:60e5:7bee:fc48:e85c?
 (p200300e587414a0060e57beefc48e85c.dip0.t-ipconnect.de.
 [2003:e5:8741:4a00:60e5:7bee:fc48:e85c])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-429ed648f55sm143875765e9.3.2024.08.20.07.20.28
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 07:20:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5aa41915-5eff-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724163630; x=1724768430; darn=lists.xenproject.org;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=2Il+ux5E/V/afeeGHtzrrXgP0e38W/c5NX5j5utEmh8=;
        b=OMNu7KvxeS4qAuS32cTvZJ9VWpp+a3nz6z7hQS1ycJTylKxtUj2JjKD5dExTw6iyyN
         8GoQdsK5B6PwQyY3IMvR+BbH/1La3LWERx3uHWs8tlSJ1YOke3ZZlAt8tKdWzQThK+QS
         LASGs9CVWxLXlkN3FGlw7i6r10nd9QgtfGAj1JRJ4DlCv3Twy9aNWMUNgLQ99OgpZQTg
         /oxbwyVtrMsx3zyAKokWh+JjY0n6i331Tt6vq3lVbeSeijbEzy/6gyb3U6zZqxfaueas
         zpsFwrsMfhEFXQMnztVHgCeRAZujfV0ttBnSKTVqku9hSAF6nXe79JLHZbrTTEDQ9iTR
         z9KQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724163630; x=1724768430;
        h=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=2Il+ux5E/V/afeeGHtzrrXgP0e38W/c5NX5j5utEmh8=;
        b=NPpsXALAjhKOcjeX4ay9vvJCckiuQ+35E5u1QJo5CamuirKQKamlczT9XK8V5hVACI
         3df9hSYfiSH2bfWdrTt7aSTcwM8RhYD8xRn5XQprBD6xhrCzTohiXml1fI+E9/4F7RHH
         JBAMzzQ717qTeJnYVcWE3/NlTQKGacANiXXQDKGC+tVPO9bFLU1FhenzjgzhoId91HwN
         aFMIsw/nEl77DDkGLbJMDaa4g2DNmBCnUPwaYTiYlTIXTqeFrZ6sw/rW5op32//t6QN/
         bl9a1ThNzAxtXhEbxYF8Uu/D+cXbjTOPyFmbVKmJIaSP5oIQmR3Sfvhqzn5J7ivSTYBQ
         w4hA==
X-Forwarded-Encrypted: i=1; AJvYcCWUnrki1MLlDKKLIkBdBKJXaziZ1SQVtoPaE6Mez7uAW5ZOqZe8tO4s2y88GsHSCYdEX3TJY06FiiY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxBIXY4SuBijksvdG1ztHJtrQbJyKuWPXNl4w6zfqZ7qgV6pvaO
	AVKogWgK3pMjpiSepjxrk7iSRvjGKi4GGbvWxb+s3OqrBMKUaLFW0gJ8drvwo+p+uKWFAjvTx10
	49fk=
X-Google-Smtp-Source: AGHT+IFP1XPLJH9BZvEF0MNaTKFLkGDZMPI5hwrtY/zjkJKlEf34EaCVVbo43UTOKoImzaGPZJeSdA==
X-Received: by 2002:a05:600c:6a84:b0:426:6714:5415 with SMTP id 5b1f17b1804b1-429ed7d6497mr115067685e9.30.1724163629066;
        Tue, 20 Aug 2024 07:20:29 -0700 (PDT)
Message-ID: <89bbbc7b-4fda-4a14-a1a3-1c4b2b708691@suse.com>
Date: Tue, 20 Aug 2024 16:20:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/3] mini-os: mm: introduce generic page table walk
 function
To: Jan Beulich <jbeulich@suse.com>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org
References: <20240813134158.580-1-jgross@suse.com>
 <20240813134158.580-2-jgross@suse.com>
 <20240820115248.34qg23znyx5qoh37@begin>
 <6e9715ba-7c49-426e-bff4-7569638c0a4b@suse.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <6e9715ba-7c49-426e-bff4-7569638c0a4b@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------T3f1gwaTgc6mWkcrHnc884aY"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------T3f1gwaTgc6mWkcrHnc884aY
Content-Type: multipart/mixed; boundary="------------OnYoWn5K2iIAfHc3Bm0JM2UH";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>,
 Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org
Message-ID: <89bbbc7b-4fda-4a14-a1a3-1c4b2b708691@suse.com>
Subject: Re: [PATCH v2 1/3] mini-os: mm: introduce generic page table walk
 function
References: <20240813134158.580-1-jgross@suse.com>
 <20240813134158.580-2-jgross@suse.com>
 <20240820115248.34qg23znyx5qoh37@begin>
 <6e9715ba-7c49-426e-bff4-7569638c0a4b@suse.com>
In-Reply-To: <6e9715ba-7c49-426e-bff4-7569638c0a4b@suse.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJ3BBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AAIQkQoDSui/t3IH4WIQQ+pJkfkcoLMCa4X6CgNK6L+3cgfgn7AJ9DmMd0SMJE
 ePbc7/m22D2v04iu7ACffXTdZQhNl557tJuDXZSBxDmW/tLOwU0EWTecRBAIAIK5OMKMU5R2
 Lk2bbjgX7vyQuCFFyKf9rC/4itNwhYWFSlKzVj3WJBDsoi2KvPm7AI+XB6NIkNAkshL5C0kd
 pcNd5Xo0jRR5/WE/bT7LyrJ0OJWS/qUit5eNNvsO+SxGAk28KRa1ieVLeZi9D03NL0+HIAtZ
 tecfqwgl3Y72UpLUyt+r7LQhcI/XR5IUUaD4C/chB4Vq2QkDKO7Q8+2HJOrFIjiVli4lU+Sf
 OBp64m//Y1xys++Z4ODoKh7tkh5DxiO3QBHG7bHK0CSQsJ6XUvPVYubAuy1XfSDzSeSBl//C
 v78Fclb+gi9GWidSTG/4hsEzd1fY5XwCZG/XJJY9M/sAAwUH/09Ar9W2U1Qm+DwZeP2ii3Ou
 14Z9VlVVPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------OnYoWn5K2iIAfHc3Bm0JM2UH
Content-Type: multipart/mixed; boundary="------------exqA0MCtwvwHdgR5Fmv0pvth"

--------------exqA0MCtwvwHdgR5Fmv0pvth
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjAuMDguMjQgMTY6MTcsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAyMC4wOC4yMDI0
IDEzOjUyLCBTYW11ZWwgVGhpYmF1bHQgd3JvdGU6DQo+PiBKdWVyZ2VuIEdyb3NzLCBsZSBt
YXIuIDEzIGFvw7t0IDIwMjQgMTU6NDE6NTYgKzAyMDAsIGEgZWNyaXQ6DQo+Pj4gSW4geDg2
IG1tIGNvZGUgdGhlcmUgYXJlIG11bHRpcGxlIGluc3RhbmNlcyBvZiBwYWdlIHRhYmxlIHdh
bGtzIGZvcg0KPj4+IGRpZmZlcmVudCBwdXJwb3Nlcy4NCj4+Pg0KPj4+IEludHJvZHVjZSBh
IGdlbmVyaWMgcGFnZSB0YWJsZSB3YWxrZXIgYmVpbmcgYWJsZSB0byBjb3ZlciB0aGUgY3Vy
cmVudA0KPj4+IHVzZSBjYXNlcy4gSXQgd2lsbCBiZSB1c2VkIGZvciBvdGhlciBjYXNlcyBp
biBmdXR1cmUsIHRvby4NCj4+Pg0KPj4+IFRoZSBwYWdlIHRhYmxlIHdhbGtlciBuZWVkcyBz
b21lIHBlci1sZXZlbCBkYXRhLCBzbyBhZGQgYSB0YWJsZSBmb3INCj4+PiB0aGF0IGRhdGEu
IE1lcmdlIGl0IHdpdGggdGhlIGFscmVhZHkgZXhpc3RpbmcgcHRfcHJvdFtdIGFycmF5Lg0K
Pj4+DQo+Pj4gUmV3cml0ZSBnZXRfcGd0KCkgdG8gdXNlIHRoZSBuZXcgd2Fsa2VyLg0KPj4+
DQo+Pj4gU2lnbmVkLW9mZi1ieTogSnVlcmdlbiBHcm9zcyA8amdyb3NzQHN1c2UuY29tPg0K
Pj4NCj4+IFJldmlld2VkLWJ5OiBTQW11ZWwgVGhpYmF1bHQgPHNhbXVlbC50aGliYXVsdEBl
bnMtbHlvbi5vcmc+DQo+IA0KPiBTYW11ZWwgLSBJJ3ZlIHRha2VuIHRoZSBsaWJlcnR5IHRv
IGNvbnZlcnQgdGhlIG9kZCB1cHBlci1jYXNlIEEuDQo+IA0KPiBKw7xyZ2VuIC0gbG9va2lu
ZyBhdCB0aGUgbWluaS1vcyBzaG9ydC1sb2cgaXMgcXVpdGUgb2RkLCBhbmQgaW5jcmVhc2lu
Z2x5DQo+IHNvLiBJbiB0aGUgbWluaS1vcyByZXBvIHN1cmVseSBhbGwgY29tbWl0cyBhcmUg
YWJvdXQgbWluaS1vczsgdGhlDQo+IHN1YmplY3QgcHJlZml4ZXMgYXJlIGtpbmQgb2YgcG9p
bnRsZXNzLiBUbyBuZXZlcnRoZWxlc3MgaWRlbnRpZnkgc3VjaA0KPiBwYXRjaGVzIG9uIHhl
bi1kZXZlbEAsIG1heSBJIHN1Z2dlc3QgdG8gdXNlICh0YWtpbmcgdGhpcyBwYXRjaCBhcyBh
bg0KPiBleGFtcGxlKSAiW1BBVENIIE1JTkktT1NdIG1tOiBpbnRyb2R1Y2UgZ2VuZXJpYyBw
YWdlIHRhYmxlIHdhbGsgZnVuY3Rpb24iDQo+IGluc3RlYWQgKG9yLCBvZiBjb3Vyc2UsIHdo
YXRldmVyIHZhcmlhdGlvbiB0aGVyZW9mIHlvdSBtYXkgbGlrZSBiZXR0ZXIpPw0KDQpPa2F5
LCBmaW5lIHdpdGggbWUuDQoNCg0KSnVlcmdlbg0KDQo=
--------------exqA0MCtwvwHdgR5Fmv0pvth
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-----

--------------exqA0MCtwvwHdgR5Fmv0pvth--

--------------OnYoWn5K2iIAfHc3Bm0JM2UH--

--------------T3f1gwaTgc6mWkcrHnc884aY
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/Ey8FAmbEpisFAwAAAAAACgkQsN6d1ii/Ey9g
FQf/cos49PwJfKBuHZAaKejlt9TYDDpsJbCEfOVuCOlPZBBIL2yi9Pw70/bZSYBJJxbX1/x/iNgm
LzIcUM73yP6gT1vKS94E1O/15jKLYHPxFgJibLqldcRV47HnXi3O563EuQUzdQMs3FhHkl5WgOAn
pYWnZgTW3gBaZUK7y9z4Y3+OUsk1XZtAT0bQ9eUMVJOlkt+iVmBYZOh4+XIIEFNsqQ//adgkos9u
4ojnkMCKjyZNMjZutOr7/oqcvSEiFqn3laSHRE1jBfGJt7pT84/PmjpcS5snmQUOXOcHv6Yr6zQ3
ImIML77Vkod81jVBIXHaVuEuPY8fawuOE/uJiUjobA==
=adaS
-----END PGP SIGNATURE-----

--------------T3f1gwaTgc6mWkcrHnc884aY--


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:20:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:20:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780504.1190130 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPj9-00074X-VC; Tue, 20 Aug 2024 14:20:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780504.1190130; Tue, 20 Aug 2024 14:20:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPj9-00074Q-Se; Tue, 20 Aug 2024 14:20:51 +0000
Received: by outflank-mailman (input) for mailman id 780504;
 Tue, 20 Aug 2024 14:20:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=2WjV=PT=ens-lyon.org=samuel.thibault@bounce.ens-lyon.org>)
 id 1sgPj9-0006b2-7b
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:20:51 +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 65e1ffad-5eff-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 16:20:49 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by sonata.ens-lyon.org (Postfix) with ESMTP id E13FDA03B3;
 Tue, 20 Aug 2024 16:20:48 +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 dKIHqWii6n_r; Tue, 20 Aug 2024 16:20:48 +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 AF42CA03B1;
 Tue, 20 Aug 2024 16:20:48 +0200 (CEST)
Received: from samy by begin with local (Exim 4.98)
 (envelope-from <samuel.thibault@ens-lyon.org>)
 id 1sgPj6-00000000UFy-1Xn6; Tue, 20 Aug 2024 16:20:48 +0200
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 65e1ffad-5eff-11ef-a507-bb4a2ccca743
Date: Tue, 20 Aug 2024 16:20:48 +0200
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: Juergen Gross <jgross@suse.com>, minios-devel@lists.xenproject.org,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 1/3] mini-os: mm: introduce generic page table walk
 function
Message-ID: <20240820142048.27m346n5xzj5fi43@begin>
Mail-Followup-To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
	Jan Beulich <jbeulich@suse.com>, Juergen Gross <jgross@suse.com>,
	minios-devel@lists.xenproject.org, xen-devel@lists.xenproject.org
References: <20240813134158.580-1-jgross@suse.com>
 <20240813134158.580-2-jgross@suse.com>
 <20240820115248.34qg23znyx5qoh37@begin>
 <6e9715ba-7c49-426e-bff4-7569638c0a4b@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <6e9715ba-7c49-426e-bff4-7569638c0a4b@suse.com>
Organization: I am not organized
User-Agent: NeoMutt/20170609 (1.8.3)

Jan Beulich, le mar. 20 août 2024 16:17:26 +0200, a ecrit:
> On 20.08.2024 13:52, Samuel Thibault wrote:
> > Juergen Gross, le mar. 13 août 2024 15:41:56 +0200, a ecrit:
> >> 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>
> > 
> > Reviewed-by: SAmuel Thibault <samuel.thibault@ens-lyon.org>
> 
> Samuel - I've taken the liberty to convert the odd upper-case A.

Oh, sure, thanks :)

Samuel


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:30:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:30:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780529.1190163 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPrz-0000ot-8T; Tue, 20 Aug 2024 14:29:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780529.1190163; Tue, 20 Aug 2024 14:29:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPrz-0000om-3y; Tue, 20 Aug 2024 14:29:59 +0000
Received: by outflank-mailman (input) for mailman id 780529;
 Tue, 20 Aug 2024 14:29: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=prYO=PT=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sgPrx-0000aG-HF
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:29:57 +0000
Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com
 [2a00:1450:4864:20::12b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ab6092fd-5f00-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 16:29:55 +0200 (CEST)
Received: by mail-lf1-x12b.google.com with SMTP id
 2adb3069b0e04-52f042c15e3so5074670e87.0
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:29:55 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5330d3afa66sm1772714e87.7.2024.08.20.07.29.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Aug 2024 07:29:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ab6092fd-5f00-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724164195; x=1724768995; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=0FTAVDz3Cw1uxIbhjmeqEYJqdjw34VbylOmDWLTwvx4=;
        b=Pv+9M6vVEbSwAJuAlkobDMMPJtHMCYxzhqrOAsgnyJIf1ThWa4pvvoiFgxWqEsDJPC
         sASGLUjxrLp51zxWLTSjXUFyVqUHVQYIBY/RBl3eYpxl0lbuOWAeTYB6QIPKUyh+dBuP
         6itpLGM3+968I25iJTrwMRm27MvG6qQLVnsTHPkPNUU1LlB5BoyM/DynSxrHnWha3xOJ
         A6yPChTQ594IqsBJbUDaghSyv5wkr8svAdPHpIP+7al0FlizdpVjcidmXPW016nEmzpL
         CF+Da9RUxtngVgg25M26xzPbxqNuHfcJObPK1VMQiC+fC9wOdlO0h2prtDL4Sbdb8ZIW
         tcXQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724164195; x=1724768995;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=0FTAVDz3Cw1uxIbhjmeqEYJqdjw34VbylOmDWLTwvx4=;
        b=uQ5/B7pkbgFfGVPfx4TKZYdWKz2CzD4gkuyRbky2iBkDMjAUbnIP4ysL1mYcM3lUpC
         aXZ1WrG6GAJ7/b46FClMWuqrqRDGon1bsTPKbX2QHIo9Ltq8zbKSmGTumBjHdlNFYgbt
         Y9p1925vjXxiJjbL4gUn4tRHITum/NnNybf1OGHDTHvgLTN3yMCYImMFdWpapZakUlPC
         BuiVM8IsxWLIJ5Y9hc4qPf4jxDN/lshHc3dJTWTv+EV+K97neCR4daJEU3CNBHS5yo85
         /J1qKVDTPs+EvtNX509RyOv72wr3Ekrdrp6Q0G38BK/Uu+kMF/Nq7FUo1+WwHMVe5Tof
         vSuA==
X-Forwarded-Encrypted: i=1; AJvYcCUm4GsCKPeMs8N3oX2nvrIfI8q+OPwoA/gt4nRXERYwK2zpCmGENVoJN8hAIeneFvHMd2H2N5QWGxnYXy+Y7HWVKaLgnZmvTHb9HIz4nyQ=
X-Gm-Message-State: AOJu0YyZUw8srg1J4YxqpW62dTK8gqykQckxiL1r4Mu/MPDD1OiroRtl
	syKmruSuBm3pU3gitH4oXE0I7ICFlzpZCZKUPtFBU5AUeVxZ+GTG
X-Google-Smtp-Source: AGHT+IFrPcDRBYvfqjcvKbmWjLtw+0FlYqh8Z0iVHC/dcsRC/BqjVUCiAdvRhyukGAYN9Iw59X5/Ew==
X-Received: by 2002:a05:6512:2824:b0:533:415e:cd9a with SMTP id 2adb3069b0e04-533415ee2demr694896e87.23.1724164194086;
        Tue, 20 Aug 2024 07:29:54 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org
Subject: [PATCH v2 01/12] MAINTAINERS: Add docs/system/arm/xenpvh.rst
Date: Tue, 20 Aug 2024 16:29:38 +0200
Message-ID: <20240820142949.533381-2-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820142949.533381-1-edgar.iglesias@gmail.com>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3584d6a6c6..c2fb0c2f42 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -559,6 +559,7 @@ F: include/hw/xen/
 F: include/sysemu/xen.h
 F: include/sysemu/xen-mapcache.h
 F: stubs/xen-hw-stub.c
+F: docs/system/arm/xenpvh.rst
 
 Guest CPU Cores (NVMM)
 ----------------------
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:30:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:30:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780528.1190151 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPry-0000aY-0X; Tue, 20 Aug 2024 14:29:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780528.1190151; Tue, 20 Aug 2024 14:29:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPrx-0000aR-UE; Tue, 20 Aug 2024 14:29:57 +0000
Received: by outflank-mailman (input) for mailman id 780528;
 Tue, 20 Aug 2024 14:29:56 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=prYO=PT=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sgPrw-0000aG-RE
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:29:56 +0000
Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com
 [2a00:1450:4864:20::234])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id aada759f-5f00-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 16:29:54 +0200 (CEST)
Received: by mail-lj1-x234.google.com with SMTP id
 38308e7fff4ca-2f15790b472so68137721fa.0
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:29:54 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f3b748db7dsm18217371fa.36.2024.08.20.07.29.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Aug 2024 07:29:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aada759f-5f00-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724164194; x=1724768994; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=1wqHo/ZnPjHlrmdKYJtuWm38+7FAW/gtzhAalcKMwBA=;
        b=g2ETv82fv0C64EwJ5L/+NsC6NLtjZkhQuECLnFl8aj/i4GFu1j7X780PL3uA33lg0T
         hHLMIs6g9zzsbPUGgyfzAn14S69ufQRnyViy0/ItHj8zVmiXzBobIt6IYL0Hg96/rZA8
         bAZsBvb/I5dfcR/Q54gc+9d9LbjgexLDjBEdFd+oCJ3pBkPdNUxMHd6CB5Hr5PUNUNmw
         1XjLitki5v8Rc/vHIUlWMHgyvxskenQ6JHrEWl1n7Ei6l7tUIJUDbopkLQK6uAIvWz/Y
         AaRxHvtJeSIAVHXJB/eFCCliA9dfE1T8uuYzM1mDHOCtyEHDwFnYBmnwlc2Lp3BIwqex
         wMvg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724164194; x=1724768994;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=1wqHo/ZnPjHlrmdKYJtuWm38+7FAW/gtzhAalcKMwBA=;
        b=jsmBq15pVxQVtLzho9Tg5fqTFP12sZ3peeqJG1HAO93vSRFxpmwJPEs8ntKFquO/yn
         vSe+guw4zmjmaMtvoXux63U/zf6771bJ3IvYdVc0/O4cVtpOdPbqECfCmdDgd2Thhmi9
         v9ZlXnyVLMOotjyXpj//ARb/TlmIqNv7PMd8QzOD9bJE5EFcqBoH+cexn3et0GaN6XHt
         V5Li7236Hbhinb6DihN3WSuZHGRFO41ZQmY5gaMuxSkVZSv1o9fKRwQ6L2uxggf9ZnDk
         SV4SgsvMmXG/GyYHzMhci0LOg0lV7nKZY2lzuPBC6ZhXeNFIzif5zlu9x4hdvq31ps1C
         pL7A==
X-Forwarded-Encrypted: i=1; AJvYcCXj2yyfGHHZC6eMmEOqGuHdEof2uKYHL1XfIPkCyYqYUNPsUToJIN/kaOwrJ0/E9tSiN8wkTF2sLOc=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzuwu3Fq3T2M0hU2l/OW19jotWOma92hhU+m3iZT13lHo9SivRs
	RTnJjgQfXfW6RgxbUEpxDPWTPcEGbk216I4ZvnS+fDSnIwtlwX+e
X-Google-Smtp-Source: AGHT+IHmXoWvrk+gxIHZjEW1LKuL3xcHNfeuaWwnRfQPlxHkqzHlE5tf/66Ts3wZhxRwZDt8IqN6DQ==
X-Received: by 2002:a05:651c:199e:b0:2ef:296d:1dda with SMTP id 38308e7fff4ca-2f3be57810fmr104068131fa.1.1724164193085;
        Tue, 20 Aug 2024 07:29:53 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org
Subject: [PATCH v2 00/12] xen: pvh: Partial QOM:fication with new x86 PVH machine
Date: Tue, 20 Aug 2024 16:29:37 +0200
Message-ID: <20240820142949.533381-1-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

This series breaks out parts of the ARM PVH support into an abstract
machine that other targets can reuse.. There's a bit of refactoring
and some bug-fixes along the way.

Finally we add a new x86 xen-pvh machine.

The corresponding changes in Xen for PVH x86 are work in progress
(by Xenia Ragiadakou). You can find a current version here:
https://github.com/edgarigl/xen/tree/edgar/virtio-pvh-upstream 

I've briefly described the steps to run Xen PVH x86 guests here
(including example guest kernel config, xl.cfg and xl command-lines):
https://github.com/edgarigl/docs/blob/master/xen/pvh/xenpvh-x86.md

Cheers,
Edgar

ChangeLog:

v1 -> v2:
* Use an abstract PVH Machine to share code between arch specific
  PVH machines. This allows more sharing than a using a device component.
* Add comments describing our PCI INTX support.
* Allow the PVH target specific implementation to provide PCI
  INTX delivery via class methods.
* Clarify use of mc->max_cpus in comments.
* Use GUEST_MAX_VCPUS mc->max_cpus on ARM.
* Use HVM_MAX_VCPUS mc->max_cpus on x86.
* pvh-common: Directly use s->cfg. members when creating gpex.
* pvh-common: Clarify use of pci-ecam-size in comments.
* x86/xen-pvh: Create smp.max_cpus nr of dummy cores (not smp.cpus).
* x86/xen-pvh: Replace static array holding dummy cores with a dynamic one.
* Move stubbed Xen/ARM functions from hw/arm/xen_arm.c into xen-stubs.c

Edgar E. Iglesias (12):
  MAINTAINERS: Add docs/system/arm/xenpvh.rst
  hw/arm: xenpvh: Update file header to use SPDX
  hw/arm: xenpvh: Tweak machine description
  hw/arm: xenpvh: Add support for SMP guests
  hw/arm: xenpvh: Remove double-negation in warning
  hw/arm: xenpvh: Move stubbed functions to xen-stubs.c
  hw/arm: xenpvh: Break out a common PVH machine
  hw/arm: xenpvh: Rename xen_arm.c -> xen-pvh.c
  hw/arm: xenpvh: Reverse virtio-mmio creation order
  hw/xen: pvh-common: Add support for creating PCIe/GPEX
  hw/i386/xen: Add a Xen PVH x86 machine
  docs/system/i386: xenpvh: Add a basic description

 MAINTAINERS                     |   2 +
 docs/system/i386/xenpvh.rst     |  49 +++++
 docs/system/target-i386.rst     |   1 +
 hw/arm/meson.build              |   5 +-
 hw/arm/trace-events             |   5 -
 hw/arm/xen-pvh.c                |  89 ++++++++
 hw/arm/xen-stubs.c              |  32 +++
 hw/arm/xen_arm.c                | 267 -----------------------
 hw/i386/xen/meson.build         |   1 +
 hw/i386/xen/xen-pvh.c           | 121 +++++++++++
 hw/xen/meson.build              |   1 +
 hw/xen/trace-events             |   4 +
 hw/xen/xen-pvh-common.c         | 362 ++++++++++++++++++++++++++++++++
 include/hw/xen/xen-pvh-common.h |  88 ++++++++
 14 files changed, 754 insertions(+), 273 deletions(-)
 create mode 100644 docs/system/i386/xenpvh.rst
 create mode 100644 hw/arm/xen-pvh.c
 create mode 100644 hw/arm/xen-stubs.c
 delete mode 100644 hw/arm/xen_arm.c
 create mode 100644 hw/i386/xen/xen-pvh.c
 create mode 100644 hw/xen/xen-pvh-common.c
 create mode 100644 include/hw/xen/xen-pvh-common.h

-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:30:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:30:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780532.1190192 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPs2-0001Y0-0l; Tue, 20 Aug 2024 14:30:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780532.1190192; Tue, 20 Aug 2024 14:30:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPs1-0001Xr-TV; Tue, 20 Aug 2024 14:30:01 +0000
Received: by outflank-mailman (input) for mailman id 780532;
 Tue, 20 Aug 2024 14:30:00 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=prYO=PT=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sgPs0-0000aG-SY
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:30:00 +0000
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com
 [2a00:1450:4864:20::130])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id adb5a1ec-5f00-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 16:29:59 +0200 (CEST)
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-5333b2fbedaso2793478e87.0
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:29:59 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5330d41e1a0sm1782218e87.196.2024.08.20.07.29.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Aug 2024 07:29:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: adb5a1ec-5f00-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724164199; x=1724768999; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=j3FilNtR3ylHjSgCwXgc1/4kLFqGR/asrW9olruIp6U=;
        b=OSJ5Q5IR63wVFpGW3Qi0fgH573k29Nk5TPTriToFD0Yje2sMPNREql/e3dLt4dYJXn
         YKvZJKyGjudUEgiNzWg+USU07QfvwcQ2xRcXlxzoufElt6678fUPEZ78vCkMvbkAkNrs
         MWim7cRFIHoAGMezoz398ofWx7Mw4JSWsWOhvyvsC5Tp8DIbQtVe4aNJPo8ZYhV+okwQ
         4IpZ8rcOlxOePgi71hJao6TJMDf8n2yqCjOOd6x0zqAUgZVKE+Z2Lb5sJqKmM8TFwKp9
         4OWVjT/FQM2wyKDPlNOvcwbugNqM4rY3G9/rosbUg1LMfoNa/4hWds3xhCiyqnAD/W0C
         IAMw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724164199; x=1724768999;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=j3FilNtR3ylHjSgCwXgc1/4kLFqGR/asrW9olruIp6U=;
        b=gqydiQ8eVJqm6AKTBAiE91gsXiaAheroMz6h+HL0raiI6pftHqjXqqDnJdKFwbEqfT
         qVT2UIuQ3jEN1fUhtiFXpJ93rnK0ki5+RXC7Yt6RmUMF3DaK0lLqlw9IHi2VzYSkNKf7
         8L5RuGRqrVlGOV83y9OnThTTJqNkf4RsWTmkrI9VwQCIXmTaH3dXpbdT5J8G3SIs293R
         9lE5jPDUNSKAOzb+szlQdzsqkJfhCeTcM5kDxXfitlV0dTiQxrSsnsYi/g4wo9ta7YdT
         +xsv7x2aF9UvfjRmuGyVRHGprX4J/TqUyLkCACNG2OF8Da4jKSqUoBsJq60bhrwhpX2G
         Qiag==
X-Forwarded-Encrypted: i=1; AJvYcCVRv2L1ScquuuanJW9RfHCJIURQhO3I8qmgxEbAsGAw6v2b74SgBBhYNJuR+uMEC0DiOf30n+ZDaNg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyLT/4zD7nY9kZT0KEVUj/Ab7fDF6KLXjlfPkB9bzAmZkzma59m
	uKNEqH+8qC1LGKvNrf2/VRteyxdTiNE9W1Ahs6ZlqwxSsR6gXiWF
X-Google-Smtp-Source: AGHT+IGQzw9towbWt3esYv6BylqAAAmG7i8maUZip7BzOASpnZ5frQ70BGwkwxAacACbTLNukHjFrw==
X-Received: by 2002:a05:6512:224c:b0:52e:a008:8f55 with SMTP id 2adb3069b0e04-5331c6dcd38mr9613532e87.41.1724164198100;
        Tue, 20 Aug 2024 07:29:58 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	qemu-arm@nongnu.org
Subject: [PATCH v2 04/12] hw/arm: xenpvh: Add support for SMP guests
Date: Tue, 20 Aug 2024 16:29:41 +0200
Message-ID: <20240820142949.533381-5-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820142949.533381-1-edgar.iglesias@gmail.com>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Add SMP support for Xen PVH ARM guests.
Create ms->smp.max_cpus ioreq servers to handle hotplug.

Note that ms->smp.max_cpus will be passed to us by the
user (Xen tools) set to the guests maxvcpus.

The value in mc->max_cpus is an absolute maximum for the
-smp option and won't be used to setup ioreq servers unless
the user explicitly specifies it with -smp.

If the user doesn't pass -smp on the command-line, smp.cpus
and smp.max_cpus will default to 1.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 hw/arm/xen_arm.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
index 5f75cc3779..fda65d0d8d 100644
--- a/hw/arm/xen_arm.c
+++ b/hw/arm/xen_arm.c
@@ -173,7 +173,7 @@ static void xen_arm_init(MachineState *machine)
 
     xen_init_ram(machine);
 
-    xen_register_ioreq(xam->state, machine->smp.cpus, &xen_memory_listener);
+    xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener);
 
     xen_create_virtio_mmio_devices(xam);
 
@@ -218,7 +218,26 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
     MachineClass *mc = MACHINE_CLASS(oc);
     mc->desc = "Xen PVH ARM machine";
     mc->init = xen_arm_init;
-    mc->max_cpus = 1;
+
+    /*
+     * mc->max_cpus holds the MAX value allowed in the -smp command-line opts.
+     *
+     * 1. If users don't pass any -smp option:
+     *   ms->smp.cpus will default to 1.
+     *   ms->smp.max_cpus will default to 1.
+     *
+     * 2. If users pass -smp X:
+     *   ms->smp.cpus will be set to X.
+     *   ms->smp.max_cpus will also be set to X.
+     *
+     * 3. If users pass -smp X,maxcpus=Y:
+     *   ms->smp.cpus will be set to X.
+     *   ms->smp.max_cpus will be set to Y.
+     *
+     * In scenarios 2 and 3, if X or Y are set to something larger than
+     * mc->max_cpus, QEMU will bail out with an error message.
+     */
+    mc->max_cpus = GUEST_MAX_VCPUS;
     mc->default_machine_opts = "accel=xen";
     /* Set explicitly here to make sure that real ram_size is passed */
     mc->default_ram_size = 0;
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:30:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:30:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780530.1190166 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPrz-0000sJ-Fp; Tue, 20 Aug 2024 14:29:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780530.1190166; Tue, 20 Aug 2024 14:29:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPrz-0000qk-Ai; Tue, 20 Aug 2024 14:29:59 +0000
Received: by outflank-mailman (input) for mailman id 780530;
 Tue, 20 Aug 2024 14:29: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=prYO=PT=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sgPry-0000aG-JA
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:29:58 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ac1a9b63-5f00-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 16:29:56 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-530e2287825so5819145e87.1
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:29:57 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-53345d17c33sm53420e87.128.2024.08.20.07.29.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Aug 2024 07:29:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ac1a9b63-5f00-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724164196; x=1724768996; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=N6K1JnQDB3GxWbgLc2L3O0RRJjZo+EVTDK5d5nCO5jo=;
        b=VtWFmFwg0ULcOSK3l5oQscnt/p7BOR9F23GTwqr5oe6xD00h9LE/HgMxjOw/HrUIud
         X0mjOX0wonn28o9fmexWkKs7CJ6GDWLkjKG3RV0nW9IfrTrT8IpoveuoiP7Nxqpl2LUR
         iLz4K4Z452DpHtq2iDX+d3c+kRrkzMLOBk3wy0ZjnNA+bppfQYgWQBk5vQbuLwYndARJ
         BwHRJulZKWIDOd1VPdDECzi57cPjaRLgHoTtiPpXq3AeINl/9HUJR9/vHI+oQzofmwN1
         J9m7DL9DZUPB6vhu+/zRWzPZ0LgLz2BYEz4QF7MztJPAuYoN5l2ZTsO0gmk3S4E7toIb
         9hqw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724164196; x=1724768996;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=N6K1JnQDB3GxWbgLc2L3O0RRJjZo+EVTDK5d5nCO5jo=;
        b=hiMYZlsJJbjYqHE44Gx87T4dhf3Ngf3+skJe24lJzyEXOWoWqNQoN7B5bQzSL4TtZF
         qJM7KSStaYiBbhRBVOQ98MvHjfImND3TtFijOX5YtURi8YCnIDLUFrsrePt3PNeHVfuz
         DubSAE8lRpuzfrCJp69QCb5PPQ5/kKD+XlwwZkmBmFZX1gnaox9LDvUweuXODetr52He
         U3rvnSekyjQx8VD+2OO33eBBGn/sAhd1Uxgx1miyfKNQj+0Fw7PtVrZUxv39jAq17/Wt
         sjiNikYmb5nM+Idxx4bCtygx2e2VfFitJ+nbbtgY3Vw9IZyawO4eAVKCgj/ja1S9a+Cm
         Kp5Q==
X-Forwarded-Encrypted: i=1; AJvYcCU67OjIDC1AtjU2IFfHhQn3YYyDoRvtpFgIHegjewOTjV9xaFKw/hhSXgYqpohfwk0B3fLak7uFYYqEufc5YoQmnCeapiAdF1cm6WGnmrM=
X-Gm-Message-State: AOJu0YwZ8+NbgHjLiEXIZ7VSML1KhFLigLxY7nM17UKfMAa6mJwXxzHP
	57oB1H0V+43PhNkuk0uevEzWu22j8hQmRuH5LA+mBbW/D4g64TO0
X-Google-Smtp-Source: AGHT+IERWznLEeJJPBmVGgbqZsGGHpjiqbNNsmHg/7CXZqA1iSzt7K9nFEzoO0ph3Q9aeI604W1JJQ==
X-Received: by 2002:a05:6512:138b:b0:52c:e3bd:c70b with SMTP id 2adb3069b0e04-5331c690c37mr9543219e87.1.1724164195374;
        Tue, 20 Aug 2024 07:29:55 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	qemu-arm@nongnu.org
Subject: [PATCH v2 02/12] hw/arm: xenpvh: Update file header to use SPDX
Date: Tue, 20 Aug 2024 16:29:39 +0200
Message-ID: <20240820142949.533381-3-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820142949.533381-1-edgar.iglesias@gmail.com>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Update file header to use SPDX and remove stray empty
comment line.

No functional changes.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 hw/arm/xen_arm.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
index 6fad829ede..766a194fa1 100644
--- a/hw/arm/xen_arm.c
+++ b/hw/arm/xen_arm.c
@@ -1,24 +1,7 @@
 /*
  * QEMU ARM Xen PVH Machine
  *
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the 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 DEALINGS IN
- * THE SOFTWARE.
+ * SPDX-License-Identifier: MIT
  */
 
 #include "qemu/osdep.h"
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:30:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:30:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780531.1190173 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPrz-0000yG-Po; Tue, 20 Aug 2024 14:29:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780531.1190173; Tue, 20 Aug 2024 14:29:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPrz-0000w8-Jk; Tue, 20 Aug 2024 14:29:59 +0000
Received: by outflank-mailman (input) for mailman id 780531;
 Tue, 20 Aug 2024 14:29: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=prYO=PT=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sgPrz-0000m9-13
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:29:59 +0000
Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com
 [2a00:1450:4864:20::12c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ad1e8d9c-5f00-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 16:29:58 +0200 (CEST)
Received: by mail-lf1-x12c.google.com with SMTP id
 2adb3069b0e04-53301d46c54so7426939e87.2
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:29:58 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5330d3b8f77sm1773996e87.72.2024.08.20.07.29.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Aug 2024 07:29:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ad1e8d9c-5f00-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724164198; x=1724768998; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=cXrv0E3MFlFU+ItFyAOjyjeGygFPyj9i38Ckg44wQ0M=;
        b=Nu2N2XY+WF9tUCwXYCgru11G/xtCPKfp9GjgwSFLKsJnRFwqYDFmZxDkkGcq5aEXus
         fiP3xnQHxxz2fphTEaS4tNrCVgGF0amQvUQvOV1g40jEfeLVjh34gKMWTKyFUMVqBvt+
         FRIdAr5uixjHlRlyDnUGZWzx8vdcHxtyfZzJuwBAkQvEBhzRbGS6cgc9JbVknD1//leD
         f8LeH5/t133CGiN9dtYFR4IvPL+D37d6JMjRhQwJgPOAqAbaeu1vf4xIJJCsEj4GU38r
         ODSBLxQcKi+A1trYdbqQFAA8RhfKRMXliDjFNA8iOHMZVyyT7sR9c/6Ee4VYGYdOCRTn
         PXoQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724164198; x=1724768998;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=cXrv0E3MFlFU+ItFyAOjyjeGygFPyj9i38Ckg44wQ0M=;
        b=nCBil1vaOn6nqn7qcGkjcvG+2x/yf7qU2VAfpQzibzQQUNfb71G3nP5zJq64KMXYfi
         kR4JtrINqI5/Y0Et1MuA6GRekyRD10sCbyH+ymXoyBAb3wIZVvEC93Ta5MrCW6SD9dEL
         OcJ5nkYwB7yb1ddk7SdIK1NsLU1GRB2j1sJwdqaJE+nPVcLgPa0cpp/uasIJFpjc4Jv/
         w4EFO17DRbzEsjsXK9B2QL8q/6NR1dpflNuxE/Lhz9D4o94D72kRDRhUe9j5ReUFSZ2b
         NUYIGAlFELZGMMT7OYWxsq+T5wv9C5JzUJsAqScnaR80XIKcw9ukgEaKY9BuQic0kJmr
         LRNQ==
X-Forwarded-Encrypted: i=1; AJvYcCVJ+8PQWYExI2srxGPRGov+UJWM7djqcuMhJyHtPMWbnCgd+tLuUY++6gaBh9gM44irkpIV+ssQBP4=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx7DX4VQpww7nelu6dK7YKd67/loUo+wyxmhYiFjtI8BCRPE2LA
	J2K5EyHgmxgnFurNbtx+kiGxu4i8IZLwd8HiUxjYAIvfEoi1xY8ZHJ+MCl2H
X-Google-Smtp-Source: AGHT+IEUHrJ/SYDaIj+10HjdHpBx8iCW0Ws8VM3nxx/08/Kowr+gNMxcGQJYD8Ll+OK5SPcAIO861w==
X-Received: by 2002:a05:6512:1085:b0:52f:413:7e8c with SMTP id 2adb3069b0e04-5331c6a2a5bmr10786717e87.14.1724164196933;
        Tue, 20 Aug 2024 07:29:56 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	qemu-arm@nongnu.org
Subject: [PATCH v2 03/12] hw/arm: xenpvh: Tweak machine description
Date: Tue, 20 Aug 2024 16:29:40 +0200
Message-ID: <20240820142949.533381-4-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820142949.533381-1-edgar.iglesias@gmail.com>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Tweak machine description to better express that this is
a Xen PVH machine for ARM.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 hw/arm/xen_arm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
index 766a194fa1..5f75cc3779 100644
--- a/hw/arm/xen_arm.c
+++ b/hw/arm/xen_arm.c
@@ -216,7 +216,7 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
 {
 
     MachineClass *mc = MACHINE_CLASS(oc);
-    mc->desc = "Xen Para-virtualized PC";
+    mc->desc = "Xen PVH ARM machine";
     mc->init = xen_arm_init;
     mc->max_cpus = 1;
     mc->default_machine_opts = "accel=xen";
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:30:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:30:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780533.1190202 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPs5-0002Er-8b; Tue, 20 Aug 2024 14:30:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780533.1190202; Tue, 20 Aug 2024 14:30:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPs5-0002EG-59; Tue, 20 Aug 2024 14:30:05 +0000
Received: by outflank-mailman (input) for mailman id 780533;
 Tue, 20 Aug 2024 14: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=prYO=PT=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sgPs3-0000m9-CS
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:30:03 +0000
Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com
 [2a00:1450:4864:20::230])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b0023ad1-5f00-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 16:30:03 +0200 (CEST)
Received: by mail-lj1-x230.google.com with SMTP id
 38308e7fff4ca-2f3f0a31ab2so6154331fa.0
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:30:02 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f3b771ebe5sm17418331fa.116.2024.08.20.07.30.01
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Aug 2024 07:30:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b0023ad1-5f00-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724164202; x=1724769002; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=C2BvZYxCNM329YOtugIJJq27AP0DG+3t72psalP89h8=;
        b=FYrF7/vhsEKJ6H4dnL4yvAklO2+Rw2U3uNut8BE132QS5ibwGMROvazQmepFDMlOZ+
         ulMD1QsetLv847o2rTMjD8mbMckxy4bcVUtCmRG8xxTLrbNajrmR2OakJttkRDNiY8dN
         rHXCBRRGQxnTKCVn09aU28svtU34UoVAg2ZLkudl3walhFarkjzY1NvwdEYZKcLPAVyI
         bVCFao2+YTkD9swyapNlGeW242WWKHRi2TfbVHhR5rhF/8LcJ2rvB8+pQYU8n8VohLC7
         61su2svDoZr4AOkrnq1mffMOY4yOkkMSbbvWvcmEuvFEFMbuVk7PExsF1bHe4Cm7IoZC
         s5Fg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724164202; x=1724769002;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=C2BvZYxCNM329YOtugIJJq27AP0DG+3t72psalP89h8=;
        b=PMYOEhFq8a/yUa1nbOVjj48rvsVPvyvbIonUfQ5HjSmNPR/0n6ZYDAjAB67xOx72V2
         D7Dy4sQLbvia+BKggGbruhDhPts5Xtw3uc8CJYWI8sVplDGUxOm42sAW+/NDIgRerzZu
         +s4RMNXcJwXCxWM8fREqBcdH2YFdpOnSpiUCgbvNDCwzZPU6e0XddwndFbjbnzqyR1gl
         7h+/C9c+rBulV2gSlBHGHIU7dnBttCOR9ypHCj8FKNd2tzg9hE0fX5ntA3OZwrSz+uyX
         1fh7u2KZLzYPujyy2iaT2kI/7rX2U71SYcIlN7Fp9hmiQ6ufJcfvJvHNJY5zbIY6ccMA
         8pQg==
X-Forwarded-Encrypted: i=1; AJvYcCW6Gkha8tgZFgmUuZqOhutoRhJElwAl3OAXDKH6XhlZVE83ILYDmXi3+TZpxyRWKwFZUehZAiKeZPk=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yxm1i12+UZe9E4Suk/BvCKDLVusdbeTjrENtiRaHj7K+MxeaLLM
	tumjNqJieyY5plXyhw8YkQZKA1NClo/YlOK64TtdpNykp3qXzzTG
X-Google-Smtp-Source: AGHT+IHrRwz7HWObwUTGagmH+INCDwhlgY6mEOdY8uIF9sicK4D/lPSZOM/URWXKGfy0q0Gg5vOZAg==
X-Received: by 2002:a2e:9119:0:b0:2ef:2b45:b71d with SMTP id 38308e7fff4ca-2f3be5afc99mr87868481fa.24.1724164201963;
        Tue, 20 Aug 2024 07:30:01 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	qemu-arm@nongnu.org
Subject: [PATCH v2 05/12] hw/arm: xenpvh: Remove double-negation in warning
Date: Tue, 20 Aug 2024 16:29:42 +0200
Message-ID: <20240820142949.533381-6-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820142949.533381-1-edgar.iglesias@gmail.com>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 hw/arm/xen_arm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
index fda65d0d8d..16b3f00992 100644
--- a/hw/arm/xen_arm.c
+++ b/hw/arm/xen_arm.c
@@ -165,7 +165,7 @@ static void xen_arm_init(MachineState *machine)
     xam->state =  g_new0(XenIOState, 1);
 
     if (machine->ram_size == 0) {
-        warn_report("%s non-zero ram size not specified. QEMU machine started"
+        warn_report("%s: ram size not specified. QEMU machine started"
                     " without IOREQ (no emulated devices including virtio)",
                     MACHINE_CLASS(object_get_class(OBJECT(machine)))->desc);
         return;
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:30:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:30:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780534.1190209 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPs5-0002LG-PQ; Tue, 20 Aug 2024 14:30:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780534.1190209; Tue, 20 Aug 2024 14:30:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPs5-0002J6-Gn; Tue, 20 Aug 2024 14:30:05 +0000
Received: by outflank-mailman (input) for mailman id 780534;
 Tue, 20 Aug 2024 14:30:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=prYO=PT=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sgPs4-0000m9-PW
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:30:04 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b0c6c0d1-5f00-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 16:30:04 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-530c2e5f4feso5684198e87.0
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:30:04 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5330d424725sm1790433e87.249.2024.08.20.07.30.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Aug 2024 07:30:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b0c6c0d1-5f00-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724164204; x=1724769004; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=P0gf4AWHulAzAV2HaIyUy+fKTdCex9KA7D9+c05rick=;
        b=mA5c6WzaQYSWFWO4VuzjBbPf1hQ5+gVKIH2/ZIYLfQmCgdi5ZrWwzrNGJ0wf69eguX
         2XDFi5My8xneOOd4asTm8PEnK7Kp1H8Pp9jWzAFxOKXuIFZPPlU2MlwsIqJt3oqpPpKw
         2NNhsgYXei+Rr0JukQQjjUfS9UfvatQUguN6SHwEivWZLyFnpGzmNf3XaxGYvVS8cgdB
         s0iobJyyBlkAF3YzPO5oveM+88amQrTrCCxq3KuIW/tB/Y+f6gfYp2VkeazRADKAfqcH
         PqFXcTrl66btGfAHWwwlmqadZBKKP9Sw5mDJwCXMgStmkc62lGCEaQag4e8NckfRal4g
         UXtQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724164204; x=1724769004;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=P0gf4AWHulAzAV2HaIyUy+fKTdCex9KA7D9+c05rick=;
        b=FMJB4GeezNTE+L3pV38XT6MpWMZkd9Ru14ViPj2zbUApkWPcX24tLHSg3SsViy1WIV
         GBJeShvkUIS0uMvc+kL2eKMaB9xa+OfhJuoyksWyjxRmf3ZCMT4JxGTXHm4AZQfMaMTx
         5BXCbDObmwMKtynRd3Z39Yv51+zu1/jXNYnDNwSWkadBqwN/wsAfCfLueVzaFm2cP/B+
         4zcTFd8iWAV5yZ7goKLUWEFP4wa+dWJn2MFK6RIsIvH6O9UhsuXQaRGUDnbyHR30mHVN
         ZIjKSB4OKE0QyHldU3IwDzuqL6UlsHHLGB6QaE0M1+lO1MVhGZl4YlyW4PFIDQTtE7Ba
         55Lw==
X-Forwarded-Encrypted: i=1; AJvYcCWSFg2P5q0Ti2wIXyFSvmDMo+c9PbF+whj3VstUActugjZC5UUFjPKzdr1gs4eouFJJe8xF+2jcyIQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzz+uIqXy7Y/F19vwGvRHuHK9WUw0vokY5+GLXaM94gSpSaK1I8
	0oWo8yw5mca3EipJDLWvKVXAofJOG8mZnHZXg5VmX0Upfq5hxXK6
X-Google-Smtp-Source: AGHT+IES1gNwxhhoBVLe4AixtVypdxMBk0O0dKwZ1tDvA9tVYLXBSnaAgHk6+BIt+ttxuzPWUzelPw==
X-Received: by 2002:a05:6512:2c98:b0:533:4191:fa47 with SMTP id 2adb3069b0e04-5334191fc44mr1624238e87.47.1724164203068;
        Tue, 20 Aug 2024 07:30:03 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	qemu-arm@nongnu.org
Subject: [PATCH v2 06/12] hw/arm: xenpvh: Move stubbed functions to xen-stubs.c
Date: Tue, 20 Aug 2024 16:29:43 +0200
Message-ID: <20240820142949.533381-7-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820142949.533381-1-edgar.iglesias@gmail.com>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 hw/arm/meson.build |  5 ++++-
 hw/arm/xen-stubs.c | 32 ++++++++++++++++++++++++++++++++
 hw/arm/xen_arm.c   | 20 --------------------
 3 files changed, 36 insertions(+), 21 deletions(-)
 create mode 100644 hw/arm/xen-stubs.c

diff --git a/hw/arm/meson.build b/hw/arm/meson.build
index 0c07ab522f..074612b40c 100644
--- a/hw/arm/meson.build
+++ b/hw/arm/meson.build
@@ -59,7 +59,10 @@ arm_ss.add(when: 'CONFIG_FSL_IMX7', if_true: files('fsl-imx7.c', 'mcimx7d-sabre.
 arm_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmuv3.c'))
 arm_ss.add(when: 'CONFIG_FSL_IMX6UL', if_true: files('fsl-imx6ul.c', 'mcimx6ul-evk.c'))
 arm_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_soc.c'))
-arm_ss.add(when: 'CONFIG_XEN', if_true: files('xen_arm.c'))
+arm_ss.add(when: 'CONFIG_XEN', if_true: files(
+  'xen-stubs.c',
+  'xen_arm.c',
+))
 
 system_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmu-common.c'))
 system_ss.add(when: 'CONFIG_CHEETAH', if_true: files('palm.c'))
diff --git a/hw/arm/xen-stubs.c b/hw/arm/xen-stubs.c
new file mode 100644
index 0000000000..4ac6a56a96
--- /dev/null
+++ b/hw/arm/xen-stubs.c
@@ -0,0 +1,32 @@
+/*
+ * Stubs for unimplemented Xen functions for ARM.
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/error-report.h"
+#include "qapi/qapi-commands-migration.h"
+#include "hw/boards.h"
+#include "sysemu/sysemu.h"
+#include "hw/xen/xen-hvm-common.h"
+#include "hw/xen/arch_hvm.h"
+
+void arch_handle_ioreq(XenIOState *state, ioreq_t *req)
+{
+    hw_error("Invalid ioreq type 0x%x\n", req->type);
+    return;
+}
+
+void arch_xen_set_memory(XenIOState *state, MemoryRegionSection *section,
+                         bool add)
+{
+}
+
+void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length)
+{
+}
+
+void qmp_xen_set_global_dirty_log(bool enable, Error **errp)
+{
+}
diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
index 16b3f00992..f0868e7be5 100644
--- a/hw/arm/xen_arm.c
+++ b/hw/arm/xen_arm.c
@@ -115,26 +115,6 @@ static void xen_init_ram(MachineState *machine)
     memory_region_add_subregion(sysmem, XEN_GRANT_ADDR_OFF, &xen_grants);
 }
 
-void arch_handle_ioreq(XenIOState *state, ioreq_t *req)
-{
-    hw_error("Invalid ioreq type 0x%x\n", req->type);
-
-    return;
-}
-
-void arch_xen_set_memory(XenIOState *state, MemoryRegionSection *section,
-                         bool add)
-{
-}
-
-void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length)
-{
-}
-
-void qmp_xen_set_global_dirty_log(bool enable, Error **errp)
-{
-}
-
 #ifdef CONFIG_TPM
 static void xen_enable_tpm(XenArmState *xam)
 {
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:30:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:30:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780535.1190222 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPs9-0003Dp-53; Tue, 20 Aug 2024 14:30:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780535.1190222; Tue, 20 Aug 2024 14:30:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPs8-0003D4-Va; Tue, 20 Aug 2024 14:30:08 +0000
Received: by outflank-mailman (input) for mailman id 780535;
 Tue, 20 Aug 2024 14:30:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=prYO=PT=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sgPs7-0000m9-Rt
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:30:07 +0000
Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com
 [2a00:1450:4864:20::233])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b24d87a9-5f00-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 16:30:06 +0200 (CEST)
Received: by mail-lj1-x233.google.com with SMTP id
 38308e7fff4ca-2f025b94e07so61565441fa.0
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:30:06 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f3f1d2b43bsm938911fa.95.2024.08.20.07.30.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Aug 2024 07:30:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b24d87a9-5f00-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724164206; x=1724769006; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=La4bzOi9ro9f5XHQO0tTS2EJNdEqne2pZ5yj4kL9zGQ=;
        b=TWHDwzoB5iNagTsqqxZAaGa5zC7hRO5fQBWsYYTiLRe63DALnMRP0IrvlZe8uXdvyD
         ttEw6V8QZLcqvBclvNBFkMzJaAJMqrFK5zo6ty+KfWErsS5/tmlYF17zt+QZ62d6ZuMa
         V+hdeH62hSR1Z9+bJCIjr7zB8zybsaMUJR/zTZUW6dm1T1wB4Z9UkhgjgSmzhi6B81b8
         1cXm85JPIlEitsL81zti9/Z9vO9dK94uolZav0+OviNJsFPRH5VXJs8WyBARoDCiltZ8
         YmaDHbenzqEaV5EDsEC709gW+6xX/bRCyP0SzKZ9tqXw7S57eLCnXvl2ECQtz2fWIM3E
         1ESQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724164206; x=1724769006;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=La4bzOi9ro9f5XHQO0tTS2EJNdEqne2pZ5yj4kL9zGQ=;
        b=arAvkZTN+QnkOOUs+whU2xQnF7WRErSRBntaYOq+pAyVyYipBEyPRQSIwaUJsipPpH
         D1fBJnxUoKbNAMunmTNxZ6W315Ohp/ds8y6OWDzT/QhBqJo9IhbYirce9kNBtAGbENdR
         bo4OyyTDBkUfFoRDgGKQreF7yB6ww3TlJoMix0B+gyrYRsdAWYHSuZC0i+U0e6D2U18Z
         fr+KyxzAM2t6Z7C27GW2G3vYfJ284/GicbqUdrVgKejWnDY2d/DbJP1CINpNNKrTwXdJ
         V7b1XBj4sPxYn24MMQXc3sfIqP5+0cxCk5n1BSccIOYeq1PmTxgHAQF40ssHniXq2HMw
         oIKg==
X-Forwarded-Encrypted: i=1; AJvYcCWkdCVMNfCivZU6WgB3JFcGBHTfmwWZerlgbls0vQNCbk858lAlKMkw1B+AYj1wE8XgkkbpfC4gwYpvAERPt34UuZMl0uA0Utw49YSiTbU=
X-Gm-Message-State: AOJu0Yx4weNPBoI5mHJv4CfXJv56OSRovTJIYYrBd5BZhDfm10qiXwnL
	dAXod5J1Df2QG4lyJdaSwyTjbxWNLng4dxgbcpFU+S02xiIumvpM/ximcA02
X-Google-Smtp-Source: AGHT+IGd+6DaCDah465GFLHr+cvbOd8y3IHEHjhNmbfoVq2Sn24FbI50r9QhwbrpmK3ehA83NVB+2A==
X-Received: by 2002:a2e:4c12:0:b0:2f1:563d:ec8a with SMTP id 38308e7fff4ca-2f3be60c0cbmr87157561fa.41.1724164205499;
        Tue, 20 Aug 2024 07:30:05 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	qemu-arm@nongnu.org
Subject: [PATCH v2 07/12] hw/arm: xenpvh: Break out a common PVH machine
Date: Tue, 20 Aug 2024 16:29:44 +0200
Message-ID: <20240820142949.533381-8-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820142949.533381-1-edgar.iglesias@gmail.com>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Break out a common Xen PVH machine in preparation for
adding a x86 Xen PVH machine.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 hw/arm/trace-events             |   5 -
 hw/arm/xen_arm.c                | 198 +++--------------------
 hw/xen/meson.build              |   1 +
 hw/xen/trace-events             |   4 +
 hw/xen/xen-pvh-common.c         | 275 ++++++++++++++++++++++++++++++++
 include/hw/xen/xen-pvh-common.h |  59 +++++++
 6 files changed, 358 insertions(+), 184 deletions(-)
 create mode 100644 hw/xen/xen-pvh-common.c
 create mode 100644 include/hw/xen/xen-pvh-common.h

diff --git a/hw/arm/trace-events b/hw/arm/trace-events
index be6c8f720b..c64ad344bd 100644
--- a/hw/arm/trace-events
+++ b/hw/arm/trace-events
@@ -68,10 +68,5 @@ z2_aer915_send_too_long(int8_t msg) "message too long (%i bytes)"
 z2_aer915_send(uint8_t reg, uint8_t value) "reg %d value 0x%02x"
 z2_aer915_event(int8_t event, int8_t len) "i2c event =0x%x len=%d bytes"
 
-# xen_arm.c
-xen_create_virtio_mmio_devices(int i, int irq, uint64_t base) "Created virtio-mmio device %d: irq %d base 0x%"PRIx64
-xen_init_ram(uint64_t machine_ram_size) "Initialized xen ram with size 0x%"PRIx64
-xen_enable_tpm(uint64_t addr) "Connected tpmdev at address 0x%"PRIx64
-
 # bcm2838.c
 bcm2838_gic_set_irq(int irq, int level) "gic irq:%d lvl:%d"
diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
index f0868e7be5..04cb9855af 100644
--- a/hw/arm/xen_arm.c
+++ b/hw/arm/xen_arm.c
@@ -7,44 +7,12 @@
 #include "qemu/osdep.h"
 #include "qemu/error-report.h"
 #include "qapi/qapi-commands-migration.h"
-#include "qapi/visitor.h"
 #include "hw/boards.h"
-#include "hw/irq.h"
-#include "hw/sysbus.h"
-#include "sysemu/block-backend.h"
-#include "sysemu/tpm_backend.h"
 #include "sysemu/sysemu.h"
-#include "hw/xen/xen-hvm-common.h"
-#include "sysemu/tpm.h"
+#include "hw/xen/xen-pvh-common.h"
 #include "hw/xen/arch_hvm.h"
-#include "trace.h"
 
 #define TYPE_XEN_ARM  MACHINE_TYPE_NAME("xenpvh")
-OBJECT_DECLARE_SIMPLE_TYPE(XenArmState, XEN_ARM)
-
-static const MemoryListener xen_memory_listener = {
-    .region_add = xen_region_add,
-    .region_del = xen_region_del,
-    .log_start = NULL,
-    .log_stop = NULL,
-    .log_sync = NULL,
-    .log_global_start = NULL,
-    .log_global_stop = NULL,
-    .priority = MEMORY_LISTENER_PRIORITY_ACCEL,
-};
-
-struct XenArmState {
-    /*< private >*/
-    MachineState parent;
-
-    XenIOState *state;
-
-    struct {
-        uint64_t tpm_base_addr;
-    } cfg;
-};
-
-static MemoryRegion ram_lo, ram_hi;
 
 /*
  * VIRTIO_MMIO_DEV_SIZE is imported from tools/libs/light/libxl_arm.c under Xen
@@ -57,147 +25,26 @@ static MemoryRegion ram_lo, ram_hi;
 #define NR_VIRTIO_MMIO_DEVICES   \
    (GUEST_VIRTIO_MMIO_SPI_LAST - GUEST_VIRTIO_MMIO_SPI_FIRST)
 
-static void xen_set_irq(void *opaque, int irq, int level)
-{
-    if (xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level)) {
-        error_report("xendevicemodel_set_irq_level failed");
-    }
-}
-
-static void xen_create_virtio_mmio_devices(XenArmState *xam)
-{
-    int i;
-
-    for (i = 0; i < NR_VIRTIO_MMIO_DEVICES; i++) {
-        hwaddr base = GUEST_VIRTIO_MMIO_BASE + i * VIRTIO_MMIO_DEV_SIZE;
-        qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL,
-                                         GUEST_VIRTIO_MMIO_SPI_FIRST + i);
-
-        sysbus_create_simple("virtio-mmio", base, irq);
-
-        trace_xen_create_virtio_mmio_devices(i,
-                                             GUEST_VIRTIO_MMIO_SPI_FIRST + i,
-                                             base);
-    }
-}
-
-static void xen_init_ram(MachineState *machine)
+static void xen_arm_instance_init(Object *obj)
 {
-    MemoryRegion *sysmem = get_system_memory();
-    ram_addr_t block_len, ram_size[GUEST_RAM_BANKS];
-
-    trace_xen_init_ram(machine->ram_size);
-    if (machine->ram_size <= GUEST_RAM0_SIZE) {
-        ram_size[0] = machine->ram_size;
-        ram_size[1] = 0;
-        block_len = GUEST_RAM0_BASE + ram_size[0];
-    } else {
-        ram_size[0] = GUEST_RAM0_SIZE;
-        ram_size[1] = machine->ram_size - GUEST_RAM0_SIZE;
-        block_len = GUEST_RAM1_BASE + ram_size[1];
-    }
+    XenPVHMachineState *s = XEN_PVH_MACHINE(obj);
 
-    memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len,
-                           &error_fatal);
+    /* Default values.  */
+    s->cfg.ram_low = (MemMapEntry) { GUEST_RAM0_BASE, GUEST_RAM0_SIZE };
+    s->cfg.ram_high = (MemMapEntry) { GUEST_RAM1_BASE, GUEST_RAM1_SIZE };
 
-    memory_region_init_alias(&ram_lo, NULL, "xen.ram.lo", &xen_memory,
-                             GUEST_RAM0_BASE, ram_size[0]);
-    memory_region_add_subregion(sysmem, GUEST_RAM0_BASE, &ram_lo);
-    if (ram_size[1] > 0) {
-        memory_region_init_alias(&ram_hi, NULL, "xen.ram.hi", &xen_memory,
-                                 GUEST_RAM1_BASE, ram_size[1]);
-        memory_region_add_subregion(sysmem, GUEST_RAM1_BASE, &ram_hi);
-    }
-
-    /* Setup support for grants.  */
-    memory_region_init_ram(&xen_grants, NULL, "xen.grants", block_len,
-                           &error_fatal);
-    memory_region_add_subregion(sysmem, XEN_GRANT_ADDR_OFF, &xen_grants);
+    s->cfg.virtio_mmio_num = NR_VIRTIO_MMIO_DEVICES;
+    s->cfg.virtio_mmio_irq_base = GUEST_VIRTIO_MMIO_SPI_FIRST;
+    s->cfg.virtio_mmio = (MemMapEntry) { GUEST_VIRTIO_MMIO_BASE,
+                                         VIRTIO_MMIO_DEV_SIZE };
 }
 
-#ifdef CONFIG_TPM
-static void xen_enable_tpm(XenArmState *xam)
-{
-    Error *errp = NULL;
-    DeviceState *dev;
-    SysBusDevice *busdev;
-
-    TPMBackend *be = qemu_find_tpm_be("tpm0");
-    if (be == NULL) {
-        error_report("Couldn't find tmp0 backend");
-        return;
-    }
-    dev = qdev_new(TYPE_TPM_TIS_SYSBUS);
-    object_property_set_link(OBJECT(dev), "tpmdev", OBJECT(be), &errp);
-    object_property_set_str(OBJECT(dev), "tpmdev", be->id, &errp);
-    busdev = SYS_BUS_DEVICE(dev);
-    sysbus_realize_and_unref(busdev, &error_fatal);
-    sysbus_mmio_map(busdev, 0, xam->cfg.tpm_base_addr);
-
-    trace_xen_enable_tpm(xam->cfg.tpm_base_addr);
-}
-#endif
-
-static void xen_arm_init(MachineState *machine)
-{
-    XenArmState *xam = XEN_ARM(machine);
-
-    xam->state =  g_new0(XenIOState, 1);
-
-    if (machine->ram_size == 0) {
-        warn_report("%s: ram size not specified. QEMU machine started"
-                    " without IOREQ (no emulated devices including virtio)",
-                    MACHINE_CLASS(object_get_class(OBJECT(machine)))->desc);
-        return;
-    }
-
-    xen_init_ram(machine);
-
-    xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener);
-
-    xen_create_virtio_mmio_devices(xam);
-
-#ifdef CONFIG_TPM
-    if (xam->cfg.tpm_base_addr) {
-        xen_enable_tpm(xam);
-    } else {
-        warn_report("tpm-base-addr is not provided. TPM will not be enabled");
-    }
-#endif
-}
-
-#ifdef CONFIG_TPM
-static void xen_arm_get_tpm_base_addr(Object *obj, Visitor *v,
-                                      const char *name, void *opaque,
-                                      Error **errp)
-{
-    XenArmState *xam = XEN_ARM(obj);
-    uint64_t value = xam->cfg.tpm_base_addr;
-
-    visit_type_uint64(v, name, &value, errp);
-}
-
-static void xen_arm_set_tpm_base_addr(Object *obj, Visitor *v,
-                                      const char *name, void *opaque,
-                                      Error **errp)
-{
-    XenArmState *xam = XEN_ARM(obj);
-    uint64_t value;
-
-    if (!visit_type_uint64(v, name, &value, errp)) {
-        return;
-    }
-
-    xam->cfg.tpm_base_addr = value;
-}
-#endif
-
 static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
 {
-
+    XenPVHMachineClass *xpc = XEN_PVH_MACHINE_CLASS(oc);
     MachineClass *mc = MACHINE_CLASS(oc);
+
     mc->desc = "Xen PVH ARM machine";
-    mc->init = xen_arm_init;
 
     /*
      * mc->max_cpus holds the MAX value allowed in the -smp command-line opts.
@@ -218,27 +65,20 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
      * mc->max_cpus, QEMU will bail out with an error message.
      */
     mc->max_cpus = GUEST_MAX_VCPUS;
-    mc->default_machine_opts = "accel=xen";
-    /* Set explicitly here to make sure that real ram_size is passed */
-    mc->default_ram_size = 0;
 
-#ifdef CONFIG_TPM
-    object_class_property_add(oc, "tpm-base-addr", "uint64_t",
-                              xen_arm_get_tpm_base_addr,
-                              xen_arm_set_tpm_base_addr,
-                              NULL, NULL);
-    object_class_property_set_description(oc, "tpm-base-addr",
-                                          "Set Base address for TPM device.");
+    /* List of supported features known to work on PVH ARM.  */
+    xpc->has_tpm = true;
+    xpc->has_virtio_mmio = true;
 
-    machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS);
-#endif
+    xen_pvh_class_setup_common_props(xpc);
 }
 
 static const TypeInfo xen_arm_machine_type = {
     .name = TYPE_XEN_ARM,
-    .parent = TYPE_MACHINE,
+    .parent = TYPE_XEN_PVH_MACHINE,
     .class_init = xen_arm_machine_class_init,
-    .instance_size = sizeof(XenArmState),
+    .instance_size = sizeof(XenPVHMachineState),
+    .instance_init = xen_arm_instance_init,
 };
 
 static void xen_arm_machine_register_types(void)
diff --git a/hw/xen/meson.build b/hw/xen/meson.build
index d887fa9ba4..4a486e3673 100644
--- a/hw/xen/meson.build
+++ b/hw/xen/meson.build
@@ -15,6 +15,7 @@ xen_specific_ss = ss.source_set()
 xen_specific_ss.add(files(
   'xen-mapcache.c',
   'xen-hvm-common.c',
+  'xen-pvh-common.c',
 ))
 if have_xen_pci_passthrough
   xen_specific_ss.add(files(
diff --git a/hw/xen/trace-events b/hw/xen/trace-events
index d1b27f6c11..a07fe41c6d 100644
--- a/hw/xen/trace-events
+++ b/hw/xen/trace-events
@@ -64,6 +64,10 @@ destroy_hvm_domain_cannot_acquire_handle(void) "Cannot acquire xenctrl handle"
 destroy_hvm_domain_failed_action(const char *action, int sts, char *errno_s) "xc_domain_shutdown failed to issue %s, sts %d, %s"
 destroy_hvm_domain_action(int xen_domid, const char *action) "Issued domain %d %s"
 
+# xen-pvh-common.c
+xen_create_virtio_mmio_devices(int i, int irq, uint64_t base) "Created virtio-mmio device %d: irq %d base 0x%"PRIx64
+xen_enable_tpm(uint64_t addr) "Connected tpmdev at address 0x%"PRIx64
+
 # xen-mapcache.c
 xen_map_cache(uint64_t phys_addr) "want 0x%"PRIx64
 xen_remap_bucket(uint64_t index) "index 0x%"PRIx64
diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
new file mode 100644
index 0000000000..880e8143d7
--- /dev/null
+++ b/hw/xen/xen-pvh-common.c
@@ -0,0 +1,275 @@
+/*
+ * QEMU Xen PVH machine - common code.
+ *
+ * Copyright (c) 2024 Advanced Micro Devices, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/error-report.h"
+#include "qapi/error.h"
+#include "qapi/visitor.h"
+#include "hw/boards.h"
+#include "hw/irq.h"
+#include "hw/sysbus.h"
+#include "sysemu/sysemu.h"
+#include "sysemu/tpm.h"
+#include "sysemu/tpm_backend.h"
+#include "hw/xen/xen-pvh-common.h"
+#include "trace.h"
+
+static const MemoryListener xen_memory_listener = {
+    .region_add = xen_region_add,
+    .region_del = xen_region_del,
+    .log_start = NULL,
+    .log_stop = NULL,
+    .log_sync = NULL,
+    .log_global_start = NULL,
+    .log_global_stop = NULL,
+    .priority = MEMORY_LISTENER_PRIORITY_ACCEL,
+};
+
+static void xen_pvh_init_ram(XenPVHMachineState *s,
+                             MemoryRegion *sysmem)
+{
+    MachineState *ms = MACHINE(s);
+    ram_addr_t block_len, ram_size[2];
+
+    if (ms->ram_size <= s->cfg.ram_low.size) {
+        ram_size[0] = ms->ram_size;
+        ram_size[1] = 0;
+        block_len = s->cfg.ram_low.base + ram_size[0];
+    } else {
+        ram_size[0] = s->cfg.ram_low.size;
+        ram_size[1] = ms->ram_size - s->cfg.ram_low.size;
+        block_len = s->cfg.ram_high.base + ram_size[1];
+    }
+
+    memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len,
+                           &error_fatal);
+
+    memory_region_init_alias(&s->ram.low, NULL, "xen.ram.lo", &xen_memory,
+                             s->cfg.ram_low.base, ram_size[0]);
+    memory_region_add_subregion(sysmem, s->cfg.ram_low.base, &s->ram.low);
+    if (ram_size[1] > 0) {
+        memory_region_init_alias(&s->ram.high, NULL, "xen.ram.hi", &xen_memory,
+                                 s->cfg.ram_high.base, ram_size[1]);
+        memory_region_add_subregion(sysmem, s->cfg.ram_high.base, &s->ram.high);
+    }
+
+    /* Setup support for grants.  */
+    memory_region_init_ram(&xen_grants, NULL, "xen.grants", block_len,
+                           &error_fatal);
+    memory_region_add_subregion(sysmem, XEN_GRANT_ADDR_OFF, &xen_grants);
+}
+
+static void xen_set_irq(void *opaque, int irq, int level)
+{
+    if (xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level)) {
+        error_report("xendevicemodel_set_irq_level failed");
+    }
+}
+
+static void xen_create_virtio_mmio_devices(XenPVHMachineState *s)
+{
+    int i;
+
+    for (i = 0; i < s->cfg.virtio_mmio_num; i++) {
+        hwaddr base = s->cfg.virtio_mmio.base + i * s->cfg.virtio_mmio.size;
+        qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL,
+                                         s->cfg.virtio_mmio_irq_base + i);
+
+        sysbus_create_simple("virtio-mmio", base, irq);
+
+        trace_xen_create_virtio_mmio_devices(i,
+                                             s->cfg.virtio_mmio_irq_base + i,
+                                             base);
+    }
+}
+
+#ifdef CONFIG_TPM
+static void xen_enable_tpm(XenPVHMachineState *s)
+{
+    Error *errp = NULL;
+    DeviceState *dev;
+    SysBusDevice *busdev;
+
+    TPMBackend *be = qemu_find_tpm_be("tpm0");
+    if (be == NULL) {
+        error_report("Couldn't find tmp0 backend");
+        return;
+    }
+    dev = qdev_new(TYPE_TPM_TIS_SYSBUS);
+    object_property_set_link(OBJECT(dev), "tpmdev", OBJECT(be), &errp);
+    object_property_set_str(OBJECT(dev), "tpmdev", be->id, &errp);
+    busdev = SYS_BUS_DEVICE(dev);
+    sysbus_realize_and_unref(busdev, &error_fatal);
+    sysbus_mmio_map(busdev, 0, s->cfg.tpm.base);
+
+    trace_xen_enable_tpm(s->cfg.tpm.base);
+}
+#endif
+
+static void xen_pvh_init(MachineState *ms)
+{
+    XenPVHMachineState *s = XEN_PVH_MACHINE(ms);
+    XenPVHMachineClass *xpc = XEN_PVH_MACHINE_GET_CLASS(s);
+    MemoryRegion *sysmem = get_system_memory();
+
+    if (ms->ram_size == 0) {
+        warn_report("%s: ram size not specified. QEMU machine started"
+                    " without IOREQ (no emulated devices including virtio)",
+                    MACHINE_CLASS(object_get_class(OBJECT(ms)))->desc);
+        return;
+    }
+
+    xen_pvh_init_ram(s, sysmem);
+    xen_register_ioreq(&s->ioreq, ms->smp.max_cpus, &xen_memory_listener);
+
+    if (s->cfg.virtio_mmio_num) {
+        xen_create_virtio_mmio_devices(s);
+    }
+
+#ifdef CONFIG_TPM
+    if (xpc->has_tpm) {
+        if (s->cfg.tpm.base) {
+            xen_enable_tpm(s);
+        } else {
+            warn_report("tpm-base-addr is not set. TPM will not be enabled");
+        }
+    }
+#endif
+
+    /* Call the implementation specific init.  */
+    if (xpc->init) {
+        xpc->init(ms);
+    }
+}
+
+#define XEN_PVH_PROP_MEMMAP_SETTER(n, f)                                   \
+static void xen_pvh_set_ ## n ## _ ## f(Object *obj, Visitor *v,           \
+                                       const char *name, void *opaque,     \
+                                       Error **errp)                       \
+{                                                                          \
+    XenPVHMachineState *xp = XEN_PVH_MACHINE(obj);                         \
+    uint64_t value;                                                        \
+                                                                           \
+    if (!visit_type_size(v, name, &value, errp)) {                         \
+        return;                                                            \
+    }                                                                      \
+    xp->cfg.n.f = value;                                                   \
+}
+
+#define XEN_PVH_PROP_MEMMAP_GETTER(n, f)                                   \
+static void xen_pvh_get_ ## n ## _ ## f(Object *obj, Visitor *v,           \
+                                       const char *name, void *opaque,     \
+                                       Error **errp)                       \
+{                                                                          \
+    XenPVHMachineState *xp = XEN_PVH_MACHINE(obj);                         \
+    uint64_t value = xp->cfg.n.f;                                          \
+                                                                           \
+    visit_type_uint64(v, name, &value, errp);                              \
+}
+
+#define XEN_PVH_PROP_MEMMAP_BASE(n)        \
+    XEN_PVH_PROP_MEMMAP_SETTER(n, base)    \
+    XEN_PVH_PROP_MEMMAP_GETTER(n, base)    \
+
+#define XEN_PVH_PROP_MEMMAP_SIZE(n)        \
+    XEN_PVH_PROP_MEMMAP_SETTER(n, size)    \
+    XEN_PVH_PROP_MEMMAP_GETTER(n, size)
+
+#define XEN_PVH_PROP_MEMMAP(n)             \
+    XEN_PVH_PROP_MEMMAP_BASE(n)            \
+    XEN_PVH_PROP_MEMMAP_SIZE(n)
+
+XEN_PVH_PROP_MEMMAP(ram_low)
+XEN_PVH_PROP_MEMMAP(ram_high)
+/* TPM only has a base-addr option.  */
+XEN_PVH_PROP_MEMMAP_BASE(tpm)
+XEN_PVH_PROP_MEMMAP(virtio_mmio)
+
+void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc)
+{
+    ObjectClass *oc = OBJECT_CLASS(xpc);
+    MachineClass *mc = MACHINE_CLASS(xpc);
+
+#define OC_MEMMAP_PROP_BASE(c, prop_name, name)                           \
+do {                                                                      \
+    object_class_property_add(c, prop_name "-base", "uint64_t",           \
+                              xen_pvh_get_ ## name ## _base,              \
+                              xen_pvh_set_ ## name ## _base, NULL, NULL); \
+    object_class_property_set_description(oc, prop_name "-base",          \
+                              "Set base address for " prop_name);         \
+} while (0)
+
+#define OC_MEMMAP_PROP_SIZE(c, prop_name, name)                           \
+do {                                                                      \
+    object_class_property_add(c, prop_name "-size", "uint64_t",           \
+                              xen_pvh_get_ ## name ## _size,              \
+                              xen_pvh_set_ ## name ## _size, NULL, NULL); \
+    object_class_property_set_description(oc, prop_name "-size",          \
+                              "Set memory range size for " prop_name);    \
+} while (0)
+
+#define OC_MEMMAP_PROP(c, prop_name, name)                                \
+do {                                                                      \
+        OC_MEMMAP_PROP_BASE(c, prop_name, name);                          \
+        OC_MEMMAP_PROP_SIZE(c, prop_name, name);                          \
+} while (0)
+
+    /*
+     * We provide memmap properties to allow Xen to move things to other
+     * addresses for example when users need to accomodate the memory-map
+     * for 1:1 mapped devices/memory.
+     */
+    OC_MEMMAP_PROP(oc, "ram-low", ram_low);
+    OC_MEMMAP_PROP(oc, "ram-high", ram_high);
+
+    if (xpc->has_virtio_mmio) {
+        OC_MEMMAP_PROP(oc, "virtio-mmio", virtio_mmio);
+    }
+
+#ifdef CONFIG_TPM
+    if (xpc->has_tpm) {
+        object_class_property_add(oc, "tpm-base-addr", "uint64_t",
+                                  xen_pvh_get_tpm_base,
+                                  xen_pvh_set_tpm_base,
+                                  NULL, NULL);
+        object_class_property_set_description(oc, "tpm-base-addr",
+                                  "Set Base address for TPM device.");
+
+        machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS);
+    }
+#endif
+}
+
+static void xen_pvh_class_init(ObjectClass *oc, void *data)
+{
+    MachineClass *mc = MACHINE_CLASS(oc);
+
+    mc->init = xen_pvh_init;
+
+    mc->desc = "Xen PVH machine";
+    mc->max_cpus = 1;
+    mc->default_machine_opts = "accel=xen";
+    /* Set to zero to make sure that the real ram size is passed. */
+    mc->default_ram_size = 0;
+}
+
+static const TypeInfo xen_pvh_info = {
+    .name = TYPE_XEN_PVH_MACHINE,
+    .parent = TYPE_MACHINE,
+    .abstract = true,
+    .instance_size = sizeof(XenPVHMachineState),
+    .class_size = sizeof(XenPVHMachineClass),
+    .class_init = xen_pvh_class_init,
+};
+
+static void xen_pvh_register_types(void)
+{
+    type_register_static(&xen_pvh_info);
+}
+
+type_init(xen_pvh_register_types);
diff --git a/include/hw/xen/xen-pvh-common.h b/include/hw/xen/xen-pvh-common.h
new file mode 100644
index 0000000000..77fd98b9fe
--- /dev/null
+++ b/include/hw/xen/xen-pvh-common.h
@@ -0,0 +1,59 @@
+/*
+ * QEMU Xen PVH machine - common code.
+ *
+ * Copyright (c) 2024 Advanced Micro Devices, Inc.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef XEN_PVH_COMMON_H__
+#define XEN_PVH_COMMON_H__
+
+#include <assert.h>
+#include "hw/sysbus.h"
+#include "hw/hw.h"
+#include "hw/xen/xen-hvm-common.h"
+#include "hw/pci-host/gpex.h"
+
+#define TYPE_XEN_PVH_MACHINE MACHINE_TYPE_NAME("xen-pvh-base")
+OBJECT_DECLARE_TYPE(XenPVHMachineState, XenPVHMachineClass,
+                    XEN_PVH_MACHINE)
+
+struct XenPVHMachineClass {
+    MachineClass parent;
+
+    /* PVH implementation specific init.  */
+    void (*init)(MachineState *state);
+
+    /*
+     * Each implementation can optionally enable features that it
+     * supports and are known to work.
+     */
+    bool has_tpm;
+    bool has_virtio_mmio;
+};
+
+struct XenPVHMachineState {
+    /*< private >*/
+    MachineState parent;
+
+    XenIOState ioreq;
+
+    struct {
+        MemoryRegion low;
+        MemoryRegion high;
+    } ram;
+
+    struct {
+        MemMapEntry ram_low, ram_high;
+        MemMapEntry tpm;
+
+        /* Virtio-mmio */
+        MemMapEntry virtio_mmio;
+        uint32_t virtio_mmio_num;
+        uint32_t virtio_mmio_irq_base;
+    } cfg;
+};
+
+void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc);
+#endif
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:30:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:30:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780536.1190232 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPsB-0003gu-MW; Tue, 20 Aug 2024 14:30:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780536.1190232; Tue, 20 Aug 2024 14:30:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPsB-0003gc-GL; Tue, 20 Aug 2024 14:30:11 +0000
Received: by outflank-mailman (input) for mailman id 780536;
 Tue, 20 Aug 2024 14:30:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=prYO=PT=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sgPs9-0000m9-Ay
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:30:09 +0000
Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com
 [2a00:1450:4864:20::22a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b3806914-5f00-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 16:30:08 +0200 (CEST)
Received: by mail-lj1-x22a.google.com with SMTP id
 38308e7fff4ca-2ef2d96164aso64441481fa.3
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:30:08 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f3b7729ca3sm17564031fa.124.2024.08.20.07.30.06
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Aug 2024 07:30:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b3806914-5f00-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724164208; x=1724769008; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=nym7Vpc1+HcpD0fJwqv749eMWZaaEovUQaBKn9/MOQM=;
        b=YYTK3sEbVSmHEhPrn2VXA2RyVEV88RXdnwDULLdptgIgdGnf7GWP3FGDp/lMKZQkhC
         O8tQySTLUxofq1N3msTcTjjXW7nMz2vSCYycygX7ru+BBV+etBHY9PnAJGkB8XvcCqdf
         p87izn6np1P3qOK/+yCz7Za71QPPxpLjuhHpBLe77F72qdPyX7hvkV+9qgGDdsuRwk0o
         suSiDJeLgIPJpDta7it6Xbdyqszc4Ix5GLunFkiJUhofKEt0OW5I1XSxvH8jHwRPbbn3
         E96KobmOV9tZ8z8i/D+WaLP8aREJda79zn4I6D65mPQZ8RJB7lRGP9PlFK8U06d+mlAw
         Sc7g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724164208; x=1724769008;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=nym7Vpc1+HcpD0fJwqv749eMWZaaEovUQaBKn9/MOQM=;
        b=oN2a8N4oUfJmBi3RRedniKsURYeuu0xsrBpLGuf06HDbi5cMHgO67ihBkd6vYr51Uh
         +ow6EK5o8Zu/bXBS54crM+i3nb/XESnstU58hH8+bBvJL8BZcqXPDlTBor8qzYacPtKv
         smTVEpMj039er6sKA+rhWyS5MaAbpCptoBZ0zFmc92s5Tum/rMUA+ksHjBqWBYJ1OsAE
         QrBxWkQS0uabjPkZ0kbw1wlDsFQ6eYoDPmy/0hfZnOnG6XIsGyDuXjvh26rOUdyKXq40
         x0oylAXfVamh+k5G46GijaoxbKjGSlJrjNPuDhCWcdqS2BfRhbLh+YntdH4BGuTqDWAc
         a0yQ==
X-Forwarded-Encrypted: i=1; AJvYcCWf5WUHDJq28Y3K4JgtFltgS34iioaxLZqvl84d7fcPSbQNxY7sf54Y3q+9ueCJXKTQKQuIeF1om6Yu+MP6zmbc7Ifogws0M755TuCuWyI=
X-Gm-Message-State: AOJu0YwZit246yw8Ak/9T2xgOCq0XMUs9ttRN23Si7OJp7U3HPZicf+z
	h7GgdTS/HQLffAK8Aqgvp3j3AmAu1mdZOJRR1Ro1eS+S7k3t64eK
X-Google-Smtp-Source: AGHT+IGvYq0XUQaDgo2b1zhaMjoLQlam8cibWHn5GgbCoSKj72iq1ZAvahi0NkyE48N8bfPt4YQ3Fg==
X-Received: by 2002:a05:651c:b10:b0:2ef:26f2:d3e2 with SMTP id 38308e7fff4ca-2f3be574b20mr115566071fa.2.1724164207760;
        Tue, 20 Aug 2024 07:30:07 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	qemu-arm@nongnu.org
Subject: [PATCH v2 08/12] hw/arm: xenpvh: Rename xen_arm.c -> xen-pvh.c
Date: Tue, 20 Aug 2024 16:29:45 +0200
Message-ID: <20240820142949.533381-9-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820142949.533381-1-edgar.iglesias@gmail.com>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Rename xen_arm.c -> xen-pvh.c to better express that this
is a PVH machine and to align with x86 HVM and future PVH
machine filenames:
hw/i386/xen/xen-hvm.c
hw/i386/xen/xen-pvh.c (in preparation)

No functional changes.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 hw/arm/meson.build              | 2 +-
 hw/arm/{xen_arm.c => xen-pvh.c} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename hw/arm/{xen_arm.c => xen-pvh.c} (100%)

diff --git a/hw/arm/meson.build b/hw/arm/meson.build
index 074612b40c..4059d0be2e 100644
--- a/hw/arm/meson.build
+++ b/hw/arm/meson.build
@@ -61,7 +61,7 @@ arm_ss.add(when: 'CONFIG_FSL_IMX6UL', if_true: files('fsl-imx6ul.c', 'mcimx6ul-e
 arm_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_soc.c'))
 arm_ss.add(when: 'CONFIG_XEN', if_true: files(
   'xen-stubs.c',
-  'xen_arm.c',
+  'xen-pvh.c',
 ))
 
 system_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmu-common.c'))
diff --git a/hw/arm/xen_arm.c b/hw/arm/xen-pvh.c
similarity index 100%
rename from hw/arm/xen_arm.c
rename to hw/arm/xen-pvh.c
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:30:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:30:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780538.1190241 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPsC-00041q-Vf; Tue, 20 Aug 2024 14:30:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780538.1190241; Tue, 20 Aug 2024 14:30:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPsC-00040n-Pi; Tue, 20 Aug 2024 14:30:12 +0000
Received: by outflank-mailman (input) for mailman id 780538;
 Tue, 20 Aug 2024 14:30:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=prYO=PT=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sgPsC-0000m9-24
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:30:12 +0000
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com
 [2a00:1450:4864:20::12e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b51dbfee-5f00-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 16:30:11 +0200 (CEST)
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-53346132365so347421e87.1
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:30:11 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5330d420bc6sm1791128e87.241.2024.08.20.07.30.09
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Aug 2024 07:30:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b51dbfee-5f00-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724164211; x=1724769011; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=nn/Mzsj0J8g/Mphb+PXQ5WHUtYUEk9GjObY40SBe48s=;
        b=E4eNChmDOSB3t3Dl53CQtsKq8Matjrpyo2dVwb4BzVLMzZGNv1GKCAZDb5gj8q2Enf
         RnSGCf1jTzsJ0GtHMPkKOZOTphPgUCW6mWfQS81QydV3tJeMCy4ab1LyougUoWJ74L3+
         pS9+1b2UbKRz+1eQ0zS+UCocbmlJDuR4ydu4Q2c+MsPdxMunm8WmrPXChfMktDuhnKCV
         O+8NmNDEKMCBA+YVJLspv9XTT9ziH+DCzSOFcMcQcWzPk0LRh8ssJGWjtwB6RPyH+BHo
         +8gDW3bmDVnOTPx86oJzBCb5PCwNQh0YzsBHz+yKWfD80GMpNABt8e2zbWSflD59Djj4
         Z7lw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724164211; x=1724769011;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=nn/Mzsj0J8g/Mphb+PXQ5WHUtYUEk9GjObY40SBe48s=;
        b=rHaaS5v0NX63AhTdMKlV2XKgDU7Mo0/Vc/fjZZzBQTFBFzmBW5GcdAn7VyJmOSb2Uo
         4bjjviXCpG8vTX56RiBE/sNxs0OCkIHHoZLi3GrFN8gVbv2//OzrHO5GG+oL47YtebI+
         GSqqMjeyr6n+ZRDEEUjndyRpyyBdohrS2q58Bg9aWkTUku16rpjObHgwgKoHEJ3mQGrx
         G950kOOhsoKFUu5NbQNFsBv3LarwL3T0Uq3+8Kgetam6GesvFXLSF0yCRYb7VeKNT5vN
         UHqVGHCZ9pTzc5QasOsdeJEXo7OhAcXgVoHLcQpntecTac04bIFTFcp4qLhZsVyDL5i4
         mg0g==
X-Forwarded-Encrypted: i=1; AJvYcCXuwLYF1eafKEqXePjutpSnPSaNP9cJaCFL9XU7Rm6EHKST6OTtJRzkJJycXPe2+LcCcrM1P10+YZ8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzRcom7TwLxKRMEcYlw7YPSGRa9hH9PRJUHxPXjQims61C95Fb6
	DOTPpSVHBMPhYbum+jiRac91/o08AeDhK0dQV3Vs4gQKuZ6sQ/Ps
X-Google-Smtp-Source: AGHT+IFotZ4Ec+2t7CYxqYEsIJgRWw4/u9z0FOKI55M7uGGokh/ts3s1WXBedzrQkXbLGgZ+ZDCasA==
X-Received: by 2002:a05:6512:3a90:b0:52f:d15f:d46b with SMTP id 2adb3069b0e04-5331c696aefmr9419582e87.14.1724164210397;
        Tue, 20 Aug 2024 07:30:10 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH v2 09/12] hw/arm: xenpvh: Reverse virtio-mmio creation order
Date: Tue, 20 Aug 2024 16:29:46 +0200
Message-ID: <20240820142949.533381-10-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820142949.533381-1-edgar.iglesias@gmail.com>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

We've been creating the virtio-mmio devices in forwards order
but since the qbus lists prepend (rather than append) entries,
the virtio busses end up with decreasing base address order.

Xen enables virtio-mmio nodes in forwards order so there's been
a missmatch. So far, we've been working around this with an
out-of-tree patch to Xen.

This reverses the order making sure the virtio busses end up
ordered with increasing base addresses avoiding the need to
patch Xen.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
---
 hw/xen/xen-pvh-common.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
index 880e8143d7..295f920442 100644
--- a/hw/xen/xen-pvh-common.c
+++ b/hw/xen/xen-pvh-common.c
@@ -75,7 +75,18 @@ static void xen_create_virtio_mmio_devices(XenPVHMachineState *s)
 {
     int i;
 
-    for (i = 0; i < s->cfg.virtio_mmio_num; i++) {
+    /*
+     * We create the transports in reverse order. Since qbus_realize()
+     * prepends (not appends) new child buses, the decrementing loop below will
+     * create a list of virtio-mmio buses with increasing base addresses.
+     *
+     * When a -device option is processed from the command line,
+     * qbus_find_recursive() picks the next free virtio-mmio bus in forwards
+     * order.
+     *
+     * This is what the Xen tools expect.
+     */
+    for (i = s->cfg.virtio_mmio_num - 1; i >= 0; i--) {
         hwaddr base = s->cfg.virtio_mmio.base + i * s->cfg.virtio_mmio.size;
         qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL,
                                          s->cfg.virtio_mmio_irq_base + i);
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:30:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:30:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780541.1190252 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPsG-0004ZF-7C; Tue, 20 Aug 2024 14:30:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780541.1190252; Tue, 20 Aug 2024 14:30:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPsG-0004Yy-2A; Tue, 20 Aug 2024 14:30:16 +0000
Received: by outflank-mailman (input) for mailman id 780541;
 Tue, 20 Aug 2024 14:30:14 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=prYO=PT=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sgPsE-0000aG-IG
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:30:14 +0000
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com
 [2a00:1450:4864:20::12e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b5db0026-5f00-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 16:30:12 +0200 (CEST)
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-53345604960so398918e87.3
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:30:12 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5330d3ff322sm1784334e87.173.2024.08.20.07.30.11
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Aug 2024 07:30:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b5db0026-5f00-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724164212; x=1724769012; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=ppMyZS+5FMSiffs9dgCYzOxXzoRKybQSEG9AEVh/uZI=;
        b=PPpxZ6fhcImssvAkF6urUpuV5RmMz8X98PEdlIFMCenrniNC+o7qDkZdthXqKF7wW+
         S5rDEJWaiHo8lqX7yBo+p6Ywh/IvW5wJEOsZmtmx4z2drDkStMERvG5bzjoYKZ58RsRr
         ZkBS9gp81lYNDZmKnvB01LlYBSPRS4okrCLxtzmILWNZhw7xhDX6ISneJGlJexuDQGLP
         9VNeJfOIOJdS6xeuKb4/cnKn3APi2lr2e8rtx3X5sBCfH58B5wiTWafJuZ+kJs1PJcFm
         i/k8mQ0FPrehG8EmHHeNoRblr04JgXZevA60zGSHddoIeUGwo/pYmFETIiK6XXfUayWA
         haIQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724164212; x=1724769012;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=ppMyZS+5FMSiffs9dgCYzOxXzoRKybQSEG9AEVh/uZI=;
        b=IFwvP1H7bRhRBQwkma7st0NnT+3s2SZ72xEZizPUZygGHdnm5Ok+2PyrtomhhTJxJ2
         cpawtjuBgP2ol9Blsi3W33ApcyK1/5BgccqL0x1tasKEiMNsSbbultBBHtrZd0uajklO
         CzA2YoJyNCiPsUVQ/++MfQJsiAhPaVfg9x883xZLWt1HRPOspTOtRwkyAqbLxmKa3b31
         GUOyCmN88C35Id3bfybp2EDe7RyhxvaPqJ61zV2uClMevgDoJ4515nJPbo7/Og/JSvfW
         n4Acn1elB14EBobZSnAQ/WdH2T0WYYe3J9vPUhWhIpzgHfNrrbeRmFTql2x61iwwKzUN
         8jPQ==
X-Forwarded-Encrypted: i=1; AJvYcCXdZuvAOdTzARxwCmQnIqrbnJ/j5NCog3nQ+XMxkZXCSeWOpudU8Lu0QEkWFOvwh7yWgWBvAbocaLtnCtHy/gpVsN9vCHwqeIVeVoy/+b0=
X-Gm-Message-State: AOJu0YxA4M8h9y3h9xN9OETdTpptIyr+UMJUxga9h+g2JziH6ilLLIjA
	Wrh4d2trn0CFa4GjSL8E6uFOKbY68+6OmIoy0+5dOMXWdqTROJpB
X-Google-Smtp-Source: AGHT+IHLMp6nmn/tVarHCHwk6XpO2ARIoKfTKlovZdAfYoHj1NTbn6sxh5nlUUvp3A1yWjCmxQMsJg==
X-Received: by 2002:a05:6512:ba7:b0:52e:a68a:6076 with SMTP id 2adb3069b0e04-5331c6e4eefmr9192819e87.49.1724164211636;
        Tue, 20 Aug 2024 07:30:11 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Subject: [PATCH v2 10/12] hw/xen: pvh-common: Add support for creating PCIe/GPEX
Date: Tue, 20 Aug 2024 16:29:47 +0200
Message-ID: <20240820142949.533381-11-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820142949.533381-1-edgar.iglesias@gmail.com>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Add support for optionally creating a PCIe/GPEX controller.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 hw/xen/xen-pvh-common.c         | 76 +++++++++++++++++++++++++++++++++
 include/hw/xen/xen-pvh-common.h | 29 +++++++++++++
 2 files changed, 105 insertions(+)

diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
index 295f920442..28d7168446 100644
--- a/hw/xen/xen-pvh-common.c
+++ b/hw/xen/xen-pvh-common.c
@@ -122,6 +122,64 @@ static void xen_enable_tpm(XenPVHMachineState *s)
 }
 #endif
 
+/*
+ * We use the GPEX PCIe controller with its internal INTX PCI interrupt
+ * swizzling. This swizzling is emulated in QEMU and routes all INTX
+ * interrupts from endpoints down to only 4 INTX interrupts.
+ * See include/hw/pci/pci.h : pci_swizzle()
+ */
+static inline void xenpvh_gpex_init(XenPVHMachineState *s,
+                                    XenPVHMachineClass *xpc,
+                                    MemoryRegion *sysmem)
+{
+    MemoryRegion *ecam_reg;
+    MemoryRegion *mmio_reg;
+    DeviceState *dev;
+    int i;
+
+    object_initialize_child(OBJECT(s), "gpex", &s->pci.gpex,
+                            TYPE_GPEX_HOST);
+    dev = DEVICE(&s->pci.gpex);
+    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
+
+    ecam_reg = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
+    memory_region_add_subregion(sysmem, s->cfg.pci_ecam.base, ecam_reg);
+
+    mmio_reg = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1);
+
+    if (s->cfg.pci_mmio.size) {
+        memory_region_init_alias(&s->pci.mmio_alias, OBJECT(dev), "pcie-mmio",
+                                 mmio_reg,
+                                 s->cfg.pci_mmio.base, s->cfg.pci_mmio.size);
+        memory_region_add_subregion(sysmem, s->cfg.pci_mmio.base,
+                                    &s->pci.mmio_alias);
+    }
+
+    if (s->cfg.pci_mmio_high.size) {
+        memory_region_init_alias(&s->pci.mmio_high_alias, OBJECT(dev),
+                "pcie-mmio-high",
+                mmio_reg, s->cfg.pci_mmio_high.base, s->cfg.pci_mmio_high.size);
+        memory_region_add_subregion(sysmem, s->cfg.pci_mmio_high.base,
+                &s->pci.mmio_high_alias);
+    }
+
+    /*
+     * PVH implementations with PCI enabled must provide set_pci_intx_irq()
+     * and optionally an implementation of set_pci_link_route().
+     */
+    assert(xpc->set_pci_intx_irq);
+
+    for (i = 0; i < GPEX_NUM_IRQS; i++) {
+        qemu_irq irq = qemu_allocate_irq(xpc->set_pci_intx_irq, s, i);
+
+        sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, irq);
+        gpex_set_irq_num(GPEX_HOST(dev), i, s->cfg.pci_intx_irq_base + i);
+        if (xpc->set_pci_link_route) {
+            xpc->set_pci_link_route(i, s->cfg.pci_intx_irq_base + i);
+        }
+    }
+}
+
 static void xen_pvh_init(MachineState *ms)
 {
     XenPVHMachineState *s = XEN_PVH_MACHINE(ms);
@@ -152,6 +210,15 @@ static void xen_pvh_init(MachineState *ms)
     }
 #endif
 
+    /* Non-zero pci-ecam-size enables PCI.  */
+    if (s->cfg.pci_ecam.size) {
+        if (s->cfg.pci_ecam.size != 256 * MiB) {
+            error_report("pci-ecam-size only supports values 0 or 0x10000000");
+            exit(EXIT_FAILURE);
+        }
+        xenpvh_gpex_init(s, xpc, sysmem);
+    }
+
     /* Call the implementation specific init.  */
     if (xpc->init) {
         xpc->init(ms);
@@ -200,6 +267,9 @@ XEN_PVH_PROP_MEMMAP(ram_high)
 /* TPM only has a base-addr option.  */
 XEN_PVH_PROP_MEMMAP_BASE(tpm)
 XEN_PVH_PROP_MEMMAP(virtio_mmio)
+XEN_PVH_PROP_MEMMAP(pci_ecam)
+XEN_PVH_PROP_MEMMAP(pci_mmio)
+XEN_PVH_PROP_MEMMAP(pci_mmio_high)
 
 void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc)
 {
@@ -242,6 +312,12 @@ do {                                                                      \
         OC_MEMMAP_PROP(oc, "virtio-mmio", virtio_mmio);
     }
 
+    if (xpc->has_pci) {
+        OC_MEMMAP_PROP(oc, "pci-ecam", pci_ecam);
+        OC_MEMMAP_PROP(oc, "pci-mmio", pci_mmio);
+        OC_MEMMAP_PROP(oc, "pci-mmio-high", pci_mmio_high);
+    }
+
 #ifdef CONFIG_TPM
     if (xpc->has_tpm) {
         object_class_property_add(oc, "tpm-base-addr", "uint64_t",
diff --git a/include/hw/xen/xen-pvh-common.h b/include/hw/xen/xen-pvh-common.h
index 77fd98b9fe..bc09eea936 100644
--- a/include/hw/xen/xen-pvh-common.h
+++ b/include/hw/xen/xen-pvh-common.h
@@ -25,10 +25,29 @@ struct XenPVHMachineClass {
     /* PVH implementation specific init.  */
     void (*init)(MachineState *state);
 
+    /*
+     * set_pci_intx_irq - Deliver INTX irqs to the guest.
+     *
+     * @opaque: pointer to XenPVHMachineState.
+     * @irq: IRQ after swizzling, between 0-3.
+     * @level: IRQ level.
+     */
+    void (*set_pci_intx_irq)(void *opaque, int irq, int level);
+
+    /*
+     * set_pci_link_route: - optional implementation call to setup
+     * routing between INTX IRQ (0 - 3) and GSI's.
+     *
+     * @line: line the INTx line (0 => A .. 3 => B)
+     * @irq: GSI
+     */
+    int (*set_pci_link_route)(uint8_t line, uint8_t irq);
+
     /*
      * Each implementation can optionally enable features that it
      * supports and are known to work.
      */
+    bool has_pci;
     bool has_tpm;
     bool has_virtio_mmio;
 };
@@ -44,6 +63,12 @@ struct XenPVHMachineState {
         MemoryRegion high;
     } ram;
 
+    struct {
+        GPEXHost gpex;
+        MemoryRegion mmio_alias;
+        MemoryRegion mmio_high_alias;
+    } pci;
+
     struct {
         MemMapEntry ram_low, ram_high;
         MemMapEntry tpm;
@@ -52,6 +77,10 @@ struct XenPVHMachineState {
         MemMapEntry virtio_mmio;
         uint32_t virtio_mmio_num;
         uint32_t virtio_mmio_irq_base;
+
+        /* PCI */
+        MemMapEntry pci_ecam, pci_mmio, pci_mmio_high;
+        uint32_t pci_intx_irq_base;
     } cfg;
 };
 
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:30:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:30:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780542.1190256 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPsG-0004fD-NS; Tue, 20 Aug 2024 14:30:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780542.1190256; Tue, 20 Aug 2024 14:30:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPsG-0004cx-EG; Tue, 20 Aug 2024 14:30:16 +0000
Received: by outflank-mailman (input) for mailman id 780542;
 Tue, 20 Aug 2024 14:30:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=prYO=PT=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sgPsE-0000m9-NM
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:30:14 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b6a0bd42-5f00-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 16:30:14 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-52efc60a6e6so8080533e87.1
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:30:14 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-533449f5fdasm118978e87.284.2024.08.20.07.30.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Aug 2024 07:30:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b6a0bd42-5f00-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724164213; x=1724769013; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=qb70tZhf6O0rqG3q2lg1Kgw4jrd26x22YIO9764ldGo=;
        b=jc/8/A4rHGCO692fgEx6TruDitoNfXvLzCOzpfNVA/iJQA1p0vUhINfBmBo7JMORMz
         S1Ydq53Q72Bvp3Vr1nqltZGZ3uPCy2DO2GwzJJII1KSpySA/yWf9AmwR1KMuuKet0UeQ
         6qhzCtovZH/mrPv2WnqmUhBuXOGAJShy0p8+0bmkvnob1T5mWtYiLSdN/j8ag62dwWHx
         0kOIMs46O/QHGwG0Dyd4ZJNTKIduXV8S4xq/otTpN+lZ0xXZJcGuPMPuo5aZl1/MFUkt
         c96ciIowyZLy+VSzROVbTYeoCUSI/4qCPdEq3XOOYq3m2Q9QwkWq4W689rkCw9mdH9Q8
         SZow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724164213; x=1724769013;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=qb70tZhf6O0rqG3q2lg1Kgw4jrd26x22YIO9764ldGo=;
        b=o4p3dbZMC1lPbcw1ugVbkhjGLRT67ZqEwSK9HrxeHHAwuqjsvOOI6LwCQzwC93A5vz
         u0XQclXZ0iqUT4P9u078FrUknExRYnngFw0sTOVdKuEnHXimzNKvb/jhRXGpMlxZWvvu
         ol4fDQiLX2VJYPI1t5+DWcIlkPEedIgfI7RBsVwUQXPMR6TUiAXsLETE0mHoQj6V0msX
         jgomG5mCQ0Kg2+1C9N8hLorlwMVNNL1RHQxRec1qHTvI0xUiNzux5FRAv0J59XmTdt2Q
         ET8Rgjv/lSb+pqfL/ifiE0jrVLnaE+K0iuYCk11W/khvOxBEVA1IUGcu4durDRK+NBJV
         PVtw==
X-Forwarded-Encrypted: i=1; AJvYcCXHR52t0wziCvrjNvMi+hQBWLWaQiRJe+PEPiKde8rcf7xVV9mtdcZBNvI6SUBNFlo4J3qruysD3snczemp9aEaFHOeAkeEB9Yjzjiaff8=
X-Gm-Message-State: AOJu0YyF6cBw5Ijx4NgCIB6dQvzsklPFS7JlmIP8aoxFAKII+0R+orG6
	RVsOkx8a9gl7Hh1VOOmeYtS92/72gVNUjbZILFI9dEoPMott/jgy
X-Google-Smtp-Source: AGHT+IFoXhrlxg3cNGb0+DSA5Qu76KzL7+3HHVZt7gmKWNEWr1BFmaIm+WYR3dUl/tDDDSx61bB+zA==
X-Received: by 2002:a05:6512:641a:b0:533:4477:28a2 with SMTP id 2adb3069b0e04-53344772a8emr1193165e87.16.1724164212866;
        Tue, 20 Aug 2024 07:30:12 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Marcel Apfelbaum <marcel.apfelbaum@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	Eduardo Habkost <eduardo@habkost.net>
Subject: [PATCH v2 11/12] hw/i386/xen: Add a Xen PVH x86 machine
Date: Tue, 20 Aug 2024 16:29:48 +0200
Message-ID: <20240820142949.533381-12-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820142949.533381-1-edgar.iglesias@gmail.com>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Add a Xen PVH x86 machine based on the abstract PVH Machine.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
---
 hw/i386/xen/meson.build |   1 +
 hw/i386/xen/xen-pvh.c   | 121 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 122 insertions(+)
 create mode 100644 hw/i386/xen/xen-pvh.c

diff --git a/hw/i386/xen/meson.build b/hw/i386/xen/meson.build
index 3f0df8bc07..c73c62b8e3 100644
--- a/hw/i386/xen/meson.build
+++ b/hw/i386/xen/meson.build
@@ -4,6 +4,7 @@ i386_ss.add(when: 'CONFIG_XEN', if_true: files(
 ))
 i386_ss.add(when: ['CONFIG_XEN', xen], if_true: files(
   'xen-hvm.c',
+  'xen-pvh.c',
 ))
 
 i386_ss.add(when: 'CONFIG_XEN_BUS', if_true: files(
diff --git a/hw/i386/xen/xen-pvh.c b/hw/i386/xen/xen-pvh.c
new file mode 100644
index 0000000000..45645667e9
--- /dev/null
+++ b/hw/i386/xen/xen-pvh.c
@@ -0,0 +1,121 @@
+/*
+ * QEMU Xen PVH x86 Machine
+ *
+ * Copyright (c) 2024 Advanced Micro Devices, Inc.
+ * Written by Edgar E. Iglesias <edgar.iglesias@amd.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/error-report.h"
+#include "hw/boards.h"
+#include "sysemu/sysemu.h"
+#include "hw/xen/arch_hvm.h"
+#include <xen/hvm/hvm_info_table.h>
+#include "hw/xen/xen-pvh-common.h"
+
+#define TYPE_XEN_PVH_X86  MACHINE_TYPE_NAME("xenpvh")
+OBJECT_DECLARE_SIMPLE_TYPE(XenPVHx86State, XEN_PVH_X86)
+
+struct XenPVHx86State {
+    /*< private >*/
+    XenPVHMachineState parent;
+
+    DeviceState **cpu;
+};
+
+static DeviceState *xen_pvh_cpu_new(MachineState *ms,
+                                    int64_t apic_id)
+{
+    Object *cpu = object_new(ms->cpu_type);
+
+    object_property_add_child(OBJECT(ms), "cpu[*]", cpu);
+    object_property_set_uint(cpu, "apic-id", apic_id, &error_fatal);
+    qdev_realize(DEVICE(cpu), NULL, &error_fatal);
+    object_unref(cpu);
+
+    return DEVICE(cpu);
+}
+
+static void xen_pvh_init(MachineState *ms)
+{
+    XenPVHx86State *xp = XEN_PVH_X86(ms);
+    int i;
+
+    /* Create dummy cores. This will indirectly create the APIC MSI window.  */
+    xp->cpu = g_malloc(sizeof xp->cpu[0] * ms->smp.max_cpus);
+    for (i = 0; i < ms->smp.max_cpus; i++) {
+        xp->cpu[i] = xen_pvh_cpu_new(ms, i);
+    }
+}
+
+static void xen_pvh_instance_init(Object *obj)
+{
+    XenPVHMachineState *s = XEN_PVH_MACHINE(obj);
+
+    /* Default values.  */
+    s->cfg.ram_low = (MemMapEntry) { 0x0, 0x80000000U };
+    s->cfg.ram_high = (MemMapEntry) { 0xC000000000ULL, 0x4000000000ULL };
+    s->cfg.pci_intx_irq_base = 16;
+}
+
+/*
+ * Deliver INTX interrupts to Xen guest.
+ */
+static void xen_pvh_set_pci_intx_irq(void *opaque, int irq, int level)
+{
+    /*
+     * Since QEMU emulates all of the swizziling
+     * We don't want Xen to do any additional swizzling in
+     * xen_set_pci_intx_level() so we always set device to 0.
+     */
+    if (xen_set_pci_intx_level(xen_domid, 0, 0, 0, irq, level)) {
+        error_report("xendevicemodel_set_pci_intx_level failed");
+    }
+}
+
+static void xen_pvh_machine_class_init(ObjectClass *oc, void *data)
+{
+    XenPVHMachineClass *xpc = XEN_PVH_MACHINE_CLASS(oc);
+    MachineClass *mc = MACHINE_CLASS(oc);
+
+    mc->desc = "Xen PVH x86 machine";
+    mc->default_cpu_type = TARGET_DEFAULT_CPU_TYPE;
+
+    /* mc->max_cpus holds the MAX value allowed in the -smp cmd-line opts. */
+    mc->max_cpus = HVM_MAX_VCPUS;
+
+    /* We have an implementation specific init to create CPU objects.  */
+    xpc->init = xen_pvh_init;
+
+    /*
+     * PCI INTX routing.
+     *
+     * We describe the mapping between the 4 INTX interrupt and GSIs
+     * using xen_set_pci_link_route(). xen_pvh_set_pci_intx_irq is
+     * used to deliver the interrupt.
+     */
+    xpc->set_pci_intx_irq = xen_pvh_set_pci_intx_irq;
+    xpc->set_pci_link_route = xen_set_pci_link_route;
+
+    /* List of supported features known to work on PVH x86.  */
+    xpc->has_pci = true;
+
+    xen_pvh_class_setup_common_props(xpc);
+}
+
+static const TypeInfo xen_pvh_x86_machine_type = {
+    .name = TYPE_XEN_PVH_X86,
+    .parent = TYPE_XEN_PVH_MACHINE,
+    .class_init = xen_pvh_machine_class_init,
+    .instance_init = xen_pvh_instance_init,
+    .instance_size = sizeof(XenPVHx86State),
+};
+
+static void xen_pvh_machine_register_types(void)
+{
+    type_register_static(&xen_pvh_x86_machine_type);
+}
+
+type_init(xen_pvh_machine_register_types)
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:30:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:30:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780546.1190262 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPsH-0004rz-Jz; Tue, 20 Aug 2024 14:30:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780546.1190262; Tue, 20 Aug 2024 14:30:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgPsH-0004nI-BU; Tue, 20 Aug 2024 14:30:17 +0000
Received: by outflank-mailman (input) for mailman id 780546;
 Tue, 20 Aug 2024 14:30:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=prYO=PT=gmail.com=edgar.iglesias@srs-se1.protection.inumbo.net>)
 id 1sgPsF-0000m9-NU
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:30:15 +0000
Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com
 [2a00:1450:4864:20::231])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b7471464-5f00-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 16:30:15 +0200 (CEST)
Received: by mail-lj1-x231.google.com with SMTP id
 38308e7fff4ca-2f3b8eb3df5so56463381fa.1
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:30:15 -0700 (PDT)
Received: from gmail.com (213-67-3-247-no600.tbcn.telia.com. [213.67.3.247])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5330d41ec8bsm1774535e87.217.2024.08.20.07.30.13
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Aug 2024 07:30:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b7471464-5f00-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724164215; x=1724769015; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=KdxPAmDEdUAtpsJzqv9PT9FKB3N+OoRAOYXGitcO7RQ=;
        b=g8Jdsy4MGpXTpFcHubkj5du1GIXuzn9nL6875ttmnqv61vHVO1JFBkLA5KvyBdsFgl
         emoeJFapBRz4p8EWc5D6fNZbIlaSAkFutd3wyKeDYQtLwBPjnhjzfxxvWcHmcyfvrmfH
         Z+GZ3q20MBefnORRu0lZKS/CwYT2a83p45qO5TxyQXJBf1zQxEMReFYRLVx8YWtP4NeS
         kIbwsO2CS2P3+K5CPex+LkZ3NYv7IVdYwjWW4WygVqj2zdZNVVwnyYcOIth8TCFXBQji
         ufmT0hHHkmYu9iVg6WAo2gqH1lS7rgmFoQDtYUY86EhXOfGrkapfYgj93TeZagOehwYv
         8yog==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724164215; x=1724769015;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=KdxPAmDEdUAtpsJzqv9PT9FKB3N+OoRAOYXGitcO7RQ=;
        b=daXCqnafLLpOKFjnX+E7P4NLHwADTKs1DF6XULE6ZJXhQ3DNMSLhC1U05vY/ghXbtS
         nq0pq95lgHQaApQERlz819zGnu84N0aUMzgQxoOUN444lgBPTgCPBVV5UkDIhms9Tags
         vHhT49P1ij4QgCFBL8BfuI7OziVNwaj/Q/SzchX+yxPYxsinxgFe6rodYRw4e+FLluyg
         elb9VNYO99LmD6L891OWQQM04UI6H2cyXwB+gImc1t/eZHUq/T7+6nscFO+vG+X8v5jF
         f1mLdIMiW/JjPWjdjhxaB6/kNJBMJGlaeApn5L7JouRswc9IelDDhFmXTx3ldHEI+Gc8
         lZLA==
X-Forwarded-Encrypted: i=1; AJvYcCWGss+yL5j3PngGW905udKFc7MwO7r5eMZ7uvyM+Fp3hP27s86P8M/r/gGPE/b1mt9A7cMYAK62YSniub3/osRdLkzSu+Mq6/dHVSpz2JE=
X-Gm-Message-State: AOJu0Yw8EaENEhR2x70G/qwbWiQp97hdof3hYlE6ygDJLlUt/gMqbWdt
	eGb4+tJr5fp3mHI31w/5ciUHpPr/sln4bvxAOo/51bMZAzl+S+4ySduLNOK1
X-Google-Smtp-Source: AGHT+IH2aSjaMdTU2w0L6jdfmyJXJpGAlgjDdskYkq7lMNexOEvEkzPUF5ILk79x6nw61ZRcBw/gvA==
X-Received: by 2002:a05:6512:3195:b0:530:d088:233f with SMTP id 2adb3069b0e04-5331c6d99c0mr9799180e87.40.1724164213973;
        Tue, 20 Aug 2024 07:30:13 -0700 (PDT)
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: qemu-devel@nongnu.org
Cc: sstabellini@kernel.org,
	anthony@xenproject.org,
	paul@xen.org,
	peter.maydell@linaro.org,
	alex.bennee@linaro.org,
	xenia.ragiadakou@amd.com,
	jason.andryuk@amd.com,
	edgar.iglesias@amd.com,
	xen-devel@lists.xenproject.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [PATCH v2 12/12] docs/system/i386: xenpvh: Add a basic description
Date: Tue, 20 Aug 2024 16:29:49 +0200
Message-ID: <20240820142949.533381-13-edgar.iglesias@gmail.com>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240820142949.533381-1-edgar.iglesias@gmail.com>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
 MAINTAINERS                 |  1 +
 docs/system/i386/xenpvh.rst | 49 +++++++++++++++++++++++++++++++++++++
 docs/system/target-i386.rst |  1 +
 3 files changed, 51 insertions(+)
 create mode 100644 docs/system/i386/xenpvh.rst

diff --git a/MAINTAINERS b/MAINTAINERS
index c2fb0c2f42..c14ac014e2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -560,6 +560,7 @@ F: include/sysemu/xen.h
 F: include/sysemu/xen-mapcache.h
 F: stubs/xen-hw-stub.c
 F: docs/system/arm/xenpvh.rst
+F: docs/system/i386/xenpvh.rst
 
 Guest CPU Cores (NVMM)
 ----------------------
diff --git a/docs/system/i386/xenpvh.rst b/docs/system/i386/xenpvh.rst
new file mode 100644
index 0000000000..354250f073
--- /dev/null
+++ b/docs/system/i386/xenpvh.rst
@@ -0,0 +1,49 @@
+Xen PVH machine (``xenpvh``)
+=========================================
+
+Xen supports a spectrum of types of guests that vary in how they depend
+on HW virtualization features, emulation models and paravirtualization.
+PVH is a mode that uses HW virtualization features (like HVM) but tries
+to avoid emulation models and instead use passthrough or
+paravirtualized devices.
+
+QEMU can be used to provide PV virtio devices on an emulated PCIe controller.
+That is the purpose of this minimal machine.
+
+Supported devices
+-----------------
+
+The x86 Xen PVH QEMU machine provide the following devices:
+
+- RAM
+- GPEX host bridge
+- virtio-pci devices
+
+The idea is to only connect virtio-pci devices but in theory any compatible
+PCI device model will work depending on Xen and guest support.
+
+Running
+-------
+
+The Xen tools will typically construct a command-line and launch QEMU
+for you when needed. But here's an example of what it can look like in
+case you need to construct one manually:
+
+.. code-block:: console
+
+    qemu-system-i386 -xen-domid 3 -no-shutdown        \
+      -chardev socket,id=libxl-cmd,path=/var/run/xen/qmp-libxl-3,server=on,wait=off \
+      -mon chardev=libxl-cmd,mode=control             \
+      -chardev socket,id=libxenstat-cmd,path=/var/run/xen/qmp-libxenstat-3,server=on,wait=off \
+      -mon chardev=libxenstat-cmd,mode=control        \
+      -nodefaults                                     \
+      -no-user-config                                 \
+      -xen-attach -name g0                            \
+      -vnc none                                       \
+      -display none                                   \
+      -device virtio-net-pci,id=nic0,netdev=net0,mac=00:16:3e:5c:81:78 \
+      -netdev type=tap,id=net0,ifname=vif3.0-emu,br=xenbr0,script=no,downscript=no \
+      -smp 4,maxcpus=4                                \
+      -nographic                                      \
+      -machine xenpvh,ram-low-base=0,ram-low-size=2147483648,ram-high-base=4294967296,ram-high-size=2147483648,pci-ecam-base=824633720832,pci-ecam-size=268435456,pci-mmio-base=4026531840,pci-mmio-size=33554432,pci-mmio-high-base=824902156288,pci-mmio-high-size=68719476736 \
+      -m 4096
diff --git a/docs/system/target-i386.rst b/docs/system/target-i386.rst
index 1b8a1f248a..23e84e3ba7 100644
--- a/docs/system/target-i386.rst
+++ b/docs/system/target-i386.rst
@@ -26,6 +26,7 @@ Architectural features
    i386/cpu
    i386/hyperv
    i386/xen
+   i386/xenpvh
    i386/kvm-pv
    i386/sgx
    i386/amd-memory-encryption
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 14:42:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 14:42:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780623.1190282 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgQ3v-0002h2-Kx; Tue, 20 Aug 2024 14:42:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780623.1190282; Tue, 20 Aug 2024 14:42:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgQ3v-0002gv-I1; Tue, 20 Aug 2024 14:42:19 +0000
Received: by outflank-mailman (input) for mailman id 780623;
 Tue, 20 Aug 2024 14:42:17 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=z0MZ=PT=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sgQ3t-0002gn-HX
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 14:42:17 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 64711be6-5f02-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 16:42:15 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a8657900fc1so65147966b.1
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 07:42:15 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838c66e2sm768425466b.3.2024.08.20.07.42.13
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 20 Aug 2024 07:42:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 64711be6-5f02-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724164935; x=1724769735; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=x+17sG+zrKvEx+m7iwaQzvbqn1AqzdTNJJMIWpFHezg=;
        b=JmiCHMmPrNplrLWkwT2Idw/3NV14Ttr3aWcWnNi84bziuvMJLWKf482wPLtOSObSBs
         KK8lYJF2LU6l+bcQkbLXjl5+VMnm1Er7Cz+VeAgM1dFm4+EAqkgaaLpXRw2nVXYJEZ84
         LYb6VGDxE5CniMdls67d1LU2Iq8+x+IQVJ6JeX6ls9fmMJqGOQEoTC1mkYDMBOYkVNEP
         FlFq0PXp3rfxbLhaRQXNKThwFIAZzwWkjXsJhCUy/eQD/e19WPiRXrIAAcvuOxlRiJAm
         Mw03z17CwmlBUlgBm/kDRRDt8oRVLjYjJhC1f9A1AJkRwgBQe6LvJDPj+rc/3/uhY61q
         piRw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724164935; x=1724769735;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=x+17sG+zrKvEx+m7iwaQzvbqn1AqzdTNJJMIWpFHezg=;
        b=mP83AsR/2EoR1XBY8XdqK4fZqGkeIzF+t2InO5JrzO3Z29rjoyoK3mMHOXswdOGf/d
         YgHRuT1NU07N2UJYKwCVd9nOBfTfOyT+mr2nr2J4l4WXgFENa5EOi3GdRWA5z7efdSOs
         g5Tkusq2c6BBBccaDvFQKnzwx3SRZrlMzgo3uvwXhbm/sUB2XvoQzrX3mBaAR7VgVSLi
         WSocTTPVYuRlvgbMs6DCxlwgl9QwEG8Bx2hteQhnYkyVeIPhLlTmu3FcykbOgn5zc9mN
         8zXuj37j3u+xXCfzYyZgXFYqaW20SsMW3rBcq2D2XiLuDvw6lp1IH58Z4RdBFA16/GYn
         A46A==
X-Forwarded-Encrypted: i=1; AJvYcCU2NqqMMYsJ0CS//3Gr8Qrp5sb+9d5TT/z/cQRXgIb4mhiPDT3zjMKSCxNaUGFHdZ28nK50ZownFHs=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzGIIkk4FU9sKU4G09nENy97RfCpZW7bxjwB0Xdc8BWS6KZC/zR
	83mdT/wpca7cmYKTEdFLh1uJCpe4xGpVBzp3ndRyNqCGkx+yR3cXWibVQg==
X-Google-Smtp-Source: AGHT+IFO8MsCnemIz+hjjhiUKpwx3kYx+ruEd1nk21ZbA4ym+z/YeMns9GVMzLZkKHXYGxXf6O5lWg==
X-Received: by 2002:a17:907:2d88:b0:a7a:c083:8579 with SMTP id a640c23a62f3a-a8392a4b2e0mr1054862366b.62.1724164934270;
        Tue, 20 Aug 2024 07:42:14 -0700 (PDT)
Message-ID: <bd4226d7002d912fb8f20db673b45c034352f200.camel@gmail.com>
Subject: Re: [PATCH v4 6/7] xen/riscv: page table handling
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Tue, 20 Aug 2024 16:42:12 +0200
In-Reply-To: <4a7f44ce-e5ba-4a36-9b0b-7cd7c14cc846@suse.com>
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
	 <8362795280a48702bef6f01d41d148edcf299935.1723214540.git.oleksii.kurochko@gmail.com>
	 <85a4e760-07af-42bd-ac27-12a4fa5172cc@suse.com>
	 <1551cd4dd3b5fcf6aea59a972b60fa6b3b06bed6.camel@gmail.com>
	 <4a7f44ce-e5ba-4a36-9b0b-7cd7c14cc846@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.3 (3.52.3-1.fc40app2) 
MIME-Version: 1.0

On Tue, 2024-08-20 at 15:47 +0200, Jan Beulich wrote:
> On 20.08.2024 15:18, oleksii.kurochko@gmail.com=C2=A0wrote:
> > On Tue, 2024-08-13 at 12:31 +0200, Jan Beulich wrote:
> > > > + * Sanity check of the entry
> > > > + * mfn is not valid and we are not populating page table. This
> > > > means
> > >=20
> > > How does this fit with ...
> > >=20
> > > > + * we either modify entry or remove an entry.
> > > > + */
> > > > +static bool pt_check_entry(pte_t entry, mfn_t mfn, unsigned
> > > > int
> > > > flags)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 /* Sanity check when modifying an entry. */
> > > > +=C2=A0=C2=A0=C2=A0 if ( (flags & PTE_VALID) && mfn_eq(mfn, INVALID=
_MFN) )
> > >=20
> > > ... the MFN check here? And why is (valid,INVALID_MFN) an
> > > indication
> > > of a modification?
> > Because as mentioned here:
> > ```
> > /*
> > =C2=A0* If `mfn` equals `INVALID_MFN`, it indicates that the following
> > page
> > table
> > =C2=A0* update operation might be related to either populating the
> > table,
> > =C2=A0* destroying a mapping, or modifying an existing mapping.
> > =C2=A0*/
> > static int pt_update(unsigned long virt,
> > ```
>=20
> That's in the description of another function. How would one know
> that
> the rules on (mfn,flags) tuples there would apply here as well,
> without
> you saying so explicitly? It may not be necessary to repeat the other
> comment, but at least you want to reference it.
>=20
> > And so if requested flags are PTE_VALID ( present ) and mfn=3DINVALID
> > it
> > will mean that we are going to modify an entry.
> >=20
> >=20
> > > But then ...
> > >=20
> > > > +=C2=A0=C2=A0=C2=A0 {
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* We don't allow modif=
ying an invalid entry. */
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( !pte_is_valid(entr=
y) )
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 printk("Modifying invalid entry is not
> > > > allowed.\n");
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 return false;
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > >=20
> > > ... I also don't understand what this is about. IOW I'm afraid
> > > I'm
> > > still confused about the purpose of this function as well as the
> > > transitions you want to permit / reject.=C2=A0
> > In the case if the caller call modify_xen_mappings() on a region
> > that
> > doesn't exist.
>=20
> Perhaps. What I think is missing is a clear statement somewhere to
> describe
> what the various combinations of (mfn,flags) mean, in terms of the
> operation
> to be carried out. This may then also help with ...
>=20
> > > I wonder whether the
> > > flags & PTE_VALID and pte_is_valid(entry) aren't in need of
> > > swapping.
> > I am not sure that I understand what you mean.
>=20
> ... this: It's hard to see what cannot be understood about my earlier
> comment. In the code commented on you have a flags & PTE_VALID check
> and a
> pte_is_valid(entry) one. I'm wondering whether the two simply are the
> wrong
> way round.
Sure. I'll add additional comments and reference in the next patch
version to clarify that moment.

>=20
> > > > +/* Update an entry at the level @target. */
> > > > +static int pt_update_entry(mfn_t root, unsigned long virt,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 mfn_t mfn, unsigned int target,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 unsigned int flags)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 int rc;
> > > > +=C2=A0=C2=A0=C2=A0 unsigned int level =3D HYP_PT_ROOT_LEVEL;
> > > > +=C2=A0=C2=A0=C2=A0 pte_t *table;
> > > > +=C2=A0=C2=A0=C2=A0 /*
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * The intermediate page tables are read-o=
nly when the MFN
> > > > is
> > > > not valid
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * and we are not populating page table.
> > >=20
> > > The way flags are handled in PTEs, how can page tables be read-
> > > only?
> > This is not needed for everyone case. In case of entry removing an
> > intermediate page table should be created in case when the user is
> > trying to remove a mapping that doesn't exist.
>=20
> I don't follow: For one, how is this related to "read-only"-ness? And
> then, why would any kind of removal, whether of a present or non-
> present mapping, ever result in page tables being created?
If the mapping doesn't exist and it was requested ( accidentally by the
caller ) then then the logic of PT update will try to allocate the page
table what is actually a bogus behaviour... I have to double-check
that.

>=20
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * This means we either modify permissions=
 or remove an
> > > > entry.
> > >=20
> > > From all I can determine we also get here when making brand new
> > > entries.
> > > What am I overlooking?
> > Yes, but in this case an intermediate page tables should be
> > read_only,
> > so alloc_only will be true and it will be allowed to create new
> > intermediate page table.
>=20
> Hmm, so instead of "read-only" do you maybe mean page tables are not
> supposed to be modified? There's a difference here: When they're
> read-only, you can't write to them (or a fault will result). Whereas
> when in principle they can be modified, there still may be a rule
> saying "in this case they shouldn't be altered".

There is such rule which checks that page tables aren't supposed to be
modified ( so that is why they are read-only ):
```
    /* Sanity check when modifying an entry. */
    if ( (flags & PTE_VALID) && mfn_eq(mfn, INVALID_MFN) )
    {
	...

        /* We don't allow modifying a table entry */
        if ( pte_is_table(entry) )
        {
            printk("Modifying a table entry is not allowed.\n");
            return false;
        }
```

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 15:52:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 15:52:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780657.1190291 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgR99-00029t-Bt; Tue, 20 Aug 2024 15:51:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780657.1190291; Tue, 20 Aug 2024 15:51:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgR99-00029m-98; Tue, 20 Aug 2024 15:51:47 +0000
Received: by outflank-mailman (input) for mailman id 780657;
 Tue, 20 Aug 2024 15:51:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgR97-00029c-Gt; Tue, 20 Aug 2024 15:51:45 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgR97-000152-8d; Tue, 20 Aug 2024 15:51:45 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgR96-0003pH-Qc; Tue, 20 Aug 2024 15:51:44 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sgR96-0006sr-Q5; Tue, 20 Aug 2024 15:51:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=mnHt1w+OO+RZZ+M2jibvwx5dsoHtcmYRysubRIuKsXA=; b=LkTO00J2fYtjjdWNK4b6qjzgwH
	Rrk2EKi3w3qGWI310g7g2VIExGh/B8YsYM10Ed3rhVZd4AWWffj35rpR8UUhOkTzQYtHItySltIdL
	7KYEh1SPdNaQb4AWmrnukdK9RpBHr0QeLElddwgnkJEPvLvUzFsTdQZ4uEBR0B8R+Fwg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187289-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187289: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=48e4ba59a3756aad743982da16bf9b5120d91a0c
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 20 Aug 2024 15:51:44 +0000

flight 187289 qemu-mainline real [real]
flight 187294 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187289/
http://logs.test-lab.xenproject.org/osstest/logs/187294/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 qemuu                48e4ba59a3756aad743982da16bf9b5120d91a0c
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  348 days
Failing since        182723  2023-09-07 18:19:05 Z  347 days   25 attempts
Testing same since   187282  2024-08-19 07:59:49 Z    1 days    2 attempts

------------------------------------------------------------
619 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 179901 lines long.)


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 16:24:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 16:24:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780671.1190302 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgReb-0000B7-Sq; Tue, 20 Aug 2024 16:24:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780671.1190302; Tue, 20 Aug 2024 16:24:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgReb-0000Az-Ph; Tue, 20 Aug 2024 16:24:17 +0000
Received: by outflank-mailman (input) for mailman id 780671;
 Tue, 20 Aug 2024 16:24: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=axOY=PT=bounce.vates.tech=bounce-md_30504962.66c4c327.v1-d5d912f90e9942e39efed96c854fe1c9@srs-se1.protection.inumbo.net>)
 id 1sgRea-0000Aa-GM
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 16:24:16 +0000
Received: from mail186-11.suw21.mandrillapp.com
 (mail186-11.suw21.mandrillapp.com [198.2.186.11])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a36831f0-5f10-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 18:24:14 +0200 (CEST)
Received: from pmta10.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail186-11.suw21.mandrillapp.com (Mailchimp) with ESMTP id
 4WpFCW6SVjzLfH7VX
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 16:24:07 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 d5d912f90e9942e39efed96c854fe1c9; Tue, 20 Aug 2024 16:24:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a36831f0-5f10-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724171047; x=1724431547;
	bh=oREGtW1Qw8NPzQcTfa6qhs8+JE+YDa7gTH9PgR4BUBQ=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=xjwKHlTc85uuiblSlqsnPS8TRAKHaydf4gTsCE0ZqxKsYA3DVsFmLIxzRARz8xk0p
	 RYGe5yz/RfflNQIutbL8JQiG68LiErANoCk6eMtq3reepPnqW9/CiI1uMDWjTZwM/U
	 o/Hs0Lvn8wHjV6O+CNz3YZntAdiRkRzmSpNXBLTimMR7QxTiR3qJPOhBo3IZEjvoxY
	 5jnwf/WqFEtkAv47JEqJi8a30Cm6bcP16PKNWuYZtIZW582op31pHM4JjunIqW4IRi
	 uQx3Vw/PhbSahKoZl7qjweAEYvLO6Y/RyWbtMm90zZfjfLs0SnqR21cGwUh7Ad0QIZ
	 VECRrI9UQkUNg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724171047; x=1724431547; i=anthony.perard@vates.tech;
	bh=oREGtW1Qw8NPzQcTfa6qhs8+JE+YDa7gTH9PgR4BUBQ=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=prtqHUUfnM9bEgZARu9ZU+aqruzNTNg7vwfN2snNnPkQogc2G4i/nEPcwBIFLERO4
	 SlKt8T6L8bY48xGTrv7SevLaGi1uf2qFAp0e1gMCd3Bcw8oScH4Z+/MGRduytmL5sH
	 dPqBdhwwU7/8RfVtOkr0fq1pGkeLYXr1KltJMSVQ8GDSnSszb6oO6swio1onCT+lL9
	 hgUX5Q4iex4xnPUsLLzxW8P5ul5+7fl6ztFdxFLlsO+q7adtPw1AXohZtFLl/RvCip
	 FhD9QpkK9xCscYQyFRcBnI2Mf374pF/FSDvTjVxsDQ7o2INhF6iPCHORXFXskKadLB
	 h8vS8Iu8v7I3g==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=20v2]=20tools/helpers/init-dom0less:=20fix=20vcpu=20availability?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724171046984
To: Amneesh Singh <a-singh21@ti.com>
Cc: xen-devel@lists.xenproject.org
Message-Id: <ZsTDJhcfFpm23oHO@l14>
References: <20240820080416.323725-1-a-singh21@ti.com>
In-Reply-To: <20240820080416.323725-1-a-singh21@ti.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.d5d912f90e9942e39efed96c854fe1c9?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240820:md
Date: Tue, 20 Aug 2024 16:24:07 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Tue, Aug 20, 2024 at 01:34:17PM +0530, Amneesh Singh wrote:
> diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c
> index fee9345..722a5af 100644
> --- a/tools/helpers/init-dom0less.c
> +++ b/tools/helpers/init-dom0less.c
> @@ -167,15 +167,20 @@ retry_transaction:
>      /* /domain */
>      if (!do_xs_write_dom(xsh, t, domid, "vm", vm_val_str)) goto err;
>      if (!do_xs_write_dom(xsh, t, domid, "name", dom_name_str)) goto err;
> -    if (!do_xs_write_dom(xsh, t, domid, "cpu", "")) goto err;

You should probably keep this node even if "*/availability" isn't going
to be written. It might be useful for watching everything under the
"cpu" node. (libxl create this node independently from all the other
"availability" sub-nodes.)

> @@ -330,14 +336,24 @@ int main(int argc, char **argv)
>  
>      for (i = 0; i < nb_vm; i++) {
>          domid_t domid = info[i].domid;
> +        libxl_vcpuinfo *vcpuinfo;
> +        int nb_vcpu = 0, nr_cpus = 0;
> +
>  
>          /* Don't need to check for Dom0 */
>          if (!domid)
>              continue;
>  
> +        vcpuinfo = libxl_list_vcpu(ctx, domid, &nb_vcpu, &nr_cpus);
> +
> +        if (!vcpuinfo) {
> +          fprintf(stderr, "libxl_list_vcpu failed.\n");
> +          nb_vcpu = 0;

Is there any value to keep going if libxl_list_vcpu() fails?
Or is the reasoning is that cpu/*/availability was broken before, so
it's not important enough to stop init-dom0less?


Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 16:30:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 16:30:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780678.1190313 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgRkD-00028R-GO; Tue, 20 Aug 2024 16:30:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780678.1190313; Tue, 20 Aug 2024 16:30:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgRkD-000281-BY; Tue, 20 Aug 2024 16:30:05 +0000
Received: by outflank-mailman (input) for mailman id 780678;
 Tue, 20 Aug 2024 16:30:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=yfvp=PT=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgRkC-0001vs-Mv
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 16:30:04 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 73403ea3-5f11-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 18:30:02 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a83856c6f51so307849266b.2
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 09:30:02 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bebc081cf5sm6906778a12.90.2024.08.20.09.30.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 09:30:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 73403ea3-5f11-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724171402; x=1724776202; 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=e6Gv6Db5kswHeBVVZ97FVUOYbze1tncphl99p1mwsJA=;
        b=BeCX6pGruOxotGKxQyDDI0KkbSKIBRWv7aRL6/iw0jh8+U4t1xqLdbkNw0unh4vbD1
         ZVJVSCiBkECbQxNhWzVi0haZvvIlDPEmgaX/pSB+hzOp6gXVSGe4TWfAzLv6bZZBE+Qd
         SsKXrNukKrG5DVxiUSBn6t/Nyr6AvHLxPoXqZ6rQhnmIEbh7C0P/MI9ujbote8m3Q/Ha
         1g5qqvroy3W9KdXc1A1/zxvYf7W6JKAkXqPUbeLcODsREFAOFXYw4pNOlrDHncvJN9/a
         ff1hWwDajY7FZi1r2b9h5hj0babHsrthRPZ4uy4ghhkzj9fNqJd42PP2K1xD2mh9i+Cd
         vFbQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724171402; x=1724776202;
        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=e6Gv6Db5kswHeBVVZ97FVUOYbze1tncphl99p1mwsJA=;
        b=RXIlOQRTT2jHXyY7RU708z8sqKCWziQBXkmrBe5pEN0QNK0YMAa0azYca2nJqgkvin
         BS2RjAcLrrkYLpf3hMiqDXhA8vvW3O+dSJXsJqhJsjcMFOqGzsJCeJ4ecgpyI8FEHNSJ
         VVNKgwU8xccAJ3TRc/pohDp0hmULD+5gVnlVKNRMJopVMyHbYLNAnpq+H7kJIhCgh/Ff
         CpVr2Jzo2DOU7VF1zIXpfwzFy6yINfNAOepeOahKl02XaULH4toe8yaBFDYCOjcpGEtn
         T1xGHDcCQSLtacphMsIUoMnl1bVWOWVGWoBq9FvDtboitT9T/9c5/rEw7kvW+FidVxHy
         3wAg==
X-Forwarded-Encrypted: i=1; AJvYcCVm+B4AH0RJFpF4up9LJZrJ4OTukk76ZBj+0Jgp5sepSyRD0U2Tn1gZHeHVoyWaeWgL5HKhhafqkiIg48ZDVH9MztUIVeVXuvugq2H2mDY=
X-Gm-Message-State: AOJu0YzcrZI0Pcbst/Gj28Zu6rzrfiyBdihUqV3dDwr1NhlWdpiIqec+
	gw0yrJfDbCqVPSx6dWA5uS52DjcoVrfliTgS+zVWpLhIXwen6OftfmkMGF5Uzw==
X-Google-Smtp-Source: AGHT+IH9TcqOu73H3pE2yKU+l2FSgTL9VkXZNJrhqjnXMZe7iuOwEjPXmyRymcHiAnWXhAqWZPRa9A==
X-Received: by 2002:a05:6402:1942:b0:5a1:2ce9:f416 with SMTP id 4fb4d7f45d1cf-5beca8e4022mr11422473a12.37.1724171401923;
        Tue, 20 Aug 2024 09:30:01 -0700 (PDT)
Message-ID: <2e28bc2c-250f-44eb-9926-e66c72312ef8@suse.com>
Date: Tue, 20 Aug 2024 18:30:00 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 6/7] xen/riscv: page table handling
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1723214540.git.oleksii.kurochko@gmail.com>
 <8362795280a48702bef6f01d41d148edcf299935.1723214540.git.oleksii.kurochko@gmail.com>
 <85a4e760-07af-42bd-ac27-12a4fa5172cc@suse.com>
 <1551cd4dd3b5fcf6aea59a972b60fa6b3b06bed6.camel@gmail.com>
 <4a7f44ce-e5ba-4a36-9b0b-7cd7c14cc846@suse.com>
 <bd4226d7002d912fb8f20db673b45c034352f200.camel@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: <bd4226d7002d912fb8f20db673b45c034352f200.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 20.08.2024 16:42, oleksii.kurochko@gmail.com wrote:
> On Tue, 2024-08-20 at 15:47 +0200, Jan Beulich wrote:
>> On 20.08.2024 15:18, oleksii.kurochko@gmail.com wrote:
>>> On Tue, 2024-08-13 at 12:31 +0200, Jan Beulich wrote:
>>>> From all I can determine we also get here when making brand new
>>>> entries.
>>>> What am I overlooking?
>>> Yes, but in this case an intermediate page tables should be
>>> read_only,
>>> so alloc_only will be true and it will be allowed to create new
>>> intermediate page table.
>>
>> Hmm, so instead of "read-only" do you maybe mean page tables are not
>> supposed to be modified? There's a difference here: When they're
>> read-only, you can't write to them (or a fault will result). Whereas
>> when in principle they can be modified, there still may be a rule
>> saying "in this case they shouldn't be altered".
> 
> There is such rule which checks that page tables aren't supposed to be
> modified ( so that is why they are read-only ):

Hmm, you're saying "read-only" again in reply to me explaining that this
isn't the correct term here. I find this increasingly confusing.

Jan

> ```
>     /* Sanity check when modifying an entry. */
>     if ( (flags & PTE_VALID) && mfn_eq(mfn, INVALID_MFN) )
>     {
> 	...
> 
>         /* We don't allow modifying a table entry */
>         if ( pte_is_table(entry) )
>         {
>             printk("Modifying a table entry is not allowed.\n");
>             return false;
>         }
> ```
> 
> ~ Oleksii



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 17:29:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 17:29:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780692.1190322 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgSfJ-00035J-Ko; Tue, 20 Aug 2024 17:29:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780692.1190322; Tue, 20 Aug 2024 17:29:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgSfJ-00035C-HQ; Tue, 20 Aug 2024 17:29:05 +0000
Received: by outflank-mailman (input) for mailman id 780692;
 Tue, 20 Aug 2024 17:29:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eMuN=PT=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sgSfI-000356-Ba
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 17:29:04 +0000
Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com
 [2607:f8b0:4864:20::f2b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b08f9caa-5f19-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 19:29:01 +0200 (CEST)
Received: by mail-qv1-xf2b.google.com with SMTP id
 6a1803df08f44-6bf9081b650so16967816d6.3
 for <xen-devel@lists.xenproject.org>; Tue, 20 Aug 2024 10:29:02 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6bf6ff0feeesm53268776d6.145.2024.08.20.10.28.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 20 Aug 2024 10:28:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b08f9caa-5f19-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724174941; x=1724779741; 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=UVLafZDf3VHIP7JQuhcXbfCo2OH33JivxKX+lEXhcnU=;
        b=Dsm9tQzFPdsGTuFCjRXvMaupFSOXTb9IMxozqpeNnbZZVbeoVieAOUd1F5rbuk+qZG
         MzFDWiPvtg2MY/Wbn5RYVGNUuBy6GamQo2ZN82HJozIBvYcQqIqUVHBRLAwO0PJ+Y1VD
         khtD46O392zFtxSkOjYWpo2OhzdS/AYHwAAsg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724174941; x=1724779741;
        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=UVLafZDf3VHIP7JQuhcXbfCo2OH33JivxKX+lEXhcnU=;
        b=SPnzxNYBdYH+RWK0ZMsYBIu/NQcXC7kFNjdy0OPMUsqAF1iFILZngbmekhB4lgm+X3
         24POC3dkcSswoY+rBLaw4hIWpyDkrs1vImClbgW72pMILKOcnUVcFQF4WTFeobjuE9Dp
         k3+A4FwHKiiq5Zmwg5x6Q6NRxgCFaV7IzyxzUbeQWYsjDbApBBt+6k9bvyPxY+RtdJkm
         ry4ziu8VUbr/OG7jSNAGXzJzKFW7Tli1hxhzPQZ5AjsFnhj7yVuj5sLS/60ifx6zL8qv
         J7pg3PrmUfDP1pVICxr4m1HgfwKF/H3ReamftRqjmmAwCuBxqkSPgw51zQyQqSZDdksi
         Fz/A==
X-Forwarded-Encrypted: i=1; AJvYcCU+uM+ZPNe039zHiWtBl2HUEVkmJJxjfUSzpahRrMPii+8EOa03JqPzl+rkk3twFdTNEo81lXvYUwU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YybLFpBNcQKXcTzVoPA/QHYcFR2o9xjTve5SltByhBJXb3uvVvR
	Yr4pa79bqoTHGDfhH3Z4SrpWgcWXFVP7juovq1MqhxNC0w92M34KhmzagyHJH/Mt66hDRt1CX3J
	T
X-Google-Smtp-Source: AGHT+IHHa7XnHEm7g/Dh6RbdUKzrHJ1J3QgaDx0wqBH3K8Hd3AM6O9n9zcl2by93qudIC/4vTzR5Wg==
X-Received: by 2002:a05:6214:5547:b0:6b7:aed6:8470 with SMTP id 6a1803df08f44-6bfa9f9de42mr25766376d6.28.1724174940774;
        Tue, 20 Aug 2024 10:29:00 -0700 (PDT)
Message-ID: <bd7c7155-4eae-4e3a-a0d2-dec48d8d94f7@citrix.com>
Date: Tue, 20 Aug 2024 18:28:56 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/3] x86/pv: Introduce x86_merge_dr6() and fix
 do_debug()
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240815131600.4037415-1-andrew.cooper3@citrix.com>
 <20240815131600.4037415-2-andrew.cooper3@citrix.com>
 <82f78de2-3d93-4e51-a845-5bb96559a4cf@suse.com>
 <c02c15d6-9f59-41ff-aaf5-499bfffe4b8e@citrix.com>
 <89137a5a-4d7d-469e-a60c-3c6f649ee4f5@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <89137a5a-4d7d-469e-a60c-3c6f649ee4f5@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 16/08/2024 7:11 am, Jan Beulich wrote:
> On 15.08.2024 18:34, Andrew Cooper wrote:
>> On 15/08/2024 4:41 pm, Jan Beulich wrote:
>>> On 15.08.2024 15:15, Andrew Cooper wrote:
>>>> Pretty much everywhere in Xen the logic to update %dr6 when injecting #DB is
>>>> buggy.  The architectural behaviour is to overwrite B{0..3} (rather than
>>>> accumulate) and accumulate all other bits.
>>> Just to double check (after 6 years I clearly don't recall anything that isn't
>>> written down in the description): The SDM pretty vaguely says "Certain debug
>>> exceptions may clear bits 0-3." What other information sources are there to
>>> make this less uncertain? (Picking an old hardcopy from the shelf, that
>>> confirms that long ago DR6 was indeed documented as all sticky.)
>> Well, "talking with the architects", but as always "it's complicated".
>>
>> The debug infrastructure has had several breaking changes in it over the
>> years (e.g. the reserved bits didn't use to be f's), and this one
>> probably changed with the introduction of superscalar pipelines.  That
>> said, I don't think I've ever found a Spec Update / Revision Guide that
>> doesn't have one "oops we don't do breakpoints properly in this case"
>> erratum listed.
>>
>> I'm informed it's "most going on all exceptions" these days, and the
>> behaviour here did come mostly from my discussions about XSA-308 (or
>> rather, the pre-security angle where it was just a bugfix) with Intel.
>>
>> A guest that does clear the status bits every #DB won't notice, and one
>> that doesn't will have problems on real hardware.
>>
>> But I can reword if if you'd prefer?
> If I may ask, I'd like it to at least be clarified that documentation isn't
> quite precise here. Kind of to soften "architectural behaviour" a little.

I've done some experimenting by pre/reloading %dr6 with ~DR6_DEFAULT
(i.e. all sticky bits asserted).

The only debug event I can find which does not clear breakpoints is
ICEBP on AMD.

ICEBP on Intel, and all combinations of singlestep/breakpoint/general
detect including SS-delayed on both Intel and AMD clear the breakpoint bits.

I'll note this, but given how broken ICEBP virt is on AMD (i.e. not
virtualised at all), I'm not inclined to special case it.


Also, I've found
https://lore.kernel.org/xen-devel/20230915203628.837732-1-andrew.cooper3@citrix.com/
which I'd totally forgotten about, which is mostly better
reviewed/acked, and contains some fixes that I'd missed when (re)doing
this part.

I'm going to pick out what I can from both of these series, because
there's still some breaking errors found in a Linux HVM VM which I was
trying to fix for 4.18 that are still not addressed...

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 17:30:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 17:30:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780698.1190333 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgSgg-0004So-W4; Tue, 20 Aug 2024 17:30:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780698.1190333; Tue, 20 Aug 2024 17:30:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgSgg-0004SS-RK; Tue, 20 Aug 2024 17:30:30 +0000
Received: by outflank-mailman (input) for mailman id 780698;
 Tue, 20 Aug 2024 17:30:29 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgSgf-0004SG-JB; Tue, 20 Aug 2024 17:30:29 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgSgf-0003H6-Ce; Tue, 20 Aug 2024 17:30:29 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgSge-0007KK-UY; Tue, 20 Aug 2024 17:30:29 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sgSge-0003XH-U9; Tue, 20 Aug 2024 17:30:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=XC6wIzJPzthWjhfLrark5eZxMkceVxztv5AAthfTNvk=; b=z83JUIMtP6F2M/LlrpQTPRNHBy
	xq0/PWV+EQ8olK9BYStMtOFeK/EBXRdMbNIipaymZ04RwNlrVM1gz2J1fWSX4rekw2WUVqgM8lEMN
	/ymBW3S50TBODZHwwlrN7odk39TGp16iwc5c6ycOkyUqhKRBsshWaK6ES6YEyyC+kJGQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187290-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187290: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=ab7f877f27caa7249f42e93678dbdb1a2ef2cc4e
X-Osstest-Versions-That:
    libvirt=b1524a3efce306338f3435188c0c682d6f439e9c
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 20 Aug 2024 17:30:28 +0000

flight 187290 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187290/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187265
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 libvirt              ab7f877f27caa7249f42e93678dbdb1a2ef2cc4e
baseline version:
 libvirt              b1524a3efce306338f3435188c0c682d6f439e9c

Last test of basis   187265  2024-08-17 04:20:57 Z    3 days
Testing same since   187290  2024-08-20 04:18:45 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andi Chandler <andi@gowling.com>
  jianqing yan <yanjianqing@kylinos.cn>
  Martin Kletzander <mkletzan@redhat.com>
  Michal Privoznik <mprivozn@redhat.com>
  Nikolai Barybin <nikolai.barybin@virtuozzo.com>
  Nikolai Barybin via Devel <devel@lists.libvirt.org>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   b1524a3efc..ab7f877f27  ab7f877f27caa7249f42e93678dbdb1a2ef2cc4e -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 17:38:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 17:38:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780710.1190342 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgSoM-0005nt-Rs; Tue, 20 Aug 2024 17:38:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780710.1190342; Tue, 20 Aug 2024 17:38:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgSoM-0005nm-Og; Tue, 20 Aug 2024 17:38:26 +0000
Received: by outflank-mailman (input) for mailman id 780710;
 Tue, 20 Aug 2024 17:38: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=9FzQ=PT=intel.com=lkp@srs-se1.protection.inumbo.net>)
 id 1sgSoK-0005ng-DW
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 17:38:24 +0000
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fda5bd4e-5f1a-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 19:38:21 +0200 (CEST)
Received: from fmviesa010.fm.intel.com ([10.60.135.150])
 by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 20 Aug 2024 10:38:19 -0700
Received: from lkp-server01.sh.intel.com (HELO 9a732dc145d3) ([10.239.97.150])
 by fmviesa010.fm.intel.com with ESMTP; 20 Aug 2024 10:37:47 -0700
Received: from kbuild by 9a732dc145d3 with local (Exim 4.96)
 (envelope-from <lkp@intel.com>) id 1sgSng-000ASU-1e;
 Tue, 20 Aug 2024 17:37:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fda5bd4e-5f1a-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1724175501; x=1755711501;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=F9ys5UlU389ee3QRFRy0ljWKUhgX8RwxMcVWiy3W9E4=;
  b=aXeEWYvOVv8aibdIIn4zBorMbjMkSt+um42ukV/ufaSqRLWG36FgajVj
   zAqklZXJvllMwoiXDP9Z1XJ4qilqgJsKXkLTtqB97FMUZF+0Kyj3ksVER
   J0xpEd9oZsXK6d4kpD8RKQN7cTI3HrpVezK6tTMzX74v5oiJi9ZonU1yW
   eaWV2QzBOgMF5RRmqdGPYb5DjrXRos43s6HWk0cqmmTZ0EwjD5Jgz9fWy
   KZqQjha9hzhipdgRA+WfHEqHODAb78daMMdLpY2iB8xW2r1zFTkAfgk0L
   nPNKgVnOLDElAlUGuczHVoEBAGgsBXZRWy4RQkQGilVG2YDSfWiZb/pwK
   A==;
X-CSE-ConnectionGUID: C3UHaGacT+md4SS17JJyxQ==
X-CSE-MsgGUID: FMl04N66Sn2fvg7Ev3M1Ag==
X-IronPort-AV: E=McAfee;i="6700,10204,11170"; a="45019404"
X-IronPort-AV: E=Sophos;i="6.10,162,1719903600"; 
   d="scan'208";a="45019404"
X-CSE-ConnectionGUID: L51FrettSbecQ6z0Q2BVTQ==
X-CSE-MsgGUID: lA8PK9nmTUyeERQjg4edhg==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.10,162,1719903600"; 
   d="scan'208";a="60958613"
Date: Wed, 21 Aug 2024 01:37:11 +0800
From: kernel test robot <lkp@intel.com>
To: Juergen Gross <jgross@suse.com>, linux-kernel@vger.kernel.org,
	x86@kernel.org, linux-acpi@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Juergen Gross <jgross@suse.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 6/7] xen: allow mapping ACPI data using a different
 physical address
Message-ID: <202408210000.e7XA8iNs-lkp@intel.com>
References: <20240820082012.31316-7-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240820082012.31316-7-jgross@suse.com>

Hi Juergen,

kernel test robot noticed the following build errors:

[auto build test ERROR on tip/x86/core]
[also build test ERROR on rafael-pm/linux-next rafael-pm/bleeding-edge linus/master v6.11-rc4 next-20240820]
[cannot apply to xen-tip/linux-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Juergen-Gross/xen-use-correct-end-address-of-kernel-for-conflict-checking/20240820-162344
base:   tip/x86/core
patch link:    https://lore.kernel.org/r/20240820082012.31316-7-jgross%40suse.com
patch subject: [PATCH v2 6/7] xen: allow mapping ACPI data using a different physical address
config: i386-buildonly-randconfig-002-20240820 (https://download.01.org/0day-ci/archive/20240821/202408210000.e7XA8iNs-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240821/202408210000.e7XA8iNs-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408210000.e7XA8iNs-lkp@intel.com/

All errors (new ones prefixed by >>):

>> arch/x86/kernel/x86_init.c:123:23: error: use of undeclared identifier 'x86_default_set_root_pointer'
     123 |                 .set_root_pointer       = x86_default_set_root_pointer,
         |                                           ^
>> arch/x86/kernel/x86_init.c:124:23: error: use of undeclared identifier 'x86_default_get_root_pointer'
     124 |                 .get_root_pointer       = x86_default_get_root_pointer,
         |                                           ^
>> arch/x86/kernel/x86_init.c:125:28: error: use of undeclared identifier 'acpi_generic_reduced_hw_init'
     125 |                 .reduced_hw_early_init  = acpi_generic_reduced_hw_init,
         |                                           ^
   3 errors generated.


vim +/x86_default_set_root_pointer +123 arch/x86/kernel/x86_init.c

f7cf5a5b8c0e59 Thomas Gleixner 2009-08-19   65  
f7cf5a5b8c0e59 Thomas Gleixner 2009-08-19   66  	.resources = {
5d94e81f69d4b1 Dan Williams    2011-03-08   67  		.probe_roms		= probe_roms,
8fee697d990c54 Thomas Gleixner 2009-08-19   68  		.reserve_resources	= reserve_standard_io_resources,
103e206309639b Ingo Molnar     2017-01-28   69  		.memory_setup		= e820__memory_setup_default,
0f4a1e80989aca Kevin Loughlin  2024-03-13   70  		.dmi_setup		= dmi_setup,
f7cf5a5b8c0e59 Thomas Gleixner 2009-08-19   71  	},
f4848472cd9948 Thomas Gleixner 2009-08-20   72  
f4848472cd9948 Thomas Gleixner 2009-08-20   73  	.mpparse = {
de93410310952f Thomas Gleixner 2009-08-20   74  		.setup_ioapic_ids	= x86_init_noop,
e061c7ae0830ff Thomas Gleixner 2024-02-13   75  		.find_mptable		= mpparse_find_mptable,
dcb7600849ce9b Thomas Gleixner 2024-02-13   76  		.early_parse_smp_cfg	= mpparse_parse_early_smp_config,
dcb7600849ce9b Thomas Gleixner 2024-02-13   77  		.parse_smp_cfg		= mpparse_parse_smp_config,
f4848472cd9948 Thomas Gleixner 2009-08-20   78  	},
d9112f43021554 Thomas Gleixner 2009-08-20   79  
d9112f43021554 Thomas Gleixner 2009-08-20   80  	.irqs = {
d9112f43021554 Thomas Gleixner 2009-08-20   81  		.pre_vector_init	= init_ISA_irqs,
66bcaf0bde100a Thomas Gleixner 2009-08-20   82  		.intr_init		= native_init_IRQ,
979923871f69a4 Thomas Gleixner 2020-01-23   83  		.intr_mode_select	= apic_intr_mode_select,
6b15ffa07dc325 Thomas Gleixner 2020-08-26   84  		.intr_mode_init		= apic_intr_mode_init,
6b15ffa07dc325 Thomas Gleixner 2020-08-26   85  		.create_pci_msi_domain	= native_create_pci_msi_domain,
d9112f43021554 Thomas Gleixner 2009-08-20   86  	},
42bbdb43b16d23 Thomas Gleixner 2009-08-20   87  
42bbdb43b16d23 Thomas Gleixner 2009-08-20   88  	.oem = {
42bbdb43b16d23 Thomas Gleixner 2009-08-20   89  		.arch_setup		= x86_init_noop,
6f30c1ac3fcf11 Thomas Gleixner 2009-08-20   90  		.banner			= default_banner,
42bbdb43b16d23 Thomas Gleixner 2009-08-20   91  	},
030cb6c00d242c Thomas Gleixner 2009-08-20   92  
030cb6c00d242c Thomas Gleixner 2009-08-20   93  	.paging = {
7737b215ad0f94 Attilio Rao     2012-08-21   94  		.pagetable_init		= native_pagetable_init,
030cb6c00d242c Thomas Gleixner 2009-08-20   95  	},
736decac643e89 Thomas Gleixner 2009-08-19   96  
736decac643e89 Thomas Gleixner 2009-08-19   97  	.timers = {
736decac643e89 Thomas Gleixner 2009-08-19   98  		.setup_percpu_clockev	= setup_boot_APIC_clock,
845b3944bbdf9e Thomas Gleixner 2009-08-19   99  		.timer_init		= hpet_time_init,
c311ed6183f4fd Rahul Tanwar    2019-10-10  100  		.wallclock_init		= x86_wallclock_init,
736decac643e89 Thomas Gleixner 2009-08-19  101  	},
d07c1be0693e09 FUJITA Tomonori 2009-11-10  102  
d07c1be0693e09 FUJITA Tomonori 2009-11-10  103  	.iommu = {
d07c1be0693e09 FUJITA Tomonori 2009-11-10  104  		.iommu_init		= iommu_init_noop,
d07c1be0693e09 FUJITA Tomonori 2009-11-10  105  	},
b72d0db9dd41da Thomas Gleixner 2009-08-29  106  
b72d0db9dd41da Thomas Gleixner 2009-08-29  107  	.pci = {
b72d0db9dd41da Thomas Gleixner 2009-08-29  108  		.init			= x86_default_pci_init,
ab3b37937e8f4f Thomas Gleixner 2009-08-29  109  		.init_irq		= x86_default_pci_init_irq,
9325a28ce2fa7c Thomas Gleixner 2009-08-29  110  		.fixup_irqs		= x86_default_pci_fixup_irqs,
b72d0db9dd41da Thomas Gleixner 2009-08-29  111  	},
f72e38e8ec8869 Juergen Gross   2017-11-09  112  
f72e38e8ec8869 Juergen Gross   2017-11-09  113  	.hyper = {
f72e38e8ec8869 Juergen Gross   2017-11-09  114  		.init_platform		= x86_init_noop,
f3614646005a1b Juergen Gross   2017-11-09  115  		.guest_late_init	= x86_init_noop,
f72e38e8ec8869 Juergen Gross   2017-11-09  116  		.x2apic_available	= bool_x86_init_noop,
ab0f59c6f13528 David Woodhouse 2020-10-24  117  		.msi_ext_dest_id	= bool_x86_init_noop,
f72e38e8ec8869 Juergen Gross   2017-11-09  118  		.init_mem_mapping	= x86_init_noop,
6f84f8d1587f20 Pavel Tatashin  2018-04-10  119  		.init_after_bootmem	= x86_init_noop,
f72e38e8ec8869 Juergen Gross   2017-11-09  120  	},
038bac2b02989a Juergen Gross   2018-02-19  121  
038bac2b02989a Juergen Gross   2018-02-19  122  	.acpi = {
41fa1ee9c6d687 Josh Boyer      2019-08-19 @123  		.set_root_pointer	= x86_default_set_root_pointer,
e7b66d16fe4172 Juergen Gross   2018-10-10 @124  		.get_root_pointer	= x86_default_get_root_pointer,
81b53e5ff21e09 Andy Shevchenko 2018-02-20 @125  		.reduced_hw_early_init	= acpi_generic_reduced_hw_init,
038bac2b02989a Juergen Gross   2018-02-19  126  	},
736decac643e89 Thomas Gleixner 2009-08-19  127  };
736decac643e89 Thomas Gleixner 2009-08-19  128  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 18:01:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 18:01:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780721.1190351 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgTAc-0002Dn-K0; Tue, 20 Aug 2024 18:01:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780721.1190351; Tue, 20 Aug 2024 18:01:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgTAc-0002Dg-HT; Tue, 20 Aug 2024 18:01:26 +0000
Received: by outflank-mailman (input) for mailman id 780721;
 Tue, 20 Aug 2024 18:01:25 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=nvfb=PT=amd.com=VictorM.Lira@srs-se1.protection.inumbo.net>)
 id 1sgTAb-0002Da-Su
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 18:01:25 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on20624.outbound.protection.outlook.com
 [2a01:111:f403:2415::624])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 35715f14-5f1e-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 20:01:23 +0200 (CEST)
Received: from BLAPR03CA0007.namprd03.prod.outlook.com (2603:10b6:208:32b::12)
 by DS7PR12MB8417.namprd12.prod.outlook.com (2603:10b6:8:eb::21) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug
 2024 18:01:13 +0000
Received: from MN1PEPF0000F0DE.namprd04.prod.outlook.com
 (2603:10b6:208:32b:cafe::4c) by BLAPR03CA0007.outlook.office365.com
 (2603:10b6:208:32b::12) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20 via Frontend
 Transport; Tue, 20 Aug 2024 18:01:13 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 MN1PEPF0000F0DE.mail.protection.outlook.com (10.167.242.36) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Tue, 20 Aug 2024 18:01:13 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 20 Aug
 2024 13:01:12 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 20 Aug
 2024 13:01:12 -0500
Received: from xsjwoods50.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend
 Transport; Tue, 20 Aug 2024 13:01:12 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 35715f14-5f1e-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Ma150mf3K4k25yDQL6UdWjBjvvnde3cBcsoqt+UkuDOv5qxP7KuP0X8dGds6a77+kJ4xHii0qhSNv8fN0jR6z46Zhbs6jq1MtUf8DJambyEgDaKDh4LrWpBAZyjxGz0CgIt3egjSnwLHsF1WNJ8X5zuIQYzMLPGe7YIzs7EHKSMA+uYvuo/1A81gOX6B6VUL8jbCU+1tAq5fpTNk0dvohhg03c1+pS5hpWGh1iiXeDQtdapyjKaety3DmwNAdY0RPgjuQeoutYdsvX2FQyXpZLbqO30CYd/BLMmXkmUHO5eANAB0uSKJpFOi8sDyhmamjG3ETihaQAxxT3Xt6/q5YQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=b2c38QiJTMcl0y+jcYjv48Mj3RBdPJkz0pyUUsKDurA=;
 b=LA6LKfr8Q+7gnPVQu6DWf8lIzvbPNzC0VTQNZf5tuVGSYhSMqfL7AYmPftOEHZvyEgOIJsMDhise2m0omcCMgIonuVtgWXoVNi94HV6Cr9WcJyiwH6Mgr/7fbEyPiOb6zs2DxlWFQ923KxK2KQVXbs+vWMUJ3gu2aTFnc1jfEd4kyIZb+TInUV969PWvTWSv0fcAdcooeaaSVLYtdUMiUdLAt6e0Xe/RcEe0T0haA7+ZA74gcaUA/nTSpXJCqdPLaYsjy8CuMffl7zKTkYmIZz5ecufrW1gczmHIsWD4Dueeh8seCZXUSBcwZylYWABh1c47p1fzTW1iaxzeIZpM/A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=b2c38QiJTMcl0y+jcYjv48Mj3RBdPJkz0pyUUsKDurA=;
 b=uQaEafZkNeRwYa520FDxi4ujgioZpsB/Yv0jRd85h48Xvk0fKI9CtTdkvGfO0swwEHZEJkiPeyB3zKUb7w9QW8Q/9CpMmPLZnaoiMsCQdMhgbaBi2dFfDzGkd2jSEwa3tsxafkMKQW1d4M0ZSVblsNdo1pcRx2YbEPvmuohMphs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: <victorm.lira@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Victor Lira <victorm.lira@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>
Subject: [XEN][PATCH v1] automation: update xilinx test scripts config
Date: Tue, 20 Aug 2024 11:00:59 -0700
Message-ID: <6b69088c886ce53ca17fe11ad97e3c364c2220de.1724176414.git.victorm.lira@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: victorm.lira@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0DE:EE_|DS7PR12MB8417:EE_
X-MS-Office365-Filtering-Correlation-Id: 3af9cc5f-1ca3-4eef-f9a7-08dcc1421444
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?Cqw1geMVvI8h5MOqjYO1ikJt/bJaiS3WhWrQhBDYEW5hewYnHOwQjhFZqWbx?=
 =?us-ascii?Q?J/VX0wcFmX/9Rq0CC2bl3+AVjQbuYbrjdzJl3QKzoxiFdveU3LCAiQTmFHvy?=
 =?us-ascii?Q?Ii/ChSA6IMN156HYZXJoJHYyl/dGic6OQddbwJg41cqkGnl0hmvVTLwzTyiv?=
 =?us-ascii?Q?h925gS1+j8MsRhiJs+uYMuOwpIP0vg5YessMn3KQzTxlzgy4few3kl1JVfx/?=
 =?us-ascii?Q?P4VtLt+scOyxgq/dK2RTxY/JWefKl09+N2AeTx7G+8fS6tKWmMfjIf58wULT?=
 =?us-ascii?Q?y2lSUjTMqYRs8kuFj74zRCkTVVE1me/V6GdIJTthcCQEzDdBH90/4Z4m3Ry/?=
 =?us-ascii?Q?AlzSCd0AxSQOwDznS6ltqnXaIgcMx4xotSMcGYHXlxxZdqKYLT6ryAq8qIkD?=
 =?us-ascii?Q?8BO6x5iFV+fno+l1lj42JAogLFcQ04dPykF5IWAup5Vk52hMhbYr9X4OHJ89?=
 =?us-ascii?Q?7UJy8eKhfoPNkbdq+345FlBRksm8/rNS3gCPK35mSLqmX+pVOGLp6BZZ0m/V?=
 =?us-ascii?Q?KCZ0e2IY5HtSIZOfoqCD8aJNQ2QQFlsVIDqEVX32S3+Qac4EXg77Fsc+4Ke8?=
 =?us-ascii?Q?WhG/bvk6igZNLr7ZJIyvTqDDKoNfgMnN484g48xO027/3mkJuTXpMDt+7uu+?=
 =?us-ascii?Q?rG8WRVPmMpOWoYq52EuybS+bwYDCMnagnbR7KsAmTbfReNE8Y57AuvhLYBTZ?=
 =?us-ascii?Q?SXFYE0uD91hxc6Ldkqlooa0NXf7P1yW6v8z7uQNWkwXv+G5NPJ6tmaBOsZas?=
 =?us-ascii?Q?FIzy2lYISCKhSpUso07Kzzqkp23y1kGaO7Cw94VqTBXOYATl+OgY5Z0UR/4S?=
 =?us-ascii?Q?VpJg1aUYUvvUBphR68eIfjd0ts5oWn/BZH0/Sivt1jg9n8eKi6LQsIhD0ZO7?=
 =?us-ascii?Q?bae1L4J0O9RQT5bYT9vUKVaYfwyRU4KHbaRSaug475dmsuKabuO1V4bA7UDH?=
 =?us-ascii?Q?uWhfZCiZx2l0Aokwqk48iZ6f9t9Qk2llAoil3lpNFvzWcnwtKgrDN4K1ElMX?=
 =?us-ascii?Q?S1OuSHM6I4gZPVQ0MeOkNoFsfIe5ejQuL9hdjvhWpZgykmd+pJAtBGKKmVNG?=
 =?us-ascii?Q?12qkbuSfCBTRTbJwdWuUJuEfQFOZivs3z0ZsHZG2UO6lnew9+I4y5373zLH6?=
 =?us-ascii?Q?xYbCidNGXSiPLlyr6IGCozOf3CkD5r6ybyTeLYnN+fgjiuaDCgWqo3M2Y13q?=
 =?us-ascii?Q?G/YtWgMhfMU9YLlwgveL3buMrMwX6jacKRFW3I6j8vNHeV/taoSxT3wx1laX?=
 =?us-ascii?Q?M41glHWrYKdQB/Qxd9tQCo8HlKpCZfogjn9/+5KsP/tQ0emNe9rT/43yDtaI?=
 =?us-ascii?Q?jr8D3iPeT3ipOXmrfPgGmzweEIYhLUZT1+4/ZI5TqOxEiSvYO5O4fQ/E0AOW?=
 =?us-ascii?Q?XKStaDDniM9jIzoCYD+HHYVHdLhuRqG1pc9MMWsc27inxU5LM9PlZqtG41nf?=
 =?us-ascii?Q?Krg0KxeiG/WsUTH7L3AdF4ufb/WLQIZ0?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 18:01:13.1053
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 3af9cc5f-1ca3-4eef-f9a7-08dcc1421444
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	MN1PEPF0000F0DE.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB8417

From: Victor Lira <victorm.lira@amd.com>

Change xen command line parameters to support new test board.
Abstract serial port device name and tftp boot directory.

Signed-off-by: Victor Lira <victorm.lira@amd.com>
---
Cc: Stefano Stabellini <sstabellini@kernel.org>
---
 .../scripts/xilinx-smoke-dom0-x86_64.sh       | 29 +++++++++++--------
 .../scripts/xilinx-smoke-dom0less-arm64.sh    |  5 ++--
 2 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index e6e6fac6a5..2696bc84bd 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -12,10 +12,12 @@ fatal() {
 # Test parameter defaults.
 TEST="$1"
 PASS_MSG="Test passed: ${TEST}"
-XEN_CMD_CONSOLE="console=com1 com1=115200,8n1,0x3F8,4"
+XEN_CMD_CONSOLE="console=com2 com2=115200,8n1,0x2e8,4"
 XEN_CMD_DOM0="dom0=pvh dom0_max_vcpus=4 dom0_mem=4G"
 XEN_CMD_XEN="sched=null loglvl=all guest_loglvl=all console_timestamps=boot"
-XEN_CMD_EXTRA=""
+XEN_CMD_EXTRA="noreboot=true sync_console"
+DOM0_CMDLINE="console=hvc0 root=/dev/ram0 earlyprintk=xen"
+DOM0_CMDLINE="${DOM0_CMDLINE} loglevel=8 ignore_loglevel no_console_suspend"
 DOM0_CMD=""
 DOMU_CMD=""
 DOMU_CFG='
@@ -28,7 +30,7 @@ memory = 512
 vif = [ "bridge=xenbr0", ]
 disk = [ ]
 '
-TIMEOUT_SECONDS=120
+TIMEOUT_SECONDS=200

 # Select test variant.
 if [ "${TEST}" = "ping" ]; then
@@ -112,26 +114,29 @@ cd ..

 # Load software into TFTP server directory.
 TFTP="/scratch/gitlab-runner/tftp"
+BOARD_ID="x86_64-0"
+BOARD_DIR="${TFTP}/${BOARD_ID}"
 XEN_CMDLINE="${XEN_CMD_CONSOLE} ${XEN_CMD_XEN} ${XEN_CMD_DOM0} ${XEN_CMD_EXTRA}"
-cp -f binaries/xen ${TFTP}/pxelinux.cfg/xen
-cp -f binaries/bzImage ${TFTP}/pxelinux.cfg/vmlinuz
-cp -f binaries/dom0-rootfs.cpio.gz ${TFTP}/pxelinux.cfg/initrd-dom0
+cp -f binaries/xen ${BOARD_DIR}/xen
+cp -f binaries/bzImage ${BOARD_DIR}/vmlinuz
+cp -f binaries/dom0-rootfs.cpio.gz ${BOARD_DIR}/initrd-dom0
 echo "
 net_default_server=10.0.6.1
-multiboot2 (tftp)/pxelinux.cfg/xen ${XEN_CMDLINE}
-module2 (tftp)/pxelinux.cfg/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
-module2 (tftp)/pxelinux.cfg/initrd-dom0
+multiboot2 (tftp)/${BOARD_ID}/xen ${XEN_CMDLINE} updated_test
+module2 (tftp)/${BOARD_ID}/vmlinuz ${DOM0_CMDLINE}
+module2 (tftp)/${BOARD_ID}/initrd-dom0
 boot
-" > ${TFTP}/pxelinux.cfg/grub.cfg
+" > ${BOARD_DIR}/grub.cfg

 # Power cycle board and collect serial port output.
-SERIAL_CMD="cat /dev/ttyUSB9 | tee smoke.serial | sed 's/\r//'"
+SERIAL_DEV="/dev/serial/${BOARD_ID}"
+SERIAL_CMD="cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"
 sh /scratch/gitlab-runner/v2000a.sh 2
 sleep 5
 sh /scratch/gitlab-runner/v2000a.sh 1
 sleep 5
 set +e
-stty -F /dev/ttyUSB9 115200
+stty -F ${SERIAL_DEV} 115200
 timeout -k 1 ${TIMEOUT_SECONDS} nohup sh -c "${SERIAL_CMD}"
 sh /scratch/gitlab-runner/v2000a.sh 2

diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index 666411d6a0..c8382bb0c7 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -134,9 +134,10 @@ sleep 5
 cd $START

 # connect to serial
+SERIAL_DEV="/dev/serial/arm64-0"
 set +e
-stty -F /dev/ttyUSB0 115200
-timeout -k 1 120 nohup sh -c "cat /dev/ttyUSB0 | tee smoke.serial | sed 's/\r//'"
+stty -F ${SERIAL_DEV} 115200
+timeout -k 1 120 nohup sh -c "cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"

 # stop the board
 cd /scratch/gitlab-runner
--
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 20 19:40:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 19:40:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780756.1190362 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgUi4-0000nk-Gf; Tue, 20 Aug 2024 19:40:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780756.1190362; Tue, 20 Aug 2024 19:40:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgUi4-0000nJ-E2; Tue, 20 Aug 2024 19:40:04 +0000
Received: by outflank-mailman (input) for mailman id 780756;
 Tue, 20 Aug 2024 19:40:03 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=9FzQ=PT=intel.com=lkp@srs-se1.protection.inumbo.net>)
 id 1sgUi2-0000Gh-Kl
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 19:40:03 +0000
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fa49935e-5f2b-11ef-8776-851b0ebba9a2;
 Tue, 20 Aug 2024 21:39:57 +0200 (CEST)
Received: from orviesa001.jf.intel.com ([10.64.159.141])
 by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 20 Aug 2024 12:39:55 -0700
Received: from lkp-server01.sh.intel.com (HELO 9a732dc145d3) ([10.239.97.150])
 by orviesa001.jf.intel.com with ESMTP; 20 Aug 2024 12:39:52 -0700
Received: from kbuild by 9a732dc145d3 with local (Exim 4.96)
 (envelope-from <lkp@intel.com>) id 1sgUhp-000AY8-19;
 Tue, 20 Aug 2024 19:39:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fa49935e-5f2b-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1724182797; x=1755718797;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=eet258ZmfZhKKtJwJUN7C598plW54ADv5Xh+PzuuGlY=;
  b=VkvfnXj6bf+NOzr72R8pSVejdfJXuedz+KjJGtxIM15BY+JfadP5Opk1
   W3Rtvk3VTotsWYUqzjllcj+w7rhF7jhoKZdg8gH5A+o7DTO0qCxJTnjLe
   zUWxPvSvAVG70KSTx1STpJmumo8xw9C1VoCeGORZfjOsDmHRtsY5t0g5w
   jKmsQTGCCrofGfiLqkILKwE++AiYSbqgBHG61HbfjSpeQctc9rVxsrtYE
   /JnIYO9L4zCSUa4nElyEdR0xEKdGXqrr05OnwdHlwasfc4FAkU48BFwrW
   /rKu3tZ16BKIGT+9wheN/XQaxq/mHHJ1ckIEb4hmDLQyuxgxpugLeVy55
   g==;
X-CSE-ConnectionGUID: 5b77VaDkTVS1ocpkC9kYYQ==
X-CSE-MsgGUID: iSbLnaUORva7uBxNzJZY3Q==
X-IronPort-AV: E=McAfee;i="6700,10204,11170"; a="22372640"
X-IronPort-AV: E=Sophos;i="6.10,162,1719903600"; 
   d="scan'208";a="22372640"
X-CSE-ConnectionGUID: E7KFSF83RlWgQgxLEKNz3A==
X-CSE-MsgGUID: 8ngfMDiLTICNrsNrsKuyFw==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.10,162,1719903600"; 
   d="scan'208";a="98315039"
Date: Wed, 21 Aug 2024 03:39:26 +0800
From: kernel test robot <lkp@intel.com>
To: Juergen Gross <jgross@suse.com>, linux-kernel@vger.kernel.org,
	x86@kernel.org, linux-acpi@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, Juergen Gross <jgross@suse.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 6/7] xen: allow mapping ACPI data using a different
 physical address
Message-ID: <202408210336.uafTZlvc-lkp@intel.com>
References: <20240820082012.31316-7-jgross@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240820082012.31316-7-jgross@suse.com>

Hi Juergen,

kernel test robot noticed the following build errors:

[auto build test ERROR on tip/x86/core]
[also build test ERROR on rafael-pm/linux-next rafael-pm/bleeding-edge linus/master v6.11-rc4 next-20240820]
[cannot apply to xen-tip/linux-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Juergen-Gross/xen-use-correct-end-address-of-kernel-for-conflict-checking/20240820-162344
base:   tip/x86/core
patch link:    https://lore.kernel.org/r/20240820082012.31316-7-jgross%40suse.com
patch subject: [PATCH v2 6/7] xen: allow mapping ACPI data using a different physical address
config: x86_64-randconfig-004-20240820 (https://download.01.org/0day-ci/archive/20240821/202408210336.uafTZlvc-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240821/202408210336.uafTZlvc-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408210336.uafTZlvc-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from arch/x86/kernel/smpboot.c:64:
>> arch/x86/include/asm/acpi.h:179:42: error: unknown type name 'acpi_physical_address'
     179 | extern void __iomem * (*acpi_os_ioremap)(acpi_physical_address phys,
         |                                          ^~~~~~~~~~~~~~~~~~~~~
>> arch/x86/include/asm/acpi.h:180:42: error: unknown type name 'acpi_size'
     180 |                                          acpi_size size);
         |                                          ^~~~~~~~~
   arch/x86/include/asm/acpi.h:181:35: error: unknown type name 'acpi_physical_address'
     181 | void __iomem *x86_acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
         |                                   ^~~~~~~~~~~~~~~~~~~~~
   arch/x86/include/asm/acpi.h:181:63: error: unknown type name 'acpi_size'
     181 | void __iomem *x86_acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
         |                                                               ^~~~~~~~~


vim +/acpi_physical_address +179 arch/x86/include/asm/acpi.h

   176	
   177	#ifdef CONFIG_XEN_PV_DOM0
   178	/* A Xen PV dom0 needs a special acpi_os_ioremap() handling. */
 > 179	extern void __iomem * (*acpi_os_ioremap)(acpi_physical_address phys,
 > 180						 acpi_size size);
   181	void __iomem *x86_acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
   182	#define acpi_os_ioremap acpi_os_ioremap
   183	#endif
   184	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 21:12:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 21:12:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780766.1190372 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgW96-0006z8-RN; Tue, 20 Aug 2024 21:12:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780766.1190372; Tue, 20 Aug 2024 21:12:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgW96-0006z1-O2; Tue, 20 Aug 2024 21:12:04 +0000
Received: by outflank-mailman (input) for mailman id 780766;
 Tue, 20 Aug 2024 21:12:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgW95-0006yr-5F; Tue, 20 Aug 2024 21:12:03 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgW94-00089f-VL; Tue, 20 Aug 2024 21:12:03 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgW94-0006rR-Hz; Tue, 20 Aug 2024 21:12:02 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sgW94-0005QB-HU; Tue, 20 Aug 2024 21:12:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=oiHEZcXKIyjIqF+dgCCpLqhGLwuPnVzU0e1ecszxZ4k=; b=zLLmxjdBFPvlK91Lkp5oUsttVb
	wrcy5HNzx6Fa6Ff6oprDWVZv+yoBuI9/iSEax4p3zOlKY6e6GqVnO5jqGbfuKPfuWCWiIRAwQWAIR
	OTvmhmxC0Za6HNZf09k8oNCX9YBDTpKHF+RSA4/3FPiywvh+Yur46l7y1qjcSbxiBXZ0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187292-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187292: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=6e4436539ae182dc86d57d13849862bcafaa4709
X-Osstest-Versions-That:
    linux=b0da640826ba3b6506b4996a6b23a429235e6923
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 20 Aug 2024 21:12:02 +0000

flight 187292 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187292/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187285
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187285
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187285
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187285
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187285
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187285
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                6e4436539ae182dc86d57d13849862bcafaa4709
baseline version:
 linux                b0da640826ba3b6506b4996a6b23a429235e6923

Last test of basis   187285  2024-08-19 17:12:38 Z    1 days
Testing same since   187292  2024-08-20 07:48:50 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Basavaraj Natikar <Basavaraj.Natikar@amd.com>
  Camila Alvarez <cam.alvarez.i@gmail.com>
  Dmitry Savin <envelsavinds@gmail.com>
  Jason Gerecke <jason.gerecke@wacom.com>
  Jiri Kosina <jkosina@suse.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Luke D. Jones <luke@ljones.dev>
  Olivier Sobrie <olivier@sobrie.be>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   b0da640826ba3..6e4436539ae18  6e4436539ae182dc86d57d13849862bcafaa4709 -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Tue Aug 20 21:42:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 20 Aug 2024 21:42:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780779.1190382 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgWcS-0003cC-Ap; Tue, 20 Aug 2024 21:42:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780779.1190382; Tue, 20 Aug 2024 21:42:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgWcS-0003c5-7h; Tue, 20 Aug 2024 21:42:24 +0000
Received: by outflank-mailman (input) for mailman id 780779;
 Tue, 20 Aug 2024 21:42:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i0f1=PT=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1sgWcQ-0003bz-SP
 for xen-devel@lists.xenproject.org; Tue, 20 Aug 2024 21:42:22 +0000
Received: from NAM04-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam04on20628.outbound.protection.outlook.com
 [2a01:111:f403:2409::628])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 13aea140-5f3d-11ef-a507-bb4a2ccca743;
 Tue, 20 Aug 2024 23:42:21 +0200 (CEST)
Received: from CH2PR16CA0027.namprd16.prod.outlook.com (2603:10b6:610:50::37)
 by LV3PR12MB9331.namprd12.prod.outlook.com (2603:10b6:408:219::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Tue, 20 Aug
 2024 21:42:14 +0000
Received: from CH2PEPF00000140.namprd02.prod.outlook.com
 (2603:10b6:610:50:cafe::53) by CH2PR16CA0027.outlook.office365.com
 (2603:10b6:610:50::37) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend
 Transport; Tue, 20 Aug 2024 21:42:14 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CH2PEPF00000140.mail.protection.outlook.com (10.167.244.72) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Tue, 20 Aug 2024 21:42:14 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 20 Aug
 2024 16:42:14 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 20 Aug
 2024 16:42:13 -0500
Received: from [172.20.142.25] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Tue, 20 Aug 2024 16:42:11 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 13aea140-5f3d-11ef-a507-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ArYDWR54BQ0nsLQTsEJQC2EJ5E6jcAoB+sJRby2iZ0gaXa6sW5aYKDnmpBEchnZM4MsQJ9opLsxnIU2M+PJ8dLGIHCkPNKDF0XvfqQ0OidxZsoX5d2Wvt4hJgQeVV0h/T6KIpwlVjRGj3zCeM9sxt3jwQH5Gzm5eupMe9zKAfT1xAHq2qFs2PHJ7wb5qP+933x+J6Sv/6BJ+JDQCrw2bHRYZPcjhqmU3HAPB6Kvi6opFcPnQE9Bb/Nf25Zrs92PZMpPUjvODcksDUAPG/hOGVlP6xYefpGYHxrYja0QOTunmRCaOLsV4Gob0QTYvU/c8/CAAZNdQ9Jvc219qwJ+GgQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=jE80Bkm6ycuFwFJslkV5hWhCP6gwB7g4HytrCoZfcPE=;
 b=L73ZmAbWS6a8iPLp+qpn7ZADOmA1RH8AqjgvYksiEfv57/fCnFMx/XE5D2NN/5TT+kS2Msa6241P4k6+wrS/tWxQNL7Xp10GoqxQleuNgcVuPE+AZK7744t/5j88ahqKbN3UDUUrL9Ei/a+9Yp3u4WAeqq6vtHnqVIQbGuJZEMYPME0ccyEjv0izYvvYAPPTLJavuJloToicl1JGmdfKDCw3ulYVonVnAaa2FGnpJ5U/2f7iAwWK/RqtIIvTnVxZhJVnu607+7bbhp0qUwyxyslO3+r+/I66VOuvHn5lhit7v55E6Kx/j3icqNLKBEc1pQEqL2Ot5gwerW2zv8zT4w==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=jE80Bkm6ycuFwFJslkV5hWhCP6gwB7g4HytrCoZfcPE=;
 b=LszqxFfaQWQ1yK49sdX/LbC/EYbfBPgCOnYx/ziYhIHMS1rP+a81nF3hzoT5inXvb0QqC++wFl7Hfg0YouoqGDWG5FfKzWBxUy+8wLsUQTFNty2vOzeeiG6wx2ESZsLcxy/0mYvuVbSGARrkEh+wcPd2Q2Ke/7LD0BbpKPjphOk=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <c8f84256-dfb8-4f42-a71c-30373bafab23@amd.com>
Date: Tue, 20 Aug 2024 17:42:11 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v13 1/6] xen/pci: Add hypercall to support reset of
 pcidev
To: Jan Beulich <jbeulich@suse.com>, "Chen, Jiqian" <Jiqian.Chen@amd.com>,
	Stefano Stabellini <sstabellini@kernel.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Julien Grall <julien@xen.org>, Michal Orzel
	<michal.orzel@amd.com>, Oleksii Kurochko <oleksii.kurochko@gmail.com>, "Rahul
 Singh" <Rahul.Singh@arm.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, Wei Liu
	<wl@xen.org>, George Dunlap <gwd@xenproject.org>, Anthony PERARD
	<anthony@xenproject.org>, Juergen Gross <jgross@suse.com>, "Daniel P . Smith"
	<dpsmith@apertussolutions.com>, "Huang, Ray" <Ray.Huang@amd.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
 <20240816110820.75672-2-Jiqian.Chen@amd.com>
 <50717151-3098-491f-9dfb-71ebaff4b684@suse.com>
 <BL1PR12MB58498DC98719ED77DA950478E78D2@BL1PR12MB5849.namprd12.prod.outlook.com>
 <1e0eee6c-0dcd-4ed4-970f-3d7e569cec09@suse.com>
Content-Language: en-US
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
In-Reply-To: <1e0eee6c-0dcd-4ed4-970f-3d7e569cec09@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB05.amd.com: stewart.hildebrand@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH2PEPF00000140:EE_|LV3PR12MB9331:EE_
X-MS-Office365-Filtering-Correlation-Id: 4d3069ba-ccaa-4e12-d846-08dcc160f4cc
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|7416014|36860700013|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?YkhHeUFmbXRFeVBJaDQ3MDVhMWpBOE1keFVQRnExVVl0ME1PUlJMRStrTmp6?=
 =?utf-8?B?U0xpTHM4NHg1WlBrenBLQk9rL1hEb1E4YUlmQTVDU3Q0MVZtTlpCK1BwOW83?=
 =?utf-8?B?U29NeGREL0dHckRGVGhMOU1xU2NsKzM0M1ZORjdGUDNwSnVsMTNlY2IrcllQ?=
 =?utf-8?B?Q0lBRWlHS0NQekNyWWRBeVRPekhaQjJvRVlhZzh5VTBENDdSeThNQi8rRHBJ?=
 =?utf-8?B?MTFScmdwQlZvQ0RPWnZHdmloZUVyRjlvMzZvUWxNemQ2ZlZCRUExV1BTSGlD?=
 =?utf-8?B?cGJ1cXpUUk1ZV3VNSmx2S1I1a0JnY0hzdUlRN2RNbWkxU1IxNmhHdFR2ckdy?=
 =?utf-8?B?RzBHSVhzdEhhTnVNejZOcFRINkdUVG91VGx4bW1Fbk0rK3dOTTVMVTByVGtm?=
 =?utf-8?B?QVhzY3ZGd1o4a0M4bWhXUkc4NEZ3U3g2VCt6b3FaU2VQSHU4aUNtU0M2TGJV?=
 =?utf-8?B?N0JHRnB0Wit5QWRzUUs0SmVSMHZPSmZHaW1nZ0pvQ2UrWUZONjFKTEhQUnZF?=
 =?utf-8?B?TnZsWTZycU02NTRBcEdxVDJwWU43TnBNV1lOcXVHb2xVK1lKVXYvN1AycXFk?=
 =?utf-8?B?TG5TSWVMalh0WGU4c29rNVBtMWhuZ283dE1VSmlweWxYcEJsL3lpTngwQWxH?=
 =?utf-8?B?WFpCRXlvV0pCNlA4WlpKSmVQWVVubC9nTXVQN3NlVHJ2NTJjYm9MdXpoQkFu?=
 =?utf-8?B?NG43N1hpaEZ2MnArbDZwQ0c0d3F5M0FyU3FiRURXVHhBODFUU1pPcEM2eER2?=
 =?utf-8?B?dTUrS25UK2ZTMzZzZ0VuRWtWbkhmNVBmMGU5VVloYzNCYUdhb1ZndWdENEhV?=
 =?utf-8?B?MjVkWGJuYnh0QTA5bjNBaWI1dHBwckJTUDQ0LzZCS3ZzYUE4M0RDVjN1UXBM?=
 =?utf-8?B?amJCRGhrOTdoMWl4Yi93VmlmTjNQU0E0WDZMSjhrQ1VNVTN3Z3h2Zkg5aTJi?=
 =?utf-8?B?U1VzUldzMVdZd21pRytqSERTYkZrR1UrT1hoblNRQ3d2MVVQUElIVUYzb3Ro?=
 =?utf-8?B?SmdFZlk3QmxrcWRISFl3YXVzdFJ0a3Q5bFhKaGZ4dHp0a2NFakYvcHh4cUx0?=
 =?utf-8?B?aElvM2tHV1NFV0hRZCt6enhSZjF4c3NqQ2tJOEltRG9JL1Jyem9TMnQvazA1?=
 =?utf-8?B?QVFVTm9ZSmNjS0FGNkkwTk1GR0t1dC9xSkhydzIyemorODg1UHAzM3VTNWcz?=
 =?utf-8?B?bk9neVlJcUd2Q2g4bWRiU09UQWhGNHRFY3A2bWEyMXNJM0pFdlVhV0FwNTJ0?=
 =?utf-8?B?bmxGYVppWm53VVpTL1k2M2lMTEVHQmJodkdHUUZsK0RRZFlWV0lxTFRORy9k?=
 =?utf-8?B?UFk3bzMxRGVpSm0yTE4xaFp1SjAvaktRV2Y5MXJZc0V3Ty9laytEOFp4YVNi?=
 =?utf-8?B?aEFYSFAzZFoyamxYK05WbUEwR0cvZFp5VUhhSEhGMXk5TW4zcVR2Z2l6SVFI?=
 =?utf-8?B?eVo2RkYrNExYdDVIZlhXaDVkaXB3R1g5ZmxHSXBLRTd6RmhaL1A2TC9xdFpM?=
 =?utf-8?B?cXJaa3VWRlRQR2ZGZm5nUHBIU0I5UnZNVXM5R21NSGRObFREMjZVbG1mNUEw?=
 =?utf-8?B?OVVuaHhoM0V1OFdQZm4xeWJVVkFiK2M5WUZUcFJkUm4yRHZJU3ZEL1VzcTBU?=
 =?utf-8?B?MFBZRkJCVGtXbmUza0ZTMWFrZ1RkY2dlanFOVXpZM0Z5S1BsdUhEYjhTV1VR?=
 =?utf-8?B?aW5Ha3hqVHpUdTZRZjZnUklIbDRDTE1aOHhHWEEvVjgya1A3cm5DVXBsUjdm?=
 =?utf-8?B?bXA0WjBFZGN1a1c1eDhacklhS1V4MWN5ekxiUlpWa1I5akdnbTdjUytSYUJI?=
 =?utf-8?B?ai9XZ1VKSzJxTjRTZHZhcDVqMDAxcnNoL2FieU1RbjFET1pHU1c2cnRUcWJO?=
 =?utf-8?B?dE05MEwxZTdPZlBpY01pSmdlcmZKNUs1QUJXKysrN3BJNEE9PQ==?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(7416014)(36860700013)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2024 21:42:14.7073
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 4d3069ba-ccaa-4e12-d846-08dcc160f4cc
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH2PEPF00000140.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9331

On 8/20/24 03:01, Jan Beulich wrote:
> On 20.08.2024 08:00, Chen, Jiqian wrote:
>> On 2024/8/19 17:04, Jan Beulich wrote:
>>> On 16.08.2024 13:08, Jiqian Chen wrote:
>>>> @@ -67,6 +68,57 @@ ret_t pci_physdev_op(int cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>>>>          break;
>>>>      }
>>>>  
>>>> +    case PHYSDEVOP_pci_device_reset:
>>>> +    {
>>>> +        struct pci_device_reset dev_reset;
>>>> +        struct pci_dev *pdev;
>>>> +        pci_sbdf_t sbdf;
>>>> +
>>>> +        ret = -EOPNOTSUPP;
>>>> +        if ( !is_pci_passthrough_enabled() )
>>>> +            break;
>>>
>>> It occurs to me (only now, sorry): Does this case really need to be an
>>> error? I.e. do we really need to bother callers by having them find out
>>> whether pass-through is supported in the underlying Xen?
>> I am not sure, but for x86, passthrough is always true, it doesn't matter.
>> For arm, this hypercall is also used for passthrough devices for now, so it is better to keep the same behavior as other PHYSDEVOP_pci_device_* operation?
> 
> Despite seeing that I did ack the respective change[1] back at the time, I
> (now) view this as grossly misnamed, at best. Imo it makes pretty little
> sense for that predicate helper to return true when there are no IOMMUs in
> use. Even more so that on an Arm/PCI system without IOMMUs one can use the
> command line option and then execution will make it past this check.
> 
> I further question the related part of [2]: Why did the stub need moving?
> I'm not even sure that part of the change fell under the Suggested-by:
> there, but I also can't exclude it (I didn't bother trying to find where
> the suggestion was made).
> 
> In any event - with [1] PHYSDEVOP_*pci* ended up inconsistent on x86,
> even if right now only on the surface. Yet as soon as this predicate is
> changed to take IOMMUs into account, the latent inconsistency would
> become a real one.
> 
> An alternative to changing how the function behaves would be to rename it,
> for name and purpose to actually match - is_pci_passthrough_permitted()
> maybe?
> 
> Thoughts anyone, Arm / SMMU maintainers in particular?
> 
> Finally, as to the change here: On an Arm/PCI system where pass-through
> isn't enabled, the hypervisor will still need to know about resets when
> vPCI is in use for Dom0. IOW I'd like to refine my earlier comment into
> suggesting that the conditional be dropped altogether.

I agree on removing the condition for the reason you mentioned. I'd
like to remove the other instances of the condition in this file as
well, but that is the subject of a separate patch in the works [3].

[3] https://lore.kernel.org/xen-devel/20231109182716.367119-9-stewart.hildebrand@amd.com/

> 
> Jan
> 
> [1] 15517ed61f55 xen/arm: Add cmdline boot option "pci-passthrough = <boolean>"
> [2] dec9e02f3190 xen: avoid generation of stub <asm/pci.h> header



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 00:16:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 00:16:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780796.1190392 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgZ1Z-0002Nn-V7; Wed, 21 Aug 2024 00:16:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780796.1190392; Wed, 21 Aug 2024 00:16:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgZ1Z-0002Ng-SD; Wed, 21 Aug 2024 00:16:29 +0000
Received: by outflank-mailman (input) for mailman id 780796;
 Wed, 21 Aug 2024 00:16:27 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0c/y=PU=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sgZ1X-0002Na-LB
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 00:16:27 +0000
Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 994f0b74-5f52-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 02:16:24 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by nyc.source.kernel.org (Postfix) with ESMTP id 5D28FA40A83;
 Wed, 21 Aug 2024 00:16:16 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85D3BC4AF09;
 Wed, 21 Aug 2024 00:16:20 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 994f0b74-5f52-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724199382;
	bh=T152HgXayAAnY4StgiBVjSHbJgJZFAmQr9grhZcCjz4=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=sbRWn+GYJ3hr9UDoKhWz2MfkfIvKoy2XxSUHUkDVr+cGzaqQcCxdC9tiJAmWJgy+k
	 rVxcWBRmnB4l2PVrgHi2/gvMPXX/YSIgvY//X2A0xsbpQekM7oLoC94xubiHbwV1Og
	 B+LrWi596QlnJ41oVymUlrZOq/fCz8ocq0fFQqdNSJq97O058mI9IJJgS3WNoUgyrV
	 EXxLCiLZhmkMAyR/uN8Ff+gwUJDamI9WLYulF1Ta4esjSzz1SVDUns7FUP2wfOwIxw
	 rM1wOLzLogJDuxAoL0ohZGzCP6WjkQXl01vJOa7lB2mBj61LK6SeQAKBumbw8s1IEI
	 ymau+PVFD8r3g==
Date: Tue, 20 Aug 2024 17:16:19 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Chen, Jiqian" <Jiqian.Chen@amd.com>
cc: Jan Beulich <jbeulich@suse.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Juergen Gross <jgross@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Wei Liu <wl@xen.org>, George Dunlap <gwd@xenproject.org>, 
    Julien Grall <julien@xen.org>, Anthony PERARD <anthony@xenproject.org>, 
    "Daniel P . Smith" <dpsmith@apertussolutions.com>, 
    "Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>, 
    "Huang, Ray" <Ray.Huang@amd.com>, 
    "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [XEN PATCH v13 3/6] x86/pvh: Add PHYSDEVOP_setup_gsi for PVH
 dom0
In-Reply-To: <BL1PR12MB58496D2638998EC4DC2572C8E78D2@BL1PR12MB5849.namprd12.prod.outlook.com>
Message-ID: <alpine.DEB.2.22.394.2408201713420.298534@ubuntu-linux-20-04-desktop>
References: <20240816110820.75672-1-Jiqian.Chen@amd.com> <20240816110820.75672-4-Jiqian.Chen@amd.com> <745cd8cc-59c2-44b8-b42b-1e5e0b3026ca@suse.com> <BL1PR12MB58496D2638998EC4DC2572C8E78D2@BL1PR12MB5849.namprd12.prod.outlook.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 20 Aug 2024, Chen, Jiqian wrote:
> On 2024/8/19 17:16, Jan Beulich wrote:
> > On 16.08.2024 13:08, Jiqian Chen wrote:
> >> The gsi of a passthrough device must be configured for it to be
> >> able to be mapped into a hvm domU.
> >> But When dom0 is PVH, the gsis may not get registered(see below
> >> clarification), it causes the info of apic, pin and irq not be
> >> added into irq_2_pin list, and the handler of irq_desc is not set,
> >> then when passthrough a device, setting ioapic affinity and vector
> >> will fail.
> >>
> >> To fix above problem, on Linux kernel side, a new code will
> >> need to call PHYSDEVOP_setup_gsi for passthrough devices to
> >> register gsi when dom0 is PVH.
> >>
> >> So, add PHYSDEVOP_setup_gsi into hvm_physdev_op for above
> >> purpose.
> >>
> >> Clarify two questions:
> >> First, why the gsi of devices belong to PVH dom0 can work?
> >> Because when probe a driver to a normal device, it uses the normal
> >> probe function of pci device, in its callstack, it requests irq
> >> and unmask corresponding ioapic of gsi, then trap into xen and
> >> register gsi finally.
> >> Callstack is(on linux kernel side) pci_device_probe->
> >> request_threaded_irq-> irq_startup-> __unmask_ioapic->
> >> io_apic_write, then trap into xen hvmemul_do_io->
> >> hvm_io_intercept-> hvm_process_io_intercept->
> >> vioapic_write_indirect-> vioapic_hwdom_map_gsi-> mp_register_gsi.
> >> So that the gsi can be registered.
> >>
> >> Second, why the gsi of passthrough device can't work when dom0
> >> is PVH?
> >> Because when assign a device to passthrough, it uses the specific
> >> probe function of pciback, in its callstack, it doesn't install a
> >> fake irq handler due to the ISR is not running. So that
> >> mp_register_gsi on Xen side is never called, then the gsi is not
> >> registered.
> >> Callstack is(on linux kernel side) pcistub_probe->pcistub_seize->
> >> pcistub_init_device-> xen_pcibk_reset_device->
> >> xen_pcibk_control_isr->isr_on==0.
> > 
> > So: Underlying XSA-461 was the observation that the very limited set of
> > cases where this fake IRQ handler is installed is an issue. The problem
> > of dealing with "false" IRQs when a line-based interrupt is shared
> > between devices affects all parties, not just Dom0 and not just PV
> > guests. Therefore an alternative to the introduction of a new hypercall
> > would be to simply leverage that the installation of such a handler
> > will need widening anyway.
> > 
> > However, the installation of said handler presently also occurs in
> > cases where it's not really needed - when the line isn't shared. Thus,
> > if the handler registration would also be eliminated when it's not
> > really needed, we'd be back to needing a separate hypercall.
> > 
> > So I think first of all it needs deciding what is going to be done in
> > Linux, at least in pciback (as here we care about the Dom0 case only).
> Agree, so the current options are either to use hypercall (PHYSDEVOP_setup_gsi) or to install fake IRQ handler in pciback.
> So, we may need the inputs from the Maintainers on Linux side.
> Hi Stefano and Juergen, what about your opinions?

I would go with the PHYSDEVOP_setup_gsi solution


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 00:51:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 00:51:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780804.1190402 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgZZB-0008Ll-Bu; Wed, 21 Aug 2024 00:51:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780804.1190402; Wed, 21 Aug 2024 00:51:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgZZB-0008Le-8b; Wed, 21 Aug 2024 00:51:13 +0000
Received: by outflank-mailman (input) for mailman id 780804;
 Wed, 21 Aug 2024 00:51: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=AfJ1=PU=kernel.org=gustavoars@srs-se1.protection.inumbo.net>)
 id 1sgZZA-0008LY-NZ
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 00:51:12 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org
 [2604:1380:40e1:4800::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6ffe58fa-5f57-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 02:51:03 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id DD8EECE0CDF;
 Wed, 21 Aug 2024 00:51:00 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72621C4AF12;
 Wed, 21 Aug 2024 00:50:59 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6ffe58fa-5f57-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724201460;
	bh=MMIPR++xC4Kxl0qx3QpEQFYibLJHZ0WBuJz0u9FG8Ls=;
	h=Date:From:To:Cc:Subject:From;
	b=YGDaaMoBOcm195MUxo0J1sIHd3EI71AAyN4+WATK/dt4PTYWPWfVin3mMWBBp2dOf
	 vs/EMEUcopSmQQa2zLhzHID4prfpVvaR4QX5UyyiUQsU8pGvEv3tXXUw76dp+lQbj0
	 Q4fgMBqaFgD910RPClrfYLxCdBlTwyO/uwNb/aWWywPpimUQ6EGqeF4WGynK15UXUu
	 D4lSfQc+TVvfq4/YtNCSmha97fuWqE48x+LhvDYxMVHnDekjiDx2MC85kdCu52RIPm
	 RRBhVJO9X8R6MyFy6Q5oD6Zn1PGJX1Y4ARijGhafpemw57SG0/mOSHnysYCC7vc2wb
	 aEbX0FZ3RiIoQ==
Date: Tue, 20 Aug 2024 18:50:56 -0600
From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
To: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	linux-hardening@vger.kernel.org
Subject: [PATCH][next] xen/pci: Avoid -Wflex-array-member-not-at-end warning
Message-ID: <ZsU58MvoYEEqBHZl@elsanto>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of
a flexible structure where the size of the flexible-array member
is known at compile-time, and refactor the rest of the code,
accordingly.

So, with this, fix the following warning:

drivers/xen/pci.c:48:55: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 drivers/xen/pci.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c
index 72d4e3f193af..a2facd8f7e51 100644
--- a/drivers/xen/pci.c
+++ b/drivers/xen/pci.c
@@ -44,15 +44,11 @@ static int xen_add_device(struct device *dev)
 	}
 #endif
 	if (pci_seg_supported) {
-		struct {
-			struct physdev_pci_device_add add;
-			uint32_t pxm;
-		} add_ext = {
-			.add.seg = pci_domain_nr(pci_dev->bus),
-			.add.bus = pci_dev->bus->number,
-			.add.devfn = pci_dev->devfn
-		};
-		struct physdev_pci_device_add *add = &add_ext.add;
+		DEFINE_RAW_FLEX(struct physdev_pci_device_add, add, optarr, 1);
+
+		add->seg = pci_domain_nr(pci_dev->bus);
+		add->bus = pci_dev->bus->number;
+		add->devfn = pci_dev->devfn;
 
 #ifdef CONFIG_ACPI
 		acpi_handle handle;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 00:56:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 00:56:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780810.1190412 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgZds-0000WB-Rp; Wed, 21 Aug 2024 00:56:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780810.1190412; Wed, 21 Aug 2024 00:56:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgZds-0000W4-Oy; Wed, 21 Aug 2024 00:56:04 +0000
Received: by outflank-mailman (input) for mailman id 780810;
 Wed, 21 Aug 2024 00:56: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=0c/y=PU=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sgZdr-0000Vy-Da
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 00:56:03 +0000
Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 22ad3f30-5f58-11ef-a507-bb4a2ccca743;
 Wed, 21 Aug 2024 02:56:02 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by nyc.source.kernel.org (Postfix) with ESMTP id 28EFAA40BDC;
 Wed, 21 Aug 2024 00:55:54 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FAACC4AF0B;
 Wed, 21 Aug 2024 00:55:58 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22ad3f30-5f58-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724201760;
	bh=zt+bRCw1JFD/aYFu4ktsx31ttxki0L5FzmNifjsxUGo=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=iI83DkJv6j8k3NwYp3USCf0B3ZclwH5Y1YWOB1Tna4gSgKqk2zmAd9N/mD4VDBvvv
	 +A/jNt2WgABrEJ6EE4SmE64oNTLlJGfTs5oPUgirlfbd/Hv21IJkKvnlDuxHBJKute
	 ki2g/3OvEer63dOW0xuoNak1WYxdb1mtUTu+nNKKY8lMCxHe2PHkHvjgSiPnvWlVJd
	 ukCOwkU1Wu7xfKiF+GlqYB0GMs5ZcBSEFaCSH5IcbzLAuka3BmMMc+Kh7mcznbcVFi
	 CNB+f8ZQFX+qGhDUXztlAUrsKzsfMGlSw8VqKXqUvFt7l6UV7+uFPZWqdn26jRSQmp
	 gBmwgbn77MXbA==
Date: Tue, 20 Aug 2024 17:55:57 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony@xenproject.org, 
    paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
    xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, 
    xen-devel@lists.xenproject.org, qemu-arm@nongnu.org
Subject: Re: [PATCH v2 04/12] hw/arm: xenpvh: Add support for SMP guests
In-Reply-To: <20240820142949.533381-5-edgar.iglesias@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408201755430.298534@ubuntu-linux-20-04-desktop>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com> <20240820142949.533381-5-edgar.iglesias@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 20 Aug 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> 
> Add SMP support for Xen PVH ARM guests.
> Create ms->smp.max_cpus ioreq servers to handle hotplug.
> 
> Note that ms->smp.max_cpus will be passed to us by the
> user (Xen tools) set to the guests maxvcpus.
> 
> The value in mc->max_cpus is an absolute maximum for the
> -smp option and won't be used to setup ioreq servers unless
> the user explicitly specifies it with -smp.
> 
> If the user doesn't pass -smp on the command-line, smp.cpus
> and smp.max_cpus will default to 1.
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>


Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  hw/arm/xen_arm.c | 23 +++++++++++++++++++++--
>  1 file changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
> index 5f75cc3779..fda65d0d8d 100644
> --- a/hw/arm/xen_arm.c
> +++ b/hw/arm/xen_arm.c
> @@ -173,7 +173,7 @@ static void xen_arm_init(MachineState *machine)
>  
>      xen_init_ram(machine);
>  
> -    xen_register_ioreq(xam->state, machine->smp.cpus, &xen_memory_listener);
> +    xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener);
>  
>      xen_create_virtio_mmio_devices(xam);
>  
> @@ -218,7 +218,26 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
>      MachineClass *mc = MACHINE_CLASS(oc);
>      mc->desc = "Xen PVH ARM machine";
>      mc->init = xen_arm_init;
> -    mc->max_cpus = 1;
> +
> +    /*
> +     * mc->max_cpus holds the MAX value allowed in the -smp command-line opts.
> +     *
> +     * 1. If users don't pass any -smp option:
> +     *   ms->smp.cpus will default to 1.
> +     *   ms->smp.max_cpus will default to 1.
> +     *
> +     * 2. If users pass -smp X:
> +     *   ms->smp.cpus will be set to X.
> +     *   ms->smp.max_cpus will also be set to X.
> +     *
> +     * 3. If users pass -smp X,maxcpus=Y:
> +     *   ms->smp.cpus will be set to X.
> +     *   ms->smp.max_cpus will be set to Y.
> +     *
> +     * In scenarios 2 and 3, if X or Y are set to something larger than
> +     * mc->max_cpus, QEMU will bail out with an error message.
> +     */
> +    mc->max_cpus = GUEST_MAX_VCPUS;
>      mc->default_machine_opts = "accel=xen";
>      /* Set explicitly here to make sure that real ram_size is passed */
>      mc->default_ram_size = 0;
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 00:56:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 00:56:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780816.1190422 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgZed-0001Xo-3b; Wed, 21 Aug 2024 00:56:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780816.1190422; Wed, 21 Aug 2024 00:56:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgZed-0001Xh-0q; Wed, 21 Aug 2024 00:56:51 +0000
Received: by outflank-mailman (input) for mailman id 780816;
 Wed, 21 Aug 2024 00:56: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=0c/y=PU=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sgZeb-0001N3-L2
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 00:56:49 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org
 [2604:1380:4641:c500::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3db296a2-5f58-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 02:56:47 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 5A97A60F81;
 Wed, 21 Aug 2024 00:56:46 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EC82C4AF0F;
 Wed, 21 Aug 2024 00:56:43 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3db296a2-5f58-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724201806;
	bh=iP+o8FjrkW5d8IANhD6wo3Kazu6e02UnaUSXg3Ib1MY=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=OoEY54OXyjObjVuSMgqtFJw+/EIe5484piVfBINT8oGtG27p2BR0tx9cSSwJQJ2vq
	 1ZHDBUW+tC5wVL5ZApWW7YiXtT5EyAeUgKppKLh/8CJhfuLpXmOoTkFdGybIy11GmQ
	 aZtNPVAga6FFaaUZwUuoxrCAaOQ+NmqkRjI9ibuVdPMIVhQ0qCjjL1/k8TzVIy1KBA
	 rD2Zsk+iE/B8oD+g41hGq8GTEVpyCSYTQy3z0v+Vo9GxsDxlZVs9rHNZGyJ31JrRxL
	 RBvP+AM+6pks3qAbPC0iwRUBKVdc1irT2h7wZ5/7EEoNer6HjoBFQmAxXsuNiVcynY
	 9TcTTIu9iWp8g==
Date: Tue, 20 Aug 2024 17:56:41 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony@xenproject.org, 
    paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
    xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, 
    xen-devel@lists.xenproject.org, qemu-arm@nongnu.org
Subject: Re: [PATCH v2 05/12] hw/arm: xenpvh: Remove double-negation in
 warning
In-Reply-To: <20240820142949.533381-6-edgar.iglesias@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408201756360.298534@ubuntu-linux-20-04-desktop>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com> <20240820142949.533381-6-edgar.iglesias@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 20 Aug 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  hw/arm/xen_arm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
> index fda65d0d8d..16b3f00992 100644
> --- a/hw/arm/xen_arm.c
> +++ b/hw/arm/xen_arm.c
> @@ -165,7 +165,7 @@ static void xen_arm_init(MachineState *machine)
>      xam->state =  g_new0(XenIOState, 1);
>  
>      if (machine->ram_size == 0) {
> -        warn_report("%s non-zero ram size not specified. QEMU machine started"
> +        warn_report("%s: ram size not specified. QEMU machine started"
>                      " without IOREQ (no emulated devices including virtio)",
>                      MACHINE_CLASS(object_get_class(OBJECT(machine)))->desc);
>          return;
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 01:06:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 01:06:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780827.1190432 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgZnr-0002kL-1Z; Wed, 21 Aug 2024 01:06:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780827.1190432; Wed, 21 Aug 2024 01:06:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgZnq-0002kE-V0; Wed, 21 Aug 2024 01:06:22 +0000
Received: by outflank-mailman (input) for mailman id 780827;
 Wed, 21 Aug 2024 01:06:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0c/y=PU=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sgZnp-0002i4-A2
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 01:06:21 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 92d8c06e-5f59-11ef-a507-bb4a2ccca743;
 Wed, 21 Aug 2024 03:06:20 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id DCE9260F8B;
 Wed, 21 Aug 2024 01:06:18 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7532C4AF09;
 Wed, 21 Aug 2024 01:06:16 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 92d8c06e-5f59-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724202378;
	bh=BH13lVKJeuyYp6L1+dnUtBn/qLzJxA6G2U25oUKFM4I=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=ZxYLv8Q6Y3WJJSFg30UoNe13lZII8LCgE6umdvgR6zt6BDmswGS45cenceElKsTmQ
	 CPNB49rZ21GTH0S1NK8rCAQpWowBtU66rWXV2yhPk9tM7uedSMzanFk8lXN0Xp3tPS
	 vJEGax8nAJQ0AKB83On5f/M1SxFJEdoInu7p6qKjwTOobZaUTrlXYC45TqD7IDr0Km
	 8De3/KVo2yNGF9NWWG6jNUnB6eY6+EuAN2hece54HuzRlkoCQFUMpMsosC/++QwxZB
	 AFutFtDqqve8dJOHx+sIywc+UPI6OcvBZG6HIDUkoHs5P1/lJm9iKH6dIR+dkOWGL0
	 qqELwFAvYsUYQ==
Date: Tue, 20 Aug 2024 18:06:15 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony@xenproject.org, 
    paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
    xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, 
    xen-devel@lists.xenproject.org, qemu-arm@nongnu.org
Subject: Re: [PATCH v2 06/12] hw/arm: xenpvh: Move stubbed functions to
 xen-stubs.c
In-Reply-To: <20240820142949.533381-7-edgar.iglesias@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408201806100.298534@ubuntu-linux-20-04-desktop>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com> <20240820142949.533381-7-edgar.iglesias@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 20 Aug 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>


Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  hw/arm/meson.build |  5 ++++-
>  hw/arm/xen-stubs.c | 32 ++++++++++++++++++++++++++++++++
>  hw/arm/xen_arm.c   | 20 --------------------
>  3 files changed, 36 insertions(+), 21 deletions(-)
>  create mode 100644 hw/arm/xen-stubs.c
> 
> diff --git a/hw/arm/meson.build b/hw/arm/meson.build
> index 0c07ab522f..074612b40c 100644
> --- a/hw/arm/meson.build
> +++ b/hw/arm/meson.build
> @@ -59,7 +59,10 @@ arm_ss.add(when: 'CONFIG_FSL_IMX7', if_true: files('fsl-imx7.c', 'mcimx7d-sabre.
>  arm_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmuv3.c'))
>  arm_ss.add(when: 'CONFIG_FSL_IMX6UL', if_true: files('fsl-imx6ul.c', 'mcimx6ul-evk.c'))
>  arm_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_soc.c'))
> -arm_ss.add(when: 'CONFIG_XEN', if_true: files('xen_arm.c'))
> +arm_ss.add(when: 'CONFIG_XEN', if_true: files(
> +  'xen-stubs.c',
> +  'xen_arm.c',
> +))
>  
>  system_ss.add(when: 'CONFIG_ARM_SMMUV3', if_true: files('smmu-common.c'))
>  system_ss.add(when: 'CONFIG_CHEETAH', if_true: files('palm.c'))
> diff --git a/hw/arm/xen-stubs.c b/hw/arm/xen-stubs.c
> new file mode 100644
> index 0000000000..4ac6a56a96
> --- /dev/null
> +++ b/hw/arm/xen-stubs.c
> @@ -0,0 +1,32 @@
> +/*
> + * Stubs for unimplemented Xen functions for ARM.
> + *
> + * SPDX-License-Identifier: MIT
> + */
> +
> +#include "qemu/osdep.h"
> +#include "qemu/error-report.h"
> +#include "qapi/qapi-commands-migration.h"
> +#include "hw/boards.h"
> +#include "sysemu/sysemu.h"
> +#include "hw/xen/xen-hvm-common.h"
> +#include "hw/xen/arch_hvm.h"
> +
> +void arch_handle_ioreq(XenIOState *state, ioreq_t *req)
> +{
> +    hw_error("Invalid ioreq type 0x%x\n", req->type);
> +    return;
> +}
> +
> +void arch_xen_set_memory(XenIOState *state, MemoryRegionSection *section,
> +                         bool add)
> +{
> +}
> +
> +void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length)
> +{
> +}
> +
> +void qmp_xen_set_global_dirty_log(bool enable, Error **errp)
> +{
> +}
> diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
> index 16b3f00992..f0868e7be5 100644
> --- a/hw/arm/xen_arm.c
> +++ b/hw/arm/xen_arm.c
> @@ -115,26 +115,6 @@ static void xen_init_ram(MachineState *machine)
>      memory_region_add_subregion(sysmem, XEN_GRANT_ADDR_OFF, &xen_grants);
>  }
>  
> -void arch_handle_ioreq(XenIOState *state, ioreq_t *req)
> -{
> -    hw_error("Invalid ioreq type 0x%x\n", req->type);
> -
> -    return;
> -}
> -
> -void arch_xen_set_memory(XenIOState *state, MemoryRegionSection *section,
> -                         bool add)
> -{
> -}
> -
> -void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length)
> -{
> -}
> -
> -void qmp_xen_set_global_dirty_log(bool enable, Error **errp)
> -{
> -}
> -
>  #ifdef CONFIG_TPM
>  static void xen_enable_tpm(XenArmState *xam)
>  {
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 01:16:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 01:16:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780837.1190442 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgZxN-0004lF-UX; Wed, 21 Aug 2024 01:16:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780837.1190442; Wed, 21 Aug 2024 01:16:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgZxN-0004l8-Qn; Wed, 21 Aug 2024 01:16:13 +0000
Received: by outflank-mailman (input) for mailman id 780837;
 Wed, 21 Aug 2024 01:16: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=0c/y=PU=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sgZxM-0004l2-ML
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 01:16:12 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org
 [2604:1380:40e1:4800::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f20b80dd-5f5a-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 03:16:09 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 6E6EACE0D55;
 Wed, 21 Aug 2024 01:16:05 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6697C4AF0E;
 Wed, 21 Aug 2024 01:16:02 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f20b80dd-5f5a-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724202964;
	bh=NQlbBQIZXFQmM6cacNu/YEXSw7R1dlPfBYyDBsDerys=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=S6wcuvVXuaYkktsgovLqQi7tAG1tcto+q/+LqNI62q/uFxp8lrF7XLyFgpMzqoVLx
	 2oDOy4eqAB9IOLKbISBM3lgSTOB9xfVeTKGUKHY9HoTk/SgC45YAIWUMN/yQHY5zUv
	 WP5uQwcm/uTkdnghyptp4mrVBzDUjHxaydwTOQR1mC4/D3q1JQ2970wmuDWjGujSh8
	 MiUQb3+5/g2m87BJveGXy6PFhzHpvdzvOB6ILmcpb/1hAM+rQ9rW0VmGr0gV47IRkD
	 HjFv0YMHTkrtCzIKH6LW/ngAgNpghKfrlVcaQtDkX4QGkQMw/a6j2If3KDMgWQ8875
	 Ow0kXnZYKqOsA==
Date: Tue, 20 Aug 2024 18:16:01 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony@xenproject.org, 
    paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
    xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, 
    xen-devel@lists.xenproject.org, qemu-arm@nongnu.org
Subject: Re: [PATCH v2 07/12] hw/arm: xenpvh: Break out a common PVH
 machine
In-Reply-To: <20240820142949.533381-8-edgar.iglesias@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408201815550.298534@ubuntu-linux-20-04-desktop>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com> <20240820142949.533381-8-edgar.iglesias@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 20 Aug 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> 
> Break out a common Xen PVH machine in preparation for
> adding a x86 Xen PVH machine.
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  hw/arm/trace-events             |   5 -
>  hw/arm/xen_arm.c                | 198 +++--------------------
>  hw/xen/meson.build              |   1 +
>  hw/xen/trace-events             |   4 +
>  hw/xen/xen-pvh-common.c         | 275 ++++++++++++++++++++++++++++++++
>  include/hw/xen/xen-pvh-common.h |  59 +++++++
>  6 files changed, 358 insertions(+), 184 deletions(-)
>  create mode 100644 hw/xen/xen-pvh-common.c
>  create mode 100644 include/hw/xen/xen-pvh-common.h
> 
> diff --git a/hw/arm/trace-events b/hw/arm/trace-events
> index be6c8f720b..c64ad344bd 100644
> --- a/hw/arm/trace-events
> +++ b/hw/arm/trace-events
> @@ -68,10 +68,5 @@ z2_aer915_send_too_long(int8_t msg) "message too long (%i bytes)"
>  z2_aer915_send(uint8_t reg, uint8_t value) "reg %d value 0x%02x"
>  z2_aer915_event(int8_t event, int8_t len) "i2c event =0x%x len=%d bytes"
>  
> -# xen_arm.c
> -xen_create_virtio_mmio_devices(int i, int irq, uint64_t base) "Created virtio-mmio device %d: irq %d base 0x%"PRIx64
> -xen_init_ram(uint64_t machine_ram_size) "Initialized xen ram with size 0x%"PRIx64
> -xen_enable_tpm(uint64_t addr) "Connected tpmdev at address 0x%"PRIx64
> -
>  # bcm2838.c
>  bcm2838_gic_set_irq(int irq, int level) "gic irq:%d lvl:%d"
> diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c
> index f0868e7be5..04cb9855af 100644
> --- a/hw/arm/xen_arm.c
> +++ b/hw/arm/xen_arm.c
> @@ -7,44 +7,12 @@
>  #include "qemu/osdep.h"
>  #include "qemu/error-report.h"
>  #include "qapi/qapi-commands-migration.h"
> -#include "qapi/visitor.h"
>  #include "hw/boards.h"
> -#include "hw/irq.h"
> -#include "hw/sysbus.h"
> -#include "sysemu/block-backend.h"
> -#include "sysemu/tpm_backend.h"
>  #include "sysemu/sysemu.h"
> -#include "hw/xen/xen-hvm-common.h"
> -#include "sysemu/tpm.h"
> +#include "hw/xen/xen-pvh-common.h"
>  #include "hw/xen/arch_hvm.h"
> -#include "trace.h"
>  
>  #define TYPE_XEN_ARM  MACHINE_TYPE_NAME("xenpvh")
> -OBJECT_DECLARE_SIMPLE_TYPE(XenArmState, XEN_ARM)
> -
> -static const MemoryListener xen_memory_listener = {
> -    .region_add = xen_region_add,
> -    .region_del = xen_region_del,
> -    .log_start = NULL,
> -    .log_stop = NULL,
> -    .log_sync = NULL,
> -    .log_global_start = NULL,
> -    .log_global_stop = NULL,
> -    .priority = MEMORY_LISTENER_PRIORITY_ACCEL,
> -};
> -
> -struct XenArmState {
> -    /*< private >*/
> -    MachineState parent;
> -
> -    XenIOState *state;
> -
> -    struct {
> -        uint64_t tpm_base_addr;
> -    } cfg;
> -};
> -
> -static MemoryRegion ram_lo, ram_hi;
>  
>  /*
>   * VIRTIO_MMIO_DEV_SIZE is imported from tools/libs/light/libxl_arm.c under Xen
> @@ -57,147 +25,26 @@ static MemoryRegion ram_lo, ram_hi;
>  #define NR_VIRTIO_MMIO_DEVICES   \
>     (GUEST_VIRTIO_MMIO_SPI_LAST - GUEST_VIRTIO_MMIO_SPI_FIRST)
>  
> -static void xen_set_irq(void *opaque, int irq, int level)
> -{
> -    if (xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level)) {
> -        error_report("xendevicemodel_set_irq_level failed");
> -    }
> -}
> -
> -static void xen_create_virtio_mmio_devices(XenArmState *xam)
> -{
> -    int i;
> -
> -    for (i = 0; i < NR_VIRTIO_MMIO_DEVICES; i++) {
> -        hwaddr base = GUEST_VIRTIO_MMIO_BASE + i * VIRTIO_MMIO_DEV_SIZE;
> -        qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL,
> -                                         GUEST_VIRTIO_MMIO_SPI_FIRST + i);
> -
> -        sysbus_create_simple("virtio-mmio", base, irq);
> -
> -        trace_xen_create_virtio_mmio_devices(i,
> -                                             GUEST_VIRTIO_MMIO_SPI_FIRST + i,
> -                                             base);
> -    }
> -}
> -
> -static void xen_init_ram(MachineState *machine)
> +static void xen_arm_instance_init(Object *obj)
>  {
> -    MemoryRegion *sysmem = get_system_memory();
> -    ram_addr_t block_len, ram_size[GUEST_RAM_BANKS];
> -
> -    trace_xen_init_ram(machine->ram_size);
> -    if (machine->ram_size <= GUEST_RAM0_SIZE) {
> -        ram_size[0] = machine->ram_size;
> -        ram_size[1] = 0;
> -        block_len = GUEST_RAM0_BASE + ram_size[0];
> -    } else {
> -        ram_size[0] = GUEST_RAM0_SIZE;
> -        ram_size[1] = machine->ram_size - GUEST_RAM0_SIZE;
> -        block_len = GUEST_RAM1_BASE + ram_size[1];
> -    }
> +    XenPVHMachineState *s = XEN_PVH_MACHINE(obj);
>  
> -    memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len,
> -                           &error_fatal);
> +    /* Default values.  */
> +    s->cfg.ram_low = (MemMapEntry) { GUEST_RAM0_BASE, GUEST_RAM0_SIZE };
> +    s->cfg.ram_high = (MemMapEntry) { GUEST_RAM1_BASE, GUEST_RAM1_SIZE };
>  
> -    memory_region_init_alias(&ram_lo, NULL, "xen.ram.lo", &xen_memory,
> -                             GUEST_RAM0_BASE, ram_size[0]);
> -    memory_region_add_subregion(sysmem, GUEST_RAM0_BASE, &ram_lo);
> -    if (ram_size[1] > 0) {
> -        memory_region_init_alias(&ram_hi, NULL, "xen.ram.hi", &xen_memory,
> -                                 GUEST_RAM1_BASE, ram_size[1]);
> -        memory_region_add_subregion(sysmem, GUEST_RAM1_BASE, &ram_hi);
> -    }
> -
> -    /* Setup support for grants.  */
> -    memory_region_init_ram(&xen_grants, NULL, "xen.grants", block_len,
> -                           &error_fatal);
> -    memory_region_add_subregion(sysmem, XEN_GRANT_ADDR_OFF, &xen_grants);
> +    s->cfg.virtio_mmio_num = NR_VIRTIO_MMIO_DEVICES;
> +    s->cfg.virtio_mmio_irq_base = GUEST_VIRTIO_MMIO_SPI_FIRST;
> +    s->cfg.virtio_mmio = (MemMapEntry) { GUEST_VIRTIO_MMIO_BASE,
> +                                         VIRTIO_MMIO_DEV_SIZE };
>  }
>  
> -#ifdef CONFIG_TPM
> -static void xen_enable_tpm(XenArmState *xam)
> -{
> -    Error *errp = NULL;
> -    DeviceState *dev;
> -    SysBusDevice *busdev;
> -
> -    TPMBackend *be = qemu_find_tpm_be("tpm0");
> -    if (be == NULL) {
> -        error_report("Couldn't find tmp0 backend");
> -        return;
> -    }
> -    dev = qdev_new(TYPE_TPM_TIS_SYSBUS);
> -    object_property_set_link(OBJECT(dev), "tpmdev", OBJECT(be), &errp);
> -    object_property_set_str(OBJECT(dev), "tpmdev", be->id, &errp);
> -    busdev = SYS_BUS_DEVICE(dev);
> -    sysbus_realize_and_unref(busdev, &error_fatal);
> -    sysbus_mmio_map(busdev, 0, xam->cfg.tpm_base_addr);
> -
> -    trace_xen_enable_tpm(xam->cfg.tpm_base_addr);
> -}
> -#endif
> -
> -static void xen_arm_init(MachineState *machine)
> -{
> -    XenArmState *xam = XEN_ARM(machine);
> -
> -    xam->state =  g_new0(XenIOState, 1);
> -
> -    if (machine->ram_size == 0) {
> -        warn_report("%s: ram size not specified. QEMU machine started"
> -                    " without IOREQ (no emulated devices including virtio)",
> -                    MACHINE_CLASS(object_get_class(OBJECT(machine)))->desc);
> -        return;
> -    }
> -
> -    xen_init_ram(machine);
> -
> -    xen_register_ioreq(xam->state, machine->smp.max_cpus, &xen_memory_listener);
> -
> -    xen_create_virtio_mmio_devices(xam);
> -
> -#ifdef CONFIG_TPM
> -    if (xam->cfg.tpm_base_addr) {
> -        xen_enable_tpm(xam);
> -    } else {
> -        warn_report("tpm-base-addr is not provided. TPM will not be enabled");
> -    }
> -#endif
> -}
> -
> -#ifdef CONFIG_TPM
> -static void xen_arm_get_tpm_base_addr(Object *obj, Visitor *v,
> -                                      const char *name, void *opaque,
> -                                      Error **errp)
> -{
> -    XenArmState *xam = XEN_ARM(obj);
> -    uint64_t value = xam->cfg.tpm_base_addr;
> -
> -    visit_type_uint64(v, name, &value, errp);
> -}
> -
> -static void xen_arm_set_tpm_base_addr(Object *obj, Visitor *v,
> -                                      const char *name, void *opaque,
> -                                      Error **errp)
> -{
> -    XenArmState *xam = XEN_ARM(obj);
> -    uint64_t value;
> -
> -    if (!visit_type_uint64(v, name, &value, errp)) {
> -        return;
> -    }
> -
> -    xam->cfg.tpm_base_addr = value;
> -}
> -#endif
> -
>  static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
>  {
> -
> +    XenPVHMachineClass *xpc = XEN_PVH_MACHINE_CLASS(oc);
>      MachineClass *mc = MACHINE_CLASS(oc);
> +
>      mc->desc = "Xen PVH ARM machine";
> -    mc->init = xen_arm_init;
>  
>      /*
>       * mc->max_cpus holds the MAX value allowed in the -smp command-line opts.
> @@ -218,27 +65,20 @@ static void xen_arm_machine_class_init(ObjectClass *oc, void *data)
>       * mc->max_cpus, QEMU will bail out with an error message.
>       */
>      mc->max_cpus = GUEST_MAX_VCPUS;
> -    mc->default_machine_opts = "accel=xen";
> -    /* Set explicitly here to make sure that real ram_size is passed */
> -    mc->default_ram_size = 0;
>  
> -#ifdef CONFIG_TPM
> -    object_class_property_add(oc, "tpm-base-addr", "uint64_t",
> -                              xen_arm_get_tpm_base_addr,
> -                              xen_arm_set_tpm_base_addr,
> -                              NULL, NULL);
> -    object_class_property_set_description(oc, "tpm-base-addr",
> -                                          "Set Base address for TPM device.");
> +    /* List of supported features known to work on PVH ARM.  */
> +    xpc->has_tpm = true;
> +    xpc->has_virtio_mmio = true;
>  
> -    machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS);
> -#endif
> +    xen_pvh_class_setup_common_props(xpc);
>  }
>  
>  static const TypeInfo xen_arm_machine_type = {
>      .name = TYPE_XEN_ARM,
> -    .parent = TYPE_MACHINE,
> +    .parent = TYPE_XEN_PVH_MACHINE,
>      .class_init = xen_arm_machine_class_init,
> -    .instance_size = sizeof(XenArmState),
> +    .instance_size = sizeof(XenPVHMachineState),
> +    .instance_init = xen_arm_instance_init,
>  };
>  
>  static void xen_arm_machine_register_types(void)
> diff --git a/hw/xen/meson.build b/hw/xen/meson.build
> index d887fa9ba4..4a486e3673 100644
> --- a/hw/xen/meson.build
> +++ b/hw/xen/meson.build
> @@ -15,6 +15,7 @@ xen_specific_ss = ss.source_set()
>  xen_specific_ss.add(files(
>    'xen-mapcache.c',
>    'xen-hvm-common.c',
> +  'xen-pvh-common.c',
>  ))
>  if have_xen_pci_passthrough
>    xen_specific_ss.add(files(
> diff --git a/hw/xen/trace-events b/hw/xen/trace-events
> index d1b27f6c11..a07fe41c6d 100644
> --- a/hw/xen/trace-events
> +++ b/hw/xen/trace-events
> @@ -64,6 +64,10 @@ destroy_hvm_domain_cannot_acquire_handle(void) "Cannot acquire xenctrl handle"
>  destroy_hvm_domain_failed_action(const char *action, int sts, char *errno_s) "xc_domain_shutdown failed to issue %s, sts %d, %s"
>  destroy_hvm_domain_action(int xen_domid, const char *action) "Issued domain %d %s"
>  
> +# xen-pvh-common.c
> +xen_create_virtio_mmio_devices(int i, int irq, uint64_t base) "Created virtio-mmio device %d: irq %d base 0x%"PRIx64
> +xen_enable_tpm(uint64_t addr) "Connected tpmdev at address 0x%"PRIx64
> +
>  # xen-mapcache.c
>  xen_map_cache(uint64_t phys_addr) "want 0x%"PRIx64
>  xen_remap_bucket(uint64_t index) "index 0x%"PRIx64
> diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
> new file mode 100644
> index 0000000000..880e8143d7
> --- /dev/null
> +++ b/hw/xen/xen-pvh-common.c
> @@ -0,0 +1,275 @@
> +/*
> + * QEMU Xen PVH machine - common code.
> + *
> + * Copyright (c) 2024 Advanced Micro Devices, Inc.
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
> +#include "qemu/osdep.h"
> +#include "qemu/error-report.h"
> +#include "qapi/error.h"
> +#include "qapi/visitor.h"
> +#include "hw/boards.h"
> +#include "hw/irq.h"
> +#include "hw/sysbus.h"
> +#include "sysemu/sysemu.h"
> +#include "sysemu/tpm.h"
> +#include "sysemu/tpm_backend.h"
> +#include "hw/xen/xen-pvh-common.h"
> +#include "trace.h"
> +
> +static const MemoryListener xen_memory_listener = {
> +    .region_add = xen_region_add,
> +    .region_del = xen_region_del,
> +    .log_start = NULL,
> +    .log_stop = NULL,
> +    .log_sync = NULL,
> +    .log_global_start = NULL,
> +    .log_global_stop = NULL,
> +    .priority = MEMORY_LISTENER_PRIORITY_ACCEL,
> +};
> +
> +static void xen_pvh_init_ram(XenPVHMachineState *s,
> +                             MemoryRegion *sysmem)
> +{
> +    MachineState *ms = MACHINE(s);
> +    ram_addr_t block_len, ram_size[2];
> +
> +    if (ms->ram_size <= s->cfg.ram_low.size) {
> +        ram_size[0] = ms->ram_size;
> +        ram_size[1] = 0;
> +        block_len = s->cfg.ram_low.base + ram_size[0];
> +    } else {
> +        ram_size[0] = s->cfg.ram_low.size;
> +        ram_size[1] = ms->ram_size - s->cfg.ram_low.size;
> +        block_len = s->cfg.ram_high.base + ram_size[1];
> +    }
> +
> +    memory_region_init_ram(&xen_memory, NULL, "xen.ram", block_len,
> +                           &error_fatal);
> +
> +    memory_region_init_alias(&s->ram.low, NULL, "xen.ram.lo", &xen_memory,
> +                             s->cfg.ram_low.base, ram_size[0]);
> +    memory_region_add_subregion(sysmem, s->cfg.ram_low.base, &s->ram.low);
> +    if (ram_size[1] > 0) {
> +        memory_region_init_alias(&s->ram.high, NULL, "xen.ram.hi", &xen_memory,
> +                                 s->cfg.ram_high.base, ram_size[1]);
> +        memory_region_add_subregion(sysmem, s->cfg.ram_high.base, &s->ram.high);
> +    }
> +
> +    /* Setup support for grants.  */
> +    memory_region_init_ram(&xen_grants, NULL, "xen.grants", block_len,
> +                           &error_fatal);
> +    memory_region_add_subregion(sysmem, XEN_GRANT_ADDR_OFF, &xen_grants);
> +}
> +
> +static void xen_set_irq(void *opaque, int irq, int level)
> +{
> +    if (xendevicemodel_set_irq_level(xen_dmod, xen_domid, irq, level)) {
> +        error_report("xendevicemodel_set_irq_level failed");
> +    }
> +}
> +
> +static void xen_create_virtio_mmio_devices(XenPVHMachineState *s)
> +{
> +    int i;
> +
> +    for (i = 0; i < s->cfg.virtio_mmio_num; i++) {
> +        hwaddr base = s->cfg.virtio_mmio.base + i * s->cfg.virtio_mmio.size;
> +        qemu_irq irq = qemu_allocate_irq(xen_set_irq, NULL,
> +                                         s->cfg.virtio_mmio_irq_base + i);
> +
> +        sysbus_create_simple("virtio-mmio", base, irq);
> +
> +        trace_xen_create_virtio_mmio_devices(i,
> +                                             s->cfg.virtio_mmio_irq_base + i,
> +                                             base);
> +    }
> +}
> +
> +#ifdef CONFIG_TPM
> +static void xen_enable_tpm(XenPVHMachineState *s)
> +{
> +    Error *errp = NULL;
> +    DeviceState *dev;
> +    SysBusDevice *busdev;
> +
> +    TPMBackend *be = qemu_find_tpm_be("tpm0");
> +    if (be == NULL) {
> +        error_report("Couldn't find tmp0 backend");
> +        return;
> +    }
> +    dev = qdev_new(TYPE_TPM_TIS_SYSBUS);
> +    object_property_set_link(OBJECT(dev), "tpmdev", OBJECT(be), &errp);
> +    object_property_set_str(OBJECT(dev), "tpmdev", be->id, &errp);
> +    busdev = SYS_BUS_DEVICE(dev);
> +    sysbus_realize_and_unref(busdev, &error_fatal);
> +    sysbus_mmio_map(busdev, 0, s->cfg.tpm.base);
> +
> +    trace_xen_enable_tpm(s->cfg.tpm.base);
> +}
> +#endif
> +
> +static void xen_pvh_init(MachineState *ms)
> +{
> +    XenPVHMachineState *s = XEN_PVH_MACHINE(ms);
> +    XenPVHMachineClass *xpc = XEN_PVH_MACHINE_GET_CLASS(s);
> +    MemoryRegion *sysmem = get_system_memory();
> +
> +    if (ms->ram_size == 0) {
> +        warn_report("%s: ram size not specified. QEMU machine started"
> +                    " without IOREQ (no emulated devices including virtio)",
> +                    MACHINE_CLASS(object_get_class(OBJECT(ms)))->desc);
> +        return;
> +    }
> +
> +    xen_pvh_init_ram(s, sysmem);
> +    xen_register_ioreq(&s->ioreq, ms->smp.max_cpus, &xen_memory_listener);
> +
> +    if (s->cfg.virtio_mmio_num) {
> +        xen_create_virtio_mmio_devices(s);
> +    }
> +
> +#ifdef CONFIG_TPM
> +    if (xpc->has_tpm) {
> +        if (s->cfg.tpm.base) {
> +            xen_enable_tpm(s);
> +        } else {
> +            warn_report("tpm-base-addr is not set. TPM will not be enabled");
> +        }
> +    }
> +#endif
> +
> +    /* Call the implementation specific init.  */
> +    if (xpc->init) {
> +        xpc->init(ms);
> +    }
> +}
> +
> +#define XEN_PVH_PROP_MEMMAP_SETTER(n, f)                                   \
> +static void xen_pvh_set_ ## n ## _ ## f(Object *obj, Visitor *v,           \
> +                                       const char *name, void *opaque,     \
> +                                       Error **errp)                       \
> +{                                                                          \
> +    XenPVHMachineState *xp = XEN_PVH_MACHINE(obj);                         \
> +    uint64_t value;                                                        \
> +                                                                           \
> +    if (!visit_type_size(v, name, &value, errp)) {                         \
> +        return;                                                            \
> +    }                                                                      \
> +    xp->cfg.n.f = value;                                                   \
> +}
> +
> +#define XEN_PVH_PROP_MEMMAP_GETTER(n, f)                                   \
> +static void xen_pvh_get_ ## n ## _ ## f(Object *obj, Visitor *v,           \
> +                                       const char *name, void *opaque,     \
> +                                       Error **errp)                       \
> +{                                                                          \
> +    XenPVHMachineState *xp = XEN_PVH_MACHINE(obj);                         \
> +    uint64_t value = xp->cfg.n.f;                                          \
> +                                                                           \
> +    visit_type_uint64(v, name, &value, errp);                              \
> +}
> +
> +#define XEN_PVH_PROP_MEMMAP_BASE(n)        \
> +    XEN_PVH_PROP_MEMMAP_SETTER(n, base)    \
> +    XEN_PVH_PROP_MEMMAP_GETTER(n, base)    \
> +
> +#define XEN_PVH_PROP_MEMMAP_SIZE(n)        \
> +    XEN_PVH_PROP_MEMMAP_SETTER(n, size)    \
> +    XEN_PVH_PROP_MEMMAP_GETTER(n, size)
> +
> +#define XEN_PVH_PROP_MEMMAP(n)             \
> +    XEN_PVH_PROP_MEMMAP_BASE(n)            \
> +    XEN_PVH_PROP_MEMMAP_SIZE(n)
> +
> +XEN_PVH_PROP_MEMMAP(ram_low)
> +XEN_PVH_PROP_MEMMAP(ram_high)
> +/* TPM only has a base-addr option.  */
> +XEN_PVH_PROP_MEMMAP_BASE(tpm)
> +XEN_PVH_PROP_MEMMAP(virtio_mmio)
> +
> +void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc)
> +{
> +    ObjectClass *oc = OBJECT_CLASS(xpc);
> +    MachineClass *mc = MACHINE_CLASS(xpc);
> +
> +#define OC_MEMMAP_PROP_BASE(c, prop_name, name)                           \
> +do {                                                                      \
> +    object_class_property_add(c, prop_name "-base", "uint64_t",           \
> +                              xen_pvh_get_ ## name ## _base,              \
> +                              xen_pvh_set_ ## name ## _base, NULL, NULL); \
> +    object_class_property_set_description(oc, prop_name "-base",          \
> +                              "Set base address for " prop_name);         \
> +} while (0)
> +
> +#define OC_MEMMAP_PROP_SIZE(c, prop_name, name)                           \
> +do {                                                                      \
> +    object_class_property_add(c, prop_name "-size", "uint64_t",           \
> +                              xen_pvh_get_ ## name ## _size,              \
> +                              xen_pvh_set_ ## name ## _size, NULL, NULL); \
> +    object_class_property_set_description(oc, prop_name "-size",          \
> +                              "Set memory range size for " prop_name);    \
> +} while (0)
> +
> +#define OC_MEMMAP_PROP(c, prop_name, name)                                \
> +do {                                                                      \
> +        OC_MEMMAP_PROP_BASE(c, prop_name, name);                          \
> +        OC_MEMMAP_PROP_SIZE(c, prop_name, name);                          \
> +} while (0)
> +
> +    /*
> +     * We provide memmap properties to allow Xen to move things to other
> +     * addresses for example when users need to accomodate the memory-map
> +     * for 1:1 mapped devices/memory.
> +     */
> +    OC_MEMMAP_PROP(oc, "ram-low", ram_low);
> +    OC_MEMMAP_PROP(oc, "ram-high", ram_high);
> +
> +    if (xpc->has_virtio_mmio) {
> +        OC_MEMMAP_PROP(oc, "virtio-mmio", virtio_mmio);
> +    }
> +
> +#ifdef CONFIG_TPM
> +    if (xpc->has_tpm) {
> +        object_class_property_add(oc, "tpm-base-addr", "uint64_t",
> +                                  xen_pvh_get_tpm_base,
> +                                  xen_pvh_set_tpm_base,
> +                                  NULL, NULL);
> +        object_class_property_set_description(oc, "tpm-base-addr",
> +                                  "Set Base address for TPM device.");
> +
> +        machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS);
> +    }
> +#endif
> +}
> +
> +static void xen_pvh_class_init(ObjectClass *oc, void *data)
> +{
> +    MachineClass *mc = MACHINE_CLASS(oc);
> +
> +    mc->init = xen_pvh_init;
> +
> +    mc->desc = "Xen PVH machine";
> +    mc->max_cpus = 1;
> +    mc->default_machine_opts = "accel=xen";
> +    /* Set to zero to make sure that the real ram size is passed. */
> +    mc->default_ram_size = 0;
> +}
> +
> +static const TypeInfo xen_pvh_info = {
> +    .name = TYPE_XEN_PVH_MACHINE,
> +    .parent = TYPE_MACHINE,
> +    .abstract = true,
> +    .instance_size = sizeof(XenPVHMachineState),
> +    .class_size = sizeof(XenPVHMachineClass),
> +    .class_init = xen_pvh_class_init,
> +};
> +
> +static void xen_pvh_register_types(void)
> +{
> +    type_register_static(&xen_pvh_info);
> +}
> +
> +type_init(xen_pvh_register_types);
> diff --git a/include/hw/xen/xen-pvh-common.h b/include/hw/xen/xen-pvh-common.h
> new file mode 100644
> index 0000000000..77fd98b9fe
> --- /dev/null
> +++ b/include/hw/xen/xen-pvh-common.h
> @@ -0,0 +1,59 @@
> +/*
> + * QEMU Xen PVH machine - common code.
> + *
> + * Copyright (c) 2024 Advanced Micro Devices, Inc.
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
> +#ifndef XEN_PVH_COMMON_H__
> +#define XEN_PVH_COMMON_H__
> +
> +#include <assert.h>
> +#include "hw/sysbus.h"
> +#include "hw/hw.h"
> +#include "hw/xen/xen-hvm-common.h"
> +#include "hw/pci-host/gpex.h"
> +
> +#define TYPE_XEN_PVH_MACHINE MACHINE_TYPE_NAME("xen-pvh-base")
> +OBJECT_DECLARE_TYPE(XenPVHMachineState, XenPVHMachineClass,
> +                    XEN_PVH_MACHINE)
> +
> +struct XenPVHMachineClass {
> +    MachineClass parent;
> +
> +    /* PVH implementation specific init.  */
> +    void (*init)(MachineState *state);
> +
> +    /*
> +     * Each implementation can optionally enable features that it
> +     * supports and are known to work.
> +     */
> +    bool has_tpm;
> +    bool has_virtio_mmio;
> +};
> +
> +struct XenPVHMachineState {
> +    /*< private >*/
> +    MachineState parent;
> +
> +    XenIOState ioreq;
> +
> +    struct {
> +        MemoryRegion low;
> +        MemoryRegion high;
> +    } ram;
> +
> +    struct {
> +        MemMapEntry ram_low, ram_high;
> +        MemMapEntry tpm;
> +
> +        /* Virtio-mmio */
> +        MemMapEntry virtio_mmio;
> +        uint32_t virtio_mmio_num;
> +        uint32_t virtio_mmio_irq_base;
> +    } cfg;
> +};
> +
> +void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc);
> +#endif
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 01:23:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 01:23:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780846.1190451 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sga3p-0006uA-MJ; Wed, 21 Aug 2024 01:22:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780846.1190451; Wed, 21 Aug 2024 01:22:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sga3p-0006u3-J4; Wed, 21 Aug 2024 01:22:53 +0000
Received: by outflank-mailman (input) for mailman id 780846;
 Wed, 21 Aug 2024 01:22:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0c/y=PU=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sga3o-0006tu-Ca
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 01:22:52 +0000
Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e1ad1479-5f5b-11ef-a507-bb4a2ccca743;
 Wed, 21 Aug 2024 03:22:51 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by nyc.source.kernel.org (Postfix) with ESMTP id 45C20A40DA8;
 Wed, 21 Aug 2024 01:22:43 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFC07C4AF0B;
 Wed, 21 Aug 2024 01:22:46 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e1ad1479-5f5b-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724203368;
	bh=0Gk5CHnQacQO+KVJ/6YNLAT2y0GWbYzGkbsGsuwtBwI=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=ZnCv9/lofL/nIBVeOeN6OkGByXDaTPTS6UI5IWNocUQAOhvvALH1EmLsRCBqLLF51
	 UIhS/uvs+Nk0Z2kbI23eTKBM/jiw6Xm+Hg6MdS65Ph07lo3kDOw/yiDb1xkjnWnCc5
	 qhKhfJLpDoL0bzvwRTPmlMMcpHx8PRQFjozki71UIGqoTTV5Q6vsYf/d6GQRmFWV1M
	 yrbKj+vq2m86jWCTbcODfXJjSxEUnIw/f032PA4+iR45AcOjG7lEbOnQtGakQYy7Ye
	 taB/dl8i/ouT6Gfq8aWYwd9nmhO2OfSKqXRMTX3SUaOpTj5HUBb+DFbQYNVJ2VkWth
	 T0WRwpqaNG6Hg==
Date: Tue, 20 Aug 2024 18:22:45 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony@xenproject.org, 
    paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
    xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, 
    xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 10/12] hw/xen: pvh-common: Add support for creating
 PCIe/GPEX
In-Reply-To: <20240820142949.533381-11-edgar.iglesias@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408201822390.298534@ubuntu-linux-20-04-desktop>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com> <20240820142949.533381-11-edgar.iglesias@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 20 Aug 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> 
> Add support for optionally creating a PCIe/GPEX controller.
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  hw/xen/xen-pvh-common.c         | 76 +++++++++++++++++++++++++++++++++
>  include/hw/xen/xen-pvh-common.h | 29 +++++++++++++
>  2 files changed, 105 insertions(+)
> 
> diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
> index 295f920442..28d7168446 100644
> --- a/hw/xen/xen-pvh-common.c
> +++ b/hw/xen/xen-pvh-common.c
> @@ -122,6 +122,64 @@ static void xen_enable_tpm(XenPVHMachineState *s)
>  }
>  #endif
>  
> +/*
> + * We use the GPEX PCIe controller with its internal INTX PCI interrupt
> + * swizzling. This swizzling is emulated in QEMU and routes all INTX
> + * interrupts from endpoints down to only 4 INTX interrupts.
> + * See include/hw/pci/pci.h : pci_swizzle()
> + */
> +static inline void xenpvh_gpex_init(XenPVHMachineState *s,
> +                                    XenPVHMachineClass *xpc,
> +                                    MemoryRegion *sysmem)
> +{
> +    MemoryRegion *ecam_reg;
> +    MemoryRegion *mmio_reg;
> +    DeviceState *dev;
> +    int i;
> +
> +    object_initialize_child(OBJECT(s), "gpex", &s->pci.gpex,
> +                            TYPE_GPEX_HOST);
> +    dev = DEVICE(&s->pci.gpex);
> +    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
> +
> +    ecam_reg = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
> +    memory_region_add_subregion(sysmem, s->cfg.pci_ecam.base, ecam_reg);
> +
> +    mmio_reg = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 1);
> +
> +    if (s->cfg.pci_mmio.size) {
> +        memory_region_init_alias(&s->pci.mmio_alias, OBJECT(dev), "pcie-mmio",
> +                                 mmio_reg,
> +                                 s->cfg.pci_mmio.base, s->cfg.pci_mmio.size);
> +        memory_region_add_subregion(sysmem, s->cfg.pci_mmio.base,
> +                                    &s->pci.mmio_alias);
> +    }
> +
> +    if (s->cfg.pci_mmio_high.size) {
> +        memory_region_init_alias(&s->pci.mmio_high_alias, OBJECT(dev),
> +                "pcie-mmio-high",
> +                mmio_reg, s->cfg.pci_mmio_high.base, s->cfg.pci_mmio_high.size);
> +        memory_region_add_subregion(sysmem, s->cfg.pci_mmio_high.base,
> +                &s->pci.mmio_high_alias);
> +    }
> +
> +    /*
> +     * PVH implementations with PCI enabled must provide set_pci_intx_irq()
> +     * and optionally an implementation of set_pci_link_route().
> +     */
> +    assert(xpc->set_pci_intx_irq);
> +
> +    for (i = 0; i < GPEX_NUM_IRQS; i++) {
> +        qemu_irq irq = qemu_allocate_irq(xpc->set_pci_intx_irq, s, i);
> +
> +        sysbus_connect_irq(SYS_BUS_DEVICE(dev), i, irq);
> +        gpex_set_irq_num(GPEX_HOST(dev), i, s->cfg.pci_intx_irq_base + i);
> +        if (xpc->set_pci_link_route) {
> +            xpc->set_pci_link_route(i, s->cfg.pci_intx_irq_base + i);
> +        }
> +    }
> +}
> +
>  static void xen_pvh_init(MachineState *ms)
>  {
>      XenPVHMachineState *s = XEN_PVH_MACHINE(ms);
> @@ -152,6 +210,15 @@ static void xen_pvh_init(MachineState *ms)
>      }
>  #endif
>  
> +    /* Non-zero pci-ecam-size enables PCI.  */
> +    if (s->cfg.pci_ecam.size) {
> +        if (s->cfg.pci_ecam.size != 256 * MiB) {
> +            error_report("pci-ecam-size only supports values 0 or 0x10000000");
> +            exit(EXIT_FAILURE);
> +        }
> +        xenpvh_gpex_init(s, xpc, sysmem);
> +    }
> +
>      /* Call the implementation specific init.  */
>      if (xpc->init) {
>          xpc->init(ms);
> @@ -200,6 +267,9 @@ XEN_PVH_PROP_MEMMAP(ram_high)
>  /* TPM only has a base-addr option.  */
>  XEN_PVH_PROP_MEMMAP_BASE(tpm)
>  XEN_PVH_PROP_MEMMAP(virtio_mmio)
> +XEN_PVH_PROP_MEMMAP(pci_ecam)
> +XEN_PVH_PROP_MEMMAP(pci_mmio)
> +XEN_PVH_PROP_MEMMAP(pci_mmio_high)
>  
>  void xen_pvh_class_setup_common_props(XenPVHMachineClass *xpc)
>  {
> @@ -242,6 +312,12 @@ do {                                                                      \
>          OC_MEMMAP_PROP(oc, "virtio-mmio", virtio_mmio);
>      }
>  
> +    if (xpc->has_pci) {
> +        OC_MEMMAP_PROP(oc, "pci-ecam", pci_ecam);
> +        OC_MEMMAP_PROP(oc, "pci-mmio", pci_mmio);
> +        OC_MEMMAP_PROP(oc, "pci-mmio-high", pci_mmio_high);
> +    }
> +
>  #ifdef CONFIG_TPM
>      if (xpc->has_tpm) {
>          object_class_property_add(oc, "tpm-base-addr", "uint64_t",
> diff --git a/include/hw/xen/xen-pvh-common.h b/include/hw/xen/xen-pvh-common.h
> index 77fd98b9fe..bc09eea936 100644
> --- a/include/hw/xen/xen-pvh-common.h
> +++ b/include/hw/xen/xen-pvh-common.h
> @@ -25,10 +25,29 @@ struct XenPVHMachineClass {
>      /* PVH implementation specific init.  */
>      void (*init)(MachineState *state);
>  
> +    /*
> +     * set_pci_intx_irq - Deliver INTX irqs to the guest.
> +     *
> +     * @opaque: pointer to XenPVHMachineState.
> +     * @irq: IRQ after swizzling, between 0-3.
> +     * @level: IRQ level.
> +     */
> +    void (*set_pci_intx_irq)(void *opaque, int irq, int level);
> +
> +    /*
> +     * set_pci_link_route: - optional implementation call to setup
> +     * routing between INTX IRQ (0 - 3) and GSI's.
> +     *
> +     * @line: line the INTx line (0 => A .. 3 => B)
> +     * @irq: GSI
> +     */
> +    int (*set_pci_link_route)(uint8_t line, uint8_t irq);
> +
>      /*
>       * Each implementation can optionally enable features that it
>       * supports and are known to work.
>       */
> +    bool has_pci;
>      bool has_tpm;
>      bool has_virtio_mmio;
>  };
> @@ -44,6 +63,12 @@ struct XenPVHMachineState {
>          MemoryRegion high;
>      } ram;
>  
> +    struct {
> +        GPEXHost gpex;
> +        MemoryRegion mmio_alias;
> +        MemoryRegion mmio_high_alias;
> +    } pci;
> +
>      struct {
>          MemMapEntry ram_low, ram_high;
>          MemMapEntry tpm;
> @@ -52,6 +77,10 @@ struct XenPVHMachineState {
>          MemMapEntry virtio_mmio;
>          uint32_t virtio_mmio_num;
>          uint32_t virtio_mmio_irq_base;
> +
> +        /* PCI */
> +        MemMapEntry pci_ecam, pci_mmio, pci_mmio_high;
> +        uint32_t pci_intx_irq_base;
>      } cfg;
>  };
>  
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 01:23:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 01:23:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780849.1190462 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sga49-0007Gb-UH; Wed, 21 Aug 2024 01:23:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780849.1190462; Wed, 21 Aug 2024 01:23:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sga49-0007GU-Qo; Wed, 21 Aug 2024 01:23:13 +0000
Received: by outflank-mailman (input) for mailman id 780849;
 Wed, 21 Aug 2024 01:23: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=0c/y=PU=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sga48-0007D7-U1
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 01:23:12 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eb3608c3-5f5b-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 03:23:08 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 012C3CE0CDF;
 Wed, 21 Aug 2024 01:23:04 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5637AC4AF0B;
 Wed, 21 Aug 2024 01:23:00 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eb3608c3-5f5b-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724203382;
	bh=PD+v8CbvewzPXcIply8oiPVykbg+nqf9Vz9nQhrUa0c=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=X5shaQ70F4qVY89XUtBQBxoCcc2kuEEqBZe3JM4mvEmEABU4dz+1Mj4Li3mqGSRpB
	 w26GCJZ9GOET88VrPaoQCGMLjBHPnd2LAwFU2RU52EPXiXHU+imMhRIm7AEP+fWFlQ
	 e0t+oK3hpmZ/iIHv0Ab3g2d03HAeyntuSpgiW3PnhV49FEbMnPCTlJIRzUmXWhmSSB
	 /eks8ZbXcpSbIemQd2USXWf95Idp7wQOTdhaci5xlm+2Bqa3iXap28ch8eAXMpzThX
	 jp+ateAJAJ12OHv6gO94mb1eRe+f3g1fuXg1N/4PhGiO3Mkxh4whfzhIapFzxL0FsX
	 MSUvCQ2mHVO/A==
Date: Tue, 20 Aug 2024 18:22:58 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
cc: qemu-devel@nongnu.org, sstabellini@kernel.org, anthony@xenproject.org, 
    paul@xen.org, peter.maydell@linaro.org, alex.bennee@linaro.org, 
    xenia.ragiadakou@amd.com, jason.andryuk@amd.com, edgar.iglesias@amd.com, 
    xen-devel@lists.xenproject.org, "Michael S. Tsirkin" <mst@redhat.com>, 
    Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, 
    Paolo Bonzini <pbonzini@redhat.com>, 
    Richard Henderson <richard.henderson@linaro.org>, 
    Eduardo Habkost <eduardo@habkost.net>
Subject: Re: [PATCH v2 11/12] hw/i386/xen: Add a Xen PVH x86 machine
In-Reply-To: <20240820142949.533381-12-edgar.iglesias@gmail.com>
Message-ID: <alpine.DEB.2.22.394.2408201822530.298534@ubuntu-linux-20-04-desktop>
References: <20240820142949.533381-1-edgar.iglesias@gmail.com> <20240820142949.533381-12-edgar.iglesias@gmail.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 20 Aug 2024, Edgar E. Iglesias wrote:
> From: "Edgar E. Iglesias" <edgar.iglesias@amd.com>
> 
> Add a Xen PVH x86 machine based on the abstract PVH Machine.
> 
> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>


Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  hw/i386/xen/meson.build |   1 +
>  hw/i386/xen/xen-pvh.c   | 121 ++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 122 insertions(+)
>  create mode 100644 hw/i386/xen/xen-pvh.c
> 
> diff --git a/hw/i386/xen/meson.build b/hw/i386/xen/meson.build
> index 3f0df8bc07..c73c62b8e3 100644
> --- a/hw/i386/xen/meson.build
> +++ b/hw/i386/xen/meson.build
> @@ -4,6 +4,7 @@ i386_ss.add(when: 'CONFIG_XEN', if_true: files(
>  ))
>  i386_ss.add(when: ['CONFIG_XEN', xen], if_true: files(
>    'xen-hvm.c',
> +  'xen-pvh.c',
>  ))
>  
>  i386_ss.add(when: 'CONFIG_XEN_BUS', if_true: files(
> diff --git a/hw/i386/xen/xen-pvh.c b/hw/i386/xen/xen-pvh.c
> new file mode 100644
> index 0000000000..45645667e9
> --- /dev/null
> +++ b/hw/i386/xen/xen-pvh.c
> @@ -0,0 +1,121 @@
> +/*
> + * QEMU Xen PVH x86 Machine
> + *
> + * Copyright (c) 2024 Advanced Micro Devices, Inc.
> + * Written by Edgar E. Iglesias <edgar.iglesias@amd.com>
> + *
> + * SPDX-License-Identifier: GPL-2.0-or-later
> + */
> +
> +#include "qemu/osdep.h"
> +#include "qemu/error-report.h"
> +#include "hw/boards.h"
> +#include "sysemu/sysemu.h"
> +#include "hw/xen/arch_hvm.h"
> +#include <xen/hvm/hvm_info_table.h>
> +#include "hw/xen/xen-pvh-common.h"
> +
> +#define TYPE_XEN_PVH_X86  MACHINE_TYPE_NAME("xenpvh")
> +OBJECT_DECLARE_SIMPLE_TYPE(XenPVHx86State, XEN_PVH_X86)
> +
> +struct XenPVHx86State {
> +    /*< private >*/
> +    XenPVHMachineState parent;
> +
> +    DeviceState **cpu;
> +};
> +
> +static DeviceState *xen_pvh_cpu_new(MachineState *ms,
> +                                    int64_t apic_id)
> +{
> +    Object *cpu = object_new(ms->cpu_type);
> +
> +    object_property_add_child(OBJECT(ms), "cpu[*]", cpu);
> +    object_property_set_uint(cpu, "apic-id", apic_id, &error_fatal);
> +    qdev_realize(DEVICE(cpu), NULL, &error_fatal);
> +    object_unref(cpu);
> +
> +    return DEVICE(cpu);
> +}
> +
> +static void xen_pvh_init(MachineState *ms)
> +{
> +    XenPVHx86State *xp = XEN_PVH_X86(ms);
> +    int i;
> +
> +    /* Create dummy cores. This will indirectly create the APIC MSI window.  */
> +    xp->cpu = g_malloc(sizeof xp->cpu[0] * ms->smp.max_cpus);
> +    for (i = 0; i < ms->smp.max_cpus; i++) {
> +        xp->cpu[i] = xen_pvh_cpu_new(ms, i);
> +    }
> +}
> +
> +static void xen_pvh_instance_init(Object *obj)
> +{
> +    XenPVHMachineState *s = XEN_PVH_MACHINE(obj);
> +
> +    /* Default values.  */
> +    s->cfg.ram_low = (MemMapEntry) { 0x0, 0x80000000U };
> +    s->cfg.ram_high = (MemMapEntry) { 0xC000000000ULL, 0x4000000000ULL };
> +    s->cfg.pci_intx_irq_base = 16;
> +}
> +
> +/*
> + * Deliver INTX interrupts to Xen guest.
> + */
> +static void xen_pvh_set_pci_intx_irq(void *opaque, int irq, int level)
> +{
> +    /*
> +     * Since QEMU emulates all of the swizziling
> +     * We don't want Xen to do any additional swizzling in
> +     * xen_set_pci_intx_level() so we always set device to 0.
> +     */
> +    if (xen_set_pci_intx_level(xen_domid, 0, 0, 0, irq, level)) {
> +        error_report("xendevicemodel_set_pci_intx_level failed");
> +    }
> +}
> +
> +static void xen_pvh_machine_class_init(ObjectClass *oc, void *data)
> +{
> +    XenPVHMachineClass *xpc = XEN_PVH_MACHINE_CLASS(oc);
> +    MachineClass *mc = MACHINE_CLASS(oc);
> +
> +    mc->desc = "Xen PVH x86 machine";
> +    mc->default_cpu_type = TARGET_DEFAULT_CPU_TYPE;
> +
> +    /* mc->max_cpus holds the MAX value allowed in the -smp cmd-line opts. */
> +    mc->max_cpus = HVM_MAX_VCPUS;
> +
> +    /* We have an implementation specific init to create CPU objects.  */
> +    xpc->init = xen_pvh_init;
> +
> +    /*
> +     * PCI INTX routing.
> +     *
> +     * We describe the mapping between the 4 INTX interrupt and GSIs
> +     * using xen_set_pci_link_route(). xen_pvh_set_pci_intx_irq is
> +     * used to deliver the interrupt.
> +     */
> +    xpc->set_pci_intx_irq = xen_pvh_set_pci_intx_irq;
> +    xpc->set_pci_link_route = xen_set_pci_link_route;
> +
> +    /* List of supported features known to work on PVH x86.  */
> +    xpc->has_pci = true;
> +
> +    xen_pvh_class_setup_common_props(xpc);
> +}
> +
> +static const TypeInfo xen_pvh_x86_machine_type = {
> +    .name = TYPE_XEN_PVH_X86,
> +    .parent = TYPE_XEN_PVH_MACHINE,
> +    .class_init = xen_pvh_machine_class_init,
> +    .instance_init = xen_pvh_instance_init,
> +    .instance_size = sizeof(XenPVHx86State),
> +};
> +
> +static void xen_pvh_machine_register_types(void)
> +{
> +    type_register_static(&xen_pvh_x86_machine_type);
> +}
> +
> +type_init(xen_pvh_machine_register_types)
> -- 
> 2.43.0
> 


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 01:25:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 01:25:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780859.1190472 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sga6f-00080j-Ak; Wed, 21 Aug 2024 01:25:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780859.1190472; Wed, 21 Aug 2024 01:25:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sga6f-00080c-7V; Wed, 21 Aug 2024 01:25:49 +0000
Received: by outflank-mailman (input) for mailman id 780859;
 Wed, 21 Aug 2024 01:25:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sga6d-00080P-Rl; Wed, 21 Aug 2024 01:25:47 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sga6d-0003e7-Fw; Wed, 21 Aug 2024 01:25:47 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sga6c-0007xj-Op; Wed, 21 Aug 2024 01:25:46 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sga6c-0003a3-OH; Wed, 21 Aug 2024 01:25:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=idJO3p58YbuDGAFRLUexODmJ10fGgXh7qSEpKjAUi/g=; b=SJM3iK+XNOhkPATINSGeAU8ny/
	JzSq8AvOFrP+6wWtpgrcOtjb/KShMc2xwS5J3Z3iWyDUpk2/7XPDrv42I88MwnqN5mOvTZ3fvllA/
	GbWu8Sv0IFSybpTY1W1kHQEd99JdjN1LV9VoPzDp/mRMznCf8Eebth4Omq9EAm/SxRg0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187293-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187293: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=a30d438ce58b70c5955f5d37f776086ab8f88623
X-Osstest-Versions-That:
    xen=a30d438ce58b70c5955f5d37f776086ab8f88623
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 21 Aug 2024 01:25:46 +0000

flight 187293 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187293/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187286
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187286
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187286
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187286
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187286
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187286
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  a30d438ce58b70c5955f5d37f776086ab8f88623
baseline version:
 xen                  a30d438ce58b70c5955f5d37f776086ab8f88623

Last test of basis   187293  2024-08-20 10:04:46 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 01:28:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 01:28:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780870.1190481 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sga9S-00017z-QV; Wed, 21 Aug 2024 01:28:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780870.1190481; Wed, 21 Aug 2024 01:28:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sga9S-00017s-Nd; Wed, 21 Aug 2024 01:28:42 +0000
Received: by outflank-mailman (input) for mailman id 780870;
 Wed, 21 Aug 2024 01:28:41 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0c/y=PU=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sga9R-00017m-OY
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 01:28:41 +0000
Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b1136aad-5f5c-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 03:28:39 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by dfw.source.kernel.org (Postfix) with ESMTP id 1D76660F96;
 Wed, 21 Aug 2024 01:28:38 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 723B8C4AF09;
 Wed, 21 Aug 2024 01:28:36 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b1136aad-5f5c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724203717;
	bh=Edd8K73reMn7pUR/xfFCHjOocAYQ1b3lbtGS/U9q3qM=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=lXR1X7nkzmgJDDGTM01Q3ByORGJH+1tJKFEhr3/fo2plpI5VYv6kEWkGcrPOiTgcH
	 Aud0eBmgDCoSIFCP/9At3MRQDLRyTI30m/89krwqSA5F34zd0fEtnk+wjC0IkWViLe
	 guB2+4T7q+PTi54Z2cokNtOjUP8Dwmyfod2Cq0U0n0dDGHCfIlhnqksVxSsRa3upyM
	 7HGh10i2BUqxrtLtLH1wOjK8pRSOUsYNhVtAY0n/fIo5DO6XDO+b4FvpJozhNbprGw
	 rUs1A7RBKgT+Teq4t8JC3DfnFbDtQfZRL8jPt9ZDnafP7HHSg1DVWKccCkVJcTOmpy
	 TTuRnT1woFWjw==
Date: Tue, 20 Aug 2024 18:28:35 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Simone Ballarin <simone.ballarin@bugseng.com>, 
    Doug Goldstein <cardoe@cardoe.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>
Subject: Re: [XEN PATCH v5] automation/eclair: extend existing deviations of
 MISRA C Rule 16.3
In-Reply-To: <4f862eb7f88c0deee86f2f0543f2794cc22a1585.1724138992.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2408201828110.298534@ubuntu-linux-20-04-desktop>
References: <4f862eb7f88c0deee86f2f0543f2794cc22a1585.1724138992.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 20 Aug 2024, Federico Serafini wrote:
> Update ECLAIR configuration to deviate more cases where an
> unintentional fallthrough cannot happen.
> 
> Tag Rule 16.3 as clean for arm.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> ---
> Hi, v4 of this patch has been on hold due to discussion on whether or not
> to consider switch clauses ending with ASSERT_UNREACHABLE() as safe;
> I propose the patch again to continue the discussion and maybe reach an
> agreement.

Yes this makes sense and reflect the agreement reached on the other
thread

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Changes from v4:
> - rebase against staging.
> ---
> Changes from v3:
> - do not add the rule to the monitored set (it is already there).
> ---
> Changes from v2:
> - fixed grammar;
> - reprhased deviations regarding do-while-false and ASSERT_UNREACHABLE().
> ---
>  .../eclair_analysis/ECLAIR/deviations.ecl     | 28 +++++++++++++++----
>  automation/eclair_analysis/ECLAIR/tagging.ecl |  2 +-
>  docs/misra/deviations.rst                     | 28 +++++++++++++++++--
>  3 files changed, 48 insertions(+), 10 deletions(-)
> 
> diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
> index 1aa8277066..9051f41602 100644
> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
> @@ -461,14 +461,30 @@ therefore it is deemed better to leave such files as is."
>  -config=MC3R1.R16.2,reports+={deliberate, "any_area(any_loc(file(x86_emulate||x86_svm_emulate)))"}
>  -doc_end
>  
> --doc_begin="Switch clauses ending with continue, goto, return statements are
> -safe."
> --config=MC3R1.R16.3,terminals+={safe, "node(continue_stmt||goto_stmt||return_stmt)"}
> +-doc_begin="Statements that change the control flow (i.e., break, continue, goto, return) and calls to functions that do not return the control back are \"allowed terminal statements\"."
> +-stmt_selector+={r16_3_allowed_terminal, "node(break_stmt||continue_stmt||goto_stmt||return_stmt)||call(property(noreturn))"}
> +-config=MC3R1.R16.3,terminals+={safe, "r16_3_allowed_terminal"}
> +-doc_end
> +
> +-doc_begin="An if-else statement having both branches ending with an allowed terminal statement is itself an allowed terminal statement."
> +-stmt_selector+={r16_3_if, "node(if_stmt)&&(child(then,r16_3_allowed_terminal)||child(then,any_stmt(stmt,-1,r16_3_allowed_terminal)))"}
> +-stmt_selector+={r16_3_else, "node(if_stmt)&&(child(else,r16_3_allowed_terminal)||child(else,any_stmt(stmt,-1,r16_3_allowed_terminal)))"}
> +-stmt_selector+={r16_3_if_else, "r16_3_if&&r16_3_else"}
> +-config=MC3R1.R16.3,terminals+={safe, "r16_3_if_else"}
> +-doc_end
> +
> +-doc_begin="An if-else statement having an always true condition and the true branch ending with an allowed terminal statement is itself an allowed terminal statement."
> +-stmt_selector+={r16_3_if_true, "r16_3_if&&child(cond,definitely_in(1..))"}
> +-config=MC3R1.R16.3,terminals+={safe, "r16_3_if_true"}
> +-doc_end
> +
> +-doc_begin="A switch clause ending with a statement expression which, in turn, ends with an allowed terminal statement is safe."
> +-config=MC3R1.R16.3,terminals+={safe, "node(stmt_expr)&&child(stmt,node(compound_stmt)&&any_stmt(stmt,-1,r16_3_allowed_terminal||r16_3_if_else||r16_3_if_true))"}
>  -doc_end
>  
> --doc_begin="Switch clauses ending with a call to a function that does not give
> -the control back (i.e., a function with attribute noreturn) are safe."
> --config=MC3R1.R16.3,terminals+={safe, "call(property(noreturn))"}
> +-doc_begin="A switch clause ending with a do-while-false the body of which, in turn, ends with an allowed terminal statement is safe.
> +An exception to that is the macro ASSERT_UNREACHABLE() which is effective in debug build only: a switch clause ending with ASSERT_UNREACHABLE() is not considered safe."
> +-config=MC3R1.R16.3,terminals+={safe, "!macro(name(ASSERT_UNREACHABLE))&&node(do_stmt)&&child(cond,definitely_in(0))&&child(body,any_stmt(stmt,-1,r16_3_allowed_terminal||r16_3_if_else||r16_3_if_true))"}
>  -doc_end
>  
>  -doc_begin="Switch clauses ending with pseudo-keyword \"fallthrough\" are
> diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl b/automation/eclair_analysis/ECLAIR/tagging.ecl
> index 4d0ac94848..b8448938e6 100644
> --- a/automation/eclair_analysis/ECLAIR/tagging.ecl
> +++ b/automation/eclair_analysis/ECLAIR/tagging.ecl
> @@ -112,7 +112,7 @@ if(string_equal(target,"x86_64"),
>  )
>  
>  if(string_equal(target,"arm64"),
> -    service_selector({"additional_clean_guidelines","MC3R1.R16.6||MC3R1.R2.1||MC3R1.R5.3||MC3R1.R7.3"})
> +    service_selector({"additional_clean_guidelines","MC3R1.R2.1||MC3R1.R5.3||MC3R1.R7.3||MC3R1.R16.3||MC3R1.R16.6"})
>  )
>  
>  -reports+={clean:added,"service(clean_guidelines_common||additional_clean_guidelines)"}
> diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
> index d51aa422b5..b66c271c4e 100644
> --- a/docs/misra/deviations.rst
> +++ b/docs/misra/deviations.rst
> @@ -415,12 +415,34 @@ Deviations related to MISRA C:2012 Rules:
>       - Tagged as `deliberate` for ECLAIR.
>  
>     * - R16.3
> -     - Switch clauses ending with continue, goto, return statements are safe.
> +     - Statements that change the control flow (i.e., break, continue, goto,
> +       return) and calls to functions that do not return the control back are
> +       \"allowed terminal statements\".
>       - Tagged as `safe` for ECLAIR.
>  
>     * - R16.3
> -     - Switch clauses ending with a call to a function that does not give
> -       the control back (i.e., a function with attribute noreturn) are safe.
> +     - An if-else statement having both branches ending with one of the allowed
> +       terminal statemets is itself an allowed terminal statements.
> +     - Tagged as `safe` for ECLAIR.
> +
> +   * - R16.3
> +     - An if-else statement having an always true condition and the true
> +       branch ending with an allowed terminal statement is itself an allowed
> +       terminal statement.
> +     - Tagged as `safe` for ECLAIR.
> +
> +   * - R16.3
> +     - A switch clause ending with a statement expression which, in turn, ends
> +       with an allowed terminal statement (e.g., the expansion of
> +       generate_exception()) is safe.
> +     - Tagged as `safe` for ECLAIR.
> +
> +   * - R16.3
> +     - A switch clause ending with a do-while-false the body of which, in turn,
> +       ends with an allowed terminal statement (e.g., PARSE_ERR_RET()) is safe.
> +       An exception to that is the macro ASSERT_UNREACHABLE() which is
> +       effective in debug build only: a switch clause ending with
> +       ASSERT_UNREACHABLE() is not considered safe.
>       - Tagged as `safe` for ECLAIR.
>  
>     * - R16.3
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 03:49:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 03:49:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780889.1190492 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgcLM-0000Sw-Lg; Wed, 21 Aug 2024 03:49:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780889.1190492; Wed, 21 Aug 2024 03:49:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgcLM-0000Sp-I4; Wed, 21 Aug 2024 03:49:08 +0000
Received: by outflank-mailman (input) for mailman id 780889;
 Wed, 21 Aug 2024 03:49:07 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0c/y=PU=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sgcLL-0000Sj-MC
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 03:49:07 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4d15fc41-5f70-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 05:49:02 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 5D001CE0DAF;
 Wed, 21 Aug 2024 03:48:59 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AFE8C4AF0C;
 Wed, 21 Aug 2024 03:48:57 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4d15fc41-5f70-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724212138;
	bh=bPr0NESxD1Zq8U6Ie+ml5lgoZSc9c9aMDgdEOtiR5XQ=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=mvWEB1fiugIQeTfZMvZR23bnyMYLt3qgjT657447170CrfIRF40F9+7ptYRd829uM
	 la6AvhddY7L/qVWQ4kf6/MXM8wD/LAKWDqdV/U1Kinb0N2Qo9M+EG07p+RF7Dbz6P8
	 mSU9n0PVS+/ZDCwjDsVwBC2ndaTkpU8UuhJR2tUgItrKZlJg9Z+JBQdgFEccWq0Xjq
	 6hOj/45RhtZmC7LfiaGuwnzhcD79dGZlWwTKmNsgxRnfC0tB3ZGHhdENoLTBVBxmMw
	 wApbAifo7SiKSEVqWOlO5OqLabGHni1C8qcb5sxGPljqaBrtVTlb75SrY+8huic8tL
	 smgu2kTrHj6Ig==
Date: Tue, 20 Aug 2024 20:48:55 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Anthony PERARD <anthony.perard@vates.tech>
cc: Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org, 
    Doug Goldstein <cardoe@cardoe.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [PATCH] automation: restore CR filtering
In-Reply-To: <ZsSMVaoJlR4mn7Ig@l14>
Message-ID: <alpine.DEB.2.22.394.2408201842090.298534@ubuntu-linux-20-04-desktop>
References: <alpine.DEB.2.22.394.2408161642220.298534@ubuntu-linux-20-04-desktop> <6d2fbe22-8866-4769-95d0-a5a8613a5936@amd.com> <ZsNl7S1JOYQgQx87@l14> <alpine.DEB.2.22.394.2408191819580.298534@ubuntu-linux-20-04-desktop> <ZsSMVaoJlR4mn7Ig@l14>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 20 Aug 2024, Anthony PERARD wrote:
> On Mon, Aug 19, 2024 at 06:56:47PM -0700, Stefano Stabellini wrote:
> > On Mon, 19 Aug 2024, Anthony PERARD wrote:
> > > On Mon, Aug 19, 2024 at 09:21:22AM +0200, Michal Orzel wrote:
> > > > On 17/08/2024 01:46, Stefano Stabellini wrote:
> > > > > diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> > > > > index 0666f6363e..ed44aab0f0 100755
> > > > > --- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
> > > > > +++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> > > > > @@ -65,4 +65,4 @@ export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x4000000
> > > > >  export QEMU_LOG="smoke.serial"
> > > > >  export PASSED="${passed}"
> > > > > 
> > > > > -./automation/scripts/qemu-key.exp
> > > > > +./automation/scripts/qemu-key.exp | sed 's/\r//'
> > > > 
> > > > I compared 3 pipelines:
> > > > 1) one before c36efb7fcea6 (https://gitlab.com/xen-project/hardware/xen/-/jobs/7566986885)
> > > > 2) one after c36efb7fcea6 (https://gitlab.com/xen-project/hardware/xen/-/jobs/7603830706)
> > > > 3) one with this fix (https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7603783403)
> > > > 
> > > > In 1), there is Xen log + Linux log in Gitlab web page
> > > > In 2), there is no log at all
> > > > In 3), there is only Xen log visible
> > > 
> > > It's nice that you can select uboot/Xen logs or Linux logs based on the
> > > number of '\r' at the end of a line (output cat -A):
> > >     U-Boot 2023.01+dfsg-2+deb12u1 (Apr 18 2024 - 22:00:21 +0000)^M^M$
> > >     (XEN) [    0.013864] Xen version 4.20-unstable (root@) (gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924) debug=n Sat Aug 17 00:54:57 UTC 2024^M^M$
> > >     [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x411fd070]^M^M^M$
> > > 
> > > But to display to GitLab's job logs, we want: sed 's/\r\+$//'
> > > 
> > > Also, do you have to edit every single script to overcome a shortcoming
> > > from the "expect" script? Can't you write a bit of Tcl and edit the line
> > > in the script instead?
> > 
> > The sed route is not perfect but it works :-)
> > 
> > I did try using expect but the logs were mangled. I think I missed that
> > there can be multilple \r. I managed to get close to the wanted behavior
> > with the below, but the Xen logs are still missing and I don't know why. 
> > 
> > https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7617161552
> 
> Well, it just looks like the output is duplicated, if you look at the
> raw output:
> https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7617161552/raw
> 
> So I don't know if it's possible to edit the output before `expect`
> prints it. It probably is, but not easy to do.
> 
> I did try to edit the command line to change QEMU's output:
>     -eval spawn $env(QEMU_CMD)
>     +spawn sh -c "$env(QEMU_CMD) | sed s/\\\\r\\\\+//"
> 
> But then many failure, probably because expect can't interact with qemu
> anymore.
> 
> So I guess `sed` the output of `expect` will do. Maybe put that in a
> script that also call the expect script? (To avoid duplication, and help
> with maintainability of the whole thing.)

I tried a couple more times with expect but couldn't get it to work.
With sed it seems to behave correctly. Can you guys spot any issues with
it? If not, I'll send the full patch.

https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7627376496

diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 0094bfc8e1..e0cea742b0 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -109,4 +109,4 @@ export QEMU_LOG="smoke.serial"
 export LOG_MSG="Domain-0"
 export PASSED="BusyBox"
 
-./automation/scripts/qemu-key.exp
+./automation/scripts/qemu-key.exp | sed 's/\r\+$//'



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 05:36:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 05:36:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780901.1190502 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sge0h-0000tp-4m; Wed, 21 Aug 2024 05:35:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780901.1190502; Wed, 21 Aug 2024 05:35:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sge0h-0000ti-1E; Wed, 21 Aug 2024 05:35:55 +0000
Received: by outflank-mailman (input) for mailman id 780901;
 Wed, 21 Aug 2024 05:35: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=yaOv=PU=ti.com=a-singh21@srs-se1.protection.inumbo.net>)
 id 1sge0f-0000tW-JB
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 05:35:53 +0000
Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 38c5cc56-5f7f-11ef-a507-bb4a2ccca743;
 Wed, 21 Aug 2024 07:35:50 +0200 (CEST)
Received: from lelv0266.itg.ti.com ([10.180.67.225])
 by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 47L5ZiCC083230;
 Wed, 21 Aug 2024 00:35:44 -0500
Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26])
 by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 47L5ZiZ7007703
 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL);
 Wed, 21 Aug 2024 00:35:44 -0500
Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE115.ent.ti.com
 (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Wed, 21
 Aug 2024 00:35:43 -0500
Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DLEE114.ent.ti.com
 (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via
 Frontend Transport; Wed, 21 Aug 2024 00:35:44 -0500
Received: from localhost (nightbug.dhcp.ti.com [10.24.72.75])
 by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 47L5Zgba030679;
 Wed, 21 Aug 2024 00:35:43 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 38c5cc56-5f7f-11ef-a507-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com;
	s=ti-com-17Q1; t=1724218544;
	bh=AcuPLkn7dksPeuORE/kW0nBgcLoMoEslflOsaxQSJfU=;
	h=Date:From:To:CC:Subject:References:In-Reply-To;
	b=W7fZ3XrojT3oM1Qu3TyB4eSMtumxa11fH7y0AL0TR5FsqoElUHxElWhTs4bjiC4J/
	 1G3WG40GPbshepjWJH/mnu7hrl5EyEBxzg9jsLqzpTE5+svwFEtZy5bIQSjYyNa+rt
	 To8cUl7bqmKqTlWyKBFTbrmN5hmEZjM5Mjjip0xk=
Date: Wed, 21 Aug 2024 11:05:42 +0530
From: Amneesh Singh <a-singh21@ti.com>
To: Julien Grall <julien@xen.org>
CC: Michal Orzel <michal.orzel@amd.com>, <xen-devel@lists.xenproject.org>,
        <sstabellini@kernel.org>
Subject: Re: [EXTERNAL] Re: [PATCH v2] drivers: char: omap-uart: provide a
 default clock frequency
Message-ID: <qu7setyrwkh7clo7dxb5iolx2mwcpkd4n45gjthxravmw3gyeo@ged7k7khka54>
References: <20240820082202.326644-1-a-singh21@ti.com>
 <a75c4202-1d66-45d0-be57-f29cacb6237c@amd.com>
 <edb52fc6-fc69-4670-a1bd-e3e960a6e408@xen.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <edb52fc6-fc69-4670-a1bd-e3e960a6e408@xen.org>
X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180

Hello,

On 10:03-20240820, Julien Grall wrote:
> Hi,
> 
> On 20/08/2024 10:00, Michal Orzel wrote:
> > On 20/08/2024 10:22, Amneesh Singh wrote:
> >>
> >>
> >> Quite a few TI K3 devices do not have clock-frequency specified in their
> >> respective UART nodes. However hard-coding the frequency is not a
> >> solution as the function clock input can differ between SoCs. So, use a
> >> default frequency of 48MHz if the device tree does not specify one.
> > I'd mention that this is same as Linux
> >
> >>
> >> Signed-off-by: Amneesh Singh <a-singh21@ti.com>
> >> ---
> >>   xen/drivers/char/omap-uart.c | 8 ++++++--
> >>   1 file changed, 6 insertions(+), 2 deletions(-)
> >> ---
> >> v1: https://lore.kernel.org/all/20240719113313.145587-1-a-singh21@ti.com/T/
> >>
> >> v1 -> v2
> >> - Ditch adding a dtuart option
> >> - Use a default value instead
> >>
> >> This default is the same one as found in the 8250_omap driver of the
> >> linux tree. Already tested with Xen.
> >>
> >> diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
> >> index 1079198..9d3d39c 100644
> >> --- a/xen/drivers/char/omap-uart.c
> >> +++ b/xen/drivers/char/omap-uart.c
> >> @@ -48,6 +48,9 @@
> >>   /* System configuration register */
> >>   #define UART_OMAP_SYSC_DEF_CONF   0x0d   /* autoidle mode, wakeup is enabled */
> >>
> >> +/* default clock frequency in hz */
> >> +#define UART_OMAP_DEFAULT_CLK_SPEED 48000000
> > I think this should have U suffix to please MISRA 7.2

Can I count on you to add this unsigned suffix as well? Thanks.

> >
> >> +
> >>   #define omap_read(uart, off)       readl((uart)->regs + ((off) << REG_SHIFT))
> >>   #define omap_write(uart, off, val) writel(val, \
> >>                                             (uart)->regs + ((off) << REG_SHIFT))
> >> @@ -322,8 +325,9 @@ static int __init omap_uart_init(struct dt_device_node *dev,
> >>       res = dt_property_read_u32(dev, "clock-frequency", &clkspec);
> >>       if ( !res )
> >>       {
> >> -        printk("omap-uart: Unable to retrieve the clock frequency\n");
> >> -        return -EINVAL;
> >> +        printk("omap-uart: Unable to retrieve the clock frequency, "
> >> +               "defaulting to %uHz\n", UART_OMAP_DEFAULT_CLK_SPEED);
> > Even though there is a comma, printk messages should not really be split. In such cases it's fine
> > to exceed 80 chars limit. Or do:
> 
> In general, we allow to exceed the limit only for the message. If there
> are arguments then ...
> 
> >          printk("omap-uart: Clock frequency not specified, defaulting to %uHz\n",
> >                 UART_OMAP_DEFAULT_CLK_SPEED);
> 
> ... this is the preferred approach. I can do the update on commit if an
> updated commit message is provided.

Please do, thanks. You can use this as the commit message:

[quote]

Quite a few TI K3 devices do not have clock-frequency specified in their
respective UART nodes. However hard-coding the frequency is not a
solution as the function clock input can differ between SoCs. So, use a
default frequency of 48MHz, which is the same as the linux default (see
8250_omap.c), if the device tree does not specify it.

[/quote]

Or if you'd prefer, I can resend the thing with the suggested changes.

> 
> Cheers,
> 
> --
> Julien Grall
> 
>

Regards
Amneesh


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 05:39:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 05:39:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780908.1190512 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sge3o-0001uv-IW; Wed, 21 Aug 2024 05:39:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780908.1190512; Wed, 21 Aug 2024 05:39:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sge3o-0001uo-Er; Wed, 21 Aug 2024 05:39:08 +0000
Received: by outflank-mailman (input) for mailman id 780908;
 Wed, 21 Aug 2024 05:39: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=yaOv=PU=ti.com=a-singh21@srs-se1.protection.inumbo.net>)
 id 1sge3m-0001ue-Og
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 05:39:06 +0000
Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id abe9c141-5f7f-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 07:39:04 +0200 (CEST)
Received: from fllv0035.itg.ti.com ([10.64.41.0])
 by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 47L5d1Ci045008;
 Wed, 21 Aug 2024 00:39:01 -0500
Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27])
 by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 47L5d1Br075066
 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL);
 Wed, 21 Aug 2024 00:39:01 -0500
Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE106.ent.ti.com
 (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Wed, 21
 Aug 2024 00:39:01 -0500
Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE111.ent.ti.com
 (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via
 Frontend Transport; Wed, 21 Aug 2024 00:39:01 -0500
Received: from localhost (nightbug.dhcp.ti.com [10.24.72.75])
 by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 47L5d0k4052863;
 Wed, 21 Aug 2024 00:39:00 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: abe9c141-5f7f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com;
	s=ti-com-17Q1; t=1724218741;
	bh=4w0VkpEfU1AMarsd6/LvOhcnQP/j7KKEjGY1ay3+X0U=;
	h=Date:From:To:CC:Subject:References:In-Reply-To;
	b=e/08dDTiPvj0uuXMJyebICcjJNrvFM+FIhQ7lZXonmzfLcX2QfbRJv9K5cTp1u9j4
	 guzNLcd8qY3unNf+Bxui79N8u8KYFngdwGksgNA0V+FmVSyeSbcGQv1CrhXpRwXXNC
	 s9AAYXxcPBbwqVN+mK2gxq1FytXht3dRR5Ty+Snw=
Date: Wed, 21 Aug 2024 11:08:59 +0530
From: Amneesh Singh <a-singh21@ti.com>
To: Anthony PERARD <anthony.perard@vates.tech>
CC: <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v2] tools/helpers/init-dom0less: fix vcpu availability
Message-ID: <y46y7zqfepuvbw3tniqkr5yepcqbvkbyj6mfj3tj4p3ylo7pg3@23plq2f3jboj>
References: <20240820080416.323725-1-a-singh21@ti.com>
 <ZsTDJhcfFpm23oHO@l14>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <ZsTDJhcfFpm23oHO@l14>
X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180

On 16:24-20240820, Anthony PERARD wrote:
> On Tue, Aug 20, 2024 at 01:34:17PM +0530, Amneesh Singh wrote:
> > diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c
> > index fee9345..722a5af 100644
> > --- a/tools/helpers/init-dom0less.c
> > +++ b/tools/helpers/init-dom0less.c
> > @@ -167,15 +167,20 @@ retry_transaction:
> >      /* /domain */
> >      if (!do_xs_write_dom(xsh, t, domid, "vm", vm_val_str)) goto err;
> >      if (!do_xs_write_dom(xsh, t, domid, "name", dom_name_str)) goto err;
> > -    if (!do_xs_write_dom(xsh, t, domid, "cpu", "")) goto err;
> 
> You should probably keep this node even if "*/availability" isn't going
> to be written. It might be useful for watching everything under the
> "cpu" node. (libxl create this node independently from all the other
> "availability" sub-nodes.)
Gotcha, didn't know that. Guess that can be kept the way it was then.
Thanks for pointing it out.
> 
> > @@ -330,14 +336,24 @@ int main(int argc, char **argv)
> >
> >      for (i = 0; i < nb_vm; i++) {
> >          domid_t domid = info[i].domid;
> > +        libxl_vcpuinfo *vcpuinfo;
> > +        int nb_vcpu = 0, nr_cpus = 0;
> > +
> >
> >          /* Don't need to check for Dom0 */
> >          if (!domid)
> >              continue;
> >
> > +        vcpuinfo = libxl_list_vcpu(ctx, domid, &nb_vcpu, &nr_cpus);
> > +
> > +        if (!vcpuinfo) {
> > +          fprintf(stderr, "libxl_list_vcpu failed.\n");
> > +          nb_vcpu = 0;
> 
> Is there any value to keep going if libxl_list_vcpu() fails?
> Or is the reasoning is that cpu/*/availability was broken before, so
> it's not important enough to stop init-dom0less?
Yes, so missing cpu/*/availability nodes would mean we cannot
pin/remove/add vcpus using xenlight I believe. However, we can still
hotplug other stuff like net or block devices. In fact, I was doing
exactly this when cpu/*/availability was broken.
> 
> 
> Thanks,
> 
> --
> 
> Anthony Perard | Vates XCP-ng Developer
> 
> XCP-ng & Xen Orchestra - Vates solutions
> 
> web: https://urldefense.com/v3/__https://vates.tech__;!!G3vK!TgBV3TUl158hw6AKLTg3uYRP3PP-1Ku8uVFaT9lFV46NIVCn9kL-y82D2xz1j_iUwo58t8yr3hwYJBV9GAMS5zaFOSA$
> 

Regards
Amneesh


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 07:06:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 07:06:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780931.1190522 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgfPo-0007Kg-KK; Wed, 21 Aug 2024 07:05:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780931.1190522; Wed, 21 Aug 2024 07:05:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgfPo-0007KZ-GS; Wed, 21 Aug 2024 07:05:56 +0000
Received: by outflank-mailman (input) for mailman id 780931;
 Wed, 21 Aug 2024 07:05:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgfPm-0007KP-O4; Wed, 21 Aug 2024 07:05:54 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgfPm-00021y-9N; Wed, 21 Aug 2024 07:05:54 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgfPl-0003vt-MI; Wed, 21 Aug 2024 07:05:53 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sgfPl-0003mG-Kx; Wed, 21 Aug 2024 07:05:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=eQWHJ+oe2EdGG+MYYO46/svxMcHkl6tfcapDmDnfAFA=; b=wWJvQjEtl+ABxrMtRRBQYeMDZK
	cTACIokS3Bqvqxb1UmmzX7JbFwrGmf0awX4ZOv2pI5e7f+MoH7RY81mLfat6yRaD59B9pNIQxQDuh
	3uq6YYD5ZLKX8uP7sQnzNnMzdcapHq2MKP8cCHtelTW28qtU0yPTkZ2uuPjdgTtr5qrc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187295-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187295: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-libvirt-vhd:leak-check/check:fail:regression
    qemu-mainline:test-amd64-amd64-dom0pvh-xl-amd:guest-start/debian.repeat:fail:heisenbug
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=075fd020afe3150a0e6c4b049705b358b597b65a
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 21 Aug 2024 07:05:53 +0000

flight 187295 qemu-mainline real [real]
flight 187299 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187295/
http://logs.test-lab.xenproject.org/osstest/logs/187299/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707
 test-amd64-amd64-libvirt-vhd 22 leak-check/check         fail REGR. vs. 182707

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-dom0pvh-xl-amd 22 guest-start/debian.repeat fail pass in 187299-retest

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass

version targeted for testing:
 qemuu                075fd020afe3150a0e6c4b049705b358b597b65a
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  349 days
Failing since        182723  2023-09-07 18:19:05 Z  348 days   26 attempts
Testing same since   187295  2024-08-20 16:09:24 Z    0 days    1 attempts

------------------------------------------------------------
620 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 180391 lines long.)


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 09:27:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 09:27:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780961.1190532 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sghcP-0004Rt-BS; Wed, 21 Aug 2024 09:27:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780961.1190532; Wed, 21 Aug 2024 09:27:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sghcP-0004Rm-8Y; Wed, 21 Aug 2024 09:27:05 +0000
Received: by outflank-mailman (input) for mailman id 780961;
 Wed, 21 Aug 2024 09:27: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=YIGS=PU=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sghcN-0004Rc-Cd
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 09:27:03 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 842268d5-5f9f-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 11:27:02 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a8682bb5e79so2383466b.2
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 02:26:59 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8670256538sm74934366b.44.2024.08.21.02.26.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 02:26:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 842268d5-5f9f-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724232419; x=1724837219; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=oEHCrGZclODO9MC+FlfThVZNIvh9p/VZbrL1qNJE3Tw=;
        b=fQeRWWhxPLCa0GKUfG7deDTdRf+vlTLQN8R0XITTRiVaGYOIUBPT3AQN2y0PnTlNvr
         oCplG8I93h4geOyKcSZQ0/RfR5M7IKUDwi7+adzD07Q4LQIL8LhocmDzpN5ROTUsqBd3
         DlEbxpN/9BvhQoKNmzf86JEYuIqua2Ky9RB1j3kv9Dxe5SEMbhKkyJmz+xrLSOgjXIg+
         LVBOpO8ucXQM7lMElosZMir1/9eipGzVsZVcsXWNAP23A7RJeiYAS1h6oNeaCLHrgiFF
         9T+DMhWuGFZssU67eMTSUPyCGgBWaHsh/rjiJXu9NDQKrst39pxXRUqF9ikmr9R6pQ3D
         njhw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724232419; x=1724837219;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=oEHCrGZclODO9MC+FlfThVZNIvh9p/VZbrL1qNJE3Tw=;
        b=kARsNLGZ/Q8cKHwld26hf+Ua8D+G8rKg4Uwtn4SiZ58G7CMPmSkhfkcSeCVjjUlORJ
         NamSP3LnzdLRfpAA0PWw2pxhtQacAJyo02f3uOe2Z9auwrOPbQ3R8vzYplqdd8ZUBcUR
         DIORJDGmbXb6jaFiSESN5utcSLtC1CW8zbeHGVayV5QOfY/wZABOmAIpGvayKlVuMbc8
         9p2iJ5ntGnzcZT61nlp+EIEKMWcKTtOpBg4RH0egJ9QVXaLDwbTcNBY2UQCPfWFa2AIU
         PnHzTdxsTKFkVa4VJwHvLaIWI3FBdfUq+YNKypJEioOi5hUP3SnfUDmWCRzeFxLj/8Bb
         BUTA==
X-Gm-Message-State: AOJu0YzdpTJlStJ5HEhG66CXJGZzM6/WVLNMCoSyPoWpqML5b45Zpdnl
	fIiiu5YyYViwiCTIAEesDfObKJRRYMpNqbfRQ+hWYhLmyUu70Lrvgt6l3vtikM6a97Gr3lE70Mg
	=
X-Google-Smtp-Source: AGHT+IFsR3fFx1MpwrXb7A7Nlk/nMR872tSlebt+MJFlag+LGwJpVz4gD3O0kGSLgq/77QBZifGmvA==
X-Received: by 2002:a17:907:3f95:b0:a77:e55a:9e87 with SMTP id a640c23a62f3a-a866f8ed42amr99884566b.48.1724232418780;
        Wed, 21 Aug 2024 02:26:58 -0700 (PDT)
Message-ID: <49bcdcf1-4d9c-4126-83a8-9a7d3a7bc49f@suse.com>
Date: Wed, 21 Aug 2024 11:26:57 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86emul: always set operand size for AVX-VNNI-INT8 insns
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Unlike for AVX-VNNI-INT16 I missed to notice that op_bytes may still be
zero when reaching the respective case block: With the ext0f38_table[]
entries having simd_packed_int, the defaulting at the bottom of
x86emul_decode() won't set the field to non-zero for F3- or F2-prefixed
insns.

Fixes: 842acaa743a5 ("x86emul: support AVX-VNNI-INT8")
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -6075,6 +6075,7 @@ x86_emulate(
     case X86EMUL_OPC_VEX_F2(0x0f38, 0x51): /* vpdpbssds [xy]mm/mem,[xy]mm,[xy]mm */
         host_and_vcpu_must_have(avx_vnni_int8);
         generate_exception_if(vex.w, X86_EXC_UD);
+        op_bytes = 16 << vex.l;
         goto simd_0f_ymm;
 
     case X86EMUL_OPC_VEX_66(0x0f38, 0x50): /* vpdpbusd [xy]mm/mem,[xy]mm,[xy]mm */


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 09:28:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 09:28:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780965.1190542 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sghdO-0004vV-M5; Wed, 21 Aug 2024 09:28:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780965.1190542; Wed, 21 Aug 2024 09:28:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sghdO-0004vM-Hx; Wed, 21 Aug 2024 09:28:06 +0000
Received: by outflank-mailman (input) for mailman id 780965;
 Wed, 21 Aug 2024 09:28:06 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=YIGS=PU=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sghdO-0004r2-5U
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 09:28:06 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id aae88cca-5f9f-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 11:28:04 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5bed83489c3so5258556a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 02:28:04 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bebc081c59sm7941809a12.85.2024.08.21.02.28.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 02:28:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aae88cca-5f9f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724232484; x=1724837284; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=v9eXvc0/XNFWbfD1Y0YUXBJmDdyD8fskrF6ICMthJKc=;
        b=BjIzNdl1kpCOigeNDX1K3+Ky6Fz8OR9iSd6HQp+tz4Ru/QwSQMQKbivwl8DYkFg2zH
         2m0S3wVjKcKWyfbeHr4l7E4paNGiAlQL4WshVf4m1dtyTdGSLUUW+Jx/1RaIh3z0p1vb
         cn2I2KIbyFUmIco6UlbDOWIsv6PHvTqI3L/N3DTaXBmiof5fnemKimxYpkL1jseKqw/p
         NGtl45RRsjAgaeYzJYluOOf5bT4a5NqGTMnNVJDxD93i5UZjb9/TCLGS8kDni90VlWn0
         Bwkf2Xbej6c73ptdvT+4d+LhRgFGrf/A54y+P0TJn/0HwU32uPWq3t3TmtZAbl26QE3v
         E8rw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724232484; x=1724837284;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=v9eXvc0/XNFWbfD1Y0YUXBJmDdyD8fskrF6ICMthJKc=;
        b=GRsCa4nfowEuy1mcWHC3tYEvaGCHXG0Jq21H0Vv7G4+QXrEMdUhCKPmXG6reSJDi4i
         +ZbPwrhEgoeOwl5PpfDykMVcYibNWa13U94Lee1S6c/ycTred62YNuYXMX0mX+va+p84
         BphiKFhTJVHN02OlOBLBBfA3Y2KfK35fFkKKsRyLpoKphnupLRY6V2NGtPCygouu7nJ9
         ydP9xDe9lKJQymYUZydeIhTTImodmYdCY8nyglwqBciTDkMeYvlX6Dat+bKnb+oIj5zY
         FEPVkzUN94JXBnrcNK9HFKM8zQPYt/DCqNc9ZXeKAndK4oyOo21+p+Togl1zy6iznb9y
         b3mg==
X-Gm-Message-State: AOJu0YxrSdCfdkbn8dhH0Grp9wGR0Ti8cS3aMLymNUuKtu3t0FEBAnGn
	WSUomYqDaGV9HGoqawerYtvsshDDqiZeEDeXR6FI2gdTfTQs5V+5ONj6FGx/Xjz8Cbb0Lxl4t1s
	=
X-Google-Smtp-Source: AGHT+IF915yDoTsaLhJfnahFcvuuoFHZLCoielCK5GVeFeQwUI+Duiz/8cUbtj0koGBD3Mu/4Q4S2g==
X-Received: by 2002:a05:6402:1ec3:b0:59e:a1a6:134d with SMTP id 4fb4d7f45d1cf-5bf1f25d267mr1182909a12.32.1724232483833;
        Wed, 21 Aug 2024 02:28:03 -0700 (PDT)
Message-ID: <fb917afb-62d1-42f0-83e6-276cae67569d@suse.com>
Date: Wed, 21 Aug 2024 11:28:02 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86emul: set (fake) operand size for AVX512CD broadcast insns
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Back at the time I failed to pay attention to op_bytes still being zero
when reaching the respective case block: With the ext0f38_table[]
entries having simd_packed_int, the defaulting at the bottom of
x86emul_decode() won't set the field to non-zero for F3-prefixed insns.

Fixes: 37ccca740c26 ("x86emul: support AVX512CD insns")
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -5929,6 +5929,7 @@ x86_emulate(
                                evex.w == ((b >> 4) & 1)),
                               X86_EXC_UD);
         d |= TwoOp;
+        op_bytes = 1; /* fake */
         /* fall through */
     case X86EMUL_OPC_EVEX_66(0x0f38, 0xc4): /* vpconflict{d,q} [xyz]mm/mem,[xyz]mm{k} */
         fault_suppression = false;


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 09:29:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 09:29:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780973.1190551 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sghep-0005W3-W0; Wed, 21 Aug 2024 09:29:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780973.1190551; Wed, 21 Aug 2024 09:29:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sghep-0005Vw-TV; Wed, 21 Aug 2024 09:29:35 +0000
Received: by outflank-mailman (input) for mailman id 780973;
 Wed, 21 Aug 2024 09:29:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8p22=PU=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sgheo-0005Vm-K6
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 09:29:34 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e024d9c7-5f9f-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 11:29:33 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a83597ce5beso95083366b.1
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 02:29:33 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8383947187sm870394066b.166.2024.08.21.02.29.31
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 02:29:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e024d9c7-5f9f-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724232573; x=1724837373; 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=qI8XOYz2FQ129hGvuKsbyCpwtMgnCyr9lnMU1jdxXjc=;
        b=qu4Nc99hqLI4cTEn9n1Nh3UqLWKEMAde4D6cgDAGjs2ONbMUGPKLRaAGrlAKYHPCRs
         xPwitRUOCQdhN4p6vWdWXpmCwEB15bUuMC1Ljo42ph5/5yMktgmcAArFtL4exFOm6vVq
         WNkLsriqSuaTd9727c56K1jx9EAkJ0j56Ofr4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724232573; x=1724837373;
        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=qI8XOYz2FQ129hGvuKsbyCpwtMgnCyr9lnMU1jdxXjc=;
        b=QqcpFGKNvdsck7wWbdLMyD8wIpz4mR1wXwbEOmclX0Oz5kPhHou72LxLkTnOb5iwyU
         1uawQMK8zt9/EnJZnlt0r0meH2nHe8ErxZmLrDgR++7P71LO9B4mTY6LRv7or/bp7sFN
         7gogGxsx8gmYegIuQugTvDbdPOG70G+j20wW4ANfkG7zoIZTQAxx3M0OA1m/hczsvo1m
         y7aZfwwDI3Qhg18hfhGjW9HmvqhrezXUFORTNkY8lGmjxE4rCNnEANCDxzo9I0lvuinI
         ZWjlGL1Ty1J67VggLBi7aEO2KhfzstzaXPYR6Vu5tMDGP81AeO2vp1Hc44q1uQZr+XWT
         IfMg==
X-Forwarded-Encrypted: i=1; AJvYcCVnd38rJFuZfKJdv18S8TjCO9pk1ESJoRWaqvTkx4rei5Nr5jhF1l5tkUMrvFXk/qIVh+7O3+YqLsk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzVSw/6vaAAD39kBAG2qT2qS2FyACvSz+g8ZxqUWB/bjXQkO3xT
	H9EWQL6uBH+2OCnm+zWn/RCtJZ7GJWCaQHk7G0MJQwZ7c8mO7A18uU64Y6275Mg=
X-Google-Smtp-Source: AGHT+IFniZye1U+eDPJJGhv0wvJ81727CE6jHedAuq2e02qT+5zmzqxRiz3kx9v60htsdCpYAJjAvQ==
X-Received: by 2002:a17:907:96aa:b0:a77:dbf9:118f with SMTP id a640c23a62f3a-a866ff68e96mr141185966b.13.1724232572529;
        Wed, 21 Aug 2024 02:29:32 -0700 (PDT)
Message-ID: <9e57bbd4-e795-40dd-a049-07b6cb32addb@citrix.com>
Date: Wed, 21 Aug 2024 10:29:29 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: always set operand size for AVX-VNNI-INT8 insns
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <49bcdcf1-4d9c-4126-83a8-9a7d3a7bc49f@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <49bcdcf1-4d9c-4126-83a8-9a7d3a7bc49f@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 21/08/2024 10:26 am, Jan Beulich wrote:
> Unlike for AVX-VNNI-INT16 I missed to notice that op_bytes may still be

Minor grammar note.  It's either "I missed that", or "I failed to notice
that".

> zero when reaching the respective case block: With the ext0f38_table[]
> entries having simd_packed_int, the defaulting at the bottom of
> x86emul_decode() won't set the field to non-zero for F3- or F2-prefixed
> insns.
>
> Fixes: 842acaa743a5 ("x86emul: support AVX-VNNI-INT8")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 09:32:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 09:32:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780981.1190562 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sghhW-0006yY-Ce; Wed, 21 Aug 2024 09:32:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780981.1190562; Wed, 21 Aug 2024 09:32:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sghhW-0006yR-9x; Wed, 21 Aug 2024 09:32:22 +0000
Received: by outflank-mailman (input) for mailman id 780981;
 Wed, 21 Aug 2024 09:32:20 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sghhU-0006yF-Ly; Wed, 21 Aug 2024 09:32:20 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sghhU-0005Mx-Gc; Wed, 21 Aug 2024 09:32:20 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sghhT-0001Te-W0; Wed, 21 Aug 2024 09:32:20 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sghhT-0002fC-VV; Wed, 21 Aug 2024 09:32:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ofhhuyvo06QeqXdHloD4abs/NvAOuL7ryJD2Y4D6FIo=; b=PFKP1DfwrF3CD1S871u4H2KGUU
	WHcIbu70PkdtXZdSfUllDq8/Q+IccpR9p13TYrZWE2niPiCOYeoBBbrtPFGnQZJ2kOnb9MAYovgCe
	BzPxlbPGpO0KBJiISrGlVH6HxEP5iPy0ZDQJ6Kh5lOOHqAMiZNv13VaJkBQNV/OH09so=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187296-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187296: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=521b1e7f4cf0b05a47995b103596978224b380a8
X-Osstest-Versions-That:
    linux=6e4436539ae182dc86d57d13849862bcafaa4709
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 21 Aug 2024 09:32:19 +0000

flight 187296 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187296/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187292
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187292
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187292
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187292
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187292
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187292
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                521b1e7f4cf0b05a47995b103596978224b380a8
baseline version:
 linux                6e4436539ae182dc86d57d13849862bcafaa4709

Last test of basis   187292  2024-08-20 07:48:50 Z    1 days
Testing same since   187296  2024-08-20 21:44:18 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alison Schofield <alison.schofield@intel.com>
  Dave Jiang <dave.jiang@intel.com>
  Ira Weiny <ira.weiny@intel.com>
  Li Ming <ming4.li@intel.com>
  Linus Torvalds <torvalds@linux-foundation.org>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   6e4436539ae18..521b1e7f4cf0b  521b1e7f4cf0b05a47995b103596978224b380a8 -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 10:05:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 10:05:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.780946.1190571 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgiD9-0004HU-TO; Wed, 21 Aug 2024 10:05:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 780946.1190571; Wed, 21 Aug 2024 10:05:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgiD9-0004HN-Qq; Wed, 21 Aug 2024 10:05:03 +0000
Received: by outflank-mailman (input) for mailman id 780946;
 Wed, 21 Aug 2024 07:48: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=SFbP=PU=vivo.com=chenyufan@srs-se1.protection.inumbo.net>)
 id 1sgg5K-0005rX-Hr
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 07:48:50 +0000
Received: from APC01-PSA-obe.outbound.protection.outlook.com
 (mail-psaapc01on2061d.outbound.protection.outlook.com
 [2a01:111:f400:feae::61d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cca7e9ea-5f91-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 09:48:48 +0200 (CEST)
Received: from KL1PR0601MB5487.apcprd06.prod.outlook.com
 (2603:1096:820:bf::14) by SEZPR06MB7176.apcprd06.prod.outlook.com
 (2603:1096:101:225::9) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.17; Wed, 21 Aug
 2024 07:48:38 +0000
Received: from KL1PR0601MB5487.apcprd06.prod.outlook.com
 ([fe80::2129:59e5:6c67:311f]) by KL1PR0601MB5487.apcprd06.prod.outlook.com
 ([fe80::2129:59e5:6c67:311f%7]) with mapi id 15.20.7875.019; Wed, 21 Aug 2024
 07:48:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cca7e9ea-5f91-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=FqTpJqpoRBo8Sy9lvE29rxdIKvKYfQ4WcIlURPCC5B0NtAi/CmDdPK3/rUTo3QOSmq5cUgQUmKp5RWIPtZNF0153c8riJDueCm0f7ND3K8YgihsIZGpJxty4BblBwQFo4qtO81/DSx8UvmNr5i6JQ50lUy+vxXzEWPTTospcMPllmWHjon6/dpRZs5v3GETqHCdhDE+FQdl7Gtqk9ZB3/lKloQL1IDkIBx+gM14hYKaFSefwVdBWAwIyKQgAveYEPEILYZqG4apPeEHwyjWtQO7NSlw2zVlyGLE+GfQ4btpeErWJtEcrAUJiKZqicVCTUqLjHsmROAHkKsRWMgY+vw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Xcv46LbAtMXtLrGfMa4QG6Sf4EvGlsOq7eLg4KJy4mA=;
 b=vAsONj3Zv1bQdTWE0++ZhyFctp7Sfl+wZI5T8JD1GZYGokf2+x+2OrV6BFXV1qSqyi2TwFN6HANdfgvMRMV2GwIP9CjCDRFQn1o1NGbcp6u1j5frEjJwhWdoXYpTP1HLg4LFbQsN/qd+USiIsmm555WAp8h5HQpmTpth3z2dDv3UWofQFyfv4PwWLbtKuhlL+C7LU6jAdDDoAGS1TeUonYWuTWC9MilofA0hDydCM+msoD2PcZTGMcm2lFxjjHp7ywLSaP6AZmOgSskzJRq0batu0cd9aaTdjrhKw/r04UymGueP9TEVe4NLeKVxQWx5A+D4nSXces482mah5rTeyg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com;
 dkim=pass header.d=vivo.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Xcv46LbAtMXtLrGfMa4QG6Sf4EvGlsOq7eLg4KJy4mA=;
 b=g3jnixOUEE/56zoSbDGlh+o3ptYtW9GfYJVxi/YJaCMlAdDRjyrT4lAPbLHMj5z6OwD4iZVdovsj+llL9NpOTRbxcvid5Q6ptCbRDAj5Wzw/cVyPAY518CYEjjrzWBBR1dH6sPESxU4By5IlWin0BUpzUlkCvluwrZq+Cg/3VjrxKAdqwl0nG22u/LgzVFAxZ7J3aWuNA8geVLoKLyP7md9DYclnZbywnvpqH92l/kOwLq8D5w6snU4n6qhIaDBh7Zr1nDZF/THbNAh/0B1KdyqyCfT94hJI4pWuSA3vk4JigL4KBJjasudqHI/i3YuqNdAcTkZTIP0f9Rf9dpuHTQ==
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=vivo.com;
From: Chen Yufan <chenyufan@vivo.com>
To: =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Jens Axboe <axboe@kernel.dk>,
	xen-devel@lists.xenproject.org,
	linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com,
	Chen Yufan <chenyufan@vivo.com>
Subject: [PATCH v1] xen/blkback: Convert to use time_after_eq macro
Date: Wed, 21 Aug 2024 15:47:29 +0800
Message-Id: <20240821074730.13411-1-chenyufan@vivo.com>
X-Mailer: git-send-email 2.39.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-ClientProxiedBy: TYCP286CA0344.JPNP286.PROD.OUTLOOK.COM
 (2603:1096:400:38e::16) To KL1PR0601MB5487.apcprd06.prod.outlook.com
 (2603:1096:820:bf::14)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: KL1PR0601MB5487:EE_|SEZPR06MB7176:EE_
X-MS-Office365-Filtering-Correlation-Id: bdb7f01b-a6b4-40c6-3e5e-08dcc1b5aad7
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|366016|376014|52116014|38350700014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?BpYS8GyY/WYZ50dMpfB6yjrZr63j1c1SK2Ep4ExC8V8GsMp4InmP/XLKQ5sB?=
 =?us-ascii?Q?lqSVQFocNgABymcrrkSejnLHSqskNTsSoWCnMyKVnbUYNapBx0MJqA7dahcb?=
 =?us-ascii?Q?cFX3+Qvt2lO9MX4OW/QK6/Oc/pM5YYnbOyBfhgvG+5lFhJCHWVKaiFMSWtM9?=
 =?us-ascii?Q?tGs7FlXbDR9QsukmTl5WOrwC/VE0JpDckhFZFo7yo50tzuj9oQhK1Ci1/Pif?=
 =?us-ascii?Q?96EMptSNJPp7DutHN179p3ClHw152V7ByqhnBNGhQaqrsDiNy2+09MRjOtjq?=
 =?us-ascii?Q?OggGyrGBUWlP4FhjtCgTsr6q1HtW7oMiVU7KHYIBVAWOwQcwkXakc02wPhCd?=
 =?us-ascii?Q?8aSlr4gz22/+IXhDCoqEWvEQt+xJlzDsLpTLMDuL9wA8utV76BpmFfy8wo7q?=
 =?us-ascii?Q?Z9Z43c/FnTPdcBb17UTk6v0HfhjlzRFckjPE9TaZ1O3ixqMdN5Jv7LRGH7af?=
 =?us-ascii?Q?ASXcfMmoy8NJ50H9zhdur6G6r2AhKTqoa8rR1AdYvg02tm3FQpY8qjyYyDtB?=
 =?us-ascii?Q?xBbBe1ZmKvHDd1I1SlfBuzG36TTGL9x2KZZrKmVv7qQ3yqUQai61kGZHqEvS?=
 =?us-ascii?Q?El5vVYnEpYI+vQH0H+OxBwwXsVHl2PCaF/hv8OjD1EOlEfPy37awJQp8ZBsj?=
 =?us-ascii?Q?uKAVaNs/3qLf5aZRfkblRUVK1deYWNAbq+Mye3yslexdtVb1YTKiHPJabBYu?=
 =?us-ascii?Q?7X8Knx0QpK1lq+DNgwfn0nrVy5EUmUzNCSErEEShlfSHCYQumV2fTrqM/T6d?=
 =?us-ascii?Q?DTLzZNUDKhgfXjksubVEUhiSv4Y0xcvrDFHvCr3/Knxf7qI2Jwm7Rrynutea?=
 =?us-ascii?Q?nEo/GQgfGKfZCZdt3ulYwSo5ukTsXMdcCVf/wYvmDrtGl4z439fONNnAzxTc?=
 =?us-ascii?Q?RyCTDrkzEkNveSDklz5C1h4x/nRsaMmuQ6YjARKKGpROWwyJjUa7iZEha3uX?=
 =?us-ascii?Q?J3n6TB0TLVWrjUkMvic2bYPAz01s2QuVDGqWSdIMUCT4jUDh52uFHcp+A/ck?=
 =?us-ascii?Q?6taIwGfVuY8w2i6gsAscZr9R49MyuZPwo6uAy7/imDSzBg+HIckXMWNy3SAu?=
 =?us-ascii?Q?YYjwixNMh8CWjvVKvLuqavoQlG0Xn/xt6m6RxoHZAw8BSj3HM/6CR91VAHKL?=
 =?us-ascii?Q?qvSUWQE1DNkKIvpGqTXgMo+yjrlfcxXyjYesfxf6jCrqbjmQW4KtlMFsvPUU?=
 =?us-ascii?Q?PGRpu2SzQhLwDXrKrFlnTXh+CloeJ33mVTMA3YQ7DVIjbPr1yVlJMgREv87o?=
 =?us-ascii?Q?JLy8INhPsH3d+QPBJev6J/9XGBCG5zlqxk8BcsIzL2iwQB9GHwuJPNiKFT7O?=
 =?us-ascii?Q?5YMfS8dP+HdUV2J6mjRe7jktMCMlC651fkeQ31FgJbDrGSkdPJDDGFx+XkZR?=
 =?us-ascii?Q?qk2JrMGxhJ0i8mLEiokzns0x3u6W6n57JrOZ617hNjA/DhpGZQ=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:KL1PR0601MB5487.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?us-ascii?Q?jNmyPD49RtN4YBauS5oCl6OcSRRb6bWAqB2Jz3FmEE4S+a1on13WOrj4XgTT?=
 =?us-ascii?Q?9FanqsHUhvz/0ZEej08qI+rd8tLrMbC/BaeQYu+UmpFc2+/UCFjcxrtlMt2J?=
 =?us-ascii?Q?nPFDPFK6oX/sLkfi9MHtU3fVNMmJC0M8qrQ2JpbJdbpOALcbU6uEL5uTu2jO?=
 =?us-ascii?Q?Tbn+ue786bu7S+ZFM91IRX8a1d7H1ikYrvDo1Q5FBnjUUe6Zt+jA5ccdNhGm?=
 =?us-ascii?Q?REY3+D48IpNeg+a2srYSwAOT8JZ9HcX4fl5TjdcP4xvp5Vg1z8efxMXnjLBj?=
 =?us-ascii?Q?BCQSl7eDgbCuTPfk7AQSMCfngHa/7t34yzOepNMQeH4g8dGP94y2tUlaAvca?=
 =?us-ascii?Q?zICqpV0a4rT83N1fD5sH1wzzCfwMC8t2YGHfb/LLvkj1bT7rkG2GIP3J5fcK?=
 =?us-ascii?Q?iRo1pzYyi6FlPscCM7BaYO20gwbatYp+wLtdDOPRaCBXX6qsiHmdHf+3dHwe?=
 =?us-ascii?Q?KiA3GqVnTY1EE2+BRz5D9XFrwU4YPoGdKKd80Ty84HNZaozW7miQCNiaX2+E?=
 =?us-ascii?Q?lwVCbBQunn8lW2AUmLA/3W740JNDBRCiqqoSYZMPZU0VrnfoJ3iMmxaamHGR?=
 =?us-ascii?Q?W+biwLTmtdd+5ZDN8PzDQfb0ApXpjp6NVdD79z4DHYGAlhpQpxgTFMu5jjpT?=
 =?us-ascii?Q?dtgtWgt6cEkcw442Zou25QjWwdIE9PNJohP5RzFDK4hh5/PTN6yyCm1RF1FC?=
 =?us-ascii?Q?uI3lRZImIhJBaozeDu0VdK/kdJH5MvoYrpcgkE9OZu2kVo9mf3f2ZmRHLPb5?=
 =?us-ascii?Q?kWh/OuXg8CNj44sV/q+pVMoNs61H//6rvoRR9FPiWKMMZnC5t/Oie6gj2OTV?=
 =?us-ascii?Q?JLQwSHv7kXZgMRGNpQjPLhxBAFPbEsrziaP2hnOs7RxZMELCjEueRoWRPDXH?=
 =?us-ascii?Q?xKRekgbymMPGkZ0wj5uar/+XcBbyKFr2Tyz8UdTyunA580lYo8iLZV0YprFY?=
 =?us-ascii?Q?Vk3U+mTmfL/GNUh2G0b5JibdGpA6fm4+UvVoJnZFxgtXJ3OnUmALni2udmgb?=
 =?us-ascii?Q?/9IWaN5asKsipKElQrmc5iBDF542zZ3O4FSARuhEwP2VJOUg01Ral4a8WNFU?=
 =?us-ascii?Q?LWHecJgYYcJyI5IwpApUzIog/ue39TaXjKrwBuOoTqgq0hnvCVFEP+J1W/3L?=
 =?us-ascii?Q?IUOx4ihNY2r8uqnygozvVSw/OC6w/8OPCd1HFE5NEYkeplqYxZfjUDXlyRPi?=
 =?us-ascii?Q?RTtXiSZeA7OFABRACuCl+ERBfaxT77buS+ETvh9Oqe22+tZCkwI9NmIBoLWJ?=
 =?us-ascii?Q?jkawVQmbb0c5rzq00naz7ZHfTRt5Y1fxbQfzRV06B++FXGx9SVOYzWl1QH9b?=
 =?us-ascii?Q?DorDymolXmLO8iaIMotaq879XFikO+yb98DkEQBdCONkBoh0JPFnXHa169iv?=
 =?us-ascii?Q?Jzw9jZlanScFdraS5S6aIhf1QDjVrK5e2K1EcuKtm7qeMU2bUJT6RNEnhCHy?=
 =?us-ascii?Q?ZrBK5vv75+yo63RW0V0z17FcKuzF1wqQo253kDl0MgRZHxIVJYskhIr2OLj+?=
 =?us-ascii?Q?Kd4caEKSUELR2grjZIjw70bre1E/6STFSAjNzXk0LDubu+8+N11GFq9tyI2c?=
 =?us-ascii?Q?5Tlulq2VKGtCzp5n/ceTRlxTBmajVBf5rMb5hq4e?=
X-OriginatorOrg: vivo.com
X-MS-Exchange-CrossTenant-Network-Message-Id: bdb7f01b-a6b4-40c6-3e5e-08dcc1b5aad7
X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB5487.apcprd06.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 07:48:38.1441
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: lpBNEWl2af4bEn9VSCNY9JS1bbVy6s4Y+1Jc1HOXQmKanRsR+8zLObKb9r9eo6YWvL42tTsAWQ1pk2jCNvtBeQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR06MB7176

Use time_after_eq macro instead of opening it for readability.

Signed-off-by: Chen Yufan <chenyufan@vivo.com>
---
 drivers/block/xen-blkback/blkback.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c
index 838064593..f6da0b74d 100644
--- a/drivers/block/xen-blkback/blkback.c
+++ b/drivers/block/xen-blkback/blkback.c
@@ -42,6 +42,7 @@
 #include <linux/delay.h>
 #include <linux/freezer.h>
 #include <linux/bitmap.h>
+#include <linux/jiffies.h>
 
 #include <xen/events.h>
 #include <xen/page.h>
@@ -134,8 +135,8 @@ module_param(log_stats, int, 0644);
 
 static inline bool persistent_gnt_timeout(struct persistent_gnt *persistent_gnt)
 {
-	return pgrant_timeout && (jiffies - persistent_gnt->last_used >=
-			HZ * pgrant_timeout);
+	return pgrant_timeout && (time_after_eq(jiffies,
+			persistent_gnt->last_used + HZ * pgrant_timeout));
 }
 
 #define vaddr(page) ((unsigned long)pfn_to_kaddr(page_to_pfn(page)))
-- 
2.39.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 10:35:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 10:35:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781010.1190581 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgigh-0001Us-8S; Wed, 21 Aug 2024 10:35:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781010.1190581; Wed, 21 Aug 2024 10:35:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgigh-0001Ul-5s; Wed, 21 Aug 2024 10:35:35 +0000
Received: by outflank-mailman (input) for mailman id 781010;
 Wed, 21 Aug 2024 10:35:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8p22=PU=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sgigf-0001Uf-Uy
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 10:35:33 +0000
Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com
 [2a00:1450:4864:20::42a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 18041387-5fa9-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 12:35:33 +0200 (CEST)
Received: by mail-wr1-x42a.google.com with SMTP id
 ffacd0b85a97d-3718eaf4046so4275238f8f.3
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 03:35:33 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8671b50985sm80605566b.194.2024.08.21.03.35.31
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 03:35:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 18041387-5fa9-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724236532; x=1724841332; 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=R8ueUpwykVpjbsoDnOyuTllZ6mVH5apAySURKPlrbqI=;
        b=vy/LYMhF2BXRd79Pe5dc3hGs86cOLDuD12PHPwmu4HMg55Or8u9N3DfGQWnj7ZgMlY
         XO+4yqqADZzBuijp9Bfs2nXhgeYPmskZaEViEh9/rFcihwm43qh3hqAohrlZX2cCp6Tj
         ut4dUUyIXMwwN/v/4zlQ3Gs7g/P+cBQ1H9Rmw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724236532; x=1724841332;
        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=R8ueUpwykVpjbsoDnOyuTllZ6mVH5apAySURKPlrbqI=;
        b=aNgAdTYsnhq773CZXBgKpCFj4NQaj+BUdm8nmQkB1qHbu2srblfVSH38p21ztq0JPn
         GX4ZveXmzQvar7eASG21EnJnrUWHrLNqVY5iIoqqVofEOzM5qF0R1DSvMMMimEOP4E7y
         EqglxTEMLC7VPHxbZoFY6I7uujn+lZ/nk7Rmjuxme6gcgVTVmaJRndoqjW5oCGszyWSA
         J5IPZyXu6hB0e+I/SnDVAlCK3sno8x46g0W9iGRMjDIQ49r35YEFTiqoijbgLUlo5FNK
         HpTe0nuzRm1X6B/qny54I+matoaHYKaVJlBsG53Qoqn3azsnfFs6+24J5nXFiG5ac8Wz
         tYpQ==
X-Forwarded-Encrypted: i=1; AJvYcCUshhIFh3dI/6pqls9TS92YvvWtwUEnIxl0u1mSmcdNqzrYMDfJ50v5Nh2bSfX56V7SWmOqC7nAEIU=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx0wFTW+MWTUB6Sa/TL9dPmqLmo3768aqQbRWzZ+ZvRuv9JwNyS
	4BeA2xt5An6tOFr6w/hTO5rDgozGkPtGVVuM75e0EUw8sY5igopMuoLq3fMu2eM=
X-Google-Smtp-Source: AGHT+IHeYpOpdpsAaRN1VrR7k8pN5Yj+sKmJ1Xzd+Kgalqm8T3Rqnu1iQcUBIyWNHz55cZ++JaoXJg==
X-Received: by 2002:a5d:64c7:0:b0:368:6596:edba with SMTP id ffacd0b85a97d-372fd720f56mr1692395f8f.39.1724236532004;
        Wed, 21 Aug 2024 03:35:32 -0700 (PDT)
Message-ID: <487bf692-ebd8-41ce-96b0-d4034bdfcef9@citrix.com>
Date: Wed, 21 Aug 2024 11:35:30 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: set (fake) operand size for AVX512CD broadcast
 insns
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <fb917afb-62d1-42f0-83e6-276cae67569d@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <fb917afb-62d1-42f0-83e6-276cae67569d@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 21/08/2024 10:28 am, Jan Beulich wrote:
> Back at the time I failed to pay attention to op_bytes still being zero
> when reaching the respective case block: With the ext0f38_table[]
> entries having simd_packed_int, the defaulting at the bottom of
> x86emul_decode() won't set the field to non-zero for F3-prefixed insns.
>
> Fixes: 37ccca740c26 ("x86emul: support AVX512CD insns")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

This is the second such patch.  Does that mean there should be an
assertion somewhere?

~Andrew

>
> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> @@ -5929,6 +5929,7 @@ x86_emulate(
>                                 evex.w == ((b >> 4) & 1)),
>                                X86_EXC_UD);
>          d |= TwoOp;
> +        op_bytes = 1; /* fake */
>          /* fall through */
>      case X86EMUL_OPC_EVEX_66(0x0f38, 0xc4): /* vpconflict{d,q} [xyz]mm/mem,[xyz]mm{k} */
>          fault_suppression = false;



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 10:49:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 10:49:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781020.1190592 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgito-0004Jc-Dt; Wed, 21 Aug 2024 10:49:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781020.1190592; Wed, 21 Aug 2024 10:49:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgito-0004JV-9t; Wed, 21 Aug 2024 10:49:08 +0000
Received: by outflank-mailman (input) for mailman id 781020;
 Wed, 21 Aug 2024 10:49: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=YIGS=PU=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgitn-0004JP-Jo
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 10:49:07 +0000
Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com
 [2a00:1450:4864:20::42d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fce89cb3-5faa-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 12:49:06 +0200 (CEST)
Received: by mail-wr1-x42d.google.com with SMTP id
 ffacd0b85a97d-36d2a601c31so3775946f8f.0
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 03:49:06 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a83838c6639sm879469366b.7.2024.08.21.03.49.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 03:49:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fce89cb3-5faa-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724237346; x=1724842146; 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=kFo3kgOHIZaKxlPsuAiXF8iQEX4Mppv0LsyhGCyFelA=;
        b=fkwviruJdaM+WosTkJ9+FrWlhQlnCtNf81n76MjBuKGI4myC7X1sYiGLGgrMJ4AIgf
         aregrEXmulTPyL2e0molkg80DNa6RPR2OpAT33INh0PiOowRaJCW4by8xUazIgkT66Kh
         Qja+q9QMA3r3ZB4sMcMIkIB9DBg9c1UBDGt3LV2QVug8MMInqQLzwc9fXAFQGtL0OJfQ
         OmCGh6sH1X6T5UBolYAJVAX5OB2UTTPdSJAHRomJx6+MRY631y8HpH+SfxunecAuS9Pd
         HVc/ObQnmzvCy1nNecX9WaUB04DhS8OOeGnMDm7SOWFNO4F69R6wyKTYlplRrvc/xHBc
         aGxQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724237346; x=1724842146;
        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=kFo3kgOHIZaKxlPsuAiXF8iQEX4Mppv0LsyhGCyFelA=;
        b=FKHwYAbOl4hb3KiZK+3ZyRWNwDZlgYhp68ejYYMVCRgPnwgnZ9rWpGz/GSylRR/IJf
         skwCntQIIc+vttkLjwL0zM1Ft6BuOFE8Vgp4vJ9pOepCY7Qjocv9zYti+YoMvd7iMSqt
         9G679ZpT4iZ0dDNPvyEBYHtHVkhaCJUmsL2klPQNh8NOun+Usqh5OWflbpffDnE7cULr
         hRn3BQRSopmW5d7i3yks0m9cDr3Z4VEbT2Mlm/BLDWyPwPuNRjkUCVcSEKVtAmchnoxl
         Db6RVLgXW72+3hg2EJ2B4xr6NTuUb+vxtv3sAOGFH7THIA7oyd2ltbrQzrSvUM5Oni0R
         AB/Q==
X-Forwarded-Encrypted: i=1; AJvYcCUyGARwhZqk3ikZWQ4Y7QkWAHqcfywCjB0APhSIpwKADL3EbSyhbHQDO+jXYEK366NcSGQUFVO4NuE=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx1m1084Cf4NpFkNix6/TqCjPjyZ7mW74vLHg/HA8uLeeduekRS
	8M7oXXdyhf31dyrAWwuhB9QVdNb6MMGIm+mjsteFE9UTkqvByaRe2ZOG+CY3pg==
X-Google-Smtp-Source: AGHT+IHrGVFgWKgxpkzOfs7aytxZ0igOIfroS4ImOEp9hGCya4BiutW3tV4HuvJR6IP8BOZq5rgNHA==
X-Received: by 2002:a05:6000:1fa9:b0:371:8319:4dbd with SMTP id ffacd0b85a97d-372fd6d6dfbmr1459893f8f.17.1724237345790;
        Wed, 21 Aug 2024 03:49:05 -0700 (PDT)
Message-ID: <f6e6c550-7f8a-4c00-b6a9-c6362df1f1a2@suse.com>
Date: Wed, 21 Aug 2024 12:49:04 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: set (fake) operand size for AVX512CD broadcast
 insns
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <fb917afb-62d1-42f0-83e6-276cae67569d@suse.com>
 <487bf692-ebd8-41ce-96b0-d4034bdfcef9@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <487bf692-ebd8-41ce-96b0-d4034bdfcef9@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 21.08.2024 12:35, Andrew Cooper wrote:
> On 21/08/2024 10:28 am, Jan Beulich wrote:
>> Back at the time I failed to pay attention to op_bytes still being zero
>> when reaching the respective case block: With the ext0f38_table[]
>> entries having simd_packed_int, the defaulting at the bottom of
>> x86emul_decode() won't set the field to non-zero for F3-prefixed insns.
>>
>> Fixes: 37ccca740c26 ("x86emul: support AVX512CD insns")
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> This is the second such patch.

Indeed. The first one was a result of me doing some AVX10.2 work,
covering new similar insn forms. That finding then prompted me to do
an audit, resulting in this 2nd finding.

>  Does that mean there should be an assertion somewhere?

Not an assertion, as there actually is a check already:

    else if ( state->simd_size != simd_none )
    {
        generate_exception_if(!op_bytes, X86_EXC_UD);

That check is what is causing emulation to fail when op_bytes isn't set
ahead of trying to invoke a SIMD insn via the shared logic near the end
of the function. I don't think it needs to be any stronger than that.
The reason this wasn't noticed so far is merely because no testing we
have in place ever exercises these insns. Which is a shortcoming, yes,
but one that's not very easy to overcome (as in: if we wanted to, that
would likely mean writing quite a bit of new testing code, to cover
everything that isn't covered right now).

For insns not accessing memory the value actually isn't needed / used.
An alternative might therefore be to move that check into the OP_MEM
conditional, and drop the fake setting of op_bytes (there are a few
more similar to the one being added here).

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 11:44:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 11:44:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781046.1190605 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgjkv-0005Tj-7T; Wed, 21 Aug 2024 11:44:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781046.1190605; Wed, 21 Aug 2024 11:44:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgjkv-0005Tc-4n; Wed, 21 Aug 2024 11:44:01 +0000
Received: by outflank-mailman (input) for mailman id 781046;
 Wed, 21 Aug 2024 11:44:00 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=YIGS=PU=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgjku-0005TW-0J
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 11:44:00 +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 a75650e7-5fb2-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 13:43:59 +0200 (CEST)
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-a83597ce5beso114338766b.1
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 04:43:58 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a838393566fsm887057866b.104.2024.08.21.04.43.57
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 04:43:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a75650e7-5fb2-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724240638; x=1724845438; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=QgUWQjFGUNrqI7VSgtR4zhXDB9+XFVK1hS1OdIdfsO0=;
        b=OJWI/cb6jCGpvMUodFJ6iaM56ViVkOb+q+9AH/FmOtowv2BLqXX7KwSqFZ/4p8FdeF
         iFz5wjJKe7x5Ihvwlj/DIZYizldncjqqHy3NoDJ1rqqC6sTKddoJXHliPnQBbkoOx3Ar
         rYrZHiFNeuu2iA0mdr8+UHvfdiPO4EcDCyh6pQeBAKeQPY0xmFaLImRB4Qoy4+GaSDtq
         Qgd2zHaaT7C7oAIWjpOvDZ6K+pgUx9rOBvOlXKAzjxrlg84UmEq+OxKdPIfOgIrBDfg0
         Cx1vfwti/OT71bycxlAZXccoBEz31icEIvXaei7OoQOzVXSK8j2uvzgaY0RlVkFTEgYW
         0XPg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724240638; x=1724845438;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=QgUWQjFGUNrqI7VSgtR4zhXDB9+XFVK1hS1OdIdfsO0=;
        b=r1JGTU666hVvoJc07g09GrSA7fM3yzyT6khfKr2UuzzmY5QzYptKT0OO4Rvo0/Ru+9
         t+lPcr7AhE1nz/cZa4S++DBpS3OJdBkVPsnBlXYaMTU4xNaTjXcbTwGcUTOmStNRdt4j
         zfpTDeDESQ2yVjMKi34LYPd3J2JJ7H2XUle2+WKoTqVP2YsgvGS60YhnKjpIr6ndXS5L
         3Bu7vIdshcUxBwAxyuVUMInpgcPVfsDigPz1dOa9rVXkbNJE/tD5fLJqDg+C0hk9eGqz
         qy2M7ZVpK+cfcCuPjBiVk752wjBgEbk2u74C2sgJ2hLkr5jJIQ8ug2HqDRCXQ3K77PNI
         Z0mg==
X-Forwarded-Encrypted: i=1; AJvYcCVsFM6FBcHakA53oV8DNqHm4XX14IcxJykfTZNjEmXQ7dvY5Nzv7pZv9kqfgdRo+/k87PodU5BIAOU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzW7Upz4uVWUqB7dgQAVHtWIX25AKK1H2jn/Hif7nMzAgWmhmH0
	BZxIAgw+dinyV+wYwCSqQu3DJMKyMSR0Y9lGry+BoiR+ImidrNlKmi7hgHxAzjRP+cUppgr+FD4
	=
X-Google-Smtp-Source: AGHT+IFUhbpiYfehz0CLjzlZNSoS4GiyX3lm9mB+a0DOrX0q6RN0W6/sPKjMlQxoDcI9Fbj2/68+YQ==
X-Received: by 2002:a17:906:d550:b0:a80:f646:c9c4 with SMTP id a640c23a62f3a-a866fed0a37mr170325966b.1.1724240638117;
        Wed, 21 Aug 2024 04:43:58 -0700 (PDT)
Message-ID: <51d748b6-4de4-4760-bc1f-75396b33c98a@suse.com>
Date: Wed, 21 Aug 2024 13:43:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: set (fake) operand size for AVX512CD broadcast
 insns
From: Jan Beulich <jbeulich@suse.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <fb917afb-62d1-42f0-83e6-276cae67569d@suse.com>
 <487bf692-ebd8-41ce-96b0-d4034bdfcef9@citrix.com>
 <f6e6c550-7f8a-4c00-b6a9-c6362df1f1a2@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <f6e6c550-7f8a-4c00-b6a9-c6362df1f1a2@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 21.08.2024 12:49, Jan Beulich wrote:
> On 21.08.2024 12:35, Andrew Cooper wrote:
>> On 21/08/2024 10:28 am, Jan Beulich wrote:
>>> Back at the time I failed to pay attention to op_bytes still being zero
>>> when reaching the respective case block: With the ext0f38_table[]
>>> entries having simd_packed_int, the defaulting at the bottom of
>>> x86emul_decode() won't set the field to non-zero for F3-prefixed insns.
>>>
>>> Fixes: 37ccca740c26 ("x86emul: support AVX512CD insns")
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>
>> This is the second such patch.
> 
> Indeed. The first one was a result of me doing some AVX10.2 work,
> covering new similar insn forms. That finding then prompted me to do
> an audit, resulting in this 2nd finding.
> 
>>   Does that mean there should be an assertion somewhere?
> 
> Not an assertion, as there actually is a check already:
> 
>     else if ( state->simd_size != simd_none )
>     {
>         generate_exception_if(!op_bytes, X86_EXC_UD);
> 
> That check is what is causing emulation to fail when op_bytes isn't set
> ahead of trying to invoke a SIMD insn via the shared logic near the end
> of the function. I don't think it needs to be any stronger than that.
> The reason this wasn't noticed so far is merely because no testing we
> have in place ever exercises these insns. Which is a shortcoming, yes,
> but one that's not very easy to overcome (as in: if we wanted to, that
> would likely mean writing quite a bit of new testing code, to cover
> everything that isn't covered right now).

Thinking about it - we have EXPECT(), which is perhaps better to use
here. That way, even if not covered by our testing, fuzzers will be in
the position to trigger it (on capable hardware only of course).

> For insns not accessing memory the value actually isn't needed / used.
> An alternative might therefore be to move that check into the OP_MEM
> conditional, and drop the fake setting of op_bytes (there are a few
> more similar to the one being added here).

Question then is whether to also move it, as indicated. From a
debugging perspective it's likely better to keep where it is, while
from a user perspective allowing reg-only insns to go through
(despite the internal error) might be preferable.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 12:06:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 12:06:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781060.1190615 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgk70-0001NO-5K; Wed, 21 Aug 2024 12:06:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781060.1190615; Wed, 21 Aug 2024 12:06:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgk70-0001NH-2m; Wed, 21 Aug 2024 12:06:50 +0000
Received: by outflank-mailman (input) for mailman id 781060;
 Wed, 21 Aug 2024 12:06:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=D8aE=PU=bounce.vates.tech=bounce-md_30504962.66c5d855.v1-010acca1462e467092bdf3806c21acbf@srs-se1.protection.inumbo.net>)
 id 1sgk6y-0001NB-Rg
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 12:06:49 +0000
Received: from mail186-11.suw21.mandrillapp.com
 (mail186-11.suw21.mandrillapp.com [198.2.186.11])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d66994be-5fb5-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 14:06:47 +0200 (CEST)
Received: from pmta10.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail186-11.suw21.mandrillapp.com (Mailchimp) with ESMTP id
 4WplS54dJ5zLfH3xH
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 12:06:45 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 010acca1462e467092bdf3806c21acbf; Wed, 21 Aug 2024 12:06:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d66994be-5fb5-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724242005; x=1724502505;
	bh=X/tOv9o3a9iLxzCm/f3NpxTQqlbHR8gkWZnodPtLg+o=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=q40Vp8rfPrm4J4dUIe4ear5b94HwMENgwvUjZ4nraoaaGrv7nXxyztXjRoW3gqBD1
	 LeRsSOF7c+i6pT5YxDaunvn+wFKdMwmOuE/Qhwp5E48ZIMviCBRP50mY1t3S/zTTc1
	 waVTobfjMAZqQZ4YlOBBkFdLGzYujiQCFQqcJhh2jMtUcu3kSara1o8neEOOYf44hB
	 VeJbErF2CiXV7XhrEyh0WOTmb9fmwyEyJjRgN//we0ZDD6nI2XvHtaVDnxGt7gFxbK
	 KWoktNDU3Q3us/7NaEujjsEVrg0psl1n/TFu95i3hVl5RU3z12Ldl+6ghdWNLu3bS7
	 tne0BcHIl9DCw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724242005; x=1724502505; i=anthony.perard@vates.tech;
	bh=X/tOv9o3a9iLxzCm/f3NpxTQqlbHR8gkWZnodPtLg+o=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=qWFIKYhzmIHm4EQk2jXuC7I8rBnlPqu9yQX2g9iC6B8/KjhmJ2LfJk8/jzn3jRGN0
	 18OAeDG2Ia9fZIv5FowVuNGvz9lIDz9ZnxX5LKyoDVawoF4hCitxzkOGyeQJt0a78I
	 9q/Bci7l5ESFCKU+dB34QPhJnv3yrweLQgyMAh8aO1z3/6pfaIcqoOgIcwzDue3rJ+
	 z82kZ9A42pMiaGl70anmuRXbRqpJium3wmpaQA22JkVKwLK7pPohxjqnhS/L/CaeUL
	 nRve68ecxkzYPDjgj+kvqvZP7R2TboHorRtSriGhnoXCCKmB4BMABFNnDXQCZdqF4Q
	 4sLc7N4kbgLWw==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH]=20automation:=20restore=20CR=20filtering?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724242003868
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org, Doug Goldstein <cardoe@cardoe.com>, Andrew Cooper <andrew.cooper3@citrix.com>
Message-Id: <ZsXYU33Ap9P/xC+R@l14>
References: <alpine.DEB.2.22.394.2408161642220.298534@ubuntu-linux-20-04-desktop> <6d2fbe22-8866-4769-95d0-a5a8613a5936@amd.com> <ZsNl7S1JOYQgQx87@l14> <alpine.DEB.2.22.394.2408191819580.298534@ubuntu-linux-20-04-desktop> <ZsSMVaoJlR4mn7Ig@l14> <alpine.DEB.2.22.394.2408201842090.298534@ubuntu-linux-20-04-desktop>
In-Reply-To: <alpine.DEB.2.22.394.2408201842090.298534@ubuntu-linux-20-04-desktop>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.010acca1462e467092bdf3806c21acbf?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240821:md
Date: Wed, 21 Aug 2024 12:06:45 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Tue, Aug 20, 2024 at 08:48:55PM -0700, Stefano Stabellini wrote:
> On Tue, 20 Aug 2024, Anthony PERARD wrote:
> > So I guess `sed` the output of `expect` will do. Maybe put that in a
> > script that also call the expect script? (To avoid duplication, and help
> > with maintainability of the whole thing.)
> 
> I tried a couple more times with expect but couldn't get it to work.
> With sed it seems to behave correctly. Can you guys spot any issues with
> it? If not, I'll send the full patch.
> 
> https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7627376496

That job looks fine to me.

> diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
> index 0094bfc8e1..e0cea742b0 100755
> --- a/automation/scripts/qemu-smoke-dom0-arm64.sh
> +++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
> @@ -109,4 +109,4 @@ export QEMU_LOG="smoke.serial"
>  export LOG_MSG="Domain-0"
>  export PASSED="BusyBox"
>  
> -./automation/scripts/qemu-key.exp
> +./automation/scripts/qemu-key.exp | sed 's/\r\+$//'

Cheers,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 12:25:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 12:25:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781071.1190634 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgkOv-0004gF-Sm; Wed, 21 Aug 2024 12:25:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781071.1190634; Wed, 21 Aug 2024 12: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 <xen-devel-bounces@lists.xenproject.org>)
	id 1sgkOv-0004g8-Pf; Wed, 21 Aug 2024 12:25:21 +0000
Received: by outflank-mailman (input) for mailman id 781071;
 Wed, 21 Aug 2024 12: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=rYNs=PU=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sgkOu-0004Qc-1a
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 12:25:20 +0000
Received: from NAM04-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam04on20617.outbound.protection.outlook.com
 [2a01:111:f403:2409::617])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6d47ffbb-5fb8-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 14:25:19 +0200 (CEST)
Received: from SJ0PR03CA0082.namprd03.prod.outlook.com (2603:10b6:a03:331::27)
 by CY8PR12MB7265.namprd12.prod.outlook.com (2603:10b6:930:57::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.16; Wed, 21 Aug
 2024 12:25:15 +0000
Received: from SJ1PEPF00002316.namprd03.prod.outlook.com
 (2603:10b6:a03:331:cafe::b1) by SJ0PR03CA0082.outlook.office365.com
 (2603:10b6:a03:331::27) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19 via Frontend
 Transport; Wed, 21 Aug 2024 12:25:15 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SJ1PEPF00002316.mail.protection.outlook.com (10.167.242.170) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Wed, 21 Aug 2024 12:25:14 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug
 2024 07:25:13 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug
 2024 07:25:13 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Wed, 21 Aug 2024 07:25:12 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6d47ffbb-5fb8-11ef-a508-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=sqKt6jXiTxIlQ7ixJmJXsYskGvy2oJjfaPWy58Df7QbPSoSivlH6P2mdTAjBlLQfqtR7/1jPK1Yd3i8WRoDK74jnLlxEqfgGzS9kWOEAAS0oVWCR5Xungus/Yt+7id3fvgpYGy5//qctO+LtYyqq+7UlbgZ3Pc7IwF/IiiTzGFYWBg864lFGEGaGqGB4DnumqltJ+tHLIGRjNGoc1ZHXK1sdM1sdI95Po8lf2Ok2k6lsMXe2Iq59WWpR24mrpr8wnCTg/GZ7QlC9zYGsjIJFXw4zgfsaUgNl7iowQ+IgReyzOaQ5oq8Q8RVpjRGggq+ZJdyvetmEfbbVv16nDv4OXQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=97wKeZFQuE5riInUagI/wzwtAQEo7E7/3Y6sQDssmUU=;
 b=DHSdDrOP3WTiivExCiuK2mwTKop3iiZ7Gn1q/8bdVnCqFR9WEERA7qJww6KO25NuMNdB+ZJ22eqr8FEr+61FgrJUbzOHjGgOTbL5982WqSgwkRWVvv7rqRt2FdO/gdE3Mw5HVkc583zc3vquz+PhevP11w2RDWQhGoPR0ggF8Ll6C0ZLJFqXMXE+TBgl2heT38burrd47JS1LIItE2G3EDfCVnN4hFXxIlvFtK1XDP2BdK3ChXJSTnIkHwxaM3hZLQTpYWH4ZPctG6TO1tEY8BIsNrcfMTftZTebiK+kYc0d70EIZHgv5HfVVAvNfhP4os6IqravLu+nEi0ODRXgAw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=97wKeZFQuE5riInUagI/wzwtAQEo7E7/3Y6sQDssmUU=;
 b=Ur0NMtSDOXXLmKxvwbgGB4086o2/rGOccrLfcExgDBWv3O33iAErtFolQQxXdBaXBVFr3j8ANRdLVh8iOp/wqoiV2jxfVCD3L9wB1URT3brKxh7c9JNZ+i01i2jTBDICsttHxqVj+6K3F32gc6DXeRaVkKDeZ+4OW4QzY2FAbIs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>
Subject: [PATCH v4 2/4] xen: arm: Move domain_page.c to MMU specific
Date: Wed, 21 Aug 2024 13:25:01 +0100
Message-ID: <20240821122503.2315844-3-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240821122503.2315844-1-ayan.kumar.halder@amd.com>
References: <20240821122503.2315844-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF00002316:EE_|CY8PR12MB7265:EE_
X-MS-Office365-Filtering-Correlation-Id: 1c2afd5f-f905-4756-27bd-08dcc1dc4f24
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?MaknWIarnv1SVICpgsDYTxAm6f9xss1j/aRQLkC7QfS5liSptOVebCIjPR7G?=
 =?us-ascii?Q?UfEiEbBvw7KnC54z9cNNUtRIbaFQ5K7WyYRZuNKOw0yOAOvJklh4HV6Jv1xv?=
 =?us-ascii?Q?PV8BT5Qy1kjb62jsWhZxhteuhAhWFnEsS9nVBCMBCDBvFKitjK4I+BR9TukL?=
 =?us-ascii?Q?9dvxidlIb7QFA1+6/KIalLtf0nVVAyBMj9pTbXnRKxsWbZ+E0bziuLMuqXTO?=
 =?us-ascii?Q?pmmRQvU2ZC5tSkT+kzVejbk7xq2OXDwHq0ytayz48C2G32HGLVWVwCA45sYC?=
 =?us-ascii?Q?MhPVjM7GKsxCwFUeAe0DpmcyThkm8Gt1wXoKVYioh0sy8K2X3i/PmYe97Htv?=
 =?us-ascii?Q?zBKIeYETq5qi32+Hk80FPfi436dMnqrSMbJLmLLlBXFX4WmpNP99SsDomLZB?=
 =?us-ascii?Q?rxRjvOi9joXB3u1zX102ut5Ezjl0dX41TnW+V2U+SmfuEvym6iEb1aOrYwF+?=
 =?us-ascii?Q?YTDCeyZQe2fjj/oB6Gv1GazIu9E76/YqYPA7QRm9qZBtSN7r33fa2sENqnmd?=
 =?us-ascii?Q?NBud7WKxpn0FymDv7tzZmlVf0xjFrZnrF0dSLIlJw7dYTvoPODbChhEHSzrH?=
 =?us-ascii?Q?8ZYrsNDUg+o4snQEsl0etlIB2LmXzMg8eOg6BDFoSzrZtX7FdtcBH6Vh12xq?=
 =?us-ascii?Q?1m8uQxP4TwB0LZmedtfJRtiD+G+nskUHCirEd/u/MQInkkmo/EeWP53wbULf?=
 =?us-ascii?Q?hs9xFqYmO1/PUNfT3Zl1nFpAhv4tvG68zFhcV5E5QcqNf9gh4q95n1d8QuQn?=
 =?us-ascii?Q?tXeW59n2YTwAFqn3aRxcbIwm+CRJvamxWsXqNWufkp2J4QblPpkiy9/i+xLE?=
 =?us-ascii?Q?XTM1CO3/K7A6Kq2x576CawM0lIp9C8oW4/W6UWgzm28+EZRIYyFwIUtPOuJL?=
 =?us-ascii?Q?gUh1dyk1WZyslyqxxeIssKRicdZ739stUXSJi2QbCgv8Rde27eWxP4ZBxZ31?=
 =?us-ascii?Q?n9Rs3WTCJCXLHu/y6z7yxO8eu6XztEMyy8ojmqifACGzB0yHiM1Wi8LTW3UN?=
 =?us-ascii?Q?lxegV5Gpg67bL8a0s5AqLUgfY/tyVsPQMp3nS89bXK/+uGvOIP89dXC4DZjD?=
 =?us-ascii?Q?hui91oojLl/ketl0rqhV9MwJZ/x7zVSajB6FUe4U1NLYDptPALkLjMI4td0d?=
 =?us-ascii?Q?xvE1bfrVm8i9HGPPxhkpKCGKEGQQdkxk667YNTmJKuH2xRdt5tGxLBdyrw14?=
 =?us-ascii?Q?ZP6bEsGwqBeQPn7xIljyxAzZBy0WaahwO7ER88F1XRGDRAheL/nUaPJJQJxZ?=
 =?us-ascii?Q?mKBNyESJsiIGdmnaSuJEbOsFxSk0veTAKpJb8KLRRuAAcl77ui3vqB3z14j2?=
 =?us-ascii?Q?XsJyRGTun2qIZjinIIbptvKch7aIi8JE7YGZdf+6Yx5XrYhVg2qTo1s21Fj2?=
 =?us-ascii?Q?5/0bNk372Un6HnPQd7fSfu6bI6fdhESZqtspyMH2ZD0TAP09vmjxHs6EQzgS?=
 =?us-ascii?Q?2kqKS8Tzd/xkRC2bdImo66FcPBn/eIkE?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 12:25:14.2940
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 1c2afd5f-f905-4756-27bd-08dcc1dc4f24
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF00002316.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7265

domain_page.c is moved to mmu/domain_page.c. The reason
being this file implements MMU specific logic for mapping,
unmapping, etc domain page.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
Changes from :-

v1 - Moved domain_page.c to mmu/domain_page.c.

v2 - Updated arm/Makefile.

v3 - 1. Used the same commit message as v2.
2. Added R-b.

 xen/arch/arm/Makefile                | 1 -
 xen/arch/arm/mmu/Makefile            | 1 +
 xen/arch/arm/{ => mmu}/domain_page.c | 0
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename xen/arch/arm/{ => mmu}/domain_page.c (100%)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index da9c979dc4..7792bff597 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -18,7 +18,6 @@ obj-$(CONFIG_IOREQ_SERVER) += dm.o
 obj-$(CONFIG_DOM0LESS_BOOT) += dom0less-build.init.o
 obj-y += domain.o
 obj-y += domain_build.init.o
-obj-$(CONFIG_ARCH_MAP_DOMAIN_PAGE) += domain_page.o
 obj-y += domctl.o
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += efi/
diff --git a/xen/arch/arm/mmu/Makefile b/xen/arch/arm/mmu/Makefile
index 67475fcd80..2cb44b857d 100644
--- a/xen/arch/arm/mmu/Makefile
+++ b/xen/arch/arm/mmu/Makefile
@@ -2,3 +2,4 @@ obj-y += p2m.o
 obj-y += pt.o
 obj-y += setup.o
 obj-y += smpboot.o
+obj-$(CONFIG_ARCH_MAP_DOMAIN_PAGE) += domain_page.o
diff --git a/xen/arch/arm/domain_page.c b/xen/arch/arm/mmu/domain_page.c
similarity index 100%
rename from xen/arch/arm/domain_page.c
rename to xen/arch/arm/mmu/domain_page.c
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 12:25:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 12:25:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781069.1190625 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgkOp-0004Qp-Lc; Wed, 21 Aug 2024 12:25:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781069.1190625; Wed, 21 Aug 2024 12:25:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgkOp-0004Qi-IS; Wed, 21 Aug 2024 12:25:15 +0000
Received: by outflank-mailman (input) for mailman id 781069;
 Wed, 21 Aug 2024 12:25:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rYNs=PU=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sgkOo-0004Qc-Hs
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 12:25:14 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on20609.outbound.protection.outlook.com
 [2a01:111:f403:2414::609])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 696d013e-5fb8-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 14:25:13 +0200 (CEST)
Received: from SJ0PR03CA0027.namprd03.prod.outlook.com (2603:10b6:a03:33a::32)
 by SJ0PR12MB6784.namprd12.prod.outlook.com (2603:10b6:a03:44f::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.29; Wed, 21 Aug
 2024 12:25:09 +0000
Received: from SJ1PEPF00002312.namprd03.prod.outlook.com
 (2603:10b6:a03:33a:cafe::83) by SJ0PR03CA0027.outlook.office365.com
 (2603:10b6:a03:33a::32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend
 Transport; Wed, 21 Aug 2024 12:25:09 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SJ1PEPF00002312.mail.protection.outlook.com (10.167.242.166) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Wed, 21 Aug 2024 12:25:09 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug
 2024 07:25:08 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug
 2024 07:25:08 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Wed, 21 Aug 2024 07:25:06 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 696d013e-5fb8-11ef-a508-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=wYL2bj51vPURx8WeG8XCDOwy48U14S5tU6oHhva9amzTn7J3HabQsB/8eGVEU+aioczRv1GYgZ+uxgLlxoyg9i9p1JSMzDvMlaicdUhIkUh3MHay6UkaiI8tI3I0vxMenM8m4AO7XWQD86uDCt+8EYwoVH2XApLLjs3dS2KuPEKSNdbVJ68cy3Ii4G0qN+JyU32mjQnbmKkbzoOCmDBTLuB+khZnqMStelv7MmR0ISeVHl58q7MX6aznuU7KIQvKVTbc6xxrajyPYTJ3H4WRyvaWnmAzbvhf1l1rmjDOCfHXoFPO8Uh4Vtr6rKfUooBJxpmO+4uUSy9Awg3YmbpnMg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=9z2Vlsc/1LlZUwNq9ZO7O+VdhHXAVt0rlCBhRyaeMzY=;
 b=QrCvEkeNvO77BxeRTZ7KTQnKKcc3yBshcr4KMMHbURP2BdZyPY2WQKHJr9oQiWGtbeUfzHb7zSkDGDoD2qdeoaL9WrBUUCT3Sv11hZKHq9C1qcm14XdyOVQ+DKhxKyMGjlCaOOhD11mCTUWTUUgPgEHUsDmX7dqTU9s3sXeCtFyvRYPBAFv24YVOfu+I8LQ1xfQCq8+qThuMBAb6GJh8/oiAvpifold2DsC/eGNDFcLCObgest/S4AgA+44BKX5QM+HlyPXcnp/Ejon+KB1TQMYmyu9rgK863afJD6HFyiKCwD4SnpVmbngQSfey01YtyCrTP9AN0spKNaTAJuBc8g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=9z2Vlsc/1LlZUwNq9ZO7O+VdhHXAVt0rlCBhRyaeMzY=;
 b=qxC/kdR5ClafT4A13a2FRydl7SsFiBXWTVXmefCcOrA4ALZZWmDRFxOmMH4oDvikUfO85uxZZthGWozZuz0KSxkm2d2nvWSwlpCGy1MIb2CtTZPE2eW8sYQdMMLlF0XIg8RkXXhDQDmvog8XnAseL65C21k8rTyiD/+S5CPHPWA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, Shawn Anastasio
	<sanastasio@raptorengineering.com>, Alistair Francis
	<alistair.francis@wdc.com>, Bob Eshleman <bobbyeshleman@gmail.com>, "Connor
 Davis" <connojdavis@gmail.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>
Subject: [PATCH v4 0/4] xen: arm: Split MMU code in preparation for MPU work (part 2)
Date: Wed, 21 Aug 2024 13:24:59 +0100
Message-ID: <20240821122503.2315844-1-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF00002312:EE_|SJ0PR12MB6784:EE_
X-MS-Office365-Filtering-Correlation-Id: 63a7b704-c4c1-45a4-f497-08dcc1dc4c04
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|7416014|36860700013|376014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?vPG5+OHW/RjnisUYnN4AFIW2N4aJ96rMHGsoYATY886IyUC5heO/F9QMw/ej?=
 =?us-ascii?Q?7UCQy43ju/+Qksyg5+EauCtK+mT/RGtK7cR65drk9tSvb+9PnjbJUR9taB3u?=
 =?us-ascii?Q?16dNF7aLmfcvnnOwVT2wugoQKcRXqhMWy9ZSQ5/dBsawm82TMliNzb3dXdAO?=
 =?us-ascii?Q?ZZUv+mSLuWEbajAEM+l9JJC/N/hrJPvVUj1/EG2DZswPraySBqedAGYqs2MC?=
 =?us-ascii?Q?BwMj+zPRyT/ieJfp6OqHsV5+pqDNf3JMuknfzXEE5KfYgmfZqYM31dGBMM5L?=
 =?us-ascii?Q?jI0Cd6KoFc/cFlcTE5t39ioL6F+n8fLQ70rdEHyrjSRQRFG48H4zv0dtnQxs?=
 =?us-ascii?Q?g9vY0S7L0SsMHiY0paQ7rtonL+vCMBIxX9hRbKhl3ZKLUcyFy4ciUN3Pj3bQ?=
 =?us-ascii?Q?Kdt1UHZk2EnebAJReDdefr2vZgPgHzBiYO/3MUn9QltoZHDoyUIJBAUNr7in?=
 =?us-ascii?Q?2g4jGfhJ7UWUor3DgNrmPDmYuls5InIrV8XKaZnAp1vyyqK398InYuCcqJmg?=
 =?us-ascii?Q?/YEkNzMryxEHLRBsqefkCZkv/1TpwhsQt7nk25uePanv/94q2f8YhPznHjPh?=
 =?us-ascii?Q?X+ZTZGF5sVIa2hHekU8dWDCmHaxnSC1zIY4VMVHWREqX0Tzy04u6K+WbDO36?=
 =?us-ascii?Q?q2xMVdtCvr64Dx05mxW1FwSUxtJruviXog/3sazbTFzkGheurnwpL2o4haX2?=
 =?us-ascii?Q?/jNz57ibswRkphvfypyXpqGWrAL66UjPGnXnBLzeBx4/IXByH8NxOKgb4l9p?=
 =?us-ascii?Q?kIqn2Tkr/ItxV5fE5rgyoFhYGYkIY8Ysosf+IQ7LkbtoucK6Iyie2EDxk6fY?=
 =?us-ascii?Q?Rf542nm2Exv0+cJ5E1WOYs35gwEbZ7ZcCt6RXA9FzoUS8bqlIS0TP6c7uWsb?=
 =?us-ascii?Q?xOuK5y0L4/aopWtCc30WXghSQKVaC7POBEpvXTYu+7gSJXkLvzPX/cD8tIXw?=
 =?us-ascii?Q?r3mjM/qrbjYVcYtYJ5nRZfr0z9mCwiPkCDJAjsn+LudA5njiyo6GI8r+x0XH?=
 =?us-ascii?Q?MlSqr3sMX/G6AMzvClQftHXoO8BdKqdW9OmBdYi9jLTP2Otet+oL5mvjyMLr?=
 =?us-ascii?Q?XOpFKyee4CtaxAhMH3dw31+xdBKh55Q4yGcAOJqMAfyhVJ0XbuKhLaaXWpX3?=
 =?us-ascii?Q?51QgMBV+vKeE+yRX8PULUlBUPS0OqfSXcQ9rgwT0pu3bpolr5h3ncWRo2BlW?=
 =?us-ascii?Q?2zyMf7O5hD146PL0sqxEv8KvSYB/D2dBZsmLmXrIq9K3VhOFuECdHKmP8GAX?=
 =?us-ascii?Q?+4q9KlWHkQDR3vxoMTCb/VSWi9B4Xf5eAvh7yIAamtmyqzcVArtPp8K2Qm7D?=
 =?us-ascii?Q?ufLiE1JIW4D3wpIx7QThCJyf0db6u/BcYs2NjBXQYTXdUDaWMbl2McwCpQF9?=
 =?us-ascii?Q?8u0b45QKWDAWY6gGy4UKwRrFwuiB?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(7416014)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 12:25:09.1033
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 63a7b704-c4c1-45a4-f497-08dcc1dc4c04
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF00002312.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6784

Hi,

In https://patchew.org/Xen/20231116145032.1651305-1-Henry.Wang@arm.com/, Henry has
reorganized some of the code between the MMU specific and generic files.

In this patch serie, we address the remaining code reorg so that MMU specific
code is cleanly separated and we have added stubs wherever necessary to avoid
introducing if-def.

Changes from :-

v1..v2 - mentioned in individual patches.
v3 - Reordered the patches so that first 3 can be committed (as they have been
reviewed).

Ayan Kumar Halder (4):
  xen: arm: Add a new helper update_boot_mapping()
  xen: arm: Move domain_page.c to MMU specific
  xen: arm: Enclose access to EL2 MMU specific registers under
    CONFIG_MMU
  xen: make VMAP support in MMU system only

 xen/arch/arm/Kconfig                 |  4 +++-
 xen/arch/arm/Makefile                |  1 -
 xen/arch/arm/arm64/mmu/mm.c          | 14 +++++++++++++-
 xen/arch/arm/arm64/smpboot.c         |  6 +++---
 xen/arch/arm/include/asm/arm64/mm.h  |  9 +--------
 xen/arch/arm/mmu/Makefile            |  1 +
 xen/arch/arm/{ => mmu}/domain_page.c |  0
 xen/arch/arm/setup.c                 |  2 ++
 xen/arch/arm/traps.c                 | 10 ++++++++++
 xen/arch/ppc/Kconfig                 |  1 +
 xen/arch/riscv/Kconfig               |  1 +
 xen/arch/x86/Kconfig                 |  1 +
 xen/common/Kconfig                   |  3 +++
 xen/common/Makefile                  |  2 +-
 xen/common/vmap.c                    |  2 --
 xen/include/xen/vmap.h               |  2 ++
 16 files changed, 42 insertions(+), 17 deletions(-)
 rename xen/arch/arm/{ => mmu}/domain_page.c (100%)

-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 12:25:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 12:25:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781072.1190641 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgkOw-0004jb-7U; Wed, 21 Aug 2024 12:25:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781072.1190641; Wed, 21 Aug 2024 12:25:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgkOw-0004ij-1A; Wed, 21 Aug 2024 12:25:22 +0000
Received: by outflank-mailman (input) for mailman id 781072;
 Wed, 21 Aug 2024 12:25:20 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rYNs=PU=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sgkOu-0004fH-3O
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 12:25:20 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on20608.outbound.protection.outlook.com
 [2a01:111:f403:2412::608])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6b92fbab-5fb8-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 14:25:18 +0200 (CEST)
Received: from SA9PR11CA0026.namprd11.prod.outlook.com (2603:10b6:806:6e::31)
 by DM3PR12MB9389.namprd12.prod.outlook.com (2603:10b6:0:46::9) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.7897.18; Wed, 21 Aug 2024 12:25:11 +0000
Received: from SN1PEPF000397B3.namprd05.prod.outlook.com
 (2603:10b6:806:6e:cafe::e9) by SA9PR11CA0026.outlook.office365.com
 (2603:10b6:806:6e::31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend
 Transport; Wed, 21 Aug 2024 12:25:11 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SN1PEPF000397B3.mail.protection.outlook.com (10.167.248.57) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Wed, 21 Aug 2024 12:25:10 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug
 2024 07:25:10 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Wed, 21 Aug 2024 07:25:09 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6b92fbab-5fb8-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=c/H1JsA2Q7jPdTbWhJooj2VLv2Q/3sHJMmrA+MM68V3Pf3aAn+iFk4n/T8jYk1GuxyRCsWDfKNOxxJaqzA/B8KecXIvSiwIAQcijyWlkgjsWGcdvruyzN7REnMq1mkwdBAuyYR5TxpbyBvxvyG8sAzxjMGIwgt7+b62F0gX2bV1J4k5aahpmvWPHFszToRvgKlinmKxDL+q62nOvzk6/iZ0kXtAQBWWAKB0aYjiFLOr+vpjBgwYZR+vTd7w9g5JqlsDXB5E7uu26fMTKi1YNydx+SgP5OxF8pRoeKU6MHsRBKoEfNcn5w/AFGMpAJ3d1dUww49n5+sQiW1lFY3zozQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=myNOoC4J1xnM7AVVy5dYiGJh7XPyIflSw2Q+8lWCIFM=;
 b=futS9a9NM5YuHSWfbCHmpJjRpA9CiAVPy1NvuAg+paJ6aqU+Kr/Yq6T0aPU2+dGRk+gJ6ZOVBA/ppavKPFUIAnGORHsEMFIy3v7ovdBNZLwwAsEZ1AQ8hNfGH2p4Yp1uXA0yvUZ6s+BuEGFOx1cLQvjwq8rHOb0GrksmOLjWtJwdVHZKaNC2d5q1PIuw4/1lqFmkk0WXaLtkWozdwp7lS1sSQ/tYZql/yqU/anflOEmwYncUf0W31Udb+WCUo+n7pncoqsZ69yX5KJ9EkR9b0kfdYi4wFVDdMy38dPjfTuNL6wdF9OSPh6XksWZ4NRIvywC82JUk0TfNWXHgu0+BWg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=myNOoC4J1xnM7AVVy5dYiGJh7XPyIflSw2Q+8lWCIFM=;
 b=y8zRDgnZHOTzzaAafd5+wyrroeLn64Byg1kU6zNOf9Kc6VcDGpl4liJUjhRtkQiAQvlvAMxpDwh7DzlPGQPEHdjcpwjn3n6XV6bnBjP0GvxhYE/v/lKVyFuFLTr1uENADskJek5JEGzUPYEJjj4r3H8nEZwaHROOHHq23wateGI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>
Subject: [PATCH v4 1/4] xen: arm: Add a new helper update_boot_mapping()
Date: Wed, 21 Aug 2024 13:25:00 +0100
Message-ID: <20240821122503.2315844-2-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240821122503.2315844-1-ayan.kumar.halder@amd.com>
References: <20240821122503.2315844-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB04.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN1PEPF000397B3:EE_|DM3PR12MB9389:EE_
X-MS-Office365-Filtering-Correlation-Id: 8e4ff698-5ee1-4264-84af-08dcc1dc4d14
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?dtvNdzQJ7EOnLrjyvqGAm7wwbO4Z7DtwQVTT47zB5kJp8mupoJSuR6/z4xCi?=
 =?us-ascii?Q?xYLV6Z6g7Nih3KgbIoCw6fK3wojkv0xCWL0l2ih7eQntRws4MDUWcXkdXq8L?=
 =?us-ascii?Q?yNrsL+e/2l21kWZ+5pgaYqmH2VNJxF6HM6fKxwi8xSqlrHPN5X6h43csbpuI?=
 =?us-ascii?Q?HHJg2Au3vqj0gJRRWNMzupFhCt9gy0/OXn2PJF2svPqevahzh1IjrSEHlyhq?=
 =?us-ascii?Q?DtdcqoxgrEmgYEKhVkxSaw1vC1nJDFZ4dfEkfrUeln4TXjX8u1rD5jBtk3Is?=
 =?us-ascii?Q?QNj6k3fXlB5fkeWeapCUxojihqdkGjT+D/YdbNAh9HB99e8T6hCaulU5J5hh?=
 =?us-ascii?Q?2uVtsGqi/ftFVK+d5XPnvuR87bjkaOoSx+tSgk0BuYJfm9uiaBPctrqE3nJq?=
 =?us-ascii?Q?nlyYCOxU1VkZQkFpr2uU3/0I3L5fEXC5rTCVo9DTGjDbmhmFh8XeF+LMHLYq?=
 =?us-ascii?Q?vit/wG2LJcemkG+BFcRFXYktGi3i6SxCnHIfWuAVhrleQgt14bEU1pthux0m?=
 =?us-ascii?Q?AW/NtrGUuOHIBTFeM6MqFZqr4u2m3GV/xevlzMU2FNOHIFcVPXq2DxswHZ/9?=
 =?us-ascii?Q?xnp4K5mbJJczZuTMgk9g4O5oMMD/6S4L1Y0eMlM4HfVscV2M4ob3KztfYdJg?=
 =?us-ascii?Q?EYBBBpWMNJ0rJY6s0EVLPaNV4BlZI7rARmneroh6xlHUK7VUGpWTp/PKxu/k?=
 =?us-ascii?Q?Pzh0RaJrfDDvIR8VKxf/A2uzOFvMYODqRewicMfvGUUpazqIlRVJYmWciq4w?=
 =?us-ascii?Q?CZIVe3T7331Kg1uQ2K1pPQilEZoqrzmV8KXgAbomZmv7QwvtVhzR1pQDUUy1?=
 =?us-ascii?Q?AFwa02XDAF1ju7BrNXu9XKe38Tf3YDVpwpEEPOJ9x7uQE0xiN+2W0jqrfTut?=
 =?us-ascii?Q?/vsYYXOUB1jNQM32n8hHQC5ASY9wiWh/5f6svchQHnhKugwg0vJDm2PwNs4s?=
 =?us-ascii?Q?vT36XzLLXzyK3MNd3PlV1KPznrTAPXJAtdyHeo+F94JMR5A237jHnn6crWOK?=
 =?us-ascii?Q?dhH62y9QxvuY4HyUXIPJQ/cpBC/TdTAgWKkLC0AQKV4458lFUroNY0S6N4+C?=
 =?us-ascii?Q?DJQUhzkX0kGUPmtpcORtbl+iKePLZFs6AcgGiXSRIBdq3gpr45u/NJBRHQCt?=
 =?us-ascii?Q?Xnx0vDESbFsztgzWIhXwApvDgreK43FJo3Kvpg1sP86Qvo4L0zEPPzfUtAdf?=
 =?us-ascii?Q?Pf3H3GWCGg6BBIAOz6GspZcPlhOW0aB6WiDckcbLb1FL5IU4oOB9PVl4m9QQ?=
 =?us-ascii?Q?5g0cB8lhqkzeiIIptFVaszADHEybjzeOYyrSiIfyP2RDzCcwTaS3oRR0yMFK?=
 =?us-ascii?Q?5Ow0zA8nhCR8VO1NZoZDJNGgjRUhSJx1b0Eyl+Hxr8sLFw4SmjZYlkX+/K0u?=
 =?us-ascii?Q?vcUJxdvuSoHDUJgligc0+mFiI0m+vi4FCDFdJH3jxadFy6MRQNMcJtdcjjoj?=
 =?us-ascii?Q?HIPDf4HpVzpvChmJXTsE+kJuQ8M4ZuXk?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 12:25:10.9455
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 8e4ff698-5ee1-4264-84af-08dcc1dc4d14
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SN1PEPF000397B3.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9389

update_boot_mapping() invokes update_identity_mapping() for the MMU specific
code.
Later when the MPU code is added, update_boot_mapping() will invoke the
equivalent.

The common code now invokes update_boot_mapping() instead of
update_identity_mapping(). So, that there is clear abstraction between the
common and MMU/MPU specific logic.

This is in continuation to commit
f661a20aa880: "Extract MMU-specific MM code".

update_identity_mapping() is now marked as static as it is called from
xen/arch/arm/arm64/mmu/mm.c only. Also, amend the prototype to
update_boot_mapping() which is now invoked from other files.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
Changes from :-

v1 - 1. Introduced update_boot_mapping() which invokes
update_identity_mapping() in MMU specific code.

v2 - 1. Make update_identity_mapping() static and update the prototype.

v3 - 1. The comment for "update_identity_mapping()" is moved to the
correct place.
2. Added R-b.

 xen/arch/arm/arm64/mmu/mm.c         | 14 +++++++++++++-
 xen/arch/arm/arm64/smpboot.c        |  6 +++---
 xen/arch/arm/include/asm/arm64/mm.h |  9 +--------
 3 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/arm64/mmu/mm.c b/xen/arch/arm/arm64/mmu/mm.c
index 293acb67e0..0de4f3c079 100644
--- a/xen/arch/arm/arm64/mmu/mm.c
+++ b/xen/arch/arm/arm64/mmu/mm.c
@@ -111,7 +111,14 @@ void __init arch_setup_page_tables(void)
     prepare_runtime_identity_mapping();
 }
 
-void update_identity_mapping(bool enable)
+/*
+ * Enable/disable the identity mapping in the live page-tables (i.e.
+ * the one pointed by TTBR_EL2).
+ *
+ * Note that nested call (e.g. enable=true, enable=true) is not
+ * supported.
+ */
+static void update_identity_mapping(bool enable)
 {
     paddr_t id_addr = virt_to_maddr(_start);
     int rc;
@@ -125,6 +132,11 @@ void update_identity_mapping(bool enable)
     BUG_ON(rc);
 }
 
+void update_boot_mapping(bool enable)
+{
+    update_identity_mapping(enable);
+}
+
 extern void switch_ttbr_id(uint64_t ttbr);
 
 typedef void (switch_ttbr_fn)(uint64_t ttbr);
diff --git a/xen/arch/arm/arm64/smpboot.c b/xen/arch/arm/arm64/smpboot.c
index a225fae64d..789f352ab6 100644
--- a/xen/arch/arm/arm64/smpboot.c
+++ b/xen/arch/arm/arm64/smpboot.c
@@ -112,18 +112,18 @@ int arch_cpu_up(int cpu)
     if ( !smp_enable_ops[cpu].prepare_cpu )
         return -ENODEV;
 
-    update_identity_mapping(true);
+    update_boot_mapping(true);
 
     rc = smp_enable_ops[cpu].prepare_cpu(cpu);
     if ( rc )
-        update_identity_mapping(false);
+        update_boot_mapping(false);
 
     return rc;
 }
 
 void arch_cpu_up_finish(void)
 {
-    update_identity_mapping(false);
+    update_boot_mapping(false);
 }
 
 /*
diff --git a/xen/arch/arm/include/asm/arm64/mm.h b/xen/arch/arm/include/asm/arm64/mm.h
index e0bd23a6ed..b4f7545d2c 100644
--- a/xen/arch/arm/include/asm/arm64/mm.h
+++ b/xen/arch/arm/include/asm/arm64/mm.h
@@ -14,14 +14,7 @@ static inline bool arch_mfns_in_directmap(unsigned long mfn, unsigned long nr)
 
 void arch_setup_page_tables(void);
 
-/*
- * Enable/disable the identity mapping in the live page-tables (i.e.
- * the one pointed by TTBR_EL2).
- *
- * Note that nested call (e.g. enable=true, enable=true) is not
- * supported.
- */
-void update_identity_mapping(bool enable);
+void update_boot_mapping(bool enable);
 
 #endif /* __ARM_ARM64_MM_H__ */
 
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 12:25:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 12:25:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781073.1190655 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgkOy-0005Bn-HP; Wed, 21 Aug 2024 12:25:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781073.1190655; Wed, 21 Aug 2024 12:25:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgkOy-0005BY-Dt; Wed, 21 Aug 2024 12:25:24 +0000
Received: by outflank-mailman (input) for mailman id 781073;
 Wed, 21 Aug 2024 12:25:23 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rYNs=PU=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sgkOx-0004fH-Oq
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 12:25:23 +0000
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on20628.outbound.protection.outlook.com
 [2a01:111:f400:7e88::628])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6f4047e3-5fb8-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 14:25:21 +0200 (CEST)
Received: from PH0PR07CA0056.namprd07.prod.outlook.com (2603:10b6:510:e::31)
 by CY8PR12MB7339.namprd12.prod.outlook.com (2603:10b6:930:51::22) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.16; Wed, 21 Aug
 2024 12:25:17 +0000
Received: from SN1PEPF000397B2.namprd05.prod.outlook.com
 (2603:10b6:510:e:cafe::d9) by PH0PR07CA0056.outlook.office365.com
 (2603:10b6:510:e::31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.18 via Frontend
 Transport; Wed, 21 Aug 2024 12:25:17 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SN1PEPF000397B2.mail.protection.outlook.com (10.167.248.56) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Wed, 21 Aug 2024 12:25:16 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug
 2024 07:25:15 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Wed, 21 Aug 2024 07:25:14 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6f4047e3-5fb8-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=IWeuRlLocCcW8HkYdDAT8p5OjKUHL7npZw/0nOlKhGOFFkxzy96OgG3K3LrR281Th9WHzMezlznY/zWCRqPeEI9I6N0GkVsdNcokpuYwxCISWwtZqMvE3bPNo3CU3khv4vXcvJ3O4sCZhmTNtMCANuNuV+EYLAMi2F4FMy9nEyj3S5YLPVQuTzN7GG6Es8xJ9vNFfiASa9c0ThekcW8rvLC6bDaYLCzUeme+MAUC77A/cuSgSQHZ86pRMsj9sxS/RUAQaqlhE+yhhQQvO+hb0RhH0RPJRWweK109TyRT2gX1P2H/1E5I6bm47eCSm9+aIZVpbmAnaimGel/icaT6qQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/zqKDpeSyfzXh5+nfpfFWd33RbQQ7fMe7jMFGYbsfNg=;
 b=yCgG2yGluodtw1Ovg8HWPP0KCu76zxdEH2IDtyn+CrtdfX+yiDOGUcDZ34F6WkHwd8kr9iR80c97SwQgHP1uAP1DZxok+Mlxtq9UKI3V2w0woyYv7p0fAB4U4tX6jatWJF7jvP2k8I0v8ZHD42Jjx3clwXsG4EEnUoHwzjxOIk1hBz1F0T+gAoXbRvkNqEfmV8tauUuUSTv9IAv2eiMXoNV88vY/jZ3mI+SOKX+LI5Wr+M4uKXhZsLCjqyLr+m+ctlQD0urEbAxePn0xMlycTyUYtTEm/PPXqJCeLvltTNa3sgJCWPREIqyqMfRVqgKxjjihqWTNENjv5hmBbkM2aA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/zqKDpeSyfzXh5+nfpfFWd33RbQQ7fMe7jMFGYbsfNg=;
 b=du/qtf9HNAr+dclAzu1wjrfRF0AARzCkZb9UbOePbBlVXDu32eXq5LBtuvmD3e2HqQcLjQAS8Tt6e73zrHJskMnOqp3z2sZMgQxBAFzwbSXUHD+/898kUhDfx0ws5zeqYI6HYxWrN8G6KppGG55KGHqE2Idw+2qd/mF427QJMe4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>
Subject: [PATCH v4 3/4] xen: arm: Enclose access to EL2 MMU specific registers under CONFIG_MMU
Date: Wed, 21 Aug 2024 13:25:02 +0100
Message-ID: <20240821122503.2315844-4-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240821122503.2315844-1-ayan.kumar.halder@amd.com>
References: <20240821122503.2315844-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB04.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN1PEPF000397B2:EE_|CY8PR12MB7339:EE_
X-MS-Office365-Filtering-Correlation-Id: b2a1f9c3-3aaf-41d8-4e2c-08dcc1dc5048
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?aTNXvxC7Osz3Yj4zJ2jcIhsKL/o72X2oYJCEmhYFDDHxng6YrB5l3ISZbMqI?=
 =?us-ascii?Q?5GcdUxXrp+DA7pUnNnI37pZtCYs7Ef3RBQKwc2MGs6Bmpygv3L3JN+DoJrWX?=
 =?us-ascii?Q?im5xWEgy/JxYj/fgPamKsuvZ+EX4eOIHP5y6JYvvHhG1zQICDgmV4e2+cyZn?=
 =?us-ascii?Q?fZifjrNK0eR2cHXp647dz2BJGaVU268yHfRYXWHLxwjQAuGn2GlJVgDNPwci?=
 =?us-ascii?Q?/OVhvT5EJr+jz1hu3GPWv+19n86QvipCYocKHerRumG9nxomhFFcAdE0zabV?=
 =?us-ascii?Q?CHMVr4lSaobyg87Qqcl6Lr/25FIIBKVLCkZfySLPVPl6Om0+UvGsOxvm32fq?=
 =?us-ascii?Q?mXcsJbumx9/fbcB18KtPNcPiBtO+CN8+R98sAgGGtkfdcPAq/8o0rntSvHQr?=
 =?us-ascii?Q?QO4BL7gaZs7bBWEqoPK9WjRrHEVzuH4qden8+ayp1Qq4nsRT9jsgZ1OKzzRI?=
 =?us-ascii?Q?wV6Du4q0TiQqPC1D4pqiGM6O2acAlbyZLP8uIMfEu70A8nLFYd2EJTAP+9Tq?=
 =?us-ascii?Q?dhtx77M72gsC9HQvx4qblNAXrYTepPoibzFDVNOrfYivZur7EINBFIyHM/ys?=
 =?us-ascii?Q?FZqZ9rep0wZyoWljlPV0rgL7r4Z272Kwy1GG6ljxbhb6n0l35JTCWhFCJfeb?=
 =?us-ascii?Q?OZi/8BVL+zvN3GbP3lF5Z5gFt+kmY0VyJI5Q3Nff+Y6Pkqj3Z93TEaEhX0B1?=
 =?us-ascii?Q?5sc7X4cLxIAI9+k2yYOW9nPhW61ZVuGzsHi0OOe3DSeTkwxwzOmULUT4IMje?=
 =?us-ascii?Q?CU/x/KQffIheagibJRjG2aJpnvGosqa5BrYEywbmY0CROPkl/IWa07gVGzd3?=
 =?us-ascii?Q?1h2z7tQxtZw8E7gaim/PUn6ErGBEEcb15vzYK1rivTwBVn7HXTbFA5KPdpd/?=
 =?us-ascii?Q?DoeqVH85Lbc4Wg4TOEtuv0rVM34AjH0YoRNVeVR5YHBo2HdYhljpfsJ882+0?=
 =?us-ascii?Q?J4FXchm2x7uX2n0iXwAmDnbQiGpcMf/SN/X6DvLPHrDF92HWMwmmmQH8U4AW?=
 =?us-ascii?Q?xv1d9L2ixDXXiUj0x/9w0HE8OpDxyUFpqjDQ92R2okD4Psrgcwg7JQSHnCK3?=
 =?us-ascii?Q?utXfTCU1BvC6XRDdYeBo6dyZgNxvJF49sVQSAUQA14ci0SMYzK5ydMibi4Eu?=
 =?us-ascii?Q?0+oGBNYjzaqKn/yCwtfpUTnYZ+z31d2RGbnfDBMT0eui0IuVKIX/LbBpurpe?=
 =?us-ascii?Q?h0SK7WaVqWE9RICsbijsz5X1GRj+sR9lHLtByooH2DZ4BmAg6xth7Lj/t2yM?=
 =?us-ascii?Q?sFuZvz80LHm1Em4lHL707W0yH9GKgn/sneGLv2Q75c5/kJzRIdV4JpgvSKA2?=
 =?us-ascii?Q?TXPy4JVti+zxDXfyWOXPOq13486MJO2iFiWpuXjn2+KBdbzY02AdGZwhIaKd?=
 =?us-ascii?Q?sTvuwTOfa3LQnGIQXOfpwHamVf1odmjHJzUW16KXpSblMKhdp2ob0VkPSIYf?=
 =?us-ascii?Q?FqzeutLPI9m0qJ7QtYNEqdXO6+VvhkOz?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 12:25:16.2868
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b2a1f9c3-3aaf-41d8-4e2c-08dcc1dc5048
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SN1PEPF000397B2.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7339

All the EL2 MMU specific registers are enclosed within CONFIG_MMU.
Also, protect vttbr_el2 field of struct reg_ctxt and accesses to it.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
Changes from :

v1 -
1. 'vttbr_el2' field is enclosed with ifdef.
2. No movement of code.

v2 -
1. Enclosed 'vttbr_el2' access in show_registers() and vcpu_show_registers().

v3 -
1. Updated the commit message.
2. Added R-b.

 xen/arch/arm/traps.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index aac6c599f8..737f4d65e3 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -720,8 +720,10 @@ struct reg_ctxt {
     uint32_t ifsr32_el2;
 #endif
 
+#ifdef CONFIG_MMU
     /* Hypervisor-side state */
     uint64_t vttbr_el2;
+#endif
 };
 
 static const char *mode_string(register_t cpsr)
@@ -919,12 +921,16 @@ static void _show_registers(const struct cpu_user_regs *regs,
 #endif
     }
     printk("  VTCR_EL2: %"PRIregister"\n", READ_SYSREG(VTCR_EL2));
+#ifdef CONFIG_MMU
     printk(" VTTBR_EL2: %016"PRIx64"\n", ctxt->vttbr_el2);
+#endif
     printk("\n");
 
     printk(" SCTLR_EL2: %"PRIregister"\n", READ_SYSREG(SCTLR_EL2));
     printk("   HCR_EL2: %"PRIregister"\n", READ_SYSREG(HCR_EL2));
+#ifdef CONFIG_MMU
     printk(" TTBR0_EL2: %016"PRIx64"\n", READ_SYSREG64(TTBR0_EL2));
+#endif
     printk("\n");
     printk("   ESR_EL2: %"PRIregister"\n", regs->hsr);
     printk(" HPFAR_EL2: %"PRIregister"\n", READ_SYSREG(HPFAR_EL2));
@@ -956,7 +962,9 @@ void show_registers(const struct cpu_user_regs *regs)
     if ( guest_mode(regs) && is_32bit_domain(current->domain) )
         ctxt.ifsr32_el2 = READ_SYSREG(IFSR32_EL2);
 #endif
+#ifdef CONFIG_MMU
     ctxt.vttbr_el2 = READ_SYSREG64(VTTBR_EL2);
+#endif
 
     _show_registers(regs, &ctxt, guest_mode(regs), current);
 }
@@ -979,7 +987,9 @@ void vcpu_show_registers(const struct vcpu *v)
     ctxt.ifsr32_el2 = v->arch.ifsr;
 #endif
 
+#ifdef CONFIG_MMU
     ctxt.vttbr_el2 = v->domain->arch.p2m.vttbr;
+#endif
 
     _show_registers(&v->arch.cpu_info->guest_cpu_user_regs, &ctxt, 1, v);
 }
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 12:25:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 12:25:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781075.1190665 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgkP8-0005iW-Pr; Wed, 21 Aug 2024 12:25:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781075.1190665; Wed, 21 Aug 2024 12:25:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgkP8-0005ho-MV; Wed, 21 Aug 2024 12:25:34 +0000
Received: by outflank-mailman (input) for mailman id 781075;
 Wed, 21 Aug 2024 12:25:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rYNs=PU=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sgkP7-0004Qc-Ag
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 12:25:33 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on2062c.outbound.protection.outlook.com
 [2a01:111:f403:2417::62c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 75181d4c-5fb8-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 14:25:32 +0200 (CEST)
Received: from PH8PR22CA0008.namprd22.prod.outlook.com (2603:10b6:510:2d1::20)
 by IA1PR12MB6649.namprd12.prod.outlook.com (2603:10b6:208:3a2::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Wed, 21 Aug
 2024 12:25:25 +0000
Received: from SN1PEPF000397AF.namprd05.prod.outlook.com
 (2603:10b6:510:2d1:cafe::c8) by PH8PR22CA0008.outlook.office365.com
 (2603:10b6:510:2d1::20) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.17 via Frontend
 Transport; Wed, 21 Aug 2024 12:25:25 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SN1PEPF000397AF.mail.protection.outlook.com (10.167.248.53) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Wed, 21 Aug 2024 12:25:24 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug
 2024 07:25:24 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug
 2024 07:25:23 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Wed, 21 Aug 2024 07:25:22 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 75181d4c-5fb8-11ef-a508-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=oudwCcprACAl0tUB4KWWBiBMhqr1PW9mBLxwggayDPkUnYZ/WX7kEy/fKl/P2s1Kq7ovvspxAp4NMbILjCkFuu5WYbW6mUooklom3INTeBN8OxE62kxe96Nsc9eWpXYLNx3xHTB5IhIE1jT4YS+HnuVhJ7cb/qA5lWYIi8Kxxm8J2XfA3svPjZe+iKGg5BCROqBwyoht0miUeLjLzuRirn0VlcMaRD9pBzN6agr72ziWfXpoxcwFi6aAYfIQ1TKffwQIMJNr9toNfKe0MGhALlfN+/8CYrUBfVgmKqs9SS20N7XoHimdnNRzNTJaqhewoqBN1C73Px+5pQXa8mzWhg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3qR+j28zT01ixWDL3qZTBCcQC9zkoG5HXJead8PRpjI=;
 b=g9WqkLpVQnmUmlpqByNztJwHBux1iwX3GOctPodUUtpHDg8P6iPMvaGS7vpBB3N6bOpBCJv2v7yGVzMjYMSOB8EpgiSCx6s2/LNW+s7ws4pIpS7gRoPtgFIrQmKhbKNb5Q7GUfQSF3TIcvWOlFWSNvri7l2jV422fcgFPtytX69oBpB1RJmdMUaBL8frcRKht/tSX/ojqQhDp9k+qB5nbG4vd4/pddXrRC/yJw0+8hcQUGemCqe2C4t5oo7vpXKQWb+HFarrg6x2P1myqpz8i68wx3wqsLOW+Q6cV3EWPtJSJzAiNaCi9hz0sY1i24zg+ms/qAXV47yD/VNPQ5QQQw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3qR+j28zT01ixWDL3qZTBCcQC9zkoG5HXJead8PRpjI=;
 b=0nUU3col59qbLpOgIHs09UPkmHMvN2FOWdnzr1QLvhH3T15X0gczOI5Et4bBVQ0/7aTxTsU6R19HR8b8Ur3KaLEG8iXF4es6B6x2GyRU3rB4CBWJjBV5baw3wb1lIgnaymLyYiJGWHiGaTXLA/vWm+H8YOxm1yyQ5/MR8BpObQw=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Penny Zheng <penny.zheng@arm.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, Shawn Anastasio
	<sanastasio@raptorengineering.com>, Alistair Francis
	<alistair.francis@wdc.com>, Bob Eshleman <bobbyeshleman@gmail.com>, "Connor
 Davis" <connojdavis@gmail.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Chen <wei.chen@arm.com>, Ayan Kumar Halder
	<ayan.kumar.halder@amd.com>
Subject: [PATCH] xen: make VMAP support in MMU system only
Date: Wed, 21 Aug 2024 13:25:03 +0100
Message-ID: <20240821122503.2315844-5-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240821122503.2315844-1-ayan.kumar.halder@amd.com>
References: <20240821122503.2315844-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN1PEPF000397AF:EE_|IA1PR12MB6649:EE_
X-MS-Office365-Filtering-Correlation-Id: 071592b1-1352-4fce-61e6-08dcc1dc5544
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|82310400026|1800799024|7416014|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?Qsi/YYQT2lBz9iFT1oJQH0xkb1rGJrLJ4wxuZ+qdbV759XtlLA5c8P0/XlF6?=
 =?us-ascii?Q?7VOZs1Eq6h3S9Y+Negq2Y6WfJaVJ+1XxCqLIwXM653/9yKUC5isAGBfZ3lHH?=
 =?us-ascii?Q?k6/0mECSeiUqPPQt9tptzOeRruHj86OsOND4zHoS/5ptqU9mlEKToEYJ6m8z?=
 =?us-ascii?Q?4LgJvHzUeNDhApvk2HBCu8s586wXn+VYk4KggfaZ3RMhOSTYfv6PsHEeaoUR?=
 =?us-ascii?Q?CQivgVFnUf2/HQEJaJH5+sDPuGLY7iqnqtjX67HgLnVctzIJphLKmNuPqwA0?=
 =?us-ascii?Q?mcTnzPtskcCi0YMdikLzOU+bBi3NqT2M+5sn4e0iFzVms2q8ZUI5EcQyER9x?=
 =?us-ascii?Q?FVYxymYdHzF0tb3n+7H9mJvm2/jGCTtpYUoX4au23sa6hD+8YKj//DgUdDYC?=
 =?us-ascii?Q?Tt1T9H/joYR8jQKfCNndjbaes63rmwjA02oPiIJanJba1N+fE3npaPq2kFSI?=
 =?us-ascii?Q?vB1+oRUKoHh5fPt4R6x0wS/GEyWt/ALw8cT1c7lE2QbUD7yf3m9e1rZ4f9GI?=
 =?us-ascii?Q?tZnXd+N6F298TMMaRR9AquHq+nG5urdmOvI+56jIjd+h4RTG1fo+lEohEz1y?=
 =?us-ascii?Q?PYKC8I4r1HmN8VapwYRdw57J/06RCCO+uVY3oLqwQR9DF87LWbDYeclc7huN?=
 =?us-ascii?Q?AF5LyvWn+HypeyDaiAqdjvA7LDAHNtGOFVJYqbe9ThWclLEJbYsyTn19dPWp?=
 =?us-ascii?Q?KonjadOTP0zNVhWNFtYdWh/eqBIvHyFVbZuGE5Ti7IxJRAiM9c6H/NdDZrxz?=
 =?us-ascii?Q?TzSCU4sgax4cTUXmE7hDMZa/zkE6RocT6pIqjcbKZltyaiMBucZPGqb+MReS?=
 =?us-ascii?Q?vsztR90St9SosSa3RxIKNqhE7HBeq0o/h7TYG2dnZIj2CLPg9xOue9DZ2boO?=
 =?us-ascii?Q?/U0LH74ju4KxWzJuEklPwTKO4LNq5+c//YniNUM2WYJU0589g3ATpROHtb2G?=
 =?us-ascii?Q?6Q4jBNgn95RjlWi0B1pWgctfOwWlOONXF/un9n7apghpIaCSqkTlCCmWgUEf?=
 =?us-ascii?Q?mFtcvUE67q924dIvVWWiBzlnVQ96DcXX6wc4ofi+58iFENCx30W/vtilDN3v?=
 =?us-ascii?Q?F6rx4B9Eyi2PNjXErKslXcxv3jKUsZhJEY6F6hcn/fVY73Ec0F8Ixj2oxFcr?=
 =?us-ascii?Q?EoviXqQkDCofmTW9T3dgHiy9Tl8yoIEhJaiCi72OWVnVp3vbqKiCGUzR3RZ/?=
 =?us-ascii?Q?6LSBIGu11w6s36WChbZxUMWZ8mnUbUmCOtqX80XIzeM5sWRdqV1+JPjQLHNa?=
 =?us-ascii?Q?5fLmzMMD//0AuAPE3UYE/2rY/vmFZU7Y0Bc7oROxvnxvbGq4r97RZsDj3iIc?=
 =?us-ascii?Q?YW7vubg/39zbOPGivNao8jDuf4cF4cWNqmdFcUGPIqCl/vjz1n0UL8oDxa+t?=
 =?us-ascii?Q?cfGbwE8zfuqTz/OT+oQ0J74+UUnsh3prfntXPxAcOY+M6LPalw=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(7416014)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 12:25:24.6497
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 071592b1-1352-4fce-61e6-08dcc1dc5544
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SN1PEPF000397AF.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6649

From: Penny Zheng <penny.zheng@arm.com>

Introduce CONFIG_VMAP which is selected by the architectures that use
MMU. vm_init() does not do anything if CONFIG_VMAP is not enabled.

VMAP is widely used in ALTERNATIVE feature to remap a range of memory
with new memory attributes. Since this is highly dependent on virtual
address translation, we choose to fold VMAP in MMU system.

In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
only support in MMU system on ARM architecture. And ALTERNATIVE now
depends on VMAP.

HARDEN_BRANCH_PREDICTOR is now gated on MMU as speculative
attacks are not possible on non MMU based systems (ie Cortex-R52, R82).
See https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability.

Also took the opportunity to remove "#ifdef VMAP_VIRT_START .. endif"
from vmap.c. Instead vmap.c is compiled when HAS_VMAP is enabled. Thus,
HAS_VMAP is now enabled from x86, ppc and riscv architectures as all of
them use MMU and has VMAP_VIRT_START defined.

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Signed-off-by: Wei Chen <wei.chen@arm.com>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
Changes from :-

v1 - 1. HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP.
2. cpuerrata.c is not gated on HAS_VMAP.

v2 - 1. Introduced CONFIG_VMAP in common/Kconfig.
2. Architectures using MMU select this config.
3. vm_init() now uses CONFIG_VMAP.

v3 - 1. HARDEN_BRANCH_PREDICTOR is now gated on MMU.
2. vmap.c is compiled when CONFIG_HAS_VMAP is enabled.
3. HAS_VMAP is enabled from x86, ppc and riscv architectures. 

 xen/arch/arm/Kconfig   | 4 +++-
 xen/arch/arm/setup.c   | 2 ++
 xen/arch/ppc/Kconfig   | 1 +
 xen/arch/riscv/Kconfig | 1 +
 xen/arch/x86/Kconfig   | 1 +
 xen/common/Kconfig     | 3 +++
 xen/common/Makefile    | 2 +-
 xen/common/vmap.c      | 2 --
 xen/include/xen/vmap.h | 2 ++
 9 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 21d03d9f44..323c967361 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -12,7 +12,7 @@ config ARM_64
 config ARM
 	def_bool y
 	select FUNCTION_ALIGNMENT_4B
-	select HAS_ALTERNATIVE
+	select HAS_ALTERNATIVE if HAS_VMAP
 	select HAS_DEVICE_TREE
 	select HAS_PASSTHROUGH
 	select HAS_UBSAN
@@ -61,6 +61,7 @@ config PADDR_BITS
 config MMU
 	def_bool y
 	select HAS_PMAP
+	select HAS_VMAP
 
 source "arch/Kconfig"
 
@@ -171,6 +172,7 @@ config ARM_SSBD
 
 config HARDEN_BRANCH_PREDICTOR
 	bool "Harden the branch predictor against aliasing attacks" if EXPERT
+	depends on MMU
 	default y
 	help
 	  Speculation attacks against some high-performance processors rely on
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index cb2c0a16b8..7f686d2cca 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -447,7 +447,9 @@ void asmlinkage __init start_xen(unsigned long boot_phys_offset,
      * It needs to be called after do_initcalls to be able to use
      * stop_machine (tasklets initialized via an initcall).
      */
+#ifdef CONFIG_HAS_ALTERNATIVE
     apply_alternatives_all();
+#endif
     enable_errata_workarounds();
     enable_cpu_features();
 
diff --git a/xen/arch/ppc/Kconfig b/xen/arch/ppc/Kconfig
index f6a77a8200..6db575a48d 100644
--- a/xen/arch/ppc/Kconfig
+++ b/xen/arch/ppc/Kconfig
@@ -2,6 +2,7 @@ config PPC
 	def_bool y
 	select FUNCTION_ALIGNMENT_4B
 	select HAS_DEVICE_TREE
+	select HAS_VMAP
 
 config PPC64
 	def_bool y
diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index 259eea8d3b..7a113c7774 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -3,6 +3,7 @@ config RISCV
 	select FUNCTION_ALIGNMENT_16B
 	select GENERIC_BUG_FRAME
 	select HAS_DEVICE_TREE
+	select HAS_VMAP
 
 config RISCV_64
 	def_bool y
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 7ef5c8bc48..1784f01aad 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -29,6 +29,7 @@ config X86
 	select HAS_PIRQ
 	select HAS_SCHED_GRANULARITY
 	select HAS_UBSAN
+	select HAS_VMAP
 	select HAS_VPCI if HVM
 	select NEEDS_LIBELF
 
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 565ceda741..90268d9249 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -83,6 +83,9 @@ config HAS_SCHED_GRANULARITY
 config HAS_UBSAN
 	bool
 
+config HAS_VMAP
+	bool
+
 config MEM_ACCESS_ALWAYS_ON
 	bool
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 7e66802a9e..fc52e0857d 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -52,7 +52,7 @@ obj-$(CONFIG_TRACEBUFFER) += trace.o
 obj-y += version.o
 obj-y += virtual_region.o
 obj-y += vm_event.o
-obj-y += vmap.o
+obj-$(CONFIG_HAS_VMAP) += vmap.o
 obj-y += vsprintf.o
 obj-y += wait.o
 obj-bin-y += warning.init.o
diff --git a/xen/common/vmap.c b/xen/common/vmap.c
index ced9cbf26f..47225fecc0 100644
--- a/xen/common/vmap.c
+++ b/xen/common/vmap.c
@@ -1,4 +1,3 @@
-#ifdef VMAP_VIRT_START
 #include <xen/bitmap.h>
 #include <xen/sections.h>
 #include <xen/init.h>
@@ -427,4 +426,3 @@ void *_xvrealloc(void *va, size_t size, unsigned int align)
 
     return ptr;
 }
-#endif
diff --git a/xen/include/xen/vmap.h b/xen/include/xen/vmap.h
index fdae37e950..c1dd7ac22f 100644
--- a/xen/include/xen/vmap.h
+++ b/xen/include/xen/vmap.h
@@ -141,7 +141,9 @@ void *arch_vmap_virt_end(void);
 /* Initialises the VMAP_DEFAULT virtual range */
 static inline void vm_init(void)
 {
+#ifdef CONFIG_HAS_VMAP
     vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end());
+#endif
 }
 
 #endif /* __XEN_VMAP_H__ */
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 12:36:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 12:36:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781112.1190674 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgkZi-0001EU-OI; Wed, 21 Aug 2024 12:36:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781112.1190674; Wed, 21 Aug 2024 12:36:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgkZi-0001EN-LU; Wed, 21 Aug 2024 12:36:30 +0000
Received: by outflank-mailman (input) for mailman id 781112;
 Wed, 21 Aug 2024 12:36:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zhuR=PU=bounce.vates.tech=bounce-md_30504962.66c5df4a.v1-7431de53ceb449429d65e95305e54f00@srs-se1.protection.inumbo.net>)
 id 1sgkZg-00019r-UP
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 12:36:28 +0000
Received: from mail186-11.suw21.mandrillapp.com
 (mail186-11.suw21.mandrillapp.com [198.2.186.11])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fbbb97f3-5fb9-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 14:36:27 +0200 (CEST)
Received: from pmta10.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail186-11.suw21.mandrillapp.com (Mailchimp) with ESMTP id
 4Wpm6L2v8yzLfH5Wr
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 12:36:26 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 7431de53ceb449429d65e95305e54f00; Wed, 21 Aug 2024 12:36:26 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fbbb97f3-5fb9-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724243786; x=1724504286;
	bh=Z+5IsVCfhNP07iFXr4NEdc8vMTe9QKmq6fNdWwknhoQ=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=Gmj5ETu91gsDh2kX/mQM5H+Wfz4cfzQ+rACQCEqgFl/xUImfGDMw5AUILZXGQow79
	 BWDTklowGX2GebA2JEaY8vPG/0r1I3m3rqFNyb7g20eyIJYFemgCRsdmaNxGkE2bwg
	 H+mRhZkTsgHSq9M4KWT4E1SIU+47m+e3LNI7eF8CWbxG09nIE1KSzis0pGdBQgkzAU
	 X1O6td0lp5izy3b7T+TAA2JhsR5VE+8jfMR5nTTJBXkM9wsL5fQ64olZVYDfLxq41G
	 4Rqj+wGtZbiZkXx8wyReYip5AaZClpSRFdzCBgVXGP86jT/NgnGTVmNemxfLH2GsxH
	 pV8j5mtUVSQBQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724243786; x=1724504286; i=anthony.perard@vates.tech;
	bh=Z+5IsVCfhNP07iFXr4NEdc8vMTe9QKmq6fNdWwknhoQ=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=OJtRR8Jw1gK7lPU+4qVLD2ODWc+JcUFwI/CbB0XERJc81gbASXi8FKCLqwhe9nOGg
	 ZkTCTCzqOZSBAZWMxYhksw1Xlz8MBcRV/iLlAgyuyO1meuKnC0xGPwJOv1Xz6+6N0v
	 IpDW/7AFpTPCX1gej3aNUM4T/i0QA29Hf7epOsLeNbxTB527a/fqRRxRo/oxlS2qg2
	 WNswCRoaaG7ulmZ8Wfuu5YHP/YDPrA/yJnO7DFEWejwMbX/fC9AGhcriBNvF/ONrbk
	 wnOK2MN3jnv11MHOfb+lo+Y1dskPGg7RlF6xx9xZ7qvnXr03//pphLG5W+qTRrw4iy
	 v7ES0O1XesDkQ==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=20v2]=20tools/helpers/init-dom0less:=20fix=20vcpu=20availability?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724243785920
To: Amneesh Singh <a-singh21@ti.com>
Cc: xen-devel@lists.xenproject.org
Message-Id: <ZsXfSdnbx2qhbuXp@l14>
References: <20240820080416.323725-1-a-singh21@ti.com> <ZsTDJhcfFpm23oHO@l14> <y46y7zqfepuvbw3tniqkr5yepcqbvkbyj6mfj3tj4p3ylo7pg3@23plq2f3jboj>
In-Reply-To: <y46y7zqfepuvbw3tniqkr5yepcqbvkbyj6mfj3tj4p3ylo7pg3@23plq2f3jboj>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.7431de53ceb449429d65e95305e54f00?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240821:md
Date: Wed, 21 Aug 2024 12:36:26 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Wed, Aug 21, 2024 at 11:08:59AM +0530, Amneesh Singh wrote:
> On 16:24-20240820, Anthony PERARD wrote:
> > On Tue, Aug 20, 2024 at 01:34:17PM +0530, Amneesh Singh wrote:
> > > @@ -330,14 +336,24 @@ int main(int argc, char **argv)
> > >
> > >      for (i = 0; i < nb_vm; i++) {
> > >          domid_t domid = info[i].domid;
> > > +        libxl_vcpuinfo *vcpuinfo;
> > > +        int nb_vcpu = 0, nr_cpus = 0;
> > > +
> > >
> > >          /* Don't need to check for Dom0 */
> > >          if (!domid)
> > >              continue;
> > >
> > > +        vcpuinfo = libxl_list_vcpu(ctx, domid, &nb_vcpu, &nr_cpus);
> > > +
> > > +        if (!vcpuinfo) {
> > > +          fprintf(stderr, "libxl_list_vcpu failed.\n");
> > > +          nb_vcpu = 0;
> > 
> > Is there any value to keep going if libxl_list_vcpu() fails?
> > Or is the reasoning is that cpu/*/availability was broken before, so
> > it's not important enough to stop init-dom0less?
> Yes, so missing cpu/*/availability nodes would mean we cannot
> pin/remove/add vcpus using xenlight I believe. However, we can still
> hotplug other stuff like net or block devices. In fact, I was doing
> exactly this when cpu/*/availability was broken.

Without the "availability" nodes, it probably mean that guest (probably
PV ones) will just use all available CPUs, it seems that Linux is doing
that, and only disable CPUs that are explicitly marked as "offline" via
that node.

But I guess it's ok.

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 13:02:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 13:02:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781129.1190685 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgkyI-0006gO-P9; Wed, 21 Aug 2024 13:01:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781129.1190685; Wed, 21 Aug 2024 13: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 <xen-devel-bounces@lists.xenproject.org>)
	id 1sgkyI-0006gH-M3; Wed, 21 Aug 2024 13:01:54 +0000
Received: by outflank-mailman (input) for mailman id 781129;
 Wed, 21 Aug 2024 13:01:53 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=YIGS=PU=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgkyG-0006gB-Vr
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 13:01:52 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 880f306e-5fbd-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 15:01:50 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5bed05c0a2fso5934438a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 06:01:50 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bebc0817a8sm8039087a12.84.2024.08.21.06.01.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 06:01:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 880f306e-5fbd-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724245310; x=1724850110; 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=0AplvF0ppKoObOqwGnY3FZwe6CCQm8OCyHkH7ScmqPc=;
        b=Fn0uTESsUYxF8x6byxzOimxGkaAX/QKp4bZimxirZXuxWU4J6aFJ6yybMZb0TcTpYM
         dtKF5n59R13icDfSJ8XcEmQNTqAWuFq9rMVQzwPg3Vsf5avPZ2Y9eDcv2ZyYuPg6hnT4
         +/NQ6EQ49aMJ/oiSApn0tQyU8lSZ/z83jWSXPSZKNZk7HXjXW8qT6J5ZXoGNTJVNMo6+
         TfZ0ooyGOLvbLJibfQXl2SRbzpva6geYH3f/nq95dul9zd+HWSq1mRKQBHuvS71Vp1R9
         3rKvsx08C09H00YKy3woNqOygO04RF4WsfNePWjEpvbngATu2fht61PY3BOKPEgtWD8i
         ayrQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724245310; x=1724850110;
        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=0AplvF0ppKoObOqwGnY3FZwe6CCQm8OCyHkH7ScmqPc=;
        b=BA/wfONE2BKBl7QVSulk/vqAGVjxX6TLoBPKtW+Z38Qo8t/b2iQH8g6YbtQ6m42k4c
         USbg0m2ZxVDkznUqSDXg4mwnYMr4G9fUUtiO7jNtMJT7bBaN4O4FQydKYuJCxyApljRG
         OjprrcamRrBFMRbCB3Nl41cPkma5yx4PTUaKMLDK+KP0jSYj05ScReIdUq9ZVIbJ4sLY
         vCOs55L2dG/yqpZQYh8EMmDbtQI7kGLfzg2WP8ZnZBeTDbSLU0jCaMJgzWXLPfSHVnJ0
         gOABzjI4QiR3oJpq698MTpSONXdKzV/3iFkTHeNxB0BU+ooMoXuLADswNd3pFlfo2Bgz
         /CCQ==
X-Forwarded-Encrypted: i=1; AJvYcCVvC/1c0z4w+EZ+n/a2Yoqne8E/XXGDL3T599RRlSmfwB7AbR3f10sMJiK/R93YfpNfHM29aN2W6+Q=@lists.xenproject.org
X-Gm-Message-State: AOJu0YztFthtM7qfSsO44sv2Q88L2lKYU46eqqExLA0hgGgJ46AZHxH6
	1GdpH44ordseHc9fTNesDqR0Ep34nCeV8rs4S6mFi+ubBxlJbTa+YGtuGDcqDA==
X-Google-Smtp-Source: AGHT+IHFyIxjviEv4J+FIf5OJPWzJrlasPdQ/fiXUrA5pikEKRe6JC5+5d+eZE+Pp86KnGYr55SkEw==
X-Received: by 2002:a05:6402:c4c:b0:5be:9d95:3910 with SMTP id 4fb4d7f45d1cf-5bf1f1d7509mr1703576a12.22.1724245310093;
        Wed, 21 Aug 2024 06:01:50 -0700 (PDT)
Message-ID: <7689a4dd-77af-405d-bee8-b0c03e8416ef@suse.com>
Date: Wed, 21 Aug 2024 15:01:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen: make VMAP support in MMU system only
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: Penny Zheng <penny.zheng@arm.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Wei Chen <wei.chen@arm.com>,
 xen-devel@lists.xenproject.org
References: <20240821122503.2315844-1-ayan.kumar.halder@amd.com>
 <20240821122503.2315844-5-ayan.kumar.halder@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240821122503.2315844-5-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 21.08.2024 14:25, Ayan Kumar Halder wrote:
> From: Penny Zheng <penny.zheng@arm.com>
> 
> Introduce CONFIG_VMAP which is selected by the architectures that use
> MMU. vm_init() does not do anything if CONFIG_VMAP is not enabled.
> 
> VMAP is widely used in ALTERNATIVE feature to remap a range of memory
> with new memory attributes. Since this is highly dependent on virtual
> address translation, we choose to fold VMAP in MMU system.
> 
> In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
> only support in MMU system on ARM architecture. And ALTERNATIVE now
> depends on VMAP.

There is a mix of VMAP and HAS_VMAP throughout here. Once that's sorted
I think there'll be redundancy in what is being said, which likely will
want consolidating then, too.

> HARDEN_BRANCH_PREDICTOR is now gated on MMU as speculative
> attacks are not possible on non MMU based systems (ie Cortex-R52, R82).
> See https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability.

I think that increasingly this wants to be a separate change. It's
entirely unrelated to what the patch's purpose is (or else the
connection isn't clear to me, and also isn't being made in the
description).

Apart from this the code changes look okay to me now.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 13:30:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 13:30:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781140.1190695 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sglPp-0003wG-ND; Wed, 21 Aug 2024 13:30:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781140.1190695; Wed, 21 Aug 2024 13:30:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sglPp-0003w9-Kf; Wed, 21 Aug 2024 13:30:21 +0000
Received: by outflank-mailman (input) for mailman id 781140;
 Wed, 21 Aug 2024 13:30:19 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=YIGS=PU=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sglPn-0003w3-Rt
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 13:30:19 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8175c379-5fc1-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 15:30:17 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-5334a8a1b07so669212e87.1
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 06:30:17 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8685bbf148sm10090766b.0.2024.08.21.06.30.15
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 06:30:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8175c379-5fc1-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724247017; x=1724851817; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=SQzdaAJqwsKkRCzMH6hE9eJ+kGq0/AQ6DRMTQETvXpA=;
        b=MP8eWd+zR9rtdye86xM0804DnBqbp0Qj3rgQyYCuIxy0g3umUec/bNCITJ8Yr7PC8N
         vEHNtDyKivo9e7d+ERdFNEPxhjx556J5OSYR+ecfD2dhfeO/ojs9nGgSYjEIif44VWAk
         38MRVWOm5KPdPPTGjCRW/KpcrDTKzwoULgw5X+QI1ipSFISw0GlxCK7FsnWXT44lynYP
         ByX/LBuye5qwb2IYlZQhWnDxzSeaw8imiF4fKP3sN5MWUi7pK8MCFIZBV9QbfQolplP8
         c/PN7dkfAsRPpvBk84DRcto2kXz2knXbixkr8s5WsLkd0C90aqFCtKckkaOz9axgiSyF
         m3pA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724247017; x=1724851817;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=SQzdaAJqwsKkRCzMH6hE9eJ+kGq0/AQ6DRMTQETvXpA=;
        b=UhJ+h5fu0eSDb0edsD6tZUoaTq8JBcBF4QS1ymQAEM0Bhoj1UOkI0O2QHZNWpR6gnA
         beye7uYNarlWr9At4Fa5z7Xw5vnokcrX4THNwUVX1C5RV6NNqkgTBwXYDNxLtydC3UnD
         dOatZflOqj7QVqqw0rgdLG+inYWI9+ZoWZDoXg0B7Hrwcnkt5jCjTihWQ5OmIMuoLurq
         wAWKRqBVh0ufB8LTa8szSHVg+EEo4pxg8WKcjuDpiPX9njmsWO8nDjMPg9cqhBjC382r
         yrje8ZRFi53poejCVxIa0cLqhIXt0KDQS7gnYUc5XFeUeheszBHebdXwvEHDq+6rsL4X
         4DgA==
X-Gm-Message-State: AOJu0Yz2a0iEu3T1E7QxSWcJ0qonDRzoas1kseom4nDICff8Q4JDQGgq
	Juq7+38LDivQXBTMHow2d8nKurcfodrC176e5G38tvOEiOjqxEFZj0ASPA+l1s8s2CEfhrU2C5s
	=
X-Google-Smtp-Source: AGHT+IEnzLb3vXctaLKOsGjmkRnXN2egx4hfjYjEsZo093Gv7pITOlG7aAo/aTXsOA/6RX7vLaH3fg==
X-Received: by 2002:a05:6512:4020:b0:52e:f950:31f5 with SMTP id 2adb3069b0e04-5334855443bmr1398911e87.18.1724247016905;
        Wed, 21 Aug 2024 06:30:16 -0700 (PDT)
Message-ID: <bfc9722a-cb6d-45d0-9351-ddfcd0bbb2e0@suse.com>
Date: Wed, 21 Aug 2024 15:30:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86emul: convert op_bytes/opc checks in SIMD emulation
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Delivering #UD for an internal shortcoming of the emulator isn't quite
right. Similarly BUG() is bigger a hammer than needed.

Switch to using EXPECT() instead.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/x86_emulate.c
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c
@@ -8114,13 +8114,13 @@ x86_emulate(
     }
     else if ( state->simd_size != simd_none )
     {
-        generate_exception_if(!op_bytes, X86_EXC_UD);
         generate_exception_if((vex.opcx && (d & TwoOp) &&
                                (vex.reg != 0xf || (evex_encoded() && !evex.RX))),
                               X86_EXC_UD);
 
-        if ( !opc )
-            BUG();
+        EXPECT(op_bytes);
+        EXPECT(opc);
+
         if ( evex_encoded() )
         {
             opc[insn_bytes - EVEX_PFX_BYTES] = 0xc3;


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 13:32:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 13:32:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781146.1190704 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sglS7-0004Tr-2b; Wed, 21 Aug 2024 13:32:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781146.1190704; Wed, 21 Aug 2024 13:32:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sglS6-0004Ti-W5; Wed, 21 Aug 2024 13:32:42 +0000
Received: by outflank-mailman (input) for mailman id 781146;
 Wed, 21 Aug 2024 13:32:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=QFRG=PU=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sglS6-0004Ta-CW
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 13:32:42 +0000
Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com
 [2607:f8b0:4864:20::82f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d63f5ee1-5fc1-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 15:32:40 +0200 (CEST)
Received: by mail-qt1-x82f.google.com with SMTP id
 d75a77b69052e-45006bcb482so33938811cf.3
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 06:32:40 -0700 (PDT)
Received: from fziglio-xenia-fedora.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6bf6fef332dsm61890646d6.124.2024.08.21.06.32.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 21 Aug 2024 06:32:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d63f5ee1-5fc1-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724247159; x=1724851959; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=Cn/bGe/oHUUjmOljNT3DkkYcezh2XDSyAST19X6GM9U=;
        b=dfH3R9t4w84ImMChzMkbe0zOprEzYXPOFvW44wLbe71aCKyI1si1wA/jlpLPjl41kv
         yJsLSxPNlGQKjgw9GOrLdkZ3MU2Moy8SwgQnGhkGuRYZhqwGtGW8yQ0NsPY1QrDPR3zw
         vSVTD8KO3UZF8Fr3yUkxatldIaGxB8H9a+A3o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724247159; x=1724851959;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=Cn/bGe/oHUUjmOljNT3DkkYcezh2XDSyAST19X6GM9U=;
        b=mm+7X+XW2n6M4rgsJexTEheKjvMKJSVsgN/+gGbZq/+TUBCybGwZgNulDK0M3Hi3RF
         cBiSbpHbvNi8KlENiJg8tsOCeDvXEp7I3Lbwq2k0DWLXq/ZQF5F3hcl96lmJS6HMsMbw
         QgONtLE/5qqkf/eUr4n5ma9XoySoVUX9f15a3l5vV3J6UqVg5FYsGTB7IUk+BkV+2CWb
         VF3sgF9M8pHHQUkC3n0oe0xg50GdZtNHs6MkdLeimKzvoENq4qzy5W47LLLt4alRlalA
         Pyde6cM2PdNVNE8tc3n5EESC0VKg1E9HO37BY1rvyeHU8ivEo6p1P7VxfvXgk5A1fC7S
         Grhg==
X-Gm-Message-State: AOJu0YxBpu47SgXKa2jqknVWKzpyx10G8qFtuquklHV+kVcQO59NCKEU
	GvQiOedKmN65o5HFF9gnj2b+NKxjLlElkZhYZpVXn+1MqwSA9oSlDhd83Lv0eKP/H3Yk9xawVbE
	H
X-Google-Smtp-Source: AGHT+IFWdhs+p8FzkWdlX7Rqq4rVGsyw+2EvGc5zCsnmN41WFHhxv12yyLCKE6AEMzqqWeLkCM2UsA==
X-Received: by 2002:a05:6214:3a85:b0:6c1:547b:418a with SMTP id 6a1803df08f44-6c155df40bcmr33700786d6.36.1724247159197;
        Wed, 21 Aug 2024 06:32:39 -0700 (PDT)
From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH] Restore memory used for IP computation
Date: Wed, 21 Aug 2024 14:32:22 +0100
Message-ID: <20240821133224.198923-1-frediano.ziglio@cloud.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

We need to write in some location but no reasons to not
trying to restore what we potentially overwrote.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/head.S | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index d8ac0f0494..3e1e9e05b6 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -418,13 +418,17 @@ __pvh_start:
          * absolute stack address as the native path, for lack of a better
          * alternative.
          */
-        mov     $0x1000, %esp
+        mov     $0xffc, %esp
+        pop     %edx
 
         /* Calculate the load base address. */
         call    1f
 1:      pop     %esi
         sub     $sym_offs(1b), %esi
 
+        /* Restore clobbered stack */
+        push    %edx
+
         /* Set up stack. */
         lea     STACK_SIZE - CPUINFO_sizeof + sym_esi(cpu0_stack), %esp
 
@@ -468,13 +472,17 @@ __start:
          * this page for a temporary stack, being one of the safest locations
          * to clobber.
          */
-        mov     $0x1000, %esp
+        mov     $0xffc, %esp
+        pop     %edx
 
         /* Calculate the load base address. */
         call    1f
 1:      pop     %esi
         sub     $sym_offs(1b), %esi
 
+        /* Restore clobbered stack */
+        push    %edx
+
         /* Set up stack. */
         lea     STACK_SIZE - CPUINFO_sizeof + sym_esi(cpu0_stack), %esp
 
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 13:37:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 13:37:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781157.1190715 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sglWt-0005lf-LW; Wed, 21 Aug 2024 13:37:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781157.1190715; Wed, 21 Aug 2024 13:37:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sglWt-0005lY-Ho; Wed, 21 Aug 2024 13:37:39 +0000
Received: by outflank-mailman (input) for mailman id 781157;
 Wed, 21 Aug 2024 13:37:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8p22=PU=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sglWs-0005lS-4b
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 13:37:38 +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 8740f834-5fc2-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 15:37:37 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5bede548f7cso5014040a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 06:37:37 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bebc082f4dsm8027521a12.96.2024.08.21.06.37.35
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 06:37:35 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8740f834-5fc2-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724247456; x=1724852256; 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=xESqlmMQF0xXVhUIs+bUmuxM5tVQ1mjDpSdiLeJCXqI=;
        b=Cvcdz41rh+E/aCafT7WbSj9/vbnJ+NjlXXIa8c2oQ81lwxEipxnD7khEkuYtBuVg86
         O50OgNm/nDJvo9I3iA+Yfn4A29Yakjfhgv58o9sUOw+/17mmyHV2/4+ItvPIyRUJw5gR
         ADIaZCGIOOW9sTe2f4lhlqMeKeuRoCGj4QddQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724247456; x=1724852256;
        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=xESqlmMQF0xXVhUIs+bUmuxM5tVQ1mjDpSdiLeJCXqI=;
        b=lsqN2Q5K2NqbykaEWw2Ha+6v3mSRf+kqSlXtu5GwvSBviqDUH8o48SPkz+pJoSorFG
         G7vYr6slh50+cMYrhqZPLy2wq0e1BwCNNcs9gM8HkP6yME9sISWovhOoE5M6UccQdjfB
         ffLkYz/NYdaSsD2xI/gNJ8+zvPRgRyPZSjrU61J28aQBqcLvjVjPx/EAbEJOJWn80dDJ
         iRUjxvRBFOhX5SoSC7LVyQckJvshRjhFUrHYP1j6mILOBBzFXu7noYSOCVGySQXmKHXu
         bFijmAFKFwv8Md01vtxANcD23xvj2DAAJ8Fzf/PE9S0S86h+2X+c6E+vwXCjbjhurqbE
         lKVw==
X-Forwarded-Encrypted: i=1; AJvYcCU8TRtbkUFXxyoVHNjTZ9E7xZieo+ODnHO6xLHMUSM/4vpGRcq4EVUJROMG8S9jR82nuW0PI2Q1wfg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyeRqjDRq9C412omjC/yZDRTV1kq+yrEvPs6ZzQhdWIdwjJy30Q
	PWHa/8InEUu6oQ96V989lLmkMxlsPSHziBXErKdorSE7CIUi4hLkk8ANdt1WAxhDrtXnyQxwN91
	b
X-Google-Smtp-Source: AGHT+IGLsb39DSqGUdswreBXVsaVmk6mdvPNZkqzNW1ne8hgoSpL0JzQkYKtkG8rQHVzl9yajMIrWQ==
X-Received: by 2002:a05:6402:4310:b0:5be:dd80:2038 with SMTP id 4fb4d7f45d1cf-5bf1f15fb48mr1641865a12.22.1724247455903;
        Wed, 21 Aug 2024 06:37:35 -0700 (PDT)
Message-ID: <e96daf14-f1ea-4590-baab-62be50f8d54b@citrix.com>
Date: Wed, 21 Aug 2024 14:37:28 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: convert op_bytes/opc checks in SIMD emulation
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <bfc9722a-cb6d-45d0-9351-ddfcd0bbb2e0@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <bfc9722a-cb6d-45d0-9351-ddfcd0bbb2e0@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 21/08/2024 2:30 pm, Jan Beulich wrote:
> Delivering #UD for an internal shortcoming of the emulator isn't quite
> right. Similarly BUG() is bigger a hammer than needed.
>
> Switch to using EXPECT() instead.
>
> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

To confirm, this is ASSERT_UNREACHABLE() (which fuzzing will now notice
as an error), and unhandleable in release builds (which ultimately ends
up in #UD)?

I think it would be helpful to at least note the fuzzing aspect in the
commit message.

>
> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
> @@ -8114,13 +8114,13 @@ x86_emulate(
>      }
>      else if ( state->simd_size != simd_none )
>      {
> -        generate_exception_if(!op_bytes, X86_EXC_UD);
>          generate_exception_if((vex.opcx && (d & TwoOp) &&
>                                 (vex.reg != 0xf || (evex_encoded() && !evex.RX))),
>                                X86_EXC_UD);
>  
> -        if ( !opc )
> -            BUG();
> +        EXPECT(op_bytes);
> +        EXPECT(opc);

This is the only BUG() in x86_emulate.c, and it's right to get rid of it
IMO.

Therefore, we should have a hunk removing it from
tools/tests/x86_emulator/x86-emulate.h too, which will prevent
reintroduction.

Maybe even undef BUG somewhere in x86_emulate/private.h?

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 13:43:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 13:43:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781164.1190725 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sglcU-0007Ed-9F; Wed, 21 Aug 2024 13:43:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781164.1190725; Wed, 21 Aug 2024 13:43:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sglcU-0007EW-4o; Wed, 21 Aug 2024 13:43:26 +0000
Received: by outflank-mailman (input) for mailman id 781164;
 Wed, 21 Aug 2024 13:43:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8p22=PU=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sglcT-0007EQ-Ai
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 13:43:25 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 56650045-5fc3-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 15:43:24 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-530e062217eso8976355e87.1
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 06:43:24 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a838394725bsm895284366b.168.2024.08.21.06.43.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 06:43:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 56650045-5fc3-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724247804; x=1724852604; 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=wLNx/3ZLdlBxFIUJJAA0DN6y2k/tuu2kLT3hqVJewJ8=;
        b=bEy+4IrBHPPGaQaRhony9iDv5d/CLEc6LPa9vbQN21yGK8k+MNuQVlD/e0Hw7Dv5Uc
         dBIGvcKV1oBXx6K4iTEQzIfg5yQQtZ1MGRa5LBfwTtZ1lZfRGw94x4nLFjWUbB14ki7O
         vBwS3O0qeM45ba/zVhAUu+jG7aUJTz6EsgYpk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724247804; x=1724852604;
        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=wLNx/3ZLdlBxFIUJJAA0DN6y2k/tuu2kLT3hqVJewJ8=;
        b=oJhmL4p60iSXyXEcb+gcqHbHd4Buqiod9TWCiUqzDP8SwN43abDaq+u4usxx48TNgT
         vd856es4KNLQ1Td0qzCrV79vLWPXcuibhyKSiZw+dxUEg4s4+1lsnch6k19JsnGFGDrs
         LnBX/tjvbFY4+BOs9i4Z4P22AhtZ1BXycWRxWN/3osocflK5eUK0HtGcqhPUXSra6eFc
         +sOFrp6bMpH8NDJjWqYPJauk4xpQR3xlZLajR1KZAMlOkLIwayT1+kCkEo0gRljOpOPB
         p+apIVRQUkGD9qGkg+/FdLdd2EA8a0bCW7nbk1aXZPVsAss0jV0NKo33ko+GUv36I9dr
         7NHQ==
X-Forwarded-Encrypted: i=1; AJvYcCX0S9JobxWS0LYMIgrUMBoEwzvskF9JABqLE5x6BzxdCmDbFUgqP2GiynXL8dj1ycwO6ZU9Ojl5650=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwgO6XUOEgc+ZjQxckhtd34whIY2Ixw70pSeQvP4QWOAn7W6kIK
	LqcgIPJHjj6johuR1ezTcGkuMAvj44uFCTK4dKw/LCLmIGV1z+7kebdbx40UOl0=
X-Google-Smtp-Source: AGHT+IE2i0rJoayLOtYsYaTmcAlkki3ObFNJZJkZt89tA8PEN5oRGgc01GYjdDLyC967L1gb8oSR0Q==
X-Received: by 2002:a05:6512:a90:b0:52f:cd03:a813 with SMTP id 2adb3069b0e04-533485fc9d2mr1257819e87.54.1724247802857;
        Wed, 21 Aug 2024 06:43:22 -0700 (PDT)
Message-ID: <ff590b58-3067-4886-a9e1-1e2e63ff4100@citrix.com>
Date: Wed, 21 Aug 2024 14:43:20 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] Restore memory used for IP computation
To: Frediano Ziglio <frediano.ziglio@cloud.com>,
 xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>
References: <20240821133224.198923-1-frediano.ziglio@cloud.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20240821133224.198923-1-frediano.ziglio@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 21/08/2024 2:32 pm, Frediano Ziglio wrote:
> We need to write in some location but no reasons to not
> trying to restore what we potentially overwrote.
>
> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>

Please follow how Linux does this.

e.g.
https://lore.kernel.org/xen-devel/20240814195053.5564-3-jason.andryuk@amd.com/

Specifically, ...

> ---
>  xen/arch/x86/boot/head.S | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
> index d8ac0f0494..3e1e9e05b6 100644
> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -418,13 +418,17 @@ __pvh_start:
>           * absolute stack address as the native path, for lack of a better
>           * alternative.
>           */

... the reasoning in this comment here is incorrect for non-BIOS
systems, and causes memory corruption for Coreboot based boot.

I've been meaning to fix it for ages, but seeing as you're changing it... :)

The first field under %ebx in a boot ABI we recognise is a much better
choice that an arbitrary location in the first page of memory.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 14:52:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 14:52:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781215.1190754 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgmgs-0003hC-Hv; Wed, 21 Aug 2024 14:52:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781215.1190754; Wed, 21 Aug 2024 14:52:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgmgs-0003h5-FD; Wed, 21 Aug 2024 14:52:02 +0000
Received: by outflank-mailman (input) for mailman id 781215;
 Wed, 21 Aug 2024 14:52:01 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rYNs=PU=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sgmgr-0003gu-1Y
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 14:52:01 +0000
Received: from NAM04-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam04on20608.outbound.protection.outlook.com
 [2a01:111:f403:2409::608])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e9216ba6-5fcc-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 16:51:57 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by MN0PR12MB5715.namprd12.prod.outlook.com (2603:10b6:208:372::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Wed, 21 Aug
 2024 14:51:47 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7875.023; Wed, 21 Aug 2024
 14:51:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e9216ba6-5fcc-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=cgYvGeBdTmpWDm+G+fQLbOvs2fgjPz56iII2XX+iiV+hIlT8VuXzcgpcpkn5eT1gOcZBQH9GvLIyLf7a++LVBpNc9KRXAIInTRzF/VHCi9wx4aQjokjkqGXqTFiQR0Ps467THrK8SCXR98av9wNwNkCsU+N189bMR0qwhX076kcwLzw5wdqpGPqMzH00Sh/qnuE8W3nIPQHLHWt2dNOSdXrXFPPY+4ODr5dUIFJZqKB80JIyxycSusmJiR7OUvvcsw0S0BSHyuyhox+hbORhVrpfGWADHk1wTXZ9YDqvQbIwiaK8lxTnpbulpLKPfavzSyS3G6X+uHavAAaBlEmdXQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=qg4ZFM6gKZ3xBxxDQNmOY9dRJCqdzaYEwg06g8ycGbc=;
 b=gqsiNozrE8zhzew1MlerhkDrTANGbfLYoU4yh/7vALrKCj8FHYEeGnGrkOjz/w22vVi6o6sit1ldw9Tyn5qvIzR2zsDxp4B4tZdlLXaRTxJUrF9VGhhb8exJysSJnk1en43Uyigz+9T3ll7jZqqwJOruNtMbZJvwXJvpFD1SLOnV0OahDIOlSHCqMUuHBR3EYEIuSaIPAOjGjnIeaFHEh2YK0rQ2sN9ULYPb1asrGH9kE1L7J/eFH3PgR0keLfTO+cmyY8PGFrjqwarxmIGoxsJi1bQBZ7uVBFSZVTJktlz42IrCmEQmGbZXOTNAB9GrcfNN408q52f65lB1ZIDFOQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=qg4ZFM6gKZ3xBxxDQNmOY9dRJCqdzaYEwg06g8ycGbc=;
 b=UHjPSqxiGtSuBpEsFdTgsiBez1iyY6NPIWNzLnaYqDg6IToJQbQpnIsTozUjgTFS5IVqHyoSECkfQjqWyIuHVZg3sj8ZH9UTYrPChAuLlfkCHEHI9RYR7c35y+fCQsX/X7qPeOuhYl8ka9OylbOEPRh6v9N6WoOL2YBB99m6WhQ=
From: "Halder, Ayan Kumar" <ayan.kumar.halder@amd.com>
To: "Charles-H. Schulz" <charles.schulz@vates.tech>, xen-devel
	<xen-devel@lists.xenproject.org>, Xen Project Advisory Board
	<advisory-board@lists.xenproject.org>
CC: Kelly Choi <kelly.choi@cloud.com>
Subject: Re: Setting up the Xen Communications Team
Thread-Topic: Setting up the Xen Communications Team
Thread-Index: AQHa8hy4XFDLZqdmk0S+qmGEw+aHmbIxzoyk
Date: Wed, 21 Aug 2024 14:51:45 +0000
Message-ID:
 <PH8PR12MB7326CC5D9546BE7CBD8CAF7DBC8E2@PH8PR12MB7326.namprd12.prod.outlook.com>
References: <e56ff82c1a1d7398a5b38784fc84a7adf51ec918.camel@vates.tech>
In-Reply-To: <e56ff82c1a1d7398a5b38784fc84a7adf51ec918.camel@vates.tech>
Accept-Language: en-GB, en-US
Content-Language: en-GB
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: PH8PR12MB7326:EE_|MN0PR12MB5715:EE_
x-ms-office365-filtering-correlation-id: 3cabe7cb-7f2f-4588-d0fe-08dcc1f0c6e3
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|366016|376014|1800799024|38070700018;
x-microsoft-antispam-message-info:
 =?utf-8?B?NTAxczNLbTZyQzZHSTlMVXlOTnNpS1U5ZlBlUThWOTNyd0FBTCtpTkpSTTVY?=
 =?utf-8?B?bGxnTTVPOXVUUHVUTlFKVXQ0RlNkMEgvc1FsRnRtc0UvNTdhU05vTkNPZHY3?=
 =?utf-8?B?c0RJRzdTS0o4b0ZzM2FNT3VPdVZyZnByQWYrSnM3UVBEVDJ5bmpiM2xLM2RQ?=
 =?utf-8?B?bDdoQ3B1eWc4dk9uV3IxaDBsejlxOEhjUjAzMEJDc3c4ZUVNVVlmQWJ6S3hs?=
 =?utf-8?B?VEZSNjB3NEFhY0dBZHJ2S2lGTGwyb2RxWVVLUHN5TDR2bkZwaTVINEN0bUNW?=
 =?utf-8?B?Z1o1UlZNdUZKVkhWcTlsSEdaM01jVEJpS3FSQ3RLOFJ5WElUSHdDdE0zeTB4?=
 =?utf-8?B?RWVTUG16emJlS0pQcHhEdWxSZFBIUnNzRExjSVhzQkJUNjdiY05FNFF0Um00?=
 =?utf-8?B?NEFOYnNHYkdkK3IvK1dNSXBHRm9IOXcxeGxmZVNiY29yT1dnN20xZG1pNEZ4?=
 =?utf-8?B?Zjg1OXBQWnhCby90cGFQVERGQWhMWTZlSEo0a2VwVDJTUWd3eHZWTEZCVGpi?=
 =?utf-8?B?OTltQ3RvM0x1K0FyREk5RzNqRlQ1ZjhXanZUSnFIbEg5VEdtRE1JQ2hjbjhj?=
 =?utf-8?B?c3hzZVhUcEdicGhMdUZIYXI5bzVaR2VFNENlYmFtNEMxdkpuZWxXZkVEWGdX?=
 =?utf-8?B?OUNhaVUvOHpTaTFWN2FXY05nMnpRK0JPUFAzL3U2Q1ZlTmpQS0gvbWpZclFv?=
 =?utf-8?B?b2xpSmpxMWNjcUt6N2VTWHRVK2FGeVZpS2tYdUx3Qld3dlZxMTJOa0VlbXZR?=
 =?utf-8?B?TGNzcm1icXVWNm5wYnJMUG5PZjJSSzFGaFRvZk5XSllqNklVT3Q5QXc1bndE?=
 =?utf-8?B?Zkl5bUhUTmprR3JZckt4YlNyd0VyRXBKQjBsVWU2UzJ3N0xqOTR4cU9oVVhI?=
 =?utf-8?B?WlA0akVjVWRaR2p5TUZrbEhyOGMyYU9NaDYvWHliam51UlF4Wm5Vck5iZ3FN?=
 =?utf-8?B?UHFzNytTaE5neFVCdjBZSm9iM2swamVKN3pFQTdJajI2aFphWTdNOGJ4cysx?=
 =?utf-8?B?a0Q5YmpTSkFPQXdmOE9rVzVPY3dhV1pRYUZTYkNFOG1XOW94L0FHaGkrZmJX?=
 =?utf-8?B?MTBNOE5EeTYyd0c2Y3cwSTRGZHJvdU1obWpHSEN1UEp1UDNrdENDTUk4VUp0?=
 =?utf-8?B?RzBGMXlvdXlxTXYyNFcxRUt5d09UZWZGOUEwZmVKMERaV2YvZmY1UWgzcEdk?=
 =?utf-8?B?MFhUeFVPNk9MdFZhOVlJYVFUTW1JV0JJekJ4Y1Zrc090SUtOVFJ3K2xFc1I3?=
 =?utf-8?B?NmpnNTY2VWw5UytWZ2NEWFJPQkQwb294RU54WFp5TWJoR1Q1TllaRG9pbWJD?=
 =?utf-8?B?ZnREVWFJSURFWWRBYmM3SGorcGJtZHZUZWZpZ1FJODg3aHNXay9Ma0hUWUIx?=
 =?utf-8?B?bEVzNDJhREtzYnQvaVFKeThud09lZnVKSmtWM3pWaDZtSlE5VGZLY29pNEZU?=
 =?utf-8?B?Y2EvLzhodVo1Q0xRUWRxd2piRG9MbXpYQVF3dW5ZMkFIdHFUZnpZdjNDN3lz?=
 =?utf-8?B?SytlTEEzdk5PZlhBNUFhVWR0QkpKdEJoQXNNb3JBd20vbUZpNDRoOFhuUDFu?=
 =?utf-8?B?ZmFzNGw5VXRJT24zdzVqV2FpdXBnYjZoL2thV09YS3UvVGpUV25UdEhHRFpY?=
 =?utf-8?B?SUYzSWNXejhBVW5KZ1NHUVcvcGtSOVM1alRXM2Y4YjErM2tKUnhVR3huNmwy?=
 =?utf-8?B?YXBFcm9XOEpRWEVJOENkelRzTGQzNTlMM0FQNHE5NU51cmJWLzNhWU0vU0I1?=
 =?utf-8?B?azVtaU1hbGtBYVQzNEhId09KSHNsdmljKzVxODNEeVM4VVg2ejRsbFZCQXI0?=
 =?utf-8?B?R3F4MXFPUkhEVy9IVkVYcXpZeENHQVR6N0tPUmhRSXVSK0wra0YxSEIyMHhm?=
 =?utf-8?B?NWtETFRuc0hFUGNNb1JhN0w2RlFDVTFabm1LRmNPMGtNSEE9PQ==?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?MmpvbUJmY1o3NzZWeURyZUgxanpYT2FMN2U3NUY5M2t2R2E1MnVCamJWUm96?=
 =?utf-8?B?VU1ydEdxdHd4OGtwS0dYZjB4NlBLbDBsMEdHdElyNFlpbFFCNERBZ05aMXI1?=
 =?utf-8?B?RWpTZS9ZTmJGSWVkYnR2THJ3SHdFZVFGL1NGWEptdWp0UVJoaDdwSWIwYnBM?=
 =?utf-8?B?dVZmdjF3ZTREMVMwODVGTVI5SWc2R0owK0EzQStaWWtiamR2RHIxd3lIUDdI?=
 =?utf-8?B?bncxWWk0MkJBV0hnTzBkTHdKSTJmaG1zcXFTNEZjQVB2aWtpN3ZUTk01MWEy?=
 =?utf-8?B?cDloSGxzWWgzOVg2MVFNZkpwcDhEZnpQb3M4L0NDY3VtN2FsRC8yU3BUOUc4?=
 =?utf-8?B?citFY2JyUHpTQy8wdWNXa05LNEk1cDJxZzJKZlk3eFFLTno4UmE2M3dVeVdw?=
 =?utf-8?B?WmJNSnpyNmNXbC9zcDdZZGdaelBzbEoxOFRRbVhETEdoQVIxN1pKVFhEWDlw?=
 =?utf-8?B?QndBVHhEZlhFWTlwNmZLSERxaTc4Z3VRVEVDODRKVFJSS0Z3aVhpampMQWM1?=
 =?utf-8?B?ekxETE9SZ3BsbHBmalBBbWlzUWZYNy96K2g2UkVuQlk0MURIT09iV2FUQzJz?=
 =?utf-8?B?ZlVZWHRtVDNXY2ZrQWdvV296WmlveTZzSC9aWmpvbFNYTVBObHg2a3dvcHk4?=
 =?utf-8?B?VFdNZVcwcFlCTDVJcnRlQkFvZ2VWN3RIeUFWNGRNZjh6WmpLWUpINHhlYi9X?=
 =?utf-8?B?Z29BL2RzZjRYMFlxaTlsTmJ2TThEZk4wOUk1SmpPQThWMWZNL2ZVckVFelVx?=
 =?utf-8?B?Mml6d25tUGE0dmp3d1MxMXJXTzNFRVVIUG8vaEE5U2svekNyUkh1TkdLMXha?=
 =?utf-8?B?MHlGNGdscFdRajlaOXYxQ2tQWmttdFhLMWUwTGhVSU1ReWoraXhhQUxzTUM3?=
 =?utf-8?B?aG9UR2crYmRoaFNxRFNIWUpPMzZEZFF1VVA3RzlDTXdvMDYyTFZQRm5KQ2tl?=
 =?utf-8?B?SUNZY3NzVVU3OHFURkxaL0tEbWNUMFVGUllHY0FhTmt1RHBkanZtTGRNYVBl?=
 =?utf-8?B?TGVWcURyTXhFTzhaQU8wajFabkplTFpML2prWmVCVEM4ZkNsTE5sKzZZLzYy?=
 =?utf-8?B?TkZ0ZitIdDAxZytNTXBnQ2FmN0xvck0vWFZuZ0toMzlyWHpKV0NOcjJBWTQ0?=
 =?utf-8?B?OHhGa1RsaTZrcGM1UFlQMjMxbTJLcXZ2VitSOGx6STMyZXlJV2F0T0g3SDBm?=
 =?utf-8?B?emZFSXhPOGlHMXVyazFnUERUVnNPTTN2b1lyZmwxM3pIeENUd2xHdXpOVER3?=
 =?utf-8?B?R1dEOUZJcURMNUllbENndTlmZG05T0pVK21HdFB0UHpqUU9nVXRRSnhnRENH?=
 =?utf-8?B?aEF3c2JyOUxaTkdnS21qYjBBNlV6MmxRR0FmT1c3ZHo5Z3RnclBPN2ppQnk1?=
 =?utf-8?B?dm1vR2hOL0R5YzlqS3ZVUTdsWDZNWGIraXBVUFlOQ0R4TXJENGFSdk1hK05S?=
 =?utf-8?B?NmcwRHRBcWtCWGNscmlDQjBJd3g4KzVmUDlhZlFxYTlNZU5BeUR4RDBBdEF1?=
 =?utf-8?B?UmJrTDE3TU9ZYmZyTk9qNVptMVFjcjNBV2dFTjhJY2ZBNHBTWVdqQ1lkZndm?=
 =?utf-8?B?VUpIbm9sbnBlMndCbWFoak5oMmhYK3VQck9DdnJzb21zZDN0cU9NWTlaVUlR?=
 =?utf-8?B?NUdTaDNCUzZrMVRsdWRNZW9ESVhEU01ubXlmVDJtV3lBd0pqaTh3QVlxSnJC?=
 =?utf-8?B?VHJTdFlGUWgzQlpaRk5VVVVEWkhMVkN6U1U5S1VocnRWNXowR0RnNGFPVHdS?=
 =?utf-8?B?bnprMXkrUEV4U1hVblU3a0paZG1kM3Q1Y3BNWlZoSVc5dEhIbVBqU3pmcXo0?=
 =?utf-8?B?MThEeTdxV2g0YXVGUXBRSXgraUlPUG5FbkM3RU15eGFCa1pLMStHVlNUeXVV?=
 =?utf-8?B?eDZMdEdCRzBIb1B2Sm9SNlNTNWR4SFBvRzcwYTVXeWQwaVVPeGY1OFdUKzM5?=
 =?utf-8?B?YnBiZTR6bHFTenBLbDhXL2ZDeHZLNnFacmtLRUNxZENwcDZqTTAwSE5ZVmdC?=
 =?utf-8?B?akxoVGtuSGJTN000aTJhK25VekJTaUFUeUdsa0RDRmxONGNxeC9iU3QvbVdW?=
 =?utf-8?B?U3pobGZsSTZrK0Q3QzlIMU43TDI1MDFJYVRzZ3BnYnowUUhqMVYzSUV6ckFB?=
 =?utf-8?B?QVVIdit2d0tqWFI3Rkw0VERaU3hDQWRTTmJBR05vYWVVQ1EwU1ZEVUpURWZP?=
 =?utf-8?B?c1E9PQ==?=
Content-Type: multipart/alternative;
	boundary="_000_PH8PR12MB7326CC5D9546BE7CBD8CAF7DBC8E2PH8PR12MB7326namp_"
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 3cabe7cb-7f2f-4588-d0fe-08dcc1f0c6e3
X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Aug 2024 14:51:45.2699
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: y8rhF4NYMXEpUX42OJSjoQdH1aYOI2xRXwWZQA8K216aM4RkLgoyZhoKdiPHSDhBFW/8lUPqFpysNy/xBO4T0g==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5715

--_000_PH8PR12MB7326CC5D9546BE7CBD8CAF7DBC8E2PH8PR12MB7326namp_
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64

SGkgQ2hhcmxlcywNCg0KVGhhbmtzIGZvciB0YWtpbmcgdGhlIGluaXRpYXRpdmUuIPCfmIoNCkkg
d2lsbCBiZSBpbnRlcmVzdGVkIHRvIGpvaW4uDQoNCktpbmQgcmVnYXJkcywNCkF5YW4NCg0KRnJv
bTogQWR2aXNvcnktYm9hcmQgPGFkdmlzb3J5LWJvYXJkLWJvdW5jZXNAbGlzdHMueGVucHJvamVj
dC5vcmc+IG9uIGJlaGFsZiBvZiBDaGFybGVzLUguIFNjaHVseiA8Y2hhcmxlcy5zY2h1bHpAdmF0
ZXMudGVjaD4NCkRhdGU6IE1vbmRheSwgMTkgQXVndXN0IDIwMjQgYXQgMTA6NDYNClRvOiB4ZW4t
ZGV2ZWwgPHhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZz4sIFhlbiBQcm9qZWN0IEFkdmlz
b3J5IEJvYXJkIDxhZHZpc29yeS1ib2FyZEBsaXN0cy54ZW5wcm9qZWN0Lm9yZz4NCkNjOiBLZWxs
eSBDaG9pIDxrZWxseS5jaG9pQGNsb3VkLmNvbT4NClN1YmplY3Q6IFNldHRpbmcgdXAgdGhlIFhl
biBDb21tdW5pY2F0aW9ucyBUZWFtDQpIZWxsbyBldmVyeW9uZSwNCg0KSnVzdCBsaWtlIGFueSBt
YWpvciBGT1NTIHByb2plY3QsIFhlbiBuZWVkcyB0byB0YWtlIGNhcmUgb2YgaXRzDQptZXNzYWdp
bmcgYW5kIGNvbW11bmljYXRpb24uIFdlIGFyZSB1c3VhbGx5IGZvY3VzZWQgb24gc29mdHdhcmUN
CmRldmVsb3BtZW50LCBob3dldmVyIHdlJ2QgbGlrZSB0byB0YWtlIHRoZSBvcHBvcnR1bml0eSB0
byBjYWxsIG9uDQp3aG9ldmVyIGlzIGludGVyZXN0ZWQgaGVyZSB0byBqb2luIHRoZSBzbWFsbCB0
ZWFtIGluIGNoYXJnZSBvZg0KQ29tbXVuaWNhdGlvbnMuDQoNCldlIGRvIG5vdCBleHBlY3QgdGhp
cyB0byBpbnZvbHZlIGEgbGFyZ2UgYWRkaXRpb25hbCB3b3JrbG9hZC4gSWYgeW91DQphcmUgaW50
ZXJlc3RlZCBpbiBqb2luaW5nLCBwbGVhc2Ugc2VuZCBhIG1lc3NhZ2UgdG8gS2VsbHkgb3IgcmVw
bHkgdG8NCnRoaXMgZW1haWwuDQoNClRoYW5rIHlvdSwNCg0KLS0NCkNoYXJsZXMtSC4gU2NodWx6
DQpDaGllZiBTdHJhdGVneSBPZmZpY2VyDQpWYXRlcyBTQVMgLSArMzMgKDApNiA5OCA2NSA1NCAy
NA0KDQo=

--_000_PH8PR12MB7326CC5D9546BE7CBD8CAF7DBC8E2PH8PR12MB7326namp_
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: base64

PGh0bWwgeG1sbnM6bz0idXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTpvZmZpY2U6b2ZmaWNlIiB4
bWxuczp3PSJ1cm46c2NoZW1hcy1taWNyb3NvZnQtY29tOm9mZmljZTp3b3JkIiB4bWxuczptPSJo
dHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL29mZmljZS8yMDA0LzEyL29tbWwiIHhtbG5zPSJo
dHRwOi8vd3d3LnczLm9yZy9UUi9SRUMtaHRtbDQwIj4NCjxoZWFkPg0KPG1ldGEgaHR0cC1lcXVp
dj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9dXRmLTgiPg0KPG1l
dGEgbmFtZT0iR2VuZXJhdG9yIiBjb250ZW50PSJNaWNyb3NvZnQgV29yZCAxNSAoZmlsdGVyZWQg
bWVkaXVtKSI+DQo8c3R5bGU+PCEtLQ0KLyogRm9udCBEZWZpbml0aW9ucyAqLw0KQGZvbnQtZmFj
ZQ0KCXtmb250LWZhbWlseToiQ2FtYnJpYSBNYXRoIjsNCglwYW5vc2UtMToyIDQgNSAzIDUgNCA2
IDMgMiA0O30NCkBmb250LWZhY2UNCgl7Zm9udC1mYW1pbHk6QXB0b3M7DQoJcGFub3NlLTE6MiAx
MSAwIDQgMiAyIDIgMiAyIDQ7fQ0KLyogU3R5bGUgRGVmaW5pdGlvbnMgKi8NCnAuTXNvTm9ybWFs
LCBsaS5Nc29Ob3JtYWwsIGRpdi5Nc29Ob3JtYWwNCgl7bWFyZ2luOjBjbTsNCglmb250LXNpemU6
MTIuMHB0Ow0KCWZvbnQtZmFtaWx5OiJBcHRvcyIsc2Fucy1zZXJpZjt9DQpzcGFuLkVtYWlsU3R5
bGUxOQ0KCXttc28tc3R5bGUtdHlwZTpwZXJzb25hbC1yZXBseTsNCglmb250LWZhbWlseToiQXB0
b3MiLHNhbnMtc2VyaWY7DQoJY29sb3I6d2luZG93dGV4dDt9DQouTXNvQ2hwRGVmYXVsdA0KCXtt
c28tc3R5bGUtdHlwZTpleHBvcnQtb25seTsNCglmb250LXNpemU6MTAuMHB0Ow0KCW1zby1saWdh
dHVyZXM6bm9uZTt9DQpAcGFnZSBXb3JkU2VjdGlvbjENCgl7c2l6ZTo2MTIuMHB0IDc5Mi4wcHQ7
DQoJbWFyZ2luOjcyLjBwdCA3Mi4wcHQgNzIuMHB0IDcyLjBwdDt9DQpkaXYuV29yZFNlY3Rpb24x
DQoJe3BhZ2U6V29yZFNlY3Rpb24xO30NCi0tPjwvc3R5bGU+DQo8L2hlYWQ+DQo8Ym9keSBsYW5n
PSJFTi1HQiIgbGluaz0iIzQ2Nzg4NiIgdmxpbms9IiM5NjYwN0QiIHN0eWxlPSJ3b3JkLXdyYXA6
YnJlYWstd29yZCI+DQo8ZGl2IGNsYXNzPSJXb3JkU2VjdGlvbjEiPg0KPHAgY2xhc3M9Ik1zb05v
cm1hbCI+PHNwYW4gc3R5bGU9ImZvbnQtc2l6ZToxMS4wcHQ7bXNvLWZhcmVhc3QtbGFuZ3VhZ2U6
RU4tVVMiPkhpIENoYXJsZXMsPG86cD48L286cD48L3NwYW4+PC9wPg0KPHAgY2xhc3M9Ik1zb05v
cm1hbCI+PHNwYW4gc3R5bGU9ImZvbnQtc2l6ZToxMS4wcHQ7bXNvLWZhcmVhc3QtbGFuZ3VhZ2U6
RU4tVVMiPjxvOnA+Jm5ic3A7PC9vOnA+PC9zcGFuPjwvcD4NCjxwIGNsYXNzPSJNc29Ob3JtYWwi
PjxzcGFuIHN0eWxlPSJmb250LXNpemU6MTEuMHB0O21zby1mYXJlYXN0LWxhbmd1YWdlOkVOLVVT
Ij5UaGFua3MgZm9yIHRha2luZyB0aGUgaW5pdGlhdGl2ZS4NCjwvc3Bhbj48c3BhbiBzdHlsZT0i
Zm9udC1zaXplOjExLjBwdDtmb250LWZhbWlseTomcXVvdDtBcHBsZSBDb2xvciBFbW9qaSZxdW90
Ozttc28tZmFyZWFzdC1sYW5ndWFnZTpFTi1VUyI+JiMxMjg1MjI7PC9zcGFuPjxzcGFuIHN0eWxl
PSJmb250LXNpemU6MTEuMHB0O21zby1mYXJlYXN0LWxhbmd1YWdlOkVOLVVTIj48bzpwPjwvbzpw
Pjwvc3Bhbj48L3A+DQo8cCBjbGFzcz0iTXNvTm9ybWFsIj48c3BhbiBzdHlsZT0iZm9udC1zaXpl
OjExLjBwdDttc28tZmFyZWFzdC1sYW5ndWFnZTpFTi1VUyI+SSB3aWxsIGJlIGludGVyZXN0ZWQg
dG8gam9pbi48bzpwPjwvbzpwPjwvc3Bhbj48L3A+DQo8cCBjbGFzcz0iTXNvTm9ybWFsIj48c3Bh
biBzdHlsZT0iZm9udC1zaXplOjExLjBwdDttc28tZmFyZWFzdC1sYW5ndWFnZTpFTi1VUyI+PG86
cD4mbmJzcDs8L286cD48L3NwYW4+PC9wPg0KPHAgY2xhc3M9Ik1zb05vcm1hbCI+PHNwYW4gc3R5
bGU9ImZvbnQtc2l6ZToxMS4wcHQ7bXNvLWZhcmVhc3QtbGFuZ3VhZ2U6RU4tVVMiPktpbmQgcmVn
YXJkcyw8bzpwPjwvbzpwPjwvc3Bhbj48L3A+DQo8cCBjbGFzcz0iTXNvTm9ybWFsIj48c3BhbiBz
dHlsZT0iZm9udC1zaXplOjExLjBwdDttc28tZmFyZWFzdC1sYW5ndWFnZTpFTi1VUyI+QXlhbjxv
OnA+PC9vOnA+PC9zcGFuPjwvcD4NCjxwIGNsYXNzPSJNc29Ob3JtYWwiPjxzcGFuIHN0eWxlPSJm
b250LXNpemU6MTEuMHB0O21zby1mYXJlYXN0LWxhbmd1YWdlOkVOLVVTIj48bzpwPiZuYnNwOzwv
bzpwPjwvc3Bhbj48L3A+DQo8ZGl2IGlkPSJtYWlsLWVkaXRvci1yZWZlcmVuY2UtbWVzc2FnZS1j
b250YWluZXIiPg0KPGRpdj4NCjxkaXY+DQo8ZGl2IHN0eWxlPSJib3JkZXI6bm9uZTtib3JkZXIt
dG9wOnNvbGlkICNCNUM0REYgMS4wcHQ7cGFkZGluZzozLjBwdCAwY20gMGNtIDBjbSI+DQo8cCBj
bGFzcz0iTXNvTm9ybWFsIiBzdHlsZT0ibWFyZ2luLWJvdHRvbToxMi4wcHQiPjxiPjxzcGFuIHN0
eWxlPSJjb2xvcjpibGFjayI+RnJvbToNCjwvc3Bhbj48L2I+PHNwYW4gc3R5bGU9ImNvbG9yOmJs
YWNrIj5BZHZpc29yeS1ib2FyZCAmbHQ7YWR2aXNvcnktYm9hcmQtYm91bmNlc0BsaXN0cy54ZW5w
cm9qZWN0Lm9yZyZndDsgb24gYmVoYWxmIG9mIENoYXJsZXMtSC4gU2NodWx6ICZsdDtjaGFybGVz
LnNjaHVsekB2YXRlcy50ZWNoJmd0Ozxicj4NCjxiPkRhdGU6IDwvYj5Nb25kYXksIDE5IEF1Z3Vz
dCAyMDI0IGF0IDEwOjQ2PGJyPg0KPGI+VG86IDwvYj54ZW4tZGV2ZWwgJmx0O3hlbi1kZXZlbEBs
aXN0cy54ZW5wcm9qZWN0Lm9yZyZndDssIFhlbiBQcm9qZWN0IEFkdmlzb3J5IEJvYXJkICZsdDth
ZHZpc29yeS1ib2FyZEBsaXN0cy54ZW5wcm9qZWN0Lm9yZyZndDs8YnI+DQo8Yj5DYzogPC9iPktl
bGx5IENob2kgJmx0O2tlbGx5LmNob2lAY2xvdWQuY29tJmd0Ozxicj4NCjxiPlN1YmplY3Q6IDwv
Yj5TZXR0aW5nIHVwIHRoZSBYZW4gQ29tbXVuaWNhdGlvbnMgVGVhbTxvOnA+PC9vOnA+PC9zcGFu
PjwvcD4NCjwvZGl2Pg0KPGRpdj4NCjxwIGNsYXNzPSJNc29Ob3JtYWwiIHN0eWxlPSJtYXJnaW4t
Ym90dG9tOjEyLjBwdCI+PHNwYW4gc3R5bGU9ImZvbnQtc2l6ZToxMS4wcHQiPkhlbGxvIGV2ZXJ5
b25lLDxicj4NCjxicj4NCkp1c3QgbGlrZSBhbnkgbWFqb3IgRk9TUyBwcm9qZWN0LCBYZW4gbmVl
ZHMgdG8gdGFrZSBjYXJlIG9mIGl0czxicj4NCm1lc3NhZ2luZyBhbmQgY29tbXVuaWNhdGlvbi4g
V2UgYXJlIHVzdWFsbHkgZm9jdXNlZCBvbiBzb2Z0d2FyZTxicj4NCmRldmVsb3BtZW50LCBob3dl
dmVyIHdlJ2QgbGlrZSB0byB0YWtlIHRoZSBvcHBvcnR1bml0eSB0byBjYWxsIG9uPGJyPg0Kd2hv
ZXZlciBpcyBpbnRlcmVzdGVkIGhlcmUgdG8gam9pbiB0aGUgc21hbGwgdGVhbSBpbiBjaGFyZ2Ug
b2Y8YnI+DQpDb21tdW5pY2F0aW9ucy4mbmJzcDs8YnI+DQo8YnI+DQpXZSBkbyBub3QgZXhwZWN0
IHRoaXMgdG8gaW52b2x2ZSBhIGxhcmdlIGFkZGl0aW9uYWwgd29ya2xvYWQuIElmIHlvdTxicj4N
CmFyZSBpbnRlcmVzdGVkIGluIGpvaW5pbmcsIHBsZWFzZSBzZW5kIGEgbWVzc2FnZSB0byBLZWxs
eSBvciByZXBseSB0bzxicj4NCnRoaXMgZW1haWwuPGJyPg0KPGJyPg0KVGhhbmsgeW91LDxicj4N
Cjxicj4NCi0tIDxicj4NCkNoYXJsZXMtSC4gU2NodWx6PGJyPg0KQ2hpZWYgU3RyYXRlZ3kgT2Zm
aWNlcjxicj4NClZhdGVzIFNBUyAtICszMyAoMCk2IDk4IDY1IDU0IDI0PGJyPg0KPGJyPg0KPG86
cD48L286cD48L3NwYW4+PC9wPg0KPC9kaXY+DQo8L2Rpdj4NCjwvZGl2Pg0KPC9kaXY+DQo8L2Rp
dj4NCjwvYm9keT4NCjwvaHRtbD4NCg==

--_000_PH8PR12MB7326CC5D9546BE7CBD8CAF7DBC8E2PH8PR12MB7326namp_--


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 15:03:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 15:03:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781225.1190767 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgms8-0005yC-Ih; Wed, 21 Aug 2024 15:03:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781225.1190767; Wed, 21 Aug 2024 15:03:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgms8-0005y5-Fk; Wed, 21 Aug 2024 15:03:40 +0000
Received: by outflank-mailman (input) for mailman id 781225;
 Wed, 21 Aug 2024 15:03: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=YIGS=PU=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgms7-0005xz-Dv
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 15:03:39 +0000
Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com
 [2a00:1450:4864:20::633])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8b17b725-5fce-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 17:03:37 +0200 (CEST)
Received: by mail-ej1-x633.google.com with SMTP id
 a640c23a62f3a-a7ab5fc975dso698444366b.1
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 08:03:37 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8682319f00sm41022566b.53.2024.08.21.08.03.36
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 08:03:36 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8b17b725-5fce-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724252617; x=1724857417; 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=J/GKRsusI7WeAOn5ZHjsof1xxc38co7wfdy34jubHPM=;
        b=c85ERlOXeKFzx2gZq3pppcdT1AgxK3+s6fdHLqBG8V0lk0XV0Lgqq6DANReYjliLXs
         21jtul5u814SZRm/wMvKYklPa5CFe/77cm1l3ozPFbG4NvQykhWvGIqqe0xT3K3XbvdP
         Ve+9PAp/vkPImRCUeXIkQSQ3K2DlHIIdUN8JeX/k1j6aXJYhuqSMcl1NtZWBe8P6/MRr
         o9GfFHCWjuzmad+8A/21EP+buc/042LF0sEvPK07Zbq8QCMlNHc0CGaocOth8gWub4mO
         eL3QyalQ7sSbMGYgHQkac0aC+8h2W0fD1nnt5waJ3J6AT/iNvb2KQg/uWTq45TaPxTur
         HCcQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724252617; x=1724857417;
        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=J/GKRsusI7WeAOn5ZHjsof1xxc38co7wfdy34jubHPM=;
        b=jltEnQOzfgl5dvUsFzHxcP3129iv3oJ5m3kLSXnnCgcFsKAzBiXXCFFG5hUsXqsceN
         uh5J/yHZTorqaKubahCQgEA4tuN727agDGh/X2k5SZ0WeGaSIE0v1TXIWOL88+gmDlrV
         CUzPBoCPwahcInOtrS101BGf6SHQ4s8KwjZfrg0eCPz083lMel5/LIla/4gjJn0CwudP
         GHkq76jo3pVdgOQKw/G8h9++elgEGQlYkW0hgk25Uux38SSnEe2QtUdfH3BkfkhjFKwc
         DGWw9pMlPT8VZii0YESbF8fLz8F8wcGUdTzQcO6/kazQBNx3YUb51C8cREImq0YfUIm/
         LAjw==
X-Forwarded-Encrypted: i=1; AJvYcCUWtldz7v0j183XMdx67U4NpmwZq1mIIKP8wJAXY998YRqi0SgoRxTnGPbnQa7BXAEEqPwUhgL4B+g=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxvZiT1/PxspChXBTstNlGU0oXO4/tya8h8TOsPe+RLk79Q8cQu
	yqA4JCbr4HXH/C5PNUYW08/C0W83LbuJzC6L7sSq8jWiAEE/IEei8YrU2bnXEg==
X-Google-Smtp-Source: AGHT+IGmY+ucV6rp6W5V39i36W1o2dycNHM1I3QipyrPp/TjsZaBH+eg2gldxdKaXk7iUIpGqfD1Sw==
X-Received: by 2002:a17:907:9716:b0:a7a:adac:57d5 with SMTP id a640c23a62f3a-a866f2f794dmr183860966b.18.1724252616564;
        Wed, 21 Aug 2024 08:03:36 -0700 (PDT)
Message-ID: <02bf330d-83bc-4fcd-9a1e-a3f1228d2873@suse.com>
Date: Wed, 21 Aug 2024 17:03:35 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: convert op_bytes/opc checks in SIMD emulation
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <bfc9722a-cb6d-45d0-9351-ddfcd0bbb2e0@suse.com>
 <e96daf14-f1ea-4590-baab-62be50f8d54b@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <e96daf14-f1ea-4590-baab-62be50f8d54b@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 21.08.2024 15:37, Andrew Cooper wrote:
> On 21/08/2024 2:30 pm, Jan Beulich wrote:
>> Delivering #UD for an internal shortcoming of the emulator isn't quite
>> right. Similarly BUG() is bigger a hammer than needed.
>>
>> Switch to using EXPECT() instead.
>>
>> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> To confirm, this is ASSERT_UNREACHABLE() (which fuzzing will now notice
> as an error), and unhandleable in release builds (which ultimately ends
> up in #UD)?

Yes, at least mostly. What exactly UNHANDLEABLE converts to depends on
the use site, I think.

> I think it would be helpful to at least note the fuzzing aspect in the
> commit message.

I've added "This way even for insns not covered by the test harness
fuzzers will have a chance of noticing issues, should any still exist
or new ones be introduced" to the 2nd paragraph.

>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>> @@ -8114,13 +8114,13 @@ x86_emulate(
>>      }
>>      else if ( state->simd_size != simd_none )
>>      {
>> -        generate_exception_if(!op_bytes, X86_EXC_UD);
>>          generate_exception_if((vex.opcx && (d & TwoOp) &&
>>                                 (vex.reg != 0xf || (evex_encoded() && !evex.RX))),
>>                                X86_EXC_UD);
>>  
>> -        if ( !opc )
>> -            BUG();
>> +        EXPECT(op_bytes);
>> +        EXPECT(opc);
> 
> This is the only BUG() in x86_emulate.c, and it's right to get rid of it
> IMO.
> 
> Therefore, we should have a hunk removing it from
> tools/tests/x86_emulator/x86-emulate.h too, which will prevent
> reintroduction.
> 
> Maybe even undef BUG somewhere in x86_emulate/private.h?

Both of these actions can only be taken if the other BUG() in decode.c
also goes away. But yes, what you suggest is probably the best course of
action. I guess I'll do that in yet another patch, though.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 15:08:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 15:08:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781232.1190776 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgmwP-0007DX-2u; Wed, 21 Aug 2024 15:08:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781232.1190776; Wed, 21 Aug 2024 15:08:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgmwO-0007DQ-WB; Wed, 21 Aug 2024 15:08:05 +0000
Received: by outflank-mailman (input) for mailman id 781232;
 Wed, 21 Aug 2024 15:08:03 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8oI7=PU=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1sgmwN-0007DK-DT
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 15:08:03 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20604.outbound.protection.outlook.com
 [2a01:111:f403:2612::604])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 27ec1f14-5fcf-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 17:08:00 +0200 (CEST)
Received: from AS9PR06CA0688.eurprd06.prod.outlook.com (2603:10a6:20b:49c::30)
 by AS8PR08MB5976.eurprd08.prod.outlook.com (2603:10a6:20b:299::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.16; Wed, 21 Aug
 2024 15:07:58 +0000
Received: from AMS0EPF00000196.eurprd05.prod.outlook.com
 (2603:10a6:20b:49c:cafe::9c) by AS9PR06CA0688.outlook.office365.com
 (2603:10a6:20b:49c::30) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.25 via Frontend
 Transport; Wed, 21 Aug 2024 15:07:58 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AMS0EPF00000196.mail.protection.outlook.com (10.167.16.217) with
 Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7897.11
 via Frontend Transport; Wed, 21 Aug 2024 15:07:57 +0000
Received: ("Tessian outbound 1b5e57ba80b9:v403");
 Wed, 21 Aug 2024 15:07:56 +0000
Received: from L4fcc6769370a.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 E81C6C2B-4B3B-41D2-AAA2-8DDF77954C67.1; 
 Wed, 21 Aug 2024 15:06:49 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id
 L4fcc6769370a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Wed, 21 Aug 2024 15:06:49 +0000
Received: from DB9PR08MB6588.eurprd08.prod.outlook.com (2603:10a6:10:25a::24)
 by DB9PR08MB6345.eurprd08.prod.outlook.com (2603:10a6:10:252::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.16; Wed, 21 Aug
 2024 15:06:47 +0000
Received: from DB9PR08MB6588.eurprd08.prod.outlook.com
 ([fe80::a8fc:ea0d:baf1:23a]) by DB9PR08MB6588.eurprd08.prod.outlook.com
 ([fe80::a8fc:ea0d:baf1:23a%3]) with mapi id 15.20.7897.014; Wed, 21 Aug 2024
 15:06:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 27ec1f14-5fcf-11ef-8776-851b0ebba9a2
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=nBs55hzK6XoLqHCgsw+EARkOkF+8pzNhBZgfCX42QpRZuKFkeu0NQmGFOW671VPn7K4NBU+7OGrDHlSH6Er5ws6FvxSjS5ZTjNJ0rnXrJhp/qLYEatx0vjKuaffJUZPe678qC8ztMEt1vNqWVQBQR4pVxeY4APau3VDIv//F426QjUEzU9GhUmzrQuN251xOdy0Dpc7CGWpd7UlMikT5PPb9E5DK+TO3vvfoKcB4D8LJdREjSv9aSiy/DYeq0ZA0a0sFe/ebqJ+N4w9vw6x2w85JmjWrKoxlzwh4aH5ZmZ70/6RjXrmotjIUazvi0y1MHbzvIih53Yt3CzkJ4moV9g==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+uWScQgZ/FGTixKPh5t+4Rh/Q7ataUUkp3iF9Bmccmo=;
 b=LkWnhr4xqNbxMAgzJ5cmRR+41GvM92L4db35gzKQbiyQoKxOicbukTtwksEBgitWRaMHmKqDuGRbBJiyjRfsv1V3xOh2LRjSBCY4bus0M3U91cGLTrkmFBo4addizd9mIffKujOSCoZmIPv3Prq0BPKksTw8CjVa+3bDetn6RAkKISnZkzmWwwTXlGPFw5qJspxkflCaE8NYN6G3cY0DSghJiwi3xlF/xoPrPbqi+iu2HNAF0/xQkAROqPyP6IR0bGmTNG2fucRuqYuFnc4aQ4JojgP2Q9PfZnBnc2pRzzUw1V7UJyUvR3P3ftCw37YlLVZU7QdjWVNy24RmwsS7Cg==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com;
 dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com;
 dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+uWScQgZ/FGTixKPh5t+4Rh/Q7ataUUkp3iF9Bmccmo=;
 b=d3nIXFwJYT3XH/jVHRmhdXTNtoo5Df1b54KDiFTDxhk+19x/pgp8EW7ZtMstsZ+Dx4i5LsaKBUvKEXqQDX/FFn4M+MOTW4TRGr4bR+cqvniOOukG01WKpEW9H5oWI0AMUuYVRHjJSXV21Td4OPBYoVF2VP8lUJNylJQEvQ56qp0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 31c7dd35aa5799e9
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=mHZyjH+m/bbzx/oy4gjCZfI7EzX1bI8Hz5MypX6j3Ln519tTVtFUDu11mRQxj4Sgbb1Qlxsjbh8l5akKQW91LLm7C7FIZ+DVNvDQwRF1j12j82xOZDb+gadRpZJCC77pmDP4ylvImOvTUAyUGZcT79hWFh8Cy9bVXUZkhYcnS1snspzAW03+ntV/95SY+Zgs3LmXKlxsuv8h0Pqvr2fBnt4JA+ohtJ7Jx2f068Xin3sInaTMv4YqGvrjH6jgFSRRTmpz0mVItJMjBwTTEEnhI7z9pD5mpsP86vUsf8hmNMvowrH9+eLibvUVJWHl7ejN5VDGAXSrAD7uXawQY+JoSQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+uWScQgZ/FGTixKPh5t+4Rh/Q7ataUUkp3iF9Bmccmo=;
 b=rPd8+gkKlXMId2hm9g61FtPzDDsA1Cmg53uSxH0Xn4d/SFx8qwlAnYXqL8nD6ZlF3v8rdRov2sWea9nAEivwMOrErEABOYdPu7odpRrws6fIfWaV6eT/3qyNbE98v0/BUeDtFrdHdPTKfD0252ZSnp5C3YzqpanLShCcmrHZc0+RE1vifI2du/1MIzpkBKR7vF5qaV1dtMJeoBXiS3nAjkPNg8aDoBDyEEp285cfDse74h/EcOEv4T0vhs4O0LMydqteVhgNFRDNmoRE6efaGIqTbxbxXdSRbnIFn5/uiB1XP4rd+FmWcjHPVjErFgUF8ZzXeHXQdNgtDnJmAVqUGg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+uWScQgZ/FGTixKPh5t+4Rh/Q7ataUUkp3iF9Bmccmo=;
 b=d3nIXFwJYT3XH/jVHRmhdXTNtoo5Df1b54KDiFTDxhk+19x/pgp8EW7ZtMstsZ+Dx4i5LsaKBUvKEXqQDX/FFn4M+MOTW4TRGr4bR+cqvniOOukG01WKpEW9H5oWI0AMUuYVRHjJSXV21Td4OPBYoVF2VP8lUJNylJQEvQ56qp0=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Michal Orzel
	<michal.orzel@amd.com>, Stefano Stabellini <sstabellini@kernel.org>, Artem
 Mygaiev <artem_mygaiev@epam.com>
Subject: Re: [PATCH] docs: fusa: Add requirements for generic timer
Thread-Topic: [PATCH] docs: fusa: Add requirements for generic timer
Thread-Index: AQHa8u0jnfgC5boSJE+t9AfK5MrS+7Ix0ZQA
Date: Wed, 21 Aug 2024 15:06:46 +0000
Message-ID: <5F0AF572-3437-4372-96EB-42F46B3A3155@arm.com>
References: <20240820103816.1661102-1-ayan.kumar.halder@amd.com>
In-Reply-To: <20240820103816.1661102-1-ayan.kumar.halder@amd.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3774.600.62)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	DB9PR08MB6588:EE_|DB9PR08MB6345:EE_|AMS0EPF00000196:EE_|AS8PR08MB5976:EE_
X-MS-Office365-Filtering-Correlation-Id: 50eee2cc-743b-4ee6-e565-08dcc1f30a62
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|1800799024|376014|366016|38070700018;
X-Microsoft-Antispam-Message-Info-Original:
 =?us-ascii?Q?o+4crYmguIcFxuiXgO6GeWlrd/JIvJKiuOJlE7vz6VahJ2q/sSrRSsjpFw+U?=
 =?us-ascii?Q?h/21ibuPTZ5EAKE+uq14TG+XjBoeFa7Vm1gw07WuK7Axprdvrdfqa9jKAsWc?=
 =?us-ascii?Q?0DC4DjTpuK0Yfay2XsXIbIgo6vqt7JdNdEq9ZoBbRSd7wVK84kXI256YzYcy?=
 =?us-ascii?Q?7C18LmSsymOre1Wh2L8bYtuyAFeQ3LENQ6FpdlDxAYWBMffb1UBPJUpnHaWO?=
 =?us-ascii?Q?+fXEmKYzoGx5SSGYbVyxjIu2IQr62riw7H0dxELH508zVMXwV4QOBlags+NE?=
 =?us-ascii?Q?k4lr8KKnw25HXZtiopyD64PYRpBh01n0HPWqbh79ku4IuEQdZRfD1KlMrwy6?=
 =?us-ascii?Q?KDkJb0ahTBw/yydVyxAT6GQYMWmM7qQMrgAMF1z5X5jJH8GE+wyS7wPvHo1i?=
 =?us-ascii?Q?np6mpPNK9A5+3Um1xC+9d6Ic7GJ2kwd9Xj9f1Ur2acEtu5SZXZGU/ue6H9rh?=
 =?us-ascii?Q?Hbv0lA6Dzib/zx2QQiJIElW0C9RDJvrx5ZyLE0ySZFLKxMy5JvgXFUry6RBd?=
 =?us-ascii?Q?Czgyo/z5crZeDB36W92Upo5twO5bfXFvX0oJOfvduVVqLa47I8cShvBwYpBC?=
 =?us-ascii?Q?NuXWRa7c4dHNmTmYaOKFKAVjHL3IwLIP4VLPtOUbKVMYiP8rzrITisKHsd2e?=
 =?us-ascii?Q?5HQHPakRjA/joVDjDPdhlbyirPraqnYJ6goK969Vh78Hq1ahuTrDmmaRgc/c?=
 =?us-ascii?Q?uXpmhRNnRhhUwlICd1kyDfZmQrtPQsHLlOZ7yhxeg7dWNo+zmJA+myBy/2kk?=
 =?us-ascii?Q?09lruQHoqeTKhshnygGShewjqVZTaW3Z6t67v4pCVllMLVlvQ3oMkiYOwdbz?=
 =?us-ascii?Q?pMvSL1+qhczifx1rizmEsYr2+tr8qsxoPjfGAnrotlJGFSki2LNVy4SMnA/R?=
 =?us-ascii?Q?xUjYZKL8i60U6FGZYh3loUcNq2dLO381YrIy2BgCt3PbYUC7W9ksu187W8Eu?=
 =?us-ascii?Q?iBgOor1f9+mzLfZ+Yf2C1YeFDKgg0E+v4sOZSASjmNCorrlaYTZLXHvmeSto?=
 =?us-ascii?Q?kw3TnXH1NnRW/oLAA1lT5KBfIhGqCQDUfGhJNBZ2k97hzb3xJ7N6IsykWo05?=
 =?us-ascii?Q?M+7q2uXbnxshGyCvoLeY96ai4uFQxZSXCFBfPA7maRY54BwdkXGSKg/mc09C?=
 =?us-ascii?Q?+6st+SQLI7LdU6ueCpPIAdVJFTT1VvMpVEMQoQJQmIhVT6zznxMe7To36bNb?=
 =?us-ascii?Q?P5kMwy+Y3oiiR6l3c/EwCe7eBw0sC1jpylM0WyjO7F42niNW+wwVSEEpIsKt?=
 =?us-ascii?Q?baXSEHRkVAfjYA11qie+6uFpl9SfjpcbPbcfQTm8k4XrkUw6W5Xk6ilPx5vL?=
 =?us-ascii?Q?vOvkUbBitr0e+2wwPsE6MPuqGNS6uQZE7u09Pekwq8gMjvJwU9bzIEfFjzuZ?=
 =?us-ascii?Q?eS+gYHzKFrjs/3PgWHOmZE886ntNNSUGthUMy4zTTMGwyjOYaQ=3D=3D?=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR08MB6588.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016)(38070700018);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <1CC4C41CF7F3FE49B005512CDD6E0811@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6345
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-SkipListedInternetSender:
 ip=[2603:10a6:10:25a::24];domain=DB9PR08MB6588.eurprd08.prod.outlook.com
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AMS0EPF00000196.eurprd05.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	b0a239a7-5b28-4e01-ad67-08dcc1f2e045
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|35042699022|1800799024|36860700013|82310400026|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?NwopqBFNYMeqSjQbTIBp/hS5xikaXx5reIYi3sFvqWB9liMGEBufSN4g+FkI?=
 =?us-ascii?Q?hbdkTatVq98muoPdhT4gcoDz+GPWdJuB6bhbn+38gabjoZ+J7Ri5PU+NKBAE?=
 =?us-ascii?Q?pazwp0LgbAPZ0Geg0mSxysmQd6S2pAFOX85QaEdRYe9+U6NHMU1x/2HqoG0M?=
 =?us-ascii?Q?WesZJUMaMmSlmiGbeZMGy8D7rumdGfKglsh1AaiQRvFPYs48qIwgbFg725R2?=
 =?us-ascii?Q?Cs05+NUrL7jUQHynok/GjmQoQ8DtzLP4PT7FaRNIWt62BhBPpJC2qJyd6jBD?=
 =?us-ascii?Q?RLKB/vQRjg3rOHaHJp/ZdJyCCToYDssTKcxNPiE933IztR5ODGHoNGnpSkgM?=
 =?us-ascii?Q?MdSzedBR868bCE7WykARv/QEtrfRQbof7jto0QXTqyGDAq/7kizxmjnHRHyB?=
 =?us-ascii?Q?rB4e0o2nX/EVVh52swSe73Sdg8V1FKToC3uAhCrQvfLu1m84A+YR2QqeWEC6?=
 =?us-ascii?Q?n+EQ60Lf9dSz9p54KesMQMiD8atig+51ahurPdAh48+t7jD5b9u3zBPm2nQE?=
 =?us-ascii?Q?z6i/PwXEUtIXcqkfN78PWYJU7ks89PUexaK5nAYqtm0jDay4Lfc++pqRIuUt?=
 =?us-ascii?Q?/S65hztN9EA8s18HatMMiB50qeoJgJ7D/xhjhFc7mLyWiL9fOaFLDP/HdYxE?=
 =?us-ascii?Q?KB1ClQRWJFdkVerFcT36lA/NaFFnQPGaxy3mutjdajzx2FkZkmqjwx7i7VSY?=
 =?us-ascii?Q?3FC+Uj74BP17qvMvqyGmvMFvWz66yCkZCDAyfAhX22tUpU3XzbrovUzT2t/j?=
 =?us-ascii?Q?T9GgGYT5T64Okp/g2R2GJ1ffSEDSX/8zHAtU+243An5gQd+J+x40XlxXnBOq?=
 =?us-ascii?Q?lpGVarT24RUGsYNOJCxY3bUTkX+4WzCpEGl4E3uWm4J/K23w8yI3W1xbuayS?=
 =?us-ascii?Q?//teqH02/y3+ZiGsVm467Wui6flgOZEoY5aXFZsIPDgCUgzpN+opqtE/MLke?=
 =?us-ascii?Q?IdNa5cqmKb3rEEDoMEnjrjtYcqXq+ZJhwLC4jstZGUkR0Tze1JBFWjWOsJPW?=
 =?us-ascii?Q?sYqTIjKeJ3N5Ya/DvEAnCwq3SMkKTRfV/boiXPkGS0moMWmsnxd5S8qgo+yD?=
 =?us-ascii?Q?9gO8qSHHFAR2HLxmNnt0si1d4EGERUGNdv78GFGDflXPqNwTJUfZq52FOg5I?=
 =?us-ascii?Q?KRvFb/84QOTzYvyKb5NTn1z4QbQNnLnfG0ZY6yQYSqbhqKA7Le5Me9lYIXcV?=
 =?us-ascii?Q?aSSG30OaLBzcSVNGggB++u0lPlLkpEqFGIY0T0R5msVdbJWmP6NdYH2+MqOJ?=
 =?us-ascii?Q?SfVYYqckZRd79ak8z3Nmc/j6WWy+/IsVur0a6ZXCzd3zDUmLb0pBUQ5l/WHV?=
 =?us-ascii?Q?g2JtpnLkaBAkoxa712D8LIV7mu6ljxpz1ENt1QPO8hezSsjcw8xQEPOy0Zj5?=
 =?us-ascii?Q?ZIqQoLVQC9MVvlRM+LcX9ETHYdpZZfrPNmIpZdgFiUy2lrNXILRIrRAt+wAz?=
 =?us-ascii?Q?BweTrFn7kNgYOdbtjoFl7IIobioU1MM6?=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230040)(35042699022)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 15:07:57.4609
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 50eee2cc-743b-4ee6-e565-08dcc1f30a62
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AMS0EPF00000196.eurprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB5976

Hi Ayan,

> On 20 Aug 2024, at 12:38, Ayan Kumar Halder <ayan.kumar.halder@amd.com> w=
rote:
>=20
> From: Michal Orzel <michal.orzel@amd.com>
>=20
> Add the requirements for the use of generic timer by a domain
>=20
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
> .../reqs/design-reqs/arm64/generic-timer.rst  | 139 ++++++++++++++++++
> docs/fusa/reqs/index.rst                      |   3 +
> docs/fusa/reqs/intro.rst                      |   3 +-
> docs/fusa/reqs/market-reqs/reqs.rst           |  34 +++++
> docs/fusa/reqs/product-reqs/arm64/reqs.rst    |  24 +++
> 5 files changed, 202 insertions(+), 1 deletion(-)
> create mode 100644 docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
> create mode 100644 docs/fusa/reqs/market-reqs/reqs.rst
> create mode 100644 docs/fusa/reqs/product-reqs/arm64/reqs.rst
>=20
> diff --git a/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst b/docs/fu=
sa/reqs/design-reqs/arm64/generic-timer.rst
> new file mode 100644
> index 0000000000..bdd4fbf696
> --- /dev/null
> +++ b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
> @@ -0,0 +1,139 @@
> +.. SPDX-License-Identifier: CC-BY-4.0
> +
> +Generic Timer
> +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> +
> +The following are the requirements related to ARM Generic Timer [1] inte=
rface
> +exposed by Xen to Arm64 domains.
> +
> +Probe the Generic Timer device tree node from a domain
> +------------------------------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_probe_dt~1`
> +
> +Description:
> +Xen shall generate a device tree node for the Generic Timer (in accordan=
ce to
> +ARM architected timer device tree binding [2]).

You might want to say where here. The domain device tree ?

> +
> +Rationale:
> +
> +Comments:
> +Domains shall probe the Generic Timer device tree node.

Please prevent the use of "shall" here. I would use "can".
Also detect the presence of might be better than probe.

> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Read system counter frequency
> +-----------------------------
> +
> +`XenSwdgn~arm64_generic_timer_read_freq~1`
> +
> +Description:
> +Xen shall expose the frequency of the system counter to the domains.

The requirement would need to say in CNTFRQ_EL0 and in the domain device tr=
ee xxx entry.

> +
> +Rationale:
> +
> +Comments:
> +Domains shall read it via CNTFRQ_EL0 register or "clock-frequency" devic=
e tree
> +property.

I do not think this comment is needed.

> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Access CNTKCTL_EL1 system register from a domain
> +------------------------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_access_cntkctlel1~1`
> +
> +Description:
> +Xen shall expose counter-timer kernel control register to the domains.

"counter-timer kernel" is a bit odd here, is it the name from arm arm ?
Generic Timer control registers ? or directly the register name.

> +
> +Rationale:
> +
> +Comments:
> +Domains shall access the counter-timer kernel control register to allow
> +controlling the access to the timer from userspace (EL0).

This is documented in the arm arm, this comment is not needed.

> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Access virtual timer from a domain
> +----------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_access_virtual_timer~1`
> +
> +Description:
> +Xen shall expose the virtual timer registers to the domains.
> +
> +Rationale:
> +
> +Comments:
> +Domains shall access and make use of the virtual timer by accessing the
> +following system registers:
> +CNTVCT_EL0,
> +CNTV_CTL_EL0,
> +CNTV_CVAL_EL0,
> +CNTV_TVAL_EL0.

The requirement to be complete should give this list, not the comment.

> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Access physical timer from a domain
> +-----------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_access_physical_timer~1`
> +
> +Description:
> +Xen shall expose physical timer registers to the domains.
> +
> +Rationale:
> +
> +Comments:
> +Domains shall access and make use of the physical timer by accessing the
> +following system registers:
> +CNTPCT_EL0,
> +CNTP_CTL_EL0,
> +CNTP_CVAL_EL0,
> +CNTP_TVAL_EL0.

same as upper

> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Trigger the virtual timer interrupt from a domain
> +-------------------------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_trigger_virtual_interrupt~1`
> +
> +Description:
> +Xen shall enable the domains to program the virtual timer to generate th=
e
> +interrupt.

I am not sure this is right here.
You gave access to the registers upper so Xen responsibility is not really =
to
enable anything but rather make sure that it generates an interrupt accordi=
ng to
how the registers have been programmed.

> +
> +Rationale:
> +
> +Comments:
> +Domains shall program the virtual timer to generate the interrupt when t=
he
> +asserted condition is met.

What a timer is used for should not really be documented here

> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Trigger the physical timer interrupt from a domain
> +--------------------------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_trigger_physical_interrupt~1`
> +
> +Description:
> +Xen shall enable the domains to program the physical timer to generate t=
he
> +interrupt

same as upper

> +
> +Rationale:
> +
> +Comments:
> +Domains shall program the physical timer to generate the interrupt when =
the
> +asserted condition is met.

same as upper

> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +[1] Arm Architecture Reference Manual for A-profile architecture, Chapte=
r 11
> +[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/t=
ree/Documentation/devicetree/bindings/timer/arm,arch_timer.yaml
> diff --git a/docs/fusa/reqs/index.rst b/docs/fusa/reqs/index.rst
> index 78c02b1d9b..183f183b1f 100644
> --- a/docs/fusa/reqs/index.rst
> +++ b/docs/fusa/reqs/index.rst
> @@ -7,3 +7,6 @@ Requirements documentation
>    :maxdepth: 2
>=20
>    intro
> +   market-reqs
> +   product-reqs
> +   design-reqs/arm64
> diff --git a/docs/fusa/reqs/intro.rst b/docs/fusa/reqs/intro.rst
> index d67b18dd9f..245a219ff2 100644
> --- a/docs/fusa/reqs/intro.rst
> +++ b/docs/fusa/reqs/intro.rst
> @@ -55,7 +55,8 @@ Title of the requirement
>   be 'XenMkt', 'XenProd' or 'XenSwdgn' to denote market, product or desig=
n
>   requirement.
>   name - This denotes name of the requirement. In case of architecture sp=
ecific
> -  requirements, this starts with the architecture type (ie x86_64, arm64=
).
> +  requirements, this starts with the architecture type (eg x86_64, arm64=
)
> +  followed by component name (eg generic_timer) and action (eg read_xxx)=
.
>   revision number - This gets incremented each time the requirement is mo=
dified.
>=20
>=20
> diff --git a/docs/fusa/reqs/market-reqs/reqs.rst b/docs/fusa/reqs/market-=
reqs/reqs.rst
> new file mode 100644
> index 0000000000..9c98c84a9a
> --- /dev/null
> +++ b/docs/fusa/reqs/market-reqs/reqs.rst
> @@ -0,0 +1,34 @@
> +.. SPDX-License-Identifier: CC-BY-4.0
> +
> +Functional Requirements
> +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> +
> +Run Arm64 VMs
> +-------------
> +
> +`XenMkt~run_arm64_vms~1`
> +
> +Description:
> +Xen shall run Arm64 VMs.
> +
> +Rationale:
> +
> +Comments:
> +
> +Needs:
> + - XenProd
> +
> +Provide timer to the VMs
> +------------------------
> +
> +`XenMkt~provide_timer_vms~1`
> +
> +Description:
> +Xen shall provide a timer to a VM.
> +
> +Rationale:
> +
> +Comments:
> +
> +Needs:
> + - XenProd
> diff --git a/docs/fusa/reqs/product-reqs/arm64/reqs.rst b/docs/fusa/reqs/=
product-reqs/arm64/reqs.rst
> new file mode 100644
> index 0000000000..9b579cc606
> --- /dev/null
> +++ b/docs/fusa/reqs/product-reqs/arm64/reqs.rst
> @@ -0,0 +1,24 @@
> +.. SPDX-License-Identifier: CC-BY-4.0
> +
> +Domain Creation And Runtime
> +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> +
> +Emulated Timer
> +--------------
> +
> +`XenProd~emulated_timer~1`
> +
> +Description:
> +Xen shall emulate Arm Generic Timer timer on behalf of domains.

Xen is not emulating but giving access or providing one.
How it is done is down to the implementation.

> +
> +Rationale:
> +
> +Comments:
> +Domains shall use it for scheduling and other needs.

This comment should be removed.

> +
> +Covers:
> + - `XenMkt~run_arm64_vms~1`
> + - `XenMkt~provide_timer_vms~1`
> +
> +Needs:
> + - XenSwdgn
> --=20
> 2.25.1
>=20

Cheers
Bertrand




From xen-devel-bounces@lists.xenproject.org Wed Aug 21 15:08:39 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 15:08:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781238.1190787 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgmwx-0007hb-EO; Wed, 21 Aug 2024 15:08:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781238.1190787; Wed, 21 Aug 2024 15:08:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgmwx-0007hU-BL; Wed, 21 Aug 2024 15:08:39 +0000
Received: by outflank-mailman (input) for mailman id 781238;
 Wed, 21 Aug 2024 15:08:38 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8p22=PU=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sgmww-0007hK-55
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 15:08:38 +0000
Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com
 [2607:f8b0:4864:20::82c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3ccef3e1-5fcf-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 17:08:36 +0200 (CEST)
Received: by mail-qt1-x82c.google.com with SMTP id
 d75a77b69052e-45006bcb482so34600431cf.3
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 08:08:36 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 d75a77b69052e-45369fd9102sm60102721cf.6.2024.08.21.08.08.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 08:08:34 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3ccef3e1-5fcf-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724252915; x=1724857715; 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=xipi/dGcO6PIirrL73lzX6Qnlrr3NyLyDL/WXughxdA=;
        b=Rc+6X8h/20k0r6muMYO/sKdnc5QylMxTTzH8C+uEyjlYNfk71jn4W8aNGyNx1gQV89
         CPdq9ZTc2RP/dG/zfAU9kBwKvdccUq0GGmtVrtbJbkO3Js1+z+oel2v3dYN/E0rrq6xO
         5f1J301k3JcsZw+GuBWySmuw2/hVaOVbF0O2U=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724252915; x=1724857715;
        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=xipi/dGcO6PIirrL73lzX6Qnlrr3NyLyDL/WXughxdA=;
        b=G1mwAn7Afe/B450ykz46E2r46CMfLTNKZ4IcfZYvFsbhRmNfEtgdomCFfmEZcDhS7R
         SeyN7zJMix0WBt0xYt89jLFicBwEz9SdXrt9hY3eVW/XDQ6B5F5K//pHXaZPT4Djpsf1
         V70FMYsj6NNEg0kdIClTnWpOoNnwUn459XkvZnOyLKgH76AzTa2B+LUDi21sV3Rck8RG
         eRm+Zn6MClxTOGrMo7GuhHEcgGD6KFyyf0rFfAv8Lm4kefSfAKVizsnujXWcNqmDKV6o
         LioLZLdhc2oMW9pNGi7xKsjSlz/xOdL3YdrbfjkiOo3H8ONNn/1jMRxddZUrv1msBfL+
         C/9g==
X-Forwarded-Encrypted: i=1; AJvYcCUJ0JM4XAHSk8beXVT6mmk6pM/soObIE7HRKQVIMUKOeD8JQi6azNDVzfuXH6PA3b4qz9sSiwja948=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxBXon+WYFrYVB+75WVO3tQwHL03nR/g2IV38XcDrfbjCK+4vqZ
	V2+/WA3f1hje7HQS7ZddD9jinZvM9DM0wKfLtVW4y35MTMhF/JOcAj05f6/Qtpg=
X-Google-Smtp-Source: AGHT+IFuOkGgD2N1cDH4BAG2GgGd/PAFZR7/C4EvZuNTrjHj0tOXHrzlDT3qsLvtAb6PvuD7mkbuzQ==
X-Received: by 2002:a05:622a:250b:b0:447:e808:ab24 with SMTP id d75a77b69052e-454f2565f7fmr28917051cf.50.1724252914611;
        Wed, 21 Aug 2024 08:08:34 -0700 (PDT)
Message-ID: <1d0f79f1-a1c5-46bf-a683-78ec3b5d9636@citrix.com>
Date: Wed, 21 Aug 2024 16:08:31 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: set (fake) operand size for AVX512CD broadcast
 insns
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <fb917afb-62d1-42f0-83e6-276cae67569d@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <fb917afb-62d1-42f0-83e6-276cae67569d@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 21/08/2024 10:28 am, Jan Beulich wrote:
> Back at the time I failed to pay attention to op_bytes still being zero
> when reaching the respective case block: With the ext0f38_table[]
> entries having simd_packed_int, the defaulting at the bottom of
> x86emul_decode() won't set the field to non-zero for F3-prefixed insns.
>
> Fixes: 37ccca740c26 ("x86emul: support AVX512CD insns")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 15:11:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 15:11:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781247.1190797 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgmzH-0000qA-QM; Wed, 21 Aug 2024 15:11:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781247.1190797; Wed, 21 Aug 2024 15:11:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgmzH-0000q3-N8; Wed, 21 Aug 2024 15:11:03 +0000
Received: by outflank-mailman (input) for mailman id 781247;
 Wed, 21 Aug 2024 15:11: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=8p22=PU=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sgmzG-0000px-IR
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 15:11:02 +0000
Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com
 [2607:f8b0:4864:20::730])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9382bc7d-5fcf-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 17:11:01 +0200 (CEST)
Received: by mail-qk1-x730.google.com with SMTP id
 af79cd13be357-7a3375015f8so462947785a.1
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 08:11:01 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a4ff02c8a7sm629874085a.16.2024.08.21.08.10.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 08:10:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9382bc7d-5fcf-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724253060; x=1724857860; 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=ruPSVAS3h7mgvEM5sMIWYKNuW4R2wfplIkbjn/4xBeU=;
        b=c5IjRvFH9q4Teoff2YAzPwbUGZWxU6Sf2FHyRvYMOR+UDT397482lNbhW8gJBZa9c6
         +BDvEtDtRQxcPq7vJM0RYA+SnLe66ID2PdqbpVYV+ZW/bxzex05bcFPI612Zufefj3gD
         FXk3omyZPw9kAT/JAzHkyMbnFFvsNPnNak/14=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724253060; x=1724857860;
        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=ruPSVAS3h7mgvEM5sMIWYKNuW4R2wfplIkbjn/4xBeU=;
        b=op3sQJOvbbwMR0q5RQ9ar5E+Qem4oTrniRrcjRZIiHmdpDWCFTOMZzVrWgegk5ubLD
         ZmNyu3MZtDfbYVqIpwm+CMsNsLY/KrKrC9huVNCc67jfn1K0rPspAXBYOD3H7xdJ9GKT
         WKkVq2sROaucBoGOxHnYMVou6K2s8o9uWhZpAVn8h45HVbDFdDAh2IOp9gW48qNIMOxM
         Q25W0kQIKSgtnXBIQOZlb8zNyX7IvaWIG4orRTup2qVdq/04i90VvwqPv9ppkHFmM766
         Q3OmGkFy82AQ/p6Pm6nFLT16Adwwmn74Wp0Fpunq0Lfvjtm8yJXn3EVIfYUgEwm4GW2V
         /Zuw==
X-Forwarded-Encrypted: i=1; AJvYcCXGWfIq6St0qVmG2Q/gtUqWsNA4P+C9CXi4VtqUoV2PqzLp13jgh2L158uI4W6BuAnJryBoIeCQ+oA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzkwEe3M5uWXTQw1pi0TjrWV90tmWrhzTtH3orU6tBsJBFLcdT0
	Ltx0mENQq1PHn+mEZJHCYzEnprT673pmZAW/aAv56vnv4/yG7FFbFlzFV7zgerQ=
X-Google-Smtp-Source: AGHT+IEQGUPSy/YbiXFeB1alNHz28RcUMgEq/8nHk/awcb2ymqy7qj1gOvzjtBQiWtpL5a+IwzLxig==
X-Received: by 2002:a05:620a:f0c:b0:79e:f78e:c554 with SMTP id af79cd13be357-7a673ffb660mr340581685a.3.1724253060286;
        Wed, 21 Aug 2024 08:11:00 -0700 (PDT)
Message-ID: <672e8b2b-2bd6-4099-bbf6-67c39f23cca5@citrix.com>
Date: Wed, 21 Aug 2024 16:10:57 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: convert op_bytes/opc checks in SIMD emulation
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <bfc9722a-cb6d-45d0-9351-ddfcd0bbb2e0@suse.com>
 <e96daf14-f1ea-4590-baab-62be50f8d54b@citrix.com>
 <02bf330d-83bc-4fcd-9a1e-a3f1228d2873@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <02bf330d-83bc-4fcd-9a1e-a3f1228d2873@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 21/08/2024 4:03 pm, Jan Beulich wrote:
> On 21.08.2024 15:37, Andrew Cooper wrote:
>> On 21/08/2024 2:30 pm, Jan Beulich wrote:
>>> Delivering #UD for an internal shortcoming of the emulator isn't quite
>>> right. Similarly BUG() is bigger a hammer than needed.
>>>
>>> Switch to using EXPECT() instead.
>>>
>>> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> To confirm, this is ASSERT_UNREACHABLE() (which fuzzing will now notice
>> as an error), and unhandleable in release builds (which ultimately ends
>> up in #UD)?
> Yes, at least mostly. What exactly UNHANDLEABLE converts to depends on
> the use site, I think.

Sure, but it's a well defined non-fatal exit path.

>
>> I think it would be helpful to at least note the fuzzing aspect in the
>> commit message.
> I've added "This way even for insns not covered by the test harness
> fuzzers will have a chance of noticing issues, should any still exist
> or new ones be introduced" to the 2nd paragraph.

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
>>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>>> @@ -8114,13 +8114,13 @@ x86_emulate(
>>>      }
>>>      else if ( state->simd_size != simd_none )
>>>      {
>>> -        generate_exception_if(!op_bytes, X86_EXC_UD);
>>>          generate_exception_if((vex.opcx && (d & TwoOp) &&
>>>                                 (vex.reg != 0xf || (evex_encoded() && !evex.RX))),
>>>                                X86_EXC_UD);
>>>  
>>> -        if ( !opc )
>>> -            BUG();
>>> +        EXPECT(op_bytes);
>>> +        EXPECT(opc);
>> This is the only BUG() in x86_emulate.c, and it's right to get rid of it
>> IMO.
>>
>> Therefore, we should have a hunk removing it from
>> tools/tests/x86_emulator/x86-emulate.h too, which will prevent
>> reintroduction.
>>
>> Maybe even undef BUG somewhere in x86_emulate/private.h?
> Both of these actions can only be taken if the other BUG() in decode.c
> also goes away. But yes, what you suggest is probably the best course of
> action. I guess I'll do that in yet another patch, though.

Is that BUG() local to your tree?  I cant see it in staging.

Deferring this to a later patch is fine.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 15:18:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 15:18:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781259.1190807 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgn5x-0002CH-GG; Wed, 21 Aug 2024 15:17:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781259.1190807; Wed, 21 Aug 2024 15:17:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgn5x-0002CA-D5; Wed, 21 Aug 2024 15:17:57 +0000
Received: by outflank-mailman (input) for mailman id 781259;
 Wed, 21 Aug 2024 15:17:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgn5w-0002C0-T5; Wed, 21 Aug 2024 15:17:56 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgn5w-0005c8-Oo; Wed, 21 Aug 2024 15:17:56 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgn5w-0006Gn-B0; Wed, 21 Aug 2024 15:17:56 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sgn5w-0001Gz-AR; Wed, 21 Aug 2024 15:17:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=PvtTOvjrL58ZlvOlNL+1Qt8xOCggwixqvrHRMP8tsUg=; b=XTeuPo32jHLOe8eIjQz0uV4xeU
	JGBqT+86VI0gNzE1K6p92ZHPxbQDuHhOYbLNg+XeGSBUKdtmKr+wcuieLUQHYu1gEEwETwUUp6p4x
	6tNMynlIl7r18wQSSvDM3i8QlHjpo1Bhdbv2/qMC5HRGVOyusQbmAViWgElAYr2UWnxs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187297-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187297: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:xen-boot:fail:heisenbug
    xen-unstable:test-armhf-armhf-xl-arndale:host-ping-check-xen:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:xen-boot:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=a30d438ce58b70c5955f5d37f776086ab8f88623
X-Osstest-Versions-That:
    xen=a30d438ce58b70c5955f5d37f776086ab8f88623
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 21 Aug 2024 15:17:56 +0000

flight 187297 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187297/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm  8 xen-boot   fail pass in 187293
 test-armhf-armhf-xl-arndale  10 host-ping-check-xen        fail pass in 187293
 test-armhf-armhf-libvirt      8 xen-boot                   fail pass in 187293

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt 16 saverestore-support-check fail in 187293 like 187286
 test-armhf-armhf-xl-arndale 15 migrate-support-check fail in 187293 never pass
 test-armhf-armhf-xl-arndale 16 saverestore-support-check fail in 187293 never pass
 test-armhf-armhf-libvirt    15 migrate-support-check fail in 187293 never pass
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187293
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187293
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187293
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187293
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187293
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  a30d438ce58b70c5955f5d37f776086ab8f88623
baseline version:
 xen                  a30d438ce58b70c5955f5d37f776086ab8f88623

Last test of basis   187297  2024-08-21 01:55:52 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  fail    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 15:37:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 15:37:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781272.1190816 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnOH-0006DN-5N; Wed, 21 Aug 2024 15:36:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781272.1190816; Wed, 21 Aug 2024 15:36:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnOH-0006DG-20; Wed, 21 Aug 2024 15:36:53 +0000
Received: by outflank-mailman (input) for mailman id 781272;
 Wed, 21 Aug 2024 15:36:52 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=WDzf=PU=cloud.com=matthew.barnes@srs-se1.protection.inumbo.net>)
 id 1sgnOG-00068X-3F
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 15:36:52 +0000
Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com
 [2607:f8b0:4864:20::82b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2e21a2ea-5fd3-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 17:36:49 +0200 (CEST)
Received: by mail-qt1-x82b.google.com with SMTP id
 d75a77b69052e-44fe188d25cso27207201cf.3
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 08:36:49 -0700 (PDT)
Received: from mbarnes-x-u.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 d75a77b69052e-454e904ff81sm15792281cf.35.2024.08.21.08.36.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 21 Aug 2024 08:36:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2e21a2ea-5fd3-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724254608; x=1724859408; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=o1ov4xsmvf/8LjYhy1kZ/l5DlyUj+pR+QeRZhllCHsA=;
        b=MKtZaZBgbD0wkqsSu1CeqRBCqddtHqyJDixcb4ikMMuXHEP69tPrJ9b7GRzlDxO7bN
         mmAdNcO4VPLfb57jjuQOyffVIpO1FF2S9Grrb02IVBAFxWRqE/eJhLlleXLQ0E3EUZrP
         Yz0bp1Ur5v9j0OzdEptmWeDhVYxibrL+7XX6Y=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724254608; x=1724859408;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=o1ov4xsmvf/8LjYhy1kZ/l5DlyUj+pR+QeRZhllCHsA=;
        b=sXk0r+anNSIY3S1zPfe5iMVamKUxbDqzYHyDXwNrlXnmcbbXdi7wT9uMNbvDLtNKFN
         wrRSvAOpYO8KtEbq5nCL6D8Tgpi/YShVFwClScw6CpcTjnuXwmn2XlXiGPmMSkoJgFM+
         gbrWO5Z8WUR7N/ewhb6QA8CYe+ukJ0JXjS/JrZPI8Fo0pFymTDfC0tnVIPyTZ+nIQZjo
         V9zj+dZqFU2qbKimvHWLhyKzazx/uB9HWQGawhpWvlXbDLopbnRnbG+YZgw9YeiVbr4w
         YSuyHmQjHDB/f9BHyndw5/MKLdMjjM4bS5gA3HhhIs9JNyzzN3GeLxJ+APjgo4ONR2oO
         FL3g==
X-Gm-Message-State: AOJu0YznNEPZJ6r06M9uusWbXLQtb06StiImY8d6n90AMi5uP2+72j2Q
	BGzdc+vio2T7GkFV1glpfn+WW0zhqjcvMN9/P5ncQpmlolZ9LWk9y5p/+O11NrvaECkjrwGrGKP
	X
X-Google-Smtp-Source: AGHT+IHqYkgy6DEis85z12XDDdaLYN8b+hVpaU3de4zW8kvzJT0HC9PgQ+wjCTjrd+Slaz13dUGZEA==
X-Received: by 2002:a05:622a:6107:b0:44f:ff2a:5a0f with SMTP id d75a77b69052e-454f21f52e9mr18004451cf.15.1724254607734;
        Wed, 21 Aug 2024 08:36:47 -0700 (PDT)
From: Matthew Barnes <matthew.barnes@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Matthew Barnes <matthew.barnes@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Alejandro Vallejo <alejandro.vallejo@cloud.com>
Subject: [PATCH v2] x86/cpufeatures: Add new cpuid features in SPR to featureset
Date: Wed, 21 Aug 2024 16:34:37 +0100
Message-Id: <248b4ea259aa78a17b7b05043ed211a00863bf94.1724247366.git.matthew.barnes@cloud.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Bcc: Matthew Barnes <matthew.barnes@cloud.com>
Content-Transfer-Encoding: 8bit

Upon running `xen-cpuid -v` on a host machine with Sapphire Rapids
within Dom0, there exist unrecognised features.

This patch adds these features as macros to the CPU featureset,
disabled by default.

Signed-off-by: Matthew Barnes <matthew.barnes@cloud.com>
---
Changes in v2:
- Remove MONITOR / UMONITOR features in MSR_ARCH_CAPS
  (these will be included properly in a separate patch)
- Xen cpufeature label renames
- Xen cpufeature comment rewords
- Tweak cli flag in commit description
---
 xen/include/public/arch-x86/cpufeatureset.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h
index abab78fa86db..9daaf92988ed 100644
--- a/xen/include/public/arch-x86/cpufeatureset.h
+++ b/xen/include/public/arch-x86/cpufeatureset.h
@@ -121,6 +121,7 @@ XEN_CPUFEATURE(SMX,           1*32+ 6) /*   Safer Mode Extensions */
 XEN_CPUFEATURE(EIST,          1*32+ 7) /*   Enhanced SpeedStep */
 XEN_CPUFEATURE(TM2,           1*32+ 8) /*   Thermal Monitor 2 */
 XEN_CPUFEATURE(SSSE3,         1*32+ 9) /*A  Supplemental Streaming SIMD Extensions-3 */
+XEN_CPUFEATURE(SDBG,          1*32+11) /*   IA32_DEBUG_INTERFACE MSR for silicon debugging support */
 XEN_CPUFEATURE(FMA,           1*32+12) /*A  Fused Multiply Add */
 XEN_CPUFEATURE(CX16,          1*32+13) /*A  CMPXCHG16B */
 XEN_CPUFEATURE(XTPR,          1*32+14) /*   Send Task Priority Messages */
@@ -181,6 +182,7 @@ XEN_CPUFEATURE(XSAVEOPT,      4*32+ 0) /*A  XSAVEOPT instruction */
 XEN_CPUFEATURE(XSAVEC,        4*32+ 1) /*A  XSAVEC/XRSTORC instructions */
 XEN_CPUFEATURE(XGETBV1,       4*32+ 2) /*A  XGETBV with %ecx=1 */
 XEN_CPUFEATURE(XSAVES,        4*32+ 3) /*S  XSAVES/XRSTORS instructions */
+XEN_CPUFEATURE(XFD,           4*32+ 4) /*   MSR_XFD{,_ERR} (eXtended Feature Disable) */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0.ebx, word 5 */
 XEN_CPUFEATURE(FSGSBASE,      5*32+ 0) /*A  {RD,WR}{FS,GS}BASE instructions */
@@ -221,6 +223,7 @@ XEN_CPUFEATURE(AVX512_VBMI,   6*32+ 1) /*A  AVX-512 Vector Byte Manipulation Ins
 XEN_CPUFEATURE(UMIP,          6*32+ 2) /*S  User Mode Instruction Prevention */
 XEN_CPUFEATURE(PKU,           6*32+ 3) /*H  Protection Keys for Userspace */
 XEN_CPUFEATURE(OSPKE,         6*32+ 4) /*!  OS Protection Keys Enable */
+XEN_CPUFEATURE(WAITPKG,       6*32+ 5) /*   UMONITOR/UMWAIT/TPAUSE monitoring support */
 XEN_CPUFEATURE(AVX512_VBMI2,  6*32+ 6) /*A  Additional AVX-512 Vector Byte Manipulation Instrs */
 XEN_CPUFEATURE(CET_SS,        6*32+ 7) /*   CET - Shadow Stacks */
 XEN_CPUFEATURE(GFNI,          6*32+ 8) /*A  Galois Field Instrs */
@@ -228,13 +231,16 @@ XEN_CPUFEATURE(VAES,          6*32+ 9) /*A  Vector AES Instrs */
 XEN_CPUFEATURE(VPCLMULQDQ,    6*32+10) /*A  Vector Carry-less Multiplication Instrs */
 XEN_CPUFEATURE(AVX512_VNNI,   6*32+11) /*A  Vector Neural Network Instrs */
 XEN_CPUFEATURE(AVX512_BITALG, 6*32+12) /*A  Support for VPOPCNT[B,W] and VPSHUFBITQMB */
+XEN_CPUFEATURE(TME,           6*32+13) /*   Total Memory Encryption */
 XEN_CPUFEATURE(AVX512_VPOPCNTDQ, 6*32+14) /*A  POPCNT for vectors of DW/QW */
+XEN_CPUFEATURE(LA57,          6*32+16) /*   5-level paging (57-bit linear address) */
 XEN_CPUFEATURE(RDPID,         6*32+22) /*A  RDPID instruction */
 XEN_CPUFEATURE(BLD,           6*32+24) /*   BusLock Detect (#DB trap) support */
 XEN_CPUFEATURE(CLDEMOTE,      6*32+25) /*A  CLDEMOTE instruction */
 XEN_CPUFEATURE(MOVDIRI,       6*32+27) /*a  MOVDIRI instruction */
 XEN_CPUFEATURE(MOVDIR64B,     6*32+28) /*a  MOVDIR64B instruction */
 XEN_CPUFEATURE(ENQCMD,        6*32+29) /*   ENQCMD{,S} instructions */
+XEN_CPUFEATURE(SGX_LC,        6*32+30) /*   SGX Launch Configuration */
 XEN_CPUFEATURE(PKS,           6*32+31) /*H  Protection Key for Supervisor */
 
 /* AMD-defined CPU features, CPUID level 0x80000007.edx, word 7 */
@@ -264,6 +270,7 @@ XEN_CPUFEATURE(BTC_NO,        8*32+29) /*A  Hardware not vulnerable to Branch Ty
 XEN_CPUFEATURE(IBPB_RET,      8*32+30) /*A  IBPB clears RSB/RAS too. */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0.edx, word 9 */
+XEN_CPUFEATURE(SGX_KEYS,      9*32+ 1) /*   SGX Attestation Service */
 XEN_CPUFEATURE(AVX512_4VNNIW, 9*32+ 2) /*   Xeon Phi AVX512 Neural Network Instructions */
 XEN_CPUFEATURE(AVX512_4FMAPS, 9*32+ 3) /*   Xeon Phi AVX512 Multiply Accumulation Single Precision */
 XEN_CPUFEATURE(FSRM,          9*32+ 4) /*A  Fast Short REP MOVS */
@@ -276,10 +283,13 @@ XEN_CPUFEATURE(TSX_FORCE_ABORT, 9*32+13) /* MSR_TSX_FORCE_ABORT.RTM_ABORT */
 XEN_CPUFEATURE(SERIALIZE,     9*32+14) /*A  SERIALIZE insn */
 XEN_CPUFEATURE(HYBRID,        9*32+15) /*   Heterogeneous platform */
 XEN_CPUFEATURE(TSXLDTRK,      9*32+16) /*a  TSX load tracking suspend/resume insns */
+XEN_CPUFEATURE(PCONFIG,       9*32+18) /*   PCONFIG insn */
 XEN_CPUFEATURE(ARCH_LBR,      9*32+19) /*   Architectural Last Branch Record */
 XEN_CPUFEATURE(CET_IBT,       9*32+20) /*   CET - Indirect Branch Tracking */
+XEN_CPUFEATURE(AMX_BF16,      9*32+22) /*   Tile computational operations on bfloat16 numbers */
 XEN_CPUFEATURE(AVX512_FP16,   9*32+23) /*A  AVX512 FP16 instructions */
 XEN_CPUFEATURE(AMX_TILE,      9*32+24) /*   AMX Tile architecture */
+XEN_CPUFEATURE(AMX_INT8,      9*32+25) /*   Tile computational operations on 8-bit integers */
 XEN_CPUFEATURE(IBRSB,         9*32+26) /*A  IBRS and IBPB support (used by Intel) */
 XEN_CPUFEATURE(STIBP,         9*32+27) /*A  STIBP */
 XEN_CPUFEATURE(L1D_FLUSH,     9*32+28) /*S  MSR_FLUSH_CMD and L1D flush. */
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 15:56:39 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 15:56:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781281.1190826 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnhA-00012s-Lk; Wed, 21 Aug 2024 15:56:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781281.1190826; Wed, 21 Aug 2024 15:56:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnhA-00012l-It; Wed, 21 Aug 2024 15:56:24 +0000
Received: by outflank-mailman (input) for mailman id 781281;
 Wed, 21 Aug 2024 15:56:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=YIGS=PU=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgnh9-00010L-6s
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 15:56:23 +0000
Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com
 [2a00:1450:4864:20::531])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e8b83bb6-5fd5-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 17:56:21 +0200 (CEST)
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5bed05c0a2fso6160931a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 08:56:21 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5bf004c2ebfsm3374250a12.1.2024.08.21.08.56.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 08:56:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e8b83bb6-5fd5-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724255780; x=1724860580; 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=v6Je+ckLJh+97f6fcsR2eoHRYR3UlvxLGUbwrJdcHGc=;
        b=BEbPRNxVUJ84eG1XO+K6ymym9z23zxQfMVuKmFkZEBPjzVpFGnoPjFxNitzx0EVT4N
         xrIgmx7Odpeoa2sqW9PXDB7tL8HiPPoiKefs0Mc/Q0JN/17xS+upADdB87u4pGSsfWis
         COj/6RzYgBumO0nOLeer9ldTpwLhy93CAMH+D6Iz9Y1Y6Z6Aj+WhSqF0YGS/ZLcH5WP/
         qbAteYUuCi3Rl4khYUQd0Av3vCa/Ebn5R87zN++tohMOJD4qChTzYrd2+c2M+E6ZheMB
         zTuRBDzPMdpGfpTUQdqG3ycIw9naSrVFYjsBlsHKRwHqx40OBZZ/Vkr+0t/qoEbIDZp4
         UFDQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724255780; x=1724860580;
        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=v6Je+ckLJh+97f6fcsR2eoHRYR3UlvxLGUbwrJdcHGc=;
        b=TIJZYFfznVnmXJ+QHweiHFfpHrZTGf/jKYDCTtTazwEH7yvdrDnYBkx2vfxR7ujric
         1rzRh5qwRfQKOreyoJ9s9xxs6heT5tvPXGYqFHieyPYPtieEp8/YzO4N6oE2Xqcvb2Xp
         0L6/MaA0fejmSszHOmZInrXTHf3Lg28ZvSTBRG3203gcTN2E/BjbDXUeZSVuyuPeppCu
         O3WjaHWPo/BWIIrtkzkuFTAC3562UR7vOcTEpI5webzQGjJFbIGU24ZVG2dWywhbW1SW
         4qwp3T8seMRCB5pflOpypOx0ak8vYuDwlCikuYLRyd4hjYaYC7L+v55yu8usCJxSZyUL
         sINQ==
X-Forwarded-Encrypted: i=1; AJvYcCVrXjXL32dQvYPPO8yNWGI0/1NsyyhMOT17Ur6TpvcSX65KgQuAlWCo/Opn/B7pNBVI87SB3SfhTsc=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw/0ZjFIyu5i23DXZ7mWl0Rhw3/9ejlC5zRr8qWTYtQcSvfvyen
	4S56wUgLAdujkOgItHdto2kNj3+aBdIPRZszzJ25DjzpcWP/g15idZOKvTsbtw==
X-Google-Smtp-Source: AGHT+IHv3t8qEHow6YhTaET4P26rR/ZuBQne1Q8NL7u9z74n7cBNxOjBT50Aq7cICkf/t5SdJM3Zig==
X-Received: by 2002:a05:6402:34d5:b0:5be:fbce:939e with SMTP id 4fb4d7f45d1cf-5bf1efb58c0mr2420221a12.0.1724255780311;
        Wed, 21 Aug 2024 08:56:20 -0700 (PDT)
Message-ID: <bece14e4-61b9-4f6a-891d-4761821dfde7@suse.com>
Date: Wed, 21 Aug 2024 17:56:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: convert op_bytes/opc checks in SIMD emulation
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <bfc9722a-cb6d-45d0-9351-ddfcd0bbb2e0@suse.com>
 <e96daf14-f1ea-4590-baab-62be50f8d54b@citrix.com>
 <02bf330d-83bc-4fcd-9a1e-a3f1228d2873@suse.com>
 <672e8b2b-2bd6-4099-bbf6-67c39f23cca5@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <672e8b2b-2bd6-4099-bbf6-67c39f23cca5@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 21.08.2024 17:10, Andrew Cooper wrote:
> On 21/08/2024 4:03 pm, Jan Beulich wrote:
>> On 21.08.2024 15:37, Andrew Cooper wrote:
>>> I think it would be helpful to at least note the fuzzing aspect in the
>>> commit message.
>> I've added "This way even for insns not covered by the test harness
>> fuzzers will have a chance of noticing issues, should any still exist
>> or new ones be introduced" to the 2nd paragraph.
> 
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks.

>>>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>>>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>>>> @@ -8114,13 +8114,13 @@ x86_emulate(
>>>>      }
>>>>      else if ( state->simd_size != simd_none )
>>>>      {
>>>> -        generate_exception_if(!op_bytes, X86_EXC_UD);
>>>>          generate_exception_if((vex.opcx && (d & TwoOp) &&
>>>>                                 (vex.reg != 0xf || (evex_encoded() && !evex.RX))),
>>>>                                X86_EXC_UD);
>>>>  
>>>> -        if ( !opc )
>>>> -            BUG();
>>>> +        EXPECT(op_bytes);
>>>> +        EXPECT(opc);
>>> This is the only BUG() in x86_emulate.c, and it's right to get rid of it
>>> IMO.
>>>
>>> Therefore, we should have a hunk removing it from
>>> tools/tests/x86_emulator/x86-emulate.h too, which will prevent
>>> reintroduction.
>>>
>>> Maybe even undef BUG somewhere in x86_emulate/private.h?
>> Both of these actions can only be taken if the other BUG() in decode.c
>> also goes away. But yes, what you suggest is probably the best course of
>> action. I guess I'll do that in yet another patch, though.
> 
> Is that BUG() local to your tree?  I cant see it in staging.

I first thought it would be when you mentioned you found only one, but it's
been there for a long time[1], in VEX/EVEX prefix decoding. With a comment
added by you[2].

Jan

[1] https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=11c35f84b53622c429071049b830bb9b7a880eff
[2] https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=933acddf74213f77a5adbb2c10ccd3f72634d456


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 16:06:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 16:06:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781292.1190837 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnqp-0003wm-Gi; Wed, 21 Aug 2024 16:06:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781292.1190837; Wed, 21 Aug 2024 16:06:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnqp-0003we-E4; Wed, 21 Aug 2024 16:06:23 +0000
Received: by outflank-mailman (input) for mailman id 781292;
 Wed, 21 Aug 2024 16:06:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0Njk=PU=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sgnqo-0003sE-1x
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 16:06:22 +0000
Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com
 [2a00:1450:4864:20::12c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4e4e80ed-5fd7-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 18:06:21 +0200 (CEST)
Received: by mail-lf1-x12c.google.com with SMTP id
 2adb3069b0e04-53345dcd377so2438320e87.2
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 09:06:21 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5334c75a2cbsm18101e87.187.2024.08.21.09.06.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 21 Aug 2024 09:06:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4e4e80ed-5fd7-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724256380; x=1724861180; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=oUVh97Qey83DY9CbPXoXhl8KPvCK+TDOmaW7a07nuQg=;
        b=T0FkaP9G92/Yhi4jij1NwZdvnDjmXZnorVi2nZqcP+uJjNApMywP2oUBAiaEg0ilY4
         wWgkZVR4B/DsxK6NbWDrxN/dX1H1+N5v4bazOOCOMMk2aIbhNrGrTUKSwZBJRLuNr3Gi
         PV06JQRw0Pn39HTNthhFiljsGjBOwYYj+XxqmKmGLxR8TAzbXLtOKyt5Mak1ilmMtiF2
         MaF8rwx0e2dTWsKZxsb4h5cF+y1v9pPHrwd1JJeDeBUif76QEXKt4zto3Rv/1qTEa84l
         nMfNaO8ygKXPN46Fj4F9seYDTZ5pl2gjlBBMT//rOi11njIm7o/ROifEKnlnbvc4RXXo
         7nHQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724256380; x=1724861180;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=oUVh97Qey83DY9CbPXoXhl8KPvCK+TDOmaW7a07nuQg=;
        b=Ouwxv8DQ6tx9f+LOb184uMeShw+MKDyoEVz+2JgYPaEInZxuYxwmGTZsdSbTITqMJT
         npLyMhMrXfjjcv6fEM+36/juTpb/AFfgRRG7FbT8GLITDkAnBuZ46t/BdslMyf7G/45X
         u3B+KYOKV7uyU2uRdT+P0GepVs067ohQdZ8n3M/HqhK5xVbEtfZdqm8jvSyw0dSY+JMh
         hY2QMoc2vbuQcu5HIZTWmTWZKOlBxmMlX8Vgy84y3GXwFTkNSm+JLpP4tidL3jaXkWQ8
         +FAKJAM/Xv7AbSKluDgFAEonDXGZzox8zQZS0WSmYTAjXeaGiQbdIlAAHqxBWaybBFai
         Wr+g==
X-Gm-Message-State: AOJu0YyYzafXMQRjOIkyOjwOChAzt+lPKcyBich9SECrLd/TLC/RfbvW
	IFiy7iTPk7I086e3qDNiNIk2/O5F8ZTNsGr2phf0iHqApn+eE3gSZFMJmA==
X-Google-Smtp-Source: AGHT+IFkcBxZH+LiYKKUWiJHZGQpVOtt27YoKTTHB/eWwF8PoQAJuionkeNK6Ibih0k5uKidJe0FJQ==
X-Received: by 2002:a05:6512:118f:b0:52e:a699:2c8c with SMTP id 2adb3069b0e04-533485f2f40mr1810308e87.45.1724256379412;
        Wed, 21 Aug 2024 09:06:19 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 0/7]  RISCV device tree mapping
Date: Wed, 21 Aug 2024 18:06:09 +0200
Message-ID: <cover.1724256026.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Current patch series introduces device tree mapping for RISC-V
and necessary things for that such as:
- Fixmap mapping
- pmap
- Xen page table processing

---
Changes in v5:
 - The following patch was merged to staging:
     [PATCH v3 3/9] xen/riscv: enable CONFIG_HAS_DEVICE_TREE
 - Drop depedency from "RISCV basic exception handling implementation" as
   it was meged to staging branch.
 - All other changes are patch specific so please look at the patch.
---
Changes in v4:
 - Drop depedency from common devicre tree patch series as it was merged to
   staging.
 - Update the cover letter message.
 - All other changes are patch specific so please look at the patch.
---
Changes in v3:
 - Introduce SBI RFENCE extension support.
 - Introduce and initialize pcpu_info[] and __cpuid_to_hartid_map[] and functionality
   to work with this arrays.
 - Make page table handling arch specific instead of trying to make it generic.
 - All other changes are patch specific so please look at the patch.
---
Changes in v2:
 - Update the cover letter message
 - introduce fixmap mapping
 - introduce pmap
 - introduce CONFIG_GENREIC_PT
 - update use early_fdt_map() after MMU is enabled.
---

Oleksii Kurochko (7):
  xen/riscv: use {read,write}{b,w,l,q}_cpu() to define
    {read,write}_atomic()
  xen/riscv: set up fixmap mappings
  xen/riscv: introduce asm/pmap.h header
  xen/riscv: introduce functionality to work with CPU info
  xen/riscv: introduce and initialize SBI RFENCE extension
  xen/riscv: page table handling
  xen/riscv: introduce early_fdt_map()

 xen/arch/riscv/Kconfig                      |   1 +
 xen/arch/riscv/Makefile                     |   3 +
 xen/arch/riscv/include/asm/atomic.h         |  25 +-
 xen/arch/riscv/include/asm/config.h         |  15 +-
 xen/arch/riscv/include/asm/fixmap.h         |  46 +++
 xen/arch/riscv/include/asm/flushtlb.h       |  18 +
 xen/arch/riscv/include/asm/mm.h             |   6 +
 xen/arch/riscv/include/asm/page.h           |  76 ++++
 xen/arch/riscv/include/asm/pmap.h           |  36 ++
 xen/arch/riscv/include/asm/processor.h      |  29 +-
 xen/arch/riscv/include/asm/riscv_encoding.h |   1 +
 xen/arch/riscv/include/asm/sbi.h            |  63 +++
 xen/arch/riscv/include/asm/smp.h            |  11 +
 xen/arch/riscv/mm.c                         | 101 ++++-
 xen/arch/riscv/pt.c                         | 420 ++++++++++++++++++++
 xen/arch/riscv/riscv64/head.S               |   4 +
 xen/arch/riscv/sbi.c                        | 273 ++++++++++++-
 xen/arch/riscv/setup.c                      |  17 +
 xen/arch/riscv/smp.c                        |  21 +
 xen/arch/riscv/smpboot.c                    |   8 +
 xen/arch/riscv/xen.lds.S                    |   2 +-
 21 files changed, 1150 insertions(+), 26 deletions(-)
 create mode 100644 xen/arch/riscv/include/asm/fixmap.h
 create mode 100644 xen/arch/riscv/include/asm/pmap.h
 create mode 100644 xen/arch/riscv/pt.c
 create mode 100644 xen/arch/riscv/smp.c
 create mode 100644 xen/arch/riscv/smpboot.c

-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 16:06:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 16:06:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781295.1190860 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnqs-0004L0-Fy; Wed, 21 Aug 2024 16:06:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781295.1190860; Wed, 21 Aug 2024 16:06:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnqs-0004I8-80; Wed, 21 Aug 2024 16:06:26 +0000
Received: by outflank-mailman (input) for mailman id 781295;
 Wed, 21 Aug 2024 16:06:24 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0Njk=PU=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sgnqq-0003uu-6Z
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 16:06:24 +0000
Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com
 [2a00:1450:4864:20::12b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4f331334-5fd7-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 18:06:22 +0200 (CEST)
Received: by mail-lf1-x12b.google.com with SMTP id
 2adb3069b0e04-52f04b4abdcso8743452e87.2
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 09:06:22 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5334c75a2cbsm18101e87.187.2024.08.21.09.06.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 21 Aug 2024 09:06:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4f331334-5fd7-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724256382; x=1724861182; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=BLz0fdaEn9M6EZ8vs11WJaaTwf00UXtzFeAQe7wZRQI=;
        b=Nmu7JmS39P/F69yNrqtsZZFHoM39iDs3tEYrOU7gmqEB2EshWA930hWZPytP37KgDz
         To9v3pdQpYDTeb9QiP48MHjFQZLt6wgPMsTuzThTlJnjPeQE7XPlRZOpkebpwnTNbVvS
         NmC1nSGFDpbOnlWfBSuFvaHix0m3lx68XFN+JY3r9eK8w2ScRUaCQKrJYt71bfz0oeg3
         36fIaASIHHfS17tOxiBcjX/j18UwVyyLa5PGVack93LBsx0f4bIMWtygrwpHB1+o7BOv
         n602xku6b4EtPa7ogT4YwON3TpHy4U7ZsOyL137b6wBzL2QNiNXmX8sdNOSVx3ODt79O
         4EZA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724256382; x=1724861182;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=BLz0fdaEn9M6EZ8vs11WJaaTwf00UXtzFeAQe7wZRQI=;
        b=nRj+nQ6mvu/tDajQ1DF7w7fKaNFF0forNyUkZgtkvl/xJYLZWopzG6kKPUhvEBHrgR
         iyHrUw+f9Pn8Ij6iUo61vvzE5EbqRXkIhp/FwSRlLcWiibWWExiVubLQ6gqH8KHeiUxL
         78qXAqdMv/boIxIdR2S+lPDSqFBLjiaAOFHIJcl/tH6KkDXSNkNFQZal1l8BX4DF66Il
         o4vcD2qLdoy5nUdnq8P6vuxTYjp99Irct4eE0ZaiwW+sxZPQpkcmmhmenF7U301OHo7V
         BbglPPkCC/3Ta38Wl3vWdgxfTFHcmmGmGsjKKttWVGiNrtjOqKAVtsQMZK3LVSFo+kLu
         SpHA==
X-Gm-Message-State: AOJu0YyfbzueBuY+o8580kbptSBcbp9kkQBFCJ+8Ejm9j6ua9gavhGYs
	6n5aBeWktsRl27uAdUm3CGrEpCCDHS+Kw2K7G+CLlHqoHX/PUPVkqf9qnw==
X-Google-Smtp-Source: AGHT+IFJURTseMyfZqkL6FC3Nxd7M5I4sZ5oyZNdRtXlsvM0rlWrb+UJIabg0mR98uJA9W0+HDtV5Q==
X-Received: by 2002:a05:6512:3da1:b0:52e:98f6:c21f with SMTP id 2adb3069b0e04-533485515c7mr1994577e87.16.1724256380960;
        Wed, 21 Aug 2024 09:06:20 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 2/7] xen/riscv: set up fixmap mappings
Date: Wed, 21 Aug 2024 18:06:11 +0200
Message-ID: <57e892d5b2c526dd44b68d4976796a25c0feca20.1724256027.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <cover.1724256026.git.oleksii.kurochko@gmail.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Set up fixmap mappings and the L0 page table for fixmap support.

Define new macros in riscv/config.h for calculating
the FIXMAP_BASE address, including BOOT_FDT_VIRT_{START, SIZE},
XEN_VIRT_SIZE, and XEN_VIRT_END.

Update the check for Xen size in riscv/lds.S to use
XEN_VIRT_SIZE instead of a hardcoded constant.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V5:
 - move definition of FIXMAP_ADDR() to asm/fixmap.h
 - add gap size equal to 2 MB ( 512 * 4K one page table entry in L1 page table )
   between Xen, FDT and Fixmap.
 - drop the comment for FIX_LAST.
 - move +1 from FIX_LAST definition to FIXADDR_TOP to be aligned with Arm.
   ( probably everything below FIX_LAST will be moved to a separate header in asm/generic.h )
 - correct the "changes in V4: s/'fence r,r'/'fence rw, rw'
 - use write_atomic() in set_pte().
 - introduce read_pte().
---
Changes in V4:
 - move definitions of XEN_VIRT_SIZE, BOOT_FDT_VIRT_{START,SIZE}, FIXMAP_{BASE,ADDR}
   below XEN_VIRT_START to have definitions appear in order.
 - define FIX_LAST as (FIX_MISC + 1) to have a guard slot at the end.
 - s/enumerated/numbered in the comment
 - update the cycle which looks for L1 page table in setup_fixmap_mapping_function() and
   the comment above him.
 - drop fences inside write_pte() and put 'fence rw,rw' in setup_fixmap() before sfence_vma().
 - update the commit message
 - drop printk message inside setup_fixmap().
---
Changes in V3:
 - s/XEN_SIZE/XEN_VIRT_SIZE
 - drop usage of XEN_VIRT_END.
 - sort newly introduced defines in config.h by address
 - code style fixes
 - drop runtime check of that pte is valid as it was checked in L1 page table finding cycle by BUG_ON().
 - update implementation of write_pte() with FENCE rw, rw.
 - add BUILD_BUG_ON() to check that amount of entries aren't bigger then entries in page table.
 - drop set_fixmap, clear_fixmap declarations as they aren't used and defined now
 - update the commit message.
 - s/__ASM_FIXMAP_H/ASM_FIXMAP_H
 - add SPDX-License-Identifier: GPL-2.0 
---
 xen/arch/riscv/include/asm/config.h | 15 ++++++++--
 xen/arch/riscv/include/asm/fixmap.h | 46 +++++++++++++++++++++++++++++
 xen/arch/riscv/include/asm/mm.h     |  2 ++
 xen/arch/riscv/include/asm/page.h   | 13 ++++++++
 xen/arch/riscv/mm.c                 | 43 +++++++++++++++++++++++++++
 xen/arch/riscv/setup.c              |  2 ++
 xen/arch/riscv/xen.lds.S            |  2 +-
 7 files changed, 120 insertions(+), 3 deletions(-)
 create mode 100644 xen/arch/riscv/include/asm/fixmap.h

diff --git a/xen/arch/riscv/include/asm/config.h b/xen/arch/riscv/include/asm/config.h
index 50583aafdc..f55d6c45da 100644
--- a/xen/arch/riscv/include/asm/config.h
+++ b/xen/arch/riscv/include/asm/config.h
@@ -41,8 +41,10 @@
  * Start addr          | End addr         | Slot       | area description
  * ============================================================================
  *                   .....                 L2 511          Unused
- *  0xffffffffc0600000  0xffffffffc0800000 L2 511          Fixmap
- *  0xffffffffc0200000  0xffffffffc0600000 L2 511          FDT
+ *  0xffffffffc0A00000  0xffffffffc0C00000 L2 511          Fixmap
+ *                   ..... ( 2 MB gap )
+ *  0xffffffffc0400000  0xffffffffc0800000 L2 511          FDT
+ *                   ..... ( 2 MB gap )
  *  0xffffffffc0000000  0xffffffffc0200000 L2 511          Xen
  *                   .....                 L2 510          Unused
  *  0x3200000000        0x7f40000000       L2 200-509      Direct map
@@ -74,6 +76,15 @@
 #error "unsupported RV_STAGE1_MODE"
 #endif
 
+#define GAP_SIZE                MB(2)
+
+#define XEN_VIRT_SIZE           MB(2)
+
+#define BOOT_FDT_VIRT_START     (XEN_VIRT_START + XEN_VIRT_SIZE + GAP_SIZE)
+#define BOOT_FDT_VIRT_SIZE      MB(4)
+
+#define FIXMAP_BASE             (BOOT_FDT_VIRT_START + BOOT_FDT_VIRT_SIZE + GAP_SIZE)
+
 #define DIRECTMAP_SLOT_END      509
 #define DIRECTMAP_SLOT_START    200
 #define DIRECTMAP_VIRT_START    SLOTN(DIRECTMAP_SLOT_START)
diff --git a/xen/arch/riscv/include/asm/fixmap.h b/xen/arch/riscv/include/asm/fixmap.h
new file mode 100644
index 0000000000..63732df36c
--- /dev/null
+++ b/xen/arch/riscv/include/asm/fixmap.h
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * fixmap.h: compile-time virtual memory allocation
+ */
+#ifndef ASM_FIXMAP_H
+#define ASM_FIXMAP_H
+
+#include <xen/bug.h>
+#include <xen/page-size.h>
+#include <xen/pmap.h>
+
+#include <asm/page.h>
+
+#define FIXMAP_ADDR(n) (FIXMAP_BASE + (n) * PAGE_SIZE)
+
+/* Fixmap slots */
+#define FIX_PMAP_BEGIN (0) /* Start of PMAP */
+#define FIX_PMAP_END (FIX_PMAP_BEGIN + NUM_FIX_PMAP - 1) /* End of PMAP */
+#define FIX_MISC (FIX_PMAP_END + 1)  /* Ephemeral mappings of hardware */
+
+#define FIX_LAST FIX_MISC
+
+#define FIXADDR_START FIXMAP_ADDR(0)
+#define FIXADDR_TOP FIXMAP_ADDR(FIX_LAST + 1)
+
+#ifndef __ASSEMBLY__
+
+/*
+ * Direct access to xen_fixmap[] should only happen when {set,
+ * clear}_fixmap() is unusable (e.g. where we would end up to
+ * recursively call the helpers).
+ */
+extern pte_t xen_fixmap[];
+
+#define fix_to_virt(slot) ((void *)FIXMAP_ADDR(slot))
+
+static inline unsigned int virt_to_fix(vaddr_t vaddr)
+{
+    BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
+
+    return ((vaddr - FIXADDR_START) >> PAGE_SHIFT);
+}
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* ASM_FIXMAP_H */
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index 25af9e1aaa..a0bdc2bc3a 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -255,4 +255,6 @@ static inline unsigned int arch_get_dma_bitsize(void)
     return 32; /* TODO */
 }
 
+void setup_fixmap_mappings(void);
+
 #endif /* _ASM_RISCV_MM_H */
diff --git a/xen/arch/riscv/include/asm/page.h b/xen/arch/riscv/include/asm/page.h
index c831e16417..a7419b93b2 100644
--- a/xen/arch/riscv/include/asm/page.h
+++ b/xen/arch/riscv/include/asm/page.h
@@ -9,6 +9,7 @@
 #include <xen/bug.h>
 #include <xen/types.h>
 
+#include <asm/atomic.h>
 #include <asm/mm.h>
 #include <asm/page-bits.h>
 
@@ -81,6 +82,18 @@ static inline void flush_page_to_ram(unsigned long mfn, bool sync_icache)
     BUG_ON("unimplemented");
 }
 
+/* Write a pagetable entry. */
+static inline void write_pte(pte_t *p, pte_t pte)
+{
+    write_atomic(p, pte);
+}
+
+/* Read a pagetable entry. */
+static inline pte_t read_pte(pte_t *p)
+{
+    return read_atomic(p);
+}
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_RISCV_PAGE_H */
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index 7d09e781bf..b8ff91cf4e 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -12,6 +12,7 @@
 #include <asm/early_printk.h>
 #include <asm/csr.h>
 #include <asm/current.h>
+#include <asm/fixmap.h>
 #include <asm/page.h>
 #include <asm/processor.h>
 
@@ -49,6 +50,9 @@ stage1_pgtbl_root[PAGETABLE_ENTRIES];
 pte_t __section(".bss.page_aligned") __aligned(PAGE_SIZE)
 stage1_pgtbl_nonroot[PGTBL_INITIAL_COUNT * PAGETABLE_ENTRIES];
 
+pte_t __section(".bss.page_aligned") __aligned(PAGE_SIZE)
+xen_fixmap[PAGETABLE_ENTRIES];
+
 #define HANDLE_PGTBL(curr_lvl_num)                                          \
     index = pt_index(curr_lvl_num, page_addr);                              \
     if ( pte_is_valid(pgtbl[index]) )                                       \
@@ -191,6 +195,45 @@ static bool __init check_pgtbl_mode_support(struct mmu_desc *mmu_desc,
     return is_mode_supported;
 }
 
+void __init setup_fixmap_mappings(void)
+{
+    pte_t *pte, tmp;
+    unsigned int i;
+
+    BUILD_BUG_ON(FIX_LAST >= PAGETABLE_ENTRIES);
+
+    pte = &stage1_pgtbl_root[pt_index(HYP_PT_ROOT_LEVEL, FIXMAP_ADDR(0))];
+
+    /*
+     * In RISC-V page table levels are numbered from Lx to L0 where
+     * x is the highest page table level for currect  MMU mode ( for example,
+     * for Sv39 has 3 page tables so the x = 2 (L2 -> L1 -> L0) ).
+     *
+     * In this cycle we want to find L1 page table because as L0 page table
+     * xen_fixmap[] will be used.
+     */
+    for ( i = HYP_PT_ROOT_LEVEL; i-- > 1; )
+    {
+        BUG_ON(!pte_is_valid(*pte));
+
+        pte = (pte_t *)LOAD_TO_LINK(pte_to_paddr(*pte));
+        pte = &pte[pt_index(i, FIXMAP_ADDR(0))];
+    }
+
+    BUG_ON(pte_is_valid(*pte));
+
+    tmp = paddr_to_pte(LINK_TO_LOAD((unsigned long)&xen_fixmap), PTE_TABLE);
+    write_pte(pte, tmp);
+
+    RISCV_FENCE(rw, rw);
+    sfence_vma();
+
+    /*
+     * We only need the zeroeth table allocated, but not the PTEs set, because
+     * set_fixmap() will set them on the fly.
+     */
+}
+
 /*
  * setup_initial_pagetables:
  *
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index 4defad68f4..13f0e8c77d 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -46,6 +46,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
     test_macros_from_bug_h();
 #endif
 
+    setup_fixmap_mappings();
+
     printk("All set up\n");
 
     for ( ;; )
diff --git a/xen/arch/riscv/xen.lds.S b/xen/arch/riscv/xen.lds.S
index 070b19d915..7a683f6065 100644
--- a/xen/arch/riscv/xen.lds.S
+++ b/xen/arch/riscv/xen.lds.S
@@ -181,6 +181,6 @@ ASSERT(!SIZEOF(.got.plt),  ".got.plt non-empty")
  * Changing the size of Xen binary can require an update of
  * PGTBL_INITIAL_COUNT.
  */
-ASSERT(_end - _start <= MB(2), "Xen too large for early-boot assumptions")
+ASSERT(_end - _start <= XEN_VIRT_SIZE, "Xen too large for early-boot assumptions")
 
 ASSERT(_ident_end - _ident_start <= IDENT_AREA_SIZE, "identity region is too big");
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 16:06:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 16:06:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781294.1190851 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnqs-0004E1-1C; Wed, 21 Aug 2024 16:06:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781294.1190851; Wed, 21 Aug 2024 16:06:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnqr-0004CV-Sm; Wed, 21 Aug 2024 16:06:25 +0000
Received: by outflank-mailman (input) for mailman id 781294;
 Wed, 21 Aug 2024 16:06:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0Njk=PU=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sgnqp-0003sE-Od
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 16:06:23 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4faece5b-5fd7-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 18:06:23 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-52f01613acbso1135482e87.1
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 09:06:23 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5334c75a2cbsm18101e87.187.2024.08.21.09.06.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 21 Aug 2024 09:06:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4faece5b-5fd7-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724256382; x=1724861182; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=SUWnXdeASKM3s0vW7zMmdmova3lTcgmrVyUhj9D0sEQ=;
        b=m3j2xzRBYQz51sLqUih/NTDVf7/NSsJ4rTInJQ+Xarmkb191UgxucZ6zubyv98539m
         k3Ci529XmK335nFBOKLyXW71ZvUO+Y/PbnCyUnlZ5V28/dnnfWGHeotiiDFySHfmUxJ3
         ioon6H4CjXdmnA96y1veJzJkSj/rTqS/a1Tw0EjhnQqu6y6OMXoZ3tPk3ZxKws3zBEP7
         pg5rhlLuDuWxbiCK9//STWouHkc/+OtQM+1GTtddza0nGf99BoPKQJpdThXM6S2dGaS9
         UsEACwAeW+Vh9ND5A/kBf31WcY11ecezUdDFQtTQdd2CnG+bjAdGWv4hHG/ria1shKxX
         DMsw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724256382; x=1724861182;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=SUWnXdeASKM3s0vW7zMmdmova3lTcgmrVyUhj9D0sEQ=;
        b=lFDWd91FTkydXbgFtvEdgBjs/TsDUgoizTpJDqMr45HMK76vODA1tRuhC+j1WwyhAT
         XyFCyOmtWZhuy4+74LPtT8bEubyKvF18ClvL32CcCAZypQiE1cJNVKfbfPVu4ebrCk2M
         vc1VhGbw7JPYLjaSKVloZLAccUg3U6EDsNelJMj90M7FXg04lt3bg7IBYZAMTMPdCx6f
         +dLFMVF1sMDPniV4Dv5YkbfTgKP+zVa6ElBVh2C47rnkabojKYoEJV8zDf7P0wgyNKXF
         g1rvy0vOnH0neFpG+G4LXBlEIDEuQ2LaNZUNmJ2HrvbDbvdgtJ20EYIeWk/NU3358p6p
         Sk8g==
X-Gm-Message-State: AOJu0YxAWxEUpL1sHLG1iG/x/Rgu7NhuoCdz0ohTqArKH16EooM75O4V
	d9eV/iFK8tzf7v5Gj1cTawt11updnoyqZ5OFG57fzHeQhi/9juP5pIAzYQ==
X-Google-Smtp-Source: AGHT+IGly+3FqelWmnfZ4T6w26becCVTPBLUHuQXOh7Aci+pcMZxXbsLZRWwPuwV0jnSTRkjQ9mktg==
X-Received: by 2002:a05:6512:1115:b0:52b:aae0:2d41 with SMTP id 2adb3069b0e04-5334caa4b27mr41128e87.28.1724256381689;
        Wed, 21 Aug 2024 09:06:21 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 3/7] xen/riscv: introduce asm/pmap.h header
Date: Wed, 21 Aug 2024 18:06:12 +0200
Message-ID: <f9cc8dd9179c6510583b85b2d00cf9600e098e10.1724256027.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <cover.1724256026.git.oleksii.kurochko@gmail.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Introduce arch_pmap_{un}map functions and select HAS_PMAP for CONFIG_RISCV.

Add pte_from_mfn() for use in arch_pmap_map().

Introduce flush_xen_tlb_one_local() and use it in arch_pmap_{un}map().

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
Changes in V5:
 - Add Reviewed-by: Jan Beulich <jbeulich@suse.com>.
 - Fix a typo in "Changes in V4":
   - "drop flush_xen_tlb_range_va_local() as it isn't used in this patch" ->
     "drop flush_xen_tlb_range_va() as it isn't used in this patch"
   - "s/flush_xen_tlb_range_va_local/flush_tlb_range_va_local" ->
     "s/flush_xen_tlb_one_local/flush_tlb_one_local"
---
Changes in V4:
 - mark arch_pmap_{un}map() as __init: documentation purpose and
   a necessary (but not sufficient) condition here, to validly
   use local TLB flushes only.
 - add flush_xen_tlb_one_local() to arch_pmap_map() as absense of
   "negative" TLB entrues will be guaranted only in the case
   when Svvptc extension is present.
 - s/mfn_from_pte/pte_from_mfn
 - drop mfn_to_xen_entry() as pte_from_mfn() does the same thing
 - add flags argument to pte_from_mfn().
 - update the commit message.
 - drop flush_xen_tlb_range_va() as it isn't used in this patch
 - s/flush_xen_tlb_one_local/flush_tlb_one_local
---
Changes in V3:
 - rename argument of function mfn_to_xen_entry(..., attr -> flags ).
 - update the code of mfn_to_xen_entry() to use flags argument.
 - add blank in mfn_from_pte() in return line.
 - introduce flush_xen_tlb_range_va_local() and use it inside arch_pmap_{un}map().
 - s/__ASM_PMAP_H__/ASM_PMAP_H
 - add SPDX-License-Identifier: GPL-2.0 
---
 xen/arch/riscv/Kconfig                |  1 +
 xen/arch/riscv/include/asm/flushtlb.h |  6 +++++
 xen/arch/riscv/include/asm/page.h     |  6 +++++
 xen/arch/riscv/include/asm/pmap.h     | 36 +++++++++++++++++++++++++++
 4 files changed, 49 insertions(+)
 create mode 100644 xen/arch/riscv/include/asm/pmap.h

diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index 259eea8d3b..0112aa8778 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -3,6 +3,7 @@ config RISCV
 	select FUNCTION_ALIGNMENT_16B
 	select GENERIC_BUG_FRAME
 	select HAS_DEVICE_TREE
+	select HAS_PMAP
 
 config RISCV_64
 	def_bool y
diff --git a/xen/arch/riscv/include/asm/flushtlb.h b/xen/arch/riscv/include/asm/flushtlb.h
index 7ce32bea0b..f4a735fd6c 100644
--- a/xen/arch/riscv/include/asm/flushtlb.h
+++ b/xen/arch/riscv/include/asm/flushtlb.h
@@ -5,6 +5,12 @@
 #include <xen/bug.h>
 #include <xen/cpumask.h>
 
+/* Flush TLB of local processor for address va. */
+static inline void flush_tlb_one_local(vaddr_t va)
+{
+    asm volatile ( "sfence.vma %0" :: "r" (va) : "memory" );
+}
+
 /*
  * Filter the given set of CPUs, removing those that definitely flushed their
  * TLB since @page_timestamp.
diff --git a/xen/arch/riscv/include/asm/page.h b/xen/arch/riscv/include/asm/page.h
index a7419b93b2..55916eaa92 100644
--- a/xen/arch/riscv/include/asm/page.h
+++ b/xen/arch/riscv/include/asm/page.h
@@ -94,6 +94,12 @@ static inline pte_t read_pte(pte_t *p)
     return read_atomic(p);
 }
 
+static inline pte_t pte_from_mfn(mfn_t mfn, unsigned int flags)
+{
+    unsigned long pte = (mfn_x(mfn) << PTE_PPN_SHIFT) | flags;
+    return (pte_t){ .pte = pte };
+}
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* _ASM_RISCV_PAGE_H */
diff --git a/xen/arch/riscv/include/asm/pmap.h b/xen/arch/riscv/include/asm/pmap.h
new file mode 100644
index 0000000000..60065c996f
--- /dev/null
+++ b/xen/arch/riscv/include/asm/pmap.h
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef ASM_PMAP_H
+#define ASM_PMAP_H
+
+#include <xen/bug.h>
+#include <xen/init.h>
+#include <xen/mm.h>
+#include <xen/page-size.h>
+
+#include <asm/fixmap.h>
+#include <asm/flushtlb.h>
+#include <asm/system.h>
+
+static inline void __init arch_pmap_map(unsigned int slot, mfn_t mfn)
+{
+    pte_t *entry = &xen_fixmap[slot];
+    pte_t pte;
+
+    ASSERT(!pte_is_valid(*entry));
+
+    pte = pte_from_mfn(mfn, PAGE_HYPERVISOR_RW);
+    write_pte(entry, pte);
+
+    flush_tlb_one_local(FIXMAP_ADDR(slot));
+}
+
+static inline void __init arch_pmap_unmap(unsigned int slot)
+{
+    pte_t pte = {};
+
+    write_pte(&xen_fixmap[slot], pte);
+
+    flush_tlb_one_local(FIXMAP_ADDR(slot));
+}
+
+#endif /* ASM_PMAP_H */
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 16:06:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 16:06:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781296.1190868 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnqt-0004XO-0t; Wed, 21 Aug 2024 16:06:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781296.1190868; Wed, 21 Aug 2024 16:06:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnqs-0004Vb-PX; Wed, 21 Aug 2024 16:06:26 +0000
Received: by outflank-mailman (input) for mailman id 781296;
 Wed, 21 Aug 2024 16:06:25 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0Njk=PU=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sgnqr-0003uu-IN
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 16:06:25 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 50147560-5fd7-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 18:06:23 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-52efe4c7c16so8788929e87.0
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 09:06:23 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5334c75a2cbsm18101e87.187.2024.08.21.09.06.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 21 Aug 2024 09:06:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 50147560-5fd7-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724256383; x=1724861183; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=eIHhs5IXiWMtLXpZ4bVpcdEviO9myYu2vT9d0eE7bZY=;
        b=NrHgAFgaZGQ5NaUhdRTGs9gRRhpUjgWB/MXm2BqgaN9avVgaruc2/2CGnnu520KV8s
         MnnNZNyF/yrZMuDDKqqnzHHqNRknjcIo0Neoy8MFpfIJMenRUFq20K1mAH3M51LJMFjt
         8JkRKcFmZg+x5Q5lviNbMN/uiucBUaFV6m94fj1VoZRXwBXvtiX5trjJJObZNZKRep6h
         6HiJQX7Y9S9PN6OKYTVQNxmwjSHX3Z/dtqgTM8tfW8oMwP9ZqOASX4INI4tZcPPRnPmE
         7HmWELLM0RlHzw51I/ZG61BC6vsyPzKJhZuTAe8Y0S1qIWqk8EcvwVvyy8zepuBk0OSv
         DYPQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724256383; x=1724861183;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=eIHhs5IXiWMtLXpZ4bVpcdEviO9myYu2vT9d0eE7bZY=;
        b=F+q5Rwl5CnJf2Sd6NRfNDzN7jjFHA5OhMXJ9ExGtJY3izp6AaAPoCme2eMFNfeud/0
         4qwBxq73QPl88yqa8zP9PCYRId185fZuo4GjwFC9K650m5saMIiIkkzRFE+EdxtRkF3H
         w8RtKVL0bgOJKqXn+/JvA9yYfG6L76dyvnHDoJJLEx06ttnEcKgKH/0tD/c/gogU8yg/
         toJjeHhCsZkphjap9GOe93bctoBRt+bOP31L+IuR29ajqOUc5/NArEHWdI/m3URE5lyd
         34RkpzWq9FYCWlf7zsn1W4VYj/iODgz07+ktVsjpgxKBWsV7z1J3XCltvbT21IEjd46w
         Bc5g==
X-Gm-Message-State: AOJu0Yx9SseI4pP5KLbvUCSIK+esaBfmAZfzP4LrwmhUcQ2lbq6QsbEt
	svZDnyEodwDtT9a6Nrgr6HZyAOB3f2zAvaKLVIDD/2OsTz9MD+PSqSR4Qw==
X-Google-Smtp-Source: AGHT+IG6t1lR0jPw4fuojzNy3cEPAh/mC8nhkhX+GydsIroadODO5JHSLlrqrXr7W6b2SoluyjhMnQ==
X-Received: by 2002:a05:6512:b10:b0:52e:fc7b:39cb with SMTP id 2adb3069b0e04-533485599aamr1902798e87.26.1724256382485;
        Wed, 21 Aug 2024 09:06:22 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 4/7] xen/riscv: introduce functionality to work with CPU info
Date: Wed, 21 Aug 2024 18:06:13 +0200
Message-ID: <03a703996ae7300a9eda54283711b19c42a7d116.1724256027.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <cover.1724256026.git.oleksii.kurochko@gmail.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Introduce struct pcpu_info to store pCPU-related information.
Initially, it includes only processor_id and hart id, but it
will be extended to include guest CPU information and
temporary variables for saving/restoring vCPU registers.

Add set_processor_id() and get_processor_id() functions to set
and retrieve the processor_id stored in pcpu_info.

Introduce cpuid_to_hartid_map() to convert Xen logical CPUs to
hart IDs (physical CPU IDs).

Define smp_processor_id() to provide accurate information,
replacing the previous "dummy" value of 0.

Initialize tp registers to point to pcpu_info[0].
Set processor_id to 0 for logical CPU 0 and store the physical
CPU ID in pcpu_info[0].

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V5:
 - add hart_id to pcpu_info;
 - add comments to pcpu_info members.
 - define INVALID_HARTID as ULONG_MAX as mhart_id register has MXLEN which is
   equal to 32 for RV-32 and 64 for RV-64.
 - add hart_id to pcpu_info structure.
 - drop cpuid_to_hartid_map[] and use pcpu_info[] for the same purpose.
 - introduce new function setup_tp(cpuid).
 - add the FIXME commit on top of pcpu_info[].
 - setup TP register before start_xen() being called.
 - update the commit message.
 - change "commit message" to "comment" in "Changes in V4" in "update the comment
   above the code of TP..."
---
Changes in V4:
 - wrap id with () inside set_processor_id().
 - code style fixes
 - update BUG_ON(id > NR_CPUS) in smp_processor_id() and drop the comment
   above BUG_ON().
 - s/__cpuid_to_hartid_map/cpuid_to_hartid_map
 - s/cpuid_to_hartid_map/cpuid_to_harti ( here cpuid_to_hartid_map is the name
   of the macros ).
 - update the comment above the code of TP register initialization in
   start_xen().
 - s/smp_setup_processor_id/smp_setup_bootcpu_id
 - update the commit message.
 - cleanup headers which are included in <asm/processor.h>
---
Changes in V3:
 - new patch.
---
 xen/arch/riscv/Makefile                |  2 ++
 xen/arch/riscv/include/asm/processor.h | 29 ++++++++++++++++++++++++--
 xen/arch/riscv/include/asm/smp.h       | 11 ++++++++++
 xen/arch/riscv/riscv64/head.S          |  4 ++++
 xen/arch/riscv/setup.c                 |  5 +++++
 xen/arch/riscv/smp.c                   | 21 +++++++++++++++++++
 xen/arch/riscv/smpboot.c               |  8 +++++++
 7 files changed, 78 insertions(+), 2 deletions(-)
 create mode 100644 xen/arch/riscv/smp.c
 create mode 100644 xen/arch/riscv/smpboot.c

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 81b77b13d6..334fd24547 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -4,6 +4,8 @@ obj-y += mm.o
 obj-$(CONFIG_RISCV_64) += riscv64/
 obj-y += sbi.o
 obj-y += setup.o
+obj-y += smp.o
+obj-y += smpboot.o
 obj-y += stubs.o
 obj-y += traps.o
 obj-y += vm_event.o
diff --git a/xen/arch/riscv/include/asm/processor.h b/xen/arch/riscv/include/asm/processor.h
index 3ae164c265..98c45afb6c 100644
--- a/xen/arch/riscv/include/asm/processor.h
+++ b/xen/arch/riscv/include/asm/processor.h
@@ -12,8 +12,33 @@
 
 #ifndef __ASSEMBLY__
 
-/* TODO: need to be implemeted */
-#define smp_processor_id() 0
+#include <xen/bug.h>
+
+register struct pcpu_info *tp asm ("tp");
+
+struct pcpu_info {
+    unsigned int processor_id; /* Xen CPU id */
+    unsigned long hart_id; /* physical CPU id */
+};
+
+/* tp points to one of these */
+extern struct pcpu_info pcpu_info[NR_CPUS];
+
+#define get_processor_id()      (tp->processor_id)
+#define set_processor_id(id)    do { \
+    tp->processor_id = (id);         \
+} while (0)
+
+static inline unsigned int smp_processor_id(void)
+{
+    unsigned int id;
+
+    id = get_processor_id();
+
+    BUG_ON(id > NR_CPUS);
+
+    return id;
+}
 
 /* On stack VCPU state */
 struct cpu_user_regs
diff --git a/xen/arch/riscv/include/asm/smp.h b/xen/arch/riscv/include/asm/smp.h
index b1ea91b1eb..2b719616ee 100644
--- a/xen/arch/riscv/include/asm/smp.h
+++ b/xen/arch/riscv/include/asm/smp.h
@@ -5,6 +5,10 @@
 #include <xen/cpumask.h>
 #include <xen/percpu.h>
 
+#include <asm/processor.h>
+
+#define INVALID_HARTID ULONG_MAX
+
 DECLARE_PER_CPU(cpumask_var_t, cpu_sibling_mask);
 DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
 
@@ -14,6 +18,13 @@ DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
  */
 #define park_offline_cpus false
 
+void smp_set_bootcpu_id(unsigned long boot_cpu_hartid);
+
+/*
+ * Mapping between linux logical cpu index and hartid.
+ */
+#define cpuid_to_hartid(cpu) pcpu_info[cpu].hart_id
+
 #endif
 
 /*
diff --git a/xen/arch/riscv/riscv64/head.S b/xen/arch/riscv/riscv64/head.S
index 3261e9fce8..9e5b9a0708 100644
--- a/xen/arch/riscv/riscv64/head.S
+++ b/xen/arch/riscv/riscv64/head.S
@@ -55,6 +55,10 @@ FUNC(start)
          */
         jal     reset_stack
 
+        /* Xen's boot cpu id is equal to 0 so setup TP register for it */
+        mv      a0, x0
+        jal     setup_tp
+
         /* restore hart_id ( bootcpu_id ) and dtb address */
         mv      a0, s0
         mv      a1, s1
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index 13f0e8c77d..e15f34509c 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -8,6 +8,7 @@
 #include <public/version.h>
 
 #include <asm/early_printk.h>
+#include <asm/smp.h>
 #include <asm/traps.h>
 
 void arch_get_xen_caps(xen_capabilities_info_t *info)
@@ -40,6 +41,10 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
 {
     remove_identity_mapping();
 
+    set_processor_id(0);
+
+    smp_set_bootcpu_id(bootcpu_id);
+
     trap_init();
 
 #ifdef CONFIG_SELF_TESTS
diff --git a/xen/arch/riscv/smp.c b/xen/arch/riscv/smp.c
new file mode 100644
index 0000000000..478ea5aeab
--- /dev/null
+++ b/xen/arch/riscv/smp.c
@@ -0,0 +1,21 @@
+#include <xen/smp.h>
+
+/*
+ * FIXME: make pcpu_info[] dynamically allocated when necessary
+ *        functionality will be ready
+ */
+/* tp points to one of these per cpu */
+struct pcpu_info pcpu_info[NR_CPUS] = { { 0, INVALID_HARTID } };
+
+void setup_tp(unsigned int cpuid)
+{
+    /*
+     * tp register contains an address of physical cpu information.
+     * So write physical CPU info of cpuid to tp register.
+     * It will be used later by get_processor_id() ( look at
+     * <asm/processor.h> ):
+     *   #define get_processor_id()    (tp->processor_id)
+     */
+    asm volatile ( "mv tp, %0"
+                   :: "r" ((unsigned long)&pcpu_info[cpuid]) : "memory" );
+}
diff --git a/xen/arch/riscv/smpboot.c b/xen/arch/riscv/smpboot.c
new file mode 100644
index 0000000000..34319f8875
--- /dev/null
+++ b/xen/arch/riscv/smpboot.c
@@ -0,0 +1,8 @@
+#include <xen/init.h>
+#include <xen/sections.h>
+#include <xen/smp.h>
+
+void __init smp_set_bootcpu_id(unsigned long boot_cpu_hartid)
+{
+    cpuid_to_hartid(0) = boot_cpu_hartid;
+}
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 16:06:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 16:06:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781293.1190846 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnqr-0004BT-PX; Wed, 21 Aug 2024 16:06:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781293.1190846; Wed, 21 Aug 2024 16:06:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnqr-0004BM-LC; Wed, 21 Aug 2024 16:06:25 +0000
Received: by outflank-mailman (input) for mailman id 781293;
 Wed, 21 Aug 2024 16:06:23 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0Njk=PU=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sgnqp-0003uu-EP
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 16:06:23 +0000
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com
 [2a00:1450:4864:20::130])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4ead5d6b-5fd7-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 18:06:21 +0200 (CEST)
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-52efd8807aaso8706232e87.3
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 09:06:21 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5334c75a2cbsm18101e87.187.2024.08.21.09.06.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 21 Aug 2024 09:06:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4ead5d6b-5fd7-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724256381; x=1724861181; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=MJcUmlEBhml/DSOe7/LwB7DMmIhQg2ECn/XQF26RxOQ=;
        b=aYMUKUWBVeIsGY0nZgav5EwgjquVY9n5ttkAYmXSNL2TQzkMDjqnGjN9VSJGn/iYhi
         H+vpBE3oTlFDH+0sHXDMajB4nejSw31t7CbvVPT1dJE5pLCqJOOWnI9bpgtVHMDKKgV4
         jTA923/ab4drcg73lBeDEcMMAnjol9hWG7ZTraWI2sQ5TVVxVVFWYeCIMDVTOabl1+1m
         Ez+QtOzOIlxVGUWLvQMq/OXFME3LiSCuKEqRB0gP9ubPIRoKWwsasrsNmZ5Hr8t86Ewz
         IG2nFPCB6/zRNfcQGJ2/UE1qdcokaGAQUwHoYM+raELf+DnUX7GJS1X7J/B184e49qmq
         fo8A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724256381; x=1724861181;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=MJcUmlEBhml/DSOe7/LwB7DMmIhQg2ECn/XQF26RxOQ=;
        b=J9wY0ER9ZEulATVrfapKMkDwfPAYyFKpfaw5oEK7S8KMgirsd1C62AxAFEnX50T0Ka
         Pajak1UHA4vOnbEI6mmHqdTXmcYKPgD2MKlDxLOVCoMEjy04zgjDUjwe0corS67lH3uw
         meQPk3aV1tFWw5FHNkIxQbHbE73SOQWyomxkh9Oio08g3c8Q0LGFlQMKiKbfQCgtqlU+
         +gRDLzKroxw8OIH12OUPJD+xcHc+NFlabs01oZIlyxVaJQwTpuxrn++2SKy3k+pXv4Jh
         xKCnk50/2dZTUplulpXIRnkgeX02ppFA1sQ6VtNEDV6SmSWmYVTGJtLww/ZRQvNQDOcw
         B+bw==
X-Gm-Message-State: AOJu0Ywg7NJnXNSQ7JSFz1oxHVO+z7IPoYGBPy/wEFEoU2JYLpJu1+Th
	mnxOWx95J9r6sTnMfBFoY4AJ1RaZ7ocYgWtvERM11VckecS1jaoOlNOwtA==
X-Google-Smtp-Source: AGHT+IHNXlncZxBGdnzMvY3I4TMULDV+gDDUZIYPEq3r5sz55D2tBSipK/7C6CGpcJ+we/eb7sj4JQ==
X-Received: by 2002:a05:6512:a91:b0:52f:ca2b:1d33 with SMTP id 2adb3069b0e04-53348551919mr1686167e87.20.1724256380111;
        Wed, 21 Aug 2024 09:06:20 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 1/7] xen/riscv: use {read,write}{b,w,l,q}_cpu() to define {read,write}_atomic()
Date: Wed, 21 Aug 2024 18:06:10 +0200
Message-ID: <5140f9eb3d1cb0b69e3b1cbbcce6167ff8d59e4c.1724256026.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <cover.1724256026.git.oleksii.kurochko@gmail.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

In Xen, memory-ordered atomic operations are not necessary,
based on {read,write}_atomic() implementations for other architectures.
Therefore, {read,write}{b,w,l,q}_cpu() can be used instead of
{read,write}{b,w,l,q}(), allowing the caller to decide if additional
fences should be applied before or after {read,write}_atomic().

Change the declaration of _write_atomic() to accept a 'volatile void *'
type for the 'x' argument instead of 'unsigned long'.
This prevents compilation errors such as:
1."discards 'volatile' qualifier from pointer target type," which occurs
  due to the initialization of a volatile pointer,
  e.g., `volatile uint8_t *ptr = p;` in _add_sized().
2."incompatible type for argument 2 of '_write_atomic'," which can occur
  when calling write_pte(), where 'x' is of type pte_t rather than
  unsigned long.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in v5:
 - new patch.
---
 xen/arch/riscv/include/asm/atomic.h | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/xen/arch/riscv/include/asm/atomic.h b/xen/arch/riscv/include/asm/atomic.h
index 31b91a79c8..446c8c7928 100644
--- a/xen/arch/riscv/include/asm/atomic.h
+++ b/xen/arch/riscv/include/asm/atomic.h
@@ -31,21 +31,17 @@
 
 void __bad_atomic_size(void);
 
-/*
- * Legacy from Linux kernel. For some reason they wanted to have ordered
- * read/write access. Thereby read* is used instead of read*_cpu()
- */
 static always_inline void read_atomic_size(const volatile void *p,
                                            void *res,
                                            unsigned int size)
 {
     switch ( size )
     {
-    case 1: *(uint8_t *)res = readb(p); break;
-    case 2: *(uint16_t *)res = readw(p); break;
-    case 4: *(uint32_t *)res = readl(p); break;
+    case 1: *(uint8_t *)res = readb_cpu(p); break;
+    case 2: *(uint16_t *)res = readw_cpu(p); break;
+    case 4: *(uint32_t *)res = readl_cpu(p); break;
 #ifndef CONFIG_RISCV_32
-    case 8: *(uint32_t *)res = readq(p); break;
+    case 8: *(uint32_t *)res = readq_cpu(p); break;
 #endif
     default: __bad_atomic_size(); break;
     }
@@ -58,15 +54,16 @@ static always_inline void read_atomic_size(const volatile void *p,
 })
 
 static always_inline void _write_atomic(volatile void *p,
-                                       unsigned long x, unsigned int size)
+                                        volatile void *x,
+                                        unsigned int size)
 {
     switch ( size )
     {
-    case 1: writeb(x, p); break;
-    case 2: writew(x, p); break;
-    case 4: writel(x, p); break;
+    case 1: writeb_cpu(*(uint8_t *)x, p); break;
+    case 2: writew_cpu(*(uint16_t *)x, p); break;
+    case 4: writel_cpu(*(uint32_t *)x, p); break;
 #ifndef CONFIG_RISCV_32
-    case 8: writeq(x, p); break;
+    case 8: writeq_cpu(*(uint64_t *)x, p); break;
 #endif
     default: __bad_atomic_size(); break;
     }
@@ -75,7 +72,7 @@ static always_inline void _write_atomic(volatile void *p,
 #define write_atomic(p, x)                              \
 ({                                                      \
     typeof(*(p)) x_ = (x);                              \
-    _write_atomic(p, x_, sizeof(*(p)));                 \
+    _write_atomic(p, &x_, sizeof(*(p)));                \
 })
 
 static always_inline void _add_sized(volatile void *p,
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 16:06:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 16:06:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781297.1190875 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnqt-0004jd-ML; Wed, 21 Aug 2024 16:06:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781297.1190875; Wed, 21 Aug 2024 16:06:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnqt-0004gT-C7; Wed, 21 Aug 2024 16:06:27 +0000
Received: by outflank-mailman (input) for mailman id 781297;
 Wed, 21 Aug 2024 16:06:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0Njk=PU=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sgnqr-0003sE-If
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 16:06:25 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 50985ebb-5fd7-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 18:06:24 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-52f04b3cb33so4770220e87.0
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 09:06:24 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5334c75a2cbsm18101e87.187.2024.08.21.09.06.22
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 21 Aug 2024 09:06:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 50985ebb-5fd7-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724256384; x=1724861184; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=0FpDkLbWKJAQ3CiJs4AaAzuGNEeRXZNpELOZW6xj11I=;
        b=iOctuW/oqjLEbz5oAoRlKz0CK+D7YMHCVkm4WPgJn0BdHqQzI/596wO8wJy8I+M5Nw
         AOtu5E/xeMFLgeOwCsHifrrHG1SpnnzFsIXipmQkB5tU9Gb29frAkkQpjY4mZHMQuAbm
         e/aUhdrYlNkfrOdDoqep07JuAevqr3E8n1r9a14iAekd0UY9+uMZBFFsjT//W0LKo5mH
         Yqp4XXAyuc794i7x2tIA9qefQuyr0YSGlDaeM3crd0gSUCUUkK2fUpIDThjHAyxvlhLl
         xrcLJEMaLztLUeendLydHGYLfKRo7pDpXg5upsuHynjkbMdpqgwcSVsmIxUSk3PvMpF7
         59xQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724256384; x=1724861184;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=0FpDkLbWKJAQ3CiJs4AaAzuGNEeRXZNpELOZW6xj11I=;
        b=IwfuoS338Y2R0jVP5+qp7aaBix6AOSssgr1lTSXJFRyZMiOUV7j2eXWsKCrJD01n20
         go7NBQBIJhY6WroHNIpceTkd7DxrvY3QbSUCHe9yLoQlQ+AoK55apu9qcBV1Aq/F/uY1
         B0+UzVjW+joyhQvOOXx/i8r7IWtsFolh5EiNftedojfszK9SGZrL6qjqRvaPFprwHupU
         hu4PpWdeyWBRQM+YAhVFrBdl2ydea2t1wmb/HfVKGJr8oACgjH5iT0TPTrzYu36J2Uq/
         JHPKBTSMGTTexVwQC4dV8oLNTnJET4xcp0IQdyt/0+J0H3x/l6YtY56nvGosQoxPxR/W
         kuog==
X-Gm-Message-State: AOJu0YxaP5gC0qv3zCjNjDn++oJXTmgnunMhwHU9giioigCsHAzKSaUw
	HS6V3MCCW6EEuXiL83Me3U2wWG/PXmhhcExomXx+4MHhgn1PpoMgUAysfw==
X-Google-Smtp-Source: AGHT+IHDSkBdGU14z0nurNEnNn+IlCY9hD/KtUz/3ycdD6y5OmmVKv9FNLxHQ6bKIEmQ2z6OMu8PPA==
X-Received: by 2002:a05:6512:ba9:b0:533:45c9:67fe with SMTP id 2adb3069b0e04-533485d78dbmr2504042e87.48.1724256383343;
        Wed, 21 Aug 2024 09:06:23 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 5/7] xen/riscv: introduce and initialize SBI RFENCE extension
Date: Wed, 21 Aug 2024 18:06:14 +0200
Message-ID: <69da9fc18b9987285e4037ef08714e8f9faa66a7.1724256027.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <cover.1724256026.git.oleksii.kurochko@gmail.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Introduce functions to work with the SBI RFENCE extension for issuing
various fence operations to remote CPUs.

Add the sbi_init() function along with auxiliary functions and macro
definitions for proper initialization and checking the availability of
SBI extensions. Currently, this is implemented only for RFENCE.

Introduce sbi_remote_sfence_vma() to send SFENCE_VMA instructions to
a set of target HARTs. This will support the implementation of
flush_xen_tlb_range_va().

Integrate __sbi_rfence_v02 from Linux kernel 6.6.0-rc4 with minimal
modifications:
 - Adapt to Xen code style.
 - Use cpuid_to_hartid() instead of cpuid_to_hartid_map[].
 - Update BIT(...) to BIT(..., UL).
 - Rename __sbi_rfence_v02_call to sbi_rfence_v02_real and
   remove the unused arg5.
 - Handle NULL cpu_mask to execute rfence on all CPUs by calling
   sbi_rfence_v02_real(..., 0UL, -1UL,...) instead of creating hmask.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V5:
 - update the comment for sbi_has_rfence().
 - update the comment for sbi_remote_sfence_vma().
 - update the prototype of sbi_remote_sfence_vma() and declare cpu_mask
   argument as pointer to const.
 - use MASK_EXTR() for sbi_{major, minor}_version().
 - redefine SBI_SPEC_VERSION_MAJOR_MASK as 0x7F000000
 - drop SBI_SPEC_VERSION_MAJOR_SHIFT as unneeded.
 - add BUG_ON(ret.value < 0) inside sbi_ext_base_func() to be sure that
   ret.value is always >= 0 as SBI spec explicitly doesn't say that.
 - s/__sbi_rfence_v02_real/sbi_rfence_v02_real
 - s/__sbi_rfence_v02/sbi_rfence_v02
 - s/__sbi_rfence/sbi_rfence
 - fold cases inside sbi_rfence_v02_real()
 - mark sbi_rfence_v02 with cf_check.
 - code style fixes in sbi_rfence_v02().
 - add the comment with explanation of algorithm used in sbi_rfence_v02().
 - use __ro_after_init for sbi_rfence variable.
 - add ASSERT(sbi_rfebce) inside sbi_remote_sfence_vma to be sure that it
   is not NULL.
 - drop local variable ret inside sbi_init() and init sbi_spec_version
   directly by return value of sbi_get_spec_version() as this function
   should always be must always succeed.
 - add the comment above sbi_get_spec_version().
 - add BUG_ON for sbi_fw_id and sbi_fw_version() to be sure that they
   have correct values.
 - make sbi_fw_id, sbi_fw_version as local because they are used only once
   for printk().
 - s/veriosn/version
 - drop  BUG_ON("At the moment flush_xen_tlb_range_va() uses SBI rfence...")
   as now we have ASSERT() in the flace where sbi_rfence is actually used.
 - update the commit message.
 - s/BUG_ON("Ooops. SBI spec version 0.1 detected. Need to add support")/panic("Ooops. SBI ...");
---
Changes in V4:
 - update the commit message.
 - code style fixes
 - update return type of sbi_has_rfence() from int to bool and drop
   conditional operator inside implementation.
 - Update mapping of SBI_ERR_FAILURE in sbi_err_map_xen_errno().
 - Update return type of sbi_spec_is_0_1() and drop conditional operator
   inside implementation.
 - s/0x%lx/%#lx
 - update the comment above declaration of sbi_remote_sfence_vma() with
   more detailed explanation what the function does.
 - update prototype of sbi_remote_sfence_vma(). Now it receives cpumask_t
   and returns int.
 - refactor __sbi_rfence_v02() take from the Linux kernel as it takes into
   account a case that hart id could be from different hbase. For example,
   the case when hart IDs are the following 0, 3, 65, 2. Or the case when
   hart IDs are unsorted: 0 3 1 2.
 - drop sbi_cpumask_to_hartmask() as it is not needed anymore
 - Update the prototype of sbi_remote_sfence_vma() and implemntation accordingly
   to the fact it returns 'int'.
 - s/flush_xen_tlb_one_local/flush_tlb_one_local
---
Changes in V3:
 - new patch.
---
 xen/arch/riscv/include/asm/sbi.h |  63 +++++++
 xen/arch/riscv/sbi.c             | 273 ++++++++++++++++++++++++++++++-
 xen/arch/riscv/setup.c           |   3 +
 3 files changed, 338 insertions(+), 1 deletion(-)

diff --git a/xen/arch/riscv/include/asm/sbi.h b/xen/arch/riscv/include/asm/sbi.h
index 0e6820a4ed..76921d4cd1 100644
--- a/xen/arch/riscv/include/asm/sbi.h
+++ b/xen/arch/riscv/include/asm/sbi.h
@@ -12,8 +12,41 @@
 #ifndef __ASM_RISCV_SBI_H__
 #define __ASM_RISCV_SBI_H__
 
+#include <xen/cpumask.h>
+
 #define SBI_EXT_0_1_CONSOLE_PUTCHAR		0x1
 
+#define SBI_EXT_BASE                    0x10
+#define SBI_EXT_RFENCE                  0x52464E43
+
+/* SBI function IDs for BASE extension */
+#define SBI_EXT_BASE_GET_SPEC_VERSION   0x0
+#define SBI_EXT_BASE_GET_IMP_ID         0x1
+#define SBI_EXT_BASE_GET_IMP_VERSION    0x2
+#define SBI_EXT_BASE_PROBE_EXT          0x3
+
+/* SBI function IDs for RFENCE extension */
+#define SBI_EXT_RFENCE_REMOTE_FENCE_I           0x0
+#define SBI_EXT_RFENCE_REMOTE_SFENCE_VMA        0x1
+#define SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID   0x2
+#define SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA       0x3
+#define SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID  0x4
+#define SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA       0x5
+#define SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID  0x6
+
+#define SBI_SPEC_VERSION_MAJOR_MASK     0x7F000000
+#define SBI_SPEC_VERSION_MINOR_MASK     0xffffff
+
+/* SBI return error codes */
+#define SBI_SUCCESS             0
+#define SBI_ERR_FAILURE         (-1)
+#define SBI_ERR_NOT_SUPPORTED   (-2)
+#define SBI_ERR_INVALID_PARAM   (-3)
+#define SBI_ERR_DENIED          (-4)
+#define SBI_ERR_INVALID_ADDRESS (-5)
+
+#define SBI_SPEC_VERSION_DEFAULT 0x1
+
 struct sbiret {
     long error;
     long value;
@@ -31,4 +64,34 @@ struct sbiret sbi_ecall(unsigned long ext, unsigned long fid,
  */
 void sbi_console_putchar(int ch);
 
+/*
+ * Check underlying SBI implementation has RFENCE
+ *
+ * @return true for supported AND false for not-supported
+ */
+bool sbi_has_rfence(void);
+
+/*
+ * Instructs the remote harts to execute one or more SFENCE.VMA
+ * instructions, covering the range of virtual addresses between
+ * [start_addr, start_addr + size).
+ *
+ * Returns 0 if IPI was sent to all the targeted harts successfully
+ * or negative value if start_addr or size is not valid.
+ *
+ * @hart_mask a cpu mask containing all the target harts.
+ * @param start virtual address start
+ * @param size virtual address range size
+ */
+int sbi_remote_sfence_vma(const cpumask_t *cpu_mask,
+                          unsigned long start_addr,
+                          unsigned long size);
+
+/*
+ * Initialize SBI library
+ *
+ * @return 0 on success, otherwise negative errno on failure
+ */
+int sbi_init(void);
+
 #endif /* __ASM_RISCV_SBI_H__ */
diff --git a/xen/arch/riscv/sbi.c b/xen/arch/riscv/sbi.c
index 0ae166c861..c4036c8e4b 100644
--- a/xen/arch/riscv/sbi.c
+++ b/xen/arch/riscv/sbi.c
@@ -5,13 +5,26 @@
  * (anup.patel@wdc.com).
  *
  * Modified by Bobby Eshleman (bobby.eshleman@gmail.com).
+ * Modified by Oleksii Kurochko (oleksii.kurochko@gmail.com).
  *
  * Copyright (c) 2019 Western Digital Corporation or its affiliates.
- * Copyright (c) 2021-2023 Vates SAS.
+ * Copyright (c) 2021-2024 Vates SAS.
  */
 
+#include <xen/compiler.h>
+#include <xen/const.h>
+#include <xen/cpumask.h>
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/lib.h>
+#include <xen/sections.h>
+#include <xen/smp.h>
+
+#include <asm/processor.h>
 #include <asm/sbi.h>
 
+static unsigned long __ro_after_init sbi_spec_version = SBI_SPEC_VERSION_DEFAULT;
+
 struct sbiret sbi_ecall(unsigned long ext, unsigned long fid,
                         unsigned long arg0, unsigned long arg1,
                         unsigned long arg2, unsigned long arg3,
@@ -38,7 +51,265 @@ struct sbiret sbi_ecall(unsigned long ext, unsigned long fid,
     return ret;
 }
 
+static int sbi_err_map_xen_errno(int err)
+{
+    switch ( err )
+    {
+    case SBI_SUCCESS:
+        return 0;
+    case SBI_ERR_DENIED:
+        return -EACCES;
+    case SBI_ERR_INVALID_PARAM:
+        return -EINVAL;
+    case SBI_ERR_INVALID_ADDRESS:
+        return -EFAULT;
+    case SBI_ERR_NOT_SUPPORTED:
+        return -EOPNOTSUPP;
+    case SBI_ERR_FAILURE:
+        fallthrough;
+    default:
+        return -ENOSYS;
+    };
+}
+
 void sbi_console_putchar(int ch)
 {
     sbi_ecall(SBI_EXT_0_1_CONSOLE_PUTCHAR, 0, ch, 0, 0, 0, 0, 0);
 }
+
+static unsigned long sbi_major_version(void)
+{
+    return MASK_EXTR(sbi_spec_version, SBI_SPEC_VERSION_MAJOR_MASK);
+}
+
+static unsigned long sbi_minor_version(void)
+{
+    return MASK_EXTR(sbi_spec_version, SBI_SPEC_VERSION_MINOR_MASK);
+}
+
+static long sbi_ext_base_func(long fid)
+{
+    struct sbiret ret;
+
+    ret = sbi_ecall(SBI_EXT_BASE, fid, 0, 0, 0, 0, 0, 0);
+
+    /*
+     * I wasn't able to find a case in the SBI spec where sbiret.value
+     * could be negative.
+     *
+     * Unfortunately, the spec does not specify the possible values of
+     * sbiret.value, but based on the description of the SBI function,
+     * ret.value >= 0 when sbiret.error = 0. SPI spec specify only
+     * possible value for sbiret.error (<= 0 whwere 0 is SBI_SUCCESS ).
+     *
+     * Just to be sure that SBI base extension functions one day won't
+     * start to return a negative value for sbiret.value when
+     * sbiret.error < 0 BUG_ON() is added.
+     */
+    BUG_ON(ret.value < 0);
+
+    if ( !ret.error )
+        return ret.value;
+    else
+        return ret.error;
+}
+
+static int sbi_rfence_v02_real(unsigned long fid,
+                               unsigned long hmask, unsigned long hbase,
+                               unsigned long start, unsigned long size,
+                               unsigned long arg4)
+{
+    struct sbiret ret = {0};
+    int result = 0;
+
+    switch ( fid )
+    {
+    case SBI_EXT_RFENCE_REMOTE_FENCE_I:
+        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
+                        0, 0, 0, 0);
+        break;
+
+    case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA:
+    case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA:
+    case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA:
+        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
+                        start, size, 0, 0);
+        break;
+
+    case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID:
+    case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID:
+    case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID:
+        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
+                        start, size, arg4, 0);
+        break;
+
+    default:
+        printk("%s: unknown function ID [%lu]\n",
+               __func__, fid);
+        result = -EINVAL;
+        break;
+    };
+
+    if ( ret.error )
+    {
+        result = sbi_err_map_xen_errno(ret.error);
+        printk("%s: hbase=%lu hmask=%#lx failed (error %d)\n",
+               __func__, hbase, hmask, result);
+    }
+
+    return result;
+}
+
+static int cf_check sbi_rfence_v02(unsigned long fid,
+                                   const cpumask_t *cpu_mask,
+                                   unsigned long start, unsigned long size,
+                                   unsigned long arg4, unsigned long arg5)
+{
+    unsigned long hartid, cpuid, hmask = 0, hbase = 0, htop = 0;
+    int result;
+
+    /*
+     * hart_mask_base can be set to -1 to indicate that hart_mask can be
+     * ignored and all available harts must be considered.
+     */
+    if ( !cpu_mask )
+        return sbi_rfence_v02_real(fid, 0UL, -1UL, start, size, arg4);
+
+    for_each_cpu ( cpuid, cpu_mask )
+    {
+        /*
+        * Hart IDs might not necessarily be numbered contiguously in
+        * a multiprocessor system, but at least one hart must have a
+        * hart ID of zero.
+        *
+        * This means that it is possible for the hart ID mapping to look like:
+        *  0, 1, 3, 65, 66, 69
+        * In such cases, more than one call to sbi_rfence_v02_real() will be
+        * needed, as a single hmask can only cover sizeof(unsigned long) CPUs:
+        *  1. sbi_rfence_v02_real(hmask=0b1011, hbase=0)
+        *  2. sbi_rfence_v02_real(hmask=0b1011, hbase=65)
+        *
+        * The algorithm below tries to batch as many harts as possible before
+        * making an SBI call. However, batching may not always be possible.
+        * For example, consider the hart ID mapping:
+        *   0, 64, 1, 65, 2, 66
+        */
+        hartid = cpuid_to_hartid(cpuid);
+        if ( hmask )
+        {
+            if ( hartid + BITS_PER_LONG <= htop ||
+                 hbase + BITS_PER_LONG <= hartid )
+            {
+                result = sbi_rfence_v02_real(fid, hmask, hbase,
+                                             start, size, arg4);
+                if ( result )
+                    return result;
+                hmask = 0;
+            }
+            else if ( hartid < hbase )
+            {
+                /* shift the mask to fit lower hartid */
+                hmask <<= hbase - hartid;
+                hbase = hartid;
+            }
+        }
+
+        if ( !hmask )
+        {
+            hbase = hartid;
+            htop = hartid;
+        }
+        else if ( hartid > htop )
+            htop = hartid;
+
+        hmask |= BIT(hartid - hbase, UL);
+    }
+
+    if ( hmask )
+    {
+        result = sbi_rfence_v02_real(fid, hmask, hbase,
+                                     start, size, arg4);
+        if ( result )
+            return result;
+    }
+
+    return 0;
+}
+
+static int (* __ro_after_init sbi_rfence)(unsigned long fid,
+                                          const cpumask_t *cpu_mask,
+                                          unsigned long start,
+                                          unsigned long size,
+                                          unsigned long arg4,
+                                          unsigned long arg5);
+
+int sbi_remote_sfence_vma(const cpumask_t *cpu_mask,
+                          unsigned long start_addr,
+                          unsigned long size)
+{
+    ASSERT(sbi_rfence);
+
+    return sbi_rfence(SBI_EXT_RFENCE_REMOTE_SFENCE_VMA,
+                      cpu_mask, start_addr, size, 0, 0);
+}
+
+/* This function must always succeed. */
+#define sbi_get_spec_version()  \
+    sbi_ext_base_func(SBI_EXT_BASE_GET_SPEC_VERSION)
+
+#define sbi_get_firmware_id()   \
+    sbi_ext_base_func(SBI_EXT_BASE_GET_IMP_ID)
+
+#define sbi_get_firmware_version()  \
+    sbi_ext_base_func(SBI_EXT_BASE_GET_IMP_VERSION)
+
+int sbi_probe_extension(long extid)
+{
+    struct sbiret ret;
+
+    ret = sbi_ecall(SBI_EXT_BASE, SBI_EXT_BASE_PROBE_EXT, extid,
+                    0, 0, 0, 0, 0);
+    if ( !ret.error && ret.value )
+        return ret.value;
+
+    return -EOPNOTSUPP;
+}
+
+static bool sbi_spec_is_0_1(void)
+{
+    return (sbi_spec_version == SBI_SPEC_VERSION_DEFAULT);
+}
+
+bool sbi_has_rfence(void)
+{
+    return (sbi_rfence != NULL);
+}
+
+int __init sbi_init(void)
+{
+    sbi_spec_version = sbi_get_spec_version();
+
+    printk("SBI specification v%lu.%lu detected\n",
+            sbi_major_version(), sbi_minor_version());
+
+    if ( !sbi_spec_is_0_1() )
+    {
+        long sbi_fw_id = sbi_get_firmware_id();
+        long sbi_fw_version = sbi_get_firmware_version();
+
+        BUG_ON((sbi_fw_id < 0) || (sbi_fw_version < 0));
+
+        printk("SBI implementation ID=%#lx Version=%#lx\n",
+            sbi_fw_id, sbi_fw_version);
+
+        if ( sbi_probe_extension(SBI_EXT_RFENCE) > 0 )
+        {
+            sbi_rfence = sbi_rfence_v02;
+            printk("SBI v0.2 RFENCE extension detected\n");
+        }
+    }
+    else
+        panic("Ooops. SBI spec version 0.1 detected. Need to add support");
+
+    return 0;
+}
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index e15f34509c..f147ba672f 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -8,6 +8,7 @@
 #include <public/version.h>
 
 #include <asm/early_printk.h>
+#include <asm/sbi.h>
 #include <asm/smp.h>
 #include <asm/traps.h>
 
@@ -47,6 +48,8 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
 
     trap_init();
 
+    sbi_init();
+
 #ifdef CONFIG_SELF_TESTS
     test_macros_from_bug_h();
 #endif
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 16:06:39 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 16:06:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781298.1190895 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnqv-0005Il-4s; Wed, 21 Aug 2024 16:06:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781298.1190895; Wed, 21 Aug 2024 16:06:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnqu-0005Gc-Qe; Wed, 21 Aug 2024 16:06:28 +0000
Received: by outflank-mailman (input) for mailman id 781298;
 Wed, 21 Aug 2024 16:06:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0Njk=PU=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sgnqs-0003sE-Te
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 16:06:27 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5136678b-5fd7-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 18:06:25 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-5334c4cc17fso230257e87.2
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 09:06:25 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5334c75a2cbsm18101e87.187.2024.08.21.09.06.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 21 Aug 2024 09:06:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5136678b-5fd7-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724256385; x=1724861185; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=rDV1tsPkyyZ0s31JtDUobwApmNzZwqQvW5WKBrf+ijM=;
        b=eeo05hGViEiI7CAgy6qEBQ/58vf4PMNICbjCCeVo7Bi9NOJsm6Qk/4C6E/XHxUeLQQ
         FN3gTivCdBsFvUiwUXsTsGsaMimPceyv3uwq3r1efkHT2qPRGKfWTFrh7ezwY3mvrFeq
         5x0lHAxunRLNrMZzOYsSg6Mkj9hELUVERlXzHMF6DWIShDJVm29QdYl4tLC9SVJg01hJ
         wej8R5+RRr6w5PaqS8tOqyz72SHmJuQshGjmD9pqKsIekGQFrG3K6GLY3xpxfS7gDQUQ
         /7ExJq/qw3h5e+absQwXoNpQ+W7kwTa9MHdnbEYBFjeVRIwgHfbRkpWJ6cz3K8IURqps
         4brA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724256385; x=1724861185;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=rDV1tsPkyyZ0s31JtDUobwApmNzZwqQvW5WKBrf+ijM=;
        b=qVhUkoe9Fi01o+OR12jst9+j5wL1fvFadDgz+zyWC4WDT0xpubDkNfFTolIKSeydOI
         nD80k3kR2vN74GjCgZ0NSuyx3KborGA1RoYU4tsK3r1pYwYxj6YoZjVu1Yheh+xwi4ji
         yNgT2wklq5p2ikRq4NzhEfWrJzGbO+k3JUlMHwUtUkS1shEz+8SMtlCA+8P6/JAugKg2
         tkLp0ZStYQTwab3b+hFJwNcbDGkIc/U2YgnZ71gh20rv0FBZh3+Pw1uEItPLgxpCtc9l
         SNPNxYzxKHSk3Awjb7UdtNeBhIMXjnCkPo6YdxIGJYBrPlJQUq8EnrmpH2KZmE1GNqqd
         8pew==
X-Gm-Message-State: AOJu0YzREQ7H2d9+DLj8sxVVUSvAI4UFHwqVPE9MlUVPhOfUSWkZBgZM
	BUB1jOnsDyusXsduDF0KQctjc1ymq6ih1AHUTonzQnbbC4oDb1gnWJJdSg==
X-Google-Smtp-Source: AGHT+IHkJMA6ZZyJm2XOTUKm9KDM2CMTVwxBL7LghDaYLdumE2y3Rrvrz3/hda0YCi9QCwZqzhEtbg==
X-Received: by 2002:a05:6512:3f12:b0:52c:d819:517e with SMTP id 2adb3069b0e04-533485a6c58mr1902513e87.30.1724256384211;
        Wed, 21 Aug 2024 09:06:24 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 6/7] xen/riscv: page table handling
Date: Wed, 21 Aug 2024 18:06:15 +0200
Message-ID: <090e617d88b279ae88f1a7859875a7e1a0c6ae73.1724256027.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <cover.1724256026.git.oleksii.kurochko@gmail.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Implement map_pages_to_xen() which requires several
functions to manage page tables and entries:
- pt_update()
- pt_mapping_level()
- pt_update_entry()
- pt_next_level()
- pt_check_entry()

To support these operations, add functions for creating,
mapping, and unmapping Xen tables:
- create_table()
- map_table()
- unmap_table()

Introduce internal macros starting with PTE_* for convenience.
These macros closely resemble PTE bits, with the exception of
PTE_SMALL, which indicates that 4KB is needed.

In addition introduce flush_tlb_range_va() for TLB flushing across
CPUs after updating the PTE for the requested mapping.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V5:
 - s/xen_{un}map/{un}map
 - introduce PTE_SMALL instead of PTE_BLOCK.
 - update the comment above defintion of PTE_4K_PAGES.
 - code style fixes.
 - s/RV_STAGE1_MODE > SATP_MODE_SV48/RV_STAGE1_MODE > SATP_MODE_SV39 around
   DECLARE_OFFSETS macros.
 - change type of root_maddr from unsgined long to maddr_t.
 - drop duplicated check ( if (rc) break ) in pt_update() inside while cycle.
 - s/1U/1UL
 - put 'spin_unlock(&xen_pt_lock);' ahead of TLB flush in pt_update().
 - update the commit message.
 - update the comment above ASSERT() in map_pages_to_xen() and also update
   the check within ASSERT() to check that flags has PTE_VALID bit set.
 - update the comment above pt_update() function.
 - add the comment inside pt_check_entry().
 - update the TLB flushing region in pt_update().
 - s/alloc_only/alloc_tbl
---
Changes in V4:
 - update the commit message.
 - drop xen_ prefix for functions: xen_pt_update(), xen_pt_mapping_level(),
   xen_pt_update_entry(), xen_pt_next_level(), xen_pt_check_entry().
 - drop 'select GENERIC_PT' for CONFIG_RISCV. There is no GENERIC_PT anymore.
 - update implementation of flush_xen_tlb_range_va and s/flush_xen_tlb_range_va/flush_tlb_range_va
 - s/pte_get_mfn/mfn_from_pte. Others similar definitions I decided not to touch as
   they were introduced before and this patter of naming such type of macros will be applied
   for newly introduced macros.
 - drop _PAGE_* definitions and use analogues of PTE_*.
 - introduce PTE_{W,X,R}_MASK and drop PAGE_{XN,W,X}_MASK. Also drop _PAGE_{*}_BIT
 - introduce PAGE_HYPERVISOR_RX.
 - drop unused now l3_table_offset.
 - drop struct pt_t as it was used only for one function. If it will be needed in the future
   pt_t will be re-introduced.
 - code styles fixes in pte_is_table(). drop level argument from t.
 - update implementation and prototype of pte_is_mapping().
 - drop level argument from pt_next_level().
 - introduce definition of SATP_PPN_MASK.
 - isolate PPN of CSR_SATP before shift by PAGE_SHIFT.
 - drop set_permission() functions as it is not used more then once.
 - update prototype of pt_check_entry(): drop level argument as it is not used.
 - pt_check_entry():
   - code style fixes
   - update the sanity check when modifying an entry
   - update the sanity check when when removing a mapping.
 - s/read_only/alloc_only.
 - code style fixes for pt_next_level().
 - pt_update_entry() changes:
   - drop arch_level variable inisde pt_update_entry()
   - drop convertion near virt to paddr_t in DECLARE_OFFSETS(offsets, virt);
   - pull out "goto out inside first 'for' cycle.
   - drop braces for 'if' cases which has only one line.
   - ident 'out' label with one blank.
   - update the comment above alloc_only and also definition to take into
     account  that if pte population was requested or not.
   - drop target variable and rename arch_target argument of the function to
     target.
 - pt_mapping_level() changes:
   - move the check if PTE_BLOCK should be mapped on the top of the function.
   - change int i to unsigned int and update 'for' cycle correspondingly.
 - update prototye of pt_update():
   - drop the comment  above nr_mfns and drop const to be consistent with other
     arguments.
   - always flush TLB at the end of the function as non-present entries can be put
     in the TLB.
   - add fence before TLB flush to ensure that PTEs are all updated before flushing.
 - s/XEN_TABLE_NORMAL_PAGE/XEN_TABLE_NORMAL
 - add a check in map_pages_to_xen() the mfn is not INVALID_MFN.
 - add the comment on top of pt_update() how mfn = INVALID_MFN is considered.
 - s/_PAGE_BLOCK/PTE_BLOCK.
 - add the comment with additional explanation for PTE_BLOCK.
 - drop defintion of FIRST_SIZE as it isn't used.
---
Changes in V3:
 - new patch. ( Technically it is reworked version of the generic approach
   which I tried to suggest in the previous version )
---
 xen/arch/riscv/Makefile                     |   1 +
 xen/arch/riscv/include/asm/flushtlb.h       |  12 +
 xen/arch/riscv/include/asm/mm.h             |   2 +
 xen/arch/riscv/include/asm/page.h           |  57 +++
 xen/arch/riscv/include/asm/riscv_encoding.h |   1 +
 xen/arch/riscv/mm.c                         |   9 -
 xen/arch/riscv/pt.c                         | 420 ++++++++++++++++++++
 7 files changed, 493 insertions(+), 9 deletions(-)
 create mode 100644 xen/arch/riscv/pt.c

diff --git a/xen/arch/riscv/Makefile b/xen/arch/riscv/Makefile
index 334fd24547..d058ea4e95 100644
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -1,6 +1,7 @@
 obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
 obj-y += entry.o
 obj-y += mm.o
+obj-y += pt.o
 obj-$(CONFIG_RISCV_64) += riscv64/
 obj-y += sbi.o
 obj-y += setup.o
diff --git a/xen/arch/riscv/include/asm/flushtlb.h b/xen/arch/riscv/include/asm/flushtlb.h
index f4a735fd6c..031d781aa2 100644
--- a/xen/arch/riscv/include/asm/flushtlb.h
+++ b/xen/arch/riscv/include/asm/flushtlb.h
@@ -5,12 +5,24 @@
 #include <xen/bug.h>
 #include <xen/cpumask.h>
 
+#include <asm/sbi.h>
+
 /* Flush TLB of local processor for address va. */
 static inline void flush_tlb_one_local(vaddr_t va)
 {
     asm volatile ( "sfence.vma %0" :: "r" (va) : "memory" );
 }
 
+/*
+ * Flush a range of VA's hypervisor mappings from the TLB of all
+ * processors in the inner-shareable domain.
+ */
+static inline void flush_tlb_range_va(vaddr_t va, size_t size)
+{
+    BUG_ON(!sbi_has_rfence());
+    sbi_remote_sfence_vma(NULL, va, size);
+}
+
 /*
  * Filter the given set of CPUs, removing those that definitely flushed their
  * TLB since @page_timestamp.
diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index a0bdc2bc3a..ce1557bb27 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -42,6 +42,8 @@ static inline void *maddr_to_virt(paddr_t ma)
 #define virt_to_mfn(va)     __virt_to_mfn(va)
 #define mfn_to_virt(mfn)    __mfn_to_virt(mfn)
 
+#define mfn_from_pte(pte) maddr_to_mfn(pte_to_paddr(pte))
+
 struct page_info
 {
     /* Each frame can be threaded onto a doubly-linked list. */
diff --git a/xen/arch/riscv/include/asm/page.h b/xen/arch/riscv/include/asm/page.h
index 55916eaa92..f148d82261 100644
--- a/xen/arch/riscv/include/asm/page.h
+++ b/xen/arch/riscv/include/asm/page.h
@@ -21,6 +21,11 @@
 #define XEN_PT_LEVEL_MAP_MASK(lvl)  (~(XEN_PT_LEVEL_SIZE(lvl) - 1))
 #define XEN_PT_LEVEL_MASK(lvl)      (VPN_MASK << XEN_PT_LEVEL_SHIFT(lvl))
 
+/*
+ * PTE format:
+ * | XLEN-1  10 | 9             8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0
+ *       PFN      reserved for SW   D   A   G   U   X   W   R   V
+ */
 #define PTE_VALID                   BIT(0, UL)
 #define PTE_READABLE                BIT(1, UL)
 #define PTE_WRITABLE                BIT(2, UL)
@@ -34,15 +39,53 @@
 #define PTE_LEAF_DEFAULT            (PTE_VALID | PTE_READABLE | PTE_WRITABLE)
 #define PTE_TABLE                   (PTE_VALID)
 
+#define PAGE_HYPERVISOR_RO          (PTE_VALID | PTE_READABLE)
 #define PAGE_HYPERVISOR_RW          (PTE_VALID | PTE_READABLE | PTE_WRITABLE)
+#define PAGE_HYPERVISOR_RX          (PTE_VALID | PTE_READABLE | PTE_EXECUTABLE)
 
 #define PAGE_HYPERVISOR             PAGE_HYPERVISOR_RW
 
+/*
+ * The PTE format does not contain the following bits within itself;
+ * they are created artificially to inform the Xen page table
+ * handling algorithm. These bits should not be explicitly written
+ * to the PTE entry.
+ */
+#define PTE_SMALL       BIT(10, UL)
+#define PTE_POPULATE    BIT(11, UL)
+
+#define PTE_R_MASK(x)   ((x) & PTE_READABLE)
+#define PTE_W_MASK(x)   ((x) & PTE_WRITABLE)
+#define PTE_X_MASK(x)   ((x) & PTE_EXECUTABLE)
+
+#define PTE_RWX_MASK(x) ((x) & (PTE_READABLE | PTE_WRITABLE | PTE_EXECUTABLE))
+
 /* Calculate the offsets into the pagetables for a given VA */
 #define pt_linear_offset(lvl, va)   ((va) >> XEN_PT_LEVEL_SHIFT(lvl))
 
 #define pt_index(lvl, va) (pt_linear_offset((lvl), (va)) & VPN_MASK)
 
+#define PAGETABLE_ORDER_MASK ((_AC(1, U) << PAGETABLE_ORDER) - 1)
+#define TABLE_OFFSET(offs) (_AT(unsigned int, offs) & PAGETABLE_ORDER_MASK)
+
+#if RV_STAGE1_MODE > SATP_MODE_SV39
+#error "need to to update DECLARE_OFFSETS macros"
+#else
+
+#define l0_table_offset(va) TABLE_OFFSET(pt_linear_offset(0, va))
+#define l1_table_offset(va) TABLE_OFFSET(pt_linear_offset(1, va))
+#define l2_table_offset(va) TABLE_OFFSET(pt_linear_offset(2, va))
+
+/* Generate an array @var containing the offset for each level from @addr */
+#define DECLARE_OFFSETS(var, addr)          \
+    const unsigned int var[] = {            \
+        l0_table_offset(addr),              \
+        l1_table_offset(addr),              \
+        l2_table_offset(addr),              \
+    }
+
+#endif
+
 /* Page Table entry */
 typedef struct {
 #ifdef CONFIG_RISCV_64
@@ -68,6 +111,20 @@ static inline bool pte_is_valid(pte_t p)
     return p.pte & PTE_VALID;
 }
 
+inline bool pte_is_table(const pte_t p)
+{
+    return ((p.pte & (PTE_VALID |
+                      PTE_READABLE |
+                      PTE_WRITABLE |
+                      PTE_EXECUTABLE)) == PTE_VALID);
+}
+
+static inline bool pte_is_mapping(const pte_t p)
+{
+    return (p.pte & PTE_VALID) &&
+           (p.pte & (PTE_WRITABLE | PTE_EXECUTABLE));
+}
+
 static inline void invalidate_icache(void)
 {
     BUG_ON("unimplemented");
diff --git a/xen/arch/riscv/include/asm/riscv_encoding.h b/xen/arch/riscv/include/asm/riscv_encoding.h
index 58abe5eccc..d80cef0093 100644
--- a/xen/arch/riscv/include/asm/riscv_encoding.h
+++ b/xen/arch/riscv/include/asm/riscv_encoding.h
@@ -164,6 +164,7 @@
 #define SSTATUS_SD			SSTATUS64_SD
 #define SATP_MODE			SATP64_MODE
 #define SATP_MODE_SHIFT			SATP64_MODE_SHIFT
+#define SATP_PPN_MASK			_UL(0x00000FFFFFFFFFFF)
 
 #define HGATP_PPN			HGATP64_PPN
 #define HGATP_VMID_SHIFT		HGATP64_VMID_SHIFT
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index b8ff91cf4e..e8430def14 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -369,12 +369,3 @@ int destroy_xen_mappings(unsigned long s, unsigned long e)
     BUG_ON("unimplemented");
     return -1;
 }
-
-int map_pages_to_xen(unsigned long virt,
-                     mfn_t mfn,
-                     unsigned long nr_mfns,
-                     unsigned int flags)
-{
-    BUG_ON("unimplemented");
-    return -1;
-}
diff --git a/xen/arch/riscv/pt.c b/xen/arch/riscv/pt.c
new file mode 100644
index 0000000000..15eb02fe9e
--- /dev/null
+++ b/xen/arch/riscv/pt.c
@@ -0,0 +1,420 @@
+#include <xen/bug.h>
+#include <xen/domain_page.h>
+#include <xen/errno.h>
+#include <xen/mm.h>
+#include <xen/mm-frame.h>
+#include <xen/pmap.h>
+#include <xen/spinlock.h>
+
+#include <asm/flushtlb.h>
+#include <asm/page.h>
+
+static inline const mfn_t get_root_page(void)
+{
+    paddr_t root_maddr = (csr_read(CSR_SATP) & SATP_PPN_MASK) << PAGE_SHIFT;
+
+    return maddr_to_mfn(root_maddr);
+}
+
+/* Sanity check of the entry. */
+static bool pt_check_entry(pte_t entry, mfn_t mfn, unsigned int flags)
+{
+    /*
+     * See the comment about the possible combination of (mfn, flags) in
+     * the comment above pt_update().
+     */
+
+    /* Sanity check when modifying an entry. */
+    if ( (flags & PTE_VALID) && mfn_eq(mfn, INVALID_MFN) )
+    {
+        /* We don't allow modifying an invalid entry. */
+        if ( !pte_is_valid(entry) )
+        {
+            printk("Modifying invalid entry is not allowed.\n");
+            return false;
+        }
+
+        /* We don't allow modifying a table entry */
+        if ( pte_is_table(entry) )
+        {
+            printk("Modifying a table entry is not allowed.\n");
+            return false;
+        }
+    }
+    /* Sanity check when inserting a mapping */
+    else if ( flags & PTE_VALID )
+    {
+        /* We should be here with a valid MFN. */
+        ASSERT(!mfn_eq(mfn, INVALID_MFN));
+
+        /*
+         * We don't allow replacing any valid entry.
+         *
+         * Note that the function pt_update() relies on this
+         * assumption and will skip the TLB flush (when Svvptc
+         * extension will be ratified). The function will need
+         * to be updated if the check is relaxed.
+         */
+        if ( pte_is_valid(entry) )
+        {
+            if ( pte_is_mapping(entry) )
+                printk("Changing MFN for a valid entry is not allowed (%#"PRI_mfn" -> %#"PRI_mfn").\n",
+                       mfn_x(mfn_from_pte(entry)), mfn_x(mfn));
+            else
+                printk("Trying to replace a table with a mapping.\n");
+            return false;
+        }
+    }
+    /* Sanity check when removing a mapping. */
+    else if ( (flags & (PTE_VALID | PTE_POPULATE)) == 0 )
+    {
+        /* We should be here with an invalid MFN. */
+        ASSERT(mfn_eq(mfn, INVALID_MFN));
+
+        /* We don't allow removing a table */
+        if ( pte_is_table(entry) )
+        {
+            printk("Removing a table is not allowed.\n");
+            return false;
+        }
+    }
+    /* Sanity check when populating the page-table. No check so far. */
+    else
+    {
+        ASSERT(flags & PTE_POPULATE);
+        /* We should be here with an invalid MFN */
+        ASSERT(mfn_eq(mfn, INVALID_MFN));
+    }
+
+    return true;
+}
+
+static pte_t *map_table(mfn_t mfn)
+{
+    /*
+     * During early boot, map_domain_page() may be unusable. Use the
+     * PMAP to map temporarily a page-table.
+     */
+    if ( system_state == SYS_STATE_early_boot )
+        return pmap_map(mfn);
+
+    return map_domain_page(mfn);
+}
+
+static void unmap_table(const pte_t *table)
+{
+    /*
+     * During early boot, map_table() will not use map_domain_page()
+     * but the PMAP.
+     */
+    if ( system_state == SYS_STATE_early_boot )
+        pmap_unmap(table);
+    else
+        unmap_domain_page(table);
+}
+
+static int create_table(pte_t *entry)
+{
+    mfn_t mfn;
+    void *p;
+    pte_t pte;
+
+    if ( system_state != SYS_STATE_early_boot )
+    {
+        struct page_info *pg = alloc_domheap_page(NULL, 0);
+
+        if ( pg == NULL )
+            return -ENOMEM;
+
+        mfn = page_to_mfn(pg);
+    }
+    else
+        mfn = alloc_boot_pages(1, 1);
+
+    p = map_table(mfn);
+    clear_page(p);
+    unmap_table(p);
+
+    pte = pte_from_mfn(mfn, PTE_TABLE);
+    write_pte(entry, pte);
+
+    return 0;
+}
+
+#define XEN_TABLE_MAP_FAILED 0
+#define XEN_TABLE_SUPER_PAGE 1
+#define XEN_TABLE_NORMAL 2
+
+/*
+ * Take the currently mapped table, find the corresponding entry,
+ * and map the next table, if available.
+ *
+ * The alloc_tbl parameters indicates whether intermediate tables should
+ * be allocated when not present.
+ *
+ * Return values:
+ *  XEN_TABLE_MAP_FAILED: Either alloc_only was set and the entry
+ *  was empty, or allocating a new page failed.
+ *  XEN_TABLE_NORMAL: next level or leaf mapped normally
+ *  XEN_TABLE_SUPER_PAGE: The next entry points to a superpage.
+ */
+static int pt_next_level(bool alloc_tbl, pte_t **table, unsigned int offset)
+{
+    pte_t *entry;
+    int ret;
+    mfn_t mfn;
+
+    entry = *table + offset;
+
+    if ( !pte_is_valid(*entry) )
+    {
+        if ( alloc_tbl )
+            return XEN_TABLE_MAP_FAILED;
+
+        ret = create_table(entry);
+        if ( ret )
+            return XEN_TABLE_MAP_FAILED;
+    }
+
+    if ( pte_is_mapping(*entry) )
+        return XEN_TABLE_SUPER_PAGE;
+
+    mfn = mfn_from_pte(*entry);
+
+    unmap_table(*table);
+    *table = map_table(mfn);
+
+    return XEN_TABLE_NORMAL;
+}
+
+/* Update an entry at the level @target. */
+static int pt_update_entry(mfn_t root, unsigned long virt,
+                           mfn_t mfn, unsigned int target,
+                           unsigned int flags)
+{
+    int rc;
+    unsigned int level = HYP_PT_ROOT_LEVEL;
+    pte_t *table;
+    /*
+     * The intermediate page table shouldn't be allocated when MFN isn't
+     * valid and we are not populating page table.
+     * This means we either modify permissions or remove an entry, or
+     * inserting brand new entry.
+     *
+     * See the comment above pt_update() for an additional explanation about
+     * combinations of (mfn, flags).
+    */
+    bool alloc_tbl = mfn_eq(mfn, INVALID_MFN) && !(flags & PTE_POPULATE);
+    pte_t pte, *entry;
+
+    /* convenience aliases */
+    DECLARE_OFFSETS(offsets, virt);
+
+    table = map_table(root);
+    for ( ; level > target; level-- )
+    {
+        rc = pt_next_level(alloc_tbl, &table, offsets[level]);
+        if ( rc == XEN_TABLE_MAP_FAILED )
+        {
+            rc = 0;
+
+            /*
+             * We are here because pt_next_level has failed to map
+             * the intermediate page table (e.g the table does not exist
+             * and the pt is read-only). It is a valid case when
+             * removing a mapping as it may not exist in the page table.
+             * In this case, just ignore it.
+             */
+            if ( flags & PTE_VALID )
+            {
+                printk("%s: Unable to map level %u\n", __func__, level);
+                rc = -ENOENT;
+            }
+
+            goto out;
+        }
+        else if ( rc != XEN_TABLE_NORMAL )
+            break;
+    }
+
+    if ( level != target )
+    {
+        printk("%s: Shattering superpage is not supported\n", __func__);
+        rc = -EOPNOTSUPP;
+        goto out;
+    }
+
+    entry = table + offsets[level];
+
+    rc = -EINVAL;
+    if ( !pt_check_entry(*entry, mfn, flags) )
+        goto out;
+
+    /* We are removing the page */
+    if ( !(flags & PTE_VALID) )
+        memset(&pte, 0x00, sizeof(pte));
+    else
+    {
+        /* We are inserting a mapping => Create new pte. */
+        if ( !mfn_eq(mfn, INVALID_MFN) )
+            pte = pte_from_mfn(mfn, PTE_VALID);
+        else /* We are updating the permission => Copy the current pte. */
+            pte = *entry;
+
+        /* update permission according to the flags */
+        pte.pte |= PTE_RWX_MASK(flags) | PTE_ACCESSED | PTE_DIRTY;
+    }
+
+    write_pte(entry, pte);
+
+    rc = 0;
+
+ out:
+    unmap_table(table);
+
+    return rc;
+}
+
+/* Return the level where mapping should be done */
+static int pt_mapping_level(unsigned long vfn, mfn_t mfn, unsigned long nr,
+                            unsigned int flags)
+{
+    unsigned int level = 0;
+    unsigned long mask;
+    unsigned int i;
+
+    /* Use blocking mapping unless the caller requests 4K mapping */
+    if ( unlikely(flags & PTE_SMALL) )
+        return level;
+
+    /*
+     * Don't take into account the MFN when removing mapping (i.e
+     * MFN_INVALID) to calculate the correct target order.
+     *
+     * `vfn` and `mfn` must be both superpage aligned.
+     * They are or-ed together and then checked against the size of
+     * each level.
+     *
+     * `left` is not included and checked separately to allow
+     * superpage mapping even if it is not properly aligned (the
+     * user may have asked to map 2MB + 4k).
+     */
+    mask = !mfn_eq(mfn, INVALID_MFN) ? mfn_x(mfn) : 0;
+    mask |= vfn;
+
+    for ( i = HYP_PT_ROOT_LEVEL; i != 0; i-- )
+    {
+        if ( !(mask & (BIT(XEN_PT_LEVEL_ORDER(i), UL) - 1)) &&
+             (nr >= BIT(XEN_PT_LEVEL_ORDER(i), UL)) )
+        {
+            level = i;
+            break;
+        }
+    }
+
+    return level;
+}
+
+static DEFINE_SPINLOCK(xen_pt_lock);
+
+/*
+ * If `mfn` equals `INVALID_MFN`, it indicates that the following page table
+ * update operation might be related to either populating the table (
+ * PTE_POPULATE will be set additionaly), destroying a mapping, or modifying
+ * an existing mapping.
+ *
+ * If `mfn` is valid and flags has PTE_VALID bit set then it means that
+ * inserting will be done.
+ */
+static int pt_update(unsigned long virt,
+                     mfn_t mfn,
+                     unsigned long nr_mfns,
+                     unsigned int flags)
+{
+    int rc = 0;
+    unsigned long vfn = virt >> PAGE_SHIFT;
+    unsigned long left = nr_mfns;
+
+    const mfn_t root = get_root_page();
+
+    /*
+     * It is bad idea to have mapping both writeable and
+     * executable.
+     * When modifying/creating mapping (i.e PTE_VALID is set),
+     * prevent any update if this happen.
+     */
+    if ( (flags & PTE_VALID) && PTE_W_MASK(flags) && PTE_X_MASK(flags) )
+    {
+        printk("Mappings should not be both Writeable and Executable.\n");
+        return -EINVAL;
+    }
+
+    if ( !IS_ALIGNED(virt, PAGE_SIZE) )
+    {
+        printk("The virtual address is not aligned to the page-size.\n");
+        return -EINVAL;
+    }
+
+    spin_lock(&xen_pt_lock);
+
+    while ( left )
+    {
+        unsigned int order, level;
+
+        level = pt_mapping_level(vfn, mfn, left, flags);
+        order = XEN_PT_LEVEL_ORDER(level);
+
+        ASSERT(left >= BIT(order, UL));
+
+        rc = pt_update_entry(root, vfn << PAGE_SHIFT, mfn, level, flags);
+        if ( rc )
+            break;
+
+        vfn += 1UL << order;
+        if ( !mfn_eq(mfn, INVALID_MFN) )
+            mfn = mfn_add(mfn, 1UL << order);
+
+        left -= (1UL << order);
+    }
+
+    /* Ensure that PTEs are all updated before flushing */
+    RISCV_FENCE(rw, rw);
+
+    spin_unlock(&xen_pt_lock);
+
+    /*
+     * Always flush TLB at the end of the function as non-present entries
+     * can be put in the TLB.
+     *
+     * The remote fence operation applies to the entire address space if
+     * either:
+     *  - start and size are both 0, or
+     *  - size is equal to 2^XLEN-1.
+     *
+     * TODO: come up with something which will allow not to flash the entire
+     *       address space.
+     */
+    flush_tlb_range_va(0, 0);
+
+    return rc;
+}
+
+int map_pages_to_xen(unsigned long virt,
+                     mfn_t mfn,
+                     unsigned long nr_mfns,
+                     unsigned int flags)
+{
+    /*
+     * Ensure that flags has PTE_VALID bit as map_pages_to_xen() is supposed
+     * to create a mapping.
+     *
+     * Ensure that we have a valid MFN before proceeding.
+     *
+     * If the MFN is invalid, pt_update() might misinterpret the operation,
+     * treating it as either a population, a mapping destruction,
+     * or a mapping modification.
+     */
+    ASSERT(!mfn_eq(mfn, INVALID_MFN) || (flags & PTE_VALID));
+
+    return pt_update(virt, mfn, nr_mfns, flags);
+}
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 16:06:39 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 16:06:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781299.1190900 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnqv-0005Qz-Mo; Wed, 21 Aug 2024 16:06:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781299.1190900; Wed, 21 Aug 2024 16:06:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgnqv-0005OZ-DT; Wed, 21 Aug 2024 16:06:29 +0000
Received: by outflank-mailman (input) for mailman id 781299;
 Wed, 21 Aug 2024 16:06:28 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0Njk=PU=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sgnqt-0003uu-WB
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 16:06:28 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 518bb267-5fd7-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 18:06:26 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-53346132348so2053752e87.2
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 09:06:26 -0700 (PDT)
Received: from fedora.. ([94.75.70.14]) by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5334c75a2cbsm18101e87.187.2024.08.21.09.06.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 21 Aug 2024 09:06:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 518bb267-5fd7-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724256386; x=1724861186; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=r+WwxRSxk0qCYUDqFKxcxr8bTjqN9cnWLzbcX46CN8Q=;
        b=nfXcXXqZRgsY/pNqgs76Eq8QzdlIYiHPAu6UnbTNYlYOXYMlVbUcgHFfImms2V3ebB
         nP5te9gk9oZfTt+R2Y81mtHRqSsMrGx5xsQf+oPfya/gjxr7o4nodHzWQduifLONzieo
         apGKgL2dWD2xWXnaVVPKIwLCuf7ZSYPsVaV8ARWvM0NdAz7kNbM2E3+duwccaG0zSfkq
         qlC6V1yHH9lvxOr3y5qa1MjnvQZ+q03gD2y93wHiFkmPrmCLr6OTn27116tD4Z3dLvcX
         TiPm56vDjNtiGIVe6pU4UBwcCY1oDth1FgXONfr5OCMScHMk/9/XQ6aPA8TAtInxbvUS
         uTNQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724256386; x=1724861186;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=r+WwxRSxk0qCYUDqFKxcxr8bTjqN9cnWLzbcX46CN8Q=;
        b=XrDJuKG/AGd8srfOOZ9DPwziyuXYLmOgOkfVx/Q27kFX1WO6xS9TR07A/qeeiCdXKI
         Px0+dEtvNUuYTZ47Fh+wMBbqzGI7PlLZhJP/2jsjW2aGLavRgoOVfjGTfFNJJ5mhbK6V
         CmfGOFILsz/hTj0bHpbbmkFv3qJF1H2ChFHDqcpbZkVcS5gEQDoAb/k/zo3k5XO98juy
         aiLv92FzLdyXhyrI1WWIQ9GUO6hDnY2KHgeRCxey0Lb6tsjAcIbjbEaOuH5Vj/LpBqxE
         wNbmV7WgjL8kyy7puDGNy5BvToiNPL+rYQxrWZd/fvAQ1QWL2IO+c7mtzDNMPbLgspL0
         ax5A==
X-Gm-Message-State: AOJu0YzHjFw51JNiX+xem4TKMflq1/8vsAj09G9/QxJV9CTpx9l6DehG
	LJu/n9NDhxii9FymCgSfUa6WCE88iEqSnhxoFbWfkRbeKGRDhEID3ccxsA==
X-Google-Smtp-Source: AGHT+IFqxrXDaah+BbfdhrfjN9h4mYDI3oI4pO8J9A7mOr/p/0aQb2HnPhoznB6GwK1pSZzXIysnOw==
X-Received: by 2002:a05:6512:234e:b0:531:4c6d:b8ef with SMTP id 2adb3069b0e04-5334854a59fmr2037352e87.6.1724256384896;
        Wed, 21 Aug 2024 09:06:24 -0700 (PDT)
From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Bob Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v5 7/7] xen/riscv: introduce early_fdt_map()
Date: Wed, 21 Aug 2024 18:06:16 +0200
Message-ID: <4f6573d6b0d996b2c2bc4721de74e9bb51baec8c.1724256027.git.oleksii.kurochko@gmail.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <cover.1724256026.git.oleksii.kurochko@gmail.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Introduce function which allows to map FDT to Xen.

Also, initialization of device_tree_flattened happens using
early_fdt_map().

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in V5:
 - drop usage of PTE_BLOCK for flag argument of map_pages_to_xen() in early_fdt_map()
   as block mapping is now default behaviour. Also PTE_BLOCK was dropped in the patch
   "xen/riscv: page table handling".
---
Changes in V4:
 - s/_PAGE_BLOCK/PTE_BLOCK
 - Add Acked-by: Jan Beulich <jbeulich@suse.com>
 - unwarap two lines in panic() in case when device_tree_flattened is NULL
   so  grep-ing for any part of the message line will always produce a hit.
 - slightly update the commit message.
---
Changes in V3:
 - Code style fixes
 - s/SZ_2M/MB(2)
 - fix condition to check if early_fdt_map() in setup.c return NULL or not.
---
Changes in V2:
 - rework early_fdt_map to use map_pages_to_xen()
 - move call early_fdt_map() to C code after MMU is enabled.
---
 xen/arch/riscv/include/asm/mm.h |  2 ++
 xen/arch/riscv/mm.c             | 55 +++++++++++++++++++++++++++++++++
 xen/arch/riscv/setup.c          |  7 +++++
 3 files changed, 64 insertions(+)

diff --git a/xen/arch/riscv/include/asm/mm.h b/xen/arch/riscv/include/asm/mm.h
index ce1557bb27..4b7b00b850 100644
--- a/xen/arch/riscv/include/asm/mm.h
+++ b/xen/arch/riscv/include/asm/mm.h
@@ -259,4 +259,6 @@ static inline unsigned int arch_get_dma_bitsize(void)
 
 void setup_fixmap_mappings(void);
 
+void *early_fdt_map(paddr_t fdt_paddr);
+
 #endif /* _ASM_RISCV_MM_H */
diff --git a/xen/arch/riscv/mm.c b/xen/arch/riscv/mm.c
index e8430def14..4a628aef83 100644
--- a/xen/arch/riscv/mm.c
+++ b/xen/arch/riscv/mm.c
@@ -1,13 +1,16 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 
+#include <xen/bootfdt.h>
 #include <xen/bug.h>
 #include <xen/compiler.h>
 #include <xen/init.h>
 #include <xen/kernel.h>
+#include <xen/libfdt/libfdt.h>
 #include <xen/macros.h>
 #include <xen/mm.h>
 #include <xen/pfn.h>
 #include <xen/sections.h>
+#include <xen/sizes.h>
 
 #include <asm/early_printk.h>
 #include <asm/csr.h>
@@ -369,3 +372,55 @@ int destroy_xen_mappings(unsigned long s, unsigned long e)
     BUG_ON("unimplemented");
     return -1;
 }
+
+void * __init early_fdt_map(paddr_t fdt_paddr)
+{
+    /* We are using 2MB superpage for mapping the FDT */
+    paddr_t base_paddr = fdt_paddr & XEN_PT_LEVEL_MAP_MASK(1);
+    paddr_t offset;
+    void *fdt_virt;
+    uint32_t size;
+    int rc;
+
+    /*
+     * Check whether the physical FDT address is set and meets the minimum
+     * alignment requirement. Since we are relying on MIN_FDT_ALIGN to be at
+     * least 8 bytes so that we always access the magic and size fields
+     * of the FDT header after mapping the first chunk, double check if
+     * that is indeed the case.
+     */
+    BUILD_BUG_ON(MIN_FDT_ALIGN < 8);
+    if ( !fdt_paddr || fdt_paddr % MIN_FDT_ALIGN )
+        return NULL;
+
+    /* The FDT is mapped using 2MB superpage */
+    BUILD_BUG_ON(BOOT_FDT_VIRT_START % MB(2));
+
+    rc = map_pages_to_xen(BOOT_FDT_VIRT_START, maddr_to_mfn(base_paddr),
+                          MB(2) >> PAGE_SHIFT,
+                          PAGE_HYPERVISOR_RO);
+    if ( rc )
+        panic("Unable to map the device-tree.\n");
+
+    offset = fdt_paddr % XEN_PT_LEVEL_SIZE(1);
+    fdt_virt = (void *)BOOT_FDT_VIRT_START + offset;
+
+    if ( fdt_magic(fdt_virt) != FDT_MAGIC )
+        return NULL;
+
+    size = fdt_totalsize(fdt_virt);
+    if ( size > BOOT_FDT_VIRT_SIZE )
+        return NULL;
+
+    if ( (offset + size) > MB(2) )
+    {
+        rc = map_pages_to_xen(BOOT_FDT_VIRT_START + MB(2),
+                              maddr_to_mfn(base_paddr + MB(2)),
+                              MB(2) >> PAGE_SHIFT,
+                              PAGE_HYPERVISOR_RO);
+        if ( rc )
+            panic("Unable to map the device-tree\n");
+    }
+
+    return fdt_virt;
+}
diff --git a/xen/arch/riscv/setup.c b/xen/arch/riscv/setup.c
index f147ba672f..c9a6909c91 100644
--- a/xen/arch/riscv/setup.c
+++ b/xen/arch/riscv/setup.c
@@ -2,6 +2,7 @@
 
 #include <xen/bug.h>
 #include <xen/compile.h>
+#include <xen/device_tree.h>
 #include <xen/init.h>
 #include <xen/mm.h>
 
@@ -56,6 +57,12 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
 
     setup_fixmap_mappings();
 
+    device_tree_flattened = early_fdt_map(dtb_addr);
+    if ( !device_tree_flattened )
+        panic("Invalid device tree blob at physical address %#lx. The DTB must be 8-byte aligned and must not exceed %lld bytes in size.\n\n"
+              "Please check your bootloader.\n",
+              dtb_addr, BOOT_FDT_VIRT_SIZE);
+
     printk("All set up\n");
 
     for ( ;; )
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 16:17:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 16:17:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781362.1190920 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgo0z-0001jO-OQ; Wed, 21 Aug 2024 16:16:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781362.1190920; Wed, 21 Aug 2024 16:16:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgo0z-0001jE-Jx; Wed, 21 Aug 2024 16:16:53 +0000
Received: by outflank-mailman (input) for mailman id 781362;
 Wed, 21 Aug 2024 16:16:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DO9u=PU=amd.com=stefano.stabellini@srs-se1.protection.inumbo.net>)
 id 1sgo0y-0001gl-MW
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 16:16:52 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on20611.outbound.protection.outlook.com
 [2a01:111:f403:2412::611])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c48448b9-5fd8-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 18:16:50 +0200 (CEST)
Received: from BLAPR03CA0180.namprd03.prod.outlook.com (2603:10b6:208:32f::10)
 by BY5PR12MB4147.namprd12.prod.outlook.com (2603:10b6:a03:205::10)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Wed, 21 Aug
 2024 16:16:42 +0000
Received: from BL02EPF00021F69.namprd02.prod.outlook.com
 (2603:10b6:208:32f:cafe::ef) by BLAPR03CA0180.outlook.office365.com
 (2603:10b6:208:32f::10) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend
 Transport; Wed, 21 Aug 2024 16:16:42 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 BL02EPF00021F69.mail.protection.outlook.com (10.167.249.5) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Wed, 21 Aug 2024 16:16:42 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug
 2024 11:16:41 -0500
Received: from ubuntu-20.04.2-arm64.shared (10.180.168.240) by
 SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Wed, 21 Aug 2024 11:16:41 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c48448b9-5fd8-11ef-a508-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ZoMkFqnXDFvQSQKCwI31zZkeOeR2b++R7U1kHImQeYQHEZPLzOo2NWPuBT0fqPIM34ebnh68ZwTb8S/Khhp5h8+1T1Ob3nBbPtuD65huG4/dFclRLEy4+77G3+Wl3oe2ZNtGbWp3oZdN3k9UeFIzRDD/LovNdoAuW+9VXb7TfEG9oox2ao07s2sfRWxkein8cRWRjTd2yTYD6QApc33R3TN58xNXP8ywA5YkSWYnm540tSa/OZ0ZLKKXPlAb6ku1I2cQzGXjwtJ0DOJp954LNaA6EfMYg2zoxXjFndvPJAnRZI4CBc2+ump52xrkOFxOAt1daccPlj9PQDwLnqb8Lw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=G74wTSTF9yAy9OwKhsdgGFVkDy2MZvABYa7IPrBhaw8=;
 b=jVDUtb7/uKVyl2z51qzxLFFwQV243wXDj12k6NWCFKktqH6kpyRbPHBkitgi4dpLp9OQSghD1tMljXsB3F2a+LGvtoSUQcpOd97w9nVY0pqdkWbX3OIb6ew5sfwCkC87hB8Tq+Vpak1jaB8a2saubQq6KJME82oY5ULpxOX6b8x7OxNCokznKa7QjKYvsTY7GSlry2N+SnykV+buzYgEcLKv5cTTmnEtaK1+iHOQwqxTaUhw5CU+XzbdrhhdoApmVnSHh6tQPhC5nE75sJPcKo9cwFEnoapP+7CzzszKa0O1XYdAz2VwN35W5uj7Su48MSBVs47Sr+9TRBS0mZAHiA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=vates.tech smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=G74wTSTF9yAy9OwKhsdgGFVkDy2MZvABYa7IPrBhaw8=;
 b=VxkqV++1uYvglHPiGd+RhBf8ZemPls4oGBZHOqDlzcSOZ/PC6ZG0OI13zTojcxdKND1On+HfifhuJrWzrxJSf1zhgifG4adU9giY1kl1+MGmzJzVSY2vViDLa/ymscIRgeFz1lktxiepGnmRrgH26lIH+xEzpVY1dkmc+tqQprQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Date: Wed, 21 Aug 2024 09:16:40 -0700
From: Stefano Stabellini <stefano.stabellini@amd.com>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Halder, Ayan Kumar" <ayan.kumar.halder@amd.com>
CC: "Charles-H. Schulz" <charles.schulz@vates.tech>, xen-devel
	<xen-devel@lists.xenproject.org>, Xen Project Advisory Board
	<advisory-board@lists.xenproject.org>, Kelly Choi <kelly.choi@cloud.com>
Subject: Re: Setting up the Xen Communications Team
In-Reply-To: <PH8PR12MB7326CC5D9546BE7CBD8CAF7DBC8E2@PH8PR12MB7326.namprd12.prod.outlook.com>
Message-ID: <alpine.DEB.2.22.394.2408210916300.3871186@ubuntu-linux-20-04-desktop>
References: <e56ff82c1a1d7398a5b38784fc84a7adf51ec918.camel@vates.tech> <PH8PR12MB7326CC5D9546BE7CBD8CAF7DBC8E2@PH8PR12MB7326.namprd12.prod.outlook.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: multipart/mixed;
	boundary="8323329-859443615-1724256998=:3871186"
Content-ID: <alpine.DEB.2.22.394.2408210916390.3871186@ubuntu-linux-20-04-desktop>
Received-SPF: None (SATLEXMB03.amd.com: stefano.stabellini@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL02EPF00021F69:EE_|BY5PR12MB4147:EE_
X-MS-Office365-Filtering-Correlation-Id: 48f4d35e-db6e-4179-ae0e-08dcc1fca500
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?bUF1RGxpdFg4VlZlRW9KeGtIZmF3aDVMM29ab3lWQSs5Smx3d1kxRm5qZVRa?=
 =?utf-8?B?c2hualowYlZLazVuYVpmTVdNNlBvbVlvM0RENkxRblJhMUd4WTBTcFI0SUJw?=
 =?utf-8?B?dUhna1RjM3FjbWJPdEdkK29aTUFwN2N2VmRFa0NTK3JzRmltUU52SDU1TStY?=
 =?utf-8?B?RkdCRUVuTUE3elRhZndpSkhsWEZYMlowQ0FtY3dRYUN1SnJ2T2lNOVRIVzZq?=
 =?utf-8?B?VFlEcHdkQjR2NmFZK21OSVFEQkVlYXo4SE9NczNMVnJHZDZ3eXVvczdpck9Q?=
 =?utf-8?B?SSs1V1BtSGNZUmc2YkdMWGQzN1IvTDZoNDVlRkhNRG9XckJYUnhjcW1oZmoz?=
 =?utf-8?B?MXF1MDVodzdncmIwM2RSdUtPUmVnOStNc2lWTStCaWE1TTQyRmJHbzdtdDZQ?=
 =?utf-8?B?VXhWNm1WKzBKTzNCeTVjWmoyV3lkUjVaRHNpb04zMFV5dDJmZnFHUzhFZm55?=
 =?utf-8?B?NGdOQlNhY0tZMU9hQ1owMWZVOWJwdlJtOXcxTXRRblpOaUlDZnZIdnI0ek9o?=
 =?utf-8?B?Z0cvN0w3RWFhcTY1U2pBT01TTE1mcUcwVFVhRkZMb2Fva1BuZmpBMmF1OXF6?=
 =?utf-8?B?d0xpV1dCN2pMaGRBMitZcmpSNDRYNUhwVlFGR2hwbVhiQ01ia0JVOGNyZWta?=
 =?utf-8?B?cDlGektUd2haOEduQXlZRDZiM1RBWlVyRnNlNy80M1dCS2h3MitXNUdmT2tt?=
 =?utf-8?B?WElQSVArOEpkOVVnblE0UmRna0NCN2NnNEZxRE05b1B3Wkk1UDVCV1lCd3N3?=
 =?utf-8?B?RFo1Q003bWNSejhjdURrMjBwbTJOK3hvbkxpT3M4VUVCUlloL05veG9aT3BG?=
 =?utf-8?B?TnlJWW9IU3BoZ2pQKzlxb2dHRnJEWndFUStsRU5sZVlPMVU0K3R6MVBlNUtN?=
 =?utf-8?B?bmpLS2JSbExqb3Nmbmt0QUJSeEMxNSthOENHMXR0SllRWHFqcXh2a0N0Q3Fh?=
 =?utf-8?B?SXdEckN6T21VSlJvQm53bXBqUDVxUU4wenF1OUtlV1pkZXg5OUIzNHhheVEr?=
 =?utf-8?B?czFKK3pUemMwYWpiU2ZpajJoQkhhTGhyMEI4TnU3VW1wUVJoSWQzRjlRR1E4?=
 =?utf-8?B?VUhWYkdHbDRrN3dwM2tPV1JqR0QvV2hUejNRNWtWS0FsZXJycU45bzQxTzEy?=
 =?utf-8?B?V1Q4R0JXbWZsMkUvOXl5aE1LUUJlNVUxSXYxY0Z1bUdOaS84VWtVbFFhS05S?=
 =?utf-8?B?RmV3bi84TlVyZzlsRG1KUDUwRk81MVlLRFFNUnRuNTN5b2ZxSVZ1NmV0ZGRh?=
 =?utf-8?B?R3hzNmZLQW9MV01MWkZybHhCREk2T1BzNG9Jc1ZqYmtScmR5RW42OUdCTG1B?=
 =?utf-8?B?dFUxTlhMem4rdC8xM000Z1hneHVIL1JDUVQ0Vm5GRGhESlIwYnZxdUFMcHUw?=
 =?utf-8?B?ZGJBZHp4MWhVMGt2VzIrb3FlZUR2ekNEN1ZJSjN4L1BCOXUvcTRJTmVORVJQ?=
 =?utf-8?B?d2lWVmVoQXVXZWJTQWFVbmhxQVNYMDhPVTdjZXBJczRYa2ovdDlFQ0xFdkN3?=
 =?utf-8?B?Y3pvSStUMTdGMmRYVVNNYUp1aDRqRkIzTHM3dGd1MmpSK3BKbkhMQjRPNm9t?=
 =?utf-8?B?Z3k0QXpOZDFoeVBJS3hkcHZoVmw0YlhXUlNhNHFqU3hUc1N2aTVOVloxYXZp?=
 =?utf-8?B?bEFuY25DRVgzcVpNUUZVVWx1U2JYNjJ3UlljL2xNS1VBK2dxdUQ4eUF3UkRl?=
 =?utf-8?B?QTNVdkQ3S21wc2hmQ3pZMHBoMzR2UFVSbUo1Z1VlZndjcXErVi9rbFk2OS9G?=
 =?utf-8?B?NUFwQWx2ZDY4VVVFUXkvejhJWnRJTDRPMkFNNTB2OU5jV1RiLytIMXl2V00y?=
 =?utf-8?B?dXdkMm1Bb2FtakxYQXo0RkFncWRDYUNkT3ZCZlJwYXZmWGU2ekZtZmdoM01U?=
 =?utf-8?B?dDhTRDZxQlF4TWdhL3U4WEN5MllZTk9mdVA4M21oMGI5ejluRnpjSVdJeXhH?=
 =?utf-8?Q?yCF2VSKrn35UaH368n4h3238ZT4s2Akj?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 16:16:42.3347
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 48f4d35e-db6e-4179-ae0e-08dcc1fca500
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL02EPF00021F69.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4147

--8323329-859443615-1724256998=:3871186
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8BIT
Content-ID: <alpine.DEB.2.22.394.2408210916391.3871186@ubuntu-linux-20-04-desktop>

Me too

Cheers,

Stefano


On Wed, 21 Aug 2024, Halder, Ayan Kumar wrote:
> Hi Charles,
> 
>  
> 
> Thanks for taking the initiative. 😊
> 
> I will be interested to join.
> 
>  
> 
> Kind regards,
> 
> Ayan
> 
>  
> 
> From: Advisory-board <advisory-board-bounces@lists.xenproject.org> on behalf of Charles-H. Schulz <charles.schulz@vates.tech>
> Date: Monday, 19 August 2024 at 10:46
> To: xen-devel <xen-devel@lists.xenproject.org>, Xen Project Advisory Board <advisory-board@lists.xenproject.org>
> Cc: Kelly Choi <kelly.choi@cloud.com>
> Subject: Setting up the Xen Communications Team
> 
> Hello everyone,
> 
> Just like any major FOSS project, Xen needs to take care of its
> messaging and communication. We are usually focused on software
> development, however we'd like to take the opportunity to call on
> whoever is interested here to join the small team in charge of
> Communications. 
> 
> We do not expect this to involve a large additional workload. If you
> are interested in joining, please send a message to Kelly or reply to
> this email.
> 
> Thank you,
> 
> --
> Charles-H. Schulz
> Chief Strategy Officer
> Vates SAS - +33 (0)6 98 65 54 24
> 
> 
> 
--8323329-859443615-1724256998=:3871186--


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 16:17:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 16:17:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781373.1190930 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgo1b-0002Lh-0A; Wed, 21 Aug 2024 16:17:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781373.1190930; Wed, 21 Aug 2024 16:17:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgo1a-0002La-TS; Wed, 21 Aug 2024 16:17:30 +0000
Received: by outflank-mailman (input) for mailman id 781373;
 Wed, 21 Aug 2024 16:17:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=YIGS=PU=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sgnrj-0003sE-H7
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 16:07:19 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 70dfe655-5fd7-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 18:07:18 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a7a8a4f21aeso841033766b.2
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 09:07:18 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868a37732dsm4681166b.48.2024.08.21.09.07.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 09:07:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 70dfe655-5fd7-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724256438; x=1724861238; 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=tmYxxokZc1hpO63BId6nvFeSKw1mDHmJPw2JVqiLm0Q=;
        b=S4blOtoxi/GfSIUyDYOqrGrAqSvsUfcLC7kuBe7b29PTsWwIVNmoZs1NVOG2ehYm7a
         5o8C1KCjjPmZU7ySVrjUw5hX5YBXrILGIUjCKD5pKFqRutHcIJ0pMb4AQZaYXDR7laPG
         oq9sgjd7zYR6YOsbdWHAqY6DsGX4nzgXHndsimx8kJnRHJVmsGrD2P8ZXvpe/VfpjE3I
         D3UpP5DPK4KNCANYE5Lme8cjHTr7Y+lTvEsTvu2kuNCjpzazEb5czOGq8KstoZ4rWeNw
         WpoBOo9iQor4umTksLDZk6T+XNjR6cdFL7DqrxRm4KPUTxkBwj5TcJxZzjj5pE9nVXWw
         ZTSg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724256438; x=1724861238;
        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=tmYxxokZc1hpO63BId6nvFeSKw1mDHmJPw2JVqiLm0Q=;
        b=RW9updwb0UKNnT9K7PrVJ9DeeLLSJVSfz8hm5UbNxxFJ9pyulS7a4gCIjAHssBoX7J
         82cb2k5/BvtHmVM79AkcrtL36lZAm2qG0NIb1oYQgDsYQqk3vHHg1A6U16VDHfWFxWbU
         aLeHbMnsZz1ggKjK7w69yQELBE0kkeITt8n4ypJMuw0qCjF08nMQYS6VnfIyi9gpgKAY
         bodLiHuzmQSxYTPTgOJvTU7/5KUgRJ8pmzxbKUM9a7iQ+kZm+TthKjAPiUi9MvISxCOI
         M7oom9G0IZMJIKdCvlLFRPA1cwVGT0qhrj4K6GGZmrs8llT8eWWVuWGLb3pZmxf7cizI
         9PLw==
X-Forwarded-Encrypted: i=1; AJvYcCU7b3boZ5v2jiKo+UEamKn2aK9GpRPlmegRNfOKNfBBSgyoc+2ec2Ub52EH/iPeLVOlP0fryZ1K4Ds=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyUyox9Wl0Rp2nkUfiF5hgw7FSvoqJf0RA+/ale1oLR/cx1xGA3
	Jl6ETCq9GV3f6d3Vx/YiTdLAxffHdR/YRpgGJj/mmKPqSnuwy+oE6Hnoyi5jig==
X-Google-Smtp-Source: AGHT+IFys5vfZbuVcA0N/jmxIstk/gTgrtjyOLX8D5bq8bcTe3dMzO65vaQKfG1wRKFZSQtUMrklWQ==
X-Received: by 2002:a17:907:e2d6:b0:a7d:35d7:4aa9 with SMTP id a640c23a62f3a-a866f385ff1mr217211366b.34.1724256438276;
        Wed, 21 Aug 2024 09:07:18 -0700 (PDT)
Message-ID: <88f54c3f-a81b-4323-a7cf-3a6be41a9207@suse.com>
Date: Wed, 21 Aug 2024 18:07:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] x86/cpufeatures: Add new cpuid features in SPR to
 featureset
To: Matthew Barnes <matthew.barnes@cloud.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 xen-devel@lists.xenproject.org
References: <248b4ea259aa78a17b7b05043ed211a00863bf94.1724247366.git.matthew.barnes@cloud.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: <248b4ea259aa78a17b7b05043ed211a00863bf94.1724247366.git.matthew.barnes@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 21.08.2024 17:34, Matthew Barnes wrote:
> Upon running `xen-cpuid -v` on a host machine with Sapphire Rapids
> within Dom0, there exist unrecognised features.
> 
> This patch adds these features as macros to the CPU featureset,
> disabled by default.
> 
> Signed-off-by: Matthew Barnes <matthew.barnes@cloud.com>

I don't strictly mind the patch in this shape, but ...

> @@ -276,10 +283,13 @@ XEN_CPUFEATURE(TSX_FORCE_ABORT, 9*32+13) /* MSR_TSX_FORCE_ABORT.RTM_ABORT */
>  XEN_CPUFEATURE(SERIALIZE,     9*32+14) /*A  SERIALIZE insn */
>  XEN_CPUFEATURE(HYBRID,        9*32+15) /*   Heterogeneous platform */
>  XEN_CPUFEATURE(TSXLDTRK,      9*32+16) /*a  TSX load tracking suspend/resume insns */
> +XEN_CPUFEATURE(PCONFIG,       9*32+18) /*   PCONFIG insn */
>  XEN_CPUFEATURE(ARCH_LBR,      9*32+19) /*   Architectural Last Branch Record */
>  XEN_CPUFEATURE(CET_IBT,       9*32+20) /*   CET - Indirect Branch Tracking */
> +XEN_CPUFEATURE(AMX_BF16,      9*32+22) /*   Tile computational operations on bfloat16 numbers */
>  XEN_CPUFEATURE(AVX512_FP16,   9*32+23) /*A  AVX512 FP16 instructions */
>  XEN_CPUFEATURE(AMX_TILE,      9*32+24) /*   AMX Tile architecture */
> +XEN_CPUFEATURE(AMX_INT8,      9*32+25) /*   Tile computational operations on 8-bit integers */
>  XEN_CPUFEATURE(IBRSB,         9*32+26) /*A  IBRS and IBPB support (used by Intel) */
>  XEN_CPUFEATURE(STIBP,         9*32+27) /*A  STIBP */
>  XEN_CPUFEATURE(L1D_FLUSH,     9*32+28) /*S  MSR_FLUSH_CMD and L1D flush. */

... having had a respective (more complete) patch pending for years I really
wonder if it shouldn't be that one to be taken. While it would need adjustment
to go ahead of other stuff (as posted in v3), I don't think it has any true
dependency on earlier patches in the AMX series. IOW I could re-post v4
standalone, and then we'd have a more complete view on AMX as well as proper
dependencies in place.

Thoughts?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 16:24:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 16:24:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781400.1190955 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgo7y-0005Lr-UB; Wed, 21 Aug 2024 16:24:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781400.1190955; Wed, 21 Aug 2024 16:24:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgo7y-0005Lk-Rf; Wed, 21 Aug 2024 16:24:06 +0000
Received: by outflank-mailman (input) for mailman id 781400;
 Wed, 21 Aug 2024 16:24:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8p22=PU=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sgo7x-0004dV-CJ
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 16:24:05 +0000
Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com
 [2607:f8b0:4864:20::82b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c800c8bf-5fd9-11ef-a508-bb4a2ccca743;
 Wed, 21 Aug 2024 18:24:04 +0200 (CEST)
Received: by mail-qt1-x82b.google.com with SMTP id
 d75a77b69052e-454b3d8999aso27503211cf.1
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 09:24:04 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 d75a77b69052e-454f70f34d1sm3672651cf.63.2024.08.21.09.24.02
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 09:24:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c800c8bf-5fd9-11ef-a508-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724257443; x=1724862243; 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=bcU5ns9QzOmlHQHyrwwjZZlosgTIKs2EQmD/T1SCrSI=;
        b=jr0fmaojN2zf/+h3p82jF/ffBt+mGd5ZkQBTLtT6U+75TkZK67M+G5x3xrviFG4Bax
         /zRlyGFdmvmOALkO1ENsflc2lfJ3dUUQjd+FaqDE3JIqxOR3U/VZiM8ebHKMyagkwV5M
         7bYVppb6PqPIUHnZogmdOPfcX0off4+xhBJWs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724257443; x=1724862243;
        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=bcU5ns9QzOmlHQHyrwwjZZlosgTIKs2EQmD/T1SCrSI=;
        b=U2tVmtcoQHwA7S4lWrFR8tFpcijnoQXY7+qWgNl7H+51q1opUHS4TbQHymbhh5MQPz
         AYxe6lAViRA4Ukf8rdVeg9XVH7IPMRN+3hkAGrxqz8XsXQQlsPrTyDbPXoXmmSfUXkr3
         nK5iaxsfjWHTYxN36bqn1EGQhAn4sPGdsUcpKHWB4tPDsBsOxe/Xkx13fFLrDRUtwJno
         AK9apzQOYlt3K2fTfJVa1bpFLPnCJErQ1zCpZ0E4SG1jH/s0DE5p993Q1MBjfu0GpaO5
         5cZtZRGYyUQX/i00Aan4rS8BQwsiBEZVMZWRw1OyZR1ZgqXJazy9bIy1iUkpQIgAiLnc
         JpVQ==
X-Forwarded-Encrypted: i=1; AJvYcCUn9J/q0pAQ66/vPsoTlt2DoxzWh3QioDEPkxF6OdILFUsh4I4lYv1//xFaVHxSNNTNz54ucauDjI8=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yydbm4wrLZc9qea+30DM7Jvi/H1JvgJjubGwMqmx+vudydLegKM
	ZWenX8i+nR5+Djq5u5TaepLBGkZTmKvyIkMGYw0IrKGOauFzg2CzxnGUVmPRYJn/gMwTxoLHpWf
	x
X-Google-Smtp-Source: AGHT+IHp4mCnfMqT/MOowhbK3BoCzXtlfHvpgqepGsuzTCzVBMMJ5sf/qqFNi2mS80miaUQBl6sKSw==
X-Received: by 2002:a05:622a:4a87:b0:446:5fe5:5e6e with SMTP id d75a77b69052e-454f21e4a28mr32086461cf.17.1724257443202;
        Wed, 21 Aug 2024 09:24:03 -0700 (PDT)
Message-ID: <3c9ed143-8f8f-447f-9312-7d6db88a1008@citrix.com>
Date: Wed, 21 Aug 2024 17:24:00 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: convert op_bytes/opc checks in SIMD emulation
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <bfc9722a-cb6d-45d0-9351-ddfcd0bbb2e0@suse.com>
 <e96daf14-f1ea-4590-baab-62be50f8d54b@citrix.com>
 <02bf330d-83bc-4fcd-9a1e-a3f1228d2873@suse.com>
 <672e8b2b-2bd6-4099-bbf6-67c39f23cca5@citrix.com>
 <bece14e4-61b9-4f6a-891d-4761821dfde7@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <bece14e4-61b9-4f6a-891d-4761821dfde7@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 21/08/2024 4:56 pm, Jan Beulich wrote:
>>>>> --- a/xen/arch/x86/x86_emulate/x86_emulate.c
>>>>> +++ b/xen/arch/x86/x86_emulate/x86_emulate.c
>>>>> @@ -8114,13 +8114,13 @@ x86_emulate(
>>>>>      }
>>>>>      else if ( state->simd_size != simd_none )
>>>>>      {
>>>>> -        generate_exception_if(!op_bytes, X86_EXC_UD);
>>>>>          generate_exception_if((vex.opcx && (d & TwoOp) &&
>>>>>                                 (vex.reg != 0xf || (evex_encoded() && !evex.RX))),
>>>>>                                X86_EXC_UD);
>>>>>  
>>>>> -        if ( !opc )
>>>>> -            BUG();
>>>>> +        EXPECT(op_bytes);
>>>>> +        EXPECT(opc);
>>>> This is the only BUG() in x86_emulate.c, and it's right to get rid of it
>>>> IMO.
>>>>
>>>> Therefore, we should have a hunk removing it from
>>>> tools/tests/x86_emulator/x86-emulate.h too, which will prevent
>>>> reintroduction.
>>>>
>>>> Maybe even undef BUG somewhere in x86_emulate/private.h?
>>> Both of these actions can only be taken if the other BUG() in decode.c
>>> also goes away. But yes, what you suggest is probably the best course of
>>> action. I guess I'll do that in yet another patch, though.
>> Is that BUG() local to your tree?  I cant see it in staging.
> I first thought it would be when you mentioned you found only one, but it's
> been there for a long time[1], in VEX/EVEX prefix decoding. With a comment
> added by you[2].

Oh, I'm clearly blind.

But yes, that one wants to become EXPECT() too, I'd say.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 16:42:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 16:42:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781434.1190965 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgoPq-0002H5-FT; Wed, 21 Aug 2024 16:42:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781434.1190965; Wed, 21 Aug 2024 16:42:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgoPq-0002Gy-Cc; Wed, 21 Aug 2024 16:42:34 +0000
Received: by outflank-mailman (input) for mailman id 781434;
 Wed, 21 Aug 2024 16:42:32 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zk+i=PU=cloud.com=alejandro.vallejo@srs-se1.protection.inumbo.net>)
 id 1sgoPo-0002GZ-QT
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 16:42:32 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5b96c701-5fdc-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 18:42:30 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5bf0261f162so3748874a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 21 Aug 2024 09:42:30 -0700 (PDT)
Received: from localhost ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a838396d048sm914624066b.204.2024.08.21.09.42.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 21 Aug 2024 09:42:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5b96c701-5fdc-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724258550; x=1724863350; darn=lists.xenproject.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=/uIToOcS9bFZSObp588RX/bNigbju3ljCQwSBwqDf8M=;
        b=LB0K29S0ivCQ/+Fp+rMBWf2lQNh5dD9SMTCGQEBhhDmMIqcLNDOarq4AoXAlY3+JZc
         eGRaQmd8zb9pMIJtYGlNALYjBrYFXvJk+dZnp4eCf0bm/3pmHX9sH4u8XPFo35mHkX6B
         p4E8gF8bFP0UgITFXqX5PlBr9MVNF9JmbvwQk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724258550; x=1724863350;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-transfer-encoding:mime-version:x-gm-message-state:from:to
         :cc:subject:date:message-id:reply-to;
        bh=/uIToOcS9bFZSObp588RX/bNigbju3ljCQwSBwqDf8M=;
        b=Sfi/jsGTbCQNv9jtPzlTyJfMriTX7zOACrGIOByB5LQ+vNnYtU7z4p4bQqYYaZpZkK
         3S6v46Gy1XnoBTHYEfBrF3+f0kAYlQRUu21rTZ+uNW+bfmaDTJlVEonnMY1qCGxj+J8P
         2kFuXz31/P5608m7fOVLgs5B9WVAJASZMNHgdvIq3JsamkP1uR3zj1rMH1RFwhQBP32Z
         C7lNOk7BR08NSiIbz3ygcV8OfZrrX+gbbTfwe3F2uP68T1xQhzDwrA8WvSopLDH13Xnm
         5qauzpGd6bmAQw8dtAT9aRbBNUkBkL/hlvQHv6SCj8QqK3SgjrRa2dwZkSC+NEx9KWUy
         dD6Q==
X-Forwarded-Encrypted: i=1; AJvYcCWHKGBEEF6/jb/T3BB+yeRskyQuKCfSol6LMeWP0+pdeuVB4HQ6jd9ESQq60QqvQhS4RakiDzz1+Ck=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyPq+KfxNjjthNz4DXzYXA08begbS56gZDcPaXvpcz1O73Cn7ni
	s/mZcPU8KY36nYIsgipghTwC2auKkyuAAdzkZHOgn79PSvnjQ/LLf/6NL/f/ESk=
X-Google-Smtp-Source: AGHT+IEj65N+H978XYqlVJ2CD9FvizofeBrq+ZMOPLDW7RL7tiqfmkpEergnfNeL94qBJG1w+I0E4Q==
X-Received: by 2002:a17:907:d84a:b0:a6f:4a42:1976 with SMTP id a640c23a62f3a-a866f42df5cmr233821766b.37.1724258549984;
        Wed, 21 Aug 2024 09:42:29 -0700 (PDT)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Wed, 21 Aug 2024 17:42:26 +0100
Message-Id: <D3LQN57ALKYC.1RG6ZQ90U2WEB@cloud.com>
Cc: "Jan Beulich" <jbeulich@suse.com>, "Andrew Cooper"
 <andrew.cooper3@citrix.com>
Subject: Re: [PATCH 15/22] x86/idle: allow using a per-pCPU L4
From: "Alejandro Vallejo" <alejandro.vallejo@cloud.com>
To: "Roger Pau Monne" <roger.pau@citrix.com>,
 <xen-devel@lists.xenproject.org>
X-Mailer: aerc 0.17.0
References: <20240726152206.28411-1-roger.pau@citrix.com>
 <20240726152206.28411-16-roger.pau@citrix.com>
In-Reply-To: <20240726152206.28411-16-roger.pau@citrix.com>

On Fri Jul 26, 2024 at 4:21 PM BST, Roger Pau Monne wrote:
> diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
> index 9cfcf0dc63f3..b62c4311da6c 100644
> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -555,6 +555,7 @@ void arch_vcpu_regs_init(struct vcpu *v)
>  int arch_vcpu_create(struct vcpu *v)
>  {
>      struct domain *d =3D v->domain;
> +    root_pgentry_t *pgt =3D NULL;
>      int rc;
> =20
>      v->arch.flags =3D TF_kernel_mode;
> @@ -589,7 +590,23 @@ int arch_vcpu_create(struct vcpu *v)
>      else
>      {
>          /* Idle domain */
> -        v->arch.cr3 =3D __pa(idle_pg_table);
> +        if ( (opt_asi_pv || opt_asi_hvm) && v->vcpu_id )
> +        {
> +            pgt =3D alloc_xenheap_page();
> +
> +            /*
> +             * For the idle vCPU 0 (the BSP idle vCPU) use idle_pg_table
> +             * directly, there's no need to create yet another copy.
> +             */

Shouldn't this comment be in the else branch instead? Or reworded to refer =
to
non-0 vCPUs.

> +            rc =3D -ENOMEM;

While it's true rc is overriden later, I feel uneasy leaving it with -ENOME=
M
after the check. Could we have it immediately before "goto fail"?

> +            if ( !pgt )
> +                goto fail;
> +
> +            copy_page(pgt, idle_pg_table);
> +            v->arch.cr3 =3D __pa(pgt);
> +        }
> +        else
> +            v->arch.cr3 =3D __pa(idle_pg_table);
>          rc =3D 0;
>          v->arch.msrs =3D ZERO_BLOCK_PTR; /* Catch stray misuses */
>      }
> @@ -611,6 +628,7 @@ int arch_vcpu_create(struct vcpu *v)
>      vcpu_destroy_fpu(v);
>      xfree(v->arch.msrs);
>      v->arch.msrs =3D NULL;
> +    free_xenheap_page(pgt);
> =20
>      return rc;
>  }

I guess the idle domain has a forever lifetime and its vCPUs are kept aroun=
d
forever too, right?; otherwise we'd need extra logic in the the vcpu_destro=
y()
to free the page table copies should they exist too.

Cheers,
Alejandro


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 17:08:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 17:08:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781444.1190976 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgooZ-0007yo-D5; Wed, 21 Aug 2024 17:08:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781444.1190976; Wed, 21 Aug 2024 17:08:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgooZ-0007yh-AV; Wed, 21 Aug 2024 17:08:07 +0000
Received: by outflank-mailman (input) for mailman id 781444;
 Wed, 21 Aug 2024 17:08:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgooX-0007yX-QK; Wed, 21 Aug 2024 17:08:05 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgooX-0007vy-7k; Wed, 21 Aug 2024 17:08:05 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgooW-0000Xv-PI; Wed, 21 Aug 2024 17:08:04 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sgooW-0000iE-Oc; Wed, 21 Aug 2024 17:08:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=cEl6QlT2mmy2U0i3MJqtt4XsKz94LhZuFQWZsCCXM4o=; b=Jd6qfHl245eUf7cpN0cU1GZ3LM
	QfwjFj2LRDobYfBUIZIRuD3gDlq/Fqk7cTzqLG4VtrGhY4DwAISvLuszn3mrmjVhMxcWAlWpT1CSl
	qUvOaaliLE8kKMJE4pLJVfM1XEg3AmgxlkvRxasdmXrO5gTrIbDzbH1X6BMTaDBhidGI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187298-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187298: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=85e07fb1ceee7943879f8a374cabfa8ab858a3c6
X-Osstest-Versions-That:
    libvirt=ab7f877f27caa7249f42e93678dbdb1a2ef2cc4e
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 21 Aug 2024 17:08:04 +0000

flight 187298 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187298/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187290
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 libvirt              85e07fb1ceee7943879f8a374cabfa8ab858a3c6
baseline version:
 libvirt              ab7f877f27caa7249f42e93678dbdb1a2ef2cc4e

Last test of basis   187290  2024-08-20 04:18:45 Z    1 days
Testing same since   187298  2024-08-21 04:18:46 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Michal Privoznik <mprivozn@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   ab7f877f27..85e07fb1ce  85e07fb1ceee7943879f8a374cabfa8ab858a3c6 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 20:31:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 20:31:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781478.1190987 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgryh-00077O-Ez; Wed, 21 Aug 2024 20:30:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781478.1190987; Wed, 21 Aug 2024 20:30:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgryh-00077H-AJ; Wed, 21 Aug 2024 20:30:47 +0000
Received: by outflank-mailman (input) for mailman id 781478;
 Wed, 21 Aug 2024 20:30:46 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DO9u=PU=amd.com=stefano.stabellini@srs-se1.protection.inumbo.net>)
 id 1sgryg-00077B-9O
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 20:30:46 +0000
Received: from NAM02-DM3-obe.outbound.protection.outlook.com
 (mail-dm3nam02on20607.outbound.protection.outlook.com
 [2a01:111:f403:2405::607])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 274f62d6-5ffc-11ef-8776-851b0ebba9a2;
 Wed, 21 Aug 2024 22:30:06 +0200 (CEST)
Received: from PH7P222CA0013.NAMP222.PROD.OUTLOOK.COM (2603:10b6:510:33a::34)
 by CY8PR12MB7124.namprd12.prod.outlook.com (2603:10b6:930:5f::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Wed, 21 Aug
 2024 20:30:02 +0000
Received: from CY4PEPF0000EE38.namprd03.prod.outlook.com
 (2603:10b6:510:33a:cafe::ab) by PH7P222CA0013.outlook.office365.com
 (2603:10b6:510:33a::34) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend
 Transport; Wed, 21 Aug 2024 20:30:02 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CY4PEPF0000EE38.mail.protection.outlook.com (10.167.242.10) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Wed, 21 Aug 2024 20:30:01 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug
 2024 15:30:00 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug
 2024 15:30:00 -0500
Received: from smtp.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 21 Aug 2024 15:29:59 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 274f62d6-5ffc-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=qY4ir6XNVTq9zr9aOeuLAEGw7c9RtYU5yDB6gG0tRGATsNv3TebRoAGb8k3anO0BJGC/6puYw8St4ZFYE5eo3f7z01ChncdOOl21oW4cCOnO49c1XEDyc4ozh4qwqZzJpXdtYaFMFjrE8B2Bp86LJ26eEhwyeXKrW1ojn8Q6UzBEEcYTa7P/uQRDiCmL03aLvGNW5o1jIq1hvO5u/BJ6wqOdjWHaL113WDIT9pXOdeffJknyBXeXIgcnKlrfTdauu0z0zhJFKkN3f+35TCN9ZiOrq/UvZ+zDRCMU8CMvi7J55tsw6rwqzdDvaem+/xifKqkrTGV7FxJcjsCw366paA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=jgqMeOKY8hi0ABVsL3NcbgKfinWJWfIC9XC12p43huU=;
 b=hQ0cAdGEvBwLogcZOE9D6awRIdThH7lNj2PMx4df70hG8/InoaNHfCyerTLamYbdphnXky4gqvxtRjfdkJS8zAW8IHKoSbUDWhY9445E7mr8esxGTQrC9/bIcTZF1Tzg5jpJ6fHiL3NiVyVmmQfBEdm5mWGn1N43S4Q0J+M1BLvxv+w5CjOi9ZB9eqWyX0uWmKrYYT601sOhENDz0kf4LeHoFfODQZGf/XX8QSsT4bnhtcnOYic449x0AXxiVmlhtLYKPdT+3kB70+wKyTxMzbf07mInGV7qfq6++/5YTBmKPv/3bqFYdgnYnNiBGCBM1eD/3g0L9tijh4jDi7lQ0Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=jgqMeOKY8hi0ABVsL3NcbgKfinWJWfIC9XC12p43huU=;
 b=EDYugaRrVv883vtpziNqe6PoCVHmqBhysYRUu8sJGUYfdE9qMFq3OzNLOZmT4/MbWIgPShq5TFcGdAgrYcPrdiAEg4tbM10XlplXBLJ6MfyqsCHhjVhlxBZQZdbrp07Kcf4ERap40PnqwlmQXzeDnOb2S2rypY0oMwNOkfYju0o=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Stefano Stabellini <stefano.stabellini@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: <sstabellini@kernel.org>, <anthony.perard@vates.tech>,
	<cardoe@cardoe.com>, <andrew.cooper3@citrix.com>, Stefano Stabellini
	<stefano.stabellini@amd.com>
Subject: [PATCH v2] automation: restore CR filtering
Date: Wed, 21 Aug 2024 13:29:58 -0700
Message-ID: <20240821202958.3942632-1-stefano.stabellini@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: stefano.stabellini@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE38:EE_|CY8PR12MB7124:EE_
X-MS-Office365-Filtering-Correlation-Id: 88af8df2-f1f8-459d-25d6-08dcc2200885
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?I6YBUjKO+ZlDO72IBbWfKxKrNpOi64Sp+QTjl4VUAzCrPJoJnGz3fWAbFknh?=
 =?us-ascii?Q?C5mC2of4UjYO4ylFOluIesr/SAEmh0DeCX7fE4TWAJso+WwQDXhE6RISESlI?=
 =?us-ascii?Q?Y8Ctamp0xLH4fs7VDkiPP0RyHvMpOE6MU+SAe+fDuWo5eQADfuscTm3KaDVo?=
 =?us-ascii?Q?Meuv2P+Bs0BTVNuW7Rg07dyhYqKwQ793WYUdRoTEADrzeSmFCzIvNrZ0aaMo?=
 =?us-ascii?Q?Lqs/rq9KA9iwEATMeOpwl51aLgnVFGQ0qRaX8pVWc9jdfqVpNJMqxgXYp0sw?=
 =?us-ascii?Q?w8tKwcoWQOsyhmxoAmoI7xVJF+md57UnM3hHs1IvASl7xMfBaptvhHw9rvP/?=
 =?us-ascii?Q?FwZ2Q2kKcp6ojVc9nUd+SQH/Sl45vsVgyxeAIjg/qo/MPigCnh7d++b6vP/u?=
 =?us-ascii?Q?jmctX+7sePywwVol9IfryDtRkukimPFjK7t5NqxKEMZQetIoKWC55x+I0tGg?=
 =?us-ascii?Q?aMFSK7dGmDJgI0KFEa3g8ahdf+rWWGd9uaMPKkptwujHu9t0bdG4snjaAXMp?=
 =?us-ascii?Q?B1ZAkcVUOAmVJ3lqckAAJ/OnOjetKfezd5rUqlJFSuRzth41R5kiSYEIhVKa?=
 =?us-ascii?Q?4UmQ543qAW7ZoSRWsn+gFAGLEBs20Y0EZ0fqrRlihCpz899lUMbEdIKQshFO?=
 =?us-ascii?Q?bSFTkJ9Xn9+XFDD77qeMFnKv9iR1nRleNI7SgPUdepmeTgyVk3CGLcTDtFVm?=
 =?us-ascii?Q?iKRe/SrcYkICFz2VT6FqGLETOxM00LbnTDAOB9+J30o59gq+AHAAAS80ytr+?=
 =?us-ascii?Q?T90nL1AUQ1QBdJyAPPzbYWzP0rHNefLokzcsxHdGhvZDTc+4YbGy8tA/d/c7?=
 =?us-ascii?Q?Oy0QqW+qWriWxtOGui9iBGT7TB2MIlYIDlFwDXoRiwBMBD7e9DqXjKoptQ8a?=
 =?us-ascii?Q?dsLCMc0WzUIe3ESe7ZaY3JrtcrpuIenJML0RlLiY2WaBJhqFoqxc+J8uCvQP?=
 =?us-ascii?Q?Myhov6Gf75HkBM3H7Q2uDFw8gtWIUSIf+t0/hyFNZ1iuHaTb2GAPS2Jz1Ts+?=
 =?us-ascii?Q?9S+TO7V0Uz2dNh8wsJFG25gPTvoYP5EWHsP0tJy5eUdB+uatfBkcC9ftBDyY?=
 =?us-ascii?Q?corFWqilXv2noS30+g9MHHBQUjT3Y6Fzdh3GfCPLxFpRgZy6ROSeCmahldRN?=
 =?us-ascii?Q?7/LqkGXU8fXUnqnDgcYiI40UBV1U4FyUgodG4fkOypDiG2ho9alw8ATIon7G?=
 =?us-ascii?Q?ddsgFngGRbhGtA0i2PmDBnLQn9r7juo9lz5p6cm1/4JIwiaGG4zO7VmGB6uC?=
 =?us-ascii?Q?AjeInKYEoVUxTUmAeu/m3Kji0+M/OoOG6RYQkyGHaNy1/uiA/+Ybtau7epGp?=
 =?us-ascii?Q?Jb1KDMdeBVoyDvLqvfzuCamBMhFOEWZECA/6IY3SjXJ4ug1TKzVy0Lk64vks?=
 =?us-ascii?Q?b9xco79iwmIy7V3eU49BSf9hlUBRLDtJv0V4AD8pnBEydT9WlzkDvyjL8HPQ?=
 =?us-ascii?Q?HKcvJ/UVmi9oIrATbPbi8XdCUqjslC1z?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 20:30:01.6203
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 88af8df2-f1f8-459d-25d6-08dcc2200885
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000EE38.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7124

After commit c36efb7fcea6 ("automation: use expect to run QEMU") we lost
the \r filtering introduced by b576497e3b7d ("automation: remove CR
characters from serial output"). This patch reintroduced it.

Fixes: c36efb7fcea6 ("automation: use expect to run QEMU")
Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
Changes in v2:
- fix the sed expression to account for multiple \r
- ensure Xen logs are visible too
---
 automation/scripts/qemu-alpine-x86_64.sh        | 2 +-
 automation/scripts/qemu-smoke-dom0-arm32.sh     | 2 +-
 automation/scripts/qemu-smoke-dom0-arm64.sh     | 2 +-
 automation/scripts/qemu-smoke-dom0less-arm32.sh | 2 +-
 automation/scripts/qemu-smoke-dom0less-arm64.sh | 2 +-
 automation/scripts/qemu-smoke-ppc64le.sh        | 2 +-
 automation/scripts/qemu-smoke-riscv64.sh        | 2 +-
 automation/scripts/qemu-smoke-x86-64.sh         | 2 +-
 automation/scripts/qemu-xtf-dom0less-arm64.sh   | 2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 5359e0820b..42a89e86b0 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -89,4 +89,4 @@ export QEMU_LOG="smoke.serial"
 export LOG_MSG="Domain-0"
 export PASSED="BusyBox"
 
-./automation/scripts/qemu-key.exp
+./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index bbdcb39f1a..fd64b19358 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -96,4 +96,4 @@ export QEMU_LOG="${serial_log}"
 export LOG_MSG="Domain-0"
 export PASSED="/ #"
 
-../automation/scripts/qemu-key.exp
+../automation/scripts/qemu-key.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 0094bfc8e1..e0cea742b0 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -109,4 +109,4 @@ export QEMU_LOG="smoke.serial"
 export LOG_MSG="Domain-0"
 export PASSED="BusyBox"
 
-./automation/scripts/qemu-key.exp
+./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index 68ffbabdb8..e824cb7c2a 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -149,4 +149,4 @@ export QEMU_LOG="${serial_log}"
 export LOG_MSG="${dom0_prompt}"
 export PASSED="${passed}"
 
-../automation/scripts/qemu-key.exp
+../automation/scripts/qemu-key.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index eb25c4af4b..f42ba5d196 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -220,4 +220,4 @@ export QEMU_LOG="smoke.serial"
 export LOG_MSG="Welcome to Alpine Linux"
 export PASSED="${passed}"
 
-./automation/scripts/qemu-key.exp
+./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/scripts/qemu-smoke-ppc64le.sh
index ccb4a576f4..594f92c19c 100755
--- a/automation/scripts/qemu-smoke-ppc64le.sh
+++ b/automation/scripts/qemu-smoke-ppc64le.sh
@@ -25,4 +25,4 @@ export QEMU_CMD="qemu-system-ppc64 \
 export QEMU_LOG="${serial_log}"
 export PASSED="Hello, ppc64le!"
 
-./automation/scripts/qemu-key.exp
+./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
index 0355c075b7..c2595f657f 100755
--- a/automation/scripts/qemu-smoke-riscv64.sh
+++ b/automation/scripts/qemu-smoke-riscv64.sh
@@ -16,4 +16,4 @@ export QEMU_CMD="qemu-system-riscv64 \
 export QEMU_LOG="smoke.serial"
 export PASSED="All set up"
 
-./automation/scripts/qemu-key.exp
+./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
index 37ac10e068..3440b1761d 100755
--- a/automation/scripts/qemu-smoke-x86-64.sh
+++ b/automation/scripts/qemu-smoke-x86-64.sh
@@ -24,4 +24,4 @@ export QEMU_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
 export QEMU_LOG="smoke.serial"
 export PASSED="Test result: SUCCESS"
 
-./automation/scripts/qemu-key.exp
+./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
index 0666f6363e..4042fe5060 100755
--- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
+++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
@@ -65,4 +65,4 @@ export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x4000000
 export QEMU_LOG="smoke.serial"
 export PASSED="${passed}"
 
-./automation/scripts/qemu-key.exp
+./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 21 20:31:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 20:31:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781485.1190995 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgrzh-0007ba-Mb; Wed, 21 Aug 2024 20:31:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781485.1190995; Wed, 21 Aug 2024 20:31:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgrzh-0007bT-Jo; Wed, 21 Aug 2024 20:31:49 +0000
Received: by outflank-mailman (input) for mailman id 781485;
 Wed, 21 Aug 2024 20:31:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=0c/y=PU=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sgrzg-0007VV-Ce
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 20:31:48 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org
 [2604:1380:40e1:4800::1])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 62362ff9-5ffc-11ef-a50a-bb4a2ccca743;
 Wed, 21 Aug 2024 22:31:46 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 39072CE0EE2;
 Wed, 21 Aug 2024 20:31:43 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9F9BFC32781;
 Wed, 21 Aug 2024 20:31:41 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 62362ff9-5ffc-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724272302;
	bh=+R8Dy7r63QjNE9vA1g9biK4T4oWUUq/f4KamlNJlfdQ=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=E57hC1PmIujDZ753pE5HvHonBU3Q/bXPDhRZ6fEtqhpzsbAXnZTMpPcTfJjoh9pBA
	 IyGcHw5PjpVszuwueRiO9DzGaiIQvtRhTxVsNmVGoAmh6D8fyXaaL1G94lmk30mHV9
	 3Nf891/Ex0GIY5Ga2KhtqaLJI6BModKfvDloSqDIHurW5X0ATKBiwLiP9i4cGsB1o0
	 hKzIYVEd+1m58fwIVtqwel5ZJ04G75Z7H41u0LZRWAM4GYPT1utvYafGN8ForItZ6d
	 h54IlXXAHT4MP1ZyKWl6JurCsclVsgJhOunn6ZzTCJ+/uIsgmBLjNIWnNrkjtQeJd5
	 GSmszFIB1O2bw==
Date: Wed, 21 Aug 2024 13:31:40 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Stefano Stabellini <stefano.stabellini@amd.com>
cc: xen-devel@lists.xenproject.org, sstabellini@kernel.org, 
    anthony.perard@vates.tech, cardoe@cardoe.com, andrew.cooper3@citrix.com
Subject: Re: [PATCH v2] automation: restore CR filtering
In-Reply-To: <20240821202958.3942632-1-stefano.stabellini@amd.com>
Message-ID: <alpine.DEB.2.22.394.2408211331300.3871186@ubuntu-linux-20-04-desktop>
References: <20240821202958.3942632-1-stefano.stabellini@amd.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 20 Aug 2024, Stefano Stabellini wrote:
> After commit c36efb7fcea6 ("automation: use expect to run QEMU") we lost
> the \r filtering introduced by b576497e3b7d ("automation: remove CR
> characters from serial output"). This patch reintroduced it.
> 
> Fixes: c36efb7fcea6 ("automation: use expect to run QEMU")
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
> ---
> Changes in v2:
> - fix the sed expression to account for multiple \r
> - ensure Xen logs are visible too

I forgot to add:
https://gitlab.com/xen-project/people/sstabellini/xen/-/pipelines/1421979833


> ---
>  automation/scripts/qemu-alpine-x86_64.sh        | 2 +-
>  automation/scripts/qemu-smoke-dom0-arm32.sh     | 2 +-
>  automation/scripts/qemu-smoke-dom0-arm64.sh     | 2 +-
>  automation/scripts/qemu-smoke-dom0less-arm32.sh | 2 +-
>  automation/scripts/qemu-smoke-dom0less-arm64.sh | 2 +-
>  automation/scripts/qemu-smoke-ppc64le.sh        | 2 +-
>  automation/scripts/qemu-smoke-riscv64.sh        | 2 +-
>  automation/scripts/qemu-smoke-x86-64.sh         | 2 +-
>  automation/scripts/qemu-xtf-dom0less-arm64.sh   | 2 +-
>  9 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
> index 5359e0820b..42a89e86b0 100755
> --- a/automation/scripts/qemu-alpine-x86_64.sh
> +++ b/automation/scripts/qemu-alpine-x86_64.sh
> @@ -89,4 +89,4 @@ export QEMU_LOG="smoke.serial"
>  export LOG_MSG="Domain-0"
>  export PASSED="BusyBox"
>  
> -./automation/scripts/qemu-key.exp
> +./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
> index bbdcb39f1a..fd64b19358 100755
> --- a/automation/scripts/qemu-smoke-dom0-arm32.sh
> +++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
> @@ -96,4 +96,4 @@ export QEMU_LOG="${serial_log}"
>  export LOG_MSG="Domain-0"
>  export PASSED="/ #"
>  
> -../automation/scripts/qemu-key.exp
> +../automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
> index 0094bfc8e1..e0cea742b0 100755
> --- a/automation/scripts/qemu-smoke-dom0-arm64.sh
> +++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
> @@ -109,4 +109,4 @@ export QEMU_LOG="smoke.serial"
>  export LOG_MSG="Domain-0"
>  export PASSED="BusyBox"
>  
> -./automation/scripts/qemu-key.exp
> +./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> index 68ffbabdb8..e824cb7c2a 100755
> --- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
> +++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> @@ -149,4 +149,4 @@ export QEMU_LOG="${serial_log}"
>  export LOG_MSG="${dom0_prompt}"
>  export PASSED="${passed}"
>  
> -../automation/scripts/qemu-key.exp
> +../automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> index eb25c4af4b..f42ba5d196 100755
> --- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
> +++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> @@ -220,4 +220,4 @@ export QEMU_LOG="smoke.serial"
>  export LOG_MSG="Welcome to Alpine Linux"
>  export PASSED="${passed}"
>  
> -./automation/scripts/qemu-key.exp
> +./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/scripts/qemu-smoke-ppc64le.sh
> index ccb4a576f4..594f92c19c 100755
> --- a/automation/scripts/qemu-smoke-ppc64le.sh
> +++ b/automation/scripts/qemu-smoke-ppc64le.sh
> @@ -25,4 +25,4 @@ export QEMU_CMD="qemu-system-ppc64 \
>  export QEMU_LOG="${serial_log}"
>  export PASSED="Hello, ppc64le!"
>  
> -./automation/scripts/qemu-key.exp
> +./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
> index 0355c075b7..c2595f657f 100755
> --- a/automation/scripts/qemu-smoke-riscv64.sh
> +++ b/automation/scripts/qemu-smoke-riscv64.sh
> @@ -16,4 +16,4 @@ export QEMU_CMD="qemu-system-riscv64 \
>  export QEMU_LOG="smoke.serial"
>  export PASSED="All set up"
>  
> -./automation/scripts/qemu-key.exp
> +./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
> index 37ac10e068..3440b1761d 100755
> --- a/automation/scripts/qemu-smoke-x86-64.sh
> +++ b/automation/scripts/qemu-smoke-x86-64.sh
> @@ -24,4 +24,4 @@ export QEMU_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
>  export QEMU_LOG="smoke.serial"
>  export PASSED="Test result: SUCCESS"
>  
> -./automation/scripts/qemu-key.exp
> +./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> index 0666f6363e..4042fe5060 100755
> --- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
> +++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> @@ -65,4 +65,4 @@ export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x4000000
>  export QEMU_LOG="smoke.serial"
>  export PASSED="${passed}"
>  
> -./automation/scripts/qemu-key.exp
> +./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> -- 
> 2.25.1
> 


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 21:14:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 21:14:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781507.1191005 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgset-0006E7-Tk; Wed, 21 Aug 2024 21:14:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781507.1191005; Wed, 21 Aug 2024 21:14:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgset-0006E0-RE; Wed, 21 Aug 2024 21:14:23 +0000
Received: by outflank-mailman (input) for mailman id 781507;
 Wed, 21 Aug 2024 21:14:23 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sgset-0006Du-A6
 for xen-devel@lists.xenproject.org; Wed, 21 Aug 2024 21:14:23 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sgses-0003mz-6N; Wed, 21 Aug 2024 21:14:22 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.1.244])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sgser-0001MY-TL; Wed, 21 Aug 2024 21:14:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
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=Cx4ssKakeEdCwyas0wHUJUaML984dvzkX+lxx17QvQA=; b=OgH0k58BCqL7VCVKf/9RDktz+b
	PEgv+Uz5ib+OBRjhYjEAx5ubzX7cPeUFVPDIlD+nkLBjRfnxoCuFYd0/Ln2C1AZXA35WKl+mtAXSR
	0IwFQMlCs8LE3jUt4n4Rg5U/0DRPY3q2ghTS/KgcaRpsmjO7//O7+ql+Hr5IfUodw8wI=;
Message-ID: <cd2e6b08-ce76-4707-831a-c21b05ca85cf@xen.org>
Date: Wed, 21 Aug 2024 22:14:19 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen: make VMAP support in MMU system only
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Penny Zheng <penny.zheng@arm.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Wei Chen <wei.chen@arm.com>
References: <20240821122503.2315844-1-ayan.kumar.halder@amd.com>
 <20240821122503.2315844-5-ayan.kumar.halder@amd.com>
Content-Language: en-GB
From: Julien Grall <julien@xen.org>
In-Reply-To: <20240821122503.2315844-5-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Ayan,

On 21/08/2024 13:25, Ayan Kumar Halder wrote:
> From: Penny Zheng <penny.zheng@arm.com>
> 
> Introduce CONFIG_VMAP which is selected by the architectures that use
> MMU. vm_init() does not do anything if CONFIG_VMAP is not enabled.
> 
> VMAP is widely used in ALTERNATIVE feature to remap a range of memory
> with new memory attributes. Since this is highly dependent on virtual
> address translation, we choose to fold VMAP in MMU system.
> 
> In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
> only support in MMU system on ARM architecture. And ALTERNATIVE now
> depends on VMAP.
> 
> HARDEN_BRANCH_PREDICTOR is now gated on MMU as speculative
> attacks are not possible on non MMU based systems (ie Cortex-R52, R82).
> See https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability.

I don't have a strong opinion on whether it should be split. But I do 
agree this deserves a bit more explanation.

Also, as I mentioned before, speculative attacks may be possible on 
non-MMU based systems. In fact some the Cortex-R are in the affected 
list... The R82 and R52 are not listed, but note:

"For information about any unlisted processors please contact Arm".

So how about the following explanation:

"At the moment, the users of HARDEN_BRANCH_PREDICTOR requires to use the 
vmap() to update the exceptions vectors. While it might be possible to 
rework the code, it is believed that speculative attackes would be 
difficult to exploit on non-MMU because the software is tightly 
controlled. So for now make HARDEN_PREDICTOR to depend on the !MMU.

> 
> Also took the opportunity to remove "#ifdef VMAP_VIRT_START .. endif"
> from vmap.c. Instead vmap.c is compiled when HAS_VMAP is enabled. Thus,
> HAS_VMAP is now enabled from x86, ppc and riscv architectures as all of
> them use MMU and has VMAP_VIRT_START defined.
> 
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>

With the typo pointed out by Jan:

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall


From xen-devel-bounces@lists.xenproject.org Wed Aug 21 22:41:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 21 Aug 2024 22:41:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781519.1191016 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgu0w-0003kY-6W; Wed, 21 Aug 2024 22:41:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781519.1191016; Wed, 21 Aug 2024 22:41:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgu0w-0003kR-42; Wed, 21 Aug 2024 22:41:14 +0000
Received: by outflank-mailman (input) for mailman id 781519;
 Wed, 21 Aug 2024 22:41:12 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgu0u-0003kH-Dd; Wed, 21 Aug 2024 22:41:12 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgu0u-0005CL-14; Wed, 21 Aug 2024 22:41:12 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgu0t-0008Ib-BE; Wed, 21 Aug 2024 22:41:11 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sgu0t-0007JM-At; Wed, 21 Aug 2024 22:41:11 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=+xucSiJHo6bBoMU38vfkhmvfFVBA1+fNQf9L3ypadEc=; b=YfrAQ7BTYJ1fsqsrGJPnF8Fv4m
	Xhn+xTShX+zg6YxHNPiTfGwXQXidd75bVPgHyLfTovNbaXx0e1cx6qCG/b5LWVHDPzOFNXsW8ROwt
	ERzCBrMc4AHCgtf3KJoGgwc6KuTci/DyLJo6+iirAjtWpgj8IedRm2k5S6gVm58JAMS8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187300-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187300: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-libvirt-vhd:leak-check/check:fail:regression
    qemu-mainline:test-amd64-amd64-xl-shadow:guest-localmigrate/x10:fail:heisenbug
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=3472f54522a928f0020d6928d54c007f862c5478
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 21 Aug 2024 22:41:11 +0000

flight 187300 qemu-mainline real [real]
flight 187303 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187300/
http://logs.test-lab.xenproject.org/osstest/logs/187303/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707
 test-amd64-amd64-libvirt-vhd 22 leak-check/check         fail REGR. vs. 182707

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-shadow 20 guest-localmigrate/x10 fail pass in 187303-retest

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass

version targeted for testing:
 qemuu                3472f54522a928f0020d6928d54c007f862c5478
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  349 days
Failing since        182723  2023-09-07 18:19:05 Z  349 days   27 attempts
Testing same since   187300  2024-08-21 07:08:57 Z    0 days    1 attempts

------------------------------------------------------------
620 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   fail    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 180812 lines long.)


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 01:52:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 01:52:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781542.1191039 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgwzc-0007iq-DO; Thu, 22 Aug 2024 01:52:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781542.1191039; Thu, 22 Aug 2024 01:52:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgwzc-0007ij-8P; Thu, 22 Aug 2024 01:52:04 +0000
Received: by outflank-mailman (input) for mailman id 781542;
 Thu, 22 Aug 2024 01:52:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgwzb-0007iZ-6Z; Thu, 22 Aug 2024 01:52:03 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgwza-0007rp-Or; Thu, 22 Aug 2024 01:52:02 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgwza-0006rr-4h; Thu, 22 Aug 2024 01:52:02 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sgwza-0001KL-4A; Thu, 22 Aug 2024 01:52:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ZObd/z/Z++OEC/Pprgh3C06L/qRkmZVyYi6/D2Flkjc=; b=wVZE4qqQsQPWV4lxL/cHSbrla5
	rzEthEATs+0hl0L3VTh4Xah8Ut4C5SE4O6BmJUm0SFBfG2LNjh6fTDdd9PKh5fjKcthEhZ0x1105s
	MdXUH036j0AsKMpDfK+ocmmTTLctXtmS818j+1cb9QoMTLQYCbbdrN69un7llzRdfolE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187301-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187301: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=b311c1b497e51a628aa89e7cb954481e5f9dced2
X-Osstest-Versions-That:
    linux=521b1e7f4cf0b05a47995b103596978224b380a8
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 22 Aug 2024 01:52:02 +0000

flight 187301 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187301/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187296
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187296
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187296
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187296
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187296
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187296
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                b311c1b497e51a628aa89e7cb954481e5f9dced2
baseline version:
 linux                521b1e7f4cf0b05a47995b103596978224b380a8

Last test of basis   187296  2024-08-20 21:44:18 Z    1 days
Testing same since   187301  2024-08-21 09:37:38 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jason Gunthorpe <jgg@nvidia.com>
  Jinjie Ruan <ruanjinjie@huawei.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Namjae Jeon <linkinjeon@kernel.org>
  Nicolin Chen <nicolinc@nvidia.com>
  Steve French <stfrench@microsoft.com>
  Thorsten Blum <thorsten.blum@toblux.com>
  Victor Timofei <victor@vtimothy.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   521b1e7f4cf0b..b311c1b497e51  b311c1b497e51a628aa89e7cb954481e5f9dced2 -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 01:56:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 01:56:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781553.1191048 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgx3h-0000Qy-1X; Thu, 22 Aug 2024 01:56:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781553.1191048; Thu, 22 Aug 2024 01:56:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sgx3g-0000Qr-Uy; Thu, 22 Aug 2024 01:56:16 +0000
Received: by outflank-mailman (input) for mailman id 781553;
 Thu, 22 Aug 2024 01:56:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgx3f-0000Me-Df; Thu, 22 Aug 2024 01:56:15 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgx3f-0007xA-CM; Thu, 22 Aug 2024 01:56:15 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sgx3e-00077k-1L; Thu, 22 Aug 2024 01:56:14 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sgx3e-0008KU-0f; Thu, 22 Aug 2024 01:56:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=KDpJ5ciPAEMZN8QIz5U4QQSAXJrGOJAf1M4Pq9Cbwm4=; b=sH9wrCvdmzhiLY+UW5RWiuBb9Y
	scWOlezGw1DqMlFdMXoNLLIng4D4g8p1uZ1xAoxdP3VUhB1aziJFg45bvJXN7yV22IKfn7n2+n8hd
	xjc97MYNB1wZ/Jm5TQ7PY6dmQaTXJhTCW842sjJXWwt739OKJV1Te/xP4akt/wa6qSpg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187304-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187304: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=6d41a9d8a12ff89adabdc286e63e9391a0481699
X-Osstest-Versions-That:
    xen=a30d438ce58b70c5955f5d37f776086ab8f88623
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 22 Aug 2024 01:56:14 +0000

flight 187304 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187304/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  6d41a9d8a12ff89adabdc286e63e9391a0481699
baseline version:
 xen                  a30d438ce58b70c5955f5d37f776086ab8f88623

Last test of basis   187284  2024-08-19 14:03:56 Z    2 days
Testing same since   187304  2024-08-21 23:03:58 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   a30d438ce5..6d41a9d8a1  6d41a9d8a12ff89adabdc286e63e9391a0481699 -> smoke


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 06:37:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 06:37:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781572.1191057 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh1RC-0001Xk-JY; Thu, 22 Aug 2024 06:36:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781572.1191057; Thu, 22 Aug 2024 06:36:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh1RC-0001Xd-Gm; Thu, 22 Aug 2024 06:36:50 +0000
Received: by outflank-mailman (input) for mailman id 781572;
 Thu, 22 Aug 2024 06:36:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=uUbg=PV=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sh1RA-0001XX-W2
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 06:36:49 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on2060e.outbound.protection.outlook.com
 [2a01:111:f403:2415::60e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e6b8edd9-6050-11ef-a50a-bb4a2ccca743;
 Thu, 22 Aug 2024 08:36:46 +0200 (CEST)
Received: from SJ0PR05CA0200.namprd05.prod.outlook.com (2603:10b6:a03:330::25)
 by LV8PR12MB9407.namprd12.prod.outlook.com (2603:10b6:408:1f9::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Thu, 22 Aug
 2024 06:36:38 +0000
Received: from SJ5PEPF00000204.namprd05.prod.outlook.com
 (2603:10b6:a03:330:cafe::25) by SJ0PR05CA0200.outlook.office365.com
 (2603:10b6:a03:330::25) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19 via Frontend
 Transport; Thu, 22 Aug 2024 06:36:36 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SJ5PEPF00000204.mail.protection.outlook.com (10.167.244.37) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Thu, 22 Aug 2024 06:36:35 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 22 Aug
 2024 01:36:34 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 22 Aug
 2024 01:36:34 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Thu, 22 Aug 2024 01:36:33 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e6b8edd9-6050-11ef-a50a-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=CU9/pWBaCTfLbNggxlr0DSNjinM/R36Dwu8jbX6WAuUKcsQKEPszW5nVNSgJlz6iXPLJEazJ8gpJ407L91ErtgfNxCEb7A/nBd31ntTAkuaKo9W4QRFv5iCO3GQlC7xTEJydgaWGIB32wqzKIRutlKCftduQ2UQliCWFBqArZmGYY5AXATJ6mU6dbt+6gzMviE50slfhe0jfC+AUsdInz0MeXFwcyUwdF2NzP/vTnd/omC+YG8LlgUh1OOK/KR6tlByCu9RtWu3fyrXbpdaBK5zc6QxSeyeXBqPBVtGjKlmfH0I1EQx3LKrsKXWnhyjo3dD/Wyb4lCqCvc8Z5sMbOQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=TypTdbROAv6TPgQfQPDqTF5ieOnuAKqqR0kMU2lmy6E=;
 b=Kza2UhO0/legfur64yp/FYXArBjjDUDqlLPuQVLaTaBO9xfe61weB64Sgfg4sgFPJ28ElmQqVQy/fo2RiFPoy0u02RwAMu1MJvGW6pz2txdDCgZba30Qkvz9XAj41b7/TwQum4O+cXpzLdj/eSXHZcN5KKoN6s2OLwoBhCZl3hHAqziXCKCH8MeFqYGLf819JzlAYP8wVewHYnwuL7d9wvf75K/zt798rZxIMha7rVpXQJtKOALEjBsFGjFd0XS7IpzsEF5k6Gj1PV9v83ky3hY4GfwUQZS3NYcjAysXUplY8qF3GwHM6ttkDt8GH+lUb6H05kDNDUNmgT/tPiRaHQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=TypTdbROAv6TPgQfQPDqTF5ieOnuAKqqR0kMU2lmy6E=;
 b=JBbj+bD+OIxGWQEoydh8I8ygbb2beIGrozfQTMGvCwBFX0bgixUHDc5h2Qix16agq0HG95KeLESO8tkheVRKYUiqDL/DO8JzOaZdCVfroU+jLjRlWMPkC+o27bnDtkHrGjzrDiIO3/g4BypD3vWARev5uocTbtiSJgSe4z6MSvc=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <e2b23cca-9652-4aac-8131-56d7ad2cb06a@amd.com>
Date: Thu, 22 Aug 2024 08:36:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] automation: restore CR filtering
To: Stefano Stabellini <stefano.stabellini@amd.com>,
	<xen-devel@lists.xenproject.org>
CC: <sstabellini@kernel.org>, <anthony.perard@vates.tech>,
	<cardoe@cardoe.com>, <andrew.cooper3@citrix.com>
References: <20240821202958.3942632-1-stefano.stabellini@amd.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240821202958.3942632-1-stefano.stabellini@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB05.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF00000204:EE_|LV8PR12MB9407:EE_
X-MS-Office365-Filtering-Correlation-Id: 1cc07888-64ed-4f3f-4c21-08dcc274c504
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?MGlHbWpOWUxaOGZ0STNzbllkclk3bkNtU1lFZHZCRkRsU1Y5M3RBZmZkd0pX?=
 =?utf-8?B?bnhiYzdGZDRIQkt2TExhVnVJcHJKTVEyalF2WlpBcHd2c29yaUxPZzFQMEZL?=
 =?utf-8?B?UTQzbDB2VzduNENDMEc1WWRDUlBBR0VlNENoYlRNQnZDYmRPNWJ5V055U1VN?=
 =?utf-8?B?cEpzMW0zK1FKOFprYXRmYzNlZU01SE9aN1gydDk3M1ZXeEVhUEhaOXZJNzZO?=
 =?utf-8?B?TDdNR3RrNXA2Rmpvc2tMbmpUM2dtNGl2UXowSVpnNEpNOXpDckw5cHVCd0Zm?=
 =?utf-8?B?Y01RMHgzd1ZLckRkWnM4WFBNaGo2TGd4bHFzckp3WnIxRHppcWM2djV4aWxC?=
 =?utf-8?B?QVFVS084clFxYlVPeURKNDBXald2dkJlOVhZSVg4N3hYcWZMZUE0TUtHS1ZR?=
 =?utf-8?B?MmNIbitCeVhtcVJpdy8vQlRQSXZXMUE0R2YxZkdDYTZSU0hvWmhnajBZdGI5?=
 =?utf-8?B?eW1TdlVpM2U3eisrMFQrUHVxUWt2N0NqV21OaTg5cFFRTDk5dkwwOVJJU3hT?=
 =?utf-8?B?NVVjQUxTUkROQ2c0QzhTZU9oVFVSS2FlSTRJVHYwTDFEemZNTFBFMDk5MWJs?=
 =?utf-8?B?YVc1b1B5N1djYmYzMk90Lzdack5wcjAxUk8rQ1J2VGs0dWpyTmw2SmYwKzJW?=
 =?utf-8?B?bU1YdjN5eXNpVG1LSTFvN2UwYjMxc0FZZ3B4N2JYMVF6SUJWdDFvdVF6eGZl?=
 =?utf-8?B?ZFVTRlBCWlNGZnhSMDVqOUhOVVNWdkRNTG1yV1JnQnJVTmpTRnJsVG1yL09C?=
 =?utf-8?B?WUhpUXdrdlVWRUVuSGZ6aUtHK3pDUlNBN1FJSXE2YjlKWWFKVEZabGpKMGRy?=
 =?utf-8?B?R0NobTJjTFJxUi9qTVpjSzhWVnRGOTE5STZ1TWZqYzJ5VVRWVXBMZ3AvL1dh?=
 =?utf-8?B?dkJmUUNrQ1F4akhpMlU0dllnTG5kNE1yREZhY3Z0YnFwVjRIQmE3dm1XRUhy?=
 =?utf-8?B?TC9aTGxKNUE2SXgvcDVUQ3dRVGJydjQ4blc0YVpWeVpRa2xkR0NNdTIyck84?=
 =?utf-8?B?bmw1c1ZiQm9kbm9GbkdmNnE3SjVHS0NaOVFnV3hNMnhyS3AyWFJIN2xQTWo4?=
 =?utf-8?B?SGY0V3lRbU0xNXNZSnJwbGI2ajE3NXFQQjlIUS94dGZHOTRuekRFdURXSEZz?=
 =?utf-8?B?MFVzZVRSdXJoc0h6ZS9LcjUyYzJncUN6WW9FdnJMUGtuaTZVZFZvMDdySEQ5?=
 =?utf-8?B?aC9xQ2RCYVcvaWhQdEQyanB6ZlRudUhURHhhZ0RCMWl0MGk3dDlDV0k3ckhB?=
 =?utf-8?B?QmhoeENROU1GdTNUdWJiWUpTSlFzeFVkSXczd3grQXI5Wkd0aDRPMGNJc0Vs?=
 =?utf-8?B?RzkvR1ErTkkwWU5Bc3dCdDdnUFp2WlJxZ0JubFBydVVRYnlKSmx0ODlKUjV3?=
 =?utf-8?B?amNBbVN1Tjlha0VNSDVWMGk2Q2VyWWNKUGNSeWlPdjdpL0dXRWh5N3FpMGZI?=
 =?utf-8?B?TkJzVU5LS1EzaEs1ekVyclNEMVBCR1R0OVpGVlJ4M3hoVnZQQTVPL1ppYkw0?=
 =?utf-8?B?OERYdnpoWU9KeGI4aWlzK2QrL1BIL3c2NHkwdUp3bk4vZWdPSThMSHVFSCt1?=
 =?utf-8?B?QmdlVU9qa2VoZmdCUXpneFdKaHhGSjNhK2poODhMSTBxTVIva0FWaTJkVmdu?=
 =?utf-8?B?S29EWWN1WVU3M3ZOTHhpZ0dDQW5BZ25mdmpxYVl1aU91a0I5K0hqN1p6eWxp?=
 =?utf-8?B?RGI0NDdxY0V6L0JrMnF6em9SSXZpTUh3Y1ZrRDNWOTNWd01UWHlHS2ZYRnlY?=
 =?utf-8?B?enVQVzRJSUhVdDA0WFUyVEE4b3lBOGw2R3I1V2RrWk9pT1I4WWFvQU5idnZF?=
 =?utf-8?B?K3k5ZDBoUzZMQ2NqVVpFSlNHQnNkQWVnWm1FVXA4N2hxN0h0WUl5ZmtIS21T?=
 =?utf-8?B?bW9qNGxTaFAvd3p4MzhiazJnMnd5YzR0Q1gwaHMzT3lMOW1YOGdWMWpxdGEr?=
 =?utf-8?Q?mxUfV2bnk2Yivg1+WWAHeSGnxS1fNRNr?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 06:36:35.5593
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 1cc07888-64ed-4f3f-4c21-08dcc274c504
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF00000204.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9407



On 21/08/2024 22:29, Stefano Stabellini wrote:
> 
> 
> After commit c36efb7fcea6 ("automation: use expect to run QEMU") we lost
> the \r filtering introduced by b576497e3b7d ("automation: remove CR
> characters from serial output"). This patch reintroduced it.
> 
> Fixes: c36efb7fcea6 ("automation: use expect to run QEMU")
> Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 07:23:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 07:23:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781581.1191068 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh29m-0000uM-UV; Thu, 22 Aug 2024 07:22:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781581.1191068; Thu, 22 Aug 2024 07:22:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh29m-0000uF-RV; Thu, 22 Aug 2024 07:22:54 +0000
Received: by outflank-mailman (input) for mailman id 781581;
 Thu, 22 Aug 2024 07:22:53 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m19V=PV=cloud.com=fouad.hilly@srs-se1.protection.inumbo.net>)
 id 1sh29l-0000u9-20
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 07:22:53 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 551c3aec-6057-11ef-8776-851b0ebba9a2;
 Thu, 22 Aug 2024 09:22:47 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-5334c018913so455897e87.0
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 00:22:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 551c3aec-6057-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724311370; x=1724916170; 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=jmgS55xg6ZJl8yxNgooCYP0Vl69Wb60UaDm28s6UMOA=;
        b=J4TCzyZ2kHKWtAnR+QR8KSWPpfUCcKB5pqHzq+dY7EMS6G78V2Fus2fOp5atJTYlUy
         WSK9uziNG1rqvMG035WzA6xaXLPNnQAnTAoWP8ijsn73kC44RL247eNaBvfBRdhgv7hT
         1oi1DF82b03vcJA7SBLDoJwDn8JBqspKtx09I=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724311370; x=1724916170;
        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=jmgS55xg6ZJl8yxNgooCYP0Vl69Wb60UaDm28s6UMOA=;
        b=beukc+P8sAQGWpgLmqOq33bICsFJ/IykGrJOjLjlpMfyLeRCoStp04tt2C7zpcCYQu
         2puCQi6w7ksHo4LTLwbL6u+bucul2J01BzeWrPXCvOGQgq+Z33jiGq7X4/R0tUtbQBdP
         1CeyUvVuiqEr66qpn7eMerYk2ThkmFJMiyLtgVa2n04WwQZxKTIBBo9ZovmjQVihf5o1
         T3afTks3kAivyByIJ0mY9bw1vIMFafWZH4/S7TfQa9mws0cULB4Z4K0ZJ1byuHrZDiK6
         WvWA2hGQ+rF1eFD59kTa5Ugs5FIKNJcGMRg5lXmP6tiN6oAECoPvI8caN67KptVosegl
         IedA==
X-Forwarded-Encrypted: i=1; AJvYcCXXbClsz3x0BFDeMtgGkseX5xrP0I3Qangzd9LamEK4T8zOqak4YT5tUhtwwlz9FsvFkagc1kfTIYc=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx4EcXhZhYre+ld0qkwjIN1ex6VVPB26pYNvUSxwAMJqhRspvQg
	ZnUklfopIyyZ/DMIgAMF0xCuGmr2K3zZSqenMYalsF0ws/jqVtldHoT+U2+W44hE2NfI3r90nTq
	zhjr9ttv/I1cN6JIpZgMesi97PpddsEfbMRNFKUHaEwom7oGGtJE=
X-Google-Smtp-Source: AGHT+IHH1HcB2kGPQDllTK5k6VaYXgo/DZa30IK1bR39u//I9CarT+GfyfkR86WF+Eu2TzUHOgKqpyzYqUBxSzxB5DE=
X-Received: by 2002:a05:6512:1391:b0:533:4722:ebbe with SMTP id
 2adb3069b0e04-5334fc008e1mr430706e87.26.1724311369154; Thu, 22 Aug 2024
 00:22:49 -0700 (PDT)
MIME-Version: 1.0
References: <20240725082725.2685481-1-fouad.hilly@cloud.com>
 <20240725082725.2685481-4-fouad.hilly@cloud.com> <d26bc29f-3ceb-4fe4-af58-c188f9bbf097@suse.com>
 <CAJKAvHbM=Dhi=VRuaKKGMgoyOP9PHyF=Q50wfezpxs=mkRTZug@mail.gmail.com> <ZsMUnNrxg728eE1J@l14>
In-Reply-To: <ZsMUnNrxg728eE1J@l14>
From: Fouad Hilly <fouad.hilly@cloud.com>
Date: Thu, 22 Aug 2024 08:22:37 +0100
Message-ID: <CAJKAvHbvJO86TZWwiQ9Wyndit3x2h6kgOdQG096ujxsEad+72A@mail.gmail.com>
Subject: Re: [PATCH v6 3/4] x86/ucode: Introduce --force option to xen-ucode
To: Anthony PERARD <anthony.perard@vates.tech>
Cc: Jan Beulich <jbeulich@suse.com>, Juergen Gross <jgross@suse.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000a41e6b0620408694"

--000000000000a41e6b0620408694
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 19, 2024 at 10:47=E2=80=AFAM Anthony PERARD <anthony.perard@vat=
es.tech>
wrote:

> On Mon, Aug 19, 2024 at 09:56:57AM +0100, Fouad Hilly wrote:
> > On Thu, Jul 25, 2024 at 9:44=E2=80=AFAM Jan Beulich <jbeulich@suse.com>=
 wrote:
> >
> > > On 25.07.2024 10:27, Fouad Hilly wrote:
> > > > @@ -79,7 +81,9 @@ static void usage(FILE *stream, const char *name)
> > > >              "options:\n"
> > > >              "  -h, --help            display this help\n"
> > > >              "  -s, --show-cpu-info   show CPU information\n"
> > > > -            "Usage: %s [microcode file | options]\n", name, name);
> > > > +            "  -f, --force           skip certain checks; do not
> use unless\n"
> > > > +            "you know exactly what you are doing\n"
> > >
> > > Did you look at the produced output? Imo you want to have
> > >
> > >             "  -f, --force           skip certain checks; do not use
> unless\n"
> > >             "                        you know exactly what you are
> doing\n"
> > >
> > > > +            "Usage: %s [microcode file [-f,--force] | options]\n",
> name, name);
> > >
> > > At least
> > >
> > >             "Usage: %s [microcode file [-f|--force] | options]\n",
> name, name);
> > >
> > > But: "options" now includes -f / --force, yet that on its own makes n=
o
> sense.
> > > I think this needs further textual clarification to properly indicate
> what is
> > > valid to use and what is not.
> > >
> >
> > Will be fixed in v7:
> > static void usage(FILE *stream, const char *name)
> > {
> >     fprintf(stream,
> >             "%s: Xen microcode updating tool\n"
> >             "Usage: %s [options | microcode-file]\n"
> >             "options:\n"
> >             "  -h, --help                       display this help\n"
> >             "  -s, --show-cpu-info              show CPU information\n"
> >             "  -f, --force <microcode-file>     skip certain checks; do
> not
> > \n"
>
> If I recall correctly, "--force" doesn't take any argument, so this
> usage is misleading. One could be tempted to execute `./xen-ucode
> -fmicrocode` or event `./xen-ucode --force -microcode` and expect it to
> work with files "microcode" or "-microcode" but instead I think getopt()
> is just going to return an error.
>
> Instead of writing "--force <microcode-file>", could you change the help
> text, with something like "skip certain checks when applying microcode"?
>

Sure, can be done in v7:

static void usage(FILE *stream, const char *name)
{
    fprintf(stream,
            "%s: Xen microcode updating tool\n"
            "Usage: %s [options | microcode-file]\n"
            "options:\n"
            "  -h, --help               display this help\n"
            "  -s, --show-cpu-info      show CPU information\n",
            "  -f, --force              skip certain checks when applying\n=
"
            "                           microcode; do not use unless you
know\n"
            "                           exactly what you are doing\n",
            name, name);
    show_curr_cpu(stream);
}

>
> >             "                                   use unless you know
> exactly
> > \n"
> >             "                                   what you are doing\n",
> >             name, name);
> >     show_curr_cpu(stream);
>
> Cheers,
>
> --
>
> Anthony Perard | Vates XCP-ng Developer
>
> XCP-ng & Xen Orchestra - Vates solutions
>
> web: https://vates.tech


Thanks,

Fouad

--000000000000a41e6b0620408694
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Mon, Aug 19, 2024 at 10:47=E2=80=
=AFAM Anthony PERARD &lt;anthony.perard@vates.tech&gt; wrote:<br></div><blo=
ckquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left=
:1px solid rgb(204,204,204);padding-left:1ex">On Mon, Aug 19, 2024 at 09:56=
:57AM +0100, Fouad Hilly wrote:<br>
&gt; On Thu, Jul 25, 2024 at 9:44=E2=80=AFAM Jan Beulich &lt;<a href=3D"mai=
lto:jbeulich@suse.com" target=3D"_blank">jbeulich@suse.com</a>&gt; wrote:<b=
r>
&gt; <br>
&gt; &gt; On 25.07.2024 10:27, Fouad Hilly wrote:<br>
&gt; &gt; &gt; @@ -79,7 +81,9 @@ static void usage(FILE *stream, const char=
 *name)<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;option=
s:\n&quot;<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0=
 -h, --help=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 display this help\n&qu=
ot;<br>
&gt; &gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0=
 -s, --show-cpu-info=C2=A0 =C2=A0show CPU information\n&quot;<br>
&gt; &gt; &gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Usage: %s [=
microcode file | options]\n&quot;, name, name);<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0 -f, =
--force=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0skip certain checks; do not=
 use unless\n&quot;<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;you know ex=
actly what you are doing\n&quot;<br>
&gt; &gt;<br>
&gt; &gt; Did you look at the produced output? Imo you want to have<br>
&gt; &gt;<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;=C2=A0 -f, -=
-force=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0skip certain checks; do not =
use unless\n&quot;<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 y=
ou know exactly what you are doing\n&quot;<br>
&gt; &gt;<br>
&gt; &gt; &gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Usage: %s [=
microcode file [-f,--force] | options]\n&quot;, name, name);<br>
&gt; &gt;<br>
&gt; &gt; At least<br>
&gt; &gt;<br>
&gt; &gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;Usage: %s [m=
icrocode file [-f|--force] | options]\n&quot;, name, name);<br>
&gt; &gt;<br>
&gt; &gt; But: &quot;options&quot; now includes -f / --force, yet that on i=
ts own makes no sense.<br>
&gt; &gt; I think this needs further textual clarification to properly indi=
cate what is<br>
&gt; &gt; valid to use and what is not.<br>
&gt; &gt;<br>
&gt; <br>
&gt; Will be fixed in v7:<br>
&gt; static void usage(FILE *stream, const char *name)<br>
&gt; {<br>
&gt;=C2=A0 =C2=A0 =C2=A0fprintf(stream,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;%s: Xen microcode=
 updating tool\n&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;Usage: %s [option=
s | microcode-file]\n&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;options:\n&quot;<=
br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;=C2=A0 -h, --help=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0display this help\n&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;=C2=A0 -s, --show=
-cpu-info=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 show CPU informat=
ion\n&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;=C2=A0 -f, --forc=
e &lt;microcode-file&gt;=C2=A0 =C2=A0 =C2=A0skip certain checks; do not<br>
&gt; \n&quot;<br>
<br>
If I recall correctly, &quot;--force&quot; doesn&#39;t take any argument, s=
o this<br>
usage is misleading. One could be tempted to execute `./xen-ucode<br>
-fmicrocode` or event `./xen-ucode --force -microcode` and expect it to<br>
work with files &quot;microcode&quot; or &quot;-microcode&quot; but instead=
 I think getopt()<br>
is just going to return an error.<br>
<br>
Instead of writing &quot;--force &lt;microcode-file&gt;&quot;, could you ch=
ange the help<br>
text, with something like &quot;skip certain checks when applying microcode=
&quot;?<br></blockquote><div><br></div><div>Sure, can be done in v7:</div><=
div><br></div><div style=3D"color:rgb(204,204,204);background-color:rgb(31,=
31,31);font-family:Consolas,&quot;Courier New&quot;,monospace;font-size:14p=
x;line-height:19px;white-space:pre"><div><span style=3D"color:rgb(86,156,21=
4)">static</span> <span style=3D"color:rgb(86,156,214)">void</span> <span s=
tyle=3D"color:rgb(220,220,170)">usage</span>(FILE <span style=3D"color:rgb(=
212,212,212)">*</span><span style=3D"color:rgb(156,220,254)">stream</span>,=
 <span style=3D"color:rgb(86,156,214)">const</span> <span style=3D"color:rg=
b(86,156,214)">char</span> <span style=3D"color:rgb(212,212,212)">*</span><=
span style=3D"color:rgb(156,220,254)">name</span>)</div><div>{</div><div>=
=C2=A0 =C2=A0 <span style=3D"color:rgb(220,220,170)">fprintf</span>(stream,=
</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span style=3D"color:r=
gb(206,145,120)">&quot;</span><span style=3D"color:rgb(156,220,254)">%s</sp=
an><span style=3D"color:rgb(206,145,120)">: Xen microcode updating tool</sp=
an><span style=3D"color:rgb(215,186,125)">\n</span><span style=3D"color:rgb=
(206,145,120)">&quot;</span></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 <span style=3D"color:rgb(206,145,120)">&quot;Usage: </span><span sty=
le=3D"color:rgb(156,220,254)">%s</span><span style=3D"color:rgb(206,145,120=
)"> [options | microcode-file]</span><span style=3D"color:rgb(215,186,125)"=
>\n</span><span style=3D"color:rgb(206,145,120)">&quot;</span></div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span style=3D"color:rgb(206,145,=
120)">&quot;options:</span><span style=3D"color:rgb(215,186,125)">\n</span>=
<span style=3D"color:rgb(206,145,120)">&quot;</span></div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span style=3D"color:rgb(206,145,120)">&quo=
t; =C2=A0-h, --help =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 displa=
y this help</span><span style=3D"color:rgb(215,186,125)">\n</span><span sty=
le=3D"color:rgb(206,145,120)">&quot;</span></div><div>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 <span style=3D"color:rgb(206,145,120)">&quot; =C2=A0-s=
, --show-cpu-info =C2=A0 =C2=A0 =C2=A0show CPU information</span><span styl=
e=3D"color:rgb(215,186,125)">\n</span><span style=3D"color:rgb(206,145,120)=
">&quot;</span>,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span =
style=3D"color:rgb(206,145,120)">&quot; =C2=A0-f, --force =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0skip certain checks when applying</span><spa=
n style=3D"color:rgb(215,186,125)">\n</span><span style=3D"color:rgb(206,14=
5,120)">&quot;</span></div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <=
span style=3D"color:rgb(206,145,120)">&quot; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 microcode; d=
o not use unless you know</span><span style=3D"color:rgb(215,186,125)">\n</=
span><span style=3D"color:rgb(206,145,120)">&quot;</span></div><div>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 <span style=3D"color:rgb(206,145,120)">&=
quot; =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 exactly what you are doing</span><span style=3D"color=
:rgb(215,186,125)">\n</span><span style=3D"color:rgb(206,145,120)">&quot;</=
span>,</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 name, name);</di=
v><div>=C2=A0 =C2=A0 <span style=3D"color:rgb(220,220,170)">show_curr_cpu</=
span>(stream);</div></div><div><span style=3D"background-color:rgb(31,31,31=
);color:rgb(204,204,204);font-family:Consolas,&quot;Courier New&quot;,monos=
pace;font-size:14px;white-space:pre">}</span>=C2=A0</div><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex">
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0use unless you know exactly<br>
&gt; \n&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0what you are doing\n&quot;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0name, name);<br>
&gt;=C2=A0 =C2=A0 =C2=A0show_curr_cpu(stream);<br>
<br>
Cheers,<br>
<br>
-- <br>
<br>
Anthony Perard | Vates XCP-ng Developer<br>
<br>
XCP-ng &amp; Xen Orchestra - Vates solutions<br>
<br>
web: <a href=3D"https://vates.tech" rel=3D"noreferrer" target=3D"_blank">ht=
tps://vates.tech</a></blockquote><div><br></div><div>Thanks,</div><div><br>=
</div><div>Fouad=C2=A0</div></div></div>

--000000000000a41e6b0620408694--


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 07:23:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 07:23:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781582.1191078 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh29q-00019C-8L; Thu, 22 Aug 2024 07:22:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781582.1191078; Thu, 22 Aug 2024 07:22:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh29q-000195-5L; Thu, 22 Aug 2024 07:22:58 +0000
Received: by outflank-mailman (input) for mailman id 781582;
 Thu, 22 Aug 2024 07:22: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=m19V=PV=cloud.com=fouad.hilly@srs-se1.protection.inumbo.net>)
 id 1sh29p-00018p-JD
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 07:22:57 +0000
Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com
 [2a00:1450:4864:20::234])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5a51a4e1-6057-11ef-a50a-bb4a2ccca743;
 Thu, 22 Aug 2024 09:22:56 +0200 (CEST)
Received: by mail-lj1-x234.google.com with SMTP id
 38308e7fff4ca-2f3ce5bc7d2so4504741fa.0
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 00:22:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5a51a4e1-6057-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724311376; x=1724916176; 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=XQOp5hF11YdDpd5Az2ZdoDZpQ8hEqedUkefTlMm/ERs=;
        b=b9vw5qejKC11lw8pY+pxa5f3nhB3D8/lZrk6jhkv0SloVf4NrNNfDNiptHiFr+3jzZ
         Eq8ALo2TzdrmaVgy0nxWz48111iC7D+8Mc7R2+QIxvUDxTwJlWQ9PEHzU03DsMhCz1v/
         uxIFFZM2fR8ATcOV7E2d/ZjVbBI8ULIBBJRx4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724311376; x=1724916176;
        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=XQOp5hF11YdDpd5Az2ZdoDZpQ8hEqedUkefTlMm/ERs=;
        b=paff5fnODKLBqNpFQOB0X5LLy1vdbpHzlzE2AST0dec5nyEGqPuq6uTcuJXq+ndwz9
         8K6wbPOJUCUP5UzG6iuLOzc8t/LdMppfib/k8fXWMLJv7yH/bOJ6ShgG59vnQLuGh7gD
         4LXuwkEuiFZWBhspIpndL0kGSxGIVN0swmfj0TED+kQ49B+UyJtuW0FEiIhuOyNKZndG
         U2E2PqBojEd32QW6ngwuULSj2Bku77kI/ua5qcso/xOl8tkoYLPe5FSB9dbyxvS1YvQP
         UHJC1DzGzaKjQxSca67LvJ27OMGuVXzoXE98Uyb9VimyZ7E3GQPUstdgxZAtMd8iUvsQ
         HSYw==
X-Forwarded-Encrypted: i=1; AJvYcCUY6CELpM8xkSXLByEMMUtFLO/jjFbWoEpmLgYzXW08xYZJkEfZ8PU/nPdCCgoA7W1TIY6i4D66uHY=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzm4sqgzS9kokmmBxMKyYSs5gMyu+R/H6UQ1nbM/pNoqG7LUMHL
	J0ja78jvjfXlYM8qZH3o0ul6lawA1jVTDF+2OwCJWoIsxViEvRVa9L8KiExnNQIBD2qX/QEzHTu
	XP3wo63Cu4vs80ouplP68kUkAiqf9lik3fuFwSaZj4Yf+gmk/
X-Google-Smtp-Source: AGHT+IFui6WY5E3Idghflkp51tgdltzD7wCTo1QJJ1ylt4UzdSx5pQa8bboUbHIwgrV0I9G7M0HOhXeVdU/cpO1u0eU=
X-Received: by 2002:a2e:bea0:0:b0:2ef:295b:4946 with SMTP id
 38308e7fff4ca-2f405c83db7mr5742091fa.4.1724311375464; Thu, 22 Aug 2024
 00:22:55 -0700 (PDT)
MIME-Version: 1.0
References: <20240725082725.2685481-1-fouad.hilly@cloud.com>
 <20240725082725.2685481-5-fouad.hilly@cloud.com> <f0925d77-db8d-410c-873f-0bf38727aca9@suse.com>
 <CAJKAvHY1CiXM+S1TNLrasPFZZPrdZo5QsJvhxCbptJFPyBqtqA@mail.gmail.com> <0f17e8ff-caef-4494-8478-c8203992c1df@suse.com>
In-Reply-To: <0f17e8ff-caef-4494-8478-c8203992c1df@suse.com>
From: Fouad Hilly <fouad.hilly@cloud.com>
Date: Thu, 22 Aug 2024 08:22:43 +0100
Message-ID: <CAJKAvHaWOewWLAb9K+Fc=rk=mDvT22G8wUOV5wHmtbv7fJxmhg@mail.gmail.com>
Subject: Re: [PATCH v6 4/4] x86/ucode: Utilize ucode_force and remove opt_ucode_allow_same
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, 
	Stefano Stabellini <sstabellini@kernel.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="00000000000004704d062040874a"

--00000000000004704d062040874a
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 19, 2024 at 10:22=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wr=
ote:

> On 19.08.2024 10:57, Fouad Hilly wrote:
> > On Mon, Jul 29, 2024 at 12:30=E2=80=AFPM Jan Beulich <jbeulich@suse.com=
> wrote:
> >> On 25.07.2024 10:27, Fouad Hilly wrote:
> >>> --- a/xen/arch/x86/cpu/microcode/core.c
> >>> +++ b/xen/arch/x86/cpu/microcode/core.c
> >>> @@ -90,6 +90,11 @@ struct ucode_mod_blob {
> >>>      size_t size;
> >>>  };
> >>>
> >>> +struct patch_with_flags {
> >>> +    unsigned int flags;
> >>> +    struct microcode_patch *patch;
> >>
> >> Pointer-to-const? If the const was omitted here just because of
> >> microcode_free_patch(), then I think the issue should be taken care
> >> of there.
> >
> > This struct is required as is, I initially added a similar struct with
> > const (which was removed in v6).
> > updated control_thread_fn()
> > -static int control_thread_fn(const struct microcode_patch *patch)
> > +static int control_thread_fn(struct microcode_patch *patch,
> > +                             unsigned int flags)
>
> And why's that change necessary, other than to cater for the omitted cons=
t
> in the struct?
>

I see your point, I will keep const and update microcode_free_patch() as
needed in v7.

>
> Jan
>


Thanks,

Fouad

--00000000000004704d062040874a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Mon, Aug 19, 2024 at 10:22=E2=80=
=AFAM Jan Beulich &lt;<a href=3D"mailto:jbeulich@suse.com" target=3D"_blank=
">jbeulich@suse.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quot=
e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)=
;padding-left:1ex">On 19.08.2024 10:57, Fouad Hilly wrote:<br>
&gt; On Mon, Jul 29, 2024 at 12:30=E2=80=AFPM Jan Beulich &lt;<a href=3D"ma=
ilto:jbeulich@suse.com" target=3D"_blank">jbeulich@suse.com</a>&gt; wrote:<=
br>
&gt;&gt; On 25.07.2024 10:27, Fouad Hilly wrote:<br>
&gt;&gt;&gt; --- a/xen/arch/x86/cpu/microcode/core.c<br>
&gt;&gt;&gt; +++ b/xen/arch/x86/cpu/microcode/core.c<br>
&gt;&gt;&gt; @@ -90,6 +90,11 @@ struct ucode_mod_blob {<br>
&gt;&gt;&gt;=C2=A0 =C2=A0 =C2=A0 size_t size;<br>
&gt;&gt;&gt;=C2=A0 };<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; +struct patch_with_flags {<br>
&gt;&gt;&gt; +=C2=A0 =C2=A0 unsigned int flags;<br>
&gt;&gt;&gt; +=C2=A0 =C2=A0 struct microcode_patch *patch;<br>
&gt;&gt;<br>
&gt;&gt; Pointer-to-const? If the const was omitted here just because of<br=
>
&gt;&gt; microcode_free_patch(), then I think the issue should be taken car=
e<br>
&gt;&gt; of there.<br>
&gt; <br>
&gt; This struct is required as is, I initially added a similar struct with=
<br>
&gt; const (which was removed in v6).<br>
&gt; updated control_thread_fn()<br>
&gt; -static int control_thread_fn(const struct microcode_patch *patch)<br>
&gt; +static int control_thread_fn(struct microcode_patch *patch,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unsigned int flags)<br>
<br>
And why&#39;s that change necessary, other than to cater for the omitted co=
nst<br>
in the struct?<br></blockquote><div><br></div><div>I see your point, I will=
 keep const and update microcode_free_patch() as needed in v7.</div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1p=
x solid rgb(204,204,204);padding-left:1ex">
<br>
Jan<br></blockquote><div><br></div><div><br></div><div>Thanks,</div><div><b=
r></div><div>Fouad=C2=A0</div></div></div>

--00000000000004704d062040874a--


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 07:29:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 07:29:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781599.1191088 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh2GA-0002lI-UE; Thu, 22 Aug 2024 07:29:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781599.1191088; Thu, 22 Aug 2024 07:29:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh2GA-0002lB-QD; Thu, 22 Aug 2024 07:29:30 +0000
Received: by outflank-mailman (input) for mailman id 781599;
 Thu, 22 Aug 2024 07:29:30 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sh2GA-0002l1-AI; Thu, 22 Aug 2024 07:29:30 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sh2GA-0006cI-2S; Thu, 22 Aug 2024 07:29:30 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sh2G9-0006tr-Ic; Thu, 22 Aug 2024 07:29:29 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sh2G9-00079F-Hn; Thu, 22 Aug 2024 07:29:29 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=TXPeps6WV5Tu8kp0uGyuu+2u3AQyo/ufjB8kxEBbgnM=; b=yQUQK3rIo7NIDLjx4SpWBtnpMm
	bc1pe+O3cukSf4W15WtnEFJXYCrWba8J96N5qN6s4g3W8oivWP/o2Go5tluO/Mq53kIL34qIEDNUF
	8N3XMmZzoC4EzrfVwIJ2WtEm9S/e529A9KDjTwW/jBjkhbW+jyin49wvxzt73ywBcwCI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187305-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187305: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-libvirt-vhd:leak-check/check:fail:regression
    qemu-mainline:test-amd64-amd64-xl-shadow:guest-localmigrate/x10:fail:heisenbug
    qemu-mainline:test-armhf-armhf-xl-multivcpu:xen-boot:fail:heisenbug
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=3472f54522a928f0020d6928d54c007f862c5478
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 22 Aug 2024 07:29:29 +0000

flight 187305 qemu-mainline real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187305/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707
 test-amd64-amd64-libvirt-vhd 22 leak-check/check         fail REGR. vs. 182707

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-shadow 20 guest-localmigrate/x10 fail in 187300 pass in 187305
 test-armhf-armhf-xl-multivcpu  8 xen-boot                  fail pass in 187300

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check fail in 187300 never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check fail in 187300 never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass

version targeted for testing:
 qemuu                3472f54522a928f0020d6928d54c007f862c5478
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  350 days
Failing since        182723  2023-09-07 18:19:05 Z  349 days   28 attempts
Testing same since   187300  2024-08-21 07:08:57 Z    1 days    2 attempts

------------------------------------------------------------
620 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                fail    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 180812 lines long.)


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 09:01:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 09:01:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781611.1191098 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh3gl-0001nA-A6; Thu, 22 Aug 2024 09:01:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781611.1191098; Thu, 22 Aug 2024 09:01:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh3gl-0001n3-5v; Thu, 22 Aug 2024 09:01:03 +0000
Received: by outflank-mailman (input) for mailman id 781611;
 Thu, 22 Aug 2024 09:01:02 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=uUbg=PV=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sh3gk-0001ms-3Y
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 09:01:02 +0000
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on20624.outbound.protection.outlook.com
 [2a01:111:f400:7e88::624])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0b2fdb79-6065-11ef-8776-851b0ebba9a2;
 Thu, 22 Aug 2024 11:00:58 +0200 (CEST)
Received: from BYAPR01CA0070.prod.exchangelabs.com (2603:10b6:a03:94::47) by
 SA1PR12MB6993.namprd12.prod.outlook.com (2603:10b6:806:24c::22) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Thu, 22 Aug
 2024 09:00:48 +0000
Received: from SJ5PEPF000001C9.namprd05.prod.outlook.com
 (2603:10b6:a03:94:cafe::a9) by BYAPR01CA0070.outlook.office365.com
 (2603:10b6:a03:94::47) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19 via Frontend
 Transport; Thu, 22 Aug 2024 09:00:48 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SJ5PEPF000001C9.mail.protection.outlook.com (10.167.242.37) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Thu, 22 Aug 2024 09:00:47 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 22 Aug
 2024 04:00:47 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Thu, 22 Aug 2024 04:00:46 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0b2fdb79-6065-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=A2X7GI5LvyHO1hgMSOh+I4d71+HMdiOzoIWEQrayHrEC1ahQIlZFYWN4g05LNT5oRcFMge3WdEF+hK2Ou+/3rmXpWt+LUnFyccNx2CfGfhvsd4Hc1xr7QnnFUBFKsCPKNNWr5eBEmcXXAOQqWh7QV1cXdkk2onqiz+FyW5GoUV0aljMwH8a0XjEl4/ttDh+xep6etLxNqJWfMtk8AwEN/idtlpZel1UFkg+Z81YUWba/VLY7ABL1gkf0eiwVXA6ToxA6ugh1ObBoKr14oxss+1xeAYVPtUc7Ny2F0tVqPlylxMp4OqoYd94q3Ckdu8KZhxorRY6YgHV03QU+E2/Fzw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=CXGyVAFUgv7B/6g+hZeR9hLS8a3VENRWOrTauzgDXcg=;
 b=MQD7tXNDBOAcgeqs/LWcc35KnfVmUBVM6yYp9zpr6F1a33+YZI/QcYAYfL7UN2ILcqzUhIBbUj4F1WvYIhGNhH0OEFj86mf8wF5agOhhWi92zDJXFcGNWrWU/T7dxw6x1En3fB074SdJP7hJ8k9ItnlB3IuCB7TrSxv7gOAh8vHk7xn5uhKE88HAp05h2I7C526XY+1N3xEZtSTC2shE0HqrV6RXmVk9EjINRSD+jQ0QWI/GlDmDbT1Co15iYM8qccxFhTj6oT1exA7Y/qnIPDlH6VNLkGTVhEUI0q0fasAkCqPRLs5IkRmtyxzTm40Sho207qru582mBQkh/8nVDQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=arm.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=CXGyVAFUgv7B/6g+hZeR9hLS8a3VENRWOrTauzgDXcg=;
 b=cz3WjnU151MA0fwq/XSWh2jsQ3NA4JU3Ua7vIHrgmGASCYnZqw6ySgQC8qytl4hvk2TvsD+k42BLyxKOEO1/517q62IgqNt4Ug8tDx17AIMVzziikqKgCjlV98BlRgMKPDsumpv6KIrnSDQDiYMJLxmTtTbMqsvFYvJ+5EsUwuU=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <101a7105-5638-4c69-a5b0-29c252284aea@amd.com>
Date: Thu, 22 Aug 2024 11:00:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] docs: fusa: Add requirements for generic timer
To: Bertrand Marquis <Bertrand.Marquis@arm.com>, Ayan Kumar Halder
	<ayan.kumar.halder@amd.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Artem Mygaiev <artem_mygaiev@epam.com>
References: <20240820103816.1661102-1-ayan.kumar.halder@amd.com>
 <5F0AF572-3437-4372-96EB-42F46B3A3155@arm.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <5F0AF572-3437-4372-96EB-42F46B3A3155@arm.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB04.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001C9:EE_|SA1PR12MB6993:EE_
X-MS-Office365-Filtering-Correlation-Id: 45405fc2-05da-42ce-1de6-08dcc288ea3c
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?SzFBZU9wbGxMOGRmbEhoT2pLa0hHM3ZKd0R3NUVmMjNLd1E3Qm11b3luanFa?=
 =?utf-8?B?VnVlWXhUOTJWRXhodkwxeUdMb1NmRkRGVkZRNzFJb3VhVGovL3lNNkQ3SXRR?=
 =?utf-8?B?NDcxZWZUS0V2YWo2bFJoTlF2N2dKekNZL1F3QUFvZ3VSSXlhWHNoOUxEM1Vz?=
 =?utf-8?B?Z2IwYTk0djJzM013L2lJMmp3N0ZUZ25uejhabmtReDdkYklRTVJJNGtsWWNr?=
 =?utf-8?B?L1pxSEp0bkZzM0UxRU9tblBFeXo4Rjl0dmhxcmVmcDFxZmJkeWx5VWVMa05u?=
 =?utf-8?B?VFRFa3lHbTU5cXpVaUFuV3hBWUZUOE4ySWZCbnhRVVYwM2N6TFBLU0NtMGc3?=
 =?utf-8?B?Qnd5OHJhNzhxa21OTHhyblRzcS9pSFpYT0V5c2tZV2Evd1BqU1N3OVlVYm50?=
 =?utf-8?B?SDA4c2NTSWpveUdTUXhHZVBTQXhCWUZLaGQxeTdOQis0c2xLTm5uL0lRUnY5?=
 =?utf-8?B?UGRZcGZLY2VDYzJ5c2dSQnVnVjl3TGtuYzlaWWhjSEp6L2s5SU9YTExsRTgv?=
 =?utf-8?B?bkl3UkMxNGtjZ0ZlS0dCVjhheG9BRFVQdXM5VFlHWGd3eVpGNjlTTEMxM29x?=
 =?utf-8?B?UFhRSy9VWCs5RmZFVk94YkFhMUJHb2E0QjVBV2FUamVhZDVNTS95QnNiaE02?=
 =?utf-8?B?WEJlS1RHdGxiVTMvREdBQUtQTnlXVTNuTk8zM1NsTVdFT3RySjBYTmVVWXFa?=
 =?utf-8?B?bDR3d0ltMnpoOUxXY0gzVlJoUzNsREF3ZGJudU15Uk8vN2lOSWJYQldNbGE0?=
 =?utf-8?B?V2FYYVg5VFMxVWxpZld0UkliWEJRMTlLT2RYTmZVbmVrcVB2WkROSGY3d284?=
 =?utf-8?B?emJsTjdTRHozU05zeDRZdkQ3VjVCeG9FUm9laUcwVGdDcFJlU3hsQldhTXJx?=
 =?utf-8?B?aE02cHczdnA3OEN4eDlodXFzaUxyQjhBYUVpUmNKOFE5Z0dOUmEvU0Zja1g5?=
 =?utf-8?B?VldQcGo1RUI0YTBNNko4R0NtRUxCMlZHY0FqcmxPVitqZEROL09KT3kvVE0z?=
 =?utf-8?B?dGNqd0p4elpjeGdQOW92UUNCUHorZ3RnWTVyZW10K3NrWnE2S2xia1lJVlJa?=
 =?utf-8?B?V2t2U3c4RDNvVEJWSEJnRFhYRWVTYmNmYmxSMEZ3eUl4MGovbTVLazkrZ1dY?=
 =?utf-8?B?bFVqaFhocFJGeTBDdVpSUmtYQVFTNTAvZTQvTW1iZER4Nm5hVEZXNjcvRC92?=
 =?utf-8?B?TGl4dThzblZJM0JFcTJ3d3drRDgzdFVsZ1FEa2djZVNJbUtxNHJKQnpmMUJ0?=
 =?utf-8?B?SUMrQTY4ekhPV0pvUEtkWXF2QzdJUW9ORnRCbEJyOC9VcHp2cG1ITmVNUTlT?=
 =?utf-8?B?dXByby9NbDVRT2NrTjc0MG1qdHNhcnNRSUlpK3ZUaFpidXB6MEM2LzRrdllm?=
 =?utf-8?B?UzNYQStGc1VpUit0SVV1WGRLTytIeXNtRkV4NkM5UjN6TW0zR2M2NUZZM0RU?=
 =?utf-8?B?TnByQWpXR1ZpYzV2dFY0UmdQYjFxTFdUM3BoTE5MOG8ydFVqSENuSVVaVzlS?=
 =?utf-8?B?M0NFa0ZSZDBudzh2dTUwZlVzb0g3UG55WWk1Y2lzT0lub0s3U1JLUzc4aktj?=
 =?utf-8?B?QWFKVklkNEdRRU9OYy80SERnZTFDLzdncUhiejg4U3BUUkhMNy9LNTlVMU9T?=
 =?utf-8?B?RUQ4K2ErdHZlYmRROCtQclJ4eUVqM1NTM3R2dWhPUWpUVmJxQ1FDVFltR3Rr?=
 =?utf-8?B?UTNRT21XS3F0TEx3cVZWZVYxMFJITDJIaGlxQW4ybEI5d2JVa3lGU1lESXU3?=
 =?utf-8?B?TDBOalVmWXhGOENxVTRQWitGaUxXUmloK2tlNzVPTS9pMm9hTUV5OUxhN05K?=
 =?utf-8?B?NFE1V2d2Sk1KVG1wTitNRnZxVXJ5MDExaW1IdTUxMHZFd3ViTnFJZkhveUQy?=
 =?utf-8?B?eWt0VkRWMFVtcXdYME1lNUV1cklOZjlwaysydVV2dGpiWm1tMXJPRlhCTGVL?=
 =?utf-8?Q?zRoXHYlPFGI4xJUq9O98DGOJnMJs9geE?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 09:00:47.9354
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 45405fc2-05da-42ce-1de6-08dcc288ea3c
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF000001C9.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6993

Hi Bertrand,

I agree with all your comments with a few exceptions, as stated below.

On 21/08/2024 17:06, Bertrand Marquis wrote:
> 
> 
> Hi Ayan,
> 
>> On 20 Aug 2024, at 12:38, Ayan Kumar Halder <ayan.kumar.halder@amd.com> wrote:
>>
>> From: Michal Orzel <michal.orzel@amd.com>
>>
>> Add the requirements for the use of generic timer by a domain
>>
>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>> ---
>> .../reqs/design-reqs/arm64/generic-timer.rst  | 139 ++++++++++++++++++
>> docs/fusa/reqs/index.rst                      |   3 +
>> docs/fusa/reqs/intro.rst                      |   3 +-
>> docs/fusa/reqs/market-reqs/reqs.rst           |  34 +++++
>> docs/fusa/reqs/product-reqs/arm64/reqs.rst    |  24 +++
>> 5 files changed, 202 insertions(+), 1 deletion(-)
>> create mode 100644 docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
>> create mode 100644 docs/fusa/reqs/market-reqs/reqs.rst
>> create mode 100644 docs/fusa/reqs/product-reqs/arm64/reqs.rst
>>
>> diff --git a/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
>> new file mode 100644
>> index 0000000000..bdd4fbf696
>> --- /dev/null
>> +++ b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
>> @@ -0,0 +1,139 @@
>> +.. SPDX-License-Identifier: CC-BY-4.0
>> +
>> +Generic Timer
>> +=============
>> +
>> +The following are the requirements related to ARM Generic Timer [1] interface
>> +exposed by Xen to Arm64 domains.
>> +
>> +Probe the Generic Timer device tree node from a domain
>> +------------------------------------------------------
>> +
>> +`XenSwdgn~arm64_generic_timer_probe_dt~1`
>> +
>> +Description:
>> +Xen shall generate a device tree node for the Generic Timer (in accordance to
>> +ARM architected timer device tree binding [2]).
> 
> You might want to say where here. The domain device tree ?
> 
>> +
>> +Rationale:
>> +
>> +Comments:
>> +Domains shall probe the Generic Timer device tree node.
> 
> Please prevent the use of "shall" here. I would use "can".
> Also detect the presence of might be better than probe.
> 
>> +
>> +Covers:
>> + - `XenProd~emulated_timer~1`
>> +
>> +Read system counter frequency
>> +-----------------------------
>> +
>> +`XenSwdgn~arm64_generic_timer_read_freq~1`
>> +
>> +Description:
>> +Xen shall expose the frequency of the system counter to the domains.
> 
> The requirement would need to say in CNTFRQ_EL0 and in the domain device tree xxx entry.
> 
>> +
>> +Rationale:
>> +
>> +Comments:
>> +Domains shall read it via CNTFRQ_EL0 register or "clock-frequency" device tree
>> +property.
> 
> I do not think this comment is needed.
> 
>> +
>> +Covers:
>> + - `XenProd~emulated_timer~1`
>> +
>> +Access CNTKCTL_EL1 system register from a domain
>> +------------------------------------------------
>> +
>> +`XenSwdgn~arm64_generic_timer_access_cntkctlel1~1`
>> +
>> +Description:
>> +Xen shall expose counter-timer kernel control register to the domains.
> 
> "counter-timer kernel" is a bit odd here, is it the name from arm arm ?
> Generic Timer control registers ? or directly the register name.
This is the name from Arm ARM. See e.g.:
https://developer.arm.com/documentation/ddi0601/2023-12/AArch64-Registers/CNTKCTL-EL1--Counter-timer-Kernel-Control-Register?lang=en

> 
>> +
>> +Rationale:
>> +
>> +Comments:
>> +Domains shall access the counter-timer kernel control register to allow
>> +controlling the access to the timer from userspace (EL0).
> 
> This is documented in the arm arm, this comment is not needed.
> 
>> +
>> +Covers:
>> + - `XenProd~emulated_timer~1`
>> +
>> +Access virtual timer from a domain
>> +----------------------------------
>> +
>> +`XenSwdgn~arm64_generic_timer_access_virtual_timer~1`
>> +
>> +Description:
>> +Xen shall expose the virtual timer registers to the domains.
>> +
>> +Rationale:
>> +
>> +Comments:
>> +Domains shall access and make use of the virtual timer by accessing the
>> +following system registers:
>> +CNTVCT_EL0,
>> +CNTV_CTL_EL0,
>> +CNTV_CVAL_EL0,
>> +CNTV_TVAL_EL0.
> 
> The requirement to be complete should give this list, not the comment.
> 
>> +
>> +Covers:
>> + - `XenProd~emulated_timer~1`
>> +
>> +Access physical timer from a domain
>> +-----------------------------------
>> +
>> +`XenSwdgn~arm64_generic_timer_access_physical_timer~1`
>> +
>> +Description:
>> +Xen shall expose physical timer registers to the domains.
>> +
>> +Rationale:
>> +
>> +Comments:
>> +Domains shall access and make use of the physical timer by accessing the
>> +following system registers:
>> +CNTPCT_EL0,
>> +CNTP_CTL_EL0,
>> +CNTP_CVAL_EL0,
>> +CNTP_TVAL_EL0.
> 
> same as upper
> 
>> +
>> +Covers:
>> + - `XenProd~emulated_timer~1`
>> +
>> +Trigger the virtual timer interrupt from a domain
>> +-------------------------------------------------
>> +
>> +`XenSwdgn~arm64_generic_timer_trigger_virtual_interrupt~1`
>> +
>> +Description:
>> +Xen shall enable the domains to program the virtual timer to generate the
>> +interrupt.
> 
> I am not sure this is right here.
> You gave access to the registers upper so Xen responsibility is not really to
> enable anything but rather make sure that it generates an interrupt according to
> how the registers have been programmed.
I'm in two minds about it. On one hand you're right and the IRQ trigger is a side-effect
of programming the registers correctly. On the other, these are design requirements which
according to "fusa/reqs/intro.rst" describe what SW implementation is doing. Our way of injecting
timer IRQs into guests is a bit different (phys timer is fully emulated and we use internal timers
and for virt timer we first route IRQ to Xen, mask the IRQ and inject to guest). If I were to write
tests to cover Generic Timer requirements I'd expect to cover whether r.g. masking/unmasking IRQ works,
whether IRQ was received, etc.

I'd like to know other opinions. @Stefano, @Artem

~Michal




From xen-devel-bounces@lists.xenproject.org Thu Aug 22 09:07:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 09:07:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781629.1191135 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh3nL-0003T0-I3; Thu, 22 Aug 2024 09:07:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781629.1191135; Thu, 22 Aug 2024 09:07:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh3nL-0003RG-8t; Thu, 22 Aug 2024 09:07:51 +0000
Received: by outflank-mailman (input) for mailman id 781629;
 Thu, 22 Aug 2024 09:06:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=A8+D=PV=cloud.com=andrii.sultanov@srs-se1.protection.inumbo.net>)
 id 1sh3mI-0002Rz-46
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 09:06:46 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id db150d48-6065-11ef-a50a-bb4a2ccca743;
 Thu, 22 Aug 2024 11:06:45 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-a8682bb5e79so84090066b.2
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 02:06:45 -0700 (PDT)
Received: from EMEAENGAAD87503.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f2e6717sm88948266b.96.2024.08.22.02.06.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 02:06:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: db150d48-6065-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724317605; x=1724922405; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=zC1kK8nz8HkQxKR7SEj5x2jWrRcksrvnhTGjt2Y7Jm0=;
        b=Ct8oVTsOgGyNIzbVsr2+HYumQqPbQG7YupRH6TU4GykhlcWy1aiHBNPGZ4RBMSZM9q
         YrQSpfvagb5mj+wSlcUOOTW7OghmW6rZQpirl2IG21qU+72fmKSLQzsLS+phhCsnCABB
         12s8W7a1tWjmmgPWEU260xNjIZu0U6J1iYSEI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724317605; x=1724922405;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=zC1kK8nz8HkQxKR7SEj5x2jWrRcksrvnhTGjt2Y7Jm0=;
        b=uYWEiP1pnk8a0SLqGY6rwyQxFXfDqwU4DhkGG4Voa6Wo18Tlcx+L3LRDHcfnHU/jrK
         RRGuKeZJ3THZZ1/Kz2vOJUJULm5mZ0E+7U7dxTUG9lT1KH2LV+NP1wBCuM1tv9m+o7lc
         W3l//XOe2qjtyk8+y6/SWLddmAom9EQSz5KTnawub6/QyIgZm/Mk76BU2+WkXKkCfYTT
         dX2ertkcUbcPa0mV52j9KEbIedrzrL1TfG5RxGiGZ0Lh7quz6/41FenM+L0nOkkMTBIg
         1RfuX4PjbKwV41ilHg7bNLys4dd+gS2kM44S0e2/HF0GtVaIyO856QNjfiexw/VQIRFv
         STVQ==
X-Gm-Message-State: AOJu0YxTR+RtQrlqMymeZ/CvL374Sc8aktJGXlWC2ud6TprdD9+FiFNn
	9YEJucM+h1SyDURyKb8qDjGxssIhQJg3LAEwVZICmB+Ovy9HmMpfsvvwBoFURN8GNB6lpc4IrL8
	p
X-Google-Smtp-Source: AGHT+IElPbcnHvnSCRtgGX92MGchEdfdBCL53x2SJ5xhZmDJgNNrDED3WbicO7q4ifC1QOYuvtSDVw==
X-Received: by 2002:a17:907:7f1f:b0:a86:89ea:ee6c with SMTP id a640c23a62f3a-a8689eaefe8mr191195266b.30.1724317604700;
        Thu, 22 Aug 2024 02:06:44 -0700 (PDT)
From: Andrii Sultanov <andrii.sultanov@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Andrii Sultanov <andrii.sultanov@cloud.com>,
	Christian Lindig <christian.lindig@citrix.com>,
	David Scott <dave@recoil.org>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH v1 4/4] Makefile.rules: Fix OCaml libs
Date: Thu, 22 Aug 2024 10:06:05 +0100
Message-Id: <9c9eac180468d1c4044048094956951bcc2edaa6.1724314239.git.andrii.sultanov@cloud.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <cover.1724314239.git.andrii.sultanov@cloud.com>
References: <cover.1724314239.git.andrii.sultanov@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This commit upstreams the pre-existing patch from
https://github.com/xenserver/xen.pg/blob/XS-8/patches/fix-ocaml-libs.patch

Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
---
 tools/ocaml/Makefile.rules | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/Makefile.rules b/tools/ocaml/Makefile.rules
index 0444e95f17..84f5ecafe7 100644
--- a/tools/ocaml/Makefile.rules
+++ b/tools/ocaml/Makefile.rules
@@ -62,18 +62,18 @@ mk-caml-lib-bytecode = $(call quiet-command, $(OCAMLC) $(OCAMLCFLAGS) -a -o $1 $
 
 mk-caml-stubs = $(call quiet-command, $(OCAMLMKLIB) -o `basename $1 .a` $2,MKLIB,$1)
 mk-caml-lib-stubs = \
-	$(call quiet-command, $(AR) rcs $1 $2 && $(OCAMLMKLIB) -o `basename $1 .a | sed -e 's/^lib//'` $2,MKLIB,$1)
+	$(call quiet-command, $(OCAMLMKLIB) -o `basename $1 .a | sed -e 's/^lib//'` $2 $3,MKLIB,$1)
 
 # define a library target <name>.cmxa and <name>.cma
 define OCAML_LIBRARY_template
  $(1).cmxa: lib$(1)_stubs.a $(foreach obj,$($(1)_OBJS),$(obj).cmx)
 	$(call mk-caml-lib-native,$$@, -cclib -l$(1)_stubs $(foreach lib,$(LIBS_$(1)),-cclib $(lib)), $(foreach obj,$($(1)_OBJS),$(obj).cmx))
  $(1).cma: $(foreach obj,$($(1)_OBJS),$(obj).cmo)
-	$(call mk-caml-lib-bytecode,$$@, -dllib dll$(1)_stubs.so -cclib -l$(1)_stubs, $$+)
+	$(call mk-caml-lib-bytecode,$$@, -dllib dll$(1)_stubs.so -cclib -l$(1)_stubs $(foreach lib,$(LIBS_$(1)),-cclib $(lib)), $$+)
  $(1)_stubs.a: $(foreach obj,$$($(1)_C_OBJS),$(obj).o)
 	$(call mk-caml-stubs,$$@, $$+)
  lib$(1)_stubs.a: $(foreach obj,$($(1)_C_OBJS),$(obj).o)
-	$(call mk-caml-lib-stubs,$$@, $$+)
+	$(call mk-caml-lib-stubs,$$@, $$+, $(foreach lib,$(LIBS_$(1)),$(lib)))
 endef
 
 # Dynamically linked OCaml libraries ("plugins" in Dynlink parlance)
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 09:07:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 09:07:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781625.1191119 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh3nK-0003EW-Qc; Thu, 22 Aug 2024 09:07:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781625.1191119; Thu, 22 Aug 2024 09:07:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh3nK-0003DN-MH; Thu, 22 Aug 2024 09:07:50 +0000
Received: by outflank-mailman (input) for mailman id 781625;
 Thu, 22 Aug 2024 09:06:42 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=A8+D=PV=cloud.com=andrii.sultanov@srs-se1.protection.inumbo.net>)
 id 1sh3mE-00031f-CF
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 09:06:42 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d7cfc6d4-6065-11ef-8776-851b0ebba9a2;
 Thu, 22 Aug 2024 11:06:40 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-5bed72ff2f2so827532a12.2
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 02:06:40 -0700 (PDT)
Received: from EMEAENGAAD87503.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f2e6717sm88948266b.96.2024.08.22.02.06.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 02:06:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d7cfc6d4-6065-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724317599; x=1724922399; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=kWxy1XT9RvB6ymqJ3xYxgfXq+O27Deowe7jItjsgCQc=;
        b=eLnXtIpUkVLwUNxrm0cC/CqdYM60hNNUFIIoPHx9QMVhFCkXWUuO2NBrLQptwd5z4W
         IbTGmhBLXC+2vBXaLjjGEU0Rkm43Mic5/TRuve/Q2ElN5WZvwPRXDt97FQZyQk16aKxs
         u2NevLxqzCOioFvIG2ogNpuAfz/2QUNN0HCvs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724317599; x=1724922399;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=kWxy1XT9RvB6ymqJ3xYxgfXq+O27Deowe7jItjsgCQc=;
        b=j+0HX7geah8CPiibGCmX8cfQrcTLv3AD1wD+Z1Euq0h7Z1rdROjCojPnmfHci6i56S
         r4BN4yO84wzG/ks2cO+ZvAozbksTSX8JGOgBNZA9nbX2A3aJ0tuYnJlyJ0iZOYo6YBZA
         3yEqexPdgz+jTYL4VeSFb7bLspAw7MCANedFQpMq7NQtAOwzBwjR5d721h4LADkHvJ5L
         cHcuEiNWvEghVmJaZGQG10LTRexbS8NxDpPVpmie2rVMLuM5jaWI+3UeMay+7dJSe8y2
         Yjt/w2tg5GglbEpXlBKz2tzqpav3CSUuxWnSRjhIpY2WHRYBfXiBa8gvdh/URGcDuuyt
         KeQA==
X-Gm-Message-State: AOJu0YzhR78irXWaQs/usbOQcgY4Kzcdu0RSVGYo3v382vZt1so3q/hs
	3busTI07OaRS5PpP+mcmgKngkGIjnz1Nr77AsBR98EhB2qU73qyMlmynxk/JzX7zcVtW0gGVQk3
	wjE0=
X-Google-Smtp-Source: AGHT+IFlLETmcRyIz7ND8jOO3vVUr1MX+pWtVnX6qPCrLgEg16gc99LhCVGWWK8MhMoKIvXaA6IawQ==
X-Received: by 2002:a17:907:9495:b0:a86:8368:860a with SMTP id a640c23a62f3a-a868368886dmr262561766b.35.1724317599189;
        Thu, 22 Aug 2024 02:06:39 -0700 (PDT)
From: Andrii Sultanov <andrii.sultanov@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Andrii Sultanov <andrii.sultanov@cloud.com>,
	Christian Lindig <christian.lindig@citrix.com>,
	David Scott <dave@recoil.org>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH v1 2/4] ocaml/libs: Implement a dynamically-loaded plugin for Xenctrl.domain_getinfo
Date: Thu, 22 Aug 2024 10:06:03 +0100
Message-Id: <6d4b94939c8910ffd7d70301b1d26c828f72ad86.1724314239.git.andrii.sultanov@cloud.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <cover.1724314239.git.andrii.sultanov@cloud.com>
References: <cover.1724314239.git.andrii.sultanov@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This plugin intends to hide the unstable Xenctrl interface under a
stable one. In case of the change in the interface, a V2 of this plugin
would need to be produced, but V1 with the old interface would
need to be kept (with potential change in the implementation) in the
meantime.

To reduce the need for such changes in the future, this plugin only
provides the absolute minimum functionality that Oxenstored uses - only
four fields of the domaininfo struct are used and presented here.

Oxenstored currently uses the single-domain domain_getinfo function,
whereas Cxenstored uses the more-efficient domain_getinfolist. Both of
these are provided in the plugin to allow a transition from one to the
other without modifying the interface in the future. Both return
identical structures and rely on the same fields in xenctrl, thus if one
of them breaks, both will break, and a new version of the interface would
need to be issued.

Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
---
 tools/ocaml/Makefile                          |   1 +
 tools/ocaml/Makefile.rules                    |  17 +-
 tools/ocaml/libs/Makefile                     |   2 +-
 tools/ocaml/libs/xenstoredglue/META.in        |   4 +
 tools/ocaml/libs/xenstoredglue/Makefile       |  39 ++++
 .../domain_getinfo_plugin_v1/META.in          |   5 +
 .../domain_getinfo_plugin_v1/Makefile         |  38 ++++
 .../domain_getinfo_stubs_v1.c                 | 169 ++++++++++++++++++
 .../domain_getinfo_v1.ml                      |  51 ++++++
 .../domain_getinfo_v1.mli                     |   0
 .../libs/xenstoredglue/plugin_interface_v1.ml |  25 +++
 .../xenstoredglue/plugin_interface_v1.mli     |  34 ++++
 12 files changed, 383 insertions(+), 2 deletions(-)
 create mode 100644 tools/ocaml/libs/xenstoredglue/META.in
 create mode 100644 tools/ocaml/libs/xenstoredglue/Makefile
 create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/META.in
 create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/Makefile
 create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c
 create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.ml
 create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.mli
 create mode 100644 tools/ocaml/libs/xenstoredglue/plugin_interface_v1.ml
 create mode 100644 tools/ocaml/libs/xenstoredglue/plugin_interface_v1.mli

diff --git a/tools/ocaml/Makefile b/tools/ocaml/Makefile
index 1557fd6c3c..eb426f2ee5 100644
--- a/tools/ocaml/Makefile
+++ b/tools/ocaml/Makefile
@@ -29,6 +29,7 @@ build-tools-oxenstored:
 	$(MAKE) -s -C libs/mmap
 	$(MAKE) -s -C libs/xb
 	$(MAKE) -s -C libs/xc
+	$(MAKE) -s -C libs/xenstoredglue
 	$(MAKE) -C xenstored
 
 .PHONY: format
diff --git a/tools/ocaml/Makefile.rules b/tools/ocaml/Makefile.rules
index 0d3c6ac839..0444e95f17 100644
--- a/tools/ocaml/Makefile.rules
+++ b/tools/ocaml/Makefile.rules
@@ -50,12 +50,13 @@ ifneq ($(MAKECMDGOALS),clean)
 endif
 
 clean: $(CLEAN_HOOKS)
-	$(Q)rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.annot *.spot *.spit $(LIBS) $(PROGRAMS) $(GENERATED_FILES) .ocamldep.make META
+	$(Q)rm -f .*.d *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa *.cmxs *.annot *.spot *.spit $(LIBS) $(PROGRAMS) $(GENERATED_FILES) .ocamldep.make META
 
 distclean: clean
 
 quiet-command = $(if $(V),$1,@printf " %-8s %s\n" "$2" "$3" && $1)
 
+mk-caml-shared-lib-native = $(call quiet-command, $(OCAMLOPT) $(OCAMLOPTFLAGS) -shared -linkall -o $1 $2 $3,MLA,$1)
 mk-caml-lib-native = $(call quiet-command, $(OCAMLOPT) $(OCAMLOPTFLAGS) -a -o $1 $2 $3,MLA,$1)
 mk-caml-lib-bytecode = $(call quiet-command, $(OCAMLC) $(OCAMLCFLAGS) -a -o $1 $2 $3,MLA,$1)
 
@@ -75,6 +76,19 @@ define OCAML_LIBRARY_template
 	$(call mk-caml-lib-stubs,$$@, $$+)
 endef
 
+# Dynamically linked OCaml libraries ("plugins" in Dynlink parlance)
+# need to compile an .cmxs file
+define OCAML_DYN_LIBRARY_template
+ $(1).cmxs: $(1).cmxa
+	$(call mk-caml-shared-lib-native,$$@, $(1).cmxa)
+ $(1).cmxa: lib$(1)_stubs.a $(foreach obj,$($(1)_OBJS),$(obj).cmx)
+	$(call mk-caml-lib-native,$$@, -cclib -l$(1)_stubs $(foreach lib,$(LIBS_$(1)),-cclib $(lib)), $(foreach obj,$($(1)_OBJS),$(obj).cmx))
+ $(1)_stubs.a: $(foreach obj,$$($(1)_C_OBJS),$(obj).o)
+	$(call mk-caml-stubs,$$@, $$+)
+ lib$(1)_stubs.a: $(foreach obj,$($(1)_C_OBJS),$(obj).o)
+	$(call mk-caml-lib-stubs,$$@, $$+)
+endef
+
 define OCAML_NOC_LIBRARY_template
  $(1).cmxa: $(foreach obj,$($(1)_OBJS),$(obj).cmx)
 	$(call mk-caml-lib-native,$$@, , $(foreach obj,$($(1)_OBJS),$(obj).cmx))
@@ -97,6 +111,7 @@ endef
 -include .ocamldep.make
 
 $(foreach lib,$(OCAML_LIBRARY),$(eval $(call OCAML_LIBRARY_template,$(lib))))
+$(foreach lib,$(OCAML_DYN_LIBRARY),$(eval $(call OCAML_DYN_LIBRARY_template,$(lib))))
 $(foreach lib,$(OCAML_NOC_LIBRARY),$(eval $(call OCAML_NOC_LIBRARY_template,$(lib))))
 $(foreach p,$(OCAML_PROGRAM),$(eval $(call OCAML_PROGRAM_template,$(p))))
 $(foreach p,$(C_PROGRAM),$(eval $(call C_PROGRAM_template,$(p))))
diff --git a/tools/ocaml/libs/Makefile b/tools/ocaml/libs/Makefile
index 89350aa12f..828fbf859d 100644
--- a/tools/ocaml/libs/Makefile
+++ b/tools/ocaml/libs/Makefile
@@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 SUBDIRS= \
 	mmap \
 	eventchn xc \
-	xb xs
+	xb xs xenstoredglue
 
 .PHONY: all
 all: subdirs-all
diff --git a/tools/ocaml/libs/xenstoredglue/META.in b/tools/ocaml/libs/xenstoredglue/META.in
new file mode 100644
index 0000000000..dbd584ac17
--- /dev/null
+++ b/tools/ocaml/libs/xenstoredglue/META.in
@@ -0,0 +1,4 @@
+version = "@VERSION@"
+description = "A small library on top of unstable Xenctrl interfaces used by Oxenstored"
+archive(byte) = "plugin_interface_v1.cma"
+archive(native) = "plugin_interface_v1.cmxa"
diff --git a/tools/ocaml/libs/xenstoredglue/Makefile b/tools/ocaml/libs/xenstoredglue/Makefile
new file mode 100644
index 0000000000..020acd3bef
--- /dev/null
+++ b/tools/ocaml/libs/xenstoredglue/Makefile
@@ -0,0 +1,39 @@
+OCAML_TOPLEVEL=$(CURDIR)/../..
+XEN_ROOT=$(OCAML_TOPLEVEL)/../..
+include $(OCAML_TOPLEVEL)/common.make
+
+SUBDIRS= domain_getinfo_plugin_v1
+
+CFLAGS += $(CFLAGS_xeninclude)
+OCAMLOPTFLAGS += -opaque
+
+OBJS = plugin_interface_v1
+INTF = $(foreach obj, $(OBJS),$(obj).cmi)
+LIBS = plugin_interface_v1.cma plugin_interface_v1.cmxa
+LIBS_plugin_interface_v1 =
+plugin_interface_v1_OBJS=$(OBJS)
+
+.PHONY: all
+all: $(INTF) $(LIBS) $(PROGRAMS) subdirs-all
+
+bins: $(PROGRAMS)
+
+libs: $(LIBS)
+
+plugin_interface_v1 = $(OBJS)
+
+OCAML_NOC_LIBRARY = plugin_interface_v1
+
+.PHONY: install
+install: $(LIBS) META subdirs-install
+
+.PHONY: uninstall
+uninstall: subdirs-uninstall
+
+.PHONY: clean
+clean: subdirs-clean
+
+.PHONY: distclean
+distclean: subdirs-distclean
+
+include $(OCAML_TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/META.in b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/META.in
new file mode 100644
index 0000000000..fb917def62
--- /dev/null
+++ b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/META.in
@@ -0,0 +1,5 @@
+version = "@VERSION@"
+description = "Xenstored plugin for Xenctrl.domain_getinfo unstable interface - V1"
+requires = "plugin_interface_v1"
+archive(byte) = "domain_getinfo_v1.cma"
+archive(native) = "domain_getinfo_v1.cmxa"
diff --git a/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/Makefile b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/Makefile
new file mode 100644
index 0000000000..eae44f8326
--- /dev/null
+++ b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/Makefile
@@ -0,0 +1,38 @@
+OCAML_TOPLEVEL=$(CURDIR)/../../..
+XEN_ROOT=$(OCAML_TOPLEVEL)/../..
+include $(OCAML_TOPLEVEL)/common.make
+
+CFLAGS += -I $(OCAML_TOPLEVEL)/libs/xenstoredglue $(CFLAGS_libxenctrl) $(CFLAGS_xeninclude)
+CFLAGS += $(APPEND_CFLAGS)
+OCAMLOPTFLAGS += -opaque
+OCAMLINCLUDE += -I ../ -I ./
+
+OBJS = domain_getinfo_v1
+INTF = $(foreach obj, $(OBJS),$(obj).cmi)
+LIBS = domain_getinfo_v1.cmxa domain_getinfo_v1.cmxs
+
+LIBS_xenstoredglue = $(call xenlibs-ldflags-ldlibs,xenctrl)
+
+all: $(INTF) $(LIBS) $(PROGRAMS)
+
+bins: $(PROGRAMS)
+
+libs: $(LIBS)
+
+domain_getinfo_v1_OBJS = $(OBJS)
+domain_getinfo_v1 = $(OBJS)
+domain_getinfo_v1_C_OBJS = domain_getinfo_stubs_v1
+
+OCAML_DYN_LIBRARY = domain_getinfo_v1
+
+.PHONY: install
+install: $(LIBS) META
+	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)/xenctrl_plugin
+	$(INSTALL_PROG) domain_getinfo_v1.cmxs $(DESTDIR)$(LIBEXEC_BIN)/xenctrl_plugin
+
+.PHONY: uninstall
+uninstall:
+	rm -f $(DESTDIR)$(LIBEXEC_BIN)/xenctrl_plugin/domain_getinfo_v1.cmxs
+
+include $(OCAML_TOPLEVEL)/Makefile.rules
+
diff --git a/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c
new file mode 100644
index 0000000000..a29ac7c877
--- /dev/null
+++ b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c
@@ -0,0 +1,169 @@
+#define _XOPEN_SOURCE 600
+#include <stdlib.h>
+#include <errno.h>
+
+#define CAML_NAME_SPACE
+#include <caml/alloc.h>
+#include <caml/memory.h>
+#include <caml/signals.h>
+#include <caml/fail.h>
+#include <caml/callback.h>
+#include <caml/custom.h>
+
+#include <xen-tools/common-macros.h>
+
+#include <string.h>
+
+#define XC_WANT_COMPAT_MAP_FOREIGN_API
+#include <xenctrl.h>
+
+#define ERR_MSG_LEN (XC_MAX_ERROR_MSG_LEN + 6)
+#define MAX_FUNC_LINE_LEN 64
+#define failwith_xc_v1(xch) xsglue_failwith_xc(xch, __FUNCTION__, __LINE__)
+
+// This is a minimal stub to xenctrl for oxenstored's purposes
+// For the full xenctrl stubs, see tools/ocaml/libs/xc/xenctrl_stubs.c
+
+static inline xc_interface *xsglue_xch_of_val_v1(value v)
+{
+	xc_interface *xch = *(xc_interface **)Data_custom_val(v);
+
+	return xch;
+}
+
+static void xsglue_xenctrl_finalize(value v)
+{
+	xc_interface *xch = xsglue_xch_of_val_v1(v);
+
+	xc_interface_close(xch);
+}
+
+static struct custom_operations xsglue_xenctrl_ops = {
+	.identifier  = "xenctrl",
+	.finalize    = xsglue_xenctrl_finalize,
+	.compare     = custom_compare_default,     /* Can't compare     */
+	.hash        = custom_hash_default,        /* Can't hash        */
+	.serialize   = custom_serialize_default,   /* Can't serialize   */
+	.deserialize = custom_deserialize_default, /* Can't deserialize */
+	.compare_ext = custom_compare_ext_default, /* Can't compare     */
+};
+
+static void Noreturn xsglue_failwith_xc(xc_interface *xch,
+		char const* func,
+		int line)
+{
+	char error_str[ERR_MSG_LEN + MAX_FUNC_LINE_LEN];
+	size_t str_len = 0;
+	if (xch) {
+		const xc_error *error = xc_get_last_error(xch);
+		if (error->code == XC_ERROR_NONE)
+			str_len = snprintf(error_str, ERR_MSG_LEN,
+				           "%d: %s", errno, strerror(errno));
+		else
+			str_len = snprintf(error_str, ERR_MSG_LEN,
+				      	   "%d: %s: %s", error->code,
+					   xc_error_code_to_desc(error->code),
+					   error->message);
+	} else {
+		str_len = snprintf(error_str, ERR_MSG_LEN,
+			           "Unable to open XC interface");
+	}
+	str_len = str_len < ERR_MSG_LEN ? str_len : ERR_MSG_LEN;
+	// Log caller's source code function and line
+	snprintf(error_str+str_len, MAX_FUNC_LINE_LEN,
+                 " - called from %s:%d", func, line);
+	caml_raise_with_string(*caml_named_value("xsg.error"), error_str);
+}
+
+CAMLprim value stub_xsglue_xc_interface_open(value unit)
+{
+	CAMLparam1(unit);
+	CAMLlocal1(result);
+	xc_interface *xch;
+
+	result = caml_alloc_custom(&xsglue_xenctrl_ops, sizeof(xch), 0, 1);
+
+	caml_enter_blocking_section();
+	xch = xc_interface_open(NULL, NULL, 0);
+	caml_leave_blocking_section();
+
+	if ( !xch )
+		failwith_xc_v1(xch);
+
+	*(xc_interface **)Data_custom_val(result) = xch;
+
+	CAMLreturn(result);
+}
+
+static value xsglue_alloc_domaininfo_v1(xc_domaininfo_t * info)
+{
+	CAMLparam0();
+	CAMLlocal1(result);
+	result = caml_alloc_tuple(4);
+
+	Store_field(result,  0, Val_int(info->domain));
+	Store_field(result,  1, Val_bool(info->flags & XEN_DOMINF_dying));
+	Store_field(result,  2, Val_bool(info->flags & XEN_DOMINF_shutdown));
+	Store_field(result,  3, Val_int(MASK_EXTR(info->flags, XEN_DOMINF_shutdownmask)));
+
+	CAMLreturn(result);
+}
+
+CAMLprim value stub_xsglue_xc_domain_getinfo(value xch_val, value domid)
+{
+	CAMLparam2(xch_val, domid);
+	CAMLlocal1(result);
+	xc_interface *xch = xsglue_xch_of_val_v1(xch_val);
+	xc_domaininfo_t info;
+	int ret;
+
+	ret = xc_domain_getinfo_single(xch, Int_val(domid), &info);
+	if (ret < 0)
+		failwith_xc_v1(xch);
+
+	result = xsglue_alloc_domaininfo_v1(&info);
+
+	CAMLreturn(result);
+}
+
+CAMLprim value stub_xsglue_xc_domain_getinfolist(value xch_val, value first_domain, value nb)
+{
+	CAMLparam3(xch_val, first_domain, nb);
+	CAMLlocal2(result, temp);
+	xc_interface *xch = xsglue_xch_of_val_v1(xch_val);
+	xc_domaininfo_t * info;
+	int i, ret, toalloc, retval;
+	unsigned int c_max_domains;
+	uint32_t c_first_domain;
+
+	/* get the minimum number of allocate byte we need and bump it up to page boundary */
+	toalloc = (sizeof(xc_domaininfo_t) * Int_val(nb)) | 0xfff;
+	ret = posix_memalign((void **) ((void *) &info), 4096, toalloc);
+	if (ret)
+		caml_raise_out_of_memory();
+
+	result = temp = Val_emptylist;
+
+	c_first_domain = Int_val(first_domain);
+	c_max_domains = Int_val(nb);
+	caml_enter_blocking_section();
+	retval = xc_domain_getinfolist(xch, c_first_domain,
+				       c_max_domains, info);
+	caml_leave_blocking_section();
+
+	if (retval < 0) {
+		free(info);
+		failwith_xc_v1(xch);
+	}
+	for (i = 0; i < retval; i++) {
+		result = caml_alloc_small(2, Tag_cons);
+		Field(result, 0) = Val_int(0);
+		Field(result, 1) = temp;
+		temp = result;
+
+		Store_field(result, 0, xsglue_alloc_domaininfo_v1(info + i));
+	}
+
+	free(info);
+	CAMLreturn(result);
+}
diff --git a/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.ml b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.ml
new file mode 100644
index 0000000000..d8947b618f
--- /dev/null
+++ b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.ml
@@ -0,0 +1,51 @@
+(** Minimal interface on top of unstable Xenctrl for Oxenstored's usage *)
+
+(** For the full Xenctrl interface, see: tools/ocaml/libs/xc/ *)
+
+module M : Plugin_interface_v1.Domain_getinfo_V1 = struct
+  exception Error of string
+
+  type domid = int
+  type handle
+
+  type domaininfo = {
+    domid : domid;
+    dying : bool;
+    shutdown : bool;
+    shutdown_code : int;
+  }
+
+  external interface_open : unit -> handle = "stub_xsglue_xc_interface_open"
+
+  external domain_getinfo : handle -> domid -> domaininfo
+    = "stub_xsglue_xc_domain_getinfo"
+
+  external __domain_getinfolist : handle -> domid -> int -> domaininfo list
+    = "stub_xsglue_xc_domain_getinfolist"
+
+  let domain_getinfolist handle first_domain =
+    (* [rev_concat lst] is equivalent to [lst |> List.concat |> List.rev]
+     * except it is tail recursive, whereas [List.concat] isn't.
+     * Example:
+     * rev_concat [[10;9;8];[7;6];[5]]] = [5; 6; 7; 8; 9; 10]
+     *)
+    let rev_append_fold acc e = List.rev_append e acc in
+    let rev_concat lst = List.fold_left rev_append_fold [] lst in
+
+    let nb = 1024 in
+    let rec __getlist lst from =
+      (* _domain_getinfolist returns domains in reverse order, largest first *)
+      match __domain_getinfolist handle from nb with
+      | [] -> rev_concat lst
+      | hd :: _ as l -> __getlist (l :: lst) (hd.domid + 1)
+    in
+    __getlist [] first_domain
+
+  let _ = Callback.register_exception "xsg.error" (Error "register_callback")
+end
+
+let () =
+  Printf.printf "Registration of %s plugin started\n%!" __MODULE__;
+  Plugin_interface_v1.register_plugin_v1
+    (module M : Plugin_interface_v1.Domain_getinfo_V1);
+  Printf.printf "Registration of %s plugin successful\n%!" __MODULE__
diff --git a/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.mli b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.mli
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tools/ocaml/libs/xenstoredglue/plugin_interface_v1.ml b/tools/ocaml/libs/xenstoredglue/plugin_interface_v1.ml
new file mode 100644
index 0000000000..6398b697ed
--- /dev/null
+++ b/tools/ocaml/libs/xenstoredglue/plugin_interface_v1.ml
@@ -0,0 +1,25 @@
+module type Domain_getinfo_V1 = sig
+  exception Error of string
+
+  type domid = int
+  type handle
+
+  type domaininfo = {
+    domid : domid;
+    dying : bool;
+    shutdown : bool;
+    shutdown_code : int;
+  }
+
+  val interface_open : unit -> handle
+  val domain_getinfo : handle -> domid -> domaininfo
+  val domain_getinfolist : handle -> domid -> domaininfo list
+end
+
+let plugin_implementation_v1 : (module Domain_getinfo_V1) option ref = ref None
+let register_plugin_v1 m = plugin_implementation_v1 := Some m
+
+let get_plugin_v1 () : (module Domain_getinfo_V1) =
+  match !plugin_implementation_v1 with
+  | Some s -> s
+  | None -> failwith "No plugin loaded"
diff --git a/tools/ocaml/libs/xenstoredglue/plugin_interface_v1.mli b/tools/ocaml/libs/xenstoredglue/plugin_interface_v1.mli
new file mode 100644
index 0000000000..cf20cc5efa
--- /dev/null
+++ b/tools/ocaml/libs/xenstoredglue/plugin_interface_v1.mli
@@ -0,0 +1,34 @@
+(** To avoid breaking the plugin interface, this module needs to be
+    standalone and can't rely on any other Xen library. Even unrelated
+    changes in the interfaces of those modules would change the hash
+    of this interface and break the plugin system.
+    It can only depend on Stdlib, therefore all of the types (domid,
+    domaininfo etc.) are redefined here instead of using alternatives
+    defined elsewhere.
+
+    NOTE: The signature of this interface should not be changed (no
+    functions or types can be added, modified, or removed). If
+    underlying Xenctrl changes require a new interface, a V2 with a
+    corresponding plugin should be created.
+ *)
+
+module type Domain_getinfo_V1 = sig
+  exception Error of string
+
+  type domid = int
+  type handle
+
+  type domaininfo = {
+    domid : domid;
+    dying : bool;
+    shutdown : bool;
+    shutdown_code : int;
+  }
+
+  val interface_open : unit -> handle
+  val domain_getinfo : handle -> domid -> domaininfo
+  val domain_getinfolist : handle -> domid -> domaininfo list
+end
+
+val register_plugin_v1 : (module Domain_getinfo_V1) -> unit
+val get_plugin_v1 : unit -> (module Domain_getinfo_V1)
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 09:07:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 09:07:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781621.1191108 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh3nK-00035K-Ax; Thu, 22 Aug 2024 09:07:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781621.1191108; Thu, 22 Aug 2024 09:07:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh3nK-00035D-7H; Thu, 22 Aug 2024 09:07:50 +0000
Received: by outflank-mailman (input) for mailman id 781621;
 Thu, 22 Aug 2024 09:06:37 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=A8+D=PV=cloud.com=andrii.sultanov@srs-se1.protection.inumbo.net>)
 id 1sh3m8-00031f-US
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 09:06:36 +0000
Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com
 [2a00:1450:4864:20::630])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d4a99749-6065-11ef-8776-851b0ebba9a2;
 Thu, 22 Aug 2024 11:06:34 +0200 (CEST)
Received: by mail-ej1-x630.google.com with SMTP id
 a640c23a62f3a-a86859e2fc0so70576166b.3
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 02:06:34 -0700 (PDT)
Received: from EMEAENGAAD87503.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f2e6717sm88948266b.96.2024.08.22.02.06.33
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 02:06:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d4a99749-6065-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724317594; x=1724922394; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=nlhcotXPcm3V0aCfa011qTB8OJqHN9ilqhFJWLxdY/g=;
        b=KJCo6U1tYO+C1kGdV0pkk2tn+qanO2c+rII5qM/crBclMUf7ypj0H228TxAun1PQQL
         sxIB9uTATSUQcvU5wfS0j7qmW69/fqp8QOaBmlceeT6PSlurI/jJbkR8NGuILGWqj9fw
         9HpKFVUksbCh3X8T0KhkHhlE+hS4Orjy8aYs8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724317594; x=1724922394;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=nlhcotXPcm3V0aCfa011qTB8OJqHN9ilqhFJWLxdY/g=;
        b=C+Sj12tOmX1cm5L41VNyS3DHhVTO/bAtwzWEwYaK5lLOzt60ZQ2LqLzNvQ1YdbdCgu
         OAfSy7XGDQq1uNLxM1hIBvpPTxZFsAKL8/8hww9hpR0VZn7NMqHPLdga5N24gyXI86WU
         gDGRUwHuUM1rKdV2u/wsqMnohnJUrAqOPevFT9Dhd8rVga/DFEZLQ7aG4BxJcUbHAYTa
         TAgTs7R8U6eOA+3UpWG7HV43XFfMEIiFxwF2O8f7Zu0fSPjmPzNwdnUXWd1s+nXnwrxx
         Umwql4hINUniHBCI+ipauP9PZ62Td6VW2kXMDExWw8VT/Je7j0d8i31hqNaMMKPQ1gG4
         j1aA==
X-Gm-Message-State: AOJu0YwQ5qYQrr6PyeDOosZo1V2uj/c/8IklKBtI9AANBJ8bJ3Tel9Ow
	44vcDd0V2sduDPC+kthm3140I+GTVevVKfAfXWr6FSOOHm5qjgcDRAOMm3kaHXAvE2Bk6qvuq/j
	4Iu8=
X-Google-Smtp-Source: AGHT+IEiB7layv7P6SORlBAgpx54WlOYrTLxhW+HkUgimcpsGyORfLMAuVC3gSPgQHKAWe/P+qIKkA==
X-Received: by 2002:a17:907:7e84:b0:a86:7fc2:398b with SMTP id a640c23a62f3a-a867fc2493emr305094366b.15.1724317593805;
        Thu, 22 Aug 2024 02:06:33 -0700 (PDT)
From: Andrii Sultanov <andrii.sultanov@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Andrii Sultanov <andrii.sultanov@cloud.com>,
	Christian Lindig <christian.lindig@citrix.com>,
	David Scott <dave@recoil.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1 0/4] Stabilize Oxenstored's interface with
Date: Thu, 22 Aug 2024 10:06:01 +0100
Message-Id: <cover.1724314239.git.andrii.sultanov@cloud.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Oxenstored depends on unstable Xenctrl, utilizing only a few of its
functions. This patch series introduces a dynamically-loaded OCaml
plugin that aims to stabilize 'Xenctrl.domain_getinfo' and
'Xenctrl.domain_getinfolist' by hiding the instability behind a versioned
interface.

This, in turn, would allow to fork Oxenstored out of the xen tree,
speeding up its development and allowing it to transition to an
OCaml-standard build system.

This is only one step towards the long-term goal of being able to drop
libxenctrl: https://gitlab.com/xen-project/xen/-/issues/190

Commits and notes further in the patches explain the exact mechanism behind
this. I've tested this oxenstored with a V2 interface and plugin, with V1
plugin continuing to be compiled, loaded, and working correctly.

A dynamic-loading approach was chosen because it allows one to easily review
the remaining usages of Xenctrl and does not force oxenstored to be recompiled
every time xen changes.

This patch series passed the Gitlab CI
(https://gitlab.com/xen-project/people/asultanov/xen/-/pipelines/1421643375),
and was further tested on some hosts.

Oxenstored currently uses the single-domain 'domain_getinfo' function,
whereas Cxenstored uses the more-efficient 'domain_getinfolist'. Both of
these are provided in the plugin to allow a transition from one to the
other without modifying the interface in the future.

A prototype of oxenstored using domain_getinfolist was also developed,
though it is not a part of the current patch series. It also passed the
Gitlab CI and was tested on hosts.
(https://gitlab.com/xen-project/people/asultanov/xen/-/pipelines/1421686622)

A Gitlab repository with these patches applied, if it's easier for
anyone to review it on there:
https://gitlab.com/xen-project/people/asultanov/xen/-/compare/staging...staging?from_project_id=2336572

Andrii Sultanov (4):
  tools/ocaml/common.make: Remove '-cc $(CC)' flag from OCAMLOPTFLAGS
  ocaml/libs: Implement a dynamically-loaded plugin for
    Xenctrl.domain_getinfo
  tools/oxenstored: Use the plugin for Xenctrl.domain_getinfo
  Makefile.rules: Fix OCaml libs

 Config.mk                                     |   2 +-
 configure                                     |   7 +
 m4/paths.m4                                   |   4 +
 tools/configure                               |   7 +
 tools/ocaml/Makefile                          |   1 +
 tools/ocaml/Makefile.rules                    |  21 ++-
 tools/ocaml/common.make                       |   2 +-
 tools/ocaml/libs/Makefile                     |   2 +-
 tools/ocaml/libs/xenstoredglue/META.in        |   4 +
 tools/ocaml/libs/xenstoredglue/Makefile       |  39 ++++
 .../domain_getinfo_plugin_v1/META.in          |   5 +
 .../domain_getinfo_plugin_v1/Makefile         |  38 ++++
 .../domain_getinfo_stubs_v1.c                 | 169 ++++++++++++++++++
 .../domain_getinfo_v1.ml                      |  51 ++++++
 .../domain_getinfo_v1.mli                     |   0
 .../libs/xenstoredglue/plugin_interface_v1.ml |  25 +++
 .../xenstoredglue/plugin_interface_v1.mli     |  34 ++++
 tools/ocaml/xenstored/Makefile                |   5 +-
 tools/ocaml/xenstored/domains.ml              |  63 +++++--
 tools/ocaml/xenstored/paths.ml.in             |   1 +
 20 files changed, 454 insertions(+), 26 deletions(-)
 create mode 100644 tools/ocaml/libs/xenstoredglue/META.in
 create mode 100644 tools/ocaml/libs/xenstoredglue/Makefile
 create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/META.in
 create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/Makefile
 create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c
 create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.ml
 create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.mli
 create mode 100644 tools/ocaml/libs/xenstoredglue/plugin_interface_v1.ml
 create mode 100644 tools/ocaml/libs/xenstoredglue/plugin_interface_v1.mli

-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 09:07:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 09:07:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781627.1191126 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh3nL-0003Je-4e; Thu, 22 Aug 2024 09:07:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781627.1191126; Thu, 22 Aug 2024 09:07:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh3nK-0003Ha-TZ; Thu, 22 Aug 2024 09:07:50 +0000
Received: by outflank-mailman (input) for mailman id 781627;
 Thu, 22 Aug 2024 09:06:44 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=A8+D=PV=cloud.com=andrii.sultanov@srs-se1.protection.inumbo.net>)
 id 1sh3mG-00031f-CA
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 09:06:44 +0000
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com
 [2a00:1450:4864:20::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d946fc37-6065-11ef-8776-851b0ebba9a2;
 Thu, 22 Aug 2024 11:06:42 +0200 (CEST)
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a866cea40c4so73624966b.0
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 02:06:42 -0700 (PDT)
Received: from EMEAENGAAD87503.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f2e6717sm88948266b.96.2024.08.22.02.06.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 02:06:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d946fc37-6065-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724317602; x=1724922402; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=apMXWG5KKVJZvsURjvsfLTCaQHUpHrA7Cdja1G+UXWs=;
        b=AruAVyGQhVxatR+S7RPsTdJQbBYUU+BuJeSW0pwuA7OM11GEVF8vwWfBe4vGyUFF4Q
         jmtskHDsuzH8VrvuAgbmE0O72JC1iE01jZXI0lQUXVgJ/6RahRxa0fei/7dyYMmpLle/
         ZyqmmO4sTkg3oaokOLosDQnNQgv9uPaT2FZ5c=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724317602; x=1724922402;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=apMXWG5KKVJZvsURjvsfLTCaQHUpHrA7Cdja1G+UXWs=;
        b=CwHSREgkjHOMDXbS6eYHJFmFIGqIwb1GN5KQqgCmgf3DV+hu0hTzyUPNBoC8fQ5x7w
         I0DfvVU1jUogULuhRH8duxZQTeIJSM7fEcCQyhgUxGbiAji7OMOfTY8LBrL71u/Lpeib
         HD82cibKeEELiBXf/tR/yq02UyvXo46s1QyRPcFS7o60SnVHo+61rpHwZBpfcPATk06G
         lWP5u3c9b6LOsJuOh38C93J0TYRw2IDu9K2oZYYnjgiCH5/zkS+mO8CUDX7ZxVS+wJKb
         bz7sdOeFyHIXX2A0PG2doLbuT4y+u1BNCNIqJ1xIXvVTzGcjmFnrVWqNMVZjNc36vcsd
         vzpg==
X-Gm-Message-State: AOJu0Yw9Owy8/RWXqh/eeqsBWc7lKo6xbqZGrvcyiX3NWptEwW8ucwqZ
	h/hMXoBUYAYKlIIRBcaCI2E5SQKLJ03scXRWv6zjsjnhMIBj4XBDy8vNO7dr53jOka8CP8LO5z+
	T7mA=
X-Google-Smtp-Source: AGHT+IErlCYaMdMcS77XZoDN4Dk2S07zgJchi44QkpyQRX2Xr3FKCRaBdbA86xHlcke/JOJlC4Ge8A==
X-Received: by 2002:a17:907:808:b0:a77:e48d:bc8 with SMTP id a640c23a62f3a-a866f27a0d1mr448033366b.21.1724317601732;
        Thu, 22 Aug 2024 02:06:41 -0700 (PDT)
From: Andrii Sultanov <andrii.sultanov@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Andrii Sultanov <andrii.sultanov@cloud.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Christian Lindig <christian.lindig@citrix.com>,
	David Scott <dave@recoil.org>
Subject: [PATCH v1 3/4] tools/oxenstored: Use the plugin for Xenctrl.domain_getinfo
Date: Thu, 22 Aug 2024 10:06:04 +0100
Message-Id: <c40ed2c49f0d72d227a1ab2ef90be0e24e17382c.1724314239.git.andrii.sultanov@cloud.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <cover.1724314239.git.andrii.sultanov@cloud.com>
References: <cover.1724314239.git.andrii.sultanov@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Oxenstored dynamically loads the plugin provided in
ocaml/libs/xenstoredglue.
The plugin is verified to be providing the specified plugin_interface
during its loading.

If a V2 of the plugin is produced, V1 will still be present, and a new
version should only be loaded if it's verified to exist
(New oxenstored can run in an environment with only V1 of the plugin).

Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
---
 Config.mk                         |  2 +-
 configure                         |  7 ++++
 m4/paths.m4                       |  4 ++
 tools/configure                   |  7 ++++
 tools/ocaml/xenstored/Makefile    |  5 ++-
 tools/ocaml/xenstored/domains.ml  | 63 +++++++++++++++++++++----------
 tools/ocaml/xenstored/paths.ml.in |  1 +
 7 files changed, 68 insertions(+), 21 deletions(-)

diff --git a/Config.mk b/Config.mk
index 1a3938b6c4..4be7d8a573 100644
--- a/Config.mk
+++ b/Config.mk
@@ -160,7 +160,7 @@ endef
 BUILD_MAKE_VARS := sbindir bindir LIBEXEC LIBEXEC_BIN libdir SHAREDIR \
                    XENFIRMWAREDIR XEN_CONFIG_DIR XEN_SCRIPT_DIR XEN_LOCK_DIR \
                    XEN_RUN_DIR XEN_PAGING_DIR XEN_DUMP_DIR XEN_LOG_DIR \
-                   XEN_LIB_DIR XEN_RUN_STORED
+                   XEN_LIB_DIR XEN_RUN_STORED XEN_CTRL_DOMAININFO_PLUGIN
 
 buildmakevars2file = $(eval $(call buildmakevars2file-closure,$(1)))
 define buildmakevars2file-closure
diff --git a/configure b/configure
index 2d7b20aa50..1a473ad2dd 100755
--- a/configure
+++ b/configure
@@ -631,6 +631,7 @@ XEN_PAGING_DIR
 XEN_LOCK_DIR
 INITD_DIR
 SHAREDIR
+XEN_CTRL_DOMAININFO_PLUGIN
 XEN_LIB_DIR
 XEN_RUN_STORED
 XEN_LOG_DIR
@@ -2199,6 +2200,12 @@ XEN_LIB_DIR=$localstatedir/lib/xen
 printf "%s\n" "#define XEN_LIB_DIR \"$XEN_LIB_DIR\"" >>confdefs.h
 
 
+XEN_CTRL_DOMAININFO_PLUGIN=$LIBEXEC_BIN/xenctrl_plugin
+
+
+printf "%s\n" "#define XEN_CTRL_DOMAININFO_PLUGIN \"$XEN_CTRL_DOMAININFO_PLUGIN\"" >>confdefs.h
+
+
 SHAREDIR=$prefix/share
 
 
diff --git a/m4/paths.m4 b/m4/paths.m4
index 3f94c62efb..e538445810 100644
--- a/m4/paths.m4
+++ b/m4/paths.m4
@@ -144,6 +144,10 @@ XEN_LIB_DIR=$localstatedir/lib/xen
 AC_SUBST(XEN_LIB_DIR)
 AC_DEFINE_UNQUOTED([XEN_LIB_DIR], ["$XEN_LIB_DIR"], [Xen's lib dir])
 
+XEN_CTRL_DOMAININFO_PLUGIN=$LIBEXEC_BIN/xenctrl_plugin
+AC_SUBST(XEN_CTRL_DOMAININFO_PLUGIN)
+AC_DEFINE_UNQUOTED([XEN_CTRL_DOMAININFO_PLUGIN], ["$XEN_CTRL_DOMAININFO_PLUGIN"], [Xenctrl's plugin for Oxenstored])
+
 SHAREDIR=$prefix/share
 AC_SUBST(SHAREDIR)
 
diff --git a/tools/configure b/tools/configure
index 7f98303fdd..24b12a1f5d 100755
--- a/tools/configure
+++ b/tools/configure
@@ -743,6 +743,7 @@ XEN_PAGING_DIR
 XEN_LOCK_DIR
 INITD_DIR
 SHAREDIR
+XEN_CTRL_DOMAININFO_PLUGIN
 XEN_LIB_DIR
 XEN_RUN_STORED
 XEN_LOG_DIR
@@ -4530,6 +4531,12 @@ XEN_LIB_DIR=$localstatedir/lib/xen
 printf "%s\n" "#define XEN_LIB_DIR \"$XEN_LIB_DIR\"" >>confdefs.h
 
 
+XEN_CTRL_DOMAININFO_PLUGIN=$LIBEXEC_BIN/xenctrl_plugin
+
+
+printf "%s\n" "#define XEN_CTRL_DOMAININFO_PLUGIN \"$XEN_CTRL_DOMAININFO_PLUGIN\"" >>confdefs.h
+
+
 SHAREDIR=$prefix/share
 
 
diff --git a/tools/ocaml/xenstored/Makefile b/tools/ocaml/xenstored/Makefile
index fa45305d8c..09896732ed 100644
--- a/tools/ocaml/xenstored/Makefile
+++ b/tools/ocaml/xenstored/Makefile
@@ -15,7 +15,8 @@ OCAMLINCLUDE += \
 	-I $(OCAML_TOPLEVEL)/libs/xb \
 	-I $(OCAML_TOPLEVEL)/libs/mmap \
 	-I $(OCAML_TOPLEVEL)/libs/xc \
-	-I $(OCAML_TOPLEVEL)/libs/eventchn
+	-I $(OCAML_TOPLEVEL)/libs/eventchn \
+	-I $(OCAML_TOPLEVEL)/libs/xenstoredglue
 
 LIBS = syslog.cma syslog.cmxa poll.cma poll.cmxa
 syslog_OBJS = syslog
@@ -59,6 +60,7 @@ INTF = symbol.cmi trie.cmi syslog.cmi systemd.cmi poll.cmi
 
 XENSTOREDLIBS = \
 	unix.cmxa \
+	dynlink.cmxa \
 	-ccopt -L -ccopt . syslog.cmxa \
 	-ccopt -L -ccopt . systemd.cmxa \
 	-ccopt -L -ccopt . poll.cmxa \
@@ -66,6 +68,7 @@ XENSTOREDLIBS = \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/eventchn $(OCAML_TOPLEVEL)/libs/eventchn/xeneventchn.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xc $(OCAML_TOPLEVEL)/libs/xc/xenctrl.cmxa \
 	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xb $(OCAML_TOPLEVEL)/libs/xb/xenbus.cmxa \
+	-ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xenstoredglue $(OCAML_TOPLEVEL)/libs/xenstoredglue/plugin_interface_v1.cmxa \
 	-ccopt -L -ccopt $(XEN_ROOT)/tools/libs/ctrl
 
 PROGRAMS = oxenstored
diff --git a/tools/ocaml/xenstored/domains.ml b/tools/ocaml/xenstored/domains.ml
index 7a3056c364..e3edee6de6 100644
--- a/tools/ocaml/xenstored/domains.ml
+++ b/tools/ocaml/xenstored/domains.ml
@@ -20,10 +20,36 @@ let warn fmt  = Logging.warn  "domains" fmt
 
 let xc = Xenctrl.interface_open ()
 
-type domains = {
-  eventchn: Event.t;
-  table: (Xenctrl.domid, Domain.t) Hashtbl.t;
+let load_plug fname =
+  let fail_with fmt = Printf.ksprintf failwith fmt in
+  let fname = Dynlink.adapt_filename fname in
+  if Sys.file_exists fname then
+    try Dynlink.loadfile fname with
+    | Dynlink.Error err as e ->
+        Printf.eprintf "ERROR loading plugin '%s': %s\n%!" fname
+          (Dynlink.error_message err);
+        raise e
+    | _ -> fail_with "Unknown error while loading plugin"
+  else fail_with "Plugin file '%s' does not exist" fname
+
+let () =
+  let filepath = Paths.xen_ctrl_plugin ^ "/domain_getinfo_v1.cmxs" in
+  Printf.printf "Trying to load plugin '%s'\n%!" filepath;
+  let list_files = Sys.readdir Paths.xen_ctrl_plugin in
+  Printf.printf "Directory listing of '%s'\n%!" Paths.xen_ctrl_plugin;
+  Array.iter (fun x -> Printf.printf "\t%s\n%!" x) list_files;
+  Dynlink.allow_only [ "Plugin_interface_v1" ];
+  load_plug filepath
+
+module Plugin =
+  (val Plugin_interface_v1.get_plugin_v1 ()
+      : Plugin_interface_v1.Domain_getinfo_V1)
+
+let handle = Plugin.interface_open ()
 
+type domains = {
+  eventchn : Event.t;
+  table : (Plugin.domid, Domain.t) Hashtbl.t;
   (* N.B. the Queue module is not thread-safe but oxenstored is single-threaded. *)
   (* Domains queue up to regain conflict-credit; we have a queue for
      	   domains that are carrying some penalty and so are below the
@@ -93,22 +119,21 @@ let cleanup doms =
   let notify = ref false in
   let dead_dom = ref [] in
 
-  Hashtbl.iter (fun id _ -> if id <> 0 then
-                   try
-                     let info = Xenctrl.domain_getinfo xc id in
-                     if info.Xenctrl.shutdown || info.Xenctrl.dying then (
-                       debug "Domain %u died (dying=%b, shutdown %b -- code %d)"
-                         id info.Xenctrl.dying info.Xenctrl.shutdown info.Xenctrl.shutdown_code;
-                       if info.Xenctrl.dying then
-                         dead_dom := id :: !dead_dom
-                       else
-                         notify := true;
-                     )
-                   with Xenctrl.Error _ ->
-                     debug "Domain %u died -- no domain info" id;
-                     dead_dom := id :: !dead_dom;
-               ) doms.table;
-  List.iter (fun id ->
+  Hashtbl.iter
+    (fun id _ ->
+      if id <> 0 then (
+        try
+          let info = Plugin.domain_getinfo handle id in
+          if info.Plugin.shutdown || info.Plugin.dying then (
+            debug "Domain %u died (dying=%b, shutdown %b -- code %d)" id
+              info.Plugin.dying info.Plugin.shutdown info.Plugin.shutdown_code;
+            if info.Plugin.dying then dead_dom := id :: !dead_dom else notify := true)
+        with Plugin.Error _ ->
+          debug "Domain %u died -- no domain info" id;
+          dead_dom := id :: !dead_dom))
+    doms.table;
+  List.iter
+    (fun id ->
       let dom = Hashtbl.find doms.table id in
       Domain.close dom;
       Hashtbl.remove doms.table id;
diff --git a/tools/ocaml/xenstored/paths.ml.in b/tools/ocaml/xenstored/paths.ml.in
index 37949dc8f3..67276dda94 100644
--- a/tools/ocaml/xenstored/paths.ml.in
+++ b/tools/ocaml/xenstored/paths.ml.in
@@ -2,3 +2,4 @@ let xen_log_dir = "@XEN_LOG_DIR@"
 let xen_config_dir = "@XEN_CONFIG_DIR@"
 let xen_run_dir = "@XEN_RUN_DIR@"
 let xen_run_stored = "@XEN_RUN_STORED@"
+let xen_ctrl_plugin = "@XEN_CTRL_DOMAININFO_PLUGIN@"
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 09:07:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 09:07:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781623.1191112 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh3nK-00038X-Hy; Thu, 22 Aug 2024 09:07:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781623.1191112; Thu, 22 Aug 2024 09:07:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh3nK-00037Y-Du; Thu, 22 Aug 2024 09:07:50 +0000
Received: by outflank-mailman (input) for mailman id 781623;
 Thu, 22 Aug 2024 09:06:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=A8+D=PV=cloud.com=andrii.sultanov@srs-se1.protection.inumbo.net>)
 id 1sh3mB-0002Rz-46
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 09:06:39 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d6ada0fc-6065-11ef-a50a-bb4a2ccca743;
 Thu, 22 Aug 2024 11:06:38 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-5334adf7249so794967e87.3
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 02:06:38 -0700 (PDT)
Received: from EMEAENGAAD87503.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f2e6717sm88948266b.96.2024.08.22.02.06.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 02:06:36 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d6ada0fc-6065-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724317597; x=1724922397; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=cORQBguaRrQouCupVhe68zYd4OsX8uT6R2EJjrpteaQ=;
        b=MOdW12v15WQoXrweKS/DwZ/wBOrbCdw9QggTD4gV+5sKUdhNW76TrBF/fz3jOA5vzu
         kPgAPhsiSEdp2XBP9buyhL+mzSAGu8lefyP6kEh9hTDpxicbBUnR6pO+1NPZVTx7aux8
         ZH7Lhs7NgXFe/zxHvMR3ks4KGa5XLFQqVh8VY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724317597; x=1724922397;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=cORQBguaRrQouCupVhe68zYd4OsX8uT6R2EJjrpteaQ=;
        b=I9iZHlN/FVsiOZ6OQ8b7gwitpnYQnHjy070pVnAGKYxSrhKw3w2kCmtmyZtlOFxHE1
         KIAQLNy+IrAUxXuUmggtZZPx7depoW1nabBnAuJBa8UlM2YPuYwviIFqm7DsejieanB4
         oFkxykc2kcGXdjGvBVxXUhqvH8DNYTUKbMQvIJsU/xUOjfV5uWLglcfQodJxP48qwuZ/
         ao4bFYAIvc+bH22H+zTvJQ3yiPGECnnAPvE98imO0cgwuGRuQkrqC70EGwgV6BukIReJ
         A5oMywFNvmnNFqElMS/W12u+pscbF5m/uT5QzfjLiFDBxIR+y6dXiRt0bxgWf5Nzuhtm
         7weQ==
X-Gm-Message-State: AOJu0YySCfphLfo8mJj5+tmcJ+FO7QODTkpk5Doq9ZaWXBitNdWqeopv
	BdK9Bbtk63aqtE6phpH5xSg5ofaQmH+aryBojUEWW5Gz/FAx8NPxbt/Y5p5krv+ivukINllNspr
	ICjM=
X-Google-Smtp-Source: AGHT+IFZoC7jcASMVLRGYIPkD8jDYYqSOXmqVpo3vYtIjOVyDqELzPmYTBq5UG2H7gbAjBder2DQiw==
X-Received: by 2002:a05:6512:39c7:b0:52c:d76f:7f61 with SMTP id 2adb3069b0e04-53348602056mr3554992e87.56.1724317597214;
        Thu, 22 Aug 2024 02:06:37 -0700 (PDT)
From: Andrii Sultanov <andrii.sultanov@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Andrii Sultanov <andrii.sultanov@cloud.com>,
	Christian Lindig <christian.lindig@citrix.com>,
	David Scott <dave@recoil.org>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH v1 1/4] tools/ocaml/common.make: Remove '-cc $(CC)' flag from OCAMLOPTFLAGS
Date: Thu, 22 Aug 2024 10:06:02 +0100
Message-Id: <110f63b76a12e8a9fead09f47319a35229222953.1724314239.git.andrii.sultanov@cloud.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <cover.1724314239.git.andrii.sultanov@cloud.com>
References: <cover.1724314239.git.andrii.sultanov@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

This flag does not work as assumed and will not pass
options (such as -shared) to the C compiler:
https://github.com/ocaml/ocaml/issues/12284

Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
---
 tools/ocaml/common.make | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
index 0c8a597d5b..cc126b749f 100644
--- a/tools/ocaml/common.make
+++ b/tools/ocaml/common.make
@@ -12,7 +12,7 @@ OCAMLFIND ?= ocamlfind
 CFLAGS += -fPIC -I$(shell ocamlc -where)
 
 OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\) .*/\1/p')
-OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F
+OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -w F -warn-error F
 OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
 
 VERSION := 4.1
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 09:27:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 09:27:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781669.1191158 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh46B-0000n9-8e; Thu, 22 Aug 2024 09:27:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781669.1191158; Thu, 22 Aug 2024 09:27:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh46B-0000n2-5L; Thu, 22 Aug 2024 09:27:19 +0000
Received: by outflank-mailman (input) for mailman id 781669;
 Thu, 22 Aug 2024 09:27:17 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/1gz=PV=cloud.com=christian.lindig@srs-se1.protection.inumbo.net>)
 id 1sh469-0000mw-Oh
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 09:27:17 +0000
Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com
 [2a00:1450:4864:20::633])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b7bb3ba1-6068-11ef-8776-851b0ebba9a2;
 Thu, 22 Aug 2024 11:27:15 +0200 (CEST)
Received: by mail-ej1-x633.google.com with SMTP id
 a640c23a62f3a-a867a564911so83972966b.2
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 02:27:15 -0700 (PDT)
Received: from smtpclient.apple ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f29eaadsm91011466b.67.2024.08.22.02.27.13
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 22 Aug 2024 02:27:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b7bb3ba1-6068-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724318834; x=1724923634; darn=lists.xenproject.org;
        h=to:references:message-id:content-transfer-encoding:cc:date
         :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=eTclOxh+v7ilbm3yHnt/W73waZWQ1h3IwdNri8LmKFk=;
        b=FA+jiJ+f7DBYz8CkcZzhPFckwc1XNz4JLLBFfeq9WFEdmuQEC+EWhlPDwGpDd5uF4G
         u3s8k1gXcJ630ADs0+/GeL+fF/4cdwJtRlRgGpKdvKU7ZtjEYM/KL7L8ZtkcbFeW9Qnd
         YYZMD6vyPa3tR7TYiFMXMmGxeBX052mYqiVLE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724318834; x=1724923634;
        h=to:references:message-id:content-transfer-encoding:cc:date
         :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=eTclOxh+v7ilbm3yHnt/W73waZWQ1h3IwdNri8LmKFk=;
        b=wh7s0kS4tgWPjcpLVmmog16s/vI4orKuMOvqIwNglfKqHTFJXAF+AL+g4LGhCc2KnF
         p3mk89ahoD2PD++EEcNoFxzRc5Yvb4hm6/Uhmbhrcgv/dHdlXJcf7mj4DA/tAikR3n9v
         JLM3FUqW4mEJ3uVq/4VB6+KEADN+s5QTJP286F3L6O0j7XJaTpuT3S7/IwElm9NGkc9B
         6K6c6bY9ocQAnA7uP24RLOuL5swp2p74jaKA+91DECgU37FdQq8xwZ+zMgU2eDuTB/A6
         AJ4QpFLWp2Vv581w2VSj5AMOxfWKjcVM06m5c5i58eoB1MzZWYTyjgW02TFEEbz9sAns
         Sbtw==
X-Gm-Message-State: AOJu0YzRvNp9T5nqM6gkK3aObiS7t7rTZGQopv0nsIUpkctthSi02oU+
	lamMWGZYub1FJ/+YqSI8Tj2b5w6kvKSqAvczu9iWwSOrB/ZJzwdJ9tmoIIfMSwY=
X-Google-Smtp-Source: AGHT+IHwM59NRIInGGC2Qr8V6NNY2Ud2qO8VO7Y0JqgKIC+7E8X1ZCZKkCOyMVhRAbcMPSsyAySqow==
X-Received: by 2002:a17:907:e285:b0:a86:6807:6c34 with SMTP id a640c23a62f3a-a866f40905emr406932566b.39.1724318833759;
        Thu, 22 Aug 2024 02:27:13 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\))
Subject: Re: [PATCH v1 0/4] Stabilize Oxenstored's interface with
From: Christian Lindig <christian.lindig@cloud.com>
In-Reply-To: <cover.1724314239.git.andrii.sultanov@cloud.com>
Date: Thu, 22 Aug 2024 10:27:01 +0100
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Christian Lindig <christian.lindig@citrix.com>,
 David Scott <dave@recoil.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <E8ABAB51-1DDC-4BF3-AA46-F003CC1806BF@cloud.com>
References: <cover.1724314239.git.andrii.sultanov@cloud.com>
To: Andrii Sultanov <andrii.sultanov@cloud.com>
X-Mailer: Apple Mail (2.3774.600.62)



> On 22 Aug 2024, at 10:06, Andrii Sultanov <andrii.sultanov@cloud.com> =
wrote:
>=20
> Oxenstored depends on unstable Xenctrl, utilizing only a few of its
> functions. This patch series introduces a dynamically-loaded OCaml
> plugin that aims to stabilize 'Xenctrl.domain_getinfo' and
> 'Xenctrl.domain_getinfolist' by hiding the instability behind a =
versioned
> interface.
>=20
> This, in turn, would allow to fork Oxenstored out of the xen tree,
> speeding up its development and allowing it to transition to an
> OCaml-standard build system.
>=20
> This is only one step towards the long-term goal of being able to drop
> libxenctrl: https://gitlab.com/xen-project/xen/-/issues/190
>=20
> Commits and notes further in the patches explain the exact mechanism =
behind
> this. I've tested this oxenstored with a V2 interface and plugin, with =
V1
> plugin continuing to be compiled, loaded, and working correctly.
>=20
> A dynamic-loading approach was chosen because it allows one to easily =
review
> the remaining usages of Xenctrl and does not force oxenstored to be =
recompiled
> every time xen changes.
>=20
> This patch series passed the Gitlab CI
> =
(https://gitlab.com/xen-project/people/asultanov/xen/-/pipelines/142164337=
5),
> and was further tested on some hosts.
>=20
> Oxenstored currently uses the single-domain 'domain_getinfo' function,
> whereas Cxenstored uses the more-efficient 'domain_getinfolist'. Both =
of
> these are provided in the plugin to allow a transition from one to the
> other without modifying the interface in the future.
>=20
> A prototype of oxenstored using domain_getinfolist was also developed,
> though it is not a part of the current patch series. It also passed =
the
> Gitlab CI and was tested on hosts.
> =
(https://gitlab.com/xen-project/people/asultanov/xen/-/pipelines/142168662=
2)
>=20
> A Gitlab repository with these patches applied, if it's easier for
> anyone to review it on there:
> =
https://gitlab.com/xen-project/people/asultanov/xen/-/compare/staging...st=
aging?from_project_id=3D2336572
>=20
> Andrii Sultanov (4):
>  tools/ocaml/common.make: Remove '-cc $(CC)' flag from OCAMLOPTFLAGS
>  ocaml/libs: Implement a dynamically-loaded plugin for
>    Xenctrl.domain_getinfo
>  tools/oxenstored: Use the plugin for Xenctrl.domain_getinfo
>  Makefile.rules: Fix OCaml libs
>=20
> Config.mk                                     |   2 +-
> configure                                     |   7 +
> m4/paths.m4                                   |   4 +
> tools/configure                               |   7 +
> tools/ocaml/Makefile                          |   1 +
> tools/ocaml/Makefile.rules                    |  21 ++-
> tools/ocaml/common.make                       |   2 +-
> tools/ocaml/libs/Makefile                     |   2 +-
> tools/ocaml/libs/xenstoredglue/META.in        |   4 +
> tools/ocaml/libs/xenstoredglue/Makefile       |  39 ++++
> .../domain_getinfo_plugin_v1/META.in          |   5 +
> .../domain_getinfo_plugin_v1/Makefile         |  38 ++++
> .../domain_getinfo_stubs_v1.c                 | 169 ++++++++++++++++++
> .../domain_getinfo_v1.ml                      |  51 ++++++
> .../domain_getinfo_v1.mli                     |   0
> .../libs/xenstoredglue/plugin_interface_v1.ml |  25 +++
> .../xenstoredglue/plugin_interface_v1.mli     |  34 ++++
> tools/ocaml/xenstored/Makefile                |   5 +-
> tools/ocaml/xenstored/domains.ml              |  63 +++++--
> tools/ocaml/xenstored/paths.ml.in             |   1 +
> 20 files changed, 454 insertions(+), 26 deletions(-)
> create mode 100644 tools/ocaml/libs/xenstoredglue/META.in
> create mode 100644 tools/ocaml/libs/xenstoredglue/Makefile
> create mode 100644 =
tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/META.in
> create mode 100644 =
tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/Makefile
> create mode 100644 =
tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_stu=
bs_v1.c
> create mode 100644 =
tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.=
ml
> create mode 100644 =
tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.=
mli
> create mode 100644 =
tools/ocaml/libs/xenstoredglue/plugin_interface_v1.ml
> create mode 100644 =
tools/ocaml/libs/xenstoredglue/plugin_interface_v1.mli
>=20
> --=20
> 2.39.2
>=20

Acked-by: Christian Lindig <christian.lindig@cloud.com>

I fully support the direction this is taking: decoupling Oxenstore from =
the Xen tree to hopefully speed up the development cycle and to attract =
OCaml developers by moving to a more OCaml-idiomatic build system. The =
code was previously shared with me.

=E2=80=94 C=


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 10:08:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 10:08:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781683.1191168 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh4k4-00083B-8f; Thu, 22 Aug 2024 10:08:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781683.1191168; Thu, 22 Aug 2024 10:08:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh4k4-000834-6A; Thu, 22 Aug 2024 10:08:32 +0000
Received: by outflank-mailman (input) for mailman id 781683;
 Thu, 22 Aug 2024 10:08:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sh4k3-00082y-8p
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 10:08:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sh4k2-0001j3-KJ; Thu, 22 Aug 2024 10:08:30 +0000
Received: from [15.248.2.26] (helo=[10.24.67.18])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sh4k2-0001m5-B2; Thu, 22 Aug 2024 10:08:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=CmvTWeI4YL/7oRomE/7yjl3rTHdfFCHruNE2eVDgeXA=; b=C3tRNHOFSQaHVUZP1VcgvOgXgC
	UaI78Thki7/TXRGRFFfRnrOF+Wttf320hwIzEuvSZE+LKuF3FAjoBmvsVxIJLOYBASo24dfYM6N4y
	n3TOgejmea+Xggvf9/NFxP+3Io2QBq+lowHtFmUTl9LkvatpTzhhPbKgIO5vURdPlE0g=;
Message-ID: <4cd8f2d6-d10e-43d4-8ce7-8b37946ece40@xen.org>
Date: Thu, 22 Aug 2024 11:08:28 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen/arm64: Hide FEAT_SME
Content-Language: en-GB
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240814210054.67520-1-julien@xen.org>
 <b306e03e-17d4-4d09-aa8c-78e44dacacca@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <b306e03e-17d4-4d09-aa8c-78e44dacacca@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 16/08/2024 08:15, Michal Orzel wrote:
  > On 14/08/2024 23:00, Julien Grall wrote:
>>
>>
>> Newer hardware may support FEAT_SME. Xen doesn't have any knowledge but
>> it will still expose the feature to the VM. If the OS is trying to use
>> SME, then it will crash.
>>
>> Solve by hiding FEAT_SME.
>>
>> Signed-off-by: Julien Grall <julien@xen.org>
> Acked-by: Michal Orzel <michal.orzel@amd.com>
> 
>>
>> ---
>>
>> The current approach used to create the domain cpuinfo is to hide
>> (i.e. a denylist) what we know Xen is not supporting. The drawback
>> with this approach is for newly introduced feature, Xen will expose it
>> by default.
>>
>> If a kernel is trying to use it then it will crash. I can't really
>> make my mind whether it would be better to expose only what we support
>> (i.e. use an allowlist).
>>
>> AFAICT, there is no security concerns with the current approach because
>> ID_* registers are not a way to tell the kernel which features are
>> supported. A guest kernel could still try to access the new registers.
> I agree with the security aspect but the part of the sentence in the middle is a bit misleading.

Indeed. It was poorly worded. I was meant to say what you wrote below :).

> ID_ registers *are* a way of informing the kernel about implemented PE features. It's just that
> the kernel could still access the features. That said, it should be considered an incorrect behavior
> and definitely not something we should worry about.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 10:16:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 10:16:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781692.1191177 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh4rU-0001E2-3b; Thu, 22 Aug 2024 10:16:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781692.1191177; Thu, 22 Aug 2024 10:16:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh4rU-0001Dv-0t; Thu, 22 Aug 2024 10:16:12 +0000
Received: by outflank-mailman (input) for mailman id 781692;
 Thu, 22 Aug 2024 10:16:10 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sh4rS-0001CH-GW
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 10:16:10 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sh4rS-0001rb-2G; Thu, 22 Aug 2024 10:16:10 +0000
Received: from [15.248.2.26] (helo=[10.24.67.18])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sh4rR-0002Q9-Ra; Thu, 22 Aug 2024 10:16:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
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=JG5LJlgUb/WFvE5Nr/hvC07BAGFOQSaVkucS05qzdmA=; b=5SCY6GacipZvvnEe87xMC96ETj
	9xjLYaMFkOMjaHN5etIT2TsjntUKC2zt5UR4zEE3qOxHCjGCGzrjwzOKne2xNhymxVdzNUjlDWF8d
	27nzEPF2uUPK9HT8ooTiVqK3KALu5MW6VlcNYq0O/zSN9MlF/WPvqGScbwLg5gGYQehU=;
Message-ID: <29fa0e7f-3b39-4434-b23b-43a41bfd1da1@xen.org>
Date: Thu, 22 Aug 2024 11:16:08 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/2] xen/arm: Drop {boot_}phys_offset usage
Content-Language: en-GB
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240814094303.23611-1-michal.orzel@amd.com>
 <20240814094303.23611-2-michal.orzel@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20240814094303.23611-2-michal.orzel@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Michal,

On 14/08/2024 10:43, Michal Orzel wrote:
> boot_phys_offset stores the physical offset (PA-VA), is calculated in
> the startup head.S code and passed to start_xen() as a first argument.
> There is no point in using it given that we can ask MMU to translate
> a VA for us using e.g. virt_to_{mfn,maddr}. Drop usage of these
> variables from the C world.

I think the code is a remanant of when Xen would be relocated to the top 
of the RAM. In this case, virt_to_mfn() would not have worked.

This was removed by f60658c6ae47 ("xen/arm: Stop relocating Xen") and I 
don't expect the relocation code to be re-introduced. So...

> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

...

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 10:33:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 10:33:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781708.1191188 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh57m-000512-Ec; Thu, 22 Aug 2024 10:33:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781708.1191188; Thu, 22 Aug 2024 10:33:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh57m-00050v-C8; Thu, 22 Aug 2024 10:33:02 +0000
Received: by outflank-mailman (input) for mailman id 781708;
 Thu, 22 Aug 2024 10:33:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sh57l-00050p-2G
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 10:33:01 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sh57k-000281-CR; Thu, 22 Aug 2024 10:33:00 +0000
Received: from [15.248.2.26] (helo=[10.24.67.18])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sh57k-0003Lt-5G; Thu, 22 Aug 2024 10:33:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=71QwtJotm16CdAZuex1E/FxwMdqnGk2+X/uhCEOp4a4=; b=dSfTEDArrGYZR9gqfzDXgoKeBC
	Ao5oe18n2kux3s+w6+DDpWRth4z/6kBDv8vUzNeNcW+smYbCf/siIzP/ORgjtwWc7qs9U+KukmhZB
	Xcq4PFrqKA0fVxRQ6xt3ZVkWIz6U5oT2gC3whPcxBGaa66pT/3eIkGIhKh/EePStkBr8=;
Message-ID: <9dea9745-9ea9-47b6-9a47-50b62560cb4c@xen.org>
Date: Thu, 22 Aug 2024 11:32:58 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/2] xen/arm: head: Do not pass physical offset to
 start_xen
Content-Language: en-GB
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240814094303.23611-1-michal.orzel@amd.com>
 <20240814094303.23611-3-michal.orzel@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20240814094303.23611-3-michal.orzel@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 14/08/2024 10:43, Michal Orzel wrote:
> Given no further use in C world of boot_phys_offset, drop it from the
> argument list of start_xen() and do the necessary changes in the startup
> code head.S (most notably modifying launch not to expect 2 arguments to
> pass to C entry point).
> 
> Both on arm64 and arm32, phys offset (stored in x20 or r10 respectively)
> is still needed, so that it can be used in e.g. create_table_entry,
> therefore keep it on the list of common register usage.
> 
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>

Acked-by: Julien Grall <jgrall@amazon.com>

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 10:36:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 10:36:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781714.1191197 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh5Al-0005aC-Se; Thu, 22 Aug 2024 10:36:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781714.1191197; Thu, 22 Aug 2024 10:36:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh5Al-0005a5-Q6; Thu, 22 Aug 2024 10:36:07 +0000
Received: by outflank-mailman (input) for mailman id 781714;
 Thu, 22 Aug 2024 10:36:07 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sh5Al-0005Zz-5y
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 10:36:07 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sh5Ak-0002G8-Qx; Thu, 22 Aug 2024 10:36:06 +0000
Received: from [15.248.2.26] (helo=[10.24.67.18])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sh5Ak-0003jX-JV; Thu, 22 Aug 2024 10:36:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=Ijoeu8VSnkTWhaxtMnYk4cCGxxQdiMO8XjhTec5NBkM=; b=CD6F1rtfH06RFLRi4Kvx9fFtdk
	N9v+VjTBwbV3fhurrEjJUQSTxKTL2sPOD8jiVHROKHmrC7ohMSxJ/5woi50dgEkK7XphiaS5b8jxn
	E9pusWsorm8i+NlZ9xlwPKw2EP6ITCn1MaYEHXpfGvi82AdWQ4gijtvOezHKV/u2XddU=;
Message-ID: <d33e1ef7-3d8e-41d0-a0f1-9bcbb4ce7848@xen.org>
Date: Thu, 22 Aug 2024 11:36:04 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 0/2] xen/arm: drop {boot_}phys_offset
Content-Language: en-GB
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240814094303.23611-1-michal.orzel@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20240814094303.23611-1-michal.orzel@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Michal,

On 14/08/2024 10:43, Michal Orzel wrote:
> This has been on a TODO list for quite some time now. There is no real need
> for these variables since we can ask the MMU to do the virt->maddr translation.
> 
> Michal Orzel (2):
>    xen/arm: Drop {boot_}phys_offset usage
>    xen/arm: head: Do not pass physical offset to start_xen

I have committed the series.

Cheers,

> 
>   xen/arch/arm/arm32/head.S     | 12 +++++-------
>   xen/arch/arm/arm64/head.S     | 12 +++++-------
>   xen/arch/arm/include/asm/mm.h |  2 +-
>   xen/arch/arm/mmu/setup.c      | 16 ++++++----------
>   xen/arch/arm/setup.c          |  5 ++---
>   5 files changed, 19 insertions(+), 28 deletions(-)
 >

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 10:37:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 10:37:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781721.1191208 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh5Bh-0006m8-4W; Thu, 22 Aug 2024 10:37:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781721.1191208; Thu, 22 Aug 2024 10:37:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh5Bh-0006m1-1n; Thu, 22 Aug 2024 10:37:05 +0000
Received: by outflank-mailman (input) for mailman id 781721;
 Thu, 22 Aug 2024 10:37:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sh5Bg-0006lt-05
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 10:37:04 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sh5Bf-0002JI-Dq; Thu, 22 Aug 2024 10:37:03 +0000
Received: from [15.248.2.26] (helo=[10.24.67.18])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sh5Bf-0003qQ-7N; Thu, 22 Aug 2024 10:37:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=3m4vTjRxGgp56ZZ8neP6PYKjEtXOY6tr6HqVR77VYHU=; b=j18Qe2/eHVTNJ+fyhK6roIXJIu
	1O2zNuGoE7FiWdHTyf6OD/wmZSeRSYYPt2Q8WjUe0ryYqWdqq9U7cSTXR+ToWwhosxd2FIcT2urF4
	cmlnwpEoQBwgefHwOZvGRVcZc58M6YvVWCLO48UyEpkj0GGGGdCuhrVNP1e3GEXhVLag=;
Message-ID: <dc95ec85-4ce8-4ca7-8c09-dbf403952822@xen.org>
Date: Thu, 22 Aug 2024 11:37:00 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4 0/4] xen: arm: Split MMU code in preparation for MPU
 work (part 2)
Content-Language: en-GB
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>
References: <20240821122503.2315844-1-ayan.kumar.halder@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20240821122503.2315844-1-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Ayan,

On 21/08/2024 13:24, Ayan Kumar Halder wrote:
> Hi,
> 
> In https://patchew.org/Xen/20231116145032.1651305-1-Henry.Wang@arm.com/, Henry has
> reorganized some of the code between the MMU specific and generic files.
> 
> In this patch serie, we address the remaining code reorg so that MMU specific
> code is cleanly separated and we have added stubs wherever necessary to avoid
> introducing if-def.
> 
> Changes from :-
> 
> v1..v2 - mentioned in individual patches.
> v3 - Reordered the patches so that first 3 can be committed (as they have been
> reviewed).
> 
> Ayan Kumar Halder (4):
>    xen: arm: Add a new helper update_boot_mapping()
>    xen: arm: Move domain_page.c to MMU specific
>    xen: arm: Enclose access to EL2 MMU specific registers under
>      CONFIG_MMU

I have committed the above 3 patches. AFAICT...

>    xen: make VMAP support in MMU system only

... this patch may require a respin and definitely needs more acks.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 10:37:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 10:37:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781728.1191217 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh5CX-0007J3-BX; Thu, 22 Aug 2024 10:37:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781728.1191217; Thu, 22 Aug 2024 10:37:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh5CX-0007Iw-91; Thu, 22 Aug 2024 10:37:57 +0000
Received: by outflank-mailman (input) for mailman id 781728;
 Thu, 22 Aug 2024 10:37:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sh5CV-0007Ik-Ez
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 10:37:55 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sh5CT-0002MP-Sl; Thu, 22 Aug 2024 10:37:53 +0000
Received: from [15.248.2.26] (helo=[10.24.67.18])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sh5CT-0003ti-Nq; Thu, 22 Aug 2024 10:37:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=oB+TY2qy4gaBrJVpY0QdAN0PNrYv98MZO8tRpIJFfrg=; b=GSxFbRwp3ZyJkZbeq/UT1HPHqs
	/94PN7svn2RcAJi4K63Az885tt9CuMnih2w2Zo+B8d3RZuhLhRWlIcSBqGGM8Q6YrgwrL7pDNCSur
	shXLOKlurfONV7ooV2vnRjoQXuGFSJichuXdPq3gzeqNxezYPUFlbVfVlYRDQt7z1Lnc=;
Message-ID: <8aba515f-4f14-4a5f-bd15-4a20717978ac@xen.org>
Date: Thu, 22 Aug 2024 11:37:52 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [EXTERNAL] Re: [PATCH v2] drivers: char: omap-uart: provide a
 default clock frequency
Content-Language: en-GB
To: Amneesh Singh <a-singh21@ti.com>
Cc: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org,
 sstabellini@kernel.org
References: <20240820082202.326644-1-a-singh21@ti.com>
 <a75c4202-1d66-45d0-be57-f29cacb6237c@amd.com>
 <edb52fc6-fc69-4670-a1bd-e3e960a6e408@xen.org>
 <qu7setyrwkh7clo7dxb5iolx2mwcpkd4n45gjthxravmw3gyeo@ged7k7khka54>
From: Julien Grall <julien@xen.org>
In-Reply-To: <qu7setyrwkh7clo7dxb5iolx2mwcpkd4n45gjthxravmw3gyeo@ged7k7khka54>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit



On 21/08/2024 06:35, Amneesh Singh wrote:
> Hello,

Hi Amneesh,

> On 10:03-20240820, Julien Grall wrote:
>> Hi,
>>
>> On 20/08/2024 10:00, Michal Orzel wrote:
>>> On 20/08/2024 10:22, Amneesh Singh wrote:
>>>>
>>>>
>>>> Quite a few TI K3 devices do not have clock-frequency specified in their
>>>> respective UART nodes. However hard-coding the frequency is not a
>>>> solution as the function clock input can differ between SoCs. So, use a
>>>> default frequency of 48MHz if the device tree does not specify one.
>>> I'd mention that this is same as Linux
>>>
>>>>
>>>> Signed-off-by: Amneesh Singh <a-singh21@ti.com>
>>>> ---
>>>>    xen/drivers/char/omap-uart.c | 8 ++++++--
>>>>    1 file changed, 6 insertions(+), 2 deletions(-)
>>>> ---
>>>> v1: https://lore.kernel.org/all/20240719113313.145587-1-a-singh21@ti.com/T/
>>>>
>>>> v1 -> v2
>>>> - Ditch adding a dtuart option
>>>> - Use a default value instead
>>>>
>>>> This default is the same one as found in the 8250_omap driver of the
>>>> linux tree. Already tested with Xen.
>>>>
>>>> diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
>>>> index 1079198..9d3d39c 100644
>>>> --- a/xen/drivers/char/omap-uart.c
>>>> +++ b/xen/drivers/char/omap-uart.c
>>>> @@ -48,6 +48,9 @@
>>>>    /* System configuration register */
>>>>    #define UART_OMAP_SYSC_DEF_CONF   0x0d   /* autoidle mode, wakeup is enabled */
>>>>
>>>> +/* default clock frequency in hz */
>>>> +#define UART_OMAP_DEFAULT_CLK_SPEED 48000000
>>> I think this should have U suffix to please MISRA 7.2
> 
> Can I count on you to add this unsigned suffix as well? Thanks.
> 
>>>
>>>> +
>>>>    #define omap_read(uart, off)       readl((uart)->regs + ((off) << REG_SHIFT))
>>>>    #define omap_write(uart, off, val) writel(val, \
>>>>                                              (uart)->regs + ((off) << REG_SHIFT))
>>>> @@ -322,8 +325,9 @@ static int __init omap_uart_init(struct dt_device_node *dev,
>>>>        res = dt_property_read_u32(dev, "clock-frequency", &clkspec);
>>>>        if ( !res )
>>>>        {
>>>> -        printk("omap-uart: Unable to retrieve the clock frequency\n");
>>>> -        return -EINVAL;
>>>> +        printk("omap-uart: Unable to retrieve the clock frequency, "
>>>> +               "defaulting to %uHz\n", UART_OMAP_DEFAULT_CLK_SPEED);
>>> Even though there is a comma, printk messages should not really be split. In such cases it's fine
>>> to exceed 80 chars limit. Or do:
>>
>> In general, we allow to exceed the limit only for the message. If there
>> are arguments then ...
>>
>>>           printk("omap-uart: Clock frequency not specified, defaulting to %uHz\n",
>>>                  UART_OMAP_DEFAULT_CLK_SPEED);
>>
>> ... this is the preferred approach. I can do the update on commit if an
>> updated commit message is provided.
> 
> Please do, thanks. You can use this as the commit message:
> 
> [quote]
> 
> Quite a few TI K3 devices do not have clock-frequency specified in their
> respective UART nodes. However hard-coding the frequency is not a
> solution as the function clock input can differ between SoCs. So, use a
> default frequency of 48MHz, which is the same as the linux default (see
> 8250_omap.c), if the device tree does not specify it.
> 
> [/quote]

Thanks for the updated commit message. I have updated it while commiting 
the patch.

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 10:53:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 10:53:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781745.1191256 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh5R2-0002dJ-U4; Thu, 22 Aug 2024 10:52:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781745.1191256; Thu, 22 Aug 2024 10:52:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh5R2-0002dC-RN; Thu, 22 Aug 2024 10:52:56 +0000
Received: by outflank-mailman (input) for mailman id 781745;
 Thu, 22 Aug 2024 10:52:56 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=wmoe=PV=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sh5R2-0002d6-CS
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 10:52:56 +0000
Received: from NAM02-DM3-obe.outbound.protection.outlook.com
 (mail-dm3nam02on20609.outbound.protection.outlook.com
 [2a01:111:f403:2405::609])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ae32b8a5-6074-11ef-8776-851b0ebba9a2;
 Thu, 22 Aug 2024 12:52:53 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by CH2PR12MB4231.namprd12.prod.outlook.com (2603:10b6:610:7d::24)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Thu, 22 Aug
 2024 10:52:47 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7875.023; Thu, 22 Aug 2024
 10:52:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ae32b8a5-6074-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=uXnKRZ8dNXvdm5G4tV7nBu1iHtQ5thwOySY3v7LAJHkF2Rn+K/+iPboCU3EhmFyy8IWH1UjtnC3AbtdM0HHMKUdAp5MiTqiAsf9etnySS4Hgx9fZbQDRGYVMB5eGpKs27VxpOBE59Mx4zscBV+L/7NbnRxcBZqVDMJIKZ/wEGqCUq4GxbqYzB5UpiaNmBJO5hmcpLz56oHnevF9vAkAXpOYjeJ7WcGVesazWdARK9PqtbFyPrkvREJAQzL7sNrsRiPibc4fdpn6L229ioyGQg63YODAVMiulYvufYjIgVhRQ/wV9i5HzvGZ3VxRdO+oclzGl+xtCKG8p0ANUaEJ7EA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=lMG8aiKz4WuD+wtermS59/pswWNOKugwWJiLeC1HqG4=;
 b=lj0bo8AY2ATLyaJTJB1OpX7vplGPo3y5d+jAYQwP2JXzFUdkgzXWLmKqr2jmeR87UT7c4t3LBMkSTsD9CvwuP85RkI1tM4a5xtvYd18Vq3nnPzyHq0bq82HbiMdNzNFmkkjHha5sbjtEHnZXHm/KMHxC/Gj4lXQkGI3cRF8a2SJSQdlZLLeaNDGep22hBPU1trvuwS0cFjsTyJFdgX8xvdTpIU6R2yCwnT0OkU7OXVsiJXXFzg5eQpEg035wQGdbCK/VuwdFANI5uBAB0M8yPEfboJB4M8Lzr8L3SL5/bDS43HUyNRlEq9dRLyzLy8+Hnnr8GBeVtm513lHWDjJXgA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=lMG8aiKz4WuD+wtermS59/pswWNOKugwWJiLeC1HqG4=;
 b=XPzlsf3FYlU9cA3mlWz3cZR43K1+dvqZc8un826ofeKxolP9FrigLM1i8l4u/e5l2D+IJjkYlgKL4dQuYJPJ5GC7eU3++bvvisvOwbfxOary6I8V/qSgtUN3wR1LjyPxWqdgiBhSqzveQ3Ja5C3E6aCUBpyurtDOWnLizxdYsrk=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <6d065949-dfae-41f8-b030-c7d09516846b@amd.com>
Date: Thu, 22 Aug 2024 11:52:39 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen: make VMAP support in MMU system only
To: Julien Grall <julien@xen.org>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
Cc: Penny Zheng <penny.zheng@arm.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Wei Chen <wei.chen@arm.com>
References: <20240821122503.2315844-1-ayan.kumar.halder@amd.com>
 <20240821122503.2315844-5-ayan.kumar.halder@amd.com>
 <cd2e6b08-ce76-4707-831a-c21b05ca85cf@xen.org>
Content-Language: en-GB
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <cd2e6b08-ce76-4707-831a-c21b05ca85cf@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0181.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:311::8) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|CH2PR12MB4231:EE_
X-MS-Office365-Filtering-Correlation-Id: 09c4b190-8a4d-477b-efc9-08dcc2988ead
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|7416014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?SHZWcjJJWUNRa0NkTkJXYTVMYllqemVLcTRNTk1JeTVpQlJrUm5HMDBTNmJD?=
 =?utf-8?B?YWlsdmRvTnJGbjFwN0xnb1BFUnRUcDZ0bko5dmJDR25nNGZrbDUxZFF1YzNL?=
 =?utf-8?B?akNQREVBZ0gyYUdiQkVIdTZ6bTlDa0U3T284NE5wSWpMcGVkcW5xdlhBNEpn?=
 =?utf-8?B?WkJ4bG5iNjZRODhyc29COXltc2VRNGoxY0FGSkhUSGRyaDBUUTJiekxWRHlP?=
 =?utf-8?B?dHVBRnZ3OTFzdTExN0Q3WGNacENXV1FMdzlWaGY2YzMzSFlpWGJRL1hLWTVR?=
 =?utf-8?B?djlGaXdzYlkyZm5tbU1TU2tGbEVuM1p5ajl0STB0bVBqZE1UVlU4ZW5qOWRQ?=
 =?utf-8?B?dUJBVjd4ajczUXphcXZIUUpUM3pWZXRLUTJqZStyRHlsNlFLS3ZxbkxQLzhB?=
 =?utf-8?B?NWhmRDNqTlN0b3JoSEFmNzZ2ZlNIYlJvRUdYRjE5YUYvb0toK25PdDkwaUcr?=
 =?utf-8?B?OWs1dG02UU5ZNnlJWDUrQ3dCSFhxMkR2bUtpWHB4QjJaY3U4V25xdVo0M01T?=
 =?utf-8?B?WGl3SmhIc0RRdHNrVDhNTEZPc2h0QUkzVHltNW5lSk9OWVh3aGE3VmFRQ2Vw?=
 =?utf-8?B?UGgzeWxlRkdORmN5aFpwa05CUytLaDRQeEIwSGtjU2VYQzc0YUc4TE5VZUl4?=
 =?utf-8?B?aW92Smo4TGlqQ0pPUitoUENJYldIU2k3NXlNRDVHWjIvZFJKaEhJV3JsWWwx?=
 =?utf-8?B?WkUwYnkyc1FvclFDRi8vblFVNXhHREo1ckpxK2VCaGhXall1U2JkUG5rb254?=
 =?utf-8?B?TmpDUHZzZTFoemE3V3FmclZ1YVVuWE5KanhTb0l0VkwxVHQzZVQ4NXV1NFNo?=
 =?utf-8?B?WWJ0YWQ0WTFTRkMveE15bUhBdmYwaTNJbTl3dDNvcU5XbmRUcC8zbVNhQnR0?=
 =?utf-8?B?b2VucTVEU3VoQTlPVTh3ckRtS29JUnVGVllpS21KaHZ0U3VaamlPNXNGdHVV?=
 =?utf-8?B?U3FiRWV4dG5QclpEODVnOCs4cGZmc0JUMEJrM3c4T3MrY25PcVcwNVY5NzRS?=
 =?utf-8?B?QWhKK3hlSmpqLy84c0F3ZUR2ZWR5WHVMd1hXSXJJQzZwQS9KVFFrZVNPcWlm?=
 =?utf-8?B?aFJCNzh5MW91UzVQajdZNUJoN0JGamowcVFmYnh0TnZCUVRvR2lYZTU3OTJJ?=
 =?utf-8?B?aEhVQXdCeEJ2SmVPN2hZM1pKTWYyVGkxOFRYby8zVytDRzJIYjlnNGltaUtY?=
 =?utf-8?B?WGRHR255aHBHR1FNM05rdUxKWjlBTXdOSDVzSlRjcUIxOHNyckZ5NlYza0pm?=
 =?utf-8?B?Y2ZlbHlqd0tablUwQ2dNOVMrVzFueGt5MDhtWmJ2WW5hU2YrUDgwOXNsSlhW?=
 =?utf-8?B?VWF0QmF4WG91d2RWME9WaFQ4bTdpMDFKa2swbXZSQm4zb2ZJYWU2dkI4anBO?=
 =?utf-8?B?bGNzM1BLc3daM1FHVFVYajVaemdscHU4dFlobGEzMkRrcVR1bVA1dklIWU9C?=
 =?utf-8?B?R1JMUUdobmdwTE8wVmxCLzJGU2hCTTB2OEJ1T3kvS3puQ0szNkV4RVVRaGFl?=
 =?utf-8?B?MTVUektPemVQU3l6azNFbDk1cnRTUjN4ZFRPWHhXRlVRV2FDYjErcmowUTE1?=
 =?utf-8?B?Rm44K2ErN0RXZ21WMnAxN0lOR01SQmF2RDNyaE84ekNZNWFSREE2anFibDFh?=
 =?utf-8?B?bm1xcGJBWjZ6N2ZaNGlXZVVjUlRoV2NWbm1xSFpqV3d3cDRWYlhITkRpaUhk?=
 =?utf-8?B?b0pDVjc1b3FGakR1R0M2Y2V5bnR0VzB2OVhTOUJJMTJqenRFdzkrK3lYa1Ft?=
 =?utf-8?Q?ynddoMbdliPzVhKRW4=3D?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(7416014)(1800799024);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?dVNhdk5GQVhjbVRteTF4RUxWTnhyczYyQ2ZPUFBUQzlNY0ZRSUpkK2JxbEVk?=
 =?utf-8?B?UCtEZGM5dzBjSmlzTFFXcDVNQXp0RDJ4TnBvdlNqVS9MZUlRRHJha0NiQ2Jx?=
 =?utf-8?B?bzRSSnR4Q2dmRGNZMkFOSDIxOHAyeFAwY3BkNjlScXZKbDMvbUx4NmhSUVpG?=
 =?utf-8?B?Rm9McXNESGlQY213NEtXUm82bWZnSHhUbmlzKzJtZ05QSkhCcXpIb2l3UEp6?=
 =?utf-8?B?Sk5Ga3VLenNFNXIvQVdIMUdoazNuK2VlOHFUbUI4U0R4b1hUdnpjeXlnczZz?=
 =?utf-8?B?NndDUmV1c1ZNbzhKdERJS2R2WjhYWFVjR0E1NysrQmhzMWFjQ2JhU2ZhdkpO?=
 =?utf-8?B?Q3NrQ3lpeVVubFZJKzNhVEJuN3c1M3ZqQ0JZS015SDNiVWxSUklmaVkzMit6?=
 =?utf-8?B?dlJ4TitRMHZsSUVicmx6UlRJdWpkcVRDNzlvVWtsUXRzbU5GNzZ0N1dFTzRL?=
 =?utf-8?B?clVmZUZuRVdYbkJyOHI0RTlyTTJHaFN2KzlhT0tMREFvVjRsTVUxR0xKSk95?=
 =?utf-8?B?SUhkOHJ5QkFBMmRMUVBsTzlWV2xhUTdwRk5kSkphZngxamVYczhqRVJzQjZj?=
 =?utf-8?B?dS9qb1ZNbjFQb1B6bkU2RCtzV21sM1U3SjBVWnNvS1pjcCtuQ2VZcHlnRkRS?=
 =?utf-8?B?Nk1kNU9LbERCanc1TFhXZjdhTkVHcDljV3BrcUhtd3lZeDlEUm1HQUo3eVdo?=
 =?utf-8?B?T1BBSkMyZDZWckovV2xUTE96UGg5SS9mUXZYRUpCdlFrSVU2eTRIYkp3YTZX?=
 =?utf-8?B?YlZRb1c3eDlmL0xDZmUvQXpURnhIOWxtUWNmVXBtMmlpTjVQbGVjOWN3am9R?=
 =?utf-8?B?azN0TU5QNXJONEtOSWVuMFl6OWI1R3NHRXVjd1k5SXVSNjJkQjhzblk1WjRp?=
 =?utf-8?B?enhUVHNNbjkycDFSNXh5MDhleW9rL2h1b0tIR3IyQ2w1T3BkWmkwdVBiUUlr?=
 =?utf-8?B?OUEzeWl0SGlVQ0s5c3FycWhpMjEwRjFhQkN0c0MyRGJ0ZkNPNVBMTGhmQXYz?=
 =?utf-8?B?cmlmKzdwME1senRRNXR2ZW5EVjdiQ2twNUJTeFZ6NlpRUG1pbHpDUFVMSXp1?=
 =?utf-8?B?aDRvbVFCb2NDUUw1SU96SnZiUTlNeWxkZ2owNzBXVEpFdHFRTTBCd3U3WWdP?=
 =?utf-8?B?ay9HR1VhMStkSUo2SFdSRGVxODVmbzBBRWJOYUNhRERuSWlwZlg4V1hzdUNL?=
 =?utf-8?B?cThPenpybGlwNGV6UWxFNkhFbmhBdndGTC9nR05tanpoaXU5Y09VdGxrWUpX?=
 =?utf-8?B?Y0tpRGhTUElhUnFXWVpMODJSdjBVcDBCOGxtS3FBUjZ4T0dCVFB0WHFCanVG?=
 =?utf-8?B?MFNkSEVMVzU1ZXZ6OFV4b0V6cy9FTUNQRS8zV09sMUJRb2s2cVFoSEFGeGNM?=
 =?utf-8?B?NHJuR0dBdlNCMjlXUWxaWi8rUGtVMHBWNWdVN2I1azRCRnN3VFBDbjRwSEhq?=
 =?utf-8?B?U3FSU2hsb2dDRXM4N1B2c2RTQWhpMEUwR09McXpTZ1ZYVlRoM1dXM3NLL3J3?=
 =?utf-8?B?VXByRXl3QnJLN25qa2xKWkhVUlZKODUwbzFmQnMveWJKTUhmTERNSzhldzEy?=
 =?utf-8?B?N1VFd2hmQngzYk5CUXZXTGlWL2hyTXEwdzlFS2pnYmVQck81L3NXdmdJbWdW?=
 =?utf-8?B?dmxmZ0Fxc2d6Mmh0dG10d3ZUOFpUY2wyV2ovbnl0dXg0SVBuMGxhZXdYQjl6?=
 =?utf-8?B?eUVwdkkxaTFNelhWcW1MdnpDWGJMUyt1RWtqT1pjak9qYU5iS0JyUjNnN1Zy?=
 =?utf-8?B?dWkzNDVmSmxodzMxTncwNVhHcnVSY0YvRzVxTnpNbWxhZGx0VkFWbCtld21Q?=
 =?utf-8?B?RjZFRFRnSmd1YlZIVkVxVC9uR0pydzB0QThXMkRKeVkzUlZIYi9OZ1FQUFl6?=
 =?utf-8?B?eEIxVW5zY3piQkJEcmNWS1RJNHhWV1NsR2praTVZek5NNkVBeXZ0Q0owcTlw?=
 =?utf-8?B?R0dYMkd5bmNWa2ZicDB0V2NiVFp1bXBUMTVVMGw2ZFZMMjdKY2x0NjBtMEFK?=
 =?utf-8?B?WHZXMzNHS0NOWUxKb3NFSkRuUmwzTEJ6RzZqRVZwanozY2NtNVNTMFB6djF1?=
 =?utf-8?B?R21vNFNtWE5WdlVNeDhrcUx1cGFNS2M2YW5sa1BOa2pRMnFrN285L015b09X?=
 =?utf-8?Q?cfKPxcnOMzFbK6tv/MKayFH+Z?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 09c4b190-8a4d-477b-efc9-08dcc2988ead
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 10:52:46.6861
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: TRSocqPkRelElQrGrzrriar+7i7UKkTvwIocUP1y3zH++G0WpjFsvpinoO2u+rcj+DG83ypWFTevb626IsFfxA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4231


On 21/08/2024 22:14, Julien Grall wrote:
> Hi Ayan,
Hi Julien,
>
> On 21/08/2024 13:25, Ayan Kumar Halder wrote:
>> From: Penny Zheng <penny.zheng@arm.com>
>>
>> Introduce CONFIG_VMAP which is selected by the architectures that use
>> MMU. vm_init() does not do anything if CONFIG_VMAP is not enabled.
>>
>> VMAP is widely used in ALTERNATIVE feature to remap a range of memory
>> with new memory attributes. Since this is highly dependent on virtual
>> address translation, we choose to fold VMAP in MMU system.
>>
>> In this patch, we introduce a new Kconfig CONFIG_HAS_VMAP, and make it
>> only support in MMU system on ARM architecture. And ALTERNATIVE now
>> depends on VMAP.
>>
>> HARDEN_BRANCH_PREDICTOR is now gated on MMU as speculative
>> attacks are not possible on non MMU based systems (ie Cortex-R52, R82).
>> See 
>> https://developer.arm.com/Arm%20Security%20Center/Speculative%20Processor%20Vulnerability.
>
> I don't have a strong opinion on whether it should be split. But I do 
> agree this deserves a bit more explanation.
>
> Also, as I mentioned before, speculative attacks may be possible on 
> non-MMU based systems. In fact some the Cortex-R are in the affected 
> list... The R82 and R52 are not listed, but note:
>
> "For information about any unlisted processors please contact Arm".
>
> So how about the following explanation:
>
> "At the moment, the users of HARDEN_BRANCH_PREDICTOR requires to use 
> the vmap() to update the exceptions vectors. While it might be 
> possible to rework the code, it is believed that speculative attackes 
> would be difficult to exploit on non-MMU because the software is 
> tightly controlled. So for now make HARDEN_PREDICTOR to depend on the 
> !MMU.

This makes sense. However, I think you mean

..... make HARDEN_BRANCH_PREDICTOR to depend on the **MMU**.

>
>>
>> Also took the opportunity to remove "#ifdef VMAP_VIRT_START .. endif"
>> from vmap.c. Instead vmap.c is compiled when HAS_VMAP is enabled. Thus,
>> HAS_VMAP is now enabled from x86, ppc and riscv architectures as all of
>> them use MMU and has VMAP_VIRT_START defined.
>>
>> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
>> Signed-off-by: Wei Chen <wei.chen@arm.com>
>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>
> With the typo pointed out by Jan:

Yes, I will use HAS_VMAP.

  I will update the commit message as below. Let me know if this makes 
sense.

```
xen: make VMAP support in MMU system only

Introduce CONFIG_HAS_VMAP which is selected by the architectures that
use MMU. vm_init() does not do anything if CONFIG_HAS_VMAP is not
enabled.

HAS_VMAP is widely used in ALTERNATIVE feature to remap a range of
memory with new memory attributes. Since this is highly dependent on
virtual address translation, we choose to fold HAS_VMAP in MMU. And
ALTERNATIVE depends on HAS_VMAP.

At the moment, the users of HARDEN_BRANCH_PREDICTOR requires to use the
vmap() to update the exceptions vectors. While it might be possible to
rework the code, it is believed that speculative attackes would be
difficult to exploit on non-MMU because the software is tightly
controlled. So for now make HARDEN_BRANCH_PREDICTOR to depend on the
MMU.

Also took the opportunity to remove "#ifdef VMAP_VIRT_START .. endif"
from vmap.c. Instead vmap.c is compiled when HAS_VMAP is enabled. Thus,
HAS_VMAP is now enabled from x86, ppc and riscv architectures as all of
them use MMU and has VMAP_VIRT_START defined.

```

- Ayan

>
> Acked-by: Julien Grall <jgrall@amazon.com>
>
> Cheers,
>


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 11:30:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 11:30:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781756.1191266 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh60i-000157-Mt; Thu, 22 Aug 2024 11:29:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781756.1191266; Thu, 22 Aug 2024 11:29:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh60i-000150-KI; Thu, 22 Aug 2024 11:29:48 +0000
Received: by outflank-mailman (input) for mailman id 781756;
 Thu, 22 Aug 2024 11:29: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=hRh8=PV=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sh60g-00014s-T6
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 11:29:47 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d3af49a5-6079-11ef-8776-851b0ebba9a2;
 Thu, 22 Aug 2024 13:29:43 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-a8666734767so87726966b.1
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 04:29:43 -0700 (PDT)
Received: from ?IPV6:2003:e5:8741:4a00:60e5:7bee:fc48:e85c?
 (p200300e587414a0060e57beefc48e85c.dip0.t-ipconnect.de.
 [2003:e5:8741:4a00:60e5:7bee:fc48:e85c])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f2a5077sm107397566b.69.2024.08.22.04.29.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 22 Aug 2024 04:29:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d3af49a5-6079-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724326182; x=1724930982; darn=lists.xenproject.org;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=4Y9CAQApsedbwydOV+2iHCqnlWuJGqk/j1F5QK8lkSk=;
        b=Nb0O0yjo8yvRVYYxJrYR7fZL23NzRhujE/KZrDyGC9drhF0XUr5QXonbJGRMtRhgJP
         rkCYAWBDeqDE77mjI7Irgj43lGiFiZ+Exp/k/Q+B9Is4WHSsFC7DhBjGXxYMZ2VJfwfw
         OlhHYSyoRjGdIHY+m31a1y3ls343ExBohS6SNCS9Mr4Lqfxp/3vYcFP9dsFtFbMIKJxq
         0qXnCTKdebYUXBGuluscxC9UhHi+vGKpBWD6elRu90P0lqCDTjzVSEfH0yoGu0Bu+jWI
         KJcNhp39QJufWlhFa+Eem25s1CLvRmpOzCiZoKCZwLlxRPjFpJ1nZoqNY6LeaxdApByO
         dYcA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724326182; x=1724930982;
        h=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=4Y9CAQApsedbwydOV+2iHCqnlWuJGqk/j1F5QK8lkSk=;
        b=wYk3kMkM3lZkCWZBbUa0yM+u0Aazbof+MXq8IHaKgoDD3kd6kdXKdzZggpsh76WxNf
         Q3v3IbRMrhhWvja64UZJYtkjSoTKaWhkXjDg8h5jH5ZSa3gX4F/8T15fQjdyVhRMmMD8
         sNUyZZ6FASmZ2Syc1eVHih4F93/qMocXpkIBXTNk1nr8jV9UhMrSgZkbG3OVFWxzGMhU
         hV9fkH8d6EgvoofMgPnEvYYrW3jGn5BKvueSaJ1G3htTGZCUawDbswjNXrNz7Q1UCAPp
         f0y0OHR2RbFQRLkuQBfCnjOqMriaAOKlqKF8tYIC5XW0HyRjQA/3pVKsIoOgPVgnKzqD
         LPpw==
X-Forwarded-Encrypted: i=1; AJvYcCU173gnZch/kwjWAijqf2OSDPaYWcHZKGBxkmohzR6+sOvppoanw9ftrvnbO+NhUuFf9pNq8h3PE+I=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyXYhGIsEr91JMs/Z9v5OXAsoTu5LqSkfaG9H9S+s0w5R7P9yt7
	5yK9hija+CFwRj4nAVDBibkDvBysiIQltW17zBHz8vp8S81MRYL8W9SnK2uZPR4=
X-Google-Smtp-Source: AGHT+IHtIa2suO2P+Jxg4VZrDHrvabAmVOEFhEArsMIFoNPxeztTm/2ks0zn0a8nw8FaqBHVwFkOgA==
X-Received: by 2002:a17:906:ee89:b0:a7a:a5ae:11ba with SMTP id a640c23a62f3a-a866f70edf5mr430377766b.50.1724326181967;
        Thu, 22 Aug 2024 04:29:41 -0700 (PDT)
Message-ID: <8d7fd92b-b71d-47fa-8684-46711f7cec31@suse.com>
Date: Thu, 22 Aug 2024 13:29:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/7] xen: introduce generic helper checking for memory
 map conflicts
To: Jan Beulich <jbeulich@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, linux-kernel@vger.kernel.org,
 x86@kernel.org
References: <20240820082012.31316-1-jgross@suse.com>
 <20240820082012.31316-3-jgross@suse.com>
 <22961690-14d0-4695-ba93-a68d2517059e@suse.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <22961690-14d0-4695-ba93-a68d2517059e@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------0p72HLI366MzTVl9iVnjjEOP"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------0p72HLI366MzTVl9iVnjjEOP
Content-Type: multipart/mixed; boundary="------------EJxvzaW62XEFNvsDb0AM0c0j";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, linux-kernel@vger.kernel.org,
 x86@kernel.org
Message-ID: <8d7fd92b-b71d-47fa-8684-46711f7cec31@suse.com>
Subject: Re: [PATCH v2 2/7] xen: introduce generic helper checking for memory
 map conflicts
References: <20240820082012.31316-1-jgross@suse.com>
 <20240820082012.31316-3-jgross@suse.com>
 <22961690-14d0-4695-ba93-a68d2517059e@suse.com>
In-Reply-To: <22961690-14d0-4695-ba93-a68d2517059e@suse.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJ3BBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AAIQkQoDSui/t3IH4WIQQ+pJkfkcoLMCa4X6CgNK6L+3cgfgn7AJ9DmMd0SMJE
 ePbc7/m22D2v04iu7ACffXTdZQhNl557tJuDXZSBxDmW/tLOwU0EWTecRBAIAIK5OMKMU5R2
 Lk2bbjgX7vyQuCFFyKf9rC/4itNwhYWFSlKzVj3WJBDsoi2KvPm7AI+XB6NIkNAkshL5C0kd
 pcNd5Xo0jRR5/WE/bT7LyrJ0OJWS/qUit5eNNvsO+SxGAk28KRa1ieVLeZi9D03NL0+HIAtZ
 tecfqwgl3Y72UpLUyt+r7LQhcI/XR5IUUaD4C/chB4Vq2QkDKO7Q8+2HJOrFIjiVli4lU+Sf
 OBp64m//Y1xys++Z4ODoKh7tkh5DxiO3QBHG7bHK0CSQsJ6XUvPVYubAuy1XfSDzSeSBl//C
 v78Fclb+gi9GWidSTG/4hsEzd1fY5XwCZG/XJJY9M/sAAwUH/09Ar9W2U1Qm+DwZeP2ii3Ou
 14Z9VlVVPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------EJxvzaW62XEFNvsDb0AM0c0j
Content-Type: multipart/mixed; boundary="------------8AUFE80Os2ns50UcQwz0MJks"

--------------8AUFE80Os2ns50UcQwz0MJks
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjAuMDguMjQgMTA6MzUsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAyMC4wOC4yMDI0
IDEwOjIwLCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KPj4gV2hlbiBib290aW5nIGFzIGEgWGVu
IFBWIGRvbTAgdGhlIG1lbW9yeSBsYXlvdXQgb2YgdGhlIGRvbTAgaXMNCj4+IG1vZGlmaWVk
IHRvIG1hdGNoIHRoYXQgb2YgdGhlIGhvc3QsIGFzIHRoaXMgcmVxdWlyZXMgbGVzcyBjaGFu
Z2VzIGluDQo+PiB0aGUga2VybmVsIGZvciBzdXBwb3J0aW5nIFhlbi4NCj4+DQo+PiBUaGVy
ZSBhcmUgc29tZSBjYXNlcywgdGhvdWdoLCB3aGljaCBhcmUgcHJvYmxlbWF0aWMsIGFzIGl0
IGlzIHRoZSBYZW4NCj4+IGh5cGVydmlzb3Igc2VsZWN0aW5nIHRoZSBrZXJuZWwncyBsb2Fk
IGFkZHJlc3MgcGx1cyBzb21lIG90aGVyIGRhdGEsDQo+PiB3aGljaCBtaWdodCBjb25mbGlj
dCB3aXRoIHRoZSBob3N0J3MgbWVtb3J5IG1hcC4NCj4+DQo+PiBUaGVzZSBjb25mbGljdHMg
YXJlIGRldGVjdGVkIGF0IGJvb3QgdGltZSBhbmQgcmVzdWx0IGluIGEgYm9vdCBlcnJvci4N
Cj4+IEluIG9yZGVyIHRvIHN1cHBvcnQgaGFuZGxpbmcgYXQgbGVhc3Qgc29tZSBvZiB0aGVz
ZSBjb25mbGljdHMgaW4NCj4+IGZ1dHVyZSwgaW50cm9kdWNlIGEgZ2VuZXJpYyBoZWxwZXIg
ZnVuY3Rpb24gd2hpY2ggd2lsbCBsYXRlciBnYWluIHRoZQ0KPj4gYWJpbGl0eSB0byBhZGFw
dCB0aGUgbWVtb3J5IGxheW91dCB3aGVuIHBvc3NpYmxlLg0KPj4NCj4+IEFkZCB0aGUgbWlz
c2luZyBjaGVjayBmb3IgdGhlIHhlbl9zdGFydF9pbmZvIGFyZWEuDQo+Pg0KPj4gU2lnbmVk
LW9mZi1ieTogSnVlcmdlbiBHcm9zcyA8amdyb3NzQHN1c2UuY29tPg0KPj4gVGVzdGVkLWJ5
OiBNYXJlayBNYXJjenlrb3dza2ktR8OzcmVja2kgPG1hcm1hcmVrQGludmlzaWJsZXRoaW5n
c2xhYi5jb20+DQo+IA0KPiBSZXZpZXdlZC1ieTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1
c2UuY29tPg0KPiANCj4gSG93ZXZlciwgc2luY2UgeW91IG1lbnRpb24gdGhlIHN0YXJ0X2lu
Zm8gYXJlYSBpdCBtYXkgYmUgd29ydGggYWRkaW5nIGhhbGYNCj4gYSBzZW50ZW5jZSB0byB0
aGUgZGVzY3JpcHRpb24gYWxzbyBtZW50aW9uaW5nIHdoeSB0aGUgaHlwZXJ2aXNvciBhbGxv
Y2F0ZWQNCj4gc3RhY2sgcGFnZSBkb2Vzbid0IG5lZWQgY2hlY2tpbmcuIEluIGZhY3QgdGhp
cyBtYXkgd2FudCB0byBleHRlbmQgdG8NCj4gaW5pdHJkIGFuZCBwaHlzLW1hY2ggbWFwIGFz
IHdlbGwsIHRvIGNvdmVyIGV2ZXJ5dGhpbmcgWGVuIHNldHMgdXAgb24gYmVoYWxmDQo+IG9m
IHRoZSBrZXJuZWwuDQoNCk9rYXkuDQoNCg0KSnVlcmdlbg0KDQo=
--------------8AUFE80Os2ns50UcQwz0MJks
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-----

--------------8AUFE80Os2ns50UcQwz0MJks--

--------------EJxvzaW62XEFNvsDb0AM0c0j--

--------------0p72HLI366MzTVl9iVnjjEOP
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/Ey8FAmbHISQFAwAAAAAACgkQsN6d1ii/Ey/u
gAgAmk/Df5hJJ/HTbzaqyhts0Uqd/yGoBNLzpwzCS87r97pgyZe7dkjd205qd5BaOmr6o1aescgz
4CPNAhkfQZNBScxW0lslSQEhXPPrN22cM7yAqnwkCG+fhG4bHadlvXdGTo0ZhdNFDaMJydYrsuQE
XbKJl6ol1ZxqoJqTm2frn1saqy9+A3F8wessMV8vU0Kolg21TW0ThCmn5Eh+5zNRhZFjd+YLFqv/
oo1jWwjRDJew5xDNkNhNY50Zk1TrYjVgDn342Ys1XRqA1WAcMa61LgrDBVFWPT3wVG/PmXuR8iXa
pHBKCdwb/PUBFKmACMezXJ93A+Pk4WKHQAEKxUXGwQ==
=jpv8
-----END PGP SIGNATURE-----

--------------0p72HLI366MzTVl9iVnjjEOP--


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 11:38:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 11:38:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781764.1191275 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh68k-0003IE-EU; Thu, 22 Aug 2024 11:38:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781764.1191275; Thu, 22 Aug 2024 11:38:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh68k-0003I7-Bx; Thu, 22 Aug 2024 11:38:06 +0000
Received: by outflank-mailman (input) for mailman id 781764;
 Thu, 22 Aug 2024 11:38:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=hRh8=PV=suse.com=jgross@srs-se1.protection.inumbo.net>)
 id 1sh68j-0003Hv-4k
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 11:38:05 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fdc8bfa7-607a-11ef-a50a-bb4a2ccca743;
 Thu, 22 Aug 2024 13:38:03 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5bec7d380caso910832a12.3
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 04:38:03 -0700 (PDT)
Received: from ?IPV6:2003:e5:8741:4a00:60e5:7bee:fc48:e85c?
 (p200300e587414a0060e57beefc48e85c.dip0.t-ipconnect.de.
 [2003:e5:8741:4a00:60e5:7bee:fc48:e85c])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a3cb0bdsm824811a12.37.2024.08.22.04.38.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 22 Aug 2024 04:38:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fdc8bfa7-607a-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724326683; x=1724931483; darn=lists.xenproject.org;
        h=in-reply-to:autocrypt:from:content-language:references:cc:to
         :subject:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=sJdmQAnQ+WjHgnIh8xPxFiV5NCA+OBzJFv7tQkP4VUs=;
        b=WTSyUuyt93ebeQ2kQxshCdzGjE3xQpF++PzDPrMdPt2/R/teibT7HaAMfI2nLMUPFM
         k76XHgohgrMNbVS2tuz3ena+bPFopAKytvgCtDsN9YJ+D1VHfNf/MheK/s1z6rjzLsfx
         e8FiwofeyLkmJLRur+StampYJkhr43yAcwIViklpIQDd8b2SnExH+EvrwV7dX7o/l7wl
         09/sVty4YU+P7tOf+IwIG9SLtVeyPLH192pSATf/0U2XE0Bd7ma2wkMcqXBVlxNvbgnH
         5XYr4zh0aAlmpuB/JI98KvJ/UVrXjPGIUn2dGiCE2AReZ97zY6VheYBcaYJ3HpD8I2KE
         3MGQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724326683; x=1724931483;
        h=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=sJdmQAnQ+WjHgnIh8xPxFiV5NCA+OBzJFv7tQkP4VUs=;
        b=wGLYa35+NMxiGpdXt1BDsrQA6W7NLrv8fnULkm3dmNtt7SkGB/nPQi8TdScpUCXtND
         9cRQ8wG+PHxWDIp61RQPA0B4nRdyD/rdzwyJ6+gJnKqe9Fsp3iOt0Ufr7vbHKjzLddhW
         CDu3uwR/WDiHT0/e1nlRmeptoXiJBL+uK9Ns0Vj0lUiePmFXq5mNgp829PhnVB2YY9S/
         W06diBtoXu0JyQ/5TpqzDSYlx69s1bniHQEw/3+h53ukZdNYGBJYlwZRMw3p/0weHni0
         8Ho0Un3eI+mN7Qy2+woGg1S6PDZGiqiKZ1UbV0kfoZw1Nw5U/EKuF50Y1qvHU3q5qJLe
         0b+w==
X-Forwarded-Encrypted: i=1; AJvYcCWEzv8SudnheUyGZqfUrJmt0R0Kvx2jAkALyvTSWcQ7sAe9vZNyMMSjL39uQe7c8+474N3QWLLrXjI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyO4YW2Zo6Xcz4tKjI5Lj6qutydkUPG9c5zVJXZeIof63LWFiiS
	pAejo0yrln8CTk09gtZAGbL3WFU+pGXI1g+xl0PRnMIBeXbSeDHc/o+6yMCXjfk=
X-Google-Smtp-Source: AGHT+IEEAPDNQM8QynTgzdLRChgmNngee/anGeB9xOhx5eDJffpAiK39fnVrLvhh95vVtman9bl6Rg==
X-Received: by 2002:a05:6402:42cf:b0:57c:a422:677b with SMTP id 4fb4d7f45d1cf-5bf1f0a3dadmr4101519a12.8.1724326682029;
        Thu, 22 Aug 2024 04:38:02 -0700 (PDT)
Message-ID: <e6095474-5000-410b-95b3-c0eeaf092042@suse.com>
Date: Thu, 22 Aug 2024 13:38:00 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 4/7] xen: move max_pfn in xen_memory_setup() out of
 function scope
To: Jan Beulich <jbeulich@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, linux-kernel@vger.kernel.org,
 x86@kernel.org
References: <20240820082012.31316-1-jgross@suse.com>
 <20240820082012.31316-5-jgross@suse.com>
 <b9556863-1536-4310-8005-f92e8948356c@suse.com>
Content-Language: en-US
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
Autocrypt: addr=jgross@suse.com; keydata=
 xsBNBFOMcBYBCACgGjqjoGvbEouQZw/ToiBg9W98AlM2QHV+iNHsEs7kxWhKMjrioyspZKOB
 ycWxw3ie3j9uvg9EOB3aN4xiTv4qbnGiTr3oJhkB1gsb6ToJQZ8uxGq2kaV2KL9650I1SJve
 dYm8Of8Zd621lSmoKOwlNClALZNew72NjJLEzTalU1OdT7/i1TXkH09XSSI8mEQ/ouNcMvIJ
 NwQpd369y9bfIhWUiVXEK7MlRgUG6MvIj6Y3Am/BBLUVbDa4+gmzDC9ezlZkTZG2t14zWPvx
 XP3FAp2pkW0xqG7/377qptDmrk42GlSKN4z76ELnLxussxc7I2hx18NUcbP8+uty4bMxABEB
 AAHNH0p1ZXJnZW4gR3Jvc3MgPGpncm9zc0BzdXNlLmNvbT7CwHkEEwECACMFAlOMcK8CGwMH
 CwkIBwMCAQYVCAIJCgsEFgIDAQIeAQIXgAAKCRCw3p3WKL8TL8eZB/9G0juS/kDY9LhEXseh
 mE9U+iA1VsLhgDqVbsOtZ/S14LRFHczNd/Lqkn7souCSoyWsBs3/wO+OjPvxf7m+Ef+sMtr0
 G5lCWEWa9wa0IXx5HRPW/ScL+e4AVUbL7rurYMfwCzco+7TfjhMEOkC+va5gzi1KrErgNRHH
 kg3PhlnRY0Udyqx++UYkAsN4TQuEhNN32MvN0Np3WlBJOgKcuXpIElmMM5f1BBzJSKBkW0Jc
 Wy3h2Wy912vHKpPV/Xv7ZwVJ27v7KcuZcErtptDevAljxJtE7aJG6WiBzm+v9EswyWxwMCIO
 RoVBYuiocc51872tRGywc03xaQydB+9R7BHPzsBNBFOMcBYBCADLMfoA44MwGOB9YT1V4KCy
 vAfd7E0BTfaAurbG+Olacciz3yd09QOmejFZC6AnoykydyvTFLAWYcSCdISMr88COmmCbJzn
 sHAogjexXiif6ANUUlHpjxlHCCcELmZUzomNDnEOTxZFeWMTFF9Rf2k2F0Tl4E5kmsNGgtSa
 aMO0rNZoOEiD/7UfPP3dfh8JCQ1VtUUsQtT1sxos8Eb/HmriJhnaTZ7Hp3jtgTVkV0ybpgFg
 w6WMaRkrBh17mV0z2ajjmabB7SJxcouSkR0hcpNl4oM74d2/VqoW4BxxxOD1FcNCObCELfIS
 auZx+XT6s+CE7Qi/c44ibBMR7hyjdzWbABEBAAHCwF8EGAECAAkFAlOMcBYCGwwACgkQsN6d
 1ii/Ey9D+Af/WFr3q+bg/8v5tCknCtn92d5lyYTBNt7xgWzDZX8G6/pngzKyWfedArllp0Pn
 fgIXtMNV+3t8Li1Tg843EXkP7+2+CQ98MB8XvvPLYAfW8nNDV85TyVgWlldNcgdv7nn1Sq8g
 HwB2BHdIAkYce3hEoDQXt/mKlgEGsLpzJcnLKimtPXQQy9TxUaLBe9PInPd+Ohix0XOlY+Uk
 QFEx50Ki3rSDl2Zt2tnkNYKUCvTJq7jvOlaPd6d/W0tZqpyy7KVay+K4aMobDsodB3dvEAs6
 ScCnh03dDAFgIq5nsB11j3KPKdVoPlfucX2c7kGNH+LUMbzqV6beIENfNexkOfxHfw==
In-Reply-To: <b9556863-1536-4310-8005-f92e8948356c@suse.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
 protocol="application/pgp-signature";
 boundary="------------NqhL8iUBds9zY3LNAUCVnaGy"

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--------------NqhL8iUBds9zY3LNAUCVnaGy
Content-Type: multipart/mixed; boundary="------------wzC2blJaBzKnJO4Y4FUmdHf0";
 protected-headers="v1"
From: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
 Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>,
 Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>,
 "H. Peter Anvin" <hpa@zytor.com>, xen-devel@lists.xenproject.org,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, linux-kernel@vger.kernel.org,
 x86@kernel.org
Message-ID: <e6095474-5000-410b-95b3-c0eeaf092042@suse.com>
Subject: Re: [PATCH v2 4/7] xen: move max_pfn in xen_memory_setup() out of
 function scope
References: <20240820082012.31316-1-jgross@suse.com>
 <20240820082012.31316-5-jgross@suse.com>
 <b9556863-1536-4310-8005-f92e8948356c@suse.com>
In-Reply-To: <b9556863-1536-4310-8005-f92e8948356c@suse.com>
Autocrypt-Gossip: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJ3BBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AAIQkQoDSui/t3IH4WIQQ+pJkfkcoLMCa4X6CgNK6L+3cgfgn7AJ9DmMd0SMJE
 ePbc7/m22D2v04iu7ACffXTdZQhNl557tJuDXZSBxDmW/tLOwU0EWTecRBAIAIK5OMKMU5R2
 Lk2bbjgX7vyQuCFFyKf9rC/4itNwhYWFSlKzVj3WJBDsoi2KvPm7AI+XB6NIkNAkshL5C0kd
 pcNd5Xo0jRR5/WE/bT7LyrJ0OJWS/qUit5eNNvsO+SxGAk28KRa1ieVLeZi9D03NL0+HIAtZ
 tecfqwgl3Y72UpLUyt+r7LQhcI/XR5IUUaD4C/chB4Vq2QkDKO7Q8+2HJOrFIjiVli4lU+Sf
 OBp64m//Y1xys++Z4ODoKh7tkh5DxiO3QBHG7bHK0CSQsJ6XUvPVYubAuy1XfSDzSeSBl//C
 v78Fclb+gi9GWidSTG/4hsEzd1fY5XwCZG/XJJY9M/sAAwUH/09Ar9W2U1Qm+DwZeP2ii3Ou
 14Z9VlVVPhcEmR/AFykL9dw/OV2O/7cdi52+l00reUu6Nd4Dl8s4f5n8b1YFzmkVVIyhwjvU
 jxtPyUgDOt6DRa+RaDlXZZmxQyWcMv2anAgYWGVszeB8Myzsw8y7xhBEVV1S+1KloCzw4V8Z
 DSJrcsZlyMDoiTb7FyqxwQnM0f6qHxWbmOOnbzJmBqpNpFuDcz/4xNsymJylm6oXiucHQBAP
 Xb/cE1YNHpuaH4SRhIxwQilCYEznWowQphNAbJtEKOmcocY7EbSt8VjXTzmYENkIfkrHRyXQ
 dUm5AoL51XZljkCqNwrADGkTvkwsWSvCSQQYEQIACQUCWTecRAIbDAAKCRCgNK6L+3cgfuef
 AJ9wlZQNQUp0KwEf8Tl37RmcxCL4bQCcC5alCSMzUBJ5DBIcR4BY+CyQFAs=

--------------wzC2blJaBzKnJO4Y4FUmdHf0
Content-Type: multipart/mixed; boundary="------------dxO4Bp0027Ss3LyctKwRJ0vD"

--------------dxO4Bp0027Ss3LyctKwRJ0vD
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: base64

T24gMjAuMDguMjQgMTA6NDQsIEphbiBCZXVsaWNoIHdyb3RlOg0KPiBPbiAyMC4wOC4yMDI0
IDEwOjIwLCBKdWVyZ2VuIEdyb3NzIHdyb3RlOg0KPj4gSW5zdGVhZCBvZiBoYXZpbmcgbWF4
X3BmbiBhcyBhIGxvY2FsIHZhcmlhYmxlIG9mIHhlbl9tZW1vcnlfc2V0dXAoKSwNCj4+IG1h
a2UgaXQgYSBzdGF0aWMgdmFyaWFibGUgaW4gc2V0dXAuYyBpbnN0ZWFkLiBUaGlzIGF2b2lk
cyBoYXZpbmcgdG8NCj4+IHBhc3MgaXQgdG8gc3ViZnVuY3Rpb25zLCB3aGljaCB3aWxsIGJl
IG5lZWRlZCBpbiBtb3JlIGNhc2VzIGluIGZ1dHVyZS4NCj4+DQo+PiBSZW5hbWUgaXQgdG8g
aW5pX25yX3BhZ2VzLCBhcyB0aGUgdmFsdWUgZGVub3RlcyB0aGUgY3VycmVudGx5IHVzYWJs
ZQ0KPj4gbnVtYmVyIG9mIG1lbW9yeSBwYWdlcyBhcyBwYXNzZWQgZnJvbSB0aGUgaHlwZXJ2
aXNvciBhdCBib290IHRpbWUuDQo+Pg0KPj4gU2lnbmVkLW9mZi1ieTogSnVlcmdlbiBHcm9z
cyA8amdyb3NzQHN1c2UuY29tPg0KPj4gVGVzdGVkLWJ5OiBNYXJlayBNYXJjenlrb3dza2kt
R8OzcmVja2kgPG1hcm1hcmVrQGludmlzaWJsZXRoaW5nc2xhYi5jb20+DQo+IA0KPiBSZXZp
ZXdlZC1ieTogSmFuIEJldWxpY2ggPGpiZXVsaWNoQHN1c2UuY29tPg0KPiANCj4gSSB3b25k
ZXIgdGhvdWdoIHdoeSAuLi4NCj4gDQo+PiBAQCAtNzEyLDkgKzcxMyw5IEBAIGNoYXIgKiBf
X2luaXQgeGVuX21lbW9yeV9zZXR1cCh2b2lkKQ0KPj4gICAJaW50IG9wOw0KPj4gICANCj4+
ICAgCXhlbl9wYXJzZV81MTJnYigpOw0KPj4gLQltYXhfcGZuID0geGVuX2dldF9wYWdlc19s
aW1pdCgpOw0KPj4gLQltYXhfcGZuID0gbWluKG1heF9wZm4sIHhlbl9zdGFydF9pbmZvLT5u
cl9wYWdlcyk7DQo+PiAtCW1lbV9lbmQgPSBQRk5fUEhZUyhtYXhfcGZuKTsNCj4+ICsJaW5p
X25yX3BhZ2VzID0geGVuX2dldF9wYWdlc19saW1pdCgpOw0KPj4gKwlpbmlfbnJfcGFnZXMg
PSBtaW4oaW5pX25yX3BhZ2VzLCB4ZW5fc3RhcnRfaW5mby0+bnJfcGFnZXMpOw0KPiANCj4g
Li4uIHRoaXMgY2FuJ3QgYmUganVzdA0KPiANCj4gCWluaV9ucl9wYWdlcyA9IG1pbih4ZW5f
Z2V0X3BhZ2VzX2xpbWl0KCksIHhlbl9zdGFydF9pbmZvLT5ucl9wYWdlcyk7DQoNCkkganVz
dCBkaWQgYSBtZWNoYW5pY2FsIGNoYW5nZSBmb3IgYWxsIHVzZXMgb2YgbWF4X3Bmbi4NCg0K
SSBhZ3JlZSB0aGF0IHlvdXIgc3VnZ2VzdGlvbiBpcyBhbiBpbXByb3ZlbWVudCwgc28gSSds
bCBtb2RpZnkgdGhlDQpjb2RlLg0KDQoNCkp1ZXJnZW4NCg0K
--------------dxO4Bp0027Ss3LyctKwRJ0vD
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-----

--------------dxO4Bp0027Ss3LyctKwRJ0vD--

--------------wzC2blJaBzKnJO4Y4FUmdHf0--

--------------NqhL8iUBds9zY3LNAUCVnaGy
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/Ey8FAmbHIxgFAwAAAAAACgkQsN6d1ii/Ey8Q
bAf/UX/4UYiZGWLLExUMGhZ+o7wu/C+KnP8TCv09jKrI3O8Pe3ha/5iXuElbqTEiVYOHAboHlqbL
3Gy2GN8lOri7qr0QDVWvqB9tfW1vKsiH2qJHqvSb1DTjed6q7877fUj1Gnoz8HgECeRzfhs9b9JD
URLpB/JigCy0JMBNKSpyCcuuW4g7NP9hkc5B4hc25Jvfaq3v1T5oaFWLm0QnDWTe2QUdH+X6ibJa
9qWfQkGuXzYu0ccZSrZn3AG1zimiAMzeNdJvO2t72JrEMRBYqKLMWmC7Vke33syC4KtI0Az21Pv1
FIUqPrvvHF3L4ERUSsDGk1btpDe5OPOl4JrXsGeedg==
=TOAm
-----END PGP SIGNATURE-----

--------------NqhL8iUBds9zY3LNAUCVnaGy--


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 11:50:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 11:50:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781775.1191286 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh6K7-0005bB-HN; Thu, 22 Aug 2024 11:49:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781775.1191286; Thu, 22 Aug 2024 11:49:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh6K7-0005b4-Ei; Thu, 22 Aug 2024 11:49:51 +0000
Received: by outflank-mailman (input) for mailman id 781775;
 Thu, 22 Aug 2024 11:49: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=MXyx=PV=bounce.vates.tech=bounce-md_30504962.66c725d9.v1-0f947c44c4d94d9d9335899c79aa1e1a@srs-se1.protection.inumbo.net>)
 id 1sh6K5-0005ay-N0
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 11:49:50 +0000
Received: from mail187-32.suw11.mandrillapp.com
 (mail187-32.suw11.mandrillapp.com [198.2.187.32])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a0eb2809-607c-11ef-8776-851b0ebba9a2;
 Thu, 22 Aug 2024 13:49:47 +0200 (CEST)
Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail187-32.suw11.mandrillapp.com (Mailchimp) with ESMTP id
 4WqM215YJvzQXg2Tt
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 11:49:45 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 0f947c44c4d94d9d9335899c79aa1e1a; Thu, 22 Aug 2024 11:49:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a0eb2809-607c-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724327385; x=1724587885;
	bh=ZA17f1S0xh474klSHRWhphEjMExcKVpp8/NwXf9cn88=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=AejLW1Dfvj7kJUF6GaQGrSlDaK033I1hU5TAm1kivVPbBzJQ4iLkN1zB1fBNz7ZH1
	 Gcxg+fEtkYnqq/hj1zdkaG4srvfC9CdFpYJWx5XnxS5VkAOJkYGQe2y+IELzBbazCs
	 msETLE3FRVC3owyFcQV6nK9O9p25L1Wc/J9rGjQGtCqYA2Ap+KYVZ3XQTafXeBAb2I
	 yfChPN3DLMq99EJIYQnFhEHjFw50q60bs8wUdDp3F34OVeEOhVq0ZindZ/w55D73Gx
	 8948TfQPjgAOm1lWRBLBX0ZGl+JMQj7gRgtwjd2GPpesX5gEnJkT0inAjmr+QLYQa4
	 XEObY0v1UAtOA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724327385; x=1724587885; i=anthony.perard@vates.tech;
	bh=ZA17f1S0xh474klSHRWhphEjMExcKVpp8/NwXf9cn88=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=SShwAOcAx9xVlt0I/NXE5aPTFLHyC6EGOVSKnSQga0W7WUVrx5jM20xXx1AAP1qJK
	 hWhBZjO0IWW/JbaCx0U0s9Ya0TkygU9Gbc6fxNfmj5hQOJY+isalplBUbydNuuIS5D
	 L+etL47nWkY5DSS/Ziuhzj6Knd/QotKffjIX2aAaZgukQ/rreDBBD1EkvOf1AzT6kG
	 Yl1GoAdqjiCzu7GUDkwp6Ekw58npFxDwWWzxYtSPt2wBw675lLqJCf3XHIUKKC8sKM
	 SayT/vx/mzq9fF8W0HVgIyje4wxtja6m8F4SIWQ/xRQ8xodwrdSfC09U8zi27Z9cdh
	 RNmsJQ5eU1FWw==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=20v1=202/4]=20ocaml/libs:=20Implement=20a=20dynamically-loaded=20plugin=20for=20Xenctrl.domain=5Fgetinfo?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724327384746
To: Andrii Sultanov <andrii.sultanov@cloud.com>
Cc: xen-devel@lists.xenproject.org, Christian Lindig <christian.lindig@citrix.com>, David Scott <dave@recoil.org>
Message-Id: <Zscl2DITQS9T6Sg9@l14>
References: <cover.1724314239.git.andrii.sultanov@cloud.com> <6d4b94939c8910ffd7d70301b1d26c828f72ad86.1724314239.git.andrii.sultanov@cloud.com>
In-Reply-To: <6d4b94939c8910ffd7d70301b1d26c828f72ad86.1724314239.git.andrii.sultanov@cloud.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.0f947c44c4d94d9d9335899c79aa1e1a?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240822:md
Date: Thu, 22 Aug 2024 11:49:45 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Thu, Aug 22, 2024 at 10:06:03AM +0100, Andrii Sultanov wrote:
> diff --git a/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/Makefile b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/Makefile
> new file mode 100644
> index 0000000000..eae44f8326
> --- /dev/null
> +++ b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/Makefile
> @@ -0,0 +1,38 @@
[...]
> +.PHONY: install
> +install: $(LIBS) META
> +	$(INSTALL_DIR) $(DESTDIR)$(LIBEXEC_BIN)/xenctrl_plugin
> +	$(INSTALL_PROG) domain_getinfo_v1.cmxs $(DESTDIR)$(LIBEXEC_BIN)/xenctrl_plugin

Is there any reason to put that new library in "/usr/libexec"?
It doesn't seems like a good place for it, and using "/usr/lib" instead
seems better.
libexec is mostly for binary, according to
    https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html

It seems that location for ocaml libs is in $(OCAMLDESTDIR), any reason
to deviate from that?

Also, on the following patch, "XEN_CTRL_DOMAININFO_PLUGIN" is
introduced. If that value is still useful, it would be better to use it
at installation time as well.

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 12:00:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 12:00:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781786.1191296 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh6UQ-0000Rc-OR; Thu, 22 Aug 2024 12:00:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781786.1191296; Thu, 22 Aug 2024 12:00:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh6UQ-0000RV-Km; Thu, 22 Aug 2024 12:00:30 +0000
Received: by outflank-mailman (input) for mailman id 781786;
 Thu, 22 Aug 2024 12:00:29 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sh6UP-0000R9-92; Thu, 22 Aug 2024 12:00:29 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sh6UO-0003ta-Cx; Thu, 22 Aug 2024 12:00:28 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sh6UN-0000Jx-QY; Thu, 22 Aug 2024 12:00:27 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sh6UN-0003gU-Pi; Thu, 22 Aug 2024 12:00:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=+o4NF+NQZ+usyWPOaatJhqlHakjghZn+reHBBYw7+VY=; b=sJx69aFJ5alMpf9LryUIWT4Bs4
	QQ2xKU04s4eDmh7w8xkAfMKMIxDwHxrFeCuo1EjcRn74yDJaE209P4rzMsqqCalMAw7ag7GUhnpDP
	RXr+II0RAcgEKSZJTJkVyJJzZSwMkJN2Amr7Sbgz9oXEld1o0iUiOC3sMZzYCMLteXe8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187306-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187306: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=a30d438ce58b70c5955f5d37f776086ab8f88623
X-Osstest-Versions-That:
    xen=a30d438ce58b70c5955f5d37f776086ab8f88623
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 22 Aug 2024 12:00:27 +0000

flight 187306 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187306/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187293
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187297
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187297
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187297
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187297
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187297
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  a30d438ce58b70c5955f5d37f776086ab8f88623
baseline version:
 xen                  a30d438ce58b70c5955f5d37f776086ab8f88623

Last test of basis   187306  2024-08-22 01:54:22 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 12:18:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 12:18:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781806.1191306 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh6lx-0003UY-75; Thu, 22 Aug 2024 12:18:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781806.1191306; Thu, 22 Aug 2024 12:18:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh6lx-0003UR-4Q; Thu, 22 Aug 2024 12:18:37 +0000
Received: by outflank-mailman (input) for mailman id 781806;
 Thu, 22 Aug 2024 12:18:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=67fr=PV=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1sh6lv-0003UL-Q6
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 12:18:36 +0000
Received: from EUR05-DB8-obe.outbound.protection.outlook.com
 (mail-db8eur05on2061b.outbound.protection.outlook.com
 [2a01:111:f400:7e1a::61b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a602e163-6080-11ef-a50a-bb4a2ccca743;
 Thu, 22 Aug 2024 14:18:33 +0200 (CEST)
Received: from AM6P194CA0108.EURP194.PROD.OUTLOOK.COM (2603:10a6:209:8f::49)
 by DU4PR08MB11103.eurprd08.prod.outlook.com (2603:10a6:10:574::11) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.15; Thu, 22 Aug
 2024 12:18:30 +0000
Received: from AM2PEPF0001C708.eurprd05.prod.outlook.com
 (2603:10a6:209:8f:cafe::b4) by AM6P194CA0108.outlook.office365.com
 (2603:10a6:209:8f::49) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19 via Frontend
 Transport; Thu, 22 Aug 2024 12:18:30 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM2PEPF0001C708.mail.protection.outlook.com (10.167.16.196) with
 Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7897.11
 via Frontend Transport; Thu, 22 Aug 2024 12:18:30 +0000
Received: ("Tessian outbound 97d928cc87dc:v403");
 Thu, 22 Aug 2024 12:18:29 +0000
Received: from L7b72416bde63.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 159A6557-A8AF-402E-8392-CEF02D4EF92E.1; 
 Thu, 22 Aug 2024 12:17:41 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id
 L7b72416bde63.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 22 Aug 2024 12:17:41 +0000
Received: from DB9PR08MB6588.eurprd08.prod.outlook.com (2603:10a6:10:25a::24)
 by GV1PR08MB8036.eurprd08.prod.outlook.com (2603:10a6:150:97::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.10; Thu, 22 Aug
 2024 12:17:37 +0000
Received: from DB9PR08MB6588.eurprd08.prod.outlook.com
 ([fe80::a8fc:ea0d:baf1:23a]) by DB9PR08MB6588.eurprd08.prod.outlook.com
 ([fe80::a8fc:ea0d:baf1:23a%3]) with mapi id 15.20.7897.014; Thu, 22 Aug 2024
 12:17:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a602e163-6080-11ef-a50a-bb4a2ccca743
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=CZzk82CdaWDBETp9q5D9QzmfRFiIjGX6nI1x68zYVcaoJ5/ZJIuBhUaIFjXadwgGc6w9fiq2iC4KIWq71ax6LyX3H9rHnEFOUFPeu2J2p3/FlCHPGah9G29PQ9tBunEI2EyFjHJ92ASQwwDXyY66EH57xHicGBu7hFfCOJbNbuv8SGbIbEm+lQGo4q7fEFszTH/EOhBiyv2kWhxw+YOLVpQgb+rnV3YI+U+C3MPfyE8iPVGogkmCA7PK60LJOAlzjrm3dBE7Rq53k4RlgrO590IKC14LtMXyBtUsfrYg5sm31BEekLU50wHxWxfP4uaThTbYai/sKaL4Oc0Rsb74tw==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+PhfxDYE2y3eHFdalA+urk2TWj5lmYocivuEZVEK3Zk=;
 b=d0TLhOFscV4D61IgFv4sIN1xqkeXtAtQVpFXKly1tPfEhEPtxWBcszYF4fty+AXOWdE1wFiqc7Mtq9f64vVHbo2ZXhtV1GgJLA9g9olcl+ZCXjyOqRGQOBGQuxyVpYaa6e8jpGS/w7+fOwZnM47MYoR7wE/8y3BVwtulYpem1VZsx512SfmZtZ7Y5onuhEu9Q7+fQymJVz+hRQMKp6pPLg+dMavQz+/r8Gh9DSwf2hrOi8qgV4+EtJLhtvYsQNHXHKLZOknpOMzNVcF0cTcpDc3O2UP1bjsFrCepCH89InFn9pCHVy9ZBJlNQforxVW49G+fS0yhK4bVyKMi6fdetg==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com;
 dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com;
 dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+PhfxDYE2y3eHFdalA+urk2TWj5lmYocivuEZVEK3Zk=;
 b=LgaAhCaIcNNWQJMx2JXK1kE+9hXyp4z2SMv4FxbvZbeHFJgB8qgyiPyZWlg3nNGpiCpxX6e7uHnh53p1NsHqesqNsTiAV2h5JgF2jrUmszlBSwqnBgRSCmP0uDr76a5o77qO4AgUcvVA7YStjD7WjGmnbVRjMm17ABrNqMKBNXY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 13a6de6946a53b83
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Nqj6OIqHeip1vUnHnGU3uGqxZJ9xbR25rRERdfokdSVdkTrTZ5KlgCSoKXoYJcNVPe2AU9kjpmVnSaZ1dAG9mQv0ccLsLK/qlbzk0+Q/aCBkJY6x5qaTiPV4F/mlqKepfTlAsjnq8fNJIyELsGEJak6ViSVDpo8F8KafK1T2sLhakxkZV0Io41h1JBiNSQKwaIltOvxau3mAHzsSoBMnUoCz9sAGTbGYvtNB496ri7FKuYOoHdBkNw7Oc7yCvNsCfLxmDsWuuYP7RBQs4niVTVz9B1fMRCe6zaYQ5dimlQQ/CJhOj3i+aJtGvB0T6ql5q6o6w4cul3TeOgDOH821WQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+PhfxDYE2y3eHFdalA+urk2TWj5lmYocivuEZVEK3Zk=;
 b=udRzVqjNHeFitLcJX0Q9+ONet9XWgX0qfbkJZhtCnhz5oT0+sfZCMRa3TStJiySRlcT8nxcBkBW28XceqRqMMyzu2Dh9FX9nD2wcE9Y6qhGjadfhjgDXmIiJt+a8tGFqbDEO/QUYtVmCE9uBX6tZDh+cs9modPGuTwBzluY0zAWiQitnaeRwy3pslAszXV0FSkgi6I24jgtuqAjoJkpN8x6nsFcXPeta00mA3fKposXAHMxcekm5yEiT8SWi5wImqVO8Ub7bcdNC21sdZdoZNUmwG1gTU6O2NBkEgMo7+GedzTdCnq5Xi2GavQE4qTQvAe5HyknIWwVyNgTVREWAOg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+PhfxDYE2y3eHFdalA+urk2TWj5lmYocivuEZVEK3Zk=;
 b=LgaAhCaIcNNWQJMx2JXK1kE+9hXyp4z2SMv4FxbvZbeHFJgB8qgyiPyZWlg3nNGpiCpxX6e7uHnh53p1NsHqesqNsTiAV2h5JgF2jrUmszlBSwqnBgRSCmP0uDr76a5o77qO4AgUcvVA7YStjD7WjGmnbVRjMm17ABrNqMKBNXY=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Michal Orzel <michal.orzel@amd.com>
CC: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, Xen-devel
	<xen-devel@lists.xenproject.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Artem Mygaiev <artem_mygaiev@epam.com>
Subject: Re: [PATCH] docs: fusa: Add requirements for generic timer
Thread-Topic: [PATCH] docs: fusa: Add requirements for generic timer
Thread-Index: AQHa8u0jnfgC5boSJE+t9AfK5MrS+7Ix0ZQAgAEsHYCAADb0AA==
Date: Thu, 22 Aug 2024 12:17:37 +0000
Message-ID: <D3358591-F9E2-44A6-A22A-FC2AA8857C68@arm.com>
References: <20240820103816.1661102-1-ayan.kumar.halder@amd.com>
 <5F0AF572-3437-4372-96EB-42F46B3A3155@arm.com>
 <101a7105-5638-4c69-a5b0-29c252284aea@amd.com>
In-Reply-To: <101a7105-5638-4c69-a5b0-29c252284aea@amd.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3774.600.62)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	DB9PR08MB6588:EE_|GV1PR08MB8036:EE_|AM2PEPF0001C708:EE_|DU4PR08MB11103:EE_
X-MS-Office365-Filtering-Correlation-Id: e6ced3d6-df10-4aa9-0cc5-08dcc2a488a2
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|376014|366016|1800799024|38070700018;
X-Microsoft-Antispam-Message-Info-Original:
 =?us-ascii?Q?D2jmwXDBo+MJdH1XsB7xwLw3+lmvcKJPeOReOA9kT78lDRcGRbr/gEnxUTaq?=
 =?us-ascii?Q?w+JLfFXd3WmOJs4mZqcvg10PR6lN5AzGVDpyzsc3j2+NGwbHFEG24pgkKY6S?=
 =?us-ascii?Q?w776tPAYPE8jzO8dQJ9+6yJcrlB+ID86CE88e+EQlA2kCIEYRl9oNHCTJBpX?=
 =?us-ascii?Q?zFDLbRDm/d2OLYeH18Ivj5CAmKeRp6BZ2agrhQ3iD0mBwVKEQ9bTgyRR8pRa?=
 =?us-ascii?Q?DonTAYCYT1IlRgB1clZUHQNjEHggz9d6ByqvfO4zGtcj8G36YJuMjlR7Pntk?=
 =?us-ascii?Q?NhfnFj6uBinTojp7IFnYpJXHASdDG037FbQy+vXTQBrybKJ4fQWpkoJhVoMz?=
 =?us-ascii?Q?yI1xokkgxzh8LML/CLdyNjwdqJaMvf29aM51vaJAT7jJrM9SZa0Jjo+1kBaj?=
 =?us-ascii?Q?UrH2Gj6ix+PBJnKHfh4gs/uKjUwo6l2GE8A4jz3SI1qhUkqzRL76SHjkaM4l?=
 =?us-ascii?Q?VI2TN2YDEFG6TGZBVXNNdkJuR2OHiHlIydR12bIBw0CFNyseh84Dsq0cz/Ir?=
 =?us-ascii?Q?/+KBhXoJC0FMyxkb2RM76KJwdlkqRS5jOTcuiqXmrOMMhUtH52khI9Ej6z+i?=
 =?us-ascii?Q?kwOsFS/6gbsBBqGswEHlHC+KzFy5tjHKIZv4IS90kds5Ph4kw9bWQPhEHBwH?=
 =?us-ascii?Q?XLO00LOvI1p5uWhLn2QSRTjw3/Q68moEZ/Rtv3B2R3fQu4wxFmKrDbhtSjtp?=
 =?us-ascii?Q?99W714qmifQuuU+k6ydvIRbNCdpAkiVzG6edmhKrCKXimr06Mo6BZlnDgnHq?=
 =?us-ascii?Q?UhUvEpIYxEp2xcC2PWiPdJXGseiZRbupTAMazq0EwRYr2noCEBRkiGE8RC2+?=
 =?us-ascii?Q?LgCejqyOpuX+ua93MQApLSnDrsgpL1wbekKb/fz+WDDboEghAeo9LmFMg68e?=
 =?us-ascii?Q?REM+3Ur+Ud0cy6+kMdluePUTCKGFPvzhJR0KLwHuWhrHRaG2WEUZyxb1P0FE?=
 =?us-ascii?Q?97qbcy0/Zbha5E87rr+PFf6rCLKBMww15Eb2qmFOQFUbnrx3fcLpdFXKgi/T?=
 =?us-ascii?Q?QngEjQ6jKTbRPYAnMvl6UgSwNiC6jy/YAd/OHLHGUsyLxsMZQ9fd31g7ViLt?=
 =?us-ascii?Q?JYpPTuK2vMd3C0B9gIFUHCRr4xsG+kNDnI8oJCtcyyR8UcjDDEm76rtZk3M7?=
 =?us-ascii?Q?cHtLRTCiAgySkgW4DqCsl4sUqmtpDxh/HAhvJTxwKyK+9wuG9MDN9tOktofb?=
 =?us-ascii?Q?DERG3TkIN/eyBUOeXM21bzS00O61PpiEyKqVflAPbXNUx9+zxPR9LkxH0/Vz?=
 =?us-ascii?Q?SYLLDbOSwQ3ShwXnK0fA6L1YsYmV4w8CPNqoJXdvtuFqvnEpPNlItRL9Yb1t?=
 =?us-ascii?Q?YwuzDg8A+9YxQnnT0/dFHcJbtiaWSlBlEgWTT9ZnuYS1u4wdcZmyMqtgjnay?=
 =?us-ascii?Q?PAe0Rq+JYsJX0tP2BD4NigZX6JanXVa9DufZ9TRWjwE4yUBngw=3D=3D?=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR08MB6588.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024)(38070700018);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <3148DD46C6BBF94896C240A1BBE97C5D@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8036
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-SkipListedInternetSender:
 ip=[2603:10a6:10:25a::24];domain=DB9PR08MB6588.eurprd08.prod.outlook.com
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM2PEPF0001C708.eurprd05.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	7b22d52c-68f5-43be-cb91-08dcc2a468ef
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|82310400026|376014|1800799024|35042699022;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?biEN6jZmVCHHZfp3rmlnZNcQyM9krga2UFGwrwtzAxrcUEBsdGr8GWsF6pa9?=
 =?us-ascii?Q?kCZDWwWXTxlgjeDqDSn8o7OKbLjaz616eKt7xAgP/S88acKMPP/FTaTf01eL?=
 =?us-ascii?Q?H4sF1NRBjlA9Z3fbyOOT9PyF50Rff2g5Vn8YBpXCsGw4gJ8pd5Am46WWoTZo?=
 =?us-ascii?Q?xqAAkkwkQfyAGgHsNSbQy+WA2ssp4UlVuIlKWpLqsRqT0b33zEv/9n/G+b3O?=
 =?us-ascii?Q?Uk/GGRCmDRn32JWk6Mg3wtXHWcrG6Mb5ucgyCzgJ7bdqkbnshmmttsEPPM+I?=
 =?us-ascii?Q?wOqn+tqsQhP7WE2eFWGrMc3H31j+Gu5OUZUdlryUHR8vvK+vjBDcgIeS93dn?=
 =?us-ascii?Q?6QJeS42GhtUO3rl/qcveqiM+0L6jCg+6wp0x/0Lqg1jueWa6Cf0hyVvYzHRz?=
 =?us-ascii?Q?jjvzEEhW9HM8QccDJIiZyMgi5LDqyYZLrYp3vbj7EzxqjWU5y/XzeZ1IOBub?=
 =?us-ascii?Q?kUhf0hxHQeuFhatxRDYVGis0ZtZjQMLzHr640JVK/e7DsQo6oBtx3vqwrAkQ?=
 =?us-ascii?Q?9sxgR3UagAG8zxTImCaQi1yq2r8Gaz9XNE84RSBKY98/RYhOUjyPwT3BaUrZ?=
 =?us-ascii?Q?5rdHr52qUC61GcfCldJQyhPb0MZGILWglt+r/7ufY/HKw1Oz8bglT+yLFLMo?=
 =?us-ascii?Q?D5plOLWK3AzitninjdkXJRUl96BVH4+toiHNlllItK0HLmfiJBM29ZTcjbb+?=
 =?us-ascii?Q?XeoTVeGE7Nlk6QnZ93rE02aAtFiX3iMgRzBQh6Ee6/kubbFCA/QRZvE9uFgN?=
 =?us-ascii?Q?5vtdjyfRZPz9jZiiceHaUwpDBzWsuxSbn7ZBMmC8lLvnKS7knbNzi9cQrx31?=
 =?us-ascii?Q?cRfyl6ZJBQui15ncdkWjlAJ/f/MOs/8jitBHSp1pg968yKfXUV0ZjkPX0JOU?=
 =?us-ascii?Q?gH7AkEoCUHh3ZWT099YSK6BlOoIOgLzuQBAKzeVKsZQu5XP2gZ/JcDK1YBW0?=
 =?us-ascii?Q?sJEs7R4dFAjIyLyuOwJeU/JF/9d62EYQGuRzRk3yoHNkwTH7PuRDCVYy68Pd?=
 =?us-ascii?Q?QtH7jsQw/um8xh9AbduGGPmULHUo4yjwSnT0fwhQ5EHpa8ahroUPYCro3l8r?=
 =?us-ascii?Q?ara3BCJb19gur0nXSw64416ebfZl4OEVMnZfvdF6mOlyc8neeAvlwgT3VTsf?=
 =?us-ascii?Q?bbKWk2mPmtWAP6cFFF0wreWf65faPJp1W4XLMIFBRq0W22wC9p4E+UADN8Ei?=
 =?us-ascii?Q?zkqr10gz9Tu2TILS0Yx7EfZX28u9HY8G1+Gi3MqauWOnIMRznl1oANYyw+ps?=
 =?us-ascii?Q?vT4P3fuurdQyUoD7gdyxb19IwgRKKYXg8aNiuO5w2TYJiS+TWTAAQZfcraU/?=
 =?us-ascii?Q?yQB4zfAs0tloRHlpaiV7spBr+EtNYfMKyavSljgnfKnRslQcNmpinEYhBsck?=
 =?us-ascii?Q?hIkNLrKKolXmY3LwKYo88btL0jL+jg9drrYdUMmDl0GHW+mQ+3t6Ze9ydM2b?=
 =?us-ascii?Q?aa+5xu6XMrTkeunnvVSfp2OCEJeLbVu/?=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(376014)(1800799024)(35042699022);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Aug 2024 12:18:30.1889
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: e6ced3d6-df10-4aa9-0cc5-08dcc2a488a2
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM2PEPF0001C708.eurprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR08MB11103

Hi Michal,

> On 22 Aug 2024, at 11:00, Michal Orzel <michal.orzel@amd.com> wrote:
>=20
> Hi Bertrand,
>=20
> I agree with all your comments with a few exceptions, as stated below.
>=20
> On 21/08/2024 17:06, Bertrand Marquis wrote:
>>=20
>>=20
>> Hi Ayan,
>>=20
>>> On 20 Aug 2024, at 12:38, Ayan Kumar Halder <ayan.kumar.halder@amd.com>=
 wrote:
>>>=20
>>> From: Michal Orzel <michal.orzel@amd.com>
>>>=20
>>> Add the requirements for the use of generic timer by a domain
>>>=20
>>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>>> ---
>>> .../reqs/design-reqs/arm64/generic-timer.rst  | 139 ++++++++++++++++++
>>> docs/fusa/reqs/index.rst                      |   3 +
>>> docs/fusa/reqs/intro.rst                      |   3 +-
>>> docs/fusa/reqs/market-reqs/reqs.rst           |  34 +++++
>>> docs/fusa/reqs/product-reqs/arm64/reqs.rst    |  24 +++
>>> 5 files changed, 202 insertions(+), 1 deletion(-)
>>> create mode 100644 docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
>>> create mode 100644 docs/fusa/reqs/market-reqs/reqs.rst
>>> create mode 100644 docs/fusa/reqs/product-reqs/arm64/reqs.rst
>>>=20
>>> diff --git a/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst b/docs/=
fusa/reqs/design-reqs/arm64/generic-timer.rst
>>> new file mode 100644
>>> index 0000000000..bdd4fbf696
>>> --- /dev/null
>>> +++ b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
>>> @@ -0,0 +1,139 @@
>>> +.. SPDX-License-Identifier: CC-BY-4.0
>>> +
>>> +Generic Timer
>>> +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>> +
>>> +The following are the requirements related to ARM Generic Timer [1] in=
terface
>>> +exposed by Xen to Arm64 domains.
>>> +
>>> +Probe the Generic Timer device tree node from a domain
>>> +------------------------------------------------------
>>> +
>>> +`XenSwdgn~arm64_generic_timer_probe_dt~1`
>>> +
>>> +Description:
>>> +Xen shall generate a device tree node for the Generic Timer (in accord=
ance to
>>> +ARM architected timer device tree binding [2]).
>>=20
>> You might want to say where here. The domain device tree ?
>>=20
>>> +
>>> +Rationale:
>>> +
>>> +Comments:
>>> +Domains shall probe the Generic Timer device tree node.
>>=20
>> Please prevent the use of "shall" here. I would use "can".
>> Also detect the presence of might be better than probe.
>>=20
>>> +
>>> +Covers:
>>> + - `XenProd~emulated_timer~1`
>>> +
>>> +Read system counter frequency
>>> +-----------------------------
>>> +
>>> +`XenSwdgn~arm64_generic_timer_read_freq~1`
>>> +
>>> +Description:
>>> +Xen shall expose the frequency of the system counter to the domains.
>>=20
>> The requirement would need to say in CNTFRQ_EL0 and in the domain device=
 tree xxx entry.
>>=20
>>> +
>>> +Rationale:
>>> +
>>> +Comments:
>>> +Domains shall read it via CNTFRQ_EL0 register or "clock-frequency" dev=
ice tree
>>> +property.
>>=20
>> I do not think this comment is needed.
>>=20
>>> +
>>> +Covers:
>>> + - `XenProd~emulated_timer~1`
>>> +
>>> +Access CNTKCTL_EL1 system register from a domain
>>> +------------------------------------------------
>>> +
>>> +`XenSwdgn~arm64_generic_timer_access_cntkctlel1~1`
>>> +
>>> +Description:
>>> +Xen shall expose counter-timer kernel control register to the domains.
>>=20
>> "counter-timer kernel" is a bit odd here, is it the name from arm arm ?
>> Generic Timer control registers ? or directly the register name.
> This is the name from Arm ARM. See e.g.:
> https://developer.arm.com/documentation/ddi0601/2023-12/AArch64-Registers=
/CNTKCTL-EL1--Counter-timer-Kernel-Control-Register?lang=3Den

Right then i would use the same upper cases: Counter-timer Kernel Control
register and still mention CNTKCTL_EL1 as it would be clearer.

>=20
>>=20
>>> +
>>> +Rationale:
>>> +
>>> +Comments:
>>> +Domains shall access the counter-timer kernel control register to allo=
w
>>> +controlling the access to the timer from userspace (EL0).
>>=20
>> This is documented in the arm arm, this comment is not needed.
>>=20
>>> +
>>> +Covers:
>>> + - `XenProd~emulated_timer~1`
>>> +
>>> +Access virtual timer from a domain
>>> +----------------------------------
>>> +
>>> +`XenSwdgn~arm64_generic_timer_access_virtual_timer~1`
>>> +
>>> +Description:
>>> +Xen shall expose the virtual timer registers to the domains.
>>> +
>>> +Rationale:
>>> +
>>> +Comments:
>>> +Domains shall access and make use of the virtual timer by accessing th=
e
>>> +following system registers:
>>> +CNTVCT_EL0,
>>> +CNTV_CTL_EL0,
>>> +CNTV_CVAL_EL0,
>>> +CNTV_TVAL_EL0.
>>=20
>> The requirement to be complete should give this list, not the comment.
>>=20
>>> +
>>> +Covers:
>>> + - `XenProd~emulated_timer~1`
>>> +
>>> +Access physical timer from a domain
>>> +-----------------------------------
>>> +
>>> +`XenSwdgn~arm64_generic_timer_access_physical_timer~1`
>>> +
>>> +Description:
>>> +Xen shall expose physical timer registers to the domains.
>>> +
>>> +Rationale:
>>> +
>>> +Comments:
>>> +Domains shall access and make use of the physical timer by accessing t=
he
>>> +following system registers:
>>> +CNTPCT_EL0,
>>> +CNTP_CTL_EL0,
>>> +CNTP_CVAL_EL0,
>>> +CNTP_TVAL_EL0.
>>=20
>> same as upper
>>=20
>>> +
>>> +Covers:
>>> + - `XenProd~emulated_timer~1`
>>> +
>>> +Trigger the virtual timer interrupt from a domain
>>> +-------------------------------------------------
>>> +
>>> +`XenSwdgn~arm64_generic_timer_trigger_virtual_interrupt~1`
>>> +
>>> +Description:
>>> +Xen shall enable the domains to program the virtual timer to generate =
the
>>> +interrupt.
>>=20
>> I am not sure this is right here.
>> You gave access to the registers upper so Xen responsibility is not real=
ly to
>> enable anything but rather make sure that it generates an interrupt acco=
rding to
>> how the registers have been programmed.
> I'm in two minds about it. On one hand you're right and the IRQ trigger i=
s a side-effect
> of programming the registers correctly. On the other, these are design re=
quirements which
> according to "fusa/reqs/intro.rst" describe what SW implementation is doi=
ng. Our way of injecting
> timer IRQs into guests is a bit different (phys timer is fully emulated a=
nd we use internal timers
> and for virt timer we first route IRQ to Xen, mask the IRQ and inject to =
guest). If I were to write
> tests to cover Generic Timer requirements I'd expect to cover whether r.g=
. masking/unmasking IRQ works,
> whether IRQ was received, etc.

This is true but i think it would be more logic in non design requirements =
to
phrase things to explain the domain point of view rather than how it is imp=
lemented.

Here the point is to have a timer fully functional from guest point of view=
, including
getting interrupts when the timer should generate one.

Maybe something like: Xen shall generate timer interrupts to domains when t=
he timer condition asserts.

>=20
> I'd like to know other opinions. @Stefano, @Artem
>=20
> ~Michal

Cheers
Bertrand=


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 12:25:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 12:25:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781816.1191316 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh6sR-00054b-00; Thu, 22 Aug 2024 12:25:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781816.1191316; Thu, 22 Aug 2024 12:25:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh6sQ-00054U-TZ; Thu, 22 Aug 2024 12:25:18 +0000
Received: by outflank-mailman (input) for mailman id 781816;
 Thu, 22 Aug 2024 12:25:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gAWf=PV=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sh6sP-00054O-Oa
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 12:25:17 +0000
Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com
 [2a00:1450:4864:20::431])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 96a3e89e-6081-11ef-a50a-bb4a2ccca743;
 Thu, 22 Aug 2024 14:25:16 +0200 (CEST)
Received: by mail-wr1-x431.google.com with SMTP id
 ffacd0b85a97d-367990aaef3so335702f8f.0
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 05:25:16 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f4f46a2sm113101166b.208.2024.08.22.05.25.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 22 Aug 2024 05:25:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 96a3e89e-6081-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724329516; x=1724934316; 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=9G/PNpDU1KLjRYj6yyi5WJf+sjPLdAU05FGixmMV1/I=;
        b=C4yHM3vOGDoUgGXrGkagxLBKvF+HcTE3H3ATkdfMgi83RFeUb77M8Zhpd3usiGVbbD
         bf2WRj5n3TBsR+Xk/NFvOULsmnbD0kBUHjDoEMhDWOGP3xIBynAtr2uUol1o/DX304SS
         h8368OwgOSdj5QXZ8KEo2XnrmB7cGmmBI9K1I=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724329516; x=1724934316;
        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=9G/PNpDU1KLjRYj6yyi5WJf+sjPLdAU05FGixmMV1/I=;
        b=F2wBtyJQaHp0my6ho7xlX+/7ctUMkkMN1OWiVEV4F1dTeDl2P0e65lNfCUjEVYQA2W
         SKyxzHzxKI3uI8ngdUZ4NK0l4lhMRtCgdo0p8k7iqboHjLUxPkzq9V4VFJ3OOPELlefw
         xnK0BMqem2BRk77OYDfCgVRaXFIwBLlBT2qSU5xSEiEtXbNZeCg1TS80hcr0yO1GjVoW
         7KKQMvb2MIG/dpLW8gJ63EzjOWtEhhoZlqatf0ZLux/VI/02F+djB7QotBmalnO1Ov1T
         ot95hHCTKxZgYgbw3qWeMxNXTwb2E2ArQyQ+7PpgjDDAp1C+G2SN19GDlmjR4LAC6Dw0
         5C5A==
X-Forwarded-Encrypted: i=1; AJvYcCX0e7WhwTQ7mk4laRxVduCKiPaxE67MaU+YwEel/dDwG0ooH0qZ1YZhO7r0XkhOfeX28n6gS3+3MO0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxkF4nSoXTGjnUv0Sik4DdMcD2LUCvAilThIKAgSLFNSf31kv60
	kyBum86F1Z4LL8wDRhUsq8uSViOrt15d43W1z/ZvScEfcI7OhRlLuCPH6WEdCS0=
X-Google-Smtp-Source: AGHT+IGHsReVvLmDYRNbLdWWP1ilJowM7K9mTb5ss5fiZyfJfHcpyLJeChk9f/a15HTRnt9r4Qy6mA==
X-Received: by 2002:a5d:4e8f:0:b0:368:4e2e:7596 with SMTP id ffacd0b85a97d-372fd6c0823mr3495945f8f.37.1724329515644;
        Thu, 22 Aug 2024 05:25:15 -0700 (PDT)
Message-ID: <e184ccf6-47da-443f-9170-dd503d225bf6@citrix.com>
Date: Thu, 22 Aug 2024 13:25:13 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 1/4] tools/ocaml/common.make: Remove '-cc $(CC)' flag
 from OCAMLOPTFLAGS
To: Andrii Sultanov <andrii.sultanov@cloud.com>,
 xen-devel@lists.xenproject.org
Cc: Christian Lindig <christian.lindig@citrix.com>,
 David Scott <dave@recoil.org>, Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?B?RWR3aW4gVMO2csO2aw==?= <edwin.torok@cloud.com>
References: <cover.1724314239.git.andrii.sultanov@cloud.com>
 <110f63b76a12e8a9fead09f47319a35229222953.1724314239.git.andrii.sultanov@cloud.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <110f63b76a12e8a9fead09f47319a35229222953.1724314239.git.andrii.sultanov@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 22/08/2024 10:06 am, Andrii Sultanov wrote:
> This flag does not work as assumed and will not pass
> options (such as -shared) to the C compiler:
> https://github.com/ocaml/ocaml/issues/12284
>
> Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
> ---
>  tools/ocaml/common.make | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
> index 0c8a597d5b..cc126b749f 100644
> --- a/tools/ocaml/common.make
> +++ b/tools/ocaml/common.make
> @@ -12,7 +12,7 @@ OCAMLFIND ?= ocamlfind
>  CFLAGS += -fPIC -I$(shell ocamlc -where)
>  
>  OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\) .*/\1/p')
> -OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -cc $(CC) -w F -warn-error F
> +OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -w F -warn-error F
>  OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
>  
>  VERSION := 4.1

This patch itself is fine, and I'll commit it in due course, but then I
got looking at the surrounding context...

`$(OCAMLOPT) -h` tells you on stderr to try `--help instead`, so
OCAMLOPTFLAG_G is never going to contain -g.

Also, why is -g conditional for OCAMLOPTFLAGS but unconditional for
OCAMLCFLAGS?  I think we can safely drop OCAMLOPTFLAG_G


Next, there's VERSION and git grep says its only used in META files.

xen.git/tools/ocaml$ git grep -w VERSION
Makefile.rules:43:      sed 's/@VERSION@/$(VERSION)/g' < $< $o
common.make:18:VERSION := 4.1
libs/eventchn/META.in:1:version = "@VERSION@"
libs/mmap/META.in:1:version = "@VERSION@"
libs/xb/META.in:1:version = "@VERSION@"
libs/xc/META.in:1:version = "@VERSION@"
libs/xenstoredglue/META.in:1:version = "@VERSION@"
libs/xenstoredglue/domain_getinfo_plugin_v1/META.in:1:version = "@VERSION@"
libs/xs/META.in:1:version = "@VERSION@"

4.1 is very very stale and should say 4.19 these days (definitely for
xc, and whatever else is using an unstable API), yet should definitely
not be 4.19 for xenstoredglue.

Are there any ABI/API implication from changing the META file?

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 13:05:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 13:05:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781827.1191326 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh7VL-0003oR-0D; Thu, 22 Aug 2024 13:05:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781827.1191326; Thu, 22 Aug 2024 13:05:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh7VK-0003oK-TK; Thu, 22 Aug 2024 13:05:30 +0000
Received: by outflank-mailman (input) for mailman id 781827;
 Thu, 22 Aug 2024 13:05:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m19V=PV=cloud.com=fouad.hilly@srs-se1.protection.inumbo.net>)
 id 1sh7VJ-0003o9-WB
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 13:05:30 +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 340453b8-6087-11ef-a50a-bb4a2ccca743;
 Thu, 22 Aug 2024 15:05:28 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5bf006f37daso1330600a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 06:05:28 -0700 (PDT)
Received: from fhilly.. ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a4c4384sm897139a12.62.2024.08.22.06.05.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 06:05:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 340453b8-6087-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724331927; x=1724936727; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=tXFpMVsEY5HDdG9iyqyw0NLnxrsTfAERPp6H4mRa/04=;
        b=R0oz3gTS+4Wjdvw8j2MlER93Lz1EtGf+B+WWkAxRn5+P4fLQK9SnnHrGzk5Ao4xqmh
         XfMOBlQuFn+f1uRVeu91k0iqxcsoKapDwbBfQyhYBjlIg0pArMKGW1VXlZOUDJHjrZYc
         OvKuxgfpAL//PJkerHSB7iMccGCZIsYz62lR4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724331927; x=1724936727;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=tXFpMVsEY5HDdG9iyqyw0NLnxrsTfAERPp6H4mRa/04=;
        b=XsmuHTEYINUnh18tErkNxZ+wVlVRRA1SXcX5EFN4yJQ3rVlr3Z3ESISIzBvmENE/zH
         sWbkOJqvE4Quk2l0n/Ng9BESzX/cARmE/mpIil4+UcWBBzjrA1YrY+I48AEBIyGpGj+r
         rFSkbvkBkp4WPR2WQZoVKByy8HSHLsKKQLzG/ftBoybcSdAx+lV0ncfVZyZF35BLj3yE
         m5s7M6uZNiRXQJ9IXq1V/mBR5urkFxJU4ehOeiYfyakQeaBh26x58W84ri1yAYbNLj8b
         2beDSP34qSKL6oShfTxnKepewy4t3oD/295FnODmCEDEQoQbn6zSngdc/GIXyPyyRecw
         nXRA==
X-Gm-Message-State: AOJu0YyY9NB7wR3kU05N4vil9gjGgaGMYZGItkFcPxS7Et5z1Tc5Uzo6
	4MS6/gAenG8jIeYE5q7S40S5VdY8LhguJhn6HpDFYPQrLOYF3SXtjyTXK5cd4qDT9DsfBaGNU0s
	f
X-Google-Smtp-Source: AGHT+IH/ji6W4wgVAqXV6EI7AgkKhuFQ8u8shIxiUdiGxBQPJTCpPYVqz+HnWo1urm8ZCjVqnxxh1w==
X-Received: by 2002:a05:6402:354c:b0:5be:fff2:1062 with SMTP id 4fb4d7f45d1cf-5bf2bcafeb2mr2987494a12.0.1724331926400;
        Thu, 22 Aug 2024 06:05:26 -0700 (PDT)
From: Fouad Hilly <fouad.hilly@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Fouad Hilly <fouad.hilly@cloud.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Community Manager <community.manager@xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v7 0/3] x86/xen-ucode: Introduce --force option
Date: Thu, 22 Aug 2024 14:04:23 +0100
Message-ID: <20240822130426.492931-1-fouad.hilly@cloud.com>
X-Mailer: git-send-email 2.42.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Refactor and introduce --force option to xen-ucode, which skips microcode
version check when updating x86 CPU micocode. A new hypercall introduced
with flags field to facilitate the new option and allow for future flags
as needed.
This change is required to enable developers to load ucode that is the same version as the
one already loaded or downgrade for testing.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>

Fouad Hilly (3):
  x86/ucode: refactor xen-ucode to utilize getopt
  x86/ucode: Introduce --force option to xen-ucode
  x86/ucode: Utilize ucode_force and remove opt_ucode_allow_same

 CHANGELOG.md                         |  1 +
 docs/misc/xen-command-line.pandoc    |  7 +-
 tools/include/xenctrl.h              |  3 +-
 tools/libs/ctrl/xc_misc.c            | 12 ++--
 tools/misc/xen-ucode.c               | 66 ++++++++++++++++---
 xen/arch/x86/cpu/microcode/amd.c     |  8 ++-
 xen/arch/x86/cpu/microcode/core.c    | 95 ++++++++++++++++------------
 xen/arch/x86/cpu/microcode/intel.c   |  9 ++-
 xen/arch/x86/cpu/microcode/private.h |  5 +-
 9 files changed, 138 insertions(+), 68 deletions(-)

-- 
2.42.0



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 13:05:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 13:05:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781830.1191352 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh7VP-0004LR-Qf; Thu, 22 Aug 2024 13:05:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781830.1191352; Thu, 22 Aug 2024 13:05:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh7VP-0004Ip-JX; Thu, 22 Aug 2024 13:05:35 +0000
Received: by outflank-mailman (input) for mailman id 781830;
 Thu, 22 Aug 2024 13:05:33 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m19V=PV=cloud.com=fouad.hilly@srs-se1.protection.inumbo.net>)
 id 1sh7VN-0004GT-RD
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 13:05:33 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 35d1aa7a-6087-11ef-8776-851b0ebba9a2;
 Thu, 22 Aug 2024 15:05:31 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5bed0a2b1e1so753792a12.3
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 06:05:31 -0700 (PDT)
Received: from fhilly.. ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a4c4384sm897139a12.62.2024.08.22.06.05.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 06:05:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 35d1aa7a-6087-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724331930; x=1724936730; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=10am4fjTuo1E+hBiTlG8YBLEvflbG5lb423qbVTK18k=;
        b=Ya/RJcgB1KtOB+74ohQyfitvTW7ktMPRFLLg56HPgq0G3bK2LOcKCnNA1Neam/6gca
         /2m0WL9DwrGYMFAZvbJArWlzUSFiHKsIaZXQpvdva4A85FwP4DsyLUzG7RNzIQ34BlL0
         IxZ8/ugg3ZMn0vNspdao0mj6NxCJ5hSmXEpsY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724331930; x=1724936730;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=10am4fjTuo1E+hBiTlG8YBLEvflbG5lb423qbVTK18k=;
        b=kv9vHYOlJ3SYa0tL0zRC9RdM/QXgjxauzaGbXUQk6F+bsTSziX3gOcuTyLB0+aPaom
         AxuujaLM2cmI0YMiJ/U3rw4N3d1QXo+48iwLAUt2OTxwXztqg6tqYAnX/UeERV41hFsd
         XIBH00FnAXR52gQyXFNICePwMw2/twQNvl5zbrwUBDS0R5Jw35LxC0W5kwXZOeuoUTAh
         752NZhTnVsJwAVAq4bBVeATclASOzJV7HHlH6BT8iiBVAuPJuxhowfmN+8yAvF89NhyW
         q5azHcstIfKghWK+JQRbnSOxXcI7xm0TR6zl5omtMpIbyxGrOpG8Ve5rdkJnJpUbaGK/
         uXnA==
X-Gm-Message-State: AOJu0YxVYSA6n+T0sIpm+7vS01gDQ4Q9cdoam65APisbNElM9aHagSY8
	fVGPqzKeCl3eLlXGnAhV1jDSdxVNpfP8/q18iuJmz5N1TN0u8dxynZHyMO9LiXlwjismhqwoe45
	T
X-Google-Smtp-Source: AGHT+IGyvi9sVdK0NyhmKt1pg4Jn0qPhsG2sBOWf1eO/gmqESSqR5LGijXmdI/nw+xLTJbz3BFcfig==
X-Received: by 2002:a05:6402:5386:b0:5a3:619:949f with SMTP id 4fb4d7f45d1cf-5c0792b5be5mr1851268a12.32.1724331929216;
        Thu, 22 Aug 2024 06:05:29 -0700 (PDT)
From: Fouad Hilly <fouad.hilly@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Fouad Hilly <fouad.hilly@cloud.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v7 2/3] x86/ucode: Introduce --force option to xen-ucode
Date: Thu, 22 Aug 2024 14:04:25 +0100
Message-ID: <20240822130426.492931-3-fouad.hilly@cloud.com>
X-Mailer: git-send-email 2.42.0
In-Reply-To: <20240822130426.492931-1-fouad.hilly@cloud.com>
References: <20240822130426.492931-1-fouad.hilly@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Introduce --force option to xen-ucode to force skipping microcode version check, which
allows the user to update x86 microcode even if both versions are the same or downgrade.
xc_microcode_update() refactored to accept flags and utilize xenpf_microcode_update2.

Signed-off-by: Fouad Hilly <fouad.hilly@cloud.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
[v7]
1- Fix usage() printout message.
[v6]
1- Fix usage() output for -f option to be explicitly wrapped for 80 character width
[v5]
1- Update commit message.
2- Re-phrase --force option description.
[v4]
1- Add --force to xen-ucode options.
2- Update xc_microcode_update() to accept and handle flags.
---
 tools/include/xenctrl.h   |  3 ++-
 tools/libs/ctrl/xc_misc.c | 12 +++++++-----
 tools/misc/xen-ucode.c    | 16 +++++++++++++---
 3 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index 9ceca0cffc2f..2c4608c09ab0 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1171,7 +1171,8 @@ typedef uint32_t xc_node_to_node_dist_t;
 int xc_physinfo(xc_interface *xch, xc_physinfo_t *info);
 int xc_cputopoinfo(xc_interface *xch, unsigned *max_cpus,
                    xc_cputopo_t *cputopo);
-int xc_microcode_update(xc_interface *xch, const void *buf, size_t len);
+int xc_microcode_update(xc_interface *xch, const void *buf,
+                        size_t len, unsigned int flags);
 int xc_get_cpu_version(xc_interface *xch, struct xenpf_pcpu_version *cpu_ver);
 int xc_get_ucode_revision(xc_interface *xch,
                           struct xenpf_ucode_revision *ucode_rev);
diff --git a/tools/libs/ctrl/xc_misc.c b/tools/libs/ctrl/xc_misc.c
index 50282fd60dcc..6a60216bda03 100644
--- a/tools/libs/ctrl/xc_misc.c
+++ b/tools/libs/ctrl/xc_misc.c
@@ -203,11 +203,12 @@ int xc_physinfo(xc_interface *xch,
     return 0;
 }
 
-int xc_microcode_update(xc_interface *xch, const void *buf, size_t len)
+int xc_microcode_update(xc_interface *xch, const void *buf,
+                        size_t len, unsigned int flags)
 {
     int ret;
     struct xen_platform_op platform_op = {};
-    DECLARE_HYPERCALL_BUFFER(struct xenpf_microcode_update, uc);
+    DECLARE_HYPERCALL_BUFFER(struct xenpf_microcode_update2, uc);
 
     uc = xc_hypercall_buffer_alloc(xch, uc, len);
     if ( uc == NULL )
@@ -215,9 +216,10 @@ int xc_microcode_update(xc_interface *xch, const void *buf, size_t len)
 
     memcpy(uc, buf, len);
 
-    platform_op.cmd = XENPF_microcode_update;
-    platform_op.u.microcode.length = len;
-    set_xen_guest_handle(platform_op.u.microcode.data, uc);
+    platform_op.cmd = XENPF_microcode_update2;
+    platform_op.u.microcode2.length = len;
+    platform_op.u.microcode2.flags = flags;
+    set_xen_guest_handle(platform_op.u.microcode2.data, uc);
 
     ret = do_platform_op(xch, &platform_op);
 
diff --git a/tools/misc/xen-ucode.c b/tools/misc/xen-ucode.c
index bfc1e74dd5cc..2d2b520c0082 100644
--- a/tools/misc/xen-ucode.c
+++ b/tools/misc/xen-ucode.c
@@ -13,6 +13,8 @@
 #include <xenctrl.h>
 #include <getopt.h>
 
+#include <xen/platform.h>
+
 static xc_interface *xch;
 
 static const char intel_id[] = "GenuineIntel";
@@ -79,7 +81,10 @@ static void usage(FILE *stream, const char *name)
             "Usage: %s [options | microcode-file]\n"
             "options:\n"
             "  -h, --help               display this help\n"
-            "  -s, --show-cpu-info      show CPU information\n",
+            "  -s, --show-cpu-info      show CPU information\n"
+            "  -f, --force              skip certain checks when applying\n"
+            "                           microcode; do not use unless you know\n"
+            "                           exactly what you are doing\n",
             name, name);
     show_curr_cpu(stream);
 }
@@ -89,6 +94,7 @@ int main(int argc, char *argv[])
     static const struct option options[] = {
         {"help", no_argument, NULL, 'h'},
         {"show-cpu-info", no_argument, NULL, 's'},
+        {"force", no_argument, NULL, 'f'},
         {NULL, no_argument, NULL, 0}
     };
     int fd, ret;
@@ -96,6 +102,7 @@ int main(int argc, char *argv[])
     size_t len;
     struct stat st;
     int opt;
+    uint32_t ucode_flags = 0;
 
     xch = xc_interface_open(NULL, NULL, 0);
     if ( xch == NULL )
@@ -105,7 +112,7 @@ int main(int argc, char *argv[])
         exit(1);
     }
 
-    while ( (opt = getopt_long(argc, argv, "hs", options, NULL)) != -1 )
+    while ( (opt = getopt_long(argc, argv, "hsf", options, NULL)) != -1 )
     {
         switch ( opt )
         {
@@ -117,6 +124,9 @@ int main(int argc, char *argv[])
             show_curr_cpu(stdout);
             exit(EXIT_SUCCESS);
 
+        case 'f':
+            ucode_flags = XENPF_UCODE_FORCE;
+            break;
         default:
             fprintf(stderr, "%s: unknown option\n", argv[0]);
             goto ext_err;
@@ -160,7 +170,7 @@ int main(int argc, char *argv[])
     }
 
     errno = 0;
-    ret = xc_microcode_update(xch, buf, len);
+    ret = xc_microcode_update(xch, buf, len, ucode_flags);
     if ( ret == -1 && errno == EEXIST )
         printf("Microcode already up to date\n");
     else if ( ret )
-- 
2.42.0



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 13:05:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 13:05:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781828.1191330 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh7VL-0003rg-8l; Thu, 22 Aug 2024 13:05:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781828.1191330; Thu, 22 Aug 2024 13:05:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh7VL-0003r7-4j; Thu, 22 Aug 2024 13:05:31 +0000
Received: by outflank-mailman (input) for mailman id 781828;
 Thu, 22 Aug 2024 13:05:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m19V=PV=cloud.com=fouad.hilly@srs-se1.protection.inumbo.net>)
 id 1sh7VK-0003o9-7B
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 13:05:30 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 34c88b1b-6087-11ef-a50a-bb4a2ccca743;
 Thu, 22 Aug 2024 15:05:29 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-5bed83488b6so1116995a12.2
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 06:05:29 -0700 (PDT)
Received: from fhilly.. ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a4c4384sm897139a12.62.2024.08.22.06.05.26
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 06:05:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 34c88b1b-6087-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724331928; x=1724936728; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=/9vAl6gPQOHAEsxcAliRbXeAmx2pjKxpw/3blrP7pio=;
        b=WXr3N73CrDR7WSSAu2QlbEKQLTw3K8/b5RhCs/9AF5k6azNXasM36DUirkbp0UH5wt
         jWgnoOx6Ry3tFGsWf+fO0/9kTXuFgXpJq6aG/rYRBA3YFguaWVlwFcpqTJd9qq8t3O3I
         9FDGGcbbIgGMGAOPB+GFMR9iEIpzshrvW6SXI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724331928; x=1724936728;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=/9vAl6gPQOHAEsxcAliRbXeAmx2pjKxpw/3blrP7pio=;
        b=RGTf/4juaSYorWkv3dok0BKbMcFiCO9WnJKb3TzcbNHcDL78+/Cto/eDnGnnECVLC2
         pf4/Tr13EIZ+GCJNfc2MiCPepXfW5BY6AsCZaBnsOzJ5zyEIXB6OfbBYCaomXUoeUZMh
         QgnUq9/wiBdVbiXqvOAfDg6V64+mmadmG5VMBXESARygzzpIcNb0tU9ywwPA7/lQe/Px
         fzdJ9UMiWO2QsRlIs5Z4nccmi/IirMe0UgitZtFgwNjbKz60YYXeajgHj3ysIctxDIQ5
         nq0M8Ac9CpxDPFU7mQsIuQ7lIxEq3aiNO0atdyMznaswg/VncXIo77yL04qhPSgVJA25
         XPaw==
X-Gm-Message-State: AOJu0YyGZpvIWv3FM5C5Iu7rKMuqjIXEyvmlb27Kx/N9Tc1H5xDHrivS
	OmVp3z4kJE+ulZytSY9CLeng35DoIm3obyEQDrK8pbjV1CxbELAbRI/a6B9U+Qdx6xD0oKdB09v
	p
X-Google-Smtp-Source: AGHT+IGOqPZ9IUB50huyh3nkNbp/xTL91tnxC3wSx581A/j50amvanN/BPD2ZnBnSxzG0eo+7AZi9A==
X-Received: by 2002:a05:6402:5215:b0:5aa:2a06:d325 with SMTP id 4fb4d7f45d1cf-5c0791d10d0mr1280006a12.7.1724331927802;
        Thu, 22 Aug 2024 06:05:27 -0700 (PDT)
From: Fouad Hilly <fouad.hilly@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Fouad Hilly <fouad.hilly@cloud.com>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH v7 1/3] x86/ucode: refactor xen-ucode to utilize getopt
Date: Thu, 22 Aug 2024 14:04:24 +0100
Message-ID: <20240822130426.492931-2-fouad.hilly@cloud.com>
X-Mailer: git-send-email 2.42.0
In-Reply-To: <20240822130426.492931-1-fouad.hilly@cloud.com>
References: <20240822130426.492931-1-fouad.hilly@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Use getopt_long() to handle command line arguments.
Introduce ext_err for common errors exit.
Introducing usage() to handle usage\help messages in a common block.

Signed-off-by: Fouad Hilly <fouad.hilly@cloud.com>
---
[v7]
1- Fix Usage message format.
2- Remove generic error message from ext_err and add specific error messages for "unknown option" and missing "microcode file".
3- Update "microcode file" -> "microcode-file" to remove ambiguity.
[v6]
1- Update usage() printed message format: [microcode file] [options] -> [microcode file | options]
2- Add missing blanks in switch ( opt )
[v5]
1- Update message description.
2- re-arrange static and automatic variables.
3- Fix indentations.
4- reverted the deletion of show-cpu-info for backwards compatibility.
[v4]
1- Merge three patches into one.
2- usage() to print messages to the correct stream.
3- Update commit message and description.
---
 tools/misc/xen-ucode.c | 54 +++++++++++++++++++++++++++++++++++-------
 1 file changed, 46 insertions(+), 8 deletions(-)

diff --git a/tools/misc/xen-ucode.c b/tools/misc/xen-ucode.c
index 390969db3d1c..bfc1e74dd5cc 100644
--- a/tools/misc/xen-ucode.c
+++ b/tools/misc/xen-ucode.c
@@ -11,6 +11,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <xenctrl.h>
+#include <getopt.h>
 
 static xc_interface *xch;
 
@@ -71,12 +72,30 @@ static void show_curr_cpu(FILE *f)
     }
 }
 
+static void usage(FILE *stream, const char *name)
+{
+    fprintf(stream,
+            "%s: Xen microcode updating tool\n"
+            "Usage: %s [options | microcode-file]\n"
+            "options:\n"
+            "  -h, --help               display this help\n"
+            "  -s, --show-cpu-info      show CPU information\n",
+            name, name);
+    show_curr_cpu(stream);
+}
+
 int main(int argc, char *argv[])
 {
+    static const struct option options[] = {
+        {"help", no_argument, NULL, 'h'},
+        {"show-cpu-info", no_argument, NULL, 's'},
+        {NULL, no_argument, NULL, 0}
+    };
     int fd, ret;
     char *filename, *buf;
     size_t len;
     struct stat st;
+    int opt;
 
     xch = xc_interface_open(NULL, NULL, 0);
     if ( xch == NULL )
@@ -86,22 +105,37 @@ int main(int argc, char *argv[])
         exit(1);
     }
 
-    if ( argc < 2 )
+    while ( (opt = getopt_long(argc, argv, "hs", options, NULL)) != -1 )
     {
-        fprintf(stderr,
-                "xen-ucode: Xen microcode updating tool\n"
-                "Usage: %s [<microcode file> | show-cpu-info]\n", argv[0]);
-        show_curr_cpu(stderr);
-        exit(2);
+        switch ( opt )
+        {
+        case 'h':
+            usage(stdout, argv[0]);
+            exit(EXIT_SUCCESS);
+
+        case 's':
+            show_curr_cpu(stdout);
+            exit(EXIT_SUCCESS);
+
+        default:
+            fprintf(stderr, "%s: unknown option\n", argv[0]);
+            goto ext_err;
+        }
     }
 
-    if ( !strcmp(argv[1], "show-cpu-info") )
+    if ( optind == argc ) {
+        fprintf(stderr, "%s: missing microcode file\n", argv[0]);
+        goto ext_err;
+    }
+
+    /* For backwards compatibility to the pre-getopt() cmdline handling */
+    if ( !strcmp(argv[optind], "show-cpu-info") )
     {
         show_curr_cpu(stdout);
         return 0;
     }
 
-    filename = argv[1];
+    filename = argv[optind];
     fd = open(filename, O_RDONLY);
     if ( fd < 0 )
     {
@@ -146,4 +180,8 @@ int main(int argc, char *argv[])
     close(fd);
 
     return 0;
+
+ ext_err:
+    usage(stderr, argv[0]);
+    exit(EXIT_FAILURE);
 }
-- 
2.42.0



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 13:05:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 13:05:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781829.1191347 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh7VP-0004Hj-HT; Thu, 22 Aug 2024 13:05:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781829.1191347; Thu, 22 Aug 2024 13:05:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh7VP-0004Ha-CN; Thu, 22 Aug 2024 13:05:35 +0000
Received: by outflank-mailman (input) for mailman id 781829;
 Thu, 22 Aug 2024 13:05:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=m19V=PV=cloud.com=fouad.hilly@srs-se1.protection.inumbo.net>)
 id 1sh7VN-0003o9-HS
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 13:05:33 +0000
Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com
 [2a00:1450:4864:20::22e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 36b0e5ad-6087-11ef-a50a-bb4a2ccca743;
 Thu, 22 Aug 2024 15:05:32 +0200 (CEST)
Received: by mail-lj1-x22e.google.com with SMTP id
 38308e7fff4ca-2ef2c56da6cso6587971fa.1
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 06:05:32 -0700 (PDT)
Received: from fhilly.. ([185.25.67.249]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a4c4384sm897139a12.62.2024.08.22.06.05.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 06:05:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 36b0e5ad-6087-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724331931; x=1724936731; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=x4KXlaa0yrvHzAKaeTOG6f3zudF8qeAlRuDumnA2t4o=;
        b=Vx/78bKKVM5vNSFhmSG3JORzC8Jfm6I7/we03QNywCe9OpJxdqTHrJwJwPB9keORFT
         96tOY5cG/QNGqUMBYybsYSUxUbIdEBXI5uD795FZj1so9YlslhN1xEK5v/5wmpRlK+LA
         FKJXkSAQNXorvbWlXLgijRNaoPxWj8+TtlV5Y=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724331931; x=1724936731;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=x4KXlaa0yrvHzAKaeTOG6f3zudF8qeAlRuDumnA2t4o=;
        b=wkxQOH7+1J0YMzyzDpE53HRucI+WQ7etQoImFM6KtMlIXoMMzPTCBXO5kejMvuG9ln
         fH4y9ALbAX2TO44JMOE4vPryRbSzds2yh27RSAUogARGpaKirYt8ILyQErlkNydIipvI
         szRis8q2b9ziV5LF4yZ+Sn1c1o3C3Rxn4KCrIzZYJMy5NY9WvbFS7ocreJwhosvezAi4
         OHpBw9tdCCPokzGOT+Ngh1/2sHDDRwa00S3JdrKjD/PeAESoZv2MpP6lF+PZklQI3hSe
         xIS5kngTV4Lj262p08poAxJAvaP677aQdVUDttMSjMdQIYcfXWcxDVAaZkhJpLDo7UiB
         AhRA==
X-Gm-Message-State: AOJu0Yx65rq54vomLU/JSZ7hnFuSDfkTjJVhgORl/oozjHdcYFaaPccA
	chH5TrsBfh8AvlTCEZIdtx5HJC2spOFLG+qBBfT2Uo8Zh31tpbYGMm05vdvyph8aK2w/Iy3AuIP
	O
X-Google-Smtp-Source: AGHT+IHHIUAQDhEMToLwf1ct8/Acte31VSgERsy6FgGPYm9Lqci6iwBO396ChDQCOKwUoHkvNKuDRQ==
X-Received: by 2002:a2e:84a:0:b0:2ee:7a71:6e3b with SMTP id 38308e7fff4ca-2f3f88850d8mr30051081fa.27.1724331930527;
        Thu, 22 Aug 2024 06:05:30 -0700 (PDT)
From: Fouad Hilly <fouad.hilly@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Fouad Hilly <fouad.hilly@cloud.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Community Manager <community.manager@xenproject.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v7 3/3] x86/ucode: Utilize ucode_force and remove opt_ucode_allow_same
Date: Thu, 22 Aug 2024 14:04:26 +0100
Message-ID: <20240822130426.492931-4-fouad.hilly@cloud.com>
X-Mailer: git-send-email 2.42.0
In-Reply-To: <20240822130426.492931-1-fouad.hilly@cloud.com>
References: <20240822130426.492931-1-fouad.hilly@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Pass xen-ucode flags to do low level checks on microcode version and utilize
it to allow for microcode downgrade or reapply the same version of the
microcode.
ucode_force is required to be passed to a low level Intel and AMD for version
checks to be done.
While adding ucode_force, opt_ucode_allow_same was removed.
Remove opt_ucode_allow_same from documentation.
update CHANGELOG.md for opt_ucode_allow_same removal.

Signed-off-by: Fouad Hilly <fouad.hilly@cloud.com>
---
[v7]
1- update commit message.
2- update CHANGELOG.md.
3- update microcode_free_patch().
[v6]
1- Removed struct microcode_nmi_patch_with_flags.
2- removed const from control_thread_fn() and primary_thread_fn().
3- Fixed "flags" checks.
[v5]
1- Update commit message.
2- Introduce structs microcode_patch_with_flags and microcode_nmi_patch_with_flags.
3- pass flags to Intel and AMD low level through apply_microcode().
[4]
1- As opt_ucode_allow_same is not required anymore, it has been removed while introducing ucode_force.
2- Apply the changes for both AMD and Intel.
3- Remove the mention of opt_ucode_allow_same from documentation.
---
 CHANGELOG.md                         |  1 +
 docs/misc/xen-command-line.pandoc    |  7 +-
 xen/arch/x86/cpu/microcode/amd.c     |  8 ++-
 xen/arch/x86/cpu/microcode/core.c    | 95 ++++++++++++++++------------
 xen/arch/x86/cpu/microcode/intel.c   |  9 ++-
 xen/arch/x86/cpu/microcode/private.h |  5 +-
 6 files changed, 72 insertions(+), 53 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5521ae5bb37a..3c5fc9e9d0bf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
 ### Removed
  - On x86:
    - Support for running on Xeon Phi processors.
+   - Remove ucode=allow-same option.
 
 ## [4.19.0](https://xenbits.xenproject.org/gitweb/?p=xen.git;a=shortlog;h=RELEASE-4.19.0) - 2024-07-29
 
diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc
index 0a66e1ee2d7e..959cf45b55d9 100644
--- a/docs/misc/xen-command-line.pandoc
+++ b/docs/misc/xen-command-line.pandoc
@@ -2650,7 +2650,7 @@ performance.
    Alternatively, selecting `tsx=1` will re-enable TSX at the users own risk.
 
 ### ucode
-> `= List of [ <integer> | scan=<bool>, nmi=<bool>, allow-same=<bool> ]`
+> `= List of [ <integer> | scan=<bool>, nmi=<bool> ]`
 
     Applicability: x86
     Default: `nmi`
@@ -2682,11 +2682,6 @@ precedence over `scan`.
 stop_machine context. In NMI handler, even NMIs are blocked, which is
 considered safer. The default value is `true`.
 
-'allow-same' alters the default acceptance policy for new microcode to permit
-trying to reload the same version.  Many CPUs will actually reload microcode
-of the same version, and this allows for easy testing of the late microcode
-loading path.
-
 ### unrestricted_guest (Intel)
 > `= <boolean>`
 
diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index f76a563c8b84..80ff6335d64a 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -22,6 +22,8 @@
 
 #include "private.h"
 
+#include "public/platform.h"
+
 #define pr_debug(x...) ((void)0)
 
 struct equiv_cpu_entry {
@@ -214,13 +216,15 @@ static enum microcode_match_result cf_check compare_patch(
     return compare_header(new, old);
 }
 
-static int cf_check apply_microcode(const struct microcode_patch *patch)
+static int cf_check apply_microcode(const struct microcode_patch *patch,
+                                    unsigned int flags)
 {
     int hw_err;
     unsigned int cpu = smp_processor_id();
     struct cpu_signature *sig = &per_cpu(cpu_sig, cpu);
     uint32_t rev, old_rev = sig->rev;
     enum microcode_match_result result = microcode_fits(patch);
+    bool ucode_force = flags & XENPF_UCODE_FORCE;
 
     if ( result == MIS_UCODE )
         return -EINVAL;
@@ -229,7 +233,7 @@ static int cf_check apply_microcode(const struct microcode_patch *patch)
      * Allow application of the same revision to pick up SMT-specific changes
      * even if the revision of the other SMT thread is already up-to-date.
      */
-    if ( result == OLD_UCODE )
+    if ( !ucode_force && (result == SAME_UCODE || result == OLD_UCODE) )
         return -EEXIST;
 
     if ( check_final_patch_levels(sig) )
diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 8a9e744489b9..7beca5c4e724 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -90,6 +90,11 @@ struct ucode_mod_blob {
     size_t size;
 };
 
+struct patch_with_flags {
+    unsigned int flags;
+    const struct microcode_patch *patch;
+};
+
 static struct ucode_mod_blob __initdata ucode_blob;
 /*
  * By default we will NOT parse the multiboot modules to see if there is
@@ -100,10 +105,8 @@ static bool __initdata ucode_scan;
 /* By default, ucode loading is done in NMI handler */
 static bool ucode_in_nmi = true;
 
-bool __read_mostly opt_ucode_allow_same;
-
 /* Protected by microcode_mutex */
-static struct microcode_patch *microcode_cache;
+static const struct microcode_patch *microcode_cache;
 
 void __init microcode_set_module(unsigned int idx)
 {
@@ -128,8 +131,6 @@ static int __init cf_check parse_ucode(const char *s)
 
         if ( (val = parse_boolean("nmi", s, ss)) >= 0 )
             ucode_in_nmi = val;
-        else if ( (val = parse_boolean("allow-same", s, ss)) >= 0 )
-            opt_ucode_allow_same = val;
         else if ( !ucode_mod_forced ) /* Not forced by EFI */
         {
             if ( (val = parse_boolean("scan", s, ss)) >= 0 )
@@ -237,7 +238,10 @@ static DEFINE_PER_CPU(int, loading_err);
  */
 static cpumask_t cpu_callin_map;
 static atomic_t cpu_out, cpu_updated;
-static const struct microcode_patch *nmi_patch = ZERO_BLOCK_PTR;
+static struct patch_with_flags nmi_patch =
+{
+    .patch  = ZERO_BLOCK_PTR,
+};
 
 /*
  * Return a patch that covers current CPU. If there are multiple patches,
@@ -252,13 +256,13 @@ static struct microcode_patch *parse_blob(const char *buf, size_t len)
     return alternative_call(ucode_ops.cpu_request_microcode, buf, len, true);
 }
 
-static void microcode_free_patch(struct microcode_patch *patch)
+static void microcode_free_patch(const struct microcode_patch *patch)
 {
-    xfree(patch);
+    xfree((struct microcode_patch *)patch);
 }
 
 /* Return true if cache gets updated. Otherwise, return false */
-static bool microcode_update_cache(struct microcode_patch *patch)
+static bool microcode_update_cache(const struct microcode_patch *patch)
 {
     ASSERT(spin_is_locked(&microcode_mutex));
 
@@ -327,7 +331,8 @@ static bool cf_check wait_cpu_callout(unsigned int nr)
  * If no patch is provided, the cached patch will be loaded. Microcode update
  * during APs bringup and CPU resuming falls into this case.
  */
-static int microcode_update_cpu(const struct microcode_patch *patch)
+static int microcode_update_cpu(const struct microcode_patch *patch,
+                                unsigned int flags)
 {
     int err;
 
@@ -335,10 +340,11 @@ static int microcode_update_cpu(const struct microcode_patch *patch)
 
     spin_lock(&microcode_mutex);
     if ( patch )
-        err = alternative_call(ucode_ops.apply_microcode, patch);
+        err = alternative_call(ucode_ops.apply_microcode, patch, flags);
     else if ( microcode_cache )
     {
-        err = alternative_call(ucode_ops.apply_microcode, microcode_cache);
+        err = alternative_call(ucode_ops.apply_microcode, microcode_cache,
+                               flags);
         if ( err == -EIO )
         {
             microcode_free_patch(microcode_cache);
@@ -379,7 +385,8 @@ static int secondary_nmi_work(void)
     return wait_for_state(LOADING_EXIT) ? 0 : -EBUSY;
 }
 
-static int primary_thread_work(const struct microcode_patch *patch)
+static int primary_thread_work(const struct microcode_patch *patch,
+                               unsigned int flags)
 {
     int ret;
 
@@ -388,7 +395,7 @@ static int primary_thread_work(const struct microcode_patch *patch)
     if ( !wait_for_state(LOADING_ENTER) )
         return -EBUSY;
 
-    ret = alternative_call(ucode_ops.apply_microcode, patch);
+    ret = alternative_call(ucode_ops.apply_microcode, patch, flags);
     if ( !ret )
         atomic_inc(&cpu_updated);
     atomic_inc(&cpu_out);
@@ -416,7 +423,8 @@ static int cf_check microcode_nmi_callback(
         return 0;
 
     if ( primary_cpu )
-        ret = primary_thread_work(nmi_patch);
+        ret = primary_thread_work(nmi_patch.patch,
+                                  nmi_patch.flags);
     else
         ret = secondary_nmi_work();
     this_cpu(loading_err) = ret;
@@ -446,7 +454,8 @@ static int secondary_thread_fn(void)
     return this_cpu(loading_err);
 }
 
-static int primary_thread_fn(const struct microcode_patch *patch)
+static int primary_thread_fn(const struct microcode_patch *patch,
+                             unsigned int flags)
 {
     if ( !wait_for_state(LOADING_CALLIN) )
         return -EBUSY;
@@ -466,10 +475,11 @@ static int primary_thread_fn(const struct microcode_patch *patch)
         return this_cpu(loading_err);
     }
 
-    return primary_thread_work(patch);
+    return primary_thread_work(patch, flags);
 }
 
-static int control_thread_fn(const struct microcode_patch *patch)
+static int control_thread_fn(const struct microcode_patch *patch,
+                             unsigned int flags)
 {
     unsigned int cpu = smp_processor_id(), done;
     unsigned long tick;
@@ -482,7 +492,8 @@ static int control_thread_fn(const struct microcode_patch *patch)
      */
     watchdog_disable();
 
-    nmi_patch = patch;
+    nmi_patch.patch = patch;
+    nmi_patch.flags = flags;
     smp_wmb();
     saved_nmi_callback = set_nmi_callback(microcode_nmi_callback);
 
@@ -498,7 +509,7 @@ static int control_thread_fn(const struct microcode_patch *patch)
         goto out;
 
     /* Control thread loads ucode first while others are in NMI handler. */
-    ret = alternative_call(ucode_ops.apply_microcode, patch);
+    ret = alternative_call(ucode_ops.apply_microcode, patch, flags);
     if ( !ret )
         atomic_inc(&cpu_updated);
     atomic_inc(&cpu_out);
@@ -544,17 +555,19 @@ static int control_thread_fn(const struct microcode_patch *patch)
 
     set_nmi_callback(saved_nmi_callback);
     smp_wmb();
-    nmi_patch = ZERO_BLOCK_PTR;
+    nmi_patch.patch = ZERO_BLOCK_PTR;
+    nmi_patch.flags = 0;
 
     watchdog_enable();
 
     return ret;
 }
 
-static int cf_check do_microcode_update(void *patch)
+static int cf_check do_microcode_update(void *_patch_with_flags)
 {
     unsigned int cpu = smp_processor_id();
     int ret;
+    struct patch_with_flags *patch_with_flags = _patch_with_flags;
 
     /*
      * The control thread set state to coordinate ucode loading. Primary
@@ -562,9 +575,11 @@ static int cf_check do_microcode_update(void *patch)
      * the completion of the ucode loading process.
      */
     if ( cpu == cpumask_first(&cpu_online_map) )
-        ret = control_thread_fn(patch);
+        ret = control_thread_fn(patch_with_flags->patch,
+                                patch_with_flags->flags);
     else if ( is_cpu_primary(cpu) )
-        ret = primary_thread_fn(patch);
+        ret = primary_thread_fn(patch_with_flags->patch,
+                                patch_with_flags->flags);
     else
         ret = secondary_thread_fn();
 
@@ -582,7 +597,8 @@ static long cf_check microcode_update_helper(void *data)
     int ret;
     struct ucode_buf *buffer = data;
     unsigned int cpu, updated;
-    struct microcode_patch *patch;
+    struct patch_with_flags patch_with_flags;
+    bool ucode_force = buffer->flags & XENPF_UCODE_FORCE;
 
     /* cpu_online_map must not change during update */
     if ( !get_cpu_maps() )
@@ -606,16 +622,17 @@ static long cf_check microcode_update_helper(void *data)
         goto put;
     }
 
-    patch = parse_blob(buffer->buffer, buffer->len);
+    patch_with_flags.patch = parse_blob(buffer->buffer, buffer->len);
+    patch_with_flags.flags = buffer->flags;
     xfree(buffer);
-    if ( IS_ERR(patch) )
+    if ( IS_ERR(patch_with_flags.patch) )
     {
-        ret = PTR_ERR(patch);
+        ret = PTR_ERR(patch_with_flags.patch);
         printk(XENLOG_WARNING "Parsing microcode blob error %d\n", ret);
         goto put;
     }
 
-    if ( !patch )
+    if ( !patch_with_flags.patch )
     {
         printk(XENLOG_WARNING "microcode: couldn't find any matching ucode in "
                               "the provided blob!\n");
@@ -632,17 +649,17 @@ static long cf_check microcode_update_helper(void *data)
     {
         enum microcode_match_result result;
 
-        result = alternative_call(ucode_ops.compare_patch, patch,
-                                  microcode_cache);
+        result = alternative_call(ucode_ops.compare_patch,
+                                  patch_with_flags.patch, microcode_cache);
 
         if ( result != NEW_UCODE &&
-             !(opt_ucode_allow_same && result == SAME_UCODE) )
+             !(ucode_force && (result == OLD_UCODE || result == SAME_UCODE)) )
         {
             spin_unlock(&microcode_mutex);
             printk(XENLOG_WARNING
                    "microcode: couldn't find any newer%s revision in the provided blob!\n",
-                   opt_ucode_allow_same ? " (or the same)" : "");
-            microcode_free_patch(patch);
+                   ucode_force? " (or a valid)" : "");
+            microcode_free_patch(patch_with_flags.patch);
             ret = -EEXIST;
 
             goto put;
@@ -674,13 +691,13 @@ static long cf_check microcode_update_helper(void *data)
      *   this requirement can be relaxed in the future. Right now, this is
      *   conservative and good.
      */
-    ret = stop_machine_run(do_microcode_update, patch, NR_CPUS);
+    ret = stop_machine_run(do_microcode_update, &patch_with_flags, NR_CPUS);
 
     updated = atomic_read(&cpu_updated);
     if ( updated > 0 )
     {
         spin_lock(&microcode_mutex);
-        microcode_update_cache(patch);
+        microcode_update_cache(patch_with_flags.patch);
         spin_unlock(&microcode_mutex);
 
         /*
@@ -697,7 +714,7 @@ static long cf_check microcode_update_helper(void *data)
             alternative_vcall(ctxt_switch_masking, current);
     }
     else
-        microcode_free_patch(patch);
+        microcode_free_patch(patch_with_flags.patch);
 
     if ( updated && updated != nr_cores )
         printk(XENLOG_ERR "ERROR: Updating microcode succeeded on %u cores and failed\n"
@@ -775,7 +792,7 @@ int microcode_update_one(void)
     if ( !ucode_ops.apply_microcode )
         return -EOPNOTSUPP;
 
-    return microcode_update_cpu(NULL);
+    return microcode_update_cpu(NULL, 0);
 }
 
 static int __init early_update_cache(const void *data, size_t len)
@@ -858,7 +875,7 @@ static int __init early_microcode_update_cpu(void)
     if ( !patch )
         return -ENOENT;
 
-    return microcode_update_cpu(patch);
+    return microcode_update_cpu(patch, 0);
 }
 
 int __init early_microcode_init(unsigned long *module_map,
diff --git a/xen/arch/x86/cpu/microcode/intel.c b/xen/arch/x86/cpu/microcode/intel.c
index f505aa1b7888..fc80f17d2376 100644
--- a/xen/arch/x86/cpu/microcode/intel.c
+++ b/xen/arch/x86/cpu/microcode/intel.c
@@ -29,6 +29,8 @@
 
 #include "private.h"
 
+#include "public/platform.h"
+
 #define pr_debug(x...) ((void)0)
 
 struct microcode_patch {
@@ -284,21 +286,22 @@ static enum microcode_match_result cf_check compare_patch(
     return compare_revisions(old->rev, new->rev);
 }
 
-static int cf_check apply_microcode(const struct microcode_patch *patch)
+static int cf_check apply_microcode(const struct microcode_patch *patch,
+                                    unsigned int flags)
 {
     uint64_t msr_content;
     unsigned int cpu = smp_processor_id();
     struct cpu_signature *sig = &this_cpu(cpu_sig);
     uint32_t rev, old_rev = sig->rev;
     enum microcode_match_result result;
+    bool ucode_force = flags & XENPF_UCODE_FORCE;
 
     result = microcode_update_match(patch);
 
     if ( result == MIS_UCODE )
         return -EINVAL;
 
-    if ( result == OLD_UCODE ||
-         (result == SAME_UCODE && !opt_ucode_allow_same) )
+    if ( !ucode_force && (result == SAME_UCODE || result == OLD_UCODE) )
         return -EEXIST;
 
     wbinvd();
diff --git a/xen/arch/x86/cpu/microcode/private.h b/xen/arch/x86/cpu/microcode/private.h
index da556fe5060a..017889e1b58d 100644
--- a/xen/arch/x86/cpu/microcode/private.h
+++ b/xen/arch/x86/cpu/microcode/private.h
@@ -3,8 +3,6 @@
 
 #include <asm/microcode.h>
 
-extern bool opt_ucode_allow_same;
-
 enum microcode_match_result {
     OLD_UCODE, /* signature matched, but revision id is older */
     SAME_UCODE, /* signature matched, but revision id is the same */
@@ -50,7 +48,8 @@ struct microcode_ops {
      * Attempt to load the provided patch into the CPU.  Returns an error if
      * anything didn't go as expected.
      */
-    int (*apply_microcode)(const struct microcode_patch *patch);
+    int (*apply_microcode)(const struct microcode_patch *patch,
+                           unsigned int flags);
 
     /*
      * Given two patches, are they both applicable to the current CPU, and is
-- 
2.42.0



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 13:11:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 13:11:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781859.1191366 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh7af-0007im-FN; Thu, 22 Aug 2024 13:11:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781859.1191366; Thu, 22 Aug 2024 13:11:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh7af-0007if-CC; Thu, 22 Aug 2024 13:11:01 +0000
Received: by outflank-mailman (input) for mailman id 781859;
 Thu, 22 Aug 2024 13:11:00 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/1gz=PV=cloud.com=christian.lindig@srs-se1.protection.inumbo.net>)
 id 1sh7ae-0007iX-Ge
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 13:11:00 +0000
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com
 [2a00:1450:4864:20::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f8ee7715-6087-11ef-8776-851b0ebba9a2;
 Thu, 22 Aug 2024 15:10:58 +0200 (CEST)
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a866cea40c4so99244966b.0
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 06:10:58 -0700 (PDT)
Received: from smtpclient.apple ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f2e6717sm119177366b.96.2024.08.22.06.10.56
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 22 Aug 2024 06:10:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f8ee7715-6087-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724332258; x=1724937058; darn=lists.xenproject.org;
        h=to:references:message-id:content-transfer-encoding:cc:date
         :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=NX6c+hZdDk2eG+QGz3L6kD9k217gPMDQNBtN5K1WUGg=;
        b=Y+rRL/MTx1qm86xPiR/j+27C0S+o1ZYVtQbiF/Ray4d5uUvWlVHH6H2zb7ZvT+DVQH
         SiBN7DGpXEfrJQzdo9pttKMyy7qvj4+1v5YfE5SS369y6Xwf1uHxUSagakG3UdE1hS0+
         wDYSvuaYLw+ntB/JdYI/N/ZfUKZi0Ny67e7+k=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724332258; x=1724937058;
        h=to:references:message-id:content-transfer-encoding:cc:date
         :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=NX6c+hZdDk2eG+QGz3L6kD9k217gPMDQNBtN5K1WUGg=;
        b=RG1J32wL+w+l1fCmf4f5RKCQvk+7A3mkRF+iiDAChAH9hrHaIz+UBkjjOGqC8NjCpD
         w8ysIq4omP5gjanpq/bamGfqtgkzGM5R5MFdi2sXHPvWXnkQyahpw29wsPdLiU/Xtsyz
         /UAL0bJ2muoJufqyjV4GM1yuAeS42CDHij7RN4fW/5tzukb3q9OJJfQevMKhhYwDVBjZ
         bRYw60YeXmpYCCsZ8rJUBzyGukb/3quaTXRreG5TfpMDvR/UA3FMsoyBULKuC8X/Fbe+
         j8FKVJQYWEiPfwy7ymG3NBJSN51nIqt4PldlNsDogq9n2TJ9nTtz4s/YJCAdW8jU/nK2
         z9Kw==
X-Forwarded-Encrypted: i=1; AJvYcCWqgS3OBWjYV5bTJqg6G6uAP69uXvT2kFMLNF28FqZz9X02USErBZwI3WkXZdWtCcuNicMyKuk3KK8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxRBPgQUAmBsmkY1BXATHI0/ccqsVd9S8W6hRnGhpLT32mKT83g
	Ae0Hp6BSEQ1ZYsHB+Sz81OXbpVV6kaUoTewCJ2T4iOwSjPjiKgqm7BsV+yjKu00=
X-Google-Smtp-Source: AGHT+IGMEV7OUE86LNJoJYqLOH77Z6g1QQLvtpfKVav8ybwqDmsMhtQOu9rQcc6WzS4vuCrzAkbJhQ==
X-Received: by 2002:a17:907:8687:b0:a77:c199:9d01 with SMTP id a640c23a62f3a-a866f27c1femr414788566b.22.1724332257475;
        Thu, 22 Aug 2024 06:10:57 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\))
Subject: Re: [PATCH v1 1/4] tools/ocaml/common.make: Remove '-cc $(CC)' flag
 from OCAMLOPTFLAGS
From: Christian Lindig <christian.lindig@cloud.com>
In-Reply-To: <e184ccf6-47da-443f-9170-dd503d225bf6@citrix.com>
Date: Thu, 22 Aug 2024 14:10:44 +0100
Cc: Andrii Sultanov <andrii.sultanov@cloud.com>,
 Xen-devel <xen-devel@lists.xenproject.org>,
 Christian Lindig <christian.lindig@citrix.com>,
 David Scott <dave@recoil.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 =?utf-8?B?RWR3aW4gVMO2csO2aw==?= <edwin.torok@cloud.com>
Content-Transfer-Encoding: quoted-printable
Message-Id: <290CECFD-7925-495D-B297-C281F619857E@cloud.com>
References: <cover.1724314239.git.andrii.sultanov@cloud.com>
 <110f63b76a12e8a9fead09f47319a35229222953.1724314239.git.andrii.sultanov@cloud.com>
 <e184ccf6-47da-443f-9170-dd503d225bf6@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
X-Mailer: Apple Mail (2.3774.600.62)



> On 22 Aug 2024, at 13:25, Andrew Cooper <andrew.cooper3@citrix.com> =
wrote:
>=20
> Are there any ABI/API implication from changing the META file?

The META file is for package/library management in an OCaml environment. =
I don=E2=80=99t see much relevance for it in the code that is part of =
the Xen tree - so see no problem changing the version.

=E2=80=94 C




From xen-devel-bounces@lists.xenproject.org Thu Aug 22 13:14:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 13:14:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781867.1191375 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh7du-0008J5-SV; Thu, 22 Aug 2024 13:14:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781867.1191375; Thu, 22 Aug 2024 13:14:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh7du-0008Iy-Pi; Thu, 22 Aug 2024 13:14:22 +0000
Received: by outflank-mailman (input) for mailman id 781867;
 Thu, 22 Aug 2024 13:14:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=raXk=PV=cloud.com=javi.merino@srs-se1.protection.inumbo.net>)
 id 1sh7dt-0008Gq-IC
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 13:14:21 +0000
Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com
 [2a00:1450:4864:20::52c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 719cf292-6088-11ef-a50a-bb4a2ccca743;
 Thu, 22 Aug 2024 15:14:21 +0200 (CEST)
Received: by mail-ed1-x52c.google.com with SMTP id
 4fb4d7f45d1cf-5bed72ff443so1108415a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 06:14:21 -0700 (PDT)
Received: from localhost.localdomain ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a3ead3esm950811a12.46.2024.08.22.06.14.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 06:14:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 719cf292-6088-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724332460; x=1724937260; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=UDfdXttzgzA9qs3QMat1Ti7nIirPW4B0aWCQarpVbak=;
        b=EmW5R+9m0MG2K99H8pYtugvUdX4s4AzFrz9de06ZZsMeQ67yho5EKsiUprkfp/jTZe
         tzbdzEDIx0yypDMTsufTDDoGP/herGRR+mjxBlgSJ8UuTeektok+XTD0iZo8DlzvnbEf
         IhZEzyLZTYnWI2Q/HJLW2C18ZGCMgZNV8dgdo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724332460; x=1724937260;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=UDfdXttzgzA9qs3QMat1Ti7nIirPW4B0aWCQarpVbak=;
        b=O/iQvGN25byzNW8OYREf3fmrVn7unWDWF/YB1B8GgamPmKP3kDMWNSpduB/O2hMrxb
         JLgWmKFmMrlbksOZzXxPacvAzJArKw2wNdsFN640GjICAMoD/jolBnaSiM6OW5ahmWxg
         1KB0SXsBHZU3wrIcJpFN0ag0xzxGrqBq+wjES2E8RZxl83331t7a4VJ0/er/4lfFdOVP
         Rg0ovn3vGT4R6FQejhi0rYwKOiylHwDwTGFs4VjWn63Dku5i+t+B2yzBuu1FG8dY1JZw
         +x5Kb4uvNKNeAC6ywtZSD2/7QRZyxdRjTepK1xi0JlDR89i7+brPoBert+LjWP+6iXZM
         GEPw==
X-Gm-Message-State: AOJu0YwmnnzjLRoSVb/Y0aYpGn1T/VX8oiUpMB18Mr4vwPU2CllP1Ccn
	VQJPqTm9uL6z2/HvZGCl0l66yoTFauy0ZXJvBSfeBTNI1eOaYjiyjzTMdv+l7rd7+RfDpLTUmoI
	5
X-Google-Smtp-Source: AGHT+IE6rgy3HAFkXx9Q9ydfiEQ6UrI0uGgXBjAps/Q8KaGfQRtEIBylcGxpMRCo0MFMQfJuDEqI5g==
X-Received: by 2002:a05:6402:3547:b0:5a1:2735:2378 with SMTP id 4fb4d7f45d1cf-5c079291eacmr1131111a12.30.1724332460185;
        Thu, 22 Aug 2024 06:14:20 -0700 (PDT)
From: Javi Merino <javi.merino@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Javi Merino <javi.merino@cloud.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	=?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@cloud.com>
Subject: [XEN PATCH v1] libxl: Fix nul-termination of the return value of libxl_xen_console_read_line()
Date: Thu, 22 Aug 2024 14:13:57 +0100
Message-ID: <ad7c89bbae34155566ae7c9ca2cb501f21c7d585.1724330921.git.javi.merino@cloud.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

When built with ASAN, "xl dmesg" crashes in the "printf("%s", line)"
call in main_dmesg().  ASAN reports a heap buffer overflow: an
off-by-one access to cr->buffer.

The readconsole sysctl copies up to count characters into the buffer,
but it does not add a null character at the end.  Despite the
documentation of libxl_xen_console_read_line(), line_r is not
nul-terminated if 16384 characters were copied to the buffer.

Fix this by making count one less that the size of the allocated
buffer so that the last byte is always null.

Reported-by: Edwin Török <edwin.torok@cloud.com>
Signed-off-by: Javi Merino <javi.merino@cloud.com>
---
 tools/libs/light/libxl_console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/light/libxl_console.c b/tools/libs/light/libxl_console.c
index a563c9d3c7f9..fa28e2139453 100644
--- a/tools/libs/light/libxl_console.c
+++ b/tools/libs/light/libxl_console.c
@@ -779,7 +779,7 @@ libxl_xen_console_reader *
     cr = libxl__zalloc(NOGC, sizeof(libxl_xen_console_reader));
     cr->buffer = libxl__zalloc(NOGC, size);
     cr->size = size;
-    cr->count = size;
+    cr->count = size - 1;
     cr->clear = clear;
     cr->incremental = 1;
 
-- 
2.44.0



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 14:01:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 14:01:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781884.1191386 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh8NE-0000p4-4G; Thu, 22 Aug 2024 14:01:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781884.1191386; Thu, 22 Aug 2024 14:01:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh8NE-0000ox-1O; Thu, 22 Aug 2024 14:01:12 +0000
Received: by outflank-mailman (input) for mailman id 781884;
 Thu, 22 Aug 2024 14:01:10 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=UkBN=PV=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sh8NC-0000or-R9
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 14:01:10 +0000
Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com
 [2607:f8b0:4864:20::f32])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f9ae65a5-608e-11ef-8776-851b0ebba9a2;
 Thu, 22 Aug 2024 16:01:06 +0200 (CEST)
Received: by mail-qv1-xf32.google.com with SMTP id
 6a1803df08f44-6bf6755323cso4338276d6.1
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 07:01:06 -0700 (PDT)
Received: from fziglio-xenia-fedora.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6c162d4c109sm7872586d6.49.2024.08.22.07.01.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 07:01:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f9ae65a5-608e-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724335265; x=1724940065; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=X5khW8YaAwwfMgjgw8nuSi309AnsACpyZ2iwYQQbG3M=;
        b=DnWje7/BYvjbQJSLbIRFp0xqMC57AyRcMlfg9Sl9eiGu6J5B5U8tBIg2xEYqJbDxBM
         x7mSpA4t1Bbfh+X0aTykbFYXl2IPYpqLAefwFt8Geu2ftYrKt6noM1GK55mG3TR3vzwi
         z4LP+pMqkaswlvNKdE2hRIspS6aWdSydJgMxY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724335265; x=1724940065;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=X5khW8YaAwwfMgjgw8nuSi309AnsACpyZ2iwYQQbG3M=;
        b=tsbi78xfF6DbtmUW6Byd/zecIQeWjI8a3MUFTekvBa9wt3ht9801ztUgvg3/aAU/RS
         Y8noSzBYeGfHtI8/6sH0Km/ZZZ27oreJpMoA+Flsu6A+Rm0ysQR2+tW8ITglyaj/dfHh
         Hu7Bl1P8NGzwCuR9HKc7bIRYe9uXuY/qpdf7djUlNtJ0ufaB1nPPgcDkAcCu0CcHRVc4
         EbIlI5SProPYJ2+YJoTWoguezO9M9/0XuSYxp6aiC6oFgr6GkLO0zDskJ31GXWBpRI85
         hKqlffWU3kBV+a7wxuWXbZztB0WaQzf8otTrbc5E5nj+Leb1HzMHJSb6mo/6u0mkugOs
         6FLw==
X-Gm-Message-State: AOJu0YyBLear8Gq8BLHY+pyWlz6mb1i/bkb9oeUjmSJZRihDN/NN4KVr
	M21ai6UABQZLI3/gPGcqBDDud11L1xkW5LtwxDNb3hAdugFM3HclEPsLRCKH18C/xO+ieMyLEvo
	g
X-Google-Smtp-Source: AGHT+IFTwIfHUxyJqPhqRnhQRnWSCdyuMoNRg5aSCiDzJIKW0BzQcLD+qPzatTyU1NObIezm7fa3KQ==
X-Received: by 2002:a05:6214:4612:b0:6b4:4585:8e43 with SMTP id 6a1803df08f44-6c155d9d07amr74983806d6.31.1724335263878;
        Thu, 22 Aug 2024 07:01:03 -0700 (PDT)
From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v2] Restore memory used for IP computation
Date: Thu, 22 Aug 2024 15:00:43 +0100
Message-ID: <20240822140044.441126-1-frediano.ziglio@cloud.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

We need to write in some location but no reasons to not
trying to restore what we potentially overwrote.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/head.S | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)
---
Changes since v1:
- Rewrite magic number field instead of some possible BIOS area.

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index d8ac0f0494..9b7e7b4e51 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -415,16 +415,19 @@ __pvh_start:
 
         /*
          * We need one push/pop to determine load address.  Use the same
-         * absolute stack address as the native path, for lack of a better
-         * alternative.
+         * stack address as the native path.
          */
-        mov     $0x1000, %esp
+        mov     %ebx, %esp
+        pop     %edx
 
         /* Calculate the load base address. */
         call    1f
 1:      pop     %esi
         sub     $sym_offs(1b), %esi
 
+        /* Restore clobbered magic field */
+        push    %edx
+
         /* Set up stack. */
         lea     STACK_SIZE - CPUINFO_sizeof + sym_esi(cpu0_stack), %esp
 
@@ -463,18 +466,21 @@ __start:
          * relocatable images, where one push/pop is required to calculate
          * images load address.
          *
-         * On a BIOS-based system, the IVT and BDA occupy the first 5/16ths of
-         * the first page of RAM, with the rest free for use.  Use the top of
-         * this page for a temporary stack, being one of the safest locations
-         * to clobber.
+         * Save and restore the magic field of start_info in ebx, and use
+         * that as the stack. See also
+         * https://lore.kernel.org/xen-devel/20240814195053.5564-3-jason.andryuk@amd.com/
          */
-        mov     $0x1000, %esp
+        mov     %ebx, %esp
+        pop     %edx
 
         /* Calculate the load base address. */
         call    1f
 1:      pop     %esi
         sub     $sym_offs(1b), %esi
 
+        /* Restore clobbered magic field */
+        push    %edx
+
         /* Set up stack. */
         lea     STACK_SIZE - CPUINFO_sizeof + sym_esi(cpu0_stack), %esp
 
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 14:31:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 14:31:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781893.1191396 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh8qL-0006B1-BQ; Thu, 22 Aug 2024 14:31:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781893.1191396; Thu, 22 Aug 2024 14:31:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh8qL-0006Au-8W; Thu, 22 Aug 2024 14:31:17 +0000
Received: by outflank-mailman (input) for mailman id 781893;
 Thu, 22 Aug 2024 14:31:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=R3RO=PV=cloud.com=edwin.torok@srs-se1.protection.inumbo.net>)
 id 1sh8qJ-0006Ao-Mo
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 14:31:15 +0000
Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com
 [2001:4860:4864:20::34])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2ebf3e93-6093-11ef-a50a-bb4a2ccca743;
 Thu, 22 Aug 2024 16:31:14 +0200 (CEST)
Received: by mail-oa1-x34.google.com with SMTP id
 586e51a60fabf-2702ed1054fso578130fac.3
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 07:31:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2ebf3e93-6093-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724337073; x=1724941873; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=RY74Mxj/2wmPmwUp1NjOvHV4cp/o/DJFi8b1s+2pXY4=;
        b=WSFpHtwY3ujO4NSVS8pKbDJZwGzFCpd8uG3rZ/KCg9Yk8qTEc1weWySrBWjkMX/dvh
         d9Nz9nU+Z/AV26OBK538Su5tgoU0DaX8bVw/gEnNzi67P48KP/p9WDG2EBxHFRd0JR28
         RnRGEtc11weV3Wkevqy3Ejn/BBV7NHjQD5bHc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724337073; x=1724941873;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=RY74Mxj/2wmPmwUp1NjOvHV4cp/o/DJFi8b1s+2pXY4=;
        b=CPr1hZVm/6TbUDQtggRFZ48L3G2+mDGpeAmCnwAqjBrjreiIhn00UjM+TzUakmocEr
         cvq5cQ0KFMJPNIye0U3l/F8RQTEouATQbtDKGlBlmobJvq0Eu0Ky+lNCrdiDvP+DgvKa
         Xh5TBuBiyDg21vg+dJcGF7WZhQ7WlVrLSGFQ7VM0wLFA3Sg79BPaAwPhnN6NtOk0C7W2
         ajWzviVDPJFl/P4S1r2TS/vbp7tzaB+Nztak8j+kqGryecrj29nu1tFFUNLf5nZWDOfy
         WzH2dqSAH6kos62N+MQ2n3XO+mFMuAKjFUpSAcX0vVcLDjLiHWu3f/Ib2vOLaiGs/9dP
         OCXQ==
X-Forwarded-Encrypted: i=1; AJvYcCXpIp8LQmEuXmzl6EiWBN/5LQ/bOwIFP3R2LuXFB2txDWROqOY3VmWyrX4q93fFhRl3ml3ohwIOeUc=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yypl5uO6Jx3pNFkfpmMaKBtWGOwwbT2IHc0ZOGz+NT6+7XTEwh+
	I0sOGcSIeE+PQyzqmIA/ARyY0KzlGjJYfT+PFYXuhDBWvQaPfJDJDDq8Xbjie5UMwOkHnOTvJNt
	3pu4x/8HrovSR449nSlHerGuwwUeR3FeeulXV9Q==
X-Google-Smtp-Source: AGHT+IEdztJOlEZd3Om0EFjg166QHgA6ZJFhf1ue2oW00p23YZqS0xJvvOXKym3fFgPFE7VDiaUlpgc0Sv13Nmrih7c=
X-Received: by 2002:a05:6870:82a8:b0:25e:e6d:5247 with SMTP id
 586e51a60fabf-273cfc55beamr2449508fac.14.1724337072652; Thu, 22 Aug 2024
 07:31:12 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1724314239.git.andrii.sultanov@cloud.com>
 <110f63b76a12e8a9fead09f47319a35229222953.1724314239.git.andrii.sultanov@cloud.com>
 <e184ccf6-47da-443f-9170-dd503d225bf6@citrix.com>
In-Reply-To: <e184ccf6-47da-443f-9170-dd503d225bf6@citrix.com>
From: Edwin Torok <edwin.torok@cloud.com>
Date: Thu, 22 Aug 2024 15:31:01 +0100
Message-ID: <CAEfZLvm3m_UprvhCbgG2+jLas_Oi_mFsGqUC2gOBr_ZPssbqCw@mail.gmail.com>
Subject: Re: [PATCH v1 1/4] tools/ocaml/common.make: Remove '-cc $(CC)' flag
 from OCAMLOPTFLAGS
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Andrii Sultanov <andrii.sultanov@cloud.com>, xen-devel@lists.xenproject.org, 
	Christian Lindig <christian.lindig@citrix.com>, David Scott <dave@recoil.org>, 
	Anthony PERARD <anthony.perard@vates.tech>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Aug 22, 2024 at 1:25=E2=80=AFPM Andrew Cooper <andrew.cooper3@citri=
x.com> wrote:
>
> On 22/08/2024 10:06 am, Andrii Sultanov wrote:
> > This flag does not work as assumed and will not pass
> > options (such as -shared) to the C compiler:
> > https://github.com/ocaml/ocaml/issues/12284
> >
> > Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
> > ---
> >  tools/ocaml/common.make | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
> > index 0c8a597d5b..cc126b749f 100644
> > --- a/tools/ocaml/common.make
> > +++ b/tools/ocaml/common.make
> > @@ -12,7 +12,7 @@ OCAMLFIND ?=3D ocamlfind
> >  CFLAGS +=3D -fPIC -I$(shell ocamlc -where)
> >
> >  OCAMLOPTFLAG_G :=3D $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\)=
 .*/\1/p')
> > -OCAMLOPTFLAGS =3D $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAM=
LINCLUDE) -cc $(CC) -w F -warn-error F
> > +OCAMLOPTFLAGS =3D $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAM=
LINCLUDE) -w F -warn-error F
> >  OCAMLCFLAGS +=3D -g $(OCAMLINCLUDE) -w F -warn-error F
> >
> >  VERSION :=3D 4.1
>
> This patch itself is fine, and I'll commit it in due course, but then I
> got looking at the surrounding context...
>
> `$(OCAMLOPT) -h` tells you on stderr to try `--help instead`, so
> OCAMLOPTFLAG_G is never going to contain -g.
>
> Also, why is -g conditional for OCAMLOPTFLAGS but unconditional for
> OCAMLCFLAGS?  I think we can safely drop OCAMLOPTFLAG_G

I'm not aware of a version of OCaml that didn't support -g, but maybe
a very old version (that wouldn't pass the minimum version check)
didn't have it.
I agree that we can safely drop the conditional and always pass `-g`.
>
>
> Next, there's VERSION and git grep says its only used in META files.
>
> xen.git/tools/ocaml$ git grep -w VERSION
> Makefile.rules:43:      sed 's/@VERSION@/$(VERSION)/g' < $< $o
> common.make:18:VERSION :=3D 4.1
> libs/eventchn/META.in:1:version =3D "@VERSION@"
> libs/mmap/META.in:1:version =3D "@VERSION@"
> libs/xb/META.in:1:version =3D "@VERSION@"
> libs/xc/META.in:1:version =3D "@VERSION@"
> libs/xenstoredglue/META.in:1:version =3D "@VERSION@"
> libs/xenstoredglue/domain_getinfo_plugin_v1/META.in:1:version =3D "@VERSI=
ON@"
> libs/xs/META.in:1:version =3D "@VERSION@"
>
> 4.1 is very very stale and should say 4.19 these days (definitely for
> xc, and whatever else is using an unstable API), yet should definitely
> not be 4.19 for xenstoredglue.
>
> Are there any ABI/API implication from changing the META file?

It is purely informational (e.g. show up in the output of `ocamlfind
list`), dependency resolution is done using `opam` files (which Xen
doesn't have), not `META` files.
You can link some code into an executable that lists the versions of
all the libraries that it got linked with (using an OCamlfind module),
and in that case it might be nice to have correct information there,
but I don't think any of our code does that.

>
> ~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 15:26:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 15:26:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781914.1191406 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh9hB-0006Q1-DE; Thu, 22 Aug 2024 15:25:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781914.1191406; Thu, 22 Aug 2024 15:25:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh9hB-0006Pu-9s; Thu, 22 Aug 2024 15:25:53 +0000
Received: by outflank-mailman (input) for mailman id 781914;
 Thu, 22 Aug 2024 15:25:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sh9hA-0006Pk-DC; Thu, 22 Aug 2024 15:25:52 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sh9hA-0007SY-5V; Thu, 22 Aug 2024 15:25:52 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sh9h9-0002PQ-Mr; Thu, 22 Aug 2024 15:25:51 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sh9h9-0000XB-ML; Thu, 22 Aug 2024 15:25:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=kWou21moGuPxZM/dgtSL+niGu5AMavGIzCTAy7q0nEI=; b=lLqKHLf17ZBQzOESMquLr4PP6z
	ZGRTigfi9qpZ+PsNX46F6cZEL/OVLZRrMC7a72WOVfXYWejkJ1iuUTM93GJHaDz75fyF8JYjQAZeT
	ok6FW5b4hEcr6a49+EOjTwQwB9P7JYl9QXDLOLSgWwenYUQE6akY9xn5oRFtHhPg5sAM=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187310-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187310: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=394c9d88858cd99fcb5a189dbabe2af34dbabfd3
X-Osstest-Versions-That:
    xen=6d41a9d8a12ff89adabdc286e63e9391a0481699
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 22 Aug 2024 15:25:51 +0000

flight 187310 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187310/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  394c9d88858cd99fcb5a189dbabe2af34dbabfd3
baseline version:
 xen                  6d41a9d8a12ff89adabdc286e63e9391a0481699

Last test of basis   187304  2024-08-21 23:03:58 Z    0 days
Testing same since   187310  2024-08-22 11:02:18 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Amneesh Singh <a-singh21@ti.com>
  Ayan Kumar Halder <ayan.kumar.halder@amd.com>
  Julien Grall <jgrall@amazon.com>
  Julien Grall <julien@xen.org>
  Michal Orzel <michal.orzel@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   6d41a9d8a1..394c9d8885  394c9d88858cd99fcb5a189dbabe2af34dbabfd3 -> smoke


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 15:30:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 15:30:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781923.1191416 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh9lK-0008Qr-TR; Thu, 22 Aug 2024 15:30:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781923.1191416; Thu, 22 Aug 2024 15:30:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sh9lK-0008Qk-Qa; Thu, 22 Aug 2024 15:30:10 +0000
Received: by outflank-mailman (input) for mailman id 781923;
 Thu, 22 Aug 2024 15:30:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=UkBN=PV=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sh9lK-0008Qe-1V
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 15:30:10 +0000
Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com
 [2607:f8b0:4864:20::332])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 69296f36-609b-11ef-a50a-bb4a2ccca743;
 Thu, 22 Aug 2024 17:30:08 +0200 (CEST)
Received: by mail-ot1-x332.google.com with SMTP id
 46e09a7af769-7093472356dso634401a34.0
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 08:30:07 -0700 (PDT)
Received: from fziglio-xenia-fedora.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 d75a77b69052e-454fe0f436dsm7786131cf.49.2024.08.22.08.30.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 08:30:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 69296f36-609b-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724340606; x=1724945406; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=H8/O+XAPl/QbSGBgMlq8pwRffeZEEcEmslfFS5zb4s8=;
        b=AX8NugHCZScxNDibQvrPW3myN8hrtL96DRJ4odKO9w3QKPnnFC7ETXeskMar6JRV+W
         Nv08ZzpuSUq2gWbACnkm4G6HoDMxHFtBVf+A+tDNwh74HG/TZiG7uRRd748llKxr7jhF
         oXkhE7C2A0BS50wRgWHYzYLpSIoILTRxt4vLY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724340606; x=1724945406;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=H8/O+XAPl/QbSGBgMlq8pwRffeZEEcEmslfFS5zb4s8=;
        b=syXFNBJfMI8Hye1FKuEmGBi35xWqc6/U/D6Ng+JU7+gVN1MafAlomOmPHbQskIC4Pb
         DJSUMn3yh+EFlopMO78K70s3pVyhSJM/+815hDaBIOfC5rk8r3T5FkowDJNVdCn0e8a/
         f401UqytBbOaM7WL0pRA141IHTkr38ws99u6FdXxBKPvjRIYL6ZP+sqLeIPEddZSeI9g
         b/FUsszyWDxNV/fOWtBOZl0j1srNxYOmKfqbxFeorBvEMXOzRGBiyicfT1GGdctlJcLc
         dlI4Y1P8NpRehC2ORokw8MlcsKH96fhSjcpdunuYTyjbVSsGQKy11YwC5QPPUqk0IrMY
         UicA==
X-Gm-Message-State: AOJu0YyFKHec7GsVstZNe8tSwrBrBQQJyNp4b57UJTkD6v9jX0HvJCv8
	rat6Kq65uwl94HD35kSDfOCHOd+dUg6tFHHZQRvObkdSE0wuaIxi5nZJt4xdduT89yuAvY/OVeO
	Q
X-Google-Smtp-Source: AGHT+IHojBVGHlDnRnHtYNhrvvyH3Ndv53rdneGOEakuYJ4P94fC6ZKkytP2uY0gFCQDmiUZkibDlA==
X-Received: by 2002:a05:6808:2226:b0:3d9:245c:4225 with SMTP id 5614622812f47-3de19c77a7fmr7450539b6e.6.1724340606557;
        Thu, 22 Aug 2024 08:30:06 -0700 (PDT)
From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	"Alejandro Vallejo" <alejandro.vallejo@cloud.com>
Subject: [PATCH] Avoid additional relocations in trampoline code
Date: Thu, 22 Aug 2024 16:29:51 +0100
Message-ID: <20240822152953.489136-1-frediano.ziglio@cloud.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The trampoline could have "manual" relocation entries (created
by assembly macros and some code to use them) and (in case of PE)
normal executable relocations.
Remove all normal executable ones. In this way we don't have to
worry about applying both correctly (they need proper order
which is hard to spot looking at the code).

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/trampoline.S | 4 ++--
 xen/arch/x86/boot/wakeup.S     | 6 +++---
 xen/arch/x86/xen.lds.S         | 7 ++++++-
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index b8ab0ffdcb..0724c953e2 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -73,7 +73,7 @@ trampoline_protmode_entry:
         mov     %ecx,%cr4
 
         /* Load pagetable base register. */
-        mov     $sym_offs(idle_pg_table),%eax
+        mov     $idle_pg_table_pa, %eax
         add     bootsym_rel(trampoline_xen_phys_start,4,%eax)
         mov     %eax,%cr3
 
@@ -113,7 +113,7 @@ trampoline_protmode_entry:
         .code64
 start64:
         /* Jump to high mappings. */
-        movabs  $__high_start, %rdi
+        movabs  $__high_start_pa + __XEN_VIRT_START, %rdi
         jmpq    *%rdi
 
 #include "video.h"
diff --git a/xen/arch/x86/boot/wakeup.S b/xen/arch/x86/boot/wakeup.S
index 08447e1934..ebe72e1fdd 100644
--- a/xen/arch/x86/boot/wakeup.S
+++ b/xen/arch/x86/boot/wakeup.S
@@ -99,7 +99,7 @@ wakeup_32:
         mov     $bootsym_rel(wakeup_stack, 4, %esp)
 
         # check saved magic again
-        mov     $sym_offs(saved_magic),%eax
+        mov     $saved_magic_pa, %eax
         add     bootsym_rel(trampoline_xen_phys_start, 4, %eax)
         mov     (%eax), %eax
         cmp     $0x9abcdef0, %eax
@@ -112,7 +112,7 @@ wakeup_32:
         mov     %ecx, %cr4
 
         /* Load pagetable base register */
-        mov     $sym_offs(idle_pg_table),%eax
+        mov     $idle_pg_table_pa ,%eax
         add     bootsym_rel(trampoline_xen_phys_start,4,%eax)
         mov     %eax,%cr3
 
@@ -156,7 +156,7 @@ wakeup_32:
         .code64
 wakeup_64:
         /* Jump to high mappings and the higher-level wakeup code. */
-        movabs  $s3_resume, %rbx
+        movabs  $s3_resume_pa + __XEN_VIRT_START, %rbx
         jmp     *%rbx
 
 bogus_saved_magic:
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 9a1dfe1b34..8e604dde48 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -71,7 +71,12 @@ SECTIONS
   __2M_text_start = .;         /* Start of 2M superpages, mapped RX. */
 #endif
 
-  start_pa = ABSOLUTE(start - __XEN_VIRT_START);
+#define DEFINE_PA_ADDRESS(sym) sym ## _pa = ABSOLUTE(sym - __XEN_VIRT_START)
+  DEFINE_PA_ADDRESS(start);
+  DEFINE_PA_ADDRESS(saved_magic);
+  DEFINE_PA_ADDRESS(idle_pg_table);
+  DEFINE_PA_ADDRESS(__high_start);
+  DEFINE_PA_ADDRESS(s3_resume);
 
   . = __XEN_VIRT_START + XEN_IMG_OFFSET;
   _start = .;
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 17:47:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 17:47:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781948.1191427 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shBtW-0004KF-Ba; Thu, 22 Aug 2024 17:46:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781948.1191427; Thu, 22 Aug 2024 17:46:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shBtW-0004K8-7N; Thu, 22 Aug 2024 17:46:46 +0000
Received: by outflank-mailman (input) for mailman id 781948;
 Thu, 22 Aug 2024 17:42:01 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=kYXT=PV=kernel.org=kees@srs-se1.protection.inumbo.net>)
 id 1shBov-0003m2-Ag
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 17:42:01 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d2bae648-60ad-11ef-8776-851b0ebba9a2;
 Thu, 22 Aug 2024 19:41:57 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 371EACE0599;
 Thu, 22 Aug 2024 17:41:52 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63DECC32782;
 Thu, 22 Aug 2024 17:41:51 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d2bae648-60ad-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724348511;
	bh=EIA1hEYwm1C2TI9GOWGiHROnOXNDw/yWFqOCejDP7oo=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To:From;
	b=Gr6enR+36v6pPq8NzbStvk6GTD120FWyjr6SQHOSZ7oQZpGhHbE+1VFa7NmXzNFnV
	 qi9pD51GM1eorajAlFle0jVSHC7W6LbGVrGiREVBiuNEiHH3B3qNcmrRVlqKJFaMQV
	 p+i9fSRcqakGYyoDrlBKXgaSoNXToyXX3zswYTJ20xS6GPs5aBC6JREBgC7bYxuKty
	 samd23N8OLvgX9JLDVN5PkLwpLwejSwKlmXBzsTjJMNECaEERrZ62oEo0ixmayO4bF
	 15Btlg/GzTisTXtSygtdIZjkZssPtoTcuZ/ZMqLpfh/QuoIHPe63hDWTmkKR9w5q7e
	 RFUJdoo4HNANg==
Date: Thu, 22 Aug 2024 10:41:50 -0700
From: Kees Cook <kees@kernel.org>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH][next] xen/pci: Avoid -Wflex-array-member-not-at-end
 warning
Message-ID: <202408221040.2961A81@keescook>
References: <ZsU58MvoYEEqBHZl@elsanto>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <ZsU58MvoYEEqBHZl@elsanto>

On Tue, Aug 20, 2024 at 06:50:56PM -0600, Gustavo A. R. Silva wrote:
> Use the `DEFINE_RAW_FLEX()` helper for an on-stack definition of
> a flexible structure where the size of the flexible-array member
> is known at compile-time, and refactor the rest of the code,
> accordingly.
> 
> So, with this, fix the following warning:
> 
> drivers/xen/pci.c:48:55: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
> 
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> ---
>  drivers/xen/pci.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c
> index 72d4e3f193af..a2facd8f7e51 100644
> --- a/drivers/xen/pci.c
> +++ b/drivers/xen/pci.c
> @@ -44,15 +44,11 @@ static int xen_add_device(struct device *dev)
>  	}
>  #endif
>  	if (pci_seg_supported) {
> -		struct {
> -			struct physdev_pci_device_add add;
> -			uint32_t pxm;
> -		} add_ext = {
> -			.add.seg = pci_domain_nr(pci_dev->bus),
> -			.add.bus = pci_dev->bus->number,
> -			.add.devfn = pci_dev->devfn
> -		};
> -		struct physdev_pci_device_add *add = &add_ext.add;
> +		DEFINE_RAW_FLEX(struct physdev_pci_device_add, add, optarr, 1);
> +
> +		add->seg = pci_domain_nr(pci_dev->bus);
> +		add->bus = pci_dev->bus->number;
> +		add->devfn = pci_dev->devfn;
>  
>  #ifdef CONFIG_ACPI
>  		acpi_handle handle;

Looks correct to me!

Reviewed-by: Kees Cook <kees@kernel.org>

-- 
Kees Cook


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 18:19:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 18:19:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781963.1191436 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shCP9-0001Cs-Qe; Thu, 22 Aug 2024 18:19:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781963.1191436; Thu, 22 Aug 2024 18:19:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shCP9-0001Cl-NS; Thu, 22 Aug 2024 18:19:27 +0000
Received: by outflank-mailman (input) for mailman id 781963;
 Thu, 22 Aug 2024 18:11:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=90+L=PV=gmail.com=aha310510@srs-se1.protection.inumbo.net>)
 id 1shCHf-0000Z4-4W
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 18:11:43 +0000
Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com
 [2607:f8b0:4864:20::633])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fa872f73-60b1-11ef-8776-851b0ebba9a2;
 Thu, 22 Aug 2024 20:11:41 +0200 (CEST)
Received: by mail-pl1-x633.google.com with SMTP id
 d9443c01a7336-201fbd0d7c2so11091805ad.0
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 11:11:40 -0700 (PDT)
Received: from kernelexploit-virtual-machine.localdomain ([121.185.186.233])
 by smtp.gmail.com with ESMTPSA id
 d9443c01a7336-20385580831sm15450765ad.76.2024.08.22.11.11.36
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 11:11:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fa872f73-60b1-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724350299; x=1724955099; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=DNG67etRpmbFoR543m1YIG0LZE60EP8XIWtrKthQBgo=;
        b=NiK8StwncW8vPAvd6j4jNsgtJ8Iw313Ba5rB+MduNWB9PvACDwmJ/AQZh/dtwvos70
         Wpl+TdFfY0fBd3FX8GTgIGTWOMm3sxe9UbXgg65rz41A8tw41VMtoMardwag+QoP+qpw
         ILwVOWGDWaa2A095BaywshR3UnTsCXbvZXFKzd61hvZJR1M1QDV1haT+sdZkzy4vmEvY
         4coxXXajzqcLFcvvqlyCpuPDGwTB61id84+j8y99MSpJPBm+pE7LRnh0SPPfQyWeoGdr
         41hAfWIf+qK7VNlLQ/4yvv4pOroJktgkZAvmrVlFa1voUJdkTVAV2LGPnll1AorNT7DD
         MaTA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724350299; x=1724955099;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=DNG67etRpmbFoR543m1YIG0LZE60EP8XIWtrKthQBgo=;
        b=SzayclWg/rFN2UR4TKhSn2WhcuLkptxaaiwx6HePNJiCHqHK+NL7qY1Ef14B0N9yh7
         Wbjtp0zakda2f7YKS0qRJiH999qMxoxpa/FO6rCekqP7WLgkbCfMcAITmL+saSASnwVM
         pVuQZ9AOe5/Pn9KdTcujaX7wEIlzya8mTABAYPN2FXCgISZpOE64iDaER416Uwxx6CJV
         eGMH19AWnmAVanWV8nea/eITCuFCvTIExdC+E0R+roKT+pOCMxt9IJoImfjhkbsMqTuM
         PTHW9XsBVUvJhO6+tsHm7Rr4d2vIlpPfTPWRk1Cq6BheeWSrpPJhhVc4PLvkbpPgit9R
         t26w==
X-Forwarded-Encrypted: i=1; AJvYcCXqdsECazxI241YL8TR9hnJL075pZwOz8hfMR6yw+SBpHfnQvBR+n7CQHIUB44rujhlBT2c+1DQGq4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwhRj6Z6+upMt3kK5bt2QwKwXZlv9j1llowkrgIMl/FITTo4qjR
	N3zYmvza6ADSLzceQnJhs8KonD3ytvZZuIRzZaI1CwVW6LVnyKHl
X-Google-Smtp-Source: AGHT+IEsv5bpxwIHa8vqXEhWiIUlfLxE0wILbUZew8Lm3s6hLcp/D+7eE72ll9aRakt9he4VallMUg==
X-Received: by 2002:a17:902:f98b:b0:1fd:9105:7dd3 with SMTP id d9443c01a7336-203681d8e0emr53955695ad.64.1724350299146;
        Thu, 22 Aug 2024 11:11:39 -0700 (PDT)
From: Jeongjun Park <aha310510@gmail.com>
To: wei.liu@kernel.org,
	paul@xen.org
Cc: davem@davemloft.net,
	edumazet@google.com,
	kuba@kernel.org,
	pabeni@redhat.com,
	madhuparnabhowmik04@gmail.com,
	xen-devel@lists.xenproject.org,
	netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Jeongjun Park <aha310510@gmail.com>
Subject: [PATCH net] net/xen-netback: prevent UAF in xenvif_flush_hash()
Date: Fri, 23 Aug 2024 03:11:09 +0900
Message-Id: <20240822181109.2577354-1-aha310510@gmail.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

During the list_for_each_entry_rcu iteration call of xenvif_flush_hash, 
kfree_rcu does not exist inside the rcu read critical section, so if 
kfree_rcu is called when the rcu grace period ends during the iteration, 
UAF occurs when accessing head->next after the entry becomes free.

Therefore, to solve this, you need to change it to list_for_each_entry_safe.

Fixes: f3265971ded9 ("net: xen-netback: hash.c: Use built-in RCU list checking")
Signed-off-by: Jeongjun Park <aha310510@gmail.com>
---
 drivers/net/xen-netback/hash.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/xen-netback/hash.c b/drivers/net/xen-netback/hash.c
index ff96f22648ef..45ddce35f6d2 100644
--- a/drivers/net/xen-netback/hash.c
+++ b/drivers/net/xen-netback/hash.c
@@ -95,7 +95,7 @@ static u32 xenvif_new_hash(struct xenvif *vif, const u8 *data,
 
 static void xenvif_flush_hash(struct xenvif *vif)
 {
-	struct xenvif_hash_cache_entry *entry;
+	struct xenvif_hash_cache_entry *entry, *n;
 	unsigned long flags;
 
 	if (xenvif_hash_cache_size == 0)
@@ -103,8 +103,7 @@ static void xenvif_flush_hash(struct xenvif *vif)
 
 	spin_lock_irqsave(&vif->hash.cache.lock, flags);
 
-	list_for_each_entry_rcu(entry, &vif->hash.cache.list, link,
-				lockdep_is_held(&vif->hash.cache.lock)) {
+	list_for_each_entry_safe(entry, n, &vif->hash.cache.list, link) {
 		list_del_rcu(&entry->link);
 		vif->hash.cache.count--;
 		kfree_rcu(entry, rcu);
--


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 20:29:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 20:29:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781978.1191450 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shEQk-0004y5-HW; Thu, 22 Aug 2024 20:29:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781978.1191450; Thu, 22 Aug 2024 20:29:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shEQk-0004xy-D9; Thu, 22 Aug 2024 20:29:14 +0000
Received: by outflank-mailman (input) for mailman id 781978;
 Thu, 22 Aug 2024 20:29:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=z8t6=PV=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1shEQi-0004wZ-G7
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 20:29:12 +0000
Received: from nyc.source.kernel.org (nyc.source.kernel.org
 [2604:1380:45d1:ec00::3])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 30163e7d-60c5-11ef-a50a-bb4a2ccca743;
 Thu, 22 Aug 2024 22:29:11 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by nyc.source.kernel.org (Postfix) with ESMTP id 0E7E6A41C9A;
 Thu, 22 Aug 2024 20:29:03 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91718C32782;
 Thu, 22 Aug 2024 20:29:08 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 30163e7d-60c5-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724358549;
	bh=ydtin9HkoF6QTW34g+HZHLPPVH2Wjjm2tpLx112Xjj8=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=NtAmKdUGM3MlU4x/LM77B9dYyd6wdlDt7ukJCjKpqe5UAbiBeQDSLO0djJ0VJsDSS
	 66BrlxWkbhra8XQkwC2hbX4Mp3Eo8CkxAJbT6KoS4P2+G3y1Gefxa38ncDySbdySa+
	 6EVlyEL/hBKyr5MSmu1h1E4R92C+1/TxMB8SRITxSvkAV7dKt+IJxkFax5HG88e/3t
	 P83JqSZJH1zR5EqnRdjtdW/32I17rFfjmTxaVK/OrV6ej2Xw3UfPQgQk5rguZCu3O1
	 eEFvy6MMmgNgG/ac5ZPiNH3v9AFhw3ifHEItBUfvWwSYlSq+c9b53kMHoDq+81dO3l
	 uM/9/rZSTmxsA==
Date: Thu, 22 Aug 2024 13:29:07 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Bertrand Marquis <Bertrand.Marquis@arm.com>
cc: Michal Orzel <michal.orzel@amd.com>, 
    Ayan Kumar Halder <ayan.kumar.halder@amd.com>, 
    Xen-devel <xen-devel@lists.xenproject.org>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Artem Mygaiev <artem_mygaiev@epam.com>
Subject: Re: [PATCH] docs: fusa: Add requirements for generic timer
In-Reply-To: <D3358591-F9E2-44A6-A22A-FC2AA8857C68@arm.com>
Message-ID: <alpine.DEB.2.22.394.2408221327400.3871186@ubuntu-linux-20-04-desktop>
References: <20240820103816.1661102-1-ayan.kumar.halder@amd.com> <5F0AF572-3437-4372-96EB-42F46B3A3155@arm.com> <101a7105-5638-4c69-a5b0-29c252284aea@amd.com> <D3358591-F9E2-44A6-A22A-FC2AA8857C68@arm.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 21 Aug 2024, Bertrand Marquis wrote:
> > On 22 Aug 2024, at 11:00, Michal Orzel <michal.orzel@amd.com> wrote:
> > 
> > Hi Bertrand,
> > 
> > I agree with all your comments with a few exceptions, as stated below.
> > 
> > On 21/08/2024 17:06, Bertrand Marquis wrote:
> >> 
> >> 
> >> Hi Ayan,
> >> 
> >>> On 20 Aug 2024, at 12:38, Ayan Kumar Halder <ayan.kumar.halder@amd.com> wrote:
> >>> 
> >>> From: Michal Orzel <michal.orzel@amd.com>
> >>> 
> >>> Add the requirements for the use of generic timer by a domain
> >>> 
> >>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> >>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> >>> ---
> >>> .../reqs/design-reqs/arm64/generic-timer.rst  | 139 ++++++++++++++++++
> >>> docs/fusa/reqs/index.rst                      |   3 +
> >>> docs/fusa/reqs/intro.rst                      |   3 +-
> >>> docs/fusa/reqs/market-reqs/reqs.rst           |  34 +++++
> >>> docs/fusa/reqs/product-reqs/arm64/reqs.rst    |  24 +++
> >>> 5 files changed, 202 insertions(+), 1 deletion(-)
> >>> create mode 100644 docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
> >>> create mode 100644 docs/fusa/reqs/market-reqs/reqs.rst
> >>> create mode 100644 docs/fusa/reqs/product-reqs/arm64/reqs.rst
> >>> 
> >>> diff --git a/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
> >>> new file mode 100644
> >>> index 0000000000..bdd4fbf696
> >>> --- /dev/null
> >>> +++ b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
> >>> @@ -0,0 +1,139 @@
> >>> +.. SPDX-License-Identifier: CC-BY-4.0
> >>> +
> >>> +Generic Timer
> >>> +=============
> >>> +
> >>> +The following are the requirements related to ARM Generic Timer [1] interface
> >>> +exposed by Xen to Arm64 domains.
> >>> +
> >>> +Probe the Generic Timer device tree node from a domain
> >>> +------------------------------------------------------
> >>> +
> >>> +`XenSwdgn~arm64_generic_timer_probe_dt~1`
> >>> +
> >>> +Description:
> >>> +Xen shall generate a device tree node for the Generic Timer (in accordance to
> >>> +ARM architected timer device tree binding [2]).
> >> 
> >> You might want to say where here. The domain device tree ?
> >> 
> >>> +
> >>> +Rationale:
> >>> +
> >>> +Comments:
> >>> +Domains shall probe the Generic Timer device tree node.
> >> 
> >> Please prevent the use of "shall" here. I would use "can".
> >> Also detect the presence of might be better than probe.
> >> 
> >>> +
> >>> +Covers:
> >>> + - `XenProd~emulated_timer~1`
> >>> +
> >>> +Read system counter frequency
> >>> +-----------------------------
> >>> +
> >>> +`XenSwdgn~arm64_generic_timer_read_freq~1`
> >>> +
> >>> +Description:
> >>> +Xen shall expose the frequency of the system counter to the domains.
> >> 
> >> The requirement would need to say in CNTFRQ_EL0 and in the domain device tree xxx entry.
> >> 
> >>> +
> >>> +Rationale:
> >>> +
> >>> +Comments:
> >>> +Domains shall read it via CNTFRQ_EL0 register or "clock-frequency" device tree
> >>> +property.
> >> 
> >> I do not think this comment is needed.
> >> 
> >>> +
> >>> +Covers:
> >>> + - `XenProd~emulated_timer~1`
> >>> +
> >>> +Access CNTKCTL_EL1 system register from a domain
> >>> +------------------------------------------------
> >>> +
> >>> +`XenSwdgn~arm64_generic_timer_access_cntkctlel1~1`
> >>> +
> >>> +Description:
> >>> +Xen shall expose counter-timer kernel control register to the domains.
> >> 
> >> "counter-timer kernel" is a bit odd here, is it the name from arm arm ?
> >> Generic Timer control registers ? or directly the register name.
> > This is the name from Arm ARM. See e.g.:
> > https://developer.arm.com/documentation/ddi0601/2023-12/AArch64-Registers/CNTKCTL-EL1--Counter-timer-Kernel-Control-Register?lang=en
> 
> Right then i would use the same upper cases: Counter-timer Kernel Control
> register and still mention CNTKCTL_EL1 as it would be clearer.
> 
> > 
> >> 
> >>> +
> >>> +Rationale:
> >>> +
> >>> +Comments:
> >>> +Domains shall access the counter-timer kernel control register to allow
> >>> +controlling the access to the timer from userspace (EL0).
> >> 
> >> This is documented in the arm arm, this comment is not needed.
> >> 
> >>> +
> >>> +Covers:
> >>> + - `XenProd~emulated_timer~1`
> >>> +
> >>> +Access virtual timer from a domain
> >>> +----------------------------------
> >>> +
> >>> +`XenSwdgn~arm64_generic_timer_access_virtual_timer~1`
> >>> +
> >>> +Description:
> >>> +Xen shall expose the virtual timer registers to the domains.
> >>> +
> >>> +Rationale:
> >>> +
> >>> +Comments:
> >>> +Domains shall access and make use of the virtual timer by accessing the
> >>> +following system registers:
> >>> +CNTVCT_EL0,
> >>> +CNTV_CTL_EL0,
> >>> +CNTV_CVAL_EL0,
> >>> +CNTV_TVAL_EL0.
> >> 
> >> The requirement to be complete should give this list, not the comment.
> >> 
> >>> +
> >>> +Covers:
> >>> + - `XenProd~emulated_timer~1`
> >>> +
> >>> +Access physical timer from a domain
> >>> +-----------------------------------
> >>> +
> >>> +`XenSwdgn~arm64_generic_timer_access_physical_timer~1`
> >>> +
> >>> +Description:
> >>> +Xen shall expose physical timer registers to the domains.
> >>> +
> >>> +Rationale:
> >>> +
> >>> +Comments:
> >>> +Domains shall access and make use of the physical timer by accessing the
> >>> +following system registers:
> >>> +CNTPCT_EL0,
> >>> +CNTP_CTL_EL0,
> >>> +CNTP_CVAL_EL0,
> >>> +CNTP_TVAL_EL0.
> >> 
> >> same as upper
> >> 
> >>> +
> >>> +Covers:
> >>> + - `XenProd~emulated_timer~1`
> >>> +
> >>> +Trigger the virtual timer interrupt from a domain
> >>> +-------------------------------------------------
> >>> +
> >>> +`XenSwdgn~arm64_generic_timer_trigger_virtual_interrupt~1`
> >>> +
> >>> +Description:
> >>> +Xen shall enable the domains to program the virtual timer to generate the
> >>> +interrupt.
> >> 
> >> I am not sure this is right here.
> >> You gave access to the registers upper so Xen responsibility is not really to
> >> enable anything but rather make sure that it generates an interrupt according to
> >> how the registers have been programmed.
> > I'm in two minds about it. On one hand you're right and the IRQ trigger is a side-effect
> > of programming the registers correctly. On the other, these are design requirements which
> > according to "fusa/reqs/intro.rst" describe what SW implementation is doing. Our way of injecting
> > timer IRQs into guests is a bit different (phys timer is fully emulated and we use internal timers
> > and for virt timer we first route IRQ to Xen, mask the IRQ and inject to guest). If I were to write
> > tests to cover Generic Timer requirements I'd expect to cover whether r.g. masking/unmasking IRQ works,
> > whether IRQ was received, etc.
> 
> This is true but i think it would be more logic in non design requirements to
> phrase things to explain the domain point of view rather than how it is implemented.
> 
> Here the point is to have a timer fully functional from guest point of view, including
> getting interrupts when the timer should generate one.
> 
> Maybe something like: Xen shall generate timer interrupts to domains when the timer condition asserts.

Both statements are correct.

Michal's original statement "Xen shall enable the domains to program the
virtual timer to generate the interrupt" is correct. The timer interrupt
will be generated by the hardware to Xen, if the guest programs the
registers correctly. If Xen does nothing, the interrupt is still
generated and received by Xen.

Bertrand's statement is also correct. Xen needs to generate a virtual
timer interrupt equivalent to the physical timer interrupt, after
receiving the physical interrupt.

I think the best statement would be a mix of the two, something like:

Xen shall enable the domain to program the virtual timer to generate
the interrupt, which Xen shall inject as virtual interrupt into the
domain.


That said, I also think that any one of these three statements is good
enough.


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 22:46:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 22:46:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.781991.1191459 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGZP-0001Ty-Vf; Thu, 22 Aug 2024 22:46:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 781991.1191459; Thu, 22 Aug 2024 22:46:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGZP-0001Tr-SH; Thu, 22 Aug 2024 22:46:19 +0000
Received: by outflank-mailman (input) for mailman id 781991;
 Thu, 22 Aug 2024 22:46:19 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shGZO-0001Th-Vu; Thu, 22 Aug 2024 22:46:18 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shGZO-0007Lk-LW; Thu, 22 Aug 2024 22:46:18 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shGZO-0008Q3-4Q; Thu, 22 Aug 2024 22:46:18 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shGZO-00045C-3u; Thu, 22 Aug 2024 22:46:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=2uiN5MYsrfvagZ/XQUobGV3SwaSIiUV9Oqx9mB9Ol6Q=; b=3TKgE5lpF/G6NJp24lc9vPxrzy
	KwVHTQwCBil0j6WYlWWz3v5YQZLC8IiGZ68m6fLRTr0GdyGcOMKkkpvtklXuvQAMSPxdKUJuFZuU8
	N9JwwvPl3B1iuIP7+XwHmsh3oLpmwOM+jKwOtMQebEyPVcHh/9E34GdxO9jrKzkS3970=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187307-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187307: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-armhf-armhf-xl-raw:debian-di-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=872cf28b8df9c5c3a1e71a88ee750df7c2513971
X-Osstest-Versions-That:
    linux=b311c1b497e51a628aa89e7cb954481e5f9dced2
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 22 Aug 2024 22:46:18 +0000

flight 187307 linux-linus real [real]
flight 187315 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187307/
http://logs.test-lab.xenproject.org/osstest/logs/187315/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-xl-raw      12 debian-di-install        fail REGR. vs. 187301

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187301
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187301
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187301
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187301
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187301
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187301
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                872cf28b8df9c5c3a1e71a88ee750df7c2513971
baseline version:
 linux                b311c1b497e51a628aa89e7cb954481e5f9dced2

Last test of basis   187301  2024-08-21 09:37:38 Z    1 days
Testing same since   187307  2024-08-22 01:58:14 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Gao Xiang <hsiangkao@linux.alibaba.com>
  Hongzhen Luo <hongzhen@linux.alibaba.com>
  Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Luke D. Jones <luke@ljones.dev>
  Maximilian Luz <luzmaximilian@gmail.com>
  Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 300 lines long.)


From xen-devel-bounces@lists.xenproject.org Thu Aug 22 23:06:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 23:06:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782004.1191490 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtC-0005Vo-2R; Thu, 22 Aug 2024 23:06:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782004.1191490; Thu, 22 Aug 2024 23:06:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtB-0005Vh-Ug; Thu, 22 Aug 2024 23:06:45 +0000
Received: by outflank-mailman (input) for mailman id 782004;
 Thu, 22 Aug 2024 23:06:44 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gAWf=PV=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shGtA-00052v-Bs
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 23:06:44 +0000
Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com
 [2a00:1450:4864:20::62c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 31c0e354-60db-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 01:06:42 +0200 (CEST)
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-a869332c2c2so182236666b.0
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 16:06:42 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f21ff19sm174676866b.39.2024.08.22.16.06.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 16:06:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 31c0e354-60db-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724368001; x=1724972801; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=2Z50rUek42kgTiveeKTgR2WMlKuKbEecpCox+h79eBY=;
        b=C56+IeeF4PwlqSsDWuIb0/VOP1/ZnziWSbJZ+MsuNGG43R9MIK8ApuP2r+QjDVFF+J
         yEpNVHKbzxfUsXsDnrr1rKR6aNYhVw3miIpSGASSY0bu+9fm9heYemp9QLoZQHQUKqYa
         ZgZIa/zZyb5tVI6oc9DlvVev3exFldFvpznvc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724368001; x=1724972801;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=2Z50rUek42kgTiveeKTgR2WMlKuKbEecpCox+h79eBY=;
        b=S1xQQyKCtESOjdUr2uCfbVilRAaadyh0i3rhkceNL2iRleH0uZE4w9abLK3WyOhvix
         2Sdu3ySPRzJey50RrMTXM0EZo2I0LXuvLoXrV9wJjC8SgyvhdGdLupRMdCFDR2l5/6Za
         X0kAd/FDiMWgIq8+JHrpPNN5sAeu+BtyDDU3hd3T6EzPa0ud3FxNlAq5eJywLKRg3HiN
         X2C/Qg+E3a8g/z7z7Dxo1zKXGo5YLyWiPAl56yHwu+xP6SBK2NSdAGUsbabSwAbd74VH
         BP+sMqTQpo38dn53P+IcAE/FNkCQL5RL6zfBFponETDMON5cUBA9C5ZPl0otduVIjjTT
         qtfw==
X-Gm-Message-State: AOJu0YxLVzlllHpTME8vo9jGk6nvHCp+3hlynO2r3RBKMv8fbjTxolj2
	0i0up79JZX/1pwQJVpQPPACusv4Vv6Vhh5wjtNe5xOpxfuNe6FLipYjowD9ukfiHwwKWzqVpLA9
	O
X-Google-Smtp-Source: AGHT+IGsUggwR5NOud8P1JQNlp5q7xeSM5LIrPIsYEgMon9pttFSlivUmD8Is2ZkHkpnZwkWVAyHgg==
X-Received: by 2002:a17:907:3d8a:b0:a72:5967:b34 with SMTP id a640c23a62f3a-a86a309ac9bmr48081766b.22.1724368000957;
        Thu, 22 Aug 2024 16:06:40 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 2/9] xen/bitops: Introduce a multiple_bits_set() helper
Date: Fri, 23 Aug 2024 00:06:28 +0100
Message-Id: <20240822230635.954557-3-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240822230635.954557-1-andrew.cooper3@citrix.com>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This will be used to simplify real logic in the following patch.  Add compile
and boot time testing as with other bitops.

Because the expression is so simple, implement it as a function-like macro
which is generic on the type of it's argument, rather than having multiple
variants.

Testing function-like macros needs a minor adjustments to the infrastructure
in xen/self-tests.h to avoid bracketing the fn parameter.  The utility of this
outweighs the associated risks.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>

Name inevitably subject to nitpicking.  I'd prefer it to be shorter but I
can't think of anything suitable.
---
 xen/common/bitops.c          | 24 ++++++++++++++++++++++++
 xen/include/xen/bitops.h     | 10 ++++++++++
 xen/include/xen/self-tests.h | 10 ++++++++--
 3 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/xen/common/bitops.c b/xen/common/bitops.c
index 94a8983af99c..4545682aa8e0 100644
--- a/xen/common/bitops.c
+++ b/xen/common/bitops.c
@@ -84,8 +84,32 @@ static void __init test_fls(void)
     CHECK(fls64, 0x8000000000000001ULL, 64);
 }
 
+static void __init test_multiple_bits_set(void)
+{
+    /*
+     * multiple_bits_set() is generic on the type of it's parameter, as the
+     * internal expression is so simple.
+     */
+
+    CHECK(multiple_bits_set, 0, false);
+    CHECK(multiple_bits_set, 1, false);
+    CHECK(multiple_bits_set, 2, false);
+    CHECK(multiple_bits_set, 3, true);
+
+    CHECK(multiple_bits_set, 1 | (1UL << (BITS_PER_LONG - 1)), true);
+#if BITS_PER_LONG > 32
+    CHECK(multiple_bits_set, 1 | (1UL << 32), true);
+    CHECK(multiple_bits_set, 1 | (1UL << 63), true);
+#endif
+
+    CHECK(multiple_bits_set, 0x8000000000000001ULL, true);
+    CHECK(multiple_bits_set, 0xc000000000000000ULL, true);
+}
+
 static void __init __constructor test_bitops(void)
 {
     test_ffs();
     test_fls();
+
+    test_multiple_bits_set();
 }
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index b8bb2ffcd337..74c0d04e6647 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -274,6 +274,16 @@ static always_inline __pure unsigned int fls64(uint64_t x)
     }
 }
 
+/*
+ * Calculate if a value has two or more bits set.  Always use this in
+ * preference to an expression of the form 'hweight(x) > 1'.
+ */
+#define multiple_bits_set(x)                    \
+    ({                                          \
+        typeof(x) _v = (x);                     \
+        (_v & (_v - 1)) != 0;                   \
+    })
+
 /* --------------------- Please tidy below here --------------------- */
 
 #ifndef find_next_bit
diff --git a/xen/include/xen/self-tests.h b/xen/include/xen/self-tests.h
index 58484fe5a8ae..e5a6ba748aba 100644
--- a/xen/include/xen/self-tests.h
+++ b/xen/include/xen/self-tests.h
@@ -15,11 +15,14 @@
  *
  * Clang < 8 can't fold constants through static inlines, causing this to
  * fail.  Simply skip it for incredibly old compilers.
+ *
+ * N.B. fn is intentionally not bracketed to allow us to test function-like
+ * macros too.
  */
 #if !defined(CONFIG_CC_IS_CLANG) || CONFIG_CLANG_VERSION >= 80000
 #define COMPILE_CHECK(fn, val, res)                                     \
     do {                                                                \
-        typeof((fn)(val)) real = (fn)(val);                             \
+        typeof(fn(val)) real = fn(val);                                 \
                                                                         \
         if ( !__builtin_constant_p(real) )                              \
             asm ( ".error \"'" STR(fn(val)) "' not compile-time constant\"" ); \
@@ -34,10 +37,13 @@
  * Check that Xen's runtime logic for fn(val) gives the expected answer.  This
  * requires using HIDE() to prevent the optimiser from collapsing the logic
  * into a constant.
+ *
+ * N.B. fn is intentionally not bracketed to allow us to test function-like
+ * macros too.
  */
 #define RUNTIME_CHECK(fn, val, res)                     \
     do {                                                \
-        typeof((fn)(val)) real = (fn)(HIDE(val));       \
+        typeof(fn(val)) real = fn(HIDE(val));           \
                                                         \
         if ( real != (res) )                            \
             panic("%s: %s(%s) expected %u, got %u\n",   \
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 23:06:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 23:06:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782002.1191470 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGt9-00053G-K5; Thu, 22 Aug 2024 23:06:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782002.1191470; Thu, 22 Aug 2024 23:06:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGt9-000539-H2; Thu, 22 Aug 2024 23:06:43 +0000
Received: by outflank-mailman (input) for mailman id 782002;
 Thu, 22 Aug 2024 23:06:42 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gAWf=PV=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shGt8-00052v-MZ
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 23:06:42 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 30dbc220-60db-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 01:06:40 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-533488ffaebso1516460e87.0
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 16:06:40 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f21ff19sm174676866b.39.2024.08.22.16.06.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 16:06:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 30dbc220-60db-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724368000; x=1724972800; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=m2LeyzUwL5o7T7PpRPGH34rG7BC0CEXy4TaB1P1AwTY=;
        b=N6y8gBZvGap8ZnbpfXZ9+SRbHNNmeLoXrEs/BrSDNHfQ8Qairt6hsLNWewZ8gVCips
         M+W1Bc5EMBA9qlxdRbprssDq6+cx60GA+idb7i/ku9AE6AquLxKW6UMilVF3QnBkbCJ+
         CFWgohkVLDmoUAL4AHJPv+YzRr/7oTK3zsofg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724368000; x=1724972800;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=m2LeyzUwL5o7T7PpRPGH34rG7BC0CEXy4TaB1P1AwTY=;
        b=SfZ1G/2ELWMod5/QUG9xeqEypEASlK+wn4w1huzO5KqtwRLb3PVWlQ7DWATfu+p/8I
         NAit+MhFcvjTQ7GBQdo4TfjjsJaKfg62yQ+cETeBobCBiPD8ICOmMPgJ/vEEL2OpD4mA
         63ELimIYXV3Yuaup2EySTyXkk+hnkC993zjcDGR/CbSihMLIUR+55lt403DJQ+LwmqIG
         51Y9aA/lSC8U/RWV4WY15Z8smAmV+KUutboj3jg3i/jCn+4PDmhsOF1wheR7yczE5BDs
         En4bhFibDVEoXOj6jQcUEug3o35Sp5xtcCEDKQnc84RjLCqbtaCfPMRxVv7UIL1mh192
         IWvQ==
X-Gm-Message-State: AOJu0Yylk3XDYEZOF9b1af/dibFC6bwk59p0B51904L8Rqcg7oVBgNuy
	7xoRhJJ0EN+XO0o1SKpQ1bgPReKwEd4CB2Hgdz3SdTLhqPJGywjL6YfyUr6SLZjff4zzDfFKjGB
	M
X-Google-Smtp-Source: AGHT+IEaVH2wJY8/h1/gFnkOs39vSqEqmt0IjwV8kWT2KBSrYXeuLEVPBeCoURFCMpIwWVDt1NBUqg==
X-Received: by 2002:a05:6512:114d:b0:52e:9b68:d2d4 with SMTP id 2adb3069b0e04-534387be68cmr225605e87.56.1724367999136;
        Thu, 22 Aug 2024 16:06:39 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 0/9] xen/bitops: hweight() cleanup/improvements
Date: Fri, 23 Aug 2024 00:06:26 +0100
Message-Id: <20240822230635.954557-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The next phase of bitops cleanup.  This series:

 1) Untangles the mess around hweight()
 2) Removes some unwise uses of hweight()
 3) Makes it work transparently for RISC-V
 4) Use the POPCNT instruction on x86 when available

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1424000649
https://cirrus-ci.com/build/4947148859506688

Andrew Cooper (9):
  xen/bitops: Reinstate the please tidy message
  xen/bitops: Introduce a multiple_bits_set() helper
  xen/bitops: Convert 'hweight(x) > 1' to new multiple_bits_set()
  xen/bitops: Drop the remnants of hweight{8,16}()
  xen/bitops: Introduce generic_hweightl() and hweightl()
  xen/bitops: Drop hweight_long() and use hweightl()
  xen/bitops: Implement hweight64() in terms of hweightl()
  xen/bitops: Implement hweight32() in terms of hweightl()
  x86/bitops: Use the POPCNT instruction when available

 xen/arch/arm/include/asm/bitops.h |  11 ----
 xen/arch/ppc/include/asm/bitops.h |  11 +---
 xen/arch/x86/cpu/vpmu.c           |   2 +-
 xen/arch/x86/hvm/vlapic.c         |  10 +--
 xen/arch/x86/include/asm/bitops.h |  30 ++++++---
 xen/common/bitmap.c               |   4 +-
 xen/common/bitops.c               |  41 ++++++++++++
 xen/common/numa.c                 |   2 +-
 xen/include/xen/bitops.h          | 102 +++++++++++++-----------------
 xen/include/xen/self-tests.h      |  10 ++-
 xen/lib/Makefile                  |   2 +
 xen/lib/arch-generic-hweightl.S   |  46 ++++++++++++++
 xen/lib/generic-hweightl.c        |  61 ++++++++++++++++++
 13 files changed, 232 insertions(+), 100 deletions(-)
 create mode 100644 xen/lib/arch-generic-hweightl.S
 create mode 100644 xen/lib/generic-hweightl.c

-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 23:06:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 23:06:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782005.1191499 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtD-0005lI-Ci; Thu, 22 Aug 2024 23:06:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782005.1191499; Thu, 22 Aug 2024 23:06:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtD-0005lB-9L; Thu, 22 Aug 2024 23:06:47 +0000
Received: by outflank-mailman (input) for mailman id 782005;
 Thu, 22 Aug 2024 23:06:45 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gAWf=PV=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shGtB-00052v-Ke
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 23:06:45 +0000
Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com
 [2a00:1450:4864:20::633])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 32d8ce17-60db-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 01:06:44 +0200 (CEST)
Received: by mail-ej1-x633.google.com with SMTP id
 a640c23a62f3a-a86859e2fc0so173830866b.3
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 16:06:44 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f21ff19sm174676866b.39.2024.08.22.16.06.41
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 16:06:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 32d8ce17-60db-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724368003; x=1724972803; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=YpnZe/6Rj0UVvPnf3275lXIauGqfUzo8Cf5z0ZU/Amw=;
        b=UwyaKJRH3kF5sHar/blpSxBxoVNxI/Rkn2BFwDCychf+aFhnx/gn93XE6H1koH6MWN
         jjro5GCzGAHmhMLdQkDhP9aY0Uz+XL4JFLI35vU6SfzA24va9rwNAHkZoEck2kwXmjEF
         QYnbiL0MKWwUdtd1ZprAdKt7ss9dT5HKiRA5o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724368003; x=1724972803;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=YpnZe/6Rj0UVvPnf3275lXIauGqfUzo8Cf5z0ZU/Amw=;
        b=gLe6sPkY66BagCVL4SSZlewQ1KSoBUauQwZCkeN0/gwFSTAFYKYPhZi5MkWozhWmDJ
         nh7CLAxoY0n8TxJ+gE/D1jl6QuaOkrJJDXaUGHHVhUQANSzLiMyRXLPj2amcupMWMK++
         qgxlZM5qegMVWAzY0Chn0cJtJPqytEty9pGzWgpVQ7cOEUA6UI5kLODvXjHoJDQmBAQl
         t5N2V151X79kgePoDhP9Dtyznd4QgJxc+c3Y+hWnxDwiukn06cg0fGFMFOnYm+hbSB12
         KXJi3hrVhHy5PPKmmGakrFDHwTGgHFzY9oo88rLgt6qCLAfT5meq2QR0dDS6f3JiWWRx
         e7iQ==
X-Gm-Message-State: AOJu0Yx3Tl7BIKq6xZnaieqHH8tlTGUlHrUfBep4xkFWDYaT+21SZrAs
	T27pMQaE+VEppPe13neT7/ee+dBBx14d4cVpIxtWKTUAipFce4iDn5rtJsVqwqgnnpO3aohrJl5
	9
X-Google-Smtp-Source: AGHT+IH6ftjYtMlhJLqOnuqIi9pKaUpCeM5Mae1UDb83A9+Z2/FTPNORDiie+hP4NqFf7A9vDzPXAg==
X-Received: by 2002:a17:907:940a:b0:a86:9f56:21e6 with SMTP id a640c23a62f3a-a86a53005e7mr14271566b.33.1724368002530;
        Thu, 22 Aug 2024 16:06:42 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 3/9] xen/bitops: Convert 'hweight(x) > 1' to new multiple_bits_set()
Date: Fri, 23 Aug 2024 00:06:29 +0100
Message-Id: <20240822230635.954557-4-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240822230635.954557-1-andrew.cooper3@citrix.com>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Using hweight() is an especially expensive way of determining simply if
multiple bits are set in a value.  Worse, 4 of the 10 hweight() calls in Xen
are of this form.

Switch to the new multiple_bits_set() helper.  This is far more efficient than
the longhand hweight() algorithm and, owing to its simplicity, likely more
efficient than even a dedicated instruction on a superscalar processor.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>

On x86, the code reduction speaks for itself:

  add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-240 (-240)
  Function                                     old     new   delta
  vlapic_ipi                                   722     650     -72
  numa_emulation                               577     497     -80
  do_xenpmu_op                                1665    1577     -88

That's an aweful lot of wasted calculation for the same answer.

I can't find a way of enabling CONFIG_NUMA on ARM (yet?) so right now there's
no change in any other architecture.  However, a synthetic helper shows the
following on ARM32:

  add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-128 (-128)
  Function                                     old     new   delta
  test_mbs                                     176      48    -128

and on ARM64:

  add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-44 (-44)
  Function                                     old     new   delta
  test_mbs                                      60      16     -44

PPC64 has POPCNTD in a default build of Xen and by chance both algorithms
compile to the same number of instructions.

RISC-V doesn't have hweight() wired up yet at all.
---
 xen/arch/x86/cpu/vpmu.c   |  2 +-
 xen/arch/x86/hvm/vlapic.c | 10 ++++++----
 xen/common/numa.c         |  2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index b2ba9994129b..a5bb1689c7d5 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -673,7 +673,7 @@ long do_xenpmu_op(
     {
         if ( (pmu_params.val &
               ~(XENPMU_MODE_SELF | XENPMU_MODE_HV | XENPMU_MODE_ALL)) ||
-             (hweight64(pmu_params.val) > 1) )
+             multiple_bits_set(pmu_params.val) )
             return -EINVAL;
 
         /* 32-bit dom0 can only sample itself. */
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 2ec95942713e..4a3e21a65f9d 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -467,12 +467,14 @@ static bool is_multicast_dest(struct vlapic *vlapic, unsigned int short_hand,
         return short_hand != APIC_DEST_SELF;
 
     if ( vlapic_x2apic_mode(vlapic) )
-        return dest_mode ? hweight16(dest) > 1 : dest == 0xffffffffU;
+        return dest_mode ? multiple_bits_set((uint16_t)dest)
+                         : dest == 0xffffffffU;
 
     if ( dest_mode )
-        return hweight8(dest &
-                        GET_xAPIC_DEST_FIELD(vlapic_get_reg(vlapic,
-                                                            APIC_DFR))) > 1;
+    {
+        dest &= GET_xAPIC_DEST_FIELD(vlapic_get_reg(vlapic, APIC_DFR));
+        return multiple_bits_set((uint8_t)dest);
+    }
 
     return dest == 0xff;
 }
diff --git a/xen/common/numa.c b/xen/common/numa.c
index 28a09766fabc..ce3991929ce5 100644
--- a/xen/common/numa.c
+++ b/xen/common/numa.c
@@ -546,7 +546,7 @@ static int __init numa_emulation(unsigned long start_pfn,
     uint64_t sz = pfn_to_paddr(end_pfn - start_pfn) / numa_fake;
 
     /* Kludge needed for the hash function */
-    if ( hweight64(sz) > 1 )
+    if ( multiple_bits_set(sz) )
     {
         uint64_t x = 1;
 
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 23:06:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 23:06:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782006.1191505 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtD-0005nt-QT; Thu, 22 Aug 2024 23:06:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782006.1191505; Thu, 22 Aug 2024 23:06:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtD-0005n7-IJ; Thu, 22 Aug 2024 23:06:47 +0000
Received: by outflank-mailman (input) for mailman id 782006;
 Thu, 22 Aug 2024 23:06:46 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gAWf=PV=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shGtC-00052v-K0
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 23:06:46 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3371b277-60db-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 01:06:45 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a86984e035aso130619766b.2
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 16:06:45 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f21ff19sm174676866b.39.2024.08.22.16.06.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 16:06:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3371b277-60db-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724368004; x=1724972804; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Z32VSiikSGXLFKmdcP1zMNdlkMYVkQVHFcaYHWzqH0I=;
        b=bTj2R2eBRNsDxvMlENtJm2nUIzV/d/FdqWcoOYH7NugUyK0aB5LCmZ3zsnoOAM0Gvp
         RsZkdMi5tHeey/yC9js/aR/IE4npPB4hqLBjSRb4utOEvJtxPrlLEXEm6aambgif6wwc
         l5hT3usa4qyncQS0iI4Cet2HXdeLgN6cCmaaA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724368004; x=1724972804;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Z32VSiikSGXLFKmdcP1zMNdlkMYVkQVHFcaYHWzqH0I=;
        b=EmCzYAsHYR3mEuaNXcKvo8sC6owAEsXlte/84TdJQ9NqAASZj/vZsT7neGtduoGVdi
         UFrwigWwAI/koPomeLNVx7EnUBJjX7QrDCoYOJQ31sTNZ0SGtE5ZG3IUlEHjVaurMSkP
         NCpaF16ken/CECD0vwg5Dy4FdB8jn3zaheYnTbErCnGFywVB1OagoyZvDP9OIf+A/hr8
         jUyBsQmIhrBAnA9wJR2Y+3bLMzzAl2g8VDkyTUOBGcjDx2ex9C9zXyWnPNkjii8R6Jgv
         AY89O22NbTLymQFfde5UJ0QxbWjrGbVQ1RzsTh6BpGCTWkHBHmkfc6YkD3+4QvCYBjQM
         KNEQ==
X-Gm-Message-State: AOJu0YztvEZLOCKCN49xC8yHwFZgXizDgrFO6YmxW4ShYtFsywON/2fa
	PRWSw2Kb1vZhjTSAVOMNhXOm00ZzyS4+EyiJ8EQDLGn2rbBHos72SqDG8Su3lLxrWaYKqqrIhWo
	I
X-Google-Smtp-Source: AGHT+IFRDX/W4UY1H3WUEVSmOJeaLU8RAXCjyi52CvapXkXlmfnP6gHsMAgaeNOhzlOkCzNZeD3hMw==
X-Received: by 2002:a17:906:9c82:b0:a86:96b3:86be with SMTP id a640c23a62f3a-a86a54b70d3mr14312866b.63.1724368003385;
        Thu, 22 Aug 2024 16:06:43 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 4/9] xen/bitops: Drop the remnants of hweight{8,16}()
Date: Fri, 23 Aug 2024 00:06:30 +0100
Message-Id: <20240822230635.954557-5-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240822230635.954557-1-andrew.cooper3@citrix.com>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

They are no more, and won't be returning in this form.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/arm/include/asm/bitops.h |  2 --
 xen/arch/ppc/include/asm/bitops.h |  2 --
 xen/arch/x86/include/asm/bitops.h |  2 --
 xen/include/xen/bitops.h          | 17 -----------------
 4 files changed, 23 deletions(-)

diff --git a/xen/arch/arm/include/asm/bitops.h b/xen/arch/arm/include/asm/bitops.h
index 3c023103f734..91cd167b6bbb 100644
--- a/xen/arch/arm/include/asm/bitops.h
+++ b/xen/arch/arm/include/asm/bitops.h
@@ -86,8 +86,6 @@ bool clear_mask16_timeout(uint16_t mask, volatile void *p,
  */
 #define hweight64(x) generic_hweight64(x)
 #define hweight32(x) generic_hweight32(x)
-#define hweight16(x) generic_hweight16(x)
-#define hweight8(x) generic_hweight8(x)
 
 #endif /* _ARM_BITOPS_H */
 /*
diff --git a/xen/arch/ppc/include/asm/bitops.h b/xen/arch/ppc/include/asm/bitops.h
index eb3355812ea3..a62c4f99c3bb 100644
--- a/xen/arch/ppc/include/asm/bitops.h
+++ b/xen/arch/ppc/include/asm/bitops.h
@@ -132,7 +132,5 @@ static inline int test_and_set_bit(unsigned int nr, volatile void *addr)
  */
 #define hweight64(x) __builtin_popcountll(x)
 #define hweight32(x) __builtin_popcount(x)
-#define hweight16(x) __builtin_popcount((uint16_t)(x))
-#define hweight8(x)  __builtin_popcount((uint8_t)(x))
 
 #endif /* _ASM_PPC_BITOPS_H */
diff --git a/xen/arch/x86/include/asm/bitops.h b/xen/arch/x86/include/asm/bitops.h
index 8c0403405aa2..4c5b21907a64 100644
--- a/xen/arch/x86/include/asm/bitops.h
+++ b/xen/arch/x86/include/asm/bitops.h
@@ -483,7 +483,5 @@ static always_inline unsigned int arch_flsl(unsigned long x)
  */
 #define hweight64(x) generic_hweight64(x)
 #define hweight32(x) generic_hweight32(x)
-#define hweight16(x) generic_hweight16(x)
-#define hweight8(x) generic_hweight8(x)
 
 #endif /* _X86_BITOPS_H */
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 74c0d04e6647..64d70a7a1cb5 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -371,23 +371,6 @@ static inline unsigned int generic_hweight32(unsigned int w)
     return (w + (w >> 16)) & 0xff;
 }
 
-static inline unsigned int generic_hweight16(unsigned int w)
-{
-    w -= ((w >> 1) & 0x5555);
-    w =  (w & 0x3333) + ((w >> 2) & 0x3333);
-    w =  (w + (w >> 4)) & 0x0f0f;
-
-    return (w + (w >> 8)) & 0xff;
-}
-
-static inline unsigned int generic_hweight8(unsigned int w)
-{
-    w -= ((w >> 1) & 0x55);
-    w =  (w & 0x33) + ((w >> 2) & 0x33);
-
-    return (w + (w >> 4)) & 0x0f;
-}
-
 static inline unsigned int generic_hweight64(uint64_t w)
 {
     if ( BITS_PER_LONG < 64 )
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 23:06:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 23:06:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782003.1191479 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtA-0005HP-Q5; Thu, 22 Aug 2024 23:06:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782003.1191479; Thu, 22 Aug 2024 23:06:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtA-0005HI-NT; Thu, 22 Aug 2024 23:06:44 +0000
Received: by outflank-mailman (input) for mailman id 782003;
 Thu, 22 Aug 2024 23:06:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gAWf=PV=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shGt9-00052v-BY
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 23:06:43 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 31641ac1-60db-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 01:06:41 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-5334a8a1b07so1860646e87.1
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 16:06:41 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f21ff19sm174676866b.39.2024.08.22.16.06.39
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 16:06:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 31641ac1-60db-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724368000; x=1724972800; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=vi0HNaxsoocOO70fDh+VCPKJb25Qc7z5AiDZW/3dXd4=;
        b=q1U1G8I5sUJYS3ilmi2J7exQaeisMT+5GRvN46ZFTt2eOMAcMvpMy8BRsYUe4RMh+X
         OAsuIsBOyVQhlpDXXg95c/7kCFKHCcdPKcSLqSLc0CtbTO8tVPpgF/wcER6J2sNAzuS+
         oZb6v1xzps4lfHg8l9N7mN9Ook8/8QKtsmD3o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724368000; x=1724972800;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=vi0HNaxsoocOO70fDh+VCPKJb25Qc7z5AiDZW/3dXd4=;
        b=I8kl4461gTHqdAXFQpqlSvHfX9YjtJQ9bjy6rbicy/uuR3o9faxcxjxpJMcaUUUYAB
         VssQg50CBmmXXax99Mf7Jn+b8MHKY2KSILXoL+8Sc+cGWx5bB5GBXk92nwOUnt9D5pZC
         IPGIR4j3C4IIvVInGbhYCyyEJ8wGf3R/g0fBzJ/aQN4cfffqlact6C9KCPkMmwyr2KnO
         lQPSlEEgWeMeTvpHGtEjiAiiqWsRS15vQc9o8SHQP4CGVVuRm6nt1vjsg5GYBvc+/J+K
         y6OV1CjL9ySH6Jfa0XsRA1zSS+jVMsoSOXAfTjU8Fe4SWiFFheOHWu8/xuGSSMLjYs3G
         EiNw==
X-Gm-Message-State: AOJu0YxLBIv//FkCVefrKGhiPiRjt2lKd0x8Wn/JAazsAsvHMPGuvowl
	jx4Sda6hmQcyt+hSOobDkUVyBEypfTgKPCAwzWESkAfHWQlIXtT8ECbdGulq6DSmC5csr+gVVe+
	F
X-Google-Smtp-Source: AGHT+IG08atBLSrHkN0q7MwPV4pRgbVAGpFeqlS9ZEga/uXi2+39o90RumbhPvbxno7nfcsm9Ll9eA==
X-Received: by 2002:a05:6512:3a8a:b0:52c:e4cf:4f31 with SMTP id 2adb3069b0e04-5343886beeemr195477e87.49.1724368000028;
        Thu, 22 Aug 2024 16:06:40 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 1/9] xen/bitops: Reinstate the please tidy message
Date: Fri, 23 Aug 2024 00:06:27 +0100
Message-Id: <20240822230635.954557-2-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240822230635.954557-1-andrew.cooper3@citrix.com>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Recent additions have undone prior tidying at the top of the file.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/include/xen/bitops.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 3d88d2f3f1d6..b8bb2ffcd337 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -204,6 +204,8 @@ static always_inline bool test_bit(int nr, const volatile void *addr)
     test_bit(nr, addr);                                 \
 })
 
+/* --------------------- Please tidy above here --------------------- */
+
 static always_inline __pure unsigned int ffs(unsigned int x)
 {
     if ( __builtin_constant_p(x) )
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 23:06:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 23:06:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782007.1191520 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtG-0006IP-1w; Thu, 22 Aug 2024 23:06:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782007.1191520; Thu, 22 Aug 2024 23:06:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtF-0006IE-Sq; Thu, 22 Aug 2024 23:06:49 +0000
Received: by outflank-mailman (input) for mailman id 782007;
 Thu, 22 Aug 2024 23:06:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gAWf=PV=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shGtE-0005x0-BD
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 23:06:48 +0000
Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com
 [2a00:1450:4864:20::133])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 34e28d5b-60db-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 01:06:47 +0200 (CEST)
Received: by mail-lf1-x133.google.com with SMTP id
 2adb3069b0e04-533463f6b16so1643376e87.1
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 16:06:47 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f21ff19sm174676866b.39.2024.08.22.16.06.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 16:06:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 34e28d5b-60db-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724368006; x=1724972806; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=AFP1jZxVxjDc6UuHRCIC5TORBnTsTsKkcvJ4HC7gOwo=;
        b=sJr3ax5WDcIYW9IT9jsb+X7jCjKugh7iocNh8PcZDIAHwUXrn4s3DDwYDUIwxCFcMM
         kdOHY5Vl3SDaHmXCksuRgZ4cBmTocbXxD0mPBtDnLlhAGJM/GtA+ZE4aNN/f/MkN/1uw
         gWnfoCp8lx3kyNpbZED3j4V7IrD5jWPppPCNQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724368006; x=1724972806;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=AFP1jZxVxjDc6UuHRCIC5TORBnTsTsKkcvJ4HC7gOwo=;
        b=uhMYUjlLOnQcPYYR5gaFO7OZ1Dp4cFUh+8MLn0Qw3DF18bpmpJq+pWZcRhDonjfk2n
         RC3z+mJ3fvjJk+HrZZcfKmWqzjjjA8lhg8KmrT6leeXWik7usmA2CXXAAPuBxz5NHSL0
         ZG99Q8TRLKiz1ZDU8TNrfsUxVDZ2XwAlb7xhj2KHyHvCh/WELfcKr4feeE61d041iLvg
         W5NKABiMz6/4syRWwKDbi2xkip2LNtKVXEB8qC8OQ18Mz76yyYYeRACOvUnc2soE/lZy
         vuXVlVR8foFO0SHGo8SuVWsQBIgqZT7N+DS2/WQRBRD+OueulioLamdoxokAcU9Ghkah
         E3ZQ==
X-Gm-Message-State: AOJu0Yyd4DKdX3F9koSntbK1serhHYv+lalOos2IrIOMjjQITbSh7sq0
	Dts+LTn1vdoAlgz3AQqhyw8qJ3vRWnHA2E5Z9uYuabAKqLeRfysDggHSuQf9N7dtfafWARe0wto
	v
X-Google-Smtp-Source: AGHT+IH4elKNA9PI3Ye/Rk6RqPEOVDFJKs/8JLNAzXLdemfeMbGWP7YuXjdSF8ZeK/iVyrA7vwZ9Hw==
X-Received: by 2002:a05:6512:33ce:b0:52e:8b15:7c55 with SMTP id 2adb3069b0e04-534387853e7mr203955e87.27.1724368004524;
        Thu, 22 Aug 2024 16:06:44 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 5/9] xen/bitops: Introduce generic_hweightl() and hweightl()
Date: Fri, 23 Aug 2024 00:06:31 +0100
Message-Id: <20240822230635.954557-6-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240822230635.954557-1-andrew.cooper3@citrix.com>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

There are 6 remaining callers in Xen:

  * The two hweight32() calls, _domain_struct_bits() and efi_find_gop_mode(),
    are __init only.
  * The two hweight_long() calls are both in bitmap_weight().
  * The two hweight64() calls are hv_vpset_nr_banks() and x86_emulate().

Only bitmap_weight() and possibly hv_vpset_nr_banks() can be considered
fast(ish) paths, and they're all of GPR-width form.

Furthermore, the differences between a generic int and generic long form is
only an ADD and SHIFT, and only in !CONFIG_HAS_FAST_MULTIPLY builds.

Therefore, it is definitely not worth having both generic implemenations.

Implement generic_hweightl() based on the current generic_hweight64(),
adjusted to be compatible with ARM32, along with standard SELF_TESTS.

Implement hweightl() with usual constant-folding and arch opt-in support.  PPC
is the only architecture that devates from generic, and it simply uses the
builtin.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/ppc/include/asm/bitops.h |  2 ++
 xen/common/bitops.c               | 14 ++++++++++
 xen/include/xen/bitops.h          | 18 ++++++++++++
 xen/lib/Makefile                  |  1 +
 xen/lib/generic-hweightl.c        | 46 +++++++++++++++++++++++++++++++
 5 files changed, 81 insertions(+)
 create mode 100644 xen/lib/generic-hweightl.c

diff --git a/xen/arch/ppc/include/asm/bitops.h b/xen/arch/ppc/include/asm/bitops.h
index a62c4f99c3bb..64512e949530 100644
--- a/xen/arch/ppc/include/asm/bitops.h
+++ b/xen/arch/ppc/include/asm/bitops.h
@@ -124,6 +124,8 @@ static inline int test_and_set_bit(unsigned int nr, volatile void *addr)
 #define arch_fls(x)  ((x) ? 32 - __builtin_clz(x) : 0)
 #define arch_flsl(x) ((x) ? BITS_PER_LONG - __builtin_clzl(x) : 0)
 
+#define arch_hweightl(x) __builtin_popcountl(x)
+
 /**
  * hweightN - returns the hamming weight of a N-bit word
  * @x: the word to weigh
diff --git a/xen/common/bitops.c b/xen/common/bitops.c
index 4545682aa8e0..d0c268b4994a 100644
--- a/xen/common/bitops.c
+++ b/xen/common/bitops.c
@@ -106,10 +106,24 @@ static void __init test_multiple_bits_set(void)
     CHECK(multiple_bits_set, 0xc000000000000000ULL, true);
 }
 
+static void __init test_hweight(void)
+{
+    /* unsigned int hweightl(unsigned long) */
+    CHECK(hweightl, 0, 0);
+    CHECK(hweightl, 1, 1);
+    CHECK(hweightl, 3, 2);
+    CHECK(hweightl, 7, 3);
+    CHECK(hweightl, 0xff, 8);
+
+    CHECK(hweightl, 1 | (1UL << (BITS_PER_LONG - 1)), 2);
+    CHECK(hweightl, -1UL, BITS_PER_LONG);
+}
+
 static void __init __constructor test_bitops(void)
 {
     test_ffs();
     test_fls();
 
     test_multiple_bits_set();
+    test_hweight();
 }
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 64d70a7a1cb5..3aac10b7f532 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -35,6 +35,12 @@ extern void __bitop_bad_size(void);
 unsigned int __pure generic_ffsl(unsigned long x);
 unsigned int __pure generic_flsl(unsigned long x);
 
+/*
+ * Hamming Weight, also called Population Count.  Returns the number of set
+ * bits in @x.
+ */
+unsigned int __pure generic_hweightl(unsigned long x);
+
 /**
  * generic__test_and_set_bit - Set a bit and return its old value
  * @nr: Bit to set
@@ -284,6 +290,18 @@ static always_inline __pure unsigned int fls64(uint64_t x)
         (_v & (_v - 1)) != 0;                   \
     })
 
+static always_inline __pure unsigned int hweightl(unsigned long x)
+{
+    if ( __builtin_constant_p(x) )
+        return __builtin_popcountl(x);
+
+#ifdef arch_hweightl
+    return arch_hweightl(x);
+#else
+    return generic_hweightl(x);
+#endif
+}
+
 /* --------------------- Please tidy below here --------------------- */
 
 #ifndef find_next_bit
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index a48541596470..b6558e108bd9 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -6,6 +6,7 @@ lib-y += ctype.o
 lib-y += find-next-bit.o
 lib-y += generic-ffsl.o
 lib-y += generic-flsl.o
+lib-y += generic-hweightl.o
 lib-y += list-sort.o
 lib-y += memchr.o
 lib-y += memchr_inv.o
diff --git a/xen/lib/generic-hweightl.c b/xen/lib/generic-hweightl.c
new file mode 100644
index 000000000000..fa4bbec273ab
--- /dev/null
+++ b/xen/lib/generic-hweightl.c
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bitops.h>
+#include <xen/init.h>
+#include <xen/self-tests.h>
+
+/* Mask value @b broadcast to every byte in a long */
+#if BITS_PER_LONG == 32
+# define MASK(b) ((b) * 0x01010101UL)
+#elif BITS_PER_LONG == 64
+# define MASK(b) ((b) * 0x0101010101010101UL)
+#else
+# error Extend me please
+#endif
+
+unsigned int generic_hweightl(unsigned long x)
+{
+    x -= (x >> 1) & MASK(0x55);
+    x =  (x & MASK(0x33)) + ((x >> 2) & MASK(0x33));
+    x =  (x + (x >> 4)) & MASK(0x0f);
+
+    if ( IS_ENABLED(CONFIG_HAS_FAST_MULTIPLY) )
+        return (x * MASK(0x01)) >> (BITS_PER_LONG - 8);
+
+    x += x >> 8;
+    x += x >> 16;
+#if BITS_PER_LONG > 32
+    x += x >> 32;
+#endif
+
+    return x & 0xff;
+}
+
+#ifdef CONFIG_SELF_TESTS
+static void __init __constructor test_generic_hweightl(void)
+{
+    RUNTIME_CHECK(generic_hweightl, 0, 0);
+    RUNTIME_CHECK(generic_hweightl, 1, 1);
+    RUNTIME_CHECK(generic_hweightl, 3, 2);
+    RUNTIME_CHECK(generic_hweightl, 7, 3);
+    RUNTIME_CHECK(generic_hweightl, 0xff, 8);
+
+    RUNTIME_CHECK(generic_hweightl, 1 | (1UL << (BITS_PER_LONG - 1)), 2);
+    RUNTIME_CHECK(generic_hweightl, -1UL, BITS_PER_LONG);
+}
+#endif /* CONFIG_SELF_TESTS */
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 23:06:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 23:06:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782008.1191526 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtG-0006Lx-H7; Thu, 22 Aug 2024 23:06:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782008.1191526; Thu, 22 Aug 2024 23:06:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtG-0006Kd-7A; Thu, 22 Aug 2024 23:06:50 +0000
Received: by outflank-mailman (input) for mailman id 782008;
 Thu, 22 Aug 2024 23:06: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=gAWf=PV=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shGtE-00052v-EA
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 23:06:48 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3498bd16-60db-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 01:06:46 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-a86933829dcso159480266b.3
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 16:06:46 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f21ff19sm174676866b.39.2024.08.22.16.06.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 16:06:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3498bd16-60db-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724368006; x=1724972806; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=AK82ekbFPxm5HGoW+WcJpZodZZU1A3OHLLprY4hQ81c=;
        b=untMoLfEqpW0n12rPuTw0k3tnYpmgvhdwRwxr4VSC23E2RZCduxzik8Uxm7EGiECOk
         RwSDu9Ej5tSkK1bFvK+esp8JDwAhMb39TgcsBjqfVfYgi4bGXala5XsniTPe3J/KtZuH
         Z7mEtn9gDEr6DYlFKE2UjIYOVKZ+hC+J/dM4w=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724368006; x=1724972806;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=AK82ekbFPxm5HGoW+WcJpZodZZU1A3OHLLprY4hQ81c=;
        b=XcISQFZfK0iPcI0u+AwyoP01G/nFbDTdS/vn3hx4qcD8lGULR7W5Q+oqSfuFgyA0i2
         RuDwDywqbV7X7jr2EJ5Qp9+wYR/aXbR8Rd/qK0st4d7RkHwg9Ja3lkmG9l42hhYWiBfk
         SwtRo/c9NBE8xTu708VS4aHnGghH0x/gco9CxBEw+YxsvRI8Y6fcL7thi6tKD0ub9tQI
         86fMpG+yoj4iMs43Ml/DR15Wd+jYeL375RkmGRIvbfr6gRCTSZ62xtDZOlwN/7AnJUCW
         x8jM1zDTuJrbKaC2hE1VfNht9I3uXJumqPfEB2exjodykjR3w3zHTNv/YeMwYeM31brM
         +9MQ==
X-Gm-Message-State: AOJu0Yy+6LMOP4xI/H6PhR4OWG3cwKweBG4BFdM+G4SgB6pJezuJxrcT
	OhIyuOjqJ2o3fEmxbvldsSJOb4GOjn6k0zbN5fKVeRf0XZZ/cuoff+lgwX/CZhP2Oqb09odcuXb
	O
X-Google-Smtp-Source: AGHT+IEYvr3ptXUw2rp6Zjt30wMYdUycUCnNCfxJnJTOh3X6pfOU4e0TztA8+zwhTK/Ff8lMCviONw==
X-Received: by 2002:a17:907:3f14:b0:a80:f6a0:9c3c with SMTP id a640c23a62f3a-a86a4eb3659mr22293866b.0.1724368005517;
        Thu, 22 Aug 2024 16:06:45 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 6/9] xen/bitops: Drop hweight_long() and use hweightl()
Date: Fri, 23 Aug 2024 00:06:32 +0100
Message-Id: <20240822230635.954557-7-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240822230635.954557-1-andrew.cooper3@citrix.com>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/common/bitmap.c      | 4 ++--
 xen/include/xen/bitops.h | 5 -----
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/xen/common/bitmap.c b/xen/common/bitmap.c
index 9d9ff09f3dde..3da63a32a680 100644
--- a/xen/common/bitmap.c
+++ b/xen/common/bitmap.c
@@ -191,10 +191,10 @@ unsigned int __bitmap_weight(const unsigned long *bitmap, unsigned int bits)
 	unsigned int k, w = 0, lim = bits / BITS_PER_LONG;
 
 	for (k = 0; k < lim; k++)
-		w += hweight_long(bitmap[k]);
+		w += hweightl(bitmap[k]);
 
 	if (bits % BITS_PER_LONG)
-		w += hweight_long(bitmap[k] & BITMAP_LAST_WORD_MASK(bits));
+		w += hweightl(bitmap[k] & BITMAP_LAST_WORD_MASK(bits));
 
 	return w;
 }
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 3aac10b7f532..11a1c9130722 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -407,11 +407,6 @@ static inline unsigned int generic_hweight64(uint64_t w)
     return (w + (w >> 32)) & 0xFF;
 }
 
-static inline unsigned int hweight_long(unsigned long w)
-{
-    return sizeof(w) == 4 ? generic_hweight32(w) : generic_hweight64(w);
-}
-
 /*
  * rol32 - rotate a 32-bit value left
  *
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 23:06:51 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 23:06:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782009.1191532 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtG-0006WV-UQ; Thu, 22 Aug 2024 23:06:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782009.1191532; Thu, 22 Aug 2024 23:06:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtG-0006Ub-PB; Thu, 22 Aug 2024 23:06:50 +0000
Received: by outflank-mailman (input) for mailman id 782009;
 Thu, 22 Aug 2024 23:06:49 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gAWf=PV=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shGtF-00052v-LA
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 23:06:49 +0000
Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com
 [2a00:1450:4864:20::32f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 35360f7f-60db-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 01:06:48 +0200 (CEST)
Received: by mail-wm1-x32f.google.com with SMTP id
 5b1f17b1804b1-429da8b5feaso13144605e9.2
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 16:06:48 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f21ff19sm174676866b.39.2024.08.22.16.06.45
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 16:06:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 35360f7f-60db-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724368007; x=1724972807; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=04R2tozSLk4UY2KQvXd1YOljv9lem5MX3oYM5xelDrU=;
        b=Go3pnA3IJPCAUr4/jE0eBz6wuNTqt4OHgIztAquFdtTn8NnK4d3W3V+00dd0SUWiDD
         b07kBFp7z0yRiK/QgGKUuD/VhOOMWJzcswN2ShpXZrgZcFoLtXK8sZDFeWcWnDJVjPwL
         bpkpCazN5fOwKccvjnsQmzHsJWSvpnpEH2Pk4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724368007; x=1724972807;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=04R2tozSLk4UY2KQvXd1YOljv9lem5MX3oYM5xelDrU=;
        b=gAvru6LJGDkACBVHcbEPO2JAVZ4CQfJwwPT6V7rOqxMEBsdXugGO9fYc1eGI07GMB6
         yBO2YwVhYGHXN7k1jwnC1oMtmGdj+8nlXIfYL0JLI7ZgjG2HAqM2VuPfOYqKGjMiQhyA
         JnNn0QHzW7+nLQY4oEP7P3gW8K4qS51oEruLl8nxd+OH4nXV0BuKFan8TuMjIcgEglZY
         eTAiPrI71dbvSKhe7Q4wNipQKgwrnC3j5e25azEzXi0u3ZXrfN5IOjZeY4R2vVJM0X2h
         HxaZIm7i0J/rgFPrvR97lIu9gvTcjvVwYXblfLCkpZo5UTiXLfGvE/s6Z8FYL4a/sBYQ
         ybEA==
X-Gm-Message-State: AOJu0YxIel9F4X9QdQgREEmUqPIOOCm2RsHT01wWV9VSTM4SsVxDvvGG
	6M1mEVPYrQL3NFPqVzYjUKivWRxJauhMctk95lVv3hWslqKmllRpq8VA48hk0IIg5av/uBOmkOZ
	4
X-Google-Smtp-Source: AGHT+IHio/DKBV8jaKHOLljzZuYgJ+o3P9U5Tg3vcUpxjvZ+92Kcr0GWV4YmOYv7acgAE63q6nqrIQ==
X-Received: by 2002:a5d:404e:0:b0:368:6f64:307c with SMTP id ffacd0b85a97d-37311855fbdmr188983f8f.15.1724368006329;
        Thu, 22 Aug 2024 16:06:46 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 7/9] xen/bitops: Implement hweight64() in terms of hweightl()
Date: Fri, 23 Aug 2024 00:06:33 +0100
Message-Id: <20240822230635.954557-8-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240822230635.954557-1-andrew.cooper3@citrix.com>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

... and drop generic_hweight64().

This is identical on all architectures except ARM32.  Add one extra SELF_TEST
to check that hweight64() works when the input is split in half.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/arm/include/asm/bitops.h |  1 -
 xen/arch/ppc/include/asm/bitops.h |  1 -
 xen/arch/x86/include/asm/bitops.h |  1 -
 xen/common/bitops.c               |  3 +++
 xen/include/xen/bitops.h          | 26 ++++++++------------------
 5 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/xen/arch/arm/include/asm/bitops.h b/xen/arch/arm/include/asm/bitops.h
index 91cd167b6bbb..bed6b3b98e08 100644
--- a/xen/arch/arm/include/asm/bitops.h
+++ b/xen/arch/arm/include/asm/bitops.h
@@ -84,7 +84,6 @@ bool clear_mask16_timeout(uint16_t mask, volatile void *p,
  *
  * The Hamming Weight of a number is the total number of bits set in it.
  */
-#define hweight64(x) generic_hweight64(x)
 #define hweight32(x) generic_hweight32(x)
 
 #endif /* _ARM_BITOPS_H */
diff --git a/xen/arch/ppc/include/asm/bitops.h b/xen/arch/ppc/include/asm/bitops.h
index 64512e949530..24dc35ef644d 100644
--- a/xen/arch/ppc/include/asm/bitops.h
+++ b/xen/arch/ppc/include/asm/bitops.h
@@ -132,7 +132,6 @@ static inline int test_and_set_bit(unsigned int nr, volatile void *addr)
  *
  * The Hamming Weight of a number is the total number of bits set in it.
  */
-#define hweight64(x) __builtin_popcountll(x)
 #define hweight32(x) __builtin_popcount(x)
 
 #endif /* _ASM_PPC_BITOPS_H */
diff --git a/xen/arch/x86/include/asm/bitops.h b/xen/arch/x86/include/asm/bitops.h
index 4c5b21907a64..9d3a2448036e 100644
--- a/xen/arch/x86/include/asm/bitops.h
+++ b/xen/arch/x86/include/asm/bitops.h
@@ -481,7 +481,6 @@ static always_inline unsigned int arch_flsl(unsigned long x)
  *
  * The Hamming Weight of a number is the total number of bits set in it.
  */
-#define hweight64(x) generic_hweight64(x)
 #define hweight32(x) generic_hweight32(x)
 
 #endif /* _X86_BITOPS_H */
diff --git a/xen/common/bitops.c b/xen/common/bitops.c
index d0c268b4994a..f6a3eb5c9daf 100644
--- a/xen/common/bitops.c
+++ b/xen/common/bitops.c
@@ -117,6 +117,9 @@ static void __init test_hweight(void)
 
     CHECK(hweightl, 1 | (1UL << (BITS_PER_LONG - 1)), 2);
     CHECK(hweightl, -1UL, BITS_PER_LONG);
+
+    /* unsigned int hweight64(uint64_t) */
+    CHECK(hweight64, -1ULL, 64);
 }
 
 static void __init __constructor test_bitops(void)
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 11a1c9130722..e97516552a2e 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -302,6 +302,14 @@ static always_inline __pure unsigned int hweightl(unsigned long x)
 #endif
 }
 
+static always_inline __pure unsigned int hweight64(uint64_t x)
+{
+    if ( BITS_PER_LONG == 64 )
+        return hweightl(x);
+    else
+        return hweightl(x >> 32) + hweightl(x);
+}
+
 /* --------------------- Please tidy below here --------------------- */
 
 #ifndef find_next_bit
@@ -389,24 +397,6 @@ static inline unsigned int generic_hweight32(unsigned int w)
     return (w + (w >> 16)) & 0xff;
 }
 
-static inline unsigned int generic_hweight64(uint64_t w)
-{
-    if ( BITS_PER_LONG < 64 )
-        return generic_hweight32(w >> 32) + generic_hweight32(w);
-
-    w -= (w >> 1) & 0x5555555555555555UL;
-    w =  (w & 0x3333333333333333UL) + ((w >> 2) & 0x3333333333333333UL);
-    w =  (w + (w >> 4)) & 0x0f0f0f0f0f0f0f0fUL;
-
-    if ( IS_ENABLED(CONFIG_HAS_FAST_MULTIPLY) )
-        return (w * 0x0101010101010101UL) >> 56;
-
-    w += w >> 8;
-    w += w >> 16;
-
-    return (w + (w >> 32)) & 0xFF;
-}
-
 /*
  * rol32 - rotate a 32-bit value left
  *
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 23:06:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 23:06:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782010.1191550 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtJ-00077n-A3; Thu, 22 Aug 2024 23:06:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782010.1191550; Thu, 22 Aug 2024 23:06:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtJ-00077T-4u; Thu, 22 Aug 2024 23:06:53 +0000
Received: by outflank-mailman (input) for mailman id 782010;
 Thu, 22 Aug 2024 23:06:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gAWf=PV=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shGtH-0005x0-Pg
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 23:06:51 +0000
Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com
 [2a00:1450:4864:20::52f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 371f1151-60db-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 01:06:51 +0200 (CEST)
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5beb6ea9ed6so1825947a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 16:06:51 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f21ff19sm174676866b.39.2024.08.22.16.06.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 16:06:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 371f1151-60db-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724368010; x=1724972810; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=ZhC0dDRFULppQVdbhtuL/Lf0g47WWxeU1SaqkI74Lp0=;
        b=XtvJAfOfBDSJuh0Kg5UoQx152wKatFwvNXiKWmjHWiWbatr+6rNuPIAHQlh9OmWy+S
         Pqyq/ClHwb8/DLQNWJCd+h79cUNOdLHhHTQBDgLUf9NYTpi5ew2UGjvQo5uahPDaCRtu
         RvRE46zQd6XkDi+zGVeOhCoAK5nSDiFXbMgGk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724368010; x=1724972810;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=ZhC0dDRFULppQVdbhtuL/Lf0g47WWxeU1SaqkI74Lp0=;
        b=QuT1nJvQgPIHP7u+tmFAiTCgefxIsQpYsN6t2zKMZn59wmisQ90eKc4fM86WaRXF6d
         gsDgOFh212bTkdH6+MN1/yEGzU78HLnu6iHrlYim5joGojZRJZNgqB0bNnrS3dfozhmn
         r3+6pCZlSnB+NdOrJRZKP1DXrHVzd4L1nqMb6YzLUUnuD+dNZssWnQc4yGn5y9CNHitQ
         C6Tc/WT5XA38JNmpHJIMKIq2HzVXjselzm5M+okNwgfPfp/inSmEXhkDSqGbdKaWY5Mv
         g1iT1ozXA3XQ5iEtG9oiJzKTb3ZY49XvE6I09yHUqnjzekrW/7jis69XeXUUW6B9GUbH
         ALKA==
X-Gm-Message-State: AOJu0YzL1122s+cnDldBiI+ThnUinfGk7uOQ90Ta8PR5GET+SbH6xtCS
	1nETXfkOwO0hJvf+4J7oUjdsiCP2j4em4p1FsfNtm2AUfhDi83977JLKCq16kNOxjdSzgPdEQud
	C
X-Google-Smtp-Source: AGHT+IHNUm/EcdxtV5dBXZ8zfI7oCAB0QZqAzhTQlqiAQ9Y/DTgEq1db+kf1Yi4Q4Xa0ZVfQM72mnA==
X-Received: by 2002:a17:907:6092:b0:a86:83c3:d5d0 with SMTP id a640c23a62f3a-a86a54b6ff9mr20615766b.59.1724368009670;
        Thu, 22 Aug 2024 16:06:49 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH 9/9] x86/bitops: Use the POPCNT instruction when available
Date: Fri, 23 Aug 2024 00:06:35 +0100
Message-Id: <20240822230635.954557-10-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240822230635.954557-1-andrew.cooper3@citrix.com>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It has existed in x86 CPUs since 2008, so we're only 16 years late adding
support.  With all the other scafolding in place, implement arch_hweightl()
for x86.

The only complication is that the call to arch_generic_hweightl() is behind
the compilers back.  Address this by writing it in ASM and ensure that it
preserves all registers.

Copy the code generation from generic_hweightl().  It's not a complicated
algorithm, and is easy to regenerate if needs be, but cover it with the same
unit tests as test_generic_hweightl() just for piece of mind.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>

A few RFC points.

 * I throught we had an x86 general lib-y but I can't find one, hence why it's
   still in xen/lib/ for now.

 * When we up the minimum toolchain to GCC 7 / Clang 5, we can use a
   __attribute__((no_caller_saved_registers)) and can forgo writing this in asm.

   GCC seems to need extra help, and wants -mgeneral-regs-only too.  It has a
   habit of complaining about incompatible instructions even when it's not
   emitting them.
---
 xen/arch/x86/include/asm/bitops.h | 21 ++++++++++++++
 xen/lib/Makefile                  |  1 +
 xen/lib/arch-generic-hweightl.S   | 46 +++++++++++++++++++++++++++++++
 xen/lib/generic-hweightl.c        | 15 ++++++++++
 4 files changed, 83 insertions(+)
 create mode 100644 xen/lib/arch-generic-hweightl.S

diff --git a/xen/arch/x86/include/asm/bitops.h b/xen/arch/x86/include/asm/bitops.h
index 642d8e58b288..0db698ed3f4c 100644
--- a/xen/arch/x86/include/asm/bitops.h
+++ b/xen/arch/x86/include/asm/bitops.h
@@ -6,6 +6,7 @@
  */
 
 #include <asm/alternative.h>
+#include <asm/asm_defns.h>
 #include <asm/cpufeatureset.h>
 
 /*
@@ -475,4 +476,24 @@ static always_inline unsigned int arch_flsl(unsigned long x)
 }
 #define arch_flsl arch_flsl
 
+static always_inline unsigned int arch_hweightl(unsigned long x)
+{
+    unsigned int r;
+
+    /*
+     * arch_generic_hweightl() is written in ASM in order to preserve all
+     * registers, as the compiler can't see the call.
+     *
+     * This limits the POPCNT instruction to using the same ABI as a function
+     * call (input in %rdi, output in %eax) but that's fine.
+     */
+    alternative_io("call arch_generic_hweightl",
+                   "popcnt %[val], %q[res]", X86_FEATURE_POPCNT,
+                   ASM_OUTPUT2([res] "=a" (r) ASM_CALL_CONSTRAINT),
+                   [val] "D" (x));
+
+    return r;
+}
+#define arch_hweightl arch_hweightl
+
 #endif /* _X86_BITOPS_H */
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index b6558e108bd9..84d731dc0ac8 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -1,5 +1,6 @@
 obj-$(CONFIG_X86) += x86/
 
+lib-$(CONFIG_X86) += arch-generic-hweightl.o
 lib-y += bsearch.o
 lib-y += ctors.o
 lib-y += ctype.o
diff --git a/xen/lib/arch-generic-hweightl.S b/xen/lib/arch-generic-hweightl.S
new file mode 100644
index 000000000000..15c6e3394845
--- /dev/null
+++ b/xen/lib/arch-generic-hweightl.S
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+        .file __FILE__
+
+#include <xen/linkage.h>
+
+/*
+ * An implementation of generic_hweightl() used on hardware without the POPCNT
+ * instruction.
+ *
+ * This function is called from within an ALTERNATIVE in arch_hweightl().
+ * i.e. behind the back of the compiler.  Therefore all registers are callee
+ * preserved.
+ *
+ * The ASM is what GCC-12 emits for generic_hweightl() in a release build of
+ * Xen, with spilling of %rdi/%rdx to preserve the callers registers.
+ */
+FUNC(arch_generic_hweightl)
+        push   %rdi
+        push   %rdx
+
+        movabs $0x5555555555555555, %rdx
+        mov    %rdi, %rax
+        shr    $1, %rax
+        and    %rdx, %rax
+        sub    %rax, %rdi
+        movabs $0x3333333333333333, %rax
+        mov    %rdi, %rdx
+        shr    $0x2, %rdi
+        and    %rax, %rdx
+        and    %rax, %rdi
+        add    %rdi, %rdx
+        mov    %rdx, %rax
+        shr    $0x4, %rax
+        add    %rdx, %rax
+        movabs $0xf0f0f0f0f0f0f0f, %rdx
+        and    %rdx, %rax
+        movabs $0x101010101010101, %rdx
+        imul   %rdx, %rax
+        shr    $0x38, %rax
+
+        pop    %rdx
+        pop    %rdi
+
+        ret
+END(arch_generic_hweightl)
diff --git a/xen/lib/generic-hweightl.c b/xen/lib/generic-hweightl.c
index fa4bbec273ab..4b39dd84de5e 100644
--- a/xen/lib/generic-hweightl.c
+++ b/xen/lib/generic-hweightl.c
@@ -43,4 +43,19 @@ static void __init __constructor test_generic_hweightl(void)
     RUNTIME_CHECK(generic_hweightl, 1 | (1UL << (BITS_PER_LONG - 1)), 2);
     RUNTIME_CHECK(generic_hweightl, -1UL, BITS_PER_LONG);
 }
+
+#ifdef CONFIG_X86
+unsigned int arch_generic_hweightl(unsigned long);
+static void __init __constructor test_arch_generic_hweightl(void)
+{
+    RUNTIME_CHECK(arch_generic_hweightl, 0, 0);
+    RUNTIME_CHECK(arch_generic_hweightl, 1, 1);
+    RUNTIME_CHECK(arch_generic_hweightl, 3, 2);
+    RUNTIME_CHECK(arch_generic_hweightl, 7, 3);
+    RUNTIME_CHECK(arch_generic_hweightl, 0xff, 8);
+
+    RUNTIME_CHECK(arch_generic_hweightl, 1 | (1UL << (BITS_PER_LONG - 1)), 2);
+    RUNTIME_CHECK(arch_generic_hweightl, -1UL, BITS_PER_LONG);
+}
+#endif /* CONFIG_X86 */
 #endif /* CONFIG_SELF_TESTS */
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 22 23:06:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Aug 2024 23:06:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782011.1191553 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtJ-0007Bq-JP; Thu, 22 Aug 2024 23:06:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782011.1191553; Thu, 22 Aug 2024 23:06:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shGtJ-0007B6-Fd; Thu, 22 Aug 2024 23:06:53 +0000
Received: by outflank-mailman (input) for mailman id 782011;
 Thu, 22 Aug 2024 23:06:51 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=gAWf=PV=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shGtH-00052v-SP
 for xen-devel@lists.xenproject.org; Thu, 22 Aug 2024 23:06:51 +0000
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com
 [2a00:1450:4864:20::12e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3699e577-60db-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 01:06:50 +0200 (CEST)
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-533462b9428so2424368e87.3
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 16:06:50 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f21ff19sm174676866b.39.2024.08.22.16.06.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 22 Aug 2024 16:06:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3699e577-60db-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724368009; x=1724972809; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Hv9HlPwXrRYZdKJJ+1+hjJMFB9PxOUm7mKL1fwt8sqc=;
        b=LkHq+bj66eQWwX2bfzMPnXlvAKAFUu3jUVVFazOW9yIp53btyNksaiUTQ+FCBUNB+8
         Bu0CBDtqz0qY/inO45Pd4c+F8f0Jn0RiQ76XAEF7dIzRj8C16tDCM6zeu1FwO7OG9O/Z
         i5mXyA13Kkehef4hC0S5xKA6LNiCj98HfrMwQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724368009; x=1724972809;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Hv9HlPwXrRYZdKJJ+1+hjJMFB9PxOUm7mKL1fwt8sqc=;
        b=hyb6h/6ctauQtAulfnXTrRmePhuZx6e5NcWTnMQUs4hGzqrV7gRNfeigU1mzT8riV7
         53eSVp2I6Zt2Q8mu0EgBtm6lbYt7j0rmubLKYPO7pIhgLmh3g0sr11ThO49MY+gOpXY2
         mHJZYftURAVO5AmPqIlGL7uH4wreYfAoE9CaCK+TdUpGUBLNu7D3jZgiSi3cPK217t3H
         3hQMPdpGfltpRpm6gBfw1GHLO2L6jUXOSO3sEoCARzCYZaT90xqfHxcg+g/Gg8uwGC4r
         nPdZbnFu8B51xk5Kt07w2QX3FId01hWUImaQleclgDHYmfckzR67uhAE3CXiRqBdVbZd
         +upQ==
X-Gm-Message-State: AOJu0YzxZwpF8TaIFxyTxGtsCzcWQwfwrRzLLYbf0xxr51WWqUxinlWv
	SXEYGwbeUrirXtZcBCOg4ut3vQAZYBEyH3mqX6PJ06kSnoFWLfiD/bH9NtPRLRXukodIkNwrqpZ
	9
X-Google-Smtp-Source: AGHT+IE7t0IfrG/EKoPzKoWKQ7aMXt59Dnlv0A5uSbNgbXpz8Nz7/5pY6zVU/KKdUSpN6o8Cct/2wA==
X-Received: by 2002:a05:6512:114b:b0:52e:9808:3f48 with SMTP id 2adb3069b0e04-5343884701cmr433413e87.21.1724368008957;
        Thu, 22 Aug 2024 16:06:48 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Wei Liu <wl@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH 8/9] xen/bitops: Implement hweight32() in terms of hweightl()
Date: Fri, 23 Aug 2024 00:06:34 +0100
Message-Id: <20240822230635.954557-9-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240822230635.954557-1-andrew.cooper3@citrix.com>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

... and drop generic_hweight32().

As noted previously, the only two users of hweight32() and they're both
singleton callers in __init paths, so it's not interesting to have a sub-GPR
optimised generic.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/arm/include/asm/bitops.h |  8 --------
 xen/arch/ppc/include/asm/bitops.h |  8 --------
 xen/arch/x86/include/asm/bitops.h |  8 --------
 xen/include/xen/bitops.h          | 24 +++++-------------------
 4 files changed, 5 insertions(+), 43 deletions(-)

diff --git a/xen/arch/arm/include/asm/bitops.h b/xen/arch/arm/include/asm/bitops.h
index bed6b3b98e08..f163d9bb4578 100644
--- a/xen/arch/arm/include/asm/bitops.h
+++ b/xen/arch/arm/include/asm/bitops.h
@@ -78,14 +78,6 @@ bool clear_mask16_timeout(uint16_t mask, volatile void *p,
 #define arch_fls(x)  ((x) ? 32 - __builtin_clz(x) : 0)
 #define arch_flsl(x) ((x) ? BITS_PER_LONG - __builtin_clzl(x) : 0)
 
-/**
- * hweightN - returns the hamming weight of a N-bit word
- * @x: the word to weigh
- *
- * The Hamming Weight of a number is the total number of bits set in it.
- */
-#define hweight32(x) generic_hweight32(x)
-
 #endif /* _ARM_BITOPS_H */
 /*
  * Local variables:
diff --git a/xen/arch/ppc/include/asm/bitops.h b/xen/arch/ppc/include/asm/bitops.h
index 24dc35ef644d..c942e9432e20 100644
--- a/xen/arch/ppc/include/asm/bitops.h
+++ b/xen/arch/ppc/include/asm/bitops.h
@@ -126,12 +126,4 @@ static inline int test_and_set_bit(unsigned int nr, volatile void *addr)
 
 #define arch_hweightl(x) __builtin_popcountl(x)
 
-/**
- * hweightN - returns the hamming weight of a N-bit word
- * @x: the word to weigh
- *
- * The Hamming Weight of a number is the total number of bits set in it.
- */
-#define hweight32(x) __builtin_popcount(x)
-
 #endif /* _ASM_PPC_BITOPS_H */
diff --git a/xen/arch/x86/include/asm/bitops.h b/xen/arch/x86/include/asm/bitops.h
index 9d3a2448036e..642d8e58b288 100644
--- a/xen/arch/x86/include/asm/bitops.h
+++ b/xen/arch/x86/include/asm/bitops.h
@@ -475,12 +475,4 @@ static always_inline unsigned int arch_flsl(unsigned long x)
 }
 #define arch_flsl arch_flsl
 
-/**
- * hweightN - returns the hamming weight of a N-bit word
- * @x: the word to weigh
- *
- * The Hamming Weight of a number is the total number of bits set in it.
- */
-#define hweight32(x) generic_hweight32(x)
-
 #endif /* _X86_BITOPS_H */
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index e97516552a2e..bad2601b0fe6 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -302,6 +302,11 @@ static always_inline __pure unsigned int hweightl(unsigned long x)
 #endif
 }
 
+static always_inline __pure unsigned int hweight32(uint32_t x)
+{
+    return hweightl(x);
+}
+
 static always_inline __pure unsigned int hweight64(uint64_t x)
 {
     if ( BITS_PER_LONG == 64 )
@@ -378,25 +383,6 @@ static inline int get_count_order(unsigned int count)
     return order;
 }
 
-/*
- * hweightN: returns the hamming weight (i.e. the number
- * of bits set) of a N-bit word
- */
-
-static inline unsigned int generic_hweight32(unsigned int w)
-{
-    w -= (w >> 1) & 0x55555555;
-    w =  (w & 0x33333333) + ((w >> 2) & 0x33333333);
-    w =  (w + (w >> 4)) & 0x0f0f0f0f;
-
-    if ( IS_ENABLED(CONFIG_HAS_FAST_MULTIPLY) )
-        return (w * 0x01010101) >> 24;
-
-    w += w >> 8;
-
-    return (w + (w >> 16)) & 0xff;
-}
-
 /*
  * rol32 - rotate a 32-bit value left
  *
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 00:39:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 00:39:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782087.1191570 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shIKG-0001q2-Mp; Fri, 23 Aug 2024 00:38:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782087.1191570; Fri, 23 Aug 2024 00:38:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shIKG-0001pv-JA; Fri, 23 Aug 2024 00:38:48 +0000
Received: by outflank-mailman (input) for mailman id 782087;
 Fri, 23 Aug 2024 00:38:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shIKE-0001pl-IT; Fri, 23 Aug 2024 00:38:46 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shIKE-0001r7-Ay; Fri, 23 Aug 2024 00:38:46 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shIKD-0002h8-U8; Fri, 23 Aug 2024 00:38:46 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shIKD-0001E4-Ta; Fri, 23 Aug 2024 00:38:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=VWVYCUTQztSNsMseZqY6a0L9xK1NsfKl9mawF0T+9v4=; b=0r5KLpYtI/ebYidOPIU7GkhX/9
	HleWOITjmq1YjXy/ZEgg747ihIRR2YqTtFH2hCuwmqL/dkiNew5nqtCScGVWVc/d+0f+3rDqDzPKv
	Ir10w9RaZg3Xr1ONDWKLeqgbEwTX5fSiwslwodG01yV7xKbh6hW9Ptwr7lao5JIaytBE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187308-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187308: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=bec195607c69c1ad12d607ab0dcb420fdd0b484c
X-Osstest-Versions-That:
    libvirt=85e07fb1ceee7943879f8a374cabfa8ab858a3c6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 23 Aug 2024 00:38:45 +0000

flight 187308 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187308/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187298
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 libvirt              bec195607c69c1ad12d607ab0dcb420fdd0b484c
baseline version:
 libvirt              85e07fb1ceee7943879f8a374cabfa8ab858a3c6

Last test of basis   187298  2024-08-21 04:18:46 Z    1 days
Testing same since   187308  2024-08-22 04:20:45 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andi Chandler <andi@gowling.com>
  jianqing yan <yanjianqing@kylinos.cn>
  Kamil Szczęk <kamil@szczek.dev>
  Peter Krempa <pkrempa@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   85e07fb1ce..bec195607c  bec195607c69c1ad12d607ab0dcb420fdd0b484c -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 00:59:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 00:59:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782100.1191579 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shIdr-0005Ta-Cf; Fri, 23 Aug 2024 00:59:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782100.1191579; Fri, 23 Aug 2024 00:59:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shIdr-0005TT-A1; Fri, 23 Aug 2024 00:59:03 +0000
Received: by outflank-mailman (input) for mailman id 782100;
 Fri, 23 Aug 2024 00:59:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shIdp-0005TJ-T1; Fri, 23 Aug 2024 00:59:01 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shIdp-0002HA-MJ; Fri, 23 Aug 2024 00:59:01 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shIdp-0003ev-Bs; Fri, 23 Aug 2024 00:59:01 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shIdp-0000Qt-BY; Fri, 23 Aug 2024 00:59:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ByYj2KhCsvv+Xqrmu7KpUvQAb3N+Woal4xS7RAavYYo=; b=HcCpvXBJ30vmDLaUoktJ3O3CLV
	A0fo9gugIefDOC7qU9+jWvLq/PHLoSMiXtQKgqU8PE4sjZQ1Mr4JU21eonJIv2vrdCSzxJNLOWlL5
	BGgc33YYPZk1A+kE3B29btmQTkgY6YBTqySIX128o682WEsE9HwBf4vsqqzizhV9IfOk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187314-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187314: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=aa80a04df488528d90a0d892f0752571b1759e8b
X-Osstest-Versions-That:
    xen=394c9d88858cd99fcb5a189dbabe2af34dbabfd3
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 23 Aug 2024 00:59:01 +0000

flight 187314 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187314/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  aa80a04df488528d90a0d892f0752571b1759e8b
baseline version:
 xen                  394c9d88858cd99fcb5a189dbabe2af34dbabfd3

Last test of basis   187310  2024-08-22 11:02:18 Z    0 days
Testing same since   187314  2024-08-22 21:04:01 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   394c9d8885..aa80a04df4  aa80a04df488528d90a0d892f0752571b1759e8b -> smoke


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 04:46:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 04:46:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782125.1191590 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shMBd-0006A0-Km; Fri, 23 Aug 2024 04:46:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782125.1191590; Fri, 23 Aug 2024 04:46:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shMBd-00069t-ID; Fri, 23 Aug 2024 04:46:09 +0000
Received: by outflank-mailman (input) for mailman id 782125;
 Fri, 23 Aug 2024 04:46:07 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shMBb-00069j-Ty; Fri, 23 Aug 2024 04:46:07 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shMBb-00064t-P0; Fri, 23 Aug 2024 04:46:07 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shMBb-00044H-4I; Fri, 23 Aug 2024 04:46:07 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shMBb-00063Y-3b; Fri, 23 Aug 2024 04:46:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=fitBjL+Ie3O7/Vb1tUKxDtpYBVcgomQRgD/3lc79Sr4=; b=DVybSBD/fpOoEnh1Uxrb01O8l6
	Q4kWouwAUC6RirM45vLzwGu6xUpJDxBTgvoJFoope+VGzjFYBO1T7tz+6xxoAl9GT7fmDQsd5xM8q
	dO5fnJtr6FQ88VhwS20z9KALAXHKhKf0lHBViVwhbCiwgslOQkQE7IYF7pTZHWKqIVTA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187309-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187309: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=407f9a4b121eb65166375c410e14d7b704bc1106
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 23 Aug 2024 04:46:07 +0000

flight 187309 qemu-mainline real [real]
flight 187317 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187309/
http://logs.test-lab.xenproject.org/osstest/logs/187317/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass

version targeted for testing:
 qemuu                407f9a4b121eb65166375c410e14d7b704bc1106
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  351 days
Failing since        182723  2023-09-07 18:19:05 Z  350 days   29 attempts
Testing same since   187309  2024-08-22 07:32:05 Z    0 days    1 attempts

------------------------------------------------------------
620 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 180820 lines long.)


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 06:32:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 06:32:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782140.1191600 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shNpz-0006hS-30; Fri, 23 Aug 2024 06:31:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782140.1191600; Fri, 23 Aug 2024 06:31:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shNpy-0006hL-VL; Fri, 23 Aug 2024 06:31:54 +0000
Received: by outflank-mailman (input) for mailman id 782140;
 Fri, 23 Aug 2024 06:31: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=+Ly7=PW=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1shNpx-0006hF-Mw
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 06:31:53 +0000
Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com
 [2a00:1450:4864:20::635])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 62467df9-6119-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 08:31:52 +0200 (CEST)
Received: by mail-ej1-x635.google.com with SMTP id
 a640c23a62f3a-a86abbd68ffso10640366b.0
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 23:31:52 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f43790bsm210819466b.126.2024.08.22.23.31.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 22 Aug 2024 23:31:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 62467df9-6119-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724394712; x=1724999512; 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=YjdBEQO1jlm3fuESIohG+xz31zFEudu6/daTF547e1I=;
        b=LeJ+JzELv0HKv167iKWvQ22XAi8zIe8cV8M4dw9v6QvyEo5xhlJ1p9OK3fymRa5OZI
         JM9qLsRwVmYU2lgxIBM2YO1iO/EUTjOs/hC+XOi2LHNIjmrewTZoWEUdetVsq/srvtt0
         d99H0UzWIIFKPP2MkO0ZsAlBbcKJPc9k2ZHCKFJK6j1c+Pl3Ky3IxNymqp4OzyWhNzxI
         5ydHl9i66i1bb4dig2AVbovLXl87vY9vv8M4xAWewkIukjU64lI9J6/w5TZnF5rSk/2P
         OKQGWAW17LfYgueEyuKNQxZhOtXs4Kxv5dha8WXb1/UIXkg3sMfamBmp+DK0hoD/J7EM
         iBcA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724394712; x=1724999512;
        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=YjdBEQO1jlm3fuESIohG+xz31zFEudu6/daTF547e1I=;
        b=Lel2kanplwA8q28jv+cMDJBjKiUSSoS+znA2wuc8+1fIZpcKx+v1fxMCcVLUdKtZ/R
         FYKgnwGzjYJ6Stf4fnPWDyfhkCsyT1brAmaAgEGkanlDGI+8Z3heFvr2CkeMxSASuCBg
         5g7RxvOvBk7/LkELEBGNSCR/DQ3MrRA2PRiPwtCd3gI5Sp0XK4oePLLGBxlLTG+EBKNy
         cgpUh55iIdnHFg+jmrxsIUgSOmH9aULx3wGPFKTlg5BjceWjN/+BZGggKs/jGgYux7Vh
         zQb/LbNba6a9qhZOE+qOq9ZCHi4eLwF+HJ4j1GQR4uhUoVVdslC22k5VEyDBHcGNdXhr
         79Aw==
X-Forwarded-Encrypted: i=1; AJvYcCV050+lSf8vBOEDagegtMl2P8/vtg/mdJEnByzmDkz+BMo4lnNW1Aa8ZSSDnfWNH8az3FxSz28n+w0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwcjvJ3LPrApqfHNjI3IIdeSvQ/hNLpn61PS6M8OUU6p2wk9iUT
	O7SLOynZIg54DJSVZt80HI1tSlkYU9bSh2LA/b3XLGGtcpta3kCWSbq+inY936Av/BTg562pHrI
	=
X-Google-Smtp-Source: AGHT+IEz0HZE9T6v3TnwLmHWp49xCvAr8+Frwi6ggjDb550xULk8hW+1QjHExOPDFmKHYDBMjKxS8Q==
X-Received: by 2002:a17:907:96a1:b0:a80:b016:2525 with SMTP id a640c23a62f3a-a86a2f5a37bmr138366566b.8.1724394711643;
        Thu, 22 Aug 2024 23:31:51 -0700 (PDT)
Message-ID: <7b575ad5-c7c6-4054-8036-9d2961630d42@suse.com>
Date: Fri, 23 Aug 2024 08:31:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v1] libxl: Fix nul-termination of the return value of
 libxl_xen_console_read_line()
To: Javi Merino <javi.merino@cloud.com>,
 Anthony PERARD <anthony.perard@vates.tech>
Cc: Juergen Gross <jgross@suse.com>, =?UTF-8?B?RWR3aW4gVMO2csO2aw==?=
 <edwin.torok@cloud.com>, xen-devel@lists.xenproject.org
References: <ad7c89bbae34155566ae7c9ca2cb501f21c7d585.1724330921.git.javi.merino@cloud.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: <ad7c89bbae34155566ae7c9ca2cb501f21c7d585.1724330921.git.javi.merino@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 22.08.2024 15:13, Javi Merino wrote:
> When built with ASAN, "xl dmesg" crashes in the "printf("%s", line)"
> call in main_dmesg().  ASAN reports a heap buffer overflow: an
> off-by-one access to cr->buffer.
> 
> The readconsole sysctl copies up to count characters into the buffer,
> but it does not add a null character at the end.  Despite the
> documentation of libxl_xen_console_read_line(), line_r is not
> nul-terminated if 16384 characters were copied to the buffer.
> 
> Fix this by making count one less that the size of the allocated
> buffer so that the last byte is always null.
> 
> Reported-by: Edwin Török <edwin.torok@cloud.com>
> Signed-off-by: Javi Merino <javi.merino@cloud.com>

Perhaps wants a Fixes: tag as well?

> --- a/tools/libs/light/libxl_console.c
> +++ b/tools/libs/light/libxl_console.c
> @@ -779,7 +779,7 @@ libxl_xen_console_reader *
>      cr = libxl__zalloc(NOGC, sizeof(libxl_xen_console_reader));
>      cr->buffer = libxl__zalloc(NOGC, size);
>      cr->size = size;
> -    cr->count = size;
> +    cr->count = size - 1;
>      cr->clear = clear;
>      cr->incremental = 1;

While this looks to be addressing the issue at hand, I still wonder: Why
does the "count" field exist at all? It's certainly odd to be set right
here (when the buffer actually is empty). It's used solely in
libxl_xen_console_read_line(), so could be a local variable there.

Then, further, I wonder why struct libxl__xen_console_reader lives in
libxl_internal.h - it's used solely in libxl_console.c.

Finally - why libxl__zalloc() when libxl_xen_console_read_line() clears
the buffer anyway?

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 06:40:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 06:40:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782149.1191610 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shNy9-0000Kh-Rj; Fri, 23 Aug 2024 06:40:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782149.1191610; Fri, 23 Aug 2024 06:40:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shNy9-0000Ka-OQ; Fri, 23 Aug 2024 06:40:21 +0000
Received: by outflank-mailman (input) for mailman id 782149;
 Fri, 23 Aug 2024 06:40: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=+Ly7=PW=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1shNy8-0000KU-3W
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 06:40:20 +0000
Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com
 [2a00:1450:4864:20::536])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8fe49427-611a-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 08:40:19 +0200 (CEST)
Received: by mail-ed1-x536.google.com with SMTP id
 4fb4d7f45d1cf-5befd2f35bfso2155996a12.2
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 23:40:19 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0515a6342sm1704838a12.79.2024.08.22.23.40.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 22 Aug 2024 23:40:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8fe49427-611a-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724395218; x=1725000018; 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=L6rQzet8aaepjX1p6bRXeaq3UnocfIoPmF5UhWJcUQc=;
        b=BaAaghhHhPt+l6xJUdeSZrnI+Y8caZM+UEkb2YrLTyRgPJMIIx1LCiIluQQg0eQKFH
         WMFSbkajUN5wfDYhY/2lpwW3MRIhxx3au30AuKQHMum/Evkt7mE8onApH5SAzU2Ructv
         3djgo9ESH7L1dzQcN6FRGxtUlXgJt45AL/UU4ZfYfZvlEV+3V9PI5CJZ4sCOpURuz+MK
         u6hkvhqqNcxnfshLO3yKgLVE84Tkp+1K8/6s297pH9952do/5wx+jECJcMxf7A0H3bn/
         mVRi5ENWhHFK85M9TWDAKT2xDxi0BYZEWSMaL0dkuhi/+CqKr9bnoPfnSGp+3tGyjmz5
         THoQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724395218; x=1725000018;
        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=L6rQzet8aaepjX1p6bRXeaq3UnocfIoPmF5UhWJcUQc=;
        b=NCQVxJ7B45NDOMb8+nmnj9jHVj3p7wzBqY+jmS9CWLql04UkUZAfHMYVE9EX8uhXlV
         vSBWtVZp/kOzl0ti73pLThSi6VsOcVSkbpCUTbhNQoEARXiqtPx1rdYDV1O1CAOHbmcs
         7tbtUf75/Es77Vhf4w39kbVdCuk4C3Z7SgD23TM+ORqT2zfuNBcsBFgY9Ev5ZpgA0HfB
         W2vt9TPAOMoYyMiH2CMONEkCJcvWg9y6NQJ/a5wqJjh9douakJ+6dnFJx64i4RI9fK6L
         4Dri1FVcrvGVaL+JLPpT27HjCaVh6WcQsNVXXpF9AOpO/LjQPiKdWXb+dpNUPS4ODplE
         XYbQ==
X-Forwarded-Encrypted: i=1; AJvYcCW7ATb0tI6RyZjMPHU5jBaqeh8xrtPYM72K2Dr5WmawUkipCd0iHCYNPx2sj/IVIFnVSQmPhHPZ6JQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyV5BKWsF8D/11CXjTz9sr5v97OdVMAsWAWhZLaMORQf0gJgP6H
	gXA2RS357GZLy5wcgnN+COSEOZAEwI2pd1GMWGEclWGtBAewq0JvzQAHWvjMsn+JyNE5yj4y6d0
	=
X-Google-Smtp-Source: AGHT+IEmDwc3AEJ51K18Slqmr+fjOq/XYVgMVeFDNuO8E7/qeuZ3hkscEuEGCfcm6no9D9pBp+dP1A==
X-Received: by 2002:a05:6402:2105:b0:5b9:462d:c538 with SMTP id 4fb4d7f45d1cf-5c08915a80cmr796039a12.3.1724395217635;
        Thu, 22 Aug 2024 23:40:17 -0700 (PDT)
Message-ID: <d65d8b50-5f9a-4495-afd8-7ca4430a2e1d@suse.com>
Date: Fri, 23 Aug 2024 08:40:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] Restore memory used for IP computation
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20240822140044.441126-1-frediano.ziglio@cloud.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: <20240822140044.441126-1-frediano.ziglio@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 22.08.2024 16:00, Frediano Ziglio wrote:
> We need to write in some location but no reasons to not
> trying to restore what we potentially overwrote.
> 
> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
> ---
>  xen/arch/x86/boot/head.S | 22 ++++++++++++++--------
>  1 file changed, 14 insertions(+), 8 deletions(-)
> ---
> Changes since v1:
> - Rewrite magic number field instead of some possible BIOS area.
> 
> diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
> index d8ac0f0494..9b7e7b4e51 100644
> --- a/xen/arch/x86/boot/head.S
> +++ b/xen/arch/x86/boot/head.S
> @@ -415,16 +415,19 @@ __pvh_start:
>  
>          /*
>           * We need one push/pop to determine load address.  Use the same
> -         * absolute stack address as the native path, for lack of a better
> -         * alternative.
> +         * stack address as the native path.

This isn't quite right, because ...

> @@ -463,18 +466,21 @@ __start:
>           * relocatable images, where one push/pop is required to calculate
>           * images load address.
>           *
> -         * On a BIOS-based system, the IVT and BDA occupy the first 5/16ths of
> -         * the first page of RAM, with the rest free for use.  Use the top of
> -         * this page for a temporary stack, being one of the safest locations
> -         * to clobber.
> +         * Save and restore the magic field of start_info in ebx, and use
> +         * that as the stack. See also

... there simply is no start_info here. Iirc Andrew suggested to use the MB
area's first slot (which effectively is what you do here, i.e. it's just the
comment which is misleading), presumably on the assumption that any exception
(incl NMI) in the window until a proper stack is set up will be deadly anyway
(which may want mentioning in the comment or description as well).

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 06:48:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 06:48:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782159.1191620 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shO5v-0001dg-NZ; Fri, 23 Aug 2024 06:48:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782159.1191620; Fri, 23 Aug 2024 06:48:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shO5v-0001dZ-KE; Fri, 23 Aug 2024 06:48:23 +0000
Received: by outflank-mailman (input) for mailman id 782159;
 Fri, 23 Aug 2024 06:48: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=+Ly7=PW=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1shO5u-0001dT-Ne
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 06:48:22 +0000
Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com
 [2a00:1450:4864:20::52c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id af64af84-611b-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 08:48:20 +0200 (CEST)
Received: by mail-ed1-x52c.google.com with SMTP id
 4fb4d7f45d1cf-5bec78c3f85so1979654a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 22 Aug 2024 23:48:20 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a3cbcaesm1693360a12.39.2024.08.22.23.48.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 22 Aug 2024 23:48:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: af64af84-611b-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724395700; x=1725000500; 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=KgAuwxLJBxFo+sIorLSrqSq2BKf0W3ERXL8VEq5bxk4=;
        b=Cp52VUExUppDAGYI/itoCtOS5fc2G1qBQsSURTcL/JdSSQHue5C3vwpy8YyPqZ1beM
         ApFUIxUhOJMNrNQyM9mTs87mFoVOzcTYHr6JVa6orQqCosU6E3knjaRrQGRkONErKH5s
         xoeSfO19vEI0T+BJ/rbEWraBtGVBKKRoJl8SAN4aSCicSmsWHNZIJ30GRVVC/N5bGPIs
         8G2jaSYHhIyjwvfSbtI56OU8hHz0qTc5Uy8Ef/sRc3oeRVagbysQ6J9os/Clbr4tNihl
         qDHgR+0vCF5NxATVQJUOytRVgEZ6+V91ZC26V8HTsBxbfO046dG1djZyTN+UA6zQ6YkK
         /I8Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724395700; x=1725000500;
        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=KgAuwxLJBxFo+sIorLSrqSq2BKf0W3ERXL8VEq5bxk4=;
        b=Bf6ucTcyLSp4C3ginSsFTYtBFICUd/AALslxMJoFn9tTN4i6FhvS9nZGcETLEV70es
         HIlhLLywOjRpZFqh3tQfDlG8jwOPljzf/y3R6uTOYucVU6OZCUYXc/0DdLo4FpGPgSLa
         U0unHBdN4TfbTJWKZZcnAypjc/l0lcE0+BsW6kyPg4t6qwLPl8ern2V99u5QCfYfehR+
         3kEHEyoWU7i+foff1ZjLlFPY1s+Ni0sPKfXlsgqwEVm813IE4Wm/UAsZzoClQoVkRmO5
         Ag1hgW0KpSGaCLWD8/ZqXX0Iy3bk0PyU6coDsD1YzSB22hnRzxiKMXrA/UYbJ20iKMrv
         IW8w==
X-Forwarded-Encrypted: i=1; AJvYcCXkBmlE7zGoypXVfw+E0n5sEdIuhcNRTfWfwHBbrioEmrDEMvKSCsRKb0+KktR8FsWpWRx/ccLwaUU=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz5TL3bLa09b08ep/wsljwU1PO5Uz9LCApGfw/WB333yo1Pk6Mc
	PhGOsUfHolvVzlNSnYVbpYKbemh6RVzYTTWE1IiJhINhiGaGzK+oeYQKlDfDnA==
X-Google-Smtp-Source: AGHT+IFmmxWJfgdQJ/oszvxr0odgYDPBpqIqjDhQnBeRT9OvvCtZFdRBXklV7gcHJ04I8sD+wEPlcQ==
X-Received: by 2002:a05:6402:2b8a:b0:5be:fcba:c37c with SMTP id 4fb4d7f45d1cf-5c0891b1fd9mr561219a12.35.1724395700111;
        Thu, 22 Aug 2024 23:48:20 -0700 (PDT)
Message-ID: <25eca7b9-daef-42c7-8aa4-0d63d0cd0aa4@suse.com>
Date: Fri, 23 Aug 2024 08:48:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v7 2/3] x86/ucode: Introduce --force option to xen-ucode
To: Fouad Hilly <fouad.hilly@cloud.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Juergen Gross <jgross@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 xen-devel@lists.xenproject.org
References: <20240822130426.492931-1-fouad.hilly@cloud.com>
 <20240822130426.492931-3-fouad.hilly@cloud.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: <20240822130426.492931-3-fouad.hilly@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 22.08.2024 15:04, Fouad Hilly wrote:
> @@ -79,7 +81,10 @@ static void usage(FILE *stream, const char *name)
>              "Usage: %s [options | microcode-file]\n"
>              "options:\n"
>              "  -h, --help               display this help\n"
> -            "  -s, --show-cpu-info      show CPU information\n",
> +            "  -s, --show-cpu-info      show CPU information\n"
> +            "  -f, --force              skip certain checks when applying\n"
> +            "                           microcode; do not use unless you know\n"
> +            "                           exactly what you are doing\n",
>              name, name);

As indicated before: --force does no longer fit "[options | microcode-file]".
The form coming closest is imo going to be "[options] [microcode-file]", with
the file name simply taking no effect when specified together with one of the
pre-existing two options.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 07:17:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 07:17:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782167.1191631 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shOXg-0007AL-Uc; Fri, 23 Aug 2024 07:17:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782167.1191631; Fri, 23 Aug 2024 07:17:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shOXg-0007AE-QQ; Fri, 23 Aug 2024 07:17:04 +0000
Received: by outflank-mailman (input) for mailman id 782167;
 Fri, 23 Aug 2024 07:17:03 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=+Ly7=PW=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1shOXf-0007A8-SV
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 07:17:03 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b10f11c6-611f-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 09:17:01 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-5befe420fc2so2328256a12.3
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 00:17:01 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f28f109sm218007166b.55.2024.08.23.00.17.00
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 23 Aug 2024 00:17:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b10f11c6-611f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724397421; x=1725002221; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Bz8CLLgWlV/7bck03wIYDrH4mmRVyA4EByfbd2a1BD8=;
        b=RxtdgcH21nWHYnk7UowmFYA/ewqPLXVW5F6PnjmesaIXb3M5krDemgcwZV9TxKiwVk
         IT66rXiMTolGYFXWkPdDWWftBX8RA7JMRm6rSDXrpLisFexRj2v7Gc0FCqFjwwXPxBGh
         21a5zI9KliGMnON2/44ok2W7ayWYK44gH6FNz1DZPJ75oa6+TRfjLpD6lr40ShKA7otR
         pl7NLPy6vdillyzczZXwZW0oWFUk3cXFGAviV0x16JzoP3l1+wOp7l3lHMuRD3WUh3pn
         y5Zoum8IvfjB6x8xU6lqpZAkQaxMtaLJelvgTaUIIPnczfE3cDFIIXDbP4SRQSJHJHIn
         ad5w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724397421; x=1725002221;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=Bz8CLLgWlV/7bck03wIYDrH4mmRVyA4EByfbd2a1BD8=;
        b=t2rV3NtceQK7PjG9QNn/vodB5Oc7Cr8U0OwMUM6ZkqAFJ/YmpSzrij1HppcI4ayJcs
         lgHhZnLqtctmHmmrVrWBAkLfMm5CVaJasN2PspepLXphMvjtsXtJgZBFYAlj+yT/hqHj
         1vssVz0KIoTPg4PjCez3sATQ5Uz4foOFEAJiwrDTOmSq9w+HG4bIZsLMdLKGwoShz2hk
         9nvt9qmCS5rovh/cwcyZhYE9WfA9ajh5byFK3T6VP5+xI9DBDzYcDAJTWOwx6FfZH5IO
         yr1qt+UJ/9uSuyenXaYnpYctlfl1+696Pn5JRCy90qB4BekSqn8sdNQPi2tmqrmpq4Fu
         Z+hw==
X-Gm-Message-State: AOJu0YzE/3hMhXdE1N+RXMxC7IlfJ+lxgRE6uZLuwWHSfJZ8h6uCEbwp
	DkWPv6u03C8y1qIYkLeuDWduXPVcU8CU68m7u3QXaQH6GDPKc9ETEofEL9UG98QHZA1QQmNDaX0
	=
X-Google-Smtp-Source: AGHT+IG6YXoZYsN7K394mX6/9pAnXMXC5oc1cSLkNpCZpRwHB/KvO3WusqsXipCrDyIjKz3v7yLuNA==
X-Received: by 2002:a17:907:e245:b0:a86:85eb:bdd1 with SMTP id a640c23a62f3a-a86a52de2e2mr90380166b.31.1724397420881;
        Fri, 23 Aug 2024 00:17:00 -0700 (PDT)
Message-ID: <d14e4ffc-d07b-4a60-8949-ecdcea86cd77@suse.com>
Date: Fri, 23 Aug 2024 09:16:59 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86emul: drop and avoid use of BUG()
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Generally it is not a good idea to use BUG() in emulator code. Even for
internal flaws we're better off returning errors to callers, rather than
crashing the system. Replace the sole remaining use and remove the
test / fuzzing harness surrogate. Put in place a declaration pleasing
the compiler when finding uses in Xen headers, while at the same time
breaking the build (at linking time) in case an active reference would
newly appear.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
The #undef and override may be going a little too far, but I guess we
can revisit this if and when it actually gets in the way.

While BUG_ON() references BUG() and is hence covered, we may want to
consider to #undef/declare that separately. That way the linker error
would make clear which one it is that was referenced.

I could use EXPECT() instead of kind of open-coding it, but I don't
really like EXPECT(false) or variations thereof.

--- a/tools/tests/x86_emulator/x86-emulate.h
+++ b/tools/tests/x86_emulator/x86-emulate.h
@@ -42,7 +42,6 @@
 
 #include <xen-tools/common-macros.h>
 
-#define BUG() abort()
 #define ASSERT assert
 #define ASSERT_UNREACHABLE() assert(!__LINE__)
 
--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -1122,7 +1122,9 @@ int x86emul_decode(struct x86_emulate_st
             switch ( def_ad_bytes )
             {
             default:
-                BUG(); /* Shouldn't be possible. */
+                ASSERT_UNREACHABLE(); /* Shouldn't be possible. */
+                return X86EMUL_UNHANDLEABLE;
+
             case 2:
                 if ( ctxt->regs->eflags & X86_EFLAGS_VM )
                     break;
--- a/xen/arch/x86/x86_emulate/private.h
+++ b/xen/arch/x86/x86_emulate/private.h
@@ -15,6 +15,9 @@
 # include <asm/x86-vendors.h>
 # include <asm/x86_emulate.h>
 
+# undef BUG /* Make sure it's not used anywhere here. */
+void BUG(void);
+
 # ifndef CONFIG_HVM
 #  define X86EMUL_NO_FPU
 #  define X86EMUL_NO_MMX


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 07:23:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 07:23:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782177.1191652 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shOdN-0000KR-Js; Fri, 23 Aug 2024 07:22:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782177.1191652; Fri, 23 Aug 2024 07:22:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shOdN-0000KK-Gr; Fri, 23 Aug 2024 07:22:57 +0000
Received: by outflank-mailman (input) for mailman id 782177;
 Fri, 23 Aug 2024 07:22: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=jBOo=PW=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1shOdL-0000KE-ON
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 07:22:56 +0000
Received: from EUR05-AM6-obe.outbound.protection.outlook.com
 (mail-am6eur05on20623.outbound.protection.outlook.com
 [2a01:111:f403:2612::623])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8258a895-6120-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 09:22:52 +0200 (CEST)
Received: from AS9PR05CA0078.eurprd05.prod.outlook.com (2603:10a6:20b:499::22)
 by AS1PR08MB7658.eurprd08.prod.outlook.com (2603:10a6:20b:479::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.16; Fri, 23 Aug
 2024 07:22:47 +0000
Received: from AMS1EPF0000003F.eurprd04.prod.outlook.com
 (2603:10a6:20b:499:cafe::3e) by AS9PR05CA0078.outlook.office365.com
 (2603:10a6:20b:499::22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19 via Frontend
 Transport; Fri, 23 Aug 2024 07:22:47 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AMS1EPF0000003F.mail.protection.outlook.com (10.167.16.36) with
 Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7897.11
 via Frontend Transport; Fri, 23 Aug 2024 07:22:47 +0000
Received: ("Tessian outbound 7d86ec5dfeb5:v403");
 Fri, 23 Aug 2024 07:22:46 +0000
Received: from L213838b8f558.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 8CA48648-8AEA-4A67-99B3-7567CE5DB143.1; 
 Fri, 23 Aug 2024 07:22:05 +0000
Received: from EUR03-DBA-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id
 L213838b8f558.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Fri, 23 Aug 2024 07:22:05 +0000
Received: from DB9PR08MB6588.eurprd08.prod.outlook.com (2603:10a6:10:25a::24)
 by PA4PR08MB6061.eurprd08.prod.outlook.com (2603:10a6:102:e9::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.13; Fri, 23 Aug
 2024 07:22:02 +0000
Received: from DB9PR08MB6588.eurprd08.prod.outlook.com
 ([fe80::a8fc:ea0d:baf1:23a]) by DB9PR08MB6588.eurprd08.prod.outlook.com
 ([fe80::a8fc:ea0d:baf1:23a%3]) with mapi id 15.20.7897.014; Fri, 23 Aug 2024
 07:22:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8258a895-6120-11ef-8776-851b0ebba9a2
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=PbAcVGvljX7io9VGsXo47xXAmBAjc1enXDc9M4JzEsxqnoEpREkXi/wP/d/NnPXW7nWcxouO/ifid7D621wei2FE3YCCdjdgkQR66c7Zic/dLnQTab7YQ4+NXo+cDWt3spuXgLjmmw2pAcxdzZRFOuLfAS+r35jMJnmDzMgMaGC1FdgQyQ8kgOJ9oeU1h69i8jOl3ah/06XjWxyBSL4m14ARc9bmV9smKEwh11iH8S0rKNJFZUYJAdgSOZ8WpZBt79GE56oVK1N+++uvky1J0LS45Vcjt6DVhkQIYulEtI80rGa+mIAXLi0iqjCK+zWM8nVABrujVcj014U3kEsrpA==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7hGzt4cutWk9HQVuYquuOv8AS/JhqBbPZklOWcgKRbU=;
 b=mEJKp13kTb91RT97RUKTFFtX49r8cjHSJWuvSKlWD1VokWPMJ13yJqaMZpGCFnDVOi78/AIMMVfRlC17NplQ0r2G6h8f8wk2kUx8jpZ2AIeG7omzxyreqW/gSdKXO15lou1wQaLWffLT+Ll8Kz05TrttcI3/dk9YAG2VjamnwRX8fXjCw/6EdHZNpZF7ZXaNlNpBl4Jy8gdy9OgFrS6eW2EWlic78oFGRLMI2Km/ApGgudj0vleXLWtXcS5ODBa6VX0wWMOMSHTp/2tIYTwdnQnIE7o42mUcWT9d2nFib4jZBXTh7PNmY7j7zmBCFg0UAhquO81bA7mOERp+YONshA==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com;
 dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com;
 dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7hGzt4cutWk9HQVuYquuOv8AS/JhqBbPZklOWcgKRbU=;
 b=n/V5PQT/2L24rh6kK9n08ktMtzy/E83a//zRsmCN5C7zF8MFMcOBESmT9e8tuhd/y88uLzkriWhHuRQV0g4iTLMuwv+6YDkpAfeW8FsxG6GSAj7nn/wC5QG18f8QSLufddTVqbh21LoSxJwgDirmUkzmVGAzIGWC89LfQYWjXBA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: d45208716cd4d226
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=siPq77wH3xgP20lSctqlv6c2laJsN99QvKgF3oJNGbu1LIuUarVJikUM20ohLAmL96wRRCSp5H+EUDnaa7iWpQnlwObydKuotBuFrjUupMMC9dNRWqevyjic6JuFQY/PLQmVf0jZO6PVFcWlgk2itxodlmIUEWqWodG/84AmAAcSaRJXNzK3xSnYmXi+m9SfDhBwyR978B/OysijwCxtjU4sYhESyCIM4fbicYrIaI1bK2K2TRnQg1nT18rbUyMH0JiE7PtghtRkLY81m1sQZeL6DLCcJb1OhMaUpYusTrtwDtfhb2Tq0sRzjXGawGxJudKkGU3sSLg62jh0O/fhlQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=7hGzt4cutWk9HQVuYquuOv8AS/JhqBbPZklOWcgKRbU=;
 b=XBzRuIxKiScaVw30INJJ85I0krZOtwly6inElkM8E1zcP+Uec+hXjKfkussZeC262l9lX3VfYRMYPC3tjSN+VUh9umh6z6ZJi6RToSbyJJbSyvZdUJrtz+RoDFjNKagxT+hM7UnK4dxbnj5A8nklpf/kBB7pwB3tPSwMf8VDNRkRHRI+jSHrRyn+DSdFu7Nh89rcZV9HaIbS3Icv8oY55ZUthz8Xy7ndft8VhtCyaXMXSKAcWKIRNxiq7bjAOr4udz0zC3CsQYBKLQMCt2oE9qNwSNyRNCcNFDmOEL5mif7dyxgbBLvIIZ68SkecTGL0QJ5L/ep4myayiuI0a5/IeA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=7hGzt4cutWk9HQVuYquuOv8AS/JhqBbPZklOWcgKRbU=;
 b=n/V5PQT/2L24rh6kK9n08ktMtzy/E83a//zRsmCN5C7zF8MFMcOBESmT9e8tuhd/y88uLzkriWhHuRQV0g4iTLMuwv+6YDkpAfeW8FsxG6GSAj7nn/wC5QG18f8QSLufddTVqbh21LoSxJwgDirmUkzmVGAzIGWC89LfQYWjXBA=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Stefano Stabellini <sstabellini@kernel.org>
CC: Michal Orzel <michal.orzel@amd.com>, Ayan Kumar Halder
	<ayan.kumar.halder@amd.com>, Xen-devel <xen-devel@lists.xenproject.org>,
	Artem Mygaiev <artem_mygaiev@epam.com>
Subject: Re: [PATCH] docs: fusa: Add requirements for generic timer
Thread-Topic: [PATCH] docs: fusa: Add requirements for generic timer
Thread-Index: AQHa8u0jnfgC5boSJE+t9AfK5MrS+7Ix0ZQAgAEsHYCAADb0AIAAiWCAgAC2X4A=
Date: Fri, 23 Aug 2024 07:22:02 +0000
Message-ID: <9DA45539-F136-40D8-BF46-E63EA1B8ADA6@arm.com>
References: <20240820103816.1661102-1-ayan.kumar.halder@amd.com>
 <5F0AF572-3437-4372-96EB-42F46B3A3155@arm.com>
 <101a7105-5638-4c69-a5b0-29c252284aea@amd.com>
 <D3358591-F9E2-44A6-A22A-FC2AA8857C68@arm.com>
 <alpine.DEB.2.22.394.2408221327400.3871186@ubuntu-linux-20-04-desktop>
In-Reply-To:
 <alpine.DEB.2.22.394.2408221327400.3871186@ubuntu-linux-20-04-desktop>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3774.600.62)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	DB9PR08MB6588:EE_|PA4PR08MB6061:EE_|AMS1EPF0000003F:EE_|AS1PR08MB7658:EE_
X-MS-Office365-Filtering-Correlation-Id: b2819b0a-1927-40d2-6cd3-08dcc344634b
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|366016|1800799024|376014|38070700018;
X-Microsoft-Antispam-Message-Info-Original:
 =?us-ascii?Q?YgoJg1ZLp/g/47rbCuzb8YfsYr4B4Q/qQzagWCN3VD+mRNpRKky4ryZlj1oA?=
 =?us-ascii?Q?ISpc+2yyqeKGJpbvEfVpVaHUNRXuMr3XP7g+sXTJrrLICZm5PvFW4NiGK2o5?=
 =?us-ascii?Q?ULqGpjSOVnJ9pBxxhXbqe1RI8ZR+aKJO77N0K0jCLEiND6XwFLei+XbGgXPH?=
 =?us-ascii?Q?GaIkinxfp9nsA7/Rk03Hy9UYENCv3TTm7sG960jvagtMspZTamNy9iITn4xp?=
 =?us-ascii?Q?/eF1O9U0d243Dn+MFDYt4urIpDNjGnNctmju8lfp83t1DWv0cZki/wfVJwjE?=
 =?us-ascii?Q?jDCaDVHOFJsioRC4oCiTMmjbk/5ZwUljs8nDGc09bVHJFXQMXaN945oO6IHi?=
 =?us-ascii?Q?lB5eGGsicT7+2bSDmbhHSsL7NSDCldkCne21G3B8UtkQkjzSplRFtFFeT4cD?=
 =?us-ascii?Q?CLLs1+TrfZqu9Mi9hBP3G65ZH6iSm07EzhbRCNxU0aG1yX6ux2dMB6u6Wu5t?=
 =?us-ascii?Q?ysVb6JWTEtmYwMOPVrCHthKqrg3vdLJ7Gd5ebceBq7S+voblQAut4LOzPbJD?=
 =?us-ascii?Q?ttStXqAebsqlHbOyz9fjv27jCj5dJHZ02Nxj8D4QglTH7XMeLp9RTkDOkhF5?=
 =?us-ascii?Q?g2EvRqHgoAKCNMATQMMCG1qOcPg34fMGj1OClhcY3uqHFjCQR6VlDgCxYle8?=
 =?us-ascii?Q?faqbXJea9oQuMfYxFDzccX83tCxWOJcoUGSMIr8dMbZTPSqsuwOI91Ej5KV5?=
 =?us-ascii?Q?wO/zHFsvH+0pY4ErGEs+bMA3x6DgjYKbaV1lqrYWy7hFOzdc57GsDEQEIHTQ?=
 =?us-ascii?Q?7VtqfNCd+2CHEUee0CVAhtbb+W/wJSNi4yxGoGjTkH5jS4hWs/6m25791o+X?=
 =?us-ascii?Q?H+kcqh+tJLjuuEugeujXUWUkYE6WahOO+j8euBLOVQB0GdXVAhv9URFiLW74?=
 =?us-ascii?Q?dJxybzKacr8w8j3lLjwpOTW+XNLecmaNtzucwBk35LfbRUKmtc/9VC5Gg4zR?=
 =?us-ascii?Q?hsnEqpZpn2LP1lpb+V2Y52bGLkA7uVCpQCahm1CNWbuIgfe/rINzMBoYN5Cl?=
 =?us-ascii?Q?cwm309ZYFHKY3dHRJVPaf6GM4ttueSjPRZh1pUpQezA8I0G1mPdaxqe6+N3T?=
 =?us-ascii?Q?kehPS2ldW9O6MwuP4g+CmtQY43uC/TECNhVo+/9y/0hY/9sZOYjjkTpq7vl4?=
 =?us-ascii?Q?Haie9F8SdthephwZeaYvGaWSzyeBxQuvNk9htMSFEfsv7Cxl9AdRYpIiWjy2?=
 =?us-ascii?Q?2KDp9q5CfeRyqvR1xSPF6NFI6yJHbkWSKbgeSfFlUG9JScG9Q5VxPCw0ebfG?=
 =?us-ascii?Q?kIgHzZP82bN7/zU34I9/qo2BveFVNGlWxG4p+r1hhoeqZidHz4DkXj9m7tJT?=
 =?us-ascii?Q?q7uvY6KaSBlkf0KIt/ZVb+EsOmCRYRUAx2+Q3zHhSNvLU0N8pjIhl2K7RHW2?=
 =?us-ascii?Q?qw2Y+Z0VDAwwwVbzpcPlwqg5Bp54eT8GhwZckNXdX0dLdRpFPA=3D=3D?=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR08MB6588.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(38070700018);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <EC717A4836AACD4FAA7F77FAB3CCBB23@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6061
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-SkipListedInternetSender:
 ip=[2603:10a6:10:25a::24];domain=DB9PR08MB6588.eurprd08.prod.outlook.com
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AMS1EPF0000003F.eurprd04.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	0f2a8627-114f-4184-7423-08dcc3444877
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|35042699022|82310400026|1800799024|36860700013|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?yDHiGi4cSOKvq8nlhL0PmEXXSfz5dFaw0PW3KtohM5gZxHARTG4eGMgezLX1?=
 =?us-ascii?Q?d5H3mtoNmLLXm7HaJxc40KEm1STO4JzVmzWH+gu6aUQKVUiWauMDDn6g86VA?=
 =?us-ascii?Q?1skpbQyd7Fit0EtyOtTINo9UhQpUALrQONdQsuV2zAnM76Gp9RulYS+nihAn?=
 =?us-ascii?Q?HNsZVt3rCCOYewvTpNwVf7TajUrlTnf/lCgAmXRXCJLsYCpzXd76seVUB9px?=
 =?us-ascii?Q?3c8X9sTEPEInLTPc64Nxk/8q+lPNJvmVT4Bf++sbYoUJ83q0NI76mt37qGaR?=
 =?us-ascii?Q?c9rfFnVm+5U/Sxen+y1MQBA7/IKu28y7ZQf+H09kSGl2vt1PJ3+csiRzIf3b?=
 =?us-ascii?Q?zVjiBN3AmpnjI93Fj2Ewhe8LpDqh/zxZlM77WsgLgB7+3TYrJrK4S+08nhBj?=
 =?us-ascii?Q?u8Ud2AV9WxoChGDgVFoDC4aeWAxj0lR9EweVmC1He8cmX1hWyFynVDvV7fSE?=
 =?us-ascii?Q?33m4SCrn42nWHZcxxhM8Kx9ZUSiYRe6fZes+2NQhMfQHWhFjjX0biIR+/Bfm?=
 =?us-ascii?Q?ZJhcAeIIO2xMa+uv4guN0O+ZnqjoACaO/XaN8CH0yLNB+Joxj7Xb1cy24V1a?=
 =?us-ascii?Q?0LvBIq5I4Ivm98OJKREgMHz/niuMWa6uo/5SllaQHd3+5XdO2polIggToorr?=
 =?us-ascii?Q?OhYW4nm68hEKd/uCpVyhINgH+XHflmwS0iS9M72Jg4vgidgzS8RoKXDtrUlN?=
 =?us-ascii?Q?VEU1XGL4H4PEyrCgeHVGdiBbrlhAbFU3YcnDQhMobvterivypdVn23xNdgqf?=
 =?us-ascii?Q?D3NgYsp288eR6txKXfEatpLUTi53FydapawC8kyA82yrAl+d9wwTJNOP5Jbr?=
 =?us-ascii?Q?5VXUAvxG9k3fAXoV83QT4RSnnyhSwYn6nNZQmEl5N7FILW4g9lDMsLg8aX6e?=
 =?us-ascii?Q?MLvJfE/ij0O2tjKGwRTgG1jGFsNyMTCx+BtFIXysJz4OX1nr1A2D41dLPS7W?=
 =?us-ascii?Q?MSZSvPok1mD+oc9jiP9lOh7nk/mman8UceY2rnua2mvav6s4P6ZulPwZ6hli?=
 =?us-ascii?Q?xO3VqzjBV77oY3rSHaaXTF5SQBdptrNcyM3kKbt8yhqqdjHsE8RWVtpO+JTJ?=
 =?us-ascii?Q?kZs6FAwuFTvPF2yeWRNa8DJfwXXaK9nfYSh835h0GlhK/SX2eVHiC+fPhYq9?=
 =?us-ascii?Q?Qjq1bwHt08ffcr7lSEXsWCFpAyWWiZev8dQpfhf5hhOSA4tSb+wMumJCzzUV?=
 =?us-ascii?Q?mIcyGOAYlm4bAON3CT6VJ3i15zUxt/BwMcuiYW2CDWr0jFJhhkajWF+VvpSC?=
 =?us-ascii?Q?aX0P/kc9KMpMxGFzCntjFhdjOV+YC50CCTQO4CrbxonO+HvWyU3zTu7DZmKb?=
 =?us-ascii?Q?qdmfxbYc96r/3xNuZ/d55oA89HrO52tkMj6KkaUwR/PJkTw9FSYqz44wE2fe?=
 =?us-ascii?Q?DWdPTTCftIYoOpNDgpOXmO0OpBIE2c2TMeUGlNyBa1kvph7+WZ04onqVXssZ?=
 =?us-ascii?Q?CT1QcDdloPH3a1MgpsXsqnXfUpXxkQ5n?=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230040)(35042699022)(82310400026)(1800799024)(36860700013)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 07:22:47.0222
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: b2819b0a-1927-40d2-6cd3-08dcc344634b
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AMS1EPF0000003F.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR08MB7658

Hi Stefano,

> On 22 Aug 2024, at 22:29, Stefano Stabellini <sstabellini@kernel.org> wro=
te:
>=20
> On Thu, 21 Aug 2024, Bertrand Marquis wrote:
>>> On 22 Aug 2024, at 11:00, Michal Orzel <michal.orzel@amd.com> wrote:
>>>=20
>>> Hi Bertrand,
>>>=20
>>> I agree with all your comments with a few exceptions, as stated below.
>>>=20
>>> On 21/08/2024 17:06, Bertrand Marquis wrote:
>>>>=20
>>>>=20
>>>> Hi Ayan,
>>>>=20
>>>>> On 20 Aug 2024, at 12:38, Ayan Kumar Halder <ayan.kumar.halder@amd.co=
m> wrote:
>>>>>=20
>>>>> From: Michal Orzel <michal.orzel@amd.com>
>>>>>=20
>>>>> Add the requirements for the use of generic timer by a domain
>>>>>=20
>>>>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>>>>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>>>>> ---
>>>>> .../reqs/design-reqs/arm64/generic-timer.rst  | 139 +++++++++++++++++=
+
>>>>> docs/fusa/reqs/index.rst                      |   3 +
>>>>> docs/fusa/reqs/intro.rst                      |   3 +-
>>>>> docs/fusa/reqs/market-reqs/reqs.rst           |  34 +++++
>>>>> docs/fusa/reqs/product-reqs/arm64/reqs.rst    |  24 +++
>>>>> 5 files changed, 202 insertions(+), 1 deletion(-)
>>>>> create mode 100644 docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
>>>>> create mode 100644 docs/fusa/reqs/market-reqs/reqs.rst
>>>>> create mode 100644 docs/fusa/reqs/product-reqs/arm64/reqs.rst
>>>>>=20
>>>>> diff --git a/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst b/doc=
s/fusa/reqs/design-reqs/arm64/generic-timer.rst
>>>>> new file mode 100644
>>>>> index 0000000000..bdd4fbf696
>>>>> --- /dev/null
>>>>> +++ b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
>>>>> @@ -0,0 +1,139 @@
>>>>> +.. SPDX-License-Identifier: CC-BY-4.0
>>>>> +
>>>>> +Generic Timer
>>>>> +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>>>>> +
>>>>> +The following are the requirements related to ARM Generic Timer [1] =
interface
>>>>> +exposed by Xen to Arm64 domains.
>>>>> +
>>>>> +Probe the Generic Timer device tree node from a domain
>>>>> +------------------------------------------------------
>>>>> +
>>>>> +`XenSwdgn~arm64_generic_timer_probe_dt~1`
>>>>> +
>>>>> +Description:
>>>>> +Xen shall generate a device tree node for the Generic Timer (in acco=
rdance to
>>>>> +ARM architected timer device tree binding [2]).
>>>>=20
>>>> You might want to say where here. The domain device tree ?
>>>>=20
>>>>> +
>>>>> +Rationale:
>>>>> +
>>>>> +Comments:
>>>>> +Domains shall probe the Generic Timer device tree node.
>>>>=20
>>>> Please prevent the use of "shall" here. I would use "can".
>>>> Also detect the presence of might be better than probe.
>>>>=20
>>>>> +
>>>>> +Covers:
>>>>> + - `XenProd~emulated_timer~1`
>>>>> +
>>>>> +Read system counter frequency
>>>>> +-----------------------------
>>>>> +
>>>>> +`XenSwdgn~arm64_generic_timer_read_freq~1`
>>>>> +
>>>>> +Description:
>>>>> +Xen shall expose the frequency of the system counter to the domains.
>>>>=20
>>>> The requirement would need to say in CNTFRQ_EL0 and in the domain devi=
ce tree xxx entry.
>>>>=20
>>>>> +
>>>>> +Rationale:
>>>>> +
>>>>> +Comments:
>>>>> +Domains shall read it via CNTFRQ_EL0 register or "clock-frequency" d=
evice tree
>>>>> +property.
>>>>=20
>>>> I do not think this comment is needed.
>>>>=20
>>>>> +
>>>>> +Covers:
>>>>> + - `XenProd~emulated_timer~1`
>>>>> +
>>>>> +Access CNTKCTL_EL1 system register from a domain
>>>>> +------------------------------------------------
>>>>> +
>>>>> +`XenSwdgn~arm64_generic_timer_access_cntkctlel1~1`
>>>>> +
>>>>> +Description:
>>>>> +Xen shall expose counter-timer kernel control register to the domain=
s.
>>>>=20
>>>> "counter-timer kernel" is a bit odd here, is it the name from arm arm =
?
>>>> Generic Timer control registers ? or directly the register name.
>>> This is the name from Arm ARM. See e.g.:
>>> https://developer.arm.com/documentation/ddi0601/2023-12/AArch64-Registe=
rs/CNTKCTL-EL1--Counter-timer-Kernel-Control-Register?lang=3Den
>>=20
>> Right then i would use the same upper cases: Counter-timer Kernel Contro=
l
>> register and still mention CNTKCTL_EL1 as it would be clearer.
>>=20
>>>=20
>>>>=20
>>>>> +
>>>>> +Rationale:
>>>>> +
>>>>> +Comments:
>>>>> +Domains shall access the counter-timer kernel control register to al=
low
>>>>> +controlling the access to the timer from userspace (EL0).
>>>>=20
>>>> This is documented in the arm arm, this comment is not needed.
>>>>=20
>>>>> +
>>>>> +Covers:
>>>>> + - `XenProd~emulated_timer~1`
>>>>> +
>>>>> +Access virtual timer from a domain
>>>>> +----------------------------------
>>>>> +
>>>>> +`XenSwdgn~arm64_generic_timer_access_virtual_timer~1`
>>>>> +
>>>>> +Description:
>>>>> +Xen shall expose the virtual timer registers to the domains.
>>>>> +
>>>>> +Rationale:
>>>>> +
>>>>> +Comments:
>>>>> +Domains shall access and make use of the virtual timer by accessing =
the
>>>>> +following system registers:
>>>>> +CNTVCT_EL0,
>>>>> +CNTV_CTL_EL0,
>>>>> +CNTV_CVAL_EL0,
>>>>> +CNTV_TVAL_EL0.
>>>>=20
>>>> The requirement to be complete should give this list, not the comment.
>>>>=20
>>>>> +
>>>>> +Covers:
>>>>> + - `XenProd~emulated_timer~1`
>>>>> +
>>>>> +Access physical timer from a domain
>>>>> +-----------------------------------
>>>>> +
>>>>> +`XenSwdgn~arm64_generic_timer_access_physical_timer~1`
>>>>> +
>>>>> +Description:
>>>>> +Xen shall expose physical timer registers to the domains.
>>>>> +
>>>>> +Rationale:
>>>>> +
>>>>> +Comments:
>>>>> +Domains shall access and make use of the physical timer by accessing=
 the
>>>>> +following system registers:
>>>>> +CNTPCT_EL0,
>>>>> +CNTP_CTL_EL0,
>>>>> +CNTP_CVAL_EL0,
>>>>> +CNTP_TVAL_EL0.
>>>>=20
>>>> same as upper
>>>>=20
>>>>> +
>>>>> +Covers:
>>>>> + - `XenProd~emulated_timer~1`
>>>>> +
>>>>> +Trigger the virtual timer interrupt from a domain
>>>>> +-------------------------------------------------
>>>>> +
>>>>> +`XenSwdgn~arm64_generic_timer_trigger_virtual_interrupt~1`
>>>>> +
>>>>> +Description:
>>>>> +Xen shall enable the domains to program the virtual timer to generat=
e the
>>>>> +interrupt.
>>>>=20
>>>> I am not sure this is right here.
>>>> You gave access to the registers upper so Xen responsibility is not re=
ally to
>>>> enable anything but rather make sure that it generates an interrupt ac=
cording to
>>>> how the registers have been programmed.
>>> I'm in two minds about it. On one hand you're right and the IRQ trigger=
 is a side-effect
>>> of programming the registers correctly. On the other, these are design =
requirements which
>>> according to "fusa/reqs/intro.rst" describe what SW implementation is d=
oing. Our way of injecting
>>> timer IRQs into guests is a bit different (phys timer is fully emulated=
 and we use internal timers
>>> and for virt timer we first route IRQ to Xen, mask the IRQ and inject t=
o guest). If I were to write
>>> tests to cover Generic Timer requirements I'd expect to cover whether r=
.g. masking/unmasking IRQ works,
>>> whether IRQ was received, etc.
>>=20
>> This is true but i think it would be more logic in non design requiremen=
ts to
>> phrase things to explain the domain point of view rather than how it is =
implemented.
>>=20
>> Here the point is to have a timer fully functional from guest point of v=
iew, including
>> getting interrupts when the timer should generate one.
>>=20
>> Maybe something like: Xen shall generate timer interrupts to domains whe=
n the timer condition asserts.
>=20
> Both statements are correct.
>=20
> Michal's original statement "Xen shall enable the domains to program the
> virtual timer to generate the interrupt" is correct. The timer interrupt
> will be generated by the hardware to Xen, if the guest programs the
> registers correctly. If Xen does nothing, the interrupt is still
> generated and received by Xen.
>=20
> Bertrand's statement is also correct. Xen needs to generate a virtual
> timer interrupt equivalent to the physical timer interrupt, after
> receiving the physical interrupt.
>=20
> I think the best statement would be a mix of the two, something like:
>=20
> Xen shall enable the domain to program the virtual timer to generate
> the interrupt, which Xen shall inject as virtual interrupt into the
> domain.

This should be split into 2 reqs (2 shall) and the second one might in
fact be a generic one for interrupt injections into guests.

Cheers
Bertrand

>=20
>=20
> That said, I also think that any one of these three statements is good
> enough.



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 08:25:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 08:25:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782195.1191675 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shPbF-00032x-DY; Fri, 23 Aug 2024 08:24:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782195.1191675; Fri, 23 Aug 2024 08:24:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shPbF-00032q-9B; Fri, 23 Aug 2024 08:24:49 +0000
Received: by outflank-mailman (input) for mailman id 782195;
 Fri, 23 Aug 2024 08:24:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shPbE-00032g-0w; Fri, 23 Aug 2024 08:24:48 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shPbD-0002Ig-VX; Fri, 23 Aug 2024 08:24:48 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shPbD-0004cK-Bb; Fri, 23 Aug 2024 08:24:47 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shPbD-0006mE-BI; Fri, 23 Aug 2024 08:24:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=sVXSpA2VpXQ/Nlukh2sQu09amwOCIKZ/aloYs4lmtas=; b=j9NvGwZYh6lBKPbIBOuJn/nusO
	rZcHYtHF3s3qv7DKGh1Truv96aboPzwFoLMOxCc3oGFAd8wOK+N1svsy5hNU6ELZ5bSuGRPzgvEac
	2qEEUS3M+BohhZYMfigLjYhvP4Aqn17KVhVepY2yAcntJf6FOlbeyUcTm2t+LVfF6aso=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187312-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187312: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=6d41a9d8a12ff89adabdc286e63e9391a0481699
X-Osstest-Versions-That:
    xen=a30d438ce58b70c5955f5d37f776086ab8f88623
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 23 Aug 2024 08:24:47 +0000

flight 187312 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187312/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187306
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187306
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187306
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187306
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187306
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187306
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  6d41a9d8a12ff89adabdc286e63e9391a0481699
baseline version:
 xen                  a30d438ce58b70c5955f5d37f776086ab8f88623

Last test of basis   187306  2024-08-22 01:54:22 Z    1 days
Testing same since   187312  2024-08-22 12:08:57 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   a30d438ce5..6d41a9d8a1  6d41a9d8a12ff89adabdc286e63e9391a0481699 -> master


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 08:25:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 08:25:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782203.1191683 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shPbr-0003WR-Ks; Fri, 23 Aug 2024 08:25:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782203.1191683; Fri, 23 Aug 2024 08:25:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shPbr-0003WK-IE; Fri, 23 Aug 2024 08:25:27 +0000
Received: by outflank-mailman (input) for mailman id 782203;
 Fri, 23 Aug 2024 08:25:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shPbq-0003SX-9A
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 08:25:26 +0000
Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com
 [2607:f8b0:4864:20::734])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3efb4d17-6129-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 10:25:25 +0200 (CEST)
Received: by mail-qk1-x734.google.com with SMTP id
 af79cd13be357-7a1da7cafccso98683285a.3
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 01:25:25 -0700 (PDT)
Received: from [192.168.1.10] (host-92-26-98-202.as13285.net. [92.26.98.202])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a67f3bb329sm153564185a.78.2024.08.23.01.25.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 23 Aug 2024 01:25:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3efb4d17-6129-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724401524; x=1725006324; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=q/p5UbZumGq1JrXX8ufF1SopGMx3J1faHSWKhX5WLoQ=;
        b=odIZ8TBXcoZplr8hLsmtrXLKNCqPVXzBB49Pznq4TH9w0G3VWVgK1aHD89npIHfzAi
         5kc83aZkutwZRbHvSaTOXcpUfdzUakk0A5/KRCHICojVKXzkmGRYpP/CrhOUUg0Oclom
         gNaWgZVuYsAeeg2zkTu9LUeqeqPpmy8KyW/s4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724401524; x=1725006324;
        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=q/p5UbZumGq1JrXX8ufF1SopGMx3J1faHSWKhX5WLoQ=;
        b=pCA7HXWTOW/RNY5nWSgo6FWenc6yL2lsvXwZCG6VoiXv1OUvw6DUzhepvO0sECFy+d
         2MYi3eu2LnYE912aEwtoUAA0cnl002J+1SLdplZVmlGncMhpeYw5gDSIchf9Z2XZm2db
         NMrsmhfwKf3yvgE4JHB+awcG4pBcIeJUC+UtK1znY6n0daTGwBMqBy5+A0xTszGxGlf6
         Rre9+4GO+qQ88w3vzj+F0EgNm8CEEKgABNBxNhqwKHVLCiiXrPD+k+sfth3Qf5GzX80/
         uq68sGyz1zFOrley63FMQZvw0SdCnJ9fDh/bGos3Kd9MjAjaldGm8OjMVH/ZoasRxlCY
         91/g==
X-Forwarded-Encrypted: i=1; AJvYcCWUOFMpP/rZZiFnlV1uGpH40JW9DagWfMPZrJCVlD8uiXIVbgyEWMX22A0xG0R3kuoIlkPOIEP5NF8=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy1Uph8LgNE1jb9FObb8ouDTDdbFLPQ1C0pvNJFqdeR0RajS+Q3
	lZm3EL7wez5V+a4vFlo7EdmIOEMBU0DQ34LmqAC+6O0n4tJqZi4ptVklNH1QLDE=
X-Google-Smtp-Source: AGHT+IFioTQgmgdZRFJiz3WPx86yO2T9XVwcXz2LivYSqjm6/F3tu/PCEASkDVnskCxy+SDb1BeRhg==
X-Received: by 2002:a05:620a:3181:b0:7a1:e20c:186e with SMTP id af79cd13be357-7a689700b1emr161906285a.15.1724401524142;
        Fri, 23 Aug 2024 01:25:24 -0700 (PDT)
Message-ID: <668800f2-409a-43fb-9bdc-23ce693cedcd@citrix.com>
Date: Fri, 23 Aug 2024 09:25:21 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: drop and avoid use of BUG()
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <d14e4ffc-d07b-4a60-8949-ecdcea86cd77@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <d14e4ffc-d07b-4a60-8949-ecdcea86cd77@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 23/08/2024 8:16 am, Jan Beulich wrote:
> Generally it is not a good idea to use BUG() in emulator code. Even for
> internal flaws we're better off returning errors to callers, rather than
> crashing the system. Replace the sole remaining use and remove the
> test / fuzzing harness surrogate. Put in place a declaration pleasing
> the compiler when finding uses in Xen headers, while at the same time
> breaking the build (at linking time) in case an active reference would
> newly appear.
>
> Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 09:34:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 09:34:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782217.1191693 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shQgN-0006hj-CL; Fri, 23 Aug 2024 09:34:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782217.1191693; Fri, 23 Aug 2024 09:34:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shQgN-0006hc-9r; Fri, 23 Aug 2024 09:34:11 +0000
Received: by outflank-mailman (input) for mailman id 782217;
 Fri, 23 Aug 2024 09:34:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shQgM-0006hW-AW
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 09:34:10 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d8d69193-6132-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 11:34:08 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a8684c31c60so225106866b.3
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 02:34:08 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f48a5d0sm232751866b.159.2024.08.23.02.34.06
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 23 Aug 2024 02:34:07 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d8d69193-6132-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724405648; x=1725010448; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:subject:from:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=2uvmszkIkUKTYN+Fk0dr+kTtQ12mzMtCsXW/XctRIbY=;
        b=vkW9ubTT0yHl31BcGku+8uDxZ/J5wpEzW1oYQptRTXDMi8vfKCHWHIY1tJ5pTYkcbC
         2A7oUFtvc3Qmkb8o61y44yCtl/a8bGbWEei+JmfAY5pShD+QJNYXS26CGHnefxi9Uz8G
         I2r7T2U+EgXU9ZzQZIKNpidKUjkkzjuHgnk2k=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724405648; x=1725010448;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:subject:from:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=2uvmszkIkUKTYN+Fk0dr+kTtQ12mzMtCsXW/XctRIbY=;
        b=XAIWlqEuFZgztv5ST3nUqaOYliEsQmnmWvAsitck7gPv5oatqMuMUx0B9LHIndXLS8
         pWqkZbswCJzFkgfUX2mxuVtS1FBnhTQTkiN2TcQMEfCPo77jRfPNWYz798h1orguzBRz
         sr8PbdpeU3djPe4sNiu1XYcIx/MAGwgMpM2mfWjUh6bNanzPi1fwamC8WydpdZuLBwyy
         HtuIccisw7ww3I97PYh1nmloVhA+HFrrtGCU5HVbljy/TJHXR3UG+vm2TZ4L4BGNBxas
         oBHuUME79Z1iF2dQMPpPtVbT1u3vEHZDEYZ+VA/3+a6OIpfjy+zXkt4iK3q0oz321nG7
         DOAA==
X-Forwarded-Encrypted: i=1; AJvYcCVRN8G6mqTUBJgOJAK8W8pVeX//dy5zNCH+8h7NDFB83DtA3ZUrLWvyIdP8uGzDN5p63o2Z8aDsIJM=@lists.xenproject.org
X-Gm-Message-State: AOJu0Ywdz8o/kjSc2JJhGKfMjDZFs+OSgTGvYXBvAixMHN6VhLHAx/Jn
	WoBbniZwmSN87gb7YyFjlxk3BXOOANOTiwRV3A2pAcOAn4fKBVdFZb5SsW75d8M=
X-Google-Smtp-Source: AGHT+IH3s0hBQA+c8tD2t0TG69Ui1NzDgwqlFACuhnU7yFFFalbkzV8EOaN7oIoZSf0pjiddsN85JQ==
X-Received: by 2002:a17:907:3f9c:b0:a86:a2b6:fc42 with SMTP id a640c23a62f3a-a86a52b643dmr86520466b.24.1724405647659;
        Fri, 23 Aug 2024 02:34:07 -0700 (PDT)
Message-ID: <925ae2fb-6f6f-4825-8469-c410b7bb89fc@citrix.com>
Date: Fri, 23 Aug 2024 10:34:05 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [XEN PATCH v1] libxl: Fix nul-termination of the return value of
 libxl_xen_console_read_line()
To: Javi Merino <javi.merino@cloud.com>, xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Juergen Gross <jgross@suse.com>, =?UTF-8?B?RWR3aW4gVMO2csO2aw==?=
 <edwin.torok@cloud.com>
References: <ad7c89bbae34155566ae7c9ca2cb501f21c7d585.1724330921.git.javi.merino@cloud.com>
Content-Language: en-GB
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <ad7c89bbae34155566ae7c9ca2cb501f21c7d585.1724330921.git.javi.merino@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 22/08/2024 2:13 pm, Javi Merino wrote:
> When built with ASAN, "xl dmesg" crashes in the "printf("%s", line)"
> call in main_dmesg().  ASAN reports a heap buffer overflow: an
> off-by-one access to cr->buffer.
>
> The readconsole sysctl copies up to count characters into the buffer,
> but it does not add a null character at the end.  Despite the
> documentation of libxl_xen_console_read_line(), line_r is not
> nul-terminated if 16384 characters were copied to the buffer.
>
> Fix this by making count one less that the size of the allocated
> buffer so that the last byte is always null.
>
> Reported-by: Edwin Török <edwin.torok@cloud.com>
> Signed-off-by: Javi Merino <javi.merino@cloud.com>
> ---
>  tools/libs/light/libxl_console.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/libs/light/libxl_console.c b/tools/libs/light/libxl_console.c
> index a563c9d3c7f9..fa28e2139453 100644
> --- a/tools/libs/light/libxl_console.c
> +++ b/tools/libs/light/libxl_console.c
> @@ -779,7 +779,7 @@ libxl_xen_console_reader *
>      cr = libxl__zalloc(NOGC, sizeof(libxl_xen_console_reader));
>      cr->buffer = libxl__zalloc(NOGC, size);
>      cr->size = size;
> -    cr->count = size;
> +    cr->count = size - 1;
>      cr->clear = clear;
>      cr->incremental = 1;
>  

This looks like it will fix the ASAN issue, but I think a better fix
would be:

-        printf("%s", line);
+       printf("%.*s", cr->count, line);

because otherwise there's a world of sharp corners once Xen has wrapped
the buffer for the first time.


Which brings us a lot of other WTFs in this code...

First, libxl_console.c describes it's functionality in terms of lines,
and line_reader() in the API.  Yet it's not lines, it's a 16k buffer
with generally multi-line content.  It's too late to fix the naming, but
we could at least rewrite the comments not to be blatant lies.


Just out of context above the hunk is:

    unsigned int size = 16384;

which isn't accurate.  The size of Xen's console ring can be changed at
compile time (like XenServer does), and/or by command line variable.

Because the dmesg ring is never full (it just keeps producing and
overwriting tail data), it's impossible to get a clean copy except in a
single hypercall; the incremental/offset parameters are an illusion, and
do not function correctly if a new printk() has occurred between
adjacent hypercalls.

And that is why setting count to size - 1 probably isn't wise.  It means
that, even in the ideal case where Xen's ringbuffer is 16k, you've still
got to make 2 hypercalls to get the content.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 10:14:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 10:14:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782230.1191704 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shRJW-0005G0-EQ; Fri, 23 Aug 2024 10:14:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782230.1191704; Fri, 23 Aug 2024 10:14:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shRJW-0005Ft-Ba; Fri, 23 Aug 2024 10:14:38 +0000
Received: by outflank-mailman (input) for mailman id 782230;
 Fri, 23 Aug 2024 10:14:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=l2sR=PW=bounce.vates.tech=bounce-md_30504962.66c86108.v1-bc3f4735558f49418844320d71e9bfdd@srs-se1.protection.inumbo.net>)
 id 1shRJU-0005Fn-1d
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 10:14:36 +0000
Received: from mail137-25.atl71.mandrillapp.com
 (mail137-25.atl71.mandrillapp.com [198.2.137.25])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7e41150e-6138-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 12:14:34 +0200 (CEST)
Received: from pmta07.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail137-25.atl71.mandrillapp.com (Mailchimp) with ESMTP id
 4Wqwsh55c4z35hTnh
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 10:14:32 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 bc3f4735558f49418844320d71e9bfdd; Fri, 23 Aug 2024 10:14:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7e41150e-6138-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724408072; x=1724668572;
	bh=9CdPXHQwe6XS75VaZtG5OP1VzkMzlV8ORdgt+V3o85Q=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=SHEBQN3aCJFMhDd884j/bzNs22BP/5Aq/2UojlCLgImKicTEVhGiKwCGCDii+JP3F
	 NPIdz9SOWvejrHcKxNPxd/xbNLllI4YQAnEI0AGKvBW/Qpm7bcup7Wr5urHIXVea5v
	 8f8TJsbUn5WQ15M/0UZ0w50thLFsWJZziUSN4AZf5ticpTg4q3AtC6ge6c/YIzeFpN
	 I4XAROXABDNk5HzEkKYhISsdmM767s5jU+V5Dq9g+P/DVFmXVGwa2AMp9Zaq4NDClc
	 KZY6xgbrw6Ki4zF+9XOtNnKO6UDwOL59DS6X01cUJiHbq/MQOwC//hOF/2jk/XcoEQ
	 q+hxzWoyXYqMA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724408072; x=1724668572; i=anthony.perard@vates.tech;
	bh=9CdPXHQwe6XS75VaZtG5OP1VzkMzlV8ORdgt+V3o85Q=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=xzYHO7eyZIrsuVi1MLUBH3m0jbvEt+GlgtMjAtoUWpowLy2Lt8enlFltqWL+WYPrN
	 tpkwChN3JLAUdzFGpm/7HsXowPcXsojLtXw/ObPwgWcTAxL+E/oB9eCDLP0oEIP9OC
	 guY0FzHZJkjrodQHJYf62W41FOKT/G1QaYdJeCBUegPVItOClmVO1E5vnyHVXsllNQ
	 ZosUK091ujTnYm6FGaG8tKjj2O7Z4qiLVpfgHC5ZdaRMw1UeLzI6Y5fEFMvV3eNSpA
	 KKDidr3QJF4ZQYPlrQrIm13fBaxfMlbvYMUe0F6ndfivUa9YKAe/YPjCmpL7+ZwT7l
	 40C16PElvqe8Q==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[XEN=20PATCH=20v1]=20libxl:=20Fix=20nul-termination=20of=20the=20return=20value=20of=20libxl=5Fxen=5Fconsole=5Fread=5Fline()?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724408070798
To: Jan Beulich <jbeulich@suse.com>, Javi Merino <javi.merino@cloud.com>
Cc: Juergen Gross <jgross@suse.com>, =?utf-8?Q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@cloud.com>, xen-devel@lists.xenproject.org
Message-Id: <ZshhBoWZZVGZLUv+@l14>
References: <ad7c89bbae34155566ae7c9ca2cb501f21c7d585.1724330921.git.javi.merino@cloud.com> <7b575ad5-c7c6-4054-8036-9d2961630d42@suse.com>
In-Reply-To: <7b575ad5-c7c6-4054-8036-9d2961630d42@suse.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.bc3f4735558f49418844320d71e9bfdd?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240823:md
Date: Fri, 23 Aug 2024 10:14:32 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Fri, Aug 23, 2024 at 08:31:50AM +0200, Jan Beulich wrote:
> On 22.08.2024 15:13, Javi Merino wrote:
> > When built with ASAN, "xl dmesg" crashes in the "printf("%s", line)"
> > call in main_dmesg().  ASAN reports a heap buffer overflow: an
> > off-by-one access to cr->buffer.
> > 
> > The readconsole sysctl copies up to count characters into the buffer,
> > but it does not add a null character at the end.  Despite the
> > documentation of libxl_xen_console_read_line(), line_r is not
> > nul-terminated if 16384 characters were copied to the buffer.
> > 
> > Fix this by making count one less that the size of the allocated
> > buffer so that the last byte is always null.
> > 
> > Reported-by: Edwin T=C3=B6r=C3=B6k <edwin.torok@cloud.com>
> > Signed-off-by: Javi Merino <javi.merino@cloud.com>
> 
> Perhaps wants a Fixes: tag as well?

Seems to be:
Fixes: 4024bae739cc ("xl: Add subcommand 'xl dmesg'")

> > --- a/tools/libs/light/libxl_console.c
> > +++ b/tools/libs/light/libxl_console.c
> > @@ -779,7 +779,7 @@ libxl_xen_console_reader *
> >      cr =3D libxl__zalloc(NOGC, sizeof(libxl_xen_console_reader));
> >      cr->buffer =3D libxl__zalloc(NOGC, size);
> >      cr->size =3D size;
> > -    cr->count =3D size;
> > +    cr->count =3D size - 1;
> >      cr->clear =3D clear;
> >      cr->incremental =3D 1;
> 
> While this looks to be addressing the issue at hand, I still wonder: Why
> does the "count" field exist at all? It's certainly odd to be set right
> here (when the buffer actually is empty). It's used solely in
> libxl_xen_console_read_line(), so could be a local variable there.

It isn't only odd to have "count" field, it is also used the wrong way.
Once "cr->count" is set to 0, the next call to
libxl_xen_console_read_line() will simply return an empty NULL, even if
in the mean time more data is available to read from the string.
Also, if the last call to libxl_xen_console_read_line() was shorter than
the buffer size, none of the following call will use the full size of
the buffer. This isn't really a problem for `xl dmesg`, but could be if
we want to implement "--follow" option for example.

So Javi, could you remove that `cr->count` field and use a local
variable instead?

And a comment in the code might be useful about why there's a "-1".

But I think a better way to address the issue would be to actually set
'\0' at the end of the string after the call to xc_readconsolering(),
and remove the not very useful memset(0). That way, it will be more
explicite as to why we need "-1".

> Then, further, I wonder why struct libxl__xen_console_reader lives in
> libxl_internal.h - it's used solely in libxl_console.c.

History? It actually use to live in libxl.h, 14 yr ago.

> Finally - why libxl__zalloc() when libxl_xen_console_read_line() clears
> the buffer anyway?

Overuse of libxl__zalloc when it was use to replace the open coding that
was used to allocate "cr". While it doesn't seems necessary, I don't
think it hurt to keep it there.

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 10:40:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 10:40:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782239.1191714 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shRhm-00018R-BN; Fri, 23 Aug 2024 10:39:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782239.1191714; Fri, 23 Aug 2024 10:39:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shRhm-00018K-7e; Fri, 23 Aug 2024 10:39:42 +0000
Received: by outflank-mailman (input) for mailman id 782239;
 Fri, 23 Aug 2024 10:39:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=14XH=PW=bounce.vates.tech=bounce-md_30504962.66c866e9.v1-d5591c3b5829461f81b563062813c14b@srs-se1.protection.inumbo.net>)
 id 1shRhk-00018E-Qj
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 10:39:41 +0000
Received: from mail187-32.suw11.mandrillapp.com
 (mail187-32.suw11.mandrillapp.com [198.2.187.32])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fecb66df-613b-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 12:39:38 +0200 (CEST)
Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail187-32.suw11.mandrillapp.com (Mailchimp) with ESMTP id
 4WqxQd0gLXzQXg29B
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 10:39:37 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 d5591c3b5829461f81b563062813c14b; Fri, 23 Aug 2024 10:39:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fecb66df-613b-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724409577; x=1724670077;
	bh=KHLj4zwjzY7dFtptBAA1CaW5882kGzNBdatfO/2AdZU=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=Bd34UoxFuy8qDOwJFkEkN6a4solZFgMCsy0RpZAasc9irlXwZxILv8MQBzQBww1hF
	 oiIo2XMvm9UpoJI/t/ty4QdSTkugoTEjIe9V5Eou0+qz3LhNFsbpSf7WncJqEWS8AP
	 38iMDIvrMmiQSdqzEGk4VE/Op7luAMlfik+P0rmkzGvA2sgtRBbwCcv3k0tATdCeEl
	 7cikeTLpOxgWdYi0SETODWCzIXFm8Q8Rd+yU7mVjjARPje5mOS/aVuGWqfnVQkiA3o
	 bfyja/mm+6g5jJt1epy0du1LxdbV2mSjznmZRqNAh0fbtGS9hXIMq7MtVc6JFKUn37
	 cgSk+FjUUM5cA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724409577; x=1724670077; i=anthony.perard@vates.tech;
	bh=KHLj4zwjzY7dFtptBAA1CaW5882kGzNBdatfO/2AdZU=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=HfMjx8nMk5M0EsSGPQMVoGsH2xeDyJoecgkEFFHXqa0i+FcMeHO+NuBRz1FUfvLqL
	 6WuGN5bxbc5zQv/4woRti2FbRx8fLlC15dKzaVfurc2/UWwGnfaox0c6e02TkYcsT9
	 Qj3YYEZG5MiXUl8ZT+gkoWCBzf2yRzeGrhFQZKVaDxtVuRZY9E+5WEiGKae/VP7p2s
	 5B8QY1oMS5ol1tLj03zyJ63TwQSakvb8l8IPSvH5zJ0xMZKrQoPILfW8wyI6kPHYmR
	 mqwaUhvwewh+A2muGwyoC0N05ossoMxMxdRUkPPCEKfAJsqJPHplgOtCY0T1L0a67Z
	 zE/am3m1FGAjQ==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[XEN=20PATCH=20v1]=20libxl:=20Fix=20nul-termination=20of=20the=20return=20value=20of=20libxl=5Fxen=5Fconsole=5Fread=5Fline()?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724409575990
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Javi Merino <javi.merino@cloud.com>, xen-devel@lists.xenproject.org, Juergen Gross <jgross@suse.com>, =?utf-8?Q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@cloud.com>
Message-Id: <Zshm5xxhW06u8nF6@l14>
References: <ad7c89bbae34155566ae7c9ca2cb501f21c7d585.1724330921.git.javi.merino@cloud.com> <925ae2fb-6f6f-4825-8469-c410b7bb89fc@citrix.com>
In-Reply-To: <925ae2fb-6f6f-4825-8469-c410b7bb89fc@citrix.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.d5591c3b5829461f81b563062813c14b?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240823:md
Date: Fri, 23 Aug 2024 10:39:37 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Fri, Aug 23, 2024 at 10:34:05AM +0100, Andrew Cooper wrote:
> On 22/08/2024 2:13 pm, Javi Merino wrote:
> This looks like it will fix the ASAN issue, but I think a better fix
> would be:
> 
> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printf("%s", line);
> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printf("%.*s", cr->count, line);

nul-terminated string are safer to manipulate, and cr->count isn't
available outside of libxl, so that's a no go.

> because otherwise there's a world of sharp corners once Xen has wrapped
> the buffer for the first time.

If wrapped buffer are visible to libxl or `xl dmesg`, that a bug in xen,
in XEN_SYSCTL_readconsole. It doesn't looks like it's possible to know
when the console ring buffer wrapped.

> 
> Which brings us a lot of other WTFs in this code...
> 
> First, libxl_console.c describes it's functionality in terms of lines,
> and line_reader() in the API.=C2=A0 Yet it's not lines, it's a 16k buffer
> with generally multi-line content.=C2=A0 It's too late to fix the naming,=
 but
> we could at least rewrite the comments not to be blatant lies.
> 
> 
> Just out of context above the hunk is:
> 
> =C2=A0=C2=A0=C2=A0 unsigned int size =3D 16384;
> 
> which isn't accurate.=C2=A0 The size of Xen's console ring can be changed=
 at
> compile time (like XenServer does), and/or by command line variable.

This buffer size isn't link to Xen's console ring size, both value don't
need to match.

> Because the dmesg ring is never full (it just keeps producing and
> overwriting tail data), it's impossible to get a clean copy except in a
> single hypercall; the incremental/offset parameters are an illusion, and
> do not function correctly if a new printk() has occurred between
> adjacent hypercalls.

Well, let's hope there's no more that "ring_size - size" is been written
to the ring in between two hypercall. There's doesn't seems to be
anything that can be done to work around this with this hypercall
(beside using a huge buffer size).

I think xenconsoled can read the console ring buffer, but does so
continuously, so if `xl dmesg` have some shortcoming, it might be fine.

> And that is why setting count to size - 1 probably isn't wise.=C2=A0 It m=
eans
> that, even in the ideal case where Xen's ringbuffer is 16k, you've still
> got to make 2 hypercalls to get the content.

Well, I've run `xl dmesg` on one machine, it seems to have taken 9
hypercall to get everything, and there's still the first few line of the
boot available. So if the ringbuffer was indeed 16k, it would not be
ideal at all... as lots of stuff would have been overwritten.

Cheers,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 10:52:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 10:52:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782253.1191754 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shRtp-0004v7-3Y; Fri, 23 Aug 2024 10:52:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782253.1191754; Fri, 23 Aug 2024 10:52:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shRto-0004v0-Vx; Fri, 23 Aug 2024 10:52:08 +0000
Received: by outflank-mailman (input) for mailman id 782253;
 Fri, 23 Aug 2024 10:52:08 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shRto-0004C8-2B
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 10:52:08 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bd18eb0d-613d-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 12:52:06 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-53349ee42a9so2238683e87.3
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 03:52:06 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f47d1c3sm239923866b.169.2024.08.23.03.52.03
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 23 Aug 2024 03:52:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bd18eb0d-613d-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724410325; x=1725015125; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=uOO1eSHIi4Cp4U+gzj0SV1mncIJwBvzbwJEtLZVYyyo=;
        b=LXqrBm9jc3iTF4uWJ2V/OtooWfFilQ9V0Gvd+6roQs+EVErcWvgJH+v3ylTHkNWtc5
         9FXVfzycbKDgQnlKJra+YTb5vEXRm0Fg90umkb/BXw0ZLw2vPw3klzNIF6gW6hJfJm4r
         AjNGJw+mns0RZblHQFb5b7a9vsvgOmTK307VQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724410325; x=1725015125;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=uOO1eSHIi4Cp4U+gzj0SV1mncIJwBvzbwJEtLZVYyyo=;
        b=FZag2Fk1NsanwK3sFFrkkd6aYpdAfeOQ7ZY5Q+POAYPhWyK/zRqMy/eFaj9RFppzyZ
         2j33hbiXFuMfpnsttbnkRm83drlJIr+7FGOzKlF1yVTo5bjJ1qrYAILJ5yqP3sSpaCEP
         XUlv+rBI8TqvEt9DjZOHPfnNqR4sSHdv/D641MfAXZVsV02YLoEUV+0oXxKLkgVi+Ox9
         E8zKYJ+4CeLsH0MWL/rlaIndn+PBGiSA4+4vZwr/I9dVaezbpqqzZ66P8sOAwDymw5HC
         f2xY2GFQkIIOdmZBI1eENXd9UHgbk6bw4wHiKcrJ8lgHPMeveSE9sxMgWxsqQ2Fr6uf1
         47JA==
X-Gm-Message-State: AOJu0Yx/Un3a+cy8icUFztwDyKGlCsu3ADLKtvqVz7qEzUzyCWqkBbN+
	0JoeyiiC5Ye2emd3HacqKF1x0pAzqEewkb3dFbh45u9x/9UbZ71t2nTHVoJZ/dDvsH+l7xvHRXx
	3
X-Google-Smtp-Source: AGHT+IEm3ot/zVxHC2E2B3CkRESeaW8QA/4ox9ba7+IvF9XuWYo+sm2A4tYv/MY/idy8qxh+1UeJcw==
X-Received: by 2002:a05:6512:6cf:b0:52f:413:7e8c with SMTP id 2adb3069b0e04-5343877870fmr1472471e87.14.1724410325081;
        Fri, 23 Aug 2024 03:52:05 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Christian Lindig <christian.lindig@citrix.com>,
	David Scott <dave@recoil.org>,
	=?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@cloud.com>,
	Rob Hoes <Rob.Hoes@citrix.com>,
	Andrii Sultanov <andrii.sultanov@cloud.com>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH 3/3] tools/ocaml: Fix the version embedded in META files
Date: Fri, 23 Aug 2024 11:51:57 +0100
Message-Id: <20240823105157.991275-4-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240823105157.991275-1-andrew.cooper3@citrix.com>
References: <20240823105157.991275-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Xen 4.1 is more than a decade stale now.  Use the same mechanism as elsewhere
in the tree to get the current version number.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Christian Lindig <christian.lindig@citrix.com>
CC: David Scott <dave@recoil.org>
CC: Edwin Török <edwin.torok@cloud.com>
CC: Rob Hoes <Rob.Hoes@citrix.com>
CC: Andrii Sultanov <andrii.sultanov@cloud.com>
CC: Anthony PERARD <anthony.perard@vates.tech>

We could use autoconf for this, but it's rather more invasive and there's
going to be a reasonable amount of churn in this area anyway.
---
 tools/ocaml/common.make | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
index 979cbe08459b..c7eefceeb42b 100644
--- a/tools/ocaml/common.make
+++ b/tools/ocaml/common.make
@@ -14,6 +14,6 @@ CFLAGS += -fPIC -I$(shell ocamlc -where)
 OCAMLOPTFLAGS = -g -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -w F -warn-error F
 OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
 
-VERSION := 4.1
+VERSION := $(shell $(XEN_ROOT)/version.sh $(XEN_ROOT)/xen/Makefile)
 
 OCAMLDESTDIR ?= $(DESTDIR)$(shell $(OCAMLFIND) printconf destdir)
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 10:52:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 10:52:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782251.1191731 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shRtm-0004Fk-HW; Fri, 23 Aug 2024 10:52:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782251.1191731; Fri, 23 Aug 2024 10:52:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shRtm-0004FR-Bn; Fri, 23 Aug 2024 10:52:06 +0000
Received: by outflank-mailman (input) for mailman id 782251;
 Fri, 23 Aug 2024 10:52:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shRtl-0004CD-9b
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 10:52:05 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bb8864cb-613d-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 12:52:04 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a86933829dcso212815966b.3
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 03:52:04 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f47d1c3sm239923866b.169.2024.08.23.03.52.01
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 23 Aug 2024 03:52:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bb8864cb-613d-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724410322; x=1725015122; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Nu11yvtztHSjwdPJuoKFnudbRkELxQKDuzUDZ3yJLxc=;
        b=IDp46kymVn6k3qkXOx+cpoo4wM1b8u2uNIDW18AxC4OFQ5qCBEX2g8ZwgUJgOUSO6i
         RUBIN8KLlLk0hqgliCdCkVnM2E5C/YlC5FO/kpyDhB6DXuV5LARD6EJCzb520lddC7C1
         0Fhcy6+gOyb1kIG/Xa7lIGNyheHAT2BeAvoX4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724410322; x=1725015122;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Nu11yvtztHSjwdPJuoKFnudbRkELxQKDuzUDZ3yJLxc=;
        b=vWcDfVb5WdNR526al8Jhph02vBNsrCewA++tUhcP4gAEqOLdhcRN4qHjMAslDoA0AP
         ZpcOjfzCW66IGsgGmxcRYih3L0SXr69bHJaEBPaTR9xgIR/s8KSwfaTsJBJx6R3+k9y8
         aJH4YL4HTKD9zI3hMtwww9dyL2dky1EkljIADcg50ioR22vqx46UzM3yU1BkUoRzdP86
         2yRQUo+RuP84CdZu5TijfvXKR/ouP2Ntx34XTr+DdMM0GEra++UkB2eP/0pjvWpYVhCU
         TqY83qcJoUYNckxibZHFwTPYJqpHvPxefUbg/H4ppV2SA4sFSqmlPHIFj80W1M9JPrZ1
         s6Eg==
X-Gm-Message-State: AOJu0Yw70tq1UmNDTnDpwTX7842m/0CJUuw1RtYk9XB+yADWUFH2HAYd
	JPIJNTUg0lqMhLBSxuIWJuqWdBVte0hpPwS7shWry8Lg9FETcJG1O15qN3ndlfvOCpYYXDt1R3u
	r
X-Google-Smtp-Source: AGHT+IGQ+JoB81mPv9dDN2BOVPwh58EKGChp4BOMiReGZ27ERwvaB7ZAh/R8vb7/dSvTncYXTEOvRQ==
X-Received: by 2002:a17:907:1c1f:b0:a86:941f:49ac with SMTP id a640c23a62f3a-a86a54dfaedmr124981666b.67.1724410321964;
        Fri, 23 Aug 2024 03:52:01 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Christian Lindig <christian.lindig@citrix.com>,
	David Scott <dave@recoil.org>,
	=?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@cloud.com>,
	Rob Hoes <Rob.Hoes@citrix.com>,
	Andrii Sultanov <andrii.sultanov@cloud.com>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH 1/3] tools/ocaml: Drop OCAMLOPTFLAG_G invocation
Date: Fri, 23 Aug 2024 11:51:55 +0100
Message-Id: <20240823105157.991275-2-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240823105157.991275-1-andrew.cooper3@citrix.com>
References: <20240823105157.991275-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

These days, `ocamlopt -h` asks you whether you meant --help instead, meaning
that the $(shell ) invocation here isn't going end up containing '-g'.

Make it unconditional, like it is in OCAMLCFLAGS already.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Christian Lindig <christian.lindig@citrix.com>
CC: David Scott <dave@recoil.org>
CC: Edwin Török <edwin.torok@cloud.com>
CC: Rob Hoes <Rob.Hoes@citrix.com>
CC: Andrii Sultanov <andrii.sultanov@cloud.com>
CC: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/ocaml/common.make | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
index cc126b749f56..708d74617c8d 100644
--- a/tools/ocaml/common.make
+++ b/tools/ocaml/common.make
@@ -11,8 +11,7 @@ OCAMLFIND ?= ocamlfind
 
 CFLAGS += -fPIC -I$(shell ocamlc -where)
 
-OCAMLOPTFLAG_G := $(shell $(OCAMLOPT) -h 2>&1 | sed -n 's/^  *\(-g\) .*/\1/p')
-OCAMLOPTFLAGS = $(OCAMLOPTFLAG_G) -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -w F -warn-error F
+OCAMLOPTFLAGS = -g -ccopt "$(LDFLAGS)" -dtypes $(OCAMLINCLUDE) -w F -warn-error F
 OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
 
 VERSION := 4.1
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 10:52:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 10:52:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782252.1191744 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shRtn-0004ff-NX; Fri, 23 Aug 2024 10:52:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782252.1191744; Fri, 23 Aug 2024 10:52:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shRtn-0004fY-KY; Fri, 23 Aug 2024 10:52:07 +0000
Received: by outflank-mailman (input) for mailman id 782252;
 Fri, 23 Aug 2024 10:52:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shRtl-0004CD-V1
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 10:52:05 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bbd76ab1-613d-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 12:52:04 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a8677ae5a35so220457066b.0
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 03:52:04 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f47d1c3sm239923866b.169.2024.08.23.03.52.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 23 Aug 2024 03:52:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bbd76ab1-613d-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724410323; x=1725015123; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Rkmqzo+FkSOQbrEOiUy8aC0COpKqGUWCpQCBif5I/0E=;
        b=UfFlb9peOR83wCMpgSL8IM6EIgZoGrT8fn+6OtQkdcI1mkm/bRmLK5zj/WuYKO8Xbb
         wBINtuuSn8V13RfkqeZNsKSeCGa0H8+qO+UVYKPRYeKLGwa6hTdhRYkTUbdrX8g2EtcY
         Eh48w89Bh2r9BQx7XP08fwb8W34XVqJcDUNbs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724410323; x=1725015123;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Rkmqzo+FkSOQbrEOiUy8aC0COpKqGUWCpQCBif5I/0E=;
        b=fUcilPa6n5AFW4pc/BhKZ8CALBbmQvXOK4m4b3F24pLNV+2q5HrTkeQznlglTgnfD5
         BbC6FOX7FIrbtb8+jMDc5nUfXlL/qSfPXR9spT1uViSmh3NeupmmwlxgUV+KefPqDjKG
         avsNjfBzyYAa9loEAZQiDo9nBJXwmpgfOSOWsmlpom30tYXUQuELO8mOp1LIy60ribs6
         8Lhkd7xyPG5BlpI/A8PAn0EnuFirnxT4FcnonaZzmmxVM4kk1QTyzQamFSxxURJ4wpR+
         pLpYrd/GIW/lyd3iJKcE1BjX1O/hDYJ9eoL9CCl/x4SoGcl8cfMZRMa6IL9bHpA90Y2R
         q8Kg==
X-Gm-Message-State: AOJu0YwRKcBxdp9520NhcMxaf9CQl2OPK5yt8SMFc6YTePHx+mbRQsQ2
	2w1oXen8IOmDXzebUjcJH0kBqa1hOJub0kayxU+G/KTbXv/gwuiQwRLwMTzkgV70FhsywepD6RX
	2
X-Google-Smtp-Source: AGHT+IGlQ1yte3xGjuGnwK9O4z3ou2vvpqXd81DCNTbUTe8SM3S0T2YqVc+EgRMHpNXdEbOnbmkjYw==
X-Received: by 2002:a17:906:d264:b0:a86:a1cd:5a8c with SMTP id a640c23a62f3a-a86a52bb759mr120712666b.22.1724410323102;
        Fri, 23 Aug 2024 03:52:03 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Christian Lindig <christian.lindig@citrix.com>,
	David Scott <dave@recoil.org>,
	=?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@cloud.com>,
	Rob Hoes <Rob.Hoes@citrix.com>,
	Andrii Sultanov <andrii.sultanov@cloud.com>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH 2/3] tools/ocaml: Drop o= rune
Date: Fri, 23 Aug 2024 11:51:56 +0100
Message-Id: <20240823105157.991275-3-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240823105157.991275-1-andrew.cooper3@citrix.com>
References: <20240823105157.991275-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This hides a shell redirection which is quite rude.  It also opencodes
$(move-if-changed) without the benefit of short-circuiting dependent logic
when the content hasn't changed.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Christian Lindig <christian.lindig@citrix.com>
CC: David Scott <dave@recoil.org>
CC: Edwin Török <edwin.torok@cloud.com>
CC: Rob Hoes <Rob.Hoes@citrix.com>
CC: Andrii Sultanov <andrii.sultanov@cloud.com>
CC: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/ocaml/Makefile.rules | 5 +++--
 tools/ocaml/common.make    | 2 --
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/ocaml/Makefile.rules b/tools/ocaml/Makefile.rules
index 5638193edf8a..5d534d8754bf 100644
--- a/tools/ocaml/Makefile.rules
+++ b/tools/ocaml/Makefile.rules
@@ -40,13 +40,14 @@ ALL_OCAML_OBJS ?= $(OBJS)
 	$(call quiet-command, $(CC) $(CFLAGS) -c -o $@ $<,CC,$@)
 
 META: META.in
-	sed 's/@VERSION@/$(VERSION)/g' < $< $o
+	sed 's/@VERSION@/$(VERSION)/g' < $< > $@.tmp
+	$(call move-if-changed,$@.tmp,$@)
 
 ALL_OCAML_OBJ_SOURCES=$(addsuffix .ml, $(ALL_OCAML_OBJS))
 
 ifneq ($(MAKECMDGOALS),clean)
 .ocamldep.make: $(ALL_OCAML_OBJ_SOURCES) Makefile $(OCAML_TOPLEVEL)/Makefile.rules
-	$(call quiet-command, $(OCAMLDEP) $(ALL_OCAML_OBJ_SOURCES) *.mli $o,MLDEP,)
+	$(call quiet-command, $(OCAMLDEP) $(ALL_OCAML_OBJ_SOURCES) *.mli > $@.tmp; $(call move-if-changed,$@.tmp,$@),MLDEP,)
 endif
 
 clean: $(CLEAN_HOOKS)
diff --git a/tools/ocaml/common.make b/tools/ocaml/common.make
index 708d74617c8d..979cbe08459b 100644
--- a/tools/ocaml/common.make
+++ b/tools/ocaml/common.make
@@ -17,5 +17,3 @@ OCAMLCFLAGS += -g $(OCAMLINCLUDE) -w F -warn-error F
 VERSION := 4.1
 
 OCAMLDESTDIR ?= $(DESTDIR)$(shell $(OCAMLFIND) printconf destdir)
-
-o= >$@.new && mv -f $@.new $@
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 10:52:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 10:52:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782250.1191723 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shRtm-0004CW-7S; Fri, 23 Aug 2024 10:52:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782250.1191723; Fri, 23 Aug 2024 10:52:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shRtm-0004CP-4v; Fri, 23 Aug 2024 10:52:06 +0000
Received: by outflank-mailman (input) for mailman id 782250;
 Fri, 23 Aug 2024 10:52:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shRtk-0004C8-Sn
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 10:52:04 +0000
Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com
 [2a00:1450:4864:20::12a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bad78ee3-613d-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 12:52:02 +0200 (CEST)
Received: by mail-lf1-x12a.google.com with SMTP id
 2adb3069b0e04-52f01b8738dso1400369e87.1
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 03:52:02 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f47d1c3sm239923866b.169.2024.08.23.03.52.00
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 23 Aug 2024 03:52:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bad78ee3-613d-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724410322; x=1725015122; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=AeHyNpXsgfseJeT0cvaTJIaBLC+Vx+eo9RM6HETHoAE=;
        b=e4Pvcjmf4MEzL3kkX88B9GjdXoQceuVFzlBQ7qrC5TXSf6we08eCHtV34eTup3ViD7
         1NBBqog61ku6of4TX17zBGXTgql05Ng9zXXRR2l8E3cJKn3e81wUxPwJu7JSXmwCqycw
         rKKtfHFAP3wpqVIIudYHHP5I/rV3f5p/ARKtE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724410322; x=1725015122;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=AeHyNpXsgfseJeT0cvaTJIaBLC+Vx+eo9RM6HETHoAE=;
        b=MftPfsLW8xFuqOwd2ngf3EkOf06lqXVKEyLIn2TBxTQNAwB4BvTTIMGdx9+EYtJDRm
         iaNxllkvn+pkLYwBeOMIamRMFoUYmq7WnQAY1O/DYOYA++cNJKxKhZIcqiedbvOuhZSh
         nBS6d4e1OB7rFrXUb4y4aZkJKhFkxAHCRHkCJn8g3EYtRceITMJSeEydBslL2aDBCKyA
         WdyBCVXoy0KwYdjdDbTk9c+mmRlSam3L9cXXO6PqF4wKocuLz9GmBrplK6HI+PIwIyYa
         Yzp28OjZ+I5KKogI727RiOTFmDmXCpdsxMUYpE5hiDyKfXCtkjoKDj4q1HmsFck5JkB5
         ye6w==
X-Gm-Message-State: AOJu0YwA9w75rNwiZpJ/gOo71BKDP0vcNlDmZLsHU8knsg8Jwq2cub1D
	O/dGeKVcu54wXXHHbKye/d6RQWvOEQAfqXrDaeNS5Jo52mM1/CbCLHTNpUYsDuEtSqTYBCoWULS
	U
X-Google-Smtp-Source: AGHT+IEQxCJOnxlTu8+00FLx7551MVKErmDQQstAwKkyi/JkA4dcwur1U8mrAjcvR1AIWJuVX/Eirg==
X-Received: by 2002:a05:6512:2822:b0:52c:df6d:e52e with SMTP id 2adb3069b0e04-53438773a92mr1163686e87.16.1724410321121;
        Fri, 23 Aug 2024 03:52:01 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Christian Lindig <christian.lindig@citrix.com>,
	David Scott <dave@recoil.org>,
	=?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@cloud.com>,
	Rob Hoes <Rob.Hoes@citrix.com>,
	Andrii Sultanov <andrii.sultanov@cloud.com>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: [PATCH 0/3] tools/ocaml: Incremental build fixes
Date: Fri, 23 Aug 2024 11:51:54 +0100
Message-Id: <20240823105157.991275-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Various extra build bugfixes found while reviewing the `Stabilize Oxenstored's
interface with` series.

Andrew Cooper (3):
  tools/ocaml: Drop OCAMLOPTFLAG_G invocation
  tools/ocaml: Drop o= rune
  tools/ocaml: Fix the version embedded in META files

 tools/ocaml/Makefile.rules | 5 +++--
 tools/ocaml/common.make    | 7 ++-----
 2 files changed, 5 insertions(+), 7 deletions(-)


base-commit: 5231765a4e6528a3208e49885b9eeff42519a6c1
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 10:53:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 10:53:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782279.1191763 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shRvT-0006L1-DC; Fri, 23 Aug 2024 10:53:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782279.1191763; Fri, 23 Aug 2024 10:53:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shRvT-0006Ku-Ai; Fri, 23 Aug 2024 10:53:51 +0000
Received: by outflank-mailman (input) for mailman id 782279;
 Fri, 23 Aug 2024 10:53: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=Tpo4=PW=cloud.com=christian.lindig@srs-se1.protection.inumbo.net>)
 id 1shRvS-0006Kk-Qa
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 10:53:50 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fa22e6d6-613d-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 12:53:49 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-533462b9428so3161726e87.3
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 03:53:48 -0700 (PDT)
Received: from smtpclient.apple ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f2a5903sm241438966b.78.2024.08.23.03.53.47
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 23 Aug 2024 03:53:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fa22e6d6-613d-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724410428; x=1725015228; darn=lists.xenproject.org;
        h=to:references:message-id:content-transfer-encoding:cc:date
         :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=EaBCts23yfICKv14pkrP2OwPRJ62+K2VZ1b00yfvBas=;
        b=YkCrMUVAeDSXCj3Oz16nt1HPx8Y7Jv/Z7yNACxDnLMwAKrTLjbnDBi32XNAC0BbUnA
         NNrzkM6jO5DRlkyX74tz6FjcaEmTbS5eNccDVq/puFrVfMLn9LrWpFGohNam6kfzjso1
         V3+ZpsGYusUTN8v45jqhDelmouls4h9ejwH5E=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724410428; x=1725015228;
        h=to:references:message-id:content-transfer-encoding:cc:date
         :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=EaBCts23yfICKv14pkrP2OwPRJ62+K2VZ1b00yfvBas=;
        b=hEjaYBJF/Dg8SdgxGPs2UjFQNe/yXJt08A6zAn7NDSB/rEQBWkcue0VHTpg0hsjy4I
         xiJ4SHBpnQM9pAiG/BkfTSa4bQzuhe6/Reol6huzVxklK1wNh7FHrrdDpsI+EA5SF8Os
         gaR4m4EE1knkW5AR0Zbzj3BVkM8UogSOpajSqCZDpis995S3EjLmoeFTdvkstJr+a1C7
         AJdkdEHuUdGR+pgFCknVzSUeRqw2b6HAwUR1LCqOZVY8+AuaFEpesmyEhzy+JmF8RMuF
         D5NqNyKfL8t+2Y9u2QTJlnKMtljuBrIvFDIM4kOhH3xQ4eSd9SIFydoqgff73Vamf5V6
         tG5g==
X-Gm-Message-State: AOJu0YyHjF5GRVl+K6XVyn94btitkAWy62qVwwN2F4l1Vq8JyzxsfcdB
	iwOMYdEgyV/AaRaH7KhGgC9yNUqwSt1fluxn/xM2xYvVCWpcfsWM8n3vpFT7sIo=
X-Google-Smtp-Source: AGHT+IHgUaYUn0D/I2p9wrYQNJYc4PFDEc3qxrQKjC/0NfqAVAOC5lKIOp5hOzr5w5KoGKWxS8G4GQ==
X-Received: by 2002:a05:6512:a91:b0:52c:8342:6699 with SMTP id 2adb3069b0e04-5343888aa07mr1502731e87.55.1724410427873;
        Fri, 23 Aug 2024 03:53:47 -0700 (PDT)
Content-Type: text/plain;
	charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\))
Subject: Re: [PATCH 0/3] tools/ocaml: Incremental build fixes
From: Christian Lindig <christian.lindig@cloud.com>
In-Reply-To: <20240823105157.991275-1-andrew.cooper3@citrix.com>
Date: Fri, 23 Aug 2024 11:53:35 +0100
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Christian Lindig <christian.lindig@citrix.com>,
 David Scott <dave@recoil.org>,
 =?utf-8?B?RWR3aW4gVMO2csO2aw==?= <edwin.torok@cloud.com>,
 Rob Hoes <Rob.Hoes@citrix.com>,
 Andrii Sultanov <andrii.sultanov@cloud.com>,
 Anthony PERARD <anthony.perard@vates.tech>
Content-Transfer-Encoding: quoted-printable
Message-Id: <55A27B23-1CD1-4123-8F16-793E0966CA49@cloud.com>
References: <20240823105157.991275-1-andrew.cooper3@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
X-Mailer: Apple Mail (2.3774.600.62)



> On 23 Aug 2024, at 11:51, Andrew Cooper <andrew.cooper3@citrix.com> =
wrote:
>=20
> Various extra build bugfixes found while reviewing the `Stabilize =
Oxenstored's
> interface with` series.
>=20
> Andrew Cooper (3):
>  tools/ocaml: Drop OCAMLOPTFLAG_G invocation
>  tools/ocaml: Drop o=3D rune
>  tools/ocaml: Fix the version embedded in META files
>=20
> tools/ocaml/Makefile.rules | 5 +++--
> tools/ocaml/common.make    | 7 ++-----
> 2 files changed, 5 insertions(+), 7 deletions(-)
>=20
>=20
> base-commit: 5231765a4e6528a3208e49885b9eeff42519a6c1
> --=20
> 2.39.2
>=20

Acked-by: Christian Lindig <christian.lindig@cloud.com>



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 11:43:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 11:43:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782302.1191782 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shSgy-0007pt-Vq; Fri, 23 Aug 2024 11:42:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782302.1191782; Fri, 23 Aug 2024 11:42:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shSgy-0007pm-Sr; Fri, 23 Aug 2024 11:42:56 +0000
Received: by outflank-mailman (input) for mailman id 782302;
 Fri, 23 Aug 2024 11:42:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4lC7=PW=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1shSgx-0007pg-Fd
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 11:42:55 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on20631.outbound.protection.outlook.com
 [2a01:111:f403:2414::631])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d3f77015-6144-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 13:42:53 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by DS0PR12MB7771.namprd12.prod.outlook.com (2603:10b6:8:138::6) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Fri, 23 Aug
 2024 11:42:47 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7875.023; Fri, 23 Aug 2024
 11:42:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d3f77015-6144-11ef-a50a-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=rm/80w8FfVXmw9V5Uwe9pizXgd2KddC568uxBVqrwKQQLAANDPV6joyUgJXYQcMV41mx1H+s4+4GTNujF4ysXhRKo+VFh28BcXOZ3AF4hS5m4NogT5Dz3ggx6+bbn23HUdjVUgJXcwIDCUu7kWhPJlWJ2iCqFY8FvpDa0sizNCjPm1iDvFXyA9nnWR4+YuZ6YJtwkEZe3ab0pqcN3KIgQd2p2XbLJn70TBkHNjJ09zTZaDJSdiqoSsMCF4etdjiPiSICui4Vkoh3C/JL2tX2QABv9JTPcVSn8nrqpkJSiK0lJHugpLNn9UsXcAh3zppNtK8+pyYDoiD+7SD/TbZ5rw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=zoOE+S29eVQUYBfKLodTrARv6z5AIm1FN0CHYl+1uIQ=;
 b=u4IMbNLvBOg51ER1xsWd5SYs9ZyOKGjkarq5dOaOnG2yBrwN4Y0eQFMl0mswR9gbUPIsrV3CZ+58JYyO41y9AjIFQa1zUgRRI7sfjC8ZmPXlmAqO+2fGZ6zUnKGZGkeS+mr9XqRUOSCZAPuRNFhso3swXyAfg8JgQ5sfN5frDZ9tpI1xiWEJTRDalGt9dgxKzkdH7SoRdwxfiKaqlKTGAxwQWFbBVwPSS65I3h7mQ0q1yUd+r+dmW2XCvuxtyYKDVqwEiOurJ6FM8lP68+0nrODAEKYz/J6+WTHEifSntj3mRpApPJlsb8vzpInt1AngB1VUAkLMFoDinQPrPhYQow==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=zoOE+S29eVQUYBfKLodTrARv6z5AIm1FN0CHYl+1uIQ=;
 b=syZxXB9JH9GmJ0v1R1zX8KQ1ai/GghvVLCTD+MGts2xSnTQoyhcKZQTE9Iemhn0l+c/KQodZBZsizPBzejs3/aTR4BWWhWhFuXnIOaNN33fo+Q+653LJovLE/uZS2pAUjjRvg/fXubbNEojDRoVcAAIiwDa9rXLw056Cz83mh84=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <d5e97cae-fc6d-4913-88ca-47ecb157752c@amd.com>
Date: Fri, 23 Aug 2024 12:42:42 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] docs: fusa: Add requirements for generic timer
Content-Language: en-GB
To: Bertrand Marquis <Bertrand.Marquis@arm.com>,
 Stefano Stabellini <sstabellini@kernel.org>
Cc: Michal Orzel <michal.orzel@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 Xen-devel <xen-devel@lists.xenproject.org>,
 Artem Mygaiev <artem_mygaiev@epam.com>
References: <20240820103816.1661102-1-ayan.kumar.halder@amd.com>
 <5F0AF572-3437-4372-96EB-42F46B3A3155@arm.com>
 <101a7105-5638-4c69-a5b0-29c252284aea@amd.com>
 <D3358591-F9E2-44A6-A22A-FC2AA8857C68@arm.com>
 <alpine.DEB.2.22.394.2408221327400.3871186@ubuntu-linux-20-04-desktop>
 <9DA45539-F136-40D8-BF46-E63EA1B8ADA6@arm.com>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <9DA45539-F136-40D8-BF46-E63EA1B8ADA6@arm.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: LO4P123CA0436.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:1a9::9) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|DS0PR12MB7771:EE_
X-MS-Office365-Filtering-Correlation-Id: 26f11be7-f19f-4511-4742-08dcc368b575
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?Z08xNjREdDdHZGlvRUNWSGJqUWl1QllpSUFLS2cvT1ZaQ3R3UncvQy9FQnlz?=
 =?utf-8?B?Z3QyVFdHQVZMWkd6K0JrVlJiVFlWUjVMb0lsYmF0Umdud3VaeUdZUXp5clha?=
 =?utf-8?B?WisyS085RURtL0ZsTU83TnFGRVBSbzRoMGlTWU1OUnhFUWNQN09xemwrenRx?=
 =?utf-8?B?YTN3UTlxWjZ0RTE4UllzcUUyN3RsNExYRmNTenlvb2tEVWh6TkRkZFptdFpt?=
 =?utf-8?B?OGdEVmVjSjc2N3A2RS8wSHBpa1BNc0F4NERYZjNMVmYrQmxJOStRaGV6LzMr?=
 =?utf-8?B?UnI2Z2lxV1hnRHBsaDdjay81dDhzUTJyendrRy9TYWEvblJDM1FTTWNzTlBq?=
 =?utf-8?B?MmxJc2RVQmhoN2NNdU5IY3N0NEdhaVRsOFJudHUrWHNmVWRPYWRQZm01ZjBP?=
 =?utf-8?B?d2cvQkgrSktPalYwVjVFdFh1L2N6a2dPVzh3REFRQVVXVlA5ekR5UGJxUDFM?=
 =?utf-8?B?VmIrRlNjbmx3dnE1THNKVUdFa0MzMGVhRTU0TTVrZkNobkFoa044Q2tqVkhY?=
 =?utf-8?B?ak5GV1VaUVRYR0pSbGtzdk00ZTFMOWVFQmFWMi9OcFQwcDl6VUJPTmw1Y080?=
 =?utf-8?B?ejN5S2NlOGFxRUd3WE5VajlIcGFsN3h1L0xVeWtVdHpXRlNRT2prQzZMenlB?=
 =?utf-8?B?bWladHFkYy9kTjB6NGFCcUJCUGhBZ0pPeG1INURLbGhkOE0xNmRBVGhWSGNu?=
 =?utf-8?B?TlZhY3N5MEwrNmJOWkI2Y01EbitqVW9Vc3lYT1kvYWhoR1pZS0p5MUY1ZzRU?=
 =?utf-8?B?b09jTmNUNU5rOVYzWUYyYlNyV1FaS0FCUktCSklwUG5BaFNFcStSUFYzQ282?=
 =?utf-8?B?Z1VUTitmUk5HSG41ZGxYWHllNDU2cTBhWXNpUTlOQSt5MGR3Smd2Q1J0VmpQ?=
 =?utf-8?B?N29Gc2lyOFVxYnpjbkoyaXNkZ0lRbnJKU0dOU2JLdnBJM3YrTkNqS0lxK2VM?=
 =?utf-8?B?VWtpR2RVenJjUmZEMFpGWk1mMko1aG9LWVRGYi9LZG5wdkZ4aHpIUWc2Y1lB?=
 =?utf-8?B?VHBHNFRxZmVqcExhSEVETEwwdFdiSjdkbEdHU1dSbzJvR2x1aXlLbzhCdHVu?=
 =?utf-8?B?eGd1TGhXaFFVZ3ZMWnZudE53RE1MVCtFa3JDRVdBc2RQY1pLcDBQSHMvZ3lC?=
 =?utf-8?B?MGxCTmdyakpwd1J6aGU1S0UzU292WG9CS3h6ZytHWVZBRDh4VnplMURTYmNw?=
 =?utf-8?B?dkEyOERkeDF3WmRrYVpuNXZrTXpiUnlNZ1ZPVzBvSUsyVWdyRHpuWUplZEhW?=
 =?utf-8?B?YWZyWGhVZ21XR0RYYzcyQWJ4NmpvNmRWbi8vVHJKeTRUcmdwU2ZNbE9JUjBj?=
 =?utf-8?B?NEdSWTdpY2QvNmdoSVpyZXZUMkl5cVN2cWtzZWV2TTRsQ1NwZDhXQVZnRndC?=
 =?utf-8?B?R2Vvc1FXdVZFc245UzRlOG5ELzBFbFJNa0pzSFZjVTFrKzI0Wmc2ZjlXcmJu?=
 =?utf-8?B?M0FGY3ZnS2hLbVNkdk5jaGN0aXJOVGl1TWMwOWQyditsdE5pdkFPSVdtdXNM?=
 =?utf-8?B?cXZ6ZE45OHBERUNzOFlBNUkyYy9obVdxeC9SQXpMODdiYmlpZXFjNTM3Y0xJ?=
 =?utf-8?B?SWR3UERFWWRDSFE2K3ZHT0tLZ3RpcVA3V3d3QXRGemEwenlyeWtITndDR2dp?=
 =?utf-8?B?cnF1amhzWmJxajNwekJPV3VzejNSU0cxWlg0TDdtdFVIYXo5bWlFQUl5ai9w?=
 =?utf-8?B?U3A0U3ltVEtGZE5BYlV3cUpMV283aytWZE8yclgvMnk3SXZLZGR0TVhNZnZW?=
 =?utf-8?B?MVNUdnpPMlBXNW90RmdYbk9uQ0prYm9rdGtDdWJpTUR4Yys0ek8vMHBkWmhN?=
 =?utf-8?Q?iKfxYqScnI3cr1rHIokDppAucmIzRT/oQcZ/M=3D?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?RzlhUlMvYUtBa0tCOXVmNW91Z1VlMk90a3VOVnJDNlhkSjlRNjFBbW80OHBC?=
 =?utf-8?B?cm9abUoybncveis4U1BhQk1OdVNrdW5TcWtNYURKTTRuemlHSVc1eXY2YUQ1?=
 =?utf-8?B?TWUxQlMvZmZoRjdOLzhFRWV6RU9SV1VtK0djaElNQmdSTkJRT0djUVdXNEMw?=
 =?utf-8?B?bTBUclM5bFhQb3F1R2lwR3RnK3ZnQVZHWEUrZDhWai9NT05uVkE2OUVJcEhH?=
 =?utf-8?B?ZFBhbnI5cC9HMmZmb1BOU0xES3MwOUtaV1VLRnFabG9vbVBUMzZOUGMvbEZh?=
 =?utf-8?B?VmVwMVJ4L0dvb09PcjhvWGN5emFvZzdSZ3p6Vk11OUl6VDBySG1IdEVvdS9k?=
 =?utf-8?B?dzlTOEg4Vm9pR01YaC9Va2NYTWZXRWdHUG15aHFUMnpmYnErQkMwN0M1QWVK?=
 =?utf-8?B?b1JkUGhYVHQ4eDcweUhYbDlSdmdUbHJOWkNScDFpTEdxclJnZ3BaLzBEREtR?=
 =?utf-8?B?TmtyZU5DdUhRYkVGWG11dm9qYXFJRENUTk5rZ0FYTGtzZDFtNjc4VmNZdk1n?=
 =?utf-8?B?ZFkrQ2JKTE8yM1VYeUY5aWlvMVFxZGNTNjZ0RUFwUWVkdHRoK2FVWU1OTEM4?=
 =?utf-8?B?bTlxd0FoK29IeUVUcWlFdDVPaDRIb1RkVEJiOU5YVkdVbWNHbG0vQkJlenlT?=
 =?utf-8?B?aFVjUmRhbVZUUW5rQTlPL1A2QnY3dVhtNUZhMnRlQ3h1WW1Za0JwN0ZMZ1lo?=
 =?utf-8?B?eUdqNnUyMU40VTBLcmdyaFhra1NHTzdNMmthdUxSdU8xWDBuVUQzM2xQN2lp?=
 =?utf-8?B?RktFZDhMdllCbnVOUGFHZSthanZDYUJnbWhGU3F4UndIcnZsWUpSUnN1eXBH?=
 =?utf-8?B?L2ozVWw3UllSbWZEWnhxNmhnRTFKMmdsVWllMmRDMEg2S0p0VW93ZlpUb2Jy?=
 =?utf-8?B?dFJLRkNJMyt5bEN3VU9xVHRPSVF1TkFuV0hoSDE4cUFOQ25yNXJBTXdTTmc2?=
 =?utf-8?B?UzdZa3VhR2lrMzFxREYxbldpOXN6ZjNnS1F0ZE9KWXRsN0hZbWJxMDVpRS95?=
 =?utf-8?B?YTN6c1VvczZXVUs1ZXJQMVh6bUNiMmJRL2NRWkllRkExL3N0VHMvT3NkRFB5?=
 =?utf-8?B?OHVRYW5tK2tJR0N6UjFrcG4wcVRmN0Q5d29tTGk5ekNLV3ZycGw3bXFjN1I2?=
 =?utf-8?B?VUtDc2hpUklESUwxNE9tRFhUVDQyWWtFVUNDbnR3OUZCZHkvdVI5bjVWYjNF?=
 =?utf-8?B?WUhUeW9qaEh4c2YvLzJDUW1YNlFxaGl4NVExQ0JKeUNFa3RUR3d6UFliY2pz?=
 =?utf-8?B?em1sTFNuTUlkR3h3RE1NODdUU3M3ZW1UcFhMVkJiT2NFTXljMkduTHhCNjcr?=
 =?utf-8?B?RkUvS2ltdFQzbTRkaHVyZXZaMDhzYnU4ZlRSZEFkSHFqa0RtelZSYjVjblUv?=
 =?utf-8?B?QlhXTjQzd2V0TkorZ0dTS1lKZSt1WFVUa2hXbTNrbWkrL2lVa3RKWm9NMkda?=
 =?utf-8?B?aDl1OVEyNHJXQWZadk5nUWh0bHpqQzFkTk1CQktkY3pxYTg4SkdDUUhUSzNv?=
 =?utf-8?B?UUcvT3BNYlVDTi9UQkhiVkNJb1RVOTBacjBVKzNpTjBoV0dMM1VIR2VXdjFT?=
 =?utf-8?B?YlROTmJValhMSVJnN3RKRmJSUWdqLzBtOU5nV05BQ2xQUHRyUDNCRnRCVEFz?=
 =?utf-8?B?ZnYvbkFSTnROMldZR1ozTVdnRm1JVEtvMFlOMUVMbEpOS1hpYW1YZVpZZUJx?=
 =?utf-8?B?SDRCT3J1SDNIMXN0dDBMSXlkclJtek8xSUwrVVNRQUhUb2M3Q0FVcndpVlJL?=
 =?utf-8?B?dXlaZzZzUjNLajc2TFlkdGpObUwzREdKaGhncVFoWmRuTitIWk1KN2RUV3NM?=
 =?utf-8?B?YVZTUXB0eEswRWhrK3pVa211aHMwY1BZY29DVmh6N0JnVng2WTIrSEpFRlBz?=
 =?utf-8?B?QVdZYlhkczBpcUM5dndrMlY2cnhGRFF2VEJZTU1mRUxHL0ZsWUl5bTgrVktt?=
 =?utf-8?B?R280bG9oU2tFNlczalRacUJkdVRXZmdTY1dPeHJxTFQ5WHpjMEZNeWpZczFl?=
 =?utf-8?B?QjNWeGNkYU9WR3BaOWFVMmVycHZHSXFlaUtGVXEzNDZlU0txR2xqcVpXU1lD?=
 =?utf-8?B?S0lYR1BnOEpOcW8zQk1pbFNYdGJtZHNKZ2FOb2FsTXE0dkovcTdSM2w4cFVB?=
 =?utf-8?Q?ny+Yd/0b/Zghi63FH2uAUdtCi?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 26f11be7-f19f-4511-4742-08dcc368b575
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 11:42:46.8967
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: K+jaHwkRFhuSjiO22l3dOoiBCzXjzl/1QH05PF6XiyNkTQGLuHERs1lTzRn+qUe6WcF2XWaIBA7WYQayEAB2Hg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7771

Hi Bertrand/Stefano/Michal,

On 23/08/2024 08:22, Bertrand Marquis wrote:
> Hi Stefano,
>
>> On 22 Aug 2024, at 22:29, Stefano Stabellini <sstabellini@kernel.org> wrote:
>>
>> On Thu, 21 Aug 2024, Bertrand Marquis wrote:
>>>> On 22 Aug 2024, at 11:00, Michal Orzel <michal.orzel@amd.com> wrote:
>>>>
>>>> Hi Bertrand,
>>>>
>>>> I agree with all your comments with a few exceptions, as stated below.
>>>>
>>>> On 21/08/2024 17:06, Bertrand Marquis wrote:
>>>>>
>>>>> Hi Ayan,
>>>>>
>>>>>> On 20 Aug 2024, at 12:38, Ayan Kumar Halder <ayan.kumar.halder@amd.com> wrote:
>>>>>>
>>>>>> From: Michal Orzel <michal.orzel@amd.com>
>>>>>>
>>>>>> Add the requirements for the use of generic timer by a domain
>>>>>>
>>>>>> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
>>>>>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>>>>>> ---
>>>>>> .../reqs/design-reqs/arm64/generic-timer.rst  | 139 ++++++++++++++++++
>>>>>> docs/fusa/reqs/index.rst                      |   3 +
>>>>>> docs/fusa/reqs/intro.rst                      |   3 +-
>>>>>> docs/fusa/reqs/market-reqs/reqs.rst           |  34 +++++
>>>>>> docs/fusa/reqs/product-reqs/arm64/reqs.rst    |  24 +++
>>>>>> 5 files changed, 202 insertions(+), 1 deletion(-)
>>>>>> create mode 100644 docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
>>>>>> create mode 100644 docs/fusa/reqs/market-reqs/reqs.rst
>>>>>> create mode 100644 docs/fusa/reqs/product-reqs/arm64/reqs.rst
>>>>>>
>>>>>> diff --git a/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
>>>>>> new file mode 100644
>>>>>> index 0000000000..bdd4fbf696
>>>>>> --- /dev/null
>>>>>> +++ b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
>>>>>> @@ -0,0 +1,139 @@
>>>>>> +.. SPDX-License-Identifier: CC-BY-4.0
>>>>>> +
>>>>>> +Generic Timer
>>>>>> +=============
>>>>>> +
>>>>>> +The following are the requirements related to ARM Generic Timer [1] interface
>>>>>> +exposed by Xen to Arm64 domains.
>>>>>> +
>>>>>> +Probe the Generic Timer device tree node from a domain
>>>>>> +------------------------------------------------------
>>>>>> +
>>>>>> +`XenSwdgn~arm64_generic_timer_probe_dt~1`
>>>>>> +
>>>>>> +Description:
>>>>>> +Xen shall generate a device tree node for the Generic Timer (in accordance to
>>>>>> +ARM architected timer device tree binding [2]).
>>>>> You might want to say where here. The domain device tree ?
>>>>>
>>>>>> +
>>>>>> +Rationale:
>>>>>> +
>>>>>> +Comments:
>>>>>> +Domains shall probe the Generic Timer device tree node.
>>>>> Please prevent the use of "shall" here. I would use "can".
>>>>> Also detect the presence of might be better than probe.
>>>>>
>>>>>> +
>>>>>> +Covers:
>>>>>> + - `XenProd~emulated_timer~1`
>>>>>> +
>>>>>> +Read system counter frequency
>>>>>> +-----------------------------
>>>>>> +
>>>>>> +`XenSwdgn~arm64_generic_timer_read_freq~1`
>>>>>> +
>>>>>> +Description:
>>>>>> +Xen shall expose the frequency of the system counter to the domains.
>>>>> The requirement would need to say in CNTFRQ_EL0 and in the domain device tree xxx entry.
>>>>>
>>>>>> +
>>>>>> +Rationale:
>>>>>> +
>>>>>> +Comments:
>>>>>> +Domains shall read it via CNTFRQ_EL0 register or "clock-frequency" device tree
>>>>>> +property.
>>>>> I do not think this comment is needed.
>>>>>
>>>>>> +
>>>>>> +Covers:
>>>>>> + - `XenProd~emulated_timer~1`
>>>>>> +
>>>>>> +Access CNTKCTL_EL1 system register from a domain
>>>>>> +------------------------------------------------
>>>>>> +
>>>>>> +`XenSwdgn~arm64_generic_timer_access_cntkctlel1~1`
>>>>>> +
>>>>>> +Description:
>>>>>> +Xen shall expose counter-timer kernel control register to the domains.
>>>>> "counter-timer kernel" is a bit odd here, is it the name from arm arm ?
>>>>> Generic Timer control registers ? or directly the register name.
>>>> This is the name from Arm ARM. See e.g.:
>>>> https://developer.arm.com/documentation/ddi0601/2023-12/AArch64-Registers/CNTKCTL-EL1--Counter-timer-Kernel-Control-Register?lang=en
>>> Right then i would use the same upper cases: Counter-timer Kernel Control
>>> register and still mention CNTKCTL_EL1 as it would be clearer.
>>>
>>>>>> +
>>>>>> +Rationale:
>>>>>> +
>>>>>> +Comments:
>>>>>> +Domains shall access the counter-timer kernel control register to allow
>>>>>> +controlling the access to the timer from userspace (EL0).
>>>>> This is documented in the arm arm, this comment is not needed.
>>>>>
>>>>>> +
>>>>>> +Covers:
>>>>>> + - `XenProd~emulated_timer~1`
>>>>>> +
>>>>>> +Access virtual timer from a domain
>>>>>> +----------------------------------
>>>>>> +
>>>>>> +`XenSwdgn~arm64_generic_timer_access_virtual_timer~1`
>>>>>> +
>>>>>> +Description:
>>>>>> +Xen shall expose the virtual timer registers to the domains.
>>>>>> +
>>>>>> +Rationale:
>>>>>> +
>>>>>> +Comments:
>>>>>> +Domains shall access and make use of the virtual timer by accessing the
>>>>>> +following system registers:
>>>>>> +CNTVCT_EL0,
>>>>>> +CNTV_CTL_EL0,
>>>>>> +CNTV_CVAL_EL0,
>>>>>> +CNTV_TVAL_EL0.
>>>>> The requirement to be complete should give this list, not the comment.
>>>>>
>>>>>> +
>>>>>> +Covers:
>>>>>> + - `XenProd~emulated_timer~1`
>>>>>> +
>>>>>> +Access physical timer from a domain
>>>>>> +-----------------------------------
>>>>>> +
>>>>>> +`XenSwdgn~arm64_generic_timer_access_physical_timer~1`
>>>>>> +
>>>>>> +Description:
>>>>>> +Xen shall expose physical timer registers to the domains.
>>>>>> +
>>>>>> +Rationale:
>>>>>> +
>>>>>> +Comments:
>>>>>> +Domains shall access and make use of the physical timer by accessing the
>>>>>> +following system registers:
>>>>>> +CNTPCT_EL0,
>>>>>> +CNTP_CTL_EL0,
>>>>>> +CNTP_CVAL_EL0,
>>>>>> +CNTP_TVAL_EL0.
>>>>> same as upper
>>>>>
>>>>>> +
>>>>>> +Covers:
>>>>>> + - `XenProd~emulated_timer~1`
>>>>>> +
>>>>>> +Trigger the virtual timer interrupt from a domain
>>>>>> +-------------------------------------------------
>>>>>> +
>>>>>> +`XenSwdgn~arm64_generic_timer_trigger_virtual_interrupt~1`
>>>>>> +
>>>>>> +Description:
>>>>>> +Xen shall enable the domains to program the virtual timer to generate the
>>>>>> +interrupt.
>>>>> I am not sure this is right here.
>>>>> You gave access to the registers upper so Xen responsibility is not really to
>>>>> enable anything but rather make sure that it generates an interrupt according to
>>>>> how the registers have been programmed.
>>>> I'm in two minds about it. On one hand you're right and the IRQ trigger is a side-effect
>>>> of programming the registers correctly. On the other, these are design requirements which
>>>> according to "fusa/reqs/intro.rst" describe what SW implementation is doing. Our way of injecting
>>>> timer IRQs into guests is a bit different (phys timer is fully emulated and we use internal timers
>>>> and for virt timer we first route IRQ to Xen, mask the IRQ and inject to guest). If I were to write
>>>> tests to cover Generic Timer requirements I'd expect to cover whether r.g. masking/unmasking IRQ works,
>>>> whether IRQ was received, etc.
>>> This is true but i think it would be more logic in non design requirements to
>>> phrase things to explain the domain point of view rather than how it is implemented.
>>>
>>> Here the point is to have a timer fully functional from guest point of view, including
>>> getting interrupts when the timer should generate one.
>>>
>>> Maybe something like: Xen shall generate timer interrupts to domains when the timer condition asserts.
>> Both statements are correct.
>>
>> Michal's original statement "Xen shall enable the domains to program the
>> virtual timer to generate the interrupt" is correct. The timer interrupt
>> will be generated by the hardware to Xen, if the guest programs the
>> registers correctly. If Xen does nothing, the interrupt is still
>> generated and received by Xen.
>>
>> Bertrand's statement is also correct. Xen needs to generate a virtual
>> timer interrupt equivalent to the physical timer interrupt, after
>> receiving the physical interrupt.
>>
>> I think the best statement would be a mix of the two, something like:
>>
>> Xen shall enable the domain to program the virtual timer to generate
>> the interrupt, which Xen shall inject as virtual interrupt into the
>> domain.
> This should be split into 2 reqs (2 shall) and the second one might in
> fact be a generic one for interrupt injections into guests.

I agree with you that the second statement shall be a requirement for 
vGIC (as it has nothing to do with the timer).

So, do we agree that the requirements should be

1. Xen shall generate physical timer interrupts to domains when the 
physical timer condition is met.

2. Xen shall generate virtual timer interrupts to domains when the 
virtual timer condition is met.

The important thing here is that Xen can generate both physical timer 
and virtual timer IRQs. It is left to the guests to use one or both.

We can drop the comments here if it is causing confusion.

Let me know your thoughts.

- Ayan



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 12:53:51 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 12:53:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782316.1191792 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shTnL-0002sU-1T; Fri, 23 Aug 2024 12:53:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782316.1191792; Fri, 23 Aug 2024 12:53:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shTnK-0002sN-V1; Fri, 23 Aug 2024 12:53:34 +0000
Received: by outflank-mailman (input) for mailman id 782316;
 Fri, 23 Aug 2024 12:53:33 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kBLJ=PW=cloud.com=javi.merino@srs-se1.protection.inumbo.net>)
 id 1shTnJ-0002sB-CG
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 12:53:33 +0000
Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com
 [2a00:1450:4864:20::432])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b3395c8e-614e-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 14:53:31 +0200 (CEST)
Received: by mail-wr1-x432.google.com with SMTP id
 ffacd0b85a97d-3718b5e9c4fso940964f8f.0
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 05:53:31 -0700 (PDT)
Received: from jmerino-thinkstation ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f2206a1sm256626466b.6.2024.08.23.05.53.30
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 23 Aug 2024 05:53:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b3395c8e-614e-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724417611; x=1725022411; darn=lists.xenproject.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=Yx0XNg8xoECMuJn9WM2rOE/TmZMMyglNPxekTQBAk80=;
        b=S6hMp1wFh5lqghrHDTDKNIB+sothwDvI7wVUV9+LML5CFgNnaL8C8IcoRkhC/GcoyL
         mO0+LOGtqoHobsC1DvW58NIK4GTsoah9d8ffZnCj768Ju9lfoS5OuteXdFaGhvbNytud
         OZrMblvg5Qp4Z7hj8HwpOIyUpx3af+0NkUBF8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724417611; x=1725022411;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=Yx0XNg8xoECMuJn9WM2rOE/TmZMMyglNPxekTQBAk80=;
        b=D5sdni1jRECAHKk6pkY+ZZzVrw5BhEGCu5YBOEziZDlZqR2RSwcuEvpC0I2FVU+gPt
         NKNUccpwNSs4VBMVDrhICC2wFNMLvtYOWBh/DMu7LKpKg7DvSevMlYlqLHu9WTshYRfM
         wiI88qtDUCzPNjG5MlBeZfJn69AJWhJ3RQIpbwPpxF2gIUcUplHaQuzJt+87cXgdR+VS
         7qrQ8ebDvg6t+LRg3nHD+idKNhP3rxdBOqETQxfy5TjHowFFoFbUPdxPkdp9PBV8g5Mt
         AoJ9K/JbrROudCeg3BijB0CuAElsgnOzTNcMOhKPIMhPVFDTJDztTuWDZDSh2BHVwmAa
         LqYw==
X-Forwarded-Encrypted: i=1; AJvYcCVKMzGYI5hpYGuKk8DwKSCC+SIRHa5R63P6DZJAyR09i82nRqqe9jZRA3+SoxZHFfVnVg9Ox5r0qH0=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzmsrt1wXgtNt8as+vKCksoiYbLyfisrE3cuBktAAI+K5h3h/Su
	yWgiTfrPkYQfGA0eiZNEmx2mMwYbAoSc+yL6W8zve/+F1qQPrJ+7iqKfC2cO7pk=
X-Google-Smtp-Source: AGHT+IF9ss6TjyIzXKW+P8Yqf1gvBdv2Riwaf5W4mSUyk9afnFZLlNFE0rw79kB7Uqfwi5YudXz8qA==
X-Received: by 2002:a5d:5648:0:b0:367:93b3:5d5a with SMTP id ffacd0b85a97d-3731191b577mr1391553f8f.57.1724417610691;
        Fri, 23 Aug 2024 05:53:30 -0700 (PDT)
Date: Fri, 23 Aug 2024 13:53:28 +0100
From: Javi Merino <javi.merino@cloud.com>
To: Anthony PERARD <anthony.perard@vates.tech>
Cc: Jan Beulich <jbeulich@suse.com>, Juergen Gross <jgross@suse.com>, 
	Edwin =?utf-8?B?VMO2csO2aw==?= <edwin.torok@cloud.com>, xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v1] libxl: Fix nul-termination of the return value of
 libxl_xen_console_read_line()
Message-ID: <qradgiaxdibr44y5vklwgbqvvgymqufrpq2a3znadcgjeswqk6@3u3vgwvgiztm>
References: <ad7c89bbae34155566ae7c9ca2cb501f21c7d585.1724330921.git.javi.merino@cloud.com>
 <7b575ad5-c7c6-4054-8036-9d2961630d42@suse.com>
 <ZshhBoWZZVGZLUv+@l14>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ZshhBoWZZVGZLUv+@l14>

On Fri, Aug 23, 2024 at 10:14:32AM GMT, Anthony PERARD wrote:
> On Fri, Aug 23, 2024 at 08:31:50AM +0200, Jan Beulich wrote:
> > On 22.08.2024 15:13, Javi Merino wrote:
> > > When built with ASAN, "xl dmesg" crashes in the "printf("%s", line)"
> > > call in main_dmesg().  ASAN reports a heap buffer overflow: an
> > > off-by-one access to cr->buffer.
> > >
> > > The readconsole sysctl copies up to count characters into the buffer,
> > > but it does not add a null character at the end.  Despite the
> > > documentation of libxl_xen_console_read_line(), line_r is not
> > > nul-terminated if 16384 characters were copied to the buffer.
> > >
> > > Fix this by making count one less that the size of the allocated
> > > buffer so that the last byte is always null.
> > >
> > > Reported-by: Edwin Török <edwin.torok@cloud.com>
> > > Signed-off-by: Javi Merino <javi.merino@cloud.com>
> >
> > Perhaps wants a Fixes: tag as well?
> 
> Seems to be:
> Fixes: 4024bae739cc ("xl: Add subcommand 'xl dmesg'")

Yes, I'll add it.

> > > --- a/tools/libs/light/libxl_console.c
> > > +++ b/tools/libs/light/libxl_console.c
> > > @@ -779,7 +779,7 @@ libxl_xen_console_reader *
> > >      cr = libxl__zalloc(NOGC, sizeof(libxl_xen_console_reader));
> > >      cr->buffer = libxl__zalloc(NOGC, size);
> > >      cr->size = size;
> > > -    cr->count = size;
> > > +    cr->count = size - 1;
> > >      cr->clear = clear;
> > >      cr->incremental = 1;
> >
> > While this looks to be addressing the issue at hand, I still wonder: Why
> > does the "count" field exist at all? It's certainly odd to be set right
> > here (when the buffer actually is empty). It's used solely in
> > libxl_xen_console_read_line(), so could be a local variable there.

True.  I just wanted to fix the actual bug, but I guess while we are
at it we can improve this piece of code.

> It isn't only odd to have "count" field, it is also used the wrong way.
> Once "cr->count" is set to 0, the next call to
> libxl_xen_console_read_line() will simply return an empty NULL, even if
> in the mean time more data is available to read from the string.
> Also, if the last call to libxl_xen_console_read_line() was shorter than
> the buffer size, none of the following call will use the full size of
> the buffer. This isn't really a problem for `xl dmesg`, but could be if
> we want to implement "--follow" option for example.
> 
> So Javi, could you remove that `cr->count` field and use a local
> variable instead?

Sure, I'll do that.

> And a comment in the code might be useful about why there's a "-1".
> 
> But I think a better way to address the issue would be to actually set
> '\0' at the end of the string after the call to xc_readconsolering(),
> and remove the not very useful memset(0). That way, it will be more
> explicite as to why we need "-1".

Right, I will get rid of the memset(0) and just nul-terminate the string.

> > Then, further, I wonder why struct libxl__xen_console_reader lives in
> > libxl_internal.h - it's used solely in libxl_console.c.
> 
> History? It actually use to live in libxl.h, 14 yr ago.
>
> > Finally - why libxl__zalloc() when libxl_xen_console_read_line() clears
> > the buffer anyway?
> 
> Overuse of libxl__zalloc when it was use to replace the open coding that
> was used to allocate "cr". While it doesn't seems necessary, I don't
> think it hurt to keep it there.

It used to be a malloc() that was changed to a zalloc() in
39eaabdf4131 (libxl: don't leak buf in libxl_xen_console_read_start
error handling, 2013-12-03).  The comment in the commit message is
wrong, the malloc+memset was being done for libxl_xen_console_reader
(the struct) not for the buffer.

It doesn't hurt to keep it, but if I'm making changes in this area, I
may as well just make it a libxl__malloc() .

Cheers,
Javi


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 12:57:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 12:57:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782324.1191802 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shTrM-00040A-HM; Fri, 23 Aug 2024 12:57:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782324.1191802; Fri, 23 Aug 2024 12:57:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shTrM-000403-EL; Fri, 23 Aug 2024 12:57:44 +0000
Received: by outflank-mailman (input) for mailman id 782324;
 Fri, 23 Aug 2024 12:57:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kBLJ=PW=cloud.com=javi.merino@srs-se1.protection.inumbo.net>)
 id 1shTrL-0003zx-9Y
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 12:57:43 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4827c2b4-614f-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 14:57:41 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5bed68129a7so2618678a12.2
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 05:57:41 -0700 (PDT)
Received: from jmerino-thinkstation ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a3cbdeasm2074481a12.33.2024.08.23.05.57.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 23 Aug 2024 05:57:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4827c2b4-614f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724417861; x=1725022661; darn=lists.xenproject.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=gGWiPQqaoQ/kIw9bPLvZMDmoTAFueMrOHJBno+Db4Ns=;
        b=ij83vz6Qt3nAAauAfL4lBA9D618bUC6g+H7U1cMCXSS09MfQdotvft8HDYsvU6V2qq
         fTUuZ7eisIZkAWk47Pafxj+bZEeH1h1pewTLRQIz5+cqjC87+adunEzrNI1zIxPQ5Wg9
         XtTZBy0l17gJzG7266Jp0YnX0KwIzuzaO1RPc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724417861; x=1725022661;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=gGWiPQqaoQ/kIw9bPLvZMDmoTAFueMrOHJBno+Db4Ns=;
        b=wZlYXb80o7QNm6vMxBARDNaHZlAXMKNn8sw7vTo8c/56SsKn5BEEI2evXedcPMxpeW
         Y/6oApLLeR6VJlcvy8yCuP/LEaThrauT8NI1HyIw0y7TTFE8tWGjSG0BXR1XF/JWO4KB
         cMjanoEvh9Gv/jd22oTrAjD+d/ZPlGIW2XnMLVFRqWuKKhUl+11uhzx8kPGNfLjEe5GN
         mmlvOJ/5eERZHpohhWVmRE0ackCsASGckWqzTj7FxKwGbTEy8IHiJhoQbb4Y/DtyUuFr
         k4lYlcck+y/D1HWI1b1WcHyKO6WqvNNT5aTPppTvog6yxFXm+X8EuxiiZ+1ThgFez2+B
         lB4Q==
X-Gm-Message-State: AOJu0YyB5KO1q+5LqQEx6Ib148ij02YNZfAHGhBPc+JMNnmFBj1yc6Rd
	j9Qn2N+Ph1HRK/PscJaNbCXlN+ghnGS+GUKf+QOAn9+GH3NmNmkB8vt/26GA7FM=
X-Google-Smtp-Source: AGHT+IHoaXFUwMWdkMrVppA9B4WOb1pZ5hKLc0TbFv9/0HKU+xPusEt6cTpDZuGv6suVNK4tUfKXMQ==
X-Received: by 2002:a05:6402:4281:b0:5bf:2569:f8eb with SMTP id 4fb4d7f45d1cf-5c0891aafb1mr1298107a12.36.1724417860622;
        Fri, 23 Aug 2024 05:57:40 -0700 (PDT)
Date: Fri, 23 Aug 2024 13:57:38 +0100
From: Javi Merino <javi.merino@cloud.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, 
	Anthony PERARD <anthony.perard@vates.tech>, Juergen Gross <jgross@suse.com>, 
	Edwin =?utf-8?B?VMO2csO2aw==?= <edwin.torok@cloud.com>
Subject: Re: [XEN PATCH v1] libxl: Fix nul-termination of the return value of
 libxl_xen_console_read_line()
Message-ID: <zofuedoeupcmu44zcfcloeryvro3femjss6fuadbl43vbinzdo@oi4pejy2ez5t>
References: <ad7c89bbae34155566ae7c9ca2cb501f21c7d585.1724330921.git.javi.merino@cloud.com>
 <925ae2fb-6f6f-4825-8469-c410b7bb89fc@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <925ae2fb-6f6f-4825-8469-c410b7bb89fc@citrix.com>

On Fri, Aug 23, 2024 at 10:34:05AM GMT, Andrew Cooper wrote:
> On 22/08/2024 2:13 pm, Javi Merino wrote:
> > When built with ASAN, "xl dmesg" crashes in the "printf("%s", line)"
> > call in main_dmesg().  ASAN reports a heap buffer overflow: an
> > off-by-one access to cr->buffer.
> >
> > The readconsole sysctl copies up to count characters into the buffer,
> > but it does not add a null character at the end.  Despite the
> > documentation of libxl_xen_console_read_line(), line_r is not
> > nul-terminated if 16384 characters were copied to the buffer.
> >
> > Fix this by making count one less that the size of the allocated
> > buffer so that the last byte is always null.
> >
> > Reported-by: Edwin Török <edwin.torok@cloud.com>
> > Signed-off-by: Javi Merino <javi.merino@cloud.com>
> > ---
> >  tools/libs/light/libxl_console.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/libs/light/libxl_console.c b/tools/libs/light/libxl_console.c
> > index a563c9d3c7f9..fa28e2139453 100644
> > --- a/tools/libs/light/libxl_console.c
> > +++ b/tools/libs/light/libxl_console.c
> > @@ -779,7 +779,7 @@ libxl_xen_console_reader *
> >      cr = libxl__zalloc(NOGC, sizeof(libxl_xen_console_reader));
> >      cr->buffer = libxl__zalloc(NOGC, size);
> >      cr->size = size;
> > -    cr->count = size;
> > +    cr->count = size - 1;
> >      cr->clear = clear;
> >      cr->incremental = 1;
> >  
> 
> This looks like it will fix the ASAN issue, but I think a better fix
> would be:
> 
> -        printf("%s", line);
> +       printf("%.*s", cr->count, line);
> 
> because otherwise there's a world of sharp corners once Xen has wrapped
> the buffer for the first time.
> 
> 
> Which brings us a lot of other WTFs in this code...
> 
> First, libxl_console.c describes it's functionality in terms of lines,
> and line_reader() in the API.  Yet it's not lines, it's a 16k buffer
> with generally multi-line content.  It's too late to fix the naming, but
> we could at least rewrite the comments not to be blatant lies.
> 
> 
> Just out of context above the hunk is:
> 
>     unsigned int size = 16384;
> 
> which isn't accurate.  The size of Xen's console ring can be changed at
> compile time (like XenServer does), and/or by command line variable.
> 
> Because the dmesg ring is never full (it just keeps producing and
> overwriting tail data), it's impossible to get a clean copy except in a
> single hypercall; the incremental/offset parameters are an illusion, and
> do not function correctly if a new printk() has occurred between
> adjacent hypercalls.
> 
> And that is why setting count to size - 1 probably isn't wise.  It means
> that, even in the ideal case where Xen's ringbuffer is 16k, you've still
> got to make 2 hypercalls to get the content.

You are right, having to do 2 hypercalls in the ideal case is not
good.  I'm going to get rid of cr->count, and make
libxl_xen_console_read_line() honour its documentation of returning a
nul-terminated string.  I'll just make the allocation one char bigger,
which was the fix I originally had.

Cheers,
Javi



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 13:00:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 13:00:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782331.1191812 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shTtz-0005UV-TX; Fri, 23 Aug 2024 13:00:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782331.1191812; Fri, 23 Aug 2024 13:00:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shTtz-0005UO-Pf; Fri, 23 Aug 2024 13:00:27 +0000
Received: by outflank-mailman (input) for mailman id 782331;
 Fri, 23 Aug 2024 13:00:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=lTQ5=PW=cloud.com=fouad.hilly@srs-se1.protection.inumbo.net>)
 id 1shTty-0005UI-GL
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 13:00:26 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a9f6dfcc-614f-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 15:00:25 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-52f04b4abdcso2362364e87.2
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 06:00:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a9f6dfcc-614f-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724418025; x=1725022825; 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=EUIqIvjOO+ZB3ICfg/YTIwjsqOnIpA4Wj0L8U6x/SiU=;
        b=EzwbWxPPCJJzET9eHGDpB2tcNA98f2iOnW4PaTPWsNKI1NCMsD7U8oJizNYEUHP1XQ
         OXt7vn0QTaTyxJzwxShApCVy1vAkTia2AqQcKhW14rHt2A9uQFZu1tUSgtSrzbhTsYi4
         VgnaqJPfqCydatiEpuYkxbudkHNxdMbm/QZBY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724418025; x=1725022825;
        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=EUIqIvjOO+ZB3ICfg/YTIwjsqOnIpA4Wj0L8U6x/SiU=;
        b=at9BFR6R4gSE82r0yQEDcnEp2A+FBoPFq5fzlIEvjrK16A8J5c1JCuxwovlkhQ5scZ
         EiTapKXAxZhVpgPZtohmRhwQlg+5am/WQU5UHS/CibAzayP0rRe4wVbP42hkBg5nJ2up
         JHVn/MQFDPGcY5cJaGWp7EpK5tfd8M8jM/u6AnEldNehRbf5J4PoIvVtgrdWBActZ/ss
         1E4V+FkBklbPcEdu/qmu9j6/UWkiWW4u0Ye4IK27CBQ2oq7rG8xBxPlf+GBYmHcTcz5Y
         T8qUAUamaWj/DlvepcFyR3EMrNeHkjDJ3v4kZZ94lZPxmxFFG6Q2RfgZzBamgDUIp3DS
         DpfA==
X-Forwarded-Encrypted: i=1; AJvYcCW3hL/VmpslEvkjBEUW8jw4bSUEUYsH/TS4EATQIa4ebPWiyp2+6mxZDMJo9SLIoyOr7dzotLod7VA=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz0DQXRzrOuchjXub9mI2kk7wDBBaHZpJ2Sr0lC7qRl3NQGFBXk
	dNZI0ahKvl2N15HzZgL/TbeZRhi8Bh9sG3EeiU5j6kb07JhJIQ2pTFZrZ8RitDM9ypFiEgQsNkG
	e9Ll/eNmQ60YAl9dpKzxeJKF+xkOh+YmBJbzgmg==
X-Google-Smtp-Source: AGHT+IHr2prIo7wJONFQOqnXFsuZPdQIHXsdn3mW65tUYdIfytggI/1v6ukS0i35NqkdYnHdjQqjLT0FM9LXH77LkKk=
X-Received: by 2002:a05:6512:3b2b:b0:52e:98f6:c21f with SMTP id
 2adb3069b0e04-53438832e5cmr1536588e87.16.1724418024099; Fri, 23 Aug 2024
 06:00:24 -0700 (PDT)
MIME-Version: 1.0
References: <20240822130426.492931-1-fouad.hilly@cloud.com>
 <20240822130426.492931-3-fouad.hilly@cloud.com> <25eca7b9-daef-42c7-8aa4-0d63d0cd0aa4@suse.com>
In-Reply-To: <25eca7b9-daef-42c7-8aa4-0d63d0cd0aa4@suse.com>
From: Fouad Hilly <fouad.hilly@cloud.com>
Date: Fri, 23 Aug 2024 14:00:12 +0100
Message-ID: <CAJKAvHb6OKk9Y0ed=aKtesxH3S7KeZRQzgSCOuA5BNn9R3g69w@mail.gmail.com>
Subject: Re: [PATCH v7 2/3] x86/ucode: Introduce --force option to xen-ucode
To: Jan Beulich <jbeulich@suse.com>
Cc: Anthony PERARD <anthony.perard@vates.tech>, Juergen Gross <jgross@suse.com>, 
	Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
Content-Type: multipart/alternative; boundary="000000000000c571c60620595b1e"

--000000000000c571c60620595b1e
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Aug 23, 2024 at 7:48=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wro=
te:

> On 22.08.2024 15:04, Fouad Hilly wrote:
> > @@ -79,7 +81,10 @@ static void usage(FILE *stream, const char *name)
> >              "Usage: %s [options | microcode-file]\n"
> >              "options:\n"
> >              "  -h, --help               display this help\n"
> > -            "  -s, --show-cpu-info      show CPU information\n",
> > +            "  -s, --show-cpu-info      show CPU information\n"
> > +            "  -f, --force              skip certain checks when
> applying\n"
> > +            "                           microcode; do not use unless
> you know\n"
> > +            "                           exactly what you are doing\n",
> >              name, name);
>
> As indicated before: --force does no longer fit "[options |
> microcode-file]".
> The form coming closest is imo going to be "[options] [microcode-file]",
> with
> the file name simply taking no effect when specified together with one of
> the
> pre-existing two options.
>

My bad, I missed this change in v7.
I agree,  "[options] [microcode-file]" seems to better fit with the
introduction of --force.
If there are no further comments on the rest of the patch series, I can
prep v8 with this change.

>
> Jan
>

Thanks,

Fouad

--000000000000c571c60620595b1e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, Aug 23, 2024 at 7:48=E2=80=AF=
AM Jan Beulich &lt;<a href=3D"mailto:jbeulich@suse.com" target=3D"_blank">j=
beulich@suse.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" =
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex">On 22.08.2024 15:04, Fouad Hilly wrote:<br>
&gt; @@ -79,7 +81,10 @@ static void usage(FILE *stream, const char *name)<b=
r>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;Usage: %s [optio=
ns | microcode-file]\n&quot;<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;options:\n&quot;=
<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0 -h, --hel=
p=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0display this help\n=
&quot;<br>
&gt; -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0 -s, --show-cpu=
-info=C2=A0 =C2=A0 =C2=A0 show CPU information\n&quot;,<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0 -s, --show-cpu=
-info=C2=A0 =C2=A0 =C2=A0 show CPU information\n&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0 -f, --force=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 skip certain checks when appl=
ying\n&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0microcode; do not use unless you know\n&quot;<br>
&gt; +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 &quot;=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0exactly what you are doing\n&quot;,<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 name, name);<br>
<br>
As indicated before: --force does no longer fit &quot;[options | microcode-=
file]&quot;.<br>
The form coming closest is imo going to be &quot;[options] [microcode-file]=
&quot;, with<br>
the file name simply taking no effect when specified together with one of t=
he<br>
pre-existing two options.<br></blockquote><div><br></div><div>My bad, I mis=
sed this change in v7.</div><div>I agree,=C2=A0 &quot;[options] [microcode-=
file]&quot; seems to better fit with the introduction of --force.</div><div=
>If there are no further comments on the rest of the patch series, I can pr=
ep v8 with this change.</div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex">
<br>
Jan<br></blockquote><div><br></div><div>Thanks,</div><div><br></div><div>Fo=
uad=C2=A0</div></div></div>

--000000000000c571c60620595b1e--


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 13:10:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 13:10:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782343.1191821 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shU3q-0007gS-Ns; Fri, 23 Aug 2024 13:10:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782343.1191821; Fri, 23 Aug 2024 13:10:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shU3q-0007gL-LF; Fri, 23 Aug 2024 13:10:38 +0000
Received: by outflank-mailman (input) for mailman id 782343;
 Fri, 23 Aug 2024 13:10:37 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shU3p-0007gF-Cc
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 13:10:37 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1481e9f8-6151-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 15:10:35 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a7aa086b077so227325366b.0
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 06:10:33 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f436322sm259382566b.117.2024.08.23.06.10.31
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 23 Aug 2024 06:10:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1481e9f8-6151-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724418633; x=1725023433; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=UW85lMy3eLQqGbmm6QqWXIyMK9LIJXV5KbNrmX3uSc8=;
        b=I6UYIJbbz0u4RDVGjwQ5xW1LFC1bzvH3mLF56bItwQOge6o/VR0FgsldFsppv3g90u
         brz4edwoFBS2jkHUKDwWwmBTKUjRfhIDAjyU8RoTq/MOUi6OXpXjOxSba842/1aUlB5c
         VTv1B7HTrIcRZvF5yK3UfkNY8DTC/SvTEBKGo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724418633; x=1725023433;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=UW85lMy3eLQqGbmm6QqWXIyMK9LIJXV5KbNrmX3uSc8=;
        b=uEGmM/ASE/CS1gJMqw+mPFwFQIIuIZovgYywGg1LuJiNZEDrfF96FWKHlIZNgsGHej
         eafDhLG4hylnK3W0CR0xv+XHuYqBjNSIqtubFX4jA3I9ndXg3za1wzF07Zs39z6VQCd4
         H05GwJDkgYE74eC1kaaN2QxYsB+6CYKQjzfivVmrtFWJVnnW5o2/JUUgZj6EpF3vPbTZ
         w6ee3TTsGU5cv2sgED1U+YEHCKgLJwtbdPyyY6giENnS18fZfSqcqBfbz3ddm+s/mxHu
         O/qNGbUYK91lxuCpxHiYVyHN0v2cMgzJNnZZvLRCV89cuB3pGLjIvLMeH39epiAuHuSY
         qWgA==
X-Gm-Message-State: AOJu0YzPvTzDJWDn9g4fNLJK7fPxKTrZwjVPPdOXGvgGDBYSp/dVA6PE
	w/Af2PkYEz38GciK5XykmAykY1zNH4uaIdb6Vl18GgyXJ6QxQt9UIVFVoiHVSiNh8ZjR2u1ztsR
	u
X-Google-Smtp-Source: AGHT+IF5Jv2uhbCVqySaIYOjBbU2IqNlpZqEyA63pgmRS5QFhGyO9e7Xi1DkxU8XFbqZ3yqs15660Q==
X-Received: by 2002:a17:907:d59a:b0:a86:91c3:9517 with SMTP id a640c23a62f3a-a86a52eb66bmr168805666b.35.1724418632091;
        Fri, 23 Aug 2024 06:10:32 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v3] x86/boot: Preserve the value clobbered by the load-base calculation
Date: Fri, 23 Aug 2024 14:10:29 +0100
Message-Id: <20240823131029.1025984-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

From: Frediano Ziglio <frediano.ziglio@cloud.com>

Right now, Xen clobbers the value at 0xffc when performing it's load-base
calculation.  We've got plenty of free registers at this point, so the value
can be preserved easily.

This fixes a real bug booting under Coreboot+SeaBIOS, where 0xffc happens to
be the cbmem pointer (e.g. Coreboot's dmesg ring, among other things).

However, there's also a better choice of memory location to use than 0xffc, as
all our supported boot protocols have a pointer to an info structure in %ebx.

Update the documentation to match.

Fixes: 1695e53851e5 ("x86/boot: Fix the boot time relocation calculations")
Fixes: d96bb172e8c9 ("x86/entry: Early PVH boot code")
Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Frediano Ziglio <frediano.ziglio@cloud.com>

v3:
 * Use plain MOV for preserve/restore.  It's easier to follow than pop/pop.
 * Update how-xen-boots.rst too.

Superceeds https://lore.kernel.org/xen-devel/20240822140044.441126-1-frediano.ziglio@cloud.com/T/#u
---
 docs/hypervisor-guide/x86/how-xen-boots.rst | 12 ++++++--
 xen/arch/x86/boot/head.S                    | 33 ++++++++++++++-------
 2 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/docs/hypervisor-guide/x86/how-xen-boots.rst b/docs/hypervisor-guide/x86/how-xen-boots.rst
index ca77d7c8a333..f1878ad7897f 100644
--- a/docs/hypervisor-guide/x86/how-xen-boots.rst
+++ b/docs/hypervisor-guide/x86/how-xen-boots.rst
@@ -96,6 +96,12 @@ Xen, once loaded into memory, identifies its position in order to relocate
 system structures.  For 32bit entrypoints, this necessarily requires a call
 instruction, and therefore a stack, but none of the ABIs provide one.
 
-Overall, given that on a BIOS-based system, the IVT and BDA occupy the first
-5/16ths of the first page of RAM, with the rest free to use, Xen assumes the
-top of the page is safe to use.
+In each supported 32bit entry protocol, ``%ebx`` is a pointer to an info
+structure, and it is highly likely that this structure does not overlap with
+Xen.  Therefore we use this as as a temporary stack, preserving the prior
+value, in order to calculate Xen's position in memory.
+
+If this heuristic happens to be wrong (most likely because we were booted by
+some other protocol), the calculation stills works as long as ``%ebx`` points
+at RAM and does not alias the currently-executing instructions.  This is
+reasonably likely, and the best we can manage given no other information.
diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index d8ac0f0494db..994819826b01 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -414,17 +414,23 @@ __pvh_start:
         cli
 
         /*
-         * We need one push/pop to determine load address.  Use the same
-         * absolute stack address as the native path, for lack of a better
-         * alternative.
+         * We need one call (i.e. push) to determine the load address.  See
+         * __start for a discussion on how to do this safely using the PVH
+         * info structure.
          */
-        mov     $0x1000, %esp
+
+        /* Preserve the field we're about to clobber. */
+        mov     (%ebx), %edx
+        lea     4(%ebx), %esp
 
         /* Calculate the load base address. */
         call    1f
 1:      pop     %esi
         sub     $sym_offs(1b), %esi
 
+        /* Restore the clobbered field. */
+        mov     %edx, (%ebx)
+
         /* Set up stack. */
         lea     STACK_SIZE - CPUINFO_sizeof + sym_esi(cpu0_stack), %esp
 
@@ -460,21 +466,26 @@ __start:
         /*
          * Multiboot (both 1 and 2) specify the stack pointer as undefined
          * when entering in BIOS circumstances.  This is unhelpful for
-         * relocatable images, where one push/pop is required to calculate
-         * images load address.
+         * relocatable images, where one call (i.e. push) is required to
+         * calculate images load address.
          *
-         * On a BIOS-based system, the IVT and BDA occupy the first 5/16ths of
-         * the first page of RAM, with the rest free for use.  Use the top of
-         * this page for a temporary stack, being one of the safest locations
-         * to clobber.
+         * This early in boot, there is one area of memory we know about with
+         * reasonable confidence that it isn't overlapped by Xen, and that's
+         * the Multiboot info structure in %ebx.  Use it as a temporary stack.
          */
-        mov     $0x1000, %esp
+
+        /* Preserve the field we're about to clobber. */
+        mov     (%ebx), %edx
+        lea     4(%ebx), %esp
 
         /* Calculate the load base address. */
         call    1f
 1:      pop     %esi
         sub     $sym_offs(1b), %esi
 
+        /* Restore the clobbered field. */
+        mov     %edx, (%ebx)
+
         /* Set up stack. */
         lea     STACK_SIZE - CPUINFO_sizeof + sym_esi(cpu0_stack), %esp
 

base-commit: 8ffcf184affbc2ff1860dabe1757388509d5ed67
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 13:30:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 13:30:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782356.1191831 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shUMl-00035N-C1; Fri, 23 Aug 2024 13:30:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782356.1191831; Fri, 23 Aug 2024 13:30:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shUMl-00035G-97; Fri, 23 Aug 2024 13:30:11 +0000
Received: by outflank-mailman (input) for mailman id 782356;
 Fri, 23 Aug 2024 13:30:10 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shUMk-000356-9k; Fri, 23 Aug 2024 13:30:10 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shUMk-0007oG-69; Fri, 23 Aug 2024 13:30:10 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shUMj-0002ZX-NH; Fri, 23 Aug 2024 13:30:09 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shUMj-0004TU-Mc; Fri, 23 Aug 2024 13:30:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=r4dOWORI1X8Z/NZWjheD+jLvBNMcE2RQvFzAnQDmroo=; b=fosEmr8r7jmTcmciC33vzvtFHk
	0lhLj1Wpe7xCR0dVn+gU8BMEKvQp1ZK4BleVQ/HUGTymhKJYdTTTBtBMHg8Sqm7WVnuEXbG6FDZkx
	TC4irjbgsypm0W3HZ06oz5/QpbWsNXaRQAa6Miyd33FjlOCbQewMDUCe8CMbY3O+qSHs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187320-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187320: regressions - FAIL
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:guest-saverestore:fail:regression
    xen-unstable-smoke:test-amd64-amd64-xl-qemuu-debianhvm-amd64:guest-localmigrate:fail:allowable
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=5231765a4e6528a3208e49885b9eeff42519a6c1
X-Osstest-Versions-That:
    xen=aa80a04df488528d90a0d892f0752571b1759e8b
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 23 Aug 2024 13:30:09 +0000

flight 187320 xen-unstable-smoke real [real]
flight 187323 xen-unstable-smoke real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187320/
http://logs.test-lab.xenproject.org/osstest/logs/187323/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-libvirt     17 guest-saverestore        fail REGR. vs. 187314

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 16 guest-localmigrate fail REGR. vs. 187314

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  5231765a4e6528a3208e49885b9eeff42519a6c1
baseline version:
 xen                  aa80a04df488528d90a0d892f0752571b1759e8b

Last test of basis   187314  2024-08-22 21:04:01 Z    0 days
Testing same since   187320  2024-08-23 08:02:13 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Jan Beulich <jbeulich@suse.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    fail    
 test-amd64-amd64-libvirt                                     fail    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 5231765a4e6528a3208e49885b9eeff42519a6c1
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Aug 23 09:13:07 2024 +0200

    x86emul: convert op_bytes/opc checks in SIMD emulation
    
    Raising #UD for an internal shortcoming of the emulator isn't quite
    right. Similarly BUG() is bigger a hammer than needed.
    
    Switch to using EXPECT() instead. This way even for insns not covered by
    the test harness fuzzers will have a chance of noticing issues, should
    any still exist or new ones be introduced.
    
    Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

commit 6fa6b7feaafd622db3a2f3436750cf07782f4c12
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Aug 23 09:12:24 2024 +0200

    x86emul: set (fake) operand size for AVX512CD broadcast insns
    
    Back at the time I failed to pay attention to op_bytes still being zero
    when reaching the respective case block: With the ext0f38_table[]
    entries having simd_packed_int, the defaulting at the bottom of
    x86emul_decode() won't set the field to non-zero for F3-prefixed insns.
    
    Fixes: 37ccca740c26 ("x86emul: support AVX512CD insns")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

commit d45687cca2450bfebe1dfbddb22f4f03c6fbc9cb
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Aug 23 09:11:15 2024 +0200

    x86emul: always set operand size for AVX-VNNI-INT8 insns
    
    Unlike for AVX-VNNI-INT16 I failed to notice that op_bytes may still be
    zero when reaching the respective case block: With the ext0f38_table[]
    entries having simd_packed_int, the defaulting at the bottom of
    x86emul_decode() won't set the field to non-zero for F3- or F2-prefixed
    insns.
    
    Fixes: 842acaa743a5 ("x86emul: support AVX-VNNI-INT8")
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 13:42:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 13:42:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782366.1191842 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shUYU-0005DJ-Eo; Fri, 23 Aug 2024 13:42:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782366.1191842; Fri, 23 Aug 2024 13:42:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shUYU-0005DC-AQ; Fri, 23 Aug 2024 13:42:18 +0000
Received: by outflank-mailman (input) for mailman id 782366;
 Fri, 23 Aug 2024 13:42:16 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shUYS-0005D6-9b
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 13:42:16 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 81db269f-6155-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 15:42:15 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a8695cc91c8so208306466b.3
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 06:42:15 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f4360c0sm260508066b.108.2024.08.23.06.42.13
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 23 Aug 2024 06:42:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 81db269f-6155-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724420534; x=1725025334; 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=HczTFglUv9an+UX8FcWm4FI8N9GLmtd5n0UAsXCVflY=;
        b=miTTrEfiASNcfZlcgK1evuTfgMueFMw/e3N3TvD4vi1Mpu5+MVQZygzHw3LY17suWS
         nkRKpR9Yij4nfeofwvfGdxvWWl3SBAifVIrgdwghswyKE8+RzUqlEk2oi6FIuiEGMHLj
         es/J8E0Gm2/Bc0RCFqfUM+NQLgy0lFfty+FkQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724420534; x=1725025334;
        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=HczTFglUv9an+UX8FcWm4FI8N9GLmtd5n0UAsXCVflY=;
        b=M2x/DKvyTHJ3Tx+wCv0Ksfi8zHAxwjFo5DYjeji8HyLn16Meukt4upi9oVcR3av9h3
         FHsmYF5tngs/lrpwBytAqiFkj0zeC0tLpaUU/e8H3JBbsExvvSCU5Ckftnxps3iMCzGW
         SJZHt6PbW7D+ubfUhYCKmhWCiOMo+ZHapCRKB8QK8IfeWDjqIM+05Z3e6lF28Ho7OZ6a
         cOnRI2kMMaAqpmbJpgETi+QngP2fIY8u5XZZpXQxwypY7AiBGSnslPsMx+uiIuEWikQZ
         J0C5JvYmNgtfRMHnZwFqlW30Z8rVhE+twlgoiwq1sJNUPBS66pP3Xjfed8fWIC85dENc
         GJGg==
X-Forwarded-Encrypted: i=1; AJvYcCWiFcsRfNW6zcyyscFs2wbN8z+UrUQAQPtwQyUZuRhOXxAEeW4LkDxwfWyIgRVkQJSvaxAPNCvqH0w=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxN1EajTuPHi2LZ59bwwD5RwGEC1isWjEEX45hoGnRPt5QqeSlI
	JPDRs7bswoR1DCL5LGGFAZAR2hxRU7SqHBkeWpeYGeaB9p9utWh4XKTSXeuhn0tNDJB1bmHAyTX
	P
X-Google-Smtp-Source: AGHT+IFg0QmfQ36AzdESCqki7vrYx6/JWGi2XCrcQQG0gDye8gpuOBw9LBZ9CjF0LpDxb99BiXIHLw==
X-Received: by 2002:a17:906:6a17:b0:a86:4649:28e6 with SMTP id a640c23a62f3a-a86a54bf4d6mr149405766b.57.1724420534269;
        Fri, 23 Aug 2024 06:42:14 -0700 (PDT)
Message-ID: <d5b62012-bffc-41f2-a3b3-2ddca89a5716@citrix.com>
Date: Fri, 23 Aug 2024 14:42:12 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/x2APIC: correct cluster tracking upon CPUs going down
 for S3
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>
References: <0a082833-3d52-4c9d-8ea4-5be01986cd2c@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <0a082833-3d52-4c9d-8ea4-5be01986cd2c@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 08/08/2024 2:30 pm, Jan Beulich wrote:
> Downing CPUs for S3 is somewhat special: Since we can expect the system
> to come back up in exactly the same hardware configuration, per-CPU data
> for the secondary CPUs isn't de-allocated (and then cleared upon re-
> allocation when the CPUs are being brought back up). Therefore the
> cluster_cpus per-CPU pointer will retain its value for all CPUs other
> than the final one in a cluster (i.e. in particular for all CPUs in the
> same cluster as CPU0). That, however, is in conflict with the assertion
> early in init_apic_ldr_x2apic_cluster().
>
> Note that the issue is avoided on Intel hardware, where we park CPUs
> instead of bringing them down.
>
> Extend the bypassing of the freeing to the suspend case, thus making
> suspend/resume also a tiny bit faster.
>
> Fixes: 2e6c8f182c9c ("x86: distinguish CPU offlining from CPU removal")
> Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 13:59:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 13:59:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782374.1191855 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shUop-00084Y-Pc; Fri, 23 Aug 2024 13:59:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782374.1191855; Fri, 23 Aug 2024 13:59:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shUop-00084R-MI; Fri, 23 Aug 2024 13:59:11 +0000
Received: by outflank-mailman (input) for mailman id 782374;
 Fri, 23 Aug 2024 13:59:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=55TD=PW=cloud.com=edwin.torok@srs-se1.protection.inumbo.net>)
 id 1shUoo-00084L-In
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 13:59:10 +0000
Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com
 [2001:4860:4864:20::29])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dd3a565c-6157-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 15:59:08 +0200 (CEST)
Received: by mail-oa1-x29.google.com with SMTP id
 586e51a60fabf-27026393c12so1519902fac.2
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 06:59:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dd3a565c-6157-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724421547; x=1725026347; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=WoZT566OMXmGylD3QDslmApKLQ9eizOF1q0oHbQsETo=;
        b=W5ZSN66lOaRQREHfkvA5F+bM8EqTK2GIUoSNTbmBhdEzkSY1f0QdieS0NDKn2v9OEL
         j2/vao38aFLFGEZVgCiA2EexJAEIsgLj9tRiGu+T8HmZ+yDwf4a6r4QL091QLoplcbuv
         bmUMyZNeyoS9MpLJtti8/TG8AKXJW93hshrlI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724421547; x=1725026347;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=WoZT566OMXmGylD3QDslmApKLQ9eizOF1q0oHbQsETo=;
        b=Re4NPV2KutUKvO6C69xqYudbr0j5LfRRItPg+4pigDJXDBXrUHUHkc59Uv96sbkDlQ
         j2Nh/dDJ7KVBFOe8OQpmTlvoAA6hShAQPGptRo70dLoOVyVx6ogZEfJ/So3Atf9pDQhn
         IJa+7k+oUZWdPlSdIda0vCMbJ2fecFB7fUN+V9OomLZstSGpxEQRhz3aXpWiRWWuFhIg
         itfvhqvM5u3FBaGoVpRYD7wihXMaDRbOyqJ2jUkI/APia2IlDijW1xQVszbwgHlLBXaP
         MO6bgNhZiJ8NSaRDgPRe5JehAhl2F8vG+lqg/72mE5cobxFuBkO3WyEfyYq0DNdT4ZQP
         h9UQ==
X-Forwarded-Encrypted: i=1; AJvYcCVWhAp4FcHe4xSYvaYF3ayBc0M3ha57eNNHoyK9I4aB6f+pU5DbmS8qgM6RlBhWpNg85AxLctKFG3Q=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyHW/NIny43vp+stXYhTPgQbiUhh3x1wXkiMXwa/GRKHvrZjwHr
	RXa4XiMDgP95VTA2qn5JCUeHSpctRHTKIa2FiON6t4TzJpxzfAdmRiBkWO0USwzC6rQzMubWyho
	+wkkcRPpz5oLBaqI0PCs2iYCEWy8xAKrFZNNcdQ==
X-Google-Smtp-Source: AGHT+IG1jKR0CKNpyIYN7ZjVM3zqpwRmo2FAurJArwReuQn3xeMG1OYYAM+SxN43bzhnPGoE025KTywKBAVyCjZmW9E=
X-Received: by 2002:a05:6870:a90c:b0:261:17e7:59b3 with SMTP id
 586e51a60fabf-273e63f21dbmr2763467fac.3.1724421546769; Fri, 23 Aug 2024
 06:59:06 -0700 (PDT)
MIME-Version: 1.0
References: <20240823105157.991275-1-andrew.cooper3@citrix.com> <55A27B23-1CD1-4123-8F16-793E0966CA49@cloud.com>
In-Reply-To: <55A27B23-1CD1-4123-8F16-793E0966CA49@cloud.com>
From: Edwin Torok <edwin.torok@cloud.com>
Date: Fri, 23 Aug 2024 14:58:55 +0100
Message-ID: <CAEfZLv=9OhpX8bTf5KBeePKkAeF-JwzzNMxJE5+7N+FuJBb1=A@mail.gmail.com>
Subject: Re: [PATCH 0/3] tools/ocaml: Incremental build fixes
To: Christian Lindig <christian.lindig@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Xen-devel <xen-devel@lists.xenproject.org>, 
	Christian Lindig <christian.lindig@citrix.com>, David Scott <dave@recoil.org>, 
	Rob Hoes <Rob.Hoes@citrix.com>, Andrii Sultanov <andrii.sultanov@cloud.com>, 
	Anthony PERARD <anthony.perard@vates.tech>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

The Makefile changes look fine to me as well.

Reviewed-by: Edwin T=C3=B6r=C3=B6k <edwin.torok@cloud.com>

On Fri, Aug 23, 2024 at 11:53=E2=80=AFAM Christian Lindig
<christian.lindig@cloud.com> wrote:
>
>
>
> > On 23 Aug 2024, at 11:51, Andrew Cooper <andrew.cooper3@citrix.com> wro=
te:
> >
> > Various extra build bugfixes found while reviewing the `Stabilize Oxens=
tored's
> > interface with` series.
> >
> > Andrew Cooper (3):
> >  tools/ocaml: Drop OCAMLOPTFLAG_G invocation
> >  tools/ocaml: Drop o=3D rune
> >  tools/ocaml: Fix the version embedded in META files
> >
> > tools/ocaml/Makefile.rules | 5 +++--
> > tools/ocaml/common.make    | 7 ++-----
> > 2 files changed, 5 insertions(+), 7 deletions(-)
> >
> >
> > base-commit: 5231765a4e6528a3208e49885b9eeff42519a6c1
> > --
> > 2.39.2
> >
>
> Acked-by: Christian Lindig <christian.lindig@cloud.com>
>


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 14:41:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 14:41:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782392.1191877 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shVTG-0007ii-RK; Fri, 23 Aug 2024 14:40:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782392.1191877; Fri, 23 Aug 2024 14:40:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shVTG-0007ib-OP; Fri, 23 Aug 2024 14:40:58 +0000
Received: by outflank-mailman (input) for mailman id 782392;
 Fri, 23 Aug 2024 14:40:57 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Xt9W=PW=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1shVTF-0007iV-6j
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 14:40:57 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on20625.outbound.protection.outlook.com
 [2a01:111:f403:2417::625])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b329c3e1-615d-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 16:40:54 +0200 (CEST)
Received: from BN9PR03CA0416.namprd03.prod.outlook.com (2603:10b6:408:111::31)
 by DS0PR12MB8477.namprd12.prod.outlook.com (2603:10b6:8:15b::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Fri, 23 Aug
 2024 14:40:50 +0000
Received: from BN3PEPF0000B06C.namprd21.prod.outlook.com
 (2603:10b6:408:111:cafe::ee) by BN9PR03CA0416.outlook.office365.com
 (2603:10b6:408:111::31) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.16 via Frontend
 Transport; Fri, 23 Aug 2024 14:40:50 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 BN3PEPF0000B06C.mail.protection.outlook.com (10.167.243.71) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.4 via Frontend Transport; Fri, 23 Aug 2024 14:40:50 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 09:40:49 -0500
Received: from [172.22.205.25] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Fri, 23 Aug 2024 09:40:49 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b329c3e1-615d-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Bxg6uinkXE41OQXLyElJufHxwMcWq84co5Dlk8GnDtEc48OxW45OOL5qYepQUCZ0rqT0k11Z6Z0u1kqzScRr08R2SkajhiZ+ZxUey9BppDHIX5752+7BP6g/nSwcGQbc/nk6BNSuRGF18VVLmE+Ef4OGgOeFRLCvVtXQlQvU7NtcOj2Ts6iG9PftNuTaQbVtcvdvUCDbUsSAAlvjWQy7px5VFgaq8JigV7lv1ID3iKJtlzOq2V276GQgpFIWMl2gv415Sve2301abgvlB98zdp6X4tEX0f5TWoe+1Rt9RPfYMQ1sIuRo5L4vpm7lJh1wSUa6Hrd6TcyneOsrK3+CDw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Bzw4QZPEdg8C27i8Oyu3omeaQNrlZDb2Q1elQN1jYSs=;
 b=EWrkjn0GsPv0D2gqIDqhN8P16pourBbxCUiPAVCOD4xqob5IvNi4KzKWlQZVvdVSA1HIP7Q469WbB64r4ky2Ui8axmbVoDjE5x9fG6LvOND+gxkKj/VmYpI4RP1/1xuaTv+nFzXFW5+3PqEH1IsdRwITGeXBkv4H8kXv2kxYuzkPuIADSmDz3IQXbAFFq9gHpAdEHXxYSlYm0kbFPiNXAkZsG4B4Aho1lo96XwyQC72ihCLg+1Gq4NySDtEB8+Xj/S/BcmmSfMM6IIJWylEjjUjonvqKo37YB/7PUGuD+YkU6XL2tTxNab77+zAlXENykR1/auBhWlz5HXUzAzPk5A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=citrix.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Bzw4QZPEdg8C27i8Oyu3omeaQNrlZDb2Q1elQN1jYSs=;
 b=O70uAKPZHajJ4n/HCKtgKILl7Al27Yr+X9Hw2Ch4jWzpgBTnJvPcHUcxU0A2gYFfxrKHQsfbjF6JEXZZblrZRA8IUyM1ii+dO/eb4igcRdWUNCzZiRHqc9wd53ZIFIJqKxPqqBYc+fLkEZCjSh+2e8k5rRh3f5XnnVCQWnEMcIY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <c836fee8-ed53-4546-b2c6-4a0c9264f0ea@amd.com>
Date: Fri, 23 Aug 2024 10:40:50 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/boot: Preserve the value clobbered by the
 load-base calculation
To: Andrew Cooper <andrew.cooper3@citrix.com>, Xen-devel
	<xen-devel@lists.xenproject.org>
CC: Frediano Ziglio <frediano.ziglio@cloud.com>, Jan Beulich
	<JBeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <20240823131029.1025984-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jason Andryuk <jason.andryuk@amd.com>
In-Reply-To: <20240823131029.1025984-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB03.amd.com: jason.andryuk@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06C:EE_|DS0PR12MB8477:EE_
X-MS-Office365-Filtering-Correlation-Id: ee06cad4-efaf-4584-eaf8-08dcc3819563
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?WEkydnJ6aFdienN6WWVrYTEwdE1oQ0oycFFsKzlFMFFuQXduTXZJV0NjNktW?=
 =?utf-8?B?UnlJYWd5dzUwVURKUXEzazRxTUpNYnkwSmZJY3ZLbkpCK2xmbVdTeXdxZTRp?=
 =?utf-8?B?bFZuV2w0UjZRVWNjTnlXT0RDcURSdlNpei9TUVZ1cDdQVmZ5cVJKQWlaaW1U?=
 =?utf-8?B?dlk0VHVUK2RWcnJIc242bzRYVnFkQ1NuNUs4V3dJSGJhc0dxRDFVU3c3LzRm?=
 =?utf-8?B?NTg2Qi9HUHRabk5sWEhnSlNxdWNtYjc2bThCdTVjMThsangxcjBVc0pmak14?=
 =?utf-8?B?RWwwQ3F3RjRtblJqNjhHaFVVZzFJZ3VrZkhPelRwR3d0YTZjejZRNGZTaTBZ?=
 =?utf-8?B?eElhTmZSVGxCMHNCWk9xTlAzSDZ5U1NKZ2hyT3ArRzVBaFUxYVNMTWJZVXAv?=
 =?utf-8?B?blpZQlQ4Q1lPazN5em9aN3dwYktkc1llMm1tVDk2SU8yb2R1T3VUZ045MXF6?=
 =?utf-8?B?a3VESHNJaTVrUnB6OEFXeDI3bVVoSm9jd3JGVTZjM2JwQUoyWm13blA4MzJD?=
 =?utf-8?B?ZktoMCt1cWg1UFNMRUtUcHBPbXJvNFRtNU5hbTI3Y0poTFh1MGx1Q1lrRVI0?=
 =?utf-8?B?eTQwTURQakxJZTJMNTFBUjhnSG1oMXlIU0crQzVKYmJJM2VYRGs4emFIYk0v?=
 =?utf-8?B?RXp2aU5uSGE0azZZNkRiaWp4ZFEvSGR1SlEvSm8xRC9uMWtNY1hFVXcvWnpW?=
 =?utf-8?B?Q24zODU5aUI5anhKSkx3RlVwLytkOFppS2EvSUtRa1NwT0NTRTVHeGlBSTJ0?=
 =?utf-8?B?WmpLTGR1MWo0RjE2NnVmT2J1bUI1U3pQMWpSOThKQU1od29CTDN4bWxjamZI?=
 =?utf-8?B?Z2JIZEYzdzZFWWhqaUM3UHkwdU0xdS9Cd0Jjd2JtM01MYVNZUW5nM21UYXBI?=
 =?utf-8?B?K3JHelk1QzVjVk8vTWhLQklEK2JRKy9OYVgyZGtvQzF6UGNZREFZLzA5V0Iz?=
 =?utf-8?B?MnNFclJzb3JDOU1TNHkzZTNuRXFVOURXTHlyQ2xObk5Pc0htTjFlSHgrTHU5?=
 =?utf-8?B?TGtJV0VaVTJLa016WlROOVNDTFBDUGxpejI2M2x2dG5rRkl2b2tiN3FobnVm?=
 =?utf-8?B?NFRuTlVEWFA3RHo5anU2aG5yaU9lR3ByRXBrZkZZU0xCc2FYMWdzUmdESUsr?=
 =?utf-8?B?cHFxeWUxcXVFamNVd2J3cmFxOUFsTVFhbzZ2ZEk2K05mNW1pcE93dlFrWFBH?=
 =?utf-8?B?NnRCekxJWDhPQW80MFlZT0V3b0l4OWFjczJJcDFhM0E5S0p1TlJPQjBsM1ZZ?=
 =?utf-8?B?aW9KdVNxWGFmTDFxUE1pdzh2S1hjZFl0eWNRZThTNDVhR0pSaE5aZ2NUemhJ?=
 =?utf-8?B?Si9sQkpKY1hndi84RmV6aWFNTFBCbmdqUDNIdzhhS2xzNlNXYkloTmRCTSsz?=
 =?utf-8?B?NE8zQzAyMk0wM2w0MURwZEdwT1FMTExYZDB2b0VUQS9xSEw4YWxxc1NEZW1t?=
 =?utf-8?B?UkU2aGJtRTNDWG9rWDlqRW1kb3FUZTJXYTJteVRKc1JzNnR4cXpGVGcwejFC?=
 =?utf-8?B?YjJaN2dKa0M5M0gwWnFwOUE3T3VuVS9xWEl0ZmtLaWtHSFJEam5pYmNXVG5O?=
 =?utf-8?B?S0I4b3VKVmxMWXRNU29DZlh6QU5XM3F6SGl2ODZlV21kem8rVGk3MEdDc0x5?=
 =?utf-8?B?OVk1NGE5cXUrSjZ0WGhxeFFHcmo2aWNpN3lCS3F5Qks3WlBRS0dHZU45aUtw?=
 =?utf-8?B?eTJDT3JteWZaK1lJTktQdktRa0laSHdVNjdoRGtKZnlkOE0zUlYwQnBmTjAv?=
 =?utf-8?B?WVZQV2g3bVJEbHhHVk82dUFYbHJucS9Xek9qUE8xUEVUZzFpbnFZVkIreUVC?=
 =?utf-8?B?bHZUaXQ2THRnY0N1UXhacm9SSEZHdUZ5SnFodWhrdXUvQnRHcDhmdWdLNHRF?=
 =?utf-8?B?WEkrOHBKQkRaeUZyeHpnL1V6cGRsL2ZlUFhsQ0MvS1pzRkZDekxMRkVkT3Bh?=
 =?utf-8?Q?kZS2HSlronDCWe63go6TfuTojqUY4KDm?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 14:40:50.3693
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ee06cad4-efaf-4584-eaf8-08dcc3819563
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN3PEPF0000B06C.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8477

On 2024-08-23 09:10, Andrew Cooper wrote:
> From: Frediano Ziglio <frediano.ziglio@cloud.com>
> 
> Right now, Xen clobbers the value at 0xffc when performing it's load-base
> calculation.  We've got plenty of free registers at this point, so the value
> can be preserved easily.
> 
> This fixes a real bug booting under Coreboot+SeaBIOS, where 0xffc happens to
> be the cbmem pointer (e.g. Coreboot's dmesg ring, among other things).
> 
> However, there's also a better choice of memory location to use than 0xffc, as
> all our supported boot protocols have a pointer to an info structure in %ebx.
> 
> Update the documentation to match.
> 
> Fixes: 1695e53851e5 ("x86/boot: Fix the boot time relocation calculations")
> Fixes: d96bb172e8c9 ("x86/entry: Early PVH boot code")
> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 15:08:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 15:08:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782406.1191893 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shVtw-0003nn-Vx; Fri, 23 Aug 2024 15:08:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782406.1191893; Fri, 23 Aug 2024 15:08:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shVtw-0003ng-T6; Fri, 23 Aug 2024 15:08:32 +0000
Received: by outflank-mailman (input) for mailman id 782406;
 Fri, 23 Aug 2024 15:08: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=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shVtv-0003na-Bk
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 15:08:31 +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 8e1ba1e0-6161-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 17:08:29 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5bed83487aeso2370987a12.2
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 08:08:29 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c044ddbf0fsm2179464a12.15.2024.08.23.08.08.27
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 23 Aug 2024 08:08:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8e1ba1e0-6161-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724425709; x=1725030509; 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=VT7svKsPUSrkaGv1sbHwS5D8HHM82C4ULQJ5gPv1TjA=;
        b=ZCG/2+8nteSD+YUTZqiEl33BmVAjtmRQVR/FagUEbrT4IAvdJRCC7MqnGu77KijxtZ
         YGBinz8dQqXztTqHHOfc1MdFMTw4hfKAM5Od5EXi2SkDdK6wS7Li8eXiPK8lNlx1U0qv
         Tmkrkn9Amz77lLufG++i23cmy9ym8XMhbCWCk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724425709; x=1725030509;
        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=VT7svKsPUSrkaGv1sbHwS5D8HHM82C4ULQJ5gPv1TjA=;
        b=kYLrQQz3a+csHKLifPOm01uC0Q8tEptf5/HPzz3TiH6xI3ey3D2ofvMSWUd1YUV2bf
         8+E9eqTSQcSCn5B2SNTsAiwbcEfnoRgHRgrfD1jnPvYa+2i1uVATp8ubh5i1Y+xlntkW
         Qe6PMHRz7FHlADXj8SNjV5EhbukKsoDqFBpxYXOPo3maNs0T3RIx4RVIrbd9sZoWrtye
         1c1WTxgfLa44+VGbR4eLL3sBV0joM2BG1oza4YHvsPsp87Sk4nIfflerV8dXoBgUTZ+1
         T/kOBj4rE0prkaWPVjdpcqctwGEi90+RHiXhLQ/OzF6fbs5Vkj9EDp8E2YjiBjWBdpxs
         GxLw==
X-Forwarded-Encrypted: i=1; AJvYcCUAyxCy1lvTXO/oRAOfSn96pBgwsKTLv2EqUSkIURBixokHcK2z90UpPVnGEM1ood8Tn7a7bpfE1BI=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yxqqm1ZKCmDxwI8XHXbX087tiw4tPc4p93iTwjikcDfFwhgzt52
	FML6VblTEBPAfxhWZuToUHO8201sn+N9a6KuiC6A6/rDyU08ogwiCsmEaXscE6U=
X-Google-Smtp-Source: AGHT+IEzN/+Q0Dvka9xERUVQsDduYfqJOG0E8V7rAnW2s76SP9XujhdwanbGlqwjpt/r8IjpcXvVvQ==
X-Received: by 2002:a50:cb86:0:b0:5be:f1a7:c2cd with SMTP id 4fb4d7f45d1cf-5c0891afa15mr1510764a12.31.1724425708771;
        Fri, 23 Aug 2024 08:08:28 -0700 (PDT)
Message-ID: <4d88b5d1-592e-4756-b093-6cbf1ca08948@citrix.com>
Date: Fri, 23 Aug 2024 16:08:26 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/9] x86emul/test: rename "cp"
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>
References: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
 <fb9e2081-16d5-4dc4-92f5-fb55f313304b@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <fb9e2081-16d5-4dc4-92f5-fb55f313304b@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 14/08/2024 9:51 am, Jan Beulich wrote:
> In preparation of introducing a const struct cpu_policy * local in
> x86_emulate(), rename that global variable to something more suitable:
> "cp" is our commonly used name for function parameters or local
> variables of type struct cpu_policy *, and the present name of the
> global could hence have interfered already.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> v2: Re-base over dropping of Xeon Phi support.

Bah - still need to reinstate part of that patch.  The model numbers
need to stay.  /me adds it to the todo list.

For this patch, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>,
with one request for this patch a couple of thoughts for separate patches.

> --- a/tools/tests/x86_emulator/x86-emulate.h
> +++ b/tools/tests/x86_emulator/x86-emulate.h
> @@ -123,7 +123,7 @@ static inline uint64_t xgetbv(uint32_t x
>  }
>  
>  /* Intentionally checking OSXSAVE here. */
> -#define cpu_has_xsave     (cp.basic.raw[1].c & (1u << 27))
> +#define cpu_has_xsave     (cpu_policy.basic.raw[1].c & (1u << 27))

Right now we deliberately don't emit names for APIC, OSXSAVE and OSPKE,
because the values won't be correct in a guest's policy.  But this is a
legitimate corner case.

What about this?

diff --git a/xen/tools/gen-cpuid.py b/xen/tools/gen-cpuid.py
index 601eec608983..1b56958f07e7 100755
--- a/xen/tools/gen-cpuid.py
+++ b/xen/tools/gen-cpuid.py
@@ -382,10 +382,11 @@ def crunch_numbers(state):
             if name and name[0] in "0123456789":
                 name = "_" + name
 
-            # Don't generate names for features fast-forwarded from other
-            # state
+            # For dynamic features (fast forwarded from other state), also
+            # prefix with an underscore to highlight that extra care
needs to
+            # be taken.
             if name in ("APIC", "OSXSAVE", "OSPKE"):
-                name = ""
+                name = "_" + name
 
             names.append(name.lower())
 
which would make the expression become cpu_policy.basic._osxsave and
avoid the opencoded number.

> @@ -133,63 +133,63 @@ static inline bool xcr0_mask(uint64_t ma
>  unsigned int rdpkru(void);
>  void wrpkru(unsigned int val);
>  
> -#define cache_line_size() (cp.basic.clflush_size * 8)
> -#define cpu_has_fpu        cp.basic.fpu
> -#define cpu_has_mmx        cp.basic.mmx
> -#define cpu_has_fxsr       cp.basic.fxsr
> -#define cpu_has_sse        cp.basic.sse
> -#define cpu_has_sse2       cp.basic.sse2
> -#define cpu_has_sse3       cp.basic.sse3
> -#define cpu_has_pclmulqdq  cp.basic.pclmulqdq
> -#define cpu_has_ssse3      cp.basic.ssse3
> -#define cpu_has_fma       (cp.basic.fma && xcr0_mask(6))
> -#define cpu_has_sse4_1     cp.basic.sse4_1
> -#define cpu_has_sse4_2     cp.basic.sse4_2
> -#define cpu_has_popcnt     cp.basic.popcnt
> -#define cpu_has_aesni      cp.basic.aesni
> -#define cpu_has_avx       (cp.basic.avx  && xcr0_mask(6))
> -#define cpu_has_f16c      (cp.basic.f16c && xcr0_mask(6))
> -
> -#define cpu_has_avx2      (cp.feat.avx2 && xcr0_mask(6))
> -#define cpu_has_bmi1       cp.feat.bmi1
> -#define cpu_has_bmi2       cp.feat.bmi2
> -#define cpu_has_avx512f   (cp.feat.avx512f  && xcr0_mask(0xe6))
> -#define cpu_has_avx512dq  (cp.feat.avx512dq && xcr0_mask(0xe6))
> -#define cpu_has_avx512_ifma (cp.feat.avx512_ifma && xcr0_mask(0xe6))
> -#define cpu_has_avx512cd  (cp.feat.avx512cd && xcr0_mask(0xe6))
> -#define cpu_has_sha        cp.feat.sha
> -#define cpu_has_avx512bw  (cp.feat.avx512bw && xcr0_mask(0xe6))
> -#define cpu_has_avx512vl  (cp.feat.avx512vl && xcr0_mask(0xe6))
> -#define cpu_has_avx512_vbmi (cp.feat.avx512_vbmi && xcr0_mask(0xe6))
> -#define cpu_has_avx512_vbmi2 (cp.feat.avx512_vbmi2 && xcr0_mask(0xe6))
> -#define cpu_has_gfni       cp.feat.gfni
> -#define cpu_has_vaes      (cp.feat.vaes && xcr0_mask(6))
> -#define cpu_has_vpclmulqdq (cp.feat.vpclmulqdq && xcr0_mask(6))
> -#define cpu_has_avx512_vnni (cp.feat.avx512_vnni && xcr0_mask(0xe6))
> -#define cpu_has_avx512_bitalg (cp.feat.avx512_bitalg && xcr0_mask(0xe6))
> -#define cpu_has_avx512_vpopcntdq (cp.feat.avx512_vpopcntdq && xcr0_mask(0xe6))
> -#define cpu_has_movdiri    cp.feat.movdiri
> -#define cpu_has_movdir64b  cp.feat.movdir64b
> -#define cpu_has_avx512_vp2intersect (cp.feat.avx512_vp2intersect && xcr0_mask(0xe6))
> -#define cpu_has_serialize  cp.feat.serialize
> -#define cpu_has_avx512_fp16 (cp.feat.avx512_fp16 && xcr0_mask(0xe6))
> -#define cpu_has_sha512     (cp.feat.sha512 && xcr0_mask(6))
> -#define cpu_has_sm3        (cp.feat.sm3 && xcr0_mask(6))
> -#define cpu_has_sm4        (cp.feat.sm4 && xcr0_mask(6))
> -#define cpu_has_avx_vnni   (cp.feat.avx_vnni && xcr0_mask(6))
> -#define cpu_has_avx512_bf16 (cp.feat.avx512_bf16 && xcr0_mask(0xe6))
> -#define cpu_has_avx_ifma   (cp.feat.avx_ifma && xcr0_mask(6))
> -#define cpu_has_avx_vnni_int8 (cp.feat.avx_vnni_int8 && xcr0_mask(6))
> -#define cpu_has_avx_ne_convert (cp.feat.avx_ne_convert && xcr0_mask(6))
> -#define cpu_has_avx_vnni_int16 (cp.feat.avx_vnni_int16 && xcr0_mask(6))

Can we take the opportunity to realign these vertically?

Also, we have X86_XCR0_* constants in a helpful place now.  Could we do
something like:

#define XCR0_AVX xcr0_mask(X86_XCR0_YMM | X86_XCR0_SSE)
#define XCR0_AVX512 ...

So that these expressions now read

#define cpu_has_$X (... && XCR0_AVX)

rather than forcing the reader to know %xcr0 by raw hex?

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 15:12:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 15:12:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782413.1191903 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shVy3-0005H4-Fd; Fri, 23 Aug 2024 15:12:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782413.1191903; Fri, 23 Aug 2024 15:12:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shVy3-0005Gx-Ce; Fri, 23 Aug 2024 15:12:47 +0000
Received: by outflank-mailman (input) for mailman id 782413;
 Fri, 23 Aug 2024 15:12:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shVy1-0005Gr-Pk
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 15:12:45 +0000
Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com
 [2a00:1450:4864:20::22b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 26561a18-6162-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 17:12:45 +0200 (CEST)
Received: by mail-lj1-x22b.google.com with SMTP id
 38308e7fff4ca-2f4f2868783so13347241fa.2
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 08:12:45 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a3ed39fsm2180021a12.57.2024.08.23.08.12.42
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 23 Aug 2024 08:12:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 26561a18-6162-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724425964; x=1725030764; 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=EkoQnZS2YC6mNm96EbocF5tiYnSuvt4Q+WKqYcrvreI=;
        b=l6lvZ7l5QkA3z8G95qETsH5P04rOmOX4v+ci3lZGtJ8c/I4xotd1ARODq1qj9Ea4m7
         bJew9DwFmDVycv9/gutlWEM1WOkWHuBF6zm+GXdWjlm+bGAlcY7G2LznfW3b+gQmQUls
         8fh3yh7LOa7hSpNsBwccu0B/wqVuAEwiutIGo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724425964; x=1725030764;
        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=EkoQnZS2YC6mNm96EbocF5tiYnSuvt4Q+WKqYcrvreI=;
        b=WyCScA2xwoD3KeT0tw1ax5VAUMrrOdCfsO9B/ShSW6SdqJR7bU02aINJnPa5IimGFx
         gV8McFFw0bYZOxGN6Et4cG4CnS/IcsIVjpZrmDPooD/OqdEZjajdrnzvz0OcJTcPUn34
         dS7wvAj66VXOTZowRwgugFAm0bGvkTXJQpv4VLEO2KhuCI3NooIfRoetdBUn0JoJFY99
         eGa8kehohzygjNrplDJeR0OhO4HXQh3ala1aBRI/juEVZP7WDCBx1yjnjGNTMu/wflhH
         8wSM5hgBcz2OpEQi6BYdqxhLggXdGfbnveOMQcOill+9Dbda75XNXa9wj1gmxqVYs7Vo
         tVQA==
X-Forwarded-Encrypted: i=1; AJvYcCW973On1R6KRPWgh0zdFv25ALITGhwrY6YW03jVX7oOXgioa3gLfTe1pMUh5t+teUIjksPrFKCvEv4=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy1GOqeVThpz6S2XhKpliOeycsXrpPyqYUO7mjYsoBYPeL96K6s
	mkyIsmXAh6hc0kSms1o3aKPidznaSjZeag58thM1u5tuXlNux+ZbZI2io3qcCrU=
X-Google-Smtp-Source: AGHT+IHI/UX1j3YyXpMb7lfqMXyN4h7Sy0NADUTUdjar8SwfSJhvve3DquATGPQd7yIQEdhHSvJ5vA==
X-Received: by 2002:a2e:be21:0:b0:2f3:e7cb:ee37 with SMTP id 38308e7fff4ca-2f4f48f0d4fmr18442941fa.8.1724425963818;
        Fri, 23 Aug 2024 08:12:43 -0700 (PDT)
Message-ID: <e39f7301-e941-493d-8d1e-50fda9841159@citrix.com>
Date: Fri, 23 Aug 2024 16:12:40 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 3/9] x86emul: introduce a struct cpu_policy * local in
 x86_emulate()
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>
References: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
 <f6b15171-a49e-4d85-a605-8770077249d7@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <f6b15171-a49e-4d85-a605-8770077249d7@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 14/08/2024 9:52 am, Jan Beulich wrote:
> While of little effect right here, future patches (AVX10, AMX,
> KeyLocker) will benefit more significantly.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 15:35:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 15:35:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782425.1191913 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shWKI-0000qa-4l; Fri, 23 Aug 2024 15:35:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782425.1191913; Fri, 23 Aug 2024 15:35:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shWKI-0000qT-26; Fri, 23 Aug 2024 15:35:46 +0000
Received: by outflank-mailman (input) for mailman id 782425;
 Fri, 23 Aug 2024 15:35: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=9RGR=PW=bugseng.com=nicola.vetrini@srs-se1.protection.inumbo.net>)
 id 1shWKG-0000qN-6N
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 15:35:44 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5b7e4b52-6165-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 17:35:43 +0200 (CEST)
Received: from support.bugseng.com (support.bugseng.com [162.55.131.47])
 by support.bugseng.com (Postfix) with ESMTPA id 180BA4EE0798;
 Fri, 23 Aug 2024 17:35:42 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5b7e4b52-6165-11ef-a50a-bb4a2ccca743
MIME-Version: 1.0
Date: Fri, 23 Aug 2024 17:35:42 +0200
From: Nicola Vetrini <nicola.vetrini@bugseng.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, Jan Beulich
 <JBeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Subject: Re: [PATCH 9/9] x86/bitops: Use the POPCNT instruction when available
In-Reply-To: <20240822230635.954557-10-andrew.cooper3@citrix.com>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-10-andrew.cooper3@citrix.com>
Message-ID: <e303115f11e70fbb5c290cf29e65159d@bugseng.com>
X-Sender: nicola.vetrini@bugseng.com
Organization: BUGSENG s.r.l.
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: 8bit

On 2024-08-23 01:06, Andrew Cooper wrote:
> It has existed in x86 CPUs since 2008, so we're only 16 years late 
> adding
> support.  With all the other scafolding in place, implement 
> arch_hweightl()
> for x86.
> 
> The only complication is that the call to arch_generic_hweightl() is 
> behind
> the compilers back.  Address this by writing it in ASM and ensure that 
> it
> preserves all registers.
> 
> Copy the code generation from generic_hweightl().  It's not a 
> complicated
> algorithm, and is easy to regenerate if needs be, but cover it with the 
> same
> unit tests as test_generic_hweightl() just for piece of mind.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> 
> A few RFC points.
> 
>  * I throught we had an x86 general lib-y but I can't find one, hence 
> why it's
>    still in xen/lib/ for now.
> 
>  * When we up the minimum toolchain to GCC 7 / Clang 5, we can use a
>    __attribute__((no_caller_saved_registers)) and can forgo writing 
> this in asm.
> 
>    GCC seems to need extra help, and wants -mgeneral-regs-only too.  It 
> has a
>    habit of complaining about incompatible instructions even when it's 
> not
>    emitting them.
> ---

> diff --git a/xen/lib/arch-generic-hweightl.S 
> b/xen/lib/arch-generic-hweightl.S
> new file mode 100644
> index 000000000000..15c6e3394845
> --- /dev/null
> +++ b/xen/lib/arch-generic-hweightl.S
> @@ -0,0 +1,46 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +        .file __FILE__
> +
> +#include <xen/linkage.h>
> +
> +/*
> + * An implementation of generic_hweightl() used on hardware without 
> the POPCNT
> + * instruction.
> + *
> + * This function is called from within an ALTERNATIVE in 
> arch_hweightl().
> + * i.e. behind the back of the compiler.  Therefore all registers are 
> callee
> + * preserved.
> + *
> + * The ASM is what GCC-12 emits for generic_hweightl() in a release 
> build of
> + * Xen, with spilling of %rdi/%rdx to preserve the callers registers.
> + */
> +FUNC(arch_generic_hweightl)
> +        push   %rdi
> +        push   %rdx
> +
> +        movabs $0x5555555555555555, %rdx
> +        mov    %rdi, %rax
> +        shr    $1, %rax
> +        and    %rdx, %rax
> +        sub    %rax, %rdi
> +        movabs $0x3333333333333333, %rax
> +        mov    %rdi, %rdx
> +        shr    $0x2, %rdi
> +        and    %rax, %rdx
> +        and    %rax, %rdi
> +        add    %rdi, %rdx
> +        mov    %rdx, %rax
> +        shr    $0x4, %rax
> +        add    %rdx, %rax
> +        movabs $0xf0f0f0f0f0f0f0f, %rdx
> +        and    %rdx, %rax
> +        movabs $0x101010101010101, %rdx
> +        imul   %rdx, %rax
> +        shr    $0x38, %rax
> +
> +        pop    %rdx
> +        pop    %rdi
> +
> +        ret
> +END(arch_generic_hweightl)
> diff --git a/xen/lib/generic-hweightl.c b/xen/lib/generic-hweightl.c
> index fa4bbec273ab..4b39dd84de5e 100644
> --- a/xen/lib/generic-hweightl.c
> +++ b/xen/lib/generic-hweightl.c
> @@ -43,4 +43,19 @@ static void __init __constructor 
> test_generic_hweightl(void)
>      RUNTIME_CHECK(generic_hweightl, 1 | (1UL << (BITS_PER_LONG - 1)), 
> 2);
>      RUNTIME_CHECK(generic_hweightl, -1UL, BITS_PER_LONG);
>  }
> +
> +#ifdef CONFIG_X86
> +unsigned int arch_generic_hweightl(unsigned long);

Hi Andrew,

do you mind putting a parameter name here, as the current form 
introduces a violation of MISRA Rule 8.2 [1] (even if unnecessary, given 
its implementation)?

Thanks,
  Nicola

[1] 
https://saas.eclairit.com:3787/fs/var/local/eclair/xen-project.ecdf/xen-project/patchew/xen/ECLAIR_normal/patchew/20240822230635.954557-1-andrew.cooper3@citrix.com/X86_64/7647484702/PROJECT.ecd;/by_service/MC3R1.R8.2.html

> +static void __init __constructor test_arch_generic_hweightl(void)
> +{
> +    RUNTIME_CHECK(arch_generic_hweightl, 0, 0);
> +    RUNTIME_CHECK(arch_generic_hweightl, 1, 1);
> +    RUNTIME_CHECK(arch_generic_hweightl, 3, 2);
> +    RUNTIME_CHECK(arch_generic_hweightl, 7, 3);
> +    RUNTIME_CHECK(arch_generic_hweightl, 0xff, 8);
> +
> +    RUNTIME_CHECK(arch_generic_hweightl, 1 | (1UL << (BITS_PER_LONG - 
> 1)), 2);
> +    RUNTIME_CHECK(arch_generic_hweightl, -1UL, BITS_PER_LONG);
> +}
> +#endif /* CONFIG_X86 */
>  #endif /* CONFIG_SELF_TESTS */

-- 
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 15:38:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 15:38:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782431.1191923 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shWMi-00023H-Ga; Fri, 23 Aug 2024 15:38:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782431.1191923; Fri, 23 Aug 2024 15:38:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shWMi-00023A-Dr; Fri, 23 Aug 2024 15:38:16 +0000
Received: by outflank-mailman (input) for mailman id 782431;
 Fri, 23 Aug 2024 15:38: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=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shWMi-000232-1P
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 15:38:16 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b5a6ec12-6165-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 17:38:14 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-a7b2dbd81e3so292967466b.1
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 08:38:14 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f299e28sm274219866b.56.2024.08.23.08.38.11
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 23 Aug 2024 08:38:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b5a6ec12-6165-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724427493; x=1725032293; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:cc:to:subject:user-agent:mime-version
         :date:message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=f+9wFlQ9TaBTKc8sbEXP5/boJkpprrwAkNQ/oaKNsFs=;
        b=I6v2YU0rHSHCLtf0Kq/v70MJ/uQnB6VvpkAzdhetx9p6AW5YmZ+96s2vew+WQQVOCJ
         xtDOYtpVWIrgpmehdfBZ7zt3pMkRT0/5xyOz2mPP7J9I7vLxEcCmmkHiSbbgCqMlSrS5
         AzSmRQned1IXnzduu1hBG0AauNzG3rWgo7390=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724427493; x=1725032293;
        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=f+9wFlQ9TaBTKc8sbEXP5/boJkpprrwAkNQ/oaKNsFs=;
        b=p91hfJVrEP0DQuDXiGUo83jPRG3sT5woxGigZBDHZsPkHxCxnN+xYR/PnXQ5UpyLCq
         mVyqf0yPPAjZm5cPfXWq8IxjuWpSr7/4MLPyi1rzcK0+qGoM7yh8dj2x9Ml5OaXXXnmw
         CzIkVCuNrH4JpZbqM6M3WlXgdIvjs0O3sw9ONhNTRU752vSnxHPm51kp612XP1ah1UpD
         qwLL9xilu98gpQ8IsITECp7/lAKrGRqgNcS4ebZZoozZa8Fs6tu3BOQxX5qp3Btla9bX
         C3ghEOCET9QQ3ZNRX69+MB9eaAmL+1xo10FSUgn5olDzUF6KyPY62+p/NyUIQEc1BK6L
         8R1Q==
X-Gm-Message-State: AOJu0Yze1aKFAmtGWr2td8ZL1fNEZFaRSQurcMddmjiMljGlD8clNzBt
	rrDjdNrklWJxSXBDfvvVkQz6BY6Zo6IihvAKz0UPMSAjp7aQ2inJjQLgpuXoesE=
X-Google-Smtp-Source: AGHT+IGdmx2we0hvr0KZc9TmFD0T0EFt/t/P2TSIp2bbdmhQC/m98Lt8CC0siUbJX1i3HcpAerGpgA==
X-Received: by 2002:a17:907:3f07:b0:a86:824c:2f72 with SMTP id a640c23a62f3a-a86a54cf72fmr149175166b.58.1724427493051;
        Fri, 23 Aug 2024 08:38:13 -0700 (PDT)
Message-ID: <7b56d922-ad79-466a-b07b-24253320ccf3@citrix.com>
Date: Fri, 23 Aug 2024 16:38:09 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 9/9] x86/bitops: Use the POPCNT instruction when available
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Jan Beulich <JBeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-10-andrew.cooper3@citrix.com>
 <e303115f11e70fbb5c290cf29e65159d@bugseng.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <e303115f11e70fbb5c290cf29e65159d@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 23/08/2024 4:35 pm, Nicola Vetrini wrote:
> On 2024-08-23 01:06, Andrew Cooper wrote:
>> diff --git a/xen/lib/generic-hweightl.c b/xen/lib/generic-hweightl.c
>> index fa4bbec273ab..4b39dd84de5e 100644
>> --- a/xen/lib/generic-hweightl.c
>> +++ b/xen/lib/generic-hweightl.c
>> @@ -43,4 +43,19 @@ static void __init __constructor
>> test_generic_hweightl(void)
>>      RUNTIME_CHECK(generic_hweightl, 1 | (1UL << (BITS_PER_LONG -
>> 1)), 2);
>>      RUNTIME_CHECK(generic_hweightl, -1UL, BITS_PER_LONG);
>>  }
>> +
>> +#ifdef CONFIG_X86
>> +unsigned int arch_generic_hweightl(unsigned long);
>
> Hi Andrew,
>
> do you mind putting a parameter name here, as the current form
> introduces a violation of MISRA Rule 8.2 [1] (even if unnecessary,
> given its implementation)?

Sorry.

I did run Eclair on this series during development, but this was a late
change and I forgot to re-check.

Fixed locally.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 16:31:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 16:31:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782450.1191946 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXCa-0003xf-KX; Fri, 23 Aug 2024 16:31:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782450.1191946; Fri, 23 Aug 2024 16:31:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXCa-0003xW-HS; Fri, 23 Aug 2024 16:31:52 +0000
Received: by outflank-mailman (input) for mailman id 782450;
 Fri, 23 Aug 2024 16:31:51 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4lC7=PW=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1shXCZ-0003wy-Cz
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 16:31:51 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20617.outbound.protection.outlook.com
 [2a01:111:f403:2416::617])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 320fd403-616d-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 18:31:49 +0200 (CEST)
Received: from DS7PR03CA0005.namprd03.prod.outlook.com (2603:10b6:5:3b8::10)
 by CH0PR12MB8507.namprd12.prod.outlook.com (2603:10b6:610:189::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Fri, 23 Aug
 2024 16:31:42 +0000
Received: from DS3PEPF0000C37A.namprd04.prod.outlook.com
 (2603:10b6:5:3b8:cafe::53) by DS7PR03CA0005.outlook.office365.com
 (2603:10b6:5:3b8::10) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend
 Transport; Fri, 23 Aug 2024 16:31:42 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 DS3PEPF0000C37A.mail.protection.outlook.com (10.167.23.4) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 16:31:42 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 11:31:41 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 11:31:41 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Fri, 23 Aug 2024 11:31:40 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 320fd403-616d-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=lQ4k1SLFw4OR+hAEQv1VLlhoG38JSAWdEWDYMipMNMOl8pbqvZdmRjVW6f82is2QPvtm0aSM3xYmFgXHAhNiRVxEedRI6zhN8kxgpt0HmlpJnsA0pSt9RdA32qr5vqTyBflepRtmX0ghYZyUQSiEtLD6mVfvAnpX+OR3v9ucK9ifxtBNs+2T4CQEtdM+3x8u4eWz3FfYQ+Ot3EP4P2hnYAoAwWbHbTLPsf2sL7LQHSXIUqc7rqdWP54OdRSwzz4Wn/M+p58dsJsgtzvAPq/1UENd33rJH0WNVX31O15XuaNQkM+78k1QC1TF91QyvriKaCgzuyyz7FOwAIcZnOkLLA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Nx/VzbkSyae2KVO1umnmm7DGWwCikaMWrTbOm87/DJ8=;
 b=PYmUhQ+VnfEE/IsznSkowyTVxjQEDqLEqxKcUJ8yzLcJ/pZBqsYrJdJhH2R9n9pGf9YEAS3f+kuoEADMGB+NPihvoeJfy9jGegNdtFivCjuMfOWGJtZUqKOMfh2w48RIEDIq5XA76DhIkZNYF0cgIQuf5PMUcKpAupztKxFL3YofadCEtwFHUQuVDJ1bgiXR0CX9A4OlhnahbI9a49SxSxWNOBHrNt2c2aWTOAFNOBNjEdRr50fq25QsumUkIoyDewZvap7xjhMJwX64vivf6Sm9Ulf3A829UrbRuNWic3DozqfcqyZGBPohqh8MlVyHNE8Xbl1f5leNheRt/DtVAw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Nx/VzbkSyae2KVO1umnmm7DGWwCikaMWrTbOm87/DJ8=;
 b=TJWvUDy+OU297FwLEEx/+TkAaZHb0CDhrmsBZjqJZCO6J7WUYzpOyGiHJqa+TCEgyqQPjXEQm3YxKY8md3RzDIB36w1fsZJQNb/bei7zMPijUYdhKNxT3IkYaGcu096paNc3bD7Au9kUZKex6bJiXygbwdeMReetZ15gad3pwV4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>
Subject: [PATCH v1 1/4] xen/arm: mpu: Introduce choice between MMU and MPU
Date: Fri, 23 Aug 2024 17:31:24 +0100
Message-ID: <20240823163127.3443404-2-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240823163127.3443404-1-ayan.kumar.halder@amd.com>
References: <20240823163127.3443404-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS3PEPF0000C37A:EE_|CH0PR12MB8507:EE_
X-MS-Office365-Filtering-Correlation-Id: 9087873e-ac76-4140-ea5d-08dcc3911219
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?UAGKY9as/WN1Hk7ZLEx2wGseKYrjp5r9iQWFJ9rxrWA32PqRNT6eFdV0j+Oc?=
 =?us-ascii?Q?rk9ebizPvSLWyMjdLI6kMjHcUz5S7MN+i9RQ+JDf3ykgaz+6/O73aB2OIGXh?=
 =?us-ascii?Q?j0dNkyG64py+WJOwdPJODkmi1g4klAosGtyr82cBdK4Dp6r1ntP3oV6AHKgL?=
 =?us-ascii?Q?NXmNx1EMjwIFdU0hDiCulJz4AOaC0qWLVeTtmTHt43zT/pY7PFazGZIsy+YZ?=
 =?us-ascii?Q?Sxk9vMasNdZZ060/k+xAi+O/SXXFt96Qw+MdFg9qNIYxysAWRK4mx8oTnn3R?=
 =?us-ascii?Q?xcwkoG0VNaZ1MPnMR92HHbr6P/osFjRGdhEaUfipbtKwid2Sl84j6jTKXCOj?=
 =?us-ascii?Q?yWVlNgLHaLh0YWPxUYURgDX5KSa9rIGywObPciNBKgEnac8Z/ssvjzD+bUBy?=
 =?us-ascii?Q?vuTvh+00bCVGpyaIS4eDKFzWU6RaWEq7r0iJKavh5uxhKzsVYHQvYyLuI0cf?=
 =?us-ascii?Q?81Q/b73ftPATKXdN1UliHC9LYohjr4TO9GEx5Al4GmW71YXeQu4BUNa1auvZ?=
 =?us-ascii?Q?gUbh5SzAolXMr7HX5rPu14H2IrIjvvZR+pugEHZyXb6/cAM6I5S+pGi/W/8w?=
 =?us-ascii?Q?oRwJtbUBrQLaa1Z/Wi+4vDzUJWUaYSAZazXP8xQTcitfpI4pf9IXBQhd1+Hg?=
 =?us-ascii?Q?ij3f/QKLMYpT5zioWg+WikOZLTPYlNQk3hQTqyyFTiEbiopakocAKS5+6Jkj?=
 =?us-ascii?Q?792qjciQErbUCwJgmQhwe1tw80WZ8hEhGa3JsWEIZ3i3v+n2h9E0raJEVtSj?=
 =?us-ascii?Q?SYzLhY+DdwtldHf+pg3AJBLSDGOdeRWNzyeaPj4QOukpKMhGT8gILoJPz2o4?=
 =?us-ascii?Q?z2ZNlfeCl6OGy/tv6nLK79CoyXvyjNmxNKgrD9f1k9/tns94O+Emp+m7zH6j?=
 =?us-ascii?Q?oKNTp4UOCIvlc+UGlURDL93atSpeo2TY7wmIopUIRNkL1tGuFMOfImyQiiNV?=
 =?us-ascii?Q?VqM923GyJThxOuLI6JainrDgMgfxIiEhCay/EuyBmKhCwl9nQ5RqLY0Z+IKG?=
 =?us-ascii?Q?Hg8AqhHgESJ82LLQ9zdCc8FCO1hq8foP7LpyrmIrhU5WhYujvX5eYmxzB/0S?=
 =?us-ascii?Q?NfY3wCz1Mq64fdiG/6zjyhJ02fiuVwWq2u5EQoYdPbT/uNx+B4kBO8NAiV0r?=
 =?us-ascii?Q?v/p6Rx6QJUum4zf/zdEYtWHEnuzxJhHGt/x8BnqaKf6aOPFBe8tTYzYhxCyu?=
 =?us-ascii?Q?DAYKRJ9mMHCxPOghu+thQlLdsBRcBotCCroVMKw3tYM90D5MJkGHgqajQXaa?=
 =?us-ascii?Q?ntKQfKpJghUmYilf81w0DQCrzGbrXaxsG8dz1PQtk5sWAtWsAvGliVhY1ESN?=
 =?us-ascii?Q?0fKQ4WsoIhe4fVb0PRvL0FX2F+oi+I61IE00qnoZkyW7cC+j+50WuqEczPvm?=
 =?us-ascii?Q?kbbtuee0bZAJ9INQvM12gJJUJbB0bDSVQbadEncgo6lhyravCeA5iV+4NBZO?=
 =?us-ascii?Q?IM83QP/nqwpvB17hbH1cQxzFp7eaCctK?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 16:31:42.0036
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 9087873e-ac76-4140-ea5d-08dcc3911219
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS3PEPF0000C37A.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB8507

There are features in the forthcoming patches which are dependent on
MPU. For eg fixed start address.
Also, some of the Xen features (eg STATIC_MEMORY) will be selected
by the MPU configuration.

Thus, this patch introduces a choice between MMU and MPU for the type
of memory management system. By default, MMU is selected.
All the current platforms are now made dependent on MMU.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
 xen/arch/arm/Kconfig           | 17 ++++++++++++++++-
 xen/arch/arm/platforms/Kconfig |  2 +-
 2 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 323c967361..686948cefd 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -58,10 +58,25 @@ config PADDR_BITS
 	default 40 if ARM_PA_BITS_40
 	default 48 if ARM_64
 
+choice
+	prompt "Memory management system"
+	default MMU if ARM
+	help
+	  User can choose between the different forms of memory management system.
+	  Most of the Arm based systems support MMU.
+
 config MMU
-	def_bool y
+	bool "MMU"
 	select HAS_PMAP
 	select HAS_VMAP
+	help
+	  Memory management unit is supported on most Arm based systems.
+
+config MPU
+	bool "MPU"
+	help
+	  Memory protection unit is supported on some Cortex-R systems.
+endchoice
 
 source "arch/Kconfig"
 
diff --git a/xen/arch/arm/platforms/Kconfig b/xen/arch/arm/platforms/Kconfig
index 76f7e76b1b..02322c259c 100644
--- a/xen/arch/arm/platforms/Kconfig
+++ b/xen/arch/arm/platforms/Kconfig
@@ -1,5 +1,5 @@
 choice
-	prompt "Platform Support"
+	prompt "Platform Support" if MMU
 	default ALL_PLAT
 	help
 	Choose which hardware platform to enable in Xen.
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 16:31:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 16:31:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782449.1191936 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXCO-0003gc-Ck; Fri, 23 Aug 2024 16:31:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782449.1191936; Fri, 23 Aug 2024 16:31:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXCO-0003gV-9g; Fri, 23 Aug 2024 16:31:40 +0000
Received: by outflank-mailman (input) for mailman id 782449;
 Fri, 23 Aug 2024 16:31:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4lC7=PW=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1shXCN-0003gP-EA
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 16:31:39 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on2062b.outbound.protection.outlook.com
 [2a01:111:f403:2416::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 29f774ce-616d-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 18:31:37 +0200 (CEST)
Received: from SJ0PR13CA0172.namprd13.prod.outlook.com (2603:10b6:a03:2c7::27)
 by DM4PR12MB8523.namprd12.prod.outlook.com (2603:10b6:8:18e::13) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Fri, 23 Aug
 2024 16:31:32 +0000
Received: from SJ1PEPF000023D2.namprd02.prod.outlook.com
 (2603:10b6:a03:2c7:cafe::54) by SJ0PR13CA0172.outlook.office365.com
 (2603:10b6:a03:2c7::27) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.11 via Frontend
 Transport; Fri, 23 Aug 2024 16:31:32 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SJ1PEPF000023D2.mail.protection.outlook.com (10.167.244.9) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 16:31:31 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 11:31:30 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Fri, 23 Aug 2024 11:31:29 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 29f774ce-616d-11ef-a50a-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=xVo8lj69fUcl17XENm9h4wHg3tTFKaE7fim5G+yN9O6ndomFamv2ohiA9SGV2ss8CZDIwvujguZHfSbrRHnaT6yblvJAIPyxcZK+ZaTS/mw5TAp9GZISaLzwB1YYXWZ6Dr0QuxTeoYYoYOUWVw5BfVQuPqkCD6wSjvfHSQySP+p84RrpnixOsBY1hYYLavbmBRUy9temmySwKof6dQE2UThlU3uunlTUTG4IAGprKeeq5ei4JvBVQgiMWFfl9AQRa6LqjQrUUvOf6dHVY4aKkznEz+rN7KtSjEzXCIU9BnvXWmwrsYtJmiUlkagtbun4MePO8DR8sdsNOZW22J1yGA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=UpDB0Wsw0MyL0N2tth1H16X6gmYFTdsxV1NglD4KSYs=;
 b=xG8zQq3s6dE5sM9EIHfbc6YLcOmMapCjKsbBqjaihQXqFpSBRCrCa24kp8GXR+aSNsYiu105o8m99vDJQv8vg2GzL2FPwXQAA5wIK0/F/5oaCZum0MMLabhXkuK0UG5zeU4EISvvk8biRhc0DOLBXDxJjIPdLkgXJ6AWsPE6QibA5Ktcfb3S5kXpETghId5Akpo3DVquLztK0U7BNi9gmDzwoOxFZZJKc90DzhpeqKBnZpLSXEqyX6Q8FDdNTLZ7lOutmHIadxm5Kl3RM6MQZPaaI2hpbSACUgY8M4GWR2SctZCvVOwlP+QE6R8DPFQMHmxzhSBnYI1wmLs3+rBtSQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=UpDB0Wsw0MyL0N2tth1H16X6gmYFTdsxV1NglD4KSYs=;
 b=y81DuIRtlcHrmqMu+flLBictH4KotlFjEKMTHa5zpHtMPkFkrQfevcNmJ6zvwa6JW8ENEsBLk1BxubLH34BkQ/BMtsg8pi86RbK9k3bAn/kJgQV/YSTCh3FpaZKQIz5yYiphGEhCeylZibUYStxtmQSol1lUeywQI+yc3NSUA7A=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>
Subject: [PATCH v1 0/4] Enable early bootup of AArch64 MPU systems.
Date: Fri, 23 Aug 2024 17:31:23 +0100
Message-ID: <20240823163127.3443404-1-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB04.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF000023D2:EE_|DM4PR12MB8523:EE_
X-MS-Office365-Filtering-Correlation-Id: c9f8ec65-1f40-4b90-36b8-08dcc3910ba8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|376014|1800799024|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?O8HbWbo+V2swiiYZqGc1pkgfzaHN3fHym+li2/AeiX17iGkgiQNEANwU0WT0?=
 =?us-ascii?Q?5OYHtnr3BygIuu9hFI3A0Edx/5uwIixiQ7uLsapw/Lar/Piq0CYANOIPYqD1?=
 =?us-ascii?Q?+KS/AjQJyjI781ihxAUFzHf6byYl3+v3II/2BrlG4DO6Zk+wGJBVw1gH3q+F?=
 =?us-ascii?Q?aDox65885hwckyuAB5QYwA5fi++sR+pP7UwqSwKwpI7nuxzDxB+W3eeEyN07?=
 =?us-ascii?Q?6bsN8cN2neXhFOd25wfYDXlp+yWX/iyptV210fqQJUBxQoLHhxMxzPHPE1ER?=
 =?us-ascii?Q?TRkYdm2qHYbQj8kR5RuSUr1bpH3Pwqzr8ax6ZWQqxQUtKLEspp9GkhLZvG1m?=
 =?us-ascii?Q?BrbOczHWWVZga7ENU0jTX6O9TDTcX0MlbZtuWdSNwCNHSI43qShbSE1/vngZ?=
 =?us-ascii?Q?nFKnRWGdf1U9NXR7X/6uwRg76EqTlQFdfjmTwZ6M4nkXeR3/ATOp7FYrWGAC?=
 =?us-ascii?Q?/6SWrNZshSz1MXHsfqBHRHeFGcHAJoU1njDq7W+m1rBO9kripDkMuEHQYTrJ?=
 =?us-ascii?Q?RaQBh2cLnJsNzPrv4dqX0JlsfQC7U9e9fkVEM79E4gd9Fr0L3rw81XoUi9jt?=
 =?us-ascii?Q?WH+Syqn3JJIn+VOLn6bsDB8fFR/SApr/ogp/r+aR3xcPzMNd4nIrSR4jEU/0?=
 =?us-ascii?Q?wuyfBwSlTFcmO/qeIHbBCZmN0pezSW+KSNr1NJQ5LZzsr+Wy5UAJYxWfv4pq?=
 =?us-ascii?Q?qqW0dktanktdMJeANO32KGJLNj4TYWGB0RwsiPOH0hDp+bdIvqhK86cMLdLT?=
 =?us-ascii?Q?G9FvuMZzu9i8sZLLNZ99WHS1zUR01Bhd7NFOA5v23ySABawhn7bbQ3s96rOJ?=
 =?us-ascii?Q?PXwY60auYgQ6umLEvSi8oK7/sN1hQiA5G4n8slp20ueNdApX3XdLFRJKTp4L?=
 =?us-ascii?Q?aBrpHgJ5GRjjI4fqPzk6C7Y6mX31v8r0F4ChrzBARMyJYoHOhVCJY5p0dsrT?=
 =?us-ascii?Q?uggs4V9ZAsmGOoXZFFC/J+YpfoOeh9sZGaIoWBsQxBEOrhenI7sD/V14t7/K?=
 =?us-ascii?Q?VEXCftiwWzRVyvuDOMUtKQhXWhEkoWkcbUeyD95gGUFzaTCFc7RbCoOsjJgx?=
 =?us-ascii?Q?oRdNeCEkqAwWBBbh+nn19rnstfmSjurAzRXVXKL06DRpZIhj0lsfjgtpqlza?=
 =?us-ascii?Q?jng9NoyEWWMjVw3o2PyMpfJshTc8B+ogUSYf9x+PBd5ah1gezf8U91ZQ2Nd+?=
 =?us-ascii?Q?4Mis9qrZ1+GtM/0xKVDW5t9L01Azh58sukm4/KyBNmQs1ZxkwjxDN0rmS/in?=
 =?us-ascii?Q?UCBFS33gPkpSTPLmaP4FATim6Lylj0P1UPIz8qWt8NkYQqpB2B3J/DFKr5gF?=
 =?us-ascii?Q?XojSoKtJe4o05YF7nJH1/5DlOYz5Y0eQ/42rmM/L0JdhDT4nzLDzNOUtmiE5?=
 =?us-ascii?Q?zjGCwxZca0VgB3nWQWQo3kOrDdTl9zQmS6p2ZUuQt6uCwHxzcg=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(1800799024)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 16:31:31.1609
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: c9f8ec65-1f40-4b90-36b8-08dcc3910ba8
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF000023D2.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB8523

These patches are based on https://lore.kernel.org/all/6d065949-dfae-41f8-b030-c7d09516846b@amd.com/T/
"[PATCH v4 0/4] xen: arm: Split MMU code in preparation for MPU work (part 2)"

We have enabled early booting of R82.

Ayan Kumar Halder (4):
  xen/arm: mpu: Introduce choice between MMU and MPU
  xen/arm: mpu: Define Xen start address for MPU systems
  xen/arm: mpu: Create boot-time MPU protection regions
  xen/arm: mpu: Disable secondary cpu bringup

 xen/arch/arm/Kconfig                     | 28 ++++++++-
 xen/arch/arm/Makefile                    |  1 +
 xen/arch/arm/arm64/mpu/Makefile          |  1 +
 xen/arch/arm/arm64/mpu/head.S            | 79 ++++++++++++++++++++++++
 xen/arch/arm/include/asm/arm64/sysregs.h | 50 +++++++++++++++
 xen/arch/arm/include/asm/mpu/arm64/mm.h  | 13 ++++
 xen/arch/arm/include/asm/mpu/layout.h    | 25 ++++++++
 xen/arch/arm/include/asm/mpu/mm.h        | 18 ++++++
 xen/arch/arm/platforms/Kconfig           |  2 +-
 9 files changed, 215 insertions(+), 2 deletions(-)
 create mode 100644 xen/arch/arm/arm64/mpu/Makefile
 create mode 100644 xen/arch/arm/arm64/mpu/head.S
 create mode 100644 xen/arch/arm/include/asm/mpu/arm64/mm.h
 create mode 100644 xen/arch/arm/include/asm/mpu/layout.h
 create mode 100644 xen/arch/arm/include/asm/mpu/mm.h

-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 16:31:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 16:31:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782451.1191956 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXCg-0004Gx-WA; Fri, 23 Aug 2024 16:31:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782451.1191956; Fri, 23 Aug 2024 16:31:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXCg-0004G0-QJ; Fri, 23 Aug 2024 16:31:58 +0000
Received: by outflank-mailman (input) for mailman id 782451;
 Fri, 23 Aug 2024 16:31:57 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4lC7=PW=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1shXCf-0003gP-DM
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 16:31:57 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on2061e.outbound.protection.outlook.com
 [2a01:111:f403:2414::61e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 36157c30-616d-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 18:31:56 +0200 (CEST)
Received: from CH0PR08CA0001.namprd08.prod.outlook.com (2603:10b6:610:33::6)
 by MN0PR12MB5740.namprd12.prod.outlook.com (2603:10b6:208:373::10) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20; Fri, 23 Aug
 2024 16:31:53 +0000
Received: from DS3PEPF0000C37C.namprd04.prod.outlook.com
 (2603:10b6:610:33:cafe::f8) by CH0PR08CA0001.outlook.office365.com
 (2603:10b6:610:33::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19 via Frontend
 Transport; Fri, 23 Aug 2024 16:31:52 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 DS3PEPF0000C37C.mail.protection.outlook.com (10.167.23.6) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 16:31:52 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 11:31:52 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 11:31:51 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Fri, 23 Aug 2024 11:31:50 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 36157c30-616d-11ef-a50a-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=l4+HfeVHXna29Bt1oGg4sA5thuBZqa7ZEsRCrBqjhLvf2iWnS2awtK4LNJXpcUsgtUb95IQzrCUbyDYg8IgLSTZVV0yNCJJwMFcqNi/zPqNN+3jRzsB9pH7nnDvQ5+XjKD4U8L0rmA7TsjGr/NW84Mjx8r7rjVUWqWy8XpLLcwBVPatnHierVc67141Faa5pw+0wV6hburHYKgnpwMv1BfBGeTUpTTo4UaNrJ+Hc+qgdnl5GvntIaLs7pV5glCS6wCONhH9JZGTfdTl98imH2qFqFWjqCpgZ8Xvw1HKnFY8oUFP7ldWbumPzII1GvqHBtCcPvgkdLnKYjf9UdR0+TQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/VX6RV1GAbIb7gcCEfNz4iYXOrRrxcVBayyRtnGLtkc=;
 b=mARlzjV1Wm7aNdI5H8DzZ9rEYC1RdQvrqBI4MrrlXStkCkn+YEHl0uvqQWFFfsyI7T0ukCKsG2GtjKrTgAIEn+Q3OgEEKh2F2XZPbViblkg/qdCaOKHoiac16FCj3mG5ql5S54oXVmhOG0VaBM0tcelZ0VhnQsK6PsOFxSW6qbHiG1dDpixQ3cF/Al68LyVy63zOLzYh78fUjH3/jwt4e7ueKEv///n3ao9r7GJ5JxxiwNGIeGV+bA80JUJuaFopaU630KtV5Pn/CWnU7fmxUZZyGRpMiTELwLfz3/rjaB26Li9mj+bamRtCWDa4ZQTRo8tp1c38v7hZzBcws1meuA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/VX6RV1GAbIb7gcCEfNz4iYXOrRrxcVBayyRtnGLtkc=;
 b=d9iDxmaJNkHxVXgBeR1j1H0lnCLudFfiee3SyUale4LVCiD9lA3gthJOR/adQW6iiGIE9H/zPIvb4mDTsq33/bMDGrPxqP0o437o3g49maMrbXoESy4Nkk2FWjHb99a42MIknqE87SLwLtNn1LQ3w2l0AE/ocwKFPPL/uCLYzOk=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>
Subject: [PATCH v1 3/4] xen/arm: mpu: Create boot-time MPU protection regions
Date: Fri, 23 Aug 2024 17:31:26 +0100
Message-ID: <20240823163127.3443404-4-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240823163127.3443404-1-ayan.kumar.halder@amd.com>
References: <20240823163127.3443404-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS3PEPF0000C37C:EE_|MN0PR12MB5740:EE_
X-MS-Office365-Filtering-Correlation-Id: 706a318d-5ef2-49a3-932d-08dcc391185e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700013|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?Aq4WSqIn+vHBBrofc+8j9mYjH6bfw95pAshSbAaWpwHd3zO/DI8Ae+fXrA1y?=
 =?us-ascii?Q?48v1jIzK2Tn5XwYoVTXu9OiME/+YMIjQLDTPagWh3CkIX08MJmO3kQrES3Zk?=
 =?us-ascii?Q?4p6i0jD8ekfkKsauREz5uYrLs8fNkoYVdJqnRwamhm/xjiyQJRQzaZehDwQ7?=
 =?us-ascii?Q?1ht/izG3oGzE6c/+YwoYommm7V4xgSsEC8vfe310Xe5gCu5HyXPIco0uBU4h?=
 =?us-ascii?Q?abWM+flc79qXmNq+3c7CBj0+DTh69Aui9beQTpO4bHYamQNx4LU2FELolK0R?=
 =?us-ascii?Q?SX5x0/tZFY0AaOV3HN6ifiBS84Hx3d247ohrXxgNLK66bBgDqPQCFg19O9IZ?=
 =?us-ascii?Q?HnVmtZ+TTwkgc3XmxDFDc0exYJ/NOoDvvFk/sCRmkJ8HCJ8urGlxuIYim9rt?=
 =?us-ascii?Q?fD2w43WCzDZBliRLyerBtgevWcafVsO6bPAHlZQrh/YyLyN6qbHyOG0hc7mz?=
 =?us-ascii?Q?l4YXz4UCX1DGIf3HwkXrKjUAt1jiybkHXo53wVIYHK0S3Jpu2lp2vdWBvVQI?=
 =?us-ascii?Q?tgUa0p/JG4qIWIOG2lZTdUsz1MLUxKSvWjDI70BazWTJzI6Oh76y+hrZtEhF?=
 =?us-ascii?Q?1mdmkOUHWT8E9DuNKTR4oolaxPV4n4QNR3b+06jBLXWIY9UileUx+SXGHSrl?=
 =?us-ascii?Q?BwIyDANNwpRxqDBi/eClxc4Sq8ag2lJjTOQ6qG8I+izlEh+3FyS8pvq97KtF?=
 =?us-ascii?Q?msKmmilb8HIxHo8zMAn6W4iWT3TFr985GambaNk/8Ai3ChMjXqoTKpdHU2Ez?=
 =?us-ascii?Q?5Rm4DX2egAkE2hfI2JHBIdG9MGQjI1+y5KepEgc0/WBScuvr1pVWZ6o0hL5N?=
 =?us-ascii?Q?rVY/34fLBbetl28H7F0vBNerCeXuDIW4Jc3HlFK2hbFivuc6NtreS7/WGxez?=
 =?us-ascii?Q?7tIzHoycLbLa4bJPw/EJJpQn4WRge1ouMTpdWZ1+2FXyMDr4FRM8COLnCNcH?=
 =?us-ascii?Q?DiD51Ibpd8kalJcyOWccwtbgciMK06ojfyHTsiAZkga1QmC7pHKMUVuRQn1h?=
 =?us-ascii?Q?Y8PAXi3D4+SeCliV6A3NmGsHpLil5l1Yf49WtuwYd4W9NsGi2vYfJ5DuVF+u?=
 =?us-ascii?Q?6Uqiq7rVv+2sGDmbsfziYFdM9CgbR89GIHTxCWioy0vItzjYJhACZV7FkYrK?=
 =?us-ascii?Q?p55qNofewAC50nzaWFaNt3kSGdhTaxriAHeXMK2Z2E0wAbEYnIp2GusB5cuA?=
 =?us-ascii?Q?yszTklOiiOG6Si8+0k76+qslG/5imIKJs4VQM+nhS9q8Q/HQLWABo6RKNi3W?=
 =?us-ascii?Q?S44f2wAe55aMOFMTf1mEutjAvmsBQORcWAw17V0VKvuYuAc+nqM0fpzVITkh?=
 =?us-ascii?Q?wgmXyzIaaouWYelGWmfu4Q5BjKji2GuqcGPbDIW0X/1Ut12S1RehP02/3BYh?=
 =?us-ascii?Q?x5fmpi1yUy9s+tKBbJapE/9jVSpQCiF1FfrTq8Sh3HtFUubarKRuDiXZvgJT?=
 =?us-ascii?Q?brpAASvG4SeHM51tc7PqL83MFUTmbfkZ?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(1800799024)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 16:31:52.5668
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 706a318d-5ef2-49a3-932d-08dcc391185e
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS3PEPF0000C37C.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5740

Define enable_boot_cpu_mm() for the AArch64-V8R system.

Like boot-time page table in MMU system, we need a boot-time MPU
protection region configuration in MPU system so Xen can fetch code and
data from normal memory.

START_ADDRESS + 2MB memory is mapped to contain the text and data
required for early boot of Xen.

One can refer to ARM DDI 0600B.a ID062922 G1.3  "General System Control
Registers", to get the definitions of PRBAR_EL2, PRLAR_EL2 and
PRSELR_EL2 registers. Also, refer to G1.2 "Accessing MPU memory region
registers", the following

```
The MPU provides two register interfaces to program the MPU regions:
 - Access to any of the MPU regions via PRSELR_ELx, PRBAR<n>_ELx, and
PRLAR<n>_ELx.
```
We use the above mechanism to configure the MPU memory regions.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
 xen/arch/arm/Makefile                    |  1 +
 xen/arch/arm/arm64/mpu/Makefile          |  1 +
 xen/arch/arm/arm64/mpu/head.S            | 70 ++++++++++++++++++++++++
 xen/arch/arm/include/asm/arm64/sysregs.h | 50 +++++++++++++++++
 xen/arch/arm/include/asm/mpu/arm64/mm.h  | 13 +++++
 xen/arch/arm/include/asm/mpu/mm.h        | 18 ++++++
 6 files changed, 153 insertions(+)
 create mode 100644 xen/arch/arm/arm64/mpu/Makefile
 create mode 100644 xen/arch/arm/arm64/mpu/head.S
 create mode 100644 xen/arch/arm/include/asm/mpu/arm64/mm.h
 create mode 100644 xen/arch/arm/include/asm/mpu/mm.h

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index 7792bff597..aebccec63a 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -1,6 +1,7 @@
 obj-$(CONFIG_ARM_32) += arm32/
 obj-$(CONFIG_ARM_64) += arm64/
 obj-$(CONFIG_MMU) += mmu/
+obj-$(CONFIG_MPU) += mpu/
 obj-$(CONFIG_ACPI) += acpi/
 obj-$(CONFIG_HAS_PCI) += pci/
 ifneq ($(CONFIG_NO_PLAT),y)
diff --git a/xen/arch/arm/arm64/mpu/Makefile b/xen/arch/arm/arm64/mpu/Makefile
new file mode 100644
index 0000000000..3340058c08
--- /dev/null
+++ b/xen/arch/arm/arm64/mpu/Makefile
@@ -0,0 +1 @@
+obj-y += head.o
diff --git a/xen/arch/arm/arm64/mpu/head.S b/xen/arch/arm/arm64/mpu/head.S
new file mode 100644
index 0000000000..2b023c346a
--- /dev/null
+++ b/xen/arch/arm/arm64/mpu/head.S
@@ -0,0 +1,70 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Start-of-day code for an Armv8-R MPU system.
+ */
+
+#include <asm/mm.h>
+#include <asm/page.h>
+#include <asm/early_printk.h>
+
+/*
+ * From the requirements of head.S we know that Xen image should
+ * be linked at XEN_START_ADDRESS, and all of text + data + bss
+ * must fit in 2MB. On MPU systems, XEN_START_ADDRESS is also the
+ * address that Xen image should be loaded at. So for initial MPU
+ * regions setup, we use 2MB for Xen data memory to setup boot
+ * region, or the create boot regions code below will need adjustment.
+ */
+#define XEN_START_MEM_SIZE      0x200000
+
+/*
+ * In boot stage, we will use 1 MPU region:
+ * Region#0: Normal memory for Xen text + data + bss (2MB)
+ */
+#define BOOT_NORMAL_REGION_IDX  0x0
+
+/* MPU normal memory attributes. */
+#define PRBAR_NORMAL_MEM        0x30    /* SH=11 AP=00 XN=00 */
+#define PRLAR_NORMAL_MEM        0x0f    /* NS=0 ATTR=111 EN=1 */
+
+.macro write_pr, sel, prbar, prlar
+    msr   PRSELR_EL2, \sel
+    dsb   sy
+    msr   PRBAR_EL2, \prbar
+    msr   PRLAR_EL2, \prlar
+    dsb   sy
+    isb
+.endm
+
+.section .text.header, "ax", %progbits
+
+/*
+ * Static start-of-day EL2 MPU memory layout.
+ *
+ * It has a very simple structure, including:
+ *  - 2MB normal memory mappings of xen at XEN_START_ADDRESS, which
+ * is the address where Xen was loaded by the bootloader.
+ */
+ENTRY(enable_boot_cpu_mm)
+    /* Map Xen start memory to a normal memory region. */
+    mov x0, #BOOT_NORMAL_REGION_IDX
+    ldr x1, =XEN_START_ADDRESS
+    and x1, x1, #MPU_REGION_MASK
+    mov x3, #PRBAR_NORMAL_MEM
+    orr x1, x1, x3
+
+    ldr x2, =XEN_START_ADDRESS
+    mov x3, #(XEN_START_MEM_SIZE - 1)
+    add x2, x2, x3
+    and x2, x2, #MPU_REGION_MASK
+    mov x3, #PRLAR_NORMAL_MEM
+    orr x2, x2, x3
+
+    /*
+     * Write to MPU protection region:
+     * x0 for pr_sel, x1 for prbar x2 for prlar
+     */
+    write_pr x0, x1, x2
+
+    ret
+ENDPROC(enable_boot_cpu_mm)
diff --git a/xen/arch/arm/include/asm/arm64/sysregs.h b/xen/arch/arm/include/asm/arm64/sysregs.h
index b593e4028b..0d122e1fa6 100644
--- a/xen/arch/arm/include/asm/arm64/sysregs.h
+++ b/xen/arch/arm/include/asm/arm64/sysregs.h
@@ -462,6 +462,56 @@
 #define ZCR_ELx_LEN_SIZE             9
 #define ZCR_ELx_LEN_MASK             0x1ff
 
+/* System registers for AArch64 with PMSA */
+#ifdef CONFIG_MPU
+
+/* EL2 MPU Protection Region Base Address Register encode */
+#define PRBAR_EL2   S3_4_C6_C8_0
+#define PRBAR1_EL2  S3_4_C6_C8_4
+#define PRBAR2_EL2  S3_4_C6_C9_0
+#define PRBAR3_EL2  S3_4_C6_C9_4
+#define PRBAR4_EL2  S3_4_C6_C10_0
+#define PRBAR5_EL2  S3_4_C6_C10_4
+#define PRBAR6_EL2  S3_4_C6_C11_0
+#define PRBAR7_EL2  S3_4_C6_C11_4
+#define PRBAR8_EL2  S3_4_C6_C12_0
+#define PRBAR9_EL2  S3_4_C6_C12_4
+#define PRBAR10_EL2 S3_4_C6_C13_0
+#define PRBAR11_EL2 S3_4_C6_C13_4
+#define PRBAR12_EL2 S3_4_C6_C14_0
+#define PRBAR13_EL2 S3_4_C6_C14_4
+#define PRBAR14_EL2 S3_4_C6_C15_0
+#define PRBAR15_EL2 S3_4_C6_C15_4
+
+/* EL2 MPU Protection Region Limit Address Register encode */
+#define PRLAR_EL2   S3_4_C6_C8_1
+#define PRLAR1_EL2  S3_4_C6_C8_5
+#define PRLAR2_EL2  S3_4_C6_C9_1
+#define PRLAR3_EL2  S3_4_C6_C9_5
+#define PRLAR4_EL2  S3_4_C6_C10_1
+#define PRLAR5_EL2  S3_4_C6_C10_5
+#define PRLAR6_EL2  S3_4_C6_C11_1
+#define PRLAR7_EL2  S3_4_C6_C11_5
+#define PRLAR8_EL2  S3_4_C6_C12_1
+#define PRLAR9_EL2  S3_4_C6_C12_5
+#define PRLAR10_EL2 S3_4_C6_C13_1
+#define PRLAR11_EL2 S3_4_C6_C13_5
+#define PRLAR12_EL2 S3_4_C6_C14_1
+#define PRLAR13_EL2 S3_4_C6_C14_5
+#define PRLAR14_EL2 S3_4_C6_C15_1
+#define PRLAR15_EL2 S3_4_C6_C15_5
+
+/* MPU Protection Region Enable Register encode */
+#define PRENR_EL2 S3_4_C6_C1_1
+
+/* MPU Protection Region Selection Register encode */
+#define PRSELR_EL2 S3_4_C6_C2_1
+
+/* MPU Type registers encode */
+#define MPUIR_EL2 S3_4_C0_C0_4
+
+#endif
+
 /* Access to system registers */
 
 #define WRITE_SYSREG64(v, name) do {                    \
diff --git a/xen/arch/arm/include/asm/mpu/arm64/mm.h b/xen/arch/arm/include/asm/mpu/arm64/mm.h
new file mode 100644
index 0000000000..d209eef6db
--- /dev/null
+++ b/xen/arch/arm/include/asm/mpu/arm64/mm.h
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * mpu.h: Arm Memory Protection Unit definitions.
+ */
+
+#ifndef __ARM64_MPU_H__
+#define __ARM64_MPU_H__
+
+#define MPU_REGION_SHIFT  6
+#define MPU_REGION_ALIGN  (_AC(1, UL) << MPU_REGION_SHIFT)
+#define MPU_REGION_MASK   (~(MPU_REGION_ALIGN - 1))
+
+#endif /* __ARM64_MPU_H__ */
diff --git a/xen/arch/arm/include/asm/mpu/mm.h b/xen/arch/arm/include/asm/mpu/mm.h
new file mode 100644
index 0000000000..f5ebca8261
--- /dev/null
+++ b/xen/arch/arm/include/asm/mpu/mm.h
@@ -0,0 +1,18 @@
+#ifndef __ARCH_ARM_MPU__
+#define __ARCH_ARM_MPU__
+
+#if defined(CONFIG_ARM_64)
+# include <asm/mpu/arm64/mm.h>
+#else
+# error "unknown ARM variant"
+#endif
+
+#endif /*  __ARCH_ARM_MPU__ */
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 16:31:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 16:31:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782452.1191961 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXCh-0004LZ-BL; Fri, 23 Aug 2024 16:31:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782452.1191961; Fri, 23 Aug 2024 16:31:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXCh-0004K3-6O; Fri, 23 Aug 2024 16:31:59 +0000
Received: by outflank-mailman (input) for mailman id 782452;
 Fri, 23 Aug 2024 16:31:57 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4lC7=PW=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1shXCf-0003wy-Rl
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 16:31:57 +0000
Received: from NAM02-DM3-obe.outbound.protection.outlook.com
 (mail-dm3nam02on20615.outbound.protection.outlook.com
 [2a01:111:f403:2405::615])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3528e294-616d-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 18:31:56 +0200 (CEST)
Received: from SJ0PR03CA0001.namprd03.prod.outlook.com (2603:10b6:a03:33a::6)
 by PH7PR12MB6812.namprd12.prod.outlook.com (2603:10b6:510:1b6::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20; Fri, 23 Aug
 2024 16:31:49 +0000
Received: from SJ1PEPF000023CF.namprd02.prod.outlook.com
 (2603:10b6:a03:33a:cafe::7b) by SJ0PR03CA0001.outlook.office365.com
 (2603:10b6:a03:33a::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend
 Transport; Fri, 23 Aug 2024 16:31:49 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SJ1PEPF000023CF.mail.protection.outlook.com (10.167.244.11) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 16:31:47 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 11:31:46 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Fri, 23 Aug 2024 11:31:45 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3528e294-616d-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=YJSwoZ3cPZbUFIfJrMhDAY1/QmBfUBRHnoNeXNCtgXjdexP0SqcYudYe4f5GNwK3bYKsyOq1CgqJdJLIiHnan90h+MyRqiPJa1Yw/3JGyKZ02i/Bf+but8Bc4Jh98PYb3dgF6t785xDVmf0Rt2fAtxnqxXf4CIPuBIFw0s6c2KMUHPoapcJ8b6oOxyEHzmr6loc38pVwJgJkuj+UvzXZb+uSFrhIC0IMASHx+hgTKj0t8XR5G4MORe5TpTZ/u5KhBfC1CrpM3G2baS1lcUhMVCgFrV/y9xm8FCfNBI8PbHeFldHM4pV41QZXLUdA8IjzAECEcgbPrS8plkA0HS9F1w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Nr9rHx3YRb1ioBThg6/mHfFwNo227Uz+gT46derpfBU=;
 b=Tw6qrhOghLPL/11ZTNK3O3EZG8tXpLKpKz8d/DuSN0vTTsi7XqTbV32U3yRwfZtLsOh+gwcxgyLxExiB11YvyOP/fr458ZUtaa9leICX00E6QNoxx70h+FcpMm/EyE1qUEX6UB8GZoKd+CNxnc0QXqDK383XDuoXuax6EBeIgvqFSM7nyCGOblosOSVugMDw95ky/mgHmR/RXrnhle9kd7t1tfksaQ96gY4rXj7P/cU7UX2E5H2xJzoWif+7+tJg8Yr3wfnlxSw4M7XllwRCItWGKdyPhuuOxkSP4skmxfXHinTxU2Hv2ZQ7jxQ8Op0irHDh14A7UvtXHpW/8b7BPQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Nr9rHx3YRb1ioBThg6/mHfFwNo227Uz+gT46derpfBU=;
 b=UDW4zK9cjOI1y66eux3xmcnKQFFN4X8YpA44YDAzUw8v4/ZINiRj5r7TAB4eLhYD6SvOVLRMe4+rm+tIXiLwhoyLcVNpQZCXtJ0bVRp9G8mR+RLhp5Bq2iaCCSNeDEwsD449ZRMyKIe7rqzxLBckYQKI27XDBerE+2tr1r8q2ZQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>, Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>, Volodymyr Babchuk
	<Volodymyr_Babchuk@epam.com>, "Jiamei . Xie" <jiamei.xie@arm.com>, "Ayan
 Kumar Halder" <ayan.kumar.halder@amd.com>
Subject: [PATCH v1 2/4] xen/arm: mpu: Define Xen start address for MPU systems
Date: Fri, 23 Aug 2024 17:31:25 +0100
Message-ID: <20240823163127.3443404-3-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240823163127.3443404-1-ayan.kumar.halder@amd.com>
References: <20240823163127.3443404-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB04.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ1PEPF000023CF:EE_|PH7PR12MB6812:EE_
X-MS-Office365-Filtering-Correlation-Id: a5601d19-ca2f-46f3-d9a5-08dcc3911580
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?ARmCeBXfk6QRFpEG4jk0AIjOUPHmrXb0p+E30Mj7a1K2tFxRiJtMQ/3MD9dJ?=
 =?us-ascii?Q?fF8QDWR69s+cBuSpyloRiCAB8TMkcClsPpplcL7lykHYjRTFX9cwqP6FDuUr?=
 =?us-ascii?Q?F1w447t/1KUktXFjsNJkHXfY5Oattz9FsFLT0CgqrgTWaiT63bCscLG0VetV?=
 =?us-ascii?Q?33RFdNoJpIjM96gA188aKYpAYhWyQqx19ZdQ+U8BFc52QGsFyaUwuoCPADom?=
 =?us-ascii?Q?BN7Yg3qrqdgIXyjoHMojXXqrX7wShL9VuYCcWHPndfKajdGCKQpg4M9UItBA?=
 =?us-ascii?Q?Bhv+v7ISdodHSibwbXp9DT/LbxxMgzE0eGd+HpnE1d3/0bDa3IPNMvTOQ3DB?=
 =?us-ascii?Q?/xnO6j9/08jte0V3npyM18BvXYcLXRWTDBc2m9Z3fMYqfDjVBN6xVS536lkr?=
 =?us-ascii?Q?F2nNMJq0eVMv/sii9WqSadGLjqdmNkgnApwk5d72qPFrS5RqbLYPgRZ12+p/?=
 =?us-ascii?Q?GcVwmaGP/cfXR6bcUL2R9hG34Jn+hV7UANF/TJp6rMVqkREZDWZjRJX6Ju9b?=
 =?us-ascii?Q?ToD0sDNTZOKfeFea+sWVwNUQURQ4sM6Nc8zqX2QYiBvOu5j7MJfsc3RrFOxh?=
 =?us-ascii?Q?E0JShs4q/We6P3IZkuO9U/bG907qf7rSnt+ckgrsmQvTeqOgOlBd9YeKoD1y?=
 =?us-ascii?Q?KNbaZ4D/rdh45YGoEvf/PDKs3miH0iQiJBDBcQR7n2TO1WbkL+SfQEfE9lZY?=
 =?us-ascii?Q?TOGm7U/j2hIKYwA69SN89ceFL3lb3uWCb9nmBmfz+8sXDijI7DFGBJVZWF1d?=
 =?us-ascii?Q?HR0dk482vODG9XDBC/3zCNmiM3g7wzBLczajYaI7ewx/6JnyUwKrHv24MukK?=
 =?us-ascii?Q?5Ixm009qxXRurnOsvtAfUfGN37mtz9s4Ci9UMX44XLq1OMeVtQhGT/pyGnfA?=
 =?us-ascii?Q?lZYO121MnSGxjGp4E8+idzJ1C93UPfHGTm8yy/vq3KUv9WtHoZpUvSbEhsrG?=
 =?us-ascii?Q?UaS4ZCB8CNabMbwfmzTbp75YsEmkktuM82WRxwh1h80GHm8fsJHRSROTnoIE?=
 =?us-ascii?Q?t2j7hpE5N/CZFgWyHWLlMPV7u02uq1wEeTWK7yZvuz1IB31lwy2HdmVscwTW?=
 =?us-ascii?Q?UQDluyVPsMKVdMN82snWBW2qxLrtoAHaZChTBmqwzNf4PFcXcE9xJ5/xQ4+j?=
 =?us-ascii?Q?kQubf8a51oqmcCRTtf8h9hAl3A0HGSFM0/InrQax5qafTYO2eCu+9i7E/UQz?=
 =?us-ascii?Q?r3N5YYpbZve75gcbqwxj1hxTYHcwrox1HDPp9FF/15bCnDt/9gxEwENNc4Lr?=
 =?us-ascii?Q?/wmIq8x9VtVOwQ1tVOG5FXRvJXiPVvDmFWqiFOA3Vvkvb1YqfEEPLmQmJOdG?=
 =?us-ascii?Q?dAI4wYGd+dL7Np2EYnpChsVMHGeF3Kasm64Etyjp/1GisKCqnkgginyNJ+0N?=
 =?us-ascii?Q?uq24XozqtUoa2R+zmKWg+SUaMPzp9hbBSZPSDzhcglSwvfLiAI+amaz+cPnf?=
 =?us-ascii?Q?bdaYP/bB4nfESq29pQgP7FOZs57hLL1/?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 16:31:47.6645
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: a5601d19-ca2f-46f3-d9a5-08dcc3911580
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ1PEPF000023CF.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6812

From: Wei Chen <wei.chen@arm.com>

On Armv8-A, Xen has a fixed virtual start address (link address
too) for all Armv8-A platforms. In an MMU based system, Xen can
map its loaded address to this virtual start address. So, on
Armv8-A platforms, the Xen start address does not need to be
configurable. But on Armv8-R platforms, there is no MMU to map
loaded address to a fixed virtual address and different platforms
will have very different address space layout. So Xen cannot use
a fixed physical address on MPU based system and need to have it
configurable.

So in this patch, we reuse the existing arm/platforms to store
Armv8-R platforms' parameters. And `XEN_START_ADDRESS` is one
kind of MPU based platform's parameters. So we define default
`XEN_START_ADDRESS` in the MPU specific header file.

We also introduce one Kconfig option for users to override the
default Xen start address of selected platform, if they think
the default address doesn't suit their scenarios. For this
Kconfig option, we use an unaligned address "0xffffffff" as the
default value to indicate that users haven't used a customized
Xen start address.

Signed-off-by: Wei Chen <wei.chen@arm.com>
Signed-off-by: Jiamei.Xie <jiamei.xie@arm.com>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
 xen/arch/arm/Kconfig                  | 11 +++++++++++
 xen/arch/arm/include/asm/mpu/layout.h | 25 +++++++++++++++++++++++++
 2 files changed, 36 insertions(+)
 create mode 100644 xen/arch/arm/include/asm/mpu/layout.h

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 686948cefd..d722ca690c 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -23,6 +23,17 @@ config ARCH_DEFCONFIG
 	default "arch/arm/configs/arm32_defconfig" if ARM_32
 	default "arch/arm/configs/arm64_defconfig" if ARM_64
 
+config XEN_START_ADDRESS
+	hex "Xen start address: keep default to use platform defined address"
+	default 0xFFFFFFFF
+	depends on MPU
+	help
+	  This option is allowed to set customized address at which Xen will be
+	  linked on MPU systems. This address must be aligned to a page size.
+	  Use 0xFFFFFFFF as the default value to indicate that user hasn't
+	  customized this address, and Xen use use the default value that has
+	  been defined in platform files.
+
 menu "Architecture Features"
 
 choice
diff --git a/xen/arch/arm/include/asm/mpu/layout.h b/xen/arch/arm/include/asm/mpu/layout.h
new file mode 100644
index 0000000000..82a74b8b5b
--- /dev/null
+++ b/xen/arch/arm/include/asm/mpu/layout.h
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * config_mpu.h: A Linux-style configuration list for Arm MPU systems,
+ *               only can be included by config.h
+ */
+
+#ifndef __ARM_CONFIG_MPU_H__
+#define __ARM_CONFIG_MPU_H__
+
+
+#define XEN_START_ADDRESS CONFIG_XEN_START_ADDRESS
+
+/*
+ * All MPU platforms need to provide a XEN_START_ADDRESS for linker. This
+ * address indicates where Xen image will be loaded and run from. This
+ * address must be aligned to a PAGE_SIZE.
+ */
+#if (XEN_START_ADDRESS % PAGE_SIZE) != 0
+#error "XEN_START_ADDRESS must be aligned to PAGE_SIZE"
+#endif
+
+#define XEN_VIRT_START         _AT(paddr_t, XEN_START_ADDRESS)
+
+#endif /* __ARM_CONFIG_MPU_H__ */
+
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 16:32:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 16:32:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782457.1191976 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXCo-0004zf-HH; Fri, 23 Aug 2024 16:32:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782457.1191976; Fri, 23 Aug 2024 16:32:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXCo-0004zY-Dh; Fri, 23 Aug 2024 16:32:06 +0000
Received: by outflank-mailman (input) for mailman id 782457;
 Fri, 23 Aug 2024 16:32:05 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4lC7=PW=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1shXCn-0003wy-CL
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 16:32:05 +0000
Received: from NAM04-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam04on2060b.outbound.protection.outlook.com
 [2a01:111:f403:2408::60b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3a357554-616d-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 18:32:03 +0200 (CEST)
Received: from DS7PR06CA0050.namprd06.prod.outlook.com (2603:10b6:8:54::32) by
 IA0PR12MB8896.namprd12.prod.outlook.com (2603:10b6:208:493::17) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.16; Fri, 23 Aug
 2024 16:31:58 +0000
Received: from DS3PEPF0000C37D.namprd04.prod.outlook.com
 (2603:10b6:8:54:cafe::d6) by DS7PR06CA0050.outlook.office365.com
 (2603:10b6:8:54::32) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.18 via Frontend
 Transport; Fri, 23 Aug 2024 16:31:58 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 DS3PEPF0000C37D.mail.protection.outlook.com (10.167.23.7) with Microsoft SMTP
 Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 16:31:57 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 11:31:56 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 11:31:56 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Fri, 23 Aug 2024 11:31:54 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3a357554-616d-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=WShjWix8mPVqDTbOruTRH2UCLY54m6OB3SEmP9idjbVD/VjSNeY4GkZ8kq5kNV8Xghu7K/+WbKopdOWXpTsHS8C+6gxlUnSyRVIMtuS9alpr8njh+wcdo5exFSOIdUTQCtIHPr9ZHW7zX4dbV7DfpL/QPi9qw9wat5qGuLe4y8tyxBr4usjMtBkj9ZoadJemVyL7mKfJOmSVUZJl4tEZf5VrAz3kF5tGwY9Rsvl0x9Nx04GoBnJPLFCsx8rWHVvB6NrsBBNSuzuME+wp5EoSzS2VOJ0y3VUfRmCDfPoecOjDK2Y0SjWSgSmb/r8S4jzy0F0ixut8JCBIQyewG7ye7Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=wuiEdftCCb5GGJkxnNH4L0uhS/yjDJbyX+vbFvef+Cw=;
 b=ASn2yW3XmcglQmdTikTAT3b1VJl+x9cTtdEootr9ekLwsuX65Se2HmOvTlc2RBGN4rSR8pzM2PCCE/BtwF41X8aAikV/twY+4/hpiBEyOz0cBqN+BxWCpk09/I0Ote0nnARayAK7SHMzDdNXHK+cqV8tmhP0EUPnm+aaFfKQfAC7H5hEcNayZVkhUHGUBT+SW+UFyytIzT63OJbSE0pwPzqDaOlhWaUCMAIZmUFshHbIVc/YaRwTkoU8lF/1ouFyAsxyPNrjtfVlTranevJj2J7fddzpKm4x9OU1IjY0xrerrqI+WhLd/9X7tRTa+ql/yC60hSVC1/bJiFFvgIjUcg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=wuiEdftCCb5GGJkxnNH4L0uhS/yjDJbyX+vbFvef+Cw=;
 b=WMiFWJiBtZyORFY8u9yaGD8ury1VgxcGoSM0aZ6jPN+gJzs1qsOd/FyWbBwwrnZhnEFttwz75Oz+Aphb2JffT0Nzve0bn5rnSwXrCq1+bQBdHxxX9OgFNUyp2gk0wu/JYeYt8X4khqK2zSMUbuHCK9bF3qMm/Cn3/KUr2O8uLOU=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Ayan Kumar Halder <ayan.kumar.halder@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>
Subject: [PATCH v1 4/4] xen/arm: mpu: Disable secondary cpu bringup
Date: Fri, 23 Aug 2024 17:31:27 +0100
Message-ID: <20240823163127.3443404-5-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20240823163127.3443404-1-ayan.kumar.halder@amd.com>
References: <20240823163127.3443404-1-ayan.kumar.halder@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS3PEPF0000C37D:EE_|IA0PR12MB8896:EE_
X-MS-Office365-Filtering-Correlation-Id: 68002031-1f55-4867-dcb0-08dcc3911b96
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?FZ5/pK0Hc63yveCg6QXKSUl4Owa+dq/mxDh4sXoEGNYv8ZumJpfq9Ho2fCbB?=
 =?us-ascii?Q?ikHgKK9CZf6ymqGRDbxX9WenvAT4W7eGel0oBmdTyuLiNrC+C2Q064knUDmi?=
 =?us-ascii?Q?QGvzb3GqoZ0/LBblXPJI5AsA+30mQTB7Xay5wbkeSMiFsfKEeRcmFyDbSsM1?=
 =?us-ascii?Q?0MtcVgK4UVAWR1p5Y8s+22IWFObUGTXPSr74BOxhdSlglG4cFLEcg/DHI+kU?=
 =?us-ascii?Q?W78QfLDk+BWdz3+vsJn7VpQ7kuDc9/bDbCyflHUKqAOMXYrihwYxsBLJDsCG?=
 =?us-ascii?Q?ckg7nhycA/Rv4Zc1gtaV9kRlzqKF/ARfM5NM4Tx4OcLRLFKf2yperL38X3qY?=
 =?us-ascii?Q?My2rrZRhVfzjzgIv91bErvb2Hyr/CEDCFQIfS/qVGCP2ke8qkKDwYjLAZlhJ?=
 =?us-ascii?Q?Ycgyd5GuwqkgWjorCCMqKfOCEsAg3GcM6apSgCCmRX0mgHFNYyDPiwthjzOo?=
 =?us-ascii?Q?OqMhQlTQT269MlWlp/mRPS/NuvTI6HTRsihEa3HoMZcjIPWIpKM91SVxhwLw?=
 =?us-ascii?Q?fGbrAX0IhowkXCATbsDjUq3/B37LzVx3TpnfL13pFZSXQ6UozefBmevvAVPa?=
 =?us-ascii?Q?gy5aYLcvKJlXIz7LCGAT6zyjwDRjo0bW5UzZzl2elAtagrprDEU1BCtfRcrY?=
 =?us-ascii?Q?sz1eqmTzK5QsipppHFcwLZ5FZSxsgr5MbLI9//cb4ti9Wcr99f4n+rnGv/HB?=
 =?us-ascii?Q?EJvumFLX7JJ1qPGTVSxRQUxQWNU+Pj7Etc69x8m0dqNCIW/UKeK5/PDoZHZs?=
 =?us-ascii?Q?Sbe5lj72cAPV3jYab7nX6L2Gw5u0XxcTmVni8TWcxv1tGfrGMMM7MijphTHf?=
 =?us-ascii?Q?0H+SK3ie7WPnL8zJ5neD/ulZX5Vyv+oqeI59gRkWp/hD2HiVBI384zVnxkMG?=
 =?us-ascii?Q?juHtCWu/Jo0MpFoQcq1AXFeMoVoTjDdRUscj+Q5VbsJ/EiBtwts9F6YNzj4w?=
 =?us-ascii?Q?pqWBBENxT8fwqUY6EdjBKFIebw7+T1yyu/+XwSuTE10jrTAcjn4JXdY45ZJq?=
 =?us-ascii?Q?zHpYWZYpzglrg233Rq0iUdQqVqf6b7mIL4lKsAeL/tPbxVlxSDLW2bq3pRwP?=
 =?us-ascii?Q?0PzMylR8Bs0iCb0O7jqy5Ym5XHokfJLzFbuNHzgacml4ZZzDQyRb7qRO1H0e?=
 =?us-ascii?Q?RuVd9cxfPp6b05Yj+xr8eJVPpzvq5V0JWnvdoTjIHeOHtbfLC8OjDsX33PNx?=
 =?us-ascii?Q?yXyz+HPRFg3sgMkOc3a3wsVAeUIuYR5o1DpgSXbqMurpda22KBw8lU3FYb8L?=
 =?us-ascii?Q?1GFKZNNhJnNO9EeRrYZPsKlUf2OvA/3pffRLzDE6jge1YETTW+LXK+H0qRxR?=
 =?us-ascii?Q?rZxEN7GwBJNfwiOfayLt1TwVy39iXZB9juUIzct/558cSC4+ZgV/jbB2nyTJ?=
 =?us-ascii?Q?laCf9/0r4+jWcq70ZZcFaHUGdi6Eu9/aqx2QhkWmVceCYyRiXmwjgVXrisUM?=
 =?us-ascii?Q?ixScpo7hY6Io969zJY6cGo8b65ioF5zr?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 16:31:57.9220
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 68002031-1f55-4867-dcb0-08dcc3911b96
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS3PEPF0000C37D.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8896

Secondary cpus are put in WFE state. We do not support SMP at this time.

Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
 xen/arch/arm/arm64/mpu/head.S | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/xen/arch/arm/arm64/mpu/head.S b/xen/arch/arm/arm64/mpu/head.S
index 2b023c346a..1579ac0408 100644
--- a/xen/arch/arm/arm64/mpu/head.S
+++ b/xen/arch/arm/arm64/mpu/head.S
@@ -68,3 +68,12 @@ ENTRY(enable_boot_cpu_mm)
 
     ret
 ENDPROC(enable_boot_cpu_mm)
+
+/*
+ * Secondary cpu has not yet been supported on MPU systems. We will block the
+ * secondary cpu bringup at this stage.
+ */
+ENTRY(enable_secondary_cpu_mm)
+1:  wfe
+    b 1b
+ENDPROC(enable_secondary_cpu_mm)
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 17:04:39 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 17:04:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782491.1191986 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXiE-0003hg-VT; Fri, 23 Aug 2024 17:04:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782491.1191986; Fri, 23 Aug 2024 17:04:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXiE-0003hZ-S1; Fri, 23 Aug 2024 17:04:34 +0000
Received: by outflank-mailman (input) for mailman id 782491;
 Fri, 23 Aug 2024 17:04:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shXiD-0003hN-Bn; Fri, 23 Aug 2024 17:04:33 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shXiD-000468-65; Fri, 23 Aug 2024 17:04:33 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shXiC-000308-Ps; Fri, 23 Aug 2024 17:04:32 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shXiC-0000yj-PM; Fri, 23 Aug 2024 17:04:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=herT8MjRMIceOsAW7OG5N7U9SI3/RZ4UChkzYT1JXjQ=; b=lob6pimvGX5wHf0zskzsQ6brNB
	apcnJ9Zo1LBOpWWdJposAkOCxQONFlzfo5kRiRaIJE7DEhdJBhUMZMXUlUOBtro20tb/Wf2+6kDm2
	kIyfYJVqcAE5RjT2P1Gb3Gq4itsiWnb6VfGuroNPdckGTZ9Z0DvIVOfnr7XTeJn4oEw0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187325-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187325: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=8ffcf184affbc2ff1860dabe1757388509d5ed67
X-Osstest-Versions-That:
    xen=aa80a04df488528d90a0d892f0752571b1759e8b
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 23 Aug 2024 17:04:32 +0000

flight 187325 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187325/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  8ffcf184affbc2ff1860dabe1757388509d5ed67
baseline version:
 xen                  aa80a04df488528d90a0d892f0752571b1759e8b

Last test of basis   187314  2024-08-22 21:04:01 Z    0 days
Failing since        187320  2024-08-23 08:02:13 Z    0 days    2 attempts
Testing same since   187325  2024-08-23 14:00:23 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Andrii Sultanov <andrii.sultanov@cloud.com>
  Christian Lindig <christian.lindig@cloud.com>
  Jan Beulich <jbeulich@suse.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   aa80a04df4..8ffcf184af  8ffcf184affbc2ff1860dabe1757388509d5ed67 -> smoke


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 17:05:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 17:05:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782500.1191995 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXj7-0004Ck-80; Fri, 23 Aug 2024 17:05:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782500.1191995; Fri, 23 Aug 2024 17:05:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXj7-0004Cd-5A; Fri, 23 Aug 2024 17:05:29 +0000
Received: by outflank-mailman (input) for mailman id 782500;
 Fri, 23 Aug 2024 17:05:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kBLJ=PW=cloud.com=javi.merino@srs-se1.protection.inumbo.net>)
 id 1shXj5-00048i-FH
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 17:05:27 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e4b939f4-6171-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 19:05:26 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5bed83488b3so2908170a12.0
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 10:05:26 -0700 (PDT)
Received: from localhost.localdomain ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a3eb329sm2311240a12.55.2024.08.23.10.05.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 23 Aug 2024 10:05:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e4b939f4-6171-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724432726; x=1725037526; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=vvsmhrQ58ty42PuHWnq4wbr6/fL17Z3aKlW9teCKYaU=;
        b=PWZxF8TsuPEnUt2TolfOqOkrB3ZspUmSGpYn9Qhi9DR+61oke33LvT3DSqhhwqZPWo
         JlQ7CqwxuZeJDbzjjoXkr4iHIAu4gILO1PGwglE+Bw1xDwuu5eELFwHNwtLzFQgClji1
         BfoQDWJkX552dlvxPeAvgI7CDhaX9nEHE+BdE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724432726; x=1725037526;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=vvsmhrQ58ty42PuHWnq4wbr6/fL17Z3aKlW9teCKYaU=;
        b=XCSeiCzNm5KZ47mnZulrqbKafHcuMeGXF6mrLDwJWS6OOVapvYHymg3WqBSQR5Bqhn
         YchtVypoB7pAl05wXUexf9HoSxC/SbTis5sb4mwPbigUS/WIdQwR0VXTgy+atQqyLb9t
         pyu3MifQ8lYv27EcjIjMgIQnIMoxITQFupPSDNw3VRt82tCVobLFdbPqZYIGLErLlyMM
         xhCDGSMsE7d6+fIZpXnfte2bt7QDIn4cBor3kIF1i17wf+NlxIT1T1RBdvXs7Cns+zUg
         6k7FhMlJ2Rvynf3wAfTa+dSaTVrYwj7q7MpXjVrLDMrAr4T/MtVdAjLem04POnZXzHFW
         +BFg==
X-Gm-Message-State: AOJu0YxSWU5VJ16AcJERg7gslsTz/DrxrGrwTHrvTmxv9BuvqjCbfUns
	R1Yzo+J70w8odnu3CbAYmXf41i4nsB6L06BxIRkV7N4BH6lCWxas865NvaJsuW4q+/vPvElw8lX
	Y
X-Google-Smtp-Source: AGHT+IGV0yrZDqhOVx4JNFSFoQNS2SQlvfJx689/qtzw+625UvSPEP90JWnJn/JSguaXcYgLIwA+Nw==
X-Received: by 2002:a05:6402:40ce:b0:5be:db8a:7f60 with SMTP id 4fb4d7f45d1cf-5c0891a2680mr2403755a12.25.1724432726109;
        Fri, 23 Aug 2024 10:05:26 -0700 (PDT)
From: Javi Merino <javi.merino@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	Javi Merino <javi.merino@cloud.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [XEN PATCH v2 0/3] libxl: Fixes for libxl_xenconsole_readline()
Date: Fri, 23 Aug 2024 18:05:02 +0100
Message-ID: <cover.1724430173.git.javi.merino@cloud.com>
X-Mailer: git-send-email 2.45.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fix nul-termination of the return value of
libxl_xen_console_read_line().  While at it, remove unneeded memset()s
to the buffer and improve the documentation of the function.

Changes since v1[0]:
  - Add Fixes: line to the first patch
  - Remove cr->count from the struct and make it a local variable in
    libxl_xen_console_read_line()
  - Improve the documentation of libxl_xen_console_read_line()

[0] https://lore.kernel.org/xen-devel/ad7c89bbae34155566ae7c9ca2cb501f21c7d585.1724330921.git.javi.merino@cloud.com/

Javi Merino (3):
  libxl: Fix nul-termination of the return value of
    libxl_xen_console_read_line()
  libxl: Remove unnecessary buffer zeroing and zalloc()
  libxl: Update the documentation of libxl_xen_console_read_line()

 tools/libs/light/libxl_console.c  | 40 ++++++++++++++++++-------------
 tools/libs/light/libxl_internal.h |  1 -
 2 files changed, 24 insertions(+), 17 deletions(-)

-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 17:05:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 17:05:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782501.1192006 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXjD-0004V2-JG; Fri, 23 Aug 2024 17:05:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782501.1192006; Fri, 23 Aug 2024 17:05:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXjD-0004Uv-G8; Fri, 23 Aug 2024 17:05:35 +0000
Received: by outflank-mailman (input) for mailman id 782501;
 Fri, 23 Aug 2024 17:05:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kBLJ=PW=cloud.com=javi.merino@srs-se1.protection.inumbo.net>)
 id 1shXjC-00048i-IT
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 17:05:34 +0000
Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com
 [2a00:1450:4864:20::536])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e8f107b9-6171-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 19:05:34 +0200 (CEST)
Received: by mail-ed1-x536.google.com with SMTP id
 4fb4d7f45d1cf-5bed83489c3so2851608a12.3
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 10:05:34 -0700 (PDT)
Received: from localhost.localdomain ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a3eb329sm2311240a12.55.2024.08.23.10.05.32
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 23 Aug 2024 10:05:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e8f107b9-6171-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724432733; x=1725037533; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=9VIye94cR8IJfpIZ8L9EApwOAmNPuWDMwQhUPHfNmgs=;
        b=MSJWAcbFddUMHEy6LfiUEbx7Di0J8MDNgNIDqxZE/MWH4ArPw3Pm8uj0ZQ0CfrJSLv
         XVdR5pG08UBTVq1NzreOJY/6MimeAyPrClfhisHOVTdMZ5224biUvfJyGYF6fqqZSr1x
         jSM5wfkte8dAYnVeQr1hhXh398n6rCDNDmu5M=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724432733; x=1725037533;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=9VIye94cR8IJfpIZ8L9EApwOAmNPuWDMwQhUPHfNmgs=;
        b=FdTsfJpVuh2gZIQO1TCZ/0QkUiVH5SO7pjp5zyvh2mlBSU9vbAZHZN1F3W8Uu6NiMO
         nn1gPqLr/XwY1K3IKVMXuxvXdPLYEHbPr4xnr6uV9rGDhjYQtbE082kDiDLPf09j/v6R
         PQSPj0LjIFBbLUew0pHoWG/2RNQ4USAyR5D27S8j8pfO3lqLZsUQlXBVJwGPOayg5vfT
         4aSa3VxSZUAshCNjJ1k7zd8b7u8obAARglmRLpGaffImTa2B/OLL6muG1wOZ6CRHfaNf
         pLj/E7S8gluOiqNIwz1bfzM6lHTpNi7HNs+t1IIFtl6R8F2ENABGp0d+NbWmLg+FlnZe
         xK+A==
X-Gm-Message-State: AOJu0Yzopp+Vggh6S2Q2LQ2ndzkDVth1pW3T0c0rJC5i+RN3JxHvmb5W
	8hSAFi9WgPy7HRjpWSi4uzqp1jyqoQpX6uUK1jLK2b1Y2jlvacWmo5wR2FFbf4M68ZZI9hni7vG
	c
X-Google-Smtp-Source: AGHT+IHcVUId93VWEXlfsjTxnksH0mjTfTAjn1kakV6hRAVCHTAcJ6ZkNu8RxbgHVtSlFErE5o2Rxg==
X-Received: by 2002:a05:6402:1d4f:b0:5bf:b29:6ec6 with SMTP id 4fb4d7f45d1cf-5c0891a9e7emr1746069a12.37.1724432732619;
        Fri, 23 Aug 2024 10:05:32 -0700 (PDT)
From: Javi Merino <javi.merino@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	Javi Merino <javi.merino@cloud.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	=?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@cloud.com>
Subject: [XEN PATCH v2 1/3] libxl: Fix nul-termination of the return value of libxl_xen_console_read_line()
Date: Fri, 23 Aug 2024 18:05:03 +0100
Message-ID: <b1c7eb226ce62f50d6a50baa3977830a31fa5c9b.1724430173.git.javi.merino@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1724430173.git.javi.merino@cloud.com>
References: <cover.1724430173.git.javi.merino@cloud.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

When built with ASAN, "xl dmesg" crashes in the "printf("%s", line)"
call in main_dmesg().  ASAN reports a heap buffer overflow: an
off-by-one access to cr->buffer.

The readconsole sysctl copies up to count characters into the buffer,
but it does not add a null character at the end.  Despite the
documentation of libxl_xen_console_read_line(), line_r is not
nul-terminated if 16384 characters were copied to the buffer.

Fix this by asking xc_readconsolering() to fill the buffer up to size
- 1.  As the number of characters in the buffer is only needed in
libxl_xen_console_read_line(), make it a local variable there instead
of part of the libxl__xen_console_reader struct.

Fixes: 4024bae739cc ("xl: Add subcommand 'xl dmesg'")
Reported-by: Edwin Török <edwin.torok@cloud.com>
Signed-off-by: Javi Merino <javi.merino@cloud.com>
---
 tools/libs/light/libxl_console.c  | 14 ++++++++++----
 tools/libs/light/libxl_internal.h |  1 -
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/tools/libs/light/libxl_console.c b/tools/libs/light/libxl_console.c
index a563c9d3c7f9..012fd996fba9 100644
--- a/tools/libs/light/libxl_console.c
+++ b/tools/libs/light/libxl_console.c
@@ -774,12 +774,14 @@ libxl_xen_console_reader *
 {
     GC_INIT(ctx);
     libxl_xen_console_reader *cr;
-    unsigned int size = 16384;
+    /* We want xen to fill the buffer in as few hypercalls as
+     * possible, but xen will not nul-terminate it.  Leave one byte at
+     * the end for the null */
+    unsigned int size = 16384 + 1;
 
     cr = libxl__zalloc(NOGC, sizeof(libxl_xen_console_reader));
     cr->buffer = libxl__zalloc(NOGC, size);
     cr->size = size;
-    cr->count = size;
     cr->clear = clear;
     cr->incremental = 1;
 
@@ -800,10 +802,14 @@ int libxl_xen_console_read_line(libxl_ctx *ctx,
                                 char **line_r)
 {
     int ret;
+    /* number of chars to copy into the buffer.  xc_readconsolering()
+     * does not add a null character at the end, so leave a space for
+     * us to add it. */
+    unsigned int nr_chars = cr->size - 1;
     GC_INIT(ctx);
 
     memset(cr->buffer, 0, cr->size);
-    ret = xc_readconsolering(ctx->xch, cr->buffer, &cr->count,
+    ret = xc_readconsolering(ctx->xch, cr->buffer, &nr_chars,
                              cr->clear, cr->incremental, &cr->index);
     if (ret < 0) {
         LOGE(ERROR, "reading console ring buffer");
@@ -811,7 +817,7 @@ int libxl_xen_console_read_line(libxl_ctx *ctx,
         return ERROR_FAIL;
     }
     if (!ret) {
-        if (cr->count) {
+        if (nr_chars) {
             *line_r = cr->buffer;
             ret = 1;
         } else {
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index 3b58bb2d7f43..96d14f5746e1 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -2077,7 +2077,6 @@ _hidden char *libxl__uuid2string(libxl__gc *gc, const libxl_uuid uuid);
 struct libxl__xen_console_reader {
     char *buffer;
     unsigned int size;
-    unsigned int count;
     unsigned int clear;
     unsigned int incremental;
     unsigned int index;
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 17:05:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 17:05:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782503.1192016 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXjM-0004tn-QP; Fri, 23 Aug 2024 17:05:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782503.1192016; Fri, 23 Aug 2024 17:05:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXjM-0004tb-N6; Fri, 23 Aug 2024 17:05:44 +0000
Received: by outflank-mailman (input) for mailman id 782503;
 Fri, 23 Aug 2024 17:05:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kBLJ=PW=cloud.com=javi.merino@srs-se1.protection.inumbo.net>)
 id 1shXjL-0004r8-Kc
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 17:05:43 +0000
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [2a00:1450:4864:20::534])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ed7acc3a-6171-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 19:05:41 +0200 (CEST)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5a10835487fso3577961a12.1
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 10:05:41 -0700 (PDT)
Received: from localhost.localdomain ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a3eb329sm2311240a12.55.2024.08.23.10.05.40
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 23 Aug 2024 10:05:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ed7acc3a-6171-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724432741; x=1725037541; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=XFEkl0EMoN1DvmJO1HoJ/u/U+K3mFLD5lcEOzlHVel4=;
        b=UCiVZZg1bJTFmbBpU01imLK7TmyVi6D7DcnZTx7wKIuD96xdWYUsByjyuz0WnEdtV3
         CAbLLrZUdXazikE81I3kXtlQNyKJ6a68RgPfg500e6Xk5zeTDMBhoBa8a9FkWkL4MW4O
         R4ACI+WozH06pXnqWrXckRKhdMomE9pTyOB+s=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724432741; x=1725037541;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=XFEkl0EMoN1DvmJO1HoJ/u/U+K3mFLD5lcEOzlHVel4=;
        b=XgedvPSjn7u+qBt2XJdxyDjRR0WUSuT/70psMKpwXyZI3FMD1ZyKzwALPnegjHi3eb
         IlD9AQ5RCn1dogG0pd10pc+xo6R7ykv84irbyr+NfKAvZ8MFY2Y98DNUm5a6kyMPDHcF
         Y6iOAIltMxPDnpSrhTY9xmzbxaXqzP3xWk8LO2EadnUR7YEQE79HjniFCp2+MaJldRCL
         SCzTWkPB3cvGXHXW5g/3xFQQ52mVw4g4uTuBGh84WUsA7ChxVsFTobotdQBlDc59WhUc
         NiKeLjQBCl4hCUqBKyTMk3aYnjMzoAYmpne4MjcdkYavXoVpE7ajUzmmKA8uCaoxgWnJ
         Pbww==
X-Gm-Message-State: AOJu0YzYaM/0eaq2BaQOOLc46oe+1EL8ZMPFKc6LgPjU0y2OIRNi/ZsO
	Xa3tHDUpTAGn5BhiSXsUknJwd8Oqc4ZrqK8ej3RvcG6foJZzy/PD0UeLi4ut3P3ghekzvLM+KJB
	7
X-Google-Smtp-Source: AGHT+IH6FyymKyCPUj5/UdPZsLtONLq48URxhfGe+UappiQ0B70aRoGrd/MjeFqdgoKUW8HST4a5Pg==
X-Received: by 2002:a05:6402:1d49:b0:5a2:fc48:db12 with SMTP id 4fb4d7f45d1cf-5c0891758d1mr2240292a12.19.1724432740912;
        Fri, 23 Aug 2024 10:05:40 -0700 (PDT)
From: Javi Merino <javi.merino@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	Javi Merino <javi.merino@cloud.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [XEN PATCH v2 2/3] libxl: Remove unnecessary buffer zeroing and zalloc()
Date: Fri, 23 Aug 2024 18:05:04 +0100
Message-ID: <ab2cb7430109e345ed6a294d9e8b2329bb373d2a.1724430173.git.javi.merino@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1724430173.git.javi.merino@cloud.com>
References: <cover.1724430173.git.javi.merino@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

When reading the console, xen overwrites the contents of the buffer,
so there is no need to zero the buffer before passing it to xen.
Instead, add a NULL at the end of the buffer.

While we are at it, change the zalloc() of the buffer back to
malloc() as it was before bdf4131 (libxl: don't leak buf in
libxl_xen_console_read_start error handling, 2013-12-03).  The comment
in that commit message says that the intent of the commit was to
change malloc+memset to zalloc(), but only for the
libxl_xen_console_reader struct, not for the buffer.

Signed-off-by: Javi Merino <javi.merino@cloud.com>
---
 tools/libs/light/libxl_console.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_console.c b/tools/libs/light/libxl_console.c
index 012fd996fba9..f42f6a51ee6f 100644
--- a/tools/libs/light/libxl_console.c
+++ b/tools/libs/light/libxl_console.c
@@ -780,7 +780,7 @@ libxl_xen_console_reader *
     unsigned int size = 16384 + 1;
 
     cr = libxl__zalloc(NOGC, sizeof(libxl_xen_console_reader));
-    cr->buffer = libxl__zalloc(NOGC, size);
+    cr->buffer = libxl__malloc(NOGC, size);
     cr->size = size;
     cr->clear = clear;
     cr->incremental = 1;
@@ -808,7 +808,6 @@ int libxl_xen_console_read_line(libxl_ctx *ctx,
     unsigned int nr_chars = cr->size - 1;
     GC_INIT(ctx);
 
-    memset(cr->buffer, 0, cr->size);
     ret = xc_readconsolering(ctx->xch, cr->buffer, &nr_chars,
                              cr->clear, cr->incremental, &cr->index);
     if (ret < 0) {
@@ -818,6 +817,7 @@ int libxl_xen_console_read_line(libxl_ctx *ctx,
     }
     if (!ret) {
         if (nr_chars) {
+            cr->buffer[nr_chars] = '\0';
             *line_r = cr->buffer;
             ret = 1;
         } else {
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 17:05:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 17:05:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782504.1192026 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXjQ-0005Ca-2f; Fri, 23 Aug 2024 17:05:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782504.1192026; Fri, 23 Aug 2024 17:05:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXjP-0005CO-VR; Fri, 23 Aug 2024 17:05:47 +0000
Received: by outflank-mailman (input) for mailman id 782504;
 Fri, 23 Aug 2024 17:05:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kBLJ=PW=cloud.com=javi.merino@srs-se1.protection.inumbo.net>)
 id 1shXjO-00048i-Bs
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 17:05:46 +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 efd1f8cb-6171-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 19:05:45 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5becd359800so2673563a12.0
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 10:05:45 -0700 (PDT)
Received: from localhost.localdomain ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a3eb329sm2311240a12.55.2024.08.23.10.05.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 23 Aug 2024 10:05:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: efd1f8cb-6171-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724432745; x=1725037545; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=y9zU8RmotkcMzPPMMUF5U/qTDP3KTxHaHOi0grkKB0I=;
        b=fL+Z3U8Is+8tPbrNmEB6OTzoHvtWXkKlYupaIw6Z2IEsbuwAOiJ7dbxVSCrW2rkxWD
         LlwSTvNPh0flO/KhhtKy37eYWXSH6y1AhZq3Ot6T4bOu8hk6aJ17V+NRGYD83D3+40mp
         G2QBnk0ArKa7aJ9z8YKbcqcQfZjTSUt+m2prY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724432745; x=1725037545;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=y9zU8RmotkcMzPPMMUF5U/qTDP3KTxHaHOi0grkKB0I=;
        b=l1epFnY2V/YVtworvEVqJ+edIoIDtM83a4GTDcq3SrQQ/MYsxuiNMrMHJZdtXNhg4w
         v23oPe/ljIAsdepZ+5nal2AMcYOum5kh13domyhQmzQoVah8ppRvpSz359nNBoY2iPrm
         Lbv0hdWz7FcrRpdbD+KnxH0kgBPUVAHe2qf02gkUetRWCsw8OpeD8B2Fw3vseo1BEPGV
         YxwPYhe8Z74C1+s7/l+wkksT1mNvD9+jbNmqEINJ/gMxRfipyQNDeXedwoSXl+3FMvST
         KjKMnp25xbEElcqs+a0Rb9+0PcnOdm/4c2LnfcDqbLU50bf90h2HbCAv+BiuQlFo0bcX
         tEZA==
X-Gm-Message-State: AOJu0YwpfHzL2GO0UHBdrTRRXTUqxzrIHc/m7elhzNjo/i1r36/PANMA
	8HUKFoN0IqBKoKWISmmgGSXTTh53lkz2vkiFUXT2YM50lC8B74VbR84AzGu+wT9RR7OMlLcWMh3
	I
X-Google-Smtp-Source: AGHT+IH9gi47eRDyTWF0F5XtXBpBWXTDCGEMNeCDo7kB6ResJleCMbF7ptrc272MMZ0N4AvTK/Oeww==
X-Received: by 2002:a05:6402:34c5:b0:5be:9bc5:f6b3 with SMTP id 4fb4d7f45d1cf-5c089158f81mr2090157a12.2.1724432744780;
        Fri, 23 Aug 2024 10:05:44 -0700 (PDT)
From: Javi Merino <javi.merino@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	Javi Merino <javi.merino@cloud.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>
Subject: [XEN PATCH v2 3/3] libxl: Update the documentation of libxl_xen_console_read_line()
Date: Fri, 23 Aug 2024 18:05:05 +0100
Message-ID: <d868579d9ea98d8072630f5b85f7f7250ece393d.1724430173.git.javi.merino@cloud.com>
X-Mailer: git-send-email 2.45.2
In-Reply-To: <cover.1724430173.git.javi.merino@cloud.com>
References: <cover.1724430173.git.javi.merino@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Despite its name, libxl_xen_console_read_line() does not read a line,
it fills the buffer with as many characters as fit.  Update the
documentation to reflect the real behaviour of the function.  Rename
line_r to avoid confusion since it is a pointer to an array of
characters.

Signed-off-by: Javi Merino <javi.merino@cloud.com>
---
 tools/libs/light/libxl_console.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/tools/libs/light/libxl_console.c b/tools/libs/light/libxl_console.c
index f42f6a51ee6f..652897e4ef6d 100644
--- a/tools/libs/light/libxl_console.c
+++ b/tools/libs/light/libxl_console.c
@@ -789,17 +789,19 @@ libxl_xen_console_reader *
     return cr;
 }
 
-/* return values:                                          *line_r
- *   1          success, whole line obtained from buffer    non-0
- *   0          no more lines available right now           0
- *   negative   error code ERROR_*                          0
- * On success *line_r is updated to point to a nul-terminated
+/* Copy part of the console ring into a buffer
+ *
+ * Return values:
+ *   1: Success, the buffer obtained from the console ring an
+ *   0: No more lines available right now
+ *   -ERROR_* on error
+ *
+ * On success, *line_r is updated to point to a nul-terminated
  * string which is valid until the next call on the same console
- * reader.  The libxl caller may overwrite parts of the string
- * if it wishes. */
+ * reader. */
 int libxl_xen_console_read_line(libxl_ctx *ctx,
                                 libxl_xen_console_reader *cr,
-                                char **line_r)
+                                char **buff)
 {
     int ret;
     /* number of chars to copy into the buffer.  xc_readconsolering()
@@ -818,10 +820,10 @@ int libxl_xen_console_read_line(libxl_ctx *ctx,
     if (!ret) {
         if (nr_chars) {
             cr->buffer[nr_chars] = '\0';
-            *line_r = cr->buffer;
+            *buff = cr->buffer;
             ret = 1;
         } else {
-            *line_r = NULL;
+            *buff = NULL;
             ret = 0;
         }
     }
-- 
2.45.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 17:19:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 17:19:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782534.1192035 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXwX-0000s1-8B; Fri, 23 Aug 2024 17:19:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782534.1192035; Fri, 23 Aug 2024 17:19:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shXwX-0000ru-5X; Fri, 23 Aug 2024 17:19:21 +0000
Received: by outflank-mailman (input) for mailman id 782534;
 Fri, 23 Aug 2024 17:19: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=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shXwV-0000ro-T5
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 17:19:20 +0000
Received: from mail-qk1-x72a.google.com (mail-qk1-x72a.google.com
 [2607:f8b0:4864:20::72a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d3ac7e84-6173-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 19:19:18 +0200 (CEST)
Received: by mail-qk1-x72a.google.com with SMTP id
 af79cd13be357-7a1dea79e1aso132246585a.1
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 10:19:18 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6c162d49e1asm20598916d6.34.2024.08.23.10.19.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 23 Aug 2024 10:19:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d3ac7e84-6173-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724433557; x=1725038357; 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=lJSCweDSTwWUs38vyHETenZE7V4JOT6YUtYqRS42w8g=;
        b=qg9dOotoyj89nSltULMJN3KFxeD3a2VV1jtInOw9BPltFWhinieFmZ6sY65ltJz0Jq
         /1LKPxvMSyCUFKoS2hV4ISIpN2RAL4t0s3NhJg849f+TZpAxiDhGRCKyUvAXRHSatWl6
         o4hZ0IkMXGp8WVQhNdysD+xeskj4sv/9VlV9o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724433557; x=1725038357;
        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=lJSCweDSTwWUs38vyHETenZE7V4JOT6YUtYqRS42w8g=;
        b=INt7+SLRS/Upc+wpyoH+1G56BAtFeZHLQf7KzfRfS7AdybE3nh6Nv8mdWxRob7kBkt
         AbT2BC5IssqkLLCjBg5OElzao4mW/H+HcZiiUF0y9ChXA5RP+Cte3XoffBPYJNxvNSFb
         LoMwyeay/9EmJeq3lFjfRAmxQQtNb0M9PUz9e/e0bSx1/GNGEOYxp1A71t7HXfaEluHk
         TWRkGHax9r7lYNDAM2jgl9ND6UEZfmRLoxbARItIFouOIFNGy+m7Rxvyyo7vNSCO6GzN
         TEdDIdstYp0rSir4ccfPZq8ni/9dQ65iR0FfUUjUl8Ik2AS07lvVuCMd4PoxDWqeomaK
         hqCQ==
X-Forwarded-Encrypted: i=1; AJvYcCVz7OB6xIzCOWkrbVj7b4c2i5y86l7doiqa8PlA+GeLbyLfiEH3gUrCmYM3NwrqkAA+qq602CyfRLg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YytWy/oAr3Sk32NLNgELY+Vd762ig+Hh6B0wSo8iTEDQ3rRSr9x
	P0x/xPmVyOHEMK1uKECPI2XoWNS8nP3+OFA+FSAI3G+Ne84fx1ST6OuOISUKC+FAZPJ7iJWlHlk
	K
X-Google-Smtp-Source: AGHT+IHvny4c83C6Oo544Qh1orNFcoU1AZ1SD+4veXLV3Ye7wUYdkl5WNe5y2dWa8L24uvszjJF65w==
X-Received: by 2002:a05:6214:54c6:b0:6c1:6f9b:619a with SMTP id 6a1803df08f44-6c16f9b63admr30455566d6.30.1724433556321;
        Fri, 23 Aug 2024 10:19:16 -0700 (PDT)
Message-ID: <da0e9836-33f3-42c3-bda7-53d868a99ae1@citrix.com>
Date: Fri, 23 Aug 2024 18:19:11 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 2/4] ocaml/libs: Implement a dynamically-loaded plugin
 for Xenctrl.domain_getinfo
To: Andrii Sultanov <andrii.sultanov@cloud.com>,
 xen-devel@lists.xenproject.org
Cc: Christian Lindig <christian.lindig@citrix.com>,
 David Scott <dave@recoil.org>, Anthony PERARD <anthony.perard@vates.tech>,
 =?UTF-8?B?RWR3aW4gVMO2csO2aw==?= <edwin.torok@cloud.com>
References: <cover.1724314239.git.andrii.sultanov@cloud.com>
 <6d4b94939c8910ffd7d70301b1d26c828f72ad86.1724314239.git.andrii.sultanov@cloud.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <6d4b94939c8910ffd7d70301b1d26c828f72ad86.1724314239.git.andrii.sultanov@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 22/08/2024 10:06 am, Andrii Sultanov wrote:
> This plugin intends to hide the unstable Xenctrl interface under a
> stable one. In case of the change in the interface, a V2 of this plugin
> would need to be produced, but V1 with the old interface would
> need to be kept (with potential change in the implementation) in the
> meantime.
>
> To reduce the need for such changes in the future, this plugin only
> provides the absolute minimum functionality that Oxenstored uses - only
> four fields of the domaininfo struct are used and presented here.
>
> Oxenstored currently uses the single-domain domain_getinfo function,
> whereas Cxenstored uses the more-efficient domain_getinfolist. Both of
> these are provided in the plugin to allow a transition from one to the
> other without modifying the interface in the future. Both return
> identical structures and rely on the same fields in xenctrl, thus if one
> of them breaks, both will break, and a new version of the interface would
> need to be issued.
>
> Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
> ---
>  tools/ocaml/Makefile                          |   1 +
>  tools/ocaml/Makefile.rules                    |  17 +-

This patch is already very big.  One minor way to help would be to split
out the changes to Makefile.rules as a separate "build infrastructure
for Ocaml dynamic libraries".

>  tools/ocaml/libs/Makefile                     |   2 +-
>  tools/ocaml/libs/xenstoredglue/META.in        |   4 +
>  tools/ocaml/libs/xenstoredglue/Makefile       |  39 ++++
>  .../domain_getinfo_plugin_v1/META.in          |   5 +
>  .../domain_getinfo_plugin_v1/Makefile         |  38 ++++
>  .../domain_getinfo_stubs_v1.c                 | 169 ++++++++++++++++++
>  .../domain_getinfo_v1.ml                      |  51 ++++++
>  .../domain_getinfo_v1.mli                     |   0
>  .../libs/xenstoredglue/plugin_interface_v1.ml |  25 +++
>  .../xenstoredglue/plugin_interface_v1.mli     |  34 ++++
>  12 files changed, 383 insertions(+), 2 deletions(-)
>  create mode 100644 tools/ocaml/libs/xenstoredglue/META.in
>  create mode 100644 tools/ocaml/libs/xenstoredglue/Makefile
>  create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/META.in
>  create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/Makefile
>  create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c
>  create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.ml
>  create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.mli
>  create mode 100644 tools/ocaml/libs/xenstoredglue/plugin_interface_v1.ml
>  create mode 100644 tools/ocaml/libs/xenstoredglue/plugin_interface_v1.mli

Peeking at your specfile change for XenServer too, I see that the only
new file packaged is:

%{_libexecdir}/%{name}/bin/xenctrl_plugin/domain_getinfo_v1.cmxs

So does this mean that the rest of xenstoredglue is just a build-time
requirement for oxenstored?

If so, then surely we'll still need to package it in
xen-ocaml-{libs,devel}, so an out-of-tree oxenstored can build?


Who should own plugin ABIs?  Logically it ought to oxenstored, but the
way this is structured, it's looks like its Xen which would end up
owning it.


Are we expecting to get one cmxs per $THING-$VERSION?  xenctrl_plugin is
a bit generic, and it probably ought to have xenstoredglue somewhere in
the path.

Talking of, can we call it xenstored-glue or perhaps just xsd-glue?  Or
will Ocaml's sensitivity around names get in our way?

Are there any standards on Ocaml dynamic libraries, or are we playing in
rare waters here?


> diff --git a/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c
> new file mode 100644
> index 0000000000..a29ac7c877
> --- /dev/null
> +++ b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c
> @@ -0,0 +1,169 @@
> +#define _XOPEN_SOURCE 600

This is very unlikely to be relevant.  It probably wants dropping from
elsewhere in Xen too.

> +#include <stdlib.h>
> +#include <errno.h>
> +
> +#define CAML_NAME_SPACE
> +#include <caml/alloc.h>
> +#include <caml/memory.h>
> +#include <caml/signals.h>
> +#include <caml/fail.h>
> +#include <caml/callback.h>
> +#include <caml/custom.h>
> +
> +#include <xen-tools/common-macros.h>
> +
> +#include <string.h>

Given the other sorting, this wants to be up by stdlib.

> +#define XC_WANT_COMPAT_MAP_FOREIGN_API

This is definitely not needed by this stub.

> +#include <xenctrl.h>
> +
> +#define ERR_MSG_LEN (XC_MAX_ERROR_MSG_LEN + 6)
> +#define MAX_FUNC_LINE_LEN 64
> +#define failwith_xc_v1(xch) xsglue_failwith_xc(xch, __FUNCTION__, __LINE__)
> +
> +// This is a minimal stub to xenctrl for oxenstored's purposes
> +// For the full xenctrl stubs, see tools/ocaml/libs/xc/xenctrl_stubs.c

Xen style is to use /* */ uniformly.  (Xen really does predate C++
comments being commonly supported in C compilers.)

> +
> +static inline xc_interface *xsglue_xch_of_val_v1(value v)
> +{
> +	xc_interface *xch = *(xc_interface **)Data_custom_val(v);
> +
> +	return xch;
> +}
> +
> +static void xsglue_xenctrl_finalize(value v)
> +{
> +	xc_interface *xch = xsglue_xch_of_val_v1(v);
> +
> +	xc_interface_close(xch);
> +}
> +
> +static struct custom_operations xsglue_xenctrl_ops = {
> +	.identifier  = "xenctrl",
> +	.finalize    = xsglue_xenctrl_finalize,
> +	.compare     = custom_compare_default,     /* Can't compare     */
> +	.hash        = custom_hash_default,        /* Can't hash        */
> +	.serialize   = custom_serialize_default,   /* Can't serialize   */
> +	.deserialize = custom_deserialize_default, /* Can't deserialize */
> +	.compare_ext = custom_compare_ext_default, /* Can't compare     */
> +};
> +
> +static void Noreturn xsglue_failwith_xc(xc_interface *xch,
> +		char const* func,
> +		int line)

const char *func, unsigned int line)

Unless you think there's a likelyhood that we'll get errors from a
negative line number.

> +{
> +	char error_str[ERR_MSG_LEN + MAX_FUNC_LINE_LEN];
> +	size_t str_len = 0;
> +	if (xch) {
> +		const xc_error *error = xc_get_last_error(xch);
> +		if (error->code == XC_ERROR_NONE)
> +			str_len = snprintf(error_str, ERR_MSG_LEN,
> +				           "%d: %s", errno, strerror(errno));
> +		else
> +			str_len = snprintf(error_str, ERR_MSG_LEN,
> +				      	   "%d: %s: %s", error->code,
> +					   xc_error_code_to_desc(error->code),
> +					   error->message);
> +	} else {
> +		str_len = snprintf(error_str, ERR_MSG_LEN,
> +			           "Unable to open XC interface");
> +	}
> +	str_len = str_len < ERR_MSG_LEN ? str_len : ERR_MSG_LEN;
> +	// Log caller's source code function and line
> +	snprintf(error_str+str_len, MAX_FUNC_LINE_LEN,
> +                 " - called from %s:%d", func, line);
> +	caml_raise_with_string(*caml_named_value("xsg.error"), error_str);

There's a lot of complexity here, not least because of trying to handle
the !xch special case.

But, to begin with, what is xsg.error?  I see there's a registration of
something by that name.  Is the Error referenced there the `exception
Error of string` from the module?

If so, what happens if we get a v2 module?  Won't we get a clash on the
name of this exception?


For the string handling, life is too short for fixed bounds like this. 
I'd recommend something more of the form:

...
        const xc_error *error = xch ? xc_get_last_error(xch) : NULL;
        char *str = NULL;
        CAMLlocal1(msg);

#define ERR (error && error->code != XC_ERROR_NONE)

        asprintf(&str,
                 "%d: %s%s%s - called from %s:%u"
                 ERR ? error->code : errno,
                 ERR ? xc_error_code_to_desc(error->code) : strerror(errno),
                 ERR ? ": " : "",
                 ERR ? error->message : "",
                 func, line);

#endif

        if (!*str)
                caml_raise_out_of_memory();

        msg = caml_copy_string(str);
        free(str);

        caml_raise_with_arg(*caml_named_value("xsg.error"), msg);
}

This has the property that even in the !xsh special case, it still
renders errno which might be helpful when debugging.

> +}
> +
> +CAMLprim value stub_xsglue_xc_interface_open(value unit)
> +{
> +	CAMLparam1(unit);
> +	CAMLlocal1(result);
> +	xc_interface *xch;
> +
> +	result = caml_alloc_custom(&xsglue_xenctrl_ops, sizeof(xch), 0, 1);
> +
> +	caml_enter_blocking_section();
> +	xch = xc_interface_open(NULL, NULL, 0);
> +	caml_leave_blocking_section();
> +
> +	if ( !xch )

This wants to be `if (!xch)` to match the rest of the file style.

> +		failwith_xc_v1(xch);
> +
> +	*(xc_interface **)Data_custom_val(result) = xch;
> +
> +	CAMLreturn(result);
> +}
> +
> +static value xsglue_alloc_domaininfo_v1(xc_domaininfo_t * info)

xc_domaininfo_t *info

And probably a const for good measure.

> +{
> +	CAMLparam0();
> +	CAMLlocal1(result);
> +	result = caml_alloc_tuple(4);
> +
> +	Store_field(result,  0, Val_int(info->domain));
> +	Store_field(result,  1, Val_bool(info->flags & XEN_DOMINF_dying));
> +	Store_field(result,  2, Val_bool(info->flags & XEN_DOMINF_shutdown));
> +	Store_field(result,  3, Val_int(MASK_EXTR(info->flags, XEN_DOMINF_shutdownmask)));
> +
> +	CAMLreturn(result);
> +}
> +
> +CAMLprim value stub_xsglue_xc_domain_getinfo(value xch_val, value domid)
> +{
> +	CAMLparam2(xch_val, domid);
> +	CAMLlocal1(result);
> +	xc_interface *xch = xsglue_xch_of_val_v1(xch_val);
> +	xc_domaininfo_t info;
> +	int ret;
> +
> +	ret = xc_domain_getinfo_single(xch, Int_val(domid), &info);
> +	if (ret < 0)
> +		failwith_xc_v1(xch);
> +
> +	result = xsglue_alloc_domaininfo_v1(&info);
> +
> +	CAMLreturn(result);
> +}
> +
> +CAMLprim value stub_xsglue_xc_domain_getinfolist(value xch_val, value first_domain, value nb)
> +{
> +	CAMLparam3(xch_val, first_domain, nb);
> +	CAMLlocal2(result, temp);
> +	xc_interface *xch = xsglue_xch_of_val_v1(xch_val);
> +	xc_domaininfo_t * info;
> +	int i, ret, toalloc, retval;
> +	unsigned int c_max_domains;
> +	uint32_t c_first_domain;
> +
> +	/* get the minimum number of allocate byte we need and bump it up to page boundary */
> +	toalloc = (sizeof(xc_domaininfo_t) * Int_val(nb)) | 0xfff;
> +	ret = posix_memalign((void **) ((void *) &info), 4096, toalloc);
> +	if (ret)
> +		caml_raise_out_of_memory();
> +
> +	result = temp = Val_emptylist;
> +
> +	c_first_domain = Int_val(first_domain);
> +	c_max_domains = Int_val(nb);
> +	caml_enter_blocking_section();
> +	retval = xc_domain_getinfolist(xch, c_first_domain,
> +				       c_max_domains, info);
> +	caml_leave_blocking_section();
> +
> +	if (retval < 0) {
> +		free(info);
> +		failwith_xc_v1(xch);
> +	}
> +	for (i = 0; i < retval; i++) {
> +		result = caml_alloc_small(2, Tag_cons);
> +		Field(result, 0) = Val_int(0);

The is Val_none, isn't it?

I've got a patch I should dust off to provide some C stub compatibility
for Ocaml < 4.12, which at least introduces some of the more common naming.

> +		Field(result, 1) = temp;
> +		temp = result;
> +
> +		Store_field(result, 0, xsglue_alloc_domaininfo_v1(info + i));
> +	}
> +
> +	free(info);
> +	CAMLreturn(result);
> +}
> diff --git a/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.ml b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.ml
> new file mode 100644
> index 0000000000..d8947b618f
> --- /dev/null
> +++ b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_getinfo_v1.ml
> @@ -0,0 +1,51 @@
> +(** Minimal interface on top of unstable Xenctrl for Oxenstored's usage *)
> +
> +(** For the full Xenctrl interface, see: tools/ocaml/libs/xc/ *)
> +
> +module M : Plugin_interface_v1.Domain_getinfo_V1 = struct
> +  exception Error of string
> +
> +  type domid = int
> +  type handle
> +
> +  type domaininfo = {
> +    domid : domid;
> +    dying : bool;
> +    shutdown : bool;
> +    shutdown_code : int;

I see Xenctrl uses this as an int too, but do we want to consider

type shutdown_code =
  | SHUTDOWN_poweroff
  | SHUTDOWN_reboot
  | SHUTDOWN_suspend
  | SHUTDOWN_crash
  | SHUTDOWN_watchdog
  | SHUTDOWN_soft_reset

One awkward thing is that the shutdown_code isn't valid unless the
shutdown bool is true, but we could fix this by having:

type domaininfo = {
  domid : domind;
  shutdown : Some shutdown_code;
}

One downside is that we'd have to bump the interface version when adding
new constants, and we'd have to be very careful not to generate a bad
SHUTDOWN_* constant as far as Ocaml is concerned.

I'm on the fence, but it's something to consider before we set the ABI
in stone.

> +  }
> +
> +  external interface_open : unit -> handle = "stub_xsglue_xc_interface_open"
> +
> +  external domain_getinfo : handle -> domid -> domaininfo
> +    = "stub_xsglue_xc_domain_getinfo"
> +
> +  external __domain_getinfolist : handle -> domid -> int -> domaininfo list
> +    = "stub_xsglue_xc_domain_getinfolist"
> +
> +  let domain_getinfolist handle first_domain =
> +    (* [rev_concat lst] is equivalent to [lst |> List.concat |> List.rev]
> +     * except it is tail recursive, whereas [List.concat] isn't.
> +     * Example:
> +     * rev_concat [[10;9;8];[7;6];[5]]] = [5; 6; 7; 8; 9; 10]
> +     *)
> +    let rev_append_fold acc e = List.rev_append e acc in
> +    let rev_concat lst = List.fold_left rev_append_fold [] lst in
> +
> +    let nb = 1024 in
> +    let rec __getlist lst from =
> +      (* _domain_getinfolist returns domains in reverse order, largest first *)
> +      match __domain_getinfolist handle from nb with
> +      | [] -> rev_concat lst
> +      | hd :: _ as l -> __getlist (l :: lst) (hd.domid + 1)
> +    in
> +    __getlist [] first_domain

This (and the C) was a hack to avoid being too invasive at the time
(iirc, it was a Xenctrl interface used by Xenopsd and we didn't want to
change the API), but it's racy when there are more than @nb domains running.

The problem is that in between the multiple hypercalls, you've dropped
Xen's domlist lock, and e.g. a new domain with a lower domid could have
come into existence.  This doesn't matter for most things, but
Oxenstored is the authoritative source of which domains are alive or
not, and it does need to be accurate.

Oxenstored really does need to make a single hypercall asking for all
32k domains in order to get a coherent view.  This is how Cxenstored works.

However, we can do this from within C and also not double-process the
resulting list.

On that subject, is list the right thing here, or would an array be
better?  One has less in the way of pointer chasing than the other,
although whether it makes any appreciable difference is a different
question.

> +
> +  let _ = Callback.register_exception "xsg.error" (Error "register_callback")
> +end
> +
> +let () =
> +  Printf.printf "Registration of %s plugin started\n%!" __MODULE__;
> +  Plugin_interface_v1.register_plugin_v1
> +    (module M : Plugin_interface_v1.Domain_getinfo_V1);
> +  Printf.printf "Registration of %s plugin successful\n%!" __MODULE__

Its rude for libraries to make assumptions about stdout.  Indeed,
oxenstored uses syslog() rather than stdout.

If this can't be hooked into Oxenstored's logging infrastructure, then
the printf() want gating on some kind of debug setting, most likely an
environment variable.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 17:25:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 17:25:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782543.1192046 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shY2X-0002P7-1q; Fri, 23 Aug 2024 17:25:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782543.1192046; Fri, 23 Aug 2024 17:25:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shY2W-0002P0-U2; Fri, 23 Aug 2024 17:25:32 +0000
Received: by outflank-mailman (input) for mailman id 782543;
 Fri, 23 Aug 2024 17:25: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=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shY2V-0002Ou-UJ
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 17:25:31 +0000
Received: from mail-oo1-xc33.google.com (mail-oo1-xc33.google.com
 [2607:f8b0:4864:20::c33])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b1e38f5b-6174-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 19:25:30 +0200 (CEST)
Received: by mail-oo1-xc33.google.com with SMTP id
 006d021491bc7-5d5bf833de7so1636482eaf.2
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 10:25:30 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a67f342a80sm197740585a.33.2024.08.23.10.25.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 23 Aug 2024 10:25:27 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b1e38f5b-6174-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724433929; x=1725038729; 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=2UxEMWL1PLeHTCBIbdcq3fe9CLARcePLYJpQkQj1bFE=;
        b=YJGmZW1oDWb1W2bYCev7CRWLOGpWemulmMgjLdestsVQh2UoCMK0QFNRnLe/2BgRw4
         Hxkm0eBYn4LTrsAMCbQNG3OxXeYUmAIAqQYGupcXxBdAfQ5u7ko3PcjnydBFAJO7K2cT
         olDMc01NwjZYyjPhaEwD0pja0x0IPxq3WfrRQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724433929; x=1725038729;
        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=2UxEMWL1PLeHTCBIbdcq3fe9CLARcePLYJpQkQj1bFE=;
        b=CO4Q75QsQkVmYOHzIeO/fcvr2j7+qkv177BDj0/2cSbuugjZiX2RmzQMMQQsTHvoJk
         n/oFhWT08Yr5xTOkfWxGjF618iITKWlKzeJWMc2VSZK5JIHbB7DTDeQ0dhelMUB9b6DI
         QOi/1bvNHVhlPOD/+dKKu4xtibAbZTaQyaPk2o2ykHBh6sgNQiRpr/fzMHm3U+utWhpZ
         VVDt12L+vz6EAT82Ueea2FAtrxtKPJv2GJFxrGspwh8s+ij8+O83NyD1HN5ZdQTNXuJU
         GUdRk1Vu7ZSnvlV6c3qcOIAjd4GG2GCnK6tzU+kPZo3rmmJ97CqnGMaDZ5xzp2BH/j35
         1XGw==
X-Forwarded-Encrypted: i=1; AJvYcCWyD//KjnV4ZYEP+wOeUKGy8bIP0Fmrr0su46OyXiF1DUvvUdixfzFf6E1tNziLJ/PtENRrst6J1j8=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy/fCxt87o8AubvzDcDsUAbgA4BqtucQGFhyYcphw2e/GqYfuXY
	ZGrRx/7zi9fWxm2CgKfGakJc7UDXS3Uk0CpcVIwAY0F6vt5awvz+iMLlmrZliNg=
X-Google-Smtp-Source: AGHT+IEvfpcx9eqELvZov4EvGT99gYi02QW1Fmz4+0QzIFNMrehMZFWLqnF9NbnViEEk0FKxPyXMLw==
X-Received: by 2002:a05:6358:2605:b0:1ac:efb0:fb2e with SMTP id e5c5f4694b2df-1b5c21e9050mr347342055d.22.1724433929222;
        Fri, 23 Aug 2024 10:25:29 -0700 (PDT)
Message-ID: <6efb4e1c-429f-4b32-bead-3d84b0e60dd7@citrix.com>
Date: Fri, 23 Aug 2024 18:25:24 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 3/4] tools/oxenstored: Use the plugin for
 Xenctrl.domain_getinfo
To: Andrii Sultanov <andrii.sultanov@cloud.com>,
 xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony.perard@vates.tech>,
 Christian Lindig <christian.lindig@citrix.com>, David Scott <dave@recoil.org>
References: <cover.1724314239.git.andrii.sultanov@cloud.com>
 <c40ed2c49f0d72d227a1ab2ef90be0e24e17382c.1724314239.git.andrii.sultanov@cloud.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <c40ed2c49f0d72d227a1ab2ef90be0e24e17382c.1724314239.git.andrii.sultanov@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 22/08/2024 10:06 am, Andrii Sultanov wrote:
> diff --git a/tools/ocaml/xenstored/domains.ml b/tools/ocaml/xenstored/domains.ml
> index 7a3056c364..e3edee6de6 100644
> --- a/tools/ocaml/xenstored/domains.ml
> +++ b/tools/ocaml/xenstored/domains.ml
> @@ -20,10 +20,36 @@ let warn fmt  = Logging.warn  "domains" fmt
>  
>  let xc = Xenctrl.interface_open ()
>  
> -type domains = {
> -  eventchn: Event.t;
> -  table: (Xenctrl.domid, Domain.t) Hashtbl.t;
> +let load_plug fname =
> +  let fail_with fmt = Printf.ksprintf failwith fmt in
> +  let fname = Dynlink.adapt_filename fname in
> +  if Sys.file_exists fname then
> +    try Dynlink.loadfile fname with
> +    | Dynlink.Error err as e ->
> +        Printf.eprintf "ERROR loading plugin '%s': %s\n%!" fname
> +          (Dynlink.error_message err);
> +        raise e
> +    | _ -> fail_with "Unknown error while loading plugin"
> +  else fail_with "Plugin file '%s' does not exist" fname
> +
> +let () =
> +  let filepath = Paths.xen_ctrl_plugin ^ "/domain_getinfo_v1.cmxs" in
> +  Printf.printf "Trying to load plugin '%s'\n%!" filepath;
> +  let list_files = Sys.readdir Paths.xen_ctrl_plugin in
> +  Printf.printf "Directory listing of '%s'\n%!" Paths.xen_ctrl_plugin;
> +  Array.iter (fun x -> Printf.printf "\t%s\n%!" x) list_files;
> +  Dynlink.allow_only [ "Plugin_interface_v1" ];
> +  load_plug filepath
> +
> +module Plugin =
> +  (val Plugin_interface_v1.get_plugin_v1 ()
> +      : Plugin_interface_v1.Domain_getinfo_V1)
> +
> +let handle = Plugin.interface_open ()
>  
> +type domains = {
> +  eventchn : Event.t;
> +  table : (Plugin.domid, Domain.t) Hashtbl.t;

Looking at just this hunk in isolation, I think you want to split this
patch into two; one to load the plugin, and a second to switch away from
using Xenctrl.domain_getinfo.

As this is Oxenstored, rather than a library, assumptions about stdout
are less bad, but it would still be nice if the logging could be plumbed
into the main logging functionality.  Or, does this all run so early on
boot that we haven't parsed oxenstored.conf yet?

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 17:32:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 17:32:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782552.1192055 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shY8l-0004nl-M0; Fri, 23 Aug 2024 17:31:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782552.1192055; Fri, 23 Aug 2024 17:31:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shY8l-0004ne-JC; Fri, 23 Aug 2024 17:31:59 +0000
Received: by outflank-mailman (input) for mailman id 782552;
 Fri, 23 Aug 2024 17:31:58 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shY8k-0004nY-Oi
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 17:31:58 +0000
Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com
 [2607:f8b0:4864:20::732])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9747f5b5-6175-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 19:31:56 +0200 (CEST)
Received: by mail-qk1-x732.google.com with SMTP id
 af79cd13be357-7a3375015f8so144536985a.1
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 10:31:56 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a67f343d3asm198715585a.48.2024.08.23.10.31.52
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 23 Aug 2024 10:31:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9747f5b5-6175-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724434314; x=1725039114; 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=hYBtPI4D05F8UqvLuqAU6Ulb5s2kANd+Ngqkyj1whOU=;
        b=idtHnkwttrZcK+SPh5yUo39lqq9wiyNq7meQlRcRoKtRo0+i35ATAFpNla5mex8tfh
         HOVFct8iKYTAFHYilZPkoGdvCdq0RiCW8jg1YIW6GOZFf2NVfMlMvMETrDchmIdlO5Gd
         RvGGDRd6gEp762+nEWfiwK4U6dMqww6BIDpKo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724434314; x=1725039114;
        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=hYBtPI4D05F8UqvLuqAU6Ulb5s2kANd+Ngqkyj1whOU=;
        b=fAxCCbPBEEs6mppy9gPR8GHbaSVP37soVwZp5AaZFDPvWsyX9aPiO2PtNm6vUlplE9
         V9qzPwlFmZhl+TrZqiu2oTbqAkfdjkWn/628iNlzG71OjxyPoNFb4oZBH0XMAhtqzHaj
         ZzmAbt9JZ4ZsPuewmdvxp3DKz24PaxKxxSV38NaGjxeTnduEc7b4oLndQluvBz+8qfGq
         bBQuW48PGjL9ds4W7YusGkDCi9cU7qlzbs8PSSrMPGkWFYFsSbeAwWPi0rhvyHAFo6EN
         2N4DgYZSYYPs7hdh9cIui00m+HtQ9G3lXBvPiVzdZVgVsJvpsHpZMSpLp35GJSjzm7IF
         +P6A==
X-Forwarded-Encrypted: i=1; AJvYcCWNiOisr3Ye2v2mgwzlJjQKpdeDe6QiG+eFlham05cOQdXe7F80Ri8IlEsFZv3DUoUfdMtJvD4cYyM=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw3YBxiFevBK1ShbXBafo6W6vdIb9Uydjy4bYpFmlW7oetQOtoz
	u49Pl0Hd3EIjLue1RQeVipsmjrrvfPg1SKReFeGJJrjMbLZRxfKrt4IB3wKY2iaWc2GGGgXVkwX
	8
X-Google-Smtp-Source: AGHT+IE03cfP9sOksr7XS37MiOX8TCr2xoBoG/YfuvTk5Wl2fthSTQ+sESZQ2DTGugTPGD9oHRQZ6g==
X-Received: by 2002:a05:620a:40d0:b0:79f:1098:a949 with SMTP id af79cd13be357-7a6896e0e59mr270071785a.4.1724434314113;
        Fri, 23 Aug 2024 10:31:54 -0700 (PDT)
Message-ID: <d27fa081-50fa-423f-a292-ee8083b47c51@citrix.com>
Date: Fri, 23 Aug 2024 18:31:50 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v2 3/3] libxl: Update the documentation of
 libxl_xen_console_read_line()
To: Javi Merino <javi.merino@cloud.com>, xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com, Anthony PERARD <anthony.perard@vates.tech>,
 Juergen Gross <jgross@suse.com>
References: <cover.1724430173.git.javi.merino@cloud.com>
 <d868579d9ea98d8072630f5b85f7f7250ece393d.1724430173.git.javi.merino@cloud.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <d868579d9ea98d8072630f5b85f7f7250ece393d.1724430173.git.javi.merino@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 23/08/2024 6:05 pm, Javi Merino wrote:
> diff --git a/tools/libs/light/libxl_console.c b/tools/libs/light/libxl_console.c
> index f42f6a51ee6f..652897e4ef6d 100644
> --- a/tools/libs/light/libxl_console.c
> +++ b/tools/libs/light/libxl_console.c
> @@ -789,17 +789,19 @@ libxl_xen_console_reader *
>      return cr;
>  }
>  
> -/* return values:                                          *line_r
> - *   1          success, whole line obtained from buffer    non-0
> - *   0          no more lines available right now           0
> - *   negative   error code ERROR_*                          0
> - * On success *line_r is updated to point to a nul-terminated
> +/* Copy part of the console ring into a buffer
> + *
> + * Return values:
> + *   1: Success, the buffer obtained from the console ring an
> + *   0: No more lines available right now
> + *   -ERROR_* on error
> + *
> + * On success, *line_r is updated to point to a nul-terminated

*buff.

Also this really wants to say somewhere "despite the function name,
there can be multiple lines in the returned buffer" or something to this
effect.

>   * string which is valid until the next call on the same console
> - * reader.  The libxl caller may overwrite parts of the string
> - * if it wishes. */
> + * reader. */

While I don't want to derail this patch further, what happens if there
happens to be an embedded \0 in Xen's console?  The hypercall is works
by a count of chars, and AFACIT, in this function we're assuming that
there's no \0 earlier in the string.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 18:00:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 18:00:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782563.1192065 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shYaA-0002QF-Q3; Fri, 23 Aug 2024 18:00:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782563.1192065; Fri, 23 Aug 2024 18:00:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shYaA-0002Q8-NS; Fri, 23 Aug 2024 18:00:18 +0000
Received: by outflank-mailman (input) for mailman id 782563;
 Fri, 23 Aug 2024 18:00:17 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=MDtM=PW=amd.com=stefano.stabellini@srs-se1.protection.inumbo.net>)
 id 1shYa9-0002Q2-KK
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 18:00:17 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on2060d.outbound.protection.outlook.com
 [2a01:111:f403:2412::60d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8b62ddb2-6179-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 20:00:14 +0200 (CEST)
Received: from BYAPR07CA0068.namprd07.prod.outlook.com (2603:10b6:a03:60::45)
 by IA1PR12MB8285.namprd12.prod.outlook.com (2603:10b6:208:3f6::19)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Fri, 23 Aug
 2024 18:00:06 +0000
Received: from SJ5PEPF000001F3.namprd05.prod.outlook.com
 (2603:10b6:a03:60:cafe::3) by BYAPR07CA0068.outlook.office365.com
 (2603:10b6:a03:60::45) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend
 Transport; Fri, 23 Aug 2024 18:00:06 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SJ5PEPF000001F3.mail.protection.outlook.com (10.167.242.71) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 18:00:05 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 13:00:05 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 13:00:04 -0500
Received: from ubuntu-20.04.2-arm64.shared (10.180.168.240) by
 SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2507.39 via Frontend Transport; Fri, 23 Aug 2024 13:00:04 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8b62ddb2-6179-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=WH35kBiOVZxCIDTlH5xgk54p+DlmnQdVZLoWvnn0bP3rv7bHD7kOxhqdRgA0+i1MUROZ1kQUd7dEHh4v6HxmiOpixqKk+PREqSPWD0DcFCgWencD3+UbJXRFsSrosTuqvmOjEMTRVOcYcQxuKk6qnqEdN6A1ASugGHxHpDhJ4gk+cSUhNtKINbvbVxy9YMhqGLHCwx6eZL3ZbZAtwpc13ZNiFAJJvUtK6R9g0weYpgGrLzfcCfOW7NJMYA8cYbkahfgJYr3abbJwKnMxWe8YZifS+evV2/nQqFJi173F4qArPNMcmvfZc/8vIhdPZfD2EFUP+wceVwIBJlMEu9K7rQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LfzpGZMDmtdl4dSoE7N6VP/grakgFOJct3JY2bcYMtg=;
 b=FyFtnH0yvH/kcEqvSQAtzt8XwbFQElfdHqYKRdVI6l+zo2AfxMs/O6E2qwKa1cJlKP46JGiRZEElw7FI93lZ5OVZrMm78B+BxMZ8NlbCe1f6VUQtOlZKkdbQkwg/d+aCCUF82H5CQGkrxqkn63ABUWViljd3vtmyvjYBSPVi48GXXRMg3IEzydBKWhRsimN+VS4L0MMMvUzsse7frjhLNzeEKcF0FpjWbX7nyHfHqkTK3Ml8HzkRvjiCAarWl1xDdcT76hM7mXBJ8YWnHRbt78hEUBqDVqXGmyYN8fBHP6VDYiY+e1TJwC6BHjMJUqe9hNiqLN0wBXJYN+n5Qn4ZCw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=arm.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LfzpGZMDmtdl4dSoE7N6VP/grakgFOJct3JY2bcYMtg=;
 b=RMRgoZTkgj1lcvnK4fVRM31Udke1i6Us5jvRK3Xg1r8o2o2RoKA1n0aoZCPL7XAgD3T6rjX0KLeudPyWI2zlnAnPusR9kwUIHBFTBPb2ly1QuG6cVEwAQ7tUrqdqq8Ba3DZ3giUwTgYvJkCqs71A2SseZvDdvwK+Ica9mrr77o4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Date: Fri, 23 Aug 2024 11:00:04 -0700
From: Stefano Stabellini <stefano.stabellini@amd.com>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Ayan Kumar Halder <ayankuma@amd.com>
CC: Bertrand Marquis <Bertrand.Marquis@arm.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Michal Orzel <michal.orzel@amd.com>, "Ayan Kumar
 Halder" <ayan.kumar.halder@amd.com>, Xen-devel
	<xen-devel@lists.xenproject.org>, Artem Mygaiev <artem_mygaiev@epam.com>
Subject: Re: [PATCH] docs: fusa: Add requirements for generic timer
In-Reply-To: <d5e97cae-fc6d-4913-88ca-47ecb157752c@amd.com>
Message-ID: <alpine.DEB.2.22.394.2408231035220.3871186@ubuntu-linux-20-04-desktop>
References: <20240820103816.1661102-1-ayan.kumar.halder@amd.com> <5F0AF572-3437-4372-96EB-42F46B3A3155@arm.com> <101a7105-5638-4c69-a5b0-29c252284aea@amd.com> <D3358591-F9E2-44A6-A22A-FC2AA8857C68@arm.com> <alpine.DEB.2.22.394.2408221327400.3871186@ubuntu-linux-20-04-desktop>
 <9DA45539-F136-40D8-BF46-E63EA1B8ADA6@arm.com> <d5e97cae-fc6d-4913-88ca-47ecb157752c@amd.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset="US-ASCII"
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001F3:EE_|IA1PR12MB8285:EE_
X-MS-Office365-Filtering-Correlation-Id: ee4dc1ab-2b7e-4a20-b7f6-08dcc39d6b74
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?H0mYCkGuiEZQCsUD/bJKE3jxX7uNCr+TCV02eK6q7yrE2lsn1kdKmm7tVWmW?=
 =?us-ascii?Q?ISXfYqH3JIx0I55zAZvM7lAM8BcSBL8FBEy3fpihC4v+CGWmMVFVsFuNgTVp?=
 =?us-ascii?Q?T4SDqFvFp6IsuVGcfmoN1dfminN/AOfMYBZkLTUYAEO20l7jDXy3kvc3JvWt?=
 =?us-ascii?Q?J9Csf2tUj1DMa8YsHQ94OMu4becOgOU7WeJ8BZqKoTgLi4maf6TJKn/64h31?=
 =?us-ascii?Q?43TRHItls5QSN8YMLsWYBIHXYlx8MVH63NXAz40fGREFuQLdufoOKZdqIcBW?=
 =?us-ascii?Q?ngUMTiSvcyqcXZXIqdFZzHpq2IWuuYFwngz+WTsJw4QD8msE7boprCuh9+7c?=
 =?us-ascii?Q?sRmSG9Ognkq2/P7+jq9OID2m1NbLsWVm1OgARK4xC21K54qO7Hy+rKZ6GOgN?=
 =?us-ascii?Q?P+nl0O+i+p6ucMAunsUX2CRiWRwvCIGPBfxGwjZBPcoxs3A2FkyPGmw7gQrq?=
 =?us-ascii?Q?i0ywCEpsXTPYwDbL/bNaCQNDkuV4bLD2dz4zWjZjJIHQOy28fTSoKsglod0H?=
 =?us-ascii?Q?+TIwMfhW3aZOwfza/9HHOWfP0qJ/6sq9GAkXwwbJuLVI9dPV8pUYSlo8fQPA?=
 =?us-ascii?Q?lO7dQEaieBYRU8vetkYJe652Yr5zUIEasFMeAZF0ucKTWI85EJR+IS49vhdw?=
 =?us-ascii?Q?fK1WAxjrdYqS7ZqQywP9hrldbqElJz93vYGLmf4Qrgd87y9L8dTlNOb8SNoh?=
 =?us-ascii?Q?Zz12qrw6wz5IVlEploeCz27SrNJZmn6Q09vdVNh0uPC3+j2dblDPA3ixDR+E?=
 =?us-ascii?Q?p8z2VFK8BtwUWUVZt21mFPmpOUYc0GYCl/JNri5Fqluyen2kJ+H37Njv0nUe?=
 =?us-ascii?Q?4C3RO0a6n0a41ikBQX8ynIbsoUk1onm+NeBADkFuFp5CYsOJGqv5PaJyUFES?=
 =?us-ascii?Q?B16+lISu0dGk5/lnJPx7MIecm3XmnMf/kwh07LPOpHvmRMYOMCzdFL3gp4nT?=
 =?us-ascii?Q?SzbaETWDya9uB5L2vssi1Bjiw3LOypFxrWuMHfqKp5gGG4kajHWmaum8ARzL?=
 =?us-ascii?Q?wufBceaNAeqLXPhsbkkYXvbtH/aN1PxS3/U3D052uKda4j2tXGMp+xmhPXKC?=
 =?us-ascii?Q?2Umq9fc4GYTB416urJKVHqalq4DpaNnKkHe2MtMotsWCsCpx6a1rSdrypj+i?=
 =?us-ascii?Q?ONFPJJiKwn+65UPGciiopuRsumcjm94fhkg/Lz086+Mo0I0Yd5vPdaiPL+cm?=
 =?us-ascii?Q?Y793UvzfwBVemuKCag3XZLBm5y3FRxoBIXqAvOEKSifN+hWJ4X5CFHxX1/a3?=
 =?us-ascii?Q?V+OxI25DIG1VwcXkF12xtvKV1oxAi2R7Hol8pKBQpAsDeEWFIWM0Nxij4CGs?=
 =?us-ascii?Q?AtPaM530WEZvjE929R8xrikAcAEUPrxtFyroioKRi+QGjDXacbHdyCnbNqDu?=
 =?us-ascii?Q?EkQjOCIYv6Z0U8NQGXNeHaKGljoxRrqzXklsNE+B919CrxyQHBnncb6ip4La?=
 =?us-ascii?Q?P0o4PLMiEHRDpwTak2HthLgvw/7gpMJW?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 18:00:05.8454
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ee4dc1ab-2b7e-4a20-b7f6-08dcc39d6b74
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF000001F3.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8285

On Fri, 23 Aug 2024, Ayan Kumar Halder wrote:
> Hi Bertrand/Stefano/Michal,
> 
> On 23/08/2024 08:22, Bertrand Marquis wrote:
> > Hi Stefano,
> > 
> > > On 22 Aug 2024, at 22:29, Stefano Stabellini <sstabellini@kernel.org>
> > > wrote:
> > > 
> > > On Thu, 21 Aug 2024, Bertrand Marquis wrote:
> > > > > On 22 Aug 2024, at 11:00, Michal Orzel <michal.orzel@amd.com> wrote:
> > > > > 
> > > > > Hi Bertrand,
> > > > > 
> > > > > I agree with all your comments with a few exceptions, as stated below.
> > > > > 
> > > > > On 21/08/2024 17:06, Bertrand Marquis wrote:
> > > > > > 
> > > > > > Hi Ayan,
> > > > > > 
> > > > > > > On 20 Aug 2024, at 12:38, Ayan Kumar Halder
> > > > > > > <ayan.kumar.halder@amd.com> wrote:
> > > > > > > 
> > > > > > > From: Michal Orzel <michal.orzel@amd.com>
> > > > > > > 
> > > > > > > Add the requirements for the use of generic timer by a domain
> > > > > > > 
> > > > > > > Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> > > > > > > Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> > > > > > > ---
> > > > > > > .../reqs/design-reqs/arm64/generic-timer.rst  | 139
> > > > > > > ++++++++++++++++++
> > > > > > > docs/fusa/reqs/index.rst                      |   3 +
> > > > > > > docs/fusa/reqs/intro.rst                      |   3 +-
> > > > > > > docs/fusa/reqs/market-reqs/reqs.rst           |  34 +++++
> > > > > > > docs/fusa/reqs/product-reqs/arm64/reqs.rst    |  24 +++
> > > > > > > 5 files changed, 202 insertions(+), 1 deletion(-)
> > > > > > > create mode 100644
> > > > > > > docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
> > > > > > > create mode 100644 docs/fusa/reqs/market-reqs/reqs.rst
> > > > > > > create mode 100644 docs/fusa/reqs/product-reqs/arm64/reqs.rst
> > > > > > > 
> > > > > > > diff --git a/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
> > > > > > > b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
> > > > > > > new file mode 100644
> > > > > > > index 0000000000..bdd4fbf696
> > > > > > > --- /dev/null
> > > > > > > +++ b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
> > > > > > > @@ -0,0 +1,139 @@
> > > > > > > +.. SPDX-License-Identifier: CC-BY-4.0
> > > > > > > +
> > > > > > > +Generic Timer
> > > > > > > +=============
> > > > > > > +
> > > > > > > +The following are the requirements related to ARM Generic Timer
> > > > > > > [1] interface
> > > > > > > +exposed by Xen to Arm64 domains.
> > > > > > > +
> > > > > > > +Probe the Generic Timer device tree node from a domain
> > > > > > > +------------------------------------------------------
> > > > > > > +
> > > > > > > +`XenSwdgn~arm64_generic_timer_probe_dt~1`
> > > > > > > +
> > > > > > > +Description:
> > > > > > > +Xen shall generate a device tree node for the Generic Timer (in
> > > > > > > accordance to
> > > > > > > +ARM architected timer device tree binding [2]).
> > > > > > You might want to say where here. The domain device tree ?
> > > > > > 
> > > > > > > +
> > > > > > > +Rationale:
> > > > > > > +
> > > > > > > +Comments:
> > > > > > > +Domains shall probe the Generic Timer device tree node.
> > > > > > Please prevent the use of "shall" here. I would use "can".
> > > > > > Also detect the presence of might be better than probe.
> > > > > > 
> > > > > > > +
> > > > > > > +Covers:
> > > > > > > + - `XenProd~emulated_timer~1`
> > > > > > > +
> > > > > > > +Read system counter frequency
> > > > > > > +-----------------------------
> > > > > > > +
> > > > > > > +`XenSwdgn~arm64_generic_timer_read_freq~1`
> > > > > > > +
> > > > > > > +Description:
> > > > > > > +Xen shall expose the frequency of the system counter to the
> > > > > > > domains.
> > > > > > The requirement would need to say in CNTFRQ_EL0 and in the domain
> > > > > > device tree xxx entry.
> > > > > > 
> > > > > > > +
> > > > > > > +Rationale:
> > > > > > > +
> > > > > > > +Comments:
> > > > > > > +Domains shall read it via CNTFRQ_EL0 register or
> > > > > > > "clock-frequency" device tree
> > > > > > > +property.
> > > > > > I do not think this comment is needed.
> > > > > > 
> > > > > > > +
> > > > > > > +Covers:
> > > > > > > + - `XenProd~emulated_timer~1`
> > > > > > > +
> > > > > > > +Access CNTKCTL_EL1 system register from a domain
> > > > > > > +------------------------------------------------
> > > > > > > +
> > > > > > > +`XenSwdgn~arm64_generic_timer_access_cntkctlel1~1`
> > > > > > > +
> > > > > > > +Description:
> > > > > > > +Xen shall expose counter-timer kernel control register to the
> > > > > > > domains.
> > > > > > "counter-timer kernel" is a bit odd here, is it the name from arm
> > > > > > arm ?
> > > > > > Generic Timer control registers ? or directly the register name.
> > > > > This is the name from Arm ARM. See e.g.:
> > > > > https://developer.arm.com/documentation/ddi0601/2023-12/AArch64-Registers/CNTKCTL-EL1--Counter-timer-Kernel-Control-Register?lang=en
> > > > Right then i would use the same upper cases: Counter-timer Kernel
> > > > Control
> > > > register and still mention CNTKCTL_EL1 as it would be clearer.
> > > > 
> > > > > > > +
> > > > > > > +Rationale:
> > > > > > > +
> > > > > > > +Comments:
> > > > > > > +Domains shall access the counter-timer kernel control register to
> > > > > > > allow
> > > > > > > +controlling the access to the timer from userspace (EL0).
> > > > > > This is documented in the arm arm, this comment is not needed.
> > > > > > 
> > > > > > > +
> > > > > > > +Covers:
> > > > > > > + - `XenProd~emulated_timer~1`
> > > > > > > +
> > > > > > > +Access virtual timer from a domain
> > > > > > > +----------------------------------
> > > > > > > +
> > > > > > > +`XenSwdgn~arm64_generic_timer_access_virtual_timer~1`
> > > > > > > +
> > > > > > > +Description:
> > > > > > > +Xen shall expose the virtual timer registers to the domains.
> > > > > > > +
> > > > > > > +Rationale:
> > > > > > > +
> > > > > > > +Comments:
> > > > > > > +Domains shall access and make use of the virtual timer by
> > > > > > > accessing the
> > > > > > > +following system registers:
> > > > > > > +CNTVCT_EL0,
> > > > > > > +CNTV_CTL_EL0,
> > > > > > > +CNTV_CVAL_EL0,
> > > > > > > +CNTV_TVAL_EL0.
> > > > > > The requirement to be complete should give this list, not the
> > > > > > comment.
> > > > > > 
> > > > > > > +
> > > > > > > +Covers:
> > > > > > > + - `XenProd~emulated_timer~1`
> > > > > > > +
> > > > > > > +Access physical timer from a domain
> > > > > > > +-----------------------------------
> > > > > > > +
> > > > > > > +`XenSwdgn~arm64_generic_timer_access_physical_timer~1`
> > > > > > > +
> > > > > > > +Description:
> > > > > > > +Xen shall expose physical timer registers to the domains.
> > > > > > > +
> > > > > > > +Rationale:
> > > > > > > +
> > > > > > > +Comments:
> > > > > > > +Domains shall access and make use of the physical timer by
> > > > > > > accessing the
> > > > > > > +following system registers:
> > > > > > > +CNTPCT_EL0,
> > > > > > > +CNTP_CTL_EL0,
> > > > > > > +CNTP_CVAL_EL0,
> > > > > > > +CNTP_TVAL_EL0.
> > > > > > same as upper
> > > > > > 
> > > > > > > +
> > > > > > > +Covers:
> > > > > > > + - `XenProd~emulated_timer~1`
> > > > > > > +
> > > > > > > +Trigger the virtual timer interrupt from a domain
> > > > > > > +-------------------------------------------------
> > > > > > > +
> > > > > > > +`XenSwdgn~arm64_generic_timer_trigger_virtual_interrupt~1`
> > > > > > > +
> > > > > > > +Description:
> > > > > > > +Xen shall enable the domains to program the virtual timer to
> > > > > > > generate the
> > > > > > > +interrupt.
> > > > > > I am not sure this is right here.
> > > > > > You gave access to the registers upper so Xen responsibility is not
> > > > > > really to
> > > > > > enable anything but rather make sure that it generates an interrupt
> > > > > > according to
> > > > > > how the registers have been programmed.
> > > > > I'm in two minds about it. On one hand you're right and the IRQ
> > > > > trigger is a side-effect
> > > > > of programming the registers correctly. On the other, these are design
> > > > > requirements which
> > > > > according to "fusa/reqs/intro.rst" describe what SW implementation is
> > > > > doing. Our way of injecting
> > > > > timer IRQs into guests is a bit different (phys timer is fully
> > > > > emulated and we use internal timers
> > > > > and for virt timer we first route IRQ to Xen, mask the IRQ and inject
> > > > > to guest). If I were to write
> > > > > tests to cover Generic Timer requirements I'd expect to cover whether
> > > > > r.g. masking/unmasking IRQ works,
> > > > > whether IRQ was received, etc.
> > > > This is true but i think it would be more logic in non design
> > > > requirements to
> > > > phrase things to explain the domain point of view rather than how it is
> > > > implemented.
> > > > 
> > > > Here the point is to have a timer fully functional from guest point of
> > > > view, including
> > > > getting interrupts when the timer should generate one.
> > > > 
> > > > Maybe something like: Xen shall generate timer interrupts to domains
> > > > when the timer condition asserts.
> > > Both statements are correct.
> > > 
> > > Michal's original statement "Xen shall enable the domains to program the
> > > virtual timer to generate the interrupt" is correct. The timer interrupt
> > > will be generated by the hardware to Xen, if the guest programs the
> > > registers correctly. If Xen does nothing, the interrupt is still
> > > generated and received by Xen.
> > > 
> > > Bertrand's statement is also correct. Xen needs to generate a virtual
> > > timer interrupt equivalent to the physical timer interrupt, after
> > > receiving the physical interrupt.
> > > 
> > > I think the best statement would be a mix of the two, something like:
> > > 
> > > Xen shall enable the domain to program the virtual timer to generate
> > > the interrupt, which Xen shall inject as virtual interrupt into the
> > > domain.
> > This should be split into 2 reqs (2 shall) and the second one might in
> > fact be a generic one for interrupt injections into guests.
> 
> I agree with you that the second statement shall be a requirement for vGIC (as
> it has nothing to do with the timer).
> 
> So, do we agree that the requirements should be
> 
> 1. Xen shall generate physical timer interrupts to domains when the physical
> timer condition is met.
> 
> 2. Xen shall generate virtual timer interrupts to domains when the virtual
> timer condition is met.
> 
> The important thing here is that Xen can generate both physical timer and
> virtual timer IRQs. It is left to the guests to use one or both.
> 
> We can drop the comments here if it is causing confusion.
> 
> Let me know your thoughts.

I'm happy to give my approval to any and all versions discussed in this
thread:

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


I could suggest further improvements or point out minor issues with any
of the wordings (including my wording), but I don't think it would be
useful. Any of these statements is good. I don't believe we need to
refine the English text any further.

Unlike code, the potential for text revisions in English is limitless.
It's always possible to find things not quite clear enough, or rephrase
in a way that is clearer and more comprehensive. Also because "clear" is
subjective.

I think it is important that we do not put too much effort into this
because the reward is not proportional.


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 18:02:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 18:02:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782574.1192076 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shYcU-000314-B4; Fri, 23 Aug 2024 18:02:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782574.1192076; Fri, 23 Aug 2024 18:02:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shYcU-00030x-7O; Fri, 23 Aug 2024 18:02:42 +0000
Received: by outflank-mailman (input) for mailman id 782574;
 Fri, 23 Aug 2024 18:02:41 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=S9BN=PW=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1shYcT-00030p-5l
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 18:02:41 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on2061e.outbound.protection.outlook.com
 [2a01:111:f403:2417::61e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e1c406d5-6179-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 20:02:39 +0200 (CEST)
Received: from CH0PR04CA0049.namprd04.prod.outlook.com (2603:10b6:610:77::24)
 by SN7PR12MB8028.namprd12.prod.outlook.com (2603:10b6:806:341::8)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Fri, 23 Aug
 2024 18:02:33 +0000
Received: from CH1PEPF0000AD7F.namprd04.prod.outlook.com
 (2603:10b6:610:77:cafe::48) by CH0PR04CA0049.outlook.office365.com
 (2603:10b6:610:77::24) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19 via Frontend
 Transport; Fri, 23 Aug 2024 18:02:33 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CH1PEPF0000AD7F.mail.protection.outlook.com (10.167.244.88) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 18:02:33 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 13:02:32 -0500
Received: from [172.20.142.25] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Fri, 23 Aug 2024 13:02:31 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e1c406d5-6179-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=GK8rCIA2VuON1aBW4iZhomC0nD6WFRYxBGmH294rNbm+SPTJX5keYkBvzXR4Ch/TroA9qpmgihTDhmm2HciEsDZ6Qb8qqkj/dw2EHMlmdEJd/D+jwjJG/Emkm20pDBK3HivRnwWMtJHz5T0khlMItctZs1idslZCau3LMg5f5n7vIhvfLPqsMMqPF0vJsAoxJOVXWUcEBSycdBFohUfQVvK1DdJ6HZ4hNPkCb4Q0GR/buxFtx4DZQJrdFN44WMvQHKsGYpo9Mp3O4o4Wbq9xDoRVyJ9BDD7nQ94dAm32HaTm4r7EiqtY69iZMnMjSBQqiAD+yFXAqQ3WMTW6uoH6xQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=101NKS/q49Y8PycYuNb81Md7WzKTjF3oRWtqwfWxQkQ=;
 b=vruaWaljg21/w5L/0+TNcGXHUQa6+oPjqgd9LsA/CEQYD5P7VwAHvHBkLFhDnFfTdngTXjXD8VCQGV9Yjxvq0k2IfZalitD+QrtHgEDRVgy8OvW4loTmIuEheh9vgTnK8fEFOCDZsGmyWGrzeBJXW1Ud1CC0eJeO2LPmz8RIzug8G2aVhLDiCV2BoXoWL5V3Xh+vej3phQfcvnzz+7eUk+3uSBn6QXzaknvdJjgFeA+8HmM1TY8x9TzVvrDQ9q3QCV9SF3PFTXsKewXD8Qtnv6bbjQ8ZuHeXviFaSA8+m/O89hPIlIHOJXVMzSfcKmSwFd9DFF1bTvgnyj+tbTHomw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=101NKS/q49Y8PycYuNb81Md7WzKTjF3oRWtqwfWxQkQ=;
 b=1YhFwP+/AnfrJP9ASuw9nhRxCo9aUI0OodcBZCqnLlWk2OlI2SBIf0iAe6cwc6uxtFlBCqqQaSj9sG6s5U9vXukcXV2Izb+6f1wdZOb47L2jgFC3pjvBXxDoZnHxYVKpyEzdoH5VKewuvXp31JI7Y8XO2lmQY1h2UDfFkxizHaE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <cad62469-aae0-4725-bfc9-1229ae6c7c9f@amd.com>
Date: Fri, 23 Aug 2024 14:02:30 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/msi: fix locking for SR-IOV devices
To: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Teddy Astie
	<teddy.astie@vates.tech>, <xen-devel@lists.xenproject.org>
References: <20240812203938.981588-1-stewart.hildebrand@amd.com>
 <74f88a45-a632-4ca6-9cee-95f52370b397@suse.com>
 <c05c9312-e729-48fb-942f-fbb378cd097a@amd.com>
 <8c0d428f-5122-4ec7-ab3b-3f61f6322211@suse.com>
Content-Language: en-US
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
In-Reply-To: <8c0d428f-5122-4ec7-ab3b-3f61f6322211@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB03.amd.com: stewart.hildebrand@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD7F:EE_|SN7PR12MB8028:EE_
X-MS-Office365-Filtering-Correlation-Id: cca38f01-9732-4d88-cc8c-08dcc39dc345
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?bjJ6d2lqYjdvREIvSjhzNjRhYnRVYlUvT3VaMXZFQ2RwajRIc2UxSG44endM?=
 =?utf-8?B?MDVoWkMxbWdvcm5qUFQ3aHNhMFlQdUxHdTdqMEZRejJGc2NYN0grWjgySlJL?=
 =?utf-8?B?eFdsMVIwS0VmYkhqY2pSZTNobmpMckFSYWpMTksrWElZZmNLRm9oM3ZYbkps?=
 =?utf-8?B?OFhuRTNScjZNWHhEN2RTa1hmM1dxKzg5VWhWc0dzYi9CZmcyS3ZXQlRnVHFs?=
 =?utf-8?B?T1B3N1Z5aWh5Y0d1dllob1pvcTZJN1lOUFFoWTJMUFRXS1g3Ymc4WVEzN0J4?=
 =?utf-8?B?c1Y3SCtNdk9DOXo3eTJrMGN2REpWOUkvNUUxMUtrSk44RlFPdG1xakdPSXRw?=
 =?utf-8?B?RXFrNlN4b1d4QUFadHc5QVIyNWIyYU1wOEVJRmFmc2lrUUUwd0ZXc3lVR0Nn?=
 =?utf-8?B?ZmpTTU9Nb1VMajNPZy9rY3FGZjY0c2RUQ1EwZ01hejRnNkpvTjIzTXYrWWp6?=
 =?utf-8?B?QytLUG5abGZiYy9qTFNwVlNsK21xRVBBR05sc1JOUXNLRmdRckpBUERVTkRH?=
 =?utf-8?B?L2JZek9ERFhvRXZZWDN4b001c2tMRitucFdLLzlJOFBQRjZoR001UzB1L2J2?=
 =?utf-8?B?SWQ0MzYvTEI1Vm5HVXcwMnhIK09wNTArNkdsSDB3U2FocTh5d3Noa1JFcUFm?=
 =?utf-8?B?VGNGZGVqMjVjbDRuZHkveGYvU1FsSkZKSjU4ZjlBbXJNWTVsNXBVdm0xOW42?=
 =?utf-8?B?NnNlOWJiM3VLVUoyZmt5a2dxV2tqRjNvRmhUa2sxZ2gwMWkzcnF0QlJDVmUy?=
 =?utf-8?B?aUNKaXMvNTdzVTM4L2xLOFR4NHJnaW93RnA3TUJlRFdOMjNBZVN1V21DZERu?=
 =?utf-8?B?NHVOaUF4bVZhLytRUTdsWkFkRE91QW52aEd5Z25qbkxrOTNuNVAyMUlOanh3?=
 =?utf-8?B?enBWbEVKb1hDTTdlQ05acDVCK3k2ZjZsVjhxMUVnV202N1Z4dzl4VUJodEdX?=
 =?utf-8?B?ZVFHOGRFL28zNGFhVlArTnN5SDlRZGQ2aVYzQ2dOZU1aTFBSVDZzd1BGV2k3?=
 =?utf-8?B?bjFCbUJlYjBpNnJvVkR3bmsxWk9Id1NuUlpVOVRCdyt6R0VlYzgvNnpxYnFG?=
 =?utf-8?B?VkJIZE8yaUVPaEZXbkFHNmQvYkhtaldQMTlwaHJyZ0JxMHhqUzBuTnFtbDFm?=
 =?utf-8?B?SzJoVVJ1cEYrQVZCUExsZWp4NTZPNDJxc3ZINVZqNlJHYUlFMDI4ZFoyYnRF?=
 =?utf-8?B?dXJzTFFrM3ZOWnRSRlJLY0dUcG9JNlM2eGNxckluYzJtWmRSZDY2SlRDZGd5?=
 =?utf-8?B?WGtXMHU2NW9kY1diTmpQeU5INlNtRGpGcEl6WVVvSEw5T2NWcERyODhsV0dF?=
 =?utf-8?B?U1VRWHgzcjNHOTErMFlCUFVwTFowb25qUnJPTkpuM0hhcEIwTVluOUFzOFdT?=
 =?utf-8?B?Uk16YVY3aElaM2cvTGdTVEJ1TFRvMkFmYmhUbklHckFHYkJaRVNNNW1yOFhu?=
 =?utf-8?B?MFlDc2hpU2tEREdvU3gwNmtjVDY4eHdJc1ZCUlVsZmZheDZGL2xXS2RuaFZ1?=
 =?utf-8?B?QlNpYjM2RTBESjFNREw1aklwTDk0V0FUT1VoOCtXZTVnNmEyc2pEbEphd3Ew?=
 =?utf-8?B?cGVGazVvUkJZRVo3ZEJWNEs4ZWhVT01YWExYVVRHMHU0QkJldzdYSzBDZWt2?=
 =?utf-8?B?ZVBCdkZldmpvbzIvQzlCMFNpN3RMRXFlYnBseUlZMHlQLzdjR2Z2RGNGbS8r?=
 =?utf-8?B?S1U4NTRHdm9tUmpqSGNvVmxyWFNwcXVSQUR1K0RGTTR5eHdGVnpheGV2cW9w?=
 =?utf-8?B?dXZabTNNYXhRcXdEakdsaFB5NnhGcTduWWJBYUoyK2RwdkJ0MVI5TlpXbVg4?=
 =?utf-8?B?Q0JUVTlmZkZCWlkvWnFEUUR3dCt2VXBVdXo4ZGRZREFEdGV2RnRxRG1xa2FM?=
 =?utf-8?B?N1psRXU3MU1jTHp0MGFyVDBINzg0MnZvWTNzd1V5eFcwREhETVA5SFY4SUFj?=
 =?utf-8?Q?b0PhIZE6m1QAKDwB/46hnseLivX0TAal?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 18:02:33.2399
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: cca38f01-9732-4d88-cc8c-08dcc39dc345
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH1PEPF0000AD7F.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8028

On 8/15/24 04:36, Jan Beulich wrote:
> On 15.08.2024 03:28, Stewart Hildebrand wrote:
>> On 8/13/24 10:01, Jan Beulich wrote:
>>> On 12.08.2024 22:39, Stewart Hildebrand wrote:
>>>> @@ -446,7 +448,27 @@ static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
>>>>  
>>>>      list_del(&pdev->alldevs_list);
>>>>      pdev_msi_deinit(pdev);
>>>> -    xfree(pdev);
>>>> +
>>>> +    if ( pdev->info.is_virtfn )
>>>> +    {
>>>> +        struct pci_dev *pf_pdev = pdev->virtfn.pf_pdev;
>>>> +
>>>> +        if ( pf_pdev )
>>>> +        {
>>>> +            list_del(&pdev->virtfn.next);
>>>> +            if ( pf_pdev->physfn.dealloc_pending &&
>>>> +                 list_empty(&pf_pdev->physfn.vf_list) )
>>>> +                xfree(pf_pdev);
>>>> +        }
>>>> +        xfree(pdev);
>>>> +    }
>>>> +    else
>>>> +    {
>>>> +        if ( list_empty(&pdev->physfn.vf_list) )
>>>> +            xfree(pdev);
>>>> +        else
>>>> +            pdev->physfn.dealloc_pending = true;
>>>> +    }
>>>
>>> Could I talk you into un-indenting the last if/else by a level, by making
>>> the earlier else and "else if()"?
>>>
>>> One aspect I didn't properly consider when making the suggestion: What if,
>>> without all VFs having gone away, the PF is re-added? In that case we
>>> would better recycle the existing structure. That's getting a little
>>> complicated, so maybe a better approach is to refuse the request (in
>>> pci_remove_device()) when the list isn't empty?
>>
>> Hm. Right. The growing complexity of maintaining these PF<->VF links
>> (introduced on a hunch that they may be useful in the future) is making
>> me favor the previous approach from v2 of simply copying the vf_len
>> array. So unless there are any objections I'll go back to that approach
>> for v4.
> 
> I continue to consider the earlier approach at least undesirable. The
> vf_len[] array shouldn't be copied around, risking for it to be / go
> stale. There should be one central place for every bit of information,
> unless there are very good reasons to duplicate something.

OK, I'll continue to refine the PF<->VF link approach for v4.


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 19:02:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 19:02:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782587.1192094 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shZYZ-000598-OP; Fri, 23 Aug 2024 19:02:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782587.1192094; Fri, 23 Aug 2024 19:02:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shZYZ-000591-Lh; Fri, 23 Aug 2024 19:02:43 +0000
Received: by outflank-mailman (input) for mailman id 782587;
 Fri, 23 Aug 2024 19:02:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shZYY-00058r-MD; Fri, 23 Aug 2024 19:02:42 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shZYY-00064G-CG; Fri, 23 Aug 2024 19:02:42 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shZYX-0005xf-WE; Fri, 23 Aug 2024 19:02:42 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shZYX-0007bR-Vm; Fri, 23 Aug 2024 19:02:41 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=nMSWCbiS1Uka1mmFj1EkLBNfdn2t9F4hE3IuH1AVmM8=; b=DVCQtnRTGh/PBWzXjJiDxjzsT+
	hxuK/WEMzlsXX1GhV6vac/Bf2RwnULxSOhZBbjIwdG8H4los8WRpJq5Z9nQBQnu67qkxGWMJZqrSO
	vqseLoVkgIMMaT4EVoqAtiA8qhsJDJ2QZgiLhS/tyPAWGt13NeVlZafvuSZGKTVGUdh4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187316-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187316: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-armhf-armhf-xl-raw:debian-di-install:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-qcow2:host-ping-check-xen:fail:heisenbug
    linux-linus:test-armhf-armhf-libvirt-vhd:xen-boot:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=872cf28b8df9c5c3a1e71a88ee750df7c2513971
X-Osstest-Versions-That:
    linux=b311c1b497e51a628aa89e7cb954481e5f9dced2
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 23 Aug 2024 19:02:41 +0000

flight 187316 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187316/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-raw     12 debian-di-install fail in 187307 pass in 187316
 test-armhf-armhf-xl-qcow2    10 host-ping-check-xen        fail pass in 187307
 test-armhf-armhf-libvirt-vhd  8 xen-boot                   fail pass in 187307

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-qcow2   14 migrate-support-check fail in 187307 never pass
 test-armhf-armhf-xl-qcow2 15 saverestore-support-check fail in 187307 never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check fail in 187307 never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check fail in 187307 never pass
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187301
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187301
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187301
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187301
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187301
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187301
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                872cf28b8df9c5c3a1e71a88ee750df7c2513971
baseline version:
 linux                b311c1b497e51a628aa89e7cb954481e5f9dced2

Last test of basis   187301  2024-08-21 09:37:38 Z    2 days
Testing same since   187307  2024-08-22 01:58:14 Z    1 days    2 attempts

------------------------------------------------------------
People who touched revisions under test:
  Gao Xiang <hsiangkao@linux.alibaba.com>
  Hongzhen Luo <hongzhen@linux.alibaba.com>
  Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Luke D. Jones <luke@ljones.dev>
  Maximilian Luz <luzmaximilian@gmail.com>
  Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 fail    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   b311c1b497e51..872cf28b8df9c  872cf28b8df9c5c3a1e71a88ee750df7c2513971 -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 19:36:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 19:36:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782601.1192134 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sha5Z-00036s-7u; Fri, 23 Aug 2024 19:36:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782601.1192134; Fri, 23 Aug 2024 19:36:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sha5Z-00036c-42; Fri, 23 Aug 2024 19:36:49 +0000
Received: by outflank-mailman (input) for mailman id 782601;
 Fri, 23 Aug 2024 19:36:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Xt9W=PW=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1sha5X-0002Oa-P4
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 19:36:47 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on20602.outbound.protection.outlook.com
 [2a01:111:f403:2418::602])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0886edd0-6187-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 21:36:47 +0200 (CEST)
Received: from BN9PR03CA0603.namprd03.prod.outlook.com (2603:10b6:408:106::8)
 by LV3PR12MB9187.namprd12.prod.outlook.com (2603:10b6:408:194::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.18; Fri, 23 Aug
 2024 19:36:41 +0000
Received: from BL02EPF00021F6D.namprd02.prod.outlook.com
 (2603:10b6:408:106:cafe::59) by BN9PR03CA0603.outlook.office365.com
 (2603:10b6:408:106::8) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend
 Transport; Fri, 23 Aug 2024 19:36:40 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 BL02EPF00021F6D.mail.protection.outlook.com (10.167.249.9) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 19:36:39 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 14:36:37 -0500
Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Fri, 23 Aug 2024 14:36:36 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0886edd0-6187-11ef-a50a-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ec25Fu0KVgOkM4yHYb1LTlK5N9XXSUUFcpstMD10M3FKFcnlqmcJoGuALa0E3v/eSTnF7awDjj5jIixjeFTsT8pzOzURfYRXONuxmfltTCWw2Oc3duUWzrjt+ZGRYNQ1wTGKJv+0yY3hriiKSnrjKZhhwVn2q/nTBzn91QuJk6WUqzywnAHiMg0BopnDILQI1pJ2rJkwd8tlbiWXGRBRk73ntB/stQirYrRhviwXyY9TaytjajansIg7kqwY4V1ujJoWMVH6rFVCSaV9i3FaH+EnlKZV9vZEt0DssaylAsn7Q7OCImwBvjsJFGTc1Y6/cz34fUAZ4Qg1yW82S3sZxw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=726QpRcn+lvf4rCuApM2KwRHNgakfInv/OKNIzKT6VQ=;
 b=pMzY17WE7Z+Q64BVu/+mXTipzfGBqP8LRFacc6Hfw0mwIcCjKARD7m3pFWZgwlWeJKZhdWgyf+CqZTdk175IYi5TFu+wDY59oaSlBH39kMXt5GvA/of4IdVtp1m98frqlxa8XHLqU3QmevR5Ef2wIUUHealFG8wA+Pybsz7nPyFG6CvXddERB9iHN9wd9f4uLG38gZhpiZhJhgIdeb40NXSciPF0lkRycIrmAB15853Bw01F/TJ+az2A3saVEHE3T/pJAzjiCw3c/x6PRVDzbtqF+7FC7s+rSDw9JEExhrO2KgEEihmXoPS700hR+CIJN8TXYzDsQIwE2N1l4eMifg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=726QpRcn+lvf4rCuApM2KwRHNgakfInv/OKNIzKT6VQ=;
 b=ALsNO2kVBUmJ2vUnwUE1CXvArrfVNOqZFf17Aop7yZKl9HufKx3nohIM3b4HuPkIgIEjTygJfjN5TbyC36tB07e9ftlcFQrbroJj8bNNqNr2pTBb9FXi/8bQmhwYUjljAOnlsphJhV5oWHM2V388aiUMHRpl2N/Uk+JLdDI9+60=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Jason Andryuk <jason.andryuk@amd.com>
To: Juergen Gross <jgross@suse.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Thomas Gleixner <tglx@linutronix.de>, "Ingo
 Molnar" <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, "H. Peter Anvin"
	<hpa@zytor.com>, Stefano Stabellini <sstabellini@kernel.org>, "Oleksandr
 Tyshchenko" <oleksandr_tyshchenko@epam.com>, Paolo Bonzini
	<pbonzini@redhat.com>, Brian Gerst <brgerst@gmail.com>
CC: <xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>, "Jason
 Andryuk" <jason.andryuk@amd.com>
Subject: [PATCH v3 2/5] x86/pvh: Make PVH entrypoint PIC for x86-64
Date: Fri, 23 Aug 2024 15:36:27 -0400
Message-ID: <20240823193630.2583107-3-jason.andryuk@amd.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240823193630.2583107-1-jason.andryuk@amd.com>
References: <20240823193630.2583107-1-jason.andryuk@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB03.amd.com: jason.andryuk@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL02EPF00021F6D:EE_|LV3PR12MB9187:EE_
X-MS-Office365-Filtering-Correlation-Id: 4f063824-6117-4102-c97d-08dcc3aae8fd
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|7416014|36860700013|1800799024|82310400026|921020;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?6VL/RPA3wdiowMbkNy1f1F3Kkr5OHmKjey+aP+IGeny5J5dPWadp+Vr7/KbJ?=
 =?us-ascii?Q?IU/znlteWzqOaHDKIab35BDhdRMPwiBzLYuo1SsJ10XwnVmMu8rMVmQWwYvn?=
 =?us-ascii?Q?3gqCn9e7dNqoke3SHTGW83XK54PmDzdnCuQrO1MO+mZXMHpizzHT95C1QVnX?=
 =?us-ascii?Q?9p1GzMUNUNZarjwP/dnWEllcDLLsewFf3m7SR2zQzYX9xmgcK9ZmX+47o9Ir?=
 =?us-ascii?Q?ktf6xvByWe9H8Mf5yBoEzatuJmumaBQICgXC6WvfteL3fGZZVCd0cB+hYLFQ?=
 =?us-ascii?Q?IDqNzTQtL/8Q1+nz1r98izAnUxTaGNmzevXolKOQTT7Jz2s45h565vY9awdL?=
 =?us-ascii?Q?Q1r3GX+vpQv+Ylz1ORicQFcrwx/MuuZRMbXdFvpAE9POQ5ZewTL37I4u3HrY?=
 =?us-ascii?Q?vr07j786qyZZ2LU/FjHEOYmcD23Cf/lJyUTT6chXYOkUT6dqyvfQEFIfl5Hs?=
 =?us-ascii?Q?vT5EyKDtnDQcCYxQMastdGwGcR1H1d36bz0zuEzCvvH3KSU88L1L8gvifwWn?=
 =?us-ascii?Q?ofep+lRZJIkgWLQyNkdjLiw3oOpSrNQ2pf8tlzCzzIQpF8IGs9CSXx1L5/+E?=
 =?us-ascii?Q?Df0mxbktz4xkFd12vvYKlN/EwocNms7bWOjq6Q7JjH8YwswPYe91iTje8Cme?=
 =?us-ascii?Q?hvqk4mDm1nS+LnudxjColk/o1djRd21fwfr3nQrmL6QrzK1KUXWDyu7n72zc?=
 =?us-ascii?Q?YiPLeP3w5TTxxpijhPNaxqkO+vOTkdPgJk2+RpRDbowYwZFAqbP/E+SfX350?=
 =?us-ascii?Q?EagGJUVfWvTqQpBrTx2wTq+/cccUXuG456Wjn4TB22m/3bfs101oLbfio9bb?=
 =?us-ascii?Q?NHYXHoe0EpILEWMKev3dHJXTxJTH+IVrH47kwe4I/KOFt4xXplnAz76NztrJ?=
 =?us-ascii?Q?Rd9U9UpjeaT6DZvQNYW5anT2bTcPfPxsDE6nB1PSVv0FZ5P3iMsz3LW7l+V1?=
 =?us-ascii?Q?1X+oBhOXiP2ih6xiFXct9GSuLowhh5x+nS+XDVgOmp2fRP4z3z4+SPJ5OUWF?=
 =?us-ascii?Q?e9/kn+1ASj7Wjts8Xkfeps81gQ+VpxG1c3TYkgfigcKttKO/HVmS33iAlhM9?=
 =?us-ascii?Q?a0d43qf44GUkVf9uvxgJqQWvOTe5j5Z+Zeextx4Pgg2SXxO1wya+Y6cfMW5l?=
 =?us-ascii?Q?fTFeSeT0P0S3vbKnIBrAg2WeseMuGDmdzoALCnLUA++9K1P/Uidu3sCK24fT?=
 =?us-ascii?Q?VSjOxIAFrRTMWLJ28FqjKhKpp0xG/E5WGG8K2sddUBgUeZ4KmNrdwmqshV1s?=
 =?us-ascii?Q?CuIExXOh22lSAYG4CM5Ho462zy05NxYgdSLXVA2Z7Ln3HX1FivbZh7VbsDnK?=
 =?us-ascii?Q?9/PGKCRfYXgE32/T9zuOqJUO7cfvuYfogtBSPeB+RSsbWDSeND38qExIi5JI?=
 =?us-ascii?Q?/6XXM5Cbol37RDpcrYTl7FkdD4ehqG+d5SOvT5hMDZea3fLy5WCEGRdAIMI8?=
 =?us-ascii?Q?HZRzVmV9miuzt8CFJh7fYY2z0wlXkfspfHjVZVeDbLaeFaJEk16QaQ=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(7416014)(36860700013)(1800799024)(82310400026)(921020);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 19:36:39.9789
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 4f063824-6117-4102-c97d-08dcc3aae8fd
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL02EPF00021F6D.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9187

The PVH entrypoint is 32bit non-PIC code running the uncompressed
vmlinux at its load address CONFIG_PHYSICAL_START - default 0x1000000
(16MB).  The kernel is loaded at that physical address inside the VM by
the VMM software (Xen/QEMU).

When running a Xen PVH Dom0, the host reserved addresses are mapped 1-1
into the PVH container.  There exist system firmwares (Coreboot/EDK2)
with reserved memory at 16MB.  This creates a conflict where the PVH
kernel cannot be loaded at that address.

Modify the PVH entrypoint to be position-indepedent to allow flexibility
in load address.  Only the 64bit entry path is converted.  A 32bit
kernel is not PIC, so calling into other parts of the kernel, like
xen_prepare_pvh() and mk_pgtable_32(), don't work properly when
relocated.

This makes the code PIC, but the page tables need to be updated as well
to handle running from the kernel high map.

The UNWIND_HINT_END_OF_STACK is to silence:
vmlinux.o: warning: objtool: pvh_start_xen+0x7f: unreachable instruction
after the lret into 64bit code.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
---
v2:
Use rip-relative loads in 64bit mode
Direct jmp to startup_64
---
 arch/x86/platform/pvh/head.S | 46 ++++++++++++++++++++++++++----------
 1 file changed, 34 insertions(+), 12 deletions(-)

diff --git a/arch/x86/platform/pvh/head.S b/arch/x86/platform/pvh/head.S
index f7235ef87bc3..ba4d0eab4436 100644
--- a/arch/x86/platform/pvh/head.S
+++ b/arch/x86/platform/pvh/head.S
@@ -7,6 +7,7 @@
 	.code32
 	.text
 #define _pa(x)          ((x) - __START_KERNEL_map)
+#define rva(x)          ((x) - pvh_start_xen)
 
 #include <linux/elfnote.h>
 #include <linux/init.h>
@@ -54,7 +55,25 @@ SYM_CODE_START_LOCAL(pvh_start_xen)
 	UNWIND_HINT_END_OF_STACK
 	cld
 
-	lgdt (_pa(gdt))
+	/*
+	 * See the comment for startup_32 for more details.  We need to
+	 * execute a call to get the execution address to be position
+	 * independent, but we don't have a stack.  Save and restore the
+	 * magic field of start_info in ebx, and use that as the stack.
+	 */
+	mov  (%ebx), %eax
+	leal 4(%ebx), %esp
+	ANNOTATE_INTRA_FUNCTION_CALL
+	call 1f
+1:	popl %ebp
+	mov  %eax, (%ebx)
+	subl $rva(1b), %ebp
+	movl $0, %esp
+
+	leal rva(gdt)(%ebp), %eax
+	leal rva(gdt_start)(%ebp), %ecx
+	movl %ecx, 2(%eax)
+	lgdt (%eax)
 
 	mov $PVH_DS_SEL,%eax
 	mov %eax,%ds
@@ -62,14 +81,14 @@ SYM_CODE_START_LOCAL(pvh_start_xen)
 	mov %eax,%ss
 
 	/* Stash hvm_start_info. */
-	mov $_pa(pvh_start_info), %edi
+	leal rva(pvh_start_info)(%ebp), %edi
 	mov %ebx, %esi
-	mov _pa(pvh_start_info_sz), %ecx
+	movl rva(pvh_start_info_sz)(%ebp), %ecx
 	shr $2,%ecx
 	rep
 	movsl
 
-	mov $_pa(early_stack_end), %esp
+	leal rva(early_stack_end)(%ebp), %esp
 
 	/* Enable PAE mode. */
 	mov %cr4, %eax
@@ -84,30 +103,33 @@ SYM_CODE_START_LOCAL(pvh_start_xen)
 	wrmsr
 
 	/* Enable pre-constructed page tables. */
-	mov $_pa(init_top_pgt), %eax
+	leal rva(init_top_pgt)(%ebp), %eax
 	mov %eax, %cr3
 	mov $(X86_CR0_PG | X86_CR0_PE), %eax
 	mov %eax, %cr0
 
 	/* Jump to 64-bit mode. */
-	ljmp $PVH_CS_SEL, $_pa(1f)
+	pushl $PVH_CS_SEL
+	leal  rva(1f)(%ebp), %eax
+	pushl %eax
+	lretl
 
 	/* 64-bit entry point. */
 	.code64
 1:
+	UNWIND_HINT_END_OF_STACK
+
 	/* Set base address in stack canary descriptor. */
 	mov $MSR_GS_BASE,%ecx
-	mov $_pa(canary), %eax
+	leal canary(%rip), %eax
 	xor %edx, %edx
 	wrmsr
 
 	call xen_prepare_pvh
 
 	/* startup_64 expects boot_params in %rsi. */
-	mov $_pa(pvh_bootparams), %rsi
-	mov $_pa(startup_64), %rax
-	ANNOTATE_RETPOLINE_SAFE
-	jmp *%rax
+	lea pvh_bootparams(%rip), %rsi
+	jmp startup_64
 
 #else /* CONFIG_X86_64 */
 
@@ -143,7 +165,7 @@ SYM_CODE_END(pvh_start_xen)
 	.balign 8
 SYM_DATA_START_LOCAL(gdt)
 	.word gdt_end - gdt_start
-	.long _pa(gdt_start)
+	.long _pa(gdt_start) /* x86-64 will overwrite if relocated. */
 	.word 0
 SYM_DATA_END(gdt)
 SYM_DATA_START_LOCAL(gdt_start)
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 19:36:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 19:36:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782600.1192124 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sha5X-0002rW-Vq; Fri, 23 Aug 2024 19:36:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782600.1192124; Fri, 23 Aug 2024 19:36:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sha5X-0002rP-RZ; Fri, 23 Aug 2024 19:36:47 +0000
Received: by outflank-mailman (input) for mailman id 782600;
 Fri, 23 Aug 2024 19:36:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Xt9W=PW=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1sha5X-0002Oa-81
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 19:36:47 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on2062b.outbound.protection.outlook.com
 [2a01:111:f403:2415::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 081d9907-6187-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 21:36:46 +0200 (CEST)
Received: from BN9PR03CA0624.namprd03.prod.outlook.com (2603:10b6:408:106::29)
 by IA1PR12MB6089.namprd12.prod.outlook.com (2603:10b6:208:3ef::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Fri, 23 Aug
 2024 19:36:42 +0000
Received: from BL02EPF00021F6D.namprd02.prod.outlook.com
 (2603:10b6:408:106:cafe::6f) by BN9PR03CA0624.outlook.office365.com
 (2603:10b6:408:106::29) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.18 via Frontend
 Transport; Fri, 23 Aug 2024 19:36:42 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 BL02EPF00021F6D.mail.protection.outlook.com (10.167.249.9) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 19:36:42 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 14:36:41 -0500
Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Fri, 23 Aug 2024 14:36:40 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 081d9907-6187-11ef-a50a-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=B3sMVq8VN0eDPtNrm6Y5209AmqJDoEaZnWPVYtlW0agBUGgv6vTxEW5RPrn+G4JtOaFvoyjLQ+QBvZSuTnYE3bXJgKs40/v5g12sbZX1VniIG9Z/eylVwOI9YJ11aHdObwx4uLrtjVDfuaIXR0e6p+XvWtzTT1zu1Dl6iFxQLNLQ0KZgE3RluBWK8NEdn5DRXT7SlDzWqhat/im87jmInZmLPZbitUmZURrhOWeOni0Dwhv5wDE/PU2Oj2a2yo+pSPf18O6Fwy4t5a3B0Bn7BWTR+bdG11kM3sZRTA+MySklJXENQssqIs2vcj77bTJa/fBlMZQhgPeH6jM6ZroqCQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3WNcTBJWFqlSsl7h7qLZb7kjFufC1sLILMFbSKVwKI0=;
 b=sFMohX8S/ImnJ3sw6spbBG4PjYY8gVTWZrsVJyAa0ajT7qbLecV1/OItoQ2OoFFFlfGO3Gow+D5YfD2fQcBSIYyWejKfyNAKA8G/FksM2TpTY6jiw16x8MksEqqVw5MKsno4yOgzmGZMBFdAVMwej3x/D4wB8EobM4quR+6lwdeUsVhb/dEDQFMcjKSt2k/n2pb9NpHSJXj/cQTvXVwqKMlLY7WrQ3ZrgDRkVWIcQSwcR9NXozdyIyoFPtAN+768ASQpuQvx8X/LaO9gZYPa2fzqUvHVYIqbrBOfdQhAhZgCZSwMJW8vPrEEgFaaJ2xdPJX4t5uUUnsCDIwZLmBlkw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3WNcTBJWFqlSsl7h7qLZb7kjFufC1sLILMFbSKVwKI0=;
 b=SuKBJWW2TgJPv/AzenI46xrSKx4hRZkVhavDABFrHESx3llNncuJ6RMZAceYvz3D6Jm1gOTLPzmzPCIfDCrCLnPpo26iax+b7+tFpdfSiEXOztmWzsnQ55FZjBvFILvC9IbOF2XBb2LzR7m0NDnjERFOXxQW8sHtLYxAEDhjmDY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Jason Andryuk <jason.andryuk@amd.com>
To: Juergen Gross <jgross@suse.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Thomas Gleixner <tglx@linutronix.de>, "Ingo
 Molnar" <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, "H. Peter Anvin"
	<hpa@zytor.com>, Stefano Stabellini <sstabellini@kernel.org>, "Oleksandr
 Tyshchenko" <oleksandr_tyshchenko@epam.com>, Paolo Bonzini
	<pbonzini@redhat.com>, Brian Gerst <brgerst@gmail.com>
CC: <xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>, "Jason
 Andryuk" <jason.andryuk@amd.com>
Subject: [PATCH v3 4/5] x86/kernel: Move page table macros to header
Date: Fri, 23 Aug 2024 15:36:29 -0400
Message-ID: <20240823193630.2583107-5-jason.andryuk@amd.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240823193630.2583107-1-jason.andryuk@amd.com>
References: <20240823193630.2583107-1-jason.andryuk@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB03.amd.com: jason.andryuk@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL02EPF00021F6D:EE_|IA1PR12MB6089:EE_
X-MS-Office365-Filtering-Correlation-Id: 3b003c65-0cc8-4f84-cd82-08dcc3aaea46
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|7416014|376014|36860700013|1800799024|921020;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?FDkRxvEsmk7D7g/8OineGBnboTwpnh3LX7xNXaMrANKqOxE6Ji4PBzHBewAK?=
 =?us-ascii?Q?/jUfg9tKXlgvCzzDjt09xmKeTQ/tc4O9houcL4XpbvS++G/kV9tYJpW7f2rW?=
 =?us-ascii?Q?o1iT/pe7yvhEJvKebrp2dxCHnyAPqOdUgoVT0rWjsSGEM64cStourjuRxVmd?=
 =?us-ascii?Q?VtC6p4pQXzPZn2IuepiXpr+Cy/fulkzscrIXLyYN9WZsO42MLugy1HDv7yjj?=
 =?us-ascii?Q?8uxsu9WHA97FOLyAtgIfz5Vf90dZYoGVcnnatAqsZBGXZ0OzQJv8MB0Gev+7?=
 =?us-ascii?Q?TzUFKACoklyruxxfu3lEvmEUhJZw0ATqAacgnq1Im4oY2Q3wuDCCMBVvl/CB?=
 =?us-ascii?Q?w8UcrE1MBFFBjtTMEyexgYAUVnFY4EVUcizDe9hK+EuIiqOsiq8Nqg+1UAK6?=
 =?us-ascii?Q?mnKidXRphMNeUUqCfu/rXaR85VgYPL+LFKt1eKbPg6UKH0u6iRU8neCuXm34?=
 =?us-ascii?Q?7DNokj/VInOIx+unQAYJLfCb3Ij6iYMoCW20bFr4R/uDH3TfBumFSuYKOX8Q?=
 =?us-ascii?Q?melLKUhN+ACk2bEb5xlZKA70UTLiEo5gP+OfveaMKhBxhdRhdSnJMBOa+Ccy?=
 =?us-ascii?Q?has+emkpcuZQ73RKbMLQelIsnDeeOnwSHasfsv/JYCOXCd14BVbSADE0ABlv?=
 =?us-ascii?Q?GRGZcBFxRcEFzkRWN0KhezO1FSXtbeswhlOMYBv80gidzzqFt7IQOOeN76l+?=
 =?us-ascii?Q?r10BNdAGjscMgeSI7KwInAO3a2QBMu+mC4lyyE03sPwaa3FZk3V5W3+iObnK?=
 =?us-ascii?Q?uC5iR1ti6f8+PA61BardvHEXNTCJzHKCo1tYiH5rXIivDNCQ+DHrQeosoEIb?=
 =?us-ascii?Q?92G/sdBwJ/JNKXENVCRX1nK5W+53stqjlzh6CpbZQuOpTCMF5jft66qoZfG4?=
 =?us-ascii?Q?WUfCfW7m6q4oZRYyFJ1gHmshgeQbV1zBJ9wyjKjXy/lw/3dvWIGz0cpPr7Ym?=
 =?us-ascii?Q?2RRdgcws4hyB1GeTHpJoCNtyxARWVDjm18F1usHAs2QKzagYPyX05Y3626rT?=
 =?us-ascii?Q?VGCJtJPAYhvJ0wXTvokP+lTuiD986dZM2o9i+v+TY2GQ1Htl+hTwpOQVBQ+Q?=
 =?us-ascii?Q?AWfLUCmK7mog9mdspr0NcFM+8ubmnYH5hgOYmQPRmAWq2AcDmXrJF41ZIO+v?=
 =?us-ascii?Q?/99IL+MrA+O/J+DDu0NyECUCsitHmmG9m3bFBx3AN99gB9bfcVHYActJjjk7?=
 =?us-ascii?Q?7CvMxkMFmy6HTSDMSi35W4Bxho/kn1+u8ynHmT/Soy3tPXmY8W5h4SlrDTVl?=
 =?us-ascii?Q?pQD7yMpvWXtr8JYatmgXDZuUN8u/KvUKlFIWb8lzMXxoDaaqbpd9XQRfT848?=
 =?us-ascii?Q?hd+8Y8a+VMXrGBzPAQkhhS0/jqyxPf2LOaw3aAUIkE/5dDsy9UHhkVG50gEP?=
 =?us-ascii?Q?TeyQ3lhH2rovTOnf9JCD0by7zd25EbkJbMK7f0CW/K25a1MUcQCfmNcmD2w+?=
 =?us-ascii?Q?OxWxEWIC2U2anTO7ZukxQ7/Uuv46wLqNfgYC9JMTAng6KhPcyeHJZg=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(7416014)(376014)(36860700013)(1800799024)(921020);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 19:36:42.1508
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 3b003c65-0cc8-4f84-cd82-08dcc3aaea46
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL02EPF00021F6D.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6089

The PVH entry point will need an additional set of prebuild page tables.
Move the macros and defines to pgtable_64.h, so they can be re-used.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
v3:
Add Juergen's R-b

v2:
Use existing pgtable_64.h
s/-/ - / in pud_index()
Did not add Juergen's R-b in case the header movement matters
---
 arch/x86/include/asm/pgtable_64.h | 23 ++++++++++++++++++++++-
 arch/x86/kernel/head_64.S         | 20 --------------------
 2 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h
index 3c4407271d08..72912b8edfdf 100644
--- a/arch/x86/include/asm/pgtable_64.h
+++ b/arch/x86/include/asm/pgtable_64.h
@@ -271,5 +271,26 @@ static inline bool gup_fast_permitted(unsigned long start, unsigned long end)
 
 #include <asm/pgtable-invert.h>
 
-#endif /* !__ASSEMBLY__ */
+#else /* __ASSEMBLY__ */
+
+#define l4_index(x)	(((x) >> 39) & 511)
+#define pud_index(x)	(((x) >> PUD_SHIFT) & (PTRS_PER_PUD - 1))
+
+L4_PAGE_OFFSET = l4_index(__PAGE_OFFSET_BASE_L4)
+L4_START_KERNEL = l4_index(__START_KERNEL_map)
+
+L3_START_KERNEL = pud_index(__START_KERNEL_map)
+
+#define SYM_DATA_START_PAGE_ALIGNED(name)			\
+	SYM_START(name, SYM_L_GLOBAL, .balign PAGE_SIZE)
+
+/* Automate the creation of 1 to 1 mapping pmd entries */
+#define PMDS(START, PERM, COUNT)			\
+	i = 0 ;						\
+	.rept (COUNT) ;					\
+	.quad	(START) + (i << PMD_SHIFT) + (PERM) ;	\
+	i = i + 1 ;					\
+	.endr
+
+#endif /* __ASSEMBLY__ */
 #endif /* _ASM_X86_PGTABLE_64_H */
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 330922b328bf..16752b8dfa89 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -32,13 +32,6 @@
  * We are not able to switch in one step to the final KERNEL ADDRESS SPACE
  * because we need identity-mapped pages.
  */
-#define l4_index(x)	(((x) >> 39) & 511)
-#define pud_index(x)	(((x) >> PUD_SHIFT) & (PTRS_PER_PUD-1))
-
-L4_PAGE_OFFSET = l4_index(__PAGE_OFFSET_BASE_L4)
-L4_START_KERNEL = l4_index(__START_KERNEL_map)
-
-L3_START_KERNEL = pud_index(__START_KERNEL_map)
 
 	__HEAD
 	.code64
@@ -577,9 +570,6 @@ SYM_CODE_START_NOALIGN(vc_no_ghcb)
 SYM_CODE_END(vc_no_ghcb)
 #endif
 
-#define SYM_DATA_START_PAGE_ALIGNED(name)			\
-	SYM_START(name, SYM_L_GLOBAL, .balign PAGE_SIZE)
-
 #ifdef CONFIG_MITIGATION_PAGE_TABLE_ISOLATION
 /*
  * Each PGD needs to be 8k long and 8k aligned.  We do not
@@ -601,14 +591,6 @@ SYM_CODE_END(vc_no_ghcb)
 #define PTI_USER_PGD_FILL	0
 #endif
 
-/* Automate the creation of 1 to 1 mapping pmd entries */
-#define PMDS(START, PERM, COUNT)			\
-	i = 0 ;						\
-	.rept (COUNT) ;					\
-	.quad	(START) + (i << PMD_SHIFT) + (PERM) ;	\
-	i = i + 1 ;					\
-	.endr
-
 	__INITDATA
 	.balign 4
 
@@ -708,8 +690,6 @@ SYM_DATA_START_PAGE_ALIGNED(level1_fixmap_pgt)
 	.endr
 SYM_DATA_END(level1_fixmap_pgt)
 
-#undef PMDS
-
 	.data
 	.align 16
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 19:36:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 19:36:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782599.1192110 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sha5W-0002S6-KP; Fri, 23 Aug 2024 19:36:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782599.1192110; Fri, 23 Aug 2024 19:36:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sha5W-0002RI-EG; Fri, 23 Aug 2024 19:36:46 +0000
Received: by outflank-mailman (input) for mailman id 782599;
 Fri, 23 Aug 2024 19:36:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Xt9W=PW=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1sha5V-0002Oa-0z
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 19:36:45 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on2060f.outbound.protection.outlook.com
 [2a01:111:f403:2415::60f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 05721e38-6187-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 21:36:42 +0200 (CEST)
Received: from BN9PR03CA0787.namprd03.prod.outlook.com (2603:10b6:408:13f::12)
 by MW6PR12MB8867.namprd12.prod.outlook.com (2603:10b6:303:249::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21; Fri, 23 Aug
 2024 19:36:37 +0000
Received: from BN2PEPF000044A9.namprd04.prod.outlook.com
 (2603:10b6:408:13f:cafe::41) by BN9PR03CA0787.outlook.office365.com
 (2603:10b6:408:13f::12) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.22 via Frontend
 Transport; Fri, 23 Aug 2024 19:36:37 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BN2PEPF000044A9.mail.protection.outlook.com (10.167.243.103) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 19:36:37 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 14:36:35 -0500
Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Fri, 23 Aug 2024 14:36:33 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 05721e38-6187-11ef-a50a-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=glKcDYjbTAAV9QqRFb3gE29XVc5EUgIBABxXIjd7IKvkId4JZU7pDco/neWOWoJ3DfaJR6ap3LvGcsV7MB7yKWNcQ+e69neisjInrfNqsuEinmkk5xLnSY/SzmdyK58nZVIPr91keS3XWtxtLnDOQMDtNiVZa5SybzqOi1eBFSFNcioPw6G+Tyyg4n74gHRlnoqjpAYIAL+D61v+mTiFhnzPrWdVfc/dEqCgnU8BO8R8PZTTwcKzh9ruDAg+URjXTYYev4w/wqEmVFJLnAGULL8ggnsOuvCV8IvH2AUjlHvDAt4wYrNn0tII93az+OCOGboK5/x5JVsSZdntG1IWjw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=55nJnnKdgeDx4oUSXrJ9Q+OVSfhHt48p1gn05H5VmsQ=;
 b=ipZLfcKjewCf/5hEs5ZX5Qux+kItX4LeWjZiGxnezz4tUmwjMNd3kmj2C+oqOQt7Rzcho6PmLrlXl0qOegxS67wk+CFcc7UZ/pHTnAmEXT8L1i+CMedaJW571BY73IECjPfUGVPBa+126HyTo5mdg51jGjXN8Qi/lwhKEBZtsHn/ca/0yKn9XXtm7sojbMZof/jUL0oAwe3nyj8lYLFzeBdY4A0FNtg9Q4BYxNELRBhBDN/NihMTLl5ZVNQ1jGUQapVklySs3djzPmNNDBR1F+ODIu69xUvdJTHXiqiquL5glAv9I8YubBlqH4y6zkpMqZ6I7AZuXOn1v59ove4rmw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=55nJnnKdgeDx4oUSXrJ9Q+OVSfhHt48p1gn05H5VmsQ=;
 b=J8yek0kab9gu+QiruPgP5X+JOvunBFxIfZ8KqKBv0rtNILjdlofoXBrNWKihFAVyKj4oo05urZb/49GbhxKhYKWEw1+SriCoNwE8Z7IVtHwIfVPEAJJve3WYIEiUM1GZ0jc8v6KnXXUZKR1D/Er9HtwDux5UnuTm4sPGBaw+TzA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jason Andryuk <jason.andryuk@amd.com>
To: Juergen Gross <jgross@suse.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Thomas Gleixner <tglx@linutronix.de>, "Ingo
 Molnar" <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, "H. Peter Anvin"
	<hpa@zytor.com>, Stefano Stabellini <sstabellini@kernel.org>, "Oleksandr
 Tyshchenko" <oleksandr_tyshchenko@epam.com>, Paolo Bonzini
	<pbonzini@redhat.com>, Brian Gerst <brgerst@gmail.com>
CC: <xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>, "Jason
 Andryuk" <jason.andryuk@amd.com>
Subject: [PATCH v3 1/5] xen: sync elfnote.h from xen tree
Date: Fri, 23 Aug 2024 15:36:26 -0400
Message-ID: <20240823193630.2583107-2-jason.andryuk@amd.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240823193630.2583107-1-jason.andryuk@amd.com>
References: <20240823193630.2583107-1-jason.andryuk@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB04.amd.com: jason.andryuk@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN2PEPF000044A9:EE_|MW6PR12MB8867:EE_
X-MS-Office365-Filtering-Correlation-Id: 679b3fdf-9c96-4805-eb13-08dcc3aae788
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014|7416014|921020;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?xC/E2UfBxPY0SLN8cFrgafV2rpiMkAcU+reHtKF7Lp2uvJjIHOYf7HlGOjty?=
 =?us-ascii?Q?/hV6VkF9JND8mFtmWU14rMLlhh87FJLi2DCg67DGKsJ5/tEAKkVbiVax4nQg?=
 =?us-ascii?Q?Y8dWFJr6WciAuBtB106Wn9Vf5K4tyqYnkMgojasESTY++oMRqYELGHZygfkn?=
 =?us-ascii?Q?cfwOiT3Bs3moIweVoDwiRGzs04DPFT9d8hn5QOrs3TBrYKNW9CVR3E6yRVEV?=
 =?us-ascii?Q?sTs+AvFnWTcDs5HDno6wEIhO/2/eVjkM9F4dN9wKhR5+hJwyhbs7umHI6wTz?=
 =?us-ascii?Q?7qJyNu61hD1azova0fX4A4A9zT9VT3yoGtMFVtNq1UpyvhYj9VTlHielQBo5?=
 =?us-ascii?Q?tdyNJD9AiE5v9RqHUG77N8zAFIXzEsyteY1TvAJnxlW6rvriNwupc0Dgsxu+?=
 =?us-ascii?Q?q/Mjv+Xr9kBrE/843bjk+Sa7Uf7Zb499UJAs5J9q11F+55sxBauId39gP6lF?=
 =?us-ascii?Q?QDVWLogr27TEV95druTSSI4ZtvcWXEe+H/6lysscIf5VH9hlq3ToPe1ulPDf?=
 =?us-ascii?Q?h6Rxm5rxyojKwV+eHqB/qrliv7vj5J7uI/hKAh6VYW/dEoP0Y1eh02bSfnwQ?=
 =?us-ascii?Q?p2c5E7b9HTVLAn3mvyWTjmt7X+tW7W3Zow8vSoh1SRf6IlQ5lQi4clNTcNEz?=
 =?us-ascii?Q?IEu/Q2CLhNjQmVmYz7P/aGV5RCWygLTDhGqPTD+Mdz6CkMMmEMefqU8keQAS?=
 =?us-ascii?Q?foxRepz9AknUMqpmRSdBhbxgRCT3hc9bmPH36JjBhoi54qI5wh0/jLmXu/UI?=
 =?us-ascii?Q?jN+Mn+1buNlCU0BMkfzmiSofZl26o4pTFULMLgfgPWElArtIGWs/i2XyMtRn?=
 =?us-ascii?Q?8ozYsX85JUQ/4OgcIhd4+0Jm2f8W5GCAYRkaHQKPzicnM2kt6okMClVkFhY1?=
 =?us-ascii?Q?GwU7c2XsMonJ9iJfjVGjimpHz2RkceBIG+vTSjrZOW1MT4Az0U4j152rSyNb?=
 =?us-ascii?Q?ICkKFrRlOvgBpwPcuAZx+QNii1l+47Ei1yvq2pEyvQ4ZDU+tWXemQCCv+EZn?=
 =?us-ascii?Q?WyaE8yzUfMreZ1F0wZKb9puhYCeJbJe3ez9qZPFzRv+kJWW2KkpWQhpLwPBg?=
 =?us-ascii?Q?0VDpBsguaaVvm7mtUPvTVgH38Zo6OhXDkyvs6d58/4Cadj8Cr6jYPqiPZXnf?=
 =?us-ascii?Q?d3wtXkiUu0JClc21O2QIE6uVA2Qyt0joUKxd0zyTZNG3adntykm24cC7fZIU?=
 =?us-ascii?Q?bu29wmIHeNntx/ouaVW+EEY9XZuuq8jRSf1LY5qfiGt1eiYdetm0QQJcKSA0?=
 =?us-ascii?Q?uXAk7/7aGCzLSQrCBuzxGOxPaDUNZq2KTzk8ylt32Ds1390jXrGjkLLuEhFo?=
 =?us-ascii?Q?TF2CjAL65TXsiIAjFZrFAO9YMeCK0xHrbfw4J4wBTe0YInKD7mqh60wbFtxc?=
 =?us-ascii?Q?smJpnsd6Yv39Eam3RQxxxPMVv63p3NyaLCQS5WBJLiymiTl0tHmMhCiajmGZ?=
 =?us-ascii?Q?jYj1eW07QFUaOBUp+Nyo2CaKbmA817SRxeBYTL7GGeNVKn2ItAHiCQ=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014)(7416014)(921020);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 19:36:37.5509
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 679b3fdf-9c96-4805-eb13-08dcc3aae788
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN2PEPF000044A9.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8867

Sync Xen's elfnote.h header from xen.git to pull in the
XEN_ELFNOTE_PHYS32_RELOC define.

xen commit dfc9fab00378 ("x86/PVH: Support relocatable dom0 kernels")

This is a copy except for the removal of the emacs editor config at the
end of the file.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
 include/xen/interface/elfnote.h | 93 +++++++++++++++++++++++++++++++--
 1 file changed, 88 insertions(+), 5 deletions(-)

diff --git a/include/xen/interface/elfnote.h b/include/xen/interface/elfnote.h
index 38deb1214613..918f47d87d7a 100644
--- a/include/xen/interface/elfnote.h
+++ b/include/xen/interface/elfnote.h
@@ -11,7 +11,9 @@
 #define __XEN_PUBLIC_ELFNOTE_H__
 
 /*
- * The notes should live in a SHT_NOTE segment and have "Xen" in the
+ * `incontents 200 elfnotes ELF notes
+ *
+ * The notes should live in a PT_NOTE segment and have "Xen" in the
  * name field.
  *
  * Numeric types are either 4 or 8 bytes depending on the content of
@@ -22,6 +24,8 @@
  *
  * String values (for non-legacy) are NULL terminated ASCII, also known
  * as ASCIZ type.
+ *
+ * Xen only uses ELF Notes contained in x86 binaries.
  */
 
 /*
@@ -52,7 +56,7 @@
 #define XEN_ELFNOTE_VIRT_BASE      3
 
 /*
- * The offset of the ELF paddr field from the acutal required
+ * The offset of the ELF paddr field from the actual required
  * pseudo-physical address (numeric).
  *
  * This is used to maintain backwards compatibility with older kernels
@@ -92,7 +96,12 @@
 #define XEN_ELFNOTE_LOADER         8
 
 /*
- * The kernel supports PAE (x86/32 only, string = "yes" or "no").
+ * The kernel supports PAE (x86/32 only, string = "yes", "no" or
+ * "bimodal").
+ *
+ * For compatibility with Xen 3.0.3 and earlier the "bimodal" setting
+ * may be given as "yes,bimodal" which will cause older Xen to treat
+ * this kernel as PAE.
  *
  * LEGACY: PAE (n.b. The legacy interface included a provision to
  * indicate 'extended-cr3' support allowing L3 page tables to be
@@ -149,7 +158,9 @@
  * The (non-default) location the initial phys-to-machine map should be
  * placed at by the hypervisor (Dom0) or the tools (DomU).
  * The kernel must be prepared for this mapping to be established using
- * large pages, despite such otherwise not being available to guests.
+ * large pages, despite such otherwise not being available to guests. Note
+ * that these large pages may be misaligned in PFN space (they'll obviously
+ * be aligned in MFN and virtual address spaces).
  * The kernel must also be able to handle the page table pages used for
  * this mapping not being accessible through the initial mapping.
  * (Only x86-64 supports this at present.)
@@ -185,9 +196,81 @@
  */
 #define XEN_ELFNOTE_PHYS32_ENTRY 18
 
+/*
+ * Physical loading constraints for PVH kernels
+ *
+ * The presence of this note indicates the kernel supports relocating itself.
+ *
+ * The note may include up to three 32bit values to place constraints on the
+ * guest physical loading addresses and alignment for a PVH kernel.  Values
+ * are read in the following order:
+ *  - a required start alignment (default 0x200000)
+ *  - a minimum address for the start of the image (default 0; see below)
+ *  - a maximum address for the last byte of the image (default 0xffffffff)
+ *
+ * When this note specifies an alignment value, it is used.  Otherwise the
+ * maximum p_align value from loadable ELF Program Headers is used, if it is
+ * greater than or equal to 4k (0x1000).  Otherwise, the default is used.
+ */
+#define XEN_ELFNOTE_PHYS32_RELOC 19
+
 /*
  * The number of the highest elfnote defined.
  */
-#define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_ENTRY
+#define XEN_ELFNOTE_MAX XEN_ELFNOTE_PHYS32_RELOC
+
+/*
+ * System information exported through crash notes.
+ *
+ * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_INFO
+ * note in case of a system crash. This note will contain various
+ * information about the system, see xen/include/xen/elfcore.h.
+ */
+#define XEN_ELFNOTE_CRASH_INFO 0x1000001
+
+/*
+ * System registers exported through crash notes.
+ *
+ * The kexec / kdump code will create one XEN_ELFNOTE_CRASH_REGS
+ * note per cpu in case of a system crash. This note is architecture
+ * specific and will contain registers not saved in the "CORE" note.
+ * See xen/include/xen/elfcore.h for more information.
+ */
+#define XEN_ELFNOTE_CRASH_REGS 0x1000002
+
+
+/*
+ * xen dump-core none note.
+ * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_NONE
+ * in its dump file to indicate that the file is xen dump-core
+ * file. This note doesn't have any other information.
+ * See tools/libxc/xc_core.h for more information.
+ */
+#define XEN_ELFNOTE_DUMPCORE_NONE               0x2000000
+
+/*
+ * xen dump-core header note.
+ * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_HEADER
+ * in its dump file.
+ * See tools/libxc/xc_core.h for more information.
+ */
+#define XEN_ELFNOTE_DUMPCORE_HEADER             0x2000001
+
+/*
+ * xen dump-core xen version note.
+ * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_XEN_VERSION
+ * in its dump file. It contains the xen version obtained via the
+ * XENVER hypercall.
+ * See tools/libxc/xc_core.h for more information.
+ */
+#define XEN_ELFNOTE_DUMPCORE_XEN_VERSION        0x2000002
+
+/*
+ * xen dump-core format version note.
+ * xm dump-core code will create one XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION
+ * in its dump file. It contains a format version identifier.
+ * See tools/libxc/xc_core.h for more information.
+ */
+#define XEN_ELFNOTE_DUMPCORE_FORMAT_VERSION     0x2000003
 
 #endif /* __XEN_PUBLIC_ELFNOTE_H__ */
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 19:36:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 19:36:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782598.1192103 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sha5W-0002Os-8s; Fri, 23 Aug 2024 19:36:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782598.1192103; Fri, 23 Aug 2024 19:36:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sha5W-0002Ol-5x; Fri, 23 Aug 2024 19:36:46 +0000
Received: by outflank-mailman (input) for mailman id 782598;
 Fri, 23 Aug 2024 19:36: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=Xt9W=PW=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1sha5U-0002Oa-OP
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 19:36:44 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on2060f.outbound.protection.outlook.com
 [2a01:111:f403:2417::60f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 05c11546-6187-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 21:36:42 +0200 (CEST)
Received: from BN0PR04CA0194.namprd04.prod.outlook.com (2603:10b6:408:e9::19)
 by DS7PR12MB5960.namprd12.prod.outlook.com (2603:10b6:8:7f::14) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.17; Fri, 23 Aug
 2024 19:36:36 +0000
Received: from BN2PEPF000044A8.namprd04.prod.outlook.com
 (2603:10b6:408:e9:cafe::26) by BN0PR04CA0194.outlook.office365.com
 (2603:10b6:408:e9::19) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19 via Frontend
 Transport; Fri, 23 Aug 2024 19:36:35 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 BN2PEPF000044A8.mail.protection.outlook.com (10.167.243.102) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 19:36:35 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 14:36:32 -0500
Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Fri, 23 Aug 2024 14:36:30 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 05c11546-6187-11ef-a50a-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=phzclxUEcNieUgcjJC3lGJWS6Rf+FjnbRSCBVXVOFLzZNPujw4UB5iMdG8PO+/J7kqa3fCvDE0hmMIe6ZTaddH93HZgB7LN73d1h8jmW8ZgnuNKFkNFom2A2lABTD058zr/5k8Qs17FFmEFmU3i4cFxpvNCHDgpyDhuycVcouWTMeNpcemH63qIP9aE6MwTuuC+H3c6tJFlrzQTm5YrENiStzQ2b7ZgeeFQScYQawF6vzlUcyTH9glPlrJL+2Fu/kJanUt3y1J6Q3UEMrQvxhdaKi/gcDQDK1kcVIX1ldcfaC+W2O6XYeNhvMKVMSv3r3+wfEPzq2bUAy1aGmeR1pA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=YE/FHW+MnLIK9zq/+3hrk0lf43oLDdOIR+bTH4i7kl8=;
 b=XU6BlZWhUttTWeHoMC0Ztg7lQmiiOHDMG90yfygJEUgQ05AJSxTtrh7QodYxg1m1Ng5igPkZjfiDJGGHXkGaGkCeu2uQTrkKe1URIaOaJXEce6Vu0o2RCHXt56zl8a1SUBBSnPiexVLvPJpaS+T/JwrXdcN2PmKfhHWZL4RhGlh4tOZhJa2NRcoJeZ2+vOZuNcJhvhAGFuuYl1drjY96m6vGl4MhbuJVgtRbE1DJzHOQrpV9lATn1aTyj4VPKVouCXHtwAeD8wnE527jEjEwbfkfZdF2vPu/4Dzux8DMeBleD727GXCPzREocne65+amDYvYWZwcVfaFHQPTi88pbw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=YE/FHW+MnLIK9zq/+3hrk0lf43oLDdOIR+bTH4i7kl8=;
 b=M+iQS0RK+4m48b7YoGmwD2vO4r8QIJ4a1CzmnsdlVCD3KOWbZstHBqUSg3V4wQ5Ck7DBJcWvlR8Jak51iYHMmoB5vdLDIGbrnNOW+5qikvvAfP52353fEkb9AwA/1kEj8d/lCfVkpmqVXIwqvrnHz5OX4FG3PDTEi1yMSvqqHl0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Jason Andryuk <jason.andryuk@amd.com>
To: Juergen Gross <jgross@suse.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Thomas Gleixner <tglx@linutronix.de>, "Ingo
 Molnar" <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, "H. Peter Anvin"
	<hpa@zytor.com>, Stefano Stabellini <sstabellini@kernel.org>, "Oleksandr
 Tyshchenko" <oleksandr_tyshchenko@epam.com>, Paolo Bonzini
	<pbonzini@redhat.com>, Brian Gerst <brgerst@gmail.com>
CC: <xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>, "Jason
 Andryuk" <jason.andryuk@amd.com>
Subject: [PATCH v3 0/5] x86/pvh: Make 64bit PVH entry relocatable
Date: Fri, 23 Aug 2024 15:36:25 -0400
Message-ID: <20240823193630.2583107-1-jason.andryuk@amd.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB04.amd.com: jason.andryuk@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BN2PEPF000044A8:EE_|DS7PR12MB5960:EE_
X-MS-Office365-Filtering-Correlation-Id: 94032644-194a-4adf-e661-08dcc3aae662
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|376014|7416014|1800799024|36860700013|921020;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?/mKgLiFErO75DiugM2+mk9cPaSZAThHW2l+SH1EaRbYhrc+xhfZGggr7tHz/?=
 =?us-ascii?Q?I0H0ITH61c20kcnevbmb5xAC7dnfbl1fkPaMhLoN52M1ZciH1b+xVA14AImz?=
 =?us-ascii?Q?zt/niUWYiacn9wmYzACIzOib1jpaFmBlhF7kE1Arb+lnye7q+v4fZpKWSJlP?=
 =?us-ascii?Q?VeoraliDMQoF/nIRBM3WkjNRWaXwOW3yEUEyYRpVgYJxjL8P5Cs8qC+D4n3y?=
 =?us-ascii?Q?nulXkrnE8r8fTr1iz5n6DTPAD50ubhFxp9OMG3XanW56NwoClALlaZQmZtAS?=
 =?us-ascii?Q?fdZN4HLZ5WYxxsLGY2IAM4saOe5fy4kk2KlbLQ86g5FnkS2vZsMY2pqdQPjn?=
 =?us-ascii?Q?9pvToYw4H1hsjAD6f8ywR4RZoSntt42ZhYCeB+lWSQW47yOvv0lMvkpp7qIw?=
 =?us-ascii?Q?hiLE+qv1o8fu8TwjRIve+loSUcZs60yQTTA9icYzLOB6o8QH1CNaa7zKZ+Sx?=
 =?us-ascii?Q?fRrz5jxCsVoRqRmkHfEBVBlciiruRKwhqAdxybiqLERyOLTEsoiQ0pD0u4Yq?=
 =?us-ascii?Q?/dhnLxQ/hoRW8U+IdgC5sSs2R2LbdUUqEVGlOlTYZgtdxajoXCJVfSJJXQpU?=
 =?us-ascii?Q?agUx4s2WpN1gbZpqC3ng9Ty8GKH+Dt7OIBKFHKd5p/fobTqon8FcP5QbY78G?=
 =?us-ascii?Q?iMGpU1OMzkdq1gHHXtP5rr87tVVrjn5smExFhWp3MoJUFnJE0tah8t6Z+2ap?=
 =?us-ascii?Q?uBgSi3BuTSsbOetZt+CoY/U3OVHa7Iy4lephxWyiQ9nZYwA0PAD1se64M0b8?=
 =?us-ascii?Q?wAQZtiUM7OXoDra1LoCola+Hj2QJudB+9i+4G4iKlUyd78mVWpTyQQaKynum?=
 =?us-ascii?Q?88ncUxw5fIgUqbj1ZKxOGhGeNa2p4kino0P+lG/WGArz3ae74ZmXdZAbyehL?=
 =?us-ascii?Q?2RKV23JM2qrT0gHLwX+esUn9dnnQGJ1GesGpdWQvdC5SihTDFtoxFxIKi4AV?=
 =?us-ascii?Q?1arU3saVFNYpXAlyaLeHRoPQqlsOZoNlb0TzIhma0exOB8ST7UQwgFpl7nrp?=
 =?us-ascii?Q?DkmUn6c8jAOc1WYjMdZ9ChY04cogmHLCqtMlbvIND7mvL30sh4nPfNHrCCmY?=
 =?us-ascii?Q?EDnKPhOBT5Nm0uFUE68z3vPk7s13NuPJcg/TyEOv+ERTWwkbd8o/xmNfJFmT?=
 =?us-ascii?Q?VE0idqu/CSp8klmBxK8H0OvEuoT+sfMTmzNlwoIhqVRTm/AIQD3pg9pEbj/x?=
 =?us-ascii?Q?x0UVHHvdI8I5h1fQEJA0hGPErv/AfSQheFGxNrK4mwiq2WKuy8Gb+TRx7qga?=
 =?us-ascii?Q?j9XKXGstKCqMAQzBQnGBPLKBU9rqCLHHJZACFt5nrgqfX8ickm6bw0CcpXXX?=
 =?us-ascii?Q?k/yLPE0tUvJJEOMLgPJIy/eSWjoGD/8cnDLd/Ar4mUp6s19q0J74jBpQPhpE?=
 =?us-ascii?Q?qH1YS+rvZOEZaDKuTtozHZb82uARvoX5GZAHb0LKdBWzdhCDiFMoBjeHjvKH?=
 =?us-ascii?Q?1gYJmWqO1m+wOYSIBz+JJiSTON6PcKG9+YpdJzqyfAUiqiGse7nOiw=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(7416014)(1800799024)(36860700013)(921020);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 19:36:35.6240
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 94032644-194a-4adf-e661-08dcc3aae662
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BN2PEPF000044A8.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5960

Using the PVH entry point, the uncompressed vmlinux is loaded at
LOAD_PHYSICAL_ADDR, and execution starts in 32bit mode at the
address in XEN_ELFNOTE_PHYS32_ENTRY, pvh_start_xen, with paging
disabled.

Loading at LOAD_PHYSICAL_ADDR has not been a problem in the past as
virtual machines don't have conflicting memory maps.  But Xen now
supports a PVH dom0, which uses the host memory map, and there are
Coreboot/EDK2 firmwares that have reserved regions conflicting with
LOAD_PHYSICAL_ADDR.  Xen recently added XEN_ELFNOTE_PHYS32_RELOC to
specify an alignment, minimum and maximum load address when
LOAD_PHYSICAL_ADDR cannot be used.  This patch series makes the PVH
entry path PIC to support relocation.

Only x86-64 is converted.  The 32bit entry path calling into vmlinux,
which is not PIC, will not support relocation.

The entry path needs pages tables to switch to 64bit mode.  A new
pvh_init_top_pgt is added to make the transition into the startup_64
when the regular init_top_pgt pagetables are setup.  This duplication is
unfortunate, but it keeps the changes simpler.  __startup_64() can't be
used to setup init_top_pgt for PVH entry because it is 64bit code - the
32bit entry code doesn't have page tables to use.

This is the straight forward implementation to make it work.  Other
approaches could be pursued.

checkpatch.pl gives an error: "ERROR: Macros with multiple statements
should be enclosed in a do - while loop" about the moved PMDS macro.
But PMDS is an assembler macro, so its not applicable.  There are some
false positive warnings "WARNING: space prohibited between function name
and open parenthesis '('" about the macro, too.

v2 addresses review feedback.  It also replace LOAD_PHYSICAL_ADDR with
_pa(pvh_start_xen) in some offset calculations.  They happened to be
equal in my original builds.  When the two values differ,
_pa(pvh_start_xen) is the correct one to use.

v3: Fix build error for 32bit.  Add Juergen's R-b to patch 4.

Jason Andryuk (5):
  xen: sync elfnote.h from xen tree
  x86/pvh: Make PVH entrypoint PIC for x86-64
  x86/pvh: Set phys_base when calling xen_prepare_pvh()
  x86/kernel: Move page table macros to header
  x86/pvh: Add 64bit relocation page tables

 arch/x86/include/asm/pgtable_64.h |  23 ++++-
 arch/x86/kernel/head_64.S         |  20 ----
 arch/x86/platform/pvh/head.S      | 161 +++++++++++++++++++++++++++---
 include/xen/interface/elfnote.h   |  93 ++++++++++++++++-
 4 files changed, 259 insertions(+), 38 deletions(-)


base-commit: 7c626ce4bae1ac14f60076d00eafe71af30450ba
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 19:36:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 19:36:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782602.1192144 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sha5a-0003Nn-Kj; Fri, 23 Aug 2024 19:36:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782602.1192144; Fri, 23 Aug 2024 19:36:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sha5a-0003NZ-H1; Fri, 23 Aug 2024 19:36:50 +0000
Received: by outflank-mailman (input) for mailman id 782602;
 Fri, 23 Aug 2024 19:36:48 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Xt9W=PW=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1sha5Y-0002Oa-OF
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 19:36:48 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on2060e.outbound.protection.outlook.com
 [2a01:111:f403:2417::60e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 08dcf510-6187-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 21:36:47 +0200 (CEST)
Received: from BN8PR03CA0030.namprd03.prod.outlook.com (2603:10b6:408:94::43)
 by SA1PR12MB6822.namprd12.prod.outlook.com (2603:10b6:806:25d::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20; Fri, 23 Aug
 2024 19:36:44 +0000
Received: from BL02EPF00021F6C.namprd02.prod.outlook.com
 (2603:10b6:408:94:cafe::ce) by BN8PR03CA0030.outlook.office365.com
 (2603:10b6:408:94::43) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend
 Transport; Fri, 23 Aug 2024 19:36:43 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 BL02EPF00021F6C.mail.protection.outlook.com (10.167.249.8) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 19:36:43 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 14:36:43 -0500
Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Fri, 23 Aug 2024 14:36:42 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 08dcf510-6187-11ef-a50a-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=vrLdvVAYNnK0GXqQoPQm4dyZhaTVDxuvnrEqN6inGJdNrYhU4z25N2fHaSwOxCwifPjhi/rlVRt2HPZvA6l5MlwALoGjQhhRwkpTF5leYyv0YjU4iW4HlsrtbqtQZtZgwxaYo+6naUP3KKVW31PU6ArynM8DedR23wRiLoPIbqrBhfknUFxcJomkrRkPNDno654xRrKfeCmZnStmauXwWLOpfxhWyKqMLPBDsnr4xfxzx/i9Sv7OSD+WSWwrummQ2g874nS4owIPGFVRg1e1Em7DJFidqK0/dxJjrNJ0pZgIBQzPEsLq9Cj5c1SwNljktDnQSszUvgjqTxEUXiFhJw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=54RpaQe43r3m1s3jgsbEk0pLsaUFOLQtoTRxmGcRr5Q=;
 b=xU8bLOxXWQBIDXUnfFu0V6bIeC69ocSKPjGVRgA12hHb/79sN9Tf/x1UhCWHVEexeJpVhBU2FJfDNCXG4BPE/D+Ay88kcI+463RqKZ8KTgn04s7vDMyj9o07874oiHq2MKTc9nJlA28/c609c8nYskmNi7x7/E/rrR0XSwM7MQdowiFAQ9Oiy96Oyr4XWD0eFIE1/gP8tbyXewy6DEhPAfS5bdap5mNfY3KeEBf9Jdw1McqbVOmF1QPp4+IZOMxxNdGGCT+Q+mV0rp0zP1MR0FmgzxnLnOodIAlGWa1O1LQqGhNfflbX1CXgxKoRB1RTAPUNCbeL95qTON4OzM4lzw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=54RpaQe43r3m1s3jgsbEk0pLsaUFOLQtoTRxmGcRr5Q=;
 b=FjkcPNpZ1ZKQqoTmzy3n3sNLAaQ/2kAC31pgibFrQ2PikK3IWsJNhQ5rQIYqWXCuP/zqeW6Jb4nKuFHrfSkT4xTYkTTLrXK+Lf67f+fvNSFW8/+eW2shQVhYnrZvgtVRmf1NeIHJHSCxMeHQGhFbyIh4qeYDf8LpK8AzaFlb4Ic=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Jason Andryuk <jason.andryuk@amd.com>
To: Juergen Gross <jgross@suse.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Thomas Gleixner <tglx@linutronix.de>, "Ingo
 Molnar" <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, "H. Peter Anvin"
	<hpa@zytor.com>, Stefano Stabellini <sstabellini@kernel.org>, "Oleksandr
 Tyshchenko" <oleksandr_tyshchenko@epam.com>, Paolo Bonzini
	<pbonzini@redhat.com>, Brian Gerst <brgerst@gmail.com>
CC: <xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>, "Jason
 Andryuk" <jason.andryuk@amd.com>
Subject: [PATCH v3 5/5] x86/pvh: Add 64bit relocation page tables
Date: Fri, 23 Aug 2024 15:36:30 -0400
Message-ID: <20240823193630.2583107-6-jason.andryuk@amd.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240823193630.2583107-1-jason.andryuk@amd.com>
References: <20240823193630.2583107-1-jason.andryuk@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB03.amd.com: jason.andryuk@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL02EPF00021F6C:EE_|SA1PR12MB6822:EE_
X-MS-Office365-Filtering-Correlation-Id: 8f124fd5-18ca-4ed9-1407-08dcc3aaeb49
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|376014|7416014|36860700013|921020;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?kfGL76HojrxbYgwwBDmpX+cNmS9nZnQffV2efutiCAaLOqj5QxTU9Q2qUtLe?=
 =?us-ascii?Q?Axzp4zhDdm2rdA76xJSyEpx+5PpSRBQ/jG7MNBzGNQ4m5jFZGEQ8lU26+PPm?=
 =?us-ascii?Q?TAa7l/4dD89wjkkG7bK/z3Gg0HsM6saP3V4HBQY522fBY10aOsiJL+0bQnrH?=
 =?us-ascii?Q?7jCr9iot1JeY0g2Ijo3frjQLfCZT5/37eFgp0s+UnbYmR6Wcat0R3uRSED4e?=
 =?us-ascii?Q?39qmsRzk6ntGdSDwqWF06IfQEU/8EMMS6FVm+dYECz/Kds+SR6hJk1KfF07x?=
 =?us-ascii?Q?xPamdRPUmvj1y+oYKpNHGNsWLoWBqc4U0RBFoXUU5ITLWGtF95mCNgxkhOI1?=
 =?us-ascii?Q?ngxvvbCWDKGspH1EnGU4OuuY6GHBzXOLqOq+k9IjYXjCGystsXnfDyY8UnBu?=
 =?us-ascii?Q?kM/Xj9KuDyyFcKKLteXht6bnYnu9tCE+lBB+/DWl8FwFVCwygUMk12ezD27c?=
 =?us-ascii?Q?5e/tzR1ppddxQ29DQuHiJErfesky7ZsE2ig35DLSXb46vcKKo0nMlT+GgXMf?=
 =?us-ascii?Q?b5gGVnBC9jLGfQRuorZNKvdAkjiVynrE2D6EEoMQLe3BlpLMWZ57QXAHJVAD?=
 =?us-ascii?Q?lHcD/QTsDP7R7I9Zrh1HudEUUahw/A0ms+rXYbGUJgk4vVqYiSKFFmLbSXZt?=
 =?us-ascii?Q?Ow/hAC7+76AwOSnUtRrDkyLYkrqlOHnEjEchPkEh9MGNTaM+uo8nr0Gllb0P?=
 =?us-ascii?Q?DWyTjxyG3Pra3+qOmIaes5FzyTtNddDRb6N67sSvsSUVmPhP885XhdG4t3RT?=
 =?us-ascii?Q?RS8KwAIFziFHyXMn8wpvB5zPacieogWW14Zgl/NNy+zHRBZQtH3nKeXZE6AZ?=
 =?us-ascii?Q?GvLNOeXv+nn6rFgnwT2JDJ2gDy9FsZLuBARyeUuWmGG8pxxAnngrrsCyh9xZ?=
 =?us-ascii?Q?/dH8FAuOxolOeYRMa71wFunkBH/HF3ahNOKnoXt+534ZZx4gVGr0b/ZXT7ME?=
 =?us-ascii?Q?R9hY1eVON+WHCXML32eQL2YHxwbhOYmbJgHjwtjbqJtiTJsHjJfmrThaulR2?=
 =?us-ascii?Q?E9zk1XXY+Ng4KJ3EonWwqf53Gt8h7EpysOIDy7P+fhVRnf2wNNZSmVogw7RT?=
 =?us-ascii?Q?s0T4xh/GhrESOpTBMWldS+3KzfY2tjKzygpYaiJn8QJtQ4bdF/ya+hYj/bTk?=
 =?us-ascii?Q?WhHmbX+UG2cCnx36SST3LdOAim9NwbLomj8Ea04JM4JKRb3eIlhyG9S7sLTp?=
 =?us-ascii?Q?ZZJQayJCLYsUfs2QNwDQwvkgm7eUhvAZx1blXDii66hMXcOHeJCH2vrzeec4?=
 =?us-ascii?Q?+bBk0YsnNOtVwDtBm/33D8tZJDczYy2y+1oMeTO4s+VwE2x2vAZGZuJCUpn6?=
 =?us-ascii?Q?eyvDjhlN7BIIlVWGiOsBeWTnlDiFZxK0ZKf4/cy2IYqZlx0eoYPyCehcHTYQ?=
 =?us-ascii?Q?/xMEYYFcXyELKqpzrc5C0JapW8quVx+LsZnx/9Yrcue+Vzt/DHVVlV5smDZE?=
 =?us-ascii?Q?HGr0/A1hc6VoX8POkkJW1FEipT8TfWHE?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(7416014)(36860700013)(921020);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 19:36:43.7965
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 8f124fd5-18ca-4ed9-1407-08dcc3aaeb49
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL02EPF00021F6C.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6822

The PVH entry point is 32bit.  For a 64bit kernel, the entry point must
switch to 64bit mode, which requires a set of page tables.  In the past,
PVH used init_top_pgt.

This works fine when the kernel is loaded at LOAD_PHYSICAL_ADDR, as the
page tables are prebuilt for this address.  If the kernel is loaded at a
different address, they need to be adjusted.

__startup_64() adjusts the prebuilt page tables for the physical load
address, but it is 64bit code.  The 32bit PVH entry code can't call it
to adjust the page tables, so it can't readily be re-used.

64bit PVH entry needs page tables set up for identity map, the kernel
high map and the direct map.  pvh_start_xen() enters identity mapped.
Inside xen_prepare_pvh(), it jumps through a pv_ops function pointer
into the highmap.  The direct map is used for __va() on the initramfs
and other guest physical addresses.

Add a dedicated set of prebuild page tables for PVH entry.  They are
adjusted in assembly before loading.

Add XEN_ELFNOTE_PHYS32_RELOC to indicate support for relocation
along with the kernel's loading constraints.  The maximum load address,
KERNEL_IMAGE_SIZE - 1, is determined by a single pvh_level2_ident_pgt
page.  It could be larger with more pages.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
---
v3:
Include asm/pgtable.h to avoid 32bit build failure

v2:
Use some defines: PTRS_PER_PGD, PTRS_PER_PMD, PAGE_SIZE
Add some spaces around operators and after commas
Include asm/pgtable_64.h
s/LOAD_PHYSICAL_ADDR/_pa(pvh_start_xen)/ in case they differ
---
 arch/x86/platform/pvh/head.S | 104 ++++++++++++++++++++++++++++++++++-
 1 file changed, 103 insertions(+), 1 deletion(-)

diff --git a/arch/x86/platform/pvh/head.S b/arch/x86/platform/pvh/head.S
index 14b4345d9bae..64fca49cd88f 100644
--- a/arch/x86/platform/pvh/head.S
+++ b/arch/x86/platform/pvh/head.S
@@ -16,6 +16,7 @@
 #include <asm/segment.h>
 #include <asm/asm.h>
 #include <asm/boot.h>
+#include <asm/pgtable.h>
 #include <asm/processor-flags.h>
 #include <asm/msr.h>
 #include <asm/nospec-branch.h>
@@ -102,8 +103,47 @@ SYM_CODE_START_LOCAL(pvh_start_xen)
 	btsl $_EFER_LME, %eax
 	wrmsr
 
+	mov %ebp, %ebx
+	subl $_pa(pvh_start_xen), %ebx /* offset */
+	jz .Lpagetable_done
+
+	/* Fixup page-tables for relocation. */
+	leal rva(pvh_init_top_pgt)(%ebp), %edi
+	movl $PTRS_PER_PGD, %ecx
+2:
+	testl $_PAGE_PRESENT, 0x00(%edi)
+	jz 1f
+	addl %ebx, 0x00(%edi)
+1:
+	addl $8, %edi
+	decl %ecx
+	jnz 2b
+
+	/* L3 ident has a single entry. */
+	leal rva(pvh_level3_ident_pgt)(%ebp), %edi
+	addl %ebx, 0x00(%edi)
+
+	leal rva(pvh_level3_kernel_pgt)(%ebp), %edi
+	addl %ebx, (PAGE_SIZE - 16)(%edi)
+	addl %ebx, (PAGE_SIZE - 8)(%edi)
+
+	/* pvh_level2_ident_pgt is fine - large pages */
+
+	/* pvh_level2_kernel_pgt needs adjustment - large pages */
+	leal rva(pvh_level2_kernel_pgt)(%ebp), %edi
+	movl $PTRS_PER_PMD, %ecx
+2:
+	testl $_PAGE_PRESENT, 0x00(%edi)
+	jz 1f
+	addl %ebx, 0x00(%edi)
+1:
+	addl $8, %edi
+	decl %ecx
+	jnz 2b
+
+.Lpagetable_done:
 	/* Enable pre-constructed page tables. */
-	leal rva(init_top_pgt)(%ebp), %eax
+	leal rva(pvh_init_top_pgt)(%ebp), %eax
 	mov %eax, %cr3
 	mov $(X86_CR0_PG | X86_CR0_PE), %eax
 	mov %eax, %cr0
@@ -198,5 +238,67 @@ SYM_DATA_START_LOCAL(early_stack)
 	.fill BOOT_STACK_SIZE, 1, 0
 SYM_DATA_END_LABEL(early_stack, SYM_L_LOCAL, early_stack_end)
 
+#ifdef CONFIG_X86_64
+/*
+ * Xen PVH needs a set of identity mapped and kernel high mapping
+ * page tables.  pvh_start_xen starts running on the identity mapped
+ * page tables, but xen_prepare_pvh calls into the high mapping.
+ * These page tables need to be relocatable and are only used until
+ * startup_64 transitions to init_top_pgt.
+ */
+SYM_DATA_START_PAGE_ALIGNED(pvh_init_top_pgt)
+	.quad   pvh_level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
+	.org    pvh_init_top_pgt + L4_PAGE_OFFSET * 8, 0
+	.quad   pvh_level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
+	.org    pvh_init_top_pgt + L4_START_KERNEL * 8, 0
+	/* (2^48-(2*1024*1024*1024))/(2^39) = 511 */
+	.quad   pvh_level3_kernel_pgt - __START_KERNEL_map + _PAGE_TABLE_NOENC
+SYM_DATA_END(pvh_init_top_pgt)
+
+SYM_DATA_START_PAGE_ALIGNED(pvh_level3_ident_pgt)
+	.quad	pvh_level2_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
+	.fill	511, 8, 0
+SYM_DATA_END(pvh_level3_ident_pgt)
+SYM_DATA_START_PAGE_ALIGNED(pvh_level2_ident_pgt)
+	/*
+	 * Since I easily can, map the first 1G.
+	 * Don't set NX because code runs from these pages.
+	 *
+	 * Note: This sets _PAGE_GLOBAL despite whether
+	 * the CPU supports it or it is enabled.  But,
+	 * the CPU should ignore the bit.
+	 */
+	PMDS(0, __PAGE_KERNEL_IDENT_LARGE_EXEC, PTRS_PER_PMD)
+SYM_DATA_END(pvh_level2_ident_pgt)
+SYM_DATA_START_PAGE_ALIGNED(pvh_level3_kernel_pgt)
+	.fill	L3_START_KERNEL, 8, 0
+	/* (2^48-(2*1024*1024*1024)-((2^39)*511))/(2^30) = 510 */
+	.quad	pvh_level2_kernel_pgt - __START_KERNEL_map + _KERNPG_TABLE_NOENC
+	.quad	0 /* no fixmap */
+SYM_DATA_END(pvh_level3_kernel_pgt)
+
+SYM_DATA_START_PAGE_ALIGNED(pvh_level2_kernel_pgt)
+	/*
+	 * Kernel high mapping.
+	 *
+	 * The kernel code+data+bss must be located below KERNEL_IMAGE_SIZE in
+	 * virtual address space, which is 1 GiB if RANDOMIZE_BASE is enabled,
+	 * 512 MiB otherwise.
+	 *
+	 * (NOTE: after that starts the module area, see MODULES_VADDR.)
+	 *
+	 * This table is eventually used by the kernel during normal runtime.
+	 * Care must be taken to clear out undesired bits later, like _PAGE_RW
+	 * or _PAGE_GLOBAL in some cases.
+	 */
+	PMDS(0, __PAGE_KERNEL_LARGE_EXEC, KERNEL_IMAGE_SIZE / PMD_SIZE)
+SYM_DATA_END(pvh_level2_kernel_pgt)
+
+	ELFNOTE(Xen, XEN_ELFNOTE_PHYS32_RELOC,
+		     .long CONFIG_PHYSICAL_ALIGN;
+		     .long LOAD_PHYSICAL_ADDR;
+		     .long KERNEL_IMAGE_SIZE - 1)
+#endif
+
 	ELFNOTE(Xen, XEN_ELFNOTE_PHYS32_ENTRY,
 	             _ASM_PTR (pvh_start_xen - __START_KERNEL_map))
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 19:36:51 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 19:36:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782603.1192150 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sha5b-0003Qc-3j; Fri, 23 Aug 2024 19:36:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782603.1192150; Fri, 23 Aug 2024 19:36:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sha5a-0003PP-Q7; Fri, 23 Aug 2024 19:36:50 +0000
Received: by outflank-mailman (input) for mailman id 782603;
 Fri, 23 Aug 2024 19:36:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Xt9W=PW=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1sha5Z-0002Oa-8V
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 19:36:49 +0000
Received: from NAM10-BN7-obe.outbound.protection.outlook.com
 (mail-bn7nam10on2060b.outbound.protection.outlook.com
 [2a01:111:f403:2009::60b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 08e2cd12-6187-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 21:36:48 +0200 (CEST)
Received: from BN9PR03CA0612.namprd03.prod.outlook.com (2603:10b6:408:106::17)
 by PH0PR12MB8128.namprd12.prod.outlook.com (2603:10b6:510:294::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.16; Fri, 23 Aug
 2024 19:36:41 +0000
Received: from BL02EPF00021F6D.namprd02.prod.outlook.com
 (2603:10b6:408:106:cafe::f4) by BN9PR03CA0612.outlook.office365.com
 (2603:10b6:408:106::17) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19 via Frontend
 Transport; Fri, 23 Aug 2024 19:36:41 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 BL02EPF00021F6D.mail.protection.outlook.com (10.167.249.9) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 19:36:41 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 14:36:39 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 14:36:39 -0500
Received: from fedora.mshome.net (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Fri, 23 Aug 2024 14:36:38 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 08e2cd12-6187-11ef-a50a-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=gI4HnmrqD+UJKi1TDmVqqlFkRMKRb5JYcMT5A3AK4fHUyUf/bNwCPOlQOvlmnmOMyzwqtcb9Y3h39ShhlMCDTM5z2AIOWACdsf76L4rqIQCDq9WPGOQQvR18WUnzy41LQhgpd8qQFQh4cS8v5+HVSWXUAISSzlzmWW/W17FeYHTTpzFCDVr/WCq4C74LnFrPTl6S2mpSvVmigvlvjmWQH+3pHE1y0C7iJlybcZAeIwwa42UdZt2AAUDUskBztV3SKaJ8X5ONT5Y5C96hqI2ZWyPIEAzDCdKoP92LnWA4r0r/rUQ2mOczt2eAj/q4dtlCrQneb+ptpWmhWZ7mFtI5qw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=87Cir7MUe+90Zd8HQRFVV15Z21B672vcEXroWazgwgg=;
 b=WRqy621ZsX7veYtjsK9uj3d/oRaukkw3pvP2T6BW/yEX0dlWOG1kaH4qysLPEJW2CIab/ZtdAQE7ZKJIQb77cjfCghavsME8+btwLff2mAFuSVQgnnKmUqwVTmCPHAWX5BrYwhnWX+FaGTvAUNGUokLgiBHCI05MytfgpjSzvUQ07PG7iZ+2NU8thM8YcWIXO3k1Fwvkp0YEebExpJIVutbVIN3z/VQVM5F5ZumNEsuabWnplZKcxpfVNDGSeG17SViWlLBkYYctF1WC44NcTbMilFbjntOd5AucSWXNFFd3EUpdOhf/BFcKwnJG0brjiSHjMM6/EDKCfzombyaa9Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=87Cir7MUe+90Zd8HQRFVV15Z21B672vcEXroWazgwgg=;
 b=OpARkPMAQRESpBjU2iz82I4pyZga0fqaaK3+0M3NlZzDqBSwdMe2G0++Qyq49hE9guqMCGRkzfSB/a0foCcPQYiiweXeui0SAQ9Kg3vcHWPOMHKi9nHD8+IcKa6okYYKWiuh/wxQjuBbaPI87LhKq5I9imGx5/A0mQ+aFzu/IsM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Jason Andryuk <jason.andryuk@amd.com>
To: Juergen Gross <jgross@suse.com>, Boris Ostrovsky
	<boris.ostrovsky@oracle.com>, Thomas Gleixner <tglx@linutronix.de>, "Ingo
 Molnar" <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen
	<dave.hansen@linux.intel.com>, <x86@kernel.org>, "H. Peter Anvin"
	<hpa@zytor.com>, Stefano Stabellini <sstabellini@kernel.org>, "Oleksandr
 Tyshchenko" <oleksandr_tyshchenko@epam.com>, Paolo Bonzini
	<pbonzini@redhat.com>, Brian Gerst <brgerst@gmail.com>
CC: <xen-devel@lists.xenproject.org>, <linux-kernel@vger.kernel.org>, "Jason
 Andryuk" <jason.andryuk@amd.com>
Subject: [PATCH v3 3/5] x86/pvh: Set phys_base when calling xen_prepare_pvh()
Date: Fri, 23 Aug 2024 15:36:28 -0400
Message-ID: <20240823193630.2583107-4-jason.andryuk@amd.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240823193630.2583107-1-jason.andryuk@amd.com>
References: <20240823193630.2583107-1-jason.andryuk@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: BL02EPF00021F6D:EE_|PH0PR12MB8128:EE_
X-MS-Office365-Filtering-Correlation-Id: 61909554-2875-4dce-f921-08dcc3aae9f0
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|7416014|36860700013|376014|1800799024|921020;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?KP4L1JWxRIeBpE0EEJO8LpP5IlZX6HTTBy+87aBKiwKesa0foNZXpOPd+2Hd?=
 =?us-ascii?Q?o58fZbj/1bkOQ0/7w2eUfvi3no+csR/v5S1h5IxXiC+zULrTwYxO4rVSj7Ng?=
 =?us-ascii?Q?CBS5L+EbRCdca/+pv9VYd1Dd85ERLMsAA4ypNYvNFMtwmblFpjHIzuf4Zrbq?=
 =?us-ascii?Q?0lpS7nwszZzs4a93u9+HvkLLz528joXOhm2B+WU45K1ymnc8nlqO6TbVIk7x?=
 =?us-ascii?Q?+H7KHH61Szp4VoVJfWyiFx6FPXEiTs/Ie+TZ5yDzhYjefpckFPoBY2ovcAPo?=
 =?us-ascii?Q?lZeG3bfV/dRvWonrZaRVjWPDUPYT0AVjFSr+L++cnODjapESASOqaBDDB7DZ?=
 =?us-ascii?Q?6cskcdTksGlpBXuvgwfpsPTk0uMRtVkWWB1efj9HMa6OzutwqNIxT6S3RjZ1?=
 =?us-ascii?Q?E/LWpEoR7AYhILzdmXseg3M9s0wZt2qTvkdcA2XeE4Z0ndbhPhIYL7TuJXhT?=
 =?us-ascii?Q?8MRsKyJZy2fBnHgDcHDA38g2ObURwu81uPFyWxjE8AA7pncDcOhqR0VvJW1B?=
 =?us-ascii?Q?tsBWo66E+Afvv80PlBUwn6tTWXDMHw62dnz6JOtDMJqmgWv3DJ+gpAzUE3ol?=
 =?us-ascii?Q?kHq0gcQTHA3o27mT7bdQNlwkYnGe+ktEvv2WCAP0rWosncovNasmX8T3rG8z?=
 =?us-ascii?Q?JfeKCpwgUXnDy5Vzc9GN26oCS5jYjV0msCXQ9igCa0kmKb5BramzJTjk0jrg?=
 =?us-ascii?Q?N2e9XYeefoAfp6uV2vlBvJBN5bW84EDPF6oRIibtV3ppKxFqcpClkbHjjtZJ?=
 =?us-ascii?Q?7UTCPii1jrgK2R9o8mv3o+/tX7/3Mkzel3NqWTNzWO3RlTdALh48kNbdkK9R?=
 =?us-ascii?Q?xuZ19cNicF6Mp2EbBuPBqHZr4ywBBQvvIY9JkBtdC7svUOBDddo7U072s8qd?=
 =?us-ascii?Q?pJDchFycruSv1QZYZqWmDXVPDmq4qYAj/4e5HHOLFHd9w8kOpyEDJfs1yEof?=
 =?us-ascii?Q?3Zd5cTuTfpPFlsgrYGfStmiCOMEW3O44bs4Qo6MJivQ5GusiGAB1cZDgElhl?=
 =?us-ascii?Q?rBxSd4BrlPVu2CKLRmSDEqdbeGZW7yFbN/GkKZ5KVnb8w4DG0ct5C4x7EA9S?=
 =?us-ascii?Q?bpNaxjHoaUnm6UTUj5yh8RkN9+61b4BTsZ6A0a7SNMST4VoDdhzb/0NIlFM3?=
 =?us-ascii?Q?RJCGDgARdh2gZQgcDjNoHAIpDpNFFJCGMpsMrFCGQX4E+drVjHc/lA8Rju9f?=
 =?us-ascii?Q?zKis5LYgDsNKN/lz/fTKQiOgm3sTdJ6OM5FPAkp1j9xV2+OurWs04O+ttCYJ?=
 =?us-ascii?Q?ZiSKUnn6z521fzyoc5o/0FgvbJL8GklbR+2t+Z1Z1pNLULBK+ewdVc2ca+C4?=
 =?us-ascii?Q?GrTG/ayHLCHhxtHbcj9B9CvQ0HBr7k9ocMFA2awCdBeG5fhomUF/nxCLsBQO?=
 =?us-ascii?Q?IS7/IH0nc0ZR8ObZfQ4QFdrhoWBJW1D+s/VFzvGKr1EG1kU3DKe//lFD/0SI?=
 =?us-ascii?Q?raPo6OBPdY3eak84qie+VKd9A5kao5HG?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(7416014)(36860700013)(376014)(1800799024)(921020);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 19:36:41.5726
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 61909554-2875-4dce-f921-08dcc3aae9f0
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	BL02EPF00021F6D.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8128

phys_base needs to be set for __pa() to work in xen_pvh_init() when
finding the hypercall page.  Set it before calling into
xen_prepare_pvh(), which calls xen_pvh_init().  Clear it afterward to
avoid __startup_64() adding to it and creating an incorrect value.

Signed-off-by: Jason Andryuk <jason.andryuk@amd.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
---
v2:
Fix comment style
Add Juergen's R-b
s/LOAD_PHYSICAL_ADDR/_pa(pvh_start_xen)/ in case they differ
---
 arch/x86/platform/pvh/head.S | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/x86/platform/pvh/head.S b/arch/x86/platform/pvh/head.S
index ba4d0eab4436..14b4345d9bae 100644
--- a/arch/x86/platform/pvh/head.S
+++ b/arch/x86/platform/pvh/head.S
@@ -125,7 +125,20 @@ SYM_CODE_START_LOCAL(pvh_start_xen)
 	xor %edx, %edx
 	wrmsr
 
+	/*
+	 * Calculate load offset and store in phys_base.  __pa() needs
+	 * phys_base set to calculate the hypercall page in xen_pvh_init().
+	 */
+	movq %rbp, %rbx
+	subq $_pa(pvh_start_xen), %rbx
+	movq %rbx, phys_base(%rip)
 	call xen_prepare_pvh
+	/*
+	 * Clear phys_base.  __startup_64 will *add* to its value,
+	 * so reset to 0.
+	 */
+	xor  %rbx, %rbx
+	movq %rbx, phys_base(%rip)
 
 	/* startup_64 expects boot_params in %rsi. */
 	lea pvh_bootparams(%rip), %rsi
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 19:39:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 19:39:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782640.1192163 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sha84-0005iC-DH; Fri, 23 Aug 2024 19:39:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782640.1192163; Fri, 23 Aug 2024 19:39:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sha84-0005i5-Ah; Fri, 23 Aug 2024 19:39:24 +0000
Received: by outflank-mailman (input) for mailman id 782640;
 Fri, 23 Aug 2024 19:39:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sha83-0005hz-N2
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 19:39:23 +0000
Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com
 [2607:f8b0:4864:20::f2c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 65417869-6187-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 21:39:22 +0200 (CEST)
Received: by mail-qv1-xf2c.google.com with SMTP id
 6a1803df08f44-6bf6755323cso13256306d6.1
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 12:39:22 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6c162d49572sm21725276d6.33.2024.08.23.12.39.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 23 Aug 2024 12:39:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 65417869-6187-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724441961; x=1725046761; 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=IIFrbXHD2yrd19PjwqR8w1LRcwaKCmmuTwEs+GhJInw=;
        b=wYEBjlQ8Qz8vFoDbqcEtUcW/035JXqJ/Kvy+wo/sbw7Twvd/DTmj3CtIJy/4y/H29o
         7IhSVc7C4ZaqzJ/isYvkc/y7s02t9VRR553QeaQCXMeQFa7pOeApxk5aOlWNNPCiu14T
         SXnWsNgtLRawpdpQx0qBCChG4e5i/hYqjiyjE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724441961; x=1725046761;
        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=IIFrbXHD2yrd19PjwqR8w1LRcwaKCmmuTwEs+GhJInw=;
        b=pOscSWn/F5cSXt31rCyroZNHYWM4tfH2gtxACCCrj3gjx+NUOUp63TmMRjr58vO2Mf
         3uatPQCATiy0hZRykVPrU/Z30kAE8KGEa7ot0/2H7WC/APOZ8S1RyW785jOHUhS+7XyV
         at8O2rKaB6314Bf7Ma5IZe17mTvSwTpBI5VY/h2Y+xWij8JcAHguF1MPzuBuOeSGDsG3
         wurTaYAFM4eTTl/QQhd24IlZKkk68/DYK+vZeu+PdpZcc5xh3k80FI0CiWWNJxpbT6Mp
         nI9Er2iDEz3Lcf0STMX1dlnEBnF2SgWNRSyzIox1ZMBY2uayvKQmBZcML5+h9aFgH0QP
         RUIQ==
X-Forwarded-Encrypted: i=1; AJvYcCVImK0twDga83MCRBB6/4scRncbicGYHBWHc1nwT/pXNY6ivMvLtOtN0/O7FmKg1eN3AeJW4WyD7bE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwcQiEahxawDNSB+uo+oGdUZ+rcfm53Q4EOFu8gnU5eLlGcMqtZ
	J8GN9ACGc4kX5o38Iw88738OdjOR0TrJ6R765tmRUMYNT2tHrLNQXoXoxu66vwI=
X-Google-Smtp-Source: AGHT+IFBE8YYikpO6Wsf1OmX/j+Zi7Lzceo4yX/ZH50RS4aweRi/I/SUnuTfeX5gPmx5aGiSDSBSfA==
X-Received: by 2002:a05:6214:5713:b0:6bf:8833:e9c3 with SMTP id 6a1803df08f44-6c16deb2529mr38558176d6.50.1724441961146;
        Fri, 23 Aug 2024 12:39:21 -0700 (PDT)
Message-ID: <fadfcb8b-5799-46e0-a0d8-944077c3329d@citrix.com>
Date: Fri, 23 Aug 2024 20:39:17 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH for-4.19? 3/6] xen/macros: Introduce BUILD_ERROR()
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240625190719.788643-1-andrew.cooper3@citrix.com>
 <20240625190719.788643-4-andrew.cooper3@citrix.com>
 <1fe765d7-65c4-4f04-8835-327a0b623010@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <1fe765d7-65c4-4f04-8835-327a0b623010@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 26/06/2024 10:23 am, Jan Beulich wrote:
> On 25.06.2024 21:07, Andrew Cooper wrote:
>> --- a/xen/include/xen/macros.h
>> +++ b/xen/include/xen/macros.h
>> @@ -59,6 +59,8 @@
>>  #define BUILD_BUG_ON(cond) ((void)BUILD_BUG_ON_ZERO(cond))
>>  #endif
>>  
>> +#define BUILD_ERROR(msg) asm ( ".error \"" msg "\"" )
> I think this wants a comment, and one even beyond what is said for
> BUILD_BUG_ON(). This is primarily to make clear to people when to use
> which, i.e. I consider it important to mention here that it is intended
> for code which, in the normal case, we expect to be DCE-d. The nature
> of the condition used is also a relevant factor, as in some cases
> BUILD_BUG_ON() simply cannot be used because something that really is
> compile time constant isn't an integer constant expression. With
> something to this effect:
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Done, thanks.

>
> I have another question / suggestion, though.
>
>> --- a/xen/include/xen/self-tests.h
>> +++ b/xen/include/xen/self-tests.h
>> @@ -22,9 +22,9 @@
>>          typeof(fn(val)) real = fn(val);                                 \
>>                                                                          \
>>          if ( !__builtin_constant_p(real) )                              \
>> -            asm ( ".error \"'" STR(fn(val)) "' not compile-time constant\"" ); \
>> +            BUILD_ERROR("'" STR(fn(val)) "' not compile-time constant"); \
>>          else if ( real != res )                                         \
>> -            asm ( ".error \"Compile time check '" STR(fn(val) == res) "' failed\"" ); \
>> +            BUILD_ERROR("Compile time check '" STR(fn(val) == res) "' failed"); \
>>      } while ( 0 )
> While right here leaving the condition outside of the macro is
> perhaps more natural, considering a case where there's just an if()
> I wonder whether we shouldn't also (only?) have BUILD_ERROR_ON(),
> better paralleling BUILD_BUG_ON():

Right now none of the uses in this series, nor any of the MISRA
conversions away __bad_*() want an _ON() form.

Nothing stops us adding an _ON() form in the future if a reasonable
usecase appears, but right now there's no need.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 19:46:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 19:46:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782657.1192174 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shaEv-0007X4-5g; Fri, 23 Aug 2024 19:46:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782657.1192174; Fri, 23 Aug 2024 19:46:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shaEv-0007Wx-2j; Fri, 23 Aug 2024 19:46:29 +0000
Received: by outflank-mailman (input) for mailman id 782657;
 Fri, 23 Aug 2024 19:46:27 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shaEt-0007Ul-MX
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 19:46:27 +0000
Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com
 [2607:f8b0:4864:20::329])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 613e3b6b-6188-11ef-8776-851b0ebba9a2;
 Fri, 23 Aug 2024 21:46:25 +0200 (CEST)
Received: by mail-ot1-x329.google.com with SMTP id
 46e09a7af769-709340f1cb1so1448882a34.3
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 12:46:25 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 d75a77b69052e-454fdfc5968sm20387171cf.15.2024.08.23.12.46.22
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 23 Aug 2024 12:46:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 613e3b6b-6188-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724442384; x=1725047184; 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=63GxUiLX1+R40sAfn9XZYAikQyhhVfqQ+eA6iCCse3c=;
        b=UgKawMLnYtocwpGKTS2fHtlxsyXsQqfIW1GZidk3S7QUYXFzL2vtI4kjN1OSSeNsaF
         Gvs+i+TDcIKKmOoTS+vlvq6fYwyub7sSKgSvqBm50mMNBrS2SxQo402lUFbi05j5JmfH
         TPMawF4/QMpDIVMpmZedH8ayc9XAHt2BG1TCQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724442384; x=1725047184;
        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=63GxUiLX1+R40sAfn9XZYAikQyhhVfqQ+eA6iCCse3c=;
        b=uG0LDaST0cvBqDz20Q5E5+f+HiktjEGNkxpFjWBIiiPPkTVIxn2fmr0zu1k0b4d9+C
         FpZY+KrNPv+8q+mTmwmnnLQPblYUMg4CmMS2HALMMd2RySd714ccU4kbmyWMJijAmk+o
         vXR2VuolshngywQFDLWzdjXAZx6E6wKh1PEFcbhgy9/rxijKvtV2LA9Dbuj3dZclGFyN
         kaPay73rZirfxPbjY6PPRx/dqpwv8wQFosgOAWvt/mNFFfcmxNEKF+XUypp/nmYpT41s
         S+ODhD5/qEebv5daECII/IaXrCGKyE1QrBJ7hIU80BDsDX0PMnUXa3KOPesoQ2t62+sJ
         sReg==
X-Forwarded-Encrypted: i=1; AJvYcCWvvRANNudXpkAZRdD3qj/ros9j/YFk5To7u8h6EwBuZdpO+IyPkZxOZ8PWPLzNI9rl6qjv4cgzTh0=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yxefg1sI9YptyHv9zqVDh5ZogmGyvHL6WYLatPMMYVZpGG0939y
	aGYTnpbjmNHB5P9TMrbYKkSc/P1aVJHQ3X2yD94qtL3ppyycAYwUDNqYJzShDRJ3GiGQgOtNwMu
	k
X-Google-Smtp-Source: AGHT+IGwlJANI9moQjG2VO1oBf3g0iVtEr4PE2iWFdm6mtxwuu9ekj6l8IiwjL+nXbqASNsHpcrrfw==
X-Received: by 2002:a05:6830:90a:b0:708:b40a:fecc with SMTP id 46e09a7af769-70e0eb04dbfmr3861446a34.1.1724442384022;
        Fri, 23 Aug 2024 12:46:24 -0700 (PDT)
Message-ID: <34b5a144-41b9-4bb9-8f28-e4447b6a77b5@citrix.com>
Date: Fri, 23 Aug 2024 20:46:20 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/6] xen/bitops: Introduce for_each_set_bit()
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240625190719.788643-1-andrew.cooper3@citrix.com>
 <20240625190719.788643-5-andrew.cooper3@citrix.com>
 <950da1fb-3df6-4962-b1fe-07e853507e37@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <950da1fb-3df6-4962-b1fe-07e853507e37@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 26/06/2024 11:17 am, Jan Beulich wrote:
> On 25.06.2024 21:07, Andrew Cooper wrote:
>> The prior version (renamed to bitmap_for_each()) was inefficeint when used
>> over a scalar, but this is the more common usage even before accounting for
>> the many opencoded forms.
>>
>> Introduce a new version which operates on scalars only and does so without
>> spilling them to memory.  This in turn requires the addition of a type-generic
>> form of ffs().
>>
>> Add testing for the new construct alongside the ffs/fls testing.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Thanks.

> with two remarks:
>
>> The naming of ffs_g() is taken from the new compiler builtins which are using
>> a g suffix to mean type-generic.
> As you say, a g suffix, not a _g one; gcc14 documents __builtin_ffsg().
> (Seeing it exists I wonder whether we wouldn't want to use it when
> available, and only fall back to the macro for older versions.) Any
> specific reason you use _g?

Legibility.  It's bad enough with the l() and ll() forms (which get
worse with the hweight() series, and I can't find a nice option).

The other option I considered was have ffs() be the generic one, and
have ffsi() for the int variant, but now we're in active contradiction
with the builtin scheme, rather than merely opting not to use it.

I don't expect this to get much use in practice.  Use of this in regular
code mixing ints and longs is almost certainly a bug on behalf of the
programmer.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 21:44:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 21:44:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782688.1192203 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shc5B-0003wk-Jd; Fri, 23 Aug 2024 21:44:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782688.1192203; Fri, 23 Aug 2024 21:44:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shc5B-0003wd-Gv; Fri, 23 Aug 2024 21:44:33 +0000
Received: by outflank-mailman (input) for mailman id 782688;
 Fri, 23 Aug 2024 21:44:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=vzBQ=PW=invisiblethingslab.com=marmarek@srs-se1.protection.inumbo.net>)
 id 1shc5A-0003wX-7J
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 21:44:32 +0000
Received: from fout7-smtp.messagingengine.com (fout7-smtp.messagingengine.com
 [103.168.172.150]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e00591e3-6198-11ef-a50a-bb4a2ccca743;
 Fri, 23 Aug 2024 23:44:30 +0200 (CEST)
Received: from phl-compute-05.internal (phl-compute-05.nyi.internal
 [10.202.2.45])
 by mailfout.nyi.internal (Postfix) with ESMTP id EE32313904D2;
 Fri, 23 Aug 2024 17:44:28 -0400 (EDT)
Received: from phl-mailfrontend-01 ([10.202.2.162])
 by phl-compute-05.internal (MEProxy); Fri, 23 Aug 2024 17:44:28 -0400
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri,
 23 Aug 2024 17:44:27 -0400 (EDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e00591e3-6198-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	invisiblethingslab.com; h=cc:cc:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:subject:subject:to:to; s=fm3; t=1724449468;
	 x=1724535868; bh=5MvIkWacA+5RskFt1p7wzNLDOka+r7Vl5YB6xvScNKU=; b=
	eV1yqT4yRtfBsTfZxaYa3+/vAC/9yhx6xfafY+JrGyEDaQRR6XXiQn77A5tEopvA
	ygJVdDIfC+lF4HP+Ch/l5KIGqbEnr+ZNpG13TfccnTzgCedgp4p93yGlYeHQtw7O
	Mk9hEf+0HbeKNrAHI68dLyu963CSlki1DHLjQ2PXKytKH1MUYImUGMZFcDgiolgR
	FbDyIcecnlJ7OSgsY2KwKedBsR41YSxcZHeEjOuNp8IgFDBmTP1CFcFI0ch7hqa1
	pV/Ie0grtP1DOdi6s/CR+jG4mtAkSgKV/o3WUghGBgwFP5KuWIC8vJVZ2oMeEUo5
	OLbEUlCQpG+P+rDSGeZRVw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-type:content-type:date:date
	:feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
	:message-id:mime-version:references:reply-to:subject:subject:to
	:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
	fm1; t=1724449468; x=1724535868; bh=5MvIkWacA+5RskFt1p7wzNLDOka+
	r7Vl5YB6xvScNKU=; b=GDZQlxhZ+W05sBtdiv979n/Yd5FGpuCHKzRmT4rMjpJC
	P1f6+4eYWfm0CqP+ZRTO3z3Dpbt6o6JOG0MAQSi6YSYp1pSC4gLzSYUAN35vpVQx
	fbBs6txL/+Zn3acZPNWzSmBsd/tOZEiiGVohVQhzGeqBPy9/eQm59FpQ/cW1IVlo
	IlV56IIjYu0B0URWE0spFd4Ps7wh54ersAelS1ByZBNTcTE0ZHpMWFUJc5WvKcg1
	b5aHXOowaP2S2q4unR9n+tsUzCGpg+GJ5qw/nWjbysGKYUqpiEuuyn7fdK0Z1FFR
	NWfoHKocHcF6qdsffJr7zuCCtPO8gcYpsJDOT9H7mA==
X-ME-Sender: <xms:vALJZjbyXt0inHKNvfIju6FE1VwedxlqvXVNv4MDHUQtcP_2bHWf7g>
    <xme:vALJZibBx_TQ8LcZPpflFnm5GOlg6goGNnp_Xj1vf8-DlYRJJzwu7_kUgu8J96T7z
    MzR3vOOjFcyVg>
X-ME-Received: <xmr:vALJZl-5_aqJ-O6URMfUrnOWTMMKnx-SSvefKTyAXwkrmyeYEU2ntzgI5m3zX0bhyCqJlWrxpRCNYVB6Ac716kDFOzMkeyVhSw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddvfedgtdduucetufdoteggodetrfdotf
    fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu
    rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh
    htshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtjeen
    ucfhrhhomhepofgrrhgvkhcuofgrrhgtiiihkhhofihskhhiqdfikphrvggtkhhiuceomh
    grrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomheqnecuggft
    rfgrthhtvghrnhepieeluddvkeejueekhfffteegfeeiffefjeejvdeijedvgfejheetud
    dvkeffudeinecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhi
    iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhesihhnvhhish
    hisghlvghthhhinhhgshhlrggsrdgtohhmpdhnsggprhgtphhtthhopeejpdhmohguvgep
    shhmthhpohhuthdprhgtphhtthhopehjsggvuhhlihgthhesshhushgvrdgtohhmpdhrtg
    hpthhtohepmhhilhgrnhgujhhokhhitgduleelheesghhmrghilhdrtghomhdprhgtphht
    thhopeholhgvkhhsihhirdhkuhhrohgthhhkohesghhmrghilhdrtghomhdprhgtphhtth
    hopehnihhkohhlrgdrjhgvlhhitgesrhhtqdhrkhdrtghomhdprhgtphhtthhopeguphhs
    mhhithhhsegrphgvrhhtuhhsshholhhuthhiohhnshdrtghomhdprhgtphhtthhopehmih
    hlrghnrdgujhhokhhitgesrhhtqdhrkhdrtghomhdprhgtphhtthhopeigvghnqdguvghv
    vghlsehlihhsthhsrdigvghnphhrohhjvggtthdrohhrgh
X-ME-Proxy: <xmx:vALJZpqzCk34Otlbcv5BhhNn1vt4dMMJS-HV3iIQMbmaJDHnoYytAg>
    <xmx:vALJZuqYJsVsN7xkUGjMMbQsOqC7hi6kR3ZSs6mQYW9TWp_EAlS97Q>
    <xmx:vALJZvTzbwMQUlb4sywEPTNvNA8221ZqtHDxlPUKdEiYeOapDaiWQw>
    <xmx:vALJZmqoZftSNVgFGfozHhG9GR-J8UjKvbAVhNrOS8umDtN4og0VfA>
    <xmx:vALJZvdQ5Z7S0K40PNkz2yYFHxXaYHJAOXfBAO_AiTEloBEd_nRaxv1a>
Feedback-ID: i1568416f:Fastmail
Date: Fri, 23 Aug 2024 23:44:24 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Milan Djokic <milandjokic1995@gmail.com>, oleksii.kurochko@gmail.com,
	Nikola Jelic <nikola.jelic@rt-rk.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	Milan Djokic <milan.djokic@rt-rk.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2] xen: PE/COFF image header
Message-ID: <ZskCubBvCcmd0jJZ@mail-itl>
References: <2b747d672eeadc1150d3b84f0303e1d288311133.1721391876.git.milan.djokic@rt-rk.com>
 <728bb10e944a7ec28a67c2e9e62910632eb2366b.1721758832.git.milandjokic1995@gmail.com>
 <1e898a3c-b881-4ca8-99f0-48f51ed28098@suse.com>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="n5lBKj+HjiXx2gJm"
Content-Disposition: inline
In-Reply-To: <1e898a3c-b881-4ca8-99f0-48f51ed28098@suse.com>


--n5lBKj+HjiXx2gJm
Content-Type: text/plain; protected-headers=v1; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Date: Fri, 23 Aug 2024 23:44:24 +0200
From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Milan Djokic <milandjokic1995@gmail.com>, oleksii.kurochko@gmail.com,
	Nikola Jelic <nikola.jelic@rt-rk.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	Milan Djokic <milan.djokic@rt-rk.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2] xen: PE/COFF image header

On Mon, Jul 29, 2024 at 01:42:46PM +0200, Jan Beulich wrote:
> On 23.07.2024 20:22, Milan Djokic wrote:
> > From: Nikola Jelic <nikola.jelic@rt-rk.com>
> >=20
> > Added PE/COFF generic image header which shall be used for EFI
> > application format for x86/risc-v. x86 and risc-v source shall be adjus=
ted
> > to use this header in following commits. pe.h header is taken over from
> > linux kernel with minor changes in terms of formatting and structure me=
mber comments.
> > Also, COFF relocation and win cert structures are ommited, since these =
are not relevant for Xen.
> >=20
> > Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gi=
t 36e4fc57fc16
> >=20
> > Signed-off-by: Nikola Jelic <nikola.jelic@rt-rk.com>
> > Signed-off-by: Milan Djokic <milan.djokic@rt-rk.com>

Acked-by: Marek Marczykowski-G=C3=B3recki <marmarek@invisiblethingslab.com>

> This looks okay to me now, but I can't ack it (or more precisely my ack
> wouldn't mean anything). There are a few style issues in comments, but
> leaving them as they are in Linux may be intentional. Just one question,
> more to other maintainers than to you:
>=20
> > +#define IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE         0x0040
> > +#define IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY      0x0080
> > +#define IMAGE_DLL_CHARACTERISTICS_NX_COMPAT            0x0100
> > +#define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION          0x0200
> > +#define IMAGE_DLLCHARACTERISTICS_NO_SEH                0x0400
> > +#define IMAGE_DLLCHARACTERISTICS_NO_BIND               0x0800
> > +#define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER            0x2000
> > +#define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000
> > +
> > +#define IMAGE_DLLCHARACTERISTICS_EX_CET_COMPAT         0x0001
> > +#define IMAGE_DLLCHARACTERISTICS_EX_FORWARD_CFI_COMPAT 0x0040
>=20
> The naming inconsistency (underscore or not after DLL) is somewhat
> unhelpful. Do we maybe want to diverge from what Linux has here? Note
> that e.g. the GNU binutils header has at least a comment there.

Indeed it doesn't look great, but IMO leaving it consistent with Linux
is okay as it ease updating and porting/comparing other code if needed.

> What I'm puzzled by is IMAGE_DLLCHARACTERISTICS_EX_FORWARD_CFI_COMPAT
> having the same value as IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE. Are
> these meant to apply to the same field? Or do these values rather
> relate to IMAGE_DEBUG_TYPE_EX_DLLCHARACTERISTICS? Some clarification
> may be needed here, or the two entries may simply want omitting for
> now.

One has _EX_ infix and the other doesn't so IMO together with visual
separation it's clear they apply to a different field.

--=20
Best Regards,
Marek Marczykowski-G=C3=B3recki
Invisible Things Lab

--n5lBKj+HjiXx2gJm
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEhrpukzGPukRmQqkK24/THMrX1ywFAmbJArkACgkQ24/THMrX
1yzUXQf/Wv9l/+FUwSIiXl68ig1X6Lv3HnF9gQdSAwh+nYY68rhvxpSgk6LPonzY
OZjbc0trsOLb+4GVnnGZVux6oGAoFOG+Y/G7xqIh9T2zNO+A3TNFO2t3nvKQmaIg
OKHxgcQyVTgi2tVGY8HtOG3AM4KPs34lZw7smIioe5LkjrOY16GZ2UvLwy8GRjwi
nI4tzkdOv6TC5IvfuT05Z4GvUQ3M66bn1/rZnhTVCXdP8qu0XtE85N9Y0ATFrZCc
u19PL4+B3FsF1/KZliN6AOzOifsxSagXwXBKKFIYIfdQhelVW1FOCfNG6nSz0d1Z
VXRJ48gv73gwlNusPjXrcyso3Xjfyg==
=UyB7
-----END PGP SIGNATURE-----

--n5lBKj+HjiXx2gJm--


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 21:44:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 21:44:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782689.1192214 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shc5P-0004Dy-QY; Fri, 23 Aug 2024 21:44:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782689.1192214; Fri, 23 Aug 2024 21:44:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shc5P-0004Dq-NY; Fri, 23 Aug 2024 21:44:47 +0000
Received: by outflank-mailman (input) for mailman id 782689;
 Fri, 23 Aug 2024 21:44:46 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shc5O-0004D5-Dz; Fri, 23 Aug 2024 21:44:46 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shc5O-0000L3-0N; Fri, 23 Aug 2024 21:44:46 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shc5N-000470-Mi; Fri, 23 Aug 2024 21:44:45 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shc5N-0001FE-M2; Fri, 23 Aug 2024 21:44:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=O1huI7oq0SD3Fz4DSN05n/ISibDet3JW7a/aYOz74Sw=; b=QBYbcIV4ZCw0mp7R6Q8ifd0M/o
	gRe99mZ70BHWIejEQ9nYXueg1eUDBghJJfOLMYG21hniGF/XblEqVA6CXEgWNVIOxbxT3iTlAai3Z
	Q2rIs2EqQqZCwciGv0Ri/eQM4n07Gov/020VurEM+eujQA54a5HD4LoayXld2KwPR10M=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187328-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187328: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=1965e9a930740b37637ac450f4752fd53edf63c4
X-Osstest-Versions-That:
    xen=8ffcf184affbc2ff1860dabe1757388509d5ed67
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 23 Aug 2024 21:44:45 +0000

flight 187328 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187328/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  1965e9a930740b37637ac450f4752fd53edf63c4
baseline version:
 xen                  8ffcf184affbc2ff1860dabe1757388509d5ed67

Last test of basis   187325  2024-08-23 14:00:23 Z    0 days
Testing same since   187328  2024-08-23 18:00:23 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Christian Lindig <christian.lindig@cloud.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   8ffcf184af..1965e9a930  1965e9a930740b37637ac450f4752fd53edf63c4 -> smoke


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 22:19:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 22:19:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782713.1192224 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shccZ-0001z6-DO; Fri, 23 Aug 2024 22:19:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782713.1192224; Fri, 23 Aug 2024 22:19:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shccZ-0001yz-AF; Fri, 23 Aug 2024 22:19:03 +0000
Received: by outflank-mailman (input) for mailman id 782713;
 Fri, 23 Aug 2024 22:19:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shccX-0001yp-W2; Fri, 23 Aug 2024 22:19:02 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shccX-0000wP-Iw; Fri, 23 Aug 2024 22:19:01 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shccW-0005OS-Vv; Fri, 23 Aug 2024 22:19:01 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shccW-0004ox-VT; Fri, 23 Aug 2024 22:19:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=cpl8G2cZv+iRPioG2I7qs9eakACU/bKmW2ZTuB9EzAw=; b=rXpWe49YBszPcpuB7kQ2qTAWKo
	KUjSIonl+f3Hx0aTqJ/OppZbMA7oSN+mQR29eMDY6MX4e34+7DiZ7kygTW3uVmf2DYaCzvaYaoOGu
	Hrdp7VDILh+VqGZ3Io8EV0+2VzAORl71afl2mVpcUcfgY5n31qqgB2RKa9quNpsgAiqE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187318-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187318: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=0888784f38704718592c88ad149c426f3943298c
X-Osstest-Versions-That:
    libvirt=bec195607c69c1ad12d607ab0dcb420fdd0b484c
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 23 Aug 2024 22:19:00 +0000

flight 187318 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187318/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187308
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 libvirt              0888784f38704718592c88ad149c426f3943298c
baseline version:
 libvirt              bec195607c69c1ad12d607ab0dcb420fdd0b484c

Last test of basis   187308  2024-08-22 04:20:45 Z    1 days
Testing same since   187318  2024-08-23 04:22:07 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Michal Privoznik <mprivozn@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   bec195607c..0888784f38  0888784f38704718592c88ad149c426f3943298c -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 23 22:29:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 22:29:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782727.1192234 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shcmm-00049K-Ho; Fri, 23 Aug 2024 22:29:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782727.1192234; Fri, 23 Aug 2024 22:29:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shcmm-00049D-Dd; Fri, 23 Aug 2024 22:29:36 +0000
Received: by outflank-mailman (input) for mailman id 782727;
 Fri, 23 Aug 2024 22:29:35 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Yg4r=PW=amd.com=VictorM.Lira@srs-se1.protection.inumbo.net>)
 id 1shcml-000497-Ef
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 22:29:35 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on20613.outbound.protection.outlook.com
 [2a01:111:f403:2412::613])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2a989c54-619f-11ef-8776-851b0ebba9a2;
 Sat, 24 Aug 2024 00:29:32 +0200 (CEST)
Received: from PH1PEPF000132FA.NAMP220.PROD.OUTLOOK.COM (2603:10b6:518:1::2b)
 by BY5PR12MB4276.namprd12.prod.outlook.com (2603:10b6:a03:20f::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.22; Fri, 23 Aug
 2024 22:29:25 +0000
Received: from CY4PEPF0000EE37.namprd05.prod.outlook.com
 (2a01:111:f403:f913::1) by PH1PEPF000132FA.outlook.office365.com
 (2603:1036:903:47::3) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.21 via Frontend
 Transport; Fri, 23 Aug 2024 22:29:24 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CY4PEPF0000EE37.mail.protection.outlook.com (10.167.242.43) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Fri, 23 Aug 2024 22:29:23 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 17:29:23 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 17:29:22 -0500
Received: from xsjwoods50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend
 Transport; Fri, 23 Aug 2024 17:29:22 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2a989c54-619f-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=w9ezWBk81ExZbDqIduBYpdmM5WPwwpi2abQ+4sBpXOwjp5jqloqhHuxZKdKF+XgaNXpFTFcfRJ65Q81OrUrxMwqSsLdv4pug5HM983PyFhelKJI9vKW1qqhO+WaCg7uvyRuYLathRyq653THsgNg0iKCS+kd9Qb3hViPZ9iDf2hl3i4kZg0ngayIrbOyYpOAUQ+93GPem+9PCHqGvoInr7UqOJoRHdzmW6U8x+CG3fRvHCtAUYH/NzWQl3IfdNavQ5fj4drfdkbXMdtd1VAoYdKO3oTqj3nfE++CLxj4gmonWZW2cWW6KK8+JdFWSArdgyEF55vLsUGt9/nSw8u3Fg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=hHyfLdJ5rqccJpxu6iDb17bnVwujeMyggvhgUMvzF8c=;
 b=lq+6Vm0nM3aBx5qUdLR7Wbx9gxx1x5Ubi1kAEwuZhj+N8i8yjCwUNxRieNx4brq20sOMPFlb5JjwPLT6MmsUgNThT/QC0qQsHy591a5tEeU+T1+/zyipu3Y1meQl485tbBSRxd3mePgnEjZLwLjdmWopVqgYGtXEMEESyLo0a8r/VFayBwBeIXap59asp0GOCDh8qMrpxBAyxiqzXtSzKmlTkOmC07WinRks/3WNN1a9UDj55sCoK++9bbgxSroMkJfZMOZJLjUbkOU081PlWFf3bhNUBPxrjdKMF5GjweyDALSPom0CtaKWYaeMfKDw0Wc9z8NtIw3VQe6EcHObvA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=hHyfLdJ5rqccJpxu6iDb17bnVwujeMyggvhgUMvzF8c=;
 b=SKE66CpCd8FSUZI7I14VFIGFWC90CF2Lo8TIFb3wrik9veeEG9EPjSI0nznRBBfBqiLm1m6t1p58Yb09M4cUGDnmR5ZMk7M3uPb8FUybBcft1pgtktfkCl+hoTwkEbcTednX/koQ8RZ/A04KLeobUNSHlCR/2+Q2KoGvgHLIQwI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: <victorm.lira@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Victor Lira <victorm.lira@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>
Subject: [XEN][PATCH v2] automation: update xilinx test scripts (tty)
Date: Fri, 23 Aug 2024 15:29:04 -0700
Message-ID: <8cf7c010d8412d23d2e1da272f1103477d751037.1724451299.git.victorm.lira@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: victorm.lira@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE37:EE_|BY5PR12MB4276:EE_
X-MS-Office365-Filtering-Correlation-Id: ee8b1008-c2a1-4444-a65f-08dcc3c30a3b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?eSdJpBi3/IfU0hnauM+1xKLXidhrDgnFUuuXXkF/Q61jEEUIbVzJ8Yf9sJhJ?=
 =?us-ascii?Q?S26Pl7Sf18E0t32g79x/zGFgpBX/AfwFO/ZAuVSykl2Um6pbf/ToiNr2/phK?=
 =?us-ascii?Q?2GVVoVG6FydrTR6Qs6ZSZHlWFFBkolprR4lSoJAi7lmj/vP4KFdPA1ytUIeP?=
 =?us-ascii?Q?Br6vg38fSlZRgUxq1OrzY4vki7LYHVGePW3LAIlEAdhael2Z9CuyipBrug0y?=
 =?us-ascii?Q?8GAl6NlCP6xJuXQwTbQil4ziUA2RmqrFrRjsr7TgfQSAcVhsmRdWOQn1Cz1x?=
 =?us-ascii?Q?WCpBQR63caUT4ouw4bBVmPRNlFtL220a/HNm4MB8mi17q+RDro+urGKWCqhR?=
 =?us-ascii?Q?Yf1Jfxv/Nptr92xfqc2uVNu0Ks9ZxFK+PWQsBHsLScjqmw+oGqteiRiFTWsN?=
 =?us-ascii?Q?g8lE/wX8Eh6LBnTKvkAQExjO235ityPJ8QICS+QA1IqPbOFsFYkIH5e7Z3sy?=
 =?us-ascii?Q?DeOEqh1atL8feABMFWqhwaAT1tD1qy8R9ssl/abLV5a9m/wZ+t+z8ZwADMZJ?=
 =?us-ascii?Q?TWNqrC2l2Bu9jL9dP6NkJAMA9LyXJWmwn5arud42/f+QzfT5lYF1OX/gsFUt?=
 =?us-ascii?Q?1XTgCfv6cIuWX8ICIdb0Wiy6Malp60Haf7jBTWaIJ2DqhP1Q0OzwZmvSefIB?=
 =?us-ascii?Q?UJkedkqRoSaqSEajJmVpXlwNZeroufX6K4DsJu2A2jtTF3WjdN5HjkXbeN/R?=
 =?us-ascii?Q?y6K/4gZ7Vku2MwUwFjT1t6sn+Ycwm+8dVpqaF9OxQkL7I8mtKtIdsAIvUPTD?=
 =?us-ascii?Q?hDN4hf5jDWAOpjYqiUu29Dq4TvsCC6dynG4ckTtpwp0J5Jy8I+n5O4jpGzIm?=
 =?us-ascii?Q?LZqMh3939EEg94CQ5o7E6kjUInlOu+efGQ2kl3WauDTPQPQGxwiMwwW+PIDo?=
 =?us-ascii?Q?DML+2n4DQiSZ71SQZIzKuhV8Y+0zYu+z7Fw5znatB4R6FN88zdIkcgI5EQ6g?=
 =?us-ascii?Q?czvrye0LjN/PDBkvrH94iJAZAr1FvBPwo0o6wiC17CvgCOZ090i2Rb1KX9NF?=
 =?us-ascii?Q?D1tykw2Yws1Cq+bdhCNwx3cfsnViNdQCE7dW1ugvjdmarTT6OGCKDZ/9Q6Fq?=
 =?us-ascii?Q?PStptImmGg5SKMT49g5FnmX3kBay9h4vHOfjDCaISA/G5rYQZZIEK1j+j3qT?=
 =?us-ascii?Q?bzk5L+uZOFTtP+sliAuYiAK5VAb6aoKRPjFhmv8wjQ/tt+D7BcG4sew0lxq6?=
 =?us-ascii?Q?7tuiBV6vSn1sCi23sJIhYUN3NVr6+HUl2hEAnXLHoq4eoaVb5IiVdBabyGkX?=
 =?us-ascii?Q?6Y3twrlVGzZtzyeSh4o8aiZuKFPkNv/YTZHxLJoKD89a30TIWV9v8/rVEc9U?=
 =?us-ascii?Q?cA3dP0e4yyf6unKkl29uoPbHiVfJkaigQ+X3kxywQXPwJBgqYX5BG2M5/mFo?=
 =?us-ascii?Q?fgO3HHg9X016dXWIEIVIOEwBjLGumO3tu3XwBzpqWXFgB2SixcuwTY6PdkKG?=
 =?us-ascii?Q?yE4ZLoWJfCBX/BdkE90jHSrl+P5SEVEb?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 22:29:23.6238
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: ee8b1008-c2a1-4444-a65f-08dcc3c30a3b
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000EE37.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4276

From: Victor Lira <victorm.lira@amd.com>

Update serial device names from ttyUSB* to test board specific names.

Update xilinx-smoke-dom0-x86_64 with new Xen command line console options,
which are now set as Gitlab CI/CD variables. Abstract the directory where
binaries are stored. Increase the timeout to match new setup.

Signed-off-by: Victor Lira <victorm.lira@amd.com>
---
Cc: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/test.yaml                |  2 ++
 .../scripts/xilinx-smoke-dom0-x86_64.sh       | 28 +++++++++----------
 .../scripts/xilinx-smoke-dom0less-arm64.sh    |  5 ++--
 3 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 4e74946419..3b339f387f 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -101,6 +101,8 @@
   variables:
     CONTAINER: ubuntu:xenial-xilinx
     LOGFILE: xilinx-smoke-x86_64.log
+    XEN_CMD_CONSOLE: "console=com2 com2=115200,8n1,0x2F8,4"
+    TEST_BOARD: "crater"
   artifacts:
     paths:
       - smoke.serial
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index e6e6fac6a5..4559e2b9ee 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -12,7 +12,6 @@ fatal() {
 # Test parameter defaults.
 TEST="$1"
 PASS_MSG="Test passed: ${TEST}"
-XEN_CMD_CONSOLE="console=com1 com1=115200,8n1,0x3F8,4"
 XEN_CMD_DOM0="dom0=pvh dom0_max_vcpus=4 dom0_mem=4G"
 XEN_CMD_XEN="sched=null loglvl=all guest_loglvl=all console_timestamps=boot"
 XEN_CMD_EXTRA=""
@@ -28,7 +27,7 @@ memory = 512
 vif = [ "bridge=xenbr0", ]
 disk = [ ]
 '
-TIMEOUT_SECONDS=120
+TIMEOUT_SECONDS=200

 # Select test variant.
 if [ "${TEST}" = "ping" ]; then
@@ -113,27 +112,28 @@ cd ..
 # Load software into TFTP server directory.
 TFTP="/scratch/gitlab-runner/tftp"
 XEN_CMDLINE="${XEN_CMD_CONSOLE} ${XEN_CMD_XEN} ${XEN_CMD_DOM0} ${XEN_CMD_EXTRA}"
-cp -f binaries/xen ${TFTP}/pxelinux.cfg/xen
-cp -f binaries/bzImage ${TFTP}/pxelinux.cfg/vmlinuz
-cp -f binaries/dom0-rootfs.cpio.gz ${TFTP}/pxelinux.cfg/initrd-dom0
+cp -f binaries/xen ${TFTP}/${TEST_BOARD}/xen
+cp -f binaries/bzImage ${TFTP}/${TEST_BOARD}/vmlinuz
+cp -f binaries/dom0-rootfs.cpio.gz ${TFTP}/${TEST_BOARD}/initrd-dom0
 echo "
 net_default_server=10.0.6.1
-multiboot2 (tftp)/pxelinux.cfg/xen ${XEN_CMDLINE}
-module2 (tftp)/pxelinux.cfg/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
-module2 (tftp)/pxelinux.cfg/initrd-dom0
+multiboot2 (tftp)/${TEST_BOARD}/xen ${XEN_CMDLINE}
+module2 (tftp)/${TEST_BOARD}/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
+module2 (tftp)/${TEST_BOARD}/initrd-dom0
 boot
-" > ${TFTP}/pxelinux.cfg/grub.cfg
+" > ${TFTP}/${TEST_BOARD}/grub.cfg

 # Power cycle board and collect serial port output.
-SERIAL_CMD="cat /dev/ttyUSB9 | tee smoke.serial | sed 's/\r//'"
-sh /scratch/gitlab-runner/v2000a.sh 2
+SERIAL_DEV="/dev/serial/${TEST_BOARD}"
+SERIAL_CMD="cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"
+sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
 sleep 5
-sh /scratch/gitlab-runner/v2000a.sh 1
+sh /scratch/gitlab-runner/${TEST_BOARD}.sh 1
 sleep 5
 set +e
-stty -F /dev/ttyUSB9 115200
+stty -F ${SERIAL_DEV} 115200
 timeout -k 1 ${TIMEOUT_SECONDS} nohup sh -c "${SERIAL_CMD}"
-sh /scratch/gitlab-runner/v2000a.sh 2
+sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2

 set -e

diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index 666411d6a0..18aa07f0a2 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -134,9 +134,10 @@ sleep 5
 cd $START

 # connect to serial
+SERIAL_DEV="/dev/serial/zynq"
 set +e
-stty -F /dev/ttyUSB0 115200
-timeout -k 1 120 nohup sh -c "cat /dev/ttyUSB0 | tee smoke.serial | sed 's/\r//'"
+stty -F ${SERIAL_DEV} 115200
+timeout -k 1 120 nohup sh -c "cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"

 # stop the board
 cd /scratch/gitlab-runner
--
2.37.6



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 23:01:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 23:01:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782737.1192243 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shdH2-0001sC-PK; Fri, 23 Aug 2024 23:00:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782737.1192243; Fri, 23 Aug 2024 23:00:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shdH2-0001s5-Mm; Fri, 23 Aug 2024 23:00:52 +0000
Received: by outflank-mailman (input) for mailman id 782737;
 Fri, 23 Aug 2024 23:00:51 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shdH1-0001rz-Te
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 23:00:51 +0000
Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com
 [2a00:1450:4864:20::52b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 89f1d7a1-61a3-11ef-8776-851b0ebba9a2;
 Sat, 24 Aug 2024 01:00:49 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5bf009cf4c0so2816532a12.1
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 16:00:49 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a4c72a7sm2600603a12.65.2024.08.23.16.00.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 23 Aug 2024 16:00:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 89f1d7a1-61a3-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724454048; x=1725058848; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=fda7N1Br5ezyCfM5MwoAp8juHmekzl5QKklpSKyKJu8=;
        b=ERlfBL7Mdr8myHspr8rOTPDoR6QKsBomeT3t5EiqOKV4+Brvx9WbflHWMPxWzB/3nS
         WVgV3ZosWejLmHh5zpD4pIug/Dlg3XJdyM2XZnjLnFIENMEh+EAHGKimzYUldktjaaGx
         9gXWXUKpgW5k7ykJF+MfdMxwkKrddblhtgCyY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724454048; x=1725058848;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=fda7N1Br5ezyCfM5MwoAp8juHmekzl5QKklpSKyKJu8=;
        b=qqYBGqeAWAIJQx7ATDV+D3YPTA53zsY1GmJ0C/3pCGEfUtHRCMi1dxPCjqvM/qtg3i
         pieGLTtCM2zhDDNL14pHmEJFRSikkB1yiD8EVw8SvRc1XPRSm5GU5b0b+CftwunC/d4H
         GZzvavBi2aQOPbT+uCwF2uRf2sChhN2QnDiqYiMOap+yJar2/uWCRXP8XbZBZ/5on/Bt
         LxOJHak1fn+Vib/KK1hWo172Nfc/QJyRiXLdcAKjZEVxDQvFvZoVqhZjaeGh7JKepzi6
         i3xq4X8VSqMChhjTWvKAzzwGPYOGBSV9nlHTJD2mhyUzEhuJG2LtzjjITeVjoaygx1S9
         A/qw==
X-Gm-Message-State: AOJu0YxeQExVvLT8F/iO7LepMZpwkEr541Y1/0IgIixPs4w3Tjhg8voO
	DcS3LwnWLNJRFwjzZrV89Y5G1SDg7R3tSv/BlCLV2Uw/b+6QAljpphBiYump8zYU3sFNQHjYodn
	9
X-Google-Smtp-Source: AGHT+IGCSjlVk2CgMvpJzo+u8GqW5WGhLP6XBUjxEWiqvo/qWerGMfxCeKRGtNIKX4FpsIUHgAUx8w==
X-Received: by 2002:a05:6402:2115:b0:5be:de37:80dc with SMTP id 4fb4d7f45d1cf-5c0891ac3b1mr2199484a12.37.1724454048154;
        Fri, 23 Aug 2024 16:00:48 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>
Subject: [PATCH] ARM/vgic: Use for_each_set_bit() in vgic_check_inflight_irqs_pending()
Date: Sat, 24 Aug 2024 00:00:45 +0100
Message-Id: <20240823230045.1581050-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

... which is better optimised for scalar values, rather than using the
arbitrary-sized bitmap helpers.

Additionally, unlike other vgic helpers, this takes both a domain and vcpu
pointer.  The domain parameter isn't used, and the callers pass v->domain.

Strip out the domain pointer.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/include/asm/vgic.h | 2 +-
 xen/arch/arm/vgic-v2.c          | 2 +-
 xen/arch/arm/vgic-v3.c          | 2 +-
 xen/arch/arm/vgic.c             | 8 ++------
 4 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/include/asm/vgic.h b/xen/arch/arm/include/asm/vgic.h
index 79b73a0dbb58..e309dca1ad01 100644
--- a/xen/arch/arm/include/asm/vgic.h
+++ b/xen/arch/arm/include/asm/vgic.h
@@ -315,7 +315,7 @@ extern bool vgic_to_sgi(struct vcpu *v, register_t sgir,
                         enum gic_sgi_mode irqmode, int virq,
                         const struct sgi_target *target);
 extern bool vgic_migrate_irq(struct vcpu *old, struct vcpu *new, unsigned int irq);
-extern void vgic_check_inflight_irqs_pending(struct domain *d, struct vcpu *v,
+extern void vgic_check_inflight_irqs_pending(struct vcpu *v,
                                              unsigned int rank, uint32_t r);
 
 #endif /* !CONFIG_NEW_VGIC */
diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index 0aa10fff0f10..a19d61017861 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -483,7 +483,7 @@ static int vgic_v2_distr_mmio_write(struct vcpu *v, mmio_info_t *info,
         rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICPENDR, DABT_WORD);
         if ( rank == NULL ) goto write_ignore;
 
-        vgic_check_inflight_irqs_pending(v->domain, v, rank->index, r);
+        vgic_check_inflight_irqs_pending(v, rank->index, r);
 
         goto write_ignore;
 
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index cc3832770181..2eaa48fadbb0 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -820,7 +820,7 @@ static int __vgic_v3_distr_common_mmio_write(const char *name, struct vcpu *v,
         rank = vgic_rank_offset(v, 1, reg - GICD_ICPENDR, DABT_WORD);
         if ( rank == NULL ) goto write_ignore;
 
-        vgic_check_inflight_irqs_pending(v->domain, v, rank->index, r);
+        vgic_check_inflight_irqs_pending(v, rank->index, r);
 
         goto write_ignore;
 
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 905e5eeb66d4..7b54ccc7cbfa 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -720,13 +720,9 @@ unsigned int vgic_max_vcpus(unsigned int domctl_vgic_version)
     }
 }
 
-void vgic_check_inflight_irqs_pending(struct domain *d, struct vcpu *v,
-                                      unsigned int rank, uint32_t r)
+void vgic_check_inflight_irqs_pending(struct vcpu *v, unsigned int rank, uint32_t r)
 {
-    const unsigned long mask = r;
-    unsigned int i;
-
-    bitmap_for_each ( i, &mask, 32 )
+    for_each_set_bit ( i, r )
     {
         struct pending_irq *p;
         struct vcpu *v_target;
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 23 23:01:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Aug 2024 23:01:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782738.1192253 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shdHJ-0002AY-0L; Fri, 23 Aug 2024 23:01:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782738.1192253; Fri, 23 Aug 2024 23:01:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shdHI-0002AR-U8; Fri, 23 Aug 2024 23:01:08 +0000
Received: by outflank-mailman (input) for mailman id 782738;
 Fri, 23 Aug 2024 23:01: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=imIp=PW=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1shdHI-0001rz-5B
 for xen-devel@lists.xenproject.org; Fri, 23 Aug 2024 23:01:08 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 94189d40-61a3-11ef-8776-851b0ebba9a2;
 Sat, 24 Aug 2024 01:01:06 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-5bf0261f162so3219718a12.0
 for <xen-devel@lists.xenproject.org>; Fri, 23 Aug 2024 16:01:06 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a3ed39fsm2619258a12.57.2024.08.23.16.01.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 23 Aug 2024 16:01:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 94189d40-61a3-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724454065; x=1725058865; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=zF8pjt0XDyvgbiqMd5EfMePZ7QzQjeJHHv0zF/e7/x8=;
        b=MqBDW0/B4wR3ADIjwQ2TjC2NDLDy8CHiuSvFfND/ePLS7FaezWDRzr7bcy7wZzs699
         /fjdbAvUvbmGkQzG4ruNqqduphY36zzJPqRuGtHikotQxUqSd758bmwLnqdm4i7Qfrxn
         pktqRW/C81ASSooi7dqsHo82pdUrFYH+4vgWk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724454065; x=1725058865;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=zF8pjt0XDyvgbiqMd5EfMePZ7QzQjeJHHv0zF/e7/x8=;
        b=N+iEC50JoQmIpJXyj7zPtlTLyxhgGnzbgYdpqpZXecvsfInFEWfYRLIGA7sN+4mDv1
         C4MkX2VJ9SctekK6zbBA3/4r7NOW/V+u4S5NdAp/mn+bC20s0aXkHAOuG7CYZU6lm3pC
         vmEAPgaWljABVlTqUyH94nMoJ9JAP8i5MdQQT+TYNdpQy/3ZA3NJ2RGC83tOZ7PTqGeL
         kCMukjqlZUbf91+O6+bxwPS0sarVN3gPD910qV/8HxEi3VfcP7TZFJwwA6syH1Q7KH11
         yFQeUqvTDubjJYxBmBUID1qnDxwp03UTIvOlmClIgvdo6NTtbgD1lmXmntyRP02PSm8r
         XB8Q==
X-Gm-Message-State: AOJu0YyygRZmYw8fNvXjNklPSVex6PGXC4QZitTtyfu+qbgEh8WojTfa
	Qypk1JCQpyQOFU0QVatlzKjsSZh7ws4Gb7T+GnIf1DM/UEMKHZp7ytxj8m0Oi/HsPhAAfekYEjz
	p
X-Google-Smtp-Source: AGHT+IH2JdWSF1S4Wcp3axdJeQAz99ay+Ym31Wz/fI9epA6oB/3l14OL97aAyOaoM3sQM2+yPfGtvw==
X-Received: by 2002:a05:6402:4404:b0:5c0:9814:3f94 with SMTP id 4fb4d7f45d1cf-5c098144075mr133295a12.21.1724454065157;
        Fri, 23 Aug 2024 16:01:05 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Jan Beulich <JBeulich@suse.com>
Subject: [PATCH] ARM/vgic: Use for_each_set_bit() in vgic_to_sgi()
Date: Sat, 24 Aug 2024 00:01:00 +0100
Message-Id: <20240823230100.1581448-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The existing expression is just a very complicated way of expressing a loop
over all bits of target->list.  Simplify the expression.

While here, fix the two gprintk()'s.  Because of a quotes vs line continuation
issue, there's a long string of spaces in the middle of the format string.

  $ strings xen-syms-arm32 | grep -e VGIC -e GICD_SGIR
  <G><1>%pv VGIC: write r=%08x                         target->list=%hx, wrong CPUTargetList
  <G><1>%pv vGICD:unhandled GICD_SGIR write %08x                  with wrong mode

not to mention trailing whitespace too.

Rewrite them to be more consise and more useful.  Use 0x prefixes for hex,
rather than ambigous, and identify the problem target vCPU / mode, rather than
simply saying somethign was wrong.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Jan Beulich <JBeulich@suse.com>

In a fun twist, we can't use target->list directly in the expresion, because
the typeof() picks up constness from the pointer, and we get:

  In file included from arch/arm/vgic.c:11:
  arch/arm/vgic.c: In function ‘vgic_to_sgi’:
  ./include/xen/bitops.h:305:19: error: assignment of read-only variable ‘__v’
    305 |               __v &= __v - 1 )
        |                   ^~
  arch/arm/vgic.c:483:9: note: in expansion of macro ‘for_each_set_bit’
    483 |         for_each_set_bit ( i, target->list )
        |         ^~~~~~~~~~~~~~~~

Sadly we need -std=c23 before we can use typeof_unqual() which is what we
actually want here.
---
 xen/arch/arm/vgic.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 7b54ccc7cbfa..081cbb67fb52 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -470,8 +470,7 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
     struct domain *d = v->domain;
     int vcpuid;
     int i;
-    unsigned int base;
-    unsigned long int bitmap;
+    unsigned int base, bitmap;
 
     ASSERT( virq < 16 );
 
@@ -481,15 +480,16 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
         perfc_incr(vgic_sgi_list);
         base = target->aff1 << 4;
         bitmap = target->list;
-        bitmap_for_each ( i, &bitmap, sizeof(target->list) * 8 )
+
+        for_each_set_bit ( i, bitmap )
         {
             vcpuid = base + i;
             if ( vcpuid >= d->max_vcpus || d->vcpu[vcpuid] == NULL ||
                  !is_vcpu_online(d->vcpu[vcpuid]) )
             {
-                gprintk(XENLOG_WARNING, "VGIC: write r=%"PRIregister" \
-                        target->list=%hx, wrong CPUTargetList \n",
-                        sgir, target->list);
+                gprintk(XENLOG_WARNING,
+                        "vGIC: write %#"PRIregister", target->list=%#x, bad target v%d\n",
+                        sgir, target->list, vcpuid);
                 continue;
             }
             vgic_inject_irq(d, d->vcpu[vcpuid], virq, true);
@@ -510,8 +510,8 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
         break;
     default:
         gprintk(XENLOG_WARNING,
-                "vGICD:unhandled GICD_SGIR write %"PRIregister" \
-                 with wrong mode\n", sgir);
+                "vGICD: GICD_SGIR write %#"PRIregister" with unhangled mode %d\n",
+                sgir, irqmode);
         return false;
     }
 
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Sat Aug 24 00:51:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Aug 2024 00:51:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782767.1192264 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shezW-0004hc-L1; Sat, 24 Aug 2024 00:50:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782767.1192264; Sat, 24 Aug 2024 00:50:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shezW-0004hV-IB; Sat, 24 Aug 2024 00:50:54 +0000
Received: by outflank-mailman (input) for mailman id 782767;
 Sat, 24 Aug 2024 00:50: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=mqP1=PX=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1shezV-0004hJ-OH
 for xen-devel@lists.xenproject.org; Sat, 24 Aug 2024 00:50:53 +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 e8403460-61b2-11ef-a50a-bb4a2ccca743;
 Sat, 24 Aug 2024 02:50:51 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 83204CE0B18;
 Sat, 24 Aug 2024 00:50:44 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 126FEC32786;
 Sat, 24 Aug 2024 00:50:42 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e8403460-61b2-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724460643;
	bh=1GkRtyDN8bM58kn6rGsQqQADyq1IuKyamDCBWcBZxAM=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=BX2PlZw4L4e89PnL3Zjks9BMDAETODFe+tEJ+n7ALd/Gw69kwNuv4aSlzk/tSuUQC
	 7/35Z8FB9l2D0eXt0LXUb0derMXKE9i6MYTazQkIEXOwBmHkP1QtNQujG1Rqo+cmyO
	 AYIaJ2UJ98AiB/0Uw43+EDWGUCLFMVAZqIckgDwO6TfHYb+/wQnYXyOvkJBX9EuehX
	 k5gs+AfRZNGlDCaEPSWLE5lQYUQNoGmaPc9L8qX1egKc3wMFXewq+EAtsq18kruRz5
	 PXEAn4kjrHwEssWMImwqWm+YCH1BfZLjQI6qT8Ez5UpJwWJqI/rjDRtNHDa5Y1Xdbk
	 wR5/ObZMbBq/w==
Date: Fri, 23 Aug 2024 17:50:41 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Victor Lira <victorm.lira@amd.com>
cc: xen-devel@lists.xenproject.org, 
    Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [XEN][PATCH v2] automation: update xilinx test scripts (tty)
In-Reply-To: <8cf7c010d8412d23d2e1da272f1103477d751037.1724451299.git.victorm.lira@amd.com>
Message-ID: <alpine.DEB.2.22.394.2408231750320.3871186@ubuntu-linux-20-04-desktop>
References: <8cf7c010d8412d23d2e1da272f1103477d751037.1724451299.git.victorm.lira@amd.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 23 Aug 2024, victorm.lira@amd.com wrote:
> From: Victor Lira <victorm.lira@amd.com>
> 
> Update serial device names from ttyUSB* to test board specific names.
> 
> Update xilinx-smoke-dom0-x86_64 with new Xen command line console options,
> which are now set as Gitlab CI/CD variables. Abstract the directory where
> binaries are stored. Increase the timeout to match new setup.
> 
> Signed-off-by: Victor Lira <victorm.lira@amd.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> ---
>  automation/gitlab-ci/test.yaml                |  2 ++
>  .../scripts/xilinx-smoke-dom0-x86_64.sh       | 28 +++++++++----------
>  .../scripts/xilinx-smoke-dom0less-arm64.sh    |  5 ++--
>  3 files changed, 19 insertions(+), 16 deletions(-)
> 
> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> index 4e74946419..3b339f387f 100644
> --- a/automation/gitlab-ci/test.yaml
> +++ b/automation/gitlab-ci/test.yaml
> @@ -101,6 +101,8 @@
>    variables:
>      CONTAINER: ubuntu:xenial-xilinx
>      LOGFILE: xilinx-smoke-x86_64.log
> +    XEN_CMD_CONSOLE: "console=com2 com2=115200,8n1,0x2F8,4"
> +    TEST_BOARD: "crater"
>    artifacts:
>      paths:
>        - smoke.serial
> diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
> index e6e6fac6a5..4559e2b9ee 100755
> --- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
> +++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
> @@ -12,7 +12,6 @@ fatal() {
>  # Test parameter defaults.
>  TEST="$1"
>  PASS_MSG="Test passed: ${TEST}"
> -XEN_CMD_CONSOLE="console=com1 com1=115200,8n1,0x3F8,4"
>  XEN_CMD_DOM0="dom0=pvh dom0_max_vcpus=4 dom0_mem=4G"
>  XEN_CMD_XEN="sched=null loglvl=all guest_loglvl=all console_timestamps=boot"
>  XEN_CMD_EXTRA=""
> @@ -28,7 +27,7 @@ memory = 512
>  vif = [ "bridge=xenbr0", ]
>  disk = [ ]
>  '
> -TIMEOUT_SECONDS=120
> +TIMEOUT_SECONDS=200
> 
>  # Select test variant.
>  if [ "${TEST}" = "ping" ]; then
> @@ -113,27 +112,28 @@ cd ..
>  # Load software into TFTP server directory.
>  TFTP="/scratch/gitlab-runner/tftp"
>  XEN_CMDLINE="${XEN_CMD_CONSOLE} ${XEN_CMD_XEN} ${XEN_CMD_DOM0} ${XEN_CMD_EXTRA}"
> -cp -f binaries/xen ${TFTP}/pxelinux.cfg/xen
> -cp -f binaries/bzImage ${TFTP}/pxelinux.cfg/vmlinuz
> -cp -f binaries/dom0-rootfs.cpio.gz ${TFTP}/pxelinux.cfg/initrd-dom0
> +cp -f binaries/xen ${TFTP}/${TEST_BOARD}/xen
> +cp -f binaries/bzImage ${TFTP}/${TEST_BOARD}/vmlinuz
> +cp -f binaries/dom0-rootfs.cpio.gz ${TFTP}/${TEST_BOARD}/initrd-dom0
>  echo "
>  net_default_server=10.0.6.1
> -multiboot2 (tftp)/pxelinux.cfg/xen ${XEN_CMDLINE}
> -module2 (tftp)/pxelinux.cfg/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
> -module2 (tftp)/pxelinux.cfg/initrd-dom0
> +multiboot2 (tftp)/${TEST_BOARD}/xen ${XEN_CMDLINE}
> +module2 (tftp)/${TEST_BOARD}/vmlinuz console=hvc0 root=/dev/ram0 earlyprintk=xen
> +module2 (tftp)/${TEST_BOARD}/initrd-dom0
>  boot
> -" > ${TFTP}/pxelinux.cfg/grub.cfg
> +" > ${TFTP}/${TEST_BOARD}/grub.cfg
> 
>  # Power cycle board and collect serial port output.
> -SERIAL_CMD="cat /dev/ttyUSB9 | tee smoke.serial | sed 's/\r//'"
> -sh /scratch/gitlab-runner/v2000a.sh 2
> +SERIAL_DEV="/dev/serial/${TEST_BOARD}"
> +SERIAL_CMD="cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"
> +sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
>  sleep 5
> -sh /scratch/gitlab-runner/v2000a.sh 1
> +sh /scratch/gitlab-runner/${TEST_BOARD}.sh 1
>  sleep 5
>  set +e
> -stty -F /dev/ttyUSB9 115200
> +stty -F ${SERIAL_DEV} 115200
>  timeout -k 1 ${TIMEOUT_SECONDS} nohup sh -c "${SERIAL_CMD}"
> -sh /scratch/gitlab-runner/v2000a.sh 2
> +sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
> 
>  set -e
> 
> diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
> index 666411d6a0..18aa07f0a2 100755
> --- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
> +++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
> @@ -134,9 +134,10 @@ sleep 5
>  cd $START
> 
>  # connect to serial
> +SERIAL_DEV="/dev/serial/zynq"
>  set +e
> -stty -F /dev/ttyUSB0 115200
> -timeout -k 1 120 nohup sh -c "cat /dev/ttyUSB0 | tee smoke.serial | sed 's/\r//'"
> +stty -F ${SERIAL_DEV} 115200
> +timeout -k 1 120 nohup sh -c "cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"
> 
>  # stop the board
>  cd /scratch/gitlab-runner
> --
> 2.37.6
> 


From xen-devel-bounces@lists.xenproject.org Sat Aug 24 02:05:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Aug 2024 02:05:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782783.1192278 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shg9a-0007jU-34; Sat, 24 Aug 2024 02:05:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782783.1192278; Sat, 24 Aug 2024 02:05:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shg9a-0007jN-0G; Sat, 24 Aug 2024 02:05:22 +0000
Received: by outflank-mailman (input) for mailman id 782783;
 Sat, 24 Aug 2024 02:05:20 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shg9Y-0007jD-H3; Sat, 24 Aug 2024 02:05:20 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shg9Y-0004qL-8Q; Sat, 24 Aug 2024 02:05:20 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shg9X-0003ET-LR; Sat, 24 Aug 2024 02:05:19 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shg9X-00086h-KX; Sat, 24 Aug 2024 02:05:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=2nDa0WZpB20M70pn5mem/J5z4jSF3IkPYa7jLkfRzCg=; b=QgmfWTO62PxbtfaqWklWlUELsr
	SVa35F9rTaOxyuc0Q0gKffOEFBhJHdh1D2A4xGpf/g5HPM4fO2GOFfk1yFFFVCmtYjcrErZyL/30L
	+4RwT2aHK+8n9LTRWvZch93HzVDaO6WM8RUhvJN2anyQwDDeYgzDCUEXu9iFsYGfB7nY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187319-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187319: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-libvirt-vhd:leak-check/check:fail:heisenbug
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=407f9a4b121eb65166375c410e14d7b704bc1106
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 24 Aug 2024 02:05:19 +0000

flight 187319 qemu-mainline real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187319/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-libvirt-vhd 22 leak-check/check           fail pass in 187309

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass

version targeted for testing:
 qemuu                407f9a4b121eb65166375c410e14d7b704bc1106
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  352 days
Failing since        182723  2023-09-07 18:19:05 Z  351 days   30 attempts
Testing same since   187309  2024-08-22 07:32:05 Z    1 days    2 attempts

------------------------------------------------------------
620 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 180820 lines long.)


From xen-devel-bounces@lists.xenproject.org Sat Aug 24 02:17:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Aug 2024 02:17:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782792.1192288 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shgKw-0001uc-2S; Sat, 24 Aug 2024 02:17:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782792.1192288; Sat, 24 Aug 2024 02:17:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shgKv-0001uV-VG; Sat, 24 Aug 2024 02:17:05 +0000
Received: by outflank-mailman (input) for mailman id 782792;
 Sat, 24 Aug 2024 02:17:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shgKu-0001uL-4B; Sat, 24 Aug 2024 02:17:04 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shgKt-00051C-PD; Sat, 24 Aug 2024 02:17:03 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shgKt-0003Xm-Eb; Sat, 24 Aug 2024 02:17:03 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shgKt-0002W6-E9; Sat, 24 Aug 2024 02:17:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=PPw/dDC8PD8BWeJ4m2VHVR8zt9nKqguTjQubxKsEVG8=; b=yOJQi3OAuds4ZBu1Whcaq6ELrk
	IxLbDzL1e3a27XOe8iTtLYFvVZmBg1c1lqEJgnEJy0wB2WUCA7VyBajlhCqxwWdUwy+TnHDd/fN4C
	Z0hxWRWp4L9PfDg6o90KioaJ/6PeNgkjff+cv5M0chGxkXO6J63VJv6nfudsxqTp39mU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187330-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187330: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=20885a36ce114f235d9d38cfcf4952c72ecda051
X-Osstest-Versions-That:
    xen=1965e9a930740b37637ac450f4752fd53edf63c4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 24 Aug 2024 02:17:03 +0000

flight 187330 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187330/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  20885a36ce114f235d9d38cfcf4952c72ecda051
baseline version:
 xen                  1965e9a930740b37637ac450f4752fd53edf63c4

Last test of basis   187328  2024-08-23 18:00:23 Z    0 days
Testing same since   187330  2024-08-23 22:04:09 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Fouad Hilly <fouad.hilly@cloud.com>
  Michal Orzel <michal.orzel@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   1965e9a930..20885a36ce  20885a36ce114f235d9d38cfcf4952c72ecda051 -> smoke


From xen-devel-bounces@lists.xenproject.org Sat Aug 24 02:42:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Aug 2024 02:42:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782803.1192298 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shgjo-0006Vg-10; Sat, 24 Aug 2024 02:42:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782803.1192298; Sat, 24 Aug 2024 02:42:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shgjn-0006VZ-UM; Sat, 24 Aug 2024 02:42:47 +0000
Received: by outflank-mailman (input) for mailman id 782803;
 Sat, 24 Aug 2024 02:42:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Yu32=PX=amd.com=VictorM.Lira@srs-se1.protection.inumbo.net>)
 id 1shgjm-0006VS-Dh
 for xen-devel@lists.xenproject.org; Sat, 24 Aug 2024 02:42:46 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on20613.outbound.protection.outlook.com
 [2a01:111:f403:2417::613])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8a13bbb3-61c2-11ef-a50a-bb4a2ccca743;
 Sat, 24 Aug 2024 04:42:44 +0200 (CEST)
Received: from CY5P221CA0161.NAMP221.PROD.OUTLOOK.COM (2603:10b6:930:6a::15)
 by SJ0PR12MB6904.namprd12.prod.outlook.com (2603:10b6:a03:483::5) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.19; Sat, 24 Aug
 2024 02:42:38 +0000
Received: from CY4PEPF0000FCBE.namprd03.prod.outlook.com
 (2603:10b6:930:6a:cafe::73) by CY5P221CA0161.outlook.office365.com
 (2603:10b6:930:6a::15) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.22 via Frontend
 Transport; Sat, 24 Aug 2024 02:42:38 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CY4PEPF0000FCBE.mail.protection.outlook.com (10.167.242.100) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Sat, 24 Aug 2024 02:42:37 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 21:42:37 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 23 Aug
 2024 21:42:28 -0500
Received: from xsjwoods50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend
 Transport; Fri, 23 Aug 2024 21:42:28 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8a13bbb3-61c2-11ef-a50a-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=UgNsg3KeLpDjG4WXfXehliq4ua7QBFab9NSFkRH2zJhXOWRk3fYNqsYbIM4aoDS0Jkrle91bDdas75EcjqOL1WsinlkQjBIfwkn2xCT3slkjsq6ji00WXZPyp2EJ2/IfT+yHc08lbFzGzGG+6iOjKlDGe++O4kMKrtZH+5Z3UB2ypykN4lNXAa31iU2UhWvNhSkqvhRf04VBUrrBHQJzKekgMuPx8AaJsFvdokO2I1aJdB1PscqcR7k8EKwFl+ueqCJt43Yidm7gDZULdooRM6JlrN0YEVRMn7iBqF0tTxdDX8y2hlaLIRYJ/sP9XX4pCsxuxIrYsZOSwp1jaQyTNQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yvukApYh2cNAgH3afRlUJ4g2tf9O96IyWGdH6wEQuVI=;
 b=LtZ/TGftf1OldBhGmxX4WNZX95WLZBKUOVwNsLmp7PJEFJ51vo2NhIKbJl7vhfYVaDlH974H8hBWK2spoK7M66doSeGHxEW6ZX9vVhZwrklOMeeedJJW/rikgWv9vhUa7zMVFIXRTGv+Hz4hkU9dQMoKKVNeyyotzz9MyjpArTtuTxHbjLe372cDvGeCmMtXOW9uAlZ+4myahyPtMS/Ujdy0YFFPyJU/5pisiK74L2tpmBTrUnh+Ez3P1McnKXVQ5cgCRqlGD6tXSDIg18A3tr2gNXoieT5AckuUagpTvQDHigo+FTyCFIBDTgkyDsULWI0rJ1Oqt7okXrl2nqkSWQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yvukApYh2cNAgH3afRlUJ4g2tf9O96IyWGdH6wEQuVI=;
 b=08egJhvNA681mvp1GF+hlmQ/5jnWE29lkDX38hBsRyWVXS47Utgz/poOgrybmqHGaaOb5VDxP/JGJxJOjdQFUVHsKxCkNh/+o74QZb8hWLeE5MxUVUYx8wsnFKZ38CWHpg7DcSpd/in9B/viOrv8sL9ZPVdA21ZFYHr7YGKgQIs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: <victorm.lira@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Victor Lira <victorm.lira@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>
Subject: [PATCH v1] automation: fix xilinx test timeout length
Date: Fri, 23 Aug 2024 19:42:21 -0700
Message-ID: <579230973e3ed60679c003ea2a708ddc6f00c1cc.1724467123.git.victorm.lira@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: victorm.lira@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000FCBE:EE_|SJ0PR12MB6904:EE_
X-MS-Office365-Filtering-Correlation-Id: 0e9af1a0-8bfd-4cfe-2f2d-08dcc3e66ac8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?l/hITl+s3y3P+VCS9rEVyPA/Y3ucmW9k0tWqXCLqU4PQo067N1lZhddS1inu?=
 =?us-ascii?Q?KatH68gD5OOYqwYTUs1JywSc9G6fFj2AWPLkeHV92hclHgiclaWjoTMpqGnd?=
 =?us-ascii?Q?cvsWVCkHdOORvCm+Pwl3OudGCNLp7zzs9cVOGj8yIIXmUXKSianLYi55R2Ec?=
 =?us-ascii?Q?GWOe+b0AP3+fO0FDa7m0JBUDezlP4FC2kc64aJGYZmBmeb6Dy6h6jYcM+4Au?=
 =?us-ascii?Q?tcspaYwqNQ4BsUXWwwEOfbW66TXXEOW0POh5q3oLQ2xWSgbqoG/KB/WIpTb+?=
 =?us-ascii?Q?ZEdVtNTBUmEK8dq9TZgpeCZul1vqcDeV931ZvcjlRIWcWa+97x+yl1zLLStS?=
 =?us-ascii?Q?oe0wzxKf+MjNwYEvNGpa//BSLjUZZVX3/pT14UNED9tkU5ansmIANLEuxToV?=
 =?us-ascii?Q?0I6+FS/SKfiE1pXp4CTyFa13ONZAdb/t1FkjPo25il5xm1KyR46ai7xUUBef?=
 =?us-ascii?Q?WU8DjaUIlFuDi5CueTW2G794yYVAoMEdVMulaSMnfawda/xHPc3vVXGs/8HI?=
 =?us-ascii?Q?NjqDgReFDYl9Bjqg2qpHElw6wLiG1zzaMXf2NF4FeGdDdUAG0lLf5+C9UQo/?=
 =?us-ascii?Q?aoRhhfUJSJJ++7tDIquQpMvpjFmQbLOqKFlSupNC5rqEnh4SfpUINOjTZMNa?=
 =?us-ascii?Q?DoQG8MKuELfBOQZtT/v+5MrN1Le85KqfwKcKJCZMB/dtZbsZw/lhGkJAYjzO?=
 =?us-ascii?Q?A41tNQxA+Id4wxL+nOPRgv9AsGNOR66zZai3PNd7gVxjDQIoSF5E1As0Ebql?=
 =?us-ascii?Q?RUjCV/unfgW8JslJD5DM0BWDrrS4mRNYMeg+xQkCoK36Zd5fvrE0nYt49JH4?=
 =?us-ascii?Q?ZuXhPfFbPmMTSPJcmVZhWM3NMKFly1abB6WrbtvKv+T6KIG3HJUz86NSzIQe?=
 =?us-ascii?Q?YC9/668Oy/2eZvTMVqhuZnxEMF8pLP03Qop6sQmlvU4tsvV6yMRI4O1KSDJD?=
 =?us-ascii?Q?yP44XEnlOdaucrGT2LycmPx2ryYrJmr0hL/VUcRw91NNhmnDRKvBBGT75v3k?=
 =?us-ascii?Q?7v0X1xJhrgTamdLdaCJOpSDVeRVlVjvEWTIaZwTvc4gyHRO9p3d1DrRwDJCN?=
 =?us-ascii?Q?2Nr7PlJ44x0SQ/DLruo60m1gCWGp0LNGT/A2rTBp3BYLf9TnF0RguyWJPjb3?=
 =?us-ascii?Q?J9WvNOx9Aq7qxNAIcBHbjt0XCoz6f9TQEYVqGSssP50/eoQRGtp4s9pYTQea?=
 =?us-ascii?Q?ChMjonpctJQiA6D0SDou6w9zTS8SkZSlwBKBbk9LiV3euXiKjIH9G/CR6iE0?=
 =?us-ascii?Q?AjQh+UUQHGJk4I3TCbkTPyIct5nc+f7yU4Jrr/4Q/BfxkcaypMv5O1plyqSn?=
 =?us-ascii?Q?RkYTnezPIJRwo5mNs/DZvVaYi8vksxCkJZxRJCLD89GUiGyqN2SRoDkAp5mK?=
 =?us-ascii?Q?8eXEGjyyJGtyvUq6faAdx6YtXtwk3WiArl3fpHJa1WqnweQxofLgjlbIFgmT?=
 =?us-ascii?Q?zr+gXojqx9JEX9X9MFrFKLr3l4QY/Rmc?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2024 02:42:37.9916
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 0e9af1a0-8bfd-4cfe-2f2d-08dcc3e66ac8
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000FCBE.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6904

From: Victor Lira <victorm.lira@amd.com>

The timout is too short which causes the test to sometimes fail.

---
Cc: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/scripts/xilinx-smoke-dom0-x86_64.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 4559e2b9ee..2b4d5f6af8 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -27,7 +27,7 @@ memory = 512
 vif = [ "bridge=xenbr0", ]
 disk = [ ]
 '
-TIMEOUT_SECONDS=200
+TIMEOUT_SECONDS=300

 # Select test variant.
 if [ "${TEST}" = "ping" ]; then
--
2.37.6



From xen-devel-bounces@lists.xenproject.org Sat Aug 24 03:33:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Aug 2024 03:33:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782815.1192308 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shhWu-0006gd-Pw; Sat, 24 Aug 2024 03:33:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782815.1192308; Sat, 24 Aug 2024 03:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shhWu-0006gW-M6; Sat, 24 Aug 2024 03:33:32 +0000
Received: by outflank-mailman (input) for mailman id 782815;
 Sat, 24 Aug 2024 03:33: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=mqP1=PX=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1shhWt-0006gQ-5F
 for xen-devel@lists.xenproject.org; Sat, 24 Aug 2024 03:33:31 +0000
Received: from nyc.source.kernel.org (nyc.source.kernel.org
 [2604:1380:45d1:ec00::3])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a061ea65-61c9-11ef-a50a-bb4a2ccca743;
 Sat, 24 Aug 2024 05:33:28 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by nyc.source.kernel.org (Postfix) with ESMTP id 78407A40A67;
 Sat, 24 Aug 2024 03:33:20 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28746C32781;
 Sat, 24 Aug 2024 03:33:26 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a061ea65-61c9-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724470406;
	bh=gcA4LnYzug7+IE1kYEzxpCit7DaURQnTehjp0JaM/EA=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=dHC0/126DLnwLZiAU/BfTD9Se7FqJ7Nm0tJHtcviQtnHOPNjN8RJjF1QLoNiz84QB
	 Xs6rzcYAWNAAra+rPOK0Dw49rt8tfoRXv7r6sKG3bm4Pqnysmf/00jTMQFJUKxZz6A
	 jrJG8tBDaF9DRmnhtxwoH/himlVhVcMDtvuRs0p21p26vI6NT7OtBHOXQRXzsygwRQ
	 WaJNHN7x3u+RHJzESmunlqQ5eH4/szPY7EmZpI0KR4Vf/ynV28sJEXez0Z+D3gTQyr
	 OySKdXZ8K8KqhrH3Zl3GMhM23GGvsSZHX3QERg9CNQfTyr5skJ8tM8m6wSG1j/j0Ma
	 Riyjrc1BBCt3g==
Date: Fri, 23 Aug 2024 20:33:24 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Victor Lira <victorm.lira@amd.com>
cc: xen-devel@lists.xenproject.org, 
    Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v1] automation: fix xilinx test timeout length
In-Reply-To: <579230973e3ed60679c003ea2a708ddc6f00c1cc.1724467123.git.victorm.lira@amd.com>
Message-ID: <alpine.DEB.2.22.394.2408232032470.3871186@ubuntu-linux-20-04-desktop>
References: <579230973e3ed60679c003ea2a708ddc6f00c1cc.1724467123.git.victorm.lira@amd.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 23 Aug 2024, victorm.lira@amd.com wrote:
> From: Victor Lira <victorm.lira@amd.com>
> 
> The timout is too short which causes the test to sometimes fail.

I can fix the timout typo on commit

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> ---
>  automation/scripts/xilinx-smoke-dom0-x86_64.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
> index 4559e2b9ee..2b4d5f6af8 100755
> --- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
> +++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
> @@ -27,7 +27,7 @@ memory = 512
>  vif = [ "bridge=xenbr0", ]
>  disk = [ ]
>  '
> -TIMEOUT_SECONDS=200
> +TIMEOUT_SECONDS=300
> 
>  # Select test variant.
>  if [ "${TEST}" = "ping" ]; then
> --
> 2.37.6
> 


From xen-devel-bounces@lists.xenproject.org Sat Aug 24 03:58:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Aug 2024 03:58:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782824.1192317 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shhv7-0002px-MB; Sat, 24 Aug 2024 03:58:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782824.1192317; Sat, 24 Aug 2024 03:58:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shhv7-0002pq-JD; Sat, 24 Aug 2024 03:58:33 +0000
Received: by outflank-mailman (input) for mailman id 782824;
 Sat, 24 Aug 2024 03:58:32 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=NNC+=PX=bombadil.srs.infradead.org=BATV+57a39d84037f3fd726e9+7671+infradead.org+hch@srs-se1.protection.inumbo.net>)
 id 1shhv5-0002pf-Sc
 for xen-devel@lists.xenproject.org; Sat, 24 Aug 2024 03:58:32 +0000
Received: from bombadil.infradead.org (bombadil.infradead.org
 [2607:7c80:54:3::133])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1dfec3c7-61cd-11ef-8776-851b0ebba9a2;
 Sat, 24 Aug 2024 05:58:28 +0200 (CEST)
Received: from
 2a02-8389-2341-5b80-7457-864c-9b77-b751.cable.dynamic.v6.surfer.at
 ([2a02:8389:2341:5b80:7457:864c:9b77:b751] helo=localhost)
 by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux))
 id 1shhuw-00000001ONa-03dM; Sat, 24 Aug 2024 03:58:22 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1dfec3c7-61cd-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender
	:Reply-To:Content-Type:Content-ID:Content-Description;
	bh=re3UFKaS3rXfUjdG/ONg9ql30vWSuwopB5zeQTi4LOU=; b=K+23zVXwp+w4tnnfTCyrAQTWzl
	2LQiB6ClhNs8AgvLs1TlIfQGWtOFTiV6mlFbwv/l+E1OqTHiMUWPiQylcFabmaCJiwSDvGIiZ1Rtb
	eb20G2jNMBhSp7snrjbupIfdAwr9vy4O2qX+Lnyi8/Bdnt4VP+k1M5N3ee1bCcLxusNCpHd8bwE5c
	SQ2lA8DGV3DQ9qyjm0MY3TsI8zjZ99vj1dQCqXlyumyOaaSQu/bF1uGtQpwG5cafHr2BhcOoGWyyo
	6HqSXEahoKI5jebrWs9HWiiLxlMagMe6UbXHB4YVsI6+/lm4AKDfMmeXByanG5g1+RQnufR7c8Sed
	7cZhlYqA==;
From: Christoph Hellwig <hch@lst.de>
To: iommu@lists.linux.dev
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Bingbu Cao <bingbu.cao@intel.com>,
	"Michael S . Tsirkin " <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	linux-kernel@vger.kernel.org,
	linux-alpha@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mips@vger.kernel.org,
	linux-parisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-s390@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-media@vger.kernel.org,
	virtualization@lists.linux.dev,
	xen-devel@lists.xenproject.org
Subject: [PATCH] dma-mapping: clear mark DMA ops as an architecture feature
Date: Sat, 24 Aug 2024 05:57:58 +0200
Message-ID: <20240824035817.1163502-2-hch@lst.de>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240824035817.1163502-1-hch@lst.de>
References: <20240824035817.1163502-1-hch@lst.de>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SRS-Rewrite: SMTP reverse-path rewritten from <hch@infradead.org> by bombadil.infradead.org. See http://www.infradead.org/rpr.html

DMA ops are a helper for architectures and not for drivers to override
the DMA implementation.  Unfortunately driver authors keep ignoring
this.  Make this more clear by renaming the symbol to ARCH_DMA_OPS,
have the three drivers overriding it depend on that.  They should
probably also be marked broken, but we can give them a bit of a grace
period for that.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/Kconfig                         |  9 +++++++++
 arch/alpha/Kconfig                   |  2 +-
 arch/arm/Kconfig                     |  2 +-
 arch/arm64/Kconfig                   |  1 +
 arch/mips/Kconfig                    |  2 +-
 arch/parisc/Kconfig                  |  2 +-
 arch/powerpc/Kconfig                 |  2 +-
 arch/s390/Kconfig                    |  2 +-
 arch/sparc/Kconfig                   |  2 +-
 arch/x86/Kconfig                     |  2 +-
 drivers/macintosh/macio_asic.c       |  4 ++--
 drivers/media/pci/intel/ipu6/Kconfig |  7 ++++++-
 drivers/vdpa/Kconfig                 | 14 ++++++++++++--
 drivers/xen/Kconfig                  |  4 ++--
 include/linux/device.h               |  2 +-
 include/linux/dma-map-ops.h          |  6 +++---
 kernel/dma/Kconfig                   |  9 ++-------
 kernel/dma/Makefile                  |  2 +-
 18 files changed, 47 insertions(+), 27 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index 975dd22a2dbd22..6abd0f1c1d833e 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -17,6 +17,15 @@ config CPU_MITIGATIONS
 	def_bool y
 endif
 
+#
+# Selected by architectures that need custom DMA operations for e.g. legacy
+# IOMMUs not handled by dma-iommu.  Drivers must never select this symbol.
+#
+config ARCH_DMA_OPS
+	depends on HAS_DMA
+	select DMA_OPS_HELPERS
+	bool
+
 menu "General architecture-dependent options"
 
 config ARCH_HAS_SUBPAGE_FAULTS
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 50ff06d5b799c9..c6d716d8bdd095 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -3,13 +3,13 @@ config ALPHA
 	bool
 	default y
 	select ARCH_32BIT_USTAT_F_TINODE
+	select ARCH_DMA_OPS if PCI
 	select ARCH_HAS_CURRENT_STACK_POINTER
 	select ARCH_MIGHT_HAVE_PC_PARPORT
 	select ARCH_MIGHT_HAVE_PC_SERIO
 	select ARCH_NO_PREEMPT
 	select ARCH_NO_SG_CHAIN
 	select ARCH_USE_CMPXCHG_LOCKREF
-	select DMA_OPS if PCI
 	select FORCE_PCI
 	select PCI_DOMAINS if PCI
 	select PCI_SYSCALL if PCI
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 54b2bb817a7fc0..a823fd14d65987 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -10,6 +10,7 @@ config ARM
 	select ARCH_HAS_CURRENT_STACK_POINTER
 	select ARCH_HAS_DEBUG_VIRTUAL if MMU
 	select ARCH_HAS_DMA_ALLOC if MMU
+	select ARCH_DMA_OPS
 	select ARCH_HAS_DMA_WRITE_COMBINE if !ARM_DMA_MEM_BUFFERABLE
 	select ARCH_HAS_ELF_RANDOMIZE
 	select ARCH_HAS_FORTIFY_SOURCE
@@ -54,7 +55,6 @@ config ARM
 	select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS
 	select DMA_DECLARE_COHERENT
 	select DMA_GLOBAL_POOL if !MMU
-	select DMA_OPS
 	select DMA_NONCOHERENT_MMAP if MMU
 	select EDAC_SUPPORT
 	select EDAC_ATOMIC_SCRUB
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index a2f8ff354ca670..ce1650ceb5b596 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -15,6 +15,7 @@ config ARM64
 	select ARCH_BINFMT_ELF_EXTRA_PHDRS
 	select ARCH_BINFMT_ELF_STATE
 	select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
+	select ARCH_DMA_OPS if XEN
 	select ARCH_ENABLE_HUGEPAGE_MIGRATION if HUGETLB_PAGE && MIGRATION
 	select ARCH_ENABLE_MEMORY_HOTPLUG
 	select ARCH_ENABLE_MEMORY_HOTREMOVE
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 60077e57693563..3b5a1aef1e9bc0 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -391,9 +391,9 @@ config MACH_JAZZ
 	bool "Jazz family of machines"
 	select ARC_MEMORY
 	select ARC_PROMLIB
+	select ARCH_DMA_OPS
 	select ARCH_MIGHT_HAVE_PC_PARPORT
 	select ARCH_MIGHT_HAVE_PC_SERIO
-	select DMA_OPS
 	select FW_ARC
 	select FW_ARC32
 	select ARCH_MAY_HAVE_PC_FDC
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index b0a2ac3ba91610..c77f9de3e8cc1b 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -3,6 +3,7 @@ config PARISC
 	def_bool y
 	select ALTERNATE_USER_ADDRESS_SPACE
 	select ARCH_32BIT_OFF_T if !64BIT
+	select ARCH_DMA_OPS
 	select ARCH_MIGHT_HAVE_PC_PARPORT
 	select HAVE_FUNCTION_TRACER
 	select HAVE_FUNCTION_GRAPH_TRACER
@@ -23,7 +24,6 @@ config PARISC
 	select ARCH_HAS_CACHE_LINE_SIZE
 	select ARCH_HAS_DEBUG_VM_PGTABLE
 	select HAVE_RELIABLE_STACKTRACE
-	select DMA_OPS
 	select RTC_CLASS
 	select RTC_DRV_GENERIC
 	select INIT_ALL_POSSIBLE
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index d7b09b064a8ac5..50c33aca1959a5 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -124,6 +124,7 @@ config PPC
 	select ARCH_32BIT_OFF_T if PPC32
 	select ARCH_DISABLE_KASAN_INLINE	if PPC_RADIX_MMU
 	select ARCH_DMA_DEFAULT_COHERENT	if !NOT_COHERENT_CACHE
+	select ARCH_DMA_OPS			if PPC64
 	select ARCH_ENABLE_MEMORY_HOTPLUG
 	select ARCH_ENABLE_MEMORY_HOTREMOVE
 	select ARCH_HAS_COPY_MC			if PPC64
@@ -185,7 +186,6 @@ config PPC
 	select CPUMASK_OFFSTACK			if NR_CPUS >= 8192
 	select DCACHE_WORD_ACCESS		if PPC64 && CPU_LITTLE_ENDIAN
 	select DMA_OPS_BYPASS			if PPC64
-	select DMA_OPS				if PPC64
 	select DYNAMIC_FTRACE			if FUNCTION_TRACER
 	select EDAC_ATOMIC_SCRUB
 	select EDAC_SUPPORT
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index a822f952f64a9c..1de639f1e50dc3 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -62,6 +62,7 @@ config S390
 	select ARCH_32BIT_USTAT_F_TINODE
 	select ARCH_BINFMT_ELF_STATE
 	select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
+	select ARCH_DMA_OPS if PCI
 	select ARCH_ENABLE_MEMORY_HOTPLUG if SPARSEMEM
 	select ARCH_ENABLE_MEMORY_HOTREMOVE
 	select ARCH_ENABLE_SPLIT_PMD_PTLOCK if PGTABLE_LEVELS > 2
@@ -137,7 +138,6 @@ config S390
 	select BUILDTIME_TABLE_SORT
 	select CLONE_BACKWARDS2
 	select DCACHE_WORD_ACCESS if !KMSAN
-	select DMA_OPS if PCI
 	select DYNAMIC_FTRACE if FUNCTION_TRACER
 	select FUNCTION_ALIGNMENT_8B if CC_IS_GCC
 	select FUNCTION_ALIGNMENT_16B if !CC_IS_GCC
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 11bf9d312318c6..ba9fd67c5c5327 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -13,10 +13,10 @@ config 64BIT
 config SPARC
 	bool
 	default y
+	select ARCH_DMA_OPS
 	select ARCH_HAS_CPU_CACHE_ALIASING
 	select ARCH_MIGHT_HAVE_PC_PARPORT if SPARC64 && PCI
 	select ARCH_MIGHT_HAVE_PC_SERIO
-	select DMA_OPS
 	select OF
 	select OF_PROMTREE
 	select HAVE_ASM_MODVERSIONS
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 007bab9f2a0e39..c105c822da0559 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -65,6 +65,7 @@ config X86
 	select ARCH_CLOCKSOURCE_INIT
 	select ARCH_CONFIGURES_CPU_MITIGATIONS
 	select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
+	select ARCH_DMA_OPS if GART_IOMMU || XEN
 	select ARCH_ENABLE_HUGEPAGE_MIGRATION if X86_64 && HUGETLB_PAGE && MIGRATION
 	select ARCH_ENABLE_MEMORY_HOTPLUG if X86_64
 	select ARCH_ENABLE_MEMORY_HOTREMOVE if MEMORY_HOTPLUG
@@ -943,7 +944,6 @@ config DMI
 
 config GART_IOMMU
 	bool "Old AMD GART IOMMU support"
-	select DMA_OPS
 	select IOMMU_HELPER
 	select SWIOTLB
 	depends on X86_64 && PCI && AMD_NB
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index 13626205530d36..e217e6e7b2a4d0 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -387,7 +387,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
 	dma_set_max_seg_size(&dev->ofdev.dev, 65536);
 	dma_set_seg_boundary(&dev->ofdev.dev, 0xffffffff);
 
-#if defined(CONFIG_PCI) && defined(CONFIG_DMA_OPS)
+#if defined(CONFIG_PCI) && defined(CONFIG_ARCH_DMA_OPS)
 	/* Set the DMA ops to the ones from the PCI device, this could be
 	 * fishy if we didn't know that on PowerMac it's always direct ops
 	 * or iommu ops that will work fine
@@ -396,7 +396,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
 	 */
 	dev->ofdev.dev.archdata = chip->lbus.pdev->dev.archdata;
 	dev->ofdev.dev.dma_ops = chip->lbus.pdev->dev.dma_ops;
-#endif /* CONFIG_PCI && CONFIG_DMA_OPS */
+#endif /* CONFIG_PCI && CONFIG_ARCH_DMA_OPS */
 
 #ifdef DEBUG
 	printk("preparing mdev @%p, ofdev @%p, dev @%p, kobj @%p\n",
diff --git a/drivers/media/pci/intel/ipu6/Kconfig b/drivers/media/pci/intel/ipu6/Kconfig
index 40e20f0aa5ae5d..0885d8f07a4d81 100644
--- a/drivers/media/pci/intel/ipu6/Kconfig
+++ b/drivers/media/pci/intel/ipu6/Kconfig
@@ -4,8 +4,13 @@ config VIDEO_INTEL_IPU6
 	depends on VIDEO_DEV
 	depends on X86 && X86_64 && HAS_DMA
 	depends on IPU_BRIDGE || !IPU_BRIDGE
+	#
+	# This driver incorrectly tries to override the dma_ops.  It should
+	# never have done that, but for now keep it working on architectures
+	# that use dma ops
+	#
+	depends on ARCH_DMA_OPS
 	select AUXILIARY_BUS
-	select DMA_OPS
 	select IOMMU_IOVA
 	select VIDEO_V4L2_SUBDEV_API
 	select MEDIA_CONTROLLER
diff --git a/drivers/vdpa/Kconfig b/drivers/vdpa/Kconfig
index 5265d09fc1c409..1ce9ca50c848e3 100644
--- a/drivers/vdpa/Kconfig
+++ b/drivers/vdpa/Kconfig
@@ -12,7 +12,12 @@ if VDPA
 config VDPA_SIM
 	tristate "vDPA device simulator core"
 	depends on RUNTIME_TESTING_MENU && HAS_DMA
-	select DMA_OPS
+	#
+	# This driver incorrectly tries to override the dma_ops.  It should
+	# never have done that, but for now keep it working on architectures
+	# that use dma ops
+	#
+	depends on ARCH_DMA_OPS
 	select VHOST_RING
 	select IOMMU_IOVA
 	help
@@ -36,7 +41,12 @@ config VDPA_SIM_BLOCK
 config VDPA_USER
 	tristate "VDUSE (vDPA Device in Userspace) support"
 	depends on EVENTFD && MMU && HAS_DMA
-	select DMA_OPS
+	#
+	# This driver incorrectly tries to override the dma_ops.  It should
+	# never have done that, but for now keep it working on architectures
+	# that use dma ops
+	#
+	depends on ARCH_DMA_OPS
 	select VHOST_IOTLB
 	select IOMMU_IOVA
 	help
diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
index d5989871dd5de3..a9c825974d3a31 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -178,7 +178,7 @@ config XEN_GRANT_DMA_ALLOC
 config SWIOTLB_XEN
 	def_bool y
 	depends on XEN_PV || ARM || ARM64
-	select DMA_OPS
+	depends on ARCH_DMA_OPS
 	select SWIOTLB
 
 config XEN_PCI_STUB
@@ -348,11 +348,11 @@ config XEN_GRANT_DMA_IOMMU
 
 config XEN_GRANT_DMA_OPS
 	bool
-	select DMA_OPS
 
 config XEN_VIRTIO
 	bool "Xen virtio support"
 	depends on VIRTIO
+	depends on ARCH_DMA_OPS
 	select XEN_GRANT_DMA_OPS
 	select XEN_GRANT_DMA_IOMMU if OF
 	help
diff --git a/include/linux/device.h b/include/linux/device.h
index 1c5280d28bc389..b25003d02c2b1f 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -750,7 +750,7 @@ struct device {
 	struct dev_pin_info	*pins;
 #endif
 	struct dev_msi_info	msi;
-#ifdef CONFIG_DMA_OPS
+#ifdef CONFIG_ARCH_DMA_OPS
 	const struct dma_map_ops *dma_ops;
 #endif
 	u64		*dma_mask;	/* dma mask (if dma'able device) */
diff --git a/include/linux/dma-map-ops.h b/include/linux/dma-map-ops.h
index 077b15c93bb8ff..f4de2a4a355d44 100644
--- a/include/linux/dma-map-ops.h
+++ b/include/linux/dma-map-ops.h
@@ -75,7 +75,7 @@ struct dma_map_ops {
 	unsigned long (*get_merge_boundary)(struct device *dev);
 };
 
-#ifdef CONFIG_DMA_OPS
+#ifdef CONFIG_ARCH_DMA_OPS
 #include <asm/dma-mapping.h>
 
 static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
@@ -90,7 +90,7 @@ static inline void set_dma_ops(struct device *dev,
 {
 	dev->dma_ops = dma_ops;
 }
-#else /* CONFIG_DMA_OPS */
+#else /* CONFIG_ARCH_DMA_OPS */
 static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
 {
 	return NULL;
@@ -99,7 +99,7 @@ static inline void set_dma_ops(struct device *dev,
 			       const struct dma_map_ops *dma_ops)
 {
 }
-#endif /* CONFIG_DMA_OPS */
+#endif /* CONFIG_ARCH_DMA_OPS */
 
 #ifdef CONFIG_DMA_CMA
 extern struct cma *dma_contiguous_default_area;
diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig
index 21bae17008368a..6849675d8fcd08 100644
--- a/kernel/dma/Kconfig
+++ b/kernel/dma/Kconfig
@@ -11,11 +11,6 @@ config HAS_DMA
 config DMA_OPS_HELPERS
 	bool
 
-config DMA_OPS
-	depends on HAS_DMA
-	select DMA_OPS_HELPERS
-	bool
-
 #
 # IOMMU drivers that can bypass the IOMMU code and optionally use the direct
 # mapping fast path should select this option and set the dma_ops_bypass
@@ -113,8 +108,8 @@ config DMA_BOUNCE_UNALIGNED_KMALLOC
 
 config DMA_NEED_SYNC
 	def_bool ARCH_HAS_SYNC_DMA_FOR_DEVICE || ARCH_HAS_SYNC_DMA_FOR_CPU || \
-		 ARCH_HAS_SYNC_DMA_FOR_CPU_ALL || DMA_API_DEBUG || DMA_OPS || \
-		 SWIOTLB
+		 ARCH_HAS_SYNC_DMA_FOR_CPU_ALL || DMA_API_DEBUG || \
+		 ARCH_DMA_OPS || SWIOTLB
 
 config DMA_RESTRICTED_POOL
 	bool "DMA Restricted Pool"
diff --git a/kernel/dma/Makefile b/kernel/dma/Makefile
index 2e6e933cf7f3fb..f479b59002cb30 100644
--- a/kernel/dma/Makefile
+++ b/kernel/dma/Makefile
@@ -2,7 +2,7 @@
 
 obj-$(CONFIG_HAS_DMA)			+= mapping.o direct.o
 obj-$(CONFIG_DMA_OPS_HELPERS)		+= ops_helpers.o
-obj-$(CONFIG_DMA_OPS)			+= dummy.o
+obj-$(CONFIG_ARCH_DMA_OPS)		+= dummy.o
 obj-$(CONFIG_DMA_CMA)			+= contiguous.o
 obj-$(CONFIG_DMA_DECLARE_COHERENT)	+= coherent.o
 obj-$(CONFIG_DMA_API_DEBUG)		+= debug.o
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Sat Aug 24 03:58:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Aug 2024 03:58:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782825.1192324 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shhv7-0002tB-VR; Sat, 24 Aug 2024 03:58:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782825.1192324; Sat, 24 Aug 2024 03:58:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shhv7-0002sJ-Q7; Sat, 24 Aug 2024 03:58:33 +0000
Received: by outflank-mailman (input) for mailman id 782825;
 Sat, 24 Aug 2024 03:58:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=NNC+=PX=bombadil.srs.infradead.org=BATV+57a39d84037f3fd726e9+7671+infradead.org+hch@srs-se1.protection.inumbo.net>)
 id 1shhv5-0002pe-J3
 for xen-devel@lists.xenproject.org; Sat, 24 Aug 2024 03:58:32 +0000
Received: from bombadil.infradead.org (bombadil.infradead.org
 [2607:7c80:54:3::133])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 1f4295cd-61cd-11ef-a50a-bb4a2ccca743;
 Sat, 24 Aug 2024 05:58:30 +0200 (CEST)
Received: from
 2a02-8389-2341-5b80-7457-864c-9b77-b751.cable.dynamic.v6.surfer.at
 ([2a02:8389:2341:5b80:7457:864c:9b77:b751] helo=localhost)
 by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux))
 id 1shhut-00000001ON7-0bmD; Sat, 24 Aug 2024 03:58:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1f4295cd-61cd-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding:
	MIME-Version:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:
	Content-ID:Content-Description:In-Reply-To:References;
	bh=Q2nYRi9U4a8itDtDq9LNnEMZ/Twd4vEjX9CTeiWFtZk=; b=ibODa9lL5q7uggEbw2OOQZkuOl
	gdhQY0r9D/9beDb+Bd4qmVTCvwI+QiMjo95/+tPj+4V9U7F5hRFToRdX4k4DvPYHu1OLEHcIx+etT
	KIlSwzlSzvMKbYOerqEj9me07yLSDIeP/0/bbrlY9qqah4ekXhqi/eYjBvvldU6VljO5zLO6djC2Z
	2yksa1axP4sCcbZUGAWwKgEmbBGoAFPkoBoCxdpgqo5+6g1QWpb94Ilm4RmYcg8FZcggX2U6K6Sfe
	cGdem+9zPaemNy7/Cr0ZBWXuCzcsmrGl8tEN+ptWMeKG1q46THZ+VeovOI19ardMWa1DQRk/ZtOsI
	ioZS20vQ==;
From: Christoph Hellwig <hch@lst.de>
To: iommu@lists.linux.dev
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Bingbu Cao <bingbu.cao@intel.com>,
	"Michael S . Tsirkin " <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	linux-kernel@vger.kernel.org,
	linux-alpha@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mips@vger.kernel.org,
	linux-parisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-s390@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-media@vger.kernel.org,
	virtualization@lists.linux.dev,
	xen-devel@lists.xenproject.org
Subject: clearly mark DMA_OPS support as an architecture feasture
Date: Sat, 24 Aug 2024 05:57:57 +0200
Message-ID: <20240824035817.1163502-1-hch@lst.de>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SRS-Rewrite: SMTP reverse-path rewritten from <hch@infradead.org> by bombadil.infradead.org. See http://www.infradead.org/rpr.html

Hi all,

we've had a long standing problems where drivers try to hook into the
DMA_OPS mechanisms to override them for something that is not DMA, or
to introduce additional dispatching.

Now that we are not using DMA_OPS support for dma-iommu and can build
kernels without DMA_OPS support on many common setups this becomes even
more problematic.

This series renames the option to ARCH_DMA_OPS and adds very explicit
comment to not use it in drivers.  The ipu6 and vdpa_sim/user drivers
that abuse the mechanism are made to depend on the option instead of
selecting it with a big comment, but I expect this to be fixed rather
sooner than later (I know the ipu6 maintainers are on it based on a
previous discussion).


From xen-devel-bounces@lists.xenproject.org Sat Aug 24 05:54:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Aug 2024 05:54:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782840.1192337 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shjiw-0005rC-Hr; Sat, 24 Aug 2024 05:54:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782840.1192337; Sat, 24 Aug 2024 05:54:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shjiw-0005r5-F6; Sat, 24 Aug 2024 05:54:06 +0000
Received: by outflank-mailman (input) for mailman id 782840;
 Sat, 24 Aug 2024 05:54:06 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shjiv-0005qv-Vl; Sat, 24 Aug 2024 05:54:05 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shjiv-00014f-NP; Sat, 24 Aug 2024 05:54:05 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shjiv-0000Bw-6u; Sat, 24 Aug 2024 05:54:05 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shjiv-0004OB-6Q; Sat, 24 Aug 2024 05:54:05 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=TtmiKF0bBTV26hR/FyZWcw7mpgbwYxeuPoQ8iNwY5vk=; b=Hn2DMXveBSkl3N79AKvmGAKcQs
	/onqSBAkogKI8cOQM5Ht6AEebW4ijl1CGMKCoIP/9AiKtJHZlHLG85BCyIvx9Jb9/CEGuloMQMAWb
	nr84kjvjBO0mRP1Ew53khGRn8kw0EnK8wN5cimoGfS2WWJhLyI2cohrTCIfo7J7ZFArE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187331-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187331: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=95764a0817a51741b7ffb1f78cba2a19b08ab2d1
X-Osstest-Versions-That:
    xen=20885a36ce114f235d9d38cfcf4952c72ecda051
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 24 Aug 2024 05:54:05 +0000

flight 187331 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187331/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  95764a0817a51741b7ffb1f78cba2a19b08ab2d1
baseline version:
 xen                  20885a36ce114f235d9d38cfcf4952c72ecda051

Last test of basis   187330  2024-08-23 22:04:09 Z    0 days
Testing same since   187331  2024-08-24 03:02:44 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Victor Lira <victorm.lira@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   20885a36ce..95764a0817  95764a0817a51741b7ffb1f78cba2a19b08ab2d1 -> smoke


From xen-devel-bounces@lists.xenproject.org Sat Aug 24 07:58:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Aug 2024 07:58:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782866.1192380 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shlev-0000cs-G4; Sat, 24 Aug 2024 07:58:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782866.1192380; Sat, 24 Aug 2024 07:58:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shlev-0000cl-D2; Sat, 24 Aug 2024 07:58:05 +0000
Received: by outflank-mailman (input) for mailman id 782866;
 Sat, 24 Aug 2024 07:58:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shlet-0000cb-Le; Sat, 24 Aug 2024 07:58:03 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shlet-0003VS-K5; Sat, 24 Aug 2024 07:58:03 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shlet-00034h-1z; Sat, 24 Aug 2024 07:58:03 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shlet-0001TK-1F; Sat, 24 Aug 2024 07:58:03 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=vAtYyiH5k5yuOE4JpZTNLFbbjmNDKO1ZFLW10GAyFjc=; b=OGru4VySfo/4Jb6/xmEAmgIXVC
	O5AeqFZ+muJzoWBGbcs6gTjji3+Y6Qf2FVXo2KxTYOHxtz2ZwlU0VtrWfdUQiw479MLDm8amvyy6O
	hF1dBoEKZ3vzftJjlrToBDlVi5pXgdxC3fo1M9/lZbtX3RoVItr9vFfZZowOc32zH+Ek=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187321-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187321: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=aa80a04df488528d90a0d892f0752571b1759e8b
X-Osstest-Versions-That:
    xen=6d41a9d8a12ff89adabdc286e63e9391a0481699
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 24 Aug 2024 07:58:03 +0000

flight 187321 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187321/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187312
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187312
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187312
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187312
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187312
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187312
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  aa80a04df488528d90a0d892f0752571b1759e8b
baseline version:
 xen                  6d41a9d8a12ff89adabdc286e63e9391a0481699

Last test of basis   187312  2024-08-22 12:08:57 Z    1 days
Testing same since   187321  2024-08-23 08:28:10 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Amneesh Singh <a-singh21@ti.com>
  Ayan Kumar Halder <ayan.kumar.halder@amd.com>
  Julien Grall <jgrall@amazon.com>
  Julien Grall <julien@xen.org>
  Michal Orzel <michal.orzel@amd.com>
  Stefano Stabellini <stefano.stabellini@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   6d41a9d8a1..aa80a04df4  aa80a04df488528d90a0d892f0752571b1759e8b -> master


From xen-devel-bounces@lists.xenproject.org Sat Aug 24 07:58:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Aug 2024 07:58:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782869.1192390 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shlfC-0000x9-U4; Sat, 24 Aug 2024 07:58:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782869.1192390; Sat, 24 Aug 2024 07:58:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shlfC-0000x2-Qa; Sat, 24 Aug 2024 07:58:22 +0000
Received: by outflank-mailman (input) for mailman id 782869;
 Sat, 24 Aug 2024 07:58:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ztRH=PX=linux.intel.com=sakari.ailus@srs-se1.protection.inumbo.net>)
 id 1shlfC-0000wR-1u
 for xen-devel@lists.xenproject.org; Sat, 24 Aug 2024 07:58:22 +0000
Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.18])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9fe45cb6-61ee-11ef-a50a-bb4a2ccca743;
 Sat, 24 Aug 2024 09:58:20 +0200 (CEST)
Received: from orviesa001.jf.intel.com ([10.64.159.141])
 by orvoesa110.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 24 Aug 2024 00:58:17 -0700
Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com)
 ([10.237.72.44])
 by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 24 Aug 2024 00:58:12 -0700
Received: from kekkonen.localdomain (localhost [127.0.0.1])
 by kekkonen.fi.intel.com (Postfix) with SMTP id AF4D411F95D;
 Sat, 24 Aug 2024 10:58:07 +0300 (EEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9fe45cb6-61ee-11ef-a50a-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
  d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
  t=1724486301; x=1756022301;
  h=date:from:to:cc:subject:message-id:references:
   mime-version:in-reply-to;
  bh=+MuJabAXZNXC3PzKmb+ctuTHQcVD5uw07JOm0cukiHM=;
  b=AyDngEiMx9Pvn2XVXyb7hwGsBU2p10K8iW4w+ZW50bNezag17HWHDbwj
   eABqAGvPTXpLYZkQ3Cxz9Le2n9sJ8yaBTlM67cleBWwVSUc00OiM30F58
   dMauW8TOUSY4+yMp6Eec85JNEHsFkuUQQ6W5MZSQyAMBCv+8A+GC7b6u6
   lmAWN7CVO1TUY2WwRuot8cFV0uejGI6+VfE4JNgx5DDGuaKq8PfDlWcpM
   jq5u8+HpulwWnmC1WIW5jiQ3jeRltENbGc00sskuXOrpNv/PiAIn2m+8A
   e4SQNBAQo6JeNv8+9Tci+T4xPB4TqxuHCClTsN5N+WmiGSs5FFbvZIs8D
   Q==;
X-CSE-ConnectionGUID: sF/w6BFBTbqdcnB1HrveGQ==
X-CSE-MsgGUID: igDkzHi5ReqKezJ4/LocWQ==
X-IronPort-AV: E=McAfee;i="6700,10204,11173"; a="23126436"
X-IronPort-AV: E=Sophos;i="6.10,172,1719903600"; 
   d="scan'208";a="23126436"
X-CSE-ConnectionGUID: xNO1WY6SQfimIDbJMyQklA==
X-CSE-MsgGUID: Re7yuOLNQLu2fGkmVM310w==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="6.10,172,1719903600"; 
   d="scan'208";a="99531438"
Date: Sat, 24 Aug 2024 07:58:07 +0000
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Christoph Hellwig <hch@lst.de>
Cc: iommu@lists.linux.dev, Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Bingbu Cao <bingbu.cao@intel.com>,
	"Michael S . Tsirkin " <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>, linux-kernel@vger.kernel.org,
	linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
	sparclinux@vger.kernel.org, linux-media@vger.kernel.org,
	virtualization@lists.linux.dev, xen-devel@lists.xenproject.org
Subject: Re: [PATCH] dma-mapping: clear mark DMA ops as an architecture
 feature
Message-ID: <ZsmSj6ZBZqBtjALU@kekkonen.localdomain>
References: <20240824035817.1163502-1-hch@lst.de>
 <20240824035817.1163502-2-hch@lst.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20240824035817.1163502-2-hch@lst.de>

Hi Christoph,

On Sat, Aug 24, 2024 at 05:57:58AM +0200, Christoph Hellwig wrote:
> DMA ops are a helper for architectures and not for drivers to override
> the DMA implementation.  Unfortunately driver authors keep ignoring
> this.  Make this more clear by renaming the symbol to ARCH_DMA_OPS,
> have the three drivers overriding it depend on that.  They should
> probably also be marked broken, but we can give them a bit of a grace
> period for that.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> # for IPU6

We'll address this for IPU6 but I can't give a timeline for that right now.

-- 
Kind regards,

Sakari Ailus


From xen-devel-bounces@lists.xenproject.org Sat Aug 24 11:41:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Aug 2024 11:41:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782916.1192400 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shp8Q-00063x-5Q; Sat, 24 Aug 2024 11:40:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782916.1192400; Sat, 24 Aug 2024 11:40:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shp8Q-00063q-1H; Sat, 24 Aug 2024 11:40:46 +0000
Received: by outflank-mailman (input) for mailman id 782916;
 Sat, 24 Aug 2024 11:40:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shp8O-00063g-Px; Sat, 24 Aug 2024 11:40:44 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shp8O-0008K4-Gd; Sat, 24 Aug 2024 11:40:44 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shp8O-00067K-34; Sat, 24 Aug 2024 11:40:44 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shp8O-0006zm-2U; Sat, 24 Aug 2024 11:40:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=3/C4ZOqFUG6LZ2gub1Z7xgOnK9W6uCr2udn3Zrtv1oM=; b=FZK5gsEQ717zvnb9a4b8YWqpZN
	X/GtgxFCjlzFaoOPb4ijFK6ooksnr/g3urDfVm5yRQVDDmKNGOSuLortPDAQ7JSj7UGUnpYlLecBY
	omBmp5NwJyDEfP8p983356x/WyRQLTP6v+WltoNbJciTUXrEYuUmlUQ9VhtwHTMger4s=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187329-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187329: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=3d5f968a177d468cd13568ef901c5be84d83d32b
X-Osstest-Versions-That:
    linux=872cf28b8df9c5c3a1e71a88ee750df7c2513971
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 24 Aug 2024 11:40:44 +0000

flight 187329 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187329/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187316
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187316
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187316
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187316
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187316
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187316
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                3d5f968a177d468cd13568ef901c5be84d83d32b
baseline version:
 linux                872cf28b8df9c5c3a1e71a88ee750df7c2513971

Last test of basis   187316  2024-08-22 23:12:32 Z    1 days
Testing same since   187329  2024-08-23 19:06:11 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Adrian Moreno <amorenoz@redhat.com>
  Alexander Stein <alexander.stein@ew.tq-group.com>
  Alexandra Winter <wintera@linux.ibm.com>
  Alexandre Courbot <gnurou@gmail.com>
  Anders Roxell <anders.roxell@linaro.org>
  Arun Ramadoss <arun.ramadoss@microchip.com>
  Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
  Bharat Bhushan <bbhushan2@marvell.com>
  Carolina Jubran <cjubran@nvidia.com>
  Chandan Kumar Rout <chandanx.rout@intel.com> (A Contingent Worker at Intel)
  Corinna Vinschen <vinschen@redhat.com>
  Damien Le Moal <dlemoal@kernel.org>
  Dan Carpenter <dan.carpenter@linaro.org>
  David S. Miller <davem@davemloft.net>
  Dragos Tatulea <dtatulea@nvidia.com>
  Eric Dumazet <edumazet@google.com>
  Felix Fietkau <nbd@nbd.name>
  Florian Westphal <fw@strlen.de>
  Geliang Tang <geliang@kernel.org>
  Griffin Kroah-Hartman <griffin@kroah.com>
  Hangbin Liu <liuhangbin@gmail.com>
  Ido Schimmel <idosch@nvidia.com>
  Ioana Ciornei <ioana.ciornei@nxp.com>
  Jakub Kicinski <kuba@kernel.org>
  Jamal Hadi Salim <jhs@mojatatu.com>
  Jason Wang <jasowang@redhat.com>
  Javier Carrasco <javier.carrasco.cruz@gmail.com>
  Jeremy Kerr <jk@codeconstruct.com.au>
  Jiri Pirko <jiri@nvidia.com>
  Joseph Huang <Joseph.Huang@garmin.com>
  Kolbjørn Barmen <linux-ppc@kolla.no>
  Kuniyuki Iwashima <kuniyu@amazon.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  Maciej Fijalkowski <maciej.fijalkowski@intel.com>
  Marek Szyprowski <m.szyprowski@samsung.com>
  Martin Whitaker <foss@martin-whitaker.me.uk>
  Masahiro Yamada <masahiroy@kernel.org>
  Matthieu Baerts (NGI0) <matttbe@kernel.org>
  Menglong Dong <dongml2@chinatelecom.cn>
  Menglong Dong <menglong8.dong@gmail.com>
  Mengyuan Lou <mengyuanlou@net-swift.com>
  Michael Chan <michael.chan@broadcom.com>
  Michael Ellerman <mpe@ellerman.id.au>
  Michael S. Tsirkin <mst@redhat.com>
  Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
  Nikolay Aleksandrov <razor@blackwall.org>
  Nikolay Kuratov <kniv@yandex-team.ru>
  Pablo Neira Ayuso <pablo@netfilter.org>
  Paolo Abeni <pabeni@redhat.com>
  Patrisious Haddad <phaddad@nvidia.com>
  Pavan Chebbi <pavan.chebbi@broadcom.com>
  Peng Fan <peng.fan@nxp.com>
  Petr Machata <petrm@nvidia.com>
  Sabrina Dubroca <sd@queasysnail.net>
  Sava Jakovljev <savaj@meyersound.com>
  Sean Anderson <sean.anderson@linux.dev>
  Sebastian Andrzej Siewior <bigeasy@linutronix.de>
  Simon Horman <horms@kernel.org>
  Somnath Kotur <somnath.kotur@broadcom.com>
  Stephen Hemminger <stephen@networkplumber.org>
  syzbot+b72d86aa5df17ce74c60@syzkaller.appspotmail.com
  Tariq Toukan <tariqt@nvidia.com>
  Thomas Bogendoerfer <tbogendoerfer@suse.de>
  Tony Nguyen <anthony.l.nguyen@intel.com>
  Ulf Hansson <ulf.hansson@linaro.org>
  Vladimir Oltean <vladimir.oltean@nxp.com>
  Willem de Bruijn <willemb@google.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   872cf28b8df9c..3d5f968a177d4  3d5f968a177d468cd13568ef901c5be84d83d32b -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Sat Aug 24 19:23:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Aug 2024 19:23:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.782995.1192434 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shwLl-0005TK-La; Sat, 24 Aug 2024 19:23:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 782995.1192434; Sat, 24 Aug 2024 19:23:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shwLl-0005T9-Fx; Sat, 24 Aug 2024 19:23:01 +0000
Received: by outflank-mailman (input) for mailman id 782995;
 Sat, 24 Aug 2024 19:23:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shwLl-0005T0-5p; Sat, 24 Aug 2024 19:23:01 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shwLl-0008E5-4F; Sat, 24 Aug 2024 19:23:01 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shwLk-0005Qj-Mh; Sat, 24 Aug 2024 19:23:00 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shwLk-0002Xi-MA; Sat, 24 Aug 2024 19:23:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=1gEnrgA5JvkmGP2SGkEOs4qqF4tNRpjnxOLVx2YZf0E=; b=EBD9dvEsG2lIdDB3BWHrsqCj0H
	IywedM2B2WSV4kX6Q1crbMfZN8IxH+j+RGaFSiWxsak3uvFK5yNAsUGNbEO+aAOOD+8Xvp4lDZwAd
	jVjXaJxqh5oywwgdJkLiHlaIdhnXSSb6Xw7LY7tGrCALVQjbjN98xwzaUGmvJCFNbvUo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187332-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187332: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-libvirt:xen-boot:fail:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=95764a0817a51741b7ffb1f78cba2a19b08ab2d1
X-Osstest-Versions-That:
    xen=aa80a04df488528d90a0d892f0752571b1759e8b
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 24 Aug 2024 19:23:00 +0000

flight 187332 xen-unstable real [real]
flight 187335 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187332/
http://logs.test-lab.xenproject.org/osstest/logs/187335/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-libvirt      8 xen-boot            fail pass in 187335-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt 16 saverestore-support-check fail in 187335 like 187321
 test-armhf-armhf-libvirt    15 migrate-support-check fail in 187335 never pass
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187321
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187321
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187321
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187321
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187321
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  95764a0817a51741b7ffb1f78cba2a19b08ab2d1
baseline version:
 xen                  aa80a04df488528d90a0d892f0752571b1759e8b

Last test of basis   187321  2024-08-23 08:28:10 Z    1 days
Testing same since   187332  2024-08-24 08:02:27 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Andrii Sultanov <andrii.sultanov@cloud.com>
  Christian Lindig <christian.lindig@cloud.com>
  Fouad Hilly <fouad.hilly@cloud.com>
  Jan Beulich <jbeulich@suse.com>
  Michal Orzel <michal.orzel@amd.com>
  Victor Lira <victorm.lira@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     fail    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   aa80a04df4..95764a0817  95764a0817a51741b7ffb1f78cba2a19b08ab2d1 -> master


From xen-devel-bounces@lists.xenproject.org Sat Aug 24 20:40:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Aug 2024 20:40:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783019.1192484 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shxYK-0001eA-Ge; Sat, 24 Aug 2024 20:40:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783019.1192484; Sat, 24 Aug 2024 20:40:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1shxYK-0001dz-CE; Sat, 24 Aug 2024 20:40:04 +0000
Received: by outflank-mailman (input) for mailman id 783019;
 Sat, 24 Aug 2024 20:40:03 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shxYJ-0001P5-B2; Sat, 24 Aug 2024 20:40:03 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shxYJ-00019e-3g; Sat, 24 Aug 2024 20:40:03 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1shxYI-0007Ew-KG; Sat, 24 Aug 2024 20:40:02 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1shxYI-0001OG-Jm; Sat, 24 Aug 2024 20:40:02 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=z3sTzpKyPFynO++g0fkjXCBBhU+tXnrUO1JZz/0mCc4=; b=AP1YOx1Nd1DEdH0GmbsRk/B24u
	hABg6xGOixZJaJdtscxL3HzXIVh3uyw/aL9mRQHKfxy+G6htMbUbb0hBBHk3By56kmGZvCXbbqAhh
	D4ZFSseZtA7KEP8q3WigqF6o7crlxcmivsKMSAzZJL7LLDbRHDWSMr6hMoxoAW777BPE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187333-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187333: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-libvirt-vhd:leak-check/check:fail:heisenbug
    qemu-mainline:test-amd64-amd64-xl-credit1:debian-fixup:fail:heisenbug
    qemu-mainline:test-amd64-amd64-xl-credit2:guest-localmigrate/x10:fail:heisenbug
    qemu-mainline:test-armhf-armhf-xl-qcow2:leak-check/check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=407f9a4b121eb65166375c410e14d7b704bc1106
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 24 Aug 2024 20:40:02 +0000

flight 187333 qemu-mainline real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187333/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-libvirt-vhd 22 leak-check/check fail in 187319 pass in 187333
 test-amd64-amd64-xl-credit1  13 debian-fixup               fail pass in 187319
 test-amd64-amd64-xl-credit2  20 guest-localmigrate/x10     fail pass in 187319

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-qcow2    20 leak-check/check        fail baseline untested
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass

version targeted for testing:
 qemuu                407f9a4b121eb65166375c410e14d7b704bc1106
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  352 days
Failing since        182723  2023-09-07 18:19:05 Z  352 days   31 attempts
Testing same since   187309  2024-08-22 07:32:05 Z    2 days    3 attempts

------------------------------------------------------------
620 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  fail    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  fail    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 180820 lines long.)


From xen-devel-bounces@lists.xenproject.org Sun Aug 25 02:09:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Aug 2024 02:09:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783039.1192494 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1si2gc-0002Qj-My; Sun, 25 Aug 2024 02:08:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783039.1192494; Sun, 25 Aug 2024 02:08:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1si2gc-0002Qc-JR; Sun, 25 Aug 2024 02:08:58 +0000
Received: by outflank-mailman (input) for mailman id 783039;
 Sun, 25 Aug 2024 02:08:58 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1si2gc-0002QS-7Y; Sun, 25 Aug 2024 02:08:58 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1si2gc-00073R-13; Sun, 25 Aug 2024 02:08:58 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1si2gb-0001vD-9Z; Sun, 25 Aug 2024 02:08:57 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1si2gb-00052l-8u; Sun, 25 Aug 2024 02:08:57 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=lgLcfjxjfqe5sZBaEQFmpgVysKE8FehsBtaZqNzWLkI=; b=n211F1U7tKlPaRev/XCMMqoTSN
	qUQBQaUCv8PbJREawOvL/HE49XfNdl2gMKOnnkDHvx+HZGsHLB+10jhk0055ZQDj8vyQJf2qQf2kz
	R4Vr2B3eKz5i+7a89gCbLiKz03MyR3Jrh0OE3dfz3ACds3+1YCTJoHyiL6uV1bjgeaRs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187334-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187334: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=d2bafcf224f3911b183113b2fcb536c9e90684a3
X-Osstest-Versions-That:
    linux=3d5f968a177d468cd13568ef901c5be84d83d32b
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 25 Aug 2024 02:08:57 +0000

flight 187334 linux-linus real [real]
flight 187337 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187334/
http://logs.test-lab.xenproject.org/osstest/logs/187337/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 187337-retest

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187329
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187329
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187329
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187329
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187329
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187329
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                d2bafcf224f3911b183113b2fcb536c9e90684a3
baseline version:
 linux                3d5f968a177d468cd13568ef901c5be84d83d32b

Last test of basis   187329  2024-08-23 19:06:11 Z    1 days
Testing same since   187334  2024-08-24 11:46:04 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Abhinav Kumar <quic_abhinavk@quicinc.com>
  Alex Deucher <alexander.deucher@amd.com>
  Andy Shevchenko <andriy.shevchenko@linux.intel.com>
  Anna Schumaker <Anna.Schumaker@Netapp.com>
  Anthony Nandaa (Microsoft) <profnandaa@gmail.com>
  Ashutosh Dixit <ashutosh.dixit@intel.com>
  Ben Whitten <ben.whitten@gmail.com>
  Bommu Krishnaiah <krishnaiah.bommu@intel.com>
  Candice Li <candice.li@amd.com>
  Carlos Song <carlos.song@nxp.com>
  Catalin Marinas <catalin.marinas@arm.com>
  Chen Ridong <chenridong@huawei.com>
  ChenXiaoSong <chenxiaosong@kylinos.cn>
  Chuck Lever <chuck.lever@oracle.com>
  Dan Carpenter <dan.carpenter@linaro.org>
  Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
  Danilo Krummrich <dakr@kernel.org>
  Dave Airlie <airlied@redhat.com>
  Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
  Dmitry Baryshkov <dmitry.baryshkov@linaro.org> # SM8350-HDK
  Dmitry Torokhov <dmitry.torokhov@gmail.com>
  Felix Kaechele <felix@kaechele.ca>
  Geert Uytterhoeven <geert+renesas@glider.be>
  Hans de Goede <hdegoede@redhat.com>
  Jeff Layton <jlayton@kernel.org>
  Jens Axboe <axboe@kernel.dk>
  Jiaxun Yang <jiaxun.yang@flygoat.com>
  John Garry <john.g.garry@oracle.com>
  John Keeping <jkeeping@inmusicbrands.com>
  Jonathan Denose <jdenose@google.com>
  Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
  Keith Busch <kbusch@kernel.org>
  Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
  Lai Jiangshan <jiangshan.ljs@antgroup.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Lucas De Marchi <lucas.demarchi@intel.com>
  Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
  Maarten Lankhorst,,, <maarten.lankhorst@linux.intel.com>
  Marc Zyngier <maz@kernel.org>
  Marek Vasut <marex@denx.de>
  Mark Brown <broonie@kernel.org>
  Matt Roper <matthew.d.roper@intel.com>
  Matthew Auld <matthew.auld@intel.com>
  Matthew Brost <matthew.brost@intel.com>
  Mengqi Zhang <mengqi.zhang@mediatek.com>
  Ming Lei <ming.lei@redhat.com>
  Ngai-Mint Kwan <ngai-mint.kwan@linux.intel.com>
  Nikita Shubin <n.shubin@yadro.com>
  Nilay Shroff <nilay@linux.ibm.com>
  Nirmoy Das <nirmoy.das@intel.com>
  Oliver Upton <oliver.upton@linux.dev>
  Paulo Alcantara (Red Hat) <pc@manguebit.com>
  Paulo Alcantara <pc@manguebit.com>
  Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  Rob Clark <robdclark@chromium.org>
  Rob Clark <robdclark@gmail.com>
  Rodrigo Vivi <rodrigo.vivi@intel.com>
  Ruijing Dong <ruijing.dong@amd.com>
  Sean Anderson <sean.anderson@linux.dev>
  Serge Semin <fancer.lancer@gmail.com>
  Stephen Boyd <swboyd@chromium.org>
  Stephen Boyd <swboyd@chromium.org> # Trogdor.Lazor
  Steve French <stfrench@microsoft.com>
  Stuart Summers <stuart.summers@intel.com>
  Suraj Kandpal <suraj.kandpal@intel.com>
  Takashi Iwai <tiwai@suse.de>
  Tejas Upadhyay <tejas.upadhyay@intel.com>
  Tejun Heo <tj@kernel.org>
  Thomas Bogendoerfer <tsbogend@alpha.franken.de>
  Thomas Zimmermann <tzimmermann@suse.de>
  Trond Myklebust <trond.myklebust@hammerspace.com>
  Ulf Hansson <ulf.hansson@linaro.org>
  Uros Bizjak <ubizjak@gmail.com>
  Vignesh Raghavendra <vigneshr@ti.com>
  Waiman Long <longman@redhat.com>
  Werner Sembach <wse@tuxedocomputers.com>
  Will Deacon <will@kernel.org>
  Yang Ruibin <11162571@vivo.com>
  Yang Wang <kevinyang.wang@amd.com>
  Zenghui Yu <yuzenghui@huawei.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   3d5f968a177d4..d2bafcf224f39  d2bafcf224f3911b183113b2fcb536c9e90684a3 -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Sun Aug 25 05:01:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Aug 2024 05:01:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783051.1192503 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1si5N0-0005IE-6S; Sun, 25 Aug 2024 05:00:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783051.1192503; Sun, 25 Aug 2024 05:00:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1si5N0-0005I7-3n; Sun, 25 Aug 2024 05:00:54 +0000
Received: by outflank-mailman (input) for mailman id 783051;
 Sun, 25 Aug 2024 05:00:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1si5My-0005Hr-Pl; Sun, 25 Aug 2024 05:00:52 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1si5My-0002KY-Hi; Sun, 25 Aug 2024 05:00:52 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1si5My-0002y5-3i; Sun, 25 Aug 2024 05:00:52 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1si5My-0002xf-3K; Sun, 25 Aug 2024 05:00:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=lWIg+cW727WFheLZ98rrVw/h8UX4cmuXwPJILLyRvyc=; b=ZuN4iv+ULIMP7QZusI6lisZttA
	a6WA2QXufg3vvQ4ysJLx/Ah0dkSg340wDsroqpFDqq/IJCgX0nhQM8zQeJJ6/Fg8COYEN3b+QyFNl
	i5u9A+4LB3qV7P+ENvnLIN2ln6Huf/jBEcBekXKCw+Hwvjcj0JO1mdXbQeHBlptzE+Ec=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187336-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187336: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-xl-credit1:debian-fixup:fail:heisenbug
    qemu-mainline:test-amd64-amd64-xl-credit2:guest-localmigrate/x10:fail:heisenbug
    qemu-mainline:test-amd64-amd64-libvirt-vhd:leak-check/check:fail:heisenbug
    qemu-mainline:test-armhf-armhf-xl-qcow2:leak-check/check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=407f9a4b121eb65166375c410e14d7b704bc1106
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 25 Aug 2024 05:00:52 +0000

flight 187336 qemu-mainline real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187336/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-credit1  13 debian-fixup     fail in 187333 pass in 187336
 test-amd64-amd64-xl-credit2 20 guest-localmigrate/x10 fail in 187333 pass in 187336
 test-amd64-amd64-libvirt-vhd 22 leak-check/check           fail pass in 187333

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-qcow2 20 leak-check/check fail in 187333 baseline untested
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass

version targeted for testing:
 qemuu                407f9a4b121eb65166375c410e14d7b704bc1106
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  353 days
Failing since        182723  2023-09-07 18:19:05 Z  352 days   32 attempts
Testing same since   187309  2024-08-22 07:32:05 Z    2 days    4 attempts

------------------------------------------------------------
620 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 180820 lines long.)


From xen-devel-bounces@lists.xenproject.org Sun Aug 25 10:14:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Aug 2024 10:14:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783103.1192514 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siAG2-0003uE-MX; Sun, 25 Aug 2024 10:14:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783103.1192514; Sun, 25 Aug 2024 10:14:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siAG2-0003u7-Jr; Sun, 25 Aug 2024 10:14:02 +0000
Received: by outflank-mailman (input) for mailman id 783103;
 Sun, 25 Aug 2024 10:14:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siAG1-0003tx-1p; Sun, 25 Aug 2024 10:14:01 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siAG0-0008QV-L1; Sun, 25 Aug 2024 10:14:00 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siAG0-0007yf-0r; Sun, 25 Aug 2024 10:14:00 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1siAG0-0004Ci-0H; Sun, 25 Aug 2024 10:14:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=nBw0jIJlO+f0puoTYf589eVVDfn84H/bkSOkmii0jbE=; b=GB9+v3B28F0/mXjI/JpfwtHAPH
	YXshoYz7sKGnwa5g31bsS3K7qt621B5NbFV1Qwu0i0kix3yV1u66Oz/j7tiJhiZG//JrHTNTdlTRi
	rg+NuHIUMnwjCuqCNxSN+WEA9F69IRhmZMeqaUXzzynAgFaxySM8g3o1Ec2iWLJSp/Nk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187338-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187338: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=95764a0817a51741b7ffb1f78cba2a19b08ab2d1
X-Osstest-Versions-That:
    xen=95764a0817a51741b7ffb1f78cba2a19b08ab2d1
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 25 Aug 2024 10:14:00 +0000

flight 187338 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187338/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt   16 saverestore-support-check fail blocked in 187332
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187332
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187332
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187332
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187332
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187332
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  95764a0817a51741b7ffb1f78cba2a19b08ab2d1
baseline version:
 xen                  95764a0817a51741b7ffb1f78cba2a19b08ab2d1

Last test of basis   187338  2024-08-25 01:52:06 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Sun Aug 25 11:33:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Aug 2024 11:33:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783122.1192524 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siBUl-0008Iu-B6; Sun, 25 Aug 2024 11:33:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783122.1192524; Sun, 25 Aug 2024 11:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siBUl-0008In-82; Sun, 25 Aug 2024 11:33:19 +0000
Received: by outflank-mailman (input) for mailman id 783122;
 Sun, 25 Aug 2024 11:33:18 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=DkcR=PY=linutronix.de=tglx@srs-se1.protection.inumbo.net>)
 id 1siBUk-0008Ih-IJ
 for xen-devel@lists.xenproject.org; Sun, 25 Aug 2024 11:33:18 +0000
Received: from galois.linutronix.de (galois.linutronix.de
 [2a0a:51c0:0:12e:550::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d13436a3-62d5-11ef-8776-851b0ebba9a2;
 Sun, 25 Aug 2024 13:33:15 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d13436a3-62d5-11ef-8776-851b0ebba9a2
From: Thomas Gleixner <tglx@linutronix.de>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020; t=1724585594;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=traTpRXPEY3SvX85V4UNHLV9avrLQDajKAbi9KW9Mas=;
	b=qn2bhicOfVHkdU7ck2v9tQF6W6WaJTXtqZEiWMHDfSL0Ev8o4KvGgHaALZgsyIAuFmttgs
	z5VnO+/6JY/fpXdhsiJya6hJDEm92zNzekboN60EFMExyIDu4ptFxzhH4F3Ic/cIAkD5Z3
	eTpykbtlXrP26a2G14buyr1ILLvcF3Fwjw+fU4Ds0yx9zmYL070XfvOjMbFbx0+G7GP/qN
	QWk0cMlQW6lVQzcayW3GOUwF4N5MKvBs+rCVlIVgoMHKGRHCRYdZj9qmfE8WafyxZ6YmSX
	+njM55adqgFTMeTO5hcBsEL9u4XGST4sctn9iwM/3LHcUT2tKJnm1xD+iixu3g==
DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de;
	s=2020e; t=1724585594;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=traTpRXPEY3SvX85V4UNHLV9avrLQDajKAbi9KW9Mas=;
	b=362fE7OT8P33AoXzNCnYkmiiNxEZ9GS9ZEvhn7ufxaWm1AsSruiz/SNKSgf7TwmCNyijB9
	4r4ytqAeRlb3O+Cg==
To: Christoph Hellwig <hch@lst.de>, iommu@lists.linux.dev
Cc: Marek Szyprowski <m.szyprowski@samsung.com>, Robin Murphy
 <robin.murphy@arm.com>, Sakari Ailus <sakari.ailus@linux.intel.com>,
 Bingbu Cao <bingbu.cao@intel.com>, "Michael S . Tsirkin" <mst@redhat.com>,
 Jason Wang <jasowang@redhat.com>, linux-kernel@vger.kernel.org,
 linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org,
 linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
 sparclinux@vger.kernel.org, linux-media@vger.kernel.org,
 virtualization@lists.linux.dev, xen-devel@lists.xenproject.org
Subject: Re: [PATCH] dma-mapping: clear mark DMA ops as an architecture feature
In-Reply-To: <20240824035817.1163502-2-hch@lst.de>
References: <20240824035817.1163502-1-hch@lst.de>
 <20240824035817.1163502-2-hch@lst.de>
Date: Sun, 25 Aug 2024 13:33:13 +0200
Message-ID: <87ed6cg7ly.ffs@tglx>
MIME-Version: 1.0
Content-Type: text/plain

On Sat, Aug 24 2024 at 05:57, Christoph Hellwig wrote:
> DMA ops are a helper for architectures and not for drivers to override
> the DMA implementation.  Unfortunately driver authors keep ignoring
> this.  Make this more clear by renaming the symbol to ARCH_DMA_OPS,
> have the three drivers overriding it depend on that.  They should
> probably also be marked broken, but we can give them a bit of a grace
> period for that.

One week :)

> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>


From xen-devel-bounces@lists.xenproject.org Sun Aug 25 15:55:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Aug 2024 15:55:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783174.1192534 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siFZz-0007LD-C4; Sun, 25 Aug 2024 15:54:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783174.1192534; Sun, 25 Aug 2024 15:54:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siFZz-0007L6-99; Sun, 25 Aug 2024 15:54:59 +0000
Received: by outflank-mailman (input) for mailman id 783174;
 Sun, 25 Aug 2024 15:54:57 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siFZx-0007Kw-9f; Sun, 25 Aug 2024 15:54:57 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siFZx-0005mD-2O; Sun, 25 Aug 2024 15:54:57 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siFZw-00080u-9X; Sun, 25 Aug 2024 15:54:56 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1siFZw-00072f-8o; Sun, 25 Aug 2024 15:54:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=2aPt0rYghd0r+YpQVNUCPdixWwAr3zThPO73uuTgCmc=; b=076HWjH7RKgbLpozNKmmRzI3bU
	jLpXJEB9D9wx7fypbykJMagGORcnUtX9LBS6WM91lRvR7KZ2lF54O4VECwFWqpEOIr4sEYq7U/Sly
	yhjrPyFBic9S52ITumObEGyvNtbvF02VG6qDPNQozSGXKHE8P0w/wtMt80qmgXF1hb3w=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187339-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187339: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-pvhv2-intel:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-amd64:guest-localmigrate/x10:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-raw:debian-di-install:fail:heisenbug
    linux-linus:test-amd64-amd64-xl-rtds:guest-localmigrate/x10:fail:allowable
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=780bdc1ba77646c3461f1988b12c42c60f836d77
X-Osstest-Versions-That:
    linux=d2bafcf224f3911b183113b2fcb536c9e90684a3
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 25 Aug 2024 15:54:56 +0000

flight 187339 linux-linus real [real]
flight 187341 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187339/
http://logs.test-lab.xenproject.org/osstest/logs/187341/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-pvhv2-intel 20 guest-localmigrate/x10 fail pass in 187341-retest
 test-amd64-amd64-xl-qemut-debianhvm-amd64 18 guest-localmigrate/x10 fail pass in 187341-retest
 test-armhf-armhf-xl-raw      12 debian-di-install   fail pass in 187341-retest

Regressions which are regarded as allowable (not blocking):
 test-amd64-amd64-xl-rtds     20 guest-localmigrate/x10   fail REGR. vs. 187334

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-raw     14 migrate-support-check fail in 187341 never pass
 test-armhf-armhf-xl-raw 15 saverestore-support-check fail in 187341 never pass
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187334
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187334
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187334
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187334
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187334
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187334
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                780bdc1ba77646c3461f1988b12c42c60f836d77
baseline version:
 linux                d2bafcf224f3911b183113b2fcb536c9e90684a3

Last test of basis   187334  2024-08-24 11:46:04 Z    1 days
Testing same since   187339  2024-08-25 02:12:32 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Alexander Gordeev <agordeev@linux.ibm.com>
  Amit Pundir <amit.pundir@linaro.org>
  Chaotian Jing <chaotian.jing@mediatek.com>
  ChenXiaoSong <chenxiaosong@kylinos.cn>
  Chris Bainbridge <chris.bainbridge@gmail.com>
  Harald Freudenberger <freude@linux.ibm.com>
  John Garry <john.g.garry@oracle.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
  Martin K. Petersen <martin.petersen@oracle.com>
  Namjae Jeon <linkinjeon@kernel.org>
  Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
  Simon Horman <horms@kernel.org>
  Steve French <stfrench@microsoft.com>
  Vasily Gorbik <gor@linux.ibm.com>
  Yihang Li <liyihang9@huawei.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    fail    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              fail    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      fail    
 test-amd64-amd64-xl-rtds                                     fail    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   d2bafcf224f39..780bdc1ba7764  780bdc1ba77646c3461f1988b12c42c60f836d77 -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Sun Aug 25 18:03:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Aug 2024 18:03:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783193.1192544 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siHaX-0003Mm-EO; Sun, 25 Aug 2024 18:03:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783193.1192544; Sun, 25 Aug 2024 18:03:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siHaX-0003Mf-Bo; Sun, 25 Aug 2024 18:03:41 +0000
Received: by outflank-mailman (input) for mailman id 783193;
 Sun, 25 Aug 2024 18:03:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ElmV=PY=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1siHaV-0003MX-EQ
 for xen-devel@lists.xenproject.org; Sun, 25 Aug 2024 18:03:39 +0000
Received: from NAM10-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam10on2060e.outbound.protection.outlook.com
 [2a01:111:f403:2412::60e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5923c29d-630c-11ef-a50b-bb4a2ccca743;
 Sun, 25 Aug 2024 20:03:37 +0200 (CEST)
Received: from BY1P220CA0004.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:59d::15)
 by CH0PR12MB8552.namprd12.prod.outlook.com (2603:10b6:610:18e::9)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Sun, 25 Aug
 2024 18:03:29 +0000
Received: from SJ5PEPF000001CE.namprd05.prod.outlook.com
 (2603:10b6:a03:59d:cafe::ad) by BY1P220CA0004.outlook.office365.com
 (2603:10b6:a03:59d::15) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24 via Frontend
 Transport; Sun, 25 Aug 2024 18:03:29 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SJ5PEPF000001CE.mail.protection.outlook.com (10.167.242.38) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Sun, 25 Aug 2024 18:03:28 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sun, 25 Aug
 2024 13:03:28 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sun, 25 Aug
 2024 13:03:27 -0500
Received: from [172.20.142.25] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Sun, 25 Aug 2024 13:03:26 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5923c29d-630c-11ef-a50b-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=X3WGYEiRDFbOtAwiyqrBBToL/QqAUHLfeutGTmq5GmrKR66Svnj/QIy2Ezm0DpLhroMYfxvDiQZYcCOIx0Pg4uLPGgLOidF/kXD9/hgNN2jGaKh20MBrygUWpW1ZM+HSlM43q3ehzpc38IeGtEjom4AYT08lUHitPxS9N3Vyc3svqOGXgjZxw/9rFrRXikYVWanXUzSEA0Sqg4l89mDQGEwTI5JP/t3wN2j0Bp5pETyANpl5gb6O32TZ13916qoMr4iHNHZPftu7EHmEMNVzeX+oyfWUM7CZhYcw1spOpyueks4Ex5rO2kYfAIuNeOpVHl2iSKWucfLjrL3L+zT1/Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=EbzNDj1Z9NQ0MfA/byv5edJIS37uK2LeuyIBCwbsJPc=;
 b=rPp3kdh3yTERgSKwZ6AIioW40jdyxBqOftWK04HhQxmctkvuoS5RGU4A8rrhuHjK54IR56R1d4Dcyr2tc826D2YHHxlTo/R6r+FcH1CG5Os8SJn8Fx7+Ux5gij9q3vtbuXW4kzzvUWKpX58GX2yBhE7/IzpOl7Cyl7Fw6g0yvrArJ3OCTC70gJCKQaTu1AsZicDxMKjqSSOk4bU7dEreJ8w8aBS/1c8xLD76cDUcRr5jwMWIjh0gPSNbL+nTm2Jw39JjgX3da51Hw0PkKOgxi4mGuSNQoSkGJKEKSypAygvrSYjYsDWONEneUhYAvf1oeroGUkiiFOtoZ+t9GsVYSw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=EbzNDj1Z9NQ0MfA/byv5edJIS37uK2LeuyIBCwbsJPc=;
 b=Ean88dsjH2xgSyXP40JWkL6pYP0iy6Cp6WChNG9ORoXznWxj3FPrkrrWEKjAIHRZKeIwR2dgxsZyngabjpUreTjLj1LEUF0TewQO4/v4xcZ+mvfpvgF9AnBUWvC82U0+6v6pgQOMsgFsRwoeZrc0RVU4O8vjmeH5ftCaioLOOoo=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <f59539c4-0444-4644-a522-ea33fb2b4dbe@amd.com>
Date: Sun, 25 Aug 2024 14:03:26 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/msi: fix locking for SR-IOV devices
To: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Teddy Astie
	<teddy.astie@vates.tech>, <xen-devel@lists.xenproject.org>
References: <20240812203938.981588-1-stewart.hildebrand@amd.com>
 <74f88a45-a632-4ca6-9cee-95f52370b397@suse.com>
Content-Language: en-US
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
In-Reply-To: <74f88a45-a632-4ca6-9cee-95f52370b397@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB05.amd.com: stewart.hildebrand@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001CE:EE_|CH0PR12MB8552:EE_
X-MS-Office365-Filtering-Correlation-Id: 30d74c98-d69c-4241-affc-08dcc530393f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|376014|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?aWx0WG5FSWY0MHk1cFV5Y1pjTzlESXl0RzdsSnNxejhEb3JRNm5RajVsc0Nv?=
 =?utf-8?B?akFRdnJ6UmgwVGUyOGZHSTV3cWZ2V1hwMW05RjZXZW9XNU1MSGV0UWphTUI4?=
 =?utf-8?B?R25ibkxaVlhhQWNEZGs1U2Vld1EwOTU4S0hXVDlJZXFTblNFcWZ3a0dwbHYx?=
 =?utf-8?B?cGNYMU03V25XMitjMUlmc3NIWTB1YklEakZ1Z1BRTzNpeVZVR0dHS3dxa1Iz?=
 =?utf-8?B?M21QVDg1Rk45Sml0L1NOazlJSFUyVzhSK1JLR3pSdllqU3kxUHd5U0c1N21n?=
 =?utf-8?B?VGNuSmhrSGN2Q3g1M21CYjdtaTl4cXVKamViUE5YdEgzaytUclZYOFJLV1Js?=
 =?utf-8?B?MTNTNHJjRVhPL2pMclZXcDFQODdkamsvMGdqcGFNUWVLUnJsL2ZCZXZRSjdi?=
 =?utf-8?B?ZE5MNXZwVFdYTDZrRlYvQzgrd1ZvUHRDVWtwQXY4ZWpDV2VDcExiZjFGdlpC?=
 =?utf-8?B?RjVMR3JQTkMxM25WaHpzWllqRFRlbklOTSt1MldYak1ja3JyaWRFRnNDbkxi?=
 =?utf-8?B?ejE5YkVpc0RLNU5rTmdvNnBOUFBvTnpJQTR5UFM5aVlrZXg1TG4wYzhoT1Nw?=
 =?utf-8?B?TndSa1FjQzFUcDlQM1IwV3FONlZGa0NOV0RtT0o0QVN4RkRmN2tuY3YrejhX?=
 =?utf-8?B?QVUrNWxMN2Q4bEF2WS9OT2ZrRmZOeC9CYXNpN3ZIajM2RmhTRHpkNzZTQ1lW?=
 =?utf-8?B?enkvcGJFWHhub05kbnMwQ093dTIrK0dyNUVBSXJNSDArd0d1SHJDeFBjdDNB?=
 =?utf-8?B?cFNRZk5RanREeFJnNGFTVko3NTU3Zy9UTm5VQzJPWXdkK1J4VTc5TVd0SVl4?=
 =?utf-8?B?R2tObDhlWXA1TExxWFdZeGExdnRDRldRM0dpTXhya3FrekFxa0tJYkt4Ynh5?=
 =?utf-8?B?c1ZwUjZXNkRpTjc5ZGx6RGlwK1d0aU9DcVY3WmZGWnRBdHJLTmF6Z2QwTWda?=
 =?utf-8?B?b2tsdkY0RUl5TVlYNmxNaFJUZ3JwUDRrZFVaa3ZrWm5ZbHZ5RWFhZk9pVjFw?=
 =?utf-8?B?a1dIZzczVGYrUjV3LzAwcVFRWSsyNHROVHc3TEp5bWp0d05ZeHpYNkpoV1Nx?=
 =?utf-8?B?NWJiaDllQy9xYXEzTVpxNmJIeFBkZW9jTEM4ckw0eDRJRmJHWlVaQVpxOTFs?=
 =?utf-8?B?UjRzN093OEhuYTE5RnlXVVRuZkhnTEJFVTMycCt1ZTdJekd5Yk1IeExhYlVQ?=
 =?utf-8?B?Znk5ZlRYUkZiU0Q2M1lhbkhDZ0EycHVtR2hpbHhRT25JaXI3WVhXSXRFYWxF?=
 =?utf-8?B?RHIzTGJyanhzdU1BcDNUcFc2dlVsNUdSb2V2MmtHMTNmOVNNRHFMMm55K2lS?=
 =?utf-8?B?YXpOWHJ1ZjkzU2pud05vYVRhdHNpMy9zS0MvWE4vckw2Y0RXQVZZanJjWHRY?=
 =?utf-8?B?VG01bk1KR2FPR0VsVXM3L09TT2F6NVhtOWlMVUFjNHZxODkvMVg5Rk9mYUJ0?=
 =?utf-8?B?QTd5dXoySGNqc2wwQ1Z4alZBWCtPUkFIK0RObXRQNUhQTDJXblIyNkZjdHVY?=
 =?utf-8?B?Rng0Y0FNdWVFVkJ0bjBaTVUxaVdaZlhFOE5pZGNLNXAvaW54NWFzaFBCNzA3?=
 =?utf-8?B?MkRzSjQ0THZyMWpKUTJsLzlOcy9mT3lLVlUrWE9CdnpkanFVWE5oK3pSUHhm?=
 =?utf-8?B?N0VDZEFGSTRVRi9vdzdPbXlkelVUaU42bXNEZmxwRDA4RHFTRjhjRWcrY3c1?=
 =?utf-8?B?M25tcWdjVXhRSHFXbzR0bCs5M2VCUzdLZEY3dXZLdlRxMFRjaHpiMTQwRDNU?=
 =?utf-8?B?WU04VzVvWEJ4QmR5cUV3aVpvM1paT1pzd1VDMFdwbmVtMnhkZ3RJa3ZkRnZH?=
 =?utf-8?B?UTlNT0V0SUFPM2o3T3Z4TVZVVW9jNWVGZ1hMZHRaZDQ3VFBFcUhsQ0RXUkNu?=
 =?utf-8?B?eGR5NWxqcnFNTTVQaWNGdWg1ejBZT0Nhcmh6UmQvbkFjdWRsY3VqWndUVTYw?=
 =?utf-8?Q?or3nNoeGG/4jQ3010m+45zKgkGlecvZ6?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2024 18:03:28.7626
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 30d74c98-d69c-4241-affc-08dcc530393f
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF000001CE.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB8552

On 8/13/24 10:01, Jan Beulich wrote:
> On 12.08.2024 22:39, Stewart Hildebrand wrote:
>> In commit 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci
>> structure") a lock moved from allocate_and_map_msi_pirq() to the caller
>> and changed from pcidevs_lock() to read_lock(&d->pci_lock). However, one
>> call path wasn't updated to reflect the change, leading to a failed
>> assertion observed under the following conditions:
>>
>> * PV dom0
>> * Debug build (debug=y) of Xen
>> * There is an SR-IOV device in the system with one or more VFs enabled
>> * Dom0 has loaded the driver for the VF and enabled MSI-X
>>
>> (XEN) Assertion 'd || pcidevs_locked()' failed at drivers/passthrough/pci.c:535
>> (XEN) ----[ Xen-4.20-unstable  x86_64  debug=y  Not tainted ]----
>> ...
>> (XEN) Xen call trace:
>> (XEN)    [<ffff82d040284da8>] R pci_get_pdev+0x4c/0xab
>> (XEN)    [<ffff82d040344f5c>] F arch/x86/msi.c#read_pci_mem_bar+0x58/0x272
>> (XEN)    [<ffff82d04034530e>] F arch/x86/msi.c#msix_capability_init+0x198/0x755
>> (XEN)    [<ffff82d040345dad>] F arch/x86/msi.c#__pci_enable_msix+0x82/0xe8
>> (XEN)    [<ffff82d0403463e5>] F pci_enable_msi+0x3f/0x78
>> (XEN)    [<ffff82d04034be2b>] F map_domain_pirq+0x2a4/0x6dc
>> (XEN)    [<ffff82d04034d4d5>] F allocate_and_map_msi_pirq+0x103/0x262
>> (XEN)    [<ffff82d04035da5d>] F physdev_map_pirq+0x210/0x259
>> (XEN)    [<ffff82d04035e798>] F do_physdev_op+0x9c3/0x1454
>> (XEN)    [<ffff82d040329475>] F pv_hypercall+0x5ac/0x6af
>> (XEN)    [<ffff82d0402012d3>] F lstar_enter+0x143/0x150
>>
>> In read_pci_mem_bar(), the VF obtains the struct pci_dev pointer for its
>> associated PF to access the vf_rlen array. This array is initialized in
>> pci_add_device() and is only populated in the associated PF's struct
>> pci_dev.
>>
>> Add a link from the VF's struct pci_dev to the associated PF struct
>> pci_dev, ensuring the PF's struct doesn't get deallocated until all its
>> VFs have gone away. Access the vf_rlen array via the new link to the PF,
>> and remove the troublesome call to pci_get_pdev().
>>
>> Add a call to pci_get_pdev() inside the pcidevs_lock()-locked section of
>> pci_add_device() to set up the link from VF to PF. In case the new
>> pci_add_device() invocation fails to find the associated PF (returning
>> NULL), we are no worse off than before: read_pci_mem_bar() will still
>> return 0 in that case.
>>
>> Note that currently the only way for Xen to know if a device is a VF is
>> if the toolstack tells Xen about it. Using PHYSDEVOP_manage_pci_add for
>> a VF is not a case that Xen handles.
> 
> How does the toolstack come into play here? It's still the Dom0 kernel to
> tell Xen, via PHYSDEVOP_pci_device_add (preferred) or
> PHYSDEVOP_manage_pci_add_ext (kind of deprecated; PHYSDEVOP_manage_pci_add
> is even more kind of deprecated).

This last bit of the commit description isn't adding much, I'll remove
it.

>> --- a/xen/arch/x86/msi.c
>> +++ b/xen/arch/x86/msi.c
>> @@ -662,34 +662,32 @@ static int msi_capability_init(struct pci_dev *dev,
>>      return 0;
>>  }
>>  
>> -static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
>> +static u64 read_pci_mem_bar(struct pf_info *pf_info, u16 seg, u8 bus, u8 slot,
>> +                            u8 func, u8 bir, int vf)
>>  {
>> +    pci_sbdf_t sbdf = PCI_SBDF(seg, bus, slot, func);
>>      u8 limit;
>>      u32 addr, base = PCI_BASE_ADDRESS_0;
>>      u64 disp = 0;
>>  
>>      if ( vf >= 0 )
>>      {
>> -        struct pci_dev *pdev = pci_get_pdev(NULL,
>> -                                            PCI_SBDF(seg, bus, slot, func));
>>          unsigned int pos;
>>          uint16_t ctrl, num_vf, offset, stride;
>>  
>> -        if ( !pdev )
>> -            return 0;
>> -
>> -        pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_SRIOV);
>> -        ctrl = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_CTRL);
>> -        num_vf = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_NUM_VF);
>> -        offset = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_OFFSET);
>> -        stride = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_STRIDE);
>> +        pos = pci_find_ext_capability(sbdf, PCI_EXT_CAP_ID_SRIOV);
>> +        ctrl = pci_conf_read16(sbdf, pos + PCI_SRIOV_CTRL);
>> +        num_vf = pci_conf_read16(sbdf, pos + PCI_SRIOV_NUM_VF);
>> +        offset = pci_conf_read16(sbdf, pos + PCI_SRIOV_VF_OFFSET);
>> +        stride = pci_conf_read16(sbdf, pos + PCI_SRIOV_VF_STRIDE);
>>  
>>          if ( !pos ||
>>               !(ctrl & PCI_SRIOV_CTRL_VFE) ||
>>               !(ctrl & PCI_SRIOV_CTRL_MSE) ||
>>               !num_vf || !offset || (num_vf > 1 && !stride) ||
>>               bir >= PCI_SRIOV_NUM_BARS ||
>> -             !pdev->vf_rlen[bir] )
>> +             !pf_info ||
> 
> See further down - I think it would be nice if we didn't need this new
> check.

OK

>> @@ -813,6 +811,7 @@ static int msix_capability_init(struct pci_dev *dev,
>>          int vf;
>>          paddr_t pba_paddr;
>>          unsigned int pba_offset;
>> +        struct pf_info *pf_info = NULL;
> 
> Pointer-to-const?

OK

>> @@ -827,9 +826,12 @@ static int msix_capability_init(struct pci_dev *dev,
>>              pslot = PCI_SLOT(dev->info.physfn.devfn);
>>              pfunc = PCI_FUNC(dev->info.physfn.devfn);
>>              vf = dev->sbdf.bdf;
>> +            if ( dev->virtfn.pf_pdev )
>> +                pf_info = &dev->virtfn.pf_pdev->physfn;
>>          }
>>  
>> -        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
>> +        table_paddr = read_pci_mem_bar(pf_info, seg, pbus, pslot, pfunc, bir,
>> +                                       vf);
> 
> I don't think putting the new arg first is very nice. SBDF should remain
> first imo. Between the latter arguments I'm not as fussed.

OK

>> @@ -446,7 +448,27 @@ static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
>>  
>>      list_del(&pdev->alldevs_list);
>>      pdev_msi_deinit(pdev);
>> -    xfree(pdev);
>> +
>> +    if ( pdev->info.is_virtfn )
>> +    {
>> +        struct pci_dev *pf_pdev = pdev->virtfn.pf_pdev;
>> +
>> +        if ( pf_pdev )
>> +        {
>> +            list_del(&pdev->virtfn.next);
>> +            if ( pf_pdev->physfn.dealloc_pending &&
>> +                 list_empty(&pf_pdev->physfn.vf_list) )
>> +                xfree(pf_pdev);
>> +        }
>> +        xfree(pdev);
>> +    }
>> +    else
>> +    {
>> +        if ( list_empty(&pdev->physfn.vf_list) )
>> +            xfree(pdev);
>> +        else
>> +            pdev->physfn.dealloc_pending = true;
>> +    }
> 
> Could I talk you into un-indenting the last if/else by a level, by making
> the earlier else and "else if()"?

Yep. Actually, there will be no need for dealloc_pending after reworking
pci_remove_device() (see below).

> One aspect I didn't properly consider when making the suggestion: What if,
> without all VFs having gone away, the PF is re-added? In that case we
> would better recycle the existing structure. That's getting a little
> complicated, so maybe a better approach is to refuse the request (in
> pci_remove_device()) when the list isn't empty?

I set up a test case locally to remove a PF without removing the
associated VFs by hacking an SR-IOV PF driver. Although the PF driver
*should* remove the VFs first, it's completely up to the particular PF
driver how VFs/PFs are removed during hot-un-plug, in what order, or
whether at all to remove the VFs before removing the PF. Anyway, during
PF-only removal, at least the Linux PCI subsystem warns about it:

[  106.500334] igb 0000:01:00.0: driver left SR-IOV enabled after remove

Returning an error code in pci_remove_device() results in only a warning
from Linux:

[  106.507011] pci 0000:01:00.0: Failed to delete - passthrough or MSI/MSI-X might fail!

Despite the warning, Linux still proceeds to remove the PF, and we would
retain a stale PF in Xen. Re-adding (hotplugging) the just-removed PF
led to Xen crashing in another weird way.

To handle this more gracefully, I suggest removing the VFs right away
along with the PF in pci_remove_device() when a PF removal request comes
along. This would satisfy the test case described here without Xen
crashing.

>> @@ -700,10 +722,22 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>>           * extended function.
>>           */
>>          if ( pdev->info.is_virtfn )
>> +        {
>> +            struct pci_dev *pf_pdev;
>> +
>>              pdev->info.is_extfn = pf_is_extfn;
>> +            pf_pdev = pci_get_pdev(NULL,
>> +                                   PCI_SBDF(seg, info->physfn.bus,
>> +                                            info->physfn.devfn));
>> +            if ( pf_pdev )
>> +            {
>> +                pdev->virtfn.pf_pdev = pf_pdev;
>> +                list_add(&pdev->virtfn.next, &pf_pdev->physfn.vf_list);
>> +            }
>> +        }
> 
> Hmm, yes, we can't really use the result of the earlier pci_get_pdev(), as
> we drop the lock intermediately. I wonder though if we wouldn't better fail
> the function if we can't find the PF instance.

Yes

>> --- a/xen/include/xen/pci.h
>> +++ b/xen/include/xen/pci.h
>> @@ -150,7 +150,17 @@ struct pci_dev {
>>          unsigned int count;
>>  #define PT_FAULT_THRESHOLD 10
>>      } fault;
>> -    u64 vf_rlen[6];
>> +    struct pf_info {
>> +        /* Only populated for PFs (info.is_virtfn == false) */
>> +        uint64_t vf_rlen[PCI_SRIOV_NUM_BARS];
>> +        struct list_head vf_list;             /* List head */
>> +        bool dealloc_pending;
>> +    } physfn;
>> +    struct {
>> +        /* Only populated for VFs (info.is_virtfn == true) */
>> +        struct pci_dev *pf_pdev;              /* Link from VF to PF */
>> +        struct list_head next;                /* Entry in vf_list */
> 
> For doubly-linked lists "next" isn't really a good name. Since both struct
> variants need such a member, why not use vf_list uniformly?

I'd like to retain some distinction between what's a list head and
what's an entry in the list. I suggest the name "entry".

> That'll then
> also lower the significance of my other question:
> 
>> +    } virtfn;
> 
> Should the two new struct-s perhaps be a union?

Yes


From xen-devel-bounces@lists.xenproject.org Sun Aug 25 20:18:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Aug 2024 20:18:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783211.1192554 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siJgn-0008LH-Pu; Sun, 25 Aug 2024 20:18:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783211.1192554; Sun, 25 Aug 2024 20:18:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siJgn-0008LA-Mv; Sun, 25 Aug 2024 20:18:17 +0000
Received: by outflank-mailman (input) for mailman id 783211;
 Sun, 25 Aug 2024 20:18:16 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siJgm-0008L0-Iy; Sun, 25 Aug 2024 20:18:16 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siJgm-0002JH-9r; Sun, 25 Aug 2024 20:18:16 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siJgl-0000yf-R1; Sun, 25 Aug 2024 20:18:15 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1siJgl-0002yg-QY; Sun, 25 Aug 2024 20:18:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=79hR8esWNSAuXwpXI72FOjDzsWknQEKsLClpDTxtoJk=; b=TFTZ6ipA5YAj1i7WeiM0wDepSm
	lHt9KgntuV56exPxu8pYLIK5VezJtqVxF2g9D2WuaaQx7q/s2msc8DEW5rJkE43XIeOXNSH/C2VdX
	2hMy0vb5e2TeToL9vukzb6M8GJTjMex4x/pusdaVdSqioHmjlA1papgZrAx8hSTcXN5E=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187340-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187340: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-libvirt-vhd:leak-check/check:fail:heisenbug
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=f259e4cb8a8b4ef5463326fc214a7d8d7703d5de
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 25 Aug 2024 20:18:15 +0000

flight 187340 qemu-mainline real [real]
flight 187343 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187340/
http://logs.test-lab.xenproject.org/osstest/logs/187343/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-libvirt-vhd 22 leak-check/check    fail pass in 187343-retest

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass

version targeted for testing:
 qemuu                f259e4cb8a8b4ef5463326fc214a7d8d7703d5de
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  353 days
Failing since        182723  2023-09-07 18:19:05 Z  353 days   33 attempts
Testing same since   187340  2024-08-25 05:05:28 Z    0 days    1 attempts

------------------------------------------------------------
621 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 180913 lines long.)


From xen-devel-bounces@lists.xenproject.org Sun Aug 25 22:52:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 25 Aug 2024 22:52:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783225.1192563 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siM5R-0007g2-9O; Sun, 25 Aug 2024 22:51:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783225.1192563; Sun, 25 Aug 2024 22:51:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siM5R-0007fv-6f; Sun, 25 Aug 2024 22:51:53 +0000
Received: by outflank-mailman (input) for mailman id 783225;
 Sun, 25 Aug 2024 22:51:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siM5P-0007fl-Uj; Sun, 25 Aug 2024 22:51:51 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siM5P-0005Ax-Ib; Sun, 25 Aug 2024 22:51:51 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siM5P-000798-3T; Sun, 25 Aug 2024 22:51:51 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1siM5P-0003oB-30; Sun, 25 Aug 2024 22:51:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=WAleAgU0nELug6NfJdoMqtwWysVuNg9oSdlHi45R8S8=; b=K0Sab+xh/Lxwjd4IoH4Hdu+a5h
	9HdcPjpGU2o+68yL1W/j6OKrTXcLckOkm8xavL/X69eaB4QfA+ZXOBtTFBpQO556lVv0aCmGBZtEu
	timo8Zt4Pjs65EbT9hR8J7RFVY0OstyMqfVvY+i7na+7fn01TXB+ww5BOv2AepxHRmxs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187342-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187342: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=5be63fc19fcaa4c236b307420483578a56986a37
X-Osstest-Versions-That:
    linux=780bdc1ba77646c3461f1988b12c42c60f836d77
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sun, 25 Aug 2024 22:51:51 +0000

flight 187342 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187342/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187339
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187339
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187339
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187339
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187339
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187339
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                5be63fc19fcaa4c236b307420483578a56986a37
baseline version:
 linux                780bdc1ba77646c3461f1988b12c42c60f836d77

Last test of basis   187339  2024-08-25 02:12:32 Z    0 days
Testing same since   187342  2024-08-25 16:14:04 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Kent Overstreet <kent.overstreet@linux.dev>
  Linus Torvalds <torvalds@linux-foundation.org>
  Yuesong Li <liyuesong@vivo.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   780bdc1ba7764..5be63fc19fcaa  5be63fc19fcaa4c236b307420483578a56986a37 -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 05:10:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 05:10:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783259.1192574 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siRz9-0008Rl-0e; Mon, 26 Aug 2024 05:09:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783259.1192574; Mon, 26 Aug 2024 05:09:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siRz8-0008Re-Tp; Mon, 26 Aug 2024 05:09:46 +0000
Received: by outflank-mailman (input) for mailman id 783259;
 Mon, 26 Aug 2024 05:09:45 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siRz7-0008RU-Lh; Mon, 26 Aug 2024 05:09:45 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siRz7-0004VG-8t; Mon, 26 Aug 2024 05:09:45 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siRz6-0003kJ-NO; Mon, 26 Aug 2024 05:09:44 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1siRz6-0005ip-MU; Mon, 26 Aug 2024 05:09:44 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=KFxizFwTKuU1nTOllhNC9Jni2jrRKZ7avcosMrRqmyk=; b=cC9aNm/KU/+XqUHOMo4RUsPhTi
	/rjuFXeIxr9Vactfno2XxTCmX7C9YgMDex9UwA/MUdqtoKSprXdQJr7NTPINnvDRxCzzLgUUqtQns
	0aHhX1K/cayjgg8uh68qCo8phT+95lDgDDLrtDK6y8mIW2KJhTECHlaqzGUpmk8FB0us=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187344-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187344: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-libvirt-vhd:leak-check/check:fail:regression
    qemu-mainline:test-armhf-armhf-xl-qcow2:leak-check/check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=f259e4cb8a8b4ef5463326fc214a7d8d7703d5de
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 26 Aug 2024 05:09:44 +0000

flight 187344 qemu-mainline real [real]
flight 187346 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187344/
http://logs.test-lab.xenproject.org/osstest/logs/187346/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707
 test-amd64-amd64-libvirt-vhd 22 leak-check/check         fail REGR. vs. 182707

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-qcow2    20 leak-check/check        fail baseline untested
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass

version targeted for testing:
 qemuu                f259e4cb8a8b4ef5463326fc214a7d8d7703d5de
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  354 days
Failing since        182723  2023-09-07 18:19:05 Z  353 days   34 attempts
Testing same since   187340  2024-08-25 05:05:28 Z    1 days    2 attempts

------------------------------------------------------------
621 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    fail    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 180913 lines long.)


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 05:58:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 05:58:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783273.1192583 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siSkH-0008BK-J7; Mon, 26 Aug 2024 05:58:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783273.1192583; Mon, 26 Aug 2024 05:58:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siSkH-0008BD-GT; Mon, 26 Aug 2024 05:58:29 +0000
Received: by outflank-mailman (input) for mailman id 783273;
 Mon, 26 Aug 2024 05:58: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=Dc7R=PZ=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1siSkF-0008B7-Qb
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 05:58:27 +0000
Received: from NAM12-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam12on20625.outbound.protection.outlook.com
 [2a01:111:f403:200a::625])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3505f55a-6370-11ef-a50b-bb4a2ccca743;
 Mon, 26 Aug 2024 07:58:26 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by PH7PR12MB8594.namprd12.prod.outlook.com (2603:10b6:510:1b3::7)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Mon, 26 Aug
 2024 05:58:19 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285%4]) with mapi id 15.20.7897.021; Mon, 26 Aug 2024
 05:58:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3505f55a-6370-11ef-a50b-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=PAPio0fuTgrGbUqzTAMeGvCZDj3+kbl2nQWX6tzFbv5nChpmlOLw03Pbf04o/jq0uaZZqRc37vNlofnqwTpsWlY7Ty1ILQUPWZ7/pqFTJCIlxEVQgtgw6gQH2AcL/xdzXYsAms8Qq+t5eX8e4K7RjaI3UvJ9JKPKvje9dVTtD49VtxPo/0gMQCX1njh5Ury7OY9pOBGEJvbTArvaunuorEWIOsZ4jWFxVPD7KSL5I4YHu9idO6U0hXOHkSda5kEmGrT1wuPl0wav25CCL6I4coFjIouCw/EFOd6MWi8XVVCgu3HASVhV3YSMVp5Kx9Zw2RFKAT0TDnJgJSXuECCi1g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Oz9l8B7Cl1KzTHi7R6Qr23XDXWSi1KxdvVbzFE6z+qk=;
 b=HIf428zI9lcokfzbMcfFQQIhUOdQI2VNTX1ezK9a/y8gaZFZNWgcCkoJyJuMH47gjlmU+YlfuymowdzV/1WA04WLzibl/HTYkd2DRofM6fu5UacdQzD2fHneps48Fidi/b45Z1p9iWnNgJqu8bDGIpkenjXp/x4YO97xlNHh2brLk3MhTKui+LMFxBDT5H7TS4/HHz7Hurl1q5YD9pEwl5FmWonmidDIyIixnxFwKxhzuQEHfp8veZoIJ0fBcIId/70Qh0lTNK/pVHstgdnoI98vr5ga41AJc+dzZoR5LqsgLMNLXpJCATGlQGLexv6+JoIlZQVLA0rGs9XpzyRtsw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Oz9l8B7Cl1KzTHi7R6Qr23XDXWSi1KxdvVbzFE6z+qk=;
 b=NZQ7emYUyrH56aRE/JHoNcnezosgh/Kz7fSlwFaGjfw2OCDdxZI+Z+lXox/G3jnABZrVG35Yh/lVxBYSjscYHEqPXgiZDj+WYX2gfZKK0IBxO89cmdYSv3OyGMNL9f+Er3sL50T4VcVypGGd0ewR4Er7J4Wp3w5gkecxNAAFLE8=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: "Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>, Jan Beulich
	<jbeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>, Andrew Cooper
	<andrew.cooper3@citrix.com>, =?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?=
	<roger.pau@citrix.com>, Wei Liu <wl@xen.org>, George Dunlap
	<gwd@xenproject.org>, Anthony PERARD <anthony@xenproject.org>, Juergen Gross
	<jgross@suse.com>, Julien Grall <julien@xen.org>, "Daniel P . Smith"
	<dpsmith@apertussolutions.com>, "Huang, Ray" <Ray.Huang@amd.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>, "Orzel,
 Michal" <Michal.Orzel@amd.com>, Oleksii Kurochko
	<oleksii.kurochko@gmail.com>, Rahul Singh <Rahul.Singh@arm.com>, Bertrand
 Marquis <bertrand.marquis@arm.com>, "Chen, Jiqian" <Jiqian.Chen@amd.com>
Subject: Re: [XEN PATCH v13 1/6] xen/pci: Add hypercall to support reset of
 pcidev
Thread-Topic: [XEN PATCH v13 1/6] xen/pci: Add hypercall to support reset of
 pcidev
Thread-Index: AQHa78yrMx2rme7kLk2Lfq5OhJcOzrIuThwAgAGubYD//8GBAIAA9fyAgAjrwgA=
Date: Mon, 26 Aug 2024 05:58:19 +0000
Message-ID:
 <BL1PR12MB5849590DC35AC9E613838C48E78B2@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
 <20240816110820.75672-2-Jiqian.Chen@amd.com>
 <50717151-3098-491f-9dfb-71ebaff4b684@suse.com>
 <BL1PR12MB58498DC98719ED77DA950478E78D2@BL1PR12MB5849.namprd12.prod.outlook.com>
 <1e0eee6c-0dcd-4ed4-970f-3d7e569cec09@suse.com>
 <c8f84256-dfb8-4f42-a71c-30373bafab23@amd.com>
In-Reply-To: <c8f84256-dfb8-4f42-a71c-30373bafab23@amd.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: BL1PR12MB5849.namprd12.prod.outlook.com
 (15.20.7897.019)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|PH7PR12MB8594:EE_
x-ms-office365-filtering-correlation-id: 33516d2e-08f3-4cfc-444e-08dcc5941635
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|7416014|376014|1800799024|366016|38070700018;
x-microsoft-antispam-message-info:
 =?utf-8?B?b2dTL3R4Q1lUTnU5V1hzc2lmN1J2MzlHa3FJSUZEZ3dXOWJIT3Z2bGxZQmpD?=
 =?utf-8?B?MENWY3BqV1FBa3U5TFp1ejRqcU55VEdBOWt1Z3RqOWFPSjFXemVOOWlMOG4y?=
 =?utf-8?B?alVmckIveldPVnJuSDNSblBrZW5ZeTJKbEpsdDVXVzZOaHg4My92WVQyaWgx?=
 =?utf-8?B?akprMWZ6ajk3ZWY3ckVSQ293eVlKelpjdXBSNG9jakdISXZobEpOOStpYkdW?=
 =?utf-8?B?MDhuVnZIVytQNDBaQjZadUpBWktjTm5YSm8zNGg5cUZHczdNVmJOVmFHNkVJ?=
 =?utf-8?B?K3I0eUM5VDVnc2xscTNTOWFxYWs1dlFjMEp1aTZTWHo1OEQvSTNweG9xdEht?=
 =?utf-8?B?SGpkVkUrQVJrTWVsd2FBbTZPMForMWR6clgrYkIwdWoxUElNenJPazJQWkd3?=
 =?utf-8?B?NDcva3hVQTFaQVdnRktoWkF6VGIzQm15V2tra0dQNkUra09EZVJZZVBXekxx?=
 =?utf-8?B?YjFDQmtrSzRwU251RjEzWHMxSWFZaFZzRDJVU0pTT2VMb3YrNklYYUQyb1FO?=
 =?utf-8?B?WWtxTk1nZi9QTDdZN3NvRVBlVmd5YTU1dkFvaHZ4Z0NDSW50OVZCeXRFUEwv?=
 =?utf-8?B?TWxhWEpIMDhsamlFL0tVK1NIN04xYkUyUnMvb3Fiei9BZUJOMXl5RlZLN3Nm?=
 =?utf-8?B?aWJINWw2WjI0d01JbjBSKzNyd3AzTmV6aDBWLzJydWRjVjZNOEtaaFAzb2Vr?=
 =?utf-8?B?Y3pEbTA3Vk9DTE5jRmJhKzZqNktIalNaT01SellyVEllSGZZU1ErTFdDMFpF?=
 =?utf-8?B?VkVrWmFMTy83RUk0TXlURXE0c1RNYmxTSlE1MnA0WldwUTM4Sk5ibVR2Qkd5?=
 =?utf-8?B?b3NIWVFNMFlYWFpwWUVyQjUydXF2ckNDR2I2OFRUNXlUVXk1c1dyU1pYa0xr?=
 =?utf-8?B?R0hyek5JcC9pZEZzOThmazkvNkdyUXowdDA5UTdVVUZWU3Q5T3BlVTZqaUo4?=
 =?utf-8?B?S1ZGcEFmV1B6UTFEcnBybzlBd1E4VmlGcWlHSklTV0U0aG01bVdNY1JSUk1K?=
 =?utf-8?B?NVFIbWdUaWJyNGtKSnJoa1pDWGV1SnJFYWw5eEQ0N1kyWXVuRGgrV1Y5QWc4?=
 =?utf-8?B?RWRvMWJtQk1TcTVlWDR4ZXB0aVNNKzhkSjlLSFk4QmtoZ1hIek5abFF6TGZv?=
 =?utf-8?B?MDl6a3JvZTQ2NXVOcGdlbEwxMW12SEVaT1crNC9rOS9mTGZPQXRFMjhmdnZI?=
 =?utf-8?B?NjZ2ZUdyMm1DbXpyZjgxRGI4SkpvOExQd2ltSWMrczBoSWJEMHphZk5ialRv?=
 =?utf-8?B?NUluMlg4V3gwYUxWSDVLM25yVklQcDVVUkVHMnNOcW5IcDBXVWU5SmZpeGU5?=
 =?utf-8?B?MkRiSlF5R05JOHkwam9XYUM5OC9oMDFUeVlzcDRmWldOUU0zN29XZk5sWldq?=
 =?utf-8?B?QldUNjFSVVI2czRGVWFwMlhTMGl0eGFCMnBEYXBhOGk5L0FsdDNCZ055eFNE?=
 =?utf-8?B?UWpzcTdFbDZtK0p1eDI2UWdmWVc2YVB3cXg4SGRLRE8yRWd4U3N1cGlVT3Zy?=
 =?utf-8?B?blZBOExVV3lWcjB5ZDRTamVoSFNQOUlsN25mdkxZSDIzaE0rSWhDdzMrS25Y?=
 =?utf-8?B?dzltREJsUTkxWU5meWxvU1ZGcTRRQnE5Tkk1Nnk3YUVkaStiMER1bjVBR2lu?=
 =?utf-8?B?cDVFc0lramZmd3ZwRFRXMUNQVkQyT0NFeDBORmFEOHFPQ1hzTThjMFRMUmhj?=
 =?utf-8?B?NUdhTWZsQ3ZUeVhIU2tEVWRFVjdhblRBNmozNDdxQ2lQdEVhR2lpZnRFUjNh?=
 =?utf-8?B?UlJNOGt0RnRFZ3Z2OU5WUFV0Q2s5ck5WYlRlYnFrVjNRc3JCWUZObXZVcGxp?=
 =?utf-8?Q?HXSm35dDA9Px5YRg0Hdtpc92vt4tcbnR9g9UI=3D?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?K25vSUFISWEyVi9IdHlqZW9DSlZoVWxJR2FQQ1BxS0hUMjc3aXBtZDlQQ3FB?=
 =?utf-8?B?SCtKcmRsNnlPYVdYWE5pMllya05UNGZ4RHRQcWh0Y2dyTHR4M3ZQTmMweHYv?=
 =?utf-8?B?MjhuTHVYbGJhWjdUL3p5N2NIc3FOc3BZcFVSdHNndW8xRVduYzBSR3BzV3NU?=
 =?utf-8?B?Z21PemNsbGh5VVkwWjhCTGNoenhrSEkzSUlaUXdDRk41amVaMU0zbk1aMW1B?=
 =?utf-8?B?KzZOUi9uMkF3UDAzMGZWbnJydS9veGdQYkFaVDRnYSszQlArQmgwL1ExWFZm?=
 =?utf-8?B?cC9uZ3RzUE1hUG0wOS9aL3JqK3p4bUIwS2NqMnc1U0l4MnAyb2hmR042Vm9L?=
 =?utf-8?B?Rlplbnd5MDU0ck9oekxPdE03bEdON3JJa2hyd0tMbmhwaDdmb0JFSFA3YVBX?=
 =?utf-8?B?c1BIaGpFdzdxYnhyVEN6ZkNGNnRDTHRBRkhQVnB6dDNST1J1U1Y3R1ZCY0pL?=
 =?utf-8?B?VUJ2cVpNOVV3clhaVm0wQ0JCV3lYM3kyeWNsZlZvZ1hCUitoSVVwbjJqOWRT?=
 =?utf-8?B?R1N5VW5tTE14a3FTaUlBUHBzdDRzN1duQm5sUW5xQVdKZWxERUF1bWgwZENB?=
 =?utf-8?B?TkR5c3VBOUduOEphaXFQZlBxbXpSRXRzaEtzNVVJSzlsQzZKWXlLQU12alBl?=
 =?utf-8?B?clVud3l0NjZxMVh1Ym5Kd2NGOC83bVptZTkvdHVlNEFlZUpvVlJJWmZSTVdN?=
 =?utf-8?B?MVAxWFNQZ0xrQmNDelMrcFdxUWYrcmhqd05zQ2pBaEdFTldlOFlDcUNERjRF?=
 =?utf-8?B?SzR1TDRqd3p6bGxOU0tSWjJ4VHkrbnowbDJPVHl5c1JGcHYyenExKzdUdnJY?=
 =?utf-8?B?a00xbndzMmdOMHNzV1ZZTFZhZHdhTEQyRm4ybVQwQTVUZzRNR1cySmtCQ01p?=
 =?utf-8?B?dVE4NzAzNElxTnFhOGJ4Ly9JR0JiMjZvdUZSQWN2THZnSk81TXhxeWNiUkkr?=
 =?utf-8?B?MWJIaXdGZkpGVGZzaER4dTZZWkowN0dPcXd1VVBuN1FmVTZJKzhSaVNUWHpk?=
 =?utf-8?B?Tklzd1piQ2FSRGVxWHA5N3pVcHV3Q0JyTmxhRjJQMHR5MWFPNTNuU1RKSVA1?=
 =?utf-8?B?KzJFakNmYmsyZXMwR2tWOG9nREFDSDQxS2M3OG1OQTRZdmdoV1d1MU1nZHBn?=
 =?utf-8?B?MGZvSUlCMW1SdWhOMlJpdDZlQ0xFVVpJMDBKUnNBT1JqUThjcUFNL2VURldI?=
 =?utf-8?B?ZWZwNEJqZkNXZEpYKzBuN2ZHVmJ2dDRDK3F1bWFpWHdzakJack1BODRhQzhz?=
 =?utf-8?B?Z3lieGg1WTVNM0lzTUs2c0l3K1hJS2tEMG9xTTl2QXZZQlNEbTMySC8xanVv?=
 =?utf-8?B?VU8xZzVZeFZBOVJwRmhicElnc0FjTmtEVGNaVzNrZ05ZWDlTQi9tdDdIelQy?=
 =?utf-8?B?WWdlRnJiZ0tIaWJOVzNPcVZ1V0xSeTJmRHF6Y0hEVE0wQU0xK04vRWY1ZFFy?=
 =?utf-8?B?TDZMVDZtV3hEMUE4bS9kZTBmUjJadVcxQk01dkFBZmc2WitPZGRoalZyMnp3?=
 =?utf-8?B?NUxrT0pySUpFK1d0YWw1MFJMRTNzK1NQMnRTSFE4RTZGUmQwdmF0Qk5pTllk?=
 =?utf-8?B?dUdPQUFqd0FkNThiU1V3T0t1Yk0xT2lwYjVCdGQrQ0Z2YTNGZ1FOamtUUWhL?=
 =?utf-8?B?enY3UFZ3ZDhPdWQrZE9vcTlFSlhuc3hwQnFGSHh5TzZZUmIvbC8vTmZOOGNN?=
 =?utf-8?B?d2ZxMVFheTMxZFIvU1lEQy9HV1JNU0RPOXhmOWdBQ1pXRzZQL0FUUk1CaU50?=
 =?utf-8?B?OTFZQnlndHVweWt3UkxuZkM2dTEzTHBhSEZCZlV4NHkrdUNGeVFSQzRtQkox?=
 =?utf-8?B?THlWUmh3SHIyQW5XbUFFTXlrU0d3aElIc2N4cnNGNXk3U0Y4QjhkdHg5VWQ4?=
 =?utf-8?B?U3c5U2d3V0lmclVCUzN4U2EvdHRjcndJME44TkR4TU5UaEhIc3VZS2NDWVNQ?=
 =?utf-8?B?dkFjTlVaS2xSeVBicVdYZTVNdExaQlF6WUJaRU56NlRSbklNMjIyWmx3QUgw?=
 =?utf-8?B?cWRkTkRNd05ZK2VBQzBHZHNWY0Jmd2VKYmJKbi9XcDlxUW8rL2pkRE01Q29h?=
 =?utf-8?B?OEJvbFh2ZUNhbVdWR0Y4RTZxeFpLYlpMMnFMMk5jN0xCd3lHa0FtUnBXQlkz?=
 =?utf-8?Q?2kD0=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <D3CC0CC50B3E7F44AFD97E2025CD114C@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 33516d2e-08f3-4cfc-444e-08dcc5941635
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Aug 2024 05:58:19.8128
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: GkK8h3OiuWgpP73bIwtgqaUrEejC3wC0csksV6TsQiQM7+UCenu9os4OuLkmmr7K0doOICrdIHTwnHA1ERV8ng==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8594

T24gMjAyNC84LzIxIDA1OjQyLCBTdGV3YXJ0IEhpbGRlYnJhbmQgd3JvdGU6DQo+IE9uIDgvMjAv
MjQgMDM6MDEsIEphbiBCZXVsaWNoIHdyb3RlOg0KPj4gT24gMjAuMDguMjAyNCAwODowMCwgQ2hl
biwgSmlxaWFuIHdyb3RlOg0KPj4+IE9uIDIwMjQvOC8xOSAxNzowNCwgSmFuIEJldWxpY2ggd3Jv
dGU6DQo+Pj4+IE9uIDE2LjA4LjIwMjQgMTM6MDgsIEppcWlhbiBDaGVuIHdyb3RlOg0KPj4+Pj4g
QEAgLTY3LDYgKzY4LDU3IEBAIHJldF90IHBjaV9waHlzZGV2X29wKGludCBjbWQsIFhFTl9HVUVT
VF9IQU5ETEVfUEFSQU0odm9pZCkgYXJnKQ0KPj4+Pj4gICAgICAgICAgYnJlYWs7DQo+Pj4+PiAg
ICAgIH0NCj4+Pj4+ICANCj4+Pj4+ICsgICAgY2FzZSBQSFlTREVWT1BfcGNpX2RldmljZV9yZXNl
dDoNCj4+Pj4+ICsgICAgew0KPj4+Pj4gKyAgICAgICAgc3RydWN0IHBjaV9kZXZpY2VfcmVzZXQg
ZGV2X3Jlc2V0Ow0KPj4+Pj4gKyAgICAgICAgc3RydWN0IHBjaV9kZXYgKnBkZXY7DQo+Pj4+PiAr
ICAgICAgICBwY2lfc2JkZl90IHNiZGY7DQo+Pj4+PiArDQo+Pj4+PiArICAgICAgICByZXQgPSAt
RU9QTk9UU1VQUDsNCj4+Pj4+ICsgICAgICAgIGlmICggIWlzX3BjaV9wYXNzdGhyb3VnaF9lbmFi
bGVkKCkgKQ0KPj4+Pj4gKyAgICAgICAgICAgIGJyZWFrOw0KPj4+Pg0KPj4+PiBJdCBvY2N1cnMg
dG8gbWUgKG9ubHkgbm93LCBzb3JyeSk6IERvZXMgdGhpcyBjYXNlIHJlYWxseSBuZWVkIHRvIGJl
IGFuDQo+Pj4+IGVycm9yPyBJLmUuIGRvIHdlIHJlYWxseSBuZWVkIHRvIGJvdGhlciBjYWxsZXJz
IGJ5IGhhdmluZyB0aGVtIGZpbmQgb3V0DQo+Pj4+IHdoZXRoZXIgcGFzcy10aHJvdWdoIGlzIHN1
cHBvcnRlZCBpbiB0aGUgdW5kZXJseWluZyBYZW4/DQo+Pj4gSSBhbSBub3Qgc3VyZSwgYnV0IGZv
ciB4ODYsIHBhc3N0aHJvdWdoIGlzIGFsd2F5cyB0cnVlLCBpdCBkb2Vzbid0IG1hdHRlci4NCj4+
PiBGb3IgYXJtLCB0aGlzIGh5cGVyY2FsbCBpcyBhbHNvIHVzZWQgZm9yIHBhc3N0aHJvdWdoIGRl
dmljZXMgZm9yIG5vdywgc28gaXQgaXMgYmV0dGVyIHRvIGtlZXAgdGhlIHNhbWUgYmVoYXZpb3Ig
YXMgb3RoZXIgUEhZU0RFVk9QX3BjaV9kZXZpY2VfKiBvcGVyYXRpb24/DQo+Pg0KPj4gRGVzcGl0
ZSBzZWVpbmcgdGhhdCBJIGRpZCBhY2sgdGhlIHJlc3BlY3RpdmUgY2hhbmdlWzFdIGJhY2sgYXQg
dGhlIHRpbWUsIEkNCj4+IChub3cpIHZpZXcgdGhpcyBhcyBncm9zc2x5IG1pc25hbWVkLCBhdCBi
ZXN0LiBJbW8gaXQgbWFrZXMgcHJldHR5IGxpdHRsZQ0KPj4gc2Vuc2UgZm9yIHRoYXQgcHJlZGlj
YXRlIGhlbHBlciB0byByZXR1cm4gdHJ1ZSB3aGVuIHRoZXJlIGFyZSBubyBJT01NVXMgaW4NCj4+
IHVzZS4gRXZlbiBtb3JlIHNvIHRoYXQgb24gYW4gQXJtL1BDSSBzeXN0ZW0gd2l0aG91dCBJT01N
VXMgb25lIGNhbiB1c2UgdGhlDQo+PiBjb21tYW5kIGxpbmUgb3B0aW9uIGFuZCB0aGVuIGV4ZWN1
dGlvbiB3aWxsIG1ha2UgaXQgcGFzdCB0aGlzIGNoZWNrLg0KPj4NCj4+IEkgZnVydGhlciBxdWVz
dGlvbiB0aGUgcmVsYXRlZCBwYXJ0IG9mIFsyXTogV2h5IGRpZCB0aGUgc3R1YiBuZWVkIG1vdmlu
Zz8NCj4+IEknbSBub3QgZXZlbiBzdXJlIHRoYXQgcGFydCBvZiB0aGUgY2hhbmdlIGZlbGwgdW5k
ZXIgdGhlIFN1Z2dlc3RlZC1ieToNCj4+IHRoZXJlLCBidXQgSSBhbHNvIGNhbid0IGV4Y2x1ZGUg
aXQgKEkgZGlkbid0IGJvdGhlciB0cnlpbmcgdG8gZmluZCB3aGVyZQ0KPj4gdGhlIHN1Z2dlc3Rp
b24gd2FzIG1hZGUpLg0KPj4NCj4+IEluIGFueSBldmVudCAtIHdpdGggWzFdIFBIWVNERVZPUF8q
cGNpKiBlbmRlZCB1cCBpbmNvbnNpc3RlbnQgb24geDg2LA0KPj4gZXZlbiBpZiByaWdodCBub3cg
b25seSBvbiB0aGUgc3VyZmFjZS4gWWV0IGFzIHNvb24gYXMgdGhpcyBwcmVkaWNhdGUgaXMNCj4+
IGNoYW5nZWQgdG8gdGFrZSBJT01NVXMgaW50byBhY2NvdW50LCB0aGUgbGF0ZW50IGluY29uc2lz
dGVuY3kgd291bGQNCj4+IGJlY29tZSBhIHJlYWwgb25lLg0KPj4NCj4+IEFuIGFsdGVybmF0aXZl
IHRvIGNoYW5naW5nIGhvdyB0aGUgZnVuY3Rpb24gYmVoYXZlcyB3b3VsZCBiZSB0byByZW5hbWUg
aXQsDQo+PiBmb3IgbmFtZSBhbmQgcHVycG9zZSB0byBhY3R1YWxseSBtYXRjaCAtIGlzX3BjaV9w
YXNzdGhyb3VnaF9wZXJtaXR0ZWQoKQ0KPj4gbWF5YmU/DQo+Pg0KPj4gVGhvdWdodHMgYW55b25l
LCBBcm0gLyBTTU1VIG1haW50YWluZXJzIGluIHBhcnRpY3VsYXI/DQo+Pg0KPj4gRmluYWxseSwg
YXMgdG8gdGhlIGNoYW5nZSBoZXJlOiBPbiBhbiBBcm0vUENJIHN5c3RlbSB3aGVyZSBwYXNzLXRo
cm91Z2gNCj4+IGlzbid0IGVuYWJsZWQsIHRoZSBoeXBlcnZpc29yIHdpbGwgc3RpbGwgbmVlZCB0
byBrbm93IGFib3V0IHJlc2V0cyB3aGVuDQo+PiB2UENJIGlzIGluIHVzZSBmb3IgRG9tMC4gSU9X
IEknZCBsaWtlIHRvIHJlZmluZSBteSBlYXJsaWVyIGNvbW1lbnQgaW50bw0KPj4gc3VnZ2VzdGlu
ZyB0aGF0IHRoZSBjb25kaXRpb25hbCBiZSBkcm9wcGVkIGFsdG9nZXRoZXIuDQo+IA0KPiBJIGFn
cmVlIG9uIHJlbW92aW5nIHRoZSBjb25kaXRpb24gZm9yIHRoZSByZWFzb24geW91IG1lbnRpb25l
ZC4gSSdkDQo+IGxpa2UgdG8gcmVtb3ZlIHRoZSBvdGhlciBpbnN0YW5jZXMgb2YgdGhlIGNvbmRp
dGlvbiBpbiB0aGlzIGZpbGUgYXMNCj4gd2VsbCwgYnV0IHRoYXQgaXMgdGhlIHN1YmplY3Qgb2Yg
YSBzZXBhcmF0ZSBwYXRjaCBpbiB0aGUgd29ya3MgWzNdLg0KPiANCj4gWzNdIGh0dHBzOi8vbG9y
ZS5rZXJuZWwub3JnL3hlbi1kZXZlbC8yMDIzMTEwOTE4MjcxNi4zNjcxMTktOS1zdGV3YXJ0Lmhp
bGRlYnJhbmRAYW1kLmNvbS8NClRoYW5rcyBTdGV3YXJ0IGFuZCBKYW4sIEkgd2lsbCByZW1vdmUg
dGhpcyBjaGVjayBmcm9tIG15IHBhdGNoIGluIG5leHQgdmVyc2lvbi4NCg0KPiANCj4+DQo+PiBK
YW4NCj4+DQo+PiBbMV0gMTU1MTdlZDYxZjU1IHhlbi9hcm06IEFkZCBjbWRsaW5lIGJvb3Qgb3B0
aW9uICJwY2ktcGFzc3Rocm91Z2ggPSA8Ym9vbGVhbj4iDQo+PiBbMl0gZGVjOWUwMmYzMTkwIHhl
bjogYXZvaWQgZ2VuZXJhdGlvbiBvZiBzdHViIDxhc20vcGNpLmg+IGhlYWRlcg0KPiANCg0KLS0g
DQpCZXN0IHJlZ2FyZHMsDQpKaXFpYW4gQ2hlbi4NCg==


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 06:06:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 06:06:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783281.1192593 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siSrX-0001Pe-Dh; Mon, 26 Aug 2024 06:05:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783281.1192593; Mon, 26 Aug 2024 06:05:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siSrX-0001PX-B6; Mon, 26 Aug 2024 06:05:59 +0000
Received: by outflank-mailman (input) for mailman id 783281;
 Mon, 26 Aug 2024 06:05: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=Dc7R=PZ=amd.com=Jiqian.Chen@srs-se1.protection.inumbo.net>)
 id 1siSrV-0001PR-TQ
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 06:05:58 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on2060f.outbound.protection.outlook.com
 [2a01:111:f403:2415::60f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 40a0c0b2-6371-11ef-8776-851b0ebba9a2;
 Mon, 26 Aug 2024 08:05:55 +0200 (CEST)
Received: from BL1PR12MB5849.namprd12.prod.outlook.com (2603:10b6:208:384::18)
 by PH7PR12MB7259.namprd12.prod.outlook.com (2603:10b6:510:207::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Mon, 26 Aug
 2024 06:05:51 +0000
Received: from BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285]) by BL1PR12MB5849.namprd12.prod.outlook.com
 ([fe80::b77f:9333:3a5a:d285%4]) with mapi id 15.20.7897.021; Mon, 26 Aug 2024
 06:05:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 40a0c0b2-6371-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=I/q5mYRTls9Wf7gScdYueFrDGGioOe1xk1atMi9TJCPmugqwu/OtCh1u+M2PrDzVfJPJMNUAMy938W96IjtYKZI6T780VEqnwBBXeM+THCZblziStH208FqNtuhEGBhDkxsEplAOramIFjHporaHI8piS2jF+iWSmx430o9Dwk8B8WZbndv+vSQtsT2S4sKt6Zei7oAmec3XVDT7FwCgDOfUj3AZOqmHSNqwYMUmG1lIlprOmHI7j2uHFgxfLH9TQCCieedTPoN9n2QN1yjduwp4URvqjTOTgnThB2mqNVFGh6qZZfuT6d0vBjowkkaKeNyL0ddmDv0fT0h/DHJiTw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LaORtK8PWKvBrHG5Epxn6hf3igeKJA2hFCchxO95M1w=;
 b=s069CI2UJJuXED4jd20qE0lMnVRiCL4mkfuzHoGyqhDLYY33JPqlbjXMnHWpZ0Gir3ZyZwiDjjgA4rP1dUbcWsBwo9ggGcO8PdVwFiGXLsd9iDuzlykcs4KXqXr1rKZevKo2T1XsY3ihvaSBHka6KxAkyOMuAWbOntUlFjeqQ9wYoZBSRjqKy/qy5xeiLtldg3wZg8+e3JJ3FY8SBsTrtICBit8wEb7qShIjPuOZskgSJuNs7vff+Te0ZpCUSu/uA+WrFhjgCu4pBhTLrTeIHth7UmvjBsZI7dtAlIfMDA6XF1Nll82teXyaiOJKTvJ9QoCnzpX2g5RSHJ4GsM+2gg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LaORtK8PWKvBrHG5Epxn6hf3igeKJA2hFCchxO95M1w=;
 b=cRz2fsLFM6+KCOrAf7xCVeDqLdBr4spW//moHjKlwuDK1q+fATp53POqLdR0GU+bT8qfEOT4+wvn+j6dofvrDBZd5g3sMQK6LkbRKLETKYXMNf+QWqQMdBNSAFinSyf2ElzoRkBJpB6u7iVJXXsr+9q4oll9Yr4lM+E4scb+IxU=
From: "Chen, Jiqian" <Jiqian.Chen@amd.com>
To: Stefano Stabellini <sstabellini@kernel.org>, Jan Beulich
	<jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
	=?utf-8?B?Um9nZXIgUGF1IE1vbm7DqQ==?= <roger.pau@citrix.com>
CC: Juergen Gross <jgross@suse.com>, Wei Liu <wl@xen.org>, George Dunlap
	<gwd@xenproject.org>, Julien Grall <julien@xen.org>, Anthony PERARD
	<anthony@xenproject.org>, "Daniel P . Smith" <dpsmith@apertussolutions.com>,
	"Hildebrand, Stewart" <Stewart.Hildebrand@amd.com>, "Huang, Ray"
	<Ray.Huang@amd.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>, "Chen, Jiqian" <Jiqian.Chen@amd.com>
Subject: Re: [XEN PATCH v13 3/6] x86/pvh: Add PHYSDEVOP_setup_gsi for PVH dom0
Thread-Topic: [XEN PATCH v13 3/6] x86/pvh: Add PHYSDEVOP_setup_gsi for PVH
 dom0
Thread-Index: AQHa78yvTwlhsUHkMUeYQ1q1oq6CvbIuUVKAgAHlWYCAAKhsgIAIwXQA
Date: Mon, 26 Aug 2024 06:05:51 +0000
Message-ID:
 <BL1PR12MB584910473DADE9A5C563E6C4E78B2@BL1PR12MB5849.namprd12.prod.outlook.com>
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
 <20240816110820.75672-4-Jiqian.Chen@amd.com>
 <745cd8cc-59c2-44b8-b42b-1e5e0b3026ca@suse.com>
 <BL1PR12MB58496D2638998EC4DC2572C8E78D2@BL1PR12MB5849.namprd12.prod.outlook.com>
 <alpine.DEB.2.22.394.2408201713420.298534@ubuntu-linux-20-04-desktop>
In-Reply-To:
 <alpine.DEB.2.22.394.2408201713420.298534@ubuntu-linux-20-04-desktop>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-imapappendstamp: BL1PR12MB5849.namprd12.prod.outlook.com
 (15.20.7897.019)
authentication-results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: BL1PR12MB5849:EE_|PH7PR12MB7259:EE_
x-ms-office365-filtering-correlation-id: 45579ba5-a353-4ca8-a729-08dcc5952353
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam:
 BCL:0;ARA:13230040|366016|1800799024|376014|7416014|38070700018;
x-microsoft-antispam-message-info:
 =?utf-8?B?TC9QQ3dkQWl6VXdrVzY3UCtYUS9BQVpuVTZwL2ZKNjdNTW1UUEdUS3ZmMmdH?=
 =?utf-8?B?RUxTRXZFYStDU3Q4ZGxBL05IWkdzdkRYWHN1Mi9HaU9vQUluYVRjc2RwTE9t?=
 =?utf-8?B?ditmdG40YkpsaHN2cWs3R21nWGJsN1FjaGZMTTNHRjdLU2ExRGFVYVBtV3Rx?=
 =?utf-8?B?SGRMc3lHcFlKTWgxWnVLend4eU9FeG0vbDE1RTRxZythY3ZxY1loTm1XQi84?=
 =?utf-8?B?YXNNdUE1d2tiSC9tVEwxQUJGbGVOQmowa2FkdEltOTJkQUdqSlg0NllFVkg2?=
 =?utf-8?B?YzdtTWZHRUhOeFRYVHQ5MnZCMW1XelMya2NxNXJLZnBidXAyOVdzcjY5MkZR?=
 =?utf-8?B?a0NpaE5ESmZUNkFYMnNlUk5lSkVkVmlLSVIzL0lLU0NpcmxFQlpzcTlaeGww?=
 =?utf-8?B?VzFzampTdVVPMlZwMFMyWGFpdE16aGdFMmdHa1ZJNlhHM3pZendkazBDeTZu?=
 =?utf-8?B?U3hEdCtiNGpsM3NLeGJVSytSdmp2YXV5SmdvcFRlN1hrTGRKK3JLM25LdVY3?=
 =?utf-8?B?MUxUSmtzNm03Qk9RQW5sQTVUWlJiZzJNc1ljUThaSzVEdVZqWG1xUTdicitm?=
 =?utf-8?B?eU9IbVV0YWpDRy9lRDdETHVaRnVSeVZPOEhUVmZvTmRFSkwybnNxOTlQaC9X?=
 =?utf-8?B?R1pPbTVZYnAvd3VKczRnUmw3VjdOakcvWjhhTDYyVDZvbGJoN2daQVRpamE0?=
 =?utf-8?B?dGIrNzllaEFETUNOOGFKUTM5Y1ZiOHg1bTFtdG9qd2FNVXM5eHpxTTN2YVdm?=
 =?utf-8?B?TGl1NjdFNFRXcndZQUh4NmVseXk3R2lVTnA1aFRkdWNJRzhsbTkyNlk5NWZC?=
 =?utf-8?B?RExQcDBVN2REUFdUZXFHZVdJT1BsWThkSlpUTGgxa3pzMkE1UHZUdElDK0xC?=
 =?utf-8?B?V0oxdk56RUYwTEY1N1RiYnZPMDZpVGN0RGFRblZTOXprbm9ONXozTE1tekds?=
 =?utf-8?B?YmFNRlRMR1VOaVdteC9KNDJKYXNlTXNrNWI5YjdtOFAwYmo2emNIdDRHajhl?=
 =?utf-8?B?U3ZEZjcxNXRSRkVTUC9oVDdqR2FWenBIYTRpSVl0OURuSUx5cmwzMmVhUFM0?=
 =?utf-8?B?TWp1TStoaC9YSmRETmV3TlFsL3JNVWdhT0lNblUvb05TYXFiNHI5dmRsTy90?=
 =?utf-8?B?R3MvYjRyZ0w2bmFldFZQNW9WMjFnYjFaVGhuQjZySVhUWklEV0s1cDBkclRK?=
 =?utf-8?B?a2V1ZTVBYUJSYjJLM3Z2NDBmeVZWemRTTjMvK3BMT1I3OEd2blg3MmFaRzlR?=
 =?utf-8?B?OStZeFgrVWs1N0U5SGNFWXhWblpaV2hRd2Nkc0ttc2hYbXdONVA2cnVNZENx?=
 =?utf-8?B?OGNvZmJKYUgxTGMrSUg4VnRKMVJXWFVFRk83TFk0akc5MHYrbUFSRlMwMWR4?=
 =?utf-8?B?SWFHYXArUlh0V05UUXlsOENnNTJQT3JLeXc1VXB2NWNFWDJnQ2E1NlhHeDFI?=
 =?utf-8?B?WjIwTGZqd1lhSjhNaFZUZGpNOTdYU1lVRHFWSCtuanVHQ1JGcEhKamJINTRq?=
 =?utf-8?B?d0RHSG1Xb0tmZFhyZEJuSng2VTlXbmJMOU1UZzB4eCtMNHpzQkRuYXVZZEVm?=
 =?utf-8?B?Sk1hazA2SmhYaG9RUlorSXlCSzNtQXM0WGlDQ2tIdTdoWTlyYkFIVXczZk5q?=
 =?utf-8?B?NlZUamxidTREVGM4cmkwNnFvOHFtNHhHblByM3BqVlF5cUk3Q2szaGIzUGZK?=
 =?utf-8?B?eXQ1Q0hmSkMzVER1aVlLSFhDMGl5MFpyYUFzSEFIdXllWi93TFZseDByZXAz?=
 =?utf-8?B?RXVTWlpTcWlxem5ZMmRURTZsS0NKNkJva1pTV1J0MndWVTd2ZERSOE0yMzFR?=
 =?utf-8?B?VVI0VmQ4TVY5YkJpUlg3UUgxTVZxMWdmSVVhMVpvdUdHN3NwaHQzYTd0Ky9G?=
 =?utf-8?B?WVhHZUQ3QkdpazFmWkVwY3g0Y1VIckRoTXVvdE1QUERLcUE9PQ==?=
x-forefront-antispam-report:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(7416014)(38070700018);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
 =?utf-8?B?QUlJU1pRcW91U0tiQ2JwK0QxamI2bUNEQWVtckg1RHVFYitUc05EdGIzRkJ4?=
 =?utf-8?B?SXN4bHNNeHgwdVppU3EraVhrWXMxd3FLK2RIT2JPb2l4RGYxaDEyTWlIdlhO?=
 =?utf-8?B?aHVUeWJaY2htRDNsU0l3amo1eGUwbld6VFVUbUdPUEl4WER5MHZxcU5UUEpu?=
 =?utf-8?B?T1gwbVhMUWVHSjBDMFpybElnN2JVVEtUbmJYT2xxUlpucy9jNzlkNFRZVXA4?=
 =?utf-8?B?YlpHeWlUbDljWm80cFFaNytJaUJqWjd0c25xYjNWTS91UGIycUNsYmR2Ly9M?=
 =?utf-8?B?VUQvL1BmUjE5cmwzMlc1MUh1aE5IckI1YWw3b3ovWFY2VlVFQTAwQVZZQTRY?=
 =?utf-8?B?QXVsaFB2ZnNFYm54WThpVm5lNnozNVhzUW5yL29nNzVaeUZCbVlpd1RuOW1x?=
 =?utf-8?B?ZUxFR3UvdVM2OENYZmZJK2UrSG5ocHJOL3lhYytWYTVBNC9SUTBndWR2U0hw?=
 =?utf-8?B?SVBiWTluWWVWdUMwMWVjbUJjb2ZjbGI3RmZlc0dNZWszdkZ5ckd4WWlMcXBM?=
 =?utf-8?B?U2ozeEI2UjM0S09GVmk4VW5IU2tVVVRMZlBpclJBMjNEWmZsZ0I4TmJJaUVI?=
 =?utf-8?B?NElLWmxPTEJCaitQSUc4RU5KcTRkc2RSMDNMbDk0TWRZMWI2WTliVXVITGFo?=
 =?utf-8?B?TlBrWFJiaE1wVnc3L1ZtbkhVSUJRNkhxWHRsNXEzWXpwYmdJZWVxRlZwYUxh?=
 =?utf-8?B?K3kxc3BkcUlxdjdEeUg2ZDQ2ZnBVZ0RBNjZ2ZSszejQxUVhEMUdMeXYxUVBm?=
 =?utf-8?B?Z1F0eVQxYXRWcEtacGJwd3BtUm5ESWRhYndKcHJTVGYxRkdQN3dlVmJNOE9k?=
 =?utf-8?B?UTlyMWtHaGV2Zng5aXRGN2NRMzZoamNjVWZuRjNkcU9nWWxjRVB0clhYSEg4?=
 =?utf-8?B?VERpSmR4Tk1KalhRMkFrMEVMam12TVl3aGZVTDdtV1lWcFRGVG52WjRBSVha?=
 =?utf-8?B?cW5DNkE3Z3Z2MWxQWTRqMVFqc0VFNnhtTFR2bTRqZzVNbXoybksvaHpKbWxi?=
 =?utf-8?B?YWlZdEY0MjVscldrQ1JMRFRCWWlkNms4VVdZNUhLWUxoL1VjTytPQXlNRHl3?=
 =?utf-8?B?aStaSDlHS2lIcStoc0w4Qnh4ZW1wTWlveXZVckZremI2OTgxaytEMGt4RlNM?=
 =?utf-8?B?NnhLZ1Boem1yakNnUW9QMzg1RkZ4a3UxcVEvRzN3a3BIUzZ5QkhOLzB4ZDBp?=
 =?utf-8?B?eXQ5WFNFbEcwcFV2akxwZVF5TDhCem9oZW52WWdCVE9WOTVPUWhNTnJBNFUx?=
 =?utf-8?B?OE9OVEVxSnFsNlZSNW5MZEkyUG5WOHlqSEV5ajVrNEtXak9ZeHNuU2RRam1P?=
 =?utf-8?B?YlNpNWlMYUh4WWtwSDBmYmFlRnRkOGZtU3ZuZTB5OWRubGQxN0JNQVB6QWVu?=
 =?utf-8?B?TkNESEt1SUIwV2N5OXprL1lNZG1NS3lkdUJBc0tJaG45UURZTy9WSXFNOHZu?=
 =?utf-8?B?SUZmSmpMVzBOUnY5TzJ6cTZocVNDWVkxa0ZMMVVESVQyVjRJUzAxQkNTRzg2?=
 =?utf-8?B?VjFUc2owaVR5RW5QTDRtVlRjU3FPSkUwRFN3V1U0Ry9IWk1ib3VYUWFWOUdO?=
 =?utf-8?B?dlVyZmY4S0dHejZWY3QvSkNCVkVrcWgrWlpFQkZvbVdJR0Z4WTdYT0N2MzhY?=
 =?utf-8?B?OVVhWEZSSnRRK3RqM1ZFRk9CK3dZVzRQWG9mZndHNnBzbDE4YTNnbCttazhk?=
 =?utf-8?B?MVUvNDREOVJGd2NFS2hSbDc0YnNvT2VtcjNVcEdqRGRnSnhGZHRuU3JFd0E3?=
 =?utf-8?B?UUNyVjR1cHNSNXh6ajJCNEVBS084NlpyWnJ2a0JNM0FPeTFtc0ZWMGRNNXpQ?=
 =?utf-8?B?NnB3dEtqNFFBWEl1ei85Nzl6aDUvQklPVTJnMXBucUt0WVVjNVZPNm1NMjJi?=
 =?utf-8?B?VlRQK09DeUw3SGFNN1dJcmJUMEpUaEV6aUJZR3d1cU9lYUJXb1RDeFdqT3BX?=
 =?utf-8?B?T0dXRGttc25GZnRKdWJmbVE3akkxVUxmNE5rc3ZIR2lSck1qQjRTZ2puSldi?=
 =?utf-8?B?OVRTOC9GczZ6STFpbU04Yk93aC9PczFrSUlndHZXcVlqcC9hTnloVkxYbGIz?=
 =?utf-8?B?dTNXR1hjYTJ0RFZlU2cxcU8wbjFEcEcydDdQaWc3SVFEcTJvdU9SZ2NGdkF2?=
 =?utf-8?Q?X7uY=3D?=
Content-Type: text/plain; charset="utf-8"
Content-ID: <62250B21F1210F4891B1F51ED04F2A17@amdcloud.onmicrosoft.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5849.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 45579ba5-a353-4ca8-a729-08dcc5952353
X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Aug 2024 06:05:51.3004
 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 8YRFlS3OU5lmw6tJeWEjD4wKlfjVkcmo731BMFeoCCAEjWtN29n3kYzKudhlPfVu8qMLBVqXGLXbEpy/YfhVdw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7259

T24gMjAyNC84LzIxIDA4OjE2LCBTdGVmYW5vIFN0YWJlbGxpbmkgd3JvdGU6DQo+IE9uIFR1ZSwg
MjAgQXVnIDIwMjQsIENoZW4sIEppcWlhbiB3cm90ZToNCj4+IE9uIDIwMjQvOC8xOSAxNzoxNiwg
SmFuIEJldWxpY2ggd3JvdGU6DQo+Pj4gT24gMTYuMDguMjAyNCAxMzowOCwgSmlxaWFuIENoZW4g
d3JvdGU6DQo+Pj4+IFRoZSBnc2kgb2YgYSBwYXNzdGhyb3VnaCBkZXZpY2UgbXVzdCBiZSBjb25m
aWd1cmVkIGZvciBpdCB0byBiZQ0KPj4+PiBhYmxlIHRvIGJlIG1hcHBlZCBpbnRvIGEgaHZtIGRv
bVUuDQo+Pj4+IEJ1dCBXaGVuIGRvbTAgaXMgUFZILCB0aGUgZ3NpcyBtYXkgbm90IGdldCByZWdp
c3RlcmVkKHNlZSBiZWxvdw0KPj4+PiBjbGFyaWZpY2F0aW9uKSwgaXQgY2F1c2VzIHRoZSBpbmZv
IG9mIGFwaWMsIHBpbiBhbmQgaXJxIG5vdCBiZQ0KPj4+PiBhZGRlZCBpbnRvIGlycV8yX3BpbiBs
aXN0LCBhbmQgdGhlIGhhbmRsZXIgb2YgaXJxX2Rlc2MgaXMgbm90IHNldCwNCj4+Pj4gdGhlbiB3
aGVuIHBhc3N0aHJvdWdoIGEgZGV2aWNlLCBzZXR0aW5nIGlvYXBpYyBhZmZpbml0eSBhbmQgdmVj
dG9yDQo+Pj4+IHdpbGwgZmFpbC4NCj4+Pj4NCj4+Pj4gVG8gZml4IGFib3ZlIHByb2JsZW0sIG9u
IExpbnV4IGtlcm5lbCBzaWRlLCBhIG5ldyBjb2RlIHdpbGwNCj4+Pj4gbmVlZCB0byBjYWxsIFBI
WVNERVZPUF9zZXR1cF9nc2kgZm9yIHBhc3N0aHJvdWdoIGRldmljZXMgdG8NCj4+Pj4gcmVnaXN0
ZXIgZ3NpIHdoZW4gZG9tMCBpcyBQVkguDQo+Pj4+DQo+Pj4+IFNvLCBhZGQgUEhZU0RFVk9QX3Nl
dHVwX2dzaSBpbnRvIGh2bV9waHlzZGV2X29wIGZvciBhYm92ZQ0KPj4+PiBwdXJwb3NlLg0KPj4+
Pg0KPj4+PiBDbGFyaWZ5IHR3byBxdWVzdGlvbnM6DQo+Pj4+IEZpcnN0LCB3aHkgdGhlIGdzaSBv
ZiBkZXZpY2VzIGJlbG9uZyB0byBQVkggZG9tMCBjYW4gd29yaz8NCj4+Pj4gQmVjYXVzZSB3aGVu
IHByb2JlIGEgZHJpdmVyIHRvIGEgbm9ybWFsIGRldmljZSwgaXQgdXNlcyB0aGUgbm9ybWFsDQo+
Pj4+IHByb2JlIGZ1bmN0aW9uIG9mIHBjaSBkZXZpY2UsIGluIGl0cyBjYWxsc3RhY2ssIGl0IHJl
cXVlc3RzIGlycQ0KPj4+PiBhbmQgdW5tYXNrIGNvcnJlc3BvbmRpbmcgaW9hcGljIG9mIGdzaSwg
dGhlbiB0cmFwIGludG8geGVuIGFuZA0KPj4+PiByZWdpc3RlciBnc2kgZmluYWxseS4NCj4+Pj4g
Q2FsbHN0YWNrIGlzKG9uIGxpbnV4IGtlcm5lbCBzaWRlKSBwY2lfZGV2aWNlX3Byb2JlLT4NCj4+
Pj4gcmVxdWVzdF90aHJlYWRlZF9pcnEtPiBpcnFfc3RhcnR1cC0+IF9fdW5tYXNrX2lvYXBpYy0+
DQo+Pj4+IGlvX2FwaWNfd3JpdGUsIHRoZW4gdHJhcCBpbnRvIHhlbiBodm1lbXVsX2RvX2lvLT4N
Cj4+Pj4gaHZtX2lvX2ludGVyY2VwdC0+IGh2bV9wcm9jZXNzX2lvX2ludGVyY2VwdC0+DQo+Pj4+
IHZpb2FwaWNfd3JpdGVfaW5kaXJlY3QtPiB2aW9hcGljX2h3ZG9tX21hcF9nc2ktPiBtcF9yZWdp
c3Rlcl9nc2kuDQo+Pj4+IFNvIHRoYXQgdGhlIGdzaSBjYW4gYmUgcmVnaXN0ZXJlZC4NCj4+Pj4N
Cj4+Pj4gU2Vjb25kLCB3aHkgdGhlIGdzaSBvZiBwYXNzdGhyb3VnaCBkZXZpY2UgY2FuJ3Qgd29y
ayB3aGVuIGRvbTANCj4+Pj4gaXMgUFZIPw0KPj4+PiBCZWNhdXNlIHdoZW4gYXNzaWduIGEgZGV2
aWNlIHRvIHBhc3N0aHJvdWdoLCBpdCB1c2VzIHRoZSBzcGVjaWZpYw0KPj4+PiBwcm9iZSBmdW5j
dGlvbiBvZiBwY2liYWNrLCBpbiBpdHMgY2FsbHN0YWNrLCBpdCBkb2Vzbid0IGluc3RhbGwgYQ0K
Pj4+PiBmYWtlIGlycSBoYW5kbGVyIGR1ZSB0byB0aGUgSVNSIGlzIG5vdCBydW5uaW5nLiBTbyB0
aGF0DQo+Pj4+IG1wX3JlZ2lzdGVyX2dzaSBvbiBYZW4gc2lkZSBpcyBuZXZlciBjYWxsZWQsIHRo
ZW4gdGhlIGdzaSBpcyBub3QNCj4+Pj4gcmVnaXN0ZXJlZC4NCj4+Pj4gQ2FsbHN0YWNrIGlzKG9u
IGxpbnV4IGtlcm5lbCBzaWRlKSBwY2lzdHViX3Byb2JlLT5wY2lzdHViX3NlaXplLT4NCj4+Pj4g
cGNpc3R1Yl9pbml0X2RldmljZS0+IHhlbl9wY2lia19yZXNldF9kZXZpY2UtPg0KPj4+PiB4ZW5f
cGNpYmtfY29udHJvbF9pc3ItPmlzcl9vbj09MC4NCj4+Pg0KPj4+IFNvOiBVbmRlcmx5aW5nIFhT
QS00NjEgd2FzIHRoZSBvYnNlcnZhdGlvbiB0aGF0IHRoZSB2ZXJ5IGxpbWl0ZWQgc2V0IG9mDQo+
Pj4gY2FzZXMgd2hlcmUgdGhpcyBmYWtlIElSUSBoYW5kbGVyIGlzIGluc3RhbGxlZCBpcyBhbiBp
c3N1ZS4gVGhlIHByb2JsZW0NCj4+PiBvZiBkZWFsaW5nIHdpdGggImZhbHNlIiBJUlFzIHdoZW4g
YSBsaW5lLWJhc2VkIGludGVycnVwdCBpcyBzaGFyZWQNCj4+PiBiZXR3ZWVuIGRldmljZXMgYWZm
ZWN0cyBhbGwgcGFydGllcywgbm90IGp1c3QgRG9tMCBhbmQgbm90IGp1c3QgUFYNCj4+PiBndWVz
dHMuIFRoZXJlZm9yZSBhbiBhbHRlcm5hdGl2ZSB0byB0aGUgaW50cm9kdWN0aW9uIG9mIGEgbmV3
IGh5cGVyY2FsbA0KPj4+IHdvdWxkIGJlIHRvIHNpbXBseSBsZXZlcmFnZSB0aGF0IHRoZSBpbnN0
YWxsYXRpb24gb2Ygc3VjaCBhIGhhbmRsZXINCj4+PiB3aWxsIG5lZWQgd2lkZW5pbmcgYW55d2F5
Lg0KPj4+DQo+Pj4gSG93ZXZlciwgdGhlIGluc3RhbGxhdGlvbiBvZiBzYWlkIGhhbmRsZXIgcHJl
c2VudGx5IGFsc28gb2NjdXJzIGluDQo+Pj4gY2FzZXMgd2hlcmUgaXQncyBub3QgcmVhbGx5IG5l
ZWRlZCAtIHdoZW4gdGhlIGxpbmUgaXNuJ3Qgc2hhcmVkLiBUaHVzLA0KPj4+IGlmIHRoZSBoYW5k
bGVyIHJlZ2lzdHJhdGlvbiB3b3VsZCBhbHNvIGJlIGVsaW1pbmF0ZWQgd2hlbiBpdCdzIG5vdA0K
Pj4+IHJlYWxseSBuZWVkZWQsIHdlJ2QgYmUgYmFjayB0byBuZWVkaW5nIGEgc2VwYXJhdGUgaHlw
ZXJjYWxsLg0KPj4+DQo+Pj4gU28gSSB0aGluayBmaXJzdCBvZiBhbGwgaXQgbmVlZHMgZGVjaWRp
bmcgd2hhdCBpcyBnb2luZyB0byBiZSBkb25lIGluDQo+Pj4gTGludXgsIGF0IGxlYXN0IGluIHBj
aWJhY2sgKGFzIGhlcmUgd2UgY2FyZSBhYm91dCB0aGUgRG9tMCBjYXNlIG9ubHkpLg0KPj4gQWdy
ZWUsIHNvIHRoZSBjdXJyZW50IG9wdGlvbnMgYXJlIGVpdGhlciB0byB1c2UgaHlwZXJjYWxsIChQ
SFlTREVWT1Bfc2V0dXBfZ3NpKSBvciB0byBpbnN0YWxsIGZha2UgSVJRIGhhbmRsZXIgaW4gcGNp
YmFjay4NCj4+IFNvLCB3ZSBtYXkgbmVlZCB0aGUgaW5wdXRzIGZyb20gdGhlIE1haW50YWluZXJz
IG9uIExpbnV4IHNpZGUuDQo+PiBIaSBTdGVmYW5vIGFuZCBKdWVyZ2VuLCB3aGF0IGFib3V0IHlv
dXIgb3BpbmlvbnM/DQo+IA0KPiBJIHdvdWxkIGdvIHdpdGggdGhlIFBIWVNERVZPUF9zZXR1cF9n
c2kgc29sdXRpb24NCg0KVGhhbmtzIFN0YWZhbm8uDQoNCklmIHVzZSBQSFlTREVWT1Bfc2V0dXBf
Z3NpIHNvbHV0aW9uLCBpdCByZXF1aXJlcyB0aGUgYWR2aWNlIG9mIHRoZSBNYWludGFpbmVycyBv
ZiB0aGlzIGZpbGUuDQpIaSBKYW4sIEFuZHJldyBhbmQgUm9nZXIsIGlzIGl0IG9rYXkgZm9yIHlv
dT8NCg0KLS0gDQpCZXN0IHJlZ2FyZHMsDQpKaXFpYW4gQ2hlbi4NCg==


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 06:17:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 06:17:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783289.1192603 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siT2A-0004GH-C6; Mon, 26 Aug 2024 06:16:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783289.1192603; Mon, 26 Aug 2024 06:16:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siT2A-0004GA-9L; Mon, 26 Aug 2024 06:16:58 +0000
Received: by outflank-mailman (input) for mailman id 783289;
 Mon, 26 Aug 2024 06:16: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=75pI=PZ=redhat.com=jasowang@srs-se1.protection.inumbo.net>)
 id 1siT29-0004G4-H5
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 06:16:57 +0000
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.133.124])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c9f64558-6372-11ef-a50b-bb4a2ccca743;
 Mon, 26 Aug 2024 08:16:55 +0200 (CEST)
Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com
 [209.85.216.71]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-34-z7E8bMVvOYmK8bKIRP2CpA-1; Mon, 26 Aug 2024 02:16:50 -0400
Received: by mail-pj1-f71.google.com with SMTP id
 98e67ed59e1d1-2d3d68d032fso4660907a91.3
 for <xen-devel@lists.xenproject.org>; Sun, 25 Aug 2024 23:16:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c9f64558-6372-11ef-a50b-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1724653013;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=dB1NfwLF4sboQ9oAiJsmEAd6cRRc4sOW3f5DA5Z/91g=;
	b=h5erD15GfJ4+04rSjlqJg8SocqzQ6ttg/ib1zQOa5uRqSZ6v6BWBcK5JYBH/QPMjfJVzEJ
	uA01hyjlUExPnAw0H6A8GVPmX8FPlJ5VE+DQP7szgyxyT4ty0fLhCgiNWo6EPbxKB8mMPd
	gtqudkCm1QiIY/5kYKN7B/J8c6HE7vc=
X-MC-Unique: z7E8bMVvOYmK8bKIRP2CpA-1
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724653009; x=1725257809;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=dB1NfwLF4sboQ9oAiJsmEAd6cRRc4sOW3f5DA5Z/91g=;
        b=qh9y1F3kC9eDfHOO0slqcOYW1LAfAMygY8eNna8Vv4u//pYGZeig+rAtI+USiWRSBs
         IUveeVo2iulaGIaImR4kDdQPW6xRwPyBwkXfeTQ+qJXyjycvTlg5tdERcFBFQkqtrJa+
         aqBkQjWyRo3ZtSzrk685b2KGvko0HSZvx51TnFSxPyxQyGF/hnML6mn4abbMamtRcgoj
         ZOsTF3fOcf0ugya+NaqY3SYzBMtvbTFX3v2L6PqP2AfJBEKy2Sc7hN0z6oNRcq64HBjV
         sAJUyHKvqmlgTahOlLGlybwm9bwTqsMxs6bb4UlqwFGMr+SRRxrtCZ+THdmSCDAexd9S
         p6XQ==
X-Forwarded-Encrypted: i=1; AJvYcCWgqt8danf8fpG2Fhp1KTMcyqXPp5v6ZciZxNKanzfrfsFVWfkRKedLFAYla2OFwGv4+MbhgiWz7tQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxVhbuC/LOo/heGdCoeQFPdwWDte4oC0B1vB+NwJNTALVfiMD6G
	MBHTBGPbVEtdTvjJtQwKIpoFBNIpFdpW2J8IQ65oPIicX0paZVwldeMFoGlSGAISt647cE4E6F3
	ses4vxk8+pcKnCKStEBTwSeXOfAh9Y3YDmbJIR1k8+yOHIfeQVejcWIvELSLwIVHHiRhagiHDmd
	DfnplmKtmSM1NPJq0c4MbD5IAYBuYPjkPKV9/QoSg=
X-Received: by 2002:a17:90a:6287:b0:2d3:cd27:c480 with SMTP id 98e67ed59e1d1-2d646d247f9mr9809276a91.33.1724653008872;
        Sun, 25 Aug 2024 23:16:48 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IE0WjIzDYmdUX7OY9EeJBLH76SMB2mi2zdVZl4NauXJ/eBoNO23zRck1BCKv7ZS6PzenwJTH61bASpm1vxRFd8=
X-Received: by 2002:a17:90a:6287:b0:2d3:cd27:c480 with SMTP id
 98e67ed59e1d1-2d646d247f9mr9809253a91.33.1724653008351; Sun, 25 Aug 2024
 23:16:48 -0700 (PDT)
MIME-Version: 1.0
References: <20240824035817.1163502-1-hch@lst.de>
In-Reply-To: <20240824035817.1163502-1-hch@lst.de>
From: Jason Wang <jasowang@redhat.com>
Date: Mon, 26 Aug 2024 14:16:36 +0800
Message-ID: <CACGkMEsK8k=yX2ZytMJQhdZi4PS9-7KLUYmf2oGLu-UvNEYzug@mail.gmail.com>
Subject: Re: clearly mark DMA_OPS support as an architecture feasture
To: Christoph Hellwig <hch@lst.de>
Cc: iommu@lists.linux.dev, Marek Szyprowski <m.szyprowski@samsung.com>, 
	Robin Murphy <robin.murphy@arm.com>, Sakari Ailus <sakari.ailus@linux.intel.com>, 
	Bingbu Cao <bingbu.cao@intel.com>, "Michael S . Tsirkin" <mst@redhat.com>, linux-kernel@vger.kernel.org, 
	linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, 
	linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, 
	linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, 
	sparclinux@vger.kernel.org, linux-media@vger.kernel.org, 
	virtualization@lists.linux.dev, xen-devel@lists.xenproject.org
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Sat, Aug 24, 2024 at 11:58=E2=80=AFAM Christoph Hellwig <hch@lst.de> wro=
te:
>
> Hi all,
>
> we've had a long standing problems where drivers try to hook into the
> DMA_OPS mechanisms to override them for something that is not DMA, or
> to introduce additional dispatching.
>
> Now that we are not using DMA_OPS support for dma-iommu and can build
> kernels without DMA_OPS support on many common setups this becomes even
> more problematic.
>
> This series renames the option to ARCH_DMA_OPS and adds very explicit
> comment to not use it in drivers.  The ipu6 and vdpa_sim/user drivers
> that abuse the mechanism are made to depend on the option instead of
> selecting it with a big comment, but I expect this to be fixed rather
> sooner than later (I know the ipu6 maintainers are on it based on a
> previous discussion).
>

I will try to fix the simulator considering virtio has already had
mapping ops now.

Thanks



From xen-devel-bounces@lists.xenproject.org Mon Aug 26 06:27:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 06:27:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783294.1192615 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siTCc-0006SX-CM; Mon, 26 Aug 2024 06:27:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783294.1192615; Mon, 26 Aug 2024 06:27:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siTCc-0006SQ-7h; Mon, 26 Aug 2024 06:27:46 +0000
Received: by outflank-mailman (input) for mailman id 783294;
 Mon, 26 Aug 2024 06:27:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=75pI=PZ=redhat.com=jasowang@srs-se1.protection.inumbo.net>)
 id 1siTCb-0006SK-FX
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 06:27:45 +0000
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.133.124])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4d0d60b5-6374-11ef-a50b-bb4a2ccca743;
 Mon, 26 Aug 2024 08:27:44 +0200 (CEST)
Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com
 [209.85.216.72]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-30-4zu6-BmuOWuzEIp6jAKvRw-1; Mon, 26 Aug 2024 02:27:40 -0400
Received: by mail-pj1-f72.google.com with SMTP id
 98e67ed59e1d1-2cb5847ff53so4911377a91.2
 for <xen-devel@lists.xenproject.org>; Sun, 25 Aug 2024 23:27:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4d0d60b5-6374-11ef-a50b-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1724653663;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=Rs8AUYhSmmGXuJkf0JZ3EFqr6hWEcb9C7Q1wG4ibjBY=;
	b=QUUE5btv6RfWxCyQDJ/2p9TcfOTYnP7Db37oj4pjFUN1V//urHQ7fJtRcWoikQm/qkEs/Q
	LcK/LH3bqSZvC6qolazKP1EjNt5V5gI+v8kdZZsbcZKzEwfFYV7nPj1LAfVZHkoNz5Imr4
	ysCOBykQ1lEmXMtecPrMY0vF0qTxxBU=
X-MC-Unique: 4zu6-BmuOWuzEIp6jAKvRw-1
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724653659; x=1725258459;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Rs8AUYhSmmGXuJkf0JZ3EFqr6hWEcb9C7Q1wG4ibjBY=;
        b=V1jyQNk5svAsUQ3olMfmPiOI7zvedhKOACdlG7zGbDjlGOH3ntI7YKZWsoRcawA08h
         lNyN0tsxammH8K9u7MzOvrFRFIPJp0nblpuB5uGQYXpMPx44YgU1o7h+IqJgFMEwRlA9
         LCifEBdyNgez1a6V3oni0BDTPf9SOMQAwwlYwAhnfa1kBvn7UF2K8YO0U39G+tIZoWFI
         0OlOWj/DUL9AZMfQWOZE8OlkNmaKdw6mp40ghQY+BQJ+GVZfRh+ulFaXIk1wvV7Ei/jd
         QBkJ5WN5xZaiTQ/dvT2oPpKCpc4AHynrYJZXVgmUBcM3f+p2kbHvjB36NxQ3OD6BDUnG
         VO2w==
X-Forwarded-Encrypted: i=1; AJvYcCXGxA99EDiotP4WY2i/BaFWOJpJ7Y4NjJzH2Ht3W7DgQC+unjp2auGBRSHiy9Qhttf/vXvesmuQ51U=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzYsWJQJf9Xr0WXIzr9CwfhLPeXpvcJQRELmoZsbPTfvCU/Ew5s
	bZ4Mks8EW7aEcPA/4wJL9xaSiQugXS8otKAj9u1p3RWbbLJemJ8jjIq+WwwNULB4z1u0CKq2MHV
	VGi83JYhTvTtn8ztLRM7eCXJZS4xj5m0bQ4ng9xB1ZQ2Lbyj4hVupIc6RpJY6aIKDoPliKi6y46
	CP+VHLXCGZODFO6UjW7Bs6S/rgNjFg75oa7XQtfyg=
X-Received: by 2002:a17:90b:ecd:b0:2cd:619:6826 with SMTP id 98e67ed59e1d1-2d646d4dcfbmr11272913a91.34.1724653659608;
        Sun, 25 Aug 2024 23:27:39 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IGP3GZqzlMhqPuuYHeWu96SGn+Tu3LWd1hDEbxpGhfc1OXWvtkUWRElPm7DPTwJzR3LmdWyUKTz2DeMu9Do6/Q=
X-Received: by 2002:a17:90b:ecd:b0:2cd:619:6826 with SMTP id
 98e67ed59e1d1-2d646d4dcfbmr11272892a91.34.1724653659123; Sun, 25 Aug 2024
 23:27:39 -0700 (PDT)
MIME-Version: 1.0
References: <20240824035817.1163502-1-hch@lst.de> <CACGkMEsK8k=yX2ZytMJQhdZi4PS9-7KLUYmf2oGLu-UvNEYzug@mail.gmail.com>
In-Reply-To: <CACGkMEsK8k=yX2ZytMJQhdZi4PS9-7KLUYmf2oGLu-UvNEYzug@mail.gmail.com>
From: Jason Wang <jasowang@redhat.com>
Date: Mon, 26 Aug 2024 14:27:27 +0800
Message-ID: <CACGkMEu83MjTpkSS1mX02ar8RNDc5T4bsd4kkGHYhkH7LZY-wA@mail.gmail.com>
Subject: Re: clearly mark DMA_OPS support as an architecture feasture
To: Christoph Hellwig <hch@lst.de>, "Michael S . Tsirkin" <mst@redhat.com>
Cc: iommu@lists.linux.dev, Marek Szyprowski <m.szyprowski@samsung.com>, 
	Robin Murphy <robin.murphy@arm.com>, Sakari Ailus <sakari.ailus@linux.intel.com>, 
	Bingbu Cao <bingbu.cao@intel.com>, linux-kernel@vger.kernel.org, 
	linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, 
	linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, 
	linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, 
	sparclinux@vger.kernel.org, linux-media@vger.kernel.org, 
	virtualization@lists.linux.dev, xen-devel@lists.xenproject.org
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 26, 2024 at 2:16=E2=80=AFPM Jason Wang <jasowang@redhat.com> wr=
ote:
>
> On Sat, Aug 24, 2024 at 11:58=E2=80=AFAM Christoph Hellwig <hch@lst.de> w=
rote:
> >
> > Hi all,
> >
> > we've had a long standing problems where drivers try to hook into the
> > DMA_OPS mechanisms to override them for something that is not DMA, or
> > to introduce additional dispatching.
> >
> > Now that we are not using DMA_OPS support for dma-iommu and can build
> > kernels without DMA_OPS support on many common setups this becomes even
> > more problematic.
> >
> > This series renames the option to ARCH_DMA_OPS and adds very explicit
> > comment to not use it in drivers.  The ipu6 and vdpa_sim/user drivers
> > that abuse the mechanism are made to depend on the option instead of
> > selecting it with a big comment, but I expect this to be fixed rather
> > sooner than later (I know the ipu6 maintainers are on it based on a
> > previous discussion).
> >
>
> I will try to fix the simulator considering virtio has already had
> mapping ops now.

Actually I meant, we can extend the virtio_config_ops to allow mapping
ops there, then simulator and VDUSE can hook the map ops there.

Not sure if Michael is fine with this.

Thanks

>
> Thanks



From xen-devel-bounces@lists.xenproject.org Mon Aug 26 06:30:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 06:30:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783315.1192623 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siTEx-00083k-Ms; Mon, 26 Aug 2024 06:30:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783315.1192623; Mon, 26 Aug 2024 06:30:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siTEx-00083d-K2; Mon, 26 Aug 2024 06:30:11 +0000
Received: by outflank-mailman (input) for mailman id 783315;
 Mon, 26 Aug 2024 06:30:10 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=CvV/=PZ=lst.de=hch@srs-se1.protection.inumbo.net>)
 id 1siTEw-00083X-DJ
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 06:30:10 +0000
Received: from verein.lst.de (verein.lst.de [213.95.11.211])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a35f8f6a-6374-11ef-8776-851b0ebba9a2;
 Mon, 26 Aug 2024 08:30:08 +0200 (CEST)
Received: by verein.lst.de (Postfix, from userid 2407)
 id 8552E68AA6; Mon, 26 Aug 2024 08:30:03 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a35f8f6a-6374-11ef-8776-851b0ebba9a2
Date: Mon, 26 Aug 2024 08:30:02 +0200
From: Christoph Hellwig <hch@lst.de>
To: Jason Wang <jasowang@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>, "Michael S . Tsirkin" <mst@redhat.com>,
	iommu@lists.linux.dev, Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Bingbu Cao <bingbu.cao@intel.com>, linux-kernel@vger.kernel.org,
	linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
	sparclinux@vger.kernel.org, linux-media@vger.kernel.org,
	virtualization@lists.linux.dev, xen-devel@lists.xenproject.org
Subject: Re: clearly mark DMA_OPS support as an architecture feasture
Message-ID: <20240826063002.GA30266@lst.de>
References: <20240824035817.1163502-1-hch@lst.de> <CACGkMEsK8k=yX2ZytMJQhdZi4PS9-7KLUYmf2oGLu-UvNEYzug@mail.gmail.com> <CACGkMEu83MjTpkSS1mX02ar8RNDc5T4bsd4kkGHYhkH7LZY-wA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <CACGkMEu83MjTpkSS1mX02ar8RNDc5T4bsd4kkGHYhkH7LZY-wA@mail.gmail.com>
User-Agent: Mutt/1.5.17 (2007-11-01)

On Mon, Aug 26, 2024 at 02:27:27PM +0800, Jason Wang wrote:
> Actually I meant, we can extend the virtio_config_ops to allow mapping
> ops there, then simulator and VDUSE can hook the map ops there.

>From a quick glance that feels like the right layer of abstraction,
although the config part of the name feels wrong at that point.



From xen-devel-bounces@lists.xenproject.org Mon Aug 26 06:32:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 06:32:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783322.1192634 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siTHL-0000E9-6u; Mon, 26 Aug 2024 06:32:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783322.1192634; Mon, 26 Aug 2024 06:32:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siTHL-0000E2-32; Mon, 26 Aug 2024 06:32:39 +0000
Received: by outflank-mailman (input) for mailman id 783322;
 Mon, 26 Aug 2024 06:32: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=75pI=PZ=redhat.com=jasowang@srs-se1.protection.inumbo.net>)
 id 1siTHJ-0000Dw-F1
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 06:32:37 +0000
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.129.124])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id faf154a9-6374-11ef-a50b-bb4a2ccca743;
 Mon, 26 Aug 2024 08:32:36 +0200 (CEST)
Received: from mail-vs1-f70.google.com (mail-vs1-f70.google.com
 [209.85.217.70]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-581-GAU5o5qGNPmmD9l4NVVahg-1; Mon, 26 Aug 2024 02:32:31 -0400
Received: by mail-vs1-f70.google.com with SMTP id
 ada2fe7eead31-498cd41e002so1479024137.1
 for <xen-devel@lists.xenproject.org>; Sun, 25 Aug 2024 23:32:31 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: faf154a9-6374-11ef-a50b-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1724653954;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=JESifInmWvZeQwWI8Jn8J0cYeIeDZ3prAXhvDlTsSj8=;
	b=KItGRfcS2Lvxd1m0u7N4RiETE+AfSkM3mh2FoTfQjeKJLsutgttZ/inBtuvU85/F3ux3Bl
	uugK4gheL50W6LPxVyO62C5/UNCbJaKsdkYfvTtWACpxvvSb52PSJ9MGeXr2HjXcMPAr+R
	ejU9tTj3y6wxYp5Q2AYQWscWjE/pc1g=
X-MC-Unique: GAU5o5qGNPmmD9l4NVVahg-1
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724653951; x=1725258751;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=JESifInmWvZeQwWI8Jn8J0cYeIeDZ3prAXhvDlTsSj8=;
        b=tuAyVBAnXr/2x8Dp7/+Fu8buGVnXIHeUm4LC4oPhTiEKB0OYILWFNAumRgfpRuYd9n
         fyFLCQywPSXDch1V2fkUtAfgZUevwjJyyG9u7C1BC1CdvFgWx6gc7Yyho2933uhYmos1
         WbWDS5Pu72GncpC1A4XFjXya+B4bGcmlrsdgQ+P4idCUqHhbwpA/9MgV739zT6tG05jY
         pbOaJHH3I+xmdrbbZNp98LLJL9zlpbCArfa6OrhhBJjMogBDzuKMeheXctMzoISNGwNz
         eROhF1sT6MaX5jyFCbMNF4ZmVbT2tLRpB98IKFA8+doj1k9hVznBk3S3shXA3o5DRpJh
         D6Vg==
X-Forwarded-Encrypted: i=1; AJvYcCUEphv6mrL0wTTSLH/83aZEIAsore6u5mOibvhRi2MAlGwsKfe8yc+8FwlthHWuB/TXie8GWM6B7kk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzpapKYMalva/iTzFHS43GZ7cAWtZjC786/KRuO68js+QQbN1be
	Ss2Hq4yCAAyg2SI5ih2irdDw+vvSxDE5NSrwZvZlCeD1iEy4DQEXfnuJcksc12xug+ZPVGP/wzG
	JT7YHsy4wbQSZMD63dGURbfohiNg13n5NOf8cBPIf/EG7xff3JD+Y6MYFtd8f4NbTLYcF9mrNUx
	YdxFdg5oJ6UcGHEag9aVc2su/5DZnn0BIy8W1DXyM=
X-Received: by 2002:a05:6102:3f0f:b0:498:cca9:8b3 with SMTP id ada2fe7eead31-498f4768d98mr6498557137.31.1724653950690;
        Sun, 25 Aug 2024 23:32:30 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IEwydcuFOVlgtFmwjWlxiF2u2xtiMO6UvY+/x7l/PEgUFs/udwBSaHF5gxdau0K58G8iWDDv631otNdoDoL8Rg=
X-Received: by 2002:a05:6102:3f0f:b0:498:cca9:8b3 with SMTP id
 ada2fe7eead31-498f4768d98mr6498530137.31.1724653950260; Sun, 25 Aug 2024
 23:32:30 -0700 (PDT)
MIME-Version: 1.0
References: <20240824035817.1163502-1-hch@lst.de> <CACGkMEsK8k=yX2ZytMJQhdZi4PS9-7KLUYmf2oGLu-UvNEYzug@mail.gmail.com>
 <CACGkMEu83MjTpkSS1mX02ar8RNDc5T4bsd4kkGHYhkH7LZY-wA@mail.gmail.com> <20240826063002.GA30266@lst.de>
In-Reply-To: <20240826063002.GA30266@lst.de>
From: Jason Wang <jasowang@redhat.com>
Date: Mon, 26 Aug 2024 14:32:15 +0800
Message-ID: <CACGkMEvB20-iwNKepBdJBNAvxN-5+MduxnX6XDbPFsVA4hNz5A@mail.gmail.com>
Subject: Re: clearly mark DMA_OPS support as an architecture feasture
To: Christoph Hellwig <hch@lst.de>
Cc: "Michael S . Tsirkin" <mst@redhat.com>, iommu@lists.linux.dev, 
	Marek Szyprowski <m.szyprowski@samsung.com>, Robin Murphy <robin.murphy@arm.com>, 
	Sakari Ailus <sakari.ailus@linux.intel.com>, Bingbu Cao <bingbu.cao@intel.com>, 
	linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, 
	linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, 
	linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, 
	linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, 
	linux-media@vger.kernel.org, virtualization@lists.linux.dev, 
	xen-devel@lists.xenproject.org
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 26, 2024 at 2:30=E2=80=AFPM Christoph Hellwig <hch@lst.de> wrot=
e:
>
> On Mon, Aug 26, 2024 at 02:27:27PM +0800, Jason Wang wrote:
> > Actually I meant, we can extend the virtio_config_ops to allow mapping
> > ops there, then simulator and VDUSE can hook the map ops there.
>
> From a quick glance that feels like the right layer of abstraction,
> although the config part of the name feels wrong at that point.

Right, or we could have a dedicated map_ops instead of trying to use
virtio_config_ops.

Thanks

>



From xen-devel-bounces@lists.xenproject.org Mon Aug 26 07:32:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 07:32:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783333.1192644 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siUCv-0003Dy-EG; Mon, 26 Aug 2024 07:32:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783333.1192644; Mon, 26 Aug 2024 07:32:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siUCv-0003Dr-AU; Mon, 26 Aug 2024 07:32:09 +0000
Received: by outflank-mailman (input) for mailman id 783333;
 Mon, 26 Aug 2024 07:32:07 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siUCt-0003Dh-IZ; Mon, 26 Aug 2024 07:32:07 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siUCt-0006wG-0b; Mon, 26 Aug 2024 07:32:07 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siUCs-0002ky-JH; Mon, 26 Aug 2024 07:32:06 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1siUCs-00016C-In; Mon, 26 Aug 2024 07:32:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=KNL+JNy3CKpG11x2CxkZYxH7eOjNAE4zKbO8vY6pVTU=; b=vvAX+vF4zN5V3gAmux/Ivzjouz
	8EHLyQhukLfqxwd2NXgrWLxOeu4AwRM+QkiUkTkI8gLD4lcK2g4MYBkTOrc8IA1iA+KF3+/B7BYf+
	HTwUPei5D41bsREXK74uhRbApWqE9IANw30aWwAyg0F8e8ylU79Kvmp10KcW/BvYiUzw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187348-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187348: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=1cc0fae8d9e2681fc6a33e5602ce8368809f9465
X-Osstest-Versions-That:
    ovmf=b158dad150bf02879668f72ce306445250838201
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 26 Aug 2024 07:32:06 +0000

flight 187348 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187348/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 1cc0fae8d9e2681fc6a33e5602ce8368809f9465
baseline version:
 ovmf                 b158dad150bf02879668f72ce306445250838201

Last test of basis   187222  2024-08-13 05:11:34 Z   13 days
Testing same since   187348  2024-08-26 05:41:34 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Mike Maslenkin <mike.maslenkin@gmail.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   b158dad150..1cc0fae8d9  1cc0fae8d9e2681fc6a33e5602ce8368809f9465 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 07:35:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 07:35:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783340.1192654 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siUFo-0003nF-Qo; Mon, 26 Aug 2024 07:35:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783340.1192654; Mon, 26 Aug 2024 07:35:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siUFo-0003n8-OB; Mon, 26 Aug 2024 07:35:08 +0000
Received: by outflank-mailman (input) for mailman id 783340;
 Mon, 26 Aug 2024 07:35:07 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=SW9P=PZ=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siUFn-0003mx-T0
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 07:35:07 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b68c82a6-637d-11ef-8776-851b0ebba9a2;
 Mon, 26 Aug 2024 09:35:05 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2f3ea86377aso41660461fa.1
 for <xen-devel@lists.xenproject.org>; Mon, 26 Aug 2024 00:35:05 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a4c43dcsm5504215a12.69.2024.08.26.00.35.04
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 26 Aug 2024 00:35:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b68c82a6-637d-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724657705; x=1725262505; 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=D3wrz/wXUtAoX4MlKaY6tCmyhosp49RzRGS6sqJiMZ0=;
        b=QrLHl6G0qyXIvK2VvCcWdtWkAExx8GMgRLuvnBRqYW3HX9oHBsXYrVFghhfkIit8Oy
         kzXJJiYwwOkx5wY557A4CmAnfyPX/dGHPIQf/jJt88Vk/LfMFlMWkRypMypP8Wdvy/R1
         Q5R22mvLziyroRjPWRgzPg9jATbv3g+9rbCNcf/X0bpCD7xzw6SmXHRVwBfZl2rNoeqd
         qsG4kusuV7EUZO+f2degtmWMVenn1jYBO2IZ2qG1SGNbeHqyY3C8NjZuimQfMaJ71EU3
         daoeppMNQowCLviKgONGZaufDJydsarTa5sv4UyFd74lXfXB17E7FF7SFGosERX7fO4N
         40qQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724657705; x=1725262505;
        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=D3wrz/wXUtAoX4MlKaY6tCmyhosp49RzRGS6sqJiMZ0=;
        b=IEVhDZfEqAJQdzebhlhP/T29QSuNW/+y5w7a7uyOEGwlurdvMm01tpYkuf9cOKk+Bf
         Nh+y94+nj6vDXX9XmI4xFc/q8FjKgjbxqW+MqmOqplXJgoCyN/JJT+3E6hBuUg0tFdME
         X2nKWsgtljbhpIsOqcwNf89CNQFm4T44Sh1ZsYWmV6MMMAd9orgzZsLqXgmilXya0FGB
         vUxvQjMr3HbFaBZB5n3M+7ClOGh11k8Wt/1Ev8sEkj++rfFtGiqvvgFpEJQcR2fuXZJ1
         e1qg3C5i9TRR4xTomjE+rVfvwnBVT/KqeOPNdmcgKVlOUt3ip+roKXNm4mg5afmYgm+p
         Bw+g==
X-Forwarded-Encrypted: i=1; AJvYcCVgkizqDEvYZnaOmjj+wZKCNMgnmvwKuRq5LI+4bzfe4dFWO2Ih6XT2oIRgDGp0IEo5lcGfjvLh1WQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzpHoDVma9/QaBoYqGgwq1pG91jeauhgYOAI8+Za/TCzT92UppT
	3tNHc6wOf9KKwchcxGikT6Q63stPWiy3gTMb33Qb4kdMeDpDzcHwCaVdsyb/QA==
X-Google-Smtp-Source: AGHT+IFA8rA1Qw+HeIHe4PjVONsiMSU76kVNkm8eg2Y56aswRGku5KGndyyHShXLGk+Px+nx5YtCQQ==
X-Received: by 2002:a05:651c:507:b0:2ef:2dc7:a8f7 with SMTP id 38308e7fff4ca-2f4f48ef4bcmr60599891fa.7.1724657705067;
        Mon, 26 Aug 2024 00:35:05 -0700 (PDT)
Message-ID: <6d527021-7d71-452a-b4fc-5a41f6ca8493@suse.com>
Date: Mon, 26 Aug 2024 09:35:05 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v13 3/6] x86/pvh: Add PHYSDEVOP_setup_gsi for PVH dom0
To: Jiqian Chen <Jiqian.Chen@amd.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, Wei Liu
 <wl@xen.org>, George Dunlap <gwd@xenproject.org>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Anthony PERARD <anthony@xenproject.org>, Juergen Gross <jgross@suse.com>,
 "Daniel P . Smith" <dpsmith@apertussolutions.com>,
 Stewart Hildebrand <Stewart.Hildebrand@amd.com>,
 Huang Rui <ray.huang@amd.com>, xen-devel@lists.xenproject.org
References: <20240816110820.75672-1-Jiqian.Chen@amd.com>
 <20240816110820.75672-4-Jiqian.Chen@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240816110820.75672-4-Jiqian.Chen@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 16.08.2024 13:08, Jiqian Chen wrote:
> The gsi of a passthrough device must be configured for it to be
> able to be mapped into a hvm domU.
> But When dom0 is PVH, the gsis may not get registered(see below
> clarification), it causes the info of apic, pin and irq not be
> added into irq_2_pin list, and the handler of irq_desc is not set,
> then when passthrough a device, setting ioapic affinity and vector
> will fail.
> 
> To fix above problem, on Linux kernel side, a new code will
> need to call PHYSDEVOP_setup_gsi for passthrough devices to
> register gsi when dom0 is PVH.
> 
> So, add PHYSDEVOP_setup_gsi into hvm_physdev_op for above
> purpose.
> 
> Clarify two questions:
> First, why the gsi of devices belong to PVH dom0 can work?
> Because when probe a driver to a normal device, it uses the normal
> probe function of pci device, in its callstack, it requests irq
> and unmask corresponding ioapic of gsi, then trap into xen and
> register gsi finally.
> Callstack is(on linux kernel side) pci_device_probe->
> request_threaded_irq-> irq_startup-> __unmask_ioapic->
> io_apic_write, then trap into xen hvmemul_do_io->
> hvm_io_intercept-> hvm_process_io_intercept->
> vioapic_write_indirect-> vioapic_hwdom_map_gsi-> mp_register_gsi.
> So that the gsi can be registered.
> 
> Second, why the gsi of passthrough device can't work when dom0
> is PVH?
> Because when assign a device to passthrough, it uses the specific
> probe function of pciback, in its callstack, it doesn't install a
> fake irq handler due to the ISR is not running. So that
> mp_register_gsi on Xen side is never called, then the gsi is not
> registered.
> Callstack is(on linux kernel side) pcistub_probe->pcistub_seize->
> pcistub_init_device-> xen_pcibk_reset_device->
> xen_pcibk_control_isr->isr_on==0.
> 
> Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
> Signed-off-by: Huang Rui <ray.huang@amd.com>
> Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Mon Aug 26 07:51:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 07:51:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783347.1192664 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siUW0-0007kR-7Y; Mon, 26 Aug 2024 07:51:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783347.1192664; Mon, 26 Aug 2024 07:51:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siUW0-0007kK-3s; Mon, 26 Aug 2024 07:51:52 +0000
Received: by outflank-mailman (input) for mailman id 783347;
 Mon, 26 Aug 2024 07:51:51 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=SW9P=PZ=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siUVz-0007kE-6A
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 07:51:51 +0000
Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com
 [2a00:1450:4864:20::52b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0c278cbe-6380-11ef-8776-851b0ebba9a2;
 Mon, 26 Aug 2024 09:51:48 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5bf068aebe5so5180120a12.0
 for <xen-devel@lists.xenproject.org>; Mon, 26 Aug 2024 00:51:48 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a3ca46esm5283301a12.27.2024.08.26.00.51.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 26 Aug 2024 00:51:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0c278cbe-6380-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724658708; x=1725263508; 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=nQfTusO5nJzIzPnXsNYpcFkmNaNtLqVSB2phx596pB4=;
        b=Gxdsk4xMXHM+5bK7SF120ZMr0k9o6UiSAml0Xwnq/ZkMTPXKkUDJ8Xg43TMyozIVu9
         QaqLO6BAo3CgCid7KoeiQzAk5sRa6YVh/YgncA3EAHb6rnmKkmozkHHX/z81kBHcIJt3
         mip3WuPgPUyGJQ+Llny6/xXbbSrq25Joxr7vFq+jAk7UVKqBHuaIDm9AxwgX2+UWYZdb
         oTR6lvrqvfyUKfnYetBZ5mO61WyEbEzH9S/253a0B8uvwIVQ5G9se3kLNbGXtKQROfKS
         ZJQR/6GaHnMofPW0OvRrU28hStaegbI5iIl1VoT3WM3OzUQM5qT8RVLTv17hRzltnfox
         2k6Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724658708; x=1725263508;
        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=nQfTusO5nJzIzPnXsNYpcFkmNaNtLqVSB2phx596pB4=;
        b=UoMF6d5a0LypjHNUMhjgA/fVl/i+14apteUPlb7Pz0fDGiEVE91cDYToXJHrQcOBRp
         BGfO3OzoOHXec2PnLLEwQEoVTS46XZ9oGCSa+CVV96l6dgPfwNajYxq9AM0OQMd/Toro
         6FzGQJ7IKBStqBjcMKo/TwD8oGUf+jrwIM6UY5QbnaCdiP7veCNzT0MV1QujeXFG/iJm
         2g/92ft894morqVFY3jtbZr7zW4x5nrKQbCXeoo9UF8QzVeSa9GDRVTvQKmTRtwppumo
         EBH9z1txq6oU/U58ASWrYz6c8UCN9I2umL0TtsBeHveOtf8N1rO4Snae6lw+PHfLO/Op
         m+Vw==
X-Forwarded-Encrypted: i=1; AJvYcCUMaoiiOwBjcH0Bt3HB2s+OArQI+GYLO9DtQJe8f2MPeQu6gMGUZ1dlUGJUxg9vPePmlDWKksf9C2s=@lists.xenproject.org
X-Gm-Message-State: AOJu0YycxxG+ZpkvL908WYnNKuJgQEd4jrXrPnDX3gyYRMTku+FDJIp2
	8pykTYmb/v1sFgBee5YANVUIZcTj9ujHia6HzWQKRw4j3KpnXpxRw1GV/9kfyA==
X-Google-Smtp-Source: AGHT+IHqv0vtX3UhnJ7kvoxjV8O0wKezYqzKW1wKn0TGgiB42nV7weu3oyi6JwbqGTrz5nglaP4IdQ==
X-Received: by 2002:a05:6402:5cd:b0:5c0:8ea7:3deb with SMTP id 4fb4d7f45d1cf-5c08ea73e93mr5512095a12.22.1724658707752;
        Mon, 26 Aug 2024 00:51:47 -0700 (PDT)
Message-ID: <0b49dff4-974a-4631-a403-bb5b0516d616@suse.com>
Date: Mon, 26 Aug 2024 09:51:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/boot: Preserve the value clobbered by the
 load-base calculation
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240823131029.1025984-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240823131029.1025984-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 23.08.2024 15:10, Andrew Cooper wrote:
> From: Frediano Ziglio <frediano.ziglio@cloud.com>
> 
> Right now, Xen clobbers the value at 0xffc when performing it's load-base
> calculation.  We've got plenty of free registers at this point, so the value
> can be preserved easily.
> 
> This fixes a real bug booting under Coreboot+SeaBIOS, where 0xffc happens to
> be the cbmem pointer (e.g. Coreboot's dmesg ring, among other things).
> 
> However, there's also a better choice of memory location to use than 0xffc, as
> all our supported boot protocols have a pointer to an info structure in %ebx.
> 
> Update the documentation to match.
> 
> Fixes: 1695e53851e5 ("x86/boot: Fix the boot time relocation calculations")
> Fixes: d96bb172e8c9 ("x86/entry: Early PVH boot code")
> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
with two nits:

> --- a/docs/hypervisor-guide/x86/how-xen-boots.rst
> +++ b/docs/hypervisor-guide/x86/how-xen-boots.rst
> @@ -96,6 +96,12 @@ Xen, once loaded into memory, identifies its position in order to relocate
>  system structures.  For 32bit entrypoints, this necessarily requires a call
>  instruction, and therefore a stack, but none of the ABIs provide one.
>  
> -Overall, given that on a BIOS-based system, the IVT and BDA occupy the first
> -5/16ths of the first page of RAM, with the rest free to use, Xen assumes the
> -top of the page is safe to use.
> +In each supported 32bit entry protocol, ``%ebx`` is a pointer to an info
> +structure, and it is highly likely that this structure does not overlap with
> +Xen.  Therefore we use this as as a temporary stack, preserving the prior

Double "as".

> @@ -460,21 +466,26 @@ __start:
>          /*
>           * Multiboot (both 1 and 2) specify the stack pointer as undefined
>           * when entering in BIOS circumstances.  This is unhelpful for
> -         * relocatable images, where one push/pop is required to calculate
> -         * images load address.
> +         * relocatable images, where one call (i.e. push) is required to
> +         * calculate images load address.

Perhaps "the" after "calculate" and (albeit you're the native speaker) isn't
it "image's" then?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 08:21:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 08:21:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783358.1192673 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siUyb-0005gZ-FN; Mon, 26 Aug 2024 08:21:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783358.1192673; Mon, 26 Aug 2024 08:21:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siUyb-0005gS-Cs; Mon, 26 Aug 2024 08:21:25 +0000
Received: by outflank-mailman (input) for mailman id 783358;
 Mon, 26 Aug 2024 08:21:24 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=SW9P=PZ=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siUya-0005gM-Ey
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 08:21:24 +0000
Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com
 [2a00:1450:4864:20::632])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2d47ce4f-6384-11ef-8776-851b0ebba9a2;
 Mon, 26 Aug 2024 10:21:22 +0200 (CEST)
Received: by mail-ej1-x632.google.com with SMTP id
 a640c23a62f3a-a86a37208b2so310678966b.0
 for <xen-devel@lists.xenproject.org>; Mon, 26 Aug 2024 01:21:22 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f29a4e0sm633318666b.58.2024.08.26.01.21.20
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 26 Aug 2024 01:21:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2d47ce4f-6384-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724660481; x=1725265281; 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=JxSRI57/dbar7REbw2c2FcaNkJ+kScc0xmfODQhklvo=;
        b=ahLmoe3lVtl+005nmwbKIAumXdFFi9FfeaLN9X4gbgW+fwa1ipfP2oDyRYLlBKYVvD
         vmHtumXOLGieHkGc6gxcvdpGfsjgWnkIY9aCjob2b+t9wZ2KnALSzXb/PVftMhSDBGYc
         kZTkKUtY7t5OVUXb/wivOY8dx0W0HsigadOvdR0dgEM1OMkuYO3E0bk/R5N0vZvicNd3
         kKArwVqdVIy6ruVYVJeinb//KRSHD7BXBeiHLFq/T97SlIBTn64rV4EjLcZ1eZ+IO0WD
         PG6Fwg4StDXfg/TpVH0X/M3048TuSs1cWE4fUxkBKRsV4FD4kNV8dgha06vK1xyeLgEo
         Oq/Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724660481; x=1725265281;
        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=JxSRI57/dbar7REbw2c2FcaNkJ+kScc0xmfODQhklvo=;
        b=Rjyn2HNaf3ro/jhESw1KrupEAdYQjaEhaEJSFnrNWmJV0CD4w9qOnXS05pbukJTERX
         ONORLHzd1QIMMBVwF8f0aAEa2gBIWXbzOJzRopy4FyHiTJz2UAsFqsQyqqPv/R83wwFo
         rMAvAT+J3W1D9R/RgrDx/2+n5bZDG8okztp2Gmi8AkMuiS/5BGy585EYqImSWss3Bk/v
         KmBpB/2n5Dz75HtsaodbGfYKvlywVUB56qhgCbMONY9yePORa/anllAy4BH6RgdGkivq
         2cHJISh+9rG0CE0fNKC6wV02DOdaaQyj0jhptAuKAetzlC4RconW/1/oi9TpTaBbUyMx
         4hpw==
X-Forwarded-Encrypted: i=1; AJvYcCUqVSx3J2Mh6/BpD+rHamLn4zSU+jB4rEpAo3MOpDlq1RWZU9naBm60EXy5fMqmFs0DI9HeAXzSKGw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyxzAz8/Xxj/M2TUaBRkf6FeaajLsMPJ+Sl3NEpkYIm4OA4eemc
	7Z7RwI5Gp2L3HAMDX2SO1EmKDg+WCpT4izi+tpjm2533m1b26HoUcuV60ZTBhg==
X-Google-Smtp-Source: AGHT+IHVnv/pN3wjA1meTxPQ4YcECe/NmOQ16cCDdbt1spC4VxzQL60QkHhEkwVtvOYYFGT6x15dew==
X-Received: by 2002:a17:906:f59e:b0:a7a:9144:e23b with SMTP id a640c23a62f3a-a86a52b6124mr528268766b.19.1724660481335;
        Mon, 26 Aug 2024 01:21:21 -0700 (PDT)
Message-ID: <55e6dc6c-344a-4483-90c2-e414ef4bc869@suse.com>
Date: Mon, 26 Aug 2024 10:21:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] Avoid additional relocations in trampoline code
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 xen-devel@lists.xenproject.org
References: <20240822152953.489136-1-frediano.ziglio@cloud.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: <20240822152953.489136-1-frediano.ziglio@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 22.08.2024 17:29, Frediano Ziglio wrote:
> The trampoline could have "manual" relocation entries (created
> by assembly macros and some code to use them) and (in case of PE)
> normal executable relocations.
> Remove all normal executable ones. In this way we don't have to
> worry about applying both correctly (they need proper order
> which is hard to spot looking at the code).
> 
> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>

I think this wants splitting into one patch replacing sym_offs() and a
2nd one introducing the hand-crafted __XEN_VIRT_START additions (which
may want macro-izing). Plus the justification for the change wants
extending, to actually explain what the problem is - after all there's
no issue anywhere right now.

> --- a/xen/arch/x86/boot/trampoline.S
> +++ b/xen/arch/x86/boot/trampoline.S
> @@ -73,7 +73,7 @@ trampoline_protmode_entry:
>          mov     %ecx,%cr4
>  
>          /* Load pagetable base register. */
> -        mov     $sym_offs(idle_pg_table),%eax
> +        mov     $idle_pg_table_pa, %eax
>          add     bootsym_rel(trampoline_xen_phys_start,4,%eax)
>          mov     %eax,%cr3
>  
> @@ -113,7 +113,7 @@ trampoline_protmode_entry:
>          .code64
>  start64:
>          /* Jump to high mappings. */
> -        movabs  $__high_start, %rdi
> +        movabs  $__high_start_pa + __XEN_VIRT_START, %rdi
>          jmpq    *%rdi
>  
>  #include "video.h"
> --- a/xen/arch/x86/boot/wakeup.S
> +++ b/xen/arch/x86/boot/wakeup.S
> @@ -99,7 +99,7 @@ wakeup_32:
>          mov     $bootsym_rel(wakeup_stack, 4, %esp)
>  
>          # check saved magic again
> -        mov     $sym_offs(saved_magic),%eax
> +        mov     $saved_magic_pa, %eax
>          add     bootsym_rel(trampoline_xen_phys_start, 4, %eax)
>          mov     (%eax), %eax
>          cmp     $0x9abcdef0, %eax
> @@ -112,7 +112,7 @@ wakeup_32:
>          mov     %ecx, %cr4
>  
>          /* Load pagetable base register */
> -        mov     $sym_offs(idle_pg_table),%eax
> +        mov     $idle_pg_table_pa ,%eax
>          add     bootsym_rel(trampoline_xen_phys_start,4,%eax)
>          mov     %eax,%cr3
>  
> @@ -156,7 +156,7 @@ wakeup_32:
>          .code64
>  wakeup_64:
>          /* Jump to high mappings and the higher-level wakeup code. */
> -        movabs  $s3_resume, %rbx
> +        movabs  $s3_resume_pa + __XEN_VIRT_START, %rbx
>          jmp     *%rbx
>  
>  bogus_saved_magic:

With the sym_offs() uses gone, I think it would be best if the macro was
#undef-ed ahead of the inclusion of trampoline.S. Since x86_64.S uses the
macro, that'll require careful re-arrangement of #include order.

> --- a/xen/arch/x86/xen.lds.S
> +++ b/xen/arch/x86/xen.lds.S
> @@ -71,7 +71,12 @@ SECTIONS
>    __2M_text_start = .;         /* Start of 2M superpages, mapped RX. */
>  #endif
>  
> -  start_pa = ABSOLUTE(start - __XEN_VIRT_START);
> +#define DEFINE_PA_ADDRESS(sym) sym ## _pa = ABSOLUTE(sym - __XEN_VIRT_START)
> +  DEFINE_PA_ADDRESS(start);
> +  DEFINE_PA_ADDRESS(saved_magic);
> +  DEFINE_PA_ADDRESS(idle_pg_table);
> +  DEFINE_PA_ADDRESS(__high_start);
> +  DEFINE_PA_ADDRESS(s3_resume);
>  
>    . = __XEN_VIRT_START + XEN_IMG_OFFSET;
>    _start = .;

For the cases where in assembly code you add __XEN_VIRT_START this is pretty
odd: You subtract the value here just to add it back there. Did you consider
a more straightforward approach, like introducing absolute xxx_va symbols?

Also, as a general request: Can you please become used to adding meaningful
subject prefixes to your patches?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 09:11:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 09:11:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783371.1192699 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siVkn-0006k6-7W; Mon, 26 Aug 2024 09:11:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783371.1192699; Mon, 26 Aug 2024 09:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siVkn-0006jz-4q; Mon, 26 Aug 2024 09:11:13 +0000
Received: by outflank-mailman (input) for mailman id 783371;
 Mon, 26 Aug 2024 09:11:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siVkl-0006jp-91; Mon, 26 Aug 2024 09:11:11 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siVkk-0000wL-5Y; Mon, 26 Aug 2024 09:11:10 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siVkj-0005hd-Js; Mon, 26 Aug 2024 09:11:09 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1siVkj-0006bP-JM; Mon, 26 Aug 2024 09:11:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=yl8tfztKrtu6wcOAJb4H0uxa6XXpyPfcuwwTPjgfUhY=; b=IxOr5e80X2y9GPN5XgYncZot1w
	8NCT7npxUj/3VaJJ6/qOcjmplhqDH9xVBZqKoMDIZ3k1T3xDvgm5TqZhFlfC16u3sjhqLoVC+un8P
	TQERdOeQmmGEgS4PjcvZZUdWq1whJvBX7+87Dx9mk+nrLq0ziYQ+V+LtPLYMlaQqkf2k=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187345-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187345: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=95764a0817a51741b7ffb1f78cba2a19b08ab2d1
X-Osstest-Versions-That:
    xen=95764a0817a51741b7ffb1f78cba2a19b08ab2d1
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 26 Aug 2024 09:11:09 +0000

flight 187345 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187345/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187338
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187338
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187338
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187338
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187338
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187338
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  95764a0817a51741b7ffb1f78cba2a19b08ab2d1
baseline version:
 xen                  95764a0817a51741b7ffb1f78cba2a19b08ab2d1

Last test of basis   187345  2024-08-26 01:55:46 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Mon Aug 26 10:21:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 10:21:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783385.1192711 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siWq9-0001uM-5e; Mon, 26 Aug 2024 10:20:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783385.1192711; Mon, 26 Aug 2024 10:20:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siWq9-0001uE-1D; Mon, 26 Aug 2024 10:20:49 +0000
Received: by outflank-mailman (input) for mailman id 783385;
 Mon, 26 Aug 2024 10:20:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=SW9P=PZ=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siWq7-0001u5-QE
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 10:20:47 +0000
Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com
 [2a00:1450:4864:20::12a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dbe794ab-6394-11ef-a50b-bb4a2ccca743;
 Mon, 26 Aug 2024 12:20:46 +0200 (CEST)
Received: by mail-lf1-x12a.google.com with SMTP id
 2adb3069b0e04-5343617fdddso5875256e87.0
 for <xen-devel@lists.xenproject.org>; Mon, 26 Aug 2024 03:20:46 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f4f6139sm641550966b.220.2024.08.26.03.20.45
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 26 Aug 2024 03:20:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dbe794ab-6394-11ef-a50b-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724667646; x=1725272446; 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=/qhVGALwY/dUHdwmy7J9EmaxnHbMtZrbU8ICizlTd00=;
        b=PwwuYxosfqKZLTD55opVD8O5SyZkEPWEeoaj7NcitoqG/5SjdCFtOgVuiLxVkm1Ehd
         mG56Lb/USl/43NP/qdsI7xz3KXJpiyZy/cIRSBiPmfAsxfr+c/Kqy4LBbL2HpPxg34ZI
         icpZB37aMDp0iF6FYX3t6CzyBbZrcyMF3DhQRcUBjj4anu3Ac4J9u4rB/cZIeo9M8EQ1
         BheyoND4Fdc09LwkIUXLFjjfvvn9dg7br4Tfpo630FYWKJUcoAywqPK4J898IbbR1+1T
         wvXw9w0z/5CMnikkMkOJCxnbFePl/lRTA4ILPXnO4LdobgL5HT6NBM+H0Po9c/1NGZvs
         z6UQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724667646; x=1725272446;
        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=/qhVGALwY/dUHdwmy7J9EmaxnHbMtZrbU8ICizlTd00=;
        b=MgrINgjsaJYjvbokU/c8SCDm3krUR2r5HOEY83x30WZ6EWhuJSIgfgQShDJhtxJEft
         cZbzfafS64rWKI5figH1BazisduGjMrFqaZCl031Zlv6Xfz6tJYdQuL4rBfz2mlNoZBt
         xABtimyTDixJyBT33INJ1gB8Ncqoc6648MMFyMGST7SVebISiFPYinYTz0yCa2grQqNY
         Mu6PGHlVsCkX5kaFQBp0neIn2qNz1eoYH5AhRF0On7FCPRUpiqAK1b4AuZmEV2bn2S9A
         IXAfOhTMzlouOHxhtVe80RMD93rbTR+UExaW9FyrhNHQNMH6S+qZcqfVdtT5JlKFZ1i/
         RNlQ==
X-Forwarded-Encrypted: i=1; AJvYcCVaNYkCO3sRtjE3uLGomUJtc1lKS69O+eYlUs0M6sTu++P/7Vwga0agvIvzZUv2ZgDs50X8sSDsh8M=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxkIlo9mXckmxPPLQFOG/uXSO29cn3VmidOpoWl1tMMuhyVEFSP
	d9AOak/UAvy3rE8MmfDA+LwwE/tNZiTBg5olDqR5VSkgP3My+K2Kmh8GCjegHA==
X-Google-Smtp-Source: AGHT+IEB8RfH37Y7OhgPNcZKm+tBz20EJMr4BIHCOjSRErSoUPBrnvlgLAyqKf0VqwMWUQa57ULHnQ==
X-Received: by 2002:ac2:4e06:0:b0:52e:936e:a237 with SMTP id 2adb3069b0e04-53438846debmr7122271e87.16.1724667646047;
        Mon, 26 Aug 2024 03:20:46 -0700 (PDT)
Message-ID: <fa7e4596-32fd-40d6-b762-6d55def3d9dc@suse.com>
Date: Mon, 26 Aug 2024 12:20:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v3] x86/msi: fix locking for SR-IOV devices
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <20240812203938.981588-1-stewart.hildebrand@amd.com>
 <74f88a45-a632-4ca6-9cee-95f52370b397@suse.com>
 <f59539c4-0444-4644-a522-ea33fb2b4dbe@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <f59539c4-0444-4644-a522-ea33fb2b4dbe@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 25.08.2024 20:03, Stewart Hildebrand wrote:
> On 8/13/24 10:01, Jan Beulich wrote:
>> One aspect I didn't properly consider when making the suggestion: What if,
>> without all VFs having gone away, the PF is re-added? In that case we
>> would better recycle the existing structure. That's getting a little
>> complicated, so maybe a better approach is to refuse the request (in
>> pci_remove_device()) when the list isn't empty?
> 
> I set up a test case locally to remove a PF without removing the
> associated VFs by hacking an SR-IOV PF driver. Although the PF driver
> *should* remove the VFs first, it's completely up to the particular PF
> driver how VFs/PFs are removed during hot-un-plug, in what order, or
> whether at all to remove the VFs before removing the PF. Anyway, during
> PF-only removal, at least the Linux PCI subsystem warns about it:
> 
> [  106.500334] igb 0000:01:00.0: driver left SR-IOV enabled after remove
> 
> Returning an error code in pci_remove_device() results in only a warning
> from Linux:
> 
> [  106.507011] pci 0000:01:00.0: Failed to delete - passthrough or MSI/MSI-X might fail!
> 
> Despite the warning, Linux still proceeds to remove the PF, and we would
> retain a stale PF in Xen. Re-adding (hotplugging) the just-removed PF
> led to Xen crashing in another weird way.
> 
> To handle this more gracefully, I suggest removing the VFs right away
> along with the PF in pci_remove_device() when a PF removal request comes
> along. This would satisfy the test case described here without Xen
> crashing.

Hmm. That's an option, yet would introduce an asymmetry: The PF can be
added late (after VFs), so it would only seem consistent to allow it to
be removed early (keeping the VFs). Suitably justified / commented it
may nevertheless be the route to take, for (hopefully) reducing possible
complications.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 10:30:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 10:30:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783391.1192720 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siWzP-000449-0F; Mon, 26 Aug 2024 10:30:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783391.1192720; Mon, 26 Aug 2024 10:30:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siWzO-000442-TA; Mon, 26 Aug 2024 10:30:22 +0000
Received: by outflank-mailman (input) for mailman id 783391;
 Mon, 26 Aug 2024 10:30:21 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=SW9P=PZ=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siWzN-00043w-Mr
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 10:30:21 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3145f582-6396-11ef-8776-851b0ebba9a2;
 Mon, 26 Aug 2024 12:30:19 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5bede548f7cso4919441a12.2
 for <xen-devel@lists.xenproject.org>; Mon, 26 Aug 2024 03:30:19 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f48ae0dsm643733766b.184.2024.08.26.03.30.18
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 26 Aug 2024 03:30:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3145f582-6396-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724668219; x=1725273019; 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=VT1IyEs9CC0EKgB+k94gZ+5VIa/8LSFZ0vZJITSVsXM=;
        b=GFjDFbF6fE10Yek/Ok7P82kCfkO2iim+6SG8PbjgjbuL2E0N1pULat0wPK4NkVyC/N
         4oKzav1mqwDRek23eKA93KwMYqjw9uFpeoKcFDnL7D2RRrScZy3GZvwkA46SwUKp9KN7
         IvJnYl2LFhVEWs/dr7xQN7x1Q3JOdXwtcENe6j/8g4bSbWdDkbG4DzImfprNxg9zn8Wo
         EftI/AeKryP/NqPL0blZOvJLGRoUaYrDtHwS1QGF/GNDMWF6oC2opZfHLQzbaI6ry7lp
         q+6pFSk45/kHQg2P19nBwD+1CfM/mK72dxMbEgwxnybLNDgxf3lmzNKfgGEnVl36Zv9r
         Gy2g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724668219; x=1725273019;
        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=VT1IyEs9CC0EKgB+k94gZ+5VIa/8LSFZ0vZJITSVsXM=;
        b=Gnmtyf5htmmxp0ybvJQ6KjRhbWY8bWcyykDF3rXGbRx+3qqz/gWqppooIHG+HlmBTB
         lgQZ6hd/fFhq6qh4QqA0Wr1uy/RF5O84fNXfK5ARvMz1qBNYYjFFgyjKKE9DvJ8eDzvS
         3YGo69UbKH/u5aoAacOnmPPDlhXufVbXbvlutNk1OcDKFjRaKcMyiZEQh6rCC0WVYXmA
         ZL5vq/U25holXXoybFjSS46mkprp++bZ/u+Vu1B4DubLWHurQatFZ9Pq080ZPismQJA3
         G5TRsh7XHumNuFknH9Cs/sbCbAfOcjI1lPbSM10/yVCMq9M7MyIXTjcq4x5Z08pfzpLH
         kzEg==
X-Forwarded-Encrypted: i=1; AJvYcCUIHxf6tnMB1gku4ZdNR29vojE30Qrze4BWzRPjM9Di9O9ugpAGncFhn/UCmo6JhhRrEu0Q3G1FqBI=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx6zMdnNB/saE2ZLKDS+t48ieS3Rk/4HWmXFrlEroBpQ3XEj+/t
	hThbx1+xMBRUiBYKdRybjSgcHWZLYiMVKUW1okvfCsQTRrHa+RSsBnkDJLFd+Q==
X-Google-Smtp-Source: AGHT+IFem1U9/b7YpLCYE/Ye/upLDunjJ/3iVT8rDH5rI32RVvJ+uTFptHFhOU4gMPL4sdIZAzGt/w==
X-Received: by 2002:a17:907:7214:b0:a86:798e:b8db with SMTP id a640c23a62f3a-a86a54b0e27mr493593966b.55.1724668218870;
        Mon, 26 Aug 2024 03:30:18 -0700 (PDT)
Message-ID: <841e2cde-6fc2-49d9-b947-534bd53bc00e@suse.com>
Date: Mon, 26 Aug 2024 12:30:20 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/9] xen/bitops: Introduce a multiple_bits_set() helper
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-3-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /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: <20240822230635.954557-3-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 23.08.2024 01:06, Andrew Cooper wrote:
> This will be used to simplify real logic in the following patch.  Add compile
> and boot time testing as with other bitops.
> 
> Because the expression is so simple, implement it as a function-like macro
> which is generic on the type of it's argument, rather than having multiple
> variants.
> 
> Testing function-like macros needs a minor adjustments to the infrastructure
> in xen/self-tests.h to avoid bracketing the fn parameter.  The utility of this
> outweighs the associated risks.

We may need to mark these two places as deviated.

> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
with one remark/request:

> --- a/xen/common/bitops.c
> +++ b/xen/common/bitops.c
> @@ -84,8 +84,32 @@ static void __init test_fls(void)
>      CHECK(fls64, 0x8000000000000001ULL, 64);
>  }
>  
> +static void __init test_multiple_bits_set(void)
> +{
> +    /*
> +     * multiple_bits_set() is generic on the type of it's parameter, as the
> +     * internal expression is so simple.
> +     */
> +
> +    CHECK(multiple_bits_set, 0, false);
> +    CHECK(multiple_bits_set, 1, false);
> +    CHECK(multiple_bits_set, 2, false);
> +    CHECK(multiple_bits_set, 3, true);
> +
> +    CHECK(multiple_bits_set, 1 | (1UL << (BITS_PER_LONG - 1)), true);

This is really the same as ...

> +#if BITS_PER_LONG > 32
> +    CHECK(multiple_bits_set, 1 | (1UL << 32), true);
> +    CHECK(multiple_bits_set, 1 | (1UL << 63), true);

... this, at least as long as BITS_PER_LONG > 32 in practice means
BITS_PER_LONG == 64. Perhaps not really worth keeping that line?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 10:37:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 10:37:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783400.1192729 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siX5q-0005LE-Nt; Mon, 26 Aug 2024 10:37:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783400.1192729; Mon, 26 Aug 2024 10:37:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siX5q-0005L7-LB; Mon, 26 Aug 2024 10:37:02 +0000
Received: by outflank-mailman (input) for mailman id 783400;
 Mon, 26 Aug 2024 10:37:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=SW9P=PZ=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siX5p-0005L1-E1
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 10:37:01 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2047a36a-6397-11ef-a50b-bb4a2ccca743;
 Mon, 26 Aug 2024 12:37:00 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a868b8bb0feso450503066b.0
 for <xen-devel@lists.xenproject.org>; Mon, 26 Aug 2024 03:37:00 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f48a5d0sm643268866b.159.2024.08.26.03.36.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 26 Aug 2024 03:36:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2047a36a-6397-11ef-a50b-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724668620; x=1725273420; 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=7rc61Y+zZcjwuGhZInOar4nHgYSvBeDCt6xQ7CZnHjY=;
        b=Sz+U5kJly638Sj8cveu0yw8zbDK9e/xwD67eFJgTbvInYHtavCUAGKlpgEQh/n1eW2
         rkN0gxguMmVna/zXpKjXKAITiFS59RvA0z6THAYSQw3V09tSCVx2C77b8cWvKPSJZjFd
         gVr2bWnB1k50jxjXAxU4+MV5rnxT2MQLCdEFAWI+nb1Yi+8qq57jVzJa3vMDKUUqvcZG
         tpLOF5Gz7NVVyfs64vgbZtRMWXc1F7hxkj7VOhNJH50VDugFQUVZk6iHTKNL6+qPVN3r
         DXnYJLVXTvmeq16YRlAWZ5Dxb+v6kB39OsiNePR067oAuTPfjQv/kY35k4KYuIdcfzdZ
         kk1A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724668620; x=1725273420;
        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=7rc61Y+zZcjwuGhZInOar4nHgYSvBeDCt6xQ7CZnHjY=;
        b=PbOKRlKFovcSfAFbcHlabHhrL2wDj8UnWwmojoYbrf5qZSnnKtqk8U+4FA3Uz6Kae2
         UAjpFTsJC7Rk/GEdoi3MyA/MVkESB2Lj3eMFyI6m6JfDooucznu2F9Kj9H/ZWreJvwrg
         Hn9SkbJRAkKjuqwzEC2B+RmrkomjcOoi/aaT9rMzsabBVSfRxmKkTqrN43kYj20lMtj0
         6l0cTV6rQUo/rSHmgNFlseIDXSnh/uD91Y9xEJk/T9mkCssdMUM0bO3g9lT6Kr0bWQhX
         KZPD2HkOixULpNMgVmDS94TJp1GcTpnFlY8G4QEqOFN4c0ERYkzh8sxU2VUOkMVElU7W
         jDGQ==
X-Forwarded-Encrypted: i=1; AJvYcCVqGTnShpPjyeu76n0BMX9A7C0xpnp9UD2UVMuWwoG1vcwMRMNmpuLw5GrxCWOLzMEugxcd4xMQwHk=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yxq0Zi5FOH0rn/c/26j89eH/oIKUEF5XTbDead456qee3743yml
	NtmXisVPKuEYPOlNNDpxmEFdlN2WkGuA4yAJ29K1AjzPyAWnSdo+xFjtsCPlMQ==
X-Google-Smtp-Source: AGHT+IGMDNeeMnoSoV+ujp4DKswXx9i13LNVEq7JcBo2v5uVoORJ0Qz/GtBG0yXX9g9YdnGDrcd7gQ==
X-Received: by 2002:a17:907:e689:b0:a86:88f7:679c with SMTP id a640c23a62f3a-a86a52c602bmr656858466b.41.1724668619923;
        Mon, 26 Aug 2024 03:36:59 -0700 (PDT)
Message-ID: <756c6b06-50a7-4201-9682-ff4a3eaafc30@suse.com>
Date: Mon, 26 Aug 2024 12:37:01 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/9] xen/bitops: Convert 'hweight(x) > 1' to new
 multiple_bits_set()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-4-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 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: <20240822230635.954557-4-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 23.08.2024 01:06, Andrew Cooper wrote:
> Using hweight() is an especially expensive way of determining simply if
> multiple bits are set in a value.  Worse, 4 of the 10 hweight() calls in Xen
> are of this form.
> 
> Switch to the new multiple_bits_set() helper.  This is far more efficient than
> the longhand hweight() algorithm and, owing to its simplicity, likely more
> efficient than even a dedicated instruction on a superscalar processor.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

Just to mention it: With the title being sufficiently generic, I half
expected the similar {bitmap,cpumask}_weight() to also be taken care of.
Yet certainly those (and maybe also their ... == 1 forms) can be covered
later.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 10:39:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 10:39:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783404.1192739 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siX8F-0005tj-2y; Mon, 26 Aug 2024 10:39:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783404.1192739; Mon, 26 Aug 2024 10:39:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siX8F-0005tc-0S; Mon, 26 Aug 2024 10:39:31 +0000
Received: by outflank-mailman (input) for mailman id 783404;
 Mon, 26 Aug 2024 10:39:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=SW9P=PZ=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siX8D-0005tW-Lu
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 10:39:29 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7892b2ef-6397-11ef-a50b-bb4a2ccca743;
 Mon, 26 Aug 2024 12:39:28 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5bf006f37daso6849401a12.1
 for <xen-devel@lists.xenproject.org>; Mon, 26 Aug 2024 03:39:28 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0515a9806sm5474428a12.87.2024.08.26.03.39.27
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 26 Aug 2024 03:39:27 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7892b2ef-6397-11ef-a50b-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724668768; x=1725273568; 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=mmMxUgxfSPYf6I9xFstGuEG5G/F8csIGqJgwMrkJ/ds=;
        b=MoHtUXwVCplg9fmMQS2/LevqSMBzXdiRS0EU6V8+usaTBkdALqPcjEIRTIuBmJqw0R
         Q6Oy+uojkNlLwzNObgaXfIS3RxFhk5EFc5jO7I7e6ZaH9NCTq3xYrLRFz829tjAPd9QH
         6Gtk9O5AN/XSver8BOvJ7KzkM3ztJjBlZosA4J6Iq+l1g2akU7q0u2jUvP9gMagRjZfs
         fsMDA9SDiwq8BKBZCwg8QhaN6vlZhgiZW+pvPl6B+BtKCgofFYYL8mFuFWbAyc8irSiG
         4rrUzYU1tFIjDV2sOql3Vf6wt0ZrjYvCc6OAOamKttbvhCCpgejjz+ON7nzvxQelEua0
         mFAA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724668768; x=1725273568;
        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=mmMxUgxfSPYf6I9xFstGuEG5G/F8csIGqJgwMrkJ/ds=;
        b=FdkzxwQ4kdWoJh3JCZ9C75KHZzHsdO7H0jpL1jTYXQN3+SLa9aAt1aZeYzSUhHCfLF
         RjLPN28+PmxcBpYAsE93mDHM1roihHgDCNQEfJzjBQMcTX/LeMb0Tz/9Jpoeru9znvZP
         +iA7lFu/LZmk3lnb48gyeBb5ijBCPbR0FTytu5JFgivgmI3CNDRBMKr4ii1bANR2eVZ/
         psUxHFaZacur4/uJvxuUI5q+c+kArqz9/PDcaK+nXMg4liW/v1MMrE4yvaY19ZpsxaHh
         Xbly4dGK4+6ozWDRjuR2UhgqTEjBhZdc30s8N2ygGGBWb97XyX2wrx3fJ6ipjN99OmAV
         uXnA==
X-Forwarded-Encrypted: i=1; AJvYcCWCX520STHg1r5jgUwsYARcY0PCUwkeAG4xHbmrWgI9h/igtSk9jI3xN4B8JTRAHk2SyOwQhplnIGg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwQaswK/7rvyZFQXhiAzZdppR0P9r0YLtFi6kmTnPBjmHt/ka7X
	WJh3jK4Kfaj+eXfTUGNbVus4PrY+gd/7XooAqiAENZPWLgNO0QKPmy5fr24THPLGLPWfG5eQpnA
	=
X-Google-Smtp-Source: AGHT+IFuN+PZ9Dz2pSkaJiUNbyiWf5XTPhwKhNJet4wUqtiILTcHM0WXgNsmEqRrx/NShirVH5CE0Q==
X-Received: by 2002:a05:6402:2691:b0:5be:fa76:55b4 with SMTP id 4fb4d7f45d1cf-5bf2c069128mr15447591a12.16.1724668768134;
        Mon, 26 Aug 2024 03:39:28 -0700 (PDT)
Message-ID: <8c6599fa-22c0-455e-9d6a-51b3bf3d24b3@suse.com>
Date: Mon, 26 Aug 2024 12:39:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/9] xen/bitops: Drop the remnants of hweight{8,16}()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-5-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240822230635.954557-5-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 23.08.2024 01:06, Andrew Cooper wrote:
> They are no more, and won't be returning in this form.

And what's the plan? Use hweight32((uint8_t)...) in an open-coded manner?
Not overly nice I would say.

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 11:40:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 11:40:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783421.1192750 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siY4y-0000TA-Ey; Mon, 26 Aug 2024 11:40:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783421.1192750; Mon, 26 Aug 2024 11:40:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siY4y-0000T3-C9; Mon, 26 Aug 2024 11:40:12 +0000
Received: by outflank-mailman (input) for mailman id 783421;
 Mon, 26 Aug 2024 11:40:11 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=SW9P=PZ=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siY4x-0000Nl-JG
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 11:40:11 +0000
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com
 [2a00:1450:4864:20::52d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eed4d4f6-639f-11ef-8776-851b0ebba9a2;
 Mon, 26 Aug 2024 13:40:03 +0200 (CEST)
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-5bed0a2ae0fso5201315a12.1
 for <xen-devel@lists.xenproject.org>; Mon, 26 Aug 2024 04:40: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
 4fb4d7f45d1cf-5c0515ab2f1sm5433696a12.97.2024.08.26.04.40.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 26 Aug 2024 04:40:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eed4d4f6-639f-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724672402; x=1725277202; 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=KUipUyunrK4D+X9IuF93LnSIGw4leY+HQ/GTbuO5DNk=;
        b=UFfKxbyn7C8wR0X7rPy4L9kx3XDssflw5AukUN4FlkpOBKGlhMHtAnsWb3lfs0Bozm
         R3AxGjYPvfF3JMRTY8NmwcaF9/ut7d+gj7Tol78irg3GgnGA3/FF7xlnNDvUqS/m/KuO
         O86WvrPNr/gL/dbqzr2j+/y12vnTGHMDEKyc0J6mmsdetwFORhvhzNRoZ4CIM/x066PI
         oMLIq5YvwwwMfA7xEocSGNeMOKguTjPLtmSdedl2WaWtv4Kr6gCor9msxDybR/1RfS+z
         sfEAs1UefrIbwPuYStgy/vqFgJHLY981Iw7MBe3QSj+kuIYhhWdaElywgKe9nCPtQof9
         0dnQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724672402; x=1725277202;
        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=KUipUyunrK4D+X9IuF93LnSIGw4leY+HQ/GTbuO5DNk=;
        b=wnM7bFzRqsT55QtEuTHbXnZGbwDOikaMIErMSzmiIjZuSOT/L+yqDOTvGEu42kAaTV
         oKrRRO7Zroq1etDtx6s524oThUgIlfBF4+Xqjo1Ilu2cbLLa1WkRxJckLS3ej/HrylHM
         FmFWx4QKbT+dr8rzJZQGBdZa/i7k6l5pHR1cegH3rdDcX0xMcIqO8OVx3BzOkKypWMth
         GRKYylzroatYie55wuPF3QP3/2TbkFpLmWY6wWfUtLqbVoZGZXA8IpMQAdH8Ph7Ii9qf
         br2bYeud7hSP2yp38ZljqTBv0lExxiNY8MDuNRFk/awm7BhyVfoWOHtMOr5azlmuBOs8
         bWyg==
X-Forwarded-Encrypted: i=1; AJvYcCXMt8BSvWbViuXZtrxogGEsDUONBEOCz0qQ5xx5QBt3ZwkX6EQefu1A2P+a8EQsXqIFsJ28OaF7zb4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyBlhHOu+qsW2Oq5fm1tqC3jRo7fUv+YRiS84fj2gbDgqb13IUm
	3EEmv/wMAA5BlT9D+xDnpbcMDTJ1K8IhcykBcbDB5VyKHR2qzC2Zl0GeyyL20Q==
X-Google-Smtp-Source: AGHT+IHMGfY0itxQ5wB3Q77TcuQ+GOBqZfcMkWtRiFhO5SvUpkRayxLvVYCAi3XC79L/QjSk6fftqg==
X-Received: by 2002:a05:6402:3894:b0:57d:12c3:eca6 with SMTP id 4fb4d7f45d1cf-5c089174241mr6180473a12.18.1724672402321;
        Mon, 26 Aug 2024 04:40:02 -0700 (PDT)
Message-ID: <14c385ce-c61d-48e3-aa09-7b450af34b6c@suse.com>
Date: Mon, 26 Aug 2024 13:40:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 5/9] xen/bitops: Introduce generic_hweightl() and
 hweightl()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-6-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240822230635.954557-6-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 23.08.2024 01:06, Andrew Cooper wrote:
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -35,6 +35,12 @@ extern void __bitop_bad_size(void);
 unsigned int __pure generic_ffsl(unsigned long x);
 unsigned int __pure generic_flsl(unsigned long x);
 
> +/*
> + * Hamming Weight, also called Population Count.  Returns the number of set
> + * bits in @x.
> + */
> +unsigned int __pure generic_hweightl(unsigned long x);

Aren't this and ...

> @@ -284,6 +290,18 @@ static always_inline __pure unsigned int fls64(uint64_t x)
>          (_v & (_v - 1)) != 0;                   \
>      })
>  
> +static always_inline __pure unsigned int hweightl(unsigned long x)

... this even __attribute_const__?

> +{
> +    if ( __builtin_constant_p(x) )
> +        return __builtin_popcountl(x);

How certain are you that compilers (even old ones) will reliably fold
constant expressions here, and never emit a libgcc call instead? The
conditions look to be more tight than just __builtin_constant_p(); a
pretty absurd example:

unsigned ltest(void) {
    return __builtin_constant_p("") ? __builtin_popcountl((unsigned long)"") : ~0;
}

> --- /dev/null
> +++ b/xen/lib/generic-hweightl.c
> @@ -0,0 +1,46 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#include <xen/bitops.h>
> +#include <xen/init.h>
> +#include <xen/self-tests.h>
> +
> +/* Mask value @b broadcast to every byte in a long */
> +#if BITS_PER_LONG == 32
> +# define MASK(b) ((b) * 0x01010101UL)
> +#elif BITS_PER_LONG == 64
> +# define MASK(b) ((b) * 0x0101010101010101UL)
> +#else
> +# error Extend me please
> +#endif
> +
> +unsigned int generic_hweightl(unsigned long x)
> +{
> +    x -= (x >> 1) & MASK(0x55);
> +    x =  (x & MASK(0x33)) + ((x >> 2) & MASK(0x33));
> +    x =  (x + (x >> 4)) & MASK(0x0f);
> +
> +    if ( IS_ENABLED(CONFIG_HAS_FAST_MULTIPLY) )
> +        return (x * MASK(0x01)) >> (BITS_PER_LONG - 8);

I realize it's nitpicking, yet especially this use isn't really "mask"-
like. Could I talk you into naming the macro e.g. BCST()?

> +    x += x >> 8;
> +    x += x >> 16;
> +#if BITS_PER_LONG > 32
> +    x += x >> 32;
> +#endif
> +
> +    return x & 0xff;
> +}

Perhaps #undef MASK here, or else ...

> +#ifdef CONFIG_SELF_TESTS
> +static void __init __constructor test_generic_hweightl(void)
> +{
> +    RUNTIME_CHECK(generic_hweightl, 0, 0);
> +    RUNTIME_CHECK(generic_hweightl, 1, 1);
> +    RUNTIME_CHECK(generic_hweightl, 3, 2);
> +    RUNTIME_CHECK(generic_hweightl, 7, 3);
> +    RUNTIME_CHECK(generic_hweightl, 0xff, 8);
> +
> +    RUNTIME_CHECK(generic_hweightl, 1 | (1UL << (BITS_PER_LONG - 1)), 2);
> +    RUNTIME_CHECK(generic_hweightl, -1UL, BITS_PER_LONG);
> +}

... actually use it some here, to have a few more cases?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 11:51:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 11:51:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783427.1192759 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siYFj-0002fJ-Dp; Mon, 26 Aug 2024 11:51:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783427.1192759; Mon, 26 Aug 2024 11:51:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siYFj-0002fC-B0; Mon, 26 Aug 2024 11:51:19 +0000
Received: by outflank-mailman (input) for mailman id 783427;
 Mon, 26 Aug 2024 11:51:18 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=SW9P=PZ=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siYFi-0002f6-HL
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 11:51:18 +0000
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com
 [2a00:1450:4864:20::52d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 803e286d-63a1-11ef-8776-851b0ebba9a2;
 Mon, 26 Aug 2024 13:51:16 +0200 (CEST)
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-5befd2f35bfso4812447a12.2
 for <xen-devel@lists.xenproject.org>; Mon, 26 Aug 2024 04:51:16 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c04a4c72a7sm5472141a12.65.2024.08.26.04.51.15
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 26 Aug 2024 04:51:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 803e286d-63a1-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724673076; x=1725277876; 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=tEoNtuDoPj2LbGgBcFqpdvQuo13wzOJeXlgU+P3OSxo=;
        b=T4P+5gLR4Do8OtU1bMeirA2CV3f84iPyRcLGxSCE0K9Q8drEtT/9/M6THScuwgOdv9
         v+uGSG6kcgG3UkgnOOZ4s0u+TANAJtQ7j5YhPtzVBlf6sb1y/RJ9AUaDdf/bG1AGcyWc
         fMuDbNmi/w9FyfLRnIAfgIoWgRgOjvp5D/o9qbJNa/M5c3ht94wJT/Sy/MfyUZiRYZ9Y
         llIbC6cx8o8LRA6paXZNzSCfu/HEzgxI/Zvz35LxLX2SpjbLNTTwgxCaKRA2HbgBDfIX
         zvWpgQvYHdZjKmxACuq9SssH/LBzi0ekUMezYm2NYCiBfOVfNMWA+f4FG0+vyET/TxQa
         0dig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724673076; x=1725277876;
        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=tEoNtuDoPj2LbGgBcFqpdvQuo13wzOJeXlgU+P3OSxo=;
        b=D+uXGjY1JihdO+RhxL2/5smCjA1ivWJEdTQEyUrPPE+6g1opWtN8TC7IU4Z1+MewDW
         xbj+Pvbkhph7b0txkX/Y4F0Y84yZw9JcfYJBqLMccmDpfv2yOZkn/dBXl1+58BeblVk8
         8SehGLPzwtqpslTRNq7DrH2G9NMRorj1jSYkAXUFAfw5zmJM1SUyHoV2mt0viuyTmulo
         imtjj8ZLdw2s2T7fcTdOOLGLB8q8QGTxb91ViOw8LfWvao0U4CKNPZDdnTcPde/YKVht
         tPArxUUV5AgosSt7QSNL7GCQxo0uos+Aog20iL+HwxC6g0nK5gnLU1ETik8T98udo36N
         raDw==
X-Forwarded-Encrypted: i=1; AJvYcCV/8zmaUYhNpc7fOFPUqY3UaNvvM5D283ZtOA3Owsq7NidiznmQyTbbFLHThFjnyrrf0xupLXYkYxE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxZEa+vVQS4JAQARRXyJAL7LnqURAbtHNAo/oTE7wsCs5dnxcTJ
	NXrU0gYeFUDy77G5Y/ZJ3Eqpr/SvSbEjEib7qRJoycPlgF3rlj4T9n0/6ox2qg==
X-Google-Smtp-Source: AGHT+IEWx/inlVU2WwFL3xmWWyNsJdhcPxfpmxy89f7MqQSoHUZ8+bLMhwKFcCuvrgxbTOds2wYITA==
X-Received: by 2002:a05:6402:26c8:b0:5c0:a8cc:2cbe with SMTP id 4fb4d7f45d1cf-5c0a8cc2da3mr2469542a12.28.1724673075710;
        Mon, 26 Aug 2024 04:51:15 -0700 (PDT)
Message-ID: <37d43f0c-974d-4607-b629-a0546e1ddf83@suse.com>
Date: Mon, 26 Aug 2024 13:51:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 6/9] xen/bitops: Drop hweight_long() and use hweightl()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-7-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240822230635.954557-7-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 23.08.2024 01:06, Andrew Cooper wrote:
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Mon Aug 26 11:52:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 11:52:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783431.1192770 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siYGk-0003AP-Mn; Mon, 26 Aug 2024 11:52:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783431.1192770; Mon, 26 Aug 2024 11:52:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siYGk-0003AI-KJ; Mon, 26 Aug 2024 11:52:22 +0000
Received: by outflank-mailman (input) for mailman id 783431;
 Mon, 26 Aug 2024 11:52:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siYGj-0003A6-JU; Mon, 26 Aug 2024 11:52:21 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siYGj-00043U-82; Mon, 26 Aug 2024 11:52:21 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siYGi-0001ML-Q4; Mon, 26 Aug 2024 11:52:20 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1siYGi-0002bQ-PV; Mon, 26 Aug 2024 11:52:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=7eLEAuVM+p0dBsKTohUICtZE/ye/Hs76L0Yebt8y1rE=; b=rD5pBXUjfK5IJm7B0/U771HVwJ
	pjCLYiNHFYenVr/6r1omDaDg8fTC4kSDLIoJSKDqk/YeQhjORl1TnEMQ7Nf3a12lqwJDxKFzvU6Kt
	Q5aKB/4YvvHtdm3ENT8+juNGU6X75aX9uKZqdhNeVGlmzKUuKAtAlYLpcqpn0ZBerdHI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187349-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187349: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b
X-Osstest-Versions-That:
    xen=95764a0817a51741b7ffb1f78cba2a19b08ab2d1
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 26 Aug 2024 11:52:20 +0000

flight 187349 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187349/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b
baseline version:
 xen                  95764a0817a51741b7ffb1f78cba2a19b08ab2d1

Last test of basis   187331  2024-08-24 03:02:44 Z    2 days
Testing same since   187349  2024-08-26 09:02:10 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Huang Rui <ray.huang@amd.com>
  Jan Beulich <jbeulich@suse.com>
  Jiqian Chen <Jiqian.Chen@amd.com>
  Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
  Milan Djokic <milan.djokic@rt-rk.com>
  Nikola Jelic <nikola.jelic@rt-rk.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   95764a0817..b8cdfac2be  b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b -> smoke


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 11:55:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 11:55:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783440.1192779 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siYJO-0003mA-8f; Mon, 26 Aug 2024 11:55:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783440.1192779; Mon, 26 Aug 2024 11:55:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siYJO-0003m3-5q; Mon, 26 Aug 2024 11:55:06 +0000
Received: by outflank-mailman (input) for mailman id 783440;
 Mon, 26 Aug 2024 11:55:05 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=SW9P=PZ=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siYJN-0003lv-0R
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 11:55:05 +0000
Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com
 [2a00:1450:4864:20::52b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 074a2000-63a2-11ef-8776-851b0ebba9a2;
 Mon, 26 Aug 2024 13:55:03 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5bed72ff2f2so5176305a12.2
 for <xen-devel@lists.xenproject.org>; Mon, 26 Aug 2024 04:55: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
 4fb4d7f45d1cf-5c044ddbce5sm5560673a12.4.2024.08.26.04.55.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 26 Aug 2024 04:55:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 074a2000-63a2-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724673302; x=1725278102; 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=/Xu4kMaCNNhluCV+49KBp0xSgf/cU7UtPbALKpCZb28=;
        b=LBEGLVj47OLPKgKtrr5dwivyBfpO1OeDSyyYEGWX59VcAhHDvt9mgPikH6+k/eXbag
         VnTArm9lsecFpyHb6OCe4IjW3UjXkJIai1xCqlGa3l/cNxvI8HeiEqvq4BvthJUMTgzw
         930DxVSBqNms6H8JSdlHOw+Kh8MkUO9iQH+fQbw6Gk277NPMkMUVyjqkBAn+5tD8oSrV
         j8g9SvVXTPAwASOHW3zN9iJndQ9UiJdFSu1hI4v5ofRh/Hrd+hiORFOhVvgJrLoGYu8U
         d1SS/gE7GE5NPyagpPIC66lnFiU//99u0VkkolIhDcomZXsFPE6tJUaIFdo6/otdqW0L
         FSrA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724673302; x=1725278102;
        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=/Xu4kMaCNNhluCV+49KBp0xSgf/cU7UtPbALKpCZb28=;
        b=KzmeWi9lRhTGltSfAUqQsCwvt56m387DvFdvstJ2CbUdwExtMoU0nGhfGbXdvY9Dh8
         czDgWugK7P4CkEaJdshEiECGFZNr+oGYCMFGpWJR4F6fw03mjvzQAZWi6b9WDp/tO8Lx
         +P5bPfZ+O96+lw2cW7LmH5S9AkqFSBOC8MOV72rKI/HDX7JdIxx628Zo1jq80uc9mE4n
         s7Chawsne4DnAO7bW/MRmKzRDm8wNdMc/TutBzn+PiLLxEGZa5hLeDq596l1HXIDexsn
         edWvXIJ9b9qYG0MSUDsulFK51kNJgZXxyceEpQe/out3ksb3l6/GVWaqYLdOZgVr3twU
         Dk+w==
X-Forwarded-Encrypted: i=1; AJvYcCV9cOf7fo0EOPUI7Xj2Rg21cQrMjFfixP56r/uOg0hwvpS2LTOYlaSCsnH/2gaa+b6S5me/C1EluuM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxAuktMNXZNJFSV+haSpxLaOKVlCvR3eRfuzdSIMxKW3bj+2wg0
	uo3SD0gTYNgtgoPig5PWg7M1+sbfZ01tN5w4Vx/D37QP+nUiJ42c3S6UidSIlQ==
X-Google-Smtp-Source: AGHT+IHQYYCflXwElkaL2G/fEfFhqA0s0sV1/OUn33PBjh9LFemQHQ4alT0/tZ03HDeE0BGqAtNxnA==
X-Received: by 2002:a05:6402:50d2:b0:5be:f564:eb0f with SMTP id 4fb4d7f45d1cf-5c08915bc58mr6552258a12.1.1724673302529;
        Mon, 26 Aug 2024 04:55:02 -0700 (PDT)
Message-ID: <11da1350-095f-49c8-bdf0-f5c83e9f0d39@suse.com>
Date: Mon, 26 Aug 2024 13:55:01 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 7/9] xen/bitops: Implement hweight64() in terms of
 hweightl()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-8-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240822230635.954557-8-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 23.08.2024 01:06, Andrew Cooper wrote:
> ... and drop generic_hweight64().
> 
> This is identical on all architectures except ARM32.  Add one extra SELF_TEST
> to check that hweight64() works when the input is split in half.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
with one remark:

> --- a/xen/include/xen/bitops.h
> +++ b/xen/include/xen/bitops.h
> @@ -302,6 +302,14 @@ static always_inline __pure unsigned int hweightl(unsigned long x)
>  #endif
>  }
>  
> +static always_inline __pure unsigned int hweight64(uint64_t x)
> +{
> +    if ( BITS_PER_LONG == 64 )
> +        return hweightl(x);
> +    else
> +        return hweightl(x >> 32) + hweightl(x);

This assume BITS_PER_LONG == 32, which of course is true right now, but
doesn't need to be in general. Better add an explicit cast to uint32_t
(or masking by 0xffffffffU)?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 11:59:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 11:59:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783448.1192789 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siYNP-0005Cz-NZ; Mon, 26 Aug 2024 11:59:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783448.1192789; Mon, 26 Aug 2024 11:59:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siYNP-0005Cs-L3; Mon, 26 Aug 2024 11:59:15 +0000
Received: by outflank-mailman (input) for mailman id 783448;
 Mon, 26 Aug 2024 11:59:14 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=SW9P=PZ=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siYNO-0005CD-Iz
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 11:59:14 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9c9bdfe1-63a2-11ef-a50b-bb4a2ccca743;
 Mon, 26 Aug 2024 13:59:13 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a7aa086b077so364619566b.0
 for <xen-devel@lists.xenproject.org>; Mon, 26 Aug 2024 04:59:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f2202fdsm659285166b.13.2024.08.26.04.59.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 26 Aug 2024 04:59:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9c9bdfe1-63a2-11ef-a50b-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724673553; x=1725278353; 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=DtA9pcQSjP3ccQDJR9MjGjGBKy+LEPAenXNB5h2lMD8=;
        b=O1pT68MiWY2uc1fT0g77bH9GcroY6WKX4HMYDZP+C6h9y5BAul+ZAY5a+L1tCrGp6K
         vWNdfUA8Yh+gz259ZAWa5FasShfejBUmey7BtXyPtP5XFsVkfYVNS5ijGcHup0/2YxQF
         8q05sly/g7e3oYfRH6cYSrge4eXj5XijGQ+WAMoVDCa9Yjr4RJClqZqC/MFK7TpwSPAK
         Vx+28S6Wp3Ea9s4h11+qEHHs/9tLNf3VY4uJFFJlFE+zFaoJRRMOuF9HMmfl9K2yZ3mm
         CSHGSsUFdlL2bcba+N8gr1YGh/yBXUzB9hx7s4jbdyCogoDGDI4cJbu5WnKX4FtFB38F
         ZkaA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724673553; x=1725278353;
        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=DtA9pcQSjP3ccQDJR9MjGjGBKy+LEPAenXNB5h2lMD8=;
        b=Co4L4CoB5AOEQMecuWGKk8pktqc8+dz7wxeujM2au5RkFAHFnRN6zEfRkkUIfTlm1e
         ChmYIokVhbrOfCDdOi5zmy7pxLb4A4kBLc+DiiBWb7BYqL5Rl7q65eCb5UOhcCSV+aKs
         GNcmTMTUJe2UdaZLHLVZay2gM19t8rrCf2qns/EzT1Sy2KbHzsdExGae0VMWz9t7bfCn
         LiyoXKV62Usobsvl9fp1d/fZpK7YIo7kfT4Z01gCJZiOoYC+I4DSOzFru53MguxhJdQ7
         T1M/aUhZUIKLkmqrdvBHEfzFMZosNr1nru8qgVA1KukiYOG1jUZw/2GGjvcAeGC/vJ/t
         Xv/w==
X-Forwarded-Encrypted: i=1; AJvYcCVfGhb0BawX8GS8T9qhXy4lVcQrYIieWQ6zhqqmSt0msC1K2Y/XET55qAyjMlvujsoWjfGgzcCHgu4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxaarsorgK6yY5f4y/kinu3yNhqI6LV8/RgcIkecUh6oyGiAefJ
	TXEOtLX2/qe2+k9l9ObdoEIeTk5cbvwLEC0cO1x+Ed3diwEuoD/og26eyZOF3w==
X-Google-Smtp-Source: AGHT+IFrjjnNnRggUPQif49pPhG+8ExmC7wrTDvVjcajug9B4YKJ1etsm41rUjBN0l/RlYP+Bj9RGw==
X-Received: by 2002:a17:907:1c84:b0:a86:6d39:cbfd with SMTP id a640c23a62f3a-a86a54ddc4dmr709567166b.57.1724673552945;
        Mon, 26 Aug 2024 04:59:12 -0700 (PDT)
Message-ID: <53d86a14-276d-4d2c-836f-4c3a78346dd1@suse.com>
Date: Mon, 26 Aug 2024 13:59:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 8/9] xen/bitops: Implement hweight32() in terms of
 hweightl()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-9-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240822230635.954557-9-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 23.08.2024 01:06, Andrew Cooper wrote:
> ... and drop generic_hweight32().
> 
> As noted previously, the only two users of hweight32() and they're both
> singleton callers in __init paths, so it's not interesting to have a sub-GPR
> optimised generic.

I think it's clear what is meant, but the part of the sentence ahead of
the comma is a little bumpy. As to not interesting: Perhaps indeed not
right now, but new uses may appear and generally the overly wide
operations may be (slightly) more expensive. Of course we can deal with
the need when it arises, so ...

> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Mon Aug 26 13:07:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 13:07:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783467.1192800 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siZRR-0000hM-La; Mon, 26 Aug 2024 13:07:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783467.1192800; Mon, 26 Aug 2024 13:07:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siZRR-0000hF-Im; Mon, 26 Aug 2024 13:07:29 +0000
Received: by outflank-mailman (input) for mailman id 783467;
 Mon, 26 Aug 2024 13:07:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=SW9P=PZ=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siZRQ-0000h7-VS
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 13:07:28 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 24b17f0a-63ac-11ef-a50b-bb4a2ccca743;
 Mon, 26 Aug 2024 15:07:27 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-53345dcd377so5426177e87.2
 for <xen-devel@lists.xenproject.org>; Mon, 26 Aug 2024 06:07:27 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f4360e7sm660561066b.123.2024.08.26.06.07.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 26 Aug 2024 06:07:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 24b17f0a-63ac-11ef-a50b-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724677647; x=1725282447; 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=R7zH0p5To41HaXQsL9JKFBkLYk67deeIbjqF+2DF2Zw=;
        b=UblDZIYO53GgnJebU7xL7aQsTWBuk2SIsw39aGHNqvY81ET2g1xXQq9AcMKkJ4i3Es
         eMnzUXuKEm52qt1mYvwwlspcAmCmwuXLl2hhB5dV2PY1q0HGUe92vy7qVmamYEg15w3z
         0jUwuLWMEu6QcNx35k/Af+3Y3s4EI9ZuQaybhRNFGY899c6iDPhFF+xA6DZKFjTbFNYR
         zuwj7tVRtkBrswWT/PoRSf/5VtL0Xw7iYZj1Kfv0NpUlRymBBUqqnfXqy+cnR4qB7Zko
         lPr4GgrXgfe/mzhC+IWZ7LySJZUBhp0BzQtBOwAPgydMKmtmJDcry9mEOf1DJqSfDYQn
         f2+g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724677647; x=1725282447;
        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=R7zH0p5To41HaXQsL9JKFBkLYk67deeIbjqF+2DF2Zw=;
        b=gPJVMjYmmPBnsJ851lBDIzXu2LJUasQmgU2i5nDBrZmzgKzhF2cNuLGUR4BLfJ8O3M
         MsyfqYEI1sj2R7fz0H1ViQ9tDXJ/SZ+JnaZPdHlwLFtzhignYPn8UIMM31wQNE77qjTm
         XZ1agHEb/t3GHKvPvojzTj2skhJ9V1QZGls/wi4gbvXmArDKD33kKjF6pUmUF49XLMYZ
         Pz12gkA889Qz+9PjtbCwx0rtdRj6pUpJyGACFlgpWiho9ZjDe4K4wlA0Y6vz01CpcWqb
         ZNq3XqdqUDYNUACDvzq5vZYhjg/lB1Hnyix2GZPXXQsN037/5CP4tkLaERhC4cnCfx+7
         c4oQ==
X-Forwarded-Encrypted: i=1; AJvYcCUCAQPUw3D12Jc4mc8dRnxZ8Uf33eSkMxIbntxOQBkHc4I6ky4pfZ+74DA6o1+V3aLCzEKP3BCduVI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyyR4jw0f6eeWSQCoVY1j3e9V4JtHMbXhDHBEvEMqsYtEVP76tP
	qETO4v/7hkSzOau/WJdOsvfnRa+qwKKYItTC74zBqN93HeEsJidW9Ds4tggfYQ==
X-Google-Smtp-Source: AGHT+IFlydMbfDXf5rBjQuuX6/0xL2LwR6G8WQX+1iuWn+dDJVowRAGn5wQ8j+h27jKp3wnuHNH1Rg==
X-Received: by 2002:a05:6512:234b:b0:533:40dc:823e with SMTP id 2adb3069b0e04-534387bb4a6mr7341187e87.48.1724677646597;
        Mon, 26 Aug 2024 06:07:26 -0700 (PDT)
Message-ID: <03febf18-516b-4677-a0a5-102036c91a29@suse.com>
Date: Mon, 26 Aug 2024 15:07:25 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 9/9] x86/bitops: Use the POPCNT instruction when available
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-10-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240822230635.954557-10-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 23.08.2024 01:06, Andrew Cooper wrote:
> A few RFC points.
> 
>  * I throught we had an x86 general lib-y but I can't find one, hence why it's
>    still in xen/lib/ for now.

We indeed have nothing like that yet. The file name should then imo not be
arch-* though, but x86-*. Or you could put it in xen/lib/x86/. It could even
be obj-y rather than lib-y, unless you expect we'll be able to get rid of
all uses, which seems unlikely at least due to bitmap_weight(). Otoh with
my ABI-level series the call site in arch_hweightl() could then be made go
away for v2 and above, at which point it living in lib-y will be preferable.

>  * When we up the minimum toolchain to GCC 7 / Clang 5, we can use a
>    __attribute__((no_caller_saved_registers)) and can forgo writing this in asm.
> 
>    GCC seems to need extra help, and wants -mgeneral-regs-only too.  It has a
>    habit of complaining about incompatible instructions even when it's not
>    emitting them.

What is this part about? What incompatible instructions, in particular?

> @@ -475,4 +476,24 @@ static always_inline unsigned int arch_flsl(unsigned long x)
>  }
>  #define arch_flsl arch_flsl
>  
> +static always_inline unsigned int arch_hweightl(unsigned long x)
> +{
> +    unsigned int r;
> +
> +    /*
> +     * arch_generic_hweightl() is written in ASM in order to preserve all
> +     * registers, as the compiler can't see the call.
> +     *
> +     * This limits the POPCNT instruction to using the same ABI as a function
> +     * call (input in %rdi, output in %eax) but that's fine.
> +     */
> +    alternative_io("call arch_generic_hweightl",
> +                   "popcnt %[val], %q[res]", X86_FEATURE_POPCNT,
> +                   ASM_OUTPUT2([res] "=a" (r) ASM_CALL_CONSTRAINT),
> +                   [val] "D" (x));

If you made [val] an output ("+D") you could avoid preserving the register
in the function. And I'd expect the register wouldn't be re-used often
afterwards, so its clobbering likely won't harm code quality very much.

> --- /dev/null
> +++ b/xen/lib/arch-generic-hweightl.S
> @@ -0,0 +1,46 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +        .file __FILE__
> +
> +#include <xen/linkage.h>
> +
> +/*
> + * An implementation of generic_hweightl() used on hardware without the POPCNT
> + * instruction.
> + *
> + * This function is called from within an ALTERNATIVE in arch_hweightl().
> + * i.e. behind the back of the compiler.  Therefore all registers are callee
> + * preserved.
> + *
> + * The ASM is what GCC-12 emits for generic_hweightl() in a release build of
> + * Xen, with spilling of %rdi/%rdx to preserve the callers registers.
> + */
> +FUNC(arch_generic_hweightl)
> +        push   %rdi
> +        push   %rdx
> +
> +        movabs $0x5555555555555555, %rdx
> +        mov    %rdi, %rax
> +        shr    $1, %rax
> +        and    %rdx, %rax
> +        sub    %rax, %rdi
> +        movabs $0x3333333333333333, %rax
> +        mov    %rdi, %rdx
> +        shr    $0x2, %rdi

Could I talk you into omitting the 0x here and ...

> +        and    %rax, %rdx
> +        and    %rax, %rdi
> +        add    %rdi, %rdx
> +        mov    %rdx, %rax
> +        shr    $0x4, %rax

... here, and maybe use ...

> +        add    %rdx, %rax
> +        movabs $0xf0f0f0f0f0f0f0f, %rdx
> +        and    %rdx, %rax
> +        movabs $0x101010101010101, %rdx
> +        imul   %rdx, %rax
> +        shr    $0x38, %rax

... 56 here (or even BITS_PER_LONG-8)?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 13:40:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 13:40:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783477.1192810 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siZxl-0006wV-3h; Mon, 26 Aug 2024 13:40:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783477.1192810; Mon, 26 Aug 2024 13:40:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siZxl-0006wO-1B; Mon, 26 Aug 2024 13:40:53 +0000
Received: by outflank-mailman (input) for mailman id 783477;
 Mon, 26 Aug 2024 13:40:51 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=SW9P=PZ=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siZxj-0006wI-8M
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 13:40:51 +0000
Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com
 [2a00:1450:4864:20::233])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ccb1cbcc-63b0-11ef-8776-851b0ebba9a2;
 Mon, 26 Aug 2024 15:40:47 +0200 (CEST)
Received: by mail-lj1-x233.google.com with SMTP id
 38308e7fff4ca-2f3f163e379so68291501fa.3
 for <xen-devel@lists.xenproject.org>; Mon, 26 Aug 2024 06:40:47 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a868f47c446sm667525866b.156.2024.08.26.06.40.45
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 26 Aug 2024 06:40:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ccb1cbcc-63b0-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724679647; x=1725284447; 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=APHpimh9QRyPzBsIDrJ1nOWEF8yafTjY+JrjFQGykj4=;
        b=WUDfnvJRxPTzTL+cRaNDFENkfa3ffyYetavbM0SDPGyDB7jxl8esOmnpm+pRqFGGH7
         CsMRgKWsm88UoLujIRmBtDtZdF2sb7TwqPgYQLu3fjSsJD/xgs9F/yqQqorhnAvwNDKE
         y7D4ywOHb5VXpWELwTcg2KoKbQYNvIaRnoB0foaUK4X/7494mEGcz0I6xBVTIU+IWb9g
         kCMiwFA3J0WEa+5zX6EGVrl5hM2s8/fYnGZf5wOA0KUz1bD4c7Vwo94LjRwScFy58qe8
         XsLfr/9+PvdRG0+H1iaHNQ3xW9ZtnJ6lOpQ1WT+PrO8UCIic/39TQmInFa0jSHDiGu3W
         B8vg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724679647; x=1725284447;
        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=APHpimh9QRyPzBsIDrJ1nOWEF8yafTjY+JrjFQGykj4=;
        b=XDWBF0qg/CYrHIeazdYWNz3IToeZixLgsBv87eKYD5BZ8Uho9YmUWF5tbtt5HPUx4q
         OxmJkSjQefxYmb3t2D4AFZq9pwzqYD/1Eckp72Hig2XhgVw4p/kEX24cfbe1NuSPOMrm
         RSFToTBmQv6OzciYTBW6d7k8BANm3BtfNbO9wIQdWZ2DkEVAaU4/J8romyzSrB2adWeX
         XlhG0wmTEWauVP9MGxLE586K7zmvKFyq+293lJA80Ktym40//MLRd+Z5IKAgxqA5uGBg
         bdn0qzN1rcvDax4AQ+YymFcCPIRvqiS7eQuPPVuaNb3Pk44HyoQ1SF71yUy/Q0sSA6oV
         YOKQ==
X-Forwarded-Encrypted: i=1; AJvYcCVrdtXmZXhgzyrwobXmwsLcVjZcNZcfpAMk1N60cjONAdabuAfp9hdDwh6x+xrJ1M2o4Bg8d6dCHJo=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx6CwhJvO2+e6Q7cGGei2O1SXfsR1eLBkCtATtTKv/5XTlEBurs
	4tPpq+TisAVsohTjmkUaWpO726Gno7yuGSUG1l/jV4LM/hlmhvdK4e+wc15t5w==
X-Google-Smtp-Source: AGHT+IFyMV1vc79GQVa9ampMUUlsDhuqhtQ2iHTDqQBCbYI14T2mxMWKJZVDybbqBhuph9Cyp5qy3A==
X-Received: by 2002:a2e:b704:0:b0:2ef:2905:f36d with SMTP id 38308e7fff4ca-2f4f5750715mr69378551fa.16.1724679646375;
        Mon, 26 Aug 2024 06:40:46 -0700 (PDT)
Message-ID: <0849576f-1a21-4e46-989b-e8b21026eb65@suse.com>
Date: Mon, 26 Aug 2024 15:40:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/9] x86emul/test: rename "cp"
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Wei Liu <wl@xen.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <bcfea345-57c1-43d9-82b3-240b685486cc@suse.com>
 <fb9e2081-16d5-4dc4-92f5-fb55f313304b@suse.com>
 <4d88b5d1-592e-4756-b093-6cbf1ca08948@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <4d88b5d1-592e-4756-b093-6cbf1ca08948@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 23.08.2024 17:08, Andrew Cooper wrote:
> On 14/08/2024 9:51 am, Jan Beulich wrote:
>> In preparation of introducing a const struct cpu_policy * local in
>> x86_emulate(), rename that global variable to something more suitable:
>> "cp" is our commonly used name for function parameters or local
>> variables of type struct cpu_policy *, and the present name of the
>> global could hence have interfered already.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> v2: Re-base over dropping of Xeon Phi support.
> 
> Bah - still need to reinstate part of that patch.  The model numbers
> need to stay.  /me adds it to the todo list.
> 
> For this patch, Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>,
> with one request for this patch a couple of thoughts for separate patches.

Thanks; see below for a clarifying question as to which one is which.

>> --- a/tools/tests/x86_emulator/x86-emulate.h
>> +++ b/tools/tests/x86_emulator/x86-emulate.h
>> @@ -123,7 +123,7 @@ static inline uint64_t xgetbv(uint32_t x
>>  }
>>  
>>  /* Intentionally checking OSXSAVE here. */
>> -#define cpu_has_xsave     (cp.basic.raw[1].c & (1u << 27))
>> +#define cpu_has_xsave     (cpu_policy.basic.raw[1].c & (1u << 27))
> 
> Right now we deliberately don't emit names for APIC, OSXSAVE and OSPKE,
> because the values won't be correct in a guest's policy.  But this is a
> legitimate corner case.
> 
> What about this?
> 
> diff --git a/xen/tools/gen-cpuid.py b/xen/tools/gen-cpuid.py
> index 601eec608983..1b56958f07e7 100755
> --- a/xen/tools/gen-cpuid.py
> +++ b/xen/tools/gen-cpuid.py
> @@ -382,10 +382,11 @@ def crunch_numbers(state):
>              if name and name[0] in "0123456789":
>                  name = "_" + name
>  
> -            # Don't generate names for features fast-forwarded from other
> -            # state
> +            # For dynamic features (fast forwarded from other state), also
> +            # prefix with an underscore to highlight that extra care
> needs to
> +            # be taken.
>              if name in ("APIC", "OSXSAVE", "OSPKE"):
> -                name = ""
> +                name = "_" + name
>  
>              names.append(name.lower())
>  
> which would make the expression become cpu_policy.basic._osxsave and
> avoid the opencoded number.

I'm not overly happy with that, not the least because of the pre-existing
case where an underscore is being prepended. If at all, I'd like these to
stand out even more. And I would have less reservations if we could limit
this to the header(s) that are generated for the tool stack, keeping the
hypervisor "immune" to mistakes in this area.

If it's just the open-coded number, I could probably introduce
cpufeat_mask() locally here. Not sure in how far the open-coding of the
field is also of concern to you.

>> @@ -133,63 +133,63 @@ static inline bool xcr0_mask(uint64_t ma
>>  unsigned int rdpkru(void);
>>  void wrpkru(unsigned int val);
>>  
>> -#define cache_line_size() (cp.basic.clflush_size * 8)
>> -#define cpu_has_fpu        cp.basic.fpu
>> -#define cpu_has_mmx        cp.basic.mmx
>> -#define cpu_has_fxsr       cp.basic.fxsr
>> -#define cpu_has_sse        cp.basic.sse
>> -#define cpu_has_sse2       cp.basic.sse2
>> -#define cpu_has_sse3       cp.basic.sse3
>> -#define cpu_has_pclmulqdq  cp.basic.pclmulqdq
>> -#define cpu_has_ssse3      cp.basic.ssse3
>> -#define cpu_has_fma       (cp.basic.fma && xcr0_mask(6))
>> -#define cpu_has_sse4_1     cp.basic.sse4_1
>> -#define cpu_has_sse4_2     cp.basic.sse4_2
>> -#define cpu_has_popcnt     cp.basic.popcnt
>> -#define cpu_has_aesni      cp.basic.aesni
>> -#define cpu_has_avx       (cp.basic.avx  && xcr0_mask(6))
>> -#define cpu_has_f16c      (cp.basic.f16c && xcr0_mask(6))
>> -
>> -#define cpu_has_avx2      (cp.feat.avx2 && xcr0_mask(6))
>> -#define cpu_has_bmi1       cp.feat.bmi1
>> -#define cpu_has_bmi2       cp.feat.bmi2
>> -#define cpu_has_avx512f   (cp.feat.avx512f  && xcr0_mask(0xe6))
>> -#define cpu_has_avx512dq  (cp.feat.avx512dq && xcr0_mask(0xe6))
>> -#define cpu_has_avx512_ifma (cp.feat.avx512_ifma && xcr0_mask(0xe6))
>> -#define cpu_has_avx512cd  (cp.feat.avx512cd && xcr0_mask(0xe6))
>> -#define cpu_has_sha        cp.feat.sha
>> -#define cpu_has_avx512bw  (cp.feat.avx512bw && xcr0_mask(0xe6))
>> -#define cpu_has_avx512vl  (cp.feat.avx512vl && xcr0_mask(0xe6))
>> -#define cpu_has_avx512_vbmi (cp.feat.avx512_vbmi && xcr0_mask(0xe6))
>> -#define cpu_has_avx512_vbmi2 (cp.feat.avx512_vbmi2 && xcr0_mask(0xe6))
>> -#define cpu_has_gfni       cp.feat.gfni
>> -#define cpu_has_vaes      (cp.feat.vaes && xcr0_mask(6))
>> -#define cpu_has_vpclmulqdq (cp.feat.vpclmulqdq && xcr0_mask(6))
>> -#define cpu_has_avx512_vnni (cp.feat.avx512_vnni && xcr0_mask(0xe6))
>> -#define cpu_has_avx512_bitalg (cp.feat.avx512_bitalg && xcr0_mask(0xe6))
>> -#define cpu_has_avx512_vpopcntdq (cp.feat.avx512_vpopcntdq && xcr0_mask(0xe6))
>> -#define cpu_has_movdiri    cp.feat.movdiri
>> -#define cpu_has_movdir64b  cp.feat.movdir64b
>> -#define cpu_has_avx512_vp2intersect (cp.feat.avx512_vp2intersect && xcr0_mask(0xe6))
>> -#define cpu_has_serialize  cp.feat.serialize
>> -#define cpu_has_avx512_fp16 (cp.feat.avx512_fp16 && xcr0_mask(0xe6))
>> -#define cpu_has_sha512     (cp.feat.sha512 && xcr0_mask(6))
>> -#define cpu_has_sm3        (cp.feat.sm3 && xcr0_mask(6))
>> -#define cpu_has_sm4        (cp.feat.sm4 && xcr0_mask(6))
>> -#define cpu_has_avx_vnni   (cp.feat.avx_vnni && xcr0_mask(6))
>> -#define cpu_has_avx512_bf16 (cp.feat.avx512_bf16 && xcr0_mask(0xe6))
>> -#define cpu_has_avx_ifma   (cp.feat.avx_ifma && xcr0_mask(6))
>> -#define cpu_has_avx_vnni_int8 (cp.feat.avx_vnni_int8 && xcr0_mask(6))
>> -#define cpu_has_avx_ne_convert (cp.feat.avx_ne_convert && xcr0_mask(6))
>> -#define cpu_has_avx_vnni_int16 (cp.feat.avx_vnni_int16 && xcr0_mask(6))
> 
> Can we take the opportunity to realign these vertically?

I've done this, and I assume that this was the "for this patch" request. I'm
not overly happy with the result, because of the now definitely necessary
line wrapping, but it's perhaps still an improvement. (It's likely going to
bite me when re-basing this ahead of other patches I have it sit behind of
right now.)

> Also, we have X86_XCR0_* constants in a helpful place now.  Could we do
> something like:
> 
> #define XCR0_AVX xcr0_mask(X86_XCR0_YMM | X86_XCR0_SSE)
> #define XCR0_AVX512 ...
> 
> So that these expressions now read
> 
> #define cpu_has_$X (... && XCR0_AVX)
> 
> rather than forcing the reader to know %xcr0 by raw hex?

I can do that, yet I probably wouldn't want to fold the xcr0_mask()
invocations into the macro expansions. Would that be okay with you?

Jan


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 13:50:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 13:50:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783483.1192820 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sia70-0000eH-VP; Mon, 26 Aug 2024 13:50:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783483.1192820; Mon, 26 Aug 2024 13:50:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sia70-0000eA-SZ; Mon, 26 Aug 2024 13:50:26 +0000
Received: by outflank-mailman (input) for mailman id 783483;
 Mon, 26 Aug 2024 13:50:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sia6y-0000e0-Vx; Mon, 26 Aug 2024 13:50:25 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sia6y-0005yT-M6; Mon, 26 Aug 2024 13:50:24 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sia6y-0004Hm-9f; Mon, 26 Aug 2024 13:50:24 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sia6y-0005M6-9G; Mon, 26 Aug 2024 13:50:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=j0Sf8hrkPtHnCffyXH0MeV5Y/ddF91SslZXgn80pR0A=; b=US25Fi6mEpM2FHH8NDBMx9HMMA
	SX55RQQ39oOLfM/sOpdKKcpIbkfVAiS+sq/00BZlej+apkhDmHXGTO4rZPrBvyaMnj83HwoAKnjU4
	J8Bc7QGmPGqJ8upFGNRS+WX/Iu37rIx7ZkHC0vXPJJWVYa0ixwnYQxTfT4yNN22M1GNA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187347-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187347: regressions - trouble: broken/fail/pass
X-Osstest-Failures:
    qemu-mainline:test-armhf-armhf-xl-rtds:<job status>:broken:regression
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-armhf-armhf-xl-rtds:host-install(5):broken:heisenbug
    qemu-mainline:test-amd64-amd64-libvirt-vhd:leak-check/check:fail:heisenbug
    qemu-mainline:test-armhf-armhf-xl-qcow2:leak-check/check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=f259e4cb8a8b4ef5463326fc214a7d8d7703d5de
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 26 Aug 2024 13:50:24 +0000

flight 187347 qemu-mainline real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187347/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-xl-rtds        <job status>                 broken
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-rtds      5 host-install(5)          broken pass in 187344
 test-amd64-amd64-libvirt-vhd 22 leak-check/check fail in 187344 pass in 187347

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-qcow2 20 leak-check/check fail in 187344 baseline untested
 test-armhf-armhf-xl-rtds    15 migrate-support-check fail in 187344 never pass
 test-armhf-armhf-xl-rtds 16 saverestore-support-check fail in 187344 never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass

version targeted for testing:
 qemuu                f259e4cb8a8b4ef5463326fc214a7d8d7703d5de
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  354 days
Failing since        182723  2023-09-07 18:19:05 Z  353 days   35 attempts
Testing same since   187340  2024-08-25 05:05:28 Z    1 days    3 attempts

------------------------------------------------------------
621 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     broken  
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-armhf-armhf-xl-rtds broken
broken-step test-armhf-armhf-xl-rtds host-install(5)

Not pushing.

(No revision log; it would be 180913 lines long.)


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 16:16:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 16:16:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783514.1192829 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sicO9-0007lP-0j; Mon, 26 Aug 2024 16:16:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783514.1192829; Mon, 26 Aug 2024 16:16:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sicO8-0007lI-UC; Mon, 26 Aug 2024 16:16:16 +0000
Received: by outflank-mailman (input) for mailman id 783514;
 Mon, 26 Aug 2024 16:16:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=89gm=PZ=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sicO7-0007lC-HM
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 16:16:15 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 82b0b463-63c6-11ef-a50b-bb4a2ccca743;
 Mon, 26 Aug 2024 18:16:13 +0200 (CEST)
Received: by mx.zohomail.com with SMTPS id 1724688967152238.96509307609676;
 Mon, 26 Aug 2024 09:16:07 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 82b0b463-63c6-11ef-a50b-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; t=1724688969; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=BHUpdCv4xtLvallcq39ehOgYx81BGwSyNnQvYXM9OjDBSBqHaoJk9SUQYD3Ez/I1CHwKRWVcqmImjBLmMfjQTiJtWIYGRvm/DfXSEUWcBe03T7NREHoOdcxJdDCO9IHY3K8WzdNGcgVakU2/onsKUfQjSQ7gL13TV5/qP7R94mc=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1724688969; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=aRn/Ig+uSKFwm9mRQX3/lTYc6Z3i4A++N191Oel+154=; 
	b=XTamXXWgSazumGrX/lvnv/YeEPnnSXgzl39gA9H2VJM/xBEW6AgZ5pvVqboJOX8oJ/jRf5U66Q5zT/HceulvRgMqd+Su5TXVnk2IhF5tQFrbLUW77Fe+Cx6SsPA1rRoDZw58ec0Rz1l7HbDeKwoSZJ/RQ/3rbnaM3ADcsV2WUeY=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1724688969;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;
	bh=aRn/Ig+uSKFwm9mRQX3/lTYc6Z3i4A++N191Oel+154=;
	b=dhZb9gWfSdKLeAzVBinbCkaty05DSENge3ncxWdqIO7aQ5m6GLT47qJ0FW7KO/3g
	fwVRKB01XDTgNU6JokvrBpEfnZLEndokisnt3OivwotM1iyEbn/s8KL2U7D4VOyuvZG
	jlFBwYW0sLngKJPdQ8/a7cfmZGNnWFWexGTeTmYo=
Message-ID: <8304166e-cc8f-4811-95e3-3c4414ef7726@apertussolutions.com>
Date: Mon, 26 Aug 2024 12:16:05 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2] xen: PE/COFF image header
Content-Language: en-US
To: Jan Beulich <jbeulich@suse.com>, =?UTF-8?B?TWlsYW4gxJBva2nEhw==?=
 <milandjokic1995@gmail.com>
Cc: oleksii.kurochko@gmail.com, Nikola Jelic <nikola.jelic@rt-rk.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, Milan Djokic <milan.djokic@rt-rk.com>,
 xen-devel@lists.xenproject.org
References: <2b747d672eeadc1150d3b84f0303e1d288311133.1721391876.git.milan.djokic@rt-rk.com>
 <728bb10e944a7ec28a67c2e9e62910632eb2366b.1721758832.git.milandjokic1995@gmail.com>
 <1e898a3c-b881-4ca8-99f0-48f51ed28098@suse.com>
 <CAKp59VEM6UWHM1Yu9NToFu9T4GfJpgKiXdAzA096KMVcMRqEsg@mail.gmail.com>
 <a84aaeed-6310-42fa-97e9-b391273c0132@suse.com>
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
Autocrypt: addr=dpsmith@apertussolutions.com; keydata=
 xsJuBFYrueARCACPWL3r2bCSI6TrkIE/aRzj4ksFYPzLkJbWLZGBRlv7HQLvs6i/K4y/b4fs
 JDq5eL4e9BdfdnZm/b+K+Gweyc0Px2poDWwKVTFFRgxKWq9R7McwNnvuZ4nyXJBVn7PTEn/Z
 G7D08iZg94ZsnUdeXfgYdJrqmdiWA6iX9u84ARHUtb0K4r5WpLUMcQ8PVmnv1vVrs/3Wy/Rb
 foxebZNWxgUiSx+d02e3Ad0aEIur1SYXXv71mqKwyi/40CBSHq2jk9eF6zmEhaoFi5+MMMgX
 X0i+fcBkvmT0N88W4yCtHhHQds+RDbTPLGm8NBVJb7R5zbJmuQX7ADBVuNYIU8hx3dF3AQCm
 601w0oZJ0jGOV1vXQgHqZYJGHg5wuImhzhZJCRESIwf+PJxik7TJOgBicko1hUVOxJBZxoe0
 x+/SO6tn+s8wKlR1Yxy8gYN9ZRqV2I83JsWZbBXMG1kLzV0SAfk/wq0PAppA1VzrQ3JqXg7T
 MZ3tFgxvxkYqUP11tO2vrgys+InkZAfjBVMjqXWHokyQPpihUaW0a8mr40w9Qui6DoJj7+Gg
 DtDWDZ7Zcn2hoyrypuht88rUuh1JuGYD434Q6qwQjUDlY+4lgrUxKdMD8R7JJWt38MNlTWvy
 rMVscvZUNc7gxcmnFUn41NPSKqzp4DDRbmf37Iz/fL7i01y7IGFTXaYaF3nEACyIUTr/xxi+
 MD1FVtEtJncZNkRn7WBcVFGKMAf+NEeaeQdGYQ6mGgk++i/vJZxkrC/a9ZXme7BhWRP485U5
 sXpFoGjdpMn4VlC7TFk2qsnJi3yF0pXCKVRy1ukEls8o+4PF2JiKrtkCrWCimB6jxGPIG3lk
 3SuKVS/din3RHz+7Sr1lXWFcGYDENmPd/jTwr1A1FiHrSj+u21hnJEHi8eTa9029F1KRfocp
 ig+k0zUEKmFPDabpanI323O5Tahsy7hwf2WOQwTDLvQ+eqQu40wbb6NocmCNFjtRhNZWGKJS
 b5GrGDGu/No5U6w73adighEuNcCSNBsLyUe48CE0uTO7eAL6Vd+2k28ezi6XY4Y0mgASJslb
 NwW54LzSSM0uRGFuaWVsIFAuIFNtaXRoIDxkcHNtaXRoQGFwZXJ0dXNzb2x1dGlvbnMuY29t
 PsJ6BBMRCAAiBQJWK7ngAhsjBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRBTc6WbYpR8
 KrQ9AP94+xjtFfJ8gj5c7PVx06Zv9rcmFUqQspZ5wSEkvxOuQQEAg6qEsPYegI7iByLVzNEg
 7B7fUG7pqWIfMqFwFghYhQzOwU0EViu54BAIAL6MXXNlrJ5tRUf+KMBtVz1LJQZRt/uxWrCb
 T06nZjnbp2UcceuYNbISOVHGXTzu38r55YzpkEA8eURQf+5hjtvlrOiHxvpD+Z6WcpV6rrMB
 kcAKWiZTQihW2HoGgVB3gwG9dCh+n0X5OzliAMiGK2a5iqnIZi3o0SeW6aME94bSkTkuj6/7
 OmH9KAzK8UnlhfkoMg3tXW8L6/5CGn2VyrjbB/rcrbIR4mCQ+yCUlocuOjFCJhBd10AG1IcX
 OXUa/ux+/OAV9S5mkr5Fh3kQxYCTcTRt8RY7+of9RGBk10txi94dXiU2SjPbassvagvu/hEi
 twNHms8rpkSJIeeq0/cAAwUH/jV3tXpaYubwcL2tkk5ggL9Do+/Yo2WPzXmbp8vDiJPCvSJW
 rz2NrYkd/RoX+42DGqjfu8Y04F9XehN1zZAFmCDUqBMa4tEJ7kOT1FKJTqzNVcgeKNBGcT7q
 27+wsqbAerM4A0X/F/ctjYcKwNtXck1Bmd/T8kiw2IgyeOC+cjyTOSwKJr2gCwZXGi5g+2V8
 NhJ8n72ISPnOh5KCMoAJXmCF+SYaJ6hIIFARmnuessCIGw4ylCRIU/TiXK94soilx5aCqb1z
 ke943EIUts9CmFAHt8cNPYOPRd20pPu4VFNBuT4fv9Ys0iv0XGCEP+sos7/pgJ3gV3pCOric
 p15jV4PCYQQYEQgACQUCViu54AIbDAAKCRBTc6WbYpR8Khu7AP9NJrBUn94C/3PeNbtQlEGZ
 NV46Mx5HF0P27lH3sFpNrwD/dVdZ5PCnHQYBZ287ZxVfVr4Zuxjo5yJbRjT93Hl0vMY=
In-Reply-To: <a84aaeed-6310-42fa-97e9-b391273c0132@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

On 8/19/24 11:39, Jan Beulich wrote:
> On 19.08.2024 17:34, Milan Đokić wrote:
>> On Mon, Jul 29, 2024 at 1:42 PM Jan Beulich <jbeulich@suse.com> wrote:
>>> On 23.07.2024 20:22, Milan Djokic wrote:
>>>> From: Nikola Jelic <nikola.jelic@rt-rk.com>
>>>>
>>>> Added PE/COFF generic image header which shall be used for EFI
>>>> application format for x86/risc-v. x86 and risc-v source shall be adjusted
>>>> to use this header in following commits. pe.h header is taken over from
>>>> linux kernel with minor changes in terms of formatting and structure member comments.
>>>> Also, COFF relocation and win cert structures are ommited, since these are not relevant for Xen.
>>>>
>>>> Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 36e4fc57fc16
>>>>
>>>> Signed-off-by: Nikola Jelic <nikola.jelic@rt-rk.com>
>>>> Signed-off-by: Milan Djokic <milan.djokic@rt-rk.com>
>>>
>>> This looks okay to me now, but I can't ack it (or more precisely my ack
>>> wouldn't mean anything). There are a few style issues in comments, but
>>> leaving them as they are in Linux may be intentional. Just one question,
>>> more to other maintainers than to you:
>>>
>> Are we supposed to CC someone additionally for approval?
> 
> No, you did Cc the right people afaics. You may want to ping the maintainers,
> though.
Should this not be submitted as part of a series that makes use of it? 
Would doing so not also address what declarations are actually needed?

v/r,
dps


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 16:31:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 16:31:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783527.1192841 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siccb-0002Si-8v; Mon, 26 Aug 2024 16:31:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783527.1192841; Mon, 26 Aug 2024 16:31:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siccb-0002Sb-4V; Mon, 26 Aug 2024 16:31:13 +0000
Received: by outflank-mailman (input) for mailman id 783527;
 Mon, 26 Aug 2024 16:31: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=89gm=PZ=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sicca-0002SV-5E
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 16:31:12 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 93603501-63c8-11ef-8776-851b0ebba9a2;
 Mon, 26 Aug 2024 18:31:01 +0200 (CEST)
Received: by mx.zohomail.com with SMTPS id 1724689855668759.160650327401;
 Mon, 26 Aug 2024 09:30:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 93603501-63c8-11ef-8776-851b0ebba9a2
ARC-Seal: i=1; a=rsa-sha256; t=1724689856; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=kIfA6KUSe4mLe5IqBV0DfeTUFaKP/74WaG/p2oYlXNpwrZvJmprTvNqD7MLaDnbDnpkRYryWsmhGTVIn7iycvVAeyrzewe6jO69iEKpAOpL39zomvPuyQN4f5daUK1lBFl6npLN3W1KC6v+IRTjT5Hau4Up4/Yn00u6uQuGUgTo=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1724689856; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=pieGe73qFrHjAlzspU0xYyVp2ATt0HeIFOZAoeHoMjc=; 
	b=XCtjMkGeh/YnfRE3hquLtIyGE9P5zrW5MI3y/8NoYSn6CQwXi6woG5J50Q6giizRVT4iuaAvbQEEEcDSGTEH7ZNjj8PNv9+HbdOnatDsky0acuKcn4AIoYuq7ALk5omSzPbtVnihwCsSTeZt1/i0cWULEqM1mQ+HjSDt6Y0JU+A=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1724689856;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To;
	bh=pieGe73qFrHjAlzspU0xYyVp2ATt0HeIFOZAoeHoMjc=;
	b=E9SYd3jBgRbFg8Vp46220/URlo+VL37farxIcQauTvKDCuda+/Whq6BKupl4VsW8
	3xH5ofgJZdow67E/Z2g8pbwC31JIWL8aEymYgqhdpDSyK7rbHybAebHskonjuB10nzG
	pzzODu66a4trBlUOypOTW/vsbPAjBiJejBLgRZ5k=
Message-ID: <85b2dbaa-99a6-4784-84f9-c79a44112b06@apertussolutions.com>
Date: Mon, 26 Aug 2024 12:30:54 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/time: prefer CMOS over EFI_GET_TIME
Content-Language: en-US
To: Roger Pau Monne <roger.pau@citrix.com>, xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
References: <20240315114242.33309-1-roger.pau@citrix.com>
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
Autocrypt: addr=dpsmith@apertussolutions.com; keydata=
 xsJuBFYrueARCACPWL3r2bCSI6TrkIE/aRzj4ksFYPzLkJbWLZGBRlv7HQLvs6i/K4y/b4fs
 JDq5eL4e9BdfdnZm/b+K+Gweyc0Px2poDWwKVTFFRgxKWq9R7McwNnvuZ4nyXJBVn7PTEn/Z
 G7D08iZg94ZsnUdeXfgYdJrqmdiWA6iX9u84ARHUtb0K4r5WpLUMcQ8PVmnv1vVrs/3Wy/Rb
 foxebZNWxgUiSx+d02e3Ad0aEIur1SYXXv71mqKwyi/40CBSHq2jk9eF6zmEhaoFi5+MMMgX
 X0i+fcBkvmT0N88W4yCtHhHQds+RDbTPLGm8NBVJb7R5zbJmuQX7ADBVuNYIU8hx3dF3AQCm
 601w0oZJ0jGOV1vXQgHqZYJGHg5wuImhzhZJCRESIwf+PJxik7TJOgBicko1hUVOxJBZxoe0
 x+/SO6tn+s8wKlR1Yxy8gYN9ZRqV2I83JsWZbBXMG1kLzV0SAfk/wq0PAppA1VzrQ3JqXg7T
 MZ3tFgxvxkYqUP11tO2vrgys+InkZAfjBVMjqXWHokyQPpihUaW0a8mr40w9Qui6DoJj7+Gg
 DtDWDZ7Zcn2hoyrypuht88rUuh1JuGYD434Q6qwQjUDlY+4lgrUxKdMD8R7JJWt38MNlTWvy
 rMVscvZUNc7gxcmnFUn41NPSKqzp4DDRbmf37Iz/fL7i01y7IGFTXaYaF3nEACyIUTr/xxi+
 MD1FVtEtJncZNkRn7WBcVFGKMAf+NEeaeQdGYQ6mGgk++i/vJZxkrC/a9ZXme7BhWRP485U5
 sXpFoGjdpMn4VlC7TFk2qsnJi3yF0pXCKVRy1ukEls8o+4PF2JiKrtkCrWCimB6jxGPIG3lk
 3SuKVS/din3RHz+7Sr1lXWFcGYDENmPd/jTwr1A1FiHrSj+u21hnJEHi8eTa9029F1KRfocp
 ig+k0zUEKmFPDabpanI323O5Tahsy7hwf2WOQwTDLvQ+eqQu40wbb6NocmCNFjtRhNZWGKJS
 b5GrGDGu/No5U6w73adighEuNcCSNBsLyUe48CE0uTO7eAL6Vd+2k28ezi6XY4Y0mgASJslb
 NwW54LzSSM0uRGFuaWVsIFAuIFNtaXRoIDxkcHNtaXRoQGFwZXJ0dXNzb2x1dGlvbnMuY29t
 PsJ6BBMRCAAiBQJWK7ngAhsjBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRBTc6WbYpR8
 KrQ9AP94+xjtFfJ8gj5c7PVx06Zv9rcmFUqQspZ5wSEkvxOuQQEAg6qEsPYegI7iByLVzNEg
 7B7fUG7pqWIfMqFwFghYhQzOwU0EViu54BAIAL6MXXNlrJ5tRUf+KMBtVz1LJQZRt/uxWrCb
 T06nZjnbp2UcceuYNbISOVHGXTzu38r55YzpkEA8eURQf+5hjtvlrOiHxvpD+Z6WcpV6rrMB
 kcAKWiZTQihW2HoGgVB3gwG9dCh+n0X5OzliAMiGK2a5iqnIZi3o0SeW6aME94bSkTkuj6/7
 OmH9KAzK8UnlhfkoMg3tXW8L6/5CGn2VyrjbB/rcrbIR4mCQ+yCUlocuOjFCJhBd10AG1IcX
 OXUa/ux+/OAV9S5mkr5Fh3kQxYCTcTRt8RY7+of9RGBk10txi94dXiU2SjPbassvagvu/hEi
 twNHms8rpkSJIeeq0/cAAwUH/jV3tXpaYubwcL2tkk5ggL9Do+/Yo2WPzXmbp8vDiJPCvSJW
 rz2NrYkd/RoX+42DGqjfu8Y04F9XehN1zZAFmCDUqBMa4tEJ7kOT1FKJTqzNVcgeKNBGcT7q
 27+wsqbAerM4A0X/F/ctjYcKwNtXck1Bmd/T8kiw2IgyeOC+cjyTOSwKJr2gCwZXGi5g+2V8
 NhJ8n72ISPnOh5KCMoAJXmCF+SYaJ6hIIFARmnuessCIGw4ylCRIU/TiXK94soilx5aCqb1z
 ke943EIUts9CmFAHt8cNPYOPRd20pPu4VFNBuT4fv9Ys0iv0XGCEP+sos7/pgJ3gV3pCOric
 p15jV4PCYQQYEQgACQUCViu54AIbDAAKCRBTc6WbYpR8Khu7AP9NJrBUn94C/3PeNbtQlEGZ
 NV46Mx5HF0P27lH3sFpNrwD/dVdZ5PCnHQYBZ287ZxVfVr4Zuxjo5yJbRjT93Hl0vMY=
In-Reply-To: <20240315114242.33309-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ZohoMailClient: External

On 3/15/24 07:42, Roger Pau Monne wrote:
> EFI_GET_TIME doesn't seem to be very reliable:

Would you mind reframing the opening as follows:

"The EFI_GET_TIME implementation is well known to be broken for many 
firmware implementations, for Xen the result on such implementations are:"

This provides a stronger, and a more realistic assessment of the 
situation, as opposed to a phrasing that could be interpreted simply as 
opinion. It also helps reflect in the git history of why this change is 
being made.

v/r,
dps


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 19:46:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 19:46:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783553.1192850 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sifeq-0007jz-JN; Mon, 26 Aug 2024 19:45:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783553.1192850; Mon, 26 Aug 2024 19:45:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sifeq-0007js-G9; Mon, 26 Aug 2024 19:45:44 +0000
Received: by outflank-mailman (input) for mailman id 783553;
 Mon, 26 Aug 2024 19:45:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=G5kA=PZ=gmail.com=milandjokic1995@srs-se1.protection.inumbo.net>)
 id 1sifep-0007jm-8w
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 19:45:43 +0000
Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com
 [2a00:1450:4864:20::432])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c6488190-63e3-11ef-8776-851b0ebba9a2;
 Mon, 26 Aug 2024 21:45:40 +0200 (CEST)
Received: by mail-wr1-x432.google.com with SMTP id
 ffacd0b85a97d-3718acbc87fso2660246f8f.3
 for <xen-devel@lists.xenproject.org>; Mon, 26 Aug 2024 12:45:40 -0700 (PDT)
Received: from Xen-host.domain.local ([89.216.37.146])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-42abed8b666sm199782125e9.1.2024.08.26.12.45.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 26 Aug 2024 12:45:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c6488190-63e3-11ef-8776-851b0ebba9a2
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724701540; x=1725306340; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=iWBiHJmTRBCaNxr4nKItKf1SRYiimQyGh/KXzm18Ab8=;
        b=E5hKVLj6D/kf6XlvoHLnAcKQDIv1HkAnAxh5TIC2caZ1y/GzoDI+zkV7Ry2Uk1chRY
         L6mzTmaTzjkJDkPRUlknlB/ap8lb2HtY7Aw2liFf7ZlMhIiA047+nwuJ+Yu/A9T3PeGt
         cyF9R41ZGNH7hH1BfSbodvMMuUo8hAX11FW7Qh+fjygoNV7/qJihNmxDdyIjE5FCUnjJ
         EqyqSMDSztEcJBVbG7yFqE08UO+UjdkT58zcyKW6IhZqdlA6AKEwwCv0RroKzbN0La9D
         w7EY5DWHnmSxyJIkOJVxP+NfkAHwSJ6vkRDX7ZBxW9q9OFfUt4RK46SzBD1hXGv7mvtR
         GUOQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724701540; x=1725306340;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=iWBiHJmTRBCaNxr4nKItKf1SRYiimQyGh/KXzm18Ab8=;
        b=jBKROjHQg5dr80aa49cKZ9+MBpEKJ54AY/C5j7gyLW+v6WphnZj9FIvrnehrBUWa+l
         YyBdMRDVWUiYYYj5zH8AxFI2uSqlEKBKmdHCC3UfEtszUG1dd/tuNzAa08B/R19NYeQg
         1XT/t7ISuNCM2/M3ujSQOXf7UZZ8NRez2eIxdLnsjS5G6LfN6WphIZy0jGCOx+3z2NIF
         RfezPFUXzDX2D8TPq1b2u8MznOFU1AuKgPwNZtrcPKX0fWZq5E93+yHuQZb86pmmq/S3
         RJms0heDvxBEAHKPH82gFR0yWw+dNLbh+n8D7iDMWgX76u5jQuh95li9WYBE+AK0cWLK
         /OPQ==
X-Gm-Message-State: AOJu0YyQGoOdtT9VsCMWVqMPDeVTqkqTsYBwmWkyFjmYKA/OYDviz+9U
	wvul8WtJsDidqkRiP0eG5X+DD7D5Di9pWyEUuUbTUbo3Fq6twpmGf31UI4Ru
X-Google-Smtp-Source: AGHT+IGBJs9ANa/8WQTxfxdo+mERZkmsc3575Zxpie945CxB31vyq4xYAPUsaXZUaVgRJ+hM1RJABQ==
X-Received: by 2002:a5d:5190:0:b0:371:86b2:a7e4 with SMTP id ffacd0b85a97d-3731186642emr6887795f8f.37.1724701539515;
        Mon, 26 Aug 2024 12:45:39 -0700 (PDT)
From: rtrk <milandjokic1995@gmail.com>
X-Google-Original-From: rtrk <rtrk@Xen-host.myguest.virtualbox.org>
To: xen-devel@lists.xenproject.org
Cc: oleksii.kurochko@gmail.com,
	Nikola Jelic <nikola.jelic@rt-rk.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Milan Djokic <milan.djokic@rt-rk.com>
Subject: [PATCH] x86/efi: Use generic PE/COFF structures in x86 efi source
Date: Mon, 26 Aug 2024 21:44:22 +0200
Message-Id: <6cf2799ced7dcee515ad8a6b6657522cdc7cec61.1724699546.git.milan.djokic@verisure.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Nikola Jelic <nikola.jelic@rt-rk.com>

Adapted x86 efi parser and mkreloc utility to use generic PE header
(efi/pe.h), instead of locally defined structures for each component.

Signed-off-by: Nikola Jelic <nikola.jelic@rt-rk.com>
Signed-off-by: Milan Djokic <milan.djokic@rt-rk.com>
---
 xen/arch/x86/efi/mkreloc.c | 134 +++++++++++--------------------------
 xen/common/efi/pe.c        |  92 ++++++-------------------
 2 files changed, 59 insertions(+), 167 deletions(-)

diff --git a/xen/arch/x86/efi/mkreloc.c b/xen/arch/x86/efi/mkreloc.c
index 083740ab8a..89c525d81e 100644
--- a/xen/arch/x86/efi/mkreloc.c
+++ b/xen/arch/x86/efi/mkreloc.c
@@ -9,45 +9,7 @@
 #include <sys/mman.h>
 #include <unistd.h>
 
-struct mz_hdr {
-    uint16_t signature;
-#define MZ_SIGNATURE 0x5a4d
-    uint16_t last_page_size;
-    uint16_t page_count;
-    uint16_t relocation_count;
-    uint16_t header_paras;
-    uint16_t min_paras;
-    uint16_t max_paras;
-    uint16_t entry_ss;
-    uint16_t entry_sp;
-    uint16_t checksum;
-    uint16_t entry_ip;
-    uint16_t entry_cs;
-    uint16_t relocations;
-    uint16_t overlay;
-    uint8_t reserved[32];
-    uint32_t extended_header_base;
-};
-
-struct pe_hdr {
-    uint32_t signature;
-#define PE_SIGNATURE 0x00004550
-    uint16_t cpu;
-    uint16_t section_count;
-    int32_t timestamp;
-    uint32_t symbols_file_offset;
-    uint32_t symbol_count;
-    uint16_t opt_hdr_size;
-    uint16_t flags;
-    struct {
-        uint16_t magic;
-#define PE_MAGIC_EXE32     0x010b
-#define PE_MAGIC_EXE32PLUS 0x020b
-        uint8_t linker_major, linker_minor;
-        uint32_t code_size, data_size, bss_size;
-        uint32_t entry_rva, code_rva, data_rva;
-    } opt_hdr;
-};
+#include "../../../include/efi/pe.h"
 
 #define PE_PAGE_SIZE 0x1000
 
@@ -55,22 +17,6 @@ struct pe_hdr {
 #define PE_BASE_RELOC_HIGHLOW  3
 #define PE_BASE_RELOC_DIR64   10
 
-struct coff_section {
-    char name[8];
-    uint32_t size;
-    uint32_t rva;
-    uint32_t file_size;
-    uint32_t file_offset;
-    uint32_t relocation_file_offset;
-    uint32_t line_number_file_offset;
-    uint16_t relocation_count;
-    uint16_t line_number_count;
-    uint32_t flags;
-#define COFF_SECTION_BSS         0x00000080U
-#define COFF_SECTION_DISCARDABLE 0x02000000U
-#define COFF_SECTION_WRITEABLE   0x80000000U
-};
-
 static void usage(const char *cmd, int rc)
 {
     fprintf(rc ? stderr : stdout,
@@ -80,7 +26,7 @@ static void usage(const char *cmd, int rc)
 }
 
 static unsigned int load(const char *name, int *handle,
-                         struct coff_section **sections,
+                         struct section_header **sections,
                          uint_fast64_t *image_base,
                          uint32_t *image_size,
                          unsigned int *width)
@@ -88,6 +34,7 @@ static unsigned int load(const char *name, int *handle,
     int in = open(name, O_RDONLY);
     struct mz_hdr mz_hdr;
     struct pe_hdr pe_hdr;
+    struct pe32_opt_hdr pe32_opt_hdr;
     uint32_t base;
 
     if ( in < 0 ||
@@ -96,16 +43,17 @@ static unsigned int load(const char *name, int *handle,
         perror(name);
         exit(2);
     }
-    if ( mz_hdr.signature != MZ_SIGNATURE ||
-         mz_hdr.relocations < sizeof(mz_hdr) ||
-         !mz_hdr.extended_header_base )
+    if ( mz_hdr.magic != MZ_MAGIC ||
+         mz_hdr.reloc_table_offset < sizeof(mz_hdr) ||
+         !mz_hdr.peaddr )
     {
         fprintf(stderr, "%s: Wrong DOS file format\n", name);
         exit(2);
     }
 
-    if ( lseek(in, mz_hdr.extended_header_base, SEEK_SET) < 0 ||
+    if ( lseek(in, mz_hdr.peaddr, SEEK_SET) < 0 ||
          read(in, &pe_hdr, sizeof(pe_hdr)) != sizeof(pe_hdr) ||
+         read(in, &pe32_opt_hdr, sizeof(pe32_opt_hdr)) != sizeof(pe32_opt_hdr) ||
          read(in, &base, sizeof(base)) != sizeof(base) ||
          /*
           * Luckily the image size field lives at the
@@ -117,35 +65,33 @@ static unsigned int load(const char *name, int *handle,
         perror(name);
         exit(3);
     }
-    switch ( (pe_hdr.signature == PE_SIGNATURE &&
-              pe_hdr.opt_hdr_size > sizeof(pe_hdr.opt_hdr)) *
-             pe_hdr.opt_hdr.magic )
+    switch ( (pe_hdr.magic == PE_MAGIC &&
+              pe_hdr.opt_hdr_size > sizeof(pe32_opt_hdr)) *
+              pe32_opt_hdr.magic )
     {
-    case PE_MAGIC_EXE32:
+    case PE_OPT_MAGIC_PE32:
         *width = 32;
         *image_base = base;
         break;
-    case PE_MAGIC_EXE32PLUS:
+    case PE_OPT_MAGIC_PE32PLUS:
         *width = 64;
-        *image_base = ((uint64_t)base << 32) | pe_hdr.opt_hdr.data_rva;
+        *image_base = ((uint64_t)base << 32) | pe32_opt_hdr.data_base;
         break;
     default:
         fprintf(stderr, "%s: Wrong PE file format\n", name);
         exit(3);
     }
 
-    *sections = malloc(pe_hdr.section_count * sizeof(**sections));
+    *sections = malloc(pe_hdr.sections * sizeof(**sections));
     if ( !*sections )
     {
         perror(NULL);
         exit(4);
     }
-    if ( lseek(in,
-               mz_hdr.extended_header_base + offsetof(struct pe_hdr, opt_hdr) +
-                  pe_hdr.opt_hdr_size,
+    if ( lseek(in, mz_hdr.peaddr + sizeof(pe_hdr) + pe_hdr.opt_hdr_size,
                SEEK_SET) < 0 ||
-         read(in, *sections, pe_hdr.section_count * sizeof(**sections)) !=
-             pe_hdr.section_count * sizeof(**sections) )
+         read(in, *sections, pe_hdr.sections * sizeof(**sections)) !=
+             pe_hdr.sections * sizeof(**sections) )
     {
         perror(name);
         exit(4);
@@ -153,12 +99,12 @@ static unsigned int load(const char *name, int *handle,
 
     *handle = in;
 
-    return pe_hdr.section_count;
+    return pe_hdr.sections;
 }
 
 static long page_size;
 
-static const void *map_section(const struct coff_section *sec, int in,
+static const void *map_section(const struct section_header *sec, int in,
                                const char *name)
 {
     const char *ptr;
@@ -166,10 +112,10 @@ static const void *map_section(const struct coff_section *sec, int in,
 
     if ( !page_size )
         page_size = sysconf(_SC_PAGESIZE);
-    offs = sec->file_offset & (page_size - 1);
+    offs = sec->data_addr & (page_size - 1);
 
-    ptr = mmap(0, offs + sec->file_size, PROT_READ, MAP_PRIVATE, in,
-               sec->file_offset - offs);
+    ptr = mmap(0, offs + sec->raw_data_size, PROT_READ, MAP_PRIVATE, in,
+               sec->data_addr - offs);
     if ( ptr == MAP_FAILED )
     {
         perror(name);
@@ -179,15 +125,15 @@ static const void *map_section(const struct coff_section *sec, int in,
     return ptr + offs;
 }
 
-static void unmap_section(const void *ptr, const struct coff_section *sec)
+static void unmap_section(const void *ptr, const struct section_header *sec)
 {
-    unsigned long offs = sec->file_offset & (page_size - 1);
+    unsigned long offs = sec->data_addr & (page_size - 1);
 
-    munmap((char *)ptr - offs, offs + sec->file_size);
+    munmap((char *)ptr - offs, offs + sec->raw_data_size);
 }
 
 static void diff_sections(const unsigned char *ptr1, const unsigned char *ptr2,
-                          const struct coff_section *sec,
+                          const struct section_header *sec,
                           int_fast64_t diff, unsigned int width,
                           uint_fast64_t base, uint_fast64_t end)
 {
@@ -208,7 +154,7 @@ static void diff_sections(const unsigned char *ptr1, const unsigned char *ptr2,
     while ( !(diff & (((int_fast64_t)1 << ((disp + 1) * CHAR_BIT)) - 1)) )
         ++disp;
 
-    for ( i = 0; i < sec->file_size; ++i )
+    for ( i = 0; i < sec->raw_data_size; ++i )
     {
         uint_fast32_t rva;
         union {
@@ -222,7 +168,7 @@ static void diff_sections(const unsigned char *ptr1, const unsigned char *ptr2,
         if ( ptr1[i] == ptr2[i] )
             continue;
 
-        if ( i < disp || i + width - disp > sec->file_size )
+        if ( i < disp || i + width - disp > sec->raw_data_size )
         {
             fprintf(stderr,
                     "Bogus difference at %.8s:%08" PRIxFAST32 "\n",
@@ -250,11 +196,11 @@ static void diff_sections(const unsigned char *ptr1, const unsigned char *ptr2,
             reloc_size += reloc_size & 2;
             if ( reloc_size )
                 printf("\t.equ rva_%08" PRIxFAST32 "_relocs,"
-                             " %#08" PRIxFAST32 "\n",
+                       " %#08" PRIxFAST32 "\n",
                        cur_rva, reloc_size);
             printf("\t.balign 4\n"
                    "\t.long %#08" PRIxFAST32 ","
-                          " rva_%08" PRIxFAST32 "_relocs\n",
+                   " rva_%08" PRIxFAST32 "_relocs\n",
                    rva, rva);
             cur_rva = rva;
             reloc_size = 8;
@@ -267,7 +213,7 @@ static void diff_sections(const unsigned char *ptr1, const unsigned char *ptr2,
             exit(3);
         }
 
-        if ( !(sec->flags & COFF_SECTION_WRITEABLE) )
+        if ( !(sec->flags & IMAGE_SCN_MEM_WRITE) )
             fprintf(stderr,
                     "Warning: relocation to r/o section %.8s:%08" PRIxFAST32 "\n",
                     sec->name, i - disp);
@@ -285,7 +231,7 @@ int main(int argc, char *argv[])
     unsigned int i, nsec, width1, width2;
     uint_fast64_t base1, base2;
     uint32_t size1, size2;
-    struct coff_section *sec1, *sec2;
+    struct section_header *sec1, *sec2;
 
     if ( argc == 1 ||
          !strcmp(argv[1], "-?") ||
@@ -328,16 +274,16 @@ int main(int argc, char *argv[])
 
         if ( memcmp(sec1[i].name, sec2[i].name, sizeof(sec1[i].name)) ||
              sec1[i].rva != sec2[i].rva ||
-             sec1[i].size != sec2[i].size ||
-             sec1[i].file_size != sec2[i].file_size ||
+             sec1[i].virtual_size != sec2[i].virtual_size ||
+             sec1[i].raw_data_size != sec2[i].raw_data_size ||
              sec1[i].flags != sec2[i].flags )
         {
             fprintf(stderr, "Mismatched section %u parameters\n", i);
             return 5;
         }
 
-        if ( !sec1[i].size ||
-             (sec1[i].flags & (COFF_SECTION_DISCARDABLE|COFF_SECTION_BSS)) )
+        if ( !sec1[i].virtual_size ||
+             (sec1[i].flags & (IMAGE_SCN_MEM_DISCARDABLE | IMAGE_SCN_CNT_UNINITIALIZED_DATA)) )
             continue;
 
         /*
@@ -354,10 +300,10 @@ int main(int argc, char *argv[])
             return 3;
         }
 
-        if ( sec1[i].file_size > sec1[i].size )
+        if ( sec1[i].raw_data_size > sec1[i].virtual_size )
         {
-            sec1[i].file_size = sec1[i].size;
-            sec2[i].file_size = sec2[i].size;
+            sec1[i].raw_data_size = sec1[i].virtual_size;
+            sec2[i].raw_data_size = sec2[i].virtual_size;
         }
         ptr1 = map_section(sec1 + i, in1, argv[1]);
         ptr2 = map_section(sec2 + i, in2, argv[2]);
diff --git a/xen/common/efi/pe.c b/xen/common/efi/pe.c
index ef8a2543e0..b50e9bb821 100644
--- a/xen/common/efi/pe.c
+++ b/xen/common/efi/pe.c
@@ -20,32 +20,10 @@
  * Lesser General Public License for more details.
  */
 
-
 #include "efi.h"
+#include "efi/pe.h"
 
-struct DosFileHeader {
-    UINT8   Magic[2];
-    UINT16  LastSize;
-    UINT16  nBlocks;
-    UINT16  nReloc;
-    UINT16  HdrSize;
-    UINT16  MinAlloc;
-    UINT16  MaxAlloc;
-    UINT16  ss;
-    UINT16  sp;
-    UINT16  Checksum;
-    UINT16  ip;
-    UINT16  cs;
-    UINT16  RelocPos;
-    UINT16  nOverlay;
-    UINT16  reserved[4];
-    UINT16  OEMId;
-    UINT16  OEMInfo;
-    UINT16  reserved2[10];
-    UINT32  ExeHeader;
-};
-
-#if defined(__arm__) || defined (__aarch64__)
+#if defined(__arm__) || defined(__aarch64__)
 #define PE_HEADER_MACHINE 0xaa64
 #elif defined(__x86_64__)
 #define PE_HEADER_MACHINE 0x8664
@@ -53,45 +31,17 @@ struct DosFileHeader {
 #error "Unknown architecture"
 #endif
 
-struct PeFileHeader {
-    UINT16  Machine;
-    UINT16  NumberOfSections;
-    UINT32  TimeDateStamp;
-    UINT32  PointerToSymbolTable;
-    UINT32  NumberOfSymbols;
-    UINT16  SizeOfOptionalHeader;
-    UINT16  Characteristics;
-};
-
-struct PeHeader {
-    UINT8   Magic[4];
-    struct PeFileHeader FileHeader;
-};
-
-struct PeSectionHeader {
-    CHAR8   Name[8];
-    UINT32  VirtualSize;
-    UINT32  VirtualAddress;
-    UINT32  SizeOfRawData;
-    UINT32  PointerToRawData;
-    UINT32  PointerToRelocations;
-    UINT32  PointerToLinenumbers;
-    UINT16  NumberOfRelocations;
-    UINT16  NumberOfLinenumbers;
-    UINT32  Characteristics;
-};
-
-static bool __init pe_name_compare(const struct PeSectionHeader *sect,
+static bool __init pe_name_compare(const struct section_header *sect,
                                    const CHAR16 *name)
 {
     size_t i;
 
-    if ( sect->Name[0] != '.' )
+    if ( sect->name[0] != '.' )
         return false;
 
-    for ( i = 1; i < sizeof(sect->Name); i++ )
+    for ( i = 1; i < sizeof(sect->name); i++ )
     {
-        const char c = sect->Name[i];
+        const char c = sect->name[i];
 
         if ( c != name[i - 1] )
             return false;
@@ -105,33 +55,29 @@ static bool __init pe_name_compare(const struct PeSectionHeader *sect,
 const void *__init pe_find_section(const void *image, const UINTN image_size,
                                    const CHAR16 *section_name, UINTN *size_out)
 {
-    const struct DosFileHeader *dos = image;
-    const struct PeHeader *pe;
-    const struct PeSectionHeader *sect;
+    const struct mz_hdr *mz = image;
+    const struct pe_hdr *pe;
+    const struct section_header *sect;
     UINTN offset, i;
 
-    if ( image_size < sizeof(*dos) ||
-         dos->Magic[0] != 'M' ||
-         dos->Magic[1] != 'Z' )
+    if ( image_size < sizeof(*mz) ||
+         mz->magic != 0x4D5A ) /* 0x4D5A is the hexadecimal value for "MZ" */
         return NULL;
 
-    offset = dos->ExeHeader;
+    offset = mz->peaddr;
     pe = image + offset;
 
     offset += sizeof(*pe);
     if ( image_size < offset ||
-         pe->Magic[0] != 'P' ||
-         pe->Magic[1] != 'E' ||
-         pe->Magic[2] != '\0' ||
-         pe->Magic[3] != '\0' )
+         pe->magic != 0x50450000 ) /* 0x50450000 is the hexadecimal value for "PE\0\0" */
         return NULL;
 
-    if ( pe->FileHeader.Machine != PE_HEADER_MACHINE )
+    if ( pe->machine != PE_HEADER_MACHINE )
         return NULL;
 
-    offset += pe->FileHeader.SizeOfOptionalHeader;
+    offset += pe->opt_hdr_size;
 
-    for ( i = 0; i < pe->FileHeader.NumberOfSections; i++ )
+    for ( i = 0; i < pe->sections; i++ )
     {
         sect = image + offset;
         if ( image_size < offset + sizeof(*sect) )
@@ -143,13 +89,13 @@ const void *__init pe_find_section(const void *image, const UINTN image_size,
             continue;
         }
 
-        if ( image_size < sect->VirtualSize + sect->VirtualAddress )
+        if ( image_size < sect->virtual_size + sect->rva )
             blexit(L"PE invalid section size + address");
 
         if ( size_out )
-            *size_out = sect->VirtualSize;
+            *size_out = sect->virtual_size;
 
-        return image + sect->VirtualAddress;
+        return image + sect->rva;
     }
 
     return NULL;
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Mon Aug 26 20:07:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 20:07:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783579.1192859 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sifza-0003pU-B0; Mon, 26 Aug 2024 20:07:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783579.1192859; Mon, 26 Aug 2024 20:07:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sifza-0003pN-8N; Mon, 26 Aug 2024 20:07:10 +0000
Received: by outflank-mailman (input) for mailman id 783579;
 Mon, 26 Aug 2024 20:07:08 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sifzY-0003pD-Nt; Mon, 26 Aug 2024 20:07:08 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sifzY-00050w-Ae; Mon, 26 Aug 2024 20:07:08 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sifzX-0003eT-RS; Mon, 26 Aug 2024 20:07:07 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sifzX-00025Y-QX; Mon, 26 Aug 2024 20:07:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=v5K5pQ2JiEg4F2/1cS3cDzyFqba3UMgShPkntuMyd7s=; b=nrYG34YPlqp56nvI6g7fmJlWZn
	0gSjokxq5IQEjJnEkbE+KCHeOdYny2e/2ASPJCc2+HdlEHJWGqsW9uTXBLQD6m8qKBgfak2bj4i8F
	Rl+10fYRZqjZ/WbJO4clUEnfTNQOHKdcQKz+wPg4XF5dDSHM5XK+wEypun4TdRZIjg40=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187350-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187350: tolerable trouble: fail/pass/starved - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:hosts-allocate:starved:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:hosts-allocate:starved:nonblocking
    xen-unstable:test-arm64-arm64-xl:hosts-allocate:starved:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:hosts-allocate:starved:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:hosts-allocate:starved:nonblocking
X-Osstest-Versions-This:
    xen=b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b
X-Osstest-Versions-That:
    xen=95764a0817a51741b7ffb1f78cba2a19b08ab2d1
From: osstest service owner <osstest-admin@xenproject.org>
Date: Mon, 26 Aug 2024 20:07:07 +0000

flight 187350 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187350/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187345
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187345
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187345
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187345
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187345
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187345
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx  3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-xsm       3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl           3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-credit2   3 hosts-allocate               starved  n/a
 test-arm64-arm64-xl-vhd       3 hosts-allocate               starved  n/a

version targeted for testing:
 xen                  b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b
baseline version:
 xen                  95764a0817a51741b7ffb1f78cba2a19b08ab2d1

Last test of basis   187345  2024-08-26 01:55:46 Z    0 days
Testing same since   187350  2024-08-26 12:08:57 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Huang Rui <ray.huang@amd.com>
  Jan Beulich <jbeulich@suse.com>
  Jiqian Chen <Jiqian.Chen@amd.com>
  Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
  Milan Djokic <milan.djokic@rt-rk.com>
  Nikola Jelic <nikola.jelic@rt-rk.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          starved 
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      starved 
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  starved 
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 starved 
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      starved 


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   95764a0817..b8cdfac2be  b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b -> master


From xen-devel-bounces@lists.xenproject.org Mon Aug 26 20:10:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Aug 2024 20:10:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783586.1192870 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sig34-0005Hq-R3; Mon, 26 Aug 2024 20:10:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783586.1192870; Mon, 26 Aug 2024 20:10:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sig34-0005Hj-O3; Mon, 26 Aug 2024 20:10:46 +0000
Received: by outflank-mailman (input) for mailman id 783586;
 Mon, 26 Aug 2024 20:10:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=G5kA=PZ=gmail.com=milandjokic1995@srs-se1.protection.inumbo.net>)
 id 1sig33-0005Hd-DF
 for xen-devel@lists.xenproject.org; Mon, 26 Aug 2024 20:10:45 +0000
Received: from mail-ot1-x331.google.com (mail-ot1-x331.google.com
 [2607:f8b0:4864:20::331])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4629b034-63e7-11ef-a50b-bb4a2ccca743;
 Mon, 26 Aug 2024 22:10:44 +0200 (CEST)
Received: by mail-ot1-x331.google.com with SMTP id
 46e09a7af769-70949118d26so4707234a34.0
 for <xen-devel@lists.xenproject.org>; Mon, 26 Aug 2024 13:10:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4629b034-63e7-11ef-a50b-bb4a2ccca743
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724703043; x=1725307843; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=EnF/XdMCXwGTcz8NWuFhou634GxQVc10IqMOlTd2QIg=;
        b=AeYMM2HviPaUqp33D1zALdV7NeiziP2q05kKDAcJWZeU2HW3H+2MQAl+qJ9VSn1zC/
         vPLM9d9u8QYxfJNLcHlw4byNpf+tnVVDC51kLlWHKJvfntecB67NhyM2/v8GGm1QtapT
         VGeI9L8yZiSqdAG4xYG6nYfJN7lAX012Y5Q3wN47ePMDDVT8o2Cgfnv03lNFRmDEPs8f
         0C8dKqMvNLi9Z3G6+netnHTlIgCoHDrFK3R1vOFqn2qq3Th/wmwi8slcmq0pneFrVj+9
         1aouV9lYjreenyK0kgrGVDdhuqmT6OiZB9CIiwUqlcGf4bzAXmvdu6GXijru0Rw5w1/M
         Lw1w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724703043; x=1725307843;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=EnF/XdMCXwGTcz8NWuFhou634GxQVc10IqMOlTd2QIg=;
        b=L2ZfRVxaWCyO0tGgIe1SwVSzSl/TMZbIb5U+b6TF3w3DUrdrZOkRP8LJ6W37xLfusH
         Sj0Kp2DxHU1RQEtouC8QGzoeeezDjzROEpMTtHviJtck4yoVZ9FFfxyYmFK42Ty8JFJn
         +nqj8NMVB6oHeW3hA1lNnNXuy6ZrvwaTr0erpBZZe/UzbwATrrHT3HKAuz/AwyzYsP5c
         UDKDjgLDAfkiU+cBynUDsYQc2/IpyJ6xP/CAw77s3BoknK8czl6/h/VIj8hTIYr82yWz
         iaCMXQKb7GLCWF5mb+hWD5E00JNV8mMVnA+ATZxFRHQxvxDIx7s9nno6MQkhJ0AGL4AM
         psmA==
X-Forwarded-Encrypted: i=1; AJvYcCXE9mv74Eq2l7AZQtqNU+XVhRrTCSbnPdA+pRlRtoO+BJci9FavjcZWZxHJf9RC5QhnRHGwq4PLFl4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxI4V7PcA2gPFnjTINf7c3vrqSd39FRe7strdIrPxe6mSpoGyKg
	j1Za06vBfGdQAjoHgzBNeEZe8aq37XI3AfA8yxbpwRZ4hNoBAiXTImWDPC+wwPMesFXVL1zf513
	KJ/Sv5VJiuJO2UZNgjJBgdlhGhWQ=
X-Google-Smtp-Source: AGHT+IFtKoPAV4ypYxfojxEGUHlgo9o3AzRRft31sPbid5z2Yyt+aXSOviBjt0WMaNjJHNZ6YYLnjEW9YSaBVTFHxdI=
X-Received: by 2002:a05:6830:6f48:b0:709:4065:63e6 with SMTP id
 46e09a7af769-70f482eaf41mr619903a34.12.1724703043175; Mon, 26 Aug 2024
 13:10:43 -0700 (PDT)
MIME-Version: 1.0
References: <2b747d672eeadc1150d3b84f0303e1d288311133.1721391876.git.milan.djokic@rt-rk.com>
 <728bb10e944a7ec28a67c2e9e62910632eb2366b.1721758832.git.milandjokic1995@gmail.com>
 <1e898a3c-b881-4ca8-99f0-48f51ed28098@suse.com> <CAKp59VEM6UWHM1Yu9NToFu9T4GfJpgKiXdAzA096KMVcMRqEsg@mail.gmail.com>
 <a84aaeed-6310-42fa-97e9-b391273c0132@suse.com> <8304166e-cc8f-4811-95e3-3c4414ef7726@apertussolutions.com>
In-Reply-To: <8304166e-cc8f-4811-95e3-3c4414ef7726@apertussolutions.com>
From: =?UTF-8?B?TWlsYW4gxJBva2nEhw==?= <milandjokic1995@gmail.com>
Date: Mon, 26 Aug 2024 22:10:31 +0200
Message-ID: <CAKp59VHW6npgCQyOigHTCZGAKcV3Jxj+MU+pe_1aE=byb62xNw@mail.gmail.com>
Subject: Re: [PATCH v2] xen: PE/COFF image header
To: "Daniel P. Smith" <dpsmith@apertussolutions.com>
Cc: Jan Beulich <jbeulich@suse.com>, oleksii.kurochko@gmail.com, 
	Nikola Jelic <nikola.jelic@rt-rk.com>, 
	=?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>, 
	Milan Djokic <milan.djokic@rt-rk.com>, xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hello Daniel,
On Mon, Aug 26, 2024 at 6:16=E2=80=AFPM Daniel P. Smith
<dpsmith@apertussolutions.com> wrote:
>
> On 8/19/24 11:39, Jan Beulich wrote:
> > On 19.08.2024 17:34, Milan =C4=90oki=C4=87 wrote:
> >> On Mon, Jul 29, 2024 at 1:42=E2=80=AFPM Jan Beulich <jbeulich@suse.com=
> wrote:
> >>> On 23.07.2024 20:22, Milan Djokic wrote:
> >>>> From: Nikola Jelic <nikola.jelic@rt-rk.com>
> >>>>
> >>>> Added PE/COFF generic image header which shall be used for EFI
> >>>> application format for x86/risc-v. x86 and risc-v source shall be ad=
justed
> >>>> to use this header in following commits. pe.h header is taken over f=
rom
> >>>> linux kernel with minor changes in terms of formatting and structure=
 member comments.
> >>>> Also, COFF relocation and win cert structures are ommited, since the=
se are not relevant for Xen.
> >>>>
> >>>> Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux=
.git 36e4fc57fc16
> >>>>
> >>>> Signed-off-by: Nikola Jelic <nikola.jelic@rt-rk.com>
> >>>> Signed-off-by: Milan Djokic <milan.djokic@rt-rk.com>
> >>>
> >>> This looks okay to me now, but I can't ack it (or more precisely my a=
ck
> >>> wouldn't mean anything). There are a few style issues in comments, bu=
t
> >>> leaving them as they are in Linux may be intentional. Just one questi=
on,
> >>> more to other maintainers than to you:
> >>>
> >> Are we supposed to CC someone additionally for approval?
> >
> > No, you did Cc the right people afaics. You may want to ping the mainta=
iners,
> > though.
> Should this not be submitted as part of a series that makes use of it?
> Would doing so not also address what declarations are actually needed?
>
We have sent subsequent patch (after this one was committed to
staging) which modifies x86 implementation to use these declarations:
https://lists.xenproject.org/archives/html/xen-devel/2024-08/msg01110.html
My understanding was that we need to separate patches which reuse
existing open-source code from the ones which update xen source
itself. Since these changes are not too big and do not relate to
multiple
Xen topics (only EFI), I thought that they are not applicable for
patch series. Although after your comment it seems that I could be
wrong :) .

BR,
Milan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 00:56:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 00:56:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783612.1192896 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sikVG-0008Fw-TA; Tue, 27 Aug 2024 00:56:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783612.1192896; Tue, 27 Aug 2024 00:56:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sikVG-0008Fp-Po; Tue, 27 Aug 2024 00:56:10 +0000
Received: by outflank-mailman (input) for mailman id 783612;
 Tue, 27 Aug 2024 00:56:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=Nig9=P2=amd.com=VictorM.Lira@srs-se1.protection.inumbo.net>)
 id 1sikVG-0008Fj-2k
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 00:56:10 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on2060c.outbound.protection.outlook.com
 [2a01:111:f403:2418::60c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 22e2d8c7-640f-11ef-a50b-bb4a2ccca743;
 Tue, 27 Aug 2024 02:56:06 +0200 (CEST)
Received: from MW2PR16CA0056.namprd16.prod.outlook.com (2603:10b6:907:1::33)
 by MN2PR12MB4223.namprd12.prod.outlook.com (2603:10b6:208:1d3::18) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Tue, 27 Aug
 2024 00:55:55 +0000
Received: from CO1PEPF000044FA.namprd21.prod.outlook.com
 (2603:10b6:907:1:cafe::34) by MW2PR16CA0056.outlook.office365.com
 (2603:10b6:907:1::33) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.20 via Frontend
 Transport; Tue, 27 Aug 2024 00:55:55 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1PEPF000044FA.mail.protection.outlook.com (10.167.241.200) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7939.2 via Frontend Transport; Tue, 27 Aug 2024 00:55:54 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 26 Aug
 2024 19:54:52 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 26 Aug
 2024 19:54:36 -0500
Received: from xsjwoods50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend
 Transport; Mon, 26 Aug 2024 19:54:36 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 22e2d8c7-640f-11ef-a50b-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=HtauIq1b76YQwB7xKaXX7FOsyxHED7tUe8uIpeLXhwXI4gk8YazgoMwoXA5QZ42/XqExkKrSinKJHguu0lFwElZLG/7CgR64V2nVAYxzhQiYlNSIFOkM8qOIKtJqEXdhJcmmAsl+VghMguoKVj06+Tx/alhW84YuoDXLW6whNd5C4OORh1EGy8s9MZvV+KFZTZ4GnSsadSPJXJwOT9dPHhB63le8ufZa+Q+KpoJ3M+wOe4vFUbkOXX8ktb4Cpv4w+ISl6YOy5J5K0UM/qpbLYu8TWEyXD3drIMvVBxKYCfuEin7FVLpo6822FEFZYStLgepQwX4yHvGMUgLVxuBWBA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=zcTkl6xrk4aiZLn8LE+k6PzG3MTPmlQPQmIf1caufRE=;
 b=T5TBG0dIgCdkkOE9ZFj/Svl7U+IToxjxbH6IiYhFP1CvnaItrYXX+E1bxxJ4Ocwpt7gwwJMckdtkVECNKOdJ3zjVTAX3tQwqLJuipZ6+j9iQ+kK40hSGaWzqGEMVLCTtRcFC8+pWTT6sCr9MfRM8R/RHZ6hMrDwzO8OTCaM5Mwe7YOjah61GU3DIxVYb25RNRjAYYu8/+7VGpTRIoDkd6l9fDXIHPOUlLYESo96vTMHlkjopTTRRtB/Q6FvHCnflJLazQPzA/ttN37G5/LVf+B2hXITlf32uyAIhesJQ5DC13zRQ0cTtZSG97AyokC6+tBi5cd2nYB+gOOnpIzlFqw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=zcTkl6xrk4aiZLn8LE+k6PzG3MTPmlQPQmIf1caufRE=;
 b=kBAa9JFJIi5gYtQu+s5ieg8OHWP/dZniWlX6+cscJg8YOD0AzJ3PPtPVBS5O68j7HS3Ip3oKlmKNcL8T3RVvOqrPWn35fAZPhR+IqQ+1F80heMZF86NVL0Vq3jC2koKfuxvxZKZ1idujdr+zEUj7s4+F7JlHj5BG68Wp635DdK8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: <victorm.lira@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Victor Lira <victorm.lira@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>
Subject: [PATCH v1] automation: update xilinx tests to use expect
Date: Mon, 26 Aug 2024 17:54:24 -0700
Message-ID: <fbda01cf915786ac7d51f9dc98489eed088a0433.1724719426.git.victorm.lira@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000044FA:EE_|MN2PR12MB4223:EE_
X-MS-Office365-Filtering-Correlation-Id: 42be6d08-ea52-4f07-9cf8-08dcc6330153
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?HmdH0yuGcCPXsJK8hnQNa0H/+iMH/9xdk6U9NKS28YP3/jUOVTI3oGustiin?=
 =?us-ascii?Q?22okexQrYhv57jMQI4GzahdF/0zNgucPVlO5B6EH5SdYaZoXgeCFI47E1GEP?=
 =?us-ascii?Q?bxJGY1pnmLaYB+x3fJacv24bNtJkopfh9qYbuwnBrRc3Ld3ey9eAvEK1oUb/?=
 =?us-ascii?Q?9ahNUblDuCTfAriaTsShCtClW5oa1bKQTWwjNMoiqzfU/z0b6pcutkRLa8zw?=
 =?us-ascii?Q?cD0dmIZ3bi7uVnMIyAez543Rt44yJpe7xbxko6CUYITPrK5NLLKa8nXjUCPM?=
 =?us-ascii?Q?ePJxWNposlM0SaOX2JYJoHitpj9JC91ojn5C9437pDU2at8gTfWzaSB+zUy9?=
 =?us-ascii?Q?ELUp1s1BxbFvXrqHSBWsYqCP1gtHTXtvBWqt5LFqkKQC55TEIUVOOtaViA33?=
 =?us-ascii?Q?0QDuFDCIJxbrfjHBHrTpDU4X9PoR2ud/RVGyNDmP+Q5gYoPvw8kqcx+AtLHO?=
 =?us-ascii?Q?RCsurS5T9XJBN0kBKqNE8V7yiNsMpz46Ib/CVRMZ4pwG/CXnVUTvhc3tfuCN?=
 =?us-ascii?Q?9c+t15K8iVMjtvxTylO2Ac1Cs9cSHlIS7L0gCxwaBUxLhjf8bxYo/vWBL+4r?=
 =?us-ascii?Q?ny8Lf/W5SbbeybBO9aCLvNFTQz54NaSr3sK7LaQyLSzkuh7r6VQmd6p2FVhr?=
 =?us-ascii?Q?6eYz+DO4qPrbDNgfaauFPYX1/5Sh9rrf1VXe142qNai1Q/hwfospTJKmGTXk?=
 =?us-ascii?Q?3iUGn7C21R09ye3Fg2YNF8Ii+8N4TZ195brVRZxRIynATEcC9wZ+Uww/BMya?=
 =?us-ascii?Q?9TYMwD7fOxpVlF8Jo+ICuiNlJn/r74pxo2kclzCeN/zRXwcw9eYF45tF/DAL?=
 =?us-ascii?Q?lD+A371zSqbBUlBOKAi1Byu188rz9SS87QQMOHSUM+d5QhCafEDn7cbUZ2aZ?=
 =?us-ascii?Q?FuV3cX2ytJezPuAJl/j2KKBzjbk7Mz9KflWe+9TvJMpcYSrgpTDW5hkY55Tn?=
 =?us-ascii?Q?nYIL67aMD3DOKw3V8HvhFiRnm5x97+ure0tiIcRVeSvi570iFZIpEinRgdVH?=
 =?us-ascii?Q?ISF65pRbt9P3iiCqjZ+T5bu4lxfMzrtym2HSKM5iUeMkb9CA/WDIfKOSJgCc?=
 =?us-ascii?Q?v3Qp0NvHYDvoUL8LMfk+BYFGYh0dkwQjYf6a+YcbbfOZj/1C87NBflVB7UGO?=
 =?us-ascii?Q?FgRagmzaA/fzv7GNbktoIMXtfhtBcqG1StNzKNISW+kH0/fYO8t+vgoluFqa?=
 =?us-ascii?Q?HiOr2jUjW153scrpZ9i23UzfbaPOPnjmBf6Ix3xTvdORxOOnT6rukHI43bX+?=
 =?us-ascii?Q?l3p9H/uQ9CWyDNLN8Trh66v6U0Rq34bt1BOh2CJOq+oDnI0LfI1O++vGVWIh?=
 =?us-ascii?Q?XMqM9+tq/pC33oRO4DOQ2qdXs6eRWqbJEdEJVA/9qoGQ2mgrawX9x3uvkFAP?=
 =?us-ascii?Q?U58JQ+7ZIjV9vpcHlovMiCpUu9KbrkmAx6mqBzJfBRvIh9IRAwi9H3ItusXs?=
 =?us-ascii?Q?RkRUyLdELElYZ+8jdnP+dU6em7Idv/64?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 00:55:54.5937
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 42be6d08-ea52-4f07-9cf8-08dcc6330153
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000044FA.namprd21.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4223

From: Victor Lira <victorm.lira@amd.com>

Fixes the CI failure introduced by 95764a0817.

Update xilinx-smoke tests to use the "expect" utility for early exit from
tests. Generalize the script "qemu-key.exp" to be used by both QEMU and
hardware tests. Add a missing "-continue_timer" flag for the expect script
to properly time out.

Signed-off-by: Victor Lira <victorm.lira@amd.com>
---
Cc: Stefano Stabellini <sstabellini@kernel.org>
---
 .../build/ubuntu/xenial-xilinx.dockerfile     |  1 +
 automation/gitlab-ci/test.yaml                |  2 ++
 .../scripts/{qemu-key.exp => console.exp}     | 27 +++++++++++--------
 automation/scripts/qemu-alpine-x86_64.sh      |  8 +++---
 automation/scripts/qemu-smoke-dom0-arm32.sh   |  8 +++---
 automation/scripts/qemu-smoke-dom0-arm64.sh   |  8 +++---
 .../scripts/qemu-smoke-dom0less-arm32.sh      |  8 +++---
 .../scripts/qemu-smoke-dom0less-arm64.sh      |  8 +++---
 automation/scripts/qemu-smoke-ppc64le.sh      |  8 +++---
 automation/scripts/qemu-smoke-riscv64.sh      |  8 +++---
 automation/scripts/qemu-smoke-x86-64.sh       |  8 +++---
 automation/scripts/qemu-xtf-dom0less-arm64.sh |  8 +++---
 .../scripts/xilinx-smoke-dom0-x86_64.sh       | 21 +++++++--------
 .../scripts/xilinx-smoke-dom0less-arm64.sh    | 20 +++++++-------
 14 files changed, 76 insertions(+), 67 deletions(-)
 rename automation/scripts/{qemu-key.exp => console.exp} (50%)

diff --git a/automation/build/ubuntu/xenial-xilinx.dockerfile b/automation/build/ubuntu/xenial-xilinx.dockerfile
index f03d62e8bd..6107d8b771 100644
--- a/automation/build/ubuntu/xenial-xilinx.dockerfile
+++ b/automation/build/ubuntu/xenial-xilinx.dockerfile
@@ -20,6 +20,7 @@ RUN apt-get update && \
         git \
         gzip \
         file \
+        expect \
         && \
         apt-get autoremove -y && \
         apt-get clean && \
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 3b339f387f..62dbed93d2 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -179,6 +179,8 @@ xilinx-smoke-dom0less-arm64-gcc-debug-gem-passthrough:

 xilinx-smoke-dom0-x86_64-gcc-debug:
   extends: .xilinx-x86_64
+  variables:
+    TEST_TIMEOUT: 500
   script:
     - ./automation/scripts/xilinx-smoke-dom0-x86_64.sh ping 2>&1 | tee ${LOGFILE}
   needs:
diff --git a/automation/scripts/qemu-key.exp b/automation/scripts/console.exp
similarity index 50%
rename from automation/scripts/qemu-key.exp
rename to automation/scripts/console.exp
index 787f1f08cb..2cf31e7ac0 100755
--- a/automation/scripts/qemu-key.exp
+++ b/automation/scripts/console.exp
@@ -1,23 +1,29 @@
 #!/usr/bin/expect -f

-if {[info exists env(QEMU_TIMEOUT)]} {
-    set timeout $env(QEMU_TIMEOUT)
+if {[info exists env(TEST_TIMEOUT)]} {
+    set timeout $env(TEST_TIMEOUT)
 } else {
     set timeout 1500
 }

-log_file -a $env(QEMU_LOG)
+log_file -a $env(TEST_LOGFILE)

 match_max 10000

-eval spawn $env(QEMU_CMD)
+eval spawn $env(TEST_CMD_START)

 expect_after {
     -re "(.*)\r" {
-        exp_continue
+        exp_continue -continue_timer
+    }
+    timeout {
+        send_error "ERROR-Timeout!\n"
+        exit 1
+    }
+    eof {
+        send_error "ERROR-EOF!\n"
+        exit 1
     }
-    timeout {send_error "ERROR-Timeout!\n"; exit 1}
-    eof {send_error "ERROR-EOF!\n"; exit 1}
 }

 if {[info exists env(UBOOT_CMD)]} {
@@ -28,22 +34,21 @@ if {[info exists env(UBOOT_CMD)]} {

 if {[info exists env(LOG_MSG)]} {
     expect {
-        "$env(PASSED)" {
+        "$env(TEST_PASS_MSG)" {
             expect "$env(LOG_MSG)"
             exit 0
         }
         "$env(LOG_MSG)" {
-            expect "$env(PASSED)"
+            expect "$env(TEST_PASS_MSG)"
             exit 0
         }
     }
 }

 expect {
-    "$env(PASSED)" {
+    "$env(TEST_PASS_MSG)" {
         exit 0
     }
 }

 expect eof
-
diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 42a89e86b0..b701b917a5 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -77,7 +77,7 @@ EOF
 # Run the test
 rm -f smoke.serial
 set +e
-export QEMU_CMD="qemu-system-x86_64 \
+export TEST_CMD_START="qemu-system-x86_64 \
     -cpu qemu64,+svm \
     -m 2G -smp 2 \
     -monitor none -serial stdio \
@@ -85,8 +85,8 @@ export QEMU_CMD="qemu-system-x86_64 \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0"

-export QEMU_LOG="smoke.serial"
+export TEST_LOGFILE="smoke.serial"
 export LOG_MSG="Domain-0"
-export PASSED="BusyBox"
+export TEST_PASS_MSG="BusyBox"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index fd64b19358..ea68f9973e 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -78,7 +78,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config

 rm -f ${serial_log}
 set +e
-export QEMU_CMD="./qemu-system-arm \
+export TEST_CMD_START="./qemu-system-arm \
    -machine virt \
    -machine virtualization=true \
    -smp 4 \
@@ -92,8 +92,8 @@ export QEMU_CMD="./qemu-system-arm \
    -bios /usr/lib/u-boot/qemu_arm/u-boot.bin"

 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="${serial_log}"
+export TEST_LOGFILE="${serial_log}"
 export LOG_MSG="Domain-0"
-export PASSED="/ #"
+export TEST_PASS_MSG="/ #"

-../automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+../automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index e0cea742b0..2ddb20b219 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -94,7 +94,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
 # Run the test
 rm -f smoke.serial
 set +e
-export QEMU_CMD="./binaries/qemu-system-aarch64 \
+export TEST_CMD_START="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
     -m 2048 -monitor none -serial stdio \
@@ -105,8 +105,8 @@ export QEMU_CMD="./binaries/qemu-system-aarch64 \
     -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"

 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="smoke.serial"
+export TEST_LOGFILE="smoke.serial"
 export LOG_MSG="Domain-0"
-export PASSED="BusyBox"
+export TEST_PASS_MSG="BusyBox"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index e824cb7c2a..fedc37d644 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -131,7 +131,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
 # Run the test
 rm -f ${serial_log}
 set +e
-export QEMU_CMD="./qemu-system-arm \
+export TEST_CMD_START="./qemu-system-arm \
     -machine virt \
     -machine virtualization=true \
     -smp 4 \
@@ -145,8 +145,8 @@ export QEMU_CMD="./qemu-system-arm \
     -bios /usr/lib/u-boot/qemu_arm/u-boot.bin"

 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="${serial_log}"
+export TEST_LOGFILE="${serial_log}"
 export LOG_MSG="${dom0_prompt}"
-export PASSED="${passed}"
+export TEST_PASS_MSG="${passed}"

-../automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+../automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index f42ba5d196..0885bd0179 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -205,7 +205,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
 # Run the test
 rm -f smoke.serial
 set +e
-export QEMU_CMD="./binaries/qemu-system-aarch64 \
+export TEST_CMD_START="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt,gic-version=$gic_version \
     -m 2048 -monitor none -serial stdio \
@@ -216,8 +216,8 @@ export QEMU_CMD="./binaries/qemu-system-aarch64 \
     -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"

 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="smoke.serial"
+export TEST_LOGFILE="smoke.serial"
 export LOG_MSG="Welcome to Alpine Linux"
-export PASSED="${passed}"
+export TEST_PASS_MSG="${passed}"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/scripts/qemu-smoke-ppc64le.sh
index 594f92c19c..85f2181ddd 100755
--- a/automation/scripts/qemu-smoke-ppc64le.sh
+++ b/automation/scripts/qemu-smoke-ppc64le.sh
@@ -11,7 +11,7 @@ machine=$1
 rm -f ${serial_log}
 set +e

-export QEMU_CMD="qemu-system-ppc64 \
+export TEST_CMD_START="qemu-system-ppc64 \
     -bios skiboot.lid \
     -M $machine \
     -m 2g \
@@ -22,7 +22,7 @@ export QEMU_CMD="qemu-system-ppc64 \
     -serial stdio \
     -kernel binaries/xen"

-export QEMU_LOG="${serial_log}"
-export PASSED="Hello, ppc64le!"
+export TEST_LOGFILE="${serial_log}"
+export TEST_PASS_MSG="Hello, ppc64le!"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
index c2595f657f..c2b5914e3f 100755
--- a/automation/scripts/qemu-smoke-riscv64.sh
+++ b/automation/scripts/qemu-smoke-riscv64.sh
@@ -6,14 +6,14 @@ set -ex
 rm -f smoke.serial
 set +e

-export QEMU_CMD="qemu-system-riscv64 \
+export TEST_CMD_START="qemu-system-riscv64 \
     -M virt \
     -smp 1 \
     -nographic \
     -m 2g \
     -kernel binaries/xen"

-export QEMU_LOG="smoke.serial"
-export PASSED="All set up"
+export TEST_LOGFILE="smoke.serial"
+export TEST_PASS_MSG="All set up"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
index 3440b1761d..f792df3b7d 100755
--- a/automation/scripts/qemu-smoke-x86-64.sh
+++ b/automation/scripts/qemu-smoke-x86-64.sh
@@ -16,12 +16,12 @@ esac

 rm -f smoke.serial
 set +e
-export QEMU_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
+export TEST_CMD_START="qemu-system-x86_64 -nographic -kernel binaries/xen \
         -initrd xtf/tests/example/$k \
         -append \"loglvl=all console=com1 noreboot console_timestamps=boot $extra\" \
         -m 512 -monitor none -serial stdio"

-export QEMU_LOG="smoke.serial"
-export PASSED="Test result: SUCCESS"
+export TEST_LOGFILE="smoke.serial"
+export TEST_PASS_MSG="Test result: SUCCESS"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
index 4042fe5060..0eceb4a74c 100755
--- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
+++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
@@ -51,7 +51,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
 # Run the test
 rm -f smoke.serial
 set +e
-export QEMU_CMD="./binaries/qemu-system-aarch64 \
+export TEST_CMD_START="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
     -m 2048 -monitor none -serial stdio \
@@ -62,7 +62,7 @@ export QEMU_CMD="./binaries/qemu-system-aarch64 \
     -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"

 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="smoke.serial"
-export PASSED="${passed}"
+export TEST_LOGFILE="smoke.serial"
+export TEST_PASS_MSG="${passed}"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 4559e2b9ee..144d9e73a1 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -27,7 +27,6 @@ memory = 512
 vif = [ "bridge=xenbr0", ]
 disk = [ ]
 '
-TIMEOUT_SECONDS=200

 # Select test variant.
 if [ "${TEST}" = "ping" ]; then
@@ -125,20 +124,20 @@ boot

 # Power cycle board and collect serial port output.
 SERIAL_DEV="/dev/serial/${TEST_BOARD}"
-SERIAL_CMD="cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"
 sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
 sleep 5
 sh /scratch/gitlab-runner/${TEST_BOARD}.sh 1
 sleep 5
 set +e
 stty -F ${SERIAL_DEV} 115200
-timeout -k 1 ${TIMEOUT_SECONDS} nohup sh -c "${SERIAL_CMD}"
-sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
-
-set -e

-if grep -q "${PASS_MSG}" smoke.serial; then
-    exit 0
-fi
-
-fatal "Test failed"
+# Capture the test result and power off board before exiting.
+export TEST_PASS_MSG="${PASS_MSG}"
+export TEST_CMD_START="cat ${SERIAL_DEV}"
+export TEST_LOGFILE="smoke.serial"
+mkfifo console
+sed 's/\r\+$//' < console &
+./automation/scripts/console.exp > console
+TEST_RESULT=$?
+sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
+exit ${TEST_RESULT}
diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index 18aa07f0a2..3a852e0798 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -137,13 +137,15 @@ cd $START
 SERIAL_DEV="/dev/serial/zynq"
 set +e
 stty -F ${SERIAL_DEV} 115200
-timeout -k 1 120 nohup sh -c "cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"

-# stop the board
-cd /scratch/gitlab-runner
-bash zcu102.sh 2
-cd $START
-
-set -e
-(grep -q "^Welcome to Alpine Linux" smoke.serial && grep -q "${passed}" smoke.serial) || exit 1
-exit 0
+# Capture the test result and power off board before exiting.
+export TEST_PASS_MSG="${passed}"
+export LOG_MSG="Welcome to Alpine Linux"
+export TEST_CMD_START="cat ${SERIAL_DEV}"
+export TEST_LOGFILE="smoke.serial"
+mkfifo console
+sed 's/\r\+$//' < console &
+./automation/scripts/console.exp > console
+TEST_RESULT=$?
+sh /scratch/gitlab-runner/zcu102.sh 2
+exit ${TEST_RESULT}
--
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 02:08:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 02:08:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783623.1192905 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sildQ-0003YM-1B; Tue, 27 Aug 2024 02:08:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783623.1192905; Tue, 27 Aug 2024 02:08:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sildP-0003YF-Uv; Tue, 27 Aug 2024 02:08:39 +0000
Received: by outflank-mailman (input) for mailman id 783623;
 Tue, 27 Aug 2024 02:08:39 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sildP-0003Y4-0W; Tue, 27 Aug 2024 02:08:39 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sildO-0002eu-MI; Tue, 27 Aug 2024 02:08:38 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sildO-00066t-6l; Tue, 27 Aug 2024 02:08:38 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sildO-0003ux-6J; Tue, 27 Aug 2024 02:08:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=spZ0w1wOGuOwPEWPCgG1z7JGanfcigELdgZYvMuuZJ0=; b=4kImUZxuKsvfgIRDjHAaqMU5vr
	g9GLZcrZU9llkC8g6sU+HrYtkq/2yfYiUGJUmwze3n/G6WnGJIoYIjdTeFloZGhtpDjkxhEO+PMth
	sRkrtEhvZ0xm4ej5EPm4GjTfai9zF1KF19Siyuz1dIHMGNlj2V6xhuTKsLKxq7WUOam0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187354-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187354: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=f3040bed3cb43ddad2e5d2fd54c6140f23c7d763
X-Osstest-Versions-That:
    ovmf=1cc0fae8d9e2681fc6a33e5602ce8368809f9465
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 27 Aug 2024 02:08:38 +0000

flight 187354 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187354/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 f3040bed3cb43ddad2e5d2fd54c6140f23c7d763
baseline version:
 ovmf                 1cc0fae8d9e2681fc6a33e5602ce8368809f9465

Last test of basis   187348  2024-08-26 05:41:34 Z    0 days
Testing same since   187354  2024-08-27 00:15:10 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Michael Kubacki <michael.kubacki@microsoft.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   1cc0fae8d9..f3040bed3c  f3040bed3cb43ddad2e5d2fd54c6140f23c7d763 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 04:00:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 04:00:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783648.1192916 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sinMu-0004Fp-Oi; Tue, 27 Aug 2024 03:59:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783648.1192916; Tue, 27 Aug 2024 03:59:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sinMu-0004Fi-LI; Tue, 27 Aug 2024 03:59:44 +0000
Received: by outflank-mailman (input) for mailman id 783648;
 Tue, 27 Aug 2024 03:59:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8CTq=P2=amd.com=Stewart.Hildebrand@srs-se1.protection.inumbo.net>)
 id 1sinMt-0004Fc-78
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 03:59:43 +0000
Received: from NAM04-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam04on20630.outbound.protection.outlook.com
 [2a01:111:f403:2408::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c898783f-6428-11ef-a50b-bb4a2ccca743;
 Tue, 27 Aug 2024 05:59:40 +0200 (CEST)
Received: from SJ0PR03CA0105.namprd03.prod.outlook.com (2603:10b6:a03:333::20)
 by LV3PR12MB9402.namprd12.prod.outlook.com (2603:10b6:408:213::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Tue, 27 Aug
 2024 03:59:35 +0000
Received: from CO1PEPF000066E9.namprd05.prod.outlook.com
 (2603:10b6:a03:333:cafe::25) by SJ0PR03CA0105.outlook.office365.com
 (2603:10b6:a03:333::20) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25 via Frontend
 Transport; Tue, 27 Aug 2024 03:59:34 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CO1PEPF000066E9.mail.protection.outlook.com (10.167.249.11) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 03:59:33 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 26 Aug
 2024 22:59:31 -0500
Received: from ubuntu.mshome.net (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Mon, 26 Aug 2024 22:59:30 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c898783f-6428-11ef-a50b-bb4a2ccca743
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ZuN+rw9jYy+MEwQQ2+1OXqI4sAeJrb7frlxQdFeFG+E9fAFgHz5bU7J9Omk6cyM9dIyuBIsIcpbv75F9OP2qse1PFqgtrdGtjWC3gPRKM0GmIWrkajmL3j8MPpmNAai9/Jy2SDb2QQqTzTRec9X5dcm3T2loi1l4BaNA3cn1JoYP1iaKqF03kYi5YQHUhmK4VJ3429FFaNMxCK3KwAR0hjsMPp7gjidk20dRPxITJVDsQlrcGYjFOtPIr8syvKGLPv3lqA/mWj9Um8yryFDGt0+v29tLwKLJWGqz3uda4r/R+m86vYXkxn1AIoW7oS4efF+eJPNQHoo4r5Nd3vw3Iw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=4IqMMfnIc5ecUpspmlAb1DkocqqVnbAC5PoQJDH2z7Y=;
 b=WePohI+AXwC9F+bIhhZaAXuHqWBpenbXzZ3sJo6XS3VFnRAQdWPDD6qq+UFUO1xQQI8ckP1fziwc+7PxzE9RkioRgmQOJaF6LmAAk/W+X4iIhfZ2uZQqKoZSXt/m6D1MdvPD1TIBr43cv/vf5Bn/1OuihwBIpbelIcwJ4yUmbft2ayEodiyc8B/xTvG9SkninQRb9wznaAhHYyX11R9m3YpgYM8NPH2eMs6sr89JJNEFnDxNNvfB6zADQd1ZWDegP5SBbl9T2e5c2Am3JaRfZMtt0x5k6kVjiKpQTMj1A4DWZGcRABEg+FcBgm+nM2vqQ5RAJ25n2NNJPP/WekiTQg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=4IqMMfnIc5ecUpspmlAb1DkocqqVnbAC5PoQJDH2z7Y=;
 b=vDkY3xgo7wLCo549m5YI5rm0bLHr1PW0hyHZi2Ybu7XSgzDcli0aVr1RqPfn1vBs7f58NFqIT8ifMu6Nbq9Im7sL29eIS4/KJcmtWMLuV2NtBaBRjOIY3LAMIDztufPoImrwh70c3BuTyN4apW0Ni9bxo0ZKZZvMCJjPVPQmOJU=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Stewart Hildebrand <stewart.hildebrand@amd.com>, Jan Beulich
	<jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Teddy Astie
	<teddy.astie@vates.tech>
Subject: [PATCH v4] x86/msi: fix locking for SR-IOV devices
Date: Mon, 26 Aug 2024 23:59:28 -0400
Message-ID: <20240827035929.118003-1-stewart.hildebrand@amd.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB04.amd.com: stewart.hildebrand@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000066E9:EE_|LV3PR12MB9402:EE_
X-MS-Office365-Filtering-Correlation-Id: 2256a0ee-b7dc-4b14-8cfb-08dcc64ca910
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?R7uUuYI1LhwYAL1EBBK0EJSbmuY3zSDixThkKd35/2ptCLoMwPub4Hf6OIzX?=
 =?us-ascii?Q?6R1/3SsqawjWfRX/FCP4Ohb/56fGUo3LEkXdBxqq62wvyaFHivPsxRZqLLrh?=
 =?us-ascii?Q?3rn653W1mUfECw2Pb5OIzwQb2HLjBlxaMBriD0QmOExGAF6ZUjAy7Sxm7G1G?=
 =?us-ascii?Q?fT0YdlaWn/e0zvIT/j2xEDGzIwtCPZAs9zfRqIkQHxzRScHGYvbdtMlqjzjB?=
 =?us-ascii?Q?TMrqKeZ3IZfumi5XFj5mC/zzKpCLJatXScnDAdU0ChGHOYhS9ZEMiuyM3Lw2?=
 =?us-ascii?Q?kJ8futsMuGSMh/rXFCHvju+Z0F8BS/c3USZ6YnX+9IdTDR1lVpL6OPrNjony?=
 =?us-ascii?Q?1uMlEOz0fkOS3l+jtfFmL+IV9BNGkuV8zR3Y8YNsgsAX+bEukqGc931UK97r?=
 =?us-ascii?Q?b2F6bZX7y7dPKkK9mQ5Vq9580/xhsW5iW5AV+3F3WNEnGq7VvbrZuhVV5lbm?=
 =?us-ascii?Q?Gpfullok2OTtv0gTS2udcuDIbmkB7sUGC0qU12zqU+wXZWhulG15EETM4i0j?=
 =?us-ascii?Q?EvXDox4Ob18s/wqsYTE+/i4+Jgq43i8jpjy5vVKSGceRURFdjwOPoS9wBFbw?=
 =?us-ascii?Q?bHlR2NX/qAMpZdsjrwVNqDdF18zwZHdZRBQP8yOOKJeSEt0fNHUNI11q+fjf?=
 =?us-ascii?Q?J543esEJ+P8UNWuQK47LLj1S1CWjG3ttaOW75pBW2XaIH7aIERjT3sO8XCkm?=
 =?us-ascii?Q?+3wOTz4SUyXLx4hRVHhT5wWGMh4t6+sKH0Y9aYR8+5M1f4+lhs7DV35b9eHs?=
 =?us-ascii?Q?dE/xW6DLtj6BpJiNt2Ju+NvrhV0ka1nZeJIYWgDk6SY/9ocKofyOCY/3c5HQ?=
 =?us-ascii?Q?kfgDUxldgSq1yuIWXv0KJbrb7BrM5SgWGF2l8fNeCFfq2sidlnKthY3DA2/Y?=
 =?us-ascii?Q?RNWXLJZJ34fIfAq7G2G3/9Cow2BIzcQkNGO1pD7Vbl+T07HSLH3jkb8r+jxe?=
 =?us-ascii?Q?IgkITtxhK+ALcj/Ja8tpQw2cfZVwq0G/h7MqWZM1VXKV5lq1M+4Blky10PQu?=
 =?us-ascii?Q?LH8b0ixND0DxaGY3qDFTDetfBctZNTPCETWTluKSEdimdChg1rHzXzSsuEM7?=
 =?us-ascii?Q?02vSDMbuZ0/n0V25+aZMXECwiHkJ8vDlA/N/vU7MQ0P9Zsezh8+SbQNsDLWZ?=
 =?us-ascii?Q?BbHZ7ZGj+qiPrlKMVI2lFOpT9Gz95+GstgQgYSlriUoxAJ/AZfcBnHdaw/F9?=
 =?us-ascii?Q?y64KdWKeDZd6uKQnGD9QHzNtnZjAt3IzTYbVZcPZILahXeKzyefZwspbTvBr?=
 =?us-ascii?Q?RqeXMu5O2OUReyo0RklbXuS+RZMSAoxngz6EeuwAjRBSbKxxSPYyiSQMGQIJ?=
 =?us-ascii?Q?wwClJIVGX42LVVqdTyWViRO2RXmQolApka25RHPOPOU/uMYuhiXCQxKlmpV+?=
 =?us-ascii?Q?1RMUMJn16jvWJoWAqQl5Rke3UlpeVwCY2FS/veQTze3e9wFPykjEoSEdS2NB?=
 =?us-ascii?Q?yMXzSbANm/8KmWuIUKq2wcAguHVFI2cf?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 03:59:33.4453
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 2256a0ee-b7dc-4b14-8cfb-08dcc64ca910
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000066E9.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR12MB9402

In commit 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci
structure") a lock moved from allocate_and_map_msi_pirq() to the caller
and changed from pcidevs_lock() to read_lock(&d->pci_lock). However, one
call path wasn't updated to reflect the change, leading to a failed
assertion observed under the following conditions:

* PV dom0
* Debug build (debug=y) of Xen
* There is an SR-IOV device in the system with one or more VFs enabled
* Dom0 has loaded the driver for the VF and enabled MSI-X

(XEN) Assertion 'd || pcidevs_locked()' failed at drivers/passthrough/pci.c:535
(XEN) ----[ Xen-4.20-unstable  x86_64  debug=y  Not tainted ]----
...
(XEN) Xen call trace:
(XEN)    [<ffff82d040284da8>] R pci_get_pdev+0x4c/0xab
(XEN)    [<ffff82d040344f5c>] F arch/x86/msi.c#read_pci_mem_bar+0x58/0x272
(XEN)    [<ffff82d04034530e>] F arch/x86/msi.c#msix_capability_init+0x198/0x755
(XEN)    [<ffff82d040345dad>] F arch/x86/msi.c#__pci_enable_msix+0x82/0xe8
(XEN)    [<ffff82d0403463e5>] F pci_enable_msi+0x3f/0x78
(XEN)    [<ffff82d04034be2b>] F map_domain_pirq+0x2a4/0x6dc
(XEN)    [<ffff82d04034d4d5>] F allocate_and_map_msi_pirq+0x103/0x262
(XEN)    [<ffff82d04035da5d>] F physdev_map_pirq+0x210/0x259
(XEN)    [<ffff82d04035e798>] F do_physdev_op+0x9c3/0x1454
(XEN)    [<ffff82d040329475>] F pv_hypercall+0x5ac/0x6af
(XEN)    [<ffff82d0402012d3>] F lstar_enter+0x143/0x150

In read_pci_mem_bar(), the VF obtains the struct pci_dev pointer for its
associated PF to access the vf_rlen array. This array is initialized in
pci_add_device() and is only populated in the associated PF's struct
pci_dev.

Add links between the VF's struct pci_dev and associated PF struct
pci_dev, ensuring the PF's struct doesn't get deallocated until all its
VFs have been removed. Access the vf_rlen array via the new link to the
PF, and remove the troublesome call to pci_get_pdev().

Add a call to pci_get_pdev() inside the pcidevs_lock()-locked section of
pci_add_device() to set up the link from VF to PF. In case the new
pci_get_pdev() invocation fails to find the associated PF (returning
NULL), return an error.

In pci_remove_device(), handle an issue with a corner case when a PF is
removed with VFs enabled, then re-added with VFs disabled. During PF
removal, a buggy PF driver may fail to disable SR-IOV, leaving stale
dangling VFs. At least Linux warns in this case:

[  106.500334]  0000:01:00.0: driver left SR-IOV enabled after remove

If the PF is subsequently re-added with VFs disabled, the previously
associated VFs in Xen would not be backed by a device. Any attempt to
access the config space of the stale VF would be invalid. Avoid issues
in this case by removing the VFs right away when removing the PF. This
also happens to simplify the maintenance of the PF<->VF links since the
associated PF will always exist during the lifetime of a VF. Note,
however, if a PF is removed before the VFs, Xen will return an error
for the VF removals since they were already removed.

Fixes: 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci structure")
Reported-by: Teddy Astie <teddy.astie@vates.tech>
Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
---
Candidate for backport to 4.19

v3->v4:
* handle case when PF is removed with VFs enabled, then re-added with
  VFs disabled

v2->v3:
* link from VF to PF's struct pci_dev *

v1->v2:
* remove call to pci_get_pdev()
---
When I tested removing a PF with VFs enabled, then re-adding with VFs
disabled, I observed the following Xen crash when dom0 attempted to
access the config space of a stale VF:

(XEN) Assertion 'pos' failed at arch/x86/msi.c:1275
(XEN) ----[ Xen-4.20-unstable  x86_64  debug=y  Tainted:   C    ]----
...
(XEN) Xen call trace:
(XEN)    [<ffff82d040346834>] R pci_msi_conf_write_intercept+0xa2/0x1de
(XEN)    [<ffff82d04035d6b4>] F pci_conf_write_intercept+0x68/0x78
(XEN)    [<ffff82d0403264e5>] F arch/x86/pv/emul-priv-op.c#pci_cfg_ok+0xa0/0x114
(XEN)    [<ffff82d04032660e>] F arch/x86/pv/emul-priv-op.c#guest_io_write+0xb5/0x1c8
(XEN)    [<ffff82d0403267bb>] F arch/x86/pv/emul-priv-op.c#write_io+0x9a/0xe0
(XEN)    [<ffff82d04037c77a>] F x86_emulate+0x100e5/0x25f1e
(XEN)    [<ffff82d0403941a8>] F x86_emulate_wrapper+0x29/0x64
(XEN)    [<ffff82d04032802b>] F pv_emulate_privileged_op+0x12e/0x217
(XEN)    [<ffff82d040369f12>] F do_general_protection+0xc2/0x1b8
(XEN)    [<ffff82d040201aa7>] F x86_64/entry.S#handle_exception_saved+0x2b/0x8c

This crash is avoided by removing the VFs right away with the PF.
---
 xen/arch/x86/msi.c            | 33 +++++++++++----------
 xen/drivers/passthrough/pci.c | 55 ++++++++++++++++++++++++++++++++---
 xen/include/xen/pci.h         | 13 ++++++++-
 3 files changed, 80 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
index 0c97fbb3fc03..8d54f268dbbf 100644
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -662,34 +662,31 @@ static int msi_capability_init(struct pci_dev *dev,
     return 0;
 }
 
-static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
+static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf,
+                            const struct pf_info *pf_info)
 {
+    pci_sbdf_t sbdf = PCI_SBDF(seg, bus, slot, func);
     u8 limit;
     u32 addr, base = PCI_BASE_ADDRESS_0;
     u64 disp = 0;
 
     if ( vf >= 0 )
     {
-        struct pci_dev *pdev = pci_get_pdev(NULL,
-                                            PCI_SBDF(seg, bus, slot, func));
         unsigned int pos;
         uint16_t ctrl, num_vf, offset, stride;
 
-        if ( !pdev )
-            return 0;
-
-        pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_SRIOV);
-        ctrl = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_CTRL);
-        num_vf = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_NUM_VF);
-        offset = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_OFFSET);
-        stride = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_STRIDE);
+        pos = pci_find_ext_capability(sbdf, PCI_EXT_CAP_ID_SRIOV);
+        ctrl = pci_conf_read16(sbdf, pos + PCI_SRIOV_CTRL);
+        num_vf = pci_conf_read16(sbdf, pos + PCI_SRIOV_NUM_VF);
+        offset = pci_conf_read16(sbdf, pos + PCI_SRIOV_VF_OFFSET);
+        stride = pci_conf_read16(sbdf, pos + PCI_SRIOV_VF_STRIDE);
 
         if ( !pos ||
              !(ctrl & PCI_SRIOV_CTRL_VFE) ||
              !(ctrl & PCI_SRIOV_CTRL_MSE) ||
              !num_vf || !offset || (num_vf > 1 && !stride) ||
              bir >= PCI_SRIOV_NUM_BARS ||
-             !pdev->vf_rlen[bir] )
+             !pf_info->vf_rlen[bir] )
             return 0;
         base = pos + PCI_SRIOV_BAR;
         vf -= PCI_BDF(bus, slot, func) + offset;
@@ -703,8 +700,8 @@ static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
         }
         if ( vf >= num_vf )
             return 0;
-        BUILD_BUG_ON(ARRAY_SIZE(pdev->vf_rlen) != PCI_SRIOV_NUM_BARS);
-        disp = vf * pdev->vf_rlen[bir];
+        BUILD_BUG_ON(ARRAY_SIZE(pf_info->vf_rlen) != PCI_SRIOV_NUM_BARS);
+        disp = vf * pf_info->vf_rlen[bir];
         limit = PCI_SRIOV_NUM_BARS;
     }
     else switch ( pci_conf_read8(PCI_SBDF(seg, bus, slot, func),
@@ -813,6 +810,7 @@ static int msix_capability_init(struct pci_dev *dev,
         int vf;
         paddr_t pba_paddr;
         unsigned int pba_offset;
+        const struct pf_info *pf_info;
 
         if ( !dev->info.is_virtfn )
         {
@@ -820,6 +818,7 @@ static int msix_capability_init(struct pci_dev *dev,
             pslot = slot;
             pfunc = func;
             vf = -1;
+            pf_info = NULL;
         }
         else
         {
@@ -827,9 +826,11 @@ static int msix_capability_init(struct pci_dev *dev,
             pslot = PCI_SLOT(dev->info.physfn.devfn);
             pfunc = PCI_FUNC(dev->info.physfn.devfn);
             vf = dev->sbdf.bdf;
+            pf_info = &dev->virtfn.pf_pdev->physfn;
         }
 
-        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
+        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf,
+                                       pf_info);
         WARN_ON(msi && msi->table_base != table_paddr);
         if ( !table_paddr )
         {
@@ -852,7 +853,7 @@ static int msix_capability_init(struct pci_dev *dev,
 
         pba_offset = pci_conf_read32(dev->sbdf, msix_pba_offset_reg(pos));
         bir = (u8)(pba_offset & PCI_MSIX_BIRMASK);
-        pba_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
+        pba_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf, pf_info);
         WARN_ON(!pba_paddr);
         pba_paddr += pba_offset & ~PCI_MSIX_BIRMASK;
 
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 5a446d3dcee0..97b3417252f7 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -341,6 +341,8 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
 
     list_add(&pdev->alldevs_list, &pseg->alldevs_list);
 
+    INIT_LIST_HEAD(&pdev->physfn.vf_list);
+
     /* update bus2bridge */
     switch ( pdev->type = pdev_type(pseg->nr, bus, devfn) )
     {
@@ -446,6 +448,10 @@ static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
 
     list_del(&pdev->alldevs_list);
     pdev_msi_deinit(pdev);
+
+    if ( pdev->info.is_virtfn )
+        list_del(&pdev->virtfn.entry);
+
     xfree(pdev);
 }
 
@@ -700,10 +706,31 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
          * extended function.
          */
         if ( pdev->info.is_virtfn )
+        {
+            struct pci_dev *pf_pdev;
+
             pdev->info.is_extfn = pf_is_extfn;
+            pf_pdev = pci_get_pdev(NULL,
+                                   PCI_SBDF(seg, info->physfn.bus,
+                                            info->physfn.devfn));
+            if ( pf_pdev )
+            {
+                pdev->virtfn.pf_pdev = pf_pdev;
+                list_add(&pdev->virtfn.entry, &pf_pdev->physfn.vf_list);
+            }
+            else
+            {
+                printk(XENLOG_WARNING "Failed to add SR-IOV device PF %pp for VF %pp\n",
+                       &PCI_SBDF(seg, info->physfn.bus, info->physfn.devfn),
+                       &pdev->sbdf);
+                free_pdev(pseg, pdev);
+                ret = -ENODEV;
+                goto out;
+            }
+        }
     }
 
-    if ( !pdev->info.is_virtfn && !pdev->vf_rlen[0] )
+    if ( !pdev->info.is_virtfn && !pdev->physfn.vf_rlen[0] )
     {
         unsigned int pos = pci_find_ext_capability(pdev->sbdf,
                                                    PCI_EXT_CAP_ID_SRIOV);
@@ -715,7 +742,9 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
         {
             unsigned int i;
 
-            BUILD_BUG_ON(ARRAY_SIZE(pdev->vf_rlen) != PCI_SRIOV_NUM_BARS);
+            BUILD_BUG_ON(ARRAY_SIZE(pdev->physfn.vf_rlen) !=
+                                    PCI_SRIOV_NUM_BARS);
+
             for ( i = 0; i < PCI_SRIOV_NUM_BARS; )
             {
                 unsigned int idx = pos + PCI_SRIOV_BAR + i * 4;
@@ -730,7 +759,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
                     continue;
                 }
                 ret = pci_size_mem_bar(pdev->sbdf, idx, NULL,
-                                       &pdev->vf_rlen[i],
+                                       &pdev->physfn.vf_rlen[i],
                                        PCI_BAR_VF |
                                        ((i == PCI_SRIOV_NUM_BARS - 1) ?
                                         PCI_BAR_LAST : 0));
@@ -818,6 +847,24 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn)
     list_for_each_entry ( pdev, &pseg->alldevs_list, alldevs_list )
         if ( pdev->bus == bus && pdev->devfn == devfn )
         {
+            ret = 0;
+
+            if ( !pdev->info.is_virtfn )
+            {
+                struct pci_dev *vf_pdev, *tmp;
+
+                /*
+                 * If a PF with VFs enabled is removed, then re-added without
+                 * VFs enabled, the previously associated VFs would no longer be
+                 * backed by a device. Remove the associated VFs right away.
+                 */
+                list_for_each_entry_safe(vf_pdev, tmp, &pdev->physfn.vf_list,
+                                         virtfn.entry)
+                    ret = pci_remove_device(vf_pdev->sbdf.seg,
+                                            vf_pdev->sbdf.bus,
+                                            vf_pdev->sbdf.devfn) ?: ret;
+            }
+
             if ( pdev->domain )
             {
                 write_lock(&pdev->domain->pci_lock);
@@ -826,7 +873,7 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn)
                 write_unlock(&pdev->domain->pci_lock);
             }
             pci_cleanup_msi(pdev);
-            ret = iommu_remove_device(pdev);
+            ret = iommu_remove_device(pdev) ?: ret;
             printk(XENLOG_DEBUG "PCI remove device %pp\n", &pdev->sbdf);
             free_pdev(pseg, pdev);
             break;
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 63e49f0117e9..a24026d25148 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -150,7 +150,18 @@ struct pci_dev {
         unsigned int count;
 #define PT_FAULT_THRESHOLD 10
     } fault;
-    u64 vf_rlen[6];
+    union {
+        struct pf_info {
+            /* Only populated for PFs (info.is_virtfn == false) */
+            struct list_head vf_list;             /* List head */
+            uint64_t vf_rlen[PCI_SRIOV_NUM_BARS];
+        } physfn;
+        struct {
+            /* Only populated for VFs (info.is_virtfn == true) */
+            struct list_head entry;               /* Entry in vf_list */
+            struct pci_dev *pf_pdev;              /* Link from VF to PF */
+        } virtfn;
+    };
 
     /* Data for vPCI. */
     struct vpci *vpci;

base-commit: b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 04:56:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 04:56:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783654.1192927 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sioFF-0005Tv-Sn; Tue, 27 Aug 2024 04:55:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783654.1192927; Tue, 27 Aug 2024 04:55:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sioFF-0005To-NI; Tue, 27 Aug 2024 04:55:53 +0000
Received: by outflank-mailman (input) for mailman id 783654;
 Tue, 27 Aug 2024 04:55:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sioFE-0005TY-Es; Tue, 27 Aug 2024 04:55:52 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sioFE-0005fC-9z; Tue, 27 Aug 2024 04:55:52 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sioFD-0004iW-TC; Tue, 27 Aug 2024 04:55:51 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sioFD-00053o-Sm; Tue, 27 Aug 2024 04:55:51 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=zYD0vIyVjXyS63O1jGdwBrTp0t2g/kRdLt4BvbvwVy8=; b=fAt91G2uXr0h321SPsIp/sXQjB
	tJBJK5HWEo+xQqDLMjDSZwp9c0W+JCmOYp9ZneOj4LIjwrH6y/ARZB0jWkNXrA0LqFxLnMhKtfIyF
	c5CFUGcegd3K/CWQKhhj1O9AcRUgLxESaayV8JSYrx70Zuw4QDbPCXNufHdIJiTpi4h4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187356-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187356: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=0e8af8803489a10d4edc61a94f1c6e03965c16f5
X-Osstest-Versions-That:
    ovmf=f3040bed3cb43ddad2e5d2fd54c6140f23c7d763
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 27 Aug 2024 04:55:51 +0000

flight 187356 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187356/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 0e8af8803489a10d4edc61a94f1c6e03965c16f5
baseline version:
 ovmf                 f3040bed3cb43ddad2e5d2fd54c6140f23c7d763

Last test of basis   187354  2024-08-27 00:15:10 Z    0 days
Testing same since   187356  2024-08-27 02:11:16 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Saloni Kasbekar <saloni.kasbekar@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   f3040bed3c..0e8af88034  0e8af8803489a10d4edc61a94f1c6e03965c16f5 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 06:09:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 06:09:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783668.1192935 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sipOC-0000xd-5n; Tue, 27 Aug 2024 06:09:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783668.1192935; Tue, 27 Aug 2024 06:09:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sipOC-0000xW-39; Tue, 27 Aug 2024 06:09:12 +0000
Received: by outflank-mailman (input) for mailman id 783668;
 Tue, 27 Aug 2024 06:09:10 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sipOA-0000xM-IO; Tue, 27 Aug 2024 06:09:10 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sipOA-0007Go-7a; Tue, 27 Aug 2024 06:09:10 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sipO9-0007fW-3k; Tue, 27 Aug 2024 06:09:09 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sipO9-00035A-3B; Tue, 27 Aug 2024 06:09:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ce1chYoAlW+J/Tqgm84S1HTEEj45RYjqDQWmHWH9DyU=; b=isH5Cu1sES94jxqDwzjmEkGLQ9
	bdKlrdiezNg0QBy3ZGYWJKBsN+pb8UkHDaIoGYc6cgMlcbuIlUD5ZoMlZI/CgSY+4epn8HEWAt7/D
	f57fE5OFxot9hYl2eeeLXh5tDNeFBbsxcmmC7aq6RDrmNYoryaeuGqcXOkYNImGGETFw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187351-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187351: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=f259e4cb8a8b4ef5463326fc214a7d8d7703d5de
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 27 Aug 2024 06:09:09 +0000

flight 187351 qemu-mainline real [real]
flight 187359 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187351/
http://logs.test-lab.xenproject.org/osstest/logs/187359/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass

version targeted for testing:
 qemuu                f259e4cb8a8b4ef5463326fc214a7d8d7703d5de
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  355 days
Failing since        182723  2023-09-07 18:19:05 Z  354 days   36 attempts
Testing same since   187340  2024-08-25 05:05:28 Z    2 days    4 attempts

------------------------------------------------------------
621 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 180913 lines long.)


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 08:41:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 08:41:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783688.1192945 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sirla-0000qD-Iz; Tue, 27 Aug 2024 08:41:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783688.1192945; Tue, 27 Aug 2024 08:41:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sirla-0000q6-GQ; Tue, 27 Aug 2024 08:41:30 +0000
Received: by outflank-mailman (input) for mailman id 783688;
 Tue, 27 Aug 2024 08:41:28 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sirlY-0000pw-S6; Tue, 27 Aug 2024 08:41:28 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sirlY-00024J-IR; Tue, 27 Aug 2024 08:41:28 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sirlY-0007Zb-5H; Tue, 27 Aug 2024 08:41:28 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sirlY-0003eJ-4r; Tue, 27 Aug 2024 08:41:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ITYQwq/rdTUNmrvJrk1UJh/nKQOezEzyGsx5nL2S5xQ=; b=Cn2PEJWPJPT5JtYKduw3j09pfd
	A81jUYGMVIkTj0HMdEu3fQjEqBhKfgE2VF8pI/IIbiAmBiOPoukh92C4jPaUkyGSaZ8yu8aMtj1eh
	wPznAl+9+G9/CBohYc4Bpf39yE2E6ufsHGuYgQ5b+pwgl7dyLkDId21TTBvqUnj04ZjA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187361-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187361: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=5a06afa7dd8ba8e99178fec9525be9e3fd2a4d3a
X-Osstest-Versions-That:
    ovmf=0e8af8803489a10d4edc61a94f1c6e03965c16f5
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 27 Aug 2024 08:41:28 +0000

flight 187361 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187361/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 5a06afa7dd8ba8e99178fec9525be9e3fd2a4d3a
baseline version:
 ovmf                 0e8af8803489a10d4edc61a94f1c6e03965c16f5

Last test of basis   187356  2024-08-27 02:11:16 Z    0 days
Testing same since   187361  2024-08-27 06:16:29 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Dun Tan <dun.tan@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   0e8af88034..5a06afa7dd  5a06afa7dd8ba8e99178fec9525be9e3fd2a4d3a -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 08:44:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 08:44:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783695.1192955 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sirow-0001Pf-0d; Tue, 27 Aug 2024 08:44:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783695.1192955; Tue, 27 Aug 2024 08:44:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sirov-0001PY-US; Tue, 27 Aug 2024 08:44:57 +0000
Received: by outflank-mailman (input) for mailman id 783695;
 Tue, 27 Aug 2024 08:44:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=qC/7=P2=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1sirot-0001PR-Rq
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 08:44:55 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a0c7a8a7-6450-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 10:44:53 +0200 (CEST)
Received: from truciolo.homenet.telecomitalia.it
 (host-79-46-33-59.retail.telecomitalia.it [79.46.33.59])
 by support.bugseng.com (Postfix) with ESMTPSA id 16F094EE077B;
 Tue, 27 Aug 2024 10:44:52 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a0c7a8a7-6450-11ef-99a0-01e77a169b0f
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: [XEN PATCH] automation/eclair: monitor rules 13.2 and 18.2
Date: Tue, 27 Aug 2024 10:44:46 +0200
Message-Id: <a285b271a7b89e81932115cbd23e8d9f8ca6d865.1724748117.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add MISRA C:2012 Rules 13.2 and 18.2 to the monitored set.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 automation/eclair_analysis/ECLAIR/monitored.ecl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/automation/eclair_analysis/ECLAIR/monitored.ecl b/automation/eclair_analysis/ECLAIR/monitored.ecl
index 7b085a329a..4d9ef1bd83 100644
--- a/automation/eclair_analysis/ECLAIR/monitored.ecl
+++ b/automation/eclair_analysis/ECLAIR/monitored.ecl
@@ -52,6 +52,7 @@
 -enable=MC3R1.R11.9
 -enable=MC3R1.R12.5
 -enable=MC3R1.R13.1
+-enable=MC3R1.R13.2
 -enable=MC3R1.R13.6
 -enable=MC3R1.R14.1
 -enable=MC3R1.R14.4
@@ -65,6 +66,7 @@
 -enable=MC3R1.R17.4
 -enable=MC3R1.R17.5
 -enable=MC3R1.R17.6
+-enable=MC3R1.R18.2
 -enable=MC3R1.R18.6
 -enable=MC3R1.R18.8
 -enable=MC3R1.R19.1
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 09:08:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 09:08:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783706.1192966 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sisBp-0005pm-Rg; Tue, 27 Aug 2024 09:08:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783706.1192966; Tue, 27 Aug 2024 09:08:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sisBp-0005pf-Og; Tue, 27 Aug 2024 09:08:37 +0000
Received: by outflank-mailman (input) for mailman id 783706;
 Tue, 27 Aug 2024 09:08:37 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=PF0L=P2=cloud.com=edwin.torok@srs-se1.protection.inumbo.net>)
 id 1sisBo-0005pZ-SB
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 09:08:36 +0000
Received: from mail-oa1-x34.google.com (mail-oa1-x34.google.com
 [2001:4860:4864:20::34])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ef3ce3df-6453-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 11:08:33 +0200 (CEST)
Received: by mail-oa1-x34.google.com with SMTP id
 586e51a60fabf-27020fca39aso4517398fac.0
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 02:08:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ef3ce3df-6453-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724749712; x=1725354512; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=c5anN8pL18L8tSoQYTb+4CpfoLT4xYPOaqVzwD+GN78=;
        b=FREMffk/8fFv+wnWsT8/oW+wfM82qHMxdZe5gy/yqfYIN8uYx/9TFuDLKn72P0vwMM
         XZbjeto7m/FCSlLys3iGk9mQANTakzZVz+AfXrUKXT1ezgNop0pFysVQ0/IIjn/vXh5I
         6LRPqOB7NURhasKB0+GFRF4s0wMGEq3FgFUbU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724749712; x=1725354512;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=c5anN8pL18L8tSoQYTb+4CpfoLT4xYPOaqVzwD+GN78=;
        b=PF262gCCGE/kNPklvLddxvRX4aKKjl9pxLtMZmULJzW3j6UtoOWkFrKCqNDQxOxpXT
         99L1cGV/OVLCbO8hI/vpT+oSajhsre02ZQck/yYk7q2uVeoPmoBJlR63X8MbPi5+jSir
         ve8tACmi3FwcQlzwgoWKP44dKkqUUhNOCspFC8UnNv6l0PRsGbN94JEZzDFhmoHcKC86
         hHXN751k11+wfxpimNuTX0TS9WsKeSFkQFN2/D2ImDg5MwuhxQGHaUgIe6z2VSmT2mbz
         l7RoQwoO53H7OWygu/TAWfpC7TZLAtfVczU61wmRJl+X0kz0b5tW9asxuL65urVhkS55
         cnSA==
X-Forwarded-Encrypted: i=1; AJvYcCVbgRBZWXvLuB4Blud2Yx1621sNez7yNxHtXLnhes2iOXO/xTa1lA//HGkSy4XLweHXGJ5b3TqzUrw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwntbC5rG8nPyVGcZ1QGSRmVLRowtIt44UcpXeXh88DATjdg0sn
	G2ViDEThivdH0p4ptrMm+qZZW784ka4chg7P/FkliBN5T1QTz/qTxO4dsM45Iy/D9F9yQBvBhjQ
	HAJ8OO/0iT1yMIbvjEtxTsC/pvOsCmhslZnMLgw==
X-Google-Smtp-Source: AGHT+IEHZNfJt6Ace4k1KuancEQx2ptrvKEPk80LcCQ5GCy05V4+Zc95u6Ory6ZNki6f5LBtlHSR0CZfJjmM/mf4Sas=
X-Received: by 2002:a05:6870:d14f:b0:254:b337:eebc with SMTP id
 586e51a60fabf-273e6686dfamr14142353fac.35.1724749712267; Tue, 27 Aug 2024
 02:08:32 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1724314239.git.andrii.sultanov@cloud.com>
 <6d4b94939c8910ffd7d70301b1d26c828f72ad86.1724314239.git.andrii.sultanov@cloud.com>
 <da0e9836-33f3-42c3-bda7-53d868a99ae1@citrix.com>
In-Reply-To: <da0e9836-33f3-42c3-bda7-53d868a99ae1@citrix.com>
From: Edwin Torok <edwin.torok@cloud.com>
Date: Tue, 27 Aug 2024 10:08:21 +0100
Message-ID: <CAEfZLvkL0Rcs=Tk_VxTxKwSj8wQben+jJ8Uay5iexBNNXYfwFQ@mail.gmail.com>
Subject: Re: [PATCH v1 2/4] ocaml/libs: Implement a dynamically-loaded plugin
 for Xenctrl.domain_getinfo
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Andrii Sultanov <andrii.sultanov@cloud.com>, xen-devel@lists.xenproject.org, 
	Christian Lindig <christian.lindig@citrix.com>, David Scott <dave@recoil.org>, 
	Anthony PERARD <anthony.perard@vates.tech>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Fri, Aug 23, 2024 at 6:19=E2=80=AFPM Andrew Cooper <andrew.cooper3@citri=
x.com> wrote:
>
> On 22/08/2024 10:06 am, Andrii Sultanov wrote:
> > This plugin intends to hide the unstable Xenctrl interface under a
> > stable one. In case of the change in the interface, a V2 of this plugin
> > would need to be produced, but V1 with the old interface would
> > need to be kept (with potential change in the implementation) in the
> > meantime.
> >
> > To reduce the need for such changes in the future, this plugin only
> > provides the absolute minimum functionality that Oxenstored uses - only
> > four fields of the domaininfo struct are used and presented here.
> >
> > Oxenstored currently uses the single-domain domain_getinfo function,
> > whereas Cxenstored uses the more-efficient domain_getinfolist. Both of
> > these are provided in the plugin to allow a transition from one to the
> > other without modifying the interface in the future. Both return
> > identical structures and rely on the same fields in xenctrl, thus if on=
e
> > of them breaks, both will break, and a new version of the interface wou=
ld
> > need to be issued.
> >
> > Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
> > ---
> >  tools/ocaml/Makefile                          |   1 +
> >  tools/ocaml/Makefile.rules                    |  17 +-
>
> This patch is already very big.  One minor way to help would be to split
> out the changes to Makefile.rules as a separate "build infrastructure
> for Ocaml dynamic libraries".
>
> >  tools/ocaml/libs/Makefile                     |   2 +-
> >  tools/ocaml/libs/xenstoredglue/META.in        |   4 +
> >  tools/ocaml/libs/xenstoredglue/Makefile       |  39 ++++
> >  .../domain_getinfo_plugin_v1/META.in          |   5 +
> >  .../domain_getinfo_plugin_v1/Makefile         |  38 ++++
> >  .../domain_getinfo_stubs_v1.c                 | 169 ++++++++++++++++++
> >  .../domain_getinfo_v1.ml                      |  51 ++++++
> >  .../domain_getinfo_v1.mli                     |   0
> >  .../libs/xenstoredglue/plugin_interface_v1.ml |  25 +++
> >  .../xenstoredglue/plugin_interface_v1.mli     |  34 ++++
> >  12 files changed, 383 insertions(+), 2 deletions(-)
> >  create mode 100644 tools/ocaml/libs/xenstoredglue/META.in
> >  create mode 100644 tools/ocaml/libs/xenstoredglue/Makefile
> >  create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugi=
n_v1/META.in
> >  create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugi=
n_v1/Makefile
> >  create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugi=
n_v1/domain_getinfo_stubs_v1.c
> >  create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugi=
n_v1/domain_getinfo_v1.ml
> >  create mode 100644 tools/ocaml/libs/xenstoredglue/domain_getinfo_plugi=
n_v1/domain_getinfo_v1.mli
> >  create mode 100644 tools/ocaml/libs/xenstoredglue/plugin_interface_v1.=
ml
> >  create mode 100644 tools/ocaml/libs/xenstoredglue/plugin_interface_v1.=
mli
>
> Peeking at your specfile change for XenServer too, I see that the only
> new file packaged is:
>
> %{_libexecdir}/%{name}/bin/xenctrl_plugin/domain_getinfo_v1.cmxs
>
> So does this mean that the rest of xenstoredglue is just a build-time
> requirement for oxenstored?

The .mli file needs to be packaged too, it is oxenstored that
"exposes" the interface and the plugin that uses it to register
themselves.

For simplicity we can package the whole plugin_interface_v1* library
(technically the plugin_interface_v1.ml could live in oxenstored, but
it'd be more difficult to update that way).
domain_get_info_plugin_v1 doesn't need to be otherwise packaged,
except the plugin (so .cma and .cmxs, although we only support native
builds, not bytecode builds, so .cmxs suffices for most purposes).

The domain_get_info_plugin_v1 will link against the plugin_interface_v1.mli=
.

>
> If so, then surely we'll still need to package it in
> xen-ocaml-{libs,devel}, so an out-of-tree oxenstored can build?
>
>
> Who should own plugin ABIs?  Logically it ought to oxenstored, but the
> way this is structured, it's looks like its Xen which would end up
> owning it.

The OCaml plugin ABI is owned by the executable that loads the plugin.
The plugin then registers itself as an implementation for an interface
exposed by the hosting application.
Due to how static linking works the ABI will be owned by this glue
library, which will be part of Xen (and its interface cannot be
changed once released, any changes require a v2 of the interface),
then oxenstored gets linked with a particular version of the glue
library at build time, and it'll be compatible with those plugin
versions at runtime.

>
>
> Are we expecting to get one cmxs per $THING-$VERSION?

Yes

> xenctrl_plugin is
> a bit generic, and it probably ought to have xenstoredglue somewhere in
> the path.
>
> Talking of, can we call it xenstored-glue or perhaps just xsd-glue?  Or
> will Ocaml's sensitivity around names get in our way?

A '-' in the name is problematic, it can be part of an 'opam' package
name, but not an 'ocamlfind' package NAME.
There are libraries that have '-' in their name on opam, but they are
named with _ at build time, it gets confusing, best to avoid a '-' in
the name.
If you want it can be xenstored_glue.

>
> Are there any standards on Ocaml dynamic libraries, or are we playing in
> rare waters here?

Looking through Git the Dynlink module has existed since 1995.

The use of plugins is documented for Dune here
https://dune.readthedocs.io/en/stable/sites.html#plugins-and-dynamic-loadin=
g-of-packages

There are other packages that use plugins, for example:
* https://github.com/BinaryAnalysisPlatform/bap/blob/aa2165ef1fb8c458f7cad6=
050ba81aa38d2c9226/lib/bap_plugins/bap_plugins.ml#L89
and plugins here https://github.com/BinaryAnalysisPlatform/bap-plugins
* https://ocaml.org/p/satML-plugin/latest
* https://github.com/Frama-C/Frama-C-snapshot/blob/639a3647736bf8ac127d00eb=
e4c4c259f75f9b87/src/kernel_services/plugin_entry_points/dynamic.mli

(there are probably more, these are just what I could find with a quick sea=
rch)

>
>
> > diff --git a/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/do=
main_getinfo_stubs_v1.c b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plu=
gin_v1/domain_getinfo_stubs_v1.c
> > new file mode 100644
> > index 0000000000..a29ac7c877
> > --- /dev/null
> > +++ b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_ge=
tinfo_stubs_v1.c
> > @@ -0,0 +1,169 @@
> > +#define _XOPEN_SOURCE 600
>
> This is very unlikely to be relevant.  It probably wants dropping from
> elsewhere in Xen too.
>
> > +#include <stdlib.h>
> > +#include <errno.h>
> > +
> > +#define CAML_NAME_SPACE
> > +#include <caml/alloc.h>
> > +#include <caml/memory.h>
> > +#include <caml/signals.h>
> > +#include <caml/fail.h>
> > +#include <caml/callback.h>
> > +#include <caml/custom.h>
> > +
> > +#include <xen-tools/common-macros.h>
> > +
> > +#include <string.h>
>
> Given the other sorting, this wants to be up by stdlib.
>
> > +#define XC_WANT_COMPAT_MAP_FOREIGN_API
>
> This is definitely not needed by this stub.
>
> > +#include <xenctrl.h>
> > +
> > +#define ERR_MSG_LEN (XC_MAX_ERROR_MSG_LEN + 6)
> > +#define MAX_FUNC_LINE_LEN 64
> > +#define failwith_xc_v1(xch) xsglue_failwith_xc(xch, __FUNCTION__, __LI=
NE__)
> > +
> > +// This is a minimal stub to xenctrl for oxenstored's purposes
> > +// For the full xenctrl stubs, see tools/ocaml/libs/xc/xenctrl_stubs.c
>
> Xen style is to use /* */ uniformly.  (Xen really does predate C++
> comments being commonly supported in C compilers.)
>
> > +
> > +static inline xc_interface *xsglue_xch_of_val_v1(value v)
> > +{
> > +     xc_interface *xch =3D *(xc_interface **)Data_custom_val(v);
> > +
> > +     return xch;
> > +}
> > +
> > +static void xsglue_xenctrl_finalize(value v)
> > +{
> > +     xc_interface *xch =3D xsglue_xch_of_val_v1(v);
> > +
> > +     xc_interface_close(xch);
> > +}
> > +
> > +static struct custom_operations xsglue_xenctrl_ops =3D {
> > +     .identifier  =3D "xenctrl",
> > +     .finalize    =3D xsglue_xenctrl_finalize,
> > +     .compare     =3D custom_compare_default,     /* Can't compare    =
 */
> > +     .hash        =3D custom_hash_default,        /* Can't hash       =
 */
> > +     .serialize   =3D custom_serialize_default,   /* Can't serialize  =
 */
> > +     .deserialize =3D custom_deserialize_default, /* Can't deserialize=
 */
> > +     .compare_ext =3D custom_compare_ext_default, /* Can't compare    =
 */
> > +};
> > +
> > +static void Noreturn xsglue_failwith_xc(xc_interface *xch,
> > +             char const* func,
> > +             int line)
>
> const char *func, unsigned int line)
>
> Unless you think there's a likelyhood that we'll get errors from a
> negative line number.

I think this function got copied from the one in xenctrl.

>
> > +{
> > +     char error_str[ERR_MSG_LEN + MAX_FUNC_LINE_LEN];
> > +     size_t str_len =3D 0;
> > +     if (xch) {
> > +             const xc_error *error =3D xc_get_last_error(xch);
> > +             if (error->code =3D=3D XC_ERROR_NONE)
> > +                     str_len =3D snprintf(error_str, ERR_MSG_LEN,
> > +                                        "%d: %s", errno, strerror(errn=
o));
> > +             else
> > +                     str_len =3D snprintf(error_str, ERR_MSG_LEN,
> > +                                        "%d: %s: %s", error->code,
> > +                                        xc_error_code_to_desc(error->c=
ode),
> > +                                        error->message);
> > +     } else {
> > +             str_len =3D snprintf(error_str, ERR_MSG_LEN,
> > +                                "Unable to open XC interface");
> > +     }
> > +     str_len =3D str_len < ERR_MSG_LEN ? str_len : ERR_MSG_LEN;
> > +     // Log caller's source code function and line
> > +     snprintf(error_str+str_len, MAX_FUNC_LINE_LEN,
> > +                 " - called from %s:%d", func, line);
> > +     caml_raise_with_string(*caml_named_value("xsg.error"), error_str)=
;
>
> There's a lot of complexity here, not least because of trying to handle
> the !xch special case.
>
> But, to begin with, what is xsg.error?  I see there's a registration of
> something by that name.  Is the Error referenced there the `exception
> Error of string` from the module?
>
> If so, what happens if we get a v2 module?  Won't we get a clash on the
> name of this exception?

The V2 module will have to declare a v2 of the exception.

>
>
> For the string handling, life is too short for fixed bounds like this.
> I'd recommend something more of the form:
>
> ...
>         const xc_error *error =3D xch ? xc_get_last_error(xch) : NULL;
>         char *str =3D NULL;
>         CAMLlocal1(msg);
>
> #define ERR (error && error->code !=3D XC_ERROR_NONE)
>
>         asprintf(&str,
>                  "%d: %s%s%s - called from %s:%u"
>                  ERR ? error->code : errno,
>                  ERR ? xc_error_code_to_desc(error->code) : strerror(errn=
o),
>                  ERR ? ": " : "",
>                  ERR ? error->message : "",
>                  func, line);
>
> #endif
>
>         if (!*str)
>                 caml_raise_out_of_memory();
>
>         msg =3D caml_copy_string(str);
>         free(str);
>
>         caml_raise_with_arg(*caml_named_value("xsg.error"), msg);
> }
>
> This has the property that even in the !xsh special case, it still
> renders errno which might be helpful when debugging.
>
> > +}
> > +
> > +CAMLprim value stub_xsglue_xc_interface_open(value unit)
> > +{
> > +     CAMLparam1(unit);
> > +     CAMLlocal1(result);
> > +     xc_interface *xch;
> > +
> > +     result =3D caml_alloc_custom(&xsglue_xenctrl_ops, sizeof(xch), 0,=
 1);
> > +
> > +     caml_enter_blocking_section();
> > +     xch =3D xc_interface_open(NULL, NULL, 0);
> > +     caml_leave_blocking_section();
> > +
> > +     if ( !xch )
>
> This wants to be `if (!xch)` to match the rest of the file style.
>
> > +             failwith_xc_v1(xch);
> > +
> > +     *(xc_interface **)Data_custom_val(result) =3D xch;
> > +
> > +     CAMLreturn(result);
> > +}
> > +
> > +static value xsglue_alloc_domaininfo_v1(xc_domaininfo_t * info)
>
> xc_domaininfo_t *info
>
> And probably a const for good measure.
>
> > +{
> > +     CAMLparam0();
> > +     CAMLlocal1(result);
> > +     result =3D caml_alloc_tuple(4);
> > +
> > +     Store_field(result,  0, Val_int(info->domain));
> > +     Store_field(result,  1, Val_bool(info->flags & XEN_DOMINF_dying))=
;
> > +     Store_field(result,  2, Val_bool(info->flags & XEN_DOMINF_shutdow=
n));
> > +     Store_field(result,  3, Val_int(MASK_EXTR(info->flags, XEN_DOMINF=
_shutdownmask)));
> > +
> > +     CAMLreturn(result);
> > +}
> > +
> > +CAMLprim value stub_xsglue_xc_domain_getinfo(value xch_val, value domi=
d)
> > +{
> > +     CAMLparam2(xch_val, domid);
> > +     CAMLlocal1(result);
> > +     xc_interface *xch =3D xsglue_xch_of_val_v1(xch_val);
> > +     xc_domaininfo_t info;
> > +     int ret;
> > +
> > +     ret =3D xc_domain_getinfo_single(xch, Int_val(domid), &info);
> > +     if (ret < 0)
> > +             failwith_xc_v1(xch);
> > +
> > +     result =3D xsglue_alloc_domaininfo_v1(&info);
> > +
> > +     CAMLreturn(result);
> > +}
> > +
> > +CAMLprim value stub_xsglue_xc_domain_getinfolist(value xch_val, value =
first_domain, value nb)
> > +{
> > +     CAMLparam3(xch_val, first_domain, nb);
> > +     CAMLlocal2(result, temp);
> > +     xc_interface *xch =3D xsglue_xch_of_val_v1(xch_val);
> > +     xc_domaininfo_t * info;
> > +     int i, ret, toalloc, retval;
> > +     unsigned int c_max_domains;
> > +     uint32_t c_first_domain;
> > +
> > +     /* get the minimum number of allocate byte we need and bump it up=
 to page boundary */
> > +     toalloc =3D (sizeof(xc_domaininfo_t) * Int_val(nb)) | 0xfff;
> > +     ret =3D posix_memalign((void **) ((void *) &info), 4096, toalloc)=
;
> > +     if (ret)
> > +             caml_raise_out_of_memory();
> > +
> > +     result =3D temp =3D Val_emptylist;
> > +
> > +     c_first_domain =3D Int_val(first_domain);
> > +     c_max_domains =3D Int_val(nb);
> > +     caml_enter_blocking_section();
> > +     retval =3D xc_domain_getinfolist(xch, c_first_domain,
> > +                                    c_max_domains, info);
> > +     caml_leave_blocking_section();
> > +
> > +     if (retval < 0) {
> > +             free(info);
> > +             failwith_xc_v1(xch);
> > +     }
> > +     for (i =3D 0; i < retval; i++) {
> > +             result =3D caml_alloc_small(2, Tag_cons);
> > +             Field(result, 0) =3D Val_int(0);
>
> The is Val_none, isn't it?

It is a temporary value that will be overwritten later (to stop the GC
from crashing should it run inbetween and see a dangling pointer).
It needs to be an integer, not a pointer so the GC doesn't go on
chasing something else. 'Val_int' retains that intention more clearly,
although Val_none is equivalent (but is not used with that meaning
here, because the first element is NOT the list element,
and it'd be confusing if it was, it is the actual record, we just
temporarily store the wrong type there, but a valid OCaml value).

>
> I've got a patch I should dust off to provide some C stub compatibility
> for Ocaml < 4.12, which at least introduces some of the more common namin=
g.
>
> > +             Field(result, 1) =3D temp;
> > +             temp =3D result;
> > +
> > +             Store_field(result, 0, xsglue_alloc_domaininfo_v1(info + =
i));
> > +     }
> > +
> > +     free(info);
> > +     CAMLreturn(result);
> > +}
> > diff --git a/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/do=
main_getinfo_v1.ml b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v=
1/domain_getinfo_v1.ml
> > new file mode 100644
> > index 0000000000..d8947b618f
> > --- /dev/null
> > +++ b/tools/ocaml/libs/xenstoredglue/domain_getinfo_plugin_v1/domain_ge=
tinfo_v1.ml
> > @@ -0,0 +1,51 @@
> > +(** Minimal interface on top of unstable Xenctrl for Oxenstored's usag=
e *)
> > +
> > +(** For the full Xenctrl interface, see: tools/ocaml/libs/xc/ *)
> > +
> > +module M : Plugin_interface_v1.Domain_getinfo_V1 =3D struct
> > +  exception Error of string
> > +
> > +  type domid =3D int
> > +  type handle
> > +
> > +  type domaininfo =3D {
> > +    domid : domid;
> > +    dying : bool;
> > +    shutdown : bool;
> > +    shutdown_code : int;
>
> I see Xenctrl uses this as an int too, but do we want to consider
>
> type shutdown_code =3D
>   | SHUTDOWN_poweroff
>   | SHUTDOWN_reboot
>   | SHUTDOWN_suspend
>   | SHUTDOWN_crash
>   | SHUTDOWN_watchdog
>   | SHUTDOWN_soft_reset
>
> One awkward thing is that the shutdown_code isn't valid unless the
> shutdown bool is true, but we could fix this by having:


>
> type domaininfo =3D {
>   domid : domind;
>   shutdown : Some shutdown_code;
> }
>
> One downside is that we'd have to bump the interface version when adding
> new constants, and we'd have to be very careful not to generate a bad
> SHUTDOWN_* constant as far as Ocaml is concerned.

To be compatible we'd also need a 'SHUTDOWN_unknown of int' at the end
to stop us from having to raise an exception.
This is how 'errno' is handled in Unix (it has a fairly large list of
errors, but of course a system could always define a new one, so it
has a fallback to 'unknown').
The application can then decide how it wants to handle the unknown, if
it wants to know more it can upgrade to a V2, if it doesn't care it
can stay on V1.

All that oxenstored does with the shutdown code is log it (so if we
add the enum we also need to add a way to stringify it), it doesn't
care about the actual value.
I'd keep it as an int for simplicity, we want to minimize dependencies
on ABIs, unless we actually want to use it.

>
> I'm on the fence, but it's something to consider before we set the ABI
> in stone.
>
> > +  }
> > +
> > +  external interface_open : unit -> handle =3D "stub_xsglue_xc_interfa=
ce_open"
> > +
> > +  external domain_getinfo : handle -> domid -> domaininfo
> > +    =3D "stub_xsglue_xc_domain_getinfo"
> > +
> > +  external __domain_getinfolist : handle -> domid -> int -> domaininfo=
 list
> > +    =3D "stub_xsglue_xc_domain_getinfolist"
> > +
> > +  let domain_getinfolist handle first_domain =3D
> > +    (* [rev_concat lst] is equivalent to [lst |> List.concat |> List.r=
ev]
> > +     * except it is tail recursive, whereas [List.concat] isn't.
> > +     * Example:
> > +     * rev_concat [[10;9;8];[7;6];[5]]] =3D [5; 6; 7; 8; 9; 10]
> > +     *)
> > +    let rev_append_fold acc e =3D List.rev_append e acc in
> > +    let rev_concat lst =3D List.fold_left rev_append_fold [] lst in
> > +
> > +    let nb =3D 1024 in
> > +    let rec __getlist lst from =3D
> > +      (* _domain_getinfolist returns domains in reverse order, largest=
 first *)
> > +      match __domain_getinfolist handle from nb with
> > +      | [] -> rev_concat lst
> > +      | hd :: _ as l -> __getlist (l :: lst) (hd.domid + 1)
> > +    in
> > +    __getlist [] first_domain
>
> This (and the C) was a hack to avoid being too invasive at the time
> (iirc, it was a Xenctrl interface used by Xenopsd and we didn't want to
> change the API), but it's racy when there are more than @nb domains runni=
ng.
>
> The problem is that in between the multiple hypercalls, you've dropped
> Xen's domlist lock, and e.g. a new domain with a lower domid could have
> come into existence.  This doesn't matter for most things, but
> Oxenstored is the authoritative source of which domains are alive or
> not, and it does need to be accurate.
>
> Oxenstored really does need to make a single hypercall asking for all
> 32k domains in order to get a coherent view.  This is how Cxenstored work=
s.
>
> However, we can do this from within C and also not double-process the
> resulting list.
>
> On that subject, is list the right thing here, or would an array be
> better?  One has less in the way of pointer chasing than the other,
> although whether it makes any appreciable difference is a different
> question.

Array might be slightly better, but is also mutable, a list is immutable.
This gets called fairly often though, not sure that copying the state
of 32k domains on the C side when you only have 1 or 2 domains running
would be worth it.
Wouldn't we be better off querying the domains we know about one at a
time in that case?
Querying all 32k is probably only worth it when you run a large number
of domains, and a performance hit for every normal user, but I haven't
measured where the cutoff point would be.
If it matters the application can make that decision based on the
number of domains it is monitoring (for a small number of domains
query individually, for large numbers query everything, even
non-existent domains).

>
> > +
> > +  let _ =3D Callback.register_exception "xsg.error" (Error "register_c=
allback")
> > +end
> > +
> > +let () =3D
> > +  Printf.printf "Registration of %s plugin started\n%!" __MODULE__;
> > +  Plugin_interface_v1.register_plugin_v1
> > +    (module M : Plugin_interface_v1.Domain_getinfo_V1);
> > +  Printf.printf "Registration of %s plugin successful\n%!" __MODULE__
>
> Its rude for libraries to make assumptions about stdout.  Indeed,
> oxenstored uses syslog() rather than stdout.
>
> If this can't be hooked into Oxenstored's logging infrastructure, then
> the printf() want gating on some kind of debug setting, most likely an
> environment variable.

I think we didn't use syslog to avoid introducing more dependencies
(in particular oxenstored will very likely change its logging
infrastructure in the future to something more standard in the OCaml
ecosystem instead of a hand rolled one, and we don't want to update
the plugin interface every time we do that).

However the plugin interface itself could expose a logging function.
Oxenstored can then implement it as it pleases, but that requires
rearranging the code a bit, in particular plugin_interface_v1.ml would
have to live in oxenstored, not in the glue (and just the mli to stay
in the glue).
For simplicity we could have a global logger in plugin_interface_v1 as
a ref set to ignore initially, that oxenstored could set on startup
(before it loads any plugins), that would retain most flexibility I
think. Then we could use the 'kprintf' variant that calls a '(string
-> unit)' function and that '(string -> unit)' would be configurable.

>
> ~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 09:44:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 09:44:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783721.1192976 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siskd-0003p6-KB; Tue, 27 Aug 2024 09:44:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783721.1192976; Tue, 27 Aug 2024 09:44:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siskd-0003oz-HA; Tue, 27 Aug 2024 09:44:35 +0000
Received: by outflank-mailman (input) for mailman id 783721;
 Tue, 27 Aug 2024 09:44:34 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1siskc-0003ot-JD
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 09:44:34 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f5911a10-6458-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 11:44:31 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-53438aa64a4so5027957e87.3
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 02:44:31 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e5954a88sm87111266b.224.2024.08.27.02.44.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 02:44:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f5911a10-6458-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724751871; x=1725356671; 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=zh5ymfJZvRoHPKtzmpSPVNFkDrKRHLBw3K+sCLDoDIA=;
        b=WY6/P+GSxEuxe+ll+CTyEi5RC7s8wJ5kcazYfFQwiwvGXQ+vjbNMc9dcCgccHJrvSQ
         gJJuqvEGE2XpPYcnarG+QXaspywDZA/qTR4d2s08CO21SrP0vn9DNM1j+sIa22z5pLfz
         ctmL1ZrBsvLOO4yGt8h1MbgtxiBNzsZLUt5bQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724751871; x=1725356671;
        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=zh5ymfJZvRoHPKtzmpSPVNFkDrKRHLBw3K+sCLDoDIA=;
        b=Gx5n7lAHWHHkIyNSUsNNp2gFTxzT6TuavtEqzQPZHjnVHfkrWpxCF+dNbuxII4b5RT
         Gmxtx73R0pQ/e4uzJCNiu/Bwwuhan0lGxt4HUNSWTYkfcRDMMNANMgAVOwjCqc4tQFKp
         XBba0pvR+Zt5IyB5E6rZw1auQOcnWGQ7PxEBcvMSdkxErQ6L17IpdYVed8ll2nJNZkck
         IXCoTLPrtCKOlJSCc2sIz7rfB30pj4bhwXiGv2UDbVaB4sGNbZl1Botcm8QlS5jVrt+L
         Rsc4qqx8yP43719RBAWLTMayxZwWxduugoZ25z/u/8JRjypw33rsJK5QyFJ0hQ3UB7Gx
         nYXQ==
X-Forwarded-Encrypted: i=1; AJvYcCWoZ6XMMgcH6B6lfC71Q2f9bhqqYW33+v3HHCtMeYoKYkcOYILWQUb9uN28pQs8y0PLMPdoK6byatw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwYf/jyHONQcv30Elc0Ea5mi4QvsSjbLp8iDOrdPnfDi/71+RUx
	z+fd8yHz7lPkG98xqFoa2QC9FPdXtTQVCPFDZsw5fE60wy41flug1GIwBR/6I4s=
X-Google-Smtp-Source: AGHT+IE/NUteti7tNO3el2rNoTC9Ob5wIshjXeSf9v/igcWvENEnSnb1NnsLrWp/hPLaHiXXhZW7iQ==
X-Received: by 2002:a05:6512:281a:b0:52e:f77b:bb58 with SMTP id 2adb3069b0e04-5343883abeamr8955234e87.36.1724751870256;
        Tue, 27 Aug 2024 02:44:30 -0700 (PDT)
Message-ID: <e8135599-d86e-484f-8a56-e478f63c5b9e@citrix.com>
Date: Tue, 27 Aug 2024 10:44:27 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/9] xen/bitops: Convert 'hweight(x) > 1' to new
 multiple_bits_set()
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-4-andrew.cooper3@citrix.com>
 <756c6b06-50a7-4201-9682-ff4a3eaafc30@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <756c6b06-50a7-4201-9682-ff4a3eaafc30@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 26/08/2024 11:37 am, Jan Beulich wrote:
> On 23.08.2024 01:06, Andrew Cooper wrote:
>> Using hweight() is an especially expensive way of determining simply if
>> multiple bits are set in a value.  Worse, 4 of the 10 hweight() calls in Xen
>> are of this form.
>>
>> Switch to the new multiple_bits_set() helper.  This is far more efficient than
>> the longhand hweight() algorithm and, owing to its simplicity, likely more
>> efficient than even a dedicated instruction on a superscalar processor.
>>
>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Thanks.

>
> Just to mention it: With the title being sufficiently generic, I half
> expected the similar {bitmap,cpumask}_weight() to also be taken care of.
> Yet certainly those (and maybe also their ... == 1 forms) can be covered
> later.

They are on my radar, but are not as easy to transform.

We'd need a new bitmap API to optimise this case; looking at the
callers, it is definitely worth optimising.  There are also an awful lot
of cpumask_weight() == 1 which want converting, albeit slightly differently.

That's a full series of work in and of itself.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 09:47:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 09:47:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783728.1192986 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sismx-00051S-1K; Tue, 27 Aug 2024 09:46:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783728.1192986; Tue, 27 Aug 2024 09:46:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sismw-00051L-U7; Tue, 27 Aug 2024 09:46:58 +0000
Received: by outflank-mailman (input) for mailman id 783728;
 Tue, 27 Aug 2024 09:46: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=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sismv-000519-HK
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 09:46:57 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4bd648d8-6459-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 11:46:56 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a869332c2c2so790068266b.0
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 02:46:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e591c02dsm87008966b.190.2024.08.27.02.46.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 02:46:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4bd648d8-6459-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724752015; x=1725356815; 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=eIoIoHLa2JQdDhqAZqitQCP9+IuDlVnN+vIvehtqhc8=;
        b=PZV0c+w/wdjX+0KkF/dFO+fR6L/laPlCoBYENwA9X7gsV5Yy5n6HfalJ5Uh8P/9FL2
         1yEhcVTsxfee7lP1CAqQhPXNMJM1rQLuePfAfnQhC61qg/SftnsI6Do+iH0blN6BO3rI
         hNW3eyGL28W2dNCarXkG/0MYDCVJvDAVbesBRpsYCP88MewkH2Z7h+Yn1dRboQ5+1Ow2
         j4pK74gCpn4IBDGb39kVkADNxdDzZK6OUE9EEtN/EeLH3PaL7Pa6dSdlgYZYuL9YQ7VE
         Fzd+lWrgu77GHx13mKuudfUt8VbDxwwk2emJ3F4JZVnTQHsWVI9GjauZCEmTNB6OygTg
         I/JA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724752015; x=1725356815;
        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=eIoIoHLa2JQdDhqAZqitQCP9+IuDlVnN+vIvehtqhc8=;
        b=wluveBH3m3bScTofwIznno596gpjSvMEJPhmwz+Ab8HR9ZPCTtrO7CVMdalXLRypH6
         WjOzyvOghfXutLli1M/sVgTaVZ+MVDON/3L+ignHq+zMnRVJuRghJymYtZhWEJSSZqmE
         CYUwQpKi9t9PZdBGwF/kKidKLPZmueo6nd08qc4xC7FQTl6gmTC0j8yvEg3Q5naxxcI9
         YVnDPKTvl+tS08HRBdBK68Mv+aCHOg0QrI8cwITGSOqm0LAgvMK6o2RH+6Sz0g49aJvi
         HpkHKx3wrLv1ejzEZhpf6ye/t2RvcB/o0Q/eT+g0yJy7iHfzvvNDHBYOi93+hMZ7hJaY
         2knw==
X-Forwarded-Encrypted: i=1; AJvYcCViKrWa7gGqH3eX5L/PYHbYlvTt2e8T12lFRTkwY/ZfVkW06NRZHV+ROG+68JbPg3LfiXtAunoQHWY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyY/DYk6PlgQR+Q5qrweLnJIWpXK09oKG4bBLY9rir/oh1jIHjy
	8vTvSYpMzGYuMWW7xP4ncYgCrb63hgAYwUkGw1x3SKaDWeeATvXE4fbvMW+rXw==
X-Google-Smtp-Source: AGHT+IG6AxG7GvirtspYc0z6mWtbsSTyxK3cog09fuVGUxVsaC0Z/oQu/m891jmI68+/ZQxCAm9Cjw==
X-Received: by 2002:a17:907:94d0:b0:a6e:f869:d718 with SMTP id a640c23a62f3a-a86e29be930mr238103366b.21.1724752015362;
        Tue, 27 Aug 2024 02:46:55 -0700 (PDT)
Message-ID: <9c0f6be6-2685-43b8-89ef-b5be3100cf62@suse.com>
Date: Tue, 27 Aug 2024 11:46:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/efi: Use generic PE/COFF structures in x86 efi source
To: rtrk <milandjokic1995@gmail.com>
Cc: oleksii.kurochko@gmail.com, Nikola Jelic <nikola.jelic@rt-rk.com>,
 "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Milan Djokic <milan.djokic@rt-rk.com>,
 xen-devel@lists.xenproject.org
References: <6cf2799ced7dcee515ad8a6b6657522cdc7cec61.1724699546.git.milan.djokic@verisure.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: <6cf2799ced7dcee515ad8a6b6657522cdc7cec61.1724699546.git.milan.djokic@verisure.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 26.08.2024 21:44, rtrk wrote:
> @@ -105,33 +55,29 @@ static bool __init pe_name_compare(const struct PeSectionHeader *sect,
>  const void *__init pe_find_section(const void *image, const UINTN image_size,
>                                     const CHAR16 *section_name, UINTN *size_out)
>  {
> -    const struct DosFileHeader *dos = image;
> -    const struct PeHeader *pe;
> -    const struct PeSectionHeader *sect;
> +    const struct mz_hdr *mz = image;
> +    const struct pe_hdr *pe;
> +    const struct section_header *sect;
>      UINTN offset, i;
>  
> -    if ( image_size < sizeof(*dos) ||
> -         dos->Magic[0] != 'M' ||
> -         dos->Magic[1] != 'Z' )
> +    if ( image_size < sizeof(*mz) ||
> +         mz->magic != 0x4D5A ) /* 0x4D5A is the hexadecimal value for "MZ" */

I think this is byte-order-reversed. The question is anyway why you don't
use MZ_MAGIC here.

>          return NULL;
>  
> -    offset = dos->ExeHeader;
> +    offset = mz->peaddr;
>      pe = image + offset;
>  
>      offset += sizeof(*pe);
>      if ( image_size < offset ||
> -         pe->Magic[0] != 'P' ||
> -         pe->Magic[1] != 'E' ||
> -         pe->Magic[2] != '\0' ||
> -         pe->Magic[3] != '\0' )
> +         pe->magic != 0x50450000 ) /* 0x50450000 is the hexadecimal value for "PE\0\0" */

Same here, with PE_MAGIC wanting using.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 09:49:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 09:49:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783733.1192996 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sispG-0005bi-CE; Tue, 27 Aug 2024 09:49:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783733.1192996; Tue, 27 Aug 2024 09:49:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sispG-0005bb-92; Tue, 27 Aug 2024 09:49:22 +0000
Received: by outflank-mailman (input) for mailman id 783733;
 Tue, 27 Aug 2024 09:49:20 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sispE-0005bV-NB
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 09:49:20 +0000
Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com
 [2a00:1450:4864:20::634])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a0f86c04-6459-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 11:49:18 +0200 (CEST)
Received: by mail-ej1-x634.google.com with SMTP id
 a640c23a62f3a-a7a81bd549eso404608366b.3
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 02:49:18 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e588b034sm87455766b.185.2024.08.27.02.49.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 02:49:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a0f86c04-6459-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724752158; x=1725356958; 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=4+LmU+bVqYIzL/Azy4y6saZXmhR1CDzvOc+8da1W2a4=;
        b=mFOrSHsnxW6KuSdhzj2pUsL9wLdr8Tap6Wh3FgspzruF9H6HhJoEWYQhW8NyB+HKZi
         N2Tj6sGa8ad7TGJgziYk2UwtfwEXbNsz26XCND9jBuukLYOilFkiOuk0GihawD/YITQG
         fnXng1QtTs7uCGMxwAkbN1be50KHz2UQZGIDg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724752158; x=1725356958;
        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=4+LmU+bVqYIzL/Azy4y6saZXmhR1CDzvOc+8da1W2a4=;
        b=oFW9M+jBNHllIpnat12zIxyA2M26hkMaengy/wO09UNKMkeVDn5ttH+mZVs0RsDDYh
         8gqP0Diz2W8wihGh4OgN0DX8TJTNpVNL9C+etDfqkWnhZfsInMzIVHUalYYkkjzh4TVy
         E5WeaDoFq6LZHTRx59t2hevdPcN29xIOp9m9zVb4YBiwpSGET9oDNP5I+JrAb3315g27
         1MC/3rgIM9H1l7ZOqrny5GrIDO/trYnLhH0xWrnEMn/K2dH/GGofykJ+mix5OreECAJc
         O8DqK0xy48dcZCgDT3HvJgjIWxfDqkDf9KcbEkk3aeZD+BgXv13jSXRzadqgSJ3Tt57w
         jBVg==
X-Forwarded-Encrypted: i=1; AJvYcCVUFJ0+q8Iw/Ng48IToDByqRgY7NMndM+LBSxvY/03ixfBaUMWdJ57h2556eAx3WUX5YrO+Q/X74FE=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw8T7XORFE1qxoqeMocqOqR+y3HZqX0FmvoOF3l9Loyp0gVKzMY
	1URta/prrBuhBDgXrfVabw9EO5GBirPZhXHmk5DS9J7hOaYfXFAXCzaHbRRkqDM=
X-Google-Smtp-Source: AGHT+IEOzG4oEpjy0+N8kDsMytWwqSxxnwBibIREY3eNIQlED+nPVeayVFo2My/J4trzk3f97qx8CQ==
X-Received: by 2002:a17:906:dac8:b0:a86:73cb:35a3 with SMTP id a640c23a62f3a-a86a54b65ccmr1183455866b.64.1724752157961;
        Tue, 27 Aug 2024 02:49:17 -0700 (PDT)
Message-ID: <f0a5525f-cfb8-4669-a0b7-3da4fdd9eaaf@citrix.com>
Date: Tue, 27 Aug 2024 10:49:15 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/9] xen/bitops: Drop the remnants of hweight{8,16}()
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-5-andrew.cooper3@citrix.com>
 <8c6599fa-22c0-455e-9d6a-51b3bf3d24b3@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <8c6599fa-22c0-455e-9d6a-51b3bf3d24b3@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 26/08/2024 11:39 am, Jan Beulich wrote:
> On 23.08.2024 01:06, Andrew Cooper wrote:
>> They are no more, and won't be returning in this form.
> And what's the plan? Use hweight32((uint8_t)...) in an open-coded manner?
> Not overly nice I would say.

If we ever regain a genuine need for the 8 or 16 forms, they can go back
into bitops.h, in terms of hweightl(), just like hweight32().

But it's been 20 years so far and we haven't actually needed
hweight8/16, and I'm expecting this to continue for the forseeable future.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 09:57:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 09:57:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783739.1193006 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sisx5-0007uv-43; Tue, 27 Aug 2024 09:57:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783739.1193006; Tue, 27 Aug 2024 09:57:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sisx5-0007uo-0Y; Tue, 27 Aug 2024 09:57:27 +0000
Received: by outflank-mailman (input) for mailman id 783739;
 Tue, 27 Aug 2024 09:57:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=jZjl=P2=cloud.com=andrii.sultanov@srs-se1.protection.inumbo.net>)
 id 1sisx3-0007ui-F8
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 09:57:25 +0000
Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com
 [2a00:1450:4864:20::22b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c28b9080-645a-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 11:57:24 +0200 (CEST)
Received: by mail-lj1-x22b.google.com with SMTP id
 38308e7fff4ca-2f4f505118fso43277771fa.3
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 02:57:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c28b9080-645a-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724752644; x=1725357444; 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=y74mDAAvmzgFRz+jUBoXAQGFr/r5n1KrbangKEg1qgM=;
        b=JKjMUFT0ncdLFk7lRRbMJr6NJ1WwOaD4HfaEyF5TW0s5QPVrGoNf6sGIlf90NW8zpq
         4RwvE+5mjVh9QSwOfoLngWvutcF+EMO8IAuu6NA/Dht2bYgbWRuw7zGQOB6q0LgUVE6s
         12hW+eoDfKkUIh5X14p22+clpSNmyjO+zsJJA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724752644; x=1725357444;
        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=y74mDAAvmzgFRz+jUBoXAQGFr/r5n1KrbangKEg1qgM=;
        b=Rvxxl5LahVNtVum5IQ2ExD5HlowTASmgjBcR69ZJyBkNVZ9NsL8PswR1ykyrqY3l/P
         fcTaanM/Py5WCudXEWzvWZuKhfE6hEapxzUDlmMdRG41gMte34TV8EuntDn+iJmGRf65
         YQT6q+bJ0QE9VFoYfAtv/+19VnIfpeEeD4WFwEfg8sPjn+gxPHXwJoI3g2qKRBGFg6rH
         Xco8e8EqHrv2Z4nTva3mYqzsGxRWmeJtJT5/qO7dkBWpsANRxwqcrkCxTmQRDgBDOKQ5
         1/uSGtYhfJVX4M2raV10B5BeGwzcveytg+4ERd6O6B21sjrwBFAj1xUvpfj+ZiqCdxRq
         pQ+w==
X-Gm-Message-State: AOJu0YzfG9uU8NsDY5fBTi2l20Ygl/+oObDwYxBv1zejyuOwyPikidFQ
	t89Wg3uvvGwEQABDZkQw8GSQ2f/uvGA+q65CcAoonzdBq77kRpmZQN598axrdR4MbprKEc24h8r
	kILvQL8PtR+CL61nDH5+80tsOHnnb6Qq+6IYOGQ==
X-Google-Smtp-Source: AGHT+IGFWxjQkBRz7IxrDZpnVVz2MT1txRsJM3zNHflhGVnqovLvAGteZ6c5BloRTpUm4060ThSbAiXosyNa2PYeilg=
X-Received: by 2002:a05:651c:54a:b0:2ef:290e:4a39 with SMTP id
 38308e7fff4ca-2f4f4927e50mr102364371fa.35.1724752643749; Tue, 27 Aug 2024
 02:57:23 -0700 (PDT)
MIME-Version: 1.0
References: <cover.1724314239.git.andrii.sultanov@cloud.com>
 <6d4b94939c8910ffd7d70301b1d26c828f72ad86.1724314239.git.andrii.sultanov@cloud.com>
 <Zscl2DITQS9T6Sg9@l14>
In-Reply-To: <Zscl2DITQS9T6Sg9@l14>
From: Andrii Sultanov <andrii.sultanov@cloud.com>
Date: Tue, 27 Aug 2024 10:57:12 +0100
Message-ID: <CAAa3AOMv64=Gunzbi32oNCpswU5Hw+6bfRfO9PqOi3KQ7zcLjA@mail.gmail.com>
Subject: Re: [PATCH v1 2/4] ocaml/libs: Implement a dynamically-loaded plugin
 for Xenctrl.domain_getinfo
To: Anthony PERARD <anthony.perard@vates.tech>
Cc: xen-devel@lists.xenproject.org, 
	Christian Lindig <christian.lindig@citrix.com>, David Scott <dave@recoil.org>
Content-Type: multipart/alternative; boundary="000000000000a813740620a744d3"

--000000000000a813740620a744d3
Content-Type: text/plain; charset="UTF-8"

> It seems that location for ocaml libs is in $(OCAMLDESTDIR), any reason
> to deviate from that?

OCAMLDESTDIR is only defined in tools/ocaml/common.make, and is unavailable
at the top-level directories level of the autoconf infrastructure (which
generates the
paths.ml file), as far as I understand.

> Is there any reason to put that new library in "/usr/libexec"?
> It doesn't seems like a good place for it, and using "/usr/lib" instead
> seems better.

I find that the general idea of libexec - that only a particular program
(oxenstored)
relies on this and others should not - fitting for this use case. It will
additionally
distinguish between the plugin itself and the packaged plugin interface
(that will go
into OCAMLDESTDIR, as suggested elsewhere in the review comments)

> libexec is mostly for binary, according to
>    https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html

Even though the .cmxs is a shared object, it will run some of its own code
to "link"
itself to the global ref defined in the plugin interface, even without
anyone calling
into the library, sort of behaving like a binary.

--000000000000a813740620a744d3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">&gt;=20
It seems that location for ocaml libs is in $(OCAMLDESTDIR), any reason<br>=
&gt; to deviate from that?

</div><div dir=3D"ltr"><br></div><div>OCAMLDESTDIR is only defined in tools=
/ocaml/common.make, and is unavailable</div><div>at the top-level directori=
es level of the autoconf infrastructure (which generates the</div><div><a h=
ref=3D"http://paths.ml">paths.ml</a> file), as far as I understand.<br></di=
v><div><br></div><div>&gt;=20
Is there any reason to put that new library in &quot;/usr/libexec&quot;?<br=
>
&gt; It doesn&#39;t seems like a good place for it, and using &quot;/usr/li=
b&quot; instead<br>
&gt; seems better.<br>

</div><div dir=3D"ltr"><br></div><div>I find that the general idea of libex=
ec - that only a particular program (oxenstored)</div><div>relies on this a=
nd others should not - fitting for this use case. It will additionally</div=
><div>distinguish between the plugin itself and the packaged plugin interfa=
ce (that will go</div><div>into OCAMLDESTDIR, as suggested elsewhere in the=
 review comments)<br></div><div><br></div><div>
&gt; libexec is mostly for binary, according to<br>&gt;=C2=A0 =C2=A0 <a hre=
f=3D"https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s07.html" rel=3D"=
noreferrer" target=3D"_blank">https://refspecs.linuxfoundation.org/FHS_3.0/=
fhs/ch04s07.html</a>

</div><div><br></div><div>Even though the .cmxs is a shared object, it will=
 run some of its own code to &quot;link&quot;=C2=A0</div><div>itself to the=
 global ref defined in the plugin interface, even without anyone calling</d=
iv><div>into the library, sort of behaving like a binary.<br></div></div>

--000000000000a813740620a744d3--


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 10:03:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 10:03:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783748.1193029 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sit32-0001EO-Dl; Tue, 27 Aug 2024 10:03:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783748.1193029; Tue, 27 Aug 2024 10:03:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sit32-0001An-5P; Tue, 27 Aug 2024 10:03:36 +0000
Received: by outflank-mailman (input) for mailman id 783748;
 Tue, 27 Aug 2024 10:03: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=KoKo=P2=bounce.vates.tech=bounce-md_30504962.66cda473.v1-7a4fed8f626b46239c7b9e69b01f9ae2@srs-se1.protection.inumbo.net>)
 id 1sit31-00015q-61
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 10:03:35 +0000
Received: from mail137-25.atl71.mandrillapp.com
 (mail137-25.atl71.mandrillapp.com [198.2.137.25])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9e1e1761-645b-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 12:03:33 +0200 (CEST)
Received: from pmta07.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail137-25.atl71.mandrillapp.com (Mailchimp) with ESMTP id
 4WtNR76f1nz35hVnw
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 10:03:31 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 7a4fed8f626b46239c7b9e69b01f9ae2; Tue, 27 Aug 2024 10:03:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9e1e1761-645b-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724753011; x=1725013511;
	bh=7a7nuSCUMb6yGcZ2VY1VCSVSooNS7myyKwj7gupd9Sg=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=BGl8ryRR8i+E7ZDBck6IQcBpLcF7nJhe9aNl7Atc7IPLP5tJve2KWslIHkZhrNSpt
	 FBqu3KVR+wKIk1YoqQof2d2XmmgNGag2tzWa9KxmYZfJN4K5sAddc4X2GTya+C0z+n
	 5u3O2EiihYVjoqlImseIYDzlWIn1evXFJmQ2bmfs5Y+C6ogF4bNK3xmxOzA5eyhh/O
	 LF2vnRuXr/FsdjrMHiG2mUvDGFUnfOM0xv013wa/1UTuFlybQUcYsy8q5ncmpwKV3L
	 uDw3c6VMVFm58oSpcyqXQWougpegSvtCtOuvkJWbUTomErFlyF8doih1DqxlQbzpGc
	 BJRQncYbAJ7ow==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724753011; x=1725013511; i=anthony.perard@vates.tech;
	bh=7a7nuSCUMb6yGcZ2VY1VCSVSooNS7myyKwj7gupd9Sg=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=PxNbPq0ciuLpzcFi2jahKY47ZkV3O+eLoj7WjM0TS3f4tMY687kk7L2Je0U8907ZX
	 1Nwdo00OUAWYyovSKthcRagcR6oze3zcrUFMIIEdi0u+MtGnHvsilE5g7CeaFeGeeX
	 RdMn3N2ipWooszNxQkKFbGr1TdYkl+6f5Z44Dga64qfEC8ahJRh+d8HEpIfyuu6HbA
	 8UrktSRjdT6e2vJzOgffTJZ0BSlPyZrSQ+P8Af8OF/aLEoVq5MzCo0aDPclGRGelDm
	 hvzEMQJVFIZXTQs+WLfgpNzlm1c6wEmIfW+tN1B9SYbPrhiPzf1t5EZ1tQaLW55lbt
	 loSlDQDBRChxg==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?[XEN=20PATCH=203/3]=20libxl:=20Probe=20QEMU=20for=20-run-with=20user=3Duser=20and=20use=20it?=
X-Mailer: git-send-email 2.39.2
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724753011426
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>, Juergen Gross <jgross@suse.com>
Message-Id: <20240827100328.23216-4-anthony.perard@vates.tech>
In-Reply-To: <20240827100328.23216-1-anthony.perard@vates.tech>
References: <20240827100328.23216-1-anthony.perard@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.7a4fed8f626b46239c7b9e69b01f9ae2?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240827:md
Date: Tue, 27 Aug 2024 10:03:31 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

"-runas" is deprecated since QEMU 9.1 and will be remove in a future
release.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_dm.c       | 12 ++++++++++--
 tools/libs/light/libxl_internal.h |  1 +
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index 298fbb84fe..49995b14b8 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -2052,8 +2052,13 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
         }
 
         if (state->dm_runas) {
-            flexarray_append(dm_args, "-runas");
-            flexarray_append(dm_args, state->dm_runas);
+            if (qemu_cmdline->have_runwith_user) {
+                flexarray_append_pair(dm_args, "-run-with",
+                                      GCSPRINTF("user=%s", state->dm_runas));
+            } else {
+                flexarray_append(dm_args, "-runas");
+                flexarray_append(dm_args, state->dm_runas);
+            }
         }
     }
     flexarray_append(dm_args, NULL);
@@ -3073,6 +3078,9 @@ static void device_model_probe_cmdline(libxl__egc *egc,
                 if (!strcmp("chroot", libxl__json_object_get_string(o))) {
                     dmss->qemu_cmdline.have_runwith_chroot = true;
                 }
+                else if (!strcmp("user", libxl__json_object_get_string(o))) {
+                    dmss->qemu_cmdline.have_runwith_user = true;
+                }
             }
 
             /*
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index df93d904c2..5c61050f79 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -4145,6 +4145,7 @@ typedef struct libxl__dm_spawn_state libxl__dm_spawn_state;
 typedef struct libxl__qemu_available_cmd_line libxl__qemu_available_cmd_line;
 struct libxl__qemu_available_cmd_line {
     bool have_runwith_chroot;
+    bool have_runwith_user;
 };
 
 typedef void libxl__dm_spawn_cb(libxl__egc *egc, libxl__dm_spawn_state*,
-- 


Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 10:03:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 10:03:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783749.1193045 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sit33-0001lb-KX; Tue, 27 Aug 2024 10:03:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783749.1193045; Tue, 27 Aug 2024 10:03:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sit33-0001kL-FO; Tue, 27 Aug 2024 10:03:37 +0000
Received: by outflank-mailman (input) for mailman id 783749;
 Tue, 27 Aug 2024 10:03:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=RBdT=P2=bounce.vates.tech=bounce-md_30504962.66cda473.v1-1b2f93cb1b2c4edb8d0fe7e4878e8374@srs-se1.protection.inumbo.net>)
 id 1sit32-00015q-4r
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 10:03:36 +0000
Received: from mail187-32.suw11.mandrillapp.com
 (mail187-32.suw11.mandrillapp.com [198.2.187.32])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9e8b35ea-645b-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 12:03:34 +0200 (CEST)
Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail187-32.suw11.mandrillapp.com (Mailchimp) with ESMTP id
 4WtNR74fkXzQXg2py
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 10:03:31 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 1b2f93cb1b2c4edb8d0fe7e4878e8374; Tue, 27 Aug 2024 10:03:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9e8b35ea-645b-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724753011; x=1725013511;
	bh=vvEWgBFkpI/68BpBe5Mn7aZ1DJf2R7AOv5a1MvGUyAA=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=w0ve9mAV0x6jz6gRVgHuDXjyIGyXaNCA99uKIn/XC6NVvM5s4mZ28+AeKSVxmnlt+
	 EMNHe8WlocQfLl7T0TVftzmPkSEpt5Or3N4DdcEuevRIcObvmXYo5fZQwwFE9Ql0W/
	 vvDYJL1rccDRGgHWXXm0sLHoNhExmNX41SetfyHdjgdj/+pFuCzku5/mgXO69dB3sp
	 b4NDlyfxKjQB+w5gb90LdC1CTFn7CX7+idOnEk6TwC7vKClO1QnmKLx/Rblwwve7G8
	 /5AcaiLZf+GLvTZpAjrXS7dDD0McM4uOBtLw4kKZVlL0lM72cZ64Nb/IPt3jlJQXdl
	 c06/l4FI/fJSw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724753011; x=1725013511; i=anthony.perard@vates.tech;
	bh=vvEWgBFkpI/68BpBe5Mn7aZ1DJf2R7AOv5a1MvGUyAA=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=XIFof5/mrgROYPkoIhrRSMVqLmf9KL71fv925M3LPb4y2T67KEyMz6ENGqdImWLhS
	 ooFzV+jkT5r98DV1anXVUaD7EoGeRGmdeNQUD9x6jLcFjZJc/Ryjxpb5dnoXY/Eh6w
	 iz6b4e1+UT4m1YQ59EoqgTJ1VupzvrA6EdLSgThIKkrLLdGJK25FQkZ93IF03kEPVr
	 Hz6+XATM5fJapS60fCnUZh/UWHbt3WUYwwV/VtHThu7FIWWAhiHoAuWq7cgqz0ZKqp
	 wfIXIMPYcjiZAHSHYfovfM4wvgmhWkybpWxEJF6q0yGNGf85wz5KAglYTDR0HKHq4j
	 5axScOsyJTeGQ==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?[XEN=20PATCH=202/3]=20libxl:=20Probe=20QEMU=20for=20-run-with=20chroot=3Ddir=20and=20use=20it?=
X-Mailer: git-send-email 2.39.2
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724753011205
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>, Juergen Gross <jgross@suse.com>
Message-Id: <20240827100328.23216-3-anthony.perard@vates.tech>
In-Reply-To: <20240827100328.23216-1-anthony.perard@vates.tech>
References: <20240827100328.23216-1-anthony.perard@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.1b2f93cb1b2c4edb8d0fe7e4878e8374?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240827:md
Date: Tue, 27 Aug 2024 10:03:31 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

QEMU 9.0 have removed "-chroot" command line option, which have been
deprecated since QEMU 8.1 in favor of "-run-with chroot=dir".

Look into the result of the QMP command "query-command-line-options"
to find out if "-run-with chroot=dir" is available. Then use it in
place of "-chroot".

Resolves: xen-project/xen#187
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_dm.c       | 78 +++++++++++++++++++++++++------
 tools/libs/light/libxl_internal.h |  5 ++
 2 files changed, 69 insertions(+), 14 deletions(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index 46babfed0b..298fbb84fe 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -1183,11 +1183,12 @@ static int libxl__pre_open_qmp_socket(libxl__gc *gc, libxl_domid domid,
 }
 
 static int libxl__build_device_model_args_new(libxl__gc *gc,
-                                        const char *dm, int guest_domid,
-                                        const libxl_domain_config *guest_config,
-                                        char ***args, char ***envs,
-                                        const libxl__domain_build_state *state,
-                                        int *dm_state_fd)
+    const char *dm, int guest_domid,
+    const libxl_domain_config *guest_config,
+    char ***args, char ***envs,
+    const libxl__domain_build_state *state,
+    const libxl__qemu_available_cmd_line *qemu_cmdline,
+    int *dm_state_fd)
 {
     const libxl_domain_create_info *c_info = &guest_config->c_info;
     const libxl_domain_build_info *b_info = &guest_config->b_info;
@@ -1778,8 +1779,13 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
         }
 
         /* Add "-chroot [dir]" to command-line */
-        flexarray_append(dm_args, "-chroot");
-        flexarray_append(dm_args, chroot_dir);
+        if (qemu_cmdline->have_runwith_chroot) {
+            flexarray_append_pair(dm_args, "-run-with",
+                                  GCSPRINTF("chroot=%s", chroot_dir));
+        } else {
+            flexarray_append(dm_args, "-chroot");
+            flexarray_append(dm_args, chroot_dir);
+        }
     }
 
     if (state->saved_state) {
@@ -2059,11 +2065,12 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
 }
 
 static int libxl__build_device_model_args(libxl__gc *gc,
-                                        const char *dm, int guest_domid,
-                                        const libxl_domain_config *guest_config,
-                                        char ***args, char ***envs,
-                                        const libxl__domain_build_state *state,
-                                        int *dm_state_fd)
+    const char *dm, int guest_domid,
+    const libxl_domain_config *guest_config,
+    char ***args, char ***envs,
+    const libxl__domain_build_state *state,
+    const libxl__qemu_available_cmd_line *qemu_cmdline,
+    int *dm_state_fd)
 /* dm_state_fd may be NULL iff caller knows we are using stubdom
  * and therefore will be passing a filename rather than a fd. */
 {
@@ -2081,7 +2088,9 @@ static int libxl__build_device_model_args(libxl__gc *gc,
         return libxl__build_device_model_args_new(gc, dm,
                                                   guest_domid, guest_config,
                                                   args, envs,
-                                                  state, dm_state_fd);
+                                                  state,
+                                                  qemu_cmdline,
+                                                  dm_state_fd);
     default:
         LOGED(ERROR, guest_domid, "unknown device model version %d",
               guest_config->b_info.device_model_version);
@@ -2403,7 +2412,9 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
 
     ret = libxl__build_device_model_args(gc, "stubdom-dm", guest_domid,
                                          guest_config, &args, NULL,
-                                         d_state, NULL);
+                                         d_state,
+                                         &sdss->dm.qemu_cmdline,
+                                         NULL);
     if (ret) {
         ret = ERROR_FAIL;
         goto out;
@@ -3024,6 +3035,7 @@ static void device_model_probe_detached(libxl__egc *egc,
 static void device_model_probe_cmdline(libxl__egc *egc,
     libxl__ev_qmp *qmp, const libxl__json_object *response, int rc)
 {
+    EGC_GC;
     libxl__dm_spawn_state *dmss = CONTAINER_OF(qmp, *dmss, qmp);
 
     if (rc)
@@ -3033,6 +3045,43 @@ static void device_model_probe_cmdline(libxl__egc *egc,
      * query-command-line-options response:
      * [ { 'option': 'str', 'parameters': [{ 'name': 'str', ... }] } ]
      */
+    const libxl__json_object *option;
+    for (int i_option = 0;
+         (option = libxl__json_array_get(response, i_option));
+         i_option++) {
+        const libxl__json_object *o;
+        const char *opt_str;
+
+        o = libxl__json_map_get("option", option, JSON_STRING);
+        if (!o) {
+            rc = ERROR_QEMU_API;
+            goto out;
+        }
+        opt_str = libxl__json_object_get_string(o);
+
+        if (!strcmp("run-with", opt_str)) {
+            const libxl__json_object *params;
+            const libxl__json_object *item;
+
+            params = libxl__json_map_get("parameters", option, JSON_ARRAY);
+            for (int i = 0; (item = libxl__json_array_get(params, i)); i++) {
+                o = libxl__json_map_get("name", item, JSON_STRING);
+                if (!o) {
+                    rc = ERROR_QEMU_API;
+                    goto out;
+                }
+                if (!strcmp("chroot", libxl__json_object_get_string(o))) {
+                    dmss->qemu_cmdline.have_runwith_chroot = true;
+                }
+            }
+
+            /*
+             * No need to parse more options, we are only interested with
+             * -run-with at the moment.
+             */
+            break;
+        }
+    }
 
     qmp->callback = device_model_probe_quit;
     rc = libxl__ev_qmp_send(egc, qmp, "quit", NULL);
@@ -3113,6 +3162,7 @@ static void device_model_launch(libxl__egc *egc,
 
     rc = libxl__build_device_model_args(gc, dm, domid, guest_config,
                                           &args, &envs, state,
+                                          &dmss->qemu_cmdline,
                                           &dm_state_fd);
     if (rc)
         goto out;
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index e99adc56cb..df93d904c2 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -4142,6 +4142,10 @@ _hidden void libxl__add_nics(libxl__egc *egc, libxl__ao *ao, uint32_t domid,
 /* First layer; wraps libxl__spawn_spawn. */
 
 typedef struct libxl__dm_spawn_state libxl__dm_spawn_state;
+typedef struct libxl__qemu_available_cmd_line libxl__qemu_available_cmd_line;
+struct libxl__qemu_available_cmd_line {
+    bool have_runwith_chroot;
+};
 
 typedef void libxl__dm_spawn_cb(libxl__egc *egc, libxl__dm_spawn_state*,
                                 int rc /* if !0, error was logged */);
@@ -4154,6 +4158,7 @@ struct libxl__dm_spawn_state {
     libxl__ev_qmp qmp;
     libxl__ev_time timeout;
     libxl__dm_resume_state dmrs;
+    libxl__qemu_available_cmd_line qemu_cmdline;
     const char *dm;
     /* filled in by user, must remain valid: */
     uint32_t guest_domid; /* domain being served */
-- 


Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 10:03:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 10:03:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783747.1193021 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sit32-00019J-3N; Tue, 27 Aug 2024 10:03:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783747.1193021; Tue, 27 Aug 2024 10:03:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sit31-00018N-VQ; Tue, 27 Aug 2024 10:03:35 +0000
Received: by outflank-mailman (input) for mailman id 783747;
 Tue, 27 Aug 2024 10:03:35 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=6Qjj=P2=bounce.vates.tech=bounce-md_30504962.66cda473.v1-2833161555d54724b73db1c6b0865185@srs-se1.protection.inumbo.net>)
 id 1sit31-00015r-4l
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 10:03:35 +0000
Received: from mail187-32.suw11.mandrillapp.com
 (mail187-32.suw11.mandrillapp.com [198.2.187.32])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9d751753-645b-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 12:03:32 +0200 (CEST)
Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail187-32.suw11.mandrillapp.com (Mailchimp) with ESMTP id
 4WtNR74DkRzQXg2bp
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 10:03:31 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 2833161555d54724b73db1c6b0865185; Tue, 27 Aug 2024 10:03:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9d751753-645b-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724753011; x=1725013511;
	bh=vchDRtHA+TPS5qyWfxue52QEMQPCyUlCs0i9CKru4ng=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=TFA8grfojzlr3qxxLXX4gwzAyudtEsXNB+EJ7DxhdMThbWtvUAUNi1gWhYjppxldd
	 TWmJ9i7S8gIjgY1paxJZPGxP0XmQ+wYUL6pOsSlrdYpXVP41nv6ahtk3Xc2yv799z3
	 iHlt+KXc2yxLBU7XbzoDhwHbGF+ZnH4lJLP713U+Z8mjzndqI3R/bNx40mM1d5E76T
	 WNaqwD+GiL3znCSqssh7Ieb5mobkjuJEj6e7kXzJdl+wkDuGFAz0BqnAsJ90R4Nf8u
	 IGwtwfUQIWuZTYe6cpF5/gZ3kp3OXsiubgsfMbO9YJ95fTNYCmT/nvbTycXLbbq4on
	 1RSGpqztTvq1g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724753011; x=1725013511; i=anthony.perard@vates.tech;
	bh=vchDRtHA+TPS5qyWfxue52QEMQPCyUlCs0i9CKru4ng=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=M+xtCFbDDMU2XyuuJ8tqPHS9eR8yO1wwpyCrb9wua/R6gt8thR4SBMdbT5q2hqFkd
	 837b0eCGY5CapNWFBAoKenSERaVVlJ4Z9h+9Y6bkEDPu3y5DK7sSDwYQEMZDw4YTmu
	 UuVVXdt2BddwsKQka00va8bg784VRR0LnwmiFLLD8NE8LU8Jku3jgnGX/V8V0ag0yB
	 4PrNdWdyh4CswNPEGOhzCxZUsbyN0JGet/ai0TmW8kw7f8Z7vasIzkZQR1uxu2r/Mi
	 8Ypco0BgyebzIgo20usgILAD1W66llsMAlY53WoqDH1gR8O3SBJYwCNSbLSQ/POFnk
	 pAvss3KD/WCeg==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?[XEN=20PATCH=201/3]=20libxl:=20Implement=20QEMU=20command=20line=20probe?=
X-Mailer: git-send-email 2.39.2
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724753010871
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@citrix.com>, Anthony PERARD <anthony.perard@vates.tech>, Juergen Gross <jgross@suse.com>
Message-Id: <20240827100328.23216-2-anthony.perard@vates.tech>
In-Reply-To: <20240827100328.23216-1-anthony.perard@vates.tech>
References: <20240827100328.23216-1-anthony.perard@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.2833161555d54724b73db1c6b0865185?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240827:md
Date: Tue, 27 Aug 2024 10:03:31 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

From: Anthony PERARD <anthony.perard@citrix.com>

Starting with QEMU 9.0, the option "-chroot", that we use for the
"dmrestrict" feature, is removed. We need to find out which to use
between "-chroot" and "-run-with chroot=dir".

This patch implement the machinery to spawn QEMU, and to run the QMP
command "query-command-line-options" but doesn't yet look at the
actual result. Whether or not to use "-run-with chroot=dir" will be
implemented in a follow up patch.

The command line used to spawn the qemu we want to probe is mostly
similar to the one we already use for the device model, "-machine
none" comes from libvirt.

This patch implement the probing on qemu-xen, even if we probably not
going to use the result. We could check the feature wanted for the
domain been created, but this could get complicated fairly quickly.
We already need to check the options "b_info->dm_restrict" for
"-chroot" and "state->dm_runas" for "-runas" (which is deprecated).

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
---
 tools/libs/light/libxl_dm.c       | 207 ++++++++++++++++++++++++++++--
 tools/libs/light/libxl_internal.h |   1 +
 2 files changed, 198 insertions(+), 10 deletions(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index ff8ddeec9a..46babfed0b 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -2858,6 +2858,20 @@ static void device_model_qmp_cb(libxl__egc *egc, libxl__ev_qmp *ev,
 static void device_model_spawn_outcome(libxl__egc *egc,
                                        libxl__dm_spawn_state *dmss,
                                        int rc);
+static void device_model_probe_startup_failed(libxl__egc *egc,
+    libxl__spawn_state *spawn, int rc);
+static void device_model_probe_confirm(libxl__egc *egc,
+    libxl__spawn_state *spawn, const char *xsdata);
+static void device_model_probe_detached(libxl__egc *egc,
+    libxl__spawn_state *spawn);
+static void device_model_probe_cmdline(libxl__egc *egc,
+    libxl__ev_qmp *qmp, const libxl__json_object *response, int rc);
+static void device_model_probe_quit(libxl__egc *egc,
+    libxl__ev_qmp *qmp, const libxl__json_object *response, int rc);
+static void device_model_probe_spawn_outcome(libxl__egc *egc,
+     libxl__dm_spawn_state *dmss, int rc);
+static void device_model_launch(libxl__egc *egc,
+    libxl__dm_spawn_state *dmss, int rc);
 static void device_model_postconfig_chardev(libxl__egc *egc,
     libxl__ev_qmp *qmp, const libxl__json_object *response, int rc);
 static void device_model_postconfig_vnc(libxl__egc *egc,
@@ -2873,25 +2887,18 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
 {
     /* convenience aliases */
     const int domid = dmss->guest_domid;
-    libxl__domain_build_state *const state = dmss->build_state;
     libxl__spawn_state *const spawn = &dmss->spawn;
 
     STATE_AO_GC(dmss->spawn.ao);
 
-    libxl_ctx *ctx = CTX;
     libxl_domain_config *guest_config = dmss->guest_config;
     const libxl_domain_create_info *c_info = &guest_config->c_info;
     const libxl_domain_build_info *b_info = &guest_config->b_info;
-    const libxl_vnc_info *vnc = libxl__dm_vnc(guest_config);
-    char *path;
-    int logfile_w, null;
     int rc;
-    char **args, **arg, **envs;
-    xs_transaction_t t;
-    char *vm_path;
-    char **pass_stuff;
     const char *dm;
-    int dm_state_fd = -1;
+    int logfile_w = -1, null = -1;
+    int qmp_probe_fd = -1;
+    bool probe_spawned = false;
 
     dmss_init(dmss);
 
@@ -2904,6 +2911,7 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
         rc = ERROR_FAIL;
         goto out;
     }
+    dmss->dm = dm;
     if (access(dm, X_OK) < 0) {
         LOGED(ERROR, domid, "device model %s is not executable", dm);
         rc = ERROR_FAIL;
@@ -2911,6 +2919,185 @@ void libxl__spawn_local_dm(libxl__egc *egc, libxl__dm_spawn_state *dmss)
     }
 
     rc = libxl__domain_get_device_model_uid(gc, dmss);
+    if (rc)
+        goto out;
+
+    /* probe QEMU's available command line options */
+    if (b_info->device_model_version
+        == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN) {
+
+        logfile_w = libxl__create_qemu_logfile(
+            gc, GCSPRINTF("qemu-probe-%s", c_info->name));
+        if (logfile_w < 0) {
+            rc = logfile_w;
+            goto out;
+        }
+        null = open("/dev/null", O_RDONLY);
+        if (null < 0) {
+            LOGED(ERROR, domid, "unable to open /dev/null");
+            rc = ERROR_FAIL;
+            goto out;
+        }
+
+        rc = libxl__pre_open_qmp_socket(gc, domid, &qmp_probe_fd);
+        if (rc) goto out;
+
+        flexarray_t *dm_args = flexarray_make(gc, 16, 1);
+        flexarray_vappend(dm_args, dm,
+                          "-S",
+                          "-no-user-config",
+                          "-nodefaults",
+                          "-nographic",
+                          "-machine", "none,accel=xen",
+                          NULL);
+        flexarray_vappend(dm_args,
+                          "-chardev",
+                          GCSPRINTF("socket,id=libxl-cmd,fd=%d,server=on,wait=off",
+                                    qmp_probe_fd),
+                          "-mon", "chardev=libxl-cmd,mode=control",
+                          NULL);
+        flexarray_append(dm_args, NULL);
+        char **exec_args = (char **) flexarray_contents(dm_args);
+
+        const char *dom_path = libxl__xs_get_dompath(gc, domid);
+
+        spawn->what = GCSPRINTF("domain %d qemu command line probe", domid);
+        spawn->xspath = "/dev/null"; /* No path to watch */
+        spawn->timeout_ms = LIBXL_DEVICE_MODEL_START_TIMEOUT * 1000;
+        spawn->pidpath = GCSPRINTF("%s/image/device-model-pid", dom_path);
+        spawn->midproc_cb = libxl__spawn_record_pid;
+        spawn->confirm_cb = device_model_probe_confirm;
+        spawn->failure_cb = device_model_probe_startup_failed;
+        spawn->detached_cb = device_model_probe_detached;
+
+        dmss->qmp.ao = ao;
+        dmss->qmp.callback = device_model_probe_cmdline;
+        dmss->qmp.domid = domid;
+        dmss->qmp.payload_fd = -1;
+        rc = libxl__ev_qmp_send(egc, &dmss->qmp, "query-command-line-options", NULL);
+        if (rc) goto out;
+
+        rc = libxl__spawn_spawn(egc, spawn);
+        if (rc < 0)
+            goto out;
+        if (!rc) { /* inner child */
+            setsid();
+            libxl__exec(gc, null, logfile_w, logfile_w, dm, exec_args, NULL);
+        }
+        probe_spawned = true;
+    } else {
+        /* Continue with launching DM instead of probing it */
+        probe_spawned = false;
+    }
+    rc = 0;
+out:
+    if (qmp_probe_fd >= 0)
+        close(qmp_probe_fd);
+    if (null >= 0)
+        close(null);
+    if (logfile_w >= 0)
+        close(logfile_w);
+    if (rc || !probe_spawned)
+        device_model_launch(egc, dmss, rc);
+}
+
+static void device_model_probe_startup_failed(libxl__egc *egc,
+    libxl__spawn_state *spawn, int rc)
+{
+    libxl__dm_spawn_state *dmss = CONTAINER_OF(spawn, *dmss, spawn);
+    device_model_probe_spawn_outcome(egc, dmss, rc);
+}
+
+static void device_model_probe_confirm(libxl__egc *egc,
+    libxl__spawn_state *spawn, const char *xsdata)
+{
+    /* Nothing to do, confirmation is done via QMP instead */
+}
+
+static void device_model_probe_detached(libxl__egc *egc,
+    libxl__spawn_state *spawn)
+{
+    libxl__dm_spawn_state *dmss = CONTAINER_OF(spawn, *dmss, spawn);
+    device_model_probe_spawn_outcome(egc, dmss, 0);
+}
+
+static void device_model_probe_cmdline(libxl__egc *egc,
+    libxl__ev_qmp *qmp, const libxl__json_object *response, int rc)
+{
+    libxl__dm_spawn_state *dmss = CONTAINER_OF(qmp, *dmss, qmp);
+
+    if (rc)
+        goto out;
+
+    /*
+     * query-command-line-options response:
+     * [ { 'option': 'str', 'parameters': [{ 'name': 'str', ... }] } ]
+     */
+
+    qmp->callback = device_model_probe_quit;
+    rc = libxl__ev_qmp_send(egc, qmp, "quit", NULL);
+    if (rc) goto out;
+    return;
+
+out:
+    libxl__spawn_initiate_failure(egc, &dmss->spawn, rc);
+}
+
+static void device_model_probe_quit(libxl__egc *egc,
+    libxl__ev_qmp *qmp, const libxl__json_object *response, int rc)
+{
+    EGC_GC;
+    libxl__dm_spawn_state *dmss = CONTAINER_OF(qmp, *dmss, qmp);
+
+    libxl__ev_qmp_dispose(gc, qmp);
+    libxl__spawn_initiate_detach(gc, &dmss->spawn);
+}
+
+static void device_model_probe_spawn_outcome(libxl__egc *egc,
+    libxl__dm_spawn_state *dmss, int rc)
+{
+    EGC_GC;
+    libxl__ev_qmp_dispose(gc, &dmss->qmp);
+
+    /* Ensure our QEMU command line probe is killed. */
+    rc = libxl__kill_xs_path(gc, dmss->spawn.pidpath,
+                             "qemu command-line probe");
+    if (rc) {
+        LOGD(WARN, dmss->guest_domid,
+             "Killing qemu command-line probe pid from path %s",
+             dmss->spawn.pidpath);
+    }
+
+    /*
+     * Ignore all failure from the QEMU command line probe, start the
+     * device model in any case.
+     */
+    device_model_launch(egc, dmss, 0);
+}
+
+static void device_model_launch(libxl__egc *egc,
+    libxl__dm_spawn_state *dmss, int rc)
+{
+    STATE_AO_GC(dmss->spawn.ao);
+    libxl_ctx *ctx = CTX;
+    libxl_domain_config *guest_config = dmss->guest_config;
+    const libxl_domain_create_info *c_info = &guest_config->c_info;
+    const libxl_domain_build_info *b_info = &guest_config->b_info;
+    const libxl_vnc_info *vnc = libxl__dm_vnc(guest_config);
+    char *path;
+    int logfile_w, null;
+    char **args, **arg, **envs;
+    xs_transaction_t t;
+    char *vm_path;
+    char **pass_stuff;
+    int dm_state_fd = -1;
+
+    /* convenience aliases */
+    const int domid = dmss->guest_domid;
+    libxl__domain_build_state *const state = dmss->build_state;
+    libxl__spawn_state *const spawn = &dmss->spawn;
+    const char *const dm = dmss->dm;
+
     if (rc)
         goto out;
 
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index 3b58bb2d7f..e99adc56cb 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -4154,6 +4154,7 @@ struct libxl__dm_spawn_state {
     libxl__ev_qmp qmp;
     libxl__ev_time timeout;
     libxl__dm_resume_state dmrs;
+    const char *dm;
     /* filled in by user, must remain valid: */
     uint32_t guest_domid; /* domain being served */
     libxl_domain_config *guest_config;
-- 


Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 10:03:39 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 10:03:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783746.1193016 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sit31-00016E-RL; Tue, 27 Aug 2024 10:03:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783746.1193016; Tue, 27 Aug 2024 10:03:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sit31-000167-Of; Tue, 27 Aug 2024 10:03:35 +0000
Received: by outflank-mailman (input) for mailman id 783746;
 Tue, 27 Aug 2024 10:03: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=lqxM=P2=bounce.vates.tech=bounce-md_30504962.66cda473.v1-8f1f9f88efe5427d845b945a4ac8ba8b@srs-se1.protection.inumbo.net>)
 id 1sit30-00015q-GO
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 10:03:34 +0000
Received: from mail187-32.suw11.mandrillapp.com
 (mail187-32.suw11.mandrillapp.com [198.2.187.32])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9d769d2c-645b-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 12:03:32 +0200 (CEST)
Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail187-32.suw11.mandrillapp.com (Mailchimp) with ESMTP id
 4WtNR70lRPzQXg2bd
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 10:03:31 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 8f1f9f88efe5427d845b945a4ac8ba8b; Tue, 27 Aug 2024 10:03:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9d769d2c-645b-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724753011; x=1725013511;
	bh=85xl+42r3E+d5KYyQdGBwoXGanIObfXZWBWVlXbR904=;
	h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From;
	b=Yq/8kFDTSFAWQ8f44lbhZ98PVMYaElQJC72k58LBa5HyUJnlboK8b0T8A3685spgI
	 xJf+0E1IuX7xrZTTE6enJg+OMKzJXGJJNBdTmyl6OSyczYAeLPyjRkl9AXNmU/XsMT
	 rSDhKnDoHrLSNTbgsgxSED1oN6qt09O33bZHz12mhxZacSMiWyqt7STq/w+7GJw36/
	 l/hkvuCSfnt5dovHHotbtgYOe2KEHWrA0c329tvyHHoBtjCo1jkQHss+U7cB2f6R2t
	 qXL2ee83Eb/2OQNk/M8sLIqNMMjSMTWQSswTmdwH0PtrzFis8O0mIa9ZlVPNUg41oD
	 vKo2gks427BDw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724753011; x=1725013511; i=anthony.perard@vates.tech;
	bh=85xl+42r3E+d5KYyQdGBwoXGanIObfXZWBWVlXbR904=;
	h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From;
	b=Z9LGYjXE5Ajkz+ie05bmLGp4BWs4cD2NZbvPfd6IEnDuOCIP3Fr/pU1ldhq+G054v
	 NecoP6fmO/oOUMafcRKWa4VY9xLhlBvwhCJR+E/gmLAgnBfiednTFC+kbjOMJnGa5U
	 GqB/mbxXx7ft9Ux34zgWKqZPcfiMGbmDFC7Oct8cDD/pfETxldRLuFnXuvHTAlYU86
	 GYjhIohI1wnQI8B5FsWlE5k7LELbb8gDn9Q7Wrta5yuYyG6am8VKOBupKHvC9S0UyW
	 zkTbnqFprqebs7GNweQnOqDxiXRVDYwqYIdVCslxHNIkM3P1WNh2XlszvQZTWQ+jYT
	 uepFTnHtBIGgw==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?[XEN=20PATCH=200/3]=20libxl:=20Implement=20QEMU=20command=20line=20probe?=
X-Mailer: git-send-email 2.39.2
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724753010498
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>, Juergen Gross <jgross@suse.com>
Message-Id: <20240827100328.23216-1-anthony.perard@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.8f1f9f88efe5427d845b945a4ac8ba8b?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240827:md
Date: Tue, 27 Aug 2024 10:03:31 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Patch series available in this git branch:
https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git br.libxl-qemu-cmdline-probe-v1

Starting with QEMU 9.0, the option "-chroot", that we use for the
"dmrestrict" feature, is removed. We need to find out which to use
between "-chroot" and "-run-with chroot=dir".

Also, "-runas" is deprecated in QEMU 9.1 and will be remove in a future
release, it's replaced with "-run-with user=user".

To find out which command line option we can use, we'll spawn QEMU, and run the
QMP command "query-command-line-options".

Some example of running these patches:
    with qemu-xen (8.0):
        http://logs.test-lab.xenproject.org/osstest/logs/187352/
    with QEMU (upstream, 9.1-rc3):
        http://logs.test-lab.xenproject.org/osstest/logs/187353/

Anthony PERARD (3):
  libxl: Implement QEMU command line probe
  libxl: Probe QEMU for -run-with chroot=dir and use it
  libxl: Probe QEMU for -run-with user=user and use it

 tools/libs/light/libxl_dm.c       | 297 +++++++++++++++++++++++++++---
 tools/libs/light/libxl_internal.h |   7 +
 2 files changed, 278 insertions(+), 26 deletions(-)

-- 


Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 10:06:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 10:06:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783769.1193055 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sit5h-0003Vh-5u; Tue, 27 Aug 2024 10:06:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783769.1193055; Tue, 27 Aug 2024 10:06:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sit5h-0003Va-2n; Tue, 27 Aug 2024 10:06:21 +0000
Received: by outflank-mailman (input) for mailman id 783769;
 Tue, 27 Aug 2024 10:06:20 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sit5g-0003VU-DM
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 10:06:20 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 00953ed2-645c-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 12:06:18 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a86e9db75b9so60710766b.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 03:06:18 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e549f5c1sm90215366b.68.2024.08.27.03.06.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 03:06:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 00953ed2-645c-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724753178; x=1725357978; 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=K7B020LNejmQpcsQmDsGhftsIXMYhjSNG2gBAlVB3jI=;
        b=eLjAizbJgf9sN1ZFn9z9vavCYN6qkUnrfaDw9xvPtEmt/QThYgO0HDPP1eDVCDD4hz
         u6DH2Ghp4t32JFz+kaQ/daRfEEWIlWGlMqssvLhKEVmsBa6Eb0KAI3HyKNUfsj7O1+Ds
         0Z1w7dTMgEQG3H07VDjf+x1BAed4Uw2KbVrQK1O7NrMkY7talLjPiVqg07512gI7zhdO
         PrTg9qG8gVT6Zvp7i8WEE/1s5PVyrFclzxXN8PD5XdtcYDbpJP4b2//dCZL2/bqJBh+l
         mWf9jD6CQU0mjgWFnog2S9+yPVA7Sf2PP4GeG8mOZ8yQRrERAer8MMSC5qM/utvNSFfU
         y0eQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724753178; x=1725357978;
        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=K7B020LNejmQpcsQmDsGhftsIXMYhjSNG2gBAlVB3jI=;
        b=VR4rCDBziD0pb8qJGbRPJvlktRmUzgU2vT4D/ii6GlEDPfsVXn7I9ZVg5UW0hPVWha
         f6cwdEbRxWQiFUzwJUJlvatW/JsUPoICs5YgmepdepyEu6a4PQCSM9lGJcCeHRVWMy39
         XP8cYcdeSYJpWKhGXMh09Bw7/tYoa81q2IwqvLVP0CcsT+x+G70/P3cKIi9eEQ2tVtmC
         quBgj5BN71ZrLdX6xyC3S1GqBPn1HI0ViLMyN+GQVhOIIDJUlhmy1YHjeb540xBw9knz
         4DTUlyD1r9/U6acjUdqvfcBA5Al9gu8WFbu0Iv4bGcESy/eCKq11FtwQMC9WYDa/tGJR
         5KDw==
X-Forwarded-Encrypted: i=1; AJvYcCVEj+5WtKNW30o6QBKVL1m/Axpr7norr+ud9HNFbyxDAR4rnwGHQkf0iwcV57YdxKv9GJFep1c7b/w=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyrnBLCB6TQ6FXGQN3tqQAH1uDjv9dAsLNs4aQ/d3hxgrkqxcfR
	wvqVCWx7MLk66vgc2K8nMe53Y1Hrxx1Euaw9sUv5d3+sv0z4NDVEF/8HK8Pkrg==
X-Google-Smtp-Source: AGHT+IEYLo/pLXhFi/u0X5rhBgSECncheOkDFPmxk31bJUo95vJ71JUxWeNJeYGP0zTt3esnAwTTHw==
X-Received: by 2002:a17:907:7b82:b0:a77:c364:c4f2 with SMTP id a640c23a62f3a-a86a54882f6mr822324166b.52.1724753177475;
        Tue, 27 Aug 2024 03:06:17 -0700 (PDT)
Message-ID: <0f9fb47c-91d1-4ee9-b6bf-1d491339e904@suse.com>
Date: Tue, 27 Aug 2024 12:06:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 1/7] xen/riscv: use {read,write}{b,w,l,q}_cpu() to
 define {read,write}_atomic()
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
 <5140f9eb3d1cb0b69e3b1cbbcce6167ff8d59e4c.1724256026.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <5140f9eb3d1cb0b69e3b1cbbcce6167ff8d59e4c.1724256026.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 21.08.2024 18:06, Oleksii Kurochko wrote:
> In Xen, memory-ordered atomic operations are not necessary,

This is an interesting statement. I'd like to suggest that you at least
limit it to the two constructs in question, rather than stating this
globally for everything.

> based on {read,write}_atomic() implementations for other architectures.
> Therefore, {read,write}{b,w,l,q}_cpu() can be used instead of
> {read,write}{b,w,l,q}(), allowing the caller to decide if additional
> fences should be applied before or after {read,write}_atomic().
> 
> Change the declaration of _write_atomic() to accept a 'volatile void *'
> type for the 'x' argument instead of 'unsigned long'.
> This prevents compilation errors such as:
> 1."discards 'volatile' qualifier from pointer target type," which occurs
>   due to the initialization of a volatile pointer,
>   e.g., `volatile uint8_t *ptr = p;` in _add_sized().

I don't follow you here. It's the other argument of write_atomic() that
has ptr passed there.

> 2."incompatible type for argument 2 of '_write_atomic'," which can occur
>   when calling write_pte(), where 'x' is of type pte_t rather than
>   unsigned long.

How's this related to the change at hand? That isn't different ahead of
this change, is it?

> --- a/xen/arch/riscv/include/asm/atomic.h
> +++ b/xen/arch/riscv/include/asm/atomic.h
> @@ -31,21 +31,17 @@
>  
>  void __bad_atomic_size(void);
>  
> -/*
> - * Legacy from Linux kernel. For some reason they wanted to have ordered
> - * read/write access. Thereby read* is used instead of read*_cpu()
> - */
>  static always_inline void read_atomic_size(const volatile void *p,
>                                             void *res,
>                                             unsigned int size)
>  {
>      switch ( size )
>      {
> -    case 1: *(uint8_t *)res = readb(p); break;
> -    case 2: *(uint16_t *)res = readw(p); break;
> -    case 4: *(uint32_t *)res = readl(p); break;
> +    case 1: *(uint8_t *)res = readb_cpu(p); break;
> +    case 2: *(uint16_t *)res = readw_cpu(p); break;
> +    case 4: *(uint32_t *)res = readl_cpu(p); break;
>  #ifndef CONFIG_RISCV_32
> -    case 8: *(uint32_t *)res = readq(p); break;
> +    case 8: *(uint32_t *)res = readq_cpu(p); break;
>  #endif
>      default: __bad_atomic_size(); break;
>      }
> @@ -58,15 +54,16 @@ static always_inline void read_atomic_size(const volatile void *p,
>  })
>  
>  static always_inline void _write_atomic(volatile void *p,
> -                                       unsigned long x, unsigned int size)
> +                                        volatile void *x,

If this really needs to become a pointer, it ought to also be pointer-
to-const. Otherwise it is yet more confusing which operand is which.

> +                                        unsigned int size)
>  {
>      switch ( size )
>      {
> -    case 1: writeb(x, p); break;
> -    case 2: writew(x, p); break;
> -    case 4: writel(x, p); break;
> +    case 1: writeb_cpu(*(uint8_t *)x, p); break;
> +    case 2: writew_cpu(*(uint16_t *)x, p); break;
> +    case 4: writel_cpu(*(uint32_t *)x, p); break;
>  #ifndef CONFIG_RISCV_32
> -    case 8: writeq(x, p); break;
> +    case 8: writeq_cpu(*(uint64_t *)x, p); break;

Of course you may not cast away const-ness then. You also be casting
away volatile-ness, but (as per above) I question the need for volatile
on x.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 10:12:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 10:12:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783778.1193065 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sitB8-0005sc-ON; Tue, 27 Aug 2024 10:11:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783778.1193065; Tue, 27 Aug 2024 10:11:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sitB8-0005sV-LY; Tue, 27 Aug 2024 10:11:58 +0000
Received: by outflank-mailman (input) for mailman id 783778;
 Tue, 27 Aug 2024 10:11: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=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sitB7-0005sP-6z
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 10:11:57 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c9831800-645c-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 12:11:55 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a8696e9bd24so558309966b.0
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 03:11:55 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e592d9a3sm89745166b.193.2024.08.27.03.11.53
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 03:11:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c9831800-645c-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724753515; x=1725358315; 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=5IyZ1xSNKaCZh8FN85uGFgt/sG9NKrQQlldMvA0JaiU=;
        b=UBtI7OelWG80mcl4CSWH2ACMkfm+jett9QBJt1dQfpLzyaw6kf2i4cHe2HLUL1YLmO
         y9CBmFaAEarJMF6lPYRr5EVS0WFNStkzXmGHLDOJtDBUhaRNkSEHwAnmeIDbAD2dW3Iv
         upujVawYK7x7xNVRUr4BtW25HUZ2jed7QWMqQ8KJhRadqXkKMOS8Y7EtP/h0cHNRsSKW
         4WTy0tE6OGh+Vb/m2X2LCms4tnAOCQI/X+PvWI6YRikTGjSFzbB5a9RJlfBA/MNodXGN
         Sp+UPHq1cZauEIkoIEGJGesQVnr/XB1Zi4+3rGJhQcZZe3FSxQlMxdLxd2piSV+Un+3C
         FCWA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724753515; x=1725358315;
        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=5IyZ1xSNKaCZh8FN85uGFgt/sG9NKrQQlldMvA0JaiU=;
        b=Vz/lA5OzBgycBiyIM19FH23FI1vgDjXF4e2piiRDuxyvHMcVxOefXtxqCnKG9TZJ04
         qNp83rTqJGcbQJ+938aCWJ9PrXtVOvcbEEAz2DLb7zVSv0NfUv7fcKft1lYDWSRVZDsk
         Py9POLibcml/1Z3JkultcpmuFSRHHuyV1LKEBwqDA9NIwCUB6DalokjRSvROtecJtx6e
         Mxl0uZZmf26sDFVNO/12cT5R1Yr8rqacaNGBDh4jRooFYdtBgeBT1K0Jjc36rEvIEidX
         jtbDelbF6LkXOmM7qhQLkCh4M9SDYdsLxQVNijeJBVA3ehZuQ7LGbA9/fIRztkXBp0mz
         viLg==
X-Forwarded-Encrypted: i=1; AJvYcCUj0UGlBkBL7BpO3BDZPdMXhR5DwnKBbh/71pcn9DZtbxpatcRZ+m+YaYloy5o1I9XrL/V4XCf03nY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxgRnprSlgV0GDgHr4wD9Ml8j/FZHqeo6KKSd5n/D/N17zHJw0h
	pYiJPYnP+YoAl07eNXY+IlLxTrxWTS/6x74TzUzn942zgQYprTMWUPcZdOcoKQ==
X-Google-Smtp-Source: AGHT+IF2uTYJt5DfWm535wpGj93TIlJrHcT55L5iu4jxgHA53+9Ayhs8XuI1xA1P9sOXIfPlehWE+g==
X-Received: by 2002:a17:907:72c7:b0:a7a:9144:e251 with SMTP id a640c23a62f3a-a86e397e641mr193513666b.11.1724753514579;
        Tue, 27 Aug 2024 03:11:54 -0700 (PDT)
Message-ID: <6b86e515-c68c-4c3b-9e99-bce4119ab1a2@suse.com>
Date: Tue, 27 Aug 2024 12:11:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/9] xen/bitops: Drop the remnants of hweight{8,16}()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-5-andrew.cooper3@citrix.com>
 <8c6599fa-22c0-455e-9d6a-51b3bf3d24b3@suse.com>
 <f0a5525f-cfb8-4669-a0b7-3da4fdd9eaaf@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <f0a5525f-cfb8-4669-a0b7-3da4fdd9eaaf@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 27.08.2024 11:49, Andrew Cooper wrote:
> On 26/08/2024 11:39 am, Jan Beulich wrote:
>> On 23.08.2024 01:06, Andrew Cooper wrote:
>>> They are no more, and won't be returning in this form.
>> And what's the plan? Use hweight32((uint8_t)...) in an open-coded manner?
>> Not overly nice I would say.
> 
> If we ever regain a genuine need for the 8 or 16 forms, they can go back
> into bitops.h, in terms of hweightl(), just like hweight32().
> 
> But it's been 20 years so far and we haven't actually needed
> hweight8/16, and I'm expecting this to continue for the forseeable future.

Well, I'm not fully convinced. People may (try to) add open-coded forms like
in my earlier reply instead. But anyway:
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 10:29:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 10:29:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783790.1193076 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sitRp-0001JR-4w; Tue, 27 Aug 2024 10:29:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783790.1193076; Tue, 27 Aug 2024 10:29:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sitRp-0001JK-2H; Tue, 27 Aug 2024 10:29:13 +0000
Received: by outflank-mailman (input) for mailman id 783790;
 Tue, 27 Aug 2024 10:29:11 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sitRn-0001JE-Km
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 10:29:11 +0000
Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com
 [2a00:1450:4864:20::234])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 32092efc-645f-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 12:29:09 +0200 (CEST)
Received: by mail-lj1-x234.google.com with SMTP id
 38308e7fff4ca-2f4f5dbd93bso39171611fa.2
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 03:29:09 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e582d965sm91073666b.100.2024.08.27.03.29.08
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 03:29:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 32092efc-645f-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724754549; x=1725359349; 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=1C/Ev2CQ1DZYN+9tMmU6GXQxTfRZwTT4FZ9YN963NPo=;
        b=PjfofYbRv9dS1A/6F4Vcf47vGd6HFF53wXyOHBRWdxq4hvhIhFn8T6zd2+hL/YFWzB
         4TuX9FsDT8TaXMs5z++uQmSyQsHuK5PbTwjB4BxMyowkud7HiINREJPjTXLRauoPcN2n
         5C5xEceHBTMbxOZWF7zNg/oUsS7dWjJZWgt2r9fxLHBuyolz4WHkdDnG+bh9LjHwoZ1/
         a2HXSsHBCbCYlDydrIyMzywfuH7o8KURjncQcYjDT05gWG2NTm91lKDoqM23ZkXcdqVL
         4X0YILFPfDf1o0i3TFVhjSOv4vfKZRE0ZdU8Mg8NGYNrJiTlfdepSQgr/6m4X2wlpezt
         8xCQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724754549; x=1725359349;
        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=1C/Ev2CQ1DZYN+9tMmU6GXQxTfRZwTT4FZ9YN963NPo=;
        b=uZ5RiKe8p5ap8IyhC0xo5PQie4I2WNvwy2iuHeENjqeKePpnqDvOtR9Q6CkE+yRK+k
         IJScx1ACDljtK4CpraIO6+jCAqmodf1NoN7paprXZgdybyjISyUP+728qtqUfXgE6oCK
         mUUCgCNlSzhtNWqK9N0ciQ1fvAdF14YQELP3ERUysF4RLOrKU+2w4GZh7mzV5rb+sS5r
         OrvueY/jdyiHrhy7JIz4i74qW/MWCkgLXjNBIQaIM5+jGbkJ2kZk1r6XatlXaa9smgvo
         IH0ZHKbRDrwrzvyukYW7sbCY5a5C3BEPtfdFn7wWvXKiqFTpBWoyjO4fMOPFCw4EigSX
         7mAw==
X-Forwarded-Encrypted: i=1; AJvYcCXdowr0D+dy9X4nsGhfJDK295fvX9JPQyPTj4Sew6ZLWKygQG1qTZ83syHd4BhZHEJ8Qt0onhLZeqA=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx7tzORT7fKj3NLCAhs7AqMfJElflEYhHihKRvD37tAlwvioqcz
	i2SIoXy1AMkISNHWzg2lDYXjTC1iZvMdPG9NkShdm6YcYvKjSqsB0Mk9gaZjww==
X-Google-Smtp-Source: AGHT+IGhiaoJNK4P2JMh+GilgxqJT941DWDpjxehVWuIJxBwDvcISAkU9bpibdzA8TlL+l85ahIDZQ==
X-Received: by 2002:a05:6512:159d:b0:52c:8a12:3d3b with SMTP id 2adb3069b0e04-534387c4a27mr8142158e87.56.1724754548834;
        Tue, 27 Aug 2024 03:29:08 -0700 (PDT)
Message-ID: <4b9cfa7e-546a-4dbb-a3de-4267849be13a@suse.com>
Date: Tue, 27 Aug 2024 12:29:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 2/7] xen/riscv: set up fixmap mappings
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
 <57e892d5b2c526dd44b68d4976796a25c0feca20.1724256027.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <57e892d5b2c526dd44b68d4976796a25c0feca20.1724256027.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 21.08.2024 18:06, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/include/asm/config.h
> +++ b/xen/arch/riscv/include/asm/config.h
> @@ -41,8 +41,10 @@
>   * Start addr          | End addr         | Slot       | area description
>   * ============================================================================
>   *                   .....                 L2 511          Unused
> - *  0xffffffffc0600000  0xffffffffc0800000 L2 511          Fixmap
> - *  0xffffffffc0200000  0xffffffffc0600000 L2 511          FDT
> + *  0xffffffffc0A00000  0xffffffffc0C00000 L2 511          Fixmap

Nit: Please can you avoid using mixed case in numbers?

> @@ -74,6 +76,15 @@
>  #error "unsupported RV_STAGE1_MODE"
>  #endif
>  
> +#define GAP_SIZE                MB(2)
> +
> +#define XEN_VIRT_SIZE           MB(2)
> +
> +#define BOOT_FDT_VIRT_START     (XEN_VIRT_START + XEN_VIRT_SIZE + GAP_SIZE)
> +#define BOOT_FDT_VIRT_SIZE      MB(4)
> +
> +#define FIXMAP_BASE             (BOOT_FDT_VIRT_START + BOOT_FDT_VIRT_SIZE + GAP_SIZE)

Nit: Overly long line.

> --- /dev/null
> +++ b/xen/arch/riscv/include/asm/fixmap.h
> @@ -0,0 +1,46 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * fixmap.h: compile-time virtual memory allocation
> + */
> +#ifndef ASM_FIXMAP_H
> +#define ASM_FIXMAP_H
> +
> +#include <xen/bug.h>
> +#include <xen/page-size.h>
> +#include <xen/pmap.h>
> +
> +#include <asm/page.h>
> +
> +#define FIXMAP_ADDR(n) (FIXMAP_BASE + (n) * PAGE_SIZE)
> +
> +/* Fixmap slots */
> +#define FIX_PMAP_BEGIN (0) /* Start of PMAP */
> +#define FIX_PMAP_END (FIX_PMAP_BEGIN + NUM_FIX_PMAP - 1) /* End of PMAP */
> +#define FIX_MISC (FIX_PMAP_END + 1)  /* Ephemeral mappings of hardware */
> +
> +#define FIX_LAST FIX_MISC
> +
> +#define FIXADDR_START FIXMAP_ADDR(0)
> +#define FIXADDR_TOP FIXMAP_ADDR(FIX_LAST + 1)
> +
> +#ifndef __ASSEMBLY__
> +
> +/*
> + * Direct access to xen_fixmap[] should only happen when {set,
> + * clear}_fixmap() is unusable (e.g. where we would end up to
> + * recursively call the helpers).
> + */
> +extern pte_t xen_fixmap[];

I'm afraid I keep being irritated by the comment: What recursive use of
helpers is being talked about here? I can't see anything recursive in this
patch. If this starts happening with a subsequent patch, then you have
two options: Move the declaration + comment there, or clarify in the
description (in enough detail) what this is about.

> @@ -81,6 +82,18 @@ static inline void flush_page_to_ram(unsigned long mfn, bool sync_icache)
>      BUG_ON("unimplemented");
>  }
>  
> +/* Write a pagetable entry. */
> +static inline void write_pte(pte_t *p, pte_t pte)
> +{
> +    write_atomic(p, pte);
> +}
> +
> +/* Read a pagetable entry. */
> +static inline pte_t read_pte(pte_t *p)
> +{
> +    return read_atomic(p);

This only works because of the strange type trickery you're playing in
read_atomic(). Look at x86 code - there's a strict expectation that the
type can be converted to/from unsigned long. And page table accessors
are written with that taken into consideration. Same goes for write_pte()
of course, with the respective comment on the earlier patch in mind.

Otoh I see that Arm does something very similar. If you have a strong
need / desire to follow that, then please at least split the two
entirely separate aspects that patch 1 presently changes both in one go.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 10:37:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 10:37:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783810.1193085 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sitZs-0003vT-TX; Tue, 27 Aug 2024 10:37:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783810.1193085; Tue, 27 Aug 2024 10:37:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sitZs-0003vL-QU; Tue, 27 Aug 2024 10:37:32 +0000
Received: by outflank-mailman (input) for mailman id 783810;
 Tue, 27 Aug 2024 10:37:31 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sitZr-0003vF-O4
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 10:37:31 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sitZr-00047g-74; Tue, 27 Aug 2024 10:37:31 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sitZq-0002Xi-VM; Tue, 27 Aug 2024 10:37:31 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=Oy1AsRA9/v+xw+pSa+h4HmNqGjQ8lWuwuexU8tqq/MY=; b=chE+nXgOAN7zI15p5DDFpag5RH
	rtmb4E4QgD4nbn6xeLVdw5TVScw5EZtk7B27vm1O+trwdmH11GSDy7DErgKd16lkCFwVisan/8+za
	+WisVA0vEcOfnKeInLIrab0p1dGS7oqev483QrEvLNDZPs5NXEbtmlFTf88iqQyfGrLk=;
Message-ID: <fca5e0dd-5f71-4286-909b-db14551aa15a@xen.org>
Date: Tue, 27 Aug 2024 11:37:29 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 1/4] xen/arm: mpu: Introduce choice between MMU and MPU
Content-Language: en-GB
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240823163127.3443404-1-ayan.kumar.halder@amd.com>
 <20240823163127.3443404-2-ayan.kumar.halder@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20240823163127.3443404-2-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 23/08/2024 17:31, Ayan Kumar Halder wrote:
> There are features in the forthcoming patches which are dependent on
> MPU. For eg fixed start address.
> Also, some of the Xen features (eg STATIC_MEMORY) will be selected
> by the MPU configuration.
> 
> Thus, this patch introduces a choice between MMU and MPU for the type
> of memory management system. By default, MMU is selected.
> All the current platforms are now made dependent on MMU.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
>   xen/arch/arm/Kconfig           | 17 ++++++++++++++++-
>   xen/arch/arm/platforms/Kconfig |  2 +-
>   2 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index 323c967361..686948cefd 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -58,10 +58,25 @@ config PADDR_BITS
>   	default 40 if ARM_PA_BITS_40
>   	default 48 if ARM_64
>   
> +choice
> +	prompt "Memory management system"
> +	default MMU if ARM
> +	help
> +	  User can choose between the different forms of memory management system.
> +	  Most of the Arm based systems support MMU.

I feel this is quite subjective. So I would drop it.

> +
>   config MMU
> -	def_bool y
> +	bool "MMU"
>   	select HAS_PMAP
>   	select HAS_VMAP
> +	help
> +	  Memory management unit is supported on most Arm based systems.

For this case, I would write "Select it you are plan to run Xen on 
Armv7-A or Armv8-A".


> +
> +config MPU
> +	bool "MPU"

I think it should be gated by UNSUPPORTED. SUPPORT.md also needs to be 
updated.

> +	help
> +	  Memory protection unit is supported on some Cortex-R systems.

Why do you make this specific to Cortex-R? Shouldn't this instead be 
Armv8-R?

> +endchoice
>   
>   source "arch/Kconfig"
>   
> diff --git a/xen/arch/arm/platforms/Kconfig b/xen/arch/arm/platforms/Kconfig
> index 76f7e76b1b..02322c259c 100644
> --- a/xen/arch/arm/platforms/Kconfig
> +++ b/xen/arch/arm/platforms/Kconfig
> @@ -1,5 +1,5 @@
>   choice
> -	prompt "Platform Support"
> +	prompt "Platform Support" if MMU
>   	default ALL_PLAT
>   	help
>   	Choose which hardware platform to enable in Xen.

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 10:39:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 10:39:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783818.1193095 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sitbe-0004X8-Bb; Tue, 27 Aug 2024 10:39:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783818.1193095; Tue, 27 Aug 2024 10:39:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sitbe-0004X1-8J; Tue, 27 Aug 2024 10:39:22 +0000
Received: by outflank-mailman (input) for mailman id 783818;
 Tue, 27 Aug 2024 10:39:22 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sitbd-0004Wt-Tf
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 10:39:21 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9db15f36-6460-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 12:39:19 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a86a37208b2so471384266b.0
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 03:39:19 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e549cfa0sm92944166b.86.2024.08.27.03.39.18
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 03:39:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9db15f36-6460-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724755159; x=1725359959; 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=ctrfrExpz+Oj0q1oexd5kxaLdvB/HUnzI4skyoYGtmU=;
        b=LAMs+wnq7M5Toohx2Oy5CxDK+/VpjWO3rysN0iqajJKbB/N/b0cs6t/o9uHfgvZE4P
         7/+GxNGcYFjOHYvsgLRGPwX+u8trHTrnfxt25DUbWp0KVT5GoAC0c7K6J/RxqOZqjjpV
         i0FGlSVJV9Wzl4aQrC6w5SlHktraH3qulKfPw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724755159; x=1725359959;
        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=ctrfrExpz+Oj0q1oexd5kxaLdvB/HUnzI4skyoYGtmU=;
        b=GmQ6FFirRi9K7j2QrSbUpNtH7i75Si/mxswYWR4oWFnrjB08Io/LAKf/EDZXmkIXGx
         vJNmMOzVp8ThcGpfL848v7JlG/lWxBFUjuGQlg1QrETLotfR2616qKfm+Xcq4Z00dKCL
         ERey0xjTSdv04nlp6CmG8vK96Ycdkfds5PPmWkz+MkZSHWAH+cPKgokUVSGVkXPm01O9
         Q48+hNdzv8RAzNbDWNysv/QVWmOycE9vcasPRUSHKXXwS1fJV8O7bn4SWX7axr3ddDUy
         j2uvfOZ69zHI/6qZsg0353tLrvEydSSSM2b1UPxkor2UY0622FMu9vg/rsiUmRWJavnE
         EYRQ==
X-Forwarded-Encrypted: i=1; AJvYcCVUklBPytW2hH5YBKSW+sY0CWzNt4tJSMirm9ySyF5KUNSXYKNYDSatslmXtQnkeiQTwo6wrmWuNJc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxCYzYrcB4U8/tEpV0zj7ED5PwEkkZE0Qoc0MniwNGncNPioKpS
	K37IHdz2NEaYYmnEC3GmLtpwM8Qy9RlkUryHG3nX/EAPJ2UQmMGgwByrPKdUOYc=
X-Google-Smtp-Source: AGHT+IEj8i3/oHZmFDGqhAxy04z7QVd6LYfkyUgerv1wHgtxU87NmHxIsXfyOAbCnAMtpuiu6pQDVA==
X-Received: by 2002:a17:907:1b1b:b0:a7a:9144:e23a with SMTP id a640c23a62f3a-a86a54a9963mr1004678266b.43.1724755158817;
        Tue, 27 Aug 2024 03:39:18 -0700 (PDT)
Message-ID: <f5bac01b-74d6-41c4-b3c5-ad595d6de378@citrix.com>
Date: Tue, 27 Aug 2024 11:39:16 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 5/9] xen/bitops: Introduce generic_hweightl() and
 hweightl()
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-6-andrew.cooper3@citrix.com>
 <14c385ce-c61d-48e3-aa09-7b450af34b6c@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <14c385ce-c61d-48e3-aa09-7b450af34b6c@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 26/08/2024 12:40 pm, Jan Beulich wrote:
> On 23.08.2024 01:06, Andrew Cooper wrote:
> --- a/xen/include/xen/bitops.h
> +++ b/xen/include/xen/bitops.h
> @@ -35,6 +35,12 @@ extern void __bitop_bad_size(void);
>  unsigned int __pure generic_ffsl(unsigned long x);
>  unsigned int __pure generic_flsl(unsigned long x);
>  
>> +/*
>> + * Hamming Weight, also called Population Count.  Returns the number of set
>> + * bits in @x.
>> + */
>> +unsigned int __pure generic_hweightl(unsigned long x);
> Aren't this and ...
>
>> @@ -284,6 +290,18 @@ static always_inline __pure unsigned int fls64(uint64_t x)
>>          (_v & (_v - 1)) != 0;                   \
>>      })
>>  
>> +static always_inline __pure unsigned int hweightl(unsigned long x)
> ... this even __attribute_const__?

Hmm.  This is following fls(), but on further consideration, they should
be const too.

I'll do a prep patch fixing that, although I'm going to rename it to
__attr_const for brevity.

Much as I'd prefer __const, I expect that is going too far, making it
too close to regular const.

>
>> +{
>> +    if ( __builtin_constant_p(x) )
>> +        return __builtin_popcountl(x);
> How certain are you that compilers (even old ones) will reliably fold
> constant expressions here, and never emit a libgcc call instead? The
> conditions look to be more tight than just __builtin_constant_p(); a
> pretty absurd example:
>
> unsigned ltest(void) {
>     return __builtin_constant_p("") ? __builtin_popcountl((unsigned long)"") : ~0;
> }

How do you express that in terms of a call to hweightl()?

Again, this is following the layout started with fls() in order to avoid
each arch opencoding different versions of constant folding.

https://godbolt.org/z/r544c49oY

When it's forced through the hweightl() interface, even GCC 4.1 decides
that it's non-constant and falls back to generic_hweightl().


I did spend a *lot* of time with the fls() series checking that all
compilers we supported did what we wanted in this case, so I don't
expect it to be a problem.  But, if a library call is emitted, it will
be very obvious (link failure), and we can re-evaluate.


>
>> --- /dev/null
>> +++ b/xen/lib/generic-hweightl.c
>> @@ -0,0 +1,46 @@
>> +/* SPDX-License-Identifier: GPL-2.0-only */
>> +
>> +#include <xen/bitops.h>
>> +#include <xen/init.h>
>> +#include <xen/self-tests.h>
>> +
>> +/* Mask value @b broadcast to every byte in a long */
>> +#if BITS_PER_LONG == 32
>> +# define MASK(b) ((b) * 0x01010101UL)
>> +#elif BITS_PER_LONG == 64
>> +# define MASK(b) ((b) * 0x0101010101010101UL)
>> +#else
>> +# error Extend me please
>> +#endif
>> +
>> +unsigned int generic_hweightl(unsigned long x)
>> +{
>> +    x -= (x >> 1) & MASK(0x55);
>> +    x =  (x & MASK(0x33)) + ((x >> 2) & MASK(0x33));
>> +    x =  (x + (x >> 4)) & MASK(0x0f);
>> +
>> +    if ( IS_ENABLED(CONFIG_HAS_FAST_MULTIPLY) )
>> +        return (x * MASK(0x01)) >> (BITS_PER_LONG - 8);
> I realize it's nitpicking, yet especially this use isn't really "mask"-
> like. Could I talk you into naming the macro e.g. BCST()?

Ok - I wasn't overly happy with the name MASK(), and BCST() is better.

>
>> +    x += x >> 8;
>> +    x += x >> 16;
>> +#if BITS_PER_LONG > 32
>> +    x += x >> 32;
>> +#endif
>> +
>> +    return x & 0xff;
>> +}
> Perhaps #undef MASK here, or else ...
>
>> +#ifdef CONFIG_SELF_TESTS
>> +static void __init __constructor test_generic_hweightl(void)
>> +{
>> +    RUNTIME_CHECK(generic_hweightl, 0, 0);
>> +    RUNTIME_CHECK(generic_hweightl, 1, 1);
>> +    RUNTIME_CHECK(generic_hweightl, 3, 2);
>> +    RUNTIME_CHECK(generic_hweightl, 7, 3);
>> +    RUNTIME_CHECK(generic_hweightl, 0xff, 8);
>> +
>> +    RUNTIME_CHECK(generic_hweightl, 1 | (1UL << (BITS_PER_LONG - 1)), 2);
>> +    RUNTIME_CHECK(generic_hweightl, -1UL, BITS_PER_LONG);
>> +}
> ... actually use it some here, to have a few more cases?

Hmm, why not.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 10:40:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 10:40:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783823.1193105 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sitcI-00057r-JI; Tue, 27 Aug 2024 10:40:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783823.1193105; Tue, 27 Aug 2024 10:40:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sitcI-000577-Gi; Tue, 27 Aug 2024 10:40:02 +0000
Received: by outflank-mailman (input) for mailman id 783823;
 Tue, 27 Aug 2024 10:40:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sitcH-00051Z-3o; Tue, 27 Aug 2024 10:40:01 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sitcH-0004AN-25; Tue, 27 Aug 2024 10:40:01 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sitcG-0003US-KH; Tue, 27 Aug 2024 10:40:00 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sitcG-0004Fe-Ju; Tue, 27 Aug 2024 10:40:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=lC1Okp+wDdu69DiQ/EfS7SQUQyLcKDlPuzG3awTteFo=; b=bJJUmMfxfwb8DhaKVvqMo1i545
	XMW6vA3AJgSv1bYzHwrnJ+w4Eax2MD04UChVRleW1AOHYrWpK5dWZ5rdQe8bKYzgF/r30TCU+NdU8
	JAGeSSsvmuvSjS++rhRROCXH/KTz00aOW2rLHBhmY91vmmFO+F9WAAuFWyZCbbEHoOp8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187355-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187355: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:hosts-allocate:starved:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:hosts-allocate:starved:nonblocking
    xen-unstable:test-arm64-arm64-xl:hosts-allocate:starved:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:hosts-allocate:starved:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:hosts-allocate:starved:nonblocking
X-Osstest-Versions-This:
    xen=b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b
X-Osstest-Versions-That:
    xen=b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 27 Aug 2024 10:40:00 +0000

flight 187355 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187355/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 187350

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187350
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187350
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187350
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187350
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187350
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187350
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm       3 hosts-allocate           starved in 187350 n/a
 test-arm64-arm64-xl-credit2   3 hosts-allocate           starved in 187350 n/a
 test-arm64-arm64-xl           3 hosts-allocate           starved in 187350 n/a
 test-arm64-arm64-xl-vhd       3 hosts-allocate           starved in 187350 n/a
 test-arm64-arm64-xl-thunderx  3 hosts-allocate           starved in 187350 n/a

version targeted for testing:
 xen                  b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b
baseline version:
 xen                  b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b

Last test of basis   187355  2024-08-27 01:55:42 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 11:17:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 11:17:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783839.1193116 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siuCQ-0004Zh-DR; Tue, 27 Aug 2024 11:17:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783839.1193116; Tue, 27 Aug 2024 11:17:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siuCQ-0004Za-9p; Tue, 27 Aug 2024 11:17:22 +0000
Received: by outflank-mailman (input) for mailman id 783839;
 Tue, 27 Aug 2024 11:17:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siuCP-0004ZQ-Kq; Tue, 27 Aug 2024 11:17:21 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siuCP-0004tv-CG; Tue, 27 Aug 2024 11:17:21 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siuCO-0004dS-MI; Tue, 27 Aug 2024 11:17:20 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1siuCO-0002Uw-M0; Tue, 27 Aug 2024 11:17:20 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=yqkXvS4PlIoTpBeX0jLBfHMcP5rHF50zbcFN22/EM+Y=; b=AJ3ExVa8oKeg1XjDVZUKHP3xoV
	j9Po9w/RUsXTePiIO5Sc1nu6GHxBg7EIS7orgh5sjp7Fr69T3/yNcO5gPzapTmjgvb5YIEmc0GcT2
	329DsRfAJitI3BNfXYrw1u2Fm7SvUetMm6GxD7I8kUulkXUCjBZY+tJL31r7dFYwdf/Y=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187362-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187362: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=ccda91c28628aa70bca614f1f7b71ad7b5ca61e0
X-Osstest-Versions-That:
    ovmf=5a06afa7dd8ba8e99178fec9525be9e3fd2a4d3a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 27 Aug 2024 11:17:20 +0000

flight 187362 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187362/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 ccda91c28628aa70bca614f1f7b71ad7b5ca61e0
baseline version:
 ovmf                 5a06afa7dd8ba8e99178fec9525be9e3fd2a4d3a

Last test of basis   187361  2024-08-27 06:16:29 Z    0 days
Testing same since   187362  2024-08-27 09:15:18 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Michael G.A. Holland <michael.holland@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   5a06afa7dd..ccda91c286  ccda91c28628aa70bca614f1f7b71ad7b5ca61e0 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 11:17:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 11:17:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783842.1193125 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siuCZ-0004qW-OF; Tue, 27 Aug 2024 11:17:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783842.1193125; Tue, 27 Aug 2024 11:17:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siuCZ-0004qN-LT; Tue, 27 Aug 2024 11:17:31 +0000
Received: by outflank-mailman (input) for mailman id 783842;
 Tue, 27 Aug 2024 11:17:30 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1siuCX-0004pf-Vj
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 11:17:30 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f184382f-6465-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 13:17:27 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5bed83488b3so6234485a12.0
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 04:17:27 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb481ba6sm880610a12.83.2024.08.27.04.17.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 04:17:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f184382f-6465-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724757447; x=1725362247; 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=jMisr3fOnVnm/3N7Ng/Fi9GXs4hmC337wybxWwBblUw=;
        b=RF5lwR+tiw16LhRd34UBFb1PIdzjsz3iMipuE+0+FpO2D6z0wwEqFjqa7/E9F+biQb
         MoKiUzJ5cp6bddtxil5NBa9TNSKqpraLOIm3XkYb5/Qud/mTJAyTg2P8V8IvqUy4ySPJ
         5i8JSwr/5ZGkz4ekrunqxAhM0TvPm554xXJqY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724757447; x=1725362247;
        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=jMisr3fOnVnm/3N7Ng/Fi9GXs4hmC337wybxWwBblUw=;
        b=TG4Uc6MGeHtcUNUCMttW3YywP/9tWZclhJXGiYeJDPUG5ucmYTfG4FaaC2JN+4MR8m
         3a5F6NsngROiVeYNqukUdZohxrW+stb7HESeV3UfeFGJD4yNgv0LcsXfXp/uUPrcCW5K
         tVKXa3ybrRRS7TJjO+rs0vEJ/d8+Ig3odfRWpHUTd5lixzCFDidbL6MRb7/Ur6ifVciQ
         ST0G4yncecs+cztBWFYZhB/SQqhEl9PGJpTQ0kd2R6GC6DS+hvCruGQYHR8ZR2rfe0J5
         8SW5Z2YODSkgmDG08+o5ASREa7nXoT22xz4lqKIQgV34s7yNVNpFr7k3K0ujhyjhI8p3
         UmIA==
X-Forwarded-Encrypted: i=1; AJvYcCUPzXdPx7vOESCZlxGVEMi+Q6ucZ/NI33SmgiVS3gtTHGxMFzwjereRMR/ek1kG4XBm21xc5uihh74=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyvwXUSEtLfhw7txjCIATbQVU12pjQdxWDTGsr7AhOEq4IMN804
	x5N5f/1pJbVfm0Pj8LEzCnqxlMnMXaDhS4Nmilq9963InavkVPO48Y9h00JNfFs=
X-Google-Smtp-Source: AGHT+IGyt3tvH2mSQIS8K9YpfhnaW8r/AJ4chfbezk4knKoVrA4a5lMWs6lafit167cBfImjn8s+SQ==
X-Received: by 2002:a05:6402:518d:b0:5c0:99ff:7c85 with SMTP id 4fb4d7f45d1cf-5c099ff84b0mr7374631a12.18.1724757446909;
        Tue, 27 Aug 2024 04:17:26 -0700 (PDT)
Message-ID: <3300b035-46d7-41d3-9908-1a0093c433e8@citrix.com>
Date: Tue, 27 Aug 2024 12:17:24 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 9/9] x86/bitops: Use the POPCNT instruction when available
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-10-andrew.cooper3@citrix.com>
 <03febf18-516b-4677-a0a5-102036c91a29@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <03febf18-516b-4677-a0a5-102036c91a29@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 26/08/2024 2:07 pm, Jan Beulich wrote:
> On 23.08.2024 01:06, Andrew Cooper wrote:
>> A few RFC points.
>>
>>  * I throught we had an x86 general lib-y but I can't find one, hence why it's
>>    still in xen/lib/ for now.
> We indeed have nothing like that yet. The file name should then imo not be
> arch-* though, but x86-*. Or you could put it in xen/lib/x86/.

I was worried about xen/lib/x86/ and interfering with userspace.

> It could even
> be obj-y rather than lib-y, unless you expect we'll be able to get rid of
> all uses, which seems unlikely at least due to bitmap_weight(). Otoh with
> my ABI-level series the call site in arch_hweightl() could then be made go
> away for v2 and above, at which point it living in lib-y will be preferable.

Yes, I was specifically trying to account for this.

I'm expecting the mandatory-popcnt work to end up looking something like:

diff --git a/xen/arch/x86/include/asm/bitops.h
b/xen/arch/x86/include/asm/bitops.h
index 0db698ed3f4c..027eda60c094 100644
--- a/xen/arch/x86/include/asm/bitops.h
+++ b/xen/arch/x86/include/asm/bitops.h
@@ -480,6 +480,9 @@ static always_inline unsigned int
arch_hweightl(unsigned long x)
 {
     unsigned int r;
 
+    if ( IS_ENABLED(CONFIG_REQUIRE_POPCNT /* or whatever */) )
+        return __builtin_popcountl(x);
+
     /*
      * arch_generic_hweightl() is written in ASM in order to preserve all
      * registers, as the compiler can't see the call.


which in turn DCE's the alternative_io() and drops the reference to
arch_generic_hweightl().

>
>>  * When we up the minimum toolchain to GCC 7 / Clang 5, we can use a
>>    __attribute__((no_caller_saved_registers)) and can forgo writing this in asm.
>>
>>    GCC seems to need extra help, and wants -mgeneral-regs-only too.  It has a
>>    habit of complaining about incompatible instructions even when it's not
>>    emitting them.
> What is this part about? What incompatible instructions, in particular?

This was weird.  https://godbolt.org/z/4z1qzWbfE is an example.

>
>> @@ -475,4 +476,24 @@ static always_inline unsigned int arch_flsl(unsigned long x)
>>  }
>>  #define arch_flsl arch_flsl
>>  
>> +static always_inline unsigned int arch_hweightl(unsigned long x)
>> +{
>> +    unsigned int r;
>> +
>> +    /*
>> +     * arch_generic_hweightl() is written in ASM in order to preserve all
>> +     * registers, as the compiler can't see the call.
>> +     *
>> +     * This limits the POPCNT instruction to using the same ABI as a function
>> +     * call (input in %rdi, output in %eax) but that's fine.
>> +     */
>> +    alternative_io("call arch_generic_hweightl",
>> +                   "popcnt %[val], %q[res]", X86_FEATURE_POPCNT,
>> +                   ASM_OUTPUT2([res] "=a" (r) ASM_CALL_CONSTRAINT),
>> +                   [val] "D" (x));
> If you made [val] an output ("+D") you could avoid preserving the register
> in the function. And I'd expect the register wouldn't be re-used often
> afterwards, so its clobbering likely won't harm code quality very much.

"+D" means it's modified by the asm, which forces preservation of the
register, if it's still needed afterwards.

Plain "D" means not modified by the asm, which means it can be reused if
necessary.

>
>> --- /dev/null
>> +++ b/xen/lib/arch-generic-hweightl.S
>> @@ -0,0 +1,46 @@
>> +/* SPDX-License-Identifier: GPL-2.0 */
>> +
>> +        .file __FILE__
>> +
>> +#include <xen/linkage.h>
>> +
>> +/*
>> + * An implementation of generic_hweightl() used on hardware without the POPCNT
>> + * instruction.
>> + *
>> + * This function is called from within an ALTERNATIVE in arch_hweightl().
>> + * i.e. behind the back of the compiler.  Therefore all registers are callee
>> + * preserved.
>> + *
>> + * The ASM is what GCC-12 emits for generic_hweightl() in a release build of
>> + * Xen, with spilling of %rdi/%rdx to preserve the callers registers.
>> + */
>> +FUNC(arch_generic_hweightl)
>> +        push   %rdi
>> +        push   %rdx
>> +
>> +        movabs $0x5555555555555555, %rdx
>> +        mov    %rdi, %rax
>> +        shr    $1, %rax
>> +        and    %rdx, %rax
>> +        sub    %rax, %rdi
>> +        movabs $0x3333333333333333, %rax
>> +        mov    %rdi, %rdx
>> +        shr    $0x2, %rdi
> Could I talk you into omitting the 0x here and ...
>
>> +        and    %rax, %rdx
>> +        and    %rax, %rdi
>> +        add    %rdi, %rdx
>> +        mov    %rdx, %rax
>> +        shr    $0x4, %rax
> ... here, and maybe use ...
>
>> +        add    %rdx, %rax
>> +        movabs $0xf0f0f0f0f0f0f0f, %rdx
>> +        and    %rdx, %rax
>> +        movabs $0x101010101010101, %rdx
>> +        imul   %rdx, %rax
>> +        shr    $0x38, %rax
> ... 56 here (or even BITS_PER_LONG-8)?

Ok.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 11:20:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 11:20:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783853.1193136 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siuF8-0006ay-45; Tue, 27 Aug 2024 11:20:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783853.1193136; Tue, 27 Aug 2024 11:20:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siuF8-0006ar-1G; Tue, 27 Aug 2024 11:20:10 +0000
Received: by outflank-mailman (input) for mailman id 783853;
 Tue, 27 Aug 2024 11:20: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=S7uN=P2=redhat.com=pabeni@srs-se1.protection.inumbo.net>)
 id 1siuF6-0006ag-O4
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 11:20:08 +0000
Received: from us-smtp-delivery-124.mimecast.com
 (us-smtp-delivery-124.mimecast.com [170.10.133.124])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4f471e9e-6466-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 13:20:06 +0200 (CEST)
Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com
 [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 us-mta-106-4CcvQ24IMS6xZFI4mXcidg-1; Tue, 27 Aug 2024 07:20:03 -0400
Received: by mail-wr1-f71.google.com with SMTP id
 ffacd0b85a97d-3718e1d1847so3188568f8f.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 04:20:03 -0700 (PDT)
Received: from ?IPV6:2a0d:3344:1b67:7410::f71? ([2a0d:3344:1b67:7410::f71])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-3730813c459sm12768823f8f.27.2024.08.27.04.20.00
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 04:20:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4f471e9e-6466-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1724757604;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=MECBd/hSEibWGsRQlj3xvU/VnK1E0855dY6x5mvZ7gA=;
	b=cZsxPebUTcTccSil891HpRKkkxE9xMsSmYdGVUTikml66Dh0ix5Fx8Inm/9izE9BPBytit
	ZxrPx+0rKcjbhSVO0PsxjZtfERMxFxBXp0ScOBD/cg/JU8iWTMgcMgv1+DmvLS2/9E7ZIg
	zpvv0CCQpacFDqFo/o7wTrP5uwEu3Jg=
X-MC-Unique: 4CcvQ24IMS6xZFI4mXcidg-1
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724757602; x=1725362402;
        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=MECBd/hSEibWGsRQlj3xvU/VnK1E0855dY6x5mvZ7gA=;
        b=dxhc57TcWgIHEVeh0yCHa5dwFmaj6rOrbKL0rX2l4YUfMcuGKCU7p9TsHa4ARc6RCy
         L+wrUzdWfvGUilZYyXxRR/mcIOIwo0kg+OdGaYU4ANLWRh3cZioKWbYrI/YzkCtQPBKX
         vdEh5zRFnIkgYduYOLEbDAmVIr/MIY2w4HROZwS9ssvulKgUaWxF7WRhJJTTGqIgBSWK
         ezKKIM5JAx6fax6WIj8cUBAUEwGHyLK7eawvp+aCGiPPPlDud+tNxXgrm1xwd+x8xVBu
         RLx43pqSPhXfQf8WNUVw1t9F/t4Axbwf/mqqlt23QGrDv+uhQ4Pflrj3lZ3GxGKLryn8
         XLNw==
X-Forwarded-Encrypted: i=1; AJvYcCWeUbtGKXFwL2LQGJQPAb1KD2xbHLbfsP0VBxjsjb9JwexCdW+NB8+VGDei2nmoN9rZYxOyB6TtcpE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxOpCRSxSnczvFBxTdlAu9g2BQVIVjZC9bVlUlwmQKYiJF9Qosq
	cAjTuUZ6LiIi5jWacoAHZg5pyNAWvuEmosLdQIYKEXRX7YNvJL0l5n8pwjwEBvzt1aT7l/EJWY7
	Mo6bSLK4O+BLOH3NWkPfmcK7uqX1QrD+ZSY2HDclkXLJFySz9CT5sY1mI2srg54Ng
X-Received: by 2002:a5d:4e10:0:b0:371:8e9c:e608 with SMTP id ffacd0b85a97d-373118e3327mr10656412f8f.52.1724757602093;
        Tue, 27 Aug 2024 04:20:02 -0700 (PDT)
X-Google-Smtp-Source: AGHT+IFYvhXTuSl+sI44eFe058b0E+jARsnoT9juypCVTahh5G9OkBjlQCUYH8EuqxJDKhKuXE431g==
X-Received: by 2002:a5d:4e10:0:b0:371:8e9c:e608 with SMTP id ffacd0b85a97d-373118e3327mr10656385f8f.52.1724757601665;
        Tue, 27 Aug 2024 04:20:01 -0700 (PDT)
Message-ID: <fd2a06d5-370f-4e07-af84-cab089b82a4b@redhat.com>
Date: Tue, 27 Aug 2024 13:19:59 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH net] net/xen-netback: prevent UAF in xenvif_flush_hash()
To: Jeongjun Park <aha310510@gmail.com>, wei.liu@kernel.org, paul@xen.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
 madhuparnabhowmik04@gmail.com, xen-devel@lists.xenproject.org,
 netdev@vger.kernel.org, linux-kernel@vger.kernel.org
References: <20240822181109.2577354-1-aha310510@gmail.com>
From: Paolo Abeni <pabeni@redhat.com>
In-Reply-To: <20240822181109.2577354-1-aha310510@gmail.com>
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Language: en-US
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 8/22/24 20:11, Jeongjun Park wrote:
> During the list_for_each_entry_rcu iteration call of xenvif_flush_hash,
> kfree_rcu does not exist inside the rcu read critical section, so if

The above wording is confusing, do you mean "kfree_rcu does not exit 
from "...?

> kfree_rcu is called when the rcu grace period ends during the iteration,
> UAF occurs when accessing head->next after the entry becomes free.

The loop runs with irq disabled, the RCU critical section extends over 
it, uninterrupted.

Do you have a splat for the reported UAF?

This does not look the correct solution.

Thanks,

Paolo



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 11:24:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 11:24:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783857.1193146 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siuJ3-0007AU-Jr; Tue, 27 Aug 2024 11:24:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783857.1193146; Tue, 27 Aug 2024 11:24:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siuJ3-0007AF-GZ; Tue, 27 Aug 2024 11:24:13 +0000
Received: by outflank-mailman (input) for mailman id 783857;
 Tue, 27 Aug 2024 11:24:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siuJ2-00079W-TM
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 11:24:12 +0000
Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com
 [2a00:1450:4864:20::62d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e1d5e162-6466-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 13:24:11 +0200 (CEST)
Received: by mail-ej1-x62d.google.com with SMTP id
 a640c23a62f3a-a868d7f92feso680553566b.2
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 04:24:11 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e5486a13sm98514266b.35.2024.08.27.04.24.09
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 04:24:10 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e1d5e162-6466-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724757850; x=1725362650; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=bJeGLICq/VGrPxHSRrfG3WmFK4/PlFbrk7T2o45JTWM=;
        b=KWY6iSLRT3vku7gXrr2auEdmNaZtlYjmDLTP6JaKiOztIqRZC2T/NQqNzw2tcd6Mgf
         9T4tB5HxxfYdQYz9GSiOvcsh5lsX91UdkWWHf5vJ9M4yFvUYO7eJqcskNlQQ2oHofgcs
         fB6GOSMQQZPcYyFDiTdYK/TwnuAguMZFdfzgcJ6XmrV/ZLxoUvRAyEjFkXO0n5vcF9X2
         jD3szeb3KpqNp5DI3ENA0ly2FE8s6tZrJJLQprp7Nwd11cgXQakaIwODjawAlRtlkD0G
         ZlMP9k3mokesL9o0w9LziUTS8i3FOHYUQUCY55EE2vnRDe1V+rPZUN8P5CE/b0yX1Hkg
         0XPA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724757850; x=1725362650;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=bJeGLICq/VGrPxHSRrfG3WmFK4/PlFbrk7T2o45JTWM=;
        b=CI7jpgILB9exBwaXTqHjqSAwBxmAQ2wpTmdlDA1rIjFzZEIuD4QuhheuZmCOAXk1JS
         UJ1FVRApOqQZCCsWiTvgqzb12hXwkkIF0VemOyL88PoRBrKyOpc3EeJ3MIEJvuYOZo8B
         f/GOUE7nXGrhFfe/NK5AkuwjkSJB0cdZmbMApB0CQgUWu5evcQc4hDwhWl1vgepdA2J3
         YQPAZQl9BMrdoEwDWTn/uYQZCdZtQ/CGv365Lwd4RpABnJri3VnWW4soeyixdfBR4c8l
         +EaYgYPtW6iLLc6K/mE+UjTbo4EwbGa4dp2ZTRi6/P9XKWyXjkyKASvUk8fzFztoW66D
         GIaQ==
X-Gm-Message-State: AOJu0YxYImWtK5Xbuy9BN0073Y/knVwl6iFBlIkl+VFiWCj/aoGqvu1g
	TbTXfs6uAO7ftv5zefW1ti6LdebGkKhTolCqTGiTlST+oDrKzuhxJjtlOIZyz5AgN38w8wtYEsQ
	=
X-Google-Smtp-Source: AGHT+IHlb0dnYZby6JoK7a6ZKHxrx/rB4F+6t20l+LrJ7dSd4mArrZA6bGqUpU3AF1jfm4oNf7UVFQ==
X-Received: by 2002:a17:906:c10c:b0:a86:ac05:2112 with SMTP id a640c23a62f3a-a86ac0523bbmr958251566b.51.1724757850446;
        Tue, 27 Aug 2024 04:24:10 -0700 (PDT)
Message-ID: <9043d8bd-ad98-4de1-ac52-70f8e4daf14a@suse.com>
Date: Tue, 27 Aug 2024 13:24:09 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86emul: drop further Xeon Phi decode leftovers
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Special casing in x86emul_decode() can be dropped, while overrides done
in decode_0f38() can move into ext0f38_table[]. That table's S/G
prefetch entries aren't needed anymore either.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/x86_emulate/decode.c
+++ b/xen/arch/x86/x86_emulate/decode.c
@@ -427,13 +427,11 @@ static const struct ext0f38_table {
     [0xbe] = { .simd_size = simd_packed_fp, .d8s = d8s_vl },
     [0xbf] = { .simd_size = simd_scalar_vexw, .d8s = d8s_dq },
     [0xc4] = { .simd_size = simd_packed_int, .two_op = 1, .d8s = d8s_vl },
-    [0xc6 ... 0xc7] = { .simd_size = simd_other, .vsib = 1, .d8s = d8s_dq },
     [0xc8] = { .simd_size = simd_packed_fp, .two_op = 1, .d8s = d8s_vl },
     [0xc9] = { .simd_size = simd_other },
     [0xca] = { .simd_size = simd_packed_fp, .two_op = 1, .d8s = d8s_vl },
-    [0xcb] = { .simd_size = simd_scalar_vexw, .d8s = d8s_dq },
-    [0xcc] = { .simd_size = simd_packed_fp, .two_op = 1, .d8s = d8s_vl },
-    [0xcd] = { .simd_size = simd_scalar_vexw, .d8s = d8s_dq },
+    [0xcb] = { .simd_size = simd_other, .d8s = d8s_vl },
+    [0xcc ... 0xcd] = { .simd_size = simd_other, .two_op = 1, .d8s = d8s_vl },
     [0xcf] = { .simd_size = simd_packed_int, .d8s = d8s_vl },
     [0xd2] = { .simd_size = simd_other },
     [0xd3] = { .simd_size = simd_other },
@@ -918,14 +916,6 @@ decode_0f38(struct x86_emulate_state *s,
     case X86EMUL_OPC_EVEX_66(0, 0x7c): /* vpbroadcast{d,q} */
         break;
 
-    case X86EMUL_OPC_VEX_F2(0, 0xcc): /* vsha512msg1 */
-    case X86EMUL_OPC_VEX_F2(0, 0xcd): /* vsha512msg2 */
-        s->desc |= TwoOp;
-        /* fallthrough */
-    case X86EMUL_OPC_VEX_F2(0, 0xcb): /* vsha512rnds2 */
-        s->simd_size = simd_other;
-        break;
-
     case 0xf0: /* movbe / crc32 */
         s->desc |= s->vex.pfx == vex_f2 ? ByteOp : Mov;
         if ( s->vex.pfx >= vex_f3 )
@@ -1421,20 +1411,6 @@ int x86emul_decode(struct x86_emulate_st
                                                    s);
                     s->simd_size = simd_other;
                 }
-
-                switch ( b )
-                {
-                /* vp4dpwssd{,s} need special casing */
-                case 0x52: case 0x53:
-                /* v4f{,n}madd{p,s}s need special casing */
-                case 0x9a: case 0x9b: case 0xaa: case 0xab:
-                    if ( s->evex.pfx == vex_f2 )
-                    {
-                        disp8scale = 4;
-                        s->simd_size = simd_128;
-                    }
-                    break;
-                }
             }
             break;
 


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 11:40:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 11:40:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783866.1193156 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siuYX-0002r5-TK; Tue, 27 Aug 2024 11:40:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783866.1193156; Tue, 27 Aug 2024 11:40:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siuYX-0002qy-QC; Tue, 27 Aug 2024 11:40:13 +0000
Received: by outflank-mailman (input) for mailman id 783866;
 Tue, 27 Aug 2024 11:40:13 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1siuYX-0002qs-Bd
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 11:40:13 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1e26772a-6469-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 13:40:11 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5bed83488b3so6259225a12.0
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 04:40:11 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e5484ff7sm98682366b.45.2024.08.27.04.40.09
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 27 Aug 2024 04:40:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1e26772a-6469-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724758810; x=1725363610; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=RDmZvKQ6fjiLWHIUIGLrzY14fFzTra7oQYlpHWiCvvQ=;
        b=u6yxaSSID14d2DyB9WyRCdvVsB++9DNfLtt2VPfUrmopL8CYd7AgXnAtDVMMPWJbLi
         FKSnGNVhDqFwwIhFwF0p7GYqmwcDwkBYP9+gd7ySPXJRNLUzRuCCzWhfCxtD8AnqRPt8
         OiwO9Zmikt7QmE32yN3mYsxxqZZ5l4UwWxGhM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724758810; x=1725363610;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=RDmZvKQ6fjiLWHIUIGLrzY14fFzTra7oQYlpHWiCvvQ=;
        b=SVH91yV1Qkd5lV0+iXuptFjmNhZJ7P77IijVMXQiNL8JKfNTQDBr0tSJxhWNVH+6Zb
         Suazoj5FxtDM8YRC5gg6Ad4FvwqFuER+uxhgIJrkdWnEB5Bx+HVVnEaEIMOKMnvkX5ni
         DY85zyM47GzE58lDV4ZblVteUBS+hg+ws/sskTB9uJQqppzf1Hdl0RiR+FEOiNIiewAz
         g3eloSV54SUfdPC5nXIinShAS8BIV7rQvTY5zuSihndR2EHJznMa4cYWcjmZ5o8CRKEA
         bkgWBF4bpIRfD5Zx9EqG23anbHHT1i8TK5OwoMBUbWRhkX2oA62vriYnGooeY+nQ5Q2y
         AIMQ==
X-Gm-Message-State: AOJu0Yw9fnuhS2RWSnUuTv5DymLOOyYx0QDvAOJcvvRgNmEFC4iSt657
	Ahcsl48ELpZzJdAW7Gbh5gVxUQQhY4wrU0ZmxQEeOfqjp7Up4RLbfx5fmNkM4LKSCTqyJKJbhbd
	2
X-Google-Smtp-Source: AGHT+IHhou3lu8mGOt542ce9wqfSxSoeBy93QDNjsmKOcFUCIKJO3nCYgDIwtrHrSegpg+fVh0Glag==
X-Received: by 2002:a17:907:da2:b0:a86:a73e:7ec9 with SMTP id a640c23a62f3a-a86a73e81ffmr955395866b.46.1724758809974;
        Tue, 27 Aug 2024 04:40:09 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>
Subject: [PATCH] xen/ARM: Drop __div64_fls()
Date: Tue, 27 Aug 2024 12:40:07 +0100
Message-Id: <20240827114007.1886130-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Following the improvements to Xen's bitops, fls() does constant propagation in
all cases.  Use it, and drop the local opencoded helper.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>

ARM32 gets a very minor code generation improvement:

  xen.git/xen$ ../scripts/bloat-o-meter xen-syms-arm32-{before,after}
  add/remove: 0/0 grow/shrink: 0/6 up/down: 0/-48 (-48)
  Function                                     old     new   delta
  wallclock_time                               288     280      -8
  printk_start_of_line                         560     552      -8
  domain_vtimer_init                           472     464      -8
  do_settime                                   376     368      -8
  burn_credits                                 760     752      -8
  __printk_ratelimit                           424     416      -8

But it's just a couple of operations improvement and no real change in code
structure.  I expect that the constant propagation being done through
__builtin_clz(), rather than pure C, is giving the optimiser a bit more
information to work with.

This file also has an __GNUC__ < 4 case which seems ripe for removing...
---
 xen/arch/arm/include/asm/div64.h | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/include/asm/div64.h b/xen/arch/arm/include/asm/div64.h
index 0459d5cc0122..da1f1fcbd503 100644
--- a/xen/arch/arm/include/asm/div64.h
+++ b/xen/arch/arm/include/asm/div64.h
@@ -102,7 +102,7 @@
 		/* preserve low part of n for reminder computation */	\
 		__r = __n;						\
 		/* determine number of bits to represent __b */		\
-		__p = 1 << __div64_fls(__b);				\
+		__p = 1 << fls(__b);					\
 		/* compute __m = ((__p << 64) + __b - 1) / __b */	\
 		__m = (~0ULL / __b) * __p;				\
 		__m += (((~0ULL % __b + 1) * __p) + __b - 1) / __b;	\
@@ -150,8 +150,8 @@
 				__p /= (__m & -__m);			\
 				__m /= (__m & -__m);			\
 			} else {					\
-				__p >>= __div64_fls(__bits);		\
-				__m >>= __div64_fls(__bits);		\
+				__p >>= fls(__bits);			\
+				__m >>= fls(__bits);			\
 			}						\
 			/* No correction needed. */			\
 			__c = 0;					\
@@ -217,18 +217,6 @@
 	__r;								\
 })
 
-/* our own fls implementation to make sure constant propagation is fine */
-#define __div64_fls(bits)						\
-({									\
-	unsigned int __left = (bits), __nr = 0;				\
-	if (__left & 0xffff0000) __nr += 16, __left >>= 16;		\
-	if (__left & 0x0000ff00) __nr +=  8, __left >>=  8;		\
-	if (__left & 0x000000f0) __nr +=  4, __left >>=  4;		\
-	if (__left & 0x0000000c) __nr +=  2, __left >>=  2;		\
-	if (__left & 0x00000002) __nr +=  1;				\
-	__nr;								\
-})
-
 #endif /* GCC version */
 
 #endif /* BITS_PER_LONG */

base-commit: b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b
prerequisite-patch-id: 57ffe02b03d27a12f20d9e08fa21eed01c8c6299
prerequisite-patch-id: 56393fef18638a92eae127f36ffddb655fc7b9f4
prerequisite-patch-id: 4f963f44331104dc00663f8ff22bd306ef04f301
prerequisite-patch-id: 81a434352bbb36e17d3b7a45f489974fc4603ecb
prerequisite-patch-id: f2f2a00eee52f668b3f557fb6d357ec3bf00ac92
prerequisite-patch-id: 67b871715259e60fbf7db917233dbdecce6891da
prerequisite-patch-id: f8562e07c91fa42b1501efa759734a7874b9d909
prerequisite-patch-id: a5f304a67525412f0669a298a5f66285b56c3a58
prerequisite-patch-id: 6b5b1dc3f6760888a15c11cc658c52ba6fd3f33d
prerequisite-patch-id: 29eb6b854e9df37f5e8ed212215baab0ac7fbe87
prerequisite-patch-id: d87fe52c264dc5a33883a04b615043fbefd94f92
prerequisite-patch-id: 26a2978b861386fda945f1e60e9153cf0bdd24f3
prerequisite-patch-id: ab50b5247a29b4fbbd7207a558647dd3c57d5175
prerequisite-patch-id: 0f2a6cfa7d77c6f05f23c3aada161d02a9fc7660
prerequisite-patch-id: 7153c7bb3a45877fd84286dd9915046fa0a76056
prerequisite-patch-id: 74830838bac94ed1e036a8173cf3210a314b35d8
prerequisite-patch-id: 74a6e5ffb9f477afb61e73ed80a40c9359bc77a2
prerequisite-patch-id: 795f6e9425cc6a953166b530ae68df466a7a3c2b
prerequisite-patch-id: e37b1bc5dd69e7e68abf0e6c004431537f70175f
prerequisite-patch-id: 2e510b0a05df30c68bec8baf8b411a71e5f14d74
prerequisite-patch-id: e0397c86b545a1d65f2e6b2049c282b926c40c64
prerequisite-patch-id: 44606527ccbdf980a4c2401394f728f9c2011b8a
prerequisite-patch-id: 65b83839f7a477b9fa8e8913380e8eac2ac1ca0e
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 11:41:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 11:41:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783873.1193165 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siuaA-0003R2-AL; Tue, 27 Aug 2024 11:41:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783873.1193165; Tue, 27 Aug 2024 11:41:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siuaA-0003Qv-7o; Tue, 27 Aug 2024 11:41:54 +0000
Received: by outflank-mailman (input) for mailman id 783873;
 Tue, 27 Aug 2024 11:41:52 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siua8-0003Qn-TZ
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 11:41:52 +0000
Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com
 [2a00:1450:4864:20::62c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 595d790a-6469-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 13:41:51 +0200 (CEST)
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-a8696e9bd24so568979866b.0
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 04:41:50 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e549ce0dsm100047666b.60.2024.08.27.04.41.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 04:41:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 595d790a-6469-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724758910; x=1725363710; 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=s/bHfEEyVYzSSYEBlTJgpv6g284H8wooJj00XUhug/k=;
        b=gPfKJIliYbIqXy7rEwpu5KJho3aGbQq/xwcRJGoCs5kD3g64cRg7DswSf06Rz1C0e1
         ojQQDEQJoioezaJSiYzjjZBrbAhTFckrctnJsr9tbKEQ8c1L2fAUWqI8xVS5QCv4mP0m
         EUeUCl8OgKmMGJWB3rHFX4u8XTaFEDliaDenQLY0p0yP/gbgBFAed77yjuBex+IW6juI
         zZCc9QP139ul6q6cgIasWlD40V58VTPOyIOsC3rZqSYORgzeW/0jF/XG9bPw8lsOpNd/
         7/v46dQsku7QDLJ2LFZkIURGa1/cazBAR1EuZQ5erPpesBc0mYHbhS2mttcYNM//qK3V
         BL2Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724758910; x=1725363710;
        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=s/bHfEEyVYzSSYEBlTJgpv6g284H8wooJj00XUhug/k=;
        b=m7a6z4git0RUCFNBo8ZM5Xl0cQ6Ti7ZdETD5MtHVFv9CpzigMbIn9GBd2ScGmR9HUJ
         wsWabfCPStj2XuoIJsI3Lcp2ZF8KHJlocLrWGmC4m1zUsG8agRdrSZmmGxHnUOs+BlDn
         fZITvNBYxMDKzW/fYB5E7m77DBbFZ+JoXQhTq2vjmwOHqmlxf6OnkxbnQFhJJdIBS+WB
         LwTFHLwqRppBdpk5qIKxJaG6i1qbOhOW1ifJ7oAsI+6AzA6tc24HZsb1MniyqvUo1EEg
         dKVHo+rsInHP4C0F90Tjsi3WsQ5EeHVPOvObg3CU5OjYQoZibKxoWq33lisYp8OOQtpv
         S14A==
X-Forwarded-Encrypted: i=1; AJvYcCVLBGLJqc4iKsODzm0qZ5+JZ81A9mFEbLDV5OvjTeHy0ArqAKnM68rFGKp8zFwPAiI+i1ut5ts+rTg=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz5TJXRMhS+LNPxnxTdrSoQIHkWvsRyibc+vKAaw4ywMNVUtK4j
	T44L9/EfUX2gNXGqotckZcksz1KrSbX9RvOseEWTI5PhR5AXOIiiWUoTp0e0FQ==
X-Google-Smtp-Source: AGHT+IHwpgTcYAQ3XuYdWXktS1RzaimHnG//f+wWwVplaBzx+kknh8NXoetphMG0u6LWKloVWS2jBQ==
X-Received: by 2002:a17:907:2cc6:b0:a86:7021:1368 with SMTP id a640c23a62f3a-a86e39dc9b2mr199287966b.21.1724758909956;
        Tue, 27 Aug 2024 04:41:49 -0700 (PDT)
Message-ID: <265ea113-5e9e-4829-9a22-24ed9e1cae69@suse.com>
Date: Tue, 27 Aug 2024 13:41:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 5/9] xen/bitops: Introduce generic_hweightl() and
 hweightl()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-6-andrew.cooper3@citrix.com>
 <14c385ce-c61d-48e3-aa09-7b450af34b6c@suse.com>
 <f5bac01b-74d6-41c4-b3c5-ad595d6de378@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <f5bac01b-74d6-41c4-b3c5-ad595d6de378@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27.08.2024 12:39, Andrew Cooper wrote:
> On 26/08/2024 12:40 pm, Jan Beulich wrote:
>> On 23.08.2024 01:06, Andrew Cooper wrote:
>> --- a/xen/include/xen/bitops.h
>> +++ b/xen/include/xen/bitops.h
>> @@ -35,6 +35,12 @@ extern void __bitop_bad_size(void);
>>  unsigned int __pure generic_ffsl(unsigned long x);
>>  unsigned int __pure generic_flsl(unsigned long x);
>>  
>>> +/*
>>> + * Hamming Weight, also called Population Count.  Returns the number of set
>>> + * bits in @x.
>>> + */
>>> +unsigned int __pure generic_hweightl(unsigned long x);
>> Aren't this and ...
>>
>>> @@ -284,6 +290,18 @@ static always_inline __pure unsigned int fls64(uint64_t x)
>>>          (_v & (_v - 1)) != 0;                   \
>>>      })
>>>  
>>> +static always_inline __pure unsigned int hweightl(unsigned long x)
>> ... this even __attribute_const__?
> 
> Hmm.  This is following fls(), but on further consideration, they should
> be const too.
> 
> I'll do a prep patch fixing that, although I'm going to rename it to
> __attr_const for brevity.
> 
> Much as I'd prefer __const, I expect that is going too far, making it
> too close to regular const.

I was actually going to suggest using that name, if we want to shorten
__attribute_const__. Yes, gcc treats __const (and __const__) as
keywords, but do we care (much)? All it requires is that we don't start
using __const as a (real) keyword.

Of course __const is a good example of why really we shouldn't use
double-underscore prefixed names anywhere. Any of them can be assigned
a meaning by the compiler, and here that's clearly the case. Therefore,
taking your planned rename, maybe better make it attr_const then? And
eventually switch stuff like __packed, __pure, and __weak to attr_* as
well? Or even introduce something like

#define attr(attr...) __attribute__((attr))

and use attr(const) here?

>>> +{
>>> +    if ( __builtin_constant_p(x) )
>>> +        return __builtin_popcountl(x);
>> How certain are you that compilers (even old ones) will reliably fold
>> constant expressions here, and never emit a libgcc call instead? The
>> conditions look to be more tight than just __builtin_constant_p(); a
>> pretty absurd example:
>>
>> unsigned ltest(void) {
>>     return __builtin_constant_p("") ? __builtin_popcountl((unsigned long)"") : ~0;
>> }
> 
> How do you express that in terms of a call to hweightl()?

hweightl((unsigned long)"");

Yet as said - it's absurd. It merely serves to make the point that what
__builtin_constant_p() returns true for doesn't necessarily constant-
fold in expressions.

> Again, this is following the layout started with fls() in order to avoid
> each arch opencoding different versions of constant folding.
> 
> https://godbolt.org/z/r544c49oY
> 
> When it's forced through the hweightl() interface, even GCC 4.1 decides
> that it's non-constant and falls back to generic_hweightl().
> 
> 
> I did spend a *lot* of time with the fls() series checking that all
> compilers we supported did what we wanted in this case, so I don't
> expect it to be a problem.

Right, and I guess I was pointlessly more concerned about popcount than
I was for ffs() / fls(). The criteria upon which gcc decides whether to
constant-fold the uses is exactly the same.

>  But, if a library call is emitted, it will
> be very obvious (link failure), and we can re-evaluate.

Indeed, we certainly would notice, albeit the diagnostic may be cryptic
to people.

Bottom line - keep it as is.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 11:44:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 11:44:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783878.1193176 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siucO-0003zW-NW; Tue, 27 Aug 2024 11:44:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783878.1193176; Tue, 27 Aug 2024 11:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siucO-0003zP-JX; Tue, 27 Aug 2024 11:44:12 +0000
Received: by outflank-mailman (input) for mailman id 783878;
 Tue, 27 Aug 2024 11:44:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=qQW3=P2=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1siucN-0003zJ-2v
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 11:44:11 +0000
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on20614.outbound.protection.outlook.com
 [2a01:111:f400:7e88::614])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ab04859b-6469-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 13:44:09 +0200 (CEST)
Received: from DM6PR07CA0095.namprd07.prod.outlook.com (2603:10b6:5:337::28)
 by CH2PR12MB4056.namprd12.prod.outlook.com (2603:10b6:610:a5::19) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Tue, 27 Aug
 2024 11:43:42 +0000
Received: from CY4PEPF0000FCC3.namprd03.prod.outlook.com
 (2603:10b6:5:337:cafe::e7) by DM6PR07CA0095.outlook.office365.com
 (2603:10b6:5:337::28) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25 via Frontend
 Transport; Tue, 27 Aug 2024 11:43:42 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CY4PEPF0000FCC3.mail.protection.outlook.com (10.167.242.105) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 11:43:42 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 27 Aug
 2024 06:43:41 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Tue, 27 Aug 2024 06:43:40 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ab04859b-6469-11ef-a0b0-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=xabVmuHK+kZirVZuWTFlrZ26j37VOmBrCs1P3jWwVVVG8od/kHv+8kbD4sS9vG0q9wTOd1T7Cbp/fdnwOkTufU9Fn++Txwnu3BYMtO5ACP8yMIo8CE2TwHrVSn3JOJDjHhbYpirQrlfEFrw+wjVaAe7GWn5bpRptxk5esG4ZrpXmyiBJVM/QNvxXqe1vOua0Q2tLlvSHI2lHLPJjhfXdhJCP4CxSqHIgPJ71IZfnuNRqyVzTHBuI2/oB9x52sngI4zFBPKUX0w82U/LuGo4RtDgK9hRiJBrUFXCa94L80yOKtz2X/CwMBnAEYiyIdq2xK7kNVd17O599iJy0EDVN2w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/gYf+V770eo7RYxzdFJUCd6Kmq0u27sksEwZ7Q8mss4=;
 b=eb0t2O6WDQcc41OOx8A1aRLPxfrrHA1AMCGBWESzaCGJFjdmTET5uYVmIL+K+7huWqRSXWOZOgEJB31K65uxIeCO3Mcyn0ufJMWhnUSl4qkd+XUNhrRWrs9oWUxIIsPP0/ivd7QAmymVisfnTZ006dnBXR+r3KWIoXdTMfLlo/iaXw1Nh3MRVankN/KXPuwpeOPl4TvIHQRsKCs158G6abaFmP2W/jK6/4E/DUh63RmDew24nQW5c91yMk6UhDdnDuTqpM/CNd0I34W83ekoasF7Oz1EMcKpMS5WPM3Aw3ev0LUzkpQ5WrjkcNCXA4BsZUM1GKeUa+tjNdma+mTbIg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=citrix.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/gYf+V770eo7RYxzdFJUCd6Kmq0u27sksEwZ7Q8mss4=;
 b=yM2Ssz2C8hap2g60xi7myu8kw3jybFBYc06xKOjKOFEX2S7ae2CqtJezSX2kbC4LH6P1iPgGBHh4CmuhgPQ3e+uPiVoNTdyFDZJ9NwcvHvpdVFfMpV/ToXucJ6etl3FmZWBzf6g9JnIpQqsAnkz27efxo/nhy6iLoRfXFXhzVlE=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <b0307587-7980-4180-9ce8-2f76b6bdd0ae@amd.com>
Date: Tue, 27 Aug 2024 13:43:39 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] ARM/vgic: Use for_each_set_bit() in
 vgic_check_inflight_irqs_pending()
To: Andrew Cooper <andrew.cooper3@citrix.com>, Xen-devel
	<xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Bertrand
 Marquis <bertrand.marquis@arm.com>
References: <20240823230045.1581050-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240823230045.1581050-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB03.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000FCC3:EE_|CH2PR12MB4056:EE_
X-MS-Office365-Filtering-Correlation-Id: 0385cef0-20d1-4c4f-1524-08dcc68d806d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?blUvbnBjUVlnY2NZNHU3bXMvQTJmdFhaNGJydlN1UG1GcnVDOTkxYXFETUMz?=
 =?utf-8?B?SDRVM0NaZ2RINnpqb2VldXU1WmFSQlhaL210S1g4LytmMmNSVGRVb3hXZFhv?=
 =?utf-8?B?RlcxSGhMWDdqQis1UGR3M1NQd3ZpVHc3OUFmNGRZT3lQOEdFc1RDVVZmamNV?=
 =?utf-8?B?N2xtMGI4UnF1MFJUZWViQWNKKzk2UG4yT2hMd003bFhjWmo1L1F5MEFhNXBV?=
 =?utf-8?B?cE0rMDVubUFYaUZPNzdTVjh4RGR4ZTBhNTNxSWZmSVN5aHc2YVZ5ZVc5WnUr?=
 =?utf-8?B?MkhhbmR0cXVOQ2xkUG5DbmFYTkVGZHNsKzFnYkh3Q2hzZFJDTElDRWQvclNp?=
 =?utf-8?B?dFl2c1JpVFR0ajBGZXFxT2pzTTBVT2dtbzBPU242V2JYdW91WURZdUExcGlB?=
 =?utf-8?B?OVlRdzVtNGJXdWhoRktIL3JJMkl5MytxZnh5SlEvQkR0QnQyRk96MTFUR3Bp?=
 =?utf-8?B?QUJzeFFtOURORDduSjBrdE91UFQ5aDVjRTBiRmNzb3V6cGszbzB4VDhGTzkw?=
 =?utf-8?B?S1BPclFXNFkwcG82VEhyY2ZETnNlQWtmQWN3S2dNdHJlbkFlSUlTakJyVmdl?=
 =?utf-8?B?L05Ga3BvaGh1bUJjemgzNEVsQThuMGlrQjVKTlJnb01GRkZoRWRjNWpZbVdo?=
 =?utf-8?B?Z2pOaGN1b3EwY0Z5aE1MYi84Z0VFclM5ZzZPTDFySkZHa0d5ODNvYXkzdU53?=
 =?utf-8?B?VTZaWkVrQjdpa3gwL0RDc21vSU84dUs3TUcyRUpQNkRvWERpSkcyVCtaaGRQ?=
 =?utf-8?B?T2ZUMDRpRjVZSjhKRGNBYzRBNkFVczlzeVdxc0V3S2lwYU5SOTN5VU40WnFr?=
 =?utf-8?B?eTZxZm12aHFFSkhQellwK0NZNklGYkNNNFBTci9jZ3FDUkFKa3FlTHZtNFJV?=
 =?utf-8?B?bmwyQy9QSVpaVVdkSjNUWDJPajYyL2FQSm0xdDN4V2JNTUIrRlBGbnZhUk1h?=
 =?utf-8?B?WG9CaXR6Tk1naW1IU3V6cGpsY2JTOGNRWFk4SWNZM0FKdDBGdmF3OUtjQ2pX?=
 =?utf-8?B?dnBWSDZzMlpqTktqV0E0N2ZyeXppTWlSV1YzdjVGQnpVNS92NWoxUTNOa3ky?=
 =?utf-8?B?eWdlVXlFTmRxeE44L3kzZDEyYW9hZ2pmNnU0eXhTU0h6N01qcnBPQjN6dzFL?=
 =?utf-8?B?L2xyWDhlTit3Nk0zTWlrQ1NwMXNYRTlMbUtWaWZ1RnpXdjJ1elpGaitQNkoy?=
 =?utf-8?B?NzYzL21yWHNwZEVwYjNQU01zcmNjWjNrMUpVUzBidm4vZnZqWkxLWCt1cmI1?=
 =?utf-8?B?NHovUzBueXQ3dll1M0NyM2RBTDFpTU9MdW5qS3ZQN2FaOCtaZ3RJaWJ3b29s?=
 =?utf-8?B?QVJKdjVFNTlkQXNUNTBCSng0UUlleW5ISmkxdGhKZUxIdnp6NXhVQ0FjdFJP?=
 =?utf-8?B?T0JxSzZLZU1IRmorQ0QzYzRtSTdNZEg1TGVOYS9jQUgvcnYvbGRHbXN5Z2lY?=
 =?utf-8?B?aDFmYktBUzhFckFQbzNkMk9scXlTQzd5cFBJZVRYTTBSdXNXNXMyWmt0d0VR?=
 =?utf-8?B?K3RBYk4vV3Z2aWhDVGJMd3lHTU1XaXdOa1B6TlJkV1NSQW9qeWxCK2s0S2tx?=
 =?utf-8?B?UEVYNEEzSzZqOU5NZ3BTM2NQT255MUF1Nk9GQzJ6bDhQZWw3YnhkN25sM28r?=
 =?utf-8?B?RFlYVzVKcnFMd1FPRlFrTmxKdFpTczNvZEZWYzdXMXh4RDAzdjFaN244SXhX?=
 =?utf-8?B?OU03SEZUaW9YTnU4U1I3Qnc4eERBem9NVzZYSEZWSXVtejFIbmxhbzlsWEd2?=
 =?utf-8?B?VzNOeVFzT3pEcFlibW16VnAwNnVVMUo5Mkt4VU1xeTNtQVRtTDFTZzRpcVFL?=
 =?utf-8?B?RW1OOUE1SmtYZzk1eTIrVFJzaXE5YWowZjZ1TDFJbHc4Mk5sdDc5T0RmWEEv?=
 =?utf-8?B?VlpUU1dRSCtldlFjSVFNblJCMGgxNmFKNi9rVEFsSGRqTmJoa1htbUVwem8r?=
 =?utf-8?Q?hjbzmYkzIProipSSbfmKVDWLRfiQ7iVh?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 11:43:42.4119
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 0385cef0-20d1-4c4f-1524-08dcc68d806d
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000FCC3.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4056



On 24/08/2024 01:00, Andrew Cooper wrote:
> 
> 
> ... which is better optimised for scalar values, rather than using the
> arbitrary-sized bitmap helpers.
> 
> Additionally, unlike other vgic helpers, this takes both a domain and vcpu
> pointer.  The domain parameter isn't used, and the callers pass v->domain.
> 
> Strip out the domain pointer.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 11:50:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 11:50:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783885.1193186 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siui7-0006OS-9b; Tue, 27 Aug 2024 11:50:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783885.1193186; Tue, 27 Aug 2024 11:50:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siui7-0006OL-6q; Tue, 27 Aug 2024 11:50:07 +0000
Received: by outflank-mailman (input) for mailman id 783885;
 Tue, 27 Aug 2024 11:50:05 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1siui5-0006J3-TJ
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 11:50:05 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7fbef80f-646a-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 13:50:04 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-a83856c6f51so343279366b.2
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 04:50:04 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb4722b0sm904689a12.69.2024.08.27.04.50.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 04:50:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7fbef80f-646a-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724759404; x=1725364204; 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=dOoVQtO220RrtdVPWv6bZPm0e+ZLfX+GhH4C47OL9TA=;
        b=Af6cVoYJB3rDJLr8D3orYp6Hq7e+Th6+b118FIRD0YL6uZn1wrr1Stwd5R/dUYcKtO
         3WUQMZOebAVa+k4xhpVB5UuUbxqwCTsuDYGra2qZc7qBmJSDPtgI+OZWVdvH1vQwFnaY
         CPPaFxwtWX3SkCNK8rXOYf2Oaa0Y5iUuyXnrY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724759404; x=1725364204;
        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=dOoVQtO220RrtdVPWv6bZPm0e+ZLfX+GhH4C47OL9TA=;
        b=DRckQ1kXn94oxm/wjobe1ngqwlS9ZJdXy3eT82p4s6Gt+Wj7QZZo6d6tOOlOTiLkvO
         k0yu3PuUdH2ntdxYaKhDWfFpGxtjYCfXl2yfXeTKY6WwDRXJiGe1EOmfLXGOIwLnNFxt
         aeeb2PFBS6I9m4bMijFLfHusW/oeTHtNAPT3z3AruUNG0h/eE/EIwl1HwOOIFOSLYAJv
         8nknYaZouKjEbH1yeXPhaWCeO2j5velkZ3CKOO/AnrTRLIJXITQ58WEoLLzEUYDi7mKq
         hJNQNlpgCOEuIYOYZ/pj3g+VFbQRqqu5rEAqcsjNcKx+eQDAG309QqNPzuKJv5MoHf+L
         AvLg==
X-Forwarded-Encrypted: i=1; AJvYcCVZ7edmzTNTh+IXh7E5cA+2YR7nHs2bN+Ln5x77DhKlPrNUvSCDgIfQPHvsCPk/SnarRVv4P+bKNJI=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yym1s/yytvST41/JMYmQPM7t1HvFA/HbLYGYRnflHQtTKtJzSVg
	tcoTVLGNZupHeH+YmDg7STh4kgUZJABs1ap8R+FHoV2+2i1XaqToGR8vIzQNfVY=
X-Google-Smtp-Source: AGHT+IEbx1iZmOacrJqcIKzb6dJA0OCL9JSNfeAPe2sXZAGLkC9dZPO680TniN8lNl+T275jAaoTgg==
X-Received: by 2002:a05:6402:50d2:b0:5bf:b29:6eb9 with SMTP id 4fb4d7f45d1cf-5c0891a823dmr12706924a12.23.1724759403856;
        Tue, 27 Aug 2024 04:50:03 -0700 (PDT)
Message-ID: <70047ef7-ca22-4eeb-9510-09ccdf0871c0@citrix.com>
Date: Tue, 27 Aug 2024 12:50:01 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 7/9] xen/bitops: Implement hweight64() in terms of
 hweightl()
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-8-andrew.cooper3@citrix.com>
 <11da1350-095f-49c8-bdf0-f5c83e9f0d39@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <11da1350-095f-49c8-bdf0-f5c83e9f0d39@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 26/08/2024 12:55 pm, Jan Beulich wrote:
> On 23.08.2024 01:06, Andrew Cooper wrote:
>> ... and drop generic_hweight64().
>>
>> This is identical on all architectures except ARM32.  Add one extra SELF_TEST
>> to check that hweight64() works when the input is split in half.
>>
>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Thanks.

> with one remark:
>
>> --- a/xen/include/xen/bitops.h
>> +++ b/xen/include/xen/bitops.h
>> @@ -302,6 +302,14 @@ static always_inline __pure unsigned int hweightl(unsigned long x)
>>  #endif
>>  }
>>  
>> +static always_inline __pure unsigned int hweight64(uint64_t x)
>> +{
>> +    if ( BITS_PER_LONG == 64 )
>> +        return hweightl(x);
>> +    else
>> +        return hweightl(x >> 32) + hweightl(x);
> This assume BITS_PER_LONG == 32, which of course is true right now, but
> doesn't need to be in general. Better add an explicit cast to uint32_t
> (or masking by 0xffffffffU)?

This is part of the point of putting in the self-tests.  They're
intended to catch things like this in new build environments.

Although, I think we've got enough cases which will #error on
BITS_PER_LONG not being 32 or 64.

Again, this is modelled after f[fl]s64() which have the same
expectations about the BITS_PER_LONG != 64 case.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 12:01:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 12:01:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783895.1193196 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siut9-0000Tg-AC; Tue, 27 Aug 2024 12:01:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783895.1193196; Tue, 27 Aug 2024 12:01:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siut9-0000TZ-7L; Tue, 27 Aug 2024 12:01:31 +0000
Received: by outflank-mailman (input) for mailman id 783895;
 Tue, 27 Aug 2024 12:01:30 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1siut8-0000TT-1W
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 12:01:30 +0000
Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com
 [2a00:1450:4864:20::12b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 17243d7b-646c-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 14:01:28 +0200 (CEST)
Received: by mail-lf1-x12b.google.com with SMTP id
 2adb3069b0e04-53351642021so6275345e87.3
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 05:01:28 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e588ade7sm100494566b.180.2024.08.27.05.01.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 05:01:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 17243d7b-646c-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724760087; x=1725364887; 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=dmJUwda64ZAH64yKwNwkUhBN3CEud0mGq6sIUI2oScU=;
        b=DYMmTEZGjndDxZ0Mn57ceAJpv75MCs6Kpp4DbtRpVXJxBhL3f7uRDGy84cs9jYQJYT
         gpdh497TMHe5xkLWOsJkNanlavge1SgD7JGY0nyMXWWhqMkBs0OqLkLsSuhYUREKMe9Q
         s7q+9g0A2mbR+v2bsIIWbMoaCTRX/IWWj+BBU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724760087; x=1725364887;
        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=dmJUwda64ZAH64yKwNwkUhBN3CEud0mGq6sIUI2oScU=;
        b=SrNnJc5AgrJHqC4rn6tGgOH8HE7ynbpZIYx8Q9+ZQ1MRVIWddIuVvyR7A932a2BGKi
         6VzumG2X+8QXK3FLqoDrnG05pXkpEUrLxjowS1pY9UlvuK9HuFoHNgBC0JhdPNQYjC/5
         mtXdnd9M8jpZ+pZP3O4vugV8yEeE3sw4fV7TLhgtalxIe0emjvvk8IXB51e1PhvoWgdi
         ESH9kn9AiOPHlR8bE+NvDP80DquwKmxhl5rNOULAgzOawZHHVnMwMbxfRbXtWc3Kj9Aw
         wJvVPbAGbS6vxML+hmYj6DCmbWcGTjn7ymCAfy6IxUNZPvANd75ZWLPlcGRIHLxHFY/H
         vrfQ==
X-Forwarded-Encrypted: i=1; AJvYcCUC5RKTuJr/f39lMXfgzUGVAk/4kQ6g5uT0xLLE3nnsGYZzi+rZzTOo9npbEEQc+qbdreNXBJZieyE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxkSTAMrsUayaK6XZMPyMW9fsB8ptS7CA4a4AYmEEHIjBRMgByb
	NTWH/+7pwQoLFnQmU+ic0bV+1wl/++bJwsQy4X00pUGi4dudFYEGC6BW+SkpsLU=
X-Google-Smtp-Source: AGHT+IEIAjChwL26EE6ed4i3/OnhM3YCEpYx2ZhM2gAAX6X8JFydd+vKf+MrHA9NpUyI29EwXgdxiQ==
X-Received: by 2002:a05:6512:108b:b0:52b:c1cc:51f1 with SMTP id 2adb3069b0e04-5343877b490mr8236635e87.23.1724760086810;
        Tue, 27 Aug 2024 05:01:26 -0700 (PDT)
Message-ID: <239165e3-6f96-452f-9c81-05f29012269f@citrix.com>
Date: Tue, 27 Aug 2024 13:01:24 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/9] xen/bitops: Introduce a multiple_bits_set() helper
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-3-andrew.cooper3@citrix.com>
 <841e2cde-6fc2-49d9-b947-534bd53bc00e@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <841e2cde-6fc2-49d9-b947-534bd53bc00e@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 26/08/2024 11:30 am, Jan Beulich wrote:
> On 23.08.2024 01:06, Andrew Cooper wrote:
>> This will be used to simplify real logic in the following patch.  Add compile
>> and boot time testing as with other bitops.
>>
>> Because the expression is so simple, implement it as a function-like macro
>> which is generic on the type of it's argument, rather than having multiple
>> variants.
>>
>> Testing function-like macros needs a minor adjustments to the infrastructure
>> in xen/self-tests.h to avoid bracketing the fn parameter.  The utility of this
>> outweighs the associated risks.
> We may need to mark these two places as deviated.

Perhaps, although it would want to be a project-wide deviation.

Eclair was green with this patch in place, so it's not blocking.

>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> with one remark/request:
>
>> --- a/xen/common/bitops.c
>> +++ b/xen/common/bitops.c
>> @@ -84,8 +84,32 @@ static void __init test_fls(void)
>>      CHECK(fls64, 0x8000000000000001ULL, 64);
>>  }
>>  
>> +static void __init test_multiple_bits_set(void)
>> +{
>> +    /*
>> +     * multiple_bits_set() is generic on the type of it's parameter, as the
>> +     * internal expression is so simple.
>> +     */
>> +
>> +    CHECK(multiple_bits_set, 0, false);
>> +    CHECK(multiple_bits_set, 1, false);
>> +    CHECK(multiple_bits_set, 2, false);
>> +    CHECK(multiple_bits_set, 3, true);
>> +
>> +    CHECK(multiple_bits_set, 1 | (1UL << (BITS_PER_LONG - 1)), true);
> This is really the same as ...
>
>> +#if BITS_PER_LONG > 32
>> +    CHECK(multiple_bits_set, 1 | (1UL << 32), true);
>> +    CHECK(multiple_bits_set, 1 | (1UL << 63), true);
> ... this, at least as long as BITS_PER_LONG > 32 in practice means
> BITS_PER_LONG == 64. Perhaps not really worth keeping that line?

I suppose not.  I'll drop it.

However, It occurs to me that I do need a test of 0x8000000000000001ULL
mostly for 32bit builds to check that even when the argument is split,
the answer is still accurate.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 12:04:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 12:04:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783900.1193206 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siuw5-00012k-Oh; Tue, 27 Aug 2024 12:04:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783900.1193206; Tue, 27 Aug 2024 12:04:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siuw5-00012d-L1; Tue, 27 Aug 2024 12:04:33 +0000
Received: by outflank-mailman (input) for mailman id 783900;
 Tue, 27 Aug 2024 12:04:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1siuw4-00012X-6s
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 12:04:32 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 839dd717-646c-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 14:04:30 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a7a81bd549eso415698066b.3
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 05:04:30 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e5950ec2sm101192066b.222.2024.08.27.05.04.28
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 05:04:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 839dd717-646c-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724760270; x=1725365070; 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=QqbZS+gDi42MRkLa6LNqr/kXkCFyAiduYvuuPEavHc4=;
        b=EbLaTcLSmEoX/XmhyvZ/jQsaWiNSq0+fDOTjjYPaJoxviO8Mfv8TMk4RX9EARKBwsj
         b5r6RQ8e2UuG9aHQqZSS9O4eMjpGdSKfJArl496sh7+s+5HtYZSLjuXHcsP04nq7hbk7
         Sri+U4qFS52SUJzRjlInB5iLOhbkUAGxkc9vM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724760270; x=1725365070;
        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=QqbZS+gDi42MRkLa6LNqr/kXkCFyAiduYvuuPEavHc4=;
        b=SE5yZ5jtC760FUZTmsL3h3PQida7e11TYNVxSU3hnNQp+I61MqebmYRZmnutmoFO6p
         TYDoJZ0R4gWlsnL/b9vl45luJTVBOQiLxD5ZXQkIx1KYUJRN7EbxkN2nM/DdK6ngA+7E
         EKXddsQBkBwv4b/3l0JdyRMaUQLA6mmiHrkYPq2DXVhqDMOZBVgyPhaVnLGrqQDTlQuE
         YS1sFftCxQDl2WAncBEogSSKX/kg1u4nOYDENkiWfiEr8sO5goMlTGZzDWBRYsFJtDQ6
         9NvDc9FE/+ZulsGcLwxgm3Ha2kxOa/+mA3lsE+DhoklrnaKjm8zYispYXuzsUOzd/lRl
         PeAQ==
X-Forwarded-Encrypted: i=1; AJvYcCX6OytZqWKwDfRNbDjWjNzwcjaoUwUuzFE5ODQi7SsE57Bgr+Km0PDWh0oY5owJuTCjx8PGPZo2yTg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxneC/VvFPrfcF/3R5DbFEHqFBu3EfRENIhiQk4MH7/nif7gHiU
	C/TqOFT/0g3bNnYMubX+Q8XAwCE6XQ+FhrMmjxI1Bf1kTKfjRi5DJZNbpYxYxn8=
X-Google-Smtp-Source: AGHT+IFL1uwiZhdo6utBk8Fxt2TS1lEZRpEIg1jGi9mPI0Agb8/Cwegj5QXl2aQRawqeQ86/h2OV8A==
X-Received: by 2002:a17:907:9724:b0:a86:a5a0:7613 with SMTP id a640c23a62f3a-a86a5a078femr747428766b.55.1724760269216;
        Tue, 27 Aug 2024 05:04:29 -0700 (PDT)
Message-ID: <08f60580-3b3c-4c14-acaa-93ddec544be1@citrix.com>
Date: Tue, 27 Aug 2024 13:04:26 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/9] xen/bitops: Drop the remnants of hweight{8,16}()
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-5-andrew.cooper3@citrix.com>
 <8c6599fa-22c0-455e-9d6a-51b3bf3d24b3@suse.com>
 <f0a5525f-cfb8-4669-a0b7-3da4fdd9eaaf@citrix.com>
 <6b86e515-c68c-4c3b-9e99-bce4119ab1a2@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <6b86e515-c68c-4c3b-9e99-bce4119ab1a2@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 27/08/2024 11:11 am, Jan Beulich wrote:
> On 27.08.2024 11:49, Andrew Cooper wrote:
>> On 26/08/2024 11:39 am, Jan Beulich wrote:
>>> On 23.08.2024 01:06, Andrew Cooper wrote:
>>>> They are no more, and won't be returning in this form.
>>> And what's the plan? Use hweight32((uint8_t)...) in an open-coded manner?
>>> Not overly nice I would say.
>> If we ever regain a genuine need for the 8 or 16 forms, they can go back
>> into bitops.h, in terms of hweightl(), just like hweight32().
>>
>> But it's been 20 years so far and we haven't actually needed
>> hweight8/16, and I'm expecting this to continue for the forseeable future.
> Well, I'm not fully convinced. People may (try to) add open-coded forms like
> in my earlier reply instead.

I'd hope we'd spot that during review, and even if not, we can fix it up
after the fact.

>  But anyway:
> Acked-by: Jan Beulich <jbeulich@suse.com>

Thanks.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 12:06:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 12:06:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783904.1193216 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siuxT-0001Yz-1U; Tue, 27 Aug 2024 12:05:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783904.1193216; Tue, 27 Aug 2024 12:05:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siuxS-0001Ys-VF; Tue, 27 Aug 2024 12:05:58 +0000
Received: by outflank-mailman (input) for mailman id 783904;
 Tue, 27 Aug 2024 12:05: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=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1siuxR-0001Ym-MG
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 12:05:57 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b6c385b9-646c-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 14:05:55 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-5a10835487fso8077747a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 05:05:55 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb2156dfsm939497a12.53.2024.08.27.05.05.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 05:05:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b6c385b9-646c-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724760355; x=1725365155; 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=RGhfv5XpRj8JLGM819T6v6Zn2+W1+Xp5UHoDnABfE4s=;
        b=N8d2frEkplWHPaCd40rsdNQjCNXbdmtBMMEJ4BzlFKjRUl+xCMuWt4ccaBePG3iIQD
         wH6ERJCPRF+ryVkh8J1ENOAejL6bVXvKvEsr0GtJ5Q5am6bCeS4FL1TzaqvvibatBoi0
         g7PJ7W15W2Jml3+VKuG97ZmMfgNB3XjvFF0cE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724760355; x=1725365155;
        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=RGhfv5XpRj8JLGM819T6v6Zn2+W1+Xp5UHoDnABfE4s=;
        b=HgLdtaz7+AqctJU+Qfc/ieG4lI+sGBUXUprA8N4977+KsFYbDlIDWy98r2JvqWQVY1
         YEE3MYjPNufzNwwUL3yZD/jFZygwsiCdfkMTn02ybSI1elcce/JuiQFm3KWfeURKCdBu
         nW3W1WuzuMKCYFAcaaHLonGBmxyz9AFbUCkQ9ROtJTXyWor5PjkQmkIjgKWvMW0QDxA+
         x70+3Uzz8GVaSoPI36BVg9PTZy6W9Op1G/PkwEewB5XnDLEGY91sPntE6aJ4CyiTdpCY
         /MOdlN/Np1UxygaI+B+rcb1itHPSTDYnVJdWjGzKFy4pKxW91HVBW27qQvSxfgoXfBK6
         7D/g==
X-Forwarded-Encrypted: i=1; AJvYcCVCap9HFbYrlmu7dfWWHepTvqDHQlaXs+bL3XiW8SwidIg/FQoSrBJPqgDzxS6+g+ZNVu0Iof9QphQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwH75EWkoJeLYcubsqKxtOF8/Pc+cwsk4KxYt0EVUKfRIhg1JN9
	yRsPPTto5IiWwmbToJWyLqpJPlLbuMm9GFciw2l47bqjcJH9bDajeFMILSc1kSM=
X-Google-Smtp-Source: AGHT+IGPnriVafvG16FruxiLP5pJ9UdZN1ehR7j4yo8Oh9z1Xvrgid/rcYN5zOSfptRC6Wbu8F3FLA==
X-Received: by 2002:a05:6402:50cf:b0:5be:ef1f:c679 with SMTP id 4fb4d7f45d1cf-5c0891a2702mr9087568a12.23.1724760354761;
        Tue, 27 Aug 2024 05:05:54 -0700 (PDT)
Message-ID: <f938a434-d166-4238-bb86-9b5600b2b50c@citrix.com>
Date: Tue, 27 Aug 2024 13:05:52 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 8/9] xen/bitops: Implement hweight32() in terms of
 hweightl()
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-9-andrew.cooper3@citrix.com>
 <53d86a14-276d-4d2c-836f-4c3a78346dd1@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <53d86a14-276d-4d2c-836f-4c3a78346dd1@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 26/08/2024 12:59 pm, Jan Beulich wrote:
> On 23.08.2024 01:06, Andrew Cooper wrote:
>> ... and drop generic_hweight32().
>>
>> As noted previously, the only two users of hweight32() and they're both
>> singleton callers in __init paths, so it's not interesting to have a sub-GPR
>> optimised generic.
> I think it's clear what is meant, but the part of the sentence ahead of
> the comma is a little bumpy. As to not interesting: Perhaps indeed not
> right now, but new uses may appear and generally the overly wide
> operations may be (slightly) more expensive. Of course we can deal with
> the need when it arises, so ...

Oh yes, that is wonky.  I'll rephrase.

>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Acked-by: Jan Beulich <jbeulich@suse.com>

Thanks.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 12:14:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 12:14:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783912.1193226 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siv5A-00043N-QX; Tue, 27 Aug 2024 12:13:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783912.1193226; Tue, 27 Aug 2024 12:13:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siv5A-00043G-NW; Tue, 27 Aug 2024 12:13:56 +0000
Received: by outflank-mailman (input) for mailman id 783912;
 Tue, 27 Aug 2024 12:13:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=qQW3=P2=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1siv59-00043A-Pl
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 12:13:55 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on2061c.outbound.protection.outlook.com
 [2a01:111:f403:2415::61c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d31e7336-646d-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 14:13:53 +0200 (CEST)
Received: from SJ2PR07CA0013.namprd07.prod.outlook.com (2603:10b6:a03:505::15)
 by SA0PR12MB4367.namprd12.prod.outlook.com (2603:10b6:806:94::13)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26; Tue, 27 Aug
 2024 12:13:50 +0000
Received: from SJ5PEPF000001D5.namprd05.prod.outlook.com
 (2603:10b6:a03:505:cafe::52) by SJ2PR07CA0013.outlook.office365.com
 (2603:10b6:a03:505::15) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26 via Frontend
 Transport; Tue, 27 Aug 2024 12:13:49 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SJ5PEPF000001D5.mail.protection.outlook.com (10.167.242.57) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 12:13:49 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 27 Aug
 2024 07:13:48 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 27 Aug
 2024 07:13:48 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Tue, 27 Aug 2024 07:13:47 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d31e7336-646d-11ef-a0b0-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=qWwiyyDiYjYbUgVur4yfgKMrpJVJJiRB2nNIKGVUng68J7izJtg/tMs7/zOd3gwLdQixv7z0tD62f6krOL7uYVvlCj0LIhL0oDwGiqzBsH3YaOJG/UHm6WCof+vJm830HGgPIQHQPhbyYp6hpizS4kyfb+htso4AExeJEK1aK6uHyxFO5L0RUHiU/u+wBukKG+lkd09Ey5CAM+XmqIU2ZDjly3OBWC+ITEZJeDTS3s3t/bVgUF2AgrderTNtxwtHKI/TQFiZ2mjcEPjvoqxrbFpOH3MOU6N07QMAOdNvyYUKPaWKM0nWgOHtYDXQYlw5pzCGsmkpIqYcXoxDDQ9Owg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=s8Dd+Wz7gQgBrVRFPtl6TPBK4TLlbA/9FtynOwB2JhQ=;
 b=WZHbEFF9yL8QEX++rJhpW64I9IcCQZQn77rDJkxKK+yiYpyrRgIYg9LtlROqmM40+QOAyrf6PJY8sWDaLt8DhQHq5FNkEjC6wwzag1RnKc4+CEzn+A9G6XWtCvqpcUXkCSTIRxy0tXjrkINo/TgTuAYGZ/lxx4k59k4M6b6U/vryCcjeWXpxRQjqflVFyvAzvhBKjUljfDp5ItZUVHcmOiseqgRN52M7N7NS47AIBYl++5Lk6WTDivO+maZUnVnlXRg2E1FWR2W+0FuXWUPbzYrrA2HF0JEYnOIEPosoBGljRGTIocrKInJudb+vL6ngqEEKIo9WtxlA2vez7Gdjdw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=citrix.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=s8Dd+Wz7gQgBrVRFPtl6TPBK4TLlbA/9FtynOwB2JhQ=;
 b=yuwWDlvOKygRfbuorKsd0Sg3374o3+4tmWc7ur2DVk/39eudqeu5H38uphoxzeptbouWvy4mrNg5+Mm+yvOqLdrS0U0Deu7b9NAgE0WZscBHR3jt3cmrf9KCjyC2+zAKWi0q0vHxYAs8TRuVMWRedYgzFQaTcrRHEMoWjcxxpro=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <6513e2ea-0471-41ca-b328-ce1bc1deddaf@amd.com>
Date: Tue, 27 Aug 2024 14:13:46 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] ARM/vgic: Use for_each_set_bit() in vgic_to_sgi()
To: Andrew Cooper <andrew.cooper3@citrix.com>, Xen-devel
	<xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, "Bertrand
 Marquis" <bertrand.marquis@arm.com>, Jan Beulich <JBeulich@suse.com>
References: <20240823230100.1581448-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240823230100.1581448-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001D5:EE_|SA0PR12MB4367:EE_
X-MS-Office365-Filtering-Correlation-Id: 0c3754bc-c6da-4756-1539-08dcc691b58d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?dmRnd2toYnh6WHhBOTFnVWJYUjl5MnRFdjRaanl3emdHVHBTZkJ4eHZWK0FT?=
 =?utf-8?B?Y1YrbzIxSmhxemxhcHJ5eWxzVHV6Skh3ei9jNXYxWjY1UCtzeUxYT3NWSDRq?=
 =?utf-8?B?Qm9hRTEyaTlhZ3dGVDFyVjVWVkRwOHBCUzdERFZNNnFXMEwvMXFyRXhiMW1H?=
 =?utf-8?B?SURLTTBOenQyQkRtQ0ZaRTE4SmRTK3pCakYzbXl5ZE5laWZESS8vaUhKK0hw?=
 =?utf-8?B?eHBnb3JQcTNqNTNLc21wWUE5T0lvejA0M1lSMG03ZFo3WVFtVVRTK0tsWmJ2?=
 =?utf-8?B?aldiN0FWR1hDSmxKMVFBTTBDVUw3L3VMakdyMFppbTJyTVp1Z2dUNXNpczMy?=
 =?utf-8?B?SHAwTzRLeEJyOG1naUJvb0FXT3N1YXFzTGpOZUQ2enlUeHdCVEd6MS82SWdM?=
 =?utf-8?B?VW96WGk1NUluUVBmd1ZpdEVoejZRa2ZDajJDUk80QmxYaVhXa2k5NVdRbkQw?=
 =?utf-8?B?aDBqSksvMWprMTg5d0M3VXU4ZjBQYXhxWDNMZGMyYW9OTDVKLyt5VGpPUG1K?=
 =?utf-8?B?K09uVEhQcnNhVFJPYjByWjZuc3ZLUzhGWVNzMUJZSExzU2tSeHd5NFl0L2FR?=
 =?utf-8?B?QVRoY2lpNU0rSW9IMm5iNmVUeTZWaS9YWVN0UFd2cDJ3V0s5OWpTNUhCd3JU?=
 =?utf-8?B?ZmNGVlpYdWE3dEgwZGlBN0ZXNW9VbjhBMDBzYlhBNUp1WU0wTEoxeVNQU3dU?=
 =?utf-8?B?d0luZVZJcTgyWU0ydituaUNIeU52Z01VYUVaSjZ6Zk5YN2krNWVPR2hVcmRC?=
 =?utf-8?B?czVHazFEUHp3c3Z5SEo4UU8yRGdHMlNJV3R4VHZnR2hKZURSN1VwSnJCSXBZ?=
 =?utf-8?B?TVkweVIyb2FhcGZ1bUIwV0pjcUtDWU1zaW4yRlBsTXNIK1l1SEZWWWNRQnVC?=
 =?utf-8?B?UDdNWTdRdWdBMWo3V0dHUnpiUjh2bDdRTmVPZ3dCTDRZMXZrNnN3QVpON3pC?=
 =?utf-8?B?VENSblY1eGhWMWlMQkZlM1AwMXdjQ2Nsam1lYWJLTFZoOHdBK1pndzBrTGFh?=
 =?utf-8?B?TE9KTkNnUVAya3hOZlJFVDNudys1VHliNC9ISWs1dmk2V25HQWNSY3VHREFn?=
 =?utf-8?B?NE55TEdiU2VUZHZXV0JBV0JwRFk2UUxMTklIZXkzdmd3TTdEZlAzNVBZK2VI?=
 =?utf-8?B?cHlrYTZBQnk5M3BIR0srRVMzd1NsOTNyNnVCVGxJYjh0cEJVOVFpS0w5aUpu?=
 =?utf-8?B?cklzRVV6cmhjTlovU3JYckhTR2pUSTM2a2wxRDBqblg3KzJscXZOSmkyT3Rx?=
 =?utf-8?B?OWV4U3c0d1JzUkFrYXNMbFlaK0JobW00bE1UUWhBZVNiYmpSWDJ1R3BIU3dF?=
 =?utf-8?B?ckNqcGJqSEJvU3RmNk04ODZnMkVDUFlJV3VDU2xvdWV3MEhzNE83VmRMOC9h?=
 =?utf-8?B?TCtPQ3ZzRmxndDRxZE5OOW91MWdlWFhRK0JBWmZIRGc1WEw2Nk1oT2RXd0Iz?=
 =?utf-8?B?L2xjUWpIam1aWVBVTnVjdjRWYTJmMm1DUjJsejNZSHdJZEV5MjA2N2NSWk02?=
 =?utf-8?B?dE9UUjNrMDdrVnhhNnpuc3ZaNDJaMXNKbEZ1bmdoU1p0UzdlK3lzazA0VVI3?=
 =?utf-8?B?eC9ORjhITHdtYndIaFZsZ0xkOENPdTlHeVdFQVZqMDh4Q3hUMmxySFM4VDJu?=
 =?utf-8?B?Y2ZxWlJvcHdLeDM2bWlNcldZR3BmNkZnT2FWWWJuMDZzQkxYNDdMT3FXaDVV?=
 =?utf-8?B?bWd0UTNlWGc2bFJOWDZiQzh3RG1mRjVXbG1uQUJRcVpORGNpL1FNN3h6S09m?=
 =?utf-8?B?cEppS1pWYVRGblJRQTdGcDQvM3BJS2dQdEhkVUcxME02bmN2TzBHVDh5TCtO?=
 =?utf-8?B?bmFoZUV1OWVJc2svdy9xUUVmbEZaazY0MlhrYWlJTEd0aGdrVWZwek5DRmw2?=
 =?utf-8?B?Qk9zK2xPd2o5bHpobjhYakJvblpCWlM0b0JabXdMV2dYNi9SWTYwTHlSOTcr?=
 =?utf-8?Q?U/FXLFvNjWbl+6vKTyALVceNfFla/r2+?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 12:13:49.6216
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 0c3754bc-c6da-4756-1539-08dcc691b58d
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF000001D5.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4367



On 24/08/2024 01:01, Andrew Cooper wrote:
> 
> 
> The existing expression is just a very complicated way of expressing a loop
> over all bits of target->list.  Simplify the expression.
> 
> While here, fix the two gprintk()'s.  Because of a quotes vs line continuation
> issue, there's a long string of spaces in the middle of the format string.
> 
>   $ strings xen-syms-arm32 | grep -e VGIC -e GICD_SGIR
>   <G><1>%pv VGIC: write r=%08x                         target->list=%hx, wrong CPUTargetList
>   <G><1>%pv vGICD:unhandled GICD_SGIR write %08x                  with wrong mode
> 
> not to mention trailing whitespace too.
> 
> Rewrite them to be more consise and more useful.  Use 0x prefixes for hex,
s/consise/concise

> rather than ambigous, and identify the problem target vCPU / mode, rather than
s/ambigous/ambiguous

> simply saying somethign was wrong.
s/somethign/something/

> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien@xen.org>
> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
> CC: Bertrand Marquis <bertrand.marquis@arm.com>
> CC: Michal Orzel <michal.orzel@amd.com>
> CC: Jan Beulich <JBeulich@suse.com>
> 
> In a fun twist, we can't use target->list directly in the expresion, because
> the typeof() picks up constness from the pointer, and we get:
> 
>   In file included from arch/arm/vgic.c:11:
>   arch/arm/vgic.c: In function ‘vgic_to_sgi’:
>   ./include/xen/bitops.h:305:19: error: assignment of read-only variable ‘__v’
>     305 |               __v &= __v - 1 )
>         |                   ^~
>   arch/arm/vgic.c:483:9: note: in expansion of macro ‘for_each_set_bit’
>     483 |         for_each_set_bit ( i, target->list )
>         |         ^~~~~~~~~~~~~~~~
> 
> Sadly we need -std=c23 before we can use typeof_unqual() which is what we
> actually want here.
> ---
>  xen/arch/arm/vgic.c | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> index 7b54ccc7cbfa..081cbb67fb52 100644
> --- a/xen/arch/arm/vgic.c
> +++ b/xen/arch/arm/vgic.c
> @@ -470,8 +470,7 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
>      struct domain *d = v->domain;
>      int vcpuid;
>      int i;
> -    unsigned int base;
> -    unsigned long int bitmap;
> +    unsigned int base, bitmap;
> 
>      ASSERT( virq < 16 );
> 
> @@ -481,15 +480,16 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
>          perfc_incr(vgic_sgi_list);
>          base = target->aff1 << 4;
>          bitmap = target->list;
> -        bitmap_for_each ( i, &bitmap, sizeof(target->list) * 8 )
> +
> +        for_each_set_bit ( i, bitmap )
>          {
>              vcpuid = base + i;
>              if ( vcpuid >= d->max_vcpus || d->vcpu[vcpuid] == NULL ||
>                   !is_vcpu_online(d->vcpu[vcpuid]) )
>              {
> -                gprintk(XENLOG_WARNING, "VGIC: write r=%"PRIregister" \
> -                        target->list=%hx, wrong CPUTargetList \n",
> -                        sgir, target->list);
> +                gprintk(XENLOG_WARNING,
> +                        "vGIC: write %#"PRIregister", target->list=%#x, bad target v%d\n",
Sth like "bad target v2" where the word vcpu does not occur anywhere in the msg can be ambiguous.
Can you add the word vcpu e.g. "bad vcpu target v%d" or "bad target vcpu %d"

> +                        sgir, target->list, vcpuid);
>                  continue;
>              }
>              vgic_inject_irq(d, d->vcpu[vcpuid], virq, true);
> @@ -510,8 +510,8 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
>          break;
>      default:
>          gprintk(XENLOG_WARNING,
> -                "vGICD:unhandled GICD_SGIR write %"PRIregister" \
> -                 with wrong mode\n", sgir);
> +                "vGICD: GICD_SGIR write %#"PRIregister" with unhangled mode %d\n",
s/unhangled/unhandled/

> +                sgir, irqmode);
>          return false;
>      }
> 
> --
> 2.39.2
> 

Otherwise:
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 12:20:39 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 12:20:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783920.1193235 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivBP-0006c1-Ib; Tue, 27 Aug 2024 12:20:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783920.1193235; Tue, 27 Aug 2024 12:20:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivBP-0006bu-Fa; Tue, 27 Aug 2024 12:20:23 +0000
Received: by outflank-mailman (input) for mailman id 783920;
 Tue, 27 Aug 2024 12:20:21 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sivBN-0006bo-CJ
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 12:20:21 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b96c172f-646e-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 14:20:19 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5bec87ececeso5909753a12.0
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 05:20:19 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e582d57fsm103089266b.116.2024.08.27.05.20.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 05:20:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b96c172f-646e-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724761219; x=1725366019; 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=Xckl3ar8HgogLNADv6d+Aj8eU2bgnOq0Jsczz3Eh6QM=;
        b=Ft6/4tAd0jw2LYmM+8t0SxrLEkxLcVxj9+lmjNfRkh0/+9zEDaXZ8rWDcYCVqnPbn4
         jSq9ekc6g/Zw0TqO97au/ILQQBeQERJe7aA/KcD/KO6aQVi1f25a3geSiaAZKMcQbEUw
         I4nDnwwSpd5fbMem1sDnCMZzLs8g/eHRkf9KE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724761219; x=1725366019;
        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=Xckl3ar8HgogLNADv6d+Aj8eU2bgnOq0Jsczz3Eh6QM=;
        b=CGeLe4IBBtEQ708ZrRYUA814E7yCBqMZ8Asp1F+no+afqpXx+foSha7erqDqr99LzN
         gtShAnKx3ZqfptqyuiK2QaSKjIkIdv2E8YK8LmA8a0UZvxok0BqH1JQfJsZ9oXZB0sTl
         NYq3cbn3Dg0/W47YAWcalblw6fFcvhCxE774LjC0Iytq0UnSkTQESjMVm1kBlPCIIH3J
         tBiZ+y7diQCwfS7jBvBhczBjptvtWWVF/+30bX8VXGv+415XVss/YfDBiIfxoTzjcEX2
         5T7zY7+Gkbr4ZgXFnJ6f9X4mSRnOxn9v7Vd2TIZJyoQjlsVMFSXibllaCjjOh/3iDn3h
         X4Cg==
X-Forwarded-Encrypted: i=1; AJvYcCUlGLoNmT7ObyZ/Y1Vqz5We5SJSdyZdFbvHbGbgNzD1YFWQH3IoTgcGfbgTPeNfCAeNfxRuLtojTI4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwuglKeFuwhf8ZGMFFBL0/hTlh8vHABuxnD1IcHCGIG3Sd3HyzH
	YYfVpK2Oa7nPPeg2CuttbGylzee1kSURHdhZprmskw3ZTij9CiIZ24Fw20Yt+sw=
X-Google-Smtp-Source: AGHT+IGoOHG4eXgQLpczX41NfMyt4H1kyb/AHjSsv7UsesnUEH9u3xdZtK2Uwf4aTHbko3C2gZ7qPA==
X-Received: by 2002:a17:907:948b:b0:a7a:be79:ca1e with SMTP id a640c23a62f3a-a86e39dcfcdmr193279366b.20.1724761218132;
        Tue, 27 Aug 2024 05:20:18 -0700 (PDT)
Message-ID: <a4c0b1d3-ff7a-4ea5-bffb-756125a434af@citrix.com>
Date: Tue, 27 Aug 2024 13:20:15 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] ARM/vgic: Use for_each_set_bit() in vgic_to_sgi()
To: Michal Orzel <michal.orzel@amd.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>, Jan Beulich <JBeulich@suse.com>
References: <20240823230100.1581448-1-andrew.cooper3@citrix.com>
 <6513e2ea-0471-41ca-b328-ce1bc1deddaf@amd.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <6513e2ea-0471-41ca-b328-ce1bc1deddaf@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27/08/2024 1:13 pm, Michal Orzel wrote:
>
> On 24/08/2024 01:01, Andrew Cooper wrote:
>>
>> The existing expression is just a very complicated way of expressing a loop
>> over all bits of target->list.  Simplify the expression.
>>
>> While here, fix the two gprintk()'s.  Because of a quotes vs line continuation
>> issue, there's a long string of spaces in the middle of the format string.
>>
>>   $ strings xen-syms-arm32 | grep -e VGIC -e GICD_SGIR
>>   <G><1>%pv VGIC: write r=%08x                         target->list=%hx, wrong CPUTargetList
>>   <G><1>%pv vGICD:unhandled GICD_SGIR write %08x                  with wrong mode
>>
>> not to mention trailing whitespace too.
>>
>> Rewrite them to be more consise and more useful.  Use 0x prefixes for hex,
> s/consise/concise
>
>> rather than ambigous, and identify the problem target vCPU / mode, rather than
> s/ambigous/ambiguous
>
>> simply saying somethign was wrong.
> s/somethign/something/
>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Stefano Stabellini <sstabellini@kernel.org>
>> CC: Julien Grall <julien@xen.org>
>> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
>> CC: Bertrand Marquis <bertrand.marquis@arm.com>
>> CC: Michal Orzel <michal.orzel@amd.com>
>> CC: Jan Beulich <JBeulich@suse.com>
>>
>> In a fun twist, we can't use target->list directly in the expresion, because
>> the typeof() picks up constness from the pointer, and we get:
>>
>>   In file included from arch/arm/vgic.c:11:
>>   arch/arm/vgic.c: In function ‘vgic_to_sgi’:
>>   ./include/xen/bitops.h:305:19: error: assignment of read-only variable ‘__v’
>>     305 |               __v &= __v - 1 )
>>         |                   ^~
>>   arch/arm/vgic.c:483:9: note: in expansion of macro ‘for_each_set_bit’
>>     483 |         for_each_set_bit ( i, target->list )
>>         |         ^~~~~~~~~~~~~~~~
>>
>> Sadly we need -std=c23 before we can use typeof_unqual() which is what we
>> actually want here.
>> ---
>>  xen/arch/arm/vgic.c | 16 ++++++++--------
>>  1 file changed, 8 insertions(+), 8 deletions(-)
>>
>> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
>> index 7b54ccc7cbfa..081cbb67fb52 100644
>> --- a/xen/arch/arm/vgic.c
>> +++ b/xen/arch/arm/vgic.c
>> @@ -470,8 +470,7 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
>>      struct domain *d = v->domain;
>>      int vcpuid;
>>      int i;
>> -    unsigned int base;
>> -    unsigned long int bitmap;
>> +    unsigned int base, bitmap;
>>
>>      ASSERT( virq < 16 );
>>
>> @@ -481,15 +480,16 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
>>          perfc_incr(vgic_sgi_list);
>>          base = target->aff1 << 4;
>>          bitmap = target->list;
>> -        bitmap_for_each ( i, &bitmap, sizeof(target->list) * 8 )
>> +
>> +        for_each_set_bit ( i, bitmap )
>>          {
>>              vcpuid = base + i;
>>              if ( vcpuid >= d->max_vcpus || d->vcpu[vcpuid] == NULL ||
>>                   !is_vcpu_online(d->vcpu[vcpuid]) )
>>              {
>> -                gprintk(XENLOG_WARNING, "VGIC: write r=%"PRIregister" \
>> -                        target->list=%hx, wrong CPUTargetList \n",
>> -                        sgir, target->list);
>> +                gprintk(XENLOG_WARNING,
>> +                        "vGIC: write %#"PRIregister", target->list=%#x, bad target v%d\n",
> Sth like "bad target v2" where the word vcpu does not occur anywhere in the msg can be ambiguous.
> Can you add the word vcpu e.g. "bad vcpu target v%d" or "bad target vcpu %d"

Hmm yeah, v%d doesn't work quite so well when it's not prefixed with d%d.

Would you be happy with d%dv%d?  It's marginally more informative and
shorter.

>
>> +                        sgir, target->list, vcpuid);
>>                  continue;
>>              }
>>              vgic_inject_irq(d, d->vcpu[vcpuid], virq, true);
>> @@ -510,8 +510,8 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
>>          break;
>>      default:
>>          gprintk(XENLOG_WARNING,
>> -                "vGICD:unhandled GICD_SGIR write %"PRIregister" \
>> -                 with wrong mode\n", sgir);
>> +                "vGICD: GICD_SGIR write %#"PRIregister" with unhangled mode %d\n",
> s/unhangled/unhandled/
>
>> +                sgir, irqmode);
>>          return false;
>>      }
>>
>> --
>> 2.39.2
>>
> Otherwise:
> Reviewed-by: Michal Orzel <michal.orzel@amd.com>

Bah, I really was asleep when writing this.  I spotted 2 of the typos,
but not all of them.

I'll fix them all up.  Thanks.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 12:31:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 12:31:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783927.1193246 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivLg-0000lz-Hn; Tue, 27 Aug 2024 12:31:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783927.1193246; Tue, 27 Aug 2024 12:31:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivLg-0000ls-DV; Tue, 27 Aug 2024 12:31:00 +0000
Received: by outflank-mailman (input) for mailman id 783927;
 Tue, 27 Aug 2024 12:30:59 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sivLf-0000lm-2x
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 12:30:59 +0000
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com
 [2a00:1450:4864:20::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3557de43-6470-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 14:30:56 +0200 (CEST)
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a86910caf9cso881092566b.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 05:30:56 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e549f5c1sm105214266b.68.2024.08.27.05.30.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 05:30:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3557de43-6470-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724761856; x=1725366656; 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=veubWuAtvi5hYg3bt7Ig8UgkkZ7tk4qURJRtiqZyn34=;
        b=OHBUZJtLLDvndf7HMnyarqO9DgbJ+nbHoiZo6gUKvNVd1/TlcVfs+3sRQ7C7o/Ziur
         J+FFg1lweidR2zL73DpFgI2qu5WL16LOgxJtEcJ2Fpa+FDTKSv5tuTyhL1AJssSHTE/4
         DZsVvnSCCg88q5cjLiNrVrQiljVYIg0gL0ZR8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724761856; x=1725366656;
        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=veubWuAtvi5hYg3bt7Ig8UgkkZ7tk4qURJRtiqZyn34=;
        b=h1hhBJUVmByeXaCRii0xURiLCpp1G0pX1RazM+zIeZ4VKIrx264hKf/WCr5ny6VhzN
         uosAVEEXf5MU/jbP0pBkuxImVK4kQuqMsL180zqV9xBfw9G+lXbz4sM0WBK0VbQUgGnA
         szs1YNMyAcKTjdJM2rRIiXZeJhQKmgEoJqkesg3NQ80rUsA3fvlaOAKkc2ZTdSAfyBDN
         HGOc7fHMM2RqaJMrE7fs9dQs//xJz8NZSSDwBTV1ju7Nq7tynm18ZMinv9cUdvnXE6VQ
         lnw7z4Rt/0N9qZZJ++McW76i5ijskAt0bO5KnBAtGpqndgePB/WiGHJIJ8ywu4zzhFGV
         C43w==
X-Forwarded-Encrypted: i=1; AJvYcCUSdVW8tiE/70zRNanhsm3YP+jOEJ9rk9nQA9YAeVumaMbCdTIRJawPuruGBNTirmYPcigwFFqw71Y=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yye2APAIlj5JmyL90aI86uNY+9Pj4wgwxraHpXXht0f1DyyGffT
	SWPNxZfOcipcTiZ5nKLPaMmmin10P9DSsioyXIjan9jEZzMTOJm4lvGdV3KNLdE=
X-Google-Smtp-Source: AGHT+IHyiW8mYK7JXKlacoBWPZf3JhjUXQh06R/EfuUqC/xz64T3zFyMjI4td/PM3C6f6Uo7Oxjd+w==
X-Received: by 2002:a17:907:2d8e:b0:a7a:c7f3:580d with SMTP id a640c23a62f3a-a86e29feb8bmr270352666b.25.1724761855759;
        Tue, 27 Aug 2024 05:30:55 -0700 (PDT)
Message-ID: <d51535cd-5149-4808-8643-68be3216a08b@citrix.com>
Date: Tue, 27 Aug 2024 13:30:53 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 5/9] xen/bitops: Introduce generic_hweightl() and
 hweightl()
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-6-andrew.cooper3@citrix.com>
 <14c385ce-c61d-48e3-aa09-7b450af34b6c@suse.com>
 <f5bac01b-74d6-41c4-b3c5-ad595d6de378@citrix.com>
 <265ea113-5e9e-4829-9a22-24ed9e1cae69@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <265ea113-5e9e-4829-9a22-24ed9e1cae69@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27/08/2024 12:41 pm, Jan Beulich wrote:
> On 27.08.2024 12:39, Andrew Cooper wrote:
>> On 26/08/2024 12:40 pm, Jan Beulich wrote:
>>> On 23.08.2024 01:06, Andrew Cooper wrote:
>>> --- a/xen/include/xen/bitops.h
>>> +++ b/xen/include/xen/bitops.h
>>> @@ -35,6 +35,12 @@ extern void __bitop_bad_size(void);
>>>  unsigned int __pure generic_ffsl(unsigned long x);
>>>  unsigned int __pure generic_flsl(unsigned long x);
>>>  
>>>> +/*
>>>> + * Hamming Weight, also called Population Count.  Returns the number of set
>>>> + * bits in @x.
>>>> + */
>>>> +unsigned int __pure generic_hweightl(unsigned long x);
>>> Aren't this and ...
>>>
>>>> @@ -284,6 +290,18 @@ static always_inline __pure unsigned int fls64(uint64_t x)
>>>>          (_v & (_v - 1)) != 0;                   \
>>>>      })
>>>>  
>>>> +static always_inline __pure unsigned int hweightl(unsigned long x)
>>> ... this even __attribute_const__?
>> Hmm.  This is following fls(), but on further consideration, they should
>> be const too.
>>
>> I'll do a prep patch fixing that, although I'm going to rename it to
>> __attr_const for brevity.
>>
>> Much as I'd prefer __const, I expect that is going too far, making it
>> too close to regular const.
> I was actually going to suggest using that name, if we want to shorten
> __attribute_const__. Yes, gcc treats __const (and __const__) as
> keywords, but do we care (much)? All it requires is that we don't start
> using __const as a (real) keyword.

Well also we'll get into more MISRA fun for overriding keywords.

But yes - the fact that GCC treats __const to mean const is precisely
why we shouldn't give it an unrelated meaning.

>
> Of course __const is a good example of why really we shouldn't use
> double-underscore prefixed names anywhere. Any of them can be assigned
> a meaning by the compiler, and here that's clearly the case. Therefore,
> taking your planned rename, maybe better make it attr_const then? And
> eventually switch stuff like __packed, __pure, and __weak to attr_* as
> well? Or even introduce something like
>
> #define attr(attr...) __attribute__((attr))
>
> and use attr(const) here?

Hmm - that's an interesting approach, and for other attributes which we
can use unconditionally.  It will end up shorter than multiple separate
__-prefixed names.

As a tangent, I've got some work from playing with -fanalyzer which
sprinkles some attr malloc/alloc_{size,align}()/free around.  It does
improve code generation (abeit marginally), but the function declaration
size suffers.

It won't work for attributes which are conditionally nothing (e.g.
cf_check), or ones that contain multiple aspects (e.g. __constructer
conataining cf_check).

In practice this means we're always going to end up with a mix, so maybe
attr_const is better for consistency.

>
>>>> +{
>>>> +    if ( __builtin_constant_p(x) )
>>>> +        return __builtin_popcountl(x);
>>> How certain are you that compilers (even old ones) will reliably fold
>>> constant expressions here, and never emit a libgcc call instead? The
>>> conditions look to be more tight than just __builtin_constant_p(); a
>>> pretty absurd example:
>>>
>>> unsigned ltest(void) {
>>>     return __builtin_constant_p("") ? __builtin_popcountl((unsigned long)"") : ~0;
>>> }
>> How do you express that in terms of a call to hweightl()?
> hweightl((unsigned long)"");
>
> Yet as said - it's absurd. It merely serves to make the point that what
> __builtin_constant_p() returns true for doesn't necessarily constant-
> fold in expressions.

Yes, but as shown in the godbolt link, this form changes GCC's mind
about the __builtin_const-ness of the expression.

>
>> Again, this is following the layout started with fls() in order to avoid
>> each arch opencoding different versions of constant folding.
>>
>> https://godbolt.org/z/r544c49oY
>>
>> When it's forced through the hweightl() interface, even GCC 4.1 decides
>> that it's non-constant and falls back to generic_hweightl().
>>
>>
>> I did spend a *lot* of time with the fls() series checking that all
>> compilers we supported did what we wanted in this case, so I don't
>> expect it to be a problem.
> Right, and I guess I was pointlessly more concerned about popcount than
> I was for ffs() / fls(). The criteria upon which gcc decides whether to
> constant-fold the uses is exactly the same.
>
>>   But, if a library call is emitted, it will
>> be very obvious (link failure), and we can re-evaluate.
> Indeed, we certainly would notice, albeit the diagnostic may be cryptic
> to people.
>
> Bottom line - keep it as is.

Thanks.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 12:32:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 12:32:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783931.1193256 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivMl-0001HF-QQ; Tue, 27 Aug 2024 12:32:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783931.1193256; Tue, 27 Aug 2024 12:32:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivMl-0001H8-MM; Tue, 27 Aug 2024 12:32:07 +0000
Received: by outflank-mailman (input) for mailman id 783931;
 Tue, 27 Aug 2024 12:32:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=eoql=P2=arm.com=robin.murphy@srs-se1.protection.inumbo.net>)
 id 1sivMk-0001H0-Dv
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 12:32:06 +0000
Received: from foss.arm.com (foss.arm.com [217.140.110.172])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTP
 id 5de0838c-6470-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 14:32:05 +0200 (CEST)
Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])
 by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 69B28DA7;
 Tue, 27 Aug 2024 05:32:30 -0700 (PDT)
Received: from [10.1.196.40] (e121345-lin.cambridge.arm.com [10.1.196.40])
 by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C67E53F762;
 Tue, 27 Aug 2024 05:32:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5de0838c-6470-11ef-a0b0-8be0dac302b0
Message-ID: <91ef4036-6468-4ecc-ac14-0146130d8da4@arm.com>
Date: Tue, 27 Aug 2024 13:31:59 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] dma-mapping: clear mark DMA ops as an architecture
 feature
To: Christoph Hellwig <hch@lst.de>, iommu@lists.linux.dev
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
 Sakari Ailus <sakari.ailus@linux.intel.com>,
 Bingbu Cao <bingbu.cao@intel.com>, "Michael S . Tsirkin" <mst@redhat.com>,
 Jason Wang <jasowang@redhat.com>, linux-kernel@vger.kernel.org,
 linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org,
 linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
 sparclinux@vger.kernel.org, linux-media@vger.kernel.org,
 virtualization@lists.linux.dev, xen-devel@lists.xenproject.org
References: <20240824035817.1163502-1-hch@lst.de>
 <20240824035817.1163502-2-hch@lst.de>
From: Robin Murphy <robin.murphy@arm.com>
Content-Language: en-GB
In-Reply-To: <20240824035817.1163502-2-hch@lst.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 24/08/2024 4:57 am, Christoph Hellwig wrote:
> DMA ops are a helper for architectures and not for drivers to override
> the DMA implementation.  Unfortunately driver authors keep ignoring
> this.  Make this more clear by renaming the symbol to ARCH_DMA_OPS,
> have the three drivers overriding it depend on that.  They should
> probably also be marked broken, but we can give them a bit of a grace
> period for that.

Nit: from a quick survey of "git grep 'select ARCH_'", maybe 
ARCH_HAS_DMA_OPS might be the clearest and most consistent name? 
Otherwise, now that any potential confusion from drivers/iommu is no 
more, I too thoroughly approve of the overall idea.

Acked-by: Robin Murphy <robin.murphy@arm.com>


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 12:40:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 12:40:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783938.1193266 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivUZ-0003rf-Hc; Tue, 27 Aug 2024 12:40:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783938.1193266; Tue, 27 Aug 2024 12:40:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivUZ-0003rY-ES; Tue, 27 Aug 2024 12:40:11 +0000
Received: by outflank-mailman (input) for mailman id 783938;
 Tue, 27 Aug 2024 12:40: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=CYmO=P2=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sivUX-0003rS-UL
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 12:40:09 +0000
Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com
 [2607:f8b0:4864:20::832])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7d9d96bf-6471-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 14:40:08 +0200 (CEST)
Received: by mail-qt1-x832.google.com with SMTP id
 d75a77b69052e-454b3d8999aso30664431cf.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 05:40:07 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 d75a77b69052e-454fdfc9cbesm52330891cf.14.2024.08.27.05.40.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 27 Aug 2024 05:40:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7d9d96bf-6471-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724762406; x=1725367206; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=EHxNDs3WvLLt5whh017HBp6YdKWqcf6qJVXiZj5BDTo=;
        b=h0c6IpPQpi6J7wI9kVqKwAqDyziQQ35H4hnX42cXy8HCW7y72Y2medg5D9PqMVAei3
         eSdfmGSqsHxEKLpMSiNxZo9Jecs4zdKx7sjRyZsXainOON3m0QjKD/voYIjV9QHQTCVX
         QxF+O2KLDLtvFNIYWIa2sQCdysVoEBt5OBCWI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724762406; x=1725367206;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=EHxNDs3WvLLt5whh017HBp6YdKWqcf6qJVXiZj5BDTo=;
        b=mtuMDLVsCn40MZ4efmdgYRD1OUggmbCQeZUFDaw495N2Ha9vwRKzoNceKxkU/UYv9L
         dkqIobR7pObzhuwkWqUmXa8qd49XZ1/ivP3oqaelkc8sKxqwVzjEUMBZV7q8hzXG3Mwv
         c2rtafRWt6Kz7dbtSzeHmPFxp2WMWlbGB3zQzZcOWI5RAJ4iZsCg71ldDRWRTQXeBFD6
         QYOqNbSt/iSzdLwD8XqucOX0vjMWlzMeMCrbnujGJXTxqDY9xCFPvibKrAN1Zz/CfQ3W
         EZiW3+zfql19gG+MQ1cayu94grVCPyzVQCgH56rE6uaM+f8Uzj/+ffas5b+Qh6dItCFT
         5k+A==
X-Gm-Message-State: AOJu0YxlMpMrLDx1LMWDDv96gKv5yCZgap5wkWHP5CVzrS6N/9QGbpSt
	QalGoYAwCjyVlV4qgbLqerTe2urGO3LqNbgxI3AsOrv+WZ5DIdmoO8abaI1dfhrE7Yjsi3A2Wtt
	Q
X-Google-Smtp-Source: AGHT+IGdQrAqoNNRtXtt0cqdwYjv3qar3XQO4WfWPub0I2PK0xcChcMgwA0H9GunuoS/luxm9WUA0w==
X-Received: by 2002:ac8:690e:0:b0:453:14c2:d503 with SMTP id d75a77b69052e-45509c1baf5mr162615451cf.24.1724762406202;
        Tue, 27 Aug 2024 05:40:06 -0700 (PDT)
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v5] x86/dom0: disable SMAP for PV domain building only
Date: Tue, 27 Aug 2024 14:39:49 +0200
Message-ID: <20240827123949.24400-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Move the logic that disables SMAP so it's only performed when building a PV
dom0, PVH dom0 builder doesn't require disabling SMAP.

The fixes tag is to account for the wrong usage of cpu_has_smap in
create_dom0(), it should instead have used
boot_cpu_has(X86_FEATURE_XEN_SMAP).  Fix while moving the logic to apply to PV
only.

While there also make cr4_pv32_mask __ro_after_init.

Fixes: 493ab190e5b1 ('xen/sm{e, a}p: allow disabling sm{e, a}p for Xen itself')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v4:
 - New approach, move the current logic so it's only applied when creating a PV
   dom0.
---
 xen/arch/x86/dom0_build.c        | 17 +++++++++++++++++
 xen/arch/x86/include/asm/setup.h |  2 ++
 xen/arch/x86/setup.c             | 19 +------------------
 3 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 8d56705a0861..31c94b14bb06 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -612,7 +612,24 @@ int __init construct_dom0(struct domain *d, const module_t *image,
     if ( is_hvm_domain(d) )
         rc = dom0_construct_pvh(d, image, image_headroom, initrd, cmdline);
     else if ( is_pv_domain(d) )
+    {
+        /*
+         * Temporarily clear SMAP in CR4 to allow user-accesses in
+         * construct_dom0().  This saves a large number of corner cases
+         * interactions with copy_from_user().
+         */
+        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
+        {
+            cr4_pv32_mask &= ~X86_CR4_SMAP;
+            write_cr4(read_cr4() & ~X86_CR4_SMAP);
+        }
         rc = dom0_construct_pv(d, image, image_headroom, initrd, cmdline);
+        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
+        {
+            write_cr4(read_cr4() | X86_CR4_SMAP);
+            cr4_pv32_mask |= X86_CR4_SMAP;
+        }
+    }
     else
         panic("Cannot construct Dom0. No guest interface available\n");
 
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index d75589178b91..8f7dfefb4dcf 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -64,6 +64,8 @@ extern bool opt_dom0_verbose;
 extern bool opt_dom0_cpuid_faulting;
 extern bool opt_dom0_msr_relaxed;
 
+extern unsigned long cr4_pv32_mask;
+
 #define max_init_domid (0)
 
 #endif
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index eee20bb1753c..eb0fcb6c8767 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -80,7 +80,7 @@ int8_t __initdata opt_probe_port_aliases = -1;
 boolean_param("probe-port-aliases", opt_probe_port_aliases);
 
 /* Only used in asm code and within this source file */
-unsigned long asmlinkage __read_mostly cr4_pv32_mask;
+unsigned long asmlinkage __ro_after_init cr4_pv32_mask;
 
 /* **** Linux config option: propagated to domain0. */
 /* "acpi=off":    Sisables both ACPI table parsing and interpreter. */
@@ -955,26 +955,9 @@ static struct domain *__init create_dom0(const module_t *image,
         }
     }
 
-    /*
-     * Temporarily clear SMAP in CR4 to allow user-accesses in construct_dom0().
-     * This saves a large number of corner cases interactions with
-     * copy_from_user().
-     */
-    if ( cpu_has_smap )
-    {
-        cr4_pv32_mask &= ~X86_CR4_SMAP;
-        write_cr4(read_cr4() & ~X86_CR4_SMAP);
-    }
-
     if ( construct_dom0(d, image, headroom, initrd, cmdline) != 0 )
         panic("Could not construct domain 0\n");
 
-    if ( cpu_has_smap )
-    {
-        write_cr4(read_cr4() | X86_CR4_SMAP);
-        cr4_pv32_mask |= X86_CR4_SMAP;
-    }
-
     return d;
 }
 
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 12:47:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 12:47:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783948.1193276 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivbF-00056E-CR; Tue, 27 Aug 2024 12:47:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783948.1193276; Tue, 27 Aug 2024 12:47:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivbF-000567-8v; Tue, 27 Aug 2024 12:47:05 +0000
Received: by outflank-mailman (input) for mailman id 783948;
 Tue, 27 Aug 2024 12:47:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sivbE-00053y-7c
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 12:47:04 +0000
Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com
 [2a00:1450:4864:20::12e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 755b89cc-6472-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 14:47:03 +0200 (CEST)
Received: by mail-lf1-x12e.google.com with SMTP id
 2adb3069b0e04-53346132365so6370538e87.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 05:47: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
 a640c23a62f3a-a86e582d658sm106142166b.99.2024.08.27.05.47.01
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 05:47:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 755b89cc-6472-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724762822; x=1725367622; 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=7Fcbd5gfGYgfYdd4EgpLTKcTATs3KULp5Wcu79qKzW0=;
        b=gPTGt7o/HffXwusW9h9iwjD+xdtcxB3CVSB6l6h9n0wgNzasm+l8Ws4vFXvYMHryaN
         f2R4W311q8ZnSVSughYCObhtrMZwnxpqdzC9vkvwtZF6eQlI7n+MP18SpDkGd5O8mUyb
         hLKMTsu6RyBSy3DYobRQJ6sNfIZpon+ST4j/DjpsnRSECf8fY400QDDePOjk5IeS+/T6
         unftLlFnvlB4HMA5Wt8oZA3Ld/IvS3bRTdjMsfIkhklJgWYIknmwnP05yHf1IEBBB0zY
         KcHBruEcVgWBFxWsvuwZYuKChJNEZiCORLJswXyi6WfUvJqJXbIPomG3aU9q/KNhIlhu
         Jw9g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724762822; x=1725367622;
        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=7Fcbd5gfGYgfYdd4EgpLTKcTATs3KULp5Wcu79qKzW0=;
        b=FqYWvnYrmmoUpbaTDCQkPrw/F2WlLQpVIbojJQbCJyVPw5xXY0sokbvW/ARbLctY6b
         d1oorCuopfRdN95PS+VbBGEGV/R/lW29zGVcuP1eiLCbXyaLGbEhiGgWIYpTq7LlCZJw
         li/m7lG+A2Vr2PQLwS4a8tse78kiljJydKsLTPLDZr81hkBUpRusirgd5Kt0quzEWBny
         zyGFKh49XzW87vn7MUJ3bWwrRj9QrTKHlPA9dg1vXwdvNMJQEDnknqMI+uNSj4kWttOK
         nWhcg1+5n2wzz/UAgaTW98EgCfgyHFYglb835u32IpzOznXP2HqK9eQ3gQHEkrivHtKG
         yMXQ==
X-Forwarded-Encrypted: i=1; AJvYcCU7OmQ7rGvIqDLUPWBuCq7W4oRg+X5gYBHL5pa3HRqQDaDBaUUxofXa0PRtFNZI5OmuSqEbTtqg/1w=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxnZeQo6dZq7MCElyMB6zCQEgRFEijtpb2ozZOPOMP/aAwuMONt
	xHr2yddCQBDa1RDlpyXfgwmc9/+nyxaz66Vh9nQowUkyT/K9jHb9jQI2ioeqhQ==
X-Google-Smtp-Source: AGHT+IFXkyiXzCW5qVYyXEVkH63Hi4iRumyfv0hUAVbO1oqLqOd2GDZ5Ai9IzzqiN6EqlgHwWcWp+g==
X-Received: by 2002:a05:6512:3a84:b0:52e:9c0a:3514 with SMTP id 2adb3069b0e04-5344e4f4329mr1578817e87.44.1724762822230;
        Tue, 27 Aug 2024 05:47:02 -0700 (PDT)
Message-ID: <89a5586b-bc9d-47da-a2b6-36e2208a6317@suse.com>
Date: Tue, 27 Aug 2024 14:47:01 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 9/9] x86/bitops: Use the POPCNT instruction when available
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-10-andrew.cooper3@citrix.com>
 <03febf18-516b-4677-a0a5-102036c91a29@suse.com>
 <3300b035-46d7-41d3-9908-1a0093c433e8@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <3300b035-46d7-41d3-9908-1a0093c433e8@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27.08.2024 13:17, Andrew Cooper wrote:
> On 26/08/2024 2:07 pm, Jan Beulich wrote:
>> On 23.08.2024 01:06, Andrew Cooper wrote:
>>> A few RFC points.
>>>
>>>  * I throught we had an x86 general lib-y but I can't find one, hence why it's
>>>    still in xen/lib/ for now.
>> We indeed have nothing like that yet. The file name should then imo not be
>> arch-* though, but x86-*. Or you could put it in xen/lib/x86/.
> 
> I was worried about xen/lib/x86/ and interfering with userspace.
> 
>> It could even
>> be obj-y rather than lib-y, unless you expect we'll be able to get rid of
>> all uses, which seems unlikely at least due to bitmap_weight(). Otoh with
>> my ABI-level series the call site in arch_hweightl() could then be made go
>> away for v2 and above, at which point it living in lib-y will be preferable.
> 
> Yes, I was specifically trying to account for this.
> 
> I'm expecting the mandatory-popcnt work to end up looking something like:
> 
> diff --git a/xen/arch/x86/include/asm/bitops.h
> b/xen/arch/x86/include/asm/bitops.h
> index 0db698ed3f4c..027eda60c094 100644
> --- a/xen/arch/x86/include/asm/bitops.h
> +++ b/xen/arch/x86/include/asm/bitops.h
> @@ -480,6 +480,9 @@ static always_inline unsigned int
> arch_hweightl(unsigned long x)
>  {
>      unsigned int r;
>  
> +    if ( IS_ENABLED(CONFIG_REQUIRE_POPCNT /* or whatever */) )
> +        return __builtin_popcountl(x);
> +
>      /*
>       * arch_generic_hweightl() is written in ASM in order to preserve all
>       * registers, as the compiler can't see the call.
> 
> 
> which in turn DCE's the alternative_io() and drops the reference to
> arch_generic_hweightl().

Right, that's along the lines of what I was thinking to re-base to once
your work has gone in. (I have close to zero hope that my work would be
going in first. [1]) Just that I don't think we'll have separate
CONFIG_REQUIRE_<feature> settings. Yet how exactly that wants structuring
is something we ought to discuss there, not here.

>>>  * When we up the minimum toolchain to GCC 7 / Clang 5, we can use a
>>>    __attribute__((no_caller_saved_registers)) and can forgo writing this in asm.
>>>
>>>    GCC seems to need extra help, and wants -mgeneral-regs-only too.  It has a
>>>    habit of complaining about incompatible instructions even when it's not
>>>    emitting them.
>> What is this part about? What incompatible instructions, in particular?
> 
> This was weird.  https://godbolt.org/z/4z1qzWbfE is an example.

That's because apparently in your experiments you didn't add -mno-sse. If you
incrementally add that, then -mno-mmx, then -msoft-float, you'll first see the
diagnostic change and then observe it to finally compile. And yes, from
looking at the gcc code emitting this error, this is solely tied to the ISAs
enabled at the time the function is being compiled. It's independent of the
choice of insns. Pretty clearly a shortcoming, imo.

>>> @@ -475,4 +476,24 @@ static always_inline unsigned int arch_flsl(unsigned long x)
>>>  }
>>>  #define arch_flsl arch_flsl
>>>  
>>> +static always_inline unsigned int arch_hweightl(unsigned long x)
>>> +{
>>> +    unsigned int r;
>>> +
>>> +    /*
>>> +     * arch_generic_hweightl() is written in ASM in order to preserve all
>>> +     * registers, as the compiler can't see the call.
>>> +     *
>>> +     * This limits the POPCNT instruction to using the same ABI as a function
>>> +     * call (input in %rdi, output in %eax) but that's fine.
>>> +     */
>>> +    alternative_io("call arch_generic_hweightl",
>>> +                   "popcnt %[val], %q[res]", X86_FEATURE_POPCNT,
>>> +                   ASM_OUTPUT2([res] "=a" (r) ASM_CALL_CONSTRAINT),
>>> +                   [val] "D" (x));
>> If you made [val] an output ("+D") you could avoid preserving the register
>> in the function. And I'd expect the register wouldn't be re-used often
>> afterwards, so its clobbering likely won't harm code quality very much.
> 
> "+D" means it's modified by the asm, which forces preservation of the
> register, if it's still needed afterwards.
> 
> Plain "D" means not modified by the asm, which means it can be reused if
> necessary.

And we likely would prefer the former: If the register's value isn't
use afterwards (and that's the case as far as the function on its own
goes), the compiler will know it doesn't need to preserve anything.
That way, rather than always preserving (in the called function)
preservation will be limited to just the (likely few) cases where the
value actually is still needed afterwards.

Jan

[1] "x86: allow Kconfig control over psABI level" actually has a suitable
    R-b, but its prereq "build: permit Kconfig control over how to deal
    with unsatisfiable choices" doesn't.


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 12:50:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 12:50:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783954.1193285 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siveT-0006yl-Pl; Tue, 27 Aug 2024 12:50:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783954.1193285; Tue, 27 Aug 2024 12:50:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siveT-0006ye-N1; Tue, 27 Aug 2024 12:50:25 +0000
Received: by outflank-mailman (input) for mailman id 783954;
 Tue, 27 Aug 2024 12:50:24 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siveS-0006yY-Nb
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 12:50:24 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ec5f79ea-6472-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 14:50:22 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a7a843bef98so527838966b.2
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 05:50:22 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e548620asm107721966b.8.2024.08.27.05.50.21
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 05:50:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ec5f79ea-6472-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724763022; x=1725367822; 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=2I9sb0rWyJjhiIrLbYmJiWJD2a3sWd93WXXkQtRBqDA=;
        b=B9mX8ZG1bmVHwsg8EFJ/mJT4DZNVBydvfjfMpFw6uWUvR6TPhWDbl7XengzK/As1ji
         alwqHQTIzQOL8eRtGmdid/+keLCl0HZObhwVzOX8wHecmPdgocuPBFJMwE7+hVfzpG1I
         vZw9TqA/onP03bvIhJp1NIXjLWefxsp42vo2GkPOM+ZDND6IBqkLyLWKQg/+I1W6Y3Ej
         ZHpZxr38ba/DZ7YqpZYmqIin/v1JAdaBaX6P+Z5cSMt+DdOwq5MO3etg69WmPqLu4W+/
         qnrCQ2V60ENnxShiGMLnkVOWJfVMpsXRfDQo90iNteXoKuyEYBJe+UOTfnG9imWRijrE
         FSAg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724763022; x=1725367822;
        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=2I9sb0rWyJjhiIrLbYmJiWJD2a3sWd93WXXkQtRBqDA=;
        b=aLJUY/8LNxAH+MkQh47AJZbeZQbSRZeyqCdI8yWvYox6ZKwDZyN3GbMC5LR2nAr13V
         2znYzPsEKRa/V7N61IFQZ5Qam7TznnLlgfij2kHJ+fMBiZqi/FRPDwABjIz/NHa+S2s2
         sF6Epz8Jqq7pa/udbj5l1Bet7b4I72mv22EEEegPTim1TpGolFZZKleooelP5UXhhVWB
         cOpGNBJgrbS4U551DS6W+aZmmwqqy0+joVNuQgXfQAUIseXthpQtQ3+dX/TPcR/lnU2q
         ZtvmDi+ZhLW3EA8thWUz60ao9jP8mvvLz0Ycyid+j/zyzbJdPs9k1j/BCuDI0tjG5LBH
         7VwQ==
X-Forwarded-Encrypted: i=1; AJvYcCXbv7DOfvd8YA0tvbTxK1qo4srvhD/alQOcqfMUUKv42lL2L5+vkTDeYO32jElKJoAd4vv48nSziAU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwsMK9ohlNH38DeI+kCWGSlcl946hjgYFhhT2XJZLzxsQzsGzJb
	naKazwXg9gyJ1JsvttVMSk+14+bbsGCtkBd27ZNc+un+5tAkeNV0Hh0gFVJEQQ==
X-Google-Smtp-Source: AGHT+IFc9+ZBM+KJFWYygc+PxUFmZcQk3XJRFYZhmFEDgOOymzP57rPhWip4FrlRfr2C+lOmNe7Jaw==
X-Received: by 2002:a17:907:6d07:b0:a86:7514:e646 with SMTP id a640c23a62f3a-a86a54d1473mr944738066b.42.1724763022117;
        Tue, 27 Aug 2024 05:50:22 -0700 (PDT)
Message-ID: <5521cd0f-6baf-4929-a2bd-9ebe67c99268@suse.com>
Date: Tue, 27 Aug 2024 14:50:20 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/9] xen/bitops: Introduce a multiple_bits_set() helper
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-3-andrew.cooper3@citrix.com>
 <841e2cde-6fc2-49d9-b947-534bd53bc00e@suse.com>
 <239165e3-6f96-452f-9c81-05f29012269f@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <239165e3-6f96-452f-9c81-05f29012269f@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27.08.2024 14:01, Andrew Cooper wrote:
> On 26/08/2024 11:30 am, Jan Beulich wrote:
>> On 23.08.2024 01:06, Andrew Cooper wrote:
>>> --- a/xen/common/bitops.c
>>> +++ b/xen/common/bitops.c
>>> @@ -84,8 +84,32 @@ static void __init test_fls(void)
>>>      CHECK(fls64, 0x8000000000000001ULL, 64);
>>>  }
>>>  
>>> +static void __init test_multiple_bits_set(void)
>>> +{
>>> +    /*
>>> +     * multiple_bits_set() is generic on the type of it's parameter, as the
>>> +     * internal expression is so simple.
>>> +     */
>>> +
>>> +    CHECK(multiple_bits_set, 0, false);
>>> +    CHECK(multiple_bits_set, 1, false);
>>> +    CHECK(multiple_bits_set, 2, false);
>>> +    CHECK(multiple_bits_set, 3, true);
>>> +
>>> +    CHECK(multiple_bits_set, 1 | (1UL << (BITS_PER_LONG - 1)), true);
>> This is really the same as ...
>>
>>> +#if BITS_PER_LONG > 32
>>> +    CHECK(multiple_bits_set, 1 | (1UL << 32), true);
>>> +    CHECK(multiple_bits_set, 1 | (1UL << 63), true);
>> ... this, at least as long as BITS_PER_LONG > 32 in practice means
>> BITS_PER_LONG == 64. Perhaps not really worth keeping that line?
> 
> I suppose not.  I'll drop it.
> 
> However, It occurs to me that I do need a test of 0x8000000000000001ULL
> mostly for 32bit builds to check that even when the argument is split,
> the answer is still accurate.

IOW you'll insert an #else in the middle. Fine with me; keep the R-b.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 12:57:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 12:57:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783962.1193295 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivlU-0008Gg-HB; Tue, 27 Aug 2024 12:57:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783962.1193295; Tue, 27 Aug 2024 12:57:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivlU-0008GZ-Ec; Tue, 27 Aug 2024 12:57:40 +0000
Received: by outflank-mailman (input) for mailman id 783962;
 Tue, 27 Aug 2024 12:57:39 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=qQW3=P2=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sivlT-0008GS-AI
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 12:57:39 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on2062b.outbound.protection.outlook.com
 [2a01:111:f403:2416::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id edfbf22a-6473-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 14:57:36 +0200 (CEST)
Received: from DS7PR03CA0202.namprd03.prod.outlook.com (2603:10b6:5:3b6::27)
 by SJ2PR12MB9006.namprd12.prod.outlook.com (2603:10b6:a03:540::17) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19; Tue, 27 Aug
 2024 12:57:27 +0000
Received: from DS2PEPF00003443.namprd04.prod.outlook.com
 (2603:10b6:5:3b6:cafe::28) by DS7PR03CA0202.outlook.office365.com
 (2603:10b6:5:3b6::27) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25 via Frontend
 Transport; Tue, 27 Aug 2024 12:57:27 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 DS2PEPF00003443.mail.protection.outlook.com (10.167.17.70) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7897.11 via Frontend Transport; Tue, 27 Aug 2024 12:57:27 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 27 Aug
 2024 07:57:26 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Tue, 27 Aug 2024 07:57:24 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: edfbf22a-6473-11ef-99a0-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=FmTIgfarZmbGwD/jYQRyg533hdAg0rKn7gejPFU71k01fZ7Es92Pjr2o21HRmYXsjMBKMpbxcg3Ux5DF30HSp9aapU6TeBr9A7Zs2Tfxa0kzgqjo/BZB7/0w3B9OyM7Gxv2bCH9Zpo0acU8YayhtfCMM/FImBMBzyJw6z1hMaFbmzja7WxWBeQVCEo6HUs06U1SbGwyWc6DN0RajzQgYZqiLeI894m55QQAq4hwEZaeWEEk2ZKqwf2+QCwu85z+pdQUSCXK3tWR2A9ZWSl5f6/O+o20sRUG2mhfM2UvBs4ftwCxhivGU14hqQJW+zb9d1WNVzc0KCBpI907r5QAtuQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=zuxYWRIwAEFWuqr//NuVQZLc/Pq2XWitwRavP23NVtI=;
 b=MJtOrPz0DHbcA/kYcoN57300JhpfJ0yv9j0CH3mMNxYxF0KRjDlokPPqIE/RH/k7ceUnJ1QtwkXoIywHv2MGW4aP+Kw53JuIv5VshA0yC79I98GNpTUjf5lJ5HqWZtO3gaQgp2uyImvfL3nam8y6OVZP7ORDS9R1NkGsDSYtcdC8Ie8lCReRbvSFJ2b+YYmxk2o3eAWSComgCWj9fEa/v6D2YyEGE5kRhTVRwpuYAkzxiL2ahDZTKN08GUuys7q02RZ83KLYFfUF1xDOG2yzMlHDWqcO965Empl73/uWAeDa12Z58BMVz8zw35P1at3+wnl+eqLMU8NaHvfIc3aqvA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=citrix.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=zuxYWRIwAEFWuqr//NuVQZLc/Pq2XWitwRavP23NVtI=;
 b=jo0V5/4gmTFDRAeJYF2lOYo1ZWq89E65CDgd9Hq8kI1kUOyqgJmZNrK3fIjHYhbDor45lXgYRuWOHeimbs3YrzFCuRP7qhoFJ3WYzAbuQMUBCCFZu6PERGOHSOoteLgsWQ5kf+JVB8lBiCmNB8i0wOnFAp1XNcI6zclEiQlFIBo=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <f3ef9244-9d16-47ab-bca3-d5bb4c34fcc2@amd.com>
Date: Tue, 27 Aug 2024 14:57:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] ARM/vgic: Use for_each_set_bit() in vgic_to_sgi()
To: Andrew Cooper <andrew.cooper3@citrix.com>, Xen-devel
	<xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Bertrand
 Marquis <bertrand.marquis@arm.com>, Jan Beulich <JBeulich@suse.com>
References: <20240823230100.1581448-1-andrew.cooper3@citrix.com>
 <6513e2ea-0471-41ca-b328-ce1bc1deddaf@amd.com>
 <a4c0b1d3-ff7a-4ea5-bffb-756125a434af@citrix.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <a4c0b1d3-ff7a-4ea5-bffb-756125a434af@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
Received-SPF: None (SATLEXMB04.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS2PEPF00003443:EE_|SJ2PR12MB9006:EE_
X-MS-Office365-Filtering-Correlation-Id: 7e44186c-b3dd-4b46-fc7b-08dcc697ce00
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?cHV5YzN5YmtPbXdTdEw3TVRicDZwUUF1RStRMElhdTdDRGNKcm5Tb3BTR0k5?=
 =?utf-8?B?aGtza0lZTGVsVkxkWFhBVTdPNGNPNUpYMXgxUjZVMkg2Z25TS1A1NTExU2ts?=
 =?utf-8?B?cEJYMFNVSUd2UFR0emNDY3JnRzI4NForRWExRHlHcEI0T0diMEpyVHd5enl2?=
 =?utf-8?B?MkRlTm9GOWF1WVp6anhxWmE5VWtNZ3BtRjZpUTJqN3dwaEJUZi9mNFBidWMw?=
 =?utf-8?B?K1BHeTBtUG14S1NneitxUG9xQUp1M1hRMm5oRzl3YnN3SUt6TWdhMHg2NENO?=
 =?utf-8?B?MTR2MW1ya1cyTlpEelZBUVFXSVV4THhtQWxBT3JHaUVHZDF3d20zbkR2bkhS?=
 =?utf-8?B?ZUhZRDFDU3Bwa2xvL3RmUEdjS1p5MDJDd3Azbi9lM1JUbGxMNm4zakQwdDNC?=
 =?utf-8?B?UjYrNjcxN1FrTFBIa3I3K1VKQ3JlWGgvbGsyVEFxNmZYYnBmL3NFTnMxaWJV?=
 =?utf-8?B?K0hrVUJobE01UnVlRUtINjVPRWVkK3E0bDNqRkpCRkM3cXVwU2FGWnl5bTlh?=
 =?utf-8?B?MTFiRCtEaEsvU0dRN0hrbFl3MzhQZkRoeGxTWVNvMGRJUVkycGc3WWEwR1FZ?=
 =?utf-8?B?TlZtZmpheEVDdUlQeGptZTI5S2luZGtHOG9aZUJLN2FFa3lOam9jYmpMaWkv?=
 =?utf-8?B?SWlRcDdlRjNHS1NvS0tkR2lHanZFTG5FbFkzTk5scGlKdGh0aURaMXo2U3Jt?=
 =?utf-8?B?MW95MmtvZlBZVzFMelErSmNudCt2bm80UWtJT3pwSWdHR0ViT1VVMXZHVkIr?=
 =?utf-8?B?YkhQQlNJTmgrQ0IzZ3RRaUErczBKaFpkcysyZ3F5VGxHb0YzRXkrNkhIY0tT?=
 =?utf-8?B?QkhJZjVrcUlJeEwvVXJFT2VGblhpNjR1d2YzYnk1anBtcTFMV2IyaHFlWU1p?=
 =?utf-8?B?cXI0YlltZkhSK29CeWZsUmlyQVdjMTd2WnZQdS9iL1Fla3ExZld2d05TcDR6?=
 =?utf-8?B?SzJMZncwQVYvVXo1WDNkMVRsdVBQWGJoc0trNVdSNUtXUEg5VmxwK0k3bEtk?=
 =?utf-8?B?dEp5aUdQUlJvMDVETjh0Q1JhUjVZT3IvYXB2ejlDWmwrMlhoWW9FOGEveTRX?=
 =?utf-8?B?cm9VVlJpU2c0aGRaM0k1N2hYd3FVUW5DSUJkY3ErUHpKQW14akJzTHpwRXpU?=
 =?utf-8?B?LzFtTVh1Tnhlc0hQQVA5bnArZWYvdWJpRURNZ2liR3dLZFBSQy9ZbXBlWnFX?=
 =?utf-8?B?N01JWC9heXl4NGpxcUVvWUY5Y1BTY2U1aENINUNkNGc4VXQvRkdCVi90aXJ1?=
 =?utf-8?B?QzlCalRQSXBHODdsWU1qbVRZSDY5VGRXZnNMMUJaRTVLc3dGSUZHY3VZQmdx?=
 =?utf-8?B?YWhWN04zYmhJdHlVcU1vZlRhekozMC9nakN2a3NNVlRUUHhTa1owR3dMSlJW?=
 =?utf-8?B?Ky9JZDJDRFVCU25DT2NmOTIyVi8vay9qVWgrWFpzMWgzWEI5ZmJMdGdncEw5?=
 =?utf-8?B?TlVneHZURlhxempSRTRDM2h5b0xlbUk4VWZnNGo5M2xoNDVRRkxMN1pPc21M?=
 =?utf-8?B?aVZqV1IrV29wdjNvdjhjOUpuYmJFZXZMcVlQYjZHckxyWktFQnFwU2hXYklT?=
 =?utf-8?B?ejJnRTFIR080WDJvUU9hb1ZrNmhEV0xaUVF0ZFBGMFg2WnVXSVh1VzlMSTBT?=
 =?utf-8?B?UndXRUkzU3owaUNMUkZFN2ZTd2RKRWhwVXkvc2FNYzdTSTdPY0xlUDkybUJs?=
 =?utf-8?B?cGhYbXhLWEoxajg2N2pZVkV2bG4zR3hpbjdvV1BJdVF1bFA1cjJ3c1FMbGdv?=
 =?utf-8?B?ajVVZCs0cFFqTVRzR2lnaTlOeXZHRTZCSWc4eW1LaWZzWkdHUGhHbTZVUHBG?=
 =?utf-8?B?cTB1QnBURlFpeFNwRFg5U1lTTnJRVGJEVVNvbFBHbTNmNDNIaEI4UEpqY2E2?=
 =?utf-8?B?R3RwaGJpakdxcDV2d2tJQlNhWFdRMGpjZWlhTUVsT3ZYNFh0UllDMnZvTzlK?=
 =?utf-8?Q?Lwx1jvxbBs2yVjdSbG1O11/NhWpr8iRt?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 12:57:27.6737
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 7e44186c-b3dd-4b46-fc7b-08dcc697ce00
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS2PEPF00003443.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB9006



On 27/08/2024 14:20, Andrew Cooper wrote:
> 
> 
> On 27/08/2024 1:13 pm, Michal Orzel wrote:
>>
>> On 24/08/2024 01:01, Andrew Cooper wrote:
>>>
>>> The existing expression is just a very complicated way of expressing a loop
>>> over all bits of target->list.  Simplify the expression.
>>>
>>> While here, fix the two gprintk()'s.  Because of a quotes vs line continuation
>>> issue, there's a long string of spaces in the middle of the format string.
>>>
>>>   $ strings xen-syms-arm32 | grep -e VGIC -e GICD_SGIR
>>>   <G><1>%pv VGIC: write r=%08x                         target->list=%hx, wrong CPUTargetList
>>>   <G><1>%pv vGICD:unhandled GICD_SGIR write %08x                  with wrong mode
>>>
>>> not to mention trailing whitespace too.
>>>
>>> Rewrite them to be more consise and more useful.  Use 0x prefixes for hex,
>> s/consise/concise
>>
>>> rather than ambigous, and identify the problem target vCPU / mode, rather than
>> s/ambigous/ambiguous
>>
>>> simply saying somethign was wrong.
>> s/somethign/something/
>>
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>> ---
>>> CC: Stefano Stabellini <sstabellini@kernel.org>
>>> CC: Julien Grall <julien@xen.org>
>>> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
>>> CC: Bertrand Marquis <bertrand.marquis@arm.com>
>>> CC: Michal Orzel <michal.orzel@amd.com>
>>> CC: Jan Beulich <JBeulich@suse.com>
>>>
>>> In a fun twist, we can't use target->list directly in the expresion, because
>>> the typeof() picks up constness from the pointer, and we get:
>>>
>>>   In file included from arch/arm/vgic.c:11:
>>>   arch/arm/vgic.c: In function ‘vgic_to_sgi’:
>>>   ./include/xen/bitops.h:305:19: error: assignment of read-only variable ‘__v’
>>>     305 |               __v &= __v - 1 )
>>>         |                   ^~
>>>   arch/arm/vgic.c:483:9: note: in expansion of macro ‘for_each_set_bit’
>>>     483 |         for_each_set_bit ( i, target->list )
>>>         |         ^~~~~~~~~~~~~~~~
>>>
>>> Sadly we need -std=c23 before we can use typeof_unqual() which is what we
>>> actually want here.
>>> ---
>>>  xen/arch/arm/vgic.c | 16 ++++++++--------
>>>  1 file changed, 8 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
>>> index 7b54ccc7cbfa..081cbb67fb52 100644
>>> --- a/xen/arch/arm/vgic.c
>>> +++ b/xen/arch/arm/vgic.c
>>> @@ -470,8 +470,7 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
>>>      struct domain *d = v->domain;
>>>      int vcpuid;
>>>      int i;
>>> -    unsigned int base;
>>> -    unsigned long int bitmap;
>>> +    unsigned int base, bitmap;
>>>
>>>      ASSERT( virq < 16 );
>>>
>>> @@ -481,15 +480,16 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
>>>          perfc_incr(vgic_sgi_list);
>>>          base = target->aff1 << 4;
>>>          bitmap = target->list;
>>> -        bitmap_for_each ( i, &bitmap, sizeof(target->list) * 8 )
>>> +
>>> +        for_each_set_bit ( i, bitmap )
>>>          {
>>>              vcpuid = base + i;
>>>              if ( vcpuid >= d->max_vcpus || d->vcpu[vcpuid] == NULL ||
>>>                   !is_vcpu_online(d->vcpu[vcpuid]) )
>>>              {
>>> -                gprintk(XENLOG_WARNING, "VGIC: write r=%"PRIregister" \
>>> -                        target->list=%hx, wrong CPUTargetList \n",
>>> -                        sgir, target->list);
>>> +                gprintk(XENLOG_WARNING,
>>> +                        "vGIC: write %#"PRIregister", target->list=%#x, bad target v%d\n",
>> Sth like "bad target v2" where the word vcpu does not occur anywhere in the msg can be ambiguous.
>> Can you add the word vcpu e.g. "bad vcpu target v%d" or "bad target vcpu %d"
> 
> Hmm yeah, v%d doesn't work quite so well when it's not prefixed with d%d.
> 
> Would you be happy with d%dv%d?  It's marginally more informative and
> shorter.
I don't think we can target a different domain with SGIs, so it does not make much sense to print domain id if
it always stays the same as the leading %pv from gprintk.

~Michal


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 12:59:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 12:59:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783969.1193305 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivn8-0000rF-V3; Tue, 27 Aug 2024 12:59:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783969.1193305; Tue, 27 Aug 2024 12:59:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivn8-0000r8-SG; Tue, 27 Aug 2024 12:59:22 +0000
Received: by outflank-mailman (input) for mailman id 783969;
 Tue, 27 Aug 2024 12:59:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sivn7-0000r2-VY
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 12:59:21 +0000
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com
 [2a00:1450:4864:20::62a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2d3f3c88-6474-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 14:59:21 +0200 (CEST)
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a86e9db75b9so82887666b.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 05:59:21 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e54850b6sm107345366b.23.2024.08.27.05.59.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 05:59:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2d3f3c88-6474-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724763560; x=1725368360; 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=cvlNN94vkzG+IFoTEbK6gQ9Z93hiR62VCIYzk9adO40=;
        b=dq2CRjzNErtjpIvJ4BZYojQSEURXydScbCVkmne53CMfbn2nSltxuQtN4nh9SCPHKG
         TN0HaMK4ynqxyd4TQwuIeA/hDlZcXkIgT0ey3rl9TVgEfwLZjNOx01AR+hNZU/8xs34x
         EdLi97wVN2TPniILjbHqrjuunmLL2GhIy1Wpw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724763560; x=1725368360;
        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=cvlNN94vkzG+IFoTEbK6gQ9Z93hiR62VCIYzk9adO40=;
        b=uynP4wI7MCOpIFqHjbP3o34lFjN36zpaeeyQS+C/fFmYf0/O/rb4KP934iUAPMQ8Vs
         NBVKl9OKT0PODdCTxHCBYGJo0YxzY83fgqxcOsTZoRLBrAkWZ35R8oscEnZI51tnz5Zq
         N/yXVlmmJAqnf5XLuuzUmS+5VCsQPvVeM2NAGY9vGfddNzvzPj98cuyViTKa8mK3eQg4
         g2LtiPAEsdlS1I9M6jlHc/3u4uFLIuFWw1DusZhom2LGOzTNT61HIAuURIT1gv9lU3UX
         6mc6R/8Aiiat2uLe1pCjsNe1O95L6BTd/rsD6aaBEDnaW1WYH604GwtzqTPFjy3U7cTH
         Xf9A==
X-Forwarded-Encrypted: i=1; AJvYcCVWkK3moHefb/plERUDDdfOOVMEgIQXK42l9ksV1C1o95QvaKyocvVHaGbibiqmHnPDsGU5XQtXPwM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwAx/RZA+qkZtgDj0Hy1aRo8QLGr++PDfA64GpjW3g0UZUjkttw
	yyQ1LIkI+tGfFrIxvSFcdsWl5ATNxE7hugrCbt/48D8GPDBkksNvKLBsmHrJH7AZwVDa57LNEl8
	k
X-Google-Smtp-Source: AGHT+IGWnf6l4KL7/z27eYW3x79xkdm3+VGwPA04thGtScErWKh+ztnuYcEHD9M/VcDF5eFIHvVXtw==
X-Received: by 2002:a17:907:7246:b0:a77:c6c4:2bb7 with SMTP id a640c23a62f3a-a86a5165450mr1064711966b.1.1724763560062;
        Tue, 27 Aug 2024 05:59:20 -0700 (PDT)
Message-ID: <734d41c3-709c-4286-8353-f5483b0987cb@citrix.com>
Date: Tue, 27 Aug 2024 13:59:18 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5] x86/dom0: disable SMAP for PV domain building only
To: Roger Pau Monne <roger.pau@citrix.com>, xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>
References: <20240827123949.24400-1-roger.pau@citrix.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20240827123949.24400-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27/08/2024 1:39 pm, Roger Pau Monne wrote:
> Move the logic that disables SMAP so it's only performed when building a PV
> dom0, PVH dom0 builder doesn't require disabling SMAP.
>
> The fixes tag is to account for the wrong usage of cpu_has_smap in
> create_dom0(), it should instead have used
> boot_cpu_has(X86_FEATURE_XEN_SMAP).  Fix while moving the logic to apply to PV
> only.
>
> While there also make cr4_pv32_mask __ro_after_init.
>
> Fixes: 493ab190e5b1 ('xen/sm{e, a}p: allow disabling sm{e, a}p for Xen itself')
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Changes since v4:
>  - New approach, move the current logic so it's only applied when creating a PV
>    dom0.
> ---
>  xen/arch/x86/dom0_build.c        | 17 +++++++++++++++++
>  xen/arch/x86/include/asm/setup.h |  2 ++
>  xen/arch/x86/setup.c             | 19 +------------------
>  3 files changed, 20 insertions(+), 18 deletions(-)
>
> diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
> index 8d56705a0861..31c94b14bb06 100644
> --- a/xen/arch/x86/dom0_build.c
> +++ b/xen/arch/x86/dom0_build.c
> @@ -612,7 +612,24 @@ int __init construct_dom0(struct domain *d, const module_t *image,
>      if ( is_hvm_domain(d) )
>          rc = dom0_construct_pvh(d, image, image_headroom, initrd, cmdline);
>      else if ( is_pv_domain(d) )
> +    {
> +        /*
> +         * Temporarily clear SMAP in CR4 to allow user-accesses in
> +         * construct_dom0().  This saves a large number of corner cases
> +         * interactions with copy_from_user().
> +         */
> +        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> +        {
> +            cr4_pv32_mask &= ~X86_CR4_SMAP;
> +            write_cr4(read_cr4() & ~X86_CR4_SMAP);
> +        }
>          rc = dom0_construct_pv(d, image, image_headroom, initrd, cmdline);
> +        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> +        {
> +            write_cr4(read_cr4() | X86_CR4_SMAP);
> +            cr4_pv32_mask |= X86_CR4_SMAP;
> +        }
> +    }

I hate to drag this on further still, but can this logic be move it into
dom0_construct_pv() itself, rather than here?

That way, it won't need moving again to make cr4_pv32_mask exist only in
PV32 builds.  (This step is somewhat tricky, so I'm not suggesting doing
it in this patch.)

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:01:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:01:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783974.1193316 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivol-0002Ja-Am; Tue, 27 Aug 2024 13:01:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783974.1193316; Tue, 27 Aug 2024 13:01:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivol-0002JT-6U; Tue, 27 Aug 2024 13:01:03 +0000
Received: by outflank-mailman (input) for mailman id 783974;
 Tue, 27 Aug 2024 13:01: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=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sivok-0002JL-5v
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 13:01:02 +0000
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [2a00:1450:4864:20::534])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 68e2a0fc-6474-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 15:01:01 +0200 (CEST)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5c0a9ae3665so2534485a12.0
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 06:01:01 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e582d329sm107017366b.108.2024.08.27.06.00.59
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 06:01:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 68e2a0fc-6474-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724763660; x=1725368460; 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=e/Y37xa5dmOu2WJNrgkdELJh6zKVgnLEPOXYENeQDW8=;
        b=alm9qkL3ad0ZgRTWmlR0tPpeTgbHI0qk7scOfK5NOyxPMOvaUbC8YrSBrFkI37ArlW
         DIi0btLLg69E0HjxsirGjlwQ3Q3LEKXV73IIMadP7AhWt0IOpec1w+NyBkuu8lBrJAfK
         wz++VnQyjhoG//0K2D6+560g5hrouICvIed44okbzjwbr4mggsY9+dW9MxXHEfbvZhHQ
         rH8hAOkQLX17m6/duL6iVnBBwyQrKOgzAiGgT6UiLhOLEvUA8ruAkgo249w7hCgtS40O
         0tM0uFngf3gHiYPKWsoVovePwQ99b3wjXZ8O24PLC2W40Ksf7aE8CSsBTKqharhgw4rk
         VdWQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724763660; x=1725368460;
        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=e/Y37xa5dmOu2WJNrgkdELJh6zKVgnLEPOXYENeQDW8=;
        b=A6fCK6yxvq3+LYKXOdkW3UnLIEw9OeVFdWIgD0hkLogycr/dsXxg5gwRHajLImbVXy
         gjOrUVmZDj2aMRstgdrpdSBfROe4Sk42IA0tSPbb3lv936fiQWmvAEZjisFqprtpKaCQ
         oKVYVmLt7uoN6TgfaS3AIRXimt9XXAIWz0FVo5rs5TkU4Ya0jS8VGoaGXIkqNs+9x33l
         OGAvqgrmltJDhutJBABaEGM1eW1OTqyKBn3r3d1DPFs8uLsnQzW/erLYNTweb1XaxYjh
         eVtI9OXEG/BMTDbPJsk09e+wJz+i/KwnlU7REmaIV9+PPDobEnfudfJuIZwtiENiBbDt
         2wJA==
X-Forwarded-Encrypted: i=1; AJvYcCWSwNqv9WlQSEQfUvnmY1bJPS9czBiBXlSVSQ6lJIQyiwfzPlXUi8pRYdfuIAGgncGnQd0/xuBFEkk=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw/fTjCPsXfAKn2PgPbnjOsu42tFsF/q9Ysj/IftK5yAv3+oNZO
	8oobr+HTY3iex6t6UKGuKGlTaGSh+S6Pq1mLNAyB8vUVHZubFknlNxsyfbOOQg==
X-Google-Smtp-Source: AGHT+IESf0thDUfvLP26gREXEAlfFn24pb5NvaQ1mPmSsNHUi4m5dfhfHIwE7gGBVTCGpycn6D7dCw==
X-Received: by 2002:a17:907:ea5:b0:a86:9ba1:639e with SMTP id a640c23a62f3a-a86e39dcb21mr192839766b.26.1724763660324;
        Tue, 27 Aug 2024 06:01:00 -0700 (PDT)
Message-ID: <73309650-3912-418b-b2e6-a60676519911@suse.com>
Date: Tue, 27 Aug 2024 15:00:59 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 7/9] xen/bitops: Implement hweight64() in terms of
 hweightl()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-8-andrew.cooper3@citrix.com>
 <11da1350-095f-49c8-bdf0-f5c83e9f0d39@suse.com>
 <70047ef7-ca22-4eeb-9510-09ccdf0871c0@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <70047ef7-ca22-4eeb-9510-09ccdf0871c0@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27.08.2024 13:50, Andrew Cooper wrote:
> On 26/08/2024 12:55 pm, Jan Beulich wrote:
>> On 23.08.2024 01:06, Andrew Cooper wrote:
>>> --- a/xen/include/xen/bitops.h
>>> +++ b/xen/include/xen/bitops.h
>>> @@ -302,6 +302,14 @@ static always_inline __pure unsigned int hweightl(unsigned long x)
>>>  #endif
>>>  }
>>>  
>>> +static always_inline __pure unsigned int hweight64(uint64_t x)
>>> +{
>>> +    if ( BITS_PER_LONG == 64 )
>>> +        return hweightl(x);
>>> +    else
>>> +        return hweightl(x >> 32) + hweightl(x);
>> This assume BITS_PER_LONG == 32, which of course is true right now, but
>> doesn't need to be in general. Better add an explicit cast to uint32_t
>> (or masking by 0xffffffffU)?
> 
> This is part of the point of putting in the self-tests.  They're
> intended to catch things like this in new build environments.

I don't think I saw any testcase where the result would be wrong if
this split didn't truncate x to the low 32 bits on the rhs of the +.

> Although, I think we've got enough cases which will #error on
> BITS_PER_LONG not being 32 or 64.

My take on this is: Such checks (#error or whatever else precaution)
should like in every single place where violating the assumptions
made would matter. Or else - how do you locate all the places that
need changing?

> Again, this is modelled after f[fl]s64() which have the same
> expectations about the BITS_PER_LONG != 64 case.

Both of them are fine afaict. fls64() has an explicit intermediate
variable of type uint32_t, and ffs64() has a (uint32_t)x as part
of the conditional expression achieving the intended effect.

Anyway, why not use hweight32() instead of hweightl() here? That'll
make things very explicit.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:05:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:05:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783979.1193325 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivsZ-0002tx-OK; Tue, 27 Aug 2024 13:04:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783979.1193325; Tue, 27 Aug 2024 13:04:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivsZ-0002tq-Lp; Tue, 27 Aug 2024 13:04:59 +0000
Received: by outflank-mailman (input) for mailman id 783979;
 Tue, 27 Aug 2024 13:04:58 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sivsY-0002tk-8c
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 13:04:58 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f5143e4a-6474-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 15:04:56 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a86883231b4so712123466b.3
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 06:04:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e582d664sm107939666b.137.2024.08.27.06.04.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 06:04:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f5143e4a-6474-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724763896; x=1725368696; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=2cJyZ6jcBQ7XZe4IFkWICAiqGmBRi+aikbjmzxCnGvE=;
        b=WmC6JoSW239/78Uzw+dm03tWYTWWPuafQ23S7JhBcKJyIchDFRntAfjF1Y35ZjKZNG
         2efVq/BJxgsWRtmp7pKciatdduGc9KK+r0jBYtARiRDquVYFilypyo+GSRl3QM3uzcr4
         EYnbNNsHb/3m4CCe+UzcraBd4zG0c/BmDR8AQVHw3rqwdGyZRNyzVjEZxQFl08gRvw3m
         OzrsP2VsaZfXEYatjnd3S61EhbVWw8TbmdAIaEVXjXVTWZdM0yPBYN0acxicKBCE3Ah3
         2X2MrxRY28EjVWZNAYl9omYLJO/JbTESvCO90GXGy7V4WxOTFXzXodWJsK0HQqj2w6nq
         MRrg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724763896; x=1725368696;
        h=content-transfer-encoding:in-reply-to:autocrypt:from:cc
         :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=2cJyZ6jcBQ7XZe4IFkWICAiqGmBRi+aikbjmzxCnGvE=;
        b=ZzSlZ4+piOoGEuWqz3i67Kj9mcch59yOKaSdY4UZuZH5PsGPTMfOlJqLoVRMy+YD6l
         fQK/d0sILwPAzymY/ThCgSV5GcpRxnm0KzkkaEmtEy1wrKFA67nT19Oh2yl0LNd6/iBD
         ofgj0I/RbEA16kIV9brP+CkwspNpFNihQDOFh2JMHCdlCLwp28/c4Liu+nw05xx+8hPH
         OyjSLJdzRW5saD+mvT4O5wzAGq1fwpgcCNi+a9m6s949irn3yCfZMi0rTO0bNOjPqLJa
         CCeq6Ztqi2BJ8GcGLB4cmelESuwUQwRvU/mQdLJgDYk4h5+gPtjeIDaTrdaF8dbCLTUE
         KaSg==
X-Forwarded-Encrypted: i=1; AJvYcCWs/9lCZUetp3N/hlxCbML2WstHGm1Oc5YdBQbv6LUr7SwSztrxtbODg+GrZhpyhn4AXd0vbGWr+W8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzN6N0BZnS0XZt2ORd6rDgSuTeceVFtpRm0lT+nSFARdKF2KVL2
	DV3nOkBP/Y6M3C99C00L+1x+8czrcouSfqLQi+3WTengd3cj3aNq/qCU3yzNOA==
X-Google-Smtp-Source: AGHT+IHQtvh1kil61sGnP0e97pCeSuWqcGQ2w4z8axtA0qL8fzmlHvZZJurVnP2C4ltTqXOCxKc0EQ==
X-Received: by 2002:a17:906:6a14:b0:a86:6a26:fec7 with SMTP id a640c23a62f3a-a86a52c70ecmr1011399366b.30.1724763895555;
        Tue, 27 Aug 2024 06:04:55 -0700 (PDT)
Message-ID: <d939dffc-e8e3-40cf-8494-c03ae6978c90@suse.com>
Date: Tue, 27 Aug 2024 15:04:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5] x86/dom0: disable SMAP for PV domain building only
To: Andrew Cooper <andrew.cooper3@citrix.com>
References: <20240827123949.24400-1-roger.pau@citrix.com>
 <734d41c3-709c-4286-8353-f5483b0987cb@citrix.com>
Content-Language: en-US
Cc: Roger Pau Monne <roger.pau@citrix.com>, xen-devel@lists.xenproject.org
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+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: <734d41c3-709c-4286-8353-f5483b0987cb@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27.08.2024 14:59, Andrew Cooper wrote:
> On 27/08/2024 1:39 pm, Roger Pau Monne wrote:
>> --- a/xen/arch/x86/dom0_build.c
>> +++ b/xen/arch/x86/dom0_build.c
>> @@ -612,7 +612,24 @@ int __init construct_dom0(struct domain *d, const module_t *image,
>>      if ( is_hvm_domain(d) )
>>          rc = dom0_construct_pvh(d, image, image_headroom, initrd, cmdline);
>>      else if ( is_pv_domain(d) )
>> +    {
>> +        /*
>> +         * Temporarily clear SMAP in CR4 to allow user-accesses in
>> +         * construct_dom0().  This saves a large number of corner cases
>> +         * interactions with copy_from_user().
>> +         */
>> +        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
>> +        {
>> +            cr4_pv32_mask &= ~X86_CR4_SMAP;
>> +            write_cr4(read_cr4() & ~X86_CR4_SMAP);
>> +        }
>>          rc = dom0_construct_pv(d, image, image_headroom, initrd, cmdline);
>> +        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
>> +        {
>> +            write_cr4(read_cr4() | X86_CR4_SMAP);
>> +            cr4_pv32_mask |= X86_CR4_SMAP;
>> +        }
>> +    }
> 
> I hate to drag this on further still, but can this logic be move it into
> dom0_construct_pv() itself, rather than here?

Just to mention it: I'm fine with this in principle, as long as this won't
mean a pile of new goto-s in dom0_construct_pv(). If a new wrapper was
introduced (with the present function becoming static), I'd be okay.

Jan

> That way, it won't need moving again to make cr4_pv32_mask exist only in
> PV32 builds.  (This step is somewhat tricky, so I'm not suggesting doing
> it in this patch.)
> 
> ~Andrew



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:07:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:07:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783988.1193336 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivuj-0004QK-4g; Tue, 27 Aug 2024 13:07:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783988.1193336; Tue, 27 Aug 2024 13:07:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sivuj-0004QD-1S; Tue, 27 Aug 2024 13:07:13 +0000
Received: by outflank-mailman (input) for mailman id 783988;
 Tue, 27 Aug 2024 13:07:12 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sivui-0004Q7-4v
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 13:07:12 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 44d56ef5-6475-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 15:07:10 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a86910caf9cso888131366b.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 06:07:10 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e587843fsm107611966b.153.2024.08.27.06.07.08
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 06:07:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 44d56ef5-6475-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724764030; x=1725368830; 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=EliJMsrrSKcenuCp0uAOrekseEJQ3lX7hHDsWNwYTl0=;
        b=Sy2v7UNvCIDu58T+XDQoeOeaCoZCD8k18nhsUtwnp9PHegd9qdCIZl1/AN/CtOiYbf
         NUCmvlj7lWaNf7kwhGMbwhf+3+WONF5XoUWpX6nszSxyeXAV/zxT2wB92LzHq5mRAfwG
         1K7Bj2u6/UAttXEE6ndZYatw/6v5IIrBSGgAM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724764030; x=1725368830;
        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=EliJMsrrSKcenuCp0uAOrekseEJQ3lX7hHDsWNwYTl0=;
        b=IXC5LmfQTUpjCPCJ/VENWIhafMRbI3FEcM6wVDxpEIr38jr/FEMHFL52xyxXLW2QY1
         pYHri54bSAN537Dy/Bp8pJ5ACxHn1xxTRRefV8pvk//jveuzVlEHry9xyg8wyVcxlCj8
         EEJ+7/4/qkOMIjtvFxoz5nyn3AKaDiV54KctyMfmJmW/QXtRp2sIrhHPLFmnBNQynyeb
         RukFdDvpEZH77V+xBQAfWYV4hoBMSUoSgWEPTpSr5AkubvGS0uOXVV3WdN9n1tph8jgc
         IQ9eKTYmG5p2hDbwFtPmEsW7o48ylldPZHgDcQ8YSuxZMF9kJFr0uTiY5hfrkA3/Hd9/
         5nSA==
X-Forwarded-Encrypted: i=1; AJvYcCWX8s7wdr136XtCI0MQ53A2tvH4Q9XhIEb3BcPnvc8epcwvWeey5HTtav8BDUxxT5ftK03pjk7Bxb8=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy0eXRCIngsayMgXXCOW3iYWhRUAdl6VewNL9lOcDeLCD7Su34y
	WxOuSLtUEiLzh9Ygckbxk1aB60bynECmr221mZpjz2ffBCCAh3TaOtAW9yPRhSU=
X-Google-Smtp-Source: AGHT+IHrs6X6OXJt6wGY9nO/i1ilZG0YEz4wZRNvikNONncS7DWZ94oRwCcyLtnqNQmCaehC/uKbkg==
X-Received: by 2002:a17:906:6a0a:b0:a72:4207:479b with SMTP id a640c23a62f3a-a86e28951a0mr323797066b.5.1724764029158;
        Tue, 27 Aug 2024 06:07:09 -0700 (PDT)
Message-ID: <4822571d-efe9-4cab-a016-70ee5f21c256@citrix.com>
Date: Tue, 27 Aug 2024 14:07:07 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5] x86/dom0: disable SMAP for PV domain building only
To: Jan Beulich <jbeulich@suse.com>
Cc: Roger Pau Monne <roger.pau@citrix.com>, xen-devel@lists.xenproject.org
References: <20240827123949.24400-1-roger.pau@citrix.com>
 <734d41c3-709c-4286-8353-f5483b0987cb@citrix.com>
 <d939dffc-e8e3-40cf-8494-c03ae6978c90@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <d939dffc-e8e3-40cf-8494-c03ae6978c90@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 27/08/2024 2:04 pm, Jan Beulich wrote:
> On 27.08.2024 14:59, Andrew Cooper wrote:
>> On 27/08/2024 1:39 pm, Roger Pau Monne wrote:
>>> --- a/xen/arch/x86/dom0_build.c
>>> +++ b/xen/arch/x86/dom0_build.c
>>> @@ -612,7 +612,24 @@ int __init construct_dom0(struct domain *d, const module_t *image,
>>>      if ( is_hvm_domain(d) )
>>>          rc = dom0_construct_pvh(d, image, image_headroom, initrd, cmdline);
>>>      else if ( is_pv_domain(d) )
>>> +    {
>>> +        /*
>>> +         * Temporarily clear SMAP in CR4 to allow user-accesses in
>>> +         * construct_dom0().  This saves a large number of corner cases
>>> +         * interactions with copy_from_user().
>>> +         */
>>> +        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
>>> +        {
>>> +            cr4_pv32_mask &= ~X86_CR4_SMAP;
>>> +            write_cr4(read_cr4() & ~X86_CR4_SMAP);
>>> +        }
>>>          rc = dom0_construct_pv(d, image, image_headroom, initrd, cmdline);
>>> +        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
>>> +        {
>>> +            write_cr4(read_cr4() | X86_CR4_SMAP);
>>> +            cr4_pv32_mask |= X86_CR4_SMAP;
>>> +        }
>>> +    }
>> I hate to drag this on further still, but can this logic be move it into
>> dom0_construct_pv() itself, rather than here?
> Just to mention it: I'm fine with this in principle, as long as this won't
> mean a pile of new goto-s in dom0_construct_pv(). If a new wrapper was
> introduced (with the present function becoming static), I'd be okay.

I'd be happy with that too.

In fact, static helpers are probably best, seeing as we'll eventually
need real #ifdefary around the cr4_pv32_mask accesses.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:19:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:19:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.783999.1193345 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siw6D-0007KB-6V; Tue, 27 Aug 2024 13:19:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 783999.1193345; Tue, 27 Aug 2024 13:19:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siw6D-0007K4-41; Tue, 27 Aug 2024 13:19:05 +0000
Received: by outflank-mailman (input) for mailman id 783999;
 Tue, 27 Aug 2024 13:19:04 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siw6C-0007Ju-K9; Tue, 27 Aug 2024 13:19:04 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siw6C-0006yJ-Cp; Tue, 27 Aug 2024 13:19:04 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1siw6C-0000T4-4n; Tue, 27 Aug 2024 13:19:04 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1siw6C-0002ar-4J; Tue, 27 Aug 2024 13:19:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=gUFUPLnvtIAPJy1lTugmItsiBWvzBCBgOAz+g2r74qQ=; b=G4p5hwAmL9qcdv32w3zXgs2ACp
	7/wYb+CunzaNifmmi1s+ldmPtuHkWdMBfV8t52mCdk6+Rh8HC++WHPMXjGYJSYAbB92spOW3uCyOT
	kctyNZLKjgXhm71UsU2Rpgj4bBX8QPinEpbGQimd6ukYllL+yWknywCZW4xA7sxA+k7c=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187357-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187357: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=1b815465d9d523aacc4b7ab63c247cc2e6cefa64
X-Osstest-Versions-That:
    libvirt=0888784f38704718592c88ad149c426f3943298c
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 27 Aug 2024 13:19:04 +0000

flight 187357 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187357/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187318
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 libvirt              1b815465d9d523aacc4b7ab63c247cc2e6cefa64
baseline version:
 libvirt              0888784f38704718592c88ad149c426f3943298c

Last test of basis   187318  2024-08-23 04:22:07 Z    4 days
Testing same since   187357  2024-08-27 04:22:23 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  aokblast <aokblast@FreeBSD.org>
  jianqing yan <yanjianqing@kylinos.cn>
  Michal Privoznik <mprivozn@redhat.com>
  Peter Krempa <pkrempa@redhat.com>
  Praveen K Paladugu <prapal@linux.microsoft.com>
  Praveen K Paladugu <praveenkpaladugu@gmail.com>
  Tim Wiederhake <twiederh@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   0888784f38..1b815465d9  1b815465d9d523aacc4b7ab63c247cc2e6cefa64 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:21:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:21:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784009.1193355 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siw86-0000YW-Im; Tue, 27 Aug 2024 13:21:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784009.1193355; Tue, 27 Aug 2024 13:21:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siw86-0000YP-GJ; Tue, 27 Aug 2024 13:21:02 +0000
Received: by outflank-mailman (input) for mailman id 784009;
 Tue, 27 Aug 2024 13:21:01 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CYmO=P2=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1siw85-0000YH-5t
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 13:21:01 +0000
Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com
 [2607:f8b0:4864:20::82c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3259bfd1-6477-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 15:20:58 +0200 (CEST)
Received: by mail-qt1-x82c.google.com with SMTP id
 d75a77b69052e-44ff132ff9cso28409341cf.2
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 06:20:58 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 d75a77b69052e-454fe199471sm52645961cf.59.2024.08.27.06.20.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 27 Aug 2024 06:20:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3259bfd1-6477-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724764857; x=1725369657; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=A6FATiIuItaulb+xyY3jzG0ahY0JFgsPvDjCNdsUmnE=;
        b=BqrxKi2u195pWPWdn+gZBRs2mcKJfP0Il2yJGmsFFHBEx/zfvxWMesmAulyCPEva74
         OJ4UhyvR+ZIiVavJ+ToyUOGVunOouipb/+nxTabEISJs6wfES4U47LanaWtSlDJ7pajI
         GeZKObsM6NiSD3U1XUHM7yo18Bfq8GEz+oQH0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724764857; x=1725369657;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=A6FATiIuItaulb+xyY3jzG0ahY0JFgsPvDjCNdsUmnE=;
        b=at2CKrJPSiIi51fSMy9K2AIqkexgUlggZuTc8hLvaNfAc8gCsEh1cDpOBbte/6W081
         35HK+qadUKvfAk4Z5aM6i2sWCknzNzbib8yB9l9IzuavO2jE5ls+fW0JcQEDrV5XQhc7
         27cDfRjuhPhnP7nHVIBUfBz0oWAQ0ESxlF5AR0inmUNcIwmx0GkoGRmfguIVGGExyMuO
         oP6+5Jv7xn0UhQINk5/gzpWo8y4YR5bX7P8Gcqaj2WHahrEjPtMdoam+0XE10XuIahtG
         C8M7B7VMLJKKDKs0zeuamD0ITDKpTT7wEbT5i8zQfC0hDjguvbPhWONZzSAgEMMblq1F
         fOGQ==
X-Gm-Message-State: AOJu0YzWJrB2BNAdklmvhG51PGx1lrmn26Jc2+fWvRYPPXHMSn6oNI5g
	ILO3dEdCotaAMm5Dj30qDjbrsehHIoRfewuWQ4KrStic6lktBsj0Mo1WsxC075M=
X-Google-Smtp-Source: AGHT+IGByl62vxk+ytl0Mtj8nWpoVrlAapMjdGVqcV4zAQDaQTQYK8kzDTqesTfOcgVNczNrkk7o5w==
X-Received: by 2002:a05:622a:1924:b0:446:3add:2cf7 with SMTP id d75a77b69052e-455097dc009mr142217541cf.56.1724764857221;
        Tue, 27 Aug 2024 06:20:57 -0700 (PDT)
Date: Tue, 27 Aug 2024 15:20:52 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Teddy Astie <teddy.astie@vates.tech>
Subject: Re: [PATCH v4] x86/msi: fix locking for SR-IOV devices
Message-ID: <Zs3StA1aZJi5ffZj@macbook.local>
References: <20240827035929.118003-1-stewart.hildebrand@amd.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <20240827035929.118003-1-stewart.hildebrand@amd.com>

On Mon, Aug 26, 2024 at 11:59:28PM -0400, Stewart Hildebrand wrote:
> In commit 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci
> structure") a lock moved from allocate_and_map_msi_pirq() to the caller
                    ^ was?
> and changed from pcidevs_lock() to read_lock(&d->pci_lock). However, one
> call path wasn't updated to reflect the change, leading to a failed
> assertion observed under the following conditions:
> 
> * PV dom0
> * Debug build (debug=y) of Xen
> * There is an SR-IOV device in the system with one or more VFs enabled
> * Dom0 has loaded the driver for the VF and enabled MSI-X
> 
> (XEN) Assertion 'd || pcidevs_locked()' failed at drivers/passthrough/pci.c:535
> (XEN) ----[ Xen-4.20-unstable  x86_64  debug=y  Not tainted ]----
> ...
> (XEN) Xen call trace:
> (XEN)    [<ffff82d040284da8>] R pci_get_pdev+0x4c/0xab
> (XEN)    [<ffff82d040344f5c>] F arch/x86/msi.c#read_pci_mem_bar+0x58/0x272
> (XEN)    [<ffff82d04034530e>] F arch/x86/msi.c#msix_capability_init+0x198/0x755
> (XEN)    [<ffff82d040345dad>] F arch/x86/msi.c#__pci_enable_msix+0x82/0xe8
> (XEN)    [<ffff82d0403463e5>] F pci_enable_msi+0x3f/0x78
> (XEN)    [<ffff82d04034be2b>] F map_domain_pirq+0x2a4/0x6dc
> (XEN)    [<ffff82d04034d4d5>] F allocate_and_map_msi_pirq+0x103/0x262
> (XEN)    [<ffff82d04035da5d>] F physdev_map_pirq+0x210/0x259
> (XEN)    [<ffff82d04035e798>] F do_physdev_op+0x9c3/0x1454
> (XEN)    [<ffff82d040329475>] F pv_hypercall+0x5ac/0x6af
> (XEN)    [<ffff82d0402012d3>] F lstar_enter+0x143/0x150
> 
> In read_pci_mem_bar(), the VF obtains the struct pci_dev pointer for its
> associated PF to access the vf_rlen array. This array is initialized in
> pci_add_device() and is only populated in the associated PF's struct
> pci_dev.
> 
> Add links between the VF's struct pci_dev and associated PF struct
> pci_dev, ensuring the PF's struct doesn't get deallocated until all its
> VFs have been removed. Access the vf_rlen array via the new link to the
> PF, and remove the troublesome call to pci_get_pdev().
> 
> Add a call to pci_get_pdev() inside the pcidevs_lock()-locked section of
> pci_add_device() to set up the link from VF to PF. In case the new
> pci_get_pdev() invocation fails to find the associated PF (returning
> NULL), return an error.
> 
> In pci_remove_device(), handle an issue with a corner case when a PF is
> removed with VFs enabled, then re-added with VFs disabled. During PF
> removal, a buggy PF driver may fail to disable SR-IOV, leaving stale
> dangling VFs. At least Linux warns in this case:
> 
> [  106.500334]  0000:01:00.0: driver left SR-IOV enabled after remove
> 
> If the PF is subsequently re-added with VFs disabled, the previously
> associated VFs in Xen would not be backed by a device. Any attempt to
> access the config space of the stale VF would be invalid. Avoid issues
> in this case by removing the VFs right away when removing the PF. This
> also happens to simplify the maintenance of the PF<->VF links since the
> associated PF will always exist during the lifetime of a VF. Note,
> however, if a PF is removed before the VFs, Xen will return an error
> for the VF removals since they were already removed.

I think there are two different fixes in this patch, that should be
split into two separate fixes:

 - Fix for the locking issue, which requires adding a pointer to the
   parent PF in the pci_dev of VFs.
 - Introduce better tracking of the PF<->VF pci_dev relation.

My suggestion would be to introduce the tacking between PF and VFs as
a pre-patch (IOW: the linked list related changes), and then do the
addition of the pf_pdev (the proper fix) as a followup.

> 
> Fixes: 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci structure")
> Reported-by: Teddy Astie <teddy.astie@vates.tech>
> Signed-off-by: Stewart Hildebrand <stewart.hildebrand@amd.com>
> ---
> Candidate for backport to 4.19
> 
> v3->v4:
> * handle case when PF is removed with VFs enabled, then re-added with
>   VFs disabled
> 
> v2->v3:
> * link from VF to PF's struct pci_dev *
> 
> v1->v2:
> * remove call to pci_get_pdev()
> ---
> When I tested removing a PF with VFs enabled, then re-adding with VFs
> disabled, I observed the following Xen crash when dom0 attempted to
> access the config space of a stale VF:
> 
> (XEN) Assertion 'pos' failed at arch/x86/msi.c:1275
> (XEN) ----[ Xen-4.20-unstable  x86_64  debug=y  Tainted:   C    ]----
> ...
> (XEN) Xen call trace:
> (XEN)    [<ffff82d040346834>] R pci_msi_conf_write_intercept+0xa2/0x1de
> (XEN)    [<ffff82d04035d6b4>] F pci_conf_write_intercept+0x68/0x78
> (XEN)    [<ffff82d0403264e5>] F arch/x86/pv/emul-priv-op.c#pci_cfg_ok+0xa0/0x114
> (XEN)    [<ffff82d04032660e>] F arch/x86/pv/emul-priv-op.c#guest_io_write+0xb5/0x1c8
> (XEN)    [<ffff82d0403267bb>] F arch/x86/pv/emul-priv-op.c#write_io+0x9a/0xe0
> (XEN)    [<ffff82d04037c77a>] F x86_emulate+0x100e5/0x25f1e
> (XEN)    [<ffff82d0403941a8>] F x86_emulate_wrapper+0x29/0x64
> (XEN)    [<ffff82d04032802b>] F pv_emulate_privileged_op+0x12e/0x217
> (XEN)    [<ffff82d040369f12>] F do_general_protection+0xc2/0x1b8
> (XEN)    [<ffff82d040201aa7>] F x86_64/entry.S#handle_exception_saved+0x2b/0x8c
> 
> This crash is avoided by removing the VFs right away with the PF.

It's not clear to me, does this crash happen even without this change
applied?  If that's the case it seems like you need an extra Fixes
tag (see above for my recommendation to split the change into two).

> ---
>  xen/arch/x86/msi.c            | 33 +++++++++++----------
>  xen/drivers/passthrough/pci.c | 55 ++++++++++++++++++++++++++++++++---
>  xen/include/xen/pci.h         | 13 ++++++++-
>  3 files changed, 80 insertions(+), 21 deletions(-)
> 
> diff --git a/xen/arch/x86/msi.c b/xen/arch/x86/msi.c
> index 0c97fbb3fc03..8d54f268dbbf 100644
> --- a/xen/arch/x86/msi.c
> +++ b/xen/arch/x86/msi.c
> @@ -662,34 +662,31 @@ static int msi_capability_init(struct pci_dev *dev,
>      return 0;
>  }
>  
> -static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
> +static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf,

Since you already have to touch this, I don't think it would very
complicated to pass a pci_sbdf_t here instead of the seg, bus, slot
and func parameters.  You can expand back to seg, bus, slot and func
as local function parameters in order to avoid more code changes than
strictly needed.

> +                            const struct pf_info *pf_info)
>  {
> +    pci_sbdf_t sbdf = PCI_SBDF(seg, bus, slot, func);
>      u8 limit;
>      u32 addr, base = PCI_BASE_ADDRESS_0;
>      u64 disp = 0;
>  
>      if ( vf >= 0 )
>      {
> -        struct pci_dev *pdev = pci_get_pdev(NULL,
> -                                            PCI_SBDF(seg, bus, slot, func));
>          unsigned int pos;
>          uint16_t ctrl, num_vf, offset, stride;
>  
> -        if ( !pdev )
> -            return 0;

Is it worth adding a:

if ( !pf_info )
{
    ASSERT_UNREACHABLE();
    return 0;
}

As I think pf_info must be != NULL if vf >= 0?

> -
> -        pos = pci_find_ext_capability(pdev->sbdf, PCI_EXT_CAP_ID_SRIOV);
> -        ctrl = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_CTRL);
> -        num_vf = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_NUM_VF);
> -        offset = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_OFFSET);
> -        stride = pci_conf_read16(pdev->sbdf, pos + PCI_SRIOV_VF_STRIDE);
> +        pos = pci_find_ext_capability(sbdf, PCI_EXT_CAP_ID_SRIOV);
> +        ctrl = pci_conf_read16(sbdf, pos + PCI_SRIOV_CTRL);
> +        num_vf = pci_conf_read16(sbdf, pos + PCI_SRIOV_NUM_VF);
> +        offset = pci_conf_read16(sbdf, pos + PCI_SRIOV_VF_OFFSET);
> +        stride = pci_conf_read16(sbdf, pos + PCI_SRIOV_VF_STRIDE);
>  
>          if ( !pos ||
>               !(ctrl & PCI_SRIOV_CTRL_VFE) ||
>               !(ctrl & PCI_SRIOV_CTRL_MSE) ||
>               !num_vf || !offset || (num_vf > 1 && !stride) ||
>               bir >= PCI_SRIOV_NUM_BARS ||
> -             !pdev->vf_rlen[bir] )
> +             !pf_info->vf_rlen[bir] )
>              return 0;
>          base = pos + PCI_SRIOV_BAR;
>          vf -= PCI_BDF(bus, slot, func) + offset;
> @@ -703,8 +700,8 @@ static u64 read_pci_mem_bar(u16 seg, u8 bus, u8 slot, u8 func, u8 bir, int vf)
>          }
>          if ( vf >= num_vf )
>              return 0;
> -        BUILD_BUG_ON(ARRAY_SIZE(pdev->vf_rlen) != PCI_SRIOV_NUM_BARS);
> -        disp = vf * pdev->vf_rlen[bir];
> +        BUILD_BUG_ON(ARRAY_SIZE(pf_info->vf_rlen) != PCI_SRIOV_NUM_BARS);
> +        disp = vf * pf_info->vf_rlen[bir];
>          limit = PCI_SRIOV_NUM_BARS;
>      }
>      else switch ( pci_conf_read8(PCI_SBDF(seg, bus, slot, func),
> @@ -813,6 +810,7 @@ static int msix_capability_init(struct pci_dev *dev,
>          int vf;
>          paddr_t pba_paddr;
>          unsigned int pba_offset;
> +        const struct pf_info *pf_info;
>  
>          if ( !dev->info.is_virtfn )
>          {
> @@ -820,6 +818,7 @@ static int msix_capability_init(struct pci_dev *dev,
>              pslot = slot;
>              pfunc = func;
>              vf = -1;
> +            pf_info = NULL;
>          }
>          else
>          {
> @@ -827,9 +826,11 @@ static int msix_capability_init(struct pci_dev *dev,
>              pslot = PCI_SLOT(dev->info.physfn.devfn);
>              pfunc = PCI_FUNC(dev->info.physfn.devfn);
>              vf = dev->sbdf.bdf;
> +            pf_info = &dev->virtfn.pf_pdev->physfn;
>          }
>  
> -        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
> +        table_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf,
> +                                       pf_info);
>          WARN_ON(msi && msi->table_base != table_paddr);
>          if ( !table_paddr )
>          {
> @@ -852,7 +853,7 @@ static int msix_capability_init(struct pci_dev *dev,
>  
>          pba_offset = pci_conf_read32(dev->sbdf, msix_pba_offset_reg(pos));
>          bir = (u8)(pba_offset & PCI_MSIX_BIRMASK);
> -        pba_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf);
> +        pba_paddr = read_pci_mem_bar(seg, pbus, pslot, pfunc, bir, vf, pf_info);
>          WARN_ON(!pba_paddr);
>          pba_paddr += pba_offset & ~PCI_MSIX_BIRMASK;
>  
> diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
> index 5a446d3dcee0..97b3417252f7 100644
> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -341,6 +341,8 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
>  
>      list_add(&pdev->alldevs_list, &pseg->alldevs_list);
>  
> +    INIT_LIST_HEAD(&pdev->physfn.vf_list);
> +
>      /* update bus2bridge */
>      switch ( pdev->type = pdev_type(pseg->nr, bus, devfn) )
>      {
> @@ -446,6 +448,10 @@ static void free_pdev(struct pci_seg *pseg, struct pci_dev *pdev)
>  
>      list_del(&pdev->alldevs_list);
>      pdev_msi_deinit(pdev);
> +
> +    if ( pdev->info.is_virtfn )
> +        list_del(&pdev->virtfn.entry);
> +
>      xfree(pdev);
>  }
>  
> @@ -700,10 +706,31 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>           * extended function.
>           */
>          if ( pdev->info.is_virtfn )
> +        {
> +            struct pci_dev *pf_pdev;
> +
>              pdev->info.is_extfn = pf_is_extfn;
> +            pf_pdev = pci_get_pdev(NULL,
> +                                   PCI_SBDF(seg, info->physfn.bus,
> +                                            info->physfn.devfn));
> +            if ( pf_pdev )
> +            {
> +                pdev->virtfn.pf_pdev = pf_pdev;
> +                list_add(&pdev->virtfn.entry, &pf_pdev->physfn.vf_list);
> +            }
> +            else
> +            {
> +                printk(XENLOG_WARNING "Failed to add SR-IOV device PF %pp for VF %pp\n",
> +                       &PCI_SBDF(seg, info->physfn.bus, info->physfn.devfn),
> +                       &pdev->sbdf);
> +                free_pdev(pseg, pdev);
> +                ret = -ENODEV;
> +                goto out;
> +            }
> +        }
>      }
>  
> -    if ( !pdev->info.is_virtfn && !pdev->vf_rlen[0] )
> +    if ( !pdev->info.is_virtfn && !pdev->physfn.vf_rlen[0] )
>      {
>          unsigned int pos = pci_find_ext_capability(pdev->sbdf,
>                                                     PCI_EXT_CAP_ID_SRIOV);
> @@ -715,7 +742,9 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>          {
>              unsigned int i;
>  
> -            BUILD_BUG_ON(ARRAY_SIZE(pdev->vf_rlen) != PCI_SRIOV_NUM_BARS);
> +            BUILD_BUG_ON(ARRAY_SIZE(pdev->physfn.vf_rlen) !=
> +                                    PCI_SRIOV_NUM_BARS);
> +
>              for ( i = 0; i < PCI_SRIOV_NUM_BARS; )
>              {
>                  unsigned int idx = pos + PCI_SRIOV_BAR + i * 4;
> @@ -730,7 +759,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>                      continue;
>                  }
>                  ret = pci_size_mem_bar(pdev->sbdf, idx, NULL,
> -                                       &pdev->vf_rlen[i],
> +                                       &pdev->physfn.vf_rlen[i],
>                                         PCI_BAR_VF |
>                                         ((i == PCI_SRIOV_NUM_BARS - 1) ?
>                                          PCI_BAR_LAST : 0));
> @@ -818,6 +847,24 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn)
>      list_for_each_entry ( pdev, &pseg->alldevs_list, alldevs_list )
>          if ( pdev->bus == bus && pdev->devfn == devfn )
>          {
> +            ret = 0;
> +
> +            if ( !pdev->info.is_virtfn )
> +            {
> +                struct pci_dev *vf_pdev, *tmp;
> +
> +                /*
> +                 * If a PF with VFs enabled is removed, then re-added without
> +                 * VFs enabled, the previously associated VFs would no longer be
> +                 * backed by a device. Remove the associated VFs right away.
> +                 */
> +                list_for_each_entry_safe(vf_pdev, tmp, &pdev->physfn.vf_list,
> +                                         virtfn.entry)
> +                    ret = pci_remove_device(vf_pdev->sbdf.seg,
> +                                            vf_pdev->sbdf.bus,
> +                                            vf_pdev->sbdf.devfn) ?: ret;
> +            }
> +
>              if ( pdev->domain )
>              {
>                  write_lock(&pdev->domain->pci_lock);
> @@ -826,7 +873,7 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn)
>                  write_unlock(&pdev->domain->pci_lock);
>              }
>              pci_cleanup_msi(pdev);
> -            ret = iommu_remove_device(pdev);
> +            ret = iommu_remove_device(pdev) ?: ret;
>              printk(XENLOG_DEBUG "PCI remove device %pp\n", &pdev->sbdf);
>              free_pdev(pseg, pdev);
>              break;
> diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
> index 63e49f0117e9..a24026d25148 100644
> --- a/xen/include/xen/pci.h
> +++ b/xen/include/xen/pci.h
> @@ -150,7 +150,18 @@ struct pci_dev {
>          unsigned int count;
>  #define PT_FAULT_THRESHOLD 10
>      } fault;
> -    u64 vf_rlen[6];
> +    union {
> +        struct pf_info {
> +            /* Only populated for PFs (info.is_virtfn == false) */
> +            struct list_head vf_list;             /* List head */
> +            uint64_t vf_rlen[PCI_SRIOV_NUM_BARS];
> +        } physfn;
> +        struct {
> +            /* Only populated for VFs (info.is_virtfn == true) */
> +            struct list_head entry;               /* Entry in vf_list */
> +            struct pci_dev *pf_pdev;              /* Link from VF to PF */

With this pointer being introduced for VFs, is the information in
pci_dev_info still required?  It would seem to me the physfn.bus and
physfn.devfn fields can now be fetched directly from the pf_pdev
pointer?

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:25:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:25:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784014.1193366 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwCS-00019d-5M; Tue, 27 Aug 2024 13:25:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784014.1193366; Tue, 27 Aug 2024 13:25:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwCS-00019W-18; Tue, 27 Aug 2024 13:25:32 +0000
Received: by outflank-mailman (input) for mailman id 784014;
 Tue, 27 Aug 2024 13:25:30 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1siwCQ-00019Q-M3
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 13:25:30 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d39ff5ef-6477-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 15:25:28 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-a83597ce5beso854444366b.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 06:25:28 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e549cf94sm109969366b.80.2024.08.27.06.25.26
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 06:25:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d39ff5ef-6477-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724765128; x=1725369928; 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=eMp28LvFTtxeR9SpDuL8luPgVO/0eKtg5UQmM1UbdnI=;
        b=Orx+KP5mTywqnBD3NRcE5i4J4GLFADQavi7B6v5RENRjKxYwY0EeAZF0GA9T3hPCKq
         0X4PSjWVmWBnSzcdT5m73nbiAlQEZAOlNwgXPcfkiuIZDN0Cyte6+XznjLUc89ttgWHT
         oJP407Pjs9l+mwGsTYuUWiIft9b2PuQ2EAcE0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724765128; x=1725369928;
        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=eMp28LvFTtxeR9SpDuL8luPgVO/0eKtg5UQmM1UbdnI=;
        b=Bv4UmsPY2Noj//Y86FqtUluK81S68I0zoMatQfQ4KEU0KniHgTI8170cLJmFhloTQb
         Ib/jD/fsWrYgGALrww2zmVgVzTUZQZVgH5zA20pMp/8lBFN3u6mYeNZMITTJKmG+2rd7
         TY1DDpYBbVCHI9dGwKqI1wOXJz1GobOoJZMcNgevvALptnnFYh0zHJJPpKfC9xIa4gJt
         uS+naiTEIWNPQ8R2/2phSX92eYpcQUscn8IzhlOKurFSzqph+NElr1WUhF5CJlbLzp8j
         sOKlpZ39GSv4Lcmsz9kQs/GiQ7kdb4N/XtJmDJJ3UbgiJhhfciLOuHeYFptu/IVN+Kpl
         R0OA==
X-Forwarded-Encrypted: i=1; AJvYcCUQ934yD7kSTxb/KDo0gRiU6HXs7+gf+NNJtQxXZ4dxv0HXND8sW6uEbRanKoqPsNj/kHTR6Pqzq8g=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwChpOfiA3hWm8ok6KcCtf5Ng2PJXKzBtd8eIoz6WsBV6CIXZun
	KCZGHGeBMzecPJWYwle7ACE0GNZeUsRG7o+Meeio16flqveV3xGYstxlS5b9BwY=
X-Google-Smtp-Source: AGHT+IErAg85D29MFl4VhFuhl5pDD3AT25FLnwyxZcAb/5OcKC52ac/2BQjmxnjB/Zwgny4JAKKvVQ==
X-Received: by 2002:a17:907:724a:b0:a86:9e85:2619 with SMTP id a640c23a62f3a-a86e2aa70ddmr332847066b.25.1724765127759;
        Tue, 27 Aug 2024 06:25:27 -0700 (PDT)
Message-ID: <c54f7015-abe1-4834-83e3-29a2cc854d85@citrix.com>
Date: Tue, 27 Aug 2024 14:25:25 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 7/9] xen/bitops: Implement hweight64() in terms of
 hweightl()
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-8-andrew.cooper3@citrix.com>
 <11da1350-095f-49c8-bdf0-f5c83e9f0d39@suse.com>
 <70047ef7-ca22-4eeb-9510-09ccdf0871c0@citrix.com>
 <73309650-3912-418b-b2e6-a60676519911@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <73309650-3912-418b-b2e6-a60676519911@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27/08/2024 2:00 pm, Jan Beulich wrote:
> On 27.08.2024 13:50, Andrew Cooper wrote:
>> On 26/08/2024 12:55 pm, Jan Beulich wrote:
>>> On 23.08.2024 01:06, Andrew Cooper wrote:
>>>> --- a/xen/include/xen/bitops.h
>>>> +++ b/xen/include/xen/bitops.h
>>>> @@ -302,6 +302,14 @@ static always_inline __pure unsigned int hweightl(unsigned long x)
>>>>  #endif
>>>>  }
>>>>  
>>>> +static always_inline __pure unsigned int hweight64(uint64_t x)
>>>> +{
>>>> +    if ( BITS_PER_LONG == 64 )
>>>> +        return hweightl(x);
>>>> +    else
>>>> +        return hweightl(x >> 32) + hweightl(x);
>>> This assume BITS_PER_LONG == 32, which of course is true right now, but
>>> doesn't need to be in general. Better add an explicit cast to uint32_t
>>> (or masking by 0xffffffffU)?
>> This is part of the point of putting in the self-tests.  They're
>> intended to catch things like this in new build environments.
> I don't think I saw any testcase where the result would be wrong if
> this split didn't truncate x to the low 32 bits on the rhs of the +.

That's arguably an error in the choice of test cases.

Although, they're just my best guesses at some

>
>> Although, I think we've got enough cases which will #error on
>> BITS_PER_LONG not being 32 or 64.
> My take on this is: Such checks (#error or whatever else precaution)
> should like in every single place where violating the assumptions
> made would matter. Or else - how do you locate all the places that
> need changing?

Whomever gets to add RISCV-128 support will have to inspect every use of
BITS_PER_LONG, irrespective of #error/BUILD_BUG_ON()/etc.

So, the answer is `grep`.

I'm not advocating that we stop helping out with #error, but it's
unrealistic to expect that only addressing the build errors will result
in a working Xen for BITS_PER_LONG==128.

>
>> Again, this is modelled after f[fl]s64() which have the same
>> expectations about the BITS_PER_LONG != 64 case.
> Both of them are fine afaict. fls64() has an explicit intermediate
> variable of type uint32_t, and ffs64() has a (uint32_t)x as part
> of the conditional expression achieving the intended effect.
>
> Anyway, why not use hweight32() instead of hweightl() here? That'll
> make things very explicit.

hweight32() doesn't exist until the next patch in the series.

Although looking at the end result, I can't figure out why I thought it
was necessary to transform hweight64 first.

I'll swap this patch and the next one, and then use hweight32().

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:43:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:43:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784033.1193376 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwTe-0005yU-MO; Tue, 27 Aug 2024 13:43:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784033.1193376; Tue, 27 Aug 2024 13:43:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwTe-0005yN-I6; Tue, 27 Aug 2024 13:43:18 +0000
Received: by outflank-mailman (input) for mailman id 784033;
 Tue, 27 Aug 2024 13:43:16 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=srL3=P2=gmail.com=milandjokic1995@srs-se1.protection.inumbo.net>)
 id 1siwTc-0005yA-Gr
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 13:43:16 +0000
Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com
 [2a00:1450:4864:20::329])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4ee487af-647a-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 15:43:14 +0200 (CEST)
Received: by mail-wm1-x329.google.com with SMTP id
 5b1f17b1804b1-428f5c0833bso34973565e9.0
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 06:43:14 -0700 (PDT)
Received: from Xen-host.domain.local ([89.216.37.146])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-42abed922b4sm224508655e9.11.2024.08.27.06.43.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 27 Aug 2024 06:43:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4ee487af-647a-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724766194; x=1725370994; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=3Tgax+vjGdtrfqrPbjfbqDqR1Q/xtHhM/7GrhsWe0+Q=;
        b=nnVVghhCEzkz95t+vfCRGml8u1QwQmWJ8rlO+mgOeJWvNU6abJPohObmRWL538etvJ
         3qrPGgH2Sv/tfzS3MMRMojzJJe1VGxBnX5eK+QILtXQ/UTrpy9/m7YcA7Ibgkyl0JN7j
         WC04k7SEqtKVKQofSBGxOxUA3gm8C2MLc7D+8wpcCid6QpazGx986Q+CJSkIH/dUieXw
         3Wcv3Rzp2+4/S9X6ifKAwA0oGCq9A37+1e9cCvvFAL3VwCPVudyMih5ijXlqMARC8hIZ
         V65SkAIyYNuWfZFEPQLDC7KJ3/gkq8usYCb5h6c5zhsWunHuMHOxiqmhIOXCIuNZVDRt
         3xMQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724766194; x=1725370994;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=3Tgax+vjGdtrfqrPbjfbqDqR1Q/xtHhM/7GrhsWe0+Q=;
        b=rMhDGsTLH1mBQrTsssse92jvBgvHp+LTkNGIRVXc91rPsVivbsfBEhk8uCh9FAigEX
         WX2eoFru3uu+O1z/1NC5vy5n2yiXqmQHdkvvtXtVvOZpYMuXAOH8cL775pFWKKmgvPHn
         x/x5DxtOyL0v6JHtjXYaY+/qlXJCZLndO+ElcQ2HXmeysiVszEeXO0YQ/+W34v3Z6qF9
         ZAGm4OaeyZxrIToLPbB++9ZUpOLsbQksRKMu9OAhssrPB9rdax/HHK3wnK9KYyJ93wq9
         uWM30bod6wJQiPeL7Mp/h4pdSXuD5NYCPVVYtRiQ9EUoko87JBlDECtESxKNXbYRQC7d
         bMUw==
X-Gm-Message-State: AOJu0YwezKgwdUJPGedR46n0XtmULERAHz42SozUUmv2xxv+kOwK2FKt
	ivb+Bfqj+fBS+s5PxTcYyYWDtHTHDjAPedV/vkFYx8XsZewslAxOk7R7TuNu
X-Google-Smtp-Source: AGHT+IEFiwKleDqqXWpVs+bQ/rh6tyVbHOUPBcweltDZaX5aM0/89sUTKHE3APO7xO/9Z1c0RU+kFA==
X-Received: by 2002:adf:fc0d:0:b0:365:aec0:e191 with SMTP id ffacd0b85a97d-3748c88a349mr1892085f8f.21.1724766193283;
        Tue, 27 Aug 2024 06:43:13 -0700 (PDT)
From: Milan Djokic <milandjokic1995@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: oleksii.kurochko@gmail.com,
	Nikola Jelic <nikola.jelic@rt-rk.com>,
	"Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Milan Djokic <milan.djokic@rt-rk.com>
Subject: [PATCH v2] x86/efi: Use generic PE/COFF structures
Date: Tue, 27 Aug 2024 15:42:10 +0200
Message-Id: <367c5d95fb89e7dd3b4260f136d194a4cd0b854a.1724765763.git.milandjokic1995@gmail.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <6cf2799ced7dcee515ad8a6b6657522cdc7cec61.1724699546.git.milan.djokic@verisure.com>
References: <6cf2799ced7dcee515ad8a6b6657522cdc7cec61.1724699546.git.milan.djokic@verisure.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

From: Nikola Jelic <nikola.jelic@rt-rk.com>

Adapted x86 efi parser and mkreloc utility to use generic PE header
(efi/pe.h), instead of locally defined structures for each component.

Signed-off-by: Nikola Jelic <nikola.jelic@rt-rk.com>
Signed-off-by: Milan Djokic <milan.djokic@rt-rk.com>
---
Changes in V2:
  - Using pe header constants instead of hardcoded values (magic,
    machine)
---
 xen/arch/x86/efi/mkreloc.c | 134 +++++++++++--------------------------
 xen/common/efi/pe.c        |  96 ++++++--------------------
 2 files changed, 61 insertions(+), 169 deletions(-)

diff --git a/xen/arch/x86/efi/mkreloc.c b/xen/arch/x86/efi/mkreloc.c
index 083740ab8a..89c525d81e 100644
--- a/xen/arch/x86/efi/mkreloc.c
+++ b/xen/arch/x86/efi/mkreloc.c
@@ -9,45 +9,7 @@
 #include <sys/mman.h>
 #include <unistd.h>
 
-struct mz_hdr {
-    uint16_t signature;
-#define MZ_SIGNATURE 0x5a4d
-    uint16_t last_page_size;
-    uint16_t page_count;
-    uint16_t relocation_count;
-    uint16_t header_paras;
-    uint16_t min_paras;
-    uint16_t max_paras;
-    uint16_t entry_ss;
-    uint16_t entry_sp;
-    uint16_t checksum;
-    uint16_t entry_ip;
-    uint16_t entry_cs;
-    uint16_t relocations;
-    uint16_t overlay;
-    uint8_t reserved[32];
-    uint32_t extended_header_base;
-};
-
-struct pe_hdr {
-    uint32_t signature;
-#define PE_SIGNATURE 0x00004550
-    uint16_t cpu;
-    uint16_t section_count;
-    int32_t timestamp;
-    uint32_t symbols_file_offset;
-    uint32_t symbol_count;
-    uint16_t opt_hdr_size;
-    uint16_t flags;
-    struct {
-        uint16_t magic;
-#define PE_MAGIC_EXE32     0x010b
-#define PE_MAGIC_EXE32PLUS 0x020b
-        uint8_t linker_major, linker_minor;
-        uint32_t code_size, data_size, bss_size;
-        uint32_t entry_rva, code_rva, data_rva;
-    } opt_hdr;
-};
+#include "../../../include/efi/pe.h"
 
 #define PE_PAGE_SIZE 0x1000
 
@@ -55,22 +17,6 @@ struct pe_hdr {
 #define PE_BASE_RELOC_HIGHLOW  3
 #define PE_BASE_RELOC_DIR64   10
 
-struct coff_section {
-    char name[8];
-    uint32_t size;
-    uint32_t rva;
-    uint32_t file_size;
-    uint32_t file_offset;
-    uint32_t relocation_file_offset;
-    uint32_t line_number_file_offset;
-    uint16_t relocation_count;
-    uint16_t line_number_count;
-    uint32_t flags;
-#define COFF_SECTION_BSS         0x00000080U
-#define COFF_SECTION_DISCARDABLE 0x02000000U
-#define COFF_SECTION_WRITEABLE   0x80000000U
-};
-
 static void usage(const char *cmd, int rc)
 {
     fprintf(rc ? stderr : stdout,
@@ -80,7 +26,7 @@ static void usage(const char *cmd, int rc)
 }
 
 static unsigned int load(const char *name, int *handle,
-                         struct coff_section **sections,
+                         struct section_header **sections,
                          uint_fast64_t *image_base,
                          uint32_t *image_size,
                          unsigned int *width)
@@ -88,6 +34,7 @@ static unsigned int load(const char *name, int *handle,
     int in = open(name, O_RDONLY);
     struct mz_hdr mz_hdr;
     struct pe_hdr pe_hdr;
+    struct pe32_opt_hdr pe32_opt_hdr;
     uint32_t base;
 
     if ( in < 0 ||
@@ -96,16 +43,17 @@ static unsigned int load(const char *name, int *handle,
         perror(name);
         exit(2);
     }
-    if ( mz_hdr.signature != MZ_SIGNATURE ||
-         mz_hdr.relocations < sizeof(mz_hdr) ||
-         !mz_hdr.extended_header_base )
+    if ( mz_hdr.magic != MZ_MAGIC ||
+         mz_hdr.reloc_table_offset < sizeof(mz_hdr) ||
+         !mz_hdr.peaddr )
     {
         fprintf(stderr, "%s: Wrong DOS file format\n", name);
         exit(2);
     }
 
-    if ( lseek(in, mz_hdr.extended_header_base, SEEK_SET) < 0 ||
+    if ( lseek(in, mz_hdr.peaddr, SEEK_SET) < 0 ||
          read(in, &pe_hdr, sizeof(pe_hdr)) != sizeof(pe_hdr) ||
+         read(in, &pe32_opt_hdr, sizeof(pe32_opt_hdr)) != sizeof(pe32_opt_hdr) ||
          read(in, &base, sizeof(base)) != sizeof(base) ||
          /*
           * Luckily the image size field lives at the
@@ -117,35 +65,33 @@ static unsigned int load(const char *name, int *handle,
         perror(name);
         exit(3);
     }
-    switch ( (pe_hdr.signature == PE_SIGNATURE &&
-              pe_hdr.opt_hdr_size > sizeof(pe_hdr.opt_hdr)) *
-             pe_hdr.opt_hdr.magic )
+    switch ( (pe_hdr.magic == PE_MAGIC &&
+              pe_hdr.opt_hdr_size > sizeof(pe32_opt_hdr)) *
+              pe32_opt_hdr.magic )
     {
-    case PE_MAGIC_EXE32:
+    case PE_OPT_MAGIC_PE32:
         *width = 32;
         *image_base = base;
         break;
-    case PE_MAGIC_EXE32PLUS:
+    case PE_OPT_MAGIC_PE32PLUS:
         *width = 64;
-        *image_base = ((uint64_t)base << 32) | pe_hdr.opt_hdr.data_rva;
+        *image_base = ((uint64_t)base << 32) | pe32_opt_hdr.data_base;
         break;
     default:
         fprintf(stderr, "%s: Wrong PE file format\n", name);
         exit(3);
     }
 
-    *sections = malloc(pe_hdr.section_count * sizeof(**sections));
+    *sections = malloc(pe_hdr.sections * sizeof(**sections));
     if ( !*sections )
     {
         perror(NULL);
         exit(4);
     }
-    if ( lseek(in,
-               mz_hdr.extended_header_base + offsetof(struct pe_hdr, opt_hdr) +
-                  pe_hdr.opt_hdr_size,
+    if ( lseek(in, mz_hdr.peaddr + sizeof(pe_hdr) + pe_hdr.opt_hdr_size,
                SEEK_SET) < 0 ||
-         read(in, *sections, pe_hdr.section_count * sizeof(**sections)) !=
-             pe_hdr.section_count * sizeof(**sections) )
+         read(in, *sections, pe_hdr.sections * sizeof(**sections)) !=
+             pe_hdr.sections * sizeof(**sections) )
     {
         perror(name);
         exit(4);
@@ -153,12 +99,12 @@ static unsigned int load(const char *name, int *handle,
 
     *handle = in;
 
-    return pe_hdr.section_count;
+    return pe_hdr.sections;
 }
 
 static long page_size;
 
-static const void *map_section(const struct coff_section *sec, int in,
+static const void *map_section(const struct section_header *sec, int in,
                                const char *name)
 {
     const char *ptr;
@@ -166,10 +112,10 @@ static const void *map_section(const struct coff_section *sec, int in,
 
     if ( !page_size )
         page_size = sysconf(_SC_PAGESIZE);
-    offs = sec->file_offset & (page_size - 1);
+    offs = sec->data_addr & (page_size - 1);
 
-    ptr = mmap(0, offs + sec->file_size, PROT_READ, MAP_PRIVATE, in,
-               sec->file_offset - offs);
+    ptr = mmap(0, offs + sec->raw_data_size, PROT_READ, MAP_PRIVATE, in,
+               sec->data_addr - offs);
     if ( ptr == MAP_FAILED )
     {
         perror(name);
@@ -179,15 +125,15 @@ static const void *map_section(const struct coff_section *sec, int in,
     return ptr + offs;
 }
 
-static void unmap_section(const void *ptr, const struct coff_section *sec)
+static void unmap_section(const void *ptr, const struct section_header *sec)
 {
-    unsigned long offs = sec->file_offset & (page_size - 1);
+    unsigned long offs = sec->data_addr & (page_size - 1);
 
-    munmap((char *)ptr - offs, offs + sec->file_size);
+    munmap((char *)ptr - offs, offs + sec->raw_data_size);
 }
 
 static void diff_sections(const unsigned char *ptr1, const unsigned char *ptr2,
-                          const struct coff_section *sec,
+                          const struct section_header *sec,
                           int_fast64_t diff, unsigned int width,
                           uint_fast64_t base, uint_fast64_t end)
 {
@@ -208,7 +154,7 @@ static void diff_sections(const unsigned char *ptr1, const unsigned char *ptr2,
     while ( !(diff & (((int_fast64_t)1 << ((disp + 1) * CHAR_BIT)) - 1)) )
         ++disp;
 
-    for ( i = 0; i < sec->file_size; ++i )
+    for ( i = 0; i < sec->raw_data_size; ++i )
     {
         uint_fast32_t rva;
         union {
@@ -222,7 +168,7 @@ static void diff_sections(const unsigned char *ptr1, const unsigned char *ptr2,
         if ( ptr1[i] == ptr2[i] )
             continue;
 
-        if ( i < disp || i + width - disp > sec->file_size )
+        if ( i < disp || i + width - disp > sec->raw_data_size )
         {
             fprintf(stderr,
                     "Bogus difference at %.8s:%08" PRIxFAST32 "\n",
@@ -250,11 +196,11 @@ static void diff_sections(const unsigned char *ptr1, const unsigned char *ptr2,
             reloc_size += reloc_size & 2;
             if ( reloc_size )
                 printf("\t.equ rva_%08" PRIxFAST32 "_relocs,"
-                             " %#08" PRIxFAST32 "\n",
+                       " %#08" PRIxFAST32 "\n",
                        cur_rva, reloc_size);
             printf("\t.balign 4\n"
                    "\t.long %#08" PRIxFAST32 ","
-                          " rva_%08" PRIxFAST32 "_relocs\n",
+                   " rva_%08" PRIxFAST32 "_relocs\n",
                    rva, rva);
             cur_rva = rva;
             reloc_size = 8;
@@ -267,7 +213,7 @@ static void diff_sections(const unsigned char *ptr1, const unsigned char *ptr2,
             exit(3);
         }
 
-        if ( !(sec->flags & COFF_SECTION_WRITEABLE) )
+        if ( !(sec->flags & IMAGE_SCN_MEM_WRITE) )
             fprintf(stderr,
                     "Warning: relocation to r/o section %.8s:%08" PRIxFAST32 "\n",
                     sec->name, i - disp);
@@ -285,7 +231,7 @@ int main(int argc, char *argv[])
     unsigned int i, nsec, width1, width2;
     uint_fast64_t base1, base2;
     uint32_t size1, size2;
-    struct coff_section *sec1, *sec2;
+    struct section_header *sec1, *sec2;
 
     if ( argc == 1 ||
          !strcmp(argv[1], "-?") ||
@@ -328,16 +274,16 @@ int main(int argc, char *argv[])
 
         if ( memcmp(sec1[i].name, sec2[i].name, sizeof(sec1[i].name)) ||
              sec1[i].rva != sec2[i].rva ||
-             sec1[i].size != sec2[i].size ||
-             sec1[i].file_size != sec2[i].file_size ||
+             sec1[i].virtual_size != sec2[i].virtual_size ||
+             sec1[i].raw_data_size != sec2[i].raw_data_size ||
              sec1[i].flags != sec2[i].flags )
         {
             fprintf(stderr, "Mismatched section %u parameters\n", i);
             return 5;
         }
 
-        if ( !sec1[i].size ||
-             (sec1[i].flags & (COFF_SECTION_DISCARDABLE|COFF_SECTION_BSS)) )
+        if ( !sec1[i].virtual_size ||
+             (sec1[i].flags & (IMAGE_SCN_MEM_DISCARDABLE | IMAGE_SCN_CNT_UNINITIALIZED_DATA)) )
             continue;
 
         /*
@@ -354,10 +300,10 @@ int main(int argc, char *argv[])
             return 3;
         }
 
-        if ( sec1[i].file_size > sec1[i].size )
+        if ( sec1[i].raw_data_size > sec1[i].virtual_size )
         {
-            sec1[i].file_size = sec1[i].size;
-            sec2[i].file_size = sec2[i].size;
+            sec1[i].raw_data_size = sec1[i].virtual_size;
+            sec2[i].raw_data_size = sec2[i].virtual_size;
         }
         ptr1 = map_section(sec1 + i, in1, argv[1]);
         ptr2 = map_section(sec2 + i, in2, argv[2]);
diff --git a/xen/common/efi/pe.c b/xen/common/efi/pe.c
index ef8a2543e0..560f35188d 100644
--- a/xen/common/efi/pe.c
+++ b/xen/common/efi/pe.c
@@ -20,78 +20,28 @@
  * Lesser General Public License for more details.
  */
 
-
 #include "efi.h"
+#include "efi/pe.h"
 
-struct DosFileHeader {
-    UINT8   Magic[2];
-    UINT16  LastSize;
-    UINT16  nBlocks;
-    UINT16  nReloc;
-    UINT16  HdrSize;
-    UINT16  MinAlloc;
-    UINT16  MaxAlloc;
-    UINT16  ss;
-    UINT16  sp;
-    UINT16  Checksum;
-    UINT16  ip;
-    UINT16  cs;
-    UINT16  RelocPos;
-    UINT16  nOverlay;
-    UINT16  reserved[4];
-    UINT16  OEMId;
-    UINT16  OEMInfo;
-    UINT16  reserved2[10];
-    UINT32  ExeHeader;
-};
-
-#if defined(__arm__) || defined (__aarch64__)
-#define PE_HEADER_MACHINE 0xaa64
+#if defined(__arm__) || defined(__aarch64__)
+#define PE_HEADER_MACHINE IMAGE_FILE_MACHINE_ARM64
 #elif defined(__x86_64__)
-#define PE_HEADER_MACHINE 0x8664
+#define PE_HEADER_MACHINE IMAGE_FILE_MACHINE_AMD64
 #else
 #error "Unknown architecture"
 #endif
 
-struct PeFileHeader {
-    UINT16  Machine;
-    UINT16  NumberOfSections;
-    UINT32  TimeDateStamp;
-    UINT32  PointerToSymbolTable;
-    UINT32  NumberOfSymbols;
-    UINT16  SizeOfOptionalHeader;
-    UINT16  Characteristics;
-};
-
-struct PeHeader {
-    UINT8   Magic[4];
-    struct PeFileHeader FileHeader;
-};
-
-struct PeSectionHeader {
-    CHAR8   Name[8];
-    UINT32  VirtualSize;
-    UINT32  VirtualAddress;
-    UINT32  SizeOfRawData;
-    UINT32  PointerToRawData;
-    UINT32  PointerToRelocations;
-    UINT32  PointerToLinenumbers;
-    UINT16  NumberOfRelocations;
-    UINT16  NumberOfLinenumbers;
-    UINT32  Characteristics;
-};
-
-static bool __init pe_name_compare(const struct PeSectionHeader *sect,
+static bool __init pe_name_compare(const struct section_header *sect,
                                    const CHAR16 *name)
 {
     size_t i;
 
-    if ( sect->Name[0] != '.' )
+    if ( sect->name[0] != '.' )
         return false;
 
-    for ( i = 1; i < sizeof(sect->Name); i++ )
+    for ( i = 1; i < sizeof(sect->name); i++ )
     {
-        const char c = sect->Name[i];
+        const char c = sect->name[i];
 
         if ( c != name[i - 1] )
             return false;
@@ -105,33 +55,29 @@ static bool __init pe_name_compare(const struct PeSectionHeader *sect,
 const void *__init pe_find_section(const void *image, const UINTN image_size,
                                    const CHAR16 *section_name, UINTN *size_out)
 {
-    const struct DosFileHeader *dos = image;
-    const struct PeHeader *pe;
-    const struct PeSectionHeader *sect;
+    const struct mz_hdr *mz = image;
+    const struct pe_hdr *pe;
+    const struct section_header *sect;
     UINTN offset, i;
 
-    if ( image_size < sizeof(*dos) ||
-         dos->Magic[0] != 'M' ||
-         dos->Magic[1] != 'Z' )
+    if ( image_size < sizeof(*mz) ||
+         mz->magic != MZ_MAGIC )
         return NULL;
 
-    offset = dos->ExeHeader;
+    offset = mz->peaddr;
     pe = image + offset;
 
     offset += sizeof(*pe);
     if ( image_size < offset ||
-         pe->Magic[0] != 'P' ||
-         pe->Magic[1] != 'E' ||
-         pe->Magic[2] != '\0' ||
-         pe->Magic[3] != '\0' )
+         pe->magic != PE_MAGIC )
         return NULL;
 
-    if ( pe->FileHeader.Machine != PE_HEADER_MACHINE )
+    if ( pe->machine != PE_HEADER_MACHINE )
         return NULL;
 
-    offset += pe->FileHeader.SizeOfOptionalHeader;
+    offset += pe->opt_hdr_size;
 
-    for ( i = 0; i < pe->FileHeader.NumberOfSections; i++ )
+    for ( i = 0; i < pe->sections; i++ )
     {
         sect = image + offset;
         if ( image_size < offset + sizeof(*sect) )
@@ -143,13 +89,13 @@ const void *__init pe_find_section(const void *image, const UINTN image_size,
             continue;
         }
 
-        if ( image_size < sect->VirtualSize + sect->VirtualAddress )
+        if ( image_size < sect->virtual_size + sect->rva )
             blexit(L"PE invalid section size + address");
 
         if ( size_out )
-            *size_out = sect->VirtualSize;
+            *size_out = sect->virtual_size;
 
-        return image + sect->VirtualAddress;
+        return image + sect->rva;
     }
 
     return NULL;
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:43:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:43:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784034.1193386 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwTs-0006GQ-TH; Tue, 27 Aug 2024 13:43:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784034.1193386; Tue, 27 Aug 2024 13:43:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwTs-0006GJ-Pv; Tue, 27 Aug 2024 13:43:32 +0000
Received: by outflank-mailman (input) for mailman id 784034;
 Tue, 27 Aug 2024 13:43:31 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CYmO=P2=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1siwTr-0005yA-Is
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 13:43:31 +0000
Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com
 [2607:f8b0:4864:20::82c])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 57cd9126-647a-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 15:43:30 +0200 (CEST)
Received: by mail-qt1-x82c.google.com with SMTP id
 d75a77b69052e-44ff50affc5so28625691cf.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 06:43:29 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 d75a77b69052e-454fe0f3b2dsm53172131cf.53.2024.08.27.06.43.26
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 27 Aug 2024 06:43:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 57cd9126-647a-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724766209; x=1725371009; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=+G5pnBmJehPtMIxK3tqkOmZD5TYh2i7LXIOI6nLfIxs=;
        b=dL2jaQ0czCN3VDNFF3m57C0nigfQebrpULY6f2vOWIqrEknJM++vyTVDs9BhchG7VY
         cnfDxPn7UlIpoEhjvKoxJ1K3CIAmpNshyK/tHBIgBSr2NiRRzdR4lYZeJowHTEDw6JFP
         wSTBiWQGg1PdMguqIMTQLzgdisGqkrdG9Edp0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724766209; x=1725371009;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=+G5pnBmJehPtMIxK3tqkOmZD5TYh2i7LXIOI6nLfIxs=;
        b=lkba+VoZyFEjpvK3tskHsGsU+juizAcHO8Ac6yXnO4gukeMErUvmg9OoQM7RvsKJ+y
         Y0da7Lc5MOmIerizMCHGAUvHOI4iRTi5ZTgADnfykpwadBjg032NEGOJ53IOdItOAIDd
         5zz2CYJEirgnvzhabsdlXClVpaTY8K9bELT4HFF1kM3XBipjJMPMIlpN9S6UINACQsHj
         AtxqVpxGvBNdDAOfBHM6qYHra9OUkSi0LjBGkQEpRqy1SI6A9KIGmWOXJLNTTZIsu+Ya
         APWrrGWLfzqleeuKtsJtMuhX3xnBifDm4rNCGgJfEruUfw7SkU/MfBsVRMuacHlBHqj5
         tIEg==
X-Forwarded-Encrypted: i=1; AJvYcCXLaZhS+AXW8AamrF2prCzE0SZXeZv0HcckQkU3apSpLcpjCPlRVMYyywOrDsP1Hw7kL+wd1u7z+yM=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzc4mchyP1my8A3DLvzIHb7ey1dnmyguJOL79prqtnIHwu6cBfl
	jFW9Wj5kQG+V4tBsLMNY50/BgaE65TtMk5eMbR7MBbavd0kDY8oMtuqKG5wcOSM=
X-Google-Smtp-Source: AGHT+IFuo2CFeYs6rIJTSw3c/FiYwIgMC+tJXARtXhisOjb9OFOHq0F2uM7sTSk7XBMCFxYHra8i7w==
X-Received: by 2002:a05:622a:5590:b0:43f:fc16:6b3f with SMTP id d75a77b69052e-456608fd36dmr33981691cf.34.1724766208640;
        Tue, 27 Aug 2024 06:43:28 -0700 (PDT)
Date: Tue, 27 Aug 2024 15:43:24 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v5] x86/dom0: disable SMAP for PV domain building only
Message-ID: <Zs3X_OUy_EkfdKng@macbook.local>
References: <20240827123949.24400-1-roger.pau@citrix.com>
 <734d41c3-709c-4286-8353-f5483b0987cb@citrix.com>
 <d939dffc-e8e3-40cf-8494-c03ae6978c90@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <d939dffc-e8e3-40cf-8494-c03ae6978c90@suse.com>

On Tue, Aug 27, 2024 at 03:04:54PM +0200, Jan Beulich wrote:
> On 27.08.2024 14:59, Andrew Cooper wrote:
> > On 27/08/2024 1:39 pm, Roger Pau Monne wrote:
> >> --- a/xen/arch/x86/dom0_build.c
> >> +++ b/xen/arch/x86/dom0_build.c
> >> @@ -612,7 +612,24 @@ int __init construct_dom0(struct domain *d, const module_t *image,
> >>      if ( is_hvm_domain(d) )
> >>          rc = dom0_construct_pvh(d, image, image_headroom, initrd, cmdline);
> >>      else if ( is_pv_domain(d) )
> >> +    {
> >> +        /*
> >> +         * Temporarily clear SMAP in CR4 to allow user-accesses in
> >> +         * construct_dom0().  This saves a large number of corner cases
> >> +         * interactions with copy_from_user().
> >> +         */
> >> +        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> >> +        {
> >> +            cr4_pv32_mask &= ~X86_CR4_SMAP;
> >> +            write_cr4(read_cr4() & ~X86_CR4_SMAP);
> >> +        }
> >>          rc = dom0_construct_pv(d, image, image_headroom, initrd, cmdline);
> >> +        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> >> +        {
> >> +            write_cr4(read_cr4() | X86_CR4_SMAP);
> >> +            cr4_pv32_mask |= X86_CR4_SMAP;
> >> +        }
> >> +    }
> > 
> > I hate to drag this on further still, but can this logic be move it into
> > dom0_construct_pv() itself, rather than here?
> 
> Just to mention it: I'm fine with this in principle, as long as this won't
> mean a pile of new goto-s in dom0_construct_pv(). If a new wrapper was
> introduced (with the present function becoming static), I'd be okay.

I've considered adding this inside of dom0_construct_pv(), but then I
would need to adjust the return paths to re-enable SMAP.

I can add a wrapper, I didn't do it that way because it seemed
cumbersome IMO.

I will prepare v6 then with that approach.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:44:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:44:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784043.1193396 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwUi-0006zH-64; Tue, 27 Aug 2024 13:44:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784043.1193396; Tue, 27 Aug 2024 13:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwUi-0006zA-2s; Tue, 27 Aug 2024 13:44:24 +0000
Received: by outflank-mailman (input) for mailman id 784043;
 Tue, 27 Aug 2024 13:44:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siwUh-0006ti-0P
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 13:44:23 +0000
Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com
 [2a00:1450:4864:20::633])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 773a492f-647a-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 15:44:22 +0200 (CEST)
Received: by mail-ej1-x633.google.com with SMTP id
 a640c23a62f3a-a86acbaddb4so473481066b.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 06:44:22 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e54851a8sm111056766b.29.2024.08.27.06.44.20
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 06:44:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 773a492f-647a-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724766262; x=1725371062; 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=RV+DxkttUXiV0vbnMI++tRBCTodxkM3RRM2Fbm+HshM=;
        b=QCXw+/IbREDojWveGDxuxRYtxZyj6gloJNZUcVvZw5MWF+v+JW9stIpOkUqDsRYXAw
         hh+GBGLYsnIEA1wxpsqaAwuoUqg7EGh8fvy39jgkV2CScWC8qY1TOojY9Xo36LePP/Ww
         e8BgpXCZyqAqep3kYBHEBijmKC7+XROXTogCH+argyJVVW0iia+CRH4BUPFhqHNaV+LY
         RL7jW7LoJ+lPjaYGbVWKNgPBLLlGnmmW/8k2BBJbkm9E8V+WAGmCTrPqANMYXf+5dR5c
         Dcg30CWyL+fN0x7WoxWI5Ua0hbOyuYhmF6Lflc5DVPQcQmbTWqGhqSLjcmHoMY9LrpSK
         rlQw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724766262; x=1725371062;
        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=RV+DxkttUXiV0vbnMI++tRBCTodxkM3RRM2Fbm+HshM=;
        b=RytLMdYzYGUriVEIl+mMsWX0hbJqTjfyi7R0cTQ7KnJiBA69dBDVaqTRtLoJaXmFzx
         4EO/V5SobssSTs1f0DOFD31P/4z9jzEB3LWN+hoMyi7J7fz/e4EchbfWOZ+QOnV6Urfr
         tTbdpL+o8z1zj3HpxyC75rSFQmZHKilk0VvPmcW1yZH+baqLcWd/cHwPcy9AWV4Yz4wg
         LMSrLEJZhvJ5y7Kd3sq3r+oHp2N1vbyaLx52LoSO2r49t4CdG1PoMNA5Or8ilqhmm9fm
         nl1svLfNc4QBebjoBVaBq9EsAggwhXqyX3oqb8mW9VEsqdc94CKFoNlSEfxDTGL5XC8C
         m9Ig==
X-Forwarded-Encrypted: i=1; AJvYcCWhpRUq7C4//xQ5mH6+ygL71/SoCU03U7CXsfIzzRZbtef3CXAZBrptC8igMxOgi7qNxoOMWUpUarY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwZBlWnNfeASuEAGgxNosczwH+ZTUflRb0I0CykrRGWzdmcbh7X
	/qWSdKtaPqI2zodxZIMxBPjGmN9JDPfwOIv1vC441ClEyqLEAX9tRBNXmj6xSQ==
X-Google-Smtp-Source: AGHT+IEvnosueUjxKJAlsjdlEaPfCYaMCfAi5TnpgUTBxz6I5VlhsOL9aiKGSJDcNxZ1Hn0P90BtnA==
X-Received: by 2002:a17:907:3fa9:b0:a86:43c0:7d2 with SMTP id a640c23a62f3a-a86e35a343emr219788566b.0.1724766261495;
        Tue, 27 Aug 2024 06:44:21 -0700 (PDT)
Message-ID: <8f01fffa-ff7e-4a08-b707-7bf5175b461e@suse.com>
Date: Tue, 27 Aug 2024 15:44:20 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 4/7] xen/riscv: introduce functionality to work with
 CPU info
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
 <03a703996ae7300a9eda54283711b19c42a7d116.1724256027.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <03a703996ae7300a9eda54283711b19c42a7d116.1724256027.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 21.08.2024 18:06, Oleksii Kurochko wrote:
> Introduce struct pcpu_info to store pCPU-related information.
> Initially, it includes only processor_id and hart id, but it
> will be extended to include guest CPU information and
> temporary variables for saving/restoring vCPU registers.
> 
> Add set_processor_id() and get_processor_id() functions to set
> and retrieve the processor_id stored in pcpu_info.
> 
> Introduce cpuid_to_hartid_map() to convert Xen logical CPUs to
> hart IDs (physical CPU IDs).

There's no function of that name anymore.

> ---
> Changes in V5:
>  - add hart_id to pcpu_info;
>  - add comments to pcpu_info members.
>  - define INVALID_HARTID as ULONG_MAX as mhart_id register has MXLEN which is
>    equal to 32 for RV-32 and 64 for RV-64.
>  - add hart_id to pcpu_info structure.
>  - drop cpuid_to_hartid_map[] and use pcpu_info[] for the same purpose.
>  - introduce new function setup_tp(cpuid).
>  - add the FIXME commit on top of pcpu_info[].

Once again "comment" here? And that despite ...

>  - setup TP register before start_xen() being called.
>  - update the commit message.
>  - change "commit message" to "comment" in "Changes in V4" in "update the comment
>    above the code of TP..."

... this?

> --- a/xen/arch/riscv/include/asm/processor.h
> +++ b/xen/arch/riscv/include/asm/processor.h
> @@ -12,8 +12,33 @@
>  
>  #ifndef __ASSEMBLY__
>  
> -/* TODO: need to be implemeted */
> -#define smp_processor_id() 0
> +#include <xen/bug.h>
> +
> +register struct pcpu_info *tp asm ("tp");

Nit: Strictly speaking there need to be blanks inside the parentheses.
But maybe an exception for a register variable name declaration is okay.

> +struct pcpu_info {
> +    unsigned int processor_id; /* Xen CPU id */
> +    unsigned long hart_id; /* physical CPU id */
> +};
> +
> +/* tp points to one of these */
> +extern struct pcpu_info pcpu_info[NR_CPUS];
> +
> +#define get_processor_id()      (tp->processor_id)
> +#define set_processor_id(id)    do { \
> +    tp->processor_id = (id);         \
> +} while (0)
> +
> +static inline unsigned int smp_processor_id(void)
> +{
> +    unsigned int id;
> +
> +    id = get_processor_id();

Nit: This can easily be the initializer of the variable.

> +    BUG_ON(id > NR_CPUS);

I'm pretty sure I pointed out before that this is off by 1: NR_CPUS
itself is invalid, too.

> --- a/xen/arch/riscv/include/asm/smp.h
> +++ b/xen/arch/riscv/include/asm/smp.h
> @@ -5,6 +5,10 @@
>  #include <xen/cpumask.h>
>  #include <xen/percpu.h>
>  
> +#include <asm/processor.h>
> +
> +#define INVALID_HARTID ULONG_MAX

So what if the firmware report this value for one of the harts?

> @@ -14,6 +18,13 @@ DECLARE_PER_CPU(cpumask_var_t, cpu_core_mask);
>   */
>  #define park_offline_cpus false
>  
> +void smp_set_bootcpu_id(unsigned long boot_cpu_hartid);
> +
> +/*
> + * Mapping between linux logical cpu index and hartid.
> + */
> +#define cpuid_to_hartid(cpu) pcpu_info[cpu].hart_id

If I'm not mistaken Misra demands parentheses around the expression
even in cases like this one (where at the use sites you can't really
do anything [that makes at least some sense] to break what the macro
is supposed to do).

> --- a/xen/arch/riscv/riscv64/head.S
> +++ b/xen/arch/riscv/riscv64/head.S
> @@ -55,6 +55,10 @@ FUNC(start)
>           */
>          jal     reset_stack
>  
> +        /* Xen's boot cpu id is equal to 0 so setup TP register for it */
> +        mv      a0, x0
> +        jal     setup_tp

I'm not going to insist, but for the casual reader "li a0, 0" may be
more obvious as to what it does, and if I'm not mistaken that actually
expands to the same underlying insn as the "mv" you use.

> --- a/xen/arch/riscv/setup.c
> +++ b/xen/arch/riscv/setup.c
> @@ -8,6 +8,7 @@
>  #include <public/version.h>
>  
>  #include <asm/early_printk.h>
> +#include <asm/smp.h>
>  #include <asm/traps.h>
>  
>  void arch_get_xen_caps(xen_capabilities_info_t *info)
> @@ -40,6 +41,10 @@ void __init noreturn start_xen(unsigned long bootcpu_id,
>  {
>      remove_identity_mapping();
>  
> +    set_processor_id(0);

This isn't really needed, is it? The pcpu_info[] initializer already
installs the necessary 0. Another thing would be if the initializer
set the field to, say, NR_CPUS.

> --- /dev/null
> +++ b/xen/arch/riscv/smp.c
> @@ -0,0 +1,21 @@
> +#include <xen/smp.h>
> +
> +/*
> + * FIXME: make pcpu_info[] dynamically allocated when necessary
> + *        functionality will be ready
> + */
> +/* tp points to one of these per cpu */
> +struct pcpu_info pcpu_info[NR_CPUS] = { { 0, INVALID_HARTID } };

As to the initializer - what about CPUs other than CPU0? Would they
better all have hart_id set to invalid?

Also, as a pretty strong suggestion to avoid excessive churn going
forward: Please consider using dedicated initializers here. IOW
perhaps

struct pcpu_info pcpu_info[NR_CPUS] = { [0 ... NR_CPUS - 1] = {
    .hart_id = INVALID_HARTID,
}};

Yet as said earlier - in addition you likely want to make sure no
two CPUs have (part of) their struct instance in the same cache line.
That won't matter right now, as you have no fields you alter at
runtime, but I expect such fields will appear.

> +void setup_tp(unsigned int cpuid)
> +{
> +    /*
> +     * tp register contains an address of physical cpu information.
> +     * So write physical CPU info of cpuid to tp register.
> +     * It will be used later by get_processor_id() ( look at
> +     * <asm/processor.h> ):
> +     *   #define get_processor_id()    (tp->processor_id)
> +     */
> +    asm volatile ( "mv tp, %0"
> +                   :: "r" ((unsigned long)&pcpu_info[cpuid]) : "memory" );
> +}

So you've opted to still do this in C. Which means there's still a
residual risk of the compiler assuming it can already to tp. What's
the problem with doing this properly in assembly?

As to the memory clobber - in an isolated, non-inline function its
significance is reduced mostly to the case of LTO (which I'm not
sure you even target). Nevertheless probably worth keeping, even if
mainly for documentation purposes. Provided of course this C function
is to remain.

> --- /dev/null
> +++ b/xen/arch/riscv/smpboot.c
> @@ -0,0 +1,8 @@
> +#include <xen/init.h>
> +#include <xen/sections.h>
> +#include <xen/smp.h>
> +
> +void __init smp_set_bootcpu_id(unsigned long boot_cpu_hartid)
> +{
> +    cpuid_to_hartid(0) = boot_cpu_hartid;
> +}

Does this really need its own function?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:51:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:51:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784052.1193406 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwbs-0001I9-Se; Tue, 27 Aug 2024 13:51:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784052.1193406; Tue, 27 Aug 2024 13:51:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwbs-0001I2-PS; Tue, 27 Aug 2024 13:51:48 +0000
Received: by outflank-mailman (input) for mailman id 784052;
 Tue, 27 Aug 2024 13:51:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=CYmO=P2=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1siwbr-0001Hc-AC
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 13:51:47 +0000
Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com
 [2607:f8b0:4864:20::82a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7fc10c35-647b-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 15:51:46 +0200 (CEST)
Received: by mail-qt1-x82a.google.com with SMTP id
 d75a77b69052e-44fee8813c3so32556381cf.2
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 06:51:46 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6c162db079csm56160046d6.78.2024.08.27.06.51.44
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 27 Aug 2024 06:51:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7fc10c35-647b-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724766705; x=1725371505; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=KNkVTkiYHeWx5t2DtRjUJMHLVLJFiiLeULy2l250Rbs=;
        b=Nd+y6Vu3RZZKhGWiePWa6JJyL6a6Q1LEb2zRMP28LUUQ05Fd2r2klK93ik9xQVVDCu
         NfaXCqUMMbQTc73ayVpP5Gu2Vy/jvtbFiIP4VysYadFoGxC0H6zWKsyqcBz418kjsJJo
         wNcZCxOuWOBXkO5s9Qjo1BbsqwKy5eD2V43zA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724766705; x=1725371505;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=KNkVTkiYHeWx5t2DtRjUJMHLVLJFiiLeULy2l250Rbs=;
        b=F+jWKVQvoYyEGB33TGte3wH2/LlBo2rRYvm5AgvFXnTbVVxalGHPKKSSyd3eBeeS4q
         gBNdkDljuIk6KG8wXzlSIuCYWLbMXD0EKoA0bJOnRm3D4ooLsgmQdu1wNRh8bxwAzisY
         Gn6P1TgM3BHNKBswZYxmuTnQx+Fj+zhcdVChx4e8h6UpFHPTdifm37eE2JgUnKGfdhS2
         3z5OnAyCJiiugn1L1MpqC0lWRhrAl2tp6BuBd8EFP0FvDuSDEzFokHKyivlvw52aIVdL
         Phu1nQbp/FKt4o+n62su5vIk823VnBxlkRE0VsSi9JZQhnig42wjHxnXcJpetZ7aUls6
         F54Q==
X-Forwarded-Encrypted: i=1; AJvYcCVSphoTK6a4qIByK+Ge58+UMwX9v8DgBZRzgB+/poDt9TZaAaV6hNzbcED7BdyDIM3Oac/eLXqkBgU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwoygZioQMlR0xBY6xNIEdhhJ2A3SzRSBgh1bopGYgekJR4Jjx6
	SWYgPr0/PYP5Vdc3xP2jPhkvoh7J6BChM9nvBI1gY96OTi5IBaI1xK0Q9aHi9Yic6VtxU16X3+l
	1
X-Google-Smtp-Source: AGHT+IFjc1FDOm46yfne36hpVK7kWWmzedxbghps7WX/UV5i6H7RqJk7zl7dgihGC/jue9cVWcXq9w==
X-Received: by 2002:a05:6214:2f0c:b0:6c3:2a41:cc14 with SMTP id 6a1803df08f44-6c32a41cc79mr38785486d6.0.1724766705193;
        Tue, 27 Aug 2024 06:51:45 -0700 (PDT)
Date: Tue, 27 Aug 2024 15:51:42 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v5] x86/dom0: disable SMAP for PV domain building only
Message-ID: <Zs3Z7quUyCi4OuYb@macbook.local>
References: <20240827123949.24400-1-roger.pau@citrix.com>
 <734d41c3-709c-4286-8353-f5483b0987cb@citrix.com>
 <d939dffc-e8e3-40cf-8494-c03ae6978c90@suse.com>
 <4822571d-efe9-4cab-a016-70ee5f21c256@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <4822571d-efe9-4cab-a016-70ee5f21c256@citrix.com>

On Tue, Aug 27, 2024 at 02:07:07PM +0100, Andrew Cooper wrote:
> On 27/08/2024 2:04 pm, Jan Beulich wrote:
> > On 27.08.2024 14:59, Andrew Cooper wrote:
> >> On 27/08/2024 1:39 pm, Roger Pau Monne wrote:
> >>> --- a/xen/arch/x86/dom0_build.c
> >>> +++ b/xen/arch/x86/dom0_build.c
> >>> @@ -612,7 +612,24 @@ int __init construct_dom0(struct domain *d, const module_t *image,
> >>>      if ( is_hvm_domain(d) )
> >>>          rc = dom0_construct_pvh(d, image, image_headroom, initrd, cmdline);
> >>>      else if ( is_pv_domain(d) )
> >>> +    {
> >>> +        /*
> >>> +         * Temporarily clear SMAP in CR4 to allow user-accesses in
> >>> +         * construct_dom0().  This saves a large number of corner cases
> >>> +         * interactions with copy_from_user().
> >>> +         */
> >>> +        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> >>> +        {
> >>> +            cr4_pv32_mask &= ~X86_CR4_SMAP;
> >>> +            write_cr4(read_cr4() & ~X86_CR4_SMAP);
> >>> +        }
> >>>          rc = dom0_construct_pv(d, image, image_headroom, initrd, cmdline);
> >>> +        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> >>> +        {
> >>> +            write_cr4(read_cr4() | X86_CR4_SMAP);
> >>> +            cr4_pv32_mask |= X86_CR4_SMAP;
> >>> +        }
> >>> +    }
> >> I hate to drag this on further still, but can this logic be move it into
> >> dom0_construct_pv() itself, rather than here?
> > Just to mention it: I'm fine with this in principle, as long as this won't
> > mean a pile of new goto-s in dom0_construct_pv(). If a new wrapper was
> > introduced (with the present function becoming static), I'd be okay.
> 
> I'd be happy with that too.
> 
> In fact, static helpers are probably best, seeing as we'll eventually
> need real #ifdefary around the cr4_pv32_mask accesses.

Do you mean a static helper in dom0_build.c for enabling/disabling
SMAP?

Because my plan would be to also add a wrapper for dom0_construct_pv()
so that I don't need to adjust the returns path in dom0_construct_pv()
itself.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:54:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:54:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784058.1193416 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwe3-0001pV-87; Tue, 27 Aug 2024 13:54:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784058.1193416; Tue, 27 Aug 2024 13:54:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwe3-0001pO-4q; Tue, 27 Aug 2024 13:54:03 +0000
Received: by outflank-mailman (input) for mailman id 784058;
 Tue, 27 Aug 2024 13:54:01 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siwe1-0001pF-9i
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 13:54:01 +0000
Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com
 [2a00:1450:4864:20::634])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cf3916da-647b-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 15:53:59 +0200 (CEST)
Received: by mail-ej1-x634.google.com with SMTP id
 a640c23a62f3a-a86fa3dea99so1640166b.2
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 06:53:59 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb471e32sm1020667a12.66.2024.08.27.06.53.58
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 06:53:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cf3916da-647b-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724766839; x=1725371639; 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=c1TVBydAj/sy7dIa9BDL2fBR6Qli5OMjIQG0E77B/ko=;
        b=daQnrGHBh3uMMo4HNKQVahhNqAI3nPeNdcj0UbuWP85xIXe2h6DKWvl5kbaB2+ycC4
         HUEL4c5p0c1JJq47YWLH3TrAqWj6BpeEWLqfMB3yFUniNzvvDI4Oc57nARkmDdniVzqT
         KyMx2coHhoV7p2psD3DKGN2vY0p/PMAJFFF9hh1zQcwRvzFF41g7+v9KklBqJSQjPLJD
         kEJa2buKGgxiZlOAx3/KcA7rQhlnrap7VVYDwfSn3HTKPVh0mGqbfIHL1edB9E27tQY5
         PcDBy2N4dC7A9B4EcytNnhc30CJiMvHBHIyPDWK1YumBX0I1tJUWgueeHJBkuCiBL41V
         B2kg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724766839; x=1725371639;
        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=c1TVBydAj/sy7dIa9BDL2fBR6Qli5OMjIQG0E77B/ko=;
        b=PZ3uBeN53rgRywjdX8wGHqs4sXh5fKJ+9hOjt7Y/weQNHQm/xSBLZpWG4zlVYNm6Mp
         2+o6IK2gHD0s+1hMspn9M/IylNMrG05x1sTc4uTZG/PJt8vMtXicqOGyPF0y76OiZtwZ
         TpZ6I8UhMf/KMewgIlNkUaFUcmYnS8ZM6n+gPQCZBxS7ZL0Lx2ym1SejdKdRTja70UsB
         ps2XTKUjvdLBWzOAlYn5UHHihDU65ZtIWUF9oCNQXGaHae4Sht/IxOWiTd8TWEbyix9D
         70uGP0TYYCeu5aPhKoSBxLVDBKYIZ9vDL2a+qVDDXm46+b53IppJXSzIfQrrQ9RvjC7R
         3hbg==
X-Gm-Message-State: AOJu0YyeJe6P+28V/ovTGKjwxOYwfa5/jWxEMiPeLpqgM8Klgy+B7jkh
	Or+u6A18gymh7NTtGLspv3NXG8Ux++MQk9TIR1POk2z0Sa/0wqvJvnlmqxEJgA==
X-Google-Smtp-Source: AGHT+IHH4CJLbYjel5WALUO98/Oy7Qm+OHNRQ9fEaAG4KQkZGCekfXl31iJ843JprZsDOBnHmjeEIQ==
X-Received: by 2002:a05:6402:5203:b0:5c0:ad36:284e with SMTP id 4fb4d7f45d1cf-5c0ad362ac8mr5693626a12.12.1724766838610;
        Tue, 27 Aug 2024 06:53:58 -0700 (PDT)
Message-ID: <ce7c0b2d-2245-40d4-93d7-0970d2f84033@suse.com>
Date: Tue, 27 Aug 2024 15:53:57 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5] x86/dom0: disable SMAP for PV domain building only
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org
References: <20240827123949.24400-1-roger.pau@citrix.com>
 <734d41c3-709c-4286-8353-f5483b0987cb@citrix.com>
 <d939dffc-e8e3-40cf-8494-c03ae6978c90@suse.com>
 <4822571d-efe9-4cab-a016-70ee5f21c256@citrix.com>
 <Zs3Z7quUyCi4OuYb@macbook.local>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+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: <Zs3Z7quUyCi4OuYb@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27.08.2024 15:51, Roger Pau Monné wrote:
> On Tue, Aug 27, 2024 at 02:07:07PM +0100, Andrew Cooper wrote:
>> On 27/08/2024 2:04 pm, Jan Beulich wrote:
>>> On 27.08.2024 14:59, Andrew Cooper wrote:
>>>> On 27/08/2024 1:39 pm, Roger Pau Monne wrote:
>>>>> --- a/xen/arch/x86/dom0_build.c
>>>>> +++ b/xen/arch/x86/dom0_build.c
>>>>> @@ -612,7 +612,24 @@ int __init construct_dom0(struct domain *d, const module_t *image,
>>>>>      if ( is_hvm_domain(d) )
>>>>>          rc = dom0_construct_pvh(d, image, image_headroom, initrd, cmdline);
>>>>>      else if ( is_pv_domain(d) )
>>>>> +    {
>>>>> +        /*
>>>>> +         * Temporarily clear SMAP in CR4 to allow user-accesses in
>>>>> +         * construct_dom0().  This saves a large number of corner cases
>>>>> +         * interactions with copy_from_user().
>>>>> +         */
>>>>> +        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
>>>>> +        {
>>>>> +            cr4_pv32_mask &= ~X86_CR4_SMAP;
>>>>> +            write_cr4(read_cr4() & ~X86_CR4_SMAP);
>>>>> +        }
>>>>>          rc = dom0_construct_pv(d, image, image_headroom, initrd, cmdline);
>>>>> +        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
>>>>> +        {
>>>>> +            write_cr4(read_cr4() | X86_CR4_SMAP);
>>>>> +            cr4_pv32_mask |= X86_CR4_SMAP;
>>>>> +        }
>>>>> +    }
>>>> I hate to drag this on further still, but can this logic be move it into
>>>> dom0_construct_pv() itself, rather than here?
>>> Just to mention it: I'm fine with this in principle, as long as this won't
>>> mean a pile of new goto-s in dom0_construct_pv(). If a new wrapper was
>>> introduced (with the present function becoming static), I'd be okay.
>>
>> I'd be happy with that too.
>>
>> In fact, static helpers are probably best, seeing as we'll eventually
>> need real #ifdefary around the cr4_pv32_mask accesses.
> 
> Do you mean a static helper in dom0_build.c for enabling/disabling
> SMAP?

While that's how I understood Andrew's response, I'm not sure that'll buy
us very much. They'll both be used just once, and hence the amount of
#ifdef-ary is going to be the same as when the logic is kept in line.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:57:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:57:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784063.1193425 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwh0-0003Gu-Kp; Tue, 27 Aug 2024 13:57:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784063.1193425; Tue, 27 Aug 2024 13:57:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwh0-0003Gn-Hx; Tue, 27 Aug 2024 13:57:06 +0000
Received: by outflank-mailman (input) for mailman id 784063;
 Tue, 27 Aug 2024 13:57:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YF2W=P2=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1siwgy-0003EW-Ez
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 13:57:04 +0000
Received: from mail-oo1-xc31.google.com (mail-oo1-xc31.google.com
 [2607:f8b0:4864:20::c31])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3c06b452-647c-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 15:57:02 +0200 (CEST)
Received: by mail-oo1-xc31.google.com with SMTP id
 006d021491bc7-5de9809a38aso1350359eaf.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 06:57:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3c06b452-647c-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724767021; x=1725371821; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=7ePsRRUJJZrjmR3x3E7P8pxZnFKK+dnjTPbEy/WvWuI=;
        b=BukuysBgKnxuQpkN9Vo+5qXF4r0CRwsPI7RCacnjTBxRhiMRPcUF15lmAlSHDCSC0H
         hhJpickofJ2GVIJWdjyEuKFJGf2adHnYqayJwQ0x0shheAOw2kDbo3aG+3M0FEcuS6lv
         4Ipl1+4f6PWeCaCdZ0vgU7luUX2K7DPAXXzRU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724767021; x=1725371821;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=7ePsRRUJJZrjmR3x3E7P8pxZnFKK+dnjTPbEy/WvWuI=;
        b=gQJ1q/MtP99xVRU0mOAX8Tinr13ZaFPX3y2V4kpoXwz2R7WAiOIvX1bEKcvwBDQlfW
         rVyE2tLAOnPLNooRPWmvsTN/Z1nTbDOwk+JhjPsomuDBVkXxJDIMRa1OV1AsqN5izvzG
         y5RZUiRFCb/vAsYcfNWwDPRjPsQCu0lT4oHcUDkC/H+fMvqxdc2Q2zpIpu5oo9klyvDS
         7CSbdbSFcS9a1S13cShVsvGKall5Ix81wGHZbF4lZQnfVwiCl8k4vusE7vHu5F8o4MRf
         3V+WhQmkHFD3RZOofJAzvaNzs2Yh18KkIF6nQolNdqUS90Ps0T/1dOBgK0CIMfPytusq
         4aDg==
X-Forwarded-Encrypted: i=1; AJvYcCUoNRrbczoDH31dgAfIQA1AbMaCd/q6GUiYkorNtaFdhYt43c8FaegSQXVzvadycHN0Ypu2//9Iu08=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwdYLfUNu7QztdpHKN6UZyLQup8U8krjdAp5zOprDXGjk+CoBIR
	fsac4sy27Xw/EDH+jof7nDeBIX8SfkiuVgMdKs+CX+o5jb0hmPqyT+JGlgWaxk+Ka8TFgMegYjf
	R+MYPMmLsMMvETxlgvT+BwNSReYgViN3yhrDdcA==
X-Google-Smtp-Source: AGHT+IEd65LqBC7abzN/zts5K1hpuW+hWIywvh/pydS8ElMKLeDbkWayR1d96BJY1QYVmAi+GGjP7qx2CbIQ5BFfvpk=
X-Received: by 2002:a05:6820:2228:b0:5da:99f5:8fd6 with SMTP id
 006d021491bc7-5dcc5b68c45mr15378505eaf.0.1724767018114; Tue, 27 Aug 2024
 06:56:58 -0700 (PDT)
MIME-Version: 1.0
References: <20240822152953.489136-1-frediano.ziglio@cloud.com> <55e6dc6c-344a-4483-90c2-e414ef4bc869@suse.com>
In-Reply-To: <55e6dc6c-344a-4483-90c2-e414ef4bc869@suse.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Tue, 27 Aug 2024 14:56:47 +0100
Message-ID: <CACHz=ZgbU3-HBgoDC9ws=cCK10B2D4K2JxjLN3_0YGoksVep8w@mail.gmail.com>
Subject: Re: [PATCH] Avoid additional relocations in trampoline code
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Alejandro Vallejo <alejandro.vallejo@cloud.com>, xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 26, 2024 at 9:21=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> On 22.08.2024 17:29, Frediano Ziglio wrote:
> > The trampoline could have "manual" relocation entries (created
> > by assembly macros and some code to use them) and (in case of PE)
> > normal executable relocations.
> > Remove all normal executable ones. In this way we don't have to
> > worry about applying both correctly (they need proper order
> > which is hard to spot looking at the code).
> >
> > Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
>
> I think this wants splitting into one patch replacing sym_offs() and a
> 2nd one introducing the hand-crafted __XEN_VIRT_START additions (which
> may want macro-izing). Plus the justification for the change wants
> extending, to actually explain what the problem is - after all there's
> no issue anywhere right now.
>

Should I explain the time dependency issue with source code?
I suppose I can describe where currently is and why it would be better
to have it removed (honestly I though I did but reading the commit
message I didn't).
Maybe for search reasons it would be better to define 2 macros like
the following?

#define phys_addr(sym) sym ## _pa
#define virt_addr(sym) sym ## _va

This way, for instance, searching for the "__high_start" word (like
"grep -rw __high_start") would produce a result.

> > --- a/xen/arch/x86/boot/trampoline.S
> > +++ b/xen/arch/x86/boot/trampoline.S
> > @@ -73,7 +73,7 @@ trampoline_protmode_entry:
> >          mov     %ecx,%cr4
> >
> >          /* Load pagetable base register. */
> > -        mov     $sym_offs(idle_pg_table),%eax
> > +        mov     $idle_pg_table_pa, %eax
> >          add     bootsym_rel(trampoline_xen_phys_start,4,%eax)
> >          mov     %eax,%cr3
> >
> > @@ -113,7 +113,7 @@ trampoline_protmode_entry:
> >          .code64
> >  start64:
> >          /* Jump to high mappings. */
> > -        movabs  $__high_start, %rdi
> > +        movabs  $__high_start_pa + __XEN_VIRT_START, %rdi
> >          jmpq    *%rdi
> >
> >  #include "video.h"
> > --- a/xen/arch/x86/boot/wakeup.S
> > +++ b/xen/arch/x86/boot/wakeup.S
> > @@ -99,7 +99,7 @@ wakeup_32:
> >          mov     $bootsym_rel(wakeup_stack, 4, %esp)
> >
> >          # check saved magic again
> > -        mov     $sym_offs(saved_magic),%eax
> > +        mov     $saved_magic_pa, %eax
> >          add     bootsym_rel(trampoline_xen_phys_start, 4, %eax)
> >          mov     (%eax), %eax
> >          cmp     $0x9abcdef0, %eax
> > @@ -112,7 +112,7 @@ wakeup_32:
> >          mov     %ecx, %cr4
> >
> >          /* Load pagetable base register */
> > -        mov     $sym_offs(idle_pg_table),%eax
> > +        mov     $idle_pg_table_pa ,%eax
> >          add     bootsym_rel(trampoline_xen_phys_start,4,%eax)
> >          mov     %eax,%cr3
> >
> > @@ -156,7 +156,7 @@ wakeup_32:
> >          .code64
> >  wakeup_64:
> >          /* Jump to high mappings and the higher-level wakeup code. */
> > -        movabs  $s3_resume, %rbx
> > +        movabs  $s3_resume_pa + __XEN_VIRT_START, %rbx
> >          jmp     *%rbx
> >
> >  bogus_saved_magic:
>
> With the sym_offs() uses gone, I think it would be best if the macro was
> #undef-ed ahead of the inclusion of trampoline.S. Since x86_64.S uses the
> macro, that'll require careful re-arrangement of #include order.
>

I think you mean including the trampoline after including x86_64.S in
head.S. I can do it.

> > --- a/xen/arch/x86/xen.lds.S
> > +++ b/xen/arch/x86/xen.lds.S
> > @@ -71,7 +71,12 @@ SECTIONS
> >    __2M_text_start =3D .;         /* Start of 2M superpages, mapped RX.=
 */
> >  #endif
> >
> > -  start_pa =3D ABSOLUTE(start - __XEN_VIRT_START);
> > +#define DEFINE_PA_ADDRESS(sym) sym ## _pa =3D ABSOLUTE(sym - __XEN_VIR=
T_START)
> > +  DEFINE_PA_ADDRESS(start);
> > +  DEFINE_PA_ADDRESS(saved_magic);
> > +  DEFINE_PA_ADDRESS(idle_pg_table);
> > +  DEFINE_PA_ADDRESS(__high_start);
> > +  DEFINE_PA_ADDRESS(s3_resume);
> >
> >    . =3D __XEN_VIRT_START + XEN_IMG_OFFSET;
> >    _start =3D .;
>
> For the cases where in assembly code you add __XEN_VIRT_START this is pre=
tty
> odd: You subtract the value here just to add it back there. Did you consi=
der
> a more straightforward approach, like introducing absolute xxx_va symbols=
?
>

I didn't consider. Would something like

#define DEFINE_ABS_ADDRESSES(sym) \
   sym ## _pa =3D ABSOLUTE(sym - __XEN_VIRT_START); \
   sym ## _va =3D ABSOLUTE(sym)

make sense? Maybe the _pa and _va suffixes are too similar? Maybe
_physaddr and _virtaddr? Or use capical letters and macros (as above)
to avoid possible clashes?

> Also, as a general request: Can you please become used to adding meaningf=
ul
> subject prefixes to your patches?
>

Sure

> Jan

Frediano


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:57:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:57:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784068.1193436 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwhn-000487-T5; Tue, 27 Aug 2024 13:57:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784068.1193436; Tue, 27 Aug 2024 13:57:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwhn-000480-QB; Tue, 27 Aug 2024 13:57:55 +0000
Received: by outflank-mailman (input) for mailman id 784068;
 Tue, 27 Aug 2024 13:57:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1siwhn-0003sI-7W
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 13:57:55 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5af6c258-647c-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 15:57:53 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-5334c018913so5306700e87.0
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 06:57:53 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e588adf2sm113898966b.173.2024.08.27.06.57.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 27 Aug 2024 06:57:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5af6c258-647c-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724767073; x=1725371873; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=VYUYCRiWwMW/1FuT+OVshjNKOGKuxH1Fw4wYQKJXxb0=;
        b=sqrurdTT8jjhh+R+YEoHKDNn3anL3HqiB5b2alp9mnxCInAJ2I9flMuPtOO9xatRoh
         PF8lGN1a0MOlzABrjdRpe6JboDLY7jNjW6fHIuh/9/+0b5qx04PdKTvdNlAEAESm6UOs
         4NaQrxlrzcL6xOYIspJYk339mTKluZopSaW6c=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724767073; x=1725371873;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=VYUYCRiWwMW/1FuT+OVshjNKOGKuxH1Fw4wYQKJXxb0=;
        b=kIVQrRuzHkDaiwhzXt+k65INYxLDlNZz24eAPOshLz7kVTGExRHChtBuw0TlCSrzkQ
         YtSQfe8SFETEuaJmDudU015RlVEh6o+XvztRwxukLlvhQ2Fe9ta/WXn21CglhFJRTQDj
         yqYx1x4yIU7+AyX+pnRCUOd1FpBp3SyqtM2RgzKakqW0wUAL/bTExexKD/4rUa02k8Cf
         2Rs3jSqTYe4bBgh+Q+6OKwehXth4E8lElnSinxgkqFCBywjuFWV3oAK8mPbrBBAXtHsa
         XpamJmIdzBqFL67RX2+M2dKZbUGI+JgInuMuz1osUA4PlbS/nfYrnzFuoW3uhp2RSEQU
         sN5Q==
X-Gm-Message-State: AOJu0YxH46NEuy1cj8KolGRF07fbxKdHCPG8xs4jnKVYIuQhEFZ11gC4
	hSnwTpn03wQPBNa+vC++qRMIOxydJ9IoH7vDq+YqA+2d3DIK5QwoEmAoUKgPhfmI9Gxv8rUYgoQ
	W
X-Google-Smtp-Source: AGHT+IERoOD6iXtrsHj8rsKjRo76854THB5EUFy13WvC4RK0qO0OsG8wpMiH0FsWnKKl2ZlYQq/QSQ==
X-Received: by 2002:a05:6512:1589:b0:52c:e05e:849b with SMTP id 2adb3069b0e04-53438861080mr8192058e87.39.1724767072370;
        Tue, 27 Aug 2024 06:57:52 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH 0/4] xen/bitops: More for_each_bit() conversions
Date: Tue, 27 Aug 2024 14:57:42 +0100
Message-Id: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

All patches are independent.  Patch 4 has been posted before, with only a
request for some wording changes.

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1428997960

Andrew Cooper (4):
  xen/evtchn: Use bitmap_for_each() in evtchn_check_pollers()
  x86/hvm: Use for_each_set_bit() in hvm_emulate_writeback()
  x86/hvm: Rework hpet_write() for improved code generation
  x86/vmx: Rewrite vmx_sync_pir_to_irr() to be more efficient

 xen/arch/x86/hvm/emulate.c             | 20 ++++----
 xen/arch/x86/hvm/hpet.c                | 29 +++--------
 xen/arch/x86/hvm/vmx/vmx.c             | 70 +++++++++++++++++++++++---
 xen/arch/x86/include/asm/hvm/emulate.h |  4 +-
 xen/common/event_channel.c             |  4 +-
 5 files changed, 83 insertions(+), 44 deletions(-)

-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:57:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:57:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784069.1193440 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwho-0004A0-3D; Tue, 27 Aug 2024 13:57:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784069.1193440; Tue, 27 Aug 2024 13:57:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwho-00049Y-07; Tue, 27 Aug 2024 13:57:56 +0000
Received: by outflank-mailman (input) for mailman id 784069;
 Tue, 27 Aug 2024 13:57:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1siwhn-00047p-G2
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 13:57:55 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5b7e8350-647c-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 15:57:54 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-a86859e2fc0so687341566b.3
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 06:57:54 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e588adf2sm113898966b.173.2024.08.27.06.57.52
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 27 Aug 2024 06:57:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5b7e8350-647c-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724767073; x=1725371873; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=lWli70jhXRT+1zJ4cUaW5oqtYkf8vd8SYDQrICxm6yE=;
        b=GL+XsUdCoKBKeDoVN5cq+4tEMei5ooCUDi9pbzHFIow3n67/+r3Ae6ojAL/u5nozU0
         heAwoM91N2n+x1a4aq/AxUqd2ld+2lY9lT8w9EH90uWI4yZHGt80KUOFvHivyY0Z0D98
         kOXzdoM/2Rr7LQBR41mEQcuVJCtOynCSik5FI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724767073; x=1725371873;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=lWli70jhXRT+1zJ4cUaW5oqtYkf8vd8SYDQrICxm6yE=;
        b=txEYLNAbcM4RnLk+Kp52JVFhckpTk7I9hKYTHZV7Xi7KxRdMMb+8WwgnrIcdfNzm9r
         AcrYDX/bsjI6izUi1DJXrTeb1v+jL96Ooes8kgqI4F2Yg4eV73HPHtfy+1bqwlAlKt4w
         gy/j6QNXEQnFDo1Jttr7HP1kLOtVicKIswijt/gHHqbu9sISj1AIbJ+2sVAPb3aLRLuW
         g2x0DrMq0Fd97N3Uw3GK3zxNh0zzYpVnps3kPTgGkvQgGPRDS44y5oZo0EuJnwCeCk7L
         dHPq/LqypqfveHQbxYx0pYdRyXqrVsyaghnEISG8N+fkZu0GZRGUW91nmqijZgkZaY1Q
         oIWg==
X-Gm-Message-State: AOJu0Ywj/7r2FE0nqiByu46D2GUu+Io0Hrf0y2Rr9ICKewsN9/4QkEk3
	Gy/rTx7PAVnoGai9W46FbbvAOBdmTqLcyk0a0yU9BAEklI2ZFTtb62Atd9Sd+jbKfLSDZZJFm4T
	X
X-Google-Smtp-Source: AGHT+IFfGcZL/pIGlbHYGOiP8yeTKhRtLOJUjxssu5EVYTfskAuuK/Tmx6RF7IRtiN49AhGs0Q7hKw==
X-Received: by 2002:a17:907:7d94:b0:a86:b504:42ea with SMTP id a640c23a62f3a-a86e3bdbd2bmr197554766b.45.1724767073100;
        Tue, 27 Aug 2024 06:57:53 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>
Subject: [PATCH 1/4] xen/evtchn: Use bitmap_for_each() in evtchn_check_pollers()
Date: Tue, 27 Aug 2024 14:57:43 +0100
Message-Id: <20240827135746.1908070-2-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

It is a preprocessor-identical opencoding.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
---
 xen/common/event_channel.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index 13b97c94d7fa..8db2ca4ba23e 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -1517,9 +1517,7 @@ void evtchn_check_pollers(struct domain *d, unsigned int port)
         return;
 
     /* Wake any interested (or potentially interested) pollers. */
-    for ( vcpuid = find_first_bit(d->poll_mask, d->max_vcpus);
-          vcpuid < d->max_vcpus;
-          vcpuid = find_next_bit(d->poll_mask, d->max_vcpus, vcpuid+1) )
+    bitmap_for_each ( vcpuid, d->poll_mask, d->max_vcpus )
     {
         v = d->vcpu[vcpuid];
         if ( ((v->poll_evtchn <= 0) || (v->poll_evtchn == port)) &&
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:57:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:57:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784070.1193456 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwhp-0004bs-F0; Tue, 27 Aug 2024 13:57:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784070.1193456; Tue, 27 Aug 2024 13:57:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwhp-0004bl-BL; Tue, 27 Aug 2024 13:57:57 +0000
Received: by outflank-mailman (input) for mailman id 784070;
 Tue, 27 Aug 2024 13:57: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=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1siwho-00047p-5u
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 13:57:56 +0000
Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com
 [2a00:1450:4864:20::52e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5c13d309-647c-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 15:57:55 +0200 (CEST)
Received: by mail-ed1-x52e.google.com with SMTP id
 4fb4d7f45d1cf-5bed83487aeso5778025a12.2
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 06:57:55 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e588adf2sm113898966b.173.2024.08.27.06.57.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 27 Aug 2024 06:57:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5c13d309-647c-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724767074; x=1725371874; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=GG6I/ExZxOSYobQF/vdPu38zR0FWgZTstjCiLrrIFG0=;
        b=MCmjjpNMXpD0a2g1Hc4BAkYGMNPAKitkxzoNKlaS4XtaHY8gjS6Xf/taKgENk2VN9Y
         V0hUknZLMt9TcBXfmP2eGSPGw1Mrrb/7+2/MCI8SUSESn5HrWpN8lQ6ALeydWIhiQyfC
         9d7QEyHofboSqHVDP51OhyAco38xAg0ux+trQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724767074; x=1725371874;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=GG6I/ExZxOSYobQF/vdPu38zR0FWgZTstjCiLrrIFG0=;
        b=fkuhc/SZOgd9C/o8XIvO1sUS7pyexqkTXVzVgs2wcs56bb5+cHt/TAcyXWsxmMdCjT
         lWy0lky6DI3KL8DhVRRMPABLnIalFY8nn4SwRorO2EN6RJhL6vl07oLeR7ac/lN9Yztq
         LCVSNeXXlxI0JqAzMTtGPjEJIleIoVUaceO25UrXQ2aotzQQ+JkqxUc45ynO8zt6FMMi
         aMTv465ptmrWsKwhTWXVTRqr1UKtMj2EjDOUFVwiAPI8FK58BPj1MFx+r3ENPnTByHth
         9tRwx/hdMeK0KLgpsYxsHKTPSCtV2kcPYqqqFpK0VKe6M0SZ7auQopueL4GqXIS7jSGJ
         vjcw==
X-Gm-Message-State: AOJu0YyyAURZ/sZkjTmRVAE2TpRGMOWUgLgV7efgwFD6LUxxygHWVdD6
	3nSNbpkG2DgLh2hNbgqEDIkLqmNE9AU+pDYud3w53KQRuHxGeg/8bQiLyNVsahN3RYWUBAYoD7B
	/
X-Google-Smtp-Source: AGHT+IGPFcMG0+WuSEvzaLfVo4yvDOnp6oCLBMJgVrqDnI5Yvr5lFEvM6AhodWIgFxEHdcFp/6Tj+A==
X-Received: by 2002:a17:907:7d94:b0:a86:b46b:860a with SMTP id a640c23a62f3a-a86e3be5cf1mr197371566b.54.1724767074158;
        Tue, 27 Aug 2024 06:57:54 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH 2/4] x86/hvm: Use for_each_set_bit() in hvm_emulate_writeback()
Date: Tue, 27 Aug 2024 14:57:44 +0100
Message-Id: <20240827135746.1908070-3-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

... which is more consise than the opencoded form.

Also, for production VMs, ~100% of emulations are simple MOVs, so it is likely
that there are no segments to write back.

Furthermore, now that find_{first,next}_bit() are no longer in use, the
seg_reg_{accessed,dirty} fields aren't forced to be unsigned long, although
they do need to remain unsigned int because of __set_bit() elsewhere.

No practical change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>

Pulling current out into curr is good for code generation.  When using current
in the loop, GCC can't retain the calculation across the call to
hvm_set_segment_register() and is forced to re-read from the cpu_info block.

However, if curr is initialised, it's calculated even in the likely path...
---
 xen/arch/x86/hvm/emulate.c             | 20 ++++++++++----------
 xen/arch/x86/include/asm/hvm/emulate.h |  4 ++--
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index feb4792cc567..732bdbab25b0 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -2908,18 +2908,18 @@ void hvm_emulate_init_per_insn(
 void hvm_emulate_writeback(
     struct hvm_emulate_ctxt *hvmemul_ctxt)
 {
-    enum x86_segment seg;
+    struct vcpu *curr;
+    unsigned int dirty = hvmemul_ctxt->seg_reg_dirty;
 
-    seg = find_first_bit(&hvmemul_ctxt->seg_reg_dirty,
-                         ARRAY_SIZE(hvmemul_ctxt->seg_reg));
+    if ( likely(!dirty) )
+        return;
 
-    while ( seg < ARRAY_SIZE(hvmemul_ctxt->seg_reg) )
-    {
-        hvm_set_segment_register(current, seg, &hvmemul_ctxt->seg_reg[seg]);
-        seg = find_next_bit(&hvmemul_ctxt->seg_reg_dirty,
-                            ARRAY_SIZE(hvmemul_ctxt->seg_reg),
-                            seg+1);
-    }
+    curr = current;
+
+    for_each_set_bit ( seg, dirty )
+        hvm_set_segment_register(curr, seg, &hvmemul_ctxt->seg_reg[seg]);
+
+    hvmemul_ctxt->seg_reg_dirty = 0;
 }
 
 /*
diff --git a/xen/arch/x86/include/asm/hvm/emulate.h b/xen/arch/x86/include/asm/hvm/emulate.h
index 29d679442e10..972cdf1fa0cf 100644
--- a/xen/arch/x86/include/asm/hvm/emulate.h
+++ b/xen/arch/x86/include/asm/hvm/emulate.h
@@ -36,8 +36,8 @@ struct hvm_emulate_ctxt {
     unsigned int insn_buf_bytes;
 
     struct segment_register seg_reg[10];
-    unsigned long seg_reg_accessed;
-    unsigned long seg_reg_dirty;
+    unsigned int seg_reg_accessed;
+    unsigned int seg_reg_dirty;
 
     /*
      * MFNs behind temporary mappings in the write callback.  The length is
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:57:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:57:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784071.1193466 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwhr-0004tc-ME; Tue, 27 Aug 2024 13:57:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784071.1193466; Tue, 27 Aug 2024 13:57:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwhr-0004tL-IY; Tue, 27 Aug 2024 13:57:59 +0000
Received: by outflank-mailman (input) for mailman id 784071;
 Tue, 27 Aug 2024 13:57: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=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1siwhq-00047p-4h
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 13:57:58 +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 5d3fa71f-647c-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 15:57:57 +0200 (CEST)
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-a868d7f92feso700694466b.2
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 06:57:57 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e588adf2sm113898966b.173.2024.08.27.06.57.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 27 Aug 2024 06:57:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5d3fa71f-647c-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724767076; x=1725371876; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=onbkRJjonSldeX+TKHvWoalIHglLaxnF1KDpl/v4wiA=;
        b=uT8enpQLoIrW8DSrhlqvctPlFAqWtGJTBIKzU71f/nDyntq2WNJZ7P/CP9qehyD9aV
         wbljrgpk+YhLg38EVpJrbG0n29+BYGMb4o8YEeNEt+ypHA80jhLu+j1gHNPwantqntOO
         BBrocgVovvIqUgzQ1m0f+QO02ztjRdxUH/HsM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724767076; x=1725371876;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=onbkRJjonSldeX+TKHvWoalIHglLaxnF1KDpl/v4wiA=;
        b=TvVdn/g1X/JlsZNnfuuwGzYJh7bBL9ImJsYQxaqAU5XwI9+gJLMl9uNe7d8GqIeTu2
         XYh1C0ru8iP+crKR1wshdIYmmGAq2qbbCj2EZwtrBdp/hve94NG7Btpnvq2bCJtIebLs
         PdsfDl7jqeMzjZF30khSzJqPHY4gAFWtTlVHnqrOiqRK/F3tNIRx4VEAPp2IhFOLZquJ
         1T2bDzrukgsVcJ7JuHEPVoOf1DhK2EIZlbqCJSbErBxPBkK+I7Za1sNlYbIpJmHRbbjP
         3O2yQhAQuqTwkoIlBCV0sycdgxuYiVT94UOLNdFN3JfkqrD+yh+PvIpLWrf/PL7v81C6
         G18Q==
X-Gm-Message-State: AOJu0YzFst2ANLV8wnjMGsnuEa+BL3L6IKsw69Erk4w7j6aL1IUeRGXQ
	LwywPqkW2vr6m7lQG6pooCvbznI7K0PVDhsMBtMTxDsb9+PKFGeQTIIwfi8h+No3EUN3PtWEz6/
	K
X-Google-Smtp-Source: AGHT+IH7hZ1uEw4kAXnd6m6eSnLzFwncr1ABIEpVvj5g0O6NferXHSInSooeNemWXtI/6AQO/5hpRg==
X-Received: by 2002:a17:907:6d0f:b0:a86:7e7f:69ab with SMTP id a640c23a62f3a-a86a52b367emr931155566b.15.1724767076098;
        Tue, 27 Aug 2024 06:57:56 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: [PATCH v2 4/4] x86/vmx: Rewrite vmx_sync_pir_to_irr() to be more efficient
Date: Tue, 27 Aug 2024 14:57:46 +0100
Message-Id: <20240827135746.1908070-5-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

There are two issues.  First, pi_test_and_clear_on() pulls the cache-line to
the CPU and dirties it even if there's nothing outstanding, but the final
for_each_set_bit() is O(256) when O(8) would do, and would avoid multiple
atomic updates to the same IRR word.

Rewrite it from scratch, explaining what's going on at each step.

Bloat-o-meter reports 177 -> 145 (net -32), but the better aspect is the
removal calls to __find_{first,next}_bit() hidden behind for_each_set_bit().

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>

The main purpose of this is to get rid of bitmap_for_each().

v2:
 * Extend the comments
---
 xen/arch/x86/hvm/vmx/vmx.c | 70 +++++++++++++++++++++++++++++++++-----
 1 file changed, 62 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 12f8a66458db..1baed7e816c4 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -2317,18 +2317,72 @@ static void cf_check vmx_deliver_posted_intr(struct vcpu *v, u8 vector)
 
 static void cf_check vmx_sync_pir_to_irr(struct vcpu *v)
 {
-    struct vlapic *vlapic = vcpu_vlapic(v);
-    unsigned int group, i;
-    DECLARE_BITMAP(pending_intr, X86_NR_VECTORS);
+    struct pi_desc *desc = &v->arch.hvm.vmx.pi_desc;
+    union {
+        uint64_t _64[X86_NR_VECTORS / (sizeof(uint64_t) * 8)];
+        uint32_t _32[X86_NR_VECTORS / (sizeof(uint32_t) * 8)];
+    } vec;
+    uint32_t *irr;
+    bool on;
 
-    if ( !pi_test_and_clear_on(&v->arch.hvm.vmx.pi_desc) )
+    /*
+     * The PIR is a contended cacheline which bounces between the CPU(s) and
+     * IOMMU(s).  An IOMMU updates the entire PIR atomically, but we can't
+     * express the same on the CPU side, so care has to be taken.
+     *
+     * First, do a plain read of ON.  If the PIR hasn't been modified, this
+     * will keep the cacheline Shared and not pull it Excusive on the current
+     * CPU.
+     */
+    if ( !pi_test_on(desc) )
         return;
 
-    for ( group = 0; group < ARRAY_SIZE(pending_intr); group++ )
-        pending_intr[group] = pi_get_pir(&v->arch.hvm.vmx.pi_desc, group);
+    /*
+     * Second, if the plain read said that ON was set, we must clear it with
+     * an atomic action.  This will bring the cachline to Exclusive on the
+     * current CPU.
+     *
+     * This should always succeed because noone else should be playing with
+     * the PIR behind our back, but assert so just in case.
+     */
+    on = pi_test_and_clear_on(desc);
+    ASSERT(on);
+
+    /*
+     * The cacheline is now Exclusive on the current CPU, and because ON was
+     * set, some other entity (an IOMMU, or Xen on another CPU) has indicated
+     * that at PIR needs re-scanning.
+     *
+     * Note: Entities which can't update the entire cacheline atomically
+     *       (i.e. Xen on another CPU) are required to update PIR first, then
+     *       set ON.  Therefore, there is a corner case where we may have
+     *       found and processed the PIR updates "last time around" and only
+     *       found ON this time around.  This is fine; the logic still
+     *       operates correctly.
+     *
+     * Atomically read and clear the entire pending bitmap as fast as we, to
+     * reduce the window where another entity may steal the cacheline back
+     * from us.  This is a performance concern, not a correctness concern.  If
+     * the another entity does steal the cacheline back, we'll just wait to
+     * get it back again.
+     */
+    for ( unsigned int i = 0; i < ARRAY_SIZE(vec._64); ++i )
+        vec._64[i] = xchg(&desc->pir[i], 0);
+
+    /*
+     * Finally, merge the pending vectors into IRR.  The IRR register is
+     * scattered in memory, so we have to do this 32 bits at a time.
+     */
+    irr = (uint32_t *)&vcpu_vlapic(v)->regs->data[APIC_IRR];
+    for ( unsigned int i = 0; i < ARRAY_SIZE(vec._32); ++i )
+    {
+        if ( !vec._32[i] )
+            continue;
 
-    bitmap_for_each ( i, pending_intr, X86_NR_VECTORS )
-        vlapic_set_vector(i, &vlapic->regs->data[APIC_IRR]);
+        asm ( "lock or %[val], %[irr]"
+              : [irr] "+m" (irr[i * 0x10])
+              : [val] "r" (vec._32[i]) );
+    }
 }
 
 static bool cf_check vmx_test_pir(const struct vcpu *v, uint8_t vec)
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 13:58:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 13:58:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784072.1193470 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwhs-0004xV-1m; Tue, 27 Aug 2024 13:58:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784072.1193470; Tue, 27 Aug 2024 13:57:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwhr-0004wO-RO; Tue, 27 Aug 2024 13:57:59 +0000
Received: by outflank-mailman (input) for mailman id 784072;
 Tue, 27 Aug 2024 13:57: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=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1siwhq-0003sI-6S
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 13:57:58 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5ca9fc5d-647c-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 15:57:56 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-a7aa086b077so493904266b.0
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 06:57:56 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e588adf2sm113898966b.173.2024.08.27.06.57.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 27 Aug 2024 06:57:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5ca9fc5d-647c-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724767076; x=1725371876; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=nGUfx2q1+jWgi8jP5MwYlvDEDt5Tq995qxqKh3B4e+k=;
        b=DHLiiCoBRMXFoVCaBxdOlLd8jCuJ7jxvy1jvJg81HN0sZuf1lwh7cRYKOm2Y2IfXAO
         dUtgyBfBI+GPZkmb6+NpJNk+pOa256bpX+2tAVipjjk2fFL+UCyRVh9tX2WS235UYPDm
         vUVD3Zbn4gT4YUA4EHC/yGqik3u4RFZPc1bSs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724767076; x=1725371876;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=nGUfx2q1+jWgi8jP5MwYlvDEDt5Tq995qxqKh3B4e+k=;
        b=ZBsXRgC7NTkQqkwIToFL/xtBLTfT6/33hwP7+7HzyxV0o5xHAWacl+kLStVHkizGDq
         M9JIiHy3lmLiBksNwYgsmnqDQy+jRWgT9NRHn84Qk9YYZZI7YJamEVmCMVWbN11+M/+o
         dwb0fRun+u0igKtay51RPCI6IdQLWo2QqxfkDTMovl2uY3EEExpWqTJ+HfaRD8AjHQbn
         kanAhLeKVBPwTy3lJmsrilb30ldbk+8zYHQVhpC6EedLtUGbdWvj0yIQyjkvjNE7Pic6
         PEmuUuDBXDw3DF1vmxeHCVvrGfzF4YQOiPD4I4v6rBAoZwRA7qAl/SJ0DQcSCtU8QtOz
         rGPw==
X-Gm-Message-State: AOJu0Yz6HxO13k8do/s9Jn1kOEIV1dHXr7LYeMYlCtcgPveJLglF5aRf
	tQXhYLO/QN05ayschIp6z8qQGEu7N2BAkkxHtY+OJvoT9vrVkPN68+niO9GN5kO/sydnm7qQQwn
	a
X-Google-Smtp-Source: AGHT+IF+lE+VmLKB8gnLP/DI0Jsj0j8worRIiuKlHU8MrF0gDq9Q5hJgWjAvzf9gxSKUf9uxlYP8Dw==
X-Received: by 2002:a17:907:7e9a:b0:a86:a4b1:d2c0 with SMTP id a640c23a62f3a-a86a54b8ce4mr1167977166b.53.1724767075121;
        Tue, 27 Aug 2024 06:57:55 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH 3/4] x86/hvm: Rework hpet_write() for improved code generation
Date: Tue, 27 Aug 2024 14:57:45 +0100
Message-Id: <20240827135746.1908070-4-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In the HPET_STATUS handling, the use of __clear_bit(i, &new_val) is the only
thing causing it to be spilled to the stack.  Furthemore we only care about
the bottom 3 bits, so rewrite it to be a plain for loop.

For the {start,stop}_timer variables, these are spilled to the stack despite
the __{set,clear}_bit() calls.  Again we only care about the bottom 3 bits, so
shrink the variables from long to int.  Use for_each_set_bit() rather than
opencoding it at the end which amongst other things means the loop predicate
is no longer forced to the stack by the loop body.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>

All in all, it's modest according to bloat-o-meter:

  add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-29 (-29)
  Function                                     old     new   delta
  hpet_write                                  2225    2196     -29

but we have shrunk the stack frame by 8 bytes; 0x28 as opposed to 0x30 before.
---
 xen/arch/x86/hvm/hpet.c | 29 ++++++++---------------------
 1 file changed, 8 insertions(+), 21 deletions(-)

diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c
index 87642575f9cd..e3981d5e467c 100644
--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -349,8 +349,7 @@ static int cf_check hpet_write(
     unsigned int tn, i;
 
     /* Acculumate a bit mask of timers whos state is changed by this write. */
-    unsigned long start_timers = 0;
-    unsigned long stop_timers  = 0;
+    unsigned int start_timers = 0, stop_timers = 0;
 #define set_stop_timer(n)    (__set_bit((n), &stop_timers))
 #define set_start_timer(n)   (__set_bit((n), &start_timers))
 #define set_restart_timer(n) (set_stop_timer(n),set_start_timer(n))
@@ -405,16 +404,12 @@ static int cf_check hpet_write(
 
     case HPET_STATUS:
         /* write 1 to clear. */
-        while ( new_val )
+        for ( i = 0; i < HPET_TIMER_NUM; i++ )
         {
-            bool active;
-
-            i = ffsl(new_val) - 1;
-            if ( i >= HPET_TIMER_NUM )
-                break;
-            __clear_bit(i, &new_val);
-            active = __test_and_clear_bit(i, &h->hpet.isr);
-            if ( active )
+            if ( !(new_val & (1U << i)) )
+                continue;
+
+            if ( __test_and_clear_bit(i, &h->hpet.isr) )
             {
                 hvm_ioapic_deassert(v->domain, timer_int_route(h, i));
                 if ( hpet_enabled(h) && timer_enabled(h, i) &&
@@ -533,19 +528,11 @@ static int cf_check hpet_write(
     }
 
     /* stop/start timers whos state was changed by this write. */
-    while (stop_timers)
-    {
-        i = ffsl(stop_timers) - 1;
-        __clear_bit(i, &stop_timers);
+    for_each_set_bit ( i, stop_timers )
         hpet_stop_timer(h, i, guest_time);
-    }
 
-    while (start_timers)
-    {
-        i = ffsl(start_timers) - 1;
-        __clear_bit(i, &start_timers);
+    for_each_set_bit ( i, start_timers )
         hpet_set_timer(h, i, guest_time);
-    }
 
 #undef set_stop_timer
 #undef set_start_timer
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 14:13:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 14:13:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784103.1193486 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwwh-0001oE-7o; Tue, 27 Aug 2024 14:13:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784103.1193486; Tue, 27 Aug 2024 14:13:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwwh-0001o7-52; Tue, 27 Aug 2024 14:13:19 +0000
Received: by outflank-mailman (input) for mailman id 784103;
 Tue, 27 Aug 2024 14:13:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1siwwg-0001o1-8T
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 14:13:18 +0000
Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com
 [2a00:1450:4864:20::434])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 814afaff-647e-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 16:13:17 +0200 (CEST)
Received: by mail-wr1-x434.google.com with SMTP id
 ffacd0b85a97d-371941bbfb0so3184730f8f.0
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 07:13:17 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e549d00bsm115255766b.66.2024.08.27.07.13.15
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 07:13:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 814afaff-647e-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724767996; x=1725372796; 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=zoKKxatk2D8XhqZNLis0wZh9HNL7/3YqqSoy0J87A44=;
        b=rfjZzl+SzCxHll/O8A5TtDV9xrlZyNq6DxcVp9wG1GerywoHU64QxGFMNW0wnexau7
         dV5DkI9/w+ptNJSoXK3YRYocHJvDQTgqZ08fUCYFagM00dDQRrX7l9ZGxHEbUN0o68RQ
         PAPVxbGM98lutUBhuSA915fnq+L8UIRDScnl0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724767996; x=1725372796;
        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=zoKKxatk2D8XhqZNLis0wZh9HNL7/3YqqSoy0J87A44=;
        b=ivpjzf8Meo6Egc4+E8jFXStdfVBNYuFVlILHIBSqYLvUlbippjSxaBC5kaDKnOjpuk
         6NxT1HzLYUAdPfOohjRBAVHGHEOeiymXpFNeRhkEjo+GGrZMfJAY6aUpXtGTRIj/+ewV
         eSg35aSAzTUsKGfNB/08t9o1MNHXFXXyoGHYSILyvKJG6soKkoHRu3n0vGw1noY13lJw
         gBZR0qS7yA7Z1Ru1oU0PYDR59vXz1M5aQ6qwBJC8xOPEz8Ri4Z3hFEbYdeUbefAPD5Xy
         Ay4bYsGqJcFx7rCVJQ3AaRfw/IxVq07CKy1sSw45LZYMTMajwoKmwVb10IwxxQ1VDb/M
         /5zg==
X-Forwarded-Encrypted: i=1; AJvYcCWlutgAm6Y4StaVXLc++I++IM/1T8lrB+eHiGpapEuCbjtZiR+Wkhv2dfSR50dyehGFKd1kggVtZ/U=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw27eE320qme/+PCCHu4tJJ5QEnVC+TOL0cAG4bazOK2ALJrWXr
	Oym8V4dFj4AUK+T4rkQ4DtJ7ea9uClu5Jp8kPy/nLlC6QD3AUIu59UPBI+LGTTg=
X-Google-Smtp-Source: AGHT+IHPJuRnRxcDjVffs9JQ7nZB8s7BvAOVkrJwI4LyYJaN8QaZooTCs2ao2oqrTEBgn0areUlbIw==
X-Received: by 2002:adf:e261:0:b0:371:83a8:afee with SMTP id ffacd0b85a97d-3748c7d4d36mr1805558f8f.27.1724767996058;
        Tue, 27 Aug 2024 07:13:16 -0700 (PDT)
Message-ID: <56ebf62b-ad9e-4f2a-8340-ad5621343a63@citrix.com>
Date: Tue, 27 Aug 2024 15:13:13 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/9] xen/bitops: Introduce a multiple_bits_set() helper
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-3-andrew.cooper3@citrix.com>
 <841e2cde-6fc2-49d9-b947-534bd53bc00e@suse.com>
 <239165e3-6f96-452f-9c81-05f29012269f@citrix.com>
 <5521cd0f-6baf-4929-a2bd-9ebe67c99268@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <5521cd0f-6baf-4929-a2bd-9ebe67c99268@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27/08/2024 1:50 pm, Jan Beulich wrote:
> On 27.08.2024 14:01, Andrew Cooper wrote:
>> On 26/08/2024 11:30 am, Jan Beulich wrote:
>>> On 23.08.2024 01:06, Andrew Cooper wrote:
>>>> --- a/xen/common/bitops.c
>>>> +++ b/xen/common/bitops.c
>>>> @@ -84,8 +84,32 @@ static void __init test_fls(void)
>>>>      CHECK(fls64, 0x8000000000000001ULL, 64);
>>>>  }
>>>>  
>>>> +static void __init test_multiple_bits_set(void)
>>>> +{
>>>> +    /*
>>>> +     * multiple_bits_set() is generic on the type of it's parameter, as the
>>>> +     * internal expression is so simple.
>>>> +     */
>>>> +
>>>> +    CHECK(multiple_bits_set, 0, false);
>>>> +    CHECK(multiple_bits_set, 1, false);
>>>> +    CHECK(multiple_bits_set, 2, false);
>>>> +    CHECK(multiple_bits_set, 3, true);
>>>> +
>>>> +    CHECK(multiple_bits_set, 1 | (1UL << (BITS_PER_LONG - 1)), true);
>>> This is really the same as ...
>>>
>>>> +#if BITS_PER_LONG > 32
>>>> +    CHECK(multiple_bits_set, 1 | (1UL << 32), true);
>>>> +    CHECK(multiple_bits_set, 1 | (1UL << 63), true);
>>> ... this, at least as long as BITS_PER_LONG > 32 in practice means
>>> BITS_PER_LONG == 64. Perhaps not really worth keeping that line?
>> I suppose not.  I'll drop it.
>>
>> However, It occurs to me that I do need a test of 0x8000000000000001ULL
>> mostly for 32bit builds to check that even when the argument is split,
>> the answer is still accurate.
> IOW you'll insert an #else in the middle. Fine with me; keep the R-b.

Oh, I already had that case, out of context below what you quoted.  I'll
just drop the one intermediate test.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 14:14:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 14:14:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784109.1193496 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwxs-0002On-Jm; Tue, 27 Aug 2024 14:14:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784109.1193496; Tue, 27 Aug 2024 14:14:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siwxs-0002Og-Gg; Tue, 27 Aug 2024 14:14:32 +0000
Received: by outflank-mailman (input) for mailman id 784109;
 Tue, 27 Aug 2024 14:14:31 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=sTyg=P2=kernel.org=kuba@srs-se1.protection.inumbo.net>)
 id 1siwxr-0002OV-4L
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 14:14:31 +0000
Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ac83a40e-647e-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 16:14:30 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by nyc.source.kernel.org (Postfix) with ESMTP id 0148DA41A34;
 Tue, 27 Aug 2024 14:14:22 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3452FC581AA;
 Tue, 27 Aug 2024 14:14:28 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ac83a40e-647e-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724768068;
	bh=MJFXP/k9RQK0ByF56VDngc+Nl9urhri3xUs+JNYlmhg=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
	b=P1rv4OLKi6geNW+qmLq+G/zau60NRnAQ8jlm4wMN1kQUU2ml20OJldWMFsgSWrc96
	 IYdXuovm7OoldXaJHbgZEEvsPNZIzvOSDaLhMzn00P+cTuZW7ZvAZeMRHwHbfHN1Sx
	 l0/GYopSKK/pPYOQDCnS/WgGemlfo5O1imN7D9Jdvbhze667OiZ13/DStg7cihbWi0
	 e4nG9IweKQct05F0QVR96vl7xrOPrfXJA0dfZi89PLEzdEXikqOudd6itVMEiH/JQS
	 TXBtn+4U1JrsKNgO7uwpByvLptlo3WcZdR2BpACqfHuke59Q82PokuVWQkZZYEmO9D
	 VcHohoA2LJegw==
Date: Tue, 27 Aug 2024 07:14:27 -0700
From: Jakub Kicinski <kuba@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Jeongjun Park <aha310510@gmail.com>, wei.liu@kernel.org, paul@xen.org,
 davem@davemloft.net, edumazet@google.com, madhuparnabhowmik04@gmail.com,
 xen-devel@lists.xenproject.org, netdev@vger.kernel.org,
 linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net/xen-netback: prevent UAF in xenvif_flush_hash()
Message-ID: <20240827071427.4c45fdb8@kernel.org>
In-Reply-To: <fd2a06d5-370f-4e07-af84-cab089b82a4b@redhat.com>
References: <20240822181109.2577354-1-aha310510@gmail.com>
	<fd2a06d5-370f-4e07-af84-cab089b82a4b@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Tue, 27 Aug 2024 13:19:59 +0200 Paolo Abeni wrote:
> On 8/22/24 20:11, Jeongjun Park wrote:
> > During the list_for_each_entry_rcu iteration call of xenvif_flush_hash,
> > kfree_rcu does not exist inside the rcu read critical section, so if  
> 
> The above wording is confusing, do you mean "kfree_rcu does not exit 
> from "...?

I think they mean that kfree_rcu() is called without holding RCU read
lock..

> > kfree_rcu is called when the rcu grace period ends during the iteration,
> > UAF occurs when accessing head->next after the entry becomes free.  

.. so it can run immediately. Therefore the loop fetching head->next
may cause a UAF.

> The loop runs with irq disabled, the RCU critical section extends over 
> it, uninterrupted.

Is this an official RCU rule? I remember Paul told us it's the case for
softirq, but IDK if it is also for local IRQ disable.

> Do you have a splat for the reported UAF?
> 
> This does not look the correct solution.

The problem may not exist, but FWIW the change makes sense to me :)
We hold the write lock, and modify the list. for_each_entry_safe()
seems like a better fit than for_each_entry_rcu()


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 14:19:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 14:19:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784115.1193506 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1six34-00048g-5b; Tue, 27 Aug 2024 14:19:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784115.1193506; Tue, 27 Aug 2024 14:19:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1six34-00048Z-2L; Tue, 27 Aug 2024 14:19:54 +0000
Received: by outflank-mailman (input) for mailman id 784115;
 Tue, 27 Aug 2024 14:19:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1six32-00048T-L1
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 14:19:52 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6c40561d-647f-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 16:19:51 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a83562f9be9so504350466b.0
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 07:19:51 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e5879183sm115146866b.182.2024.08.27.07.19.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 07:19:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6c40561d-647f-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724768391; x=1725373191; 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=DYOT7dZMikS+sZ4B5vTDVx29jinCuR0z/kKGorKdXPI=;
        b=QhLr1sCxkC4F0ErsFR5LmB1FTSig3xVDuyai4J1KPfkjdW1p6vkLPXUCcWdKN+iUC9
         Ljjt9lXNE/CKOWDF+cUijFgPZ7DaEV2PPu690zFa3WtLfl1xsBFExFAbx6drQ9lrLWDM
         yJikakOfCPVudVc9w64MvhheXKlrsxr+cbBcdY9nK1plS6On063fl/CtrVBBzd1p8WWy
         eIg7gpqhL53hM3ouYGAJ/myJeZmuaZG+hH2cskaueOuuaxWKWDpKaTNqZReu8IWlreFz
         f7pmXfQKRXoF5cmMINvXgHP7pDY1Bpg0A8rLqc+22mvX04y2csh0h58hDAYNwTFL2faD
         61lA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724768391; x=1725373191;
        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=DYOT7dZMikS+sZ4B5vTDVx29jinCuR0z/kKGorKdXPI=;
        b=pXL9V4GIivpIFkFCU6H5w7NI9oY15lTJCijb8DErRx9CN//w0H13DZqgoStOzjQLw3
         QGyPyTFoZDvyd67Y3b54mdZOi0goscUbR/zQvE5H0bJqupvvRY57099/m81KRiHoVtLv
         g511MpsUGYlW4IA5nu5RiP8Elm/hUkCy52zCKK/DBN9J3qE0QYoBNhjrgoA7YncKsDuL
         Err+th4QF52R6lvcHHLX+Ijq0iPX/7DKxdGbZDvvZDDWIyELlkRGaSt8iqtj1XW6TJWH
         fMVeUCk2tpSo0sPWltEs9khFZQwk6kRMenKeh7iqm/kS7asIqgQIWijbWmNSnP/cq54r
         Am8g==
X-Forwarded-Encrypted: i=1; AJvYcCWZlxGpCEe9HLnDmpKT8SlchPRRsqhOZwCNYXYwIMcKAuleG4asvwa0OQKvxNs/6tAjVHPDqnYjdeQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxGBbsoZFZ4jrVOrUjdfOLhi2FpH1BqJlUUGC3Xv6i/W1IE5n7/
	e+DmFC7fzXhR/lPdWKlzKk04AkNY23JqiDUjkWpPq1qV4utX+v72Ko36Zf9Qqg==
X-Google-Smtp-Source: AGHT+IEfM0ZDASYMTLjuNs6/Bk5x8+TfsQclA8OxnYtkVj1tnFTwQn4dRYrHN5ou4pkXQxxUK2K15Q==
X-Received: by 2002:a17:907:3da0:b0:a86:817e:d27b with SMTP id a640c23a62f3a-a86a54b05f3mr976162466b.43.1724768390491;
        Tue, 27 Aug 2024 07:19:50 -0700 (PDT)
Message-ID: <10789eb4-ed96-48ab-860b-ec6f2d0e6341@suse.com>
Date: Tue, 27 Aug 2024 16:19:49 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 5/7] xen/riscv: introduce and initialize SBI RFENCE
 extension
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
 <69da9fc18b9987285e4037ef08714e8f9faa66a7.1724256027.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <69da9fc18b9987285e4037ef08714e8f9faa66a7.1724256027.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 21.08.2024 18:06, Oleksii Kurochko wrote:
> --- a/xen/arch/riscv/include/asm/sbi.h
> +++ b/xen/arch/riscv/include/asm/sbi.h
> @@ -12,8 +12,41 @@
>  #ifndef __ASM_RISCV_SBI_H__
>  #define __ASM_RISCV_SBI_H__
>  
> +#include <xen/cpumask.h>
> +
>  #define SBI_EXT_0_1_CONSOLE_PUTCHAR		0x1
>  
> +#define SBI_EXT_BASE                    0x10
> +#define SBI_EXT_RFENCE                  0x52464E43
> +
> +/* SBI function IDs for BASE extension */
> +#define SBI_EXT_BASE_GET_SPEC_VERSION   0x0
> +#define SBI_EXT_BASE_GET_IMP_ID         0x1
> +#define SBI_EXT_BASE_GET_IMP_VERSION    0x2
> +#define SBI_EXT_BASE_PROBE_EXT          0x3
> +
> +/* SBI function IDs for RFENCE extension */
> +#define SBI_EXT_RFENCE_REMOTE_FENCE_I           0x0
> +#define SBI_EXT_RFENCE_REMOTE_SFENCE_VMA        0x1
> +#define SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID   0x2
> +#define SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA       0x3
> +#define SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID  0x4
> +#define SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA       0x5
> +#define SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID  0x6
> +
> +#define SBI_SPEC_VERSION_MAJOR_MASK     0x7F000000
> +#define SBI_SPEC_VERSION_MINOR_MASK     0xffffff

Nit: Perhaps neater / more clear as

#define SBI_SPEC_VERSION_MAJOR_MASK     0x7f000000
#define SBI_SPEC_VERSION_MINOR_MASK     0x00ffffff

> @@ -31,4 +64,34 @@ struct sbiret sbi_ecall(unsigned long ext, unsigned long fid,
>   */
>  void sbi_console_putchar(int ch);
>  
> +/*
> + * Check underlying SBI implementation has RFENCE
> + *
> + * @return true for supported AND false for not-supported
> + */
> +bool sbi_has_rfence(void);
> +
> +/*
> + * Instructs the remote harts to execute one or more SFENCE.VMA
> + * instructions, covering the range of virtual addresses between
> + * [start_addr, start_addr + size).
> + *
> + * Returns 0 if IPI was sent to all the targeted harts successfully
> + * or negative value if start_addr or size is not valid.
> + *
> + * @hart_mask a cpu mask containing all the target harts.
> + * @param start virtual address start
> + * @param size virtual address range size
> + */
> +int sbi_remote_sfence_vma(const cpumask_t *cpu_mask,
> +                          unsigned long start_addr,
> +                          unsigned long size);

I may have asked before: Why not vaddr_t and size_t respectively?

> @@ -38,7 +51,265 @@ struct sbiret sbi_ecall(unsigned long ext, unsigned long fid,
>      return ret;
>  }
>  
> +static int sbi_err_map_xen_errno(int err)
> +{
> +    switch ( err )
> +    {
> +    case SBI_SUCCESS:
> +        return 0;
> +    case SBI_ERR_DENIED:
> +        return -EACCES;
> +    case SBI_ERR_INVALID_PARAM:
> +        return -EINVAL;
> +    case SBI_ERR_INVALID_ADDRESS:
> +        return -EFAULT;
> +    case SBI_ERR_NOT_SUPPORTED:
> +        return -EOPNOTSUPP;
> +    case SBI_ERR_FAILURE:
> +        fallthrough;
> +    default:

What's the significance of the "fallthrough" here?

> +static unsigned long sbi_major_version(void)
> +{
> +    return MASK_EXTR(sbi_spec_version, SBI_SPEC_VERSION_MAJOR_MASK);
> +}
> +
> +static unsigned long sbi_minor_version(void)
> +{
> +    return MASK_EXTR(sbi_spec_version, SBI_SPEC_VERSION_MINOR_MASK);
> +}

Both functions return less than 32-bit wide values. Why unsigned long
return types?

> +static long sbi_ext_base_func(long fid)
> +{
> +    struct sbiret ret;
> +
> +    ret = sbi_ecall(SBI_EXT_BASE, fid, 0, 0, 0, 0, 0, 0);
> +
> +    /*
> +     * I wasn't able to find a case in the SBI spec where sbiret.value
> +     * could be negative.
> +     *
> +     * Unfortunately, the spec does not specify the possible values of
> +     * sbiret.value, but based on the description of the SBI function,
> +     * ret.value >= 0 when sbiret.error = 0. SPI spec specify only
> +     * possible value for sbiret.error (<= 0 whwere 0 is SBI_SUCCESS ).
> +     *
> +     * Just to be sure that SBI base extension functions one day won't
> +     * start to return a negative value for sbiret.value when
> +     * sbiret.error < 0 BUG_ON() is added.
> +     */
> +    BUG_ON(ret.value < 0);

I'd be careful here and move this ...

> +    if ( !ret.error )
> +        return ret.value;

... into the if() body here, just to avoid the BUG_ON() pointlessly
triggering ...

> +    else
> +        return ret.error;

... when an error is returned anyway. After all, if an error is returned,
ret.value presumably is (deemed) undefined.

> +static int sbi_rfence_v02_real(unsigned long fid,
> +                               unsigned long hmask, unsigned long hbase,
> +                               unsigned long start, unsigned long size,

Again vaddr_t / size_t perhaps? And then again elsewhere as well.

> +                               unsigned long arg4)
> +{
> +    struct sbiret ret = {0};
> +    int result = 0;
> +
> +    switch ( fid )
> +    {
> +    case SBI_EXT_RFENCE_REMOTE_FENCE_I:
> +        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
> +                        0, 0, 0, 0);
> +        break;
> +
> +    case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA:
> +    case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA:
> +    case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA:
> +        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
> +                        start, size, 0, 0);
> +        break;
> +
> +    case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID:
> +    case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID:
> +    case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID:
> +        ret = sbi_ecall(SBI_EXT_RFENCE, fid, hmask, hbase,
> +                        start, size, arg4, 0);
> +        break;
> +
> +    default:
> +        printk("%s: unknown function ID [%lu]\n",

I wonder how useful the logging in decimal of (perhaps large) unknown
values is.

> +               __func__, fid);
> +        result = -EINVAL;
> +        break;
> +    };
> +
> +    if ( ret.error )
> +    {
> +        result = sbi_err_map_xen_errno(ret.error);
> +        printk("%s: hbase=%lu hmask=%#lx failed (error %d)\n",
> +               __func__, hbase, hmask, result);

Considering that sbi_err_map_xen_errno() may lose information, I'd
recommend logging ret.error here.

> +static int cf_check sbi_rfence_v02(unsigned long fid,
> +                                   const cpumask_t *cpu_mask,
> +                                   unsigned long start, unsigned long size,
> +                                   unsigned long arg4, unsigned long arg5)
> +{
> +    unsigned long hartid, cpuid, hmask = 0, hbase = 0, htop = 0;
> +    int result;
> +
> +    /*
> +     * hart_mask_base can be set to -1 to indicate that hart_mask can be
> +     * ignored and all available harts must be considered.
> +     */
> +    if ( !cpu_mask )
> +        return sbi_rfence_v02_real(fid, 0UL, -1UL, start, size, arg4);
> +
> +    for_each_cpu ( cpuid, cpu_mask )
> +    {
> +        /*
> +        * Hart IDs might not necessarily be numbered contiguously in
> +        * a multiprocessor system, but at least one hart must have a
> +        * hart ID of zero.

Does this latter fact matter here in any way?

> +        * This means that it is possible for the hart ID mapping to look like:
> +        *  0, 1, 3, 65, 66, 69
> +        * In such cases, more than one call to sbi_rfence_v02_real() will be
> +        * needed, as a single hmask can only cover sizeof(unsigned long) CPUs:
> +        *  1. sbi_rfence_v02_real(hmask=0b1011, hbase=0)
> +        *  2. sbi_rfence_v02_real(hmask=0b1011, hbase=65)
> +        *
> +        * The algorithm below tries to batch as many harts as possible before
> +        * making an SBI call. However, batching may not always be possible.
> +        * For example, consider the hart ID mapping:
> +        *   0, 64, 1, 65, 2, 66

Just to mention it: Batching is also possible here: First (0,1,2), then
(64,65,66). It just requires a different approach. Whether switching is
worthwhile depends on how numbering is done on real world systems.

> +        */
> +        hartid = cpuid_to_hartid(cpuid);
> +        if ( hmask )
> +        {
> +            if ( hartid + BITS_PER_LONG <= htop ||
> +                 hbase + BITS_PER_LONG <= hartid )
> +            {
> +                result = sbi_rfence_v02_real(fid, hmask, hbase,
> +                                             start, size, arg4);
> +                if ( result )
> +                    return result;
> +                hmask = 0;
> +            }
> +            else if ( hartid < hbase )
> +            {
> +                /* shift the mask to fit lower hartid */
> +                hmask <<= hbase - hartid;
> +                hbase = hartid;
> +            }
> +        }
> +
> +        if ( !hmask )
> +        {
> +            hbase = hartid;
> +            htop = hartid;
> +        }
> +        else if ( hartid > htop )
> +            htop = hartid;
> +
> +        hmask |= BIT(hartid - hbase, UL);
> +    }
> +
> +    if ( hmask )
> +    {
> +        result = sbi_rfence_v02_real(fid, hmask, hbase,
> +                                     start, size, arg4);
> +        if ( result )
> +            return result;

It's a little odd to have this here, rather than ...

> +    }
> +
> +    return 0;
> +}

... making these two a uniform return path. If you wanted you
could even replace the return in the loop with a simple break,
merely requiring the clearing of hmask to come first.

> +static int (* __ro_after_init sbi_rfence)(unsigned long fid,
> +                                          const cpumask_t *cpu_mask,
> +                                          unsigned long start,
> +                                          unsigned long size,
> +                                          unsigned long arg4,
> +                                          unsigned long arg5);
> +
> +int sbi_remote_sfence_vma(const cpumask_t *cpu_mask,
> +                          unsigned long start_addr,

To match other functions, perhaps just "start"?

> +int sbi_probe_extension(long extid)
> +{
> +    struct sbiret ret;
> +
> +    ret = sbi_ecall(SBI_EXT_BASE, SBI_EXT_BASE_PROBE_EXT, extid,
> +                    0, 0, 0, 0, 0);
> +    if ( !ret.error && ret.value )
> +        return ret.value;
> +
> +    return -EOPNOTSUPP;

Any reason not to use sbi_err_map_xen_errno() here?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 14:33:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 14:33:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784122.1193515 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sixFV-0007nu-6e; Tue, 27 Aug 2024 14:32:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784122.1193515; Tue, 27 Aug 2024 14:32:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sixFV-0007nn-3b; Tue, 27 Aug 2024 14:32:45 +0000
Received: by outflank-mailman (input) for mailman id 784122;
 Tue, 27 Aug 2024 14:32:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sixFT-0007nh-Ba
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 14:32:43 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 372ca944-6481-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 16:32:41 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a86859e2fc0so692647366b.3
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 07:32:41 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e594e815sm116071666b.197.2024.08.27.07.32.39
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 07:32:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 372ca944-6481-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724769161; x=1725373961; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=bX3yhpUS8Udc/Fy86+W8abe82JJZNRwGknibPZYS9ZM=;
        b=LvhbalI8/mute3KW2RfZispzJxNrRgJiRJ3JYKKXdoMI2M+Yi6BRD/4MJpyGdANUfc
         9I3wHfYN4Io8jAQbOLZoNYa+YC6dvaDc1rGpIfpD6LIcHR/sLYrifMD1vy6D20VQ8T2d
         pE/3KLIPMInHVjrsRTRV/CkHUvZQmGCsV5O/Q=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724769161; x=1725373961;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=bX3yhpUS8Udc/Fy86+W8abe82JJZNRwGknibPZYS9ZM=;
        b=oE5CSdmzm96RvT4P7p0VY/cF0PYLX7Ys/i/ivIF5IaL8HdL02UPMsee/DCWzt9RxK2
         /EqtkUA5g1p2yFdbDYdhzxrx5Dk/3dZT8YMivboZhkAMWbaSAQBB4gDRM84/Y29WmPtR
         iew/eyLcGj70Sb0jVZ8+UWKD2wUlaakBgf07i2mogand8/Hja6TE6JlGfVi5VzkLDqy9
         ZaH7oQWpxefy3jvh66JkVHHjdBhtEJ+AbQm2G00nLVUlG+3fdLPyBGmeNlTlPBH0d6M5
         0ys0kqfmm2sRwnu98Pok+kWobplJeH2v75vuDZWkijlfrDJ54Tc0AH9lfz5iMkFhrZqT
         XGMw==
X-Forwarded-Encrypted: i=1; AJvYcCXYHReyfMlHtgt5c47KKsoDAKN9J/x9zwuqTQB6P3xWv1xhIGo2jreIO8AGYQAcuCaA6KaZMVmeyDg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzcMjKKQr46lXvTTvnmktEnbtlPj3jZxNE1nNUOm7Q6R+Pn10Qf
	HDuGxVGyHNODfTlK683iE1ugm/ajPA5FEwJwG18axsinpNBDi+Jhtcirmr3b7Lk=
X-Google-Smtp-Source: AGHT+IFzjnQ51A8bA7YNUS0a9rbS5W7qBsYr2TXf3NM7pT6g7gpdVYlQoaMygPBlDN/RJSTobPo6MA==
X-Received: by 2002:a17:906:6a23:b0:a7a:8e98:890d with SMTP id a640c23a62f3a-a86e39c9e11mr261384566b.16.1724769160253;
        Tue, 27 Aug 2024 07:32:40 -0700 (PDT)
Message-ID: <d63df810-3f95-4c99-90fd-e509c26fc4fe@citrix.com>
Date: Tue, 27 Aug 2024 15:32:38 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 7/9] xen/bitops: Implement hweight64() in terms of
 hweightl()
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-8-andrew.cooper3@citrix.com>
 <11da1350-095f-49c8-bdf0-f5c83e9f0d39@suse.com>
 <70047ef7-ca22-4eeb-9510-09ccdf0871c0@citrix.com>
 <73309650-3912-418b-b2e6-a60676519911@suse.com>
 <c54f7015-abe1-4834-83e3-29a2cc854d85@citrix.com>
Content-Language: en-GB
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <c54f7015-abe1-4834-83e3-29a2cc854d85@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 27/08/2024 2:25 pm, Andrew Cooper wrote:
> On 27/08/2024 2:00 pm, Jan Beulich wrote:
>> On 27.08.2024 13:50, Andrew Cooper wrote:
>>> On 26/08/2024 12:55 pm, Jan Beulich wrote:
>>>> On 23.08.2024 01:06, Andrew Cooper wrote:
>>> Again, this is modelled after f[fl]s64() which have the same
>>> expectations about the BITS_PER_LONG != 64 case.
>> Both of them are fine afaict. fls64() has an explicit intermediate
>> variable of type uint32_t, and ffs64() has a (uint32_t)x as part
>> of the conditional expression achieving the intended effect.
>>
>> Anyway, why not use hweight32() instead of hweightl() here? That'll
>> make things very explicit.
> hweight32() doesn't exist until the next patch in the series.
>
> Although looking at the end result, I can't figure out why I thought it
> was necessary to transform hweight64 first.
>
> I'll swap this patch and the next one, and then use hweight32().

I've found out why.

The hweight32() patch is the one that deletes generic_hweight32(), but
generic_hweight64() uses it.

I can work around this, but it means keeping generic_hweight32() around
and deleting it in the hweight64() patch.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 14:51:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 14:51:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784132.1193525 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sixXy-0003yI-L8; Tue, 27 Aug 2024 14:51:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784132.1193525; Tue, 27 Aug 2024 14:51:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sixXy-0003yB-If; Tue, 27 Aug 2024 14:51:50 +0000
Received: by outflank-mailman (input) for mailman id 784132;
 Tue, 27 Aug 2024 14:51:49 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sixXx-0003xz-4o; Tue, 27 Aug 2024 14:51:49 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sixXw-0000B4-WB; Tue, 27 Aug 2024 14:51:49 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sixXw-0002s0-L0; Tue, 27 Aug 2024 14:51:48 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sixXw-0000wl-KV; Tue, 27 Aug 2024 14:51:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=gsgKy7MCu9W/EqYKdbaiAlAZmvV6yqADW8Z9w1/T1n8=; b=30VcbefmeVD3LSfcEhdpdEjIpq
	ubMPNjP1t45tlCPk1Fcc6/TUYDbCE3x50DoyBrUsPfkrGyERUsre8Ie3jCvZvIU2GjntNMK1cIN/c
	nrvZCjsFnpHaVzO24BMtJXGil9LDjYF9ZQoQHyzqpKNYVfJZUSDsklsBVN+B/spHVQ34=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187363-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187363: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=efaf8931bbfa33a81b8792fbf9e2ccc239d53204
X-Osstest-Versions-That:
    ovmf=ccda91c28628aa70bca614f1f7b71ad7b5ca61e0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 27 Aug 2024 14:51:48 +0000

flight 187363 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187363/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 efaf8931bbfa33a81b8792fbf9e2ccc239d53204
baseline version:
 ovmf                 ccda91c28628aa70bca614f1f7b71ad7b5ca61e0

Last test of basis   187362  2024-08-27 09:15:18 Z    0 days
Testing same since   187363  2024-08-27 13:15:02 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Min M Xu <min.m.xu@intel.com>
  Min Xu <min.m.xu@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   ccda91c286..efaf8931bb  efaf8931bbfa33a81b8792fbf9e2ccc239d53204 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 14:56:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 14:56:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784145.1193536 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sixcY-00054f-BO; Tue, 27 Aug 2024 14:56:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784145.1193536; Tue, 27 Aug 2024 14:56:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sixcY-00054Y-83; Tue, 27 Aug 2024 14:56:34 +0000
Received: by outflank-mailman (input) for mailman id 784145;
 Tue, 27 Aug 2024 14:56:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YF2W=P2=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sixcX-00054S-OW
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 14:56:33 +0000
Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com
 [2607:f8b0:4864:20::233])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8beb2d15-6484-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 16:56:32 +0200 (CEST)
Received: by mail-oi1-x233.google.com with SMTP id
 5614622812f47-3db18c4927bso481546b6e.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 07:56:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8beb2d15-6484-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724770591; x=1725375391; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=3zfXWuWnfI6HwOBNf9fB4tWQH8n4IDdRYeIo3+qXDJ4=;
        b=icrkqucnVTczXypH4Ax7t+zH3GCBElZNmyrdMJMg+duMserA98Jt6YZDJX2m2rhquO
         EQ2HPXJlRi2D9QWtznSnIEK3I4sk6yILN2VaQ7qik+ZQs4CNdsex4PTJrfJwGpccHaCz
         AIxsBLLYrjeXQdhAE4BSXEAMz3dVMKHEYqQWk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724770591; x=1725375391;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=3zfXWuWnfI6HwOBNf9fB4tWQH8n4IDdRYeIo3+qXDJ4=;
        b=X6U/SXGS47jCuJv/K6idZh5v+rUtq/opInG0BMEdK3QIMCFKzEb4m+OMNqpQef7UKh
         nf3IeLFSQfKkVEDzhuS4uCrYIogal/Qx6sYbXuVpool15r+V4ryLpTzGux03tZxY2Mur
         eEEyjia8HpO3GuyBZphVFBZYosf1+DuRAFLsz9Su27Uj21CjNJfbpFxDCOBtRtdSpvXM
         wPMdiAPEQtXMai73aZEiMrnoN2UvmgLCELK2frEmeAPL65ek7STVabl8HeJMkkaEuVa2
         MzrjGblRBY3N0NOKMvlTM4LY3/r99ymSYAR1qTXf18Te6UUc/p3iA4boCABo23sFYsEB
         5Fag==
X-Forwarded-Encrypted: i=1; AJvYcCVP7DRMNsbGIQ7NU/spohCe6eZa4MIxedGLjo2FNUbAnaXit17edw4hPeesBhLPMY3iMLuB8fnTtSQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyFtBP9EyUPelbr8a9KqhcU4smF69R+DS8C5aWkSnk+Q9GWvgva
	AB442MGeFt8ZyjJC0ldjU8u+DepEXHDqQMVuNwSA71OqEgcofvsTxE0TnkOzTZ7VM3xjB2Kbjoi
	ilSqRcsOlNK5kZL3U73oYJPLegU1l1g7k+WlEwA==
X-Google-Smtp-Source: AGHT+IGjXXXcTTgyMbsVSHGnJCBqRwt8RIWiyisA5OHp6yJviml7+zlcWbxaX0LtI+SYmAVZmygdCce96cwnRd5TERc=
X-Received: by 2002:a05:6808:144a:b0:3de:223a:89ad with SMTP id
 5614622812f47-3de2a89e8a8mr15236605b6e.29.1724770591064; Tue, 27 Aug 2024
 07:56:31 -0700 (PDT)
MIME-Version: 1.0
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-2-alejandro.vallejo@cloud.com> <ad72cc97-b9dd-4e7e-93f6-333805e40785@suse.com>
 <CACHz=Zh7wK58mbB762fnevHEKW9qhp-NRJ6buNe1b-qLxP0qPg@mail.gmail.com>
 <b9b40658-ff13-4240-98a2-4811411e31b6@suse.com> <CACHz=Zj8h-TeDa2Ey8EKKEOpXJqx9MnL+AGpdTBY1B8PZ0==mA@mail.gmail.com>
 <a3d901f9-0a74-4cef-b616-77d338dda314@suse.com> <CACHz=ZgCd81NV7yXZ-Lud-QP8sj05mH9N0c-1z=eBv3pz2ENAw@mail.gmail.com>
 <f5519911-6a3a-468a-98ec-3345339847cd@suse.com>
In-Reply-To: <f5519911-6a3a-468a-98ec-3345339847cd@suse.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Tue, 27 Aug 2024 15:56:20 +0100
Message-ID: <CACHz=ZhuFgTjbGJp-prENbPAM03SoGJ-=+8M1az_TZ3vsG2TEA@mail.gmail.com>
Subject: Re: [PATCH 1/5] x86: Put trampoline in .init.data section
To: Jan Beulich <jbeulich@suse.com>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Xen-devel <xen-devel@lists.xenproject.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 19, 2024 at 4:50=E2=80=AFPM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> On 19.08.2024 17:30, Frediano Ziglio wrote:
> > On Mon, Aug 19, 2024 at 3:30=E2=80=AFPM Jan Beulich <jbeulich@suse.com>=
 wrote:
> >> On 19.08.2024 16:16, Frediano Ziglio wrote:
> >>> On Thu, Aug 8, 2024 at 9:54=E2=80=AFAM Jan Beulich <jbeulich@suse.com=
> wrote:
> >>>> On 08.08.2024 10:00, Frediano Ziglio wrote:
> >>>>> On Thu, Aug 8, 2024 at 8:34=E2=80=AFAM Jan Beulich <jbeulich@suse.c=
om> wrote:
> >>>>>> On 07.08.2024 15:48, Alejandro Vallejo wrote:
> >>>>>>> This change allows to put the trampoline in a separate, not execu=
table
> >>>>>>> section. The trampoline contains a mix of code and data (data whi=
ch
> >>>>>>> is modified from C code during early start so must be writable).
> >>>>>>> This is in preparation for W^X patch in order to satisfy UEFI CA
> >>>>>>> memory mitigation requirements.
> >>>>>>
> >>>>>> Which, aiui, has the downside of disassembly of the section no lon=
ger
> >>>>>> happening by default, when using objdump or similar tools, which g=
o from
> >>>>>> section attributes. Why is it being in .init.text (and hence RX) n=
ot
> >>>>>> appropriate? It should - in principle at least - be possible to av=
oid
> >>>>>> all in-place writing to it, but instead only ever write to its rel=
ocated
> >>>>>> copy. Quite a bit more code churn of course.
> >>>>>>
> >>>>>> I wonder if we shouldn't put the trampoline in its own section, RW=
X in
> >>>>>> the object file, and switched to whatever appropriate in the binar=
y
> >>>>>> (which really may be RX, not RW).
> >>>>>
> >>>>> We cannot have RWX to satisfy UEFI CA memory mitigation, that's why=
 I
> >>>>> had to move it, code sections should not be writeable. We can mark
> >>>>> either RX or RW but we use the data very early so we are not able t=
o
> >>>>> change the permissions (we can try with all complications that this
> >>>>> could bring like how to report an error at so early stages).
> >>>>
> >>>> The early writing could be done away with, as indicated. There's not
> >>>> really any strict requirement to write to the trampoline region with=
in
> >>>> the Xen image. All updates to it could in principle be done after it
> >>>> was copied into low memory. Then (and of course only then) could it =
be
> >>>> part of an RX section in the image, maybe .init.text, maybe a separa=
te
> >>>> .trampoline section.
> >>>
> >>>    how strong are you on this? Is this "objdump" thing such a big
> >>> issue? The code contains a lot of 16 bit code which would require
> >>> additional options anyway. Won't be an assembly listing output more
> >>> helpful instead?
> >>
> >> Well. Whether a listing can serve as a stand-in depends on the situati=
on.
> >> Not being able to disassemble code (e.g. also in the final executable)
> >> can be pretty limiting. The need to pass extra options is related, but
> >> not really an argument against.
> >
> > If some code is inside some data section (in the final binary) you can
> > use -D option to disassemble everything, even data. For instance a
> > "objdump -D xen-syms -m i8086" and look for some "trampoline" symbols.
> > Yes, the output of -D is surely longer than -d.
>
> Well, no, I surely don't want to disassemble all data. Based on what I've
> observed in the past, I also wouldn't be surprised if objdump didn't get
> utterly confused by disassembling data, perhaps to the point of crashing.
>
> >>> Could I ouput the trampoline in a code section ("ax" instead of "aw")
> >>> and then later move it into .init.data section assuring .init.data is
> >>> writeable but not executable?
> >>
> >> Could you go into a little more detail on what you mean here? At the
> >> first glance my reaction is "yes, sure, why not", but much depends on
> >> what exactly is meant.
> >
> > For instance you could put the trampoline into a
> >     .section .init.trampoline, "awx", @progbits
> > section (having the "x" will be disassembled by objdump -d head.o).
> > Then in xen/arch/x86/xen.lds.S in the .init.data section having somethi=
ng like
> > ...
> >   DECL_SECTION(.init.data) {
> >        *(.init.bss.stack_aligned)
> >       (.init.trampoline)
> >    ...
> > this will put the trampoline in .init.data section of the final
> > object. At this point the .init.data containing code will have execute
> > permission that you would have to fix using objcopy command.
> > The final trampoline will be in a data section not executable so to
> > use objdump you will need the -D option, but not disassembling head.o.
> > In theory we could keep the temporary object file before the objcopy
> > adjustment to avoid the -D but I don't think it would save a lot of
> > burdain.
>
> Part of my "want to be able to disassemble" also applies to the final
> binaries. Since iirc one can disassemble individual sections, an option
> may be to have .trampoline be its own section even in the final (PE)
> binary?
>
> In any event, especially as long as there is no really good option, I
> think I'd like to have input from Andrew and/or Roger as well.
>
> Jan

Hi,
   what about having an extra copy in .init.data. That is, compile the
trampoline in .init.text having it readable/executable in the final
PE, at the beginning copying into .init.data and handle the changes
there then when we can allocate the final memory allocate it and copy
the temporary writable copy into final lower memory area.

On a related but not too much topic, I noted there's no .init.bss.
Maybe we could allocate .init.bss (and .init.bss.stack_aligned or
whatever .init.bss.*) at the end of normal .bss and "cut" it while we
remove .init.text and .init.data.

Frediano


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 14:59:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 14:59:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784151.1193547 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sixfK-00060A-OY; Tue, 27 Aug 2024 14:59:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784151.1193547; Tue, 27 Aug 2024 14:59:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sixfK-000603-KO; Tue, 27 Aug 2024 14:59:26 +0000
Received: by outflank-mailman (input) for mailman id 784151;
 Tue, 27 Aug 2024 14:59:25 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sixfJ-0005zv-L5
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 14:59:25 +0000
Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com
 [2a00:1450:4864:20::232])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f241a71c-6484-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 16:59:23 +0200 (CEST)
Received: by mail-lj1-x232.google.com with SMTP id
 38308e7fff4ca-2f4f2868710so54990431fa.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 07:59:23 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb471d7bsm1106038a12.59.2024.08.27.07.59.21
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 07:59:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f241a71c-6484-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724770763; x=1725375563; 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=+eGfLxbXWtAbxqynD3ls7oxBi+rif7KL2WE066bPxrI=;
        b=R1+TgnaCSHfPlo0Qkdo/VOZurQJPYandsTfIsxZbiL8/lspuQ2pn5qO6ynbsLPoXwo
         4LOjXr2zoo134cQ5Vnqv/i0xHlz9mOrMd/ZHT7X2kQIKu9EgYcuL+zcOkaGVLHemM5KA
         NKJuXbDpGmpSkj8ASV3glDzzlIBgdQzK1Dkd4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724770763; x=1725375563;
        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=+eGfLxbXWtAbxqynD3ls7oxBi+rif7KL2WE066bPxrI=;
        b=oVQWGgclU5S6dccXI9M5guApmVA+gDn9NTOMogk4LAQTfbcZO1aNd6qOYGJ2gOBB/f
         YCp8APNIhKWIJOY5z7haj2gsXJ/jrAIuaIudXBh0xBK873PXhAONnxrljZpBf4mIALRR
         TbkG5tz0rK2xLi3zxfo7soSZGd2HVL0a5VE9VDfYCOejovdqKjlEZsuJpfxcxA95dirT
         nMgxDj3eEO37EyUDl2m4GwKBWYHZdQO0hHtXlTJ91acJnlb0Z+IO5x6tq8D1HewJR9Iv
         WPErnDxykvou6vzIwGrZG8f7IaU+C0xuXy05AFw/AFx1EshGzkgs8p5LVxkstRPPJXcy
         7HGA==
X-Forwarded-Encrypted: i=1; AJvYcCWfWXV2b+2cOym0jlrGe7kXZlBj+g7CmtOzXBDvx/JNyc6O2oGZDxL2Yf5s9U6qBjP9rW007W4tyt4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxxDYLnagn3gxYyI0HOfdh0PaUYfQmtKTF2mn8ea03lLRhYKQiG
	mKn+zuDdkqBixMwsbf7IjNp9NQI86eNKmjgt+fpqRywGkM/a7eKlLs6d4TxfZgMsmVCKHBm93kI
	D
X-Google-Smtp-Source: AGHT+IGH1kKKVr8Cx/frG6GABtNGRt8rIiXE5NYNv0N8I+GQ6lFedK6xb6tKPmoASEV3xUUD0rdueg==
X-Received: by 2002:a2e:6e17:0:b0:2ef:2525:be90 with SMTP id 38308e7fff4ca-2f4f493f375mr89924591fa.31.1724770762458;
        Tue, 27 Aug 2024 07:59:22 -0700 (PDT)
Message-ID: <f924efc6-825f-4101-97e7-7bff9a50e5c6@citrix.com>
Date: Tue, 27 Aug 2024 15:59:20 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 9/9] x86/bitops: Use the POPCNT instruction when available
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-10-andrew.cooper3@citrix.com>
 <03febf18-516b-4677-a0a5-102036c91a29@suse.com>
 <3300b035-46d7-41d3-9908-1a0093c433e8@citrix.com>
 <89a5586b-bc9d-47da-a2b6-36e2208a6317@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <89a5586b-bc9d-47da-a2b6-36e2208a6317@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27/08/2024 1:47 pm, Jan Beulich wrote:
> On 27.08.2024 13:17, Andrew Cooper wrote:
>> On 26/08/2024 2:07 pm, Jan Beulich wrote:
>>> On 23.08.2024 01:06, Andrew Cooper wrote:
>>>> A few RFC points.
>>>>
>>>>  * I throught we had an x86 general lib-y but I can't find one, hence why it's
>>>>    still in xen/lib/ for now.
>>> We indeed have nothing like that yet. The file name should then imo not be
>>> arch-* though, but x86-*. Or you could put it in xen/lib/x86/.
>> I was worried about xen/lib/x86/ and interfering with userspace.
>>
>>> It could even
>>> be obj-y rather than lib-y, unless you expect we'll be able to get rid of
>>> all uses, which seems unlikely at least due to bitmap_weight(). Otoh with
>>> my ABI-level series the call site in arch_hweightl() could then be made go
>>> away for v2 and above, at which point it living in lib-y will be preferable.
>> Yes, I was specifically trying to account for this.
>>
>> I'm expecting the mandatory-popcnt work to end up looking something like:
>>
>> diff --git a/xen/arch/x86/include/asm/bitops.h
>> b/xen/arch/x86/include/asm/bitops.h
>> index 0db698ed3f4c..027eda60c094 100644
>> --- a/xen/arch/x86/include/asm/bitops.h
>> +++ b/xen/arch/x86/include/asm/bitops.h
>> @@ -480,6 +480,9 @@ static always_inline unsigned int
>> arch_hweightl(unsigned long x)
>>  {
>>      unsigned int r;
>>  
>> +    if ( IS_ENABLED(CONFIG_REQUIRE_POPCNT /* or whatever */) )
>> +        return __builtin_popcountl(x);
>> +
>>      /*
>>       * arch_generic_hweightl() is written in ASM in order to preserve all
>>       * registers, as the compiler can't see the call.
>>
>>
>> which in turn DCE's the alternative_io() and drops the reference to
>> arch_generic_hweightl().
> Right, that's along the lines of what I was thinking to re-base to once
> your work has gone in. (I have close to zero hope that my work would be
> going in first. [1]) Just that I don't think we'll have separate
> CONFIG_REQUIRE_<feature> settings. Yet how exactly that wants structuring
> is something we ought to discuss there, not here.

I just couldn't remember the name you'd given the option.  I wasn't
trying to driveby review it here.

>
>>>>  * When we up the minimum toolchain to GCC 7 / Clang 5, we can use a
>>>>    __attribute__((no_caller_saved_registers)) and can forgo writing this in asm.
>>>>
>>>>    GCC seems to need extra help, and wants -mgeneral-regs-only too.  It has a
>>>>    habit of complaining about incompatible instructions even when it's not
>>>>    emitting them.
>>> What is this part about? What incompatible instructions, in particular?
>> This was weird.  https://godbolt.org/z/4z1qzWbfE is an example.
> That's because apparently in your experiments you didn't add -mno-sse. If you
> incrementally add that, then -mno-mmx, then -msoft-float, you'll first see the
> diagnostic change and then observe it to finally compile. And yes, from
> looking at the gcc code emitting this error, this is solely tied to the ISAs
> enabled at the time the function is being compiled. It's independent of the
> choice of insns. Pretty clearly a shortcoming, imo.

Ah - it was -msoft-float which I was looking for.

I'd played around with -mno-{sse,mmx} but not gotten a working result.


>
>>>> @@ -475,4 +476,24 @@ static always_inline unsigned int arch_flsl(unsigned long x)
>>>>  }
>>>>  #define arch_flsl arch_flsl
>>>>  
>>>> +static always_inline unsigned int arch_hweightl(unsigned long x)
>>>> +{
>>>> +    unsigned int r;
>>>> +
>>>> +    /*
>>>> +     * arch_generic_hweightl() is written in ASM in order to preserve all
>>>> +     * registers, as the compiler can't see the call.
>>>> +     *
>>>> +     * This limits the POPCNT instruction to using the same ABI as a function
>>>> +     * call (input in %rdi, output in %eax) but that's fine.
>>>> +     */
>>>> +    alternative_io("call arch_generic_hweightl",
>>>> +                   "popcnt %[val], %q[res]", X86_FEATURE_POPCNT,
>>>> +                   ASM_OUTPUT2([res] "=a" (r) ASM_CALL_CONSTRAINT),
>>>> +                   [val] "D" (x));
>>> If you made [val] an output ("+D") you could avoid preserving the register
>>> in the function. And I'd expect the register wouldn't be re-used often
>>> afterwards, so its clobbering likely won't harm code quality very much.
>> "+D" means it's modified by the asm, which forces preservation of the
>> register, if it's still needed afterwards.
>>
>> Plain "D" means not modified by the asm, which means it can be reused if
>> necessary.
> And we likely would prefer the former: If the register's value isn't
> use afterwards (and that's the case as far as the function on its own
> goes), the compiler will know it doesn't need to preserve anything.
> That way, rather than always preserving (in the called function)
> preservation will be limited to just the (likely few) cases where the
> value actually is still needed afterwards.

Constraints are there to describe how the asm() behaves to the compiler.

You appear to be asking me to put in explicitly-incorrect constraints
because you think it will game the optimiser.

Except the reasoning is backwards.  The only thing forcing "+D" will do
is cause the compiler to preserve the value elsewhere if it's actually
needed later, despite the contents of %rdi still being good for the purpose.

In other words, using "+D" for asm which is really only "D" (as this one
is) will result in strictly worse code generation in the corner case you
seem to be worried about.

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 15:00:20 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 15:00:20 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784155.1193556 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sixgB-0007QR-WF; Tue, 27 Aug 2024 15:00:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784155.1193556; Tue, 27 Aug 2024 15:00:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sixgB-0007QK-TP; Tue, 27 Aug 2024 15:00:19 +0000
Received: by outflank-mailman (input) for mailman id 784155;
 Tue, 27 Aug 2024 15:00:18 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sixgA-0005zv-MF
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 15:00:18 +0000
Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com
 [2a00:1450:4864:20::12a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 11e437ed-6485-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 17:00:16 +0200 (CEST)
Received: by mail-lf1-x12a.google.com with SMTP id
 2adb3069b0e04-5343617fdddso8331792e87.0
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 08:00:16 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e54b488fsm120987566b.92.2024.08.27.08.00.15
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 08:00:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 11e437ed-6485-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724770816; x=1725375616; 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=Un1GmJ+ZgTY+JwsHPVW/Q/0SlZVOhrqdqkfEzJs0DTk=;
        b=LU0CczjT8vwKAweFwd1O6rL6D5yMURIkPnFzD8ZOlEP9rMcWs+EPeGyB1VnYgafQsh
         ky9cyru9WnQsjyRCrNXvBLm6SGkmGkgr4gpePlK/Zz9JmGe/Eip/XI6L7EIC5D6QRU+u
         P7WYIOdeVLGVRQHCcWFIoP6HUSZRKWgYjwjKOIy+iFV+MgGDUgX811UzmXR7XvHJxB2n
         kc5ES+Yw0d3+plnA7XKuv35PTdAxF9Ozv500PfxAKcTFbfT7rEECXivBF2DoW5I6lrY6
         hzpEJ/ZJfBAIc33a5piacaoM4Pz5ivxiLf4T1/nbSuICnNRdMSKY3CjV91c7q8vrAIhM
         AnPw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724770816; x=1725375616;
        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=Un1GmJ+ZgTY+JwsHPVW/Q/0SlZVOhrqdqkfEzJs0DTk=;
        b=itkgNCiWnPY1P47rnkgxIEB3sH3vUksUZUWrX4xs5qAGESLlfRkcX7b7rUaPmrEqOZ
         c9Vq+c4Ebo+6PL9P4XHX8Zo/3oUCE/wsHUDtehSplwuVw4a7RLii08HJtFdkZyqiYVab
         RK5TNS3O7lYWkFtT6s7PQ+HjRouOqy8SaL2z/fJjHuODrapeCUYtonIGz38pCVFnsWn9
         QdkkRjvAnFmahmJ2fHJrjKOBAt9oNGsAZt7tTqU25UmX/PdzEb6qNfQKUrtOWISmoDu6
         dFBi+d43Hvkcm56CFoACls/xijvfWDyl6CmSxcRH6rIus6YphuqYa7e7bRr1iepkATz/
         gg+w==
X-Forwarded-Encrypted: i=1; AJvYcCXOnkf2k1EiHA3HgMeBWq5debtm7irGAzttP/J8O0ncSVmuBGvjATzACO3KPsfUFoa77KF1Hbn7YXI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwYw/Q96yzw4lUziuA2NKXYZYBolhcmCkNLrnj19O5g4ykuMUpJ
	sKEXQDih3I4Et1P3u23uriiQoZd8f4ZhvIGPo9FNgRYfJRfh4LJOL667Bc5m5w==
X-Google-Smtp-Source: AGHT+IE3s33Kj13U6EfMMJOsP0pfXeR0Drv7OXpWlYE6RsY9+hdN+UxYzQptY1QKXBZlJTDFw39Sag==
X-Received: by 2002:a05:6512:ad1:b0:530:ad8d:dcdb with SMTP id 2adb3069b0e04-53438846f81mr12121081e87.19.1724770815789;
        Tue, 27 Aug 2024 08:00:15 -0700 (PDT)
Message-ID: <c0005454-3b34-427d-8ea0-620aba632487@suse.com>
Date: Tue, 27 Aug 2024 17:00:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 6/7] xen/riscv: page table handling
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
 <090e617d88b279ae88f1a7859875a7e1a0c6ae73.1724256027.git.oleksii.kurochko@gmail.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <090e617d88b279ae88f1a7859875a7e1a0c6ae73.1724256027.git.oleksii.kurochko@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 21.08.2024 18:06, Oleksii Kurochko wrote:
> Implement map_pages_to_xen() which requires several
> functions to manage page tables and entries:
> - pt_update()
> - pt_mapping_level()
> - pt_update_entry()
> - pt_next_level()
> - pt_check_entry()
> 
> To support these operations, add functions for creating,
> mapping, and unmapping Xen tables:
> - create_table()
> - map_table()
> - unmap_table()
> 
> Introduce internal macros starting with PTE_* for convenience.
> These macros closely resemble PTE bits, with the exception of
> PTE_SMALL, which indicates that 4KB is needed.

What macros are you talking about here? Is this partially stale, as
only PTE_SMALL and PTE_POPULATE (and a couple of masks) are being
added?

> --- a/xen/arch/riscv/include/asm/flushtlb.h
> +++ b/xen/arch/riscv/include/asm/flushtlb.h
> @@ -5,12 +5,24 @@
>  #include <xen/bug.h>
>  #include <xen/cpumask.h>
>  
> +#include <asm/sbi.h>
> +
>  /* Flush TLB of local processor for address va. */
>  static inline void flush_tlb_one_local(vaddr_t va)
>  {
>      asm volatile ( "sfence.vma %0" :: "r" (va) : "memory" );
>  }
>  
> +/*
> + * Flush a range of VA's hypervisor mappings from the TLB of all
> + * processors in the inner-shareable domain.
> + */

Isn't inner-sharable an Arm term? Don't you simply mean "all" here?

> @@ -68,6 +111,20 @@ static inline bool pte_is_valid(pte_t p)
>      return p.pte & PTE_VALID;
>  }
>  
> +inline bool pte_is_table(const pte_t p)
> +{
> +    return ((p.pte & (PTE_VALID |
> +                      PTE_READABLE |
> +                      PTE_WRITABLE |
> +                      PTE_EXECUTABLE)) == PTE_VALID);
> +}

In how far is the READABLE check valid here? You (imo correctly) ...

> +static inline bool pte_is_mapping(const pte_t p)
> +{
> +    return (p.pte & PTE_VALID) &&
> +           (p.pte & (PTE_WRITABLE | PTE_EXECUTABLE));
> +}

... don't consider this bit here.

> --- a/xen/arch/riscv/include/asm/riscv_encoding.h
> +++ b/xen/arch/riscv/include/asm/riscv_encoding.h
> @@ -164,6 +164,7 @@
>  #define SSTATUS_SD			SSTATUS64_SD
>  #define SATP_MODE			SATP64_MODE
>  #define SATP_MODE_SHIFT			SATP64_MODE_SHIFT
> +#define SATP_PPN_MASK			_UL(0x00000FFFFFFFFFFF)
>  
>  #define HGATP_PPN			HGATP64_PPN
>  #define HGATP_VMID_SHIFT		HGATP64_VMID_SHIFT

This looks odd, padding-wise, but that's because hard tabs are being
used here. Is that intentional?

> --- /dev/null
> +++ b/xen/arch/riscv/pt.c
> @@ -0,0 +1,420 @@
> +#include <xen/bug.h>
> +#include <xen/domain_page.h>
> +#include <xen/errno.h>
> +#include <xen/mm.h>
> +#include <xen/mm-frame.h>
> +#include <xen/pmap.h>
> +#include <xen/spinlock.h>
> +
> +#include <asm/flushtlb.h>
> +#include <asm/page.h>
> +
> +static inline const mfn_t get_root_page(void)
> +{
> +    paddr_t root_maddr = (csr_read(CSR_SATP) & SATP_PPN_MASK) << PAGE_SHIFT;
> +
> +    return maddr_to_mfn(root_maddr);
> +}
> +
> +/* Sanity check of the entry. */
> +static bool pt_check_entry(pte_t entry, mfn_t mfn, unsigned int flags)
> +{
> +    /*
> +     * See the comment about the possible combination of (mfn, flags) in
> +     * the comment above pt_update().
> +     */
> +
> +    /* Sanity check when modifying an entry. */
> +    if ( (flags & PTE_VALID) && mfn_eq(mfn, INVALID_MFN) )
> +    {
> +        /* We don't allow modifying an invalid entry. */
> +        if ( !pte_is_valid(entry) )
> +        {
> +            printk("Modifying invalid entry is not allowed.\n");

Perhaps all of these printk()s should be dprintk()? And not have a full
stop?

> +            return false;
> +        }
> +
> +        /* We don't allow modifying a table entry */
> +        if ( pte_is_table(entry) )
> +        {
> +            printk("Modifying a table entry is not allowed.\n");
> +            return false;
> +        }
> +    }
> +    /* Sanity check when inserting a mapping */
> +    else if ( flags & PTE_VALID )
> +    {
> +        /* We should be here with a valid MFN. */
> +        ASSERT(!mfn_eq(mfn, INVALID_MFN));

This is odd to have here, considering the if() further up.

> +        /*
> +         * We don't allow replacing any valid entry.
> +         *
> +         * Note that the function pt_update() relies on this
> +         * assumption and will skip the TLB flush (when Svvptc
> +         * extension will be ratified). The function will need
> +         * to be updated if the check is relaxed.
> +         */
> +        if ( pte_is_valid(entry) )
> +        {
> +            if ( pte_is_mapping(entry) )
> +                printk("Changing MFN for a valid entry is not allowed (%#"PRI_mfn" -> %#"PRI_mfn").\n",
> +                       mfn_x(mfn_from_pte(entry)), mfn_x(mfn));
> +            else
> +                printk("Trying to replace a table with a mapping.\n");
> +            return false;
> +        }
> +    }
> +    /* Sanity check when removing a mapping. */
> +    else if ( (flags & (PTE_VALID | PTE_POPULATE)) == 0 )

The PTE_VALID part of the check is pointless considering the earlier
if(). I guess you may want to have it for doc purposes ...

Since further up you're using "else if ( flags & PTE_VALID )" imo
here you want to use "else if ( !(flags & ...) )".

> +    {
> +        /* We should be here with an invalid MFN. */
> +        ASSERT(mfn_eq(mfn, INVALID_MFN));
> +
> +        /* We don't allow removing a table */
> +        if ( pte_is_table(entry) )
> +        {
> +            printk("Removing a table is not allowed.\n");
> +            return false;
> +        }

Is this restriction temporary?

> +    }
> +    /* Sanity check when populating the page-table. No check so far. */
> +    else
> +    {
> +        ASSERT(flags & PTE_POPULATE);

This again is redundant with earlier if() conditions.

> +#define XEN_TABLE_MAP_FAILED 0
> +#define XEN_TABLE_SUPER_PAGE 1
> +#define XEN_TABLE_NORMAL 2
> +
> +/*
> + * Take the currently mapped table, find the corresponding entry,
> + * and map the next table, if available.
> + *
> + * The alloc_tbl parameters indicates whether intermediate tables should
> + * be allocated when not present.
> + *
> + * Return values:
> + *  XEN_TABLE_MAP_FAILED: Either alloc_only was set and the entry
> + *  was empty, or allocating a new page failed.
> + *  XEN_TABLE_NORMAL: next level or leaf mapped normally
> + *  XEN_TABLE_SUPER_PAGE: The next entry points to a superpage.
> + */
> +static int pt_next_level(bool alloc_tbl, pte_t **table, unsigned int offset)

Having the boolean first is unusual, but well - it's your choice.

> +{
> +    pte_t *entry;
> +    int ret;
> +    mfn_t mfn;
> +
> +    entry = *table + offset;
> +
> +    if ( !pte_is_valid(*entry) )
> +    {
> +        if ( alloc_tbl )
> +            return XEN_TABLE_MAP_FAILED;

Is this condition meant to be inverted?

> +        ret = create_table(entry);
> +        if ( ret )
> +            return XEN_TABLE_MAP_FAILED;

You don't really use "ret". Why not omit the local variable, even
more so that it has too wide scope?

> +/* Update an entry at the level @target. */
> +static int pt_update_entry(mfn_t root, unsigned long virt,
> +                           mfn_t mfn, unsigned int target,
> +                           unsigned int flags)
> +{
> +    int rc;
> +    unsigned int level = HYP_PT_ROOT_LEVEL;
> +    pte_t *table;
> +    /*
> +     * The intermediate page table shouldn't be allocated when MFN isn't
> +     * valid and we are not populating page table.
> +     * This means we either modify permissions or remove an entry, or
> +     * inserting brand new entry.
> +     *
> +     * See the comment above pt_update() for an additional explanation about
> +     * combinations of (mfn, flags).
> +    */
> +    bool alloc_tbl = mfn_eq(mfn, INVALID_MFN) && !(flags & PTE_POPULATE);

Is this meant to be inverted, too (to actually match variable name and
comment)?

> +    pte_t pte, *entry;
> +
> +    /* convenience aliases */
> +    DECLARE_OFFSETS(offsets, virt);
> +
> +    table = map_table(root);
> +    for ( ; level > target; level-- )
> +    {
> +        rc = pt_next_level(alloc_tbl, &table, offsets[level]);
> +        if ( rc == XEN_TABLE_MAP_FAILED )
> +        {
> +            rc = 0;
> +
> +            /*
> +             * We are here because pt_next_level has failed to map
> +             * the intermediate page table (e.g the table does not exist
> +             * and the pt is read-only). It is a valid case when

I'm sorry, but there's still a "read-only" left here.

> +             * removing a mapping as it may not exist in the page table.
> +             * In this case, just ignore it.
> +             */
> +            if ( flags & PTE_VALID )
> +            {
> +                printk("%s: Unable to map level %u\n", __func__, level);
> +                rc = -ENOENT;
> +            }
> +
> +            goto out;
> +        }
> +        else if ( rc != XEN_TABLE_NORMAL )

No need for "else" when the earlier if() ends in "goto".

> +            break;
> +    }
> +
> +    if ( level != target )
> +    {
> +        printk("%s: Shattering superpage is not supported\n", __func__);
> +        rc = -EOPNOTSUPP;
> +        goto out;
> +    }
> +
> +    entry = table + offsets[level];
> +
> +    rc = -EINVAL;
> +    if ( !pt_check_entry(*entry, mfn, flags) )
> +        goto out;
> +
> +    /* We are removing the page */
> +    if ( !(flags & PTE_VALID) )
> +        memset(&pte, 0x00, sizeof(pte));
> +    else
> +    {
> +        /* We are inserting a mapping => Create new pte. */
> +        if ( !mfn_eq(mfn, INVALID_MFN) )
> +            pte = pte_from_mfn(mfn, PTE_VALID);
> +        else /* We are updating the permission => Copy the current pte. */
> +            pte = *entry;
> +
> +        /* update permission according to the flags */
> +        pte.pte |= PTE_RWX_MASK(flags) | PTE_ACCESSED | PTE_DIRTY;

When updating an entry, don't you also need to clear (some of) the flags?

> +/* Return the level where mapping should be done */
> +static int pt_mapping_level(unsigned long vfn, mfn_t mfn, unsigned long nr,
> +                            unsigned int flags)
> +{
> +    unsigned int level = 0;
> +    unsigned long mask;
> +    unsigned int i;
> +
> +    /* Use blocking mapping unless the caller requests 4K mapping */
> +    if ( unlikely(flags & PTE_SMALL) )
> +        return level;
> +
> +    /*
> +     * Don't take into account the MFN when removing mapping (i.e
> +     * MFN_INVALID) to calculate the correct target order.
> +     *
> +     * `vfn` and `mfn` must be both superpage aligned.
> +     * They are or-ed together and then checked against the size of
> +     * each level.
> +     *
> +     * `left` is not included and checked separately to allow
> +     * superpage mapping even if it is not properly aligned (the
> +     * user may have asked to map 2MB + 4k).

What is this about? There's nothing named "left" here.

> +     */
> +    mask = !mfn_eq(mfn, INVALID_MFN) ? mfn_x(mfn) : 0;
> +    mask |= vfn;
> +
> +    for ( i = HYP_PT_ROOT_LEVEL; i != 0; i-- )
> +    {
> +        if ( !(mask & (BIT(XEN_PT_LEVEL_ORDER(i), UL) - 1)) &&
> +             (nr >= BIT(XEN_PT_LEVEL_ORDER(i), UL)) )
> +        {
> +            level = i;
> +            break;
> +        }
> +    }
> +
> +    return level;
> +}
> +
> +static DEFINE_SPINLOCK(xen_pt_lock);

Another largely meaningless xen_ prefix?

> +/*
> + * If `mfn` equals `INVALID_MFN`, it indicates that the following page table
> + * update operation might be related to either populating the table (
> + * PTE_POPULATE will be set additionaly), destroying a mapping, or modifying
> + * an existing mapping.

And the latter two are distinguished by? PTE_VALID?

> + * If `mfn` is valid and flags has PTE_VALID bit set then it means that
> + * inserting will be done.
> + */

What about mfn != INVALID_MFN and PTE_VALID clear? Also note that "`mfn` is
valid" isn't the same as "mfn != INVALID_MFN". You want to be precise here,
to avoid confusion later on. (I say that knowing that we're still fighting
especially shadow paging code on x86 not having those properly separated.)

> +static int pt_update(unsigned long virt,
> +                     mfn_t mfn,
> +                     unsigned long nr_mfns,
> +                     unsigned int flags)
> +{
> +    int rc = 0;
> +    unsigned long vfn = virt >> PAGE_SHIFT;

Please don't open-code e.g PFN_DOWN().

> +    unsigned long left = nr_mfns;
> +
> +    const mfn_t root = get_root_page();
> +
> +    /*
> +     * It is bad idea to have mapping both writeable and
> +     * executable.
> +     * When modifying/creating mapping (i.e PTE_VALID is set),
> +     * prevent any update if this happen.
> +     */
> +    if ( (flags & PTE_VALID) && PTE_W_MASK(flags) && PTE_X_MASK(flags) )

Seeing them in use, I wonder about the naming of those PTE_?_MASK()
macros. Along with the lhs, why not simply (flags & PTE_...)?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 15:02:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 15:02:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784163.1193566 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sixhn-00083y-Db; Tue, 27 Aug 2024 15:01:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784163.1193566; Tue, 27 Aug 2024 15:01:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sixhn-00083q-B0; Tue, 27 Aug 2024 15:01:59 +0000
Received: by outflank-mailman (input) for mailman id 784163;
 Tue, 27 Aug 2024 15:01: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=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sixhl-000826-E9
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 15:01:57 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4cea1fc9-6485-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 17:01:55 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a86e9db75b9so102510566b.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 08:01:55 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e5487a88sm120256166b.38.2024.08.27.08.01.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 08:01:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4cea1fc9-6485-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724770915; x=1725375715; 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=yaZPpSO8+n4j8whG+wrXXjP8Dq75GL9fzKcBrXBURUw=;
        b=DKGdlbTkqAMAYDNRjKHdmpD+wqDfamzFk0tu4v0970VrNBUrxndV8vc5S270ajfHHx
         owgkX3MbC/eUOpEEvHHJkl7LShqVVTQTLvfQckJ9fmKN7ILwayo5TAGdRGFy6Di8CO4M
         znNlKd82868f3eubkyuGyTj7W9MNMbEY4etXhXBCKyaGYgNcLL40tn1cU0UNGJt2Z/mO
         rD5qYerdcJtgvcbSLNk9QEi2Quwq7EGtFfhgv85F2Z38t3YbFlBf3L5rc++lqa9jIajq
         N+RV82DqLzWOvZ2ZfZuhUfQ2R/kARnH6NfuE8aPYKGEOS4zpZUNt6eCRaKXtvYxrYga+
         wqlQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724770915; x=1725375715;
        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=yaZPpSO8+n4j8whG+wrXXjP8Dq75GL9fzKcBrXBURUw=;
        b=M+lQ4T9yX0/sR5g4KJ6o3We3meAb9T60tvgLXSpbkedulEWH2EIvbqRACNzjGNG0gn
         St2keQaEad6/Y+95LWC8Vbt9B3IvriG0dHPRkNJjgJxgHhQFsZut4scdJFRBIxLzTQ2e
         DcE62QWnj3MG86tZuZm/3FdiKiWg2FWPrpQPgdK4V/CSrRVgl/ZIc1zNTX91Pnfs83s+
         sMQ5hz4GQ2NM2tP4AHOi4/6OjoJp2CwgEtiUxtPllNemC030V1tJUkktC9Dd5U/f2HSI
         /CjW1ELuyeFWslYSTsgSqMDsHOxeIix4pOcuL+f4/nMt7GUuBPMFsD56nwYd2KmDQyr8
         zCKQ==
X-Forwarded-Encrypted: i=1; AJvYcCUXYk4hOaVqxDNNFitIb3bMdb0tKpL9YYE1iR6Is73PQeKgWvK8j4H0s7SMcw72g/0d+cYq817metE=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw/LKVzkwSictY+GVfMzQF0lnHEgkIvJzWZgpcqVHklz/fyZLhn
	kGs92oP1NWfA/okxRPyBrRV0r5W8mCBoZ9HSiQ/hguRwy0o3/SOZyEtyS5BMpg==
X-Google-Smtp-Source: AGHT+IHwPZE2COM0keTUFK2JeugXSUuvpO3I/4B/Rxmx/HiALiFhUCMpaiwrEjZYUqfBRrgj0wJlBQ==
X-Received: by 2002:a17:907:7251:b0:a80:f358:5d55 with SMTP id a640c23a62f3a-a86a52c11e5mr838392666b.33.1724770914801;
        Tue, 27 Aug 2024 08:01:54 -0700 (PDT)
Message-ID: <7dfb83d4-3022-40c6-98aa-d5a236c2de66@suse.com>
Date: Tue, 27 Aug 2024 17:01:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 7/9] xen/bitops: Implement hweight64() in terms of
 hweightl()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Wei Liu <wl@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-8-andrew.cooper3@citrix.com>
 <11da1350-095f-49c8-bdf0-f5c83e9f0d39@suse.com>
 <70047ef7-ca22-4eeb-9510-09ccdf0871c0@citrix.com>
 <73309650-3912-418b-b2e6-a60676519911@suse.com>
 <c54f7015-abe1-4834-83e3-29a2cc854d85@citrix.com>
 <d63df810-3f95-4c99-90fd-e509c26fc4fe@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <d63df810-3f95-4c99-90fd-e509c26fc4fe@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 27.08.2024 16:32, Andrew Cooper wrote:
> On 27/08/2024 2:25 pm, Andrew Cooper wrote:
>> On 27/08/2024 2:00 pm, Jan Beulich wrote:
>>> On 27.08.2024 13:50, Andrew Cooper wrote:
>>>> On 26/08/2024 12:55 pm, Jan Beulich wrote:
>>>>> On 23.08.2024 01:06, Andrew Cooper wrote:
>>>> Again, this is modelled after f[fl]s64() which have the same
>>>> expectations about the BITS_PER_LONG != 64 case.
>>> Both of them are fine afaict. fls64() has an explicit intermediate
>>> variable of type uint32_t, and ffs64() has a (uint32_t)x as part
>>> of the conditional expression achieving the intended effect.
>>>
>>> Anyway, why not use hweight32() instead of hweightl() here? That'll
>>> make things very explicit.
>> hweight32() doesn't exist until the next patch in the series.
>>
>> Although looking at the end result, I can't figure out why I thought it
>> was necessary to transform hweight64 first.
>>
>> I'll swap this patch and the next one, and then use hweight32().
> 
> I've found out why.
> 
> The hweight32() patch is the one that deletes generic_hweight32(), but
> generic_hweight64() uses it.
> 
> I can work around this, but it means keeping generic_hweight32() around
> and deleting it in the hweight64() patch.

Or simply fold both patches?

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 15:05:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 15:05:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784166.1193576 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sixkg-0000Cr-QH; Tue, 27 Aug 2024 15:04:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784166.1193576; Tue, 27 Aug 2024 15:04:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sixkg-0000Ck-NN; Tue, 27 Aug 2024 15:04:58 +0000
Received: by outflank-mailman (input) for mailman id 784166;
 Tue, 27 Aug 2024 15:04: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=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sixkf-0000Ce-1P
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 15:04:57 +0000
Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com
 [2a00:1450:4864:20::12b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b86e6123-6485-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 17:04:56 +0200 (CEST)
Received: by mail-lf1-x12b.google.com with SMTP id
 2adb3069b0e04-5343d2af735so4201589e87.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 08:04:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e582d8a3sm120775366b.136.2024.08.27.08.04.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 08:04:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b86e6123-6485-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724771095; x=1725375895; 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=n+VagzEb5uChgRmU+PmbRm9keAJ4VXJ0Ct20vb0wnSg=;
        b=EPW0DCN9kizXwdwX9NosKCMHVv0rtEW/qZOPOs+gglMY+SmQkzkgQmdlr7WKJRaJ6c
         fPTBw7b1KOZmWwX48asrNMwU4dzJ2HUyojT1fimGZ9t5cxQp8TTBqSuO9z4ZOG6bihxO
         abjC+2gfJJGaXaFs7GrrxSHQY4t5dumXgZqB8NE2iA7hMTaI80I7TqL759/Ei0TS8S9C
         sC6ceWk6QolU6hdGBYidy1c+2sUAX6qEBf8Tuk9AnW+AX0Y38rPYq0TP/b/pjo9RY5iG
         D77F//9aJEMXkDd01bkp08pYPWQxPfnowMSCO1lrGSs5h3R+hagYmAmn5vdQWZom4nVp
         dFFA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724771095; x=1725375895;
        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=n+VagzEb5uChgRmU+PmbRm9keAJ4VXJ0Ct20vb0wnSg=;
        b=aXiUt7ZKSIy3GCt76/tPeVyup/4SrU1FHE1CYMlngfRrUz5lMwL5ccKcuP3XVI4QvU
         s0jJTKvqxy5utpRU6MbWmueLD2atMZ+ZwpzGTDKQiVcp2ypN9M5bOCPX7Sia9rCPFjcz
         R180EpcWCu6tWya50rnlebgGsj6vPFtrQ7NLhFaSCPTvxKfdbg5Jljd4FfgAb09BOWgW
         VbBk5yk2RlFmoCTvCPzlRS1FAYUpTKvrvUdHJK6sRPeKtflFWZ++BH4nPqkfOjtfLSf0
         Bh9RiLHB58/39uxJ+gyc8Ew8SPVutomOoUgzjWIqqAOTR3EP/2JtNOHbYs0VwRBX+cfv
         TxQA==
X-Forwarded-Encrypted: i=1; AJvYcCVhtLV1pI1KjBfDkCGCOANmsjqHhvAdfJlfmXKCwY/XMW7CcN8vOASsb3+yRtR+U/PDUWuzgULATEs=@lists.xenproject.org
X-Gm-Message-State: AOJu0YycDoAPavmEZ/hkXBN5/qE7K6qwN1CeVlF3TE6xXJwhrxyGSShe
	RA5PJsihQ9JBPjlv1Y4IBfgDvBbCn5mRCtLTW6AfBtzUHULf029X0y22W5GIGfvr7RLYsxa4Sqo
	=
X-Google-Smtp-Source: AGHT+IE8JxhL5Sr82z6lHL/PYpQwenbgBsP/5WBaSVgUm/FOmt4OOnlVwmUvOO6h5W9Wrb0SrWhdNw==
X-Received: by 2002:a05:6512:e9a:b0:530:c212:4a5a with SMTP id 2adb3069b0e04-5344e3c9983mr2165789e87.22.1724771095324;
        Tue, 27 Aug 2024 08:04:55 -0700 (PDT)
Message-ID: <22585e0f-b1d6-49b0-a04f-fe9161f79ea2@suse.com>
Date: Tue, 27 Aug 2024 17:04:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 9/9] x86/bitops: Use the POPCNT instruction when available
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240822230635.954557-1-andrew.cooper3@citrix.com>
 <20240822230635.954557-10-andrew.cooper3@citrix.com>
 <03febf18-516b-4677-a0a5-102036c91a29@suse.com>
 <3300b035-46d7-41d3-9908-1a0093c433e8@citrix.com>
 <89a5586b-bc9d-47da-a2b6-36e2208a6317@suse.com>
 <f924efc6-825f-4101-97e7-7bff9a50e5c6@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <f924efc6-825f-4101-97e7-7bff9a50e5c6@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27.08.2024 16:59, Andrew Cooper wrote:
> On 27/08/2024 1:47 pm, Jan Beulich wrote:
>> On 27.08.2024 13:17, Andrew Cooper wrote:
>>> On 26/08/2024 2:07 pm, Jan Beulich wrote:
>>>> On 23.08.2024 01:06, Andrew Cooper wrote:
>>>>> @@ -475,4 +476,24 @@ static always_inline unsigned int arch_flsl(unsigned long x)
>>>>>  }
>>>>>  #define arch_flsl arch_flsl
>>>>>  
>>>>> +static always_inline unsigned int arch_hweightl(unsigned long x)
>>>>> +{
>>>>> +    unsigned int r;
>>>>> +
>>>>> +    /*
>>>>> +     * arch_generic_hweightl() is written in ASM in order to preserve all
>>>>> +     * registers, as the compiler can't see the call.
>>>>> +     *
>>>>> +     * This limits the POPCNT instruction to using the same ABI as a function
>>>>> +     * call (input in %rdi, output in %eax) but that's fine.
>>>>> +     */
>>>>> +    alternative_io("call arch_generic_hweightl",
>>>>> +                   "popcnt %[val], %q[res]", X86_FEATURE_POPCNT,
>>>>> +                   ASM_OUTPUT2([res] "=a" (r) ASM_CALL_CONSTRAINT),
>>>>> +                   [val] "D" (x));
>>>> If you made [val] an output ("+D") you could avoid preserving the register
>>>> in the function. And I'd expect the register wouldn't be re-used often
>>>> afterwards, so its clobbering likely won't harm code quality very much.
>>> "+D" means it's modified by the asm, which forces preservation of the
>>> register, if it's still needed afterwards.
>>>
>>> Plain "D" means not modified by the asm, which means it can be reused if
>>> necessary.
>> And we likely would prefer the former: If the register's value isn't
>> use afterwards (and that's the case as far as the function on its own
>> goes), the compiler will know it doesn't need to preserve anything.
>> That way, rather than always preserving (in the called function)
>> preservation will be limited to just the (likely few) cases where the
>> value actually is still needed afterwards.
> 
> Constraints are there to describe how the asm() behaves to the compiler.
> 
> You appear to be asking me to put in explicitly-incorrect constraints
> because you think it will game the optimiser.
> 
> Except the reasoning is backwards.  The only thing forcing "+D" will do
> is cause the compiler to preserve the value elsewhere if it's actually
> needed later, despite the contents of %rdi still being good for the purpose.
> 
> In other words, using "+D" for asm which is really only "D" (as this one
> is) will result in strictly worse code generation in the corner case you
> seem to be worried about.

Well, then leave it as is. (An extra benefit would have been that
arch_generic_hweightl() then would ended up with a odd-number-of-slots
stack frame. Not that this matters much, but having ABI-compliant
functions where possible seems always preferable, when possible.)

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 15:20:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 15:20:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784180.1193586 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sixzU-0004b6-35; Tue, 27 Aug 2024 15:20:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784180.1193586; Tue, 27 Aug 2024 15:20:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sixzU-0004az-03; Tue, 27 Aug 2024 15:20:16 +0000
Received: by outflank-mailman (input) for mailman id 784180;
 Tue, 27 Aug 2024 15:20:15 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=XoQA=P2=bounce.vates.tech=bounce-md_30504962.66cdeeaa.v1-6a2409223d934861b9fb99e074e8022a@srs-se1.protection.inumbo.net>)
 id 1sixzS-0004at-M5
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 15:20:15 +0000
Received: from mail187-32.suw11.mandrillapp.com
 (mail187-32.suw11.mandrillapp.com [198.2.187.32])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id da1dc6c0-6487-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 17:20:12 +0200 (CEST)
Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail187-32.suw11.mandrillapp.com (Mailchimp) with ESMTP id
 4WtWSV4wPHzQXg3Cr
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 15:20:10 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 6a2409223d934861b9fb99e074e8022a; Tue, 27 Aug 2024 15:20:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: da1dc6c0-6487-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724772010; x=1725032510;
	bh=Ymni47yYiavwbdtek5GqXhef3XC8ro+P1vB45EwEbaQ=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=C2BPhibe47UrVY9fC5M1BkWzedWlmMvTHCMV6mXvvF3v0dHLFrSpUpSrb1G9ucOd+
	 RbGIybBFgg3NhCvADD+/If9eNbpfO8q75CpIds1Du2IMYKO+/2ZrWnkWuoippORzup
	 Vx7LF5Ne1/ZuzhnpGdY9+c+cIQSlkFlUlv36+zfC3Zpt50NjGQCDXnNFW+48O25yVf
	 FzYS76uKxSpTmj0I6chmMzeuD/uEpqwo5M5ejVKlCXH0nHOKNQJB7nKCywFPGGKYhn
	 GZ6bPZztyde9M6qPpBpg6HUfrYEsW1fL5lo4H4wwadoU9XGBszfcm9zDLFaWn0gj49
	 Px65DPvwllTKQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724772010; x=1725032510; i=anthony.perard@vates.tech;
	bh=Ymni47yYiavwbdtek5GqXhef3XC8ro+P1vB45EwEbaQ=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=s6lKuHvVeJAmGy20rmL/C7/BWBZwARHv4V9/at0Z6p0Rus6fQ+RZbaoOcCFjYJGKq
	 1MMAoByzuQo4vfH6TiVWpK5EcxMgiiaQueXShrgzd8DmebibpJqUbnHqqf/ImZlJWD
	 rdSNiPEnsyReDpWAZiYQHudKkrCmVJ9dpLpJ/qyjwsWxy10lGpQkLJLb1ROKn7pYgG
	 a/hPZ7wmlz+It/axopCHtm/p9Q6O1EzPQY28bczLRfXU/wmyYffP6phmY/NPF3Zw+z
	 6HMUqhw4gE3+PixI5K177bkbd4dbLCSB6H4RIaTQOX15b01WF/CObgKpL4SvMYz1me
	 r/5gujWCStEiw==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[XEN=20PATCH=20v2=201/3]=20libxl:=20Fix=20nul-termination=20of=20the=20return=20value=20of=20libxl=5Fxen=5Fconsole=5Fread=5Fline()?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724772009582
To: Javi Merino <javi.merino@cloud.com>
Cc: xen-devel@lists.xenproject.org, jbeulich@suse.com, andrew.cooper3@citrix.com, Juergen Gross <jgross@suse.com>, =?utf-8?Q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@cloud.com>
Message-Id: <Zs3uqKNTV1601s9j@l14>
References: <cover.1724430173.git.javi.merino@cloud.com> <b1c7eb226ce62f50d6a50baa3977830a31fa5c9b.1724430173.git.javi.merino@cloud.com>
In-Reply-To: <b1c7eb226ce62f50d6a50baa3977830a31fa5c9b.1724430173.git.javi.merino@cloud.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.6a2409223d934861b9fb99e074e8022a?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240827:md
Date: Tue, 27 Aug 2024 15:20:10 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Fri, Aug 23, 2024 at 06:05:03PM +0100, Javi Merino wrote:
> diff --git a/tools/libs/light/libxl_console.c b/tools/libs/light/libxl_console.c
> index a563c9d3c7f9..012fd996fba9 100644
> --- a/tools/libs/light/libxl_console.c
> +++ b/tools/libs/light/libxl_console.c
> @@ -774,12 +774,14 @@ libxl_xen_console_reader *
>  {
>      GC_INIT(ctx);
>      libxl_xen_console_reader *cr;
> -    unsigned int size = 16384;
> +    /* We want xen to fill the buffer in as few hypercalls as
> +     * possible, but xen will not nul-terminate it.  Leave one byte at
> +     * the end for the null */
> +    unsigned int size = 16384 + 1;

This comment doesn't really explain why the size choosen is 16k+1, it
kind of explain the +1 but that's about it.

16k seems to be the initial size
    https://elixir.bootlin.com/xen/v4.19.0/source/xen/drivers/char/console.c#L110
But then, it is changed to depend on $(nproc) and loglevel
    https://elixir.bootlin.com/xen/v4.19.0/source/xen/drivers/char/console.c#L1095
with 16k been the minimum it seems:
    https://elixir.bootlin.com/xen/v4.19.0/source/xen/drivers/char/console.c#L1061

So, I think a useful comment here would reflect that 16k is default size
of Xen's console buffer.

Also, multi-line comments are normally expected to be with begin and end
markers on separated lines:
    /*
     * Comments.
     */


It be nice to fix both comments, but otherwise the patch looks good:
Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 15:21:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 15:21:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784186.1193596 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siy0L-00055Y-Cz; Tue, 27 Aug 2024 15:21:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784186.1193596; Tue, 27 Aug 2024 15:21:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siy0L-00055R-9f; Tue, 27 Aug 2024 15:21:09 +0000
Received: by outflank-mailman (input) for mailman id 784186;
 Tue, 27 Aug 2024 15:21:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8SwS=P2=bounce.vates.tech=bounce-md_30504962.66cdeedc.v1-9c2576835f4546838e99ea644bee7a12@srs-se1.protection.inumbo.net>)
 id 1siy0K-00052X-CJ
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 15:21:08 +0000
Received: from mail187-32.suw11.mandrillapp.com
 (mail187-32.suw11.mandrillapp.com [198.2.187.32])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f7515d9a-6487-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 17:21:01 +0200 (CEST)
Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail187-32.suw11.mandrillapp.com (Mailchimp) with ESMTP id
 4WtWTS1Yx4zQXg2bx
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 15:21:00 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 9c2576835f4546838e99ea644bee7a12; Tue, 27 Aug 2024 15:21:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f7515d9a-6487-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724772060; x=1725032560;
	bh=YBXVkINCpMI6QLd/E/U9xEiztFYTsWcnDcHLDsd05D4=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=wI9cKm1828qNyLIp+UVNcKxQCbgl7pxGkdIWHo4LcO+VO9AC6h6w2eBKpcT6k/VoR
	 S+5KOxA/UeozHyaQenUcS3h+u/JHEJ2RB5Beqfb/hBTkU3j8A8oI/fRoL+UKFp/wvX
	 3PCTTV77CU7+3zLpvNBGvFvUlHIGS3VyHKGVtb+GenG1xcR+A+2ovE5Ts8cMhWcdNl
	 0x5rEUpXph+pM9URM6iwAZoeGKUec+rq5FKvCewH+8wJ6NaCZv70GbGIUfwsMXt0pf
	 qzns+mOgSF24MR0UBQSSUZqTwmrogley0nnRqcqZ+BKM+2ONjVD21JWPAoaCbzOevw
	 DwnM9TqXWNWsg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724772060; x=1725032560; i=anthony.perard@vates.tech;
	bh=YBXVkINCpMI6QLd/E/U9xEiztFYTsWcnDcHLDsd05D4=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=KIIMTR82wJRrQhhQHNYNdXFuPABFx+3xIiTWRYmI51dYtn5Bijj+aul1SOd26Xqgl
	 hxaFWiyv6kfNWjp3zT6qj2pGQ1uggDfHF/L5yz++LgxULU2muik5c4sqcogDKurKdj
	 j/YWDt8XLL5hhOI817RCFszxsz/KOr8ZTgiDphfkgNHHgnuT7Nf5bXNkjYShF2exil
	 ZcKJYkFIDadrVU4aAtuPcXvRCHXcNui8f1w3FsCDdRhScv/7er3oznYOFuTPtARMXh
	 h4mhCveiR0dHLd0NKsyGlfkshsva8bNQTsLcQfEHq9b7+LYk1TRb+YVlFP6G0u0evx
	 VqnN0GgTOA5Yw==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[XEN=20PATCH=20v2=202/3]=20libxl:=20Remove=20unnecessary=20buffer=20zeroing=20and=20zalloc()?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724772059159
To: Javi Merino <javi.merino@cloud.com>
Cc: xen-devel@lists.xenproject.org, jbeulich@suse.com, andrew.cooper3@citrix.com, Juergen Gross <jgross@suse.com>
Message-Id: <Zs3u2jR+dhIlxa6f@l14>
References: <cover.1724430173.git.javi.merino@cloud.com> <ab2cb7430109e345ed6a294d9e8b2329bb373d2a.1724430173.git.javi.merino@cloud.com>
In-Reply-To: <ab2cb7430109e345ed6a294d9e8b2329bb373d2a.1724430173.git.javi.merino@cloud.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.9c2576835f4546838e99ea644bee7a12?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240827:md
Date: Tue, 27 Aug 2024 15:21:00 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Fri, Aug 23, 2024 at 06:05:04PM +0100, Javi Merino wrote:
> When reading the console, xen overwrites the contents of the buffer,
> so there is no need to zero the buffer before passing it to xen.
> Instead, add a NULL at the end of the buffer.
> 
> While we are at it, change the zalloc() of the buffer back to
> malloc() as it was before bdf4131 (libxl: don't leak buf in
> libxl_xen_console_read_start error handling, 2013-12-03).  The comment
> in that commit message says that the intent of the commit was to
> change malloc+memset to zalloc(), but only for the
> libxl_xen_console_reader struct, not for the buffer.
> 
> Signed-off-by: Javi Merino <javi.merino@cloud.com>

Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 15:26:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 15:26:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784192.1193605 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siy5G-0005jr-Ul; Tue, 27 Aug 2024 15:26:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784192.1193605; Tue, 27 Aug 2024 15:26:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siy5G-0005jk-SE; Tue, 27 Aug 2024 15:26:14 +0000
Received: by outflank-mailman (input) for mailman id 784192;
 Tue, 27 Aug 2024 15:26:13 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ZYJc=P2=bounce.vates.tech=bounce-md_30504962.66cdf012.v1-9a14d418303b47678cf7d7952e218851@srs-se1.protection.inumbo.net>)
 id 1siy5F-0005hU-6w
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 15:26:13 +0000
Received: from mail187-32.suw11.mandrillapp.com
 (mail187-32.suw11.mandrillapp.com [198.2.187.32])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b0433af5-6488-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 17:26:11 +0200 (CEST)
Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail187-32.suw11.mandrillapp.com (Mailchimp) with ESMTP id
 4WtWbQ15hlzQXg2bZ
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 15:26:10 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 9a14d418303b47678cf7d7952e218851; Tue, 27 Aug 2024 15:26:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b0433af5-6488-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724772370; x=1725032870;
	bh=lqqA/fCZvHf1v3hOUldCexVgyymrJAPgOfvTEDAlb30=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=KWkPaHi2S4Q8Qe2GkalKLo3wOGQj4nG7srlbosQUZ1c8UdS1JiWOFV4LtRRvNl1E4
	 P008Z5wd4RvByKrL8gLaRgzj+/BDfttbu5w3mjQJ6+Th5OZGP9HDsaDyttwOoGF7IS
	 Yjo5wmaGe2lUXbSkuC2xtKVCrGeTKORuPpGdaiaXmcRMt9EC+RvmP2nuOz2o513K2X
	 7/oJcQFqc9UBQ4Aw/z9BGTvytmBOaVRAbcmjcwvY/j6divydfjaCDWoXYm4gQy8qYv
	 i3bU1bJLqwd1XQg/+CTIWuF5hSmHqD3BeB+c7UDUxLvG/anMyTb+GxW4XJbuki8dnG
	 jrMBsel2Ulc4Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724772370; x=1725032870; i=anthony.perard@vates.tech;
	bh=lqqA/fCZvHf1v3hOUldCexVgyymrJAPgOfvTEDAlb30=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=e+WcXq6+wnPAs4FH4IL8RlZ/rZa7YJIuYhoK2e+iivmA2Xc4ZpeCfjokzhOIIAgfv
	 6K4gqz+0T87NGe8TaQgmLFH7usUi9soxo4la/WWBPQgCEa2q+PM42IgLJ5lILJqOWh
	 ZaFUa5K49q6nskpoP6lLEBEQM9qfcDAWoMUSjl+nYrlYzeM7+oIdvtIepL235X3dWk
	 AryoAWJdJKK3tYOvP5cS90r+ld+ra4JTvmlBlpV2AREMfsalMSMl8idsUDVXppdIIV
	 4X6I89OwBmDqrgE1baBEYrG5Diq8BM0V/9JjqVqozI8iZyb0aV7EEa9EXDK2Tx4mk/
	 rjeRDCplvxKEg==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[XEN=20PATCH=20v2=203/3]=20libxl:=20Update=20the=20documentation=20of=20libxl=5Fxen=5Fconsole=5Fread=5Fline()?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724772369119
To: Javi Merino <javi.merino@cloud.com>
Cc: xen-devel@lists.xenproject.org, jbeulich@suse.com, andrew.cooper3@citrix.com, Juergen Gross <jgross@suse.com>
Message-Id: <Zs3wEK1HjdgkqVwE@l14>
References: <cover.1724430173.git.javi.merino@cloud.com> <d868579d9ea98d8072630f5b85f7f7250ece393d.1724430173.git.javi.merino@cloud.com>
In-Reply-To: <d868579d9ea98d8072630f5b85f7f7250ece393d.1724430173.git.javi.merino@cloud.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.9a14d418303b47678cf7d7952e218851?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240827:md
Date: Tue, 27 Aug 2024 15:26:10 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Fri, Aug 23, 2024 at 06:05:05PM +0100, Javi Merino wrote:
> Despite its name, libxl_xen_console_read_line() does not read a line,
> it fills the buffer with as many characters as fit.  Update the
> documentation to reflect the real behaviour of the function.  Rename
> line_r to avoid confusion since it is a pointer to an array of
> characters.
> 
> Signed-off-by: Javi Merino <javi.merino@cloud.com>
> ---
>  tools/libs/light/libxl_console.c | 22 ++++++++++++----------
>  1 file changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/tools/libs/light/libxl_console.c b/tools/libs/light/libxl_console.c
> index f42f6a51ee6f..652897e4ef6d 100644
> --- a/tools/libs/light/libxl_console.c
> +++ b/tools/libs/light/libxl_console.c
> @@ -789,17 +789,19 @@ libxl_xen_console_reader *
>      return cr;
>  }
>  
> -/* return values:                                          *line_r
> - *   1          success, whole line obtained from buffer    non-0
> - *   0          no more lines available right now           0
> - *   negative   error code ERROR_*                          0
> - * On success *line_r is updated to point to a nul-terminated
> +/* Copy part of the console ring into a buffer
> + *
> + * Return values:
> + *   1: Success, the buffer obtained from the console ring an
> + *   0: No more lines available right now
> + *   -ERROR_* on error
> + *
> + * On success, *line_r is updated to point to a nul-terminated
>   * string which is valid until the next call on the same console
> - * reader.  The libxl caller may overwrite parts of the string
> - * if it wishes. */
> + * reader. */
>  int libxl_xen_console_read_line(libxl_ctx *ctx,
>                                  libxl_xen_console_reader *cr,
> -                                char **line_r)
> +                                char **buff)

You may want to update "tools/include/libxl.h" as well. I don't know why
this comments is here instead of in the public header. At least there's
some documentation I guess.

Cheers,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 15:50:51 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 15:50:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784223.1193616 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siySn-0003Qq-T0; Tue, 27 Aug 2024 15:50:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784223.1193616; Tue, 27 Aug 2024 15:50:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siySn-0003Qj-QB; Tue, 27 Aug 2024 15:50:33 +0000
Received: by outflank-mailman (input) for mailman id 784223;
 Tue, 27 Aug 2024 15:50:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siySm-0003Qd-6X
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 15:50:32 +0000
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com
 [2a00:1450:4864:20::529])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 16b50e9e-648c-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 17:50:31 +0200 (CEST)
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5bed05c0a2fso6947269a12.3
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 08:50:31 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1c4f37sm1142919a12.15.2024.08.27.08.50.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 08:50:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 16b50e9e-648c-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724773831; x=1725378631; 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=TnoIv9rn8ZSaCj7N5sMftzWerTKewjrZ/r8uJIgT2hE=;
        b=CQ1kaDfRJ0pb/YQ1S/5dVCE+6u2nRnvQjIMu0a+9eSvXYr43kaiAV2oWI3dnjR+hVX
         I+e0KV+EbKCAVAMVYhTz1E5ZrOgLwAsDXIssCEzsHP7a36oemRwNZA4tQkKPlWPe4UES
         YQFUxyh1mG/xTLCu/uQXz+AfT8gy5zpAPOhbiLDCHF9srILQ9c5/2Pz5uCU+DRKQu8+V
         hItaJTVXJvgDFmi1gGsG0GrDAzNBi8vqgArFPF2sOC7DGLQm9L8y2iQ+qke802Mdx+VJ
         wB9w+ue6oQ18+2z4ZDKCynhldAmc/V4TF87uqVLdgxqnpmf4o4f4wNvOhApW1bUJD11W
         jsTw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724773831; x=1725378631;
        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=TnoIv9rn8ZSaCj7N5sMftzWerTKewjrZ/r8uJIgT2hE=;
        b=TSJU011mTnt8FOMfaGWixy2WZh8Yo02al32LFBH+4q38mxvqm1VfY3pOmmtVN5odFs
         wk4b7nD5+e+6sN9rDh09qFQcfhucaiL+X77iTaKit/slumvByfscvybaUTnYQdxdATuy
         h5410N3mZBUjiIajsdPfkOOB/e6IPUaI/dUp+UNPAqjUq1HNI2/lRSMiQwQy4lNA7iIO
         TFujXj5xeoS0+uIcLCst0aS7hWrs0IXMitPwwFzvWDrgfrz17DNee5iMX74lm86aCt5C
         fjXKHDqm8lWY10WCSW3+h4/rXRlbvctjI3ZO69jhLjw7n5C5VVX2VhBhSJcqIEzwWRMD
         rkIA==
X-Forwarded-Encrypted: i=1; AJvYcCUfz0y104iw2AYy0i2cFm00KuOSEJh3GlcNdLUuNGBLXyl5+M2H86Gix4uLx1UN+ytVGo2WoQ2M2Cw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwdCBDMSU/8+mfNDHCuhH4uM6a59j9KmDmwVobk+9GWIIXV5z26
	/zFBrRqZICIJxClDdDRSb571pHEFPYYIPVtLBKC1qvrwy1yC/o8fdpWTWzPIkQ==
X-Google-Smtp-Source: AGHT+IFDx+ZkETay8GNFrGIQPbco4CBBtrTKn7k4uh+vlubrFcNlO4r/ob9ziWIM+gLC4wf5glOLhw==
X-Received: by 2002:a05:6402:42c7:b0:5be:e9f8:9bbf with SMTP id 4fb4d7f45d1cf-5c089164ac8mr11017040a12.9.1724773830476;
        Tue, 27 Aug 2024 08:50:30 -0700 (PDT)
Message-ID: <527b3a0f-3e86-47aa-9092-e67df329b7e9@suse.com>
Date: Tue, 27 Aug 2024 17:50:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] Avoid additional relocations in trampoline code
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 xen-devel@lists.xenproject.org
References: <20240822152953.489136-1-frediano.ziglio@cloud.com>
 <55e6dc6c-344a-4483-90c2-e414ef4bc869@suse.com>
 <CACHz=ZgbU3-HBgoDC9ws=cCK10B2D4K2JxjLN3_0YGoksVep8w@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: <CACHz=ZgbU3-HBgoDC9ws=cCK10B2D4K2JxjLN3_0YGoksVep8w@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27.08.2024 15:56, Frediano Ziglio wrote:
> On Mon, Aug 26, 2024 at 9:21 AM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 22.08.2024 17:29, Frediano Ziglio wrote:
>>> The trampoline could have "manual" relocation entries (created
>>> by assembly macros and some code to use them) and (in case of PE)
>>> normal executable relocations.
>>> Remove all normal executable ones. In this way we don't have to
>>> worry about applying both correctly (they need proper order
>>> which is hard to spot looking at the code).
>>>
>>> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
>>
>> I think this wants splitting into one patch replacing sym_offs() and a
>> 2nd one introducing the hand-crafted __XEN_VIRT_START additions (which
>> may want macro-izing). Plus the justification for the change wants
>> extending, to actually explain what the problem is - after all there's
>> no issue anywhere right now.
> 
> Should I explain the time dependency issue with source code?

Time dependency? I guess I don't understand ...

> I suppose I can describe where currently is and why it would be better
> to have it removed (honestly I though I did but reading the commit
> message I didn't).
> Maybe for search reasons it would be better to define 2 macros like
> the following?
> 
> #define phys_addr(sym) sym ## _pa
> #define virt_addr(sym) sym ## _va
> 
> This way, for instance, searching for the "__high_start" word (like
> "grep -rw __high_start") would produce a result.

I assume it's best to keep everything there together, so see below.

>> With the sym_offs() uses gone, I think it would be best if the macro was
>> #undef-ed ahead of the inclusion of trampoline.S. Since x86_64.S uses the
>> macro, that'll require careful re-arrangement of #include order.
>>
> 
> I think you mean including the trampoline after including x86_64.S in
> head.S.

Yes.

>>> --- a/xen/arch/x86/xen.lds.S
>>> +++ b/xen/arch/x86/xen.lds.S
>>> @@ -71,7 +71,12 @@ SECTIONS
>>>    __2M_text_start = .;         /* Start of 2M superpages, mapped RX. */
>>>  #endif
>>>
>>> -  start_pa = ABSOLUTE(start - __XEN_VIRT_START);
>>> +#define DEFINE_PA_ADDRESS(sym) sym ## _pa = ABSOLUTE(sym - __XEN_VIRT_START)
>>> +  DEFINE_PA_ADDRESS(start);
>>> +  DEFINE_PA_ADDRESS(saved_magic);
>>> +  DEFINE_PA_ADDRESS(idle_pg_table);
>>> +  DEFINE_PA_ADDRESS(__high_start);
>>> +  DEFINE_PA_ADDRESS(s3_resume);
>>>
>>>    . = __XEN_VIRT_START + XEN_IMG_OFFSET;
>>>    _start = .;
>>
>> For the cases where in assembly code you add __XEN_VIRT_START this is pretty
>> odd: You subtract the value here just to add it back there. Did you consider
>> a more straightforward approach, like introducing absolute xxx_va symbols?
> 
> I didn't consider. Would something like
> 
> #define DEFINE_ABS_ADDRESSES(sym) \
>    sym ## _pa = ABSOLUTE(sym - __XEN_VIRT_START); \
>    sym ## _va = ABSOLUTE(sym)
> 
> make sense? Maybe the _pa and _va suffixes are too similar? Maybe
> _physaddr and _virtaddr? Or use capical letters and macros (as above)
> to avoid possible clashes?

I'd like to ask that we don't introduce symbols we don't actually use. Hence
a single macro defining both is probably not going to be overly helpful. As
to capital letters: I'm struggling with the "(as above)" - I don't see any
use of capital letters in symbol names being generated. But yes, I was going
to suggest to consider _VA and _PA tags, precisely to reduce the risk of
clashes.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 15:55:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 15:55:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784229.1193625 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siyXf-00040n-E6; Tue, 27 Aug 2024 15:55:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784229.1193625; Tue, 27 Aug 2024 15:55:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siyXf-00040g-BG; Tue, 27 Aug 2024 15:55:35 +0000
Received: by outflank-mailman (input) for mailman id 784229;
 Tue, 27 Aug 2024 15:55:34 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siyXe-00040a-C9
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 15:55:34 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c921a9f4-648c-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 17:55:30 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5bed72ff443so6560145a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 08:55:30 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e594e809sm124144866b.219.2024.08.27.08.55.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 08:55:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c921a9f4-648c-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724774130; x=1725378930; 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=niKBLfDuQyq3nbWbh5tdu7wA7idV67hA9CxZQeeYDik=;
        b=JlCyv+0R6GpzLHL6NnK34QPBsGAFAeWIP+vktmcqjLJC4VgMJkmm4qlBgVLuwEGFsP
         KmDOcmEXkqDXVIo4pFaCQ7gvUa0ku1dYXONaRmekkjrBOeb+euPHcdVIXC2VcBj3PaLI
         4wMMdwuic+0b1kbXhNKjbQ52/cZgVrYmbFswHy+7GVNGB4g6kgAvigF5vKkI+tydAaoW
         u2eCsuefh8cjynhVv784j2M9Xz3oZR1X6h4hYCJd/EbTzF3uNXjLg01l9RI4ugmzA7Sc
         9VClJy0sjNszqWoNzWdyoVdQNSZk5P6KaY+Q81NimtHlOywFkTwzvV8sTZjt34A4ScCC
         tuIg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724774130; x=1725378930;
        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=niKBLfDuQyq3nbWbh5tdu7wA7idV67hA9CxZQeeYDik=;
        b=o3eKDTB+5qqD9vMvexU0tfXcVvFzRzilDF/tbKkBjo7GrSNVWaRbn18oNYJqgVPI1v
         p8i3XkxKFL1VD8OsMQxXTK8v02BLxxWPlE8mmox7ZoIj40RhYcYowpjFdirVA01RgcjP
         mlgFb87x23NhaAw9EyW/XN7g9RMxj8y+QSwByIgRyVh0KjDT0TiNwkjOrAV1eQi4a863
         gOKer3BjLhgbxmkAcct+m6JC8TD3RO5fXl+poK6dUtyEx1cLXCVwSnYp4DJQ4zO40Vq1
         zSQ3hs87MDwRggOpWD03g9LbrWUqOeuZT8dAzyVHvh2DvcFKBC6Yi456L9sU3h6LHz7H
         2dmw==
X-Forwarded-Encrypted: i=1; AJvYcCXh1Mp3Vbi4cW5bSJlPTcoa7mdFKH3VRXH0h/A3bJ5L0JOtx/s3KR1qq4yjGJWYNY+3+R+pJLZbxAg=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx4zY1+HVnZ31E4zpt/MxFOLgZl8/kh6p4PuxIUf5P3l19HcRDn
	2rQOk79b+gX4HxQxhi8oSEKZGQJ8fDcoIwRkNQEv8nKAJ0IPMy/k2WjFLyeYbA==
X-Google-Smtp-Source: AGHT+IGelQYwIc1IlBvbq9eaN+6UkAiym28qD6xcS53GW6Z6H/qyJpzZ1poLFvY/QhAKJZayVsD1vQ==
X-Received: by 2002:a17:906:f590:b0:a86:8ec7:11b2 with SMTP id a640c23a62f3a-a86a54f124cmr955737266b.59.1724774129847;
        Tue, 27 Aug 2024 08:55:29 -0700 (PDT)
Message-ID: <773b4710-46c4-4bc3-bf53-623bf666cfe8@suse.com>
Date: Tue, 27 Aug 2024 17:55:28 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/5] x86: Put trampoline in .init.data section
To: Frediano Ziglio <frediano.ziglio@cloud.com>
Cc: Alejandro Vallejo <alejandro.vallejo@cloud.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240807134819.8987-1-alejandro.vallejo@cloud.com>
 <20240807134819.8987-2-alejandro.vallejo@cloud.com>
 <ad72cc97-b9dd-4e7e-93f6-333805e40785@suse.com>
 <CACHz=Zh7wK58mbB762fnevHEKW9qhp-NRJ6buNe1b-qLxP0qPg@mail.gmail.com>
 <b9b40658-ff13-4240-98a2-4811411e31b6@suse.com>
 <CACHz=Zj8h-TeDa2Ey8EKKEOpXJqx9MnL+AGpdTBY1B8PZ0==mA@mail.gmail.com>
 <a3d901f9-0a74-4cef-b616-77d338dda314@suse.com>
 <CACHz=ZgCd81NV7yXZ-Lud-QP8sj05mH9N0c-1z=eBv3pz2ENAw@mail.gmail.com>
 <f5519911-6a3a-468a-98ec-3345339847cd@suse.com>
 <CACHz=ZhuFgTjbGJp-prENbPAM03SoGJ-=+8M1az_TZ3vsG2TEA@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: <CACHz=ZhuFgTjbGJp-prENbPAM03SoGJ-=+8M1az_TZ3vsG2TEA@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27.08.2024 16:56, Frediano Ziglio wrote:
> On Mon, Aug 19, 2024 at 4:50 PM Jan Beulich <jbeulich@suse.com> wrote:
>>
>> On 19.08.2024 17:30, Frediano Ziglio wrote:
>>> On Mon, Aug 19, 2024 at 3:30 PM Jan Beulich <jbeulich@suse.com> wrote:
>>>> On 19.08.2024 16:16, Frediano Ziglio wrote:
>>>>> Could I ouput the trampoline in a code section ("ax" instead of "aw")
>>>>> and then later move it into .init.data section assuring .init.data is
>>>>> writeable but not executable?
>>>>
>>>> Could you go into a little more detail on what you mean here? At the
>>>> first glance my reaction is "yes, sure, why not", but much depends on
>>>> what exactly is meant.
>>>
>>> For instance you could put the trampoline into a
>>>     .section .init.trampoline, "awx", @progbits
>>> section (having the "x" will be disassembled by objdump -d head.o).
>>> Then in xen/arch/x86/xen.lds.S in the .init.data section having something like
>>> ...
>>>   DECL_SECTION(.init.data) {
>>>        *(.init.bss.stack_aligned)
>>>       (.init.trampoline)
>>>    ...
>>> this will put the trampoline in .init.data section of the final
>>> object. At this point the .init.data containing code will have execute
>>> permission that you would have to fix using objcopy command.
>>> The final trampoline will be in a data section not executable so to
>>> use objdump you will need the -D option, but not disassembling head.o.
>>> In theory we could keep the temporary object file before the objcopy
>>> adjustment to avoid the -D but I don't think it would save a lot of
>>> burdain.
>>
>> Part of my "want to be able to disassemble" also applies to the final
>> binaries. Since iirc one can disassemble individual sections, an option
>> may be to have .trampoline be its own section even in the final (PE)
>> binary?
>>
>> In any event, especially as long as there is no really good option, I
>> think I'd like to have input from Andrew and/or Roger as well.
> 
> what about having an extra copy in .init.data. That is, compile the
> trampoline in .init.text having it readable/executable in the final
> PE, at the beginning copying into .init.data and handle the changes
> there then when we can allocate the final memory allocate it and copy
> the temporary writable copy into final lower memory area.

I dislike such duplication, and I'd fear it may cause more confusion
than to actually help. Plus you'd need to sort the symbol name clashes.

> On a related but not too much topic, I noted there's no .init.bss.
> Maybe we could allocate .init.bss (and .init.bss.stack_aligned or
> whatever .init.bss.*) at the end of normal .bss and "cut" it while we
> remove .init.text and .init.data.

How would anything (in C) use .init.bss? __attribute__((section(...)))
doesn't make @nobits sections (last I checked), and .init.bss that's
@progbits is not really different from .init.data.

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 15:57:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 15:57:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784236.1193636 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siyZZ-0005QS-Pa; Tue, 27 Aug 2024 15:57:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784236.1193636; Tue, 27 Aug 2024 15:57:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siyZZ-0005QL-Mj; Tue, 27 Aug 2024 15:57:33 +0000
Received: by outflank-mailman (input) for mailman id 784236;
 Tue, 27 Aug 2024 15:57:32 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siyZY-0005QF-Ss
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 15:57:32 +0000
Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com
 [2a00:1450:4864:20::635])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 10a09a57-648d-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 17:57:30 +0200 (CEST)
Received: by mail-ej1-x635.google.com with SMTP id
 a640c23a62f3a-a86e9db75b9so111452566b.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 08:57:30 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e582d4fdsm124333266b.133.2024.08.27.08.57.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 08:57:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 10a09a57-648d-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724774250; x=1725379050; 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=uEQ0ZKoyudcETo5WkVOCunps6bO+2NlpdSBvf82/18A=;
        b=BtVcoZ4Ho2prPUF3XoAlioIC6lr6u+4XcxlYhkzwm1vtxZC1rQZj96YyRqkIpodt2Z
         J1dgLaxXs747qUP/1lqv4/p9eZqjM42O3W0ArI2sJXXrQh/9WNB03VDtVqM1g9Fl9tJG
         3Qutg65qTLTpu4197eBX8NtfubDmhFuKElH9TvZuCoJFNHFNOKob/1DPjE5ypqkhMTwb
         AgehgFz79GS8+Ijsv4qlMDUMcNtZHRssPpGx3obC5PvpJP48TTMZOBMSJ4lvs8Pw84O5
         RlCPRlk0LG04cA4LVt3H4qIitmqTtx6cYkH56e3NjFjCN1I9BhkFRzWAUxHSQ51ij9gI
         3u8g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724774250; x=1725379050;
        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=uEQ0ZKoyudcETo5WkVOCunps6bO+2NlpdSBvf82/18A=;
        b=E/4nm9lmL9i+7CxgpC9vF35pEhLlUn8fkOXQc+uVy5OaoyhrzM1XAwYKW1Tl0QW3VU
         Qbb7Qy1CuwuThuq5F0ZvhJdJw7d7W8rzWgeNxclprkSiITKhca4YjczXDPM3szn8I/0h
         frle25gqhf69yac7PINzaPM9M9pIn2ivYcNgz7hbdsyDMC/I28xu43wI3aKXip6lrZpj
         RohiHl+2oGQannzTPhlxfoyhaLcg/7HyT3lHYKcsbKJe470FfqA9mxgL8JO+Gg/mqmmi
         ZODNbXuSNEfcgr3iPh1Yj32dJf3m5Eg0MzfNm9NQRt0+B0yiRUwOzYhvvukEb6DHSSpH
         yKNA==
X-Forwarded-Encrypted: i=1; AJvYcCXzGmDv82C3G3oHdr8ke4mU7RxOrTpjfzSZ0YAGwMm+st5Euz4FgxIeyxDRtAN7jesgEt5Onhfkyk0=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy+vw3Bg835zHj5m/tTwVgY6EDKadBV7r8kwzD+BrhT0yEnn8KY
	8FW9tNt9iVDHAs7Q/2p/iOExBSU9dXrakGKaNV4wLsMWmXzmtMet1X0xpmRhHg==
X-Google-Smtp-Source: AGHT+IF876mnmi6CEZkkVnd8EK2w4nNfD4+Ed1TE9jNlh+V0AELcKCN0YKnsnvjge1FFKeytZUdCjA==
X-Received: by 2002:a17:907:7246:b0:a77:c6c4:2bb7 with SMTP id a640c23a62f3a-a86a5165450mr1109864566b.1.1724774249884;
        Tue, 27 Aug 2024 08:57:29 -0700 (PDT)
Message-ID: <f70fd372-6692-4e43-bd45-a1663beade73@suse.com>
Date: Tue, 27 Aug 2024 17:57:28 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/4] xen/evtchn: Use bitmap_for_each() in
 evtchn_check_pollers()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Xen-devel <xen-devel@lists.xenproject.org>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
 <20240827135746.1908070-2-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240827135746.1908070-2-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 27.08.2024 15:57, Andrew Cooper wrote:
> It is a preprocessor-identical opencoding.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Tue Aug 27 16:07:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 16:07:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784242.1193646 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siyj6-00081v-Lf; Tue, 27 Aug 2024 16:07:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784242.1193646; Tue, 27 Aug 2024 16:07:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siyj6-00081A-IJ; Tue, 27 Aug 2024 16:07:24 +0000
Received: by outflank-mailman (input) for mailman id 784242;
 Tue, 27 Aug 2024 16:07:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=tHc6=P2=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1siyj5-0007zW-Et
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 16:07:23 +0000
Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com
 [2a00:1450:4864:20::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 70ce9652-648e-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 18:07:21 +0200 (CEST)
Received: by mail-ej1-x630.google.com with SMTP id
 a640c23a62f3a-a86933829dcso646560666b.3
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 09:07:21 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e582d878sm126332166b.119.2024.08.27.09.07.20
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 09:07:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 70ce9652-648e-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724774841; x=1725379641; 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=GSlOYRYOQV+Hp5y5cuE+6TSIU8mS+8Dx/yBelA6NMJQ=;
        b=QOMH5xPsrrHmWTp8t6CpzbO5zZIelHN13NMGdAgV6rBU6QKSA9ZeYmn9NDXSiSTmln
         E3+H0LS6KLvvxaxON0fzr+zY2Lan8w3wgQ2J8VaJmbvogm9bfoSfiCjGHwAOf7wpAHg/
         0yq1iVncgDHL8qaEoGaqVOWpPXl20wqJYqJuQCtJS/MO2NPMdD/6Izutp0j2uWNpD6Fc
         J/Y2SMLYUZgUk6Dd8HasU56bW4PCy5pl/cCCGMr8vxrd7pn6v/OF0DEKDbv+vCbS8hLu
         guGDl/JUph7c0bRIdfs10HANOH4M/GswipSr+f0hzIPpRS4PqswSc1EiG/+Ms5uC+RkZ
         c6uA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724774841; x=1725379641;
        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=GSlOYRYOQV+Hp5y5cuE+6TSIU8mS+8Dx/yBelA6NMJQ=;
        b=w13J1efPtMHKQgHoLUIuDON9lfIBsPHg2jkXQC6tXB17xlHK81EwHdlFKQLNj8RNaS
         QkY7QSC3rmVUTgaQnbvuZauyfhXqXhx7que/3Qup73w6n1Da0CvcFQpiYFQ4Ir/cn6Ff
         lznew3SrNNmiR88UCyP86H0V0wvkiEWzvUxAnRHncvzMueLDdTAmXcuvCG4cgiSI3mvg
         mhM/WVMxDDZyfPUhiysaFZHZj0d7OrpjNPzr79D7qp6xuCwM2e9Eg5B2aqUWWKphkKC8
         KB7e3Cp/GI68hrukneSKIjswTaLEcqrDJYNwZWZ71o/8GM7VfRkC0pb3QRayb55bF5Ho
         +PzA==
X-Forwarded-Encrypted: i=1; AJvYcCU620mcDO3lkxOiciyhtTvVtqqmfuF8SbD35NIUnVKwjDGREGu7yoCt/EGE86gMroubHPiKRnbaXGo=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyGyUT6BYjjvLMUn6/Us9agrQ+M9RQIEIV+iVRmmIsWjkMAdi+/
	cd+CKYvXTiiEX60v5d3IAOTRK5EqCkR8Y2nRrVkJLCcmND4sp7ATPoEGZMqxBwV1exp3+hahP5o
	=
X-Google-Smtp-Source: AGHT+IHjv5IJomM9PEVZ6FJbbqU8v2hS+YKnHFGKr696Y5gtfZhJofIqFE87HAvkX22811eNrW9t2A==
X-Received: by 2002:a17:907:e268:b0:a86:7983:a4a7 with SMTP id a640c23a62f3a-a86a52f08eamr949356266b.38.1724774840662;
        Tue, 27 Aug 2024 09:07:20 -0700 (PDT)
Message-ID: <a92063db-fc28-4162-83bd-33617bbfcfbe@suse.com>
Date: Tue, 27 Aug 2024 18:07:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/4] x86/hvm: Use for_each_set_bit() in
 hvm_emulate_writeback()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
 <20240827135746.1908070-3-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /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: <20240827135746.1908070-3-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27.08.2024 15:57, Andrew Cooper wrote:
> ... which is more consise than the opencoded form.
> 
> Also, for production VMs, ~100% of emulations are simple MOVs, so it is likely
> that there are no segments to write back.
> 
> Furthermore, now that find_{first,next}_bit() are no longer in use, the
> seg_reg_{accessed,dirty} fields aren't forced to be unsigned long, although
> they do need to remain unsigned int because of __set_bit() elsewhere.
> 
> No practical change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> 
> Pulling current out into curr is good for code generation.  When using current
> in the loop, GCC can't retain the calculation across the call to
> hvm_set_segment_register() and is forced to re-read from the cpu_info block.
> 
> However, if curr is initialised, it's calculated even in the likely path...

That's a little odd, as I don't think I can spot what would force the compiler
into doing so. As a wild guess, ...

> --- a/xen/arch/x86/hvm/emulate.c
> +++ b/xen/arch/x86/hvm/emulate.c
> @@ -2908,18 +2908,18 @@ void hvm_emulate_init_per_insn(
>  void hvm_emulate_writeback(
>      struct hvm_emulate_ctxt *hvmemul_ctxt)
>  {
> -    enum x86_segment seg;
> +    struct vcpu *curr;
> +    unsigned int dirty = hvmemul_ctxt->seg_reg_dirty;

... is the order of these two possibly relevant? Yet of course it's not the
end of the world whichever way it's done.

> -    seg = find_first_bit(&hvmemul_ctxt->seg_reg_dirty,
> -                         ARRAY_SIZE(hvmemul_ctxt->seg_reg));
> +    if ( likely(!dirty) )
> +        return;
>  
> -    while ( seg < ARRAY_SIZE(hvmemul_ctxt->seg_reg) )
> -    {
> -        hvm_set_segment_register(current, seg, &hvmemul_ctxt->seg_reg[seg]);
> -        seg = find_next_bit(&hvmemul_ctxt->seg_reg_dirty,
> -                            ARRAY_SIZE(hvmemul_ctxt->seg_reg),
> -                            seg+1);
> -    }
> +    curr = current;
> +
> +    for_each_set_bit ( seg, dirty )
> +        hvm_set_segment_register(curr, seg, &hvmemul_ctxt->seg_reg[seg]);
> +
> +    hvmemul_ctxt->seg_reg_dirty = 0;

Why is this suddenly appearing here? You don't mention it in the description,
so it's not clear whether you found a (however minor) issue, or whether
that's purely cosmetic (yet then it's still an extra store we could do
without).

Jan


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 16:25:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 16:25:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784255.1193656 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siz0I-0003HT-6N; Tue, 27 Aug 2024 16:25:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784255.1193656; Tue, 27 Aug 2024 16:25:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1siz0I-0003HM-3W; Tue, 27 Aug 2024 16:25:10 +0000
Received: by outflank-mailman (input) for mailman id 784255;
 Tue, 27 Aug 2024 16:25:08 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1siz0G-0003HG-GN
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 16:25:08 +0000
Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com
 [2607:f8b0:4864:20::732])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id eb652d90-6490-11ef-99a0-01e77a169b0f;
 Tue, 27 Aug 2024 18:25:06 +0200 (CEST)
Received: by mail-qk1-x732.google.com with SMTP id
 af79cd13be357-7a1d81dc0beso348838385a.2
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 09:25:06 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a67f343cd3sm566129185a.49.2024.08.27.09.25.02
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 09:25:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eb652d90-6490-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724775905; x=1725380705; 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=VwWHCm+eBlPvfIrLooLg3X6MncqBg8z1Y9NJkKavlew=;
        b=m8KcZNrgYm05kHxyHjtd9lLv8vB/3S5q03z8QDn4va3UKuv69IRhLZZjbUplL2KFRb
         EXFsDSCnyDlRaoQeZOEDyIERNm6ItjIQAamyvMXGho2ek7Pt2yZd+VFWB0JI0j9PcSr9
         FkPEP5pe4hg/Pz15hyBy+f44aVMr1BfDKopKQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724775905; x=1725380705;
        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=VwWHCm+eBlPvfIrLooLg3X6MncqBg8z1Y9NJkKavlew=;
        b=jbC9VV6kyHoJ84a1+DRwWFPigsvI/jPFM0UKZAcj3aEZXBXpZISVZgXZoXx5wrNPal
         SssxWyIW30rfrUjuiYhqag5W2sPJunuXtX1PeA/Or8ZlSpPmZgWcWzABuYnIIJC24D0/
         XAaRLub5dkYilee7pYQP5LPHSFopPGTMZq6AokKz0QMHjMy7/1d2v2cq6sIoLjbZ41bC
         bXT00QdBX/gVjXm8c+g8334K4kK7jjj2BBi9oZEaJxkWXm+EWJO/S+IOcU2L4w7z9Hug
         UxTro4Y1jrQ5BICZzBH0Bt9Qaw3cCJveY5wp6ZWZ5aU0Qbwx+JW9/fY7+wi6Ha9fwdDK
         CTYw==
X-Gm-Message-State: AOJu0Yy0RhoAvHmcjHtE9hiZtj8QgJZVPGbJuqU1107fNiv6sjbJEt1B
	5MXTjMjOJCNPJ56bhifCwgpKKXpVQXj2vSjscCkmR87a9DrATxAW8hakWDkDlCge2u5gqgh4EDA
	l
X-Google-Smtp-Source: AGHT+IHkp0qglFpU0T6x0lkXtRYsQO/kWxkxZM5DQloG90VQomMYgzYVceaj04bjOog0HTcygnGrVQ==
X-Received: by 2002:a05:620a:1994:b0:7a1:e30b:dd06 with SMTP id af79cd13be357-7a689701c85mr1682008685a.25.1724775904569;
        Tue, 27 Aug 2024 09:25:04 -0700 (PDT)
Message-ID: <a1d3dca7-6a41-4350-9cce-bb2985842664@citrix.com>
Date: Tue, 27 Aug 2024 17:25:00 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 4/4] x86/vmx: Rewrite vmx_sync_pir_to_irr() to be more
 efficient
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Jan Beulich <JBeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Julien Grall <julien@xen.org>, Volodymyr Babchuk
 <Volodymyr_Babchuk@epam.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
 <20240827135746.1908070-5-andrew.cooper3@citrix.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20240827135746.1908070-5-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27/08/2024 2:57 pm, Andrew Cooper wrote:
> There are two issues.  First, pi_test_and_clear_on() pulls the cache-line to
> the CPU and dirties it even if there's nothing outstanding, but the final
> for_each_set_bit() is O(256) when O(8) would do, and would avoid multiple
> atomic updates to the same IRR word.
>
> Rewrite it from scratch, explaining what's going on at each step.
>
> Bloat-o-meter reports 177 -> 145 (net -32), but the better aspect is the
> removal calls to __find_{first,next}_bit() hidden behind for_each_set_bit().
>
> No functional change.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien@xen.org>
> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
> CC: Bertrand Marquis <bertrand.marquis@arm.com>
> CC: Michal Orzel <michal.orzel@amd.com>
> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>
> The main purpose of this is to get rid of bitmap_for_each().
>
> v2:
>  * Extend the comments

FWIW, Gitlab CI has gained one reliable failure for this series (which
includes the hweight series too, because of how I've got my branch
arranged).

It is a timeout (domU not reporting in after boot), and as it is
specific to the AlderLake runner, it's very likely to be this patch.

I guess I need to triple-check the IRR scatter logic...

~Andrew


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 17:00:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 17:00:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784268.1193666 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sizXx-0001Tq-OE; Tue, 27 Aug 2024 16:59:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784268.1193666; Tue, 27 Aug 2024 16:59:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sizXx-0001Tj-LN; Tue, 27 Aug 2024 16:59:57 +0000
Received: by outflank-mailman (input) for mailman id 784268;
 Tue, 27 Aug 2024 16:59: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=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sizXw-0001Td-MJ
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 16:59:56 +0000
Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com
 [2607:f8b0:4864:20::1131])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c8a2ebf6-6495-11ef-a0b0-8be0dac302b0;
 Tue, 27 Aug 2024 18:59:55 +0200 (CEST)
Received: by mail-yw1-x1131.google.com with SMTP id
 00721157ae682-68d30057ae9so51243547b3.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 09:59:55 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6c162db0ba1sm57869896d6.99.2024.08.27.09.59.53
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Tue, 27 Aug 2024 09:59:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c8a2ebf6-6495-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724777994; x=1725382794; 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=S6TKN26a3+uGV/BpJ6ms3tGe7DA41dy80mMbv9n0IWc=;
        b=Mn/YVxHGR9AAESOI78fKqF8VpijQsIwGvXKC9nUip2blEDcBrsEJIqXI2lX7b+ocph
         htSjfMAwHrKN1BrI9ts0qFORkAMX8XNSn96OKturimFjEh8w9H9aHm5yrJaXiHDMpIxp
         7xQq0qgwSqFEj+ZhElRL5coa8a3d2kJuLBsiQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724777994; x=1725382794;
        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=S6TKN26a3+uGV/BpJ6ms3tGe7DA41dy80mMbv9n0IWc=;
        b=mDPJuGdraqdzffzKWy3BGhSTkNC8SiwL7mDoGyfwUTLFNyuVGA13wrPFvxuRwENNLt
         9/BaBbM1cNecHodhH1a+G14iXo0of1krNwUVM+PitHnM4A0OwTiUUaZVN8cipvWF2xZG
         WQjKQDDNPXhBAhkCkwbUmJ2Fd+MReRm9bREFVa0hCl0hsTrTxxuZUfPe6WsA6pPf/9lm
         ACR89lickvrSI77Dg+T0fAuws3jHRlD52dZlkloWK2oxn1Xvwsm9Kd/ZyjAW66XqWpPT
         M+PFLbDNohsw3BuVQIldvVQCLIejtqOQggOTymVFzgLvRc78n58yTltnjuHGlTsQslBf
         TMlw==
X-Forwarded-Encrypted: i=1; AJvYcCV4f7cC5qEGXluWHWtuTZ+iDLxUKYZLdSd4hG+5BFQ1SS7Gvv9/zTMU+iZpK5JD1dEeT7YpzoLNv7Q=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yyd8rMjpGMGB6i9ulwgZ8f8TP/LFxPa3YeqouKo+hM4YuTJ3pUF
	nWR4pomoBtOQsAPvfQUL9pX9NhofLonOHy2ufsR5dtwSvPD9acU/99UYBO6ne4c=
X-Google-Smtp-Source: AGHT+IG3yX6sDeuehEKTcwnYQmafNVXUshoYjfs6SYb5xaA+zpxiOHe0y3yVjOoGUst97lIfsSqACw==
X-Received: by 2002:a05:6902:1588:b0:e11:7858:9478 with SMTP id 3f1490d57ef6-e17a8acbe0dmr17458331276.22.1724777994441;
        Tue, 27 Aug 2024 09:59:54 -0700 (PDT)
Message-ID: <310cfc10-043c-4bb9-89e9-3d9bfc6e80ac@citrix.com>
Date: Tue, 27 Aug 2024 17:59:51 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86emul: drop further Xeon Phi decode leftovers
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <9043d8bd-ad98-4de1-ac52-70f8e4daf14a@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <9043d8bd-ad98-4de1-ac52-70f8e4daf14a@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 27/08/2024 12:24 pm, Jan Beulich wrote:
> Special casing in x86emul_decode() can be dropped, while overrides done
> in decode_0f38() can move into ext0f38_table[]. That table's S/G
> prefetch entries aren't needed anymore either.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 17:15:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 17:15:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784275.1193676 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sizmP-0004h3-TQ; Tue, 27 Aug 2024 17:14:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784275.1193676; Tue, 27 Aug 2024 17:14:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sizmP-0004gw-Q6; Tue, 27 Aug 2024 17:14:53 +0000
Received: by outflank-mailman (input) for mailman id 784275;
 Tue, 27 Aug 2024 17:14:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sizmP-0004gm-1m; Tue, 27 Aug 2024 17:14:53 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sizmO-0003HB-Rz; Tue, 27 Aug 2024 17:14:52 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sizmO-0006UN-8j; Tue, 27 Aug 2024 17:14:52 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sizmO-0000JU-8F; Tue, 27 Aug 2024 17:14:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=F0BmkXotRDHUqSfRZwQAeqOXj+MMo6q+FF3lK2zJ7iY=; b=5v29Yb/c7PPTN98vfiA1TAsCsO
	WfCFLGb+p52Ata++zW3a272AJupzt/LAFIb0TdZeyaYZmFuSJpqpVWVSRsalSuPIywbcn5Zc3/MW3
	k8IknJj9oxtWgC6QQBqEfvRRk5Hde/8IFCjuif/auqJC1R+4c9sn70w/VSL59kVvS1eY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187358-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187358: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=3e9bff3bbe1355805de919f688bef4baefbfd436
X-Osstest-Versions-That:
    linux=5be63fc19fcaa4c236b307420483578a56986a37
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 27 Aug 2024 17:14:52 +0000

flight 187358 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187358/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187342
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187342
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187342
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187342
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187342
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187342
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                3e9bff3bbe1355805de919f688bef4baefbfd436
baseline version:
 linux                5be63fc19fcaa4c236b307420483578a56986a37

Last test of basis   187342  2024-08-25 16:14:04 Z    2 days
Testing same since   187358  2024-08-27 05:11:06 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Christian Brauner <brauner@kernel.org>
  David Howells <dhowells@redhat.com>
  Ed Tsai <ed.tsai@mediatek.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Zhihao Cheng <chengzhihao1@huawei.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   5be63fc19fcaa..3e9bff3bbe135  3e9bff3bbe1355805de919f688bef4baefbfd436 -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 18:22:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 18:22:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784302.1193697 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj0pr-0008FG-U3; Tue, 27 Aug 2024 18:22:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784302.1193697; Tue, 27 Aug 2024 18:22:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj0pr-0008F9-Ra; Tue, 27 Aug 2024 18:22:31 +0000
Received: by outflank-mailman (input) for mailman id 784302;
 Tue, 27 Aug 2024 18:22:30 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj0pq-0008Ez-MZ; Tue, 27 Aug 2024 18:22:30 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj0pq-0004V8-HV; Tue, 27 Aug 2024 18:22:30 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj0pq-0008C9-24; Tue, 27 Aug 2024 18:22:30 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sj0pq-0004gr-1d; Tue, 27 Aug 2024 18:22:30 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=+ddB/Qesz6vJJRZUQEZfcsBplp3GLNcWSK4tDFbFNp8=; b=prsQS7hXMtjjgIhLk4gq4jvz02
	QOE9pa20Jl88zJNKXO3oxcLrM7mqMqbqV1QvHEjyaZ0FMBxThK1PtexRR6eefIxKECMgOUpup4b6A
	+pr34QKQ+HEUkKgM6R3QwDFtxEE/lJz4y0FLjG0uDlL+q8KoraBpUJn3IV5SffKN/sPQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187364-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187364: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=b2a431868c4ae0ad99def0a504d2fe097e16cd4f
X-Osstest-Versions-That:
    ovmf=efaf8931bbfa33a81b8792fbf9e2ccc239d53204
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 27 Aug 2024 18:22:30 +0000

flight 187364 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187364/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 b2a431868c4ae0ad99def0a504d2fe097e16cd4f
baseline version:
 ovmf                 efaf8931bbfa33a81b8792fbf9e2ccc239d53204

Last test of basis   187363  2024-08-27 13:15:02 Z    0 days
Testing same since   187364  2024-08-27 16:43:23 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Oliver Smith-Denny <osde@linux.microsoft.com>
  Oliver Smith-Denny <osde@microsoft.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   efaf8931bb..b2a431868c  b2a431868c4ae0ad99def0a504d2fe097e16cd4f -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 20:54:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 20:54:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784355.1193708 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj3Cu-0006zB-As; Tue, 27 Aug 2024 20:54:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784355.1193708; Tue, 27 Aug 2024 20:54:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj3Cu-0006z4-8I; Tue, 27 Aug 2024 20:54:28 +0000
Received: by outflank-mailman (input) for mailman id 784355;
 Tue, 27 Aug 2024 20:54:26 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj3Cs-0006yu-8t; Tue, 27 Aug 2024 20:54:26 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj3Cr-00071T-Vb; Tue, 27 Aug 2024 20:54:25 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj3Cr-00055e-J2; Tue, 27 Aug 2024 20:54:25 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sj3Cr-0008PT-IW; Tue, 27 Aug 2024 20:54:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=RTlW1xlgGi2Qha9XeCro1sx1b/QioW3hxRYz2laniOo=; b=hDoXifzuqhePDEa2yk3S1Piyc5
	xRYru+C3VMC4g4xXa2zSl5qgxCMccse2JUgdSNpH6Z1Kkc/1sirgsDPYx4YVyHmlmlnxgf6sUBqPq
	zOa7d+f0NFuHnB+RTlZvDYSrl4mZbYNd52cjAbC8gULDam3QEeJai1O2QMbiZY4IBMkk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187365-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187365: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=9429f1a6c4758ae91f3ae721a036f4bbf76fb2b8
X-Osstest-Versions-That:
    xen=b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 27 Aug 2024 20:54:25 +0000

flight 187365 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187365/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  9429f1a6c4758ae91f3ae721a036f4bbf76fb2b8
baseline version:
 xen                  b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b

Last test of basis   187349  2024-08-26 09:02:10 Z    1 days
Testing same since   187365  2024-08-27 18:02:19 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Frediano Ziglio <frediano.ziglio@cloud.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   b8cdfac2be..9429f1a6c4  9429f1a6c4758ae91f3ae721a036f4bbf76fb2b8 -> smoke


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 21:19:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 21:19:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784366.1193717 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj3bQ-0002m5-7l; Tue, 27 Aug 2024 21:19:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784366.1193717; Tue, 27 Aug 2024 21:19:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj3bQ-0002ly-5J; Tue, 27 Aug 2024 21:19:48 +0000
Received: by outflank-mailman (input) for mailman id 784366;
 Tue, 27 Aug 2024 21:19:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj3bP-0002lo-51; Tue, 27 Aug 2024 21:19:47 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj3bO-0007Rw-Tr; Tue, 27 Aug 2024 21:19:46 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj3bO-00061b-HA; Tue, 27 Aug 2024 21:19:46 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sj3bO-0002PZ-Gb; Tue, 27 Aug 2024 21:19:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ysZ8wpqKR8z6yYwhRzEglC277VmFSkovYwO2CLpLAMU=; b=iskbSQDAeWf/XkjGDgaG42Tob2
	JezRj2DlSw+CQg8pK9rDKrAdMCd6Opx87byI/Uf20AkBcUfBQnochqHrJ/9Zx+cHQu6LJ2JYj+oNM
	/ObV4rjn1OM49jHEamrmUWk0QxN/D0u3HlJHNY7evccAPu8RonkuunELSldvEWaGrHqI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187367-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187367: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=a0594ca403e77f68b317cc15b9b5c6b39e36e0fb
X-Osstest-Versions-That:
    ovmf=b2a431868c4ae0ad99def0a504d2fe097e16cd4f
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 27 Aug 2024 21:19:46 +0000

flight 187367 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187367/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 a0594ca403e77f68b317cc15b9b5c6b39e36e0fb
baseline version:
 ovmf                 b2a431868c4ae0ad99def0a504d2fe097e16cd4f

Last test of basis   187364  2024-08-27 16:43:23 Z    0 days
Testing same since   187367  2024-08-27 19:13:21 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  dependabot[bot] <support@github.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   b2a431868c..a0594ca403  a0594ca403e77f68b317cc15b9b5c6b39e36e0fb -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 22:08:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 22:08:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784376.1193728 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj4Lz-000292-Fj; Tue, 27 Aug 2024 22:07:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784376.1193728; Tue, 27 Aug 2024 22:07:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj4Lz-00028v-Cf; Tue, 27 Aug 2024 22:07:55 +0000
Received: by outflank-mailman (input) for mailman id 784376;
 Tue, 27 Aug 2024 22:07:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj4Ly-00028l-8e; Tue, 27 Aug 2024 22:07:54 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj4Lx-0008FA-Pk; Tue, 27 Aug 2024 22:07:53 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj4Lx-0007j9-DT; Tue, 27 Aug 2024 22:07:53 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sj4Lx-0006wa-D1; Tue, 27 Aug 2024 22:07:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=NYRgp07n6NjBEQD1Vm0UGGFH6NwX3w3RiQbzuqU/C+I=; b=WbKao+g06S0JDfzbfGE/1ZjlxO
	sNF6hq5cguMQ1IbTpMI+QjlWJJBPkTy85vkUyKJrWGe1v5rthxNeogmlmt7dV35z7SxmFUw8Z+SIV
	Wh2m8NDCGyo+SlxSSE8PiGNWUzBLclEj1ZI2P0vSe99PTtVIvn6vA7heYyWLxy0wxKeQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187360-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187360: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=afaee42f777bc359db95f692804f7fc7e12c0c02
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 27 Aug 2024 22:07:53 +0000

flight 187360 qemu-mainline real [real]
flight 187370 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187360/
http://logs.test-lab.xenproject.org/osstest/logs/187370/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass

version targeted for testing:
 qemuu                afaee42f777bc359db95f692804f7fc7e12c0c02
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  355 days
Failing since        182723  2023-09-07 18:19:05 Z  355 days   37 attempts
Testing same since   187360  2024-08-27 06:16:18 Z    0 days    1 attempts

------------------------------------------------------------
621 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 181112 lines long.)


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 23:26:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 23:26:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784397.1193738 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj5a8-00078e-1U; Tue, 27 Aug 2024 23:26:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784397.1193738; Tue, 27 Aug 2024 23:26:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj5a7-00078X-Uu; Tue, 27 Aug 2024 23:26:35 +0000
Received: by outflank-mailman (input) for mailman id 784397;
 Tue, 27 Aug 2024 23:26:35 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4Ve6=P2=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1sj5a6-00078R-TM
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 23:26:34 +0000
Received: from NAM10-BN7-obe.outbound.protection.outlook.com
 (mail-bn7nam10on2060d.outbound.protection.outlook.com
 [2a01:111:f403:2009::60d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cab413b3-64cb-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 01:26:32 +0200 (CEST)
Received: from SA9PR13CA0129.namprd13.prod.outlook.com (2603:10b6:806:27::14)
 by CH3PR12MB8236.namprd12.prod.outlook.com (2603:10b6:610:121::6)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Tue, 27 Aug
 2024 23:26:28 +0000
Received: from SA2PEPF000015C8.namprd03.prod.outlook.com
 (2603:10b6:806:27:cafe::47) by SA9PR13CA0129.outlook.office365.com
 (2603:10b6:806:27::14) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.14 via Frontend
 Transport; Tue, 27 Aug 2024 23:26:28 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SA2PEPF000015C8.mail.protection.outlook.com (10.167.241.198) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 23:26:27 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 27 Aug
 2024 18:26:23 -0500
Received: from [172.20.38.216] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Tue, 27 Aug 2024 18:26:22 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cab413b3-64cb-11ef-99a0-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=XzmvOz2sK11Eh/Li18zb+FTsHZ4KbeCFMwaQpOGCCnWERhrh4VNMadN6lPrvrUhOllnt7BDchX/XDFC+1Mo3n6otZouUTPTIefSC/i9BzMxz3bZVr24EVoD6Uhc6K817y0qFkEAtVRt6N3uD0tufZUl7gchTXJ2k6vCOaPy5kOwlkgDhT2FyeSh7HbLzyZCIyEKGBeCTJRXVrkpKdR8bYGRrYEqYdFmxMzIYukPmTA8TH4SJjpBwZYZ+m+26V+AalybmV3G/4/zjwmPGTHm+VuXvi/F62Sx3EkMTMjfRMetgmU4yYO2bWjcflWU1ota3P2pwYArFxILSCctV0h/asw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=64A3inMMlAXPkLih/Bn2MyMNi1I5lZpNECsr9i/D/6I=;
 b=sclBBYDvFRLxlPtCgJJIz55WbvGWs1alHjbtI6PoRXBdecZWcVETLv7PmPftsZaPrU3xUaSlmHRxBeI71Q35VlKwm/SGoVhVGfYdWSyq+CqNRJeJKQUsnxlAV8AGvib5VYgtN6OxGXu5mxVehYInhmk6+yCjEFite1c60cj72Ng7u2M2EhhoUu8dM/SphM7/i0Sa8qlKHDr1E0K97+6mTwm9/EFsruUITdcZMfQej1REsA1tG53pJfl6+VYCJ0qoVd5UG4uJP1LV62Cz/wxfrHEm9f/l4HmtiLDMX5JWaBz17/al96pcMRgtdAPLX2E+B+p4kSI0BtVxaVUOCse/PA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=vates.tech smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=64A3inMMlAXPkLih/Bn2MyMNi1I5lZpNECsr9i/D/6I=;
 b=APmFbytcv5RPPz6LxNTNB+IS1LbDJc219d+p8v+nwQLggKUEq8BT40EM6XMYbfK7egt7h0WWdd2SyGbkwS+fKWejzyIioQbWIyETadqGyMWnKjKQnMWjTSmh6GldVVh/x+Qpzl+3hTr9z3o1iMZyQ8X296hLBh84/WzpBG5ptKg=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <ebef6a88-abae-4e9a-8f9f-56eddb5a569c@amd.com>
Date: Tue, 27 Aug 2024 18:17:05 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH 1/3] libxl: Implement QEMU command line probe
To: Anthony PERARD <anthony.perard@vates.tech>,
	<xen-devel@lists.xenproject.org>
CC: Anthony PERARD <anthony.perard@citrix.com>, Juergen Gross
	<jgross@suse.com>
References: <20240827100328.23216-1-anthony.perard@vates.tech>
 <20240827100328.23216-2-anthony.perard@vates.tech>
Content-Language: en-US
From: Jason Andryuk <jason.andryuk@amd.com>
In-Reply-To: <20240827100328.23216-2-anthony.perard@vates.tech>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB03.amd.com: jason.andryuk@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SA2PEPF000015C8:EE_|CH3PR12MB8236:EE_
X-MS-Office365-Filtering-Correlation-Id: f13a5ead-a97e-4956-2afe-08dcc6efacd8
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|376014|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?UGYya0xoeXJlMTBqWTJyUzlLVjhWdjkxOFByeGJsdWVvL21VZWY5RFU4aXBa?=
 =?utf-8?B?dTQwaHJZanJkeXREd2FFM1ZGNEhzZCtEbEExbi9wRE5IaHpyOGNnL2ZhQVFq?=
 =?utf-8?B?eWdaVEw4elE1YmhVTXhTdW13ZUVCMEVWN2FQeVFZbUViQnlsNEpSTEZBWkdt?=
 =?utf-8?B?K2JrVWpnTE44eGtaZjdlVmNITzhoWWREd3FxR0I5S1pjSHBTUURsTDZHdGNM?=
 =?utf-8?B?VkZ5NDlNZXRrY0ZzbVFZd3dUZVVTb0YrZ3hXV2pLQWNJa3I0cTZsMllvSDdD?=
 =?utf-8?B?bUFIOHhyalFnTzZLd0p4SXBvc2hmbkRFRzBLbnI1Nm5kZ0huUDBEeitURVl6?=
 =?utf-8?B?NlFDK01ZS28wNlBHT2xOU0dybXlUUWhLa0FXVUQ4QXo2dit4dzRnUHVoQ1FG?=
 =?utf-8?B?Wmx5TlR4ajJMYlQrSjh5eXB5V2pCZWJ5UmhKN0UwMWZPR0RPQ1poRU1GVU9O?=
 =?utf-8?B?RFEvb0JtVHN3S1A5NzVvd3RjT1ZnY0JUajk5NHNpVHVaSFNZa2tlcjVpWGx0?=
 =?utf-8?B?eDROcXdzbGxteUJLdFdTSUNDZ3p3TjdQRjdoU0NXWXVLdjR5ZGdpR3FvUTNa?=
 =?utf-8?B?NjVncUc4WGR0L0t0aEQ2aFJoT2F4bXpZMTQ0ckZPTFAvRGt5VW9neUVOc250?=
 =?utf-8?B?Znd4em1wbDRraGd4SFA3Rm8xeGR6QzFDVFJNUGR5TS8rUFFKN3oxWGxwWDlY?=
 =?utf-8?B?VlVtT1IwSGlITjdnaU5PdDczQm4rOFNlNlQ5dG9JOHcwY3VEbThuTUY5aVox?=
 =?utf-8?B?UlJZUjd2SHRsTy92RUZVVFRpSDRDbksvbGlleEFpRTd2N1BFL2VCMlQ4ejY5?=
 =?utf-8?B?MjRQOXV5cHk0bExielFqTi9ZWjl1QnNFaVVzRGJiTWNkSmZ3WXFZRWZWMFhZ?=
 =?utf-8?B?ZHhTc2k4V0JlUjZDNkZUcnhqT0ZjcUpEYXUvcFdwVmRuT1BTNWw5T2tMTC8w?=
 =?utf-8?B?OXJlZE8wOXQwaDFlYUxmMDg4YTFWdnhGS0tPK3BvV2UweUQvalN2bStQS1VG?=
 =?utf-8?B?K2Q0a0RVUVFSV1NQQzFZSWNiZXRpQWttMVFzL1RqNXlJaU9SZFQ0ZmhHMnlt?=
 =?utf-8?B?cEpJNW1iR1RNK2ZWdjFXOW5KUkc2VFJHNkFoeW1MWjBmY1VPZFZibXRjMDJF?=
 =?utf-8?B?S0h3SjFlUnM3M2J1Z21UR01FUWRhTk5PZ3dOTVl1Sm1KdjEwMGZGdzZ5QnU2?=
 =?utf-8?B?d3hxcS9MU2RVNnV3OGphR2dGL0h5bndLUEU4UVhIMlc5SmZJNmxTR200UStE?=
 =?utf-8?B?QjVaaWp4UlU3WUJaeEswa0I3UGxuRS9IQk5SekR6U2tMbC92YmhKb3IwWk94?=
 =?utf-8?B?SUw2amwyTm1WT25wM3RWQURuSHNpQ3RYOTJZNGRES3VDU0l2RGttMTZjMHBK?=
 =?utf-8?B?S2JKUEhZSXU5Z2xEekc1U29iemV1a3lRMCtGWDArMUl4YWVZSHNGT3FCaE0y?=
 =?utf-8?B?UTlqeko4YTRvRTZBY3M1U2tiekxocjdJazM3Vis0RFdEa1VEa0xqMTRsUzVO?=
 =?utf-8?B?cEw4QkJBWXUwcGRPTVZlZ2RGcmNOZkJtT3AwT1NYbG9JUkxOYWZJYXQ1U1dl?=
 =?utf-8?B?eTdPOVplMkpNT3BrRW1SREc1SEJtOThaZ25OSjdra1lBQkpaek8xVTlBOTRs?=
 =?utf-8?B?NlRXTzlEaEs3WjNlZFcwMmpPV0Y5WUNEK0J0K3NJeU1VN0ovRmViS0xKN1g1?=
 =?utf-8?B?L0kwK3VGNDVwNjFSTHVYYzNzQUVpdFI0TFJjNXpXd1VFcW05K1lrOXNDaDlz?=
 =?utf-8?B?dE9CQTQyVVpoOGNXQ3JmR2lhUEo0bUlvd1VPbVZUM1ptbGhqVjhyeXdFalRD?=
 =?utf-8?B?SEFZTHMzVGZ0KzZmNDg4VVJlSlN6ZGZGbmtFM1ViT1hnRWQwQlpWaTkvSDZT?=
 =?utf-8?B?Y2M2am1BQWhWOWdvNVV4UlFUSHg0WVFIbzV5SHd6bGQ5OUNDei9jeEY5R09k?=
 =?utf-8?Q?mRefWtHIxyV5ZKuVpYtXtb34iMVMpBme?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 23:26:27.8317
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: f13a5ead-a97e-4956-2afe-08dcc6efacd8
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SA2PEPF000015C8.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8236

On 2024-08-27 06:03, Anthony PERARD wrote:
> From: Anthony PERARD <anthony.perard@citrix.com>
> 
> Starting with QEMU 9.0, the option "-chroot", that we use for the
> "dmrestrict" feature, is removed. We need to find out which to use
> between "-chroot" and "-run-with chroot=dir".
> 
> This patch implement the machinery to spawn QEMU, and to run the QMP
> command "query-command-line-options" but doesn't yet look at the
> actual result. Whether or not to use "-run-with chroot=dir" will be
> implemented in a follow up patch.
> 
> The command line used to spawn the qemu we want to probe is mostly
> similar to the one we already use for the device model, "-machine
> none" comes from libvirt.
> 
> This patch implement the probing on qemu-xen, even if we probably not
> going to use the result. We could check the feature wanted for the
> domain been created, but this could get complicated fairly quickly.

"domain being created"?

> We already need to check the options "b_info->dm_restrict" for
> "-chroot" and "state->dm_runas" for "-runas" (which is deprecated).
> 
> Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>

Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 23:30:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 23:30:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784403.1193747 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj5dV-0008Je-GV; Tue, 27 Aug 2024 23:30:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784403.1193747; Tue, 27 Aug 2024 23:30:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj5dV-0008J3-DZ; Tue, 27 Aug 2024 23:30:05 +0000
Received: by outflank-mailman (input) for mailman id 784403;
 Tue, 27 Aug 2024 23:30:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4Ve6=P2=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1sj5dU-00080d-0N
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 23:30:04 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20625.outbound.protection.outlook.com
 [2a01:111:f403:2416::625])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 47de48ee-64cc-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 01:30:01 +0200 (CEST)
Received: from SN1PR12CA0087.namprd12.prod.outlook.com (2603:10b6:802:21::22)
 by CY8PR12MB7514.namprd12.prod.outlook.com (2603:10b6:930:92::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Tue, 27 Aug
 2024 23:29:56 +0000
Received: from SA2PEPF000015C7.namprd03.prod.outlook.com
 (2603:10b6:802:21:cafe::a0) by SN1PR12CA0087.outlook.office365.com
 (2603:10b6:802:21::22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24 via Frontend
 Transport; Tue, 27 Aug 2024 23:29:56 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SA2PEPF000015C7.mail.protection.outlook.com (10.167.241.197) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 23:29:56 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 27 Aug
 2024 18:29:55 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 27 Aug
 2024 18:29:55 -0500
Received: from [172.20.38.216] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Tue, 27 Aug 2024 18:29:54 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 47de48ee-64cc-11ef-a0b0-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=bpEXVivbMrgr1xopV2w6im3nHla5p84FMX+ITUkIR/0W+dkMU0vsJVxUiTOhQCbLZOBkifYFGpJHDejr2uKfUkRThu1LLrLgnYUI/c8weHJMz1csGmWGh746auyHZkI92kvclp4otB+/i5k3W+dvJgweRt5FcEzOdhXvmyj+FQnIyF1eN+gQETNk/Q//9AF7DTNYr6Y9otpQ3QDX0wRsbB6j0+m8kIscVPbsuYUW9QhtztLdwIrmiqsuxZTI7uRtE4tysk+S3+WdTb+xyIWKurUhX66pFf58zfZLFNOHhjonnz/jR1j9vacBTmOmoMIildVOJfSPOktxrl/VLik00Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=X62I4IbYL6Xjki2tP3l2iI9fd3dxz3v7Xh0Coq5tGaQ=;
 b=WJPsP6b9sd767y63DOUh9Ryr71UPTOPu4gUAXtEGMK5Rcugr9+uSYw/uQcS/n7P5qcMkvLQaRxxsA0WqtaDETW99ACJf7R53o9Fbn+m4SBeSTv8hhVWTiH9e8+AFn81DxrY1JLFUz9wRyEqpIsWcFfCli+XfRpeJdq6N5YzI88RdeXZ+4frxuwxyfvOI8XTSoYeR0Ry40AVucAZZVn2db2bKEePyG/SHGiISmeEs29wK2WgHoJTuHXePtWX7Z53MjXbSvKz9CPAfcrNJlee3+cAN2wJEhvyyOHL516bDBwWNKB+F4DTlD135LcHzjBM5g3jfOePity4+i+9FFMsH8Q==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=vates.tech smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=X62I4IbYL6Xjki2tP3l2iI9fd3dxz3v7Xh0Coq5tGaQ=;
 b=qO/7LfOQrFkN4P6jB3cb+WtesRWFunjL3q7RQqDelYaz2Ya3I18t+A2b64cXdjLy3hMY/gf9tsFNkAzWvv9Au6dfOzh3EPjk76aNoim5DmPucB9pPZBpU49888eHWX5r1uWpxpmU3omMyLkMgYcpLP12rNF82mbjKFIlnwCNOBw=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <8ab87d44-8a93-4468-b960-0c76c1e6a147@amd.com>
Date: Tue, 27 Aug 2024 18:20:42 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH 2/3] libxl: Probe QEMU for -run-with chroot=dir and
 use it
To: Anthony PERARD <anthony.perard@vates.tech>,
	<xen-devel@lists.xenproject.org>
CC: Juergen Gross <jgross@suse.com>
References: <20240827100328.23216-1-anthony.perard@vates.tech>
 <20240827100328.23216-3-anthony.perard@vates.tech>
Content-Language: en-US
From: Jason Andryuk <jason.andryuk@amd.com>
In-Reply-To: <20240827100328.23216-3-anthony.perard@vates.tech>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB05.amd.com: jason.andryuk@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SA2PEPF000015C7:EE_|CY8PR12MB7514:EE_
X-MS-Office365-Filtering-Correlation-Id: a6b6b294-846b-4f1c-1209-08dcc6f02931
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?Z0FLa0lrZXNaa3ZHdDJ5R25FYmZZQXpSTlRBSVg0VzZtWUZXWXFISGVvWDha?=
 =?utf-8?B?eTluSDlyb1lVVnNJRmIwMEFabHNIQkVwTmdHVTdwU21wTGp6bVVaYXI0dFkx?=
 =?utf-8?B?UG1QT0oxODhVNzh0ZThHU3V6ZW9hckNWbmpMemVad0NBR2VzZFB1Uy9WcE9j?=
 =?utf-8?B?OHdDQzIrdGI4VjBVc1dEbG41N2EzdVhRVHVLY0xURVBJUjFrcEUySXowaWZL?=
 =?utf-8?B?YnVYRHQybERGM2toRXg5ZDAwWkxZTTFMdEFLWUpNb3d5eGZ4UmtuWi9CaWlV?=
 =?utf-8?B?dVQvR1E5WXhRamZ3WVY1Y2haZFd0YVVvL1FrbUJnQ1NlMTBxYkp5WWpzZm5q?=
 =?utf-8?B?T2JDNmlxWnBSSTNuelRYWG5Ibnl2ckx6TzAzc3BZWEZEWWlROWJtcW9vVitW?=
 =?utf-8?B?cWwxUXYxUWgxUU82aXVLQ2EwV2UzRTdZQVhvNEd4QlIyNXppSDRQd3MrNXN1?=
 =?utf-8?B?ajU4WitBWlRNWnRQc2pjbGRWdzZtRjNzNS8vTE5LcmZNVnZtRmtqV1dVaGM5?=
 =?utf-8?B?Rm1XaDF6V2ZrcEJpbW0xazQrdzgyYlRJZjdTOEt0QWVOVE1WL29zV1lJWFVt?=
 =?utf-8?B?THFIdmdvZFoyVXVxclczbi9xNFRndkhLdHpseUFsc2RBT0JFU3dlZ0tnZ1NJ?=
 =?utf-8?B?Y011OEJ4Q2dMbi93ZnV4Sk1SZ2tKTkhnc1dHQzUrWEluVnpNY253Z3k1YTEy?=
 =?utf-8?B?QzdwZkQzQ0k1S1orcEZZSDhodHRSUk0wRHF2bndYKytaMkp1RURLVTdlRDUr?=
 =?utf-8?B?cVpCb05CZHliOFY0TGExOWtRQVJmRy81VkRKMzZhaG00YWZoVHFKM3NvLytz?=
 =?utf-8?B?TUk2TEduaVhhQ29ldTF6bzZ6MGlHTUNvTG1uZFg1OTdFcmh4VVN3cWd0aGRw?=
 =?utf-8?B?c1NGamRJNW1aUlFoQTBQZmZyRUoyUjRZTDhYUS9PS3gwSDFkdU5lVTlqdzU4?=
 =?utf-8?B?WUliZ1N6NVRQT0RYK3RkU2JlMUorU3hMK09Sayt5SVhaOE5PeFZ5WXIzczJV?=
 =?utf-8?B?OGNwU2liQ0d0NmtyNjNnenRsbExNVkxjQXNXUUxoWUVuNlZ5UDlJeEhJNFhn?=
 =?utf-8?B?ZFZab214SVpKcHgrZW50L2Nvb1N1Q0VPaU9GN1RGbFY0VWk1SFdoZHYyUXBt?=
 =?utf-8?B?OC9TWHdob1hHRE5vMHRKQ0FnWjFITHZFUkQyTHB3VUZxL1BnRm5GSlRSQjNy?=
 =?utf-8?B?aEE1bjVLRDl3Z1hVUGI5YXJ4QmFOT3dMRnhTMWVTeExndEdkM3JNVTkrQnlq?=
 =?utf-8?B?VkFKWXZWaHBEK3EzRzdiQ1FzaWRHQnd4MnN4eTRINDB5dEV0YkFnUWtaZDMx?=
 =?utf-8?B?UUR4VDVMK1BETFRJZXhOQjB0WlRya2xZL1BMb3dTUG5pMzRIVzFEN3JUdzZ4?=
 =?utf-8?B?T1BBUlIxdjQ4emV6OHFuQUhKa2xXOXp6T0VVRkpHb0VCdlVxS2VZZEhFVlgy?=
 =?utf-8?B?ay9kZnBtd3gzNjRRQmR4dlhzc25EMy85VDBCd1BsSEZ0aGg2UUlWY0JIMmQv?=
 =?utf-8?B?RTd4d2pFUW5UaGJkUHV6VXVOcGJ5RXlOT2t1ZGcweXNaQXVQdkhNMit0Tlc1?=
 =?utf-8?B?YWI4MlFRSncweUUzY3Y0SXdoN2ZnRzZBcnBzMXlPL0J4R1JmOEhXWm94aTNC?=
 =?utf-8?B?MzRxU0tZa0ExZXBWMTc2NGhBcnZGRmV0ODBTZWRBVjdqdElydlljclhEVGFz?=
 =?utf-8?B?OHoweUhtYkpwblFXbnpZcURLdWFwdzZhdTQ5bDI3SWFneGVRNFZHbVBiZTU2?=
 =?utf-8?B?bWF1Q3YyYmxQSzFzZm9oM2dHczJ3YzByRmFZRHJRcG9QUEpRTWpEdWJnUGNy?=
 =?utf-8?B?WmhFZkRpMEdldWxkNVRITzg1NHhNKzNUM2ZHMjJwOHovMEZzMkx6VnRnQXl2?=
 =?utf-8?B?WHlxTUxNdFA5NFNzd0Z0SVFOZWZsT3l4QVgvQkNtbXl3cDk5WDhXdTl4Vk1v?=
 =?utf-8?Q?2VJ57KYmIO10X3U6rIaxSWJstGae9y6T?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 23:29:56.4362
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: a6b6b294-846b-4f1c-1209-08dcc6f02931
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SA2PEPF000015C7.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7514

On 2024-08-27 06:03, Anthony PERARD wrote:
> QEMU 9.0 have removed "-chroot" command line option, which have been
> deprecated since QEMU 8.1 in favor of "-run-with chroot=dir".
> 
> Look into the result of the QMP command "query-command-line-options"
> to find out if "-run-with chroot=dir" is available. Then use it in
> place of "-chroot".
> 
> Resolves: xen-project/xen#187
> Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>

Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>

though one suggestion below.

> ---
>   tools/libs/light/libxl_dm.c       | 78 +++++++++++++++++++++++++------
>   tools/libs/light/libxl_internal.h |  5 ++
>   2 files changed, 69 insertions(+), 14 deletions(-)
> 
> diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
> index 46babfed0b..298fbb84fe 100644
> --- a/tools/libs/light/libxl_dm.c
> +++ b/tools/libs/light/libxl_dm.c
> @@ -1183,11 +1183,12 @@ static int libxl__pre_open_qmp_socket(libxl__gc *gc, libxl_domid domid,
>   }
>   
>   static int libxl__build_device_model_args_new(libxl__gc *gc,
> -                                        const char *dm, int guest_domid,
> -                                        const libxl_domain_config *guest_config,
> -                                        char ***args, char ***envs,
> -                                        const libxl__domain_build_state *state,
> -                                        int *dm_state_fd)
> +    const char *dm, int guest_domid,
> +    const libxl_domain_config *guest_config,
> +    char ***args, char ***envs,
> +    const libxl__domain_build_state *state,
> +    const libxl__qemu_available_cmd_line *qemu_cmdline,

cmd_line/cmdline makes me think of command line strings. 
qemu_opts/qemu_cli_opts is a little more generic, to me at least.  But 
not a big deal if you want to keep it as is.

Thanks,
Jason

> +    int *dm_state_fd)
>   {
>       const libxl_domain_create_info *c_info = &guest_config->c_info;
>       const libxl_domain_build_info *b_info = &guest_config->b_info;


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 23:30:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 23:30:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784407.1193758 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj5e7-0000dU-Ov; Tue, 27 Aug 2024 23:30:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784407.1193758; Tue, 27 Aug 2024 23:30:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj5e7-0000dN-MC; Tue, 27 Aug 2024 23:30:43 +0000
Received: by outflank-mailman (input) for mailman id 784407;
 Tue, 27 Aug 2024 23:30:42 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4Ve6=P2=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1sj5e6-0000bD-FW
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 23:30:42 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on2062b.outbound.protection.outlook.com
 [2a01:111:f403:2417::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5e985c50-64cc-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 01:30:40 +0200 (CEST)
Received: from SJ0PR05CA0114.namprd05.prod.outlook.com (2603:10b6:a03:334::29)
 by DS7PR12MB6336.namprd12.prod.outlook.com (2603:10b6:8:93::8) with
 Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.7897.26; Tue, 27 Aug 2024 23:30:34 +0000
Received: from SJ5PEPF000001CE.namprd05.prod.outlook.com
 (2603:10b6:a03:334:cafe::9c) by SJ0PR05CA0114.outlook.office365.com
 (2603:10b6:a03:334::29) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.14 via Frontend
 Transport; Tue, 27 Aug 2024 23:30:34 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SJ5PEPF000001CE.mail.protection.outlook.com (10.167.242.38) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Tue, 27 Aug 2024 23:30:33 +0000
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Tue, 27 Aug
 2024 18:30:33 -0500
Received: from [172.20.38.216] (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Tue, 27 Aug 2024 18:30:32 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5e985c50-64cc-11ef-99a0-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=ymLInvb+FkeGt0tC7yp8QX31F2NSbbyQEhe6wC18NGcyO6r7LzagsNFLDXgLH8VJp/ob6sHMwO6D1nSSpMcoKB1zE5m0P287LryV9X/f9MKwD120cjJKoAJNtBsqfICBfCsXT1cZPl53P4gU8+IijL0tB1YZwI/Q/rBGjy71Z4J4cPUQYCRmEUbrfP/dvZVpIO+u/pU/CpRM9okM1EvR/HG2PPuIKodNwvP7X3qegL3SEwPAdyfixTENaVVbNqPIpPVn0c8mNpm+Yke92C7iMYHnaMRGcwxwjYQ68dYhRX8D4HY2rOYrpnz8X5pp+pZU3ZlSRlSvgVImN60GzfXS9Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=INOrIyZO8CY39NcCWMaX/aB9X6CxLn4T4ltdcqwUqbk=;
 b=DoGk8gEG78Kk5QmtRLxuH1WZCTbqTg274rgdgz+t67Nsp8DBSIOumuvii+xwmxk6f0MZXordU6jz3gASFZGaR/7qkGNOtJYQVonYPuH5zevN706CkrFnEl6EC8IO/WrNQvCCvII15ueyKmFfkepZosC3d5XDUWm/KcUq2UNK9sVCVZ+pdRO8HOUQByzpuVHQS7sIdslVQSqSWPwj5ohkvxoI4Ekss3CkjmiE7owDpYIetp+e9cMFJXei6B9zkNT6jLmUPHsbjlf0ugzzwgGhfb2oc/FoeEfKCopGcfqi0lo8pQlTKH9KwA+Z+GUkxptizetdrUQSw7ctMq/2z1dc5A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=vates.tech smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=INOrIyZO8CY39NcCWMaX/aB9X6CxLn4T4ltdcqwUqbk=;
 b=FrWoeTbLTjmxwGHwCpWTBOU3MWTgpadjti9e3+pgoPeONPnPkKy7hsPt5WfWKmlYwBNFn8Ctm75CSQZ3rgcYnhPEJj8QeV8BAYDEy7AknrNtsfpqqthsqi/1gdzax6ajsikiuiMaKfl29Hkgo80wv1yqeEqtNOrj/eQfDaR8UAA=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <bb9fc13b-76a7-4109-98bb-725d903de3dd@amd.com>
Date: Tue, 27 Aug 2024 18:21:20 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH 3/3] libxl: Probe QEMU for -run-with user=user and use
 it
To: Anthony PERARD <anthony.perard@vates.tech>,
	<xen-devel@lists.xenproject.org>
CC: Juergen Gross <jgross@suse.com>
References: <20240827100328.23216-1-anthony.perard@vates.tech>
 <20240827100328.23216-4-anthony.perard@vates.tech>
Content-Language: en-US
From: Jason Andryuk <jason.andryuk@amd.com>
In-Reply-To: <20240827100328.23216-4-anthony.perard@vates.tech>
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB03.amd.com: jason.andryuk@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001CE:EE_|DS7PR12MB6336:EE_
X-MS-Office365-Filtering-Correlation-Id: 3267ce94-e8f0-4762-5939-08dcc6f03f77
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?YUo0cHBHdWFUUmFFVkg0ai94ZnJSZVF2TDNPZytIejBIT0YxU1ZoWlk4dSs5?=
 =?utf-8?B?ejFBdXcrWnZHRHF0SmZaNWRKU2NCRDkwcll5WXNoYXR0TFJCTkhkbUFiOU01?=
 =?utf-8?B?aWgyTGFNTXphUFJ0WE1TdVlEV09CcnhoSHZCbTRoalJpVlo0YUg3U3lEZ3lN?=
 =?utf-8?B?NHZnRUlQWExrd1pacjNHVFV1YWFiZXJzaHFLZmFwL3RRNFFmTk93TXR0elNF?=
 =?utf-8?B?VDZWWmpvMmhMemZ2RGJKRmZPb0lkcGtvdGNKaHZpbVYxQytBdStIQmxuZkFV?=
 =?utf-8?B?OTRIWU9Ic3haY01saUcwZWhvY3J6cG91M2RwbXZOcEdNMzNOeDlWY3BKbUlJ?=
 =?utf-8?B?czB4dnBBNlVrd2w5NFZqREUyZVk1WEFzTHJRLy94SURkTm5xdzdSU0x4bExQ?=
 =?utf-8?B?QUtrejhMOG5vbEM3aUJmUHVuVnl4UHB6ZmxQV242MFJ1QWJRZ3FhWEdXekZt?=
 =?utf-8?B?QTkrTk1SOXcrb0xEbGI4ZjVxT3pqcHJlSm9ydXZUcHczdnNjK0FkOVlpUElR?=
 =?utf-8?B?UWdxYzVZelBQYjA2U3lyTTRHN3JJUG5BZVNQOTFaQmxGQ2IrRXpuQ2gzNCtT?=
 =?utf-8?B?T2FleDBtNHFZcDNGVnF5YTJ3czAwbE50SU9yUVJLOFBvZ3dCOGdBK0NQQnkv?=
 =?utf-8?B?YURhcjliTnJjSjBnenplSm5YVHFDa3hMeG03eS9oVHJpNnppSkxuRFdTMnIr?=
 =?utf-8?B?dHE1S2lseFU5eWI1cWp2c1hhWS9ldEhqVEo3dHMzejltUGJmRGR4L0l5Y2VE?=
 =?utf-8?B?REkwdzhzM0kzQWJMQ3gwdEVrUVJvMk5UQlNQVi9zVEJVU0l1UytNY3VoNWJ0?=
 =?utf-8?B?T1lhUUJ0UkdMYml2aHFTN1Bya2xZZHJIYmtHZ044T1pEaGVKUEUwZTNBZVVs?=
 =?utf-8?B?RXZxN2tUQkJLQlk2YU82VkRZWmRyYVhXL1hKSm04WG5uTFh3bDM1TXVhWDR6?=
 =?utf-8?B?VlREbXFxQTJQSzJkRnFxaWdSRkc5Mk0vODg5TFBackorUGN6V3N2bUhFbm9T?=
 =?utf-8?B?NjZXSEhzMGNKeHRIOFJMMkw0dGIrZ1V5bks0bHlYK2o4Z3lCbGM3ckR2eS85?=
 =?utf-8?B?aHJGdExuQWZUWlVZUUlrMTBLdjNiakZwWllCbUU4WGhWbmVTUktnYlByUW8w?=
 =?utf-8?B?TDU0THhwRk5SWnl5aXAwNXB5RDI4aStBYWJoR1Nrbkh6TTNOTmNxZ0NTMVFa?=
 =?utf-8?B?bC90L1BXandMbjBjR1ErK3pFQmVKMTZHZjN2ZENveE9FeFZ0N2o4bjFhWWtq?=
 =?utf-8?B?eXFrR1pzeWhPY0ZUeThmMVVHRVJWcDI2eU1xQUpyZzhGbkNOdS9MdElCbWxq?=
 =?utf-8?B?T1FNOXdaNHFkdnpzdlhXYmhQcUk2MXZweHpmRUNuR2t1SkdhaEZ2bEN1S0dk?=
 =?utf-8?B?QW02NFE2c2VzOXNCM0RHVHJwQlpqS0tQWTZndU1USEhKMEhzQ3NRN01sdS9D?=
 =?utf-8?B?OWxlU3B5RlErdGgzdXByaDlneHdIZExVTGdLcjhsYkxiUkVOWXFpdzA4UzdO?=
 =?utf-8?B?R1E5UEhXbGZtU3lBWWQ3Smx2ZEU4emlid3R4TDZRZGQrclpoQ0ZINXFiMlNm?=
 =?utf-8?B?YnZPME1PczNjQU5KSkhSM0F6TmRqVjhVaFFKaUoycW9ON1RSbmlPWU9FMGJY?=
 =?utf-8?B?Z1hWSU5XRGY3cUtGREpEdFA3MGExUkZud0RiQndLMVNBK1g0V3l3WTFDZDRn?=
 =?utf-8?B?S3JyOGsyMGtqYVFlZzI1RXVHbUQ2RUdPZ3Y3Z3ZUclpzQWEzZXU0aTNVYWxx?=
 =?utf-8?B?VnBVZlljSGZ1MTRSaXduWTE3WGRNdHBUemlNL3A2bzJ3T3NpZlRKalFSVm5Q?=
 =?utf-8?B?UmlwUGt4SnN4ZlF5Z0VlenBXSXR4NHFaTXZXKzhoK0QzMDZyRUp5bkVjUVRu?=
 =?utf-8?B?Zmg5QW0yaEhoeDFwNFVYMTVrU3Qvc3ZrYWx1OGtqOEt4azhsc295T3lRNEI3?=
 =?utf-8?Q?OVp3yjSeFg9JiOisHRVAeWrzCyO53RBl?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 23:30:33.7598
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 3267ce94-e8f0-4762-5939-08dcc6f03f77
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF000001CE.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6336

On 2024-08-27 06:03, Anthony PERARD wrote:
> "-runas" is deprecated since QEMU 9.1 and will be remove in a future
> release.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>

Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>


From xen-devel-bounces@lists.xenproject.org Tue Aug 27 23:45:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 23:45:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784423.1193778 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj5sP-0003Iz-Br; Tue, 27 Aug 2024 23:45:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784423.1193778; Tue, 27 Aug 2024 23:45:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj5sP-0003Iq-99; Tue, 27 Aug 2024 23:45:29 +0000
Received: by outflank-mailman (input) for mailman id 784423;
 Tue, 27 Aug 2024 23:45: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=ovuO=P2=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sj5sO-0003Ib-Oh
 for xen-devel@lists.xenproject.org; Tue, 27 Aug 2024 23:45:28 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6f5fd6d3-64ce-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 01:45:26 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-5becfd14353so6700085a12.1
 for <xen-devel@lists.xenproject.org>; Tue, 27 Aug 2024 16:45:26 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb20b35asm1524316a12.45.2024.08.27.16.45.24
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 27 Aug 2024 16:45:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6f5fd6d3-64ce-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724802326; x=1725407126; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=WgiybHYeK3pm1QvF6orArHL/oTUQSxNbFe0CWEQYQ/I=;
        b=QTxE4SMJ60LztIYsjGjQkQHhBdQ0BdbiAzDRHYFpDSNG1uREZaMeFXhRv+/ME09sdb
         ZxCfgKObvGWSpJ6GiezKO+RSZkBMaYXMxmZ6gpeXWOvgpmb1kXjM2k4ilEkkcxcRq3T1
         DgPgmmwuJO3kj+L325JnE9BhEPX76CMS/PmFQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724802326; x=1725407126;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=WgiybHYeK3pm1QvF6orArHL/oTUQSxNbFe0CWEQYQ/I=;
        b=ntqbCEe4pIcRgUv3BdsXCh2PIbfh5Xhupve7YmX6MDWaOJpOEjo/A8vZG2B5LbRxJV
         EZSMfb2odtacrXZdM27Nz2I0/I14vDmozsBuZZroWvYI8uHH6sCjEZSEDcbJdScthTns
         W2XYaLWaTSrD2sCk32pfHxrMLYQ1trNJBk/ZPyvUNb60CpMHiUjdTG+5CNmmfPO5TCJJ
         rGlzmp0cFzY2xNudO3PPw4Jl81rDOI/zQ3duFIFOQRASz9y5rzxJXKmY/gOTdWliTKqS
         lWG8phlaJJAjkwdXoK8Pro/y1CCf+kHLiC/hsk7V31smtnA8MMHY7ueu85ak/lYk3oLx
         M5wg==
X-Gm-Message-State: AOJu0YxuW3swEjn/33ogw09r73yA6jdGrpNDVDxZc5rJ8EURfAniFaSb
	sfq9vQ+1MHwJBa0+XSd9Fsog4lFNMLYcmsPJueB8o47PDi11Qp2wnK/CZpEgWBYnXFH3BH0ubNp
	X
X-Google-Smtp-Source: AGHT+IE7w59NXZwFzuqnzDMQE+2TnhAN3acSGhTBtdr2LqhMBkoL1fqlpK6jqGD/DJLAUxs1JNgd5w==
X-Received: by 2002:a05:6402:35c1:b0:5be:e1b6:aaef with SMTP id 4fb4d7f45d1cf-5c08919e805mr10266788a12.28.1724802325378;
        Tue, 27 Aug 2024 16:45:25 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>
Subject: [PATCH] ARM/vgic: Fix variable shadowing in vgic_to_sgi()
Date: Wed, 28 Aug 2024 00:45:22 +0100
Message-Id: <20240827234522.2237355-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

for_each_set_bit() allocates its own variable intentionally as loop-scope
only.  Unfortunately, this causes the inner 'i' to shadow the outer 'i'.

Drop the outermost 'i' and 'vcpuid' variables, moving them into a more narrow
scope and correcting them to be unsigned which they should have been all
along.

Fixes: 9429f1a6c475 ("ARM/vgic: Use for_each_set_bit() in vgic_to_sgi()")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
---
 xen/arch/arm/vgic.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 8ffe099bcb5f..6ecd9146511c 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -468,8 +468,6 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
                  int virq, const struct sgi_target *target)
 {
     struct domain *d = v->domain;
-    int vcpuid;
-    int i;
     unsigned int base, bitmap;
 
     ASSERT( virq < 16 );
@@ -483,7 +481,8 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
 
         for_each_set_bit ( i, bitmap )
         {
-            vcpuid = base + i;
+            unsigned int vcpuid = base + i;
+
             if ( vcpuid >= d->max_vcpus || d->vcpu[vcpuid] == NULL ||
                  !is_vcpu_online(d->vcpu[vcpuid]) )
             {
@@ -497,7 +496,7 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
         break;
     case SGI_TARGET_OTHERS:
         perfc_incr(vgic_sgi_others);
-        for ( i = 0; i < d->max_vcpus; i++ )
+        for ( unsigned int i = 0; i < d->max_vcpus; i++ )
         {
             if ( i != current->vcpu_id && d->vcpu[i] != NULL &&
                  is_vcpu_online(d->vcpu[i]) )

base-commit: b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b
prerequisite-patch-id: 87415b68ed015b8f36405b2554f2abd6c02f28aa
prerequisite-patch-id: d87fe52c264dc5a33883a04b615043fbefd94f92
prerequisite-patch-id: abb68a851297bbf63c16093c6362c0d4b9c39334
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Tue Aug 27 23:45:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 27 Aug 2024 23:45:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784420.1193767 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj5sM-00034A-3Z; Tue, 27 Aug 2024 23:45:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784420.1193767; Tue, 27 Aug 2024 23:45:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj5sM-000343-13; Tue, 27 Aug 2024 23:45:26 +0000
Received: by outflank-mailman (input) for mailman id 784420;
 Tue, 27 Aug 2024 23:45:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj5sK-00033t-IA; Tue, 27 Aug 2024 23:45:24 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj5sK-0001R5-6o; Tue, 27 Aug 2024 23:45:24 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj5sJ-0005p7-Th; Tue, 27 Aug 2024 23:45:23 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sj5sJ-0000bX-TE; Tue, 27 Aug 2024 23:45:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=SlQhGL+uF2yB0Pg4uxV9HPOkrX61XZ5mjZ5SNGdhx50=; b=hJXR5B2a5IdbIRUPdsmn3LagqG
	+p+dbjDdG2+/HZk7BVuNh6umQf2f8bKYzEX41UXfCcZXJU6XuMJuDWyRYYjVToGHroBTmfAkrjTHv
	4muaHjzEKzsc7N/EhhRZrXfyBEG7hJPn+z9zt7lTBkkJ8AnWDJC2rZMweJUF06L7iUF8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187369-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187369: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=cc7bb9a86e61ef80c225510f941dfc64dc9b4560
X-Osstest-Versions-That:
    ovmf=a0594ca403e77f68b317cc15b9b5c6b39e36e0fb
From: osstest service owner <osstest-admin@xenproject.org>
Date: Tue, 27 Aug 2024 23:45:23 +0000

flight 187369 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187369/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 cc7bb9a86e61ef80c225510f941dfc64dc9b4560
baseline version:
 ovmf                 a0594ca403e77f68b317cc15b9b5c6b39e36e0fb

Last test of basis   187367  2024-08-27 19:13:21 Z    0 days
Testing same since   187369  2024-08-27 21:41:35 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Aravind P R <aravind.p.r@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   a0594ca403..cc7bb9a86e  cc7bb9a86e61ef80c225510f941dfc64dc9b4560 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 03:07:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 03:07:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784439.1193788 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj91m-0003k5-Gf; Wed, 28 Aug 2024 03:07:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784439.1193788; Wed, 28 Aug 2024 03:07:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj91m-0003jy-Dz; Wed, 28 Aug 2024 03:07:22 +0000
Received: by outflank-mailman (input) for mailman id 784439;
 Wed, 28 Aug 2024 03:07:22 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj91m-0003jo-2t; Wed, 28 Aug 2024 03:07:22 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj91l-0004sG-Rk; Wed, 28 Aug 2024 03:07:21 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj91l-0006ck-55; Wed, 28 Aug 2024 03:07:21 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sj91l-0000BF-4L; Wed, 28 Aug 2024 03:07:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=kVgrdKITxebDu4sOEzHLOiZe733HXwokWxbLt6dr2rA=; b=nsceKOA3krztFlpnxSye7lutjp
	T6JPn8FFOwzX5VPKm6cI0Shjp05wS2+ucbhVCIP6doGN/QJK4rlp3COQq2beRwvA86m2EnYPZtmV/
	nzrQ7LoSMqIuyHxhyQQoELlfqYc7wjGPKjIusZKbZAe9meRpqllJYOTuhryOomXJJbI4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187372-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187372: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=ded4191e1087c56e0bdeb118fd519d18cb353ef3
X-Osstest-Versions-That:
    ovmf=cc7bb9a86e61ef80c225510f941dfc64dc9b4560
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 03:07:21 +0000

flight 187372 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187372/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 ded4191e1087c56e0bdeb118fd519d18cb353ef3
baseline version:
 ovmf                 cc7bb9a86e61ef80c225510f941dfc64dc9b4560

Last test of basis   187369  2024-08-27 21:41:35 Z    0 days
Testing same since   187372  2024-08-28 00:43:28 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Nate DeSimone <nathaniel.l.desimone@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   cc7bb9a86e..ded4191e10  ded4191e1087c56e0bdeb118fd519d18cb353ef3 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 03:10:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 03:10:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784446.1193797 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj94u-0005BQ-VB; Wed, 28 Aug 2024 03:10:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784446.1193797; Wed, 28 Aug 2024 03:10:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sj94u-0005BJ-SU; Wed, 28 Aug 2024 03:10:36 +0000
Received: by outflank-mailman (input) for mailman id 784446;
 Wed, 28 Aug 2024 03:10:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj94u-0005B9-3K; Wed, 28 Aug 2024 03:10:36 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj94u-0004w7-1U; Wed, 28 Aug 2024 03:10:36 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sj94t-0006hW-I9; Wed, 28 Aug 2024 03:10:35 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sj94t-0005y4-HX; Wed, 28 Aug 2024 03:10:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=wSbZlU8NMjL77fu9qIZaZIaL9NE4m/SKkmqyemlt7WY=; b=lI8np6CUG2+HSCEA9O4a1FQj1K
	uV/xNmJ1WSYsN5vHWRVnOO3yQygLb4bA6AoYpHe1sxUlu01QlMPV3+gltF1rUSuDaxy9wpLbwA9y4
	LUhGmuqtfl8GV7gzwsth7JTlHzGr+nJI4+r+4CWIfL5CMizHIkKC01nVRFCVuSFc1VZw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187366-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187366: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=3ec3f5fc4a91e389ea56b111a73d97ffc94f19c6
X-Osstest-Versions-That:
    linux=3e9bff3bbe1355805de919f688bef4baefbfd436
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 03:10:35 +0000

flight 187366 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187366/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187358
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187358
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187358
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187358
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187358
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187358
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                3ec3f5fc4a91e389ea56b111a73d97ffc94f19c6
baseline version:
 linux                3e9bff3bbe1355805de919f688bef4baefbfd436

Last test of basis   187358  2024-08-27 05:11:06 Z    0 days
Testing same since   187366  2024-08-27 18:40:54 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Albert Jakieła <jakiela@google.com>
  Daniel Golle <daniel@makrotopia.org>
  Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
  Hal Feng <hal.feng@starfivetech.com>
  Hendrik Borghorst <hendrikborghorst@gmail.com>
  Hongbo Li <lihongbo22@huawei.com>
  Huang-Huang Bao <i@eh5.me>
  Joe Lawrence <joe.lawrence@redhat.com>
  John Sweeney <john.sweeney@runbox.com>
  Kailang Yang <kailang@realtek.com>
  Konrad Dybcio <konrad.dybcio@linaro.org>
  Konrad Dybcio <quic_kdybcio@quicinc.com>
  Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
  Linus Torvalds <torvalds@linux-foundation.org>
  Linus Walleij <linus.walleij@linaro.org>
  Ma Ke <make24@iscas.ac.cn>
  Mark Brown <broonie@kernel.org>
  Nícolas F. R. A. Prado <nfraprado@collabora.com>
  Petr Mladek <pmladek@suse.com>
  Richard Fitzgerald <rf@opensource.cirrus.com>
  Richard Kojedzinszky <richard@kojedz.in>
  Ryan Sullivan <rysulliv@redhat.com>
  Simon Trimmer <simont@opensource.cirrus.com>
  Takashi Iwai <tiwai@suse.de>
  Thomas Blocher <thomas.blocher@ek-dev.de>
  Trevor Woerner <twoerner@gmail.com>
  Vijendar Mukunda <Vijendar.Mukunda@amd.com>
  YOUNGJIN JOO <neoelec@gmail.com>
  YR Yang <yr.yang@mediatek.com>
  Yuntao Liu <liuyuntao12@huawei.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   3e9bff3bbe135..3ec3f5fc4a91e  3ec3f5fc4a91e389ea56b111a73d97ffc94f19c6 -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 04:38:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 04:38:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784467.1193808 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjARI-0002I5-6p; Wed, 28 Aug 2024 04:37:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784467.1193808; Wed, 28 Aug 2024 04:37:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjARI-0002Hy-47; Wed, 28 Aug 2024 04:37:48 +0000
Received: by outflank-mailman (input) for mailman id 784467;
 Wed, 28 Aug 2024 04:37:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjARG-0002Ho-W4; Wed, 28 Aug 2024 04:37:47 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjARG-0006tS-OB; Wed, 28 Aug 2024 04:37:46 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjARG-0000gi-9i; Wed, 28 Aug 2024 04:37:46 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjARG-0001Yd-9G; Wed, 28 Aug 2024 04:37:46 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=3cfAQg0/2tmf884P4XrtpHXIyII8v0qyHI125kMktsQ=; b=R3z9q1JwjP73GusXcgj+A/iHiI
	I3NZ5ikuJyeCG8hbjbMJZWQjFoFZPkb2WShdrfSJWAHWpAXjXx99REVEm5UhAJMpy4M285Bgn+mHP
	ZOZRf/9yiCFTwzqmXjM90zYOMmJ5NbpVySidIy7yWevDstObRPOfQZxMCAJ+plIoWwQs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187373-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187373: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=39a999eb1decf486c615489174912f2d278636d1
X-Osstest-Versions-That:
    ovmf=ded4191e1087c56e0bdeb118fd519d18cb353ef3
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 04:37:46 +0000

flight 187373 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187373/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 39a999eb1decf486c615489174912f2d278636d1
baseline version:
 ovmf                 ded4191e1087c56e0bdeb118fd519d18cb353ef3

Last test of basis   187372  2024-08-28 00:43:28 Z    0 days
Testing same since   187373  2024-08-28 03:14:31 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Oliver Smith-Denny <osde@linux.microsoft.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   ded4191e10..39a999eb1d  39a999eb1decf486c615489174912f2d278636d1 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 06:11:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 06:11:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784479.1193828 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjBtp-0001nk-1r; Wed, 28 Aug 2024 06:11:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784479.1193828; Wed, 28 Aug 2024 06:11:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjBto-0001nd-Uo; Wed, 28 Aug 2024 06:11:20 +0000
Received: by outflank-mailman (input) for mailman id 784479;
 Wed, 28 Aug 2024 06:11:20 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/gvM=P3=bombadil.srs.infradead.org=BATV+4c6678e563c2e29e76cf+7675+infradead.org+hch@srs-se1.protection.inumbo.net>)
 id 1sjBto-0001ZP-7E
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 06:11:20 +0000
Received: from bombadil.infradead.org (bombadil.infradead.org
 [2607:7c80:54:3::133])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 572d1c0f-6504-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 08:11:19 +0200 (CEST)
Received: from [2001:4bb8:2dc:a2cd:2ccf:8fbe:8ab4:c9db] (helo=localhost)
 by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux))
 id 1sjBtg-0000000E1uh-0axG; Wed, 28 Aug 2024 06:11:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 572d1c0f-6504-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender
	:Reply-To:Content-Type:Content-ID:Content-Description;
	bh=xXPvEjkN13oRSPiD1VpIsI6lICkEOhwDSVN6M4ebF3M=; b=G6ceizxaxo/5YPTjysre3RE3P5
	r6theemKFI6tHVBOtljvn4KkqxAS2QAOgq2kFNqL/qSweoZ78GG5roeidLnOxQYaFwBGFSvMgjIxT
	Nd3VjlhZeAlYoMTPJ/A+LgEVZKiJo8/6vpC94GKnxo/yeszqxNmOI2uH+gYkKm6wByymb+IQbHgRs
	lDgiPm0CITsg8ivicn6DOIMDexltTWRjLyX7eFt13Mh7KXkquOY+RUG+jycl2hgcaS99zex+kd+o9
	eIbY6ta0tPyXUDbcb5Au2QNiyOxW5yX9stCLkEzWH5+UibAoch+LaUcS6z8gLwS5pfwAXC+wswjoI
	AbBwVQ3w==;
From: Christoph Hellwig <hch@lst.de>
To: iommu@lists.linux.dev
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Bingbu Cao <bingbu.cao@intel.com>,
	"Michael S . Tsirkin " <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	linux-kernel@vger.kernel.org,
	linux-alpha@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mips@vger.kernel.org,
	linux-parisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-s390@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-media@vger.kernel.org,
	virtualization@lists.linux.dev,
	xen-devel@lists.xenproject.org
Subject: [PATCH 1/2] vdpa_sim: don't select DMA_OPS
Date: Wed, 28 Aug 2024 09:10:28 +0300
Message-ID: <20240828061104.1925127-2-hch@lst.de>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240828061104.1925127-1-hch@lst.de>
References: <20240828061104.1925127-1-hch@lst.de>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SRS-Rewrite: SMTP reverse-path rewritten from <hch@infradead.org> by bombadil.infradead.org. See http://www.infradead.org/rpr.html

vdpa_sim has been fixed to not override the dma_map_ops in commit
6c3d329e6486 ("vdpa_sim: get rid of DMA ops"), so don't select the
symbol and don't depend on HAS_DMA.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/vdpa/Kconfig | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/vdpa/Kconfig b/drivers/vdpa/Kconfig
index 5265d09fc1c409..b08de3b7706109 100644
--- a/drivers/vdpa/Kconfig
+++ b/drivers/vdpa/Kconfig
@@ -11,8 +11,7 @@ if VDPA
 
 config VDPA_SIM
 	tristate "vDPA device simulator core"
-	depends on RUNTIME_TESTING_MENU && HAS_DMA
-	select DMA_OPS
+	depends on RUNTIME_TESTING_MENU
 	select VHOST_RING
 	select IOMMU_IOVA
 	help
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 06:11:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 06:11:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784478.1193818 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjBtn-0001Zc-SD; Wed, 28 Aug 2024 06:11:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784478.1193818; Wed, 28 Aug 2024 06:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjBtn-0001ZV-Nt; Wed, 28 Aug 2024 06:11:19 +0000
Received: by outflank-mailman (input) for mailman id 784478;
 Wed, 28 Aug 2024 06:11:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/gvM=P3=bombadil.srs.infradead.org=BATV+4c6678e563c2e29e76cf+7675+infradead.org+hch@srs-se1.protection.inumbo.net>)
 id 1sjBtm-0001ZP-AV
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 06:11:18 +0000
Received: from bombadil.infradead.org (bombadil.infradead.org
 [2607:7c80:54:3::133])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 550b1831-6504-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 08:11:16 +0200 (CEST)
Received: from [2001:4bb8:2dc:a2cd:2ccf:8fbe:8ab4:c9db] (helo=localhost)
 by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux))
 id 1sjBtc-0000000E1uI-0svg; Wed, 28 Aug 2024 06:11:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 550b1831-6504-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding:
	MIME-Version:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:
	Content-ID:Content-Description:In-Reply-To:References;
	bh=3ciW+jDJYrdLJiK7yrXhNzVEL4ig56HUYUk4VOvh/z0=; b=DachNt1cx+ujVHKXHJfhguYPcC
	9aAqfBoRuTD2BycDnkoq2+XVJgduR0jUZafb+wHb4B+tRHNCEo+SGOrtcsQvZMydA7tNGInWBQs5w
	69FOaQMwVwWuo6pPJtsi2BcUec+73lr/fSkNmYLKWVNWI7lSQZKrpLFPAp9IcRtasZAYiQf8cOkxO
	tni42Ic2e8NqYRy7ZadXs2xugccm0Zfp5fifHQ9pwwtZOGq968HzDTabeQWV+VtZubJN2NukZ+srM
	m7lxrEC4huwPqB6G7d3uGQA+7nAvrJsZgB3gE8FZFou6JBOpJJHKhnTlWsvD8OBG21HfoKRWJ0AQk
	brwIO41g==;
From: Christoph Hellwig <hch@lst.de>
To: iommu@lists.linux.dev
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Bingbu Cao <bingbu.cao@intel.com>,
	"Michael S . Tsirkin " <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	linux-kernel@vger.kernel.org,
	linux-alpha@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mips@vger.kernel.org,
	linux-parisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-s390@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-media@vger.kernel.org,
	virtualization@lists.linux.dev,
	xen-devel@lists.xenproject.org
Subject: clearly mark DMA_OPS support as an architecture feature v2
Date: Wed, 28 Aug 2024 09:10:27 +0300
Message-ID: <20240828061104.1925127-1-hch@lst.de>
X-Mailer: git-send-email 2.43.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SRS-Rewrite: SMTP reverse-path rewritten from <hch@infradead.org> by bombadil.infradead.org. See http://www.infradead.org/rpr.html

Hi all,

we've had a long standing problems where drivers try to hook into the
DMA_OPS mechanisms to override them for something that is not DMA, or
to introduce additional dispatching.

Now that we are not using DMA_OPS support for dma-iommu and can build
kernels without DMA_OPS support on many common setups this becomes even
more problematic.

This series renames the option to ARCH_HAS_DMA_OPS and adds very explicit
comment to not use it in drivers.  The ipu6 and vdpa_sim/user drivers
that abuse the mechanism are made to depend on the option instead of
selecting it with a big comment, but I expect this to be fixed rather
sooner than later (I know the ipu6 maintainers are on it based on a
previous discussion).

Changes since v1:
 - s/ARCH_DMA_OPS/ARCH_HAS_DMA_OPS/g
 - spelling fixes
 - vdpa_sim actually doesn't need dma ops these days, add a prep patch
   to remove the dependency


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 06:11:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 06:11:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784480.1193837 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjBts-00022s-8R; Wed, 28 Aug 2024 06:11:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784480.1193837; Wed, 28 Aug 2024 06:11:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjBts-00022l-5g; Wed, 28 Aug 2024 06:11:24 +0000
Received: by outflank-mailman (input) for mailman id 784480;
 Wed, 28 Aug 2024 06:11:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=/gvM=P3=bombadil.srs.infradead.org=BATV+4c6678e563c2e29e76cf+7675+infradead.org+hch@srs-se1.protection.inumbo.net>)
 id 1sjBtq-0001ZP-QC
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 06:11:22 +0000
Received: from bombadil.infradead.org (bombadil.infradead.org
 [2607:7c80:54:3::133])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 586f62b9-6504-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 08:11:21 +0200 (CEST)
Received: from [2001:4bb8:2dc:a2cd:2ccf:8fbe:8ab4:c9db] (helo=localhost)
 by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux))
 id 1sjBtk-0000000E1vN-3ebv; Wed, 28 Aug 2024 06:11:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 586f62b9-6504-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding:
	MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender
	:Reply-To:Content-Type:Content-ID:Content-Description;
	bh=wLOj1wm4quKRI7T//ojIfZpi6nYGjLfhudVG0GuNPR8=; b=HY5EOWDvAYPTwFU0+TFGql1uZh
	nbAq3VD6pJlrDT4lZOpvrnVWaCe6yIPpYkZEqcNiFBFslVnYFw1IPHBycNxDJd2CLktQ8p0Gjke9s
	QGOUNKDIkk3fUNqd5bJWJwhnnWM70JlLjAClfHJ6l4+cuddHMWb++DnrUXzhHrmWOS0VtyaWO5r4J
	l7GinfR91cpYZfXA47z615snfZm5LiUwDnFEqme/+VTQEKM1xBhrFo39+JTN6cRO7UGE4Jh6Wmicm
	ZgcZqS10Ad5UV+WhMS+vfAnmdwgWmnRWNKbuati0Xn19d2rIeatDB1efe1V9P3fEfL6pTqtsSnyW+
	/h07oy/g==;
From: Christoph Hellwig <hch@lst.de>
To: iommu@lists.linux.dev
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Bingbu Cao <bingbu.cao@intel.com>,
	"Michael S . Tsirkin " <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	linux-kernel@vger.kernel.org,
	linux-alpha@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mips@vger.kernel.org,
	linux-parisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org,
	linux-s390@vger.kernel.org,
	sparclinux@vger.kernel.org,
	linux-media@vger.kernel.org,
	virtualization@lists.linux.dev,
	xen-devel@lists.xenproject.org,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH 2/2] dma-mapping: clearly mark DMA ops as an architecture feature
Date: Wed, 28 Aug 2024 09:10:29 +0300
Message-ID: <20240828061104.1925127-3-hch@lst.de>
X-Mailer: git-send-email 2.43.0
In-Reply-To: <20240828061104.1925127-1-hch@lst.de>
References: <20240828061104.1925127-1-hch@lst.de>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SRS-Rewrite: SMTP reverse-path rewritten from <hch@infradead.org> by bombadil.infradead.org. See http://www.infradead.org/rpr.html

DMA ops are a helper for architectures and not for drivers to override
the DMA implementation.

Unfortunately driver authors keep ignoring this.  Make the fact more
clear by renaming the symbol to ARCH_HAS_DMA_OPS and having the two drivers
overriding their dma_ops depend on that.  These drivers should probably be
marked broken, but we can give them a bit of a grace period for that.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> # for IPU6
Acked-by: Robin Murphy <robin.murphy@arm.com>
---
 arch/Kconfig                         | 9 +++++++++
 arch/alpha/Kconfig                   | 2 +-
 arch/arm/Kconfig                     | 2 +-
 arch/arm64/Kconfig                   | 1 +
 arch/mips/Kconfig                    | 2 +-
 arch/parisc/Kconfig                  | 2 +-
 arch/powerpc/Kconfig                 | 2 +-
 arch/s390/Kconfig                    | 2 +-
 arch/sparc/Kconfig                   | 2 +-
 arch/x86/Kconfig                     | 2 +-
 drivers/macintosh/macio_asic.c       | 4 ++--
 drivers/media/pci/intel/ipu6/Kconfig | 7 ++++++-
 drivers/vdpa/Kconfig                 | 7 ++++++-
 drivers/xen/Kconfig                  | 4 ++--
 include/linux/device.h               | 2 +-
 include/linux/dma-map-ops.h          | 6 +++---
 kernel/dma/Kconfig                   | 9 ++-------
 kernel/dma/Makefile                  | 2 +-
 18 files changed, 41 insertions(+), 26 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index 975dd22a2dbd22..61c4ec04878754 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -17,6 +17,15 @@ config CPU_MITIGATIONS
 	def_bool y
 endif
 
+#
+# Selected by architectures that need custom DMA operations for e.g. legacy
+# IOMMUs not handled by dma-iommu.  Drivers must never select this symbol.
+#
+config ARCH_HAS_DMA_OPS
+	depends on HAS_DMA
+	select DMA_OPS_HELPERS
+	bool
+
 menu "General architecture-dependent options"
 
 config ARCH_HAS_SUBPAGE_FAULTS
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 50ff06d5b799c9..109a4cddcd1389 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -4,12 +4,12 @@ config ALPHA
 	default y
 	select ARCH_32BIT_USTAT_F_TINODE
 	select ARCH_HAS_CURRENT_STACK_POINTER
+	select ARCH_HAS_DMA_OPS if PCI
 	select ARCH_MIGHT_HAVE_PC_PARPORT
 	select ARCH_MIGHT_HAVE_PC_SERIO
 	select ARCH_NO_PREEMPT
 	select ARCH_NO_SG_CHAIN
 	select ARCH_USE_CMPXCHG_LOCKREF
-	select DMA_OPS if PCI
 	select FORCE_PCI
 	select PCI_DOMAINS if PCI
 	select PCI_SYSCALL if PCI
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 54b2bb817a7fc0..f5f7995a2f8f59 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -10,6 +10,7 @@ config ARM
 	select ARCH_HAS_CURRENT_STACK_POINTER
 	select ARCH_HAS_DEBUG_VIRTUAL if MMU
 	select ARCH_HAS_DMA_ALLOC if MMU
+	select ARCH_HAS_DMA_OPS
 	select ARCH_HAS_DMA_WRITE_COMBINE if !ARM_DMA_MEM_BUFFERABLE
 	select ARCH_HAS_ELF_RANDOMIZE
 	select ARCH_HAS_FORTIFY_SOURCE
@@ -54,7 +55,6 @@ config ARM
 	select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS
 	select DMA_DECLARE_COHERENT
 	select DMA_GLOBAL_POOL if !MMU
-	select DMA_OPS
 	select DMA_NONCOHERENT_MMAP if MMU
 	select EDAC_SUPPORT
 	select EDAC_ATOMIC_SCRUB
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index a2f8ff354ca670..40940cbde435a3 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -24,6 +24,7 @@ config ARM64
 	select ARCH_HAS_CURRENT_STACK_POINTER
 	select ARCH_HAS_DEBUG_VIRTUAL
 	select ARCH_HAS_DEBUG_VM_PGTABLE
+	select ARCH_HAS_DMA_OPS if XEN
 	select ARCH_HAS_DMA_PREP_COHERENT
 	select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
 	select ARCH_HAS_FAST_MULTIPLIER
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 60077e57693563..023ad33a7e945d 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -8,6 +8,7 @@ config MIPS
 	select ARCH_HAS_CPU_FINALIZE_INIT
 	select ARCH_HAS_CURRENT_STACK_POINTER if !CC_IS_CLANG || CLANG_VERSION >= 140000
 	select ARCH_HAS_DEBUG_VIRTUAL if !64BIT
+	select ARCH_HAS_DMA_OPS if MACH_JAZZ
 	select ARCH_HAS_FORTIFY_SOURCE
 	select ARCH_HAS_KCOV
 	select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE if !EVA
@@ -393,7 +394,6 @@ config MACH_JAZZ
 	select ARC_PROMLIB
 	select ARCH_MIGHT_HAVE_PC_PARPORT
 	select ARCH_MIGHT_HAVE_PC_SERIO
-	select DMA_OPS
 	select FW_ARC
 	select FW_ARC32
 	select ARCH_MAY_HAVE_PC_FDC
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index b0a2ac3ba91610..859835a0692c24 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -10,6 +10,7 @@ config PARISC
 	select ARCH_WANT_FRAME_POINTERS
 	select ARCH_HAS_CPU_CACHE_ALIASING
 	select ARCH_HAS_DMA_ALLOC if PA11
+	select ARCH_HAS_DMA_OPS
 	select ARCH_HAS_ELF_RANDOMIZE
 	select ARCH_HAS_STRICT_KERNEL_RWX
 	select ARCH_HAS_STRICT_MODULE_RWX
@@ -23,7 +24,6 @@ config PARISC
 	select ARCH_HAS_CACHE_LINE_SIZE
 	select ARCH_HAS_DEBUG_VM_PGTABLE
 	select HAVE_RELIABLE_STACKTRACE
-	select DMA_OPS
 	select RTC_CLASS
 	select RTC_DRV_GENERIC
 	select INIT_ALL_POSSIBLE
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index d7b09b064a8ac5..f87fc0375a92b3 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -133,6 +133,7 @@ config PPC
 	select ARCH_HAS_DEBUG_WX		if STRICT_KERNEL_RWX
 	select ARCH_HAS_DEVMEM_IS_ALLOWED
 	select ARCH_HAS_DMA_MAP_DIRECT 		if PPC_PSERIES
+	select ARCH_HAS_DMA_OPS			if PPC64
 	select ARCH_HAS_FORTIFY_SOURCE
 	select ARCH_HAS_GCOV_PROFILE_ALL
 	select ARCH_HAS_KCOV
@@ -185,7 +186,6 @@ config PPC
 	select CPUMASK_OFFSTACK			if NR_CPUS >= 8192
 	select DCACHE_WORD_ACCESS		if PPC64 && CPU_LITTLE_ENDIAN
 	select DMA_OPS_BYPASS			if PPC64
-	select DMA_OPS				if PPC64
 	select DYNAMIC_FTRACE			if FUNCTION_TRACER
 	select EDAC_ATOMIC_SCRUB
 	select EDAC_SUPPORT
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index a822f952f64a9c..f31f6b85c25ccc 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -70,6 +70,7 @@ config S390
 	select ARCH_HAS_DEBUG_VM_PGTABLE
 	select ARCH_HAS_DEBUG_WX
 	select ARCH_HAS_DEVMEM_IS_ALLOWED
+	select ARCH_HAS_DMA_OPS if PCI
 	select ARCH_HAS_ELF_RANDOMIZE
 	select ARCH_HAS_FORCE_DMA_UNENCRYPTED
 	select ARCH_HAS_FORTIFY_SOURCE
@@ -137,7 +138,6 @@ config S390
 	select BUILDTIME_TABLE_SORT
 	select CLONE_BACKWARDS2
 	select DCACHE_WORD_ACCESS if !KMSAN
-	select DMA_OPS if PCI
 	select DYNAMIC_FTRACE if FUNCTION_TRACER
 	select FUNCTION_ALIGNMENT_8B if CC_IS_GCC
 	select FUNCTION_ALIGNMENT_16B if !CC_IS_GCC
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 11bf9d312318c6..dcfdb7f1dae976 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -14,9 +14,9 @@ config SPARC
 	bool
 	default y
 	select ARCH_HAS_CPU_CACHE_ALIASING
+	select ARCH_HAS_DMA_OPS
 	select ARCH_MIGHT_HAVE_PC_PARPORT if SPARC64 && PCI
 	select ARCH_MIGHT_HAVE_PC_SERIO
-	select DMA_OPS
 	select OF
 	select OF_PROMTREE
 	select HAVE_ASM_MODVERSIONS
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 007bab9f2a0e39..9e2e7d361019fe 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -79,6 +79,7 @@ config X86
 	select ARCH_HAS_DEBUG_VIRTUAL
 	select ARCH_HAS_DEBUG_VM_PGTABLE	if !X86_PAE
 	select ARCH_HAS_DEVMEM_IS_ALLOWED
+	select ARCH_HAS_DMA_OPS			if GART_IOMMU || XEN
 	select ARCH_HAS_EARLY_DEBUG		if KGDB
 	select ARCH_HAS_ELF_RANDOMIZE
 	select ARCH_HAS_FAST_MULTIPLIER
@@ -943,7 +944,6 @@ config DMI
 
 config GART_IOMMU
 	bool "Old AMD GART IOMMU support"
-	select DMA_OPS
 	select IOMMU_HELPER
 	select SWIOTLB
 	depends on X86_64 && PCI && AMD_NB
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index 13626205530d36..bede200e32e8ff 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -387,7 +387,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
 	dma_set_max_seg_size(&dev->ofdev.dev, 65536);
 	dma_set_seg_boundary(&dev->ofdev.dev, 0xffffffff);
 
-#if defined(CONFIG_PCI) && defined(CONFIG_DMA_OPS)
+#if defined(CONFIG_PCI) && defined(CONFIG_ARCH_HAS_DMA_OPS)
 	/* Set the DMA ops to the ones from the PCI device, this could be
 	 * fishy if we didn't know that on PowerMac it's always direct ops
 	 * or iommu ops that will work fine
@@ -396,7 +396,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
 	 */
 	dev->ofdev.dev.archdata = chip->lbus.pdev->dev.archdata;
 	dev->ofdev.dev.dma_ops = chip->lbus.pdev->dev.dma_ops;
-#endif /* CONFIG_PCI && CONFIG_DMA_OPS */
+#endif /* CONFIG_PCI && CONFIG_ARCH_HAS_DMA_OPS */
 
 #ifdef DEBUG
 	printk("preparing mdev @%p, ofdev @%p, dev @%p, kobj @%p\n",
diff --git a/drivers/media/pci/intel/ipu6/Kconfig b/drivers/media/pci/intel/ipu6/Kconfig
index 40e20f0aa5ae5d..49e4fb696573f6 100644
--- a/drivers/media/pci/intel/ipu6/Kconfig
+++ b/drivers/media/pci/intel/ipu6/Kconfig
@@ -4,8 +4,13 @@ config VIDEO_INTEL_IPU6
 	depends on VIDEO_DEV
 	depends on X86 && X86_64 && HAS_DMA
 	depends on IPU_BRIDGE || !IPU_BRIDGE
+	#
+	# This driver incorrectly tries to override the dma_ops.  It should
+	# never have done that, but for now keep it working on architectures
+	# that use dma ops
+	#
+	depends on ARCH_HAS_DMA_OPS
 	select AUXILIARY_BUS
-	select DMA_OPS
 	select IOMMU_IOVA
 	select VIDEO_V4L2_SUBDEV_API
 	select MEDIA_CONTROLLER
diff --git a/drivers/vdpa/Kconfig b/drivers/vdpa/Kconfig
index b08de3b7706109..559fb9d3271fcc 100644
--- a/drivers/vdpa/Kconfig
+++ b/drivers/vdpa/Kconfig
@@ -35,7 +35,12 @@ config VDPA_SIM_BLOCK
 config VDPA_USER
 	tristate "VDUSE (vDPA Device in Userspace) support"
 	depends on EVENTFD && MMU && HAS_DMA
-	select DMA_OPS
+	#
+	# This driver incorrectly tries to override the dma_ops.  It should
+	# never have done that, but for now keep it working on architectures
+	# that use dma ops
+	#
+	depends on ARCH_HAS_DMA_OPS
 	select VHOST_IOTLB
 	select IOMMU_IOVA
 	help
diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
index d5989871dd5de3..27f288b5f30c37 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -177,8 +177,8 @@ config XEN_GRANT_DMA_ALLOC
 
 config SWIOTLB_XEN
 	def_bool y
+	depends on ARCH_DMA_OPS
 	depends on XEN_PV || ARM || ARM64
-	select DMA_OPS
 	select SWIOTLB
 
 config XEN_PCI_STUB
@@ -348,10 +348,10 @@ config XEN_GRANT_DMA_IOMMU
 
 config XEN_GRANT_DMA_OPS
 	bool
-	select DMA_OPS
 
 config XEN_VIRTIO
 	bool "Xen virtio support"
+	depends on ARCH_DMA_OPS
 	depends on VIRTIO
 	select XEN_GRANT_DMA_OPS
 	select XEN_GRANT_DMA_IOMMU if OF
diff --git a/include/linux/device.h b/include/linux/device.h
index 1c5280d28bc389..b4bde8d226979b 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -750,7 +750,7 @@ struct device {
 	struct dev_pin_info	*pins;
 #endif
 	struct dev_msi_info	msi;
-#ifdef CONFIG_DMA_OPS
+#ifdef CONFIG_ARCH_HAS_DMA_OPS
 	const struct dma_map_ops *dma_ops;
 #endif
 	u64		*dma_mask;	/* dma mask (if dma'able device) */
diff --git a/include/linux/dma-map-ops.h b/include/linux/dma-map-ops.h
index 077b15c93bb8ff..9668ddf3696e71 100644
--- a/include/linux/dma-map-ops.h
+++ b/include/linux/dma-map-ops.h
@@ -75,7 +75,7 @@ struct dma_map_ops {
 	unsigned long (*get_merge_boundary)(struct device *dev);
 };
 
-#ifdef CONFIG_DMA_OPS
+#ifdef CONFIG_ARCH_HAS_DMA_OPS
 #include <asm/dma-mapping.h>
 
 static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
@@ -90,7 +90,7 @@ static inline void set_dma_ops(struct device *dev,
 {
 	dev->dma_ops = dma_ops;
 }
-#else /* CONFIG_DMA_OPS */
+#else /* CONFIG_ARCH_HAS_DMA_OPS */
 static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
 {
 	return NULL;
@@ -99,7 +99,7 @@ static inline void set_dma_ops(struct device *dev,
 			       const struct dma_map_ops *dma_ops)
 {
 }
-#endif /* CONFIG_DMA_OPS */
+#endif /* CONFIG_ARCH_HAS_DMA_OPS */
 
 #ifdef CONFIG_DMA_CMA
 extern struct cma *dma_contiguous_default_area;
diff --git a/kernel/dma/Kconfig b/kernel/dma/Kconfig
index 21bae17008368a..4c0dcd90912167 100644
--- a/kernel/dma/Kconfig
+++ b/kernel/dma/Kconfig
@@ -11,11 +11,6 @@ config HAS_DMA
 config DMA_OPS_HELPERS
 	bool
 
-config DMA_OPS
-	depends on HAS_DMA
-	select DMA_OPS_HELPERS
-	bool
-
 #
 # IOMMU drivers that can bypass the IOMMU code and optionally use the direct
 # mapping fast path should select this option and set the dma_ops_bypass
@@ -113,8 +108,8 @@ config DMA_BOUNCE_UNALIGNED_KMALLOC
 
 config DMA_NEED_SYNC
 	def_bool ARCH_HAS_SYNC_DMA_FOR_DEVICE || ARCH_HAS_SYNC_DMA_FOR_CPU || \
-		 ARCH_HAS_SYNC_DMA_FOR_CPU_ALL || DMA_API_DEBUG || DMA_OPS || \
-		 SWIOTLB
+		 ARCH_HAS_SYNC_DMA_FOR_CPU_ALL || DMA_API_DEBUG || \
+		 ARCH_HAS_DMA_OPS || SWIOTLB
 
 config DMA_RESTRICTED_POOL
 	bool "DMA Restricted Pool"
diff --git a/kernel/dma/Makefile b/kernel/dma/Makefile
index 2e6e933cf7f3fb..6977033444a375 100644
--- a/kernel/dma/Makefile
+++ b/kernel/dma/Makefile
@@ -2,7 +2,7 @@
 
 obj-$(CONFIG_HAS_DMA)			+= mapping.o direct.o
 obj-$(CONFIG_DMA_OPS_HELPERS)		+= ops_helpers.o
-obj-$(CONFIG_DMA_OPS)			+= dummy.o
+obj-$(CONFIG_ARCH_HAS_DMA_OPS)		+= dummy.o
 obj-$(CONFIG_DMA_CMA)			+= contiguous.o
 obj-$(CONFIG_DMA_DECLARE_COHERENT)	+= coherent.o
 obj-$(CONFIG_DMA_API_DEBUG)		+= debug.o
-- 
2.43.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 06:21:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 06:21:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784494.1193848 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjC3V-0004if-Ad; Wed, 28 Aug 2024 06:21:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784494.1193848; Wed, 28 Aug 2024 06:21:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjC3V-0004iY-7W; Wed, 28 Aug 2024 06:21:21 +0000
Received: by outflank-mailman (input) for mailman id 784494;
 Wed, 28 Aug 2024 06:21:19 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=wIbb=P3=gaisler.com=andreas@srs-se1.protection.inumbo.net>)
 id 1sjC3T-0004iS-1j
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 06:21:19 +0000
Received: from smtp-out3.simply.com (smtp-out3.simply.com [94.231.106.210])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bbaae71f-6505-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 08:21:17 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
 by smtp.simply.com (Simply.com) with ESMTP id 4WtvSD4CTtz1FXRy;
 Wed, 28 Aug 2024 08:21:16 +0200 (CEST)
Received: from [192.168.0.25] (h-98-128-223-123.NA.cust.bahnhof.se
 [98.128.223.123])
 (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (Client did not present a certificate)
 by smtp.simply.com (Simply.com) with ESMTPSA id 4WtvSC6CZ0z1DPkN;
 Wed, 28 Aug 2024 08:21:15 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bbaae71f-6505-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gaisler.com;
	s=unoeuro; t=1724826076;
	bh=MZjaRsFFki5Bx5B5FHnglUd9d4H7fBDSxyu2jHiKATQ=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=H9fF3GHsObx42DQlccYjWkCaI8H7IjrygcJqC6jNaK4z0Z18apld5cXSgQVOUCs01
	 KKScBf0M+KhxqxD5GBoovtvU90uovoSytFCOkAnhgzKqOSnS+qVrnNytVlHc49wNmn
	 MMSVwYK7ONDpeF3VHN8cIXWAeIenPfu7ecQ0hXO8=
Message-ID: <12a0f286-3114-4dac-8b75-3a638d9c8635@gaisler.com>
Date: Wed, 28 Aug 2024 08:21:14 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/2] dma-mapping: clearly mark DMA ops as an architecture
 feature
To: Christoph Hellwig <hch@lst.de>, iommu@lists.linux.dev
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
 Robin Murphy <robin.murphy@arm.com>,
 Sakari Ailus <sakari.ailus@linux.intel.com>,
 Bingbu Cao <bingbu.cao@intel.com>, "Michael S . Tsirkin" <mst@redhat.com>,
 Jason Wang <jasowang@redhat.com>, linux-kernel@vger.kernel.org,
 linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
 linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org,
 linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
 sparclinux@vger.kernel.org, linux-media@vger.kernel.org,
 virtualization@lists.linux.dev, xen-devel@lists.xenproject.org,
 Thomas Gleixner <tglx@linutronix.de>
References: <20240828061104.1925127-1-hch@lst.de>
 <20240828061104.1925127-3-hch@lst.de>
Content-Language: en-US
From: Andreas Larsson <andreas@gaisler.com>
In-Reply-To: <20240828061104.1925127-3-hch@lst.de>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 2024-08-28 08:10, Christoph Hellwig wrote:
> --- a/drivers/xen/Kconfig
> +++ b/drivers/xen/Kconfig
> @@ -177,8 +177,8 @@ config XEN_GRANT_DMA_ALLOC
>  
>  config SWIOTLB_XEN
>  	def_bool y
> +	depends on ARCH_DMA_OPS

Rename to ARCH_HAS_DMA_OPS in v2 is missing here

>  	depends on XEN_PV || ARM || ARM64
> -	select DMA_OPS
>  	select SWIOTLB
>  
>  config XEN_PCI_STUB
> @@ -348,10 +348,10 @@ config XEN_GRANT_DMA_IOMMU
>  
>  config XEN_GRANT_DMA_OPS
>  	bool
> -	select DMA_OPS
>  
>  config XEN_VIRTIO
>  	bool "Xen virtio support"
> +	depends on ARCH_DMA_OPS

and here.

Cheers,
Andreas



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 06:40:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 06:40:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784501.1193858 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjCMN-0008Ov-03; Wed, 28 Aug 2024 06:40:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784501.1193858; Wed, 28 Aug 2024 06:40:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjCMM-0008Oo-SS; Wed, 28 Aug 2024 06:40:50 +0000
Received: by outflank-mailman (input) for mailman id 784501;
 Wed, 28 Aug 2024 06:40:49 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjCML-0008Oe-OG; Wed, 28 Aug 2024 06:40:49 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjCML-0000vv-GB; Wed, 28 Aug 2024 06:40:49 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjCMK-0004JD-OB; Wed, 28 Aug 2024 06:40:48 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjCMK-0002jX-Nf; Wed, 28 Aug 2024 06:40:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=q2mHWQU451lUlDqv54r8SaHqkXR7rT3DQNGnjbmrz7Y=; b=ygZ6LW2ZzumPLx/eOUt1Yb3CAs
	E7LMd0w4xgVJgg/E81Nfm95/pBPbPXgZ8o+1ZqejAi03dD1PY6+nXc5hgEkl7Na3iRqaOCViqw5tq
	tDsmgzYbOyBHjM3W3IBqcZnVc8/9UXG4jMGh3a2EwkIt/ieXh06wyUCIAHgxbmOoqakk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187368-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187368: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=9429f1a6c4758ae91f3ae721a036f4bbf76fb2b8
X-Osstest-Versions-That:
    xen=b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 06:40:48 +0000

flight 187368 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187368/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187355
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187355
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail like 187355
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187355
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187355
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187355
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187355
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  9429f1a6c4758ae91f3ae721a036f4bbf76fb2b8
baseline version:
 xen                  b8cdfac2be38c98dd3ad0e911a3f7f787f5bcf6b

Last test of basis   187355  2024-08-27 01:55:42 Z    1 days
Testing same since   187368  2024-08-27 21:09:10 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Frediano Ziglio <frediano.ziglio@cloud.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   b8cdfac2be..9429f1a6c4  9429f1a6c4758ae91f3ae721a036f4bbf76fb2b8 -> master


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 06:45:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 06:45:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784511.1193880 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjCQo-0000h2-NG; Wed, 28 Aug 2024 06:45:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784511.1193880; Wed, 28 Aug 2024 06:45:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjCQo-0000gv-K2; Wed, 28 Aug 2024 06:45:26 +0000
Received: by outflank-mailman (input) for mailman id 784511;
 Wed, 28 Aug 2024 06:45:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjCQn-0000gl-RE; Wed, 28 Aug 2024 06:45:25 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjCQn-00011o-QQ; Wed, 28 Aug 2024 06:45:25 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjCQm-0004Ud-QY; Wed, 28 Aug 2024 06:45:25 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjCQm-0007Hm-Q5; Wed, 28 Aug 2024 06:45:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=OfwK71pMLiZYMVH9zYojPYrpncbzjhL6U/aM9ABWGzk=; b=1/YTzAxAQNxbNh2Y2uBLiFr+4d
	/ntQGUrko9dRMg+BxI9u2EXlQ4wrNa4I/PI+N+BFaa2MiApO5onJkByTWkx5RGjtryAaCrKAK+ND6
	sJeFkO5/j94maqIe/p9je0GbiU3b4CIvVLWYlJUEuDX5yD0HSNkefNMCqVObz50hcqMA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187375-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187375: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=25da777d95c0e76b3e0a15ff617870105c228b7b
X-Osstest-Versions-That:
    ovmf=39a999eb1decf486c615489174912f2d278636d1
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 06:45:24 +0000

flight 187375 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187375/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 25da777d95c0e76b3e0a15ff617870105c228b7b
baseline version:
 ovmf                 39a999eb1decf486c615489174912f2d278636d1

Last test of basis   187373  2024-08-28 03:14:31 Z    0 days
Testing same since   187375  2024-08-28 04:41:30 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Nate DeSimone <nathaniel.l.desimone@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   39a999eb1d..25da777d95  25da777d95c0e76b3e0a15ff617870105c228b7b -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 07:06:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 07:06:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784522.1193889 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjClE-00050U-CR; Wed, 28 Aug 2024 07:06:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784522.1193889; Wed, 28 Aug 2024 07:06:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjClE-00050N-9t; Wed, 28 Aug 2024 07:06:32 +0000
Received: by outflank-mailman (input) for mailman id 784522;
 Wed, 28 Aug 2024 07:06:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=RIMj=P3=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sjClC-00050H-D5
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 07:06:30 +0000
Received: from NAM02-SN1-obe.outbound.protection.outlook.com
 (mail-sn1nam02on20622.outbound.protection.outlook.com
 [2a01:111:f400:7ea9::622])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0b2e920d-650c-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 09:06:28 +0200 (CEST)
Received: from BL1PR13CA0235.namprd13.prod.outlook.com (2603:10b6:208:2bf::30)
 by BY5PR12MB4162.namprd12.prod.outlook.com (2603:10b6:a03:201::11)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27; Wed, 28 Aug
 2024 07:06:23 +0000
Received: from MN1PEPF0000F0E5.namprd04.prod.outlook.com
 (2603:10b6:208:2bf:cafe::a3) by BL1PR13CA0235.outlook.office365.com
 (2603:10b6:208:2bf::30) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.19 via Frontend
 Transport; Wed, 28 Aug 2024 07:06:22 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 MN1PEPF0000F0E5.mail.protection.outlook.com (10.167.242.43) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Wed, 28 Aug 2024 07:06:22 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 28 Aug
 2024 02:06:21 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Wed, 28 Aug 2024 02:06:20 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0b2e920d-650c-11ef-a0b0-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=QZfV3ZRIigscPBHDin/nx6qzTyIbYMuKWjZVcA83/TNICfolaajhY88zcQjkEtCzAHG71N0b18/egkdoqwOh+BZ8kEWPkXX9W6NyD9LOLs2bQckSHvdLEdsZ5x0v9CF9mgyy5s0fLDPS7IDlxY8OFIXtJEBUc5EMJCssuIeQ5g1AkTZcpO7y59UYDN0rNPUr8MGnavNcgaGpSCLbyfjsYO2PCLHpOWK4VbBfTZd+83qBWlMb839pvWfVz4se/lpoqH/lzAn/K3SaLq3IQNgK5LsqmRPHpnM3SuR6NGKL2WYq8wU3TRIE6coXVayzAeRvihN6AADiBRrDlkZ7w9+r4g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=+8Lfp2CZBbUQ8ONYYPoWKGUcOuXsHmRawUQ0jh6cAG0=;
 b=QPMOOIj3MLFJbgxzt9nMpdRxGrfPFyJu12gZI0rZXCQdLKpj/4TvauigfQDHroRC6IJAs0nZqC5FYTafNTCXJMXLgytI3fS7mhMJERWsJ8nFtU5DxSgqn1bVRjnNqIt9thoPSlYRsFWwnRUgbLKufOi7TO0THlFZy/wNsQB8J/3IpvFXl9b72Pf+YKUHcHzNtgJouRxPP/4vHMbowHU0qa/+E1Qn3A7VBdQI3Tb1j3I5RVwxT2ET4p5VWU74/pUhfSjy36bcb0A4Afi2htevQ38klMxZ4zbjVvj0h8rsAcezVrOsfa3dryvrulwGaB5fzXhoVgd19im0FKtVgwibuQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=citrix.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=+8Lfp2CZBbUQ8ONYYPoWKGUcOuXsHmRawUQ0jh6cAG0=;
 b=2XvqQcMB+bSX3ATjuDkAX5p4D79jLPcJfJRV7oeTiSo0i3A6vkBJBfg41RXz3tXHC2ToxVf8E2Skq+m8jbUMBDWY+07jm8XuWwvBtsKW5jrVAfw+eJbsML/8ZUGQDpUdeNajqEuOV1bi3ltrjX8nmhimOlukBZI7sRfVDL90j+c=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <748f9e0d-e630-42f2-9273-95e2e85c524f@amd.com>
Date: Wed, 28 Aug 2024 09:06:19 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] ARM/vgic: Fix variable shadowing in vgic_to_sgi()
To: Andrew Cooper <andrew.cooper3@citrix.com>, Xen-devel
	<xen-devel@lists.xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
	<julien@xen.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, Bertrand
 Marquis <bertrand.marquis@arm.com>
References: <20240827234522.2237355-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <20240827234522.2237355-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB03.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MN1PEPF0000F0E5:EE_|BY5PR12MB4162:EE_
X-MS-Office365-Filtering-Correlation-Id: 4816063e-36ca-40a2-ed6c-08dcc72fec7a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?aDl5M3M5TGMxbHFYeFB1Q1A2V2JEWnJFaXBPaXIxZUE5cWRtbDNBMkxlOWow?=
 =?utf-8?B?REhFQUpTeExWZ25IdDhGelo5STQ3Sno4elRrbHRqS1JoSVB5d01HekViZnJm?=
 =?utf-8?B?ckZWWXhWdGlNMlF5V2p3VUl2YTNyM21JVy9xQzc2T2hmS0krN21rd25kc282?=
 =?utf-8?B?K2RiZWFDT1RiNVVQU3BxZUZuV1ZLS2ErZXZGQVpQejlLQ1ljODU0RS9mN0RT?=
 =?utf-8?B?d2ExRWtGZ3JZQXcyRTVVVFQ0WjlzSkNzUFRFL2VSeW1CWTVHbXpQNWJ4cGVj?=
 =?utf-8?B?c1JGL3ZRSVk1TDVqRE5TVC9sdk1sRnhWZmVEYmVRMTM2TlNLY3pxVmVnZWlP?=
 =?utf-8?B?TWkvTWF4QkV2S2VJL3NFRmU5b1ptaklNc3JMRVpvcm1YK1A0WmJrcHdtN1dU?=
 =?utf-8?B?eWFjZU81SFdJRHpBTkZLQVVrTlErUGdVdzFhb2dxdFhJZHB6NTF2NFZJNDhl?=
 =?utf-8?B?WDRjaFJndVhNVy9XMCs4Qm5Uamd2aTJ0SDFWcXg1YmNBek0rMlVPWmpXK3NL?=
 =?utf-8?B?NG13em9VZElhSFV6anJsSlNtOWpYUE4yakExQ3c5TEtXTkI4QUNpRVZxT0t5?=
 =?utf-8?B?VXhWVC8wU3BlWkExYkh1QUQyMXAxUE9uclYxSlJHTmQ0TWEzdnB0dGpzTmpo?=
 =?utf-8?B?ZUYzRGFQVmNOS0hRWkVxaFRhbU9ua2s3SlJtU0MyWDVPa3NEMTZMd09EdEtS?=
 =?utf-8?B?SkRRRGVKaUp3ZjRIZVE3RlFQOHRrajZMU3F4aUgzeEJkakVCNklka0tXazE4?=
 =?utf-8?B?MEtEbk5DRi9oTWozRDMyTTNVVVpyOFVrRmNKWVZUQmhiOUtmc2I2YTZ2akpJ?=
 =?utf-8?B?TjduaUxlRnViSzVlbkptTTB0Z1duU3VFUmFNRVdxdjhsZlA2dDJHOHg5a3dG?=
 =?utf-8?B?cS9OcmVha25hWkZNOUg5SmtvWW1yenFQaE5tTkdQUzZQNm1KVkxWYlcwTmxj?=
 =?utf-8?B?Mi9XNUtqSzhaSVJ5QXFFZnlSZEJWWnVmTE5Uc09UdDM2S09EaHNYVDV6VTUz?=
 =?utf-8?B?ZHZUcWw4RVlBNkF2b2pnZkM2L0hmYXp1ZlhWWGx3VnBJTkliNkR3TVJUZUxv?=
 =?utf-8?B?RHgwRGxCakhLVWNYbEUzWDgzOFZObURRSkZ6dnJNRUNra1k0eUhzc3lLT2lN?=
 =?utf-8?B?TjVxY1lNTWhyQy9MamhNajZHUkJSRVBSVFk4ODVIVlJPZUU5Uyt6a2JCMGFP?=
 =?utf-8?B?Uzg3c0kwZ0xFRmhJMUFJWUpJcWpZNTlYY09rd1c0NUFJQ0NGWkIxZnJtWXZV?=
 =?utf-8?B?R3JidVZGdHhSWkgveWRjaEJ0MCszSmk4aGJWT0cvNWhNcW13YzRQMWU4NjVH?=
 =?utf-8?B?TDRTNHdlOTFET0crYytLelk0RWFOaGZUZmEya2l3TW00Z05OREQ3TS9RYTV3?=
 =?utf-8?B?TDZZWTk4a0ZHUWd4dHhhc2JueE5hMWt5YzJWT1A1VFhlSjlMZEp2eEx2dWNM?=
 =?utf-8?B?aDhPdkgvQ3piVE9mRlVKV0U4amhlcS9zMnV1bjNYa2ZiV2lMb3lVV2lNVC9r?=
 =?utf-8?B?KzlEUktFNk5hckZqUDJJOU9HVll6RWxPS2pnRld6ZmlSSTZqTTM1ems0NHRW?=
 =?utf-8?B?SDIrTDl6OXI4RkcvM0hleEQzU2JtblV1d0VwVHlqcGM3OVk0VG9IeWJTV1Yr?=
 =?utf-8?B?RTRBeDQ5Um9WWVQ2aVlUZkFwWERJL2lwbUVJWUVrUFU5eW5FKzV3Ym90Umli?=
 =?utf-8?B?WjgrVjl3YjZZYkVxaEZiZi9nWFYzZFIwOW9Qa1dUUnZ6N1drMmNqbkttK2U2?=
 =?utf-8?B?UTdmemNnSUpGNTFuKzJCd1RMVC96bTh0OE9WS2pyMENDNEpOa2I3RG1qS1Nr?=
 =?utf-8?B?YnhqYmpyb2JBN0J1alpCR3ZqcVNVK2RaTVNXRjdWbHNhd2ZyZ3o0WlJPYWxO?=
 =?utf-8?B?cUMyQzRKbXY0Rko0SnJtSFR2WTlHNXQweVU4S3ZtVFRFemVVajlXQjFtcGp3?=
 =?utf-8?Q?HT8epxQmN31+rflOaRLlG/n94wX6bQ3m?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2024 07:06:22.4012
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 4816063e-36ca-40a2-ed6c-08dcc72fec7a
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	MN1PEPF0000F0E5.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4162



On 28/08/2024 01:45, Andrew Cooper wrote:
> 
> 
> for_each_set_bit() allocates its own variable intentionally as loop-scope
> only.  Unfortunately, this causes the inner 'i' to shadow the outer 'i'.
NIT: I'd mention it violates MISRA R5.3

> 
> Drop the outermost 'i' and 'vcpuid' variables, moving them into a more narrow
> scope and correcting them to be unsigned which they should have been all
> along.
> 
> Fixes: 9429f1a6c475 ("ARM/vgic: Use for_each_set_bit() in vgic_to_sgi()")
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien@xen.org>
> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
> CC: Bertrand Marquis <bertrand.marquis@arm.com>
> CC: Michal Orzel <michal.orzel@amd.com>
> ---
>  xen/arch/arm/vgic.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
> index 8ffe099bcb5f..6ecd9146511c 100644
> --- a/xen/arch/arm/vgic.c
> +++ b/xen/arch/arm/vgic.c
> @@ -468,8 +468,6 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
>                   int virq, const struct sgi_target *target)
>  {
>      struct domain *d = v->domain;
> -    int vcpuid;
> -    int i;
>      unsigned int base, bitmap;
> 
>      ASSERT( virq < 16 );
> @@ -483,7 +481,8 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
> 
>          for_each_set_bit ( i, bitmap )
>          {
> -            vcpuid = base + i;
> +            unsigned int vcpuid = base + i;
With this change you should replace the printk specifier from %d to %u for vcpuid.

Apart from that:
Reviewed-by: Michal Orzel <michal.orzel@amd.com>

~Michal


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 07:51:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 07:51:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784533.1193900 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjDSu-0004aw-Fq; Wed, 28 Aug 2024 07:51:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784533.1193900; Wed, 28 Aug 2024 07:51:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjDSu-0004ap-CZ; Wed, 28 Aug 2024 07:51:40 +0000
Received: by outflank-mailman (input) for mailman id 784533;
 Wed, 28 Aug 2024 07:51:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rm2h=P3=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sjDSt-0004aj-8w
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 07:51:39 +0000
Received: from mail-oo1-xc32.google.com (mail-oo1-xc32.google.com
 [2607:f8b0:4864:20::c32])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5a475609-6512-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 09:51:37 +0200 (CEST)
Received: by mail-oo1-xc32.google.com with SMTP id
 006d021491bc7-5d5c7f24372so4756941eaf.0
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 00:51:37 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5a475609-6512-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724831496; x=1725436296; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=bP0plvhO8YHIsonleWKg3q16oNG+zil+AkCgzONfyBQ=;
        b=SbTajC1TCr40RuRF0Wy8PLwiSB7ZUN8WyFVN+9M0qN29JJy+UHX8WGFt6mWjpqU4un
         u8cpdGoJxGSK3rxYs8bqAGoAyd/EDVvCQKe8lfhfYpTQCfkV4eaxJnQmpFrPns2O0bjE
         I3pbiabiQ+HOQXAOILUsa1f3km/tTbjVnm5kY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724831496; x=1725436296;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=bP0plvhO8YHIsonleWKg3q16oNG+zil+AkCgzONfyBQ=;
        b=Xvj293mevAB0gwBG93BV5uXZzjrwXkmPvAUH1QqtFGOJi9xlWLH6fb1TMO/aCmvdBG
         D9lkuG9Nc2NxNLwSNwqj9ynX2nhxD943Xz3dnE/Y7jZLo7refxhnYD4dVxnzZuYtsYLh
         /Yn+VuQUwreSvgA6E7OJBXKSEdonHxAYO9MPewRfe3EgSgnhOd/6ItobiKC11/ov+8un
         +DpOxmo8z/fHqvlpDVBBlRInn2M0GVXaESQuApyitY9Od1cCa/fBfmM1bglXAiNFwVSv
         RgTwsT1aVGlzxptsgXBOnOmCwr60z9Aebwx4fgx8yOG+deJ5JrL4xMnFZUdwSXD2ZzVj
         ZvdA==
X-Forwarded-Encrypted: i=1; AJvYcCX+jfbftQojmhcGxxQWsbTsRr4EhVjjNwEkrsMFWrxVZqIkG7H5ykUt+MBe2QArw0ehbAwQbhnXBc4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwUEI81c3e/sohpf3+rcUvMkjf7lFHmf4SgY2ozWwO2IqciNW9a
	RD8ZqAhtsj9nH1Z11m3MTwdcBEZ61zLEnU77nVmSeuwJr/JYXZfDGWfaTZduJkreRzYrFFXo/JL
	M5GWcctYvbH7uH7Zqh+O4X51t/20P77wE12Oq8Q==
X-Google-Smtp-Source: AGHT+IESSV+TPXt8tKq9x8lQN6dWAmfZ92AelsD0FYE36oZjHpVkgT1RLgqbmnMLYkiwOJ9fm+2VH1huJjrctf6RdtI=
X-Received: by 2002:a05:6820:80f:b0:5dc:a733:d984 with SMTP id
 006d021491bc7-5df866c0974mr1211152eaf.1.1724831496412; Wed, 28 Aug 2024
 00:51:36 -0700 (PDT)
MIME-Version: 1.0
References: <20240822152953.489136-1-frediano.ziglio@cloud.com>
 <55e6dc6c-344a-4483-90c2-e414ef4bc869@suse.com> <CACHz=ZgbU3-HBgoDC9ws=cCK10B2D4K2JxjLN3_0YGoksVep8w@mail.gmail.com>
 <527b3a0f-3e86-47aa-9092-e67df329b7e9@suse.com>
In-Reply-To: <527b3a0f-3e86-47aa-9092-e67df329b7e9@suse.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Wed, 28 Aug 2024 08:51:25 +0100
Message-ID: <CACHz=ZgdCMbkgJfirf=O-kt0mRqUkjXVgfETjZqQbhH-URZ1cw@mail.gmail.com>
Subject: Re: [PATCH] Avoid additional relocations in trampoline code
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
	Alejandro Vallejo <alejandro.vallejo@cloud.com>, xen-devel@lists.xenproject.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Aug 27, 2024 at 4:50=E2=80=AFPM Jan Beulich <jbeulich@suse.com> wro=
te:
>
> On 27.08.2024 15:56, Frediano Ziglio wrote:
> > On Mon, Aug 26, 2024 at 9:21=E2=80=AFAM Jan Beulich <jbeulich@suse.com>=
 wrote:
> >>
> >> On 22.08.2024 17:29, Frediano Ziglio wrote:
> >>> The trampoline could have "manual" relocation entries (created
> >>> by assembly macros and some code to use them) and (in case of PE)
> >>> normal executable relocations.
> >>> Remove all normal executable ones. In this way we don't have to
> >>> worry about applying both correctly (they need proper order
> >>> which is hard to spot looking at the code).
> >>>
> >>> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
> >>
> >> I think this wants splitting into one patch replacing sym_offs() and a
> >> 2nd one introducing the hand-crafted __XEN_VIRT_START additions (which
> >> may want macro-izing). Plus the justification for the change wants
> >> extending, to actually explain what the problem is - after all there's
> >> no issue anywhere right now.
> >
> > Should I explain the time dependency issue with source code?
>
> Time dependency? I guess I don't understand ...
>

You have a time dependency between 2 code path when one has to be
executed before/after another.
Some patterns are expected (you don't call a method on a destroyed
object) but nasty hidden ones makes code more complicated and less
robust, making code changes harder and program fragile.
In that specific case the copy of the trampoline, for EFI path, is
done after relocation rollback. In that specific code path, you are
executing code which is not meant to be executed at that location (now
should be executed at higher locations) hoping that compiler/binary
code can cope with it. The code should relocate back and switch to
higher locations as quick as possible.

> > I suppose I can describe where currently is and why it would be better
> > to have it removed (honestly I though I did but reading the commit
> > message I didn't).
> > Maybe for search reasons it would be better to define 2 macros like
> > the following?
> >
> > #define phys_addr(sym) sym ## _pa
> > #define virt_addr(sym) sym ## _va
> >
> > This way, for instance, searching for the "__high_start" word (like
> > "grep -rw __high_start") would produce a result.
>
> I assume it's best to keep everything there together, so see below.
>
> >> With the sym_offs() uses gone, I think it would be best if the macro w=
as
> >> #undef-ed ahead of the inclusion of trampoline.S. Since x86_64.S uses =
the
> >> macro, that'll require careful re-arrangement of #include order.
> >>
> >
> > I think you mean including the trampoline after including x86_64.S in
> > head.S.
>
> Yes.
>

That worked like a charm!

> >>> --- a/xen/arch/x86/xen.lds.S
> >>> +++ b/xen/arch/x86/xen.lds.S
> >>> @@ -71,7 +71,12 @@ SECTIONS
> >>>    __2M_text_start =3D .;         /* Start of 2M superpages, mapped R=
X. */
> >>>  #endif
> >>>
> >>> -  start_pa =3D ABSOLUTE(start - __XEN_VIRT_START);
> >>> +#define DEFINE_PA_ADDRESS(sym) sym ## _pa =3D ABSOLUTE(sym - __XEN_V=
IRT_START)
> >>> +  DEFINE_PA_ADDRESS(start);
> >>> +  DEFINE_PA_ADDRESS(saved_magic);
> >>> +  DEFINE_PA_ADDRESS(idle_pg_table);
> >>> +  DEFINE_PA_ADDRESS(__high_start);
> >>> +  DEFINE_PA_ADDRESS(s3_resume);
> >>>
> >>>    . =3D __XEN_VIRT_START + XEN_IMG_OFFSET;
> >>>    _start =3D .;
> >>
> >> For the cases where in assembly code you add __XEN_VIRT_START this is =
pretty
> >> odd: You subtract the value here just to add it back there. Did you co=
nsider
> >> a more straightforward approach, like introducing absolute xxx_va symb=
ols?
> >
> > I didn't consider. Would something like
> >
> > #define DEFINE_ABS_ADDRESSES(sym) \
> >    sym ## _pa =3D ABSOLUTE(sym - __XEN_VIRT_START); \
> >    sym ## _va =3D ABSOLUTE(sym)
> >
> > make sense? Maybe the _pa and _va suffixes are too similar? Maybe
> > _physaddr and _virtaddr? Or use capical letters and macros (as above)
> > to avoid possible clashes?
>
> I'd like to ask that we don't introduce symbols we don't actually use. He=
nce
> a single macro defining both is probably not going to be overly helpful. =
As
> to capital letters: I'm struggling with the "(as above)" - I don't see an=
y
> use of capital letters in symbol names being generated. But yes, I was go=
ing
> to suggest to consider _VA and _PA tags, precisely to reduce the risk of
> clashes.
>

Unfortunately this worked but is producing these warnings which are
pretty annoying:

ld: ./.xen.efi.0xffff82d040000000.0: stripping non-representable
symbol 'saved_magic_va' (value 0xffff82d040816018)

I tried to remove them somehow, but I didn't find any way (no hidden
symbols, not been able to force the linker to strip it and not
complain).
I think I'll get back to the single "pa" symbol, this time with _PA
suffix, maybe hidden, and adding macros (phys_addr/virt_addr) to make
clear the purpose.

> Jan

I'll try to split the patch as suggested, although it will be hard to
come with a sensible message for the second commit.

Regards,
  Frediano


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 08:13:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 08:13:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784543.1193909 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjDnp-0000Yd-71; Wed, 28 Aug 2024 08:13:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784543.1193909; Wed, 28 Aug 2024 08:13:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjDnp-0000YW-4H; Wed, 28 Aug 2024 08:13:17 +0000
Received: by outflank-mailman (input) for mailman id 784543;
 Wed, 28 Aug 2024 08:13: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=NRYu=P3=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjDno-0000YA-Og
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 08:13:16 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5f931227-6515-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 10:13:14 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a7a9cf7d3f3so808875266b.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 01:13:14 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e594a545sm206301166b.205.2024.08.28.01.13.13
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 01:13:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5f931227-6515-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724832794; x=1725437594; 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=fy3lVpWLV/wnb8UcTsEYO/zgSlhGphcsNDPNuSgPzq8=;
        b=bKXrtDx724+9SiS19I6r1QnEfufJnYjXJjgki47Ee54tIoHnN8nc7f4R7dGwlbRddS
         fnTbYlMpxrCxPIzww2Em1s0V7EH2QwFAE3lSGzLIsEFUDOo2vL5x4hsHiPtAFUCisyYl
         tizWHo/NVSh9GNqU0daUlkaYsTogP9VmKy7FKjKIMfJ6jxrPylRJjETRFwA+E+Dvzns9
         YoJIBUe15YleAldvyv1Uzza0S4zCS6VYYekH3sXRXvR8o0dolb7cQwnJZItq0cq+wh8C
         Iwd7hqLsByLRBejq0wglrEZETcZ3U/Ni9NmVrLf5q+ndjd03HU2KNNI25JGuethIQgAN
         faEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724832794; x=1725437594;
        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=fy3lVpWLV/wnb8UcTsEYO/zgSlhGphcsNDPNuSgPzq8=;
        b=cqMjSGTV7mqIBqAg7EjEoTjVhq9N4Hsq2RtQbHaDnREUTRiwNEoAADOnRM9ojIVFmS
         0IA/kCq7L40cbvS1ACGQASB0d8a2v7XsGEtvxSlHbihq/IXiq4nkQeiJWmMY17DjYNRP
         3dJhVVrOUMxdp83GMciGPZBSbo+aDwip/w4uYtxXn4hwrxY0mJ4ghDMNULajsPy0U44Z
         QWR4DQX+JgPUNWe8zvWBJlUd7K8a6xItnugXqzSJZb2XBvmunc/d1/iZKqZFwTHFhKrx
         IU1DSmBKotklsyUECw3FOQEfHaxMHh5c36EX+PYr5RjJ6T1RGqAt7QavfHKEoruFLTbj
         d3WA==
X-Forwarded-Encrypted: i=1; AJvYcCWCg3MnchUUe2c4iOJEtaP5Lc97Z9JAYJh2SyFE+QClf1W8Y9ZIDa5X/RcRxLlzl3fyHtSEDryuIV8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyKClV/Ig0lG/w2aMhSM5dP5vXS6ltk0OgcsVDPB/2jfyLJi4jd
	2hRNxA1CMd0Fq+AsBzg3MsnTBU9JVnVaXWx1tyw2iW1q5gLLG43E7NV8A1ySfw==
X-Google-Smtp-Source: AGHT+IEor1Q++j0VuS6BTuFaGvhKH619jyrUfcOczFEQIToEKn67fjOk9/X8zjszsbj+o83yRnvPuQ==
X-Received: by 2002:a17:907:1c1f:b0:a86:941f:49ac with SMTP id a640c23a62f3a-a86a54dfaedmr1178823966b.67.1724832793850;
        Wed, 28 Aug 2024 01:13:13 -0700 (PDT)
Message-ID: <2316ca39-50d4-4311-aeff-30be588245d9@suse.com>
Date: Wed, 28 Aug 2024 10:13:12 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/4] x86/hvm: Rework hpet_write() for improved code
 generation
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
 <20240827135746.1908070-4-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 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: <20240827135746.1908070-4-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27.08.2024 15:57, Andrew Cooper wrote:
> In the HPET_STATUS handling, the use of __clear_bit(i, &new_val) is the only
> thing causing it to be spilled to the stack.  Furthemore we only care about
> the bottom 3 bits, so rewrite it to be a plain for loop.
> 
> For the {start,stop}_timer variables, these are spilled to the stack despite
> the __{set,clear}_bit() calls.

That's an observation from what the compiler happens to do? I don't see any
other reason why they would need spilling; I expect it's merely a matter of
registers better be used for other variables. If we ever meant to build Xen
with APX fully in use, that might change. IOW may I at least ask for
s/are/happen to be/? I'm also a little irritated by "despite", but you're
the native speaker. It would have seemed to me that e.g. "irrespective of"
would better express what (I think) is meant.

>  Again we only care about the bottom 3 bits, so
> shrink the variables from long to int.  Use for_each_set_bit() rather than
> opencoding it at the end which amongst other things means the loop predicate
> is no longer forced to the stack by the loop body.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> 
> All in all, it's modest according to bloat-o-meter:
> 
>   add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-29 (-29)
>   Function                                     old     new   delta
>   hpet_write                                  2225    2196     -29
> 
> but we have shrunk the stack frame by 8 bytes; 0x28 as opposed to 0x30 before.

However, on the negative side all the first of the loops you touch now always
takes 3 iterations, when previously we may have got away with as little as
none. Is there a reason not to use

    for_each_set_bit ( i, new_val & ((1U << HPET_TIMER_NUM) - 1) )

there (with the masking of the low bit possibly pulled out)?

> @@ -533,19 +528,11 @@ static int cf_check hpet_write(
>      }
>  
>      /* stop/start timers whos state was changed by this write. */
> -    while (stop_timers)
> -    {
> -        i = ffsl(stop_timers) - 1;
> -        __clear_bit(i, &stop_timers);
> +    for_each_set_bit ( i, stop_timers )
>          hpet_stop_timer(h, i, guest_time);
> -    }
>  
> -    while (start_timers)
> -    {
> -        i = ffsl(start_timers) - 1;
> -        __clear_bit(i, &start_timers);
> +    for_each_set_bit ( i, start_timers )
>          hpet_set_timer(h, i, guest_time);
> -    }

To avoid variable shadowing, I think you don't want to use i in these two
loops. Alternatively the function scope i would need constraining to the
individual loops.

Unrelated to the change you make, but related to the code you touch: Isn't
there a bug there with the length != 8 handling ahead of the switch()? The
bits being write-1-to-clear, using the value read for parts the original
insn didn't write means we might clear ISR bits we weren't asked to clear.
I guess I'll make a patch, which may want to go ahead of yours for ease of
backporting. (Of course guests should have no need to write to other than
the bottom part of the register, but still.)

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 09:00:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 09:00:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784553.1193920 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjEXa-0000tn-Ld; Wed, 28 Aug 2024 09:00:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784553.1193920; Wed, 28 Aug 2024 09:00:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjEXa-0000tg-Hh; Wed, 28 Aug 2024 09:00:34 +0000
Received: by outflank-mailman (input) for mailman id 784553;
 Wed, 28 Aug 2024 09:00:33 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NRYu=P3=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjEXZ-0000ta-Np
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 09:00:33 +0000
Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com
 [2a00:1450:4864:20::632])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fab0c2d2-651b-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 11:00:31 +0200 (CEST)
Received: by mail-ej1-x632.google.com with SMTP id
 a640c23a62f3a-a868d7f92feso822691166b.2
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 02:00:31 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e594a545sm212828166b.205.2024.08.28.02.00.30
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 02:00:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fab0c2d2-651b-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724835631; x=1725440431; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=IDlXVI4tN1z7T+KNMK8D/vgvXHZ0aqeWrPhpeNr3oGI=;
        b=ah7AC7Zl23ipu5eq4c5/0ncSewAz+AsIDt7RpttT3A00tHTu/fHT0JtshmAyazk1wi
         TEACT8x4qyL+UZcFaTKz+fsLg5Bvsjt/M5/I9dxPcUpuhhX3RvrKqCHl1LTSd0I3kDDM
         kdffRlIwqzb+w8RFQn+Z4BkE3P53bHrpDx0/RLDUrHfiusm75uD0wK8aOZzn1ogObsto
         mWDk9YF4vxKtEq3K10cFICk/HpOlaEOyqM7aCR0HgsYKyRFIQ3ORtaiaSr8u4G91GP9u
         gCeOCCTl/YsAVQFMwNEAR5ryzpJ+9TzfJOemV24CId6BYDInZwAh9t6Zmt+b5cxD4f1g
         w6Sg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724835631; x=1725440431;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=IDlXVI4tN1z7T+KNMK8D/vgvXHZ0aqeWrPhpeNr3oGI=;
        b=h/2Vu/CjeGouE5OLRyyHnbGwNNc0QcUHXxHYwvHus+Ippv7eRfHxsfWuzpJqSei4Eo
         jkOndh5f68n8umhU2e+EV/drU7W5n27Bm+WCRGaYRYrl+G86N6YyeR+WLZQMs8KlFnuJ
         wCnXS/TW6qZV0baiKsTNSsJ38WZHckH6B6rb4807KvDivWugmY4lzob9YAjCmxk5yTh4
         oLlDWyycU29E45x0jzmL+eWowE7XBJb+31zxtRsnXxkZ8ssAZ6VmqmWs2Aa6bo3oPPSf
         LVZzBmBFS+G2lxGpOxml4Of0ke4Fz3eDMfbnZwJ6XNoxETfWKV9hsRrpKtQkdFRbezRV
         70IQ==
X-Gm-Message-State: AOJu0Yy9Pb/YplcrwRFAs+651+xvtwJ1RBCDgYJs78HWOL1NwgrRM60U
	wPs1pgG0X7p2eRWxvx/s1VJJx3kG95oNl2an+0eyHoT6jyZOSPAwND9NFyphzg7j8emrGfaLB4g
	=
X-Google-Smtp-Source: AGHT+IGHpx7Xudff8ARLDevvbz3QNV7fJG1J76Ibn5Mnv56P9WECyyj73XMjM7T7Gsm5H0pq4MV8+w==
X-Received: by 2002:a17:907:9724:b0:a86:95ff:f3a0 with SMTP id a640c23a62f3a-a86a5188d5fmr1133283866b.3.1724835631012;
        Wed, 28 Aug 2024 02:00:31 -0700 (PDT)
Message-ID: <da785047-0bee-4d16-a6ae-d1727bd8317a@suse.com>
Date: Wed, 28 Aug 2024 11:00:29 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86/HVM: correct partial HPET_STATUS write emulation
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

For partial writes the non-written parts of registers are folded into
the full 64-bit value from what they're presently set to. That's wrong
to do though when the behavior is write-1-to-clear: Writes not
including to low 3 bits would unconditionally clear all ISR bits which
are presently set. Re-calculate the value to use.

Fixes: be07023be115 ("x86/vhpet: add support for level triggered interrupts")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
Alternatively we could also suppress the folding in of read bits, but
that looked to me to end up in a more intrusive change.

--- a/xen/arch/x86/hvm/hpet.c
+++ b/xen/arch/x86/hvm/hpet.c
@@ -404,7 +404,8 @@ static int cf_check hpet_write(
         break;
 
     case HPET_STATUS:
-        /* write 1 to clear. */
+        /* Write 1 to clear. Therefore don't use new_val directly here. */
+        new_val = val << ((addr & 7) * 8);
         while ( new_val )
         {
             bool active;


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 09:20:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 09:20:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784559.1193931 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjEqM-0003rW-1y; Wed, 28 Aug 2024 09:19:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784559.1193931; Wed, 28 Aug 2024 09:19:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjEqL-0003rP-TK; Wed, 28 Aug 2024 09:19:57 +0000
Received: by outflank-mailman (input) for mailman id 784559;
 Wed, 28 Aug 2024 09:19: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=NRYu=P3=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjEqL-0003rJ-28
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 09:19:57 +0000
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com
 [2a00:1450:4864:20::130])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id afe40007-651e-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 11:19:54 +0200 (CEST)
Received: by mail-lf1-x130.google.com with SMTP id
 2adb3069b0e04-52f01b8738dso4989501e87.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 02:19:54 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e548624asm216155866b.42.2024.08.28.02.19.53
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 02:19:53 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: afe40007-651e-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724836794; x=1725441594; 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=gzAfXzTdCHjqWg+HQHn50qpCjr6L3XGf7gdJY3A+lgQ=;
        b=L5CKOFabTYdbAxKXVLzujKFGykIeugOYsziLsYe3UUvlOlrzKPHvJ7I5MfjkW54V/T
         3hgEbgjeNCCo2kjy9QgpRV/MtmP1C878kOXIIpASqxiWfV4IrO0Awu2i55bBfMHAHjdx
         wgSH9xfV2gZiQcDav1Pipu1AWonwykcS++xhdgjmHZKxEDfYOkSVHyZNkl/o9KhT06G8
         9ToSnh3z2hJrgZCVgORAe+WAicX3tfRt7uUT9Z+LNjSSlZoiPt5v6YAwkS0evDDt+kQm
         8tx5UdnZhrZYHgH1FgpBkEz2JTkH5EhHemsfGJ8cw5p+dayFdmAGh3yXWw6up3QFViW5
         AOoA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724836794; x=1725441594;
        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=gzAfXzTdCHjqWg+HQHn50qpCjr6L3XGf7gdJY3A+lgQ=;
        b=rveuXuCciS2XbSk8Mfn7/GqWseV8+AHunGLMjGTY4wklzmxyc2x/3apwN5sQU24/2O
         PLe23WWY0ZbcVNCktyJYtRHN7MTFzspfVmHAHDywP15y9q05PwtiujjzbfcGsF1cebiX
         3QwSC6Cd33erbbRRVa3COSNjH4HrVQK/O4ycfyv/jd+43Q+8UlIadwd4ErrmLQ9odhG8
         yTN1MmmlFr0fVm3o/bmafj9+RYSKORhrmM1Hl074HpJI4rz4ecS3sq1AxIqStqWyX2U6
         lucotJn2famigyLaE5EdX2vwS1NFSqYFxaSbvIKelQ/c1owa0OVRmhLTxiOvTOMFsNQU
         pmqA==
X-Forwarded-Encrypted: i=1; AJvYcCU5VcVfSInWKjXZitblcmojcX9qyUI6/6fJjtinpulSJeyKWrPoJxi6F/JEugswT2ZAVKGxCA8m+xI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzQt2VTwVVCLTGUB/4ASltji9M8JnjH5k/C/+Bpv82a86lcci+J
	XLkWg1OBX/EJcrRhf5T3jZXDal1mLvYHEtBoGQiKuqx/adng6s2RF28He6U5mw==
X-Google-Smtp-Source: AGHT+IEkhPX0eVXKuw1C0qpQQpNqZBGtT/JvuUkbb8i51BGQya+3f+OPPPWjVRuN0DjemfngLl7+eQ==
X-Received: by 2002:a05:6512:ba7:b0:52b:c0b1:ab9e with SMTP id 2adb3069b0e04-5343875589fmr10580294e87.5.1724836793941;
        Wed, 28 Aug 2024 02:19:53 -0700 (PDT)
Message-ID: <d022a5b1-c0ca-4399-b972-b01d834a95ec@suse.com>
Date: Wed, 28 Aug 2024 11:19:52 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 4/4] x86/vmx: Rewrite vmx_sync_pir_to_irr() to be more
 efficient
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
 <20240827135746.1908070-5-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240827135746.1908070-5-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 27.08.2024 15:57, Andrew Cooper wrote:
> There are two issues.  First, pi_test_and_clear_on() pulls the cache-line to
> the CPU and dirties it even if there's nothing outstanding, but the final
> for_each_set_bit() is O(256) when O(8) would do,

Nit: That's bitmap_for_each() now, I think. And again ...

> and would avoid multiple
> atomic updates to the same IRR word.
> 
> Rewrite it from scratch, explaining what's going on at each step.
> 
> Bloat-o-meter reports 177 -> 145 (net -32), but the better aspect is the
> removal calls to __find_{first,next}_bit() hidden behind for_each_set_bit().

... here, and no underscore prefixes on the two find functions.

> --- a/xen/arch/x86/hvm/vmx/vmx.c
> +++ b/xen/arch/x86/hvm/vmx/vmx.c
> @@ -2317,18 +2317,72 @@ static void cf_check vmx_deliver_posted_intr(struct vcpu *v, u8 vector)
>  
>  static void cf_check vmx_sync_pir_to_irr(struct vcpu *v)
>  {
> -    struct vlapic *vlapic = vcpu_vlapic(v);
> -    unsigned int group, i;
> -    DECLARE_BITMAP(pending_intr, X86_NR_VECTORS);
> +    struct pi_desc *desc = &v->arch.hvm.vmx.pi_desc;
> +    union {
> +        uint64_t _64[X86_NR_VECTORS / (sizeof(uint64_t) * 8)];

Using unsigned long here would imo be better, as that's what matches
struct pi_desc's DECLARE_BITMAP().

> +        uint32_t _32[X86_NR_VECTORS / (sizeof(uint32_t) * 8)];
> +    } vec;
> +    uint32_t *irr;
> +    bool on;
>  
> -    if ( !pi_test_and_clear_on(&v->arch.hvm.vmx.pi_desc) )
> +    /*
> +     * The PIR is a contended cacheline which bounces between the CPU(s) and
> +     * IOMMU(s).  An IOMMU updates the entire PIR atomically, but we can't
> +     * express the same on the CPU side, so care has to be taken.
> +     *
> +     * First, do a plain read of ON.  If the PIR hasn't been modified, this
> +     * will keep the cacheline Shared and not pull it Excusive on the current
> +     * CPU.
> +     */
> +    if ( !pi_test_on(desc) )
>          return;
>  
> -    for ( group = 0; group < ARRAY_SIZE(pending_intr); group++ )
> -        pending_intr[group] = pi_get_pir(&v->arch.hvm.vmx.pi_desc, group);
> +    /*
> +     * Second, if the plain read said that ON was set, we must clear it with
> +     * an atomic action.  This will bring the cachline to Exclusive on the

Nit (from my spell checker): cacheline.

> +     * current CPU.
> +     *
> +     * This should always succeed because noone else should be playing with
> +     * the PIR behind our back, but assert so just in case.
> +     */
> +    on = pi_test_and_clear_on(desc);
> +    ASSERT(on);
> +
> +    /*
> +     * The cacheline is now Exclusive on the current CPU, and because ON was

"is" is pretty ambitious. We can only hope it (still) is.

> +     * set, some other entity (an IOMMU, or Xen on another CPU) has indicated
> +     * that at PIR needs re-scanning.

Stray "at"?

> +     *
> +     * Note: Entities which can't update the entire cacheline atomically
> +     *       (i.e. Xen on another CPU) are required to update PIR first, then
> +     *       set ON.  Therefore, there is a corner case where we may have
> +     *       found and processed the PIR updates "last time around" and only
> +     *       found ON this time around.  This is fine; the logic still
> +     *       operates correctly.
> +     *
> +     * Atomically read and clear the entire pending bitmap as fast as we, to

Missing "can" before the comma?

> +     * reduce the window where another entity may steal the cacheline back
> +     * from us.  This is a performance concern, not a correctness concern.  If
> +     * the another entity does steal the cacheline back, we'll just wait to

"the other"?

> +     * get it back again.
> +     */
> +    for ( unsigned int i = 0; i < ARRAY_SIZE(vec._64); ++i )
> +        vec._64[i] = xchg(&desc->pir[i], 0);
> +
> +    /*
> +     * Finally, merge the pending vectors into IRR.  The IRR register is
> +     * scattered in memory, so we have to do this 32 bits at a time.
> +     */
> +    irr = (uint32_t *)&vcpu_vlapic(v)->regs->data[APIC_IRR];
> +    for ( unsigned int i = 0; i < ARRAY_SIZE(vec._32); ++i )
> +    {
> +        if ( !vec._32[i] )
> +            continue;
>  
> -    bitmap_for_each ( i, pending_intr, X86_NR_VECTORS )
> -        vlapic_set_vector(i, &vlapic->regs->data[APIC_IRR]);
> +        asm ( "lock or %[val], %[irr]"
> +              : [irr] "+m" (irr[i * 0x10])

This wants to be irr * 4 only, to account for sizeof(*irr) == 4.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 09:20:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 09:20:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784560.1193940 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjEqb-00053t-Ba; Wed, 28 Aug 2024 09:20:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784560.1193940; Wed, 28 Aug 2024 09:20:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjEqb-00053m-7O; Wed, 28 Aug 2024 09:20:13 +0000
Received: by outflank-mailman (input) for mailman id 784560;
 Wed, 28 Aug 2024 09:20:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rm2h=P3=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sjEqa-00052T-36
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 09:20:12 +0000
Received: from mail-qv1-xf2f.google.com (mail-qv1-xf2f.google.com
 [2607:f8b0:4864:20::f2f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b93be8dd-651e-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 11:20:10 +0200 (CEST)
Received: by mail-qv1-xf2f.google.com with SMTP id
 6a1803df08f44-6bf6beda0c0so35099476d6.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 02:20:10 -0700 (PDT)
Received: from fziglio-xenia-fedora.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6c162d21710sm63763296d6.11.2024.08.28.02.20.08
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 02:20:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b93be8dd-651e-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724836809; x=1725441609; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=4RGhBHc552V5isJ2kp8ZF0VtasdROqoNs8OcgQhRR7c=;
        b=OM2YtuxsRZBYxMM/2nC1oTfCSgSkVpSwrQlziQYVtKxwho5Q+WnFoc+hYdmM7THtmZ
         Hj1b6dqObWJQGbQI9pAF5m+7NL03OTyPWSoZOvzdnly0uLGgd2ZpXkANcfmo2oPJqEb8
         vnxFXCt2Z+8Scb2uJ8gyVtKPoKYL9Od75QJN4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724836809; x=1725441609;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=4RGhBHc552V5isJ2kp8ZF0VtasdROqoNs8OcgQhRR7c=;
        b=EK+q+xIqD7is6BtPHAnBD+JbbbG02yDmpRBcpCpkvqKt+BiRH4bHpEdta5k+wPWpCh
         hLrO3H8GovFMIJh5PsLVB+RxKPrq7FsZ7JAc+/1fma08/1TON6gvHhnG3m2vsnGVLQWi
         zEYQv93UqCt4SUoegcb2ux5mDMAnzBNJHVXuZtrgWKWQvJXwVeHiaUs9fyKGHYA9UxBw
         0MYOUc+AtTSPmUbbDB0ufEQScw7PbeT5Q7WTEZqTMbeHEbcUnDdijRspAv1WVTZKvdgC
         /yUuS/6J7nYl5bVs9eV7ZD7O9As8idf9ak+qkcefYrLrc4fB4eNQFqwWRsSct07YBn/7
         WWYA==
X-Gm-Message-State: AOJu0YzAFoMcNjStMWKrWvYPAbX0O9RlzEjhFqbylJBR86gtwcAqhINJ
	9lWHYmm/5dV0mNQHafhlHtmHrBjALTX8GdNJkdwMjLNsZi32CaJ2WvjdbXTCK2Zo/HqZ+mqSzXj
	K
X-Google-Smtp-Source: AGHT+IHxRkJdClhb6Gw3jEDOTUxCeI/er0Xo4kT911pY124/51QCpurE13swPk/asc4qF65QJgh7wg==
X-Received: by 2002:a05:6214:5987:b0:6b5:e2da:8bec with SMTP id 6a1803df08f44-6c16deb85f1mr194733766d6.55.1724836809441;
        Wed, 28 Aug 2024 02:20:09 -0700 (PDT)
From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v2 1/2] x86/boot: Avoid relocations in trampoline code to physical addresses
Date: Wed, 28 Aug 2024 10:19:53 +0100
Message-ID: <20240828091956.127760-1-frediano.ziglio@cloud.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The trampoline could have "manual" relocation entries (created
by assembly macros and some code to use them) and (in case of PE)
normal executable relocations.
Remove some normal executable ones. In this way we don't have to
worry about applying both correctly (they need proper order
which is hard to spot looking at the code).
Specifically in efi_arch_post_exit_boot trampoline is copied after
fixing relocations with efi_arch_relocate_image. These time dependencies
between different part of code are hard to spot making hard to change
code. In this case the copy is done in a state where code should be run
at higher locations so it would be better to reduce the code between
calling efi_arch_relocate_image and jumping to higher location.
Absolute symbols are defined by linker in order to avoid relocations.
These symbols use a "_PA" suffix to avoid possible clashes.
phys_addr macro is used to make more clear the address we want and making
symbol search easier.
sym_offs and sym_esi are undefined to avoid the usage of them which
would lead to relocations.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/head.S       | 6 ++++--
 xen/arch/x86/boot/trampoline.S | 9 ++++++++-
 xen/arch/x86/boot/wakeup.S     | 4 ++--
 xen/arch/x86/xen.lds.S         | 9 +++++++--
 4 files changed, 21 insertions(+), 7 deletions(-)
---
Changes since v1:
- add subject prefix to commit messages;
- more explanation of the improvement;
- use upper case for suffix to avoid clashes;
- undefine some macros to avoid usage of them;
- use some macros to make code more clear;
- use hidden symbols;
- split change in 2 commits.

diff --git a/xen/arch/x86/boot/head.S b/xen/arch/x86/boot/head.S
index d8ac0f0494..a8a14060b6 100644
--- a/xen/arch/x86/boot/head.S
+++ b/xen/arch/x86/boot/head.S
@@ -870,8 +870,10 @@ cmdline_parse_early:
 reloc:
         .incbin "reloc.bin"
 
+#include "x86_64.S"
+
+        .section .init.text, "ax", @progbits
+
 ENTRY(trampoline_start)
 #include "trampoline.S"
 ENTRY(trampoline_end)
-
-#include "x86_64.S"
diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index b8ab0ffdcb..3a6eb942a7 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -16,6 +16,11 @@
  * not guaranteed to persist.
  */
 
+/* We don't want relocation in the trampoline.
+ * Undefine some macros generating relocations. */
+#undef sym_offs
+#undef sym_esi
+
 /* NB. bootsym() is only usable in real mode, or via BOOT_PSEUDORM_DS. */
 #undef bootsym
 #define bootsym(s) ((s)-trampoline_start)
@@ -34,6 +39,8 @@
         .long 111b - (off) - .;            \
         .popsection
 
+#define phys_addr(sym) sym ## _PA
+
 /* Start of the permanent trampoline code. */
 
         .code16
@@ -73,7 +80,7 @@ trampoline_protmode_entry:
         mov     %ecx,%cr4
 
         /* Load pagetable base register. */
-        mov     $sym_offs(idle_pg_table),%eax
+        mov     $phys_addr(idle_pg_table), %eax
         add     bootsym_rel(trampoline_xen_phys_start,4,%eax)
         mov     %eax,%cr3
 
diff --git a/xen/arch/x86/boot/wakeup.S b/xen/arch/x86/boot/wakeup.S
index 08447e1934..ae4dd5eb40 100644
--- a/xen/arch/x86/boot/wakeup.S
+++ b/xen/arch/x86/boot/wakeup.S
@@ -99,7 +99,7 @@ wakeup_32:
         mov     $bootsym_rel(wakeup_stack, 4, %esp)
 
         # check saved magic again
-        mov     $sym_offs(saved_magic),%eax
+        mov     $phys_addr(saved_magic), %eax
         add     bootsym_rel(trampoline_xen_phys_start, 4, %eax)
         mov     (%eax), %eax
         cmp     $0x9abcdef0, %eax
@@ -112,7 +112,7 @@ wakeup_32:
         mov     %ecx, %cr4
 
         /* Load pagetable base register */
-        mov     $sym_offs(idle_pg_table),%eax
+        mov     $phys_addr(idle_pg_table), %eax
         add     bootsym_rel(trampoline_xen_phys_start,4,%eax)
         mov     %eax,%cr3
 
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 9a1dfe1b34..5cfbd2524a 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -22,7 +22,7 @@ ENTRY(efi_start)
 
 #define FORMAT "elf64-x86-64"
 
-ENTRY(start_pa)
+ENTRY(start_PA)
 
 #endif /* EFI */
 
@@ -71,7 +71,12 @@ SECTIONS
   __2M_text_start = .;         /* Start of 2M superpages, mapped RX. */
 #endif
 
-  start_pa = ABSOLUTE(start - __XEN_VIRT_START);
+#define DEFINE_PA_ADDRESS(sym) \
+  HIDDEN(sym ## _PA = ABSOLUTE(sym - __XEN_VIRT_START))
+
+  DEFINE_PA_ADDRESS(start);
+  DEFINE_PA_ADDRESS(saved_magic);
+  DEFINE_PA_ADDRESS(idle_pg_table);
 
   . = __XEN_VIRT_START + XEN_IMG_OFFSET;
   _start = .;
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 09:20:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 09:20:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784561.1193950 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjEqc-0005KM-Jg; Wed, 28 Aug 2024 09:20:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784561.1193950; Wed, 28 Aug 2024 09:20:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjEqc-0005KD-Fp; Wed, 28 Aug 2024 09:20:14 +0000
Received: by outflank-mailman (input) for mailman id 784561;
 Wed, 28 Aug 2024 09:20:13 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=rm2h=P3=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sjEqb-0003rJ-So
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 09:20:13 +0000
Received: from mail-qt1-x82a.google.com (mail-qt1-x82a.google.com
 [2607:f8b0:4864:20::82a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b9ea46e9-651e-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 11:20:12 +0200 (CEST)
Received: by mail-qt1-x82a.google.com with SMTP id
 d75a77b69052e-456768fb0a6so813951cf.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 02:20:12 -0700 (PDT)
Received: from fziglio-xenia-fedora.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6c162d21710sm63763296d6.11.2024.08.28.02.20.09
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 02:20:10 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b9ea46e9-651e-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724836811; x=1725441611; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=0JSvtCmO9jAkp0KnDfC0SlX5scV2vhq50nOcVowwJtE=;
        b=eCGnQkJWObvfewn799KREz1s3pjIqYVJxzkmhma20q6vB7IboFZMsXwTYhpRxpEF5S
         k0qLsdX3EDjidTYTkdSc4VrchIr9p5GyJ+j8OkQ9jXVK/fCzM96bG6dMHLYq7KLPhesu
         VKfGqLS/3CMQJdgV3IpHVHwnrBMO3MppEQ+RI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724836811; x=1725441611;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=0JSvtCmO9jAkp0KnDfC0SlX5scV2vhq50nOcVowwJtE=;
        b=G1F3egVCV4X0K6JNyeMz1RdciyGIW3yXQGtrBh1h9ergkJ6NHbFro/sQCD2NS3eXti
         eEkFlkU8qv0r06cl52dsYHAB177rARPU0MeLH9WR0Xm6Yxx0Nhwt2d+OG0jirMyINKIA
         7dJvNlk4IiaKYrQ16EfQXkg1riaMWXMJ0nZfUX6LKlh6mhaGXSHaJKDIIMht6zbdAu0K
         VCP+mryNg6gw91iCggQuukq3EcneWNs65C/Lbzn82XhMgv/Ln6ANv7RMWtSvItMtGsat
         ow7tCGnEbhAFb356OVh037ynaFYg+ioLHvtBpKogSPHKqPSwI3K/658jVuTeAcZktyZH
         Vjxw==
X-Gm-Message-State: AOJu0Yx1YS6GHEYLbj4tNVl5GAB01tizOCU/WERx3TzxwPCwnRw+Qil4
	Rny94bAYFQqln4QlP1XEZf5UU6fKIITbhhN7IRU1rjNsYQKHnBg4cVkg6ITpFZ3zbBsO/7IcLuD
	h
X-Google-Smtp-Source: AGHT+IE5mp8V1Sj6xT5ZqXrshqa1ZdKt2HKcZZ8KJuKayVeJWYDbIBov1bGRqRh6mk8q5R28JWO/RQ==
X-Received: by 2002:a05:6214:2b82:b0:6b7:4712:c878 with SMTP id 6a1803df08f44-6c16dcbcb08mr191690446d6.41.1724836810614;
        Wed, 28 Aug 2024 02:20:10 -0700 (PDT)
From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v2 2/2] x86/boot: Avoid relocations in trampoline code to virtual addresses
Date: Wed, 28 Aug 2024 10:19:54 +0100
Message-ID: <20240828091956.127760-2-frediano.ziglio@cloud.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240828091956.127760-1-frediano.ziglio@cloud.com>
References: <20240828091956.127760-1-frediano.ziglio@cloud.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Add virt_addr macro to make more clear the address we want and making
symbol search easier.
We don't generate direct absolute symbols to virtual addresses to avoid
linker warnings.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/trampoline.S | 3 ++-
 xen/arch/x86/boot/wakeup.S     | 2 +-
 xen/arch/x86/xen.lds.S         | 2 ++
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/boot/trampoline.S b/xen/arch/x86/boot/trampoline.S
index 3a6eb942a7..02c713af91 100644
--- a/xen/arch/x86/boot/trampoline.S
+++ b/xen/arch/x86/boot/trampoline.S
@@ -40,6 +40,7 @@
         .popsection
 
 #define phys_addr(sym) sym ## _PA
+#define virt_addr(sym) (sym ## _PA + __XEN_VIRT_START)
 
 /* Start of the permanent trampoline code. */
 
@@ -120,7 +121,7 @@ trampoline_protmode_entry:
         .code64
 start64:
         /* Jump to high mappings. */
-        movabs  $__high_start, %rdi
+        movabs  $virt_addr(__high_start), %rdi
         jmpq    *%rdi
 
 #include "video.h"
diff --git a/xen/arch/x86/boot/wakeup.S b/xen/arch/x86/boot/wakeup.S
index ae4dd5eb40..5ac8ba1fb6 100644
--- a/xen/arch/x86/boot/wakeup.S
+++ b/xen/arch/x86/boot/wakeup.S
@@ -156,7 +156,7 @@ wakeup_32:
         .code64
 wakeup_64:
         /* Jump to high mappings and the higher-level wakeup code. */
-        movabs  $s3_resume, %rbx
+        movabs  $virt_addr(s3_resume), %rbx
         jmp     *%rbx
 
 bogus_saved_magic:
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 5cfbd2524a..b200606278 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -77,6 +77,8 @@ SECTIONS
   DEFINE_PA_ADDRESS(start);
   DEFINE_PA_ADDRESS(saved_magic);
   DEFINE_PA_ADDRESS(idle_pg_table);
+  DEFINE_PA_ADDRESS(__high_start);
+  DEFINE_PA_ADDRESS(s3_resume);
 
   . = __XEN_VIRT_START + XEN_IMG_OFFSET;
   _start = .;
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 09:21:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 09:21:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784576.1193960 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjEri-0006K1-Sc; Wed, 28 Aug 2024 09:21:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784576.1193960; Wed, 28 Aug 2024 09:21:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjEri-0006Ju-PE; Wed, 28 Aug 2024 09:21:22 +0000
Received: by outflank-mailman (input) for mailman id 784576;
 Wed, 28 Aug 2024 09:21:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3BgB=P3=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sjErh-0006Jd-QD
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 09:21:21 +0000
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com
 [2a00:1450:4864:20::132])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e33643f2-651e-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 11:21:20 +0200 (CEST)
Received: by mail-lf1-x132.google.com with SMTP id
 2adb3069b0e04-533462b9428so10940875e87.3
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 02:21:20 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5334ea890casm2081999e87.273.2024.08.28.02.21.18
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 02:21:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e33643f2-651e-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724836880; x=1725441680; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=yVhCExET/kebc+rRmphVPpv9/7BZVIPY12/mf3K7teQ=;
        b=m/faE54tzrylUjuZju0F9l2SurHVWbXen73LE1vW13FVk+00HuVkjNGXP7gkGqg/dl
         FrYDit2MYIHUgiTTvICqFW6XKucS3/oryEB42TX72J4jqcA2RZaFnbF6cms6gUnlaM20
         p//TxC0UFhhq2ne8Dvjp/jDtYGzgr6TAZbqwOCPUuIZcusOyOnF0ZnyQSVuXv5QD3uzk
         /L1kRwHSNlrg08v35IHrZ2FoNFb2J6L/j7T8r0QfGkaqxK1sGe5Q3MtMG0Rrrhu7e1Jc
         EOVFsU4E/TVemTP75gWQQGE2V0hhnuLxZeL3vKCnTT9Zf6zkVHy/5GpCGL+jUldqR+D6
         AE3A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724836880; x=1725441680;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=yVhCExET/kebc+rRmphVPpv9/7BZVIPY12/mf3K7teQ=;
        b=QsKzr0nRVyTdQPIbm8R5Ye47WsskFNQU71LJEfbk8p9EjxyIwtR6kZUcAumdlx2eGJ
         6cz15Pn8C7T7/Nka2Nq6X+z+GAA0u3otR/oav2SWJ4kK4EjS3rbzUCuOsWDzXrF7vIoe
         96FbBVJX9ZAnRpzUTXGF0M5oMgBmIJMcszEKe+r/UL2vP0u6TTczXTDLlE/rxaLLJXo+
         rL1oiBgYh8OeVAzJXWYzEXUQOZZYO0kTuFMu7b4SZfgKPHZJhe20GAT8JLIV4L2JCU0g
         al+T+9Yy9Ma+Ex2/DKucDEWnpqJd8RZoyBcSVK6z/Lr4UTF7NrFOVeQgqzJB61lS1LuT
         0Pbw==
X-Forwarded-Encrypted: i=1; AJvYcCU92v4X/oS9O5y7+a0+aOsN2q3SWw6rZ+OjLZcW0DfNxCgKAMq8m6emfKrEzLDqq2NcIBbSpsBakCU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxGYBjYCXA1vIgOelR9l2kK6N2GJgqKq8kJZ7FrSG54TyYap13P
	hZTcMm5Lp79FQWhQpj8NNSDm/GJIykhuIbvmCYNdxgZcJxOVv23x
X-Google-Smtp-Source: AGHT+IFUVYX2u4C/MWOEMV/kjkcNgdltvxJjyZBuMNZegV7YXF4QGn892JEnss/Ep32d5sPSAzkFyg==
X-Received: by 2002:a05:6512:4017:b0:52c:e119:7f1 with SMTP id 2adb3069b0e04-5343888a7c4mr13568555e87.51.1724836879476;
        Wed, 28 Aug 2024 02:21:19 -0700 (PDT)
Message-ID: <3f52a19ea90fa8e70d7bf0055fe39a2be721c129.camel@gmail.com>
Subject: Re: [PATCH v5 1/7] xen/riscv: use {read,write}{b,w,l,q}_cpu() to
 define {read,write}_atomic()
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Wed, 28 Aug 2024 11:21:18 +0200
In-Reply-To: <0f9fb47c-91d1-4ee9-b6bf-1d491339e904@suse.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
	 <5140f9eb3d1cb0b69e3b1cbbcce6167ff8d59e4c.1724256026.git.oleksii.kurochko@gmail.com>
	 <0f9fb47c-91d1-4ee9-b6bf-1d491339e904@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.4 (3.52.4-1.fc40app2) 
MIME-Version: 1.0

On Tue, 2024-08-27 at 12:06 +0200, Jan Beulich wrote:
> On 21.08.2024 18:06, Oleksii Kurochko wrote:
> > In Xen, memory-ordered atomic operations are not necessary,
>=20
> This is an interesting statement.
I looked at the definition of build_atomic_{write,read}() for other
architectures and didn't find any additional memory-ordered primitives
such as fences.

> I'd like to suggest that you at least
> limit it to the two constructs in question, rather than stating this
> globally for everything.
I am not sure that I understand what is "the two constructs". Could you
please clarify?

>=20
> > based on {read,write}_atomic() implementations for other
> > architectures.
> > Therefore, {read,write}{b,w,l,q}_cpu() can be used instead of
> > {read,write}{b,w,l,q}(), allowing the caller to decide if
> > additional
> > fences should be applied before or after {read,write}_atomic().
> >=20
> > Change the declaration of _write_atomic() to accept a 'volatile
> > void *'
> > type for the 'x' argument instead of 'unsigned long'.
> > This prevents compilation errors such as:
> > 1."discards 'volatile' qualifier from pointer target type," which
> > occurs
> > =C2=A0 due to the initialization of a volatile pointer,
> > =C2=A0 e.g., `volatile uint8_t *ptr =3D p;` in _add_sized().
>=20
> I don't follow you here.
This issue started occurring after the change mentioned in point 2
below.

I initially provided an incorrect explanation for the compilation error
mentioned above. Let me correct that now and update the commit message
in the next patch version. The reason for this error is that after the
_write_atomic() prototype was updated from _write_atomic(..., unsigned
long, ...) to _write_atomic(..., void *x, ...), the write_atomic()
macro contains x_, which is of type 'volatile uintX_t' because ptr has
the type 'volatile uintX_t *'.

Therefore, _write_atomic() should have its second argument declared as
volatile const void *. Alternatively, we can consider updating
write_atomic() to:
   #define write_atomic(p, x)                              \
   ({                                                      \
       typeof(*(p)) x_ =3D (x);                              \
       _write_atomic(p, (const void *)&x_, sizeof(*(p)));  \
   })
Would this be a better approach?Would it be better?

> It's the other argument of write_atomic() that
> has ptr passed there.
Probably the thing mentioned above it is what you mean here. I wasn't
sure that I understand this sentence correctly.

>=20
> > 2."incompatible type for argument 2 of '_write_atomic'," which can
> > occur
> > =C2=A0 when calling write_pte(), where 'x' is of type pte_t rather than
> > =C2=A0 unsigned long.
>=20
> How's this related to the change at hand? That isn't different ahead
> of
> this change, is it?
This is not directly related to the current change, which is why I
decided to add a sentence about write_pte().

Since write_pte(pte_t *p, pte_t pte) uses write_atomic(), and the
argument types are pte_t * and pte respectively, we encounter a
compilation issue in write_atomic() because:

_write_atomic() expects the second argument to be of type unsigned
long, leading to a compilation error like "incompatible type for
argument 2 of '_write_atomic'."
I considered defining write_pte() as write_atomic(p, pte.pte), but this
would fail at 'typeof(*(p)) x_ =3D (x);' and result in a compilation
error 'invalid initializer' or something like that.

It might be better to update write_pte() to:
   /* Write a pagetable entry. */
   static inline void write_pte(pte_t *p, pte_t pte)
   {
       write_atomic((unsigned long *)p, pte.pte);
   }
Then, we wouldn't need to modify the definition of write_atomic() or
change the type of the second argument of _write_atomic().
Would it be better?

>=20
> > --- a/xen/arch/riscv/include/asm/atomic.h
> > +++ b/xen/arch/riscv/include/asm/atomic.h
> > @@ -31,21 +31,17 @@
> > =C2=A0
> > =C2=A0void __bad_atomic_size(void);
> > =C2=A0
> > -/*
> > - * Legacy from Linux kernel. For some reason they wanted to have
> > ordered
> > - * read/write access. Thereby read* is used instead of read*_cpu()
> > - */
> > =C2=A0static always_inline void read_atomic_size(const volatile void *p=
,
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 void *res,
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 unsigned int size)
> > =C2=A0{
> > =C2=A0=C2=A0=C2=A0=C2=A0 switch ( size )
> > =C2=A0=C2=A0=C2=A0=C2=A0 {
> > -=C2=A0=C2=A0=C2=A0 case 1: *(uint8_t *)res =3D readb(p); break;
> > -=C2=A0=C2=A0=C2=A0 case 2: *(uint16_t *)res =3D readw(p); break;
> > -=C2=A0=C2=A0=C2=A0 case 4: *(uint32_t *)res =3D readl(p); break;
> > +=C2=A0=C2=A0=C2=A0 case 1: *(uint8_t *)res =3D readb_cpu(p); break;
> > +=C2=A0=C2=A0=C2=A0 case 2: *(uint16_t *)res =3D readw_cpu(p); break;
> > +=C2=A0=C2=A0=C2=A0 case 4: *(uint32_t *)res =3D readl_cpu(p); break;
> > =C2=A0#ifndef CONFIG_RISCV_32
> > -=C2=A0=C2=A0=C2=A0 case 8: *(uint32_t *)res =3D readq(p); break;
> > +=C2=A0=C2=A0=C2=A0 case 8: *(uint32_t *)res =3D readq_cpu(p); break;
> > =C2=A0#endif
> > =C2=A0=C2=A0=C2=A0=C2=A0 default: __bad_atomic_size(); break;
> > =C2=A0=C2=A0=C2=A0=C2=A0 }
> > @@ -58,15 +54,16 @@ static always_inline void
> > read_atomic_size(const volatile void *p,
> > =C2=A0})
> > =C2=A0
> > =C2=A0static always_inline void _write_atomic(volatile void *p,
> > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0 unsigned long x, unsigned
> > int size)
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 volatile void *x,
>=20
> If this really needs to become a pointer, it ought to also be
> pointer-
> to-const. Otherwise it is yet more confusing which operand is which.
Sure. I will add 'const' if the prototype of _write_atomic() won't use
'unsigned long' for x argument.

>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 unsigned int size)
> > =C2=A0{
> > =C2=A0=C2=A0=C2=A0=C2=A0 switch ( size )
> > =C2=A0=C2=A0=C2=A0=C2=A0 {
> > -=C2=A0=C2=A0=C2=A0 case 1: writeb(x, p); break;
> > -=C2=A0=C2=A0=C2=A0 case 2: writew(x, p); break;
> > -=C2=A0=C2=A0=C2=A0 case 4: writel(x, p); break;
> > +=C2=A0=C2=A0=C2=A0 case 1: writeb_cpu(*(uint8_t *)x, p); break;
> > +=C2=A0=C2=A0=C2=A0 case 2: writew_cpu(*(uint16_t *)x, p); break;
> > +=C2=A0=C2=A0=C2=A0 case 4: writel_cpu(*(uint32_t *)x, p); break;
> > =C2=A0#ifndef CONFIG_RISCV_32
> > -=C2=A0=C2=A0=C2=A0 case 8: writeq(x, p); break;
> > +=C2=A0=C2=A0=C2=A0 case 8: writeq_cpu(*(uint64_t *)x, p); break;
>=20
> Of course you may not cast away const-ness then. You also be casting
> away volatile-ness, but (as per above) I question the need for
> volatile
> on x.
I added an explanation about this earlier in the message. Let's discuss
whether volatile is needed there or not.

If I should not cast away the const and volatile qualifiers, then I
need to update the prototypes of writeX_cpu()?

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 09:42:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 09:42:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784588.1193969 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjFBq-0002D9-GA; Wed, 28 Aug 2024 09:42:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784588.1193969; Wed, 28 Aug 2024 09:42:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjFBq-0002D2-DX; Wed, 28 Aug 2024 09:42:10 +0000
Received: by outflank-mailman (input) for mailman id 784588;
 Wed, 28 Aug 2024 09:42:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NRYu=P3=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjFBp-0002Cw-K8
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 09:42:09 +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 ca895870-6521-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 11:42:08 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5becfd14353so7056243a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 02:42:07 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb475f2esm2018303a12.63.2024.08.28.02.42.06
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 02:42:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ca895870-6521-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724838127; x=1725442927; 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=chP+CDnz93O6ObYXNfs6fucwEu+/SuH+oCZro2F2ioE=;
        b=Rkqc1T7ArWDvo2S9z+ll1IEa8uF+RygW/sIXdXUSA0ylB+KG2qoKUf0cx6s8HeE6VH
         Wm2Grk0rdXmAnz05RYJSte+B/JcAuC9XgfhuQdrXtsp4NNrEO4Opgh22owGPChE0bUgN
         X3UHYI3zRp2ofxb5yXcJe6SuWHmsLXBe9RbQmDdV2JmwAMzRj3ZC0Cigg/6qSi2sUUes
         vzh2Q+VjvRkWMiJvaOIh1Jyx9wGjnCSQ1W3IlwIF1s/CAYdX/N6gPw9p/w1IRB9l6oiV
         9lBKDoQfpqMQ+PL+g39yZeA0OkBKZHWyTFtnoOSRfZ5nOE8/KHDZ/eMHmOaecUcJaZPS
         5Qug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724838127; x=1725442927;
        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=chP+CDnz93O6ObYXNfs6fucwEu+/SuH+oCZro2F2ioE=;
        b=FL5CQ86272vzZsdDO95UEVorpnshnGVPPIoPzYHrJFRZOE+XAZ25JXCLw0UbrBbY1+
         5LQny6WnI+wGQx4nWd0CpcPfpuedqJeIur/UDXZhweLyp6UpLLSBBCmU5+2DUw1QeJlM
         zKV+aLzfR8W5HWD0f1HPWqS76P8Sui5u4vEqPGA8gAFWn+5BSlsRuWIV1LVE2pwUG2w6
         nUDu494CiuJndxMa05OUe9lSgXAQ1mWInhin6EOHfB0ZBtlcZEsVMrQ5Kbj10u0SuJkw
         TOoW8M7j3lC+fMGHiYf7Lne0GIpru3kTCJnz64BqisdfU1XIuMZp924LEn+uelrnqOas
         MUvA==
X-Forwarded-Encrypted: i=1; AJvYcCVCp7vDsn8jAWQKSG/OjLPNFLdL+hG5eU9B7MnHwDvXiGrp7Tqoajn7ZXA2FZVM5eVZ7rCaNOsh9G0=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yxc4POlSxUVk5iOygtqqotGmaf6+NdNAgCbZ3i3KinZFuO5bn7C
	N5xBQTjVWvN6KtxtLt4t/H/qpz7sTA+F1o3sft6QNMAhlFINLVhXMe2jDGmVzA==
X-Google-Smtp-Source: AGHT+IG55RV53GxEA9tgFbvg7tGjxBxVgDwc/0KtzecQ/tc5sdKdiNA11PKpFrzdYimzSfnL3JSx5g==
X-Received: by 2002:a05:6402:5cc:b0:5bf:50:266b with SMTP id 4fb4d7f45d1cf-5c089171b3fmr9914572a12.19.1724838127072;
        Wed, 28 Aug 2024 02:42:07 -0700 (PDT)
Message-ID: <45f1305f-2c2c-4b1c-8377-f98dbc5dbe53@suse.com>
Date: Wed, 28 Aug 2024 11:42:05 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 1/7] xen/riscv: use {read,write}{b,w,l,q}_cpu() to
 define {read,write}_atomic()
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
 <5140f9eb3d1cb0b69e3b1cbbcce6167ff8d59e4c.1724256026.git.oleksii.kurochko@gmail.com>
 <0f9fb47c-91d1-4ee9-b6bf-1d491339e904@suse.com>
 <3f52a19ea90fa8e70d7bf0055fe39a2be721c129.camel@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: <3f52a19ea90fa8e70d7bf0055fe39a2be721c129.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28.08.2024 11:21, oleksii.kurochko@gmail.com wrote:
> On Tue, 2024-08-27 at 12:06 +0200, Jan Beulich wrote:
>> On 21.08.2024 18:06, Oleksii Kurochko wrote:
>>> In Xen, memory-ordered atomic operations are not necessary,
>>
>> This is an interesting statement.
> I looked at the definition of build_atomic_{write,read}() for other
> architectures and didn't find any additional memory-ordered primitives
> such as fences.
> 
>> I'd like to suggest that you at least
>> limit it to the two constructs in question, rather than stating this
>> globally for everything.
> I am not sure that I understand what is "the two constructs". Could you
> please clarify?

{read,write}_atomic() (the statement in your description is, after all,
not obviously limited to just those two, yet I understand you mean to
say what you say only for them)

>>> based on {read,write}_atomic() implementations for other
>>> architectures.
>>> Therefore, {read,write}{b,w,l,q}_cpu() can be used instead of
>>> {read,write}{b,w,l,q}(), allowing the caller to decide if
>>> additional
>>> fences should be applied before or after {read,write}_atomic().
>>>
>>> Change the declaration of _write_atomic() to accept a 'volatile
>>> void *'
>>> type for the 'x' argument instead of 'unsigned long'.
>>> This prevents compilation errors such as:
>>> 1."discards 'volatile' qualifier from pointer target type," which
>>> occurs
>>>   due to the initialization of a volatile pointer,
>>>   e.g., `volatile uint8_t *ptr = p;` in _add_sized().
>>
>> I don't follow you here.
> This issue started occurring after the change mentioned in point 2
> below.
> 
> I initially provided an incorrect explanation for the compilation error
> mentioned above. Let me correct that now and update the commit message
> in the next patch version. The reason for this error is that after the
> _write_atomic() prototype was updated from _write_atomic(..., unsigned
> long, ...) to _write_atomic(..., void *x, ...), the write_atomic()
> macro contains x_, which is of type 'volatile uintX_t' because ptr has
> the type 'volatile uintX_t *'.

While there's no "ptr" in write_atomic(), I think I see what you mean. Yet
at the same time Arm - having a similar construct - gets away without
volatile. Perhaps this wants modelling after read_atomic() then, using a
union?

> Therefore, _write_atomic() should have its second argument declared as
> volatile const void *. Alternatively, we can consider updating
> write_atomic() to:
>    #define write_atomic(p, x)                              \
>    ({                                                      \
>        typeof(*(p)) x_ = (x);                              \
>        _write_atomic(p, (const void *)&x_, sizeof(*(p)));  \
>    })
> Would this be a better approach?Would it be better?

Like const you also should avoid to cast away volatile, whenever possible.

>>> 2."incompatible type for argument 2 of '_write_atomic'," which can
>>> occur
>>>   when calling write_pte(), where 'x' is of type pte_t rather than
>>>   unsigned long.
>>
>> How's this related to the change at hand? That isn't different ahead
>> of
>> this change, is it?
> This is not directly related to the current change, which is why I
> decided to add a sentence about write_pte().
> 
> Since write_pte(pte_t *p, pte_t pte) uses write_atomic(), and the
> argument types are pte_t * and pte respectively, we encounter a
> compilation issue in write_atomic() because:
> 
> _write_atomic() expects the second argument to be of type unsigned
> long, leading to a compilation error like "incompatible type for
> argument 2 of '_write_atomic'."
> I considered defining write_pte() as write_atomic(p, pte.pte), but this
> would fail at 'typeof(*(p)) x_ = (x);' and result in a compilation
> error 'invalid initializer' or something like that.
> 
> It might be better to update write_pte() to:
>    /* Write a pagetable entry. */
>    static inline void write_pte(pte_t *p, pte_t pte)
>    {
>        write_atomic((unsigned long *)p, pte.pte);
>    }
> Then, we wouldn't need to modify the definition of write_atomic() or
> change the type of the second argument of _write_atomic().
> Would it be better?

As said numerous times before: Whenever you can get away without a cast,
you should avoid the cast. Here:

static inline void write_pte(pte_t *p, pte_t pte)
{
    write_atomic(&p->pte, pte.pte);
}

That's one of the possible options, yes. Yet, like Arm has it, you may
actually want the capability to read/write non-scalar types. If so,
adjustments to write_atomic() are necessary, yet as indicated before:
Please keep such entirely independent changes separate.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 09:48:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 09:48:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784597.1193980 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjFI7-0003hV-8q; Wed, 28 Aug 2024 09:48:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784597.1193980; Wed, 28 Aug 2024 09:48:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjFI7-0003hO-4s; Wed, 28 Aug 2024 09:48:39 +0000
Received: by outflank-mailman (input) for mailman id 784597;
 Wed, 28 Aug 2024 09:48:37 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjFI5-0003hI-Ja
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 09:48:37 +0000
Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com
 [2a00:1450:4864:20::32e])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b222efe7-6522-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 11:48:36 +0200 (CEST)
Received: by mail-wm1-x32e.google.com with SMTP id
 5b1f17b1804b1-42bac9469e8so348655e9.3
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 02:48:36 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e54851d9sm219066766b.24.2024.08.28.02.48.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 02:48:34 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b222efe7-6522-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724838516; x=1725443316; 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=t1bbLMZVqWv5hn4w+rWnt+7lHpcNra8b9rwjurRD0Vo=;
        b=dpkS098I/yJdzoOSGv0EQnSEF7U/AWMZXQgtNn8pFp+OdfKU4ZwPGB91BXZN/Wioav
         XHWCm1/sIY7sCy3suyZDhSlmcDCEp7yez+tgP+1IjCALwut/Ho/TsgHAfvN20iGFjSzi
         Iv7A/GkVfck1rtXMHSTTt1GvPR+nO1M4teADY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724838516; x=1725443316;
        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=t1bbLMZVqWv5hn4w+rWnt+7lHpcNra8b9rwjurRD0Vo=;
        b=S08FEXzW0aF7q8azj3qmC+xNY2I3nxtiMQGnROTno0KFbYUwB48xSvLfxQAUikyBH4
         2iWpwfQkbiujkHMZql0vVJwV41hPFFp6tHCwYepy7tADCX0PFfKN+N/J5hSdVMOjqnsF
         SeewTFraHMk48NjRLxsCOPmxz4YiNRepFDVZDnFbFI0zPz6VrPWEBR41TN47bxqon6L9
         1HDwXICBM/ckbqO+2tuglJg3TzStOOvFvnO3y3HLC3LJ+AleuBB6AEnwBKvb13VNPxzU
         VLGoOpR2DN4qZ0R6D9+Lq3owtNukVXIuOC9sJC7yCpg/6C+n+4tzyVemrUexNpuNq9Q3
         nARQ==
X-Forwarded-Encrypted: i=1; AJvYcCXN+oYDqj7mt1WFZeYi0CJm+E+J7G+IlaKAJQPk88cw/YfAdH3D0WaYs2O7IrsBVRB0vL2oUxafA9E=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzStmgd8KNqrHpZ/Eq8xE661l0M/MdLzG69jTJ6yN3xJql9KVd6
	e6GKa1B601FttSedeecBtbTkPogzjSTOlUjyoCzPQ8F0jpGl6E6K+4aLXww1cc0=
X-Google-Smtp-Source: AGHT+IGIcwEiFwYJZlsB0jsOcOn/H4IUiU+sCzzjcSFyZvR1dw/u2WTODQ46dJPhaaaAT2xKW5yTKA==
X-Received: by 2002:a5d:4404:0:b0:371:8a70:b10e with SMTP id ffacd0b85a97d-373118e9f6dmr9693976f8f.60.1724838515106;
        Wed, 28 Aug 2024 02:48:35 -0700 (PDT)
Message-ID: <0d831d53-ebc4-48b6-9d50-b0d554c298de@citrix.com>
Date: Wed, 28 Aug 2024 10:48:32 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] ARM/vgic: Fix variable shadowing in vgic_to_sgi()
To: Michal Orzel <michal.orzel@amd.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Julien Grall
 <julien@xen.org>, Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>
References: <20240827234522.2237355-1-andrew.cooper3@citrix.com>
 <748f9e0d-e630-42f2-9273-95e2e85c524f@amd.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <748f9e0d-e630-42f2-9273-95e2e85c524f@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28/08/2024 8:06 am, Michal Orzel wrote:
>
> On 28/08/2024 01:45, Andrew Cooper wrote:
>>
>> for_each_set_bit() allocates its own variable intentionally as loop-scope
>> only.  Unfortunately, this causes the inner 'i' to shadow the outer 'i'.
> NIT: I'd mention it violates MISRA R5.3

Done.

>
>> Drop the outermost 'i' and 'vcpuid' variables, moving them into a more narrow
>> scope and correcting them to be unsigned which they should have been all
>> along.
>>
>> Fixes: 9429f1a6c475 ("ARM/vgic: Use for_each_set_bit() in vgic_to_sgi()")
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Stefano Stabellini <sstabellini@kernel.org>
>> CC: Julien Grall <julien@xen.org>
>> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
>> CC: Bertrand Marquis <bertrand.marquis@arm.com>
>> CC: Michal Orzel <michal.orzel@amd.com>
>> ---
>>  xen/arch/arm/vgic.c | 7 +++----
>>  1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
>> index 8ffe099bcb5f..6ecd9146511c 100644
>> --- a/xen/arch/arm/vgic.c
>> +++ b/xen/arch/arm/vgic.c
>> @@ -468,8 +468,6 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
>>                   int virq, const struct sgi_target *target)
>>  {
>>      struct domain *d = v->domain;
>> -    int vcpuid;
>> -    int i;
>>      unsigned int base, bitmap;
>>
>>      ASSERT( virq < 16 );
>> @@ -483,7 +481,8 @@ bool vgic_to_sgi(struct vcpu *v, register_t sgir, enum gic_sgi_mode irqmode,
>>
>>          for_each_set_bit ( i, bitmap )
>>          {
>> -            vcpuid = base + i;
>> +            unsigned int vcpuid = base + i;
> With this change you should replace the printk specifier from %d to %u for vcpuid.

So I should, yes.

>
> Apart from that:
> Reviewed-by: Michal Orzel <michal.orzel@amd.com>

Thanks.  Sorry for breaking CI.

I did run Eclair on it, but for the manually triggered run, it only
generates a warning, and does not trigger a "pipeline {failed,fixed}"
event, because the pipeline hasn't changed state from the last time I
ran it.

I'm not sure if we can do any better for something which is
conditionally manually triggered.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 09:48:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 09:48:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784598.1193991 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjFIN-00041X-Fx; Wed, 28 Aug 2024 09:48:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784598.1193991; Wed, 28 Aug 2024 09:48:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjFIN-00041Q-BX; Wed, 28 Aug 2024 09:48:55 +0000
Received: by outflank-mailman (input) for mailman id 784598;
 Wed, 28 Aug 2024 09:48:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjFIL-0003zn-KT; Wed, 28 Aug 2024 09:48:53 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjFIL-0004qV-8k; Wed, 28 Aug 2024 09:48:53 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjFIK-0007RF-Rj; Wed, 28 Aug 2024 09:48:52 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjFIK-0003d8-RJ; Wed, 28 Aug 2024 09:48:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=4EAExhmCMIFJzRf7CnQ5S79jO5HVueJTxHyVvTOp0do=; b=SsPj3mOzLe9Pn4KOpSVa/z3Lj1
	PFQpGDzFonaurmF1dR7e4XC7xfj46aTKMLWCTWV59bT1DcQlgZ6yHTJamtc2xxNPdlF2GuYOpf33C
	wcIgHp8zrqvUEBXFBioWAQxDj3ecVBBy+il/C9p8kUJ5q+R9/zoY/dDAkllst4cTfEzU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187378-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187378: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=99e4c8ea93fa0e98bc1bdb968e9d5bb42ff5d39c
X-Osstest-Versions-That:
    ovmf=25da777d95c0e76b3e0a15ff617870105c228b7b
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 09:48:52 +0000

flight 187378 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187378/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 99e4c8ea93fa0e98bc1bdb968e9d5bb42ff5d39c
baseline version:
 ovmf                 25da777d95c0e76b3e0a15ff617870105c228b7b

Last test of basis   187375  2024-08-28 04:41:30 Z    0 days
Testing same since   187378  2024-08-28 07:13:32 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Chao Li <lichao@loongson.cn>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   25da777d95..99e4c8ea93  99e4c8ea93fa0e98bc1bdb968e9d5bb42ff5d39c -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 09:49:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 09:49:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784609.1193999 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjFJ2-0004ic-Ms; Wed, 28 Aug 2024 09:49:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784609.1193999; Wed, 28 Aug 2024 09:49:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjFJ2-0004iV-KD; Wed, 28 Aug 2024 09:49:36 +0000
Received: by outflank-mailman (input) for mailman id 784609;
 Wed, 28 Aug 2024 09:49: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=NRYu=P3=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjFJ1-0003hI-NP
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 09:49:35 +0000
Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com
 [2a00:1450:4864:20::632])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d5165d79-6522-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 11:49:35 +0200 (CEST)
Received: by mail-ej1-x632.google.com with SMTP id
 a640c23a62f3a-a86fa3dea99so81388366b.2
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 02:49:35 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb21567fsm2048281a12.58.2024.08.28.02.49.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 02:49:34 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d5165d79-6522-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724838574; x=1725443374; 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=xJ5VyFfuoROWlAKrL/oBSeIt9ZGH4XcNI1AU7gV88z4=;
        b=BxYEaOiqHG05L3hSbWyZygdN3/qByIXersIv3YeEBo1/hanPrXIGt7tF7RgipH+PR9
         icoutT/wiWaQm060KVhawPiKFDecEaqMIR7mXH+sHtgHOFtE6D//Rryou4NgiZnZ5RAM
         TKp7TZOjQax3QyXrR4hmxbpr9vDrIpcnB1czENTGH7A4r443llmrAJrEquIbIF2crYLT
         Umi/molJegUhiJyINzFonbjkIcoHAl1SFNbw60Sji/tUpGWwiFUhnynVWSJ8DnO5rKuK
         CufX349wB8kLQ9da9XRY29NJA0AwabqxECzW7Clo7X3GwupGIl6+Ni4CMXvahzEwUgTd
         dubA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724838574; x=1725443374;
        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=xJ5VyFfuoROWlAKrL/oBSeIt9ZGH4XcNI1AU7gV88z4=;
        b=eoTaKLO2YCjUg7PrQgWe2YWjDBbg+dU8v4PDkaDOHt6+iM4LXkHUG4UndgnWHpgfd7
         nD1UITczUGqW+GcNdohqqKp0cHQFYYsGNz7KyJJJyjLv+1ULdnTtxFKF2CzO1C9OxCDW
         +UKSL6NREFNc5ilcnMuOq0odR8rDBp2++cGk9H5XVJCBc6DWsu1w8QuxA9AjH1GwUaOy
         lNKSZ69Gu2ECLR1Y8Gwrqx32iBm4OIR8vydUz4TynLrrozfHqgJK6ro+nRz5s5E6oIGV
         Qdw4O8YqLEuB3klscLQYaiXa48p+DY7UUnP01+YhrBtXWzZV136nf8myuP3uxX6wkrIR
         UPMw==
X-Gm-Message-State: AOJu0YxMduy+YJ0V8TJz+WVpj3lc2+aEYFaFBXebuJBtsBQmt8RMEcxj
	pDd/GYXrWbsWnpdD6YXb38LJs+8tsOK6Yjft7nnne2Z5/BO3zstv/2gmcRo08A==
X-Google-Smtp-Source: AGHT+IEU9RBxYC2SjGdEBpH/Fgaq1zKalGXwNAbEJfZ/EGvM61plEAXIl2qnZ9yOhrn+TAYVtkvWbA==
X-Received: by 2002:a05:6402:2711:b0:5be:dab8:1bb3 with SMTP id 4fb4d7f45d1cf-5c0891692b1mr13558576a12.13.1724838574453;
        Wed, 28 Aug 2024 02:49:34 -0700 (PDT)
Message-ID: <77276161-2fcc-4527-87ba-0ef5988ff82a@suse.com>
Date: Wed, 28 Aug 2024 11:49:33 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5] x86/dom0: disable SMAP for PV domain building only
To: Roger Pau Monne <roger.pau@citrix.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org
References: <20240827123949.24400-1-roger.pau@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240827123949.24400-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 27.08.2024 14:39, Roger Pau Monne wrote:
> --- a/xen/arch/x86/dom0_build.c
> +++ b/xen/arch/x86/dom0_build.c
> @@ -612,7 +612,24 @@ int __init construct_dom0(struct domain *d, const module_t *image,
>      if ( is_hvm_domain(d) )
>          rc = dom0_construct_pvh(d, image, image_headroom, initrd, cmdline);
>      else if ( is_pv_domain(d) )
> +    {
> +        /*
> +         * Temporarily clear SMAP in CR4 to allow user-accesses in
> +         * construct_dom0().  This saves a large number of corner cases
> +         * interactions with copy_from_user().
> +         */
> +        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> +        {
> +            cr4_pv32_mask &= ~X86_CR4_SMAP;
> +            write_cr4(read_cr4() & ~X86_CR4_SMAP);
> +        }
>          rc = dom0_construct_pv(d, image, image_headroom, initrd, cmdline);
> +        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> +        {
> +            write_cr4(read_cr4() | X86_CR4_SMAP);
> +            cr4_pv32_mask |= X86_CR4_SMAP;
> +        }
> +    }

Andrew, looking at this code I really wonder what benefit you request to
move this further is going to have. Afaict no matter where we put it, it'll
be an #ifdef around each of the two accesses to cr4_pv32_mask when we make
that variable CONFIG_PV32-only.

> --- a/xen/arch/x86/include/asm/setup.h
> +++ b/xen/arch/x86/include/asm/setup.h
> @@ -64,6 +64,8 @@ extern bool opt_dom0_verbose;
>  extern bool opt_dom0_cpuid_faulting;
>  extern bool opt_dom0_msr_relaxed;
>  
> +extern unsigned long cr4_pv32_mask;

With this ...

> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -80,7 +80,7 @@ int8_t __initdata opt_probe_port_aliases = -1;
>  boolean_param("probe-port-aliases", opt_probe_port_aliases);
>  
>  /* Only used in asm code and within this source file */
> -unsigned long asmlinkage __read_mostly cr4_pv32_mask;
> +unsigned long asmlinkage __ro_after_init cr4_pv32_mask;

... both the comment and the asmlinkage become stale now.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 09:53:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 09:53:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784614.1194009 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjFMh-0006Ct-5f; Wed, 28 Aug 2024 09:53:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784614.1194009; Wed, 28 Aug 2024 09:53:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjFMh-0006Cm-3B; Wed, 28 Aug 2024 09:53:23 +0000
Received: by outflank-mailman (input) for mailman id 784614;
 Wed, 28 Aug 2024 09:53:22 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3BgB=P3=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sjFMf-0006Cg-Vf
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 09:53:21 +0000
Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com
 [2a00:1450:4864:20::132])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 5bb8435a-6523-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 11:53:20 +0200 (CEST)
Received: by mail-lf1-x132.google.com with SMTP id
 2adb3069b0e04-53351642021so7723605e87.3
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 02:53:20 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5334ea8940asm2161714e87.286.2024.08.28.02.53.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 02:53:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5bb8435a-6523-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724838800; x=1725443600; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=g8zadqbn2M/ZYFdNdSGK9gbT7OCJiGxh1VIvqrFwzgs=;
        b=QXvKYTKVCMA//T0BhHv/KnBnVCZjSgA14fhg/F0tZE9ihYauNNZdPNTwP3dztg/DIg
         3rWOWNIHfh5tj0234eMfyRruQ/JMfyapnZNTr7jAcMw4UKKsz8A0Xf0S20Kl4KRxnlab
         DOttzgQ1DGcVL3IWKQIBZzI2l4o79Utv6WH2vyPOnQ/xsl8pARI7g6pBo4My19/dZmJI
         IyMcUiXEyJDkNUFYbsjyBQnqWMJwqGSPi2n/7kWeGtT2g8t69bezXIB+GVVl8TwY6Blq
         ScKbSR1rLm93nRy3GJkrHuujxIq4mUcBx1eq1WO6u8ch18NnPxDTcL1K7WmUcLJTuZgP
         5/gw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724838800; x=1725443600;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=g8zadqbn2M/ZYFdNdSGK9gbT7OCJiGxh1VIvqrFwzgs=;
        b=MRqppZoo8CjhzXRtisFzRxD0ajKAppbKaubNA6izLH7v26KFL7WdhxVh655kXYVIyq
         oR2b2Kd+dJB2O8ii9Eu+Rv0p3CP5paHZn60uwxpNSwnPk7/kYYbqNT3YgwvbPsZ7R6vU
         rttz8M4ptUmfjMbUVUAtg3bAlQMrXGun50Ix8B+uq/I2haghLmB7kn6sB31UOoBldYd3
         aZ65EWNOtFKdX+pxskyLAO9kMb/j7bEWZjnH7/9iyrLqi1mjI5zjD2WfqdB3v86mQxtx
         Je7+chL9p2byKIVlf/G23Hx5oD2E3FoICDr+ErwO0W+MNVYx/wr1bEbeuTZkzCLt+v49
         VcHA==
X-Forwarded-Encrypted: i=1; AJvYcCUhYa/VMVTiDhYNaWmffepZNrqfaBZrAkpDPj5/pA8uDHS80dmOG5W8eE+Ua6inx/W1ylE+jwoMTwU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YySGcGkJLekL9D4x3/YpU/gLNaIkG5JWgKkba3W/y6Td4OzMoo7
	qcqftAdMODQHGF9h38XonvULvNY/A6/Qrct8W/Fp04ZSjfngid1VgFrSUw==
X-Google-Smtp-Source: AGHT+IE4In3Sn17/jfokXh+fQUCfusIvL9xIdo2hJ56GtDukezaa9mEpipVGZknh/A6kso91UL7bBg==
X-Received: by 2002:a05:6512:1589:b0:532:ef22:eb4e with SMTP id 2adb3069b0e04-534387c4a10mr10078182e87.54.1724838799782;
        Wed, 28 Aug 2024 02:53:19 -0700 (PDT)
Message-ID: <9210aa20ebe892b9866309a7531398d446d0eef5.camel@gmail.com>
Subject: Re: [PATCH v5 2/7] xen/riscv: set up fixmap mappings
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Wed, 28 Aug 2024 11:53:18 +0200
In-Reply-To: <4b9cfa7e-546a-4dbb-a3de-4267849be13a@suse.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
	 <57e892d5b2c526dd44b68d4976796a25c0feca20.1724256027.git.oleksii.kurochko@gmail.com>
	 <4b9cfa7e-546a-4dbb-a3de-4267849be13a@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.4 (3.52.4-1.fc40app2) 
MIME-Version: 1.0

On Tue, 2024-08-27 at 12:29 +0200, Jan Beulich wrote:
> >=20
> > +
> > +/*
> > + * Direct access to xen_fixmap[] should only happen when {set,
> > + * clear}_fixmap() is unusable (e.g. where we would end up to
> > + * recursively call the helpers).
> > + */
> > +extern pte_t xen_fixmap[];
>=20
> I'm afraid I keep being irritated by the comment: What recursive use
> of
> helpers is being talked about here? I can't see anything recursive in
> this
> patch. If this starts happening with a subsequent patch, then you
> have
> two options: Move the declaration + comment there, or clarify in the
> description (in enough detail) what this is about.
This comment is added because of:
```
void *__init pmap_map(mfn_t mfn)
  ...
       /*
        * We cannot use set_fixmap() here. We use PMAP when the domain map
        * page infrastructure is not yet initialized, so
   map_pages_to_xen() called
        * by set_fixmap() needs to map pages on demand, which then calls
   pmap()
        * again, resulting in a loop. Modify the PTEs directly instead.
   The same
        * is true for pmap_unmap().
        */
       arch_pmap_map(slot, mfn);
   ...
```
And it happens because set_fixmap() could be defined using generic PT
helpers so what will lead to recursive behaviour when when there is no
direct map:
   static pte_t *map_table(mfn_t mfn)
   {
       /*
        * During early boot, map_domain_page() may be unusable. Use the
        * PMAP to map temporarily a page-table.
        */
       if ( system_state =3D=3D SYS_STATE_early_boot )
           return pmap_map(mfn);
       ...
   }

>=20
> > @@ -81,6 +82,18 @@ static inline void flush_page_to_ram(unsigned
> > long mfn, bool sync_icache)
> > =C2=A0=C2=A0=C2=A0=C2=A0 BUG_ON("unimplemented");
> > =C2=A0}
> > =C2=A0
> > +/* Write a pagetable entry. */
> > +static inline void write_pte(pte_t *p, pte_t pte)
> > +{
> > +=C2=A0=C2=A0=C2=A0 write_atomic(p, pte);
> > +}
> > +
> > +/* Read a pagetable entry. */
> > +static inline pte_t read_pte(pte_t *p)
> > +{
> > +=C2=A0=C2=A0=C2=A0 return read_atomic(p);
>=20
> This only works because of the strange type trickery you're playing
> in
> read_atomic(). Look at x86 code - there's a strict expectation that
> the
> type can be converted to/from unsigned long. And page table accessors
> are written with that taken into consideration. Same goes for
> write_pte()
> of course, with the respective comment on the earlier patch in mind.
I will check x86 code. Probably my answer on the patch with
read/write_atomic() suggest that too. Based on the answers to that
patch I think we can go with x86 approach.

Thanks.

~ Oleksii

>=20
> Otoh I see that Arm does something very similar. If you have a strong
> need / desire to follow that, then please at least split the two
> entirely separate aspects that patch 1 presently changes both in one
> go.
>=20
> Jan



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 09:54:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 09:54:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784618.1194019 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjFNV-0006ho-FG; Wed, 28 Aug 2024 09:54:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784618.1194019; Wed, 28 Aug 2024 09:54:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjFNV-0006hh-Cj; Wed, 28 Aug 2024 09:54:13 +0000
Received: by outflank-mailman (input) for mailman id 784618;
 Wed, 28 Aug 2024 09:54:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjFNT-0006Cg-Ob
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 09:54:11 +0000
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [2a00:1450:4864:20::534])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 79abd2a3-6523-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 11:54:11 +0200 (CEST)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5bede548f7cso7475532a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 02:54:11 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb471dfdsm2020321a12.60.2024.08.28.02.54.09
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 02:54:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 79abd2a3-6523-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724838851; x=1725443651; 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=A/ZefStMd0MSIlj+zM8LvXm5uBaBJjURoHOaiqWbMyM=;
        b=D0sdPs60f6FiA+xq93QORtHBqu+GypvqF3m6ZUIUKBo8JplvNoj1jkUuKT84erLC5Q
         bCkbmIG+wNliJ9Ojup3IWTrPkSM5vC9IvarUuBW+JJngkSPPrcTlKmQlpSt6D2Wudv94
         oycZY/k6UeZ7lTI+q2g8nXf5KJzOWk3yxc5h4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724838851; x=1725443651;
        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=A/ZefStMd0MSIlj+zM8LvXm5uBaBJjURoHOaiqWbMyM=;
        b=PHTkoaMamyLHpfDVDWWguXaeDLH9+/WRxD92OGGDCzx9uLi6hITlp24x2cnWqMnw0y
         vSRWqcjKL2kqKuFIw1hK/eSWZaIiFHP8iLyeH+W+Ao41uDqXQhCeX6Yq2tRHnMWlg/ul
         MEw9VXcZmW/OXBIOJZCdSCp9DYdf4WpO7DTTe0+kcDCAOtI76ciOIT/ymWXFmg2iBDM9
         6196upE/5+qWSrJq6GY0J7BKzkvZ0dK78CaotLZ7HATRokYLIln5S4zAjsQLzESF/WYV
         AHZoFjDBQ+gZRqsVjHKUz1K8EEPfaypLoXxHLltjYC1RVFiggvZ0AjpbgZ5NGvz3sM5S
         Vbcw==
X-Gm-Message-State: AOJu0Ywz62jAmEvgWTu5n5AU/OLJIzy6e8HFcg5YGdWB5AmOW4i7sgVi
	cI0qLmo5WDaZQr8AAztBkLwYG104nXufznV4+N3mNrThRaBKc2vuEIU3wnG0Wq0=
X-Google-Smtp-Source: AGHT+IFANIwBJEVOur10Q3EJpoal7hxcl64tbj3dU1WE7ke0Tk4gnwmvQ/sx2Eq1EDt6nE+wgxqcQA==
X-Received: by 2002:a05:6402:2350:b0:5be:ee30:9948 with SMTP id 4fb4d7f45d1cf-5c08915ba45mr11543060a12.8.1724838850295;
        Wed, 28 Aug 2024 02:54:10 -0700 (PDT)
Message-ID: <94456289-dad1-4fa8-98ad-1012a8ddc779@citrix.com>
Date: Wed, 28 Aug 2024 10:54:08 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5] x86/dom0: disable SMAP for PV domain building only
To: Jan Beulich <jbeulich@suse.com>, Roger Pau Monne <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org
References: <20240827123949.24400-1-roger.pau@citrix.com>
 <77276161-2fcc-4527-87ba-0ef5988ff82a@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <77276161-2fcc-4527-87ba-0ef5988ff82a@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 28/08/2024 10:49 am, Jan Beulich wrote:
> On 27.08.2024 14:39, Roger Pau Monne wrote:
>> --- a/xen/arch/x86/dom0_build.c
>> +++ b/xen/arch/x86/dom0_build.c
>> @@ -612,7 +612,24 @@ int __init construct_dom0(struct domain *d, const module_t *image,
>>      if ( is_hvm_domain(d) )
>>          rc = dom0_construct_pvh(d, image, image_headroom, initrd, cmdline);
>>      else if ( is_pv_domain(d) )
>> +    {
>> +        /*
>> +         * Temporarily clear SMAP in CR4 to allow user-accesses in
>> +         * construct_dom0().  This saves a large number of corner cases
>> +         * interactions with copy_from_user().
>> +         */
>> +        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
>> +        {
>> +            cr4_pv32_mask &= ~X86_CR4_SMAP;
>> +            write_cr4(read_cr4() & ~X86_CR4_SMAP);
>> +        }
>>          rc = dom0_construct_pv(d, image, image_headroom, initrd, cmdline);
>> +        if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
>> +        {
>> +            write_cr4(read_cr4() | X86_CR4_SMAP);
>> +            cr4_pv32_mask |= X86_CR4_SMAP;
>> +        }
>> +    }
> Andrew, looking at this code I really wonder what benefit you request to
> move this further is going to have. Afaict no matter where we put it, it'll
> be an #ifdef around each of the two accesses to cr4_pv32_mask when we make
> that variable CONFIG_PV32-only.

This TU is common to PV and HVM, meaning that this logic inspecting
XEN_SMAP and playing with cr4 is included even in !PV builds.

Having it all in x86/pv/dom0_build.c means it will be dropped in a !PV
build.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 10:36:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 10:36:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784640.1194038 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjG2W-0007V3-NU; Wed, 28 Aug 2024 10:36:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784640.1194038; Wed, 28 Aug 2024 10:36:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjG2W-0007Uw-Kn; Wed, 28 Aug 2024 10:36:36 +0000
Received: by outflank-mailman (input) for mailman id 784640;
 Wed, 28 Aug 2024 10:36:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NRYu=P3=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjG2W-0007Qm-2t
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 10:36:36 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 65bda02e-6529-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 12:36:34 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-5c210e23651so1008231a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 03:36:34 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1c2d2esm2073770a12.16.2024.08.28.03.36.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 03:36:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 65bda02e-6529-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724841394; x=1725446194; 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=2kqiz6hB63jDsjhvU7O+cVSBsv9rLDySCre9tX4VYoc=;
        b=L8fd5bOb9nsRoZ2k4El7P9Wy6s0aMCErGM4sTuOUSBcei3CgvVX7G5Y6s6ZzBaR5xD
         RR5wetb/403lQUgISNcmZkYoXbG+/eq82j2vphoy8jnJf6+PsmCwEHqJXqMPTSh8Ib8K
         ErZwwTTuNOMf5JE88d6MSZPJ5x1sFqJ9YmsNJWiEP1t2fcRvlrF1puYnn6hDMR4XdJbR
         OCFxknhVLMSNIC9SQBP4WPRwcU9Qh1s34+llmfQ5Y499dXR3lyFmWdPMCiaYJQRstK4K
         MHRAbMoDloYE/TKfs1WP9W4IMztCiSa4GyUi3AYU6xLx/q1he4Rm1H0LHqM0Jrnbxfxj
         yymw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724841394; x=1725446194;
        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=2kqiz6hB63jDsjhvU7O+cVSBsv9rLDySCre9tX4VYoc=;
        b=uqg4sO6ibGnfc4r3IsbiyJi/dZpNQWlGDolLryBDTcyTfwE+iEJ/6hpWAYAENyKB00
         Jz3RTn3NmGfeAHYS8oxRUjs0X29uDo9u+hCWewrz/cssqoRujRDfNou0O4Q3Z3dTjlCv
         AOBa0mmqbUza8TCCB9RLGshQVsEcjpBVr2TEmjGFkGXm1X9qmvGp4OvhFUzOBDWKeAFH
         ZQWxQAqhEGSFemooF9AK1lQMpEbVV0GxR1FgFgISzG/QmuDgmlsu90XPjpDHHTJ3Q7Mg
         o7xv30lDfcjeft4sX9fIQ4BnedwLi7hGCIS8bQHXlCf2Hhu18yrZy9bReer5+uv0Hvps
         p6jQ==
X-Forwarded-Encrypted: i=1; AJvYcCWeD+aZmDGPi0tXtyxal810n3P6ym73UYxCu72YPycqtv2qGs3EE4Qj8GTmQdH4iBgu/4HttP/RsTI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyD+W+z9m9artptSd7Trh1CMQ+LvonAgHrhY6JX9cqR8xjthb88
	oHfHJFQ7PVEzi0jlCmvMzc8UHIzDM4mHAV3TOqiQFS7dXC36ZMsItPZY/9ZbUl+y2t0PAVMfOMo
	=
X-Google-Smtp-Source: AGHT+IEbZLBJ39Ltx3KW1Eojwj1Ryf3ceRjTrvHVP1vtnAwndaFWVfOGcT6/eXJYJGc2Ex+79UUxMg==
X-Received: by 2002:a05:6402:51c6:b0:5be:e1bc:2304 with SMTP id 4fb4d7f45d1cf-5c2138e0fdemr1388426a12.7.1724841394066;
        Wed, 28 Aug 2024 03:36:34 -0700 (PDT)
Message-ID: <0742fd21-d606-440a-a7fa-dd3bfccfa1c4@suse.com>
Date: Wed, 28 Aug 2024 12:36:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v4] x86/msi: fix locking for SR-IOV devices
To: Stewart Hildebrand <stewart.hildebrand@amd.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 Teddy Astie <teddy.astie@vates.tech>, xen-devel@lists.xenproject.org
References: <20240827035929.118003-1-stewart.hildebrand@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240827035929.118003-1-stewart.hildebrand@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 27.08.2024 05:59, Stewart Hildebrand wrote:
> In commit 4f78438b45e2 ("vpci: use per-domain PCI lock to protect vpci
> structure") a lock moved from allocate_and_map_msi_pirq() to the caller
> and changed from pcidevs_lock() to read_lock(&d->pci_lock). However, one
> call path wasn't updated to reflect the change, leading to a failed
> assertion observed under the following conditions:
> 
> * PV dom0
> * Debug build (debug=y) of Xen
> * There is an SR-IOV device in the system with one or more VFs enabled
> * Dom0 has loaded the driver for the VF and enabled MSI-X
> 
> (XEN) Assertion 'd || pcidevs_locked()' failed at drivers/passthrough/pci.c:535
> (XEN) ----[ Xen-4.20-unstable  x86_64  debug=y  Not tainted ]----
> ...
> (XEN) Xen call trace:
> (XEN)    [<ffff82d040284da8>] R pci_get_pdev+0x4c/0xab
> (XEN)    [<ffff82d040344f5c>] F arch/x86/msi.c#read_pci_mem_bar+0x58/0x272
> (XEN)    [<ffff82d04034530e>] F arch/x86/msi.c#msix_capability_init+0x198/0x755
> (XEN)    [<ffff82d040345dad>] F arch/x86/msi.c#__pci_enable_msix+0x82/0xe8
> (XEN)    [<ffff82d0403463e5>] F pci_enable_msi+0x3f/0x78
> (XEN)    [<ffff82d04034be2b>] F map_domain_pirq+0x2a4/0x6dc
> (XEN)    [<ffff82d04034d4d5>] F allocate_and_map_msi_pirq+0x103/0x262
> (XEN)    [<ffff82d04035da5d>] F physdev_map_pirq+0x210/0x259
> (XEN)    [<ffff82d04035e798>] F do_physdev_op+0x9c3/0x1454
> (XEN)    [<ffff82d040329475>] F pv_hypercall+0x5ac/0x6af
> (XEN)    [<ffff82d0402012d3>] F lstar_enter+0x143/0x150
> 
> In read_pci_mem_bar(), the VF obtains the struct pci_dev pointer for its
> associated PF to access the vf_rlen array. This array is initialized in
> pci_add_device() and is only populated in the associated PF's struct
> pci_dev.
> 
> Add links between the VF's struct pci_dev and associated PF struct
> pci_dev, ensuring the PF's struct doesn't get deallocated until all its
> VFs have been removed. Access the vf_rlen array via the new link to the
> PF, and remove the troublesome call to pci_get_pdev().
> 
> Add a call to pci_get_pdev() inside the pcidevs_lock()-locked section of
> pci_add_device() to set up the link from VF to PF. In case the new
> pci_get_pdev() invocation fails to find the associated PF (returning
> NULL), return an error.
> 
> In pci_remove_device(), handle an issue with a corner case when a PF is
> removed with VFs enabled, then re-added with VFs disabled. During PF
> removal, a buggy PF driver may fail to disable SR-IOV, leaving stale
> dangling VFs. At least Linux warns in this case:
> 
> [  106.500334]  0000:01:00.0: driver left SR-IOV enabled after remove
> 
> If the PF is subsequently re-added with VFs disabled, the previously
> associated VFs in Xen would not be backed by a device. Any attempt to
> access the config space of the stale VF would be invalid. Avoid issues
> in this case by removing the VFs right away when removing the PF. This
> also happens to simplify the maintenance of the PF<->VF links since the
> associated PF will always exist during the lifetime of a VF. Note,
> however, if a PF is removed before the VFs, Xen will return an error
> for the VF removals since they were already removed.

Not very nice, but probably tolerable.

> ---
> When I tested removing a PF with VFs enabled, then re-adding with VFs
> disabled, I observed the following Xen crash when dom0 attempted to
> access the config space of a stale VF:
> 
> (XEN) Assertion 'pos' failed at arch/x86/msi.c:1275
> (XEN) ----[ Xen-4.20-unstable  x86_64  debug=y  Tainted:   C    ]----
> ...
> (XEN) Xen call trace:
> (XEN)    [<ffff82d040346834>] R pci_msi_conf_write_intercept+0xa2/0x1de
> (XEN)    [<ffff82d04035d6b4>] F pci_conf_write_intercept+0x68/0x78
> (XEN)    [<ffff82d0403264e5>] F arch/x86/pv/emul-priv-op.c#pci_cfg_ok+0xa0/0x114
> (XEN)    [<ffff82d04032660e>] F arch/x86/pv/emul-priv-op.c#guest_io_write+0xb5/0x1c8
> (XEN)    [<ffff82d0403267bb>] F arch/x86/pv/emul-priv-op.c#write_io+0x9a/0xe0
> (XEN)    [<ffff82d04037c77a>] F x86_emulate+0x100e5/0x25f1e
> (XEN)    [<ffff82d0403941a8>] F x86_emulate_wrapper+0x29/0x64
> (XEN)    [<ffff82d04032802b>] F pv_emulate_privileged_op+0x12e/0x217
> (XEN)    [<ffff82d040369f12>] F do_general_protection+0xc2/0x1b8
> (XEN)    [<ffff82d040201aa7>] F x86_64/entry.S#handle_exception_saved+0x2b/0x8c
> 
> This crash is avoided by removing the VFs right away with the PF.

If I'm not mistaken the same would happen independent of your change if
Dom0 disabled VFs without reporting their removal (first). That's
technically no different from removing with VFs enabled, then adding
with VFs disabled. We may want to be able to cope with that.

> --- a/xen/drivers/passthrough/pci.c
> +++ b/xen/drivers/passthrough/pci.c
> @@ -341,6 +341,8 @@ static struct pci_dev *alloc_pdev(struct pci_seg *pseg, u8 bus, u8 devfn)
>  
>      list_add(&pdev->alldevs_list, &pseg->alldevs_list);
>  
> +    INIT_LIST_HEAD(&pdev->physfn.vf_list);

There is a certain risk with doing such uniformly when the field is part
of a union. Yes, little initialization has happened up to here, but I'm
still concerned. (One of the reasons I don't like the struct list_head
instances to be split, despite your legitimate point regarding naming.)
At the very least this wants moving yet earlier in the function, before
the new struct is passed anywhere else.

> @@ -700,10 +706,31 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
>           * extended function.
>           */
>          if ( pdev->info.is_virtfn )
> +        {
> +            struct pci_dev *pf_pdev;
> +
>              pdev->info.is_extfn = pf_is_extfn;
> +            pf_pdev = pci_get_pdev(NULL,
> +                                   PCI_SBDF(seg, info->physfn.bus,
> +                                            info->physfn.devfn));
> +            if ( pf_pdev )
> +            {
> +                pdev->virtfn.pf_pdev = pf_pdev;
> +                list_add(&pdev->virtfn.entry, &pf_pdev->physfn.vf_list);
> +            }
> +            else
> +            {
> +                printk(XENLOG_WARNING "Failed to add SR-IOV device PF %pp for VF %pp\n",
> +                       &PCI_SBDF(seg, info->physfn.bus, info->physfn.devfn),
> +                       &pdev->sbdf);
> +                free_pdev(pseg, pdev);
> +                ret = -ENODEV;

Why -ENODEV? Ideally the error code from the earlier pci_add_device() could
be retained (even if some fallback would be needed in case that one succeeded
or the path wasn't even taken). Yet on the whole I wonder if we wouldn't be
better off delaying that recursive call some, such that the lock wouldn't
be dropped anymore between the call and getting here. This would then also
eliminate the need for the new pci_get_pdev() invocation.

> @@ -818,6 +847,24 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn)
>      list_for_each_entry ( pdev, &pseg->alldevs_list, alldevs_list )
>          if ( pdev->bus == bus && pdev->devfn == devfn )
>          {
> +            ret = 0;
> +
> +            if ( !pdev->info.is_virtfn )
> +            {
> +                struct pci_dev *vf_pdev, *tmp;
> +
> +                /*
> +                 * If a PF with VFs enabled is removed, then re-added without
> +                 * VFs enabled, the previously associated VFs would no longer be
> +                 * backed by a device. Remove the associated VFs right away.
> +                 */

While in the description the "enabled" and "disabled" are kind of
tolerable, at least in the code comment I think we want to be more
precise. The question isn't whether VFs are enabled, but whether we
know of the VFs.

It's further unclear here what "a device" is.

> +                list_for_each_entry_safe(vf_pdev, tmp, &pdev->physfn.vf_list,
> +                                         virtfn.entry)
> +                    ret = pci_remove_device(vf_pdev->sbdf.seg,
> +                                            vf_pdev->sbdf.bus,
> +                                            vf_pdev->sbdf.devfn) ?: ret;

And if this fails, the VF will still remain orphaned. I think in the
model I had suggested no such risk would exist.

Misra also isn't going to like the recursion here.

> @@ -826,7 +873,7 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn)
>                  write_unlock(&pdev->domain->pci_lock);
>              }
>              pci_cleanup_msi(pdev);
> -            ret = iommu_remove_device(pdev);
> +            ret = iommu_remove_device(pdev) ?: ret;
>              printk(XENLOG_DEBUG "PCI remove device %pp\n", &pdev->sbdf);
>              free_pdev(pseg, pdev);
>              break;

Is it even legitimate to continue cleaning up if there was an earlier
failure?

In any event - please consider e.g. the case where the XSM check allows
the PF removal, but denies the removal of some of the VFs.

> --- a/xen/include/xen/pci.h
> +++ b/xen/include/xen/pci.h
> @@ -150,7 +150,18 @@ struct pci_dev {
>          unsigned int count;
>  #define PT_FAULT_THRESHOLD 10
>      } fault;
> -    u64 vf_rlen[6];
> +    union {
> +        struct pf_info {
> +            /* Only populated for PFs (info.is_virtfn == false) */
> +            struct list_head vf_list;             /* List head */
> +            uint64_t vf_rlen[PCI_SRIOV_NUM_BARS];
> +        } physfn;
> +        struct {
> +            /* Only populated for VFs (info.is_virtfn == true) */
> +            struct list_head entry;               /* Entry in vf_list */
> +            struct pci_dev *pf_pdev;              /* Link from VF to PF */

const?

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 10:44:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 10:44:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784670.1194048 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjGA3-0001BJ-Et; Wed, 28 Aug 2024 10:44:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784670.1194048; Wed, 28 Aug 2024 10:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjGA3-0001BC-Bv; Wed, 28 Aug 2024 10:44:23 +0000
Received: by outflank-mailman (input) for mailman id 784670;
 Wed, 28 Aug 2024 10:44:22 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NRYu=P3=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjGA2-0001B6-3V
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 10:44:22 +0000
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com
 [2a00:1450:4864:20::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7b14acbc-652a-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 12:44:20 +0200 (CEST)
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a86e5e9ff05so230633266b.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 03:44:20 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e549b1d9sm227466466b.48.2024.08.28.03.44.18
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 03:44:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7b14acbc-652a-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724841859; x=1725446659; 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=iYXGgoUsTnz1IAsequLBskqm1HZ9svYx1885zpAfyto=;
        b=Y8D8wL2XxVWWdpg6wsZ3b6gDnO/SreEU5Sn0+XS/LCv4heqMamzMtRceQqZIzSvkIu
         dL66cLuj8ML7DKW9oik0FrXRGBGkh1Dc+9OT7bylV1FLASrwnm6VadTmVZFlbXcJIQXA
         t74MX1pzNCDcHbX7Qj+tIcz+2WhTEAfo4fS2w4Zcwp0dH2XzOE12gxtCBd4HzQArT+hu
         gaP3OC9NFvXJ6tmELMaUqK/7sP/W6x6s3mPwELnoT2/u6WlwJwj7FFK3GtO2MUiBU6/V
         YPAmdzIqUKxiftG3rPpZEX60RD0BVjxjmW14+gZk5X0qRJ0ja0OBPI72ZxykJ9r0AEFT
         M3Og==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724841859; x=1725446659;
        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=iYXGgoUsTnz1IAsequLBskqm1HZ9svYx1885zpAfyto=;
        b=YwYfVrZnjRmzuSPfGRDSoa+LZgiYyGwq8LJcjeyiLG0erEcC65aG8EqRc7gAKbYnAv
         NBOgE6mfz6pHutY4zgwIqHuu4baBI++Ila4WRzqnu/nk1/junjYRjI4HIgyKQUKnCNFA
         1BplUNldYufmZ1b9cVg4ZV8y62hkDKaa556gkiUsJ5IaJWLjiIyiILR4eQJK2s6528+p
         yuCQKTnTfgauESMb+Zq/n9U2q2BYGeQh+dvlZW8JSqGZt3zI+a7vc0382oRwzOB1IbQd
         QFtW9sc2TLKXCvUcVdCLpIzsGJ87dj11QMNHMC3tXuu/Qqdzgbh5iJpoIgKC+GJLZQDN
         8RcA==
X-Forwarded-Encrypted: i=1; AJvYcCV1X8rFtuQhdkf+2NqGAsPewI4cp6C78ljWGH/aic+q6b4ZpMzJlNLjXV/fSjFX3B5IzWJHdFvuGPI=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz7n4ujfENK9k52+pv1IxdLExbWvUlb0SeZcNdV2WPqhattkbhR
	T+3+aEuUkGRKi0+HVNSinSJ8ROpNrCpTexFrK7+Ed837x9qWEolOc6VFVRUU1Q==
X-Google-Smtp-Source: AGHT+IEPUDQyDdPexLqb48iBgp0fQbv5sq4+9dn1Wip0B/bhG65Wy2d3uTqvwO57jSSh+rWDizLd8g==
X-Received: by 2002:a17:907:7e93:b0:a80:f81c:fd75 with SMTP id a640c23a62f3a-a870a5d443amr132760866b.0.1724841859405;
        Wed, 28 Aug 2024 03:44:19 -0700 (PDT)
Message-ID: <3705f296-3b79-4bad-9bbc-0b86aaa41314@suse.com>
Date: Wed, 28 Aug 2024 12:44:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 2/7] xen/riscv: set up fixmap mappings
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
 <57e892d5b2c526dd44b68d4976796a25c0feca20.1724256027.git.oleksii.kurochko@gmail.com>
 <4b9cfa7e-546a-4dbb-a3de-4267849be13a@suse.com>
 <9210aa20ebe892b9866309a7531398d446d0eef5.camel@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: <9210aa20ebe892b9866309a7531398d446d0eef5.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 28.08.2024 11:53, oleksii.kurochko@gmail.com wrote:
> On Tue, 2024-08-27 at 12:29 +0200, Jan Beulich wrote:
>>>
>>> +
>>> +/*
>>> + * Direct access to xen_fixmap[] should only happen when {set,
>>> + * clear}_fixmap() is unusable (e.g. where we would end up to
>>> + * recursively call the helpers).
>>> + */
>>> +extern pte_t xen_fixmap[];
>>
>> I'm afraid I keep being irritated by the comment: What recursive use
>> of
>> helpers is being talked about here? I can't see anything recursive in
>> this
>> patch. If this starts happening with a subsequent patch, then you
>> have
>> two options: Move the declaration + comment there, or clarify in the
>> description (in enough detail) what this is about.
> This comment is added because of:
> ```
> void *__init pmap_map(mfn_t mfn)
>   ...
>        /*
>         * We cannot use set_fixmap() here. We use PMAP when the domain map
>         * page infrastructure is not yet initialized, so
>    map_pages_to_xen() called
>         * by set_fixmap() needs to map pages on demand, which then calls
>    pmap()
>         * again, resulting in a loop. Modify the PTEs directly instead.
>    The same
>         * is true for pmap_unmap().
>         */
>        arch_pmap_map(slot, mfn);
>    ...
> ```
> And it happens because set_fixmap() could be defined using generic PT
> helpers

As you say - could be. If I'm not mistaken no set_fixmap() implementation
exists even by the end of the series. Fundamentally I'd expect set_fixmap()
to (possibly) use xen_fixmap[] directly. That in turn ...

> so what will lead to recursive behaviour when when there is no
> direct map:

... would mean no recursion afaict. Hence why clarification is needed as
to what's going on here _and_ what's planned.

Jan

>    static pte_t *map_table(mfn_t mfn)
>    {
>        /*
>         * During early boot, map_domain_page() may be unusable. Use the
>         * PMAP to map temporarily a page-table.
>         */
>        if ( system_state == SYS_STATE_early_boot )
>            return pmap_map(mfn);
>        ...
>    }



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 10:47:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 10:47:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784677.1194058 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjGCt-0002Zh-R8; Wed, 28 Aug 2024 10:47:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784677.1194058; Wed, 28 Aug 2024 10:47:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjGCt-0002Za-OA; Wed, 28 Aug 2024 10:47:19 +0000
Received: by outflank-mailman (input) for mailman id 784677;
 Wed, 28 Aug 2024 10:47:18 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjGCs-0002Z8-7Y; Wed, 28 Aug 2024 10:47:18 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjGCr-0005uf-Uw; Wed, 28 Aug 2024 10:47:17 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjGCr-0000w4-Ln; Wed, 28 Aug 2024 10:47:17 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjGCr-0005wP-LI; Wed, 28 Aug 2024 10:47:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=4asoyMP1AcM2DPokcKpYmXwdj8h9QGJeUJPImo9zXs0=; b=jiiXA04PF0YnhJX8cRIG9AvAKI
	wUB1+Im65ddRpOHe1KtB5KaPOaASZXS1xxkGli++n+pp853+lxITzwdFA1l5BqK5TRjOeFcXsENSJ
	Z32dduUtnjTWbpJukKvqE77OR9HPyL8JMgu+WWtSNZh9ElUhvZ0u2rSefaG8T9/rbx1Q=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187371-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187371: regressions - trouble: broken/fail/pass
X-Osstest-Failures:
    qemu-mainline:test-armhf-armhf-xl-qcow2:<job status>:broken:regression
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-libvirt-vhd:leak-check/check:fail:heisenbug
    qemu-mainline:test-armhf-armhf-xl-qcow2:host-install(5):broken:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=afaee42f777bc359db95f692804f7fc7e12c0c02
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 10:47:17 +0000

flight 187371 qemu-mainline real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187371/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-xl-qcow2       <job status>                 broken
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-libvirt-vhd 22 leak-check/check           fail pass in 187360

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-qcow2     5 host-install(5)       broken baseline untested
 test-armhf-armhf-xl-qcow2   14 migrate-support-check fail in 187360 never pass
 test-armhf-armhf-xl-qcow2 15 saverestore-support-check fail in 187360 never pass
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass

version targeted for testing:
 qemuu                afaee42f777bc359db95f692804f7fc7e12c0c02
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  356 days
Failing since        182723  2023-09-07 18:19:05 Z  355 days   38 attempts
Testing same since   187360  2024-08-27 06:16:18 Z    1 days    2 attempts

------------------------------------------------------------
621 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    broken  
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 fail    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-armhf-armhf-xl-qcow2 broken
broken-step test-armhf-armhf-xl-qcow2 host-install(5)

Not pushing.

(No revision log; it would be 181112 lines long.)


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 10:56:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 10:56:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784687.1194068 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjGLk-0004Z4-R4; Wed, 28 Aug 2024 10:56:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784687.1194068; Wed, 28 Aug 2024 10:56:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjGLk-0004Yx-Nx; Wed, 28 Aug 2024 10:56:28 +0000
Received: by outflank-mailman (input) for mailman id 784687;
 Wed, 28 Aug 2024 10:56:27 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3BgB=P3=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sjGLi-0004Td-UM
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 10:56:26 +0000
Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com
 [2a00:1450:4864:20::131])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2b30c350-652c-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 12:56:25 +0200 (CEST)
Received: by mail-lf1-x131.google.com with SMTP id
 2adb3069b0e04-5334adf7249so7785207e87.3
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 03:56:25 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5334ea36a17sm2106591e87.95.2024.08.28.03.56.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 03:56:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2b30c350-652c-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724842584; x=1725447384; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=9b4N4oGt0bxH+CCXjlFKEAXH981ACmRGX5u+yhg76/Y=;
        b=fTFpHRthDYlbTwBof8yRqKooh4zwz5VmmsghHyWvxIj5MksnUcJlHtDMovvMtF5RPe
         PPV8hs2wNW8L2KaX4tA8tdv0eV85c57haf2swAE9OGNxl+kTMEq/NOIuwe2Pv3GcCcAQ
         KAL2o1ZIhdpUTXdmUNhTVovLSl4O6hBjF33+xC6ajK7UwnWMcCtb8ogC6Pnqh1nG/433
         3X6HoSWMP7O7TUxZI7MgSrjqPwS64+v4CP12B0oINLphNdMYLXMe9Pu97F4lH+u88A2k
         x3tWyRb3YfLOeSpsEuWU6vubMZhH0GBHO3HPLPln+Ah/Pit9zdvRtWqxkdMkLiGzq53O
         03Xw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724842584; x=1725447384;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=9b4N4oGt0bxH+CCXjlFKEAXH981ACmRGX5u+yhg76/Y=;
        b=lhyQJAqI6I8YOReS4aaxG5XZTUHQ8UutRXv0lI7swqtJmOflipINBOe4OCyluNefTQ
         IaUeWmJ1gvMAw2iYG/xi8EmbJEaJTE/Duchfx/P0Kvkiws1vLFw5351XdMnTcqAwDfuF
         rigC0csC9/eQMXq0MOn4f5AP95ubG26WqVdlDmU41cDiuiiLgF4zNTxS9bTOaphC05fG
         /LqtM0Hf+2uy8IjtKZi8S+MBuFwGqw+dVclb+dKFgjE7737W15/rzPKFEqRoMx7CNMw0
         Vchm9m0aiX4Rs9vZCgpLG9FC48IP4HUsIRDn+58Zq4OPoEEuIPXeIpAwrAhdPMZefW6z
         bgyw==
X-Forwarded-Encrypted: i=1; AJvYcCVPHLwbsREdrvcHkRcx3c0rcH08icViN45AgbAZgqbNIYAp599YOq2HLF2wkkgk8B+V0DyHe8r6Yt8=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx9PRR87fyiPQeRMMbhgDUyG+ixlUXBq1xCurb9M/+DAHlzQZ1f
	IGQMZu9v2lSIhHtDWqkkmc5Q6VYKrVUqTF6p1GlOmLTnCo2MehnD
X-Google-Smtp-Source: AGHT+IEwe32BCxbbMbVYptW0bJtu0II+e4d3ITPihawHRicYxNi0hZVtoItAEuBacwxXa6gZ7I8hJA==
X-Received: by 2002:a05:6512:33cd:b0:533:48c9:754d with SMTP id 2adb3069b0e04-5346c622a69mr1035142e87.34.1724842583718;
        Wed, 28 Aug 2024 03:56:23 -0700 (PDT)
Message-ID: <d5c6b74609d18a18ef789e795d6ce72469bff277.camel@gmail.com>
Subject: Re: [PATCH v5 4/7] xen/riscv: introduce functionality to work with
 CPU info
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Wed, 28 Aug 2024 12:56:22 +0200
In-Reply-To: <8f01fffa-ff7e-4a08-b707-7bf5175b461e@suse.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
	 <03a703996ae7300a9eda54283711b19c42a7d116.1724256027.git.oleksii.kurochko@gmail.com>
	 <8f01fffa-ff7e-4a08-b707-7bf5175b461e@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.4 (3.52.4-1.fc40app2) 
MIME-Version: 1.0

On Tue, 2024-08-27 at 15:44 +0200, Jan Beulich wrote:
> On 21.08.2024 18:06, Oleksii Kurochko wrote:

>=20
> > --- a/xen/arch/riscv/include/asm/smp.h
> > +++ b/xen/arch/riscv/include/asm/smp.h
> > @@ -5,6 +5,10 @@
> > =C2=A0#include <xen/cpumask.h>
> > =C2=A0#include <xen/percpu.h>
> > =C2=A0
> > +#include <asm/processor.h>
> > +
> > +#define INVALID_HARTID ULONG_MAX
>=20
> So what if the firmware report this value for one of the harts?
It could be an issue, but in my opinion, there is a small chance that
the firmware will use such a high number. I can add a BUG_ON() in
start_xen() to check that bootcpu_id is not equal to INVALID_HARTID to
ensure that the firmware does not report this value. Otherwise, we
would need to add a 'bool valid;' to struct pcpu_info and use it
instead of INVALID_HARTID.

> > --- a/xen/arch/riscv/setup.c
> > +++ b/xen/arch/riscv/setup.c
> > @@ -8,6 +8,7 @@
> > =C2=A0#include <public/version.h>
> > =C2=A0
> > =C2=A0#include <asm/early_printk.h>
> > +#include <asm/smp.h>
> > =C2=A0#include <asm/traps.h>
> > =C2=A0
> > =C2=A0void arch_get_xen_caps(xen_capabilities_info_t *info)
> > @@ -40,6 +41,10 @@ void __init noreturn start_xen(unsigned long
> > bootcpu_id,
> > =C2=A0{
> > =C2=A0=C2=A0=C2=A0=C2=A0 remove_identity_mapping();
> > =C2=A0
> > +=C2=A0=C2=A0=C2=A0 set_processor_id(0);
>=20
> This isn't really needed, is it? The pcpu_info[] initializer already
> installs the necessary 0. Another thing would be if the initializer
> set the field to, say, NR_CPUS.
>=20
> > --- /dev/null
> > +++ b/xen/arch/riscv/smp.c
> > @@ -0,0 +1,21 @@
> > +#include <xen/smp.h>
> > +
> > +/*
> > + * FIXME: make pcpu_info[] dynamically allocated when necessary
> > + *=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 functionality will be rea=
dy
> > + */
> > +/* tp points to one of these per cpu */
> > +struct pcpu_info pcpu_info[NR_CPUS] =3D { { 0, INVALID_HARTID } };
>=20
> As to the initializer - what about CPUs other than CPU0? Would they
> better all have hart_id set to invalid?
I thought about that, but I decided that if we have INVALID_HARTID as
hart_id and the hart_id is checked in the appropriate places, then it
doesn't really matter what the processor_id member of struct pcpu_info
is. For clarity, it might be better to set it to an invalid value, but
it doesn't clear which value we should choose as invalid. I assume that
NR_CPUS is a good candidate for that?

>=20
> Also, as a pretty strong suggestion to avoid excessive churn going
> forward: Please consider using dedicated initializers here. IOW
> perhaps
>=20
> struct pcpu_info pcpu_info[NR_CPUS] =3D { [0 ... NR_CPUS - 1] =3D {
> =C2=A0=C2=A0=C2=A0 .hart_id =3D INVALID_HARTID,
> }};
>=20
> Yet as said earlier - in addition you likely want to make sure no
> two CPUs have (part of) their struct instance in the same cache line.
> That won't matter right now, as you have no fields you alter at
> runtime, but I expect such fields will appear.
Is my understanding correct that adding __cacheline_aligned will be
sufficient:
   struct pcpu_info {
   ...
   } __cacheline_aligned;


>=20
> > +void setup_tp(unsigned int cpuid)
> > +{
> > +=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * tp register contains an address of physical=
 cpu
> > information.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * So write physical CPU info of cpuid to tp r=
egister.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * It will be used later by get_processor_id()=
 ( look at
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * <asm/processor.h> ):
> > +=C2=A0=C2=A0=C2=A0=C2=A0 *=C2=A0=C2=A0 #define get_processor_id()=C2=
=A0=C2=A0=C2=A0 (tp->processor_id)
> > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0 asm volatile ( "mv tp, %0"
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 :: "r" ((unsigned long)&pcpu_info[c=
puid]) :
> > "memory" );
> > +}
>=20
> So you've opted to still do this in C. Which means there's still a
> residual risk of the compiler assuming it can already to tp. What's
> the problem with doing this properly in assembly?
There is no problem and to be on the safe side I will re-write it to
assembly.

>=20
> As to the memory clobber - in an isolated, non-inline function its
> significance is reduced mostly to the case of LTO (which I'm not
> sure you even target). Nevertheless probably worth keeping, even if
> mainly for documentation purposes. Provided of course this C function
> is to remain.
>=20
> > --- /dev/null
> > +++ b/xen/arch/riscv/smpboot.c
> > @@ -0,0 +1,8 @@
> > +#include <xen/init.h>
> > +#include <xen/sections.h>
> > +#include <xen/smp.h>
> > +
> > +void __init smp_set_bootcpu_id(unsigned long boot_cpu_hartid)
> > +{
> > +=C2=A0=C2=A0=C2=A0 cpuid_to_hartid(0) =3D boot_cpu_hartid;
> > +}
>=20
> Does this really need its own function?
No, there is no such need. I will drop it.

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 11:03:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 11:03:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784705.1194078 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjGSm-0006Qc-GV; Wed, 28 Aug 2024 11:03:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784705.1194078; Wed, 28 Aug 2024 11:03:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjGSm-0006QV-Dj; Wed, 28 Aug 2024 11:03:44 +0000
Received: by outflank-mailman (input) for mailman id 784705;
 Wed, 28 Aug 2024 11:03:42 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=933A=P3=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1sjGSk-0006QP-Ju
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 11:03:42 +0000
Received: from pb-smtp21.pobox.com (pb-smtp21.pobox.com [173.228.157.53])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2c9534be-652d-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 13:03:40 +0200 (CEST)
Received: from pb-smtp21.pobox.com (unknown [127.0.0.1])
 by pb-smtp21.pobox.com (Postfix) with ESMTP id C9F3A2EAB7;
 Wed, 28 Aug 2024 07:03:35 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1])
 by pb-smtp21.pobox.com (Postfix) with ESMTP id B25B02EAB6;
 Wed, 28 Aug 2024 07:03:35 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [46.211.119.31])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 8C6BF2EAB5;
 Wed, 28 Aug 2024 07:03:31 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2c9534be-652d-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:mime-version:content-transfer-encoding;
	 s=sasl; bh=oeuHNhYVPMSGHHFU+SsBAnXlLn7c83Viv0J+IyHHYIo=; b=Ep95
	tuXmsWrLVHQTZMlC2dVhqu4vg41ekwIV05H+4ON0ywkO8OLuueUz95zlr8iPUQJb
	bgE5wh3mssZb/XMBc86sBcruwpBdv6rqTOSlIk3pLFx155Aro3MY+81It7uWqU3Y
	VdBYmJVKj0RGpbOcSBVqfhSt6E4KZxjwLCxiRPM=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>
Subject: [XEN PATCH v7 0/2] x86: make CPU virtualisation support configurable
Date: Wed, 28 Aug 2024 14:03:27 +0300
Message-Id: <cover.1724842645.git.Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
X-Pobox-Relay-ID:
 297F73F6-652D-11EF-84A2-E92ED1CD468F-90055647!pb-smtp21.pobox.com
Content-Transfer-Encoding: quoted-printable

These are final 2 patches of the series for making VMX/SVM support in Xen
configurable:

https://lore.kernel.org/xen-devel/cover.1723110344.git.Sergiy_Kibrik@epam=
.com/

Minor changes comparing to v6, changelogs are provided per-patch.

  -Sergiy=20

Xenia Ragiadakou (2):
  ioreq: do not build arch_vcpu_ioreq_completion() for non-VMX
    configurations
  x86/hvm: make AMD-V and Intel VT-x support configurable

 xen/Kconfig              |  7 +++++++
 xen/arch/arm/ioreq.c     |  6 ------
 xen/arch/x86/Kconfig     | 19 +++++++++++++++++--
 xen/arch/x86/hvm/ioreq.c |  2 ++
 xen/include/xen/ioreq.h  | 10 ++++++++++
 5 files changed, 36 insertions(+), 8 deletions(-)

--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 11:05:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 11:05:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784709.1194088 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjGUk-0006z5-S3; Wed, 28 Aug 2024 11:05:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784709.1194088; Wed, 28 Aug 2024 11:05:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjGUk-0006yw-OS; Wed, 28 Aug 2024 11:05:46 +0000
Received: by outflank-mailman (input) for mailman id 784709;
 Wed, 28 Aug 2024 11:05:45 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=933A=P3=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1sjGUj-0006yl-PY
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 11:05:45 +0000
Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 779dc1ec-652d-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 13:05:43 +0200 (CEST)
Received: from pb-smtp1.pobox.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id 4689C3DDE4;
 Wed, 28 Aug 2024 07:05:42 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id 3A16A3DDE3;
 Wed, 28 Aug 2024 07:05:42 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [46.211.119.31])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 3289F3DDE0;
 Wed, 28 Aug 2024 07:05:37 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 779dc1ec-652d-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:in-reply-to:references:mime-version
	:content-transfer-encoding; s=sasl; bh=6fC74O0gmkPt/XZJaNayOLv0S
	GsSK/V8Gt9hWnpnSqs=; b=Fq640KPOPDSdRu1mvA5jJGuaCP+JBmyYKQuAdpJ8+
	2+r2wwkxIIVGx6/xDwG6OrK4SisdUrOdJfnBeT3aarDfvwfr/Ul7gblyioq2cnbw
	ucF1LqzU67kRKGwVIiSIroIeoaQ0vOFQJun9d4sdOePzzJmhWihwa+UCkyZ5kIlQ
	TU=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Xenia Ragiadakou <burzalodowa@gmail.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
	Julien Grall <julien@xen.org>
Subject: [XEN PATCH v7 1/2] ioreq: do not build arch_vcpu_ioreq_completion() for non-VMX configurations
Date: Wed, 28 Aug 2024 14:05:34 +0300
Message-Id: <2e71667a06ece7f0d045c309d69bb73b99d6caa5.1724842645.git.Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1724842645.git.Sergiy_Kibrik@epam.com>
References: <cover.1724842645.git.Sergiy_Kibrik@epam.com>
MIME-Version: 1.0
X-Pobox-Relay-ID:
 7461714E-652D-11EF-88F4-2BAEEB2EC81B-90055647!pb-smtp1.pobox.com
Content-Transfer-Encoding: quoted-printable

From: Xenia Ragiadakou <burzalodowa@gmail.com>

VIO_realmode_completion is specific to vmx realmode and thus the function
arch_vcpu_ioreq_completion() has actual handling work only in VMX-enabled=
 build,
as for the rest x86 and ARM build configurations it is basically a stub.

Here a separate configuration option ARCH_VCPU_IOREQ_COMPLETION introduce=
d that
tells whether the platform we're building for requires any specific ioreq
completion handling. As of now only VMX has such requirement, so the opti=
on is
selected by INTEL_VMX, for other configurations a generic default stub is
provided (it is ARM's version of arch_vcpu_ioreq_completion() moved to co=
mmon
header).

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
CC: Julien Grall <julien@xen.org>
---
changes in v7:
 - comment in Kconfig adjusted
 - fixed patch description
 - updated tags
changes in v6:
 - rename option ARCH_IOREQ_COMPLETION -> ARCH_VCPU_IOREQ_COMPLETION
 - put a comment with brief option's description
changes in v5:
 - introduce ARCH_IOREQ_COMPLETION option & put arch_vcpu_ioreq_completio=
n() under it
 - description changed
---
 xen/Kconfig              |  7 +++++++
 xen/arch/arm/ioreq.c     |  6 ------
 xen/arch/x86/Kconfig     |  1 +
 xen/arch/x86/hvm/ioreq.c |  2 ++
 xen/include/xen/ioreq.h  | 10 ++++++++++
 5 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/xen/Kconfig b/xen/Kconfig
index e459cdac0c..72fdb83760 100644
--- a/xen/Kconfig
+++ b/xen/Kconfig
@@ -95,4 +95,11 @@ config LTO
 config ARCH_SUPPORTS_INT128
 	bool
=20
+#
+# For platforms that require specific handling of per-vCPU ioreq complet=
ion
+# events
+#
+config ARCH_VCPU_IOREQ_COMPLETION
+	bool
+
 source "Kconfig.debug"
diff --git a/xen/arch/arm/ioreq.c b/xen/arch/arm/ioreq.c
index 5df755b48b..2e829d2e7f 100644
--- a/xen/arch/arm/ioreq.c
+++ b/xen/arch/arm/ioreq.c
@@ -135,12 +135,6 @@ bool arch_ioreq_complete_mmio(void)
     return false;
 }
=20
-bool arch_vcpu_ioreq_completion(enum vio_completion completion)
-{
-    ASSERT_UNREACHABLE();
-    return true;
-}
-
 /*
  * The "legacy" mechanism of mapping magic pages for the IOREQ servers
  * is x86 specific, so the following hooks don't need to be implemented =
on Arm:
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 7ef5c8bc48..74e081c7bd 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -127,6 +127,7 @@ config AMD_SVM
=20
 config INTEL_VMX
 	def_bool HVM
+	select ARCH_VCPU_IOREQ_COMPLETION
=20
 config XEN_SHSTK
 	bool "Supervisor Shadow Stacks"
diff --git a/xen/arch/x86/hvm/ioreq.c b/xen/arch/x86/hvm/ioreq.c
index 4eb7a70182..5c3d0c69aa 100644
--- a/xen/arch/x86/hvm/ioreq.c
+++ b/xen/arch/x86/hvm/ioreq.c
@@ -29,6 +29,7 @@ bool arch_ioreq_complete_mmio(void)
     return handle_mmio();
 }
=20
+#ifdef CONFIG_VCPU_ARCH_IOREQ_COMPLETION
 bool arch_vcpu_ioreq_completion(enum vio_completion completion)
 {
     switch ( completion )
@@ -51,6 +52,7 @@ bool arch_vcpu_ioreq_completion(enum vio_completion com=
pletion)
=20
     return true;
 }
+#endif
=20
 static gfn_t hvm_alloc_legacy_ioreq_gfn(struct ioreq_server *s)
 {
diff --git a/xen/include/xen/ioreq.h b/xen/include/xen/ioreq.h
index cd399adf17..29a17e8ff5 100644
--- a/xen/include/xen/ioreq.h
+++ b/xen/include/xen/ioreq.h
@@ -111,7 +111,17 @@ void ioreq_domain_init(struct domain *d);
 int ioreq_server_dm_op(struct xen_dm_op *op, struct domain *d, bool *con=
st_op);
=20
 bool arch_ioreq_complete_mmio(void);
+
+#ifdef CONFIG_VCPU_ARCH_IOREQ_COMPLETION
 bool arch_vcpu_ioreq_completion(enum vio_completion completion);
+#else
+static inline bool arch_vcpu_ioreq_completion(enum vio_completion comple=
tion)
+{
+    ASSERT_UNREACHABLE();
+    return true;
+}
+#endif
+
 int arch_ioreq_server_map_pages(struct ioreq_server *s);
 void arch_ioreq_server_unmap_pages(struct ioreq_server *s);
 void arch_ioreq_server_enable(struct ioreq_server *s);
--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 11:06:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 11:06:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784714.1194098 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjGVL-0007eb-2s; Wed, 28 Aug 2024 11:06:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784714.1194098; Wed, 28 Aug 2024 11:06:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjGVL-0007eU-03; Wed, 28 Aug 2024 11:06:23 +0000
Received: by outflank-mailman (input) for mailman id 784714;
 Wed, 28 Aug 2024 11:06:21 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjGVJ-0007eD-KG
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 11:06:21 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8d99f3a7-652d-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 13:06:19 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a868831216cso758284266b.3
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 04:06:19 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e592d995sm229178566b.204.2024.08.28.04.06.18
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 04:06:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8d99f3a7-652d-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724843179; x=1725447979; 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=pJH0Wn1rbXhb1J6k8gE0oDwQs34HWMEWleH5WCn038g=;
        b=Z3vHwX4dV97mkb9RXddhB9n0sklWrUAhytIup/lh7/Fg/dNZIFAYDLjLlumzma3Lt6
         ro/vCYor2VFFJfnniwiyALHqMTmLZGfPPcFtLfG9PmUK6KczLmJhtJJShIRRIUfFoDZy
         PYfOdSzXhWds1oCQzJFqizdUpApR09KsTB/5w=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724843179; x=1725447979;
        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=pJH0Wn1rbXhb1J6k8gE0oDwQs34HWMEWleH5WCn038g=;
        b=E5XTEKi98NziTn/VsBtmcBIchEpSkvP74FVL2YhoZId+IVAx/NqkDguXa4d+Fo6kU1
         /GmoTilYxsuQ9aH/HJeTMLXBGH6HDkZZ+pkMagWQkvjqH/rK/nBLwiwIwFxbPdaN1A7G
         2BMBL6Q+6WLjh9ed8mrCYrho6Q6a61dwDwKU826iqZgYPCjw0zwb+UtRQDnRW4zJzfCO
         MGJkFBbJ3GnyHC6h4yeZnN35t9aO7iZL6M5Zn3XitBjVYEXKpLCaLqr5EyqiRqoWUrag
         laLDgEpjTNsutpahX4dg8pDhMubDVvdj2+gW89vSf4BYt3NYkEBQ991/SjYnXIFefznt
         o7Ag==
X-Forwarded-Encrypted: i=1; AJvYcCW4CCN+NhdDhLP4rgPg5TP3knqaK2GyFcV7qX3UzmImFvwQzzuZNl9T86R+36lxu36iv3R4qgHDXjw=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy3blVSpH3ROHilpD/1XPBysfKOOHmoHcUHS++BvOhiLDxuyo1Q
	Rs2rngQ8mxYtRk1slqQEqx5PG4Yj7QQ+QJAF014+wpwRJsVJ/y7gtPh0JUbAWvY=
X-Google-Smtp-Source: AGHT+IGBWQc47npBaGeb5WNQKsJ1iBCunevJkKC3Yi5rUDFIFNVwMB1mjbmA3nUTTGROhlfYUCfP4A==
X-Received: by 2002:a17:906:6a0d:b0:a86:80ef:4fe5 with SMTP id a640c23a62f3a-a86a54b024dmr1199300566b.47.1724843178647;
        Wed, 28 Aug 2024 04:06:18 -0700 (PDT)
Message-ID: <c508fcdf-d918-40cf-94d5-c56a191e53bc@citrix.com>
Date: Wed, 28 Aug 2024 12:06:16 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/HVM: correct partial HPET_STATUS write emulation
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <da785047-0bee-4d16-a6ae-d1727bd8317a@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <da785047-0bee-4d16-a6ae-d1727bd8317a@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28/08/2024 10:00 am, Jan Beulich wrote:
> For partial writes the non-written parts of registers are folded into
> the full 64-bit value from what they're presently set to. That's wrong
> to do though when the behavior is write-1-to-clear: Writes not
> including to low 3 bits would unconditionally clear all ISR bits which
> are presently set. Re-calculate the value to use.
>
> Fixes: be07023be115 ("x86/vhpet: add support for level triggered interrupts")
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> ---
> Alternatively we could also suppress the folding in of read bits, but
> that looked to me to end up in a more intrusive change.
>
> --- a/xen/arch/x86/hvm/hpet.c
> +++ b/xen/arch/x86/hvm/hpet.c
> @@ -404,7 +404,8 @@ static int cf_check hpet_write(
>          break;
>  
>      case HPET_STATUS:
> -        /* write 1 to clear. */
> +        /* Write 1 to clear. Therefore don't use new_val directly here. */
> +        new_val = val << ((addr & 7) * 8);
>          while ( new_val )
>          {
>              bool active;

It's sad that we allow any sub-word accesses.  The spec makes it pretty
clear that only aligned 32-bit and 64-bit accesses are acceptable, and
it would simplify the merging logic substantially.

Nevertheless, this is the simplest bugfix for now.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 11:07:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 11:07:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784722.1194109 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjGWo-0000Xq-DY; Wed, 28 Aug 2024 11:07:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784722.1194109; Wed, 28 Aug 2024 11:07:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjGWo-0000Xj-9Y; Wed, 28 Aug 2024 11:07:54 +0000
Received: by outflank-mailman (input) for mailman id 784722;
 Wed, 28 Aug 2024 11:07:53 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=933A=P3=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1sjGWn-0000Xd-Kc
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 11:07:53 +0000
Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c43a1cc4-652d-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 13:07:51 +0200 (CEST)
Received: from pb-smtp1.pobox.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id CA0A43DE20;
 Wed, 28 Aug 2024 07:07:50 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id C198A3DE1F;
 Wed, 28 Aug 2024 07:07:50 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [46.211.119.31])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp1.pobox.com (Postfix) with ESMTPSA id D2C9C3DE1D;
 Wed, 28 Aug 2024 07:07:48 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c43a1cc4-652d-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:in-reply-to:references:mime-version
	:content-transfer-encoding; s=sasl; bh=sYeNlXd320jgCemX/nEWnRjUu
	eRsq3RVfPj+4GsXNkw=; b=GcXpl1GP0Lk6uDIt92caFIryZ5FCjwSAmft4YfJeE
	4Lk0Og3vowFZ4qniRf7vM9BHusiFtTeA+k49EYYP1waJVD3L/l+NeK8zQGTk628O
	M1BUXwqA1CKvWzS0w2pV34aFtGnG7ElQ5yuzTk/slRQlvLNxrBT6Kr9SsXBF1kfi
	pY=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Xenia Ragiadakou <burzalodowa@gmail.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Xenia Ragiadakou <xenia.ragiadakou@amd.com>,
	Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Subject: [XEN PATCH v7 2/2] x86/hvm: make AMD-V and Intel VT-x support configurable
Date: Wed, 28 Aug 2024 14:07:45 +0300
Message-Id: <eaa54180fbb8056ba6bcaa9ca3d985c899156354.1724842645.git.Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1724842645.git.Sergiy_Kibrik@epam.com>
References: <cover.1724842645.git.Sergiy_Kibrik@epam.com>
MIME-Version: 1.0
X-Pobox-Relay-ID:
 C2DA7960-652D-11EF-897D-2BAEEB2EC81B-90055647!pb-smtp1.pobox.com
Content-Transfer-Encoding: quoted-printable

From: Xenia Ragiadakou <burzalodowa@gmail.com>

Provide the user with configuration control over the cpu virtualization s=
upport
in Xen by making AMD_SVM and INTEL_VMX options user selectable.

To preserve the current default behavior, both options depend on HVM and
default to value of HVM.

To prevent users from unknowingly disabling virtualization support, make =
the
controls user selectable only if EXPERT is enabled.

No functional change intended.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
changes in v6:
 - "default y" instead of "default HVM"
changes in v5:
- change kconfig option name SVM/VMX -> AMD_SVM/INTEL_VMX
changes in v3:
 - only tags added
---
 xen/arch/x86/Kconfig | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 74e081c7bd..d0aaf359eb 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -123,11 +123,25 @@ config HVM
 	  If unsure, say Y.
=20
 config AMD_SVM
-	def_bool HVM
+	bool "AMD-V" if EXPERT
+	depends on HVM
+	default y
+	help
+	  Enables virtual machine extensions on platforms that implement the
+	  AMD Virtualization Technology (AMD-V).
+	  If your system includes a processor with AMD-V support, say Y.
+	  If in doubt, say Y.
=20
 config INTEL_VMX
-	def_bool HVM
+	bool "Intel VT-x" if EXPERT
+	depends on HVM
+	default y
 	select ARCH_VCPU_IOREQ_COMPLETION
+	help
+	  Enables virtual machine extensions on platforms that implement the
+	  Intel Virtualization Technology (Intel VT-x).
+	  If your system includes a processor with Intel VT-x support, say Y.
+	  If in doubt, say Y.
=20
 config XEN_SHSTK
 	bool "Supervisor Shadow Stacks"
--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 11:31:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 11:31:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784740.1194118 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjGt9-00061n-9l; Wed, 28 Aug 2024 11:30:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784740.1194118; Wed, 28 Aug 2024 11:30:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjGt9-00061g-6z; Wed, 28 Aug 2024 11:30:59 +0000
Received: by outflank-mailman (input) for mailman id 784740;
 Wed, 28 Aug 2024 11:30:57 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ecal=P3=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sjGt7-00061a-H4
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 11:30:57 +0000
Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com
 [2607:f8b0:4864:20::729])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fcdd01b9-6530-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 13:30:55 +0200 (CEST)
Received: by mail-qk1-x729.google.com with SMTP id
 af79cd13be357-7a4df9dc840so387979885a.2
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 04:30:55 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a67f35ba3bsm626925885a.59.2024.08.28.04.30.51
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 04:30:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fcdd01b9-6530-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724844654; x=1725449454; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=NP40Ho4Pmq7WnToYus2s15UIRJ92xUV+gpDp04qChq4=;
        b=AOTNdHnuYGlhcnYzgNN/uvdBzwVoS5TZtMbjVwf3MQPNimdMDhOQeiDMHFUafUN4m2
         WbjMIKlONArqqm12SF5Auk1Wh8V822ti3UpaaLZ+tVgJl0ReK/8xfmqOCwacYCfrWQls
         mcb/ueSCF7bfIqj/9GzDBlVP4HkGxUX6ft48o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724844654; x=1725449454;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=NP40Ho4Pmq7WnToYus2s15UIRJ92xUV+gpDp04qChq4=;
        b=Wu5+FVSNjtQqmmWyj6htrY4j9NTO4wXaZlvrBPFnf1nr/319aUjlHQ5lTXXcHxGpTy
         EPnKVG95TnIN8W5eL/T1ecViJ71q/qZvli0Oj17AHrKMRfG4oA2CJnZJDWBqAoyh9y69
         smE8z+P7+1ZIvrcUdHrAoaB21ZlI+RGWL8ZM34HiNR4LWWCj7pRSYzR+hvTXxNNRWhWt
         ln0sEGLYqQjcdiymHlwTYw5KilMMqwQivKpjqr759QmEiwJ9kldUqCflYDZOF1SVPoU5
         gcbZ99GuMeIoFEzP4948SBt3jDjEbgmTQKRdCzJZpyNgmVzzVDWe+1oJ1o34Gm9nHb2l
         drUw==
X-Gm-Message-State: AOJu0YxswveN6IKCyXyh5XbNHuL96nyDPpGdXnAvW7cEr4va6/aywQ5K
	7JA/DQI+QInjrDFfZvzO+JUH1c/gOS+vXo/lkBnDfWVNZrqdFFEjrmqMhBmwFP6vRVzzM9q57+z
	+
X-Google-Smtp-Source: AGHT+IFKxLbDap4Z7rOnqJ3joVSoQbGTU5gfXH+djtGXTusKrCJtihPvJA714ffvGw6RZz0BhQwtbQ==
X-Received: by 2002:a05:620a:458c:b0:79f:197d:fe92 with SMTP id af79cd13be357-7a6896e4417mr1465527285a.2.1724844653525;
        Wed, 28 Aug 2024 04:30:53 -0700 (PDT)
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v6] x86/dom0: disable SMAP for PV domain building only
Date: Wed, 28 Aug 2024 13:30:44 +0200
Message-ID: <20240828113044.35541-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Move the logic that disables SMAP so it's only performed when building a PV
dom0, PVH dom0 builder doesn't require disabling SMAP.

The fixes tag is to account for the wrong usage of cpu_has_smap in
create_dom0(), it should instead have used
boot_cpu_has(X86_FEATURE_XEN_SMAP).  Fix while moving the logic to apply to PV
only.

While there also make cr4_pv32_mask __ro_after_init.

Fixes: 493ab190e5b1 ('xen/sm{e, a}p: allow disabling sm{e, a}p for Xen itself')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v5:
 - Drop comment and asmlinkage attribute.
 - Introduce a wrapper for dom0_construct_pv() so the usage of cr4_pv32_mask
   can be limited to a PV-specific file.

Changes since v4:
 - New approach, move the current logic so it's only applied when creating a PV
   dom0.
---
 xen/arch/x86/include/asm/setup.h |  2 ++
 xen/arch/x86/pv/dom0_build.c     | 38 +++++++++++++++++++++++++++-----
 xen/arch/x86/setup.c             | 20 +----------------
 3 files changed, 36 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index d75589178b91..8f7dfefb4dcf 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -64,6 +64,8 @@ extern bool opt_dom0_verbose;
 extern bool opt_dom0_cpuid_faulting;
 extern bool opt_dom0_msr_relaxed;
 
+extern unsigned long cr4_pv32_mask;
+
 #define max_init_domid (0)
 
 #endif
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 57e58a02e707..22988f2660b0 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -354,11 +354,11 @@ static struct page_info * __init alloc_chunk(struct domain *d,
     return page;
 }
 
-int __init dom0_construct_pv(struct domain *d,
-                             const module_t *image,
-                             unsigned long image_headroom,
-                             module_t *initrd,
-                             const char *cmdline)
+static int __init dom0_construct(struct domain *d,
+                                 const module_t *image,
+                                 unsigned long image_headroom,
+                                 module_t *initrd,
+                                 const char *cmdline)
 {
     int i, rc, order, machine;
     bool compatible, compat;
@@ -1051,6 +1051,34 @@ out:
     return rc;
 }
 
+int __init dom0_construct_pv(struct domain *d,
+                             const module_t *image,
+                             unsigned long image_headroom,
+                             module_t *initrd,
+                             const char *cmdline)
+{
+    int rc;
+
+    /*
+     * Temporarily clear SMAP in CR4 to allow user-accesses in
+     * construct_dom0().  This saves a large number of corner cases
+     * interactions with copy_from_user().
+     */
+    if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
+    {
+        cr4_pv32_mask &= ~X86_CR4_SMAP;
+        write_cr4(read_cr4() & ~X86_CR4_SMAP);
+    }
+    rc = dom0_construct(d, image, image_headroom, initrd, cmdline);
+    if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
+    {
+        write_cr4(read_cr4() | X86_CR4_SMAP);
+        cr4_pv32_mask |= X86_CR4_SMAP;
+    }
+
+    return rc;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index eee20bb1753c..f1076c72032d 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -79,8 +79,7 @@ bool __read_mostly use_invpcid;
 int8_t __initdata opt_probe_port_aliases = -1;
 boolean_param("probe-port-aliases", opt_probe_port_aliases);
 
-/* Only used in asm code and within this source file */
-unsigned long asmlinkage __read_mostly cr4_pv32_mask;
+unsigned long __ro_after_init cr4_pv32_mask;
 
 /* **** Linux config option: propagated to domain0. */
 /* "acpi=off":    Sisables both ACPI table parsing and interpreter. */
@@ -955,26 +954,9 @@ static struct domain *__init create_dom0(const module_t *image,
         }
     }
 
-    /*
-     * Temporarily clear SMAP in CR4 to allow user-accesses in construct_dom0().
-     * This saves a large number of corner cases interactions with
-     * copy_from_user().
-     */
-    if ( cpu_has_smap )
-    {
-        cr4_pv32_mask &= ~X86_CR4_SMAP;
-        write_cr4(read_cr4() & ~X86_CR4_SMAP);
-    }
-
     if ( construct_dom0(d, image, headroom, initrd, cmdline) != 0 )
         panic("Could not construct domain 0\n");
 
-    if ( cpu_has_smap )
-    {
-        write_cr4(read_cr4() | X86_CR4_SMAP);
-        cr4_pv32_mask |= X86_CR4_SMAP;
-    }
-
     return d;
 }
 
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 11:46:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 11:46:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784749.1194127 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjH88-0000J3-Hg; Wed, 28 Aug 2024 11:46:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784749.1194127; Wed, 28 Aug 2024 11:46:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjH88-0000Iw-Eq; Wed, 28 Aug 2024 11:46:28 +0000
Received: by outflank-mailman (input) for mailman id 784749;
 Wed, 28 Aug 2024 11:46:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NRYu=P3=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjH86-0000Ip-IK
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 11:46:26 +0000
Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com
 [2a00:1450:4864:20::634])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2794f5c0-6533-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 13:46:25 +0200 (CEST)
Received: by mail-ej1-x634.google.com with SMTP id
 a640c23a62f3a-a8696e9bd24so714642766b.0
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 04:46:25 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e54875b8sm235152766b.1.2024.08.28.04.46.24
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 04:46:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2794f5c0-6533-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724845585; x=1725450385; 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=mpdrHGXQc+FtDMvN3QJ8IPXtZ70AgcSCoXmjz/j9ZhA=;
        b=NMW+jdUVPoV37jo6PR9UhTClP9eDFzv35TDcHKUUCyXeFx1PNo3OHwDFa1q++uffcX
         BqjS0I92/kx8/qOpntImS9rq3+IgkNuhj8NfHUXNP92TBqIW2ZLWW3csUdabrwBEeTR2
         jGrKGxKBiU2st7SWkoRPl9f4KlpHCE72hjmTNA+nPxC5WQGOMSuuJCO/FDZ+lIvBmZb1
         6Luw4SMHKLKszopeYE9g4kxLv3Xej1/btPBR6Kz9h4XsYOKOhO56NOaMZRJdJrHb5vV9
         gFrh4Mtf4IlhrEq7gEhR3fQFwZke6cJreDuC6YghS6MS5SOVQ4fRYSF6rywZsPejC6Ke
         Tdgg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724845585; x=1725450385;
        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=mpdrHGXQc+FtDMvN3QJ8IPXtZ70AgcSCoXmjz/j9ZhA=;
        b=W2XJOU1PgOKL7/zYuy6cAbML5/lVzU1c16PxcabzF8sRZMiTYYZ4gQ1xRnPyDL34BH
         Ofqz6D11+D85N1cDHrQaQlmsvup0xGWv77V7SPGiFXXzcs1Awt2bU2SqTY5Nb86Y0Ft1
         JPI1qi4j0BrqWNCHuehg+W2/CGIUSxSEqWypOE6NSmHUTS6iN14AL16+xLeRVgklaJRC
         tmZ899gfPwVuKnpySbnl7vNV4sfARafagekTqmcBhHkM8p29dFmYBIOOGjyPxJpPAeCe
         Kotv7+DGdYI8MEnh1g2t8D8PELAzV09gQVsA22v5WxPxnjST5ZolH91nxkeBsgwjZt6O
         uYZw==
X-Forwarded-Encrypted: i=1; AJvYcCUkuvuOOVEy2eMpNygXT8XqZWLnb1Yylshubs43wYpW+vcG3AjbYZOrd2Uq+xaGTiJq5rujjVQ7feI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzmeC/Yepy3HHhZN83x59z3PQeQw6LzWxtCMtlElqiZAqOPOS6Q
	LY7fvYgF0ONlC9Wb0j7/rO1jaUSK+aa1BcK99Vi1nenqnRmLcwEa02To/CuEog==
X-Google-Smtp-Source: AGHT+IGAMuPmHNROaq8Y/pjAje3JllW0LSLvjRBc1pLXqcnCqzpo4nJRmPVQnOqdlskk48h8Yx7oKw==
X-Received: by 2002:a17:907:1c27:b0:a77:b01b:f949 with SMTP id a640c23a62f3a-a870aa54808mr148528366b.35.1724845584691;
        Wed, 28 Aug 2024 04:46:24 -0700 (PDT)
Message-ID: <dac66b57-fba3-409c-83cb-6b33171f3949@suse.com>
Date: Wed, 28 Aug 2024 13:46:23 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/HVM: correct partial HPET_STATUS write emulation
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <da785047-0bee-4d16-a6ae-d1727bd8317a@suse.com>
 <c508fcdf-d918-40cf-94d5-c56a191e53bc@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <c508fcdf-d918-40cf-94d5-c56a191e53bc@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28.08.2024 13:06, Andrew Cooper wrote:
> On 28/08/2024 10:00 am, Jan Beulich wrote:
>> For partial writes the non-written parts of registers are folded into
>> the full 64-bit value from what they're presently set to. That's wrong
>> to do though when the behavior is write-1-to-clear: Writes not
>> including to low 3 bits would unconditionally clear all ISR bits which
>> are presently set. Re-calculate the value to use.
>>
>> Fixes: be07023be115 ("x86/vhpet: add support for level triggered interrupts")
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> ---
>> Alternatively we could also suppress the folding in of read bits, but
>> that looked to me to end up in a more intrusive change.
>>
>> --- a/xen/arch/x86/hvm/hpet.c
>> +++ b/xen/arch/x86/hvm/hpet.c
>> @@ -404,7 +404,8 @@ static int cf_check hpet_write(
>>          break;
>>  
>>      case HPET_STATUS:
>> -        /* write 1 to clear. */
>> +        /* Write 1 to clear. Therefore don't use new_val directly here. */
>> +        new_val = val << ((addr & 7) * 8);
>>          while ( new_val )
>>          {
>>              bool active;
> 
> It's sad that we allow any sub-word accesses.  The spec makes it pretty
> clear that only aligned 32-bit and 64-bit accesses are acceptable, and
> it would simplify the merging logic substantially.

While that's true, the bug here would still have been there if we limited
emulation to 32- and 64-bit accesses.

> Nevertheless, this is the simplest bugfix for now.
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 11:50:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 11:50:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784755.1194137 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjHBl-0002Rh-VY; Wed, 28 Aug 2024 11:50:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784755.1194137; Wed, 28 Aug 2024 11:50:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjHBl-0002Ra-Sx; Wed, 28 Aug 2024 11:50:13 +0000
Received: by outflank-mailman (input) for mailman id 784755;
 Wed, 28 Aug 2024 11:50: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=NRYu=P3=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjHBk-0002RU-P0
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 11:50:12 +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 ad41b9be-6533-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 13:50:09 +0200 (CEST)
Received: by mail-lj1-x22c.google.com with SMTP id
 38308e7fff4ca-2f4f2868710so65947271fa.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 04:50:09 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1c2f53sm2161402a12.19.2024.08.28.04.50.08
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 04:50:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ad41b9be-6533-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724845809; x=1725450609; 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=/4fXpOsfKB9LG9OCJy5yXlfw7MKLEuNLfonqWdlwlIg=;
        b=Eu/nZp5mCYbu2OrGCWOiZrrR7CWvZiM8CTDIvhDb6grzFqcty/ytOCE1ud/2zfrYwe
         E99lCKnA44SK2rZF16a7EQMDn7RiE1RlqLBihJulisbBsMMPxqTvz7pcu9wxGLVzOS6n
         fvGLsdax/U/ULVhKVtEJtJpPM80uSxXJDwoL2aDQUaYVULMRHVVw2OFzNaS3U6ZSPv1J
         IbhuJPwInoACkP43JXm4jnv2O3vIIwb2yG8YV4LC0U5PJLSI+ge2Rn4Fe5w8hHMxpu3P
         OpCA8w3DLQY4GPMxG8dwduoZTIbL7HBzDo88rxEHBKgyW98sEieupvj41i33oLaBeuMb
         A0Gw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724845809; x=1725450609;
        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=/4fXpOsfKB9LG9OCJy5yXlfw7MKLEuNLfonqWdlwlIg=;
        b=g/Icq6QZHLwUuMkUfunzoT1Ov0xMUlU+lqYSEqg1CY6kNJnaKbd6khPxdDJRQqSi2Q
         gn1x0j7C55otcQRHM1UHadVzQ2pjawtIyCu8rpuEvjCPeI4kKBlxFBgbF7gwhQs+Pahx
         fXzHvaSp+umTA+XcZW3XxAySmEp/KHNg+G/rpo0sjSHOI7HhG5uC0NW1tcqXLy1PDrtI
         ev2yG4umtULNFw0/pLF2QFwQlnIz0fdLNkJgrLiArF1ohiYThSeBx6zqsmyaxDmmir4g
         m8gU/uBhPh7ldNR44Bs7+1EVAQ72F/0C6s6rOohLpyM0je/IZBqIaKFRjhwFJu1uFeXv
         fguQ==
X-Forwarded-Encrypted: i=1; AJvYcCXZ921VN45WsGn9804F1uEcn4KnHwI59cH9JkiiWx6t4SkKWPJ5A0KJCoXKESmuehDdsmtPweZ32KY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxvPh57Z2y4hxvM7cXIRiM/jUGBe1JResvJZ3zPbEFhYc5N6Vq7
	rg4euhrLXKZbbw0da5MVayGOOORQbwEtEQFxfI0smG9lhJD2USvtErNhHb9CGA==
X-Google-Smtp-Source: AGHT+IEkBWAHoLhOTd+Bp8LPszz/63ay02Pb8F//4nz0ZrWzdI0GvDeBVuEEu/Cr5GW4ZgP61WVCMw==
X-Received: by 2002:a2e:8812:0:b0:2f1:929b:aef6 with SMTP id 38308e7fff4ca-2f4f493f3a5mr99757811fa.36.1724845808959;
        Wed, 28 Aug 2024 04:50:08 -0700 (PDT)
Message-ID: <50658093-8463-4ee3-b308-31be2dd1fd42@suse.com>
Date: Wed, 28 Aug 2024 13:50:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6] x86/dom0: disable SMAP for PV domain building only
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xenproject.org
References: <20240828113044.35541-1-roger.pau@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240828113044.35541-1-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28.08.2024 13:30, Roger Pau Monne wrote:
> Move the logic that disables SMAP so it's only performed when building a PV
> dom0, PVH dom0 builder doesn't require disabling SMAP.
> 
> The fixes tag is to account for the wrong usage of cpu_has_smap in
> create_dom0(), it should instead have used
> boot_cpu_has(X86_FEATURE_XEN_SMAP).  Fix while moving the logic to apply to PV
> only.
> 
> While there also make cr4_pv32_mask __ro_after_init.
> 
> Fixes: 493ab190e5b1 ('xen/sm{e, a}p: allow disabling sm{e, a}p for Xen itself')
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
preferably with ...

> @@ -1051,6 +1051,34 @@ out:
>      return rc;
>  }
>  
> +int __init dom0_construct_pv(struct domain *d,
> +                             const module_t *image,
> +                             unsigned long image_headroom,
> +                             module_t *initrd,
> +                             const char *cmdline)
> +{
> +    int rc;
> +
> +    /*
> +     * Temporarily clear SMAP in CR4 to allow user-accesses in
> +     * construct_dom0().  This saves a large number of corner cases

... the final 's' dropped here and ...

> +     * interactions with copy_from_user().
> +     */
> +    if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> +    {
> +        cr4_pv32_mask &= ~X86_CR4_SMAP;
> +        write_cr4(read_cr4() & ~X86_CR4_SMAP);
> +    }
> +    rc = dom0_construct(d, image, image_headroom, initrd, cmdline);
> +    if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )

... blank lines added around the function call. Happy to adjust while
committing, so long as you agree.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 11:51:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 11:51:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784760.1194148 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjHD0-0002y7-AM; Wed, 28 Aug 2024 11:51:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784760.1194148; Wed, 28 Aug 2024 11:51:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjHD0-0002y0-7L; Wed, 28 Aug 2024 11:51:30 +0000
Received: by outflank-mailman (input) for mailman id 784760;
 Wed, 28 Aug 2024 11:51:29 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjHCy-0002xs-UK
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 11:51:28 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id db241cbd-6533-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 13:51:26 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a8684c31c60so796058666b.3
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 04:51:26 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e582d496sm235798766b.112.2024.08.28.04.51.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 04:51:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: db241cbd-6533-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724845886; x=1725450686; 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=YVonPyzXYY2JGbCkvrDq1/ZLFtUKj0/ExqdDot0/Pbk=;
        b=E/irsQde1B9GXpvTXDJiiv6/olIZ3z56nPCdNDVkGwTr0a0DNMPnHpdseRwwdE9VDO
         yihkaym7KuWYgQkuf+RzA5IJXJAfpLxMIm+F7NYAFVCn4HezST5pap2aWCo5A6NHkRjO
         NVvjtIl99VPvK/9nn20oIe/Z/ziTRDltGN0ks=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724845886; x=1725450686;
        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=YVonPyzXYY2JGbCkvrDq1/ZLFtUKj0/ExqdDot0/Pbk=;
        b=PPQYg+H52zdse1Ivj0btYf2f7ZTbN2Y2+p9Bw+mipMPlYDe0gB7t07zD55rciKgKbP
         l4zBGziOt5YeVmBNXZ47lOLbBeBbK9HdRAgk1Lz3idLe6ikUuEjsV7HMOe9zBm8VVMHW
         1aTlQj/vDJKybOuTjJ3xbrj2LlsHZrMHdbvQEauuBhtOAdDr7+0J4vBdcfzckJ6859fF
         l9exDasPgOZ3KYpkLRcWc6gG2SRHtI7oBQNdUYYxHbJIMuXb6QwZmGQXkAOttocgmO24
         /8FjzwAfhAS2R8fIuPMtfqQREO24q1jNzkJBkj62kv0xAO6lTz1w0bjs3wrCw9/a0ci0
         MAuA==
X-Gm-Message-State: AOJu0YzDLmxUeBoCwqEXTvx4Xqt7DIoRb7ukN18+7NLD6WxaxE/qvC/i
	vlqazGm8rEbV1v+vAAaVcFf2/9y/+7+Pb/X4t7Xdbex6kSVxpsApJSuHHYwjhgVAbkRbPvcG4jT
	8
X-Google-Smtp-Source: AGHT+IE+ugCFsBDBm5lhEPhKz0TQhq202WjceTsu6m6/meNzD20Ptd5eR4KQX5jOZVV6p1r+mG6QGg==
X-Received: by 2002:a17:907:7d9f:b0:a86:8b7b:7880 with SMTP id a640c23a62f3a-a86a54bf55emr1178583166b.63.1724845885907;
        Wed, 28 Aug 2024 04:51:25 -0700 (PDT)
Message-ID: <bd206c4d-8e1d-488c-b428-3f6402a9ae4f@citrix.com>
Date: Wed, 28 Aug 2024 12:51:23 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6] x86/dom0: disable SMAP for PV domain building only
To: Jan Beulich <jbeulich@suse.com>, Roger Pau Monne <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org
References: <20240828113044.35541-1-roger.pau@citrix.com>
 <50658093-8463-4ee3-b308-31be2dd1fd42@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <50658093-8463-4ee3-b308-31be2dd1fd42@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28/08/2024 12:50 pm, Jan Beulich wrote:
> On 28.08.2024 13:30, Roger Pau Monne wrote:
>> Move the logic that disables SMAP so it's only performed when building a PV
>> dom0, PVH dom0 builder doesn't require disabling SMAP.
>>
>> The fixes tag is to account for the wrong usage of cpu_has_smap in
>> create_dom0(), it should instead have used
>> boot_cpu_has(X86_FEATURE_XEN_SMAP).  Fix while moving the logic to apply to PV
>> only.
>>
>> While there also make cr4_pv32_mask __ro_after_init.
>>
>> Fixes: 493ab190e5b1 ('xen/sm{e, a}p: allow disabling sm{e, a}p for Xen itself')
>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> preferably with ...
>
>> @@ -1051,6 +1051,34 @@ out:
>>      return rc;
>>  }
>>  
>> +int __init dom0_construct_pv(struct domain *d,
>> +                             const module_t *image,
>> +                             unsigned long image_headroom,
>> +                             module_t *initrd,
>> +                             const char *cmdline)
>> +{
>> +    int rc;
>> +
>> +    /*
>> +     * Temporarily clear SMAP in CR4 to allow user-accesses in
>> +     * construct_dom0().  This saves a large number of corner cases
> ... the final 's' dropped here and ...
>
>> +     * interactions with copy_from_user().
>> +     */
>> +    if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
>> +    {
>> +        cr4_pv32_mask &= ~X86_CR4_SMAP;
>> +        write_cr4(read_cr4() & ~X86_CR4_SMAP);
>> +    }
>> +    rc = dom0_construct(d, image, image_headroom, initrd, cmdline);
>> +    if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> ... blank lines added around the function call. Happy to adjust while
> committing, so long as you agree.

+1 to both suggestions.

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 11:55:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 11:55:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784768.1194158 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjHGo-0003cD-U8; Wed, 28 Aug 2024 11:55:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784768.1194158; Wed, 28 Aug 2024 11:55:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjHGo-0003c6-RQ; Wed, 28 Aug 2024 11:55:26 +0000
Received: by outflank-mailman (input) for mailman id 784768;
 Wed, 28 Aug 2024 11:55:25 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NRYu=P3=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjHGn-0003c0-Dm
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 11:55:25 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 68d4724b-6534-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 13:55:24 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a86e5e9ff05so238689666b.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 04:55:24 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e5878f79sm238983066b.179.2024.08.28.04.55.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 04:55:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 68d4724b-6534-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724846124; x=1725450924; 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=r6OLnEM0rsfbWkV6p9DNaXY2VSEmm6g3roxaIJuas68=;
        b=EnKLjTnKLwZDddi3OY9sYYY9lmnwwFXCL6fLOKeM61sb4rpTzMJc4F+YgZUHPzODbV
         iJRipicfsOphX+j6AxApsp8YedRFzbFoem3l4PzUZq7OABvlyW/jxUq13OVezlq8uXqz
         OEWEer+hdTJKPU65KQr+OCIV1+tyl3yqRw+YbpYwbtzD/zPq+rpET1uf3CqJkY96yemo
         GnRXAUyipEI9I91hslHd6l0ahEERlQwC6jYHdVRIvDfXwgWtsj1sqN/wl04MF2W347Sy
         yZL17bubXPEMDZmCZTcvU4qu1TTm1V/JKCgh1ry5KMFlWIDCZ39hOPt6cnu4NPQL8uC3
         TAeA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724846124; x=1725450924;
        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=r6OLnEM0rsfbWkV6p9DNaXY2VSEmm6g3roxaIJuas68=;
        b=YPeqN3D17oOMBso6oDHEv7Xbkxi1uBvNXMvfjNiGgwQlFRrIZAKNZPaeogJd+u8NWZ
         ZQ+7ms2Sw3qrA85MNx9qMXUrpLSpTTcUZPElO/ccxoVUlRwvdyFXnQ0q2lviGS75Ii/a
         zTBug1Ev6TBF2PbFl15blT5nvrOUIuUrWU9FW6X00oHBy9rtwC2cdgm5RfvBhP58cYMk
         nV8Jzq2vy7RINofcp5SXnLt/qqLcAFIM3RSAm/9hLPRLP75nsvj1MajuAvy94eyJApsz
         wbQjp13BVUhGloFn+wlfuvyMnbdcvDWEUlChevz6VejKH6SMT5k+jQ01yFVVeFv77mKP
         fPkw==
X-Forwarded-Encrypted: i=1; AJvYcCUQaYWP0bRUajjCCyOKKKLK7qHW14Igsv9CXxNO8j0PTl9QCiHrstaQApiIEwMme8RKSL17rBeh9yc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyxDuQx8oxb8MKriHPvWBL10n2yMkemYiK0Fc3sp+utizlQXgun
	pYfFyGQxxCScxJnGcSdv3PYViZ6cP7Ka0UbR1EYIRKYJYR+Kz09hj9oawEcdlw==
X-Google-Smtp-Source: AGHT+IGPYAVosAPed4eYLuKng5Tdy0tlpWaOpRwJIKgb2CxSjBhy9X2rfy5pfl2hK3Ryf4Qb8F5kCw==
X-Received: by 2002:a17:907:7d9e:b0:a86:8d9d:898a with SMTP id a640c23a62f3a-a870ab15453mr139295966b.58.1724846123645;
        Wed, 28 Aug 2024 04:55:23 -0700 (PDT)
Message-ID: <711d89a3-b1df-49d3-bd05-ebb0f4824f49@suse.com>
Date: Wed, 28 Aug 2024 13:55:21 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 4/7] xen/riscv: introduce functionality to work with
 CPU info
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
 <03a703996ae7300a9eda54283711b19c42a7d116.1724256027.git.oleksii.kurochko@gmail.com>
 <8f01fffa-ff7e-4a08-b707-7bf5175b461e@suse.com>
 <d5c6b74609d18a18ef789e795d6ce72469bff277.camel@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: <d5c6b74609d18a18ef789e795d6ce72469bff277.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28.08.2024 12:56, oleksii.kurochko@gmail.com wrote:
> On Tue, 2024-08-27 at 15:44 +0200, Jan Beulich wrote:
>> On 21.08.2024 18:06, Oleksii Kurochko wrote:
>>> --- a/xen/arch/riscv/include/asm/smp.h
>>> +++ b/xen/arch/riscv/include/asm/smp.h
>>> @@ -5,6 +5,10 @@
>>>  #include <xen/cpumask.h>
>>>  #include <xen/percpu.h>
>>>  
>>> +#include <asm/processor.h>
>>> +
>>> +#define INVALID_HARTID ULONG_MAX
>>
>> So what if the firmware report this value for one of the harts?
> It could be an issue, but in my opinion, there is a small chance that
> the firmware will use such a high number. I can add a BUG_ON() in
> start_xen() to check that bootcpu_id is not equal to INVALID_HARTID to
> ensure that the firmware does not report this value. Otherwise, we
> would need to add a 'bool valid;' to struct pcpu_info and use it
> instead of INVALID_HARTID.

Which route to go largely depends on expectations to actual hardware
we're intending Xen to be usable on.

>>> --- a/xen/arch/riscv/setup.c
>>> +++ b/xen/arch/riscv/setup.c
>>> @@ -8,6 +8,7 @@
>>>  #include <public/version.h>
>>>  
>>>  #include <asm/early_printk.h>
>>> +#include <asm/smp.h>
>>>  #include <asm/traps.h>
>>>  
>>>  void arch_get_xen_caps(xen_capabilities_info_t *info)
>>> @@ -40,6 +41,10 @@ void __init noreturn start_xen(unsigned long
>>> bootcpu_id,
>>>  {
>>>      remove_identity_mapping();
>>>  
>>> +    set_processor_id(0);
>>
>> This isn't really needed, is it? The pcpu_info[] initializer already
>> installs the necessary 0. Another thing would be if the initializer
>> set the field to, say, NR_CPUS.

As suggested here, ...

>>> --- /dev/null
>>> +++ b/xen/arch/riscv/smp.c
>>> @@ -0,0 +1,21 @@
>>> +#include <xen/smp.h>
>>> +
>>> +/*
>>> + * FIXME: make pcpu_info[] dynamically allocated when necessary
>>> + *        functionality will be ready
>>> + */
>>> +/* tp points to one of these per cpu */
>>> +struct pcpu_info pcpu_info[NR_CPUS] = { { 0, INVALID_HARTID } };
>>
>> As to the initializer - what about CPUs other than CPU0? Would they
>> better all have hart_id set to invalid?
> I thought about that, but I decided that if we have INVALID_HARTID as
> hart_id and the hart_id is checked in the appropriate places, then it
> doesn't really matter what the processor_id member of struct pcpu_info
> is. For clarity, it might be better to set it to an invalid value, but
> it doesn't clear which value we should choose as invalid. I assume that
> NR_CPUS is a good candidate for that?

... yes. With that you'd also avoid the need for a "valid" flag: An
entry's hart ID would be valid (no matter which value) if its
processor_id field is valid (less than NR_CPUS).

>> Also, as a pretty strong suggestion to avoid excessive churn going
>> forward: Please consider using dedicated initializers here. IOW
>> perhaps
>>
>> struct pcpu_info pcpu_info[NR_CPUS] = { [0 ... NR_CPUS - 1] = {
>>     .hart_id = INVALID_HARTID,
>> }};
>>
>> Yet as said earlier - in addition you likely want to make sure no
>> two CPUs have (part of) their struct instance in the same cache line.
>> That won't matter right now, as you have no fields you alter at
>> runtime, but I expect such fields will appear.
> Is my understanding correct that adding __cacheline_aligned will be
> sufficient:
>    struct pcpu_info {
>    ...
>    } __cacheline_aligned;

Yes, that's what we do elsewhere.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 12:36:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 12:36:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784781.1194169 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjHuL-0003Xc-3N; Wed, 28 Aug 2024 12:36:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784781.1194169; Wed, 28 Aug 2024 12: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 <xen-devel-bounces@lists.xenproject.org>)
	id 1sjHuK-0003XV-VQ; Wed, 28 Aug 2024 12:36:16 +0000
Received: by outflank-mailman (input) for mailman id 784781;
 Wed, 28 Aug 2024 12:36:15 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjHuJ-0003XL-BH; Wed, 28 Aug 2024 12:36:15 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjHuJ-0008Fg-3U; Wed, 28 Aug 2024 12:36:15 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjHuI-00046g-FR; Wed, 28 Aug 2024 12:36:14 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjHuI-0004PD-Ex; Wed, 28 Aug 2024 12:36:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=31iuE+xAgs/UAYmLoEyWWKgaNeBh85vxbpiQ+pwcXMI=; b=baM14zG5aBkWDioJ+eTHXCnwkw
	XhfW7QxF8n/7NRLZVNHc6K6hrvAokRnjRd9t6M4Mst8Z8s9GRoyTMN5jCVqANNQ/wrww1bqmxisbb
	a9vtEULQbYu5msm2h1canxPJx+ONjuLHKPFrcSHh9LAUtJF/lbP5JWb/1FbjLpgTa2eo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187380-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187380: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=90d0ec17e7074905de347ccf2accdd6b8e8ee968
X-Osstest-Versions-That:
    ovmf=99e4c8ea93fa0e98bc1bdb968e9d5bb42ff5d39c
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 12:36:14 +0000

flight 187380 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187380/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 90d0ec17e7074905de347ccf2accdd6b8e8ee968
baseline version:
 ovmf                 99e4c8ea93fa0e98bc1bdb968e9d5bb42ff5d39c

Last test of basis   187378  2024-08-28 07:13:32 Z    0 days
Testing same since   187380  2024-08-28 10:11:30 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Nhi Pham <nhi@os.amperecomputing.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   99e4c8ea93..90d0ec17e7  90d0ec17e7074905de347ccf2accdd6b8e8ee968 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 12:52:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 12:52:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784792.1194177 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjIA3-0007O2-Ci; Wed, 28 Aug 2024 12:52:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784792.1194177; Wed, 28 Aug 2024 12:52:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjIA3-0007Nv-A7; Wed, 28 Aug 2024 12:52:31 +0000
Received: by outflank-mailman (input) for mailman id 784792;
 Wed, 28 Aug 2024 12:52:30 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=BXJm=P3=gmail.com=aha310510@srs-se1.protection.inumbo.net>)
 id 1sjIA2-0007Nn-7F
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 12:52:30 +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 603c38f3-653c-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 14:52:26 +0200 (CEST)
Received: by mail-pl1-x62c.google.com with SMTP id
 d9443c01a7336-201e64607a5so47884815ad.2
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 05:52:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 603c38f3-653c-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724849545; x=1725454345; 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=g2hMAGnvoRO6n2Q7lnRfLg+Icwjjl00HQPQLTynWNlU=;
        b=ROyUwlVsLjyo/ixqu6Cym15+R8QDrZL8tS+8Gc3LdVdHMJNVNofiXbQfbpd+l1w4bo
         yy4LKNLsseIiLpjENQkErCqqveN+TyGfnUI1P0a7PjMAuQhj2hikXvDEkUv/kCTsp7rB
         WZo+6EPzbRVjG/etF0t/R4/JK3MFdx/vj7XRrFnF+UEklO08RXmRQY1jDFNuUD4JmmjU
         gdp3tlf1drml3QNt7LSEwmDeR7rXVyh9QNlfnUY+Nm4TCYbMz4beN8bbzPc1QxSaxrPS
         A9uNec3R9C4yPCQOAW2xuP5ezThvgJQX9aX80KI31Gan3gujWhrtDGqIf1oPp3gjH9Tc
         K7ug==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724849545; x=1725454345;
        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=g2hMAGnvoRO6n2Q7lnRfLg+Icwjjl00HQPQLTynWNlU=;
        b=duWoBO8e22EojgFkdHG6QwifWibq51vNzSIu0QUQzg7Qj856AQ+O1k7Pds4Asj3d2a
         GojkSknA3BU6BBXYQbx5A+qCW4Jb+0q5kSMf0EIyV86+TcHodnDHEb0Co23fkqT+Yzs0
         EkpsESFClWGVxrMXrGGXUTbeAWJ6/4BR0Vmj00oN4Da3m9V8WhxJv0yjPEacQ9aACBtW
         zWL+WsSC8Z1N9uIdEND0CfpP8wFc0JwCNfbNjZ1evofZJ91YEejYfzhJbc6A6obtdB1O
         LCcd4s7Uy1NsMqVDNJYvUOwgPnBkNjngW1GakcpDdyjV1SylRDdIOsZzvr1NGl+TRWXv
         nVCA==
X-Forwarded-Encrypted: i=1; AJvYcCUqE+l9QMt+QSuyRrS6CcuHq7/GDeZiT3OGzGQs+YhUSR9Sqy1iiOXyy/iKcwE/JN0haJ8BpC6EmwY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxcgjI7DbsjzVO9fv85blH3nVZ6uJKALA4wlQP/XanMS3lwOIvc
	C8Okp/rGqwBwG8TLHvqezUmSER4tOTlURnJsjvHrIGEsCpkXrNB2GL5HvCYQW3/jmDwMKs+dzxm
	o7zwxjemqSlN7LnYaURI9+4jn7gc=
X-Google-Smtp-Source: AGHT+IGK2UffMTh2JEs6OvO7g3s2HyjTdn804wzwOm6obRBkMq9RSUKF79nQzyur3eL7iSr3cVLPMRQrpw3b+WCyRiI=
X-Received: by 2002:a17:90b:1116:b0:2d4:6ef:cb0c with SMTP id
 98e67ed59e1d1-2d646d6fb51mr15192481a91.43.1724849545019; Wed, 28 Aug 2024
 05:52:25 -0700 (PDT)
MIME-Version: 1.0
References: <20240822181109.2577354-1-aha310510@gmail.com> <fd2a06d5-370f-4e07-af84-cab089b82a4b@redhat.com>
In-Reply-To: <fd2a06d5-370f-4e07-af84-cab089b82a4b@redhat.com>
From: Jeongjun Park <aha310510@gmail.com>
Date: Wed, 28 Aug 2024 21:52:12 +0900
Message-ID: <CAO9qdTGHJw-SUFH9D16N5wSn4KmaMUcX+GVFuEFu+jqMb3HU1g@mail.gmail.com>
Subject: Re: [PATCH net] net/xen-netback: prevent UAF in xenvif_flush_hash()
To: Paolo Abeni <pabeni@redhat.com>
Cc: wei.liu@kernel.org, paul@xen.org, davem@davemloft.net, edumazet@google.com, 
	kuba@kernel.org, madhuparnabhowmik04@gmail.com, 
	xen-devel@lists.xenproject.org, netdev@vger.kernel.org, 
	linux-kernel@vger.kernel.org
Content-Type: text/plain; charset="UTF-8"

On Tue, 27 Aug 2024 13:19:59 +0200 Paolo Abeni wrote:
> On 8/22/24 20:11, Jeongjun Park wrote:
> > During the list_for_each_entry_rcu iteration call of xenvif_flush_hash,
> > kfree_rcu does not exist inside the rcu read critical section, so if
>
> The above wording is confusing, do you mean "kfree_rcu does not exit
> from "...?
>
> > kfree_rcu is called when the rcu grace period ends during the iteration,
> > UAF occurs when accessing head->next after the entry becomes free.
>
> The loop runs with irq disabled, the RCU critical section extends over
> it, uninterrupted.

Basically, list_for_each_entry_rcu is specified to be used under the protection
of rcu_read_lock(), but this is not the case with xenvif_new_hash(). If it is
used without the protection of rcu_read_lock(), kfree is called immediately
after the grace period ends after the call to kfree_rcu() inside
list_for_each_entry_rcu, so the entry is released, and a UAF occurs when
fetching with ->next thereafter.

Regards,
Jeongjun Park


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 13:03:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 13:03:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784797.1194188 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjIKG-0001D3-9w; Wed, 28 Aug 2024 13:03:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784797.1194188; Wed, 28 Aug 2024 13:03:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjIKG-0001Cw-7J; Wed, 28 Aug 2024 13:03:04 +0000
Received: by outflank-mailman (input) for mailman id 784797;
 Wed, 28 Aug 2024 13:03: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=ecal=P3=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sjIKF-0001Cq-IH
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 13:03:03 +0000
Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com
 [2607:f8b0:4864:20::f2c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id db1d9ae8-653d-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 15:03:02 +0200 (CEST)
Received: by mail-qv1-xf2c.google.com with SMTP id
 6a1803df08f44-6bf7a2035d9so5365336d6.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 06:03:02 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6c162d1d25bsm65315876d6.3.2024.08.28.06.02.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 06:03:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: db1d9ae8-653d-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724850181; x=1725454981; darn=lists.xenproject.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=tRcdpoX5CUpqmqbn355dj5OGtL+pHqOUjSPJWnpeuv0=;
        b=n4pNjXb/EmWiujxKwBS3sIJ3yQCnqyw1KBrXUPoGCWdpb2/jyiMMs03UM2unk7fpi4
         iTug2uBaV+lwLX6tHiv7mR5tESHSK4X+xcI6rEF6Gg1HAiPlYsbYviIUhDW/UjO0cSgZ
         cJsK387kC/i2/fAgVGJsX+qZEDDdoRkmtIEqo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724850181; x=1725454981;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=tRcdpoX5CUpqmqbn355dj5OGtL+pHqOUjSPJWnpeuv0=;
        b=Lcs7pLsNq8gCrF6jGLqWGwx036rlxSGAbyQgdklA/DbNeLB9SgIGxXmr7gvoet+mDJ
         agoGOoOCBMzZ6Hkkc6wgsC9GVjzLyNVb64z8AZPV/oRcwp9bVkTbSFbE//k07uJA1t9l
         HkzCm4aPDIojAsiok0wqNS9vMmzhAPKC2O7NHshm6DrXj07/wHzHnIEfD2p3zqXqjAK1
         NIXxoCAgfz18N6qqV1DnCdwXyMCi+Mdr4JDOpywm2H5zUGK1roI1qxWUr6kJIfeMy/ff
         JIz0KhTKR3KD3pG686FmPyAvj4lAj+HPILDOoYlal+Rw6asITm3W5yDxWVdCaPF2Sa2q
         VPSg==
X-Forwarded-Encrypted: i=1; AJvYcCVuuHbM7h7uJVA7yeFgGFuFRS8UwPJ9fMs5XuVrQMn2itd4a4iXmUASl4FmCrf+mhc3kbG3ZGBFvJk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyM6hT3cd3Cee/ehBWiswhJewfkk2SaEQkr43JIgUtH82cBdK1Q
	is3zUH1gaAZsCQdAEsHUulLnyEwGXPIJlgG1lo8PcmfFuZIeHk3pQaZN7/uGzE5Rk1eWY0FTjlA
	L
X-Google-Smtp-Source: AGHT+IE++OUJx5ej4DQZImKabBRDSee5543G4gwOjQxw4Eld3DGV4OiP7suzVhXAuA9fZHJIc+6ymA==
X-Received: by 2002:a05:6214:4a8b:b0:6c3:355e:12b3 with SMTP id 6a1803df08f44-6c335d7c352mr40441506d6.23.1724850180671;
        Wed, 28 Aug 2024 06:03:00 -0700 (PDT)
Date: Wed, 28 Aug 2024 15:02:58 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v6] x86/dom0: disable SMAP for PV domain building only
Message-ID: <Zs8gAuc5qoVsVkQe@macbook.local>
References: <20240828113044.35541-1-roger.pau@citrix.com>
 <50658093-8463-4ee3-b308-31be2dd1fd42@suse.com>
 <bd206c4d-8e1d-488c-b428-3f6402a9ae4f@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <bd206c4d-8e1d-488c-b428-3f6402a9ae4f@citrix.com>

On Wed, Aug 28, 2024 at 12:51:23PM +0100, Andrew Cooper wrote:
> On 28/08/2024 12:50 pm, Jan Beulich wrote:
> > On 28.08.2024 13:30, Roger Pau Monne wrote:
> >> Move the logic that disables SMAP so it's only performed when building a PV
> >> dom0, PVH dom0 builder doesn't require disabling SMAP.
> >>
> >> The fixes tag is to account for the wrong usage of cpu_has_smap in
> >> create_dom0(), it should instead have used
> >> boot_cpu_has(X86_FEATURE_XEN_SMAP).  Fix while moving the logic to apply to PV
> >> only.
> >>
> >> While there also make cr4_pv32_mask __ro_after_init.
> >>
> >> Fixes: 493ab190e5b1 ('xen/sm{e, a}p: allow disabling sm{e, a}p for Xen itself')
> >> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > Reviewed-by: Jan Beulich <jbeulich@suse.com>
> > preferably with ...
> >
> >> @@ -1051,6 +1051,34 @@ out:
> >>      return rc;
> >>  }
> >>  
> >> +int __init dom0_construct_pv(struct domain *d,
> >> +                             const module_t *image,
> >> +                             unsigned long image_headroom,
> >> +                             module_t *initrd,
> >> +                             const char *cmdline)
> >> +{
> >> +    int rc;
> >> +
> >> +    /*
> >> +     * Temporarily clear SMAP in CR4 to allow user-accesses in
> >> +     * construct_dom0().  This saves a large number of corner cases
> > ... the final 's' dropped here and ...
> >
> >> +     * interactions with copy_from_user().
> >> +     */
> >> +    if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> >> +    {
> >> +        cr4_pv32_mask &= ~X86_CR4_SMAP;
> >> +        write_cr4(read_cr4() & ~X86_CR4_SMAP);
> >> +    }
> >> +    rc = dom0_construct(d, image, image_headroom, initrd, cmdline);
> >> +    if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
> > ... blank lines added around the function call. Happy to adjust while
> > committing, so long as you agree.
> 
> +1 to both suggestions.

Sure, please adjust at commit.

> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks (to both).


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 13:11:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 13:11:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784807.1194197 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjIS6-0003RO-1v; Wed, 28 Aug 2024 13:11:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784807.1194197; Wed, 28 Aug 2024 13:11:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjIS5-0003RH-Vg; Wed, 28 Aug 2024 13:11:09 +0000
Received: by outflank-mailman (input) for mailman id 784807;
 Wed, 28 Aug 2024 13:11:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3BgB=P3=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sjIS4-0003RB-88
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 13:11:08 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id fc7d7e20-653e-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 15:11:07 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-53351642021so7965822e87.3
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 06:11:07 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5334ea593bbsm2160977e87.153.2024.08.28.06.11.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 06:11:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fc7d7e20-653e-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724850666; x=1725455466; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=vEcRmzid6xh4HaD2KoafCbYmt/x62C/EM5iejs8ZlP0=;
        b=Whit56wF2QCi++GrLl6Ggpg7B8DnRJW5ECIZmKpDW9F1I13pv08nAgSaikg/HQ/rnH
         4UTYIY8A3BlMg23pDK8FvQv4rG0GzG7qYg9s8/Yq2AGQpAeoh36/mwP9I+TVi4ToaiPa
         FYEEEJxGUoxRqOpbupTOkUPzj5oJ7J3385DU+BkT+IUKJ4YtGq1i8tnJBr9aep7BmQn6
         PqxaxxkldM30xz02DY/VdwNEbs//SGABfG2pKhKMTRQf+QWd9ku1Vu1jm1Nr7Vz9wzYb
         5pctLvwsnwnOPwp3XGdUkTlrz/mN42EDQDYZtknxqdzfjdhxH/g0WXXcedYeEKLjJjn4
         Ezng==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724850666; x=1725455466;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=vEcRmzid6xh4HaD2KoafCbYmt/x62C/EM5iejs8ZlP0=;
        b=QEPTA5AACm44adTkxDx/QejFW5/RjeBuOUcJJog+i0jlP+oBzsEKIO9PASMpLEZWTb
         uaRwWs+sj/xAPDOcA8ubm5FGFyR+0QQ+bnpOlxt1DP8qOPES0+504DkG7e1F8mSCMeA+
         Q2ZvVkOLXmO9wJocmIulRiTB6S3C9Z2iddP2RM5B3ORmQpukI0vJ1Bjmu594AfbdwK+h
         6jL1E7v/FRWRQ0wz0BbtV+KNCcf+sziz9/8bwciuBwglhnqmqqJIkfGI+4BE/+Gx90lQ
         TWvCaZ5shn4J0VrTr8raGx3g/x61/hSyzBJ/yQMd5bzvxm5MqgSvT2SyUrcx1RldsHdC
         uLbw==
X-Forwarded-Encrypted: i=1; AJvYcCWdCCM79xfLXP4GjW2xjKM64gopU4XdA2DNp0HqNdAfHhXAY+6TtmsgETzz4DMkjzLFi2m5yxsQXjM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwAsj0XS8/zIhoGEr+dxkHNfrF/lojMVFOal9gmTdr8HpC47njE
	Gki6pscRzgOuON93ScgXzAPSBxg7Z/Lp0fIWfGgkr5NxYAMn7SO5
X-Google-Smtp-Source: AGHT+IEJIDDXNrUKjwLoibKEsuHFlnepJSu5gSVBr828WUIf+Kogzs7AA3BSMqDISl/1YINoHEJBQQ==
X-Received: by 2002:a05:6512:1196:b0:52f:eb:aaca with SMTP id 2adb3069b0e04-5343878594fmr10199426e87.32.1724850665874;
        Wed, 28 Aug 2024 06:11:05 -0700 (PDT)
Message-ID: <d3fb6472f995646d9e998c847bfb2b9dc1488caa.camel@gmail.com>
Subject: Re: [PATCH v5 5/7] xen/riscv: introduce and initialize SBI RFENCE
 extension
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Wed, 28 Aug 2024 15:11:04 +0200
In-Reply-To: <10789eb4-ed96-48ab-860b-ec6f2d0e6341@suse.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
	 <69da9fc18b9987285e4037ef08714e8f9faa66a7.1724256027.git.oleksii.kurochko@gmail.com>
	 <10789eb4-ed96-48ab-860b-ec6f2d0e6341@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: base64
User-Agent: Evolution 3.52.4 (3.52.4-1.fc40app2) 
MIME-Version: 1.0

T24gVHVlLCAyMDI0LTA4LTI3IGF0IDE2OjE5ICswMjAwLCBKYW4gQmV1bGljaCB3cm90ZToKPiBP
biAyMS4wOC4yMDI0IDE4OjA2LCBPbGVrc2lpIEt1cm9jaGtvIHdyb3RlOgo+ID4gLS0tIGEveGVu
L2FyY2gvcmlzY3YvaW5jbHVkZS9hc20vc2JpLmgKPiA+ICsrKyBiL3hlbi9hcmNoL3Jpc2N2L2lu
Y2x1ZGUvYXNtL3NiaS5oCj4gPiBAQCAtMzEsNCArNjQsMzQgQEAgc3RydWN0IHNiaXJldCBzYmlf
ZWNhbGwodW5zaWduZWQgbG9uZyBleHQsCj4gPiB1bnNpZ25lZCBsb25nIGZpZCwKPiA+IMKgICov
Cj4gPiDCoHZvaWQgc2JpX2NvbnNvbGVfcHV0Y2hhcihpbnQgY2gpOwo+ID4gwqAKPiA+ICsvKgo+
ID4gKyAqIENoZWNrIHVuZGVybHlpbmcgU0JJIGltcGxlbWVudGF0aW9uIGhhcyBSRkVOQ0UKPiA+
ICsgKgo+ID4gKyAqIEByZXR1cm4gdHJ1ZSBmb3Igc3VwcG9ydGVkIEFORCBmYWxzZSBmb3Igbm90
LXN1cHBvcnRlZAo+ID4gKyAqLwo+ID4gK2Jvb2wgc2JpX2hhc19yZmVuY2Uodm9pZCk7Cj4gPiAr
Cj4gPiArLyoKPiA+ICsgKiBJbnN0cnVjdHMgdGhlIHJlbW90ZSBoYXJ0cyB0byBleGVjdXRlIG9u
ZSBvciBtb3JlIFNGRU5DRS5WTUEKPiA+ICsgKiBpbnN0cnVjdGlvbnMsIGNvdmVyaW5nIHRoZSBy
YW5nZSBvZiB2aXJ0dWFsIGFkZHJlc3NlcyBiZXR3ZWVuCj4gPiArICogW3N0YXJ0X2FkZHIsIHN0
YXJ0X2FkZHIgKyBzaXplKS4KPiA+ICsgKgo+ID4gKyAqIFJldHVybnMgMCBpZiBJUEkgd2FzIHNl
bnQgdG8gYWxsIHRoZSB0YXJnZXRlZCBoYXJ0cwo+ID4gc3VjY2Vzc2Z1bGx5Cj4gPiArICogb3Ig
bmVnYXRpdmUgdmFsdWUgaWYgc3RhcnRfYWRkciBvciBzaXplIGlzIG5vdCB2YWxpZC4KPiA+ICsg
Kgo+ID4gKyAqIEBoYXJ0X21hc2sgYSBjcHUgbWFzayBjb250YWluaW5nIGFsbCB0aGUgdGFyZ2V0
IGhhcnRzLgo+ID4gKyAqIEBwYXJhbSBzdGFydCB2aXJ0dWFsIGFkZHJlc3Mgc3RhcnQKPiA+ICsg
KiBAcGFyYW0gc2l6ZSB2aXJ0dWFsIGFkZHJlc3MgcmFuZ2Ugc2l6ZQo+ID4gKyAqLwo+ID4gK2lu
dCBzYmlfcmVtb3RlX3NmZW5jZV92bWEoY29uc3QgY3B1bWFza190ICpjcHVfbWFzaywKPiA+ICvC
oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCB1bnNpZ25l
ZCBsb25nIHN0YXJ0X2FkZHIsCj4gPiArwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC
oMKgwqDCoMKgwqDCoMKgwqAgdW5zaWduZWQgbG9uZyBzaXplKTsKPiAKPiBJIG1heSBoYXZlIGFz
a2VkIGJlZm9yZTogV2h5IG5vdCB2YWRkcl90IGFuZCBzaXplX3QgcmVzcGVjdGl2ZWx5PwpKdXN0
IHRvIGZvbGxvdyBob3cgdGhpcyBhcmd1bWVudHMgYXJlIGRlY2xhcmVkIGluIFJJU0MtViBTQkkg
c3BlYyBidXQKY29uc2lkZXJpbmcgdGhhdCB0aGF0IHRoZSBwcm90b3R5cGUgb2YgdGhpcyBmdW5j
dGlvbiBoYXMgYmVlbiBhbHJlYWR5CmNoYW5nZSBJIHRoaW5rIHdlIGNhbiBhbHNvIGNoYW5nZSB0
eXBlcyBvZiBzdGFydF9hZGRyIGFuZCBzaXplLgoKPiAKPiA+IEBAIC0zOCw3ICs1MSwyNjUgQEAg
c3RydWN0IHNiaXJldCBzYmlfZWNhbGwodW5zaWduZWQgbG9uZyBleHQsCj4gPiB1bnNpZ25lZCBs
b25nIGZpZCwKPiA+IMKgwqDCoMKgIHJldHVybiByZXQ7Cj4gPiDCoH0KPiA+IMKgCj4gPiArc3Rh
dGljIGludCBzYmlfZXJyX21hcF94ZW5fZXJybm8oaW50IGVycikKPiA+ICt7Cj4gPiArwqDCoMKg
IHN3aXRjaCAoIGVyciApCj4gPiArwqDCoMKgIHsKPiA+ICvCoMKgwqAgY2FzZSBTQklfU1VDQ0VT
UzoKPiA+ICvCoMKgwqDCoMKgwqDCoCByZXR1cm4gMDsKPiA+ICvCoMKgwqAgY2FzZSBTQklfRVJS
X0RFTklFRDoKPiA+ICvCoMKgwqDCoMKgwqDCoCByZXR1cm4gLUVBQ0NFUzsKPiA+ICvCoMKgwqAg
Y2FzZSBTQklfRVJSX0lOVkFMSURfUEFSQU06Cj4gPiArwqDCoMKgwqDCoMKgwqAgcmV0dXJuIC1F
SU5WQUw7Cj4gPiArwqDCoMKgIGNhc2UgU0JJX0VSUl9JTlZBTElEX0FERFJFU1M6Cj4gPiArwqDC
oMKgwqDCoMKgwqAgcmV0dXJuIC1FRkFVTFQ7Cj4gPiArwqDCoMKgIGNhc2UgU0JJX0VSUl9OT1Rf
U1VQUE9SVEVEOgo+ID4gK8KgwqDCoMKgwqDCoMKgIHJldHVybiAtRU9QTk9UU1VQUDsKPiA+ICvC
oMKgwqAgY2FzZSBTQklfRVJSX0ZBSUxVUkU6Cj4gPiArwqDCoMKgwqDCoMKgwqAgZmFsbHRocm91
Z2g7Cj4gPiArwqDCoMKgIGRlZmF1bHQ6Cj4gCj4gV2hhdCdzIHRoZSBzaWduaWZpY2FuY2Ugb2Yg
dGhlICJmYWxsdGhyb3VnaCIgaGVyZT8KVG8gaW5kaWNhdGUgdGhhdCB0aGUgZmFsbHRocm91Z2gg
ZnJvbSB0aGUgY2FzZSBTQklfRVJSX0ZBSUxVUkUgYW5kCmRlZmF1bHQgbGFiZWxzIGlzIGludGVu
dGlvbmFsIGFuZCBzaG91bGQgbm90IGJlIGRpYWdub3NlZCBieSBhIGNvbXBpbGVyCnRoYXQgd2Fy
bnMgb24gZmFsbHRocm91Z2guIE9yIGl0IGlzIG5lZWRlZCBvbmx5IHdoZW4gZmFsbHRob3VnaCBo
YXBwZW4KYmV0d2VlbiBzd2l0Y2gncyBjYXNlcyBsYWJlbCAoIG5vdCBkZWZhdWx0IGxhYmVsICkg
bGlrZSBpbiB0aGUKZm9sbG93aW5nIGNvZGUgKCBzaG91bGQgaXQgYmUgZmFsbHRocm91Z2ggaGVy
ZT8gKToKICAgIGNhc2UgU0JJX0VYVF9SRkVOQ0VfUkVNT1RFX0hGRU5DRV9HVk1BOgogICAgY2Fz
ZSBTQklfRVhUX1JGRU5DRV9SRU1PVEVfSEZFTkNFX1ZWTUE6CiAgICBjYXNlIFNCSV9FWFRfUkZF
TkNFX1JFTU9URV9TRkVOQ0VfVk1BOgoKQWRkaXRpb25hbGx5LCBJIGFtIGNvbnNpZGVyaW5nIHdo
ZXRoZXIgdGhlIGNhc2UgU0JJX0VSUl9GQUlMVVJFIHNob3VsZApiZSByZW1vdmVkIG9yIGlmIHdl
IHNob3VsZCBmaW5kIHRoZSBhcHByb3ByaWF0ZSBYZW4gZXJyb3IgY29kZSBmb3IgdGhpcwpjYXNl
LiBJIGFtIHVuY2VydGFpbiB3aGljaCBYZW4gZXJyb3IgY29kZSBmcm9tIHhlbi9lcnJuby5oIHdv
dWxkIGJlCmFwcHJvcHJpYXRlLgoKPiAKPiA+ICtzdGF0aWMgdW5zaWduZWQgbG9uZyBzYmlfbWFq
b3JfdmVyc2lvbih2b2lkKQo+ID4gK3sKPiA+ICvCoMKgwqAgcmV0dXJuIE1BU0tfRVhUUihzYmlf
c3BlY192ZXJzaW9uLAo+ID4gU0JJX1NQRUNfVkVSU0lPTl9NQUpPUl9NQVNLKTsKPiA+ICt9Cj4g
PiArCj4gPiArc3RhdGljIHVuc2lnbmVkIGxvbmcgc2JpX21pbm9yX3ZlcnNpb24odm9pZCkKPiA+
ICt7Cj4gPiArwqDCoMKgIHJldHVybiBNQVNLX0VYVFIoc2JpX3NwZWNfdmVyc2lvbiwKPiA+IFNC
SV9TUEVDX1ZFUlNJT05fTUlOT1JfTUFTSyk7Cj4gPiArfQo+IAo+IEJvdGggZnVuY3Rpb25zIHJl
dHVybiBsZXNzIHRoYW4gMzItYml0IHdpZGUgdmFsdWVzLiBXaHkgdW5zaWduZWQgbG9uZwo+IHJl
dHVybiB0eXBlcz8KV2UgaGFkIHRoaXMgZGlzY3Vzc2lvbiBpbiB0aGUgcHJldmlvdXMgcGF0Y2gg
c2VyaWVzLiBQbGVhc2UgbG9vayBoZXJlOgpodHRwczovL2xvcmUua2VybmVsLm9yZy94ZW4tZGV2
ZWwvMjUzNjM4YzQtMjI1Ni00YmRkLTlmMTItN2Y5OWUzNzMzNTVlQHN1c2UuY29tLwoKSWYgaXQg
d291bGQgYmUgYmV0dGVyIEkgY2FuIGFkZCB0aGUgY29tbWVudCBmb3IgdGhlc2UgZnVuY3Rpb25z
IHdoeQp0aGV5IHJldHVybnMgJ3Vuc2lnbmVkIGxvbmcnLgoKPiAKPiA+ICvCoMKgwqDCoMKgwqDC
oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgdW5zaWduZWQg
bG9uZyBhcmc0KQo+ID4gK3sKPiA+ICvCoMKgwqAgc3RydWN0IHNiaXJldCByZXQgPSB7MH07Cj4g
PiArwqDCoMKgIGludCByZXN1bHQgPSAwOwo+ID4gKwo+ID4gK8KgwqDCoCBzd2l0Y2ggKCBmaWQg
KQo+ID4gK8KgwqDCoCB7Cj4gPiArwqDCoMKgIGNhc2UgU0JJX0VYVF9SRkVOQ0VfUkVNT1RFX0ZF
TkNFX0k6Cj4gPiArwqDCoMKgwqDCoMKgwqAgcmV0ID0gc2JpX2VjYWxsKFNCSV9FWFRfUkZFTkNF
LCBmaWQsIGhtYXNrLCBoYmFzZSwKPiA+ICvCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC
oMKgwqDCoMKgwqDCoMKgIDAsIDAsIDAsIDApOwo+ID4gK8KgwqDCoMKgwqDCoMKgIGJyZWFrOwo+
ID4gKwo+ID4gK8KgwqDCoCBjYXNlIFNCSV9FWFRfUkZFTkNFX1JFTU9URV9IRkVOQ0VfR1ZNQToK
PiA+ICvCoMKgwqAgY2FzZSBTQklfRVhUX1JGRU5DRV9SRU1PVEVfSEZFTkNFX1ZWTUE6Cj4gPiAr
wqDCoMKgIGNhc2UgU0JJX0VYVF9SRkVOQ0VfUkVNT1RFX1NGRU5DRV9WTUE6Cj4gPiArwqDCoMKg
wqDCoMKgwqAgcmV0ID0gc2JpX2VjYWxsKFNCSV9FWFRfUkZFTkNFLCBmaWQsIGhtYXNrLCBoYmFz
ZSwKPiA+ICvCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIHN0
YXJ0LCBzaXplLCAwLCAwKTsKPiA+ICvCoMKgwqDCoMKgwqDCoCBicmVhazsKPiA+ICsKPiA+ICvC
oMKgwqAgY2FzZSBTQklfRVhUX1JGRU5DRV9SRU1PVEVfU0ZFTkNFX1ZNQV9BU0lEOgo+ID4gK8Kg
wqDCoCBjYXNlIFNCSV9FWFRfUkZFTkNFX1JFTU9URV9IRkVOQ0VfR1ZNQV9WTUlEOgo+ID4gK8Kg
wqDCoCBjYXNlIFNCSV9FWFRfUkZFTkNFX1JFTU9URV9IRkVOQ0VfVlZNQV9BU0lEOgo+ID4gK8Kg
wqDCoMKgwqDCoMKgIHJldCA9IHNiaV9lY2FsbChTQklfRVhUX1JGRU5DRSwgZmlkLCBobWFzaywg
aGJhc2UsCj4gPiArwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC
oCBzdGFydCwgc2l6ZSwgYXJnNCwgMCk7Cj4gPiArwqDCoMKgwqDCoMKgwqAgYnJlYWs7Cj4gPiAr
Cj4gPiArwqDCoMKgIGRlZmF1bHQ6Cj4gPiArwqDCoMKgwqDCoMKgwqAgcHJpbnRrKCIlczogdW5r
bm93biBmdW5jdGlvbiBJRCBbJWx1XVxuIiwKPiAKPiBJIHdvbmRlciBob3cgdXNlZnVsIHRoZSBs
b2dnaW5nIGluIGRlY2ltYWwgb2YgKHBlcmhhcHMgbGFyZ2UpIHVua25vd24KPiB2YWx1ZXMgaXMu
CkFncmVlLCBpdCB3b3VsZCBtdWNoIGJldHRlciBpbiBoZXguCgo+IAo+ID4gK8KgwqDCoMKgwqDC
oMKgwqDCoMKgwqDCoMKgwqAgX19mdW5jX18sIGZpZCk7Cj4gPiArwqDCoMKgwqDCoMKgwqAgcmVz
dWx0ID0gLUVJTlZBTDsKPiA+ICvCoMKgwqDCoMKgwqDCoCBicmVhazsKPiA+ICvCoMKgwqAgfTsK
PiA+ICsKPiA+ICvCoMKgwqAgaWYgKCByZXQuZXJyb3IgKQo+ID4gK8KgwqDCoCB7Cj4gPiArwqDC
oMKgwqDCoMKgwqAgcmVzdWx0ID0gc2JpX2Vycl9tYXBfeGVuX2Vycm5vKHJldC5lcnJvcik7Cj4g
PiArwqDCoMKgwqDCoMKgwqAgcHJpbnRrKCIlczogaGJhc2U9JWx1IGhtYXNrPSUjbHggZmFpbGVk
IChlcnJvciAlZClcbiIsCj4gPiArwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCBfX2Z1bmNf
XywgaGJhc2UsIGhtYXNrLCByZXN1bHQpOwo+IAo+IENvbnNpZGVyaW5nIHRoYXQgc2JpX2Vycl9t
YXBfeGVuX2Vycm5vKCkgbWF5IGxvc2UgaW5mb3JtYXRpb24sIEknZAo+IHJlY29tbWVuZCBsb2dn
aW5nIHJldC5lcnJvciBoZXJlLgpCeSAnbG9zZSBpbmZvcm1hdGlvbicgeW91IG1lYW4gY2FzZSBT
QklfRVJSX0ZBSUxVUkU/Cgo+IAo+ID4gK3N0YXRpYyBpbnQgY2ZfY2hlY2sgc2JpX3JmZW5jZV92
MDIodW5zaWduZWQgbG9uZyBmaWQsCj4gPiArwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKg
wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgY29uc3QgY3B1bWFza190ICpj
cHVfbWFzaywKPiA+ICvCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC
oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCB1bnNpZ25lZCBsb25nIHN0YXJ0LCB1bnNpZ25lZAo+
ID4gbG9uZyBzaXplLAo+ID4gK8KgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKg
wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIHVuc2lnbmVkIGxvbmcgYXJnNCwgdW5zaWdu
ZWQKPiA+IGxvbmcgYXJnNSkKPiA+ICt7Cj4gPiArwqDCoMKgIHVuc2lnbmVkIGxvbmcgaGFydGlk
LCBjcHVpZCwgaG1hc2sgPSAwLCBoYmFzZSA9IDAsIGh0b3AgPSAwOwo+ID4gK8KgwqDCoCBpbnQg
cmVzdWx0Owo+ID4gKwo+ID4gK8KgwqDCoCAvKgo+ID4gK8KgwqDCoMKgICogaGFydF9tYXNrX2Jh
c2UgY2FuIGJlIHNldCB0byAtMSB0byBpbmRpY2F0ZSB0aGF0IGhhcnRfbWFzawo+ID4gY2FuIGJl
Cj4gPiArwqDCoMKgwqAgKiBpZ25vcmVkIGFuZCBhbGwgYXZhaWxhYmxlIGhhcnRzIG11c3QgYmUg
Y29uc2lkZXJlZC4KPiA+ICvCoMKgwqDCoCAqLwo+ID4gK8KgwqDCoCBpZiAoICFjcHVfbWFzayAp
Cj4gPiArwqDCoMKgwqDCoMKgwqAgcmV0dXJuIHNiaV9yZmVuY2VfdjAyX3JlYWwoZmlkLCAwVUws
IC0xVUwsIHN0YXJ0LCBzaXplLAo+ID4gYXJnNCk7Cj4gPiArCj4gPiArwqDCoMKgIGZvcl9lYWNo
X2NwdSAoIGNwdWlkLCBjcHVfbWFzayApCj4gPiArwqDCoMKgIHsKPiA+ICvCoMKgwqDCoMKgwqDC
oCAvKgo+ID4gK8KgwqDCoMKgwqDCoMKgICogSGFydCBJRHMgbWlnaHQgbm90IG5lY2Vzc2FyaWx5
IGJlIG51bWJlcmVkIGNvbnRpZ3VvdXNseQo+ID4gaW4KPiA+ICvCoMKgwqDCoMKgwqDCoCAqIGEg
bXVsdGlwcm9jZXNzb3Igc3lzdGVtLCBidXQgYXQgbGVhc3Qgb25lIGhhcnQgbXVzdCBoYXZlCj4g
PiBhCj4gPiArwqDCoMKgwqDCoMKgwqAgKiBoYXJ0IElEIG9mIHplcm8uCj4gCj4gRG9lcyB0aGlz
IGxhdHRlciBmYWN0IG1hdHRlciBoZXJlIGluIGFueSB3YXk/Ckl0IGRvZXNuJ3QsIGp1c3QgY29w
eSBmcm9tIHRoZSBSSVNDLVYgc3BlYyB0aGUgZnVsbCBzZW50ZW5jZS4gSWYgaXQKd291bGQgYmUg
YmV0dGVyIHRvIGRyb3AgdGhlIGxhdHRlciBmYWN0IEkgd2lsbCBiZSBoYXBweSB0byBkbyB0aGF0
IGluCnRoZSBuZXh0IHBhdGNoIHZlcnNpb24uCgo+IAo+ID4gK8KgwqDCoMKgwqDCoMKgICogVGhp
cyBtZWFucyB0aGF0IGl0IGlzIHBvc3NpYmxlIGZvciB0aGUgaGFydCBJRCBtYXBwaW5nCj4gPiB0
byBsb29rIGxpa2U6Cj4gPiArwqDCoMKgwqDCoMKgwqAgKsKgIDAsIDEsIDMsIDY1LCA2NiwgNjkK
PiA+ICvCoMKgwqDCoMKgwqDCoCAqIEluIHN1Y2ggY2FzZXMsIG1vcmUgdGhhbiBvbmUgY2FsbCB0
bwo+ID4gc2JpX3JmZW5jZV92MDJfcmVhbCgpIHdpbGwgYmUKPiA+ICvCoMKgwqDCoMKgwqDCoCAq
IG5lZWRlZCwgYXMgYSBzaW5nbGUgaG1hc2sgY2FuIG9ubHkgY292ZXIgc2l6ZW9mKHVuc2lnbmVk
Cj4gPiBsb25nKSBDUFVzOgo+ID4gK8KgwqDCoMKgwqDCoMKgICrCoCAxLiBzYmlfcmZlbmNlX3Yw
Ml9yZWFsKGhtYXNrPTBiMTAxMSwgaGJhc2U9MCkKPiA+ICvCoMKgwqDCoMKgwqDCoCAqwqAgMi4g
c2JpX3JmZW5jZV92MDJfcmVhbChobWFzaz0wYjEwMTEsIGhiYXNlPTY1KQo+ID4gK8KgwqDCoMKg
wqDCoMKgICoKPiA+ICvCoMKgwqDCoMKgwqDCoCAqIFRoZSBhbGdvcml0aG0gYmVsb3cgdHJpZXMg
dG8gYmF0Y2ggYXMgbWFueSBoYXJ0cyBhcwo+ID4gcG9zc2libGUgYmVmb3JlCj4gPiArwqDCoMKg
wqDCoMKgwqAgKiBtYWtpbmcgYW4gU0JJIGNhbGwuIEhvd2V2ZXIsIGJhdGNoaW5nIG1heSBub3Qg
YWx3YXlzIGJlCj4gPiBwb3NzaWJsZS4KPiA+ICvCoMKgwqDCoMKgwqDCoCAqIEZvciBleGFtcGxl
LCBjb25zaWRlciB0aGUgaGFydCBJRCBtYXBwaW5nOgo+ID4gK8KgwqDCoMKgwqDCoMKgICrCoMKg
IDAsIDY0LCAxLCA2NSwgMiwgNjYKPiAKPiBKdXN0IHRvIG1lbnRpb24gaXQ6IEJhdGNoaW5nIGlz
IGFsc28gcG9zc2libGUgaGVyZTogRmlyc3QgKDAsMSwyKSwKPiB0aGVuCj4gKDY0LDY1LDY2KS4g
SXQganVzdCByZXF1aXJlcyBhIGRpZmZlcmVudCBhcHByb2FjaC4gV2hldGhlciBzd2l0Y2hpbmcK
PiBpcwo+IHdvcnRod2hpbGUgZGVwZW5kcyBvbiBob3cgbnVtYmVyaW5nIGlzIGRvbmUgb24gcmVh
bCB3b3JsZCBzeXN0ZW1zLgpGb3Igc3VyZSwgaXQncyBwb3NzaWJsZSB0byBkbyB0aGF0LiBJIHdh
cyBqdXN0IHRyeWluZyB0byBkZXNjcmliZSB0aGUKY3VycmVudGx5IGltcGxlbWVudGVkIGFsZ29y
aXRobS4gSWYgeW91IHRoaW5rIGl0J3MgYmVuZWZpY2lhbCB0byBhZGQKdGhhdCBpbmZvcm1hdGlv
biB0byB0aGUgY29tbWVudCwgSSBjYW4gaW5jbHVkZSBpdCBhcyB3ZWxsLgoKPiAKPiA+ICtzdGF0
aWMgaW50ICgqIF9fcm9fYWZ0ZXJfaW5pdCBzYmlfcmZlbmNlKSh1bnNpZ25lZCBsb25nIGZpZCwK
PiA+ICvCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKg
wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIGNvbnN0IGNwdW1hc2tfdAo+ID4gKmNwdV9t
YXNrLAo+ID4gK8KgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC
oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqAgdW5zaWduZWQgbG9uZyBzdGFydCwK
PiA+ICvCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKg
wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIHVuc2lnbmVkIGxvbmcgc2l6ZSwKPiA+ICvC
oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKg
wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIHVuc2lnbmVkIGxvbmcgYXJnNCwKPiA+ICvCoMKgwqDC
oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKg
wqDCoMKgwqDCoMKgwqDCoMKgIHVuc2lnbmVkIGxvbmcgYXJnNSk7Cj4gPiArCj4gPiAraW50IHNi
aV9yZW1vdGVfc2ZlbmNlX3ZtYShjb25zdCBjcHVtYXNrX3QgKmNwdV9tYXNrLAo+ID4gK8KgwqDC
oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIHVuc2lnbmVkIGxv
bmcgc3RhcnRfYWRkciwKPiAKPiBUbyBtYXRjaCBvdGhlciBmdW5jdGlvbnMsIHBlcmhhcHMganVz
dCAic3RhcnQiPwpJdCB3b3VsZCBiZSBiZXR0ZXIsIFJJU0MtViBzcGVjIGlzIHVzaW5nICdzdGFy
dCcgZXZlcnl3aGVyZSB0b28sIGF0CmxlYXN0LCBmb3IgRkVOQ0UgRXh0ZW5zaW9uLgoKPiAKPiA+
ICtpbnQgc2JpX3Byb2JlX2V4dGVuc2lvbihsb25nIGV4dGlkKQo+ID4gK3sKPiA+ICvCoMKgwqAg
c3RydWN0IHNiaXJldCByZXQ7Cj4gPiArCj4gPiArwqDCoMKgIHJldCA9IHNiaV9lY2FsbChTQklf
RVhUX0JBU0UsIFNCSV9FWFRfQkFTRV9QUk9CRV9FWFQsIGV4dGlkLAo+ID4gK8KgwqDCoMKgwqDC
oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIDAsIDAsIDAsIDAsIDApOwo+ID4gK8KgwqDCoCBp
ZiAoICFyZXQuZXJyb3IgJiYgcmV0LnZhbHVlICkKPiA+ICvCoMKgwqDCoMKgwqDCoCByZXR1cm4g
cmV0LnZhbHVlOwo+ID4gKwo+ID4gK8KgwqDCoCByZXR1cm4gLUVPUE5PVFNVUFA7Cj4gCj4gQW55
IHJlYXNvbiBub3QgdG8gdXNlIHNiaV9lcnJfbWFwX3hlbl9lcnJubygpIGhlcmU/CldlIGNhbiwg
anVzdCBtaXNzZWQgdGhhdC4KClRoYW5rcy4KCn4gT2xla3NpaQo=



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 13:12:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 13:12:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784814.1194207 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjITn-00041V-HA; Wed, 28 Aug 2024 13:12:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784814.1194207; Wed, 28 Aug 2024 13:12:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjITn-00041O-E5; Wed, 28 Aug 2024 13:12:55 +0000
Received: by outflank-mailman (input) for mailman id 784814;
 Wed, 28 Aug 2024 13:12:54 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=J5xK=P3=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1sjITl-00041G-L3
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 13:12:54 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3aa867a4-653f-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 15:12:51 +0200 (CEST)
Received: from truciolo.homenet.telecomitalia.it
 (host-79-46-33-59.retail.telecomitalia.it [79.46.33.59])
 by support.bugseng.com (Postfix) with ESMTPSA id 4DD374EE0745;
 Wed, 28 Aug 2024 15:12:50 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3aa867a4-653f-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail;
	t=1724850770; bh=YgUHtBUkddA4AevUOiJ9qiyDHF9U+GGJWoIylf0IYnM=;
	h=From:To:Cc:Subject:Date:From;
	b=UjIUas4yOUEIP7DACSCEa0ZB/VA65j1wrrnMY343Nxp8R4LAwT0Pmkwg5sEDlSmRE
	 R9yJFfuvXVDFmT3SUujGWKfH/BubaP/nbOf2PKwFlERTyeWKY+WbuZFUUsWeoQ8RNA
	 4W6PAqCMeISUDrwy6T1F39BW6PPnGC4IhJddlRrMFSsksAAQI9ALXdVA5F2o+KBI0E
	 hOGPdUbfcMqhaC5RCkC+tINaiSTqNh555FsqANa7Obyr8yPg70NoHFfwu86pKn3Pmt
	 gJr1GWPGzE5h54YBDp5zQYkqvQE121XURYyGaIr7YJzgTtGlr3G6kqAYTrcFo5gwPC
	 L6spIwiiUjarA==
From: Federico Serafini <federico.serafini@bugseng.com>
To: xen-devel@lists.xenproject.org
Cc: consulting@bugseng.com,
	Federico Serafini <federico.serafini@bugseng.com>,
	Simone Ballarin <simone.ballarin@bugseng.com>,
	Doug Goldstein <cardoe@cardoe.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Julien Grall <julien@xen.org>
Subject: [XEN PATCH] xen/bitmap: remove comment-based deviations
Date: Wed, 28 Aug 2024 15:12:44 +0200
Message-Id: <4aa692a50a5d08d24560f02fdc36911965fc860b.1724850701.git.federico.serafini@bugseng.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Update ECLAIR configuration of MISRA C:2012 Rule 20.7 ("Expressions
resulting from the expansion of macro parameters shall be enclosed in
parentheses") to tag as 'safe' the expansions of arguments surrounded
by the following tokens: '{', '}' and ';'.

Remove redundant comment-based deviations.

Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
---
 automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++
 docs/misra/deviations.rst                        | 5 +++++
 xen/include/xen/bitmap.h                         | 3 ---
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
index 1aa8277066..f37329973f 100644
--- a/automation/eclair_analysis/ECLAIR/deviations.ecl
+++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
@@ -565,6 +565,10 @@ of this macro do not lead to developer confusion, and can thus be deviated."
 -config=MC3R1.R20.7,reports+={safe, "any_area(any_loc(any_exp(macro(^count_args_$))))"}
 -doc_end
 
+-doc_begin="The expansion of an argument surrounded by tokens '{', '}' and ';' is safe."
+-config=MC3R1.R20.7,expansion_context+={safe, "left_right(^[\\{;]$,^[;\\}]$)"}
+-doc_end
+
 -doc_begin="Uses of variadic macros that have one of their arguments defined as
 a macro and used within the body for both ordinary parameter expansion and as an
 operand to the # or ## operators have a behavior that is well-understood and
diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
index d51aa422b5..d529726464 100644
--- a/docs/misra/deviations.rst
+++ b/docs/misra/deviations.rst
@@ -512,6 +512,11 @@ Deviations related to MISRA C:2012 Rules:
        refactoring it to add parentheses breaks its functionality.
      - Tagged as `safe` for ECLAIR.
 
+   * - R20.7
+     - The expansion of an argument surrounded by tokens '{', '}' and ';' is
+       safe.
+     - Tagged as `safe` for ECLAIR.
+
    * - R20.12
      - Variadic macros that use token pasting often employ the gcc extension
        `ext_paste_comma`, as detailed in `C-language-toolchain.rst`, which is
diff --git a/xen/include/xen/bitmap.h b/xen/include/xen/bitmap.h
index 5d668053b0..4b642cd420 100644
--- a/xen/include/xen/bitmap.h
+++ b/xen/include/xen/bitmap.h
@@ -103,13 +103,10 @@ extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order);
 #define bitmap_switch(nbits, zero, small, large)			  \
 	unsigned int n__ = (nbits);					  \
 	if (__builtin_constant_p(nbits) && !n__) {			  \
-		/* SAF-7-safe Rule 20.7 non-parenthesized macro argument */ \
 		zero;							  \
 	} else if (__builtin_constant_p(nbits) && n__ <= BITS_PER_LONG) { \
-		/* SAF-7-safe Rule 20.7 non-parenthesized macro argument */ \
 		small;							  \
 	} else {							  \
-		/* SAF-7-safe Rule 20.7 non-parenthesized macro argument */ \
 		large;							  \
 	}
 
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 13:30:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 13:30:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784824.1194218 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjIl1-00085q-UP; Wed, 28 Aug 2024 13:30:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784824.1194218; Wed, 28 Aug 2024 13:30:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjIl1-00085j-Rm; Wed, 28 Aug 2024 13:30:43 +0000
Received: by outflank-mailman (input) for mailman id 784824;
 Wed, 28 Aug 2024 13:30:42 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjIl0-00085d-JK
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 13:30:42 +0000
Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com
 [2a00:1450:4864:20::52a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b7c00c89-6541-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 15:30:40 +0200 (CEST)
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-5c0a9ae3665so3827321a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 06:30:40 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e54852f5sm245821366b.25.2024.08.28.06.30.38
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 06:30:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b7c00c89-6541-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724851839; x=1725456639; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=jRsj11XV1fVGwS7FB2o0nFLySj8EnNqCoZEfVWbPM/A=;
        b=jBQtDANLkoXgfuBZ7xL0nlz+Qcifgb30+HcEbh4T7tu6QEDTVh060JPDNfK1tcrJdW
         lCwxhnysxK6S1MZDGyn3rQJ39QODBoGJpZwOYJCVUB20/qADXSKatH+MfiahJBZ9ZdnE
         4SemfZqLTsWzcFhpZwuvxev826SVut74rXESM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724851839; x=1725456639;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=jRsj11XV1fVGwS7FB2o0nFLySj8EnNqCoZEfVWbPM/A=;
        b=hnAmxq+8yZL5BvApUzRi7Puo4gJcPegGCbg76hvu70nyhzytA8IfyooAOo1grTen7D
         flkRc+QCe5Eks1IXxiI/DFhfT/0QXKmpNIr0KSJMrMuMYxXiLYkM/mD8/cKmAA6CIfyT
         H6wvnkCcbqazb6MzdF2daEbd7ATHHwaHi+82QXzccbT+adYqpJnTujJltAr/n5ZJuZ29
         xzcxA3dFBvdGdJeDVdkoZ5Mh2U4M7CP/0b4IlQSjx+NZnt0rLB09x4Ei74kmbGpBUjIn
         CL/mSwDxNgeW7YhH0xEtIDHGfOFV6GETndzv8mXvj6aGU6aXUlmXdpKNuVqjP1W2OdmW
         XIAw==
X-Gm-Message-State: AOJu0Yy9w6dISXNBAFBYuYIX1gXl9yPT/rXujc23o+QfBHT2ZhgwykHy
	C1xN4QPcjPjY7qEta6043Qrt+pIqCehMBcnzAPx3M961FoMEhcTiEGmG+oOKKSTSNzIsEQHiHxr
	F
X-Google-Smtp-Source: AGHT+IH4Z3pKu7AOfwQIwZoBfP/sRISuxlD3gzCHt8+rLYokFpknOs81rt/qkJafGJJBiLdhp3qGMQ==
X-Received: by 2002:a17:907:1b19:b0:a7a:952b:95b1 with SMTP id a640c23a62f3a-a870a97464amr158936666b.24.1724851838735;
        Wed, 28 Aug 2024 06:30:38 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Christian Lindig <christian.lindig@citrix.com>,
	David Scott <dave@recoil.org>,
	=?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@cloud.com>,
	Rob Hoes <Rob.Hoes@citrix.com>,
	Andrii Sultanov <andrii.sultanov@cloud.com>
Subject: [PATCH] tools/ocaml: Factor out compatiblity handling
Date: Wed, 28 Aug 2024 14:30:33 +0100
Message-Id: <20240828133033.2378322-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

... rather than having each library implement its own subset.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Christian Lindig <christian.lindig@citrix.com>
CC: David Scott <dave@recoil.org>
CC: Edwin Török <edwin.torok@cloud.com>
CC: Rob Hoes <Rob.Hoes@citrix.com>
CC: Andrii Sultanov <andrii.sultanov@cloud.com>

Broken out of a larger series, to help Andrii with his dynlib work.
---
 tools/ocaml/libs/xc/Makefile        |  2 +-
 tools/ocaml/libs/xc/xenctrl_stubs.c | 13 +++----------
 tools/ocaml/libs/xen-caml-compat.h  | 23 +++++++++++++++++++++++
 3 files changed, 27 insertions(+), 11 deletions(-)
 create mode 100644 tools/ocaml/libs/xen-caml-compat.h

diff --git a/tools/ocaml/libs/xc/Makefile b/tools/ocaml/libs/xc/Makefile
index 1d9fecb06ef2..cdf4d01dac52 100644
--- a/tools/ocaml/libs/xc/Makefile
+++ b/tools/ocaml/libs/xc/Makefile
@@ -2,7 +2,7 @@ OCAML_TOPLEVEL=$(CURDIR)/../..
 XEN_ROOT=$(OCAML_TOPLEVEL)/../..
 include $(OCAML_TOPLEVEL)/common.make
 
-CFLAGS += -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
+CFLAGS += -I../ -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
 CFLAGS += $(APPEND_CFLAGS)
 OCAMLINCLUDE += -I ../mmap -I ../eventchn
 
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index a52908012960..c78191f95abc 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -25,6 +25,8 @@
 #include <caml/fail.h>
 #include <caml/callback.h>
 
+#include "xen-caml-compat.h"
+
 #include <sys/mman.h>
 #include <stdint.h>
 #include <string.h>
@@ -37,14 +39,6 @@
 
 #include "mmap_stubs.h"
 
-#ifndef Val_none
-#define Val_none (Val_int(0))
-#endif
-
-#ifndef Tag_some
-#define Tag_some 0
-#endif
-
 static inline xc_interface *xch_of_val(value v)
 {
 	xc_interface *xch = *(xc_interface **)Data_custom_val(v);
@@ -744,8 +738,7 @@ CAMLprim value stub_xc_evtchn_status(value xch_val, value domid, value port)
 	Store_field(result_status, 0, Val_int(status.vcpu));
 	Store_field(result_status, 1, stat);
 
-	result = caml_alloc_small(1, Tag_some);
-	Store_field(result, 0, result_status);
+	result = caml_alloc_some(result_status);
 
 	CAMLreturn(result);
 }
diff --git a/tools/ocaml/libs/xen-caml-compat.h b/tools/ocaml/libs/xen-caml-compat.h
new file mode 100644
index 000000000000..b4a0ca4ce90c
--- /dev/null
+++ b/tools/ocaml/libs/xen-caml-compat.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: LGPL-2.1-only WITH OCaml-LGPL-linking-exception */
+#ifndef XEN_CAML_COMPAT_H
+#define XEN_CAML_COMPAT_H
+
+#ifndef Val_none /* Option handling.  Compat for Ocaml < 4.12 */
+
+#define Val_none Val_int(0)
+#define Tag_some 0
+#define Some_val(v) Field(v, 0)
+
+static inline value caml_alloc_some(value v)
+{
+    CAMLparam1(v);
+
+    value some = caml_alloc_small(1, Tag_some);
+    Store_field(some, 0, v);
+
+    CAMLreturn(some);
+}
+
+#endif /* !Val_none */
+
+#endif /* XEN_CAML_COMPAT_H */

base-commit: 75c64db3722f0245137a1e8cfd3435f4790d0fd7
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 13:33:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 13:33:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784830.1194227 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjInh-0000Cb-Bd; Wed, 28 Aug 2024 13:33:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784830.1194227; Wed, 28 Aug 2024 13:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjInh-0000CU-8j; Wed, 28 Aug 2024 13:33:29 +0000
Received: by outflank-mailman (input) for mailman id 784830;
 Wed, 28 Aug 2024 13:33:28 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjIng-0000CI-7F; Wed, 28 Aug 2024 13:33:28 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjInf-0000oL-TJ; Wed, 28 Aug 2024 13:33:27 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjInf-0006C3-KM; Wed, 28 Aug 2024 13:33:27 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjInf-0007DL-Js; Wed, 28 Aug 2024 13:33:27 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=/JwRVGSje9xVh5PtL4RprIVHHG32kEkZtB3BNe+2gCQ=; b=Xqe/Bl+5sYjDSSyDaWnhvxtXYh
	QWQ5MYJ7jGmi7OoqLUJuu32HwgqPLLmKjwd8sDWLO1dMa8z2uMLXNtazcA8KPeZlgeHR/kG3yaq/D
	rT+jbCWcEcLx+ooPfRD3jJk6TcSNvlouD0XqDuUUJ3RD9RjFlSzQwnS6pK5hdOhh6F+M=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187379-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187379: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=75c64db3722f0245137a1e8cfd3435f4790d0fd7
X-Osstest-Versions-That:
    xen=9429f1a6c4758ae91f3ae721a036f4bbf76fb2b8
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 13:33:27 +0000

flight 187379 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187379/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  75c64db3722f0245137a1e8cfd3435f4790d0fd7
baseline version:
 xen                  9429f1a6c4758ae91f3ae721a036f4bbf76fb2b8

Last test of basis   187365  2024-08-27 18:02:19 Z    0 days
Testing same since   187379  2024-08-28 10:02:12 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   9429f1a6c4..75c64db372  75c64db3722f0245137a1e8cfd3435f4790d0fd7 -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 13:38:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 13:38:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784839.1194237 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjIsh-0001a0-Ta; Wed, 28 Aug 2024 13:38:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784839.1194237; Wed, 28 Aug 2024 13:38:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjIsh-0001Zt-R4; Wed, 28 Aug 2024 13:38:39 +0000
Received: by outflank-mailman (input) for mailman id 784839;
 Wed, 28 Aug 2024 13:38:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=v9ut=P3=tklengyel.com=tamas@srs-se1.protection.inumbo.net>)
 id 1sjIsg-0001Zn-RQ
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 13:38:38 +0000
Received: from sender4-op-o15.zoho.com (sender4-op-o15.zoho.com
 [136.143.188.15]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d2ba5330-6542-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 15:38:37 +0200 (CEST)
Delivered-To: tamas@tklengyel.com
Received: by mx.zohomail.com with SMTPS id 1724852306670261.24261591500965;
 Wed, 28 Aug 2024 06:38:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d2ba5330-6542-11ef-a0b0-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1724852308; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=Z3AhUZM4obUdwIZun6TURgGCxhMh5jKOkglTsl1EJg72at/VDGChmLJjc0c+baH/3w/aXYEEuuAQm2Nw5BjqbDshbaevnc6CRAqAje7t5JYg7YEVb31Tdyv7E1sSUtcgaQVxRfS+dL783Prk5tLA4ehfUlDf5w1OnoPvbEiS5Kw=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1724852308; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=h5izV+gy9kms6C1QElYdVAc20fiMd6pHKbrRU4zUrIk=; 
	b=OgnanZK7kHoGZsnfXU4pTOM0a319/1V3uF5oQFyN/QH0o4462c/9XCoj9Pk5Io27uryFMI83AnB8Jn5DQ5NKrImaFo+a1uexUMfQ/RcD1wzXZ2y7CS83zJTu/kZtTgC6bx91JablKOHhZueERMaon5tDGM40ZOTjjksNlWwYSiQ=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=tklengyel.com;
	spf=pass  smtp.mailfrom=tamas@tklengyel.com;
	dmarc=pass header.from=<tamas@tklengyel.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1724852308;
	s=zmail; d=tklengyel.com; i=tamas@tklengyel.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=h5izV+gy9kms6C1QElYdVAc20fiMd6pHKbrRU4zUrIk=;
	b=Fki3e9fvkLDsBeTxSMje7Ny9qbhiJrs8ryIOiSDOm8R94ojW4cSDZT8Ua4ixWy2Z
	Ki5Xga3AoRpWeCzCjxS/gId9PqeOwTETveFNYn3jfa6VTXW99jdfQaZABSSmMudi8k+
	DDQ6r72TH8JoLceUVmYJ1FqzdKPqcbTkaj6/uZ2Y=
From: Tamas K Lengyel <tamas@tklengyel.com>
To: xen-devel@lists.xenproject.org
Cc: Tamas K Lengyel <tamas@tklengyel.com>,
	Anthony PERARD <anthony.perard@vates.tech>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH] oss-fuzz: Fix coverage runtime error
Date: Wed, 28 Aug 2024 09:38:23 -0400
Message-Id: <20240828133823.1114-1-tamas@tklengyel.com>
X-Mailer: git-send-email 2.34.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

The oss-fuzz infrastructure collects runtime coverage information for debugging
and fuzzing evaluation. Currently it appears broken due to missing C files.
This is because the fuzzer's Makefile only symlinks the C files from various
locations in the Xen source tree into the build folder. These symlinks however
are gone as oss-fuzz uses separate docker containers for the build and for the
run.

Update the oss-fuzz build script to copy the required C files into the
build folder to fix this oss-fuzz specific issue.

Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
---
 tools/fuzz/oss-fuzz/build.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/fuzz/oss-fuzz/build.sh b/tools/fuzz/oss-fuzz/build.sh
index 08eeb66e4c..002d86c44f 100644
--- a/tools/fuzz/oss-fuzz/build.sh
+++ b/tools/fuzz/oss-fuzz/build.sh
@@ -9,3 +9,7 @@ cd xen
 make clang=y -C tools/include
 make clang=y -C tools/fuzz/x86_instruction_emulator libfuzzer-harness
 cp tools/fuzz/x86_instruction_emulator/libfuzzer-harness $OUT/x86_instruction_emulator
+
+# Runtime coverage collection requires access to source files and symlinks don't work
+cp xen/lib/x86/*.c tools/fuzz/x86_instruction_emulator
+cp tools/tests/x86_emulator/*.c tools/fuzz/x86_instruction_emulator
-- 
2.34.1



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 13:40:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 13:40:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784844.1194248 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjIuO-000310-7Z; Wed, 28 Aug 2024 13:40:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784844.1194248; Wed, 28 Aug 2024 13:40:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjIuO-00030t-4I; Wed, 28 Aug 2024 13:40:24 +0000
Received: by outflank-mailman (input) for mailman id 784844;
 Wed, 28 Aug 2024 13:40:23 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjIuN-00030i-53
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 13:40:23 +0000
Received: from mail-qv1-xf33.google.com (mail-qv1-xf33.google.com
 [2607:f8b0:4864:20::f33])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 11ae08e9-6543-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 15:40:21 +0200 (CEST)
Received: by mail-qv1-xf33.google.com with SMTP id
 6a1803df08f44-6bf705959f1so6016516d6.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 06:40:21 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 6a1803df08f44-6c162db0acdsm65691636d6.85.2024.08.28.06.40.18
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 06:40:19 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 11ae08e9-6543-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724852420; x=1725457220; 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=QU5S5X0NULHTM1QIsTLILDFcVu9I2b5MsJCxlya5c9o=;
        b=etRZwNydqxoRB6G/2wijNi81H/TL4uWxFJ2qapA8Bkuo/gPi+2Qd/uwka4dBAMZ/Jq
         czRCHXRLdZr07RH+UvQ/WZdkmRsS/fEb3LUOC/jE2V8g4T6WY9XT/uEgXpgub90U0v9U
         kVADOt0LalJgjTc/IsZLx+4h+rfOa4vMDfZhM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724852420; x=1725457220;
        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=QU5S5X0NULHTM1QIsTLILDFcVu9I2b5MsJCxlya5c9o=;
        b=gYh6jXpusVyDhzKA2vngFsja0pIPL1HeKO+aHdK3DO+EDrkodGr610p6IA870OY2BP
         ASfugbPqYDLzQG3No82Sn5/BwbNtlGmWNJuxWhmxZgY1z5sMbA1gjxBEqeXIL8ZCJyTa
         WeCdTjGgpGxLPPnkIPC7Xt9ogxKOIKvZik15qobrH6bs8UthPQblguwfsoRPHDix89qV
         qdbqaje5af+uh39NW75eczNYU7PfJ10gnDXpmW6x2UZraI4k1Vo36m7hiGYES+aQ9MNn
         w6NcljOOAYT9ho6S4zd4hFKRkHjvTfFD4LWltGzLDmL7JDihTtaMVwW0pcOma2eWEIeo
         8ZFg==
X-Forwarded-Encrypted: i=1; AJvYcCX26dgM5LG95c5zDuiUZIO+BuK9H+ZIA6AyDPPK9kOZtyu0nKlsR8lVgIryt8SniBm5zOXNd3fFqL4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzimbyLPWofNdBa3DTWV1hBxW7P7EMTANC/aActpn01OIJOP6tw
	rwWD6aALkxhXenGWriqcP0AQEmPLC2PqoBYcMKa5LI94nOjUetkqnOfP7+wUMi4w3IPwIzszq0h
	O
X-Google-Smtp-Source: AGHT+IFdAZdXdMzcbAd1CF1VlmVe/taoIoR0YrI4Bm0cIqNTMUaofUks2gfxUJTUZyr++FG0l8X1Yg==
X-Received: by 2002:a05:6214:5b84:b0:6bb:bf27:8a15 with SMTP id 6a1803df08f44-6c335d10dabmr42515096d6.3.1724852419890;
        Wed, 28 Aug 2024 06:40:19 -0700 (PDT)
Message-ID: <cfa79e7e-9e2e-4273-848c-dc4edd761e7c@citrix.com>
Date: Wed, 28 Aug 2024 14:40:16 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] oss-fuzz: Fix coverage runtime error
To: Tamas K Lengyel <tamas@tklengyel.com>, xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>,
 Jan Beulich <jbeulich@suse.com>
References: <20240828133823.1114-1-tamas@tklengyel.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20240828133823.1114-1-tamas@tklengyel.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 28/08/2024 2:38 pm, Tamas K Lengyel wrote:
> The oss-fuzz infrastructure collects runtime coverage information for debugging
> and fuzzing evaluation. Currently it appears broken due to missing C files.
> This is because the fuzzer's Makefile only symlinks the C files from various
> locations in the Xen source tree into the build folder. These symlinks however
> are gone as oss-fuzz uses separate docker containers for the build and for the
> run.
>
> Update the oss-fuzz build script to copy the required C files into the
> build folder to fix this oss-fuzz specific issue.
>
> Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks for looking into this.


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 14:15:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 14:15:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784863.1194259 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJSF-0000gI-TB; Wed, 28 Aug 2024 14:15:23 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784863.1194259; Wed, 28 Aug 2024 14:15:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJSF-0000gB-Oc; Wed, 28 Aug 2024 14:15:23 +0000
Received: by outflank-mailman (input) for mailman id 784863;
 Wed, 28 Aug 2024 14:15:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8VpF=P3=cloud.com=edwin.torok@srs-se1.protection.inumbo.net>)
 id 1sjJSD-0000g5-RB
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 14:15:21 +0000
Received: from mail-oa1-x2a.google.com (mail-oa1-x2a.google.com
 [2001:4860:4864:20::2a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f503d3e5-6547-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 16:15:20 +0200 (CEST)
Received: by mail-oa1-x2a.google.com with SMTP id
 586e51a60fabf-268eec6c7c1so4535705fac.3
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 07:15:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f503d3e5-6547-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724854519; x=1725459319; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=sJZNtG3bBFxdf+oxP206xMOBzxraOp+5kHD+xYJrLc4=;
        b=WWVscQc5L6uoagundfjv9YHUphxRusSaSwVBch6JHvfmvbffwWS6o/mfzSMSBEN6YM
         m2J5ZNjnAxn07hnpjx9LZ4I6m3EbZQ/6wC87MArRIKKnEEa0u7clbWr0Aj0O5fQxiVkV
         4btBRnjzhw8HErHcKgh2e01Un3kh+YV3NlX2s=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724854519; x=1725459319;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=sJZNtG3bBFxdf+oxP206xMOBzxraOp+5kHD+xYJrLc4=;
        b=i+/nSXWhqShvbCjnpfLjHQ1jvJJy3xs5lvS7LiXGmpxoKXFdoNszIhhDw6Zk9JoOV1
         2+8mKo5O6tC5thhO7owmG2SbFsBSXwNJld+3y3X8PBRCiIWELCkdTwKh76gwmj/7usDl
         sYTI458Nhw05MX3SeQdfqiNnmCB2+3Pql7Pcztk2GeuI27N+T8bLpW/omr+1d1jwwnGM
         Pload8qx8XmNw324WxxvZygZzDNfdwDKjpLJmW2iAdP6CPJFah8rj/OM+1AXyb9YAVe+
         K0p7/Z/t6QzE66+eXl2c/jiZ11qNFZdN5Q9unif7yzzrYyX3EuYZU5dDrHhScKhGPsCX
         f24g==
X-Gm-Message-State: AOJu0Ywf2s8aGJxqHuS9UIoF0EFmRVZGMdJZZpCR40/p2rLnFefiOKYc
	7tvNh3Brad2TK9xeJ5dNKqAJq2u6qwkZ3qgjTpWn1irgSAQlaojcpCcJVRumnygJ4sxIBy213tc
	Su50qCRSllSM0/YNOKBt3F78kOggVwvKbHgeKfQ==
X-Google-Smtp-Source: AGHT+IEZHo9aVUAyCmyAsLyIUacC91+qeimCIe146baUuugw2F5R5hmhIENi++R5BhS0YuAX4oPDilK24t7y7+dq6vE=
X-Received: by 2002:a05:6870:8a25:b0:261:1dfb:3f35 with SMTP id
 586e51a60fabf-273e672a2a0mr19620923fac.48.1724854519241; Wed, 28 Aug 2024
 07:15:19 -0700 (PDT)
MIME-Version: 1.0
References: <20240828133033.2378322-1-andrew.cooper3@citrix.com>
In-Reply-To: <20240828133033.2378322-1-andrew.cooper3@citrix.com>
From: Edwin Torok <edwin.torok@cloud.com>
Date: Wed, 28 Aug 2024 15:15:08 +0100
Message-ID: <CAEfZLvmJAw5wiKu5BZokgpbHdAv6Msro_ANgJ06NmATWuHiMNA@mail.gmail.com>
Subject: Re: [PATCH] tools/ocaml: Factor out compatiblity handling
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, 
	Christian Lindig <christian.lindig@citrix.com>, David Scott <dave@recoil.org>, 
	Rob Hoes <Rob.Hoes@citrix.com>, Andrii Sultanov <andrii.sultanov@cloud.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Aug 28, 2024 at 2:30=E2=80=AFPM Andrew Cooper <andrew.cooper3@citri=
x.com> wrote:
>
> ... rather than having each library implement its own subset.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Christian Lindig <christian.lindig@citrix.com>
> CC: David Scott <dave@recoil.org>
> CC: Edwin T=C3=B6r=C3=B6k <edwin.torok@cloud.com>
> CC: Rob Hoes <Rob.Hoes@citrix.com>
> CC: Andrii Sultanov <andrii.sultanov@cloud.com>
>
> Broken out of a larger series, to help Andrii with his dynlib work.
> ---
>  tools/ocaml/libs/xc/Makefile        |  2 +-
>  tools/ocaml/libs/xc/xenctrl_stubs.c | 13 +++----------
>  tools/ocaml/libs/xen-caml-compat.h  | 23 +++++++++++++++++++++++
>  3 files changed, 27 insertions(+), 11 deletions(-)
>  create mode 100644 tools/ocaml/libs/xen-caml-compat.h
>
> diff --git a/tools/ocaml/libs/xc/Makefile b/tools/ocaml/libs/xc/Makefile
> index 1d9fecb06ef2..cdf4d01dac52 100644
> --- a/tools/ocaml/libs/xc/Makefile
> +++ b/tools/ocaml/libs/xc/Makefile
> @@ -2,7 +2,7 @@ OCAML_TOPLEVEL=3D$(CURDIR)/../..
>  XEN_ROOT=3D$(OCAML_TOPLEVEL)/../..
>  include $(OCAML_TOPLEVEL)/common.make
>
> -CFLAGS +=3D -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
> +CFLAGS +=3D -I../ -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
>  CFLAGS +=3D $(APPEND_CFLAGS)
>  OCAMLINCLUDE +=3D -I ../mmap -I ../eventchn
>
> diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xe=
nctrl_stubs.c
> index a52908012960..c78191f95abc 100644
> --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
> +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
> @@ -25,6 +25,8 @@
>  #include <caml/fail.h>
>  #include <caml/callback.h>
>
> +#include "xen-caml-compat.h"
> +
>  #include <sys/mman.h>
>  #include <stdint.h>
>  #include <string.h>
> @@ -37,14 +39,6 @@
>
>  #include "mmap_stubs.h"
>
> -#ifndef Val_none
> -#define Val_none (Val_int(0))
> -#endif
> -
> -#ifndef Tag_some
> -#define Tag_some 0
> -#endif
> -
>  static inline xc_interface *xch_of_val(value v)
>  {
>         xc_interface *xch =3D *(xc_interface **)Data_custom_val(v);
> @@ -744,8 +738,7 @@ CAMLprim value stub_xc_evtchn_status(value xch_val, v=
alue domid, value port)
>         Store_field(result_status, 0, Val_int(status.vcpu));
>         Store_field(result_status, 1, stat);
>
> -       result =3D caml_alloc_small(1, Tag_some);
> -       Store_field(result, 0, result_status);
> +       result =3D caml_alloc_some(result_status);
>
>         CAMLreturn(result);
>  }
> diff --git a/tools/ocaml/libs/xen-caml-compat.h b/tools/ocaml/libs/xen-ca=
ml-compat.h
> new file mode 100644
> index 000000000000..b4a0ca4ce90c
> --- /dev/null
> +++ b/tools/ocaml/libs/xen-caml-compat.h
> @@ -0,0 +1,23 @@
> +/* SPDX-License-Identifier: LGPL-2.1-only WITH OCaml-LGPL-linking-except=
ion */
> +#ifndef XEN_CAML_COMPAT_H
> +#define XEN_CAML_COMPAT_H
> +
> +#ifndef Val_none /* Option handling.  Compat for Ocaml < 4.12 */
> +
> +#define Val_none Val_int(0)
> +#define Tag_some 0
> +#define Some_val(v) Field(v, 0)
> +
> +static inline value caml_alloc_some(value v)
> +{
> +    CAMLparam1(v);
> +
> +    value some =3D caml_alloc_small(1, Tag_some);
> +    Store_field(some, 0, v);

The compiler uses Field() rather than Store_field() here.
I think using Store_field here can potentially read uninitialized
data, because 'caml_alloc_small' gives you uninitialized memory
that you must immediately fill with valid values.
Looking at the implementation Store_field calls caml_modify which will
read the old value to figure out whether it was in minor or major
heap,
and doing that on uninitialized data is unpredictable.

We should follow what the manual says and use Field() when
caml_alloc_small() is used, and use Store_field() when caml_alloc() is
used,
and not attempt to mix them:
See https://ocaml.org/manual/5.2/intfc.html#ss:c-low-level-gc-harmony

> +
> +    CAMLreturn(some);
> +}
> +
> +#endif /* !Val_none */
> +
> +#endif /* XEN_CAML_COMPAT_H */
>
> base-commit: 75c64db3722f0245137a1e8cfd3435f4790d0fd7
> --
> 2.39.2
>


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 14:16:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 14:16:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784871.1194274 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJTc-00024g-K4; Wed, 28 Aug 2024 14:16:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784871.1194274; Wed, 28 Aug 2024 14:16:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJTc-000243-Dq; Wed, 28 Aug 2024 14:16:48 +0000
Received: by outflank-mailman (input) for mailman id 784871;
 Wed, 28 Aug 2024 14:16:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjJTb-00021C-TI; Wed, 28 Aug 2024 14:16:47 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjJTb-0001aa-L9; Wed, 28 Aug 2024 14:16:47 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjJTb-00011r-8S; Wed, 28 Aug 2024 14:16:47 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjJTb-0000aa-7z; Wed, 28 Aug 2024 14:16:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=1LtWxDtOTTuMTDh2kVR3j2YOSVufncMzOupTrBGtPx4=; b=uxcdgI12KZdGRH3uhZBIXOIXFU
	OaNBZFfjGa0Rh7Vpa6evYipwPkSwVDUqDUYtTWc6PxLAq3ZH7f5Li6Z4pnD/5EUiTd3A07IZtnQ7W
	gCg7VVgQE8dW2I1ExjNus6LEqczO5wZVsyi7MALr+8JsTMTUwilvg0q7BbWYjREIWcBo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187374-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187374: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=48bdeaf2fa49513d4be53588100807f269c36997
X-Osstest-Versions-That:
    libvirt=1b815465d9d523aacc4b7ab63c247cc2e6cefa64
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 14:16:47 +0000

flight 187374 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187374/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187357
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 libvirt              48bdeaf2fa49513d4be53588100807f269c36997
baseline version:
 libvirt              1b815465d9d523aacc4b7ab63c247cc2e6cefa64

Last test of basis   187357  2024-08-27 04:22:23 Z    1 days
Testing same since   187374  2024-08-28 04:18:53 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andi Chandler <andi@gowling.com>
  Fedora Weblate Translation <i18n@lists.fedoraproject.org>
  jianqing yan <yanjianqing@kylinos.cn>
  Jiri Denemark <jdenemar@redhat.com>
  Peter Krempa <pkrempa@redhat.com>
  Sergey Dyasli <sergey.dyasli@nutanix.com>
  Weblate <noreply@weblate.org>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   1b815465d9..48bdeaf2fa  48bdeaf2fa49513d4be53588100807f269c36997 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 14:16:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 14:16:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784870.1194267 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJTc-00021T-9j; Wed, 28 Aug 2024 14:16:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784870.1194267; Wed, 28 Aug 2024 14:16:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJTc-00021L-6d; Wed, 28 Aug 2024 14:16:48 +0000
Received: by outflank-mailman (input) for mailman id 784870;
 Wed, 28 Aug 2024 14:16: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=8VpF=P3=cloud.com=edwin.torok@srs-se1.protection.inumbo.net>)
 id 1sjJTb-0001tx-F5
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 14:16:47 +0000
Received: from mail-oo1-xc33.google.com (mail-oo1-xc33.google.com
 [2607:f8b0:4864:20::c33])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 27bc15b8-6548-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 16:16:45 +0200 (CEST)
Received: by mail-oo1-xc33.google.com with SMTP id
 006d021491bc7-5de92d2e9b3so2305701eaf.2
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 07:16:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 27bc15b8-6548-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724854604; x=1725459404; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=l6mbQVo3apXE3R6cHuuqLd86Pc8uhYEsQ0417KxFfQ8=;
        b=fEBuiO/3ZHGCNciyl02e+jkixjMj+xBgi9RFa5/KSQu7oJ4ZsOPaSzsj43BEjC6VmC
         V9eGxWzaj5keMCtJj3C74kx/xFqpO6aGym8Yb8+4EpDbfysp+GP4sdjwJ6FeJvnWHF8O
         NsxV2dVJUOFT5LutNW76Oez2DF32RrVIz/OjY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724854604; x=1725459404;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=l6mbQVo3apXE3R6cHuuqLd86Pc8uhYEsQ0417KxFfQ8=;
        b=XwBQXl/sDwghF0g2YI9lof/LOk7oQBjYpxFzA1oc5d4/Xoz/d80JIHUm3T2Pcg1pa9
         HeVLRH4q/FkSeajq/xjhJrObQU6rbVfjfRLVRtoMIrwVtUFEp0LkBQotu4B9EvD24rYq
         ivV/p4Qr9I2BqWa6hJXwhf6ls0RzgWpMBeUaovRBvP3D4lOqLwIYDz5+hxGCN/WgasYx
         zFBbI9tct703PuecdGU9B+CAzeZlLDclTcsIIAkpPuHamaDIRa0yeREL21zeXbGePEQQ
         EeXb62h0rIjjLIkX2SQylDgE8k9K6UNITl+psUIb2y+xWqMhMSxElVtNz8d/hDmME7dL
         lyIw==
X-Gm-Message-State: AOJu0Yxr1J/rHD8ZJ+nCXDCtOsJuFgwhCQyC9Ir+7L/bVPbcre/u/rYS
	DWbXLM5oR5MeHAkt+OTrbwxhYEll9NKLZn0EPMQ5xvzSs+3AOSf3rGa4hOvK+ATNOW2BtWXHwx5
	A8+VyQ4aOLL73MgOFbNKSUAvGZL3463CqcX0QHg==
X-Google-Smtp-Source: AGHT+IFTAYJdBSbDfzqob4kRNU367vEbNkvLt7IUvnPTeOdLvUIMnH47f77F2d6yu9LNWLpfRJO6YlPlGCuDYvV86uA=
X-Received: by 2002:a05:6871:ca11:b0:270:4d48:6be2 with SMTP id
 586e51a60fabf-2777d1f3f58mr2051460fac.26.1724854604336; Wed, 28 Aug 2024
 07:16:44 -0700 (PDT)
MIME-Version: 1.0
References: <20240828133033.2378322-1-andrew.cooper3@citrix.com> <CAEfZLvmJAw5wiKu5BZokgpbHdAv6Msro_ANgJ06NmATWuHiMNA@mail.gmail.com>
In-Reply-To: <CAEfZLvmJAw5wiKu5BZokgpbHdAv6Msro_ANgJ06NmATWuHiMNA@mail.gmail.com>
From: Edwin Torok <edwin.torok@cloud.com>
Date: Wed, 28 Aug 2024 15:16:33 +0100
Message-ID: <CAEfZLvm48sc50deiuvhoWfh0no=EHfCO4JpXKLvNPASAJZ8Whg@mail.gmail.com>
Subject: Re: [PATCH] tools/ocaml: Factor out compatiblity handling
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, 
	Christian Lindig <christian.lindig@citrix.com>, David Scott <dave@recoil.org>, 
	Rob Hoes <Rob.Hoes@citrix.com>, Andrii Sultanov <andrii.sultanov@cloud.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Aug 28, 2024 at 3:15=E2=80=AFPM Edwin Torok <edwin.torok@cloud.com>=
 wrote:
>
> On Wed, Aug 28, 2024 at 2:30=E2=80=AFPM Andrew Cooper <andrew.cooper3@cit=
rix.com> wrote:
> >
> > ... rather than having each library implement its own subset.
> >
> > Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > ---
> > CC: Christian Lindig <christian.lindig@citrix.com>
> > CC: David Scott <dave@recoil.org>
> > CC: Edwin T=C3=B6r=C3=B6k <edwin.torok@cloud.com>
> > CC: Rob Hoes <Rob.Hoes@citrix.com>
> > CC: Andrii Sultanov <andrii.sultanov@cloud.com>
> >
> > Broken out of a larger series, to help Andrii with his dynlib work.
> > ---
> >  tools/ocaml/libs/xc/Makefile        |  2 +-
> >  tools/ocaml/libs/xc/xenctrl_stubs.c | 13 +++----------
> >  tools/ocaml/libs/xen-caml-compat.h  | 23 +++++++++++++++++++++++
> >  3 files changed, 27 insertions(+), 11 deletions(-)
> >  create mode 100644 tools/ocaml/libs/xen-caml-compat.h
> >
> > diff --git a/tools/ocaml/libs/xc/Makefile b/tools/ocaml/libs/xc/Makefil=
e
> > index 1d9fecb06ef2..cdf4d01dac52 100644
> > --- a/tools/ocaml/libs/xc/Makefile
> > +++ b/tools/ocaml/libs/xc/Makefile
> > @@ -2,7 +2,7 @@ OCAML_TOPLEVEL=3D$(CURDIR)/../..
> >  XEN_ROOT=3D$(OCAML_TOPLEVEL)/../..
> >  include $(OCAML_TOPLEVEL)/common.make
> >
> > -CFLAGS +=3D -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
> > +CFLAGS +=3D -I../ -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
> >  CFLAGS +=3D $(APPEND_CFLAGS)
> >  OCAMLINCLUDE +=3D -I ../mmap -I ../eventchn
> >
> > diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/=
xenctrl_stubs.c
> > index a52908012960..c78191f95abc 100644
> > --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
> > +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
> > @@ -25,6 +25,8 @@
> >  #include <caml/fail.h>
> >  #include <caml/callback.h>
> >
> > +#include "xen-caml-compat.h"
> > +
> >  #include <sys/mman.h>
> >  #include <stdint.h>
> >  #include <string.h>
> > @@ -37,14 +39,6 @@
> >
> >  #include "mmap_stubs.h"
> >
> > -#ifndef Val_none
> > -#define Val_none (Val_int(0))
> > -#endif
> > -
> > -#ifndef Tag_some
> > -#define Tag_some 0
> > -#endif
> > -
> >  static inline xc_interface *xch_of_val(value v)
> >  {
> >         xc_interface *xch =3D *(xc_interface **)Data_custom_val(v);
> > @@ -744,8 +738,7 @@ CAMLprim value stub_xc_evtchn_status(value xch_val,=
 value domid, value port)
> >         Store_field(result_status, 0, Val_int(status.vcpu));
> >         Store_field(result_status, 1, stat);
> >
> > -       result =3D caml_alloc_small(1, Tag_some);
> > -       Store_field(result, 0, result_status);
> > +       result =3D caml_alloc_some(result_status);
> >
> >         CAMLreturn(result);
> >  }
> > diff --git a/tools/ocaml/libs/xen-caml-compat.h b/tools/ocaml/libs/xen-=
caml-compat.h
> > new file mode 100644
> > index 000000000000..b4a0ca4ce90c
> > --- /dev/null
> > +++ b/tools/ocaml/libs/xen-caml-compat.h
> > @@ -0,0 +1,23 @@
> > +/* SPDX-License-Identifier: LGPL-2.1-only WITH OCaml-LGPL-linking-exce=
ption */
> > +#ifndef XEN_CAML_COMPAT_H
> > +#define XEN_CAML_COMPAT_H
> > +
> > +#ifndef Val_none /* Option handling.  Compat for Ocaml < 4.12 */
> > +
> > +#define Val_none Val_int(0)
> > +#define Tag_some 0
> > +#define Some_val(v) Field(v, 0)
> > +
> > +static inline value caml_alloc_some(value v)
> > +{
> > +    CAMLparam1(v);
> > +
> > +    value some =3D caml_alloc_small(1, Tag_some);
> > +    Store_field(some, 0, v);
>
> The compiler uses Field() rather than Store_field() here.
> I think using Store_field here can potentially read uninitialized
> data, because 'caml_alloc_small' gives you uninitialized memory
> that you must immediately fill with valid values.
> Looking at the implementation Store_field calls caml_modify which will
> read the old value to figure out whether it was in minor or major
> heap,
> and doing that on uninitialized data is unpredictable.
>
> We should follow what the manual says and use Field() when
> caml_alloc_small() is used, and use Store_field() when caml_alloc() is
> used,
> and not attempt to mix them:
> See https://ocaml.org/manual/5.2/intfc.html#ss:c-low-level-gc-harmony

Which probably means we've got a bunch of other pre-existing bugs like
these that we need to fix,
as otherwise we do quite a lot of operations on uninitialized data...

>
> > +
> > +    CAMLreturn(some);
> > +}
> > +
> > +#endif /* !Val_none */
> > +
> > +#endif /* XEN_CAML_COMPAT_H */
> >
> > base-commit: 75c64db3722f0245137a1e8cfd3435f4790d0fd7
> > --
> > 2.39.2
> >


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 14:20:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 14:20:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784883.1194288 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJXP-000426-2u; Wed, 28 Aug 2024 14:20:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784883.1194288; Wed, 28 Aug 2024 14:20:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJXO-00041z-Vi; Wed, 28 Aug 2024 14:20:42 +0000
Received: by outflank-mailman (input) for mailman id 784883;
 Wed, 28 Aug 2024 14:20:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjJXN-00041t-Ja
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 14:20:41 +0000
Received: from mail-oa1-x36.google.com (mail-oa1-x36.google.com
 [2001:4860:4864:20::36])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b3ab33a9-6548-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 16:20:40 +0200 (CEST)
Received: by mail-oa1-x36.google.com with SMTP id
 586e51a60fabf-27022a3536dso4837755fac.2
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 07:20:40 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 af79cd13be357-7a67f341defsm643471685a.28.2024.08.28.07.20.37
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 07:20:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b3ab33a9-6548-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724854839; x=1725459639; 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=ODmkmzjojR3IXzIVniL2oQ6WHIyDJC/mL6mCiOia3Aw=;
        b=TIJbNPG8gGSh8+e++SWZ5KF2WMOZP+hSCz0uVTFX9BzVueDbhbhoH8ZvteGyVRZEor
         42eupB4M1D67R3Fwg/OFfGlH4AkYAxlkNY2E3Hwu+BAR9mgH7QVG32zB412cuacplEJ3
         GhEe7C27VzWo1aUZ76HzNLavbqc5956wQBkis=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724854839; x=1725459639;
        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=ODmkmzjojR3IXzIVniL2oQ6WHIyDJC/mL6mCiOia3Aw=;
        b=lGButjLNOdkKhwZL8NVtmu3rmWLOPX50UwnLxWdrrHnlv6d3aswfNZjIYqUffPLCZf
         AFRY4tn5cjf+yCH1Ndwwxef30peJSaxSASTlyB1ouH+uDa9eJSxLHe9zmznowsORUAcs
         s7/YH1skhdLwnZWN2VjnB0Frk8qkUxUUIBwedg2xR/6KOGBswnJnOf3WHwmZgZKKZri8
         LLgAqDtEoA1EX7GBBzKNF83R81E9LLY/3qfHwcNXhYBDmEl5kI1gCIHjq9BJopljH5rE
         kkiSxTwQufmSw2ROb3/g7vqa06cDgwdB0wcxvS8tckmiS7lXYwO92h6VZ5XORe2KB2jE
         pfrA==
X-Gm-Message-State: AOJu0YxODrPRsnZ/VgLRiajULbuf8QU/BP5oNNT6SRLoEBa9cbjXP+tU
	0dq0MAj7Ky3KZZo2SD2C4wEMzK+Rq78RUIW0gTWcU01w0cMbJCGZj3169CARi88=
X-Google-Smtp-Source: AGHT+IFmCinpX1DrG+DDqk3XRxAW/6A89MXsB1oQphwZ13V726wuYQKVZrL9fS0OvuL5lZNwguij+A==
X-Received: by 2002:a05:6870:96a1:b0:261:26be:2606 with SMTP id 586e51a60fabf-273e64e6c5emr19532297fac.25.1724854839096;
        Wed, 28 Aug 2024 07:20:39 -0700 (PDT)
Message-ID: <a30f26be-b460-449b-a80c-f5d3a85f0550@citrix.com>
Date: Wed, 28 Aug 2024 15:20:35 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] tools/ocaml: Factor out compatiblity handling
To: Edwin Torok <edwin.torok@cloud.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Christian Lindig <christian.lindig@citrix.com>, David Scott
 <dave@recoil.org>, Rob Hoes <Rob.Hoes@citrix.com>,
 Andrii Sultanov <andrii.sultanov@cloud.com>
References: <20240828133033.2378322-1-andrew.cooper3@citrix.com>
 <CAEfZLvmJAw5wiKu5BZokgpbHdAv6Msro_ANgJ06NmATWuHiMNA@mail.gmail.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <CAEfZLvmJAw5wiKu5BZokgpbHdAv6Msro_ANgJ06NmATWuHiMNA@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28/08/2024 3:15 pm, Edwin Torok wrote:
> On Wed, Aug 28, 2024 at 2:30 PM Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> ... rather than having each library implement its own subset.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Christian Lindig <christian.lindig@citrix.com>
>> CC: David Scott <dave@recoil.org>
>> CC: Edwin Török <edwin.torok@cloud.com>
>> CC: Rob Hoes <Rob.Hoes@citrix.com>
>> CC: Andrii Sultanov <andrii.sultanov@cloud.com>
>>
>> Broken out of a larger series, to help Andrii with his dynlib work.
>> ---
>>  tools/ocaml/libs/xc/Makefile        |  2 +-
>>  tools/ocaml/libs/xc/xenctrl_stubs.c | 13 +++----------
>>  tools/ocaml/libs/xen-caml-compat.h  | 23 +++++++++++++++++++++++
>>  3 files changed, 27 insertions(+), 11 deletions(-)
>>  create mode 100644 tools/ocaml/libs/xen-caml-compat.h
>>
>> diff --git a/tools/ocaml/libs/xc/Makefile b/tools/ocaml/libs/xc/Makefile
>> index 1d9fecb06ef2..cdf4d01dac52 100644
>> --- a/tools/ocaml/libs/xc/Makefile
>> +++ b/tools/ocaml/libs/xc/Makefile
>> @@ -2,7 +2,7 @@ OCAML_TOPLEVEL=$(CURDIR)/../..
>>  XEN_ROOT=$(OCAML_TOPLEVEL)/../..
>>  include $(OCAML_TOPLEVEL)/common.make
>>
>> -CFLAGS += -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
>> +CFLAGS += -I../ -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
>>  CFLAGS += $(APPEND_CFLAGS)
>>  OCAMLINCLUDE += -I ../mmap -I ../eventchn
>>
>> diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
>> index a52908012960..c78191f95abc 100644
>> --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
>> +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
>> @@ -25,6 +25,8 @@
>>  #include <caml/fail.h>
>>  #include <caml/callback.h>
>>
>> +#include "xen-caml-compat.h"
>> +
>>  #include <sys/mman.h>
>>  #include <stdint.h>
>>  #include <string.h>
>> @@ -37,14 +39,6 @@
>>
>>  #include "mmap_stubs.h"
>>
>> -#ifndef Val_none
>> -#define Val_none (Val_int(0))
>> -#endif
>> -
>> -#ifndef Tag_some
>> -#define Tag_some 0
>> -#endif
>> -
>>  static inline xc_interface *xch_of_val(value v)
>>  {
>>         xc_interface *xch = *(xc_interface **)Data_custom_val(v);
>> @@ -744,8 +738,7 @@ CAMLprim value stub_xc_evtchn_status(value xch_val, value domid, value port)
>>         Store_field(result_status, 0, Val_int(status.vcpu));
>>         Store_field(result_status, 1, stat);
>>
>> -       result = caml_alloc_small(1, Tag_some);
>> -       Store_field(result, 0, result_status);
>> +       result = caml_alloc_some(result_status);
>>
>>         CAMLreturn(result);
>>  }
>> diff --git a/tools/ocaml/libs/xen-caml-compat.h b/tools/ocaml/libs/xen-caml-compat.h
>> new file mode 100644
>> index 000000000000..b4a0ca4ce90c
>> --- /dev/null
>> +++ b/tools/ocaml/libs/xen-caml-compat.h
>> @@ -0,0 +1,23 @@
>> +/* SPDX-License-Identifier: LGPL-2.1-only WITH OCaml-LGPL-linking-exception */
>> +#ifndef XEN_CAML_COMPAT_H
>> +#define XEN_CAML_COMPAT_H
>> +
>> +#ifndef Val_none /* Option handling.  Compat for Ocaml < 4.12 */
>> +
>> +#define Val_none Val_int(0)
>> +#define Tag_some 0
>> +#define Some_val(v) Field(v, 0)
>> +
>> +static inline value caml_alloc_some(value v)
>> +{
>> +    CAMLparam1(v);
>> +
>> +    value some = caml_alloc_small(1, Tag_some);
>> +    Store_field(some, 0, v);
> The compiler uses Field() rather than Store_field() here.
> I think using Store_field here can potentially read uninitialized
> data, because 'caml_alloc_small' gives you uninitialized memory
> that you must immediately fill with valid values.
> Looking at the implementation Store_field calls caml_modify which will
> read the old value to figure out whether it was in minor or major
> heap,
> and doing that on uninitialized data is unpredictable.
>
> We should follow what the manual says and use Field() when
> caml_alloc_small() is used, and use Store_field() when caml_alloc() is
> used,
> and not attempt to mix them:
> See https://ocaml.org/manual/5.2/intfc.html#ss:c-low-level-gc-harmony

Lovely, this got changed in Ocaml with no information or justification...

https://github.com/ocaml/ocaml/pull/9819

I'll resync this locally, but I shaltn't repost.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 14:27:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 14:27:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784892.1194298 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJe3-0005H8-OV; Wed, 28 Aug 2024 14:27:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784892.1194298; Wed, 28 Aug 2024 14:27:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJe3-0005H1-LX; Wed, 28 Aug 2024 14:27:35 +0000
Received: by outflank-mailman (input) for mailman id 784892;
 Wed, 28 Aug 2024 14:27:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=8VpF=P3=cloud.com=edwin.torok@srs-se1.protection.inumbo.net>)
 id 1sjJe2-0005FM-5G
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 14:27:34 +0000
Received: from mail-oa1-x2a.google.com (mail-oa1-x2a.google.com
 [2001:4860:4864:20::2a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a9a458c6-6549-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 16:27:33 +0200 (CEST)
Received: by mail-oa1-x2a.google.com with SMTP id
 586e51a60fabf-27032e6dbf2so4323494fac.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 07:27:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a9a458c6-6549-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724855252; x=1725460052; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=qa/H1ncEY8uYMIx0VFMRocUlTKAMW0akNfBkAXUhGJE=;
        b=LcBMOROiaW7YlEw1OY5n/0ip9HU3jc1JbBJ6bHtIsSdC4Ez+FtVHySY21Tegg1VNq/
         H3GgQVbkBW3XrfMDyaoRzGQQBi2UVAsEJyJJ8zw+G1a8VWRZ3OErzFtuAA1ai+wldCJU
         8FcEOeq5ZAqaPBTPIrqJ2fdZLKGH9UsrfJXYU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724855252; x=1725460052;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=qa/H1ncEY8uYMIx0VFMRocUlTKAMW0akNfBkAXUhGJE=;
        b=LS9tKf8VgM4ZFPli4i6hYyNfkrQBQm0G1FW75OCb9xBBMmoWl/+FfKKaa3NpWZMyNa
         OFP/bI+9jlXnh02cU5ahBuHKzXe8UTE0FJCCs8fO9NZR/GFNc+Ks06yggAg2La9EbxyO
         G5deDrary018HG188siO0RKHDBK8psyVKZ27Owf/X7Aqv7Df4+HwkycI22AqALKjYp9T
         lJMP0QAmUEBjBR787LkOwC64DAycEz14R2oPBHgXgDMXZ6Tesan4TlguPJmdYpkOSOCn
         ebrSvxM3hf/VuZAV9/3baecKPs5PiiWY3NfNbjpf7KK3I7sCI3WFDDBCwNUsZC7U4LYA
         349w==
X-Gm-Message-State: AOJu0YxIHKnmiPjzvf+vgJWrQgVptvNZT1MOBM4WAFW3+huICccOr28D
	A6NBjKXG4aytzPnRd02gsuXDQNz4HLEjwMW/5omWAldhkQdd2zacDg11ksF1OQlK5QkV5XMC6Ov
	iQlc/DqLkP+zyJCwUgSvINVKidyxKe6wR+on6/z674On4PEjeV3c=
X-Google-Smtp-Source: AGHT+IE8dGawMqYldqAp2Sjm3ye7oP4gKigex6EsiKVHb+FX4IFg/agc+1Er4TULw/su0p3I+BLrIewhIe2UEGGxaBU=
X-Received: by 2002:a05:6871:286:b0:260:fd20:a880 with SMTP id
 586e51a60fabf-273e674bcc8mr17919272fac.42.1724855251949; Wed, 28 Aug 2024
 07:27:31 -0700 (PDT)
MIME-Version: 1.0
References: <20240828133033.2378322-1-andrew.cooper3@citrix.com>
 <CAEfZLvmJAw5wiKu5BZokgpbHdAv6Msro_ANgJ06NmATWuHiMNA@mail.gmail.com> <a30f26be-b460-449b-a80c-f5d3a85f0550@citrix.com>
In-Reply-To: <a30f26be-b460-449b-a80c-f5d3a85f0550@citrix.com>
From: Edwin Torok <edwin.torok@cloud.com>
Date: Wed, 28 Aug 2024 15:27:20 +0100
Message-ID: <CAEfZLvkTpWxcX+3FRnWJHfwmegDPgbaCkVJCoN0hbbf7hSdvgw@mail.gmail.com>
Subject: Re: [PATCH] tools/ocaml: Factor out compatiblity handling
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>, 
	Christian Lindig <christian.lindig@citrix.com>, David Scott <dave@recoil.org>, 
	Rob Hoes <Rob.Hoes@citrix.com>, Andrii Sultanov <andrii.sultanov@cloud.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Aug 28, 2024 at 3:20=E2=80=AFPM Andrew Cooper <andrew.cooper3@citri=
x.com> wrote:
>
> On 28/08/2024 3:15 pm, Edwin Torok wrote:
> > On Wed, Aug 28, 2024 at 2:30=E2=80=AFPM Andrew Cooper <andrew.cooper3@c=
itrix.com> wrote:
> >> ... rather than having each library implement its own subset.
> >>
> >> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> >> ---
> >> CC: Christian Lindig <christian.lindig@citrix.com>
> >> CC: David Scott <dave@recoil.org>
> >> CC: Edwin T=C3=B6r=C3=B6k <edwin.torok@cloud.com>
> >> CC: Rob Hoes <Rob.Hoes@citrix.com>
> >> CC: Andrii Sultanov <andrii.sultanov@cloud.com>
> >>
> >> Broken out of a larger series, to help Andrii with his dynlib work.
> >> ---
> >>  tools/ocaml/libs/xc/Makefile        |  2 +-
> >>  tools/ocaml/libs/xc/xenctrl_stubs.c | 13 +++----------
> >>  tools/ocaml/libs/xen-caml-compat.h  | 23 +++++++++++++++++++++++
> >>  3 files changed, 27 insertions(+), 11 deletions(-)
> >>  create mode 100644 tools/ocaml/libs/xen-caml-compat.h
> >>
> >> diff --git a/tools/ocaml/libs/xc/Makefile b/tools/ocaml/libs/xc/Makefi=
le
> >> index 1d9fecb06ef2..cdf4d01dac52 100644
> >> --- a/tools/ocaml/libs/xc/Makefile
> >> +++ b/tools/ocaml/libs/xc/Makefile
> >> @@ -2,7 +2,7 @@ OCAML_TOPLEVEL=3D$(CURDIR)/../..
> >>  XEN_ROOT=3D$(OCAML_TOPLEVEL)/../..
> >>  include $(OCAML_TOPLEVEL)/common.make
> >>
> >> -CFLAGS +=3D -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
> >> +CFLAGS +=3D -I../ -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest=
)
> >>  CFLAGS +=3D $(APPEND_CFLAGS)
> >>  OCAMLINCLUDE +=3D -I ../mmap -I ../eventchn
> >>
> >> diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc=
/xenctrl_stubs.c
> >> index a52908012960..c78191f95abc 100644
> >> --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
> >> +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
> >> @@ -25,6 +25,8 @@
> >>  #include <caml/fail.h>
> >>  #include <caml/callback.h>
> >>
> >> +#include "xen-caml-compat.h"
> >> +
> >>  #include <sys/mman.h>
> >>  #include <stdint.h>
> >>  #include <string.h>
> >> @@ -37,14 +39,6 @@
> >>
> >>  #include "mmap_stubs.h"
> >>
> >> -#ifndef Val_none
> >> -#define Val_none (Val_int(0))
> >> -#endif
> >> -
> >> -#ifndef Tag_some
> >> -#define Tag_some 0
> >> -#endif
> >> -
> >>  static inline xc_interface *xch_of_val(value v)
> >>  {
> >>         xc_interface *xch =3D *(xc_interface **)Data_custom_val(v);
> >> @@ -744,8 +738,7 @@ CAMLprim value stub_xc_evtchn_status(value xch_val=
, value domid, value port)
> >>         Store_field(result_status, 0, Val_int(status.vcpu));
> >>         Store_field(result_status, 1, stat);
> >>
> >> -       result =3D caml_alloc_small(1, Tag_some);
> >> -       Store_field(result, 0, result_status);
> >> +       result =3D caml_alloc_some(result_status);
> >>
> >>         CAMLreturn(result);
> >>  }
> >> diff --git a/tools/ocaml/libs/xen-caml-compat.h b/tools/ocaml/libs/xen=
-caml-compat.h
> >> new file mode 100644
> >> index 000000000000..b4a0ca4ce90c
> >> --- /dev/null
> >> +++ b/tools/ocaml/libs/xen-caml-compat.h
> >> @@ -0,0 +1,23 @@
> >> +/* SPDX-License-Identifier: LGPL-2.1-only WITH OCaml-LGPL-linking-exc=
eption */
> >> +#ifndef XEN_CAML_COMPAT_H
> >> +#define XEN_CAML_COMPAT_H
> >> +
> >> +#ifndef Val_none /* Option handling.  Compat for Ocaml < 4.12 */
> >> +
> >> +#define Val_none Val_int(0)
> >> +#define Tag_some 0
> >> +#define Some_val(v) Field(v, 0)
> >> +
> >> +static inline value caml_alloc_some(value v)
> >> +{
> >> +    CAMLparam1(v);
> >> +
> >> +    value some =3D caml_alloc_small(1, Tag_some);
> >> +    Store_field(some, 0, v);
> > The compiler uses Field() rather than Store_field() here.
> > I think using Store_field here can potentially read uninitialized
> > data, because 'caml_alloc_small' gives you uninitialized memory
> > that you must immediately fill with valid values.
> > Looking at the implementation Store_field calls caml_modify which will
> > read the old value to figure out whether it was in minor or major
> > heap,
> > and doing that on uninitialized data is unpredictable.
> >
> > We should follow what the manual says and use Field() when
> > caml_alloc_small() is used, and use Store_field() when caml_alloc() is
> > used,
> > and not attempt to mix them:
> > See https://ocaml.org/manual/5.2/intfc.html#ss:c-low-level-gc-harmony
>
> Lovely, this got changed in Ocaml with no information or justification...
>
> https://github.com/ocaml/ocaml/pull/9819
>

Looking at the code more it only dereferences the old value if
Is_young returns false. And Is_young is done as a pointer comparison.
Newly allocated values will live in the young (minor) heap by default
and you're not allowed to have a GC run between caml_alloc_small and
Store_field anyway.
So in practice Store_field is probably OK, but is on very dangerous
ground as it relies on an implementation detail.

> I'll resync this locally, but I shaltn't repost.
>
> ~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 14:28:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 14:28:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784899.1194308 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJeb-00062a-5Y; Wed, 28 Aug 2024 14:28:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784899.1194308; Wed, 28 Aug 2024 14:28:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJeb-00062T-1b; Wed, 28 Aug 2024 14:28:09 +0000
Received: by outflank-mailman (input) for mailman id 784899;
 Wed, 28 Aug 2024 14:28:07 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjJeZ-00062C-9D; Wed, 28 Aug 2024 14:28:07 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjJeZ-0001la-3k; Wed, 28 Aug 2024 14:28:07 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjJeY-0001Qx-LL; Wed, 28 Aug 2024 14:28:06 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjJeY-0006Yj-Ki; Wed, 28 Aug 2024 14:28:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=+yiTx1I+hdMlRCl2nC92YTQ1wCKl9eXezEJ+hnaNxFU=; b=6YzTz+N4pHni4cgVV+86eYndCY
	ILF8pD4FETI5oThCVjI/JOpu7Kz07yV9rMLgeHKQ8TnpdEy+WUYxJtwmttWcQBoHbw7HR/La+ua7z
	zYaH/n6hiRBA3KxQpRHkGqScS1z0K1/U4LxQIlaMOgRZ9FShMEMNk/JppEmPHbBfhzWg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187382-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187382: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=a0ac7cf67afd382b4bd13a402bb6100a435b5b7b
X-Osstest-Versions-That:
    ovmf=90d0ec17e7074905de347ccf2accdd6b8e8ee968
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 14:28:06 +0000

flight 187382 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187382/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 a0ac7cf67afd382b4bd13a402bb6100a435b5b7b
baseline version:
 ovmf                 90d0ec17e7074905de347ccf2accdd6b8e8ee968

Last test of basis   187380  2024-08-28 10:11:30 Z    0 days
Testing same since   187382  2024-08-28 12:45:12 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Linus Liu <linus.liu@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   90d0ec17e7..a0ac7cf67a  a0ac7cf67afd382b4bd13a402bb6100a435b5b7b -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 14:29:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 14:29:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784908.1194318 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJfV-0006bu-Ek; Wed, 28 Aug 2024 14:29:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784908.1194318; Wed, 28 Aug 2024 14:29:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJfV-0006bn-Bt; Wed, 28 Aug 2024 14:29:05 +0000
Received: by outflank-mailman (input) for mailman id 784908;
 Wed, 28 Aug 2024 14:29:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=aBH1=P3=bounce.vates.tech=bounce-md_30504962.66cf342c.v1-a0a6dfb6c83541049680e3dfd81c52eb@srs-se1.protection.inumbo.net>)
 id 1sjJfT-0005vz-MC
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 14:29:04 +0000
Received: from mail187-32.suw11.mandrillapp.com
 (mail187-32.suw11.mandrillapp.com [198.2.187.32])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id de59e257-6549-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 16:29:01 +0200 (CEST)
Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail187-32.suw11.mandrillapp.com (Mailchimp) with ESMTP id
 4Wv6H01R8JzQXg8kD
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 14:29:00 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 a0a6dfb6c83541049680e3dfd81c52eb; Wed, 28 Aug 2024 14:29:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: de59e257-6549-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724855340; x=1725115840;
	bh=HhiV0BNU0RIa9UKRXwsR/IwnP8IZKOE7MjdjteLDQUc=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=bpZeitchsHNxbP6mPNEZnLDqKrIgoKisUsnRce27ClkpZKnihaOwBt6K3EHfILrWn
	 rBCQsO5/oyBTFXhFi0Iq8Mezgpq63Ej3CG6rfRjr8R0qa/99wU1dVCjn/+4u7/zrma
	 m51mHmUjtLyXv0dRaSTAo7bJCQA23o/2ez871wcz2jdoAKXFq/ecDxq8PTrQITqYwp
	 oMTFbPsGcy60f9GK0jLP0ERYftj8gQS4eahFSUgpXRVE9YJywOxrRVMtGcVM0AzOmA
	 GVF5wy7CgGwHGOCSueqfQeADpuXbl0lqaxwHmyNcPJ17Mc9AOGY3Ok45MUBnAxnikB
	 RVNJCep43JNvw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724855340; x=1725115840; i=anthony.perard@vates.tech;
	bh=HhiV0BNU0RIa9UKRXwsR/IwnP8IZKOE7MjdjteLDQUc=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=GazoneEVbafukXfRUcEjsjN7vBTL+HZlEl6Ok7NeVgIFQetaU/DMXS5TXz6pYe+iI
	 2S/4xHufSCCMkEtUzhOL1uOW/jWbxZUNE/Hs9NJGL9bQy5J4byhUY4yRQ0N9S1IfIz
	 6h5gJYPKc6dYCLC39irJyFQ2onVb91xn/JdoY4L73YQ5r2UUtZyCf/Jk+K8MqCJgCO
	 M8xgGtAxzl7Qd60rDaHcm1y8MieXNg04H3K/jHojAdeZf3HU8ZoRpgEgRb9qXLmJ3R
	 nxepQdp0S/lKn3N9h8sJVe9S6ap3pGPALUyff/EaOFCr2jf1+UnqsUIszBlTYmx8Ae
	 a3iCGaNP8Emug==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[XEN=20PATCH=201/3]=20libxl:=20Implement=20QEMU=20command=20line=20probe?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724855339193
To: Jason Andryuk <jason.andryuk@amd.com>
Cc: xen-devel@lists.xenproject.org, Juergen Gross <jgross@suse.com>
Message-Id: <Zs80Ktc/PfSFrmwu@l14>
References: <20240827100328.23216-1-anthony.perard@vates.tech> <20240827100328.23216-2-anthony.perard@vates.tech> <ebef6a88-abae-4e9a-8f9f-56eddb5a569c@amd.com>
In-Reply-To: <ebef6a88-abae-4e9a-8f9f-56eddb5a569c@amd.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.a0a6dfb6c83541049680e3dfd81c52eb?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240828:md
Date: Wed, 28 Aug 2024 14:29:00 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Tue, Aug 27, 2024 at 06:17:05PM -0400, Jason Andryuk wrote:
> On 2024-08-27 06:03, Anthony PERARD wrote:
> > From: Anthony PERARD <anthony.perard@citrix.com>
> > 
> > Starting with QEMU 9.0, the option "-chroot", that we use for the
> > "dmrestrict" feature, is removed. We need to find out which to use
> > between "-chroot" and "-run-with chroot=dir".
> > 
> > This patch implement the machinery to spawn QEMU, and to run the QMP
> > command "query-command-line-options" but doesn't yet look at the
> > actual result. Whether or not to use "-run-with chroot=dir" will be
> > implemented in a follow up patch.
> > 
> > The command line used to spawn the qemu we want to probe is mostly
> > similar to the one we already use for the device model, "-machine
> > none" comes from libvirt.
> > 
> > This patch implement the probing on qemu-xen, even if we probably not
> > going to use the result. We could check the feature wanted for the
> > domain been created, but this could get complicated fairly quickly.
> 
> "domain being created"?

Yes.

> > We already need to check the options "b_info->dm_restrict" for
> > "-chroot" and "state->dm_runas" for "-runas" (which is deprecated).
> > 
> > Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
> 
> Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 14:42:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 14:42:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784921.1194328 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJsl-0001gp-Ke; Wed, 28 Aug 2024 14:42:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784921.1194328; Wed, 28 Aug 2024 14:42:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJsl-0001gi-Gx; Wed, 28 Aug 2024 14:42:47 +0000
Received: by outflank-mailman (input) for mailman id 784921;
 Wed, 28 Aug 2024 14:42:46 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=HR2x=P3=bounce.vates.tech=bounce-md_30504962.66cf3762.v1-a95f825d5daf4dfca293eb7ba3c198a2@srs-se1.protection.inumbo.net>)
 id 1sjJsj-0001gc-Ii
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 14:42:46 +0000
Received: from mail187-32.suw11.mandrillapp.com
 (mail187-32.suw11.mandrillapp.com [198.2.187.32])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c820c60e-654b-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 16:42:43 +0200 (CEST)
Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail187-32.suw11.mandrillapp.com (Mailchimp) with ESMTP id
 4Wv6Zp1FhHzQXgCTT
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 14:42:42 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 a95f825d5daf4dfca293eb7ba3c198a2; Wed, 28 Aug 2024 14:42:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c820c60e-654b-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724856162; x=1725116662;
	bh=iIxB/m3mCS7MC/ry2Lyz0dBSlsPzD3LE+gEALXQt8f4=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=ooAwTccbQEQay0SqqEXDdTdAP62kqUcuoGIrp8/QBQcwC4VZCaWGuqQipxgLwK5Dx
	 4GHT8dPq5pcnBHa0jzAC9CKWrO1s1F+djAPBBFavHg/HQ8Ecg8vhD5h5qzbWRplVvo
	 RwtvUKI5ULhuMqbUDQk9zjdHKItot1t1eaSrBZzwmeijeXEFIwD/x75cKrz9G8SYJZ
	 gU83VKiHl86aQpxvrFLrNhb8liYXvFpQ+0P26PEJLE9m+sD6sCGia5sF10bO6DdRGN
	 ZwFxejgjwJI9AwzMNpGMY6uCsOHt5R284awVGYKZgus2RqRLSDFfPlzu3FMGr7h+pn
	 JMQy24XDcHl5w==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724856162; x=1725116662; i=anthony.perard@vates.tech;
	bh=iIxB/m3mCS7MC/ry2Lyz0dBSlsPzD3LE+gEALXQt8f4=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=BlHutNXWYqcpV3HWae+V/9xzYZuUUeWHR/h/6rgtZTip6J/CzGwAdGjBS8acSXung
	 DAc2A9NFbu3h54o7o8228W4jMZUPC3A7hLpUsc+LnGoVk07L34AQqgv6Yq8V1e4gYy
	 Yd7mM5qsR+LFU01num+6VuGBzPmnuL/ufUPzi1pySGuz3IGmoi12wap+grSb3Iv8gN
	 cd0q33JbPBob+4FEBRyZO4RZsSgIWnIYN9GEApOaDrACCws53GvLC98O5Am9A39iZ/
	 anTf0wLlAj4yTz+Go9raYVg1jw0FddvvRV75kRbwAsa9BpC4hVfIc52lcWnG8lXUVH
	 X/MaphBZHm6pw==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[XEN=20PATCH=202/3]=20libxl:=20Probe=20QEMU=20for=20-run-with=20chroot=3Ddir=20and=20use=20it?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724856161354
To: Jason Andryuk <jason.andryuk@amd.com>
Cc: xen-devel@lists.xenproject.org, Juergen Gross <jgross@suse.com>
Message-Id: <Zs83YDlqNXhbyQag@l14>
References: <20240827100328.23216-1-anthony.perard@vates.tech> <20240827100328.23216-3-anthony.perard@vates.tech> <8ab87d44-8a93-4468-b960-0c76c1e6a147@amd.com>
In-Reply-To: <8ab87d44-8a93-4468-b960-0c76c1e6a147@amd.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.a95f825d5daf4dfca293eb7ba3c198a2?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240828:md
Date: Wed, 28 Aug 2024 14:42:42 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

On Tue, Aug 27, 2024 at 06:20:42PM -0400, Jason Andryuk wrote:
> On 2024-08-27 06:03, Anthony PERARD wrote:
> > QEMU 9.0 have removed "-chroot" command line option, which have been
> > deprecated since QEMU 8.1 in favor of "-run-with chroot=dir".
> > 
> > Look into the result of the QMP command "query-command-line-options"
> > to find out if "-run-with chroot=dir" is available. Then use it in
> > place of "-chroot".
> > 
> > Resolves: xen-project/xen#187
> > Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
> 
> Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
> 
> though one suggestion below.
> 
> > ---
> >   tools/libs/light/libxl_dm.c       | 78 +++++++++++++++++++++++++------
> >   tools/libs/light/libxl_internal.h |  5 ++
> >   2 files changed, 69 insertions(+), 14 deletions(-)
> > 
> > diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
> > index 46babfed0b..298fbb84fe 100644
> > --- a/tools/libs/light/libxl_dm.c
> > +++ b/tools/libs/light/libxl_dm.c
> > @@ -1183,11 +1183,12 @@ static int libxl__pre_open_qmp_socket(libxl__gc *gc, libxl_domid domid,
> >   }
> >   static int libxl__build_device_model_args_new(libxl__gc *gc,
> > -                                        const char *dm, int guest_domid,
> > -                                        const libxl_domain_config *guest_config,
> > -                                        char ***args, char ***envs,
> > -                                        const libxl__domain_build_state *state,
> > -                                        int *dm_state_fd)
> > +    const char *dm, int guest_domid,
> > +    const libxl_domain_config *guest_config,
> > +    char ***args, char ***envs,
> > +    const libxl__domain_build_state *state,
> > +    const libxl__qemu_available_cmd_line *qemu_cmdline,
> 
> cmd_line/cmdline makes me think of command line strings.
> qemu_opts/qemu_cli_opts is a little more generic, to me at least.  But not a
> big deal if you want to keep it as is.

Yes, "opts" sounds better than "cmdline" in this context.

I'll rename "libxl__qemu_available_cmd_line" to
"libxl__qemu_available_opts".

And "qemu_cmdline" to "qemu_opts", both in the struct
libxl__dm_spawn_state and as argument of functions.

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 14:44:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 14:44:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784926.1194338 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJuL-0002Ep-UE; Wed, 28 Aug 2024 14:44:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784926.1194338; Wed, 28 Aug 2024 14:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJuL-0002Ei-RO; Wed, 28 Aug 2024 14:44:25 +0000
Received: by outflank-mailman (input) for mailman id 784926;
 Wed, 28 Aug 2024 14:44:24 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=28yR=P3=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sjJuK-0002EZ-MI
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 14:44:24 +0000
Received: from NAM10-BN7-obe.outbound.protection.outlook.com
 (mail-bn7nam10on20600.outbound.protection.outlook.com
 [2a01:111:f403:2009::600])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 02fa4a33-654c-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 16:44:22 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by CH2PR12MB4167.namprd12.prod.outlook.com (2603:10b6:610:7a::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.26; Wed, 28 Aug
 2024 14:44:18 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7897.027; Wed, 28 Aug 2024
 14:44:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 02fa4a33-654c-11ef-99a0-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=uO7ibVPqqnX2+cS37HiNxEnecc5sA9oWJtMGdhSUJAMbPHfUhF7k5HqCAbdc7E28ptWqDIoGBOa2QGV7lgnqk7J4SUAGEPJ9Ji1PBaDaBuOD4BzzUoGVxCCxNOlnTbvFe6AG0wtRo8MXh5u5UNvEu+X6/mok2S2RJnHae0aAi9f2NqZOCKnndzFoJVHp4Lmcv6h90DZXIq9XxdxSebNWYTm4o2LsA3t7C5qfYZ4dq2q1WRIiVZMs/WLYTLy+7Le9nD+8L7oNPr9j+jm4lBU1DpHjqNypmhCB4sXGFXD7f2+1XmvyKqaMPiSFfKgoMvs+BD3BqILZ1lPq1FRau4SZ/w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=57kOUV1e3r30yTAw2PXgm+rGElW+7eDATI09QVN1qB4=;
 b=fOslr9mZVYRF4owRP6OwxdN4bg2ukKZjuMD6qCMJlzObaaxBxanqckB9i4WyLQrzicpqt8sNm5YNF0/uJUuM8f9F8gNl1D//wgL23jHEO3+QH9SfWHi8THrL/3y4aL2xzbAjqndS+d8+TKX+vKEUsbOjNpQzt5yMNLF1J08PngT0gSzSb6RiEXiAFqQhH5R9HoVwVnA96AeWihFob0axFXpxAYNnBJEng4m/3MHWN3a79YezFKTZQgxynjN3CURMX/KiDCmA0pPx4terwQwuoCnpU4GUHzECx5JpJB4jYbvOWMMDxE0DR6zQeXVbOoZGrm5PsX8fU0v0NiqHqiMeSA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=57kOUV1e3r30yTAw2PXgm+rGElW+7eDATI09QVN1qB4=;
 b=Wp5P3wFaJF2jswSjTT4+RSUmr+IwQ25PV4g6rkUkdvva/svnbdfdHo8sZxGYn/EyGwQoWHTZ3aikNRJ65FsmCWXKzF+gMbTW01rej7ERmTTSN2vDGgV1wD54Fy7PO7F78rl/IFlJSQIjiFVMoO7T6qQh5UzQlxUediMGK2/8iXo=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <afada706-86b5-4093-8574-bfdc06aed639@amd.com>
Date: Wed, 28 Aug 2024 15:44:13 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 1/4] xen/arm: mpu: Introduce choice between MMU and MPU
Content-Language: en-GB
To: Julien Grall <julien@xen.org>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240823163127.3443404-1-ayan.kumar.halder@amd.com>
 <20240823163127.3443404-2-ayan.kumar.halder@amd.com>
 <fca5e0dd-5f71-4286-909b-db14551aa15a@xen.org>
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <fca5e0dd-5f71-4286-909b-db14551aa15a@xen.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P123CA0601.GBRP123.PROD.OUTLOOK.COM
 (2603:10a6:600:295::21) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|CH2PR12MB4167:EE_
X-MS-Office365-Filtering-Correlation-Id: 1dc8d6c0-bd56-420a-0046-08dcc76fe53d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?UXhtV2pYSTNTM2Z2RDExMHFRd1kwbDY3UStXbFlKdGNES2JVUVNwTGlIZlNu?=
 =?utf-8?B?SWxsQ295MzlhNUIxL0JDMDFmZDNrVU92Mm95ZitCQXU5eTNmZkNOc0hnT3Jh?=
 =?utf-8?B?eWJpai9HNFhxVkpvQ0hiUmkvQndlbzVQYmU0QXdaeXVmdllxSUN0STg4YkxT?=
 =?utf-8?B?MEl1YURiRlc0SC9vajJzVjc4RWovWkdRMVoyNEdtZ01RQ2VocDQxMHNzcUdi?=
 =?utf-8?B?UDYxb1NrSEJVc3FhNStGMWxtRXc0eE40MEtGSytFREliZFJ5QkZWcHMvNk5I?=
 =?utf-8?B?R2NROFI1SE1EcW95YkJGMjd3YWdMRytwMXhXVnpZRU96RmNPZVQwOTJvVFdP?=
 =?utf-8?B?NjFwdmhBdlRBdGMyS0VCREhETWxzWmFvREhlb2dXZmg3M0lCckExVXZ0WmNQ?=
 =?utf-8?B?R1Q2SW93ZnY0b212bmVJTFlSYnMwa1ZBcUswaWE1TFRvQVhsb2RDVVU0NWRP?=
 =?utf-8?B?M0NrcVNkREdkZVNpM3c4OEtvWVZlUi8wbWFUTVFkL093Z3NZMkRnbGFuejJR?=
 =?utf-8?B?VCtqSExYd1k5ZVI5TGZnMTlPcnEveFUrdG0rdjgzY2NvdVh3UVUxZ2FPVTJE?=
 =?utf-8?B?YUFDNzRFSXJmM2FiZWhTV3dxL0FrcmJaa3RIdHA3ZnhoVjNtbVNpOWo3SWlK?=
 =?utf-8?B?cnhyb1cwaEF1UEV4RE5hWEp0VHhDdUV2eWx2NnY2YjhZTTF0UmlKOFd2UE4w?=
 =?utf-8?B?a3hUZ2pGYUd1SURiQlVkbzdZRG5ueS80WHFXTElCeTBrdTRkRDZlU3JGNE5O?=
 =?utf-8?B?dWdTU25sSjFYSmRQSVkvWVZUTnRJaWhyTmp3MXJmMWVtbHF6bHYrQkcwQ1lH?=
 =?utf-8?B?MWlIWnRpL2hmSXJhaVBURTUwdFkxblh4dFJBbEMvNk81dzNMbWtmbnArR1lJ?=
 =?utf-8?B?aEVETStaWlhoRGVQa0UyWDN1THJSaFNKMXJtRzVvbzVQVWl6a0VuanJkZVRW?=
 =?utf-8?B?dnZiZlBOUG5SRXZjSXpFSkZZOFNzalR2VkxwZjY3SmEyYklCeXdIck14RS9J?=
 =?utf-8?B?eVF2Ums5SDUxejM1by9tZGZXOWFaWjVuQUQ5cjZTdFdtQ2dTMmE5MzVOWHRa?=
 =?utf-8?B?QzFlQlRRTTk1QWl0YXBuRkN2anJzVGRBMzNpU2tDYytvS1luU3ZnbFMwS3pC?=
 =?utf-8?B?WVpKc1ZWb1Z1MFRCekh2QUFrUEt0SGNVdFRPWXlJbXJjNEdvT1llRHRlY3RS?=
 =?utf-8?B?Q3pVVXJYZnk1TzVvN3BScmZ1RUN0ejdyd2t6TU5IQzRmUk5SdkRLbWtlT3Ja?=
 =?utf-8?B?aUw2V2c5Yk56cjB3VGo3RVY4TjIvWm1mVTZ5NEhkQWZqcm5XWXkwalNuNllv?=
 =?utf-8?B?VXVLUkZJbENEdXlibWtjNTYySWV5QlNCY2JFeVpMRlZsaG5aT05ZWFRUMUtX?=
 =?utf-8?B?a0t1OHRRSEFTRXlUOE1kaE4vdnJ0TlcvZVhsMGhhNkJhZkhqY2RjZS8rUnFZ?=
 =?utf-8?B?VGtCZTBrRkwwRHNYb3VBYXJoRnBXVFdIMWkyVDNGak1SdkNWQUdlbk9kYy9F?=
 =?utf-8?B?MUl5VTdKV1NXMm16SG1tdy8zRjlRVExDeWVJZEZSWkVDbWREWmZ2UjlWaXVi?=
 =?utf-8?B?RFBQUXVTODA1aDE4a1lLdEIrb3dWTm5POXBUSWswZGRKVVpGK2k0TlA3Q3RZ?=
 =?utf-8?B?OXFOQkxrVVFGOWpLZXhTSmFEb2d3RXh5TkhZL3JjUFB0R2txOWZ3SDJSTHoz?=
 =?utf-8?B?MC81QzVka1RkMWtNa3dTaWFCQXAzS29teXA1c1llUjFoRlFRWnBma3R1TnV2?=
 =?utf-8?B?NFpaTnRKdnNqQnhsaFdZVTM2OUZHcWowYW1ZNzlXNEpKY2F3T1NwYWppMEtN?=
 =?utf-8?B?TDRwQ0NSTmxNS0x4UUJBQT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?Kzk1MWlsM0U1RFI3M2dVQWV5RWRXWDJKNlZTdjNGaXZxYnBRcnJldkJKMVJu?=
 =?utf-8?B?d1VYNCtWZkJOTld4UGdPc2lNQzBHK2JHM2xPdHJjSklBeWNheVhZWHFkRkRZ?=
 =?utf-8?B?N3dzclVqMWZSMGltZkVoMzhiREJDRk1uUURFUUZaMys3eE9BeERhdkNNYzBk?=
 =?utf-8?B?cUtEOGVQSUN6ZGY5NFY0WWFYWmliQ3BoMHpnN0xkc2dJZEdsSVNEYjFHUGZW?=
 =?utf-8?B?K2tmVytkakxTOHI2SVJGc2ZhUjYyTU1ETUFJT3pOWWtUZ0NydDFFVFRnRVdB?=
 =?utf-8?B?SlFkL0EvalNxOTB3R21XK1E4bk5XTkpwQllkUjF6YVp1b2FTQlVWVWpyK3Nv?=
 =?utf-8?B?TXNnV3ZSeTFiQzNVeVZXWVk5a0Nid3RWWXNTY1hpWFFSMjFab2VRZFdXaGZ5?=
 =?utf-8?B?OEFEZlhCU2h5OGpmQm9RYTlsZ1FsNkEvdVBRVTI4c0xiN3JCMFRZS1VMbHpE?=
 =?utf-8?B?SVpJMFA4VTk3T3hrQXZrWTgremhhM0I5cXVKcXZQb0RpSmdIQ2tEdk1MeStk?=
 =?utf-8?B?YjlUbG50R1A4a0NKTDAvV0FvdkxuWFZRVUUwZGRYV1RxSDI5aFc5TFlZWE50?=
 =?utf-8?B?S3M1TTA1TjB4WTlzdHhrZFh0ZWhQUnNZSEkrRlRlTWRSZmx1eUNsSlZ3a2Z6?=
 =?utf-8?B?Vk03SS9tYVJnOUdPS0RWY0xiU2V5Ym5QU002S3k4K3VQbDFOQ0FhUEFnZzQy?=
 =?utf-8?B?R3U3UWk4UHFkanFwT004TStqT252L0ZoV3p5QjlyUHNPblVaSVh4NHVMb0lq?=
 =?utf-8?B?SU56SDNabklOMTFGWldZZXZJU0dua21sUFRtL2ZiaVI0WFBBU25GMDNTQStG?=
 =?utf-8?B?V3pmaGJ6eGI4OTQ1NHpaV0kzaEl0SjRZZEdnb0NLaldIbE9KM0UxL0NRMkp4?=
 =?utf-8?B?dmtoQ0hsK044bzdORUwvcVFhVHVCQ0txZVUxSWVJUVlwcmlLYmNlbExtR25s?=
 =?utf-8?B?Q0g1OTk0Mzg1eDA2S0dkSzQvYkRlVk05UGVxR1p6c2ZLemtZYVEwTFdhL2t0?=
 =?utf-8?B?YTh5Ky9NbS9ZK29laTNqdW9Ya0NqOWx6d1BETjJNUmhneVN5bGR4djN2enNu?=
 =?utf-8?B?ZXVFS0FZN1BjUUxublZBTjlqSTJBbWV1R3BUYzdSc05BbFZNTDllMkZGaTVK?=
 =?utf-8?B?QXBkSmtqRHpERndNUStlOVFjOWdoOFRNY2ZnUWdSS1RUdmt1Nkxxd0JSdWlu?=
 =?utf-8?B?VERFYWFXYkpJc2MvK2FaNWJEQnFycDJPVjRtc2hNZ01aQUlGMTBYRyt0d2RK?=
 =?utf-8?B?U0l4K1ZzQ01WOHpxT09kYXN2UCs2S0l5RTFDRURJZktFcUtxdHA5OHZZeTgz?=
 =?utf-8?B?Yk1ES3VCdmIzWEJJNC9oWkJ6TkgwQU8wUzhBZ0MrOGllS2FEaUFNMXRlcHlD?=
 =?utf-8?B?RVR5QUd1eFZIejM4a3hud3NpelRtNVlBVmZKcm5saUx6Y3lJZDJFOExrck1B?=
 =?utf-8?B?M0FzQTMzVlE0MXBHSkNxMVNPMDlneUpUNEFqU0tkaEM2eXN4cVlEY29xZ3d1?=
 =?utf-8?B?eDJyeS95aFliaUxIYWZGYW93SjZjeEoxaTRUb2dGM0Jka2thU2JsQmVKZVFa?=
 =?utf-8?B?UWVMNkNscjdlQkNESkw0T2dXaW8reFZPQU82dXdLejNVdlp2cFh6b0RHM2gx?=
 =?utf-8?B?a0dKTXJLbkJsWm83OVh0cDM1TWV6MXlCWU9rZGl6cVZ6Ykt6eDdKSjdRUUxB?=
 =?utf-8?B?eXFDRWZCSC9EYTdhNUZCSnVLeGhxWmZoN1VUU2NEdTVvbEJFbmxJMWluMkgr?=
 =?utf-8?B?MlJyWEFiUFBwTEkrR2hGaEQ3aFhVNmJmUnVWTTh0cEFOdFh1cFQ1Mk1HNmtG?=
 =?utf-8?B?WVk3RTZuR0RvZ202b1hvc3JKU0trams3MGVURHdTeDhmM3JNMDUwRVBmK3dI?=
 =?utf-8?B?ZDlMckdpbUloT1d5cmVaOFRtTCsvak9sOWQ1eVlGc1NhYzBsQTJ5K2RvRXFo?=
 =?utf-8?B?MFpIOFZLbzI3NUk2UXdYNFZRMEF1OFlJT2ZnS1R2V3BtbkhvejdzV0pPZmpD?=
 =?utf-8?B?M0pjWlplK04wOVhRTi9SNGxCSENUNkMzNmFDeFNxRWhna3pmRDRvVDgwN2dF?=
 =?utf-8?B?WEx1TW90WitGMmxVTmF3RGp4Z1YwR3pYQ0tnSkRSNzF2V3huSHBvWGtLVTdl?=
 =?utf-8?Q?xESXSCqHsYV7pAAMhbgP/mDLF?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 1dc8d6c0-bd56-420a-0046-08dcc76fe53d
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2024 14:44:18.4185
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: zr9OzXNkQ7pRlVCVfAdZz7zqNKdVY7I2Pk0Vg1FIUnq3S5z8HyRngnb9k1/A2SdtefB8Ke+B9tZp9FH2l7u0lA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4167


On 27/08/2024 11:37, Julien Grall wrote:
> Hi,
Hi Julien,
>
> On 23/08/2024 17:31, Ayan Kumar Halder wrote:
>> There are features in the forthcoming patches which are dependent on
>> MPU. For eg fixed start address.
>> Also, some of the Xen features (eg STATIC_MEMORY) will be selected
>> by the MPU configuration.
>>
>> Thus, this patch introduces a choice between MMU and MPU for the type
>> of memory management system. By default, MMU is selected.
>> All the current platforms are now made dependent on MMU.
>>
>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>> ---
>>   xen/arch/arm/Kconfig           | 17 ++++++++++++++++-
>>   xen/arch/arm/platforms/Kconfig |  2 +-
>>   2 files changed, 17 insertions(+), 2 deletions(-)
>>
>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>> index 323c967361..686948cefd 100644
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -58,10 +58,25 @@ config PADDR_BITS
>>       default 40 if ARM_PA_BITS_40
>>       default 48 if ARM_64
>>   +choice
>> +    prompt "Memory management system"
>> +    default MMU if ARM
>> +    help
>> +      User can choose between the different forms of memory 
>> management system.
>> +      Most of the Arm based systems support MMU.
>
> I feel this is quite subjective. So I would drop it.
Agreed.
>
>> +
>>   config MMU
>> -    def_bool y
>> +    bool "MMU"
>>       select HAS_PMAP
>>       select HAS_VMAP
>> +    help
>> +      Memory management unit is supported on most Arm based systems.
>
> For this case, I would write "Select it you are plan to run Xen on 
> Armv7-A or Armv8-A".
Ack.
>
>
>> +
>> +config MPU
>> +    bool "MPU"
>
> I think it should be gated by UNSUPPORTED. SUPPORT.md also needs to be 
> updated.
Ack.
>
>> +    help
>> +      Memory protection unit is supported on some Cortex-R systems.
>
> Why do you make this specific to Cortex-R? Shouldn't this instead be 
> Armv8-R?

Yes, you are correct. It should be Armv8-R. Otherwise, someone might 
think it is applicable for Cortex-R5, R7, etc.

- Ayan



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 14:44:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 14:44:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784927.1194347 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJuP-0002U2-5C; Wed, 28 Aug 2024 14:44:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784927.1194347; Wed, 28 Aug 2024 14:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJuP-0002Tt-1w; Wed, 28 Aug 2024 14:44:29 +0000
Received: by outflank-mailman (input) for mailman id 784927;
 Wed, 28 Aug 2024 14:44:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjJuN-0002Sq-2A
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 14:44:27 +0000
Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com
 [2607:f8b0:4864:20::333])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 05130bc6-654c-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 16:44:26 +0200 (CEST)
Received: by mail-ot1-x333.google.com with SMTP id
 46e09a7af769-709428a9469so5909267a34.3
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 07:44:25 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 d75a77b69052e-454fe1967a3sm62331841cf.68.2024.08.28.07.44.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 07:44:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 05130bc6-654c-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724856264; x=1725461064; 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=1QCV+2b2ouHVeE/b0YtNxy3kRxwpySPvvxXVCsd9U14=;
        b=WsIkqXbIsdy4vHYkNDnUsiJvZa8zDSLyTAeexBmSiqHPbKEwH8cjy0lF77nC70vgCQ
         O5aSS7m3LJYecPDxbGsKLhg5qfOKMNETMqqGykbv6gvDOOn4YsxK+MWZqdMKNkJ6Z4w5
         3spS65uqo8F9SsCu8SToUnaNbU72QoNon5kgQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724856264; x=1725461064;
        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=1QCV+2b2ouHVeE/b0YtNxy3kRxwpySPvvxXVCsd9U14=;
        b=eKvwM9V1hMvzOv90MQ+8q4+zM5y69mrF55R+4FntumFnN408w4ASNpKsOr4pvbzEVE
         389Rxh2VqMD7mqH1ew5ccXihxW8/HMiowmyW3Klv0ymR7zfKO0gQfSi1TIhVj7/pNKUq
         yQe5u6XyHnboks65TiD/3oQTp23uTUOto0sLYJDjcSlyXN09AMEvhSxXT+mhyX6hH6Gz
         X254OAT91E5ZDaKs+LUEFK9vewUari2ibAF0vZWb9AiWtVwbDq5GqI0w34517gAUAnH1
         ShXtW4cvmy6m6JwbUn2TY5Vi9RNYfmTD/f+TmBE93uqCQ1Ct3GE/7VDD30hWbHE+hNP2
         ih8A==
X-Forwarded-Encrypted: i=1; AJvYcCW4YqWYpQp8zN+G7DTfGud0Ik0bQp+eUPJzhQaj6dZPq4Sccx6/xMCvyoCy1sajx5ZFy4e+VeqY5dA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxIqZ/Ft1eAn6Ha62TKNWQTHLbtwsdvNk1eyZNfcBYnjqk38H2M
	ZZg6l+o3oXwmZuEQ4b19ognuV0+At8Vm5fJ112A7NA4v8CXePCeC51kmSY+3pNU=
X-Google-Smtp-Source: AGHT+IG2ofPpTNYMcB1E84LvSFh39mC/64iRd/LXo4ANMC3blm/Q9OctNkJY1KxoFfVELdrruRXOCA==
X-Received: by 2002:a05:6830:720d:b0:70f:3dd0:316c with SMTP id 46e09a7af769-70f3dd03473mr11658646a34.27.1724856264272;
        Wed, 28 Aug 2024 07:44:24 -0700 (PDT)
Message-ID: <8f34109f-1718-47e5-99c5-a6010d7ebe51@citrix.com>
Date: Wed, 28 Aug 2024 15:44:21 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/4] x86/hvm: Use for_each_set_bit() in
 hvm_emulate_writeback()
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
 <20240827135746.1908070-3-andrew.cooper3@citrix.com>
 <a92063db-fc28-4162-83bd-33617bbfcfbe@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <a92063db-fc28-4162-83bd-33617bbfcfbe@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 27/08/2024 5:07 pm, Jan Beulich wrote:
> On 27.08.2024 15:57, Andrew Cooper wrote:
>> ... which is more consise than the opencoded form.
>>
>> Also, for production VMs, ~100% of emulations are simple MOVs, so it is likely
>> that there are no segments to write back.
>>
>> Furthermore, now that find_{first,next}_bit() are no longer in use, the
>> seg_reg_{accessed,dirty} fields aren't forced to be unsigned long, although
>> they do need to remain unsigned int because of __set_bit() elsewhere.
>>
>> No practical change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: Roger Pau Monné <roger.pau@citrix.com>
>>
>> Pulling current out into curr is good for code generation.  When using current
>> in the loop, GCC can't retain the calculation across the call to
>> hvm_set_segment_register() and is forced to re-read from the cpu_info block.
>>
>> However, if curr is initialised, it's calculated even in the likely path...
> That's a little odd, as I don't think I can spot what would force the compiler
> into doing so. As a wild guess, ...
>
>> --- a/xen/arch/x86/hvm/emulate.c
>> +++ b/xen/arch/x86/hvm/emulate.c
>> @@ -2908,18 +2908,18 @@ void hvm_emulate_init_per_insn(
>>  void hvm_emulate_writeback(
>>      struct hvm_emulate_ctxt *hvmemul_ctxt)
>>  {
>> -    enum x86_segment seg;
>> +    struct vcpu *curr;
>> +    unsigned int dirty = hvmemul_ctxt->seg_reg_dirty;
> ... is the order of these two possibly relevant? Yet of course it's not the
> end of the world whichever way it's done.

My general conclusion is that GCC doesn't try very hard to optimise
likely() early exits.

I suspect there's some reasonably low hanging fruit to be found there.

>
>> -    seg = find_first_bit(&hvmemul_ctxt->seg_reg_dirty,
>> -                         ARRAY_SIZE(hvmemul_ctxt->seg_reg));
>> +    if ( likely(!dirty) )
>> +        return;
>>  
>> -    while ( seg < ARRAY_SIZE(hvmemul_ctxt->seg_reg) )
>> -    {
>> -        hvm_set_segment_register(current, seg, &hvmemul_ctxt->seg_reg[seg]);
>> -        seg = find_next_bit(&hvmemul_ctxt->seg_reg_dirty,
>> -                            ARRAY_SIZE(hvmemul_ctxt->seg_reg),
>> -                            seg+1);
>> -    }
>> +    curr = current;
>> +
>> +    for_each_set_bit ( seg, dirty )
>> +        hvm_set_segment_register(curr, seg, &hvmemul_ctxt->seg_reg[seg]);
>> +
>> +    hvmemul_ctxt->seg_reg_dirty = 0;
> Why is this suddenly appearing here? You don't mention it in the description,
> so it's not clear whether you found a (however minor) issue, or whether
> that's purely cosmetic (yet then it's still an extra store we could do
> without).

Oh, yes.  Nothing anywhere in Xen ever clears these segment dirty bits.

I suspect the worst that will go wrong is that we'll waste time
re-{VMWRITE,memcpy}-ing the segment registers into the VMCS/VMCB, but
the logic in Xen is definitely not right.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 14:50:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 14:50:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784942.1194359 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJzh-0004OO-Sw; Wed, 28 Aug 2024 14:49:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784942.1194359; Wed, 28 Aug 2024 14:49:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjJzh-0004OH-P3; Wed, 28 Aug 2024 14:49:57 +0000
Received: by outflank-mailman (input) for mailman id 784942;
 Wed, 28 Aug 2024 14:49:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sjJzg-0004OB-OE
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 14:49:56 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sjJzg-00028y-62; Wed, 28 Aug 2024 14:49:56 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sjJzf-0006KY-WD; Wed, 28 Aug 2024 14:49:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=X4t8IBRnrSGGQzGQ+NAqpV25AhiNyFtll5IAOWduaCk=; b=H7uHXC/ID76ZiIAXLPj5xGAHeW
	B2viPHQmD4wDg9gdyaOQsc8xn6RyQN24w4qj/3yBHqh7iiiiHASRrR9dHCUS/F2/LZpFoFvpuyHk6
	RoVJRPw1JnEDh8bqtfKMSTtPLpNNA6eiPWozM0ZnJSpYXX8ZHUgxpdp2QRhPZX7OtySo=;
Message-ID: <efc024ad-1e1c-45d0-9511-cc0c082dfef7@xen.org>
Date: Wed, 28 Aug 2024 15:49:54 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 2/4] xen/arm: mpu: Define Xen start address for MPU
 systems
Content-Language: en-GB
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Wei Chen <wei.chen@arm.com>, Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 "Jiamei . Xie" <jiamei.xie@arm.com>
References: <20240823163127.3443404-1-ayan.kumar.halder@amd.com>
 <20240823163127.3443404-3-ayan.kumar.halder@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20240823163127.3443404-3-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 23/08/2024 17:31, Ayan Kumar Halder wrote:
> From: Wei Chen <wei.chen@arm.com>
> 
> On Armv8-A, Xen has a fixed virtual start address (link address
> too) for all Armv8-A platforms. In an MMU based system, Xen can
> map its loaded address to this virtual start address. So, on
> Armv8-A platforms, the Xen start address does not need to be
> configurable. But on Armv8-R platforms, there is no MMU to map
> loaded address to a fixed virtual address and different platforms
> will have very different address space layout. So Xen cannot use
> a fixed physical address on MPU based system and need to have it
> configurable.
> 
> So in this patch, we reuse the existing arm/platforms to store
> Armv8-R platforms' parameters. And `XEN_START_ADDRESS` is one
> kind of MPU based platform's parameters. So we define default
> `XEN_START_ADDRESS` in the MPU specific header file.

This seems a left-over from as previous work?

> 
> We also introduce one Kconfig option for users to override the
> default Xen start address of selected platform, if they think
> the default address doesn't suit their scenarios. For this
> Kconfig option, we use an unaligned address "0xffffffff" as the
> default value to indicate that users haven't used a customized
> Xen start address.
> 
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Jiamei.Xie <jiamei.xie@arm.com>
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
>   xen/arch/arm/Kconfig                  | 11 +++++++++++
>   xen/arch/arm/include/asm/mpu/layout.h | 25 +++++++++++++++++++++++++
>   2 files changed, 36 insertions(+)
>   create mode 100644 xen/arch/arm/include/asm/mpu/layout.h
> 
> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
> index 686948cefd..d722ca690c 100644
> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -23,6 +23,17 @@ config ARCH_DEFCONFIG
>   	default "arch/arm/configs/arm32_defconfig" if ARM_32
>   	default "arch/arm/configs/arm64_defconfig" if ARM_64
>   
> +config XEN_START_ADDRESS
> +	hex "Xen start address: keep default to use platform defined address"
> +	default 0xFFFFFFFF
> +	depends on MPU
> +	help
> +	  This option is allowed to set customized address at which Xen will be
> +	  linked on MPU systems.

I don't quite understand what you mean by "allowed".

 >  This address must be aligned to a page size.> +	  Use 0xFFFFFFFF as 
the default value to indicate that user hasn't
> +	  customized this address, and Xen use use the default value that has
> +	  been defined in platform files.

At least in this patch, there is no default set. Instead you will throw 
an error.

> +
>   menu "Architecture Features"
>   
>   choice
> diff --git a/xen/arch/arm/include/asm/mpu/layout.h b/xen/arch/arm/include/asm/mpu/layout.h
> new file mode 100644
> index 0000000000..82a74b8b5b
> --- /dev/null
> +++ b/xen/arch/arm/include/asm/mpu/layout.h
> @@ -0,0 +1,25 @@
> +// SPDX-License-Identifier: GPL-2.0-only

Coding style: /* SPDX-... */

> +/*
> + * config_mpu.h: A Linux-style configuration list for Arm MPU systems,
 > + *               only can be included by config.h
> + */

I don't understand how this description match the content below. Also, 
shouldn't you include it from xen/config.h?

> +
> +#ifndef __ARM_CONFIG_MPU_H__
> +#define __ARM_CONFIG_MPU_H__

This doesn't match the name of the file.

> +
> +
> +#define XEN_START_ADDRESS CONFIG_XEN_START_ADDRESS
> +
> +/*
> + * All MPU platforms need to provide a XEN_START_ADDRESS for linker. This
> + * address indicates where Xen image will be loaded and run from. This
> + * address must be aligned to a PAGE_SIZE.
> + */
> +#if (XEN_START_ADDRESS % PAGE_SIZE) != 0
> +#error "XEN_START_ADDRESS must be aligned to PAGE_SIZE"
> +#endif
> +
> +#define XEN_VIRT_START         _AT(paddr_t, XEN_START_ADDRESS)
> +
> +#endif /* __ARM_CONFIG_MPU_H__ */
> +

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 14:50:51 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 14:50:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784947.1194368 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjK0Z-0005lO-4L; Wed, 28 Aug 2024 14:50:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784947.1194368; Wed, 28 Aug 2024 14:50:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjK0Z-0005lH-1K; Wed, 28 Aug 2024 14:50:51 +0000
Received: by outflank-mailman (input) for mailman id 784947;
 Wed, 28 Aug 2024 14:50:49 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NRYu=P3=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjK0X-0005kw-GD
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 14:50:49 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e9866e7b-654c-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 16:50:48 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a8695cc91c8so718699466b.3
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 07:50:48 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e5486994sm258523666b.14.2024.08.28.07.50.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 07:50:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e9866e7b-654c-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724856648; x=1725461448; 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=Fb/0ZOBQiQlb+u4QQLMjeXGqqA54bgXEtZj2quhmFs8=;
        b=OCHUS0bd0i3LcqifpwRn5iupMzHpqCBK7qipBsPcAaku8HoiiMyCB/L/75J/y6kkke
         NfDylTfbEXhYEsvRUYvuoDPMKvf0/7+GlLrks7HVrHtK2h9jpS2wgeIEEQ/nsJVoCEKG
         v/XYsiNYcE2BMzZTtAJdlcyac6ZSGcxJygiqMbYRdCensC2MDyk2VkpNyn8x81kFJ8uw
         tlFkxb+kh8VK2TMN8zsjRmkoI8hgFgiG9cAFkPh4uOpj/rq6QLHjq8kv9dzeoMT4fuBf
         TZaxnEC1GlU7J9dkiq4FkS1DAug4/tWCiSybudOcHL8SN3R/BUFXiEscyF8rFpERESuq
         ua1g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724856648; x=1725461448;
        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=Fb/0ZOBQiQlb+u4QQLMjeXGqqA54bgXEtZj2quhmFs8=;
        b=N4soQZ3EdiXgQ8aKzujMH8LKjslMPOgYncPyjvhI3XKQHrIc9pvRl2WzLeSs5JX/fU
         HVA9ozCromD03uTGoglYN4+asYgRXT3sOLcTCeasySPc9Q+hAnKaM2/Zn3f0k8RgEGFF
         hdl0vrKYcLOkbyJTxyEoWB0E3JGEbUwaKRcQ17DsOgIQsneHwye/Ku6SlpFyBlH7SvnV
         pRsUSZ6C84+atpvkAwnK7siWYiFKnVKZCz13UipDiRLFSNHwwQkSXZR+qEf7Vukgkdnh
         14ByHZCk/YkvFGUkhhkE60ZGbH2kewNgBw3KuJ1FZhFNVhx6weL8y4ppWE1P4RjQqs1W
         F/CQ==
X-Forwarded-Encrypted: i=1; AJvYcCVirpviLVVBa8oH4jbIAfA+acex+agIs1HYZTqFHFZcmmuNYNsNjFDrT1L8lGtImerGoBmwoljMnzc=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yzkmv4EdtToLepJuwXvBMWNxU9O8hrC6moDcmU2xo+VZ72I7kb5
	iyLk6Gb2JUuE6ES7JStlYme063m7ZRqK1TXQrDQjr/4RSdWJTavfue+NC4iuRQ==
X-Google-Smtp-Source: AGHT+IFWOATNkyxFxGi7ZkGmiVcyEBpDdAmPAewfmRHl2l9K7qxthZycsALyAqvRnCW3gdhJBOsB7g==
X-Received: by 2002:a17:907:31c4:b0:a86:7021:1368 with SMTP id a640c23a62f3a-a870a9ba5dbmr194676466b.21.1724856647582;
        Wed, 28 Aug 2024 07:50:47 -0700 (PDT)
Message-ID: <1eae8fa0-2d4c-4cf6-8120-fd7fefa523ed@suse.com>
Date: Wed, 28 Aug 2024 16:50:46 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH] xen/bitmap: remove comment-based deviations
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Simone Ballarin <simone.ballarin@bugseng.com>,
 Doug Goldstein <cardoe@cardoe.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 xen-devel@lists.xenproject.org
References: <4aa692a50a5d08d24560f02fdc36911965fc860b.1724850701.git.federico.serafini@bugseng.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 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: <4aa692a50a5d08d24560f02fdc36911965fc860b.1724850701.git.federico.serafini@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 28.08.2024 15:12, Federico Serafini wrote:
> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
> @@ -565,6 +565,10 @@ of this macro do not lead to developer confusion, and can thus be deviated."
>  -config=MC3R1.R20.7,reports+={safe, "any_area(any_loc(any_exp(macro(^count_args_$))))"}
>  -doc_end
>  
> +-doc_begin="The expansion of an argument surrounded by tokens '{', '}' and ';' is safe."
> +-config=MC3R1.R20.7,expansion_context+={safe, "left_right(^[\\{;]$,^[;\\}]$)"}
> +-doc_end

Not the least because this is quite a bit wider than ...

> --- a/xen/include/xen/bitmap.h
> +++ b/xen/include/xen/bitmap.h
> @@ -103,13 +103,10 @@ extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order);
>  #define bitmap_switch(nbits, zero, small, large)			  \
>  	unsigned int n__ = (nbits);					  \
>  	if (__builtin_constant_p(nbits) && !n__) {			  \
> -		/* SAF-7-safe Rule 20.7 non-parenthesized macro argument */ \
>  		zero;							  \
>  	} else if (__builtin_constant_p(nbits) && n__ <= BITS_PER_LONG) { \
> -		/* SAF-7-safe Rule 20.7 non-parenthesized macro argument */ \
>  		small;							  \
>  	} else {							  \
> -		/* SAF-7-safe Rule 20.7 non-parenthesized macro argument */ \
>  		large;							  \
>  	}

... what's needed here, I wonder if we're not opening up avenues to
problems by generally permitting that pattern. Plus in the description
I'm missing a statement to the effect of why this is (always) safe.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 14:57:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 14:57:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784954.1194378 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjK6R-0006km-Op; Wed, 28 Aug 2024 14:56:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784954.1194378; Wed, 28 Aug 2024 14:56:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjK6R-0006kf-LF; Wed, 28 Aug 2024 14:56:55 +0000
Received: by outflank-mailman (input) for mailman id 784954;
 Wed, 28 Aug 2024 14:56:54 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NRYu=P3=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjK6Q-0006ij-Sh
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 14:56:54 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c2b7dab4-654d-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 16:56:52 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a8692bbec79so876539766b.3
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 07:56:52 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e5486994sm259124566b.14.2024.08.28.07.56.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 07:56:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c2b7dab4-654d-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724857012; x=1725461812; 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=2VfOD9+PJiSIqqab2EUGIMphNnLbOpx4tJShfEp78+g=;
        b=JvODChIdBfSkUnG7J1PCdrcz+GBh5oo39jXbqW55uLrHGYEN2uClzu7qzpZQXdIHSc
         RhzlZWQ/yAtu9k8WGDsP/vOAWO+1WotsmTn9CiLMKe1Cd29SRT00Vc4HjPB+raBiaTiO
         g8pw39OXZVNJzAmfP4V7J3YlEwLiPMLt/IuciUuDZuXsNeVqibKe7YnuUAUcTqJihHo8
         vWYNiF3ACMszfCkjLm4Bgh5R5p+qaAVba3Ux8h8Y0Jck7f7nAB/3SLnZ4ZB4P3d7dVJJ
         3H+jd1izKwSYMezsZ8QzajlFMBqB1xBsImdTAWFZWRz90qYs2L4OLpUk1Sl26Hgtp9aZ
         dAfQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724857012; x=1725461812;
        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=2VfOD9+PJiSIqqab2EUGIMphNnLbOpx4tJShfEp78+g=;
        b=Z8BGHqUwGb8eDk6C+8HOr1Gsgjks62JKCijH9iGWbvTdcbq2etqwhEg8w7DVBKWaw+
         ZPTYnXS7xiVaHxY+FcWgPBjYfmQt6hqyoyvx/jMmcscw6u+5fo6UscGIXRi3BatqPV7M
         m2qIscbe5j4W6/U04+xmbHIOm/Th03acLzcpXgpZevtFil/EQFcH7budOPKk8Tr0DVnO
         OxjMcjLhPwW6odwFPZouEn4kwT+/cJ2wW13RGhOOuCgrCKdDR+qrY/rtN7mRF/BPAzp+
         kyDJ3b4Z3OT5ldn6oZhL6fzTDPZrbzCwneaP7w5CfnuP/DEdME3HsL0a3KEVK9owgb5P
         yEgA==
X-Forwarded-Encrypted: i=1; AJvYcCWw7KIVbXlMDUV8tYP7KBi15NmmqjYo8Jb4cnRVJbIkEc2fvNcvwefoscp8VPbtwGG7z5ehc0G9ixQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw+hp/6V/9YCICDiKEdLo/UGTzZDekaCpdwTDg16JF6kJPspjT9
	idSJYeqdyb+uYI1Ox42Akt+lRBfMu0buTlVZC+yBjSLL319uuFKRvlY10HsU7w==
X-Google-Smtp-Source: AGHT+IEUzlY0naLYVNqF1UtFsTeRlOWw8aHQ7Knu/xUaErB9ndK8JjLwPpcgLLW3cAwPPy5ky0GTXg==
X-Received: by 2002:a17:907:e228:b0:a86:a28a:99ef with SMTP id a640c23a62f3a-a870a98ecd0mr209220966b.18.1724857011921;
        Wed, 28 Aug 2024 07:56:51 -0700 (PDT)
Message-ID: <09742cbe-4c06-49d4-8b26-7ce9076063a1@suse.com>
Date: Wed, 28 Aug 2024 16:56:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/4] x86/hvm: Use for_each_set_bit() in
 hvm_emulate_writeback()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
 <20240827135746.1908070-3-andrew.cooper3@citrix.com>
 <a92063db-fc28-4162-83bd-33617bbfcfbe@suse.com>
 <8f34109f-1718-47e5-99c5-a6010d7ebe51@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <8f34109f-1718-47e5-99c5-a6010d7ebe51@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28.08.2024 16:44, Andrew Cooper wrote:
> On 27/08/2024 5:07 pm, Jan Beulich wrote:
>> On 27.08.2024 15:57, Andrew Cooper wrote:
>>> +    for_each_set_bit ( seg, dirty )
>>> +        hvm_set_segment_register(curr, seg, &hvmemul_ctxt->seg_reg[seg]);
>>> +
>>> +    hvmemul_ctxt->seg_reg_dirty = 0;
>> Why is this suddenly appearing here? You don't mention it in the description,
>> so it's not clear whether you found a (however minor) issue, or whether
>> that's purely cosmetic (yet then it's still an extra store we could do
>> without).
> 
> Oh, yes.  Nothing anywhere in Xen ever clears these segment dirty bits.

hvm_emulate_init_once()?

> I suspect the worst that will go wrong is that we'll waste time
> re-{VMWRITE,memcpy}-ing the segment registers into the VMCS/VMCB, but
> the logic in Xen is definitely not right.

I'm on the edge of asking to do such clearing before emulation, not after
processing the dirty bits. That would then be hvm_emulate_init_per_insn(),
well centralized.

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 15:01:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 15:01:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784962.1194388 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjKAn-0000Xh-9H; Wed, 28 Aug 2024 15:01:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784962.1194388; Wed, 28 Aug 2024 15:01:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjKAn-0000Xa-5a; Wed, 28 Aug 2024 15:01:25 +0000
Received: by outflank-mailman (input) for mailman id 784962;
 Wed, 28 Aug 2024 15:01:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sjKAm-0000XU-1V
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 15:01:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sjKAl-0002Nv-FK; Wed, 28 Aug 2024 15:01:23 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sjKAl-0007CO-8u; Wed, 28 Aug 2024 15:01:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=CKhoBEdU1oBU1ObBf+zxVNpjO6KmigcCl/gcErSgd2M=; b=PqxLnBNobXUV2DyPO0oIrrvn3C
	BZ9LBqH1ZOvVxqbZtfaosxhsSvISsveHFU49w64qvDxHrP82FZq9lThPsEZugOgwzN4jjuRLN0VSV
	U30hJcj8gcM5Fiq/b1F2rhjcT59QF0Dgxo8o8IGiH7xwUb+XDcz1ajoWBerHhsG+QIkU=;
Message-ID: <f14c6fb3-0ab6-49e6-b0f1-622802a599f0@xen.org>
Date: Wed, 28 Aug 2024 16:01:21 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 3/4] xen/arm: mpu: Create boot-time MPU protection
 regions
Content-Language: en-GB
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240823163127.3443404-1-ayan.kumar.halder@amd.com>
 <20240823163127.3443404-4-ayan.kumar.halder@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20240823163127.3443404-4-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 23/08/2024 17:31, Ayan Kumar Halder wrote:
> Define enable_boot_cpu_mm() for the AArch64-V8R system.
> 
> Like boot-time page table in MMU system, we need a boot-time MPU
> protection region configuration in MPU system so Xen can fetch code and
> data from normal memory.
> 
> START_ADDRESS + 2MB memory is mapped to contain the text and data
> required for early boot of Xen.
> 
> One can refer to ARM DDI 0600B.a ID062922 G1.3  "General System Control
> Registers", to get the definitions of PRBAR_EL2, PRLAR_EL2 and
> PRSELR_EL2 registers. Also, refer to G1.2 "Accessing MPU memory region
> registers", the following
> 
> ```
> The MPU provides two register interfaces to program the MPU regions:
>   - Access to any of the MPU regions via PRSELR_ELx, PRBAR<n>_ELx, and
> PRLAR<n>_ELx.
> ```
> We use the above mechanism to configure the MPU memory regions.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
>   xen/arch/arm/Makefile                    |  1 +
>   xen/arch/arm/arm64/mpu/Makefile          |  1 +
>   xen/arch/arm/arm64/mpu/head.S            | 70 ++++++++++++++++++++++++
>   xen/arch/arm/include/asm/arm64/sysregs.h | 50 +++++++++++++++++
>   xen/arch/arm/include/asm/mpu/arm64/mm.h  | 13 +++++
>   xen/arch/arm/include/asm/mpu/mm.h        | 18 ++++++
>   6 files changed, 153 insertions(+)
>   create mode 100644 xen/arch/arm/arm64/mpu/Makefile
>   create mode 100644 xen/arch/arm/arm64/mpu/head.S
>   create mode 100644 xen/arch/arm/include/asm/mpu/arm64/mm.h
>   create mode 100644 xen/arch/arm/include/asm/mpu/mm.h
> 
> diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
> index 7792bff597..aebccec63a 100644
> --- a/xen/arch/arm/Makefile
> +++ b/xen/arch/arm/Makefile
> @@ -1,6 +1,7 @@
>   obj-$(CONFIG_ARM_32) += arm32/
>   obj-$(CONFIG_ARM_64) += arm64/
>   obj-$(CONFIG_MMU) += mmu/
> +obj-$(CONFIG_MPU) += mpu/
>   obj-$(CONFIG_ACPI) += acpi/
>   obj-$(CONFIG_HAS_PCI) += pci/
>   ifneq ($(CONFIG_NO_PLAT),y)
> diff --git a/xen/arch/arm/arm64/mpu/Makefile b/xen/arch/arm/arm64/mpu/Makefile
> new file mode 100644
> index 0000000000..3340058c08
> --- /dev/null
> +++ b/xen/arch/arm/arm64/mpu/Makefile
> @@ -0,0 +1 @@
> +obj-y += head.o
> diff --git a/xen/arch/arm/arm64/mpu/head.S b/xen/arch/arm/arm64/mpu/head.S
> new file mode 100644
> index 0000000000..2b023c346a
> --- /dev/null
> +++ b/xen/arch/arm/arm64/mpu/head.S
> @@ -0,0 +1,70 @@
> +// SPDX-License-Identifier: GPL-2.0-only

Coding style: /* ... */

> +/*
> + * Start-of-day code for an Armv8-R MPU system.
> + */
> +
> +#include <asm/mm.h>
> +#include <asm/page.h>

I can't see any use of the definition of page.h. Is it necessary?

> +#include <asm/early_printk.h>

You include early_printk.h but don't use it.

> +
> +/*
> + * From the requirements of head.S we know that Xen image should
> + * be linked at XEN_START_ADDRESS, and all of text + data + bss
> + * must fit in 2MB.

Xen can be bigger than 2MB. But rather than hardcoding the limit, you 
want to use _end.

> On MPU systems, XEN_START_ADDRESS is also the
> + * address that Xen image should be loaded at. So for initial MPU
> + * regions setup, we use 2MB for Xen data memory to setup boot
> + * region, or the create boot regions code below will need adjustment.
> + */
> +#define XEN_START_MEM_SIZE      0x200000

See above.

> +
> +/*
> + * In boot stage, we will use 1 MPU region:
> + * Region#0: Normal memory for Xen text + data + bss (2MB)
> + */
> +#define BOOT_NORMAL_REGION_IDX  0x0
> +
> +/* MPU normal memory attributes. */
> +#define PRBAR_NORMAL_MEM        0x30    /* SH=11 AP=00 XN=00 */
> +#define PRLAR_NORMAL_MEM        0x0f    /* NS=0 ATTR=111 EN=1 */
> +
> +.macro write_pr, sel, prbar, prlar
> +    msr   PRSELR_EL2, \sel
> +    dsb   sy

I am not sure I understand why this is a dsb rather than isb. Can you 
clarify?

If a "dsb" is necessary, "sy" seems to be quite strict.

> +    msr   PRBAR_EL2, \prbar
> +    msr   PRLAR_EL2, \prlar
> +    dsb   sy
> +    isb
> +.endm
> +
> +.section .text.header, "ax", %progbits
> +
> +/*
> + * Static start-of-day EL2 MPU memory layout.
> + *
> + * It has a very simple structure, including:
> + *  - 2MB normal memory mappings of xen at XEN_START_ADDRESS, which
> + * is the address where Xen was loaded by the bootloader.
> + */

Please document a bit more the code and how the registers are used. For 
an example see the mmu/head.S code.

> +ENTRY(enable_boot_cpu_mm)
> +    /* Map Xen start memory to a normal memory region. */
> +    mov x0, #BOOT_NORMAL_REGION_IDX
> +    ldr x1, =XEN_START_ADDRESS
> +    and x1, x1, #MPU_REGION_MASK
> +    mov x3, #PRBAR_NORMAL_MEM
> +    orr x1, x1, x3
> +
> +    ldr x2, =XEN_START_ADDRESS
> +    mov x3, #(XEN_START_MEM_SIZE - 1)
> +    add x2, x2, x3
> +    and x2, x2, #MPU_REGION_MASK
> +    mov x3, #PRLAR_NORMAL_MEM
> +    orr x2, x2, x3
> +
> +    /*
> +     * Write to MPU protection region:
> +     * x0 for pr_sel, x1 for prbar x2 for prlar
> +     */
> +    write_pr x0, x1, x2
> +
> +    ret
> +ENDPROC(enable_boot_cpu_mm)

Missing emacs magic.

> diff --git a/xen/arch/arm/include/asm/arm64/sysregs.h b/xen/arch/arm/include/asm/arm64/sysregs.h
> index b593e4028b..0d122e1fa6 100644
> --- a/xen/arch/arm/include/asm/arm64/sysregs.h
> +++ b/xen/arch/arm/include/asm/arm64/sysregs.h
> @@ -462,6 +462,56 @@
>   #define ZCR_ELx_LEN_SIZE             9
>   #define ZCR_ELx_LEN_MASK             0x1ff
>   
> +/* System registers for AArch64 with PMSA */
> +#ifdef CONFIG_MPU

Can we define the registers in mpu/sysregs.h? This can then be included 
only where it is needed.

> +
> +/* EL2 MPU Protection Region Base Address Register encode */
> +#define PRBAR_EL2   S3_4_C6_C8_0
> +#define PRBAR1_EL2  S3_4_C6_C8_4
> +#define PRBAR2_EL2  S3_4_C6_C9_0
> +#define PRBAR3_EL2  S3_4_C6_C9_4
> +#define PRBAR4_EL2  S3_4_C6_C10_0
> +#define PRBAR5_EL2  S3_4_C6_C10_4
> +#define PRBAR6_EL2  S3_4_C6_C11_0
> +#define PRBAR7_EL2  S3_4_C6_C11_4
> +#define PRBAR8_EL2  S3_4_C6_C12_0
> +#define PRBAR9_EL2  S3_4_C6_C12_4
> +#define PRBAR10_EL2 S3_4_C6_C13_0
> +#define PRBAR11_EL2 S3_4_C6_C13_4
> +#define PRBAR12_EL2 S3_4_C6_C14_0
> +#define PRBAR13_EL2 S3_4_C6_C14_4
> +#define PRBAR14_EL2 S3_4_C6_C15_0
> +#define PRBAR15_EL2 S3_4_C6_C15_4
> +
> +/* EL2 MPU Protection Region Limit Address Register encode */
> +#define PRLAR_EL2   S3_4_C6_C8_1
> +#define PRLAR1_EL2  S3_4_C6_C8_5
> +#define PRLAR2_EL2  S3_4_C6_C9_1
> +#define PRLAR3_EL2  S3_4_C6_C9_5
> +#define PRLAR4_EL2  S3_4_C6_C10_1
> +#define PRLAR5_EL2  S3_4_C6_C10_5
> +#define PRLAR6_EL2  S3_4_C6_C11_1
> +#define PRLAR7_EL2  S3_4_C6_C11_5
> +#define PRLAR8_EL2  S3_4_C6_C12_1
> +#define PRLAR9_EL2  S3_4_C6_C12_5
> +#define PRLAR10_EL2 S3_4_C6_C13_1
> +#define PRLAR11_EL2 S3_4_C6_C13_5
> +#define PRLAR12_EL2 S3_4_C6_C14_1
> +#define PRLAR13_EL2 S3_4_C6_C14_5
> +#define PRLAR14_EL2 S3_4_C6_C15_1
> +#define PRLAR15_EL2 S3_4_C6_C15_5
> +
> +/* MPU Protection Region Enable Register encode */
> +#define PRENR_EL2 S3_4_C6_C1_1
> +
> +/* MPU Protection Region Selection Register encode */
> +#define PRSELR_EL2 S3_4_C6_C2_1
> +
> +/* MPU Type registers encode */
> +#define MPUIR_EL2 S3_4_C0_C0_4
> +
> +#endif
> +
>   /* Access to system registers */
>   
>   #define WRITE_SYSREG64(v, name) do {                    \
> diff --git a/xen/arch/arm/include/asm/mpu/arm64/mm.h b/xen/arch/arm/include/asm/mpu/arm64/mm.h
> new file mode 100644
> index 0000000000..d209eef6db
> --- /dev/null
> +++ b/xen/arch/arm/include/asm/mpu/arm64/mm.h
> @@ -0,0 +1,13 @@
> +// SPDX-License-Identifier: GPL-2.0-only

Coding style: /* ... */

> +/*
> + * mpu.h: Arm Memory Protection Unit definitions.

The file is name mm.h.

> + */
> +
> +#ifndef __ARM64_MPU_H__
> +#define __ARM64_MPU_H__
> +
> +#define MPU_REGION_SHIFT  6
> +#define MPU_REGION_ALIGN  (_AC(1, UL) << MPU_REGION_SHIFT)
> +#define MPU_REGION_MASK   (~(MPU_REGION_ALIGN - 1))
> +
> +#endif /* __ARM64_MPU_H__ */

Missing emacs magic.

> diff --git a/xen/arch/arm/include/asm/mpu/mm.h b/xen/arch/arm/include/asm/mpu/mm.h
> new file mode 100644
> index 0000000000..f5ebca8261
> --- /dev/null
> +++ b/xen/arch/arm/include/asm/mpu/mm.h

Do we need this file?

> @@ -0,0 +1,18 @@
> +#ifndef __ARCH_ARM_MPU__
> +#define __ARCH_ARM_MPU__
> +
> +#if defined(CONFIG_ARM_64)
> +# include <asm/mpu/arm64/mm.h>
> +#else
> +# error "unknown ARM variant"
> +#endif
> +
> +#endif /*  __ARCH_ARM_MPU__ */
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * indent-tabs-mode: nil
> + * End:
> + */

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 15:03:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 15:03:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784969.1194398 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjKCn-00018O-Mv; Wed, 28 Aug 2024 15:03:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784969.1194398; Wed, 28 Aug 2024 15:03:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjKCn-00018H-J7; Wed, 28 Aug 2024 15:03:29 +0000
Received: by outflank-mailman (input) for mailman id 784969;
 Wed, 28 Aug 2024 15:03:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=NRYu=P3=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjKCl-000187-T5
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 15:03:27 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ad8693f8-654e-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 17:03:26 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-a868d7f92feso871166766b.2
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 08:03:26 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e5143dc6sm256111866b.0.2024.08.28.08.03.24
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 08:03:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ad8693f8-654e-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724857406; x=1725462206; 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=mDVX7He1O/8M+9lQ6hRGuhTAR/5SuIZg5vw8mjOO8X8=;
        b=hATaX62QozmRUZYB4LmURPZL75+HLVyWSMDsz6hxLIpa902aJog1t16+3f5ahPk4NR
         PrWKtbOdZocs5L3F5ACo0FFHakDHzLjXcnNLTa3Detm4agauvk4f4ItLYzxgbGr7f2hf
         3ucTPAZxB2ogpI5dI+EeHqXH3UnkkuwTbB+mn9bmXk/W9fTVzgdritAADm661N8flgb2
         SJhN3IzJuOM/AcNaf9PYufwLxc00HN/3GdhJW5xAA3iUvoZZC4F06QbqrIWhsKKng56n
         Kcl3N6Dd7nDXAPUmcQ9h+LPrKOlK8ztLbV7LseN6tPxREDqlwSXB+7/G7u61TRREjTyU
         T+1w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724857406; x=1725462206;
        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=mDVX7He1O/8M+9lQ6hRGuhTAR/5SuIZg5vw8mjOO8X8=;
        b=cjCT2Hej1+Kb0d7zFOfuiaM1MzbfYZ4atfNv4mrWxOKg3PB91crutdaSZrQzYjFbHE
         P5Yr1O+QswImO0Zo9U+iHuGKV76Sqm2BGOJEK5m5PScMiZnjGkWBKpZWHL4Qf/B0sUI4
         jMy1i3bXa3OU4eNvVQhk3PH7PMCqJukdI9eGO9vLz3KXw/kaRZbDGF6jrDeELXYW3Xk/
         YQPjJhAeyFpzWBc3DhZmgOaIk+FU3mK90D2/0BAuXAlmolSE75/FbXhxqVl2ZYVZPIvJ
         yAk2QVhGsu4TdTPJ5GfjbHtOiTyaj7J4N5P2bJrB9pXzqi4pSFWN54bk2k68uruO9PQ/
         GP7A==
X-Forwarded-Encrypted: i=1; AJvYcCVfkZ9S0FCRM+EYvyYbFNIJT4r8Nk867xDjKGuNcAerG5pI3JU+jGCnzCaiuVkKN1hV/b8m++E/Ac4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyyFxIZniciHYlORS2B2281A0mytIH3G1tnrAIfmnktmSOez7Im
	kLIM8UfmkxdG71ARPnSIxZxO+5t4sMrQNaO4aDXkSOHBe13rnOlGgPu0P75wUw==
X-Google-Smtp-Source: AGHT+IFtOUWTC/kJ9aAYvUj2ubqs9ktLnqDAfsAmLBtj97DwAOurLqN0HJyTM4hY6qVKGFYQ0aJc3w==
X-Received: by 2002:a17:907:3f12:b0:a86:b042:585a with SMTP id a640c23a62f3a-a86b0425952mr1253240266b.57.1724857405518;
        Wed, 28 Aug 2024 08:03:25 -0700 (PDT)
Message-ID: <c7b8997d-8cbf-463e-bccd-ae850885f576@suse.com>
Date: Wed, 28 Aug 2024 17:03:23 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 5/7] xen/riscv: introduce and initialize SBI RFENCE
 extension
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
 <69da9fc18b9987285e4037ef08714e8f9faa66a7.1724256027.git.oleksii.kurochko@gmail.com>
 <10789eb4-ed96-48ab-860b-ec6f2d0e6341@suse.com>
 <d3fb6472f995646d9e998c847bfb2b9dc1488caa.camel@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: <d3fb6472f995646d9e998c847bfb2b9dc1488caa.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28.08.2024 15:11, oleksii.kurochko@gmail.com wrote:
> On Tue, 2024-08-27 at 16:19 +0200, Jan Beulich wrote:
>> On 21.08.2024 18:06, Oleksii Kurochko wrote:
>>> @@ -38,7 +51,265 @@ struct sbiret sbi_ecall(unsigned long ext,
>>> unsigned long fid,
>>>      return ret;
>>>  }
>>>  
>>> +static int sbi_err_map_xen_errno(int err)
>>> +{
>>> +    switch ( err )
>>> +    {
>>> +    case SBI_SUCCESS:
>>> +        return 0;
>>> +    case SBI_ERR_DENIED:
>>> +        return -EACCES;
>>> +    case SBI_ERR_INVALID_PARAM:
>>> +        return -EINVAL;
>>> +    case SBI_ERR_INVALID_ADDRESS:
>>> +        return -EFAULT;
>>> +    case SBI_ERR_NOT_SUPPORTED:
>>> +        return -EOPNOTSUPP;
>>> +    case SBI_ERR_FAILURE:
>>> +        fallthrough;
>>> +    default:
>>
>> What's the significance of the "fallthrough" here?
> To indicate that the fallthrough from the case SBI_ERR_FAILURE and
> default labels is intentional and should not be diagnosed by a compiler
> that warns on fallthrough. Or it is needed only when fallthough happen
> between switch's cases label ( not default label ) like in the
> following code ( should it be fallthrough here? ):
>     case SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA:
>     case SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA:
>     case SBI_EXT_RFENCE_REMOTE_SFENCE_VMA:

No, it's also not needed there. It's only needed when there are statements
in between.

> Additionally, I am considering whether the case SBI_ERR_FAILURE should
> be removed or if we should find the appropriate Xen error code for this
> case. I am uncertain which Xen error code from xen/errno.h would be
> appropriate.

There's nothing really suitable, I fear.

>>> +static unsigned long sbi_major_version(void)
>>> +{
>>> +    return MASK_EXTR(sbi_spec_version,
>>> SBI_SPEC_VERSION_MAJOR_MASK);
>>> +}
>>> +
>>> +static unsigned long sbi_minor_version(void)
>>> +{
>>> +    return MASK_EXTR(sbi_spec_version,
>>> SBI_SPEC_VERSION_MINOR_MASK);
>>> +}
>>
>> Both functions return less than 32-bit wide values. Why unsigned long
>> return types?
> We had this discussion in the previous patch series. Please look here:
> https://lore.kernel.org/xen-devel/253638c4-2256-4bdd-9f12-7f99e373355e@suse.com/

That was for the variables used here, not the functions. The functions
clip the values in the variables enough to no longer warrant wider-
than-int.

>>> +    if ( ret.error )
>>> +    {
>>> +        result = sbi_err_map_xen_errno(ret.error);
>>> +        printk("%s: hbase=%lu hmask=%#lx failed (error %d)\n",
>>> +               __func__, hbase, hmask, result);
>>
>> Considering that sbi_err_map_xen_errno() may lose information, I'd
>> recommend logging ret.error here.
> By 'lose information' you mean case SBI_ERR_FAILURE?

Or anything else hitting the default label there.

>>> +static int cf_check sbi_rfence_v02(unsigned long fid,
>>> +                                   const cpumask_t *cpu_mask,
>>> +                                   unsigned long start, unsigned
>>> long size,
>>> +                                   unsigned long arg4, unsigned
>>> long arg5)
>>> +{
>>> +    unsigned long hartid, cpuid, hmask = 0, hbase = 0, htop = 0;
>>> +    int result;
>>> +
>>> +    /*
>>> +     * hart_mask_base can be set to -1 to indicate that hart_mask
>>> can be
>>> +     * ignored and all available harts must be considered.
>>> +     */
>>> +    if ( !cpu_mask )
>>> +        return sbi_rfence_v02_real(fid, 0UL, -1UL, start, size,
>>> arg4);
>>> +
>>> +    for_each_cpu ( cpuid, cpu_mask )
>>> +    {
>>> +        /*
>>> +        * Hart IDs might not necessarily be numbered contiguously
>>> in
>>> +        * a multiprocessor system, but at least one hart must have
>>> a
>>> +        * hart ID of zero.
>>
>> Does this latter fact matter here in any way?
> It doesn't, just copy from the RISC-V spec the full sentence. If it
> would be better to drop the latter fact I will be happy to do that in
> the next patch version.

You may certainly leave extra information, but then you want to somehow
express which part is relevant and which part is "extra". One way of
achieving such would imo be to actually state that you're quoting from
some spec.

>>> +        * This means that it is possible for the hart ID mapping
>>> to look like:
>>> +        *  0, 1, 3, 65, 66, 69
>>> +        * In such cases, more than one call to
>>> sbi_rfence_v02_real() will be
>>> +        * needed, as a single hmask can only cover sizeof(unsigned
>>> long) CPUs:
>>> +        *  1. sbi_rfence_v02_real(hmask=0b1011, hbase=0)
>>> +        *  2. sbi_rfence_v02_real(hmask=0b1011, hbase=65)
>>> +        *
>>> +        * The algorithm below tries to batch as many harts as
>>> possible before
>>> +        * making an SBI call. However, batching may not always be
>>> possible.
>>> +        * For example, consider the hart ID mapping:
>>> +        *   0, 64, 1, 65, 2, 66
>>
>> Just to mention it: Batching is also possible here: First (0,1,2),
>> then
>> (64,65,66). It just requires a different approach. Whether switching
>> is
>> worthwhile depends on how numbering is done on real world systems.
> For sure, it's possible to do that. I was just trying to describe the
> currently implemented algorithm. If you think it's beneficial to add
> that information to the comment, I can include it as well.

What I'd like to ask for is that you make a difference between "cannot"
and "we don't".

Jan


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 16:12:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 16:12:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.784995.1194408 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjLHG-0006hF-HR; Wed, 28 Aug 2024 16:12:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 784995.1194408; Wed, 28 Aug 2024 16:12:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjLHG-0006h8-DJ; Wed, 28 Aug 2024 16:12:10 +0000
Received: by outflank-mailman (input) for mailman id 784995;
 Wed, 28 Aug 2024 16:12:09 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=3BgB=P3=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sjLHF-0006h0-OX
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 16:12:09 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 413faff4-6558-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 18:11:59 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-533488ffaddso8452661e87.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 09:11:59 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5334ea5d2e6sm2210059e87.191.2024.08.28.09.11.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 09:11:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 413faff4-6558-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724861519; x=1725466319; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=avBjpsSY3UaFLOZlShl6YtYSFJebiMm7jV8zSyEbyY0=;
        b=LIydCsg5XpvVbvohVQU+WkJgjLkTGBuhLFrjiTyofTpImmfpLKAOts0Gymp5Dr4ETF
         zQgo3SzcoED/o0YWNRQ3o9xXfQa+zb3o7E6k+FhvgfYQG1LjFXHx0761xaA9DqHNDD6e
         KFfPPj7IN5bbJZbmViHALLSKPRX1SAk9S2iJpzu3zqjYKzGXn7kTGO/3ar4q04QXUCUR
         UH9N6WiYKe+obg6Ft101VkbzEtc3Ge/7ZdHGzBokaHI3r7SrRYiZHElq86dAzao4Lx/W
         iDBmUhUUvOIUyxqWb8/pP9PGMfByAFyo/DtDTlg+z9SFHef34iPfOwqgOSFDveGanSOZ
         sTbw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724861519; x=1725466319;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=avBjpsSY3UaFLOZlShl6YtYSFJebiMm7jV8zSyEbyY0=;
        b=vyoFCIB7KigIqYkHGRMfVmjSk64y9XRwBoMi9bcAJ60zF1qU9NffM+FKs/pGH4LqJk
         DCbycusH0rdtffPLCJy1iHTebhbsDOgh6MJYfzUSU1XdVBQQgnAEMxwLY8ezCOLFwcUr
         b670TqMytlQn1LsEKr/B/fnjg58RZaZdU/nEm5+KA2Mw7wo8bkWE37sCs11Z8DBQ8NzG
         tJwk234TMCi5xbxp5ymIIod432CaJFDv6cyQj8m8iYVESFZNT7VFtu84F8OeZS2tTx2y
         HOBbSSPAIn5XOWDh+P86B0SKHBKVTja5GVY4WpVOQZx8jczyPYelKrHY+Lp/WmIi0c5L
         lRSQ==
X-Forwarded-Encrypted: i=1; AJvYcCULg0yDhFIACFZLHGDhT8q3sWgp4OkarHEkBB4C6LJqG6q6FVzkFwVwbcoJK+S21iyfwXJz6vgUhdE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxZzJbwcgM36sRUK9A+2Zbppj7Qyrq+66MCNfKEkeiHp/fBKXAO
	s0g2UdQmq0CFhk5UNpCkpjFmr2H6SmRPSJczCT7fLKn/JoKwIAVmRbXrfw==
X-Google-Smtp-Source: AGHT+IFvbvmxhrfi7xvV1pShoa0AVP0sn5NlYndekHZzLNoDt8z4QASJdtEFAuTQOQvEhq6Cguz6Mg==
X-Received: by 2002:a05:6512:68f:b0:533:71f:3a53 with SMTP id 2adb3069b0e04-5343877889amr12922406e87.19.1724861518378;
        Wed, 28 Aug 2024 09:11:58 -0700 (PDT)
Message-ID: <ed84c53454cb63082aa96befe89a89d8f234ef71.camel@gmail.com>
Subject: Re: [PATCH v5 6/7] xen/riscv: page table handling
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Wed, 28 Aug 2024 18:11:57 +0200
In-Reply-To: <c0005454-3b34-427d-8ea0-620aba632487@suse.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
	 <090e617d88b279ae88f1a7859875a7e1a0c6ae73.1724256027.git.oleksii.kurochko@gmail.com>
	 <c0005454-3b34-427d-8ea0-620aba632487@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.4 (3.52.4-1.fc40app2) 
MIME-Version: 1.0

On Tue, 2024-08-27 at 17:00 +0200, Jan Beulich wrote:
> On 21.08.2024 18:06, Oleksii Kurochko wrote:
> > Implement map_pages_to_xen() which requires several
> > functions to manage page tables and entries:
> > - pt_update()
> > - pt_mapping_level()
> > - pt_update_entry()
> > - pt_next_level()
> > - pt_check_entry()
> >=20
> > To support these operations, add functions for creating,
> > mapping, and unmapping Xen tables:
> > - create_table()
> > - map_table()
> > - unmap_table()
> >=20
> > Introduce internal macros starting with PTE_* for convenience.
> > These macros closely resemble PTE bits, with the exception of
> > PTE_SMALL, which indicates that 4KB is needed.
>=20
> What macros are you talking about here? Is this partially stale, as
> only PTE_SMALL and PTE_POPULATE (and a couple of masks) are being
> added?
I am speaking about macros connected to masks:
     #define PTE_R_MASK(x)   ((x) & PTE_READABLE)
     #define PTE_W_MASK(x)   ((x) & PTE_WRITABLE)
     #define PTE_X_MASK(x)   ((x) & PTE_EXECUTABLE)
  =20
     #define PTE_RWX_MASK(x) ((x) & (PTE_READABLE | PTE_WRITABLE |
   PTE_EXECUTABLE))

>=20
> > --- a/xen/arch/riscv/include/asm/flushtlb.h
> > +++ b/xen/arch/riscv/include/asm/flushtlb.h
> > @@ -5,12 +5,24 @@
> > =C2=A0#include <xen/bug.h>
> > =C2=A0#include <xen/cpumask.h>
> > =C2=A0
> > +#include <asm/sbi.h>
> > +
> > =C2=A0/* Flush TLB of local processor for address va. */
> > =C2=A0static inline void flush_tlb_one_local(vaddr_t va)
> > =C2=A0{
> > =C2=A0=C2=A0=C2=A0=C2=A0 asm volatile ( "sfence.vma %0" :: "r" (va) : "=
memory" );
> > =C2=A0}
> > =C2=A0
> > +/*
> > + * Flush a range of VA's hypervisor mappings from the TLB of all
> > + * processors in the inner-shareable domain.
> > + */
>=20
> Isn't inner-sharable an Arm term? Don't you simply mean "all" here?
Yes, this is Arm term. It should used "all" instead. Thanks.

>=20
> > @@ -68,6 +111,20 @@ static inline bool pte_is_valid(pte_t p)
> > =C2=A0=C2=A0=C2=A0=C2=A0 return p.pte & PTE_VALID;
> > =C2=A0}
> > =C2=A0
> > +inline bool pte_is_table(const pte_t p)
> > +{
> > +=C2=A0=C2=A0=C2=A0 return ((p.pte & (PTE_VALID |
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PTE_READABLE |
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PTE_WRITABLE |
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PTE_EXECUTABLE)) =
=3D=3D PTE_VALID);
> > +}
>=20
> In how far is the READABLE check valid here? You (imo correctly) ...
>=20
> > +static inline bool pte_is_mapping(const pte_t p)
> > +{
> > +=C2=A0=C2=A0=C2=A0 return (p.pte & PTE_VALID) &&
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (p.pte & =
(PTE_WRITABLE | PTE_EXECUTABLE));
> > +}
>=20
> ... don't consider this bit here.
pte_is_mapping() seems to me is correct as according to the RISC-V
privileged spec:
   4. Otherwise, the PTE is valid. If pte.r =3D 1 or pte.x =3D 1, go to ste=
p=20
   5. Otherwise, this PTE is a pointer to the next level of the page  =20
   table.
   5. A leaf PTE has been found. ...

and regarding pte_is_table() READABLE check is valid as we have to
check only that pte.r =3D pte.x =3D 0. WRITABLE check should be dropped. Or
just use define pte_is_table() as:
   inline bool pte_is_table(const pte_t p)
   {
   	return !pte_is_mapping(p);
   }


>=20
> > --- a/xen/arch/riscv/include/asm/riscv_encoding.h
> > +++ b/xen/arch/riscv/include/asm/riscv_encoding.h
> > @@ -164,6 +164,7 @@
> > =C2=A0#define SSTATUS_SD			SSTATUS64_SD
> > =C2=A0#define SATP_MODE			SATP64_MODE
> > =C2=A0#define SATP_MODE_SHIFT			SATP64_MODE_SHIFT
> > +#define SATP_PPN_MASK			_UL(0x00000FFFFFFFFFFF)
> > =C2=A0
> > =C2=A0#define HGATP_PPN			HGATP64_PPN
> > =C2=A0#define HGATP_VMID_SHIFT		HGATP64_VMID_SHIFT
>=20
> This looks odd, padding-wise, but that's because hard tabs are being
> used here. Is that intentional?
I use tabs here because riscv_encoding.h was copied from Linux kernel
which uses hard tabs and definitions above use 3 tabs so I used 3 hard
tabs too.

>=20
> > --- /dev/null
> > +++ b/xen/arch/riscv/pt.c
> > @@ -0,0 +1,420 @@
> > +#include <xen/bug.h>
> > +#include <xen/domain_page.h>
> > +#include <xen/errno.h>
> > +#include <xen/mm.h>
> > +#include <xen/mm-frame.h>
> > +#include <xen/pmap.h>
> > +#include <xen/spinlock.h>
> > +
> > +#include <asm/flushtlb.h>
> > +#include <asm/page.h>
> > +
> > +static inline const mfn_t get_root_page(void)
> > +{
> > +=C2=A0=C2=A0=C2=A0 paddr_t root_maddr =3D (csr_read(CSR_SATP) & SATP_P=
PN_MASK) <<
> > PAGE_SHIFT;
> > +
> > +=C2=A0=C2=A0=C2=A0 return maddr_to_mfn(root_maddr);
> > +}
> > +
> > +/* Sanity check of the entry. */
> > +static bool pt_check_entry(pte_t entry, mfn_t mfn, unsigned int
> > flags)
> > +{
> > +=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * See the comment about the possible combinat=
ion of (mfn,
> > flags) in
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * the comment above pt_update().
> > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +
> > +=C2=A0=C2=A0=C2=A0 /* Sanity check when modifying an entry. */
> > +=C2=A0=C2=A0=C2=A0 if ( (flags & PTE_VALID) && mfn_eq(mfn, INVALID_MFN=
) )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* We don't allow modifying=
 an invalid entry. */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( !pte_is_valid(entry) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pri=
ntk("Modifying invalid entry is not allowed.\n");
>=20
> Perhaps all of these printk()s should be dprintk()?
It could be dprintk() but at the same time I don't see any issue if it
will be printed once.

>  And not have a full
> stop?
By "full stop," do you mean something like panic() or BUG_ON()? The
error is propagated up to the caller, which then calls panic().
Anexample of this is:
       if ( (offset + size) > MB(2) )
       {
           rc =3D map_pages_to_xen(BOOT_FDT_VIRT_START + MB(2),
                                 maddr_to_mfn(base_paddr + MB(2)),
                                 MB(2) >> PAGE_SHIFT,
                                 PAGE_HYPERVISOR_RO);
           if ( rc )
               panic("Unable to map the device-tree\n");
       }
If it would be better for some reason to call panic() or BUG_ON() as
soon as pt_check_entry() returns false, I can do it that way as well.

>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret=
urn false;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* We don't allow modifying=
 a table entry */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( pte_is_table(entry) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pri=
ntk("Modifying a table entry is not allowed.\n");
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret=
urn false;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > +=C2=A0=C2=A0=C2=A0 }
> > +=C2=A0=C2=A0=C2=A0 /* Sanity check when inserting a mapping */
> > +=C2=A0=C2=A0=C2=A0 else if ( flags & PTE_VALID )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* We should be here with a=
 valid MFN. */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ASSERT(!mfn_eq(mfn, INVALID=
_MFN));
>=20
> This is odd to have here, considering the if() further up.
Agree, ASSERT() could be drop.

>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * We don't allow repl=
acing any valid entry.
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * Note that the funct=
ion pt_update() relies on this
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * assumption and will=
 skip the TLB flush (when Svvptc
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * extension will be r=
atified). The function will need
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * to be updated if th=
e check is relaxed.
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( pte_is_valid(entry) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if =
( pte_is_mapping(entry) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 printk("Changing MFN for a valid entry is not
> > allowed (%#"PRI_mfn" -> %#"PRI_mfn").\n",
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 mfn_x(mfn_f=
rom_pte(entry)), mfn_x(mfn));
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 els=
e
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 printk("Trying to replace a table with a
> > mapping.\n");
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret=
urn false;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > +=C2=A0=C2=A0=C2=A0 }
> > +=C2=A0=C2=A0=C2=A0 /* Sanity check when removing a mapping. */
> > +=C2=A0=C2=A0=C2=A0 else if ( (flags & (PTE_VALID | PTE_POPULATE)) =3D=
=3D 0 )
>=20
> The PTE_VALID part of the check is pointless considering the earlier
> if(). I guess you may want to have it for doc purposes ...
Yes, it just helps to read the code and understand "confusing" if's()
above.

>=20
> Since further up you're using "else if ( flags & PTE_VALID )" imo
> here you want to use "else if ( !(flags & ...) )".
>=20
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* We should be here with a=
n invalid MFN. */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ASSERT(mfn_eq(mfn, INVALID_=
MFN));
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* We don't allow removing =
a table */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( pte_is_table(entry) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pri=
ntk("Removing a table is not allowed.\n");
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret=
urn false;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
>=20
> Is this restriction temporary?
Yes.

>=20
> > +=C2=A0=C2=A0=C2=A0 }
> > +=C2=A0=C2=A0=C2=A0 /* Sanity check when populating the page-table. No =
check so
> > far. */
> > +=C2=A0=C2=A0=C2=A0 else
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ASSERT(flags & PTE_POPULATE=
);
>=20
> This again is redundant with earlier if() conditions.
>=20
> > +#define XEN_TABLE_MAP_FAILED 0
> > +#define XEN_TABLE_SUPER_PAGE 1
> > +#define XEN_TABLE_NORMAL 2
> > +
> > +/*
> > + * Take the currently mapped table, find the corresponding entry,
> > + * and map the next table, if available.
> > + *
> > + * The alloc_tbl parameters indicates whether intermediate tables
> > should
> > + * be allocated when not present.
> > + *
> > + * Return values:
> > + *=C2=A0 XEN_TABLE_MAP_FAILED: Either alloc_only was set and the entry
> > + *=C2=A0 was empty, or allocating a new page failed.
> > + *=C2=A0 XEN_TABLE_NORMAL: next level or leaf mapped normally
> > + *=C2=A0 XEN_TABLE_SUPER_PAGE: The next entry points to a superpage.
> > + */
> > +static int pt_next_level(bool alloc_tbl, pte_t **table, unsigned
> > int offset)
>=20
> Having the boolean first is unusual, but well - it's your choice.
>=20
> > +{
> > +=C2=A0=C2=A0=C2=A0 pte_t *entry;
> > +=C2=A0=C2=A0=C2=A0 int ret;
> > +=C2=A0=C2=A0=C2=A0 mfn_t mfn;
> > +
> > +=C2=A0=C2=A0=C2=A0 entry =3D *table + offset;
> > +
> > +=C2=A0=C2=A0=C2=A0 if ( !pte_is_valid(*entry) )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( alloc_tbl )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret=
urn XEN_TABLE_MAP_FAILED;
>=20
> Is this condition meant to be inverted?
if alloc_tbl =3D true we shouldn't allocatetable as:
     * The intermediate page table shouldn't be allocated when MFN
isn't
     * valid and we are not populating page table.
...
    */
    bool alloc_tbl =3D mfn_eq(mfn, INVALID_MFN) && !(flags &
PTE_POPULATE);

So if mfn =3D INVALID_MFN and flags.PTE_POPULATE=3D0 it means that this
table shouldn't be allocated and thereby pt_next_level() should return
XEN_TABLE_MAP_FAILED.

Or to invert if ( alloc_tbl )it will be needed to invert defintion of
alloc_tbl:
 bool alloc_tbl =3D !mfn_eq(mfn, INVALID_MFN) || (flags & PTE_POPULATE);
>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret =3D create_table(entry)=
;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( ret )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ret=
urn XEN_TABLE_MAP_FAILED;
>=20
> You don't really use "ret". Why not omit the local variable, even
> more so that it has too wide scope?
I'll omit that, it is really useless.

>=20
> > +/* Update an entry at the level @target. */
> > +static int pt_update_entry(mfn_t root, unsigned long virt,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 mfn_t mfn, unsigned int target,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0 unsigned int flags)
> > +{
> > +=C2=A0=C2=A0=C2=A0 int rc;
> > +=C2=A0=C2=A0=C2=A0 unsigned int level =3D HYP_PT_ROOT_LEVEL;
> > +=C2=A0=C2=A0=C2=A0 pte_t *table;
> > +=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * The intermediate page table shouldn't be al=
located when MFN
> > isn't
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * valid and we are not populating page table.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * This means we either modify permissions or =
remove an entry,
> > or
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * inserting brand new entry.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 *
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * See the comment above pt_update() for an ad=
ditional
> > explanation about
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * combinations of (mfn, flags).
> > +=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0 bool alloc_tbl =3D mfn_eq(mfn, INVALID_MFN) && !(fl=
ags &
> > PTE_POPULATE);
>=20
> Is this meant to be inverted, too (to actually match variable name
> and
> comment)?
Oh, you mentioned that too. I wrote the similar above. I think it would
be better to invert if we want to use alloc_tbl variable name.

>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bre=
ak;
> > +=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0 if ( level !=3D target )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printk("%s: Shattering supe=
rpage is not supported\n",
> > __func__);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rc =3D -EOPNOTSUPP;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto out;
> > +=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0 entry =3D table + offsets[level];
> > +
> > +=C2=A0=C2=A0=C2=A0 rc =3D -EINVAL;
> > +=C2=A0=C2=A0=C2=A0 if ( !pt_check_entry(*entry, mfn, flags) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto out;
> > +
> > +=C2=A0=C2=A0=C2=A0 /* We are removing the page */
> > +=C2=A0=C2=A0=C2=A0 if ( !(flags & PTE_VALID) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 memset(&pte, 0x00, sizeof(p=
te));
> > +=C2=A0=C2=A0=C2=A0 else
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* We are inserting a mappi=
ng =3D> Create new pte. */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( !mfn_eq(mfn, INVALID_M=
FN) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pte=
 =3D pte_from_mfn(mfn, PTE_VALID);
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else /* We are updating the=
 permission =3D> Copy the current
> > pte. */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pte=
 =3D *entry;
> > +
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* update permission accord=
ing to the flags */
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pte.pte |=3D PTE_RWX_MASK(f=
lags) | PTE_ACCESSED | PTE_DIRTY;
>=20
> When updating an entry, don't you also need to clear (some of) the
> flags?
I am not sure why some flags should be cleared. Here we are taking only
necessary for pte flags such as R, W, X or other bits in flags are
ignored.

>=20
> > +/* Return the level where mapping should be done */
> > +static int pt_mapping_level(unsigned long vfn, mfn_t mfn, unsigned
> > long nr,
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0 unsigned int flags)
> > +{
> > +=C2=A0=C2=A0=C2=A0 unsigned int level =3D 0;
> > +=C2=A0=C2=A0=C2=A0 unsigned long mask;
> > +=C2=A0=C2=A0=C2=A0 unsigned int i;
> > +
> > +=C2=A0=C2=A0=C2=A0 /* Use blocking mapping unless the caller requests =
4K mapping
> > */
> > +=C2=A0=C2=A0=C2=A0 if ( unlikely(flags & PTE_SMALL) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return level;
> > +
> > +=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * Don't take into account the MFN when removi=
ng mapping (i.e
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * MFN_INVALID) to calculate the correct targe=
t order.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 *
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * `vfn` and `mfn` must be both superpage alig=
ned.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * They are or-ed together and then checked ag=
ainst the size
> > of
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * each level.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 *
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * `left` is not included and checked separate=
ly to allow
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * superpage mapping even if it is not properl=
y aligned (the
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * user may have asked to map 2MB + 4k).
>=20
> What is this about? There's nothing named "left" here.
It refer to "remaining" pages or "leftover" space after trying to align
a mapping to a superpage boundary.
>=20
> > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0 mask =3D !mfn_eq(mfn, INVALID_MFN) ? mfn_x(mfn) : 0=
;
> > +=C2=A0=C2=A0=C2=A0 mask |=3D vfn;
> > +
> > +=C2=A0=C2=A0=C2=A0 for ( i =3D HYP_PT_ROOT_LEVEL; i !=3D 0; i-- )
> > +=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( !(mask & (BIT(XEN_PT_L=
EVEL_ORDER(i), UL) - 1)) &&
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 (nr >=3D BIT(XEN_PT_LEVEL_ORDER(i), UL)) )
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 {
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 lev=
el =3D i;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 bre=
ak;
> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 }
> > +=C2=A0=C2=A0=C2=A0 }
> > +
> > +=C2=A0=C2=A0=C2=A0 return level;
> > +}
> > +
> > +static DEFINE_SPINLOCK(xen_pt_lock);
>=20
> Another largely meaningless xen_ prefix?
Thanks. I'll drop it.

>=20
> > +/*
> > + * If `mfn` equals `INVALID_MFN`, it indicates that the following
> > page table
> > + * update operation might be related to either populating the
> > table (
> > + * PTE_POPULATE will be set additionaly), destroying a mapping, or
> > modifying
> > + * an existing mapping.
>=20
> And the latter two are distinguished by? PTE_VALID?
inserting -> (PTE_VALID=3D1 + (mfn=3Dsomething valid))
destroying-> ( PTE_VALID=3D0 )

>=20
> > + * If `mfn` is valid and flags has PTE_VALID bit set then it means
> > that
> > + * inserting will be done.
> > + */
>=20
> What about mfn !=3D INVALID_MFN and PTE_VALID clear?
PTE_VALID=3D0 will be always considered as destroying and no matter what
is mfn value as in this case the removing is done in the way where mfn
isn't used:
        memset(&pte, 0x00, sizeof(pte));


>  Also note that "`mfn` is
> valid" isn't the same as "mfn !=3D INVALID_MFN". You want to be precise
> here,
> to avoid confusion later on. (I say that knowing that we're still
> fighting
> especially shadow paging code on x86 not having those properly
> separated.)
If it is needed to be precise and mfn is valid isn't the same as "mfn
!=3D INVALID_MFN" only for the case of shadow paging?

> >=20
>=20
> > +=C2=A0=C2=A0=C2=A0 unsigned long left =3D nr_mfns;
> > +
> > +=C2=A0=C2=A0=C2=A0 const mfn_t root =3D get_root_page();
> > +
> > +=C2=A0=C2=A0=C2=A0 /*
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * It is bad idea to have mapping both writeab=
le and
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * executable.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * When modifying/creating mapping (i.e PTE_VA=
LID is set),
> > +=C2=A0=C2=A0=C2=A0=C2=A0 * prevent any update if this happen.
> > +=C2=A0=C2=A0=C2=A0=C2=A0 */
> > +=C2=A0=C2=A0=C2=A0 if ( (flags & PTE_VALID) && PTE_W_MASK(flags) &&
> > PTE_X_MASK(flags) )
>=20
> Seeing them in use, I wonder about the naming of those PTE_?_MASK()
> macros. Along with the lhs, why not simply (flags & PTE_...)?
Hmm, good point. They can be really dropped with simplification of the
mentioned if(...).

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 16:20:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 16:20:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785003.1194418 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjLPc-0000Ya-CF; Wed, 28 Aug 2024 16:20:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785003.1194418; Wed, 28 Aug 2024 16:20:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjLPc-0000YT-9C; Wed, 28 Aug 2024 16:20:48 +0000
Received: by outflank-mailman (input) for mailman id 785003;
 Wed, 28 Aug 2024 16:20:47 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjLPb-0000YA-Iw; Wed, 28 Aug 2024 16:20:47 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjLPb-0004Fp-AS; Wed, 28 Aug 2024 16:20:47 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjLPb-0004j1-1e; Wed, 28 Aug 2024 16:20:47 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjLPb-0005YF-1H; Wed, 28 Aug 2024 16:20:47 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=fUt8Nn5UmpHibfP4AUBE7G9hRjxXp1Fa67V34s+cMxQ=; b=J5BwAIJL3Q1NjIlUr2H3/uzuUL
	HkH04XHH3R1ianK/3GL2VzEFLlYz0ZkObTkbo3wxlgElOcaeb83Weg0D533dGKZMunhdRfr6L78LO
	PAIbi/60eoBYuo3qYLnRUx4QoufERA/9gyI5BOfzhA6ak63Diu0SciAD6wjvHkObMiI8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187383-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187383: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=1fd2f9ec8f16cc8efb949888db94eb42006f77c6
X-Osstest-Versions-That:
    ovmf=a0ac7cf67afd382b4bd13a402bb6100a435b5b7b
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 16:20:47 +0000

flight 187383 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187383/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 1fd2f9ec8f16cc8efb949888db94eb42006f77c6
baseline version:
 ovmf                 a0ac7cf67afd382b4bd13a402bb6100a435b5b7b

Last test of basis   187382  2024-08-28 12:45:12 Z    0 days
Testing same since   187383  2024-08-28 14:45:07 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Hongbin1 Zhang <hongbin1.zhang@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   a0ac7cf67a..1fd2f9ec8f  1fd2f9ec8f16cc8efb949888db94eb42006f77c6 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 16:38:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 16:38:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785014.1194428 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjLgU-0003PS-QS; Wed, 28 Aug 2024 16:38:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785014.1194428; Wed, 28 Aug 2024 16:38:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjLgU-0003PL-Mv; Wed, 28 Aug 2024 16:38:14 +0000
Received: by outflank-mailman (input) for mailman id 785014;
 Wed, 28 Aug 2024 16:38:13 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=up7O=P3=bounce.vates.tech=bounce-md_30504962.66cf5270.v1-b859026ae7614831888f2940ed2e1c80@srs-se1.protection.inumbo.net>)
 id 1sjLgT-0003PF-44
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 16:38:13 +0000
Received: from mail137-25.atl71.mandrillapp.com
 (mail137-25.atl71.mandrillapp.com [198.2.137.25])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e90eeb62-655b-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 18:38:10 +0200 (CEST)
Received: from pmta07.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail137-25.atl71.mandrillapp.com (Mailchimp) with ESMTP id
 4Wv9810SqMz35hTny
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 16:38:09 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 b859026ae7614831888f2940ed2e1c80; Wed, 28 Aug 2024 16:38:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e90eeb62-655b-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724863089; x=1725123589;
	bh=UOStic/LZX6XVX/sSEGr44o+pPQAQeLXe2Il6UL0+vM=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=UAu51CzXB0hCoVPRGkliY6rRNVWQK6KeP72alXFA6eS8rBxsP/zlFDBJAQQ3eTtg2
	 gTlM/b+AUjTcilFH2yeNRWI0cGxeGYZYCWwRYK36natSbEHWbsDEWEdj/YHAsS9JMC
	 4cj/0DzygeY6faILgBWvHaVixlRYnaZnxzLZRPD2WHR4ejpxbfOtmEm/APbOIi44iD
	 Fi7ah+4nGiABHOG9YmFM9tUAj147+u7eiex7TSl9GuKErJZi1lqtKuXoWJ8/8ZG61A
	 /Ly3GKsIhzFdXYApkokiCu0360HZegiMHRNGGxVv624hR3Ee1QNVb4AoXTeo9zFDjv
	 DyWTK50+nVGOg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724863089; x=1725123589; i=anthony.perard@vates.tech;
	bh=UOStic/LZX6XVX/sSEGr44o+pPQAQeLXe2Il6UL0+vM=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=pbhfuglFbv8T7mTCzTtHhEHykIICvSqqsKNZlhASW+DQ0wFArm0ysrKQixKsEnr2x
	 g357jbv1r7SaZs7vSkbMdRRMeLXCE5TsaSeLb6yUrHc2YajWD9iQhHsdr8xFjWoupv
	 5GBjnVjNE1LP8lAZUhBd7Gl9LVmr0UfpCE85Y9T4FGNdW5AzD5cLkVCyztEIP/Qulp
	 ioSmtqvJ/ly5sWuYoKWK4HoCytQh9bSh+nd8eFVARm/+DYO02W12YMRynpkwPo5l3a
	 gUacZYkcdk/B4LkeyngUQhWiBlSZG/2GatQysef7kTB3deYi5KUYXxO1oUNltqa8B6
	 5xYopAMObB1JQ==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=20v3=201/3]=20hw/xen/xen=5Fpt:=20Save=20back=20data=20only=20for=20declared=20registers?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724863087792
To: =?utf-8?Q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Cc: qemu-devel@nongnu.org, Stefano Stabellini <sstabellini@kernel.org>, Paul Durrant <paul@xen.org>, "open list:X86 Xen CPUs" <xen-devel@lists.xenproject.org>
Message-Id: <Zs9SbXAJ++8mj/uR@l14>
References: <cover.f5d45e3c2fb87552abfaf80982b0b724fca2134c.1714955598.git-series.marmarek@invisiblethingslab.com> <aa391652c33c8a4a64db8f27ad50ccb65600b293.1714955598.git-series.marmarek@invisiblethingslab.com>
In-Reply-To: <aa391652c33c8a4a64db8f27ad50ccb65600b293.1714955598.git-series.marmarek@invisiblethingslab.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.b859026ae7614831888f2940ed2e1c80?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240828:md
Date: Wed, 28 Aug 2024 16:38:08 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Mon, May 06, 2024 at 02:33:20AM +0200, Marek Marczykowski-G=C3=B3recki w=
rote:
> Call pci_default_write_config() only after resolving any handlers from
> XenPTRegInfo structures, and only with a value updated with those
> handlers. This is important for two reasons:
> 1. XenPTRegInfo has ro_mask which needs to be enforced - Xen-specific
>    hooks do that on their own (especially xen_pt_*_reg_write()).
> 2. Not setting value early allows hooks to see the old value too.
> 
> If it would be only about the first point, setting PCIDevice.wmask would
> probably be sufficient, but given the second point, change those
> writes.
> 
> Relevant handlers already save data back to the emulated registers
> space, call the pci_default_write_config() only for its side effects.
> 
> Signed-off-by: Marek Marczykowski-G=C3=B3recki <marmarek@invisiblethingsl=
ab.com>
> ---
> v3:
>  - use emulated register value for pci_default_write_config() call, not
>    the one for writting back to the hardware
>  - greatly simplify the patch by calling pci_default_write_config() on
>    the whole value
> v2:
>  - rewrite commit message, previous one was very misleading
>  - fix loop saving register values
>  - fix int overflow when calculating write mask

Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 16:38:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 16:38:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785016.1194437 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjLgs-0003pH-13; Wed, 28 Aug 2024 16:38:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785016.1194437; Wed, 28 Aug 2024 16:38:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjLgr-0003pA-Ul; Wed, 28 Aug 2024 16:38:37 +0000
Received: by outflank-mailman (input) for mailman id 785016;
 Wed, 28 Aug 2024 16:38:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=HXF/=P3=bounce.vates.tech=bounce-md_30504962.66cf5289.v1-da54c3286194458496dd3f8169c1f6be@srs-se1.protection.inumbo.net>)
 id 1sjLgq-0003op-6O
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 16:38:36 +0000
Received: from mail187-32.suw11.mandrillapp.com
 (mail187-32.suw11.mandrillapp.com [198.2.187.32])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f77c76f2-655b-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 18:38:34 +0200 (CEST)
Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail187-32.suw11.mandrillapp.com (Mailchimp) with ESMTP id
 4Wv98T2sbBzQXg3by
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 16:38:33 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 da54c3286194458496dd3f8169c1f6be; Wed, 28 Aug 2024 16:38:33 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f77c76f2-655b-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724863113; x=1725123613;
	bh=Vfw4UjiIvn5BMezQQ2ACcscxr03OJTFE65zr3iU6S+U=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=aMc0CDJmaQ1h6U0J5Qre0/9oXdv+RvLrY/VggU1Ep1dpvVObpsMUKirD+6POSSDMR
	 2DuxfWEOhkurBxclqMGbER1bQ3flrG7Gp+/9joU5ijyCtbqmOyfU7uCYEQtyzwLCWL
	 kl1L1vdxXg+/8CG5gwIbEXlMOcypWrDJ6pzT7Ekswb3WqEcGsCC+fw55xoi1X2pbXq
	 noPm8UvevbPrx7VFNu4Yhd0uVOfswAIYTr4SHc+kFhHLPOti3iWI5rfeJqrHvZjlM5
	 0FOruUoCUwamFcJ37GRejictd3mP7OYKqxHzkOY0n1xVSFKytTBk/6e6wldmuX6wVS
	 07Xy8WqGWu4IA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724863113; x=1725123613; i=anthony.perard@vates.tech;
	bh=Vfw4UjiIvn5BMezQQ2ACcscxr03OJTFE65zr3iU6S+U=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=JBXGOSxSgEljhpXduvKLV7lAr5IJTcXAEDItqnyEZkKLqKulr7YM8hf+OThrcjIYl
	 M9V6FPzysiZNm5gZDgV/wv9RHQS30Bw/K9FHNrUSh6CQTkw/DR6og0pC8nEOhZse8R
	 1YdXKXj7XMcdiM999rNI8iSD96BQQdNn3BVBd12iaODJEVzWP9DcrCbgNU8B3mORNH
	 Dk+D9dNK9rHr29I+yDMNeUJwnr2UUAVTRpQ5sCfF4EL9b+0I0EKk/oVjPwCnyDI+Hq
	 9CmHYUV8SXenrmtGpHDD6oShMxBHC6/vLwlNZcT9lQxbRGKgadO79ZlDgrHLIvjzyt
	 utlXLPCI2+k9A==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=20v3=202/3]=20Update=20Xen's=20features.h=20header?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724863112535
To: =?utf-8?Q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Cc: qemu-devel@nongnu.org, Stefano Stabellini <sstabellini@kernel.org>, Paul Durrant <paul@xen.org>, "open list:X86 Xen CPUs" <xen-devel@lists.xenproject.org>
Message-Id: <Zs9SiEQtWIsvlhXk@l14>
References: <cover.f5d45e3c2fb87552abfaf80982b0b724fca2134c.1714955598.git-series.marmarek@invisiblethingslab.com> <e167b362448dc3abc677f3b925a58c55d6158da7.1714955598.git-series.marmarek@invisiblethingslab.com>
In-Reply-To: <e167b362448dc3abc677f3b925a58c55d6158da7.1714955598.git-series.marmarek@invisiblethingslab.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.da54c3286194458496dd3f8169c1f6be?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240828:md
Date: Wed, 28 Aug 2024 16:38:33 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Mon, May 06, 2024 at 02:33:21AM +0200, Marek Marczykowski-G=C3=B3recki w=
rote:
> Update it to get XENFEAT_dm_msix_all_writes for the next patch.
> 
> Signed-off-by: Marek Marczykowski-G=C3=B3recki <marmarek@invisiblethingsl=
ab.com>

Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 16:48:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 16:48:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785028.1194447 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjLqG-000693-Tc; Wed, 28 Aug 2024 16:48:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785028.1194447; Wed, 28 Aug 2024 16:48:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjLqG-00068w-Qv; Wed, 28 Aug 2024 16:48:20 +0000
Received: by outflank-mailman (input) for mailman id 785028;
 Wed, 28 Aug 2024 16:48:19 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=9MTI=P3=bounce.vates.tech=bounce-md_30504962.66cf54ce.v1-3a80558c6cae4a62bbe164a50dae955a@srs-se1.protection.inumbo.net>)
 id 1sjLqE-00068p-Q7
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 16:48:19 +0000
Received: from mail187-32.suw11.mandrillapp.com
 (mail187-32.suw11.mandrillapp.com [198.2.187.32])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 52243ebf-655d-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 18:48:16 +0200 (CEST)
Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail187-32.suw11.mandrillapp.com (Mailchimp) with ESMTP id
 4Wv9Mf20DxzQXgCV9
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 16:48:14 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 3a80558c6cae4a62bbe164a50dae955a; Wed, 28 Aug 2024 16:48:14 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 52243ebf-655d-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724863694; x=1725124194;
	bh=8NvK91ipe60HCoJYurXZDNDoH6ucf6ji/cyjBADJiGw=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=qylCvrzJLY0ccwpvzEV0owT4LCWYcvLo7Z/pGojFryzVVjmwiKkAfUfIezwV5an/e
	 DhSkQ0T3guKUJwJb9cacSQEMtDTWYPBKlNhdLR6jXzUg85kZOokG77V+/Oblmt3o+C
	 LcvGib4CYw1kD2vT+Zh9RCvdm7Em+qCzwEoEC+yBbDXK7LDMrCwP1+d74XMxU5zhGA
	 eCfMpmnHp1arBe/hoSEJOJgD1YvBWyGE97gyu9sO7Gq3MEfJdHc7MqKKVhhoIB3CqE
	 6zwEd+DiKF0MrgsFmWl8baVLezVc+L4dy0IPIxoq0QpTO2dMWC4IN7DhryBIGWzF29
	 x6I0yFx0l2CXQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724863694; x=1725124194; i=anthony.perard@vates.tech;
	bh=8NvK91ipe60HCoJYurXZDNDoH6ucf6ji/cyjBADJiGw=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=bTYaD2hnMc+BbPzw3L5NyKUg16FRWTeVRoejFBUdz+ouasejtQwSKMpxHEKEwK3Jo
	 ww/trbe3j/07ehlpdigWRLRXM0bEjOaQclumiJNM5a3saF/fu17fUduJPaz+GikWhi
	 o3vD3xKt7IhvPkeIe28fzt4wg+IYYRt3Mdwm3KnvPZKx6gerXOoYfesPEmn0ZJ/AFL
	 gw6HXYpEFF76BHGQhf0WFOwJ78htw8tbuPp7wQEW1ViuKQ6yYiyD1A1AqJ5S2gicFS
	 UrdI6fQk3tSJp2Puu76mC+ipJ3DW4JP6/oKAqKpK+Lffezji4sP2bpLauMYoBrvhtP
	 lm9ZWywd/+6Hg==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20[PATCH=20v3=203/3]=20Do=20not=20access=20/dev/mem=20in=20MSI-X=20PCI=20passthrough=20on=20Xen?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724863693032
To: =?utf-8?Q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>
Cc: qemu-devel@nongnu.org, Stefano Stabellini <sstabellini@kernel.org>, Paul Durrant <paul@xen.org>, "open list:X86 Xen CPUs" <xen-devel@lists.xenproject.org>
Message-Id: <Zs9UzJVsjKU0/frk@l14>
References: <cover.f5d45e3c2fb87552abfaf80982b0b724fca2134c.1714955598.git-series.marmarek@invisiblethingslab.com> <ebeb8c419feedad9fe0e9f39d3ed3a9ff0f4c49b.1714955598.git-series.marmarek@invisiblethingslab.com>
In-Reply-To: <ebeb8c419feedad9fe0e9f39d3ed3a9ff0f4c49b.1714955598.git-series.marmarek@invisiblethingslab.com>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.3a80558c6cae4a62bbe164a50dae955a?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240828:md
Date: Wed, 28 Aug 2024 16:48:14 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Mon, May 06, 2024 at 02:33:22AM +0200, Marek Marczykowski-G=C3=B3recki w=
rote:
> diff --git a/hw/xen/xen_pt_msi.c b/hw/xen/xen_pt_msi.c
> index 09cca4e..836cc9c 100644
> --- a/hw/xen/xen_pt_msi.c
> +++ b/hw/xen/xen_pt_msi.c
> @@ -493,7 +501,12 @@ static uint64_t pci_msix_read(void *opaque, hwaddr a=
ddr,
>          return get_entry_value(&msix->msix_entry[entry_nr], offset);
>      } else {
>          /* Pending Bit Array (PBA) */
> -        return *(uint32_t *)(msix->phys_iomem_base + addr);
> +        if (s->msix->phys_iomem_base) {
> +            return *(uint32_t *)(msix->phys_iomem_base + addr);
> +        }
> +        XEN_PT_LOG(&s->dev, "reading PBA, addr 0x%lx, offset 0x%lx\n",
> +                   addr, addr - msix->total_entries * PCI_MSIX_ENTRY_SIZ=
E);
> +        return 0xFFFFFFFF;

If Xen advertise XENFEAT_dm_msix_all_writes, we are not expecting QEMU
to reach this code, right? A comment might be useful.

>      }
>  }
>  
> @@ -576,33 +593,40 @@ int xen_pt_msix_init(XenPCIPassthroughState *s, uin=
t32_t base)
>      msix->table_base =3D s->real_device.io_regions[bar_index].base_addr;
>      XEN_PT_LOG(d, "get MSI-X table BAR base 0x%"PRIx64"\n", msix->table_=
base);
>  
> +    /* Accessing /dev/mem is needed only on older Xen. */
> +    if (!(xc_version_info.submap & (1U << XENFEAT_dm_msix_all_writes))) =
{

Would it be ok to use test_bit() instead?

Thanks,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 17:50:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 17:50:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785048.1194458 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjMo4-00013i-Ac; Wed, 28 Aug 2024 17:50:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785048.1194458; Wed, 28 Aug 2024 17:50:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjMo4-00013b-75; Wed, 28 Aug 2024 17:50:08 +0000
Received: by outflank-mailman (input) for mailman id 785048;
 Wed, 28 Aug 2024 17:50: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=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjMo3-000121-K1
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 17:50:07 +0000
Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com
 [2a00:1450:4864:20::236])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f5fbb02e-6565-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 19:50:06 +0200 (CEST)
Received: by mail-lj1-x236.google.com with SMTP id
 38308e7fff4ca-2f4f5dbd93bso55128991fa.2
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 10:50:06 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1e2685sm2496372a12.29.2024.08.28.10.50.04
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 10:50:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f5fbb02e-6565-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724867406; x=1725472206; 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=M2Aiq12ZCG5INqRw99VCRkNGF9BmrbJGR2rtuVFqgKU=;
        b=STFryB1KQ/wgtnPjHlrPFU2vGU9+UMOOVZ75ULCggo+SsZUsXwNpARJw0RC+72Nlkl
         oRfag2XB8YxwZ/8E1ZRgpQOZ2f3ssZ0QMQPHdouKiOayQRP3j141UgshypyaCqk/2BxX
         54YYdkrmXmr2tO8Jd0bbmqcS4U79/tkZ9IfRw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724867406; x=1725472206;
        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=M2Aiq12ZCG5INqRw99VCRkNGF9BmrbJGR2rtuVFqgKU=;
        b=gJB5xhBY5zhVV/Z1ngnK36bfT51MzbAAL+o07WNuzLQXskBe35WwtZscFuuY5wmAXP
         B1tT+WfbLJAEg2IlrBOqXjX+b4Kh0QncmRrWv5IrKFskgcXOe9zP7HzemTyN7vBi0Fam
         HXXTfFGPFZ30m4lNdL/kTZDdl32jyeMmztxJn+hJ0AfFKS0z7M9eVrh5T/8sVrsd2QYl
         dyS+ygnXBMx1YDh/MLTOjL56nNp5h2CzLQBZUbw3neZsPn+XhWnLkqyPZ1coojlaa6oW
         A0f+p98y/gp/75rPTIzOjDFpkEvEEzfkfgmg3DcA7JXZZ6bbak9q1uue0TLC5kBo46ZQ
         jy4Q==
X-Forwarded-Encrypted: i=1; AJvYcCW78SQi+VW3w6gYpC7KSA79uVQD/Fupj2VlIFYN6QTmNtKmLwScfNe6qSrrYzFTZdVqxwpuwRVj25Q=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwUiG/mlDgCBwL6gf+pIUYvFGXQDu6fLZYxu2Dwh96fqHdbBV83
	zW5fSCRy+FONh49CnaM4WC+I475HvLcCr0W0prDy5v2buMbjUxppvO7poKs6vCM=
X-Google-Smtp-Source: AGHT+IH3geemmY6Q6xrSqr3j5nDJmMJFxGxVmrxBinbexLaUmwQAxGAINz61Cd8FEqD391jl1hYs1A==
X-Received: by 2002:a2e:4a1a:0:b0:2f3:b234:980b with SMTP id 38308e7fff4ca-2f6103c87cemr3379941fa.28.1724867405452;
        Wed, 28 Aug 2024 10:50:05 -0700 (PDT)
Message-ID: <7b7b1434-e615-4189-ab52-3cce2932fb4b@citrix.com>
Date: Wed, 28 Aug 2024 18:50:03 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/4] x86/hvm: Rework hpet_write() for improved code
 generation
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
 <20240827135746.1908070-4-andrew.cooper3@citrix.com>
 <2316ca39-50d4-4311-aeff-30be588245d9@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <2316ca39-50d4-4311-aeff-30be588245d9@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28/08/2024 9:13 am, Jan Beulich wrote:
> On 27.08.2024 15:57, Andrew Cooper wrote:
>> In the HPET_STATUS handling, the use of __clear_bit(i, &new_val) is the only
>> thing causing it to be spilled to the stack.  Furthemore we only care about
>> the bottom 3 bits, so rewrite it to be a plain for loop.
>>
>> For the {start,stop}_timer variables, these are spilled to the stack despite
>> the __{set,clear}_bit() calls.
> That's an observation from what the compiler happens to do? I don't see any
> other reason why they would need spilling; I expect it's merely a matter of
> registers better be used for other variables.

It is a consequence of how our helpers are written.  I do expect it to
improve when I get around to reworking them.

For example, the Linux helpers have enough constant folding capabilities
to allow the compiler to turn:

{
    int foo = 0;
    ...
    __set_bit(1, &foo);

into:

{
    int foo = 1;


as well as being able to emit LOCK AND/OR/XOR in place of LOCK BT{C,S,R}
for a constant bit position.

One thing I want to do, which I haven't figured out how to do yet, is to
allow the arch form to emit BT?Q forms.

Right now, code generation for PGC_* and PGT_* suffers quite a lot.  We
mix between reg/imm logic, then spill to the stack because top bits
aren't within range for the "I" constraint on 32-bit instructions, issue
a BT?L reg/mem (which has much higher latency than any other form), then
pick it back off the stack to do more reg/imm logic.

I was wondering if, because of the always_inline, I could do something
like __builtin_constant_p(bit) && __builtin_object_size(addr, 0) >= 8
and emitting long-granular logic, which will be able to pick the imm/reg
form rather than turning into reg/mem.

But, I've not had time to experiment here, and I doubt I'll get around
to it soon.

Another optimisation we're lacking vs Linux is that our test_bit() has a
volatile pointer where Linux's is non-volatile.  This makes a massive
difference for the ability to optimise looking at multiple bits.


>  If we ever meant to build Xen
> with APX fully in use, that might change. IOW may I at least ask for
> s/are/happen to be/? I'm also a little irritated by "despite", but you're
> the native speaker. It would have seemed to me that e.g. "irrespective of"
> would better express what (I think) is meant.

"despite" isn't really the right term, but I also wouldn't have said it
was something to be irritated over.

What I was trying to say was "they're spilled to the stack even with the
__set_bit() calls removed".  Which makes sense; they're values held for
almost the full duration of the function, that are not used in ~every
step of logic.

Interestingly, given that they're spilled to the stack, the __set_bit()
form is more efficient than the plain C "|= (1u << i);", but I'd still
like an implementation which could make that determination itself.

>
>>  Again we only care about the bottom 3 bits, so
>> shrink the variables from long to int.  Use for_each_set_bit() rather than
>> opencoding it at the end which amongst other things means the loop predicate
>> is no longer forced to the stack by the loop body.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: Roger Pau Monné <roger.pau@citrix.com>
>>
>> All in all, it's modest according to bloat-o-meter:
>>
>>   add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-29 (-29)
>>   Function                                     old     new   delta
>>   hpet_write                                  2225    2196     -29
>>
>> but we have shrunk the stack frame by 8 bytes; 0x28 as opposed to 0x30 before.
> However, on the negative side all the first of the loops you touch now always
> takes 3 iterations, when previously we may have got away with as little as
> none. Is there a reason not to use
>
>     for_each_set_bit ( i, new_val & ((1U << HPET_TIMER_NUM) - 1) )
>
> there (with the masking of the low bit possibly pulled out)?

There are multiple angles here.

First, I got an unexpected surprise on ARM with an expression, and while
this one won't pick up pointer const-ness, I can never remember what
MISRA's view on this is.

Second, this is the odd-loop-out compared to rest of the function, which
are all of the form "for ( i = 0; i < HPET_TIMER_NUM ;".

But perhaps most importantly, OSes don't touch this register.  Xen not
at all, and Linux only in _hpet_print_config().  Neither bother
preserving/clearing it on suspend/resume, even when running the HPET in
legacy replacement mode.

I haven't checked windows behaviour, but I don't expect it to differ
here.  This register simply isn't interesting for the preferred type of
interrupts (edge), and also isn't useful for an ISR handling a line
interrupt.

So my choice was based on which produced the smallest code, because it's
an dead-in-practice codepath.

>
>> @@ -533,19 +528,11 @@ static int cf_check hpet_write(
>>      }
>>  
>>      /* stop/start timers whos state was changed by this write. */
>> -    while (stop_timers)
>> -    {
>> -        i = ffsl(stop_timers) - 1;
>> -        __clear_bit(i, &stop_timers);
>> +    for_each_set_bit ( i, stop_timers )
>>          hpet_stop_timer(h, i, guest_time);
>> -    }
>>  
>> -    while (start_timers)
>> -    {
>> -        i = ffsl(start_timers) - 1;
>> -        __clear_bit(i, &start_timers);
>> +    for_each_set_bit ( i, start_timers )
>>          hpet_set_timer(h, i, guest_time);
>> -    }
> To avoid variable shadowing, I think you don't want to use i in these two
> loops. Alternatively the function scope i would need constraining to the
> individual loops.

Yeah, I was bitten by that on one of the ARM patches.  I'll adjust.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 18:09:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 18:09:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785060.1194467 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjN6E-0004GR-SE; Wed, 28 Aug 2024 18:08:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785060.1194467; Wed, 28 Aug 2024 18:08:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjN6E-0004GK-Pi; Wed, 28 Aug 2024 18:08:54 +0000
Received: by outflank-mailman (input) for mailman id 785060;
 Wed, 28 Aug 2024 18:08:53 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjN6D-0004GE-OT
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 18:08:53 +0000
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com
 [2a00:1450:4864:20::134])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 947d67bf-6568-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 20:08:51 +0200 (CEST)
Received: by mail-lf1-x134.google.com with SMTP id
 2adb3069b0e04-52f01b8738dso5500132e87.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 11:08:51 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e588adf2sm274100766b.173.2024.08.28.11.08.49
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 11:08:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 947d67bf-6568-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724868531; x=1725473331; 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=wm/tY85tB+9252myaGjqw12IAnBOLLyIHLhn6OjktJU=;
        b=H4W+lPP/cg88QRa5OK9ZPf96EH05hlIw6wQbIMdjrgzw9UOCg6faRg40EADYsfqq7j
         eKinVUiwIkWC4UFLMDeAy2QabqipxXasXHpau3NQ9wKO8y9XPNDmjZtMZxg6NwfWMdl3
         SuCq9cEIkA80CuxqiN52IKbyy2G+dOKBVcptw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724868531; x=1725473331;
        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=wm/tY85tB+9252myaGjqw12IAnBOLLyIHLhn6OjktJU=;
        b=dU3rBWiW+2R9S0kx1KH8C0wAtu2H63loKGwlqSaUG4VuKVRiZQ0JwOM1ahCAmeZMLu
         D+XfM4/vmnnp+QOVqCqA8HySorA3KXFSkGjyoAImvKU1xJpMaurRoyVMQJkkBHs8u0iz
         IXWbFQRaaeNSk1SDUNcfK4Roz6nXRVzqMgmp1aZi3iG20z0FbdCv2/gOVi6MUpciA+dH
         XGfkoOMQnbUHY5xRFpAOquwdKnURUqCVbclB9tryGkoWPBBEK71p/6ihzBe6v6C1B8N4
         NRjfCZQw0jGCV4BvCPgPuaQ0C7LULfCmA3tUp5TkMXavEleiHysK+Za825gyhNzPUD2i
         3INg==
X-Forwarded-Encrypted: i=1; AJvYcCUrtIPvjXnGKIfKZtP8K8yx7N4qG1uD4LB1+3wXUaqXVa6mMlzHCrVGKphRRpc4JWNUqCe4POQth3c=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxfTho6MFo3D4RGbvd2gDI32LG0OMwYtM7xFyFwuRs/Bmxutfni
	bD+xR6HJ5qwza2qfOi2B2VRv8P281sZjbmflBkva+tN/YoMX03lXm+rfRJ/Ika0=
X-Google-Smtp-Source: AGHT+IEqpynOAYTmMxcEi81PaTkDZ3ZRIlrZOC+m4kLXO5YTPsqqStCxBcX0P+TidXsP1nnieNboOA==
X-Received: by 2002:a05:6512:baa:b0:52e:9f17:841a with SMTP id 2adb3069b0e04-5353e543272mr84512e87.6.1724868530268;
        Wed, 28 Aug 2024 11:08:50 -0700 (PDT)
Message-ID: <cb2609f0-ed06-40ab-9983-9dad59c589d9@citrix.com>
Date: Wed, 28 Aug 2024 19:08:48 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 4/4] x86/vmx: Rewrite vmx_sync_pir_to_irr() to be more
 efficient
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
 <20240827135746.1908070-5-andrew.cooper3@citrix.com>
 <d022a5b1-c0ca-4399-b972-b01d834a95ec@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <d022a5b1-c0ca-4399-b972-b01d834a95ec@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28/08/2024 10:19 am, Jan Beulich wrote:
> On 27.08.2024 15:57, Andrew Cooper wrote:
>> There are two issues.  First, pi_test_and_clear_on() pulls the cache-line to
>> the CPU and dirties it even if there's nothing outstanding, but the final
>> for_each_set_bit() is O(256) when O(8) would do,
> Nit: That's bitmap_for_each() now, I think. And again ...
>
>> and would avoid multiple
>> atomic updates to the same IRR word.
>>
>> Rewrite it from scratch, explaining what's going on at each step.
>>
>> Bloat-o-meter reports 177 -> 145 (net -32), but the better aspect is the
>> removal calls to __find_{first,next}_bit() hidden behind for_each_set_bit().
> ... here, and no underscore prefixes on the two find functions.

Yes, and fixed.

>
>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>> @@ -2317,18 +2317,72 @@ static void cf_check vmx_deliver_posted_intr(struct vcpu *v, u8 vector)
>>  
>>  static void cf_check vmx_sync_pir_to_irr(struct vcpu *v)
>>  {
>> -    struct vlapic *vlapic = vcpu_vlapic(v);
>> -    unsigned int group, i;
>> -    DECLARE_BITMAP(pending_intr, X86_NR_VECTORS);
>> +    struct pi_desc *desc = &v->arch.hvm.vmx.pi_desc;
>> +    union {
>> +        uint64_t _64[X86_NR_VECTORS / (sizeof(uint64_t) * 8)];
> Using unsigned long here would imo be better, as that's what matches
> struct pi_desc's DECLARE_BITMAP().

Why?  It was also the primary contribution to particularly-bad code
generation in this function.

>
>> +        uint32_t _32[X86_NR_VECTORS / (sizeof(uint32_t) * 8)];
>> +    } vec;
>> +    uint32_t *irr;
>> +    bool on;
>>  
>> -    if ( !pi_test_and_clear_on(&v->arch.hvm.vmx.pi_desc) )
>> +    /*
>> +     * The PIR is a contended cacheline which bounces between the CPU(s) and
>> +     * IOMMU(s).  An IOMMU updates the entire PIR atomically, but we can't
>> +     * express the same on the CPU side, so care has to be taken.
>> +     *
>> +     * First, do a plain read of ON.  If the PIR hasn't been modified, this
>> +     * will keep the cacheline Shared and not pull it Excusive on the current
>> +     * CPU.
>> +     */
>> +    if ( !pi_test_on(desc) )
>>          return;
>>  
>> -    for ( group = 0; group < ARRAY_SIZE(pending_intr); group++ )
>> -        pending_intr[group] = pi_get_pir(&v->arch.hvm.vmx.pi_desc, group);
>> +    /*
>> +     * Second, if the plain read said that ON was set, we must clear it with
>> +     * an atomic action.  This will bring the cachline to Exclusive on the
> Nit (from my spell checker): cacheline.
>
>> +     * current CPU.
>> +     *
>> +     * This should always succeed because noone else should be playing with
>> +     * the PIR behind our back, but assert so just in case.
>> +     */
>> +    on = pi_test_and_clear_on(desc);
>> +    ASSERT(on);
>> +
>> +    /*
>> +     * The cacheline is now Exclusive on the current CPU, and because ON was
> "is" is pretty ambitious. We can only hope it (still) is.

I can't think of a clearer way of saying this.  "will have become
Exclusive" perhaps, but this is getting into some subtle tense gymnastics.

>> +     * get it back again.
>> +     */
>> +    for ( unsigned int i = 0; i < ARRAY_SIZE(vec._64); ++i )
>> +        vec._64[i] = xchg(&desc->pir[i], 0);
>> +
>> +    /*
>> +     * Finally, merge the pending vectors into IRR.  The IRR register is
>> +     * scattered in memory, so we have to do this 32 bits at a time.
>> +     */
>> +    irr = (uint32_t *)&vcpu_vlapic(v)->regs->data[APIC_IRR];
>> +    for ( unsigned int i = 0; i < ARRAY_SIZE(vec._32); ++i )
>> +    {
>> +        if ( !vec._32[i] )
>> +            continue;
>>  
>> -    bitmap_for_each ( i, pending_intr, X86_NR_VECTORS )
>> -        vlapic_set_vector(i, &vlapic->regs->data[APIC_IRR]);
>> +        asm ( "lock or %[val], %[irr]"
>> +              : [irr] "+m" (irr[i * 0x10])
> This wants to be irr * 4 only, to account for sizeof(*irr) == 4.

Ah, that will be where the AlderLake interrupts are disappearing to.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 18:48:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 18:48:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785072.1194478 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjNiZ-0003EF-GZ; Wed, 28 Aug 2024 18:48:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785072.1194478; Wed, 28 Aug 2024 18:48:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjNiZ-0003E8-Dw; Wed, 28 Aug 2024 18:48:31 +0000
Received: by outflank-mailman (input) for mailman id 785072;
 Wed, 28 Aug 2024 18:48:29 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjNiX-0003Dy-Ra; Wed, 28 Aug 2024 18:48:29 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjNiX-0007MY-EY; Wed, 28 Aug 2024 18:48:29 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjNiW-0008Sw-UR; Wed, 28 Aug 2024 18:48:29 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjNiW-0006Ie-Tz; Wed, 28 Aug 2024 18:48:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=VMev+3TKusRlWBly/H6pr3Tr/ZN5uq6Lla4SsaWEMf8=; b=fNmR0tLZaUTDUBsIPiknNoh6nQ
	W1o2uPMwSe01kn7EMNDonOtEcJRE+8qqmRzpkNOlbXXaKyQCBD+03MU++D8STL4mUpiqCvxlJs672
	y01WkxhQxtHagAdBMaXOCv/faeyWmWrY7gCNcKlf0Y9XGSCUeG+Hu3X4O490UVp0a3TE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187384-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187384: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=84e7b74c8c643c59ee32d4da769f48a3c8c277a4
X-Osstest-Versions-That:
    ovmf=1fd2f9ec8f16cc8efb949888db94eb42006f77c6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 18:48:28 +0000

flight 187384 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187384/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 84e7b74c8c643c59ee32d4da769f48a3c8c277a4
baseline version:
 ovmf                 1fd2f9ec8f16cc8efb949888db94eb42006f77c6

Last test of basis   187383  2024-08-28 14:45:07 Z    0 days
Testing same since   187384  2024-08-28 16:41:33 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Dun Tan <dun.tan@intel.com>
  Hongbin1 Zhang <hongbin1.zhang@intel.com>
  Jiaxin Wu <jiaxin.wu@intel.com>
  Wei6 Xu <wei6.xu@intel.com>
  xieyuanh <yuanhao.xie@intel.com>
  Yuanhao Xie <yuanhao.xie@intel.com>
  Zhang Hongbin <hongbin1.zhang@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   1fd2f9ec8f..84e7b74c8c  84e7b74c8c643c59ee32d4da769f48a3c8c277a4 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 18:57:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 18:57:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785080.1194488 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjNqi-0005MO-CI; Wed, 28 Aug 2024 18:56:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785080.1194488; Wed, 28 Aug 2024 18:56:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjNqi-0005MH-95; Wed, 28 Aug 2024 18:56:56 +0000
Received: by outflank-mailman (input) for mailman id 785080;
 Wed, 28 Aug 2024 18:56:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjNqh-0005MB-0W
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 18:56:55 +0000
Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com
 [2a00:1450:4864:20::233])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 49ed2166-656f-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 20:56:52 +0200 (CEST)
Received: by mail-lj1-x233.google.com with SMTP id
 38308e7fff4ca-2f3f07ac2dcso78045141fa.2
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 11:56:52 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1e2685sm2553439a12.29.2024.08.28.11.56.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 11:56:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 49ed2166-656f-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724871412; x=1725476212; 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=GG+26ZRDHt2JvbBOiUkTB9caTmrHTiy54JyBlCCkuNg=;
        b=jWMITR2BUFBxlzDuCRE3dJ+8TVJWv+eqG+i6mc4bvuCmQ0e+W89SW6CxoPrHHvvUSC
         uc3Bfj6uJq5Rdc5ueGc/sR4mbxGv5X5SB5d/HVDQ3BDzJwiq3DWqp81tn9S34G5hIPIF
         oSBsk7oyjBilb1lQg58+dFqdrFy0BTkEHwI4Y=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724871412; x=1725476212;
        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=GG+26ZRDHt2JvbBOiUkTB9caTmrHTiy54JyBlCCkuNg=;
        b=aZpEZSk3oQe9d9kAeCSVobGgXyEQTiZr8cjLI5OKPSyUif0bCyLTebBcT6IlCHYpgm
         G95miwAVJd6NcU8ZcbuKpQAqqDXqq8J0vz6DXUU7RJ1ub0E/XLqwDp30Ao/jDfKU/aTH
         YndY2WSySVwTXdy1P0PUyZp2Ib9opy3v7A9u0mAjilbtDwjJ80P2aTmAIrfLAkWjHLXf
         DHQRIWyiN//w4K9Y0NBhoK+AQzpffIM5doHjL5FEEBIGhbfjIIAz9nkL3/KT2XD9zEEz
         bwjViPgrfXNLOs4q+WcSPko6rFHLQJzejHD5F6fQkPu3bcI6tBZcbhSTyGDdumKzU3+1
         WkIg==
X-Forwarded-Encrypted: i=1; AJvYcCVg9J9lY5vNxicKlkwBqZ1cvkpnIs920vWfdVcklst8iPl+SUVY04YYR3bR3mCgGN1bDHNxn2jll/A=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwLN/vMrPDw59BUwCL5rPJjwNI0yX+Q54qI6q9XrHsozcnpx6Nc
	I5HHdqtvB4Q/zsZo0u0V3CvoKAkBj8lvKebVOz6bMplSkX2Iheg0CTu51Ff5t3I=
X-Google-Smtp-Source: AGHT+IH7OPV/oB83+67MnEd133rMpTYtVi4NhaS/AcC+eTlahIUTQNCyuI7Gk7Ggr/Y//VNU39SyPA==
X-Received: by 2002:a2e:460a:0:b0:2f2:9f39:3e58 with SMTP id 38308e7fff4ca-2f61054b2c5mr4079511fa.48.1724871411869;
        Wed, 28 Aug 2024 11:56:51 -0700 (PDT)
Message-ID: <17a98dae-51d4-4da0-a35a-1ddf94a06168@citrix.com>
Date: Wed, 28 Aug 2024 19:56:49 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/4] x86/hvm: Use for_each_set_bit() in
 hvm_emulate_writeback()
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
 <20240827135746.1908070-3-andrew.cooper3@citrix.com>
 <a92063db-fc28-4162-83bd-33617bbfcfbe@suse.com>
 <8f34109f-1718-47e5-99c5-a6010d7ebe51@citrix.com>
 <09742cbe-4c06-49d4-8b26-7ce9076063a1@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <09742cbe-4c06-49d4-8b26-7ce9076063a1@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28/08/2024 3:56 pm, Jan Beulich wrote:
> On 28.08.2024 16:44, Andrew Cooper wrote:
>> On 27/08/2024 5:07 pm, Jan Beulich wrote:
>>> On 27.08.2024 15:57, Andrew Cooper wrote:
>>>> +    for_each_set_bit ( seg, dirty )
>>>> +        hvm_set_segment_register(curr, seg, &hvmemul_ctxt->seg_reg[seg]);
>>>> +
>>>> +    hvmemul_ctxt->seg_reg_dirty = 0;
>>> Why is this suddenly appearing here? You don't mention it in the description,
>>> so it's not clear whether you found a (however minor) issue, or whether
>>> that's purely cosmetic (yet then it's still an extra store we could do
>>> without).
>> Oh, yes.  Nothing anywhere in Xen ever clears these segment dirty bits.
> hvm_emulate_init_once()?

I meant after emulation.  The value is initialised to 0 at the start of day.

>
>> I suspect the worst that will go wrong is that we'll waste time
>> re-{VMWRITE,memcpy}-ing the segment registers into the VMCS/VMCB, but
>> the logic in Xen is definitely not right.
> I'm on the edge of asking to do such clearing before emulation, not after
> processing the dirty bits. That would then be hvm_emulate_init_per_insn(),
> well centralized.

Specifically, hvmemul_ctxt should not believe itself to be dirty after a
call to hvm_emulate_writeback(), because that's the logic to make the
context no-longer-dirty.

That said, the more I look at this, the less convinced I am by it.  For
a function named writeback(), it's doing a very narrow thing that is not
the usual meaning of the term when it comes to pipelines or insn
emulation...

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 18:57:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 18:57:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785085.1194498 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjNrU-0005pk-Kt; Wed, 28 Aug 2024 18:57:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785085.1194498; Wed, 28 Aug 2024 18:57:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjNrU-0005pd-H6; Wed, 28 Aug 2024 18:57:44 +0000
Received: by outflank-mailman (input) for mailman id 785085;
 Wed, 28 Aug 2024 18:57:43 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjNrT-0005pX-5c
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 18:57: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 67520b0a-656f-11ef-a0b0-8be0dac302b0;
 Wed, 28 Aug 2024 20:57:42 +0200 (CEST)
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-a868b739cd9so851592466b.2
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 11:57:42 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e54a014csm281039666b.90.2024.08.28.11.57.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 11:57:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 67520b0a-656f-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724871462; x=1725476262; 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=zFpkr8WVyhDSjP2s0SKwSBW1ET3nG7QD4yQ8AOxgWEE=;
        b=YIjWxfgBXdgTP3qG3W4TZbs/YZ2awMSIH6Cmz90FYS0uoMNuOTnL+7WJWCICS3CQZs
         C2KdpIOxJAoOmRzcV44W9HgS31Znizkr+KHhFmR9f63L/IrOms/pumH35vRfx4PHELXF
         Sfuc4ouKC4tsdClOnQDPOaWW06W64dtVsIDIc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724871462; x=1725476262;
        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=zFpkr8WVyhDSjP2s0SKwSBW1ET3nG7QD4yQ8AOxgWEE=;
        b=S43N6sVaSsBMGf6Kkr6Usp3q4KAGHhDocg/ZrE1zmGro6EtERCfoU8zGSBnj8hfwfj
         WMlJWf1QnFJfGbZBDsZmFpFX7Uf/usoFfgPJ13aDrWBq3mVdyP4dgyjfSalyyebU3UW2
         PFbkcqMd3xiIzbzWl+ohhA5lNj39S+gz/DraZlgKoeIPOEElt92BCMoDdiLGfdZEwRsS
         tojgdNCf8wUVQMQXpT+vzkbsew3TVkN2e/u7EnvZWLedBhEg8CZguMAWG4PEU/CMJtkG
         8FJCxBpLSbMRmt+V9kOyFWu6JiMwDF/aHS541n9A9CtSz85+iGxe60vRaqCXGt9OyTWC
         6/jA==
X-Forwarded-Encrypted: i=1; AJvYcCUb7RteshPJbQZ/weryhO9Gyyh8G0N+3aG9og5qil5RGmMEXjmNd/NWo1dZm6VjRgI+DMzcJkegSZM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwVS2my9L+igdmdxfEx3yBb10t77xZuidCm2VjEDFNWef2fvFSI
	PRiKaSAt40VS1hc1kJHLv7BvblI4YzrDjrmNjGnbjadAuCBkdA9GfQvnbxwPD94=
X-Google-Smtp-Source: AGHT+IGYmu06g7UtLaBxEUdcDuFahYEh7yVY1Uta0ZSTqky24c/vclhSD3K4Zk9cBbvpLspVkzXbmA==
X-Received: by 2002:a17:907:7e8c:b0:a7a:ab1a:2d71 with SMTP id a640c23a62f3a-a897fad365amr25662566b.59.1724871461531;
        Wed, 28 Aug 2024 11:57:41 -0700 (PDT)
Message-ID: <a5b4ca69-96ea-46d6-ab0d-2be4fd1d9d99@citrix.com>
Date: Wed, 28 Aug 2024 19:57:39 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6] x86/dom0: disable SMAP for PV domain building only
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>, xen-devel@lists.xenproject.org
References: <20240828113044.35541-1-roger.pau@citrix.com>
 <50658093-8463-4ee3-b308-31be2dd1fd42@suse.com>
 <bd206c4d-8e1d-488c-b428-3f6402a9ae4f@citrix.com>
 <Zs8gAuc5qoVsVkQe@macbook.local>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <Zs8gAuc5qoVsVkQe@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28/08/2024 2:02 pm, Roger Pau Monné wrote:
> On Wed, Aug 28, 2024 at 12:51:23PM +0100, Andrew Cooper wrote:
>> On 28/08/2024 12:50 pm, Jan Beulich wrote:
>>> On 28.08.2024 13:30, Roger Pau Monne wrote:
>>>> Move the logic that disables SMAP so it's only performed when building a PV
>>>> dom0, PVH dom0 builder doesn't require disabling SMAP.
>>>>
>>>> The fixes tag is to account for the wrong usage of cpu_has_smap in
>>>> create_dom0(), it should instead have used
>>>> boot_cpu_has(X86_FEATURE_XEN_SMAP).  Fix while moving the logic to apply to PV
>>>> only.
>>>>
>>>> While there also make cr4_pv32_mask __ro_after_init.
>>>>
>>>> Fixes: 493ab190e5b1 ('xen/sm{e, a}p: allow disabling sm{e, a}p for Xen itself')
>>>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>>> preferably with ...
>>>
>>>> @@ -1051,6 +1051,34 @@ out:
>>>>      return rc;
>>>>  }
>>>>  
>>>> +int __init dom0_construct_pv(struct domain *d,
>>>> +                             const module_t *image,
>>>> +                             unsigned long image_headroom,
>>>> +                             module_t *initrd,
>>>> +                             const char *cmdline)
>>>> +{
>>>> +    int rc;
>>>> +
>>>> +    /*
>>>> +     * Temporarily clear SMAP in CR4 to allow user-accesses in
>>>> +     * construct_dom0().  This saves a large number of corner cases
>>> ... the final 's' dropped here and ...
>>>
>>>> +     * interactions with copy_from_user().


Actually, even with this adjustment the comment is still wonky.

The point is that we're clearing SMAP so we *don't* need to rewrite
construct_dom0() in terms of copy_{to,from}_user().

I've adjusted it.

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 19:25:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 19:25:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785103.1194516 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjOHq-0002cj-PJ; Wed, 28 Aug 2024 19:24:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785103.1194516; Wed, 28 Aug 2024 19:24:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjOHq-0002cc-Mg; Wed, 28 Aug 2024 19:24:58 +0000
Received: by outflank-mailman (input) for mailman id 785103;
 Wed, 28 Aug 2024 19:24: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 1sjOHp-0002cW-Ai
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 19:24: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 1sjOHo-0007zi-B0; Wed, 28 Aug 2024 19:24:56 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sjOHo-0006h2-3i; Wed, 28 Aug 2024 19:24:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org;
	s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:
	References:Cc:To:Subject:MIME-Version:Date:Message-ID;
	bh=l/he+9/N/jJqycW0k+XyA2IpjSGRkTOvA60BQp18/W8=; b=tdLVVmhcQJfdwWaHX5k+pAqx8V
	ckISQ3PsmL81cySI4ZFAW2j2YwWalHsHYYHR7cFKwPaEIkT/J2kgDz9tlgUs4G+sIZ1Kk8JrzNlIR
	iJyDcUP59nC1k6KIW3o6yFT9GDMlPfpq/WrsbkMYrR5FLFqhd2KG5YwiotH3A9fwPUEw=;
Message-ID: <c0146fd6-25cd-46fe-a1d8-428ff9c69b05@xen.org>
Date: Wed, 28 Aug 2024 20:24:53 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 4/4] xen/arm: mpu: Disable secondary cpu bringup
Content-Language: en-GB
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>,
 xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240823163127.3443404-1-ayan.kumar.halder@amd.com>
 <20240823163127.3443404-5-ayan.kumar.halder@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <20240823163127.3443404-5-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi Ayan,

The title is a bit confusing. It implies seconary CPU bringup used to 
work on the MPU. However, you are adding a stub for enable_secondary_cpu_mm.

Also, I am not entirely this is really sufficient to disable CPU 
bringup. There will be plenty of initialization done for secondary CPUs.

I would suggest to update NR_CPUS to 1 for MPU so we will fail early.

For the title, how about

xen/arm: mpu: Implement a dummy enable_secondary_cpu_mm

On 23/08/2024 17:31, Ayan Kumar Halder wrote:
> Secondary cpus are put in WFE state. We do not support SMP at this time.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> ---
>   xen/arch/arm/arm64/mpu/head.S | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/xen/arch/arm/arm64/mpu/head.S b/xen/arch/arm/arm64/mpu/head.S
> index 2b023c346a..1579ac0408 100644
> --- a/xen/arch/arm/arm64/mpu/head.S
> +++ b/xen/arch/arm/arm64/mpu/head.S
> @@ -68,3 +68,12 @@ ENTRY(enable_boot_cpu_mm)
>   
>       ret
>   ENDPROC(enable_boot_cpu_mm)
> +
> +/*
> + * Secondary cpu has not yet been supported on MPU systems. We will block the
> + * secondary cpu bringup at this stage.
> + */
> +ENTRY(enable_secondary_cpu_mm)

Can we print a message so it is easier to spot that 
enable_secondary_cpu_mm is not properly implemented?

> +1:  wfe
> +    b 1b
> +ENDPROC(enable_secondary_cpu_mm)

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 19:31:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 19:31:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785111.1194527 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjOO5-0004lt-Ft; Wed, 28 Aug 2024 19:31:25 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785111.1194527; Wed, 28 Aug 2024 19:31:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjOO5-0004lm-Au; Wed, 28 Aug 2024 19:31:25 +0000
Received: by outflank-mailman (input) for mailman id 785111;
 Wed, 28 Aug 2024 19:31:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>) id 1sjOO4-0004lQ-0j
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 19:31:24 +0000
Received: from xenbits.xenproject.org ([104.239.192.120])
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sjOO3-00087f-6I; Wed, 28 Aug 2024 19:31:23 +0000
Received: from gw1.octic.net ([88.97.20.152] helo=[10.0.0.211])
 by xenbits.xenproject.org with esmtpsa
 (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92)
 (envelope-from <julien@xen.org>)
 id 1sjOO2-00071C-W4; Wed, 28 Aug 2024 19:31:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
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=/9+MS3G688e03JfjXnCw9lx8NmTaRiUe6N6O88VYb5w=; b=BEHOGf+JBaC9oeYQh3NX+DgMsk
	Lp12BvpP4h+UMu6Vg1SEIGJaCxVX28BJBmNmpjJ4BF3SBgLfaibyI+oUkIcP6cAOLo6fRKrjKm9P/
	KpsX7q1VMLBSVS9VKgQCRx25LGIc1QFZZtSeuqwW1f3zDkcUaGIQfG9lsWwtdWt0LunA=;
Message-ID: <ae2148dc-cbc4-4f71-abc7-ab1f928e453b@xen.org>
Date: Wed, 28 Aug 2024 20:31:20 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1 1/4] xen/arm: mpu: Introduce choice between MMU and MPU
Content-Language: en-GB
To: Ayan Kumar Halder <ayankuma@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>, xen-devel@lists.xenproject.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
References: <20240823163127.3443404-1-ayan.kumar.halder@amd.com>
 <20240823163127.3443404-2-ayan.kumar.halder@amd.com>
 <fca5e0dd-5f71-4286-909b-db14551aa15a@xen.org>
 <afada706-86b5-4093-8574-bfdc06aed639@amd.com>
From: Julien Grall <julien@xen.org>
In-Reply-To: <afada706-86b5-4093-8574-bfdc06aed639@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

On 28/08/2024 15:44, Ayan Kumar Halder wrote:
> 
> On 27/08/2024 11:37, Julien Grall wrote:
>> Hi,
> Hi Julien,
>>
>> On 23/08/2024 17:31, Ayan Kumar Halder wrote:
>>> There are features in the forthcoming patches which are dependent on
>>> MPU. For eg fixed start address.
>>> Also, some of the Xen features (eg STATIC_MEMORY) will be selected
>>> by the MPU configuration.
>>>
>>> Thus, this patch introduces a choice between MMU and MPU for the type
>>> of memory management system. By default, MMU is selected.
>>> All the current platforms are now made dependent on MMU.
>>>
>>> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
>>> ---
>>>   xen/arch/arm/Kconfig           | 17 ++++++++++++++++-
>>>   xen/arch/arm/platforms/Kconfig |  2 +-
>>>   2 files changed, 17 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>>> index 323c967361..686948cefd 100644
>>> --- a/xen/arch/arm/Kconfig
>>> +++ b/xen/arch/arm/Kconfig
>>> @@ -58,10 +58,25 @@ config PADDR_BITS
>>>       default 40 if ARM_PA_BITS_40
>>>       default 48 if ARM_64
>>>   +choice
>>> +    prompt "Memory management system"
>>> +    default MMU if ARM
>>> +    help
>>> +      User can choose between the different forms of memory 
>>> management system.
>>> +      Most of the Arm based systems support MMU.
>>
>> I feel this is quite subjective. So I would drop it.
> Agreed.
>>
>>> +
>>>   config MMU
>>> -    def_bool y
>>> +    bool "MMU"
>>>       select HAS_PMAP
>>>       select HAS_VMAP
>>> +    help
>>> +      Memory management unit is supported on most Arm based systems.
>>
>> For this case, I would write "Select it you are plan to run Xen on 
>> Armv7-A or Armv8-A".
> Ack.

Actually, thinking a bit more. We should be able to run Xen on Armv9. So 
maybe it would be beter to write:

"Select it if you plan to run Xen on A-profile Armv7+".

Cheers,

-- 
Julien Grall



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 19:36:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 19:36:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785118.1194536 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjOTM-00063o-0Z; Wed, 28 Aug 2024 19:36:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785118.1194536; Wed, 28 Aug 2024 19:36:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjOTL-00063h-Tn; Wed, 28 Aug 2024 19:36:51 +0000
Received: by outflank-mailman (input) for mailman id 785118;
 Wed, 28 Aug 2024 19:36: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=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjOTK-00063b-Bk
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 19:36:50 +0000
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com
 [2a00:1450:4864:20::52d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dda76536-6574-11ef-99a0-01e77a169b0f;
 Wed, 28 Aug 2024 21:36:48 +0200 (CEST)
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-5bebd3b7c22so1765784a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 12:36:48 -0700 (PDT)
Received: from [192.168.1.10] (host-92-26-98-202.as13285.net. [92.26.98.202])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a86e549ce94sm280117966b.78.2024.08.28.12.36.46
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 12:36:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dda76536-6574-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724873808; x=1725478608; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=SMeaRe1grcnleZp5PTuI+x0gNgH883nGOFfW3RpRT14=;
        b=GqK66z2qZwfv9CRqBZCpUStB4qOj/rfhhUZvRKAVIvekIhzQOV8xbR7FrNzPflLJvF
         VvDSRQhx7+WvDC/YDHUVbr8hrxgu2Um4dRmTqxH0M9FzbseLbxPl+AouWIyT+yoNJ/zS
         wkFhmflVZq2SAz0jJINOVPWEKRgcPYYxHwQus=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724873808; x=1725478608;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=SMeaRe1grcnleZp5PTuI+x0gNgH883nGOFfW3RpRT14=;
        b=gVXpbczrmpUUzbgpXNrAGeng2b53V68vAI8urBbXT4Wg6Oh4alEQn13gcwCF+7MI39
         o/5sla9ikhnctCSg8sYmC7fZojtQg2LLMgAoS54OvEPO71PTinLfV1SUEyr0oGfBaXiM
         6s73HsfKG1gA23MA0o7NBjMfuU79xj0Z99p2iL3nMkE4K3E05wp7wIstpUqjkcUW27Oc
         3l1htVAbJOAjnZOehd0Sv5aHevrboucgZfHUsPFFGiqAi3ZfJ94ZF2ioBetUmZa8MysP
         rTvwy8QW0esCSF7bP/AHnc2bsbi2Jt8TNLoW4bO36hzn7PPAvMqfxBSjm8ouMD1LmGrG
         LIAA==
X-Forwarded-Encrypted: i=1; AJvYcCVeHlMja7jMiawBFoJA5UNWH/Q3cjGKzy0cEf2lCAN/a0LhGUEYLPRtWQdRDWSQ+dbFRodr3cZhbfQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxgSoDRYGwvNu0CyBe9zNssseqMq2wCgGUuEMwlJ4LJf72CbsPn
	UPEFXdnyd5Irl8bnHNy0OguNvvLQ1pFRlicQyixn5CET3SlT9anvilQLHwZyHPo=
X-Google-Smtp-Source: AGHT+IEWOMt1xcAHcG4qSWhLp3pcsOo5Cg/J4mibco6PthfI5HeKPFzIbd9S56NJ814PojsmBE8UQA==
X-Received: by 2002:a17:907:1c1e:b0:a7d:a453:dba1 with SMTP id a640c23a62f3a-a89825f8407mr19451366b.20.1724873807407;
        Wed, 28 Aug 2024 12:36:47 -0700 (PDT)
Message-ID: <2049e310-53ff-47b1-8f8e-9ad8c08cec3c@citrix.com>
Date: Wed, 28 Aug 2024 20:36:46 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 4/4] x86/vmx: Rewrite vmx_sync_pir_to_irr() to be more
 efficient
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
 <20240827135746.1908070-5-andrew.cooper3@citrix.com>
 <d022a5b1-c0ca-4399-b972-b01d834a95ec@suse.com>
 <cb2609f0-ed06-40ab-9983-9dad59c589d9@citrix.com>
Content-Language: en-GB
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <cb2609f0-ed06-40ab-9983-9dad59c589d9@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28/08/2024 7:08 pm, Andrew Cooper wrote:
> On 28/08/2024 10:19 am, Jan Beulich wrote:
>> On 27.08.2024 15:57, Andrew Cooper wrote:
>>> +     * get it back again.
>>> +     */
>>> +    for ( unsigned int i = 0; i < ARRAY_SIZE(vec._64); ++i )
>>> +        vec._64[i] = xchg(&desc->pir[i], 0);
>>> +
>>> +    /*
>>> +     * Finally, merge the pending vectors into IRR.  The IRR register is
>>> +     * scattered in memory, so we have to do this 32 bits at a time.
>>> +     */
>>> +    irr = (uint32_t *)&vcpu_vlapic(v)->regs->data[APIC_IRR];
>>> +    for ( unsigned int i = 0; i < ARRAY_SIZE(vec._32); ++i )
>>> +    {
>>> +        if ( !vec._32[i] )
>>> +            continue;
>>>  
>>> -    bitmap_for_each ( i, pending_intr, X86_NR_VECTORS )
>>> -        vlapic_set_vector(i, &vlapic->regs->data[APIC_IRR]);
>>> +        asm ( "lock or %[val], %[irr]"
>>> +              : [irr] "+m" (irr[i * 0x10])
>> This wants to be irr * 4 only, to account for sizeof(*irr) == 4.
> Ah, that will be where the AlderLake interrupts are disappearing to.

Indeed.  It's much happier now.

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1431047447

~Andrew


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 20:26:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 20:26:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785138.1194546 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjPF1-0006Bb-Gl; Wed, 28 Aug 2024 20:26:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785138.1194546; Wed, 28 Aug 2024 20:26:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjPF1-0006BU-Df; Wed, 28 Aug 2024 20:26:07 +0000
Received: by outflank-mailman (input) for mailman id 785138;
 Wed, 28 Aug 2024 20:26:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjPEz-0006BG-NB; Wed, 28 Aug 2024 20:26:05 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjPEz-0001xe-B4; Wed, 28 Aug 2024 20:26:05 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjPEy-0002VV-Uq; Wed, 28 Aug 2024 20:26:05 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjPEy-0007PA-U7; Wed, 28 Aug 2024 20:26:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=id0QFhGk6Y1Qtoygn/1HFeXjt8ulcDbgmV25xTF4syc=; b=NdNtAR/flM77MKxSWROHtm/BU8
	tGpB9X+3E0hDx16JdiQzlgTgyGdNHDV4KTmM3JMihVIdlolW2HeLaLK6MDlSjAtKPrkztYyjShpzY
	+AtbTX0pS0zxk7MheMWRlaKgQhjVH1ngmGFHSyI35Cj9pFqzfcyBB+NL4NcgcfCNCPU0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187376-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187376: regressions - FAIL
X-Osstest-Failures:
    linux-linus:test-armhf-armhf-xl-raw:debian-di-install:fail:regression
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=86987d84b968b69a610fd00ab9006c13db193b4e
X-Osstest-Versions-That:
    linux=3ec3f5fc4a91e389ea56b111a73d97ffc94f19c6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 20:26:04 +0000

flight 187376 linux-linus real [real]
flight 187385 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187376/
http://logs.test-lab.xenproject.org/osstest/logs/187385/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-xl-raw      12 debian-di-install        fail REGR. vs. 187366

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187366
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187366
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187366
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187366
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187366
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187366
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                86987d84b968b69a610fd00ab9006c13db193b4e
baseline version:
 linux                3ec3f5fc4a91e389ea56b111a73d97ffc94f19c6

Last test of basis   187366  2024-08-27 18:40:54 Z    1 days
Testing same since   187376  2024-08-28 05:42:32 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  David Howells <dhowells@redhat.com>
  Jarkko Sakkinen <jarkko@kernel.org>
  Linus Torvalds <torvalds@linux-foundation.org>
  Stefan Berger <stefanb@linux.ibm.com>
  Stefan Metzmacher <metze@samba.org>
  Steve French <stfrench@microsoft.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 86987d84b968b69a610fd00ab9006c13db193b4e
Merge: 46d22bfdf0bc 416871f4fb84
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Wed Aug 28 15:05:02 2024 +1200

    Merge tag 'v6.11-rc5-client-fixes' of git://git.samba.org/sfrench/cifs-2.6
    
    Pull smb client fixes from Steve French:
    
     - two RDMA/smbdirect fixes and a minor cleanup
    
     - punch hole fix
    
    * tag 'v6.11-rc5-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
      cifs: Fix FALLOC_FL_PUNCH_HOLE support
      smb/client: fix rdma usage in smb2_async_writev()
      smb/client: remove unused rq_iter_size from struct smb_rqst
      smb/client: avoid dereferencing rdata=NULL in smb2_new_read_req()

commit 46d22bfdf0bc76429f596c58ca74a8f67d0f6251
Merge: 3ec3f5fc4a91 08d08e2e9f0a
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Wed Aug 28 14:55:48 2024 +1200

    Merge tag 'tpmdd-next-6.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd
    
    Pull TPM fix from Jarkko Sakkinen:
     "A bug fix for tpm_ibmvtpm driver so that it will take the bus
      encryption into use"
    
    * tag 'tpmdd-next-6.11-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd:
      tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support

commit 08d08e2e9f0ad1af0044e4747723f66677c35ee9
Author: Stefan Berger <stefanb@linux.ibm.com>
Date:   Mon Jul 29 09:29:34 2024 -0400

    tpm: ibmvtpm: Call tpm2_sessions_init() to initialize session support
    
    Commit d2add27cf2b8 ("tpm: Add NULL primary creation") introduced
    CONFIG_TCG_TPM2_HMAC. When this option is enabled on ppc64 then the
    following message appears in the kernel log due to a missing call to
    tpm2_sessions_init().
    
    [    2.654549] tpm tpm0: auth session is not active
    
    Add the missing call to tpm2_session_init() to the ibmvtpm driver to
    resolve this issue.
    
    Cc: stable@vger.kernel.org # v6.10+
    Fixes: d2add27cf2b8 ("tpm: Add NULL primary creation")
    Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
    Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
    Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>

commit 416871f4fb84bc96822562e654941d5625a25bf8
Author: David Howells <dhowells@redhat.com>
Date:   Fri Aug 23 14:22:42 2024 +0100

    cifs: Fix FALLOC_FL_PUNCH_HOLE support
    
    The cifs filesystem doesn't quite emulate FALLOC_FL_PUNCH_HOLE correctly
    (note that due to lack of protocol support, it can't actually implement it
    directly).  Whilst it will (partially) invalidate dirty folios in the
    pagecache, it doesn't write them back first, and so the EOF marker on the
    server may be lower than inode->i_size.
    
    This presents a problem, however, as if the punched hole invalidates the
    tail of the locally cached dirty data, writeback won't know it needs to
    move the EOF over to account for the hole punch (which isn't supposed to
    move the EOF).  We could just write zeroes over the punched out region of
    the pagecache and write that back - but this is supposed to be a
    deallocatory operation.
    
    Fix this by manually moving the EOF over on the server after the operation
    if the hole punched would corrupt it.
    
    Note that the FSCTL_SET_ZERO_DATA RPC and the setting of the EOF should
    probably be compounded to stop a third party interfering (or, at least,
    massively reduce the chance).
    
    This was reproducible occasionally by using fsx with the following script:
    
            truncate 0x0 0x375e2 0x0
            punch_hole 0x2f6d3 0x6ab5 0x375e2
            truncate 0x0 0x3a71f 0x375e2
            mapread 0xee05 0xcf12 0x3a71f
            write 0x2078e 0x5604 0x3a71f
            write 0x3ebdf 0x1421 0x3a71f *
            punch_hole 0x379d0 0x8630 0x40000 *
            mapread 0x2aaa2 0x85b 0x40000
            fallocate 0x1b401 0x9ada 0x40000
            read 0x15f2 0x7d32 0x40000
            read 0x32f37 0x7a3b 0x40000 *
    
    The second "write" should extend the EOF to 0x40000, and the "punch_hole"
    should operate inside of that - but that depends on whether the VM gets in
    and writes back the data first.  If it doesn't, the file ends up 0x3a71f in
    size, not 0x40000.
    
    Fixes: 31742c5a3317 ("enable fallocate punch hole ("fallocate -p") for SMB3")
    Signed-off-by: David Howells <dhowells@redhat.com>
    cc: Steve French <sfrench@samba.org>
    cc: Paulo Alcantara <pc@manguebit.com>
    cc: Shyam Prasad N <nspmangalore@gmail.com>
    cc: Jeff Layton <jlayton@kernel.org>
    cc: linux-cifs@vger.kernel.org
    cc: netfs@lists.linux.dev
    Signed-off-by: Steve French <stfrench@microsoft.com>

commit 017d1701743657fbfaea74397727a9d2b81846b7
Author: Stefan Metzmacher <metze@samba.org>
Date:   Wed Aug 21 16:31:39 2024 +0200

    smb/client: fix rdma usage in smb2_async_writev()
    
    rqst.rq_iter needs to be truncated otherwise we'll
    also send the bytes into the stream socket...
    
    This is the logic behind rqst.rq_npages = 0, which was removed in
    "cifs: Change the I/O paths to use an iterator rather than a page list"
    (d08089f649a0cfb2099c8551ac47eef0cc23fdf2).
    
    Cc: stable@vger.kernel.org
    Fixes: d08089f649a0 ("cifs: Change the I/O paths to use an iterator rather than a page list")
    Reviewed-by: David Howells <dhowells@redhat.com>
    Signed-off-by: Stefan Metzmacher <metze@samba.org>
    Signed-off-by: Steve French <stfrench@microsoft.com>

commit b608e2c318789aeba49055747166e13bee57df4a
Author: Stefan Metzmacher <metze@samba.org>
Date:   Wed Aug 21 15:59:12 2024 +0200

    smb/client: remove unused rq_iter_size from struct smb_rqst
    
    Reviewed-by: David Howells <dhowells@redhat.com>
    Fixes: d08089f649a0 ("cifs: Change the I/O paths to use an iterator rather than a page list")
    Signed-off-by: Stefan Metzmacher <metze@samba.org>
    Signed-off-by: Steve French <stfrench@microsoft.com>

commit c724b2ab6a46435b4e7d58ad2fbbdb7a318823cf
Author: Stefan Metzmacher <metze@samba.org>
Date:   Wed Aug 21 17:18:23 2024 +0200

    smb/client: avoid dereferencing rdata=NULL in smb2_new_read_req()
    
    This happens when called from SMB2_read() while using rdma
    and reaching the rdma_readwrite_threshold.
    
    Cc: stable@vger.kernel.org
    Fixes: a6559cc1d35d ("cifs: split out smb3_use_rdma_offload() helper")
    Reviewed-by: David Howells <dhowells@redhat.com>
    Signed-off-by: Stefan Metzmacher <metze@samba.org>
    Signed-off-by: Steve French <stfrench@microsoft.com>


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 21:27:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 21:27:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785152.1194557 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQC4-0008Qx-2W; Wed, 28 Aug 2024 21:27:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785152.1194557; Wed, 28 Aug 2024 21:27:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQC3-0008Qq-Uc; Wed, 28 Aug 2024 21:27:07 +0000
Received: by outflank-mailman (input) for mailman id 785152;
 Wed, 28 Aug 2024 21:27:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjQC1-0008Qg-Rx; Wed, 28 Aug 2024 21:27:05 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjQC1-000338-BD; Wed, 28 Aug 2024 21:27:05 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjQC0-000485-Ri; Wed, 28 Aug 2024 21:27:04 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjQC0-0003Qc-R3; Wed, 28 Aug 2024 21:27:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=hrNJiNQSxlMnTrA9O0wFNIBL/2ogkx3l4L2PYWWCf0M=; b=mQ3Aioz/p3tnwt8+Y87nn4RPS/
	41Nw+iLyale5Jl2fnK5wqVeGcrg3MqcfaRBx98jgwgUUmhM53LAs21z31n8GSwvl5aiQFWobi8Hsx
	OXIpz+Enxgzbydtl33tAz6XtfXWOqE/pPIf9eMljrWhqWr/Pm0Hf7Q0zgHpyWCo/Zz+Y=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187387-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187387: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=319835abb8517fde84bff31740fb1e61b33a3ae8
X-Osstest-Versions-That:
    ovmf=84e7b74c8c643c59ee32d4da769f48a3c8c277a4
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 21:27:04 +0000

flight 187387 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187387/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 319835abb8517fde84bff31740fb1e61b33a3ae8
baseline version:
 ovmf                 84e7b74c8c643c59ee32d4da769f48a3c8c277a4

Last test of basis   187384  2024-08-28 16:41:33 Z    0 days
Testing same since   187387  2024-08-28 19:11:27 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Ray Ni <ray.ni@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   84e7b74c8c..319835abb8  319835abb8517fde84bff31740fb1e61b33a3ae8 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 22:04:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 22:04:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785166.1194596 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQln-0006vg-HC; Wed, 28 Aug 2024 22:04:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785166.1194596; Wed, 28 Aug 2024 22:04:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQln-0006vZ-EB; Wed, 28 Aug 2024 22:04:03 +0000
Received: by outflank-mailman (input) for mailman id 785166;
 Wed, 28 Aug 2024 22:04:01 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjQll-0006E8-Ka
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 22:04:01 +0000
Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com
 [2a00:1450:4864:20::52b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6dd22981-6589-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 00:04:00 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5bed05c0a2fso8767537a12.3
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 15:04:00 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1c2d2esm2695898a12.16.2024.08.28.15.03.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 15:03:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6dd22981-6589-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724882638; x=1725487438; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=NylPTSK4uUZZH3htPDJReCwwETRg+F4qLCEB3OzPaac=;
        b=ZmdcLbqtqrxGpwBHHuGMX/0xYiXXcNxUmJSLJDXuLPO0qaeeAAWLBxYB2Ab4QTgKSF
         U6pDwE4ZI1gkuItnjNp12C+5LYrXoogHtniOuRbmvijZeKK1LvI7RywwQeOx7tJd4mwD
         6jEZwExQx7OTQqnXvFKhBbKwghEHNuDsM0O60=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724882638; x=1725487438;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=NylPTSK4uUZZH3htPDJReCwwETRg+F4qLCEB3OzPaac=;
        b=ZIx4TUimE3vUh6AUOokC94G5nSCwOOeYaVxsXr+r17fNDTO9Jfe5vhCTawQ8UyRqRF
         2vBDbUdHdHRDJeIQyXhsKsueSsp+Y1ItSw5XEvvBFH/vIzo9eb5gHMWP92LRKqBGdf0o
         RrEZhlPxJ+vAS4sgANYLCPjr8I10ty1rKmEnqjS0q3k1tHRvbd5xK/+hs+zkM6nSyH36
         mnyQEAgRV0vlgpZzxP0tCofnGAWE3wCXg5zA76gQu7L5dWV7RVTfVHsRrXyL9n/vX04v
         fOLPCtF2viKYYphbdduaq4TI0gY0C89mQ8z4SKXYNY50ENknlflgGuiy66lZoRvGsyvj
         VdAA==
X-Gm-Message-State: AOJu0YzBgsyInrsxITmoHZ2WuhG6iggn9YrKC+emkI5qQwnMnW3xN/4Q
	fvY7NG7qonaWgtls3011EnxyAqiGYLamkYGmO7yRjiAvcRquAsy5AyL8XkVcZ1WK5dh/yuVUtgI
	o
X-Google-Smtp-Source: AGHT+IE2eu8kKMFH5UPCGR6d+u0pnhhnKtzrehZJO4eQoOpFhy8qAaNfa1P2UR0oHN/qkBQGs1V35Q==
X-Received: by 2002:a05:6402:3705:b0:5c0:aadc:8b51 with SMTP id 4fb4d7f45d1cf-5c21ed5758emr695859a12.22.1724882638135;
        Wed, 28 Aug 2024 15:03:58 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v2 03/11] xen/bitops: Reinstate the please tidy message
Date: Wed, 28 Aug 2024 23:03:43 +0100
Message-Id: <20240828220351.2686408-4-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Recent additions have undone prior tidying at the top of the file.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/include/xen/bitops.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 94af6da18b9b..9f0a0ce4a73b 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -204,6 +204,8 @@ static always_inline bool test_bit(int nr, const volatile void *addr)
     test_bit(nr, addr);                                 \
 })
 
+/* --------------------- Please tidy above here --------------------- */
+
 static always_inline attr_const unsigned int ffs(unsigned int x)
 {
     if ( __builtin_constant_p(x) )
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 22:04:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 22:04:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785165.1194579 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQll-0006ME-Ba; Wed, 28 Aug 2024 22:04:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785165.1194579; Wed, 28 Aug 2024 22:04:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQll-0006L2-58; Wed, 28 Aug 2024 22:04:01 +0000
Received: by outflank-mailman (input) for mailman id 785165;
 Wed, 28 Aug 2024 22:03:59 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjQlj-0006E8-R2
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 22:03:59 +0000
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [2a00:1450:4864:20::534])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6c704332-6589-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 00:03:57 +0200 (CEST)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5bf006f37daso18895a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 15:03:57 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1c2d2esm2695898a12.16.2024.08.28.15.03.55
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 15:03:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6c704332-6589-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724882636; x=1725487436; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=TA9zJhMMiP1cl4HW7H7RUH127emY4xJNbEczm6wLMBU=;
        b=lyzXYIpTlZfTLoaktw/83gq7NnZCWtARmJkEIoQg5D4Pib7zbZpYyn2u5yNA7FpXnz
         tgBz+3kgRjR0N/XlEzTqG5XYZGp365TraSWmolI/7gjXgeE8C8TZDB/VEqIXXYGxbtx8
         zlYVTJKqy0j3GqSJmgtowx7G+ZG9qmpb/nU00=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724882636; x=1725487436;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=TA9zJhMMiP1cl4HW7H7RUH127emY4xJNbEczm6wLMBU=;
        b=hCh7KmDEMvZnpyoauCDBT2Fai5iMShq726JkLH3u2aTt4FsiOio8JEE3nYZ3S6NKxn
         4Pakmnjv1PGhr8DZIr5B2N+Lw/dlmCrgY+7JInTd0iDNOnCRFOHpTYZqyVLoOnsoMKlO
         SMpK6Y0/zsMkRxc1rgRpW+fSFzwG9JxcatwV/G4zZYIG/Xc7CajEmU5xQZSlbTzOWXID
         +1mIMd4vUxSqQ1MLUq/QdKIg5TcjNH5c/fjqf37xwJbS2mLxP0IEB2J41FlwYGj+MnbM
         DPbssmse1Q4whgtutIwahJMa7s6vijoprRZ9E6CcGHEyg3Oo5UHUem7/9/hfxJTKVnpU
         ugUg==
X-Gm-Message-State: AOJu0YwOD4rO/GR266l1+QibihGXDwHUDLwBpHkP/q1Y+LarA0qbbXIi
	ecVEifQvb4UW2wgGfB5OdQztNtkI0mgOOqovnzpwLAj1Ws8g8MmEB+EK2kl+oOr7VgH+Z4SWuhI
	l
X-Google-Smtp-Source: AGHT+IGD9DKTjQXlDEnryzLj/nD4dCJYNsZnTxN+I9P6dA3O2JfEGef4Tj0eX54rIlOSfqwvDZUzNg==
X-Received: by 2002:a05:6402:3506:b0:5c0:a8b8:dd6b with SMTP id 4fb4d7f45d1cf-5c22018ad3dmr620843a12.14.1724882636093;
        Wed, 28 Aug 2024 15:03:56 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v2 01/11] xen/compiler: Rename __attribute_const__ to attr_const
Date: Wed, 28 Aug 2024 23:03:41 +0100
Message-Id: <20240828220351.2686408-2-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

There's no need for the name to be so verbose.

No functional change.

Suggest-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>

v2:
 * New
---
 tools/libs/guest/xg_dom_decompress_unsafe_zstd.c |  2 +-
 xen/arch/arm/include/asm/arm64/cpufeature.h      | 12 ++++++------
 xen/arch/x86/include/asm/byteorder.h             |  4 ++--
 xen/arch/x86/include/asm/endbr.h                 |  4 ++--
 xen/include/xen/byteorder/swab.h                 |  6 +++---
 xen/include/xen/compiler.h                       |  2 +-
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c b/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c
index 7cd266444bb1..ff45732a3616 100644
--- a/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c
+++ b/tools/libs/guest/xg_dom_decompress_unsafe_zstd.c
@@ -22,7 +22,7 @@ typedef uint16_t __be16;
 typedef uint32_t __be32;
 typedef uint64_t __be64;
 
-#define __attribute_const__
+#define attr_const
 #define __force
 #define always_inline
 #define noinline
diff --git a/xen/arch/arm/include/asm/arm64/cpufeature.h b/xen/arch/arm/include/asm/arm64/cpufeature.h
index d9b9fa77cbd2..1bb503e857e9 100644
--- a/xen/arch/arm/include/asm/arm64/cpufeature.h
+++ b/xen/arch/arm/include/asm/arm64/cpufeature.h
@@ -44,25 +44,25 @@ struct arm64_ftr_bits {
 	s64		safe_val; /* safe value for FTR_EXACT features */
 };
 
-static inline int __attribute_const__
+static inline int attr_const
 cpuid_feature_extract_signed_field_width(u64 features, int field, int width)
 {
 	return (s64)(features << (64 - width - field)) >> (64 - width);
 }
 
-static inline int __attribute_const__
+static inline int attr_const
 cpuid_feature_extract_signed_field(u64 features, int field)
 {
 	return cpuid_feature_extract_signed_field_width(features, field, 4);
 }
 
-static inline unsigned int __attribute_const__
+static inline unsigned int attr_const
 cpuid_feature_extract_unsigned_field_width(u64 features, int field, int width)
 {
 	return (u64)(features << (64 - width - field)) >> (64 - width);
 }
 
-static inline unsigned int __attribute_const__
+static inline unsigned int attr_const
 cpuid_feature_extract_unsigned_field(u64 features, int field)
 {
 	return cpuid_feature_extract_unsigned_field_width(features, field, 4);
@@ -73,7 +73,7 @@ static inline u64 arm64_ftr_mask(const struct arm64_ftr_bits *ftrp)
 	return (u64)GENMASK(ftrp->shift + ftrp->width - 1, ftrp->shift);
 }
 
-static inline int __attribute_const__
+static inline int attr_const
 cpuid_feature_extract_field_width(u64 features, int field, int width, bool sign)
 {
 	return (sign) ?
@@ -81,7 +81,7 @@ cpuid_feature_extract_field_width(u64 features, int field, int width, bool sign)
 		cpuid_feature_extract_unsigned_field_width(features, field, width);
 }
 
-static inline int __attribute_const__
+static inline int attr_const
 cpuid_feature_extract_field(u64 features, int field, bool sign)
 {
 	return cpuid_feature_extract_field_width(features, field, 4, sign);
diff --git a/xen/arch/x86/include/asm/byteorder.h b/xen/arch/x86/include/asm/byteorder.h
index e935f7b2b03b..a877c07f6796 100644
--- a/xen/arch/x86/include/asm/byteorder.h
+++ b/xen/arch/x86/include/asm/byteorder.h
@@ -4,13 +4,13 @@
 #include <xen/types.h>
 #include <xen/compiler.h>
 
-static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
+static inline attr_const __u32 ___arch__swab32(__u32 x)
 {
     asm("bswap %0" : "=r" (x) : "0" (x));
     return x;
 }
 
-static inline __attribute_const__ __u64 ___arch__swab64(__u64 val)
+static inline attr_const __u64 ___arch__swab64(__u64 val)
 { 
     union { 
         struct { __u32 a,b; } s;
diff --git a/xen/arch/x86/include/asm/endbr.h b/xen/arch/x86/include/asm/endbr.h
index 3033e40d29a8..ba3bae714787 100644
--- a/xen/arch/x86/include/asm/endbr.h
+++ b/xen/arch/x86/include/asm/endbr.h
@@ -19,7 +19,7 @@
  * gen_endbr64() is written deliberately to avoid the problematic operand, and
  * marked __const__ as it is safe for the optimiser to hoist/merge/etc.
  */
-static inline uint32_t __attribute_const__ gen_endbr64(void)
+static inline uint32_t attr_const gen_endbr64(void)
 {
     uint32_t res;
 
@@ -45,7 +45,7 @@ static inline void place_endbr64(void *ptr)
  * contain an ENDBR64 instruction.  Use an encoding which isn't the default
  * P6_NOP4.  Specifically, nopw (%rcx)
  */
-static inline uint32_t __attribute_const__ gen_endbr64_poison(void)
+static inline uint32_t attr_const gen_endbr64_poison(void)
 {
     uint32_t res;
 
diff --git a/xen/include/xen/byteorder/swab.h b/xen/include/xen/byteorder/swab.h
index b7e30f050385..9f817e3c4492 100644
--- a/xen/include/xen/byteorder/swab.h
+++ b/xen/include/xen/byteorder/swab.h
@@ -123,7 +123,7 @@
 #endif /* OPTIMIZE */
 
 
-static inline __attribute_const__ __u16 __fswab16(__u16 x)
+static inline attr_const __u16 __fswab16(__u16 x)
 {
     return __arch__swab16(x);
 }
@@ -136,7 +136,7 @@ static inline void __swab16s(__u16 *addr)
     __arch__swab16s(addr);
 }
 
-static inline __attribute_const__ __u32 __fswab32(__u32 x)
+static inline attr_const __u32 __fswab32(__u32 x)
 {
     return __arch__swab32(x);
 }
@@ -150,7 +150,7 @@ static inline void __swab32s(__u32 *addr)
 }
 
 #ifdef __BYTEORDER_HAS_U64__
-static inline __attribute_const__ __u64 __fswab64(__u64 x)
+static inline attr_const __u64 __fswab64(__u64 x)
 {
 #  ifdef __SWAB_64_THRU_32__
     __u32 h = x >> 32;
diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
index 444bf80142c7..b118e4ba62eb 100644
--- a/xen/include/xen/compiler.h
+++ b/xen/include/xen/compiler.h
@@ -88,7 +88,7 @@
 
 #define __constructor       __attribute__((__constructor__)) cf_check
 #define __pure              __attribute__((__pure__))
-#define __attribute_const__ __attribute__((__const__))
+#define attr_const          __attribute__((__const__))
 #define __transparent__     __attribute__((__transparent_union__))
 
 /*
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 22:04:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 22:04:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785163.1194566 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQlk-0006ER-PE; Wed, 28 Aug 2024 22:04:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785163.1194566; Wed, 28 Aug 2024 22:04:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQlk-0006EK-MO; Wed, 28 Aug 2024 22:04:00 +0000
Received: by outflank-mailman (input) for mailman id 785163;
 Wed, 28 Aug 2024 22:03:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjQlj-0006E0-AZ
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 22:03:59 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6be75a87-6589-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 00:03:57 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-a8683dc3b17so470202666b.3
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 15:03:57 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1c2d2esm2695898a12.16.2024.08.28.15.03.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 15:03:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6be75a87-6589-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724882636; x=1725487436; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=YY7MdvuXI6KKD8+0pPI2HR0N6tLhBf9qtdXr9xTRqOc=;
        b=JVg+js8fhpXq0R7yHZOGyCwdSnLv9LB32l/WDbC7v8aVXiq0IULmFHNOigMaQs5Tod
         mDwQJj4zLkSzSDyZr4/JwkWleJmhXwSb8IGpuFQ2aAAzCeEsolDY+bFTqWuJinTyEj4I
         9v455mIuarMUdSyp8xBJQM7+hA3rKaLmI4o/w=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724882636; x=1725487436;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=YY7MdvuXI6KKD8+0pPI2HR0N6tLhBf9qtdXr9xTRqOc=;
        b=PSLmzp43+k0Zqb6domwnBNSO0ikPtOltWH6IZm5X0kweB+fAoKoXJYKC2j1iosKire
         GowEPdyu2rLymzZJb43RZurgTzwhVgw40Jb5UxcDsh5IXZvvZYnv+c6Oj8xjc/am0KWA
         KhN0t8qULdft5L9opgtURQVoV+0ANbROvOzBSGp9WRHyfI9EuJbRwOEW2ByRYR27Mh2v
         cOYcZ23D1mDSELOtCqVTj4hGLqoOfqCOGKz3AAp+PoYd2yrQ1mp40+dOS7hNp8GTVgkN
         FujcbcsHn/9whJowCFLeYnmOW2MyoTFvOW5Sj4k0Zw/FcBNKPB/ED0FMe3jPecbIJ0/E
         VR3g==
X-Gm-Message-State: AOJu0YxI4vfYxH9CRLcDQ6ClcTkCmoYjocyusHwqRed6up2zsieszeR8
	PGmIT6dL1RAXcO67yarzZs6BOgZz54H2YmDaNk8p7tXzjzTpIb6SSBi/WBpIefNsnJsNChWs1qf
	j
X-Google-Smtp-Source: AGHT+IEuHLfT8SF7T9SoGHK35Ew10y9xfRr96n0xd9gQtPh6jurJbr0jjpik5vI6lideD3kIfObDjw==
X-Received: by 2002:a05:6402:90c:b0:5a1:2ce9:f416 with SMTP id 4fb4d7f45d1cf-5c21eda0c2bmr824009a12.37.1724882635259;
        Wed, 28 Aug 2024 15:03:55 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v2 00/11] xen/bitops: hweight() cleanup/improvements
Date: Wed, 28 Aug 2024 23:03:40 +0100
Message-Id: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The next phase of bitops cleanup.  This series:

 1) Untangles the mess around hweight()
 2) Removes some unwise uses of hweight()
 3) Makes it work transparently for RISC-V
 4) Use the POPCNT instruction on x86 when available

See individual patches for v2 changes.

https://gitlab.com/xen-project/people/andyhhp/xen/-/pipelines/1431232348
https://cirrus-ci.com/build/6014616877137920

Andrew Cooper (11):
  xen/compiler: Rename __attribute_const__ to attr_const
  xen/bitops: Switch from __pure to attr_const
  xen/bitops: Reinstate the please tidy message
  xen/bitops: Introduce a multiple_bits_set() helper
  xen/bitops: Convert 'hweight(x) > 1' to new multiple_bits_set()
  xen/bitops: Drop the remnants of hweight{8,16}()
  xen/bitops: Introduce generic_hweightl() and hweightl()
  xen/bitops: Drop hweight_long() and use hweightl()
  xen/bitops: Implement hweight32() in terms of hweightl()
  xen/bitops: Implement hweight64() in terms of hweight{l,32}()
  x86/bitops: Use the POPCNT instruction when available

 xen/arch/arm/include/asm/arm64/cpufeature.h |  12 +-
 xen/arch/arm/include/asm/bitops.h           |  11 --
 xen/arch/ppc/include/asm/bitops.h           |  11 +-
 xen/arch/x86/cpu/vpmu.c                     |   2 +-
 xen/arch/x86/hvm/vlapic.c                   |  10 +-
 xen/arch/x86/include/asm/bitops.h           |  32 ++++--
 xen/arch/x86/include/asm/byteorder.h        |   4 +-
 xen/arch/x86/include/asm/endbr.h            |   4 +-
 xen/common/bitmap.c                         |   4 +-
 xen/common/bitops.c                         |  40 +++++++
 xen/common/numa.c                           |   2 +-
 xen/include/xen/bitops.h                    | 118 +++++++++-----------
 xen/include/xen/byteorder/swab.h            |   6 +-
 xen/include/xen/compiler.h                  |   2 +-
 xen/include/xen/self-tests.h                |  10 +-
 xen/lib/Makefile                            |   2 +
 xen/lib/generic-hweightl.c                  |  49 ++++++++
 xen/lib/x86-generic-hweightl.c              |  69 ++++++++++++
 18 files changed, 266 insertions(+), 122 deletions(-)
 create mode 100644 xen/lib/generic-hweightl.c
 create mode 100644 xen/lib/x86-generic-hweightl.c

-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 22:04:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 22:04:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785164.1194571 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQll-0006HE-2D; Wed, 28 Aug 2024 22:04:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785164.1194571; Wed, 28 Aug 2024 22:04:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQlk-0006Fq-TV; Wed, 28 Aug 2024 22:04:00 +0000
Received: by outflank-mailman (input) for mailman id 785164;
 Wed, 28 Aug 2024 22:03:59 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjQlj-0006E0-Ig
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 22:03:59 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6cff8213-6589-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 00:03:58 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5bf0261f162so8588209a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 15:03:58 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1c2d2esm2695898a12.16.2024.08.28.15.03.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 15:03:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6cff8213-6589-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724882637; x=1725487437; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=uiSYv9zaENNOFB/jb2t7LrfrF1ZHW6+ZFjjQ3yb40Ek=;
        b=LMPUC3MnPKJV7324noSpfQG0pAxQKQJhuYPfYeJ31TavdAs7Jxa2pqenUnBGyaS3sb
         ok8QdClTdQoSjGELTwaWPNNAfmPxmvWrhnGGsE3rapP06R4DMySkSsdlvGsa87nUFjY0
         UWRuoEBRNslNz1NcTjJTcYbKTXnsdNpresrbg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724882637; x=1725487437;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=uiSYv9zaENNOFB/jb2t7LrfrF1ZHW6+ZFjjQ3yb40Ek=;
        b=Km9tPHpJv1nzLDzy4wc1QXFEO1AxW3lYYsARG7k6rUzhMfSoajRsbzsXYvLY0Fz2ad
         ltxZhfky9hZMprmCkmO8K2Q5yH5FY84T0S7ZuhctJyDXIexSwPz+CZL1X1RgcsO/ZeVz
         BpX6QNwlZfWxQqlHMuvHbIk9YtF1NtSNpbFJ4pxwVNmfKMeIs/kWUUcsveGhhK9Rtvq6
         ZGphpN2RnRuUIE3Us6MzRXHJcZP7LnzV8S7C+uR4/gGWm6+NVcxHdIAFn+UbzzUWq4/l
         BjzpIRdkPZ/J2WOmKUVqUOsThpFI5s2Vy8OdyS3QewMhYOUb7vloCqfKfJLDC7tlo+pH
         wPxg==
X-Gm-Message-State: AOJu0YwM6aSQo45fcKnidNEIdmXdPhr2YcPkeFInuzPKRhVrLZaJpugt
	3fpuq1kxoCDP4LB0BSSNfU38DEKS8S2OeKwqR0ZFwctsEHJxciGEGk+8Y6T/amitum61EZHUD8m
	d
X-Google-Smtp-Source: AGHT+IEtdemzdGxMgWOSMC2OOmCx1wf030Xl+NsCnh9UAs1rIvfUrQcYgpBhIgnas5MaVAkOPz96nA==
X-Received: by 2002:a05:6402:518e:b0:5c0:bba6:860e with SMTP id 4fb4d7f45d1cf-5c21ed52c4dmr755306a12.18.1724882637093;
        Wed, 28 Aug 2024 15:03:57 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v2 02/11] xen/bitops: Switch from __pure to attr_const
Date: Wed, 28 Aug 2024 23:03:42 +0100
Message-Id: <20240828220351.2686408-3-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

All of the ffs()/fls() infrastructure is in fact (attr) const, because it
doesn't even read global state.  This allows the compiler even more
flexibility to optimise.

No functional change.

Reported-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>

v2:
 * New
---
 xen/include/xen/bitops.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 1cd43e464d9e..94af6da18b9b 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -32,8 +32,8 @@ extern void __bitop_bad_size(void);
  *
  * Bits are labelled from 1.  Returns 0 if given 0.
  */
-unsigned int __pure generic_ffsl(unsigned long x);
-unsigned int __pure generic_flsl(unsigned long x);
+unsigned int attr_const generic_ffsl(unsigned long x);
+unsigned int attr_const generic_flsl(unsigned long x);
 
 /**
  * generic__test_and_set_bit - Set a bit and return its old value
@@ -204,7 +204,7 @@ static always_inline bool test_bit(int nr, const volatile void *addr)
     test_bit(nr, addr);                                 \
 })
 
-static always_inline __pure unsigned int ffs(unsigned int x)
+static always_inline attr_const unsigned int ffs(unsigned int x)
 {
     if ( __builtin_constant_p(x) )
         return __builtin_ffs(x);
@@ -216,7 +216,7 @@ static always_inline __pure unsigned int ffs(unsigned int x)
 #endif
 }
 
-static always_inline __pure unsigned int ffsl(unsigned long x)
+static always_inline attr_const unsigned int ffsl(unsigned long x)
 {
     if ( __builtin_constant_p(x) )
         return __builtin_ffsl(x);
@@ -228,7 +228,7 @@ static always_inline __pure unsigned int ffsl(unsigned long x)
 #endif
 }
 
-static always_inline __pure unsigned int ffs64(uint64_t x)
+static always_inline attr_const unsigned int ffs64(uint64_t x)
 {
     if ( BITS_PER_LONG == 64 )
         return ffsl(x);
@@ -246,7 +246,7 @@ static always_inline __pure unsigned int ffs64(uint64_t x)
      sizeof(x) <= sizeof(uint64_t) ? ffs64(x) :         \
      ({ BUILD_ERROR("ffs_g() Bad input type"); 0; }))
 
-static always_inline __pure unsigned int fls(unsigned int x)
+static always_inline attr_const unsigned int fls(unsigned int x)
 {
     if ( __builtin_constant_p(x) )
         return x ? 32 - __builtin_clz(x) : 0;
@@ -258,7 +258,7 @@ static always_inline __pure unsigned int fls(unsigned int x)
 #endif
 }
 
-static always_inline __pure unsigned int flsl(unsigned long x)
+static always_inline attr_const unsigned int flsl(unsigned long x)
 {
     if ( __builtin_constant_p(x) )
         return x ? BITS_PER_LONG - __builtin_clzl(x) : 0;
@@ -270,7 +270,7 @@ static always_inline __pure unsigned int flsl(unsigned long x)
 #endif
 }
 
-static always_inline __pure unsigned int fls64(uint64_t x)
+static always_inline attr_const unsigned int fls64(uint64_t x)
 {
     if ( BITS_PER_LONG == 64 )
         return flsl(x);
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 22:04:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 22:04:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785167.1194606 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQlo-0007BU-WF; Wed, 28 Aug 2024 22:04:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785167.1194606; Wed, 28 Aug 2024 22:04:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQlo-0007BJ-R7; Wed, 28 Aug 2024 22:04:04 +0000
Received: by outflank-mailman (input) for mailman id 785167;
 Wed, 28 Aug 2024 22:04:03 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjQln-0006E8-Nb
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 22:04:03 +0000
Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com
 [2a00:1450:4864:20::22e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6f09f2af-6589-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 00:04:02 +0200 (CEST)
Received: by mail-lj1-x22e.google.com with SMTP id
 38308e7fff4ca-2f3e9fb6ee9so84001561fa.3
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 15:04:02 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1c2d2esm2695898a12.16.2024.08.28.15.03.58
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 15:03:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6f09f2af-6589-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724882641; x=1725487441; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=jE7MF4AvTxU0huYOPOMOwWO7uwI5OHylKNn5LBEsDiE=;
        b=Fyud8T8eUx8itFWQ9uj6AEwijMh64XFVIwQo1D2Ku0LpVc2FXHP1Wh0n+foZU+K1Ru
         pY0Nl1fvQzqLqm9/yS9UrU/8UpsvKbQR2BgtBS0i7Gz1dZe7Cpvs3jLl4Teip/2+NQhD
         aGQCbjwJLHw13B21XWPSIlFlF+awbJ2y7JK7o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724882641; x=1725487441;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=jE7MF4AvTxU0huYOPOMOwWO7uwI5OHylKNn5LBEsDiE=;
        b=jtZMiZ/GrGT6yVY98Cqm4Z1B3uE8fX02uYv2tXAuDPBIklmpOwGWWZlAWiKcZF2NIC
         Is7ccXLiPYc40u6IjHadDGtdzDdo2XYclSjKj5F3ItZH4Pyag10DRusw3MxMkRkI/w8W
         rO1Yi68SLbtyIn9twki5T5S1kvuuQyT/rZJ3czChtniOst9pqo8Glyfk/q/6YpdyotA9
         9+oPtRqGdyUM+J6zvDo0xtxtjr2dubgt9t8Sd6JQgmbl/U/RP0SPz7opV6dw8Z/IcS5O
         VSNiZIcaU0RPqxNsMvYpVgt1g4l7U4P8cx1b0W52lxPMb9UYFNcez1dpon8O411evRe3
         Uh0g==
X-Gm-Message-State: AOJu0YyGWT/b87zZYcd59eIJyRTOcSdCIYf+In452ja1sh3UuxN7/ygh
	7rAdEPPmjUL9SSdOWwftmY7T1+iT3QVHOGWlcbkbBKN4tm8fTCCXG39IBkPKkPLXsKtxQOOGt8Y
	/
X-Google-Smtp-Source: AGHT+IGskY5mUpIjN+AdOMHhdI+obRxCcgVMM986wSrN/PLyjC7vqCbNurLLvgdunNzRC4wX05XAQg==
X-Received: by 2002:a05:651c:1543:b0:2ef:2dfd:15e3 with SMTP id 38308e7fff4ca-2f6103a28femr5671851fa.19.1724882640541;
        Wed, 28 Aug 2024 15:04:00 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v2 04/11] xen/bitops: Introduce a multiple_bits_set() helper
Date: Wed, 28 Aug 2024 23:03:44 +0100
Message-Id: <20240828220351.2686408-5-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This will be used to simplify real logic in the following patch.  Add compile
and boot time testing as with other bitops.

Because the expression is so simple, implement it as a function-like macro
which is generic on the type of it's argument, rather than having multiple
variants.

Testing function-like macros needs a minor adjustments to the infrastructure
in xen/self-tests.h to avoid bracketing the fn parameter.  The utility of this
outweighs the associated risks.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>

Name inevitably subject to nitpicking.  I'd prefer it to be shorter but I
can't think of anything suitable.

v2:
 * Drop redundant CHECK() in the BITS_PER_LONG > 32 case.
---
 xen/common/bitops.c          | 23 +++++++++++++++++++++++
 xen/include/xen/bitops.h     | 10 ++++++++++
 xen/include/xen/self-tests.h | 10 ++++++++--
 3 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/xen/common/bitops.c b/xen/common/bitops.c
index 9e532f0d87aa..b504dd1308b8 100644
--- a/xen/common/bitops.c
+++ b/xen/common/bitops.c
@@ -112,9 +112,32 @@ static void __init test_for_each_set_bit(void)
         panic("for_each_set_bit(uint64) expected %#"PRIx64", got %#"PRIx64"\n", ull, ull_res);
 }
 
+static void __init test_multiple_bits_set(void)
+{
+    /*
+     * multiple_bits_set() is generic on the type of it's parameter, as the
+     * internal expression is so simple.
+     */
+
+    CHECK(multiple_bits_set, 0, false);
+    CHECK(multiple_bits_set, 1, false);
+    CHECK(multiple_bits_set, 2, false);
+    CHECK(multiple_bits_set, 3, true);
+
+    CHECK(multiple_bits_set, 1 | (1UL << (BITS_PER_LONG - 1)), true);
+#if BITS_PER_LONG > 32
+    CHECK(multiple_bits_set, 1 | (1UL << 32), true);
+#endif
+
+    CHECK(multiple_bits_set, 0x8000000000000001ULL, true);
+    CHECK(multiple_bits_set, 0xc000000000000000ULL, true);
+}
+
 static void __init __constructor test_bitops(void)
 {
     test_ffs();
     test_fls();
     test_for_each_set_bit();
+
+    test_multiple_bits_set();
 }
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 9f0a0ce4a73b..e7c2c5598275 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -298,6 +298,16 @@ static always_inline attr_const unsigned int fls64(uint64_t x)
               __v && ((iter) = ffs_g(__v) - 1, true);   \
               __v &= __v - 1 )
 
+/*
+ * Calculate if a value has two or more bits set.  Always use this in
+ * preference to an expression of the form 'hweight(x) > 1'.
+ */
+#define multiple_bits_set(x)                    \
+    ({                                          \
+        typeof(x) _v = (x);                     \
+        (_v & (_v - 1)) != 0;                   \
+    })
+
 /* --------------------- Please tidy below here --------------------- */
 
 #ifndef find_next_bit
diff --git a/xen/include/xen/self-tests.h b/xen/include/xen/self-tests.h
index e9a879489363..bd8a4867aa40 100644
--- a/xen/include/xen/self-tests.h
+++ b/xen/include/xen/self-tests.h
@@ -15,11 +15,14 @@
  *
  * Clang < 8 can't fold constants through static inlines, causing this to
  * fail.  Simply skip it for incredibly old compilers.
+ *
+ * N.B. fn is intentionally not bracketed to allow us to test function-like
+ * macros too.
  */
 #if !defined(CONFIG_CC_IS_CLANG) || CONFIG_CLANG_VERSION >= 80000
 #define COMPILE_CHECK(fn, val, res)                                     \
     do {                                                                \
-        typeof((fn)(val)) real = (fn)(val);                             \
+        typeof(fn(val)) real = fn(val);                                 \
                                                                         \
         if ( !__builtin_constant_p(real) )                              \
             BUILD_ERROR("'" STR(fn(val)) "' not compile-time constant"); \
@@ -34,10 +37,13 @@
  * Check that Xen's runtime logic for fn(val) gives the expected answer.  This
  * requires using HIDE() to prevent the optimiser from collapsing the logic
  * into a constant.
+ *
+ * N.B. fn is intentionally not bracketed to allow us to test function-like
+ * macros too.
  */
 #define RUNTIME_CHECK(fn, val, res)                     \
     do {                                                \
-        typeof((fn)(val)) real = (fn)(HIDE(val));       \
+        typeof(fn(val)) real = fn(HIDE(val));           \
                                                         \
         if ( real != (res) )                            \
             panic("%s: %s(%s) expected %u, got %u\n",   \
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 22:04:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 22:04:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785168.1194616 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQlq-0007Ss-A2; Wed, 28 Aug 2024 22:04:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785168.1194616; Wed, 28 Aug 2024 22:04:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQlq-0007Sc-5I; Wed, 28 Aug 2024 22:04:06 +0000
Received: by outflank-mailman (input) for mailman id 785168;
 Wed, 28 Aug 2024 22:04:04 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjQlo-0006E0-Fb
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 22:04:04 +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 702a4b3d-6589-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 00:04:04 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5c0abaae174so4210006a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 15:04:04 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1c2d2esm2695898a12.16.2024.08.28.15.04.01
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 15:04:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 702a4b3d-6589-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724882643; x=1725487443; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=1d4T7bgcWZFGEOhnXIFX9rzTrMxxv0mMcntif1gRWqE=;
        b=rDw/v8bnzRTZHYzsgx9qQyUe+lDE7zoQbJXY3qfHCrH/mg8bbfkUd0Su/1Vu/0MNGg
         j0zR7Pib5OFCMbqvpBxVz8fH+MM8gC19U9Jt27euoeltoTuwOJVPxK3xtos5A8Q30ho0
         z4nwJ4qqNGLBjyvaYWxs0PgLPFSVcLyolk734=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724882643; x=1725487443;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=1d4T7bgcWZFGEOhnXIFX9rzTrMxxv0mMcntif1gRWqE=;
        b=cql2E8ZC2XHcazHTP+ukJ/6zv42aBKEZDF9+RUsnxgF5rDCprgaL869n1M4XpWzIN1
         9Xiok5uktFD5X0KAzrkmDJbKtO13Qd2StZpZAfyMRa9m97LcJ6Eoantt7OQgje8W7oXG
         VLiAoYOju5VDpZ7BTORNGmshxp0VEPOXXs0PXVkeoWkkX4ei+7yCG07mlr/LNX6M4bRH
         JAXJvnXE3C1Xsxju0gZ+S6T4nhS/p/dYFNwTviJR6/UMxD1AvEY3j10znrF3FAIAe0Qv
         jR2rZKjlAdCTY7cSen0VRF21B/uN+FsJY+NRVl0AAmF3IQcZPKK5oQcTXpONAB0xWQqj
         MWaQ==
X-Gm-Message-State: AOJu0YzYNc8jeASN8jAl4zcoKGUWB7XU+lJAtw/uXkVVMJmWTycaD8vz
	OStrptz00JAD8Fc7SVT0EnomPlXSfG2iHtmh1m1O8IdaDY0C8vFI/NcjIrIFdCjQPNjdcQR77Lx
	k
X-Google-Smtp-Source: AGHT+IF7BfYv8A77TM6Js7u46H/5nrrqGXZxWpYnBfYsiP2mHja+VUkq+v83YoMCSlV9Z3MbjxLEzg==
X-Received: by 2002:a05:6402:518e:b0:5be:fc44:d159 with SMTP id 4fb4d7f45d1cf-5c21ed52ba1mr605962a12.22.1724882642446;
        Wed, 28 Aug 2024 15:04:02 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v2 06/11] xen/bitops: Drop the remnants of hweight{8,16}()
Date: Wed, 28 Aug 2024 23:03:46 +0100
Message-Id: <20240828220351.2686408-7-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

They are no more.  No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/arch/arm/include/asm/bitops.h |  2 --
 xen/arch/ppc/include/asm/bitops.h |  2 --
 xen/arch/x86/include/asm/bitops.h |  2 --
 xen/include/xen/bitops.h          | 17 -----------------
 4 files changed, 23 deletions(-)

diff --git a/xen/arch/arm/include/asm/bitops.h b/xen/arch/arm/include/asm/bitops.h
index 3c023103f734..91cd167b6bbb 100644
--- a/xen/arch/arm/include/asm/bitops.h
+++ b/xen/arch/arm/include/asm/bitops.h
@@ -86,8 +86,6 @@ bool clear_mask16_timeout(uint16_t mask, volatile void *p,
  */
 #define hweight64(x) generic_hweight64(x)
 #define hweight32(x) generic_hweight32(x)
-#define hweight16(x) generic_hweight16(x)
-#define hweight8(x) generic_hweight8(x)
 
 #endif /* _ARM_BITOPS_H */
 /*
diff --git a/xen/arch/ppc/include/asm/bitops.h b/xen/arch/ppc/include/asm/bitops.h
index eb3355812ea3..a62c4f99c3bb 100644
--- a/xen/arch/ppc/include/asm/bitops.h
+++ b/xen/arch/ppc/include/asm/bitops.h
@@ -132,7 +132,5 @@ static inline int test_and_set_bit(unsigned int nr, volatile void *addr)
  */
 #define hweight64(x) __builtin_popcountll(x)
 #define hweight32(x) __builtin_popcount(x)
-#define hweight16(x) __builtin_popcount((uint16_t)(x))
-#define hweight8(x)  __builtin_popcount((uint8_t)(x))
 
 #endif /* _ASM_PPC_BITOPS_H */
diff --git a/xen/arch/x86/include/asm/bitops.h b/xen/arch/x86/include/asm/bitops.h
index 8c0403405aa2..4c5b21907a64 100644
--- a/xen/arch/x86/include/asm/bitops.h
+++ b/xen/arch/x86/include/asm/bitops.h
@@ -483,7 +483,5 @@ static always_inline unsigned int arch_flsl(unsigned long x)
  */
 #define hweight64(x) generic_hweight64(x)
 #define hweight32(x) generic_hweight32(x)
-#define hweight16(x) generic_hweight16(x)
-#define hweight8(x) generic_hweight8(x)
 
 #endif /* _X86_BITOPS_H */
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index e7c2c5598275..1c160b643ed6 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -395,23 +395,6 @@ static inline unsigned int generic_hweight32(unsigned int w)
     return (w + (w >> 16)) & 0xff;
 }
 
-static inline unsigned int generic_hweight16(unsigned int w)
-{
-    w -= ((w >> 1) & 0x5555);
-    w =  (w & 0x3333) + ((w >> 2) & 0x3333);
-    w =  (w + (w >> 4)) & 0x0f0f;
-
-    return (w + (w >> 8)) & 0xff;
-}
-
-static inline unsigned int generic_hweight8(unsigned int w)
-{
-    w -= ((w >> 1) & 0x55);
-    w =  (w & 0x33) + ((w >> 2) & 0x33);
-
-    return (w + (w >> 4)) & 0x0f;
-}
-
 static inline unsigned int generic_hweight64(uint64_t w)
 {
     if ( BITS_PER_LONG < 64 )
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 22:04:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 22:04:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785169.1194620 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQlq-0007Wd-Kq; Wed, 28 Aug 2024 22:04:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785169.1194620; Wed, 28 Aug 2024 22:04:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQlq-0007Tu-Cb; Wed, 28 Aug 2024 22:04:06 +0000
Received: by outflank-mailman (input) for mailman id 785169;
 Wed, 28 Aug 2024 22:04:05 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjQlp-0006E8-4G
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 22:04:05 +0000
Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com
 [2a00:1450:4864:20::531])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6fe06872-6589-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 00:04:03 +0200 (CEST)
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5a10835487fso10803030a12.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 15:04:03 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1c2d2esm2695898a12.16.2024.08.28.15.04.00
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 15:04:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6fe06872-6589-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724882642; x=1725487442; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=ZXiFJWRq4x5FPe198sZU9vAtmoQscirnVku7zrIp0cM=;
        b=AbMiCzaNw0J+7PjWB8aCJV6Pn2eztdFDTL0VPEFHeN5cmMrJEsdc+h5hCo9J3j1rOU
         IvAtx2Pfn3/TcNM53PABbHTCqlZ6FI0KTNFO7RO2claYanfwzYz2HGPR0rSKWImmuayU
         QyfOQ09YXX9fM6QMEj65IUOlKjD9mRABasOcE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724882642; x=1725487442;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=ZXiFJWRq4x5FPe198sZU9vAtmoQscirnVku7zrIp0cM=;
        b=UcOnKcIAAbA0kM7V+zt05kWYQozjxCHv+lZzliJlSHHAWFfVdb/ZFrF63YS9Ecsjwg
         C1v4FJ2naCpG311WdEn3qrE1kRErfFZTqaa8q6LZnHUWisZm+LrIswq+oqKwF2t5DMMO
         SZMGl922841IXMJuqAXAb8iOvyqsgc4ZfMv/wSJVdg50Qw2kk8ZysaIsj/AnpL8Uq6BQ
         UQXg4cH9/PeR0UUmhIVeA9a/vrlo6WWWkMUPnGcC4rTOYxCeOoCVjwLCw5GlWECaUVdL
         yNkCUULjPt7wMgJlkquYwdidMd0tELav56BCX+E4v7KqvnFeqPP1MvPogyJahzfeJ6u3
         450w==
X-Gm-Message-State: AOJu0YwaG8sQ8wbbucrUDitjyK9A3vGdTs6ed8llZYU6BiRsTvpU4Gkf
	jwQoz1dBu7Cx5EMrqsUHr5Fny2uDOpkhlNhqpLTxc3jSh8/smI7ugECp59pigKG+ny5x+Zgoskj
	f
X-Google-Smtp-Source: AGHT+IEvBWczXJywqu93GhfTA0hun1Xm5VwCqG1AFE2wyPe5kLOh7xiV1ipXRad4bLf+4WSvk1yCJw==
X-Received: by 2002:a05:6402:40c4:b0:5be:fbce:939e with SMTP id 4fb4d7f45d1cf-5c21ec5b94dmr882236a12.0.1724882641403;
        Wed, 28 Aug 2024 15:04:01 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v2 05/11] xen/bitops: Convert 'hweight(x) > 1' to new multiple_bits_set()
Date: Wed, 28 Aug 2024 23:03:45 +0100
Message-Id: <20240828220351.2686408-6-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Using hweight() is an especially expensive way of determining simply if
multiple bits are set in a value.  Worse, 4 of the 10 hweight() calls in Xen
are of this form.

Switch to the new multiple_bits_set() helper.  This is far more efficient than
the longhand hweight() algorithm and, owing to its simplicity, likely more
efficient than even a dedicated instruction on a superscalar processor.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>

For future work, do related work for bitmap_weight() so cpumask_weight() in
particular can stop being used for so many 0/1 special cases.

On x86, the code reduction speaks for itself:

  add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-240 (-240)
  Function                                     old     new   delta
  vlapic_ipi                                   722     650     -72
  numa_emulation                               577     497     -80
  do_xenpmu_op                                1665    1577     -88

That's an aweful lot of wasted calculation for the same answer.

I can't find a way of enabling CONFIG_NUMA on ARM (yet?) so right now there's
no change in any other architecture.  However, a synthetic helper shows the
following on ARM32:

  add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-128 (-128)
  Function                                     old     new   delta
  test_mbs                                     176      48    -128

and on ARM64:

  add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-44 (-44)
  Function                                     old     new   delta
  test_mbs                                      60      16     -44

PPC64 has POPCNTD in a default build of Xen and by chance both algorithms
compile to the same number of instructions.

RISC-V doesn't have hweight() wired up yet at all.
---
 xen/arch/x86/cpu/vpmu.c   |  2 +-
 xen/arch/x86/hvm/vlapic.c | 10 ++++++----
 xen/common/numa.c         |  2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index b2ba9994129b..a5bb1689c7d5 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -673,7 +673,7 @@ long do_xenpmu_op(
     {
         if ( (pmu_params.val &
               ~(XENPMU_MODE_SELF | XENPMU_MODE_HV | XENPMU_MODE_ALL)) ||
-             (hweight64(pmu_params.val) > 1) )
+             multiple_bits_set(pmu_params.val) )
             return -EINVAL;
 
         /* 32-bit dom0 can only sample itself. */
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index 2ec95942713e..4a3e21a65f9d 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -467,12 +467,14 @@ static bool is_multicast_dest(struct vlapic *vlapic, unsigned int short_hand,
         return short_hand != APIC_DEST_SELF;
 
     if ( vlapic_x2apic_mode(vlapic) )
-        return dest_mode ? hweight16(dest) > 1 : dest == 0xffffffffU;
+        return dest_mode ? multiple_bits_set((uint16_t)dest)
+                         : dest == 0xffffffffU;
 
     if ( dest_mode )
-        return hweight8(dest &
-                        GET_xAPIC_DEST_FIELD(vlapic_get_reg(vlapic,
-                                                            APIC_DFR))) > 1;
+    {
+        dest &= GET_xAPIC_DEST_FIELD(vlapic_get_reg(vlapic, APIC_DFR));
+        return multiple_bits_set((uint8_t)dest);
+    }
 
     return dest == 0xff;
 }
diff --git a/xen/common/numa.c b/xen/common/numa.c
index 28a09766fabc..ce3991929ce5 100644
--- a/xen/common/numa.c
+++ b/xen/common/numa.c
@@ -546,7 +546,7 @@ static int __init numa_emulation(unsigned long start_pfn,
     uint64_t sz = pfn_to_paddr(end_pfn - start_pfn) / numa_fake;
 
     /* Kludge needed for the hash function */
-    if ( hweight64(sz) > 1 )
+    if ( multiple_bits_set(sz) )
     {
         uint64_t x = 1;
 
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 22:04:08 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 22:04:08 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785170.1194636 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQls-00080O-P4; Wed, 28 Aug 2024 22:04:08 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785170.1194636; Wed, 28 Aug 2024 22:04:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQls-000808-LF; Wed, 28 Aug 2024 22:04:08 +0000
Received: by outflank-mailman (input) for mailman id 785170;
 Wed, 28 Aug 2024 22:04: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=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjQlq-0006E0-U7
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 22:04:06 +0000
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [2a00:1450:4864:20::534])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 717cec95-6589-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 00:04:06 +0200 (CEST)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5bed72ff2f2so9048435a12.2
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 15:04:06 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1c2d2esm2695898a12.16.2024.08.28.15.04.02
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 15:04:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 717cec95-6589-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724882645; x=1725487445; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=uz9gF0kJ1ww5Xl2kbFnbXvQPW3lQQ7rY+fD3ahbYndw=;
        b=cD2ielAqEZaS2j5hMPfNsDbJHvhVBtoNOjRxh9zYLUMwJHxVrhznwXtC7OaKu11UV2
         TnY+CUXaLS8qSluASp75oWH45GL+EXPFmZlFE3xWsW7Tctq6yt3ey9D4X/LMXVbtwTfg
         fOnJcZK/e1CeJUJmeSBauK47f3I7reFLjWg0U=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724882645; x=1725487445;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=uz9gF0kJ1ww5Xl2kbFnbXvQPW3lQQ7rY+fD3ahbYndw=;
        b=cQ6F2vwa15laAUFUndfNlvD6vg1KnZB4Ri0T2w4bRecy7zJkF1G2S56SohTr8B6Y9D
         mjcDOGRau0yd344j804XqIn3Vk5x4yb8l8IPQv4T9DiGwkhA5lYnzH9sAkChzsoOkV4P
         pMFs/Zqfcs8A9vwHrC4nI2FEkhe1n0XYtXO5Q3RK950epguYBWRfOJH/dzu+TaQfyVsC
         bV5yoqLpZU4/2c58QgqtFye8Sz056wRWw57FQFbNUdGjJB+G0VbneL+kD/cQowPxjEDr
         npJkZUgu4SH5zZuq50ahf+U2IthOUYvs3ONE795bXUs8Bj6k9j8Dunhe2naEf/4ds9aq
         /4kA==
X-Gm-Message-State: AOJu0YxxwdVVj+doHyAo+EWhYXMoiNcTX+hKHKIFpwM6JwdSMNw2G/gl
	GGK1wllbBoOKI+1zoLeniDrsOg27o0rWMuxfyqQ1jO7i6J3itXjU607vOY6lOhYsBLEfOdGIVeZ
	3
X-Google-Smtp-Source: AGHT+IFPnPelOGlHkbSiWoLUTbbBX0ocH1aTm9zD7+Aeom2DD0tWujvgwCU1PAM7VBJ3aUgzB/qqxA==
X-Received: by 2002:a05:6402:1d48:b0:5b8:34a9:7fd9 with SMTP id 4fb4d7f45d1cf-5c21ed86b5amr661354a12.27.1724882644363;
        Wed, 28 Aug 2024 15:04:04 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v2 07/11] xen/bitops: Introduce generic_hweightl() and hweightl()
Date: Wed, 28 Aug 2024 23:03:47 +0100
Message-Id: <20240828220351.2686408-8-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

There are 6 remaining callers in Xen:

  * The two hweight32() calls, _domain_struct_bits() and efi_find_gop_mode(),
    are __init only.
  * The two hweight_long() calls are both in bitmap_weight().
  * The two hweight64() calls are hv_vpset_nr_banks() and x86_emulate().

Only bitmap_weight() and possibly hv_vpset_nr_banks() can be considered fast
paths, and they're all of GPR-width form.

Furthermore, the differences between a generic int and generic long form is
only an ADD and SHIFT, and only in !CONFIG_HAS_FAST_MULTIPLY builds.

Therefore, it is definitely not worth having both generic implemenations.

Implement generic_hweightl() based on the current generic_hweight64(),
adjusted to be compatible with ARM32, along with standard SELF_TESTS.

Implement hweightl() with usual constant-folding and arch opt-in support.  PPC
is the only architecture that devates from generic, and it simply uses the
builtin.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>

v2:
 * s/MASK/BCST/.  Extend testing
 * s/__pure/attr_const/.
---
 xen/arch/ppc/include/asm/bitops.h |  2 ++
 xen/common/bitops.c               | 14 +++++++++
 xen/include/xen/bitops.h          | 18 ++++++++++++
 xen/lib/Makefile                  |  1 +
 xen/lib/generic-hweightl.c        | 49 +++++++++++++++++++++++++++++++
 5 files changed, 84 insertions(+)
 create mode 100644 xen/lib/generic-hweightl.c

diff --git a/xen/arch/ppc/include/asm/bitops.h b/xen/arch/ppc/include/asm/bitops.h
index a62c4f99c3bb..64512e949530 100644
--- a/xen/arch/ppc/include/asm/bitops.h
+++ b/xen/arch/ppc/include/asm/bitops.h
@@ -124,6 +124,8 @@ static inline int test_and_set_bit(unsigned int nr, volatile void *addr)
 #define arch_fls(x)  ((x) ? 32 - __builtin_clz(x) : 0)
 #define arch_flsl(x) ((x) ? BITS_PER_LONG - __builtin_clzl(x) : 0)
 
+#define arch_hweightl(x) __builtin_popcountl(x)
+
 /**
  * hweightN - returns the hamming weight of a N-bit word
  * @x: the word to weigh
diff --git a/xen/common/bitops.c b/xen/common/bitops.c
index b504dd1308b8..5e5d20d225d7 100644
--- a/xen/common/bitops.c
+++ b/xen/common/bitops.c
@@ -133,6 +133,19 @@ static void __init test_multiple_bits_set(void)
     CHECK(multiple_bits_set, 0xc000000000000000ULL, true);
 }
 
+static void __init test_hweight(void)
+{
+    /* unsigned int hweightl(unsigned long) */
+    CHECK(hweightl, 0, 0);
+    CHECK(hweightl, 1, 1);
+    CHECK(hweightl, 3, 2);
+    CHECK(hweightl, 7, 3);
+    CHECK(hweightl, 0xff, 8);
+
+    CHECK(hweightl, 1 | (1UL << (BITS_PER_LONG - 1)), 2);
+    CHECK(hweightl, -1UL, BITS_PER_LONG);
+}
+
 static void __init __constructor test_bitops(void)
 {
     test_ffs();
@@ -140,4 +153,5 @@ static void __init __constructor test_bitops(void)
     test_for_each_set_bit();
 
     test_multiple_bits_set();
+    test_hweight();
 }
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 1c160b643ed6..96dfe0f2c71a 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -35,6 +35,12 @@ extern void __bitop_bad_size(void);
 unsigned int attr_const generic_ffsl(unsigned long x);
 unsigned int attr_const generic_flsl(unsigned long x);
 
+/*
+ * Hamming Weight, also called Population Count.  Returns the number of set
+ * bits in @x.
+ */
+unsigned int attr_const generic_hweightl(unsigned long x);
+
 /**
  * generic__test_and_set_bit - Set a bit and return its old value
  * @nr: Bit to set
@@ -308,6 +314,18 @@ static always_inline attr_const unsigned int fls64(uint64_t x)
         (_v & (_v - 1)) != 0;                   \
     })
 
+static always_inline attr_const unsigned int hweightl(unsigned long x)
+{
+    if ( __builtin_constant_p(x) )
+        return __builtin_popcountl(x);
+
+#ifdef arch_hweightl
+    return arch_hweightl(x);
+#else
+    return generic_hweightl(x);
+#endif
+}
+
 /* --------------------- Please tidy below here --------------------- */
 
 #ifndef find_next_bit
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index a48541596470..b6558e108bd9 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -6,6 +6,7 @@ lib-y += ctype.o
 lib-y += find-next-bit.o
 lib-y += generic-ffsl.o
 lib-y += generic-flsl.o
+lib-y += generic-hweightl.o
 lib-y += list-sort.o
 lib-y += memchr.o
 lib-y += memchr_inv.o
diff --git a/xen/lib/generic-hweightl.c b/xen/lib/generic-hweightl.c
new file mode 100644
index 000000000000..c242d4c2d9ab
--- /dev/null
+++ b/xen/lib/generic-hweightl.c
@@ -0,0 +1,49 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bitops.h>
+#include <xen/init.h>
+#include <xen/self-tests.h>
+
+/* Value @b broadcast to every byte in a long */
+#if BITS_PER_LONG == 32
+# define BCST(b) ((b) * 0x01010101UL)
+#elif BITS_PER_LONG == 64
+# define BCST(b) ((b) * 0x0101010101010101UL)
+#else
+# error Extend me please
+#endif
+
+unsigned int generic_hweightl(unsigned long x)
+{
+    x -= (x >> 1) & BCST(0x55);
+    x =  (x & BCST(0x33)) + ((x >> 2) & BCST(0x33));
+    x =  (x + (x >> 4)) & BCST(0x0f);
+
+    if ( IS_ENABLED(CONFIG_HAS_FAST_MULTIPLY) )
+        return (x * BCST(0x01)) >> (BITS_PER_LONG - 8);
+
+    x += x >> 8;
+    x += x >> 16;
+#if BITS_PER_LONG > 32
+    x += x >> 32;
+#endif
+
+    return x & 0xff;
+}
+
+#ifdef CONFIG_SELF_TESTS
+static void __init __constructor test_generic_hweightl(void)
+{
+    RUNTIME_CHECK(generic_hweightl, 0, 0);
+    RUNTIME_CHECK(generic_hweightl, 1, 1);
+    RUNTIME_CHECK(generic_hweightl, 3, 2);
+    RUNTIME_CHECK(generic_hweightl, 7, 3);
+    RUNTIME_CHECK(generic_hweightl, 0xff, 8);
+
+    RUNTIME_CHECK(generic_hweightl, BCST(0x55), BITS_PER_LONG / 2);
+    RUNTIME_CHECK(generic_hweightl, BCST(0xaa), BITS_PER_LONG / 2);
+
+    RUNTIME_CHECK(generic_hweightl, 1 | (1UL << (BITS_PER_LONG - 1)), 2);
+    RUNTIME_CHECK(generic_hweightl, -1UL, BITS_PER_LONG);
+}
+#endif /* CONFIG_SELF_TESTS */
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 22:04:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 22:04:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785171.1194641 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQlt-00087g-Dx; Wed, 28 Aug 2024 22:04:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785171.1194641; Wed, 28 Aug 2024 22:04:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQlt-00086B-5r; Wed, 28 Aug 2024 22:04:09 +0000
Received: by outflank-mailman (input) for mailman id 785171;
 Wed, 28 Aug 2024 22:04: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=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjQlr-0006E0-Oz
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 22:04:07 +0000
Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com
 [2a00:1450:4864:20::22c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 723a1c2b-6589-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 00:04:07 +0200 (CEST)
Received: by mail-lj1-x22c.google.com with SMTP id
 38308e7fff4ca-2f4f8742138so66205671fa.0
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 15:04:07 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1c2d2esm2695898a12.16.2024.08.28.15.04.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 15:04:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 723a1c2b-6589-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724882646; x=1725487446; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=3wEH6spuDcWI9g3H1/wKwZf6UslM/CRGIF6MqUG9Fo4=;
        b=SYh+VbLbtd+UcTE5IWCL1WUQ/K70VLsSZcyt75G1gXMwWAG9916peHIG8rr1KgmqM2
         rpm7FNtH3X5P/w3uJlp5RyUl+KvgPTE1G6OfLlqmAjIjm0JgV2S7RbVNwmyxhJu9RclS
         DkPiiiPNruOXnjluUbjL3da+NAqdCpIuTRe2A=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724882646; x=1725487446;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=3wEH6spuDcWI9g3H1/wKwZf6UslM/CRGIF6MqUG9Fo4=;
        b=XvI65YU1qZG3QHaF8z7dcqEJhu+ePEy4a0TJSoYZi0eamiTP3EpXEKknB5pOT1ql2b
         mZ3Td/cdD8z7RVynU6ZkS9D+GU2fC4aDDTaxtTncWFt56iDnKSqol9laBEhqWKvp0xQD
         vd1lG61N+D7xoBufahTObrx26JHi3D68KG8VqJSNmXidfc0yH9dDC3Puk7t566SQRYdo
         xSHDs9TQbUiWmtOTD7q2jc/+25pYEITkz9lHkyIrOs8LI1AuYCU6rxsW/7laxT/ca+UP
         3q738UjiI3j5u0c/1lDaYTsuk5gC6PoJ1C6qErgEiv47Usiq+N1u5C6oh/7tFuyyPr4M
         /ZZA==
X-Gm-Message-State: AOJu0YxoBP+I3BMYYsk2c6h1JLUO9v5oFwV0v9WZCTOLE30b2iyV4Fv5
	lnSiFkNW44atpEIzPnU0Yec0TTp2EzTGYwi6ksVtjVTDalAQfpRp5cMZ8EASTvYFf0b4E4CTmiD
	r
X-Google-Smtp-Source: AGHT+IE5UtUMGD1wRggXBe+xzppDvxCyJEivzUcLNMKfgMxac6dmJDS5xX3A4MiKzTBV/xGdZyLdlw==
X-Received: by 2002:a05:651c:19ac:b0:2ef:2247:987b with SMTP id 38308e7fff4ca-2f6108908d2mr6546591fa.32.1724882645193;
        Wed, 28 Aug 2024 15:04:05 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v2 08/11] xen/bitops: Drop hweight_long() and use hweightl()
Date: Wed, 28 Aug 2024 23:03:48 +0100
Message-Id: <20240828220351.2686408-9-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 xen/common/bitmap.c      | 4 ++--
 xen/include/xen/bitops.h | 5 -----
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/xen/common/bitmap.c b/xen/common/bitmap.c
index 9d9ff09f3dde..3da63a32a680 100644
--- a/xen/common/bitmap.c
+++ b/xen/common/bitmap.c
@@ -191,10 +191,10 @@ unsigned int __bitmap_weight(const unsigned long *bitmap, unsigned int bits)
 	unsigned int k, w = 0, lim = bits / BITS_PER_LONG;
 
 	for (k = 0; k < lim; k++)
-		w += hweight_long(bitmap[k]);
+		w += hweightl(bitmap[k]);
 
 	if (bits % BITS_PER_LONG)
-		w += hweight_long(bitmap[k] & BITMAP_LAST_WORD_MASK(bits));
+		w += hweightl(bitmap[k] & BITMAP_LAST_WORD_MASK(bits));
 
 	return w;
 }
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 96dfe0f2c71a..58c600155f7e 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -431,11 +431,6 @@ static inline unsigned int generic_hweight64(uint64_t w)
     return (w + (w >> 32)) & 0xFF;
 }
 
-static inline unsigned int hweight_long(unsigned long w)
-{
-    return sizeof(w) == 4 ? generic_hweight32(w) : generic_hweight64(w);
-}
-
 /*
  * rol32 - rotate a 32-bit value left
  *
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 22:04:12 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 22:04:12 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785172.1194656 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQlw-0000DV-Ml; Wed, 28 Aug 2024 22:04:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785172.1194656; Wed, 28 Aug 2024 22:04:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQlw-0000DJ-JQ; Wed, 28 Aug 2024 22:04:12 +0000
Received: by outflank-mailman (input) for mailman id 785172;
 Wed, 28 Aug 2024 22:04:10 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjQlu-0006E8-U2
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 22:04:10 +0000
Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com
 [2a00:1450:4864:20::52a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 735b5ad8-6589-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 00:04:09 +0200 (CEST)
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-5a108354819so9317577a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 15:04:09 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1c2d2esm2695898a12.16.2024.08.28.15.04.05
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 15:04:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 735b5ad8-6589-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724882648; x=1725487448; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=+a9rZjwjT4T/KMzHim0E6pRI1Xb37U68VQt9wRm391Y=;
        b=b/lenRI932SyEytxCAFEiO/qsUMJQcj46yK/2EQwJV5yqOiR4EfYhmBFIUvNGcNERG
         uJ1yO725B4mqWpd2WorZFUuLsOjeCfPq0bBp/mPW7olusr7UpKTfgIf9dDVjUByXqDx7
         Ba61YuBnA8xLFcCSQT+7LZHwjVPopcpjTBd/8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724882648; x=1725487448;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=+a9rZjwjT4T/KMzHim0E6pRI1Xb37U68VQt9wRm391Y=;
        b=YKHg9Aain2ThG+UogaAxRg+bjMXfbWFsu2HDKDRvJplSmD7OqR5yfrLS59SeVhnbIc
         iwu36hPf9h1yifargx9fmWpQpdB3mmOuDnx5MbKcD/XiE1UhC1gCOCIX12d31H97AS/5
         JtCeAG+bryp6aTIPqYMIf3EtT6K1GPEO20RPY2cAr2PxlMB5vuF5f+U5jn6j29RYhUnn
         i3DBJay4rI5/B6Y2B5mJ6AUQsez9y2vvBHJl+9fMwf74CEkzexf1pbGW2Fx+U18ibXJD
         vEnac9DNCxBY3z4XM8MKXRiu3Gy89JF5oFJV6M8FdE6lBqJVUW29tH4/0zORbiysg2S4
         27Pg==
X-Gm-Message-State: AOJu0YzXKkhqB9ejgcm1yKZHKeniB9pHZu+VgO/2vpvRJjKC8/xBfotM
	zOVHzGf1K53hnUYhxOKhPnd3YaRw5u4VZqaSzk6+6yeS09/ygecOCRb2hArcL9QwbI9KH6EB0I/
	e
X-Google-Smtp-Source: AGHT+IE3qOrSiwEVqCW9Hnp03aRaF70/QvtqPk4oYtkklqTrDEe2lMIHKCK2PJjCz4Asj6oY3RjTrQ==
X-Received: by 2002:a05:6402:40c1:b0:5c2:17b7:5a7e with SMTP id 4fb4d7f45d1cf-5c21ed9fcbcmr609830a12.36.1724882647591;
        Wed, 28 Aug 2024 15:04:07 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v2 09/11] xen/bitops: Implement hweight32() in terms of hweightl()
Date: Wed, 28 Aug 2024 23:03:49 +0100
Message-Id: <20240828220351.2686408-10-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

... and drop generic_hweight32().

As noted previously, the only two users of hweight32() are in __init paths.

The int-optimised form of generic_hweight() is only two instructions shorter
than the long-optimised form, and even then only on architectures which lack
fast multiplication, so there's no point providing an int-optimised form.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>

v2:
 * Reorder with respect to the hweight64() patch
 * Rerwrite the commit message
 * s/__pure/attr_const/
---
 xen/arch/arm/include/asm/bitops.h | 1 -
 xen/arch/ppc/include/asm/bitops.h | 1 -
 xen/arch/x86/include/asm/bitops.h | 1 -
 xen/include/xen/bitops.h          | 5 +++++
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/include/asm/bitops.h b/xen/arch/arm/include/asm/bitops.h
index 91cd167b6bbb..b28c25b3d52d 100644
--- a/xen/arch/arm/include/asm/bitops.h
+++ b/xen/arch/arm/include/asm/bitops.h
@@ -85,7 +85,6 @@ bool clear_mask16_timeout(uint16_t mask, volatile void *p,
  * The Hamming Weight of a number is the total number of bits set in it.
  */
 #define hweight64(x) generic_hweight64(x)
-#define hweight32(x) generic_hweight32(x)
 
 #endif /* _ARM_BITOPS_H */
 /*
diff --git a/xen/arch/ppc/include/asm/bitops.h b/xen/arch/ppc/include/asm/bitops.h
index 64512e949530..f488a7c03425 100644
--- a/xen/arch/ppc/include/asm/bitops.h
+++ b/xen/arch/ppc/include/asm/bitops.h
@@ -133,6 +133,5 @@ static inline int test_and_set_bit(unsigned int nr, volatile void *addr)
  * The Hamming Weight of a number is the total number of bits set in it.
  */
 #define hweight64(x) __builtin_popcountll(x)
-#define hweight32(x) __builtin_popcount(x)
 
 #endif /* _ASM_PPC_BITOPS_H */
diff --git a/xen/arch/x86/include/asm/bitops.h b/xen/arch/x86/include/asm/bitops.h
index 4c5b21907a64..507b043b8a86 100644
--- a/xen/arch/x86/include/asm/bitops.h
+++ b/xen/arch/x86/include/asm/bitops.h
@@ -482,6 +482,5 @@ static always_inline unsigned int arch_flsl(unsigned long x)
  * The Hamming Weight of a number is the total number of bits set in it.
  */
 #define hweight64(x) generic_hweight64(x)
-#define hweight32(x) generic_hweight32(x)
 
 #endif /* _X86_BITOPS_H */
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index 58c600155f7e..a462c3065158 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -326,6 +326,11 @@ static always_inline attr_const unsigned int hweightl(unsigned long x)
 #endif
 }
 
+static always_inline attr_const unsigned int hweight32(uint32_t x)
+{
+    return hweightl(x);
+}
+
 /* --------------------- Please tidy below here --------------------- */
 
 #ifndef find_next_bit
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 22:04:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 22:04:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785173.1194666 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQlz-0000bD-0V; Wed, 28 Aug 2024 22:04:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785173.1194666; Wed, 28 Aug 2024 22:04:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQly-0000b1-Sn; Wed, 28 Aug 2024 22:04:14 +0000
Received: by outflank-mailman (input) for mailman id 785173;
 Wed, 28 Aug 2024 22:04:13 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjQlw-0006E8-Sa
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 22:04:12 +0000
Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com
 [2a00:1450:4864:20::333])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7474ae6a-6589-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 00:04:11 +0200 (CEST)
Received: by mail-wm1-x333.google.com with SMTP id
 5b1f17b1804b1-4280ca0791bso65455495e9.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 15:04:11 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1c2d2esm2695898a12.16.2024.08.28.15.04.07
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 15:04:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7474ae6a-6589-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724882650; x=1725487450; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=RsrqcBVubseMkc2czg+d/Lcx765jVnGIyUSplcSJKR4=;
        b=D3CKCn9t1BNiwkxkuLB+WwvPpw6Z8+6Lv73F3ZbjFcxLTqE7sJsLZXmbf3DoYTqCBv
         pFBV+/xjXWrPpVPbltFHpDpiM4efF25Ja+hA5Tqd6c5Tcm+Zuvdb7jNGHv0FQZIo9zLW
         5jOY3XwvAu/sqs3HIbRyRL+0/AiSociLXnE2A=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724882650; x=1725487450;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=RsrqcBVubseMkc2czg+d/Lcx765jVnGIyUSplcSJKR4=;
        b=RZfJnFEddSefUo7KtSwOQHkhZ2FeqKTsr8trj2g5EuLa0pLTm4iksrfKcgcopDQbhV
         l44moESqNRBBIeXsrCeYQuGyXEcgy5KPa6Dfpfd6zwWYKZO9qKrYi1wjhypqIAy7cTmy
         8FMR8cTC0CdJBZVZZzcIkNZhLUtUQ4TKn4tn0HFt/AKEAqJCC83R299kISL37nSo8pZ2
         zWPUXTkinkt7XtMpyYH2sTWQNNy9clqqHKU4o91HICDEc2YmTkS3logEQ5vHyyiaPHtW
         Hfs0+EWoca+FgayY/UR5gTiZMMzZUGI8pT1MU979+ZcVVM7D3sd3+H2XjsUtRax6Vg5N
         2Tcg==
X-Gm-Message-State: AOJu0YwioL/bi11+y0f3b4GyZui6fhckNTdZ8iy8WOQ+8qQHMKudbx2X
	/GxQonCu7IOvsLcd6aaNWtinV1Ccmlvfi3m3JmKWY1fB490EoqfaXIvataDmcAi1ZExW0OQmzih
	K
X-Google-Smtp-Source: AGHT+IH9thU/Kzrpd446ZuHrwCQxl0T9VP7RRAW0814zcCW2MU0Qfv9Jbyb29dJP8AwWWDR2moSOtQ==
X-Received: by 2002:a05:6000:b89:b0:371:846d:12b3 with SMTP id ffacd0b85a97d-3749b54d1abmr469774f8f.28.1724882649798;
        Wed, 28 Aug 2024 15:04:09 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Michal Orzel <michal.orzel@amd.com>,
	Oleksii Kurochko <oleksii.kurochko@gmail.com>,
	Shawn Anastasio <sanastasio@raptorengineering.com>
Subject: [PATCH v2 10/11] xen/bitops: Implement hweight64() in terms of hweight{l,32}()
Date: Wed, 28 Aug 2024 23:03:50 +0100
Message-Id: <20240828220351.2686408-11-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

... and drop generic_hweight{32,64}().

This is identical on all architectures except ARM32.  Add one extra SELF_TEST
to check that hweight64() works when the input is split in half.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
CC: Shawn Anastasio <sanastasio@raptorengineering.com>

v2:
 * Reorder with respect to the hweight32() patch
 * s/__pure/attr_const/
---
 xen/arch/arm/include/asm/bitops.h |  8 ------
 xen/arch/ppc/include/asm/bitops.h |  8 ------
 xen/arch/x86/include/asm/bitops.h |  8 ------
 xen/common/bitops.c               |  3 +++
 xen/include/xen/bitops.h          | 45 ++++++-------------------------
 5 files changed, 11 insertions(+), 61 deletions(-)

diff --git a/xen/arch/arm/include/asm/bitops.h b/xen/arch/arm/include/asm/bitops.h
index b28c25b3d52d..f163d9bb4578 100644
--- a/xen/arch/arm/include/asm/bitops.h
+++ b/xen/arch/arm/include/asm/bitops.h
@@ -78,14 +78,6 @@ bool clear_mask16_timeout(uint16_t mask, volatile void *p,
 #define arch_fls(x)  ((x) ? 32 - __builtin_clz(x) : 0)
 #define arch_flsl(x) ((x) ? BITS_PER_LONG - __builtin_clzl(x) : 0)
 
-/**
- * hweightN - returns the hamming weight of a N-bit word
- * @x: the word to weigh
- *
- * The Hamming Weight of a number is the total number of bits set in it.
- */
-#define hweight64(x) generic_hweight64(x)
-
 #endif /* _ARM_BITOPS_H */
 /*
  * Local variables:
diff --git a/xen/arch/ppc/include/asm/bitops.h b/xen/arch/ppc/include/asm/bitops.h
index f488a7c03425..c942e9432e20 100644
--- a/xen/arch/ppc/include/asm/bitops.h
+++ b/xen/arch/ppc/include/asm/bitops.h
@@ -126,12 +126,4 @@ static inline int test_and_set_bit(unsigned int nr, volatile void *addr)
 
 #define arch_hweightl(x) __builtin_popcountl(x)
 
-/**
- * hweightN - returns the hamming weight of a N-bit word
- * @x: the word to weigh
- *
- * The Hamming Weight of a number is the total number of bits set in it.
- */
-#define hweight64(x) __builtin_popcountll(x)
-
 #endif /* _ASM_PPC_BITOPS_H */
diff --git a/xen/arch/x86/include/asm/bitops.h b/xen/arch/x86/include/asm/bitops.h
index 507b043b8a86..642d8e58b288 100644
--- a/xen/arch/x86/include/asm/bitops.h
+++ b/xen/arch/x86/include/asm/bitops.h
@@ -475,12 +475,4 @@ static always_inline unsigned int arch_flsl(unsigned long x)
 }
 #define arch_flsl arch_flsl
 
-/**
- * hweightN - returns the hamming weight of a N-bit word
- * @x: the word to weigh
- *
- * The Hamming Weight of a number is the total number of bits set in it.
- */
-#define hweight64(x) generic_hweight64(x)
-
 #endif /* _X86_BITOPS_H */
diff --git a/xen/common/bitops.c b/xen/common/bitops.c
index 5e5d20d225d7..91ae961440af 100644
--- a/xen/common/bitops.c
+++ b/xen/common/bitops.c
@@ -144,6 +144,9 @@ static void __init test_hweight(void)
 
     CHECK(hweightl, 1 | (1UL << (BITS_PER_LONG - 1)), 2);
     CHECK(hweightl, -1UL, BITS_PER_LONG);
+
+    /* unsigned int hweight64(uint64_t) */
+    CHECK(hweight64, -1ULL, 64);
 }
 
 static void __init __constructor test_bitops(void)
diff --git a/xen/include/xen/bitops.h b/xen/include/xen/bitops.h
index a462c3065158..c4cb432eed23 100644
--- a/xen/include/xen/bitops.h
+++ b/xen/include/xen/bitops.h
@@ -331,6 +331,14 @@ static always_inline attr_const unsigned int hweight32(uint32_t x)
     return hweightl(x);
 }
 
+static always_inline attr_const unsigned int hweight64(uint64_t x)
+{
+    if ( BITS_PER_LONG == 64 )
+        return hweightl(x);
+    else
+        return hweight32(x >> 32) + hweight32(x);
+}
+
 /* --------------------- Please tidy below here --------------------- */
 
 #ifndef find_next_bit
@@ -399,43 +407,6 @@ static inline int get_count_order(unsigned int count)
     return order;
 }
 
-/*
- * hweightN: returns the hamming weight (i.e. the number
- * of bits set) of a N-bit word
- */
-
-static inline unsigned int generic_hweight32(unsigned int w)
-{
-    w -= (w >> 1) & 0x55555555;
-    w =  (w & 0x33333333) + ((w >> 2) & 0x33333333);
-    w =  (w + (w >> 4)) & 0x0f0f0f0f;
-
-    if ( IS_ENABLED(CONFIG_HAS_FAST_MULTIPLY) )
-        return (w * 0x01010101) >> 24;
-
-    w += w >> 8;
-
-    return (w + (w >> 16)) & 0xff;
-}
-
-static inline unsigned int generic_hweight64(uint64_t w)
-{
-    if ( BITS_PER_LONG < 64 )
-        return generic_hweight32(w >> 32) + generic_hweight32(w);
-
-    w -= (w >> 1) & 0x5555555555555555UL;
-    w =  (w & 0x3333333333333333UL) + ((w >> 2) & 0x3333333333333333UL);
-    w =  (w + (w >> 4)) & 0x0f0f0f0f0f0f0f0fUL;
-
-    if ( IS_ENABLED(CONFIG_HAS_FAST_MULTIPLY) )
-        return (w * 0x0101010101010101UL) >> 56;
-
-    w += w >> 8;
-    w += w >> 16;
-
-    return (w + (w >> 32)) & 0xFF;
-}
-
 /*
  * rol32 - rotate a 32-bit value left
  *
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 22:04:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 22:04:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785174.1194671 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQlz-0000f2-Hj; Wed, 28 Aug 2024 22:04:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785174.1194671; Wed, 28 Aug 2024 22:04:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjQlz-0000dx-9d; Wed, 28 Aug 2024 22:04:15 +0000
Received: by outflank-mailman (input) for mailman id 785174;
 Wed, 28 Aug 2024 22:04:13 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=mQTD=P3=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjQlw-0006E0-Ub
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 22:04:12 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7505a605-6589-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 00:04:12 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-5c210e23573so1833151a12.0
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 15:04:12 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c0bb1c2d2esm2695898a12.16.2024.08.28.15.04.09
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Aug 2024 15:04:10 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7505a605-6589-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724882651; x=1725487451; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Sb7srVii8m7D5bOp7Td/YLt3PcEfAn83ipVBC8MF2p4=;
        b=CHV7GAiOq4okjKbi0Rb2cYBHQMAiXHFQzvejNaWJrcZ2pwRnodad6wjrwPTaVxOeui
         GqTpyUeVKoPjQ4LYDZp8l6Fejdg0NceeWEowYdTbAZ5X0JFV+xW7IbZ8yB2imj9vtK2T
         wT4wY+Fw0IhkMqriJSbT+COm/GmYM4+ymyW7k=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724882651; x=1725487451;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Sb7srVii8m7D5bOp7Td/YLt3PcEfAn83ipVBC8MF2p4=;
        b=ACu1DtvWIdsVUd28HBx3S/HL8FOLk7ETO54iqr7twuirZh1wmcimFTkox9gRy9YLea
         CTk3BN7l1B4PcvFNmfagmY3TlVDArqCOFKVdFccUV74vzic5Qnw5cWeGI47ktym8oZhE
         MGuH43f05YWxOhyEiVa7mSS2vcTN0V4BEyucfD+YawMYZaJkb/4hzv36+Lw/yMTEmTq9
         WMRQdNU95O9+2APAMRb00qfYOz9LrtgEPFrfcqcDtVLN9Yj0SAmedEV7kmHmWUBP+UMX
         C/VT5oLagu+Wvs+iKW8SPTh4XTShA+pZdtzS8emMpMnZXA7JBaBc4PAIoGJYZQ3MVe1O
         fLbg==
X-Gm-Message-State: AOJu0YxbwWqF+aMTFhyZrruV/uiQ/a++sHmpkCNnxFUUfn/au9LHP2xl
	HYIGe0fluUVHdgzt1RlxOG1r9oWygZttoqjGIgUNU9m5K+w6nEIWnQnvDb+IfkblsdY77lEvNgZ
	O
X-Google-Smtp-Source: AGHT+IGKW3SvmGx+8Qmh8o8prGpaIiHhPr6Oq+77bbpVyS4CCBGopTL/2h4wnYqadHJpcMBYRKfyqw==
X-Received: by 2002:a05:6402:2554:b0:5be:ef1f:c679 with SMTP id 4fb4d7f45d1cf-5c21ed8e6c7mr686193a12.23.1724882650506;
        Wed, 28 Aug 2024 15:04:10 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v2 11/11] x86/bitops: Use the POPCNT instruction when available
Date: Wed, 28 Aug 2024 23:03:51 +0100
Message-Id: <20240828220351.2686408-12-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It has existed in x86 CPUs since 2008, so we're only 16 years late adding
support.  With all the other scafolding in place, implement arch_hweightl()
for x86.

The only complication is that the call to arch_generic_hweightl() is behind
the compilers back.  Address this by writing it in ASM and ensure that it
preserves all registers.

Copy the code generation from generic_hweightl().  It's not a complicated
algorithm, and is easy to regenerate if needs be, but cover it with the same
unit tests as test_generic_hweightl() just for piece of mind.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>

v2:
 * Fix MISRA 8.2 (parameter name) and 8.5 (single declaration) regressions.
 * Rename {arch->x86}-generic-hweightl.{S->c}
 * Adjust ASM formating

The __constructor trick to cause any reference to $foo() to pull in
test_$foo() only works when both are in the same TU.  i.e. what I did in
v1 (putting test_arch_generic_hweightl() in the regular generic-hweightl.c)
didn't work.

This in turn means that arch_generic_hweightl() needs writing in a global asm
block, and also that we can't use FUNC()/END().  While we could adjust it to
work for GCC/binutils, we can't have CPP macros in Clang-IAS strings.

I don't particularly like opencoding FUNC()/END(), but I can't think of
anything better.
---
 xen/arch/x86/include/asm/bitops.h | 23 +++++++++++
 xen/lib/Makefile                  |  1 +
 xen/lib/x86-generic-hweightl.c    | 69 +++++++++++++++++++++++++++++++
 3 files changed, 93 insertions(+)
 create mode 100644 xen/lib/x86-generic-hweightl.c

diff --git a/xen/arch/x86/include/asm/bitops.h b/xen/arch/x86/include/asm/bitops.h
index 642d8e58b288..39e37f1cbe55 100644
--- a/xen/arch/x86/include/asm/bitops.h
+++ b/xen/arch/x86/include/asm/bitops.h
@@ -6,6 +6,7 @@
  */
 
 #include <asm/alternative.h>
+#include <asm/asm_defns.h>
 #include <asm/cpufeatureset.h>
 
 /*
@@ -475,4 +476,26 @@ static always_inline unsigned int arch_flsl(unsigned long x)
 }
 #define arch_flsl arch_flsl
 
+unsigned int arch_generic_hweightl(unsigned long x);
+
+static always_inline unsigned int arch_hweightl(unsigned long x)
+{
+    unsigned int r;
+
+    /*
+     * arch_generic_hweightl() is written in ASM in order to preserve all
+     * registers, as the compiler can't see the call.
+     *
+     * This limits the POPCNT instruction to using the same ABI as a function
+     * call (input in %rdi, output in %eax) but that's fine.
+     */
+    alternative_io("call arch_generic_hweightl",
+                   "popcnt %[val], %q[res]", X86_FEATURE_POPCNT,
+                   ASM_OUTPUT2([res] "=a" (r) ASM_CALL_CONSTRAINT),
+                   [val] "D" (x));
+
+    return r;
+}
+#define arch_hweightl arch_hweightl
+
 #endif /* _X86_BITOPS_H */
diff --git a/xen/lib/Makefile b/xen/lib/Makefile
index b6558e108bd9..54440f628aae 100644
--- a/xen/lib/Makefile
+++ b/xen/lib/Makefile
@@ -36,6 +36,7 @@ lib-y += strtol.o
 lib-y += strtoll.o
 lib-y += strtoul.o
 lib-y += strtoull.o
+lib-$(CONFIG_X86) += x86-generic-hweightl.o
 lib-$(CONFIG_X86) += xxhash32.o
 lib-$(CONFIG_X86) += xxhash64.o
 
diff --git a/xen/lib/x86-generic-hweightl.c b/xen/lib/x86-generic-hweightl.c
new file mode 100644
index 000000000000..e0be25a01c1d
--- /dev/null
+++ b/xen/lib/x86-generic-hweightl.c
@@ -0,0 +1,69 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <xen/bitops.h>
+#include <xen/init.h>
+#include <xen/self-tests.h>
+
+/*
+ * An implementation of generic_hweightl() used on hardware without the POPCNT
+ * instruction.
+ *
+ * This function is called from within an ALTERNATIVE in arch_hweightl().
+ * i.e. behind the back of the compiler.  Therefore all registers are callee
+ * preserved.
+ *
+ * The ASM is what GCC-12 emits for generic_hweightl() in a release build of
+ * Xen, with spilling of %rdi/%rdx to preserve the callers registers.
+ *
+ * Note: When we can use __attribute__((no_caller_saved_registers))
+ *       unconditionally (GCC 7, Clang 5), we can implement this in plain C.
+ */
+asm (
+    ".type arch_generic_hweightl, STT_FUNC\n\t"
+    ".globl arch_generic_hweightl\n\t"
+    ".hidden arch_generic_hweightl\n\t"
+    ".balign " STR(CONFIG_FUNCTION_ALIGNMENT) ", 0x90\n\t"
+    "arch_generic_hweightl:\n\t"
+
+    "push   %rdi\n\t"
+    "push   %rdx\n\t"
+
+    "movabs $0x5555555555555555, %rdx\n\t"
+    "mov    %rdi, %rax\n\t"
+    "shr    $1, %rax\n\t"
+    "and    %rdx, %rax\n\t"
+    "sub    %rax, %rdi\n\t"
+    "movabs $0x3333333333333333, %rax\n\t"
+    "mov    %rdi, %rdx\n\t"
+    "shr    $2, %rdi\n\t"
+    "and    %rax, %rdx\n\t"
+    "and    %rax, %rdi\n\t"
+    "add    %rdi, %rdx\n\t"
+    "mov    %rdx, %rax\n\t"
+    "shr    $4, %rax\n\t"
+    "add    %rdx, %rax\n\t"
+    "movabs $0x0f0f0f0f0f0f0f0f, %rdx\n\t"
+    "and    %rdx, %rax\n\t"
+    "movabs $0x0101010101010101, %rdx\n\t"
+    "imul   %rdx, %rax\n\t"
+    "shr    $" STR(BITS_PER_LONG) "- 8, %rax\n\t"
+
+    "pop    %rdx\n\t"
+    "pop    %rdi\n\t"
+
+    "ret\n\t"
+
+    ".size arch_generic_hweightl, . - arch_generic_hweightl\n\t"
+);
+
+static void __init __constructor test_arch_generic_hweightl(void)
+{
+    RUNTIME_CHECK(arch_generic_hweightl, 0, 0);
+    RUNTIME_CHECK(arch_generic_hweightl, 1, 1);
+    RUNTIME_CHECK(arch_generic_hweightl, 3, 2);
+    RUNTIME_CHECK(arch_generic_hweightl, 7, 3);
+    RUNTIME_CHECK(arch_generic_hweightl, 0xff, 8);
+
+    RUNTIME_CHECK(arch_generic_hweightl, 1 | (1UL << (BITS_PER_LONG - 1)), 2);
+    RUNTIME_CHECK(arch_generic_hweightl, -1UL, BITS_PER_LONG);
+}
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 23:02:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 23:02:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785263.1194686 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjRfc-00083a-QA; Wed, 28 Aug 2024 23:01:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785263.1194686; Wed, 28 Aug 2024 23:01:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjRfc-00083T-Ms; Wed, 28 Aug 2024 23:01:44 +0000
Received: by outflank-mailman (input) for mailman id 785263;
 Wed, 28 Aug 2024 23:01:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjRfa-00083J-So; Wed, 28 Aug 2024 23:01:42 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjRfa-0004gU-Kw; Wed, 28 Aug 2024 23:01:42 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjRfa-0007Jc-4h; Wed, 28 Aug 2024 23:01:42 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjRfa-0000NY-4G; Wed, 28 Aug 2024 23:01:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=KE7G5AuwRpMNZUBJgJzOa6pO4iaeBMH+OwkuwVH5qGk=; b=RuXN3P3Z+8CN4QmccrQnlZj8uI
	gxSXTcIo/rNVgMcbnk512ECiweilFOoGiGnrUUtWiv2MHJu3uAbEWIb7mc0uwb9ynqGoXdPckcaML
	QZivzP6Fd+uKJ+wWHlWDoupy/qS7Ksk5CCbvmRLz68SsVJytSdFajlNaKT3KiG2v3X1Y=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187386-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187386: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=fb1658221a31ec1db33253a80001191391e73b17
X-Osstest-Versions-That:
    xen=75c64db3722f0245137a1e8cfd3435f4790d0fd7
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 23:01:42 +0000

flight 187386 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187386/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  fb1658221a31ec1db33253a80001191391e73b17
baseline version:
 xen                  75c64db3722f0245137a1e8cfd3435f4790d0fd7

Last test of basis   187379  2024-08-28 10:02:12 Z    0 days
Testing same since   187386  2024-08-28 19:00:23 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Roger Pau Monne <roger.pau@citrix.com>
  Roger Pau Monné <roger.pau@citrix.com>
  Tamas K Lengyel <tamas@tklengyel.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   75c64db372..fb1658221a  fb1658221a31ec1db33253a80001191391e73b17 -> smoke


From xen-devel-bounces@lists.xenproject.org Wed Aug 28 23:15:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 23:15:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785271.1194696 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjRsT-0001wR-Tw; Wed, 28 Aug 2024 23:15:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785271.1194696; Wed, 28 Aug 2024 23:15:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjRsT-0001wK-Qs; Wed, 28 Aug 2024 23:15:01 +0000
Received: by outflank-mailman (input) for mailman id 785271;
 Wed, 28 Aug 2024 23:14:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjRsR-0001wA-PX; Wed, 28 Aug 2024 23:14:59 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjRsR-0004uX-Gr; Wed, 28 Aug 2024 23:14:59 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjRsR-0007wj-6H; Wed, 28 Aug 2024 23:14:59 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjRsR-0006RS-5i; Wed, 28 Aug 2024 23:14:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=1xq/cdaCObpIh7cz4t6YRAfbj1mXQQoWnPk5UWg7xDo=; b=V2nPHxrBaUTOpRnKdAJ5I8gnw1
	SWpnSh0zX2c+Q1sCef0aFUjewnK+Kx1mlUQY3FAXOIq2QalvOn1CY51BTHMa4Hz9xQRvKH768rYxv
	gAWmDG1nCMsKkgQjUT8N/6WJgLUw6rRPRldqsmEgBSO7P0dCTU27axG1Q0AMQV0aoj9c=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187377-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187377: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    xen-unstable:test-amd64-amd64-qemuu-freebsd12-amd64:guest-localmigrate/x10:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=9429f1a6c4758ae91f3ae721a036f4bbf76fb2b8
X-Osstest-Versions-That:
    xen=9429f1a6c4758ae91f3ae721a036f4bbf76fb2b8
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 23:14:59 +0000

flight 187377 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187377/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail in 187368 pass in 187377
 test-amd64-amd64-qemuu-freebsd12-amd64 19 guest-localmigrate/x10 fail pass in 187368

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187368
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187368
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187368
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187368
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187368
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187368
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  9429f1a6c4758ae91f3ae721a036f4bbf76fb2b8
baseline version:
 xen                  9429f1a6c4758ae91f3ae721a036f4bbf76fb2b8

Last test of basis   187377  2024-08-28 06:43:37 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       fail    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 23:27:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 23:27:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785281.1194705 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjS4c-0004qU-W2; Wed, 28 Aug 2024 23:27:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785281.1194705; Wed, 28 Aug 2024 23:27:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjS4c-0004qN-TD; Wed, 28 Aug 2024 23:27:34 +0000
Received: by outflank-mailman (input) for mailman id 785281;
 Wed, 28 Aug 2024 23:27:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=P1ns=P3=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sjS4b-0004qH-CD
 for xen-devel@lists.xenproject.org; Wed, 28 Aug 2024 23:27:33 +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 1828537d-6595-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 01:27:32 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id D46DDCE19B3;
 Wed, 28 Aug 2024 23:27:25 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D328C4CEC0;
 Wed, 28 Aug 2024 23:27:23 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1828537d-6595-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724887645;
	bh=zNd+s1fuNWyF8PWk4IUpXo2o+9xqOA95kSrWOlAQIHo=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=nPm0Hv2OmPuRgFnJadIvtQwCU182d38qvAQX3uym/EAyVbbv88CQAnCVbF6wTYBle
	 MrALyoWkDvYcfGG+wqy5zAvPb7SJtkVtv1I3RiP/r/a6phNdegrUaKBM+eMS0Acv5d
	 a7cjFZcM0ThDQ3geZfPKvvQsf4TAFWJH6d6jeqzihWFF4KSmOSbGSsqllroYcxzZcy
	 WhRV5ypjaI5DPnG7WqaKII6YweudU3HyJzVQRNQRlUi1m0je6s/j532ezVI+Ik45/s
	 wcYoCtO6Av/gLrV6+SZrEaLOk1t4vKJD6d1OoZeUMUoP137WXjtOCi+31syPVUZBSV
	 W6fNLQLA5SOOA==
Date: Wed, 28 Aug 2024 16:27:22 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
cc: xen-devel@lists.xenproject.org, Xenia Ragiadakou <burzalodowa@gmail.com>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Bertrand Marquis <bertrand.marquis@arm.com>, 
    Michal Orzel <michal.orzel@amd.com>, 
    Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>, 
    Xenia Ragiadakou <xenia.ragiadakou@amd.com>, Julien Grall <julien@xen.org>
Subject: Re: [XEN PATCH v7 1/2] ioreq: do not build arch_vcpu_ioreq_completion()
 for non-VMX configurations
In-Reply-To: <2e71667a06ece7f0d045c309d69bb73b99d6caa5.1724842645.git.Sergiy_Kibrik@epam.com>
Message-ID: <alpine.DEB.2.22.394.2408281627030.53815@ubuntu-linux-20-04-desktop>
References: <cover.1724842645.git.Sergiy_Kibrik@epam.com> <2e71667a06ece7f0d045c309d69bb73b99d6caa5.1724842645.git.Sergiy_Kibrik@epam.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 28 Aug 2024, Sergiy Kibrik wrote:
> From: Xenia Ragiadakou <burzalodowa@gmail.com>
> 
> VIO_realmode_completion is specific to vmx realmode and thus the function
> arch_vcpu_ioreq_completion() has actual handling work only in VMX-enabled build,
> as for the rest x86 and ARM build configurations it is basically a stub.
> 
> Here a separate configuration option ARCH_VCPU_IOREQ_COMPLETION introduced that
> tells whether the platform we're building for requires any specific ioreq
> completion handling. As of now only VMX has such requirement, so the option is
> selected by INTEL_VMX, for other configurations a generic default stub is
> provided (it is ARM's version of arch_vcpu_ioreq_completion() moved to common
> header).
> 
> Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
> Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
> Acked-by: Jan Beulich <jbeulich@suse.com>
> CC: Julien Grall <julien@xen.org>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>



From xen-devel-bounces@lists.xenproject.org Wed Aug 28 23:53:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Aug 2024 23:53:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785293.1194716 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjSTF-00015j-Tq; Wed, 28 Aug 2024 23:53:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785293.1194716; Wed, 28 Aug 2024 23:53:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjSTF-00015c-Qg; Wed, 28 Aug 2024 23:53:01 +0000
Received: by outflank-mailman (input) for mailman id 785293;
 Wed, 28 Aug 2024 23:53:00 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjSTE-00015S-LC; Wed, 28 Aug 2024 23:53:00 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjSTE-0005Zn-Fl; Wed, 28 Aug 2024 23:53:00 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjSTE-0000ts-7r; Wed, 28 Aug 2024 23:53:00 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjSTE-0005l9-7G; Wed, 28 Aug 2024 23:53:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=qUihrtU5rb09XYnO7Oa2HTNGD1mICpI4MITuacq0zOI=; b=qx81IuHDsrZZcdMLCFrd6wIWqL
	aWgM0AtzH/ERYIdbFcQX3QWQYldaCH6+Ztq+5T17N5jUxqCW0AM+MoKkH5Fk9c06O9HCQPQjXXZJM
	jB4Km0ATTQhy1dVJOm5UG5nA3hjn7Wa7qO7lh+4pVCjDfqUYrepcCESKPDfaWajqqQfA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187389-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187389: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=7cde720e5126a47dadfb63ec9fd11b637620102d
X-Osstest-Versions-That:
    ovmf=319835abb8517fde84bff31740fb1e61b33a3ae8
From: osstest service owner <osstest-admin@xenproject.org>
Date: Wed, 28 Aug 2024 23:53:00 +0000

flight 187389 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187389/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 7cde720e5126a47dadfb63ec9fd11b637620102d
baseline version:
 ovmf                 319835abb8517fde84bff31740fb1e61b33a3ae8

Last test of basis   187387  2024-08-28 19:11:27 Z    0 days
Testing same since   187389  2024-08-28 21:41:28 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  HoraceX Lien <horacex.lien@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   319835abb8..7cde720e51  7cde720e5126a47dadfb63ec9fd11b637620102d -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 00:07:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 00:07:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785303.1194726 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjSgp-0004Um-IX; Thu, 29 Aug 2024 00:07:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785303.1194726; Thu, 29 Aug 2024 00:07:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjSgp-0004Uf-Es; Thu, 29 Aug 2024 00:07:03 +0000
Received: by outflank-mailman (input) for mailman id 785303;
 Thu, 29 Aug 2024 00:07:02 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=kKLr=P4=kernel.org=kuba@srs-se1.protection.inumbo.net>)
 id 1sjSgo-0004UZ-9C
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 00:07:02 +0000
Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9cb47982-659a-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 02:07:00 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by ams.source.kernel.org (Postfix) with ESMTP id 1BB33AE40C3;
 Thu, 29 Aug 2024 00:06:54 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9796EC4CEC0;
 Thu, 29 Aug 2024 00:06:58 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9cb47982-659a-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724890019;
	bh=0KBomtwl5htJf2KliDq8qRkg58AM7cR5JxLbBwVmD/M=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
	b=LmZLwx+POZ+ZZEuXHKVyWVVwSDgrJjSJCUR3aUrxypd4Z4wK+wbPf9EJE/+P7brK+
	 SxbhLDYEJtEpBdkHd8ZwKsdkFWzDjPHxwjPdbkJNS2jfBZv5jzatoqnUiz0zEG28tw
	 hjUYhdxihOCJgq/u8k3cQcEl7ih41Mn0OJWPBDGbgcpU1aJFA1pEtVgtDBWDmAU/l3
	 SHsHnTvjwc7rGXVGqyuHpCidavb1xuTXQKYBS481Y30pxpCGAw1EwM2rQcFNZH6mAD
	 r6TnzILRj+UQJyfdOrc8aBAzwzd0JC9nICmjlULt7mfWsJxiVe4VWmakJOCcMTOr0t
	 Sn0irpBpH5afg==
Date: Wed, 28 Aug 2024 17:06:57 -0700
From: Jakub Kicinski <kuba@kernel.org>
To: Jeongjun Park <aha310510@gmail.com>
Cc: Paolo Abeni <pabeni@redhat.com>, wei.liu@kernel.org, paul@xen.org,
 davem@davemloft.net, edumazet@google.com, madhuparnabhowmik04@gmail.com,
 xen-devel@lists.xenproject.org, netdev@vger.kernel.org,
 linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net/xen-netback: prevent UAF in xenvif_flush_hash()
Message-ID: <20240828170657.5f493cc6@kernel.org>
In-Reply-To: <CAO9qdTGHJw-SUFH9D16N5wSn4KmaMUcX+GVFuEFu+jqMb3HU1g@mail.gmail.com>
References: <20240822181109.2577354-1-aha310510@gmail.com>
	<fd2a06d5-370f-4e07-af84-cab089b82a4b@redhat.com>
	<CAO9qdTGHJw-SUFH9D16N5wSn4KmaMUcX+GVFuEFu+jqMb3HU1g@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

On Wed, 28 Aug 2024 21:52:12 +0900 Jeongjun Park wrote:
> > The loop runs with irq disabled, the RCU critical section extends over
> > it, uninterrupted.  
> 
> Basically, list_for_each_entry_rcu is specified to be used under the protection
> of rcu_read_lock(), but this is not the case with xenvif_new_hash(). If it is
> used without the protection of rcu_read_lock(), kfree is called immediately
> after the grace period ends after the call to kfree_rcu() inside
> list_for_each_entry_rcu, so the entry is released, and a UAF occurs when
> fetching with ->next thereafter.

You cut off and didn't answer Paolo's question whether you have a splat
/ saw this actually cause a crash or a KASAN warning.


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 00:20:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 00:20:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785309.1194735 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjSu3-0007hW-N9; Thu, 29 Aug 2024 00:20:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785309.1194735; Thu, 29 Aug 2024 00:20:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjSu3-0007hP-K7; Thu, 29 Aug 2024 00:20:43 +0000
Received: by outflank-mailman (input) for mailman id 785309;
 Thu, 29 Aug 2024 00:20:43 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kAFl=P4=kernel.org=patchwork-bot+netdevbpf@srs-se1.protection.inumbo.net>)
 id 1sjSu3-0007hJ-05
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 00:20:43 +0000
Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 85e4d9f5-659c-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 02:20:40 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by ams.source.kernel.org (Postfix) with ESMTP id D3443AE4111;
 Thu, 29 Aug 2024 00:20:34 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id B42F1C4CEC4;
 Thu, 29 Aug 2024 00:20:39 +0000 (UTC)
Received: from [10.30.226.235] (localhost [IPv6:::1])
 by aws-us-west-2-korg-oddjob-rhel9-1.codeaurora.org (Postfix) with ESMTP id
 33DB73809A80; Thu, 29 Aug 2024 00:20:41 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 85e4d9f5-659c-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724890839;
	bh=eBdRKI+jWY2+i6cFgW77TOP+7WLPwhi0XxTqy7tOYoo=;
	h=Subject:From:Date:References:In-Reply-To:To:Cc:From;
	b=sG1hZYK+1QTmNn/xbvTl/6TmcYKrlLn8u9HAdFHg1HqiuxyU94OLWvTBxmNM0eqoW
	 DnNYMXacQ4k0o/Ws4OGIWghS/JNfQ+Qo/CKJhMG5xzdyLjqDVX79Ni8DyFswA4+UiS
	 Eky6Rl3d7QF1ctg0XH4RWHmvmdMwbzq3KB9PuiP/bynIJ47CcjvLo5IgKlPYv17jRG
	 kI5y1tvcY9shy+rurvFuA3ns9a6f3KTMd2LC3Sb/C4+93bJUhrvRvl81WgbTiyso4K
	 xHhSqjdLjP9L0dZxNkbLSOEiJ+qVLgpsf2MKrmC/kMM2kahN7iIrU4ixvlifr2UK2k
	 N2cE+9qfsB+mw==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: Re: [PATCH net] net/xen-netback: prevent UAF in xenvif_flush_hash()
From: patchwork-bot+netdevbpf@kernel.org
Message-Id: 
 <172489083974.1473828.6183768950292270791.git-patchwork-notify@kernel.org>
Date: Thu, 29 Aug 2024 00:20:39 +0000
References: <20240822181109.2577354-1-aha310510@gmail.com>
In-Reply-To: <20240822181109.2577354-1-aha310510@gmail.com>
To: Jeongjun Park <aha310510@gmail.com>
Cc: wei.liu@kernel.org, paul@xen.org, davem@davemloft.net,
 edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
 madhuparnabhowmik04@gmail.com, xen-devel@lists.xenproject.org,
 netdev@vger.kernel.org, linux-kernel@vger.kernel.org

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 23 Aug 2024 03:11:09 +0900 you wrote:
> During the list_for_each_entry_rcu iteration call of xenvif_flush_hash,
> kfree_rcu does not exist inside the rcu read critical section, so if
> kfree_rcu is called when the rcu grace period ends during the iteration,
> UAF occurs when accessing head->next after the entry becomes free.
> 
> Therefore, to solve this, you need to change it to list_for_each_entry_safe.
> 
> [...]

Here is the summary with links:
  - [net] net/xen-netback: prevent UAF in xenvif_flush_hash()
    https://git.kernel.org/netdev/net-next/c/0fa5e94a1811

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html




From xen-devel-bounces@lists.xenproject.org Thu Aug 29 00:25:39 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 00:25:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785314.1194745 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjSyo-0008HT-6d; Thu, 29 Aug 2024 00:25:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785314.1194745; Thu, 29 Aug 2024 00:25:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjSyo-0008HM-3h; Thu, 29 Aug 2024 00:25:38 +0000
Received: by outflank-mailman (input) for mailman id 785314;
 Thu, 29 Aug 2024 00:25: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=i2Q5=P4=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sjSym-0008HG-W3
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 00:25:37 +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 343b0d4e-659d-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 02:25:35 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id C1FC5CE19B0;
 Thu, 29 Aug 2024 00:25:31 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EA94C4CEC0;
 Thu, 29 Aug 2024 00:25:30 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 343b0d4e-659d-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724891130;
	bh=VqDbObe7d5BLNOYikx3b+uU7d3i7Z2o62HQnyU6jKsI=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=YYkPhUIcnL7KJ+hI0N/hSFBhlhBKPRFpz0vtYDG0zduTlIj/cURBdFaa16h8esBkE
	 bzMAPJHtiR36YaegGy8ysosewfvYm/WJ/79tu0rNo8fdXXevZQtkCcJ4Z4KeXw44Dt
	 EjvG4tyt6O51hrrATYKpQEgY6gSlq3fXDJQ6zL50lg5DG4AVUS7DF2RTrORtTrRW7H
	 efUlRsnW5L7MIKhiasv1TcNdaiknFezXe2VO3KugWedakxUqAzD+jU2JUMl64QXjsq
	 h73sqmb62So8yNI38v3sxpAxHyAkYBLO+YeIrZbTU3YQQ0BFrh/YLHfqvVMdh+nEWd
	 wv8ABBzJ5nh3w==
Date: Wed, 28 Aug 2024 17:25:28 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Victor Lira <victorm.lira@amd.com>
cc: xen-devel@lists.xenproject.org, 
    Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v1] automation: update xilinx tests to use expect
In-Reply-To: <fbda01cf915786ac7d51f9dc98489eed088a0433.1724719426.git.victorm.lira@amd.com>
Message-ID: <alpine.DEB.2.22.394.2408281718580.53815@ubuntu-linux-20-04-desktop>
References: <fbda01cf915786ac7d51f9dc98489eed088a0433.1724719426.git.victorm.lira@amd.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 26 Aug 2024, victorm.lira@amd.com wrote:
> From: Victor Lira <victorm.lira@amd.com>
> 
> Fixes the CI failure introduced by 95764a0817.
> 
> Update xilinx-smoke tests to use the "expect" utility for early exit from
> tests. Generalize the script "qemu-key.exp" to be used by both QEMU and
> hardware tests. Add a missing "-continue_timer" flag for the expect script
> to properly time out.
> 
> Signed-off-by: Victor Lira <victorm.lira@amd.com>
> ---
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> ---
>  .../build/ubuntu/xenial-xilinx.dockerfile     |  1 +
>  automation/gitlab-ci/test.yaml                |  2 ++
>  .../scripts/{qemu-key.exp => console.exp}     | 27 +++++++++++--------
>  automation/scripts/qemu-alpine-x86_64.sh      |  8 +++---
>  automation/scripts/qemu-smoke-dom0-arm32.sh   |  8 +++---
>  automation/scripts/qemu-smoke-dom0-arm64.sh   |  8 +++---
>  .../scripts/qemu-smoke-dom0less-arm32.sh      |  8 +++---
>  .../scripts/qemu-smoke-dom0less-arm64.sh      |  8 +++---
>  automation/scripts/qemu-smoke-ppc64le.sh      |  8 +++---
>  automation/scripts/qemu-smoke-riscv64.sh      |  8 +++---
>  automation/scripts/qemu-smoke-x86-64.sh       |  8 +++---
>  automation/scripts/qemu-xtf-dom0less-arm64.sh |  8 +++---
>  .../scripts/xilinx-smoke-dom0-x86_64.sh       | 21 +++++++--------
>  .../scripts/xilinx-smoke-dom0less-arm64.sh    | 20 +++++++-------
>  14 files changed, 76 insertions(+), 67 deletions(-)
>  rename automation/scripts/{qemu-key.exp => console.exp} (50%)
> 
> diff --git a/automation/build/ubuntu/xenial-xilinx.dockerfile b/automation/build/ubuntu/xenial-xilinx.dockerfile
> index f03d62e8bd..6107d8b771 100644
> --- a/automation/build/ubuntu/xenial-xilinx.dockerfile
> +++ b/automation/build/ubuntu/xenial-xilinx.dockerfile
> @@ -20,6 +20,7 @@ RUN apt-get update && \
>          git \
>          gzip \
>          file \
> +        expect \
>          && \
>          apt-get autoremove -y && \
>          apt-get clean && \
> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> index 3b339f387f..62dbed93d2 100644
> --- a/automation/gitlab-ci/test.yaml
> +++ b/automation/gitlab-ci/test.yaml
> @@ -179,6 +179,8 @@ xilinx-smoke-dom0less-arm64-gcc-debug-gem-passthrough:
> 
>  xilinx-smoke-dom0-x86_64-gcc-debug:
>    extends: .xilinx-x86_64
> +  variables:
> +    TEST_TIMEOUT: 500

I think we need to add something similar for .xilinx-arm64



>    script:
>      - ./automation/scripts/xilinx-smoke-dom0-x86_64.sh ping 2>&1 | tee ${LOGFILE}
>    needs:
> diff --git a/automation/scripts/qemu-key.exp b/automation/scripts/console.exp
> similarity index 50%
> rename from automation/scripts/qemu-key.exp
> rename to automation/scripts/console.exp
> index 787f1f08cb..2cf31e7ac0 100755
> --- a/automation/scripts/qemu-key.exp
> +++ b/automation/scripts/console.exp
> @@ -1,23 +1,29 @@
>  #!/usr/bin/expect -f
> 
> -if {[info exists env(QEMU_TIMEOUT)]} {
> -    set timeout $env(QEMU_TIMEOUT)
> +if {[info exists env(TEST_TIMEOUT)]} {
> +    set timeout $env(TEST_TIMEOUT)
>  } else {
>      set timeout 1500
>  }
> 
> -log_file -a $env(QEMU_LOG)
> +log_file -a $env(TEST_LOGFILE)
> 
>  match_max 10000
> 
> -eval spawn $env(QEMU_CMD)
> +eval spawn $env(TEST_CMD_START)
> 
>  expect_after {
>      -re "(.*)\r" {
> -        exp_continue
> +        exp_continue -continue_timer
> +    }
> +    timeout {
> +        send_error "ERROR-Timeout!\n"
> +        exit 1
> +    }
> +    eof {
> +        send_error "ERROR-EOF!\n"
> +        exit 1
>      }
> -    timeout {send_error "ERROR-Timeout!\n"; exit 1}
> -    eof {send_error "ERROR-EOF!\n"; exit 1}
>  }
> 
>  if {[info exists env(UBOOT_CMD)]} {
> @@ -28,22 +34,21 @@ if {[info exists env(UBOOT_CMD)]} {
> 
>  if {[info exists env(LOG_MSG)]} {
>      expect {
> -        "$env(PASSED)" {
> +        "$env(TEST_PASS_MSG)" {
>              expect "$env(LOG_MSG)"
>              exit 0
>          }
>          "$env(LOG_MSG)" {
> -            expect "$env(PASSED)"
> +            expect "$env(TEST_PASS_MSG)"
>              exit 0
>          }
>      }
>  }
> 
>  expect {
> -    "$env(PASSED)" {
> +    "$env(TEST_PASS_MSG)" {
>          exit 0
>      }
>  }
> 
>  expect eof
> -
> diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
> index 42a89e86b0..b701b917a5 100755
> --- a/automation/scripts/qemu-alpine-x86_64.sh
> +++ b/automation/scripts/qemu-alpine-x86_64.sh
> @@ -77,7 +77,7 @@ EOF
>  # Run the test
>  rm -f smoke.serial
>  set +e
> -export QEMU_CMD="qemu-system-x86_64 \
> +export TEST_CMD_START="qemu-system-x86_64 \
>      -cpu qemu64,+svm \
>      -m 2G -smp 2 \
>      -monitor none -serial stdio \
> @@ -85,8 +85,8 @@ export QEMU_CMD="qemu-system-x86_64 \
>      -device virtio-net-pci,netdev=n0 \
>      -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0"
> 
> -export QEMU_LOG="smoke.serial"
> +export TEST_LOGFILE="smoke.serial"
>  export LOG_MSG="Domain-0"
> -export PASSED="BusyBox"
> +export TEST_PASS_MSG="BusyBox"
> 
> -./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +./automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
> index fd64b19358..ea68f9973e 100755
> --- a/automation/scripts/qemu-smoke-dom0-arm32.sh
> +++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
> @@ -78,7 +78,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
> 
>  rm -f ${serial_log}
>  set +e
> -export QEMU_CMD="./qemu-system-arm \
> +export TEST_CMD_START="./qemu-system-arm \
>     -machine virt \
>     -machine virtualization=true \
>     -smp 4 \
> @@ -92,8 +92,8 @@ export QEMU_CMD="./qemu-system-arm \
>     -bios /usr/lib/u-boot/qemu_arm/u-boot.bin"
> 
>  export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
> -export QEMU_LOG="${serial_log}"
> +export TEST_LOGFILE="${serial_log}"
>  export LOG_MSG="Domain-0"
> -export PASSED="/ #"
> +export TEST_PASS_MSG="/ #"
> 
> -../automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +../automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
> index e0cea742b0..2ddb20b219 100755
> --- a/automation/scripts/qemu-smoke-dom0-arm64.sh
> +++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
> @@ -94,7 +94,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
>  # Run the test
>  rm -f smoke.serial
>  set +e
> -export QEMU_CMD="./binaries/qemu-system-aarch64 \
> +export TEST_CMD_START="./binaries/qemu-system-aarch64 \
>      -machine virtualization=true \
>      -cpu cortex-a57 -machine type=virt \
>      -m 2048 -monitor none -serial stdio \
> @@ -105,8 +105,8 @@ export QEMU_CMD="./binaries/qemu-system-aarch64 \
>      -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
> 
>  export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
> -export QEMU_LOG="smoke.serial"
> +export TEST_LOGFILE="smoke.serial"
>  export LOG_MSG="Domain-0"
> -export PASSED="BusyBox"
> +export TEST_PASS_MSG="BusyBox"
> 
> -./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +./automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> index e824cb7c2a..fedc37d644 100755
> --- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
> +++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> @@ -131,7 +131,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
>  # Run the test
>  rm -f ${serial_log}
>  set +e
> -export QEMU_CMD="./qemu-system-arm \
> +export TEST_CMD_START="./qemu-system-arm \
>      -machine virt \
>      -machine virtualization=true \
>      -smp 4 \
> @@ -145,8 +145,8 @@ export QEMU_CMD="./qemu-system-arm \
>      -bios /usr/lib/u-boot/qemu_arm/u-boot.bin"
> 
>  export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
> -export QEMU_LOG="${serial_log}"
> +export TEST_LOGFILE="${serial_log}"
>  export LOG_MSG="${dom0_prompt}"
> -export PASSED="${passed}"
> +export TEST_PASS_MSG="${passed}"
> 
> -../automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +../automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> index f42ba5d196..0885bd0179 100755
> --- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
> +++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> @@ -205,7 +205,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
>  # Run the test
>  rm -f smoke.serial
>  set +e
> -export QEMU_CMD="./binaries/qemu-system-aarch64 \
> +export TEST_CMD_START="./binaries/qemu-system-aarch64 \
>      -machine virtualization=true \
>      -cpu cortex-a57 -machine type=virt,gic-version=$gic_version \
>      -m 2048 -monitor none -serial stdio \
> @@ -216,8 +216,8 @@ export QEMU_CMD="./binaries/qemu-system-aarch64 \
>      -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
> 
>  export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
> -export QEMU_LOG="smoke.serial"
> +export TEST_LOGFILE="smoke.serial"
>  export LOG_MSG="Welcome to Alpine Linux"
> -export PASSED="${passed}"
> +export TEST_PASS_MSG="${passed}"
> 
> -./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +./automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/scripts/qemu-smoke-ppc64le.sh
> index 594f92c19c..85f2181ddd 100755
> --- a/automation/scripts/qemu-smoke-ppc64le.sh
> +++ b/automation/scripts/qemu-smoke-ppc64le.sh
> @@ -11,7 +11,7 @@ machine=$1
>  rm -f ${serial_log}
>  set +e
> 
> -export QEMU_CMD="qemu-system-ppc64 \
> +export TEST_CMD_START="qemu-system-ppc64 \
>      -bios skiboot.lid \
>      -M $machine \
>      -m 2g \
> @@ -22,7 +22,7 @@ export QEMU_CMD="qemu-system-ppc64 \
>      -serial stdio \
>      -kernel binaries/xen"
> 
> -export QEMU_LOG="${serial_log}"
> -export PASSED="Hello, ppc64le!"
> +export TEST_LOGFILE="${serial_log}"
> +export TEST_PASS_MSG="Hello, ppc64le!"
> 
> -./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +./automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
> index c2595f657f..c2b5914e3f 100755
> --- a/automation/scripts/qemu-smoke-riscv64.sh
> +++ b/automation/scripts/qemu-smoke-riscv64.sh
> @@ -6,14 +6,14 @@ set -ex
>  rm -f smoke.serial
>  set +e
> 
> -export QEMU_CMD="qemu-system-riscv64 \
> +export TEST_CMD_START="qemu-system-riscv64 \
>      -M virt \
>      -smp 1 \
>      -nographic \
>      -m 2g \
>      -kernel binaries/xen"
> 
> -export QEMU_LOG="smoke.serial"
> -export PASSED="All set up"
> +export TEST_LOGFILE="smoke.serial"
> +export TEST_PASS_MSG="All set up"
> 
> -./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +./automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
> index 3440b1761d..f792df3b7d 100755
> --- a/automation/scripts/qemu-smoke-x86-64.sh
> +++ b/automation/scripts/qemu-smoke-x86-64.sh
> @@ -16,12 +16,12 @@ esac
> 
>  rm -f smoke.serial
>  set +e
> -export QEMU_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
> +export TEST_CMD_START="qemu-system-x86_64 -nographic -kernel binaries/xen \
>          -initrd xtf/tests/example/$k \
>          -append \"loglvl=all console=com1 noreboot console_timestamps=boot $extra\" \
>          -m 512 -monitor none -serial stdio"
> 
> -export QEMU_LOG="smoke.serial"
> -export PASSED="Test result: SUCCESS"
> +export TEST_LOGFILE="smoke.serial"
> +export TEST_PASS_MSG="Test result: SUCCESS"
> 
> -./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +./automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> index 4042fe5060..0eceb4a74c 100755
> --- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
> +++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> @@ -51,7 +51,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
>  # Run the test
>  rm -f smoke.serial
>  set +e
> -export QEMU_CMD="./binaries/qemu-system-aarch64 \
> +export TEST_CMD_START="./binaries/qemu-system-aarch64 \
>      -machine virtualization=true \
>      -cpu cortex-a57 -machine type=virt \
>      -m 2048 -monitor none -serial stdio \
> @@ -62,7 +62,7 @@ export QEMU_CMD="./binaries/qemu-system-aarch64 \
>      -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
> 
>  export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
> -export QEMU_LOG="smoke.serial"
> -export PASSED="${passed}"
> +export TEST_LOGFILE="smoke.serial"
> +export TEST_PASS_MSG="${passed}"
> 
> -./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +./automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
> index 4559e2b9ee..144d9e73a1 100755
> --- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
> +++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
> @@ -27,7 +27,6 @@ memory = 512
>  vif = [ "bridge=xenbr0", ]
>  disk = [ ]
>  '
> -TIMEOUT_SECONDS=200
> 
>  # Select test variant.
>  if [ "${TEST}" = "ping" ]; then
> @@ -125,20 +124,20 @@ boot
> 
>  # Power cycle board and collect serial port output.
>  SERIAL_DEV="/dev/serial/${TEST_BOARD}"
> -SERIAL_CMD="cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"
>  sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
>  sleep 5
>  sh /scratch/gitlab-runner/${TEST_BOARD}.sh 1
>  sleep 5
>  set +e
>  stty -F ${SERIAL_DEV} 115200
> -timeout -k 1 ${TIMEOUT_SECONDS} nohup sh -c "${SERIAL_CMD}"
> -sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
> -
> -set -e
> 
> -if grep -q "${PASS_MSG}" smoke.serial; then
> -    exit 0
> -fi
> -
> -fatal "Test failed"
> +# Capture the test result and power off board before exiting.
> +export TEST_PASS_MSG="${PASS_MSG}"
> +export TEST_CMD_START="cat ${SERIAL_DEV}"
> +export TEST_LOGFILE="smoke.serial"
> +mkfifo console
> +sed 's/\r\+$//' < console &
> +./automation/scripts/console.exp > console
> +TEST_RESULT=$?
> +sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
> +exit ${TEST_RESULT}

Isn't this sufficient? Why do we need the fifo?

export TEST_PASS_MSG="${PASS_MSG}"
export TEST_CMD_START="cat ${SERIAL_DEV}"
export TEST_LOGFILE="smoke.serial"
./automation/scripts/console.exp | sed 's/\r//'
TEST_RESULT=$?
sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
exit ${TEST_RESULT}


> diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
> index 18aa07f0a2..3a852e0798 100755
> --- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
> +++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
> @@ -137,13 +137,15 @@ cd $START
>  SERIAL_DEV="/dev/serial/zynq"
>  set +e
>  stty -F ${SERIAL_DEV} 115200
> -timeout -k 1 120 nohup sh -c "cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"

The timeout should be set in test.yaml otherwise we'll default to 1500


> -# stop the board
> -cd /scratch/gitlab-runner
> -bash zcu102.sh 2
> -cd $START
> -
> -set -e
> -(grep -q "^Welcome to Alpine Linux" smoke.serial && grep -q "${passed}" smoke.serial) || exit 1
> -exit 0
> +# Capture the test result and power off board before exiting.
> +export TEST_PASS_MSG="${passed}"
> +export LOG_MSG="Welcome to Alpine Linux"
> +export TEST_CMD_START="cat ${SERIAL_DEV}"
> +export TEST_LOGFILE="smoke.serial"
> +mkfifo console
> +sed 's/\r\+$//' < console &
> +./automation/scripts/console.exp > console
> +TEST_RESULT=$?
> +sh /scratch/gitlab-runner/zcu102.sh 2
> +exit ${TEST_RESULT}

Same comment about the fifo, I think it could be removed?


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 00:28:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 00:28:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785322.1194757 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjT19-0001AW-Jr; Thu, 29 Aug 2024 00:28:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785322.1194757; Thu, 29 Aug 2024 00:28:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjT19-0001AP-Fe; Thu, 29 Aug 2024 00:28:03 +0000
Received: by outflank-mailman (input) for mailman id 785322;
 Thu, 29 Aug 2024 00:28:02 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i2Q5=P4=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sjT18-0001AJ-1m
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 00:28:02 +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 8b421941-659d-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 02:28:01 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 52C54CE19DA;
 Thu, 29 Aug 2024 00:27:58 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3141FC4CEC0;
 Thu, 29 Aug 2024 00:27:54 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8b421941-659d-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724891275;
	bh=gHA57WDKmjsKvC1wyD430+u7TEzTO37/CLJseSrvF6g=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=iFaKD0glGznufGjWG1YX6aQITJcAC52qAv0mQ2FFNo6HX054cCsOhLaEfaDETrVje
	 jJKIyNH6ADI5s+ihmuCx2xL+sFvgehs6IhGGfCI3/iMxkNEcSlffUd++GRtPRe2jz7
	 BdaFfmvMGkxavUfYdM0CvxNtrD1eVH51CX094Fa9lj2tGtEElpXH6YxkhoK7bTelvz
	 Nc+60SWSrMHU2GHo5rw/oYVCTdfLZtk58V+cAdG8ToH99lMscWNUsfhq/Snl/IvM9x
	 HWK4bs5UQvxdgGQdI7KJ60WtP9wZ5C9ooxc3FZfX5QXKfX7wXZNmjklPxyqqISvVy1
	 ACCAHYRpoVtWw==
Date: Wed, 28 Aug 2024 17:27:52 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Simone Ballarin <simone.ballarin@bugseng.com>, 
    Doug Goldstein <cardoe@cardoe.com>, 
    Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [XEN PATCH] automation/eclair: monitor rules 13.2 and 18.2
In-Reply-To: <a285b271a7b89e81932115cbd23e8d9f8ca6d865.1724748117.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2408281727470.53815@ubuntu-linux-20-04-desktop>
References: <a285b271a7b89e81932115cbd23e8d9f8ca6d865.1724748117.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Tue, 27 Aug 2024, Federico Serafini wrote:
> Add MISRA C:2012 Rules 13.2 and 18.2 to the monitored set.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
>  automation/eclair_analysis/ECLAIR/monitored.ecl | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/automation/eclair_analysis/ECLAIR/monitored.ecl b/automation/eclair_analysis/ECLAIR/monitored.ecl
> index 7b085a329a..4d9ef1bd83 100644
> --- a/automation/eclair_analysis/ECLAIR/monitored.ecl
> +++ b/automation/eclair_analysis/ECLAIR/monitored.ecl
> @@ -52,6 +52,7 @@
>  -enable=MC3R1.R11.9
>  -enable=MC3R1.R12.5
>  -enable=MC3R1.R13.1
> +-enable=MC3R1.R13.2
>  -enable=MC3R1.R13.6
>  -enable=MC3R1.R14.1
>  -enable=MC3R1.R14.4
> @@ -65,6 +66,7 @@
>  -enable=MC3R1.R17.4
>  -enable=MC3R1.R17.5
>  -enable=MC3R1.R17.6
> +-enable=MC3R1.R18.2
>  -enable=MC3R1.R18.6
>  -enable=MC3R1.R18.8
>  -enable=MC3R1.R19.1
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 00:36:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 00:36:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785327.1194766 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjT8t-00033L-Ax; Thu, 29 Aug 2024 00:36:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785327.1194766; Thu, 29 Aug 2024 00:36:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjT8t-00033E-7a; Thu, 29 Aug 2024 00:36:03 +0000
Received: by outflank-mailman (input) for mailman id 785327;
 Thu, 29 Aug 2024 00:36:01 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i2Q5=P4=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sjT8r-000338-Pe
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 00:36:01 +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 a8e584b9-659e-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 02:36:00 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 4CB78CE19B6;
 Thu, 29 Aug 2024 00:35:57 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D933C4CEC2;
 Thu, 29 Aug 2024 00:35:54 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a8e584b9-659e-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724891755;
	bh=VvoZj2CvTAW+P0JXl3bo0fxrLliV7G0ffaBZf1do2Qg=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=in2AyjUb2puPxheNbmzKEUJuVK0mLr/3vZJ+h2JfUcE7mg40lbMCFsEVspcsW5Gom
	 5A7RAXUC3uPXIhm+0TQV+DvipVsqFg0azeB/KtOnZuNyT1gmd0tUG7yUWdp235rE6B
	 yKho+536mI9xAQsxdzJf7OkxZGuRnj3cszYix5WAXlye6tuTITrFt2Z7O6xe1iunRF
	 uhTCQuCdOY3W9JSwXjDwaOlAcULhvu9DVH1ijKtv0VOFLZj20iOOg9howLDdx6sPDc
	 jBvoFoMnWwyYYajNEfctrn9PQtiGBvmSdgxJ4modyKtW8N0UZ7NIQVaEOktgsHX1n0
	 DkSox4kp39i5g==
Date: Wed, 28 Aug 2024 17:35:52 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Stefano Stabellini <sstabellini@kernel.org>
cc: Federico Serafini <federico.serafini@bugseng.com>, 
    xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>, 
    =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Subject: Re: [XEN PATCH v5 7/8] x86/mm: add defensive return
In-Reply-To: <alpine.DEB.2.22.394.2407291512280.4857@ubuntu-linux-20-04-desktop>
Message-ID: <alpine.DEB.2.22.394.2408281735020.53815@ubuntu-linux-20-04-desktop>
References: <cover.1722239813.git.federico.serafini@bugseng.com> <24501d2e7f5d82d8e5a483a80b35e04ce765a7cf.1722239813.git.federico.serafini@bugseng.com> <alpine.DEB.2.22.394.2407291512280.4857@ubuntu-linux-20-04-desktop>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Mon, 29 Jul 2024, Stefano Stabellini wrote:
> On Mon, 29 Jul 2024, Federico Serafini wrote:
> > Add defensive return statement at the end of an unreachable
> > default case. Other than improve safety, this meets the requirements
> > to deviate a violation of MISRA C Rule 16.3: "An unconditional `break'
> > statement shall terminate every switch-clause".
> > 
> > Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> > ---
> > No changes from v3 and v4, further feedback on this thread would be appreciated:
> > https://lists.xenproject.org/archives/html/xen-devel/2024-07/msg00474.html

Looking at the older threads, I looks like Jan suggested EACCES, I also
think it is marginally better. My R-b stands also for EACCES. Jan, I
think you should go ahead and fix on commit


> > ---
> >  xen/arch/x86/mm.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
> > index 95795567f2..8973e76dff 100644
> > --- a/xen/arch/x86/mm.c
> > +++ b/xen/arch/x86/mm.c
> > @@ -917,6 +917,7 @@ get_page_from_l1e(
> >                  return 0;
> >              default:
> >                  ASSERT_UNREACHABLE();
> > +                return -EPERM;
> >              }
> >          }
> >          else if ( l1f & _PAGE_RW )
> > -- 
> > 2.34.1
> > 
> > 
> 


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 00:43:06 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 00:43:06 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785336.1194775 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjTFd-0005UM-4K; Thu, 29 Aug 2024 00:43:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785336.1194775; Thu, 29 Aug 2024 00:43:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjTFd-0005UF-1p; Thu, 29 Aug 2024 00:43:01 +0000
Received: by outflank-mailman (input) for mailman id 785336;
 Thu, 29 Aug 2024 00:43:00 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i2Q5=P4=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sjTFc-0005U9-MI
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 00:43:00 +0000
Received: from sin.source.kernel.org (sin.source.kernel.org
 [2604:1380:40e1:4800::1])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a21ef8fc-659f-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 02:42:58 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by sin.source.kernel.org (Postfix) with ESMTP id 6765ACE0691;
 Thu, 29 Aug 2024 00:42:52 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D214C4CEC0;
 Thu, 29 Aug 2024 00:42:50 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a21ef8fc-659f-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724892171;
	bh=ane8Mm/0Ga+QsNQ1MUFX45+/BxKnxWZoecqhvqhEgq0=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=JtUDEA9qteyW+gtJVe84XXRPyYZy5h+No1IHAkHi4fIrE67qOHQ1YfrX6u6H20Rfu
	 zFdW6nK0GYb9N73LkDv+Lnqj0j6qxgdGhUDOnm5t2tgbU6u3Z5oVSXkdoGl6a+BL02
	 QcsE172cfCRNIvJkOixfkl0gcIJ9QL+nvhJIQYFXl3HbsJhKaTxTw6blUT4aBaVpbW
	 iukhEoNjHEvFbzZXkOg5pu2qYzoH+CufzQXpP6RqKERI3IFr49frC/Ry4Vv15KmkiP
	 H7DQHfLB9nv8eogEC9+cs7Qh/ExJybhbBhPSf9g6KyNN49wvUXGMpJnn5Xw6Q1X+fP
	 eqhcS7FhWUtvw==
Date: Wed, 28 Aug 2024 17:42:48 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Federico Serafini <federico.serafini@bugseng.com>
cc: xen-devel@lists.xenproject.org, consulting@bugseng.com, 
    Simone Ballarin <simone.ballarin@bugseng.com>, 
    Doug Goldstein <cardoe@cardoe.com>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>
Subject: Re: [XEN PATCH] xen/bitmap: remove comment-based deviations
In-Reply-To: <4aa692a50a5d08d24560f02fdc36911965fc860b.1724850701.git.federico.serafini@bugseng.com>
Message-ID: <alpine.DEB.2.22.394.2408281741550.53815@ubuntu-linux-20-04-desktop>
References: <4aa692a50a5d08d24560f02fdc36911965fc860b.1724850701.git.federico.serafini@bugseng.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Wed, 28 Aug 2024, Federico Serafini wrote:
> Update ECLAIR configuration of MISRA C:2012 Rule 20.7 ("Expressions
> resulting from the expansion of macro parameters shall be enclosed in
> parentheses") to tag as 'safe' the expansions of arguments surrounded
> by the following tokens: '{', '}' and ';'.
> 
> Remove redundant comment-based deviations.
> 
> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>

I am missing some context: is this done to cover other cases similar to
the one below (bitmap_allocate_region) or is this done only to get rid
of the three SAF-7-safe in-code comments?


> ---
>  automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++
>  docs/misra/deviations.rst                        | 5 +++++
>  xen/include/xen/bitmap.h                         | 3 ---
>  3 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl
> index 1aa8277066..f37329973f 100644
> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
> @@ -565,6 +565,10 @@ of this macro do not lead to developer confusion, and can thus be deviated."
>  -config=MC3R1.R20.7,reports+={safe, "any_area(any_loc(any_exp(macro(^count_args_$))))"}
>  -doc_end
>  
> +-doc_begin="The expansion of an argument surrounded by tokens '{', '}' and ';' is safe."
> +-config=MC3R1.R20.7,expansion_context+={safe, "left_right(^[\\{;]$,^[;\\}]$)"}
> +-doc_end
> +
>  -doc_begin="Uses of variadic macros that have one of their arguments defined as
>  a macro and used within the body for both ordinary parameter expansion and as an
>  operand to the # or ## operators have a behavior that is well-understood and
> diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
> index d51aa422b5..d529726464 100644
> --- a/docs/misra/deviations.rst
> +++ b/docs/misra/deviations.rst
> @@ -512,6 +512,11 @@ Deviations related to MISRA C:2012 Rules:
>         refactoring it to add parentheses breaks its functionality.
>       - Tagged as `safe` for ECLAIR.
>  
> +   * - R20.7
> +     - The expansion of an argument surrounded by tokens '{', '}' and ';' is
> +       safe.
> +     - Tagged as `safe` for ECLAIR.
> +
>     * - R20.12
>       - Variadic macros that use token pasting often employ the gcc extension
>         `ext_paste_comma`, as detailed in `C-language-toolchain.rst`, which is
> diff --git a/xen/include/xen/bitmap.h b/xen/include/xen/bitmap.h
> index 5d668053b0..4b642cd420 100644
> --- a/xen/include/xen/bitmap.h
> +++ b/xen/include/xen/bitmap.h
> @@ -103,13 +103,10 @@ extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order);
>  #define bitmap_switch(nbits, zero, small, large)			  \
>  	unsigned int n__ = (nbits);					  \
>  	if (__builtin_constant_p(nbits) && !n__) {			  \
> -		/* SAF-7-safe Rule 20.7 non-parenthesized macro argument */ \
>  		zero;							  \
>  	} else if (__builtin_constant_p(nbits) && n__ <= BITS_PER_LONG) { \
> -		/* SAF-7-safe Rule 20.7 non-parenthesized macro argument */ \
>  		small;							  \
>  	} else {							  \
> -		/* SAF-7-safe Rule 20.7 non-parenthesized macro argument */ \
>  		large;							  \
>  	}
>  
> -- 
> 2.34.1
> 


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 00:48:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 00:48:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785344.1194793 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjTKu-00072Y-Qh; Thu, 29 Aug 2024 00:48:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785344.1194793; Thu, 29 Aug 2024 00:48:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjTKu-00072R-Ni; Thu, 29 Aug 2024 00:48:28 +0000
Received: by outflank-mailman (input) for mailman id 785344;
 Thu, 29 Aug 2024 00:48:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=i2Q5=P4=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sjTKt-00072L-Sc
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 00:48:27 +0000
Received: from nyc.source.kernel.org (nyc.source.kernel.org
 [2604:1380:45d1:ec00::3])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6624c521-65a0-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 02:48:26 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by nyc.source.kernel.org (Postfix) with ESMTP id 02979A437A8;
 Thu, 29 Aug 2024 00:48:18 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F228C4CEC0;
 Thu, 29 Aug 2024 00:48:23 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6624c521-65a0-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724892504;
	bh=Z6XxHWm2G5Gj/WMxdWAToykBCZyJ0Kzr8JWEK3KlLaE=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=aaHX+Ul7wWaT1iJIb/vq1EG3lvecVSO44igI5GKpmVe4rzE1FVKLWUVqcciVAYmvx
	 E3WOeuNiP3lbqtvXzPJzUavOaFPXXs+HJZTW8P8k1/okMjXqPxKMvcF91oHFliHxQW
	 7U5pBT1VPoXHkBQq08tkqVszUQSCIpmNXDYtuNhfbR4vQZPPJw8NwvEjzJVOEQxaPH
	 92kyfGw9Qmw7A6teSgMgprvevNEQ0i2UUXfiwMd9OZmL28bsotvHs9PHcs+I0Z4wo7
	 0X/PqSHNAd3zQZADW948K3axVBORC+r0avCn0KgUK9wXI318eyxZvcwvhvlzvdUxT7
	 1EcutVx4G6LPQ==
Date: Wed, 28 Aug 2024 17:48:22 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Jan Beulich <jbeulich@suse.com>
cc: victorm.lira@amd.com, Stefano Stabellini <sstabellini@kernel.org>, 
    roberto.bagnara@bugseng.com, consulting@bugseng.com, 
    simone.ballarin@bugseng.com, xen-devel@lists.xenproject.org
Subject: Re: [RFC PATCH v3] automation: add linker symbol name script
In-Reply-To: <68c3ac17-2ccb-40db-b105-712d444440c3@suse.com>
Message-ID: <alpine.DEB.2.22.394.2408281748050.53815@ubuntu-linux-20-04-desktop>
References: <29c7f6cd166d5d3c0e9f64dc937e29dc7ecf3f2d.1721933988.git.victorm.lira@amd.com> <68c3ac17-2ccb-40db-b105-712d444440c3@suse.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Fri, 26 Jul 2024, Jan Beulich wrote:
> On 25.07.2024 21:01, victorm.lira@amd.com wrote:
> > From: Victor Lira <victorm.lira@amd.com>
> > 
> > Requested-by: Jan Beulich <jbeulich@suse.com>
> > Signed-off-by: Victor Lira <victorm.lira@amd.com>
> 
> Looks okay to me now, just that I don't see ...
> 
> > --- /dev/null
> > +++ b/automation/eclair_analysis/linker-symbols.sh
> > @@ -0,0 +1,34 @@
> > +#!/bin/sh
> > +
> > +# Stop immediately if any executed command has exit status different from 0.
> > +set -e
> > +
> > +# Extract linker symbol names (except those starting with ".") from assignments.
> > +
> > +script_name=$(basename "$0")
> > +script_dir="$(
> > +  cd "$(dirname "$0")"
> > +  echo "${PWD}"
> > +)"
> > +src_dir="${script_dir}/../.."
> > +
> > +fatal() {
> > +  echo "${script_name}: $*" >&2
> > +  exit 1
> > +}
> > +
> > +usage() {
> > +  fatal "Usage: ${script_name} <arm|x86>"
> > +}
> > +
> > +if [ $# -ne 1 ]; then
> > +  usage
> > +fi
> > +
> > +filepath="${src_dir}/xen/arch/${1}/xen.lds"
> > +
> > +if [ ! -f "$filepath" ]; then
> > +  fatal "Could not find ${1} linker script. Must be run after arm/x86 build."
> 
> ... why you have "arm/x86" there when the message already includes ${1}.
> That'll simply go stale (and unnoticed) when PPC and/or RISC-V make further
> progress. Actually in usage() I'm similarly uncertain you want to mention
> the two architectures explicitly. Just say <arch> there? Happy to make
> adjustments while committing, so long as you agree.

I made the suggested changes on commit adding my R-b


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 01:13:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 01:13:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785351.1194808 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjTiZ-0002yg-NR; Thu, 29 Aug 2024 01:12:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785351.1194808; Thu, 29 Aug 2024 01:12:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjTiZ-0002yZ-KO; Thu, 29 Aug 2024 01:12:55 +0000
Received: by outflank-mailman (input) for mailman id 785351;
 Thu, 29 Aug 2024 01:12:54 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=N580=P4=amd.com=VictorM.Lira@srs-se1.protection.inumbo.net>)
 id 1sjTiY-0002yT-Cz
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 01:12:54 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on2062a.outbound.protection.outlook.com
 [2a01:111:f403:2414::62a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id d0436680-65a3-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 03:12:53 +0200 (CEST)
Received: from SJ2PR12MB8876.namprd12.prod.outlook.com (2603:10b6:a03:539::18)
 by DS7PR12MB6191.namprd12.prod.outlook.com (2603:10b6:8:98::21) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug
 2024 01:12:49 +0000
Received: from SJ2PR12MB8876.namprd12.prod.outlook.com
 ([fe80::69d9:a014:7a29:de4a]) by SJ2PR12MB8876.namprd12.prod.outlook.com
 ([fe80::69d9:a014:7a29:de4a%5]) with mapi id 15.20.7897.027; Thu, 29 Aug 2024
 01:12:49 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d0436680-65a3-11ef-a0b0-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Eg66WHJuH3lFr4odXsW/JUXJw/I8rVy3vRfCUd0w4J8ttuPN8Jo6w2CBZ/D6uFeKxwWpjMkm1hudffORO66AyrxmxTZ9gTeiA5mjZ5LDUtThsxrY/rScXnY5XqnHricIwl7LlktmAoR2ZAlBW2a4yvOEXu0ZniYByLigdi+RzubqRy0YEikkx8MinUHcSr3xtq6oTGkByqd0UiPlDQ/ZIwoK7xenmNcL+Rb4dMjiCK8w2GjXm803hvH1wit0G6vgqHXuhDCnbxG5EFcSLIU4mZdRx4LC2Z8hvEh5RUmzG7D+YuN3Cf5iIX8WSJrMGo1LLfjHWhYev8j7iARFeUN3xg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=yrIrLs/kUauWM077ChCd602fJVbM6WoSGrQ0TaHlR+0=;
 b=NWaa97XntQeOUo2nEN/2sHzvwg+L201KThXFM1d/e+Wzn/884da/Uh1WezKzsXO0LvaaUUCJyqixDIsrEbmI4FkzFnvifuMCpl0WuJXcYSlxXkhyckxnmUeev8iQKR3XkWLdE0u740AnRJTyfONi219e3x11qVd3TE63jymWUfoJuzjtf1ArLB/bvVvlvWV9V1xQEqFp5GXRACsLEmzU7jwLxB2rvLqTSdj+3g4uGLZWptDQwjM+JCQSBQaD1sKEuNTR0bbuZn9PWdJ8q1NJQH48OKrdVbQleFfudrI5pIg+fIa4Z6JfRjVMCGPWZRznWXv0NWANyKybVNgugamLAw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=yrIrLs/kUauWM077ChCd602fJVbM6WoSGrQ0TaHlR+0=;
 b=mXFamvGzz+y2mU4lV71gEcLz1hBzlX9ReOOEYqT3MaWk6kgOP54X0WohzhN2kcwXycU0REzMGu6xxS/GTh/Afdg5DKKCLK7L0B5qGU8S2nEbFeqequFQRzOliBwPxSepLhKOv+sTKiDOs8Fuy667DZ5wgAK5349lhdftH4Up5m0=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <b2ffadd6-8a72-43e5-b4df-7291d535141c@amd.com>
Date: Wed, 28 Aug 2024 18:12:45 -0700
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1] automation: update xilinx tests to use expect
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org
References: <fbda01cf915786ac7d51f9dc98489eed088a0433.1724719426.git.victorm.lira@amd.com>
 <alpine.DEB.2.22.394.2408281718580.53815@ubuntu-linux-20-04-desktop>
Content-Language: en-US
From: "Lira, Victor M" <VictorM.Lira@amd.com>
In-Reply-To: <alpine.DEB.2.22.394.2408281718580.53815@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: BN0PR04CA0116.namprd04.prod.outlook.com
 (2603:10b6:408:ec::31) To SJ2PR12MB8876.namprd12.prod.outlook.com
 (2603:10b6:a03:539::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ2PR12MB8876:EE_|DS7PR12MB6191:EE_
X-MS-Office365-Filtering-Correlation-Id: 8eeb298f-be8a-4474-07b0-08dcc7c7b28d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?bWRiTGlDdUxUZU1LUWJuWXFMU0ZsZUVTOHFTVzNqb1VRb211YUMraDFOZmZG?=
 =?utf-8?B?WkhVaDk2ZVh3a0FLYm04U01qNWdiUnRSUG53aUNRYlN0emhyTTJEOVVFTDhT?=
 =?utf-8?B?cG10NFA5OWpvei9wY1psYndXWXFoK0JVRlFOa3JRUDlBMDExR0h4UzFnVlZx?=
 =?utf-8?B?ZnY3M0p3aEFhRVV3UzBqUGZrRncxTUFDUU9KMEhQOWNibzVqZVRkNDkveXBl?=
 =?utf-8?B?TmRKMEM4VGpwU1cvTWxWaTJKVjNrcVZVYWhLeWVUNmduazF1TnZ5ZVI2dUlr?=
 =?utf-8?B?WGhIUVZaT2dlRUNPVWVNYkhyUWxzMmRsVFpSbzNveVc2ellDamJwcUJwMWRZ?=
 =?utf-8?B?TkZEaDBQRm91UG9sY21IRzFDL2tQSlZ3TzVEVEhMM25OKzdkNUpxbEdkQVpE?=
 =?utf-8?B?cVYrazhuQ1ZnWlJzOTNkRjUxMENxNXE4UnEwTDlNUXUzVnRTZlZlWmFOT0ti?=
 =?utf-8?B?Z256N0VGWFJlZFpMUDZOY1VsS0NzOElHcmpmYmgvS25uMjNTejFzcVZxL3hj?=
 =?utf-8?B?NkJRcGoxbFJ3bEVSWDZWekh5b1JQTXBSTi8zVVdCYkRrRHNxcTRlcElwcTIx?=
 =?utf-8?B?VDBJYW5BNkRhVW5mMm1vRW5pTExYSUFIOFk4eXc4bk9UUW14ejFtTEVHcTRa?=
 =?utf-8?B?SzFSbkdlWis3dFQ0RS80aDJvcDBOQ1RGVWV1UGpVWG1PNDJ1dVFkSVJPQURC?=
 =?utf-8?B?dWRoQ3RheEZzei96WUNERDFtQ2ZKNzc4RTFVQ3ROdjlLcjBLcTRLSEFKV1ZY?=
 =?utf-8?B?c3pLT08xOStTVEVFR3U2eGdBQmdkV0xHWUV0UW45bEkwZ2oyaHc3Q0Z5MHB6?=
 =?utf-8?B?VWwxSC91aUllZ2FqSjVmRnUrVFMzMVlKYWV2a0h1UEpSQnBmTVJOTnUxNng5?=
 =?utf-8?B?a2lBSW1aNVplV3BXYnFlUVpzd3J3WFNlM2h1S1hrandmK2h5RzdJVUNuMFNi?=
 =?utf-8?B?emZKNTh2ajh5TVJOUzZhb3lMemVvcmtWUHdqUXNNWlVCWURJenBndmhLMWVm?=
 =?utf-8?B?Q3JXY1Y1U1M2SU0yTUhvSmZuRG0yYjI5c0wvRVkvQk01aFg0bVI0TkxGNDEz?=
 =?utf-8?B?MG5uOVdLUStTSk81ajNxWmsrODRlcWFsRjJWNUd6S2cwSXlvMzJ4d2dSN3JQ?=
 =?utf-8?B?Rm15cXBTckp4MGVkekFIS2Frb1JjdUtLdnBsdTJoVXJCQVpnZ3FPcEI0bkxw?=
 =?utf-8?B?cHVlWGpZMUprZGszREIyeUpiRTZoa1ZLNVlaWklHK1JJK2N5clBMWHU1MFFh?=
 =?utf-8?B?YTc1bWhnRVdhcHNDOXpraGJQUDEyWHh0MTZ0MTMwYUhwQXk0aklmQkYvOVJ4?=
 =?utf-8?B?bElndk9vUVI2ZkNrZ1JMblpaVjdwb0ZDS2pjT0hma20vd3BmbzE3MkgvM240?=
 =?utf-8?B?bFg5emNiVHU4dFdTWUlnSUdPS0hyZElXK1FRZnhQVVQ2Yk5wYkQ4WUVRaUJT?=
 =?utf-8?B?M2NjdkF3TEdmUktockZ1QzljU2lkRVRsc3h1THQ5eElDa2ZPaU5lSDBneW0y?=
 =?utf-8?B?ekxOYVA4MjNWdCt5RjBqN283OTVnNHFlaWliNUVzRzBRNHk2ZjZ1N1F5cUJO?=
 =?utf-8?B?OG1PY213TERtaTRnY2NSMUgvaTdxdVVMWURZSEtBVHdIOGRWTzQ5TUg1anY1?=
 =?utf-8?B?dzQrRGtESk1Dd1ZwQUpHZVBhTEJUclN2S1llM00xRklqOURaSE53dkRzdTZN?=
 =?utf-8?B?cVE4TDE4L2I2cTdMNTRNMlFnUWNQSURLTVZnNDN1L2duRXlWNWV6aFllNHlq?=
 =?utf-8?B?Wkg3cUNnVUlLdUFFTGs2dHY0ci9VYm1HaE0vQmFhamFTYmZ1QklwU29PYXcw?=
 =?utf-8?B?SHBvekxOc3F6Rnk0MUZSZz09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR12MB8876.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MmQ1NXkxN0FRV0V2RWhaUXNkQmsza09UZFJrSUNNY1h2N1BLME5jUnp5RUl5?=
 =?utf-8?B?VmRHdTJydHljWW5hdjRmd0xrU3gvTlZrQUZSL1E2RU1mQlBRWUI1VUVDYmNt?=
 =?utf-8?B?aGFsM2JNQnpJSGxTNnp5aUlJUTFNUHZrSEEvV0FnTFNTb3VKZWRZcDdzQmhj?=
 =?utf-8?B?UnRjcjZqSGw3dXVRYWtjY2pVVk43WmdDdTB5dVo0T1pxOFRwdHp3R25EQnRa?=
 =?utf-8?B?c1Q4SnB5a0p5eG1NdXQ5RVZpTmFBMW5kTHZTZnE1TU9YQzNhR0YydXczbTZT?=
 =?utf-8?B?UHl4RXczUkVuWDl3N29RY0VIdnRjNStqRU8rTnRwMzZkTk1JTDJSNXFDaC9a?=
 =?utf-8?B?d3pzdmMydkJUWS9vdEhBU1hZczdCdTh3d0xVelNjR1BEWk5LZUhkdTQvMFVI?=
 =?utf-8?B?elk5MEtQTTMzM3FoalZ6QkJTMXYwYWtZc1UvY29Na3VVS1Jqd2cvVmZ2NFRo?=
 =?utf-8?B?Szd5SVhzRFAyNkUyWlZncnpmK3hpVUpJUVBxSUpkMHU0ZHMvbzNFNmR4V0lV?=
 =?utf-8?B?ay9VcnBacUFKbFd2TUxoeHJtempRL0NWekJva2dqemdIaG5SaExOUE9vNVl0?=
 =?utf-8?B?MjZRc0Ntbko3M0t6SjVCSHdtbFA2Y2tRR1J6MnNBL1lwQjRPdzB6THUxSTRD?=
 =?utf-8?B?M1QzRzNpL3FsT0sydzVaQ0hNUW5IblJEbTQ1ODBiSVhwT2ZCS3RiMWo1eEVr?=
 =?utf-8?B?aXlkTlNHaEZlTUFhRmRYTWtaWjM1ZlJzMDBSazN2Y3loVUpOZTV6MlVZWTNX?=
 =?utf-8?B?RU54RG8wb29MeSsyaG5sYk50ZGlseExGZEFLelJNbmxKVGlHMDRJWTZnUFgy?=
 =?utf-8?B?eFVVditFRFQ3Qlh4YWhPTytpRG1VWEFLeUZBaHQxMU5zRWJBUUwyVU9Ucjlv?=
 =?utf-8?B?K1duQzU1MDdKTXk4UFpHV3NRQWxYY3BCUmpUQm1pcWJqelZBNWoxanFsTzgz?=
 =?utf-8?B?OWx5V254TkpxRytzbkM4Z2pKVEtVOUxmSlFYcUl0YWV1V3lhRGlMTnA2bmNr?=
 =?utf-8?B?ZjltMlp2SnJlYVRBTTFQMmJNMmUwenozc0ZCYWZxZ1pqSDVmeFVZN1NVa0lX?=
 =?utf-8?B?bllBaE4rd0tFRURNNXErV3JiTkpIaDh6UytBUGdadDdtSStuYmlrbkJqc0NW?=
 =?utf-8?B?ZndVNStaRUJyYWVzTWpvYVEvNlBtYTM0MFlBczNmTGdQUWkxSVA1TXhJYmM2?=
 =?utf-8?B?ejQ2T1grclJSWE0wbWd4MnJDZy9pQzVFTTFHY1htQ0tVZU9ua0krUndIS1Uz?=
 =?utf-8?B?TStrV3ZGcmg4eVlidFNuZTdQRWVLa2hkbzJVMi82SDlHU0g1UEVjVU5wcVFL?=
 =?utf-8?B?ZmRxNFpOMmJQaU95V0c5YnRoWmRwVVhId29kQzdEdndybXB4TFROcEx2bUpR?=
 =?utf-8?B?TGg3NExaa2ZrVHhWa2R3d3VZaFRSR3cwZVQ2L1RJWEI2SlJObm5lRGhEUXdO?=
 =?utf-8?B?RlVGcTNqQXYyUkdIOURIN2krdnM5K2lNL0x3aWZOTFhsSVAva0Z6V2dnci9I?=
 =?utf-8?B?VHZuWHluTG14VnpiOEpBQmxQakVpYWFXazFNWnhiTkJodkx2T05XSkFsekcw?=
 =?utf-8?B?TElWTHZEVCt2czlMcGlGVVN2MWlvQU4zSzdHMEFpVUliNHVWaDVMWTZ3Q2t1?=
 =?utf-8?B?VkprL2c4ZjcwZVl2aFlqMXVlRmd3WEE4a2FUMWNxellqSHlzSGRpVGdzYWhn?=
 =?utf-8?B?ODJnKysyK3FGNlpSWFdFY2xxZE91N1ZTSGU2MitaY21pZ1Z3NTl3c1RKcHBG?=
 =?utf-8?B?TGNKK0piODQwTHVFTExLTVVCZCtZbW5xY2xqQnpvOXV0Myt6SnBRaWRyVkdw?=
 =?utf-8?B?SElnQjJTKzR1T3pMbHFBOEZNRlBobHFtaEM4YW1ua3I4S3FmMlpEUUVudU9a?=
 =?utf-8?B?VjFMeFYwdGtVU1Fma1dWV2x6UWtpblNxUHVwUUJaeXlRZGhJTnBRVndKWGVF?=
 =?utf-8?B?TjlsbW5MMTNYZnJlb0JJZnJKb2VsTGpMeU94YnoySi9RaHFnRmNlbXVjb1ds?=
 =?utf-8?B?eTA3dnkzczBiRGttZFFicjRkYTh4MiswSWxmdks3aWg3TDV6NGljRE5BVHBE?=
 =?utf-8?B?QS9UTkl0V2o4RnFyRUJYVmhnNGdOb0NIZXJGcm1JdEx0Y2ZGbmZIaVc1c3dQ?=
 =?utf-8?Q?ys02tnDfBonuU9TBNCrjYS+F4?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 8eeb298f-be8a-4474-07b0-08dcc7c7b28d
X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8876.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 01:12:48.9278
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: fBoQHE9Q9sG5mhbuDZCDK6vFm9Lguyi2CfV1cXAHhmtmK8Qp025UeA3FZSL2Uis69YOucb90o++NXfgt7a6A4Q==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6191


On 8/28/2024 5:25 PM, Stefano Stabellini wrote:
>>   xilinx-smoke-dom0-x86_64-gcc-debug:
>>     extends: .xilinx-x86_64
>> +  variables:
>> +    TEST_TIMEOUT: 500
> I think we need to add something similar for .xilinx-arm64
> The timeout should be set in test.yaml otherwise we'll default to 1500
I will add the missing variable.
>> t TEST_LOGFILE="smoke.serial"
>> +mkfifo console
>> +sed 's/\r\+$//' < console &
>> +./automation/scripts/console.exp > console
>> +TEST_RESULT=$?
>> +sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
>> +exit ${TEST_RESULT}
> Isn't this sufficient? Why do we need the fifo?
>
> export TEST_PASS_MSG="${PASS_MSG}"
> export TEST_CMD_START="cat ${SERIAL_DEV}"
> export TEST_LOGFILE="smoke.serial"
> ./automation/scripts/console.exp | sed 's/\r//'
> TEST_RESULT=$?
> sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
> exit ${TEST_RESULT}

In the line
	./automation/scripts/console.exp | sed 's/\r//'

The exit status gets set to that of "sed" instead of "console.exp", and it could
produce a false result. This was one way to achieve the result while avoiding bash-isms.


Victor



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 02:29:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 02:29:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785361.1194818 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjUuX-0007wc-0Z; Thu, 29 Aug 2024 02:29:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785361.1194818; Thu, 29 Aug 2024 02:29:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjUuW-0007wV-Tv; Thu, 29 Aug 2024 02:29:20 +0000
Received: by outflank-mailman (input) for mailman id 785361;
 Thu, 29 Aug 2024 02:29:19 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjUuV-0007wL-2k; Thu, 29 Aug 2024 02:29:19 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjUuU-0008O7-Qk; Thu, 29 Aug 2024 02:29:18 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjUuU-0000bb-EM; Thu, 29 Aug 2024 02:29:18 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjUuU-0002E4-Dq; Thu, 29 Aug 2024 02:29:18 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=2ljJM7zGKzZYYc7PA6lO+xFey1xHqJ0/oZNqfpVmz/0=; b=6FkayGIntAl2asG/rLGuG40GCx
	Zy65rJ+2saWHlxmdG3dq7KTYocvOetsCFPZsLivI6Q/APQ5PRBKUszqLTn5SHMeaH1wWtO5ExFuRw
	2SG1w1E1ElJEFnhyg8yNlTTPC7qX943RAboafTw9yf6U3a4DZTdA5FSd40dwlbOMxecY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187391-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187391: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=41a51d173557350ec8bcf64075a3e97730bf70dd
X-Osstest-Versions-That:
    ovmf=7cde720e5126a47dadfb63ec9fd11b637620102d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 29 Aug 2024 02:29:18 +0000

flight 187391 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187391/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 41a51d173557350ec8bcf64075a3e97730bf70dd
baseline version:
 ovmf                 7cde720e5126a47dadfb63ec9fd11b637620102d

Last test of basis   187389  2024-08-28 21:41:28 Z    0 days
Testing same since   187391  2024-08-29 00:11:30 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Nhi Pham <nhi@os.amperecomputing.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   7cde720e51..41a51d1735  41a51d173557350ec8bcf64075a3e97730bf70dd -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 04:00:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 04:00:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785390.1194828 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjWKJ-0006A5-9Q; Thu, 29 Aug 2024 04:00:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785390.1194828; Thu, 29 Aug 2024 04:00:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjWKJ-00069a-6H; Thu, 29 Aug 2024 04:00:03 +0000
Received: by outflank-mailman (input) for mailman id 785390;
 Thu, 29 Aug 2024 04:00:02 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjWKI-0005xC-8N; Thu, 29 Aug 2024 04:00:02 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjWKH-0001ZF-TO; Thu, 29 Aug 2024 04:00:01 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjWKH-0003Yv-KJ; Thu, 29 Aug 2024 04:00:01 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjWKH-00012u-Jj; Thu, 29 Aug 2024 04:00:01 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=QmPMO+HahwL8XPoGXOBznN4TSBBbRuQeTRYzBHNSo3k=; b=ZiV4xDEWRP5j0iohenL+NAobOP
	skAMlCQNLoUh1CMR81loHyuVbD4suDY40Z4lEkWme+ej6dF3czOyhPzEBRA+fJkPXE2/weBt1VAy/
	oOpAH44DCIUZUy4oFjd0GLtF2bFSzKh3g/bw40kJmMSvNV/MkbmuwMkKNAtY2RMQSstU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187393-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187393: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=383f729ac096b8deb279933fce86e83a5f7f5ec7
X-Osstest-Versions-That:
    ovmf=41a51d173557350ec8bcf64075a3e97730bf70dd
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 29 Aug 2024 04:00:01 +0000

flight 187393 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187393/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 383f729ac096b8deb279933fce86e83a5f7f5ec7
baseline version:
 ovmf                 41a51d173557350ec8bcf64075a3e97730bf70dd

Last test of basis   187391  2024-08-29 00:11:30 Z    0 days
Testing same since   187393  2024-08-29 02:31:47 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Ceping Sun <cepingx.sun@intel.com>
  Michael G.A. Holland <michael.holland@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   41a51d1735..383f729ac0  383f729ac096b8deb279933fce86e83a5f7f5ec7 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 04:14:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 04:14:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785401.1194838 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjWY1-0000T9-L0; Thu, 29 Aug 2024 04:14:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785401.1194838; Thu, 29 Aug 2024 04:14:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjWY1-0000Sy-Gl; Thu, 29 Aug 2024 04:14:13 +0000
Received: by outflank-mailman (input) for mailman id 785401;
 Thu, 29 Aug 2024 04:14:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=N580=P4=amd.com=VictorM.Lira@srs-se1.protection.inumbo.net>)
 id 1sjWY0-0000SB-EZ
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 04:14:12 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on20620.outbound.protection.outlook.com
 [2a01:111:f403:2415::620])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 236fd54b-65bd-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 06:14:10 +0200 (CEST)
Received: from BYAPR11CA0089.namprd11.prod.outlook.com (2603:10b6:a03:f4::30)
 by PH7PR12MB5685.namprd12.prod.outlook.com (2603:10b6:510:13c::22)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Thu, 29 Aug
 2024 04:14:04 +0000
Received: from SJ5PEPF000001F3.namprd05.prod.outlook.com
 (2603:10b6:a03:f4:cafe::f1) by BYAPR11CA0089.outlook.office365.com
 (2603:10b6:a03:f4::30) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend
 Transport; Thu, 29 Aug 2024 04:14:04 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SJ5PEPF000001F3.mail.protection.outlook.com (10.167.242.71) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 04:14:03 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 28 Aug
 2024 23:13:44 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 28 Aug
 2024 23:13:26 -0500
Received: from xsjwoods50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend
 Transport; Wed, 28 Aug 2024 23:13:25 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 236fd54b-65bd-11ef-a0b0-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Z37Za/hRhn/OhK8mFRWlE3da3+uSevcl2wVNMacwg2dyrUtjOPwLPAx1p85FodKHH0xkAyPuEoL1TLlwCupztGCojBY410ORRWyUZhAnAxJqzs0KaiCUxLcZYd+aMFjvralXX7jMtFQq1Raa1XPKrM8gRQj1xqN/uJW4SZgS+2mdGrIgoUNDiAdbLAW8PhfaCkfG+qX+BI/x92pVP6uK4l3r95FJ/8Y1Qdh0Kyj6ge/Xq/ZF7Zbui+qsc7V+5GU/dzJqAzTOmd05Z9GkI1nZK19KGox9+sfFc9mx5yDNYOnPZ83bTFO4VL8XxMDhi/ifSQ1grfTeXSGvXla+v2gBgw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=/ROK+JzG6w0la5ILJ3khYDvH0QlaEN7IBcIWNfYChCs=;
 b=XjrU/K8mhIF5nwn9a093gKcgAQ7DkuIew3VlvjiTs2acfKPAXgCAu++lGAp+/ZAQJM9AKW72MUxlfOts1tlRHSb5mw7S1BHLK9twF4QXEa5l6TrulHBe+iVGhELaiV8xtlD1dyiA9l+7c9PBnnytSdEQjjwiu7QGYuzNyGKwvw+XHJJDb3h3jPwyGnKIE77ufHEi++eqWY9yYWVXQosPfuxYmIv6fL40HkxNbIZ5ysOAauELi6PMvmgj6B9gTnDLwWECG/l/UFywwNtk6JmDgHraXBQGrhkqrOJSe6zPJyok4iwAT1c5aj36Bk5iiPeTPVdSNYRazwmtMu2ARxU2OA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=/ROK+JzG6w0la5ILJ3khYDvH0QlaEN7IBcIWNfYChCs=;
 b=H2FJTh6b3l3aMQYCS0EBx89ItSwSvSzpTRvbCtjaA4KnWQFdbAoxnNg16QSy8Rdl2QUow3JBcwKb7Laz5vRqCCREOx8jpE81IoNfmesFl1vUxeuSP4FEDKDKDvjjUjIb9iIDREdZej0WQEhchLN/a0nd+Cm9/Xhlzhcc06S19E4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: <victorm.lira@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Victor Lira <victorm.lira@amd.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
Subject: [PATCH v1] automation: fix false success in qemu tests
Date: Wed, 28 Aug 2024 21:09:14 -0700
Message-ID: <e4de45759723b28713ef205335c4d79b9e7074b7.1724904269.git.victorm.lira@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ5PEPF000001F3:EE_|PH7PR12MB5685:EE_
X-MS-Office365-Filtering-Correlation-Id: 70d1585d-cd37-4246-2899-08dcc7e1046a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|36860700013|82310400026|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?U4cctDlujQrTipXbeoMokPNTmxk0JJRktgc2Jd5rKDVZ+AHWp/Zws7yqfz9s?=
 =?us-ascii?Q?TqQszxvk0LzRhVRRYqqGFy7zKoe0eadb2eZKYJWtrEu5nnyLRUdaATyvshvC?=
 =?us-ascii?Q?KOQxWVcG0oHHJqcs/9L6SGG6SCZLtD622Hx2dVoQACZg3EqyLN/drtf8OWMX?=
 =?us-ascii?Q?MQi9mSgthwqcSYKpmmnYZ5RYJtXH/rSMzYe6KhxgKNVb6wEmBVzuh/u0ric2?=
 =?us-ascii?Q?jsjmnapV3XVcH5oAQtxErIGRaLkfiJd7vU/ehRP9essVDEEUJF5eaw9RJTgZ?=
 =?us-ascii?Q?Sv40PqlxSFcT8euIjB18A0/Bg1AMhd0yHrYFPvtYhZYCDQlVHNUSJ0LsfbP7?=
 =?us-ascii?Q?HPImX5Hf4suSQ6AuDuv/fk6CXxH79+zQmC3FVRIVaCpQ9p5N/1CKrLrXIXkq?=
 =?us-ascii?Q?pVCVW//vT9ZaKp/pJglAwO37HOFoWKNQMCc6tbLLVuQcXmQO7+vWIVC2VXvJ?=
 =?us-ascii?Q?A94QEeNxv1aJTzIkMVV2Lo+DNY7zOi9PKCsOBCxqbFg4Jg1CNIbykcJ9VToj?=
 =?us-ascii?Q?AIp3Qd2CNJ+TXyb4W8U6eI+NoF5i5LXO4ky7A6t9jBYnDnjJUb+jeJbCxTWQ?=
 =?us-ascii?Q?dWtoyOx3pweIBG7u9M0cagumqT2RxxKPfiAeLi1giTJUrxQJnokHaU3CgHog?=
 =?us-ascii?Q?drHiyD03Htb85cCXFMruObXKMRk0qcHeRY6fMc2IMqyVfC730qDpbH2G9Bb/?=
 =?us-ascii?Q?cceVldG2KjpqrsYvOwgp0WxJbi/pRbGZTLc7UAuAzPhRHAZe+XWN4XsVoMyn?=
 =?us-ascii?Q?yzVw22kCQ1ZZp0LIAOlyc51GPJopFyuvoLY8Yjr4ZeBPNDUNYa0sYbSAk+I8?=
 =?us-ascii?Q?FYGmz4XTrSWJVeAsuwS1iABUDPhJSeYjyyAEnDQNHl6y/meNslyfVsQfr0HC?=
 =?us-ascii?Q?QDsiKKOn99YK3Dr6dh1MlHuXjCitti95XFSmZpJknWnzOfFhuUOBOqQB0/SO?=
 =?us-ascii?Q?h0exZBx8XLdeeAaD3kQbb+Va2kWy3Ou8UlRTnwbP8l7V51I3JFi9B6fPQkvM?=
 =?us-ascii?Q?7nX5wY4GZl1NNj1Qe8dNP5cUJ/wqCPOXI0q1QwmZonwAEC7lGe7uuLdfwlfa?=
 =?us-ascii?Q?jdnN3LF2/YGHn/DCHSoLxfG8+8CT1AjCCH2xF/WiIZECnOI+6LF0dkNsfHI9?=
 =?us-ascii?Q?KUhlTDAHFkSmtC521G5RwdNi2O6WyTAx8Y8V9pNJf7pMIvYVcljVzeWB65nM?=
 =?us-ascii?Q?a+Wcqf0Kd0hRaflhBvSjttNQWgD0qUODTnvzu0upz6O3z1ZvyExlwa2vOEpG?=
 =?us-ascii?Q?K9s9fzdzMaS2NNROGyaLcNPSzAU1JkhnuQvtwF1baxJ+qwyFrvmwNMtrmhlO?=
 =?us-ascii?Q?fQofHeWtSeoe/sb8w/ySjmDE8Rou/fCTUwWrpjr0tnvNuLIaYexXnLjofQdj?=
 =?us-ascii?Q?JBbapGRKaetoIF55AK7Jdc7EpktQ4FC5N5M19bpQD5M0dMPc6jLRbep2h9VK?=
 =?us-ascii?Q?McgfhUuEqu970wbb1LkI0oxEFDQa+E4S?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700013)(82310400026)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 04:14:03.2277
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 70d1585d-cd37-4246-2899-08dcc7e1046a
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SJ5PEPF000001F3.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5685

From: Victor Lira <victorm.lira@amd.com>

Fix flaw in qemu-*.sh tests that producess a false success. The following
lines produces success despite the "expect" script producing nonzero exit
status.

    set +e
...
    ./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
    (end of file)

The "set +e" is sometimes needed for cleanup such as powering off hardware
after running a test.

Fixes the CI failure introduced by 95764a0817.

Update xilinx-smoke tests to use the "expect" utility for early exit from
tests. Generalize the variable names in the script "qemu-key.exp" to be
used by both QEMU and hardware tests. Add a missing "-continue_timer" flag
for the expect script to properly time out. Add "expect" to xilinx
dockerfile.

Signed-off-by: Victor Lira <victorm.lira@amd.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Julien Grall <julien@xen.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org
---
 .../build/ubuntu/xenial-xilinx.dockerfile     |  1 +
 automation/gitlab-ci/test.yaml                |  2 ++
 .../scripts/{qemu-key.exp => console.exp}     | 27 +++++++++++--------
 automation/scripts/qemu-alpine-x86_64.sh      | 13 ++++++---
 automation/scripts/qemu-smoke-dom0-arm32.sh   | 15 +++++++----
 automation/scripts/qemu-smoke-dom0-arm64.sh   | 15 +++++++----
 .../scripts/qemu-smoke-dom0less-arm32.sh      | 15 +++++++----
 .../scripts/qemu-smoke-dom0less-arm64.sh      | 15 +++++++----
 automation/scripts/qemu-smoke-ppc64le.sh      | 13 ++++++---
 automation/scripts/qemu-smoke-riscv64.sh      | 13 ++++++---
 automation/scripts/qemu-smoke-x86-64.sh       | 13 ++++++---
 automation/scripts/qemu-xtf-dom0less-arm64.sh | 13 ++++++---
 .../scripts/xilinx-smoke-dom0-x86_64.sh       | 22 +++++++--------
 .../scripts/xilinx-smoke-dom0less-arm64.sh    | 21 ++++++++-------
 14 files changed, 127 insertions(+), 71 deletions(-)
 rename automation/scripts/{qemu-key.exp => console.exp} (50%)

diff --git a/automation/build/ubuntu/xenial-xilinx.dockerfile b/automation/build/ubuntu/xenial-xilinx.dockerfile
index f03d62e8bd..6107d8b771 100644
--- a/automation/build/ubuntu/xenial-xilinx.dockerfile
+++ b/automation/build/ubuntu/xenial-xilinx.dockerfile
@@ -20,6 +20,7 @@ RUN apt-get update && \
         git \
         gzip \
         file \
+        expect \
         && \
         apt-get autoremove -y && \
         apt-get clean && \
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 3b339f387f..e3ebe37459 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -84,6 +84,7 @@
   variables:
     CONTAINER: ubuntu:xenial-xilinx
     LOGFILE: qemu-smoke-xilinx.log
+    TEST_TIMEOUT: 120
   artifacts:
     paths:
       - smoke.serial
@@ -103,6 +104,7 @@
     LOGFILE: xilinx-smoke-x86_64.log
     XEN_CMD_CONSOLE: "console=com2 com2=115200,8n1,0x2F8,4"
     TEST_BOARD: "crater"
+    TEST_TIMEOUT: 500
   artifacts:
     paths:
       - smoke.serial
diff --git a/automation/scripts/qemu-key.exp b/automation/scripts/console.exp
similarity index 50%
rename from automation/scripts/qemu-key.exp
rename to automation/scripts/console.exp
index 787f1f08cb..2cf31e7ac0 100755
--- a/automation/scripts/qemu-key.exp
+++ b/automation/scripts/console.exp
@@ -1,23 +1,29 @@
 #!/usr/bin/expect -f

-if {[info exists env(QEMU_TIMEOUT)]} {
-    set timeout $env(QEMU_TIMEOUT)
+if {[info exists env(TEST_TIMEOUT)]} {
+    set timeout $env(TEST_TIMEOUT)
 } else {
     set timeout 1500
 }

-log_file -a $env(QEMU_LOG)
+log_file -a $env(TEST_LOGFILE)

 match_max 10000

-eval spawn $env(QEMU_CMD)
+eval spawn $env(TEST_CMD_START)

 expect_after {
     -re "(.*)\r" {
-        exp_continue
+        exp_continue -continue_timer
+    }
+    timeout {
+        send_error "ERROR-Timeout!\n"
+        exit 1
+    }
+    eof {
+        send_error "ERROR-EOF!\n"
+        exit 1
     }
-    timeout {send_error "ERROR-Timeout!\n"; exit 1}
-    eof {send_error "ERROR-EOF!\n"; exit 1}
 }

 if {[info exists env(UBOOT_CMD)]} {
@@ -28,22 +34,21 @@ if {[info exists env(UBOOT_CMD)]} {

 if {[info exists env(LOG_MSG)]} {
     expect {
-        "$env(PASSED)" {
+        "$env(TEST_PASS_MSG)" {
             expect "$env(LOG_MSG)"
             exit 0
         }
         "$env(LOG_MSG)" {
-            expect "$env(PASSED)"
+            expect "$env(TEST_PASS_MSG)"
             exit 0
         }
     }
 }

 expect {
-    "$env(PASSED)" {
+    "$env(TEST_PASS_MSG)" {
         exit 0
     }
 }

 expect eof
-
diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 42a89e86b0..e9a1577af7 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -77,7 +77,7 @@ EOF
 # Run the test
 rm -f smoke.serial
 set +e
-export QEMU_CMD="qemu-system-x86_64 \
+export TEST_CMD_START="qemu-system-x86_64 \
     -cpu qemu64,+svm \
     -m 2G -smp 2 \
     -monitor none -serial stdio \
@@ -85,8 +85,13 @@ export QEMU_CMD="qemu-system-x86_64 \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0"

-export QEMU_LOG="smoke.serial"
+export TEST_LOGFILE="smoke.serial"
 export LOG_MSG="Domain-0"
-export PASSED="BusyBox"
+export TEST_PASS_MSG="BusyBox"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+# Capture test result using expect utility.
+rm -f console
+mkfifo console
+sed 's/\r\+$//' < console &
+./automation/scripts/console.exp > console
+exit $?
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index fd64b19358..dc2ed1f968 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -78,7 +78,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config

 rm -f ${serial_log}
 set +e
-export QEMU_CMD="./qemu-system-arm \
+export TEST_CMD_START="./qemu-system-arm \
    -machine virt \
    -machine virtualization=true \
    -smp 4 \
@@ -92,8 +92,13 @@ export QEMU_CMD="./qemu-system-arm \
    -bios /usr/lib/u-boot/qemu_arm/u-boot.bin"

 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="${serial_log}"
+export TEST_LOGFILE="${serial_log}"
 export LOG_MSG="Domain-0"
-export PASSED="/ #"
-
-../automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+export TEST_PASS_MSG="/ #"
+
+# Capture test result using expect utility.
+rm -f console
+mkfifo console
+sed 's/\r\+$//' < console &
+../automation/scripts/console.exp > console
+exit $?
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index e0cea742b0..8ecddae555 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -94,7 +94,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
 # Run the test
 rm -f smoke.serial
 set +e
-export QEMU_CMD="./binaries/qemu-system-aarch64 \
+export TEST_CMD_START="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
     -m 2048 -monitor none -serial stdio \
@@ -105,8 +105,13 @@ export QEMU_CMD="./binaries/qemu-system-aarch64 \
     -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"

 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="smoke.serial"
+export TEST_LOGFILE="smoke.serial"
 export LOG_MSG="Domain-0"
-export PASSED="BusyBox"
-
-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+export TEST_PASS_MSG="BusyBox"
+
+# Capture test result using expect utility.
+rm -f console
+mkfifo console
+sed 's/\r\+$//' < console &
+./automation/scripts/console.exp > console
+exit $?
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index e824cb7c2a..2625efc163 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -131,7 +131,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
 # Run the test
 rm -f ${serial_log}
 set +e
-export QEMU_CMD="./qemu-system-arm \
+export TEST_CMD_START="./qemu-system-arm \
     -machine virt \
     -machine virtualization=true \
     -smp 4 \
@@ -145,8 +145,13 @@ export QEMU_CMD="./qemu-system-arm \
     -bios /usr/lib/u-boot/qemu_arm/u-boot.bin"

 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="${serial_log}"
+export TEST_LOGFILE="${serial_log}"
 export LOG_MSG="${dom0_prompt}"
-export PASSED="${passed}"
-
-../automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+export TEST_PASS_MSG="${passed}"
+
+# Capture test result using expect utility.
+rm -f console
+mkfifo console
+sed 's/\r\+$//' < console &
+../automation/scripts/console.exp > console
+exit $?
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index f42ba5d196..a9ab92d8bf 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -205,7 +205,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
 # Run the test
 rm -f smoke.serial
 set +e
-export QEMU_CMD="./binaries/qemu-system-aarch64 \
+export TEST_CMD_START="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt,gic-version=$gic_version \
     -m 2048 -monitor none -serial stdio \
@@ -216,8 +216,13 @@ export QEMU_CMD="./binaries/qemu-system-aarch64 \
     -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"

 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="smoke.serial"
+export TEST_LOGFILE="smoke.serial"
 export LOG_MSG="Welcome to Alpine Linux"
-export PASSED="${passed}"
-
-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+export TEST_PASS_MSG="${passed}"
+
+# Capture test result using expect utility.
+rm -f console
+mkfifo console
+sed 's/\r\+$//' < console &
+./automation/scripts/console.exp > console
+exit $?
diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/scripts/qemu-smoke-ppc64le.sh
index 594f92c19c..74ffca00c6 100755
--- a/automation/scripts/qemu-smoke-ppc64le.sh
+++ b/automation/scripts/qemu-smoke-ppc64le.sh
@@ -11,7 +11,7 @@ machine=$1
 rm -f ${serial_log}
 set +e

-export QEMU_CMD="qemu-system-ppc64 \
+export TEST_CMD_START="qemu-system-ppc64 \
     -bios skiboot.lid \
     -M $machine \
     -m 2g \
@@ -22,7 +22,12 @@ export QEMU_CMD="qemu-system-ppc64 \
     -serial stdio \
     -kernel binaries/xen"

-export QEMU_LOG="${serial_log}"
-export PASSED="Hello, ppc64le!"
+export TEST_LOGFILE="${serial_log}"
+export TEST_PASS_MSG="Hello, ppc64le!"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+# Capture test result using expect utility.
+rm -f console
+mkfifo console
+sed 's/\r\+$//' < console &
+./automation/scripts/console.exp > console
+exit $?
diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
index c2595f657f..d1631b9633 100755
--- a/automation/scripts/qemu-smoke-riscv64.sh
+++ b/automation/scripts/qemu-smoke-riscv64.sh
@@ -6,14 +6,19 @@ set -ex
 rm -f smoke.serial
 set +e

-export QEMU_CMD="qemu-system-riscv64 \
+export TEST_CMD_START="qemu-system-riscv64 \
     -M virt \
     -smp 1 \
     -nographic \
     -m 2g \
     -kernel binaries/xen"

-export QEMU_LOG="smoke.serial"
-export PASSED="All set up"
+export TEST_LOGFILE="smoke.serial"
+export TEST_PASS_MSG="All set up"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+# Capture test result using expect utility.
+rm -f console
+mkfifo console
+sed 's/\r\+$//' < console &
+./automation/scripts/console.exp > console
+exit $?
diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
index 3440b1761d..1703b96e9e 100755
--- a/automation/scripts/qemu-smoke-x86-64.sh
+++ b/automation/scripts/qemu-smoke-x86-64.sh
@@ -16,12 +16,17 @@ esac

 rm -f smoke.serial
 set +e
-export QEMU_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
+export TEST_CMD_START="qemu-system-x86_64 -nographic -kernel binaries/xen \
         -initrd xtf/tests/example/$k \
         -append \"loglvl=all console=com1 noreboot console_timestamps=boot $extra\" \
         -m 512 -monitor none -serial stdio"

-export QEMU_LOG="smoke.serial"
-export PASSED="Test result: SUCCESS"
+export TEST_LOGFILE="smoke.serial"
+export TEST_PASS_MSG="Test result: SUCCESS"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+# Capture test result using expect utility.
+rm -f console
+mkfifo console
+sed 's/\r\+$//' < console &
+./automation/scripts/console.exp > console
+exit $?
diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
index 4042fe5060..77a46e3e79 100755
--- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
+++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
@@ -51,7 +51,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
 # Run the test
 rm -f smoke.serial
 set +e
-export QEMU_CMD="./binaries/qemu-system-aarch64 \
+export TEST_CMD_START="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
     -m 2048 -monitor none -serial stdio \
@@ -62,7 +62,12 @@ export QEMU_CMD="./binaries/qemu-system-aarch64 \
     -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"

 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="smoke.serial"
-export PASSED="${passed}"
+export TEST_LOGFILE="smoke.serial"
+export TEST_PASS_MSG="${passed}"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+# Capture test result using expect utility.
+rm -f console
+mkfifo console
+sed 's/\r\+$//' < console &
+./automation/scripts/console.exp > console
+exit $?
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 4559e2b9ee..14999956a8 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -27,7 +27,6 @@ memory = 512
 vif = [ "bridge=xenbr0", ]
 disk = [ ]
 '
-TIMEOUT_SECONDS=200

 # Select test variant.
 if [ "${TEST}" = "ping" ]; then
@@ -125,20 +124,21 @@ boot

 # Power cycle board and collect serial port output.
 SERIAL_DEV="/dev/serial/${TEST_BOARD}"
-SERIAL_CMD="cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"
 sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
 sleep 5
 sh /scratch/gitlab-runner/${TEST_BOARD}.sh 1
 sleep 5
 set +e
 stty -F ${SERIAL_DEV} 115200
-timeout -k 1 ${TIMEOUT_SECONDS} nohup sh -c "${SERIAL_CMD}"
-sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
-
-set -e
-
-if grep -q "${PASS_MSG}" smoke.serial; then
-    exit 0
-fi

-fatal "Test failed"
+# Capture the test result and power off board before exiting.
+export TEST_PASS_MSG="${PASS_MSG}"
+export TEST_CMD_START="cat ${SERIAL_DEV}"
+export TEST_LOGFILE="smoke.serial"
+rm -f console
+mkfifo console
+sed 's/\r\+$//' < console &
+./automation/scripts/console.exp > console
+TEST_RESULT=$?
+sh "/scratch/gitlab-runner/${TEST_BOARD}.sh" 2
+exit ${TEST_RESULT}
diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index 18aa07f0a2..a6ad37a887 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -137,13 +137,16 @@ cd $START
 SERIAL_DEV="/dev/serial/zynq"
 set +e
 stty -F ${SERIAL_DEV} 115200
-timeout -k 1 120 nohup sh -c "cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"

-# stop the board
-cd /scratch/gitlab-runner
-bash zcu102.sh 2
-cd $START
-
-set -e
-(grep -q "^Welcome to Alpine Linux" smoke.serial && grep -q "${passed}" smoke.serial) || exit 1
-exit 0
+# Capture the test result and power off board before exiting.
+export TEST_PASS_MSG="${passed}"
+export LOG_MSG="Welcome to Alpine Linux"
+export TEST_CMD_START="cat ${SERIAL_DEV}"
+export TEST_LOGFILE="smoke.serial"
+rm -f console
+mkfifo console
+sed 's/\r\+$//' < console &
+./automation/scripts/console.exp > console
+TEST_RESULT=$?
+sh /scratch/gitlab-runner/zcu102.sh 2
+exit ${TEST_RESULT}
--
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 04:18:23 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 04:18:23 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785408.1194848 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjWc2-0001dx-41; Thu, 29 Aug 2024 04:18:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785408.1194848; Thu, 29 Aug 2024 04:18:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjWc2-0001dq-1I; Thu, 29 Aug 2024 04:18:22 +0000
Received: by outflank-mailman (input) for mailman id 785408;
 Thu, 29 Aug 2024 04:18: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=N580=P4=amd.com=VictorM.Lira@srs-se1.protection.inumbo.net>)
 id 1sjWc0-0001dk-Fm
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 04:18:20 +0000
Received: from NAM12-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam12on20613.outbound.protection.outlook.com
 [2a01:111:f403:200a::613])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b7cc3d75-65bd-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 06:18:19 +0200 (CEST)
Received: from SJ2PR12MB8876.namprd12.prod.outlook.com (2603:10b6:a03:539::18)
 by DM3PR12MB9415.namprd12.prod.outlook.com (2603:10b6:8:1ac::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug
 2024 04:18:15 +0000
Received: from SJ2PR12MB8876.namprd12.prod.outlook.com
 ([fe80::69d9:a014:7a29:de4a]) by SJ2PR12MB8876.namprd12.prod.outlook.com
 ([fe80::69d9:a014:7a29:de4a%5]) with mapi id 15.20.7897.027; Thu, 29 Aug 2024
 04:18:15 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b7cc3d75-65bd-11ef-a0b0-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=QpX87+616XPT/uw3/Wa2fcjqSIicKhi6AAs/a/vNLhmFJbwpoDZYoBL/iYxXwM9mx4GnHGWSJz5OXM3wRQjMUf+0YxU75MCeaDYvVKrDqA/PLAk1eZlrvLKrUKJ3tCktQ3MeVE5V3X/QAEOj8ci+nMT/og0AQfcjchp25P5Yu6OB89L4RrLCDWVd8BUkYNkQ2n/FnHjX2DH9tRaeqWoAlnW1RZOvEnW9eau5PorNVNuUseioYGLwlKVxfj+UOSg67vN/ZZ0r67+AKYqXLwdeSdOMTTxhkp96Y031NjbR+aG8Y9KQq8enkq6pvn39DyRPFwSGr0LLjVf6ZhJKW7TbDQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=CuIZrbkzZ1dOSGUoyKupye1CIvOEvqvYkiVLKnr3yLA=;
 b=VwgNa56HuZepH8OHlA3oX3xJb7o6NlUVBHmTSeCPvFrqOIi0EGvIpX7al/zhzeOK8neDRkmxI16InOa1vIeVg3AvLqJ+j3TnAVcZN0Mlo2Y0ddkK1FCclbY7r7PZMsEKN3mjt28zCXBvlI/8+El0Nh/fpHFHQJuom87Ocjr5zgUYCwQVwAahkHS3X1+jfWA1cN72AKBA6hDw8gi2/EM3XpQ/B9CqqnJaNzLgpQd0Y/YIseVVR4nTiI+Eeq714ll3siLPtHBSYWogyseZ8c4RTMsNmuLcMYk9laMWCoVi1QtbxBPdlALEjBPQtYFqczKSUp6lQ02Qutiq9tS2KXu5NA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=CuIZrbkzZ1dOSGUoyKupye1CIvOEvqvYkiVLKnr3yLA=;
 b=zxzct24mHZX0bIaPAak6ARIunREKwVCtfdsYqaBd7zdaG57ujFTaF5hOv8rOasv9Qi9Q6yaFr9icsBsBYLxuktCRrS+ISUeuTZYEHTkRCMW6Ua4VCjHbugMJfqeD0bk6p2bjdFGXOGuXu9jjyJYdsUk71EdvLVIoOiEmA7aVZys=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <553b3468-39cd-4f10-8036-15726c5054e7@amd.com>
Date: Wed, 28 Aug 2024 21:18:12 -0700
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1] automation: fix false success in qemu tests
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
 <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <e4de45759723b28713ef205335c4d79b9e7074b7.1724904269.git.victorm.lira@amd.com>
Content-Language: en-US
From: "Lira, Victor M" <VictorM.Lira@amd.com>
In-Reply-To: <e4de45759723b28713ef205335c4d79b9e7074b7.1724904269.git.victorm.lira@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: SA0PR11CA0166.namprd11.prod.outlook.com
 (2603:10b6:806:1bb::21) To SJ2PR12MB8876.namprd12.prod.outlook.com
 (2603:10b6:a03:539::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ2PR12MB8876:EE_|DM3PR12MB9415:EE_
X-MS-Office365-Filtering-Correlation-Id: f577d0cd-ce61-4dae-7e5d-08dcc7e19a4d
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?MGlSVmxUSGRGV0Znb3plMzlOU2tXdCtKM1MyM3JPMCtnOW93dGc1cTNLeVl2?=
 =?utf-8?B?bS9RV3VIb2hZQjdxWDRzZC9nSDRkVml4Y2xXcVZYT1E2TGFHV3N0M215V1BD?=
 =?utf-8?B?MmVURDFNYzlmRVR5REJQNWZDRnl2Q1o0dU5TQ2RjOHdPMjBpMXB4QVJoZWZn?=
 =?utf-8?B?RVBMMVIyQUVMVCtaWnRtNnd3RHlVMHhxTGFxSFcyN3UxSStyRkVjY3JJNGFW?=
 =?utf-8?B?clBxTkxESThQcTZIdVhGU3JPWHhyYS9Lc2U5dS9VZStMYU9GMVJTVU05aDBT?=
 =?utf-8?B?MG8rNFF5VTU4aTlxNDRicmdGQ3JQNkFKYlpYWS9zR3VZL0pUaGZOb0ZTNFNr?=
 =?utf-8?B?ZEU0cXpibzhVM2I0VGJzc0txS0F5NDc1KzVJai9od2xZWUN4eEN2aTJQanY2?=
 =?utf-8?B?YTRQdjVmRDRpMFVaV0FnM1hjd0x5TC9UZGVLRTFQY3drTExoMThySGh1ZmhE?=
 =?utf-8?B?K3pUckJ0eUtvakx2eXIwT0tlbWF1eEVmM3dsNEJURFd4bURwZ3V5SnpoMW9M?=
 =?utf-8?B?SThLbG9yY3dpdDNNcnZoRThiaTBOZ0JBMldxbVpPTGlRVzNIR2ZFdEhpYzhO?=
 =?utf-8?B?QXI3R1VUVnRFQ0wvYUJxUUYwellGRENncVN5YmdDbXdIcEJjUlJ3VUN3d0Nv?=
 =?utf-8?B?OHR5YUtVbzNSS0NMQWhEQ240Yk4zemhXYUhHdXhibHQ0VVJic1oraEdIWDA0?=
 =?utf-8?B?c1Q1L2J4SVZTUjBGWXdaWmwwQWMrVHFtR0lHanFyakRoRi9EeE9sOUJLMUo1?=
 =?utf-8?B?UWgxazUwS0VHVGNySGxoWHdDNlNxSVNITGFpSmQzL05mVWJkTVdaNEkzenpv?=
 =?utf-8?B?T1BhN1ZpdzNwRjdWUUFBWldJem5ORGttMnJyNG9DZ3NjcVRkQWxoZlZnQlZJ?=
 =?utf-8?B?WUJ2bDY5SnU1bXBRb1I4MmxLN0xrMFdQdDByVUJLQ1kvd2NaamZCNGg1bGlz?=
 =?utf-8?B?cWU0SVBvSk42MkZIZ0c1RDJLNEZHMVJMUW9IRjRuMTRqeTFFVWJHUFVqbzBi?=
 =?utf-8?B?YURpc3U1M0NHTnFHM1NZNTB2dVgzVVhISnBIMkZsQjIxVFFtUnR3UTVoOG1P?=
 =?utf-8?B?dFdVcVRnYjQ1dnI1ZnBKTndMZGZMLzhHZHRlQTdpaWVHc2tkWlhnOURuZmRT?=
 =?utf-8?B?U3k5THlPaWk4ajNVY1g2dHNOaDBQdU1CZm1Qc0pFWEFncDRTMmxLK2w4bWVz?=
 =?utf-8?B?eUt3dkJaYll2dmpjTmpNNC9mVVdES25FSm9xZjlqdW5aTXNwWlhjQ3VZRzYv?=
 =?utf-8?B?bzEwZUtSelhLS2NqZ2dWclkvc2Q0eWd0QTNlZTRseEszNm5Kd2JxeGptNDda?=
 =?utf-8?B?MWdPU3RMcFUreHBBSVV4emdWVVMwSGxsS21COUh6RlZQazIvTTM5dzZQZU4w?=
 =?utf-8?B?YWJIdnVSUjFLZHJTM29vbzVSbGwybmRmWkJ1WGx0Q0h4Z3V0Zjk5TVdwd2Vx?=
 =?utf-8?B?RE5RbVRvUHhwVGNUZi9kaVFpenNDU0VTYk01OW15OUk0SzE0SHZVYnQ4Qmg4?=
 =?utf-8?B?QXcxUERWaUNnRHdYUDdkangrSDhQbjNHaEZjdytkRkNqWlBIekgwT0lKbnpS?=
 =?utf-8?B?RUlSK25QTVk4MEJ6b3Rtc25ZYTdDNVdRbXZ1cndrSG45NHNINkFlWGZQQ1ZE?=
 =?utf-8?B?ZmZRQkw5MmpGRDFwSDZTYXgzRDlIKzFpb3dncVJrenVIZGIwSlNJSy9SMW1E?=
 =?utf-8?B?WXhVbnM4VkVrbVRJeU1PV0R0ZjRBcVAvd1NOZGVKamc5NDR4TlViblpMYkdG?=
 =?utf-8?Q?tu8Bbek/iqu+mQcCpU=3D?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR12MB8876.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?anIrdm1qRzJwcUFXY2dSRy9zbVRIRHFPd3hDdkp6Nk5mYnJEdDNBakh2Rkhq?=
 =?utf-8?B?d1hmYXFUbkpnR05jMVZWWnE2NnpRcXNTRXdHTndXRkR6YVgya0FFT28zNnJo?=
 =?utf-8?B?bVNBT1cvbXQ1QzhJQXhBNWNEd0FyWklPVzFoR3pGN1c4YzNMUGc2b1c3U2Rn?=
 =?utf-8?B?Y1ZmVEZ4NEpHdU9EVno5dC8wNm1WeGhwZ2pOdW8vcWhqcnNoVzJmYUVvclNL?=
 =?utf-8?B?UzA4RGxRRE5jOXpoZG5MbVoyaUN1aGZOc3UxZXRoejJ1ajMxNSswSnNPQmxI?=
 =?utf-8?B?MDh2cmVvNlp6bUVMVmVZQ2NXOEFlaE5oVWVsZk1wNk9hdFN0YW1vSnZXbW5C?=
 =?utf-8?B?YzEzdFhjTUl2VHhKemdERmY1UVZuVmpXWVRPbmxKdmJWNWpFZjBLTjRKQ1Q5?=
 =?utf-8?B?NVdmbm1ZTE51ZEt5WjR4bi9MbEtndjNISHBRRjRLc1RhWDcrYzdJb2hTc0hN?=
 =?utf-8?B?bm5sYk9DVGJDREhoYk42R0Q4QTdGSktadEZGL04zL0VSL0pGWTFSeHcxVnB3?=
 =?utf-8?B?N0RGeXNmdEJaM0N0UTJBMWpINGZ1all2VnVYM3FRT0pFUnRiZ1ZEbXZ3TmFN?=
 =?utf-8?B?WHplb3FNanJQaitPejR0NlZzc0ZqTWI0OHRDbHhOT3kwNlF2eHlUNVdGUWZH?=
 =?utf-8?B?aXkwN3E5SGVmc1o3NHpEQzRJMkJoc2VhMmY0cFVuNEc3eHBZeTZ4emJDdUcx?=
 =?utf-8?B?d05zMG83Z2lweVhiZ3NwYzIwRVBEc1BKNmxQLzl2V1Y2WjRwZDQ1WkZqY2lT?=
 =?utf-8?B?K1drNC9ua1VCR3VyQkhsM2FIakd3SHltUXlsUXkrR2JWbkliZHVQajd4S0NL?=
 =?utf-8?B?YlRYcnNqemdsQnJZejdCRkhPcXVFK2hFN1IrVTRYRVdZTk0xdDgvOEViNjhm?=
 =?utf-8?B?Sy9FaHVYeE9TMzFRemZrcHNVOWZ0QTBKdy9SUURuL0NreElXY2l1NmlhY3Ri?=
 =?utf-8?B?alNRU0hNbC9jeWhXQ0tnaC9Zb1hORnJyODJYdVp0SHMrT3dqanNTK3RnRnMv?=
 =?utf-8?B?TGExU3VqQ1ZXekZ5L2xOOFdsMXlVM3VXMk1pdXlZUEFacmJ2ZnRGYm4zN2VK?=
 =?utf-8?B?N0IwREUrY0p0TE1meHE0eVRBVXdBd3lLeTZxaWFXMTVTeHA1S1hKWjd5dVZG?=
 =?utf-8?B?YUsrZHY5OEFGTUgzcms0ZXBaZjZNRTg3ZUp6ZlBYZVdUSFlZM2VTWTBuUVVs?=
 =?utf-8?B?WSs0NUR4Q0tsT0JCUCtnTUdKOWVKbS9hM2k4WlNhOGY4Q2g2S0VNdk9SUWY0?=
 =?utf-8?B?ZDZWZUk5YjVobXF2cyt3QVJSaE5IOWUxZDB1TkcwcUZKMlAzU1kyZitwL2p0?=
 =?utf-8?B?c2l6SzZMR1UybU5PQ0Fab3FVZEFic3BDc2lSM0VldlJlQ1R5dzhXekZ3RHpO?=
 =?utf-8?B?VjFBYkZ5K21HbU9SZHUrUE9tRmZ2bEFMSXBKbEFEOHhCbitDUHE1VWQ1YVV0?=
 =?utf-8?B?ZDlZSmkrdVI5V0FDc3g0MEtmdHlXVHYvLzlGUnVVVFc0ZmNpdUw1VWRKY0g2?=
 =?utf-8?B?MWFpaHJhQ3prWFRIbno2M1VYblB4WS9iTVZyZUd3anVqWDB2cGVaR1JDRVY2?=
 =?utf-8?B?clVLdDN4bEdTanlLdzVpb2I3T1lSVnRXRk00WU5WWTVBSGU5S3AxUGl2N25x?=
 =?utf-8?B?cFR2N3Q2cHY0TEJ3NjNWdjRRTi9vVVNMb2dzSmF2Y3VzSjdkVGlaU1lCcG9H?=
 =?utf-8?B?MVEyaElqeVRucUIxOG0yb2E1aUVxNWNQbU9ab3oxOTdob0JIQ0p2SURidGpQ?=
 =?utf-8?B?YXVjSEFBVTdRdUhNZHV5a2xrRldBOVNhZGFPVlEyNWI1SzlhM0FOdW1OTmd3?=
 =?utf-8?B?ZDc5VFNyUlVKSTJBV09ZQ3Axa0Q4RTVOMVFVMjdlMHY2MlF3TU55UjFQNDY3?=
 =?utf-8?B?WjFrdlhuQnhmdjlBUlc3dHJQdEQ2eUZlM212YkxVRFRaeHd0aktmZ1lGNE1y?=
 =?utf-8?B?OVFueWJLVHFNaVdMNzg3T3lRZzUvN0NmV2JsV1RETTM4bUVOdGdWVFhnTFZz?=
 =?utf-8?B?Z1VMNkRkR3hHMzFSMm9qNWRBS3U3WWZKQnlPdDl4bTlxdWhmeC90ZFNYNmdy?=
 =?utf-8?B?VC8xaFJVWG1YTXlkaVNLK3lzeHJiUjkyK08wbXhZUTdiaittY1BxWGhCMVNZ?=
 =?utf-8?Q?YesWrt77W2tLj41xm0ibEz4zZ?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: f577d0cd-ce61-4dae-7e5d-08dcc7e19a4d
X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8876.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 04:18:15.1390
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: kctZOdNR4ujjJrBbo65Ucdeu2uVU/T/xjcjiYFLjZmRMWJ63TueeL/CH9cqxM8D9EwoYIbsDLdpBycc1Ta4UOw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9415

While developing a patch to update xilinx tests to use the "expect"
utility I found that with the current use of "expect" in the *qemu-* 
*scripts,
it is possible for the test to produce a *false success *if the expect
script returns nonzero due to the following lines

     set +e
...
     ./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
     (end of file)

The first disables exiting on errors which is needed for cleanup in some
cases such as turning off power in a hardware test. However, here the
script exits 0 on reaching the end of file.

This is a serious flaw in our testing system as the result of the test is
essentially ignored.

I have been able produce such a false success here by setting a random 
passed
message and short timeout (line 142).
https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7693194287#L142

I have sent a patch that fixes this using the same method from my xilinx
patch but suggestions are welcome. For qemu tests it may be enough to
instead just remove "set +e".



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 04:30:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 04:30:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785419.1194858 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjWnr-0004t2-8K; Thu, 29 Aug 2024 04:30:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785419.1194858; Thu, 29 Aug 2024 04:30:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjWnr-0004sv-5O; Thu, 29 Aug 2024 04:30:35 +0000
Received: by outflank-mailman (input) for mailman id 785419;
 Thu, 29 Aug 2024 04:30:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=EacX=P4=lst.de=hch@srs-se1.protection.inumbo.net>)
 id 1sjWnp-0004sn-1Y
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 04:30:33 +0000
Received: from verein.lst.de (verein.lst.de [213.95.11.211])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6d05eb61-65bf-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 06:30:31 +0200 (CEST)
Received: by verein.lst.de (Postfix, from userid 2407)
 id F39EA68AFE; Thu, 29 Aug 2024 06:30:27 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6d05eb61-65bf-11ef-a0b0-8be0dac302b0
Date: Thu, 29 Aug 2024 06:30:27 +0200
From: Christoph Hellwig <hch@lst.de>
To: Andreas Larsson <andreas@gaisler.com>
Cc: Christoph Hellwig <hch@lst.de>, iommu@lists.linux.dev,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Bingbu Cao <bingbu.cao@intel.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>, linux-kernel@vger.kernel.org,
	linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org,
	linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org,
	sparclinux@vger.kernel.org, linux-media@vger.kernel.org,
	virtualization@lists.linux.dev, xen-devel@lists.xenproject.org,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 2/2] dma-mapping: clearly mark DMA ops as an
 architecture feature
Message-ID: <20240829043027.GA4707@lst.de>
References: <20240828061104.1925127-1-hch@lst.de> <20240828061104.1925127-3-hch@lst.de> <12a0f286-3114-4dac-8b75-3a638d9c8635@gaisler.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <12a0f286-3114-4dac-8b75-3a638d9c8635@gaisler.com>
User-Agent: Mutt/1.5.17 (2007-11-01)

On Wed, Aug 28, 2024 at 08:21:14AM +0200, Andreas Larsson wrote:
> On 2024-08-28 08:10, Christoph Hellwig wrote:
> > --- a/drivers/xen/Kconfig
> > +++ b/drivers/xen/Kconfig
> > @@ -177,8 +177,8 @@ config XEN_GRANT_DMA_ALLOC
> >  
> >  config SWIOTLB_XEN
> >  	def_bool y
> > +	depends on ARCH_DMA_OPS
> 
> Rename to ARCH_HAS_DMA_OPS in v2 is missing here

Thanks,

I've fixed this up locally now.


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 05:12:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 05:12:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785429.1194868 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjXSM-000475-2H; Thu, 29 Aug 2024 05:12:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785429.1194868; Thu, 29 Aug 2024 05:12:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjXSL-00046y-Vt; Thu, 29 Aug 2024 05:12:25 +0000
Received: by outflank-mailman (input) for mailman id 785429;
 Thu, 29 Aug 2024 05:12:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjXSL-00046o-8a; Thu, 29 Aug 2024 05:12:25 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjXSL-00039A-1L; Thu, 29 Aug 2024 05:12:25 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjXSK-0005iP-Ni; Thu, 29 Aug 2024 05:12:24 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjXSK-0002og-Mv; Thu, 29 Aug 2024 05:12:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=CtUHnvUS6/5j7W2/VgLmMPgGoTIxmrVFaPvp8mCx73I=; b=tlb+8EdaXBmlc5gm5f+bWa7vQn
	Sr/QSayYgcdGYuCz7JDaozFTux2hMMq7LlKZAk0QPz/YtoELpa35KarXbpY8sxM5CK8Wp0Fwagcro
	cd8wY1TGzssYiEEuXW3Ytpluw7GT2cjoN5xM1BjqXO74BeN7nbJm4pAgsh1iQgQz+FPk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187381-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187381: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=afaee42f777bc359db95f692804f7fc7e12c0c02
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 29 Aug 2024 05:12:24 +0000

flight 187381 qemu-mainline real [real]
flight 187396 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187381/
http://logs.test-lab.xenproject.org/osstest/logs/187396/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass

version targeted for testing:
 qemuu                afaee42f777bc359db95f692804f7fc7e12c0c02
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  357 days
Failing since        182723  2023-09-07 18:19:05 Z  356 days   39 attempts
Testing same since   187360  2024-08-27 06:16:18 Z    1 days    3 attempts

------------------------------------------------------------
621 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 181112 lines long.)


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 05:36:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 05:36:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785441.1194878 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjXpL-0007vn-U9; Thu, 29 Aug 2024 05:36:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785441.1194878; Thu, 29 Aug 2024 05:36:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjXpL-0007vg-RN; Thu, 29 Aug 2024 05:36:11 +0000
Received: by outflank-mailman (input) for mailman id 785441;
 Thu, 29 Aug 2024 05:36:11 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjXpK-0007vW-WE; Thu, 29 Aug 2024 05:36:11 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjXpK-0003XU-Ks; Thu, 29 Aug 2024 05:36:10 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjXpK-0006sf-2q; Thu, 29 Aug 2024 05:36:10 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjXpK-00061S-2F; Thu, 29 Aug 2024 05:36:10 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=P5Onk855enoyDqPTMX6MyqOCHRf/sk8eQBrv/6nwQCI=; b=sTypT6ahnRdUfr+jJxwh97yd+n
	lLv193DFYb4ITRj04yjRGrpE+yYqLnoMuRNSkoaTtt8HbYQRyHE0W0rKdN+eFyrz7bR8vjPWjLadW
	aTFmvtCibhx5+2+NLZ3v+Tz35QoA2ogOE/3uDgtAnujTpPAMyoj+SQbu7Fz2xfnaH1MY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187392-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187392: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=0e0426dda4bcc67826a575822538583e8f5b7cfc
X-Osstest-Versions-That:
    xen=fb1658221a31ec1db33253a80001191391e73b17
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 29 Aug 2024 05:36:10 +0000

flight 187392 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187392/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  0e0426dda4bcc67826a575822538583e8f5b7cfc
baseline version:
 xen                  fb1658221a31ec1db33253a80001191391e73b17

Last test of basis   187386  2024-08-28 19:00:23 Z    0 days
Testing same since   187392  2024-08-29 01:00:24 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Federico Serafini <federico.serafini@bugseng.com>
  Victor Lira <victorm.lira@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   fb1658221a..0e0426dda4  0e0426dda4bcc67826a575822538583e8f5b7cfc -> smoke


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 05:55:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 05:55:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785450.1194888 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjY7k-0003D1-9h; Thu, 29 Aug 2024 05:55:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785450.1194888; Thu, 29 Aug 2024 05:55:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjY7k-0003Cu-6X; Thu, 29 Aug 2024 05:55:12 +0000
Received: by outflank-mailman (input) for mailman id 785450;
 Thu, 29 Aug 2024 05:55:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjY7i-0003Co-Uw
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 05:55:11 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3f85b0b2-65cb-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 07:55:09 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-5334b0e1a8eso325363e87.0
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 22:55:09 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8988feb112sm31713966b.39.2024.08.28.22.55.07
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 22:55:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3f85b0b2-65cb-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724910908; x=1725515708; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=TChNeicFWEvZRxp5rEEVegR0lK4vwAbrXE7Ewib5yl8=;
        b=dGBAL4swy2XlWp0WNSKV9DA8nJ+lI+3T1zhVuExSs8Fseg0jYP5CcI/zgLpSxIoeFl
         zmQIOSijCo1tnaj8tgTfWaBFUMRVz3LkXWOW5t37hQHaoh73sXeGTnz6X5T3LnErRGwT
         qCPgRMd0oV6fENvN0BtJ+OTo+sQYCzqEP0x26euPIYZcrkMmCsyTBkTLkE7wxsqgXeT7
         ObS04OJOoEo72MvHBuWwbQbog9T/7l+3tRPjIThX+KMSQXsy8HS50R9qK61eh3tdcnjM
         cL91bj/l1yrzP92NfEpIB1pPte4yWvAtq/w4SX4ftNwrDs6VfYYX2e3ZQLAOiK8jWnnU
         1IpQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724910908; x=1725515708;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=TChNeicFWEvZRxp5rEEVegR0lK4vwAbrXE7Ewib5yl8=;
        b=T2Cum6PjoQ47BjPfVy+PdmN3T3V9jYHVPCltz/tjueBuzTg1wVq+aS5//7kJ7H+lWC
         mk43Fw3XCsYQgmCucnNE3yrD3LkrTrdruG9PDKMDMywBQQmIQdh+iL0cHploWBvasDnb
         QBzc+9HeG6HdCfvDprwindTm/gdSZbrM5EgB2JngDIBoceJkigOewwMNjdwIXecrziG2
         dFmTxU22eNn/WvgeI4fUiHEz5oHIWKfOoZ3pJhXcZFyz2HPtFRlwfH8VP+mdJIVZryR5
         rn/E67BGQWJ9//hsGraLhG37e4X8mVlm+Oc8zpXScqXVQA8RZiverQwZdnBv5y3hVAy6
         WzKQ==
X-Gm-Message-State: AOJu0YxSOzOJwPyvnjb54C8G0xWPBONeRmP7pAcvESOB0UVA4Le7N4MB
	ppJfSQkvjB4Xo7Vf7vWmKgoDZEgZxlNSaiiaXhLEY0A34QI77XYqkCOFYdebRkuJ7uT0MJ02GVw
	=
X-Google-Smtp-Source: AGHT+IGEZVS9fixFILZZKvdr8rWtiNHg0swOH2e2TQEZMm4TGDdKtU3nb1kOJBXVRQEhLURtF/YeZA==
X-Received: by 2002:a05:6512:2210:b0:52e:d0f8:2d30 with SMTP id 2adb3069b0e04-5353e5be49emr1072170e87.59.1724910908368;
        Wed, 28 Aug 2024 22:55:08 -0700 (PDT)
Message-ID: <9cc9e16d-a4b0-4902-9f12-a7cb337b1763@suse.com>
Date: Thu, 29 Aug 2024 07:55:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Julien Grall <julien@xen.org>, Stefano Stabellini
 <sstabellini@kernel.org>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] Arm64: adjust __irq_to_desc() to fix build with gcc14
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

With the original code I observe

In function ‘__irq_to_desc’,
    inlined from ‘route_irq_to_guest’ at arch/arm/irq.c:465:12:
arch/arm/irq.c:54:16: error: array subscript -2 is below array bounds of ‘irq_desc_t[32]’ {aka ‘struct irq_desc[32]’} [-Werror=array-bounds=]
   54 |         return &this_cpu(local_irq_desc)[irq];
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

which looks pretty bogus: How in the world does the compiler arrive at
-2 when compiling route_irq_to_guest()? Yet independent of that the
function's parameter wants to be of unsigned type anyway, as shown by
a vast majority of callers (others use plain int when they really mean
non-negative quantities). With that adjustment the code compiles fine
again.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116519

--- a/xen/arch/arm/include/asm/irq.h
+++ b/xen/arch/arm/include/asm/irq.h
@@ -56,7 +56,7 @@ extern const unsigned int nr_irqs;
 struct irq_desc;
 struct irqaction;
 
-struct irq_desc *__irq_to_desc(int irq);
+struct irq_desc *__irq_to_desc(unsigned int irq);
 
 #define irq_to_desc(irq)    __irq_to_desc(irq)
 
--- unstable.orig/xen/arch/arm/irq.c	2024-06-28 15:56:44.000000000 +0200
+++ unstable/xen/arch/arm/irq.c	2024-08-28 15:12:10.333607505 +0200
@@ -48,7 +48,7 @@ void irq_end_none(struct irq_desc *irq)
 static irq_desc_t irq_desc[NR_IRQS];
 static DEFINE_PER_CPU(irq_desc_t[NR_LOCAL_IRQS], local_irq_desc);
 
-struct irq_desc *__irq_to_desc(int irq)
+struct irq_desc *__irq_to_desc(unsigned int irq)
 {
     if ( irq < NR_LOCAL_IRQS )
         return &this_cpu(local_irq_desc)[irq];


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 06:10:21 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 06:10:21 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785460.1194898 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjYMJ-00072X-KC; Thu, 29 Aug 2024 06:10:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785460.1194898; Thu, 29 Aug 2024 06:10:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjYMJ-00072Q-H3; Thu, 29 Aug 2024 06:10:15 +0000
Received: by outflank-mailman (input) for mailman id 785460;
 Thu, 29 Aug 2024 06:10:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjYMI-00072G-3U; Thu, 29 Aug 2024 06:10:14 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjYMH-0004Cq-Tg; Thu, 29 Aug 2024 06:10:13 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjYMH-0008P5-He; Thu, 29 Aug 2024 06:10:13 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjYMH-00058f-H7; Thu, 29 Aug 2024 06:10:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=vvfSZJFlKWM25iXt9fwexb1Rq+DMGGKSKAd2f143dIM=; b=n4ipa2mCsOkKYAMAl5eI8UWX9F
	DgjUrnXjxnsct1rU0nsm2xtnYlt1saOyKPWe1ClLzs08iIN/qwl43Up/AfiCX/ilqS24D0niz6gDC
	MmRPDWz+jKfyG2TJddBnSFf575WVnL6f79gqhba6waRDXRshwo5oCbRSxGoN4MOtE4ts=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187394-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187394: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=2fe9b6c22fcc9b8617b95d4a2cf091fea4f66537
X-Osstest-Versions-That:
    ovmf=383f729ac096b8deb279933fce86e83a5f7f5ec7
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 29 Aug 2024 06:10:13 +0000

flight 187394 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187394/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 2fe9b6c22fcc9b8617b95d4a2cf091fea4f66537
baseline version:
 ovmf                 383f729ac096b8deb279933fce86e83a5f7f5ec7

Last test of basis   187393  2024-08-29 02:31:47 Z    0 days
Testing same since   187394  2024-08-29 04:11:29 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Prachotan Reddy Bathi <Prachotan.Bathi@arm.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   383f729ac0..2fe9b6c22f  2fe9b6c22fcc9b8617b95d4a2cf091fea4f66537 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 06:13:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 06:13:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785468.1194908 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjYPU-0007bL-2f; Thu, 29 Aug 2024 06:13:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785468.1194908; Thu, 29 Aug 2024 06:13:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjYPT-0007bE-Vt; Thu, 29 Aug 2024 06:13:31 +0000
Received: by outflank-mailman (input) for mailman id 785468;
 Thu, 29 Aug 2024 06:13:30 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjYPS-0007as-3L
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 06:13:30 +0000
Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com
 [2a00:1450:4864:20::634])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cf3643cd-65cd-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 08:13:29 +0200 (CEST)
Received: by mail-ej1-x634.google.com with SMTP id
 a640c23a62f3a-a86abbd68ffso49179666b.0
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 23:13:29 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8989196895sm32578566b.124.2024.08.28.23.13.27
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 23:13:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cf3643cd-65cd-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724912009; x=1725516809; 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=vtOIuYV7UtLtgJzoz3lPgxTu4VXpbICmI2DcuM8MaJk=;
        b=GEq50BHiE8EGU6p2cOb+S7yLDnxgYnyB1pUXD/oCa2n5FmxHgCyRYtaFlO+14BLLyx
         jek7kOGJRWnK0JPVv9S7QGK/eZIXgv1oS5WDIwHKkJ21fTqgIN+GniEjUuhtQ9NhPS5n
         HUbi2lmHVvjoE0pbhs+kqE2DeY0/WnsOOXQU+kKhikjd+04vP5kg+f6kOVhsSVXb1S0W
         29aLvosgPdDUtshWqBiyo1xTExlNDGDwlNzLJkiiDPEGsKTuhGfAU41pkcT4/4rQVMT4
         AzJ9pt42uWFZPkgyEUFPLjCMjH8EKfRZVuV3IQo8FxntmqmTg8kKnpNABpJBvt0nMSiH
         XhNg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724912009; x=1725516809;
        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=vtOIuYV7UtLtgJzoz3lPgxTu4VXpbICmI2DcuM8MaJk=;
        b=IqBoVVxSzGkdfnqPViA/TArXf+no44vona/0zX7JG+Xg4y2sQLqhHryoeS4Iay2nUF
         +M5cWL7Mq4tCCLxHGUvkRYAa4BeOPCzSl2JM1ymj2jO/pqssa4D5yaNGREUKhxo+HphX
         gHXxqIc1shrP64zsi9IEpVwKsGgzg5gN5GEzgGzeuukwYXkrbclJ+b+fEF/77kUFxY43
         y6Du55zG2QC1UsW8A2q48mDtZ/KXFsQE/jFj5zvQYS59A1pC745XQBJLwBxVsXDxV9Ee
         QhHJiA97P7Fv2vDno8G7dGbBw/8P1ZMIIVZ4J/6XButoTigdg3Nd2eIcjI2T2Ox4U6/b
         FSug==
X-Forwarded-Encrypted: i=1; AJvYcCWokVLMGVcGtSgtMpKM1aTi3fKi8RE0xr2NyquWgzzxReLX0Yv2QeeKqHK9ciG+xAttmHv8lpXZObs=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxFYNyYTkYbSeJIxIvueCixXT6N7BfLs7dguzXCAZV6lhMGLvvb
	0TGEbivAIx83VGBTkQJzl9X418jpJsWnLfvFmt7aKsL7txlodZnEIyn2vYfp8A==
X-Google-Smtp-Source: AGHT+IG+HTHG/I5JxjFlwFyEmhiJMF6weZ7gKXjHv5AC9AlWundSGoSy5ztAnFiIFh1YBzgASWmdhg==
X-Received: by 2002:a17:907:608c:b0:a7d:8912:6697 with SMTP id a640c23a62f3a-a898231cbe5mr159482566b.3.1724912008558;
        Wed, 28 Aug 2024 23:13:28 -0700 (PDT)
Message-ID: <20aeddd3-5a87-42d3-8eb4-478fbdb30321@suse.com>
Date: Thu, 29 Aug 2024 08:13:26 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/4] x86/hvm: Use for_each_set_bit() in
 hvm_emulate_writeback()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
 <20240827135746.1908070-3-andrew.cooper3@citrix.com>
 <a92063db-fc28-4162-83bd-33617bbfcfbe@suse.com>
 <8f34109f-1718-47e5-99c5-a6010d7ebe51@citrix.com>
 <09742cbe-4c06-49d4-8b26-7ce9076063a1@suse.com>
 <17a98dae-51d4-4da0-a35a-1ddf94a06168@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <17a98dae-51d4-4da0-a35a-1ddf94a06168@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28.08.2024 20:56, Andrew Cooper wrote:
> On 28/08/2024 3:56 pm, Jan Beulich wrote:
>> On 28.08.2024 16:44, Andrew Cooper wrote:
>>> On 27/08/2024 5:07 pm, Jan Beulich wrote:
>>>> On 27.08.2024 15:57, Andrew Cooper wrote:
>>>>> +    for_each_set_bit ( seg, dirty )
>>>>> +        hvm_set_segment_register(curr, seg, &hvmemul_ctxt->seg_reg[seg]);
>>>>> +
>>>>> +    hvmemul_ctxt->seg_reg_dirty = 0;
>>>> Why is this suddenly appearing here? You don't mention it in the description,
>>>> so it's not clear whether you found a (however minor) issue, or whether
>>>> that's purely cosmetic (yet then it's still an extra store we could do
>>>> without).
>>> Oh, yes.  Nothing anywhere in Xen ever clears these segment dirty bits.
>> hvm_emulate_init_once()?
> 
> I meant after emulation.  The value is initialised to 0 at the start of day.
> 
>>
>>> I suspect the worst that will go wrong is that we'll waste time
>>> re-{VMWRITE,memcpy}-ing the segment registers into the VMCS/VMCB, but
>>> the logic in Xen is definitely not right.
>> I'm on the edge of asking to do such clearing before emulation, not after
>> processing the dirty bits. That would then be hvm_emulate_init_per_insn(),
>> well centralized.
> 
> Specifically, hvmemul_ctxt should not believe itself to be dirty after a
> call to hvm_emulate_writeback(), because that's the logic to make the
> context no-longer-dirty.

That's one aspect, yes. Debuggability is another. For that retaining state
until it strictly needs clearing out may be helpful. Plus ...

> That said, the more I look at this, the less convinced I am by it.  For
> a function named writeback(), it's doing a very narrow thing that is not
> the usual meaning of the term when it comes to pipelines or insn
> emulation...

... as you say here.

Anyway - I'll leave where to put the clearing to you, just as long as it's
at least mentioned in the description.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 06:25:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 06:25:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785475.1194918 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjYat-0001PG-Te; Thu, 29 Aug 2024 06:25:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785475.1194918; Thu, 29 Aug 2024 06:25:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjYat-0001P9-Qp; Thu, 29 Aug 2024 06:25:19 +0000
Received: by outflank-mailman (input) for mailman id 785475;
 Thu, 29 Aug 2024 06:25:18 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjYas-0001P3-FU
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 06:25:18 +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 7546a949-65cf-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 08:25:17 +0200 (CEST)
Received: by mail-ej1-x62c.google.com with SMTP id
 a640c23a62f3a-a86910caf9cso259023666b.1
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 23:25:17 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8988feb592sm34807666b.13.2024.08.28.23.25.16
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 23:25:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7546a949-65cf-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724912717; x=1725517517; 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=+l/JIYcACG+9Ld1DN3q7Z0bV6lqYTRANY4kBSvKDckA=;
        b=ISWr6FbS+9SzKfeB1de0xty+xi1moocq9wN6JHSNicYDDSDI5ItZ9XZGuOu0gDFZ+8
         VStVCQYsejyEpKO2XncxD5vtwFGq80HpY4ekKAGjD/DS7PLDuNL389aUCrMFvfVdCfNv
         2vvnSraj+hcj0Y/yAv6UEAm5b6cylAaqKWpzPXbfsGvY307mMVrkH/rvC7gJzFgFpdNe
         C+/2S95oVw+kYQ+sR/dfsf5u/QXOXHRJIVygIkxX0OoNN40A/YrGlS1eOGK6zdeRW1Mj
         cQqXdIR50Py2JsuBprxNEI+VcHonk7p+WMxGoGWEOYl729CJS6+p20n5nq42eIrwbUeH
         CpPQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724912717; x=1725517517;
        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=+l/JIYcACG+9Ld1DN3q7Z0bV6lqYTRANY4kBSvKDckA=;
        b=kFS3NmgxQSdoOeR6MIl7izZHHj3/MYp4xAS+ctkcjCOhrWH2EVxWl5nKsQRqvrN38k
         GitcSrwrXMP7P2/xAKmknrvuFtk43iyLVU7xxQw07opa5XTG3moLRbi3ypYuStsaiq4N
         hOrVuPaR2fB/flPkRsxsT/51JXfEkxRH5v2NbXiSx85S+YI/y5v46U6p48AMGmioS6NE
         T0+pETSCKCPbw3asmydOiFxS42xxwPuIpnKg/+DSl7o28yQl8uB71vdQ68MR5vMePWSD
         h5XU/Rr74qSECh1ZVBw2rt6m/uRMpOWXBSg4pbace2iP18VI4vPndr6g4Evg3oweHmrO
         xOSg==
X-Forwarded-Encrypted: i=1; AJvYcCWqn16qrLgLzao8OxAom3DjURj0g6zpXh6sLHHZowrAKCBkdGAv30EweDUdQgJxUBaoHt8JsdeXheY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyRxLSmiVFQTKyo21q9+TwujgLcgLHSEhqpSAwCxwC8mg45P/XQ
	L4FEWI8Ii2s4bBIJEWNXgqE+++lKMrrKYhcHeBQvXYLr1qtylMcAdgAO0njHlA==
X-Google-Smtp-Source: AGHT+IEq9NwshHsMMX0yaBp9VeuhfCYg0S2YDyvEZtxh6SWBtH48OWnpGYFqHkzls8YF5zLvPXId1A==
X-Received: by 2002:a17:907:7e99:b0:a86:abbd:6834 with SMTP id a640c23a62f3a-a89828335famr140267866b.30.1724912716550;
        Wed, 28 Aug 2024 23:25:16 -0700 (PDT)
Message-ID: <2f08e857-e56b-41ca-8f99-ba36742d232b@suse.com>
Date: Thu, 29 Aug 2024 08:25:15 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/4] x86/hvm: Rework hpet_write() for improved code
 generation
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
 <20240827135746.1908070-4-andrew.cooper3@citrix.com>
 <2316ca39-50d4-4311-aeff-30be588245d9@suse.com>
 <7b7b1434-e615-4189-ab52-3cce2932fb4b@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <7b7b1434-e615-4189-ab52-3cce2932fb4b@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28.08.2024 19:50, Andrew Cooper wrote:
> On 28/08/2024 9:13 am, Jan Beulich wrote:
>> On 27.08.2024 15:57, Andrew Cooper wrote:
>>> In the HPET_STATUS handling, the use of __clear_bit(i, &new_val) is the only
>>> thing causing it to be spilled to the stack.  Furthemore we only care about
>>> the bottom 3 bits, so rewrite it to be a plain for loop.
>>>
>>> For the {start,stop}_timer variables, these are spilled to the stack despite
>>> the __{set,clear}_bit() calls.
>> That's an observation from what the compiler happens to do? I don't see any
>> other reason why they would need spilling; I expect it's merely a matter of
>> registers better be used for other variables.
> 
> It is a consequence of how our helpers are written.  I do expect it to
> improve when I get around to reworking them.
> 
> For example, the Linux helpers have enough constant folding capabilities
> to allow the compiler to turn:
> 
> {
>     int foo = 0;
>     ...
>     __set_bit(1, &foo);
> 
> into:
> 
> {
>     int foo = 1;
> 
> 
> as well as being able to emit LOCK AND/OR/XOR in place of LOCK BT{C,S,R}
> for a constant bit position.
> 
> One thing I want to do, which I haven't figured out how to do yet, is to
> allow the arch form to emit BT?Q forms.
> 
> Right now, code generation for PGC_* and PGT_* suffers quite a lot.  We
> mix between reg/imm logic, then spill to the stack because top bits
> aren't within range for the "I" constraint on 32-bit instructions, issue
> a BT?L reg/mem (which has much higher latency than any other form), then
> pick it back off the stack to do more reg/imm logic.
> 
> I was wondering if, because of the always_inline, I could do something
> like __builtin_constant_p(bit) && __builtin_object_size(addr, 0) >= 8
> and emitting long-granular logic, which will be able to pick the imm/reg
> form rather than turning into reg/mem.

That may work, provided there actually was always_inline.

>>  If we ever meant to build Xen
>> with APX fully in use, that might change. IOW may I at least ask for
>> s/are/happen to be/? I'm also a little irritated by "despite", but you're
>> the native speaker. It would have seemed to me that e.g. "irrespective of"
>> would better express what (I think) is meant.
> 
> "despite" isn't really the right term, but I also wouldn't have said it
> was something to be irritated over.
> 
> What I was trying to say was "they're spilled to the stack even with the
> __set_bit() calls removed".  Which makes sense; they're values held for
> almost the full duration of the function, that are not used in ~every
> step of logic.

Right, the "not a good use for a register var" reason that I had alluded to.

>>>  Again we only care about the bottom 3 bits, so
>>> shrink the variables from long to int.  Use for_each_set_bit() rather than
>>> opencoding it at the end which amongst other things means the loop predicate
>>> is no longer forced to the stack by the loop body.
>>>
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>> ---
>>> CC: Jan Beulich <JBeulich@suse.com>
>>> CC: Roger Pau Monné <roger.pau@citrix.com>
>>>
>>> All in all, it's modest according to bloat-o-meter:
>>>
>>>   add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-29 (-29)
>>>   Function                                     old     new   delta
>>>   hpet_write                                  2225    2196     -29
>>>
>>> but we have shrunk the stack frame by 8 bytes; 0x28 as opposed to 0x30 before.
>> However, on the negative side all the first of the loops you touch now always
>> takes 3 iterations, when previously we may have got away with as little as
>> none. Is there a reason not to use
>>
>>     for_each_set_bit ( i, new_val & ((1U << HPET_TIMER_NUM) - 1) )
>>
>> there (with the masking of the low bit possibly pulled out)?
> 
> There are multiple angles here.
> 
> First, I got an unexpected surprise on ARM with an expression, and while
> this one won't pick up pointer const-ness, I can never remember what
> MISRA's view on this is.
> 
> Second, this is the odd-loop-out compared to rest of the function, which
> are all of the form "for ( i = 0; i < HPET_TIMER_NUM ;".
> 
> But perhaps most importantly, OSes don't touch this register.  Xen not
> at all, and Linux only in _hpet_print_config().  Neither bother
> preserving/clearing it on suspend/resume, even when running the HPET in
> legacy replacement mode.
> 
> I haven't checked windows behaviour, but I don't expect it to differ
> here.  This register simply isn't interesting for the preferred type of
> interrupts (edge), and also isn't useful for an ISR handling a line
> interrupt.

Yet there must have been an environment where the register is of use, or
else Roger wouldn't have been prompted to make what is now be07023be115
("x86/vhpet: add support for level triggered interrupts").

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 06:36:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 06:36:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785481.1194928 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjYlF-0003fJ-RR; Thu, 29 Aug 2024 06:36:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785481.1194928; Thu, 29 Aug 2024 06:36:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjYlF-0003fC-Oq; Thu, 29 Aug 2024 06:36:01 +0000
Received: by outflank-mailman (input) for mailman id 785481;
 Thu, 29 Aug 2024 06:36:01 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjYlF-0003f6-AM
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 06:36:01 +0000
Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com
 [2a00:1450:4864:20::62e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f3aab792-65d0-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 08:35:58 +0200 (CEST)
Received: by mail-ej1-x62e.google.com with SMTP id
 a640c23a62f3a-a86933829dcso28029966b.3
 for <xen-devel@lists.xenproject.org>; Wed, 28 Aug 2024 23:35:59 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a898900f243sm35276766b.69.2024.08.28.23.35.57
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 28 Aug 2024 23:35:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f3aab792-65d0-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724913358; x=1725518158; 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=+YmzGokIl+z9bwdZt4rni8uT8RctknFP6bTn/Y3UWxY=;
        b=H+zyX+OkUMx3dKTPCvOuA5InJSk2GscvycbowJmDVjaS9M88bU6cD/6cwEGVZ6hI1U
         2EaKKpAmTYb1ZB3lyOcJIhqCCCCv3PtnbrLMvq9HXKX11ZJiiP0BcgS/jxjq0WtTttKl
         LbVJ6CEt6GW4waCKDt1CtuCyoQlLu6G1skDqkFKwKt6NmKu2/CYIkIjPHfz+Wc5/IkwX
         u03LFNngEKNuFxd+TqwIDixOslT8I65bdSmdLJkFcFBYE/Snon+H2hfM/Jy2CFkQwriF
         Zd2F8tcoj51IUfkn2m+2MKI6+zfRnIX4WeT3R4xlmTiB9VOKK08qASvuaNCIL3jTHLSd
         HZIQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724913358; x=1725518158;
        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=+YmzGokIl+z9bwdZt4rni8uT8RctknFP6bTn/Y3UWxY=;
        b=iP6ySx2rpi3L8zFugFqjQJ48c/NCQViJ+2UZYHp70bYhKQCFjou6Yn0JWtJCEncTVa
         AeqWEo9LjhvMs/WMg2CHuYMT8MXc4oXljo1aZWDeMo/4xoVOVkL96WVZA6FTDpJWnz5J
         m4CE4PXlAN6X23q9u9HxJjJIC1Ugqy/QBpywERZb9U2w9yNRz4Dkx8vDzY03vTsrwSxV
         UQ1P5oHTk66zVN2DLPOAQ749fjyYdJBFoFqhqkeulOyDSXUG4iBpMsmp74Ii7iAudrAt
         Iu3d4F555FDrorcMFpawypAdov/KSOBLYv6TPgsn6A3eN/X88/segr1M8GXQrMzIIDzW
         nWNw==
X-Forwarded-Encrypted: i=1; AJvYcCVfgHMa7JGi5xlifx8jkOHUcFGeHP9UaHbm1xyLznFUPBL/TS5ltiq67cTTIvf+bR571lbCGexyEdU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YypZBUF++Azf3svTFowjCfnwHIPF59yRspQGJ7AgkHeVn+39aEs
	vYSzha2oayP5DZy/RW7k2c+Hk7/EsU42Qoxd5r006BzZeOXVTzRV7Jqca+POeg==
X-Google-Smtp-Source: AGHT+IHEWeLd19Cs+Fxu2ZQhIgb+i8G4gQ8mjy0YVYDib/wnAL/1rasdvSv3M0XQAsdR3pL+JB+n2w==
X-Received: by 2002:a17:907:9482:b0:a86:700f:93c1 with SMTP id a640c23a62f3a-a897face4cfmr136474366b.60.1724913358353;
        Wed, 28 Aug 2024 23:35:58 -0700 (PDT)
Message-ID: <84476add-72a3-46c0-84a8-aeb91307ff22@suse.com>
Date: Thu, 29 Aug 2024 08:35:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 4/4] x86/vmx: Rewrite vmx_sync_pir_to_irr() to be more
 efficient
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240827135746.1908070-1-andrew.cooper3@citrix.com>
 <20240827135746.1908070-5-andrew.cooper3@citrix.com>
 <d022a5b1-c0ca-4399-b972-b01d834a95ec@suse.com>
 <cb2609f0-ed06-40ab-9983-9dad59c589d9@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <cb2609f0-ed06-40ab-9983-9dad59c589d9@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28.08.2024 20:08, Andrew Cooper wrote:
> On 28/08/2024 10:19 am, Jan Beulich wrote:
>> On 27.08.2024 15:57, Andrew Cooper wrote:
>>> There are two issues.  First, pi_test_and_clear_on() pulls the cache-line to
>>> the CPU and dirties it even if there's nothing outstanding, but the final
>>> for_each_set_bit() is O(256) when O(8) would do,
>> Nit: That's bitmap_for_each() now, I think. And again ...
>>
>>> and would avoid multiple
>>> atomic updates to the same IRR word.
>>>
>>> Rewrite it from scratch, explaining what's going on at each step.
>>>
>>> Bloat-o-meter reports 177 -> 145 (net -32), but the better aspect is the
>>> removal calls to __find_{first,next}_bit() hidden behind for_each_set_bit().
>> ... here, and no underscore prefixes on the two find functions.
> 
> Yes, and fixed.
> 
>>
>>> --- a/xen/arch/x86/hvm/vmx/vmx.c
>>> +++ b/xen/arch/x86/hvm/vmx/vmx.c
>>> @@ -2317,18 +2317,72 @@ static void cf_check vmx_deliver_posted_intr(struct vcpu *v, u8 vector)
>>>  
>>>  static void cf_check vmx_sync_pir_to_irr(struct vcpu *v)
>>>  {
>>> -    struct vlapic *vlapic = vcpu_vlapic(v);
>>> -    unsigned int group, i;
>>> -    DECLARE_BITMAP(pending_intr, X86_NR_VECTORS);
>>> +    struct pi_desc *desc = &v->arch.hvm.vmx.pi_desc;
>>> +    union {
>>> +        uint64_t _64[X86_NR_VECTORS / (sizeof(uint64_t) * 8)];
>> Using unsigned long here would imo be better, as that's what matches
>> struct pi_desc's DECLARE_BITMAP().
> 
> Why?  It was also the primary contribution to particularly-bad code
> generation in this function.

I answered the "why" already: Because of you copying from something ...

>>> +        uint32_t _32[X86_NR_VECTORS / (sizeof(uint32_t) * 8)];
>>> +    } vec;
>>> +    uint32_t *irr;
>>> +    bool on;
>>>  
>>> -    if ( !pi_test_and_clear_on(&v->arch.hvm.vmx.pi_desc) )
>>> +    /*
>>> +     * The PIR is a contended cacheline which bounces between the CPU(s) and
>>> +     * IOMMU(s).  An IOMMU updates the entire PIR atomically, but we can't
>>> +     * express the same on the CPU side, so care has to be taken.
>>> +     *
>>> +     * First, do a plain read of ON.  If the PIR hasn't been modified, this
>>> +     * will keep the cacheline Shared and not pull it Excusive on the current
>>> +     * CPU.
>>> +     */
>>> +    if ( !pi_test_on(desc) )
>>>          return;
>>>  
>>> -    for ( group = 0; group < ARRAY_SIZE(pending_intr); group++ )
>>> -        pending_intr[group] = pi_get_pir(&v->arch.hvm.vmx.pi_desc, group);
>>> +    /*
>>> +     * Second, if the plain read said that ON was set, we must clear it with
>>> +     * an atomic action.  This will bring the cachline to Exclusive on the
>> Nit (from my spell checker): cacheline.
>>
>>> +     * current CPU.
>>> +     *
>>> +     * This should always succeed because noone else should be playing with
>>> +     * the PIR behind our back, but assert so just in case.
>>> +     */
>>> +    on = pi_test_and_clear_on(desc);
>>> +    ASSERT(on);
>>> +
>>> +    /*
>>> +     * The cacheline is now Exclusive on the current CPU, and because ON was
>> "is" is pretty ambitious. We can only hope it (still) is.
> 
> I can't think of a clearer way of saying this.  "will have become
> Exclusive" perhaps, but this is getting into some subtle tense gymnastics.
> 
>>> +     * get it back again.
>>> +     */
>>> +    for ( unsigned int i = 0; i < ARRAY_SIZE(vec._64); ++i )
>>> +        vec._64[i] = xchg(&desc->pir[i], 0);

... that is the result of DECLARE_BITMAP(), i.e. an array of unsigned longs.
If you make that part of the new union unsigned long[] too, you'll have code
which is bitness-independent (i.e. would also have worked correctly in 32-bit
Xen, and would work correctly in hypothetical 128-bit Xen). I don't think the
array _type_ was "the primary contribution to particularly-bad code
generation in this function"; it was how that bitmap was used.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 06:53:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 06:53:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785490.1194938 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjZ2M-0007g8-9Q; Thu, 29 Aug 2024 06:53:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785490.1194938; Thu, 29 Aug 2024 06:53:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjZ2M-0007g1-6e; Thu, 29 Aug 2024 06:53:42 +0000
Received: by outflank-mailman (input) for mailman id 785490;
 Thu, 29 Aug 2024 06:53:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=v/9N=P4=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sjZ2L-0007fv-8w
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 06:53:41 +0000
Received: from NAM12-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam12on2061d.outbound.protection.outlook.com
 [2a01:111:f403:2417::61d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6b75228d-65d3-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 08:53:40 +0200 (CEST)
Received: from SN6PR16CA0063.namprd16.prod.outlook.com (2603:10b6:805:ca::40)
 by CY5PR12MB6130.namprd12.prod.outlook.com (2603:10b6:930:26::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Thu, 29 Aug
 2024 06:53:36 +0000
Received: from SA2PEPF00003AE9.namprd02.prod.outlook.com
 (2603:10b6:805:ca:cafe::f7) by SN6PR16CA0063.outlook.office365.com
 (2603:10b6:805:ca::40) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend
 Transport; Thu, 29 Aug 2024 06:53:36 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 SA2PEPF00003AE9.mail.protection.outlook.com (10.167.248.9) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 06:53:35 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 29 Aug
 2024 01:53:34 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 29 Aug
 2024 01:53:34 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Thu, 29 Aug 2024 01:53:32 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6b75228d-65d3-11ef-a0b0-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=fByj/DAnc8QRs3tEDZJmangC+DzdD6+n9MuHibhoNPGTrmohWZtZXXK/5MQa7Vafbm6ERMEWq+b0KfBqJgkm7L/4zTiJrVYn6yrhESb2m4L8xPpDBd+tj35oE+LMW9t6qunf+qZA5BsOfZ2vhY8KnSJXgCYrIoKRdl9BKB0dD0C/qPTwjK3jU/CmcpU0urDnGCo1F7UueeaHO3scB2YIg9YCBTndgk9+60JOr/GDIeZtTBycyK6h75afimLWbnt8AIslRv2hlopRZn5e/5pkNRjie0xbA9LDx1txva+3cbgWPpoVG/BiTN9+DXNOzb2NttXe820RmAjZs0woeS4dMA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=aFs28kpno5mKFR628jWVGAfUyjLnvihFrGHeClS/aE8=;
 b=zDlfEMPZESqD2ovP1+rkBpBnkVyAEliEDoRi5rESIAIfcz/hxTudRj0d1vdj2mq2f4eE4S4EW4JLKQVsIe3E4xd7oeRGLt9xrH0ntWr+psZoeaZmYMUm9AHAQBzSY6Nq4LmAh9nezk5JJm9cQ85JxOyYJXw4jOcuGrhpMJoryh3OTS+KqBsrCczXwIQz8nWuNGVqO4EMD1T2JjyI3yJnnC51b4ctsFGkM/l133AQMdctQjs5l/JajIMlQwqMRHwaXRWWsavBTiwweBipxGfc9D2kbR5p5z4uAYany5On+pctksX3lE3M8Q8vhbP25wxAmSzjG5v2ytOavXAmEy9LTg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=aFs28kpno5mKFR628jWVGAfUyjLnvihFrGHeClS/aE8=;
 b=vcFfiXiUx5boW5P5xDx14aaeAHdqDrtD6KRGQd/osyQrw55IsQDLbiwboZu67sVIBWrymSun7SEx7bt2Zv4WSqOVmd3JI54YmfcUTTb+/XNEC2wXUes4LtQKPmpRuit5zoMfMgpKPiDzxu6OpTvUIS6s3dkvDcI7PMXJABiCNd4=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
Message-ID: <2756d5b3-e4b1-420e-8402-2697c559acb9@amd.com>
Date: Thu, 29 Aug 2024 08:53:22 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1] automation: fix false success in qemu tests
To: <victorm.lira@amd.com>, <xen-devel@lists.xenproject.org>
CC: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
	<jbeulich@suse.com>, Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>
References: <e4de45759723b28713ef205335c4d79b9e7074b7.1724904269.git.victorm.lira@amd.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <e4de45759723b28713ef205335c4d79b9e7074b7.1724904269.git.victorm.lira@amd.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SA2PEPF00003AE9:EE_|CY5PR12MB6130:EE_
X-MS-Office365-Filtering-Correlation-Id: e9f67441-7b80-485a-1ddf-08dcc7f74dce
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?YUw5aUhQZHpjVGhMcDNvMGlJNGNReWt3SHREejRpLzV4WEtCNFlhcTJJSmxB?=
 =?utf-8?B?a0pyQW1tTTdQMnBJSHhCa2RyaEJyVkNyUjdaUFQzNUVJdkFydzIvMCtIelpR?=
 =?utf-8?B?WjJ0Z0FpUmtmRUZTUSt4WWF3V29OYW5zcXVsbHU2VDRleGVOOGRwZURtN3g0?=
 =?utf-8?B?VkE1ZktkczBMQUVpa0ZVWnhWN21Ec3dteTZJZkxUT0kwUjN3d0RObkhIYUFw?=
 =?utf-8?B?bUNEMXR4MDdtMk5nWkZEejV0NU9ROWZjWGtBaTN1cXpNRWczUXZFZklEaXBL?=
 =?utf-8?B?UFZmNGQ5eDVqZFZTMWkwdUlmeEgrNHBmRkw3RlFTWFo2RjBBMjRkbkFJdHpT?=
 =?utf-8?B?WXJCa0RHdWltSUlZQWRlRzVvQjRlTlBXOTlBdUZ3NG4xY3p3eXJTMXJVOTlR?=
 =?utf-8?B?K0lOQTlhTWEzWHZVR2FyYW5pUHJsQ3dmOWZBbDdtOHBXREI0UnBpaGNxelMv?=
 =?utf-8?B?R1psR3NOSUViTjkzdjc3ZlFobE4vbVNoUkJxVXN4amMvUXZMazV0ZHhweEQ2?=
 =?utf-8?B?UGQyOGs2em04bWFzNHVuYUNkSEEzaGsyZ2FNbXhnTUc3Tzd4MmVySlp6aEs3?=
 =?utf-8?B?eldxR25tb3Q2UEZSVWFKL1J2NGJGS1NpcGlRK3E3MGVCbXFMNmdrVk9jNElY?=
 =?utf-8?B?OVM2dWxodko5K1d3SUc0S1AxU3ZYSVk5NnAvQ0F6YUN5anVNcjNFZEVjeDU0?=
 =?utf-8?B?OXVIY3RPL3o0N1JTS0ZZQXBzR3dCU3pTQk1MWXhCWmxFc2RjWnVuUDNTaGps?=
 =?utf-8?B?Y0ppTkRubTZIdDNaVFR2Wlg5MFdJNXg1a0FKbVgxd2ZpY2VSY21ZMmFXUUJi?=
 =?utf-8?B?T2dZTUlybWs5a0tPcGJVQUtoaDJFSVdPU1FYajc2Q3RIQmNoWUthYTlRQXNQ?=
 =?utf-8?B?dkVNV0RuTDFkKzBBUmZaVC8wT3ZhTUZUdGlSU0ZQZ1J2bW02YW0yU0JYZEVz?=
 =?utf-8?B?SW5mdGhQd1hCbkxaSy9KWXd6eVdINXFzU1dGL3R2cDRaRGU4VDRPcG1lYm9r?=
 =?utf-8?B?eVE5QW52VDN1L3dKeUxjVFczZzhTTjR6cUFZdTJxNkxsV2NkakltNHpjRTBh?=
 =?utf-8?B?bjhNK25YQzc0bWtNWlp5b0R6cVE4SEFyK2RIb1QyQ3IveHB5a0ZTeGxkMVF4?=
 =?utf-8?B?Y3hNL2czZVdqa0hjQmpROVFVai9NcTQyamdVS2lLTC8xQTdmK2dtQ21oSm9G?=
 =?utf-8?B?VmRYV29xc3U3ZkdYbDB1VS9OS1ozc0xMNUpvY1VFUHNiR0x2anZ1ZnRNWGFa?=
 =?utf-8?B?Kzc3OTBYSTN3WkFZeDN4N0w5NU9QQ21jV09TTDB3RWNneW54R3NpTGpZSXRh?=
 =?utf-8?B?S3NQSC85RGM2OUxkTDg4OGR2SUFCaWF5REpDRjl3TGtFUHNLeEcvQzMzR00x?=
 =?utf-8?B?QWl1MjlWTHlwTngvQkVmMjB4aDVMT3lqN290dTZsSHBvSzFXM2FsQTlXekFr?=
 =?utf-8?B?Yy9Lb2I5OXNjVFZibFhUVmRxaDZtQzlwTHd3SmRpeHBHdUYxSWRJZXVKaExi?=
 =?utf-8?B?NFI5MGtQT3cyc0lPakEwLzZTMnhDVEJpTHc0N05RYjVXbEhqWjF3ZnZYMi91?=
 =?utf-8?B?NmdpQVI2RXN3VFF1anZIRjFpWmdNcDBjYXM5Z2VpUktMK1lBTVM4WjV1M250?=
 =?utf-8?B?cEhEb05YWjRjaHFQeDJuMXUrM2wwSXhiMVpIdFFYTmFyczRzM1IwbHoxczNk?=
 =?utf-8?B?Wk4rcWZHYnVJVjZ1NWg4eG5kSGRUS0hObUROdS96bVQ4eEQ4NjhwQmlvOUVx?=
 =?utf-8?B?a3FHOXpJWFJ4RkJGUTFrbXhTTEJhc3BqUEhIQzFYdmxvQ0RpcDE5TWhuUFo2?=
 =?utf-8?B?aG1yNkVTc1R0cERGOXJGRUltcFY4S09BZnFKa3pTbmlUV3U3NTk0QmxndG13?=
 =?utf-8?B?SnhIZzUxTTQwMzZlbEIxOXpicW56NHYwWHJVT1VIeUt6dnppZ2xIRzUxRHZ0?=
 =?utf-8?Q?9N7qlbLfAkFmzNjWNxCMqns1o62lPmys?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 06:53:35.3470
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: e9f67441-7b80-485a-1ddf-08dcc7f74dce
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SA2PEPF00003AE9.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6130

Hi Victor,

On 29/08/2024 06:09, victorm.lira@amd.com wrote:
> 
> 
> From: Victor Lira <victorm.lira@amd.com>
> 
> Fix flaw in qemu-*.sh tests that producess a false success. The following
> lines produces success despite the "expect" script producing nonzero exit
> status.
> 
>     set +e
> ...
>     ./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
>     (end of file)
> 
> The "set +e" is sometimes needed for cleanup such as powering off hardware
> after running a test.
> 
> Fixes the CI failure introduced by 95764a0817.
You may want to use "Fixes" tag. See docs/process/sending-patches.pandoc.

> 
> Update xilinx-smoke tests to use the "expect" utility for early exit from
> tests. Generalize the variable names in the script "qemu-key.exp" to be
> used by both QEMU and hardware tests. Add a missing "-continue_timer" flag
> for the expect script to properly time out. Add "expect" to xilinx
> dockerfile.
This commit tries to do 2 thins at once:
 - fix "set +e" issue
 - make xilinx tests use expect

These should be 2 separate patches. The first patch should only remove "set +e" from qemu patches.
There is no need for fifo in qemu tests. You should use that only in xilinx tests where we cannot remove "set +e".

~Michal


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 07:01:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 07:01:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785496.1194947 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjZ9u-0001Zc-0r; Thu, 29 Aug 2024 07:01:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785496.1194947; Thu, 29 Aug 2024 07:01:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjZ9t-0001ZV-UW; Thu, 29 Aug 2024 07:01:29 +0000
Received: by outflank-mailman (input) for mailman id 785496;
 Thu, 29 Aug 2024 07:01: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=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjZ9s-0001ZP-MC
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 07:01:28 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 82a7ba91-65d4-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 09:01:27 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a8679f534c3so28372266b.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 00:01:27 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8988feb580sm37683366b.37.2024.08.29.00.01.25
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 00:01:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 82a7ba91-65d4-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724914887; x=1725519687; 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=wLjJVm7rPDH9Bf7DDhBSF5Plw2vcj0VaFk1mowMV8ck=;
        b=fbz4i9Kya1Mrkj4g2XUtxSS0mbhvH38Dcv9zkxAepJckXOJqD2z4mzTMRVKo9R36ga
         ilf7lRIolv3b+vfYO/K0e0ValmQ7IDx5MPxjsaAnNXFCHYrS9jgtAo9NreVC1YKtcVVi
         a3UPouB44ewU6K+OekZb2IcbpkclBXzxeYyIkNC2386c2QMsLONp3GmjPCYBFPXfWcFu
         0wu0X4ogXV4IKDVghcXPBfNLBhW27SAWx5ilUC4eWEIY0VJpy4eg0zGBpGz0SN1VVy1H
         0w7SLtBtWANLPRrKxk9PoOF+rjSLau0ZaEGe1ujFbTJeVjH0PdkuO+jgcXXjCG46ETEU
         uqCA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724914887; x=1725519687;
        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=wLjJVm7rPDH9Bf7DDhBSF5Plw2vcj0VaFk1mowMV8ck=;
        b=Ey9DQFi3ABukGJd5Rfgk6+pIZ9SgxQrsS4+zjqPlm0DQR9bEDE2cN8osEfX43dIMZU
         HSX9UhdwLU67hDdzirqrA98kTZRKPptCECCAD+Ye2aYFBwXjaAzEvocgrFJ8E9OyThmJ
         LQs1eqm48T97P5n/fsGYnXrb4lhhoofGCNIlbv5TWFwcVy4YFmVH13EFvhy/KViS3eOK
         BkgBlvLmYPAPEkHBReohk+bf0N6fsplKWNcMa/9KHQZMM7C4nwTARIThW57AFoV1Xx7c
         M7LywTIM55yG/MeKNoU9ckgHJ9P1prJPj6EeZBBjzp9WdyfDYU61AgvPNyLN+Al80b3T
         XcqA==
X-Forwarded-Encrypted: i=1; AJvYcCXENmC5TMAH+nXs7EhHhs2XJfx+nXH+pFrH1KaRalGvtOOUPJpA/b0EE3ZEcCikA6mi4hlBGC4WJi0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyFBfHu4SknnbVQ21nCtf8cq/ljkOxc6O7r+EY4vG1eEykCdg6B
	4lRWIhai4Rc+RRmQ4Tdx/AvoyZOCChXf3Q16k16to9Y0yiVQDraF553KbLqzlg==
X-Google-Smtp-Source: AGHT+IEjOGpQWvQ+zYUDVlcIIpu4/ck3qaONzafUOyMsJoHQ2m7YNuNQhgHS+GOV4p1qh/fdjOJwFA==
X-Received: by 2002:a17:907:7ba0:b0:a86:8a89:3d7e with SMTP id a640c23a62f3a-a897f930bc8mr105643366b.41.1724914886424;
        Thu, 29 Aug 2024 00:01:26 -0700 (PDT)
Message-ID: <b83e7d23-2171-447f-a4e5-48563e4068a5@suse.com>
Date: Thu, 29 Aug 2024 09:01:24 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 6/7] xen/riscv: page table handling
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
 <090e617d88b279ae88f1a7859875a7e1a0c6ae73.1724256027.git.oleksii.kurochko@gmail.com>
 <c0005454-3b34-427d-8ea0-620aba632487@suse.com>
 <ed84c53454cb63082aa96befe89a89d8f234ef71.camel@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: <ed84c53454cb63082aa96befe89a89d8f234ef71.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 28.08.2024 18:11, oleksii.kurochko@gmail.com wrote:
> On Tue, 2024-08-27 at 17:00 +0200, Jan Beulich wrote:
>> On 21.08.2024 18:06, Oleksii Kurochko wrote:
>>> Implement map_pages_to_xen() which requires several
>>> functions to manage page tables and entries:
>>> - pt_update()
>>> - pt_mapping_level()
>>> - pt_update_entry()
>>> - pt_next_level()
>>> - pt_check_entry()
>>>
>>> To support these operations, add functions for creating,
>>> mapping, and unmapping Xen tables:
>>> - create_table()
>>> - map_table()
>>> - unmap_table()
>>>
>>> Introduce internal macros starting with PTE_* for convenience.
>>> These macros closely resemble PTE bits, with the exception of
>>> PTE_SMALL, which indicates that 4KB is needed.
>>
>> What macros are you talking about here? Is this partially stale, as
>> only PTE_SMALL and PTE_POPULATE (and a couple of masks) are being
>> added?
> I am speaking about macros connected to masks:
>      #define PTE_R_MASK(x)   ((x) & PTE_READABLE)
>      #define PTE_W_MASK(x)   ((x) & PTE_WRITABLE)
>      #define PTE_X_MASK(x)   ((x) & PTE_EXECUTABLE)
>    
>      #define PTE_RWX_MASK(x) ((x) & (PTE_READABLE | PTE_WRITABLE |
>    PTE_EXECUTABLE))

Some of which is did question further down in my reply. But what's
worse - by saying "closely resemble PTE bits, with the exception of
PTE_SMALL" you pretty clearly _do not_ refer to the macros above, but
to PTE_VALID etc.

>>> @@ -68,6 +111,20 @@ static inline bool pte_is_valid(pte_t p)
>>>      return p.pte & PTE_VALID;
>>>  }
>>>  
>>> +inline bool pte_is_table(const pte_t p)
>>> +{
>>> +    return ((p.pte & (PTE_VALID |
>>> +                      PTE_READABLE |
>>> +                      PTE_WRITABLE |
>>> +                      PTE_EXECUTABLE)) == PTE_VALID);
>>> +}
>>
>> In how far is the READABLE check valid here? You (imo correctly) ...

Oh, I wrongly picked on READABLE when it should have been the WRITABLE
bit.

>>> +static inline bool pte_is_mapping(const pte_t p)
>>> +{
>>> +    return (p.pte & PTE_VALID) &&
>>> +           (p.pte & (PTE_WRITABLE | PTE_EXECUTABLE));
>>> +}
>>
>> ... don't consider this bit here.
> pte_is_mapping() seems to me is correct as according to the RISC-V
> privileged spec:
>    4. Otherwise, the PTE is valid. If pte.r = 1 or pte.x = 1, go to step 
>    5. Otherwise, this PTE is a pointer to the next level of the page   
>    table.
>    5. A leaf PTE has been found. ...

Right. And then why do you check all three of r, x, and w, when the doc
mentions only r and x? There may be reasons, but such reasons then need
clearly stating in a code comment, for people to understand why the code
is not following the spec.

> and regarding pte_is_table() READABLE check is valid as we have to
> check only that pte.r = pte.x = 0. WRITABLE check should be dropped. Or
> just use define pte_is_table() as:
>    inline bool pte_is_table(const pte_t p)
>    {
>    	return !pte_is_mapping(p);
>    }

You had it like this earlier on, didn't you? That's wrong, because for a
PTE to describe another page table level PTE_VALID needs to be set.

>>> --- /dev/null
>>> +++ b/xen/arch/riscv/pt.c
>>> @@ -0,0 +1,420 @@
>>> +#include <xen/bug.h>
>>> +#include <xen/domain_page.h>
>>> +#include <xen/errno.h>
>>> +#include <xen/mm.h>
>>> +#include <xen/mm-frame.h>
>>> +#include <xen/pmap.h>
>>> +#include <xen/spinlock.h>
>>> +
>>> +#include <asm/flushtlb.h>
>>> +#include <asm/page.h>
>>> +
>>> +static inline const mfn_t get_root_page(void)
>>> +{
>>> +    paddr_t root_maddr = (csr_read(CSR_SATP) & SATP_PPN_MASK) <<
>>> PAGE_SHIFT;
>>> +
>>> +    return maddr_to_mfn(root_maddr);
>>> +}
>>> +
>>> +/* Sanity check of the entry. */
>>> +static bool pt_check_entry(pte_t entry, mfn_t mfn, unsigned int
>>> flags)
>>> +{
>>> +    /*
>>> +     * See the comment about the possible combination of (mfn,
>>> flags) in
>>> +     * the comment above pt_update().
>>> +     */
>>> +
>>> +    /* Sanity check when modifying an entry. */
>>> +    if ( (flags & PTE_VALID) && mfn_eq(mfn, INVALID_MFN) )
>>> +    {
>>> +        /* We don't allow modifying an invalid entry. */
>>> +        if ( !pte_is_valid(entry) )
>>> +        {
>>> +            printk("Modifying invalid entry is not allowed.\n");
>>
>> Perhaps all of these printk()s should be dprintk()?
> It could be dprintk() but at the same time I don't see any issue if it
> will be printed once.

What guarantees that it wouldn't be logged over and over? It's simply
bad practice to accompany all error returns with log messages, even
in release builds. Even if right now you're only in the bring-up phase,
you still want to have security in mind. If any such log message ended
up reachable from a guest-invoked path, an XSA would be needed.

>>  And not have a full
>> stop?
> By "full stop," do you mean something like panic() or BUG_ON()?

No. "Full stop" is the period at the end of a sentence (which shouldn't
normally be there at the end of log messages).

>>> +        /*
>>> +         * We don't allow replacing any valid entry.
>>> +         *
>>> +         * Note that the function pt_update() relies on this
>>> +         * assumption and will skip the TLB flush (when Svvptc
>>> +         * extension will be ratified). The function will need
>>> +         * to be updated if the check is relaxed.
>>> +         */
>>> +        if ( pte_is_valid(entry) )
>>> +        {
>>> +            if ( pte_is_mapping(entry) )
>>> +                printk("Changing MFN for a valid entry is not
>>> allowed (%#"PRI_mfn" -> %#"PRI_mfn").\n",
>>> +                       mfn_x(mfn_from_pte(entry)), mfn_x(mfn));
>>> +            else
>>> +                printk("Trying to replace a table with a
>>> mapping.\n");
>>> +            return false;
>>> +        }
>>> +    }
>>> +    /* Sanity check when removing a mapping. */
>>> +    else if ( (flags & (PTE_VALID | PTE_POPULATE)) == 0 )
>>
>> The PTE_VALID part of the check is pointless considering the earlier
>> if(). I guess you may want to have it for doc purposes ...
> Yes, it just helps to read the code and understand "confusing" if's()
> above.

Well, since you mention "confusing": I for one consider such redundant
checks confusing. It raises the question whether this check is wrong or
the earlier one is. Therefore, if you want to keep the redundancy, it
may help if you extend the comment to mention it's actually redundant
(e.g. by saying "for completeness" or some such).

>>> +#define XEN_TABLE_MAP_FAILED 0
>>> +#define XEN_TABLE_SUPER_PAGE 1
>>> +#define XEN_TABLE_NORMAL 2
>>> +
>>> +/*
>>> + * Take the currently mapped table, find the corresponding entry,
>>> + * and map the next table, if available.
>>> + *
>>> + * The alloc_tbl parameters indicates whether intermediate tables
>>> should
>>> + * be allocated when not present.
>>> + *
>>> + * Return values:
>>> + *  XEN_TABLE_MAP_FAILED: Either alloc_only was set and the entry
>>> + *  was empty, or allocating a new page failed.
>>> + *  XEN_TABLE_NORMAL: next level or leaf mapped normally
>>> + *  XEN_TABLE_SUPER_PAGE: The next entry points to a superpage.
>>> + */
>>> +static int pt_next_level(bool alloc_tbl, pte_t **table, unsigned
>>> int offset)
>>
>> Having the boolean first is unusual, but well - it's your choice.
>>
>>> +{
>>> +    pte_t *entry;
>>> +    int ret;
>>> +    mfn_t mfn;
>>> +
>>> +    entry = *table + offset;
>>> +
>>> +    if ( !pte_is_valid(*entry) )
>>> +    {
>>> +        if ( alloc_tbl )
>>> +            return XEN_TABLE_MAP_FAILED;
>>
>> Is this condition meant to be inverted?
> if alloc_tbl = true we shouldn't allocatetable as:
>      * The intermediate page table shouldn't be allocated when MFN
> isn't
>      * valid and we are not populating page table.
> ...
>     */

Well, no. The variable name really shouldn't be the opposite of what is
meant. "alloc_tbl" can only possibly mean "allocate a table if none is
there". I can't think of a sensible interpretation in the inverted sense.
I'm curious how you mean to interpret that variable name.

>     bool alloc_tbl = mfn_eq(mfn, INVALID_MFN) && !(flags &
> PTE_POPULATE);
> 
> So if mfn = INVALID_MFN and flags.PTE_POPULATE=0 it means that this
> table shouldn't be allocated and thereby pt_next_level() should return
> XEN_TABLE_MAP_FAILED.
> 
> Or to invert if ( alloc_tbl )it will be needed to invert defintion of
> alloc_tbl:
>  bool alloc_tbl = !mfn_eq(mfn, INVALID_MFN) || (flags & PTE_POPULATE);

Yes, as I did comment further down.

>>> +    if ( level != target )
>>> +    {
>>> +        printk("%s: Shattering superpage is not supported\n",
>>> __func__);
>>> +        rc = -EOPNOTSUPP;
>>> +        goto out;
>>> +    }
>>> +
>>> +    entry = table + offsets[level];
>>> +
>>> +    rc = -EINVAL;
>>> +    if ( !pt_check_entry(*entry, mfn, flags) )
>>> +        goto out;
>>> +
>>> +    /* We are removing the page */
>>> +    if ( !(flags & PTE_VALID) )
>>> +        memset(&pte, 0x00, sizeof(pte));
>>> +    else
>>> +    {
>>> +        /* We are inserting a mapping => Create new pte. */
>>> +        if ( !mfn_eq(mfn, INVALID_MFN) )
>>> +            pte = pte_from_mfn(mfn, PTE_VALID);
>>> +        else /* We are updating the permission => Copy the current
>>> pte. */
>>> +            pte = *entry;
>>> +
>>> +        /* update permission according to the flags */
>>> +        pte.pte |= PTE_RWX_MASK(flags) | PTE_ACCESSED | PTE_DIRTY;
>>
>> When updating an entry, don't you also need to clear (some of) the
>> flags?
> I am not sure why some flags should be cleared. Here we are taking only
> necessary for pte flags such as R, W, X or other bits in flags are
> ignored.

Consider what happens to a PTE with R and X set when a request comes in
to change to R/W. You'll end up with R, X, and W all set if you don't
first clear the bits that are meant to be changeable in a "modify"
operation.

>>> +/* Return the level where mapping should be done */
>>> +static int pt_mapping_level(unsigned long vfn, mfn_t mfn, unsigned
>>> long nr,
>>> +                            unsigned int flags)
>>> +{
>>> +    unsigned int level = 0;
>>> +    unsigned long mask;
>>> +    unsigned int i;
>>> +
>>> +    /* Use blocking mapping unless the caller requests 4K mapping
>>> */
>>> +    if ( unlikely(flags & PTE_SMALL) )
>>> +        return level;
>>> +
>>> +    /*
>>> +     * Don't take into account the MFN when removing mapping (i.e
>>> +     * MFN_INVALID) to calculate the correct target order.
>>> +     *
>>> +     * `vfn` and `mfn` must be both superpage aligned.
>>> +     * They are or-ed together and then checked against the size
>>> of
>>> +     * each level.
>>> +     *
>>> +     * `left` is not included and checked separately to allow
>>> +     * superpage mapping even if it is not properly aligned (the
>>> +     * user may have asked to map 2MB + 4k).
>>
>> What is this about? There's nothing named "left" here.
> It refer to "remaining" pages or "leftover" space after trying to align
> a mapping to a superpage boundary.

What what is the quoted "left" here? Such a variable appears to exist in
the caller, but using the name here is lacking context.

>>> +/*
>>> + * If `mfn` equals `INVALID_MFN`, it indicates that the following
>>> page table
>>> + * update operation might be related to either populating the
>>> table (
>>> + * PTE_POPULATE will be set additionaly), destroying a mapping, or
>>> modifying
>>> + * an existing mapping.
>>
>> And the latter two are distinguished by? PTE_VALID?
> inserting -> (PTE_VALID=1 + (mfn=something valid))
> destroying-> ( PTE_VALID=0 )

Which then needs saying in the comment.

>>> + * If `mfn` is valid and flags has PTE_VALID bit set then it means
>>> that
>>> + * inserting will be done.
>>> + */
>>
>> What about mfn != INVALID_MFN and PTE_VALID clear?
> PTE_VALID=0 will be always considered as destroying and no matter what
> is mfn value as in this case the removing is done in the way where mfn
> isn't used:

Right, yet elsewhere you're restrictive as to MFN values valid to use.
Not requiring INVALID_MFN here looks inconsistent to me.

>         memset(&pte, 0x00, sizeof(pte));

Just to mention it: I don't think memset() is a very good way of clearing
a PTE, even if right here it's not a live one.

>>  Also note that "`mfn` is
>> valid" isn't the same as "mfn != INVALID_MFN". You want to be precise
>> here,
>> to avoid confusion later on. (I say that knowing that we're still
>> fighting
>> especially shadow paging code on x86 not having those properly
>> separated.)
> If it is needed to be precise and mfn is valid isn't the same as "mfn
> != INVALID_MFN" only for the case of shadow paging?

No, I used shadow paging only as an example of where we have similar
issues. I'd like to avoid that a new port starts out with introducing
more instances of that. You want to properly separate INVALID_MFN from
"invalid MFN", where the latter means any MFN where either nothing
exists at all, or (see mfn_valid()) where no struct page_info exists.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 07:04:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 07:04:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785505.1194959 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjZD0-0002Cy-K8; Thu, 29 Aug 2024 07:04:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785505.1194959; Thu, 29 Aug 2024 07:04:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjZD0-0002Cr-Fe; Thu, 29 Aug 2024 07:04:42 +0000
Received: by outflank-mailman (input) for mailman id 785505;
 Thu, 29 Aug 2024 07:04:41 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjZCz-0002Cl-24
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 07:04:41 +0000
Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com
 [2a00:1450:4864:20::633])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f503e8cf-65d4-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 09:04:39 +0200 (CEST)
Received: by mail-ej1-x633.google.com with SMTP id
 a640c23a62f3a-a86c476f679so30040366b.1
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 00:04:39 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89892225bbsm37538966b.199.2024.08.29.00.04.37
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 00:04:38 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f503e8cf-65d4-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724915078; x=1725519878; 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=Gnd9JCsY88DYXal7dEGnFfeZUo5ombkAjR8uLdQZKUc=;
        b=I87NC6lI+5GjdWhzAYwrRKQGHfgbaiAQ3yQv/OTdqzJJpBeFIn0vw76zcLNoKB/NK1
         28T5R9NLr4vgiWLo3RTFJPA8H/0FfPF9Nadfwpzb5wJ10SXqBFKuGUR1hEwQSqFVHA8v
         Vf/S28UH/ecocMQxkTpikQl9Us/ZAfOLC3GpbNvupGqTlP9CbJQAm0OhAY9C6tzOzPWD
         8MqYmZz0X7A38QnEM4/BEfErhflt+1Jxo9FcQyqYud32KGbx7REEhZNSXFQ7f99oGxRk
         ayQvk+MHzZNXtvtfWJx9QYDhCwy0YWnTLloWyyg5/X+hUqtxrmfuF3N4RZs++4OkEWdv
         4Nrw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724915078; x=1725519878;
        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=Gnd9JCsY88DYXal7dEGnFfeZUo5ombkAjR8uLdQZKUc=;
        b=o7ZceapFpxnM17sKGko1X07qNZunYoAcCAC/CDQjqcoz+0pN28Ydu5CCXWn41pf5aS
         1rehCSjgQbfIi3QmtGNBtao0m3fxAt+jX91rNeBABjq0Iv/I6IQFq75iwjVPiPQv5VeK
         1VQSPIoHIW5gHIT5gftfP0zcSTsiq7mG4pC5f6knRIzGU0VC2qvojkcGBGBZGYfJpljd
         GEN/KoivGLO7QiXM5s6WDtGsoZXbmoj1gwZp2BBthttVwaTGs4EH0DzozZH6rJgz3d8S
         9WYFFUmUub1xgOrN7EoboRff2J2DQeCEDVQths7irOagxXj36Un2SmyjnlJT73MTRmr2
         p4gw==
X-Forwarded-Encrypted: i=1; AJvYcCXjFnQbSEYAAe1PAQvzLe10qOhIyGXQBOaibEUoobVX4bL7dFsBNgS+HiirkEEpVL7pmO485KUPjHs=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwHS7+iN+QEd9etb6FluD1XOzJZu5sTkptGQjNxpd/GuDHZN7uN
	TAt/IrEq6xBGOSHquyGUg5cdXS8/SgzVU1Ps5b2YI9aHWsdZM0uBoWsg39B9Rw==
X-Google-Smtp-Source: AGHT+IHmUEzxRyUnBA0E2PO1lmvXVgIdqt9KMs3Xt5mBb71h06wLqmBUginCOylyTyG21b1/S7Qryw==
X-Received: by 2002:a17:907:9686:b0:a86:96d1:d1b with SMTP id a640c23a62f3a-a897f83ad1amr121496266b.16.1724915078389;
        Thu, 29 Aug 2024 00:04:38 -0700 (PDT)
Message-ID: <da5d2ccc-6a21-4bcc-8ceb-75b930dcdabe@suse.com>
Date: Thu, 29 Aug 2024 09:04:37 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v5 7/8] x86/mm: add defensive return
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Federico Serafini <federico.serafini@bugseng.com>,
 xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <cover.1722239813.git.federico.serafini@bugseng.com>
 <24501d2e7f5d82d8e5a483a80b35e04ce765a7cf.1722239813.git.federico.serafini@bugseng.com>
 <alpine.DEB.2.22.394.2407291512280.4857@ubuntu-linux-20-04-desktop>
 <alpine.DEB.2.22.394.2408281735020.53815@ubuntu-linux-20-04-desktop>
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: <alpine.DEB.2.22.394.2408281735020.53815@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 29.08.2024 02:35, Stefano Stabellini wrote:
> On Mon, 29 Jul 2024, Stefano Stabellini wrote:
>> On Mon, 29 Jul 2024, Federico Serafini wrote:
>>> Add defensive return statement at the end of an unreachable
>>> default case. Other than improve safety, this meets the requirements
>>> to deviate a violation of MISRA C Rule 16.3: "An unconditional `break'
>>> statement shall terminate every switch-clause".
>>>
>>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
>>
>> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
>>
>>> ---
>>> No changes from v3 and v4, further feedback on this thread would be appreciated:
>>> https://lists.xenproject.org/archives/html/xen-devel/2024-07/msg00474.html
> 
> Looking at the older threads, I looks like Jan suggested EACCES, I also
> think it is marginally better. My R-b stands also for EACCES. Jan, I
> think you should go ahead and fix on commit

No, I very definitely want a 2nd x86 maintainer opinion here. Or a better
suggestion for the error code to use by anyone. After all, as you confirm,
EACCES is only marginally better.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 07:29:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 07:29:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785512.1194968 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjZaT-0007TS-9X; Thu, 29 Aug 2024 07:28:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785512.1194968; Thu, 29 Aug 2024 07:28:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjZaT-0007TL-5k; Thu, 29 Aug 2024 07:28:57 +0000
Received: by outflank-mailman (input) for mailman id 785512;
 Thu, 29 Aug 2024 07:28:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=v/9N=P4=amd.com=Michal.Orzel@srs-se1.protection.inumbo.net>)
 id 1sjZaR-0007TF-3m
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 07:28:55 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on20628.outbound.protection.outlook.com
 [2a01:111:f403:2414::628])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 55f5392d-65d8-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 09:28:51 +0200 (CEST)
Received: from MW4PR04CA0222.namprd04.prod.outlook.com (2603:10b6:303:87::17)
 by DM4PR12MB6011.namprd12.prod.outlook.com (2603:10b6:8:6b::14) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug
 2024 07:28:46 +0000
Received: from CO1PEPF000044F4.namprd05.prod.outlook.com
 (2603:10b6:303:87:cafe::6) by MW4PR04CA0222.outlook.office365.com
 (2603:10b6:303:87::17) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend
 Transport; Thu, 29 Aug 2024 07:28:46 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CO1PEPF000044F4.mail.protection.outlook.com (10.167.241.74) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 07:28:45 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 29 Aug
 2024 02:28:45 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 29 Aug
 2024 02:28:45 -0500
Received: from [10.252.147.188] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Thu, 29 Aug 2024 02:28:43 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 55f5392d-65d8-11ef-99a0-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=XaJBDgwP5Ok6e5wfc6elFBVdOhCt3kETSANWowtGLL4Vj66pafaJ1geyXKL0QrYpdX3yRVpMyd1IAgtituIrla00YdsZm2qLQyT4vRmqqHDbaR1QyiMcZ8KcpxITmtn/MXo/IOv5kvMP+UyGI9cosvOA1To+5sRmVwdGNhl7zXTJ0/xzRLedeg0N10UJpnIpTIvanGofjS7+7u2BRLsvrjm1RsT8dIhYncBo+tiqb2f6R1azkf+/CU9qXrLkh7UiZXplyIxW3/KcS8oTS1C1bOZzQCOHjvZ0qNoudBNcIObHSYsXVWO1nweU7FeWTAlWEAlxxkhIoRiSupO0x8AcIg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=LvDgCUlzTqKh0t/JzhHySZPFUzHRBypWW0m9/XxgAAE=;
 b=XYrh0iVc42g3KGPlQQotkRK+xzK68ka4o4HzVY4XfNDDOy6o0bo7QXmBsmtW6gGeg5D7ytMgqDTUy2LGH9+coJMjptzWD8gTy35C0IpEPerRv14uO6WK9cSWvyLtCQycsYe1tt7dqIHp3q7TrRE7H0rSTZlns1Ch89SBm/cxEGw9J8VF6/36daRTCRhUPkxNiOvYgjOUEU+wzbOOHFb/yOpdN6jgLe/kiMEkC6YLYB9kSfIP+s/qZWam0qygCuN5rSPBn38CfEZ+QZiJ7OfrJlkEkqJfClS/3NP7kdTk7TS9rx+NX51wCvmz4+ohLZruVm+Wr2G7uP+chfgIitXw9g==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass
 (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com;
 dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=LvDgCUlzTqKh0t/JzhHySZPFUzHRBypWW0m9/XxgAAE=;
 b=l/bAymd8XMLwrL0pDlL7kXK1JqCDZP3x5Zrlxk0w6+cM11ywVq3HzXCdKzwXNtdbp3u/GcMNizVZV+JwTxbiCzL3oY6y5erTgSg5OoLzRmCE/ZwNv4Grryup4uUji6D9HA3RVOifbcTO8usJzCMrLJp1I7QvKYE2qWy2VrsADy0=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <4d895ba4-bcf2-472d-be7e-d9747382301d@amd.com>
Date: Thu, 29 Aug 2024 09:28:42 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] Arm64: adjust __irq_to_desc() to fix build with gcc14
To: Jan Beulich <jbeulich@suse.com>, "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
CC: Julien Grall <julien@xen.org>, Stefano Stabellini
	<sstabellini@kernel.org>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
	Bertrand Marquis <bertrand.marquis@arm.com>
References: <9cc9e16d-a4b0-4902-9f12-a7cb337b1763@suse.com>
Content-Language: en-US
From: Michal Orzel <michal.orzel@amd.com>
In-Reply-To: <9cc9e16d-a4b0-4902-9f12-a7cb337b1763@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
Received-SPF: None (SATLEXMB05.amd.com: michal.orzel@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CO1PEPF000044F4:EE_|DM4PR12MB6011:EE_
X-MS-Office365-Filtering-Correlation-Id: e7566635-ae38-4ce7-9726-08dcc7fc37c3
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|376014|82310400026|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?RFI2bXBVd0hOejNJUk9YeFV3L1dYYzVyUzUvUHBOSTRCN2FNYjdVem1ONDh0?=
 =?utf-8?B?R3FueUR2T3R4TzB4YVUvVjgxUGpmcGhHc05xbmJiY1V6VnJRNVNydkVheEl4?=
 =?utf-8?B?ZWxGbktWT2k3OWtLUCtya1hZbGd3MFc3YXY4TjFuMHFOeUYvZ05GS0Urbk9z?=
 =?utf-8?B?R2xpc3F5Kzcra1VZR2YwMWZwQ1lLVXAvaGxacmpHMXc0ZkpnTm5Fd3g0M2g3?=
 =?utf-8?B?RWE5OVc0L24vdFlsdVIvOWtST1dUZjhyR2h6dzdkdEtBaGlpbTNFQ1ZHeW5v?=
 =?utf-8?B?d25HcWRlZGgvL3o2UDRCSHNpa2dKbjQwaFB2Mjc4cEs2MlhtZ3kwajRkSkl6?=
 =?utf-8?B?L0RUWjdtSTFYV0dhTC84djNqd3JPb1U5UmFFTEZjTjI0Ly9tK0NsSVFTVFNh?=
 =?utf-8?B?YVJYZ1NJWm5OZDBFcnVNRUx5OHZNOXo3L0FDWEZKMUFuK0d5TDIyM3duWnpY?=
 =?utf-8?B?eUJxV3p0UTBEd3hLR2FRNE9hVEszdmpiK09zc2Q5SHVlS2ZFaHZIWHlFT2ov?=
 =?utf-8?B?YWpBY1FkZ2lBZVFvWEpIMFhzcmROVVNGWnp5OVltVWJJY2I4dks2NFEyanNo?=
 =?utf-8?B?MWo0ZStFcGIwa2R0dWpHUi9hcGx4VXE5cXBYM3M2TjBUZkY0bmFpYUV0NEd5?=
 =?utf-8?B?cGFNYlZ0V0NYSG5DdUlxQ1kycVg3Sy9pUEhCWHNDR3d2cng4elF4eDB4NTJI?=
 =?utf-8?B?Q1RlNFlrZFBpbHpaa1lBd0dCTHVJZVMvY3Q1VTdMMkpsVmpJYjFQYndKUlY0?=
 =?utf-8?B?dWF5SktOK1FlVVd2VDBocmhQMkkxTENzaEllTzNQdVlUOE56RjQ4U0JqOGVQ?=
 =?utf-8?B?Qk92Wms4SUZCNDJWNmkwaWlVUkN3eGhUZENKdlp6eFprZ0k0WHN4aUdWUFdF?=
 =?utf-8?B?Q0dTcHY1TmJDU2t2SlJQY09qWno1dm40Y1JHeHlJSUEvVDBXdi8xRGpzYXJn?=
 =?utf-8?B?ZkJ6NnhTTmFkaFRFMlJvaWIrNGJDNlVSK3dDVHhUK2JLajczM2EwaHdyNkJ1?=
 =?utf-8?B?V2J4L1A2RlBvZTMyK0Y2VDREYmtVMjdMQnA0WGtUOGlzM2JGTDJYdEdRZjdw?=
 =?utf-8?B?UDBsQW5XYVl0MWVFbFhXQWNjcDFQSUtEMXYxeVA2R016NnVDTjVEUEVhdG5q?=
 =?utf-8?B?RWIzamZTRXdYR3JyYWdiRm4vRm8xL2hDTDl5R2pwVTB3MEtBbnVMQnN5VDZS?=
 =?utf-8?B?Z21FcXBPeDQzK3BmLzJOQ0Y4SjhUU1FnSnR0QlZIYk05TVBJZVJPRXY2Vkwy?=
 =?utf-8?B?STNmb0JkL2p0SHJRb3pibzMvemVLbUdiQ3BTN3dST003N1FxTmRLVmZjcTAv?=
 =?utf-8?B?eUROUE5rWnFBd000ZGxjTlJqM2ZQYkY4RDFubDh6M2dXbzJxZGlUSG13R0lT?=
 =?utf-8?B?elMwT2laSzl2aHRIR2I3b2ZZTHRuK0hNSitaaTd2R1p0dEo0RVZ1UXJZUTRr?=
 =?utf-8?B?K2ZzUTFxK0VzdysycFlTM3BJNGdVR2s4UjdMdHpjeWJKb2NqbmFnS1h6SlBw?=
 =?utf-8?B?MktIK2N3dHB2c0t3OUZWbndpU3V6bmNLc3QwVzhpemVpNHB4eTAxSFZpWEdy?=
 =?utf-8?B?M1NablliQXliNURMaVVtREE5cEJRY2d1cEo2VzFlUlVRWnBhSlJUNlUrWlJy?=
 =?utf-8?B?bCtFcG9HeVdGSUtQRTBiVjdwT0hJanlXMzI0WXc2VHZhS1gvaDRBbkFoNjV6?=
 =?utf-8?B?a09JRCtxVXN2QUlRWmxqTjNFbzViaEt6SXdTNUFmUGhQQVlmZHpuZExWTEFx?=
 =?utf-8?B?cjlnYmIvZ2EzbjFSQXJ5TmhWam1yZkJtYll4ZnQvRXV4ckR0aEtNUk4xWkla?=
 =?utf-8?B?VlNNeHJtNmp5NWpXSlVNMFRjTlJrS0liSDJuR0k0NnM1SGUyUzdQbUZlMUZa?=
 =?utf-8?B?TS9Bb0UyYlYwMUNzOGxycmhoeFM0b0JjZGRSWnZUMEMyb3BzQjdhL2V6R0M0?=
 =?utf-8?Q?lhXxvhzDRZhjcvKfjL/SrRxig7r0e4KK?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(82310400026)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 07:28:45.7425
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: e7566635-ae38-4ce7-9726-08dcc7fc37c3
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CO1PEPF000044F4.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6011



On 29/08/2024 07:55, Jan Beulich wrote:
> 
> 
> With the original code I observe
> 
> In function ‘__irq_to_desc’,
>     inlined from ‘route_irq_to_guest’ at arch/arm/irq.c:465:12:
> arch/arm/irq.c:54:16: error: array subscript -2 is below array bounds of ‘irq_desc_t[32]’ {aka ‘struct irq_desc[32]’} [-Werror=array-bounds=]
>    54 |         return &this_cpu(local_irq_desc)[irq];
>       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> which looks pretty bogus: How in the world does the compiler arrive at
> -2 when compiling route_irq_to_guest()? Yet independent of that the
> function's parameter wants to be of unsigned type anyway, as shown by
> a vast majority of callers (others use plain int when they really mean
> non-negative quantities). With that adjustment the code compiles fine
> again.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Michal Orzel <michal.orzel@amd.com>

Are there any places where we still require irq member of irq_desc to be signed?

~Michal


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 07:31:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 07:31:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785516.1194977 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjZcj-0000TP-Ko; Thu, 29 Aug 2024 07:31:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785516.1194977; Thu, 29 Aug 2024 07:31:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjZcj-0000TI-I0; Thu, 29 Aug 2024 07:31:17 +0000
Received: by outflank-mailman (input) for mailman id 785516;
 Thu, 29 Aug 2024 07:31: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=h9f7=P4=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sjZci-0000TA-CC
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 07:31:16 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id abd8471f-65d8-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 09:31:14 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a7a9cf7d3f3so30363766b.1
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 00:31:14 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8988feb072sm40635566b.28.2024.08.29.00.31.12
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 29 Aug 2024 00:31:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: abd8471f-65d8-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724916674; x=1725521474; darn=lists.xenproject.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=0MpogHJ9hNwyoLioWPtbtmNpT3TYed6fG+b23Bzg2nQ=;
        b=I3tI31LAGzV/bPa2LIhLLky8GejRMPn6pwDNTuA6fn5d1h/xJlrIDwY0mVa1lK8YE7
         TUZEE3J8CK80ysooi32X2c7Bts+Oy32zuNuyRwHwHVm5hwfMz76hP2VR+kP/hrnZMcNL
         Jujhdc7iPXlYve14+OvGyU6twZC24P2nN4G98=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724916674; x=1725521474;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=0MpogHJ9hNwyoLioWPtbtmNpT3TYed6fG+b23Bzg2nQ=;
        b=Kvw2mkSsViBlhYUc+euFYJq2o1Ghe9eJopREPx9ChEKxxXo3oXveNy1SS7BG8Ve7YH
         i0X2NGC2qPYCXnCOLTHw5flMnEIVPlwdInTwwY0Iql5fWXeDk2uoaohuxLxzYUDSazD0
         GdxEg/W7aLzN6kXMyOPgASRmRzSU6WawJGE8mM/L738lq8e5aBsqglxs+E9pafA1NjcU
         b/86J3LUgpLzgNIs253RqSD8MBFS80oDcCvkYmOhmC+bd2iTg1YLOgKHyCBgAIxgUQTM
         OfqMQkcBh1+VkP6BEPADWb6C/tVTKjjaS4dRduTA8sIdmWEsEVauueiUJCVlfLukx/MQ
         J/tA==
X-Forwarded-Encrypted: i=1; AJvYcCWUH31dNUSwZEqjtqvoAExfpwEmYbRH/ISEYo/eojWYBnH4SYo5J+Du8bT2gOIp/5WY9yFQJTAlMMg=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw0JfyOgU0RkYSY8MGksguKLjcdZrn4mye0WPN4O00XzuokiUrh
	gq9qOpR/de7FmeyhhDRkEkpMzfH52je+TyJknBNB7BmjuC9hazZDGFVXqAGur5A=
X-Google-Smtp-Source: AGHT+IFkuKYmBRsXT/a8mw8rZxoXTi5cK8IrMuZk1FL6qYXpPUBUIhXLuJtM8/ZkacV2pcmCnat9XA==
X-Received: by 2002:a17:907:3f24:b0:a86:9c41:cfc1 with SMTP id a640c23a62f3a-a897f775dd1mr149229966b.8.1724916673197;
        Thu, 29 Aug 2024 00:31:13 -0700 (PDT)
Date: Thu, 29 Aug 2024 09:31:11 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>, xen-devel@lists.xenproject.org
Subject: Re: [PATCH v6] x86/dom0: disable SMAP for PV domain building only
Message-ID: <ZtAjv6hdbPTZ1dGI@macbook.local>
References: <20240828113044.35541-1-roger.pau@citrix.com>
 <50658093-8463-4ee3-b308-31be2dd1fd42@suse.com>
 <bd206c4d-8e1d-488c-b428-3f6402a9ae4f@citrix.com>
 <Zs8gAuc5qoVsVkQe@macbook.local>
 <a5b4ca69-96ea-46d6-ab0d-2be4fd1d9d99@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <a5b4ca69-96ea-46d6-ab0d-2be4fd1d9d99@citrix.com>

On Wed, Aug 28, 2024 at 07:57:39PM +0100, Andrew Cooper wrote:
> On 28/08/2024 2:02 pm, Roger Pau Monné wrote:
> > On Wed, Aug 28, 2024 at 12:51:23PM +0100, Andrew Cooper wrote:
> >> On 28/08/2024 12:50 pm, Jan Beulich wrote:
> >>> On 28.08.2024 13:30, Roger Pau Monne wrote:
> >>>> Move the logic that disables SMAP so it's only performed when building a PV
> >>>> dom0, PVH dom0 builder doesn't require disabling SMAP.
> >>>>
> >>>> The fixes tag is to account for the wrong usage of cpu_has_smap in
> >>>> create_dom0(), it should instead have used
> >>>> boot_cpu_has(X86_FEATURE_XEN_SMAP).  Fix while moving the logic to apply to PV
> >>>> only.
> >>>>
> >>>> While there also make cr4_pv32_mask __ro_after_init.
> >>>>
> >>>> Fixes: 493ab190e5b1 ('xen/sm{e, a}p: allow disabling sm{e, a}p for Xen itself')
> >>>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> >>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> >>> preferably with ...
> >>>
> >>>> @@ -1051,6 +1051,34 @@ out:
> >>>>      return rc;
> >>>>  }
> >>>>  
> >>>> +int __init dom0_construct_pv(struct domain *d,
> >>>> +                             const module_t *image,
> >>>> +                             unsigned long image_headroom,
> >>>> +                             module_t *initrd,
> >>>> +                             const char *cmdline)
> >>>> +{
> >>>> +    int rc;
> >>>> +
> >>>> +    /*
> >>>> +     * Temporarily clear SMAP in CR4 to allow user-accesses in
> >>>> +     * construct_dom0().  This saves a large number of corner cases
> >>> ... the final 's' dropped here and ...
> >>>
> >>>> +     * interactions with copy_from_user().
> 
> 
> Actually, even with this adjustment the comment is still wonky.
> 
> The point is that we're clearing SMAP so we *don't* need to rewrite
> construct_dom0() in terms of copy_{to,from}_user().
> 
> I've adjusted it.

It did seem weird to me, I've assumed the wording was meaning to imply
that SMAP was disabled so that construct_dom0() didn't need to use
copy_from_user().

The comment you added seems fine to me, however there's a typo I
think:

    /*
     * Clear SMAP in CR4 to allow user-accesses in construct_dom0().  This
     * prevents us needing to write rewrite construct_dom0() in terms of
                              ^ extra?
     * copy_{to,from}_user().
     */

We can fix at some later point when modifying this.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 07:37:02 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 07:37:02 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785523.1194988 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjZiE-0001nv-7l; Thu, 29 Aug 2024 07:36:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785523.1194988; Thu, 29 Aug 2024 07:36:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjZiE-0001no-44; Thu, 29 Aug 2024 07:36:58 +0000
Received: by outflank-mailman (input) for mailman id 785523;
 Thu, 29 Aug 2024 07:36: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=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjZiC-0001ne-PS
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 07:36:56 +0000
Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com
 [2a00:1450:4864:20::531])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 77714401-65d9-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 09:36:55 +0200 (CEST)
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5c0a9f2b967so302322a12.2
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 00:36:55 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8988feae40sm42193166b.15.2024.08.29.00.36.54
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 00:36:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 77714401-65d9-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724917015; x=1725521815; 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=EPvKsDxamALFVizMxYoZYAq4FXmbltUGzR8tF5oi8H8=;
        b=UBZ4XH8Z0w+jItm6QdL+woaj6tYOiRl7SWgabHIWtKlQ/6zpkMg7VzkI9yNkkh6WxB
         Ntzkgrml93Q5nmxeN4iBcEro6m6KPBtGJiRTU0j4M1xBZoLZSnn0FIVmFqKnUKkQJR+g
         l79LB8DKZdC7+7l5mgkLNRH8GnzD3Ldtes3QOejn9CUFQzQub4VJQniz0HHPD4pyclt3
         13pZLdvJx9LKkO9HvWmOiZ4W0IIPj4ry9yNABXpOSwA+9ig+0R97RViV2CtEMxKH8ZUL
         SHFiku6S4GJLn4ya3K+1oZ4/7jwAxKCq6LvyPoCrgQy8XTTXvISqqDm7ESHWdcvLX8XZ
         hrXg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724917015; x=1725521815;
        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=EPvKsDxamALFVizMxYoZYAq4FXmbltUGzR8tF5oi8H8=;
        b=YLGRv5khb6x9sN1SFJ74i2kx0xcECZwPMcPi1nUtPAjmJN7D0ru2o3zfN38hnF1C6B
         xrcCmnKG41C5JrmXyOCT6qMeEKfo14kU+Bt6fUT/Xi/Q+kN6vkt+07K4+c8qITMxNHza
         vtb7U/OTqjt3kjXhu2eI/Q2Ic+gvQmCUFdquMEwALkvjsfsZMU74jb8ey+nuru/Eon7x
         eE6gtY1wJAoCWRads9yA4oaVwcCIewJjvGls0oMxL0wEGn1XjZezs8hRDYmqBewbUSQv
         1M7uLA4rbLbajsBtT77XTwGbys8qu7GLQ0359ysfsGA8Dnc9HOkboAdEc14J/DhDqHcb
         mW6A==
X-Forwarded-Encrypted: i=1; AJvYcCUu7/ToKrXdCWVtVC0zezjNTucL8MJMSzttjHbItKX79ZggJaDtodiaCW0plffRwO3Y58dFXzutu10=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwDwtL3BnXHQVL/FHtZOY3CmhgNRYbjRD15Vrlvli6b/wXdRYI6
	vB8pPfaFI7Vv25Iq3gIXWEdzpJv5o+NagxA1PI3HHv73q1sXcBLz+Bj0YKybdw==
X-Google-Smtp-Source: AGHT+IHCvI8ouXpFygZrpJUxrPMlfecWbR+ACdOo5etKh4QftjOiCrFYnUkGABiQbK7QlnvBYBvDYA==
X-Received: by 2002:a17:907:3e82:b0:a86:ba2e:1bab with SMTP id a640c23a62f3a-a897fa75285mr144301966b.45.1724917015207;
        Thu, 29 Aug 2024 00:36:55 -0700 (PDT)
Message-ID: <5837eb89-98c6-41af-9f13-7b9c05ced49e@suse.com>
Date: Thu, 29 Aug 2024 09:36:53 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] Arm64: adjust __irq_to_desc() to fix build with gcc14
To: Michal Orzel <michal.orzel@amd.com>
Cc: Julien Grall <julien@xen.org>, Stefano Stabellini
 <sstabellini@kernel.org>, Volodymyr Babchuk <volodymyr_babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <9cc9e16d-a4b0-4902-9f12-a7cb337b1763@suse.com>
 <4d895ba4-bcf2-472d-be7e-d9747382301d@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <4d895ba4-bcf2-472d-be7e-d9747382301d@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 29.08.2024 09:28, Michal Orzel wrote:
> On 29/08/2024 07:55, Jan Beulich wrote:
>> With the original code I observe
>>
>> In function ‘__irq_to_desc’,
>>     inlined from ‘route_irq_to_guest’ at arch/arm/irq.c:465:12:
>> arch/arm/irq.c:54:16: error: array subscript -2 is below array bounds of ‘irq_desc_t[32]’ {aka ‘struct irq_desc[32]’} [-Werror=array-bounds=]
>>    54 |         return &this_cpu(local_irq_desc)[irq];
>>       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> which looks pretty bogus: How in the world does the compiler arrive at
>> -2 when compiling route_irq_to_guest()? Yet independent of that the
>> function's parameter wants to be of unsigned type anyway, as shown by
>> a vast majority of callers (others use plain int when they really mean
>> non-negative quantities). With that adjustment the code compiles fine
>> again.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Acked-by: Michal Orzel <michal.orzel@amd.com>

Thanks.

> Are there any places where we still require irq member of irq_desc to be signed?

I can't spot any. On x86 we store negated values, but only in ->arch.irq.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 07:54:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 07:54:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785531.1194998 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjZzJ-0005cZ-L6; Thu, 29 Aug 2024 07:54:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785531.1194998; Thu, 29 Aug 2024 07:54:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjZzJ-0005cS-Hr; Thu, 29 Aug 2024 07:54:37 +0000
Received: by outflank-mailman (input) for mailman id 785531;
 Thu, 29 Aug 2024 07:54:36 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjZzI-0005cM-E4
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 07:54:36 +0000
Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com
 [2a00:1450:4864:20::632])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id eee2bb53-65db-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 09:54:35 +0200 (CEST)
Received: by mail-ej1-x632.google.com with SMTP id
 a640c23a62f3a-a869332c2c2so248092566b.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 00:54:35 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8989021983sm43236566b.84.2024.08.29.00.54.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 00:54:34 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eee2bb53-65db-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724918075; x=1725522875; 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=gKGplyn+VBD9o0AN7kFlSJBHVrIldR04oPCMcvO8e4k=;
        b=Gwc8lb2p4eT60dEi9Kni2UnzPFtS2tG+Upt3a/FsZiT655bPiS0YeQVm035i6yd2T+
         MRk3ZTNYwkcYaX7baUjapfCYYd37+XTeGvg2povn7gbXk9h+kvwUzxqmFsnFzvTI4Ire
         4ooltXTFz/76P++J5yJerMXDPYej/0uYLK0rtz4fGgkbxuwBzeJlCRvuyTYHamzzVUj1
         afXQUSaNK3oAO9Xm5t2NCuTmAv/XfHhZ6ALMqseO4GgOspwMsRWijQNVp4KjfRumUfaQ
         B8NDpI5n+4W97MXVCiJwM7mpdiIXamCWspgO1botlRl04dG8FrEOYPTv7MgLebUibNGC
         0N7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724918075; x=1725522875;
        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=gKGplyn+VBD9o0AN7kFlSJBHVrIldR04oPCMcvO8e4k=;
        b=jpot25FBVjyVGDsT/bN6rmXdwuehrvzLo6rbTCvbcj7jTJlLGFoIfQmIkUeFsFKVkY
         qcHdiHYjYhw/GCGZTjITYi2sro7IplWbs1Uymp4HoAvAhToq0/WZPDR0mm+ZYmBBOJJ3
         /2Y/T31mAEoBpDfz5sP+RVRoWGjiIC6ryrX4tRkxAjy8EcjtoXyo1VVLDH9qbB4oz3fP
         B9JsV2imLH3zBNDGTjuKtnjaoHyWC0owMccBUO6SoBYiQFNK6S7XACekB9dMBpIBP99l
         1KAnditqWI8qaUA83HpFup3l0ss10M4SVbkJ6rf5+LFkG44f1dEKmkHBMXXaDcbcSdIx
         qrSg==
X-Forwarded-Encrypted: i=1; AJvYcCU+D49GyZo43p5KU0T7YA5ePAPKcp6JQSb2UMIsdpEHcdu/rledAbx/YPoZMylOC+clLD4AXF/s9t0=@lists.xenproject.org
X-Gm-Message-State: AOJu0Ywrb5xOX2E3WLL9OXtp9EYfc0WVc/Dv91ogNSZuQeSYJxEkGkOl
	UTYgNReEnL/0YK4d/htg2rraKv5QdJ3dY3szhAIJqFa/ZaAkIFfgmMG8AY3Jqg==
X-Google-Smtp-Source: AGHT+IE3q4esLwnEuhjY+OE16gMSPBa84KGNtQoQGuWiUwUOu5xorkG8E2DZPyEeDx/jXHZxSgj9NA==
X-Received: by 2002:a17:907:9726:b0:a7a:ac5f:bbef with SMTP id a640c23a62f3a-a8982833612mr177672766b.31.1724918074662;
        Thu, 29 Aug 2024 00:54:34 -0700 (PDT)
Message-ID: <ec35f90e-d999-49a5-b3c3-79aa32689687@suse.com>
Date: Thu, 29 Aug 2024 09:54:32 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen: make VMAP support in MMU system only
To: Ayan Kumar Halder <ayankuma@amd.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: Penny Zheng <penny.zheng@arm.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Wei Chen <wei.chen@arm.com>,
 Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
References: <20240821122503.2315844-1-ayan.kumar.halder@amd.com>
 <20240821122503.2315844-5-ayan.kumar.halder@amd.com>
 <cd2e6b08-ce76-4707-831a-c21b05ca85cf@xen.org>
 <6d065949-dfae-41f8-b030-c7d09516846b@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <6d065949-dfae-41f8-b030-c7d09516846b@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 22.08.2024 12:52, Ayan Kumar Halder wrote:
>   I will update the commit message as below. Let me know if this makes 
> sense.

Certainly better. One more question though:

> ```
> xen: make VMAP support in MMU system only
> 
> Introduce CONFIG_HAS_VMAP which is selected by the architectures that
> use MMU. vm_init() does not do anything if CONFIG_HAS_VMAP is not
> enabled.
> 
> HAS_VMAP is widely used in ALTERNATIVE feature to remap a range of
> memory with new memory attributes. Since this is highly dependent on
> virtual address translation, we choose to fold HAS_VMAP in MMU. And
> ALTERNATIVE depends on HAS_VMAP.

What is "fold HAS_VMAP in MMU"? I see no folding anywhere. My only guess
is that this means to describe the "select HAS_VMAP" being added to MMU.
But then why the word "fold"?

Jan

> At the moment, the users of HARDEN_BRANCH_PREDICTOR requires to use the
> vmap() to update the exceptions vectors. While it might be possible to
> rework the code, it is believed that speculative attackes would be
> difficult to exploit on non-MMU because the software is tightly
> controlled. So for now make HARDEN_BRANCH_PREDICTOR to depend on the
> MMU.
> 
> Also took the opportunity to remove "#ifdef VMAP_VIRT_START .. endif"
> from vmap.c. Instead vmap.c is compiled when HAS_VMAP is enabled. Thus,
> HAS_VMAP is now enabled from x86, ppc and riscv architectures as all of
> them use MMU and has VMAP_VIRT_START defined.
> 
> ```
> 
> - Ayan
> 
>>
>> Acked-by: Julien Grall <jgrall@amazon.com>
>>
>> Cheers,
>>



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 08:53:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 08:53:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785552.1195032 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjatu-0000M5-1E; Thu, 29 Aug 2024 08:53:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785552.1195032; Thu, 29 Aug 2024 08:53:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjatt-0000Ly-UX; Thu, 29 Aug 2024 08:53:05 +0000
Received: by outflank-mailman (input) for mailman id 785552;
 Thu, 29 Aug 2024 08:53:03 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=LPGY=P4=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sjatr-0000Ls-Ot
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 08:53:03 +0000
Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com
 [2a00:1450:4864:20::229])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 18f5a3d0-65e4-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 10:53:01 +0200 (CEST)
Received: by mail-lj1-x229.google.com with SMTP id
 38308e7fff4ca-2ef27bfd15bso3958171fa.2
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 01:53:01 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f61519548fsm1214691fa.138.2024.08.29.01.52.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 29 Aug 2024 01:52:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 18f5a3d0-65e4-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724921581; x=1725526381; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=3pAeqYcXGKMwmvhFqpwMfbF2m53XROhpyAYtZoIZ/Ts=;
        b=JQatCZKk9QFejoa7RDtq0RcJQxn8I0N1QPcXUB8sCvyc/QNfydDvfnEeLvQLLRCbNz
         mgr5f1jfp0P/uArBxHj/BC4CdyBGHfIW1HP6huG8r/o9S+6ofEc5IFsMrEhtKQ4vu7F9
         dhDu6cs0pFlsL8Eu4kdzNLYinXEmacJEGkYHw7BWABPOqr+Uu4R722OXxcbe7Y9q24//
         7otfRgLmeB1BayMN0MkhLcj0YmnDIdZ8fyQyxWDMDdHudOobRoud0m+tGs0RaVjUtIz1
         dKT5uXACBuOVTj/WLxR9VOKzbKbX52vg1RNauGlc3Z5WSUbbrwepixB/1Rjm9xDR/XAF
         pudA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724921581; x=1725526381;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=3pAeqYcXGKMwmvhFqpwMfbF2m53XROhpyAYtZoIZ/Ts=;
        b=srgz9lkKWQ+YHLSK2yH97fuyWnTI5QyE8fSzrJEIctqGe2wlY1T23qHx0ex+roE5VG
         FL/n2gwtBTkA1lusL75LoFZtYQdbdkoB3P4s4upKUgCPM8Z/fWHTNMQ1tEHeRHpMo/2N
         3nkjI7RaeU0xKVkaDjoBCjqSZe/bdNKigB4Yl4zC4GEypQ2PP49aMCML5DWSIqdRNjUV
         LpEP2MVcAIJ4gUsIxulANXmRHtrGBq+cBPrku46JlYNTth2iGPxV06XHWcXC4EcknAaH
         V5I/ls3UeBK40CzrTo7EU88txVo711bX6E1B5kjxqHyYXTm68X37f4etNnlnolUVKTos
         lqpA==
X-Forwarded-Encrypted: i=1; AJvYcCV9t3b7A4aPjz8b3dwvr1y+UGixbHyprxNjiS1Zx6h4gO6UowtkV7N6hVjbEwRECYHuorpkqZcCGSU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YydZ4IJdPrY67eWlaH2JDVoiiClXHf60VCA5y5GFMs/Ehpzyenj
	2GOAagnWiCRbhcB/rKReTj2ySCq/efQ7Rg51BRMpm49zgbn9iyGZ
X-Google-Smtp-Source: AGHT+IFomjk60ayFYhj5yurQ5SKHmHhdEuzl2MovCnhlR4rEjMUlT2c2/1gwTvJv8TUXNecNCmSRpQ==
X-Received: by 2002:a05:651c:210d:b0:2f3:f690:17f3 with SMTP id 38308e7fff4ca-2f610889e5bmr16730641fa.31.1724921580344;
        Thu, 29 Aug 2024 01:53:00 -0700 (PDT)
Message-ID: <8cdeec70558a45597700d3ecf86aa4612348a50a.camel@gmail.com>
Subject: Re: [PATCH v5 1/7] xen/riscv: use {read,write}{b,w,l,q}_cpu() to
 define {read,write}_atomic()
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Thu, 29 Aug 2024 10:52:59 +0200
In-Reply-To: <45f1305f-2c2c-4b1c-8377-f98dbc5dbe53@suse.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
	 <5140f9eb3d1cb0b69e3b1cbbcce6167ff8d59e4c.1724256026.git.oleksii.kurochko@gmail.com>
	 <0f9fb47c-91d1-4ee9-b6bf-1d491339e904@suse.com>
	 <3f52a19ea90fa8e70d7bf0055fe39a2be721c129.camel@gmail.com>
	 <45f1305f-2c2c-4b1c-8377-f98dbc5dbe53@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.4 (3.52.4-1.fc40app2) 
MIME-Version: 1.0

On Wed, 2024-08-28 at 11:42 +0200, Jan Beulich wrote:
> On 28.08.2024 11:21, oleksii.kurochko@gmail.com=C2=A0wrote:
> > On Tue, 2024-08-27 at 12:06 +0200, Jan Beulich wrote:
> > > On 21.08.2024 18:06, Oleksii Kurochko wrote:
> > > > In Xen, memory-ordered atomic operations are not necessary,
> > >=20
> > > This is an interesting statement.
> > I looked at the definition of build_atomic_{write,read}() for other
> > architectures and didn't find any additional memory-ordered
> > primitives
> > such as fences.
> >=20
> > > I'd like to suggest that you at least
> > > limit it to the two constructs in question, rather than stating
> > > this
> > > globally for everything.
> > I am not sure that I understand what is "the two constructs". Could
> > you
> > please clarify?
>=20
> {read,write}_atomic() (the statement in your description is, after
> all,
> not obviously limited to just those two, yet I understand you mean to
> say what you say only for them)
Yeah, I re-read commit message after your reply and now I can see that
is not really clear.

>=20
> > > > based on {read,write}_atomic() implementations for other
> > > > architectures.
> > > > Therefore, {read,write}{b,w,l,q}_cpu() can be used instead of
> > > > {read,write}{b,w,l,q}(), allowing the caller to decide if
> > > > additional
> > > > fences should be applied before or after {read,write}_atomic().
> > > >=20
> > > > Change the declaration of _write_atomic() to accept a 'volatile
> > > > void *'
> > > > type for the 'x' argument instead of 'unsigned long'.
> > > > This prevents compilation errors such as:
> > > > 1."discards 'volatile' qualifier from pointer target type,"
> > > > which
> > > > occurs
> > > > =C2=A0 due to the initialization of a volatile pointer,
> > > > =C2=A0 e.g., `volatile uint8_t *ptr =3D p;` in _add_sized().
> > >=20
> > > I don't follow you here.
> > This issue started occurring after the change mentioned in point 2
> > below.
> >=20
> > I initially provided an incorrect explanation for the compilation
> > error
> > mentioned above. Let me correct that now and update the commit
> > message
> > in the next patch version. The reason for this error is that after
> > the
> > _write_atomic() prototype was updated from _write_atomic(...,
> > unsigned
> > long, ...) to _write_atomic(..., void *x, ...), the write_atomic()
> > macro contains x_, which is of type 'volatile uintX_t' because ptr
> > has
> > the type 'volatile uintX_t *'.
>=20
> While there's no "ptr" in write_atomic(), I think I see what you
> mean. Yet
> at the same time Arm - having a similar construct - gets away without
> volatile. Perhaps this wants modelling after read_atomic() then,
> using a
> union?
The use of a union could be considered as a solution. For now, I think
I will just update write_pte() to avoid this issue and and minimize
changes in this patch.

>=20
> > > > 2."incompatible type for argument 2 of '_write_atomic'," which
> > > > can
> > > > occur
> > > > =C2=A0 when calling write_pte(), where 'x' is of type pte_t rather
> > > > than
> > > > =C2=A0 unsigned long.
> > >=20
> > > How's this related to the change at hand? That isn't different
> > > ahead
> > > of
> > > this change, is it?
> > This is not directly related to the current change, which is why I
> > decided to add a sentence about write_pte().
> >=20
> > Since write_pte(pte_t *p, pte_t pte) uses write_atomic(), and the
> > argument types are pte_t * and pte respectively, we encounter a
> > compilation issue in write_atomic() because:
> >=20
> > _write_atomic() expects the second argument to be of type unsigned
> > long, leading to a compilation error like "incompatible type for
> > argument 2 of '_write_atomic'."
> > I considered defining write_pte() as write_atomic(p, pte.pte), but
> > this
> > would fail at 'typeof(*(p)) x_ =3D (x);' and result in a compilation
> > error 'invalid initializer' or something like that.
> >=20
> > It might be better to update write_pte() to:
> > =C2=A0=C2=A0 /* Write a pagetable entry. */
> > =C2=A0=C2=A0 static inline void write_pte(pte_t *p, pte_t pte)
> > =C2=A0=C2=A0 {
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 write_atomic((unsigned long *)p, p=
te.pte);
> > =C2=A0=C2=A0 }
> > Then, we wouldn't need to modify the definition of write_atomic()
> > or
> > change the type of the second argument of _write_atomic().
> > Would it be better?
>=20
> As said numerous times before: Whenever you can get away without a
> cast,
> you should avoid the cast. Here:
>=20
> static inline void write_pte(pte_t *p, pte_t pte)
> {
> =C2=A0=C2=A0=C2=A0 write_atomic(&p->pte, pte.pte);
> }
>=20
> That's one of the possible options, yes. Yet, like Arm has it, you
> may
> actually want the capability to read/write non-scalar types. If so,
> adjustments to write_atomic() are necessary, yet as indicated before:
> Please keep such entirely independent changes separate.
I quickly checked that there is only one instance where write_atomic()
is used for a scalar type in the Arm code. I think it would be better
to update RISC-V's write_pte() and not modify write_atomic(), at least
for now.

Thanks.

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 09:03:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 09:03:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785559.1195042 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjb49-0002aR-Vu; Thu, 29 Aug 2024 09:03:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785559.1195042; Thu, 29 Aug 2024 09:03:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjb49-0002aK-TA; Thu, 29 Aug 2024 09:03:41 +0000
Received: by outflank-mailman (input) for mailman id 785559;
 Thu, 29 Aug 2024 09:03:41 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dlBE=P4=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sjb49-0002aE-3W
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 09:03:41 +0000
Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com
 [2607:f8b0:4864:20::334])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 94bb3110-65e5-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 11:03:39 +0200 (CEST)
Received: by mail-ot1-x334.google.com with SMTP id
 46e09a7af769-70f5cd2fa39so305025a34.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 02:03:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 94bb3110-65e5-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724922218; x=1725527018; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=g1UfUkHSnxo95nom+0+6Wz5KcQR7geXrg9ZJx9j7Z5k=;
        b=AL/zwxLQsNvnk8YE2yUEDPndoItN+RQx5C5YpP7PIVknpD6YMydQWV/nwFVsQV7rf6
         DqgSh8zCdKahyVZH98+0A5fjzD4t+aPe2jWa0UcMu9nCEFNgMBWyXMg24BGa0s88RHwP
         s1D/+yZObW5PzTxi/9djFA1DEXRfG67Gs9lGU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724922218; x=1725527018;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=g1UfUkHSnxo95nom+0+6Wz5KcQR7geXrg9ZJx9j7Z5k=;
        b=G49nH6478egFkRnrhnNBf1cGOeT1KIBgGkvGgk8iYlBXliGVPdnBe2kNXFLZqr8BFK
         GdAzJ+C/V8G6zqmjIzb0+66rInXmqcfKsmJ0JwCXhkR2bpQf9S6ZvbuFjnQH4AMrTp74
         MaI/J9rNEoOtcW0vNS1c+5WKIIzVO1bvq+grCuFDQ4nG559qqy3XL/njRqefJI7DWtb/
         qZVXKFEEkx1/g1QF6kgNGYxI+yVtJHy4BTB/qLGOSGetgozdYiPlehVcX9/42Kh21mi3
         nl9brHSEySdsZSO5pYd/j56RVK4UBw4XQtdG37JG303zSwqpue0Q3nft+NWI4vQ7DroD
         pOog==
X-Gm-Message-State: AOJu0YyUdjpBdfBG/tM7WefjWEIYmF9B0IAghf87Kfd/+lE6C+/NFETf
	iEZ2wYhF/I+7kmYb/OxDD9mc7ORtD0ochagxqHnMN0zMccR4B43QX9GbCA1Dx9aKjN126MJy4+r
	FODLoKEVvlrgUj1Qycwr0iMOUUcpRP6T5LaPfmlr5Q0m7wZ2O
X-Google-Smtp-Source: AGHT+IFCsymf4AGydbDTCL8zxZEHbpt7xd57FyYY98NGyLgP59zy1DObh3LU8LJKYLx7n6XIHGJcIr+UG8LYm89FUq4=
X-Received: by 2002:a05:6870:350b:b0:260:fd64:60f2 with SMTP id
 586e51a60fabf-27790074658mr2167707fac.8.1724922218056; Thu, 29 Aug 2024
 02:03:38 -0700 (PDT)
MIME-Version: 1.0
References: <20240819142953.415817-1-frediano.ziglio@cloud.com>
In-Reply-To: <20240819142953.415817-1-frediano.ziglio@cloud.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Thu, 29 Aug 2024 10:03:27 +0100
Message-ID: <CACHz=ZiR3xnhdUu37xL7hsKCNSRsUsNNsxALVvWUbkt3FzkGQA@mail.gmail.com>
Subject: Re: [PATCH v4] Avoid crash calling PrintErrMesg from efi_multiboot2
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>, 
	=?UTF-8?Q?Marek_Marczykowski=2DG=C3=B3recki?= <marmarek@invisiblethingslab.com>, 
	Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Aug 19, 2024 at 3:30=E2=80=AFPM Frediano Ziglio
<frediano.ziglio@cloud.com> wrote:
>
> Although code is compiled with -fpic option data is not position
> independent. This causes data pointer to become invalid if
> code is not relocated properly which is what happens for
> efi_multiboot2 which is called by multiboot entry code.
>
> Code tested adding
>    PrintErrMesg(L"Test message", EFI_BUFFER_TOO_SMALL);
> in efi_multiboot2 before calling efi_arch_edd (this function
> can potentially call PrintErrMesg).
>
> Before the patch (XenServer installation on Qemu, xen replaced
> with vanilla xen.gz):
>   Booting `XenServer (Serial)'Booting `XenServer (Serial)'
>   Test message: !!!! X64 Exception Type - 0E(#PF - Page-Fault)  CPU Apic =
ID - 00000000 !!!!
>   ExceptionData - 0000000000000000  I:0 R:0 U:0 W:0 P:0 PK:0 SS:0 SGX:0
>   RIP  - 000000007DC29E46, CS  - 0000000000000038, RFLAGS - 0000000000210=
246
>   RAX  - 0000000000000000, RCX - 0000000000000050, RDX - 0000000000000000
>   RBX  - 000000007DAB4558, RSP - 000000007EFA1200, RBP - 0000000000000000
>   RSI  - FFFF82D040467A88, RDI - 0000000000000000
>   R8   - 000000007EFA1238, R9  - 000000007EFA1230, R10 - 0000000000000000
>   R11  - 000000007CF42665, R12 - FFFF82D040467A88, R13 - 000000007EFA1228
>   R14  - 000000007EFA1225, R15 - 000000007DAB45A8
>   DS   - 0000000000000030, ES  - 0000000000000030, FS  - 0000000000000030
>   GS   - 0000000000000030, SS  - 0000000000000030
>   CR0  - 0000000080010033, CR2 - FFFF82D040467A88, CR3 - 000000007EC01000
>   CR4  - 0000000000000668, CR8 - 0000000000000000
>   DR0  - 0000000000000000, DR1 - 0000000000000000, DR2 - 0000000000000000
>   DR3  - 0000000000000000, DR6 - 00000000FFFF0FF0, DR7 - 0000000000000400
>   GDTR - 000000007E9E2000 0000000000000047, LDTR - 0000000000000000
>   IDTR - 000000007E4E5018 0000000000000FFF,   TR - 0000000000000000
>   FXSAVE_STATE - 000000007EFA0E60
>   !!!! Find image based on IP(0x7DC29E46) (No PDB)  (ImageBase=3D00000000=
7DC28000, EntryPoint=3D000000007DC2B917) !!!!
>
> After the patch:
>   Booting `XenServer (Serial)'Booting `XenServer (Serial)'
>   Test message: Buffer too small
>   BdsDxe: loading Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4AF=
6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
>   BdsDxe: starting Boot0000 "UiApp" from Fv(7CB8BDC9-F8EB-4F34-AAEA-3EE4A=
F6516A1)/FvFile(462CAA21-7614-4503-836E-8AB6F4662331)
>
> Fixes: 9180f5365524 ("x86: add multiboot2 protocol support for EFI platfo=
rms")
> Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
> ---
>  xen/common/efi/boot.c | 46 ++++++++++++++++++++++++++++++-------------
>  1 file changed, 32 insertions(+), 14 deletions(-)
> ---
> Changes since v1:
> - added "Fixes:" tag;
> - fixed cast style change.
>
> Changes since v2:
> - wrap long line.
>
> Changes since v3:
> - fixed "Fixes:" tag.
>
> diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c
> index efbec00af9..fdbe75005c 100644
> --- a/xen/common/efi/boot.c
> +++ b/xen/common/efi/boot.c
> @@ -287,19 +287,36 @@ static bool __init match_guid(const EFI_GUID *guid1=
, const EFI_GUID *guid2)
>  /* generic routine for printing error messages */
>  static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)
>  {
> -    static const CHAR16* const ErrCodeToStr[] __initconstrel =3D {
> -        [~EFI_ERROR_MASK & EFI_NOT_FOUND]           =3D L"Not found",
> -        [~EFI_ERROR_MASK & EFI_NO_MEDIA]            =3D L"The device has=
 no media",
> -        [~EFI_ERROR_MASK & EFI_MEDIA_CHANGED]       =3D L"Media changed"=
,
> -        [~EFI_ERROR_MASK & EFI_DEVICE_ERROR]        =3D L"Device error",
> -        [~EFI_ERROR_MASK & EFI_VOLUME_CORRUPTED]    =3D L"Volume corrupt=
ed",
> -        [~EFI_ERROR_MASK & EFI_ACCESS_DENIED]       =3D L"Access denied"=
,
> -        [~EFI_ERROR_MASK & EFI_OUT_OF_RESOURCES]    =3D L"Out of resourc=
es",
> -        [~EFI_ERROR_MASK & EFI_VOLUME_FULL]         =3D L"Volume is full=
",
> -        [~EFI_ERROR_MASK & EFI_SECURITY_VIOLATION]  =3D L"Security viola=
tion",
> -        [~EFI_ERROR_MASK & EFI_CRC_ERROR]           =3D L"CRC error",
> -        [~EFI_ERROR_MASK & EFI_COMPROMISED_DATA]    =3D L"Compromised da=
ta",
> -        [~EFI_ERROR_MASK & EFI_BUFFER_TOO_SMALL]    =3D L"Buffer too sma=
ll",
> +#define ERROR_MESSAGE_LIST \
> +    ERROR_MESSAGE(EFI_NOT_FOUND, "Not found") \
> +    ERROR_MESSAGE(EFI_NO_MEDIA, "The device has no media") \
> +    ERROR_MESSAGE(EFI_MEDIA_CHANGED, "Media changed") \
> +    ERROR_MESSAGE(EFI_DEVICE_ERROR, "Device error") \
> +    ERROR_MESSAGE(EFI_VOLUME_CORRUPTED, "Volume corrupted") \
> +    ERROR_MESSAGE(EFI_ACCESS_DENIED, "Access denied") \
> +    ERROR_MESSAGE(EFI_OUT_OF_RESOURCES, "Out of resources") \
> +    ERROR_MESSAGE(EFI_VOLUME_FULL, "Volume is full") \
> +    ERROR_MESSAGE(EFI_SECURITY_VIOLATION, "Security violation") \
> +    ERROR_MESSAGE(EFI_CRC_ERROR, "CRC error") \
> +    ERROR_MESSAGE(EFI_COMPROMISED_DATA, "Compromised data") \
> +    ERROR_MESSAGE(EFI_BUFFER_TOO_SMALL, "Buffer too small")
> +
> +    static const struct ErrorStrings {
> +        CHAR16 start;
> +#undef ERROR_MESSAGE
> +#define ERROR_MESSAGE(code, str) CHAR16 msg_ ## code[sizeof(str)];
> +        ERROR_MESSAGE_LIST
> +    } ErrorStrings __initconst =3D {
> +        0
> +#undef ERROR_MESSAGE
> +#define ERROR_MESSAGE(code, str) , L ## str
> +        ERROR_MESSAGE_LIST
> +    };
> +    static const uint16_t ErrCodeToStr[] __initconst =3D {
> +#undef ERROR_MESSAGE
> +#define ERROR_MESSAGE(code, str) \
> +        [~EFI_ERROR_MASK & code] =3D offsetof(struct ErrorStrings, msg_ =
## code),
> +        ERROR_MESSAGE_LIST
>      };
>      EFI_STATUS ErrIdx =3D ErrCode & ~EFI_ERROR_MASK;
>
> @@ -308,7 +325,8 @@ static void __init PrintErrMesg(const CHAR16 *mesg, E=
FI_STATUS ErrCode)
>      PrintErr(L": ");
>
>      if( (ErrIdx < ARRAY_SIZE(ErrCodeToStr)) && ErrCodeToStr[ErrIdx] )
> -        mesg =3D ErrCodeToStr[ErrIdx];
> +        mesg =3D (const CHAR16 *)((const void *)&ErrorStrings +
> +                                ErrCodeToStr[ErrIdx]);
>      else
>      {
>          PrintErr(L"ErrCode: ");

Any update on this?

Frediano


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 09:06:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 09:06:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785564.1195052 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjb6a-0003Cv-B0; Thu, 29 Aug 2024 09:06:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785564.1195052; Thu, 29 Aug 2024 09:06:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjb6a-0003CJ-8H; Thu, 29 Aug 2024 09:06:12 +0000
Received: by outflank-mailman (input) for mailman id 785564;
 Thu, 29 Aug 2024 09:06:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=ns9Z=P4=darkstar.site=sakib@srs-se1.protection.inumbo.net>)
 id 1sjb6Z-000382-3L
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 09:06:11 +0000
Received: from pb-smtp1.pobox.com (pb-smtp1.pobox.com [64.147.108.70])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id eb073ea2-65e5-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 11:06:04 +0200 (CEST)
Received: from pb-smtp1.pobox.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id 5F6811F58A;
 Thu, 29 Aug 2024 05:06:03 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1])
 by pb-smtp1.pobox.com (Postfix) with ESMTP id 5719A1F589;
 Thu, 29 Aug 2024 05:06:03 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
Received: from localhost (unknown [185.130.54.95])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 2E19C1F588;
 Thu, 29 Aug 2024 05:06:02 -0400 (EDT)
 (envelope-from sakib@darkstar.site)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: eb073ea2-65e5-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc
	:subject:date:message-id:mime-version:content-transfer-encoding;
	 s=sasl; bh=CbF2V9zLGMAUTXE/8jLkeb4ABf4w1O6sneUcUiJN5wE=; b=IMgt
	0U8Q11eyITYaYY7XFNhc40YURxUhrR9KoHRoahrcRSHWtelbXtsjSDoJR+6F7S5u
	HYOwTu+RI5Ix+PqViO6/PEmQG8DyTvx5OQ30SCA0GuS9y7mNyJqqUrqQNWA4VMe3
	QxB48EBGgnQzaFsQVaI5345i5ATZXyVolPd3Y6A=
From: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
To: xen-devel@lists.xenproject.org
Cc: Sergiy Kibrik <Sergiy_Kibrik@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Jan Beulich <jbeulich@suse.com>
Subject: [XEN PATCH v3] x86/intel: optional build of PSR support
Date: Thu, 29 Aug 2024 12:05:59 +0300
Message-Id: <20240829090559.149249-1-Sergiy_Kibrik@epam.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
X-Pobox-Relay-ID:
 EA264036-65E5-11EF-9CA1-2BAEEB2EC81B-90055647!pb-smtp1.pobox.com
Content-Transfer-Encoding: quoted-printable

Platform Shared Resource feature is available for certain Intel's CPUs on=
ly,
hence can be put under CONFIG_INTEL build option.

When !INTEL then PSR-related sysctls XEN_SYSCTL_psr_cmt_op &
XEN_SYSCTL_psr_alloc are off as well.

Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
CC: Jan Beulich <jbeulich@suse.com>
---
v2 patch here:
https://lore.kernel.org/xen-devel/20240801084453.1163506-1-Sergiy_Kibrik@=
epam.com/

changes in v3:
 - drop stubs for psr_domain_{init,free} & psr_ctxt_switch_to() and guard=
 these
   routines at call sites
 - add stub for psr_cmt_enabled()
 - drop some of #ifdef-s from arch_do_{domctl,sysctl}
changes in v2:
 - split outer switch cases for {XEN_SYSCTL,XEN_DOMCTL}_psr_cmt_op and
   {XEN_SYSCTL,XEN_DOMCTL}_psr_alloc so that return codes in default swit=
ch
   cases are not mangled (as Jan suggested)
---
 xen/arch/x86/Makefile          |  2 +-
 xen/arch/x86/domain.c          | 12 ++++++++----
 xen/arch/x86/domctl.c          |  3 +++
 xen/arch/x86/include/asm/psr.h |  7 +++++++
 xen/arch/x86/sysctl.c          |  4 +++-
 5 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 286c003ec3..4d1ba2a3a1 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -57,7 +57,7 @@ obj-y +=3D pci.o
 obj-y +=3D percpu.o
 obj-y +=3D physdev.o
 obj-$(CONFIG_COMPAT) +=3D x86_64/physdev.o
-obj-y +=3D psr.o
+obj-$(CONFIG_INTEL) +=3D psr.o
 obj-y +=3D setup.o
 obj-y +=3D shutdown.o
 obj-y +=3D smp.o
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 89aad7e897..ebe648ef80 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -861,7 +861,8 @@ int arch_domain_create(struct domain *d,
     if ( (rc =3D iommu_domain_init(d, config->iommu_opts)) !=3D 0 )
         goto fail;
=20
-    psr_domain_init(d);
+    if ( IS_ENABLED(CONFIG_INTEL) )
+        psr_domain_init(d);
=20
     if ( is_hvm_domain(d) )
     {
@@ -902,7 +903,8 @@ int arch_domain_create(struct domain *d,
=20
  fail:
     d->is_dying =3D DOMDYING_dead;
-    psr_domain_free(d);
+    if ( IS_ENABLED(CONFIG_INTEL) )
+        psr_domain_free(d);
     iommu_domain_destroy(d);
     cleanup_domain_irq_mapping(d);
     free_xenheap_page(d->shared_info);
@@ -940,7 +942,8 @@ void arch_domain_destroy(struct domain *d)
     free_xenheap_page(d->shared_info);
     cleanup_domain_irq_mapping(d);
=20
-    psr_domain_free(d);
+    if ( IS_ENABLED(CONFIG_INTEL) )
+        psr_domain_free(d);
 }
=20
 void arch_domain_shutdown(struct domain *d)
@@ -2024,7 +2027,8 @@ static void __context_switch(void)
         nd->arch.ctxt_switch->to(n);
     }
=20
-    psr_ctxt_switch_to(nd);
+    if ( IS_ENABLED(CONFIG_INTEL) )
+        psr_ctxt_switch_to(nd);
=20
     if ( need_full_gdt(nd) )
         update_xen_slot_in_full_gdt(n, cpu);
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 68b5b46d1a..bd8baaae20 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1195,6 +1195,7 @@ long arch_do_domctl(
     case XEN_DOMCTL_psr_alloc:
         switch ( domctl->u.psr_alloc.cmd )
         {
+#ifdef CONFIG_INTEL
         case XEN_DOMCTL_PSR_SET_L3_CBM:
             ret =3D psr_set_val(d, domctl->u.psr_alloc.target,
                               domctl->u.psr_alloc.data,
@@ -1257,6 +1258,8 @@ long arch_do_domctl(
=20
 #undef domctl_psr_get_val
=20
+#endif /* CONFIG_INTEL */
+
         default:
             ret =3D -EOPNOTSUPP;
             break;
diff --git a/xen/arch/x86/include/asm/psr.h b/xen/arch/x86/include/asm/ps=
r.h
index 51df78794c..d42c7f1580 100644
--- a/xen/arch/x86/include/asm/psr.h
+++ b/xen/arch/x86/include/asm/psr.h
@@ -67,10 +67,17 @@ enum psr_type {
=20
 extern struct psr_cmt *psr_cmt;
=20
+#ifdef CONFIG_INTEL
 static inline bool psr_cmt_enabled(void)
 {
     return !!psr_cmt;
 }
+#else
+static inline bool psr_cmt_enabled(void)
+{
+    return false;
+}
+#endif /* CONFIG_INTEL */
=20
 int psr_alloc_rmid(struct domain *d);
 void psr_free_rmid(struct domain *d);
diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c
index 1d40d82c5a..8b0d1f1e32 100644
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -225,10 +225,11 @@ long arch_do_sysctl(
=20
     case XEN_SYSCTL_psr_alloc:
     {
-        uint32_t data[PSR_INFO_ARRAY_SIZE] =3D { };
+        uint32_t __maybe_unused data[PSR_INFO_ARRAY_SIZE] =3D { };
=20
         switch ( sysctl->u.psr_alloc.cmd )
         {
+#ifdef CONFIG_INTEL
         case XEN_SYSCTL_PSR_get_l3_info:
             ret =3D psr_get_info(sysctl->u.psr_alloc.target,
                                PSR_TYPE_L3_CBM, data, ARRAY_SIZE(data));
@@ -279,6 +280,7 @@ long arch_do_sysctl(
             if ( __copy_field_to_guest(u_sysctl, sysctl, u.psr_alloc) )
                 ret =3D -EFAULT;
             break;
+#endif /* CONFIG_INTEL */
=20
         default:
             ret =3D -EOPNOTSUPP;
--=20
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 09:30:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 09:30:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785594.1195062 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjbTt-0008Oy-5y; Thu, 29 Aug 2024 09:30:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785594.1195062; Thu, 29 Aug 2024 09:30:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjbTt-0008Or-3G; Thu, 29 Aug 2024 09:30:17 +0000
Received: by outflank-mailman (input) for mailman id 785594;
 Thu, 29 Aug 2024 09:30:15 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4mUO=P4=epam.com=prvs=5971918609=sergiy_kibrik@srs-se1.protection.inumbo.net>)
 id 1sjbTr-0008Ol-PN
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 09:30:15 +0000
Received: from mx0a-0039f301.pphosted.com (mx0a-0039f301.pphosted.com
 [148.163.133.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 4a3cc759-65e9-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 11:30:13 +0200 (CEST)
Received: from pps.filterd (m0174676.ppops.net [127.0.0.1])
 by mx0a-0039f301.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47T7fK3J007529;
 Thu, 29 Aug 2024 09:30:00 GMT
Received: from duzpr83cu001.outbound.protection.outlook.com
 (mail-northeuropeazlp17013012.outbound.protection.outlook.com [40.93.64.12])
 by mx0a-0039f301.pphosted.com (PPS) with ESMTPS id 41amtq8ja7-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 29 Aug 2024 09:29:59 +0000 (GMT)
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com (2603:10a6:20b:5c0::11)
 by AS8PR03MB7046.eurprd03.prod.outlook.com (2603:10a6:20b:23e::15)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug
 2024 09:29:56 +0000
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d]) by AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d%5]) with mapi id 15.20.7897.027; Thu, 29 Aug 2024
 09:29:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4a3cc759-65e9-11ef-99a0-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=tHQ2ZsB4tDp0SkJYU++PMUCq0fUef0W4pDlOeNRTZ1asCRMSKmJL/zEhAZF1GsIb9pjkpamLI6c+v2jUmKbfYJsvy4BTgvuKMSGPigeeLWYTR7PN+t7qSPbtUsS34iVl6gcq+WbZyIjDxiuTEqXQAyHct/33DewGiPxIRHAvwiOo9u3SXSesqQznGmYw/JQvWwQVOdtubPT+hpL3iiwSor4OtUp2XGM3+XzlWGqx6keQ6niju7Q+to+QBfS9ZizrenAkoA4RWFpJjuiLQof1woR/HE2UF/m5SlAw/GYCL9hgDOT3IVQ+U6WjHHj3NKDTyStw6QIoddtAiB7/iI3o6w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=QX60cFgxvS1j/hQCViRG5wRI6bX/9dzwIwqyk0nbFgo=;
 b=JFq/nb9ftMHUBUeuFcklZl+nNbzH4wCzzNIAhw1PAS239NUy3Mq3y+wNKHZ7aIaAoZebOP2dNBvLBc2O5YdfeS+5w8yQTDZIeX60WvJG4qDO5ukGkYRR39G40vyrmjUxU3xuzd8mWY3FuA+N5JaYotpj44yZ8h81TCsHluzDeD2EoBUB+cpNZI/VnK2IvwUK+IxAtNHIYZAP71XftX5hdMsdH98lDb0q1q3SbxKQdEj97NZwrhGEimvpJHx9IbcdJmbHn/JomMnnKOmWyNtRVq+hGdlQwg8uts76ZVEJCEv/t9GjHxKKUx8sOdgVh5craa1Of7CE6uvFo6Sxom+jHA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=QX60cFgxvS1j/hQCViRG5wRI6bX/9dzwIwqyk0nbFgo=;
 b=Td1FbezMMiYweH0BaNpu1Wh/nEeT9PeFyMRaUp+Yy5FndPAwQw0WjYNDW//bUVR8wvdcZN9PeK6P9cAhdunaGtLFKmLW40TefWmj++VexqqMoktUFRrN4hkgcc+gbiGyrbf50PdlIqIOMnW//RjtZX0V+n0HZh4NBkmN3Ll/VbF9c1UsszvvGcV2aWPMC8lPGBlDDP0pbTJxXNSper2KODfdAqbkV4mRVseuYJT/IcD3ppKhHy4DnLpspmxSyC8GJ4ueGeDKR5nT1q4aUbiVF6jx7JFq7XGL9n9wq15kZ+tczy9CSkIdJVHLv/LNaLXOdxLoQxjATUunN2l+HlSUuQ==
Message-ID: <595e2722-5812-49c5-a668-2ab88250c925@epam.com>
Date: Thu, 29 Aug 2024 12:29:54 +0300
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v2 1/5] x86/Kconfig: introduce CENTAUR, HYGON &
 SHANGHAI config options
To: Jan Beulich <jbeulich@suse.com>, Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        Alejandro Vallejo <alejandro.vallejo@cloud.com>,
        xen-devel@lists.xenproject.org
References: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
 <2a217c9602e92f92050cb4894bb9a42ee99a84ea.1723806405.git.Sergiy_Kibrik@epam.com>
 <5cd1fac5-bf4f-4a5b-b02f-e971d36581b0@suse.com>
Content-Language: en-US
From: Sergiy Kibrik <sergiy_kibrik@epam.com>
In-Reply-To: <5cd1fac5-bf4f-4a5b-b02f-e971d36581b0@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: BE1P281CA0243.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:b10:8b::8) To AS8PR03MB9192.eurprd03.prod.outlook.com
 (2603:10a6:20b:5c0::11)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9192:EE_|AS8PR03MB7046:EE_
X-MS-Office365-Filtering-Correlation-Id: 4e83e4a7-e8dc-4f36-0fc9-08dcc80d254a
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|366016|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?ZlB4Sit3bXAyVGtUY1RZbGlLVlVEVlljTjl5dDlQRVB4TzlHVU5iRVZJMTFm?=
 =?utf-8?B?L09rT0REVW1iWnI5cjJlYjRqZkVDK1NQNnFHd3BKYzQ2SjRkWG5TR3RNQWtG?=
 =?utf-8?B?aFdjdWZJQlJ6RGhJZzQxWFo2NzZxSkM5K3pOek1RYUVkcjdFRm1CREVqYWRI?=
 =?utf-8?B?Wk9KWkJtbXFFMUxiY1dQckdSckEwWU1jdVlLZmZ6QkZQTjFpcElEbW40VFRs?=
 =?utf-8?B?Z1FXR0N6SmVNcW5ZaTNQUk9CRm5sQlZaZTZIcUQ2TGQ0QXZYL1JPRFkxWm1w?=
 =?utf-8?B?MmY3VzBBdGx6NnNxQ0pGTG1rQ0JBVlozaVd0NXBpQmtYbVVabGM5V05xcERH?=
 =?utf-8?B?ZmRSOUVTQ08zMXNRTDVlaHZvRWpla0l5OFNOalZaZTQzTUNxQ2UzUGZYVCtC?=
 =?utf-8?B?cVRGOWROZ2RnMGk4ZTM1ZVR2OEc1UGhwT0JXekJBRGt4K0ZkdENKSkIxRXU2?=
 =?utf-8?B?RXkvdjk1RG8xaVFJVnJYcHRHMnVValdkbGxCSTBMbDZCTkpFMUZ2SXVKUjFn?=
 =?utf-8?B?QW9sUTllSWRWczh3d0VkZGt5VW1GcG96Y3gveFJubFpLRXJ5RDJ5eEY2d3Nx?=
 =?utf-8?B?N3RlR2o2V01OYUo0NDY1NmVPeC9BTllnWlBQR2xGTWF0ZnEva3lxMkkzZ3B0?=
 =?utf-8?B?bnh0c3VkaW5zTUxGS0hmYVpsK2ljOXkrWHdFQ2JVVUxIV2FSeFdaYjU2UzhJ?=
 =?utf-8?B?MENTaEllU3NYc1RsTFBMbzU5a2xPSWtzQzk5RUxoUTNNaUoyMTNsZHZnTGJz?=
 =?utf-8?B?T3hHem5uLzh6cjhTU0RNdkNkQkF4Zng3bGhGbkNOb3FNQ0dBZDF2N0NqY3NT?=
 =?utf-8?B?Nno2VjBUMzZLWGkvQ1FaYkllVVFqSytWbGEzWDByZVY0Z0crRkMxcGp1UGFG?=
 =?utf-8?B?QXpwZC9hSExRemVSTU9ocVRYTlJtWC96cmczZytpNm5YQnowcDQxeVhXSkEy?=
 =?utf-8?B?U28waUxxbXYwMG9HKzdxTHVoVzMzRHdGbjlrYldpbkdPQ0ZyYmIrOEQyay9j?=
 =?utf-8?B?TFhFZDFoZm5rZXp6ekJtVDMraFR0a1M3V0tTT0xoUjA1b2VSa1N5a3VrTHNH?=
 =?utf-8?B?WkJ4Z1ZDeDZKaERIK2dMV0o2N2xBWjZkVlJTc3R6RDVpUUI1c3A0ZTNrVlFG?=
 =?utf-8?B?clVhLzB6Y1l3R0lkZmNudzZuaWZXb1JhWUtvYXEzNTYxSjlyR2dGRzNWdUtl?=
 =?utf-8?B?SEhzaHJQUjVpZjMzRDFLUmN4MTF1amI2cFZxNUw2Q1VVSU44Um9lQjJRTTRl?=
 =?utf-8?B?SkNsaVE4TzR1ZjNjZHVuRzRubkNmVlpmeml6OVcwMnBuZG5yZGVmN0NIS2xH?=
 =?utf-8?B?ckVwNXExRXQvdkJnUUFzckFsTFlCMVJ1RmJYOVNDa0RzSng2TjdTbXlaSWlM?=
 =?utf-8?B?QTJ5TzJXRExBd2EzSmxwZ09tWjRFSTQzU3k3WWQ4V0JlMmJ0YUhmRnh4N3kx?=
 =?utf-8?B?cGxJeDVrd2pOVERVTW5QWlBoYVVES0tHdmFSQy9ZTmM5WEEvMG5neW9kdVJN?=
 =?utf-8?B?VHFSMFc2eFpLZnB1UC9IRWd3R0g2SVRKSStUdnZxaElrSjhYWVMvRnlaNUlM?=
 =?utf-8?B?RXVNMWxMZjBiaVFEU09VZWh0cCtoYVN2UmFxUFljcC9JbnVmZ2pRRU1heHJr?=
 =?utf-8?B?UE83OU5IZGJSODNaQ3J4UXM0N2pCd0tpQ0VBTWdTaUxUN1dObDJRTEhqb1Ba?=
 =?utf-8?B?cHBYR1dHbythOHJRdnJ2bnB6VUh1dzl6MGFuTHdjNlpEdXpxNTJpV2ZqODBt?=
 =?utf-8?B?MlJRTyt6R2daN2cxaFJQbkswTkwwOW94bDRsR2N4cnhiSU45U3JvcHVBbWJN?=
 =?utf-8?B?Tm85Z0ZJaWtpalRkcXhtQT09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9192.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(366016)(1800799024);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?anBXMUVPOGR0ZVEzNzJIQ2dmYkh6T0E5TUM0YW9YN1p4d2FvTW5UZVBONmVt?=
 =?utf-8?B?T3ZEY3hhMXpFMWZ6WmdKa3dKZ3crUWpENjNFUHU3NVVLRkx5VFVrRmxUOEZh?=
 =?utf-8?B?ZTU1UmtrWk9RbUF3RTF0dDN4N3p1aVU0VlUvUWJEcTN5dHJYOTA4eGVHU2g4?=
 =?utf-8?B?MFVhQXNEOXZwdHBieTdDS3g4SFptT2VUa21yRkhPNVYxZ2lkamFTWkhTbjZB?=
 =?utf-8?B?ZTh1T2VrTzMyQ1hESGREMnp1aVA1RXdmVWtBbE1lTEVFVmk5WWNrOERGaDRB?=
 =?utf-8?B?eHlhZUp2SnJWR1hacGMxM3BJckEzQWtCTEF5YXcrNm9YcTFaVUw5dXpiZnc1?=
 =?utf-8?B?TWtKM2xLdi9NNFZWbm9yMmtWTzlXUkhxeW5PQ0tYek1VRXFZOS81YXY4VGV0?=
 =?utf-8?B?UHp4eXJmVTh2M2dGR3ozUzJ2QnEwQ3RUSXhxQ0FLQWZVaU94dGs0YWc2L21P?=
 =?utf-8?B?SGtESHNKVUNjQUprN1h6aGJFRks2TWVWMkRJWEYxWFFoY2l4eWxnUnkvUHhF?=
 =?utf-8?B?c1dzNDlhanBDQ1I0RXRBekRGZTcxUVVSSEJrR0pROWV1c2Vrekx2OXVVWHJl?=
 =?utf-8?B?TUI4a3FWUHN1QmJ1Nll0UDVZR3dhZlFJZGJQSTFHTmhINU1vRnZVSG5NMVlC?=
 =?utf-8?B?Qll2QjhSa0svbDN4U2t4R2crSjJZaW5zcTRnaXZpVHdQbERaMnlYcllIS09T?=
 =?utf-8?B?UkVJYTRGSm51bmFxdzVyWmpFTy8wUlczRVhPZ3J4MVFiTVBScktVWEZhWDRr?=
 =?utf-8?B?ZlZFNmhJQ3pwOEtDWnFBRG5QUEJBMWlmdkpjMnl5RHdjREJwRWswYlBqamM0?=
 =?utf-8?B?cUxNT1NrYXFkN1dzN0ZQcFRuVzlDaUkrNHh0dU9mdkhLaXFpR1FxLzl4VlZo?=
 =?utf-8?B?L2g5b2tJYnBDcEo3bkVkL0UwZlhvWU1rNm5xSlZhYjZHODdvVjBXMVlXYmlF?=
 =?utf-8?B?b2MwZHdzKzlwZEg2a1RRRzlqekFPQ1c0RGhHMEplYnJxb3VDNUxNcVNobHpH?=
 =?utf-8?B?V1h3a05zcTRGbjFib2Q1THorZ2w5Y0t4SXNVWGJBNnlvVitCdXpTMDY5ZGsz?=
 =?utf-8?B?a1pqcmg4WUNOdU40RlZYc2xzTWE2S0FOdWtxdkxlZUJjY0E2cW42WkY5dXhW?=
 =?utf-8?B?S0ZNY0VJN1VFQUVRUVg2L2pKREtNdDVaRXFyYVpMSFlORDg5K2tHcGFJQ0NG?=
 =?utf-8?B?amplNDF1RUc4ajlETmpYUTlxcmZVSUFMQVVEdnlTSDl0MDUvMnliaG01dWR3?=
 =?utf-8?B?eDd4MllrSis1aEtJZjBhS0pyWGpSY09rcXhzL2hsYlF6UWVmYndXK21ueDRG?=
 =?utf-8?B?bDMwaEk3R0lZeVRkTXNWVmVEWGNYNStGUER5OTVjOElyZDdXbGJGeG5CYVdH?=
 =?utf-8?B?R0JkL2Q0SFF2QW9jekhiblZUNXk3TTJjUFV4UldvVUdOV3NuZmc0VlVGcmFr?=
 =?utf-8?B?aGhEWGM5MSs4WjBzcVVhM3J3WCthM0NhMVZWQ3ZIaStWaGtkZUQvbWFUV3JC?=
 =?utf-8?B?dWxsSFVZaUJSR2xLNmtDYjJDazIyOGpza3A4OW50eXZVWlFjYjFBaVBSRmVo?=
 =?utf-8?B?Y1Jpdk42REsxTW1xR3B6UnlxOXhVMU5CUEI4cSt3Zjc2KzN5cHdPRzlOVjdx?=
 =?utf-8?B?UFJ4NlR2TmZ4SUlGSDJVTjRqamJNZGVqZHV5ajF2VGVUWDVjRWVBOUUrUXVz?=
 =?utf-8?B?Q1Fxa2w0eHN6Rk9pclFlRjNEWWpqb0E1ejU3a0ZiWVgxN3YwVG1LamxHdmZJ?=
 =?utf-8?B?ZW13NkFaS1JTQTdlZU9FZUJSbGdDT3VwelpDbTF5WmFxV3EzWXF2anp0ZWVn?=
 =?utf-8?B?dDhzNWhJdlVjb1ZkZjhGaWR2b09CMEZReXpwT1QwdFFCcldpQkdqMTBIQ0gx?=
 =?utf-8?B?aDB2RmEzR0NHUzkzV0JnQXpNQzFWU3h5SExiT0psVisxMzlZN0padlFjeHpl?=
 =?utf-8?B?WHlHb0FjeEFham85YUtkM3l1Z1hEV243Vm9EN3ZjZWplcjEydXBlakRQdEFR?=
 =?utf-8?B?Y0NWc1lIWGMzRys5REpSNDM3OWh4Q2ZxSC9wVE1CS0J3Z1pYdUxrVXBxNWpk?=
 =?utf-8?B?WlBCOHZlcGxaY1lacnpGSWg2QTIrdGRVQ25aR20wSmwvZXJicGdQZU00RXlk?=
 =?utf-8?B?MS8yRFRpTHZsUkhySkxaM1FTWDU4NVZuVm8rem9ocWRGSXozRUZzd0Q4ZHZQ?=
 =?utf-8?B?MHc9PQ==?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 4e83e4a7-e8dc-4f36-0fc9-08dcc80d254a
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9192.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 09:29:56.7200
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: mr/VbLegT3sG1d9xa8jjFrbmmsN7HbwxiR9hqkDY7ENfGESLhXwdNvWjDx834Iox4r0D+5/XwQZRQX85BAuAKw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7046
X-Proofpoint-GUID: U-QNnIPe7TJasjm8I-IocHAEA7e05f31
X-Proofpoint-ORIG-GUID: U-QNnIPe7TJasjm8I-IocHAEA7e05f31
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16
 definitions=2024-08-29_02,2024-08-29_01,2024-05-17_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0
 suspectscore=0 spamscore=0 lowpriorityscore=0 mlxscore=0 mlxlogscore=999
 malwarescore=0 adultscore=0 priorityscore=1501 phishscore=0 bulkscore=0
 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1
 engine=8.19.0-2407110000 definitions=main-2408290070

19.08.24 11:53, Jan Beulich:
> On 16.08.2024 13:10, Sergiy Kibrik wrote:
>> --- a/xen/arch/x86/Kconfig.cpu
>> +++ b/xen/arch/x86/Kconfig.cpu
>> @@ -10,6 +10,25 @@ config AMD
>>   	  May be turned off in builds targetting other vendors.  Otherwise,
>>   	  must be enabled for Xen to work suitably on AMD platforms.
>>   
>> +config CENTAUR
>> +	bool "Support Centaur CPUs"
>> +	default y
>> +	help
>> +	  Detection, tunings and quirks for VIA platforms.
>> +
>> +	  May be turned off in builds targeting other vendors. Otherwise, must
>> +          be enabled for Xen to work suitably on VIA platforms.
>> +
>> +config HYGON
>> +	bool "Support Hygon CPUs"
>> +	depends on AMD
>> +	default y
>> +	help
>> +	  Detection, tunings and quirks for Hygon platforms.
>> +
>> +	  May be turned off in builds targeting other vendors. Otherwise, must
>> +          be enabled for Xen to work suitably on Hygon platforms.
>> +
>>   config INTEL
>>   	bool "Support Intel CPUs"
>>   	default y
>> @@ -19,4 +38,14 @@ config INTEL
>>   	  May be turned off in builds targetting other vendors.  Otherwise,
>>   	  must be enabled for Xen to work suitably on Intel platforms.
>>   
>> +config SHANGHAI
>> +	bool "Support Shanghai CPUs"
>> +	depends on INTEL
>> +	default y
>> +	help
>> +	  Detection, tunings and quirks for Zhaoxin platforms.
>> +
>> +	  May be turned off in builds targeting other vendors. Otherwise, must
>> +          be enabled for Xen to work suitably on Zhaoxin platforms.
>> +
>>   endmenu
> Imo this re-raises the question of whether it is a good idea to leave out
> "CPU" from the names: The more names there are, the more likely it'll become
> that going forward we'll run into a naming collision. Andrew, iirc you
> were the main proponent for omitting "CPU" - may I ask that you re-consider?
> 
> Furthermore I wonder whether "depends on" is appropriate here. This way one
> won't be offered e.g. SHANGHAI if earlier on one de-selected INTEL.

I see, then probably I'll use 'select INTEL' here.
And also 'select AMD' for HYGON.

   -Sergiy


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 09:42:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 09:42:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785600.1195072 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjbfA-0002Ih-69; Thu, 29 Aug 2024 09:41:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785600.1195072; Thu, 29 Aug 2024 09:41:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjbfA-0002Ia-2Z; Thu, 29 Aug 2024 09:41:56 +0000
Received: by outflank-mailman (input) for mailman id 785600;
 Thu, 29 Aug 2024 09:41:55 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjbf9-0002IQ-4u; Thu, 29 Aug 2024 09:41:55 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjbf9-0008Lw-0k; Thu, 29 Aug 2024 09:41:55 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjbf8-0003CJ-Fw; Thu, 29 Aug 2024 09:41:54 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjbf8-00056t-FV; Thu, 29 Aug 2024 09:41:54 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=1LTKRBzAKOuI1zlvzwrmfw5qYLhRy3+vgsmAXEj4uJE=; b=7FR+Thki4+86NDnztPZcn1oRfk
	anu64QPBX++pHBwxPTCQ8Ghkckl2qeiITAPvsrfBZ77HiblpExM0i3SbKJm5km7JGtTpTGPpkl52u
	GyGIf+F59CKFajASOaKYbOOuPs7YzqZU7cCyLUpugyiohsVzzDr1DujCuLF7DoZ/HyUs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187398-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187398: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=31f022500549f1d862af531da704a9b3c6568ff5
X-Osstest-Versions-That:
    ovmf=2fe9b6c22fcc9b8617b95d4a2cf091fea4f66537
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 29 Aug 2024 09:41:54 +0000

flight 187398 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187398/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 31f022500549f1d862af531da704a9b3c6568ff5
baseline version:
 ovmf                 2fe9b6c22fcc9b8617b95d4a2cf091fea4f66537

Last test of basis   187394  2024-08-29 04:11:29 Z    0 days
Testing same since   187398  2024-08-29 06:13:23 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Nickle Wang <nicklew@nvidia.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   2fe9b6c22f..31f0225005  31f022500549f1d862af531da704a9b3c6568ff5 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 09:48:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 09:48:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785607.1195082 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjbli-0003wb-Ri; Thu, 29 Aug 2024 09:48:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785607.1195082; Thu, 29 Aug 2024 09:48:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjbli-0003wU-OX; Thu, 29 Aug 2024 09:48:42 +0000
Received: by outflank-mailman (input) for mailman id 785607;
 Thu, 29 Aug 2024 09:48:41 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4mUO=P4=epam.com=prvs=5971918609=sergiy_kibrik@srs-se1.protection.inumbo.net>)
 id 1sjblh-0003wO-2c
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 09:48:41 +0000
Received: from mx0b-0039f301.pphosted.com (mx0b-0039f301.pphosted.com
 [148.163.137.242]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dc646126-65eb-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 11:48:37 +0200 (CEST)
Received: from pps.filterd (m0174680.ppops.net [127.0.0.1])
 by mx0b-0039f301.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 47T8jJa6020670;
 Thu, 29 Aug 2024 09:48:24 GMT
Received: from du2pr03cu002.outbound.protection.outlook.com
 (mail-northeuropeazlp17012026.outbound.protection.outlook.com [40.93.64.26])
 by mx0b-0039f301.pphosted.com (PPS) with ESMTPS id 41anrnrad2-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);
 Thu, 29 Aug 2024 09:48:24 +0000 (GMT)
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com (2603:10a6:20b:5c0::11)
 by PA1PR03MB10772.eurprd03.prod.outlook.com (2603:10a6:102:484::17)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27; Thu, 29 Aug
 2024 09:48:21 +0000
Received: from AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d]) by AS8PR03MB9192.eurprd03.prod.outlook.com
 ([fe80::baa9:29b3:908:ed7d%5]) with mapi id 15.20.7897.027; Thu, 29 Aug 2024
 09:48:21 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dc646126-65eb-11ef-99a0-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=IUDSnMHxUO2KJBhnhOzhDIgTtiSVl7fJ3JKvzV+2/rX2fqFJAmjnrhrn4SrijW7HiqzETzODIlejN+Ihowfb2f896ISQU1vX44sDcLOB3CyuRr9QEFvrNrqFlBUKPAMLJXGarop2keIhbscJlNTGX9gKlBeur4JF/uqcmWGtAHLQm5w9OHgp0NDHZ5avoZv6z+cO4SLcNB1gSZjh5Of6DkX2P1WAuRTbzLe5YYYETc+yOND6b3lhmJ8wMsegtO2QUtALocnG1EJxDFlXKazclC+C5Ks500eQoNGEsSnpPVkjKI+Xm1WhEnTy0eeAkm8wF/vHSsYU7mhqyobVYZxelQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=mgER5DsOgs79K3ivRSOoBr4SXrbT3Cq0I8G6lG1sDmA=;
 b=I3akgr6BYw7SojFgEtn47Z4J7RhJtqDkeqfoklULN9M/Dy2e1R3VpT0VJ2/h6OTr34EphQcQ8X0yzz/23mGrEhE8wu+NWmHhmyI6+ASM/EUchWvtYGmrKBvpX2GCk6Qyd6Rzvdaw4Kmh59LWEKdtSAVDcaGW1gtuNTmTyfTUWZTmdJVOJCkq1otbJZqzObrkEj3LHTkgPDn11Lyc1oDBRJ/UbwdJT8RVkKZhmwAcjm8WErH2VybLGUpP6XL5Vvp7SPlxNDi4lTc2BbEnDbY6QAOFsZCSUjWLldgYf1zAag2YZJm7XotHbVkLvq3lmaw0v29ttDmorJB9AFmPwbqTrw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com;
 dkim=pass header.d=epam.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=epam.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=mgER5DsOgs79K3ivRSOoBr4SXrbT3Cq0I8G6lG1sDmA=;
 b=YAFD2/8AWdEysu3PsGAf5IHZwwAg+2JS5Tmm0YArHRs9bBDR36rqqxbrBMv3sFb2wMQwAcXXeMiZavUEJ14VY/rnK2jeSd3yb1hEDsioGx93mqQRckTaMajzOYHRNPg2pTWbb47i037IBSLA3dMzMYlGVO9bIYFKPeXxvDYDNfdzar29lrjpUl6jYPs8vwq7wyGM4lkeI355SAGPIfIS167ka/SHw0JCt8gyRE7YWK3k6W8x/OHjDgxZNm7qv5Q+83ptiTVUaay7rF0w3I0DtYZ2YfB3TYAJwjzNOp7cxN1BH2+oGUU3vHjuBJv8OKKJz1PjW2V9IPvqyI1Na6zpUQ==
Message-ID: <7e798639-98f4-4b7b-bab3-14f4f6da51d0@epam.com>
Date: Thu, 29 Aug 2024 12:48:19 +0300
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v2 5/5] x86/amd: optional build of amd.c
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
        =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
        Stefano Stabellini <sstabellini@kernel.org>,
        xen-devel@lists.xenproject.org
References: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
 <3c641433fa7cfe1f7fdc918ab32086835a2e13eb.1723806405.git.Sergiy_Kibrik@epam.com>
 <5675ea5a-0c14-42e2-b817-d9576a1f64b7@suse.com>
Content-Language: en-US
From: Sergiy Kibrik <sergiy_kibrik@epam.com>
In-Reply-To: <5675ea5a-0c14-42e2-b817-d9576a1f64b7@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: BE0P281CA0008.DEUP281.PROD.OUTLOOK.COM
 (2603:10a6:b10:a::18) To AS8PR03MB9192.eurprd03.prod.outlook.com
 (2603:10a6:20b:5c0::11)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: AS8PR03MB9192:EE_|PA1PR03MB10772:EE_
X-MS-Office365-Filtering-Correlation-Id: 41ee5b46-328a-406a-0628-08dcc80fb7fa
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?M2U4NzhrSThmRkNVM3ArTWVDZkpZazJCUEZGRUdXNXVtUER4OTdON2d6ZmhY?=
 =?utf-8?B?L0hTa3NFVWZoWkUyNmpoazl5eE5xbzViYzllOGNtby8xZWU1cUwxVkVZeTVW?=
 =?utf-8?B?UUI2SVVKajNxV0EwcnRFRVgrajFXbk51QkVQWDBPdEJlaUFOY0FNZVFxQUNT?=
 =?utf-8?B?TGsrMWppamZsQ3BzRkJKSnFSSVMydHJ0VFZEUWRLZGxmSzAxTTJxRFMxNnBl?=
 =?utf-8?B?R2I4Mmhwb1QvRHpWbGJyQXZiU0RlTWF6OStlTjB2dTJlcHdsWDdpeE1HcE84?=
 =?utf-8?B?QVkwT1lRcEJ4Qjd6ZVdCV0NJMG1zWUtlTUpBQzRCS1NOZm1yTUNnYTdxRWdk?=
 =?utf-8?B?V2pEbUxKMzIxWjhkSCtxV0RNaGdPVVl1K0pHdVRoYWwwOTFqbldhdkV3RUpK?=
 =?utf-8?B?aUtZdVhwVmlFVW5OM2NWSjYrNDNjRTV4bjdleTJMaHVnb096czB0L0tDWmZG?=
 =?utf-8?B?bmx5VWJXcDN4cStTN1RnRlVTWTdtT1NyYSt1ZW9BMno2OHdxQ2wzaUdYRWpY?=
 =?utf-8?B?Y294cTQ3aDhlei95QmNKK3M1YXdaTmtwbE4vb3dWRDVBYVVTVnNWS1FCLzQ2?=
 =?utf-8?B?MEVpQTd6OTAzcXBMMWU3WXdJRFlsNWJBdGlTcVA0d21XRE96YzV4eHhzY1k5?=
 =?utf-8?B?SVlKOXpBZlcwVjNuZUZRbVlKcG9qdUR5NHFNbUVEeUZ2a2k2OHVUNHFzSkhB?=
 =?utf-8?B?V2VSWnl3UlhYYnErT3VWdHA1UTJIYWZvdmloVEY5dkJVa2ZnekV1QVIzQ3JK?=
 =?utf-8?B?ZFpVK0Vod0xpY21XcHhTWXFnT2FPMzBtZzB4UFRET21CU2VjaHpaMjg4NDh1?=
 =?utf-8?B?eE14alEvVDB3dURkNlFLYldoYlNKMGVCaTNDemcrSXR5V1NxRlErY21UZit2?=
 =?utf-8?B?clFoNjBYREY2RC9wODVXRCs1REt0N3ovS3NteTlEM2ZVY0Yyay9Md0cxNkNu?=
 =?utf-8?B?WDIvTUU1TTFDQXU5V3J5bTMyQnFDNDdLcFd3ZFAwcDh3S3V6Z1VJK3ZEMXc5?=
 =?utf-8?B?ZFJUcG1aWUZXajZaZExweU9oOFY1WXEveldIeWtOalNSY2RnOE9nY09WWG0r?=
 =?utf-8?B?aEszNU9TSW5PREJKakd0bjE0NWtKVUxDM3ROYm04S1ZSTG9MbEdWWGV4TE5T?=
 =?utf-8?B?UEZrdk1ZK0tCQm1BNlJRVDNTK0VtN2lqYkJuUnlncHhjRUxRWEZ1SUZ4TG1n?=
 =?utf-8?B?WUFPck1hUTI4aVVMU0hwZE1zQkVQNE45cC9oVlJac1R0bVFrK0lVVWF1Rm5S?=
 =?utf-8?B?eHRmTmRDaDl1K203Y2tVTUJhRHN1YkhiTEExcTYzazJONjk5YlRXbnp0U1hO?=
 =?utf-8?B?eCtCSXlKaWJVTUVhNW5wOUpjMFo4Y3pHNnZlQXk0NzB2dTVBaTVzRythVFU5?=
 =?utf-8?B?alJSQmpPSGszN3lBVUxYdUQ3RU9PZmVEakhZTjhaWEhNT1NtckcvaytyUGh2?=
 =?utf-8?B?bU5OREZicklNVHQrSFd4ZUVnUkxnMk56bGsyeE9jMldqNTZHd1FoR0E2dW91?=
 =?utf-8?B?dHJ3NDBrZVB4cm8zZCt0RTVOZTN2OVZRSnkzd1dGSWZTZXNWZUVGMmU5UVV2?=
 =?utf-8?B?U2IxUURYMzZzWkJPc3MvL2hrVFhvTGU3T2hrR1oyWFlIMnFhZnMrN2NoOE9T?=
 =?utf-8?B?UHQzM1JiVWluK0puaFBMelhzTll2cDJ1MmlNcUsyM0ppamxMbStGQWRDNm4y?=
 =?utf-8?B?ZFBKMzJCQUg3VWtTZjlHQWJSOGdSZHRrM2RpWXdYY2VTcklLNG5Ga0YzODQ2?=
 =?utf-8?Q?jIwgsJNFyjm1E6NmRo=3D?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR03MB9192.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?U1ZjbUV2VVh3WnplVktac3FockJOL1MwUHFpZWJZdVFhSDdnRDVEUGtMK2w5?=
 =?utf-8?B?dW5CUC9oRjJ0V3llZ25Cc3JFellpNDJMY2pVazRxYVFuZGxIOVdUWXVRQ2hV?=
 =?utf-8?B?UXh1RjZjNUFSWFhaVEJ1MHE1QlRWRTM5WDB0b0Q3WElYY1ZOSWFOQ2FSZEU3?=
 =?utf-8?B?NFpnQllweXViQUV0K0xNUnczdWpNRFFrS1pLOUZlRm5wQWNTZndJZDF5bjlC?=
 =?utf-8?B?NWtGMGNVbDQyZC8yV2RWRkQ4K0hjblJvOUZQYmtieUEvcFR6emZhSTZHa3lQ?=
 =?utf-8?B?VkpITHRsSEd0dzBQTkQ4eVhyUVZnc1lBTGFUSGw2dnJSNlRKcmVUMkhDNTIw?=
 =?utf-8?B?QzYxVnRxTzZLbnJ4akIzazJXQldRUkJGVlpnTUhoTmFISm9qRUc5L0dNWE42?=
 =?utf-8?B?QWZ4dUdSa3ZqSytuSjBaRDBmUFVzK0x1dWR0RmN5dWwwRk5jekNCenQ1MFdk?=
 =?utf-8?B?dWVLSEkxcHRnNFlweEdES0VzNWJ0b01rcGpHTHhueGc0UTU1UGp0UjZMNkov?=
 =?utf-8?B?bG16bnkwQzFZY3FWRjZRWlR4TW1kd0YxbkY3MG1mL1NGTS9od0RnaVZYK1ZU?=
 =?utf-8?B?SjlwMTB2bVQvT2dXbGM3WXNMYXoxSnN0eWZMOHlUUjE1MnQ4TzhFeVZTdk01?=
 =?utf-8?B?c1k5OFZWakFjbWd4bE15WEdmeGRreEozc1MwOFpubm5PeWc5TG05WS9jN2Jy?=
 =?utf-8?B?RTliVE0xNWNBK0Q4VmNLNWhWV1hZNDVFZ0ljdEZLVVVLN3JMVXYrTFQ3OWFB?=
 =?utf-8?B?ZmZCZUxOR1ZyWG84OVF6blBjUHNZbHF4dVZhL2ROcVk3ZXl0WjIvaVdKNUVj?=
 =?utf-8?B?Q1BKZVZsbzRvdytnK2ExS0h2Zm5RajU1MTRNamt4TmpNNE5NbHhOazUzcGtC?=
 =?utf-8?B?YWltVG9XWVJObFMzM0s4OHhXY1pBVmdKakZlVENGT0IybFkxQzVOZ2V3UGI4?=
 =?utf-8?B?ZHNaRk1aZ0xmQVVzd3FzSG9RWit0RVcrOGpGSnd2WlFkTjFDYTQ0R1lrOTJ4?=
 =?utf-8?B?bks0cnhHTnlMTS9Xak5GNlhsakJ1NGZJbGRqY01PaGxZM1VDM0FvUHBtTzhQ?=
 =?utf-8?B?dnZTSzdFNkFJcHgzOGlVbXZTMFpVRW9WY2JVa21qeW9zanBFcXprdm9mdm1x?=
 =?utf-8?B?a1d0OFBpRllSN2ZoN01rMlUyNW5OVkRid3ZKK3VCOGNKRFQvcTFYLzhDU0R0?=
 =?utf-8?B?SzVVZzNYK3p3QmJ4c01xQmdScndialE0SExSM2FGQ212aHJIZFpzSHFnM1E2?=
 =?utf-8?B?Y2pVRG5lOWFKNlZ3U2t0Y29hUFMvWjh6NngzTDljNU5Tc011V2ZLM3ludFNB?=
 =?utf-8?B?K1M0eEEwY0MwN2dGZnFJbk5EVGJSaUllOEdCL2JDS2FyQVNmRzZyWmVKM000?=
 =?utf-8?B?T2ExZEhINEZqMTR2VWwyb2RrRmZsUThtSkxHbFJqMGRIR2JacHNMUHhmbWFU?=
 =?utf-8?B?NFRhSWJDQW9iajRTVHJRenFRaVhTWldoVjcwUFZxSlNTVkF0cm1DSzZ6UkZl?=
 =?utf-8?B?bk95dENtbXVrZE5Bd2g0ZE1VekhiMUdwSGtLQ3pxMTFoU2QxS3AxTEJuWVFo?=
 =?utf-8?B?UFBYN2RLdVljck0zcXR2WHFCNllIbnl1QWZNTWFIdjJsbzVGOEZGSWVGekZU?=
 =?utf-8?B?Wkd5UzFKQUNvaWt6dEw4NnVPS1hIZHNmcjF1OHFxRjkvZWpMVXh5SmFpdXFi?=
 =?utf-8?B?WnUzbTExbXNzYlFLcDl3WWhwT1BkaWZQcEFJSC9hcEpoYm5LdVZHbk0zMVFX?=
 =?utf-8?B?eW5yQVFmZ0htVzBoTEdhYUk4cnhRMzZiSXc5OGs5V05JZmNBeEltQVM4QUtN?=
 =?utf-8?B?WTNqOVZwek1DNTdmaU5kWUhpKzlITTVGcGozcE9tMXJ4Rk50RG4zdGltOHBj?=
 =?utf-8?B?WUJyWHA5Y1FpQTU0Yi9aN1N4T1ZyN2VBb0trekRqbWx4K0VhVzFuL0pvR0dW?=
 =?utf-8?B?bVdwUFo5SnBWOHZOR0pEQS9XMDdRS0pMWkZjK1ROdEtVKzhHUm12a2wrd0k2?=
 =?utf-8?B?Y0JtU0hoR00vRTFQRzRuZFJTdEd6RWNrVXdoM0ZNM3owTkhJNTRGVzNBREVT?=
 =?utf-8?B?UmJTZXFLbG8yWkVhalAwczc0RjVPbjl1UXVqVTBBVUxNRmNIRHdDKzIxM084?=
 =?utf-8?Q?yIqfI++Q+X8LBvQZ79SvFq4b9?=
X-OriginatorOrg: epam.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 41ee5b46-328a-406a-0628-08dcc80fb7fa
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB9192.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 09:48:21.7713
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: e+7U9XIQDcFk1L5O9rOLSk9zdMASWjOGWTrQppuDu3dN0ZXHQINlYvtN7r9/VKlwbTCp+Z89djqVeJbN2M1l0A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA1PR03MB10772
X-Proofpoint-ORIG-GUID: xrqv9oct9Q5Bf5hD5jQE7KR5chkBzQz9
X-Proofpoint-GUID: xrqv9oct9Q5Bf5hD5jQE7KR5chkBzQz9
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16
 definitions=2024-08-29_02,2024-08-29_01,2024-05-17_01
X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0
 suspectscore=0 spamscore=0 priorityscore=1501 clxscore=1015
 mlxlogscore=999 lowpriorityscore=0 malwarescore=0 phishscore=0
 adultscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx
 scancount=1 engine=8.19.0-2407110000 definitions=main-2408290072

19.08.24 15:36, Jan Beulich:
> On 16.08.2024 13:19, Sergiy Kibrik wrote:
>> --- a/xen/arch/x86/hvm/svm/svm.c
>> +++ b/xen/arch/x86/hvm/svm/svm.c
>> @@ -919,7 +919,8 @@ static void cf_check svm_ctxt_switch_from(struct vcpu *v)
>>        * Possibly clear previous guest selection of SSBD if set.  Note that
>>        * SPEC_CTRL.SSBD is already handled by svm_vmexit_spec_ctrl.
>>        */
>> -    if ( v->arch.msrs->virt_spec_ctrl.raw & SPEC_CTRL_SSBD )
>> +    if ( IS_ENABLED(CONFIG_AMD) &&
>> +         v->arch.msrs->virt_spec_ctrl.raw & SPEC_CTRL_SSBD )
>>       {
>>           ASSERT(v->domain->arch.cpuid->extd.virt_ssbd);
>>           amd_set_legacy_ssbd(false);
>> @@ -953,7 +954,8 @@ static void cf_check svm_ctxt_switch_to(struct vcpu *v)
>>           wrmsr_tsc_aux(v->arch.msrs->tsc_aux);
>>   
>>       /* Load SSBD if set by the guest. */
>> -    if ( v->arch.msrs->virt_spec_ctrl.raw & SPEC_CTRL_SSBD )
>> +    if ( IS_ENABLED(CONFIG_AMD) &&
>> +         v->arch.msrs->virt_spec_ctrl.raw & SPEC_CTRL_SSBD )
>>       {
>>           ASSERT(v->domain->arch.cpuid->extd.virt_ssbd);
>>           amd_set_legacy_ssbd(true);
> Instead of these changes, shouldn't AMD_SVM become dependent upon AMD in
> Kconfig?

It could be done earlier, yet I haven't done so since we briefly touched 
this before and decided not to link {AMD,INTEL} with {AMD_SVM,INTEL_VMX} 
then:

https://lore.kernel.org/xen-devel/9a973f18-e0af-456c-8b07-6869f044519e@citrix.com/

   -Sergiy


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 09:57:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 09:57:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785618.1195091 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjbtu-0006ET-IH; Thu, 29 Aug 2024 09:57:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785618.1195091; Thu, 29 Aug 2024 09:57:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjbtu-0006EM-Ff; Thu, 29 Aug 2024 09:57:10 +0000
Received: by outflank-mailman (input) for mailman id 785618;
 Thu, 29 Aug 2024 09:57:08 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjbts-0006EC-Id; Thu, 29 Aug 2024 09:57:08 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjbts-00009Z-De; Thu, 29 Aug 2024 09:57:08 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjbtr-0003bS-VH; Thu, 29 Aug 2024 09:57:08 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjbtr-00037X-Us; Thu, 29 Aug 2024 09:57:07 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=SKeKLdP50OTf9wZ4eTCHx41FWfVFxdmlCLa+6SxLhBM=; b=PvymnvzFmvsoZAsCbwA0N81sds
	doczsoH3u92BcTz2ExYhDoM3G2QnNaWnEMZpLyIWqLJNhYeTytaVsk7tlcppaZwOD+IuER7aBKCpT
	A8T7N+AR38TQYi04clLK9ShwbdpJGHnGWN6BUmCkX+aSwLtCVUH66r/03zj6twl6N0hA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187388-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187388: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-armhf-armhf-xl-raw:debian-di-install:fail:heisenbug
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=928f79a188aacc057ba36c85b36b6d1e99c8f595
X-Osstest-Versions-That:
    linux=3ec3f5fc4a91e389ea56b111a73d97ffc94f19c6
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 29 Aug 2024 09:57:07 +0000

flight 187388 linux-linus real [real]
flight 187399 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187388/
http://logs.test-lab.xenproject.org/osstest/logs/187399/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-raw      12 debian-di-install   fail pass in 187399-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-raw     14 migrate-support-check fail in 187399 never pass
 test-armhf-armhf-xl-raw 15 saverestore-support-check fail in 187399 never pass
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187366
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187366
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187366
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187366
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187366
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187366
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                928f79a188aacc057ba36c85b36b6d1e99c8f595
baseline version:
 linux                3ec3f5fc4a91e389ea56b111a73d97ffc94f19c6

Last test of basis   187366  2024-08-27 18:40:54 Z    1 days
Failing since        187376  2024-08-28 05:42:32 Z    1 days    2 attempts
Testing same since   187388  2024-08-28 20:44:41 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Bibo Mao <maobibo@loongson.cn>
  Chuck Lever <chuck.lever@oracle.com>
  David Howells <dhowells@redhat.com>
  David Sterba <dsterba@suse.com>
  Filipe Manana <fdmanana@suse.com>
  Hans de Goede <hdegoede@redhat.com>
  Huacai Chen <chenhuacai@loongson.cn>
  Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
  Jarkko Sakkinen <jarkko@kernel.org>
  Jeff Layton <jlayton@kernel.org>
  Josef Bacik <josef@toxicpanda.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Mathieu Fenniak <mathieu@fenniak.net>
  Miao Wang <shankerwangmiao@gmail.com>
  Olga Kornievskaia <okorniev@redhat.com>
  Qu Wenruo <wqu@suse.com>
  Sanket Goswami <Sanket.Goswami@amd.com>
  Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
  Stefan Berger <stefanb@linux.ibm.com>
  Stefan Metzmacher <metze@samba.org>
  Steve French <stfrench@microsoft.com>
  Tianyang Zhang <zhangtianyang@loongson.cn>
  Tiezhu Yang <yangtiezhu@loongson.cn>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   3ec3f5fc4a91e..928f79a188aac  928f79a188aacc057ba36c85b36b6d1e99c8f595 -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 10:03:05 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 10:03:05 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785627.1195102 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjbzY-0007nD-5z; Thu, 29 Aug 2024 10:03:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785627.1195102; Thu, 29 Aug 2024 10:03:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjbzY-0007n6-2z; Thu, 29 Aug 2024 10:03:00 +0000
Received: by outflank-mailman (input) for mailman id 785627;
 Thu, 29 Aug 2024 10:02: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=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjbzX-0007n0-3I
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 10:02:59 +0000
Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com
 [2a00:1450:4864:20::22b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dd9c1fda-65ed-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 12:02:57 +0200 (CEST)
Received: by mail-lj1-x22b.google.com with SMTP id
 38308e7fff4ca-2f50f1d864fso5300181fa.1
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 03:02:57 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226ccf406sm511765a12.59.2024.08.29.03.02.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 03:02:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dd9c1fda-65ed-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724925777; x=1725530577; 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=3GbnsKP5EuJs7t7uTD23QwEsjDzzgZbyxrhSYc+pZUU=;
        b=Lqb2Mul+oazWkM4QnoPZ0YTWtreIl/X/hKUptXMidzDWCYJb9+WPMHxJ0msBwODPon
         CSf81rwvlNIcZ+fZarTtIj3abPZ5VzF0N2pdD8/+/ocPE0tFGwBdnBQj/3FLrkebVQMT
         23WWW7B6/ZJX3qjDyepKzy1Z7j0TGHIrsEKdt9QGME9EOd7s9M3iv1nYHalE0JRYVA+e
         VuzQamyUBKEMXwxt7BS2rIFCwH28a8YXFmPdho1LsnAI2JUVwbTyNK6WWNtjs58IWYS1
         UwYKbeYagMY11jh6L4+sRnj5sIVKzisg8uFiB0+RC9Se/4cECCyGVKKdm0p1r3cPZIMq
         jW5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724925777; x=1725530577;
        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=3GbnsKP5EuJs7t7uTD23QwEsjDzzgZbyxrhSYc+pZUU=;
        b=eS2jXHVcdNhPLlMmbMe5wReZYZOf6bQWNY65xX4bQqRtk2cYgNscnN5APfsxY/C6jJ
         xRzQO6aVGbtXSrS4wJlZLammCF3R9o0nqUGKOR+d203HW2uoIi4EDdjzOzpM+wDqjAeL
         vRIerQpdO93rBtfcIPN2kDwNT6oKjJB9JjaQ7VBLsowZpmDZig7ELobBBp0Bq3ekdCPv
         m5nh7ELqqhs7ubNY3UW/YSuap4OrMvkkjcIFRCBXlYjJL+mmauIpkaM681G2udbOrKSV
         ARy/MUvddlnVt4qEJZ2cBOZX/o54DNlsPyrIc6KjHKh5FZKIqWoQ05+QR8UJpJs+LtZq
         uJRA==
X-Forwarded-Encrypted: i=1; AJvYcCVTYZh6KZou3eErnyvf6KjSZclGIDTeDvpkJyeQPBMkUFB5GKQBRYVnWqAyGE4pjQ6ejsz/GX+G8yo=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzQtA3c7gAPEx8H+X/2KM3bfy6h6f2UINb4r2yjp3dt/Y4XOKTc
	G1cP58JkNOHVdtORCfIU0MPM+XmpVUliSWRLn+EnkQURUZ+aVrIi+nsA9Qr6iA==
X-Google-Smtp-Source: AGHT+IEBdbGaIaLlt45wDdRKwZk6CB6zAy2LdBTWMTY4hKFVIOH/zpMBn7SpfhWdWkfYsYW0YFF0MQ==
X-Received: by 2002:a2e:d09:0:b0:2f3:f054:684b with SMTP id 38308e7fff4ca-2f6103f66ddmr14824501fa.29.1724925776332;
        Thu, 29 Aug 2024 03:02:56 -0700 (PDT)
Message-ID: <697bbad5-e545-4847-9228-56dc6e07bd21@suse.com>
Date: Thu, 29 Aug 2024 12:02:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v2 5/5] x86/amd: optional build of amd.c
To: Sergiy Kibrik <sergiy_kibrik@epam.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
References: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
 <3c641433fa7cfe1f7fdc918ab32086835a2e13eb.1723806405.git.Sergiy_Kibrik@epam.com>
 <5675ea5a-0c14-42e2-b817-d9576a1f64b7@suse.com>
 <7e798639-98f4-4b7b-bab3-14f4f6da51d0@epam.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <7e798639-98f4-4b7b-bab3-14f4f6da51d0@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 29.08.2024 11:48, Sergiy Kibrik wrote:
> 19.08.24 15:36, Jan Beulich:
>> On 16.08.2024 13:19, Sergiy Kibrik wrote:
>>> --- a/xen/arch/x86/hvm/svm/svm.c
>>> +++ b/xen/arch/x86/hvm/svm/svm.c
>>> @@ -919,7 +919,8 @@ static void cf_check svm_ctxt_switch_from(struct vcpu *v)
>>>        * Possibly clear previous guest selection of SSBD if set.  Note that
>>>        * SPEC_CTRL.SSBD is already handled by svm_vmexit_spec_ctrl.
>>>        */
>>> -    if ( v->arch.msrs->virt_spec_ctrl.raw & SPEC_CTRL_SSBD )
>>> +    if ( IS_ENABLED(CONFIG_AMD) &&
>>> +         v->arch.msrs->virt_spec_ctrl.raw & SPEC_CTRL_SSBD )
>>>       {
>>>           ASSERT(v->domain->arch.cpuid->extd.virt_ssbd);
>>>           amd_set_legacy_ssbd(false);
>>> @@ -953,7 +954,8 @@ static void cf_check svm_ctxt_switch_to(struct vcpu *v)
>>>           wrmsr_tsc_aux(v->arch.msrs->tsc_aux);
>>>   
>>>       /* Load SSBD if set by the guest. */
>>> -    if ( v->arch.msrs->virt_spec_ctrl.raw & SPEC_CTRL_SSBD )
>>> +    if ( IS_ENABLED(CONFIG_AMD) &&
>>> +         v->arch.msrs->virt_spec_ctrl.raw & SPEC_CTRL_SSBD )
>>>       {
>>>           ASSERT(v->domain->arch.cpuid->extd.virt_ssbd);
>>>           amd_set_legacy_ssbd(true);
>> Instead of these changes, shouldn't AMD_SVM become dependent upon AMD in
>> Kconfig?
> 
> It could be done earlier, yet I haven't done so since we briefly touched 
> this before and decided not to link {AMD,INTEL} with {AMD_SVM,INTEL_VMX} 
> then:
> 
> https://lore.kernel.org/xen-devel/9a973f18-e0af-456c-8b07-6869f044519e@citrix.com/

Yet that only suggests that e.g HYGON also ought to select AMD_SVM. Which
will happen transitively with HYGON selecting AMD (in the earlier patch).

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 10:14:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 10:14:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785635.1195111 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjcAr-0001MC-3c; Thu, 29 Aug 2024 10:14:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785635.1195111; Thu, 29 Aug 2024 10:14:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjcAr-0001M5-14; Thu, 29 Aug 2024 10:14:41 +0000
Received: by outflank-mailman (input) for mailman id 785635;
 Thu, 29 Aug 2024 10:14:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zolI=P4=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjcAq-0001Lz-DY
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 10:14:40 +0000
Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com
 [2a00:1450:4864:20::22d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 7f9e97a6-65ef-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 12:14:38 +0200 (CEST)
Received: by mail-lj1-x22d.google.com with SMTP id
 38308e7fff4ca-2f3e071eb64so5654441fa.1
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 03:14:38 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89892223dbsm58517266b.202.2024.08.29.03.14.36
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 03:14:36 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7f9e97a6-65ef-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724926478; x=1725531278; 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=nSvw49VZtnVp2/3l5caroRkHs18mkUqTFKbF+KUpyGI=;
        b=YJMu7CrIwf0SMWK1i6JOdoCCELl6YM2jJIEd7w3y2Gs5nS+SKkrGCXeDH0oNzlqi2o
         FeVV/h9sCKlezw3Fhj+c5qMb8bec9w1ffFdvhFqEUYpI2yUr8LMiD7RaTsNxxGQLMYTA
         kilt8QD+9mFoWnChJiG7xEQ52Npsxk0lp1d40=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724926478; x=1725531278;
        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=nSvw49VZtnVp2/3l5caroRkHs18mkUqTFKbF+KUpyGI=;
        b=wII+V9aBLzNJt74WG2ZrwqabBoPuP1DPS3lOJocBi/fuylXqSTFVNRe8DihMqK4BR3
         cMsluN1JHRvnQ0MUuV/nhK+uzwQYqUcezeDuCqkVcjPO1b8ok9ZYsS8N9EwD0UNSUZGw
         M2ZfKe3E9wyV/JCFaV1OlfcsbTYqSh7h8h3TGO6CuVUZa6HVQga8D2IuMIhy6gvi4Rg6
         3HSqtaA65Xx4plXeleLEyXD3xwZJFt+5RzlJiajUEtrZvrnQmEu2zJV0GrjNFJS58+ES
         /1hk0mUjclSHj+Q/zy6XWlwCYPE9vK6Qc7eYN7oq6nIvqE8Ns3yVcKRFU5D/4BqOo85z
         GUkw==
X-Forwarded-Encrypted: i=1; AJvYcCUdN9sWesHh+qPH8MoqOLZrgwv/4mfN8/AmZ467lIvjR/YgCxZ+T8OtQ686Q8YBg+esAF5Y13cTDn8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxjRPBwpCUUrMWfUZ8Nv7UIftYonFOIB1AbQW9W9GaOgMCfORIb
	ZDJTLNqMzdWXzfjoIo9vP33HXv7/CbjajncKytPH+bCyfMX+4MHLo/GUzRCszzI=
X-Google-Smtp-Source: AGHT+IGmdPQS3s5uaSwuPSFaUVcfTRzZg+SyfUjfY7lYELFnu6/rvH34kOBhnArSYUNKpoKlDlt17Q==
X-Received: by 2002:a05:651c:1541:b0:2f5:d04:4a7f with SMTP id 38308e7fff4ca-2f6106d8e2amr23721381fa.20.1724926477203;
        Thu, 29 Aug 2024 03:14:37 -0700 (PDT)
Message-ID: <40ee3e13-7725-4266-9fcb-6b6d14f31e54@citrix.com>
Date: Thu, 29 Aug 2024 11:14:35 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v3] x86/intel: optional build of PSR support
To: Sergiy Kibrik <Sergiy_Kibrik@epam.com>, xen-devel@lists.xenproject.org
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Jan Beulich <jbeulich@suse.com>
References: <20240829090559.149249-1-Sergiy_Kibrik@epam.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20240829090559.149249-1-Sergiy_Kibrik@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 29/08/2024 10:05 am, Sergiy Kibrik wrote:
> Platform Shared Resource feature is available for certain Intel's CPUs only,
> hence can be put under CONFIG_INTEL build option.

AMD implement PSR too, and even some extensions over what Intel implement.

Furthermore it is likely that the eventual automotive system will want
to make use of it to reduce interference between criticial and
non-critical VMs.

What is currently true is "Xen's implementation of PSR only supports
Intel CPUs right now".

But - I think it is wrong to tie this to CONFIG_INTEL.

Perhaps CONFIG_PSR which is selected by CONFIG_INTEL for now, which can
eventually become user selectable option?

>
> When !INTEL then PSR-related sysctls XEN_SYSCTL_psr_cmt_op &
> XEN_SYSCTL_psr_alloc are off as well.
>
> Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
> CC: Jan Beulich <jbeulich@suse.com>
> ---
> v2 patch here:
> https://lore.kernel.org/xen-devel/20240801084453.1163506-1-Sergiy_Kibrik@epam.com/
>
> changes in v3:
>  - drop stubs for psr_domain_{init,free} & psr_ctxt_switch_to() and guard these
>    routines at call sites

Why?  That's error prone and contrary to how other subsystems work.

> diff --git a/xen/arch/x86/include/asm/psr.h b/xen/arch/x86/include/asm/psr.h
> index 51df78794c..d42c7f1580 100644
> --- a/xen/arch/x86/include/asm/psr.h
> +++ b/xen/arch/x86/include/asm/psr.h
> @@ -67,10 +67,17 @@ enum psr_type {
>  
>  extern struct psr_cmt *psr_cmt;
>  
> +#ifdef CONFIG_INTEL
>  static inline bool psr_cmt_enabled(void)
>  {
>      return !!psr_cmt;
>  }
> +#else
> +static inline bool psr_cmt_enabled(void)
> +{
> +    return false;
> +}

This would be better as simply:

static inline bool psr_cmt_enabled(void)
{
    return IS_ENABLED(CONFIG_blah) ? !!psr_cmt : false;
}

or if the worst comes to the worst,

static inline bool psr_cmt_enabled(void)
{
#ifdef CONFIG_blah
    return !!psr_cmt;
#else
    return false;
#endif
}

Both cases leave you with only a single function declaration, which
helps grep/tags/cscope-ability.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 10:58:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 10:58:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785647.1195121 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjcqt-0001qv-Be; Thu, 29 Aug 2024 10:58:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785647.1195121; Thu, 29 Aug 2024 10:58:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjcqt-0001qo-8k; Thu, 29 Aug 2024 10:58:07 +0000
Received: by outflank-mailman (input) for mailman id 785647;
 Thu, 29 Aug 2024 10:58: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=4Ugx=P4=cloud.com=kelly.choi@srs-se1.protection.inumbo.net>)
 id 1sjcqs-0001qe-Ed
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 10:58:06 +0000
Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com
 [2a00:1450:4864:20::52a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8ffb36a2-65f5-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 12:58:03 +0200 (CEST)
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-5c0a9ae3665so465802a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 03:58:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8ffb36a2-65f5-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724929082; x=1725533882; 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=/6CBlYePOkvF5FsLWKMWCnZEaLFgbgH1XcB164VcwJg=;
        b=KEvT1u26W8p+R/rSY6bfKrl+uF6b2rso2JUEndHe6/7aeYtbKLkoJkD3691epSySMP
         8hUB2k2esBEg0xaUJxWU6Ffgh1O7/efbAeTIKM9PSMe91LneiCmrKgtML2brcdRsKWjg
         yki1HHq4EN+HUUZqUHGS07SBVIPHMFG8W/EtI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724929082; x=1725533882;
        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=/6CBlYePOkvF5FsLWKMWCnZEaLFgbgH1XcB164VcwJg=;
        b=nRCTa3OSE649qmpy4FtNOAbZVldzO7Rx0llehjs7j9n9sXeCnYWpN/r+xTPF2Mr9lg
         Yfo0hPupExGDVwnGuL5aKcsz9maLTqMtfRZEEabAgnGfqdQ3bzBhBCldJUHv8PHX6giO
         5s4r+ZuBYu13LTXihIjxfmx7QRUJn4+AzL66OoFM/+RXwD1MKgfTUiLi5pWjD3NQAFUj
         YNHzq0eyMotmRzDswAP/YAbJ4mSyG2Ob6FqwLh+RzLsPZsCmyulGEh1zgd+qLqX5b24L
         vchFCRXitJMbP7jS6S3zDAtbRBYZo7fCRRWC6dGkyag3NA9JJcLg1XN6FrHWPKjOLO75
         Qh0A==
X-Forwarded-Encrypted: i=1; AJvYcCXWoT3/8uOi4eqzmplwAjEl+z6KGPzMDZOErkeMWWCI4Sub0i+Jj4NNHDPZ7gtTALa++9bxLM8vSWQ=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzllZIb7gfPjkLm75EDCcX+LMKnxq1ZRF03dUOoDwmPom70rkjK
	dl8ajJgt7TPmHosB/SqXxG2VDTGCFMqXCYckgbuu8dNkNSZdbBKvLxAYHdP3KCAvM3iIB6MzymR
	HuUyhipgVrreOY7hzX1gyrXgg/ko6RlEmuprLQ2JNcbkGTNjJ
X-Google-Smtp-Source: AGHT+IFqRxu0NDBTvUxw+egd/griYRSV2N2DKuQcEwrKlm1gwdKbdqspnc2BtSr1Cj+nbc6dVvjQcZUhW5M91nn3xOM=
X-Received: by 2002:a05:6402:13d5:b0:5bf:f1:908 with SMTP id
 4fb4d7f45d1cf-5c21ed86a9bmr2149089a12.24.1724929082009; Thu, 29 Aug 2024
 03:58:02 -0700 (PDT)
MIME-Version: 1.0
References: <CAO-mL=zWYsDGkBoDtc8erGfAFnaR1y+FaLKsx3pEJ3MgxKAy0Q@mail.gmail.com>
 <alpine.DEB.2.22.394.2408161111160.298534@ubuntu-linux-20-04-desktop> <c5e23ad4-5415-4ea9-9b9d-806cd93fd742@suse.com>
In-Reply-To: <c5e23ad4-5415-4ea9-9b9d-806cd93fd742@suse.com>
From: Kelly Choi <kelly.choi@cloud.com>
Date: Thu, 29 Aug 2024 11:57:26 +0100
Message-ID: <CAO-mL=wE_mK1JkV4=M7hkcM-y1p-JAZawbvLiVp18CwzeW4i1Q@mail.gmail.com>
Subject: Re: Xen Project statistics help
To: Jan Beulich <jbeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>, xen-devel <xen-devel@lists.xenproject.org>, 
	committers@xenproject.org
Content-Type: multipart/alternative; boundary="0000000000003250b20620d0595a"

--0000000000003250b20620d0595a
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thanks both.
I'll look to see what's possible, although if anyone could help automate
this monthly that would be greatly helpful!

Many thanks,
Kelly Choi

Community Manager
Xen Project


On Mon, Aug 19, 2024 at 9:38=E2=80=AFAM Jan Beulich <jbeulich@suse.com> wro=
te:

> On 16.08.2024 20:25, Stefano Stabellini wrote:
> > xen.biterg.io was created by a company called Bitergia. Bitergia was
> > later contracted by the Linux Foundation to create a generic dashboard
> > for all their Open Source projects. Getting access to the Linux
> > Foundation dashboard is the best way to go (if it comes to no cost to
> > our project).
> >
> > I have used scripts like these in the past to get some data out of a
> > release. You can copy/paste the output to an Excel datasheet to do
> > further calculations there.
> >
> > # List of contributors by name (using the commit "Author" tag) for the
> > # 4.19 release. One name per commit.
> > git log 4.18.0-rc4...4.19.0-rc4 --format=3D'%aN' | sort | uniq -c | sor=
t
> -rn
> >
> > # List of reviewers (using the Reviewed-by and Acked-by tags) for the
> > # 4.19 release. One name per review.
> > git log 4.18.0-rc4...4.19.0-rc4 --pretty=3Dformat:%b | grep -E
> "Reviewed-by|Acked-by" | sed -E
> 's/.*(Reviewed-by|Acked-by):\s*(.*)\s*<.*/\2/' | sort | uniq -c | sort -r=
n
>
> Just to mention it: Going by tags here doesn't come anywhere close to the
> actual work put into reviewing, even when leaving aside the obvious
> difference between small, large but mechanical, and large+intrusive
> changes. Imo unlike commit stats, review stats would better be collected
> from the mailing list.
>
> Jan
>

--0000000000003250b20620d0595a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thanks both.=C2=A0<div>I&#39;ll look to see what&#39;s pos=
sible, although if anyone could help automate this monthly that would be gr=
eatly helpful!=C2=A0</div><div><br clear=3D"all"><div><div dir=3D"ltr" clas=
s=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><=
div>Many thanks,</div><div>Kelly Choi</div><div><br></div><div><div style=
=3D"color:rgb(136,136,136)">Community 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 Mon, Aug 19, 2024 at 9:38=E2=80=AFAM Jan Beulich &lt;<a href=3D"mailto:j=
beulich@suse.com">jbeulich@suse.com</a>&gt; wrote:<br></div><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid =
rgb(204,204,204);padding-left:1ex">On 16.08.2024 20:25, Stefano Stabellini =
wrote:<br>
&gt; <a href=3D"http://xen.biterg.io" rel=3D"noreferrer" target=3D"_blank">=
xen.biterg.io</a> was created by a company called Bitergia. Bitergia was<br=
>
&gt; later contracted by the Linux Foundation to create a generic dashboard=
<br>
&gt; for all their Open Source projects. Getting access to the Linux<br>
&gt; Foundation dashboard is the best way to go (if it comes to no cost to<=
br>
&gt; our project).<br>
&gt; <br>
&gt; I have used scripts like these in the past to get some data out of a<b=
r>
&gt; release. You can copy/paste the output to an Excel datasheet to do<br>
&gt; further calculations there.<br>
&gt; <br>
&gt; # List of contributors by name (using the commit &quot;Author&quot; ta=
g) for the<br>
&gt; # 4.19 release. One name per commit.<br>
&gt; git log 4.18.0-rc4...4.19.0-rc4 --format=3D&#39;%aN&#39; | sort | uniq=
 -c | sort -rn<br>
&gt; <br>
&gt; # List of reviewers (using the Reviewed-by and Acked-by tags) for the<=
br>
&gt; # 4.19 release. One name per review.<br>
&gt; git log 4.18.0-rc4...4.19.0-rc4 --pretty=3Dformat:%b | grep -E &quot;R=
eviewed-by|Acked-by&quot; | sed -E &#39;s/.*(Reviewed-by|Acked-by):\s*(.*)\=
s*&lt;.*/\2/&#39; | sort | uniq -c | sort -rn<br>
<br>
Just to mention it: Going by tags here doesn&#39;t come anywhere close to t=
he<br>
actual work put into reviewing, even when leaving aside the obvious<br>
difference between small, large but mechanical, and large+intrusive<br>
changes. Imo unlike commit stats, review stats would better be collected<br=
>
from the mailing list.<br>
<br>
Jan<br>
</blockquote></div>

--0000000000003250b20620d0595a--


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 10:59:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 10:59:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785652.1195131 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjcsW-0002NX-M6; Thu, 29 Aug 2024 10:59:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785652.1195131; Thu, 29 Aug 2024 10:59:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjcsW-0002NQ-Je; Thu, 29 Aug 2024 10:59:48 +0000
Received: by outflank-mailman (input) for mailman id 785652;
 Thu, 29 Aug 2024 10:59:46 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=h9f7=P4=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sjcsU-0002NI-UH
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 10:59:46 +0000
Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com
 [2a00:1450:4864:20::635])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cd3ce7a2-65f5-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 12:59:45 +0200 (CEST)
Received: by mail-ej1-x635.google.com with SMTP id
 a640c23a62f3a-a86933829dcso57158066b.3
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 03:59:45 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a898900f612sm64569666b.71.2024.08.29.03.59.43
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 29 Aug 2024 03:59:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cd3ce7a2-65f5-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724929185; x=1725533985; darn=lists.xenproject.org;
        h=content-transfer-encoding:content-disposition:mime-version
         :message-id:subject:cc:to:from:date:from:to:cc:subject:date
         :message-id:reply-to;
        bh=WgXKstaAqWTNUSiEc4ABlxl59g3dFOxxAOyfDM5fp/Y=;
        b=S3xbgTJKZf2fPuQQS2yq2tLZdLZacKKNHjHNenXBfDeESnMA1T5ITbMgY1tJoVl1Yv
         EvO3zcr6tuiNRpNiPgV8jG5b3txe5DfngPGTtxT/ea0Jit5yFbwu7zxLBoZjryavU67B
         FoMRPOMvENjNdzZHvwJEB/Gl/ZDJj3mtgknWI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724929185; x=1725533985;
        h=content-transfer-encoding:content-disposition:mime-version
         :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=WgXKstaAqWTNUSiEc4ABlxl59g3dFOxxAOyfDM5fp/Y=;
        b=fW7N1yInRp61rJc5s1EszXuslETvCQzP4U4B3q1CEj89oa47+f9WFbpuclnDNk2Ybq
         cSj1gBn2qU3e+bIrS79JMyUVgGUiS1SefwgekRm7VVUVppExSTZVv+Dg+/qwCDQGPIX2
         kv86yXFz1RQ+vWOhYDv1aqIQGBim+ftIGc8/harBph0Yz9sH/nvFlOcd3qvjX/FRE6F1
         HfG34MGO4j4PqfePnrVp9Cpbl0ciHsY5KcIOP8mjRvx6w5wvGSR6ghPsoM26dlydB5Cc
         doasICUaJGhsfkqO/fbwnOXL57P9HEkrrQ4emWkpECNL2gDP+IJnC7JkUEVtXAp9cX1b
         1NyA==
X-Gm-Message-State: AOJu0YyTWIBUf4Svn8TFLytOSZmyhJZZXlmBM4PnfiXCIVhPbIUiMypp
	49aomWvvlh2VAkbX7ae3hz05Qm7/Jc2kczcbQvbuCP1bWVZgYszzlTLn9C225rbkO/iLTpBtAcA
	k
X-Google-Smtp-Source: AGHT+IH78T8MzzWY84T8oRuoa9W3JaKb3WBKdUy2RTpJRejBho/SVdUFL0qoBWz+vkt7nlhJs/aYpw==
X-Received: by 2002:a17:907:3daa:b0:a7a:9144:e256 with SMTP id a640c23a62f3a-a897f778b9amr202392166b.6.1724929184385;
        Thu, 29 Aug 2024 03:59:44 -0700 (PDT)
Date: Thu, 29 Aug 2024 12:59:43 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Paul Durrant <paul@xen.org>, Owen Smith <owen.smith@cloud.com>,
	Mark Syms <mark.syms@citrix.com>,
	Anthony Perard <anthony.perard@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>
Subject: Block protocol incompatibilities with 4K logical sector size disks
Message-ID: <ZtBUnzH4sIrFAo0f@macbook.local>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

Hello,

To give some context, this started as a bug report against FreeBSD failing to
work with PV blkif attached disks with 4K logical sectors when the backend is
Linux kernel blkback:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=280884

Further investigation has lead me to discover that the protocol described in
the public blkif.h header is not implemented uniformly, and there are major
inconsistencies between implementations regarding the meaning of the `sectors`
and `sector-size` xenstore nodes, and the sector_number and {first,last}_sect
struct request fields.  Below is a summary of the findings on the
implementation I've analyzed.

Linux blk{front,back} always assumes the `sectors` xenstore node to be in 512b
units, regardless of the value of the `sector-size` node.  Equally the ring
request sector_number and the segments {first,last}_sect fields are always
assumed to be in units of 512b regardless of the value of `sector-size`.  The
`feature-large-sector-size` node is neither exposed by blkfront, neither
checked by blkback before exposing a `sector-size` node different than 512b.

FreeBSD blk{front,back} calculates (and for blkback exposes) the disk size as
`sectors` * `sector-size` based on the values in the xenstore nodes (as
described in blkif.h).  The ring sector_number is filled with the sector number
based on the `sector-size` value, however the {first,last}_sect fields are
always calculated as 512b units.   The `feature-large-sector-size` node is
neither exposed by blkfront, neither checked by blkback before exposing a
`sector-size` node different than 512b.

QEMU qdisk blkback implementation exposes the `sectors` disk size in units of
`sector-size` (as FreeBSD blkback).  The ring structure fields sector_number
and {first,last}_sect are assumed to be in units of `sector-size`.  This
implementation will not expose a `sector-size` node with a value different than
512 unless the frontend xenstore path has the `feature-large-sector-size` node
present.

Windows blkfront calculates the disk size as `sectors` * `sector-size` from the
xenstore nodes exposed by blkback.   The ring structure fields sector_number
and {first,last}_sect are assumed to be in units of `sector-size`.  This
frontend implementation exposes `feature-large-sector-size`.

When using a disk with a logical sector size different than 512b, Linux is only
compatible with itself, same for FreeBSD.  QEMU blkback implementation is also
only compatible with the Windows blkfront implementation.  The
`feature-large-sector-size` seems to only be implemented for the QEMU/Windows
combination, both Linux and FreeBSD don't implement any support for it neither
in the backend or the frontend.

The following table attempts to summarize in which units the following fields
are defined for the analyzed implementations (please correct me if I got some
of this wrong):

                        │ sectors xenbus node │ requests sector_number │ requests {first,last}_sect
────────────────────────┼─────────────────────┼────────────────────────┼───────────────────────────
FreeBSD blk{front,back} │     sector-size     │      sector-size       │           512
────────────────────────┼─────────────────────┼────────────────────────┼───────────────────────────
Linux blk{front,back}   │         512         │          512           │           512
────────────────────────┼─────────────────────┼────────────────────────┼───────────────────────────
QEMU blkback            │     sector-size     │      sector-size       │       sector-size
────────────────────────┼─────────────────────┼────────────────────────┼───────────────────────────
Windows blkfront        │     sector-size     │      sector-size       │       sector-size
────────────────────────┼─────────────────────┼────────────────────────┼───────────────────────────
MiniOS                  │     sector-size     │          512           │           512
────────────────────────┼─────────────────────┼────────────────────────┼───────────────────────────
tapdisk blkback         │         512         │      sector-size       │           512

It's all a mess, I'm surprised we didn't get more reports about brokenness when
using disks with 4K logical sectors.

Overall I think the in-kernel backends are more difficult to update (as it
might require a kernel rebuild), compared to QEMU or blktap.  Hence my slight
preference would be to adjust the public interface to match the behavior of
Linux blkback, and then adjust the implementation in the rest of the backends
and frontends.

There was an attempt in 2019 to introduce a new frontend feature flag to signal
whether the frontend supported `sector-size` xenstore nodes different than 512 [0].
However that was only ever implemented for QEMU blkback and Windows blkfront,
all the other backends will expose `sector-size` different than 512 without
checking if `feature-large-sector-size` is exposed by the frontend.  I'm afraid
it's now too late to retrofit that feature into existing backends, seeing as
they already expose `sector-size` nodes greater than 512 without checking if
`feature-large-sector-size` is reported by the frontend.

My proposal would be to adjust the public interface with:

 * Disk size is calculated as: `sectors` * 512 (`sectors` being the contents of
   such xenstore backend node).

 * All the sector related fields in blkif ring requests use a 512b base sector
   size, regardless of the value in the `sector-size` xenstore node.

 * The `sector-size` contains the disk logical sector size.  The frontend must
   ensure that all request segments addresses are aligned and it's length is
   a multiple of such size.  Otherwise the backend will refuse to process the
   request.

Regards, Roger.

[0] https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=67e1c050e36b2c9900cca83618e56189effbad98


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 11:05:51 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 11:05:51 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785660.1195142 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjcyI-0003uz-AS; Thu, 29 Aug 2024 11:05:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785660.1195142; Thu, 29 Aug 2024 11:05:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjcyI-0003us-6c; Thu, 29 Aug 2024 11:05:46 +0000
Received: by outflank-mailman (input) for mailman id 785660;
 Thu, 29 Aug 2024 11:05:44 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=4Ugx=P4=cloud.com=kelly.choi@srs-se1.protection.inumbo.net>)
 id 1sjcyG-0003um-Hm
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 11:05:44 +0000
Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com
 [2a00:1450:4864:20::52f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id a1e704bc-65f6-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 13:05:42 +0200 (CEST)
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5c0ba23a5abso496456a12.3
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 04:05:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a1e704bc-65f6-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724929542; x=1725534342; darn=lists.xenproject.org;
        h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject
         :date:message-id:reply-to;
        bh=QAxJPme2nq5IE9WRfCabt2OHBetHDLSVy8OJAqrdbJQ=;
        b=LC4jXyGVx67ho6TUoA3nuB2bNUn+4X61rBJPB2o5SJcUaDWmmJ6x1s0ePWYsq+5FTZ
         PBBL1FlVKA4PEIsNsZMQ1JRbqS1qgFFdlSttsTiyrcc1pzHGY2/yU5hP9e0g4RWscJRW
         plMzAuI5UbE9eIsxLF9u+DICmOL1FGbbnpRVw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724929542; x=1725534342;
        h=cc:to:subject:message-id:date:from:mime-version:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=QAxJPme2nq5IE9WRfCabt2OHBetHDLSVy8OJAqrdbJQ=;
        b=GvoIfBwUoD5qJP15JJyOBCI90CHyYaEgMOmP8FK6R24oEsvp4rs2T6lj2jVJ9W1bL3
         FUI9x004VWe5Fj5VDJ6Hm0wGooiKajYuiNy+N7masFVa9qHej56zJdP/l3C/8ReHYOeH
         Px+SUo5UQnBhMmR9XWpy4n7TtcNtuOr1YEEP5SkBZMGhc+YhzHUCioTE9iQwxNld3Yuv
         U9E4gzo7/uQjgp8GsT3b5Yhd/CxIuvSPVfzQj+fr+Cy7/B8ndGfmj92VGuLTQb2gTSSf
         H6hepr1/Dwm/qUi9+hGVLk3zs2xAzV0HOSNSQhDw1/G29xlfx5lTZWavDmXTxBcioKtW
         wQsQ==
X-Gm-Message-State: AOJu0YxbUn7wyMpmAo1Q7eps3/KcU9Mg3zHKhlDs85bTNH+Zxe5n2iZa
	Qw0zHi2guXekkT0A//0YWwsCP+nMReOBdmX5gTY0FiESRLTHyvX4zRkpEtzR1NX2QoeKJmajHpE
	0rbQ30q/7G+JC0hcTaMA9yN2uPfCd/4fn9UGuXvjr1QVtDE5y
X-Google-Smtp-Source: AGHT+IFOBaS1lHlfCMBMY8Zj9qkS7ulQsKiRRRC0Qr+J5necsE4L9rHv2LYTHFVIJj9lrZWpoGtFEzcNWu4en+rUAmY=
X-Received: by 2002:a17:907:7208:b0:a86:94e2:2a47 with SMTP id
 a640c23a62f3a-a897f835caemr201372066b.15.1724929541268; Thu, 29 Aug 2024
 04:05:41 -0700 (PDT)
MIME-Version: 1.0
From: Kelly Choi <kelly.choi@cloud.com>
Date: Thu, 29 Aug 2024 12:05:05 +0100
Message-ID: <CAO-mL=y+AGD7Yw2WNK7GWKBEYvcHXTHFbRSSJLFREHMG_KGwZg@mail.gmail.com>
Subject: Call for next release manager
To: xen-devel <xen-devel@lists.xenproject.org>
Cc: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Content-Type: multipart/alternative; boundary="0000000000009223e90620d07402"

--0000000000009223e90620d07402
Content-Type: text/plain; charset="UTF-8"

Hi all,

I'd like to thank Oleksii for his hard work as the release manager for 4.19.

As we prepare for our next release, we welcome any interest from the
community in becoming the next release manager.

Feel free to reply directly with your interest, or you can raise this in
the community call.

Many thanks,
Kelly Choi

Community Manager
Xen Project

--0000000000009223e90620d07402
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi all,<div><br></div><div>I&#39;d like to thank Oleksii f=
or his hard work as the release manager for 4.19.</div><div><br></div><div>=
As we prepare for our next release, we welcome any interest from the commun=
ity in becoming the next release manager.</div><div><br></div><div>Feel fre=
e to reply directly with your interest, or you can raise this in the commun=
ity call.=C2=A0</div><div><br clear=3D"all"><div><div dir=3D"ltr" class=3D"=
gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"ltr"><div>M=
any thanks,</div><div>Kelly Choi</div><div><br></div><div><div style=3D"col=
or:rgb(136,136,136)">Community Manager</div><div style=3D"color:rgb(136,136=
,136)">Xen Project=C2=A0<br></div></div></div></div></div></div></div>

--0000000000009223e90620d07402--


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 11:31:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 11:31:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785669.1195152 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdNF-0001M0-9b; Thu, 29 Aug 2024 11:31:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785669.1195152; Thu, 29 Aug 2024 11:31:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdNF-0001Lt-6X; Thu, 29 Aug 2024 11:31:33 +0000
Received: by outflank-mailman (input) for mailman id 785669;
 Thu, 29 Aug 2024 11:31:32 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=D0cO=P4=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sjdNE-0001Lj-ML
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 11:31:32 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on2062e.outbound.protection.outlook.com
 [2a01:111:f403:2418::62e])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3ba7db13-65fa-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 13:31:30 +0200 (CEST)
Received: from DM6PR13CA0011.namprd13.prod.outlook.com (2603:10b6:5:bc::24) by
 PH7PR12MB9073.namprd12.prod.outlook.com (2603:10b6:510:2eb::22) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug
 2024 11:31:25 +0000
Received: from CY4PEPF0000E9CD.namprd03.prod.outlook.com
 (2603:10b6:5:bc:cafe::b2) by DM6PR13CA0011.outlook.office365.com
 (2603:10b6:5:bc::24) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.14 via Frontend
 Transport; Thu, 29 Aug 2024 11:31:25 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CY4PEPF0000E9CD.mail.protection.outlook.com (10.167.241.132) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 11:31:24 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 29 Aug
 2024 06:31:23 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 29 Aug
 2024 06:31:23 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Thu, 29 Aug 2024 06:31:22 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3ba7db13-65fa-11ef-99a0-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Kwou0QZukpW9/yeY/Nsv7JHn/yRwdHhOdDjruPmrEaAhKDytHil4H2+3yi9Mmx+S7a9mb1p72b9gALLG6B1u5EBTztxrOTxhYGNfO1bLihjFN4t+DTgcZNZF996GfIjUhsvI6A9NGOcV8m9hk1kLuD4K36y1VhKrE6J6vGiC4h2yKdAySGS22X58W+bMAWqlxZ2vtnDHHW/6KYWwdo1iJUWaD6S48peV443fcUR3zaMQRgrTzRRecuB6pRFgdkvtlC4CdT7lzkStljt6OtbSl/Jv008w4af0eMOq0GOsuFG3fyT0SjxDWtFBMJbVlNqUSVWIu0IkgPnmUemAmkyWrA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Gm2POMBECsGV7z8vdKZQvlwhA36fQr6aLBAeMcMvOw8=;
 b=atGIA5w3+z3PvRd8Oau1FSqjg1Z+ahCzOjJ3czvhMzA/GmuB/0jvg+KXdoLwikA+Nf4bhStyYS5CtMoJsmaV/J/33Fo/RaMftH8gXIsm0j2NS6v8Sj2ypvFuS4vnh/e/QaRsVSAWlJv2dDtqaccJ1vGS81Q+sMQDKp2JprGWrebQzCQvj+hZBeygLTVpSK9GlkJcRAqjIFF8wtc6MPQC67GI7SkqDBDAY7j/yfhrJvXHvP9Yu1AL4aulG6VanvkR3hO34OSQuHSt4kQ4f02jEcAVnjjHroCGWa6mPOLPB4mRU34grRwKR1nqnyIsp0mxg/kqxYRHqQGvYuD+NW97vw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Gm2POMBECsGV7z8vdKZQvlwhA36fQr6aLBAeMcMvOw8=;
 b=u9GUA2IHZwRzfD2fw5ptln6mAH0RiPRzzN9G9JuusuYLJIsR+0NOXcOgrXffj8Qco2NBRYFmoYylCYUG3/GDN6Uw6nDc4nMD2KhXBH4+Q6pJoV6MHANOfNJ8lHjpnXi5VpRfnKAevEmU1TpHK+RPIRVERTDRF3+g1vyIb6QaTms=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Michal Orzel <michal.orzel@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Bertrand Marquis <bertrand.marquis@arm.com>, "Ayan
 Kumar Halder" <ayan.kumar.halder@amd.com>, Artem Mygaiev
	<artem_mygaiev@epam.com>, Hisao Munakata <hisao.munakata.vt@renesas.com>
Subject: [PATCH v2] docs: fusa: Add requirements for generic timer
Date: Thu, 29 Aug 2024 12:31:20 +0100
Message-ID: <20240829113120.3980270-1-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9CD:EE_|PH7PR12MB9073:EE_
X-MS-Office365-Filtering-Correlation-Id: 62cc6915-9716-4bbc-8546-08dcc81e1d3e
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?alh1WRuvGe58qx7RN8CRSG9uvjraUDTkAWAkwrO5ThgGqCGWheWbBPraUqBq?=
 =?us-ascii?Q?xNO+VO0PyBr36VDglCevlKDPLhmLHJCRe9pvJTiIfSibaUo4fAJYzh2wSYgq?=
 =?us-ascii?Q?Ww6lAlub6sFK5+psFoPbLAPsORrxNR8Dou2PBXluY8HwlnycBpVwoGBXue5n?=
 =?us-ascii?Q?1oSevtBPwBS3AbDAsblZsiAkcreEE9w10nZWYIE7zehK24f5CMjoTg8q/YS5?=
 =?us-ascii?Q?6juVflxMIvUjQrQJmQjAbx3ysk35SZUeNHp+r3fQGPSTamTw5cuNZjfo04Js?=
 =?us-ascii?Q?pBn9hLceOVkSDxfkaFj/ORJ1w09tl5R8P4tT/G0U1IagD5kfkMRJ70iO24KQ?=
 =?us-ascii?Q?sJ4dI4tcgxtwtlGbE3/7qu5jdp5RIW6KeJyLCdsl60KPgcUVwC8uuAYaJYtq?=
 =?us-ascii?Q?pEvYT1GAOTtOKuSnw4f1gRGwPmCClkr3843ZinCTVo7fOxVq1/K1AAUv/U7r?=
 =?us-ascii?Q?VqOSI8EBqnNuIlPK+dzmTsJGPyoD7ALop3sh/Nti7InoojSlW3tPmJ8B6UvF?=
 =?us-ascii?Q?leh8qLKKEZsm4x4+yBiY2Lwlkiyd5+BUCDqmnYNpoLpxHzOaxV8A7pjsbasx?=
 =?us-ascii?Q?cLv5b6Y1sfcl2zMtRYJId27gnkQUCtMH1nQTmM7ImEFB8PML1zaQiRsiMFEn?=
 =?us-ascii?Q?jFlpYK8DgJ+jp2aiWd53y5fPQbySYJ4edIL/lNKJ0OksiYEpiW7g7jFNd3H/?=
 =?us-ascii?Q?TwKjuQ1HaxRWNYhH0W8wA8PugnLxC4Wsa8KOukTq6Fm5QsV4Bpzxy7PWjxC4?=
 =?us-ascii?Q?yryngZTjUyJJwrzZw2Ln2BvCq1YVb90j1VBMqzuPNZm3RjSdJY928mL8TpbV?=
 =?us-ascii?Q?XltVYw2DljYLzbyXFBlt3cNXvTIqoI9qQXWvLLtfB2EItMOD+s279l5d728H?=
 =?us-ascii?Q?6Bl3Qt5EUd2gbjDkAw58NpYxeZnaKNbtwS6DDhXr/EA48xWwvCv6p+/o7JHi?=
 =?us-ascii?Q?M6mzYbgfITJ+IJ2bd9VsIj9rsp+YiCRviHpS6/7SwPaqtZsBsfOTQNVJ4zx3?=
 =?us-ascii?Q?XK7kP8xGsD7YeRcOVoDMWuIHJPjmyiyHRdu4C7XEdwwfpb81yUzCDkA6o3IE?=
 =?us-ascii?Q?+XfYp6heODhZ5nGZXPZmRJAzRY5da7JXEuu3PIwnSiam66QA6RbEMt/QmEIU?=
 =?us-ascii?Q?FZ6mwyMKhZFjNRfjYRFIpIvqxVu0ngA2gXSQ0WNSxD5QZ0qxj43cATbEHc3z?=
 =?us-ascii?Q?ZnCv7+LI8A5ZQRi1mO8z1XKY6sS6cPpu5CdAumcbNrridQBYdub8kJeAn6kn?=
 =?us-ascii?Q?z+PUT44PYFgAERsuiHS96xh3LFuMMe5CC02Y6Aqizsbu62phSeRrCVIprMVj?=
 =?us-ascii?Q?9pirL5TwkCRzSei1x1GSSaYNjZ+VdFlpkQWKaPTi+N1O6hrLldDzQwc/Tulu?=
 =?us-ascii?Q?LRDLR0FrczcGHA8OsbvYh5ojbn/RQe6k/ClBAgGMZKBcI7lvrhPLWTmNfuQZ?=
 =?us-ascii?Q?9jtVCzhwZOsPdijaBbwV8/yXfKdtQOKj?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 11:31:24.2947
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 62cc6915-9716-4bbc-8546-08dcc81e1d3e
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000E9CD.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB9073

From: Michal Orzel <michal.orzel@amd.com>

Add the requirements for the use of generic timer by a domain

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
Changes from -

v1 - 1. Fixed some wordings as suggested in v1.
2. Removed the comments which mentions Domain specific usage details.

 .../reqs/design-reqs/arm64/generic-timer.rst  | 123 ++++++++++++++++++
 docs/fusa/reqs/index.rst                      |   3 +
 docs/fusa/reqs/intro.rst                      |   3 +-
 docs/fusa/reqs/market-reqs/reqs.rst           |  34 +++++
 docs/fusa/reqs/product-reqs/arm64/reqs.rst    |  23 ++++
 5 files changed, 185 insertions(+), 1 deletion(-)
 create mode 100644 docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
 create mode 100644 docs/fusa/reqs/market-reqs/reqs.rst
 create mode 100644 docs/fusa/reqs/product-reqs/arm64/reqs.rst

diff --git a/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
new file mode 100644
index 0000000000..f2a0cd7fb8
--- /dev/null
+++ b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
@@ -0,0 +1,123 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+Generic Timer
+=============
+
+The following are the requirements related to ARM Generic Timer [1] interface
+exposed by Xen to Arm64 domains.
+
+Probe the Generic Timer device tree node from a domain
+------------------------------------------------------
+
+`XenSwdgn~arm64_generic_timer_probe_dt~1`
+
+Description:
+Xen shall generate a device tree node for the Generic Timer (in accordance to
+ARM architected timer device tree binding [2]) in the domain device tree.
+
+Rationale:
+
+Comments:
+Domains can detect the presence of the Generic Timer device tree node.
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Read system counter frequency
+-----------------------------
+
+`XenSwdgn~arm64_generic_timer_read_freq~1`
+
+Description:
+Xen shall expose the frequency of the system counter to the domains in
+CNTFRQ_EL0 register and/or domain device tree's "clock-frequency" property.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Access CNTKCTL_EL1 system register from a domain
+------------------------------------------------
+
+`XenSwdgn~arm64_generic_timer_access_cntkctlel1~1`
+
+Description:
+Xen shall expose Counter-timer Kernel Control register (CNTKCTL_EL1) to the
+domains.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Access virtual timer from a domain
+----------------------------------
+
+`XenSwdgn~arm64_generic_timer_access_virtual_timer~1`
+
+Description:
+Xen shall expose the virtual timer registers (CNTVCT_EL0, CNTV_CTL_EL0,
+CNTV_CVAL_EL0, CNTV_TVAL_EL0) to the domains.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Access physical timer from a domain
+-----------------------------------
+
+`XenSwdgn~arm64_generic_timer_access_physical_timer~1`
+
+Description:
+Xen shall expose physical timer registers (CNTPCT_EL0, CNTP_CTL_EL0,
+CNTP_CVAL_EL0, CNTP_TVAL_EL0) to the domains.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Trigger the virtual timer interrupt from a domain
+-------------------------------------------------
+
+`XenSwdgn~arm64_generic_timer_trigger_virtual_interrupt~1`
+
+Description:
+Xen shall generate virtual timer interrupts to domains when the virtual timer
+condition is met.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+Trigger the physical timer interrupt from a domain
+--------------------------------------------------
+
+`XenSwdgn~arm64_generic_timer_trigger_physical_interrupt~1`
+
+Description:
+Xen shall generate physical timer interrupts to domains when the physical timer
+condition is met.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_timer~1`
+
+[1] Arm Architecture Reference Manual for A-profile architecture, Chapter 11
+[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/timer/arm,arch_timer.yaml
diff --git a/docs/fusa/reqs/index.rst b/docs/fusa/reqs/index.rst
index 78c02b1d9b..183f183b1f 100644
--- a/docs/fusa/reqs/index.rst
+++ b/docs/fusa/reqs/index.rst
@@ -7,3 +7,6 @@ Requirements documentation
    :maxdepth: 2
 
    intro
+   market-reqs
+   product-reqs
+   design-reqs/arm64
diff --git a/docs/fusa/reqs/intro.rst b/docs/fusa/reqs/intro.rst
index d67b18dd9f..245a219ff2 100644
--- a/docs/fusa/reqs/intro.rst
+++ b/docs/fusa/reqs/intro.rst
@@ -55,7 +55,8 @@ Title of the requirement
   be 'XenMkt', 'XenProd' or 'XenSwdgn' to denote market, product or design
   requirement.
   name - This denotes name of the requirement. In case of architecture specific
-  requirements, this starts with the architecture type (ie x86_64, arm64).
+  requirements, this starts with the architecture type (eg x86_64, arm64)
+  followed by component name (eg generic_timer) and action (eg read_xxx).
   revision number - This gets incremented each time the requirement is modified.
 
 
diff --git a/docs/fusa/reqs/market-reqs/reqs.rst b/docs/fusa/reqs/market-reqs/reqs.rst
new file mode 100644
index 0000000000..9c98c84a9a
--- /dev/null
+++ b/docs/fusa/reqs/market-reqs/reqs.rst
@@ -0,0 +1,34 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+Functional Requirements
+=======================
+
+Run Arm64 VMs
+-------------
+
+`XenMkt~run_arm64_vms~1`
+
+Description:
+Xen shall run Arm64 VMs.
+
+Rationale:
+
+Comments:
+
+Needs:
+ - XenProd
+
+Provide timer to the VMs
+------------------------
+
+`XenMkt~provide_timer_vms~1`
+
+Description:
+Xen shall provide a timer to a VM.
+
+Rationale:
+
+Comments:
+
+Needs:
+ - XenProd
diff --git a/docs/fusa/reqs/product-reqs/arm64/reqs.rst b/docs/fusa/reqs/product-reqs/arm64/reqs.rst
new file mode 100644
index 0000000000..7aa3eeab6a
--- /dev/null
+++ b/docs/fusa/reqs/product-reqs/arm64/reqs.rst
@@ -0,0 +1,23 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+Domain Creation And Runtime
+===========================
+
+Emulated Timer
+--------------
+
+`XenProd~emulated_timer~1`
+
+Description:
+Xen shall grant access to "Arm Generic Timer" for the domains.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenMkt~run_arm64_vms~1`
+ - `XenMkt~provide_timer_vms~1`
+
+Needs:
+ - XenSwdgn
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 11:47:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 11:47:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785678.1195161 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdcU-0004Ev-Ma; Thu, 29 Aug 2024 11:47:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785678.1195161; Thu, 29 Aug 2024 11:47:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdcU-0004Eo-Jq; Thu, 29 Aug 2024 11:47:18 +0000
Received: by outflank-mailman (input) for mailman id 785678;
 Thu, 29 Aug 2024 11:47:17 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjdcT-0004E6-7f
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 11:47:17 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 70102f73-65fc-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 13:47:15 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a83597ce5beso96785066b.1
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 04:47:15 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89891daebcsm70409766b.170.2024.08.29.04.47.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 04:47:14 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 70102f73-65fc-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724932035; x=1725536835; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id:from:to:cc
         :subject:date:message-id:reply-to;
        bh=ef/TO3RUZp7UJLqGV5F3Bdki7XY3CnYxHWBDiwP5ghs=;
        b=BppJBfqK///3Co+jyImR27QTzDNm2lXycy1Z1ciP5d3gYtwqx7VHr3ExXcIGlWzeNJ
         DS8ER3EU0W1mkG6PKbHzwPCuYClRkkFiWZ9pjolYbOH1yUnkex5tNcMLh1KTOPWjIQ27
         7oswdd8UniAxt0Uwr6uF5xdd/2QDS2fG2p8yL7Q45jFqoh1CKH53tRtaFLp/v5tH222/
         OgECEddjL/3tYViXD6210Z0+QK8fG678HeQ3EDffSsdtDT6uS2Hovb8sXs2HrSX6p8wI
         8aX2RP0w6Aji87kagK8qqc/zxrBRUoYuOoyu9fAb2XWVtQ3D3IPBq/mCLWjmjYuP4r1m
         YIuw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724932035; x=1725536835;
        h=content-transfer-encoding:autocrypt:subject:from:cc:to
         :content-language:user-agent:mime-version:date:message-id
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=ef/TO3RUZp7UJLqGV5F3Bdki7XY3CnYxHWBDiwP5ghs=;
        b=qz93xl6d2jK7puiPgStS4EUA/j4Yaw9QLivvhSZm1OntG+ehZVlHqFVZKQdIeMYBnZ
         nc5tBbhU/7tOUIpdPDr0C6FPMzsnKO58Y0LIilOk78WnNkirU+OXMT6ufCh/Q29ExfPb
         ///hztu03TT9yDzKgyzwEej+Z7WN6P7FOhpTPqccpUDUhF4sOEHzegcFAgmvII3Oevse
         zcflfxGEKtRZ9Eq1Iypzf2VaHR7co5I6uDHHyNeNOQvgqHOpGdB/3eMXwsTw2z9qMqoD
         OLOj/gPNgSpjlXKQrXE4LmARB8+hR21Ql5L5qaa4GlT9GaQCIt4+g/BYmVut1NQo42ey
         Y8sA==
X-Gm-Message-State: AOJu0YxojlZiFkBG/eb0Jv4M3yrlvYllEXk04htRiNvWakuiCYgIhWat
	Nl8w3fx88OmHpyklY/dyjKeS8ygMIXPiqeVeTGcas0H7qovl7p1LZVB//5JXvOHFOGqciXhEeUU
	=
X-Google-Smtp-Source: AGHT+IG1hf/954NdGq5xjwiHQfApGyexVCeOsm4FQnOmNzbHd3B0zmwCxzHlnqSh8aYLd7egeFd+Dg==
X-Received: by 2002:a17:907:3f14:b0:a72:5967:b34 with SMTP id a640c23a62f3a-a898c473f1dmr183119166b.22.1724932035136;
        Thu, 29 Aug 2024 04:47:15 -0700 (PDT)
Message-ID: <71348420-c60a-4d5c-9548-8e5f24f82c76@suse.com>
Date: Thu, 29 Aug 2024 13:47:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH] x86: drop map-low-16Mb leftovers
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Prior work has fully eliminated that hardcoded boundary. Drop both the
linker script assertion (the upper bound is now the stubs area) and the
artificial extending of xen.efi's image size.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -359,14 +359,6 @@ SECTIONS
 
   DWARF2_DEBUG_SECTIONS
 
-#ifdef EFI
-  /* Trick the linker into setting the image size to no less than 16Mb. */
-  __image_end__ = .;
-  .pad ALIGN(__section_alignment__) : {
-    . = __image_end__ < __image_base__ + MB(16) ? ALIGN(MB(16)) : .;
-  }
-#endif
-
 #ifdef CONFIG_HYPERV_GUEST
   hv_hcall_page = ABSOLUTE(HV_HCALL_PAGE - XEN_VIRT_START + __XEN_VIRT_START);
 #endif
@@ -429,6 +421,3 @@ ASSERT((trampoline_end - trampoline_star
     "not enough room for trampoline and mbi data")
 ASSERT((wakeup_stack - wakeup_stack_start) >= WAKEUP_STACK_MIN,
     "wakeup stack too small")
-
-/* Plenty of boot code assumes that Xen isn't larger than 16M. */
-ASSERT(_end - _start <= MB(16), "Xen too large for early-boot assumptions")


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 11:53:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 11:53:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785701.1195171 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdi2-0005qy-9q; Thu, 29 Aug 2024 11:53:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785701.1195171; Thu, 29 Aug 2024 11:53:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdi2-0005qr-6n; Thu, 29 Aug 2024 11:53:02 +0000
Received: by outflank-mailman (input) for mailman id 785701;
 Thu, 29 Aug 2024 11:53:00 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dlBE=P4=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sjdi0-0005ql-Kc
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 11:53:00 +0000
Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com
 [2a00:1450:4864:20::529])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 3c26f364-65fd-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 13:52:58 +0200 (CEST)
Received: by mail-ed1-x529.google.com with SMTP id
 4fb4d7f45d1cf-5c210e23651so556647a12.3
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 04:52:58 -0700 (PDT)
Received: from fziglio-xenia-fedora.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226ccfe78sm616104a12.69.2024.08.29.04.52.56
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 29 Aug 2024 04:52:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3c26f364-65fd-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724932378; x=1725537178; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=t4OqEWyZVMJYP4Q1dCFXbk9bU+PaTs6KjTWg21ZmJh4=;
        b=iaKNbYMAkB84Q9XDyiK0WGKIocZ4XZx2jJbHgo+j14JE6mA+NPkQpEk9Z982IyrHuW
         Gs7Gp35isDXMlX7uFowMTvhfr1SxxhMQADRL9IW4BypnjLZM3nuSBFZmLM11CfqqssCn
         n9RXB8dFq+Fly1RjXQJnVZ5L+A+Q4DydBVTnM=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724932378; x=1725537178;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=t4OqEWyZVMJYP4Q1dCFXbk9bU+PaTs6KjTWg21ZmJh4=;
        b=ums1RbCfa/CCOU1QcYjmBgEMnovSmPcLgzSNN5LclUra9PeQ+AMZuBZxrsgDhX015V
         3GHi5Eb6XNLwEFxNOaqOPDY+eKUCBT/k+PMOeqpv5UwI9j6SCFCZ2RNFB8pHaYrbdXhq
         ExBwXnNbwQiISZfWkxrp2Xp8ZUM9e89ZLBg1eRdf6SPKC3xty+uh2cflpxBYoPdbKkZQ
         xQlHckmXaBNz7OtPqeJ0Wo47GX3fZNd8mPuO/dx3BrCHwgRvAhyJzr7LenuNz+DdmzoL
         PU6k36SY4QJTfu4ERpW1mgHQZbsLuyv+ueZdUaFniC3MY5el6Laclc2CP5tEnuxoH0nv
         C9og==
X-Gm-Message-State: AOJu0Yz2BbCtg5vFqf52afw80l95rAnJn0NZL5nhuS7lmCxnCSVQ6xC6
	2B0c2FZIojGmO6CZQXLoqH0lTeXcLU8rY2ZpTFMBDx8thRfjY+ihSj3BgokQ2m0AGJrafa5aDo1
	c
X-Google-Smtp-Source: AGHT+IHpIyPbAlSbhyV3XURLXvebXe2XRgkMpd6IIEIdby5cc/qYAgdnr5Vc8CjlYbg+0x50U7G0eg==
X-Received: by 2002:a05:6402:3481:b0:5be:e01c:6b5e with SMTP id 4fb4d7f45d1cf-5c21eda3441mr2093762a12.35.1724932377470;
        Thu, 29 Aug 2024 04:52:57 -0700 (PDT)
From: Frediano Ziglio <frediano.ziglio@cloud.com>
To: xen-devel@lists.xenproject.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH] x86/boot: Use C99 types for integers
Date: Thu, 29 Aug 2024 12:52:44 +0100
Message-ID: <20240829115247.168608-1-frediano.ziglio@cloud.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit

Just style update, no functional change.

Signed-off-by: Frediano Ziglio <frediano.ziglio@cloud.com>
---
 xen/arch/x86/boot/cmdline.c | 30 ++++++++++++++---------------
 xen/arch/x86/boot/defs.h    |  2 +-
 xen/arch/x86/boot/reloc.c   | 38 ++++++++++++++++++-------------------
 3 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/xen/arch/x86/boot/cmdline.c b/xen/arch/x86/boot/cmdline.c
index f9eee756aa..b8ad7f3a14 100644
--- a/xen/arch/x86/boot/cmdline.c
+++ b/xen/arch/x86/boot/cmdline.c
@@ -36,15 +36,15 @@ asm (
 
 /* Keep in sync with trampoline.S:early_boot_opts label! */
 typedef struct __packed {
-    u8 skip_realmode;
-    u8 opt_edd;
-    u8 opt_edid;
-    u8 padding;
+    uint8_t skip_realmode;
+    uint8_t opt_edd;
+    uint8_t opt_edid;
+    uint8_t padding;
 #ifdef CONFIG_VIDEO
-    u16 boot_vid_mode;
-    u16 vesa_width;
-    u16 vesa_height;
-    u16 vesa_depth;
+    uint16_t boot_vid_mode;
+    uint16_t vesa_width;
+    uint16_t vesa_height;
+    uint16_t vesa_depth;
 #endif
 } early_boot_opts_t;
 
@@ -214,7 +214,7 @@ static bool skip_realmode(const char *cmdline)
     return find_opt(cmdline, "no-real-mode", false) || find_opt(cmdline, "tboot=", true);
 }
 
-static u8 edd_parse(const char *cmdline)
+static uint8_t edd_parse(const char *cmdline)
 {
     const char *c;
 
@@ -229,7 +229,7 @@ static u8 edd_parse(const char *cmdline)
     return !strmaxcmp(c, "skipmbr", delim_chars);
 }
 
-static u8 edid_parse(const char *cmdline)
+static uint8_t edid_parse(const char *cmdline)
 {
     const char *c;
 
@@ -245,7 +245,7 @@ static u8 edid_parse(const char *cmdline)
 }
 
 #ifdef CONFIG_VIDEO
-static u16 rows2vmode(unsigned int rows)
+static uint16_t rows2vmode(unsigned int rows)
 {
     switch ( rows )
     {
@@ -300,7 +300,7 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo)
         {
             vesa_width = strtoui(c + strlen("gfx-"), "x", &c);
 
-            if ( vesa_width > U16_MAX )
+            if ( vesa_width > UINT16_MAX )
                 return;
 
             /*
@@ -311,12 +311,12 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo)
             ++c;
             vesa_height = strtoui(c, "x", &c);
 
-            if ( vesa_height > U16_MAX )
+            if ( vesa_height > UINT16_MAX )
                 return;
 
             vesa_depth = strtoui(++c, delim_chars_comma, NULL);
 
-            if ( vesa_depth > U16_MAX )
+            if ( vesa_depth > UINT16_MAX )
                 return;
 
             ebo->vesa_width = vesa_width;
@@ -328,7 +328,7 @@ static void vga_parse(const char *cmdline, early_boot_opts_t *ebo)
         {
             tmp = strtoui(c + strlen("mode-"), delim_chars_comma, NULL);
 
-            if ( tmp > U16_MAX )
+            if ( tmp > UINT16_MAX )
                 return;
 
             ebo->boot_vid_mode = tmp;
diff --git a/xen/arch/x86/boot/defs.h b/xen/arch/x86/boot/defs.h
index 239b9f8716..ee1a4da6af 100644
--- a/xen/arch/x86/boot/defs.h
+++ b/xen/arch/x86/boot/defs.h
@@ -57,7 +57,7 @@ typedef u16 uint16_t;
 typedef u32 uint32_t;
 typedef u64 uint64_t;
 
-#define U16_MAX		((u16)(~0U))
+#define UINT16_MAX	((uint16_t)(~0U))
 #define UINT_MAX	(~0U)
 
 #endif /* __BOOT_DEFS_H__ */
diff --git a/xen/arch/x86/boot/reloc.c b/xen/arch/x86/boot/reloc.c
index 4033557481..589e026ff9 100644
--- a/xen/arch/x86/boot/reloc.c
+++ b/xen/arch/x86/boot/reloc.c
@@ -68,24 +68,24 @@ struct vesa_mode_info {
 #endif /* CONFIG_VIDEO */
 
 #define get_mb2_data(tag, type, member)   (((const multiboot2_tag_##type##_t *)(tag))->member)
-#define get_mb2_string(tag, type, member) ((u32)get_mb2_data(tag, type, member))
+#define get_mb2_string(tag, type, member) ((uint32_t)get_mb2_data(tag, type, member))
 
-static u32 alloc;
+static uint32_t alloc;
 
-static u32 alloc_mem(u32 bytes)
+static uint32_t alloc_mem(uint32_t bytes)
 {
     return alloc -= ALIGN_UP(bytes, 16);
 }
 
-static void zero_mem(u32 s, u32 bytes)
+static void zero_mem(uint32_t s, uint32_t bytes)
 {
     while ( bytes-- )
         *(char *)s++ = 0;
 }
 
-static u32 copy_mem(u32 src, u32 bytes)
+static uint32_t copy_mem(uint32_t src, uint32_t bytes)
 {
-    u32 dst, dst_ret;
+    uint32_t dst, dst_ret;
 
     dst = alloc_mem(bytes);
     dst_ret = dst;
@@ -96,9 +96,9 @@ static u32 copy_mem(u32 src, u32 bytes)
     return dst_ret;
 }
 
-static u32 copy_string(u32 src)
+static uint32_t copy_string(uint32_t src)
 {
-    u32 p;
+    uint32_t p;
 
     if ( !src )
         return 0;
@@ -109,7 +109,7 @@ static u32 copy_string(u32 src)
     return copy_mem(src, p - src + 1);
 }
 
-static struct hvm_start_info *pvh_info_reloc(u32 in)
+static struct hvm_start_info *pvh_info_reloc(uint32_t in)
 {
     struct hvm_start_info *out;
 
@@ -139,7 +139,7 @@ static struct hvm_start_info *pvh_info_reloc(u32 in)
     return out;
 }
 
-static multiboot_info_t *mbi_reloc(u32 mbi_in)
+static multiboot_info_t *mbi_reloc(uint32_t mbi_in)
 {
     int i;
     multiboot_info_t *mbi_out;
@@ -192,7 +192,7 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
 #ifdef CONFIG_VIDEO
     struct boot_video_info *video = NULL;
 #endif
-    u32 ptr;
+    uint32_t ptr;
     unsigned int i, mod_idx = 0;
 
     ptr = alloc_mem(sizeof(*mbi_out));
@@ -203,8 +203,8 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
     ptr = ALIGN_UP(mbi_in + sizeof(*mbi_fix), MULTIBOOT2_TAG_ALIGN);
 
     /* Get the number of modules. */
-    for ( tag = _p(ptr); (u32)tag - mbi_in < mbi_fix->total_size;
-          tag = _p(ALIGN_UP((u32)tag + tag->size, MULTIBOOT2_TAG_ALIGN)) )
+    for ( tag = _p(ptr); (uint32_t)tag - mbi_in < mbi_fix->total_size;
+          tag = _p(ALIGN_UP((uint32_t)tag + tag->size, MULTIBOOT2_TAG_ALIGN)) )
     {
         if ( tag->type == MULTIBOOT2_TAG_TYPE_MODULE )
             ++mbi_out->mods_count;
@@ -228,8 +228,8 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
     ptr = ALIGN_UP(mbi_in + sizeof(*mbi_fix), MULTIBOOT2_TAG_ALIGN);
 
     /* Put all needed data into mbi_out. */
-    for ( tag = _p(ptr); (u32)tag - mbi_in < mbi_fix->total_size;
-          tag = _p(ALIGN_UP((u32)tag + tag->size, MULTIBOOT2_TAG_ALIGN)) )
+    for ( tag = _p(ptr); (uint32_t)tag - mbi_in < mbi_fix->total_size;
+          tag = _p(ALIGN_UP((uint32_t)tag + tag->size, MULTIBOOT2_TAG_ALIGN)) )
     {
         switch ( tag->type )
         {
@@ -272,10 +272,10 @@ static multiboot_info_t *mbi2_reloc(uint32_t mbi_in, uint32_t video_out)
                 mmap_dst[i].size = sizeof(*mmap_dst);
                 mmap_dst[i].size -= sizeof(mmap_dst[i].size);
                 /* Now copy a given region data. */
-                mmap_dst[i].base_addr_low = (u32)mmap_src->addr;
-                mmap_dst[i].base_addr_high = (u32)(mmap_src->addr >> 32);
-                mmap_dst[i].length_low = (u32)mmap_src->len;
-                mmap_dst[i].length_high = (u32)(mmap_src->len >> 32);
+                mmap_dst[i].base_addr_low = (uint32_t)mmap_src->addr;
+                mmap_dst[i].base_addr_high = (uint32_t)(mmap_src->addr >> 32);
+                mmap_dst[i].length_low = (uint32_t)mmap_src->len;
+                mmap_dst[i].length_high = (uint32_t)(mmap_src->len >> 32);
                 mmap_dst[i].type = mmap_src->type;
                 mmap_src = _p(mmap_src) + get_mb2_data(tag, mmap, entry_size);
             }
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 11:58:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 11:58:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785708.1195182 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdn2-0007Ds-SZ; Thu, 29 Aug 2024 11:58:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785708.1195182; Thu, 29 Aug 2024 11:58:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdn2-0007Dl-OI; Thu, 29 Aug 2024 11:58:12 +0000
Received: by outflank-mailman (input) for mailman id 785708;
 Thu, 29 Aug 2024 11:58:11 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjdn1-0007Df-6J
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 11:58:11 +0000
Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com
 [2a00:1450:4864:20::634])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f4ef90e1-65fd-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 13:58:08 +0200 (CEST)
Received: by mail-ej1-x634.google.com with SMTP id
 a640c23a62f3a-a86883231b4so56009366b.3
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 04:58:08 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226c7c1f7sm630681a12.42.2024.08.29.04.58.07
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 04:58:07 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f4ef90e1-65fd-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724932688; x=1725537488; darn=lists.xenproject.org;
        h=content-transfer-encoding:autocrypt:cc:content-language:to:subject
         :from:user-agent:mime-version:date:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=U73BlY8BZ1Tl7XPL6jzB21vtHemVJgsSYu0GdyUNSiw=;
        b=KCkgE2WBXkISxWStzQ6fh9n7sUjjH59uWc8Swbuu2JJ32z2NUjcE8kz+uad/6Z9JWI
         60f7azKCzSEXNhNcxar4nu8lEzGjnkxLB3mvFqukYjhzKSFkbAG/SP78bXOCrF9SVS6Q
         0LAvJVrjdacfbDlcjdZY+pJfIaDocb+vkc8K6khGUZdch1+hTJbgcWv9wB8qo4wiADFk
         m8uNW9g+Pvu9WTM2E9RWTXBNx2x/KaIp4/6TWMrcZuvPhDYLgvVLDCDwvTwoCzWf6RZa
         gnvmbcWSUb8eVx5d7SkpaDEWbrKff8OsarADTiJtWH7uBkeJ9QurdPXQeFSSofq4Kj+y
         fLbw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724932688; x=1725537488;
        h=content-transfer-encoding:autocrypt:cc:content-language:to:subject
         :from:user-agent:mime-version:date:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=U73BlY8BZ1Tl7XPL6jzB21vtHemVJgsSYu0GdyUNSiw=;
        b=hkPnF+MXmf2Q/E/EYi+/0C2fONpKut5hUsc03WHy5zgGu0ZHKsX4jn6KwAdDivWtbT
         Wu863tpKqDI0Rn7yCzCLyjzIeGFUk/46UlfG7AzI7M0X1Yw7CSnKcXXSVS3lV7ZC3HBD
         Dcl91c77Ta8mWbBO5fUerT0kux81tVRKYmXYGnd1wtOsajs8nmMy/unBEtg3x5rb/SNn
         U/HZGYx5NuYru+ZEjzAQ5Y253z2qQpIqmOe0j+bjZ7VQyf/DhMZiC4GDaMZ/6P4cMHIC
         E6SDe2GBLu61yGhgU5QJRsFClhPIUNlmGUSpDkNUQ5q6owArtp7eM0rcYqjBKr61BztZ
         3P5A==
X-Gm-Message-State: AOJu0Yw0FHspaQzX11TpQMM3GJjfjcscmHv/nylLRl6Ts/ViEfBU4cjG
	I7tWvK1q6cW66vUBp+hm8yOblGSr8X/W+wZ9F/4bixup33IaXr5slLLdilfmSXglj54CNI2hRyc
	=
X-Google-Smtp-Source: AGHT+IHZMyYeEhxFLZ3xo9k/SsaTxSVKBJ6SemnMYWkpfh0Q2nv0IYEDbJjz77JjrPQxOKhj3v6pYA==
X-Received: by 2002:a17:907:6d1a:b0:a86:821e:8a28 with SMTP id a640c23a62f3a-a897fa6d0admr197926066b.54.1724932687781;
        Thu, 29 Aug 2024 04:58:07 -0700 (PDT)
Message-ID: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
Date: Thu, 29 Aug 2024 13:58:06 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jan Beulich <jbeulich@suse.com>
Subject: [PATCH 0/5] types: (mostly) purge Linux-inherited s{8,16,32,64}
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Content-Language: en-US
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.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
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Replace uses except where linux-compat.h, where they're moved to, is
sensible to #include.

1: x86: drop s<N>/u<N> overrides from mkelf32
2: types: replace remaining uses of s8
3: types: replace remaining uses of s16
4: types: replace remaining uses of s32
5: types: replace remaining uses of s64

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 11:58:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 11:58:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785711.1195192 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdnb-0007fZ-2z; Thu, 29 Aug 2024 11:58:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785711.1195192; Thu, 29 Aug 2024 11:58:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdnb-0007fS-0F; Thu, 29 Aug 2024 11:58:47 +0000
Received: by outflank-mailman (input) for mailman id 785711;
 Thu, 29 Aug 2024 11:58:45 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjdnZ-0007Df-45
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 11:58:45 +0000
Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com
 [2a00:1450:4864:20::530])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 09d2b8e8-65fe-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 13:58:43 +0200 (CEST)
Received: by mail-ed1-x530.google.com with SMTP id
 4fb4d7f45d1cf-5c218866849so615328a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 04:58:43 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8988feb25asm70548366b.41.2024.08.29.04.58.42
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 04:58:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 09d2b8e8-65fe-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724932723; x=1725537523; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=Jj1rljSuKRUjwrs1h28RS9OID/yR/9HEGB54IEgRD3U=;
        b=QohyuEnsdR2zXM0eVawHZE4t4bXxT9+4qEL6LTg7VlAkpu6mZ6dFWHqqy8Od7jM/3W
         6zz/rT+/2FTliZnbpnuIsqNHHy6DhZ9oXJWCQdQ4lHgGxEWn2F9PE6gi1+zYQKRp8G3I
         r9e0XYY9dy7kDbNUQMOktuD2hrQCGvOcAYWljWTM0VSpL8CwmSVFtyR0Vhc1k4CHXzAr
         NPXvs6ySXhd+rGfttbdL3D40bSkRaUAm1CnKlalrSayclN64L4FeWlba1m0gfMJMuoyi
         evZN5cYCEWUqawf/XsKLtFxEh87PlW45z5h47YVzC0FNV7GGw+vrH2Fq0ifN9M6+cIC5
         X9gg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724932723; x=1725537523;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=Jj1rljSuKRUjwrs1h28RS9OID/yR/9HEGB54IEgRD3U=;
        b=wsZIN/15kZ7su+LoVNbFROpD7fVwGkUBMC84TP7KDxTe9OEmsJ8/8N+0LAFxWsbLXy
         0NKF1d00WRyYEeY7Jc9b8W/1CQt6orNBmCwSNFUx53q3v2FTRIQo8WG/f6XvBkU1XFYV
         GjdH2WskzUO86Lxr6JqNGTXLuxeYe0cPcDKsZpgNad6yjHdmBk5dT9itC7gf0Om7F84a
         ONEfLsHyE+veL5YpXm7q15F6Xc9sbUGudaVQgltdDqj5c+PGHPRjTo1ZXinAJfP5J4GD
         +PlDaQ68O/Ucwwzl1N20Xe3rSLqGedUs7JgXAizP/NliFSAwaTv4eQgyschykYyWMouN
         DokQ==
X-Gm-Message-State: AOJu0YySQn6up6lHERyG7p25NfOOiAQNJs9tJYJKyFVrqHUEwZy8s9+1
	7pd3X/ufF1KMMM7hDqoHnl77tfXqaftIzEnUBj6KgnqX4QDCYf4G4NCX7sKE1uSrxzYcSJNpgM4
	=
X-Google-Smtp-Source: AGHT+IFfF3TsFB/px46qApHrHb+1lPV9mj1iQ1UFMtiio3ecKTtqUspu393BT8Klm2Ctq1gR8hNYHw==
X-Received: by 2002:a05:6402:2690:b0:5c0:902c:e191 with SMTP id 4fb4d7f45d1cf-5c21ed45d49mr2462989a12.9.1724932722830;
        Thu, 29 Aug 2024 04:58:42 -0700 (PDT)
Message-ID: <fd27e294-744d-4fe0-ba73-1483dfc27621@suse.com>
Date: Thu, 29 Aug 2024 13:58:41 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 1/5] x86: drop s<N>/u<N> overrides from mkelf32
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Use uint<N>_t instead (s<N> were unused altogether). While adjusting
swap<N>() drop excessive casts and rename the arguments to avoid leading
underscores.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/boot/mkelf32.c
+++ b/xen/arch/x86/boot/mkelf32.c
@@ -17,14 +17,6 @@
 #include <unistd.h>
 #include <inttypes.h>
 
-#define u8  uint8_t
-#define u16 uint16_t
-#define u32 uint32_t
-#define u64 uint64_t
-#define s8  int8_t
-#define s16 int16_t
-#define s32 int32_t
-#define s64 int64_t
 #include "../../../include/xen/elfstructs.h"
 
 #define DYNAMICALLY_FILLED   0
@@ -72,9 +64,9 @@ static Elf32_Phdr note_phdr = {
     4                                        /* p_align */
 };
 
-static u8 out_shstrtab[] = "\0.text\0.shstrtab";
+static uint8_t out_shstrtab[] = "\0.text\0.shstrtab";
 /* If num_phdrs >= 2, we need to tack the .note. */
-static u8 out_shstrtab_extra[] = ".note\0";
+static uint8_t out_shstrtab_extra[] = ".note\0";
 
 static Elf32_Shdr out_shdr[] = {
     { 0 },
@@ -124,9 +116,9 @@ static Elf32_Shdr out_shdr_note = {
 #undef swap32
 #undef swap64
 
-#define swap16(_v) ((((u16)(_v)>>8)&0xff)|(((u16)(_v)&0xff)<<8))
-#define swap32(_v) (((u32)swap16((u16)(_v))<<16)|(u32)swap16((u32)((_v)>>16)))
-#define swap64(_v) (((u64)swap32((u32)(_v))<<32)|(u64)swap32((u32)((_v)>>32)))
+#define swap16(v) (( (uint8_t)(v)       <<  8) | (uint8_t)((v) >>  8))
+#define swap32(v) (((uint32_t)swap16(v) << 16) |    swap16((v) >> 16))
+#define swap64(v) (((uint64_t)swap32(v) << 32) |    swap32((v) >> 32))
 
 static int big_endian;
 
@@ -256,8 +248,8 @@ static void do_read(int fd, void *data,
 
 int main(int argc, char **argv)
 {
-    u64        final_exec_addr;
-    u32        loadbase, dat_siz, mem_siz, note_base, note_sz, offset;
+    uint64_t   final_exec_addr;
+    uint32_t   loadbase, dat_siz, mem_siz, note_base, note_sz, offset;
     char      *inimage, *outimage;
     int        infd, outfd;
     char       buffer[1024] = {};
@@ -302,7 +294,7 @@ int main(int argc, char **argv)
         return 1;
     }
 
-    big_endian = (*(u16 *)in32_ehdr.e_ident == ((ELFMAG0 << 8) | ELFMAG1));
+    big_endian = (*(uint16_t *)in32_ehdr.e_ident == ((ELFMAG0 << 8) | ELFMAG1));
 
     endianadjust_ehdr32(&in32_ehdr);
     if ( in32_ehdr.e_ident[EI_CLASS] != ELFCLASS64 )
@@ -345,11 +337,11 @@ int main(int argc, char **argv)
     endianadjust_phdr64(&in64_phdr);
 
     (void)lseek(infd, in64_phdr.p_offset, SEEK_SET);
-    dat_siz = (u32)in64_phdr.p_filesz;
+    dat_siz = (uint32_t)in64_phdr.p_filesz;
 
     /* Do not use p_memsz: it does not include BSS alignment padding. */
-    /*mem_siz = (u32)in64_phdr.p_memsz;*/
-    mem_siz = (u32)(final_exec_addr - in64_phdr.p_vaddr);
+    /*mem_siz = (uint32_t)in64_phdr.p_memsz;*/
+    mem_siz = (uint32_t)(final_exec_addr - in64_phdr.p_vaddr);
 
     note_sz = note_base = offset = 0;
     if ( num_phdrs > 1 )



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 11:59:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 11:59:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785719.1195201 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdoe-0008Jd-Fc; Thu, 29 Aug 2024 11:59:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785719.1195201; Thu, 29 Aug 2024 11:59:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdoe-0008JW-Cy; Thu, 29 Aug 2024 11:59:52 +0000
Received: by outflank-mailman (input) for mailman id 785719;
 Thu, 29 Aug 2024 11:59:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjdod-0008JK-6S
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 11:59:51 +0000
Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com
 [2a00:1450:4864:20::135])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 31774404-65fe-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 13:59:49 +0200 (CEST)
Received: by mail-lf1-x135.google.com with SMTP id
 2adb3069b0e04-5353d0b7463so997554e87.3
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 04:59:49 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8989221c63sm70089266b.201.2024.08.29.04.59.48
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 04:59:48 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 31774404-65fe-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724932789; x=1725537589; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=ZT3iXwalvN1B13aqyfNpuDLOaefZIro3XvoMHaM/jD4=;
        b=SQAdxl/RCkLIGMIQ4QebDp6wAOv6gOI91nqQMf7t22NQV0TA4Wy8akjQGLGAsc9w8A
         Tef1Bh6MJvP0ZnLNepEy8CRBLmXHf/b4yVt7NR8SOruENfCtn9PUDyM+2DP4VIN4EJcL
         8Kc7c5PVq+/8UAeIgOCxedVsmfXC8caO/ySxvNyZMu3YcL988Fa29ml0yaCIZZ5yNDKs
         cNT+rIsm7kP8OedisjSbVLmoBl0AqqZ+yFcash77L1mw9kXGnRk6CgyKKxKS+8irsgKw
         G+MV6o2kLv605X/Er1DgrLYtl7OTUprStWZGxWcDe5SxlV3EbaRYbXn85WE90Z5AVR5n
         o0DA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724932789; x=1725537589;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=ZT3iXwalvN1B13aqyfNpuDLOaefZIro3XvoMHaM/jD4=;
        b=vcLWJ/vPL38oE4S4Akt6zzaH+PlBGmnUW7R0YCg7JOnfJQ6wrQWA6vH7i1jqblevK6
         /3eobKd61t26J62U9/D6jvBZBd8KkFxBUG9+gd4vvU5Yr8347LGusjR17ZKUGDvmS3Xd
         G07PAHsqeBB0cRWN+CPQM8ewqxk3i/b+ix3UIzcfxYViWTuI4BW8usmpKBB8sD/vdCIU
         30zRREq1096gF+vczYjnFqTfTV7EUvwJ5ahiImqZTOHVqC50vs5wNMR9P9m5QLt0+2xh
         8WjOfegbWx+Av3a7ES2u3l5Vok7I6vL9K8+Is9nDA7YmfK1iYZTN76kn73xN6sp+9FjH
         0U6g==
X-Gm-Message-State: AOJu0YyMCGrHdejtwcImui3fctQZ6jmiwnN4/mos900YP8oQEayaUyTM
	/7nV5Bxjk/Aw0vMtJqqxFV/pDdUMcQNUzTOTGMgrtflGxuiNoXiQh28DZ2nVqjWcwYdUtKHbfjM
	=
X-Google-Smtp-Source: AGHT+IHgX0dvvVFrjpUd7E1sffm4j1ybtRegBWCZC5TURTgk/AiHefRTANRfHIfHoUGNcJGcy2Wsnw==
X-Received: by 2002:ac2:4c49:0:b0:533:4785:82ab with SMTP id 2adb3069b0e04-5353e543424mr2311093e87.1.1724932789103;
        Thu, 29 Aug 2024 04:59:49 -0700 (PDT)
Message-ID: <e6341c57-cf0d-46c5-8582-a84af515a650@suse.com>
Date: Thu, 29 Aug 2024 13:59:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 2/5] types: replace remaining uses of s8
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

... and move the type itself to linux-compat.h.

While doing so,
- convert __read_mostly to __ro_after_init for respective variables
  having their type changed (for acpi_numa add the attribute anew),
- in cpuid_hypervisor_leaves() drop a cast altogether,
- switch an adjacent struct arch_irq_desc field to bool.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -71,7 +71,7 @@ static struct {
 /*
  * Knob to control our willingness to enable the local APIC.
  */
-static s8 __initdata enable_local_apic; /* -1=force-disable, +1=force-enable */
+static int8_t __initdata enable_local_apic; /* -1=force-disable, +1=force-enable */
 
 /*
  * Debug level
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -46,7 +46,7 @@ static unsigned int __initdata opt_cpuid
 integer_param("cpuid_mask_thermal_ecx", opt_cpuid_mask_thermal_ecx);
 
 /* 1 = allow, 0 = don't allow guest creation, -1 = don't allow boot */
-s8 __read_mostly opt_allow_unsafe;
+int8_t __ro_after_init opt_allow_unsafe;
 boolean_param("allow_unsafe", opt_allow_unsafe);
 
 /* Signal whether the ACPI C1E quirk is required. */
--- a/xen/arch/x86/e820.c
+++ b/xen/arch/x86/e820.c
@@ -27,7 +27,7 @@ static unsigned long long __initdata opt
 size_param("availmem", opt_availmem);
 
 /* opt_nomtrr_check: Don't clip ram to highest cacheable MTRR. */
-static s8 __initdata e820_mtrr_clip = -1;
+static int8_t __initdata e820_mtrr_clip = -1;
 boolean_param("e820-mtrr-clip", e820_mtrr_clip);
 
 /* opt_e820_verbose: Be verbose about clipping, the original e820, &c */
--- a/xen/arch/x86/hvm/quirks.c
+++ b/xen/arch/x86/hvm/quirks.c
@@ -11,7 +11,7 @@
 #include <xen/param.h>
 #include <asm/hvm/support.h>
 
-s8 __read_mostly hvm_port80_allowed = -1;
+int8_t __ro_after_init hvm_port80_allowed = -1;
 boolean_param("hvm_port80", hvm_port80_allowed);
 
 static int __init cf_check dmi_hvm_deny_port80(const struct dmi_system_id *id)
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -59,7 +59,7 @@ static unsigned int __ro_after_init vm_n
 integer_param("vm-notify-window", vm_notify_window);
 
 static bool __read_mostly opt_ept_pml = true;
-static s8 __read_mostly opt_ept_ad = -1;
+static int8_t __ro_after_init opt_ept_ad = -1;
 int8_t __read_mostly opt_ept_exec_sp = -1;
 
 static int __init cf_check parse_ept_param(const char *s)
--- a/xen/arch/x86/include/asm/acpi.h
+++ b/xen/arch/x86/include/asm/acpi.h
@@ -100,7 +100,7 @@ extern unsigned long acpi_wakeup_address
 
 #define ARCH_HAS_POWER_INIT	1
 
-extern s8 acpi_numa;
+extern int8_t acpi_numa;
 
 extern struct acpi_sleep_info acpi_sinfo;
 #define acpi_video_flags bootsym(video_flags)
--- a/xen/arch/x86/include/asm/amd.h
+++ b/xen/arch/x86/include/asm/amd.h
@@ -160,7 +160,7 @@
 struct cpuinfo_x86;
 int cpu_has_amd_erratum(const struct cpuinfo_x86 *cpu, int osvw_id, ...);
 
-extern s8 opt_allow_unsafe;
+extern int8_t opt_allow_unsafe;
 
 void fam10h_check_enable_mmcfg(void);
 void check_enable_amd_mmconf_dmi(void);
--- a/xen/arch/x86/include/asm/hvm/hvm.h
+++ b/xen/arch/x86/include/asm/hvm/hvm.h
@@ -241,7 +241,7 @@ struct hvm_function_table {
 
 extern struct hvm_function_table hvm_funcs;
 extern bool hvm_enabled;
-extern s8 hvm_port80_allowed;
+extern int8_t hvm_port80_allowed;
 
 extern const struct hvm_function_table *start_svm(void);
 extern const struct hvm_function_table *start_vmx(void);
--- a/xen/arch/x86/include/asm/irq.h
+++ b/xen/arch/x86/include/asm/irq.h
@@ -80,8 +80,8 @@ struct arch_irq_desc {
         cpumask_var_t pending_mask;
         vmask_t *used_vectors;
         unsigned move_cleanup_count;
-        u8 move_in_progress : 1;
-        s8 used;
+        bool move_in_progress : 1;
+        int8_t used;
         /*
          * Weak reference to domain having permission over this IRQ (which can
          * be different from the domain actually having the IRQ assigned)
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -170,7 +170,7 @@ static uint32_t __ro_after_init base_dis
       is_pv_domain(d)) ?                                        \
      L1_DISALLOW_MASK : (L1_DISALLOW_MASK & ~PAGE_CACHE_ATTRS))
 
-static s8 __read_mostly opt_mmio_relax;
+static int8_t __ro_after_init opt_mmio_relax;
 
 static int __init cf_check parse_mmio_relax(const char *s)
 {
--- a/xen/arch/x86/msi.c
+++ b/xen/arch/x86/msi.c
@@ -35,7 +35,7 @@
 #include <xsm/xsm.h>
 #include <xen/vpci.h>
 
-static s8 __read_mostly use_msi = -1;
+static int8_t __ro_after_init use_msi = -1;
 boolean_param("msi", use_msi);
 
 static void __pci_disable_msix(struct msi_desc *entry);
--- a/xen/arch/x86/numa.c
+++ b/xen/arch/x86/numa.c
@@ -25,7 +25,7 @@ nodeid_t apicid_to_node[MAX_LOCAL_APIC]
     [0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE
 };
 
-s8 acpi_numa = 0;
+int8_t __ro_after_init acpi_numa = 0;
 
 int __init arch_numa_setup(const char *opt)
 {
--- a/xen/arch/x86/oprofile/op_model_athlon.c
+++ b/xen/arch/x86/oprofile/op_model_athlon.c
@@ -157,7 +157,7 @@ static inline u64 op_amd_randomize_ibs_o
          * IbsOpMaxCnt must fit in the range from 0x0081 to
          * 0xff80.
          */
-        val += (s8)(random >> 4);
+        val += (int8_t)(random >> 4);
     else
         val |= (u64)(random & IBS_RANDOM_MASK) << 32;
 
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -166,7 +166,7 @@ unsigned long __read_mostly mmu_cr4_feat
 
 /* smep: Enable/disable Supervisor Mode Execution Protection */
 #define SMEP_HVM_ONLY (-2)
-static s8 __initdata opt_smep = -1;
+static int8_t __initdata opt_smep = -1;
 
 /*
  * Initial domain place holder. Needs to be global so it can be created in
@@ -203,7 +203,7 @@ custom_param("smep", parse_smep_param);
 
 /* smap: Enable/disable Supervisor Mode Access Prevention */
 #define SMAP_HVM_ONLY (-2)
-static s8 __initdata opt_smap = -1;
+static int8_t __initdata opt_smap = -1;
 
 static int __init cf_check parse_smap_param(const char *s)
 {
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1116,7 +1116,7 @@ void cpuid_hypervisor_leaves(const struc
             res->a = offset;
             res->b = offset >> 32;
             res->c = d->arch.vtsc_to_ns.mul_frac;
-            res->d = (s8)d->arch.vtsc_to_ns.shift;
+            res->d = d->arch.vtsc_to_ns.shift;
             break;
         }
 
--- a/xen/include/acpi/cpufreq/cpufreq.h
+++ b/xen/include/acpi/cpufreq/cpufreq.h
@@ -79,7 +79,7 @@ struct cpufreq_policy {
 
     bool                resume; /* flag for cpufreq 1st run
                                  * S3 wakeup, hotplug cpu, etc */
-    s8                  turbo;  /* tristate flag: 0 for unsupported
+    int8_t              turbo;  /* tristate flag: 0 for unsupported
                                  * -1 for disable, 1 for enabled
                                  * See CPUFREQ_TURBO_* below for defines */
 };
--- a/xen/include/xen/linux-compat.h
+++ b/xen/include/xen/linux-compat.h
@@ -11,7 +11,7 @@
 
 #include <xen/types.h>
 
-typedef int8_t  __s8;
+typedef int8_t  s8, __s8;
 typedef uint8_t __u8;
 typedef int16_t __s16;
 typedef int32_t __s32;
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -5,7 +5,6 @@
 #include <xen/stdint.h>
 
 /* Linux inherited types which are being phased out */
-typedef int8_t s8;
 typedef uint8_t u8;
 typedef int16_t s16;
 typedef uint16_t u16, __u16;



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 12:00:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 12:00:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785725.1195212 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdpA-0001Jv-SQ; Thu, 29 Aug 2024 12:00:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785725.1195212; Thu, 29 Aug 2024 12:00:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdpA-0001Jo-PZ; Thu, 29 Aug 2024 12:00:24 +0000
Received: by outflank-mailman (input) for mailman id 785725;
 Thu, 29 Aug 2024 12:00:23 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjdp9-0008JK-Qg
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 12:00:23 +0000
Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com
 [2a00:1450:4864:20::52c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 455805a8-65fe-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 14:00:23 +0200 (CEST)
Received: by mail-ed1-x52c.google.com with SMTP id
 4fb4d7f45d1cf-5bed0a2ae0fso533878a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 05:00:23 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8989196975sm70956866b.135.2024.08.29.05.00.21
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 05:00:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 455805a8-65fe-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724932823; x=1725537623; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=DYYTaskfgTvZ4g7no0G93dtPg+JMiV4HrqW3HUo5R4s=;
        b=d1DkFcV9b9YyqNhCdkOBN52MNpS8JLObuGqmoTJrOBsOxM0z1GMaaaCEVfD0+jiZhk
         a+Ax2W1HP8iTfYTpxeoiQ+8oo2DEawCsAYzwE0izonJ8QbdFGi39DWdy96tjH6MMiXZY
         B1mfvoQsDt9Q9IHsQ1y0bGJG9eC9U0tBaYNvOaVH/xMvMcZfcOqJtyF7045glHdw6cxY
         anPrKnFp5eAnzlDC9O3MhjYnIoO18zNLZfTNIPm7D2Pys8J4E8Nxl2DZMyFV3s2ixGig
         LCVraR/b4clhZIaaksionF8L2op4AybCKPFFWD2cqKQ7IlCXjOrXL1hyH7lJMDymrWnS
         1LZg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724932823; x=1725537623;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=DYYTaskfgTvZ4g7no0G93dtPg+JMiV4HrqW3HUo5R4s=;
        b=DpAoTO09JEaXrhCMNP9hLeu17yzKDTpoIaajuNndO1zi2TvL9dm89D1mzVvCoXSzDT
         yIykyRlgjTun7zIVYLGPE9EZaY+1NtSeVyn+sCYEt59XofsdZyUBw6sUqDuQQeJihnL2
         ofhdkJxf3nElh5tukbp6xvv5cyZc2Q71GtLgWMOu+m2AtoFpIm2tFNjILsbkwvb9okUs
         mjAcQrrOxzwPnDChEKx9MuQnlSeb2kS0JDizvnACX6ctq5UUR4olPjRzpbl20RvqNRwJ
         7PfpwWVEDJQwc/IHF5Bz8zdCBX54Rnr8GQCnxOE6/XXV2p6bm3mz4NKkIZnJWNhXbENT
         KwQg==
X-Gm-Message-State: AOJu0YxqtWEVzndiuX5ZXrm8ohlMWJMJ/Hu6wUdtnK+JjtlyppyqBVzx
	cchCx9L4wrZ1fvCSz+0D5Hkhlthf8YQNOS7VAiCytRRQG1AZ9MSfPD+L7eK2FqeH29UmIxKN4mU
	=
X-Google-Smtp-Source: AGHT+IE8ZUfXZU3uzZZtba31YP3xh8mJLc4nhklYgKzdkfAwkLo8V7Y/UxggnnumlinqBwN2YvoPvg==
X-Received: by 2002:a05:6402:90d:b0:5c0:a8c0:3726 with SMTP id 4fb4d7f45d1cf-5c21ed54acamr1783229a12.19.1724932822369;
        Thu, 29 Aug 2024 05:00:22 -0700 (PDT)
Message-ID: <a3c8c66a-3b90-49e3-bf49-b73fa05a1f64@suse.com>
Date: Thu, 29 Aug 2024 14:00:20 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 3/5] types: replace remaining uses of s16
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>
References: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

... and move the type itself to linux-compat.h.

While doing so switch an adjacent x86 struct page_info field to bool.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/arm/arm32/livepatch.c
+++ b/xen/arch/arm/arm32/livepatch.c
@@ -135,7 +135,7 @@ static s32 get_addend(unsigned char type
         addend =  (*(u32 *)dest & 0x00000FFF);
         addend |= (*(u32 *)dest & 0x000F0000) >> 4;
         /* Addend is to sign-extend ([19:16],[11:0]). */
-        addend = (s16)addend;
+        addend = (int16_t)addend;
         break;
 
     case R_ARM_CALL:
--- a/xen/arch/arm/arm64/livepatch.c
+++ b/xen/arch/arm/arm64/livepatch.c
@@ -124,7 +124,7 @@ static int reloc_data(enum aarch64_reloc
     switch ( len )
     {
     case 16:
-        *(s16 *)place = sval;
+        *(int16_t *)place = sval;
         if ( sval < INT16_MIN || sval > UINT16_MAX )
 	        return -EOVERFLOW;
         break;
--- a/xen/arch/x86/include/asm/irq.h
+++ b/xen/arch/x86/include/asm/irq.h
@@ -67,8 +67,8 @@ struct irq_desc;
  * the old destinations.
  */
 struct arch_irq_desc {
-        s16 vector;                  /* vector itself is only 8 bits, */
-        s16 old_vector;              /* but we use -1 for unassigned  */
+        int16_t vector;                  /* vector itself is only 8 bits, */
+        int16_t old_vector;              /* but we use -1 for unassigned  */
         /*
          * Except for high priority interrupts @cpu_mask may have bits set for
          * offline CPUs.  Consumers need to be careful to mask this down to
--- a/xen/arch/x86/include/asm/mm.h
+++ b/xen/arch/x86/include/asm/mm.h
@@ -286,8 +286,8 @@ struct page_info
         struct {
             u16 nr_validated_ptes:PAGETABLE_ORDER + 1;
             u16 :16 - PAGETABLE_ORDER - 1 - 1;
-            u16 partial_flags:1;
-            s16 linear_pt_count;
+            bool partial_flags:1;
+            int16_t linear_pt_count;
         };
 
         /*
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -1390,7 +1390,7 @@ unmap_common(
     struct grant_table *lgt, *rgt;
     grant_ref_t ref;
     struct active_grant_entry *act;
-    s16              rc = 0;
+    int16_t          rc;
     struct grant_mapping *map;
     unsigned int flags;
     bool put_handle = false;
@@ -2580,7 +2580,7 @@ acquire_grant_for_copy(
     uint16_t trans_page_off;
     uint16_t trans_length;
     bool is_sub_page;
-    s16 rc = GNTST_okay;
+    int16_t rc = GNTST_okay;
     unsigned int pin_incr = readonly ? GNTPIN_hstr_inc : GNTPIN_hstw_inc;
 
     *page = NULL;
@@ -3416,14 +3416,14 @@ gnttab_get_version(XEN_GUEST_HANDLE_PARA
     return 0;
 }
 
-static s16
+static int16_t
 swap_grant_ref(grant_ref_t ref_a, grant_ref_t ref_b)
 {
     struct domain *d = rcu_lock_current_domain();
     struct grant_table *gt = d->grant_table;
     struct active_grant_entry *act_a = NULL;
     struct active_grant_entry *act_b = NULL;
-    s16 rc = GNTST_okay;
+    int16_t rc = GNTST_okay;
 
     grant_write_lock(gt);
 
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -43,6 +43,7 @@
 #include <xen/err.h>
 #include <xen/irq.h>
 #include <xen/lib.h>
+#include <xen/linux-compat.h>
 #include <xen/list.h>
 #include <xen/mm.h>
 #include <xen/vmap.h>
--- a/xen/include/xen/linux-compat.h
+++ b/xen/include/xen/linux-compat.h
@@ -13,7 +13,7 @@
 
 typedef int8_t  s8, __s8;
 typedef uint8_t __u8;
-typedef int16_t __s16;
+typedef int16_t s16, __s16;
 typedef int32_t __s32;
 typedef int64_t __s64;
 
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -6,7 +6,6 @@
 
 /* Linux inherited types which are being phased out */
 typedef uint8_t u8;
-typedef int16_t s16;
 typedef uint16_t u16, __u16;
 typedef int32_t s32;
 typedef uint32_t u32, __u32;



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 12:01:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 12:01:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785736.1195221 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdqI-0001w2-51; Thu, 29 Aug 2024 12:01:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785736.1195221; Thu, 29 Aug 2024 12:01:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdqI-0001vv-1o; Thu, 29 Aug 2024 12:01:34 +0000
Received: by outflank-mailman (input) for mailman id 785736;
 Thu, 29 Aug 2024 12:01:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjdqG-0001r9-Gi
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 12:01:32 +0000
Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com
 [2a00:1450:4864:20::42b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6e257fa5-65fe-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 14:01:31 +0200 (CEST)
Received: by mail-wr1-x42b.google.com with SMTP id
 ffacd0b85a97d-371c5187198so369644f8f.3
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 05:01:31 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8989195e6bsm70881066b.99.2024.08.29.05.01.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 05:01:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6e257fa5-65fe-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724932891; x=1725537691; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=+4LOghClr9pcCZnA2NN/G4bl/sIzTUpbHkgkt6Fava0=;
        b=TGsctMu5re9Oqv+b0mHjU2t8aQs4RGergG8iZqrDRKD/HRd9oJkAWZW9A9OcY+em3n
         oT2WpBSpUPgTiiQm55BZjD53HghpwT3RFfvyXAn3fGnW2UCBUqzt05DYeuXA16BIssZ9
         jdznbF7VOR5EFExdURYJ0UARRWGrAml99BTTlI69UMe5eXpKNwV6AAkYd+2mZ4hEn5E/
         EtSfZzyrjYH7ui3G9NO3rM5xCWwQT/d6qBJmspArQW4EBx3fQANzdPQYUcCdeErpTSEp
         rcQfxtjmM9STrNENbrxc7pVQeKy0BhnEmj6TqTMaFPHqmTLi3/i0ZBPOjmiQfEMGMDXB
         Uw3Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724932891; x=1725537691;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=+4LOghClr9pcCZnA2NN/G4bl/sIzTUpbHkgkt6Fava0=;
        b=hWL8ira12u44jwe03HTvVXX/chl2EmMAGeTN36dWGE9TtSpJAWnNtV3CXKnlF0/uNz
         SEb9PeCDpNVQCGBmkLWFZuG0BPV+0egMshYjnzj2Z/SV1J8+xdS3MM6A877fYMJnJpHf
         gXhrMBGN2Oe8efeV4YVLQaxWbee2YeLl+C7NTN8i9eFt1+8z9IvtnPxRj0IxqhpXxcq1
         aHmwQFjHU22MH6/5hdwfJcr4kmn4fk/eWxjCbpZx75fysAn2SOq14r61KnQab8R1lucr
         xFFDeG7vRa8garRWZmNvfagKXfeA2jSD/WddeuqMxJjVePX6WIqSr+0w2GpDWcTPbOCy
         HKGw==
X-Gm-Message-State: AOJu0YzkTYzmNuewN+kzWqXtrTFM8Tydf9BjktudI7TRBXMPaF5dBY/+
	wRxmumjqj3i/tdGXhgZgycu3jBX5Vp9ZN9RwI7jddJHIJEbgkNU/KxLCweB1Dz5K+XscbCDMd3A
	=
X-Google-Smtp-Source: AGHT+IEvLlF8ZJ8CbFSkkYTZDmk95WzWrtVzRn2FHuOXgjbGqIvzpfuo2fXRt2C4mgYMqW1moRw16w==
X-Received: by 2002:a05:6402:2552:b0:5c0:aa04:2342 with SMTP id 4fb4d7f45d1cf-5c21ed56617mr2252531a12.22.1724932878643;
        Thu, 29 Aug 2024 05:01:18 -0700 (PDT)
Message-ID: <0e6b7685-e061-4ace-88fd-86728d765e5a@suse.com>
Date: Thu, 29 Aug 2024 14:01:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 4/5] types: replace remaining uses of s32
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 Daniel Smith <dpsmith@apertussolutions.com>
References: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

... and move the type itself to linux-compat.h.

While doing so switch a few adjacent types as well, for (a little bit
of) consistency.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/arm/alternative.c
+++ b/xen/arch/arm/alternative.c
@@ -63,7 +63,7 @@ static u32 get_alt_insn(const struct alt
 
     if ( insn_is_branch_imm(insn) )
     {
-        s32 offset = insn_get_branch_offset(insn);
+        int32_t offset = insn_get_branch_offset(insn);
         unsigned long target;
 
         target = (unsigned long)altinsnptr + offset;
--- a/xen/arch/arm/arm32/livepatch.c
+++ b/xen/arch/arm/arm32/livepatch.c
@@ -32,7 +32,7 @@ void arch_livepatch_apply(const struct l
 
     if ( func->new_addr )
     {
-        s32 delta;
+        int32_t delta;
 
         /*
          * PC is current address (old_addr) + 8 bytes. The semantics for a
@@ -41,11 +41,11 @@ void arch_livepatch_apply(const struct l
          * ARM DDI 0406C.c, see A2.3 (pg 45) and A8.8.18 pg (pg 334,335)
          *
          */
-        delta = (s32)func->new_addr - (s32)(func->old_addr + 8);
+        delta = (int32_t)func->new_addr - (int32_t)(func->old_addr + 8);
 
         /* The arch_livepatch_symbol_ok should have caught it. */
-        ASSERT(delta >= -(s32)ARCH_LIVEPATCH_RANGE ||
-               delta < (s32)ARCH_LIVEPATCH_RANGE);
+        ASSERT(delta >= -(int32_t)ARCH_LIVEPATCH_RANGE ||
+               delta < (int32_t)ARCH_LIVEPATCH_RANGE);
 
         /* CPU shifts by two (left) when decoding, so we shift right by two. */
         delta = delta >> 2;
@@ -113,9 +113,9 @@ bool arch_livepatch_symbol_deny(const st
     return false;
 }
 
-static s32 get_addend(unsigned char type, void *dest)
+static int32_t get_addend(unsigned char type, void *dest)
 {
-    s32 addend = 0;
+    int32_t addend = 0;
 
     switch ( type ) {
     case R_ARM_NONE:
@@ -149,7 +149,8 @@ static s32 get_addend(unsigned char type
     return addend;
 }
 
-static int perform_rel(unsigned char type, void *dest, uint32_t val, s32 addend)
+static int perform_rel(unsigned char type, void *dest, uint32_t val,
+                       int32_t addend)
 {
 
     switch ( type ) {
@@ -203,8 +204,8 @@ static int perform_rel(unsigned char typ
          * arch_livepatch_verify_distance can't account of addend so we have
          * to do the check here as well.
          */
-        if ( (s32)val < -(s32)ARCH_LIVEPATCH_RANGE ||
-             (s32)val >= (s32)ARCH_LIVEPATCH_RANGE )
+        if ( (int32_t)val < -(int32_t)ARCH_LIVEPATCH_RANGE ||
+             (int32_t)val >= (int32_t)ARCH_LIVEPATCH_RANGE )
             return -EOVERFLOW;
 
         /* CPU always shifts insn by two, so complement it. */
@@ -234,7 +235,7 @@ int arch_livepatch_perform(struct livepa
         uint32_t val;
         void *dest;
         unsigned char type;
-        s32 addend;
+        int32_t addend;
 
         if ( use_rela )
         {
--- a/xen/arch/arm/arm64/insn.c
+++ b/xen/arch/arm/arm64/insn.c
@@ -223,9 +223,9 @@ u32 __kprobes aarch64_insn_gen_nop(void)
  * signed value (so it can be used when computing a new branch
  * target).
  */
-s32 aarch64_get_branch_offset(u32 insn)
+int32_t aarch64_get_branch_offset(uint32_t insn)
 {
-	s32 imm;
+	int32_t imm;
 
 	if (aarch64_insn_is_b(insn) || aarch64_insn_is_bl(insn)) {
 		imm = aarch64_insn_decode_immediate(AARCH64_INSN_IMM_26, insn);
@@ -251,7 +251,7 @@ s32 aarch64_get_branch_offset(u32 insn)
  * Encode the displacement of a branch in the imm field and return the
  * updated instruction.
  */
-u32 aarch64_set_branch_offset(u32 insn, s32 offset)
+uint32_t aarch64_set_branch_offset(uint32_t insn, int32_t offset)
 {
 	if (aarch64_insn_is_b(insn) || aarch64_insn_is_bl(insn))
 		return aarch64_insn_encode_immediate(AARCH64_INSN_IMM_26, insn,
--- a/xen/arch/arm/arm64/livepatch.c
+++ b/xen/arch/arm/arm64/livepatch.c
@@ -130,7 +130,7 @@ static int reloc_data(enum aarch64_reloc
         break;
 
     case 32:
-        *(s32 *)place = sval;
+        *(int32_t *)place = sval;
         if ( sval < INT32_MIN || sval > UINT32_MAX )
 	        return -EOVERFLOW;
         break;
--- a/xen/arch/arm/include/asm/alternative.h
+++ b/xen/arch/arm/include/asm/alternative.h
@@ -12,11 +12,11 @@
 #include <xen/stringify.h>
 
 struct alt_instr {
-	s32 orig_offset;	/* offset to original instruction */
-	s32 repl_offset;	/* offset to replacement instruction */
-	u16 cpufeature;		/* cpufeature bit set for replacement */
-	u8  orig_len;		/* size of original instruction(s) */
-	u8  repl_len;		/* size of new instruction(s), <= orig_len */
+	int32_t  orig_offset;	/* offset to original instruction */
+	int32_t  repl_offset;	/* offset to replacement instruction */
+	uint16_t cpufeature;	/* cpufeature bit set for replacement */
+	uint8_t  orig_len;	/* size of original instruction(s) */
+	uint8_t  repl_len;	/* size of new instruction(s), <= orig_len */
 };
 
 /* Xen: helpers used by common code. */
--- a/xen/arch/arm/include/asm/arm64/insn.h
+++ b/xen/arch/arm/include/asm/arm64/insn.h
@@ -75,8 +75,8 @@ u64 aarch64_insn_decode_immediate(enum a
 u32 aarch64_insn_encode_immediate(enum aarch64_insn_imm_type type,
 				  u32 insn, u64 imm);
 
-s32 aarch64_get_branch_offset(u32 insn);
-u32 aarch64_set_branch_offset(u32 insn, s32 offset);
+int32_t aarch64_get_branch_offset(uint32_t insn);
+uint32_t aarch64_set_branch_offset(uint32_t insn, int32_t offset);
 
 u32 aarch64_insn_gen_branch_imm(unsigned long pc, unsigned long addr,
 				enum aarch64_insn_branch_type type);
@@ -89,12 +89,12 @@ static inline bool insn_is_branch_imm(u3
     return aarch64_insn_is_branch_imm(insn);
 }
 
-static inline s32 insn_get_branch_offset(u32 insn)
+static inline int32_t insn_get_branch_offset(uint32_t insn)
 {
     return aarch64_get_branch_offset(insn);
 }
 
-static inline u32 insn_set_branch_offset(u32 insn, s32 offset)
+static inline uint32_t insn_set_branch_offset(uint32_t insn, int32_t offset)
 {
     return aarch64_set_branch_offset(insn, offset);
 }
--- a/xen/arch/x86/efi/efi-boot.h
+++ b/xen/arch/x86/efi/efi-boot.h
@@ -101,12 +101,12 @@ static void __init efi_arch_relocate_ima
     }
 }
 
-extern const s32 __trampoline_rel_start[], __trampoline_rel_stop[];
-extern const s32 __trampoline_seg_start[], __trampoline_seg_stop[];
+extern const int32_t __trampoline_rel_start[], __trampoline_rel_stop[];
+extern const int32_t __trampoline_seg_start[], __trampoline_seg_stop[];
 
 static void __init relocate_trampoline(unsigned long phys)
 {
-    const s32 *trampoline_ptr;
+    const int32_t *trampoline_ptr;
 
     trampoline_phys = phys;
 
--- a/xen/arch/x86/include/asm/uaccess.h
+++ b/xen/arch/x86/include/asm/uaccess.h
@@ -406,7 +406,7 @@ copy_from_unsafe(void *to, const void __
 
 struct exception_table_entry
 {
-	s32 addr, cont;
+	int32_t addr, cont;
 };
 extern struct exception_table_entry __start___ex_table[];
 extern struct exception_table_entry __stop___ex_table[];
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1859,8 +1859,8 @@ static void cf_check local_time_calibrat
      * This allows us to binary shift a 32-bit tsc_elapsed such that:
      * stime_elapsed < tsc_elapsed <= 2*stime_elapsed
      */
-    while ( ((u32)stime_elapsed64 != stime_elapsed64) ||
-            ((s32)stime_elapsed64 < 0) )
+    while ( ((uint32_t)stime_elapsed64 != stime_elapsed64) ||
+            ((int32_t)stime_elapsed64 < 0) )
     {
         stime_elapsed64 >>= 1;
         tsc_elapsed64   >>= 1;
--- a/xen/common/trace.c
+++ b/xen/common/trace.c
@@ -459,8 +459,8 @@ static inline bool bogus(u32 prod, u32 c
 
 static inline u32 calc_unconsumed_bytes(const struct t_buf *buf)
 {
-    u32 prod = buf->prod, cons = buf->cons;
-    s32 x;
+    uint32_t prod = buf->prod, cons = buf->cons;
+    int32_t x;
 
     barrier(); /* must read buf->prod and buf->cons only once */
     if ( bogus(prod, cons) )
@@ -478,8 +478,8 @@ static inline u32 calc_unconsumed_bytes(
 
 static inline u32 calc_bytes_to_wrap(const struct t_buf *buf)
 {
-    u32 prod = buf->prod, cons = buf->cons;
-    s32 x;
+    uint32_t prod = buf->prod, cons = buf->cons;
+    int32_t x;
 
     barrier(); /* must read buf->prod and buf->cons only once */
     if ( bogus(prod, cons) )
--- a/xen/include/acpi/actypes.h
+++ b/xen/include/acpi/actypes.h
@@ -186,8 +186,8 @@ typedef int INT32;
 
 /*! [End] no source code translation !*/
 
-typedef u32 acpi_native_uint;
-typedef s32 acpi_native_int;
+typedef uint32_t acpi_native_uint;
+typedef int32_t acpi_native_int;
 
 typedef u32 acpi_io_address;
 typedef u32 acpi_physical_address;
--- a/xen/include/xen/linux-compat.h
+++ b/xen/include/xen/linux-compat.h
@@ -14,7 +14,7 @@
 typedef int8_t  s8, __s8;
 typedef uint8_t __u8;
 typedef int16_t s16, __s16;
-typedef int32_t __s32;
+typedef int32_t s32, __s32;
 typedef int64_t __s64;
 
 typedef paddr_t phys_addr_t;
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -7,7 +7,6 @@
 /* Linux inherited types which are being phased out */
 typedef uint8_t u8;
 typedef uint16_t u16, __u16;
-typedef int32_t s32;
 typedef uint32_t u32, __u32;
 typedef int64_t s64;
 typedef uint64_t u64, __u64;



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 12:01:46 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 12:01:46 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785738.1195231 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdqU-0002Ei-CO; Thu, 29 Aug 2024 12:01:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785738.1195231; Thu, 29 Aug 2024 12:01:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdqU-0002Eb-9q; Thu, 29 Aug 2024 12:01:46 +0000
Received: by outflank-mailman (input) for mailman id 785738;
 Thu, 29 Aug 2024 12:01:44 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zolI=P4=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjdqS-00013g-Eu
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 12:01:44 +0000
Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com
 [2a00:1450:4864:20::632])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 748ffaf9-65fe-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 14:01:42 +0200 (CEST)
Received: by mail-ej1-x632.google.com with SMTP id
 a640c23a62f3a-a8696e9bd24so65243766b.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 05:01:42 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226c74184sm659067a12.32.2024.08.29.05.01.40
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 05:01:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 748ffaf9-65fe-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724932902; x=1725537702; 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=KMM9en/xnClhhJwmKz0DSStG28feVHlgR2ZlrSdk90M=;
        b=VuAj3wmD0PRrHUPRddPpX31knlKZqwf80/jsU5qAvCqUj4f5ZhHlGa+6P6A32Kpdw4
         KU5HYpNeCOq6EJ8vdyJTo317e+R8zMIew5gj9ViTi8b8/v/EKkoUaZ7c0wvWuNcozOgx
         NUnjFcxj6SB08c5CjZF+NjQMMCDDnj5NV0i0s=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724932902; x=1725537702;
        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=KMM9en/xnClhhJwmKz0DSStG28feVHlgR2ZlrSdk90M=;
        b=WvkWM6azixo8xUvjyQoi/Gc7fqqOIF+2/Pqp66zqliqrpVvVB4hBRVEfpiIsjqKpVb
         w/psoYvNuiUNHrdsr5qLYwMw9RZvxtdFf3T7praHZAUV0E/XmaasAV3r7mFFXCSdwSXC
         VPxdyjpyLSjRdvsJVwpWzffuPpZ0cQlgHlwcEzbIYhtfTawrpSfWlc0TAJ0DFz4/15pn
         WVDyJIXcrcrXInukE1XDC4fyCJnyWYY3PCPNoJXe1jFULP+F0E+M5q5yJzLWb1LLZucm
         M99uwzFRJV6h2YP7lHHqV3sKXtazCo7weusN6UKj0s8vD3Oe3qXY8rayiKB6PFWU+A8y
         XEog==
X-Forwarded-Encrypted: i=1; AJvYcCWIoqoGilqhUl8NWjYeM+fjgwt4r3w0mLbmg9svqekTP04yhG+nGkrGjkY3yibOFmF8gdz6pPFsHU0=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yyxvi9KnGOmQAidcCAbaM4AfKMGJM19VcesJzOmggpufWJo5oz8
	FAd2ZnKw8eGKH47wC8Z6lwhZt2Vtc4J4EDcGufJmsriyO+EFriwNLVv/InLSvwE=
X-Google-Smtp-Source: AGHT+IGun6zjhXT3andKixvxbAs+V1OCoflXCX4ba5GIZZ9PbFpWa0pK0t6OkcolejIZIrzEKd5u6A==
X-Received: by 2002:a17:907:e86:b0:a72:4320:19f3 with SMTP id a640c23a62f3a-a897f930b04mr187418866b.39.1724932900992;
        Thu, 29 Aug 2024 05:01:40 -0700 (PDT)
Message-ID: <b1fe245e-7ccf-4fa6-b71d-fec415ecfec7@citrix.com>
Date: Thu, 29 Aug 2024 13:01:38 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86: drop map-low-16Mb leftovers
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <71348420-c60a-4d5c-9548-8e5f24f82c76@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <71348420-c60a-4d5c-9548-8e5f24f82c76@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 29/08/2024 12:47 pm, Jan Beulich wrote:
> Prior work has fully eliminated that hardcoded boundary.

I'd cite e.g. commit cbabbc9f5659 ("x86/boot: Size the boot/directmap
mappings dynamically") here.

>  Drop both the
> linker script assertion (the upper bound is now the stubs area) and the
> artificial extending of xen.efi's image size.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

Sorry I didn't drop the assertion at the time.


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 12:04:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 12:04:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785748.1195242 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdsn-00034w-Sm; Thu, 29 Aug 2024 12:04:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785748.1195242; Thu, 29 Aug 2024 12:04:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdsn-00034p-PU; Thu, 29 Aug 2024 12:04:09 +0000
Received: by outflank-mailman (input) for mailman id 785748;
 Thu, 29 Aug 2024 12:04:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=LPGY=P4=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sjdsm-00034d-Di
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 12:04:08 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id cac25687-65fe-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 14:04:07 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-5334adf7249so779623e87.3
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 05:04:07 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-53540859301sm137470e87.295.2024.08.29.05.04.04
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 29 Aug 2024 05:04:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cac25687-65fe-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724933046; x=1725537846; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=9dzAV2EJGw6yfaq5GwniSakhzOsM6M2GQswLIFbJNZk=;
        b=nbIjAw1TT/d+esrNLiCg28II7M6ELzL8vzcvCxVov17SH6hAMPw9EEqwcH8WT7ARV3
         aZr3hcxIynB6ZAlCypByu9GBr+xysXpFnPX2lOo7Hb9kauTc0xxkt8F3kS8KU9x8CtV6
         DmNaK/ZqcxeWiMfKHiONAl/6UusLf2p22LgFg7AqOt7TFMkFleYGVeW3jFBh33bVqdTC
         eXrsPUJjczKBd/UPeYQiRWJbulPh+hVq/xoNeF2RrmxyuwYAy1YqNWmGqc2paLLQfueK
         VTxRn6g22gnec6jS8p5gCVKCNTjGNTI1At1p1JSAuzajrdmYBebTuBmwSuAFILmsCp+O
         AZ7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724933046; x=1725537846;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=9dzAV2EJGw6yfaq5GwniSakhzOsM6M2GQswLIFbJNZk=;
        b=Ph3/S8UbUuKHOXe692Uy/0BxlDWUQxXcNrFeSEz+zxgdaqtV2HvUYZXLCNIYTc7P6U
         8316OkR5BwXt3ISwXqmAh5qbhvz6WSrA3gT1HrL4qk8KXfTimeQE5E0V2qwm/CF+csdn
         /DbtNICoZS4JkunmvbNMgfICofmbgYtJFJCrgHMlgkYOts/gJHCIUjZ7JsxDjwB1Lhsy
         yiTjmuUy5iPLN1dMEanYb0pjfXnsrNoHpaz22Jl20mTDs+f/jQGjhLH2ZYdHG8rkX+c0
         3UkqwLhg4crs9uym1mWzRpGL+S/u3yC3B1a/d/Gy97fI+TaXq6qS8K0ICRnbw2JimBA2
         gcjg==
X-Forwarded-Encrypted: i=1; AJvYcCWsWO7b0nFQonhh+i5AQkKIl/9GsnMLvUks/zc3r4B5TnPEDHN4Xqrwt/1sOhrJ/ypqv+X7iTCuOyY=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yx3oGP6Zg5p/EvWucxc5MyoRNzn8SmTjvm3PcXvvHjx+ZE9YYLN
	IsHoB8aE9MnBpWGFzrhyClzt8jTEQJI7Xahi7B3sNAuR8DblaCPn
X-Google-Smtp-Source: AGHT+IGMomFrlJlke6KxgOwNI1EQFsPuU1rHPdCNGUC9hGeNkv5Ph1YS+0/kQy0OBg2hQlgATo8RYw==
X-Received: by 2002:a05:6512:1105:b0:52e:8141:1b27 with SMTP id 2adb3069b0e04-5353e5aae52mr1844077e87.43.1724933045668;
        Thu, 29 Aug 2024 05:04:05 -0700 (PDT)
Message-ID: <4418002b93a3ae101e15e390dc537c726948bcb4.camel@gmail.com>
Subject: Re: [PATCH v5 6/7] xen/riscv: page table handling
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Thu, 29 Aug 2024 14:04:04 +0200
In-Reply-To: <b83e7d23-2171-447f-a4e5-48563e4068a5@suse.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
	 <090e617d88b279ae88f1a7859875a7e1a0c6ae73.1724256027.git.oleksii.kurochko@gmail.com>
	 <c0005454-3b34-427d-8ea0-620aba632487@suse.com>
	 <ed84c53454cb63082aa96befe89a89d8f234ef71.camel@gmail.com>
	 <b83e7d23-2171-447f-a4e5-48563e4068a5@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.4 (3.52.4-1.fc40app2) 
MIME-Version: 1.0

On Thu, 2024-08-29 at 09:01 +0200, Jan Beulich wrote:
> On 28.08.2024 18:11, oleksii.kurochko@gmail.com=C2=A0wrote:
> > On Tue, 2024-08-27 at 17:00 +0200, Jan Beulich wrote:
> > > On 21.08.2024 18:06, Oleksii Kurochko wrote:
> > > > Implement map_pages_to_xen() which requires several
> > > > functions to manage page tables and entries:
> > > > - pt_update()
> > > > - pt_mapping_level()
> > > > - pt_update_entry()
> > > > - pt_next_level()
> > > > - pt_check_entry()
> > > >=20
> > > > To support these operations, add functions for creating,
> > > > mapping, and unmapping Xen tables:
> > > > - create_table()
> > > > - map_table()
> > > > - unmap_table()
> > > >=20
> > > > Introduce internal macros starting with PTE_* for convenience.
> > > > These macros closely resemble PTE bits, with the exception of
> > > > PTE_SMALL, which indicates that 4KB is needed.
> > >=20
> > > What macros are you talking about here? Is this partially stale,
> > > as
> > > only PTE_SMALL and PTE_POPULATE (and a couple of masks) are being
> > > added?
> > I am speaking about macros connected to masks:
> > =C2=A0=C2=A0=C2=A0=C2=A0 #define PTE_R_MASK(x)=C2=A0=C2=A0 ((x) & PTE_R=
EADABLE)
> > =C2=A0=C2=A0=C2=A0=C2=A0 #define PTE_W_MASK(x)=C2=A0=C2=A0 ((x) & PTE_W=
RITABLE)
> > =C2=A0=C2=A0=C2=A0=C2=A0 #define PTE_X_MASK(x)=C2=A0=C2=A0 ((x) & PTE_E=
XECUTABLE)
> > =C2=A0=C2=A0=20
> > =C2=A0=C2=A0=C2=A0=C2=A0 #define PTE_RWX_MASK(x) ((x) & (PTE_READABLE |=
 PTE_WRITABLE |
> > =C2=A0=C2=A0 PTE_EXECUTABLE))
>=20
> Some of which is did question further down in my reply. But what's
> worse - by saying "closely resemble PTE bits, with the exception of
> PTE_SMALL" you pretty clearly _do not_ refer to the macros above, but
> to PTE_VALID etc.
Agree, it should be corrected.

>=20
> > > > @@ -68,6 +111,20 @@ static inline bool pte_is_valid(pte_t p)
> > > > =C2=A0=C2=A0=C2=A0=C2=A0 return p.pte & PTE_VALID;
> > > > =C2=A0}
> > > > =C2=A0
> > > > +inline bool pte_is_table(const pte_t p)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 return ((p.pte & (PTE_VALID |
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PTE_READABLE |
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PTE_WRITABLE |
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 PTE_EXECUTABLE=
)) =3D=3D PTE_VALID);
> > > > +}
> > >=20
> > > In how far is the READABLE check valid here? You (imo correctly)
> > > ...
>=20
> Oh, I wrongly picked on READABLE when it should have been the
> WRITABLE
> bit.
>=20
> > > > +static inline bool pte_is_mapping(const pte_t p)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 return (p.pte & PTE_VALID) &&
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (p.pt=
e & (PTE_WRITABLE | PTE_EXECUTABLE));
> > > > +}
> > >=20
> > > ... don't consider this bit here.
> > pte_is_mapping() seems to me is correct as according to the RISC-V
> > privileged spec:
> > =C2=A0=C2=A0 4. Otherwise, the PTE is valid. If pte.r =3D 1 or pte.x =
=3D 1, go to
> > step=20
> > =C2=A0=C2=A0 5. Otherwise, this PTE is a pointer to the next level of t=
he
> > page=C2=A0=C2=A0=20
> > =C2=A0=C2=A0 table.
> > =C2=A0=C2=A0 5. A leaf PTE has been found. ...
>=20
> Right. And then why do you check all three of r, x, and w, when the
> doc
> mentions only r and x? There may be reasons, but such reasons then
> need
> clearly stating in a code comment, for people to understand why the
> code
> is not following the spec.
So I remembered why R, W, and X are checked. There is contradictory
information about these bits
(https://github.com/riscv/riscv-isa-manual/blob/main/src/supervisor.adoc?pl=
ain=3D1#L1317C64-L1321C10
):
```
The permission bits, R, W, and X, indicate whether the page is
readable, writable, and executable, respectively. When all three are
zero, the PTE is a pointer to the next level of the page table;
otherwise, it is a leaf PTE.
```

However, it is also written here
(https://github.com/riscv/riscv-isa-manual/blob/main/src/supervisor.adoc?pl=
ain=3D1#L1539
) that only pte.r and pte.x should be checked.

I can assume that the interpretation that R=3DW=3DX=3D0 indicates a pointer
to the next level of the page table could come from this statement
(https://github.com/riscv/riscv-isa-manual/blob/main/src/supervisor.adoc?pl=
ain=3D1#L1538
):
```
If _pte_._v_ =3D 0, or if _pte_._r_ =3D 0 and _pte_._w_ =3D 1, or if any bi=
ts
or encodings that are reserved for future standard use are set within
_pte_, stop and raise a page-fault exception corresponding to the
original access type.
```
>From this, I can assume that when pte.r =3D 0, pte.w should also always
be zero; otherwise, a page-fault exception will be raised. ( but it is
no obviously connected to if the PTE is a pointer to the next page
table or not... ).




>=20
> > and regarding pte_is_table() READABLE check is valid as we have to
> > check only that pte.r =3D pte.x =3D 0. WRITABLE check should be
> > dropped. Or
> > just use define pte_is_table() as:
> > =C2=A0=C2=A0 inline bool pte_is_table(const pte_t p)
> > =C2=A0=C2=A0 {
> > =C2=A0=C2=A0=C2=A0	return !pte_is_mapping(p);
> > =C2=A0=C2=A0 }
>=20
> You had it like this earlier on, didn't you? That's wrong, because
> for a
> PTE to describe another page table level PTE_VALID needs to be set.
Agree, it's wrong, missed that.

> > > > +#define XEN_TABLE_MAP_FAILED 0
> > > > +#define XEN_TABLE_SUPER_PAGE 1
> > > > +#define XEN_TABLE_NORMAL 2
> > > > +
> > > > +/*
> > > > + * Take the currently mapped table, find the corresponding
> > > > entry,
> > > > + * and map the next table, if available.
> > > > + *
> > > > + * The alloc_tbl parameters indicates whether intermediate
> > > > tables
> > > > should
> > > > + * be allocated when not present.
> > > > + *
> > > > + * Return values:
> > > > + *=C2=A0 XEN_TABLE_MAP_FAILED: Either alloc_only was set and the
> > > > entry
> > > > + *=C2=A0 was empty, or allocating a new page failed.
> > > > + *=C2=A0 XEN_TABLE_NORMAL: next level or leaf mapped normally
> > > > + *=C2=A0 XEN_TABLE_SUPER_PAGE: The next entry points to a
> > > > superpage.
> > > > + */
> > > > +static int pt_next_level(bool alloc_tbl, pte_t **table,
> > > > unsigned
> > > > int offset)
> > >=20
> > > Having the boolean first is unusual, but well - it's your choice.
> > >=20
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 pte_t *entry;
> > > > +=C2=A0=C2=A0=C2=A0 int ret;
> > > > +=C2=A0=C2=A0=C2=A0 mfn_t mfn;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 entry =3D *table + offset;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 if ( !pte_is_valid(*entry) )
> > > > +=C2=A0=C2=A0=C2=A0 {
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( alloc_tbl )
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 return XEN_TABLE_MAP_FAILED;
> > >=20
> > > Is this condition meant to be inverted?
> > if alloc_tbl =3D true we shouldn't allocatetable as:
> > =C2=A0=C2=A0=C2=A0=C2=A0 * The intermediate page table shouldn't be all=
ocated when MFN
> > isn't
> > =C2=A0=C2=A0=C2=A0=C2=A0 * valid and we are not populating page table.
> > ...
> > =C2=A0=C2=A0=C2=A0 */
>=20
> Well, no. The variable name really shouldn't be the opposite of what
> is
> meant. "alloc_tbl" can only possibly mean "allocate a table if none
> is
> there". I can't think of a sensible interpretation in the inverted
> sense.
> I'm curious how you mean to interpret that variable name.
My interpretation was that alloc_tbl =3D true means that algorithm is
trying to allocate the table what is forbidden at the moment but I
agree that your interpretation sounds more understandable based on the
variable name.

>=20
> > =C2=A0=C2=A0=C2=A0 bool alloc_tbl =3D mfn_eq(mfn, INVALID_MFN) && !(fla=
gs &
> > PTE_POPULATE);
> >=20
> > So if mfn =3D INVALID_MFN and flags.PTE_POPULATE=3D0 it means that this
> > table shouldn't be allocated and thereby pt_next_level() should
> > return
> > XEN_TABLE_MAP_FAILED.
> >=20
> > Or to invert if ( alloc_tbl )it will be needed to invert defintion
> > of
> > alloc_tbl:
> > =C2=A0bool alloc_tbl =3D !mfn_eq(mfn, INVALID_MFN) || (flags &
> > PTE_POPULATE);
>=20
> Yes, as I did comment further down.
>=20
> > > > +=C2=A0=C2=A0=C2=A0 if ( level !=3D target )
> > > > +=C2=A0=C2=A0=C2=A0 {
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 printk("%s: Shattering =
superpage is not supported\n",
> > > > __func__);
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 rc =3D -EOPNOTSUPP;
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto out;
> > > > +=C2=A0=C2=A0=C2=A0 }
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 entry =3D table + offsets[level];
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 rc =3D -EINVAL;
> > > > +=C2=A0=C2=A0=C2=A0 if ( !pt_check_entry(*entry, mfn, flags) )
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto out;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 /* We are removing the page */
> > > > +=C2=A0=C2=A0=C2=A0 if ( !(flags & PTE_VALID) )
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 memset(&pte, 0x00, size=
of(pte));
> > > > +=C2=A0=C2=A0=C2=A0 else
> > > > +=C2=A0=C2=A0=C2=A0 {
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* We are inserting a m=
apping =3D> Create new pte. */
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( !mfn_eq(mfn, INVAL=
ID_MFN) )
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 pte =3D pte_from_mfn(mfn, PTE_VALID);
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 else /* We are updating=
 the permission =3D> Copy the
> > > > current
> > > > pte. */
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 pte =3D *entry;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* update permission ac=
cording to the flags */
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pte.pte |=3D PTE_RWX_MA=
SK(flags) | PTE_ACCESSED |
> > > > PTE_DIRTY;
> > >=20
> > > When updating an entry, don't you also need to clear (some of)
> > > the
> > > flags?
> > I am not sure why some flags should be cleared. Here we are taking
> > only
> > necessary for pte flags such as R, W, X or other bits in flags are
> > ignored.
>=20
> Consider what happens to a PTE with R and X set when a request comes
> in
> to change to R/W. You'll end up with R, X, and W all set if you don't
> first clear the bits that are meant to be changeable in a "modify"
> operation.
That's definitely going to be a problem. I'll update the code then.

>=20
> > > > +/* Return the level where mapping should be done */
> > > > +static int pt_mapping_level(unsigned long vfn, mfn_t mfn,
> > > > unsigned
> > > > long nr,
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0 unsigned int flags)
> > > > +{
> > > > +=C2=A0=C2=A0=C2=A0 unsigned int level =3D 0;
> > > > +=C2=A0=C2=A0=C2=A0 unsigned long mask;
> > > > +=C2=A0=C2=A0=C2=A0 unsigned int i;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 /* Use blocking mapping unless the caller reque=
sts 4K
> > > > mapping
> > > > */
> > > > +=C2=A0=C2=A0=C2=A0 if ( unlikely(flags & PTE_SMALL) )
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return level;
> > > > +
> > > > +=C2=A0=C2=A0=C2=A0 /*
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * Don't take into account the MFN when re=
moving mapping
> > > > (i.e
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * MFN_INVALID) to calculate the correct t=
arget order.
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 *
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * `vfn` and `mfn` must be both superpage =
aligned.
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * They are or-ed together and then checke=
d against the
> > > > size
> > > > of
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * each level.
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 *
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * `left` is not included and checked sepa=
rately to allow
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * superpage mapping even if it is not pro=
perly aligned
> > > > (the
> > > > +=C2=A0=C2=A0=C2=A0=C2=A0 * user may have asked to map 2MB + 4k).
> > >=20
> > > What is this about? There's nothing named "left" here.
> > It refer to "remaining" pages or "leftover" space after trying to
> > align
> > a mapping to a superpage boundary.
>=20
> What what is the quoted "left" here? Such a variable appears to exist
> in
> the caller, but using the name here is lacking context.
Then I will update the comment and tell from where 'left' is coming.

>=20
>=20
> > > > + * If `mfn` is valid and flags has PTE_VALID bit set then it
> > > > means
> > > > that
> > > > + * inserting will be done.
> > > > + */
> > >=20
> > > What about mfn !=3D INVALID_MFN and PTE_VALID clear?
> > PTE_VALID=3D0 will be always considered as destroying and no matter
> > what
> > is mfn value as in this case the removing is done in the way where
> > mfn
> > isn't used:
>=20
> Right, yet elsewhere you're restrictive as to MFN values valid to
> use.
> Not requiring INVALID_MFN here looks inconsistent to me.
but actually if we will leave ASSERT in pt_check_entry() we will be
sure that we are here with mfn =3D INVALID_MFN:
       /* Sanity check when removing a mapping. */
       else if ( (flags & (PTE_VALID | PTE_POPULATE)) =3D=3D 0 )
       {
           /* We should be here with an invalid MFN. */
           ASSERT(mfn_eq(mfn, INVALID_MFN));
>=20
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 memset(&pte, 0x00, sizeof(pt=
e));
>=20
> Just to mention it: I don't think memset() is a very good way of
> clearing
> a PTE, even if right here it's not a live one.
Just direct assigning would be better?=20

>=20
> > > =C2=A0Also note that "`mfn` is
> > > valid" isn't the same as "mfn !=3D INVALID_MFN". You want to be
> > > precise
> > > here,
> > > to avoid confusion later on. (I say that knowing that we're still
> > > fighting
> > > especially shadow paging code on x86 not having those properly
> > > separated.)
> > If it is needed to be precise and mfn is valid isn't the same as
> > "mfn
> > !=3D INVALID_MFN" only for the case of shadow paging?
>=20
> No, I used shadow paging only as an example of where we have similar
> issues. I'd like to avoid that a new port starts out with introducing
> more instances of that. You want to properly separate INVALID_MFN
> from
> "invalid MFN", where the latter means any MFN where either nothing
> exists at all, or (see mfn_valid()) where no struct page_info exists.
Well, now I think I understand the difference between "INVALID_MFN" and
"invalid MFN."

Referring back to your original reply, I need to update the comment
above pt_update():
```
   ...
     * If `mfn` is valid ( exist ) and flags has PTE_VALID bit set then it
   means that inserting will be done.
```
Would this be correct and more precise?

Based on the code for mfn_valid(), the separation is currently done
using the max_page value, which can't be initialized at the moment as
it requires reading the device tree file to obtain the RAM end.

We could use a placeholder for the RAM end (for example, a very high
value like -1UL) and then add __mfn_valid() within pt_update().
However, I'm not sure if this approach aligns with what you consider by
proper separation between INVALID_MFN and "invalid MFN."

~ Oleksii


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 12:07:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 12:07:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785753.1195251 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdvk-0004GV-AB; Thu, 29 Aug 2024 12:07:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785753.1195251; Thu, 29 Aug 2024 12:07:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdvk-0004GO-7h; Thu, 29 Aug 2024 12:07:12 +0000
Received: by outflank-mailman (input) for mailman id 785753;
 Thu, 29 Aug 2024 12:07:11 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zolI=P4=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjdvj-0004F2-Fr
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 12:07:11 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 38092b3b-65ff-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 14:07:10 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a8677ae5a35so58893166b.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 05:07:10 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226cd4bcbsm639717a12.74.2024.08.29.05.07.08
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 05:07:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 38092b3b-65ff-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724933230; x=1725538030; 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=6ROYzNoX1qE7s9SqveyhJlDofZYmhylXnoCWYS8h9w8=;
        b=c0FF19+m+0cLAc4ya7do7Vpjv29O1gJBcjPUH9F7W2caqDbibG3Aw0HdrELWULbT35
         nwh2lIAEO8KyYAeuy3eICcplQLBYN6s2641cGCuh6GjbIONg7NpSohLDbo48fqtZitdO
         ukVerpIMxsKLtJdU8mPJ7CAQsjrBG+f+wpgwE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724933230; x=1725538030;
        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=6ROYzNoX1qE7s9SqveyhJlDofZYmhylXnoCWYS8h9w8=;
        b=O0kczCn5BAxNV5Y6SWZWHkCKPQhlwNODXHDjhDp/HwsLyQIkxvU5ezuhqzDqYUWMbe
         l05nrbY19LHbKS1zU5umkSsBZ65UKo1o2I7YwFipp57biCDz45dCLZMryBrBW/z/9IVl
         BP/0thKFA//1xmKvkxJU4TF+pWS0JK2cJjrDQbtFaGPXNgnfkx0tYzGQ3nj6Df6pYd+X
         9RnT1FEbeh2Zyt6YrNzphF5++RZZnV7NdaUYvszoECsYOqoh4uycRjJX4IID0pmKjxIU
         9XX3UyAcXsJAKKPcLQ7DZdxLmLLNhMMeQQMbNagZ3Qu++mjZ2N52xWXZeYVDPcU8wmus
         jmLQ==
X-Forwarded-Encrypted: i=1; AJvYcCWGKUdcDh3BvVFULArxQOdvYFpDAwh/tW0eBNwvfZea1WpezB1IE92q+zGcWekDEQoQeZwbmJSZmcE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxmwuYRf/ArRgAiPA+mUYlvuLFXnAXuj0ytuJDsMrCl1RCg1s7U
	M+H058L1kA9tgOnPNarJj55f1C6grUJBDCKA287Y4cSaq2xbv836q2fOASQBEX0=
X-Google-Smtp-Source: AGHT+IEiHm/pZ+kXUuKezAdZLXrSQOLEHxrQf7RUU1p3sTKQqbJy6dqvXxW5b7zynyN+dAp298njOA==
X-Received: by 2002:a17:907:1c9e:b0:a7a:9ece:ea5f with SMTP id a640c23a62f3a-a897f956730mr186752966b.41.1724933229379;
        Thu, 29 Aug 2024 05:07:09 -0700 (PDT)
Message-ID: <594b5ad4-0b86-4397-a261-0e98515e3abe@citrix.com>
Date: Thu, 29 Aug 2024 13:07:07 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/boot: Use C99 types for integers
To: Frediano Ziglio <frediano.ziglio@cloud.com>,
 xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>
References: <20240829115247.168608-1-frediano.ziglio@cloud.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20240829115247.168608-1-frediano.ziglio@cloud.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 29/08/2024 12:52 pm, Frediano Ziglio wrote:
> diff --git a/xen/arch/x86/boot/defs.h b/xen/arch/x86/boot/defs.h
> index 239b9f8716..ee1a4da6af 100644
> --- a/xen/arch/x86/boot/defs.h
> +++ b/xen/arch/x86/boot/defs.h
> @@ -57,7 +57,7 @@ typedef u16 uint16_t;
>  typedef u32 uint32_t;
>  typedef u64 uint64_t;
>  
> -#define U16_MAX		((u16)(~0U))
> +#define UINT16_MAX	((uint16_t)(~0U))
>  #define UINT_MAX	(~0U)
>  
>  #endif /* __BOOT_DEFS_H__ */

I'm happy with the change in principle, but could we see about dropping
defs.h entirely?  For example, we've already got both of these UINT
constants in types.h

Since this was written, we've got rather better about cleaning up
xen/types.h, and extracting macros into xen/macros.h

I think there's a good chance that the regular headers can now be used
directly, or with minor tweaking.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 12:07:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 12:07:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785760.1195262 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdw4-0004y3-Hd; Thu, 29 Aug 2024 12:07:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785760.1195262; Thu, 29 Aug 2024 12:07:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdw4-0004xu-Ex; Thu, 29 Aug 2024 12:07:32 +0000
Received: by outflank-mailman (input) for mailman id 785760;
 Thu, 29 Aug 2024 12:07:31 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjdqg-00013g-Ca
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 12:01:58 +0000
Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com
 [2a00:1450:4864:20::52b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7cda3871-65fe-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 14:01:56 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5bec4fc82b0so2954829a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 05:01:56 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226ccff65sm632354a12.72.2024.08.29.05.01.55
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 05:01:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7cda3871-65fe-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724932916; x=1725537716; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=LVMQIK1HgZzB/1b4Keq1JOlb+ZRrdFY+OKkfoX3Sk94=;
        b=aJcG0ag+xkB3aS6rqV2wl9gs2OYrf7IAoyE3v8Th9ocrtGpjcGarncYGZ+SrubOlBI
         fvNhot61uflOrWy6NlMcPk6r+w1fxUkIZ7zmBjfRkIHEzh7yhVVHztBq2T86PTOrDr0A
         04sdjmwdSKM7g4FtkiDbsHupQ3+E4fw9dU77MKTlpdBG2vSm00OUHY3Hf+K0q1wRy899
         zIJZNALudeJ2Qhruv4TDA+2Xs5zPGg0Qyl7jHQE4S0k98fYp6742tPqq1J2y8be2VhW1
         yhYMfv7x+AgsyKjcXtqejLuZ8mz0z/CaPt9MJQB26BMcnSB9E4/lhsy6ZOSdeF11UY/N
         8ong==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724932916; x=1725537716;
        h=content-transfer-encoding:in-reply-to:autocrypt:content-language
         :references:cc:to:from:subject:user-agent:mime-version:date
         :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=LVMQIK1HgZzB/1b4Keq1JOlb+ZRrdFY+OKkfoX3Sk94=;
        b=qoWsKDR8EI7GUkP5NQo5HA44jLXqMM5sj7Tde+pF7JWfQKBpZNehKqSef4ZEnCPdGp
         rRHDG0kk01PQ6PcTfOji+TlOYzneCnTCE6oSERKuA1qQnctTsYfV8Wz3ZUtvtLsl6crV
         mjMeoI+oQg2NYJPEUyWpfOIAkqRAEiCn2pMrUJ6vAHl49rtK3h+r4fyy7EmeN98TOa3P
         pTe+nya5HRn+7OkbzbPVR5EAfcz0bz9GBv0SWMY17agXJD0RHMs1P88cR8QvBY2y51G5
         xxRbABpBGE0w1qgFqmeV1dVNVXR+wxNfXdCyNHVeeqO/T/l4aYosfLO74e3QjcIpByWz
         tygg==
X-Gm-Message-State: AOJu0YyNlpYSgIzt4NUMij3JzFk+ep2Jl+p0rdyGEuoPMzL3FwZFPsP1
	6p6BPAJEVBeTAki7IsnabJBKM3XMa979+3PqjBu7e3cdConWvU8s+OCpBNspUrRwxxO6f2aDmcw
	=
X-Google-Smtp-Source: AGHT+IEMbX4Gx0u3ZfACfhCdEe3hRZf+ALTTX5bNiZi2rsGmVbQ8JV9oH7a3wLErwAaXMwQ1/IYpfQ==
X-Received: by 2002:a05:6402:5186:b0:5c2:1014:295a with SMTP id 4fb4d7f45d1cf-5c2200de37dmr2349860a12.2.1724932915719;
        Thu, 29 Aug 2024 05:01:55 -0700 (PDT)
Message-ID: <50ffc0e1-ff3d-421f-a703-295541357e17@suse.com>
Date: Thu, 29 Aug 2024 14:01:54 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: [PATCH 5/5] types: replace remaining uses of s64
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>
References: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
Content-Language: en-US
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

... and move the type itself to linux-compat.h.

While doing so
- correct the type of union uu's uq field in lib/divmod.c,
- switch a few adjacent types as well, for (a little bit of)
  consistency.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/arm/arm64/cpufeature.c
+++ b/xen/arch/arm/arm64/cpufeature.c
@@ -484,8 +484,8 @@ static const struct arm64_ftr_bits ftr_r
 	ARM64_FTR_END,
 };
 
-static u64 arm64_ftr_set_value(const struct arm64_ftr_bits *ftrp, s64 reg,
-			       s64 ftr_val)
+static uint64_t arm64_ftr_set_value(const struct arm64_ftr_bits *ftrp,
+				    int64_t reg, int64_t ftr_val)
 {
 	u64 mask = arm64_ftr_mask(ftrp);
 
@@ -494,10 +494,10 @@ static u64 arm64_ftr_set_value(const str
 	return reg;
 }
 
-static s64 arm64_ftr_safe_value(const struct arm64_ftr_bits *ftrp, s64 new,
-				s64 cur)
+static int64_t arm64_ftr_safe_value(const struct arm64_ftr_bits *ftrp,
+				    int64_t new, int64_t cur)
 {
-	s64 ret = 0;
+	int64_t ret = 0;
 
 	switch (ftrp->type) {
 	case FTR_EXACT:
@@ -532,8 +532,8 @@ static void sanitize_reg(u64 *cur_reg, u
 
 	for (;ftrp->width != 0;ftrp++)
 	{
-		s64 cur_field = arm64_ftr_value(ftrp, *cur_reg);
-		s64 new_field = arm64_ftr_value(ftrp, new_reg);
+		int64_t cur_field = arm64_ftr_value(ftrp, *cur_reg);
+		int64_t new_field = arm64_ftr_value(ftrp, new_reg);
 
 		if (cur_field == new_field)
 			continue;
--- a/xen/arch/arm/arm64/livepatch.c
+++ b/xen/arch/arm/arm64/livepatch.c
@@ -119,7 +119,7 @@ static u64 do_reloc(enum aarch64_reloc_o
 
 static int reloc_data(enum aarch64_reloc_op op, void *place, u64 val, int len)
 {
-    s64 sval = do_reloc(op, place, val);
+    int64_t sval = do_reloc(op, place, val);
 
     switch ( len )
     {
@@ -136,7 +136,7 @@ static int reloc_data(enum aarch64_reloc
         break;
 
     case 64:
-        *(s64 *)place = sval;
+        *(int64_t *)place = sval;
         break;
 
     default:
@@ -155,9 +155,9 @@ enum aarch64_insn_movw_imm_type {
 static int reloc_insn_movw(enum aarch64_reloc_op op, void *dest, u64 val,
                            int lsb, enum aarch64_insn_movw_imm_type imm_type)
 {
-    u64 imm;
-    s64 sval;
-    u32 insn = *(u32 *)dest;
+    uint64_t imm;
+    int64_t sval;
+    uint32_t insn = *(uint32_t *)dest;
 
     sval = do_reloc(op, dest, val);
     imm = sval >> lsb;
@@ -200,9 +200,9 @@ static int reloc_insn_movw(enum aarch64_
 static int reloc_insn_imm(enum aarch64_reloc_op op, void *dest, u64 val,
                           int lsb, int len, enum aarch64_insn_imm_type imm_type)
 {
-    u64 imm, imm_mask;
-    s64 sval;
-    u32 insn = *(u32 *)dest;
+    uint64_t imm, imm_mask;
+    int64_t sval;
+    uint32_t insn = *(uint32_t *)dest;
 
     /* Calculate the relocation value. */
     sval = do_reloc(op, dest, val);
@@ -220,7 +220,7 @@ static int reloc_insn_imm(enum aarch64_r
      * Extract the upper value bits (including the sign bit) and
      * shift them to bit 0.
      */
-    sval = (s64)(sval & ~(imm_mask >> 1)) >> (len - 1);
+    sval = (int64_t)(sval & ~(imm_mask >> 1)) >> (len - 1);
 
     /*
      * Overflow has occurred if the upper bits are not all equal to
--- a/xen/arch/arm/include/asm/arm64/cpufeature.h
+++ b/xen/arch/arm/include/asm/arm64/cpufeature.h
@@ -39,15 +39,15 @@ struct arm64_ftr_bits {
 	bool		visible;
 	bool		strict;	/* CPU Sanity check: strict matching required ? */
 	enum ftr_type	type;
-	u8		shift;
-	u8		width;
-	s64		safe_val; /* safe value for FTR_EXACT features */
+	uint8_t		shift;
+	uint8_t		width;
+	int64_t		safe_val; /* safe value for FTR_EXACT features */
 };
 
 static inline int __attribute_const__
 cpuid_feature_extract_signed_field_width(u64 features, int field, int width)
 {
-	return (s64)(features << (64 - width - field)) >> (64 - width);
+	return (int64_t)(features << (64 - width - field)) >> (64 - width);
 }
 
 static inline int __attribute_const__
@@ -87,9 +87,12 @@ cpuid_feature_extract_field(u64 features
 	return cpuid_feature_extract_field_width(features, field, 4, sign);
 }
 
-static inline s64 arm64_ftr_value(const struct arm64_ftr_bits *ftrp, u64 val)
+static inline int64_t arm64_ftr_value(const struct arm64_ftr_bits *ftrp,
+                                      uint64_t val)
 {
-	return (s64)cpuid_feature_extract_field_width(val, ftrp->shift, ftrp->width, ftrp->sign);
+	return (int64_t)cpuid_feature_extract_field_width(val, ftrp->shift,
+							  ftrp->width,
+							  ftrp->sign);
 }
 
 #endif /* _ASM_ARM_ARM64_CPUFEATURES_H */
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -1206,7 +1206,7 @@ void vlapic_tdt_msr_set(struct vlapic *v
     if ( value > guest_tsc )
     {
         uint64_t delta = gtsc_to_gtime(v->domain, value - guest_tsc);
-        delta = max_t(s64, delta, 0);
+        delta = max_t(int64_t, delta, 0);
 
         HVM_DBG_LOG(DBG_LEVEL_VLAPIC_TIMER, "delta[0x%016"PRIx64"]", delta);
 
--- a/xen/arch/x86/include/asm/hvm/vcpu.h
+++ b/xen/arch/x86/include/asm/hvm/vcpu.h
@@ -134,8 +134,8 @@ struct hvm_vcpu {
     unsigned long       hw_cr[5];
 
     struct vlapic       vlapic;
-    s64                 cache_tsc_offset;
-    u64                 guest_time;
+    int64_t             cache_tsc_offset;
+    uint64_t            guest_time;
 
     /* Lock and list for virtual platform timers. */
     spinlock_t          tm_lock;
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -66,10 +66,10 @@ struct cpu_time {
 struct platform_timesource {
     const char *id;
     const char *name;
-    u64 frequency;
+    uint64_t frequency;
     /* Post-init this hook may only be invoked via the read_counter() wrapper! */
-    u64 (*read_counter)(void);
-    s64 (*init)(struct platform_timesource *);
+    uint64_t (*read_counter)(void);
+    int64_t (*init)(struct platform_timesource *);
     void (*resume)(struct platform_timesource *);
     int counter_bits;
 };
@@ -368,7 +368,7 @@ static u64 cf_check read_pit_count(void)
     return count32;
 }
 
-static s64 __init cf_check init_pit(struct platform_timesource *pts)
+static int64_t __init cf_check init_pit(struct platform_timesource *pts)
 {
     u8 portb = inb(0x61);
     u64 start, end;
@@ -610,7 +610,7 @@ static u64 cf_check read_pmtimer_count(v
     return inl(pmtmr_ioport);
 }
 
-static s64 __init cf_check init_pmtimer(struct platform_timesource *pts)
+static int64_t __init cf_check init_pmtimer(struct platform_timesource *pts)
 {
     if ( !pmtmr_ioport || (pmtmr_width != 24 && pmtmr_width != 32) )
         return 0;
@@ -655,7 +655,7 @@ static unsigned int __initdata tsc_flags
  * Called in verify_tsc_reliability() under reliable TSC conditions
  * thus reusing all the checks already performed there.
  */
-static s64 __init cf_check init_tsc(struct platform_timesource *pts)
+static int64_t __init cf_check init_tsc(struct platform_timesource *pts)
 {
     u64 ret = pts->frequency;
 
@@ -1010,9 +1010,9 @@ static void __init reset_platform_timer(
     spin_unlock_irq(&platform_timer_lock);
 }
 
-static s64 __init try_platform_timer(struct platform_timesource *pts)
+static int64_t __init try_platform_timer(struct platform_timesource *pts)
 {
-    s64 rc = pts->init(pts);
+    int64_t rc = pts->init(pts);
 
     if ( rc <= 0 )
         return rc;
@@ -1046,7 +1046,7 @@ static u64 __init init_platform_timer(vo
 
     struct platform_timesource *pts = NULL;
     unsigned int i;
-    s64 rc = -1;
+    int64_t rc = -1;
 
     /* clocksource=tsc is initialized via __initcalls (when CPUs are up). */
     if ( (opt_clocksource[0] != '\0') && strcmp(opt_clocksource, "tsc") )
@@ -1837,7 +1837,7 @@ static void cf_check local_time_calibrat
      * Weirdness can happen if we lose sync with the platform timer.
      * We could be smarter here: resync platform timer with local timer?
      */
-    if ( ((s64)stime_elapsed64 < (EPOCH / 2)) )
+    if ( ((int64_t)stime_elapsed64 < (EPOCH / 2)) )
         goto out;
 
     /*
@@ -2312,7 +2312,7 @@ static void __init tsc_check_writability
 
         write_tsc(tsc | (1ULL << 32));
         tmp = rdtsc();
-        if ( ABS((s64)tmp - (s64)tmp2) < (1LL << 31) )
+        if ( ABS((int64_t)tmp - (int64_t)tmp2) < (1LL << 31) )
             what = "only partially";
     }
     else
--- a/xen/common/ubsan/ubsan.c
+++ b/xen/common/ubsan/ubsan.c
@@ -21,7 +21,6 @@ static DEFINE_PER_CPU(struct xen_ubsan[1
 #define current this_cpu(in_ubsan)
 #define dump_stack dump_execution_state
 #define u64 long long unsigned int
-#define s64 long long int
 
 #include "ubsan.h"
 
@@ -102,7 +101,7 @@ static s_max get_signed_val(struct type_
 	}
 
 	if (type_bit_width(type) == 64)
-		return *(s64 *)val;
+		return *(int64_t *)val;
 
 	return *(s_max *)val;
 }
@@ -141,10 +140,11 @@ static void val_to_string(char *str, siz
 #endif
 		} else if (type_is_signed(type)) {
 			scnprintf(str, size, "%lld",
-				(s64)get_signed_val(type, value));
+				  (long long)get_signed_val(type, value));
 		} else {
 			scnprintf(str, size, "%llu",
-				(u64)get_unsigned_val(type, value));
+				  (unsigned long long)get_unsigned_val(type,
+								       value));
 		}
 	}
 }
--- a/xen/common/ubsan/ubsan.h
+++ b/xen/common/ubsan/ubsan.h
@@ -97,8 +97,8 @@ enum {
 typedef __int128 s_max;
 typedef unsigned __int128 u_max;
 #else
-typedef s64 s_max;
-typedef u64 u_max;
+typedef int64_t s_max;
+typedef uint64_t u_max;
 #endif
 
 #endif
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -105,7 +105,7 @@ static inline int erst_errno(int command
 
 static int erst_timedout(u64 *t, u64 spin_unit)
 {
-	if ((s64)*t < spin_unit) {
+	if ((int64_t)*t < spin_unit) {
 		printk(XENLOG_WARNING "Firmware does not respond in time\n");
 		return 1;
 	}
--- a/xen/include/acpi/actypes.h
+++ b/xen/include/acpi/actypes.h
@@ -147,8 +147,8 @@ typedef int INT32;
 
 /*! [End] no source code translation !*/
 
-typedef u64 acpi_native_uint;
-typedef s64 acpi_native_int;
+typedef uint64_t acpi_native_uint;
+typedef int64_t acpi_native_int;
 
 typedef u64 acpi_io_address;
 typedef u64 acpi_physical_address;
--- a/xen/include/xen/linux-compat.h
+++ b/xen/include/xen/linux-compat.h
@@ -15,7 +15,7 @@ typedef int8_t  s8, __s8;
 typedef uint8_t __u8;
 typedef int16_t s16, __s16;
 typedef int32_t s32, __s32;
-typedef int64_t __s64;
+typedef int64_t s64, __s64;
 
 typedef paddr_t phys_addr_t;
 
--- a/xen/include/xen/time.h
+++ b/xen/include/xen/time.h
@@ -29,7 +29,7 @@ struct vcpu;
  * of real time into system time 
  */
 
-typedef s64 s_time_t;
+typedef int64_t s_time_t;
 #define PRI_stime PRId64
 
 s_time_t get_s_time_fixed(u64 at_tick);
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -8,7 +8,6 @@
 typedef uint8_t u8;
 typedef uint16_t u16, __u16;
 typedef uint32_t u32, __u32;
-typedef int64_t s64;
 typedef uint64_t u64, __u64;
 
 #include <asm/types.h>
--- a/xen/lib/divmod.c
+++ b/xen/lib/divmod.c
@@ -46,8 +46,8 @@
  * one or more of the following formats.
  */
 union uu {
-    s64            q;              /* as a (signed) quad */
-    s64            uq;             /* as an unsigned quad */
+    int64_t        q;              /* as a (signed) quad */
+    uint64_t       uq;             /* as an unsigned quad */
     long           sl[2];          /* as two signed longs */
     unsigned long  ul[2];          /* as two unsigned longs */
 };
@@ -72,7 +72,7 @@ union uu {
  * and assembly.
  */
 #define CHAR_BIT        8               /* number of bits in a char */
-#define QUAD_BITS       (sizeof(s64) * CHAR_BIT)
+#define QUAD_BITS       (sizeof(int64_t) * CHAR_BIT)
 #define LONG_BITS       (sizeof(long) * CHAR_BIT)
 #define HALF_BITS       (sizeof(long) * CHAR_BIT / 2)
 
@@ -324,7 +324,7 @@ u64 __qdivrem(u64 uq, u64 vq, u64 *arq)
  * Divide two signed quads.
  * Truncates towards zero, as required by C99.
  */
-s64 __divdi3(s64 a, s64 b)
+int64_t __divdi3(int64_t a, int64_t b)
 {
     u64 ua, ub, uq;
     int neg = (a < 0) ^ (b < 0);
@@ -361,7 +361,7 @@ u64 __umoddi3(u64 a, u64 b)
  *  11 % -5 =  1
  * -11 % -5 = -1
  */
-s64 __moddi3(s64 a, s64 b)
+int64_t __moddi3(int64_t a, int64_t b)
 {
     u64 ua, ub, urem;
     int neg = (a < 0);
@@ -374,7 +374,7 @@ s64 __moddi3(s64 a, s64 b)
 /*
  * Quotient and remainder of unsigned long long division
  */
-s64 __ldivmod_helper(s64 a, s64 b, s64 *r)
+int64_t __ldivmod_helper(int64_t a, int64_t b, int64_t *r)
 {
     u64 ua, ub, rem, quot;
 



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 12:08:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 12:08:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785779.1195272 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdx6-0005r6-WC; Thu, 29 Aug 2024 12:08:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785779.1195272; Thu, 29 Aug 2024 12:08:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjdx6-0005qz-S4; Thu, 29 Aug 2024 12:08:36 +0000
Received: by outflank-mailman (input) for mailman id 785779;
 Thu, 29 Aug 2024 12:08: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=zolI=P4=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjdx5-0005qm-Fz
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 12:08:35 +0000
Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com
 [2a00:1450:4864:20::52a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6a39826c-65ff-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 14:08:34 +0200 (CEST)
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-58ef19aa69dso501247a12.3
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 05:08:34 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226ce54cesm640047a12.83.2024.08.29.05.08.32
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 05:08:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6a39826c-65ff-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724933314; x=1725538114; 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=gwXxdZra2bMuNCn5odJL0W2Kmj7pBZJOCQM53v7FMjg=;
        b=Gb0tjdQCEWqj3j9KW+37+IUou6JYAiyOFK7GKJzx5IO5RF7/A0Wc8tLeHjYKWbSx2m
         s+UE3ueaqfLjRTp6VIwilVvSOIu5+1bUjYXHBYCYtSOjIXlizn9QzyDtwXkrdAE7WCPk
         wJzST52G1lOFA5Jv3CGqLWNbEIcnGtxxyQCgQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724933314; x=1725538114;
        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=gwXxdZra2bMuNCn5odJL0W2Kmj7pBZJOCQM53v7FMjg=;
        b=cR5oJBM1BlbidVnwhs1OH96TMWYDsQCHOHsttMfCr0x55uZo3Gwt4G/ogl98SkZpdj
         ZEc7LpaA97LnQsYOTOC3yKsx1CKO91lsJAjnFe2cPrjPp5Zf278rAB4HAX2vgQRq2kN2
         DtT1QVjx3eXJTuG1KZs7yek13uyeGfd0vscA6JbjVfvVeHwpkeNsIZdSL6Um8IThh30V
         GPFMc9oarIV8wH7QfDS7TAtCukNQfoJ2VAvWAVh5tFDIsB7B+q0Eods0+d/x8E2k/Ax1
         WNLmiS2/ameKTdwOF3+ZcoP53pYC8J9kCfxAfmYHuYLt5yfQCr37zle/sTsK3uPhoZ5h
         92kw==
X-Forwarded-Encrypted: i=1; AJvYcCVRvfuhMDU+nyMPUdbMB5ojR3fXhQSlHN4/YFNg3kJM5OBWOFZyJT81eaMUuL6twZZiz4uIxFBVZqY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwnOgKbvaTJ8/dc844KAenkS4BrhiaVQWqzY4/iPWgz9UzRvSqw
	8Eoex5K0XlNu3YN+o9bov10bHeHLR+OhuUD39M5zCFs8FhCkiGon5MuyU2wfHZcHr6jxWP9f2Zw
	x
X-Google-Smtp-Source: AGHT+IHcCAcfm7Xr8bfOeHqhjc0ZSdQjgWbVnuzrxpu7LPafoMRuYFTO/0hnTWAbXQWANHiaSO4fPA==
X-Received: by 2002:a17:907:1b0d:b0:a86:808c:59b with SMTP id a640c23a62f3a-a897fad76a2mr197424066b.69.1724933313581;
        Thu, 29 Aug 2024 05:08:33 -0700 (PDT)
Message-ID: <63194314-76af-4db0-9a64-b45b6fdcc33d@citrix.com>
Date: Thu, 29 Aug 2024 13:08:31 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 1/5] x86: drop s<N>/u<N> overrides from mkelf32
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
References: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
 <fd27e294-744d-4fe0-ba73-1483dfc27621@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <fd27e294-744d-4fe0-ba73-1483dfc27621@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 29/08/2024 12:58 pm, Jan Beulich wrote:
> Use uint<N>_t instead (s<N> were unused altogether). While adjusting
> swap<N>() drop excessive casts and rename the arguments to avoid leading
> underscores.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 12:13:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 12:13:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785789.1195282 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sje1Y-0007Lp-GT; Thu, 29 Aug 2024 12:13:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785789.1195282; Thu, 29 Aug 2024 12:13:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sje1Y-0007Li-CS; Thu, 29 Aug 2024 12:13:12 +0000
Received: by outflank-mailman (input) for mailman id 785789;
 Thu, 29 Aug 2024 12:13:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=1zDJ=P4=arm.com=Bertrand.Marquis@srs-se1.protection.inumbo.net>)
 id 1sje1X-0007Lc-PT
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 12:13:11 +0000
Received: from EUR02-AM0-obe.outbound.protection.outlook.com
 (mail-am0eur02on2060c.outbound.protection.outlook.com
 [2a01:111:f403:2606::60c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 0e4c48df-6600-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 14:13:10 +0200 (CEST)
Received: from AS4P251CA0004.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d2::6)
 by AM8PR08MB5747.eurprd08.prod.outlook.com (2603:10a6:20b:1c7::21) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.19; Thu, 29 Aug
 2024 12:13:05 +0000
Received: from AM4PEPF00027A6C.eurprd04.prod.outlook.com
 (2603:10a6:20b:5d2:cafe::46) by AS4P251CA0004.outlook.office365.com
 (2603:10a6:20b:5d2::6) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend
 Transport; Thu, 29 Aug 2024 12:13:05 +0000
Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by
 AM4PEPF00027A6C.mail.protection.outlook.com (10.167.16.90) with
 Microsoft
 SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7918.13
 via Frontend Transport; Thu, 29 Aug 2024 12:13:05 +0000
Received: ("Tessian outbound de2677e4ad72:v403");
 Thu, 29 Aug 2024 12:13:04 +0000
Received: from L92bf38cd484f.1
 by 64aa7808-outbound-1.mta.getcheckrecipient.com id
 AB606583-F662-42FF-A808-48BB7CB84518.1; 
 Thu, 29 Aug 2024 12:08:09 +0000
Received: from EUR03-AM7-obe.outbound.protection.outlook.com
 by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id
 L92bf38cd484f.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384);
 Thu, 29 Aug 2024 12:08:09 +0000
Received: from DB9PR08MB6588.eurprd08.prod.outlook.com (2603:10a6:10:25a::24)
 by DU0PR08MB7884.eurprd08.prod.outlook.com (2603:10a6:10:3b0::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.19; Thu, 29 Aug
 2024 12:08:06 +0000
Received: from DB9PR08MB6588.eurprd08.prod.outlook.com
 ([fe80::a8fc:ea0d:baf1:23a]) by DB9PR08MB6588.eurprd08.prod.outlook.com
 ([fe80::a8fc:ea0d:baf1:23a%4]) with mapi id 15.20.7918.017; Thu, 29 Aug 2024
 12:08:06 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0e4c48df-6600-11ef-a0b0-8be0dac302b0
ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass;
 b=Th5sh/f6vId0ZL2r4rRuLvjYaDUv/nwIfqtTp8gLpLo/xdChrUMHa1UuVQWCyAU45eNVcS8QJnwhGjhoXLiDA/H3nQKv26P9eWKMFWBtHWtVQfw9wnnd/cDOJU74YtCF9ZBeSbietw1eJ5zxOlpLn1R+72w4cCdmyoqY1fRuIh5wWZdLGOhVoC7l0gzYEbKUXKLiyt9w8r6hfDgmTJTusH5YFOdD7fFXzJ87pibFzuD0c5fHQrbNnT62paX0+qykSi8BHVx7kY0UAHbF/benv7RUI4vnPSBq31zKTLhFaACsKHjmY9zX/PVxwSOqYd1o3YXYTVUIFpE9/SvryHUS+Q==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3lHEmkpXMa2uyIswJkRQ6NHRDOX+iQAljOHVIeoGEwY=;
 b=cEPFe5KyztDFX8RK3Jgz7lvslPa2Ud85C09t2xOpFBxfLeE/e4q+RTLlijIXLRRn43Is6j1PQ+0WManWJeV3gpW1QF0CtMzYMjjM87QUX4H5clqidsNWTCPybEOtviWohtXHLR3silVa9b7gpE/s18nP6EfTt0jgKTHMTqHOhmnzNCsZTtjORJ9DPF5Cz2210JU0SaRPtG9mCIFCpx3ZRMvko7qUwatMyF45QfLTV6vxv2/kpT+xS0Pf6IEO7M6T+R0QMGKnCkDfwU1si6/XaApUILXTQvoTRykrc10dmeTPFMJD6sCrrKsTgPfFVkh5exApeSXtUToXzpz24tWbiw==
ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is
 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com;
 dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com;
 dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1
 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com]
 dmarc=[1,1,header.from=arm.com])
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3lHEmkpXMa2uyIswJkRQ6NHRDOX+iQAljOHVIeoGEwY=;
 b=BIUrPygOVC9t+05OexclindTwNygMAWxOL70UjwWnFDlFLpWmL3XIWKg+OirWuaysc8xh6TXBV92ELrsL4zsCcL2AbcCnCjO0LF34KsoyiCNM91XQfYNkTvg0RaQXGw9QRiA9aKd3+aWMIS3WagaSTgrFgAJe5gUhqzZgPcV43w=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123)
 smtp.mailfrom=arm.com; dkim=pass (signature was verified)
 header.d=arm.com;dmarc=pass action=none header.from=arm.com;
Received-SPF: Pass (protection.outlook.com: domain of arm.com designates
 63.35.35.123 as permitted sender) receiver=protection.outlook.com;
 client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com;
 pr=C
X-CheckRecipientChecked: true
X-CR-MTA-CID: 58dfc2f987a37f44
X-CR-MTA-TID: 64aa7808
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=x6rLeLMPyJwdh9bI88XsVDiKWJmlm56UFeYh6M9xTrXN7gTci1sup+bhu2oEjOUolfgnV+TmDRJDpL2QFhUrkG9YkQMCFJ/6GbQWJ4prOIceKBsS8CuqyzgdgWErjkaFA7ZCMghHxIXjXwuVLNT9m9bSKCfqBK/eHmA+tlHR3hoItjvwtDIGv+CE3GAYALhiRRk9vyLGqqoKuPaXYhz515xCMvWqNDFHgOzlLsDEScNUb68yn4glz5/qPjhN7FEYLC+gEl2lkkX0XSODtSmQJnY9FLMdtnRgVrW3rHxEaOKgBOAFlKhDdqXJKPvZO3jNDyvDm75g9I2RVAR6/AJe4g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=3lHEmkpXMa2uyIswJkRQ6NHRDOX+iQAljOHVIeoGEwY=;
 b=VXG+8L2nOjV1q2tUmiwl5hv9MngUzd3G+cDC0/zGbM0SBvYM0ZaAF3VN0mn3Y5euqLhj7sZTW4AV/jzVk/YNtfAMp5NxLrMso+fdF7pW0Y85DLl/dOdHctHNyitwJ9MMNaUZkjA8nRuR9BiktlIYrAh8qGqzoXyt/WLomzjEcLRMZIQLZmllAqYdDKhy0PBG+Zbw/wEVP2OrK0vhv1rtP0q/Hea6RfPr812mavACa1OmrclpR+s6JG2RVPZVzK387N771UFKi2RvbqfA9n673maBx1lO64GKu7zTkcykteT34Rk9FnRPj+23B4njevHdCBVI9QlFLnR9piBoQkVBow==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass
 header.d=arm.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=3lHEmkpXMa2uyIswJkRQ6NHRDOX+iQAljOHVIeoGEwY=;
 b=BIUrPygOVC9t+05OexclindTwNygMAWxOL70UjwWnFDlFLpWmL3XIWKg+OirWuaysc8xh6TXBV92ELrsL4zsCcL2AbcCnCjO0LF34KsoyiCNM91XQfYNkTvg0RaQXGw9QRiA9aKd3+aWMIS3WagaSTgrFgAJe5gUhqzZgPcV43w=
From: Bertrand Marquis <Bertrand.Marquis@arm.com>
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
CC: Xen-devel <xen-devel@lists.xenproject.org>, Michal Orzel
	<michal.orzel@amd.com>, Stefano Stabellini <sstabellini@kernel.org>, Artem
 Mygaiev <artem_mygaiev@epam.com>, Hisao Munakata
	<hisao.munakata.vt@renesas.com>
Subject: Re: [PATCH v2] docs: fusa: Add requirements for generic timer
Thread-Topic: [PATCH v2] docs: fusa: Add requirements for generic timer
Thread-Index: AQHa+gcFR3YtqyGnJ0KBJ/zbYknDerI+JBsA
Date: Thu, 29 Aug 2024 12:08:06 +0000
Message-ID: <43971A3E-4DE6-4DB2-83A4-265DDC3A1747@arm.com>
References: <20240829113120.3980270-1-ayan.kumar.halder@amd.com>
In-Reply-To: <20240829113120.3980270-1-ayan.kumar.halder@amd.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-mailer: Apple Mail (2.3776.700.51)
Authentication-Results-Original: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
x-ms-traffictypediagnostic:
	DB9PR08MB6588:EE_|DU0PR08MB7884:EE_|AM4PEPF00027A6C:EE_|AM8PR08MB5747:EE_
X-MS-Office365-Filtering-Correlation-Id: 783c6fd7-b971-4252-cbb3-08dcc823efde
x-checkrecipientrouted: true
nodisclaimer: true
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam-Untrusted:
 BCL:0;ARA:13230040|366016|376014|1800799024|38070700018;
X-Microsoft-Antispam-Message-Info-Original:
 =?us-ascii?Q?j1564+aAxS/jTfpifIk843D1JPYURFSH7aytwY5qeBV1x62tFjy3NNTsnIgZ?=
 =?us-ascii?Q?y2uRZOLoXEveRKaFndXlpztmwN0INdXBmzzQwnVjPEt2k1grn16S/HZlDl0q?=
 =?us-ascii?Q?QLKxcwcw+51vLbADI3W6P2RhjhmbdxQt8Y375niNV+6YsQ4yzjFWk7FLRh+P?=
 =?us-ascii?Q?baWE0gOusBDjpCzGOzivXUSMOp/g9PwoCTybJHo+puTvMligZojR1N/AwORe?=
 =?us-ascii?Q?xXnOsBAEeaO+a8lsKSEdHyommAj+C9bRf9WZ+3J+/h1MjhXa4xIzsD+Q+w4q?=
 =?us-ascii?Q?2RWStYQuxudjYlqy9+MYzf2K9YMp/12GCQyCM4ZNMiME7ZecpWIGUUGdxNGs?=
 =?us-ascii?Q?9x+9mZFKtMuwyWQQIAmDbJbcmpgJpYXSEtTP/6Osndqa7XZl+krwhaOXH5Lo?=
 =?us-ascii?Q?pA99WZVirGGfcSTr/I2MGgmklKxYNZADvwsKPnyX4K0mUM7eMlV9okoJzFL2?=
 =?us-ascii?Q?MLyzvTlh4n5akwzl5QZig5/FPebTWb0ClFAIPt8kTiKfAlrnI64Vy775Z2jR?=
 =?us-ascii?Q?2Dxj2tAQI2kyKCiWzj8sUPK0EOpkTV6oH9grrM7wRtxw/dDt6tMGxy8yD13U?=
 =?us-ascii?Q?4f+6vEwiBe0pPVbFo8YIt/50VebPwZL7yQS8cf1Gt/RFZFdJmTdk6Lpvu9kV?=
 =?us-ascii?Q?S8mdZNH85fwWDEkKGeDgj0mD69mDppPUzSNrTCHCQAWJy3/2QONlRNEbr6rU?=
 =?us-ascii?Q?4b51FysMlxiNHg8QzQ/NHaiSTZ22W9ObusaIehspc3ljSquLu+nsCMqhgXBm?=
 =?us-ascii?Q?Y3DHgzhVUb0d8l3Pqfnq6W/CHuEbsSQgKzzPHv4LrvDSCIpxtLV0s+VzksH1?=
 =?us-ascii?Q?vEOm4MQ7tLTKQJXRRZyIVHbNtBOmr6SGTiJhd8QBjJ1m8VGMA/RTN5+ErpJL?=
 =?us-ascii?Q?ww9FtZMj7jtbNTYhIt1oV1XqkseFSXmpEWYtqMhDAIY7hoDPQYaXMwk407an?=
 =?us-ascii?Q?e9L4X3PtLCAWBX8U4ghKWDCoEdfF8awTCWS3D71txLuOnJaq//u2FJGUh94U?=
 =?us-ascii?Q?Kvei0MzZUURzTVpGv7oiuxJM7dptXfcFusAO9KtaQ9sHwcsYlosbzlNFqYCE?=
 =?us-ascii?Q?T0joXrL2nNwT0WO1DX1x6mF3+u4RUrKo3AIhscPaLemfkudK8IUi/FlWrp67?=
 =?us-ascii?Q?5lP97UeJLM2mm0igK2uAT+dhuJs3ipkJhrZxh1u9ceV8BJkd1ysCfYuHgbAV?=
 =?us-ascii?Q?ZWKaE+VEr1hbAls4a8FvuoVqKYhhjnid/LHST5++grLIkj2poq93FVycujV2?=
 =?us-ascii?Q?LhJakO4rDOkEBKkXNJ6QjhRHFAZkmr/gldHeyordqiv1OtZnxWC225vwmaC6?=
 =?us-ascii?Q?eeOLGTucLJibP4Qrlm9xR+njQx18gYHvVu1pljtyOOPm6Px29JbUIt7hNKqi?=
 =?us-ascii?Q?w6sJxb1L4+et583YcmRZlVh1GPSPbfozRSKKgwiXk+f/POuDBQ=3D=3D?=
X-Forefront-Antispam-Report-Untrusted:
 CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR08MB6588.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(38070700018);DIR:OUT;SFP:1101;
Content-Type: text/plain; charset="us-ascii"
Content-ID: <D73BCB5C183545458344D8B0F0116A31@eurprd08.prod.outlook.com>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB7884
Original-Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=arm.com;
X-EOPAttributedMessage: 0
X-MS-Exchange-SkipListedInternetSender:
 ip=[2603:10a6:10:25a::24];domain=DB9PR08MB6588.eurprd08.prod.outlook.com
X-MS-Exchange-Transport-CrossTenantHeadersStripped:
 AM4PEPF00027A6C.eurprd04.prod.outlook.com
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id-Prvs:
	37fa33a4-e105-49ff-9023-08dcc8233dce
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|82310400026|35042699022|36860700013|376014;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?wQJNkfk8Bbs5BsXl9D/cNhNoqLwP8W497p7chYLJtIgsNylSPAVhQ9xhQY4B?=
 =?us-ascii?Q?kndeGiPFyOepkhyHwiGDW+oRZ8v+eMsUWcFERLY15s7Xz3GzZPTBTkE+BeRW?=
 =?us-ascii?Q?kjAPaqJrVNRaEBMBB/mlgmB7eIcRqFKWGLR21z9qeFBVxqkauTA1CZ8XbuPL?=
 =?us-ascii?Q?mNVgr40pMHbk8BgPP6peb2BwP/CnRHLEv6Z6VY1Nt9EjNzYmtgmYexHQCA5I?=
 =?us-ascii?Q?hZgh5a8zaDPGIMLAUkMsCP9tyO9k0Ev8YX5JaomszW1wx+T9kCE16BKswFg9?=
 =?us-ascii?Q?pS6VdG+7+syKKvm32MG1CkSATLyAkXncZlsm6i7FJyfnFS+fF7h8bLwEob3J?=
 =?us-ascii?Q?pX1z43JtdIoD1ehilW86yUMo+4ouwZoGjdbhUwvEJn4y87tmGQVui/sK4c2O?=
 =?us-ascii?Q?ERuzlFohvwlUtDlzSezPRnS246If9NKDA5Dzmp822vc3em8M6TKheT4+SusD?=
 =?us-ascii?Q?Wryvr/t9doGrqvFmta1Hld6iHtnapYrDDQLQXcvjTXZvFbglYECuwUzia4Rq?=
 =?us-ascii?Q?An8CFgwbb9c+QM49PWsniSm+bh1C72wr9soC9lcn3TVbifyCXobN6Q19bGym?=
 =?us-ascii?Q?AlTpUuaGJ9ygUPf+nGqfFj1xhWiQrQrWMlUBxZpIyVH2AFyYKwKWXwFi0C4K?=
 =?us-ascii?Q?HQVprtgSvwe5Caa7R4HPMxKTNz+mKt6YTNkOv7lbzt2ilqR/9/QCm9Ikom8S?=
 =?us-ascii?Q?yqqcYAMGmq7g9rrSFckydY6HDUPrTQdmbyHUyB3ClGRzB85abMrJkNT7Uhb0?=
 =?us-ascii?Q?jG6sIFhiuwpIdoGtiM/uQPCd85lPBD0a1l7SiNv6/OaJtHsaSl0ntnwgpvsS?=
 =?us-ascii?Q?cXk++01144YT2l60dpZkcflDyR4FkBdLlObH7hghHOGNT24g6ln2nL6hWJS+?=
 =?us-ascii?Q?vCm4gngU2nnvFxZ4n6N0cOWMWj7aOEZT3a9SFkFtxqh4JCGlkjzEDiRoguhP?=
 =?us-ascii?Q?SeP1ng7ZvNMLzuo7gHWcoXk+QbFQxOiQUfWuYdehujhzfJuuMtxxjlnyw+ha?=
 =?us-ascii?Q?4sDIsZvCfd8mc/I4JH47kxBaiviP2g4XvI6+4UuCOyR+K1unw9cD97kyU+Mc?=
 =?us-ascii?Q?tn/RTl8q4LlsvCC2kg4utMpErdSGjfTKQefUv7QF7Dv5lJ/94Bm1r5+GOOTb?=
 =?us-ascii?Q?ea95hKy75kq6HzNx0iPPWDjs0T4tGr7LcsK7NII71BUacmeXFKxldJFLryYs?=
 =?us-ascii?Q?zzKqlSeMm9xCK++gzyGZRUOG874Erj+wXioxrEnj6BwD7dFHt/0/iHgNDKzX?=
 =?us-ascii?Q?lKXo9Tk2deZmq+AVXcN9Q/Hdt28p9g9FnWQ+iv5WV46jub3Xtay8ILuu5zqO?=
 =?us-ascii?Q?UOREwmAizV+oNlr38EUkDeVvtFcV6ZIvAMhRcXtKH/PkY4/tNHGnwzvA/pyX?=
 =?us-ascii?Q?w+Wg5ZM2faRnV21wq7qBA+T82fvIwvsnFuTL+xaaQVeXPkqtIwARi1O7LE9l?=
 =?us-ascii?Q?vV6u6omdtDZNeTqjcl7Zn7PZkdJCO2lr?=
X-Forefront-Antispam-Report:
	CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(35042699022)(36860700013)(376014);DIR:OUT;SFP:1101;
X-OriginatorOrg: arm.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 12:13:05.2909
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 783c6fd7-b971-4252-cbb3-08dcc823efde
X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com]
X-MS-Exchange-CrossTenant-AuthSource:
	AM4PEPF00027A6C.eurprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5747

Hi Ayan,


> On 29 Aug 2024, at 13:31, Ayan Kumar Halder <ayan.kumar.halder@amd.com> w=
rote:
>=20
> From: Michal Orzel <michal.orzel@amd.com>
>=20
> Add the requirements for the use of generic timer by a domain
>=20
> Signed-off-by: Michal Orzel <michal.orzel@amd.com>
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Cheers
Bertrand

> ---
> Changes from -
>=20
> v1 - 1. Fixed some wordings as suggested in v1.
> 2. Removed the comments which mentions Domain specific usage details.
>=20
> .../reqs/design-reqs/arm64/generic-timer.rst  | 123 ++++++++++++++++++
> docs/fusa/reqs/index.rst                      |   3 +
> docs/fusa/reqs/intro.rst                      |   3 +-
> docs/fusa/reqs/market-reqs/reqs.rst           |  34 +++++
> docs/fusa/reqs/product-reqs/arm64/reqs.rst    |  23 ++++
> 5 files changed, 185 insertions(+), 1 deletion(-)
> create mode 100644 docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
> create mode 100644 docs/fusa/reqs/market-reqs/reqs.rst
> create mode 100644 docs/fusa/reqs/product-reqs/arm64/reqs.rst
>=20
> diff --git a/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst b/docs/fu=
sa/reqs/design-reqs/arm64/generic-timer.rst
> new file mode 100644
> index 0000000000..f2a0cd7fb8
> --- /dev/null
> +++ b/docs/fusa/reqs/design-reqs/arm64/generic-timer.rst
> @@ -0,0 +1,123 @@
> +.. SPDX-License-Identifier: CC-BY-4.0
> +
> +Generic Timer
> +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> +
> +The following are the requirements related to ARM Generic Timer [1] inte=
rface
> +exposed by Xen to Arm64 domains.
> +
> +Probe the Generic Timer device tree node from a domain
> +------------------------------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_probe_dt~1`
> +
> +Description:
> +Xen shall generate a device tree node for the Generic Timer (in accordan=
ce to
> +ARM architected timer device tree binding [2]) in the domain device tree=
.
> +
> +Rationale:
> +
> +Comments:
> +Domains can detect the presence of the Generic Timer device tree node.
> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Read system counter frequency
> +-----------------------------
> +
> +`XenSwdgn~arm64_generic_timer_read_freq~1`
> +
> +Description:
> +Xen shall expose the frequency of the system counter to the domains in
> +CNTFRQ_EL0 register and/or domain device tree's "clock-frequency" proper=
ty.
> +
> +Rationale:
> +
> +Comments:
> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Access CNTKCTL_EL1 system register from a domain
> +------------------------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_access_cntkctlel1~1`
> +
> +Description:
> +Xen shall expose Counter-timer Kernel Control register (CNTKCTL_EL1) to =
the
> +domains.
> +
> +Rationale:
> +
> +Comments:
> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Access virtual timer from a domain
> +----------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_access_virtual_timer~1`
> +
> +Description:
> +Xen shall expose the virtual timer registers (CNTVCT_EL0, CNTV_CTL_EL0,
> +CNTV_CVAL_EL0, CNTV_TVAL_EL0) to the domains.
> +
> +Rationale:
> +
> +Comments:
> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Access physical timer from a domain
> +-----------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_access_physical_timer~1`
> +
> +Description:
> +Xen shall expose physical timer registers (CNTPCT_EL0, CNTP_CTL_EL0,
> +CNTP_CVAL_EL0, CNTP_TVAL_EL0) to the domains.
> +
> +Rationale:
> +
> +Comments:
> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Trigger the virtual timer interrupt from a domain
> +-------------------------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_trigger_virtual_interrupt~1`
> +
> +Description:
> +Xen shall generate virtual timer interrupts to domains when the virtual =
timer
> +condition is met.
> +
> +Rationale:
> +
> +Comments:
> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +Trigger the physical timer interrupt from a domain
> +--------------------------------------------------
> +
> +`XenSwdgn~arm64_generic_timer_trigger_physical_interrupt~1`
> +
> +Description:
> +Xen shall generate physical timer interrupts to domains when the physica=
l timer
> +condition is met.
> +
> +Rationale:
> +
> +Comments:
> +
> +Covers:
> + - `XenProd~emulated_timer~1`
> +
> +[1] Arm Architecture Reference Manual for A-profile architecture, Chapte=
r 11
> +[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/t=
ree/Documentation/devicetree/bindings/timer/arm,arch_timer.yaml
> diff --git a/docs/fusa/reqs/index.rst b/docs/fusa/reqs/index.rst
> index 78c02b1d9b..183f183b1f 100644
> --- a/docs/fusa/reqs/index.rst
> +++ b/docs/fusa/reqs/index.rst
> @@ -7,3 +7,6 @@ Requirements documentation
>    :maxdepth: 2
>=20
>    intro
> +   market-reqs
> +   product-reqs
> +   design-reqs/arm64
> diff --git a/docs/fusa/reqs/intro.rst b/docs/fusa/reqs/intro.rst
> index d67b18dd9f..245a219ff2 100644
> --- a/docs/fusa/reqs/intro.rst
> +++ b/docs/fusa/reqs/intro.rst
> @@ -55,7 +55,8 @@ Title of the requirement
>   be 'XenMkt', 'XenProd' or 'XenSwdgn' to denote market, product or desig=
n
>   requirement.
>   name - This denotes name of the requirement. In case of architecture sp=
ecific
> -  requirements, this starts with the architecture type (ie x86_64, arm64=
).
> +  requirements, this starts with the architecture type (eg x86_64, arm64=
)
> +  followed by component name (eg generic_timer) and action (eg read_xxx)=
.
>   revision number - This gets incremented each time the requirement is mo=
dified.
>=20
>=20
> diff --git a/docs/fusa/reqs/market-reqs/reqs.rst b/docs/fusa/reqs/market-=
reqs/reqs.rst
> new file mode 100644
> index 0000000000..9c98c84a9a
> --- /dev/null
> +++ b/docs/fusa/reqs/market-reqs/reqs.rst
> @@ -0,0 +1,34 @@
> +.. SPDX-License-Identifier: CC-BY-4.0
> +
> +Functional Requirements
> +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> +
> +Run Arm64 VMs
> +-------------
> +
> +`XenMkt~run_arm64_vms~1`
> +
> +Description:
> +Xen shall run Arm64 VMs.
> +
> +Rationale:
> +
> +Comments:
> +
> +Needs:
> + - XenProd
> +
> +Provide timer to the VMs
> +------------------------
> +
> +`XenMkt~provide_timer_vms~1`
> +
> +Description:
> +Xen shall provide a timer to a VM.
> +
> +Rationale:
> +
> +Comments:
> +
> +Needs:
> + - XenProd
> diff --git a/docs/fusa/reqs/product-reqs/arm64/reqs.rst b/docs/fusa/reqs/=
product-reqs/arm64/reqs.rst
> new file mode 100644
> index 0000000000..7aa3eeab6a
> --- /dev/null
> +++ b/docs/fusa/reqs/product-reqs/arm64/reqs.rst
> @@ -0,0 +1,23 @@
> +.. SPDX-License-Identifier: CC-BY-4.0
> +
> +Domain Creation And Runtime
> +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> +
> +Emulated Timer
> +--------------
> +
> +`XenProd~emulated_timer~1`
> +
> +Description:
> +Xen shall grant access to "Arm Generic Timer" for the domains.
> +
> +Rationale:
> +
> +Comments:
> +
> +Covers:
> + - `XenMkt~run_arm64_vms~1`
> + - `XenMkt~provide_timer_vms~1`
> +
> +Needs:
> + - XenSwdgn
> --=20
> 2.25.1
>=20



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 12:15:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 12:15:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785794.1195292 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sje3L-0007tT-Qi; Thu, 29 Aug 2024 12:15:03 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785794.1195292; Thu, 29 Aug 2024 12:15:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sje3L-0007tM-NZ; Thu, 29 Aug 2024 12:15:03 +0000
Received: by outflank-mailman (input) for mailman id 785794;
 Thu, 29 Aug 2024 12:15: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=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sje3K-0007tE-Ua
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 12:15:02 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 50f38c78-6600-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 14:15:01 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a86cc0d10aaso61275366b.2
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 05:15:01 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8989221c24sm71490766b.196.2024.08.29.05.15.00
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 05:15:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 50f38c78-6600-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724933701; x=1725538501; 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=BIcdrVvM45vUU1dn+CBgSjmywvRTg6UZEf81hF7tbHg=;
        b=Qj7we+bXVv5XAjw3G4e81biZ775J0Tl7Z/DIGxpmSzsTocI2BfG9SWihHfrlo1sRIa
         RAhRpvy+0NM9Cg8qwIq0eltDWK0lUUReZU73olbt2qQ4DwTHyCJp4AfK0z39M/xziJ0S
         a4ooub0lifGYh6O3Q9i/QeAG2UtFHFlYZKr0Tugu/EgMT42HJvvkG5UyoMHK+PkPs83h
         v1fV6VqfXdPfTY7N33gM54eQX2WvQ8ytA9JAFt/vhkNYcLfi7Z49HNoDzeM/4LICF547
         1NHB2rASotiG3UTGdovZ6qgz2zPG96v6x3pGBzfrq1kxQ+XdRi1vqMJMJFFzNtSKIeHQ
         Nxxw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724933701; x=1725538501;
        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=BIcdrVvM45vUU1dn+CBgSjmywvRTg6UZEf81hF7tbHg=;
        b=i0wSjAmpdX+BANkNOcDLbFAFhd9wUpQrhy3jKGBA6VYAVcythCVBkW8E/WmnHCHPQ/
         zIeHIX1mKTsEanhs6Sg47QCbpDOvSKeEuRJFTO5w/xqS08qNmdlsKoTItn8ElMnlJr31
         56pAMa/lPgODmbuGHyc7OeFusvdDA9gFj4httRTEaHGsnwOoJn0gyVDNeGbRM6gAK6ge
         gJhndT2TKyqx15xrJX/paJuJHdshL8UY/N5jwAWCgQRea1yk70gCjxN5RLu0ZWVOIvyk
         TE7QbiXsuvL3Ue6H2CHNXCxwMVIJeHsKKaE406zzk1tbR/sR7qlrbMjhQuLVrE0OuGl4
         BWvQ==
X-Forwarded-Encrypted: i=1; AJvYcCUpKTaEWbJNunll+gp4QGTJUkymnvfwSjq6GxTzsTandvGQOpugN9wfN1LO7bL+Duvpyg4krNCRkQg=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwrWt1rOBWAXmIyvntpLFke3hLNA8u8eU06UTi8yR5bf40ipCsH
	oGEERxDcFJ+9X/Z+xiktFn5HMZ7YDYk7LllVcafrwcjUL5WzPbh+6NzjnJr5Ww==
X-Google-Smtp-Source: AGHT+IGNr6pWQ6URETWBryaMqp4RV7NbD2SdHTSPYjluh7GN6d1PfP/B027t624509kejEHWPREwlg==
X-Received: by 2002:a17:907:7e92:b0:a86:7c6e:2bb9 with SMTP id a640c23a62f3a-a897f7892e8mr218934266b.2.1724933700901;
        Thu, 29 Aug 2024 05:15:00 -0700 (PDT)
Message-ID: <05a08778-7c3f-416e-a7ef-12a1472d3fce@suse.com>
Date: Thu, 29 Aug 2024 14:14:59 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 6/7] xen/riscv: page table handling
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
 <090e617d88b279ae88f1a7859875a7e1a0c6ae73.1724256027.git.oleksii.kurochko@gmail.com>
 <c0005454-3b34-427d-8ea0-620aba632487@suse.com>
 <ed84c53454cb63082aa96befe89a89d8f234ef71.camel@gmail.com>
 <b83e7d23-2171-447f-a4e5-48563e4068a5@suse.com>
 <4418002b93a3ae101e15e390dc537c726948bcb4.camel@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: <4418002b93a3ae101e15e390dc537c726948bcb4.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 29.08.2024 14:04, oleksii.kurochko@gmail.com wrote:
> On Thu, 2024-08-29 at 09:01 +0200, Jan Beulich wrote:
>> On 28.08.2024 18:11, oleksii.kurochko@gmail.com wrote:
>>> On Tue, 2024-08-27 at 17:00 +0200, Jan Beulich wrote:
>>>> On 21.08.2024 18:06, Oleksii Kurochko wrote:
>>>>> @@ -68,6 +111,20 @@ static inline bool pte_is_valid(pte_t p)
>>>>>      return p.pte & PTE_VALID;
>>>>>  }
>>>>>  
>>>>> +inline bool pte_is_table(const pte_t p)
>>>>> +{
>>>>> +    return ((p.pte & (PTE_VALID |
>>>>> +                      PTE_READABLE |
>>>>> +                      PTE_WRITABLE |
>>>>> +                      PTE_EXECUTABLE)) == PTE_VALID);
>>>>> +}
>>>>
>>>> In how far is the READABLE check valid here? You (imo correctly)
>>>> ...
>>
>> Oh, I wrongly picked on READABLE when it should have been the
>> WRITABLE
>> bit.
>>
>>>>> +static inline bool pte_is_mapping(const pte_t p)
>>>>> +{
>>>>> +    return (p.pte & PTE_VALID) &&
>>>>> +           (p.pte & (PTE_WRITABLE | PTE_EXECUTABLE));
>>>>> +}
>>>>
>>>> ... don't consider this bit here.
>>> pte_is_mapping() seems to me is correct as according to the RISC-V
>>> privileged spec:
>>>    4. Otherwise, the PTE is valid. If pte.r = 1 or pte.x = 1, go to
>>> step 
>>>    5. Otherwise, this PTE is a pointer to the next level of the
>>> page   
>>>    table.
>>>    5. A leaf PTE has been found. ...
>>
>> Right. And then why do you check all three of r, x, and w, when the
>> doc
>> mentions only r and x? There may be reasons, but such reasons then
>> need
>> clearly stating in a code comment, for people to understand why the
>> code
>> is not following the spec.
> So I remembered why R, W, and X are checked. There is contradictory
> information about these bits
> (https://github.com/riscv/riscv-isa-manual/blob/main/src/supervisor.adoc?plain=1#L1317C64-L1321C10
> ):
> ```
> The permission bits, R, W, and X, indicate whether the page is
> readable, writable, and executable, respectively. When all three are
> zero, the PTE is a pointer to the next level of the page table;
> otherwise, it is a leaf PTE.
> ```
> 
> However, it is also written here
> (https://github.com/riscv/riscv-isa-manual/blob/main/src/supervisor.adoc?plain=1#L1539
> ) that only pte.r and pte.x should be checked.
> 
> I can assume that the interpretation that R=W=X=0 indicates a pointer
> to the next level of the page table could come from this statement
> (https://github.com/riscv/riscv-isa-manual/blob/main/src/supervisor.adoc?plain=1#L1538
> ):
> ```
> If _pte_._v_ = 0, or if _pte_._r_ = 0 and _pte_._w_ = 1, or if any bits
> or encodings that are reserved for future standard use are set within
> _pte_, stop and raise a page-fault exception corresponding to the
> original access type.
> ```
> From this, I can assume that when pte.r = 0, pte.w should also always
> be zero; otherwise, a page-fault exception will be raised. ( but it is
> no obviously connected to if the PTE is a pointer to the next page
> table or not... ).

I don't view the information provided as contradictory, especially when
further taking the "Encoding of PTE R/W/X fields" table into account: W
set but the other two clear is "Reserved for future use."

>>>>> + * If `mfn` is valid and flags has PTE_VALID bit set then it
>>>>> means
>>>>> that
>>>>> + * inserting will be done.
>>>>> + */
>>>>
>>>> What about mfn != INVALID_MFN and PTE_VALID clear?
>>> PTE_VALID=0 will be always considered as destroying and no matter
>>> what
>>> is mfn value as in this case the removing is done in the way where
>>> mfn
>>> isn't used:
>>
>> Right, yet elsewhere you're restrictive as to MFN values valid to
>> use.
>> Not requiring INVALID_MFN here looks inconsistent to me.
> but actually if we will leave ASSERT in pt_check_entry() we will be
> sure that we are here with mfn = INVALID_MFN:
>        /* Sanity check when removing a mapping. */
>        else if ( (flags & (PTE_VALID | PTE_POPULATE)) == 0 )
>        {
>            /* We should be here with an invalid MFN. */
>            ASSERT(mfn_eq(mfn, INVALID_MFN));

Having such an assertion there is fine, but doesn't save you from getting
comments correct / complete.

>>>         memset(&pte, 0x00, sizeof(pte));
>>
>> Just to mention it: I don't think memset() is a very good way of
>> clearing
>> a PTE, even if right here it's not a live one.
> Just direct assigning would be better? 

Imo yes.

>>>>  Also note that "`mfn` is
>>>> valid" isn't the same as "mfn != INVALID_MFN". You want to be
>>>> precise
>>>> here,
>>>> to avoid confusion later on. (I say that knowing that we're still
>>>> fighting
>>>> especially shadow paging code on x86 not having those properly
>>>> separated.)
>>> If it is needed to be precise and mfn is valid isn't the same as
>>> "mfn
>>> != INVALID_MFN" only for the case of shadow paging?
>>
>> No, I used shadow paging only as an example of where we have similar
>> issues. I'd like to avoid that a new port starts out with introducing
>> more instances of that. You want to properly separate INVALID_MFN
>> from
>> "invalid MFN", where the latter means any MFN where either nothing
>> exists at all, or (see mfn_valid()) where no struct page_info exists.
> Well, now I think I understand the difference between "INVALID_MFN" and
> "invalid MFN."
> 
> Referring back to your original reply, I need to update the comment
> above pt_update():
> ```
>    ...
>      * If `mfn` is valid ( exist ) and flags has PTE_VALID bit set then it
>    means that inserting will be done.
> ```
> Would this be correct and more precise?

That depends on whether it correctly describes what the code does. If
the code continues to check against INVALID_MFN, such a description
wouldn't be correct. Also, just to re-iterate, ...

> Based on the code for mfn_valid(), the separation is currently done
> using the max_page value, which can't be initialized at the moment as
> it requires reading the device tree file to obtain the RAM end.

... mfn_valid() may return false for MMIO pages, for which it may still
be legitimate to create mappings. IMO ...

> We could use a placeholder for the RAM end (for example, a very high
> value like -1UL) and then add __mfn_valid() within pt_update().
> However, I'm not sure if this approach aligns with what you consider by
> proper separation between INVALID_MFN and "invalid MFN."

... throughout the code here you mean INVALID_MFN and never "invalid MFN".
Populating page tables is lower a layer than where you want to be
concerned with that distinction; the callers of these low level functions
will need to make the distinction where necessary.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 12:25:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 12:25:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785806.1195301 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjeDJ-0002Ly-Qz; Thu, 29 Aug 2024 12:25:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785806.1195301; Thu, 29 Aug 2024 12: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 <xen-devel-bounces@lists.xenproject.org>)
	id 1sjeDJ-0002Lr-NQ; Thu, 29 Aug 2024 12:25:21 +0000
Received: by outflank-mailman (input) for mailman id 785806;
 Thu, 29 Aug 2024 12: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=D0cO=P4=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sjeDI-0002Ll-35
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 12:25:20 +0000
Received: from NAM02-BN1-obe.outbound.protection.outlook.com
 (mail-bn1nam02on20618.outbound.protection.outlook.com
 [2a01:111:f403:2407::618])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c0337386-6601-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 14:25:18 +0200 (CEST)
Received: from PH8PR12MB7326.namprd12.prod.outlook.com (2603:10b6:510:216::7)
 by SA3PR12MB7877.namprd12.prod.outlook.com (2603:10b6:806:31b::12)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Thu, 29 Aug
 2024 12:25:14 +0000
Received: from PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264]) by PH8PR12MB7326.namprd12.prod.outlook.com
 ([fe80::6d76:9c33:d230:8264%4]) with mapi id 15.20.7897.027; Thu, 29 Aug 2024
 12:25:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c0337386-6601-11ef-a0b0-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=Jxvr1AVqJAqoL0LXdZdCiyZxOwSf8foTnamtta+qfmWbRgg/FPHleNhNVYE+C55a7DfBtlqvGLI+2+3YL3w5aBaufJouZMZ0tpTTdfSVehJTgFn0OvKnxeLUrBHBLD+tTI9kEd4QDrNTMQJ22Hv4giWMD8hrew34Q/bI8l5Q3kjw2CXS3oobjFgN/4Q/Tah9ZHb6fMhcFDpCvZalssGgcmwceHLjXZV45zhihiIIy6CHogxjXKv0d/2nseL6ScYDxA/0NhZJ/s8VE9na/aapaLbpMZIxNqIyhQ6b8zB2X6gvsJ7bKpUiFO4F9N7cr42M3UmcbLpzvw+bn897shcVZg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=PL+jn9OjPmLNJlqKfsE9y44CsGOuj/IRg4bxm5PdPqk=;
 b=O6EP+cY4PuRZ6DKitTFD/jaUWTIjkdH0ccH9ytqcbcUY092vIRc/slVXRKPELXuILsugVYQCmvKm/rdlOkTNA8c/tpTua4pNMOnVu5oGpURbFUngGVf/TClqBB/rISydxdweFFN2ue1IMNmmYggtGc3HWihzc1agkYikurp/kuPMjSbzf7l6+tzRa6NOi4FdF4yliiEt1w3fy6xYbMEzOnme+ignF2jmtrgNi+XhU38S/oo4ehJeFUIT2vhNuqCETmHNOY6/lF82vQh5DUlZmQc8nnIx+Y4GwhIRBq/2YhKG3Gf7o/IhtF8J/4TC8AccUNcy3S+Ac8RZek+26ivevA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=PL+jn9OjPmLNJlqKfsE9y44CsGOuj/IRg4bxm5PdPqk=;
 b=CnJ5ZayrXaXF+n/E4EyjtJtnemxcPvf5Ub3V/yDmZS7rvHgxUOAcwv303toE9tCBBdjE9EhAyixsZoqQYoD8SmQkAX9L0SEi3OtAZKxmWjEfjFfKr1st4+m9m2IqE/BTmvVyWOAFjFDBcvMjal+bkGTez2kyj5ldVvj6bbhyTsQ=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <138347b2-e2b8-44d8-961f-cea212f1ec37@amd.com>
Date: Thu, 29 Aug 2024 13:25:07 +0100
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] xen: make VMAP support in MMU system only
To: Jan Beulich <jbeulich@suse.com>,
 Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: Penny Zheng <penny.zheng@arm.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Wei Chen <wei.chen@arm.com>,
 Julien Grall <julien@xen.org>, xen-devel@lists.xenproject.org
References: <20240821122503.2315844-1-ayan.kumar.halder@amd.com>
 <20240821122503.2315844-5-ayan.kumar.halder@amd.com>
 <cd2e6b08-ce76-4707-831a-c21b05ca85cf@xen.org>
 <6d065949-dfae-41f8-b030-c7d09516846b@amd.com>
 <ec35f90e-d999-49a5-b3c3-79aa32689687@suse.com>
Content-Language: en-GB
From: Ayan Kumar Halder <ayankuma@amd.com>
In-Reply-To: <ec35f90e-d999-49a5-b3c3-79aa32689687@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-ClientProxiedBy: LO4P265CA0007.GBRP265.PROD.OUTLOOK.COM
 (2603:10a6:600:2ad::23) To PH8PR12MB7326.namprd12.prod.outlook.com
 (2603:10b6:510:216::7)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PH8PR12MB7326:EE_|SA3PR12MB7877:EE_
X-MS-Office365-Filtering-Correlation-Id: da329a71-95a1-47c2-da79-08dcc825a1e2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|1800799024|376014|366016;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?dkkwQkFIVEc3ZUg5ZExLRXFFMFlEY2FIdzdJNGJ4ZHIzc0EyMGNQQU5QMVl1?=
 =?utf-8?B?bXpid1ZtRXQ1UDBaUUViYnhhVmdTUkMzdldzeU9LR1I1UzFuS3BYQzRHb2hN?=
 =?utf-8?B?TERFOVhGS0UzYXRCUkdmZHlvRkpaRC92ODFYUkptMzJESGprMlZVUGFhMEo5?=
 =?utf-8?B?N04rL2JpSStlUlB5b3hzamF1cHJJUnlWbE9PVWExZitOdzFhSjZXZ1hXLzMx?=
 =?utf-8?B?Skd6NCtjeXJzVjZMVDhlTXl5RDc3MTdYS1M5WjVoU0FweXA0cWpDVlMybnBj?=
 =?utf-8?B?MTYzM2RhUGQxWEJYZ2YySU5zSnNKQ1JUbGhxaFJDR21NdjFWdmoyelY4VEg2?=
 =?utf-8?B?RU83bWJmTElUK1ZVMGhvY2lSalRrOUJYT25DRzhCbmxWMktHR0g0RlZTRUFJ?=
 =?utf-8?B?WFU5bmxwVGdGbXNqZXZ0OTlUMUtGSUlhMlFOUHlMMDFKNkhsM0Z2SnNJS3V0?=
 =?utf-8?B?VUtZUjkwMWlja0g1ZjJSQjk2QUM2Y04xR2UxYTJCYzlCbjhxRlFrd3BlNStJ?=
 =?utf-8?B?dzlaajEzYWFUTFZFRXBWdE9BV21aRzhJZzZFUUh5WkxCOHZueG1nWG5GK0p2?=
 =?utf-8?B?UXppamp2NUc4elNUc1B2MzVieUNVbnIrQmhFTWVIMTYwNW1mZ0szc1loYS82?=
 =?utf-8?B?c1ZEcmhnNnV1TDVQTUlxRERYWUtYNEwvT3RnOHRUU3FoQUZub1RvMHhjcnBn?=
 =?utf-8?B?YTd3VW56UFJSa1pZcTRIU2JIYzg5S05kK0xDYXl3d0ZaS2JJY0Y0SG9pZWtQ?=
 =?utf-8?B?RTBjdjRRNUM0Uy84ZXBEWkhyanlxU29KODR2aTM2dTEwMDltbjBlWHFJSDR5?=
 =?utf-8?B?WmZveXc1SWV1RVVtaGdEYWM4ZFQ0UDBJOTNQcnlMd0d6WGtDaDNrc3ltamx0?=
 =?utf-8?B?VnFzYVpVWU1ISGxmK3lOSXpoT3ZnMVVLWWdoQlFTWTFEaEFNeklmV09CTjdY?=
 =?utf-8?B?bXhDWmZIUnEyWDQrRjJzUlJzV2hnSGtOY09wMUdjcmNwaGszeTRxWjU2RVlj?=
 =?utf-8?B?cTBmM3QrRjFpcWRBN1cvcXYrUmVqMTEwQmQxcVVXTWszS2lGSVdCZDZpRXZv?=
 =?utf-8?B?ZGU5MFprTjVZSWhpaEgvalp5M1hudER5R2hNV0s3Rzhza3A2em1TTWNuUjRC?=
 =?utf-8?B?VEc0Ym1LYXZJY2hqQW1xRXhDczRDN0dGdURNZnJkQVpTeWN5YUR0TXlXKzZO?=
 =?utf-8?B?Y3pONFRqbUFGaEFWRkdkNndCb2pSWkg4eENSTHBOMWgzTFVySC9lY2Nvd0Ew?=
 =?utf-8?B?MHVndVZjbkVhVkN5RElYdm15Um5sNlJQb0cvVkExRmFnbGk0M2ZqSUh6Q2ZT?=
 =?utf-8?B?dUtNUnJ3TGdPSW03WWJ1WVJEdlR4Z01rUHorUko1emM0a3QwSVA0TlpWUDF3?=
 =?utf-8?B?UnlKL250cXBsbW9SdXo4Q0Z3MGI5OWV0NmtyaWd0Q3JlcnpuWGNPdzhDUUJP?=
 =?utf-8?B?d1NqWU94blJHWHhHdU1VQSs4YnpFTlRKUEpURU0ycW9aRXdrTEFVN084NFJC?=
 =?utf-8?B?aW9tN3RDVXN2a2hiVzQ0em5UMldjNTNHTGNOVDRDSE9hcVE4N2JDcjlMUGMr?=
 =?utf-8?B?c1YrQmV5UDdOQk9kN2MydEFWSll4NU4ySlBlNHRjSktSWGNJeFJiUjBTNStF?=
 =?utf-8?B?N0pxSDVkSk1KUWRMZVRiZ0NMcU9Ea2NYY1ZrdTFmMWJ0NVBIWmthUVU5NXVq?=
 =?utf-8?B?eldFRWNhcHROOXRYMmVsNE9pQ2MxYjJmV25LY21HVXU0NkdMSVIvaldUTjVh?=
 =?utf-8?B?TnNBcXlTbFZYbURPNnFQOTQ4VzdCRGVTZHJyS2M0MkFNQmVEaFVCWFVxOUN2?=
 =?utf-8?B?V3ErN0pjM2RLUFFsQjFTdz09?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH8PR12MB7326.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(1800799024)(376014)(366016);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?MmZUSjlCa0JsQWhWR1VkaDN2MFB0NklTM0MydC84YVZsYkRSL1VDdTJiMFk2?=
 =?utf-8?B?KzU5eTBCY0VCc0NGMU1UK0FSa1pheXFYTmkxb0ZxYjdsT1hJNjhxb09OWHox?=
 =?utf-8?B?TFdidGxlMVlzTys2L1luNTlNNnY5MWM5RFE2L3B5T3hUWjJ1RVRZWXhlWU1y?=
 =?utf-8?B?TDFMc2NNSFR0T2hhVDh6cy9Lb0JmRGJMci9mbXlhU3FPZjlvK2MybjVvbjlL?=
 =?utf-8?B?TnFQdzByaHkwUnp2WmhxemhPOXRoMDVXbWZLNlNDWWRrakovLzVob1d3bEh3?=
 =?utf-8?B?Z3NJZUlKL1ZtUHZ4aDFLSE5aUTY5U0Y2S0N1clN1UnRoTzNWMEFyUmxoNGhH?=
 =?utf-8?B?aUZPWTU5dk1XZ1RWMFZNTVd0dUxtNTdqVnZTTlVTZXJGaCtSbU9WMGU5NWVq?=
 =?utf-8?B?NTF1YlpkYUkxL2pRcWswNExOcEZnQTRjRXNFbkZHZ3JIRnQ1Sm85L29RQzdH?=
 =?utf-8?B?dVJEVzhMSnpJU0JqZmhObkFxWjZCMS9FRlF5Y0VlTDNmdHk1ZTNSSExML1U4?=
 =?utf-8?B?QVc2Ukg5RXpLMHpWYmdQRk1ISGg4V1BPa01GRXFaZEtPdVJrSk03QnlWQnhU?=
 =?utf-8?B?c2VWZkhJZEdYM0V0R1BEK3FDQlBqUlNEUStLSnFwQTFySmNtMDMrS0NaTnBp?=
 =?utf-8?B?RXhrVmxTNVFoVnBZZEQxVWpyWUpha1daSlpqeGpNQmFsdnhoVnZzS2k4N2l6?=
 =?utf-8?B?bHJrNjFuZk1od1JBK0xPQ05SdXR0THZ1MzVmM3dmWmtLY0NOQkNma05FckZU?=
 =?utf-8?B?SUJUcjVxdEhhdEthaURQcUVhQVRLaDRBcEs2b2ErZ0pNd0xMNzh6M2NBZHlK?=
 =?utf-8?B?cXUrZlVWRE55M2R4cHpyZmY5MjhOZ1J3RjgvRHRVL3hoVnZhRUZPdDBJdWdp?=
 =?utf-8?B?ZE1VVkgxc0JQR24rZXYvTTU5TmdmM2hSRmV5aGU4V3ZPV2RDM2sxa3grV2xq?=
 =?utf-8?B?Rk45ZVhuUStNbFU5WlRDUFJ3TFFUSkN5YkRmSjZBL20ySGgzVVlnWEtqYVpB?=
 =?utf-8?B?WmN1dHM1YVlMdkJPS0dXU3RIaW9aV1oyclVRNVhmOTEzRFZTd0FCam9VcjJX?=
 =?utf-8?B?Z1FBN0c0aGZiUlltTzg0aWFXKzRuRkhBb2s1bWxlZ3VjNFY0Y1F3QmZiMHIx?=
 =?utf-8?B?NFB3MkxnMVcwbk9vTDVIOUt3d0cvcTFRb1VoWHRKcVNjOCtJQldqcXMwZXFW?=
 =?utf-8?B?NGprRXdDMll3QzcreXplcVlSc09VR2FKZUNWMVhHWWlKdDlOTlFjalpVcmRu?=
 =?utf-8?B?OGlXQUs5bVYyMENDaEVYWXFWYk0reVBtbVBzdjB5VzBQemd5a3RDZkRzSkV6?=
 =?utf-8?B?aHFzNU5JYktjQ1BYeUtjU09UUXZGb21lRVhNNk0wa01FR2cySWJIZFM1ZE9L?=
 =?utf-8?B?OTYzM09FV2sxOVMvcG4yRjVQTzE1anNxdGw4bUlNajhVZDU0ODZUUjE4a1dO?=
 =?utf-8?B?QkNZQXh1R05KVEJxMi9EdWxhNG80TXRHQ3FaUThacXR4QmttK0ptQjJkRlV0?=
 =?utf-8?B?YzRtK2xpMm9jZGRWdlNsejByRXB6NU5XVnIybjlKK0xkTDFxQnczLy9ZMk1L?=
 =?utf-8?B?a2NLM3VjYzZpMG1uSWxTMnNHZFJaYkJkRVhoL3ViSTAvaEpyMXpGUkVRbk4y?=
 =?utf-8?B?QVpRUks2cjlrN0JZSzBoZWh1YVl4MmhKYk04TkcrY0pGdmxVMGdHYmhIOWY2?=
 =?utf-8?B?UnU4ZGwzQzVhSEtpeFdnQ2U3aWlvaW9IZExBMmJnRHZYWldmVTcraXNkVWow?=
 =?utf-8?B?VjlDaWlkaXZocFJJakdGTXNYTVRkWUFNOVVLby9MaFhrUWh0ekhBQlRTZzVH?=
 =?utf-8?B?cGIyRStEZk1oWmh3aExpVmN0RkNKM0VnSCs1Qk9EUDRpNmVteWFtbkZ3Uzg1?=
 =?utf-8?B?QWdlajgxdXA5d0krSzFpZ1lVVlZ1amRONFdDbVZreGh3eHZwTk5tU0M5djBn?=
 =?utf-8?B?bGd6b1Y0SStBbEYyWXM1R2taaUQ1OFFWS2xBRXpUVzB0Y2pkenk3VFVkeXZw?=
 =?utf-8?B?cFdyR1pwaVBHMUMxMjhmcDBXaS9OSDRjczltTHcySlpuRnFiZmZnZ1dNRWFT?=
 =?utf-8?B?Z1lmSjJwVE80RjFJdTJKQTJYVFVNS2hLMHlCTDVZQ2dDdi82dGxnVG0zYkNm?=
 =?utf-8?Q?xMMDoha4NREYKDPFyuO2VWdNS?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: da329a71-95a1-47c2-da79-08dcc825a1e2
X-MS-Exchange-CrossTenant-AuthSource: PH8PR12MB7326.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 12:25:13.7745
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: Uv48OPBuEBd/VYlDk+vqBr5D1f2FPusV8whqIY5J+52VPJ7QJTQJhw9gSZwKM/qCUSWOlAUgaaBrjyJg/lNp+w==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7877

Hi Jan,

On 29/08/2024 08:54, Jan Beulich wrote:
> On 22.08.2024 12:52, Ayan Kumar Halder wrote:
>>    I will update the commit message as below. Let me know if this makes
>> sense.
> Certainly better. One more question though:
>
>> ```
>> xen: make VMAP support in MMU system only
>>
>> Introduce CONFIG_HAS_VMAP which is selected by the architectures that
>> use MMU. vm_init() does not do anything if CONFIG_HAS_VMAP is not
>> enabled.
>>
>> HAS_VMAP is widely used in ALTERNATIVE feature to remap a range of
>> memory with new memory attributes. Since this is highly dependent on
>> virtual address translation, we choose to fold HAS_VMAP in MMU. And
>> ALTERNATIVE depends on HAS_VMAP.
> What is "fold HAS_VMAP in MMU"? I see no folding anywhere. My only guess
> is that this means to describe the "select HAS_VMAP" being added to MMU.
> But then why the word "fold"?

Sorry, I used the incorrect word. Rather I should say

"... we choose to make HAS_VMAP selected by MMU. And ALTERNATIVE depends 
..."

- Ayan



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 12:36:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 12:36:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785812.1195311 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjeO3-0005HN-Nu; Thu, 29 Aug 2024 12:36:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785812.1195311; Thu, 29 Aug 2024 12:36:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjeO3-0005HG-LE; Thu, 29 Aug 2024 12:36:27 +0000
Received: by outflank-mailman (input) for mailman id 785812;
 Thu, 29 Aug 2024 12:36:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zolI=P4=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjeO2-0005HA-MM
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 12:36:26 +0000
Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com
 [2a00:1450:4864:20::52a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 4e20789a-6603-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 14:36:25 +0200 (CEST)
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-5bed72ff443so671232a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 05:36:25 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8989221df2sm73595966b.203.2024.08.29.05.36.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 05:36:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 4e20789a-6603-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724934985; x=1725539785; 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=/FjugODqD6da7Mk89MMdO22rG59CJpH4Ye7qMr1QT70=;
        b=lys7SDp5lP0Au1jOXCtAz8jIj85UMkTTvyOoCT1sUPqTwrFmTNwZgZU75AhuQZsXCP
         NERoLylsLefCkjmmUlUAVWir7LOVFKqpo++8uCkJ3W9uxia5/gmuJqelDQ5pTGOi/qkf
         HL/ZcpKQ9GamLwyB5lhBhBzTBw7uvngMKiNHg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724934985; x=1725539785;
        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=/FjugODqD6da7Mk89MMdO22rG59CJpH4Ye7qMr1QT70=;
        b=XKeXMO1BvGCY7lXJOyPw6Wx1BhADUj/bcZmTr/2KNdZZBryl+93PVwPERB9Q4+b79/
         pLyZfqDNt/4Rep0Mm2fHOlOKyimy4FuPl7tjzd/kKyWH5FaY7rMFLK6+dnNZoDavKo3c
         9sPd762nllwKJjsjTDmokzdIItSHRzC0fuo4ErTUBuXD3PAHjqCdxtky6zD8JRtd8ztC
         72iktWXw8CmbTrAE5lF1xt7tmWftqwo//rBXi2DRkMT+0S1nuNehpuMpu2ghnqV8TBy1
         iOqfXt6d9XH9We8oWp06Jt7VzHWc6CQkfLUDv12Y5O/N4P6nbvAUumxzPAO4fAG5Q+HU
         S9Nw==
X-Forwarded-Encrypted: i=1; AJvYcCUmToNbJmIl1Hbra7sYTK1E6y5RUCz3aVC0PYLKkmBc/WnshHHMIbPRH9RJEGeS70LRapNmS5tsGyg=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw2n8o3cgaFar8am4NncRSZtOBTs4c4MQN1qAhUEqlO0r/fiOG7
	+IfXNqzJ0hyXQtWqtk66FR+ZvnKNW6Q9rXAbQLiX0h1QzqILL7mJKcxx+wlqLyE=
X-Google-Smtp-Source: AGHT+IHkVSa7CgTeB6ju99yEblz4BMEvAxbiJPdZeW6REeu8csg9j1vma1rNwrtj7VSI0KgTUjormg==
X-Received: by 2002:a05:6402:13cc:b0:5c0:a9ae:d333 with SMTP id 4fb4d7f45d1cf-5c21eda0d69mr2173653a12.37.1724934984535;
        Thu, 29 Aug 2024 05:36:24 -0700 (PDT)
Message-ID: <9b9d9c98-26cf-449d-ac9e-bccff439b0cf@citrix.com>
Date: Thu, 29 Aug 2024 13:36:22 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 2/5] types: replace remaining uses of s8
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Julien Grall <julien@xen.org>, Stefano Stabellini
 <sstabellini@kernel.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>
References: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
 <e6341c57-cf0d-46c5-8582-a84af515a650@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <e6341c57-cf0d-46c5-8582-a84af515a650@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 29/08/2024 12:59 pm, Jan Beulich wrote:
> ... and move the type itself to linux-compat.h.
>
> While doing so,
> - convert __read_mostly to __ro_after_init for respective variables
>   having their type changed (for acpi_numa add the attribute anew),
> - in cpuid_hypervisor_leaves() drop a cast altogether,
> - switch an adjacent struct arch_irq_desc field to bool.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

The __read_mostly -> __ro_after_init changes are safe as far as I can tell.

use_msi is in desperate need of renaming to opt_msi.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 12:39:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 12:39:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785822.1195322 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjeQi-0006iy-5a; Thu, 29 Aug 2024 12:39:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785822.1195322; Thu, 29 Aug 2024 12:39:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjeQi-0006ir-2b; Thu, 29 Aug 2024 12:39:12 +0000
Received: by outflank-mailman (input) for mailman id 785822;
 Thu, 29 Aug 2024 12:39:10 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zolI=P4=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjeQg-0006il-6K
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 12:39:10 +0000
Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com
 [2a00:1450:4864:20::635])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id af34a100-6603-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 14:39:08 +0200 (CEST)
Received: by mail-ej1-x635.google.com with SMTP id
 a640c23a62f3a-a83562f9be9so58120766b.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 05:39:08 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8988feb31fsm75915966b.17.2024.08.29.05.39.06
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 05:39:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: af34a100-6603-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724935148; x=1725539948; 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=nPfiqSPR1uayb7Dclvg8XwOKMTWX9m7qnQT7ztGN+QI=;
        b=U+ppLHE/78CewLaqIAVnMmXZqD4aCpeJC5SG2nvBjbgeS8Xlby6sfzZwD4MIVIR7pH
         0L2wsEDKI++qFJiIYuLHNK6uCZvPTNHVH0s2wx4SUnE3oyqAcrSWUL7jNpbZC7lYupmo
         7dXJlYwjA+VjMiWJR7kF0oX+D85nYAZu1rDp8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724935148; x=1725539948;
        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=nPfiqSPR1uayb7Dclvg8XwOKMTWX9m7qnQT7ztGN+QI=;
        b=BiRm3IKmYuo7xr1FYPP9xJ7iyNVLuseUlqjUaYxhlJGQ7e5fJzVw7h4ULQUF2gAw+D
         3INKO32V5B8FpXFGkp2QTG+PIwxeRLrKn+UtmrphsKNQcQqE5Xj2MhB0O/GxH1Jkyq8G
         VyBd00/0uu//v5hqi/c8WIkrp9AF1o58i45c5sBJW17a/cO6iCwJbafaGDdbTEgItvnp
         6wWThA2Gpm5IhxipKkoYcBBnqD6ZL4z19GXkR4zacVDBBVhJZOSHAS6jvQzu7/4QZlMt
         yfujREWoOAuFLWqwIj3ch+Hexd7gR9RUASeaSfiQYLeVd1z3Mhg7/bGVGcqAoEvwtxBJ
         tNLg==
X-Forwarded-Encrypted: i=1; AJvYcCWoHkDuCLbKQdbAgHcASH/VDjpwkbbga2u/3KC+BX/10pi0HdGgjjgy/Gn6nL2gb7A1XNNfRnDXbJ8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YytY7FxhprZui23CNiy/tiYY3HVmfQrhVsvVLS5mHS39IFeamL4
	6C/RM9df5pB+texRKc1mWCx3LssUmHKXE7uUm6s8hNErOBuG2I/kaa9pI0wQDUc=
X-Google-Smtp-Source: AGHT+IE9PagEgqgmlXKVnFPR2loidaMmOUYB4xqQN95CniiVbOYJsw2N+6pZANslt3wxvn3Y3si7ug==
X-Received: by 2002:a17:907:3f8a:b0:a86:743a:a716 with SMTP id a640c23a62f3a-a897fa744b6mr181230466b.53.1724935147196;
        Thu, 29 Aug 2024 05:39:07 -0700 (PDT)
Message-ID: <f7d01882-3218-41c5-9dff-965c0fe83107@citrix.com>
Date: Thu, 29 Aug 2024 13:39:05 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 3/5] types: replace remaining uses of s16
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Julien Grall <julien@xen.org>, Stefano Stabellini
 <sstabellini@kernel.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>
References: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
 <a3c8c66a-3b90-49e3-bf49-b73fa05a1f64@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <a3c8c66a-3b90-49e3-bf49-b73fa05a1f64@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 29/08/2024 1:00 pm, Jan Beulich wrote:
> ... and move the type itself to linux-compat.h.
>
> While doing so switch an adjacent x86 struct page_info field to bool.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 12:42:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 12:42:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785827.1195332 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjeTW-0008BG-Jg; Thu, 29 Aug 2024 12:42:06 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785827.1195332; Thu, 29 Aug 2024 12:42:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjeTW-0008B9-G2; Thu, 29 Aug 2024 12:42:06 +0000
Received: by outflank-mailman (input) for mailman id 785827;
 Thu, 29 Aug 2024 12:42:05 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjeTV-0008Az-CS; Thu, 29 Aug 2024 12:42:05 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjeTV-0003Fg-2L; Thu, 29 Aug 2024 12:42:05 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjeTU-0001TP-FK; Thu, 29 Aug 2024 12:42:04 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjeTU-0008Q9-Eo; Thu, 29 Aug 2024 12:42:04 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=26hgDvGlVP0BC7dNgUGTYtCaCiwQRafayvNAMigYLgA=; b=Me1VmCHwiWK+1/0gTNfy1CP7JP
	ZVevsobhlxW1qvR9reWzKGq9AlviHikk5veB/NpFG7XuBAGZYvTL0w7L2xOSh3Iodx2hLfpFbNv/h
	OTHWrdbPZL9Dob3emf4xouHv1Ie7UKwQ2j8loSK4XiO8jyT3rgKL6sc6D71LrX2WYYs4=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187402-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187402: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=bb248a95091ab542440053d9c289a97e80eb6630
X-Osstest-Versions-That:
    ovmf=31f022500549f1d862af531da704a9b3c6568ff5
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 29 Aug 2024 12:42:04 +0000

flight 187402 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187402/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 bb248a95091ab542440053d9c289a97e80eb6630
baseline version:
 ovmf                 31f022500549f1d862af531da704a9b3c6568ff5

Last test of basis   187398  2024-08-29 06:13:23 Z    0 days
Testing same since   187402  2024-08-29 10:11:27 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Oliver Smith-Denny <osde@linux.microsoft.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   31f0225005..bb248a9509  bb248a95091ab542440053d9c289a97e80eb6630 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 12:44:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 12:44:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785837.1195341 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjeVh-0000NX-2Q; Thu, 29 Aug 2024 12:44:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785837.1195341; Thu, 29 Aug 2024 12:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjeVg-0000NQ-Vk; Thu, 29 Aug 2024 12:44:20 +0000
Received: by outflank-mailman (input) for mailman id 785837;
 Thu, 29 Aug 2024 12:44:19 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zolI=P4=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjeVf-0000NK-E8
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 12:44:19 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6783802a-6604-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 14:44:17 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-5343eeb4973so970276e87.2
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 05:44:17 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226ccff2dsm670923a12.76.2024.08.29.05.44.15
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 05:44:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6783802a-6604-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724935457; x=1725540257; 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=kGPKwiNAmHKwo1v3eCOZXL043wrQcm3nXEP4rh3wZco=;
        b=WQOpUvyaOOK0fdWHNbrRdERCI29uy+OOjslnkqYVBsznaSdCyZpNvXJhPL4wiIbNwk
         EWe+v66ZRppihHQNolkgZBaZ57JkLTDvYlw2QDjDqw2IOUl3FkBTkynGYXp/T7qBFeTM
         nhgOl1ke7L4JjxbwBJQRJyp/PCRmx3pFRISdw=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724935457; x=1725540257;
        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=kGPKwiNAmHKwo1v3eCOZXL043wrQcm3nXEP4rh3wZco=;
        b=p0T2K6/lOZezDBIP3QIA/lAIpmdglIVKzBwovoXf0NEOcvn7jGWqRtsqvKcJXoQGwR
         9fQNfgbgPpdTFDlqZm1EGEC+1kLK7DfGiMxwJIVNzwbvnalxUhwJZJr0ORBTEAeuerPp
         zcbS284A3XXLcjs1KZvHOjB3SnAGiSELsxAaE/7yb+VyTkSVlJbscA4jqN4COeKoLVAc
         cEw4KvRe//J91EcK8BCDLTnE9TDSAKKILUNtaW85f79mn/xhPk7Udl5DNNvtFXu6CKeS
         PMIWLxg+T3r6RpB3ukK8hE3tfSaKgfZzcPeVxEvyI7FB7qL9uz/UZ0CcaQJaehOERfwt
         l37A==
X-Forwarded-Encrypted: i=1; AJvYcCWgvM5aGttzjIOrRZevLwdHofTI+9NrmIHEXDg8GBM9lVbTajb0+MgSAEFOz9XK4jiQWim4aB/XqaE=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzppKuaSgVd2VjK+2ecXgRVU3CZZD7Qy/AX/A5fbx0YUnofndsI
	OQZrnGV0yWUqYt+JSFbM/nydvlahTPVvEU0SoDIklZz1/wHczPkZhqXoNaUrumI=
X-Google-Smtp-Source: AGHT+IE2AAM02kHEuXjnrTFagwWEj9XkAq1XEKQqbZNRtcqiDpR4+ldcZzI32ACbnruDJi7rzNfpTw==
X-Received: by 2002:a05:6512:3b21:b0:52f:cd03:a84a with SMTP id 2adb3069b0e04-5353e5acd03mr2568880e87.39.1724935456358;
        Thu, 29 Aug 2024 05:44:16 -0700 (PDT)
Message-ID: <3fa09b21-fb7e-4b3c-91cb-d47c25608771@citrix.com>
Date: Thu, 29 Aug 2024 13:44:14 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/5] types: replace remaining uses of s32
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Julien Grall <julien@xen.org>, Stefano Stabellini
 <sstabellini@kernel.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 Daniel Smith <dpsmith@apertussolutions.com>
References: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
 <0e6b7685-e061-4ace-88fd-86728d765e5a@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <0e6b7685-e061-4ace-88fd-86728d765e5a@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 29/08/2024 1:01 pm, Jan Beulich wrote:
> ... and move the type itself to linux-compat.h.
>
> While doing so switch a few adjacent types as well, for (a little bit
> of) consistency.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>, with a minor
formatting request.

> --- a/xen/arch/arm/arm32/livepatch.c
> +++ b/xen/arch/arm/arm32/livepatch.c
> @@ -41,11 +41,11 @@ void arch_livepatch_apply(const struct l
>           * ARM DDI 0406C.c, see A2.3 (pg 45) and A8.8.18 pg (pg 334,335)
>           *
>           */
> -        delta = (s32)func->new_addr - (s32)(func->old_addr + 8);
> +        delta = (int32_t)func->new_addr - (int32_t)(func->old_addr + 8);
>  
>          /* The arch_livepatch_symbol_ok should have caught it. */
> -        ASSERT(delta >= -(s32)ARCH_LIVEPATCH_RANGE ||
> -               delta < (s32)ARCH_LIVEPATCH_RANGE);
> +        ASSERT(delta >= -(int32_t)ARCH_LIVEPATCH_RANGE ||
> +               delta < (int32_t)ARCH_LIVEPATCH_RANGE);

Could you vertically like this, like it is ...

> @@ -203,8 +204,8 @@ static int perform_rel(unsigned char typ
>           * arch_livepatch_verify_distance can't account of addend so we have
>           * to do the check here as well.
>           */
> -        if ( (s32)val < -(s32)ARCH_LIVEPATCH_RANGE ||
> -             (s32)val >= (s32)ARCH_LIVEPATCH_RANGE )
> +        if ( (int32_t)val < -(int32_t)ARCH_LIVEPATCH_RANGE ||
> +             (int32_t)val >= (int32_t)ARCH_LIVEPATCH_RANGE )
>              return -EOVERFLOW;

... here?

I'd argue that even this one wants one extra space in the middle, so the
'-' is further to the right of the >=.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 12:45:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 12:45:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785842.1195352 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjeWw-0000tg-Cz; Thu, 29 Aug 2024 12:45:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785842.1195352; Thu, 29 Aug 2024 12:45:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjeWw-0000tZ-9M; Thu, 29 Aug 2024 12:45:38 +0000
Received: by outflank-mailman (input) for mailman id 785842;
 Thu, 29 Aug 2024 12:45:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjeWu-0000tN-Sd; Thu, 29 Aug 2024 12:45:36 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjeWu-0003Jy-Re; Thu, 29 Aug 2024 12:45:36 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjeWu-0001b5-G7; Thu, 29 Aug 2024 12:45:36 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjeWu-0001ee-FW; Thu, 29 Aug 2024 12:45:36 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=EfCD4srUc2zod/bA4rWRml87ngGPsGGcET14wJqcxXk=; b=wbmt1l4y1++pvvkzeVl5py8kys
	fDOOXlgTnd+daZlgzvF0n73BwAtk///ntEnah7J9R06wviVTAIZP7eamj3gKTwy9ZG7sT51DQizsP
	Av2hqXs4bT/R1msyZWG9In0p+yBJYzf8KvEKdRZyv6ariotjKorTUak1C9EY0Gsu9lpg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187400-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187400: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=99f942f3d410059dc223ee0a908827e928ef3592
X-Osstest-Versions-That:
    xen=0e0426dda4bcc67826a575822538583e8f5b7cfc
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 29 Aug 2024 12:45:36 +0000

flight 187400 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187400/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  99f942f3d410059dc223ee0a908827e928ef3592
baseline version:
 xen                  0e0426dda4bcc67826a575822538583e8f5b7cfc

Last test of basis   187392  2024-08-29 01:00:24 Z    0 days
Testing same since   187400  2024-08-29 09:00:23 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Anthony PERARD <anthony.perard@vates.tech>
  Jan Beulich <jbeulich@suse.com>
  Michal Orzel <michal.orzel@amd.com>
  Sergiy Kibrik <Sergiy_Kibrik@epam.com>
  Xenia Ragiadakou <burzalodowa@gmail.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   0e0426dda4..99f942f3d4  99f942f3d410059dc223ee0a908827e928ef3592 -> smoke


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 12:52:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 12:52:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785850.1195361 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjed1-0003YG-0T; Thu, 29 Aug 2024 12:51:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785850.1195361; Thu, 29 Aug 2024 12:51:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjed0-0003Y9-U8; Thu, 29 Aug 2024 12:51:54 +0000
Received: by outflank-mailman (input) for mailman id 785850;
 Thu, 29 Aug 2024 12:51: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=zolI=P4=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjecz-0003Y3-Fl
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 12:51:53 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 76ba96d1-6605-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 14:51:52 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a8677ae5a35so65900866b.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 05:51:52 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226ccfe8fsm675413a12.62.2024.08.29.05.51.50
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 05:51:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 76ba96d1-6605-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724935912; x=1725540712; 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=rMo5bRBH0nbWBgalqxyESbnLNu0WPfOm0dwY46yOmtg=;
        b=cOqFwZ+KiVjVHItxGGfnDrCd2OwbYUwU0Bvs2Dh92H2ntdbkvkE6NzvnG+tXJXjaR2
         J8RWljszTrepXGJsExWCG8XTCzmnmCmftwj0x4wPi/SeTkWBkIq2yESpHdgdJnFex7Ia
         SIOHJGJlcXqoYFqnwGt1u4BM++tjzCj3OQlvA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724935912; x=1725540712;
        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=rMo5bRBH0nbWBgalqxyESbnLNu0WPfOm0dwY46yOmtg=;
        b=JVO87mYZjU7U/m8DIxwLrjjzHkaXl4MH5NcPKDKGae1JkGXPoMRroXbenw+5005Gj5
         8w1C205+ED4zDFuU/8vgDwcBIhJFs5G4LqGZY32BKjYqaLmes0euR+0fjIkuV/9vRj8s
         uOhZnkYhzH+QIsifiKNfJhY+k2/dcazA3SKQyBKtDQmh77+Zs9CFJsRv7t89wWBW7Feo
         zdb1c7DItW8pS+INqhLmZ3QeJ923pMZNIVfHqF9ghHalsSKJI3i+0EtWi38znZxFCqmP
         IszDsTC1d9eInNGZjnK830xrVrFeQ+eUToDQVDQK8SCSKXlonWAp36cD9IRV45NSGDTg
         E0TQ==
X-Forwarded-Encrypted: i=1; AJvYcCUNlk3RBhNnjbyPb1dJ0XvaPdi11l+n9SehYMxgOSmKYYopYy3Yzr7Wy8RaPuqb88EJojw40X0oZiw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YztmPB/VBTacZUE5D43j3DlYBR4jPIkILnuMxZqdMhYIQ2eexvE
	cVY7GJDNE8HiMBBnankqu3dRk+cgobtTZ5BnHFmwGeJ8P73kmLiLLvEAf9HXxuI=
X-Google-Smtp-Source: AGHT+IEADzLFDdxJ7ZbXj0f8Rai7E/6yYg00EFkWxZej1niUB0xi7nr6H012BmnkJc+QxMfT92R5CQ==
X-Received: by 2002:a05:6402:34c4:b0:5be:fbce:9391 with SMTP id 4fb4d7f45d1cf-5c21ed41d7amr2186629a12.11.1724935911403;
        Thu, 29 Aug 2024 05:51:51 -0700 (PDT)
Message-ID: <737c8726-f290-4abf-b46a-344dd63862fa@citrix.com>
Date: Thu, 29 Aug 2024 13:51:49 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 5/5] types: replace remaining uses of s64
To: Jan Beulich <jbeulich@suse.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Julien Grall <julien@xen.org>, Stefano Stabellini
 <sstabellini@kernel.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Michal Orzel <michal.orzel@amd.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>
References: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
 <50ffc0e1-ff3d-421f-a703-295541357e17@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <50ffc0e1-ff3d-421f-a703-295541357e17@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 29/08/2024 1:01 pm, Jan Beulich wrote:
> --- a/xen/arch/x86/time.c
> +++ b/xen/arch/x86/time.c
> @@ -66,10 +66,10 @@ struct cpu_time {
>  struct platform_timesource {
>      const char *id;
>      const char *name;
> -    u64 frequency;
> +    uint64_t frequency;
>      /* Post-init this hook may only be invoked via the read_counter() wrapper! */
> -    u64 (*read_counter)(void);
> -    s64 (*init)(struct platform_timesource *);
> +    uint64_t (*read_counter)(void);
> +    int64_t (*init)(struct platform_timesource *);
>      void (*resume)(struct platform_timesource *);

I'm surprised that we haven't seen MISRA complaints about this.  That,
or I've not been paying enough attention.

> --- a/xen/common/ubsan/ubsan.c
> +++ b/xen/common/ubsan/ubsan.c
> @@ -21,7 +21,6 @@ static DEFINE_PER_CPU(struct xen_ubsan[1
>  #define current this_cpu(in_ubsan)
>  #define dump_stack dump_execution_state
>  #define u64 long long unsigned int
> -#define s64 long long int

This block of defines was my magic to use ubsan.c otherwise unmodified
from Linux.

It ought to use linux-compat.h now it exists, rather than swapping away
from {u,s}64.

Everything else looks good.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 13:01:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 13:01:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785859.1195372 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjem8-0006Bs-SU; Thu, 29 Aug 2024 13:01:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785859.1195372; Thu, 29 Aug 2024 13:01:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjem8-0006Bl-ON; Thu, 29 Aug 2024 13:01:20 +0000
Received: by outflank-mailman (input) for mailman id 785859;
 Thu, 29 Aug 2024 13:01:18 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zolI=P4=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjem6-0006Be-No
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 13:01:18 +0000
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com
 [2a00:1450:4864:20::62a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id c1453067-6606-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 15:01:07 +0200 (CEST)
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a7aa086b077so53684966b.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 06:01:07 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8988feb072sm76925166b.28.2024.08.29.06.01.04
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 06:01:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c1453067-6606-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724936467; x=1725541267; 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=stLVbPvXbVnwp8iTE2RucsKVwjH1zhKeuvAiDK/3dj4=;
        b=Scwo0i5t3XARQFpuyuW+rnDhnme34lB5cnX7IsTOGSdSRn6hr6+nnBUP1jPSlU38dW
         Sof7eAadQqbowhNV6diPITyUmo3n1vo4w62VtbTLJ1JU02WcuenT0/FgArHFtzfF9dwq
         JWv0gz7ucayxBE4JS/90H9cvUlAO66X8vLftQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724936467; x=1725541267;
        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=stLVbPvXbVnwp8iTE2RucsKVwjH1zhKeuvAiDK/3dj4=;
        b=Of8vbRjS9ZF5Z/bvl+EvKFIWrc74JowcPAnzT3bbTeBqs7IL3C5EKP8A8ysW9Y0UWs
         QU+j0RPI9gXeuJRXjrm/1jTgK1qqv6A4+WoYBUklVoHn4gXdqVZ4NIzZVHlYmjcTW1Eh
         52OC5fXnw9yO4LDNapea0PMp6j8HBGz+4SVI2aj+yNsn3lqMzFBFMScTCaWNGvF7xBLP
         vPNeu83JUSCTRwCwHWcEaHDpeqINE9vqxxr0U6BefYDglPP33BqvnsLoRg21FXa6G/EE
         74Ej4yNfPfpnTouUs5ms/ZSMGsso6Pm+nPuE2+zejvNC+jlef7AXeAtXGYHbVE2VExPR
         D6tQ==
X-Forwarded-Encrypted: i=1; AJvYcCXXAzvtRWgjiRsD0euZj6sHTshusRPT3jAt8y9ekxBpUBxyEe3LrT2J7wKV7rh0XUL41tRZYIevZtA=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwqtQkbsMLKYrO+YL4JTdxzNe/J2phES9SSi2OYReLFBwdagB1R
	fDRPOd7R3KsQuEZrOZ7vDQQiCb623gQzChJ6UQuDUNjgDn6CT8tltlKsU+rpfm4=
X-Google-Smtp-Source: AGHT+IFr8NkGSolvS7hqqXM4NarDjOcnTMyHcyXFyzdutqatxwSKTI9GGEZRx9FkTfz4gI7ZAcvZAQ==
X-Received: by 2002:a17:907:9482:b0:a86:700f:93c1 with SMTP id a640c23a62f3a-a897face4cfmr235517266b.60.1724936464963;
        Thu, 29 Aug 2024 06:01:04 -0700 (PDT)
Message-ID: <26a0e465-bc48-489a-ac7a-5455b131fab4@citrix.com>
Date: Thu, 29 Aug 2024 14:01:02 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v6] x86/dom0: disable SMAP for PV domain building only
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>, xen-devel@lists.xenproject.org
References: <20240828113044.35541-1-roger.pau@citrix.com>
 <50658093-8463-4ee3-b308-31be2dd1fd42@suse.com>
 <bd206c4d-8e1d-488c-b428-3f6402a9ae4f@citrix.com>
 <Zs8gAuc5qoVsVkQe@macbook.local>
 <a5b4ca69-96ea-46d6-ab0d-2be4fd1d9d99@citrix.com>
 <ZtAjv6hdbPTZ1dGI@macbook.local>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <ZtAjv6hdbPTZ1dGI@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 29/08/2024 8:31 am, Roger Pau Monné wrote:
> On Wed, Aug 28, 2024 at 07:57:39PM +0100, Andrew Cooper wrote:
>> On 28/08/2024 2:02 pm, Roger Pau Monné wrote:
>>> On Wed, Aug 28, 2024 at 12:51:23PM +0100, Andrew Cooper wrote:
>>>> On 28/08/2024 12:50 pm, Jan Beulich wrote:
>>>>> On 28.08.2024 13:30, Roger Pau Monne wrote:
>>>>>> Move the logic that disables SMAP so it's only performed when building a PV
>>>>>> dom0, PVH dom0 builder doesn't require disabling SMAP.
>>>>>>
>>>>>> The fixes tag is to account for the wrong usage of cpu_has_smap in
>>>>>> create_dom0(), it should instead have used
>>>>>> boot_cpu_has(X86_FEATURE_XEN_SMAP).  Fix while moving the logic to apply to PV
>>>>>> only.
>>>>>>
>>>>>> While there also make cr4_pv32_mask __ro_after_init.
>>>>>>
>>>>>> Fixes: 493ab190e5b1 ('xen/sm{e, a}p: allow disabling sm{e, a}p for Xen itself')
>>>>>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>>>>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>>>>> preferably with ...
>>>>>
>>>>>> @@ -1051,6 +1051,34 @@ out:
>>>>>>      return rc;
>>>>>>  }
>>>>>>  
>>>>>> +int __init dom0_construct_pv(struct domain *d,
>>>>>> +                             const module_t *image,
>>>>>> +                             unsigned long image_headroom,
>>>>>> +                             module_t *initrd,
>>>>>> +                             const char *cmdline)
>>>>>> +{
>>>>>> +    int rc;
>>>>>> +
>>>>>> +    /*
>>>>>> +     * Temporarily clear SMAP in CR4 to allow user-accesses in
>>>>>> +     * construct_dom0().  This saves a large number of corner cases
>>>>> ... the final 's' dropped here and ...
>>>>>
>>>>>> +     * interactions with copy_from_user().
>>
>> Actually, even with this adjustment the comment is still wonky.
>>
>> The point is that we're clearing SMAP so we *don't* need to rewrite
>> construct_dom0() in terms of copy_{to,from}_user().
>>
>> I've adjusted it.
> It did seem weird to me, I've assumed the wording was meaning to imply
> that SMAP was disabled so that construct_dom0() didn't need to use
> copy_from_user().
>
> The comment you added seems fine to me, however there's a typo I
> think:
>
>     /*
>      * Clear SMAP in CR4 to allow user-accesses in construct_dom0().  This
>      * prevents us needing to write rewrite construct_dom0() in terms of
>                               ^ extra?
>      * copy_{to,from}_user().
>      */
>
> We can fix at some later point when modifying this.

Urgh, sorry.

Luckily, I've got just the patch to do this in...

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 13:01:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 13:01:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785862.1195381 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjemi-0006gP-5p; Thu, 29 Aug 2024 13:01:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785862.1195381; Thu, 29 Aug 2024 13:01:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjemi-0006gI-34; Thu, 29 Aug 2024 13:01:56 +0000
Received: by outflank-mailman (input) for mailman id 785862;
 Thu, 29 Aug 2024 13:01:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjemh-0006Be-Fo
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 13:01:55 +0000
Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com
 [2a00:1450:4864:20::62f])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id dd0e5a86-6606-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 15:01:53 +0200 (CEST)
Received: by mail-ej1-x62f.google.com with SMTP id
 a640c23a62f3a-a86883231b4so65018866b.3
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 06:01:53 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8989221c2fsm76599666b.197.2024.08.29.06.01.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 06:01:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dd0e5a86-6606-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724936513; x=1725541313; 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=73G/kKffEOfYWnxdHaXi0o5x8TmRZ28dwfnIYa9Gv14=;
        b=NBP9omltPq4QzQrwqkSPIEYImMlQg+rQGYITnzC8EPf8XnxtQV++YMzV/USaZnMNe/
         5RrVUJ1a8AB5g9Lhe+HpqiHBb3XqB7h/r1qrc50U4TKKV5ME7mAQvTpXyHDQPEAS2LW9
         jVEix+oawaciO5emF5mMBO2qLQriagezLY3/eYjiktHEnUV0aPaPizsoh8vHTPsixoe1
         guNXn6Hi/93elIH6SaAallpvc5aAwYlIJi016F8aINz5q9WBMTQEcKGDKsAzXECW+Dd3
         RrCzme1OIoIbPVFAOMfGfKh2ofrRfFrckdkMsVtm30pRzDlrEdSY6EBj2rHZsp2FRNdG
         zetg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724936513; x=1725541313;
        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=73G/kKffEOfYWnxdHaXi0o5x8TmRZ28dwfnIYa9Gv14=;
        b=hiMEKO59C7ebBvYFgHSFrB989wcUpCJAgeB63fDCeQcZUadGk01Wca8J1mfiVuc2KQ
         djGkVLxi/+vKIPSj9iu1BGdVdFvb+xihUE8L/lMdfqtdAVw5Vy06WMrcYhKtHhdfNuSt
         Kh2MraXOXtYUIQt9oxPHtLcVL9g3crp8RlB35vBidurjp1ozaqCt05zODFbbf4FP5vUV
         p803mcAthVIbES5YTOqvWu18SB0A/OITfzb78Rg4dGFw11VsFgUHstxbLP8eHCvU6Mhd
         AKPUdSiAG372Fsz/KtT3WjtvhlKZ3/oIFF1NPjsybVMZdGO3nk7OEuRUPwTgrDV48f7U
         eNAQ==
X-Forwarded-Encrypted: i=1; AJvYcCUIYDD77mfV5LpPDNVwy0fESj1t3oV47F0RTNA2Kb2ede4pUd6JVCylIveMW6bkLpw8kwfftCQYzvY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxwEUs4nVmkHRnwYny2mGqq0Nz/c8bRFi4ipjTEFlacVwh2yxg4
	rco92LyYzAYh/QmU9vYlijZvsWL1xUfGNqKvVntqjrU4kkhCp5xdusWmnrJIMaDWlVHn9SuPFIM
	=
X-Google-Smtp-Source: AGHT+IGi1owXCCTKYuOMLksJY+fXvyOdBg6fexDNFCj0II/IpeasckOPWDowW/NPSixbAGYVNcBXww==
X-Received: by 2002:a17:906:6a0d:b0:a86:8f32:3a68 with SMTP id a640c23a62f3a-a897f8fc7dfmr246078066b.37.1724936512220;
        Thu, 29 Aug 2024 06:01:52 -0700 (PDT)
Message-ID: <6e742ccd-71bf-4933-a7e3-c6ab91f4d196@suse.com>
Date: Thu, 29 Aug 2024 15:01:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 4/5] types: replace remaining uses of s32
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Julien Grall <julien@xen.org>, Stefano Stabellini
 <sstabellini@kernel.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Marek Marczykowski <marmarek@invisiblethingslab.com>,
 Daniel Smith <dpsmith@apertussolutions.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
 <0e6b7685-e061-4ace-88fd-86728d765e5a@suse.com>
 <3fa09b21-fb7e-4b3c-91cb-d47c25608771@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <3fa09b21-fb7e-4b3c-91cb-d47c25608771@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 29.08.2024 14:44, Andrew Cooper wrote:
> On 29/08/2024 1:01 pm, Jan Beulich wrote:
>> ... and move the type itself to linux-compat.h.
>>
>> While doing so switch a few adjacent types as well, for (a little bit
>> of) consistency.
>>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>,

Thanks.

> with a minor formatting request.
> 
>> --- a/xen/arch/arm/arm32/livepatch.c
>> +++ b/xen/arch/arm/arm32/livepatch.c
>> @@ -41,11 +41,11 @@ void arch_livepatch_apply(const struct l
>>           * ARM DDI 0406C.c, see A2.3 (pg 45) and A8.8.18 pg (pg 334,335)
>>           *
>>           */
>> -        delta = (s32)func->new_addr - (s32)(func->old_addr + 8);
>> +        delta = (int32_t)func->new_addr - (int32_t)(func->old_addr + 8);
>>  
>>          /* The arch_livepatch_symbol_ok should have caught it. */
>> -        ASSERT(delta >= -(s32)ARCH_LIVEPATCH_RANGE ||
>> -               delta < (s32)ARCH_LIVEPATCH_RANGE);
>> +        ASSERT(delta >= -(int32_t)ARCH_LIVEPATCH_RANGE ||
>> +               delta < (int32_t)ARCH_LIVEPATCH_RANGE);
> 
> Could you vertically like this, like it is ...
> 
>> @@ -203,8 +204,8 @@ static int perform_rel(unsigned char typ
>>           * arch_livepatch_verify_distance can't account of addend so we have
>>           * to do the check here as well.
>>           */
>> -        if ( (s32)val < -(s32)ARCH_LIVEPATCH_RANGE ||
>> -             (s32)val >= (s32)ARCH_LIVEPATCH_RANGE )
>> +        if ( (int32_t)val < -(int32_t)ARCH_LIVEPATCH_RANGE ||
>> +             (int32_t)val >= (int32_t)ARCH_LIVEPATCH_RANGE )
>>              return -EOVERFLOW;
> 
> ... here?

If the Arm folks don't mind - sure, I can. I think though that the latter
only happens to look aligned, without there having been such an intention.
Kind of supported ...

> I'd argue that even this one wants one extra space in the middle, so the
> '-' is further to the right of the >=.

... by this observation of yours.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 13:14:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 13:14:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785874.1195391 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjeyc-000159-6p; Thu, 29 Aug 2024 13:14:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785874.1195391; Thu, 29 Aug 2024 13:14:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjeyc-000152-2k; Thu, 29 Aug 2024 13:14:14 +0000
Received: by outflank-mailman (input) for mailman id 785874;
 Thu, 29 Aug 2024 13:14:13 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjeyb-000142-A0
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 13:14:13 +0000
Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com
 [2a00:1450:4864:20::535])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 94d3d192-6608-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 15:14:11 +0200 (CEST)
Received: by mail-ed1-x535.google.com with SMTP id
 4fb4d7f45d1cf-5c0abaae174so691112a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 06:14:11 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89891d8109sm78764766b.174.2024.08.29.06.14.10
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 06:14:10 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 94d3d192-6608-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724937251; x=1725542051; 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=4X/l2g8Liqe3GrPATDRGihZCqaRvKpc7lPGiV6oW+cw=;
        b=WietnjVy6XjQYoWW1nKTFKHAbIM04kV7hTzYsaKftobgzZo0nEzHfaP06n+mXyFXkx
         /w/DGmi6sdllbb/cg6yhoSCoBFQewvMfB7R3cfPB/JeMtqrv//Vns3c8PcFNZjq4eoqr
         bvKOHUycvVgmwPjGYhZNOQfnn7gqik+1vk4wvnPXKu1VYwqwLahl5hQVb0Atp3HbIs+M
         Qmhe90ZmTGwF2IDwC/j6+yX4SPdbYluHoXfW1gfuvzhsiYebLucshFD4fYNvuSe0SeOy
         U3dDfJ7n0sbX0bgB3gCCOR3m+NsGxbNOrbpouvSn7wD9PjzuU0o6zUSeLV+4pWgZV35b
         atzQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724937251; x=1725542051;
        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=4X/l2g8Liqe3GrPATDRGihZCqaRvKpc7lPGiV6oW+cw=;
        b=lyNEp40OP/Gf23Vy2H68SiHMyKecUVcdUcTF0Og2DMl/W/mi+4F6kcKAVPiUA14gSL
         bbeqwqYhWyDJHrO+KnaI3StAsMSeEaJysgmZ00XteKDLgkxg9y1oHkJbzqJnTcv8cPWV
         /KIBLGfVHxDb5uYB9Y5pEz5RQ8FMULGT126WPbTm+pc5Yu1tVp0BPDPoXnD2vEtXGnrx
         enAi+XZ0znWRgHhTfjU7K2N5EvUI/I7c/+tPJ550jVoiXsYt1rdONzc8gp6D7eAICc7g
         S2/vn91ajxUNnMXO9XYLTE/93243GFFXeSy2IuMzxw+A9q2ttsZxLO4SlANGD9Fh8AZ6
         PWrA==
X-Forwarded-Encrypted: i=1; AJvYcCXze1BnmpxmWJmgMQgN+khbRQbs3MYGZoDBlYzoiMaWiP+iCKWEuVNjdElLS2Ok5zHgJbBRGv+NCbk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxfAh6eKveEC7zlLpq0A0QESqKg+z1V3+TB8nYLiQAVYdc8YWtG
	f5PeWq7NRhmF9pcXgI0GcSOpvJ022HyqorEzB/cFgEhdU/ogIlPrAAsTOAHMgw==
X-Google-Smtp-Source: AGHT+IGvX9Pb5YK5jbwb38dWYfS40DXJtneicOcCjOaL3swubEfr1/ioEMNqSyqfi8/oMRkcec59ng==
X-Received: by 2002:a05:6402:51d2:b0:5be:eb90:183c with SMTP id 4fb4d7f45d1cf-5c21ed314abmr2804857a12.6.1724937250823;
        Thu, 29 Aug 2024 06:14:10 -0700 (PDT)
Message-ID: <74fa2ddb-a7be-4d58-9717-5c14eee7782a@suse.com>
Date: Thu, 29 Aug 2024 15:14:09 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH 5/5] types: replace remaining uses of s64
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Julien Grall <julien@xen.org>, Stefano Stabellini
 <sstabellini@kernel.org>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Michal Orzel <michal.orzel@amd.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
References: <b1ded557-63b8-4999-98ca-de80488ebad1@suse.com>
 <50ffc0e1-ff3d-421f-a703-295541357e17@suse.com>
 <737c8726-f290-4abf-b46a-344dd63862fa@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <737c8726-f290-4abf-b46a-344dd63862fa@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 29.08.2024 14:51, Andrew Cooper wrote:
> On 29/08/2024 1:01 pm, Jan Beulich wrote:
>> --- a/xen/arch/x86/time.c
>> +++ b/xen/arch/x86/time.c
>> @@ -66,10 +66,10 @@ struct cpu_time {
>>  struct platform_timesource {
>>      const char *id;
>>      const char *name;
>> -    u64 frequency;
>> +    uint64_t frequency;
>>      /* Post-init this hook may only be invoked via the read_counter() wrapper! */
>> -    u64 (*read_counter)(void);
>> -    s64 (*init)(struct platform_timesource *);
>> +    uint64_t (*read_counter)(void);
>> +    int64_t (*init)(struct platform_timesource *);
>>      void (*resume)(struct platform_timesource *);
> 
> I'm surprised that we haven't seen MISRA complaints about this.  That,
> or I've not been paying enough attention.

What Misra concerns do you see here?

>> --- a/xen/common/ubsan/ubsan.c
>> +++ b/xen/common/ubsan/ubsan.c
>> @@ -21,7 +21,6 @@ static DEFINE_PER_CPU(struct xen_ubsan[1
>>  #define current this_cpu(in_ubsan)
>>  #define dump_stack dump_execution_state
>>  #define u64 long long unsigned int
>> -#define s64 long long int
> 
> This block of defines was my magic to use ubsan.c otherwise unmodified
> from Linux.
> 
> It ought to use linux-compat.h now it exists, rather than swapping away
> from {u,s}64.

Except that this doesn't work without retaining the hunk adjusting
val_to_string(). I'm actually surprised Linux gets away with that, seeing
their include/uapi/asm-generic/int-l64.h (which is the model we use,
resulting in -Wformat warnings). Thoughts?

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 13:15:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 13:15:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785880.1195402 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjf08-0001dw-Gn; Thu, 29 Aug 2024 13:15:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785880.1195402; Thu, 29 Aug 2024 13:15:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjf08-0001dp-Du; Thu, 29 Aug 2024 13:15:48 +0000
Received: by outflank-mailman (input) for mailman id 785880;
 Thu, 29 Aug 2024 13:15: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=0n6n=P4=bounce.vates.tech=bounce-md_30504962.66d0747e.v1-9fbed1d04ff84916936c2e20710d9ed7@srs-se1.protection.inumbo.net>)
 id 1sjf07-0001dd-2D
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 13:15:47 +0000
Received: from mail135-11.atl141.mandrillapp.com
 (mail135-11.atl141.mandrillapp.com [198.2.135.11])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cbdc9fcd-6608-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 15:15:44 +0200 (CEST)
Received: from pmta14.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail135-11.atl141.mandrillapp.com (Mailchimp) with ESMTP id
 4Wvhby6BFnzLfH091
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 13:15:42 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 9fbed1d04ff84916936c2e20710d9ed7; Thu, 29 Aug 2024 13:15:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cbdc9fcd-6608-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1724937342; x=1725197842;
	bh=GNvtVlkOwaX8Tpje5yHMSIrXJ2hP+8ENORnl23xzVs8=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=lEfIq2jktmrt6qk/YIx0jkEZ0X9DgChcJrxyBuaJz2NPFbnJ2m3mrBf+7Rli9JY8J
	 A4FCLFjZ3CgLu5ZMWHBz7qu0lKJ21YXl0GN95IjOft6RRbDLlhsn8XYpcivrSJTSxP
	 49QUXrrc05fIafveD3LN2rus22mKI6+NF4SB/FIIHT7QpfufXDnlCRsbSOgZqXnuAp
	 4qbnL501L22chZtjqbAbmI66gGTJw8iLTC6+71lhxqNuM0zD8Uf406cadCaExuPKjH
	 wlIk0XkPPoseaj9KhEA5w+n3ayYxd4DtCmFGmPnXPxl1faXlf2UuuNW1spHTfuWDOp
	 FtkJS+hh4yhlg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1724937342; x=1725197842; i=anthony.perard@vates.tech;
	bh=GNvtVlkOwaX8Tpje5yHMSIrXJ2hP+8ENORnl23xzVs8=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=aQsIS3vBVJDtfBzajYBUaiU5TRYJ07IsQhlQoYrKlLm43tmA2r7uCjFPJq0sIEi0Y
	 OvO4fi0YzchUJ+seg7PoyGBUPcmscma1ovxzVMRzbQqHX1Z24wmLKe1dLjWkBuhnL2
	 uq7962XTNTyjWJPHpnCqtF1fNfidirerxXBCdlY+wThpvBfZQmtHGcRtM1co2kZ9Fp
	 OVyKsFezQ1sj2t7rtg+l8BmxhSlDMSeTH2KQUp3UmDgXGbjbsifcXCYV07Y3LNasLc
	 IVH6XuxPmqD9uk3MPaVDxEc/b0bbxWMTCBL85u7CsWfF+6DtWuHsk5CNeogDlSmTmP
	 vW22HY2EfGs+g==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20Block=20protocol=20incompatibilities=20with=204K=20logical=20sector=20size=20disks?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1724937341282
To: =?utf-8?Q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, Paul Durrant <paul@xen.org>, Owen Smith <owen.smith@cloud.com>, Mark Syms <mark.syms@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>, Juergen Gross <jgross@suse.com>
Message-Id: <ZtB0fMRCGajdcfap@l14>
References: <ZtBUnzH4sIrFAo0f@macbook.local>
In-Reply-To: <ZtBUnzH4sIrFAo0f@macbook.local>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.9fbed1d04ff84916936c2e20710d9ed7?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240829:md
Date: Thu, 29 Aug 2024 13:15:42 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Thu, Aug 29, 2024 at 12:59:43PM +0200, Roger Pau Monn=C3=A9 wrote:
> Hello,
> 
> To give some context, this started as a bug report against FreeBSD failin=
g to
> work with PV blkif attached disks with 4K logical sectors when the backen=
d is
> Linux kernel blkback:
> 
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280884
> 
> Further investigation has lead me to discover that the protocol described=
 in
> the public blkif.h header is not implemented uniformly, and there are maj=
or
> inconsistencies between implementations regarding the meaning of the `sec=
tors`
> and `sector-size` xenstore nodes, and the sector_number and {first,last}_=
sect
> struct request fields.  Below is a summary of the findings on the
> implementation I've analyzed.
> 
> Linux blk{front,back} always assumes the `sectors` xenstore node to be in=
 512b
> units, regardless of the value of the `sector-size` node.  Equally the ri=
ng
> request sector_number and the segments {first,last}_sect fields are alway=
s
> assumed to be in units of 512b regardless of the value of `sector-size`. =
 The
> `feature-large-sector-size` node is neither exposed by blkfront, neither
> checked by blkback before exposing a `sector-size` node different than 51=
2b.
> 
> FreeBSD blk{front,back} calculates (and for blkback exposes) the disk siz=
e as
> `sectors` * `sector-size` based on the values in the xenstore nodes (as
> described in blkif.h).  The ring sector_number is filled with the sector =
number
> based on the `sector-size` value, however the {first,last}_sect fields ar=
e
> always calculated as 512b units.   The `feature-large-sector-size` node i=
s
> neither exposed by blkfront, neither checked by blkback before exposing a
> `sector-size` node different than 512b.
> 
> QEMU qdisk blkback implementation exposes the `sectors` disk size in unit=
s of
> `sector-size` (as FreeBSD blkback).  The ring structure fields sector_num=
ber
> and {first,last}_sect are assumed to be in units of `sector-size`.  This
> implementation will not expose a `sector-size` node with a value differen=
t than
> 512 unless the frontend xenstore path has the `feature-large-sector-size`=
 node
> present.
> 
> Windows blkfront calculates the disk size as `sectors` * `sector-size` fr=
om the
> xenstore nodes exposed by blkback.   The ring structure fields sector_num=
ber
> and {first,last}_sect are assumed to be in units of `sector-size`.  This
> frontend implementation exposes `feature-large-sector-size`.
> 
> When using a disk with a logical sector size different than 512b, Linux i=
s only
> compatible with itself, same for FreeBSD.  QEMU blkback implementation is=
 also
> only compatible with the Windows blkfront implementation.  The
> `feature-large-sector-size` seems to only be implemented for the QEMU/Win=
dows
> combination, both Linux and FreeBSD don't implement any support for it ne=
ither
> in the backend or the frontend.
> 
> The following table attempts to summarize in which units the following fi=
elds
> are defined for the analyzed implementations (please correct me if I got =
some
> of this wrong):
> 
>                         =E2=94=82 sectors xenbus node =E2=94=82 requests =
sector_number =E2=94=82 requests {first,last}_sect
> =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80
> FreeBSD blk{front,back} =E2=94=82     sector-size     =E2=94=82      sect=
or-size       =E2=94=82           512
> =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80
> Linux blk{front,back}   =E2=94=82         512         =E2=94=82          =
512           =E2=94=82           512
> =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80
> QEMU blkback            =E2=94=82     sector-size     =E2=94=82      sect=
or-size       =E2=94=82       sector-size
> =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80
> Windows blkfront        =E2=94=82     sector-size     =E2=94=82      sect=
or-size       =E2=94=82       sector-size
> =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80
> MiniOS                  =E2=94=82     sector-size     =E2=94=82          =
512           =E2=94=82           512
> =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80
> tapdisk blkback         =E2=94=82         512         =E2=94=82      sect=
or-size       =E2=94=82           512

There's OVMF as well, which copied MiniOS's implementation, and looks
like it's still the same as MiniOS for the table above:

OVMF (base on MiniOS)   =E2=94=82     sector-size     =E2=94=82          51=
2           =E2=94=82           512

> 
> It's all a mess, I'm surprised we didn't get more reports about brokennes=
s when
> using disks with 4K logical sectors.
> 
> Overall I think the in-kernel backends are more difficult to update (as i=
t
> might require a kernel rebuild), compared to QEMU or blktap.  Hence my sl=
ight
> preference would be to adjust the public interface to match the behavior =
of
> Linux blkback, and then adjust the implementation in the rest of the back=
ends
> and frontends.

I would add that making "sector-size" been different from 512 illegal
makes going forward easier, has every implementation will work with a
"sector-size" of 512, and it probably going to be the most common sector
size for a while longer.

> There was an attempt in 2019 to introduce a new frontend feature flag to =
signal
> whether the frontend supported `sector-size` xenstore nodes different tha=
n 512 [0].
> However that was only ever implemented for QEMU blkback and Windows blkfr=
ont,
> all the other backends will expose `sector-size` different than 512 witho=
ut
> checking if `feature-large-sector-size` is exposed by the frontend.  I'm =
afraid
> it's now too late to retrofit that feature into existing backends, seeing=
 as
> they already expose `sector-size` nodes greater than 512 without checking=
 if
> `feature-large-sector-size` is reported by the frontend.

Much before that, "physical-sector-size" was introduced (2013):
    https://xenbits.xen.org/gitweb/?p=3Dxen.git;a=3Dcommit;h=3Da67e2dac9f83=
39681b30b0f89274a64e691ea139

Linux seems to implement it, but QEMU or OVMF don't have it.

> My proposal would be to adjust the public interface with:
> 
>  * Disk size is calculated as: `sectors` * 512 (`sectors` being the conte=
nts of
>    such xenstore backend node).
> 
>  * All the sector related fields in blkif ring requests use a 512b base s=
ector
>    size, regardless of the value in the `sector-size` xenstore node.
> 
>  * The `sector-size` contains the disk logical sector size.  The frontend=
 must
>    ensure that all request segments addresses are aligned and it's length=
 is
>    a multiple of such size.  Otherwise the backend will refuse to process=
 the
>    request.

You still want to try to have a "sector-size" different from 512? To me
this just add confusion to the confusion. There would be no way fro
backend or frontend to know if setting something other than 512 is going
to work. Also, it is probably easier to update backend than frontend, so
it is just likely that something is going to lag behind and broke.

Why not make use of the node "physical-sector-size" that have existed
for 10 years, even if unused or unadvertised, and if an IO request isn't
aligned on it, it is just going to be slow (as backend would have to
read,update,write instead of just write sectors).

Cheers,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 13:33:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 13:33:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785891.1195412 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjfHG-0006P3-1j; Thu, 29 Aug 2024 13:33:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785891.1195412; Thu, 29 Aug 2024 13:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjfHF-0006Ow-Uy; Thu, 29 Aug 2024 13:33:29 +0000
Received: by outflank-mailman (input) for mailman id 785891;
 Thu, 29 Aug 2024 13:33: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=D0cO=P4=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sjfHE-0006Oq-BQ
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 13:33:28 +0000
Received: from NAM12-MW2-obe.outbound.protection.outlook.com
 (mail-mw2nam12on2060b.outbound.protection.outlook.com
 [2a01:111:f403:200a::60b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 43e6a596-660b-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 15:33:25 +0200 (CEST)
Received: from DM6PR02CA0118.namprd02.prod.outlook.com (2603:10b6:5:1b4::20)
 by PH8PR12MB6963.namprd12.prod.outlook.com (2603:10b6:510:1be::14) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.25; Thu, 29 Aug
 2024 13:33:20 +0000
Received: from CY4PEPF0000EE3A.namprd03.prod.outlook.com
 (2603:10b6:5:1b4:cafe::48) by DM6PR02CA0118.outlook.office365.com
 (2603:10b6:5:1b4::20) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend
 Transport; Thu, 29 Aug 2024 13:33:20 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 CY4PEPF0000EE3A.mail.protection.outlook.com (10.167.242.12) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 13:33:19 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 29 Aug
 2024 08:33:18 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 29 Aug
 2024 08:33:18 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Thu, 29 Aug 2024 08:33:17 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 43e6a596-660b-11ef-99a0-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=WbHhYZUgmF59EEYVYZHH3YiGocPEAE7lnF9NhBxmHsguzW0Ok83IajRXAEdUqwf3IcymypusrIpYvelj1ib0w0JooVWkmqJiGsihTbrTmDhOnHX31LXwlJhqpcFTHm2T10Vzcubtafo4ELSBYq3pJUp/OFNLjiJRa7NUeywPMinSdYyDZeS7QNFn5zLpJqgKq+qg3spOhpiNMTg6ZM4U1SbUtYCjseSNJi3xFptnQmsyokOHBjEfQfdGIWD/1TjwmHN0/6OXe4aKTvd0TaImuWswgSV0amNSzV7kEsSlQ0eb3xajSg+sUWIBUfWGIgTF1Nku0ea+ei+tmiQCdhx/oQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=Mt926UbtbaScBSxfteAtZruswq8iCIhAVzKnK055V28=;
 b=Ivdcth/oW+bJfPSlJBWacjUI1jGJ2quHm7Zb/NVAgcb9vzi/qIGiIHEi2KbTfH6aRmh+5UV64dujQaZJjy/d9nIfkXpPsoLwGbYmB6Ba5T9MXvhcr37qcMyBUvWWsVyPUxNruFpW5YoOzWMzCwLuHVBX5zne1M+5r23FTDxdNrrDvz7+Klhs2EBKUm+E5kUwrWE9dAXSl4pyubh03J6ASIlepyZSgBq3QqItlCTiGozNAV6Q6a2DjPL5FtsWp+BQjNJqRODeFs+y6rofVtXCcu2nGOsbrvg/OcH7fkEsvAH3FYoZaC8ldQ4mGrZOiRyJrrX2uhaOSpIyVtryde75xA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=Mt926UbtbaScBSxfteAtZruswq8iCIhAVzKnK055V28=;
 b=C1kZCk6DJJi/Ff3MRrcKtFMLkG2blZZFmzTsJ3W3OqiR5NmiY/nFrRSaFQ8d16an6eGB4hrCFYhCfLIrAjLCBRR0BLkrex+UI7vJWXKcqFSi5mMbPdxCwhzQ2VhpNMdYckCAa0nwN30Cajfka9e7VY4yEcK8T2qyyk9OxHS2yVI=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Michal Orzel <michal.orzel@amd.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Bertrand Marquis <bertrand.marquis@arm.com>, "Ayan
 Kumar Halder" <ayan.kumar.halder@amd.com>, Artem Mygaiev
	<artem_mygaiev@epam.com>, Hisao Munakata <hisao.munakata.vt@renesas.com>
Subject: [PATCH] docs: fusa: Add requirements for emulated uart
Date: Thu, 29 Aug 2024 14:33:14 +0100
Message-ID: <20240829133314.4042845-1-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: ayan.kumar.halder@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CY4PEPF0000EE3A:EE_|PH8PR12MB6963:EE_
X-MS-Office365-Filtering-Correlation-Id: 0c9984a1-5cfc-4397-836d-08dcc82f259f
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|1800799024|376014|36860700013;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?TvP7DX5ZuyKAXrUw6NxCoVN7wqB7vDoydHkqCn5gT697SYCKhrhNYaO6jRlj?=
 =?us-ascii?Q?ET+lM1J/vHi9+VDajMDK6Oj2LRxnxFFY9WoZFqHu/eWsaCwHnCC/EymXqJO0?=
 =?us-ascii?Q?uF2gCdKGmoRrvjic77B1GHJGLErHuWOH902xvKF0OqhCHWqOoExChmsMjWD8?=
 =?us-ascii?Q?9T1tXD5YYC/xIhX6JAR0hhJ8Hc6zaFgQjKzoki8nfxIXh6gKP2WZXvOoxuz5?=
 =?us-ascii?Q?2jZrz4EvEhC+BvZiLZr0C7DznIQeRIzkCKqCgO13WG9XwaFOQN9nQKLxpc7i?=
 =?us-ascii?Q?U9JjN8LJu44sbY8nJtMV6TKkAZmVKj5wJIDloRozo5XMYEyTLBW5jpv5r+9Q?=
 =?us-ascii?Q?N/LLWpWQJO5/N1bJDieV3RIJPMWeS8yDdtJRAkz9373BWha12k2yit4LhQde?=
 =?us-ascii?Q?1rXpUILSJnEqzBxQC4iIMFp7+nDFkAPmbx71AA1Sw9rhJnI88XQm6VQrAIES?=
 =?us-ascii?Q?CzIll3nj9G0XHAYwUQ+3f2yb+bf3CS1LpMENu6dBUB07Sjl89O6MurgsAiGu?=
 =?us-ascii?Q?th/3pxHVjLHVzr0MTW2tQrogmmDicXjhY2Oe0T98c7iTWUqSOl3QCBMiUDQ9?=
 =?us-ascii?Q?LsaL4JGxEIcj3oRY97L5ACPCrL6h3bDocesUtDtFTEwYRfY9tZSpQXRky2KT?=
 =?us-ascii?Q?mQoQH69k5g4bwNFzY5QFtMmLwLegb16JyWLSWEF1Vpd7TBr57AZUz/pp6JOw?=
 =?us-ascii?Q?8e5XRo+h1Un6tg+ZSQxLSzrWYhi1hOrKcIT0t91Wl9DA7MPhMli6/d84c9pA?=
 =?us-ascii?Q?siLTKzLHPreGIr6Mm/A5Kkkp35VXmYaLIHaTkWfGBzCJ7XcZgBmBjveI/AZr?=
 =?us-ascii?Q?HI7RL6aUijgF47kCztrVFzz7NbkMB/rsv/jENxJr4IlguBDpBb0/9Eht1J+F?=
 =?us-ascii?Q?dELr5cpdzQLGekFMpT+11hlJqBvB38+gC8TmoSH3ILKsuxwfbYg/glPntN3O?=
 =?us-ascii?Q?DtOl57IbUke6MxsjdU8/cjLDy8zXJRr/33Af6gqqwVzLh8lYZZVE+p3ROPiX?=
 =?us-ascii?Q?ULg3M74DBLylR3AJsrAf9zDBEFVa7Zz313LzINtGO0oHgd7NbCDgaCqPdsmj?=
 =?us-ascii?Q?8uX78PPU/0H45OUTY786ShQuQc3qqr6Ez1nGCqgL3ksiDhhQeEaE8sOjvFyf?=
 =?us-ascii?Q?cMU1xUjswkf6Vnm6qYduga6OW6yUdBoU6wrLcuEIOhGnV18s/6Hy4NDDieU3?=
 =?us-ascii?Q?rrP10kuVrfpSD/rV0I2LzkaxJeetuVZyQTuu98LuzjnAeAoAirVc+3kKjSmq?=
 =?us-ascii?Q?AKYrBe2yJ5SlfX//tMOU3Ucm5jAJrguWjJ+Cz2vdjgohsRhHtvJgqjZ0jOA+?=
 =?us-ascii?Q?MO9VbclBG6b4L2AsqeqV/vI5po7mXi97WuZCmR7qEYOHHPJegsgMQbzALJpZ?=
 =?us-ascii?Q?ushNy/eda3L3bzoHsuDHPl5hpOg+DPMx3jiC2Vkw5wBfMKd9YmCGE82uVSH4?=
 =?us-ascii?Q?K8EdcdoFiStFeCbNy8EkZNj0DnR6+qG7?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(376014)(36860700013);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 13:33:19.6715
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 0c9984a1-5cfc-4397-836d-08dcc82f259f
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CY4PEPF0000EE3A.namprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6963

From: Michal Orzel <michal.orzel@amd.com>

Add the requirements for emulated SBSA UART.

Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
---
 .../fusa/reqs/design-reqs/arm64/sbsa-uart.rst | 224 ++++++++++++++++++
 docs/fusa/reqs/market-reqs/reqs.rst           |  31 +++
 docs/fusa/reqs/product-reqs/arm64/reqs.rst    |  21 ++
 3 files changed, 276 insertions(+)
 create mode 100644 docs/fusa/reqs/design-reqs/arm64/sbsa-uart.rst

diff --git a/docs/fusa/reqs/design-reqs/arm64/sbsa-uart.rst b/docs/fusa/reqs/design-reqs/arm64/sbsa-uart.rst
new file mode 100644
index 0000000000..aac3facce6
--- /dev/null
+++ b/docs/fusa/reqs/design-reqs/arm64/sbsa-uart.rst
@@ -0,0 +1,224 @@
+.. SPDX-License-Identifier: CC-BY-4.0
+
+SBSA UART
+=========
+
+The following are the requirements related to SBSA UART [1] emulated and
+exposed by Xen to Arm64 domains.
+
+Probe the UART device tree node from a domain
+---------------------------------------------
+
+`XenSwdgn~arm64_uart_probe_dt~1`
+
+Description:
+Xen shall generate a device tree node for the SBSA UART (in accordance to Arm
+SBSA UART device tree binding [2]) in the domain device tree.
+
+Rationale:
+
+Comments:
+Domains can detect the presence of the SBSA UART device tree node.
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Transmit data in software polling mode
+--------------------------------------
+
+`XenSwdgn~arm64_uart_transmit_data_poll_mode~1`
+
+Description:
+Xen shall enable transmission of data in polling mode for domains.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Transmit data in interrupt driven mode
+--------------------------------------
+
+`XenSwdgn~arm64_uart_transmit_data_interrupt_mode~1`
+
+Description:
+Xen shall enable transmission of data in interrupt driven mode for domains.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Receive data in software polling mode
+-------------------------------------
+
+`XenSwdgn~arm64_uart_receive_data_polling_mode~1`
+
+Description:
+Xen shall enable reception of data in polling mode for domains.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Receive data in interrupt driven mode
+-------------------------------------
+
+`XenSwdgn~arm64_uart_receive_data_interrupt_mode~1`
+
+Description:
+Xen shall enable reception of data in interrupt driven mode for domains.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART data register
+-------------------------
+
+`XenSwdgn~arm64_uart_access_data_register~1`
+
+Description:
+Xen shall expose the UARTDR register to the domains.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART receive status register
+-----------------------------------
+
+`XenSwdgn~arm64_uart_access_receive_status_register~1`
+
+Description:
+Xen shall expose the UARTRSR register to the domains.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART flag register
+-------------------------
+
+`XenSwdgn~arm64_uart_access_flag_register~1`
+
+Description:
+Xen shall expose the UARTFR register to the domains.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART mask set/clear register
+-----------------------------------
+
+`XenSwdgn~arm64_uart_access_mask_register~1`
+
+Description:
+Xen shall expose the UARTIMSC register to the domains.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART raw interrupt status register
+-----------------------------------------
+
+`XenSwdgn~arm64_uart_access_raw_interrupt_status_register~1`
+
+Description:
+Xen shall expose the UARTRIS register to the domains.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART masked interrupt status register
+--------------------------------------------
+
+`XenSwdgn~arm64_uart_access_mask_irq_status_register~1`
+
+Description:
+Xen shall expose the UARTMIS register to the domains.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Access UART interrupt clear register
+------------------------------------
+
+`XenSwdgn~arm64_uart_access_irq_clear_register~1`
+
+Description:
+Xen shall expose the UARTICR register to the domains.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Receive UART TX interrupt
+-------------------------
+
+`XenSwdgn~arm64_uart_receive_tx_irq~1`
+
+Description:
+Xen shall generate UART TX interrupt when the UART transmit interrupt condition
+is met. 
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+Receive UART RX interrupt reception
+-----------------------------------
+
+`XenSwdgn~arm64_uart_receive_rx_irq~1`
+
+Description:
+Xen shall generate UART RX interrupt when the UART receive interrupt condition
+is met.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenProd~emulated_uart~1`
+
+[1] Arm Base System Architecture, chapter B
+[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/serial/arm_sbsa_uart.txt
\ No newline at end of file
diff --git a/docs/fusa/reqs/market-reqs/reqs.rst b/docs/fusa/reqs/market-reqs/reqs.rst
index 9c98c84a9a..b69699e5fb 100644
--- a/docs/fusa/reqs/market-reqs/reqs.rst
+++ b/docs/fusa/reqs/market-reqs/reqs.rst
@@ -15,6 +15,22 @@ Rationale:
 
 Comments:
 
+Needs:
+ - XenProd
+
+Run virtualization unaware VMs
+------------------------------
+
+`XenMkt~run_virtualization_unaware_vms~1`
+
+Description:
+Xen shall run VMs which haven't been modified for Xen.
+
+Rationale:
+Any kernel/RTOS can run as a VM on top of Xen.
+
+Comments:
+
 Needs:
  - XenProd
 
@@ -32,3 +48,18 @@ Comments:
 
 Needs:
  - XenProd
+
+Provide console to the VMs
+--------------------------
+
+`XenMkt~provide_console_vms~1`
+
+Description:
+Xen shall provide a console to a VM.
+
+Rationale:
+
+Comments:
+
+Needs:
+ - XenProd
\ No newline at end of file
diff --git a/docs/fusa/reqs/product-reqs/arm64/reqs.rst b/docs/fusa/reqs/product-reqs/arm64/reqs.rst
index 7aa3eeab6a..e90f275148 100644
--- a/docs/fusa/reqs/product-reqs/arm64/reqs.rst
+++ b/docs/fusa/reqs/product-reqs/arm64/reqs.rst
@@ -17,7 +17,28 @@ Comments:
 
 Covers:
  - `XenMkt~run_arm64_vms~1`
+ - `XenMkt~run_virtualization_unaware_vms~1`
  - `XenMkt~provide_timer_vms~1`
 
 Needs:
  - XenSwdgn
+
+Emulated UART
+-------------
+
+`XenProd~emulated_uart~1`
+
+Description:
+Xen shall grant access to "Arm SBSA UART" for the domains.
+
+Rationale:
+
+Comments:
+
+Covers:
+ - `XenMkt~run_arm64_vms~1`
+ - `XenMkt~run_virtualization_unaware_vms~1`
+ - `XenMkt~provide_console_vms~1`
+
+Needs:
+ - XenSwdgn
\ No newline at end of file
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 13:43:09 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 13:43:09 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785898.1195422 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjfQW-0000ge-Sc; Thu, 29 Aug 2024 13:43:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785898.1195422; Thu, 29 Aug 2024 13:43:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjfQW-0000gX-Pp; Thu, 29 Aug 2024 13:43:04 +0000
Received: by outflank-mailman (input) for mailman id 785898;
 Thu, 29 Aug 2024 13:43:03 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=dlBE=P4=cloud.com=frediano.ziglio@srs-se1.protection.inumbo.net>)
 id 1sjfQV-0000gR-SU
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 13:43:03 +0000
Received: from mail-oo1-xc29.google.com (mail-oo1-xc29.google.com
 [2607:f8b0:4864:20::c29])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9b7f335b-660c-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 15:43:01 +0200 (CEST)
Received: by mail-oo1-xc29.google.com with SMTP id
 006d021491bc7-5df998d7a44so385052eaf.2
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 06:43:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9b7f335b-660c-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1724938980; x=1725543780; darn=lists.xenproject.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=9a5vcWm5an8nEcn6WsqlhOT0b47Xfg8gWU0il8eCCTE=;
        b=T2X/9sN6kLDPmFio0wCmtgUy1i1uf16lvsVgCr5+7QeyEZfT6vGGsRSjqlaftNdvUb
         AMKLAW9qEKu97ko6L4ICkiStjJgq9qblU8I56wSzDf571crunQa85wXdAwfgUEkaWvBi
         pxDmQd1CKj7d8bkeLuup3upbaoZTJoYGlXBgA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724938980; x=1725543780;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=9a5vcWm5an8nEcn6WsqlhOT0b47Xfg8gWU0il8eCCTE=;
        b=Z6gLGcNGI25QyHpybdmPRM5YURz26sLXUGvxKrNH+wqos7HS6/OdxiCHyZNg/+bFVJ
         y/xr1RxzQzNAuShR2Qkn/kjpR3KyszQZXaYI6hYHaTx/0orASiP8yCNPsRnmJFn6uqxc
         YC9PoRVC8bWJaD5aIo+md4AB09AjS174GaqZ7hK/ACoWikO4I7VH63MzoiGud6b9yaXu
         haGXvEE0kkJPdddACXdKYHFOQLtpAO07S2/X7jCHlBYUOJm52Z3dRx/r6RhU0wbv38Gv
         2yszzGUyUxLwPrEfnjC8GZ90paGuUXDg7hmLp/BGWUaFZKr34tWtEi4nsuB4Lf0XG6nD
         aydQ==
X-Gm-Message-State: AOJu0YxPJjwcDY7DbigfVZCVA1GVTVXpUCzW4URtzL8M/bHQerEiR6/h
	EzCX9YP6MwPRDE3F3P+w5ovNqHcSmaL6OM/j6aqhEuQET0C5xFjIQNV8aBAzuW3Yu9w9ajVvu7y
	zDp7VaXpuCfhzIz71OgsuHWFOEaHzOI5K7JmdNA==
X-Google-Smtp-Source: AGHT+IGU8/YsbUCa7lD/roEvB6YnJZfJiXZdyTdf7WKEaoWmjDfYhvpSQYkbrp0D2sjqKqLbh4b/A1q3+Ysk4LTm0QU=
X-Received: by 2002:a05:6808:1302:b0:3dc:299d:c505 with SMTP id
 5614622812f47-3df05e22505mr2539841b6e.37.1724938980053; Thu, 29 Aug 2024
 06:43:00 -0700 (PDT)
MIME-Version: 1.0
References: <20240829115247.168608-1-frediano.ziglio@cloud.com> <594b5ad4-0b86-4397-a261-0e98515e3abe@citrix.com>
In-Reply-To: <594b5ad4-0b86-4397-a261-0e98515e3abe@citrix.com>
From: Frediano Ziglio <frediano.ziglio@cloud.com>
Date: Thu, 29 Aug 2024 14:42:49 +0100
Message-ID: <CACHz=Zj3Mw+7EbbB3vdndu5bzhXEN3p1JV4Dzm12Xt2EE1AV+Q@mail.gmail.com>
Subject: Re: [PATCH] x86/boot: Use C99 types for integers
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>, 
	=?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Thu, Aug 29, 2024 at 1:07=E2=80=AFPM Andrew Cooper <andrew.cooper3@citri=
x.com> wrote:
>
> On 29/08/2024 12:52 pm, Frediano Ziglio wrote:
> > diff --git a/xen/arch/x86/boot/defs.h b/xen/arch/x86/boot/defs.h
> > index 239b9f8716..ee1a4da6af 100644
> > --- a/xen/arch/x86/boot/defs.h
> > +++ b/xen/arch/x86/boot/defs.h
> > @@ -57,7 +57,7 @@ typedef u16 uint16_t;
> >  typedef u32 uint32_t;
> >  typedef u64 uint64_t;
> >
> > -#define U16_MAX              ((u16)(~0U))
> > +#define UINT16_MAX   ((uint16_t)(~0U))
> >  #define UINT_MAX     (~0U)
> >
> >  #endif /* __BOOT_DEFS_H__ */
>
> I'm happy with the change in principle, but could we see about dropping
> defs.h entirely?  For example, we've already got both of these UINT
> constants in types.h
>
> Since this was written, we've got rather better about cleaning up
> xen/types.h, and extracting macros into xen/macros.h
>
> I think there's a good chance that the regular headers can now be used
> directly, or with minor tweaking.
>

I tried, it gave a huge bunch of errors.
I think it can be done in a later follow-up.

Frediano


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 14:04:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 14:04:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785907.1195432 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjfkd-0005Q4-HE; Thu, 29 Aug 2024 14:03:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785907.1195432; Thu, 29 Aug 2024 14:03:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjfkd-0005Px-Df; Thu, 29 Aug 2024 14:03:51 +0000
Received: by outflank-mailman (input) for mailman id 785907;
 Thu, 29 Aug 2024 14:03:50 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjfkc-0005Pr-1m
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 14:03:50 +0000
Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com
 [2a00:1450:4864:20::531])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 824bfaf1-660f-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 16:03:46 +0200 (CEST)
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5bec4fc82b0so3124542a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 07:03:47 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226ccff4bsm748439a12.70.2024.08.29.07.03.45
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 07:03:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 824bfaf1-660f-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724940226; x=1725545026; 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=rW+ItIsfoHzQDBbyvLOPy9LlX7H+e9rA+BLsO5BJ9fI=;
        b=c1rahDGbO45itSDYNB0UgRzFdfgoM1lQLJQIX7I6uNBvqtc22GXmGgu+ss1ouMZ26T
         o6Mnsnfj/vkCulspwftHv63rAHbH2X0pw/eVzGLC5+9CXUNByqB9IAVH/2qr93jviNJi
         OPB9aQkOOfkuv3jCdR8/uqmlJtiDMrx4/Asah0oC4XGKWmPc46po5aV6m8hknZasqgY/
         dMNtS8lv/B4HGX2lG6CwwxdwDpj+I7TUxeayZEbM/5UIH804uSjLH3CO83WxfHQ1AIY8
         riYidd8GsikAy2JVah3FPVcbV4dO78z+5l09bKY7OnxAn1R3jrRnKKxfRJ/Z81Z93jJh
         oQWQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724940226; x=1725545026;
        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=rW+ItIsfoHzQDBbyvLOPy9LlX7H+e9rA+BLsO5BJ9fI=;
        b=F0cfXKMhYFHhA13geQJT7h262/s986G/C37FmJ2BHXkhvNlpOu2+ytpGFD8nzSo4ac
         CqcvE8VqCrN83PGtK1YX9DNI9Piemz2B05J5RCbZqwQal84ZYkC+zkVfWm3G8qRPSsrR
         x8lf/4G1vUqpE46aN8mRkPVaM4pLqoWw7rF+VVs2B1XroMWFmWf8J4IiEIlGjU1HWNbA
         V7vhAmzCQf+YZn1FCCe7G/5qvEYxZ6X/6K7QEIYuUvnXYCGpZ5ZUsB6N6kvhuKfFP1pL
         F3t8aJa4YmO1wbFEOunxmVCx5+teJ+AgRaZbRhWzixWHvlWk5jNbQicH6LKzChNkEND1
         I+Lg==
X-Forwarded-Encrypted: i=1; AJvYcCUnP+SPl+8KLbML+y2j/3XN3LvWpkY1TKGX2qxHycbBXTlfYW5pxUyYMJ58EJOx2u4xatfAxWXSHu0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxO/HPfSQEy7Eqozg+qKPoc2lQ5MCWC87556s1vYXmdyZFTF3MW
	DWmu1LFoJOKF1HX/z2khmeT4v53a2MUkddlsqXpxKP1WOuTObZyU4J6unsLUfg==
X-Google-Smtp-Source: AGHT+IGEhQK9uq+7i8QUWkK2DQ3yKr0YMtQKW3oLSslyGa/hr2SPpNQJhga3GbqnAY79lQuDQB+YXQ==
X-Received: by 2002:a05:6402:3506:b0:5c0:a8b8:dd6b with SMTP id 4fb4d7f45d1cf-5c22018ad3dmr4167837a12.14.1724940225952;
        Thu, 29 Aug 2024 07:03:45 -0700 (PDT)
Message-ID: <4381179f-bcca-4bd4-8dcf-8de79b79c405@suse.com>
Date: Thu, 29 Aug 2024 16:03:44 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 01/11] xen/compiler: Rename __attribute_const__ to
 attr_const
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
 <20240828220351.2686408-2-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240828220351.2686408-2-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 29.08.2024 00:03, Andrew Cooper wrote:
> There's no need for the name to be so verbose.
> 
> No functional change.
> 
> Suggest-by: Jan Beulich <JBeulich@suse.com>

The form you use here was your suggestion, wasn't it? I'm fine with the
change as is, so ...

> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

Yet I still would have liked the more generic

#define attr(attr...) __attribute__((attr))

better.

Jan



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 14:08:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 14:08:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785911.1195441 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjfor-0006tH-1C; Thu, 29 Aug 2024 14:08:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785911.1195441; Thu, 29 Aug 2024 14:08:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjfoq-0006tA-U5; Thu, 29 Aug 2024 14:08:12 +0000
Received: by outflank-mailman (input) for mailman id 785911;
 Thu, 29 Aug 2024 14:08:11 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjfop-0006t4-BI
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 14:08:11 +0000
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com
 [2a00:1450:4864:20::532])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1eaef7b1-6610-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 16:08:09 +0200 (CEST)
Received: by mail-ed1-x532.google.com with SMTP id
 4fb4d7f45d1cf-5bec4fc82b0so3130101a12.1
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 07:08:09 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8989021973sm83115466b.82.2024.08.29.07.07.57
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 07:07:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1eaef7b1-6610-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724940489; x=1725545289; 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=OucCFpg53QMwr2D4n6uKH73osXrEEX/NwpoqVurCiSE=;
        b=UdRTS+htDfml2JFOwXSpvLpHJ4fOwEzALKfSU+YOP8vt6pQOrHotR4XR/AEJQyacc+
         OUOenqxGR9qX39mbIc7i2xJ9lnMqpRD+V2OEWxiXQYEykHSC2HWRjMH4JyzvRdpzUUF+
         UmrzeTis3z0zPYN0bMkc8DTzbx4e1xtt1Ya9Bz4hY5JX8ph44pvciwA1yXe+Bb6huKkv
         WSfyybOMkYF1n80RysitU+56zcp1K8IFd9yHyCtcWgXy/9+awlwwtF8NyZo2sPOr5Yc5
         r+I3fkzUUSIT/RjKwitxeuVXQkxD4LFVrEF2p23pg/ztQWNXXYbtjb7Arx+rhlH/D8Yg
         s14g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724940489; x=1725545289;
        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=OucCFpg53QMwr2D4n6uKH73osXrEEX/NwpoqVurCiSE=;
        b=FkRjW5ntsBZHx9F7nRZXLvmGMHGJTauBF4rK1hKJLVstcL3kO/C5qQgSdaPUeyW8fY
         ujInNRo47UPvwKq21Syl1X04O539+BYp0la3BCSVEvMsZhaZSjHDvjCvLCfqe2W4TsUM
         NRXQkcr0iarEXkBrReMSgyV2+FRQVDZX83Y9tLqlvK8AfYZokxt79VrsO4TRnHD1zxud
         J13t3ZqGQloRSQ1RJVtBrTJS3e5AZV/16PWhx0Tx4LFTeOesGnYrvhjiQL+r6gZU7EQu
         YVyXWgcZrBwjw1oxqjD0xBx7sZ8G/OOcCR5ji12zsdMkXEYg/ss0UQmdKyu4AWbRXVul
         glsg==
X-Forwarded-Encrypted: i=1; AJvYcCU/tfMsprMz9+Z+z9Yu8+5MFymH2l+B0B4DxR7Nj43VP8hFExhFJmCYJgjA7k8UH9rlmz2jHYXfaeY=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxAF5dN1PAk8O5R4sJZD6Qx2joaYuKokcmBLct9bh/w64VdVTHH
	flVDdhSxTs8kRMRCPVP6ZpRsiTkoTiklLk/PbPo6Px1AeK4bR70ILdrBOakhHqCyra9MnTfXpXM
	=
X-Google-Smtp-Source: AGHT+IE5ndOWrAVJvXNQDhnidKrJlOlYtaroRNDFuietyVHVW9mBLgSBoipdfR54mfA/Pnye/2Qwiw==
X-Received: by 2002:a05:6402:42cb:b0:5be:ecd9:c73e with SMTP id 4fb4d7f45d1cf-5c2200f17b6mr4104535a12.2.1724940477903;
        Thu, 29 Aug 2024 07:07:57 -0700 (PDT)
Message-ID: <116eba82-9075-4d38-86b7-6ee0001b4a87@suse.com>
Date: Thu, 29 Aug 2024 16:07:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 02/11] xen/bitops: Switch from __pure to attr_const
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
 <20240828220351.2686408-3-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /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: <20240828220351.2686408-3-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 29.08.2024 00:03, Andrew Cooper wrote:
> All of the ffs()/fls() infrastructure is in fact (attr) const, because it
> doesn't even read global state.  This allows the compiler even more
> flexibility to optimise.
> 
> No functional change.
> 
> Reported-by: Jan Beulich <JBeulich@suse.com>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Julien Grall <julien@xen.org>
> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
> CC: Bertrand Marquis <bertrand.marquis@arm.com>
> CC: Michal Orzel <michal.orzel@amd.com>
> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> CC: Shawn Anastasio <sanastasio@raptorengineering.com>
> 
> v2:
>  * New
> ---
>  xen/include/xen/bitops.h | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)

The various arch_* forms didn't have __pure and hence also don't gain
attr_const presumably because we deem these attributes ineffectual for
always-inline functions? On that basis
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 14:10:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 14:10:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785917.1195452 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjfqt-0008OL-Fx; Thu, 29 Aug 2024 14:10:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785917.1195452; Thu, 29 Aug 2024 14:10:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjfqt-0008OE-CR; Thu, 29 Aug 2024 14:10:19 +0000
Received: by outflank-mailman (input) for mailman id 785917;
 Thu, 29 Aug 2024 14:10:17 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjfqr-0008O6-NU
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 14:10:17 +0000
Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com
 [2a00:1450:4864:20::629])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 6a072015-6610-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 16:10:15 +0200 (CEST)
Received: by mail-ej1-x629.google.com with SMTP id
 a640c23a62f3a-a8679f534c3so77492566b.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 07:10:15 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89891968e9sm83045666b.120.2024.08.29.07.10.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 07:10:14 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6a072015-6610-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724940615; x=1725545415; 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=xChegkYL3ZJ3hmg0fZfaQeXYfxu5WzVZDZ2+vkj50kU=;
        b=eUKzs7fMLMEfZZZjkkQyXLz113nJIBnC0M+1ScfzBrKIdGutXXbjBLrYAO8nM1uKHO
         lNoSpWbh61xbcutidXwFZsSwnEyVjvOz9+8SQrtlyUAcRIB6uU5zxtSwQN0YFSBMGBAA
         bC60304mK92a1y/HT0QpI0+0Uv2KMIJyPuyfUTIFXIptHcJXmR+ShrprTtEb0yeZqoKO
         aVhNgljlEdOEInfXSdtGYtO6DHEdGEBG4OYEEOMg6opl6UnnyO89tQflHd6QFERFKrVj
         T6B/wlMCnHFv+2mlamEY4ylmwNB0ecqyi36AbM+dBsd9Xo3vbzQ0BUyFcXxm1n/Lr2GW
         yAxA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724940615; x=1725545415;
        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=xChegkYL3ZJ3hmg0fZfaQeXYfxu5WzVZDZ2+vkj50kU=;
        b=j0BM0Hqix7I/csR/3cLeBxkn0bIpyzibUmALc07FmRg2eI/pwdN4arCU91+uerfNJb
         X/ygyCJSEG2SgBnv+upQ5yESph6bP1wjL9N2ZH9rwHBdSrOS9xfQANXLHLmfJRDdyo0t
         NCT0cQ1sHB+7Fx42Q0hI3iBYhKMrTptOoxCPq56kTdNwlQY6GqxF7iSbtRChKmpGrafe
         LE3kE+n7nUE+FNf2TflL/MC6eH5axTyqxzd+Zw6YEcBw2OkiSMOIWoswlqreY5HydSEA
         ApONdMhXIsOH14IoCLNTVq532nptd6TYKbFoLg5fCSIiJq/Yd8P5bpYABz0TwNIeI5p9
         XakQ==
X-Forwarded-Encrypted: i=1; AJvYcCWMnG/+ZOSqbh7Fkr1M+tln1+l7xw2JkJLnXXurCvItI2yAxFkq2YcS9RU5f+9Hb3vaERDTWfjdCdM=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwpJtr2gwr5HJpJssVrp4OSYn0c9+sXGCa6vNcGK9aKUdCNQXFy
	KiBYBPiPXteEFyODGhGE2wREpuZOj3zNCC564DsO1LBspe6BPovrcGIucf6HBg==
X-Google-Smtp-Source: AGHT+IHFLDd0NcJ9MrqY+G+kYbalA83Mlp/cdd+cMqkVXXw7P90ybkVpx/rPfKdTIWuFF4NoieR3ww==
X-Received: by 2002:a17:907:980f:b0:a7a:929f:c0cf with SMTP id a640c23a62f3a-a897f83ad77mr250599966b.21.1724940615074;
        Thu, 29 Aug 2024 07:10:15 -0700 (PDT)
Message-ID: <3a397df2-7a29-4e30-bb8c-4ec8b54d949c@suse.com>
Date: Thu, 29 Aug 2024 16:10:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 07/11] xen/bitops: Introduce generic_hweightl() and
 hweightl()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
 <20240828220351.2686408-8-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240828220351.2686408-8-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 29.08.2024 00:03, Andrew Cooper wrote:
> There are 6 remaining callers in Xen:
> 
>   * The two hweight32() calls, _domain_struct_bits() and efi_find_gop_mode(),
>     are __init only.
>   * The two hweight_long() calls are both in bitmap_weight().
>   * The two hweight64() calls are hv_vpset_nr_banks() and x86_emulate().
> 
> Only bitmap_weight() and possibly hv_vpset_nr_banks() can be considered fast
> paths, and they're all of GPR-width form.
> 
> Furthermore, the differences between a generic int and generic long form is
> only an ADD and SHIFT, and only in !CONFIG_HAS_FAST_MULTIPLY builds.
> 
> Therefore, it is definitely not worth having both generic implemenations.
> 
> Implement generic_hweightl() based on the current generic_hweight64(),
> adjusted to be compatible with ARM32, along with standard SELF_TESTS.
> 
> Implement hweightl() with usual constant-folding and arch opt-in support.  PPC
> is the only architecture that devates from generic, and it simply uses the
> builtin.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Thu Aug 29 14:24:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 14:24:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785925.1195462 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjg4U-0002Sn-LA; Thu, 29 Aug 2024 14:24:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785925.1195462; Thu, 29 Aug 2024 14:24:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjg4U-0002Sg-Hd; Thu, 29 Aug 2024 14:24:22 +0000
Received: by outflank-mailman (input) for mailman id 785925;
 Thu, 29 Aug 2024 14:24:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjg4S-0002Sa-Vm
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 14:24:20 +0000
Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com
 [2a00:1450:4864:20::235])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 60d8f813-6612-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 16:24:19 +0200 (CEST)
Received: by mail-lj1-x235.google.com with SMTP id
 38308e7fff4ca-2f4f24263acso11624481fa.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 07:24:19 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89891a3d60sm84401266b.123.2024.08.29.07.24.17
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 07:24:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 60d8f813-6612-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724941459; x=1725546259; 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=1yeUeXMVCCYMjnDWBO8RbTQPtDKrzLwgR/Gfr6iSrh4=;
        b=QzNIJFPk3hk1YGwvRota2JuSfodU2Una0X2WjbsYy/nZUjaBbxN7H1pm3QSaiH8nCV
         nCMfS0EQ617zG5I0fCvgAYp+Z+rmFNEDcNtNIe4XmHEs+xEHNLP1wHpJegveoe2SUu6s
         pVLHL7nJfdtJcDAl5Jl6jQoaN3BRfArJZlpOjI7bw6lRZYQaneoBYN62WQfd1BUd4d2S
         WSw1XsOPc1qsIcHzGRijCyI6cY/YECYWpIvX0jZmAn2eEkhSA0bsLCrundDAxBN3kA/B
         Wjg8qn1KpLpEaC1e0Qfkl5Mos/HO6391RAv5Wm7XpvChibB9zG85vFjJxFN8BpI5Z6GA
         3NpQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724941459; x=1725546259;
        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=1yeUeXMVCCYMjnDWBO8RbTQPtDKrzLwgR/Gfr6iSrh4=;
        b=GxnXbD1ya3E7mTrcIv2FAZqs5kwcqAnX6jOKfQhkWUgph2VSAUrI9G28x3+ctFsIgn
         QM9U8UWs1A58mHDzUy/28RoclFzhe9lRI/HOWRiIyZpGnZh4ohj1RW3gwdC6+zr/7vE+
         5s5qkyNe5BNB3NVU+ggLk17EAHlgR0fxBAoqwuJ6OUB4I3i7/t2cwDbSCk1XcQTUmssr
         47CHK0y70ZyGD3/FoTgm+DkHFtjFI+CgNYpbNTmmw5OqFPzd0i3z44CrPAcRZt2ztvxX
         mIKdzmtqEIHkatL05gsDL+h5Gnrmh7dKhUgNv8CC74O82oXHwWgl//7RjL8uXh7pl090
         8FCA==
X-Forwarded-Encrypted: i=1; AJvYcCVHlIXl31s/tO8CNarxPciwfb6WyBWWQZ0Ie8/4wzqj8jXTXFcehIoNdg1FL/Pj37pRcoGruTZlqM4=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyP1srwmR/pGxNpzhHgAZuu8g/PJzuU7mCGae7WGZbfMhSRaMJT
	Fj8NkP0/Igz6utAINq7OuwdIefRRtzD8CkysSfhPMjM+PSk9ySlp5Km4miuZnQ==
X-Google-Smtp-Source: AGHT+IGWHtvarJP6h9sDnWnpOLIEVg37S1tD2gDTbApy82dyRGM5Gk5Mn7iM6KRlO4n4wFHWfIEw9w==
X-Received: by 2002:a2e:be8a:0:b0:2ef:28ed:1ff2 with SMTP id 38308e7fff4ca-2f6105c494emr28019021fa.9.1724941458424;
        Thu, 29 Aug 2024 07:24:18 -0700 (PDT)
Message-ID: <afb66c02-8732-4dff-91dd-3ff1b8a8fa1d@suse.com>
Date: Thu, 29 Aug 2024 16:24:16 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 09/11] xen/bitops: Implement hweight32() in terms of
 hweightl()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
 <20240828220351.2686408-10-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240828220351.2686408-10-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 29.08.2024 00:03, Andrew Cooper wrote:
> --- a/xen/include/xen/bitops.h
> +++ b/xen/include/xen/bitops.h
> @@ -326,6 +326,11 @@ static always_inline attr_const unsigned int hweightl(unsigned long x)
>  #endif
>  }
>  
> +static always_inline attr_const unsigned int hweight32(uint32_t x)

See my question/remark on the earlier patch: I think we want to be consistent
with always-inline functions and const/pure attributes. Since elsewhere we
omit it, I think it should be omitted here, too.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 14:26:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 14:26:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785929.1195471 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjg6e-0003QH-0P; Thu, 29 Aug 2024 14:26:36 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785929.1195471; Thu, 29 Aug 2024 14:26:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjg6d-0003QA-U3; Thu, 29 Aug 2024 14:26:35 +0000
Received: by outflank-mailman (input) for mailman id 785929;
 Thu, 29 Aug 2024 14:26: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=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjg6c-0003Q4-Uf
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 14:26:34 +0000
Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com
 [2a00:1450:4864:20::52f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b1329753-6612-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 16:26:34 +0200 (CEST)
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5bec87ececeso790593a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 07:26:34 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226c7cfdasm768979a12.58.2024.08.29.07.26.32
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 07:26:33 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b1329753-6612-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724941593; x=1725546393; 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=NtyUbmcf+TaZt4jF4n1fZqLl9i9eG/bJ7xH4Jvx94HA=;
        b=RiB3sKZngcPR7M1HdcyXqDPYbcLT6W1CppIWRHcF7WAgRDmkMvptYjmV0AcE3mzhfK
         PqpJhFHYDX1+pRMaLkxuRNJa0F/iefV8b+4SXa+mZzadUV2egBkTu8A5syTIjS1TvcqU
         piU238J9+FBm3RMnhsNK78L+aimUyHCOhosugomdThNq8Fi7iwN8f58SEG9uEVNVXD5x
         MwaTNXpGRVP/59xOb5W9hOB9vi5O8E8GYfjuSvHSrwSNqIXlwGgcg6FJVoH1HKS23jnW
         L1MtjMQbikFja+LYmpUTp1BYRX2mVQVEpfjuBDmCexE4HRFxnZAPMzyP85UivLwhJACs
         68OQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724941593; x=1725546393;
        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=NtyUbmcf+TaZt4jF4n1fZqLl9i9eG/bJ7xH4Jvx94HA=;
        b=icFwkHOUv8WUnrFMZONf8Xc8VEZwiIACyiOxXxl3WV5s6Pf5wAyXTLirtKNrHsYMUd
         PQV4nRbc0nRZzyZ2xgGoyPowYlzvTknr8Rd2EPpAD9B3uA8P8tJjijQ3fybYScnoSUWk
         fbuf/hsQWzncmBHKLHN+Hs10Uh52H6B45HelqFxvhPv27aDY5q0JiH2g4key1lEYO7D+
         0atg1dVURYjzwm2CYYi9NqeRvQcBKYozecSquVJxHiJy4YDJhE2k8GevFWY/y9MYjHeD
         KLJRdKGLrXWqHikDgI3x18OwUOfzvHyPMWoVq2QoEkt5CSavXOiu/GPegIwWcYs5KqNs
         Xc7Q==
X-Forwarded-Encrypted: i=1; AJvYcCX3GcsKCecrhoGXoTVA3pZuYQ9yg/B+WI5R5qYT6OL14649ryUddqhAY135qxNlaxP9sAgEsrmybQc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwotMq3Jw1f2tbbdiYD58p/hzaNEotlfNRt4ujTtI+AbEv28UbW
	WsIwjC4BJsa684QYPp4EGWrf+nRytL8WNGRx/75J3wwaK05fD0VyDGwD0nQXFw==
X-Google-Smtp-Source: AGHT+IEjsECHk0l+GNxCaulIUZh+3PejoqfbJof12GRRpchY3qJlf6vhQbWWtm6wC5CjPlkMYf4KPw==
X-Received: by 2002:a17:907:7e9a:b0:a86:8524:2558 with SMTP id a640c23a62f3a-a897f7895d4mr306151566b.12.1724941593338;
        Thu, 29 Aug 2024 07:26:33 -0700 (PDT)
Message-ID: <ed4265dc-b9a7-4c0c-8587-5b2fe2b90c5b@suse.com>
Date: Thu, 29 Aug 2024 16:26:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 10/11] xen/bitops: Implement hweight64() in terms of
 hweight{l,32}()
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
 <20240828220351.2686408-11-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240828220351.2686408-11-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 29.08.2024 00:03, Andrew Cooper wrote:
> --- a/xen/include/xen/bitops.h
> +++ b/xen/include/xen/bitops.h
> @@ -331,6 +331,14 @@ static always_inline attr_const unsigned int hweight32(uint32_t x)
>      return hweightl(x);
>  }
>  
> +static always_inline attr_const unsigned int hweight64(uint64_t x)

Same remark here as for the previous patch.

> +{
> +    if ( BITS_PER_LONG == 64 )

This can be >=, can't it?

With the adjustments:
Reviewed-by: Jan Beulich <jbeulich@suse.com>

Without:
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 14:37:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 14:37:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785940.1195482 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjgGj-00066I-Ur; Thu, 29 Aug 2024 14:37:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785940.1195482; Thu, 29 Aug 2024 14:37:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjgGj-00066B-Re; Thu, 29 Aug 2024 14:37:01 +0000
Received: by outflank-mailman (input) for mailman id 785940;
 Thu, 29 Aug 2024 14:37:01 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjgGi-000665-Uw
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 14:37:00 +0000
Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com
 [2a00:1450:4864:20::534])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 255e78e0-6614-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 16:36:58 +0200 (CEST)
Received: by mail-ed1-x534.google.com with SMTP id
 4fb4d7f45d1cf-5becd359800so827312a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 07:36:58 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226c7304fsm767642a12.29.2024.08.29.07.36.57
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 07:36:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 255e78e0-6614-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724942218; x=1725547018; 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=vx31+ZcZhCXIra5jHzn5w+458vRmv7WDBiTjEo5e6sM=;
        b=VF/Nu6dU0eC23PKq1fljE130q1tLk0yAcbyv+sTxLekdC4OPKj/759Mc2Y3oEh78vL
         mRLe7No7naWsxuW0OxKSFguXY/hnvR7jX8XpxECciemuTTZCfWkbDdz3sCtViAkiYksa
         tpenH3IDz3JdAyNVr+i7hmrwV4UHtD/hA2W8td20KuQW5cTW7Xi7TehNLxN9S/EXn8DU
         03OmvXHKLV4lXMR00qKhwA8mKOpm71WKMCqTutR3mVFLcwkaelSpPb8F01tSBML4J1+Q
         ZOqECGJCcpJ2HVP3D/ox0noGj/JOnZG2N+ug9zxA1MyfF7G3IaPNvLUpZ229/rNda2r1
         wLVw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724942218; x=1725547018;
        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=vx31+ZcZhCXIra5jHzn5w+458vRmv7WDBiTjEo5e6sM=;
        b=oK3PY0CI64baOnUpPzuoLehUpE+YqWTMvFMOuAO1zOQnlnMxvKUGRa7VYt23GK/G5Q
         mluZ4VXAa8kIrAUtH7k2LbeXXTdTpSqjpRBWBhoPuRdNLXynsEodN8Tg5ovfmqnULKNc
         TyV5+wmOPs3fdPtx8vs3npdSKSjW4CshrYX5RhTLNuvxAea62RoKbhe+3GZixNJr1oof
         hL+SQRML7m8juqfVuDzMqhY5mxL5Hvvfe/iL36rxRvEqS7lUlkE9NQTMzBtjOMVAn9Pi
         LNqeYUwxLAHrqcoDmVypWRdstLkrttyRiIscF5RyEJfegVUM4PKgJ+OFBoIaDoKgB7rG
         kY8g==
X-Forwarded-Encrypted: i=1; AJvYcCUMFtlYTPDcxmSpk3tHSm3hcpcTlYuEw76TohlVnIR6cp0CIG/At2yxhytp6kobBxA0tn+0pVRS8KU=@lists.xenproject.org
X-Gm-Message-State: AOJu0YziuxYfGx7XMf7OrcXmjavfmf5H0EPDP+0dnlwY5MvjNMbexQ95
	5uTSZbEmQu7zJNPAvQ2uODpWobpyy3aDywUUfJilFqDxV2KodbsXXD6hJgpkXw==
X-Google-Smtp-Source: AGHT+IFFi3B8ot9bFyw+6VkEBpYUQlN0J2uZ8nVRvjIoQVenmJ3o+cpwMGoMVKHZUV3399eO27NgDA==
X-Received: by 2002:a05:6402:84b:b0:5c0:c6a7:bd24 with SMTP id 4fb4d7f45d1cf-5c21ed976d1mr3012681a12.30.1724942217883;
        Thu, 29 Aug 2024 07:36:57 -0700 (PDT)
Message-ID: <48377e77-2458-439c-b594-21bde610ffbb@suse.com>
Date: Thu, 29 Aug 2024 16:36:56 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 11/11] x86/bitops: Use the POPCNT instruction when
 available
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
 <20240828220351.2686408-12-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240828220351.2686408-12-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 29.08.2024 00:03, Andrew Cooper wrote:
> It has existed in x86 CPUs since 2008, so we're only 16 years late adding
> support.  With all the other scafolding in place, implement arch_hweightl()
> for x86.
> 
> The only complication is that the call to arch_generic_hweightl() is behind
> the compilers back.  Address this by writing it in ASM and ensure that it
> preserves all registers.
> 
> Copy the code generation from generic_hweightl().  It's not a complicated
> algorithm, and is easy to regenerate if needs be, but cover it with the same
> unit tests as test_generic_hweightl() just for piece of mind.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> 
> v2:
>  * Fix MISRA 8.2 (parameter name) and 8.5 (single declaration) regressions.
>  * Rename {arch->x86}-generic-hweightl.{S->c}
>  * Adjust ASM formating
> 
> The __constructor trick to cause any reference to $foo() to pull in
> test_$foo() only works when both are in the same TU.  i.e. what I did in
> v1 (putting test_arch_generic_hweightl() in the regular generic-hweightl.c)
> didn't work.

I'm afraid I don't understand this. What exactly didn't work, breaking in which
way? Presumably as much as you, I don't really like the global asm() in a C
file, when ideally the same could be written with less clutter in an assembly
one.

> This in turn means that arch_generic_hweightl() needs writing in a global asm
> block, and also that we can't use FUNC()/END().  While we could adjust it to
> work for GCC/binutils, we can't have CPP macros in Clang-IAS strings.

What does Clang different from gcc there? I was hoping that at least their pre-
processors would work in (sufficiently) similar ways.

> --- /dev/null
> +++ b/xen/lib/x86-generic-hweightl.c
> @@ -0,0 +1,69 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +
> +#include <xen/bitops.h>
> +#include <xen/init.h>
> +#include <xen/self-tests.h>
> +
> +/*
> + * An implementation of generic_hweightl() used on hardware without the POPCNT
> + * instruction.
> + *
> + * This function is called from within an ALTERNATIVE in arch_hweightl().
> + * i.e. behind the back of the compiler.  Therefore all registers are callee
> + * preserved.
> + *
> + * The ASM is what GCC-12 emits for generic_hweightl() in a release build of
> + * Xen, with spilling of %rdi/%rdx to preserve the callers registers.
> + *
> + * Note: When we can use __attribute__((no_caller_saved_registers))
> + *       unconditionally (GCC 7, Clang 5), we can implement this in plain C.
> + */
> +asm (
> +    ".type arch_generic_hweightl, STT_FUNC\n\t"
> +    ".globl arch_generic_hweightl\n\t"
> +    ".hidden arch_generic_hweightl\n\t"
> +    ".balign " STR(CONFIG_FUNCTION_ALIGNMENT) ", 0x90\n\t"

Maybe better avoid open-coding CODE_FILL, in case we want to change that
down the road?

Also could I talk you into dropping the \t there? Canonical assembly code
wants ...

> +    "arch_generic_hweightl:\n\t"

.. labels unindented.

Jan


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 14:42:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 14:42:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785949.1195492 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjgLz-0007dB-Jv; Thu, 29 Aug 2024 14:42:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785949.1195492; Thu, 29 Aug 2024 14:42:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjgLz-0007d4-H3; Thu, 29 Aug 2024 14:42:27 +0000
Received: by outflank-mailman (input) for mailman id 785949;
 Thu, 29 Aug 2024 14:42:25 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=LPGY=P4=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sjgLx-0007cy-OB
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 14:42:25 +0000
Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com
 [2a00:1450:4864:20::230])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e726c094-6614-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 16:42:23 +0200 (CEST)
Received: by mail-lj1-x230.google.com with SMTP id
 38308e7fff4ca-2f50966c448so7929561fa.2
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 07:42:23 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 38308e7fff4ca-2f614f384eesm1860351fa.62.2024.08.29.07.42.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 29 Aug 2024 07:42:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e726c094-6614-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1724942543; x=1725547343; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=yegLIobAX3JcGEVXi/TSJXJCqTJI6vrDcDN4DRWWpac=;
        b=ME8iB/03C75jhIxjBqmezRCKjYeaRSlIcnQRyp8ZGXZ5Z0EwhG2vsfbfSsWlCDrwfQ
         KCDaTfCjIkibmchJs4YVQ8cY3YKyrm6hSFui/TlH7RjZ9h4Tro2MuO27a+tQOWd+dojb
         FZTfeOX2oQCqXXWQ7Tij3CFxOHcH1pY+AivQl3srGpOBTWL0fhj3WLOwNoRjzAc412Lz
         z2aIRTQDwBrelRubyu0ZNSBbfTRFRP9f6O97RGWXy+NxugX/AUt7tNW5isR2yePwKeYN
         ULVsbHGQjjh7exzpkuVYRr7Zv1FJJ9jQqxDm+3ZaY0vUf2NyWeZcjZZHjKYGm60688Go
         vwXg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724942543; x=1725547343;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=yegLIobAX3JcGEVXi/TSJXJCqTJI6vrDcDN4DRWWpac=;
        b=M0wl+wLXPXxleVEuM5PVvowLXa8AnW3m7py4GMsTrYLLp56k5KuoLuIfCkA/rMN9wX
         A3YOMnRFT50tlmKUmIXHJ5Q69p3SFZFlgOhrayS3/QS9TV7epISsnp6iAi0k9eIJoTsj
         RBu/gYDY3xToSeldt2wWgldlZs3g5/7dbkkxkIwnxpqTXQt9JUZ/t0vPIXrjYhqy6w7x
         ukYRqoDj2D4VVa7JWUKnGCxhu/MBBOtsQdUXKvOKNJwInztcYgoD1JWgxbZHFv4nUedr
         aTcnnUeItAnLPDAVQN/IP/d6OlErCNeWkA1aK/eb/uWxbNSW82i99GvtlFko+1JTdhuO
         /qww==
X-Forwarded-Encrypted: i=1; AJvYcCVwA9wa6CYVS/254mUnnwCvA91E10css9fNGN21OWkpcmIRnStomHhP9UV99xstH+SG5cJUkmQsz3Y=@lists.xenproject.org
X-Gm-Message-State: AOJu0YzUfonvUkVH9fSOOWSc2E2C8M1IhTKBTfSNN9f9q8wwIMVj3t13
	dpgbqQDXbGvLtaQvA/M74FJ9NG8+xYvHxbivaUpJVn+iT2xpSfw/
X-Google-Smtp-Source: AGHT+IENl01FmC8OHBQVgf3q0WKnjPnkqOViJhqUB93HWNl+/4fCZM20ykW0MDCALyMK2Mxj+ElZGQ==
X-Received: by 2002:a05:651c:548:b0:2f4:3de7:ac4c with SMTP id 38308e7fff4ca-2f6103908d3mr27692921fa.8.1724942542256;
        Thu, 29 Aug 2024 07:42:22 -0700 (PDT)
Message-ID: <9cc1fdf64f52ae5242e28ced7fec309c4f2e2d55.camel@gmail.com>
Subject: Re: [PATCH v5 6/7] xen/riscv: page table handling
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Thu, 29 Aug 2024 16:42:21 +0200
In-Reply-To: <05a08778-7c3f-416e-a7ef-12a1472d3fce@suse.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
	 <090e617d88b279ae88f1a7859875a7e1a0c6ae73.1724256027.git.oleksii.kurochko@gmail.com>
	 <c0005454-3b34-427d-8ea0-620aba632487@suse.com>
	 <ed84c53454cb63082aa96befe89a89d8f234ef71.camel@gmail.com>
	 <b83e7d23-2171-447f-a4e5-48563e4068a5@suse.com>
	 <4418002b93a3ae101e15e390dc537c726948bcb4.camel@gmail.com>
	 <05a08778-7c3f-416e-a7ef-12a1472d3fce@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.4 (3.52.4-1.fc40app2) 
MIME-Version: 1.0

On Thu, 2024-08-29 at 14:14 +0200, Jan Beulich wrote:
> > > > > =C2=A0Also note that "`mfn` is
> > > > > valid" isn't the same as "mfn !=3D INVALID_MFN". You want to be
> > > > > precise
> > > > > here,
> > > > > to avoid confusion later on. (I say that knowing that we're
> > > > > still
> > > > > fighting
> > > > > especially shadow paging code on x86 not having those
> > > > > properly
> > > > > separated.)
> > > > If it is needed to be precise and mfn is valid isn't the same
> > > > as
> > > > "mfn
> > > > !=3D INVALID_MFN" only for the case of shadow paging?
> > >=20
> > > No, I used shadow paging only as an example of where we have
> > > similar
> > > issues. I'd like to avoid that a new port starts out with
> > > introducing
> > > more instances of that. You want to properly separate INVALID_MFN
> > > from
> > > "invalid MFN", where the latter means any MFN where either
> > > nothing
> > > exists at all, or (see mfn_valid()) where no struct page_info
> > > exists.
> > Well, now I think I understand the difference between "INVALID_MFN"
> > and
> > "invalid MFN."
> >=20
> > Referring back to your original reply, I need to update the comment
> > above pt_update():
> > ```
> > =C2=A0=C2=A0=C2=A0 ...
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * If `mfn` is valid ( exist ) and flags =
has PTE_VALID bit set
> > then it
> > =C2=A0=C2=A0=C2=A0 means that inserting will be done.
> > ```
> > Would this be correct and more precise?
>=20
> That depends on whether it correctly describes what the code does. If
> the code continues to check against INVALID_MFN, such a description
> wouldn't be correct. Also, just to re-iterate, ...
>=20
> > Based on the code for mfn_valid(), the separation is currently done
> > using the max_page value, which can't be initialized at the moment
> > as
> > it requires reading the device tree file to obtain the RAM end.
>=20
> ... mfn_valid() may return false for MMIO pages, for which it may
> still
> be legitimate to create mappings. IMO ...
>=20
> > We could use a placeholder for the RAM end (for example, a very
> > high
> > value like -1UL) and then add __mfn_valid() within pt_update().
> > However, I'm not sure if this approach aligns with what you
> > consider by
> > proper separation between INVALID_MFN and "invalid MFN."
>=20
> ... throughout the code here you mean INVALID_MFN and never "invalid
> MFN".
IIC INVALID_MFN should mean that mfn exist ( correspond to some usable
memory range of memory map ) but hasn't been mapped yet. Then for me
what I have in the comment seems correct to me:
```
   if `mfn` isn't equal to INVALID_MFN ( so it is valid/exist in terms
   that there is real memory range in memory map to which this mfn
   correspond ) and flags PTE_VALID bit set ...
```


> Populating page tables is lower a layer than where you want to be
> concerned with that distinction; the callers of these low level
> functions
> will need to make the distinction where necessary.
Then the question now is just in a proper wording of the pt_update()
arguments values?

~ Oleksii



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 14:44:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 14:44:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785954.1195502 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjgO9-0008D1-Vz; Thu, 29 Aug 2024 14:44:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785954.1195502; Thu, 29 Aug 2024 14:44:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjgO9-0008Cu-Sl; Thu, 29 Aug 2024 14:44:41 +0000
Received: by outflank-mailman (input) for mailman id 785954;
 Thu, 29 Aug 2024 14:44:40 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjgO8-0008Cb-Bq; Thu, 29 Aug 2024 14:44:40 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjgO8-0005JM-1d; Thu, 29 Aug 2024 14:44:40 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjgO7-00063o-Ij; Thu, 29 Aug 2024 14:44:39 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjgO7-0005Ck-IF; Thu, 29 Aug 2024 14:44:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=WgCTcbMwEyA0BVQuSDy884+iC3EwpFWQ0EMA2JOUixc=; b=hxGFaH8VuCPgJuFU/KT2O0Qk0R
	E9CkXckAleH9plaDW3yt4p3efVd5Cm7ceV7r/Q7rrMYrSUW4/0va8hHMCnGbxYuGUfSvnNzeaLm9l
	gu1iS9DbA5Is4/yqp1rKZo+bB91nI95bNhxPzZUwMdNiCGign5hFtd8ifZCN2RCFtL8Y=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187403-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187403: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=01735bbe4a46a6fb7d5d739d0fc5a14897ad18da
X-Osstest-Versions-That:
    ovmf=bb248a95091ab542440053d9c289a97e80eb6630
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 29 Aug 2024 14:44:39 +0000

flight 187403 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187403/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 01735bbe4a46a6fb7d5d739d0fc5a14897ad18da
baseline version:
 ovmf                 bb248a95091ab542440053d9c289a97e80eb6630

Last test of basis   187402  2024-08-29 10:11:27 Z    0 days
Testing same since   187403  2024-08-29 13:15:08 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Oliver Smith-Denny <osde@linux.microsoft.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   bb248a9509..01735bbe4a  01735bbe4a46a6fb7d5d739d0fc5a14897ad18da -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 14:56:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 14:56:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785966.1195512 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjgZq-0002fX-2k; Thu, 29 Aug 2024 14:56:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785966.1195512; Thu, 29 Aug 2024 14:56:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjgZp-0002fQ-VB; Thu, 29 Aug 2024 14:56:45 +0000
Received: by outflank-mailman (input) for mailman id 785966;
 Thu, 29 Aug 2024 14:56:44 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=ImPG=P4=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjgZo-0002fK-Mt
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 14:56:44 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e7405d4c-6616-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 16:56:43 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-a83597ce5beso134441466b.1
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 07:56:43 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89892223dbsm87015666b.202.2024.08.29.07.56.41
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 07:56:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e7405d4c-6616-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1724943402; x=1725548202; 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=jjYGJ5pbuuFoo5fZa/NDupmQORKeRYvCj7xZYF1vhbc=;
        b=Xg55JPVn1QDCMYGhtdREZCy8dYeVPwB2T6us51TSJLcwzk6I4u10DuZ068jouc+ka8
         sJ+bT1+JqIskNAd9TReoEUDRW+4KlsRp5OXL3ZMfOyTLWbyafICI+3TBixMS0if9HK8w
         tvWjLMhUqVYaod0coZsgdkr5J//YQS6pa7lXWATKxGr5gPNb6JW0Y72XBc9NsnU3HDcN
         9mv9JBG3nFUUwxEuQX9w9FpO1501Kj38EADab/ZeMAqB7CJ2XaocSTBcK2uzqgvF20gO
         FaU7tX8tA+48YUqG6SogJpvieMNGB0UslO2hnSBE47HTqhatXU0tsVnFG7fyGrPrlBvt
         78Rw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724943402; x=1725548202;
        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=jjYGJ5pbuuFoo5fZa/NDupmQORKeRYvCj7xZYF1vhbc=;
        b=R/twbbCseH3FC6m1uii3AYhvC02rHfLTQ6v9t6szWgCOwmW5ZnY+n7rQpziF5YzVMR
         IJcV5Jl09iBNJF91QrR/n9VcdW8Qp3efUX3Z3mpD8rVA9PyiGb1ZhcGqhbBaTsKCztUH
         3HfS/mErDizAGseESqP/B/vaDhURPTDB6KHHy3pIKKRloDaQbOz0HfNY53Yu3PONjWAT
         wQpI9Hk0DywvXMGEUDiDeEo69n5sK9iFVHyuwYfUx2DnkYARZWvQOcmCViVKyWTX/FN+
         huqIB7zWJ2yawrVTj+1hSVEPHCxra7c6Zs9VkouuUNsCOSjJOU5v5fnSgi5NdkmLMUyN
         9mZQ==
X-Forwarded-Encrypted: i=1; AJvYcCUF7I5YJRBX3CdI6kdjULm22Tn80DrzU5H6x89m6jIKUFXXrOl2E+fFUEoVNk9bWojZ4XPf/jhQmzc=@lists.xenproject.org
X-Gm-Message-State: AOJu0YweYsgJNqqae7sU0Pz2HkCAoJ/LwHTv5sPg7k5my+YtzkMyvx2G
	tSXOJrP5KfxFIUxqgXzoAzh8REmx+uWe3XsfhxwUZF778jFb/fVPjD80N6ZRDsVZ9Y3/pu6rpBM
	=
X-Google-Smtp-Source: AGHT+IHYTe/4UI9sVRkBVadZpHLsqTuILk8eKi+tRJFew+pLcIJn4togEKrwzNIjBl+6S2rIkU58xw==
X-Received: by 2002:a17:907:1c0b:b0:a80:f616:5cf9 with SMTP id a640c23a62f3a-a8981f69201mr345580966b.0.1724943402045;
        Thu, 29 Aug 2024 07:56:42 -0700 (PDT)
Message-ID: <2929ae8c-1eb3-457a-a792-2d3a6f57c13b@suse.com>
Date: Thu, 29 Aug 2024 16:56:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 6/7] xen/riscv: page table handling
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
 <090e617d88b279ae88f1a7859875a7e1a0c6ae73.1724256027.git.oleksii.kurochko@gmail.com>
 <c0005454-3b34-427d-8ea0-620aba632487@suse.com>
 <ed84c53454cb63082aa96befe89a89d8f234ef71.camel@gmail.com>
 <b83e7d23-2171-447f-a4e5-48563e4068a5@suse.com>
 <4418002b93a3ae101e15e390dc537c726948bcb4.camel@gmail.com>
 <05a08778-7c3f-416e-a7ef-12a1472d3fce@suse.com>
 <9cc1fdf64f52ae5242e28ced7fec309c4f2e2d55.camel@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: <9cc1fdf64f52ae5242e28ced7fec309c4f2e2d55.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 29.08.2024 16:42, oleksii.kurochko@gmail.com wrote:
> On Thu, 2024-08-29 at 14:14 +0200, Jan Beulich wrote:
>>>>>>  Also note that "`mfn` is
>>>>>> valid" isn't the same as "mfn != INVALID_MFN". You want to be
>>>>>> precise
>>>>>> here,
>>>>>> to avoid confusion later on. (I say that knowing that we're
>>>>>> still
>>>>>> fighting
>>>>>> especially shadow paging code on x86 not having those
>>>>>> properly
>>>>>> separated.)
>>>>> If it is needed to be precise and mfn is valid isn't the same
>>>>> as
>>>>> "mfn
>>>>> != INVALID_MFN" only for the case of shadow paging?
>>>>
>>>> No, I used shadow paging only as an example of where we have
>>>> similar
>>>> issues. I'd like to avoid that a new port starts out with
>>>> introducing
>>>> more instances of that. You want to properly separate INVALID_MFN
>>>> from
>>>> "invalid MFN", where the latter means any MFN where either
>>>> nothing
>>>> exists at all, or (see mfn_valid()) where no struct page_info
>>>> exists.
>>> Well, now I think I understand the difference between "INVALID_MFN"
>>> and
>>> "invalid MFN."
>>>
>>> Referring back to your original reply, I need to update the comment
>>> above pt_update():
>>> ```
>>>     ...
>>>       * If `mfn` is valid ( exist ) and flags has PTE_VALID bit set
>>> then it
>>>     means that inserting will be done.
>>> ```
>>> Would this be correct and more precise?
>>
>> That depends on whether it correctly describes what the code does. If
>> the code continues to check against INVALID_MFN, such a description
>> wouldn't be correct. Also, just to re-iterate, ...
>>
>>> Based on the code for mfn_valid(), the separation is currently done
>>> using the max_page value, which can't be initialized at the moment
>>> as
>>> it requires reading the device tree file to obtain the RAM end.
>>
>> ... mfn_valid() may return false for MMIO pages, for which it may
>> still
>> be legitimate to create mappings. IMO ...
>>
>>> We could use a placeholder for the RAM end (for example, a very
>>> high
>>> value like -1UL) and then add __mfn_valid() within pt_update().
>>> However, I'm not sure if this approach aligns with what you
>>> consider by
>>> proper separation between INVALID_MFN and "invalid MFN."
>>
>> ... throughout the code here you mean INVALID_MFN and never "invalid
>> MFN".
> IIC INVALID_MFN should mean that mfn exist ( correspond to some usable
> memory range of memory map ) but hasn't been mapped yet. Then for me
> what I have in the comment seems correct to me:
> ```
>    if `mfn` isn't equal to INVALID_MFN ( so it is valid/exist in terms
>    that there is real memory range in memory map to which this mfn
>    correspond ) and flags PTE_VALID bit set ...
> ```

Not really, no, as said ...

>> Populating page tables is lower a layer than where you want to be
>> concerned with that distinction; the callers of these low level
>> functions
>> will need to make the distinction where necessary.

... here. At this level I think you want to consider only INVALID_MFN,
and for anything else you're simply not concerned what the MFN provided
points at[1]. Specifically, said said before, it may point at an MMIO
range which may not be in the memory map (a PCI device BAR for example).

Jan

[1] One thing that could be checked at this layer is the number of
significant MFN bits, in case there were hardware setups in which you
know that not the full width is permitted that the PTE has room for. No
idea whether such exists in the RISC-V world.


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 15:20:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 15:20:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785973.1195522 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjgwe-000816-Sb; Thu, 29 Aug 2024 15:20:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785973.1195522; Thu, 29 Aug 2024 15:20:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjgwe-00080z-Oi; Thu, 29 Aug 2024 15:20:20 +0000
Received: by outflank-mailman (input) for mailman id 785973;
 Thu, 29 Aug 2024 15:20:20 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjgwe-00080p-58; Thu, 29 Aug 2024 15:20:20 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjgwd-0005xg-Sc; Thu, 29 Aug 2024 15:20:19 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjgwd-0006zZ-Et; Thu, 29 Aug 2024 15:20:19 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjgwd-0007Ho-EL; Thu, 29 Aug 2024 15:20:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=sHtMk8B5diZPv4PjS5wIZgOoW0YKbZAqEajn37TVUFE=; b=6uX+kRq6EduXk5XKfeUP40V6cl
	Zmx/aNe/k8lYHlOgCKl9I7aeF2R9S5GVVMFEvoQZELyYXl2VHywNiA2/cSOkw1YcFnXiygdGZRbQm
	Eytirre8AVION9t49V0RQImm5RtXrxHmodnSoroNcw4JAtNw08a5UdJ7fRE6U1lWzbDg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187390-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187390: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-xl-credit2:host-ping-check-xen:fail:heisenbug
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=fb1658221a31ec1db33253a80001191391e73b17
X-Osstest-Versions-That:
    xen=9429f1a6c4758ae91f3ae721a036f4bbf76fb2b8
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 29 Aug 2024 15:20:19 +0000

flight 187390 xen-unstable real [real]
flight 187404 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187390/
http://logs.test-lab.xenproject.org/osstest/logs/187404/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-credit2  10 host-ping-check-xen fail pass in 187404-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-credit2 15 migrate-support-check fail in 187404 never pass
 test-armhf-armhf-xl-credit2 16 saverestore-support-check fail in 187404 never pass
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187377
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187377
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187377
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187377
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187377
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187377
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  fb1658221a31ec1db33253a80001191391e73b17
baseline version:
 xen                  9429f1a6c4758ae91f3ae721a036f4bbf76fb2b8

Last test of basis   187377  2024-08-28 06:43:37 Z    1 days
Testing same since   187390  2024-08-28 23:42:20 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Roger Pau Monne <roger.pau@citrix.com>
  Roger Pau Monné <roger.pau@citrix.com>
  Tamas K Lengyel <tamas@tklengyel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   9429f1a6c4..fb1658221a  fb1658221a31ec1db33253a80001191391e73b17 -> master


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 15:42:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 15:42:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785987.1195547 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjhIR-0003j1-SO; Thu, 29 Aug 2024 15:42:51 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785987.1195547; Thu, 29 Aug 2024 15:42:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjhIR-0003iu-Pg; Thu, 29 Aug 2024 15:42:51 +0000
Received: by outflank-mailman (input) for mailman id 785987;
 Thu, 29 Aug 2024 15:42: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=h9f7=P4=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sjhIQ-0003il-DT
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 15:42:50 +0000
Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com
 [2a00:1450:4864:20::536])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 5755d43d-661d-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 17:42:47 +0200 (CEST)
Received: by mail-ed1-x536.google.com with SMTP id
 4fb4d7f45d1cf-5bed05c0a2fso945868a12.3
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 08:42:47 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89891dacb2sm91900966b.183.2024.08.29.08.42.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 29 Aug 2024 08:42:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 5755d43d-661d-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724946167; x=1725550967; darn=lists.xenproject.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=Vp0CN+UaeHV6/vmMmS1h1axhAIZtHxlFP3D4D1tJGIE=;
        b=cZFylR+Lbulf/dpS07YkkCtvaxTm37ONSJvyuW2ucreXDPKvybkkh9jGB1NF2VkvYm
         xrofw1H/du7OfVEHb4B+g2mW8LUNJswx2kZkdwDz9CLCetvekDYBkbkHo03plvjg4ocj
         zy4l83Oz45ylr2w67HBPk1W1rOOvqLvkD/zR8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724946167; x=1725550967;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=Vp0CN+UaeHV6/vmMmS1h1axhAIZtHxlFP3D4D1tJGIE=;
        b=awVNYhzDFAKnLRBf7W6CdxiEzCBi0cybxm4mYdQBRhKwwLDho+8d6GxhAAijtFj0ah
         RHfy8VwF5ZLvkWie2o8GEtyK0KV1KC9Svj3M/89W2Rx5FA2kw2ocroHI9eyM4bpcPapQ
         mqEqouRr6XVlwQ/eN3OkhJRgSWifQob/l4PAHXQXLYf/Fw9HEX/8Yl/e5QhMFOa+rcn9
         kR6ezTJLR8TstIY3kwejukXG5OLTdDZahih5JreBz03oTeMAEv0ePowg6FPaHevqhnLF
         lNLd6rKa1xQ9I3tiSltq7x+TKRgWZViSUzs9EfVB/kQu+ADDFFp36u6loDOraD0rjcsZ
         0CyQ==
X-Gm-Message-State: AOJu0YyBfj4xFyFzFaRErzSgzy+PAOhKBKDXlr8AB9SK+gguUUELjgxT
	rGecazzPtpqT2wO2U0vkUFBl6zO9+vbDZ/fZhO1ZmxJin87NzPLkaAA0CgPnaog=
X-Google-Smtp-Source: AGHT+IHfDzLInsL/iga3oMevKCws/DrvNkMQoP9KqrnPBZixMErkhL9kHWDhH4kOWjSw4o0To0wsHg==
X-Received: by 2002:a05:6402:90b:b0:5be:fbe7:11ac with SMTP id 4fb4d7f45d1cf-5c21ed54d3cmr3485727a12.20.1724946166714;
        Thu, 29 Aug 2024 08:42:46 -0700 (PDT)
Date: Thu, 29 Aug 2024 17:42:45 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Anthony PERARD <anthony.perard@vates.tech>
Cc: xen-devel@lists.xenproject.org, Paul Durrant <paul@xen.org>,
	Owen Smith <owen.smith@cloud.com>, Mark Syms <mark.syms@citrix.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Juergen Gross <jgross@suse.com>
Subject: Re: Block protocol incompatibilities with 4K logical sector size
 disks
Message-ID: <ZtCW9Qq9k8UQ-jJC@macbook.local>
References: <ZtBUnzH4sIrFAo0f@macbook.local>
 <ZtB0fMRCGajdcfap@l14>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ZtB0fMRCGajdcfap@l14>

On Thu, Aug 29, 2024 at 01:15:42PM +0000, Anthony PERARD wrote:
> On Thu, Aug 29, 2024 at 12:59:43PM +0200, Roger Pau Monné wrote:
> > Hello,
> >
> > To give some context, this started as a bug report against FreeBSD failing to
> > work with PV blkif attached disks with 4K logical sectors when the backend is
> > Linux kernel blkback:
> >
> > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=280884
> >
> > Further investigation has lead me to discover that the protocol described in
> > the public blkif.h header is not implemented uniformly, and there are major
> > inconsistencies between implementations regarding the meaning of the `sectors`
> > and `sector-size` xenstore nodes, and the sector_number and {first,last}_sect
> > struct request fields.  Below is a summary of the findings on the
> > implementation I've analyzed.
> >
> > Linux blk{front,back} always assumes the `sectors` xenstore node to be in 512b
> > units, regardless of the value of the `sector-size` node.  Equally the ring
> > request sector_number and the segments {first,last}_sect fields are always
> > assumed to be in units of 512b regardless of the value of `sector-size`.  The
> > `feature-large-sector-size` node is neither exposed by blkfront, neither
> > checked by blkback before exposing a `sector-size` node different than 512b.
> >
> > FreeBSD blk{front,back} calculates (and for blkback exposes) the disk size as
> > `sectors` * `sector-size` based on the values in the xenstore nodes (as
> > described in blkif.h).  The ring sector_number is filled with the sector number
> > based on the `sector-size` value, however the {first,last}_sect fields are
> > always calculated as 512b units.   The `feature-large-sector-size` node is
> > neither exposed by blkfront, neither checked by blkback before exposing a
> > `sector-size` node different than 512b.
> >
> > QEMU qdisk blkback implementation exposes the `sectors` disk size in units of
> > `sector-size` (as FreeBSD blkback).  The ring structure fields sector_number
> > and {first,last}_sect are assumed to be in units of `sector-size`.  This
> > implementation will not expose a `sector-size` node with a value different than
> > 512 unless the frontend xenstore path has the `feature-large-sector-size` node
> > present.
> >
> > Windows blkfront calculates the disk size as `sectors` * `sector-size` from the
> > xenstore nodes exposed by blkback.   The ring structure fields sector_number
> > and {first,last}_sect are assumed to be in units of `sector-size`.  This
> > frontend implementation exposes `feature-large-sector-size`.
> >
> > When using a disk with a logical sector size different than 512b, Linux is only
> > compatible with itself, same for FreeBSD.  QEMU blkback implementation is also
> > only compatible with the Windows blkfront implementation.  The
> > `feature-large-sector-size` seems to only be implemented for the QEMU/Windows
> > combination, both Linux and FreeBSD don't implement any support for it neither
> > in the backend or the frontend.
> >
> > The following table attempts to summarize in which units the following fields
> > are defined for the analyzed implementations (please correct me if I got some
> > of this wrong):
> >
> >                         │ sectors xenbus node │ requests sector_number │ requests {first,last}_sect
> > ────────────────────────┼─────────────────────┼────────────────────────┼───────────────────────────
> > FreeBSD blk{front,back} │     sector-size     │      sector-size       │           512
> > ────────────────────────┼─────────────────────┼────────────────────────┼───────────────────────────
> > Linux blk{front,back}   │         512         │          512           │           512
> > ────────────────────────┼─────────────────────┼────────────────────────┼───────────────────────────
> > QEMU blkback            │     sector-size     │      sector-size       │       sector-size
> > ────────────────────────┼─────────────────────┼────────────────────────┼───────────────────────────
> > Windows blkfront        │     sector-size     │      sector-size       │       sector-size
> > ────────────────────────┼─────────────────────┼────────────────────────┼───────────────────────────
> > MiniOS                  │     sector-size     │          512           │           512
> > ────────────────────────┼─────────────────────┼────────────────────────┼───────────────────────────
> > tapdisk blkback         │         512         │      sector-size       │           512
> 
> There's OVMF as well, which copied MiniOS's implementation, and looks
> like it's still the same as MiniOS for the table above:
> 
> OVMF (base on MiniOS)   │     sector-size     │          512           │           512
> 
> >
> > It's all a mess, I'm surprised we didn't get more reports about brokenness when
> > using disks with 4K logical sectors.
> >
> > Overall I think the in-kernel backends are more difficult to update (as it
> > might require a kernel rebuild), compared to QEMU or blktap.  Hence my slight
> > preference would be to adjust the public interface to match the behavior of
> > Linux blkback, and then adjust the implementation in the rest of the backends
> > and frontends.
> 
> I would add that making "sector-size" been different from 512 illegal
> makes going forward easier, has every implementation will work with a
> "sector-size" of 512, and it probably going to be the most common sector
> size for a while longer.

My main concern is the amount of backends out there that already
expose a "sector-size" different than 512.  I fear any changes here
will take time to propagate to in-kernel backends, and hence my
approach was to avoid modifying Linux blkback, because (as seen in the
FreeBSD bug report) there are already instances of 4K logical sector
disks being used by users.  Modifying the frontends is likely easier,
as that's under the owner of the VM control.

> > There was an attempt in 2019 to introduce a new frontend feature flag to signal
> > whether the frontend supported `sector-size` xenstore nodes different than 512 [0].
> > However that was only ever implemented for QEMU blkback and Windows blkfront,
> > all the other backends will expose `sector-size` different than 512 without
> > checking if `feature-large-sector-size` is exposed by the frontend.  I'm afraid
> > it's now too late to retrofit that feature into existing backends, seeing as
> > they already expose `sector-size` nodes greater than 512 without checking if
> > `feature-large-sector-size` is reported by the frontend.
> 
> Much before that, "physical-sector-size" was introduced (2013):
>     https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=a67e2dac9f8339681b30b0f89274a64e691ea139
> 
> Linux seems to implement it, but QEMU or OVMF don't have it.

Yeah, I was aware of this, normal disks already have a physical sector
size (optimal sector size) and a logical sector size (minimal size
supported by the drive).  Some implement a smaller logical than
physical sector size by doing read-modify-write.

> > My proposal would be to adjust the public interface with:
> >
> >  * Disk size is calculated as: `sectors` * 512 (`sectors` being the contents of
> >    such xenstore backend node).
> >
> >  * All the sector related fields in blkif ring requests use a 512b base sector
> >    size, regardless of the value in the `sector-size` xenstore node.
> >
> >  * The `sector-size` contains the disk logical sector size.  The frontend must
> >    ensure that all request segments addresses are aligned and it's length is
> >    a multiple of such size.  Otherwise the backend will refuse to process the
> >    request.
> 
> You still want to try to have a "sector-size" different from 512? To me
> this just add confusion to the confusion. There would be no way fro
> backend or frontend to know if setting something other than 512 is going
> to work.

But that's already the case, most (all?) backends except QEMU will set
"sector-size" to the underlying block storage logical sector size
without any way to tell if the frontend supports sector-sizes != 512.
So the issue is not inherently with the setting of the "sector-size"
node to a value different than 512, but rather how different
implementations have diverged regarding which is the base unit of
other fields.

> Also, it is probably easier to update backend than frontend, so
> it is just likely that something is going to lag behind and broke.

Hm, I'm not convinced, sometimes the owner of a VM has no control over
the version of the backends if it's not the admin of the host.  OTOH
the owner of a VM could always update the kernel in order to
workaround such blkfront/blkback incompatibility issues.  Hence my
preference was for solutions that didn't involve changing Linux
blkback, as I believe that's the most commonly used backend.

> Why not make use of the node "physical-sector-size" that have existed
> for 10 years, even if unused or unadvertised, and if an IO request isn't
> aligned on it, it is just going to be slow (as backend would have to
> read,update,write instead of just write sectors).

I don't really fancy implementing read-modify-write on the backends,
as it's going to add more complexity to blkback implementations,
specially the in-kernel ones I would assume.

All frontends I've looked into support "sector-size" != 512, but
there's a lack of uniformity on whether other units used in the
protocol are based on the blkback exposed "sector-size", or hardcoded
to 512.

So your suggestion would be to hardcode "sector-size" to 512 and use
the "physical-sector-size" node value to set the block device logical
sector size the frontends?

If we go that route I would suggest that backends are free to refuse
requests that aren't a multiple of "physical-sector-size".

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 15:54:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 15:54:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.785995.1195558 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjhT8-0005xc-QL; Thu, 29 Aug 2024 15:53:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 785995.1195558; Thu, 29 Aug 2024 15:53:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjhT8-0005xV-Ni; Thu, 29 Aug 2024 15:53:54 +0000
Received: by outflank-mailman (input) for mailman id 785995;
 Thu, 29 Aug 2024 15:53:53 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=h9f7=P4=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sjhT7-0005xP-4C
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 15:53:53 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e2b69816-661e-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 17:53:51 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-a7aa086b077so81126266b.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 08:53:51 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89891968desm93645266b.130.2024.08.29.08.53.49
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 29 Aug 2024 08:53:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e2b69816-661e-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724946830; x=1725551630; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=1PsMmeUOjiISMrqGqz+8vRrkX+IgVLNR6ZLFF7YcSnc=;
        b=YCzhI/3VztRFsCGaQAGQmnWUaL9XNzg8UHGGGpHduKLIjvcLVWmNcDc4UtZEB9vbqo
         YUwfWO+DeW8bd5pteFJugCbI9qFH8ktmHHtHcD1xfP04BSKNn0H636Y8cvIpgqGN6All
         fKMe26nyAhUcOND3teEO//3oaGGNV9BBUSrH0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724946830; x=1725551630;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=1PsMmeUOjiISMrqGqz+8vRrkX+IgVLNR6ZLFF7YcSnc=;
        b=bktnJ/d9Lm0Cwk/rbZ+5xl5A5TDl75ejkIKUKu2YIVTVh1bwjRJ3/wccMZYHZSFo8+
         9wzMMhCblcLCp907jCjKC+YzHvJRys+yqqiznt3918b3Rq1TWXJdmBYFgZZuG/vlysYR
         7Kha1TFeI2D8ghKcwaedGHLhSYD5uZZ+WaKyZYqYi2EPf8A7QM5FHBHNU3IdHADq+e/Z
         YyEsUM0itfKJWFIxF2aCyhUs+6xW6w+YDO5p9QjwG3+RjJDw+E3YN7eOJ+AlkRZnoAZK
         GptC6V6wLB1F98GyI8Dloet0VW1xf/OBl8pwq9zRFbYfgtlVDh0WnKK7X4kWZseDmxSa
         jJgQ==
X-Gm-Message-State: AOJu0Yz4oKE/lRFB3/9updIs9CuFc3rmxUVR2o+MiRVvS67yRjIyjto/
	RmKHoIlSNp4Fdakkk9dvRo0weltR24grGK7PSgtgaEwfKkjU5gMtFM4xRElD+SQ=
X-Google-Smtp-Source: AGHT+IEfGxiTZDLvwlkDgjw7QOlBrbfljEug5FqXGSIGAxWhCJPtOz36w3tJ3TFnU5VPWfrVCgQ6ug==
X-Received: by 2002:a17:907:1c17:b0:a86:963f:ea8d with SMTP id a640c23a62f3a-a897fab7e38mr250867866b.64.1724946829974;
        Thu, 29 Aug 2024 08:53:49 -0700 (PDT)
Date: Thu, 29 Aug 2024 17:53:48 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Javi Merino <javi.merino@cloud.com>
Cc: xen-devel@lists.xenproject.org, jbeulich@suse.com,
	andrew.cooper3@citrix.com,
	Anthony PERARD <anthony.perard@vates.tech>,
	Juergen Gross <jgross@suse.com>,
	Edwin =?utf-8?B?VMO2csO2aw==?= <edwin.torok@cloud.com>
Subject: Re: [XEN PATCH v2 1/3] libxl: Fix nul-termination of the return
 value of libxl_xen_console_read_line()
Message-ID: <ZtCZjJVG-7daxcxb@macbook.local>
References: <cover.1724430173.git.javi.merino@cloud.com>
 <b1c7eb226ce62f50d6a50baa3977830a31fa5c9b.1724430173.git.javi.merino@cloud.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <b1c7eb226ce62f50d6a50baa3977830a31fa5c9b.1724430173.git.javi.merino@cloud.com>

On Fri, Aug 23, 2024 at 06:05:03PM +0100, Javi Merino wrote:
> When built with ASAN, "xl dmesg" crashes in the "printf("%s", line)"
> call in main_dmesg().  ASAN reports a heap buffer overflow: an
> off-by-one access to cr->buffer.
> 
> The readconsole sysctl copies up to count characters into the buffer,
> but it does not add a null character at the end.  Despite the
> documentation of libxl_xen_console_read_line(), line_r is not
> nul-terminated if 16384 characters were copied to the buffer.
> 
> Fix this by asking xc_readconsolering() to fill the buffer up to size
> - 1.  As the number of characters in the buffer is only needed in
> libxl_xen_console_read_line(), make it a local variable there instead
> of part of the libxl__xen_console_reader struct.

Instead of playing games with the buffer size in order to add an extra
NUL character, we could possibly use libxl_write_exactly(ctx,
STDOUT_FILENO,...) in main_dmesg(), using cr->count as the buffer
length?

Regards, Roger.


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 16:08:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 16:08:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786001.1195568 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjhhX-0001C2-2C; Thu, 29 Aug 2024 16:08:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786001.1195568; Thu, 29 Aug 2024 16:08:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjhhW-0001Bu-Ui; Thu, 29 Aug 2024 16:08:46 +0000
Received: by outflank-mailman (input) for mailman id 786001;
 Thu, 29 Aug 2024 16:08:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=oMn0=P4=amd.com=Jason.Andryuk@srs-se1.protection.inumbo.net>)
 id 1sjhhV-0001Bo-T8
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 16:08:45 +0000
Received: from NAM12-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam12on20625.outbound.protection.outlook.com
 [2a01:111:f403:2418::625])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f647b2b7-6620-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 18:08:44 +0200 (CEST)
Received: from PH7PR02CA0024.namprd02.prod.outlook.com (2603:10b6:510:33d::10)
 by CY5PR12MB6526.namprd12.prod.outlook.com (2603:10b6:930:31::20)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug
 2024 16:08:40 +0000
Received: from MWH0EPF000A6730.namprd04.prod.outlook.com
 (2603:10b6:510:33d:cafe::d4) by PH7PR02CA0024.outlook.office365.com
 (2603:10b6:510:33d::10) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20 via Frontend
 Transport; Thu, 29 Aug 2024 16:08:40 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 MWH0EPF000A6730.mail.protection.outlook.com (10.167.249.22) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 16:08:39 +0000
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 29 Aug
 2024 11:08:37 -0500
Received: from [172.20.38.216] (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend
 Transport; Thu, 29 Aug 2024 11:08:37 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f647b2b7-6620-11ef-a0b0-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=hIEuZ2o3H9InWViKC3ZFVXj5Rbolb5ukckhy9QCE+5un/NsnUj/HF+GfGHUROL7a24HfO7OFJugeYagQXyvKYi5mRFvPLJtIHAUL2Rb5ojfJk7NjOXPY0pwFqEC6FQANv5I357U824LYTdn2yWQm4Q1Zl7dog7E5W4kYiGrCG/jbdktKBStZKqAQgh61pykxZ0NoPZkju5/vZ3lGRCskakcqH5w6J3Pe2Q8R+kHrxdcVo5W1vFIQOBv4EsfBqE0FGZdZUH0DTVCOX8Mw24aK0zsG0kSYgtAXORjt4yOuGxDm5OP/Kg6aYzTJOXuLU4+2KP5LFFdt3gI4XEtq67IseA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=V/4PyCj6qBL0Fod1a3hAL9UsAlOynP4IHqZ7TGFIxxY=;
 b=KM663ZBrJsuaKKLDVA8KtprrTueyKYlazxlye0X/J47yiexZyLXBcbbrAuCDP2YTCoqYsS89xClEbB6oq7JfjMO4+qZC6hy0/p4UGfS5Yhxm62f8vW8zBqRfMFDivQw+VoX1zwXT4P980/UwmGL+XZfiL24uicg4tpoFNxDZiiUwgF3UIbtR8IjQRvaXlG1rTwDMOYULcWfjzieQVoFhqmNwHQFKDbUh6SnV92veSwseCVWnd4dJ44ADXRdHnsUwTUVAlsVkqXxDCiez2phVhzRTAByZ1s55nG8e379S0ojT+wj2ipxejVDUC3JoHr+d/9rxhZB24SlhP2uKI8X53A==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=V/4PyCj6qBL0Fod1a3hAL9UsAlOynP4IHqZ7TGFIxxY=;
 b=vVJVfDGP5hszq79eO2KL54Apgko2gYYsDu965dQW4YSjqeQGUrDVhrBkyTr4dVexV1chtW2jkExIdn14JyxW9CYwQWdn5Mp/S5inWLjJ9SIod+WmHAzeZHSWeu8vQ22RmT74w/YX4YFl3eZV38SU85+iPKCBxivrcstyLqp4Drs=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
Message-ID: <f4551fc8-d0c0-492c-8ad3-b045843af381@amd.com>
Date: Thu, 29 Aug 2024 12:08:35 -0400
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Jason Andryuk <jason.andryuk@amd.com>
Subject: IOREQ completions for MMIO writes
To: Xen-devel <xen-devel@lists.xenproject.org>
Content-Language: en-US
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: None (SATLEXMB03.amd.com: jason.andryuk@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: MWH0EPF000A6730:EE_|CY5PR12MB6526:EE_
X-MS-Office365-Filtering-Correlation-Id: 68ca604d-2e11-4744-ee4b-08dcc844d862
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?TzBBZjJ1UThLb2xlUk90UCtkcHo0WnFIc3J0QWZ0Q0ZYWGx3aWhaL3QraERl?=
 =?utf-8?B?cm5HcFpGYUVXeXdSQjNsd3NlemxqL2w3QnlFNUQ5c2lwaEpDbE1FaE1ibGZH?=
 =?utf-8?B?VzZsaUw4d2JaN0FHWC95Tzc4cTRZWE15bGs1ay9aWDFjWGFIWWE5blBuWjZQ?=
 =?utf-8?B?T3BiTGZtZ2ZRMHN3Q2ZqK2tkMVpaMDRmMDJnc05KQVdsZ3FSZzI1RjA3NDlD?=
 =?utf-8?B?aUNuTHJFeEdsY3E4VXpScDhBQ2sraWpaVG5OWXBmRHJ5OE1KYWZqQTZZUnY2?=
 =?utf-8?B?TlQwcllXTUkxdnpTQzNiWWpaRUlnWTc0ZWo1bHE1YzQxWmNWZCt6OUdJM08w?=
 =?utf-8?B?N25Qb0thYzlrV2VmTnNuZjY0eGdFaURwQ0tXQ0wwQjNWbncra01Ldmo4cXh4?=
 =?utf-8?B?Y2ZTNmZGZ1pTVHNnR3JnRDBLLzVoZFdEeUhIUVRMUDNxNkNDYUpRQlBMNHBp?=
 =?utf-8?B?K3FuMFY2KytxMnlZOUswVTdxTjdMNU5Wa1VvTCtVNzVhNXRPT1k1WUhiTUh2?=
 =?utf-8?B?UlZ0ZUg4bUxxdWhBcUtwOUhZMW95UU1hU2RPczhuYzBoaE1uL0paRS94OUQ4?=
 =?utf-8?B?d2ZTRjVnb281TzVXRkI1QnBaM0VPN05nS2J2REdvR2NzZFFKc240U2IxSWJD?=
 =?utf-8?B?NzRReXhWcGJ1cm5JeUJXWHZPZXk3Q2pwZk85UVA0TEVyWWFzeWdzV2V0aXJQ?=
 =?utf-8?B?QW9vR09ud0hWTXlOcHNGZU9NTzcvVWFuRC9ablhwWlNMVWFrYmxHL3VBNUp0?=
 =?utf-8?B?TG9BWm5nZE5Ec0xiQ21FMTM2OUpVSy92UGZnS0QvQmRKWDFDUitwZnIxNmpE?=
 =?utf-8?B?UFQxUlRDN0Zzd2J5bW5YbTU3SWNsUVg1MHRtSWtXUVQ3VVNiNlRVSkNmQ3Jy?=
 =?utf-8?B?WEtyTnRHeEJId3A4T0pDK2twaXV1NmhFSG5kcnFkb2RlRFhQZzJaSUp4ZHNW?=
 =?utf-8?B?ODlJTW1DS1dzRjBjZXl1TkdETVpjVWJoM1ZNdHIyd1h6djI0d1U1b2loUTJx?=
 =?utf-8?B?WFRUSXd4MmVrMndCQURqMDNkNEo3NkdpTnZ4NFlzNU1KUjhyS2VERHJTdzU2?=
 =?utf-8?B?Q0REL2txd2JDbnF3WkVlWXFmWnNTcXdyNTYxL2dnN0lkZVgzQlJ2RDcyTjFD?=
 =?utf-8?B?T3I1WEFsaDhHWU9VTWdWblU2V2Y5NEc5TEQ5cnFFNWlrVmtWL0ZSekFWaGJB?=
 =?utf-8?B?TUdjUDJFUVU3S05PY3J0by85a1pXdG5BMzkwUTJ3WC90WHU3RzlUOEhwUXUy?=
 =?utf-8?B?OElObHlRRGdUSng4bE9ycEgzWkFhcGNFem0rcUlKYVpFLzNDenQ4ZkpYNzZn?=
 =?utf-8?B?a1Z5OWx0ZklLdGx4NWx1RWsvVnphQWFPQWVVRXR2UHU1ZTFvWEtDalZzUUZS?=
 =?utf-8?B?NDVCZExvaERPK0E5cGJYTklWMTBtODUvNnp6eEZxY0tKbFk3cXI2aVBJbVlX?=
 =?utf-8?B?SlVmWEI5VjErb1p1VFVaVm1lQTJwanZTZHpMTHMxRWhwS1ByaXRnUSt2MU5o?=
 =?utf-8?B?bVdmcFdhRUJmSGlFdHpLWTRlYzdnL2o4bHpaZlE2TGZSNW01ZzYwUy9BcGVH?=
 =?utf-8?B?UElTY0k0TFQ4S1o1Y3o1b21LSGgyVEJWQlp1SFRLemtSbEFKcWNtT1l0eWpj?=
 =?utf-8?B?ZzdIc3VJeEN6dDVudlU0V2lJMVcyWk96d2srVndTSVRpL3ZNallxT05qYjZi?=
 =?utf-8?B?VG1RRUo0SFRNRHpYRm9Xa0tyUEswMVE5dEt6SG9Rbm1tSHlLekpLOXZ5WHpy?=
 =?utf-8?B?OU40RmRDRVk1enZiTURuTWF2MFBBdDUzTlNtSWdLbTVyeGRJNDJDMkxTTHlW?=
 =?utf-8?B?QldMZGdtcWxvaEV5NDFxZjNlNzgvN2dtMFJ3VWh1TkpnajgyMlZ2T2RBemh3?=
 =?utf-8?B?eGRwYXBac05LdnFnRkpoOHZuS3JWVDBkVk5EVlp0TGwyMUJjc2swbUwxaEc5?=
 =?utf-8?Q?Fb76AY0o5xN9rRGlI9nPJ5dllj81zxIT?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 16:08:39.0023
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 68ca604d-2e11-4744-ee4b-08dcc844d862
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	MWH0EPF000A6730.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6526

Hi Everyone,

I've been looking at ioreq latency and pausing of vCPUs.  Specifically 
for MMIO (IOREQ_TYPE_COPY) writes, they still need completions:

static inline bool ioreq_needs_completion(const ioreq_t *ioreq)
{
     return ioreq->state == STATE_IOREQ_READY &&
            !ioreq->data_is_ptr &&
            (ioreq->type != IOREQ_TYPE_PIO || ioreq->dir != IOREQ_WRITE);
}

state == STATE_IOREQ_READY
data_is_ptr == 0
type == IOREQ_TYPE_COPY
dir == IOREQ_WRITE

To a completion is needed.  The vCPU remains paused with 
_VPF_blocked_in_xen set in paused_flags until the ioreq server notifies 
of the completion.

At least for the case I'm looking, a single write to a mmio register, it 
doesn't seem like the vCPU needs to be blocked.  The write has been sent 
and subsequent emulation should not depend on it.

I feel like I am missing something, but I can't think of a specific 
example where a write needs to be blocking.  Maybe it simplifies the 
implementation, so a subsequent instruction will always have a ioreq 
slot available?

Any insights are appreciated.

Thanks,
Jason


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 16:11:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 16:11:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786005.1195578 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjhkE-0002dW-Eu; Thu, 29 Aug 2024 16:11:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786005.1195578; Thu, 29 Aug 2024 16:11:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjhkE-0002dP-Bl; Thu, 29 Aug 2024 16:11:34 +0000
Received: by outflank-mailman (input) for mailman id 786005;
 Thu, 29 Aug 2024 16:11:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjhkD-0002dB-28; Thu, 29 Aug 2024 16:11:33 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjhkC-0007J0-Mu; Thu, 29 Aug 2024 16:11:32 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjhkC-0008EK-8y; Thu, 29 Aug 2024 16:11:32 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjhkC-0003TK-8M; Thu, 29 Aug 2024 16:11:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=6yBgT9pnVmw06LYt8hGwWGGv2Uh7vDlBWa8YMTtpOjI=; b=kETgiUEMBzPQUg+smUwlLYCPaZ
	INEV4nA4qSyGhm9nBfIcDiJOt6vzT744zNGnWyZQeecVUo8N1iVtKwSMsw6hmocrr0wGCG0ba0YVh
	LegzWTooPRbQHndoxFNL8XGPiJwsaeaMlkWLqEOXQUYhQ+rUPXoqebLzCHfD2YT2I0PQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187395-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187395: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=21562c4df6434dba9c6bece5096a37919c9075d1
X-Osstest-Versions-That:
    libvirt=48bdeaf2fa49513d4be53588100807f269c36997
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 29 Aug 2024 16:11:32 +0000

flight 187395 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187395/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187374
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 libvirt              21562c4df6434dba9c6bece5096a37919c9075d1
baseline version:
 libvirt              48bdeaf2fa49513d4be53588100807f269c36997

Last test of basis   187374  2024-08-28 04:18:53 Z    1 days
Testing same since   187395  2024-08-29 04:18:48 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Michal Privoznik <mprivozn@redhat.com>
  Pavel Hrdina <phrdina@redhat.com>
  Praveen K Paladugu <prapal@linux.microsoft.com>
  Praveen K Paladugu <praveenkpaladugu@gmail.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   48bdeaf2fa..21562c4df6  21562c4df6434dba9c6bece5096a37919c9075d1 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 17:24:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 17:24:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786035.1195588 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjisP-0006kt-Io; Thu, 29 Aug 2024 17:24:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786035.1195588; Thu, 29 Aug 2024 17:24:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjisP-0006km-G3; Thu, 29 Aug 2024 17:24:05 +0000
Received: by outflank-mailman (input) for mailman id 786035;
 Thu, 29 Aug 2024 17:24:04 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=N580=P4=amd.com=VictorM.Lira@srs-se1.protection.inumbo.net>)
 id 1sjisN-0006kg-Tw
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 17:24:03 +0000
Received: from NAM11-CO1-obe.outbound.protection.outlook.com
 (mail-co1nam11on20607.outbound.protection.outlook.com
 [2a01:111:f403:2416::607])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7a16bd6e-662b-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 19:24:00 +0200 (CEST)
Received: from SJ2PR12MB8876.namprd12.prod.outlook.com (2603:10b6:a03:539::18)
 by PH7PR12MB6658.namprd12.prod.outlook.com (2603:10b6:510:211::14)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug
 2024 17:23:45 +0000
Received: from SJ2PR12MB8876.namprd12.prod.outlook.com
 ([fe80::69d9:a014:7a29:de4a]) by SJ2PR12MB8876.namprd12.prod.outlook.com
 ([fe80::69d9:a014:7a29:de4a%5]) with mapi id 15.20.7897.027; Thu, 29 Aug 2024
 17:23:45 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7a16bd6e-662b-11ef-99a0-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=VY3itrknVLqDtjMIiTJ+4vOyIsINHvrj+qnbeAW2hfitq6cMLadI0gFJ1A+DEH81eV16Fx/F6dFwwVX3oBWCaZe8LFEm7u4TCuiws4xGFxoJFpGy55a/subQX6lr9djfSUkkk6zD7TbtNjPufrYiwciAjqVCMgSor7UdNHxOAoPh5a2eKD9IKXPG4dAoCfpQ7aoak8xG+CtLDfDRq2p/Ucd6p7YemYrqPq/dp7W33CfSy8djW7NYvBVMW+xcYO8iJX1t9+nm8IJkApg8KfT6ySbWhxy3f6/a7fQX3CT6yYNSNAwgO0dXHWj34hP73yHsYrySDK4Ruj3ZqaUoWoIpDQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=KJJTaqkI3DYB+NOL0fCH1RyECZlhQQPbFR4pvG2MHJ0=;
 b=HGz6jn4jlkNQaAw2ymvTi0jBk3TDxHD4U+vmXmJroB8oM4p0Wj9VB5Tp04DlvWf6z26bs4ZebHXwDqVoyt7FDbrNKPhsXV7Cxwiy3CfMu7Lu0rg4xIZv7rF2W2yDtfctx9MfzycOptnMLE2ghm2YnX9IVmo25jR/xkOJWjzU+aCasP3I2EPnDvIDPcRavwINNOSHnAR/cASedu8bvkXVt2PIsKJ5dL/zUM/XBhd+11qsdYUEqszZ4v7ByOxQ+bQoBv0ZRhlc7ZYSZJ3wRaxo/arnwOM82uOV8EZzIEfJhBmaw26h0AvOAtpCwXgkyMVb6+YBoWSqqtvDWFDcPJmGsQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
 smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass
 header.d=amd.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=KJJTaqkI3DYB+NOL0fCH1RyECZlhQQPbFR4pvG2MHJ0=;
 b=MWWNW3LPObqGT1qEJIWQSRUCUe6oG/ibVNNTE8kTzI6YuRvylfOeZMiUCnj+Ht1bfJy+ic0wwjQNU/69sN+ytJmMA86fpHwSWALGw3LxVUo0Cp2wa9JO98g2CcjSQDlOI9jbDMBWBK75VhW53ajI1w5CnGkbaTMz16MRsXBXcss=
Authentication-Results: dkim=none (message not signed)
 header.d=none;dmarc=none action=none header.from=amd.com;
Message-ID: <fab9c785-3db3-45a9-b701-826478f9bdee@amd.com>
Date: Thu, 29 Aug 2024 10:23:44 -0700
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v1] automation: fix false success in qemu tests
To: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich
 <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>
References: <e4de45759723b28713ef205335c4d79b9e7074b7.1724904269.git.victorm.lira@amd.com>
 <2756d5b3-e4b1-420e-8402-2697c559acb9@amd.com>
Content-Language: en-US
From: "Lira, Victor M" <VictorM.Lira@amd.com>
In-Reply-To: <2756d5b3-e4b1-420e-8402-2697c559acb9@amd.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-ClientProxiedBy: SJ0PR03CA0038.namprd03.prod.outlook.com
 (2603:10b6:a03:33e::13) To SJ2PR12MB8876.namprd12.prod.outlook.com
 (2603:10b6:a03:539::18)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SJ2PR12MB8876:EE_|PH7PR12MB6658:EE_
X-MS-Office365-Filtering-Correlation-Id: dcb97ae1-3ade-42b4-4bc5-08dcc84f563b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014;
X-Microsoft-Antispam-Message-Info:
	=?utf-8?B?alB3NW1TL05PVjRWNFg5NENKdUlYYnVnZFpDZVQ2MU1NZlVJR1ZCaVFKeXRX?=
 =?utf-8?B?S2ZaNWUzZ0NvNllaN3pKWW0xTjFiY1NnbTF0N1czNjM0QXN2aHRIajkvVXFI?=
 =?utf-8?B?M2pPeGlKNHl2V1ljUWpER3pHa3dScFhPdmJMS2F4clAwRGswRGFtODluQTlX?=
 =?utf-8?B?ZVcxd0wwRWNjSldpeEVwaE9hVWVVRVJZRWtDMDFUOUw4Snl0Wmd4N1FVVUtU?=
 =?utf-8?B?c3N5c3RnV08rSUlTVmJ6ZlRaZ3VWdWltaXNSeE1TMjlBdktLdStmdHMyRThS?=
 =?utf-8?B?RDllRjhTQXhpWVNuT3YvTzEzUVZjb1lZU0hDa25NM0dvZjB0TWxQK1JCTnNR?=
 =?utf-8?B?cHlNUFFOV1ExL0RiNnFYY1JYWUx3KzFQc2RBU1R5WkJ1dUdoZzJMNStaa2Jw?=
 =?utf-8?B?cWNYK2Y3ek1DcHJRaWZIcEh2MG85K3JOYkFIdWUrcTJiRTIrQUsydEY3cnpK?=
 =?utf-8?B?SjBXNmdHNkhxZzcyU1Y2WkdiaE9yS1ZOWEZNOUpyeGN6VTU3Rmw1Qkx0UXhn?=
 =?utf-8?B?cGM2VEV1eURlUDZuQitjaUJtOHVKN0IxVStqbmxtc1Zab0NkblVVS0VxN2FP?=
 =?utf-8?B?aEpQeHplZk1uZ3UyYmtaUlNlQmJSMjFiNVFRWVpOaldBMWZnaUZ5dmVWVHYr?=
 =?utf-8?B?NmY2dmRYZ0EwcS9jSTRMeisrOGlIazdaNnFLS2dOM2NKYXBsL2dyMGJIdlpM?=
 =?utf-8?B?TDRpbSttTWZnZDI1Z1QrU3JnVkFHd2JXcnhmTDFhbWRsbWpScy9NajZLWkV4?=
 =?utf-8?B?NFZhdkFBbzdaWUtRUjBUOC9mRGdIR2kzc1J2cHFpQVFXRmtPK2Qybk02aTNm?=
 =?utf-8?B?eWVXVzVBS1V0VVVGVi9pYlJtNjhIMC9ORUJRb0NIWGFQbXdzMFRzR3NjektC?=
 =?utf-8?B?a0hucE04R3RNRy8rOFBHL2JxV0NVMWp3anlEaXBta3JUSnhkNkc3ZEl6cTUv?=
 =?utf-8?B?bWdUN0VVRHJ2TTZZK1FUNk1JWEpQMmJZNmRPekVHM25kYSsxYTN6K3dCNmp0?=
 =?utf-8?B?MFdVTXNPNTg5SmJDaHk3YTN2M2FEeHZtOHdVVW1XQnhJa2pBYU1Cc1JhUEFu?=
 =?utf-8?B?UDh5eTRUQ0ZTMmdjY1dxakVWRDJzNC9TdDIwV0tOSS9sVTVIeEtHQ3cvOGR6?=
 =?utf-8?B?V0Z1eHhseTFNWXJyUUhtNGYzdGo1ZnhZWXV2SngyRUZkOVk3dTdTdkFkNUh3?=
 =?utf-8?B?WFYvM1NoVG1mQkJNaCtYYThHZStSTnpWQkUrOFQyL05FTHlOOVFrbmxYbklr?=
 =?utf-8?B?THMvL1NSV3UzOVRzTFYzZkY3dzJlZW5JSmNTMisyQndLdzliNW5pYkNtWll3?=
 =?utf-8?B?UHVtSDRwNDBabEkxNG5CN1BWckcrZVB1cTBzN1E4RE5kWTRScmpTRUxZbjVR?=
 =?utf-8?B?K203eUhoSXkwZEI4RWV4U1NJbnQwTkRraHpVaGNjcml4NVlTRUZUWGFRSFl2?=
 =?utf-8?B?NnkrZUwwOGRiakJXU1RPSXJicDJwNWFJRmpMenRzQzBDSXN6Q1FhSGFJZUg4?=
 =?utf-8?B?S3A4bUhmUjNDbkZ0RVdkRFNpMW52VFNUSEFrSzg3V2hJZXF2UXVjcUJ4MVdD?=
 =?utf-8?B?NXNKOWgrME4rdXB5bGttQ3VpQjJNZ0xmbTVGaGxjMG40QTlsb2tvM2xRVjlW?=
 =?utf-8?B?VjJYZGUreHpwVGIzSVNPZlkyUXZ3eDVxWVp6bEJDYXFTM3IxdDBnUEV6cnl2?=
 =?utf-8?B?VFk5dkJsS2NKTklsZ05tZ3NKY3hlNU84THNNRFpVN0RiNFBEajl4YURoRkxp?=
 =?utf-8?B?RnQ0LzlzTFlFa0VTVU9GYUk3dHQyazloUlVuYncxbjlqYUxqbWM5NGtuTDJG?=
 =?utf-8?Q?FJ+Yiznfmu+42ry00o6D31GDh+9bG1TAXmyI4=3D?=
X-Forefront-Antispam-Report:
	CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ2PR12MB8876.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
	=?utf-8?B?VC9MT2JJZ3ZYeEJKbjRkaUFOVFdPcGhIWXI4NkRTK0pFc1gvODRPMHhQbnFz?=
 =?utf-8?B?eXJCSFFMSmQ5ZTErUmRUUUJtTVVOOGRueTRybUZEclVKQVk4VFdSdFNSVUJa?=
 =?utf-8?B?QUE1anJkZnpTc0tRT0RNQ09EVHpiMkhlQW14S3A1R0djdkFtdFR5SFZsUzhw?=
 =?utf-8?B?L1BOaXpDZ3VjdERNSUlKME1Ld1M1TVBldnFoR01xSThKQU5vclp4QU1XRTI4?=
 =?utf-8?B?SnpMU2ZSMXkvMGVMdUdnbTFRTUNHN0c0T2laV3F5VU9NbnBsRHIwYmZSVmQ3?=
 =?utf-8?B?ZnF3N2R3OVU0a09nL2tlcjRDVXpLb1JPZnBOL1BTNkZxMm14ZXFvTXRLM25q?=
 =?utf-8?B?UktMTmpYQ05vQUQwTTVNOTVNOEFEQUY2RWhnNmxKK1NNalpCRVZuSm8vbzk5?=
 =?utf-8?B?UDh3WFBFcWg2eG54RTFWYXdTcVJOY3FSbEFhS1BTVEkyTSs4SDVMalcrYTFt?=
 =?utf-8?B?U0t5bUh3N0FYQWlHWXllSDNCcXRtMmFRSFBuVFFsM3BBNzFsOGxzSElWaW5o?=
 =?utf-8?B?ZG1OVnNhUlJZa1l5WjI1S0FPOUdJK2RQSXhMTElpS1UvV1RVSUhJRXh0QkZY?=
 =?utf-8?B?QjRHUnFzQjZpZldPTG1uWm9VdFN6bTY2dURjYzNZcGR4MnRxaE1IbUEwUndJ?=
 =?utf-8?B?QTJJK1RoWGtHQ05WenJuNXlOdFpaWmkydEoxWGRwUDdTVEs3Nmh0dEtlRU9h?=
 =?utf-8?B?cFBVRVhmOGk4K3YycjhJZVREc3JZY056Z0VOOWpURldhbmRSc1BMRmVkazdV?=
 =?utf-8?B?M2JuMjJaMms4OEk2L2NDNGkyTzVTcmxwbDM4V0x2WnBnRjF2YStDRDY1cXp1?=
 =?utf-8?B?NUpvWHFQWkF2SlI3Tk11T1A2RXVZRHl1dE9DOW81NTJNRlF3UFRNdmlxcitv?=
 =?utf-8?B?WlFBV1E3MFZQZlVpMENoKzBVM21sRSt1UllJbnF5RXFNbFdQTFlSUHR6TkpW?=
 =?utf-8?B?M0NLTFBiZVlQb2JtVkxKTEhydHBlVGtqenJqQ1o0TjlPRG5pNUQ1Ny9lOXNq?=
 =?utf-8?B?Vm00eWdDK1lXQ0MrcENOckVhbU9JNVRueWpRblRmMDRSTEc4eWVITjZ6c0hP?=
 =?utf-8?B?ZGgwbU5zWVRKZW5tZ3psTlcyK0RtRjdJNE1RR1M3TlhCeWE2NTF0RnVLR1dV?=
 =?utf-8?B?dGpLcGZaMGtZbWR4Q2xSY2ZoQjZRelFQcnRxTmlsYmZKWU5TSUhvNm1NRWVV?=
 =?utf-8?B?MFoxRWZBSVhzaFdMUklwMjBnZU8vc1ErMU4rU0tjQkFVOWlmTVlvMEo4aVVm?=
 =?utf-8?B?S1diOXcyYnRFRlE0WXRyTzMzbVhYd2JsbitEd2x1c2pkZjI2UVcybjhVSDI3?=
 =?utf-8?B?ZXVjVFJxWHhEY0hCZjUwc2Nkdk84cDBNVVBpR1YzU0RYNVJQNkp0U1AyZldL?=
 =?utf-8?B?bXdhQ3BUSk5WZTNlR0xEQTd5aG1waktPY05vV0VDeXZocXhVQStIQnQ0SDFC?=
 =?utf-8?B?cDBRZ1pBZDFrTTJzdGZkamxPWVEvVlpnL1JqTjc2V1l2L09tekIyeWRKM3kv?=
 =?utf-8?B?QXdVbVRmUmh1aEtQS0EvQVU3RXZ4OWZyVDdYaXBXTFNaeGl1TUZiSXRybzRy?=
 =?utf-8?B?aHppYzlsTXpoK1hJYXJBaG81VzhrckVMSkNjUDdhUHlQbWwvcVNDaWV0R2xB?=
 =?utf-8?B?VVJmTVk2K1lSbzZwNFVIS3RHb2xlSTdaMVJWeGU2L1JJWkFiZ3VjTEErYzNi?=
 =?utf-8?B?UVFGL3kvd2h2V0hUTktIYldURVdhZlEwWS8rcWVVWWdzelVYYWFMMlZLWDZq?=
 =?utf-8?B?eEZWdUZKOW9lRURvZjgybnNYQjI0Z0VWVFlmOCt4b3poLzhXSEU3bGRwUXV0?=
 =?utf-8?B?UHBiUWExRElPUGhwTUJVVWkweC9UaWxoTnZScTJYZnpXVW1STTYxbXIzSHhI?=
 =?utf-8?B?ZGdHMFd4WU80bDRVNlg0SGdKWkt6NElTZ2xmUVBUaEc1UHE1NHJTODd3SHpW?=
 =?utf-8?B?dzh4QXk2WlhYWnA2RWJ5SzgydlJ6RWRDUStIbmJTT1FTNysxSXNhMW9VY0lz?=
 =?utf-8?B?ZmZaM09FaTRxenQ2TXBwKzhPWnliUmVYZjlFTVBUUzVMcG8waGxIekdHeFZ3?=
 =?utf-8?B?ekEzZ1N0OVZCbDgvVjVtOFZoMWREMW9INVU4a0hjUTRFcUJvZERGWHNrbnNh?=
 =?utf-8?Q?Ws5yF+Mkmv0psqUO+iEizMP7N?=
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-Network-Message-Id: dcb97ae1-3ade-42b4-4bc5-08dcc84f563b
X-MS-Exchange-CrossTenant-AuthSource: SJ2PR12MB8876.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 17:23:45.5897
 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: O/uUoe2vaC0WVsebgs/jS0qV1hvjwev/xgy7tjQmR2V1dqi57vCXKf8nf0j3fGCx5KEzpsm7JC2MnETd4W9NbQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6658

Hello Michal,

Unfortunately only removing "set +e" did not fix the issue as the test 
still will always pass.
See here (line 90):
https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7700210695

I think we will need to use the fifo or the Bash "pipefail" function.

> You may want to use "Fixes" tag. See docs/process/sending-patches.pandoc.
> This commit tries to do 2 thins at once:
>   - fix "set +e" issue
>   - make xilinx tests use expect
>
> These should be 2 separate patches. The first patch should only remove "set +e" from qemu patches.
> There is no need for fifo in qemu tests. You should use that only in xilinx tests where we cannot remove "set +e".
>
> ~Michal

OK, I will review the doc and create separate patches for fixing the 
qemu and xilinx tests.


Victor




From xen-devel-bounces@lists.xenproject.org Thu Aug 29 17:31:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 17:31:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786042.1195598 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjize-0000Vc-8N; Thu, 29 Aug 2024 17:31:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786042.1195598; Thu, 29 Aug 2024 17:31:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjize-0000VV-4y; Thu, 29 Aug 2024 17:31:34 +0000
Received: by outflank-mailman (input) for mailman id 786042;
 Thu, 29 Aug 2024 17:31:32 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zolI=P4=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjizc-0000VL-Pj
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 17:31:32 +0000
Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com
 [2a00:1450:4864:20::433])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 87cb4bcc-662c-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 19:31:31 +0200 (CEST)
Received: by mail-wr1-x433.google.com with SMTP id
 ffacd0b85a97d-371b015572cso730485f8f.1
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 10:31:31 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89892221cdsm100868866b.207.2024.08.29.10.31.29
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 10:31:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 87cb4bcc-662c-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724952691; x=1725557491; darn=lists.xenproject.org;
        h=content-transfer-encoding:in-reply-to:autocrypt:from
         :content-language:references:to:subject:user-agent:mime-version:date
         :message-id:from:to:cc:subject:date:message-id:reply-to;
        bh=JVc5H4Sqrf5HsD0UnVXy0zp71X7ivIbue4Mk1LYDI3s=;
        b=XlfXfYsQkVoV7TdWb3AxKj1QAGkM7NPda+A85fvwvCsEy84iQjFL6LPP3V48VaDO1P
         1dMTdQhzL0GX3IchhIuNsL3andHa0RrnFdZrcvb4w7JEwSuoe6R80QkY31lQ7FdPp/1m
         dh6F1ADZpy2tmpWHtJeQEuWa00WZAZXr42Fm0=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724952691; x=1725557491;
        h=content-transfer-encoding:in-reply-to:autocrypt: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=JVc5H4Sqrf5HsD0UnVXy0zp71X7ivIbue4Mk1LYDI3s=;
        b=o4Lj4BHr9MXrdW+OwmBeE+MDjVtHpUg/6x7hHjSWxFs49Yl+b84rvPiu6MmZvM7Pqh
         uBJ0r0f8sckMaBdtTyOahMBOXqZFTg1rPIuGRKrvyWnuxphNKHE0NTi6M6vZ/8jVKqW2
         5bE4vlqU8kCa+lec8n6Yy5wlu8TVpEjO39nVmCn5rrMS01y51l6GIKuohBPOq07znD/s
         mT7Yitl70ej1W/o3nNyQjFuKbqam8L6y9oIvAR1QpIx+JpyD+h3uA28OE48YWQukd8DO
         4x2B53QyK10Z+6qCdJ7AbjNE1+yj6tg4Zgw94uiL6DMep/D6D7hmT+2/ETZyGTu0dZOF
         G6fA==
X-Forwarded-Encrypted: i=1; AJvYcCWJKpGVpvLn30V36SIg0uwPXVFCktgIe3TbDyosNMOqaX1sNm7lS4OKfpKKgo9rgNBas40iypGKex0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwgFXgd7eyCLc1fijipJIeHxACuVEZiKLsIxzICsA2mqdh0+ezE
	7nDhgZF2S5nv9J/bSVY8pTJC7yTc/tQkg+vEoGIeEz/tqzbba9CVwSKUCNgz8kawfEucs9ejLiU
	9
X-Google-Smtp-Source: AGHT+IHMXbC51obgubKT6vUVA/B52MOWuZftGEeZ8V74U58TzxEwcbA31dB1sHgenRW+fz/bmiXjtg==
X-Received: by 2002:adf:e005:0:b0:368:4c38:a668 with SMTP id ffacd0b85a97d-3749b526b73mr3361000f8f.9.1724952690527;
        Thu, 29 Aug 2024 10:31:30 -0700 (PDT)
Message-ID: <f6bfba53-3a17-4da2-ac45-50b7b2175eb2@citrix.com>
Date: Thu, 29 Aug 2024 18:31:28 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: IOREQ completions for MMIO writes
To: Jason Andryuk <jason.andryuk@amd.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <f4551fc8-d0c0-492c-8ad3-b045843af381@amd.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <f4551fc8-d0c0-492c-8ad3-b045843af381@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 29/08/2024 5:08 pm, Jason Andryuk wrote:
> Hi Everyone,
>
> I've been looking at ioreq latency and pausing of vCPUs.  Specifically
> for MMIO (IOREQ_TYPE_COPY) writes, they still need completions:
>
> static inline bool ioreq_needs_completion(const ioreq_t *ioreq)
> {
>     return ioreq->state == STATE_IOREQ_READY &&
>            !ioreq->data_is_ptr &&
>            (ioreq->type != IOREQ_TYPE_PIO || ioreq->dir != IOREQ_WRITE);
> }
>
> state == STATE_IOREQ_READY
> data_is_ptr == 0
> type == IOREQ_TYPE_COPY
> dir == IOREQ_WRITE
>
> To a completion is needed.  The vCPU remains paused with
> _VPF_blocked_in_xen set in paused_flags until the ioreq server
> notifies of the completion.
>
> At least for the case I'm looking, a single write to a mmio register,
> it doesn't seem like the vCPU needs to be blocked.  The write has been
> sent and subsequent emulation should not depend on it.
>
> I feel like I am missing something, but I can't think of a specific
> example where a write needs to be blocking.  Maybe it simplifies the
> implementation, so a subsequent instruction will always have a ioreq
> slot available?
>
> Any insights are appreciated.


This is a thorny issue.

In x86, MMIO writes are typically posted, but that doesn't mean that the
underlying layers can stop tracking the write completely.

In your scenario, consider what happens when the same vCPU hits a second
MMIO write a few instructions later.  You've now got two IOREQs worth of
pending state, only one slot in the "ring", and a wait of an unknown
period of time for qemu to process the first.


More generally, by not blocking you're violating memory ordering.

Consider vCPU0 doing an MMIO write, and vCPU1 doing an MMIO read, and
qemu happening to process vCPU1 first.

You now have a case where the VM can observe vCPU0 "completing" before
vCPU1 starts, yet vCPU1 observing the old value.

Other scenarios which exist would be e.g. a subsequent IO hitting STDVGA
buffering and being put into the bufioreq ring.  Or the vCPU being able
to continue when the "please unplug my emulated disk/network" request is
still pending.


In terms of what to do about latency, this is one area where Xen does
suffer vs KVM.

With KVM, this type of emulation is handled synchronously by an entity
on the same logical processor.  With Xen, one LP says "I'm now blocked,
schedule something else" without any idea when the IO will even be
processed.


One crazy idea I had was to look into not de-scheduling the HVM vCPU,
and instead going idle by MONITOR-ing the IOREQ slot.

This way, Qemu can "resume" the HVM vCPU by simply writing the
completion status (and observing some kind of new "I don't need an
evtchn" signal).  For a sufficiently quick turnaround, you're also not
thrashing the cache by scheduling another vCPU in the meantime.

It's definitely more complicated.  For one, you'd need to double the
size of an IOREQ slot (currently 32 bytes) to avoid sharing a cacheline
with an adjacent vCPU.

I also have no idea if it would be an improvement in practice, but on
paper it does look like it warrants some further experimentation.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 18:38:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 18:38:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786059.1195608 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjk2U-0003MI-V4; Thu, 29 Aug 2024 18:38:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786059.1195608; Thu, 29 Aug 2024 18:38:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjk2U-0003MB-Ru; Thu, 29 Aug 2024 18:38:34 +0000
Received: by outflank-mailman (input) for mailman id 786059;
 Thu, 29 Aug 2024 18:38:33 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zolI=P4=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjk2T-0003M5-Gr
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 18:38:33 +0000
Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com
 [2a00:1450:4864:20::633])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e28984a5-6635-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 20:38:29 +0200 (CEST)
Received: by mail-ej1-x633.google.com with SMTP id
 a640c23a62f3a-a8696e9bd24so129176866b.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 11:38:29 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a898900f26asm108992166b.58.2024.08.29.11.38.20
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Thu, 29 Aug 2024 11:38:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e28984a5-6635-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724956708; x=1725561508; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=eObA4/0vF47B3M4DileFOdwT05bO0d69HHcAChJn1Yg=;
        b=tumvY/c8zuSIdZN9VwB7G/6QBmCc4nKan47pUi1kodkepVCE+suQ2ncLD4N4HrGIAQ
         XQItM3z9Z3CN2BnekDG/62UzUo39ASUVBCf99aN9ei4dIapaMxYMHmfTXe4AnI1ooujs
         6aTUF/WGmNQPFpuX1CIPqfxX2TH3wDK9usfbY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724956708; x=1725561508;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=eObA4/0vF47B3M4DileFOdwT05bO0d69HHcAChJn1Yg=;
        b=itct7rrERkxzTSsFCKPPqcR7W5nlUhvhyLXMbwCVQyTL8AxwQh7BAiqr3+Lu2y+RPx
         UBtAUjoFv6xbJ/OTrYLzka9cm/ZC70U2lMgBrO/FaJVht1ZlivSKuHUZyvKbg2p6P/J/
         Kbk7S5lO4S5fbBcd++TjkMB2tTHsJVUFGm9MfL9PUnTIN6Kne4f+apJDj6FS2T7n4EyK
         ZdXOaai10j9pY7Nv1VDw8I4M/5xBL/ePe1IW16iA6OepWMi4bYjvyoLi3OL80xXVt0Yx
         bXryFpK6vwP87iZmpbvHApFCf1rzUY++ztXD6RhQ+7yUVlVu4dlER8RhlzRhsKAYGEqK
         9ifQ==
X-Gm-Message-State: AOJu0Yze2hI9v8PLBLZorNqCu1CRX8TMLPtPwgjKxoBlauPhzQSts8m2
	SOnoeEPK5oBoFp5MN4iLoGMRWQP9DUC/V15Zfx2/+ZeysXcrhVd1srFT3cb8wJ2m1eaDVFE8XJ6
	h
X-Google-Smtp-Source: AGHT+IH75GJDefyrKK4Ut9+fvaWChrcrXGLdYFb1vZmf3GXZIVILEPPV3pLkMvjJNfb6LDp8WjNrww==
X-Received: by 2002:a17:907:ea6:b0:a86:ad8b:3511 with SMTP id a640c23a62f3a-a897fa7235fmr286354066b.49.1724956707649;
        Thu, 29 Aug 2024 11:38:27 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH] x86/pv: Make cr4_pv32_mask be PV32-only
Date: Thu, 29 Aug 2024 19:38:17 +0100
Message-Id: <20240829183817.2807665-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The user of cr4_pv32_mask (the cr4_pv32_restore() function) only exists in a
CONFIG_PV32 build, but right now the variable is unconditionally set up.

To start with, move the setup into set_in_cr4() and remove it from it's
somewhat ad-hoc position in __start_xen().  This means the variable will be
set up in two steps for a CONFIG_PV32=y build, but it's cleaner and more
robust logic overall.

With that, there's no good reason for the variable to stay in setup.c.  Move
it to x86/pv/traps.c (for want of any better place to live), and move the
declaration to beside set_in_cr4() and mmu_cr4_features which is a better
position than setup.h.

Guard the reference with CONFIG_PV32, and fix up a recent typo in an adjacent
comment while at it.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/include/asm/processor.h |  4 ++++
 xen/arch/x86/include/asm/setup.h     |  2 --
 xen/arch/x86/pv/dom0_build.c         | 10 +++++++---
 xen/arch/x86/pv/traps.c              |  4 ++++
 xen/arch/x86/setup.c                 |  4 ----
 5 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/include/asm/processor.h b/xen/arch/x86/include/asm/processor.h
index 66463f6a6d67..e71dbb8d3fbf 100644
--- a/xen/arch/x86/include/asm/processor.h
+++ b/xen/arch/x86/include/asm/processor.h
@@ -312,11 +312,15 @@ static inline void stts(void)
  * after us can get the correct flags.
  */
 extern unsigned long mmu_cr4_features;
+extern unsigned long cr4_pv32_mask;
 
 static always_inline void set_in_cr4 (unsigned long mask)
 {
     mmu_cr4_features |= mask;
     write_cr4(read_cr4() | mask);
+
+    if ( IS_ENABLED(CONFIG_PV32) && (mask & XEN_CR4_PV32_BITS) )
+        cr4_pv32_mask |= (mask & XEN_CR4_PV32_BITS);
 }
 
 static always_inline void __monitor(const void *eax, unsigned long ecx,
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index 8f7dfefb4dcf..d75589178b91 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -64,8 +64,6 @@ extern bool opt_dom0_verbose;
 extern bool opt_dom0_cpuid_faulting;
 extern bool opt_dom0_msr_relaxed;
 
-extern unsigned long cr4_pv32_mask;
-
 #define max_init_domid (0)
 
 #endif
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 57b1834b5eaa..262edb6bf2f0 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -1061,12 +1061,14 @@ int __init dom0_construct_pv(struct domain *d,
 
     /*
      * Clear SMAP in CR4 to allow user-accesses in construct_dom0().  This
-     * prevents us needing to write rewrite construct_dom0() in terms of
+     * prevents us needing to write construct_dom0() in terms of
      * copy_{to,from}_user().
      */
     if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
     {
-        cr4_pv32_mask &= ~X86_CR4_SMAP;
+        if ( IS_ENABLED(CONFIG_PV32) )
+            cr4_pv32_mask &= ~X86_CR4_SMAP;
+
         write_cr4(read_cr4() & ~X86_CR4_SMAP);
     }
 
@@ -1075,7 +1077,9 @@ int __init dom0_construct_pv(struct domain *d,
     if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
     {
         write_cr4(read_cr4() | X86_CR4_SMAP);
-        cr4_pv32_mask |= X86_CR4_SMAP;
+
+        if ( IS_ENABLED(CONFIG_PV32) )
+            cr4_pv32_mask |= X86_CR4_SMAP;
     }
 
     return rc;
diff --git a/xen/arch/x86/pv/traps.c b/xen/arch/x86/pv/traps.c
index 5a7341abf068..3389a25acd83 100644
--- a/xen/arch/x86/pv/traps.c
+++ b/xen/arch/x86/pv/traps.c
@@ -18,6 +18,10 @@
 #include <asm/traps.h>
 #include <irq_vectors.h>
 
+#ifdef CONFIG_PV32
+unsigned long __ro_after_init cr4_pv32_mask;
+#endif
+
 void pv_inject_event(const struct x86_event *event)
 {
     struct vcpu *curr = current;
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index f1076c72032d..c2e0082a3020 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -79,8 +79,6 @@ bool __read_mostly use_invpcid;
 int8_t __initdata opt_probe_port_aliases = -1;
 boolean_param("probe-port-aliases", opt_probe_port_aliases);
 
-unsigned long __ro_after_init cr4_pv32_mask;
-
 /* **** Linux config option: propagated to domain0. */
 /* "acpi=off":    Sisables both ACPI table parsing and interpreter. */
 /* "acpi=force":  Override the disable blacklist.                   */
@@ -1898,8 +1896,6 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     if ( boot_cpu_has(X86_FEATURE_XEN_SMAP) )
         set_in_cr4(X86_CR4_SMAP);
 
-    cr4_pv32_mask = mmu_cr4_features & XEN_CR4_PV32_BITS;
-
     if ( boot_cpu_has(X86_FEATURE_FSGSBASE) )
         set_in_cr4(X86_CR4_FSGSBASE);
 

base-commit: 99f942f3d410059dc223ee0a908827e928ef3592
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 19:25:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 19:25:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786072.1195618 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjkm3-0002wC-E0; Thu, 29 Aug 2024 19:25:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786072.1195618; Thu, 29 Aug 2024 19:25:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjkm3-0002w5-AQ; Thu, 29 Aug 2024 19:25:39 +0000
Received: by outflank-mailman (input) for mailman id 786072;
 Thu, 29 Aug 2024 19:25:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=zolI=P4=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sjkm2-0002vz-Ct
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 19:25:38 +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 779a9de4-663c-11ef-a0b0-8be0dac302b0;
 Thu, 29 Aug 2024 21:25:36 +0200 (CEST)
Received: by mail-ed1-x52b.google.com with SMTP id
 4fb4d7f45d1cf-5c210e23573so1081328a12.0
 for <xen-devel@lists.xenproject.org>; Thu, 29 Aug 2024 12:25:36 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8989233403sm111581466b.212.2024.08.29.12.25.34
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Thu, 29 Aug 2024 12:25:34 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 779a9de4-663c-11ef-a0b0-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1724959536; x=1725564336; 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=hzQd8HyDl+nxrJBwHhRqXGCUtHG/JG1E/D0KkCoNeiw=;
        b=WlXrdxGgH9h8V/by5+UZK5PqwbOsmJ8NvHw+4PH/FQbxkHPGYGmyXt8wUcxtkGtjPI
         kmtx17IUs64+v+QYFtk0CbuUIolnIp2iZA1CQ1cx0ro7bWb4QhcmMBoSY1Ec3Ogug/Kq
         bs+iACELjLNcZj6WeVxwc0ffnP0SlS2ECtJ98=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1724959536; x=1725564336;
        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=hzQd8HyDl+nxrJBwHhRqXGCUtHG/JG1E/D0KkCoNeiw=;
        b=P+CJDcHcWCO7lKk0//F4Gq7oTzYvNCteyEfev8i3odaDkOom9oUBOqDt15gZH70yZs
         bUz4vg2emTW6nHy9Ts8F4qhg3V8Ca/hf+llCiwdaAE2VgeuO8Ed2CEIcVoyhpwfi7KFB
         yV1nXoCAZkOyF7cTlWRkt9A676lpSgiSdM/GlKlhvf+aa0jWH0gQP0pFk4uykZTrl48+
         iltOVxec1pBlsd13DOMRxw7FTZKWQsg/ZCFRZJaZujZsYfQeKn5XXr8WgHEQKGVYpJAF
         r6T+/SYtcP3g677Iidou8WCDsHAPk0B1bewRgNJOuKJA6HCkfe+uMWgHnAPNEjTFOYvF
         tDGQ==
X-Forwarded-Encrypted: i=1; AJvYcCWoPD4op1oqneFYl4G+zY37T4i6DA5Hq0a5YhAXPBGVpQqXsAeGHp5yAc9l5X3UUtq9GJ8oVm7hq8k=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxqlUvypPlFvvg28kUegsjhrT28YQt+CZOTZwXJeJXziYHMPqpP
	jd4UFkq6bg36tDVnLmaTHuYGVEQfsNFT/qyq5tuMuXDIR417nnf+LNlTlPwRU0M=
X-Google-Smtp-Source: AGHT+IFxifD3lPTj0zQouOMfgtvmkFCklC8cnFq0tuDXDnVcBvRf5fXG4J/fy53Vgmfb95eKy8eAbw==
X-Received: by 2002:a17:907:980c:b0:a86:9776:ef40 with SMTP id a640c23a62f3a-a897f920162mr374189266b.36.1724959535325;
        Thu, 29 Aug 2024 12:25:35 -0700 (PDT)
Message-ID: <1f3772da-94cc-465e-bcc2-2d857ebe8552@citrix.com>
Date: Thu, 29 Aug 2024 20:25:32 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v2 3/5] x86/spec-ctrl: configurable
 Intlel/AMD-specific calculations
To: Sergiy Kibrik <Sergiy_Kibrik@epam.com>, xen-devel@lists.xenproject.org
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Jan Beulich <jbeulich@suse.com>
References: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
 <b789679a7edd41c88eca41d3c703d2292cfcce0e.1723806405.git.Sergiy_Kibrik@epam.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <b789679a7edd41c88eca41d3c703d2292cfcce0e.1723806405.git.Sergiy_Kibrik@epam.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 16/08/2024 12:14 pm, Sergiy Kibrik wrote:
> Put platforms-specific code under #ifdef CONFIG_{AMD,INTEL} so that when
> corresponding CPU support is disabled by configuration less dead code will end
> up in the build.
>
> This includes re-ordering of calls to ibpb_calculations() & div_calculations(),
> but since they don't access common variables or feature bits it should be
> safe to do.
>
> Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
> CC: Jan Beulich <jbeulich@suse.com>

Sorry, but no.

This logic is security critical, highly fragile, gets chopped/changed
multiple times a year (as researchers keep on finding new things), and
all major work is done to it under embargo.

Just look at the history of the file.

The ifdefary around the tsx_init() call is bad enough and I intend to
revert it and do that differently.  I would have objected if I'd got to
the patch in time.


The only relevant cost in this file is whether I (and the other security
team members) can edit it correctly or not in staging and all prior
in-support branches.  You really don't want to know how many times
there's been a bug in backports...

Saving 451 lines from certification is not cheaper than the
problems/risks you're introducing with this change.

~Andrew


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 19:49:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 19:49:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786083.1195627 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjl9H-0007PH-5p; Thu, 29 Aug 2024 19:49:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786083.1195627; Thu, 29 Aug 2024 19:49:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjl9H-0007PA-30; Thu, 29 Aug 2024 19:49:39 +0000
Received: by outflank-mailman (input) for mailman id 786083;
 Thu, 29 Aug 2024 19:49:38 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjl9G-0007P0-Am; Thu, 29 Aug 2024 19:49:38 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjl9G-0002of-64; Thu, 29 Aug 2024 19:49:38 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjl9F-0002jQ-OS; Thu, 29 Aug 2024 19:49:37 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjl9F-000185-Nv; Thu, 29 Aug 2024 19:49:37 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=O0JxnP196E7yKRBZSvzAA/c1gqa3Pjk6MGCEwKNb4L0=; b=29MEsEy8b3MraH9ZxCopiouU7Q
	x8CTv/v7m7wtur6ESRJQrXDAAotNYWFjoxoE2CKFeLHNhBZJmpxCkbeRF7pRnQNtLHX3jJPBQ8TC1
	14wzWsuW0eHUkZiDriRlRFDmdTZd0kfdQ12aSt8kQdBsioi6wk2sQNukPXb8K54hxYKI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187407-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187407: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=1169122c6f22d4db3e44b7b720480522b6933a62
X-Osstest-Versions-That:
    ovmf=01735bbe4a46a6fb7d5d739d0fc5a14897ad18da
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 29 Aug 2024 19:49:37 +0000

flight 187407 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187407/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 1169122c6f22d4db3e44b7b720480522b6933a62
baseline version:
 ovmf                 01735bbe4a46a6fb7d5d739d0fc5a14897ad18da

Last test of basis   187403  2024-08-29 13:15:08 Z    0 days
Testing same since   187407  2024-08-29 16:45:30 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Aaron Pop <aaronpop@microsoft.com>
  Oliver Smith-Denny <osde@microsoft.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   01735bbe4a..1169122c6f  1169122c6f22d4db3e44b7b720480522b6933a62 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 20:23:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 20:23:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786095.1195638 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjlgL-0005T9-Mf; Thu, 29 Aug 2024 20:23:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786095.1195638; Thu, 29 Aug 2024 20:23:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjlgL-0005T2-Iq; Thu, 29 Aug 2024 20:23:49 +0000
Received: by outflank-mailman (input) for mailman id 786095;
 Thu, 29 Aug 2024 20:23: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=i2Q5=P4=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sjlgK-0005Sw-Gn
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 20:23:48 +0000
Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9769691a-6644-11ef-99a0-01e77a169b0f;
 Thu, 29 Aug 2024 22:23:46 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by nyc.source.kernel.org (Postfix) with ESMTP id 35E73A429CB;
 Thu, 29 Aug 2024 20:23:38 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id E62ECC4CEC1;
 Thu, 29 Aug 2024 20:23:43 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9769691a-6644-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724963024;
	bh=Q/GabXxRkrG/A8CtNWlncrU95PRdbk2vURGI7vgVYeI=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=qwYGHVbHwjiaqvgukAKNJvjZMLHNURjNrcL1xeIQRzrPyKnU9Qyzjq3yW/HDOCM4Y
	 Fx4AKfzUCid23t8bWzuUPAZRsMizAmQUxxIDDLvbsJd+e4eXs5q4dpaavVGTIvToFP
	 woxOHiO6lrcoaslh7mE3Xa/FusCEZjJrKpU7J0hlxF0M8yuZM+sN2ef3KdlFoVJ1Kw
	 3Z/40/ueJpIxt/Y8LDXLw/VARucB4PhvKOl6UQgarexkfo3PUdaXEma9sAE9c+A7nA
	 g40yITlkbo1TZpsUHCiStmGmq2ehGNC1tXUyHBKi9XvdqE54ByrbjNgEby9zSsp5Xk
	 Ic58Xzf2OsrAA==
Date: Thu, 29 Aug 2024 13:23:42 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: "Lira, Victor M" <VictorM.Lira@amd.com>
cc: Michal Orzel <michal.orzel@amd.com>, xen-devel@lists.xenproject.org, 
    Andrew Cooper <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, 
    Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [PATCH v1] automation: fix false success in qemu tests
In-Reply-To: <fab9c785-3db3-45a9-b701-826478f9bdee@amd.com>
Message-ID: <alpine.DEB.2.22.394.2408291323290.53815@ubuntu-linux-20-04-desktop>
References: <e4de45759723b28713ef205335c4d79b9e7074b7.1724904269.git.victorm.lira@amd.com> <2756d5b3-e4b1-420e-8402-2697c559acb9@amd.com> <fab9c785-3db3-45a9-b701-826478f9bdee@amd.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 28 Aug 2024, Lira, Victor M wrote:
> Hello Michal,
> 
> Unfortunately only removing "set +e" did not fix the issue as the test still
> will always pass.
> See here (line 90):
> https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/7700210695
> 
> I think we will need to use the fifo or the Bash "pipefail" function.

pipefail is better if possible


> > You may want to use "Fixes" tag. See docs/process/sending-patches.pandoc.
> > This commit tries to do 2 thins at once:
> >   - fix "set +e" issue
> >   - make xilinx tests use expect
> > 
> > These should be 2 separate patches. The first patch should only remove "set
> > +e" from qemu patches.
> > There is no need for fifo in qemu tests. You should use that only in xilinx
> > tests where we cannot remove "set +e".
> > 
> > ~Michal
> 
> OK, I will review the doc and create separate patches for fixing the qemu and
> xilinx tests.
> 
> 
> Victor
> 
> 


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 21:31:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 21:31:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786111.1195647 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjmk1-0000Wy-86; Thu, 29 Aug 2024 21:31:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786111.1195647; Thu, 29 Aug 2024 21:31:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjmk1-0000Wr-5P; Thu, 29 Aug 2024 21:31:41 +0000
Received: by outflank-mailman (input) for mailman id 786111;
 Thu, 29 Aug 2024 21:31:39 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjmjz-0000WR-MK; Thu, 29 Aug 2024 21:31:39 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjmjz-0004aa-FA; Thu, 29 Aug 2024 21:31:39 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjmjz-00085k-1F; Thu, 29 Aug 2024 21:31:39 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjmjz-0003Va-0j; Thu, 29 Aug 2024 21:31:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=59iFgGNHtHPTUhqeXre5NiLiKo7rlhOb8MPTKCkSyNo=; b=hmRRvko3es+5MdkV1ZR8ERFrmm
	ZMU1y6yhHHoNps/5W4ZXOKCohojo2rfzN2SC3jusUvOkDed3iJqwOCEXnCfvu4SFqYppINbkrZE5U
	YNqW0hodqSd3iwm3g2t0Sz+NcWMVC4AnuVYjtYk3bQVBVYyB/sPN/hf9C9MEyKHoLj5o=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187397-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [qemu-mainline test] 187397: regressions - FAIL
X-Osstest-Failures:
    qemu-mainline:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:debian-hvm-install:fail:regression
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:windows-install:fail:heisenbug
    qemu-mainline:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    qemu-mainline:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    qemuu=cec99171931ea79215c79661d33423ac84e63b6e
X-Osstest-Versions-That:
    qemuu=c152379422a204109f34ca2b43ecc538c7d738ae
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 29 Aug 2024 21:31:39 +0000

flight 187397 qemu-mainline real [real]
flight 187408 qemu-mainline real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187397/
http://logs.test-lab.xenproject.org/osstest/logs/187408/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 12 debian-hvm-install fail REGR. vs. 182707

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemuu-win7-amd64 12 windows-install fail pass in 187408-retest

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop  fail in 187408 like 182707
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 182707
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 182707
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 182707
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass

version targeted for testing:
 qemuu                cec99171931ea79215c79661d33423ac84e63b6e
baseline version:
 qemuu                c152379422a204109f34ca2b43ecc538c7d738ae

Last test of basis   182707  2023-09-07 00:28:57 Z  357 days
Failing since        182723  2023-09-07 18:19:05 Z  357 days   40 attempts
Testing same since   187397  2024-08-29 05:16:44 Z    0 days    1 attempts

------------------------------------------------------------
621 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        fail    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

(No revision log; it would be 181188 lines long.)


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 22:00:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 22:00:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786121.1195658 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjnC6-0005vP-Im; Thu, 29 Aug 2024 22:00:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786121.1195658; Thu, 29 Aug 2024 22:00:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjnC6-0005vI-Fx; Thu, 29 Aug 2024 22:00:42 +0000
Received: by outflank-mailman (input) for mailman id 786121;
 Thu, 29 Aug 2024 22:00:41 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjnC5-0005up-DH; Thu, 29 Aug 2024 22:00:41 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjnC4-00055s-Vp; Thu, 29 Aug 2024 22:00:40 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjnC4-0000ZE-Kg; Thu, 29 Aug 2024 22:00:40 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjnC4-0007NY-KE; Thu, 29 Aug 2024 22:00:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=UROqgLuWIAW8rATgavjMUMlPjnO7Bk6XTreeV4x8v90=; b=nX2z2FcIu2HSwRe4xP6lawzafF
	XUFnuUgJMYnNRZeCYVHpqG8BA+xwQD0xTZu1ZfYwmQ7TtUcHAHt08gI5JNR95z6xOOV6h8T7/iMuQ
	u9myFtIom4E1fUX8KXscOlip23SMN0+xSzhwxC+jZ7Pu5xRPahaYBzZGAgOHoO6Zr8PY=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187409-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187409: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=b6c4708c4d3470cfd9f465771a665510d3ad1a66
X-Osstest-Versions-That:
    ovmf=1169122c6f22d4db3e44b7b720480522b6933a62
From: osstest service owner <osstest-admin@xenproject.org>
Date: Thu, 29 Aug 2024 22:00:40 +0000

flight 187409 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187409/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 b6c4708c4d3470cfd9f465771a665510d3ad1a66
baseline version:
 ovmf                 1169122c6f22d4db3e44b7b720480522b6933a62

Last test of basis   187407  2024-08-29 16:45:30 Z    0 days
Testing same since   187409  2024-08-29 20:11:30 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Aaron Pop <aaronpop@microsoft.com>
  Ray Robles <rayrobles@microsoft.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   1169122c6f..b6c4708c4d  b6c4708c4d3470cfd9f465771a665510d3ad1a66 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Thu Aug 29 22:35:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 22:35:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786136.1195678 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjnjG-00033c-96; Thu, 29 Aug 2024 22:34:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786136.1195678; Thu, 29 Aug 2024 22:34:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjnjG-00033V-63; Thu, 29 Aug 2024 22:34:58 +0000
Received: by outflank-mailman (input) for mailman id 786136;
 Thu, 29 Aug 2024 22:34: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=N580=P4=amd.com=VictorM.Lira@srs-se1.protection.inumbo.net>)
 id 1sjnjE-000330-FS
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 22:34:56 +0000
Received: from NAM02-SN1-obe.outbound.protection.outlook.com
 (mail-sn1nam02on20627.outbound.protection.outlook.com
 [2a01:111:f400:7ea9::627])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id e8b95f59-6656-11ef-99a0-01e77a169b0f;
 Fri, 30 Aug 2024 00:34:54 +0200 (CEST)
Received: from SA0PR11CA0201.namprd11.prod.outlook.com (2603:10b6:806:1bc::26)
 by CY5PR12MB6573.namprd12.prod.outlook.com (2603:10b6:930:43::21)
 with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27; Thu, 29 Aug
 2024 22:34:47 +0000
Received: from SN1PEPF000397B3.namprd05.prod.outlook.com
 (2603:10b6:806:1bc:cafe::4f) by SA0PR11CA0201.outlook.office365.com
 (2603:10b6:806:1bc::26) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.27 via Frontend
 Transport; Thu, 29 Aug 2024 22:34:47 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SN1PEPF000397B3.mail.protection.outlook.com (10.167.248.57) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 22:34:46 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 29 Aug
 2024 17:34:45 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 29 Aug
 2024 17:34:45 -0500
Received: from xsjwoods50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend
 Transport; Thu, 29 Aug 2024 17:34:44 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e8b95f59-6656-11ef-99a0-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=iy9pa/B4RtQH+pJnJvocQdzo6x6PA+eZRU9SC2j6IdOgqRZXZ5jcJzrJlvK+R7292GOmToqo20mvbnfNP3r8mmTBf8otuL0g3BdVcZRe0iWpveQNjKCxmdk8KvHZZ+rVeMJLNxWkFx0dKEZ/ttU8GUOyEa80pwPQETMsNRGFgs1HXBg34emAgueC7ksBeu0+8IGTlTMn2fxeUGKBeAgSMOo2wki1/FShVwcSMJf0OF7/KNwgi+iFUgjtBj88SaunLTyTk/UTlNXB6uU3hZ5ATtlKAdhYnDMhlwVCSe1NvQOXyE13ioYKZSxZ+lA5d0VAxBPOwWWyyDEKUneOIMP0fg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=U1jgTNWGwPI6xz2FmLlpvUZAIaWeP7Yy8H0GhG+UJYc=;
 b=Xe1Z3YR6KkwLeFZvJiquEPqp/qBZugLgQkVZn1ab9l/vG+q3c2ViPKVe8z1FWd7Y8zrk/EgKr2lPvgS5Jx+giKnlnDOhf5u2L3RSgYuS1eMPVJq92fcZWmV2bAQmGhzA46Pa1mVzJikqSOn+VkrrdFlG8aZZb1j8rbnTWf2zUg7LQ5qBezYfSpR9a7AjPW8JSnOp3L/gQ5/r4aCeE7vf4ELwurMSUhw0RBaXqsvZFbmWtzATLDr1YZWlgLtkX4+vYL2ChF9OVtn0XJA0J90AvKuOJLgjbyGvSO0dIrj8kcbtRhXwupzDOmAvt25Ds4ysNhJfypgNofeIpkUbTTSRrg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=U1jgTNWGwPI6xz2FmLlpvUZAIaWeP7Yy8H0GhG+UJYc=;
 b=ZPrKYbQGVeXlZ5Te40i/8y4K1McoP/mfnrY177vOHUuzdxxQJLteRZlhkk+qFllOKZ3RMp6NxFuAEmC26VQP1m0wblae6FMwGeXm38SDZ/AtpmTU5KcZUziIB8osU7VrqPsJz+Gj/XZe1LZQ8HvgYqNhGGFkqAlJYS8lJuTyAgM=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: <victorm.lira@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Victor Lira <victorm.lira@amd.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Michal Orzel
	<michal.orzel@amd.com>
Subject: [PATCH v2 1/2] automation: fix false success in qemu tests
Date: Thu, 29 Aug 2024 15:34:22 -0700
Message-ID: <9b60c6473aa084e4e47c64aa2347db6e3ca9ac91.1724967614.git.victorm.lira@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1724967614.git.victorm.lira@amd.com>
References: <cover.1724967614.git.victorm.lira@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: victorm.lira@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN1PEPF000397B3:EE_|CY5PR12MB6573:EE_
X-MS-Office365-Filtering-Correlation-Id: 3e62a679-f183-4ccc-d13f-08dcc87ac95b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?NLMFrx89MS2Sx93VZzOxKLxaPSQg5C7zR0cKesafOCKIQMJdA2tNR58M2XsO?=
 =?us-ascii?Q?MMS7Am+qNyN5AvwpcASUNsz9LJwUEKWxXlvWXmkbzd1sEJOBBLsxydhS4C/y?=
 =?us-ascii?Q?yTB6eTC5F5VJcd/8TzKVme8fBDpAkH0lBtvraoauwHDu3dzmv8QZGcCBamqo?=
 =?us-ascii?Q?YWEPLJCegu+qQavZHlBNDxZ7OIQKbjPeLpX0t+k4kphT87NO+ogFkdC+9xEd?=
 =?us-ascii?Q?8ELpiDzqzjjty5TEfp2dlH22p+mA8Ipeofc3oEB0iwap0JZ3js5+QH0M6S5y?=
 =?us-ascii?Q?+/OPnFXCYEe008rQANfsSuxNTOhxn6WT7ave2hqxQ5tPSdJtWZkZWwjCn5Lc?=
 =?us-ascii?Q?nsPDs3CeYgChTbUfNY9IUhH+/RXVN3NSJ0AvrkObl7YbSW542o8TAl8irRNR?=
 =?us-ascii?Q?RYJxbHi6fWtVthjEdAWBTcviuL1fIAsqYmldj21KUlD5zKXA9uU7cWmZMAvQ?=
 =?us-ascii?Q?paMRt10vvvgsUB3wseG89ytQiBLy3a+0bBQlalfx3bgRzImJJ7cFIgponVgH?=
 =?us-ascii?Q?/PLxWU9bAHrW1A4MppcVXefZ8FpZOYgxZ/wjpQUeeeCDBJIqaQh/9LtdmYXa?=
 =?us-ascii?Q?c8dmHDU7y5LwHgSmZLNDA0mr9dvtiNL79uWAvVpMbXXkoytYD8Poj/cyHf4Q?=
 =?us-ascii?Q?eMijae5JqHUciQGPiY4JtEg3Bp51j/APM/sIkGl9WLNHBm2tMFzb3K9HRkFc?=
 =?us-ascii?Q?sUuK5XKvlhCRuQ5NblLhMpvCoNoomPOGVy+Tn7U2FZt3ldmTDflZ6BCUTG2R?=
 =?us-ascii?Q?eECKmvFMWCVfpqTVG95hKYlILa25MGFrk9PYsiGjHPU6o/hRETfzR8aRwX5l?=
 =?us-ascii?Q?tn/U/UReVVbudG4M1nwoyAK4BdguYgYm2ou0AooxY7bH5LE1hOPZHM2jcBY7?=
 =?us-ascii?Q?VkTcFEPXkTgocKHyQIa0CXSl5K24nqLuDid+xAJWeriw62VAqmS3VpFj360P?=
 =?us-ascii?Q?Lsdz2qcADpZD0/IL5g+A4HGNhG+O9oq/4r0Jn68Fy807ppS3dh6R7622e1l0?=
 =?us-ascii?Q?+6HX2tN4nzkDk043KBL+u5wLdn6VemYZOvRSFn85/tVfGr7FUgJOy+payKzu?=
 =?us-ascii?Q?5iDzWnifJ6oMnfLhk4ojI8lyAlV3lQhoCf0CwqBwJgUtCY21acYs9C6i8iMb?=
 =?us-ascii?Q?SLVrIeNSgjDrAu394L4lmoqTYTXEKhW5rRdklCM3H+P+dxBiiZnO63cVZIdL?=
 =?us-ascii?Q?VG6C7UGWDismXVbhMlSqyQ64G1OHbdEld6ahJN0/6NftuTxTBombNL3bGuZB?=
 =?us-ascii?Q?fr8dBQsJZHQsKaPgtsYAPdZw6TWK2O0KhJt3Jyvdep34UacRMbmonEa6DhiV?=
 =?us-ascii?Q?neWN/+dYZCTS/gr4Qj7o1EQ/mV6wQdpCSRCHW/l4H4VGiQXdTsCgg6nsLLsX?=
 =?us-ascii?Q?JdixlOiAtCdDZmXzz4ySSDxbGPh6hxbBF79fWLce4ZhH1iwaCw=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 22:34:46.6914
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 3e62a679-f183-4ccc-d13f-08dcc87ac95b
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SN1PEPF000397B3.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6573

From: Victor Lira <victorm.lira@amd.com>

Fix flaw in qemu-*.sh tests that producess a false success. The following
lines produces success despite the "expect" script producing nonzero exit
status:

    set +e
...
    ./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
    (end of file)

The default exit status for a pipeline using "|" operator is that of the
rightmost command. Fix this by setting the "pipefail" option in the shell,
and removing "set +e" allowing the expect script to determine the result.

Signed-off-by: Victor Lira <victorm.lira@amd.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Julien Grall <julien@xen.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Michal Orzel <michal.orzel@amd.com>
Cc: xen-devel@lists.xenproject.org
---
 automation/scripts/qemu-alpine-x86_64.sh        | 3 +--
 automation/scripts/qemu-key.exp                 | 2 +-
 automation/scripts/qemu-smoke-dom0-arm32.sh     | 3 +--
 automation/scripts/qemu-smoke-dom0-arm64.sh     | 3 +--
 automation/scripts/qemu-smoke-dom0less-arm32.sh | 3 +--
 automation/scripts/qemu-smoke-dom0less-arm64.sh | 3 +--
 automation/scripts/qemu-smoke-ppc64le.sh        | 3 +--
 automation/scripts/qemu-smoke-riscv64.sh        | 3 +--
 automation/scripts/qemu-smoke-x86-64.sh         | 3 +--
 automation/scripts/qemu-xtf-dom0less-arm64.sh   | 3 +--
 10 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 42a89e86b021..93914c41bc24 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -1,6 +1,6 @@
 #!/bin/bash

-set -ex
+set -ex -o pipefail

 # DomU Busybox
 cd binaries
@@ -76,7 +76,6 @@ EOF

 # Run the test
 rm -f smoke.serial
-set +e
 export QEMU_CMD="qemu-system-x86_64 \
     -cpu qemu64,+svm \
     -m 2G -smp 2 \
diff --git a/automation/scripts/qemu-key.exp b/automation/scripts/qemu-key.exp
index 787f1f08cb96..66c416483146 100755
--- a/automation/scripts/qemu-key.exp
+++ b/automation/scripts/qemu-key.exp
@@ -14,7 +14,7 @@ eval spawn $env(QEMU_CMD)

 expect_after {
     -re "(.*)\r" {
-        exp_continue
+        exp_continue -continue_timer
     }
     timeout {send_error "ERROR-Timeout!\n"; exit 1}
     eof {send_error "ERROR-EOF!\n"; exit 1}
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index fd64b19358ae..7c282eff3a58 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -1,6 +1,6 @@
 #!/bin/bash

-set -ex
+set -ex -o pipefail

 serial_log="$(pwd)/smoke.serial"

@@ -77,7 +77,6 @@ git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git
 bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config

 rm -f ${serial_log}
-set +e
 export QEMU_CMD="./qemu-system-arm \
    -machine virt \
    -machine virtualization=true \
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index e0cea742b0a0..81f210f7f50e 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -1,6 +1,6 @@
 #!/bin/bash

-set -ex
+set -ex -o pipefail

 # DomU Busybox
 cd binaries
@@ -93,7 +93,6 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf

 # Run the test
 rm -f smoke.serial
-set +e
 export QEMU_CMD="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index e824cb7c2a3d..38e8a0b0bd7d 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -1,6 +1,6 @@
 #!/bin/bash

-set -ex
+set -ex -o pipefail

 test_variant=$1

@@ -130,7 +130,6 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config

 # Run the test
 rm -f ${serial_log}
-set +e
 export QEMU_CMD="./qemu-system-arm \
     -machine virt \
     -machine virtualization=true \
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index f42ba5d196bc..ea67650e17da 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -1,6 +1,6 @@
 #!/bin/bash

-set -ex
+set -ex -o pipefail

 test_variant=$1

@@ -204,7 +204,6 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf

 # Run the test
 rm -f smoke.serial
-set +e
 export QEMU_CMD="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt,gic-version=$gic_version \
diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/scripts/qemu-smoke-ppc64le.sh
index 594f92c19cc2..49e189c37058 100755
--- a/automation/scripts/qemu-smoke-ppc64le.sh
+++ b/automation/scripts/qemu-smoke-ppc64le.sh
@@ -1,6 +1,6 @@
 #!/bin/bash

-set -ex
+set -ex -o pipefail

 serial_log="$(pwd)/smoke.serial"

@@ -9,7 +9,6 @@ machine=$1

 # Run the test
 rm -f ${serial_log}
-set +e

 export QEMU_CMD="qemu-system-ppc64 \
     -bios skiboot.lid \
diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
index c2595f657ff3..422ee03e0d26 100755
--- a/automation/scripts/qemu-smoke-riscv64.sh
+++ b/automation/scripts/qemu-smoke-riscv64.sh
@@ -1,10 +1,9 @@
 #!/bin/bash

-set -ex
+set -ex -o pipefail

 # Run the test
 rm -f smoke.serial
-set +e

 export QEMU_CMD="qemu-system-riscv64 \
     -M virt \
diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
index 3440b1761db4..7495185d9fc6 100755
--- a/automation/scripts/qemu-smoke-x86-64.sh
+++ b/automation/scripts/qemu-smoke-x86-64.sh
@@ -1,6 +1,6 @@
 #!/bin/bash

-set -ex
+set -ex -o pipefail

 # variant should be either pv or pvh
 variant=$1
@@ -15,7 +15,6 @@ case $variant in
 esac

 rm -f smoke.serial
-set +e
 export QEMU_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
         -initrd xtf/tests/example/$k \
         -append \"loglvl=all console=com1 noreboot console_timestamps=boot $extra\" \
diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
index 4042fe50602b..acef1637e25b 100755
--- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
+++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
@@ -1,6 +1,6 @@
 #!/bin/bash

-set -ex
+set -ex -o pipefail

 # Name of the XTF test
 xtf_test=$1
@@ -50,7 +50,6 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf

 # Run the test
 rm -f smoke.serial
-set +e
 export QEMU_CMD="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
--
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 22:35:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 22:35:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786135.1195668 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjnjA-0002om-1y; Thu, 29 Aug 2024 22:34:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786135.1195668; Thu, 29 Aug 2024 22:34:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjnj9-0002of-VR; Thu, 29 Aug 2024 22:34:51 +0000
Received: by outflank-mailman (input) for mailman id 786135;
 Thu, 29 Aug 2024 22:34:51 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=N580=P4=amd.com=VictorM.Lira@srs-se1.protection.inumbo.net>)
 id 1sjnj8-0002oZ-R9
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 22:34:50 +0000
Received: from NAM11-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam11on2060b.outbound.protection.outlook.com
 [2a01:111:f403:2415::60b])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e51bcc9d-6656-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 00:34:48 +0200 (CEST)
Received: from SN6PR01CA0027.prod.exchangelabs.com (2603:10b6:805:b6::40) by
 CY5PR12MB6180.namprd12.prod.outlook.com (2603:10b6:930:23::8) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 15.20.7918.20; Thu, 29 Aug 2024 22:34:41 +0000
Received: from SN1PEPF000397B5.namprd05.prod.outlook.com
 (2603:10b6:805:b6:cafe::78) by SN6PR01CA0027.outlook.office365.com
 (2603:10b6:805:b6::40) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend
 Transport; Thu, 29 Aug 2024 22:34:41 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 SN1PEPF000397B5.mail.protection.outlook.com (10.167.248.59) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 22:34:41 +0000
Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 29 Aug
 2024 17:34:40 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com
 (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 29 Aug
 2024 17:34:40 -0500
Received: from xsjwoods50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend
 Transport; Thu, 29 Aug 2024 17:34:39 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e51bcc9d-6656-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=eaBG48U/yxhSRdfCZ1iPzGpypHbpdDKS/kNYpIexrIr7OMvzHe9zG6nl8DHJEJxttwl0wEIc1x78tkPrr3lpoZ8FR3tMlYlKdCwd+s7LQPRVOf6OgmfMjJE3neQPhFUIcTohWukl7Tv4FhetrU4invjO7h2xAZnZL2XWXq2DNEcSHPd3lcfyvYp+p6ly5HRZtSJWQoyq55dANqHX4m/iQnV8WXvqga2kz4nmLJuaapLD15gAj58e6HtsEn74buZ/MW6IV2ZLiv/3DsRgQ40ukspf5TZsg6zzNA8pNR4RIP+0drTCyIvA/fuKST2aDzdDXzeJX4w5KTBW+2thJQS8yQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=5Bg6jyvZrN9UIpYXhrdKMxapnXYnZfNOq+H1L5YAZps=;
 b=rpYDSnO7z/eEyRTRkQGIZ6lwpQZsAclFdJxe7iWobIorulSzl9zvDUic5dTHx8jwTmSf8ObxM567kXZZNjAIimFQ29uHK0jKfsDsrS5aaBC9y2xcgkso8co8K7H6dZlAr5BlA4zPHLIGcvZirmGb6hZmmSi5Dl0H+SZ9XxIH34UEbGHnuTGJT+KYpxTZZ2wnwvi49pIOfCNn7ue8ZpJy8YI8GC+dOaCptRdYB36WyxXGtHqP47oidOusSI3jPAMyO//2lu0bhX5msgumcyGGKM6PBHDgInI70z98NLbWtOtOEejM7EArXz6tP6ijH9SsHrak8ImIlh77C9icnOkNNg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=5Bg6jyvZrN9UIpYXhrdKMxapnXYnZfNOq+H1L5YAZps=;
 b=3CVmPXrs6u7iG9xDeZGMDnEfkSciR/wQ6byKq4leSejeaICSlLJIpR175vvawuZUA6LTO6TytabUO+Li0xDL711e9tPKlbj+O+8Bzf5z7QE+7rqtMK5oQcYuHd/ggfe0uZ3RKGrreHPw+aaV3D1A1ys9ICNHPYcPQ/yHJ1N01G8=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: <victorm.lira@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Victor Lira <victorm.lira@amd.com>
Subject: [XEN PATCH v2 0/2] automation: test script fixes (pipefail)
Date: Thu, 29 Aug 2024 15:34:21 -0700
Message-ID: <cover.1724967614.git.victorm.lira@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
Received-SPF: None (SATLEXMB05.amd.com: victorm.lira@amd.com does not
 designate permitted sender hosts)
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: SN1PEPF000397B5:EE_|CY5PR12MB6180:EE_
X-MS-Office365-Filtering-Correlation-Id: 07293d21-fd24-451b-433f-08dcc87ac60b
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|1800799024|36860700013|376014|82310400026;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?wykpv8E7oiW6GYBaond6K63pKJzvQK53NFsRrMDY35OmOLKbZQEvINXt/Ef2?=
 =?us-ascii?Q?q32b806fyZQKyoSuB1lPr3jmqGudu9ZLYQMdTIHSRO5Z97CenIQqmArZsbgS?=
 =?us-ascii?Q?7nj2XrpuJ5HArJX1gf0xBye4UmBH2Fyz7V1oQewQeY8U9mOrcJigpmQJjNQ/?=
 =?us-ascii?Q?yJLK3npLenLH6Ce1c1bxQAb+7OvTM3aj16fQT5xWsJGbaEzQovF6uCPBpQfD?=
 =?us-ascii?Q?FpHjdp1g/ineo+r/BJMVZy/EhqJvqBmnkJauKur56EiOz0LD7XbaK3jOrLkh?=
 =?us-ascii?Q?jEic8V5aWc4qAy1/WjlRJ/fuqebtXWHpn3KN7wKbrV2eBsX5J+CrwhpqwRcV?=
 =?us-ascii?Q?wIRHHVJLqsS+GOhNKCFn54c8wQBKkVKM1EdgMJHmAUV71tNQGm0in7YDTbSL?=
 =?us-ascii?Q?tjL4kPOtjO91r7fY100f01XXxJDhKSYf3tNEFeAkKR7fhxQEkaYje8GTcsC6?=
 =?us-ascii?Q?ZMcUnR1rOOYATJ61ffNnEH6FY2akBRQ8ClRFIlW2glefJL/aTQaSuV7znndI?=
 =?us-ascii?Q?hdRMmpyIlprqQSuP8mMcjYgGp1UuSNNz/xcJdOfvXh3JwZjX/6ButENWvtK0?=
 =?us-ascii?Q?+OnNlZkqNQ3WB+JEyRQJI20sR4W41Jz66oF5Kt9psvA6zQqaIif2xQtDhOou?=
 =?us-ascii?Q?U93xP3HEqElwfqAgpcFQrAOrYNzouXbhSpQfkGQ2RVBbTr4ApmCWVN1ypiya?=
 =?us-ascii?Q?RSd7wmyk8m8GYAgC1MFsRiNQBwWC+7q2GThSym3700jY9sOmjrVfkDwG9ewo?=
 =?us-ascii?Q?MX9ZwQ4X1A3EB0IJxkWh74JaJZkTwd5675EwL7XUzbWge+PHYa85lL4U6MbI?=
 =?us-ascii?Q?6F27TXpwxC45lPo4S3L70qjeufS4/ESpaJJ866XC1HKiI7yfrRtWbpCXZGOW?=
 =?us-ascii?Q?soKX5B+n1sALlkn58D0Gq6rgV06XZwfAVQWZMkpJTu24kbzCnMG9c5CH3dWC?=
 =?us-ascii?Q?ksO9n23pkNDxCxG38/bShjuvbDTICF08LusOiWiFrWmtaZpTpbwP9nVw54Tc?=
 =?us-ascii?Q?v93b0bevkzeaIlCXfZbRJBS29FvFndi57Wb0oQlqVIC8zldomqvXTZu0kOk7?=
 =?us-ascii?Q?hO2fszCB0crTxNE8UhXzHX86yQYvtkMm2cnv76O2xAMsZCooklWr4wNCo3av?=
 =?us-ascii?Q?t0SsbZ2wt5+kAQCmA591Urx7WJ5i5t+mP/MQyvhppqJOHjaosRUZXMNi6qUZ?=
 =?us-ascii?Q?5v/D6fpTKx3QhWMjpYj73/n0KepfWI6tQRZokZ7pxV0xuA4wENWfAlUpAewH?=
 =?us-ascii?Q?mWsKT9UH7VeZ8mrDC7wVwT0Hr2pVIQTiIYHecDaEX7lr6XE7XUSo5ZAZpqR3?=
 =?us-ascii?Q?le4=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 22:34:41.1772
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 07293d21-fd24-451b-433f-08dcc87ac60b
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	SN1PEPF000397B5.namprd05.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6180

From: Victor Lira <victorm.lira@amd.com>

Separated into two patches to improve clarity and updated to use the
"pipefail" function instead of "mkfifo".

Victor Lira (2):
  automation: fix qemu test false success
  automation: use expect utility in xilinx tests

 .../build/ubuntu/xenial-xilinx.dockerfile     |  1 +
 automation/gitlab-ci/test.yaml                |  2 ++
 .../scripts/{qemu-key.exp => console.exp}     | 10 ++++-----
 automation/scripts/qemu-alpine-x86_64.sh      |  9 ++++----
 automation/scripts/qemu-smoke-dom0-arm32.sh   |  9 ++++----
 automation/scripts/qemu-smoke-dom0-arm64.sh   |  9 ++++----
 .../scripts/qemu-smoke-dom0less-arm32.sh      |  9 ++++----
 .../scripts/qemu-smoke-dom0less-arm64.sh      |  9 ++++----
 automation/scripts/qemu-smoke-ppc64le.sh      |  9 ++++----
 automation/scripts/qemu-smoke-riscv64.sh      |  9 ++++----
 automation/scripts/qemu-smoke-x86-64.sh       |  9 ++++----
 automation/scripts/qemu-xtf-dom0less-arm64.sh |  9 ++++----
 .../scripts/xilinx-smoke-dom0-x86_64.sh       | 22 +++++++++----------
 .../scripts/xilinx-smoke-dom0less-arm64.sh    | 19 ++++++++--------
 14 files changed, 64 insertions(+), 71 deletions(-)
 rename automation/scripts/{qemu-key.exp => console.exp} (78%)

--
2.25.1



From xen-devel-bounces@lists.xenproject.org Thu Aug 29 22:35:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Aug 2024 22:35:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786137.1195688 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjnjM-0003LJ-Gu; Thu, 29 Aug 2024 22:35:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786137.1195688; Thu, 29 Aug 2024 22:35:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjnjM-0003L8-E2; Thu, 29 Aug 2024 22:35:04 +0000
Received: by outflank-mailman (input) for mailman id 786137;
 Thu, 29 Aug 2024 22:35:02 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=N580=P4=amd.com=VictorM.Lira@srs-se1.protection.inumbo.net>)
 id 1sjnjK-000330-Pl
 for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 22:35:02 +0000
Received: from NAM10-DM6-obe.outbound.protection.outlook.com
 (mail-dm6nam10on2061a.outbound.protection.outlook.com
 [2a01:111:f400:7e88::61a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id ec89af0e-6656-11ef-99a0-01e77a169b0f;
 Fri, 30 Aug 2024 00:35:00 +0200 (CEST)
Received: from CH2PR03CA0012.namprd03.prod.outlook.com (2603:10b6:610:59::22)
 by CY8PR12MB7585.namprd12.prod.outlook.com (2603:10b6:930:98::7) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Thu, 29 Aug
 2024 22:34:54 +0000
Received: from DS3PEPF0000C381.namprd04.prod.outlook.com
 (2603:10b6:610:59:cafe::4c) by CH2PR03CA0012.outlook.office365.com
 (2603:10b6:610:59::22) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28 via Frontend
 Transport; Thu, 29 Aug 2024 22:34:54 +0000
Received: from SATLEXMB04.amd.com (165.204.84.17) by
 DS3PEPF0000C381.mail.protection.outlook.com (10.167.23.11) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Thu, 29 Aug 2024 22:34:54 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 29 Aug
 2024 17:34:52 -0500
Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 29 Aug
 2024 17:34:52 -0500
Received: from xsjwoods50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend
 Transport; Thu, 29 Aug 2024 17:34:52 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ec89af0e-6656-11ef-99a0-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=kCIclsFLjbTirbjJWJ5DddrjPvcqAim+fjSUpHWaIEph1aBvTwz9Lk0SeijnaDpRTQZ0ZHqZ0o2Vcnc2P9D2d2fPHWCi0sco7dB/HLj8UxwTxy9NsLAfHZZtg5YP7hgDI3txqVl73wW0BjG+EYXpzyyB/6NMNZhNUx7ixPoXdqGuKsXUr5WnhFw+dN0YHIGook70QD00FGMVbSoWWO3x5iNybKWO/4f0IP+eueVaAIdC9WIiioB0LBxmDXil49x4vOuKi3yHhQqNUO3d1kty2xZJ2NvfP6XrV8lk3twIcH8GEEvxJ86bcSHIrHCWxigOmJDhqGPStyTWc4P5z+fU+A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=bDjxXa+T088VquLWdlKJWLM1PWaU1rdeMmmnf3wCXPE=;
 b=D5b/UW8TX50rgXG4ZbjUQYD2fWb3E/Vm/9R9LRnGprbTT6GgJoXlYOuu2WbtONvS5GiiP9xXB4Wi8X/vm9RI9EWvivtR89T8Cg+4XWQEkDYifC8UY++HMkb4zn9qwj2ZJblg4UqzflF0j7vqpqtxHHJB4OP8Iflal8P2Kv4/0TPgRdLByhPhp4ccYqoebcZnMXB5cYrlFs9g0ZLrLr21glYJbFsIn6w/pQewgf0qBFFu4Ay9oDQgCjX1t7PNApgEYQiQ0KSHj0vYwRIyoCIAwXvuZCGbKdjcI8srtmM+qMQPAUw/uL9I0xmp2SABpso3QNlZSl6yE4+uxQshx1R/YQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=bDjxXa+T088VquLWdlKJWLM1PWaU1rdeMmmnf3wCXPE=;
 b=wwKbc2GP0FYCbZch/IIGkzuoMDDDDGLG/rOPfGbauIUsp8iC9LIgTIq8hJqQ5OMEeLId9dyODog76GJAdaDpM44y68AYDdQKc8vC6oC3i0MX7vbBxPyijkcn1+Go1bQhiNxKFJnUoboqAZ26tNU7su8Oe5tkcHaKkXR5qt8QTHQ=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C
From: <victorm.lira@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Victor Lira <victorm.lira@amd.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, Julien Grall
	<julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>, Michal Orzel
	<michal.orzel@amd.com>
Subject: [PATCH v2 2/2] automation: use expect utility in xilinx tests
Date: Thu, 29 Aug 2024 15:34:23 -0700
Message-ID: <5bbea0bbf22b409dd047b93e2e8cebcab61d14d5.1724967614.git.victorm.lira@amd.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <cover.1724967614.git.victorm.lira@amd.com>
References: <cover.1724967614.git.victorm.lira@amd.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: DS3PEPF0000C381:EE_|CY8PR12MB7585:EE_
X-MS-Office365-Filtering-Correlation-Id: d31913c4-1328-4e11-e12b-08dcc87acdc2
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?6gpoesJPAOSU2TdUqG7pTCKAfqwmZL5MMGb2JvNPtqGkxfVXhGhfyhKNHmWS?=
 =?us-ascii?Q?1QPMIgS36ACGuMIM4LDu38TDxF3EXQiuq3RwBVw1GNkxafJwFM/XXqNRULIs?=
 =?us-ascii?Q?VziFpfffQBZn5+8Cx5brgqA1jeCgPQJDIYrwzw5/CEACRBhEFHJ2r93QD9Cj?=
 =?us-ascii?Q?0eT2N5IsmAgAuZaQRU4lRvwDyw21GYCMcDHtDtcpiKKHOmsbuHf6YAVmq3/R?=
 =?us-ascii?Q?LvQ2HqDdPB3j9PSS3YphSvJ7DhvsiurM8qjJvsaybsjMJm2EObS7cjIsoIu8?=
 =?us-ascii?Q?ljB3mhPVMitTxu89SBWgpH775dsNCqzgaEPkYGeoKKnzT044DKMUWXMgyL2j?=
 =?us-ascii?Q?BLYqh8PfqZXetPriQ8LYZR/sO6YmzX1RNu/hosDuKJqRGIL6NsoiLIQMKU6H?=
 =?us-ascii?Q?Tfvt3RUT2hAmbP5oT+L/zv8zq8aWNZSvfUdqbjVzm+slkEj0DkPwVhp4XXAx?=
 =?us-ascii?Q?x0LLDLmioE5g3Hh3ecXBrgAb6m0vAAQkP2LgpGhg4LE2fgGFGXKCQ/TaR47c?=
 =?us-ascii?Q?9wlGN/g11MPfHuPNHkiiJnF+8s9RepIrCQlB+2FOlU7Yl3Re2VsZa5iGJLoe?=
 =?us-ascii?Q?JUrsONaZT+JMRviuSZuu7jmYCaorTT8o6rX8gYRhzAlrdyECtlUR5516+bNY?=
 =?us-ascii?Q?thfBJR717UQqM6jBbNYaQJ9s2Lqs/6pE/83aLp40wnYWuZg12gtYoN/MA1Ur?=
 =?us-ascii?Q?zF44gLsc2O9gKajsM8dSrtmlOPOp0/xyLySMCiVFMs7/pIwRhQ7/e6Xk7Cex?=
 =?us-ascii?Q?vI8R5fYCm31IJqma7E7PGepOsBjX3l/bS1+PPYv78kJKpUV8pZihe5b4rp2A?=
 =?us-ascii?Q?UQHeVQh0tqu29aAmsjD26SUtQPCgvm+dZl818tFWoqaAjhBTOyfvPMkxk4ue?=
 =?us-ascii?Q?b3eWQMpYkXg5RQoAGlNvRSCqATNbS254K7jNJAINmIdi+rvkJGexS/2KeXMB?=
 =?us-ascii?Q?fQX899aeclkY3oetD9RomORcfI2Km72LDk0bOZeE5P5qzx+KKUoGRcCU/DGp?=
 =?us-ascii?Q?IlupV8yxqxHYWDrDpSdZLebxHxcbl0yYNKHTon51JBLQrE8wxVPp2IH0ZGRM?=
 =?us-ascii?Q?BUJkVUfRPaRaqKXf4DID8QC8dwDV0d14H6EpkicGRGgXUgIQxSNssTQRXX5N?=
 =?us-ascii?Q?6ghMpCRRHRuVXvLc2ICgPmxQRiBL5Sj6ci5Sbj6Oh32jiPzRzE0hThtsaUuW?=
 =?us-ascii?Q?uLPrx6Ajuc0tNe2aICzax5UAsxOF3R+VLDPRzaJbtB4q47zTOA4XB6JLOoz/?=
 =?us-ascii?Q?tjqC6G7XkPV81nGFdTm4bOE4oZdW3fjPdhSX65YM5DQzuHHKNY9XsQEexbro?=
 =?us-ascii?Q?CWKriEy3BvasgICWyT8OirENA9Czu9EEDxosXtSNLL3oQPaG+8fCKvlUs+bT?=
 =?us-ascii?Q?uqcWGHPFIt2I5pjGgNiJUFeZ4K0+8PIL3G5p4Mr7VtAFh2Jtmg=3D=3D?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 22:34:54.0465
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: d31913c4-1328-4e11-e12b-08dcc87acdc2
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	DS3PEPF0000C381.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7585

From: Victor Lira <victorm.lira@amd.com>

Fixes: 95764a0817a5 (automation: update xilinx test scripts (tty))
This patch introduced a CI failure due to a timeout in xilinx-x86_64 test.

Change xilinx-x86_64 and xilinx-arm64 scripts to use "expect" utility
to determine test result and allow early exit from tests.
Add "expect" to xilinx container environment (dockerfile).
Rename references to "QEMU" in "qemu-key.exp" expect script to "TEST" to be
used by both QEMU and hardware tests.

Signed-off-by: Victor Lira <victorm.lira@amd.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Julien Grall <julien@xen.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Michal Orzel <michal.orzel@amd.com>
Cc: xen-devel@lists.xenproject.org
---
 .../build/ubuntu/xenial-xilinx.dockerfile     |  1 +
 automation/gitlab-ci/test.yaml                |  2 ++
 .../scripts/{qemu-key.exp => console.exp}     |  8 +++----
 automation/scripts/qemu-alpine-x86_64.sh      |  6 ++---
 automation/scripts/qemu-smoke-dom0-arm32.sh   |  6 ++---
 automation/scripts/qemu-smoke-dom0-arm64.sh   |  6 ++---
 .../scripts/qemu-smoke-dom0less-arm32.sh      |  6 ++---
 .../scripts/qemu-smoke-dom0less-arm64.sh      |  6 ++---
 automation/scripts/qemu-smoke-ppc64le.sh      |  6 ++---
 automation/scripts/qemu-smoke-riscv64.sh      |  6 ++---
 automation/scripts/qemu-smoke-x86-64.sh       |  6 ++---
 automation/scripts/qemu-xtf-dom0less-arm64.sh |  6 ++---
 .../scripts/xilinx-smoke-dom0-x86_64.sh       | 22 +++++++++----------
 .../scripts/xilinx-smoke-dom0less-arm64.sh    | 19 ++++++++--------
 14 files changed, 54 insertions(+), 52 deletions(-)
 rename automation/scripts/{qemu-key.exp => console.exp} (83%)

diff --git a/automation/build/ubuntu/xenial-xilinx.dockerfile b/automation/build/ubuntu/xenial-xilinx.dockerfile
index f03d62e8bd3f..6107d8b7711f 100644
--- a/automation/build/ubuntu/xenial-xilinx.dockerfile
+++ b/automation/build/ubuntu/xenial-xilinx.dockerfile
@@ -20,6 +20,7 @@ RUN apt-get update && \
         git \
         gzip \
         file \
+        expect \
         && \
         apt-get autoremove -y && \
         apt-get clean && \
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 3b339f387fbe..e3ebe3745994 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -84,6 +84,7 @@
   variables:
     CONTAINER: ubuntu:xenial-xilinx
     LOGFILE: qemu-smoke-xilinx.log
+    TEST_TIMEOUT: 120
   artifacts:
     paths:
       - smoke.serial
@@ -103,6 +104,7 @@
     LOGFILE: xilinx-smoke-x86_64.log
     XEN_CMD_CONSOLE: "console=com2 com2=115200,8n1,0x2F8,4"
     TEST_BOARD: "crater"
+    TEST_TIMEOUT: 500
   artifacts:
     paths:
       - smoke.serial
diff --git a/automation/scripts/qemu-key.exp b/automation/scripts/console.exp
similarity index 83%
rename from automation/scripts/qemu-key.exp
rename to automation/scripts/console.exp
index 66c416483146..f538aa6bd06c 100755
--- a/automation/scripts/qemu-key.exp
+++ b/automation/scripts/console.exp
@@ -1,16 +1,16 @@
 #!/usr/bin/expect -f

-if {[info exists env(QEMU_TIMEOUT)]} {
-    set timeout $env(QEMU_TIMEOUT)
+if {[info exists env(TEST_TIMEOUT)]} {
+    set timeout $env(TEST_TIMEOUT)
 } else {
     set timeout 1500
 }

-log_file -a $env(QEMU_LOG)
+log_file -a $env(TEST_LOG)

 match_max 10000

-eval spawn $env(QEMU_CMD)
+eval spawn $env(TEST_CMD)

 expect_after {
     -re "(.*)\r" {
diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
index 93914c41bc24..1ff689b577e3 100755
--- a/automation/scripts/qemu-alpine-x86_64.sh
+++ b/automation/scripts/qemu-alpine-x86_64.sh
@@ -76,7 +76,7 @@ EOF

 # Run the test
 rm -f smoke.serial
-export QEMU_CMD="qemu-system-x86_64 \
+export TEST_CMD="qemu-system-x86_64 \
     -cpu qemu64,+svm \
     -m 2G -smp 2 \
     -monitor none -serial stdio \
@@ -84,8 +84,8 @@ export QEMU_CMD="qemu-system-x86_64 \
     -device virtio-net-pci,netdev=n0 \
     -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0"

-export QEMU_LOG="smoke.serial"
+export TEST_LOG="smoke.serial"
 export LOG_MSG="Domain-0"
 export PASSED="BusyBox"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
index 7c282eff3a58..e1cd83880928 100755
--- a/automation/scripts/qemu-smoke-dom0-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
@@ -77,7 +77,7 @@ git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git
 bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config

 rm -f ${serial_log}
-export QEMU_CMD="./qemu-system-arm \
+export TEST_CMD="./qemu-system-arm \
    -machine virt \
    -machine virtualization=true \
    -smp 4 \
@@ -91,8 +91,8 @@ export QEMU_CMD="./qemu-system-arm \
    -bios /usr/lib/u-boot/qemu_arm/u-boot.bin"

 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="${serial_log}"
+export TEST_LOG="${serial_log}"
 export LOG_MSG="Domain-0"
 export PASSED="/ #"

-../automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+../automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
index 81f210f7f50e..4d22a124df11 100755
--- a/automation/scripts/qemu-smoke-dom0-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
@@ -93,7 +93,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf

 # Run the test
 rm -f smoke.serial
-export QEMU_CMD="./binaries/qemu-system-aarch64 \
+export TEST_CMD="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
     -m 2048 -monitor none -serial stdio \
@@ -104,8 +104,8 @@ export QEMU_CMD="./binaries/qemu-system-aarch64 \
     -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"

 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="smoke.serial"
+export TEST_LOG="smoke.serial"
 export LOG_MSG="Domain-0"
 export PASSED="BusyBox"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
index 38e8a0b0bd7d..41f6e5d8e615 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
@@ -130,7 +130,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config

 # Run the test
 rm -f ${serial_log}
-export QEMU_CMD="./qemu-system-arm \
+export TEST_CMD="./qemu-system-arm \
     -machine virt \
     -machine virtualization=true \
     -smp 4 \
@@ -144,8 +144,8 @@ export QEMU_CMD="./qemu-system-arm \
     -bios /usr/lib/u-boot/qemu_arm/u-boot.bin"

 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="${serial_log}"
+export TEST_LOG="${serial_log}"
 export LOG_MSG="${dom0_prompt}"
 export PASSED="${passed}"

-../automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+../automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
index ea67650e17da..83e1866ca6c5 100755
--- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
+++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
@@ -204,7 +204,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf

 # Run the test
 rm -f smoke.serial
-export QEMU_CMD="./binaries/qemu-system-aarch64 \
+export TEST_CMD="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt,gic-version=$gic_version \
     -m 2048 -monitor none -serial stdio \
@@ -215,8 +215,8 @@ export QEMU_CMD="./binaries/qemu-system-aarch64 \
     -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"

 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="smoke.serial"
+export TEST_LOG="smoke.serial"
 export LOG_MSG="Welcome to Alpine Linux"
 export PASSED="${passed}"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/scripts/qemu-smoke-ppc64le.sh
index 49e189c37058..617096ad1fa8 100755
--- a/automation/scripts/qemu-smoke-ppc64le.sh
+++ b/automation/scripts/qemu-smoke-ppc64le.sh
@@ -10,7 +10,7 @@ machine=$1
 # Run the test
 rm -f ${serial_log}

-export QEMU_CMD="qemu-system-ppc64 \
+export TEST_CMD="qemu-system-ppc64 \
     -bios skiboot.lid \
     -M $machine \
     -m 2g \
@@ -21,7 +21,7 @@ export QEMU_CMD="qemu-system-ppc64 \
     -serial stdio \
     -kernel binaries/xen"

-export QEMU_LOG="${serial_log}"
+export TEST_LOG="${serial_log}"
 export PASSED="Hello, ppc64le!"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
index 422ee03e0d26..8f755d0a6a99 100755
--- a/automation/scripts/qemu-smoke-riscv64.sh
+++ b/automation/scripts/qemu-smoke-riscv64.sh
@@ -5,14 +5,14 @@ set -ex -o pipefail
 # Run the test
 rm -f smoke.serial

-export QEMU_CMD="qemu-system-riscv64 \
+export TEST_CMD="qemu-system-riscv64 \
     -M virt \
     -smp 1 \
     -nographic \
     -m 2g \
     -kernel binaries/xen"

-export QEMU_LOG="smoke.serial"
+export TEST_LOG="smoke.serial"
 export PASSED="All set up"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
index 7495185d9fc6..da0c26cc2f82 100755
--- a/automation/scripts/qemu-smoke-x86-64.sh
+++ b/automation/scripts/qemu-smoke-x86-64.sh
@@ -15,12 +15,12 @@ case $variant in
 esac

 rm -f smoke.serial
-export QEMU_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
+export TEST_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
         -initrd xtf/tests/example/$k \
         -append \"loglvl=all console=com1 noreboot console_timestamps=boot $extra\" \
         -m 512 -monitor none -serial stdio"

-export QEMU_LOG="smoke.serial"
+export TEST_LOG="smoke.serial"
 export PASSED="Test result: SUCCESS"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
index acef1637e25b..9608de6ec033 100755
--- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
+++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
@@ -50,7 +50,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf

 # Run the test
 rm -f smoke.serial
-export QEMU_CMD="./binaries/qemu-system-aarch64 \
+export TEST_CMD="./binaries/qemu-system-aarch64 \
     -machine virtualization=true \
     -cpu cortex-a57 -machine type=virt \
     -m 2048 -monitor none -serial stdio \
@@ -61,7 +61,7 @@ export QEMU_CMD="./binaries/qemu-system-aarch64 \
     -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"

 export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
-export QEMU_LOG="smoke.serial"
+export TEST_LOG="smoke.serial"
 export PASSED="${passed}"

-./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
+./automation/scripts/console.exp | sed 's/\r\+$//'
diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
index 4559e2b9ee1f..ef6e1361a95c 100755
--- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
+++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
@@ -1,8 +1,8 @@
-#!/bin/sh
+#!/usr/bin/env bash

 # Run x86_64 dom0 tests on hardware.

-set -ex
+set -ex -o pipefail

 fatal() {
     echo "$(basename "$0") $*" >&2
@@ -27,7 +27,6 @@ memory = 512
 vif = [ "bridge=xenbr0", ]
 disk = [ ]
 '
-TIMEOUT_SECONDS=200

 # Select test variant.
 if [ "${TEST}" = "ping" ]; then
@@ -125,20 +124,19 @@ boot

 # Power cycle board and collect serial port output.
 SERIAL_DEV="/dev/serial/${TEST_BOARD}"
-SERIAL_CMD="cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"
 sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
 sleep 5
 sh /scratch/gitlab-runner/${TEST_BOARD}.sh 1
 sleep 5
 set +e
 stty -F ${SERIAL_DEV} 115200
-timeout -k 1 ${TIMEOUT_SECONDS} nohup sh -c "${SERIAL_CMD}"
-sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
-
-set -e

-if grep -q "${PASS_MSG}" smoke.serial; then
-    exit 0
-fi
+# Capture test result and power off board before exiting.
+export PASSED="${PASS_MSG}"
+export TEST_CMD="cat ${SERIAL_DEV}"
+export TEST_LOG="smoke.serial"

-fatal "Test failed"
+./automation/scripts/console.exp | sed 's/\r\+$//'
+TEST_RESULT=$?
+sh "/scratch/gitlab-runner/${TEST_BOARD}.sh" 2
+exit ${TEST_RESULT}
diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
index 18aa07f0a273..b24ad11b8cac 100755
--- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
+++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
@@ -1,6 +1,6 @@
 #!/bin/bash

-set -ex
+set -ex -o pipefail

 test_variant=$1

@@ -137,13 +137,14 @@ cd $START
 SERIAL_DEV="/dev/serial/zynq"
 set +e
 stty -F ${SERIAL_DEV} 115200
-timeout -k 1 120 nohup sh -c "cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"

-# stop the board
-cd /scratch/gitlab-runner
-bash zcu102.sh 2
-cd $START
+# Capture test result and power off board before exiting.
+export PASSED="${passed}"
+export LOG_MSG="Welcome to Alpine Linux"
+export TEST_CMD="cat ${SERIAL_DEV}"
+export TEST_LOG="smoke.serial"

-set -e
-(grep -q "^Welcome to Alpine Linux" smoke.serial && grep -q "${passed}" smoke.serial) || exit 1
-exit 0
+./automation/scripts/console.exp | sed 's/\r\+$//'
+TEST_RESULT=$?
+sh "/scratch/gitlab-runner/zcu102.sh" 2
+exit ${TEST_RESULT}
--
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 00:48:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 00:48:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786164.1195698 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjpoA-00022L-5k; Fri, 30 Aug 2024 00:48:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786164.1195698; Fri, 30 Aug 2024 00:48:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjpoA-00022E-2N; Fri, 30 Aug 2024 00:48:10 +0000
Received: by outflank-mailman (input) for mailman id 786164;
 Fri, 30 Aug 2024 00:48:07 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=D3iD=P5=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sjpo7-000227-Rg
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 00:48:07 +0000
Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 844d18b1-6669-11ef-99a0-01e77a169b0f;
 Fri, 30 Aug 2024 02:48:05 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by nyc.source.kernel.org (Postfix) with ESMTP id 6F023A43CD1;
 Fri, 30 Aug 2024 00:47:57 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34D02C4CEC1;
 Fri, 30 Aug 2024 00:48:03 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 844d18b1-6669-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724978884;
	bh=8FyekvWU0IwLmVVV62jL2vD5xmEyaX7IbOJyjrc88Iw=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=GykdardJTWJDXKxMJqCXi5AShoU1AsNHY+Tmqv3du2r6P7iDPRL3QPxqh9+i3lK/b
	 /KbwLMPI4QOXzP1Ciw0qmeOF3etDiB+zS0hwvQQuMAo5MQmJh3TRChp91IjfzSfu5G
	 p7FRtNHBq+AimSQ+GG3sCSy0NR15FhSI1W+pc3P0KT4d0dxM8TwYTx00P4TbrQQXTr
	 NLmAN3z/SEwolDUt6S01MDDUf7sKeNJkWD6/5wjXXGYUru5QnSQXJFOSs9GhDUhQuI
	 vvaP7fJyM3EbGV03vrHX3pH64hcqGDGuBN/eIaHbt6vR93k6kL8oXcDlxWXM9/Ot9w
	 NkBS3qKW1rv0w==
Date: Thu, 29 Aug 2024 17:48:01 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Victor Lira <victorm.lira@amd.com>
cc: xen-devel@lists.xenproject.org, Andrew Cooper <andrew.cooper3@citrix.com>, 
    Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>
Subject: Re: [PATCH v2 1/2] automation: fix false success in qemu tests
In-Reply-To: <9b60c6473aa084e4e47c64aa2347db6e3ca9ac91.1724967614.git.victorm.lira@amd.com>
Message-ID: <alpine.DEB.2.22.394.2408291747540.53815@ubuntu-linux-20-04-desktop>
References: <cover.1724967614.git.victorm.lira@amd.com> <9b60c6473aa084e4e47c64aa2347db6e3ca9ac91.1724967614.git.victorm.lira@amd.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 29 Aug 2024, victorm.lira@amd.com wrote:
> From: Victor Lira <victorm.lira@amd.com>
> 
> Fix flaw in qemu-*.sh tests that producess a false success. The following
> lines produces success despite the "expect" script producing nonzero exit
> status:
> 
>     set +e
> ...
>     ./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
>     (end of file)
> 
> The default exit status for a pipeline using "|" operator is that of the
> rightmost command. Fix this by setting the "pipefail" option in the shell,
> and removing "set +e" allowing the expect script to determine the result.
> 
> Signed-off-by: Victor Lira <victorm.lira@amd.com>


Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Julien Grall <julien@xen.org>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Michal Orzel <michal.orzel@amd.com>
> Cc: xen-devel@lists.xenproject.org
> ---
>  automation/scripts/qemu-alpine-x86_64.sh        | 3 +--
>  automation/scripts/qemu-key.exp                 | 2 +-
>  automation/scripts/qemu-smoke-dom0-arm32.sh     | 3 +--
>  automation/scripts/qemu-smoke-dom0-arm64.sh     | 3 +--
>  automation/scripts/qemu-smoke-dom0less-arm32.sh | 3 +--
>  automation/scripts/qemu-smoke-dom0less-arm64.sh | 3 +--
>  automation/scripts/qemu-smoke-ppc64le.sh        | 3 +--
>  automation/scripts/qemu-smoke-riscv64.sh        | 3 +--
>  automation/scripts/qemu-smoke-x86-64.sh         | 3 +--
>  automation/scripts/qemu-xtf-dom0less-arm64.sh   | 3 +--
>  10 files changed, 10 insertions(+), 19 deletions(-)
> 
> diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
> index 42a89e86b021..93914c41bc24 100755
> --- a/automation/scripts/qemu-alpine-x86_64.sh
> +++ b/automation/scripts/qemu-alpine-x86_64.sh
> @@ -1,6 +1,6 @@
>  #!/bin/bash
> 
> -set -ex
> +set -ex -o pipefail
> 
>  # DomU Busybox
>  cd binaries
> @@ -76,7 +76,6 @@ EOF
> 
>  # Run the test
>  rm -f smoke.serial
> -set +e
>  export QEMU_CMD="qemu-system-x86_64 \
>      -cpu qemu64,+svm \
>      -m 2G -smp 2 \
> diff --git a/automation/scripts/qemu-key.exp b/automation/scripts/qemu-key.exp
> index 787f1f08cb96..66c416483146 100755
> --- a/automation/scripts/qemu-key.exp
> +++ b/automation/scripts/qemu-key.exp
> @@ -14,7 +14,7 @@ eval spawn $env(QEMU_CMD)
> 
>  expect_after {
>      -re "(.*)\r" {
> -        exp_continue
> +        exp_continue -continue_timer
>      }
>      timeout {send_error "ERROR-Timeout!\n"; exit 1}
>      eof {send_error "ERROR-EOF!\n"; exit 1}
> diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
> index fd64b19358ae..7c282eff3a58 100755
> --- a/automation/scripts/qemu-smoke-dom0-arm32.sh
> +++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
> @@ -1,6 +1,6 @@
>  #!/bin/bash
> 
> -set -ex
> +set -ex -o pipefail
> 
>  serial_log="$(pwd)/smoke.serial"
> 
> @@ -77,7 +77,6 @@ git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git
>  bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
> 
>  rm -f ${serial_log}
> -set +e
>  export QEMU_CMD="./qemu-system-arm \
>     -machine virt \
>     -machine virtualization=true \
> diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
> index e0cea742b0a0..81f210f7f50e 100755
> --- a/automation/scripts/qemu-smoke-dom0-arm64.sh
> +++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
> @@ -1,6 +1,6 @@
>  #!/bin/bash
> 
> -set -ex
> +set -ex -o pipefail
> 
>  # DomU Busybox
>  cd binaries
> @@ -93,7 +93,6 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
> 
>  # Run the test
>  rm -f smoke.serial
> -set +e
>  export QEMU_CMD="./binaries/qemu-system-aarch64 \
>      -machine virtualization=true \
>      -cpu cortex-a57 -machine type=virt \
> diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> index e824cb7c2a3d..38e8a0b0bd7d 100755
> --- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
> +++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> @@ -1,6 +1,6 @@
>  #!/bin/bash
> 
> -set -ex
> +set -ex -o pipefail
> 
>  test_variant=$1
> 
> @@ -130,7 +130,6 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
> 
>  # Run the test
>  rm -f ${serial_log}
> -set +e
>  export QEMU_CMD="./qemu-system-arm \
>      -machine virt \
>      -machine virtualization=true \
> diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> index f42ba5d196bc..ea67650e17da 100755
> --- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
> +++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> @@ -1,6 +1,6 @@
>  #!/bin/bash
> 
> -set -ex
> +set -ex -o pipefail
> 
>  test_variant=$1
> 
> @@ -204,7 +204,6 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
> 
>  # Run the test
>  rm -f smoke.serial
> -set +e
>  export QEMU_CMD="./binaries/qemu-system-aarch64 \
>      -machine virtualization=true \
>      -cpu cortex-a57 -machine type=virt,gic-version=$gic_version \
> diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/scripts/qemu-smoke-ppc64le.sh
> index 594f92c19cc2..49e189c37058 100755
> --- a/automation/scripts/qemu-smoke-ppc64le.sh
> +++ b/automation/scripts/qemu-smoke-ppc64le.sh
> @@ -1,6 +1,6 @@
>  #!/bin/bash
> 
> -set -ex
> +set -ex -o pipefail
> 
>  serial_log="$(pwd)/smoke.serial"
> 
> @@ -9,7 +9,6 @@ machine=$1
> 
>  # Run the test
>  rm -f ${serial_log}
> -set +e
> 
>  export QEMU_CMD="qemu-system-ppc64 \
>      -bios skiboot.lid \
> diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
> index c2595f657ff3..422ee03e0d26 100755
> --- a/automation/scripts/qemu-smoke-riscv64.sh
> +++ b/automation/scripts/qemu-smoke-riscv64.sh
> @@ -1,10 +1,9 @@
>  #!/bin/bash
> 
> -set -ex
> +set -ex -o pipefail
> 
>  # Run the test
>  rm -f smoke.serial
> -set +e
> 
>  export QEMU_CMD="qemu-system-riscv64 \
>      -M virt \
> diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
> index 3440b1761db4..7495185d9fc6 100755
> --- a/automation/scripts/qemu-smoke-x86-64.sh
> +++ b/automation/scripts/qemu-smoke-x86-64.sh
> @@ -1,6 +1,6 @@
>  #!/bin/bash
> 
> -set -ex
> +set -ex -o pipefail
> 
>  # variant should be either pv or pvh
>  variant=$1
> @@ -15,7 +15,6 @@ case $variant in
>  esac
> 
>  rm -f smoke.serial
> -set +e
>  export QEMU_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
>          -initrd xtf/tests/example/$k \
>          -append \"loglvl=all console=com1 noreboot console_timestamps=boot $extra\" \
> diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> index 4042fe50602b..acef1637e25b 100755
> --- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
> +++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> @@ -1,6 +1,6 @@
>  #!/bin/bash
> 
> -set -ex
> +set -ex -o pipefail
> 
>  # Name of the XTF test
>  xtf_test=$1
> @@ -50,7 +50,6 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
> 
>  # Run the test
>  rm -f smoke.serial
> -set +e
>  export QEMU_CMD="./binaries/qemu-system-aarch64 \
>      -machine virtualization=true \
>      -cpu cortex-a57 -machine type=virt \
> --
> 2.25.1
> 


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 00:48:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 00:48:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786165.1195708 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjpoL-0002It-Cu; Fri, 30 Aug 2024 00:48:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786165.1195708; Fri, 30 Aug 2024 00:48:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjpoL-0002Im-9O; Fri, 30 Aug 2024 00:48:21 +0000
Received: by outflank-mailman (input) for mailman id 786165;
 Fri, 30 Aug 2024 00:48:20 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=D3iD=P5=kernel.org=sstabellini@srs-se1.protection.inumbo.net>)
 id 1sjpoK-000227-1L
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 00:48:20 +0000
Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8bca3b53-6669-11ef-99a0-01e77a169b0f;
 Fri, 30 Aug 2024 02:48:18 +0200 (CEST)
Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])
 by nyc.source.kernel.org (Postfix) with ESMTP id 011FFA43669;
 Fri, 30 Aug 2024 00:48:10 +0000 (UTC)
Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD4A1C4CEC1;
 Fri, 30 Aug 2024 00:48:15 +0000 (UTC)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8bca3b53-6669-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1724978896;
	bh=FhD1Iy6+epxCN6P5KzH6rco0gWQog9agnhpXvjrDO+0=;
	h=Date:From:To:cc:Subject:In-Reply-To:References:From;
	b=YnZsKixc1Q6n2LtbU+2wVJLKbEkarlzbsvX7XkyOuft44TzNhLN0QBJ0O8bkVGmQ7
	 tzDlmfbCsRsMV6bVykxJy0rg+mFDNBgbPeKslHg9OEi2U7I4Y2NwjvSHr6D4hf/mq/
	 p52f8bCH6HYrso5sGbIcImxSlTprgwT1ABogTNbGAljlmg/rl/NaZqwi9LPuH8oBay
	 ISFGsOtJtJBYv3f8n7GUn7h+0gZgt2EvI36FllPMnDX6wYW+WbDWcauVWx4IM0GH/7
	 dzXnxMaOVZMt84RRrIdD1GPovCesUqi9DxzcmTGrPpTmdU2RKlz8/s5DZeItnPv9Eh
	 d3bCm8Bsysttw==
Date: Thu, 29 Aug 2024 17:48:14 -0700 (PDT)
From: Stefano Stabellini <sstabellini@kernel.org>
X-X-Sender: sstabellini@ubuntu-linux-20-04-desktop
To: Victor Lira <victorm.lira@amd.com>
cc: xen-devel@lists.xenproject.org, Andrew Cooper <andrew.cooper3@citrix.com>, 
    Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>, 
    Stefano Stabellini <sstabellini@kernel.org>, 
    Michal Orzel <michal.orzel@amd.com>
Subject: Re: [PATCH v2 2/2] automation: use expect utility in xilinx tests
In-Reply-To: <5bbea0bbf22b409dd047b93e2e8cebcab61d14d5.1724967614.git.victorm.lira@amd.com>
Message-ID: <alpine.DEB.2.22.394.2408291748070.53815@ubuntu-linux-20-04-desktop>
References: <cover.1724967614.git.victorm.lira@amd.com> <5bbea0bbf22b409dd047b93e2e8cebcab61d14d5.1724967614.git.victorm.lira@amd.com>
User-Agent: Alpine 2.22 (DEB 394 2020-01-19)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII

On Thu, 29 Aug 2024, victorm.lira@amd.com wrote:
> From: Victor Lira <victorm.lira@amd.com>
> 
> Fixes: 95764a0817a5 (automation: update xilinx test scripts (tty))
> This patch introduced a CI failure due to a timeout in xilinx-x86_64 test.
> 
> Change xilinx-x86_64 and xilinx-arm64 scripts to use "expect" utility
> to determine test result and allow early exit from tests.
> Add "expect" to xilinx container environment (dockerfile).
> Rename references to "QEMU" in "qemu-key.exp" expect script to "TEST" to be
> used by both QEMU and hardware tests.
> 
> Signed-off-by: Victor Lira <victorm.lira@amd.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Julien Grall <julien@xen.org>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Michal Orzel <michal.orzel@amd.com>
> Cc: xen-devel@lists.xenproject.org
> ---
>  .../build/ubuntu/xenial-xilinx.dockerfile     |  1 +
>  automation/gitlab-ci/test.yaml                |  2 ++
>  .../scripts/{qemu-key.exp => console.exp}     |  8 +++----
>  automation/scripts/qemu-alpine-x86_64.sh      |  6 ++---
>  automation/scripts/qemu-smoke-dom0-arm32.sh   |  6 ++---
>  automation/scripts/qemu-smoke-dom0-arm64.sh   |  6 ++---
>  .../scripts/qemu-smoke-dom0less-arm32.sh      |  6 ++---
>  .../scripts/qemu-smoke-dom0less-arm64.sh      |  6 ++---
>  automation/scripts/qemu-smoke-ppc64le.sh      |  6 ++---
>  automation/scripts/qemu-smoke-riscv64.sh      |  6 ++---
>  automation/scripts/qemu-smoke-x86-64.sh       |  6 ++---
>  automation/scripts/qemu-xtf-dom0less-arm64.sh |  6 ++---
>  .../scripts/xilinx-smoke-dom0-x86_64.sh       | 22 +++++++++----------
>  .../scripts/xilinx-smoke-dom0less-arm64.sh    | 19 ++++++++--------
>  14 files changed, 54 insertions(+), 52 deletions(-)
>  rename automation/scripts/{qemu-key.exp => console.exp} (83%)
> 
> diff --git a/automation/build/ubuntu/xenial-xilinx.dockerfile b/automation/build/ubuntu/xenial-xilinx.dockerfile
> index f03d62e8bd3f..6107d8b7711f 100644
> --- a/automation/build/ubuntu/xenial-xilinx.dockerfile
> +++ b/automation/build/ubuntu/xenial-xilinx.dockerfile
> @@ -20,6 +20,7 @@ RUN apt-get update && \
>          git \
>          gzip \
>          file \
> +        expect \
>          && \
>          apt-get autoremove -y && \
>          apt-get clean && \
> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> index 3b339f387fbe..e3ebe3745994 100644
> --- a/automation/gitlab-ci/test.yaml
> +++ b/automation/gitlab-ci/test.yaml
> @@ -84,6 +84,7 @@
>    variables:
>      CONTAINER: ubuntu:xenial-xilinx
>      LOGFILE: qemu-smoke-xilinx.log
> +    TEST_TIMEOUT: 120
>    artifacts:
>      paths:
>        - smoke.serial
> @@ -103,6 +104,7 @@
>      LOGFILE: xilinx-smoke-x86_64.log
>      XEN_CMD_CONSOLE: "console=com2 com2=115200,8n1,0x2F8,4"
>      TEST_BOARD: "crater"
> +    TEST_TIMEOUT: 500
>    artifacts:
>      paths:
>        - smoke.serial
> diff --git a/automation/scripts/qemu-key.exp b/automation/scripts/console.exp
> similarity index 83%
> rename from automation/scripts/qemu-key.exp
> rename to automation/scripts/console.exp
> index 66c416483146..f538aa6bd06c 100755
> --- a/automation/scripts/qemu-key.exp
> +++ b/automation/scripts/console.exp
> @@ -1,16 +1,16 @@
>  #!/usr/bin/expect -f
> 
> -if {[info exists env(QEMU_TIMEOUT)]} {
> -    set timeout $env(QEMU_TIMEOUT)
> +if {[info exists env(TEST_TIMEOUT)]} {
> +    set timeout $env(TEST_TIMEOUT)
>  } else {
>      set timeout 1500
>  }
> 
> -log_file -a $env(QEMU_LOG)
> +log_file -a $env(TEST_LOG)
> 
>  match_max 10000
> 
> -eval spawn $env(QEMU_CMD)
> +eval spawn $env(TEST_CMD)
> 
>  expect_after {
>      -re "(.*)\r" {
> diff --git a/automation/scripts/qemu-alpine-x86_64.sh b/automation/scripts/qemu-alpine-x86_64.sh
> index 93914c41bc24..1ff689b577e3 100755
> --- a/automation/scripts/qemu-alpine-x86_64.sh
> +++ b/automation/scripts/qemu-alpine-x86_64.sh
> @@ -76,7 +76,7 @@ EOF
> 
>  # Run the test
>  rm -f smoke.serial
> -export QEMU_CMD="qemu-system-x86_64 \
> +export TEST_CMD="qemu-system-x86_64 \
>      -cpu qemu64,+svm \
>      -m 2G -smp 2 \
>      -monitor none -serial stdio \
> @@ -84,8 +84,8 @@ export QEMU_CMD="qemu-system-x86_64 \
>      -device virtio-net-pci,netdev=n0 \
>      -netdev user,id=n0,tftp=binaries,bootfile=/pxelinux.0"
> 
> -export QEMU_LOG="smoke.serial"
> +export TEST_LOG="smoke.serial"
>  export LOG_MSG="Domain-0"
>  export PASSED="BusyBox"
> 
> -./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +./automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-dom0-arm32.sh b/automation/scripts/qemu-smoke-dom0-arm32.sh
> index 7c282eff3a58..e1cd83880928 100755
> --- a/automation/scripts/qemu-smoke-dom0-arm32.sh
> +++ b/automation/scripts/qemu-smoke-dom0-arm32.sh
> @@ -77,7 +77,7 @@ git clone --depth 1 https://gitlab.com/xen-project/imagebuilder.git
>  bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
> 
>  rm -f ${serial_log}
> -export QEMU_CMD="./qemu-system-arm \
> +export TEST_CMD="./qemu-system-arm \
>     -machine virt \
>     -machine virtualization=true \
>     -smp 4 \
> @@ -91,8 +91,8 @@ export QEMU_CMD="./qemu-system-arm \
>     -bios /usr/lib/u-boot/qemu_arm/u-boot.bin"
> 
>  export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
> -export QEMU_LOG="${serial_log}"
> +export TEST_LOG="${serial_log}"
>  export LOG_MSG="Domain-0"
>  export PASSED="/ #"
> 
> -../automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +../automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-dom0-arm64.sh b/automation/scripts/qemu-smoke-dom0-arm64.sh
> index 81f210f7f50e..4d22a124df11 100755
> --- a/automation/scripts/qemu-smoke-dom0-arm64.sh
> +++ b/automation/scripts/qemu-smoke-dom0-arm64.sh
> @@ -93,7 +93,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
> 
>  # Run the test
>  rm -f smoke.serial
> -export QEMU_CMD="./binaries/qemu-system-aarch64 \
> +export TEST_CMD="./binaries/qemu-system-aarch64 \
>      -machine virtualization=true \
>      -cpu cortex-a57 -machine type=virt \
>      -m 2048 -monitor none -serial stdio \
> @@ -104,8 +104,8 @@ export QEMU_CMD="./binaries/qemu-system-aarch64 \
>      -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
> 
>  export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
> -export QEMU_LOG="smoke.serial"
> +export TEST_LOG="smoke.serial"
>  export LOG_MSG="Domain-0"
>  export PASSED="BusyBox"
> 
> -./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +./automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-dom0less-arm32.sh b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> index 38e8a0b0bd7d..41f6e5d8e615 100755
> --- a/automation/scripts/qemu-smoke-dom0less-arm32.sh
> +++ b/automation/scripts/qemu-smoke-dom0less-arm32.sh
> @@ -130,7 +130,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d . -c config
> 
>  # Run the test
>  rm -f ${serial_log}
> -export QEMU_CMD="./qemu-system-arm \
> +export TEST_CMD="./qemu-system-arm \
>      -machine virt \
>      -machine virtualization=true \
>      -smp 4 \
> @@ -144,8 +144,8 @@ export QEMU_CMD="./qemu-system-arm \
>      -bios /usr/lib/u-boot/qemu_arm/u-boot.bin"
> 
>  export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
> -export QEMU_LOG="${serial_log}"
> +export TEST_LOG="${serial_log}"
>  export LOG_MSG="${dom0_prompt}"
>  export PASSED="${passed}"
> 
> -../automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +../automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-dom0less-arm64.sh b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> index ea67650e17da..83e1866ca6c5 100755
> --- a/automation/scripts/qemu-smoke-dom0less-arm64.sh
> +++ b/automation/scripts/qemu-smoke-dom0less-arm64.sh
> @@ -204,7 +204,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
> 
>  # Run the test
>  rm -f smoke.serial
> -export QEMU_CMD="./binaries/qemu-system-aarch64 \
> +export TEST_CMD="./binaries/qemu-system-aarch64 \
>      -machine virtualization=true \
>      -cpu cortex-a57 -machine type=virt,gic-version=$gic_version \
>      -m 2048 -monitor none -serial stdio \
> @@ -215,8 +215,8 @@ export QEMU_CMD="./binaries/qemu-system-aarch64 \
>      -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
> 
>  export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
> -export QEMU_LOG="smoke.serial"
> +export TEST_LOG="smoke.serial"
>  export LOG_MSG="Welcome to Alpine Linux"
>  export PASSED="${passed}"
> 
> -./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +./automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-ppc64le.sh b/automation/scripts/qemu-smoke-ppc64le.sh
> index 49e189c37058..617096ad1fa8 100755
> --- a/automation/scripts/qemu-smoke-ppc64le.sh
> +++ b/automation/scripts/qemu-smoke-ppc64le.sh
> @@ -10,7 +10,7 @@ machine=$1
>  # Run the test
>  rm -f ${serial_log}
> 
> -export QEMU_CMD="qemu-system-ppc64 \
> +export TEST_CMD="qemu-system-ppc64 \
>      -bios skiboot.lid \
>      -M $machine \
>      -m 2g \
> @@ -21,7 +21,7 @@ export QEMU_CMD="qemu-system-ppc64 \
>      -serial stdio \
>      -kernel binaries/xen"
> 
> -export QEMU_LOG="${serial_log}"
> +export TEST_LOG="${serial_log}"
>  export PASSED="Hello, ppc64le!"
> 
> -./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +./automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-riscv64.sh b/automation/scripts/qemu-smoke-riscv64.sh
> index 422ee03e0d26..8f755d0a6a99 100755
> --- a/automation/scripts/qemu-smoke-riscv64.sh
> +++ b/automation/scripts/qemu-smoke-riscv64.sh
> @@ -5,14 +5,14 @@ set -ex -o pipefail
>  # Run the test
>  rm -f smoke.serial
> 
> -export QEMU_CMD="qemu-system-riscv64 \
> +export TEST_CMD="qemu-system-riscv64 \
>      -M virt \
>      -smp 1 \
>      -nographic \
>      -m 2g \
>      -kernel binaries/xen"
> 
> -export QEMU_LOG="smoke.serial"
> +export TEST_LOG="smoke.serial"
>  export PASSED="All set up"
> 
> -./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +./automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-smoke-x86-64.sh b/automation/scripts/qemu-smoke-x86-64.sh
> index 7495185d9fc6..da0c26cc2f82 100755
> --- a/automation/scripts/qemu-smoke-x86-64.sh
> +++ b/automation/scripts/qemu-smoke-x86-64.sh
> @@ -15,12 +15,12 @@ case $variant in
>  esac
> 
>  rm -f smoke.serial
> -export QEMU_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
> +export TEST_CMD="qemu-system-x86_64 -nographic -kernel binaries/xen \
>          -initrd xtf/tests/example/$k \
>          -append \"loglvl=all console=com1 noreboot console_timestamps=boot $extra\" \
>          -m 512 -monitor none -serial stdio"
> 
> -export QEMU_LOG="smoke.serial"
> +export TEST_LOG="smoke.serial"
>  export PASSED="Test result: SUCCESS"
> 
> -./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +./automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/qemu-xtf-dom0less-arm64.sh b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> index acef1637e25b..9608de6ec033 100755
> --- a/automation/scripts/qemu-xtf-dom0less-arm64.sh
> +++ b/automation/scripts/qemu-xtf-dom0less-arm64.sh
> @@ -50,7 +50,7 @@ bash imagebuilder/scripts/uboot-script-gen -t tftp -d binaries/ -c binaries/conf
> 
>  # Run the test
>  rm -f smoke.serial
> -export QEMU_CMD="./binaries/qemu-system-aarch64 \
> +export TEST_CMD="./binaries/qemu-system-aarch64 \
>      -machine virtualization=true \
>      -cpu cortex-a57 -machine type=virt \
>      -m 2048 -monitor none -serial stdio \
> @@ -61,7 +61,7 @@ export QEMU_CMD="./binaries/qemu-system-aarch64 \
>      -bios /usr/lib/u-boot/qemu_arm64/u-boot.bin"
> 
>  export UBOOT_CMD="virtio scan; dhcp; tftpb 0x40000000 boot.scr; source 0x40000000"
> -export QEMU_LOG="smoke.serial"
> +export TEST_LOG="smoke.serial"
>  export PASSED="${passed}"
> 
> -./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
> +./automation/scripts/console.exp | sed 's/\r\+$//'
> diff --git a/automation/scripts/xilinx-smoke-dom0-x86_64.sh b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
> index 4559e2b9ee1f..ef6e1361a95c 100755
> --- a/automation/scripts/xilinx-smoke-dom0-x86_64.sh
> +++ b/automation/scripts/xilinx-smoke-dom0-x86_64.sh
> @@ -1,8 +1,8 @@
> -#!/bin/sh
> +#!/usr/bin/env bash
> 
>  # Run x86_64 dom0 tests on hardware.
> 
> -set -ex
> +set -ex -o pipefail
> 
>  fatal() {
>      echo "$(basename "$0") $*" >&2
> @@ -27,7 +27,6 @@ memory = 512
>  vif = [ "bridge=xenbr0", ]
>  disk = [ ]
>  '
> -TIMEOUT_SECONDS=200
> 
>  # Select test variant.
>  if [ "${TEST}" = "ping" ]; then
> @@ -125,20 +124,19 @@ boot
> 
>  # Power cycle board and collect serial port output.
>  SERIAL_DEV="/dev/serial/${TEST_BOARD}"
> -SERIAL_CMD="cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"
>  sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
>  sleep 5
>  sh /scratch/gitlab-runner/${TEST_BOARD}.sh 1
>  sleep 5
>  set +e
>  stty -F ${SERIAL_DEV} 115200
> -timeout -k 1 ${TIMEOUT_SECONDS} nohup sh -c "${SERIAL_CMD}"
> -sh /scratch/gitlab-runner/${TEST_BOARD}.sh 2
> -
> -set -e
> 
> -if grep -q "${PASS_MSG}" smoke.serial; then
> -    exit 0
> -fi
> +# Capture test result and power off board before exiting.
> +export PASSED="${PASS_MSG}"
> +export TEST_CMD="cat ${SERIAL_DEV}"
> +export TEST_LOG="smoke.serial"
> 
> -fatal "Test failed"
> +./automation/scripts/console.exp | sed 's/\r\+$//'
> +TEST_RESULT=$?
> +sh "/scratch/gitlab-runner/${TEST_BOARD}.sh" 2
> +exit ${TEST_RESULT}
> diff --git a/automation/scripts/xilinx-smoke-dom0less-arm64.sh b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
> index 18aa07f0a273..b24ad11b8cac 100755
> --- a/automation/scripts/xilinx-smoke-dom0less-arm64.sh
> +++ b/automation/scripts/xilinx-smoke-dom0less-arm64.sh
> @@ -1,6 +1,6 @@
>  #!/bin/bash
> 
> -set -ex
> +set -ex -o pipefail
> 
>  test_variant=$1
> 
> @@ -137,13 +137,14 @@ cd $START
>  SERIAL_DEV="/dev/serial/zynq"
>  set +e
>  stty -F ${SERIAL_DEV} 115200
> -timeout -k 1 120 nohup sh -c "cat ${SERIAL_DEV} | tee smoke.serial | sed 's/\r//'"
> 
> -# stop the board
> -cd /scratch/gitlab-runner
> -bash zcu102.sh 2
> -cd $START
> +# Capture test result and power off board before exiting.
> +export PASSED="${passed}"
> +export LOG_MSG="Welcome to Alpine Linux"
> +export TEST_CMD="cat ${SERIAL_DEV}"
> +export TEST_LOG="smoke.serial"
> 
> -set -e
> -(grep -q "^Welcome to Alpine Linux" smoke.serial && grep -q "${passed}" smoke.serial) || exit 1
> -exit 0
> +./automation/scripts/console.exp | sed 's/\r\+$//'
> +TEST_RESULT=$?
> +sh "/scratch/gitlab-runner/zcu102.sh" 2
> +exit ${TEST_RESULT}
> --
> 2.25.1
> 


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 01:32:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 01:32:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786178.1195718 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjqVJ-0001l7-L0; Fri, 30 Aug 2024 01:32:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786178.1195718; Fri, 30 Aug 2024 01:32:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjqVJ-0001l0-Gp; Fri, 30 Aug 2024 01:32:45 +0000
Received: by outflank-mailman (input) for mailman id 786178;
 Fri, 30 Aug 2024 01:32:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjqVH-0001kq-Ov; Fri, 30 Aug 2024 01:32:43 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjqVH-0008Eu-J4; Fri, 30 Aug 2024 01:32:43 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjqVH-0000uG-33; Fri, 30 Aug 2024 01:32:43 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjqVH-0001xu-1c; Fri, 30 Aug 2024 01:32:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=s68sqbOTFitR3Eqi5Q01s8CX8eucP4dnkFFom5RldKQ=; b=grhEdGX/3yFTV+6Mpbah6PLv6o
	L/Kthz1sAIt96KZ2Z2iRU56uVhwKHH+o2lGNEuoJ79QsivawWIrFGlUJgRRGUg+lT0kHgAYAp1xXZ
	P3ZD+g4Tt07/0sGLmgBgiHqIUrtcodmxR71Kk+QvhnmlFsmkVxSLxDKLky3k6lRF+zt8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187401-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187401: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:heisenbug
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=d5d547aa7b51467b15d9caa86b116f8c2507c72a
X-Osstest-Versions-That:
    linux=928f79a188aacc057ba36c85b36b6d1e99c8f595
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 01:32:43 +0000

flight 187401 linux-linus real [real]
flight 187411 linux-linus real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187401/
http://logs.test-lab.xenproject.org/osstest/logs/187411/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail pass in 187411-retest

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187388
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187388
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187388
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187388
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187388
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187388
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                d5d547aa7b51467b15d9caa86b116f8c2507c72a
baseline version:
 linux                928f79a188aacc057ba36c85b36b6d1e99c8f595

Last test of basis   187388  2024-08-28 20:44:41 Z    1 days
Testing same since   187401  2024-08-29 10:00:28 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Jason A. Donenfeld <Jason@zx2c4.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Yann Droneaud <yann@droneaud.fr>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   928f79a188aac..d5d547aa7b514  d5d547aa7b51467b15d9caa86b116f8c2507c72a -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 04:23:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 04:23:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786197.1195728 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjt9k-0004kA-TK; Fri, 30 Aug 2024 04:22:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786197.1195728; Fri, 30 Aug 2024 04:22:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjt9k-0004k3-P0; Fri, 30 Aug 2024 04:22:40 +0000
Received: by outflank-mailman (input) for mailman id 786197;
 Fri, 30 Aug 2024 04:22:39 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjt9j-0004jq-Ah; Fri, 30 Aug 2024 04:22:39 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjt9j-0003f2-0K; Fri, 30 Aug 2024 04:22:39 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjt9i-0006ZL-H6; Fri, 30 Aug 2024 04:22:38 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjt9i-0003oX-GP; Fri, 30 Aug 2024 04:22:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=+t0gGbCjmKW2GXOS0NItuD7L4klGtD6DAXJTfyyIA1o=; b=f8t1BNuXu9H1kozWIonLEduKKY
	UWzv8yxGN+eYwU4k2MV2OFKG6xeh9SN/xDcX3JbhDRGCFAz7Xmo3qnsU6ibbirCAsGWvgIr8taWa8
	+T0yaA3itxJCEIFzdIyB1xMIirThIFfkvEP7ReNXw8POPGEkcTy83xo8vehtaV9tlArQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187413-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187413: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=6a7be5a8418ab6397375e32e399e9523db9d4293
X-Osstest-Versions-That:
    ovmf=b6c4708c4d3470cfd9f465771a665510d3ad1a66
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 04:22:38 +0000

flight 187413 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187413/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 6a7be5a8418ab6397375e32e399e9523db9d4293
baseline version:
 ovmf                 b6c4708c4d3470cfd9f465771a665510d3ad1a66

Last test of basis   187409  2024-08-29 20:11:30 Z    0 days
Testing same since   187413  2024-08-30 01:56:32 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Abdul Lateef Attar <AbdulLateef.Attar@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   b6c4708c4d..6a7be5a841  6a7be5a8418ab6397375e32e399e9523db9d4293 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 05:17:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 05:17:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786208.1195737 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sju0y-000601-SJ; Fri, 30 Aug 2024 05:17:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786208.1195737; Fri, 30 Aug 2024 05:17:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sju0y-0005zu-PY; Fri, 30 Aug 2024 05:17:40 +0000
Received: by outflank-mailman (input) for mailman id 786208;
 Fri, 30 Aug 2024 05:17:39 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sju0x-0005zj-K4; Fri, 30 Aug 2024 05:17:39 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sju0x-0004wD-B7; Fri, 30 Aug 2024 05:17:39 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sju0w-0001Ix-Rp; Fri, 30 Aug 2024 05:17:38 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sju0w-0006ER-RL; Fri, 30 Aug 2024 05:17:38 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=+n4nPGD1Nb5HWYxxV/WpPK4pfYAedUmyud1Iw8EuaDc=; b=VWHi79byHYYxWwsRIp4ZgcHoss
	AnfUxNtklAmQX44Hfk3wdCgR1+bTbsWIkElQaCQMUvB8PekGNfxNwHpmMT9cSyUKRwJEQA+gGIWEp
	KZ6i2GXbXLjMf23bhU9GoJDPLf2xrA3VKZdlWYKps65r5sgrKX/GuYTTjCINZH0aHQNI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187405-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187405: tolerable FAIL - PUSHED
X-Osstest-Failures:
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=99f942f3d410059dc223ee0a908827e928ef3592
X-Osstest-Versions-That:
    xen=fb1658221a31ec1db33253a80001191391e73b17
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 05:17:38 +0000

flight 187405 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187405/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187390
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187390
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187390
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187390
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187390
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187390
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  99f942f3d410059dc223ee0a908827e928ef3592
baseline version:
 xen                  fb1658221a31ec1db33253a80001191391e73b17

Last test of basis   187390  2024-08-28 23:42:20 Z    1 days
Testing same since   187405  2024-08-29 15:22:49 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Anthony PERARD <anthony.perard@citrix.com>
  Anthony PERARD <anthony.perard@vates.tech>
  Federico Serafini <federico.serafini@bugseng.com>
  Jan Beulich <jbeulich@suse.com>
  Michal Orzel <michal.orzel@amd.com>
  Sergiy Kibrik <Sergiy_Kibrik@epam.com>
  Victor Lira <victorm.lira@amd.com>
  Xenia Ragiadakou <burzalodowa@gmail.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   fb1658221a..99f942f3d4  99f942f3d410059dc223ee0a908827e928ef3592 -> master


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 07:41:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 07:41:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786234.1195792 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjwFw-0004uc-8x; Fri, 30 Aug 2024 07:41:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786234.1195792; Fri, 30 Aug 2024 07:41:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjwFw-0004uV-6N; Fri, 30 Aug 2024 07:41:16 +0000
Received: by outflank-mailman (input) for mailman id 786234;
 Fri, 30 Aug 2024 07:41:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=q2fe=P5=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjwFv-0004uP-9x
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 07:41:15 +0000
Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com
 [2a00:1450:4864:20::22c])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3b6d2aa2-66a3-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 09:41:13 +0200 (CEST)
Received: by mail-lj1-x22c.google.com with SMTP id
 38308e7fff4ca-2f3f07ac2dcso16548711fa.2
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 00:41:13 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226c7bf75sm1605470a12.54.2024.08.30.00.41.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 30 Aug 2024 00:41:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3b6d2aa2-66a3-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1725003673; x=1725608473; 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=YYH2sn2oQE6qGAyiuI1lWBLefo0YZ9BTGfkr9+Sg5JM=;
        b=RN1CKKnToH2Zfj9othyw1edzmPmtQRR3N5rOOzlWPkFmJ7vimvFzroL4u7GOgieVfl
         qXzU98pRNx+gypOhFWMFaofNpHpoTDQnTHqWI+kN3pUrVXciVcB75bUHijq5vW2gQdRr
         pFZQ67KPXdA3/1v26u8UTrK5hjcdL1qQL5jYRVM2ubHb7eBwGZ8hkK3qSk7jMXGrNO5L
         ueAQZ1KmFQCQnA/aRdwheESQ/7SH++FsXJk5b8svD0aX/l4dQFM0j3Hy1Z323XXf/+DJ
         8C9F2dLTgYqKpIMB2G2TIWeHBPUTTUOf+jEiNbPM0UBSBi90u9WlJoVj21iw26sBNS1L
         mQQg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725003673; x=1725608473;
        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=YYH2sn2oQE6qGAyiuI1lWBLefo0YZ9BTGfkr9+Sg5JM=;
        b=NfruHLjdChmYWw8UXtPJe5aE4vxI7yoxNvjHCcxhfPD2kDg48AnCVBpadeqD9q/8rW
         4wVxbBYg0J23a/164g83djZY3EYGng1Hr/m/2HzP7y2q52CYKa55G2wqzwUR0jMGih6G
         rTEkzzVQ7VFRBmzd6HNTOnMncp7yRxUftlq6fAbh4qO7qMCYUF3JJ5XDgFRgbr67baYx
         Mk4Sd7enKwK6QAvR7nifdpdwerB2s3NYl5RhVZfw+q5hABxdlvxEAErDQBaDTS9RP0hg
         kmwug+1NMpoOB0J8FTk4edY6ExmOy43MwqMVe/O385b8KOkfbZ05Dk8f7wDpyhJ/HXWy
         2fhw==
X-Forwarded-Encrypted: i=1; AJvYcCX5KOK6/mM8iRadfzGO7XL40k+UBcvhll4sN96owUyyuU+bJP66uhU6kw1xJK5ATitXuvWtz1z9osw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxLuL2iKrg7HbS8UYil/nxPo4GUYNzeGiOwOc697toHgCui4LhP
	gLVn2Yi+Jyo9LOTvhimFADJFan1jBGc0T2dImkbH9CU51f0pVXeMwIBJ2uunVA==
X-Google-Smtp-Source: AGHT+IEixPUtc8uieyCMor6sv8U7YbGEwTATR2wGFKl1GiPhNCiUCJqTfwueXGJTy+kEEf0OO9Ii8Q==
X-Received: by 2002:a2e:b889:0:b0:2f5:966:c220 with SMTP id 38308e7fff4ca-2f6103a5272mr36795041fa.20.1725003672646;
        Fri, 30 Aug 2024 00:41:12 -0700 (PDT)
Message-ID: <92a35397-9fd0-40de-b0b5-228a7962a661@suse.com>
Date: Fri, 30 Aug 2024 09:41:11 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v2 3/5] x86/spec-ctrl: configurable
 Intlel/AMD-specific calculations
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Sergiy Kibrik <Sergiy_Kibrik@epam.com>, xen-devel@lists.xenproject.org
References: <cover.1723806405.git.Sergiy_Kibrik@epam.com>
 <b789679a7edd41c88eca41d3c703d2292cfcce0e.1723806405.git.Sergiy_Kibrik@epam.com>
 <1f3772da-94cc-465e-bcc2-2d857ebe8552@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <1f3772da-94cc-465e-bcc2-2d857ebe8552@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 29.08.2024 21:25, Andrew Cooper wrote:
> On 16/08/2024 12:14 pm, Sergiy Kibrik wrote:
>> Put platforms-specific code under #ifdef CONFIG_{AMD,INTEL} so that when
>> corresponding CPU support is disabled by configuration less dead code will end
>> up in the build.
>>
>> This includes re-ordering of calls to ibpb_calculations() & div_calculations(),
>> but since they don't access common variables or feature bits it should be
>> safe to do.
>>
>> Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
>> CC: Jan Beulich <jbeulich@suse.com>
> 
> Sorry, but no.
> 
> This logic is security critical, highly fragile, gets chopped/changed
> multiple times a year (as researchers keep on finding new things), and
> all major work is done to it under embargo.
> 
> Just look at the history of the file.
> 
> The ifdefary around the tsx_init() call is bad enough and I intend to
> revert it and do that differently.  I would have objected if I'd got to
> the patch in time.
> 
> 
> The only relevant cost in this file is whether I (and the other security
> team members) can edit it correctly or not in staging and all prior
> in-support branches.  You really don't want to know how many times
> there's been a bug in backports...
> 
> Saving 451 lines from certification is not cheaper than the
> problems/risks you're introducing with this change.

Did you see my earlier reply? I don't think the issue is with hiding source
lines. We want to have the compiler DCE stuff wherever possible, hence why
I did respond asking to switch to IS_ENABLED(). That imo fits pretty well
with the vendor checks we have there already anyway.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 07:55:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 07:55:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786239.1195802 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjwTU-00077T-An; Fri, 30 Aug 2024 07:55:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786239.1195802; Fri, 30 Aug 2024 07:55:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjwTU-00077M-8I; Fri, 30 Aug 2024 07:55:16 +0000
Received: by outflank-mailman (input) for mailman id 786239;
 Fri, 30 Aug 2024 07:55:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=q2fe=P5=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjwTT-00077E-9l
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 07:55:15 +0000
Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com
 [2a00:1450:4864:20::62d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 309819ec-66a5-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 09:55:14 +0200 (CEST)
Received: by mail-ej1-x62d.google.com with SMTP id
 a640c23a62f3a-a86984e035aso188245866b.2
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 00:55:14 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8988ff289fsm183468066b.2.2024.08.30.00.55.13
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 30 Aug 2024 00:55:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 309819ec-66a5-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1725004514; x=1725609314; 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=yNVFw5K8lcM51c2sbYjyx0iCLVUBopbyPoaHs0Rv5p0=;
        b=bv5vA0Gd9rP20qVmDFnTYZZMYSp9iYxnywB+rmPNs7fp3FiINTddNtG9bXchXfqtdJ
         BJZ0hR9quIyHRq6X7UUK6ZW0YZBJvhkwH7fo7VhN+4heAY18HhV6K29o8E0SV3KtmxWL
         HyxynGyHuukiut8OG0hpbx5VDagDJog9fwfJWM9MBFAfGvGaEWIZv5QBvJ4IFHTIScAf
         C70is4Huqd/OOPQFSE36cElFBErElCVFKxyv4Vsqa36pJCAmVGCjfdcFh3XS1DTtd+Zm
         F4UseF/rX2nxEtFBWyU+0hUB5YnILjHCAtan7lVsnQzr8GcihIibxqNRV1WsjGrbhslZ
         jfYg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725004514; x=1725609314;
        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=yNVFw5K8lcM51c2sbYjyx0iCLVUBopbyPoaHs0Rv5p0=;
        b=p4seVJ+XWTe8HDc3Ey3bLfvD3pqL7trP4ofSMM0CBsrzl05tAI09LGCUyXHvqtzif5
         gzxC14ZWO808mF0Ng9uPXI5vS3lQFiaqJ4rIVDzFtNnRJZGvjG+Qrz5n+L31o4sbhbao
         TSXmQnqe2Px36ThenwoBdOR1eHVC1/ESidWtin+Ac+g02DLxh/4qKJE8+9OzX/8rLdiv
         5HljfSTF+rB87bGCThN0zDrQzVA2EOfWeRwgS/ws6EV/r/+okjyUYpclkdUVjr/QBkV3
         KdFrKcEWvsBtBj1j9SdgQTj+CG+uyvtTayp6dMsNrSG7v/n928z01eEaY/+hp4epmq8h
         EX9A==
X-Forwarded-Encrypted: i=1; AJvYcCWWKOdEpEH1VZyMwkjmeWpWMeJcimk+7l2KJ9SFDcwUpXAlzEZZX9Cm9rszJkDZ4qQ3UnRL95KeVBw=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yw9tpM+r9GmB7/x+Mqss6WfwTvshkSrZkC7BCuhBwSuX1QD57n1
	iOvDdd2tM3Yym4tV6d3nvIax2W0XJB3RG08k7tppBSl/ikVx65NeARFmT4ewxA==
X-Google-Smtp-Source: AGHT+IEjDffswZMV26EbR81Yk62sj8PYFDCQqgN5aghek9JeEP2JP3KtpSdoDYP9SCamNj/OJeFkGw==
X-Received: by 2002:a17:907:d14:b0:a86:6ba1:44da with SMTP id a640c23a62f3a-a89a36728fcmr85364166b.32.1725004513704;
        Fri, 30 Aug 2024 00:55:13 -0700 (PDT)
Message-ID: <77e852b6-1336-4289-87f2-9cefe2e6fd04@suse.com>
Date: Fri, 30 Aug 2024 09:55:12 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/pv: Make cr4_pv32_mask be PV32-only
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240829183817.2807665-1-andrew.cooper3@citrix.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240829183817.2807665-1-andrew.cooper3@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 29.08.2024 20:38, Andrew Cooper wrote:
> The user of cr4_pv32_mask (the cr4_pv32_restore() function) only exists in a
> CONFIG_PV32 build, but right now the variable is unconditionally set up.
> 
> To start with, move the setup into set_in_cr4() and remove it from it's
> somewhat ad-hoc position in __start_xen().  This means the variable will be
> set up in two steps for a CONFIG_PV32=y build, but it's cleaner and more
> robust logic overall.
> 
> With that, there's no good reason for the variable to stay in setup.c.  Move
> it to x86/pv/traps.c (for want of any better place to live), and move the
> declaration to beside set_in_cr4() and mmu_cr4_features which is a better
> position than setup.h.
> 
> Guard the reference with CONFIG_PV32, and fix up a recent typo in an adjacent
> comment while at it.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
with a suggestion:

> --- a/xen/arch/x86/pv/traps.c
> +++ b/xen/arch/x86/pv/traps.c
> @@ -18,6 +18,10 @@
>  #include <asm/traps.h>
>  #include <irq_vectors.h>
>  
> +#ifdef CONFIG_PV32
> +unsigned long __ro_after_init cr4_pv32_mask;
> +#endif

To save on the number of such #ifdef-s, how about moving this into an existing
one. pv/mm.c has one, albeit near the bottom of the file (which I'd be fine
with, but I could imagine you or others not liking such placement), and
pv/domain.c has one near the top which seems pretty well suited.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 08:06:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 08:06:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786249.1195812 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjweC-0001uj-HY; Fri, 30 Aug 2024 08:06:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786249.1195812; Fri, 30 Aug 2024 08:06:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjweC-0001uc-Dy; Fri, 30 Aug 2024 08:06:20 +0000
Received: by outflank-mailman (input) for mailman id 786249;
 Fri, 30 Aug 2024 08:06:18 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjweA-0001uS-No; Fri, 30 Aug 2024 08:06:18 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjweA-0008UY-EP; Fri, 30 Aug 2024 08:06:18 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjwe9-0001NW-TI; Fri, 30 Aug 2024 08:06:18 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjwe9-0006fj-Sp; Fri, 30 Aug 2024 08:06:17 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=K+2z0ZHkNU7rHcaArqlhrGsB/rgKzw44sIrDPmI7qlI=; b=zHfOmeIM/50cBvz9RSoiWo2Wfp
	3YgtpqRsA65HaGbL5OkwZhieaLSAdzsxooFTGNe+u1W70lFx07riyHJ0SSPyEBOpFsRC6VuSMpktV
	CIVv+kb+KY6/K0IGcaNkxM/eKmIPhSA01k8qkjHsEoV7eqWz5FIPLnmgLzXeOew4s3ns=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187416-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187416: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=391666da2c1dc5671bbb3393079d86f46e3435af
X-Osstest-Versions-That:
    ovmf=6a7be5a8418ab6397375e32e399e9523db9d4293
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 08:06:17 +0000

flight 187416 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187416/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 391666da2c1dc5671bbb3393079d86f46e3435af
baseline version:
 ovmf                 6a7be5a8418ab6397375e32e399e9523db9d4293

Last test of basis   187413  2024-08-30 01:56:32 Z    0 days
Testing same since   187416  2024-08-30 05:41:39 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Gerd Hoffmann <kraxel@redhat.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   6a7be5a841..391666da2c  391666da2c1dc5671bbb3393079d86f46e3435af -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 08:13:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 08:13:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786261.1195821 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjwkn-0003js-6g; Fri, 30 Aug 2024 08:13:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786261.1195821; Fri, 30 Aug 2024 08:13:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjwkn-0003jl-3F; Fri, 30 Aug 2024 08:13:09 +0000
Received: by outflank-mailman (input) for mailman id 786261;
 Fri, 30 Aug 2024 08:13:07 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=B9l7=P5=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1sjwkl-0003jf-CZ
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 08:13:07 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id aee40d92-66a7-11ef-99a0-01e77a169b0f;
 Fri, 30 Aug 2024 10:13:05 +0200 (CEST)
Received: from [192.168.1.113] (93-36-216-241.ip62.fastwebnet.it
 [93.36.216.241])
 by support.bugseng.com (Postfix) with ESMTPSA id 3563D4EE0793;
 Fri, 30 Aug 2024 10:13:04 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aee40d92-66a7-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail;
	t=1725005584; bh=ig0enLZKbwdcEtBIw4fDv7W8R6Dwv3rph1z68bp6GMU=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=JtHaX+rlkAhR3oHCh3TEZ+xdDDjkbDxOObWSFs6p5TA1LHyo+3alNfQlvGDwtBgI/
	 7nElvGh1tRlCylT5TvBMrsZSZeC2m4+un2UTEtNc3VDPG7bcHz8n6zx40XejdtKbF+
	 d7zKrcV/tUylN4nJurpkRf2w8UOqHVRmaFRk88wHpKxjNYsM1/deHpbL/QSg8k0sa2
	 lNKOjBgMPQoeTEf0tjY7W5ZfSyrK5il1wMNA27Os+d5opYhzmSpORJv2FsL9GwlgOy
	 0vtt1lVKo4PeWgfDharOtwI3bbgNHp1Ea1yy38gQj4yG7Eb35Im/Uc2HWiGeiwKYLv
	 HsKdteSkptoCg==
Message-ID: <45a72e19-dceb-46a1-9771-066e64f69f38@bugseng.com>
Date: Fri, 30 Aug 2024 10:13:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH] xen/bitmap: remove comment-based deviations
To: Jan Beulich <jbeulich@suse.com>
Cc: consulting@bugseng.com, Simone Ballarin <simone.ballarin@bugseng.com>,
 Doug Goldstein <cardoe@cardoe.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 xen-devel@lists.xenproject.org
References: <4aa692a50a5d08d24560f02fdc36911965fc860b.1724850701.git.federico.serafini@bugseng.com>
 <1eae8fa0-2d4c-4cf6-8120-fd7fefa523ed@suse.com>
Content-Language: en-US, it
From: Federico Serafini <federico.serafini@bugseng.com>
Organization: BUGSENG
In-Reply-To: <1eae8fa0-2d4c-4cf6-8120-fd7fefa523ed@suse.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 28/08/24 16:50, Jan Beulich wrote:
> On 28.08.2024 15:12, Federico Serafini wrote:
>> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
>> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
>> @@ -565,6 +565,10 @@ of this macro do not lead to developer confusion, and can thus be deviated."
>>   -config=MC3R1.R20.7,reports+={safe, "any_area(any_loc(any_exp(macro(^count_args_$))))"}
>>   -doc_end
>>   
>> +-doc_begin="The expansion of an argument surrounded by tokens '{', '}' and ';' is safe."
>> +-config=MC3R1.R20.7,expansion_context+={safe, "left_right(^[\\{;]$,^[;\\}]$)"}
>> +-doc_end
> 
> Not the least because this is quite a bit wider than ...
> 
>> --- a/xen/include/xen/bitmap.h
>> +++ b/xen/include/xen/bitmap.h
>> @@ -103,13 +103,10 @@ extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order);
>>   #define bitmap_switch(nbits, zero, small, large)			  \
>>   	unsigned int n__ = (nbits);					  \
>>   	if (__builtin_constant_p(nbits) && !n__) {			  \
>> -		/* SAF-7-safe Rule 20.7 non-parenthesized macro argument */ \
>>   		zero;							  \
>>   	} else if (__builtin_constant_p(nbits) && n__ <= BITS_PER_LONG) { \
>> -		/* SAF-7-safe Rule 20.7 non-parenthesized macro argument */ \
>>   		small;							  \
>>   	} else {							  \
>> -		/* SAF-7-safe Rule 20.7 non-parenthesized macro argument */ \
>>   		large;							  \
>>   	}
> 
> ... what's needed here, I wonder if we're not opening up avenues to
> problems by generally permitting that pattern. Plus in the description
> I'm missing a statement to the effect of why this is (always) safe.

The rational of the rule is that if a macro argument expands to an
expression, there may be problems related to operator precedence, e.g.:

#define A(x, y) x * y

A(1+1, 2+2) will expand to: 1+1 * 2+2

Yes, the deviation is more general and wider than what is needed for
the specific case but it is safe: if the expanded argument is between
one of the aforementioned tokens, then there are no operators involved
and no precedence issues.

I can add some details in a v2.

-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 08:22:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 08:22:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786269.1195833 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjwtg-0005xn-1q; Fri, 30 Aug 2024 08:22:20 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786269.1195833; Fri, 30 Aug 2024 08:22:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjwtf-0005xg-To; Fri, 30 Aug 2024 08:22:19 +0000
Received: by outflank-mailman (input) for mailman id 786269;
 Fri, 30 Aug 2024 08:22:19 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=B9l7=P5=bugseng.com=federico.serafini@srs-se1.protection.inumbo.net>)
 id 1sjwtf-0005xa-9d
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 08:22:19 +0000
Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f89edaaa-66a8-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 10:22:18 +0200 (CEST)
Received: from [192.168.1.113] (93-36-216-241.ip62.fastwebnet.it
 [93.36.216.241])
 by support.bugseng.com (Postfix) with ESMTPSA id 8319F4EE0793;
 Fri, 30 Aug 2024 10:22:17 +0200 (CEST)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f89edaaa-66a8-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail;
	t=1725006137; bh=LV1XKfX2gBtEoHP2z/+y6FzvetF+AY30cg8xQrYI/2o=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
	b=XaCGi10eW3QPWCKAMNHIJ5L51r1+RJ3MTbVtuHe30zo5ZNMRbvdsyIjym2jG9Ht4O
	 744yXQD/HzzRq3aXoRYiqCG5cpUctdQSov7sQMhXZBQGI4MBgxwldjfM2FJdKXuHza
	 TLtmIaNbiTmiMidiaeOobpvzRFBpplfimxmKBTZ9D5YWBI7uIOBFa+kfVBnw8VJNM5
	 +gG8nP2hliZYwZ66dsyPxpX5sL4tl9RcSO80ACoCowqSMSPro5sVdar2Scjv4IRiOC
	 QsiL2a16Avj6W+VlN1MQUYehAqZkcnvlPsbKqrH3fsnfPV/CIIXGy7WHMEyqNnWAPL
	 lzx0yzCO0CEzg==
Message-ID: <1194cb27-b188-4f20-8906-b6b7e6b9f87f@bugseng.com>
Date: Fri, 30 Aug 2024 10:22:17 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH] xen/bitmap: remove comment-based deviations
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org, consulting@bugseng.com,
 Simone Ballarin <simone.ballarin@bugseng.com>,
 Doug Goldstein <cardoe@cardoe.com>, Andrew Cooper
 <andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>,
 Julien Grall <julien@xen.org>
References: <4aa692a50a5d08d24560f02fdc36911965fc860b.1724850701.git.federico.serafini@bugseng.com>
 <alpine.DEB.2.22.394.2408281741550.53815@ubuntu-linux-20-04-desktop>
Content-Language: en-US, it
From: Federico Serafini <federico.serafini@bugseng.com>
Organization: BUGSENG
In-Reply-To: <alpine.DEB.2.22.394.2408281741550.53815@ubuntu-linux-20-04-desktop>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

On 29/08/24 02:42, Stefano Stabellini wrote:
> On Wed, 28 Aug 2024, Federico Serafini wrote:
>> Update ECLAIR configuration of MISRA C:2012 Rule 20.7 ("Expressions
>> resulting from the expansion of macro parameters shall be enclosed in
>> parentheses") to tag as 'safe' the expansions of arguments surrounded
>> by the following tokens: '{', '}' and ';'.
>>
>> Remove redundant comment-based deviations.
>>
>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> 
> I am missing some context: is this done to cover other cases similar to
> the one below (bitmap_allocate_region) or is this done only to get rid
> of the three SAF-7-safe in-code comments?

This is done to cover also other cases that may occur in the future.
More details here:
https://lists.xenproject.org/archives/html/xen-devel/2024-08/msg01392.html

-- 
Federico Serafini, M.Sc.

Software Engineer, BUGSENG (http://bugseng.com)


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 09:09:11 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 09:09:11 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786278.1195841 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjxck-0005aZ-E1; Fri, 30 Aug 2024 09:08:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786278.1195841; Fri, 30 Aug 2024 09:08:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjxck-0005aS-BN; Fri, 30 Aug 2024 09:08:54 +0000
Received: by outflank-mailman (input) for mailman id 786278;
 Fri, 30 Aug 2024 09:08: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=Y0tE=P5=amd.com=ayan.kumar.halder@srs-se1.protection.inumbo.net>)
 id 1sjxcj-0005aM-03
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 09:08:53 +0000
Received: from NAM11-BN8-obe.outbound.protection.outlook.com
 (mail-bn8nam11on2061d.outbound.protection.outlook.com
 [2a01:111:f403:2414::61d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 790e1387-66af-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 11:08:51 +0200 (CEST)
Received: from DM6PR02CA0119.namprd02.prod.outlook.com (2603:10b6:5:1b4::21)
 by SJ1PR12MB6147.namprd12.prod.outlook.com (2603:10b6:a03:45a::22) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.20; Fri, 30 Aug
 2024 09:08:45 +0000
Received: from CH2PEPF0000014A.namprd02.prod.outlook.com
 (2603:10b6:5:1b4:cafe::33) by DM6PR02CA0119.outlook.office365.com
 (2603:10b6:5:1b4::21) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20 via Frontend
 Transport; Fri, 30 Aug 2024 09:08:45 +0000
Received: from SATLEXMB03.amd.com (165.204.84.17) by
 CH2PEPF0000014A.mail.protection.outlook.com (10.167.244.107) with Microsoft
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.20.7918.13 via Frontend Transport; Fri, 30 Aug 2024 09:08:44 +0000
Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB03.amd.com
 (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 30 Aug
 2024 04:08:43 -0500
Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com
 (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Fri, 30 Aug
 2024 04:08:43 -0500
Received: from xcbayankuma40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com
 (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.39 via
 Frontend Transport; Fri, 30 Aug 2024 04:08:41 -0500
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 790e1387-66af-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
 b=BjTfB40WqiPNzcQfil4ynmTId0bUPvXnA6dn2roRSyZzqLAe/NM8ZCoEmonSQolbjwhZiNUIM/S0tGFvt+NNL0LqsaTP1iycTwOUhqbRU0Xx0/h1wQq9zWzKcqsw30QY00h6uL12XHlNX5X7xrSqHcuiTGAu78p/hXURyAGd7z+4CCVjxx0If2wHSJlIBooewWmFhnXp+e51i7OMlsLXWXEdh0Ldy6ewgGDwjSwIBBMkFBe05JDK8i9/9SNrM8efqCkzL3NOXsYW9rm1N56HCjp+To4Y5KBdXc8x5jxrOjevyHieLSsESGB/GKFFeIT41uWO82h4/OAd9qwHGE/HMg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
 s=arcselector10001;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
 bh=702JNP648h5o3yeR3PwqBQVSDHl6mLWjy/wWCPQQlwI=;
 b=XbMUqM4wdy7XN6hXswR9H+clxyrd8PvMz/1kwRdh/DLIAdmjjBW15RpgvECtecft5Am5D0JNB2pNJYWwob8VsrvbQbnunZn+tIgTJWB4I6SNMY6UOe0Ky8RCItRKjZsJa6v4YGB3cC3BsG+F7MXk3pjKAPBQYmumMWfEwg5/2JwhWOIoRRlWOSM9fvcJWNIuvw6NsXFTdPvyL9JSucqJE3MO66zV6nMJUhh09nzPAhCxuMz1P3I8nPwGJtKNwvLJECtbDSC+cxB0m7R5S7giGEZY4mT/rqiOySQXCyLTco9Oxf5tvCRoV0Fw3ZBD23rC7By9+4j2sQoJad7KG5mfUw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is
 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com;
 dmarc=pass (p=quarantine sp=quarantine pct=100) action=none
 header.from=amd.com; dkim=none (message not signed); arc=none (0)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
 bh=702JNP648h5o3yeR3PwqBQVSDHl6mLWjy/wWCPQQlwI=;
 b=3/6zyJsIfGRRIJSCuAUADZ6dOqrQJrafOtP4vCE+RfFLtTtBAhvSzZ9e+1q0TLy2TDzJWYWjllp+Ur7seBDLM0hHD28Z67xMm1MuI5yrZZCd6IHCGZiYPDaHLi6AZ8E9aIRlE4lT8K5UtlXFUzYgfksLdxNfk6D204/+QB+mvIY=
X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17)
 smtp.mailfrom=amd.com; dkim=none (message not signed)
 header.d=none;dmarc=pass action=none header.from=amd.com;
Received-SPF: Pass (protection.outlook.com: domain of amd.com designates
 165.204.84.17 as permitted sender) receiver=protection.outlook.com;
 client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C
From: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
To: <xen-devel@lists.xenproject.org>
CC: Penny Zheng <penny.zheng@arm.com>, Stefano Stabellini
	<sstabellini@kernel.org>, Julien Grall <julien@xen.org>, Bertrand Marquis
	<bertrand.marquis@arm.com>, Michal Orzel <michal.orzel@amd.com>, "Volodymyr
 Babchuk" <Volodymyr_Babchuk@epam.com>, Andrew Cooper
	<andrew.cooper3@citrix.com>, Jan Beulich <jbeulich@suse.com>, Shawn Anastasio
	<sanastasio@raptorengineering.com>, Alistair Francis
	<alistair.francis@wdc.com>, Bob Eshleman <bobbyeshleman@gmail.com>, "Connor
 Davis" <connojdavis@gmail.com>, =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?=
	<roger.pau@citrix.com>, Wei Chen <wei.chen@arm.com>, Ayan Kumar Halder
	<ayan.kumar.halder@amd.com>, Julien Grall <jgrall@amazon.com>
Subject: [PATCH v5] xen: make VMAP support in MMU system only
Date: Fri, 30 Aug 2024 10:08:21 +0100
Message-ID: <20240830090821.23105-1-ayan.kumar.halder@amd.com>
X-Mailer: git-send-email 2.25.1
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-EOPAttributedMessage: 0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: CH2PEPF0000014A:EE_|SJ1PR12MB6147:EE_
X-MS-Office365-Filtering-Correlation-Id: 6462e23b-05ea-41a2-200a-08dcc8d359e4
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
	BCL:0;ARA:13230040|36860700013|7416014|376014|82310400026|1800799024;
X-Microsoft-Antispam-Message-Info:
	=?us-ascii?Q?R/qmzWMs9ZoFZx1J7/8TLBdCqU6EiJuqfQBWcxVvGFNuwtPGTvYc4sKE1F5W?=
 =?us-ascii?Q?l5nxBJcPA2X8lEbrKedu2gqcgfDSieGNUjJJYsEPNnKx2rzuYlziuBJs7kk8?=
 =?us-ascii?Q?3cPrsUVbLz0E3+4hE+KqDXCZwhM8NZcJye+B4ve2w9cG6fxLwUxw4V2yTfYV?=
 =?us-ascii?Q?B0N1tjkBdwk8blV8LnTKA35ndkuy9DIjtPpvfOWT3ew/Ej3R6YCG2kNues1R?=
 =?us-ascii?Q?xPTnJXOepqgbWdHrGp1jc4Ku5ggNAfiz4j0eU8mqNM8ViOP1j2afL8AH1/nQ?=
 =?us-ascii?Q?nsTKUrBexKyKkQ4H6B0pQzK0lDqP269KIwKSjVqfmZCF+jD1z1gCOguPrDPn?=
 =?us-ascii?Q?2qiSmGhd8DfC4nyD2GX7bv//Ym8zkvFloRU867hsGoVyFtvmqHLe4/A+/0qZ?=
 =?us-ascii?Q?qWpkyF+DR3AtKf16hFkDMh3fOazUZCMt+Tdb8QrjmNMFpWGwChTeb75o/Uwt?=
 =?us-ascii?Q?vf6i8uPeU3PuYJXTuAWDde+VYsZSPzE0aFVTEp+UtarIg9w6Js3oFKqPGDbJ?=
 =?us-ascii?Q?bSnYbIXVYySG5NHGuyIHViBqnbZB5q0Hvf6csKbNoPK/kKElJrAonGEFSE6r?=
 =?us-ascii?Q?ovnw7ccEPBzR+smksm7ZzbrY5NImWlsEre66ifBSFB/NFD2DraBFp9DegER3?=
 =?us-ascii?Q?/RjnrQQIwc46CypEeOFJPQnMLraWlo6NnI9zRRPQ2LNCEcIB3mEIJmg4jyTd?=
 =?us-ascii?Q?VVNlJfXKXa1diyD/4WXFC5h+5+kWfCLAcvQh8b6QSj7SbXU13rEvUEGv0vxy?=
 =?us-ascii?Q?k2MKmnb90TCQLnCqjm13zhkyK7SZKuzDfPZzsrw9vZzHX46Y1Pin45FeVwAP?=
 =?us-ascii?Q?bPTazLvHLN4BK20yN9uinDbPnvKbE49O9GmfhR4dX9ASu9LZcBws0MIBJH2C?=
 =?us-ascii?Q?tDf+InPwhbmIK3BVXOfYPTRh0u7ypTQfcITbOsmqDkh8rsTdEL+z7ohVrh63?=
 =?us-ascii?Q?/N/lZXk9HsCvusr2PKF1VgXjPWhQNINrDpHOYEwoc9Hd7p/0GiF7wFEoF2gu?=
 =?us-ascii?Q?NGno86gUN+zF2g3FO5FvYNVqZ8nWBVNcC8um8SPyXOHXygM5a78CX/Q/dERQ?=
 =?us-ascii?Q?e3+512NUJLwOSc+5GSXMJDJPoUscsuXMJTBMghp0HhEIqg3h3fZkBOg5CFQo?=
 =?us-ascii?Q?2WZJXVuLoMaELVTetf6DQMJARsONYPJXNhuE1LoPnLmofO5qY2XecmwDQ/ln?=
 =?us-ascii?Q?6mM6hKqOXUEH3Xiphv/rXsHfPXAM9nyqJA2tHNZ1yGXp69zzxmQ+03/3LBt4?=
 =?us-ascii?Q?iR4Ry6yXpVey/Tw5GIQwFu7efdJP44P99fDUCGL1ON7H9yPDcYnPFMHuZ3tk?=
 =?us-ascii?Q?iGJtR+FkuF93nY0K4JXlms7EZ0NCxDMfdh+TMyKqnUfUJtrb4Jc6TuzjYl5B?=
 =?us-ascii?Q?Xa48PI8SvWXzSFl7usjSRCkLtxTQggytg1z5dR8S79D9bUVnaStqHyW3HRMz?=
 =?us-ascii?Q?fEnRvh/U92oElkPB17DPq8CA/ueSu7vW?=
X-Forefront-Antispam-Report:
	CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(7416014)(376014)(82310400026)(1800799024);DIR:OUT;SFP:1101;
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 09:08:44.9201
 (UTC)
X-MS-Exchange-CrossTenant-Network-Message-Id: 6462e23b-05ea-41a2-200a-08dcc8d359e4
X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com]
X-MS-Exchange-CrossTenant-AuthSource:
	CH2PEPF0000014A.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Anonymous
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6147

From: Penny Zheng <penny.zheng@arm.com>

Introduce CONFIG_HAS_VMAP which is selected by the architectures that
use MMU. vm_init() does not do anything if CONFIG_HAS_VMAP is not
enabled.

HAS_VMAP is widely used in ALTERNATIVE feature to remap a range of
memory with new memory attributes. Since this is highly dependent on
virtual address translation, we choose to make HAS_VMAP selected by
MMU. And ALTERNATIVE depends on HAS_VMAP.

At the moment, the users of HARDEN_BRANCH_PREDICTOR requires to use the
vmap() to update the exceptions vectors. While it might be possible to
rework the code, it is believed that speculative attackes would be
difficult to exploit on non-MMU because the software is tightly
controlled. So for now make HARDEN_BRANCH_PREDICTOR to depend on the
MMU.

Also took the opportunity to remove "#ifdef VMAP_VIRT_START .. endif"
from vmap.c. Instead vmap.c is compiled when HAS_VMAP is enabled. Thus,
HAS_VMAP is now enabled from x86, ppc and riscv architectures as all of
them use MMU and has VMAP_VIRT_START defined.

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Signed-off-by: Wei Chen <wei.chen@arm.com>
Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Acked-by: Julien Grall <jgrall@amazon.com>
---

Changes from :-

v1 - 1. HARDEN_BRANCH_PREDICTOR is now gated on HAS_VMAP.
2. cpuerrata.c is not gated on HAS_VMAP.

v2 - 1. Introduced CONFIG_VMAP in common/Kconfig.
2. Architectures using MMU select this config.
3. vm_init() now uses CONFIG_VMAP.

v3 - 1. HARDEN_BRANCH_PREDICTOR is now gated on MMU.
2. vmap.c is compiled when CONFIG_HAS_VMAP is enabled.
3. HAS_VMAP is enabled from x86, ppc and riscv architectures.

v4 - 1. Fixed the commit message.
2. Added Julien's Ack.

 xen/arch/arm/Kconfig   | 4 +++-
 xen/arch/arm/setup.c   | 2 ++
 xen/arch/ppc/Kconfig   | 1 +
 xen/arch/riscv/Kconfig | 1 +
 xen/arch/x86/Kconfig   | 1 +
 xen/common/Kconfig     | 3 +++
 xen/common/Makefile    | 2 +-
 xen/common/vmap.c      | 2 --
 xen/include/xen/vmap.h | 2 ++
 9 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 21d03d9f44..323c967361 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -12,7 +12,7 @@ config ARM_64
 config ARM
 	def_bool y
 	select FUNCTION_ALIGNMENT_4B
-	select HAS_ALTERNATIVE
+	select HAS_ALTERNATIVE if HAS_VMAP
 	select HAS_DEVICE_TREE
 	select HAS_PASSTHROUGH
 	select HAS_UBSAN
@@ -61,6 +61,7 @@ config PADDR_BITS
 config MMU
 	def_bool y
 	select HAS_PMAP
+	select HAS_VMAP
 
 source "arch/Kconfig"
 
@@ -171,6 +172,7 @@ config ARM_SSBD
 
 config HARDEN_BRANCH_PREDICTOR
 	bool "Harden the branch predictor against aliasing attacks" if EXPERT
+	depends on MMU
 	default y
 	help
 	  Speculation attacks against some high-performance processors rely on
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 961d3ea670..71ebaa77ca 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -446,7 +446,9 @@ void asmlinkage __init start_xen(unsigned long fdt_paddr)
      * It needs to be called after do_initcalls to be able to use
      * stop_machine (tasklets initialized via an initcall).
      */
+#ifdef CONFIG_HAS_ALTERNATIVE
     apply_alternatives_all();
+#endif
     enable_errata_workarounds();
     enable_cpu_features();
 
diff --git a/xen/arch/ppc/Kconfig b/xen/arch/ppc/Kconfig
index f6a77a8200..6db575a48d 100644
--- a/xen/arch/ppc/Kconfig
+++ b/xen/arch/ppc/Kconfig
@@ -2,6 +2,7 @@ config PPC
 	def_bool y
 	select FUNCTION_ALIGNMENT_4B
 	select HAS_DEVICE_TREE
+	select HAS_VMAP
 
 config PPC64
 	def_bool y
diff --git a/xen/arch/riscv/Kconfig b/xen/arch/riscv/Kconfig
index 259eea8d3b..7a113c7774 100644
--- a/xen/arch/riscv/Kconfig
+++ b/xen/arch/riscv/Kconfig
@@ -3,6 +3,7 @@ config RISCV
 	select FUNCTION_ALIGNMENT_16B
 	select GENERIC_BUG_FRAME
 	select HAS_DEVICE_TREE
+	select HAS_VMAP
 
 config RISCV_64
 	def_bool y
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index d0aaf359eb..dee8db45e8 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -29,6 +29,7 @@ config X86
 	select HAS_PIRQ
 	select HAS_SCHED_GRANULARITY
 	select HAS_UBSAN
+	select HAS_VMAP
 	select HAS_VPCI if HVM
 	select NEEDS_LIBELF
 
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 565ceda741..90268d9249 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -83,6 +83,9 @@ config HAS_SCHED_GRANULARITY
 config HAS_UBSAN
 	bool
 
+config HAS_VMAP
+	bool
+
 config MEM_ACCESS_ALWAYS_ON
 	bool
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 7e66802a9e..fc52e0857d 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -52,7 +52,7 @@ obj-$(CONFIG_TRACEBUFFER) += trace.o
 obj-y += version.o
 obj-y += virtual_region.o
 obj-y += vm_event.o
-obj-y += vmap.o
+obj-$(CONFIG_HAS_VMAP) += vmap.o
 obj-y += vsprintf.o
 obj-y += wait.o
 obj-bin-y += warning.init.o
diff --git a/xen/common/vmap.c b/xen/common/vmap.c
index ced9cbf26f..47225fecc0 100644
--- a/xen/common/vmap.c
+++ b/xen/common/vmap.c
@@ -1,4 +1,3 @@
-#ifdef VMAP_VIRT_START
 #include <xen/bitmap.h>
 #include <xen/sections.h>
 #include <xen/init.h>
@@ -427,4 +426,3 @@ void *_xvrealloc(void *va, size_t size, unsigned int align)
 
     return ptr;
 }
-#endif
diff --git a/xen/include/xen/vmap.h b/xen/include/xen/vmap.h
index fdae37e950..c1dd7ac22f 100644
--- a/xen/include/xen/vmap.h
+++ b/xen/include/xen/vmap.h
@@ -141,7 +141,9 @@ void *arch_vmap_virt_end(void);
 /* Initialises the VMAP_DEFAULT virtual range */
 static inline void vm_init(void)
 {
+#ifdef CONFIG_HAS_VMAP
     vm_init_type(VMAP_DEFAULT, (void *)VMAP_VIRT_START, arch_vmap_virt_end());
+#endif
 }
 
 #endif /* __XEN_VMAP_H__ */
-- 
2.25.1



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 09:10:55 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 09:10:55 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786284.1195852 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjxef-00070U-Rz; Fri, 30 Aug 2024 09:10:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786284.1195852; Fri, 30 Aug 2024 09:10:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjxef-00070N-NL; Fri, 30 Aug 2024 09:10:53 +0000
Received: by outflank-mailman (input) for mailman id 786284;
 Fri, 30 Aug 2024 09:10:52 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=q2fe=P5=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjxee-000709-Dz
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 09:10:52 +0000
Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com
 [2a00:1450:4864:20::52d])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id bff18149-66af-11ef-99a0-01e77a169b0f;
 Fri, 30 Aug 2024 11:10:49 +0200 (CEST)
Received: by mail-ed1-x52d.google.com with SMTP id
 4fb4d7f45d1cf-5c22b1f470dso1223680a12.1
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 02:10:49 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226ce48f0sm1692255a12.79.2024.08.30.02.10.48
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 30 Aug 2024 02:10:48 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bff18149-66af-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1725009049; x=1725613849; 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=XT4Yg5crDkbfU+vWXD1Sxz60wgfsa6qjHCvF7zSJeBM=;
        b=FOo1Kyzq7UW6jn8XGE4LIVO+x02srQvlZpXKt6jlx10+xiuQe9KkZYVtDbrFjkV32H
         Pm4CazqCwZRl7Vgjsh0WZ0oWvHlSiwpxi2lrfsAXmJCcmB4iauMRusZOQ8GqwNSVWm8q
         HbeDMMf++uU+floEqgdf4xh0k1lAXch9SEOWrZJfRc+rodt+j+M5oe2kCWqF1Ck3HhFQ
         Uibfpbuhvjg0TxfMVmQ6bFI7t32zSQmqVRVNlVcPGFrwTEdsxMzYhb+NRFd7zfulhpem
         XA4LYRNfIbEI8ltUX8u4LcmxgIZugEndMujTmjr6N2u7Z1deW9cwmjLJ9LTmT2La+pEE
         QbJQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725009049; x=1725613849;
        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=XT4Yg5crDkbfU+vWXD1Sxz60wgfsa6qjHCvF7zSJeBM=;
        b=AyMPhagXDQvXx3IQdSB6aa6cTEtnDkL6dvmkMNpFN3iSs6Be6Gg16q0Chv8jENCh7+
         /xWy/FnUOJRz/KoNSTgoMl5Qtx8VFujIDV+0yBU/oBCWtnfXoIF9V2bXoo/uwvlC4K7b
         NfZ9nwMQxSZo+4sFQWKbd9u1Uzm7oFofOk7hV7JgSf8vbuYH9hvsRdwi7h1DdAA3kZN+
         F3NLr5M5ZRj8ED3nWX8tnP/1NWD7wb/gRS/8LDXRP+ejR5v9WEHbdZgw7dg2o1i7qLgq
         r+UzzCziiNKOc/TeVCyV6zaY/ibwFdtfMU2uhJr7Sc1uaietsRePS4ffB4YuYSrhbxD9
         2xww==
X-Forwarded-Encrypted: i=1; AJvYcCU7RyDWvq8rYF8RA3g+4wTsQqICwIDPKmBQ5pWY97E/u4oP5Ofsz36Oq7KDSKCFs+SX1uWg7cjbgqk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyYW0A/kFbfJMet5S9Vkk+Bn3j0/vDFMUUsYVfIci/IB9yFj2bo
	FRurMl3TTci0ijRlQBkTRQN7Vij1bISGAFhcgx9AwArTcazvTZKuk40GFcVYJokSWW6VbRwtKnY
	=
X-Google-Smtp-Source: AGHT+IHJp+KUOuuaozWcoh+fyOQ+7mb/vnqP2h6dzbn6Cjs2FM9QmDeiMj60CLxF2CYMf5F3/4ocvA==
X-Received: by 2002:a05:6402:4496:b0:5c0:8ea7:3deb with SMTP id 4fb4d7f45d1cf-5c21ed61ba7mr4777167a12.22.1725009048923;
        Fri, 30 Aug 2024 02:10:48 -0700 (PDT)
Message-ID: <b9f46431-b91c-4c30-8d88-b6decdf12b06@suse.com>
Date: Fri, 30 Aug 2024 11:10:47 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH] xen/bitmap: remove comment-based deviations
To: Federico Serafini <federico.serafini@bugseng.com>
Cc: consulting@bugseng.com, Simone Ballarin <simone.ballarin@bugseng.com>,
 Doug Goldstein <cardoe@cardoe.com>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Andrew Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>,
 xen-devel@lists.xenproject.org
References: <4aa692a50a5d08d24560f02fdc36911965fc860b.1724850701.git.federico.serafini@bugseng.com>
 <1eae8fa0-2d4c-4cf6-8120-fd7fefa523ed@suse.com>
 <45a72e19-dceb-46a1-9771-066e64f69f38@bugseng.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 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: <45a72e19-dceb-46a1-9771-066e64f69f38@bugseng.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 30.08.2024 10:13, Federico Serafini wrote:
> On 28/08/24 16:50, Jan Beulich wrote:
>> On 28.08.2024 15:12, Federico Serafini wrote:
>>> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
>>> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
>>> @@ -565,6 +565,10 @@ of this macro do not lead to developer confusion, and can thus be deviated."
>>>   -config=MC3R1.R20.7,reports+={safe, "any_area(any_loc(any_exp(macro(^count_args_$))))"}
>>>   -doc_end
>>>   
>>> +-doc_begin="The expansion of an argument surrounded by tokens '{', '}' and ';' is safe."
>>> +-config=MC3R1.R20.7,expansion_context+={safe, "left_right(^[\\{;]$,^[;\\}]$)"}
>>> +-doc_end
>>
>> Not the least because this is quite a bit wider than ...
>>
>>> --- a/xen/include/xen/bitmap.h
>>> +++ b/xen/include/xen/bitmap.h
>>> @@ -103,13 +103,10 @@ extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order);
>>>   #define bitmap_switch(nbits, zero, small, large)			  \
>>>   	unsigned int n__ = (nbits);					  \
>>>   	if (__builtin_constant_p(nbits) && !n__) {			  \
>>> -		/* SAF-7-safe Rule 20.7 non-parenthesized macro argument */ \
>>>   		zero;							  \
>>>   	} else if (__builtin_constant_p(nbits) && n__ <= BITS_PER_LONG) { \
>>> -		/* SAF-7-safe Rule 20.7 non-parenthesized macro argument */ \
>>>   		small;							  \
>>>   	} else {							  \
>>> -		/* SAF-7-safe Rule 20.7 non-parenthesized macro argument */ \
>>>   		large;							  \
>>>   	}
>>
>> ... what's needed here, I wonder if we're not opening up avenues to
>> problems by generally permitting that pattern. Plus in the description
>> I'm missing a statement to the effect of why this is (always) safe.
> 
> The rational of the rule is that if a macro argument expands to an
> expression, there may be problems related to operator precedence, e.g.:
> 
> #define A(x, y) x * y
> 
> A(1+1, 2+2) will expand to: 1+1 * 2+2
> 
> Yes, the deviation is more general and wider than what is needed for
> the specific case but it is safe: if the expanded argument is between
> one of the aforementioned tokens, then there are no operators involved
> and no precedence issues.
> 
> I can add some details in a v2.

Please do,taking into consideration also language extensions that we use,
e.g. the statements-as-expressions one (where figure braces exist inside
an expression).

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 09:13:13 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 09:13:13 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786292.1195862 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjxgu-0007d3-9i; Fri, 30 Aug 2024 09:13:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786292.1195862; Fri, 30 Aug 2024 09:13:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjxgu-0007cw-6D; Fri, 30 Aug 2024 09:13:12 +0000
Received: by outflank-mailman (input) for mailman id 786292;
 Fri, 30 Aug 2024 09:13:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=q2fe=P5=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sjxgs-0007cJ-QH
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 09:13:10 +0000
Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com
 [2a00:1450:4864:20::22d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 13b0363f-66b0-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 11:13:10 +0200 (CEST)
Received: by mail-lj1-x22d.google.com with SMTP id
 38308e7fff4ca-2f4f8742138so17365711fa.0
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 02:13:10 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226c74184sm1783644a12.32.2024.08.30.02.13.08
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 30 Aug 2024 02:13:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 13b0363f-66b0-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1725009190; x=1725613990; 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=4VfOdxQlpk+nPeowB6qgdL8IIZ32TUp2YJ0/WXOo4m0=;
        b=Ek2edgMr3ltEfCjwHcuWKgJr7P9TqVAwvkpQsj9svwPCmufNxzp2iP4PN5HZ7BcRfr
         CIqqoy2XSboRy3ILyDvbbp01FB9dOZ5rc6I0mwbVlYSYMhZ5alXFR/heqbdMbgawAv83
         EO9i/xhjmErbKm3i5gDZx8T5whoPmZDIQFtjTvBN08oSJkSOiYWt3k95/haTX/qKZ+gR
         50F0VGDFJxyRnvIIaU/TxQ6URkhRh4RbejcA6FnFAOEVBgiUpv26FZKlPX1xLd6RA+g0
         0X4i7j+ZgadulLUk++5+8POvGjUC2bb1EnGysle1FuiME0Dp2UDQNr+fx5sit6drj43e
         ayLQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725009190; x=1725613990;
        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=4VfOdxQlpk+nPeowB6qgdL8IIZ32TUp2YJ0/WXOo4m0=;
        b=SqkGOzWVwNktKncnaCWONwPNaBBL9gPfTC+l9lEEgg3uvQE0XyEeXWn9XWIjLZ+4Kt
         KIMJyXfi2QAY7bx01PG1y3iWPHSlq/1x3Wn+mpZJW+hz474sWNACu94Ke2gKCAndvuCY
         OUo9MXpHU5YQBGj8BDBmlQbKd8cdh8kTfoX/d4YuQj7XhSoBlJ7ljRmSn4kR9cKCTCLh
         Dw+GFJBKxz65TbEfpedd6OLvZQKGWSmVQCzxRwGRW3gZiehbF8Du3wWkafzV+MDYHETq
         Li+ewvNg6fVd6esGS/N2O5zXBnlH45/Cx202D6MaBMbAAOQutpw5amah0MaEz8afhJhd
         E7bQ==
X-Forwarded-Encrypted: i=1; AJvYcCVlgypCjEhBxsq1Yez8ZmRMB2s76D+RRWb1w8TZjc49mSuTh3mcsFlcLdPkdxuwPahipixukKaJTD0=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy7QpWRXwaylyT5vHX3QNPMqdEOl8I6o9oKUMnv2FvruuCazkBQ
	lKbfCeid6hY6syH0NgpHrBkOmLnn6xhjLu1NkdgCKc8lrStgPC51biXBJC0CGg==
X-Google-Smtp-Source: AGHT+IEQJu/wD/PSmszB1acXotfZMfRC9JQ9I7aOn/MAdegZSwVdV1c1P8FoLdvIUG73dnCBJ3Pe9A==
X-Received: by 2002:a2e:a589:0:b0:2f5:abe:b6bd with SMTP id 38308e7fff4ca-2f6108a7ad5mr39152521fa.42.1725009189596;
        Fri, 30 Aug 2024 02:13:09 -0700 (PDT)
Message-ID: <c94074c4-863a-4c26-b4da-e02c19703059@suse.com>
Date: Fri, 30 Aug 2024 11:13:07 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5] xen: make VMAP support in MMU system only
To: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
Cc: Penny Zheng <penny.zheng@arm.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Andrew Cooper <andrew.cooper3@citrix.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, =?UTF-8?Q?Roger_Pau_Monn=C3=A9?=
 <roger.pau@citrix.com>, Wei Chen <wei.chen@arm.com>,
 Julien Grall <jgrall@amazon.com>, xen-devel@lists.xenproject.org
References: <20240830090821.23105-1-ayan.kumar.halder@amd.com>
Content-Language: en-US
From: Jan Beulich <jbeulich@suse.com>
Autocrypt: addr=jbeulich@suse.com; keydata=
 xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk
 hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK
 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD
 /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py
 O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl
 MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP
 nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo
 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp
 Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC
 AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee
 e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF
 hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l
 IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS
 FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj
 t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8
 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3
 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9
 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V
 m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM
 EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr
 wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A
 nAuWpQkjM1ASeQwSHEeAWPgskBQL
In-Reply-To: <20240830090821.23105-1-ayan.kumar.halder@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 30.08.2024 11:08, Ayan Kumar Halder wrote:
> From: Penny Zheng <penny.zheng@arm.com>
> 
> Introduce CONFIG_HAS_VMAP which is selected by the architectures that
> use MMU. vm_init() does not do anything if CONFIG_HAS_VMAP is not
> enabled.
> 
> HAS_VMAP is widely used in ALTERNATIVE feature to remap a range of
> memory with new memory attributes. Since this is highly dependent on
> virtual address translation, we choose to make HAS_VMAP selected by
> MMU. And ALTERNATIVE depends on HAS_VMAP.
> 
> At the moment, the users of HARDEN_BRANCH_PREDICTOR requires to use the
> vmap() to update the exceptions vectors. While it might be possible to
> rework the code, it is believed that speculative attackes would be
> difficult to exploit on non-MMU because the software is tightly
> controlled. So for now make HARDEN_BRANCH_PREDICTOR to depend on the
> MMU.
> 
> Also took the opportunity to remove "#ifdef VMAP_VIRT_START .. endif"
> from vmap.c. Instead vmap.c is compiled when HAS_VMAP is enabled. Thus,
> HAS_VMAP is now enabled from x86, ppc and riscv architectures as all of
> them use MMU and has VMAP_VIRT_START defined.
> 
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
> Signed-off-by: Wei Chen <wei.chen@arm.com>
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@amd.com>
> Acked-by: Julien Grall <jgrall@amazon.com>

Acked-by: Jan Beulich <jbeulich@suse.com>




From xen-devel-bounces@lists.xenproject.org Fri Aug 30 09:18:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 09:18:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786300.1195872 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjxlt-0000a7-Qq; Fri, 30 Aug 2024 09:18:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786300.1195872; Fri, 30 Aug 2024 09:18:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjxlt-0000a0-Ne; Fri, 30 Aug 2024 09:18:21 +0000
Received: by outflank-mailman (input) for mailman id 786300;
 Fri, 30 Aug 2024 09:18:21 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=oDj5=P5=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sjxls-0000Zu-Ub
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 09:18:20 +0000
Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com
 [2a00:1450:4864:20::32a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cb6f0c2b-66b0-11ef-99a0-01e77a169b0f;
 Fri, 30 Aug 2024 11:18:19 +0200 (CEST)
Received: by mail-wm1-x32a.google.com with SMTP id
 5b1f17b1804b1-429ec9f2155so13881025e9.2
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 02:18:18 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-3749ee7172csm3436911f8f.36.2024.08.30.02.18.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Aug 2024 02:18:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cb6f0c2b-66b0-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1725009498; x=1725614298; darn=lists.xenproject.org;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to;
        bh=clW6gophoHKkGx6cqQlzA1T+qYAGXySf1L801sTC0Jg=;
        b=Z89iX5ykFCNa4aHLxlGTQarpe+fH9Eu9bh89ULdI3V5G9vBES8H8GjxROTQIzhegC8
         kmjlHu4tXZECSjOmKwE0lcgyZaaFpqsItfpuFsMygxxnKSX+7yupu5oB+VJbOPl/C1En
         OEyE+l8hWmSvFfUeVYS0cIsXbxo/VrM16dw90=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725009498; x=1725614298;
        h=in-reply-to:content-disposition:mime-version:references:message-id
         :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to;
        bh=clW6gophoHKkGx6cqQlzA1T+qYAGXySf1L801sTC0Jg=;
        b=CUPxlVrtytfI9MR0VSqPM2YoOCfI4uGvhlXy33RYa6VTqQLc3TVZ/AtOlVR2qcprQG
         1H8WlKvIDTba7aLHUZX+6CqLnJCEe8q8U/ZOueIA1IouR+g3+0FqOCoYoyGPn8nOtQ/X
         TjyfQVcci2sSR1X5zIIt4hTKuSsBuQ5GLCq/Xu5fjDKTc3AcEUZP5EGM4Z9nKXOV79XK
         lf0tuIUmp2lLBx5DDvjXi8Wcbn7K/NvIV2Qqceb7pdH/qkiG0g8J15kV5bZyOsO2yIh7
         dBkKzl3+evZq2nHdB7GwFn+dQX1/NgyYTSWXAYdWa+P+cJctrl+33EVPzUnkHdWh1XBr
         cR0Q==
X-Forwarded-Encrypted: i=1; AJvYcCW5T6nDJ/hlEIyZY4dUqKpOnrExIjboGeI+Je94bzbxWYfA/RbZ27YfnKM3u2XEL5uwLWarITIG5bs=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yynl1UAwGFoQ9LaYQ7Ni6u/f4GQiNeWnKWJN2zrA0oS7rsOMY4y
	XXWtghTfvXaWGj4jbnjTM/cLyrRC9UBAuS7nL2gkJM6Vjv/E4w3N6q0pjO0Ajy4=
X-Google-Smtp-Source: AGHT+IESDthxpe8YtRzfXG5ZRO7mnebgPWfL4Uhun6kqcxaM/jWVK4IhVl8sL1XojACM3BaywVzw2g==
X-Received: by 2002:adf:b30d:0:b0:367:8e53:7fd7 with SMTP id ffacd0b85a97d-3749b54cf7fmr3601637f8f.28.1725009497328;
        Fri, 30 Aug 2024 02:18:17 -0700 (PDT)
Date: Fri, 30 Aug 2024 11:18:16 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Federico Serafini <federico.serafini@bugseng.com>,
	xen-devel@lists.xenproject.org, consulting@bugseng.com,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: Re: [XEN PATCH v5 7/8] x86/mm: add defensive return
Message-ID: <ZtGOWAnqGu-XNCgy@macbook.local>
References: <cover.1722239813.git.federico.serafini@bugseng.com>
 <24501d2e7f5d82d8e5a483a80b35e04ce765a7cf.1722239813.git.federico.serafini@bugseng.com>
 <alpine.DEB.2.22.394.2407291512280.4857@ubuntu-linux-20-04-desktop>
 <alpine.DEB.2.22.394.2408281735020.53815@ubuntu-linux-20-04-desktop>
 <da5d2ccc-6a21-4bcc-8ceb-75b930dcdabe@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <da5d2ccc-6a21-4bcc-8ceb-75b930dcdabe@suse.com>

On Thu, Aug 29, 2024 at 09:04:37AM +0200, Jan Beulich wrote:
> On 29.08.2024 02:35, Stefano Stabellini wrote:
> > On Mon, 29 Jul 2024, Stefano Stabellini wrote:
> >> On Mon, 29 Jul 2024, Federico Serafini wrote:
> >>> Add defensive return statement at the end of an unreachable
> >>> default case. Other than improve safety, this meets the requirements
> >>> to deviate a violation of MISRA C Rule 16.3: "An unconditional `break'
> >>> statement shall terminate every switch-clause".
> >>>
> >>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
> >>
> >> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
> >>
> >>> ---
> >>> No changes from v3 and v4, further feedback on this thread would be appreciated:
> >>> https://lists.xenproject.org/archives/html/xen-devel/2024-07/msg00474.html
> > 
> > Looking at the older threads, I looks like Jan suggested EACCES, I also
> > think it is marginally better. My R-b stands also for EACCES. Jan, I
> > think you should go ahead and fix on commit
> 
> No, I very definitely want a 2nd x86 maintainer opinion here. Or a better
> suggestion for the error code to use by anyone. After all, as you confirm,
> EACCES is only marginally better.

Hm, the only alternative I could suggest is using ERANGE, to signal
the value of opt_mmio_relax is out of the expected range, however that
could be confusing for the callers?

One benefit of using ERANGE is that there's currently no return path
in get_page_from_l1e() with that error code, so it would be very easy
to spot when an unexpected value of opt_mmio_relax is found.  However
there are no guarantees that further error paths might use that error
code.

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 09:19:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 09:19:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786305.1195882 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjxn0-00017F-2p; Fri, 30 Aug 2024 09:19:30 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786305.1195882; Fri, 30 Aug 2024 09:19:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjxn0-000178-07; Fri, 30 Aug 2024 09:19:30 +0000
Received: by outflank-mailman (input) for mailman id 786305;
 Fri, 30 Aug 2024 09:19:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=oDj5=P5=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sjxmz-000170-6L
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 09:19:29 +0000
Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com
 [2a00:1450:4864:20::334])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f47ec570-66b0-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 11:19:27 +0200 (CEST)
Received: by mail-wm1-x334.google.com with SMTP id
 5b1f17b1804b1-42bac9469e8so13346875e9.3
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 02:19:27 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-3749efb1682sm3430744f8f.101.2024.08.30.02.19.25
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Aug 2024 02:19:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f47ec570-66b0-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1725009567; x=1725614367; darn=lists.xenproject.org;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date:from:to
         :cc:subject:date:message-id:reply-to;
        bh=ha5BRDxljk1GTSThvun3hVuf0A3qFlheOk9/zjHZDaY=;
        b=hZnVVZx3PnnH/aSnVa1zzGJO7p9O74AAAUdmE/DHqiuAH2OxpFWKfXd8pqXigzOF46
         h0VULfxXGe5NJR4oF68hlwZRlm0c/d5zQIacoiHmg4xQtho1+e+G7HiNg4i4vCCYTMLN
         pJdAUf7RtzZZyOFQYAYAqoOfPiTts6EgJ06lQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725009567; x=1725614367;
        h=in-reply-to:content-transfer-encoding:content-disposition
         :mime-version:references:message-id:subject:cc:to:from:date
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
        bh=ha5BRDxljk1GTSThvun3hVuf0A3qFlheOk9/zjHZDaY=;
        b=oEI3SufJZWYhlW3E2g7m+TVGQq1ZgAKhGm4fApevK5f3BEy28g5BHvN5bHfysLGhNm
         118KX6lf4XFSg2G7VTkGGwaS7JElTVr/BBfz0SfGOsN1kt9sxF3vt5KkpBMIKozifNsj
         x8IVa4HxE0mCOgy5nYMW2rcDpKL1CxpT6auLiZ8VV6yu0UDsWEySULDM5yHc74FLrpjt
         FiTX3PVdjyKS2GSS7ONn4UcBFKkP4KbieLPLonX55HNbmOptAka1yvZwbOElAJBnSfix
         yffbxuSp9dW1EoOl8TjPX1RUGzFjXj/j6okrylX5d3yoYpS0iEs35VCaXtqD/RrKt+dv
         PWeQ==
X-Forwarded-Encrypted: i=1; AJvYcCVJQA0JuKRD9az0/em//EwVHxEm6/QMD56vcgtuD/yUcf80APwbNnPRH5bj8cHDs2axYY1HpBsNmLM=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy0eJNGnVsA5XdYnDHEzM8N4NtwFQEI2FkZebEL7cfh/HVg/WXQ
	rauQnRprXyTv00N2nfiHLiiJMb52787U5TLNIvTwXmGXjKnGa43YeIZ1D3MLIGw=
X-Google-Smtp-Source: AGHT+IFw0D5IVxgOTCm8NnoiaDYtJ6rmDLC5L4rVeEQ+pPLESJ3mHqg+8C5pz7qkvzOn/0YyjOLX5Q==
X-Received: by 2002:a05:600c:3b11:b0:426:5f8f:51a4 with SMTP id 5b1f17b1804b1-42bb0258ac3mr42854415e9.12.1725009566389;
        Fri, 30 Aug 2024 02:19:26 -0700 (PDT)
Date: Fri, 30 Aug 2024 11:19:25 +0200
From: Roger Pau =?utf-8?B?TW9ubsOp?= <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] x86/pv: Make cr4_pv32_mask be PV32-only
Message-ID: <ZtGOnQVY4SiEK63o@macbook.local>
References: <20240829183817.2807665-1-andrew.cooper3@citrix.com>
 <77e852b6-1336-4289-87f2-9cefe2e6fd04@suse.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <77e852b6-1336-4289-87f2-9cefe2e6fd04@suse.com>

On Fri, Aug 30, 2024 at 09:55:12AM +0200, Jan Beulich wrote:
> On 29.08.2024 20:38, Andrew Cooper wrote:
> > The user of cr4_pv32_mask (the cr4_pv32_restore() function) only exists in a
> > CONFIG_PV32 build, but right now the variable is unconditionally set up.
> > 
> > To start with, move the setup into set_in_cr4() and remove it from it's
> > somewhat ad-hoc position in __start_xen().  This means the variable will be
> > set up in two steps for a CONFIG_PV32=y build, but it's cleaner and more
> > robust logic overall.
> > 
> > With that, there's no good reason for the variable to stay in setup.c.  Move
> > it to x86/pv/traps.c (for want of any better place to live), and move the
> > declaration to beside set_in_cr4() and mmu_cr4_features which is a better
> > position than setup.h.
> > 
> > Guard the reference with CONFIG_PV32, and fix up a recent typo in an adjacent
> > comment while at it.
> > 
> > No functional change.
> > 
> > Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> with a suggestion:
> 
> > --- a/xen/arch/x86/pv/traps.c
> > +++ b/xen/arch/x86/pv/traps.c
> > @@ -18,6 +18,10 @@
> >  #include <asm/traps.h>
> >  #include <irq_vectors.h>
> >  
> > +#ifdef CONFIG_PV32
> > +unsigned long __ro_after_init cr4_pv32_mask;
> > +#endif
> 
> To save on the number of such #ifdef-s, how about moving this into an existing
> one. pv/mm.c has one, albeit near the bottom of the file (which I'd be fine
> with, but I could imagine you or others not liking such placement), and
> pv/domain.c has one near the top which seems pretty well suited.

I'm fine either way:

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks, Roger.


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 09:41:36 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 09:41:36 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786312.1195891 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjy8H-0006Lf-NG; Fri, 30 Aug 2024 09:41:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786312.1195891; Fri, 30 Aug 2024 09:41:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjy8H-0006LY-Kj; Fri, 30 Aug 2024 09:41:29 +0000
Received: by outflank-mailman (input) for mailman id 786312;
 Fri, 30 Aug 2024 09:41:29 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjy8G-0006LO-Vg; Fri, 30 Aug 2024 09:41:28 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjy8G-0001cJ-LY; Fri, 30 Aug 2024 09:41:28 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjy8G-0004PJ-Aw; Fri, 30 Aug 2024 09:41:28 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjy8G-0002kf-AU; Fri, 30 Aug 2024 09:41:28 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=huXHNuI8Bek2boOQcvEnoduo6jPmVF8jJm46pqpCwls=; b=Je2owc7IJbyM4t5PRkBC+AoIS9
	dRF/QhT4JcDGoj3yEtJhGx8gDL59B0Qt/oeD/4gRrKQq7RqkMlL9O9mou+EdHyf+TmMJlZGtSkCLl
	TVAOAD3IsDaCqU17VtAKxo8ascYXn/l43b/2/VKDjSjQKf2HNynD6mgf5to4RattRmqk=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187406-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-6.1 test] 187406: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-6.1:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-6.1:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-6.1:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-6.1:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=311d8503ef9fa25932825c5342de7213738aad8e
X-Osstest-Versions-That:
    linux=ee5e09825b810498caeaaa3d46a3410768471053
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 09:41:28 +0000

flight 187406 linux-6.1 real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187406/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187281
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187281
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187281
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187281
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187281
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187281
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                311d8503ef9fa25932825c5342de7213738aad8e
baseline version:
 linux                ee5e09825b810498caeaaa3d46a3410768471053

Last test of basis   187281  2024-08-19 04:15:49 Z   11 days
Testing same since   187406  2024-08-29 15:43:38 Z    0 days    1 attempts

------------------------------------------------------------
302 people touched revisions under test,
not listing them all

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   ee5e09825b810..311d8503ef9fa  311d8503ef9fa25932825c5342de7213738aad8e -> tested/linux-6.1


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 09:49:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 09:49:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786325.1195908 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjyGH-0007xP-Ux; Fri, 30 Aug 2024 09:49:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786325.1195908; Fri, 30 Aug 2024 09:49:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjyGH-0007wD-PD; Fri, 30 Aug 2024 09:49:45 +0000
Received: by outflank-mailman (input) for mailman id 786325;
 Fri, 30 Aug 2024 09:49:44 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=PfWu=P5=bounce.vates.tech=bounce-md_30504962.66d195b4.v1-1ad4937e69c44b9aa22f45a8be7d3abe@srs-se1.protection.inumbo.net>)
 id 1sjyGG-0007tp-0H
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 09:49:44 +0000
Received: from mail135-11.atl141.mandrillapp.com
 (mail135-11.atl141.mandrillapp.com [198.2.135.11])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2d9167da-66b5-11ef-99a0-01e77a169b0f;
 Fri, 30 Aug 2024 11:49:41 +0200 (CEST)
Received: from pmta14.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail135-11.atl141.mandrillapp.com (Mailchimp) with ESMTP id
 4WwCzm2YxvzLfH1Bd
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 09:49:40 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 1ad4937e69c44b9aa22f45a8be7d3abe; Fri, 30 Aug 2024 09:49:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2d9167da-66b5-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1725011380; x=1725271880;
	bh=5LiO0Nd/Zy1z0sOoL8UJ1K72e8zF+8gwKPSYqigHYq0=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=L6hJ8RXrjoQRQh6418pPvTvSQAiKezboT34+hYPDZ2nAVrzsUVsMgQU95o+sOUxFX
	 sznzf1qA+N0FgtWiIvmbCSgOcuP9+ueZo9azFo488c/k4xscJvx6PSJ9xgB7O2pR19
	 cFKeCJpVTsSrjqO5kqvhFoUYQ02g1okjuacxL5WfXu//DRLssIBK0Pmy04ZnzUw/Ub
	 Ti+nYkbSdML+v5REF4JvV5sXQ3dtb8o2ug6jq0f+UEN+3dZwwveLY7UPEgawYtIXml
	 FqIs9ZOXwOm5/FqANfSWV8woNvDdWlifAXL9dMxsIom8Qw2QS3LS6WM0Qm/agpijGY
	 Db92MtVrxGj9g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1725011380; x=1725271880; i=anthony.perard@vates.tech;
	bh=5LiO0Nd/Zy1z0sOoL8UJ1K72e8zF+8gwKPSYqigHYq0=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=xJc2iJgzpHBptd5uf2deIN24kcU4WbSzLjpVYgu2QUIdapC0iVmrokSQFebh9T808
	 lVklg4UTZkCbuY4QkYm61VEvxTOpVGW1ziZcXphM8VQe6oUZaYqoX/LbyYXn+pyJWd
	 68PMRbSn6W0Ipy7MVR/O73w6jooh4ix7ZEcDK6WqeiZ+1Op6U/yXcu3MQEgSDZrElh
	 81VCFFrIIoWYJj/BGUnEKXSeoVerp9+bo68BJK5JQDkZy/4z9coKAJMRiyo0EK6Stj
	 RDp/Rpzo9aB+KqH/4SCCAHsx2KkaIir68rz69DRE9VCHOXwH0QINit6dTDjEWzjy5T
	 BQfmYzm7AJmdA==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?[XEN=20PATCH=20v2=201/2]=20libxl:=20Probe=20QEMU=20for=20-run-with=20chroot=3Ddir=20and=20use=20it?=
X-Mailer: git-send-email 2.39.2
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1725011379613
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>, Jason Andryuk <jason.andryuk@amd.com>, Juergen Gross <jgross@suse.com>
Message-Id: <20240830094937.40476-2-anthony.perard@vates.tech>
In-Reply-To: <20240830094937.40476-1-anthony.perard@vates.tech>
References: <20240830094937.40476-1-anthony.perard@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.1ad4937e69c44b9aa22f45a8be7d3abe?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240830:md
Date: Fri, 30 Aug 2024 09:49:40 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

QEMU 9.0 have removed "-chroot" command line option, which have been
deprecated since QEMU 8.1 in favor of "-run-with chroot=dir".

Look into the result of the QMP command "query-command-line-options"
to find out if "-run-with chroot=dir" is available. Then use it in
place of "-chroot".

Resolves: xen-project/xen#187
Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---

Notes:
    v2:
    - rename "qemu_cmdline" to "qemu_opts" in struct field and func
      parameters.
    - rename "struct libxl__qemu_available_cmd_line" to
      "struct libxl__qemu_available_opts".

 tools/libs/light/libxl_dm.c       | 78 +++++++++++++++++++++++++------
 tools/libs/light/libxl_internal.h |  5 ++
 2 files changed, 69 insertions(+), 14 deletions(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index 46babfed0b..15b157060f 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -1183,11 +1183,12 @@ static int libxl__pre_open_qmp_socket(libxl__gc *gc, libxl_domid domid,
 }
 
 static int libxl__build_device_model_args_new(libxl__gc *gc,
-                                        const char *dm, int guest_domid,
-                                        const libxl_domain_config *guest_config,
-                                        char ***args, char ***envs,
-                                        const libxl__domain_build_state *state,
-                                        int *dm_state_fd)
+    const char *dm, int guest_domid,
+    const libxl_domain_config *guest_config,
+    char ***args, char ***envs,
+    const libxl__domain_build_state *state,
+    const libxl__qemu_available_opts *qemu_opts,
+    int *dm_state_fd)
 {
     const libxl_domain_create_info *c_info = &guest_config->c_info;
     const libxl_domain_build_info *b_info = &guest_config->b_info;
@@ -1778,8 +1779,13 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
         }
 
         /* Add "-chroot [dir]" to command-line */
-        flexarray_append(dm_args, "-chroot");
-        flexarray_append(dm_args, chroot_dir);
+        if (qemu_opts->have_runwith_chroot) {
+            flexarray_append_pair(dm_args, "-run-with",
+                                  GCSPRINTF("chroot=%s", chroot_dir));
+        } else {
+            flexarray_append(dm_args, "-chroot");
+            flexarray_append(dm_args, chroot_dir);
+        }
     }
 
     if (state->saved_state) {
@@ -2059,11 +2065,12 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
 }
 
 static int libxl__build_device_model_args(libxl__gc *gc,
-                                        const char *dm, int guest_domid,
-                                        const libxl_domain_config *guest_config,
-                                        char ***args, char ***envs,
-                                        const libxl__domain_build_state *state,
-                                        int *dm_state_fd)
+    const char *dm, int guest_domid,
+    const libxl_domain_config *guest_config,
+    char ***args, char ***envs,
+    const libxl__domain_build_state *state,
+    const libxl__qemu_available_opts *qemu_opts,
+    int *dm_state_fd)
 /* dm_state_fd may be NULL iff caller knows we are using stubdom
  * and therefore will be passing a filename rather than a fd. */
 {
@@ -2081,7 +2088,9 @@ static int libxl__build_device_model_args(libxl__gc *gc,
         return libxl__build_device_model_args_new(gc, dm,
                                                   guest_domid, guest_config,
                                                   args, envs,
-                                                  state, dm_state_fd);
+                                                  state,
+                                                  qemu_opts,
+                                                  dm_state_fd);
     default:
         LOGED(ERROR, guest_domid, "unknown device model version %d",
               guest_config->b_info.device_model_version);
@@ -2403,7 +2412,9 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
 
     ret = libxl__build_device_model_args(gc, "stubdom-dm", guest_domid,
                                          guest_config, &args, NULL,
-                                         d_state, NULL);
+                                         d_state,
+                                         &sdss->dm.qemu_opts,
+                                         NULL);
     if (ret) {
         ret = ERROR_FAIL;
         goto out;
@@ -3024,6 +3035,7 @@ static void device_model_probe_detached(libxl__egc *egc,
 static void device_model_probe_cmdline(libxl__egc *egc,
     libxl__ev_qmp *qmp, const libxl__json_object *response, int rc)
 {
+    EGC_GC;
     libxl__dm_spawn_state *dmss = CONTAINER_OF(qmp, *dmss, qmp);
 
     if (rc)
@@ -3033,6 +3045,43 @@ static void device_model_probe_cmdline(libxl__egc *egc,
      * query-command-line-options response:
      * [ { 'option': 'str', 'parameters': [{ 'name': 'str', ... }] } ]
      */
+    const libxl__json_object *option;
+    for (int i_option = 0;
+         (option = libxl__json_array_get(response, i_option));
+         i_option++) {
+        const libxl__json_object *o;
+        const char *opt_str;
+
+        o = libxl__json_map_get("option", option, JSON_STRING);
+        if (!o) {
+            rc = ERROR_QEMU_API;
+            goto out;
+        }
+        opt_str = libxl__json_object_get_string(o);
+
+        if (!strcmp("run-with", opt_str)) {
+            const libxl__json_object *params;
+            const libxl__json_object *item;
+
+            params = libxl__json_map_get("parameters", option, JSON_ARRAY);
+            for (int i = 0; (item = libxl__json_array_get(params, i)); i++) {
+                o = libxl__json_map_get("name", item, JSON_STRING);
+                if (!o) {
+                    rc = ERROR_QEMU_API;
+                    goto out;
+                }
+                if (!strcmp("chroot", libxl__json_object_get_string(o))) {
+                    dmss->qemu_opts.have_runwith_chroot = true;
+                }
+            }
+
+            /*
+             * No need to parse more options, we are only interested with
+             * -run-with at the moment.
+             */
+            break;
+        }
+    }
 
     qmp->callback = device_model_probe_quit;
     rc = libxl__ev_qmp_send(egc, qmp, "quit", NULL);
@@ -3113,6 +3162,7 @@ static void device_model_launch(libxl__egc *egc,
 
     rc = libxl__build_device_model_args(gc, dm, domid, guest_config,
                                           &args, &envs, state,
+                                          &dmss->qemu_opts,
                                           &dm_state_fd);
     if (rc)
         goto out;
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index e99adc56cb..0133c57e01 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -4142,6 +4142,10 @@ _hidden void libxl__add_nics(libxl__egc *egc, libxl__ao *ao, uint32_t domid,
 /* First layer; wraps libxl__spawn_spawn. */
 
 typedef struct libxl__dm_spawn_state libxl__dm_spawn_state;
+typedef struct libxl__qemu_available_opts libxl__qemu_available_opts;
+struct libxl__qemu_available_opts {
+    bool have_runwith_chroot;
+};
 
 typedef void libxl__dm_spawn_cb(libxl__egc *egc, libxl__dm_spawn_state*,
                                 int rc /* if !0, error was logged */);
@@ -4154,6 +4158,7 @@ struct libxl__dm_spawn_state {
     libxl__ev_qmp qmp;
     libxl__ev_time timeout;
     libxl__dm_resume_state dmrs;
+    libxl__qemu_available_opts qemu_opts;
     const char *dm;
     /* filled in by user, must remain valid: */
     uint32_t guest_domid; /* domain being served */
-- 


Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 09:49:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 09:49:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786326.1195913 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjyGI-00083h-7N; Fri, 30 Aug 2024 09:49:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786326.1195913; Fri, 30 Aug 2024 09:49:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjyGI-00080r-12; Fri, 30 Aug 2024 09:49:46 +0000
Received: by outflank-mailman (input) for mailman id 786326;
 Fri, 30 Aug 2024 09:49:45 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=n/bQ=P5=bounce.vates.tech=bounce-md_30504962.66d195b4.v1-f9f7dc8716dc4b379193f41ae648c972@srs-se1.protection.inumbo.net>)
 id 1sjyGH-0007tp-4W
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 09:49:45 +0000
Received: from mail135-11.atl141.mandrillapp.com
 (mail135-11.atl141.mandrillapp.com [198.2.135.11])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2eb485ab-66b5-11ef-99a0-01e77a169b0f;
 Fri, 30 Aug 2024 11:49:43 +0200 (CEST)
Received: from pmta14.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail135-11.atl141.mandrillapp.com (Mailchimp) with ESMTP id
 4WwCzm510tzLfH1CD
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 09:49:40 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 f9f7dc8716dc4b379193f41ae648c972; Fri, 30 Aug 2024 09:49:40 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2eb485ab-66b5-11ef-99a0-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1725011380; x=1725271880;
	bh=VlT/ir/7U6EdnF9VDO79yZehSnEW7U7FvGLlDvPzdzw=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=QRCvx3LU1EwOCSLzrhiFFrSXbErABl51Zodxvm2XU9fSax6u4zOhYAezlFWxkP9+w
	 uYgXvknqDRkVHF+V6rDq8r1Hc5V9zHeuVS+sSe983khev9Diip8BmDsMwdNGndIDQc
	 puS2R4FHXwhr0G+/l5FwK59LwlxF9rzOr+W8bH6VYZzQ8nB9NWx/HGHTGsL2bBzNio
	 2nO3WLOYzHX0Wh+K2qoZA1oab1CdtQ1IJJ3Bv5SJzpYtMTQIp3iBxEBI513xRSDYLV
	 f7OjFXovXIVzHMopgeeJRtfEn77XfSX5yK0BwkNcW4s/jn87o5aGDLxjR89IWZ7pYC
	 bytgYPVJX0sFQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1725011380; x=1725271880; i=anthony.perard@vates.tech;
	bh=VlT/ir/7U6EdnF9VDO79yZehSnEW7U7FvGLlDvPzdzw=;
	h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=qVD1zClVj8yqMkqQXZXRwln0O676M8GtNYllnPrdWXJwxE1/7MJzNavIdtLURDRZi
	 rKvd/VPApa1H2bXgY3isk/MQpebJ5ntXeMhXxSB8eIcqOe6ZPuSF2polu11hCaTx0X
	 ybnSPI7U2egZ9o3sAXCJKH66Z6p0oWSfRCvXWQHeI03HAZO3cwPfyxmxGtCWQG3Px2
	 O8zKN9Iqcn3hHmqiL2HIiduIXsg4O4VzDCmSfW9RXp8ty83RecmekAgOz44YxUHVQu
	 HNK0bHljzL5dyNBDSaIBiT+FdILT6vmqfJnGwKBSM+KM+FSSOIMVoqnJCPzkd1o6K6
	 N1h4Akp7WCp3g==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?[XEN=20PATCH=20v2=202/2]=20libxl:=20Probe=20QEMU=20for=20-run-with=20user=3Duser=20and=20use=20it?=
X-Mailer: git-send-email 2.39.2
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1725011379928
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>, Jason Andryuk <jason.andryuk@amd.com>, Juergen Gross <jgross@suse.com>
Message-Id: <20240830094937.40476-3-anthony.perard@vates.tech>
In-Reply-To: <20240830094937.40476-1-anthony.perard@vates.tech>
References: <20240830094937.40476-1-anthony.perard@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.f9f7dc8716dc4b379193f41ae648c972?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240830:md
Date: Fri, 30 Aug 2024 09:49:40 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

"-runas" is deprecated since QEMU 9.1 and will be remove in a future
release.

Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>
---

Notes:
    v2:
    - rename "qemu_cmdline" to "qemu_opts" in struct field and func
      parameters.

 tools/libs/light/libxl_dm.c       | 12 ++++++++++--
 tools/libs/light/libxl_internal.h |  1 +
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/tools/libs/light/libxl_dm.c b/tools/libs/light/libxl_dm.c
index 15b157060f..1f2f5bd97a 100644
--- a/tools/libs/light/libxl_dm.c
+++ b/tools/libs/light/libxl_dm.c
@@ -2052,8 +2052,13 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
         }
 
         if (state->dm_runas) {
-            flexarray_append(dm_args, "-runas");
-            flexarray_append(dm_args, state->dm_runas);
+            if (qemu_opts->have_runwith_user) {
+                flexarray_append_pair(dm_args, "-run-with",
+                                      GCSPRINTF("user=%s", state->dm_runas));
+            } else {
+                flexarray_append(dm_args, "-runas");
+                flexarray_append(dm_args, state->dm_runas);
+            }
         }
     }
     flexarray_append(dm_args, NULL);
@@ -3073,6 +3078,9 @@ static void device_model_probe_cmdline(libxl__egc *egc,
                 if (!strcmp("chroot", libxl__json_object_get_string(o))) {
                     dmss->qemu_opts.have_runwith_chroot = true;
                 }
+                else if (!strcmp("user", libxl__json_object_get_string(o))) {
+                    dmss->qemu_opts.have_runwith_user = true;
+                }
             }
 
             /*
diff --git a/tools/libs/light/libxl_internal.h b/tools/libs/light/libxl_internal.h
index 0133c57e01..089a2f949c 100644
--- a/tools/libs/light/libxl_internal.h
+++ b/tools/libs/light/libxl_internal.h
@@ -4145,6 +4145,7 @@ typedef struct libxl__dm_spawn_state libxl__dm_spawn_state;
 typedef struct libxl__qemu_available_opts libxl__qemu_available_opts;
 struct libxl__qemu_available_opts {
     bool have_runwith_chroot;
+    bool have_runwith_user;
 };
 
 typedef void libxl__dm_spawn_cb(libxl__egc *egc, libxl__dm_spawn_state*,
-- 


Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 09:49:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 09:49:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786324.1195902 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjyGH-0007uC-LL; Fri, 30 Aug 2024 09:49:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786324.1195902; Fri, 30 Aug 2024 09:49:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjyGH-0007u5-I6; Fri, 30 Aug 2024 09:49:45 +0000
Received: by outflank-mailman (input) for mailman id 786324;
 Fri, 30 Aug 2024 09:49: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=fTbV=P5=bounce.vates.tech=bounce-md_30504962.66d195b3.v1-1aeebc3cf2674cbf8c3aa11c57ca257b@srs-se1.protection.inumbo.net>)
 id 1sjyGF-0007to-Hc
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 09:49:43 +0000
Received: from mail135-11.atl141.mandrillapp.com
 (mail135-11.atl141.mandrillapp.com [198.2.135.11])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2d59a5e8-66b5-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 11:49:41 +0200 (CEST)
Received: from pmta14.mandrill.prod.atl01.rsglab.com (localhost [127.0.0.1])
 by mail135-11.atl141.mandrillapp.com (Mailchimp) with ESMTP id
 4WwCzl6DwTzLfH0Q4
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 09:49:39 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 1aeebc3cf2674cbf8c3aa11c57ca257b; Fri, 30 Aug 2024 09:49:39 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2d59a5e8-66b5-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1725011379; x=1725271879;
	bh=4sGqzl3pHWUWgo6zIvCEtetCdFeclMIXIb/FR8+SB4I=;
	h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From;
	b=Ok8439v9HCJB3Rumc66JDiPPx+jV3A4iXnwHMzNEWD4Fku+SAkSNsK/K4P0328ESS
	 69gyURoVqVz9vodTXHX+RUnFcCnHecIxvm1Iy8hkhc0kOD9KyOnbI7hcjTe9IoyZHl
	 OdaeLq52Jc2ml1zcO9/kH/Kam86FXr2jZpN2+LvB5soIMU9x1BVkwRov9f6mqPQmlN
	 fKNoyhU+ism5Sd+TB2lCDQLwqMvkFItn2HdmoP0d2OeQJDll8GbjXcgQvKqLs8itnl
	 20uEuY4GVLkWM04ioB1r/eu0hsRltUqd0K5nJPIfMYs8Op4IZZy760EZ1i5oYevHwu
	 SEMRKpfWsVJPw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1725011379; x=1725271879; i=anthony.perard@vates.tech;
	bh=4sGqzl3pHWUWgo6zIvCEtetCdFeclMIXIb/FR8+SB4I=;
	h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version:
	 Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From;
	b=ogampzA65DubjkKOiMrLD7Dciql9sjmUYjG9uItq3vETHMX0VnyGPPTob/DobSwnu
	 HjnKtfbACE4DqjLonoS2ablkyWaZp9tnVlFvAxMCTxHligNZUTztfETY+Vl6QeOKsu
	 TXxEPBCxMxToFIjfZbnJQJswU8zR0dSQowG8zkRUPHkokgeTRkDrJYm39fXbxOydu7
	 9JZkTJ4aEnIEJddRskIOEKm4IGgik5IoSmHzzZx4/dMIR82vUKSghdXzfGzX8JlwFP
	 ypXnslOAunmrCZfBastXqnPXCBrWh1d6S2LO3b7Z56gx5GID5qZGmGigV4D6s+YByr
	 Hu5vZBpmfEAVg==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?[XEN=20PATCH=20v2=200/2]=20libxl:=20Implement=20QEMU=20command=20line=20probe?=
X-Mailer: git-send-email 2.39.2
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1725011379275
To: xen-devel@lists.xenproject.org
Cc: Anthony PERARD <anthony.perard@vates.tech>, Juergen Gross <jgross@suse.com>
Message-Id: <20240830094937.40476-1-anthony.perard@vates.tech>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.1aeebc3cf2674cbf8c3aa11c57ca257b?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240830:md
Date: Fri, 30 Aug 2024 09:49:39 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit

Patch series available in this git branch:
https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git br.libxl-qemu-cmdline-probe-v2

v2:
- removed commited patch
- rename "qemu_cmdline" to "qemu_opts" in struct field and func parameters.
- rename "struct libxl__qemu_available_cmd_line" to
  "struct libxl__qemu_available_opts".

Starting with QEMU 9.0, the option "-chroot", that we use for the
"dmrestrict" feature, is removed. We need to find out which to use
between "-chroot" and "-run-with chroot=dir".

Also, "-runas" is deprecated in QEMU 9.1 and will be remove in a future
release, it's replaced with "-run-with user=user".

To find out which command line option we can use, we'll spawn QEMU, and run the
QMP command "query-command-line-options".

Some example of running these patches:
    with qemu-xen (8.0):
        http://logs.test-lab.xenproject.org/osstest/logs/187352/
    with QEMU (upstream, 9.1-rc3):
        http://logs.test-lab.xenproject.org/osstest/logs/187353/

Anthony PERARD (2):
  libxl: Probe QEMU for -run-with chroot=dir and use it
  libxl: Probe QEMU for -run-with user=user and use it

 tools/libs/light/libxl_dm.c       | 90 +++++++++++++++++++++++++------
 tools/libs/light/libxl_internal.h |  6 +++
 2 files changed, 80 insertions(+), 16 deletions(-)

-- 


Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 09:52:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 09:52:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786340.1195952 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjyJI-0002PS-39; Fri, 30 Aug 2024 09:52:52 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786340.1195952; Fri, 30 Aug 2024 09:52:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjyJH-0002PL-W4; Fri, 30 Aug 2024 09:52:51 +0000
Received: by outflank-mailman (input) for mailman id 786340;
 Fri, 30 Aug 2024 09:52:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=oDj5=P5=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sjyJG-0001wc-KF
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 09:52:50 +0000
Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com
 [2a00:1450:4864:20::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9e038f21-66b5-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 11:52:49 +0200 (CEST)
Received: by mail-ej1-x630.google.com with SMTP id
 a640c23a62f3a-a86c476f679so197235666b.1
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 02:52:50 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89891db563sm194655566b.185.2024.08.30.02.52.47
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Aug 2024 02:52:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9e038f21-66b5-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1725011569; x=1725616369; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=Hgy6KsLd6IVjOwpOTywTcBhClUvG6CNwo7fjv2Ub9pE=;
        b=CISCvTTikoh72V5M1EcMolC5AWIP9DqPjY8cnPV/2gGIe7/bKXPEVTbyZBW90i8/m6
         QYOkJ6YVvVPOAi5AaQ4oHN8P1pdk6uUarvnBVkq5a9gSa3fT65Ee/pSf13/KnxXERR/O
         8Lrq20/E5CaCVJaFxOB2xJpHh/QWxky2UcqcU=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725011569; x=1725616369;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=Hgy6KsLd6IVjOwpOTywTcBhClUvG6CNwo7fjv2Ub9pE=;
        b=eR3L7Di/v3wJA/CVrJFZf/IWkzordalNSbbUHaQWKxeVbSt+LddALuutT8TlxfqCIT
         88Ap0SmitoYXc0ucjUyaer59PpdLb27OKJfxZzk/3+QUdx79nQ27E5GA7NKpiHQS0azu
         l9iUayvy9sKCgbrvT6INF3lUZcJQDiPcJmpfwfdeemAiWNcHa5YBL/d3T3x5WFRgZNI9
         2xsev6Gv0W/scFyxnqHtlRqmOc74bLIKb6RV9lrv6gc7unqmlIahAkgJUZQmI+R1yrVs
         qN0A0EeQRKMRHWleEYdp5R+RkPwwJv33O2jOInPpcaTA9LRgXvC+e01avA86FQTyawzl
         x4Vg==
X-Gm-Message-State: AOJu0YzXHE2MMV6Eei6U6NCpaCDVrJmu5NV9oakvPdvUNkjKot/eeQI5
	A9oLJxPIkeDTrVARrWbIZG/eBKnduOQYCM8GRpwh/bbq0mlFSfmibjfJwgSAoJdwaTWeB7cklE7
	r
X-Google-Smtp-Source: AGHT+IFxGczVF6OVtd6iF412SmeyKSsOp7M6/YaF4GjHiZ2HTlFEHYZsy4UU3cUI+jq5qcQVC4tb1w==
X-Received: by 2002:a17:907:94cb:b0:a86:8d83:542d with SMTP id a640c23a62f3a-a897fa751f3mr483777566b.45.1725011568064;
        Fri, 30 Aug 2024 02:52:48 -0700 (PDT)
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v2 2/2] x86/time: prefer CMOS over EFI_GET_TIME
Date: Fri, 30 Aug 2024 11:52:20 +0200
Message-ID: <20240830095220.49473-3-roger.pau@citrix.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240830095220.49473-1-roger.pau@citrix.com>
References: <20240830095220.49473-1-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The EFI_GET_TIME implementation is well known to be broken for many firmware
implementations, for Xen the result on such implementations are:

----[ Xen-4.19-unstable  x86_64  debug=y  Tainted:   C    ]----
CPU:    0
RIP:    e008:[<0000000062ccfa70>] 0000000062ccfa70
[...]
Xen call trace:
   [<0000000062ccfa70>] R 0000000062ccfa70
   [<00000000732e9a3f>] S 00000000732e9a3f
   [<ffff82d04034f34f>] F arch/x86/time.c#get_cmos_time+0x1b3/0x26e
   [<ffff82d04045926f>] F init_xen_time+0x28/0xa4
   [<ffff82d040454bc4>] F __start_xen+0x1ee7/0x2578
   [<ffff82d040203334>] F __high_start+0x94/0xa0

Pagetable walk from 0000000062ccfa70:
 L4[0x000] = 000000207ef1c063 ffffffffffffffff
 L3[0x001] = 000000005d6c0063 ffffffffffffffff
 L2[0x116] = 8000000062c001e3 ffffffffffffffff (PSE)

****************************************
Panic on CPU 0:
FATAL PAGE FAULT
[error_code=0011]
Faulting linear address: 0000000062ccfa70
****************************************

Swap the preference to default to CMOS first, and EFI later, in an attempt to
use EFI_GET_TIME as a last resort option only.  Note that Linux for example
doesn't allow calling the get_time method, and instead provides a dummy handler
that unconditionally returns EFI_UNSUPPORTED on x86-64.

Such change in the preferences requires some re-arranging of the function
logic, so that panic messages with workaround suggestions are suitably printed.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
 xen/arch/x86/time.c | 26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 272ca2468ea6..0eee954809a9 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1305,24 +1305,36 @@ static unsigned long get_cmos_time(void)
     static bool __read_mostly cmos_rtc_probe;
     boolean_param("cmos-rtc-probe", cmos_rtc_probe);
 
+    if ( likely(!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC)) )
+        cmos_rtc_probe = false;
+
+    if ( (!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC) ||
+          cmos_rtc_probe) && read_cmos_time(&rtc, cmos_rtc_probe) )
+        return mktime(rtc.year, rtc.mon, rtc.day, rtc.hour, rtc.min, rtc.sec);
+
     if ( efi_enabled(EFI_RS) )
     {
         unsigned long res = efi_get_time();
 
         if ( res )
             return res;
+
+        panic("Broken EFI_GET_TIME %s\n",
+              !cmos_rtc_probe ? "try booting with \"cmos-rtc-probe\" option"
+                              : "and no CMOS RTC found");
     }
 
-    if ( likely(!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC)) )
-        cmos_rtc_probe = false;
-    else if ( system_state < SYS_STATE_smp_boot && !cmos_rtc_probe )
+    /*
+     * No viable clock source found.  Attempt to provide some guidance to the
+     * user about possible workarounds to boot Xen on the system.
+     */
+    ASSERT(system_state < SYS_STATE_smp_boot);
+
+    if ( !cmos_rtc_probe )
         panic("System with no CMOS RTC advertised must be booted from EFI"
               " (or with command line option \"cmos-rtc-probe\")\n");
 
-    if ( unlikely(!read_cmos_time(&rtc, cmos_rtc_probe)) )
-        panic("No CMOS RTC found - system must be booted from EFI\n");
-
-    return mktime(rtc.year, rtc.mon, rtc.day, rtc.hour, rtc.min, rtc.sec);
+    panic("No CMOS RTC found - system must be booted from EFI\n");
 }
 
 static unsigned int __ro_after_init cmos_alias_mask;
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 09:52:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 09:52:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786339.1195937 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjyJG-0001zg-PP; Fri, 30 Aug 2024 09:52:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786339.1195937; Fri, 30 Aug 2024 09:52:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjyJG-0001yd-Kr; Fri, 30 Aug 2024 09:52:50 +0000
Received: by outflank-mailman (input) for mailman id 786339;
 Fri, 30 Aug 2024 09:52:50 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=oDj5=P5=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sjyJF-0001wc-VH
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 09:52:49 +0000
Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com
 [2a00:1450:4864:20::52f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9d662550-66b5-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 11:52:48 +0200 (CEST)
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5bec4e00978so1717653a12.0
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 02:52:48 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226c6a399sm1745361a12.8.2024.08.30.02.52.46
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Aug 2024 02:52:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9d662550-66b5-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1725011567; x=1725616367; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to;
        bh=VUv2AnrjlmtsO6HtyrpSxryNAtOQVlYXS0leiTHoEDs=;
        b=wPhHJXQpfZxysDs86M1sj3az1obft2YRwMvGmXEVWcLZJktbo1uFt0yjd9pmHhE8Ow
         bjXPCZhQCNJoz0qfYjhr2WwNmPaVTXYw7or8WtluHKcnHwUcjG5KbY+GK4H1eDNZ5oVh
         g0b5ww1/6hyiXugfFIbfIB2fV9XJdTHag7Y20=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725011567; x=1725616367;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=VUv2AnrjlmtsO6HtyrpSxryNAtOQVlYXS0leiTHoEDs=;
        b=HV+S/E2Nz4Erk5v3Y34DP0PQAdPFPorq1o7DS4zBz07ZvVKxBZ2bVdbJ/68CZTpc+p
         ua7/pzqwKYqAnwRqt9iLT6HiF87fW2bi82ZjJZjpCai4D/qnbsZ1r9o2wSwOYTAVIebp
         45NO3sJ7o4CirPYDRtnbSMhyyHrRjyQWTbrFqX+J+T+6gEczHVe8e3e51FQ+gbODcA8l
         ovZ5RiDIEimUAzR8N+VlFbek1qkdAu6ppn2SZR9wd8pydUlrKqn6tuZtxv8mukS0hDEe
         /RIUWeS9wRFZbeShC2EBsVDaJYuWS/4zdkSBpWYmUmlN5J2gBhN/+lhfUsqq8fIbz2G8
         MIbA==
X-Gm-Message-State: AOJu0Yygw5nAmUXhbiEcPe/bLmC3+tgYoZwlPALIJ4edzf2y8Zb5/yFX
	rZvdNg9gbcqfdbsYS8PnhVai1xhRTCiShNoBreh65+XUOP5gdCTv8DR04Satue5oQ7L+g891mzd
	l
X-Google-Smtp-Source: AGHT+IG90mdLnqMxXpywPpfTEaRFhM+hkLnjtbl1iKjcoL7hGmRpCUtGYyjNmSkHeUjTNfxLqveMBA==
X-Received: by 2002:a05:6402:2791:b0:5be:cfb1:ceb8 with SMTP id 4fb4d7f45d1cf-5c21ed3fd25mr4797240a12.13.1725011567001;
        Fri, 30 Aug 2024 02:52:47 -0700 (PDT)
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v2 1/2] x86/time: split CMOS time fetching into wrapper
Date: Fri, 30 Aug 2024 11:52:19 +0200
Message-ID: <20240830095220.49473-2-roger.pau@citrix.com>
X-Mailer: git-send-email 2.46.0
In-Reply-To: <20240830095220.49473-1-roger.pau@citrix.com>
References: <20240830095220.49473-1-roger.pau@citrix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Split the logic that deals with probing and fetching the CMOS time into a
separate helper.  While moving the code also take the opportunity to reduce the
scope of some local variables.

No functional change intended.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v1:
 - New in this version.
---
 xen/arch/x86/time.c | 72 +++++++++++++++++++++++++--------------------
 1 file changed, 40 insertions(+), 32 deletions(-)

diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index a97d78484105..272ca2468ea6 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1245,29 +1245,14 @@ static void __get_cmos_time(struct rtc_time *rtc)
         rtc->year += 100;
 }
 
-static unsigned long get_cmos_time(void)
+/* Returns true when fetching time from CMOS is successful. */
+static bool read_cmos_time(struct rtc_time *rtc, bool cmos_rtc_probe)
 {
-    unsigned long res, flags;
-    struct rtc_time rtc;
     unsigned int seconds = 60;
-    static bool __read_mostly cmos_rtc_probe;
-    boolean_param("cmos-rtc-probe", cmos_rtc_probe);
-
-    if ( efi_enabled(EFI_RS) )
-    {
-        res = efi_get_time();
-        if ( res )
-            return res;
-    }
-
-    if ( likely(!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC)) )
-        cmos_rtc_probe = false;
-    else if ( system_state < SYS_STATE_smp_boot && !cmos_rtc_probe )
-        panic("System with no CMOS RTC advertised must be booted from EFI"
-              " (or with command line option \"cmos-rtc-probe\")\n");
 
     for ( ; ; )
     {
+        unsigned long flags;
         s_time_t start, t1, t2;
 
         spin_lock_irqsave(&rtc_lock, flags);
@@ -1285,33 +1270,56 @@ static unsigned long get_cmos_time(void)
         } while ( (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP) &&
                   t2 < MILLISECS(3) );
 
-        __get_cmos_time(&rtc);
+        __get_cmos_time(rtc);
 
         spin_unlock_irqrestore(&rtc_lock, flags);
 
-        if ( likely(!cmos_rtc_probe) ||
-             t1 > SECONDS(1) || t2 >= MILLISECS(3) ||
-             rtc.sec >= 60 || rtc.min >= 60 || rtc.hour >= 24 ||
-             !rtc.day || rtc.day > 31 ||
-             !rtc.mon || rtc.mon > 12 )
-            break;
+        if ( likely(!cmos_rtc_probe) )
+            return true;
+
+        if ( t1 > SECONDS(1) || t2 >= MILLISECS(3) ||
+             rtc->sec >= 60 || rtc->min >= 60 || rtc->hour >= 24 ||
+             !rtc->day || rtc->day > 31 ||
+             !rtc->mon || rtc->mon > 12 )
+            return false;
 
         if ( seconds < 60 )
         {
-            if ( rtc.sec != seconds )
-            {
-                cmos_rtc_probe = false;
+            if ( rtc->sec != seconds )
                 acpi_gbl_FADT.boot_flags &= ~ACPI_FADT_NO_CMOS_RTC;
-            }
-            break;
+            return true;
         }
 
         process_pending_softirqs();
 
-        seconds = rtc.sec;
+        seconds = rtc->sec;
     }
 
-    if ( unlikely(cmos_rtc_probe) )
+    ASSERT_UNREACHABLE();
+    return false;
+}
+
+static unsigned long get_cmos_time(void)
+{
+    struct rtc_time rtc;
+    static bool __read_mostly cmos_rtc_probe;
+    boolean_param("cmos-rtc-probe", cmos_rtc_probe);
+
+    if ( efi_enabled(EFI_RS) )
+    {
+        unsigned long res = efi_get_time();
+
+        if ( res )
+            return res;
+    }
+
+    if ( likely(!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC)) )
+        cmos_rtc_probe = false;
+    else if ( system_state < SYS_STATE_smp_boot && !cmos_rtc_probe )
+        panic("System with no CMOS RTC advertised must be booted from EFI"
+              " (or with command line option \"cmos-rtc-probe\")\n");
+
+    if ( unlikely(!read_cmos_time(&rtc, cmos_rtc_probe)) )
         panic("No CMOS RTC found - system must be booted from EFI\n");
 
     return mktime(rtc.year, rtc.mon, rtc.day, rtc.hour, rtc.min, rtc.sec);
-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 09:52:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 09:52:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786338.1195932 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjyJG-0001wp-Gm; Fri, 30 Aug 2024 09:52:50 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786338.1195932; Fri, 30 Aug 2024 09:52:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjyJG-0001wi-E3; Fri, 30 Aug 2024 09:52:50 +0000
Received: by outflank-mailman (input) for mailman id 786338;
 Fri, 30 Aug 2024 09:52: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=oDj5=P5=cloud.com=roger.pau@srs-se1.protection.inumbo.net>)
 id 1sjyJF-0001wW-Dt
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 09:52:49 +0000
Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com
 [2a00:1450:4864:20::52a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 9c87c29e-66b5-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 11:52:47 +0200 (CEST)
Received: by mail-ed1-x52a.google.com with SMTP id
 4fb4d7f45d1cf-5c0abaae174so1740211a12.1
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 02:52:47 -0700 (PDT)
Received: from localhost ([213.195.124.163]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226c7c3a8sm1744327a12.49.2024.08.30.02.52.45
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Aug 2024 02:52:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9c87c29e-66b5-11ef-99a1-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1725011566; x=1725616366; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=WQgY1SyYX8MA+74lGCoRJr6I7F44MZ2RJqqmsaAqQFU=;
        b=n3t2cVzXGde7tT8pVoi9Csr9RL8PWF+c1Rre6EIvxsFtnolBvbynp1GTakkd8XN+O1
         ZFI/0HBMiRpsWj3uJqkA4bLPqVkwTDaSTr+w3tLBJ0qO87R/yOrV+IW3oIIt+x+pDfXQ
         YbCThFE8HzUsEEQa4n/q5TVL4hEUbWBNTFJdY=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725011566; x=1725616366;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=WQgY1SyYX8MA+74lGCoRJr6I7F44MZ2RJqqmsaAqQFU=;
        b=uvgc1SL/2i/eFztm1YMnoCPI2uJL18GRze47yfoLJXB+kc6bZ/jkR4jiz0g4YIloj6
         YP0/zjZTj2GPuzSw3l9jixsKDGYywvUHJ5mImdaRJ7qYhR7kuAFqZnHC0uI3gz+bMK8E
         1LGmHe+PRGvlpxvFcnwk7/CvhVW4couWOMXnktU9f/uizyARGAOoR+HZznnEIX4mXVrL
         2XPYgbiQDX6qcuzJbCe/a3+wg3O7FlNChDCAqhx9J9DytZG9aLO+WgfO5sL+ofp83G3w
         ycBL/CbEE6banvS1ZqtWdj/xHBnqKuZ1dVZdNMHSMTFKZhs2VjWajaWGTtBYARjvMHyU
         Zd0Q==
X-Gm-Message-State: AOJu0Yy7BKsxuaqCWcScoQz7/oAud5/mnbNFiYwZMv4SRi1JKyI0jrQ0
	PAoK9TuO9eRFHRF0uMiu3UiI+whnsMyiZYJ21FGAiYbvMpheGO+midnIZT0Kf4eOCmGrgMbmSq7
	o
X-Google-Smtp-Source: AGHT+IHUugu43YpkATjhrFqbJPq8Av3kIaXYJLWh2s4PKvc25daKnFMmsRASM0TvHgcU/K2wCGkGMg==
X-Received: by 2002:a05:6402:34d6:b0:5be:dbbb:2d49 with SMTP id 4fb4d7f45d1cf-5c21ed311d4mr4561645a12.1.1725011565863;
        Fri, 30 Aug 2024 02:52:45 -0700 (PDT)
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	=?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= <marmarek@invisiblethingslab.com>,
	Roger Pau Monne <roger.pau@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [PATCH v2 0/2] x86/time: prefer CMOS over EFI_GET_TIME
Date: Fri, 30 Aug 2024 11:52:18 +0200
Message-ID: <20240830095220.49473-1-roger.pau@citrix.com>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Hello,

Workaround a common issue with x86 EFI implementations having broken
EFI_GET_TIME methods, and only resort to EFI_GET_TIME if CMOS is not
available.

First patch splits some of the CMOS probe and fetch logic into a
separate helper, so that patch 2 that actually performs the ordering
change is cleaner.

Thanks, Roger.

Roger Pau Monne (2):
  x86/time: split CMOS time fetching into wrapper
  x86/time: prefer CMOS over EFI_GET_TIME

 xen/arch/x86/time.c | 88 +++++++++++++++++++++++++++------------------
 1 file changed, 54 insertions(+), 34 deletions(-)

-- 
2.46.0



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 09:55:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 09:55:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786351.1195961 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjyLm-0003bu-FA; Fri, 30 Aug 2024 09:55:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786351.1195961; Fri, 30 Aug 2024 09:55:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjyLm-0003bn-Bv; Fri, 30 Aug 2024 09:55:26 +0000
Received: by outflank-mailman (input) for mailman id 786351;
 Fri, 30 Aug 2024 09:55:24 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjyLk-0003bd-E3; Fri, 30 Aug 2024 09:55:24 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjyLk-0001rs-8d; Fri, 30 Aug 2024 09:55:24 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjyLj-0004pu-R7; Fri, 30 Aug 2024 09:55:23 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjyLj-00087T-Qa; Fri, 30 Aug 2024 09:55:23 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=lUnYh23p5Vc4IVYFWuKENiucKRQTJydCX9W9rVYZbBM=; b=hJ+cwwpWF3gMi1CCaixgKwFJ9s
	pWOO5mD2ksm1wx1nPv8O4WrBsYaXtgzyDrwso6F4ZgwvsSAvOmnTj1aFJWJ4MRkH5zInolmuFteos
	Gx3J50kbLjnb2PV+Ft27Z12Q/LW2FdSDjAOeT17vJ4JLIPEWw3nhaB4BtjmESrq64QOo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187418-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187418: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=0a6d41ba0a080ff40620ff304fa9c99bb2874570
X-Osstest-Versions-That:
    ovmf=391666da2c1dc5671bbb3393079d86f46e3435af
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 09:55:23 +0000

flight 187418 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187418/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 0a6d41ba0a080ff40620ff304fa9c99bb2874570
baseline version:
 ovmf                 391666da2c1dc5671bbb3393079d86f46e3435af

Last test of basis   187416  2024-08-30 05:41:39 Z    0 days
Testing same since   187418  2024-08-30 08:13:30 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Ard Biesheuvel <ardb@kernel.org>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   391666da2c..0a6d41ba0a  0a6d41ba0a080ff40620ff304fa9c99bb2874570 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 11:01:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 11:01:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786377.1195972 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjzNn-0000SV-Vo; Fri, 30 Aug 2024 11:01:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786377.1195972; Fri, 30 Aug 2024 11:01:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjzNn-0000SO-TC; Fri, 30 Aug 2024 11:01:35 +0000
Received: by outflank-mailman (input) for mailman id 786377;
 Fri, 30 Aug 2024 11:01:34 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=A2j7=P5=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sjzNm-0000SI-LM
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 11:01:34 +0000
Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com
 [2a00:1450:4864:20::136])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 368f4988-66bf-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 13:01:33 +0200 (CEST)
Received: by mail-lf1-x136.google.com with SMTP id
 2adb3069b0e04-533461323cdso2065485e87.2
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 04:01:31 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5354079baecsm558005e87.22.2024.08.30.04.01.29
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Aug 2024 04:01:29 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 368f4988-66bf-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1725015691; x=1725620491; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=pBP9+S7Q1AknDRCFY+I9YRkS7F+HlIlzAXv9VwJ1NXM=;
        b=UjAiQqDhGB5eFOMhIYGRf9qoVuLHSWCtLHCLozq3XLbjy5FivhH5ZUOukXFRRzNd+u
         SnL/GeeV6qs6KmJLqRMHMV8S9GxlO7BOeTdA2u0I7iLdiWVcGlyMRGNdAz8xuhVwktGz
         HiQkSy3SQpD0srWh7eH8aixp6lawSgO3T/lnkjZn6CMREsjyxz6awyP5iUQ3GoYyr4cE
         eDtKtO4NFPouKA/URnjf7zrddvXlj0vRxaXwDq7zAsQXcdHg9gFMzaQ9eDJ4QiXxbGYm
         BUYcUR42P4927uqQlEHdnM5TOnnT25oQFJjc8Yp0nmnXBZBsiJ6V2dNNimiiclMuUIOM
         IjRQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725015691; x=1725620491;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=pBP9+S7Q1AknDRCFY+I9YRkS7F+HlIlzAXv9VwJ1NXM=;
        b=qBsifqC/aXV3V89poOl5Bmi/mj9UR1xsUsRyzS5MLR7bb+E2Bpat00Ogdq+zsaMbXa
         e4VJo298FS0JtbaILx9RDUUdvgwV706z9GH4jC0JhjoykBYFcWzcL8Uvuk1XUJV+eQCY
         qzcyBqNql6l/dBD19IxMbc1mdrUsfzrqB89zJLJVieH00XRGWKnOyVoreuBzcwKYzXmU
         B0JyNq3XkT+fcip/zxPJVjRVORfbUhYd7yswtKsXBtNxcptf92SnhW+0aeiBfI6WW23Y
         FYDAzKbMVFAqucQ90IPNUD927DCK9tDgloJyXBikkgGBR1nU44cF05Te/SRdVqyJDVRx
         rdwA==
X-Forwarded-Encrypted: i=1; AJvYcCVuz5bgoyvIqGIjdCjtjQDkg9njSha9ekzyE351OBbJ7zSROdCB65FRqTzDCJ4OTpIt8/DrpJHIUx4=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy1JcmApkPIuKdriZN7JGGOGK6pk9TJfUw19jku7NXDel8h1CTa
	bHBNTXKT6EtxEzDTukMD8f/c98oRu3bO+u1rrAZU59UxHXfsaPMo
X-Google-Smtp-Source: AGHT+IF5whGjH4AJTJi4FghPoy4AwaC29yXOY9E7QIcqmnJDtkQ5vfobnTUNREGu/qU+8QTrSnNsoA==
X-Received: by 2002:a05:6512:3d0f:b0:533:46de:30a0 with SMTP id 2adb3069b0e04-53546b9c0cemr1218980e87.54.1725015689834;
        Fri, 30 Aug 2024 04:01:29 -0700 (PDT)
Message-ID: <f995bf0772edf69ba20c873c8056ab248a1cdd6f.camel@gmail.com>
Subject: Re: [PATCH v5 2/7] xen/riscv: set up fixmap mappings
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Fri, 30 Aug 2024 13:01:28 +0200
In-Reply-To: <3705f296-3b79-4bad-9bbc-0b86aaa41314@suse.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
	 <57e892d5b2c526dd44b68d4976796a25c0feca20.1724256027.git.oleksii.kurochko@gmail.com>
	 <4b9cfa7e-546a-4dbb-a3de-4267849be13a@suse.com>
	 <9210aa20ebe892b9866309a7531398d446d0eef5.camel@gmail.com>
	 <3705f296-3b79-4bad-9bbc-0b86aaa41314@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.4 (3.52.4-1.fc40app2) 
MIME-Version: 1.0

On Wed, 2024-08-28 at 12:44 +0200, Jan Beulich wrote:
> On 28.08.2024 11:53, oleksii.kurochko@gmail.com=C2=A0wrote:
> > On Tue, 2024-08-27 at 12:29 +0200, Jan Beulich wrote:
> > > >=20
> > > > +
> > > > +/*
> > > > + * Direct access to xen_fixmap[] should only happen when {set,
> > > > + * clear}_fixmap() is unusable (e.g. where we would end up to
> > > > + * recursively call the helpers).
> > > > + */
> > > > +extern pte_t xen_fixmap[];
> > >=20
> > > I'm afraid I keep being irritated by the comment: What recursive
> > > use
> > > of
> > > helpers is being talked about here? I can't see anything
> > > recursive in
> > > this
> > > patch. If this starts happening with a subsequent patch, then you
> > > have
> > > two options: Move the declaration + comment there, or clarify in
> > > the
> > > description (in enough detail) what this is about.
We can't move declaration of xen_fixmap[] to the patch where
set_fixmap() will be introduced ( which uses PMAP for domain map page
infrastructure ) as xen_fixmap[] is used in the current patch.

And we can't properly provide the proper description with the function
which will be introduced one day in the future ( what can be not good
too ). I came up with the following description in the comment above
xen_fixmap[] declaration:
   /*
    * Direct access to xen_fixmap[] should only happen when {set,
    * clear}_fixmap() is unusable (e.g. where we would end up to
    * recursively call the helpers).
    *=20
    * One such case is pmap_map() where set_fixmap() can not be used.
    * It happens because PMAP is used when the domain map page
   infrastructure
    * is not yet initialized, so map_pages_to_xen() called by
   set_fixmap() needs
    * to map pages on demand, which then calls pmap() again, resulting
   in a loop.
    * Modification of the PTEs directly instead in arch_pmap_map().
    * The same is true for pmap_unmap().
    */

Could it be an option just to drop the comment for now at all as at the
moment there is no such restriction with the usage of
{set,clear}_fixmap() and xen_fixmap[]?

> > This comment is added because of:
> > ```
> > void *__init pmap_map(mfn_t mfn)
> > =C2=A0 ...
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /*
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * We cannot use set_fixmap()=
 here. We use PMAP when the
> > domain map
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * page infrastructure is not=
 yet initialized, so
> > =C2=A0=C2=A0 map_pages_to_xen() called
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * by set_fixmap() needs to m=
ap pages on demand, which then
> > calls
> > =C2=A0=C2=A0 pmap()
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * again, resulting in a loop=
. Modify the PTEs directly
> > instead.
> > =C2=A0=C2=A0 The same
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * is true for pmap_unmap().
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 arch_pmap_map(slot, mfn);
> > =C2=A0=C2=A0 ...
> > ```
> > And it happens because set_fixmap() could be defined using generic
> > PT
> > helpers
>=20
> As you say - could be. If I'm not mistaken no set_fixmap()
> implementation
> exists even by the end of the series. Fundamentally I'd expect
> set_fixmap()
> to (possibly) use xen_fixmap[] directly. That in turn ...
>=20
> > so what will lead to recursive behaviour when when there is no
> > direct map:
>=20
> ... would mean no recursion afaict. Hence why clarification is needed
> as
> to what's going on here _and_ what's planned.
Yes, it is true. No recursion will happen in this case but if to look
at the implementation of set_fixmap() for other Arm or x86 ( but I am
not sure that x86 uses PMAP inside map_pages_to_xen() ) they are using
map_pages_to_xen().

~ Oleksii

>=20
> > =C2=A0=C2=A0 static pte_t *map_table(mfn_t mfn)
> > =C2=A0=C2=A0 {
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /*
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * During early boot, map_dom=
ain_page() may be unusable. Use
> > the
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * PMAP to map temporarily a =
page-table.
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if ( system_state =3D=3D SYS_STATE=
_early_boot )
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return pma=
p_map(mfn);
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ...
> > =C2=A0=C2=A0 }
>=20



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 11:01:54 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 11:01:54 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786378.1195982 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sjzO6-0000kS-7E; Fri, 30 Aug 2024 11:01:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786378.1195982; Fri, 30 Aug 2024 11: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 <xen-devel-bounces@lists.xenproject.org>)
	id 1sjzO6-0000kL-3v; Fri, 30 Aug 2024 11:01:54 +0000
Received: by outflank-mailman (input) for mailman id 786378;
 Fri, 30 Aug 2024 11:01:52 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjzO4-0000k0-UT; Fri, 30 Aug 2024 11:01:52 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjzO4-00031j-Ns; Fri, 30 Aug 2024 11:01:52 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sjzO4-0006Rc-8P; Fri, 30 Aug 2024 11:01:52 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sjzO4-00069U-7t; Fri, 30 Aug 2024 11:01:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=cPwMai4nqSERn6fREcRf6D9XoYI2j0ZM9wBxg7DiAqU=; b=SfIHbgFR9JaYSN3lXmJiKt5U/S
	p6oBbAI0ggYzRgmw/X4kjiwZMdp84/FH+iLaeBiRUaQAnHCKAxnD3aYYXYCj5LNv2Jjyq8k+Z9T1T
	t75hEfHqKqKoy2eHFK9yg5b0+7obs9vsrJkWZivwla9/DHP+6IFvW2nHO3KunXfSah2U=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187417-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187417: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=5e99a40ea54a6bf0bdc18241992866a642d7782b
X-Osstest-Versions-That:
    xen=99f942f3d410059dc223ee0a908827e928ef3592
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 11:01:52 +0000

flight 187417 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187417/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  5e99a40ea54a6bf0bdc18241992866a642d7782b
baseline version:
 xen                  99f942f3d410059dc223ee0a908827e928ef3592

Last test of basis   187400  2024-08-29 09:00:23 Z    1 days
Testing same since   187417  2024-08-30 08:02:18 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Victor Lira <victorm.lira@amd.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   99f942f3d4..5e99a40ea5  5e99a40ea54a6bf0bdc18241992866a642d7782b -> smoke


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 11:55:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 11:55:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786400.1195991 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk0Dp-0001Mp-WB; Fri, 30 Aug 2024 11:55:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786400.1195991; Fri, 30 Aug 2024 11:55:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk0Dp-0001Mi-T9; Fri, 30 Aug 2024 11:55:21 +0000
Received: by outflank-mailman (input) for mailman id 786400;
 Fri, 30 Aug 2024 11:55: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=A2j7=P5=gmail.com=oleksii.kurochko@srs-se1.protection.inumbo.net>)
 id 1sk0Do-0001Mc-C0
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 11:55:20 +0000
Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com
 [2a00:1450:4864:20::12f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ba7f1966-66c6-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 13:55:19 +0200 (CEST)
Received: by mail-lf1-x12f.google.com with SMTP id
 2adb3069b0e04-5353d0b7463so3153159e87.3
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 04:55:19 -0700 (PDT)
Received: from [192.168.219.191] ([94.75.70.14])
 by smtp.gmail.com with ESMTPSA id
 2adb3069b0e04-5354079b8f9sm570988e87.46.2024.08.30.04.55.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Aug 2024 04:55:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ba7f1966-66c6-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1725018918; x=1725623718; darn=lists.xenproject.org;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject
         :date:message-id:reply-to;
        bh=9k8UVcLavTKC4nrsL2A1geBGJEEavOnCyF8T9DdtvvI=;
        b=iQZf/Yq/1nj7YlDhxGCsSIobsmDXyRvNijQ+XNBRjv+dTk2UIsKhoGKiMZ+432pqvl
         ED/brpnhel6zRPsGWQ0rHXZwaTgB5cF9hF3cgMGYOEAQSvLGXh22sOMTK/Vc3oV7CQBa
         DNB2rXjUKkY0eXDOUWc8SzYDtw8SMM80289Bl7CbsE4oM43GK8zeh86gjPyTec7v+j/Y
         g36DOOWD6jC7Q3uxpXdeApCQIxU6aH7SLeBRzRCUKpdAylF4l5mveGf2jKVsKo5rH/DO
         zewStSI8L/yK/58lhS2FZa/0qqv3zGtNSvjvsrHpBcmWheOpUxP5qlbUVUAgiyU8sQWw
         SOKw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725018918; x=1725623718;
        h=mime-version:user-agent:content-transfer-encoding:references
         :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state
         :from:to:cc:subject:date:message-id:reply-to;
        bh=9k8UVcLavTKC4nrsL2A1geBGJEEavOnCyF8T9DdtvvI=;
        b=hC//QVLfSfEAwtQLetnpNBfDcoFjwEfdPi0Z7HP39wh1PrJ0B2JMU5+E9iCKKMactR
         AcF9A3Goe0LoLF8ThLOtgl9FH5iuuV4ojfJYju7lIMwM9pWQRIHvUAOdpxFGnefd1JsJ
         3zTkx0WHW96i80p9dXRo5vshgbP6Cw23j8uH1ibdYiITDIIMUZB02BaaQ45uCmDP5mmi
         eitT7n0H6r9Va3Sov8Q24t92s7hygdQSBWbdDPUVKgAevGj0NS1ulfhAhzHaTDtupMzz
         mXpN1BcSxuhpYYjSUW+d6TPN6cblZAbJ1cjzULwhvMm8w7ZmXc4UA2hUoTZGw2bQ9Al8
         ZoZA==
X-Forwarded-Encrypted: i=1; AJvYcCXEtYgI1gXEp6Q1xi3xyzbzq/Jng3Xg2GgJLcj6pFAyILAp7qM4e2NBeqeJw+KXYdg9ADtUNOM15jk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwVEurcDpdxkcLEkSssPJp95i/UtkR9sEeUWDOnt9AoMek+RYaq
	GmgDMIQOBSGWo0MEz22INA6/54D3cIU2rPPb+lZE5aE/ODEGJ0pj
X-Google-Smtp-Source: AGHT+IG4chFDXvLPshzjo10qcP2LtEdiEvb8DG9ES8uIlOGdKYtsX4nyWcWxRVkaYVNPg35lk12oMg==
X-Received: by 2002:a05:6512:693:b0:533:407f:5cbd with SMTP id 2adb3069b0e04-53546b191ccmr1572070e87.7.1725018917614;
        Fri, 30 Aug 2024 04:55:17 -0700 (PDT)
Message-ID: <66cb014343699b74b2539b61b25e2285092b4aff.camel@gmail.com>
Subject: Re: [PATCH v5 2/7] xen/riscv: set up fixmap mappings
From: oleksii.kurochko@gmail.com
To: Jan Beulich <jbeulich@suse.com>
Cc: Alistair Francis <alistair.francis@wdc.com>, Bob Eshleman
 <bobbyeshleman@gmail.com>, Connor Davis <connojdavis@gmail.com>, Andrew
 Cooper <andrew.cooper3@citrix.com>, Julien Grall <julien@xen.org>, Stefano
 Stabellini <sstabellini@kernel.org>, xen-devel@lists.xenproject.org
Date: Fri, 30 Aug 2024 13:55:16 +0200
In-Reply-To: <4b9cfa7e-546a-4dbb-a3de-4267849be13a@suse.com>
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
	 <57e892d5b2c526dd44b68d4976796a25c0feca20.1724256027.git.oleksii.kurochko@gmail.com>
	 <4b9cfa7e-546a-4dbb-a3de-4267849be13a@suse.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
User-Agent: Evolution 3.52.4 (3.52.4-1.fc40app2) 
MIME-Version: 1.0

On Tue, 2024-08-27 at 12:29 +0200, Jan Beulich wrote:
> > @@ -81,6 +82,18 @@ static inline void flush_page_to_ram(unsigned
> > long mfn, bool sync_icache)
> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BUG_ON("unimplemented");
> > =C2=A0 }
> > =C2=A0=20
> > +/* Write a pagetable entry. */
> > +static inline void write_pte(pte_t *p, pte_t pte)
> > +{
> > +=C2=A0=C2=A0=C2=A0 write_atomic(p, pte);
> > +}
> > +
> > +/* Read a pagetable entry. */
> > +static inline pte_t read_pte(pte_t *p)
> > +{
> > +=C2=A0=C2=A0=C2=A0 return read_atomic(p);
>=20
> This only works because of the strange type trickery you're playing
> in
> read_atomic(). Look at x86 code - there's a strict expectation that
> the
> type can be converted to/from unsigned long. And page table accessors
> are written with that taken into consideration. Same goes for
> write_pte()
> of course, with the respective comment on the earlier patch in mind.
>=20
> Otoh I see that Arm does something very similar. If you have a strong
> need / desire to follow that, then please at least split the two
> entirely separate aspects that patch 1 presently changes both in one
> go.
I am not 100% sure that type trick could be dropped easily for RISC-V:
1. I still need the separate C function for proper #ifdef-ing:
   #ifndef CONFIG_RISCV_32
       case 8: *(uint32_t *)res =3D readq_cpu(p); break;
   #endif
  =20
2. Because of the point 1 the change should be as following:
   -#define read_atomic(p) ({                                   \
   -    union { typeof(*(p)) val; char c[sizeof(*(p))]; } x_;   \
   -    read_atomic_size(p, x_.c, sizeof(*(p)));                \
   -    x_.val;                                                 \
   +#define read_atomic(p) ({                                 \
   +    unsigned long x_;                                     \
   +    read_atomic_size(p, &x_, sizeof(*(p)));               \
   +    (typeof(*(p)))x_;                                     \
    })
   But after that I think it will be an error: "conversion to non-scalar
   type requested" in the last line as *p points to pte_t.
  =20
   and we can't just in read_pte() change to:
   static inline pte_t read_pte(pte_t *p)
   {
       return read_atomic(&p->pte);
   }
   As in this cases it started it will return unsigned long but function
   expects pte_t. As an option read_pte() can be updated to:
   /* Read a pagetable entry. */
   static inline pte_t read_pte(pte_t *p)
   {
       return (pte_t) { .pte =3D read_atomic(&p->pte) };
   }
  =20
   But I am not sure that it is better then just have a union trick inside
   read_atomic() and then just have read_atomic(p) for read_pte().
  =20
   Am I missing something?
  =20
~ Oleksii


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 12:03:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 12:03:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786411.1196002 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk0Kz-0003cB-OV; Fri, 30 Aug 2024 12:02:45 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786411.1196002; Fri, 30 Aug 2024 12:02:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk0Kz-0003c4-Lj; Fri, 30 Aug 2024 12:02:45 +0000
Received: by outflank-mailman (input) for mailman id 786411;
 Fri, 30 Aug 2024 12:02:44 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk0Ky-0003bu-De; Fri, 30 Aug 2024 12:02:44 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk0Kx-0004DR-VV; Fri, 30 Aug 2024 12:02:43 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk0Kx-0007y9-Ft; Fri, 30 Aug 2024 12:02:43 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sk0Kx-0001A0-FP; Fri, 30 Aug 2024 12:02:43 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=ngl2L61OItj3nIr45PAA2oiqLsznJLqZt2dtftAyRwg=; b=zGiTtWiMjftx7MQjgsiX5NtXQF
	6D6fRycHOW/PAiDmR/hMkIXntjpA631jPgb+tL1wTmSiWbccGoIG7nn0XkG1uDmKJIAOB81rUrHAg
	oLGUcCbQJVk9SvuF0JjclBuBLaw5N8EfelFUPltQHyjXxibY0o02WcCRzgddIcb3fHGA=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187419-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187419: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=a63a7dbf85963d0c11617173b117ca9edb645875
X-Osstest-Versions-That:
    ovmf=0a6d41ba0a080ff40620ff304fa9c99bb2874570
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 12:02:43 +0000

flight 187419 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187419/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 a63a7dbf85963d0c11617173b117ca9edb645875
baseline version:
 ovmf                 0a6d41ba0a080ff40620ff304fa9c99bb2874570

Last test of basis   187418  2024-08-30 08:13:30 Z    0 days
Testing same since   187419  2024-08-30 10:15:25 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Ard Biesheuvel <ardb@kernel.org>
  Sami Mujawar <sami.mujawar@arm.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   0a6d41ba0a..a63a7dbf85  a63a7dbf85963d0c11617173b117ca9edb645875 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 12:34:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 12:34:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786426.1196012 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk0pq-0000dJ-0z; Fri, 30 Aug 2024 12:34:38 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786426.1196012; Fri, 30 Aug 2024 12:34:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk0pp-0000dC-TQ; Fri, 30 Aug 2024 12:34:37 +0000
Received: by outflank-mailman (input) for mailman id 786426;
 Fri, 30 Aug 2024 12:34:36 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=q2fe=P5=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sk0pn-0000d6-V9
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 12:34:35 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 36072538-66cc-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 14:34:33 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-58ef19aa69dso1667645a12.3
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 05:34:33 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226c6a445sm1852061a12.11.2024.08.30.05.34.32
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 30 Aug 2024 05:34:32 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 36072538-66cc-11ef-99a1-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1725021273; x=1725626073; 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=8CoqEr+B5m2uk0VUEu3Zy0oIm3v9e/PhpTGOAL5GA0M=;
        b=P9edKPCw0ZxGJnV1XWYKmE6MEKNu6n/GZgIWZgHlkcjrpDlh3QKfovK812KgmdTp6A
         inThqnBRtcI1t6Byh63JkyUTR8UAH5cYqQU7YAQN/V/0Uc1gRLu0CBbF94Gekk6qIxOM
         od3OrXAj9tnoR4dspHuSxi8rZ/mU7GlCGuqLil2/2boJEybF9Vp+ED8JDdICix4deAF/
         nQgqgq1v07cNeXxO615vTxHQ4pkTvLGqPQbNOSKcI1K45FF2qO6ZQUWSWcSZQOes1CaU
         PxgE+j3IJmc+ZxzDjzvi31vmNup9DU9SsdX3gL+CSSnvxQoQ396bxpVShV5NwMBuo63B
         t42A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725021273; x=1725626073;
        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=8CoqEr+B5m2uk0VUEu3Zy0oIm3v9e/PhpTGOAL5GA0M=;
        b=OLxs0ulHDGhOxK8btAiHXEMpto7qfwV/4Puab1DzTxU4WwFrSGBuJErkz3UvcDXWhp
         tUxOucpLoPGh7paWHgb/GjCboLE2hsVQTb24zNkNtlvSyOubNFt3sFLEGUmUEUgrBmbF
         lFH31Qr7SpP2QnhI90FnNMxgdGDsqbnsSVYeA6AJG1RRIDiWoSN6PUM6DTsf18f7+G4p
         QcNk3p3eqjcIA69xCbNChZ8MC6wWlTLdej0RjiMaJDejkaw/JDBqu8uShaWgFsK85d9S
         kEoWjTWeGNUcw4dTPAcK8FWttgXmrOcmxGgYGn1KR9AFceFPIm7x/fiFkT0W1Di68uVl
         ft5A==
X-Forwarded-Encrypted: i=1; AJvYcCVFUWpEmGzrMXUp4LJzmavfsYuqAQzwakMrqek5NZcwdn+Oed+c/5VeJYMwKoOk9AWJptTKaDtuFa8=@lists.xenproject.org
X-Gm-Message-State: AOJu0YxiVu+W0JE+FFTV9Jbfn8ISl0vo3EMIhuIjbgIAEkpXmyWqLSCo
	WeaezQIVxDY+IzeQ9fDZcJZhWyDHznvjBxnlJBK/vv2F0dyMhrRVxmdRVmV4yg==
X-Google-Smtp-Source: AGHT+IFZ+NmdslnP8SEkRSePHnCFW5ZEOA87ZHnhm/pwe0R4SkVoPAY5yIJRqGMMRsIZCNNUsEykGA==
X-Received: by 2002:a05:6402:401f:b0:5c0:ab2d:334c with SMTP id 4fb4d7f45d1cf-5c21eda0c76mr5338117a12.32.1725021273075;
        Fri, 30 Aug 2024 05:34:33 -0700 (PDT)
Message-ID: <fe68201e-96cb-4a4f-811a-1cbcc9090aa7@suse.com>
Date: Fri, 30 Aug 2024 14:34:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 2/7] xen/riscv: set up fixmap mappings
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
 <57e892d5b2c526dd44b68d4976796a25c0feca20.1724256027.git.oleksii.kurochko@gmail.com>
 <4b9cfa7e-546a-4dbb-a3de-4267849be13a@suse.com>
 <66cb014343699b74b2539b61b25e2285092b4aff.camel@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: <66cb014343699b74b2539b61b25e2285092b4aff.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 30.08.2024 13:55, oleksii.kurochko@gmail.com wrote:
> On Tue, 2024-08-27 at 12:29 +0200, Jan Beulich wrote:
>>> @@ -81,6 +82,18 @@ static inline void flush_page_to_ram(unsigned
>>> long mfn, bool sync_icache)
>>>       BUG_ON("unimplemented");
>>>   }
>>>   
>>> +/* Write a pagetable entry. */
>>> +static inline void write_pte(pte_t *p, pte_t pte)
>>> +{
>>> +    write_atomic(p, pte);
>>> +}
>>> +
>>> +/* Read a pagetable entry. */
>>> +static inline pte_t read_pte(pte_t *p)
>>> +{
>>> +    return read_atomic(p);
>>
>> This only works because of the strange type trickery you're playing
>> in
>> read_atomic(). Look at x86 code - there's a strict expectation that
>> the
>> type can be converted to/from unsigned long. And page table accessors
>> are written with that taken into consideration. Same goes for
>> write_pte()
>> of course, with the respective comment on the earlier patch in mind.
>>
>> Otoh I see that Arm does something very similar. If you have a strong
>> need / desire to follow that, then please at least split the two
>> entirely separate aspects that patch 1 presently changes both in one
>> go.
> I am not 100% sure that type trick could be dropped easily for RISC-V:
> 1. I still need the separate C function for proper #ifdef-ing:
>    #ifndef CONFIG_RISCV_32
>        case 8: *(uint32_t *)res = readq_cpu(p); break;
>    #endif
>    
> 2. Because of the point 1 the change should be as following:
>    -#define read_atomic(p) ({                                   \
>    -    union { typeof(*(p)) val; char c[sizeof(*(p))]; } x_;   \
>    -    read_atomic_size(p, x_.c, sizeof(*(p)));                \
>    -    x_.val;                                                 \
>    +#define read_atomic(p) ({                                 \
>    +    unsigned long x_;                                     \
>    +    read_atomic_size(p, &x_, sizeof(*(p)));               \
>    +    (typeof(*(p)))x_;                                     \
>     })
>    But after that I think it will be an error: "conversion to non-scalar
>    type requested" in the last line as *p points to pte_t.
>    
>    and we can't just in read_pte() change to:
>    static inline pte_t read_pte(pte_t *p)
>    {
>        return read_atomic(&p->pte);
>    }
>    As in this cases it started it will return unsigned long but function
>    expects pte_t.

Of course.

> As an option read_pte() can be updated to:
>    /* Read a pagetable entry. */
>    static inline pte_t read_pte(pte_t *p)
>    {
>        return (pte_t) { .pte = read_atomic(&p->pte) };
>    }

That's what's needed.

>    But I am not sure that it is better then just have a union trick inside
>    read_atomic() and then just have read_atomic(p) for read_pte().

It's largely up to you. My main request is that things end up / remain
consistent. Which way round is secondary, and often merely a matter of
suitably justifying the choice made.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 12:35:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 12:35:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786430.1196022 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk0qe-00014g-9p; Fri, 30 Aug 2024 12:35:28 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786430.1196022; Fri, 30 Aug 2024 12:35:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk0qe-00014Z-6k; Fri, 30 Aug 2024 12:35:28 +0000
Received: by outflank-mailman (input) for mailman id 786430;
 Fri, 30 Aug 2024 12:35:27 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YGfl=P5=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sk0qd-0000d6-8k
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 12:35:27 +0000
Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com
 [2a00:1450:4864:20::430])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 54ead3dd-66cc-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 14:35:25 +0200 (CEST)
Received: by mail-wr1-x430.google.com with SMTP id
 ffacd0b85a97d-3718eaf4046so1431209f8f.3
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 05:35:25 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8989215caasm210616266b.189.2024.08.30.05.35.23
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 30 Aug 2024 05:35:24 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 54ead3dd-66cc-11ef-99a1-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1725021325; x=1725626125; 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=Emcs+vKg6FYKCd5rzmcMrTCvOyBwAAqKYRZNok18zXo=;
        b=t+tmnEcdupcNyPgQifQvlBmt6sGWOAdHHr4pYCBkNuxjWoqx1dtAeLgZsvDx7k51p7
         OFeJlbmJUt2YT3ZsMma7EBin3Eh9Fp7h8OhsW6Oa4vgczZdSRugxMeGHwzCxZYwbkovI
         RZQHWd+Ko/iU6Ps++m8xBrjiPNo33nSFzQOVA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725021325; x=1725626125;
        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=Emcs+vKg6FYKCd5rzmcMrTCvOyBwAAqKYRZNok18zXo=;
        b=cnPpyzGTN0iAEUz3BjugH8avX7UVWci2Pl5eE9Y2RbxhczMRVcxUJAEjE/imo2rhCa
         fX/x+VkEW8kiBpQmJUzUuMfCkhtJAFP7F/y6voQbtlDdq5Oj/mS5e6J/rudAlBZm1WcL
         qCPPRjjVP7wuBMO3m5IuNrM9fhK6OZOqDXpW64KL/2DSBQHyYROVjv1k/ud1tcGBHqzB
         6NQInaJ7YP7READGYJm6IWJJmaaY1HfRDTjClJdH2hGs21Be7XP2WRF25DORuyF9NHqI
         /aJHfGWZNig9xgABnv8ZxE/MSS8eZJnWbX+ixrHVIpoK9co01t3hIXFxD2+vZJzCugYC
         rdtw==
X-Forwarded-Encrypted: i=1; AJvYcCUqnvqlcznMdBtP22j8EGJDtnLlgADIwgOEWbxl5jbdb/Bgqv70kPpxOJYsVmNuUfte105DnZKhxfo=@lists.xenproject.org
X-Gm-Message-State: AOJu0YylnMNo7sxEAmX6F1xyZa/8V7neeXnwezzNK1TtMY8gr7Layp8M
	xjd6N/if+gbCiBHXIoRJnMmNew6Chg2MDAj7lBcdTZbs3IsgpLZpkEQT0QS3wzM=
X-Google-Smtp-Source: AGHT+IGEG1w+W7muCwlGwCYkGvSN60v4UaCfhBRnKiu9giThhi9Syz1sJ5idmGQGY+Sj/oM27LfxSw==
X-Received: by 2002:adf:e54a:0:b0:367:dc45:55ab with SMTP id ffacd0b85a97d-3749b544e07mr5052251f8f.25.1725021324547;
        Fri, 30 Aug 2024 05:35:24 -0700 (PDT)
Message-ID: <9a709ffc-d5b3-4caf-bcf9-81073b1f57bb@citrix.com>
Date: Fri, 30 Aug 2024 13:35:22 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/2] automation: use expect utility in xilinx tests
To: victorm.lira@amd.com, xen-devel@lists.xenproject.org
Cc: Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>,
 Stefano Stabellini <sstabellini@kernel.org>,
 Michal Orzel <michal.orzel@amd.com>
References: <cover.1724967614.git.victorm.lira@amd.com>
 <5bbea0bbf22b409dd047b93e2e8cebcab61d14d5.1724967614.git.victorm.lira@amd.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <5bbea0bbf22b409dd047b93e2e8cebcab61d14d5.1724967614.git.victorm.lira@amd.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 29/08/2024 11:34 pm, victorm.lira@amd.com wrote:
> From: Victor Lira <victorm.lira@amd.com>
>
> Fixes: 95764a0817a5 (automation: update xilinx test scripts (tty))
> This patch introduced a CI failure due to a timeout in xilinx-x86_64 test.
>
> Change xilinx-x86_64 and xilinx-arm64 scripts to use "expect" utility
> to determine test result and allow early exit from tests.
> Add "expect" to xilinx container environment (dockerfile).
> Rename references to "QEMU" in "qemu-key.exp" expect script to "TEST" to be
> used by both QEMU and hardware tests.

This is committed now, but just a quick note for the future.  "Fixes:"
is a tag, and it normally lives here just above the SoB.

If you need to refer to it in the commit message, as you do here, then
the normal way is "Commit $sha ("$subject") introduced ..." in a regular
sentence.


> Signed-off-by: Victor Lira <victorm.lira@amd.com>


~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 12:37:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 12:37:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786436.1196031 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk0sW-0002MP-Kn; Fri, 30 Aug 2024 12:37:24 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786436.1196031; Fri, 30 Aug 2024 12:37:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk0sW-0002MI-I3; Fri, 30 Aug 2024 12:37:24 +0000
Received: by outflank-mailman (input) for mailman id 786436;
 Fri, 30 Aug 2024 12:37:23 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <SRS0=q2fe=P5=suse.com=jbeulich@srs-se1.protection.inumbo.net>)
 id 1sk0sV-0002M6-6N
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 12:37:23 +0000
Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com
 [2a00:1450:4864:20::533])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 99e8d336-66cc-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 14:37:21 +0200 (CEST)
Received: by mail-ed1-x533.google.com with SMTP id
 4fb4d7f45d1cf-5bede548f7cso1896205a12.2
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 05:37:21 -0700 (PDT)
Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de.
 [37.24.206.209]) by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89891d7368sm210988566b.168.2024.08.30.05.37.19
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 30 Aug 2024 05:37:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 99e8d336-66cc-11ef-99a1-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=suse.com; s=google; t=1725021441; x=1725626241; 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=6Z0krdLP9NbaqvYjToGU5GHAbSi87Pw4pwu9EzvkbzA=;
        b=XtlDSE2zsG/eh2qTJaIknh0V61WKuC9ZCUSG2/XWBaz2p+IYZzVgH0gOQ8n4ADaqe/
         wzqutdqMGFlPef+M7hghcfch8htaFot5bG3aBxcQOaIpuYOWgxaOqE9ponpRRSRD2rUx
         lqOWZSivDTEMMSvh21ZkDEB53Ak3XOTxP/q322erigjvEfot8J4YmGKuhDysVH5GrTNx
         MtS1TjrsYUJsvNpUQ3f5hMQbPwRc0M6BLcJxp0WkCl5J/h0P5KpNKO5Gj5JYI+QGXDOb
         oegSRfi8cZyQAgR9Pr0cAi0T9ChznOxJ5U/L4W0qBfuUx28H0Rrkq8eBo13kmhYOqUIX
         9pAw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725021441; x=1725626241;
        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=6Z0krdLP9NbaqvYjToGU5GHAbSi87Pw4pwu9EzvkbzA=;
        b=cZe3lTv0/+TpIZ+ikYRSdlkpeqpF9MYXomaNOOEaVSplD7izhdJEpDdgB/yjHQr5Dq
         gYVTdLzSF6mDcgTJfVslPvJEe8xH82LXf4fyF9xOKYnc1uIM+9jqGqV0Kn/NMwHAudCV
         fbF6fbBaYCzWCkAWNKg+zKZe3Z2kkDdtvIXanXJrHROvjjBxTAmWYWGFD+loFebM2mCS
         mjDYaAwtk06Q10HYYEPUnC7mHkIo6jw6LxWqA2YHuj3FD2u32lp9eR8alhhHngB80nNP
         /3kDfoVhLmrakz+ooOxvstpvUMYYEqiwLEbq7pkUZq0yV5SBuShjfPilt9dvcAG0ORBk
         e8sg==
X-Forwarded-Encrypted: i=1; AJvYcCW8CtLRVuqfrDa7Krb7ihhlmn7m3I1E2eCjPOFx12ANvGLy/urcHHPf9ReDpF9Uua25eNsI2uVcWuw=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyqcCSt+ZZn20Ip01mkN2hqSgdW4N0+qXaTKDi/dvZFyAFZL8kq
	3CLKDw5YWXIZBTOAIaX4aiQ/RLiS1cJ5xEhhBrjWWvIhqOppQhX2sPZgt9YWjw==
X-Google-Smtp-Source: AGHT+IEAiGMcRyMLWPb1CdN03i6jjWKfmb9HOjhARkAITCuzoOA7Jzr2L4jODr4+SOaGnQmN3OtPNQ==
X-Received: by 2002:a17:906:c143:b0:a6f:8265:8f2 with SMTP id a640c23a62f3a-a897f8e2fc5mr452205866b.37.1725021440682;
        Fri, 30 Aug 2024 05:37:20 -0700 (PDT)
Message-ID: <8b398d9d-ccaf-4e1f-bedf-6105a8cca914@suse.com>
Date: Fri, 30 Aug 2024 14:37:18 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v5 2/7] xen/riscv: set up fixmap mappings
To: oleksii.kurochko@gmail.com
Cc: Alistair Francis <alistair.francis@wdc.com>,
 Bob Eshleman <bobbyeshleman@gmail.com>, Connor Davis
 <connojdavis@gmail.com>, Andrew Cooper <andrew.cooper3@citrix.com>,
 Julien Grall <julien@xen.org>, Stefano Stabellini <sstabellini@kernel.org>,
 xen-devel@lists.xenproject.org
References: <cover.1724256026.git.oleksii.kurochko@gmail.com>
 <57e892d5b2c526dd44b68d4976796a25c0feca20.1724256027.git.oleksii.kurochko@gmail.com>
 <4b9cfa7e-546a-4dbb-a3de-4267849be13a@suse.com>
 <9210aa20ebe892b9866309a7531398d446d0eef5.camel@gmail.com>
 <3705f296-3b79-4bad-9bbc-0b86aaa41314@suse.com>
 <f995bf0772edf69ba20c873c8056ab248a1cdd6f.camel@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: <f995bf0772edf69ba20c873c8056ab248a1cdd6f.camel@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 30.08.2024 13:01, oleksii.kurochko@gmail.com wrote:
> On Wed, 2024-08-28 at 12:44 +0200, Jan Beulich wrote:
>> On 28.08.2024 11:53, oleksii.kurochko@gmail.com wrote:
>>> On Tue, 2024-08-27 at 12:29 +0200, Jan Beulich wrote:
>>>>>
>>>>> +
>>>>> +/*
>>>>> + * Direct access to xen_fixmap[] should only happen when {set,
>>>>> + * clear}_fixmap() is unusable (e.g. where we would end up to
>>>>> + * recursively call the helpers).
>>>>> + */
>>>>> +extern pte_t xen_fixmap[];
>>>>
>>>> I'm afraid I keep being irritated by the comment: What recursive
>>>> use
>>>> of
>>>> helpers is being talked about here? I can't see anything
>>>> recursive in
>>>> this
>>>> patch. If this starts happening with a subsequent patch, then you
>>>> have
>>>> two options: Move the declaration + comment there, or clarify in
>>>> the
>>>> description (in enough detail) what this is about.
> We can't move declaration of xen_fixmap[] to the patch where
> set_fixmap() will be introduced ( which uses PMAP for domain map page
> infrastructure ) as xen_fixmap[] is used in the current patch.
> 
> And we can't properly provide the proper description with the function
> which will be introduced one day in the future ( what can be not good
> too ). I came up with the following description in the comment above
> xen_fixmap[] declaration:
>    /*
>     * Direct access to xen_fixmap[] should only happen when {set,
>     * clear}_fixmap() is unusable (e.g. where we would end up to
>     * recursively call the helpers).
>     * 
>     * One such case is pmap_map() where set_fixmap() can not be used.
>     * It happens because PMAP is used when the domain map page
>    infrastructure
>     * is not yet initialized, so map_pages_to_xen() called by
>    set_fixmap() needs
>     * to map pages on demand, which then calls pmap() again, resulting
>    in a loop.
>     * Modification of the PTEs directly instead in arch_pmap_map().
>     * The same is true for pmap_unmap().
>     */
> 
> Could it be an option just to drop the comment for now at all as at the
> moment there is no such restriction with the usage of
> {set,clear}_fixmap() and xen_fixmap[]?

The comment isn't the right place to explain things here, imo. It's the
patch description where unexpected aspects need shedding light on.

>>> This comment is added because of:
>>> ```
>>> void *__init pmap_map(mfn_t mfn)
>>>   ...
>>>        /*
>>>         * We cannot use set_fixmap() here. We use PMAP when the
>>> domain map
>>>         * page infrastructure is not yet initialized, so
>>>    map_pages_to_xen() called
>>>         * by set_fixmap() needs to map pages on demand, which then
>>> calls
>>>    pmap()
>>>         * again, resulting in a loop. Modify the PTEs directly
>>> instead.
>>>    The same
>>>         * is true for pmap_unmap().
>>>         */
>>>        arch_pmap_map(slot, mfn);
>>>    ...
>>> ```
>>> And it happens because set_fixmap() could be defined using generic
>>> PT
>>> helpers
>>
>> As you say - could be. If I'm not mistaken no set_fixmap()
>> implementation
>> exists even by the end of the series. Fundamentally I'd expect
>> set_fixmap()
>> to (possibly) use xen_fixmap[] directly. That in turn ...
>>
>>> so what will lead to recursive behaviour when when there is no
>>> direct map:
>>
>> ... would mean no recursion afaict. Hence why clarification is needed
>> as
>> to what's going on here _and_ what's planned.
> Yes, it is true. No recursion will happen in this case but if to look
> at the implementation of set_fixmap() for other Arm or x86 ( but I am
> not sure that x86 uses PMAP inside map_pages_to_xen() ) they are using
> map_pages_to_xen().

There's no PMAP so far on x86.

Jan


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 13:43:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 13:43:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786459.1196044 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk1u1-0005jo-EL; Fri, 30 Aug 2024 13:43:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786459.1196044; Fri, 30 Aug 2024 13:43:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk1u1-0005jh-An; Fri, 30 Aug 2024 13:43:01 +0000
Received: by outflank-mailman (input) for mailman id 786459;
 Fri, 30 Aug 2024 13:42:59 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk1tz-0005jX-JF; Fri, 30 Aug 2024 13:42:59 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk1tz-0005oY-C5; Fri, 30 Aug 2024 13:42:59 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk1tz-0001zW-3i; Fri, 30 Aug 2024 13:42:59 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sk1tz-0002h3-3J; Fri, 30 Aug 2024 13:42:59 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=4psqGSEK+5RxWSoCbvsOvj8QaZFjvkI4NpDb3u8zQ9M=; b=x0Kn2yadYCX3JdqbajesOs5cyO
	9RSTwSwlWEMSVJtk/s/euZxqo3bF4vDuw6ZWACSznMiRft5r7rvhhsuHsiatlj+qbiLYjfXr0VUk4
	wDUmhb/fJDMpDItWOL1ygvqhJTyoWIu9AxfNagiSkfdRwDtPF18D4ouhAYjYg6VVG7s0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187420-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187420: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=f31aa47deea9239d61b41fda8d445ecf607fcef9
X-Osstest-Versions-That:
    ovmf=a63a7dbf85963d0c11617173b117ca9edb645875
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 13:42:59 +0000

flight 187420 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187420/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 f31aa47deea9239d61b41fda8d445ecf607fcef9
baseline version:
 ovmf                 a63a7dbf85963d0c11617173b117ca9edb645875

Last test of basis   187419  2024-08-30 10:15:25 Z    0 days
Testing same since   187420  2024-08-30 12:14:59 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Fish <afish@apple.com>
  Xiaoqiang Zhang <xiaoqiang.zhang@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   a63a7dbf85..f31aa47dee  f31aa47deea9239d61b41fda8d445ecf607fcef9 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 15:35:28 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 15:35:28 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786496.1196055 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk3eZ-00072Q-3w; Fri, 30 Aug 2024 15:35:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786496.1196055; Fri, 30 Aug 2024 15:35:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk3eZ-00072J-0b; Fri, 30 Aug 2024 15:35:11 +0000
Received: by outflank-mailman (input) for mailman id 786496;
 Fri, 30 Aug 2024 15:35:09 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=X2Xk=P5=cloud.com=christian.lindig@srs-se1.protection.inumbo.net>)
 id 1sk3eX-00072D-AH
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 15:35:09 +0000
Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com
 [2a00:1450:4864:20::52f])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 6fdf721d-66e5-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 17:35:08 +0200 (CEST)
Received: by mail-ed1-x52f.google.com with SMTP id
 4fb4d7f45d1cf-5c210e23651so2145995a12.3
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 08:35:08 -0700 (PDT)
Received: from smtpclient.apple ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 4fb4d7f45d1cf-5c226ce54dbsm2130516a12.90.2024.08.30.08.35.06
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Fri, 30 Aug 2024 08:35:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 6fdf721d-66e5-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=cloud.com; s=cloud; t=1725032108; x=1725636908; darn=lists.xenproject.org;
        h=to:references:message-id:content-transfer-encoding:cc:date
         :in-reply-to:from:subject:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=8UXBlXWH+S8PPSMlgkp60n/fC/Ac2whA4zgV7WSDV3w=;
        b=lBrDkhJJRfZYgq0WTC3io6yTx8j+GEjEBmnEj5iFd1pW5uYjVRbtjn8kWZ0MxbGhXJ
         Zciqct4XyhhMd0mpul74MmZdAYDDxh/MQwCzOYriOL0KQhVFsdJWI/FYYPW6/X1vWEgQ
         QYETJHn2AOUZLYiKbvIPqtn4oqy8Hsf1wBL9o=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725032108; x=1725636908;
        h=to:references:message-id:content-transfer-encoding:cc:date
         :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=8UXBlXWH+S8PPSMlgkp60n/fC/Ac2whA4zgV7WSDV3w=;
        b=WYMGe+48Oen0zAshOrQumaUSINjtSGFvVdCSOLRRWZE3EqYmltsup2B9j5uXNUDDz8
         6j8Dg6GN5fCjGcR7+EDw9PhzuB9qN7NulYnduvGKVjprdlqWd4XkvPAqqNHSiwoTdwDK
         pHRSI/8cVpCGMstD5terOX7XVOBLm5drB8wgRBqSeuuK1B3aOblfJnknuhDZcaX5rYHm
         lsd+eEJYgI7KGVymmhL2RiVNt3aeVmiuWF4EMsgxnXbhhQOjpFP/76f8eV6Ycy9C8cin
         CW93ug0xXv3nWCYzEFsjWD5FzSX8baV5zV3/4Upy2ifiSHy54jLzNaC+fgtXWdxqaj3N
         Y//w==
X-Gm-Message-State: AOJu0Yxt7wojBcCQRYnG3YOK+0wuYyeri0o1bcTG9VjgkHT/ayNMXqCo
	vaxUlOYH+FE+3rUTkwuzGIJ4KZsnCJdlTmdPzBqhsJJxkVMph09VKDOAiuLK8yw=
X-Google-Smtp-Source: AGHT+IGINzFEEgcqW5B1LFTx9AwAOcBiA1nutISsEOqs/y8cqOYYcFkvZqZpV0HAwSklYI5+9MdOZA==
X-Received: by 2002:a05:6402:40c8:b0:5c2:1298:35ee with SMTP id 4fb4d7f45d1cf-5c21ed33fe2mr5853149a12.2.1725032107074;
        Fri, 30 Aug 2024 08:35:07 -0700 (PDT)
Content-Type: text/plain;
	charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\))
Subject: Re: [PATCH] tools/ocaml: Factor out compatiblity handling
From: Christian Lindig <christian.lindig@cloud.com>
In-Reply-To: <20240828133033.2378322-1-andrew.cooper3@citrix.com>
Date: Fri, 30 Aug 2024 16:34:54 +0100
Cc: Xen-devel <xen-devel@lists.xenproject.org>,
 Christian Lindig <christian.lindig@citrix.com>,
 David Scott <dave@recoil.org>,
 =?utf-8?B?RWR3aW4gVMO2csO2aw==?= <edwin.torok@cloud.com>,
 Rob Hoes <Rob.Hoes@citrix.com>,
 Andrii Sultanov <andrii.sultanov@cloud.com>
Content-Transfer-Encoding: quoted-printable
Message-Id: <8A3B017E-662B-46C3-9105-353F2D060006@cloud.com>
References: <20240828133033.2378322-1-andrew.cooper3@citrix.com>
To: Andrew Cooper <Andrew.Cooper3@citrix.com>
X-Mailer: Apple Mail (2.3774.600.62)



> On 28 Aug 2024, at 14:30, Andrew Cooper <Andrew.Cooper3@citrix.com> =
wrote:
>=20
> ... rather than having each library implement its own subset.
>=20
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Christian Lindig <christian.lindig@citrix.com>
> CC: David Scott <dave@recoil.org>
> CC: Edwin T=C3=B6r=C3=B6k <edwin.torok@cloud.com>
> CC: Rob Hoes <Rob.Hoes@citrix.com>
> CC: Andrii Sultanov <andrii.sultanov@cloud.com>
>=20
> Broken out of a larger series, to help Andrii with his dynlib work.
> ---
> tools/ocaml/libs/xc/Makefile        |  2 +-
> tools/ocaml/libs/xc/xenctrl_stubs.c | 13 +++----------
> tools/ocaml/libs/xen-caml-compat.h  | 23 +++++++++++++++++++++++
> 3 files changed, 27 insertions(+), 11 deletions(-)
> create mode 100644 tools/ocaml/libs/xen-caml-compat.h
>=20
> diff --git a/tools/ocaml/libs/xc/Makefile =
b/tools/ocaml/libs/xc/Makefile
> index 1d9fecb06ef2..cdf4d01dac52 100644
> --- a/tools/ocaml/libs/xc/Makefile
> +++ b/tools/ocaml/libs/xc/Makefile
> @@ -2,7 +2,7 @@ OCAML_TOPLEVEL=3D$(CURDIR)/../..
> XEN_ROOT=3D$(OCAML_TOPLEVEL)/../..
> include $(OCAML_TOPLEVEL)/common.make
>=20
> -CFLAGS +=3D -I../mmap $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest)
> +CFLAGS +=3D -I../ -I../mmap $(CFLAGS_libxenctrl) =
$(CFLAGS_libxenguest)
> CFLAGS +=3D $(APPEND_CFLAGS)
> OCAMLINCLUDE +=3D -I ../mmap -I ../eventchn
>=20
> diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c =
b/tools/ocaml/libs/xc/xenctrl_stubs.c
> index a52908012960..c78191f95abc 100644
> --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
> +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
> @@ -25,6 +25,8 @@
> #include <caml/fail.h>
> #include <caml/callback.h>
>=20
> +#include "xen-caml-compat.h"
> +
> #include <sys/mman.h>
> #include <stdint.h>
> #include <string.h>
> @@ -37,14 +39,6 @@
>=20
> #include "mmap_stubs.h"
>=20
> -#ifndef Val_none
> -#define Val_none (Val_int(0))
> -#endif
> -
> -#ifndef Tag_some
> -#define Tag_some 0
> -#endif
> -
> static inline xc_interface *xch_of_val(value v)
> {
> xc_interface *xch =3D *(xc_interface **)Data_custom_val(v);
> @@ -744,8 +738,7 @@ CAMLprim value stub_xc_evtchn_status(value =
xch_val, value domid, value port)
> Store_field(result_status, 0, Val_int(status.vcpu));
> Store_field(result_status, 1, stat);
>=20
> - result =3D caml_alloc_small(1, Tag_some);
> - Store_field(result, 0, result_status);
> + result =3D caml_alloc_some(result_status);
>=20
> CAMLreturn(result);
> }
> diff --git a/tools/ocaml/libs/xen-caml-compat.h =
b/tools/ocaml/libs/xen-caml-compat.h
> new file mode 100644
> index 000000000000..b4a0ca4ce90c
> --- /dev/null
> +++ b/tools/ocaml/libs/xen-caml-compat.h
> @@ -0,0 +1,23 @@
> +/* SPDX-License-Identifier: LGPL-2.1-only WITH =
OCaml-LGPL-linking-exception */
> +#ifndef XEN_CAML_COMPAT_H
> +#define XEN_CAML_COMPAT_H
> +
> +#ifndef Val_none /* Option handling.  Compat for Ocaml < 4.12 */
> +
> +#define Val_none Val_int(0)
> +#define Tag_some 0
> +#define Some_val(v) Field(v, 0)
> +
> +static inline value caml_alloc_some(value v)
> +{
> +    CAMLparam1(v);
> +
> +    value some =3D caml_alloc_small(1, Tag_some);
> +    Store_field(some, 0, v);
> +
> +    CAMLreturn(some);
> +}
> +
> +#endif /* !Val_none */
> +
> +#endif /* XEN_CAML_COMPAT_H */
>=20
> base-commit: 75c64db3722f0245137a1e8cfd3435f4790d0fd7
> --=20
> 2.39.2
>=20

Acked-by: Christian Lindig <christian.lindig@cloud.com>




From xen-devel-bounces@lists.xenproject.org Fri Aug 30 15:48:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 15:48:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786502.1196065 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk3qs-0001NX-5N; Fri, 30 Aug 2024 15:47:54 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786502.1196065; Fri, 30 Aug 2024 15:47:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk3qs-0001NQ-2L; Fri, 30 Aug 2024 15:47:54 +0000
Received: by outflank-mailman (input) for mailman id 786502;
 Fri, 30 Aug 2024 15:47: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=YGfl=P5=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sk3qr-0001NJ-KC
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 15:47:53 +0000
Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com
 [2a00:1450:4864:20::631])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 36fd5c21-66e7-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 17:47:51 +0200 (CEST)
Received: by mail-ej1-x631.google.com with SMTP id
 a640c23a62f3a-a86933829dcso242775466b.3
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 08:47:51 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89891d6e9asm233135266b.148.2024.08.30.08.47.50
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 30 Aug 2024 08:47:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 36fd5c21-66e7-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1725032871; x=1725637671; 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=BKQY0Mh8zdoCyqju3qDYbHH0iJXkFR4ZWv6hjHGIxtU=;
        b=pjDyrmTpdCELLtpVAlJxO5E9Ij6samyh9jAPBNdFk0xszEm2vQpQS0qXu6nLx64maa
         jTQ1+e/dKAWxmCRrH17ZR7ykmaFYAFdPEv7s6jfREejN08FW00V6Y3kjEgNO9lGhn2n1
         xkdIHOpWJxiQqFmhmJDOI8Tvs4EKOm+Ltvfoo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725032871; x=1725637671;
        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=BKQY0Mh8zdoCyqju3qDYbHH0iJXkFR4ZWv6hjHGIxtU=;
        b=ZzFX21ppX/4fKPQPvkaf4rlt0alSahiYc5yllQSKmrGFUN+0uMBrwdIU6dnmdkvwoT
         /Hyuz6x2/x3/fiC4YijQJAaePtt9V0pF1ONBRBAb2jGU0eBkoHG0FFzugctZ8WBt5VJW
         8VgjNNHdVSVqKfEKYgpAmbpTMrkYQFGjupn7V80aVsxkhzfRk1SbBHcs83ePZAQhDaTv
         wjoOtY0fy1894faPXKVuzaP5xv7vVlS0PQXvDKZs214nZ1MV3JBvRiZrT7AfuM52GXku
         2egoQPBdNG631qSCgXz0bHLDbomoVomq2XgPp77RMwyXzu0xzjfx7XT87AN5E5cZhsbe
         Vz6A==
X-Forwarded-Encrypted: i=1; AJvYcCX4pIw+f39uqJIIFs7RkB9mB621xfuIcOTBrWRwP2FRURk9CuwLuBXYhu/tG9GPAxkkjjC8IPz5VeU=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yz/QuolAAkicp6gtrDWB44UK9OgmB3GY1+9RR0oFxbvWM2WwWQN
	+EzBL+UNb6LE+Y9WymG2tTt8Q5NRw1Qx8cm5ds/JFELSvAoFOmAwObKm3+mjw7w=
X-Google-Smtp-Source: AGHT+IFzEbC4/UVmP/47JJKGpmAwge8eu0dxKBIARarCY4L5Me1ST7GpzUYLVJmwvH7T7hT+B8kkvg==
X-Received: by 2002:a17:907:7f17:b0:a86:83f9:bc1f with SMTP id a640c23a62f3a-a897fab787bmr579945166b.61.1725032870751;
        Fri, 30 Aug 2024 08:47:50 -0700 (PDT)
Message-ID: <e994f35f-6f11-44d3-9ea7-0d020fa720dc@citrix.com>
Date: Fri, 30 Aug 2024 16:47:48 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 1/2] x86/time: split CMOS time fetching into wrapper
To: Roger Pau Monne <roger.pau@citrix.com>, xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, Jan Beulich <jbeulich@suse.com>
References: <20240830095220.49473-1-roger.pau@citrix.com>
 <20240830095220.49473-2-roger.pau@citrix.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20240830095220.49473-2-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 30/08/2024 10:52 am, Roger Pau Monne wrote:
> Split the logic that deals with probing and fetching the CMOS time into a
> separate helper.  While moving the code also take the opportunity to reduce the
> scope of some local variables.
>
> No functional change intended.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

This does look like a straight rearrangement, so

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>, although...

> +static unsigned long get_cmos_time(void)
> +{
> +    struct rtc_time rtc;
> +    static bool __read_mostly cmos_rtc_probe;
> +    boolean_param("cmos-rtc-probe", cmos_rtc_probe);
> +
> +    if ( efi_enabled(EFI_RS) )
> +    {
> +        unsigned long res = efi_get_time();
> +
> +        if ( res )
> +            return res;
> +    }
> +
> +    if ( likely(!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC)) )
> +        cmos_rtc_probe = false;
> +    else if ( system_state < SYS_STATE_smp_boot && !cmos_rtc_probe )
> +        panic("System with no CMOS RTC advertised must be booted from EFI"
> +              " (or with command line option \"cmos-rtc-probe\")\n");
> +
> +    if ( unlikely(!read_cmos_time(&rtc, cmos_rtc_probe)) )
>          panic("No CMOS RTC found - system must be booted from EFI\n");

... this really does show some (preexisting) tangled logic.

All of this should live in an init function, and not be re-evaluated
each time we call get_wallclock_time(), not that we call it very often.

cmos_rtc_probe should be __initdata or at least __ro_after_init, but it
gets written on every pass through the function on most systems.

Lets focus on not crashing.  Cleanup can come later.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 15:53:07 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 15:53:07 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786509.1196075 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk3vq-0002qQ-Nw; Fri, 30 Aug 2024 15:53:02 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786509.1196075; Fri, 30 Aug 2024 15:53:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk3vq-0002qJ-KQ; Fri, 30 Aug 2024 15:53:02 +0000
Received: by outflank-mailman (input) for mailman id 786509;
 Fri, 30 Aug 2024 15:53:01 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk3vp-0002q9-Ar; Fri, 30 Aug 2024 15:53:01 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk3vp-0008SZ-51; Fri, 30 Aug 2024 15:53:01 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk3vo-0005FI-Lo; Fri, 30 Aug 2024 15:53:00 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sk3vo-0003jm-LJ; Fri, 30 Aug 2024 15:53:00 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=fuazQG4H7EGlVaJqnO0vPacTYNFc9GK2lrggSPoJihQ=; b=bvqleZXrZTROFXc5bQyXNJDfcN
	Ie5yHsXRk7atBI1tAZShjiX4ALldSqweZ7wRAUwjxoytSOi3xdFTZL1YTvY+k9YVodQjCYeEgwwA3
	q5GOkJPGkAgX4z4u5ovRkkQOLcxy9bRx5gH0DGueowPE7lm8OC6s4YkgLoZ3GP1BxmHc=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187421-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187421: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=a1b0703e8ea59b2b353e644b92f01b8cad182d04
X-Osstest-Versions-That:
    ovmf=f31aa47deea9239d61b41fda8d445ecf607fcef9
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 15:53:00 +0000

flight 187421 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187421/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 a1b0703e8ea59b2b353e644b92f01b8cad182d04
baseline version:
 ovmf                 f31aa47deea9239d61b41fda8d445ecf607fcef9

Last test of basis   187420  2024-08-30 12:14:59 Z    0 days
Testing same since   187421  2024-08-30 14:13:16 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Rebecca Cran <rebecca@bsdio.com>
  Wei6 Xu <wei6.xu@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   f31aa47dee..a1b0703e8e  a1b0703e8ea59b2b353e644b92f01b8cad182d04 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 16:09:37 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 16:09:37 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786518.1196084 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk4Bn-0006ID-0v; Fri, 30 Aug 2024 16:09:31 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786518.1196084; Fri, 30 Aug 2024 16:09:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk4Bm-0006I6-UW; Fri, 30 Aug 2024 16:09:30 +0000
Received: by outflank-mailman (input) for mailman id 786518;
 Fri, 30 Aug 2024 16:09:29 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=kvro=P5=bounce.vates.tech=bounce-md_30504962.66d1eeb5.v1-855aff8734354a5badf40d95c5f5b5fc@srs-se1.protection.inumbo.net>)
 id 1sk4Bl-0006Hz-0O
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 16:09:29 +0000
Received: from mail177-17.suw61.mandrillapp.com
 (mail177-17.suw61.mandrillapp.com [198.2.177.17])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3a7422ee-66ea-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 18:09:26 +0200 (CEST)
Received: from pmta14.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1])
 by mail177-17.suw61.mandrillapp.com (Mailchimp) with ESMTP id
 4WwNPx49VqzRKLlgq
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 16:09:25 +0000 (GMT)
Received: from [37.26.189.201] by mandrillapp.com id
 855aff8734354a5badf40d95c5f5b5fc; Fri, 30 Aug 2024 16:09:25 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3a7422ee-66ea-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com;
	s=mte1; t=1725034165; x=1725294665;
	bh=AW7FJqN6YyE+MwvmPnT4Bx3Se7i+/6V1JEROid/5nE4=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=S303CoyslbWpPLsvIwvZ9qfzdxZbPCp6gBznRbW35PJNgyC7Zoc5YdGuX+Y4d6RHW
	 rMn1jTEiVBUUoQRdp48BmTIq2iODlMn5wiAxCRNGpd4x3nJ4sj7Sz7iuspVANUXDSp
	 0lTCvfuTJbqaNF8EojdDhveXzlsRveBdoQIFE4C1BNVb0sQi1+3XZULgWX/rl7KL+N
	 LwUJkx4V8HBW8hKvfY9JQ1t6F1BFDNFDy95gQFuRAHi3eL/CP9kMv3AYupiuSiTK5q
	 cAhdXCJERpqSkR9Q58/x28GOAUDZeH5jufISgi7o/+9Q2+lrJRqaYokjm472IjPg+r
	 lRUEg4PoPBDjA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1;
	t=1725034165; x=1725294665; i=anthony.perard@vates.tech;
	bh=AW7FJqN6YyE+MwvmPnT4Bx3Se7i+/6V1JEROid/5nE4=;
	h=From:Subject:To:Cc:Message-Id:References:In-Reply-To:Feedback-ID:
	 Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date:
	 Subject:From;
	b=reBLIWO1T/JOy6oBWN2GU/ExKHoajIDZejhCvUfxrhHooXqNUUaCIdSvL3+VonJ+2
	 CpTO/pJcIA93Hnqv2c8aTc/dZVlUCvupUT4OzLHh2SskzIr9zf83WQfCVobuWCq/w3
	 mO7txF5T5SG1WgwDzWhzTKzudWKru+YJMEVRMPGsdM1tfYLiJEnJagAWVw4JlUYhte
	 O6vALcRaiVZUuHFY0faQYY6DY+AXcftO4reKWjmfi+JQj7JYZlwXg6R0wAnNUr9pva
	 GmkzUMLN5b+DoOMh2nTRuPpAMMPwpz4LtDNHeW36tenZHLSHpaWd7y30jhMFlz14xV
	 AMpFyrgEty86A==
From: Anthony PERARD <anthony.perard@vates.tech>
Subject: =?utf-8?Q?Re:=20Block=20protocol=20incompatibilities=20with=204K=20logical=20sector=20size=20disks?=
X-Bm-Disclaimer: Yes
X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2
X-Bm-Transport-Timestamp: 1725034164181
To: =?utf-8?Q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Cc: xen-devel@lists.xenproject.org, Paul Durrant <paul@xen.org>, Owen Smith <owen.smith@cloud.com>, Mark Syms <mark.syms@citrix.com>, Stefano Stabellini <sstabellini@kernel.org>, Juergen Gross <jgross@suse.com>
Message-Id: <ZtHus/ytlA1UnHEI@l14>
References: <ZtBUnzH4sIrFAo0f@macbook.local> <ZtB0fMRCGajdcfap@l14> <ZtCW9Qq9k8UQ-jJC@macbook.local>
In-Reply-To: <ZtCW9Qq9k8UQ-jJC@macbook.local>
X-Native-Encoded: 1
X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.855aff8734354a5badf40d95c5f5b5fc?=
X-Mandrill-User: md_30504962
Feedback-ID: 30504962:30504962.20240830:md
Date: Fri, 30 Aug 2024 16:09:25 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On Thu, Aug 29, 2024 at 05:42:45PM +0200, Roger Pau Monn=C3=A9 wrote:
> On Thu, Aug 29, 2024 at 01:15:42PM +0000, Anthony PERARD wrote:
> > On Thu, Aug 29, 2024 at 12:59:43PM +0200, Roger Pau Monn=C3=A9 wrote:
> > > The following table attempts to summarize in which units the followin=
g fields
> > > are defined for the analyzed implementations (please correct me if I =
got some
> > > of this wrong):
> > >
> > >                         =E2=94=82 sectors xenbus node =E2=94=82 reque=
sts sector_number =E2=94=82 requests {first,last}_sect
> > > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80
> > > FreeBSD blk{front,back} =E2=94=82     sector-size     =E2=94=82      =
sector-size       =E2=94=82           512
> > > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80
> > > Linux blk{front,back}   =E2=94=82         512         =E2=94=82      =
    512           =E2=94=82           512
> > > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80
> > > QEMU blkback            =E2=94=82     sector-size     =E2=94=82      =
sector-size       =E2=94=82       sector-size
> > > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80
> > > Windows blkfront        =E2=94=82     sector-size     =E2=94=82      =
sector-size       =E2=94=82       sector-size
> > > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80
> > > MiniOS                  =E2=94=82     sector-size     =E2=94=82      =
    512           =E2=94=82           512
> > > =E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=
=94=BC=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=BC=E2=94=80=E2=94=80=E2=
=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=
=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=
=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80=E2=94=80
> > > tapdisk blkback         =E2=94=82         512         =E2=94=82      =
sector-size       =E2=94=82           512

Tapdisk situation seems more like:

     tapdisk blkback         =E2=94=82      ??????????     =E2=94=82      ?=
??????????       =E2=94=82         ?????

I've looks at the implementation at xapi-project/blktat[1] and the way
sector_number or {first,last}_sect seems to be used varied on which
backend is used (block-vhd, block-nbd, block-aio).

[1] https://github.com/xapi-project/blktap

block-vhd seems mostly sectors of 512 but recalculated with "s->spb"
(sector per block?) but still, sector seems to be only 512.

block-nbd seems to set "sector-size" to always 512, but uses
"sector-size" for sector_number and {first,last}_sect.

The weirdest one is block-aio, where on read it multiply sector_number
and {first,last}_sect by 512, but on write, those are multiplied by
"sector-size". With "sector-size" set by ioctl(BLKSSZGET)

At least, is seems "sectors" is a multiple of 512 on all those, like in
the table, but I've only look at those 3 "drivers".


> > There's OVMF as well, which copied MiniOS's implementation, and looks
> > like it's still the same as MiniOS for the table above:
> > 
> > OVMF (base on MiniOS)   =E2=94=82     sector-size     =E2=94=82        =
  512           =E2=94=82           512
> > 
> > >
> > > It's all a mess, I'm surprised we didn't get more reports about broke=
nness when
> > > using disks with 4K logical sectors.
> > >
> > > Overall I think the in-kernel backends are more difficult to update (=
as it
> > > might require a kernel rebuild), compared to QEMU or blktap.  Hence m=
y slight
> > > preference would be to adjust the public interface to match the behav=
ior of
> > > Linux blkback, and then adjust the implementation in the rest of the =
backends
> > > and frontends.
> > 
> > I would add that making "sector-size" been different from 512 illegal
> > makes going forward easier, has every implementation will work with a
> > "sector-size" of 512, and it probably going to be the most common secto=
r
> > size for a while longer.
> 
> My main concern is the amount of backends out there that already
> expose a "sector-size" different than 512.  I fear any changes here
> will take time to propagate to in-kernel backends, and hence my
> approach was to avoid modifying Linux blkback, because (as seen in the
> FreeBSD bug report) there are already instances of 4K logical sector
> disks being used by users.  Modifying the frontends is likely easier,
> as that's under the owner of the VM control.
> 
> > > There was an attempt in 2019 to introduce a new frontend feature flag=
 to signal
> > > whether the frontend supported `sector-size` xenstore nodes different=
 than 512 [0].
> > > However that was only ever implemented for QEMU blkback and Windows b=
lkfront,
> > > all the other backends will expose `sector-size` different than 512 w=
ithout
> > > checking if `feature-large-sector-size` is exposed by the frontend.  =
I'm afraid
> > > it's now too late to retrofit that feature into existing backends, se=
eing as
> > > they already expose `sector-size` nodes greater than 512 without chec=
king if
> > > `feature-large-sector-size` is reported by the frontend.
> > 
> > Much before that, "physical-sector-size" was introduced (2013):
> >     https://xenbits.xen.org/gitweb/?p=3Dxen.git;a=3Dcommit;h=3Da67e2dac=
9f8339681b30b0f89274a64e691ea139
> > 
> > Linux seems to implement it, but QEMU or OVMF don't have it.
> 
> Yeah, I was aware of this, normal disks already have a physical sector
> size (optimal sector size) and a logical sector size (minimal size
> supported by the drive).  Some implement a smaller logical than
> physical sector size by doing read-modify-write.
> 
> > > My proposal would be to adjust the public interface with:
> > >
> > >  * Disk size is calculated as: `sectors` * 512 (`sectors` being the c=
ontents of
> > >    such xenstore backend node).
> > >
> > >  * All the sector related fields in blkif ring requests use a 512b ba=
se sector
> > >    size, regardless of the value in the `sector-size` xenstore node.
> > >
> > >  * The `sector-size` contains the disk logical sector size.  The fron=
tend must
> > >    ensure that all request segments addresses are aligned and it's le=
ngth is
> > >    a multiple of such size.  Otherwise the backend will refuse to pro=
cess the
> > >    request.
> > 
> > You still want to try to have a "sector-size" different from 512? To me
> > this just add confusion to the confusion. There would be no way fro
> > backend or frontend to know if setting something other than 512 is goin=
g
> > to work.
> 
> But that's already the case, most (all?) backends except QEMU will set
> "sector-size" to the underlying block storage logical sector size

QEMU, only if feature-large-sector-size is set, indeed, otherwise it
just return an error if it have to set "sector-size" to a value
different from 512.

Otherwise, yes for Linux, FreeBSD, and maybe yes for blktap. For blktap
it seems to depend of the storage, more or less:
    - block-vhd: always "sector-size" =3D 512
    - block-nbd: always "sector-size" =3D 512
    - block-aio: physical storage sector size

> without any way to tell if the frontend supports sector-sizes !=3D 512.
> So the issue is not inherently with the setting of the "sector-size"
> node to a value different than 512, but rather how different
> implementations have diverged regarding which is the base unit of
> other fields.
> 
> > Also, it is probably easier to update backend than frontend, so
> > it is just likely that something is going to lag behind and broke.
> 
> Hm, I'm not convinced, sometimes the owner of a VM has no control over
> the version of the backends if it's not the admin of the host.  OTOH
> the owner of a VM could always update the kernel in order to
> workaround such blkfront/blkback incompatibility issues.  Hence my
> preference was for solutions that didn't involve changing Linux
> blkback, as I believe that's the most commonly used backend.

Going the Linux way might be the least bad option indeed. sectors in
requests has been described as a 512-bytes for a long while. It's only
"sectors" that have been described as "sector-size"-bytes size.

> > Why not make use of the node "physical-sector-size" that have existed
> > for 10 years, even if unused or unadvertised, and if an IO request isn'=
t
> > aligned on it, it is just going to be slow (as backend would have to
> > read,update,write instead of just write sectors).
> 
> I don't really fancy implementing read-modify-write on the backends,
> as it's going to add more complexity to blkback implementations,
> specially the in-kernel ones I would assume.
> 
> All frontends I've looked into support "sector-size" !=3D 512, but
> there's a lack of uniformity on whether other units used in the
> protocol are based on the blkback exposed "sector-size", or hardcoded
> to 512.
> 
> So your suggestion would be to hardcode "sector-size" to 512 and use
> the "physical-sector-size" node value to set the block device logical
> sector size the frontends?
> 
> If we go that route I would suggest that backends are free to refuse
> requests that aren't a multiple of "physical-sector-size".

After looking in more detail in the different implementations, and linux
one, I don't think changing "physical-sector-size" meaning is going to
be helpful.

What to do about "feature-large-sector-size"? Should backend refuse to
connect to the front end if that flag is set and "sector-size" want to
be different than 512? This would just be Windows frontend I guess.
(Just as an helper for updated backend)


So yes, after more research, having sector in the protocol been a
512-byte size seems the least bad option. "sector_number" and
"{first,last}_sect" have been described as is for a long while. Only
"sectors" for the size has been described as a "sector-size" quantity.

Cheers,

-- 

Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 16:31:19 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 16:31:19 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786528.1196095 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk4Wl-0002m7-Oh; Fri, 30 Aug 2024 16:31:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786528.1196095; Fri, 30 Aug 2024 16:31:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk4Wl-0002m0-Kf; Fri, 30 Aug 2024 16:31:11 +0000
Received: by outflank-mailman (input) for mailman id 786528;
 Fri, 30 Aug 2024 16:31:10 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YGfl=P5=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sk4Wk-0002ls-FG
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 16:31:10 +0000
Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com
 [2a00:1450:4864:20::630])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 420acf57-66ed-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 18:31:07 +0200 (CEST)
Received: by mail-ej1-x630.google.com with SMTP id
 a640c23a62f3a-a8679f534c3so211486366b.0
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 09:31:07 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8988feb1b8sm230985666b.38.2024.08.30.09.31.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 30 Aug 2024 09:31:05 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 420acf57-66ed-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1725035467; x=1725640267; 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=tVwyDbMKzTjeM5/tUK//WOodT3aZ3ZT6PJ86JPXdyU0=;
        b=F6RB4rrpDRXuK8OO2eMiv8Vtiy6XB7+DnZLwFDCG5h48+R+uOiNQBoMI+0HriGihbn
         f45cvDCi4+h7INHiCbAA8redswS+QqRoecbrlQLGHj11Zo9CLVxnOUZVqpyYofTebwjL
         qpRFCVF4zdnXrMiTvFE5okiDDEz9okaR3ZjG4=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725035467; x=1725640267;
        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=tVwyDbMKzTjeM5/tUK//WOodT3aZ3ZT6PJ86JPXdyU0=;
        b=AhGkhgT+CBZ9L+gD90wmYsk7rTCD6WOEXZaG5sHq6/nSovlzQxqUr1FdTPn04DnBf0
         HOSCN25WOb7ywX4z9tlnnbhxMBIrFzouIxIVQrg54d4lQWQ2IXANKaSQomIrV3poFnpl
         QC1B5BLf/jjWZBbZYBOmn54U6VhtaVOmN2PRS/1m1brU/AinifkP5/NNVVapKrFHzioS
         yKkdOdfnGHX6qLNo9cUQVtAq/M7gSYEjyOLs7lWEqIOUmV8F/JosZub2emhPgWLEeAz4
         aUskGE8HWYRGygxENshrvgYM0ZftTfBE2r44TCfaimkhR6BJ2EfEi662Nc+3blmR51cW
         eCqA==
X-Forwarded-Encrypted: i=1; AJvYcCU4Gxe+OG64de4yCj00E980Ne6snAhBkLsCPspZX0a6a0arinMOBEhIWG/v+F25SiTXtN5ZXYM+QVk=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyIW4LLLqS+orc0Zc2EmbPGXfJB25Hpc/6PrulJ9D92NrG9Dzmw
	5Tm8pjV7K0zo2Bs2oFqT1bpg1NivStXcsJt5ZzAtmuLNJm5eZTBTa2jpu9WzTXk=
X-Google-Smtp-Source: AGHT+IENfdzpxG6hDkgLJyZExNc4MOXW0kQH/ewg6rYOmhNiRE25V2Ew/waXQ6SKCNKbtnLq3HRB0w==
X-Received: by 2002:a17:907:980f:b0:a7a:929f:c0cf with SMTP id a640c23a62f3a-a897f83ad77mr583139866b.21.1725035466278;
        Fri, 30 Aug 2024 09:31:06 -0700 (PDT)
Message-ID: <ca2aa9b3-44cf-4a44-9111-1d7e8c9b4dff@citrix.com>
Date: Fri, 30 Aug 2024 17:31:04 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 2/2] x86/time: prefer CMOS over EFI_GET_TIME
To: Roger Pau Monne <roger.pau@citrix.com>, xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
 =?UTF-8?Q?Marek_Marczykowski-G=C3=B3recki?=
 <marmarek@invisiblethingslab.com>, Jan Beulich <jbeulich@suse.com>
References: <20240830095220.49473-1-roger.pau@citrix.com>
 <20240830095220.49473-3-roger.pau@citrix.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20240830095220.49473-3-roger.pau@citrix.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 30/08/2024 10:52 am, Roger Pau Monne wrote:
> The EFI_GET_TIME implementation is well known to be broken for many firmware
> implementations, for Xen the result on such implementations are:
>
> ----[ Xen-4.19-unstable  x86_64  debug=y  Tainted:   C    ]----
> CPU:    0
> RIP:    e008:[<0000000062ccfa70>] 0000000062ccfa70
> [...]
> Xen call trace:
>    [<0000000062ccfa70>] R 0000000062ccfa70
>    [<00000000732e9a3f>] S 00000000732e9a3f
>    [<ffff82d04034f34f>] F arch/x86/time.c#get_cmos_time+0x1b3/0x26e
>    [<ffff82d04045926f>] F init_xen_time+0x28/0xa4
>    [<ffff82d040454bc4>] F __start_xen+0x1ee7/0x2578
>    [<ffff82d040203334>] F __high_start+0x94/0xa0
>
> Pagetable walk from 0000000062ccfa70:
>  L4[0x000] = 000000207ef1c063 ffffffffffffffff
>  L3[0x001] = 000000005d6c0063 ffffffffffffffff
>  L2[0x116] = 8000000062c001e3 ffffffffffffffff (PSE)
>
> ****************************************
> Panic on CPU 0:
> FATAL PAGE FAULT
> [error_code=0011]
> Faulting linear address: 0000000062ccfa70
> ****************************************
>
> Swap the preference to default to CMOS first, and EFI later, in an attempt to
> use EFI_GET_TIME as a last resort option only.  Note that Linux for example
> doesn't allow calling the get_time method, and instead provides a dummy handler
> that unconditionally returns EFI_UNSUPPORTED on x86-64.
>
> Such change in the preferences requires some re-arranging of the function
> logic, so that panic messages with workaround suggestions are suitably printed.
>
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
>  xen/arch/x86/time.c | 26 +++++++++++++++++++-------
>  1 file changed, 19 insertions(+), 7 deletions(-)
>
> diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
> index 272ca2468ea6..0eee954809a9 100644
> --- a/xen/arch/x86/time.c
> +++ b/xen/arch/x86/time.c
> @@ -1305,24 +1305,36 @@ static unsigned long get_cmos_time(void)
>      static bool __read_mostly cmos_rtc_probe;
>      boolean_param("cmos-rtc-probe", cmos_rtc_probe);
>  
> +    if ( likely(!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC)) )
> +        cmos_rtc_probe = false;
> +
> +    if ( (!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC) ||
> +          cmos_rtc_probe) && read_cmos_time(&rtc, cmos_rtc_probe) )
> +        return mktime(rtc.year, rtc.mon, rtc.day, rtc.hour, rtc.min, rtc.sec);
> +
>      if ( efi_enabled(EFI_RS) )
>      {
>          unsigned long res = efi_get_time();
>  
>          if ( res )
>              return res;
> +
> +        panic("Broken EFI_GET_TIME %s\n",
> +              !cmos_rtc_probe ? "try booting with \"cmos-rtc-probe\" option"
> +                              : "and no CMOS RTC found");
>      }
>  
> -    if ( likely(!(acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_CMOS_RTC)) )
> -        cmos_rtc_probe = false;
> -    else if ( system_state < SYS_STATE_smp_boot && !cmos_rtc_probe )
> +    /*
> +     * No viable clock source found.  Attempt to provide some guidance to the
> +     * user about possible workarounds to boot Xen on the system.
> +     */
> +    ASSERT(system_state < SYS_STATE_smp_boot);
> +
> +    if ( !cmos_rtc_probe )
>          panic("System with no CMOS RTC advertised must be booted from EFI"
>                " (or with command line option \"cmos-rtc-probe\")\n");
>  
> -    if ( unlikely(!read_cmos_time(&rtc, cmos_rtc_probe)) )
> -        panic("No CMOS RTC found - system must be booted from EFI\n");
> -
> -    return mktime(rtc.year, rtc.mon, rtc.day, rtc.hour, rtc.min, rtc.sec);
> +    panic("No CMOS RTC found - system must be booted from EFI\n");
>  }
>  
>  static unsigned int __ro_after_init cmos_alias_mask;

Hmm, I know I said "fix the crash first, cleanup later" on the prior
patch, but I'm tempted to retract that.  This is very hard to follow.

Going back to first principles, at runtime we need USE_{XEN,RTC,EFI} to
select between the various methods available.

At boot, we need to figure out what to do.  I think we want an
init_wallclock_time() split out of get_cmos_time() (which is badly named
anyway, given EFI), and called from init_xen_time() only.  In
particular, the init stuff should not be re-evaluated in
time_{suspend,resume}().

Various details we have to work with:

 * ACPI_FADT_NO_CMOS_RTC, although we know this is falsely set on some
platforms, hence the whole probing logic.

 * Booted on an EFI system, although we know EFI_GET_TIME is broken on
millions of systems, and we only find this out with a #PF in the middle
of EFI-RS.  Furthermore, more-major-OSes-than-us strictly veto the use
of this service, and it's not only Linux; it's Windows too.

Personally, I think "cmos-rtc-probe" is inappropriate/insufficient.  It
ought to be wc-time=guess|xen|rtc|efi.  We should be able to influence
the behaviour more than a boolean "probe or not".  The Xen case might be
better as "hypervisor", although I can't see any evidence of Viridian
having a virtualised wallclock interface.

I think the init logic wants to be:
 * If ACPI says we have an RTC, use it.
 * If ACPI says we have no RTC, probe to see if it's really there.
 * If we genuinely seem to not have an RTC, probe EFI.  This would be
quite invasive in the #PF handler, but not impossible.


That said, I'm still holding out hope that we can simply delete Xen's
need for wallclock time.  Xen only uses wallclock time for the
non-default console_timestamps=date, but even then it's uncorrelate with
dom0 changing the platform time, leading to actively-misleading log
files.  There's a reason why "time since boot" is the norm.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 17:06:31 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 17:06:31 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786538.1196108 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk54e-0008SQ-9F; Fri, 30 Aug 2024 17:06:12 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786538.1196108; Fri, 30 Aug 2024 17:06:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk54e-0008RU-5i; Fri, 30 Aug 2024 17:06:12 +0000
Received: by outflank-mailman (input) for mailman id 786538;
 Fri, 30 Aug 2024 17:06:10 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YGfl=P5=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sk54c-0008Pz-Ap
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 17:06:10 +0000
Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com
 [2a00:1450:4864:20::129])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 25ffe94b-66f2-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 19:06:07 +0200 (CEST)
Received: by mail-lf1-x129.google.com with SMTP id
 2adb3069b0e04-5334879ba28so2873513e87.3
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 10:06:07 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8989230a9dsm232725966b.224.2024.08.30.10.06.05
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 30 Aug 2024 10:06:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 25ffe94b-66f2-11ef-99a1-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1725037567; x=1725642367; 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=+/BOiHGSYumqVQLot/pndyPGdTJkwe1yspWUo6nf1OY=;
        b=XHWHqFJT9EyDhEnnVv/DImD+KdZaRmyL1f6GKwM17qY89UdgKS3y4DwkQQO36C5lEE
         MzwqG/+qzb2r0zEICs4qBkl5JKr8QO4uIQ1FDNwK9YxVvoqegFDDJQ9K0mLKe4s8ZSxK
         T5ejqvArop5QWEgQtAVex6lAELwSB9IiE/8dA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725037567; x=1725642367;
        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=+/BOiHGSYumqVQLot/pndyPGdTJkwe1yspWUo6nf1OY=;
        b=jv+LWiVdWcIlHZUbWEzuz+r2dNxp+sxLujVf3VtEgSoXtqAWuLWubgxweYxo2NxL9n
         Mm5zlUjhYcwZZ0dgQL4wUxfQgjPuwZkomfbQXv9baCbk81C6FMybDKMYcxdjpifR5e7s
         Z4vWFgQq3XGYEwwXegP/qmrB/mwTg/vGwuLIRVBBRQopNvMm+TiwQb+0YvPi/eB03vFd
         s6fRbUjnLw5cyWjCJIA/0w6vbPTKZzM5c2cjEz1IgI2X+jfcu6NqpvwxiglcTVogvIuN
         lWpYBdu2A8o8UK1aNvjK00V9N4lDCsXHhttlw4U/w9pYBP7IHfaijrI4CbinHq9RgCOd
         0y6Q==
X-Gm-Message-State: AOJu0YwRxi8Mx0nACoJWflLSl+jNw2I0ScyzJwbWjeKd3J4NxC/J5ZVu
	9HU1+GbMdsXo+Ps9Kc+qIMUpWYXWDQxrSXdSThBUmqsw6Niko4NxgL5TreaQyYg=
X-Google-Smtp-Source: AGHT+IHB5eX4GFz0tjwjZfMa13jBVvoLExGQOFHf30KYF/d2nNCjUxLEQbIHI0HatiPDBR1YS4f+3w==
X-Received: by 2002:a05:6512:6d2:b0:52f:cffd:39f9 with SMTP id 2adb3069b0e04-53546b2c596mr1964005e87.24.1725037566568;
        Fri, 30 Aug 2024 10:06:06 -0700 (PDT)
Message-ID: <49ab67ae-1e1a-457a-a759-8517711ab5f8@citrix.com>
Date: Fri, 30 Aug 2024 18:06:04 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH] x86/pv: Make cr4_pv32_mask be PV32-only
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Jan Beulich <jbeulich@suse.com>
Cc: Xen-devel <xen-devel@lists.xenproject.org>
References: <20240829183817.2807665-1-andrew.cooper3@citrix.com>
 <77e852b6-1336-4289-87f2-9cefe2e6fd04@suse.com>
 <ZtGOnQVY4SiEK63o@macbook.local>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <ZtGOnQVY4SiEK63o@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 30/08/2024 10:19 am, Roger Pau Monné wrote:
> On Fri, Aug 30, 2024 at 09:55:12AM +0200, Jan Beulich wrote:
>> On 29.08.2024 20:38, Andrew Cooper wrote:
>>> The user of cr4_pv32_mask (the cr4_pv32_restore() function) only exists in a
>>> CONFIG_PV32 build, but right now the variable is unconditionally set up.
>>>
>>> To start with, move the setup into set_in_cr4() and remove it from it's
>>> somewhat ad-hoc position in __start_xen().  This means the variable will be
>>> set up in two steps for a CONFIG_PV32=y build, but it's cleaner and more
>>> robust logic overall.
>>>
>>> With that, there's no good reason for the variable to stay in setup.c.  Move
>>> it to x86/pv/traps.c (for want of any better place to live), and move the
>>> declaration to beside set_in_cr4() and mmu_cr4_features which is a better
>>> position than setup.h.
>>>
>>> Guard the reference with CONFIG_PV32, and fix up a recent typo in an adjacent
>>> comment while at it.
>>>
>>> No functional change.
>>>
>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>> with a suggestion:
>>
>>> --- a/xen/arch/x86/pv/traps.c
>>> +++ b/xen/arch/x86/pv/traps.c
>>> @@ -18,6 +18,10 @@
>>>  #include <asm/traps.h>
>>>  #include <irq_vectors.h>
>>>  
>>> +#ifdef CONFIG_PV32
>>> +unsigned long __ro_after_init cr4_pv32_mask;
>>> +#endif
>> To save on the number of such #ifdef-s, how about moving this into an existing
>> one. pv/mm.c has one, albeit near the bottom of the file (which I'd be fine
>> with, but I could imagine you or others not liking such placement), and
>> pv/domain.c has one near the top which seems pretty well suited.
> I'm fine either way:
>
> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
>
> Thanks, Roger.

Thanks.  I'll put it alongside opt_pv32 in pv/domain.c which is indeed
pretty well suited.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 17:16:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 17:16:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786545.1196117 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk5EI-00028D-4a; Fri, 30 Aug 2024 17:16:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786545.1196117; Fri, 30 Aug 2024 17:16:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk5EI-000286-1j; Fri, 30 Aug 2024 17:16:10 +0000
Received: by outflank-mailman (input) for mailman id 786545;
 Fri, 30 Aug 2024 17:16:08 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YGfl=P5=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sk5EG-000280-Ow
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 17:16:08 +0000
Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com
 [2a00:1450:4864:20::62d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8a6f8d74-66f3-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 19:16:06 +0200 (CEST)
Received: by mail-ej1-x62d.google.com with SMTP id
 a640c23a62f3a-a86a0b5513aso240937466b.1
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 10:16:06 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89891d72c3sm237697366b.147.2024.08.30.10.16.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 30 Aug 2024 10:16:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8a6f8d74-66f3-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1725038165; x=1725642965; 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=FX1+GsNHmsic0w/XiGgpLMmpBMNUBTOQA9yhKwSb0x4=;
        b=kL+k2u6HqZfPTcKghkjtuzBJZ42B1SunjPcy9XE7AI9lie8iFpvbGjdy7W1CD7+MUJ
         7zRkEGf51j8DH/XZCfmctRNHe23lKjenjp/YCfXB7hRPF+ciDLRuJUaey3kK4Msp2pmw
         d/e8bwh5gP1xvwWeC3JQ/+jKw3BCBI6yQmieE=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725038165; x=1725642965;
        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=FX1+GsNHmsic0w/XiGgpLMmpBMNUBTOQA9yhKwSb0x4=;
        b=FgOMRlYykNlWSQOz55W7XmmrmUFnVxM0Knhxk9Fpyj0xR+rrVR8arE/ksJmU1126tw
         PGkUTbQo2HfJNkJR6OFZPWgQXE5WXkyZFc4X29wrmt/6MMgB70lydJuMDqVwLJB4syIh
         weKRPWSnLBg9rt0BM+KEE81V8d8fr+05T6NQvlHf4Glm9Vq/Cz3duagjnd6bXbPSe8dy
         tRDbDt7oxHxae0oxXwHN2rXODLbyKK8cu1j7D1pQYj5chuy9sJctkqVqGVZBgr2xsqv9
         8WJutIrdjkZ1korD97dvHRkvi06Y2TPdlKLRBx/uIRS29h+0hswzixNmLdxgseg1LN9y
         O9BQ==
X-Forwarded-Encrypted: i=1; AJvYcCU8ZxGYK9LH/OIYQK+If4rTCWTGwFvS+sbdnQBksgjn6phRHJwyYyMyaynUhWgBRPhjJ0EmMNoF9Z0=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyXhDYuGVTykvPmwDN9iHedbFuvcGWUfrTPE21YPP9gxaiVQAQt
	uKFEvLM2cIfokA+8nnja9KWHYosfAc8i8AawnCzYQhyeHMNHXV9wAOxxSf6Clwg=
X-Google-Smtp-Source: AGHT+IFCoRqYDYWQ32ZC/XhlwAzkYSV04/SAHqwL5sNELFnaT5xariOeZXkW4AfbZIEM50hJVnq8FA==
X-Received: by 2002:a17:907:6d23:b0:a7a:aa35:408c with SMTP id a640c23a62f3a-a897f77fa9amr571429966b.8.1725038164657;
        Fri, 30 Aug 2024 10:16:04 -0700 (PDT)
Message-ID: <6292af41-00e6-4c06-8781-92830f6022ba@citrix.com>
Date: Fri, 30 Aug 2024 18:16:02 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v2 0/2] libxl: Implement QEMU command line probe
To: Anthony PERARD <anthony.perard@vates.tech>, xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>
References: <20240830094937.40476-1-anthony.perard@vates.tech>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <20240830094937.40476-1-anthony.perard@vates.tech>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

On 30/08/2024 10:49 am, Anthony PERARD wrote:
> Patch series available in this git branch:
> https://xenbits.xen.org/git-http/people/aperard/xen-unstable.git br.libxl-qemu-cmdline-probe-v2
>
> v2:
> - removed commited patch
> - rename "qemu_cmdline" to "qemu_opts" in struct field and func parameters.
> - rename "struct libxl__qemu_available_cmd_line" to
>   "struct libxl__qemu_available_opts".
>
> Starting with QEMU 9.0, the option "-chroot", that we use for the
> "dmrestrict" feature, is removed. We need to find out which to use
> between "-chroot" and "-run-with chroot=dir".
>
> Also, "-runas" is deprecated in QEMU 9.1 and will be remove in a future
> release, it's replaced with "-run-with user=user".
>
> To find out which command line option we can use, we'll spawn QEMU, and run the
> QMP command "query-command-line-options".
>
> Some example of running these patches:
>     with qemu-xen (8.0):
>         http://logs.test-lab.xenproject.org/osstest/logs/187352/
>     with QEMU (upstream, 9.1-rc3):
>         http://logs.test-lab.xenproject.org/osstest/logs/187353/
>
> Anthony PERARD (2):
>   libxl: Probe QEMU for -run-with chroot=dir and use it
>   libxl: Probe QEMU for -run-with user=user and use it
>
>  tools/libs/light/libxl_dm.c       | 90 +++++++++++++++++++++++++------
>  tools/libs/light/libxl_internal.h |  6 +++
>  2 files changed, 80 insertions(+), 16 deletions(-)

I've committed these as they're fully reviewed, but I think this
warrants a CHANGELOG.md update as we're fixing libxl to work with newer
QEMU.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 17:51:43 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 17:51:43 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786561.1196144 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk5mb-00019m-V5; Fri, 30 Aug 2024 17:51:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786561.1196144; Fri, 30 Aug 2024 17:51:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk5mb-00019f-SV; Fri, 30 Aug 2024 17:51:37 +0000
Received: by outflank-mailman (input) for mailman id 786561;
 Fri, 30 Aug 2024 17:51:36 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk5ma-00019V-IJ; Fri, 30 Aug 2024 17:51:36 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk5ma-0003Bm-20; Fri, 30 Aug 2024 17:51:36 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk5mZ-00089R-Is; Fri, 30 Aug 2024 17:51:35 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sk5mZ-00087k-IQ; Fri, 30 Aug 2024 17:51:35 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=JEawaVONr8OV6ODsRwe2SknnPYw2fjHnhDTQUjSQUqQ=; b=2RDKfzHBear8/qawfgwIopwFdS
	mLjvciSxmlDF8C4pjsdkse7TfV+G8SnB8MaoBrKb+Fze/6XTEzkyKzjnSsTHokIHXkhLOxSIJE8mI
	t5Oy4zgOEvM5aZQ2aXAw5dWyEIXGbStpAHwO2RF069RNUgitZOju48j0eYfd8AERtWsE=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187423-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187423: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=9d5a9940e4b1bf7cc9080ff245485abbf1858d2c
X-Osstest-Versions-That:
    ovmf=a1b0703e8ea59b2b353e644b92f01b8cad182d04
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 17:51:35 +0000

flight 187423 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187423/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 9d5a9940e4b1bf7cc9080ff245485abbf1858d2c
baseline version:
 ovmf                 a1b0703e8ea59b2b353e644b92f01b8cad182d04

Last test of basis   187421  2024-08-30 14:13:16 Z    0 days
Testing same since   187423  2024-08-30 16:11:28 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Ceping Sun <cepingx.sun@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   a1b0703e8e..9d5a9940e4  9d5a9940e4b1bf7cc9080ff245485abbf1858d2c -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 17:53:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 17:53:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786568.1196154 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk5oD-0001g6-9w; Fri, 30 Aug 2024 17:53:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786568.1196154; Fri, 30 Aug 2024 17:53:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk5oD-0001fz-71; Fri, 30 Aug 2024 17:53:17 +0000
Received: by outflank-mailman (input) for mailman id 786568;
 Fri, 30 Aug 2024 17:53:15 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YGfl=P5=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sk5oB-0001fr-As
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 17:53:15 +0000
Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com
 [2a00:1450:4864:20::636])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ba711939-66f8-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 19:53:13 +0200 (CEST)
Received: by mail-ej1-x636.google.com with SMTP id
 a640c23a62f3a-a86910caf9cso555690666b.1
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 10:53:13 -0700 (PDT)
Received: from andrewcoop.eng.citrite.net ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8988feb2a3sm239739966b.3.2024.08.30.10.53.11
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 30 Aug 2024 10:53:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ba711939-66f8-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1725040393; x=1725645193; darn=lists.xenproject.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to;
        bh=iLBjy3jQyg2WrSnoZIIBj/Tgnhve2wb9GQSzOxv16XM=;
        b=TNybCgAe0QBRRO56b5+vA6AU5rk/Gy62f7kzAAII8w3YkYrJ1cbhwV3Xo1JTA418Lp
         XTBFvGsd14GyObafQjMXCy3wDu64qvtxmB/bcTteZ6O408XN8gK6GAh/2cLyoXQJkJyy
         UJW1BXWeRED7oQZCTZikbLa0VVnAKCbz+/AAQ=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725040393; x=1725645193;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
         :reply-to;
        bh=iLBjy3jQyg2WrSnoZIIBj/Tgnhve2wb9GQSzOxv16XM=;
        b=s+bNUuroR3d2dhwxQeXUWn8iRtGidCjNBElpfyMc5xTaKBATdBx6+bb/CmbJpUmlWF
         x4j7GuKPtAHXbOTfGBa374Q/2x6WoDIwPwznOivugczG/17jSajJjFAYrEJYm+2CyPaw
         hmuvVzD6pOO3N2L18oON6GElkyiYShPLq8q8EYkQxECFBJa3SDEbaRJKA7ZAVxAotpol
         QeEiejWnz+EF4jfdT2qZREkzIXWGgkP+KkxhiqvC247AXM8b/hXz8XF0bt9UdkcgOLnY
         BpUzHgDfEadI5cRS1p8avdyXLS90nc/WxzCTZoDZHW8Kwm9xTsDwyk7VZjgAqgCMAElv
         hIAQ==
X-Gm-Message-State: AOJu0YyNxMEz+iRSy2KpqChb2jMbP0/P74S/caO+8D412wzvIWtGaj3W
	+D5WOqJYRSJatosYTWl/7lEpcClSe2D2Mhj+UYsrp3pMKy64TzwwdL3Wps1lA7I0PKlE+wD7WUs
	r
X-Google-Smtp-Source: AGHT+IEc+PBwEUC87ER5KaT6r3CPMvdWEEhenPmCO1InpZBVYj2ppc+KV97HFABgF08k7L7IVEa6MA==
X-Received: by 2002:a17:906:565a:b0:a89:b829:7598 with SMTP id a640c23a62f3a-a89b8297622mr60152566b.12.1725040392217;
        Fri, 30 Aug 2024 10:53:12 -0700 (PDT)
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Christian Lindig <christian.lindig@citrix.com>,
	David Scott <dave@recoil.org>,
	=?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= <edwin.torok@cloud.com>,
	Rob Hoes <Rob.Hoes@citrix.com>,
	Andrii Sultanov <andrii.sultanov@cloud.com>
Subject: [PATCH] tools/ocaml/xc: Drop the GC lock for all hypercalls
Date: Fri, 30 Aug 2024 18:53:09 +0100
Message-Id: <20240830175309.2854442-1-andrew.cooper3@citrix.com>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We should be doing this unilaterally.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Christian Lindig <christian.lindig@citrix.com>
CC: David Scott <dave@recoil.org>
CC: Edwin Török <edwin.torok@cloud.com>
CC: Rob Hoes <Rob.Hoes@citrix.com>
CC: Andrii Sultanov <andrii.sultanov@cloud.com>

Also pulled out of a larger cleanup series.
---
 tools/ocaml/libs/xc/xenctrl_stubs.c | 63 +++++++++++++++++++++++++++--
 1 file changed, 60 insertions(+), 3 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index c78191f95abc..20487b21008f 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -312,7 +312,10 @@ CAMLprim value stub_xc_domain_max_vcpus(value xch_val, value domid,
 	xc_interface *xch = xch_of_val(xch_val);
 	int r;
 
+	caml_enter_blocking_section();
 	r = xc_domain_max_vcpus(xch, Int_val(domid), Int_val(max_vcpus));
+	caml_leave_blocking_section();
+
 	if (r)
 		failwith_xc(xch);
 
@@ -329,7 +332,10 @@ value stub_xc_domain_sethandle(value xch_val, value domid, value handle)
 
 	domain_handle_of_uuid_string(h, String_val(handle));
 
+	caml_enter_blocking_section();
 	i = xc_domain_sethandle(xch, Int_val(domid), h);
+	caml_leave_blocking_section();
+
 	if (i)
 		failwith_xc(xch);
 
@@ -391,7 +397,10 @@ CAMLprim value stub_xc_domain_shutdown(value xch_val, value domid, value reason)
 	xc_interface *xch = xch_of_val(xch_val);
 	int ret;
 
+	caml_enter_blocking_section();
 	ret = xc_domain_shutdown(xch, Int_val(domid), Int_val(reason));
+	caml_leave_blocking_section();
+
 	if (ret < 0)
 		failwith_xc(xch);
 
@@ -503,7 +512,10 @@ CAMLprim value stub_xc_domain_getinfo(value xch_val, value domid)
 	xc_domaininfo_t info;
 	int ret;
 
+	caml_enter_blocking_section();
 	ret = xc_domain_getinfo_single(xch, Int_val(domid), &info);
+	caml_leave_blocking_section();
+
 	if (ret < 0)
 		failwith_xc(xch);
 
@@ -546,7 +558,10 @@ CAMLprim value stub_xc_vcpu_context_get(value xch_val, value domid,
 	int ret;
 	vcpu_guest_context_any_t ctxt;
 
+	caml_enter_blocking_section();
 	ret = xc_vcpu_getcontext(xch, Int_val(domid), Int_val(cpu), &ctxt);
+	caml_leave_blocking_section();
+
 	if ( ret < 0 )
 		failwith_xc(xch);
 
@@ -584,10 +599,14 @@ CAMLprim value stub_xc_vcpu_setaffinity(value xch_val, value domid,
 		if (Bool_val(Field(cpumap, i)))
 			c_cpumap[i/8] |= 1 << (i&7);
 	}
+
+	caml_enter_blocking_section();
 	retval = xc_vcpu_setaffinity(xch, Int_val(domid),
 				     Int_val(vcpu),
 				     c_cpumap, NULL,
 				     XEN_VCPUAFFINITY_HARD);
+	caml_leave_blocking_section();
+
 	free(c_cpumap);
 
 	if (retval < 0)
@@ -612,10 +631,13 @@ CAMLprim value stub_xc_vcpu_getaffinity(value xch_val, value domid,
 	if (c_cpumap == NULL)
 		failwith_xc(xch);
 
+	caml_enter_blocking_section();
 	retval = xc_vcpu_getaffinity(xch, Int_val(domid),
 				     Int_val(vcpu),
 				     c_cpumap, NULL,
 				     XEN_VCPUAFFINITY_HARD);
+	caml_leave_blocking_section();
+
 	if (retval < 0) {
 		free(c_cpumap);
 		failwith_xc(xch);
@@ -639,9 +661,13 @@ CAMLprim value stub_xc_sched_id(value xch_val)
 {
 	CAMLparam1(xch_val);
 	xc_interface *xch = xch_of_val(xch_val);
-	int sched_id;
+	int ret, sched_id;
+
+	caml_enter_blocking_section();
+	ret = xc_sched_id(xch, &sched_id);
+	caml_leave_blocking_section();
 
-	if (xc_sched_id(xch, &sched_id))
+	if (ret)
 		failwith_xc(xch);
 
 	CAMLreturn(Val_int(sched_id));
@@ -674,7 +700,10 @@ CAMLprim value stub_xc_evtchn_reset(value xch_val, value domid)
 	xc_interface *xch = xch_of_val(xch_val);
 	int r;
 
+	caml_enter_blocking_section();
 	r = xc_evtchn_reset(xch, Int_val(domid));
+	caml_leave_blocking_section();
+
 	if (r < 0)
 		failwith_xc(xch);
 	CAMLreturn(Val_unit);
@@ -811,7 +840,10 @@ CAMLprim value stub_xc_send_debug_keys(value xch_val, value keys)
 	xc_interface *xch = xch_of_val(xch_val);
 	int r;
 
+	caml_enter_blocking_section();
 	r = xc_send_debug_keys(xch, String_val(keys));
+	caml_leave_blocking_section();
+
 	if (r)
 		failwith_xc(xch);
 	CAMLreturn(Val_unit);
@@ -952,7 +984,11 @@ CAMLprim value stub_xc_domain_set_memmap_limit(value xch_val, value domid,
 	int retval;
 
 	v = Int64_val(map_limitkb);
+
+	caml_enter_blocking_section();
 	retval = xc_domain_set_memmap_limit(xch, Int_val(domid), v);
+	caml_leave_blocking_section();
+
 	if (retval)
 		failwith_xc(xch);
 
@@ -1203,8 +1239,11 @@ CAMLprim value stub_xc_domain_ioport_permission(value xch_val, value domid,
 	c_nr_ports = Int_val(nr_ports);
 	c_allow = Bool_val(allow);
 
+	caml_enter_blocking_section();
 	ret = xc_domain_ioport_permission(xch, Int_val(domid),
 					 c_start_port, c_nr_ports, c_allow);
+	caml_leave_blocking_section();
+
 	if (ret < 0)
 		failwith_xc(xch);
 
@@ -1225,8 +1264,11 @@ CAMLprim value stub_xc_domain_iomem_permission(value xch_val, value domid,
 	c_nr_pfns = Nativeint_val(nr_pfns);
 	c_allow = Bool_val(allow);
 
+	caml_enter_blocking_section();
 	ret = xc_domain_iomem_permission(xch, Int_val(domid),
 					 c_start_pfn, c_nr_pfns, c_allow);
+	caml_leave_blocking_section();
+
 	if (ret < 0)
 		failwith_xc(xch);
 
@@ -1245,8 +1287,11 @@ CAMLprim value stub_xc_domain_irq_permission(value xch_val, value domid,
 	c_pirq = Int_val(pirq);
 	c_allow = Bool_val(allow);
 
+	caml_enter_blocking_section();
 	ret = xc_domain_irq_permission(xch, Int_val(domid),
 				       c_pirq, c_allow);
+	caml_leave_blocking_section();
+
 	if (ret < 0)
 		failwith_xc(xch);
 
@@ -1309,7 +1354,9 @@ CAMLprim value stub_xc_domain_test_assign_device(value xch_val, value domid, val
 	func = Int_val(Field(desc, 3));
 	sbdf = encode_sbdf(domain, bus, dev, func);
 
+	caml_enter_blocking_section();
 	ret = xc_test_assign_device(xch, Int_val(domid), sbdf);
+	caml_leave_blocking_section();
 
 	CAMLreturn(Val_bool(ret == 0));
 }
@@ -1328,8 +1375,10 @@ CAMLprim value stub_xc_domain_assign_device(value xch_val, value domid, value de
 	func = Int_val(Field(desc, 3));
 	sbdf = encode_sbdf(domain, bus, dev, func);
 
+	caml_enter_blocking_section();
 	ret = xc_assign_device(xch, Int_val(domid), sbdf,
 			       XEN_DOMCTL_DEV_RDM_RELAXED);
+	caml_leave_blocking_section();
 
 	if (ret < 0)
 		failwith_xc(xch);
@@ -1350,7 +1399,9 @@ CAMLprim value stub_xc_domain_deassign_device(value xch_val, value domid, value
 	func = Int_val(Field(desc, 3));
 	sbdf = encode_sbdf(domain, bus, dev, func);
 
+	caml_enter_blocking_section();
 	ret = xc_deassign_device(xch, Int_val(domid), sbdf);
+	caml_leave_blocking_section();
 
 	if (ret < 0)
 		failwith_xc(xch);
@@ -1379,8 +1430,11 @@ CAMLprim value stub_xc_get_cpu_featureset(value xch_val, value idx)
 		/* To/from hypervisor to retrieve actual featureset */
 		uint32_t fs[fs_len], len = fs_len;
 		unsigned int i;
+		int ret;
 
-		int ret = xc_get_cpu_featureset(xch, Int_val(idx), &len, fs);
+		caml_enter_blocking_section();
+		ret = xc_get_cpu_featureset(xch, Int_val(idx), &len, fs);
+		caml_leave_blocking_section();
 
 		if (ret)
 			failwith_xc(xch);
@@ -1403,7 +1457,10 @@ CAMLprim value stub_xc_watchdog(value xch_val, value domid, value timeout)
 	int ret;
 	unsigned int c_timeout = Int32_val(timeout);
 
+	caml_enter_blocking_section();
 	ret = xc_watchdog(xch, Int_val(domid), c_timeout);
+	caml_leave_blocking_section();
+
 	if (ret < 0)
 		failwith_xc(xch);
 
-- 
2.39.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 18:51:39 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 18:51:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786578.1196164 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk6iQ-00043w-Du; Fri, 30 Aug 2024 18:51:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786578.1196164; Fri, 30 Aug 2024 18:51:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk6iQ-00043p-AP; Fri, 30 Aug 2024 18:51:22 +0000
Received: by outflank-mailman (input) for mailman id 786578;
 Fri, 30 Aug 2024 18:51:20 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk6iO-00043f-DI; Fri, 30 Aug 2024 18:51:20 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk6iO-0004WD-2W; Fri, 30 Aug 2024 18:51:20 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk6iN-00015C-Kj; Fri, 30 Aug 2024 18:51:19 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sk6iN-0002m5-KI; Fri, 30 Aug 2024 18:51:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=+5L2o/F7ILd8KYVJPw4WZ00TiX3GBrvhUwKE91k43r8=; b=fUlhwArkJTs11+Rirk7T69odDW
	hhEQaIIl9d4h5NbjlKBsxqrx7KJHFSshWeg3q1MZ+N6WBbR+K1cwSAxeBrA0xChaljsCiOFcPlA/7
	21VRCOn/PE9k/LJCtwLttvz0OOXJLNGDOkFyp6qI+YFEF34GWpvumK46VLDzRxkGShiQ=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187412-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187412: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=1b5fe53681d9c388f1600310fe3488091701d4d0
X-Osstest-Versions-That:
    linux=d5d547aa7b51467b15d9caa86b116f8c2507c72a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 18:51:19 +0000

flight 187412 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187412/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187401
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187401
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187401
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187401
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail like 187401
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187401
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187401
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                1b5fe53681d9c388f1600310fe3488091701d4d0
baseline version:
 linux                d5d547aa7b51467b15d9caa86b116f8c2507c72a

Last test of basis   187401  2024-08-29 10:00:28 Z    1 days
Testing same since   187412  2024-08-30 01:43:43 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Aleksandr Mishin <amishin@t-argos.ru>
  Alexander Sverdlin <alexander.sverdlin@siemens.com>
  Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
  Arınç ÜNAL <arinc.unal@arinc9.com>
  Avraham Stern <avraham.stern@intel.com>
  Benjamin Berg <benjamin.berg@intel.com>
  Brett Creeley <brett.creeley@amd.com>
  Brian Norris <briannorris@chromium.org>
  Cong Wang <cong.wang@bytedance.com>
  Cosmo Chou <chou.cosmo@gmail.com>
  Daniel Gabay <daniel.gabay@intel.com>
  David S. Miller <davem@davemloft.net>
  Dmitry Antipov <dmantipov@yandex.ru>
  Emmanuel Grumbach <emmanuel.grumbach@intel.com>
  Eric Dumazet <edumazet@google.com>
  Eugene Shalygin <eugene.shalygin@gmail.com>
  Greg Ungerer <gerg@kernel.org>
  Guenter Roeck <linux@roeck-us.net>
  Haiyang Zhang <haiyangz@microsoft.com>
  Jacky Chou <jacky_chou@aspeedtech.com>
  Jakub Kicinski <kuba@kernel.org>
  Jamie Bainbridge <jamie.bainbridge@gmail.com>
  Jay Vosburgh <jv@jvosburgh.net>
  Jianbo Liu <jianbol@nvidia.com>
  Johannes Berg <johannes.berg@intel.com>
  Kalle Valo <kvalo@kernel.org>
  Kees Cook <kees@kernel.org>
  Kiran K <kiran.k@intel.com>
  Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
  Linus Torvalds <torvalds@linux-foundation.org>
  Lorenzo Colitti <lorenzo@google.com>
  Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  Matthieu Baerts (NGI0) <matttbe@kernel.org>
  Max Filippov <jcmvbkbc@gmail.com>
  MD Danish Anwar <danishanwar@ti.com>
  Miri Korenblit <miriam.rachel.korenblit@intel.com>
  Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
  Ondrej Mosnacek <omosnace@redhat.com>
  Pablo Neira Ayuso <pablo@netfilter.org>
  Paolo Abeni <pabeni@redhat.com>
  Paul Moore <paul@paul-moore.com> (LSM/SELinux)
  Petr Machata <petrm@nvidia.com>
  Ross Brown <true.robot.ross@gmail.com>
  Sascha Hauer <s.hauer@pengutronix.de>
  Sriram Yagnaraman <sriram.yagnaraman@ericsson.com>
  Stephen Brennan <stephen.s.brennan@oracle.com>
  Stephen Hemminger <stephen@networkplumber.org>
  Tariq Toukan <tariqt@nvidia.com>
  Xin Long <lucien.xin@gmail.com>
  Xueming Feng <kuro@kuroa.me>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   d5d547aa7b514..1b5fe53681d9c  1b5fe53681d9c388f1600310fe3488091701d4d0 -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 19:17:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 19:17:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786589.1196173 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk77y-0000Ad-Hc; Fri, 30 Aug 2024 19:17:46 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786589.1196173; Fri, 30 Aug 2024 19:17:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk77y-0000AW-E6; Fri, 30 Aug 2024 19:17:46 +0000
Received: by outflank-mailman (input) for mailman id 786589;
 Fri, 30 Aug 2024 19:17:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YGfl=P5=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sk77x-0000AO-Ca
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 19:17:45 +0000
Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com
 [2a00:1450:4864:20::62a])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 8883e518-6704-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 21:17:44 +0200 (CEST)
Received: by mail-ej1-x62a.google.com with SMTP id
 a640c23a62f3a-a86883231b4so248016266b.3
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 12:17:44 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89891d86cesm248608466b.171.2024.08.30.12.17.42
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 30 Aug 2024 12:17:42 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8883e518-6704-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1725045463; x=1725650263; 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=eO8ZjtEt7FVT4/B3qnuF54I6LroN/wGF9mWRE2zybd0=;
        b=biSE8wco4Jh/wASWsPPY/57IJXVSCVNW2iaHS3y17xtfhSfNYcKag41M8sV0X7lXWW
         +RLnUB2B7MD+4XF3n0Ri+L55LT9vU/2bwl/Zs501a0a8RwkS7C5MsFlckDyRZjqs2hyr
         7R8YdBXxpk2Su5G5deTfCqJS7kDuOTJAji1fk=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725045463; x=1725650263;
        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=eO8ZjtEt7FVT4/B3qnuF54I6LroN/wGF9mWRE2zybd0=;
        b=rlnApMfALhvL0PaEUc/UvEKMng0Cp+Q+arpNEqR+6yO0Pxq2I4GCUaWRcavdkHBOZl
         bXtw2JdyPARZos3LDL1cPklwKeqG8IIlR+HT7xP9ZHqNgQsrUa5cT4CnDsBfUBAfwtLS
         nDfuKfUzXzq54e0WfVMlmYX8psAgFd0lxJrmRpLjZM4LFWU556Qx3H7b6j/vM0kyGvuD
         x6VfJyGALvE/W92+qOt1zBN/O6AdpZLnuuBbLvRhjVidEBgrtsKk/WkbCtEAwvGw33pr
         hv7dyfaftUsxOvJibWYrwbSEK3i2kC1ht9pUkacLLYsWubILqqMz9mWFQHSLNDeFfCWj
         RD2w==
X-Forwarded-Encrypted: i=1; AJvYcCVOF6XOnJIVDZUn4WXmuFz+nv1w25lYopbZrznPt0ReFcEXTU4myh9kElkG6yJ0nGfJvUplF2whMok=@lists.xenproject.org
X-Gm-Message-State: AOJu0YyoyhA/SdwOPw5nPSQ8Ollz8LL1Tl7CNmuRnXQDOItzmHcE7Vnt
	KkrKqp5Xug58AMZCY84io/DvhTjRzuGhvlQ/yzuhpmE5v0/u9UQF8dOYC2Std/M=
X-Google-Smtp-Source: AGHT+IFk9hgH0RW+arGfWxloBxZws9ePC3bBZvtzDLMNlBWOygCd51NPEgan3/NreQPGSAwzaMfTeA==
X-Received: by 2002:a17:907:1c27:b0:a86:8197:8df9 with SMTP id a640c23a62f3a-a897fad5066mr622007666b.66.1725045463013;
        Fri, 30 Aug 2024 12:17:43 -0700 (PDT)
Message-ID: <9ac39818-2259-4aa2-8bc6-17809fe62368@citrix.com>
Date: Fri, 30 Aug 2024 20:17:40 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v5 7/8] x86/mm: add defensive return
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Jan Beulich <jbeulich@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
 Federico Serafini <federico.serafini@bugseng.com>,
 xen-devel@lists.xenproject.org, consulting@bugseng.com
References: <cover.1722239813.git.federico.serafini@bugseng.com>
 <24501d2e7f5d82d8e5a483a80b35e04ce765a7cf.1722239813.git.federico.serafini@bugseng.com>
 <alpine.DEB.2.22.394.2407291512280.4857@ubuntu-linux-20-04-desktop>
 <alpine.DEB.2.22.394.2408281735020.53815@ubuntu-linux-20-04-desktop>
 <da5d2ccc-6a21-4bcc-8ceb-75b930dcdabe@suse.com>
 <ZtGOWAnqGu-XNCgy@macbook.local>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <ZtGOWAnqGu-XNCgy@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 30/08/2024 10:18 am, Roger Pau Monné wrote:
> On Thu, Aug 29, 2024 at 09:04:37AM +0200, Jan Beulich wrote:
>> On 29.08.2024 02:35, Stefano Stabellini wrote:
>>> On Mon, 29 Jul 2024, Stefano Stabellini wrote:
>>>> On Mon, 29 Jul 2024, Federico Serafini wrote:
>>>>> Add defensive return statement at the end of an unreachable
>>>>> default case. Other than improve safety, this meets the requirements
>>>>> to deviate a violation of MISRA C Rule 16.3: "An unconditional `break'
>>>>> statement shall terminate every switch-clause".
>>>>>
>>>>> Signed-off-by: Federico Serafini <federico.serafini@bugseng.com>
>>>> Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
>>>>
>>>>> ---
>>>>> No changes from v3 and v4, further feedback on this thread would be appreciated:
>>>>> https://lists.xenproject.org/archives/html/xen-devel/2024-07/msg00474.html
>>> Looking at the older threads, I looks like Jan suggested EACCES, I also
>>> think it is marginally better. My R-b stands also for EACCES. Jan, I
>>> think you should go ahead and fix on commit
>> No, I very definitely want a 2nd x86 maintainer opinion here. Or a better
>> suggestion for the error code to use by anyone. After all, as you confirm,
>> EACCES is only marginally better.
> Hm, the only alternative I could suggest is using ERANGE, to signal
> the value of opt_mmio_relax is out of the expected range, however that
> could be confusing for the callers?
>
> One benefit of using ERANGE is that there's currently no return path
> in get_page_from_l1e() with that error code, so it would be very easy
> to spot when an unexpected value of opt_mmio_relax is found.  However
> there are no guarantees that further error paths might use that error
> code.

EPERM and EACCES are both very wrong here.  They imply something that is
simply not appropriate in this context.

We use EILSEQ elsewhere for believed-impossible conditions where we need
an errno of some kind.  I suggest we use it here too.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 19:22:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 19:22:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786594.1196184 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk7Cf-0001dx-1i; Fri, 30 Aug 2024 19:22:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786594.1196184; Fri, 30 Aug 2024 19:22:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk7Ce-0001dq-V0; Fri, 30 Aug 2024 19:22:36 +0000
Received: by outflank-mailman (input) for mailman id 786594;
 Fri, 30 Aug 2024 19:22:35 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YGfl=P5=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sk7Cd-0001dk-L0
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 19:22:35 +0000
Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com
 [2a00:1450:4864:20::12a])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 34765e5a-6705-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 21:22:32 +0200 (CEST)
Received: by mail-lf1-x12a.google.com with SMTP id
 2adb3069b0e04-5353cd2fa28so2858572e87.3
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 12:22:32 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a8989221c24sm242157966b.196.2024.08.30.12.22.30
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 30 Aug 2024 12:22:30 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 34765e5a-6705-11ef-99a1-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1725045752; x=1725650552; 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=FlesElXwYrUPfMC3M2GbQMy2srF6FMwCLcBLJGILsas=;
        b=dN++h7mU3s7YvKN/Gt+0ezQinc+TEQNeZfCQG4i7tDWihB9aD28DGVBI+kZ+fIvt13
         KmQeqpCgvgN6tQd4KL1siFlACpgCwSY9tfdqm5btBqRT2yWJuvYPqYtlXDIkR4Af6cQA
         b3MrFxPf2u8z8z2Uz7K1W5il7hayqkyFcg3u8=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725045752; x=1725650552;
        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=FlesElXwYrUPfMC3M2GbQMy2srF6FMwCLcBLJGILsas=;
        b=XHOGJn9OTwOiHILizgPOHJnBsGu9+SPgErokCFPX6wUEUbzOtE+uuM8nF3wLblTmU/
         qZJMzfzE3meOXmPawSrD5rpSFO20KJFnTtZPCjwgRvtkMNQ+I3CK83MHwpis8gvAsAel
         UgKAqzVJZI5gOmprsgp8SCsFCHNF/+k25xiWsb7ON/rwiyLDFgNlzM9lC4ZZV4Z3lICU
         W2myOnHVHOSnAoOubJwsUTod1UEeaAUURc5D3vP2BYdkikisdrY8/BJf9bGuT13sLB3Y
         v5aJudPK4+aiXkF7NppSZeliSqp/lVSid46VYyHFpzN/SlLo9M+F/429Xo2r27qw+ckK
         DGKg==
X-Gm-Message-State: AOJu0YyX5UhSOKr80CiEpBt2j0RS//fblBW6alumC5Bo4OMraKh+umLJ
	Ij3iJ4Z0ue2ht0JAtQb+wyiu8yEebtm/6mhKMRdXMqJa2Nn0t3Kp6lVMFwSIU4o=
X-Google-Smtp-Source: AGHT+IH0BbU/bbx/kiMwCmcJI8NOctylJgK3dB//FLO2lXENM6HLYJd8HVIRR/i5u75/95oT9hU41Q==
X-Received: by 2002:a05:6512:2814:b0:530:dab8:7dde with SMTP id 2adb3069b0e04-53546b451b4mr1993298e87.34.1725045751409;
        Fri, 30 Aug 2024 12:22:31 -0700 (PDT)
Message-ID: <dc7d8179-b2c9-4ec8-99e5-5a901b751832@citrix.com>
Date: Fri, 30 Aug 2024 20:22:29 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [XEN PATCH v2 1/3] libxl: Fix nul-termination of the return value
 of libxl_xen_console_read_line()
To: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Javi Merino <javi.merino@cloud.com>
Cc: xen-devel@lists.xenproject.org, jbeulich@suse.com,
 Anthony PERARD <anthony.perard@vates.tech>, Juergen Gross <jgross@suse.com>,
 =?UTF-8?B?RWR3aW4gVMO2csO2aw==?= <edwin.torok@cloud.com>
References: <cover.1724430173.git.javi.merino@cloud.com>
 <b1c7eb226ce62f50d6a50baa3977830a31fa5c9b.1724430173.git.javi.merino@cloud.com>
 <ZtCZjJVG-7daxcxb@macbook.local>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <ZtCZjJVG-7daxcxb@macbook.local>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 29/08/2024 4:53 pm, Roger Pau Monné wrote:
> On Fri, Aug 23, 2024 at 06:05:03PM +0100, Javi Merino wrote:
>> When built with ASAN, "xl dmesg" crashes in the "printf("%s", line)"
>> call in main_dmesg().  ASAN reports a heap buffer overflow: an
>> off-by-one access to cr->buffer.
>>
>> The readconsole sysctl copies up to count characters into the buffer,
>> but it does not add a null character at the end.  Despite the
>> documentation of libxl_xen_console_read_line(), line_r is not
>> nul-terminated if 16384 characters were copied to the buffer.
>>
>> Fix this by asking xc_readconsolering() to fill the buffer up to size
>> - 1.  As the number of characters in the buffer is only needed in
>> libxl_xen_console_read_line(), make it a local variable there instead
>> of part of the libxl__xen_console_reader struct.
> Instead of playing games with the buffer size in order to add an extra
> NUL character, we could possibly use libxl_write_exactly(ctx,
> STDOUT_FILENO,...) in main_dmesg(), using cr->count as the buffer
> length?

Sadly no.

struct libxl__xen_console_reader (which has the count field) is a libxl
private (opaque) type which `xl` can't access.

Otherwise this would be a oneline fix already...

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 19:33:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 19:33:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786602.1196194 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk7N0-0003rA-Vi; Fri, 30 Aug 2024 19:33:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786602.1196194; Fri, 30 Aug 2024 19:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk7N0-0003r3-Sw; Fri, 30 Aug 2024 19:33:18 +0000
Received: by outflank-mailman (input) for mailman id 786602;
 Fri, 30 Aug 2024 19:33:17 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YGfl=P5=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sk7Mz-0003qx-1j
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 19:33:17 +0000
Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com
 [2a00:1450:4864:20::62b])
 by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id b36ad83c-6706-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 21:33:15 +0200 (CEST)
Received: by mail-ej1-x62b.google.com with SMTP id
 a640c23a62f3a-a8677ae5a35so236352366b.0
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 12:33:15 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89891da22bsm244749466b.182.2024.08.30.12.33.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 30 Aug 2024 12:33:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b36ad83c-6706-11ef-99a1-01e77a169b0f
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1725046394; x=1725651194; 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=kUTKmBU9MMaOEmcCXoXNsZMfgR4Ehc4WJxU3g0vHFuQ=;
        b=DvG8MURsHs9OgUnqwjDvwWMR6YLXedwy5Os2L9SmUTCMuGSxLb6rWdMtVtF2CH7yVG
         bag6bP3D5vx+EGpvJsxTwiZKnmVMmzyNXt1FzFbosUVlj8OLTji1kP5wOuV3mIFUb4Y0
         q7XZsLOZXnDC1yfR7LQjhb13iGvahDESuiciI=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725046394; x=1725651194;
        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=kUTKmBU9MMaOEmcCXoXNsZMfgR4Ehc4WJxU3g0vHFuQ=;
        b=qNUS/mBP53qrAiSrhPiPtxuweWYCHOCCTWeHfOGx+c8anrhj/9RGsyWvcCVmz2vB+z
         3fdYirJvdRTeJC+SepZRxY5aTimMuXIKkbNX9h6FmBmoJ9THmSifsMlePxsnVSoQUAS9
         ClrEWZ0tvohmVq3VG8vjlKYYgUDii9j92ir42KmZKYLlyCucj1yXYUbr+VhNdwSR3m9a
         xrMJ/nWtgCxE7uST0bM9Ze3gnPNEbb0fV9koAeeYwmME2hdSM135qx5KI4JV8i5on/6+
         z2VShXNTH1hlz9ISgqGhqYp+rfFN1EwN/+AH3Yc97UOfazuGzqPcbhDbGuDPp8jTu894
         pxrw==
X-Forwarded-Encrypted: i=1; AJvYcCUrPvLpzyO8ZyB8+hZHAHI7uv3fZgXlZVaPIHq/kd0FxuNkhU6oafftWV6Conpb4lxh5GZ8EqvokLI=@lists.xenproject.org
X-Gm-Message-State: AOJu0YwMC67hZ0X3QzfjAJm0Obg6CXB9d/nOgsNp6t1enTgAhVOpJ27F
	3cuW98zyvmh0p+7iS47QqM4sjIF5HedTGzQ9iv79K46cKsm9m+Fxj3W+02We5r0=
X-Google-Smtp-Source: AGHT+IEE2bxYGxUQ738mUgAXWfF2fqvmmj26ELQL7sMa1A54T+bSfomBHbiiw6Zzht9xFugXbqDYxA==
X-Received: by 2002:a17:907:3f2a:b0:a86:bb90:93fa with SMTP id a640c23a62f3a-a897fa75198mr536567966b.44.1725046394002;
        Fri, 30 Aug 2024 12:33:14 -0700 (PDT)
Message-ID: <bc04ec24-a273-408c-9342-ec37c4951f1a@citrix.com>
Date: Fri, 30 Aug 2024 20:33:11 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 02/11] xen/bitops: Switch from __pure to attr_const
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Stefano Stabellini <sstabellini@kernel.org>, Julien Grall <julien@xen.org>,
 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
 Bertrand Marquis <bertrand.marquis@arm.com>,
 Michal Orzel <michal.orzel@amd.com>,
 Oleksii Kurochko <oleksii.kurochko@gmail.com>,
 Shawn Anastasio <sanastasio@raptorengineering.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
 <20240828220351.2686408-3-andrew.cooper3@citrix.com>
 <116eba82-9075-4d38-86b7-6ee0001b4a87@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <116eba82-9075-4d38-86b7-6ee0001b4a87@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 29/08/2024 3:07 pm, Jan Beulich wrote:
> On 29.08.2024 00:03, Andrew Cooper wrote:
>> All of the ffs()/fls() infrastructure is in fact (attr) const, because it
>> doesn't even read global state.  This allows the compiler even more
>> flexibility to optimise.
>>
>> No functional change.
>>
>> Reported-by: Jan Beulich <JBeulich@suse.com>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: Roger Pau Monné <roger.pau@citrix.com>
>> CC: Stefano Stabellini <sstabellini@kernel.org>
>> CC: Julien Grall <julien@xen.org>
>> CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
>> CC: Bertrand Marquis <bertrand.marquis@arm.com>
>> CC: Michal Orzel <michal.orzel@amd.com>
>> CC: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>> CC: Shawn Anastasio <sanastasio@raptorengineering.com>
>>
>> v2:
>>  * New
>> ---
>>  xen/include/xen/bitops.h | 16 ++++++++--------
>>  1 file changed, 8 insertions(+), 8 deletions(-)
> The various arch_* forms didn't have __pure and hence also don't gain
> attr_const presumably because we deem these attributes ineffectual for
> always-inline functions? On that basis
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

It's not quite that.

The non static-inline ones definitely do need the attribute.  That's the
only thing the optimiser has to operate with.

The static inlines shouldn't need it for GCC's benefit.  GCC will
apparently (according to buzilla) silently drop the attribute if it
believes it to have been erroneous.

However, Eclair does care about the attributes even on static-inlines as
part of it's side-effects analysis for various rules.

Therefore I've been putting the attributes on the APIs we expect code to
be using, but not on the arch_* infrastructure.  Whether this is the
right balance remains to be seen.

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 19:57:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 19:57:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786608.1196204 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk7kI-0000Fi-NT; Fri, 30 Aug 2024 19:57:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786608.1196204; Fri, 30 Aug 2024 19:57:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk7kI-0000Fb-Ku; Fri, 30 Aug 2024 19:57:22 +0000
Received: by outflank-mailman (input) for mailman id 786608;
 Fri, 30 Aug 2024 19:57:21 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk7kH-0000FQ-8c; Fri, 30 Aug 2024 19:57:21 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk7kG-0005na-2Y; Fri, 30 Aug 2024 19:57:20 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk7kF-0002ey-PG; Fri, 30 Aug 2024 19:57:19 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sk7kF-00027Q-K7; Fri, 30 Aug 2024 19:57:19 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=zRNaUR723IFkm2EmJ3JYpcS+b+znMROgvXffBZhLzzY=; b=BcfH8rnK7bn2w8n5+yAGeXKVVC
	1eSjPD4GLWhSr1NRNZkNMbAmHPONcPjmAj5vbPdj7THwHYqTwN3IY2T32od4G7HYLPUzNfHOePo6Y
	rOhmMGt9SjHqntHbh89boPOxguzHfKVg3rk07KUwpPFwFRa0kYh//FsVB9AfrpHYx2xs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187426-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xtf test] 187426: all pass - PUSHED
X-Osstest-Versions-This:
    xtf=f503efe8e5cf8858ec0704f1aaa82d0bf50891a5
X-Osstest-Versions-That:
    xtf=f37c4574dd79d058c035be989ac6648508556a1a
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 19:57:19 +0000

flight 187426 xtf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187426/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 xtf                  f503efe8e5cf8858ec0704f1aaa82d0bf50891a5
baseline version:
 xtf                  f37c4574dd79d058c035be989ac6648508556a1a

Last test of basis   186995  2024-07-25 01:11:38 Z   36 days
Testing same since   187426  2024-08-30 18:41:32 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Bernhard Kaindl <bernhard.kaindl@cloud.com>

jobs:
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-amd64-pvops                                            pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xtf.git
   f37c457..f503efe  f503efe8e5cf8858ec0704f1aaa82d0bf50891a5 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 20:03:16 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 20:03:16 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786618.1196214 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk7pr-0001sB-GD; Fri, 30 Aug 2024 20:03:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786618.1196214; Fri, 30 Aug 2024 20:03:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk7pr-0001s4-Cr; Fri, 30 Aug 2024 20:03:07 +0000
Received: by outflank-mailman (input) for mailman id 786618;
 Fri, 30 Aug 2024 20:03:06 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=YGfl=P5=cloud.com=andrew.cooper@srs-se1.protection.inumbo.net>)
 id 1sk7pq-0001ry-Bo
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 20:03:06 +0000
Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com
 [2a00:1450:4864:20::12d])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dea79372-670a-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 22:03:05 +0200 (CEST)
Received: by mail-lf1-x12d.google.com with SMTP id
 2adb3069b0e04-5343d2af735so2135387e87.1
 for <xen-devel@lists.xenproject.org>; Fri, 30 Aug 2024 13:03:05 -0700 (PDT)
Received: from [10.125.226.166] ([185.25.67.249])
 by smtp.gmail.com with ESMTPSA id
 a640c23a62f3a-a89891d8109sm250529666b.174.2024.08.30.13.03.03
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 30 Aug 2024 13:03:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dea79372-670a-11ef-a0b1-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=citrix.com; s=google; t=1725048185; x=1725652985; 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=IEzcl/YiJ1rAH/kUkVYmX+0WnDcSPCERYm84t9TlZVI=;
        b=IOYi1CEArp1Var4H2HzFpkEJg2okyevW0sQwrlHzeK1x8a6zxRkFzRCBNE50mU4H4v
         Q1OwdyMxdYBOUlwmxtvtiCUwnl7EwzCfiNVYmFIHYAd7XT3ICud7A3yAaxDGdAmHhH5c
         YUmZ8X3ucOjoRoMM4vm/x043p0Kbz7rj6zePo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725048185; x=1725652985;
        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=IEzcl/YiJ1rAH/kUkVYmX+0WnDcSPCERYm84t9TlZVI=;
        b=q6xOVoJufsHupOajtt36niYFfdnClSkkPfeoFK5eZ/C7ctAb5M+u3S456X5ql5LNTz
         SUfpL0khdyW8MQf107px0UkY2oeYYeTT7PYNCZRteA8z05VEgWWokY+0+R33GmRyanUS
         6leqBBgvGD9jPFvKf3ORg2iNzRmEbjQ8t2+9k2Va4aFtxyiCpkrjioDzy8qHrCvx7E7/
         rAr4U/JPTqPOkjEb92LnUTZjhhrPclmI48ECpKYNyTKGZ3J5rgnzUoUoin1AEhjflL50
         7g4lqShk8a2nc0mNUzEnz5eM0Xzm2oBIYb+7pkjIelZT8oWR3BV4jfnfWvX/AWHQ0kBm
         +VIQ==
X-Forwarded-Encrypted: i=1; AJvYcCXTt5R+UeSIXiC/wkG5N+9lt3KxIk09LCcX/D2p3ht6VEZOvkurqM10gI5RMeRCGELEu84byvQjM1M=@lists.xenproject.org
X-Gm-Message-State: AOJu0YznXnta8lqeyJtcgfoVE8RhFrL9je9DW97WI2q/NGMEtp7KthRL
	hnE6Ie8LZxNhDsTtKKJYKsG3YaZaGpUF3ejr2yix5nF073uLcXJ1tfBQUOgAUHs=
X-Google-Smtp-Source: AGHT+IHZys1vcCxPv6W/WFOruS00mETlobf+qpqkcFkDsWOoH1HbHlWi/YVMLbWelGwU95bi5mZrQQ==
X-Received: by 2002:a05:6512:3f17:b0:52d:b226:9428 with SMTP id 2adb3069b0e04-53546afd97emr2453458e87.6.1725048184231;
        Fri, 30 Aug 2024 13:03:04 -0700 (PDT)
Message-ID: <f661dca1-0583-4a83-89db-662473749df8@citrix.com>
Date: Fri, 30 Aug 2024 21:03:02 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: [PATCH v2 11/11] x86/bitops: Use the POPCNT instruction when
 available
To: Jan Beulich <jbeulich@suse.com>
Cc: =?UTF-8?Q?Roger_Pau_Monn=C3=A9?= <roger.pau@citrix.com>,
 Xen-devel <xen-devel@lists.xenproject.org>
References: <20240828220351.2686408-1-andrew.cooper3@citrix.com>
 <20240828220351.2686408-12-andrew.cooper3@citrix.com>
 <48377e77-2458-439c-b594-21bde610ffbb@suse.com>
Content-Language: en-GB
From: Andrew Cooper <andrew.cooper3@citrix.com>
Autocrypt: addr=andrew.cooper3@citrix.com; keydata=
 xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp
 VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn
 srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR
 Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E
 ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5
 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe
 LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV
 e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5
 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ
 ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v
 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI
 CwUWAgMBAAIeAQIXgAUCWKD95wIZAQAKCRBlw/kGpdefoHbdD/9AIoR3k6fKl+RFiFpyAhvO
 59ttDFI7nIAnlYngev2XUR3acFElJATHSDO0ju+hqWqAb8kVijXLops0gOfqt3VPZq9cuHlh
 IMDquatGLzAadfFx2eQYIYT+FYuMoPZy/aTUazmJIDVxP7L383grjIkn+7tAv+qeDfE+txL4
 SAm1UHNvmdfgL2/lcmL3xRh7sub3nJilM93RWX1Pe5LBSDXO45uzCGEdst6uSlzYR/MEr+5Z
 JQQ32JV64zwvf/aKaagSQSQMYNX9JFgfZ3TKWC1KJQbX5ssoX/5hNLqxMcZV3TN7kU8I3kjK
 mPec9+1nECOjjJSO/h4P0sBZyIUGfguwzhEeGf4sMCuSEM4xjCnwiBwftR17sr0spYcOpqET
 ZGcAmyYcNjy6CYadNCnfR40vhhWuCfNCBzWnUW0lFoo12wb0YnzoOLjvfD6OL3JjIUJNOmJy
 RCsJ5IA/Iz33RhSVRmROu+TztwuThClw63g7+hoyewv7BemKyuU6FTVhjjW+XUWmS/FzknSi
 dAG+insr0746cTPpSkGl3KAXeWDGJzve7/SBBfyznWCMGaf8E2P1oOdIZRxHgWj0zNr1+ooF
 /PzgLPiCI4OMUttTlEKChgbUTQ+5o0P080JojqfXwbPAyumbaYcQNiH1/xYbJdOFSiBv9rpt
 TQTBLzDKXok86M7BTQRS4TZ/ARAAkgqudHsp+hd82UVkvgnlqZjzz2vyrYfz7bkPtXaGb9H4
 Rfo7mQsEQavEBdWWjbga6eMnDqtu+FC+qeTGYebToxEyp2lKDSoAsvt8w82tIlP/EbmRbDVn
 7bhjBlfRcFjVYw8uVDPptT0TV47vpoCVkTwcyb6OltJrvg/QzV9f07DJswuda1JH3/qvYu0p
 vjPnYvCq4NsqY2XSdAJ02HrdYPFtNyPEntu1n1KK+gJrstjtw7KsZ4ygXYrsm/oCBiVW/OgU
 g/XIlGErkrxe4vQvJyVwg6YH653YTX5hLLUEL1NS4TCo47RP+wi6y+TnuAL36UtK/uFyEuPy
 wwrDVcC4cIFhYSfsO0BumEI65yu7a8aHbGfq2lW251UcoU48Z27ZUUZd2Dr6O/n8poQHbaTd
 6bJJSjzGGHZVbRP9UQ3lkmkmc0+XCHmj5WhwNNYjgbbmML7y0fsJT5RgvefAIFfHBg7fTY/i
 kBEimoUsTEQz+N4hbKwo1hULfVxDJStE4sbPhjbsPCrlXf6W9CxSyQ0qmZ2bXsLQYRj2xqd1
 bpA+1o1j2N4/au1R/uSiUFjewJdT/LX1EklKDcQwpk06Af/N7VZtSfEJeRV04unbsKVXWZAk
 uAJyDDKN99ziC0Wz5kcPyVD1HNf8bgaqGDzrv3TfYjwqayRFcMf7xJaL9xXedMcAEQEAAcLB
 XwQYAQgACQUCUuE2fwIbDAAKCRBlw/kGpdefoG4XEACD1Qf/er8EA7g23HMxYWd3FXHThrVQ
 HgiGdk5Yh632vjOm9L4sd/GCEACVQKjsu98e8o3ysitFlznEns5EAAXEbITrgKWXDDUWGYxd
 pnjj2u+GkVdsOAGk0kxczX6s+VRBhpbBI2PWnOsRJgU2n10PZ3mZD4Xu9kU2IXYmuW+e5KCA
 vTArRUdCrAtIa1k01sPipPPw6dfxx2e5asy21YOytzxuWFfJTGnVxZZSCyLUO83sh6OZhJkk
 b9rxL9wPmpN/t2IPaEKoAc0FTQZS36wAMOXkBh24PQ9gaLJvfPKpNzGD8XWR5HHF0NLIJhgg
 4ZlEXQ2fVp3XrtocHqhu4UZR4koCijgB8sB7Tb0GCpwK+C4UePdFLfhKyRdSXuvY3AHJd4CP
 4JzW0Bzq/WXY3XMOzUTYApGQpnUpdOmuQSfpV9MQO+/jo7r6yPbxT7CwRS5dcQPzUiuHLK9i
 nvjREdh84qycnx0/6dDroYhp0DFv4udxuAvt1h4wGwTPRQZerSm4xaYegEFusyhbZrI0U9tJ
 B8WrhBLXDiYlyJT6zOV2yZFuW47VrLsjYnHwn27hmxTC/7tvG3euCklmkn9Sl9IAKFu29RSo
 d5bD8kMSCYsTqtTfT6W4A3qHGvIDta3ptLYpIAOD2sY3GYq2nf3Bbzx81wZK14JdDDHUX2Rs
 6+ahAA==
In-Reply-To: <48377e77-2458-439c-b594-21bde610ffbb@suse.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On 29/08/2024 3:36 pm, Jan Beulich wrote:
> On 29.08.2024 00:03, Andrew Cooper wrote:
>> It has existed in x86 CPUs since 2008, so we're only 16 years late adding
>> support.  With all the other scafolding in place, implement arch_hweightl()
>> for x86.
>>
>> The only complication is that the call to arch_generic_hweightl() is behind
>> the compilers back.  Address this by writing it in ASM and ensure that it
>> preserves all registers.
>>
>> Copy the code generation from generic_hweightl().  It's not a complicated
>> algorithm, and is easy to regenerate if needs be, but cover it with the same
>> unit tests as test_generic_hweightl() just for piece of mind.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>> CC: Jan Beulich <JBeulich@suse.com>
>> CC: Roger Pau Monné <roger.pau@citrix.com>
>>
>> v2:
>>  * Fix MISRA 8.2 (parameter name) and 8.5 (single declaration) regressions.
>>  * Rename {arch->x86}-generic-hweightl.{S->c}
>>  * Adjust ASM formating
>>
>> The __constructor trick to cause any reference to $foo() to pull in
>> test_$foo() only works when both are in the same TU.  i.e. what I did in
>> v1 (putting test_arch_generic_hweightl() in the regular generic-hweightl.c)
>> didn't work.
> I'm afraid I don't understand this. What exactly didn't work, breaking in which
> way? Presumably as much as you, I don't really like the global asm() in a C
> file, when ideally the same could be written with less clutter in an assembly
> one.

We have lib-y because we wish to not include arch_generic_hweightl() if
it isn't referenced.

But, test_arch_generic_hweightl() unconditionally references
arch_generic_hweightl() (in CONFIG_SELF_TESTS builds).

So, the trick is to have both {test_,}arch_generic_hweightl() together
in the same object file, with test_* being entirely self contained as a
constructor.

That way, if and only if something else references
arch_generic_hweightl() do we pull in this object file, and pick up the
tests as side effect.


v1 of this patch had the test in a separate object file, causing
arch_generic_hweightl() to be referenced based on the inclusion criteria
for regular generic-hweightl.c

This patch causes the x86 build of Xen to no longer reference
generic_hweightl(), so it was excluded along with its own tests, and
test_arch_generic_hweightl().

Therefore, we had arch_generic_hweightl() in use, but the selftests not
included.


Both {test_,}arch_generic_hweightl() do need to be in the same TU for
this to work (nicely), and I'm very uninterested in writing
test_arch_generic_hweightl() in asm.


>
>> This in turn means that arch_generic_hweightl() needs writing in a global asm
>> block, and also that we can't use FUNC()/END().  While we could adjust it to
>> work for GCC/binutils, we can't have CPP macros in Clang-IAS strings.
> What does Clang different from gcc there? I was hoping that at least their pre-
> processors would work in (sufficiently) similar ways.

It's inside a string, not outside, so CPP on the C file does nothing.

Passing CPP over the intermediate .S would work, but we don't have an
intermediate .S with Clang-IAS.

I'm also not particularly interested in doubling up xen/linkage.h with
different quoting in !__ASSEMBLY__ case.


One other option which comes to mind is to have:

    .macro func name
        FUNC(\name)
    .endm

which (I think) could be used as:

    asm (
        "FUNC foo\n\t"
        ...
        "ret\n\t"
        "END foo"
    );

It reads almost the same, and avoids opencoding contents of FUNC, but
even this requires changing the __ASSEMBLY__-ness of linkage.h and I
can't see a nice way of making it happen.

Or we finally bump our minimum toolchain version...  GCC 7 is already
old enough to be out of the recent LTS's...

~Andrew


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 20:11:30 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 20:11:30 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786623.1196223 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk7xu-0004AS-7X; Fri, 30 Aug 2024 20:11:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786623.1196223; Fri, 30 Aug 2024 20:11:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk7xu-0004AL-4t; Fri, 30 Aug 2024 20:11:26 +0000
Received: by outflank-mailman (input) for mailman id 786623;
 Fri, 30 Aug 2024 20:11:25 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk7xt-0004AB-BD; Fri, 30 Aug 2024 20:11:25 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk7xs-0006AD-Ui; Fri, 30 Aug 2024 20:11:24 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk7xs-0003dB-Ie; Fri, 30 Aug 2024 20:11:24 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sk7xs-0000M3-Hz; Fri, 30 Aug 2024 20:11:24 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=UTIdsEnHp5+gX6q+80UAziUma/8q/bcyr6Z9BRN+wds=; b=KgXD/aPF+Hfpvd6lv94MAbx6eA
	DnBxqZpkGU0ioEsM7TNvmN6qUdRnfkBR24589Ozyi3XYZqNUbFZVzCD5E2ie6SrcOyn6foWBvfGOD
	sz4EfL7bD74xMA4E6Go1h11NzCZcHjlRttGuK1XbwKR9MVQOVA11CQa+YgNBz08NQxqI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187425-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187425: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=0b0b7041cc6cab48479caeb4013f2a77b26b9b1d
X-Osstest-Versions-That:
    ovmf=9d5a9940e4b1bf7cc9080ff245485abbf1858d2c
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 20:11:24 +0000

flight 187425 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187425/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 0b0b7041cc6cab48479caeb4013f2a77b26b9b1d
baseline version:
 ovmf                 9d5a9940e4b1bf7cc9080ff245485abbf1858d2c

Last test of basis   187423  2024-08-30 16:11:28 Z    0 days
Testing same since   187425  2024-08-30 18:11:27 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Anthony PERARD <anthony.perard@citrix.com>
  Jason Andryuk <jason.andryuk@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   9d5a9940e4..0b0b7041cc  0b0b7041cc6cab48479caeb4013f2a77b26b9b1d -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 20:52:24 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 20:52:24 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786635.1196234 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk8bT-0003DN-4S; Fri, 30 Aug 2024 20:52:19 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786635.1196234; Fri, 30 Aug 2024 20:52:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk8bT-0003DG-1D; Fri, 30 Aug 2024 20:52:19 +0000
Received: by outflank-mailman (input) for mailman id 786635;
 Fri, 30 Aug 2024 20:52:17 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk8bR-0003D6-EV; Fri, 30 Aug 2024 20:52:17 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk8bR-0006x3-6T; Fri, 30 Aug 2024 20:52:17 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk8bQ-0006R4-SE; Fri, 30 Aug 2024 20:52:16 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sk8bQ-00056f-Ri; Fri, 30 Aug 2024 20:52:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=czgUlw/IceVU1kDdM5pEr25r/nVKQrBzMV+UOCWuqTk=; b=XajIAuDIVarr9/2HECaO6Uo75v
	95/qNM271cl4IU1SeSAT9tBsX3fN2U+Ny1mKh1XZh8FXrGoGGV77CtIfFNwMQSh5IKFp9C/T0fhVw
	1E918ADVhYIYPClwy3wggEmlFNxbDhtLJxdeeFxTpd1dJksINz8Y9CRQ0VJ352HYN3Vg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187424-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable-smoke test] 187424: tolerable all pass - PUSHED
X-Osstest-Failures:
    xen-unstable-smoke:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable-smoke:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=1436593d5f8f7f700478e307d5198535ba69f88d
X-Osstest-Versions-That:
    xen=5e99a40ea54a6bf0bdc18241992866a642d7782b
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 20:52:16 +0000

flight 187424 xen-unstable-smoke real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187424/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  1436593d5f8f7f700478e307d5198535ba69f88d
baseline version:
 xen                  5e99a40ea54a6bf0bdc18241992866a642d7782b

Last test of basis   187417  2024-08-30 08:02:18 Z    0 days
Testing same since   187424  2024-08-30 18:02:03 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Anthony PERARD <anthony.perard@vates.tech>
  Christian Lindig <christian.lindig@cloud.com>

jobs:
 build-arm64-xsm                                              pass    
 build-amd64                                                  pass    
 build-armhf                                                  pass    
 build-amd64-libvirt                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-libvirt                                     pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/xen.git
   5e99a40ea5..1436593d5f  1436593d5f8f7f700478e307d5198535ba69f88d -> smoke


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:48:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:48:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786651.1196255 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9TH-0004R9-Dp; Fri, 30 Aug 2024 21:47:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786651.1196255; Fri, 30 Aug 2024 21:47:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9TH-0004R2-8x; Fri, 30 Aug 2024 21:47:55 +0000
Received: by outflank-mailman (input) for mailman id 786651;
 Fri, 30 Aug 2024 21:47:53 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9TF-0004BO-Gl
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:47:53 +0000
Received: from sender3-of-o57.zoho.com (sender3-of-o57.zoho.com
 [136.143.184.57]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 80cc9cb1-6719-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:47:51 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054460817330.6426605494462;
 Fri, 30 Aug 2024 14:47:40 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 80cc9cb1-6719-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054462; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=VVb9AQHQzWR0Xi2YBkK8F9dotHc22hwmVT/LlesQD8Ep099R821c1DgywspI4LquG1hX93Kne+sbnH/DjXwPEPRdyxUN08DnabgJAXPouP59ITtCwrG2jpwejvBzQdo6GEOZO8VqHMDWQ5mqVHVzTaFmcYuDKA2y16NmlXCqWyg=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054462; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=M4W1+EbYZ1Civ9bhjGdGJrVHK5yOv98KXuuX61z+p3g=; 
	b=cUpNh9U8LgPdyvJKQS3ji/lxd+zIM1Y9zDvfRHx3XDvMvc7/7OX1siznfG8ykfEmXHn7/4LNt8fKcUHr/BpB5snOhE4we4wysUw/fbxgciUHjPFu4I0CcOMf8LN/7hyz7LpZmzo74DaAciz4vK1cYWBWBYmjWHQOypEfbhGT25M=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054462;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=M4W1+EbYZ1Civ9bhjGdGJrVHK5yOv98KXuuX61z+p3g=;
	b=sHHzHCuGHGQltokKpd4X2yRE+MQNFBUIgXNLNgudjrJQNsTEkIGzdG7ZgX53oL3G
	Bs570rYESGeIxMHp8DV4M1l39KusyOgGHF9Chuq8gA7oP2a0fLWfRdBdShtfHYeT/9G
	hpZ8ncIhIEf19P9+zBm6Hp478IrYnKcZY0nOar8Y=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: Christopher Clark <christopher.w.clark@gmail.com>,
	jason.andryuk@amd.com,
	"Daniel P . Smith" <dpsmith@apertussolutions.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 01/44] x86/boot: move x86 boot module counting into a new boot_info struct
Date: Fri, 30 Aug 2024 17:46:46 -0400
Message-Id: <20240830214730.1621-2-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

From: Christopher Clark <christopher.w.clark@gmail.com>

An initial step towards a non-multiboot internal representation of boot
modules for common code, starting with x86 setup and converting the fields
that are accessed for the startup calculations.

Introduce a new header, <xen/asm/bootinfo.h>, and populate it with a new
boot_info structure initially containing a count of the number of boot
modules.

No functional change intended.

Signed-off-by: Christopher Clark <christopher.w.clark@gmail.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootinfo.h | 25 +++++++++++++
 xen/arch/x86/setup.c                | 58 +++++++++++++++++------------
 2 files changed, 59 insertions(+), 24 deletions(-)
 create mode 100644 xen/arch/x86/include/asm/bootinfo.h

diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
new file mode 100644
index 000000000000..e850f80d26a7
--- /dev/null
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (c) 2024 Christopher Clark <christopher.w.clark@gmail.com>
+ * Copyright (c) 2024 Apertus Solutions, LLC
+ * Author: Daniel P. Smith <dpsmith@apertussolutions.com>
+ */
+
+#ifndef __XEN_X86_BOOTINFO_H__
+#define __XEN_X86_BOOTINFO_H__
+
+struct boot_info {
+    unsigned int nr_mods;
+};
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index eee20bb1753c..dd94ee2e736b 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -32,6 +32,7 @@
 #include <compat/xen.h>
 #endif
 #include <xen/bitops.h>
+#include <asm/bootinfo.h>
 #include <asm/smp.h>
 #include <asm/processor.h>
 #include <asm/mpspec.h>
@@ -276,7 +277,16 @@ static int __init cf_check parse_acpi_param(const char *s)
 custom_param("acpi", parse_acpi_param);
 
 static const module_t *__initdata initial_images;
-static unsigned int __initdata nr_initial_images;
+static struct boot_info __initdata *boot_info;
+
+static void __init multiboot_to_bootinfo(multiboot_info_t *mbi)
+{
+    static struct boot_info __initdata info;
+
+    info.nr_mods = mbi->mods_count;
+
+    boot_info = &info;
+}
 
 unsigned long __init initial_images_nrpages(nodeid_t node)
 {
@@ -285,7 +295,7 @@ unsigned long __init initial_images_nrpages(nodeid_t node)
     unsigned long nr;
     unsigned int i;
 
-    for ( nr = i = 0; i < nr_initial_images; ++i )
+    for ( nr = i = 0; i < boot_info->nr_mods; ++i )
     {
         unsigned long start = initial_images[i].mod_start;
         unsigned long end = start + PFN_UP(initial_images[i].mod_end);
@@ -301,7 +311,7 @@ void __init discard_initial_images(void)
 {
     unsigned int i;
 
-    for ( i = 0; i < nr_initial_images; ++i )
+    for ( i = 0; i < boot_info->nr_mods; ++i )
     {
         uint64_t start = (uint64_t)initial_images[i].mod_start << PAGE_SHIFT;
 
@@ -309,7 +319,7 @@ void __init discard_initial_images(void)
                            start + PAGE_ALIGN(initial_images[i].mod_end));
     }
 
-    nr_initial_images = 0;
+    boot_info->nr_mods = 0;
     initial_images = NULL;
 }
 
@@ -1034,9 +1044,10 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
         mod = __va(mbi->mods_addr);
     }
 
+    multiboot_to_bootinfo(mbi);
+
     loader = (mbi->flags & MBI_LOADERNAME) ? __va(mbi->boot_loader_name)
                                            : "unknown";
-
     /* Parse the command-line options. */
     if ( mbi->flags & MBI_CMDLINE )
         cmdline = cmdline_cook(__va(mbi->cmdline), loader);
@@ -1141,18 +1152,18 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
            bootsym(boot_edd_info_nr));
 
     /* Check that we have at least one Multiboot module. */
-    if ( !(mbi->flags & MBI_MODULES) || (mbi->mods_count == 0) )
+    if ( !(mbi->flags & MBI_MODULES) || (boot_info->nr_mods == 0) )
         panic("dom0 kernel not specified. Check bootloader configuration\n");
 
     /* Check that we don't have a silly number of modules. */
-    if ( mbi->mods_count > sizeof(module_map) * 8 )
+    if ( boot_info->nr_mods > sizeof(module_map) * 8 )
     {
-        mbi->mods_count = sizeof(module_map) * 8;
+        boot_info->nr_mods = sizeof(module_map) * 8;
         printk("Excessive multiboot modules - using the first %u only\n",
-               mbi->mods_count);
+               boot_info->nr_mods);
     }
 
-    bitmap_fill(module_map, mbi->mods_count);
+    bitmap_fill(module_map, boot_info->nr_mods);
     __clear_bit(0, module_map); /* Dom0 kernel is always first */
 
     if ( pvh_boot )
@@ -1325,9 +1336,8 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     kexec_reserve_area();
 
     initial_images = mod;
-    nr_initial_images = mbi->mods_count;
 
-    for ( i = 0; !efi_enabled(EFI_LOADER) && i < mbi->mods_count; i++ )
+    for ( i = 0; !efi_enabled(EFI_LOADER) && i < boot_info->nr_mods; i++ )
     {
         if ( mod[i].mod_start & (PAGE_SIZE - 1) )
             panic("Bootloader didn't honor module alignment request\n");
@@ -1351,8 +1361,8 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
          * respective reserve_e820_ram() invocation below. No need to
          * query efi_boot_mem_unused() here, though.
          */
-        mod[mbi->mods_count].mod_start = virt_to_mfn(_stext);
-        mod[mbi->mods_count].mod_end = __2M_rwdata_end - _stext;
+        mod[boot_info->nr_mods].mod_start = virt_to_mfn(_stext);
+        mod[boot_info->nr_mods].mod_end = __2M_rwdata_end - _stext;
     }
 
     modules_headroom = bzimage_headroom(bootstrap_map(mod), mod->mod_end);
@@ -1412,7 +1422,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
         {
             /* Don't overlap with modules. */
             end = consider_modules(s, e, reloc_size + mask,
-                                   mod, mbi->mods_count, -1);
+                                   mod, boot_info->nr_mods, -1);
             end &= ~mask;
         }
         else
@@ -1433,7 +1443,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
         }
 
         /* Is the region suitable for relocating the multiboot modules? */
-        for ( j = mbi->mods_count - 1; j >= 0; j-- )
+        for ( j = boot_info->nr_mods - 1; j >= 0; j-- )
         {
             /*
              * 'headroom' is a guess for the decompressed size and
@@ -1448,7 +1458,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
             /* Don't overlap with other modules (or Xen itself). */
             end = consider_modules(s, e, size, mod,
-                                   mbi->mods_count + relocated, j);
+                                   boot_info->nr_mods + relocated, j);
 
             if ( highmem_start && end > highmem_start )
                 continue;
@@ -1475,7 +1485,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
         {
             /* Don't overlap with modules (or Xen itself). */
             e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size), mod,
-                                 mbi->mods_count + relocated, -1);
+                                 boot_info->nr_mods + relocated, -1);
             if ( s >= e )
                 break;
             if ( e > kexec_crash_area_limit )
@@ -1490,7 +1500,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
     if ( modules_headroom && !mod->reserved )
         panic("Not enough memory to relocate the dom0 kernel image\n");
-    for ( i = 0; i < mbi->mods_count; ++i )
+    for ( i = 0; i < boot_info->nr_mods; ++i )
     {
         uint64_t s = (uint64_t)mod[i].mod_start << PAGE_SHIFT;
 
@@ -1570,7 +1580,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
                     ASSERT(j);
                 }
                 map_e = boot_e820.map[j].addr + boot_e820.map[j].size;
-                for ( j = 0; j < mbi->mods_count; ++j )
+                for ( j = 0; j < boot_info->nr_mods; ++j )
                 {
                     uint64_t end = pfn_to_paddr(mod[j].mod_start) +
                                    mod[j].mod_end;
@@ -1645,7 +1655,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
         }
     }
 
-    for ( i = 0; i < mbi->mods_count; ++i )
+    for ( i = 0; i < boot_info->nr_mods; ++i )
     {
         set_pdx_range(mod[i].mod_start,
                       mod[i].mod_start + PFN_UP(mod[i].mod_end));
@@ -2032,8 +2042,8 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
            cpu_has_nx ? XENLOG_INFO : XENLOG_WARNING "Warning: ",
            cpu_has_nx ? "" : "not ");
 
-    initrdidx = find_first_bit(module_map, mbi->mods_count);
-    if ( bitmap_weight(module_map, mbi->mods_count) > 1 )
+    initrdidx = find_first_bit(module_map, boot_info->nr_mods);
+    if ( bitmap_weight(module_map, boot_info->nr_mods) > 1 )
         printk(XENLOG_WARNING
                "Multiple initrd candidates, picking module #%u\n",
                initrdidx);
@@ -2043,7 +2053,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
      * above our heap. The second module, if present, is an initrd ramdisk.
      */
     dom0 = create_dom0(mod, modules_headroom,
-                       initrdidx < mbi->mods_count ? mod + initrdidx : NULL,
+                       initrdidx < boot_info->nr_mods ? mod + initrdidx : NULL,
                        kextra, loader);
     if ( !dom0 )
         panic("Could not set up DOM0 guest OS\n");
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:48:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:48:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786652.1196264 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9TN-0004j1-JD; Fri, 30 Aug 2024 21:48:01 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786652.1196264; Fri, 30 Aug 2024 21:48:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9TN-0004iu-Gb; Fri, 30 Aug 2024 21:48:01 +0000
Received: by outflank-mailman (input) for mailman id 786652;
 Fri, 30 Aug 2024 21:48:00 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9TM-0004BO-Ro
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:48:00 +0000
Received: from sender3-of-o57.zoho.com (sender3-of-o57.zoho.com
 [136.143.184.57]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8533de97-6719-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:47:59 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 17250544619691020.6911507983529;
 Fri, 30 Aug 2024 14:47:41 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8533de97-6719-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054464; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=k1d4FRK7F8uwIJpTqyE+y8FsdfwNHiKb4oG6Oj8svyS1Mx4mDuDzj19fAv+wcAmM2M39G8drszEFyHOiFTG6mwqy/QERRlEgF81z7KCQw7mU3Xf6zYH1p0TLX6TEiA8XknDnJoM8tH/ySx3fLc6rBSm9qZ4BxHP7hOuO2tnqc+g=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054464; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=KAESHRPaE5VWyf1xY+l5m4fxgSkS1FQVX7bHFI04M2Y=; 
	b=R7s9lqaXfp3RhPrhyRGwVnNU8DPAuxC7iNMeymPgEDC+t5G3AHbojj351+eycFhBc+e0SosR6a2pyhOva+H1Dqt1qn5JLxJgzXdsZFWVLTfRMkdhmzw9Uvl0H0PVdLaElz6gYLi+/bSAjBeFu7i5vli00Qx3ueakrcGNnb/VQQw=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054464;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=KAESHRPaE5VWyf1xY+l5m4fxgSkS1FQVX7bHFI04M2Y=;
	b=T0tOh+gFQViOt10PluDy2w7iaysThBZ5A1a3OMU14qMJs2f9DaSBNrdVV6804hfw
	QcuGVnmJzdePaI7RlJ+/Db2p7hKfPkZGl17xOBGQJy/12DhpRvcoHJC2foVDCAqqv56
	TC0Ns/xjvRu1xtGzSXiQkbOA1dVPIYtPo8FEEhmY=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 02/44] x86/boot: move boot loader name to boot info
Date: Fri, 30 Aug 2024 17:46:47 -0400
Message-Id: <20240830214730.1621-3-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Transition the incoming boot loader name to be held in struct boot_info.

No functional change intended.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootinfo.h |  2 ++
 xen/arch/x86/setup.c                | 15 ++++++++-------
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index e850f80d26a7..e69feb1bb8be 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -10,6 +10,8 @@
 
 struct boot_info {
     unsigned int nr_mods;
+
+    const char *boot_loader_name;
 };
 
 #endif
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index dd94ee2e736b..432b7d1701e4 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -285,6 +285,9 @@ static void __init multiboot_to_bootinfo(multiboot_info_t *mbi)
 
     info.nr_mods = mbi->mods_count;
 
+    info.boot_loader_name = (mbi->flags & MBI_LOADERNAME) ?
+                            __va(mbi->boot_loader_name) : "unknown";
+
     boot_info = &info;
 }
 
@@ -993,7 +996,7 @@ static struct domain *__init create_dom0(const module_t *image,
 
 void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 {
-    const char *memmap_type = NULL, *loader, *cmdline = "";
+    const char *memmap_type = NULL, *cmdline = "";
     char *kextra;
     void *bsp_stack;
     struct cpu_info *info = get_cpu_info(), *bsp_info;
@@ -1046,11 +1049,9 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
     multiboot_to_bootinfo(mbi);
 
-    loader = (mbi->flags & MBI_LOADERNAME) ? __va(mbi->boot_loader_name)
-                                           : "unknown";
     /* Parse the command-line options. */
     if ( mbi->flags & MBI_CMDLINE )
-        cmdline = cmdline_cook(__va(mbi->cmdline), loader);
+        cmdline = cmdline_cook(__va(mbi->cmdline), boot_info->boot_loader_name);
 
     if ( (kextra = strstr(cmdline, " -- ")) != NULL )
     {
@@ -1091,7 +1092,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     if ( pvh_boot )
         pvh_print_info();
 
-    printk("Bootloader: %s\n", loader);
+    printk("Bootloader: %s\n", boot_info->boot_loader_name);
 
     printk("Command line: %s\n", cmdline);
 
@@ -1184,7 +1185,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
         l3_bootmap[l3_table_offset(BOOTSTRAP_MAP_BASE)] =
             l3e_from_paddr(__pa(l2_bootmap), __PAGE_HYPERVISOR);
 
-        memmap_type = loader;
+        memmap_type = boot_info->boot_loader_name;
     }
     else if ( efi_enabled(EFI_BOOT) )
         memmap_type = "EFI";
@@ -2054,7 +2055,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
      */
     dom0 = create_dom0(mod, modules_headroom,
                        initrdidx < boot_info->nr_mods ? mod + initrdidx : NULL,
-                       kextra, loader);
+                       kextra, boot_info->boot_loader_name);
     if ( !dom0 )
         panic("Could not set up DOM0 guest OS\n");
 
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:48:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:48:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786650.1196243 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9TB-0004Bd-21; Fri, 30 Aug 2024 21:47:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786650.1196243; Fri, 30 Aug 2024 21:47:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9TA-0004BW-VJ; Fri, 30 Aug 2024 21:47:48 +0000
Received: by outflank-mailman (input) for mailman id 786650;
 Fri, 30 Aug 2024 21:47: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9TA-0004BO-3p
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:47:48 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 7c743483-6719-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:47:44 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054459554998.661626605448;
 Fri, 30 Aug 2024 14:47:39 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 7c743483-6719-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054460; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=i/lvLZRG1P68ZnIsuwne03eY7aFdJe0iN8rXi4mjV8wEKX44pZe5FaKQ2cZFOLIk8K96BYXSX54Sedhhvhj0TMS9T+2hTxqF6TaXjikNo0SH48P6erzNpLUbY4RwPlkhVTTvN3SEQIiK3tUb85Nu2EClhWWtltVyNoK4sFqcifc=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054460; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=0mH3ez+4GaiNeQYfdl+7mRSZeT4ezAUWzGnLTdWj95k=; 
	b=n3TNnEjmvhcvBEfUXdbel+b7Ip9HOa3AvnjwMsiTHeicOrlKcHV/CT242rXAqIwGuO8glmXUu9BizYOISCbCoPWu7jnkdDuXLnKXuL242LV6oXYiM5pP3SNtDeefrpi3DMnA4U6VJJNbltnzQUg6K98bOywAPlENVVRAsVsuj2k=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054460;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=0mH3ez+4GaiNeQYfdl+7mRSZeT4ezAUWzGnLTdWj95k=;
	b=I/f7TznhBl8/P/pWI7JgkY1ekJ2ft1B+qRjacg5REHc8apuQsyAulPvav7+4Nvb6
	NPDqYlPB2A8HT/uPxSrJT7a9yYAQYwpSGNig/byONn7SkC49czqZgqVAMDSgTSL7b77
	q/hdC+JMa22y3Onh0C/VFI5+RfDBvuApPxFxT6Bc=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com
Subject: [PATCH v4 00/44] Boot modules for Hyperlaunch
Date: Fri, 30 Aug 2024 17:46:45 -0400
Message-Id: <20240830214730.1621-1-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

The Boot Modules for Hyperlaunch series is an effort to split out preliminary
changes necessary for the introduction of the Hyperlaunch domain builder
logic. These preliminary changes revolve around introducing the struct
boot_module and struct boot_domain structures. This includes converting the
dom0 construction path to use these structures. These abstractions lay the
groundwork to transform and extend the dom0 construction logic into a limited,
but general domain builder.

The splitting of Hyperlaunch into a pair of series was twofold, to reduce the
effort in reviewing a much larger series, and to reduce the effort in handling
the knock-on effects to the construction logic from requested review changes.

A note on v4:

For v4, two significant direction changes occurred. First, the series was
pulled back from attempting to be in common and instead focused on being
purely an x86 capability. Second, the changes were broken down into much
smaller change sets and ordered to provide a more ordered evolution of the
code. To the most extent possible, it was attempted to ensure all v3 comments
were transcribed accordingly with the scope change.

Much thanks to AMD for supporting this work.

Documentation on Hyperlaunch:
https://wiki.xenproject.org/wiki/Hyperlaunch

Original Hyperlaunch v1 patch series:
https://lists.xenproject.org/archives/html/xen-devel/2022-07/msg00345.html

V/r,
Daniel P. Smith

Changes since v3:
- reduced scope to x86 only
- broke changes into a smaller chunks with a linear progression
- concerns about deconflicting with Arm deferred
- conversion from mb1 to boot modules no longer attempted at entry points
- the temporary conversion function is now the permenant means to convert
- incorporated suggestion from Andy Cooper for handling bootstrap_map

Changes since v2:
- combined v2 patches 7 and 8 for common review
- rebased the v2 series onto the current tip of staging (sorry)
- fixed the placement of the patch changelogs
- provided the changes description in the cover letter

Changes since v1:
- the v2 and v3 series implement functionality from v1 patches 2-4
    - v2 series objective is to enable efficient patch review in support
      of merging the functionality into the hypervisor. It implements a
      subset of the v1 series, incorporating changes from community
      feedback.
- the bootstrap map is made accessible early in the v2 series via both
  multiboot and boot module arguments until later in the series where
  multiboot use is retired. This allows for incremental conversion across
  several patches from multiboot to boot modules.
- the 32-bit x86 boot environment header is removed, and changes are
  made to allow the new common bootinfo headers to be used instead.
- Arm and RISC-V architecture bootinfo headers are added to ensure that
  builds on those architectures can complete correctly.
- The KConfig patch to set the maximum number of boot modules allowed
  is not included in this series, replaced with a static maximum define.

Andrew Cooper (1):
  x86/boot: split bootstrap_map_addr() out of bootstrap_map()

Christopher Clark (1):
  x86/boot: move x86 boot module counting into a new boot_info struct

Daniel P. Smith (42):
  x86/boot: move boot loader name to boot info
  x86/boot: move cmdline to boot info
  x86/boot: move mmap info to boot info
  x86/boot: introduce struct boot_module
  x86/boot: convert consider_modules to struct boot_module
  x86/boot: move headroom to boot modules
  x86/boot: convert setup.c mod refs to early_mod
  x86/boot: introduce boot module types
  x86/boot: introduce boot module flags
  x86/boot: add start and size fields to struct boot_module
  x86/boot: update struct boot_module on module relocation
  x86/boot: transition relocation calculations to struct boot_module
  x86/boot: introduce boot module interator
  x86/boot: introduce consumed flag for struct boot_module
  x86/boot: convert microcode loading to consume struct boot_info
  x86/boot: convert late microcode loading to struct boot_module
  x86/boot: use consumed boot module flag for microcode
  x86/boot: convert xsm policy loading to struct boot_module
  x86/boot: convert ramdisk locating to struct boot_module
  x86/boot: remove module_map usage from microcode loading
  x86/boot: remove module_map usage from xsm policy loading
  x86/boot: remove module_map usage by ramdisk loading
  x86/boot: convert create_dom0 to use boot info
  x86/boot: convert construct_dom0 to use struct boot_module
  x86/boot: relocate kextra into boot info
  x86/boot: add cmdline to struct boot_module
  x86/boot: convert dom0_construct_pv image param to struct boot_module
  x86/boot: convert dom0_construct_pv initrd param to struct boot_module
  x86/boot: convert dom0_construct_pvh to struct boot_module
  x86/boot: convert pvh_load_kernel to struct boot_module
  x86/boot: convert initial_images to struct boot_module
  x86/boot: drop the use of initial_images unit global
  x86/boot: remove usage of mod_end by discard_initial_images
  x86/boot: remove remaining early_mod references
  x86/boot: remove early_mod from struct boot_module
  x86/boot: introduce boot domain
  x86/boot: introduce domid field to struct boot_domain
  x86/boot: add cmdline to struct boot_domain
  x86/boot: add struct domain to struct boot_domain
  x86/boot: convert construct_dom0 to struct boot_domain
  x86/boot: convert dom0_construct_pv to struct boot_domain
  x86/boot: convert dom0_construct_pvh to struct boot_domain

 xen/arch/x86/cpu/microcode/core.c     |  78 +++----
 xen/arch/x86/dom0_build.c             |  21 +-
 xen/arch/x86/hvm/dom0_build.c         |  55 +++--
 xen/arch/x86/include/asm/bootdomain.h |  37 +++
 xen/arch/x86/include/asm/bootinfo.h   |  83 +++++++
 xen/arch/x86/include/asm/dom0_build.h |  11 +-
 xen/arch/x86/include/asm/microcode.h  |  12 +-
 xen/arch/x86/include/asm/setup.h      |   9 +-
 xen/arch/x86/pv/dom0_build.c          |  38 ++--
 xen/arch/x86/setup.c                  | 316 ++++++++++++++++----------
 xen/include/xsm/xsm.h                 |  14 +-
 xen/xsm/xsm_core.c                    |  15 +-
 xen/xsm/xsm_policy.c                  |  18 +-
 13 files changed, 442 insertions(+), 265 deletions(-)
 create mode 100644 xen/arch/x86/include/asm/bootdomain.h
 create mode 100644 xen/arch/x86/include/asm/bootinfo.h

-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:48:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:48:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786653.1196274 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9TV-00056r-T1; Fri, 30 Aug 2024 21:48:09 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786653.1196274; Fri, 30 Aug 2024 21:48:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9TV-00056i-PW; Fri, 30 Aug 2024 21:48:09 +0000
Received: by outflank-mailman (input) for mailman id 786653;
 Fri, 30 Aug 2024 21:48:08 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9TU-0004BO-Qk
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:48:08 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 89e4a070-6719-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:48:07 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054463025557.548854351013;
 Fri, 30 Aug 2024 14:47:43 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 89e4a070-6719-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054465; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=kZfzSBiAOcWM1nNWw8G6aWDYpPkIo63VSHznsMdZ2tqCKj39rJ5gHMuBO18irh/KNd7mnxlzwXRgiMzhsOOTs/FPMtu497XfFgODVZAmSVjeCYoNseK5XEWWbfM0FinWWFw+vvzBmdhXaNeUAvjiF+CePNUbqszKR0tCF4sblEY=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054465; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=Qexd3Ieo0x5aB7CkcPEqhzSRdIxc4KHzWNUKGdjfDMk=; 
	b=L8nQ3JmrkA4ybkEhwkoZFrMqtzpmqd8nXSww2zkjd2cp3Wi9cCR8ny91f6MqwV1v/7+lkj+2DUCgLXYEjVmBsh9RkbHQIY0WZ/yiK1apwAiDkTyuNvQrVaVB9VUH1fnPS6ltTzCQhWfdSWXA/egn1z7/HY2P95RKHv6Vvyp3Uk4=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054465;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=Qexd3Ieo0x5aB7CkcPEqhzSRdIxc4KHzWNUKGdjfDMk=;
	b=kKDzBb+ZDpO2+u840lmHk+yzp84/29Qyboj/exo/kudo2h9Ieg65aP9GRtqhDxzJ
	07MU7U9q62rJim9GQL4XzZ91lUKyL8HpU799r2HDgAa8e18oHwI3EjZTddjgDofF6IO
	TrmJmuTTm6OuTZkg0VhLOg1bE2qVgI7i+I7Pgi+A=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 03/44] x86/boot: move cmdline to boot info
Date: Fri, 30 Aug 2024 17:46:48 -0400
Message-Id: <20240830214730.1621-4-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Transition Xen's command line to being held in struct boot_info.

No functional change intended.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootinfo.h |  1 +
 xen/arch/x86/setup.c                | 21 +++++++++++++--------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index e69feb1bb8be..d2ca077d2356 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -12,6 +12,7 @@ struct boot_info {
     unsigned int nr_mods;
 
     const char *boot_loader_name;
+    const char *cmdline;
 };
 
 #endif
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 432b7d1701e4..a945fa10555f 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -276,6 +276,8 @@ static int __init cf_check parse_acpi_param(const char *s)
 }
 custom_param("acpi", parse_acpi_param);
 
+static const char *cmdline_cook(const char *p, const char *loader_name);
+
 static const module_t *__initdata initial_images;
 static struct boot_info __initdata *boot_info;
 
@@ -288,6 +290,13 @@ static void __init multiboot_to_bootinfo(multiboot_info_t *mbi)
     info.boot_loader_name = (mbi->flags & MBI_LOADERNAME) ?
                             __va(mbi->boot_loader_name) : "unknown";
 
+    /* Parse the command-line options. */
+    if ( mbi->flags & MBI_CMDLINE )
+        info.cmdline = cmdline_cook(__va(mbi->cmdline),
+                                    info.boot_loader_name);
+    else
+        info.cmdline = "";
+
     boot_info = &info;
 }
 
@@ -996,7 +1005,7 @@ static struct domain *__init create_dom0(const module_t *image,
 
 void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 {
-    const char *memmap_type = NULL, *cmdline = "";
+    const char *memmap_type = NULL;
     char *kextra;
     void *bsp_stack;
     struct cpu_info *info = get_cpu_info(), *bsp_info;
@@ -1049,11 +1058,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
     multiboot_to_bootinfo(mbi);
 
-    /* Parse the command-line options. */
-    if ( mbi->flags & MBI_CMDLINE )
-        cmdline = cmdline_cook(__va(mbi->cmdline), boot_info->boot_loader_name);
-
-    if ( (kextra = strstr(cmdline, " -- ")) != NULL )
+    if ( (kextra = strstr(boot_info->cmdline, " -- ")) != NULL )
     {
         /*
          * Options after ' -- ' separator belong to dom0.
@@ -1064,7 +1069,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
         kextra += 3;
         while ( kextra[1] == ' ' ) kextra++;
     }
-    cmdline_parse(cmdline);
+    cmdline_parse(boot_info->cmdline);
 
     /* Must be after command line argument parsing and before
      * allocing any xenheap structures wanted in lower memory. */
@@ -1094,7 +1099,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
     printk("Bootloader: %s\n", boot_info->boot_loader_name);
 
-    printk("Command line: %s\n", cmdline);
+    printk("Command line: %s\n", boot_info->cmdline);
 
     printk("Xen image load base address: %#lx\n", xen_phys_start);
     if ( hypervisor_name )
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:48:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:48:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786657.1196284 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Td-0005dp-6n; Fri, 30 Aug 2024 21:48:17 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786657.1196284; Fri, 30 Aug 2024 21:48:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Td-0005di-1v; Fri, 30 Aug 2024 21:48:17 +0000
Received: by outflank-mailman (input) for mailman id 786657;
 Fri, 30 Aug 2024 21:48: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Tc-0004BO-3H
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:48:16 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 8e3c4ba0-6719-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:48:14 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054464189234.4870791649007;
 Fri, 30 Aug 2024 14:47:44 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 8e3c4ba0-6719-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054466; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=GCB88FNkVAkVJ4OErzRK+V0XldeNho6qax4qz6noXdyBPG+ZAZnwX9dhj0fBKxmgtsHfJryPRpR2X8e/kS/NQzK3rnNmBK8tJ71U1lZjsHcNWa8EVJeVFlTI9PXxEdql7U7vIId4Tg21Fnj8GUmNAV2SC0fslgMKHqHBQ5jy1/8=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054466; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=AHDLb8T/b80h/7jv5pdrXG2adOVOnBNwTs0CHWLNuOc=; 
	b=Scg75RdV6n6c7HabrT/rBUhqT/e7pXIXZnfox1qAgmkzEhp3nkLluGFwHQGv5mlTEO603hc5MbAAvLhtFhtQMJegvxX218U/sCfc3dzGWL8H+j+O6ZVXHRQOymGekBx7CmyPbe0Wn9nJOgPdxTEqqDg3UvnoOzZG8lNQvcsOkpM=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054466;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=AHDLb8T/b80h/7jv5pdrXG2adOVOnBNwTs0CHWLNuOc=;
	b=X1YUFfg/0Gkk09gpid6a1UXiO/0l3eDj08+fSxYHIxheOGJHh8uxik4mGZemS9X7
	DhfYvj6pFSP7crpfiAvd/PKM0yQgmQ3X9bnI1Kzg+VT6NK/fIkdOIFrKqu791PxFD6E
	LEKVCa7zdRbCstp3wa9P0IFqhuOrmwZ8vpm3WzAs=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 04/44] x86/boot: move mmap info to boot info
Date: Fri, 30 Aug 2024 17:46:49 -0400
Message-Id: <20240830214730.1621-5-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Transition the memory map info to be held in struct boot_info.

No functional change intended.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootinfo.h |  5 +++++
 xen/arch/x86/setup.c                | 12 +++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index d2ca077d2356..e785ed1c5982 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -8,11 +8,16 @@
 #ifndef __XEN_X86_BOOTINFO_H__
 #define __XEN_X86_BOOTINFO_H__
 
+#include <xen/types.h>
+
 struct boot_info {
     unsigned int nr_mods;
 
     const char *boot_loader_name;
     const char *cmdline;
+
+    paddr_t mmap_addr;
+    uint32_t mmap_length;
 };
 
 #endif
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index a945fa10555f..c6b45ced00ae 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -297,6 +297,12 @@ static void __init multiboot_to_bootinfo(multiboot_info_t *mbi)
     else
         info.cmdline = "";
 
+    if ( mbi->flags & MBI_MEMMAP )
+    {
+        info.mmap_addr = mbi->mmap_addr;
+        info.mmap_length = mbi->mmap_length;
+    }
+
     boot_info = &info;
 }
 
@@ -1200,13 +1206,13 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     {
         memmap_type = "Xen-e820";
     }
-    else if ( mbi->flags & MBI_MEMMAP )
+    else if ( boot_info->mmap_addr )
     {
         memmap_type = "Multiboot-e820";
-        while ( bytes < mbi->mmap_length &&
+        while ( bytes < boot_info->mmap_length &&
                 e820_raw.nr_map < ARRAY_SIZE(e820_raw.map) )
         {
-            memory_map_t *map = __va(mbi->mmap_addr + bytes);
+            memory_map_t *map = __va(boot_info->mmap_addr + bytes);
 
             /*
              * This is a gross workaround for a BIOS bug. Some bootloaders do
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:48:27 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:48:27 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786664.1196294 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Tn-0006FY-JU; Fri, 30 Aug 2024 21:48:27 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786664.1196294; Fri, 30 Aug 2024 21:48:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Tn-0006FR-GI; Fri, 30 Aug 2024 21:48:27 +0000
Received: by outflank-mailman (input) for mailman id 786664;
 Fri, 30 Aug 2024 21:48:26 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Tm-00065G-3m
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:48:26 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 93724ef6-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:48:23 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054465277157.3636748835229;
 Fri, 30 Aug 2024 14:47:45 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 93724ef6-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054467; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=hkPK0sEs6w6MyzjfL5eePRMtOl+7XRDZXnXEysR6hOmPZQp0i+YqQHaopu079OxveECVPhSL9jqzwNax5Z6hyI/xw7d+eXO3fthnnZvNpKjEgS2jUHN9zBOn3s63OpOYSh6m1JBYxXOg1cSJCvophvdgaza9z47Fv6XREhpyMEM=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054467; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=mTJb7A779pFDFU65rSxPgwx1Pg9D5EASEmZIOVhMBEs=; 
	b=hFIlEOzWBo5HwsMzBvPdqr6stCKeAeAK6RteSAIa2+Mom5JQSymXgd+e3NkL7xp4uNTCJfbq6+7SMcpb0gxazsElqTTzrnIKKBKRyxK/Ak5LIY3O42T9Ua+Fn5o9shioPpyU0mO8GS2psmjELq94h+lwxz/uwrnlZRKLiSzUSyY=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054467;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=mTJb7A779pFDFU65rSxPgwx1Pg9D5EASEmZIOVhMBEs=;
	b=BnDNhT6E9IBxgN1VXSPCDDdxGikEmeMUGoqL9KYXIeObS5b5kpkTR5msUBxhNbmy
	6kY/dk05jjaEQVwq9gL2a0Mp/UtNVS8+m03p9EhZx1PCitPVB+iuHxGyPD7VLCKGwC6
	xiACIYvbAf4JE8euEXCZAB7GkkYX+m8PGb/3Ftms=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 05/44] x86/boot: introduce struct boot_module
Date: Fri, 30 Aug 2024 17:46:50 -0400
Message-Id: <20240830214730.1621-6-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

This will introduce a new struct boot_module to provide a rich state
representation around modules provided by the boot loader. Support is for 64
boot modules, one held in reserve for Xen, and up to 63 can be provided by the
boot loader. The array of struct boot_modules will be accessible via a
reference held in struct boot_info.

A temporary `early_mod` parameter is included in struct boot_module to ease the
transition from using Multiboot v1 structures over to struct boot_module. Once
the transition is complete, the parameter will be dropped from the structure.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootinfo.h |  6 ++++++
 xen/arch/x86/setup.c                | 19 ++++++++++++++++---
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index e785ed1c5982..844262495962 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -8,10 +8,16 @@
 #ifndef __XEN_X86_BOOTINFO_H__
 #define __XEN_X86_BOOTINFO_H__
 
+#include <xen/multiboot.h>
 #include <xen/types.h>
 
+struct boot_module {
+    module_t *early_mod;
+};
+
 struct boot_info {
     unsigned int nr_mods;
+    struct boot_module *mods;
 
     const char *boot_loader_name;
     const char *cmdline;
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index c6b45ced00ae..28fdbf4d4c2b 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -278,12 +278,17 @@ custom_param("acpi", parse_acpi_param);
 
 static const char *cmdline_cook(const char *p, const char *loader_name);
 
+/* Max number of boot modules a bootloader can provide in addition to Xen */
+#define MAX_NR_BOOTMODS 63
+
 static const module_t *__initdata initial_images;
 static struct boot_info __initdata *boot_info;
 
-static void __init multiboot_to_bootinfo(multiboot_info_t *mbi)
+static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
 {
     static struct boot_info __initdata info;
+    static struct boot_module __initdata boot_mods[MAX_NR_BOOTMODS + 1];
+    unsigned int i;
 
     info.nr_mods = mbi->mods_count;
 
@@ -303,6 +308,14 @@ static void __init multiboot_to_bootinfo(multiboot_info_t *mbi)
         info.mmap_length = mbi->mmap_length;
     }
 
+    info.mods = boot_mods;
+
+    for ( i=0; i < info.nr_mods; i++ )
+        boot_mods[i].early_mod = &mods[i];
+
+    /* map the last mb module for xen entry */
+    boot_mods[info.nr_mods].early_mod = &mods[info.nr_mods];
+
     boot_info = &info;
 }
 
@@ -1062,7 +1075,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
         mod = __va(mbi->mods_addr);
     }
 
-    multiboot_to_bootinfo(mbi);
+    multiboot_to_bootinfo(mbi, mod);
 
     if ( (kextra = strstr(boot_info->cmdline, " -- ")) != NULL )
     {
@@ -1164,7 +1177,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
            bootsym(boot_edd_info_nr));
 
     /* Check that we have at least one Multiboot module. */
-    if ( !(mbi->flags & MBI_MODULES) || (boot_info->nr_mods == 0) )
+    if ( boot_info->nr_mods == 0 )
         panic("dom0 kernel not specified. Check bootloader configuration\n");
 
     /* Check that we don't have a silly number of modules. */
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:48:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:48:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786670.1196304 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Ts-0006f6-Ra; Fri, 30 Aug 2024 21:48:32 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786670.1196304; Fri, 30 Aug 2024 21:48:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Ts-0006ex-OG; Fri, 30 Aug 2024 21:48:32 +0000
Received: by outflank-mailman (input) for mailman id 786670;
 Fri, 30 Aug 2024 21:48: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Tr-00065G-NV
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:48:31 +0000
Received: from sender3-of-o57.zoho.com (sender3-of-o57.zoho.com
 [136.143.184.57]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 97c23d19-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:48:30 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054466365953.1827755781716;
 Fri, 30 Aug 2024 14:47:46 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 97c23d19-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054468; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=n1vzAdrh/oyymzXFaRv9pOKnwJwtAiTcbY4L6gTtrg/4p6m6n+KMDsrPryMXD1gkFIdQ5LtNdUXOSZbXgH1Pahaq8ObLts0809zhLFn01lUmynhWs33LZ7EpTOEPqOZKm79E1f9iPdL5KLOUKP/uGhxAZA7UqStmpeM578wkoMg=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054468; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=0gXaC5isg4IrQFsCJP9Fq77RhO29MxC4nrBXRRPDF6A=; 
	b=Krfmu32iuu+u5S+3VHWecVIFHkV/yyapQqzJo6sUO2gTafSnjBR6FwLhjimkCHfWLeWU3pJ9QqxXZZwJna6Lu7vTJHOhSk91BqWsxtFoFnSIOoXAr+nkMGKjfYZ5DecZeJyQ4ssTI+FDY8rfJBifDxqi2hQeR3axKWIqjwm3Ypo=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054468;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=0gXaC5isg4IrQFsCJP9Fq77RhO29MxC4nrBXRRPDF6A=;
	b=uppunk61v82ki+dFT/FCqIqRyq9dWDem9hk0pXj+dXLWsp6ezjWIq+I2UskrmvIn
	rHWO5A+QYDLGf7b3dQv9GxPETcA7lXWMtEbFzUCOxSkegebHf69BtdQbYh6E/N+Dzt+
	4gAx0rkCsmgHbg0dSI2SmCqG7EkIycZ0wDJGTENw=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 06/44] x86/boot: convert consider_modules to struct boot_module
Date: Fri, 30 Aug 2024 17:46:51 -0400
Message-Id: <20240830214730.1621-7-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

To start transitioning consider_modules() over to struct boot_module, begin
with taking the array of struct boot_modules but use the temporary struct
element early_mod.

No functional change intended.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/setup.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 28fdbf4d4c2b..8912956ee7f1 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -632,7 +632,7 @@ static void __init noinline move_xen(void)
 #undef BOOTSTRAP_MAP_LIMIT
 
 static uint64_t __init consider_modules(
-    uint64_t s, uint64_t e, uint32_t size, const module_t *mod,
+    uint64_t s, uint64_t e, uint32_t size, const struct boot_module *mods,
     unsigned int nr_mods, unsigned int this_mod)
 {
     unsigned int i;
@@ -642,20 +642,20 @@ static uint64_t __init consider_modules(
 
     for ( i = 0; i < nr_mods ; ++i )
     {
-        uint64_t start = (uint64_t)mod[i].mod_start << PAGE_SHIFT;
-        uint64_t end = start + PAGE_ALIGN(mod[i].mod_end);
+        uint64_t start = (uint64_t)mods[i].early_mod->mod_start << PAGE_SHIFT;
+        uint64_t end = start + PAGE_ALIGN(mods[i].early_mod->mod_end);
 
         if ( i == this_mod )
             continue;
 
         if ( s < end && start < e )
         {
-            end = consider_modules(end, e, size, mod + i + 1,
+            end = consider_modules(end, e, size, &mods[i + 1],
                                    nr_mods - i - 1, this_mod - i - 1);
             if ( end )
                 return end;
 
-            return consider_modules(s, start, size, mod + i + 1,
+            return consider_modules(s, start, size, &mods[i + 1],
                                     nr_mods - i - 1, this_mod - i - 1);
         }
     }
@@ -1447,7 +1447,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
         {
             /* Don't overlap with modules. */
             end = consider_modules(s, e, reloc_size + mask,
-                                   mod, boot_info->nr_mods, -1);
+                                   boot_info->mods, boot_info->nr_mods, -1);
             end &= ~mask;
         }
         else
@@ -1482,7 +1482,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
                 continue;
 
             /* Don't overlap with other modules (or Xen itself). */
-            end = consider_modules(s, e, size, mod,
+            end = consider_modules(s, e, size, boot_info->mods,
                                    boot_info->nr_mods + relocated, j);
 
             if ( highmem_start && end > highmem_start )
@@ -1509,7 +1509,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
         while ( !kexec_crash_area.start )
         {
             /* Don't overlap with modules (or Xen itself). */
-            e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size), mod,
+            e = consider_modules(s, e, PAGE_ALIGN(kexec_crash_area.size), boot_info->mods,
                                  boot_info->nr_mods + relocated, -1);
             if ( s >= e )
                 break;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:48:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:48:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786674.1196313 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9U0-0007DY-4R; Fri, 30 Aug 2024 21:48:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786674.1196313; Fri, 30 Aug 2024 21:48:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9U0-0007D9-0h; Fri, 30 Aug 2024 21:48:40 +0000
Received: by outflank-mailman (input) for mailman id 786674;
 Fri, 30 Aug 2024 21:48:39 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Tz-00065G-3d
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:48:39 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 9c1d208c-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:48:37 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054467441405.8525706873397;
 Fri, 30 Aug 2024 14:47:47 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 9c1d208c-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054469; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=hIA7N2SJZp89HintuCk+GAjbeXw1wAB4oYeGTSk2lJS5U9LoFNlQZzBCdw/eYsYnnZXkNN3pNzeNuWTkoeLuu1ppCn+UE22Ct2rq89eZI04Z6S0+WhIJQzlU5V46M4F/A+crL8HnA+pGB9tASmU6dtYuOLDzCkSO5+4ZjV22rZg=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054469; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=fxUow580sXI5NW+SdFuYYRTiCwP+vMd1bOEnrXKFUj4=; 
	b=mCMqZzAeeWwKuBQbud9mZdBYmAMGXR3G3uMXd8c3M3LwJ6UX2YfQW9uzjiwEJ5A7Z41uhRE2QbY0mqMY9x9krSETPoBTaFghijgkEOtqPC4iNCUmf0Ph9xwUNOKeGG89OS7zAXMGs9FPO1IfHiSb4WNpW4xchDgNz32IlVLFHBk=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054469;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=fxUow580sXI5NW+SdFuYYRTiCwP+vMd1bOEnrXKFUj4=;
	b=nAiTT+NBAuq1xI+ZCeVXuPl9MrtoOoqzE4vnjoPfgYSGwDZWEbPI+yFmlVkogkpK
	x6Ha9alBUZJbRDFd7WPTlP4LBNUqq3uAfXrA6g0A79+q0Z/06zExLPPhvPWV2DeRHHY
	YwnsUSmN2k8KU3kfXl8jBWYE3tMuz5PHE3pC8hsc=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 07/44] x86/boot: move headroom to boot modules
Date: Fri, 30 Aug 2024 17:46:52 -0400
Message-Id: <20240830214730.1621-8-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

The purpose of struct boot_module is to encapsulate the state of boot modules.
Doing locates boot module state with its respective boot module, reduces
globals and multiple state variables being passed around. It also lays the
ground work for hyperlaunch where more multiple instances of these state
variables like headroom will be needed.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootinfo.h |  1 +
 xen/arch/x86/setup.c                | 22 +++++++++++++---------
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index 844262495962..3e0e36df096b 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -13,6 +13,7 @@
 
 struct boot_module {
     module_t *early_mod;
+    unsigned long headroom;
 };
 
 struct boot_info {
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 8912956ee7f1..fd6cc7fac907 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1031,7 +1031,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     unsigned int initrdidx, num_parked = 0;
     multiboot_info_t *mbi;
     module_t *mod;
-    unsigned long nr_pages, raw_max_page, modules_headroom, module_map[1];
+    unsigned long nr_pages, raw_max_page, module_map[1];
     int i, j, e820_warn = 0, bytes = 0;
     unsigned long eb_start, eb_end;
     bool acpi_boot_table_init_done = false, relocated = false;
@@ -1390,7 +1390,9 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
         mod[boot_info->nr_mods].mod_end = __2M_rwdata_end - _stext;
     }
 
-    modules_headroom = bzimage_headroom(bootstrap_map(mod), mod->mod_end);
+    boot_info->mods[0].headroom = bzimage_headroom(
+                        bootstrap_map(boot_info->mods[0].early_mod),
+                        boot_info->mods[0].early_mod->mod_end);
     bootstrap_map(NULL);
 
 #ifndef highmem_start
@@ -1475,8 +1477,10 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
              * decompressor overheads of mod[0] (the dom0 kernel).  When we
              * move mod[0], we incorporate this as extra space at the start.
              */
-            unsigned long headroom = j ? 0 : modules_headroom;
-            unsigned long size = PAGE_ALIGN(headroom + mod[j].mod_end);
+            struct boot_module *bm = &boot_info->mods[j];
+            unsigned long size;
+
+            size = PAGE_ALIGN(bm->headroom + mod[j].mod_end);
 
             if ( mod[j].reserved )
                 continue;
@@ -1489,14 +1493,14 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
                 continue;
 
             if ( s < end &&
-                 (headroom ||
+                 (bm->headroom ||
                   ((end - size) >> PAGE_SHIFT) > mod[j].mod_start) )
             {
-                move_memory(end - size + headroom,
+                move_memory(end - size + bm->headroom,
                             (uint64_t)mod[j].mod_start << PAGE_SHIFT,
                             mod[j].mod_end);
                 mod[j].mod_start = (end - size) >> PAGE_SHIFT;
-                mod[j].mod_end += headroom;
+                mod[j].mod_end += bm->headroom;
                 mod[j].reserved = 1;
             }
         }
@@ -1523,7 +1527,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 #endif
     }
 
-    if ( modules_headroom && !mod->reserved )
+    if ( boot_info->mods[0].headroom && !mod->reserved )
         panic("Not enough memory to relocate the dom0 kernel image\n");
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
@@ -2077,7 +2081,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
      * We're going to setup domain0 using the module(s) that we stashed safely
      * above our heap. The second module, if present, is an initrd ramdisk.
      */
-    dom0 = create_dom0(mod, modules_headroom,
+    dom0 = create_dom0(mod, boot_info->mods[0].headroom,
                        initrdidx < boot_info->nr_mods ? mod + initrdidx : NULL,
                        kextra, boot_info->boot_loader_name);
     if ( !dom0 )
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:48:47 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:48:47 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786680.1196324 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9U7-0007mk-DW; Fri, 30 Aug 2024 21:48:47 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786680.1196324; Fri, 30 Aug 2024 21:48:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9U7-0007mX-9J; Fri, 30 Aug 2024 21:48:47 +0000
Received: by outflank-mailman (input) for mailman id 786680;
 Fri, 30 Aug 2024 21:48:45 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9U5-00065G-RD
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:48:45 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a038ab1a-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:48:44 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 172505446851348.39122552142521;
 Fri, 30 Aug 2024 14:47:48 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a038ab1a-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054470; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=ETp14un5/oRlpw59XDSha+sLCsPX7dzvMDm6v/B7GqUW/ai3XLcyLu9VlqpQz0FLlPwTAMuR31saMVgpnMG7tGcTffPRfVYvbl0HdiqMRONVF3bViygDQjaiS5UkH6VGz3EaAbBz42ueYxMvhbD8EnY1GSK1/FBJjZ/Wf0X4Giw=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054470; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=bHmAH7Z09uDCvq9Lv4ibJKqcWjY/D6qrWQ62O+CCfoc=; 
	b=hy/WDeoEtxLbSTVg1Y/K8RabOYXbLJTQs5snF3J8mwJtPiQrZYi85HgcKfyqJVQzEY80BD03AbuFnKxVozodPxvEDhSWeDf1jVFW1eo4erv4sBYU7tM3TlLHqjqaQ0Ymk8XTrng8ZPln9aLN8FUbB7rKZUYf0BZVVn0r1HK3IMY=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054470;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=bHmAH7Z09uDCvq9Lv4ibJKqcWjY/D6qrWQ62O+CCfoc=;
	b=vWIFzzwO5EKR5BbYzso1Z775SxcdDEpJVFG4Jllb+38PeR2RIWaO8nofWBvRSmQV
	LXeJL5myJc/YX+175AdpzdModS4G4fpDYGvAon/4d9gClKDo/bxCWd8QhoevMIuYYJi
	4ZnIM2bZg8v5wfOHJtX31khvPjxBKqUasTk7ZzhE=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 08/44] x86/boot: convert setup.c mod refs to early_mod
Date: Fri, 30 Aug 2024 17:46:53 -0400
Message-Id: <20240830214730.1621-9-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

To allow a slow conversion of x86 over to struct boot_module, start with
replacing all references to struct mod to the early_mod element of struct
boot_module. These serves twofold, first to allow the incremental transition
from struct mod fields to struct boot_module fields.  The second is to allow
the conversion of function definitions from taking struct mod parameters to
accepting struct boot_module as needed when a transitioned field will be
accessed.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/setup.c | 61 ++++++++++++++++++++++++--------------------
 1 file changed, 34 insertions(+), 27 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index fd6cc7fac907..82a4375683d2 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1360,15 +1360,15 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     set_kexec_crash_area_size((u64)nr_pages << PAGE_SHIFT);
     kexec_reserve_area();
 
-    initial_images = mod;
+    initial_images = boot_info->mods[0].early_mod;
 
     for ( i = 0; !efi_enabled(EFI_LOADER) && i < boot_info->nr_mods; i++ )
     {
-        if ( mod[i].mod_start & (PAGE_SIZE - 1) )
+        if ( boot_info->mods[i].early_mod->mod_start & (PAGE_SIZE - 1) )
             panic("Bootloader didn't honor module alignment request\n");
-        mod[i].mod_end -= mod[i].mod_start;
-        mod[i].mod_start >>= PAGE_SHIFT;
-        mod[i].reserved = 0;
+        boot_info->mods[i].early_mod->mod_end -= boot_info->mods[i].early_mod->mod_start;
+        boot_info->mods[i].early_mod->mod_start >>= PAGE_SHIFT;
+        boot_info->mods[i].early_mod->reserved = 0;
     }
 
     /*
@@ -1379,6 +1379,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
     if ( xen_phys_start )
     {
+        int idx = boot_info->nr_mods;
         relocated = true;
 
         /*
@@ -1386,8 +1387,8 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
          * respective reserve_e820_ram() invocation below. No need to
          * query efi_boot_mem_unused() here, though.
          */
-        mod[boot_info->nr_mods].mod_start = virt_to_mfn(_stext);
-        mod[boot_info->nr_mods].mod_end = __2M_rwdata_end - _stext;
+        boot_info->mods[idx].early_mod->mod_start = virt_to_mfn(_stext);
+        boot_info->mods[idx].early_mod->mod_end = __2M_rwdata_end - _stext;
     }
 
     boot_info->mods[0].headroom = bzimage_headroom(
@@ -1480,9 +1481,9 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
             struct boot_module *bm = &boot_info->mods[j];
             unsigned long size;
 
-            size = PAGE_ALIGN(bm->headroom + mod[j].mod_end);
+            size = PAGE_ALIGN(bm->headroom + bm->early_mod->mod_end);
 
-            if ( mod[j].reserved )
+            if ( boot_info->mods[j].early_mod->reserved )
                 continue;
 
             /* Don't overlap with other modules (or Xen itself). */
@@ -1494,14 +1495,14 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
             if ( s < end &&
                  (bm->headroom ||
-                  ((end - size) >> PAGE_SHIFT) > mod[j].mod_start) )
+                  ((end - size) >> PAGE_SHIFT) > bm->early_mod->mod_start) )
             {
                 move_memory(end - size + bm->headroom,
-                            (uint64_t)mod[j].mod_start << PAGE_SHIFT,
-                            mod[j].mod_end);
-                mod[j].mod_start = (end - size) >> PAGE_SHIFT;
-                mod[j].mod_end += bm->headroom;
-                mod[j].reserved = 1;
+                            (uint64_t)bm->early_mod->mod_start << PAGE_SHIFT,
+                            bm->early_mod->mod_end);
+                bm->early_mod->mod_start = (end - size) >> PAGE_SHIFT;
+                bm->early_mod->mod_end += bm->headroom;
+                bm->early_mod->reserved = 1;
             }
         }
 
@@ -1527,13 +1528,15 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 #endif
     }
 
-    if ( boot_info->mods[0].headroom && !mod->reserved )
+    if ( boot_info->mods[0].headroom && !boot_info->mods[0].early_mod->reserved )
         panic("Not enough memory to relocate the dom0 kernel image\n");
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
-        uint64_t s = (uint64_t)mod[i].mod_start << PAGE_SHIFT;
+        uint64_t s = (uint64_t)boot_info->mods[i].early_mod->mod_start
+                        << PAGE_SHIFT;
 
-        reserve_e820_ram(&boot_e820, s, s + PAGE_ALIGN(mod[i].mod_end));
+        reserve_e820_ram(&boot_e820, s,
+                         s + PAGE_ALIGN(boot_info->mods[i].early_mod->mod_end));
     }
 
     if ( !xen_phys_start )
@@ -1611,8 +1614,9 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
                 map_e = boot_e820.map[j].addr + boot_e820.map[j].size;
                 for ( j = 0; j < boot_info->nr_mods; ++j )
                 {
-                    uint64_t end = pfn_to_paddr(mod[j].mod_start) +
-                                   mod[j].mod_end;
+                    uint64_t end = pfn_to_paddr(
+                                   boot_info->mods[j].early_mod->mod_start) +
+                                   boot_info->mods[j].early_mod->mod_end;
 
                     if ( map_e < end )
                         map_e = end;
@@ -1686,11 +1690,13 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
-        set_pdx_range(mod[i].mod_start,
-                      mod[i].mod_start + PFN_UP(mod[i].mod_end));
-        map_pages_to_xen((unsigned long)mfn_to_virt(mod[i].mod_start),
-                         _mfn(mod[i].mod_start),
-                         PFN_UP(mod[i].mod_end), PAGE_HYPERVISOR);
+        set_pdx_range(boot_info->mods[i].early_mod->mod_start,
+                      boot_info->mods[i].early_mod->mod_start +
+                      PFN_UP(boot_info->mods[i].early_mod->mod_end));
+        map_pages_to_xen(
+            (unsigned long)mfn_to_virt(boot_info->mods[i].early_mod->mod_start),
+            _mfn(boot_info->mods[i].early_mod->mod_start),
+            PFN_UP(boot_info->mods[i].early_mod->mod_end), PAGE_HYPERVISOR);
     }
 
 #ifdef CONFIG_KEXEC
@@ -2081,8 +2087,9 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
      * We're going to setup domain0 using the module(s) that we stashed safely
      * above our heap. The second module, if present, is an initrd ramdisk.
      */
-    dom0 = create_dom0(mod, boot_info->mods[0].headroom,
-                       initrdidx < boot_info->nr_mods ? mod + initrdidx : NULL,
+    dom0 = create_dom0(boot_info->mods[0].early_mod, boot_info->mods[0].headroom,
+                       initrdidx < boot_info->nr_mods ?
+                            boot_info->mods[initrdidx].early_mod : NULL,
                        kextra, boot_info->boot_loader_name);
     if ( !dom0 )
         panic("Could not set up DOM0 guest OS\n");
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:50:04 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:50:04 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786687.1196335 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9VM-0000tj-0D; Fri, 30 Aug 2024 21:50:04 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786687.1196335; Fri, 30 Aug 2024 21:50:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9VL-0000t8-QH; Fri, 30 Aug 2024 21:50:03 +0000
Received: by outflank-mailman (input) for mailman id 786687;
 Fri, 30 Aug 2024 21:50:02 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9VK-0000Zf-8u
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:50:02 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id cd2154f2-6719-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:50:00 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054479373585.778896678308;
 Fri, 30 Aug 2024 14:47:59 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: cd2154f2-6719-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054481; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=FEGmLK6fu+9wYmYqWZCJ3D208mCbv5w+ovSDVze+c93yVuEgwNzEFii9v59Wx5bpIEEMGUgbHjCAdvfj7aNsUmqk2mOtCqz97RxBYjVJmYp09LSaPwrUzP9kJ3xhNB6cS8sJxCePDWzNOQhqaJ0di9OUGRr3dUsi0tg8FaKN3Dw=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054481; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=x7EA1HjwHFmnd4GnZ7Gub2RJOomQt0q62OXf51BcXpM=; 
	b=VTWhRAdCMXgT8oyOCjAtvVXa52eqKZG3JRjIxN7XwVgt7uj7MIzsvWHQpT26VvERP+105AzH6hlMz+/vDnTZO/x1BqPi//6ndjGHYzLmzswtQbWPzlnXocPsG+uKw8NLffuyZBnHLfAQ/0Qdex4AZeMhpaw7GPRK8OAxdCz8fIQ=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054481;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=x7EA1HjwHFmnd4GnZ7Gub2RJOomQt0q62OXf51BcXpM=;
	b=pSth6LFRIXPSZKfgsmM1u9uCXbxqB+1eHdVwKjkXPw+NDTySyaXzTiji8PL5zIyr
	vro1JEqgTsOTLFlxGB0xBSEvQQsdASY1ErOql689Syj+lq3sch1gJ2Aim2iZy47/eCZ
	BuzKKeWDSuwqp02/CvQHW4cdaGGTaVthiIpWXFBo=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 18/44] x86/boot: convert late microcode loading to struct boot_module
Date: Fri, 30 Aug 2024 17:47:03 -0400
Message-Id: <20240830214730.1621-19-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Remove the use of struct mod to hold the reference for the microcode,
converting the code to work with a struct boot_module.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/cpu/microcode/core.c | 31 +++++++++++++++----------------
 1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 653a725173ba..cedb03beea54 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -28,7 +28,6 @@
 #include <xen/err.h>
 #include <xen/guest_access.h>
 #include <xen/init.h>
-#include <xen/multiboot.h>
 #include <xen/param.h>
 #include <xen/spinlock.h>
 #include <xen/stop_machine.h>
@@ -59,7 +58,7 @@
  */
 #define MICROCODE_UPDATE_TIMEOUT_US 1000000
 
-static module_t __initdata ucode_mod;
+static struct boot_module __initdata ucode_mod;
 static signed int __initdata ucode_mod_idx;
 static bool __initdata ucode_mod_forced;
 static unsigned int nr_cores;
@@ -93,7 +92,7 @@ struct ucode_mod_blob {
 
 static struct ucode_mod_blob __initdata ucode_blob;
 /*
- * By default we will NOT parse the multiboot modules to see if there is
+ * By default we will NOT parse the boot modules to see if there is
  * cpio image with the microcode images.
  */
 static bool __initdata ucode_scan;
@@ -198,7 +197,7 @@ static void __init microcode_scan_module(
             ucode_blob.data = cd.data;
             break;
         }
-        bootstrap_map(NULL);
+        bootstrap_map_bm(NULL);
     }
 }
 
@@ -211,7 +210,7 @@ static void __init microcode_grab_module(
          !__test_and_clear_bit(ucode_mod_idx, module_map) )
         goto scan;
     bi->mods[ucode_mod_idx].type = BOOTMOD_MICROCODE;
-    ucode_mod = *bi->mods[ucode_mod_idx].early_mod;
+    ucode_mod = bi->mods[ucode_mod_idx];
 scan:
     if ( ucode_scan )
         microcode_scan_module(module_map, bi);
@@ -749,14 +748,14 @@ static int __init cf_check microcode_init(void)
      */
     if ( ucode_blob.size )
     {
-        bootstrap_map(NULL);
+        bootstrap_map_bm(NULL);
         ucode_blob.size = 0;
         ucode_blob.data = NULL;
     }
-    else if ( ucode_mod.mod_end )
+    else if ( ucode_mod.size )
     {
-        bootstrap_map(NULL);
-        ucode_mod.mod_end = 0;
+        bootstrap_map_bm(NULL);
+        ucode_mod.size = 0;
     }
 
     return 0;
@@ -814,9 +813,9 @@ int __init microcode_init_cache(
         /* Need to rescan the modules because they might have been relocated */
         microcode_scan_module(module_map, bi);
 
-    if ( ucode_mod.mod_end )
-        rc = early_update_cache(bootstrap_map(&ucode_mod),
-                                ucode_mod.mod_end);
+    if ( ucode_mod.size )
+        rc = early_update_cache(bootstrap_map_bm(&ucode_mod),
+                                ucode_mod.size);
     else if ( ucode_blob.size )
         rc = early_update_cache(ucode_blob.data, ucode_blob.size);
 
@@ -835,10 +834,10 @@ static int __init early_microcode_update_cpu(void)
         len = ucode_blob.size;
         data = ucode_blob.data;
     }
-    else if ( ucode_mod.mod_end )
+    else if ( ucode_mod.size )
     {
-        len = ucode_mod.mod_end;
-        data = bootstrap_map(&ucode_mod);
+        len = ucode_mod.size;
+        data = bootstrap_map_bm(&ucode_mod);
     }
 
     if ( !data )
@@ -904,7 +903,7 @@ int __init early_microcode_init(unsigned long *module_map,
 
     microcode_grab_module(module_map, bi);
 
-    if ( ucode_mod.mod_end || ucode_blob.size )
+    if ( ucode_mod.size || ucode_blob.size )
         rc = early_microcode_update_cpu();
 
     /*
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:50:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:50:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786688.1196344 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9VS-0001bx-5C; Fri, 30 Aug 2024 21:50:10 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786688.1196344; Fri, 30 Aug 2024 21:50:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9VS-0001bq-2Y; Fri, 30 Aug 2024 21:50:10 +0000
Received: by outflank-mailman (input) for mailman id 786688;
 Fri, 30 Aug 2024 21:50: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9VR-0000Zf-FW
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:50:09 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d1d1e673-6719-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:50:07 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 172505448043769.83491652747614;
 Fri, 30 Aug 2024 14:48:00 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d1d1e673-6719-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054482; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=XTnfnMMm4v6l8bgXkrImzcmzW4zs0WOeye4Wvyn/3qtPDFmtYslJfbzmsHztcRJrBrXcUdp8HkyNIxuXbyT6L6h5ZRs80F8cn2GJBR1F/wlCulfd042UqUvOqfSMaIt3jtqczW34RQ0BpB+IcoVlZ6k9S8z5j9tjtdAsa92owW0=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054482; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=LvQN4/ZeUGHQXB1oFQeKAxyDBFEc9pZ1Jq2e0h2a0EA=; 
	b=PwZwn/ShaCUjoquhIDwC/pWauonn6EskybZSDF0kJECtc4ykfm8siRTP2Hu7yuBVPejf15P6bJKNFHopZdLQZiiTrUjFaUij77/nGSR2yjIKVgj5uh0iMmucnKSUfJVZGdnQycXXReNKz+e8i6sBiu8gvAvTIxYDuTqdoxV4xzE=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054482;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=LvQN4/ZeUGHQXB1oFQeKAxyDBFEc9pZ1Jq2e0h2a0EA=;
	b=W/Gl4cgwewEQRRVLEyJntP9FHXJtsY8Bg50wNRAiItjTUSUQ4QV4d/aJmgozlJdt
	2pUEavy2UhYy5r/kroq/mqALqBSw4r2+wFArYhplNMjL4QjZWsNJRWSEuwexTL3ESRe
	fGvhnScPUX3CVOece3XxRKakOQrReni3BC+MSiB0=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 19/44] x86/boot: use consumed boot module flag for microcode
Date: Fri, 30 Aug 2024 17:47:04 -0400
Message-Id: <20240830214730.1621-20-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

To track if the microcode boot module was loaded, a copy of the boot module is
kept. The size element of this copy is set to zero as the indicator that the
microcode was loaded. A side effect is that the modules have to be rescanned to
find the boot module post-relocation, so the cache copy can be created.

Use the consumed boot module flag to track the loading of the microcode boot
module. This removes the need to manipulate the boot module size element, no
longer requiring the copy, thus allowing it to be replaced by a reference. As a
result it is no longer necessary to rescan the boot modules after relocation
has occurred.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/cpu/microcode/core.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index cedb03beea54..83dd8bbe9fb1 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -58,7 +58,7 @@
  */
 #define MICROCODE_UPDATE_TIMEOUT_US 1000000
 
-static struct boot_module __initdata ucode_mod;
+static struct boot_module __initdata *ucode_mod;
 static signed int __initdata ucode_mod_idx;
 static bool __initdata ucode_mod_forced;
 static unsigned int nr_cores;
@@ -210,7 +210,7 @@ static void __init microcode_grab_module(
          !__test_and_clear_bit(ucode_mod_idx, module_map) )
         goto scan;
     bi->mods[ucode_mod_idx].type = BOOTMOD_MICROCODE;
-    ucode_mod = bi->mods[ucode_mod_idx];
+    ucode_mod = &bi->mods[ucode_mod_idx];
 scan:
     if ( ucode_scan )
         microcode_scan_module(module_map, bi);
@@ -752,10 +752,10 @@ static int __init cf_check microcode_init(void)
         ucode_blob.size = 0;
         ucode_blob.data = NULL;
     }
-    else if ( ucode_mod.size )
+    else if ( ucode_mod && !(ucode_mod->flags & BOOTMOD_FLAG_X86_CONSUMED) )
     {
         bootstrap_map_bm(NULL);
-        ucode_mod.size = 0;
+        ucode_mod->flags |= BOOTMOD_FLAG_X86_CONSUMED;
     }
 
     return 0;
@@ -809,14 +809,14 @@ int __init microcode_init_cache(
     if ( !ucode_ops.apply_microcode )
         return -ENODEV;
 
-    if ( ucode_scan )
-        /* Need to rescan the modules because they might have been relocated */
+    /* Scan if microcode was not detected earlier */
+    if ( !ucode_mod )
         microcode_scan_module(module_map, bi);
 
-    if ( ucode_mod.size )
-        rc = early_update_cache(bootstrap_map_bm(&ucode_mod),
-                                ucode_mod.size);
-    else if ( ucode_blob.size )
+    if ( ucode_mod && !(ucode_mod->flags & BOOTMOD_FLAG_X86_CONSUMED) )
+        rc = early_update_cache(bootstrap_map_bm(ucode_mod),
+                                ucode_mod->size);
+    else if ( ucode_mod && ucode_blob.size )
         rc = early_update_cache(ucode_blob.data, ucode_blob.size);
 
     return rc;
@@ -834,10 +834,10 @@ static int __init early_microcode_update_cpu(void)
         len = ucode_blob.size;
         data = ucode_blob.data;
     }
-    else if ( ucode_mod.size )
+    else if ( ucode_mod && !(ucode_mod->flags & BOOTMOD_FLAG_X86_CONSUMED) )
     {
-        len = ucode_mod.size;
-        data = bootstrap_map_bm(&ucode_mod);
+        len = ucode_mod->size;
+        data = bootstrap_map_bm(ucode_mod);
     }
 
     if ( !data )
@@ -903,7 +903,7 @@ int __init early_microcode_init(unsigned long *module_map,
 
     microcode_grab_module(module_map, bi);
 
-    if ( ucode_mod.size || ucode_blob.size )
+    if ( ucode_mod || ucode_blob.size )
         rc = early_microcode_update_cpu();
 
     /*
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:50:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:50:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786690.1196354 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Va-00022c-Bu; Fri, 30 Aug 2024 21:50:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786690.1196354; Fri, 30 Aug 2024 21:50:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Va-00022U-8f; Fri, 30 Aug 2024 21:50:18 +0000
Received: by outflank-mailman (input) for mailman id 786690;
 Fri, 30 Aug 2024 21:50:17 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9VZ-0000Zf-3p
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:50:17 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id d62f24fe-6719-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:50:15 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054481581187.92876924816562;
 Fri, 30 Aug 2024 14:48:01 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: d62f24fe-6719-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054483; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=MImAxhfwNPeS3w8pWcKg4XRtc6oggkouWyA+B/FXA+UfZHI5QNwG88fQIgbAVE4DgNVLQGltY3LuT4QqILVlht22rkpTdj6mMO4jhPzdVSaXjs+qKhsuGVhW+KC5tqCbwR0+gzwwb21AqlKClpkSY/4easU3xmNdiN0oIOrSPXA=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054483; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=HBuvBxLu0927SlqbG8RcjS/3s6UZxSTS/pkLGNBX224=; 
	b=Q7BjRw5S14bOAYEyGSFlzxeebkGQJecgUnPtlDQuIOluyU6LMt+UJM51CsScplaQZLcxl17Ya3N+qBBe9VFmzZoB4mgCQ/maSLrSZ9ywYYPpFBY2nf8jbmA3yJeNRqxEQOOHKUrzkTpxzkZU0g33j2lnPHAFsBuR47VUxHtR0NM=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054483;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=HBuvBxLu0927SlqbG8RcjS/3s6UZxSTS/pkLGNBX224=;
	b=aVD2dDfuU1kn0SnndaUHLfFEXQNIof6L+lN7Z97oJQI1DViGz+HiERFQ3I5JoPXv
	JYUUKI0v6VU1/YITg0yn/n5Fqlo+BqGOK4ooymMWQoY5vsk/uLeXavzfzuIJydYk7U9
	XzTy9BZo+dlFeId/fJGhZH89euiM0sZyJTzasB8g=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 20/44] x86/boot: convert xsm policy loading to struct boot_module
Date: Fri, 30 Aug 2024 17:47:05 -0400
Message-Id: <20240830214730.1621-21-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Iterate through the unclaimed struct boot_module to see if any are an XSM FLASK
policy. If one is located, mark it as an xsm policy.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootinfo.h |  1 +
 xen/arch/x86/setup.c                |  2 +-
 xen/include/xsm/xsm.h               | 11 +++++++----
 xen/xsm/xsm_core.c                  | 13 +++++++++++--
 xen/xsm/xsm_policy.c                | 15 ++++++++-------
 5 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index 1cef48457c66..1a325f66b3ba 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -18,6 +18,7 @@ enum bootmod_type {
     BOOTMOD_KERNEL,
     BOOTMOD_RAMDISK,
     BOOTMOD_MICROCODE,
+    BOOTMOD_XSM_POLICY,
 };
 
 struct boot_module {
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 6495ab393576..28b39d23f644 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1878,7 +1878,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     mmio_ro_ranges = rangeset_new(NULL, "r/o mmio ranges",
                                   RANGESETF_prettyprint_hex);
 
-    xsm_multiboot_init(module_map, mbi);
+    xsm_multiboot_init(module_map, boot_info);
 
     /*
      * IOMMU-related ACPI table parsing may require some of the system domains
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 627c0d2731af..9e511ef8878c 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -17,7 +17,10 @@
 
 #include <xen/alternative-call.h>
 #include <xen/sched.h>
-#include <xen/multiboot.h>
+
+#ifdef CONFIG_MULTIBOOT
+#include <asm/bootinfo.h>
+#endif
 
 /* policy magic number (defined by XSM_MAGIC) */
 typedef uint32_t xsm_magic_t;
@@ -779,9 +782,9 @@ static inline int xsm_argo_send(const struct domain *d, const struct domain *t)
 
 #ifdef CONFIG_MULTIBOOT
 int xsm_multiboot_init(
-    unsigned long *module_map, const multiboot_info_t *mbi);
+    unsigned long *module_map, const struct boot_info *bi);
 int xsm_multiboot_policy_init(
-    unsigned long *module_map, const multiboot_info_t *mbi,
+    unsigned long *module_map, const struct boot_info *bi,
     void **policy_buffer, size_t *policy_size);
 #endif
 
@@ -829,7 +832,7 @@ static const inline struct xsm_ops *silo_init(void)
 
 #ifdef CONFIG_MULTIBOOT
 static inline int xsm_multiboot_init (
-    unsigned long *module_map, const multiboot_info_t *mbi)
+    unsigned long *module_map, const struct boot_info *bi)
 {
     return 0;
 }
diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index eaa028109bde..9f87ec4f6754 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -21,6 +21,7 @@
 #ifdef CONFIG_XSM
 
 #ifdef CONFIG_MULTIBOOT
+#include <asm/bootinfo.h>
 #include <asm/setup.h>
 #endif
 
@@ -140,7 +141,7 @@ static int __init xsm_core_init(const void *policy_buffer, size_t policy_size)
 
 #ifdef CONFIG_MULTIBOOT
 int __init xsm_multiboot_init(
-    unsigned long *module_map, const multiboot_info_t *mbi)
+    unsigned long *module_map, const struct boot_info *bi)
 {
     int ret = 0;
     void *policy_buffer = NULL;
@@ -150,7 +151,7 @@ int __init xsm_multiboot_init(
 
     if ( XSM_MAGIC )
     {
-        ret = xsm_multiboot_policy_init(module_map, mbi, &policy_buffer,
+        ret = xsm_multiboot_policy_init(module_map, bi, &policy_buffer,
                                         &policy_size);
         if ( ret )
         {
@@ -161,6 +162,14 @@ int __init xsm_multiboot_init(
     }
 
     ret = xsm_core_init(policy_buffer, policy_size);
+    if ( ret == 0 )
+    {
+        int idx = first_boot_module_index(bi, BOOTMOD_XSM_POLICY);
+
+        /* If the policy was loaded from a boot module, mark it consumed */
+        if ( idx >= 0 )
+            bi->mods[idx].flags |= BOOTMOD_FLAG_X86_CONSUMED;
+    }
     bootstrap_map(NULL);
 
     return 0;
diff --git a/xen/xsm/xsm_policy.c b/xen/xsm/xsm_policy.c
index 8dafbc93810f..e4c94afd108d 100644
--- a/xen/xsm/xsm_policy.c
+++ b/xen/xsm/xsm_policy.c
@@ -21,6 +21,7 @@
 #include <xsm/xsm.h>
 #ifdef CONFIG_MULTIBOOT
 #include <xen/multiboot.h>
+#include <asm/bootinfo.h>
 #include <asm/setup.h>
 #endif
 #include <xen/bitops.h>
@@ -31,11 +32,10 @@
 
 #ifdef CONFIG_MULTIBOOT
 int __init xsm_multiboot_policy_init(
-    unsigned long *module_map, const multiboot_info_t *mbi,
+    unsigned long *module_map, const struct boot_info *bi,
     void **policy_buffer, size_t *policy_size)
 {
     int i;
-    module_t *mod = (module_t *)__va(mbi->mods_addr);
     int rc = 0;
     u32 *_policy_start;
     unsigned long _policy_len;
@@ -44,13 +44,13 @@ int __init xsm_multiboot_policy_init(
      * Try all modules and see whichever could be the binary policy.
      * Adjust module_map for the module that is the binary policy.
      */
-    for ( i = mbi->mods_count-1; i >= 1; i-- )
+    for ( i = bi->nr_mods-1; i >= 1; i-- )
     {
-        if ( !test_bit(i, module_map) )
+        if ( bi->mods[i].type != BOOTMOD_UNKNOWN )
             continue;
 
-        _policy_start = bootstrap_map(mod + i);
-        _policy_len   = mod[i].mod_end;
+        _policy_start = bootstrap_map_bm(&bi->mods[i]);
+        _policy_len   = bi->mods[i].size;
 
         if ( (xsm_magic_t)(*_policy_start) == XSM_MAGIC )
         {
@@ -61,11 +61,12 @@ int __init xsm_multiboot_policy_init(
                    _policy_len,_policy_start);
 
             __clear_bit(i, module_map);
+            bi->mods[i].type = BOOTMOD_XSM_POLICY;
             break;
 
         }
 
-        bootstrap_map(NULL);
+        bootstrap_map_bm(NULL);
     }
 
     return rc;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:50:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:50:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786695.1196363 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Vi-0002Ta-Kv; Fri, 30 Aug 2024 21:50:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786695.1196363; Fri, 30 Aug 2024 21:50:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Vi-0002Sx-HO; Fri, 30 Aug 2024 21:50:26 +0000
Received: by outflank-mailman (input) for mailman id 786695;
 Fri, 30 Aug 2024 21:50:25 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Vh-0000Zf-8P
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:50:25 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id db15f88e-6719-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:50:23 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054482625863.6026282912172;
 Fri, 30 Aug 2024 14:48:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: db15f88e-6719-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054484; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=ZpQugvle45rdXeAfWV4kID5LyxhjVsZlWkEtcWbbKHNTJ6+e9VOPH12tT2oLZN5emnI68vHZva7ndgNSiupWfe4RHjHJzhnNkfGgXFTXr3Fiqyq6rOWIOl3zQ26SbwSixa9Ba4ih70XLObXQ/rN4tIKy9GBpoV06Yg1kkOyJy+o=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054484; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=eet/JYMlrz1AXMqNeYAuxYWhlWnTzhzkBPRDYkxgQbw=; 
	b=Q0HBGubFwAyK2Z2xulPWBWP9X2bwB3YDmZvqXYGhleo6vL37DEs3hAKcMmC8HNLWKnOHtddDHsGFwHW1Xtpyb7O8Dr8kjaZlFj1hzSVOIRnwcAjbLC2/jgYX7cDRyS7dLYw0hKJCQQDQ6jok50SS5VfHX/+aNOKEvMOmxqbn9mo=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054484;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=eet/JYMlrz1AXMqNeYAuxYWhlWnTzhzkBPRDYkxgQbw=;
	b=oIpDnyve5SvNNVceia88lUtSdHiR3zWs3MlNAlJ+EVtl/HShQfvig0ZsXlY3SPCd
	8Ad13IouLhb+4CmMKSFYzxW7pVpLXfCF2f3X8uL88S815QfP8e851eH4OWRSme1KFlv
	BdTnjPqR76Ke5Q8+3Pkz+FTujWmLJoKZFHEW0Kt4=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 21/44] x86/boot: convert ramdisk locating to struct boot_module
Date: Fri, 30 Aug 2024 17:47:06 -0400
Message-Id: <20240830214730.1621-22-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Locate the first unclaimed struct boot_module and mark it as ramdisk. If there
are any remaining unclaimed struct boot_module instances, report to the
console.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/setup.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 28b39d23f644..189c45302fab 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -2100,20 +2100,30 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
            cpu_has_nx ? XENLOG_INFO : XENLOG_WARNING "Warning: ",
            cpu_has_nx ? "" : "not ");
 
-    initrdidx = find_first_bit(module_map, boot_info->nr_mods);
-    boot_info->mods[initrdidx].type = BOOTMOD_RAMDISK;
-    boot_info->mods[initrdidx].flags |= BOOTMOD_FLAG_X86_CONSUMED;
-    if ( bitmap_weight(module_map, boot_info->nr_mods) > 1 )
-        printk(XENLOG_WARNING
-               "Multiple initrd candidates, picking module #%u\n",
-               initrdidx);
+    /*
+     * At this point all capabilities that consume boot modules should have
+     * claimed their boot modules. Find the first unclaimed boot module and
+     * claim it as the initrd ramdisk. Do a second search to see if there are
+     * any remaining unclaimed boot modules, and report them as unusued initrd
+     * candidates.
+     */
+    initrdidx = first_boot_module_index(boot_info, BOOTMOD_UNKNOWN);
+    if ( initrdidx >= 0 )
+    {
+        boot_info->mods[initrdidx].type = BOOTMOD_RAMDISK;
+        boot_info->mods[initrdidx].flags |= BOOTMOD_FLAG_X86_CONSUMED;
+        if ( first_boot_module_index(boot_info, BOOTMOD_UNKNOWN) >= 0 )
+            printk(XENLOG_WARNING
+                   "Multiple initrd candidates, picking module #%u\n",
+                   initrdidx);
+    }
 
     /*
      * We're going to setup domain0 using the module(s) that we stashed safely
      * above our heap. The second module, if present, is an initrd ramdisk.
      */
     dom0 = create_dom0(boot_info->mods[0].early_mod, boot_info->mods[0].headroom,
-                       initrdidx < boot_info->nr_mods ?
+                       (initrdidx >= 0 && initrdidx < boot_info->nr_mods) ?
                             boot_info->mods[initrdidx].early_mod : NULL,
                        kextra, boot_info->boot_loader_name);
     if ( !dom0 )
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:50:35 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:50:35 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786701.1196374 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Vq-0002ua-TW; Fri, 30 Aug 2024 21:50:34 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786701.1196374; Fri, 30 Aug 2024 21:50:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Vq-0002uT-Qj; Fri, 30 Aug 2024 21:50:34 +0000
Received: by outflank-mailman (input) for mailman id 786701;
 Fri, 30 Aug 2024 21:50:33 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Vp-0002pb-Q4
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:50:33 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id dffef035-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:50:31 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054483861421.2034253922176;
 Fri, 30 Aug 2024 14:48:03 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: dffef035-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054485; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=ia6wGt9t5HuBaQqNQZ55WRnAQOdNnd9zqfY1qg9OixdfEMmT1wNje3s6Q/q5BhgBMfDWXZTTN4LYwoEoAigRMgQt275/Gv6+yHbGe1kTnb9GPV7fCOc1+V5D8M+xbfuYC6yAnytFTD+oPN0G6yLo3CQUpsVq7CGSXcqVueFbjNE=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054485; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=9VY/wyQt4O/me1dGYDFEc+UYgABFvTmTG94v1OX5tlk=; 
	b=KLZYeWk/gNdHKm7R1TsLTdZnnfd8Pqld01RmdseUqYSB4176FVTlWN1YBPRka9dlzAc+cAJ6V2NEl9QZKTnwPuY4m59HUJ57JjTZ3n/feNlfemlOeYXz9GfxWYCtnvzMYcajOzov85JazR5b/M+sB/LFajIHJywr5S6tfrqhVGM=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054485;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=9VY/wyQt4O/me1dGYDFEc+UYgABFvTmTG94v1OX5tlk=;
	b=dF8UFFgbdH1r41iLKSnyhdODKsMso2k76i9ie9JTslPQtsE3jMsvPBNpVZj4g+uK
	uqEJTlaujfMdz+wn+o2J0xj5U6TskKUwhWHmUWqWk937G3c0SPd8vfbHjyWwhrjdblf
	TX7n9XXtYAoQbM4TLZq9EYdpQ2vNTrNF7GkEbBPk=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 22/44] x86/boot: remove module_map usage from microcode loading
Date: Fri, 30 Aug 2024 17:47:07 -0400
Message-Id: <20240830214730.1621-23-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

With all consumers of module_map converted, remove usage of it
by the microcode loading logic.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/cpu/microcode/core.c    | 22 +++++++++-------------
 xen/arch/x86/include/asm/microcode.h |  6 ++----
 xen/arch/x86/setup.c                 |  4 ++--
 3 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 83dd8bbe9fb1..a465a676d176 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -151,8 +151,7 @@ static int __init cf_check parse_ucode(const char *s)
 }
 custom_param("ucode", parse_ucode);
 
-static void __init microcode_scan_module(
-    unsigned long *module_map, const struct boot_info *bi)
+static void __init microcode_scan_module(const struct boot_info *bi)
 {
     uint64_t *_blob_start;
     unsigned long _blob_size;
@@ -177,7 +176,7 @@ static void __init microcode_scan_module(
      */
     for ( i = 1 /* Ignore dom0 kernel */; i < bi->nr_mods; i++ )
     {
-        if ( !test_bit(i, module_map) )
+        if ( bi->mods[i].type != BOOTMOD_UNKNOWN )
             continue;
 
         _blob_start = bootstrap_map_bm(&bi->mods[i]);
@@ -201,19 +200,18 @@ static void __init microcode_scan_module(
     }
 }
 
-static void __init microcode_grab_module(
-    unsigned long *module_map, const struct boot_info *bi)
+static void __init microcode_grab_module(const struct boot_info *bi)
 {
     if ( ucode_mod_idx < 0 )
         ucode_mod_idx += bi->nr_mods;
     if ( ucode_mod_idx <= 0 || ucode_mod_idx >= bi->nr_mods ||
-         !__test_and_clear_bit(ucode_mod_idx, module_map) )
+         (bi->mods[ucode_mod_idx].type != BOOTMOD_UNKNOWN) )
         goto scan;
     bi->mods[ucode_mod_idx].type = BOOTMOD_MICROCODE;
     ucode_mod = &bi->mods[ucode_mod_idx];
 scan:
     if ( ucode_scan )
-        microcode_scan_module(module_map, bi);
+        microcode_scan_module(bi);
 }
 
 static struct microcode_ops __ro_after_init ucode_ops;
@@ -801,8 +799,7 @@ static int __init early_update_cache(const void *data, size_t len)
     return rc;
 }
 
-int __init microcode_init_cache(
-    unsigned long *module_map, const struct boot_info *bi)
+int __init microcode_init_cache(const struct boot_info *bi)
 {
     int rc = 0;
 
@@ -811,7 +808,7 @@ int __init microcode_init_cache(
 
     /* Scan if microcode was not detected earlier */
     if ( !ucode_mod )
-        microcode_scan_module(module_map, bi);
+        microcode_scan_module(bi);
 
     if ( ucode_mod && !(ucode_mod->flags & BOOTMOD_FLAG_X86_CONSUMED) )
         rc = early_update_cache(bootstrap_map_bm(ucode_mod),
@@ -857,8 +854,7 @@ static int __init early_microcode_update_cpu(void)
     return microcode_update_cpu(patch);
 }
 
-int __init early_microcode_init(unsigned long *module_map,
-                                const struct boot_info *bi)
+int __init early_microcode_init(const struct boot_info *bi)
 {
     const struct cpuinfo_x86 *c = &boot_cpu_data;
     int rc = 0;
@@ -901,7 +897,7 @@ int __init early_microcode_init(unsigned long *module_map,
         return -ENODEV;
     }
 
-    microcode_grab_module(module_map, bi);
+    microcode_grab_module(bi);
 
     if ( ucode_mod || ucode_blob.size )
         rc = early_microcode_update_cpu();
diff --git a/xen/arch/x86/include/asm/microcode.h b/xen/arch/x86/include/asm/microcode.h
index 02fdb56bb82b..6abd6c1ff510 100644
--- a/xen/arch/x86/include/asm/microcode.h
+++ b/xen/arch/x86/include/asm/microcode.h
@@ -26,10 +26,8 @@ DECLARE_PER_CPU(struct cpu_signature, cpu_sig);
 void microcode_set_module(unsigned int idx);
 int microcode_update(
     XEN_GUEST_HANDLE(const_void) buf, unsigned long len, unsigned int flags);
-int early_microcode_init(
-    unsigned long *module_map, const struct boot_info *bi);
-int microcode_init_cache(
-    unsigned long *module_map, const struct boot_info *bi);
+int early_microcode_init(const struct boot_info *bi);
+int microcode_init_cache(const struct boot_info *bi);
 int microcode_update_one(void);
 
 #endif /* ASM_X86__MICROCODE_H */
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 189c45302fab..541a956923d3 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1398,7 +1398,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
      * TODO: load ucode earlier once multiboot modules become accessible
      * at an earlier stage.
      */
-    early_microcode_init(module_map, boot_info);
+    early_microcode_init(boot_info);
 
     if ( xen_phys_start )
     {
@@ -1952,7 +1952,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
     timer_init();
 
-    microcode_init_cache(module_map, boot_info); /* Needs xmalloc() */
+    microcode_init_cache(boot_info); /* Needs xmalloc() */
 
     tsx_init(); /* Needs microcode.  May change HLE/RTM feature bits. */
 
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:50:41 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:50:41 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786705.1196384 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Vx-0003Mf-AZ; Fri, 30 Aug 2024 21:50:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786705.1196384; Fri, 30 Aug 2024 21:50:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Vx-0003MY-7h; Fri, 30 Aug 2024 21:50:41 +0000
Received: by outflank-mailman (input) for mailman id 786705;
 Fri, 30 Aug 2024 21:50:40 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Vw-0002pb-GT
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:50:40 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e4722501-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:50:39 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054484953288.2781406902028;
 Fri, 30 Aug 2024 14:48:04 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e4722501-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054486; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=fMBteAsI13MSUK4JhY2EasizYgJhcij4MN1c+5n7gd7nE0l0SsZ39qCofDWdb6+oc1ziSm+bhYHl7Tqhpp1jAWILiIsY4EJl5Iqzl+vFt1coeIA01Glqcj88pXe4SAZ6HMDk6EOg71np5el8QBgH6VBeFZYcdCWHCWNBiRRNPZU=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054486; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=CWEMixDJY7x4MLnQ/ZkZHLIFrIhvLWgtbDqN9QKbuu4=; 
	b=QolIQEHusFGH/1c7zyLjewOEij4pwbIQ/uWsxESAEJNd6uDb3Lc9h36BVXidVBERvSGb8c2HLTynoBN+5KUbTUCjSPdhbZZjeKO/YTJhXY3Xuc+rqXejjtuLRYpCH9f4j2RhNRJ+IJ5W4d6a+/8JK0HC/9yzY6j199exdjt/Ups=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054486;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=CWEMixDJY7x4MLnQ/ZkZHLIFrIhvLWgtbDqN9QKbuu4=;
	b=gsUanQnsMQJRxhBKO4nK+31N6TJynts15cxFfqcmbWbFQv7dk50npWV3qnrlwqzs
	NVnQ+aBuuQU01qZX3glUcgQrcVwcvxaFnOqXRv602/idE0jzHlt0ER55B0y6X15ruBw
	jBhn8VggWGLyLrrlGqgRSlJ/3dLAq8PQHscyZxBI=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 23/44] x86/boot: remove module_map usage from xsm policy loading
Date: Fri, 30 Aug 2024 17:47:08 -0400
Message-Id: <20240830214730.1621-24-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/setup.c  | 2 +-
 xen/include/xsm/xsm.h | 9 +++------
 xen/xsm/xsm_core.c    | 6 ++----
 xen/xsm/xsm_policy.c  | 5 +----
 4 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 541a956923d3..90c2ddb3728a 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1878,7 +1878,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     mmio_ro_ranges = rangeset_new(NULL, "r/o mmio ranges",
                                   RANGESETF_prettyprint_hex);
 
-    xsm_multiboot_init(module_map, boot_info);
+    xsm_multiboot_init(boot_info);
 
     /*
      * IOMMU-related ACPI table parsing may require some of the system domains
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 9e511ef8878c..3f05d09880d8 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -781,11 +781,9 @@ static inline int xsm_argo_send(const struct domain *d, const struct domain *t)
 #endif /* XSM_NO_WRAPPERS */
 
 #ifdef CONFIG_MULTIBOOT
-int xsm_multiboot_init(
-    unsigned long *module_map, const struct boot_info *bi);
+int xsm_multiboot_init(const struct boot_info *bi);
 int xsm_multiboot_policy_init(
-    unsigned long *module_map, const struct boot_info *bi,
-    void **policy_buffer, size_t *policy_size);
+    const struct boot_info *bi, void **policy_buffer, size_t *policy_size);
 #endif
 
 #ifdef CONFIG_HAS_DEVICE_TREE
@@ -831,8 +829,7 @@ static const inline struct xsm_ops *silo_init(void)
 #include <xsm/dummy.h>
 
 #ifdef CONFIG_MULTIBOOT
-static inline int xsm_multiboot_init (
-    unsigned long *module_map, const struct boot_info *bi)
+static inline int xsm_multiboot_init(const struct boot_info *bi)
 {
     return 0;
 }
diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c
index 9f87ec4f6754..f816c94fb5aa 100644
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -140,8 +140,7 @@ static int __init xsm_core_init(const void *policy_buffer, size_t policy_size)
 }
 
 #ifdef CONFIG_MULTIBOOT
-int __init xsm_multiboot_init(
-    unsigned long *module_map, const struct boot_info *bi)
+int __init xsm_multiboot_init(const struct boot_info *bi)
 {
     int ret = 0;
     void *policy_buffer = NULL;
@@ -151,8 +150,7 @@ int __init xsm_multiboot_init(
 
     if ( XSM_MAGIC )
     {
-        ret = xsm_multiboot_policy_init(module_map, bi, &policy_buffer,
-                                        &policy_size);
+        ret = xsm_multiboot_policy_init(bi, &policy_buffer, &policy_size);
         if ( ret )
         {
             bootstrap_map(NULL);
diff --git a/xen/xsm/xsm_policy.c b/xen/xsm/xsm_policy.c
index e4c94afd108d..ac09dd808b27 100644
--- a/xen/xsm/xsm_policy.c
+++ b/xen/xsm/xsm_policy.c
@@ -32,8 +32,7 @@
 
 #ifdef CONFIG_MULTIBOOT
 int __init xsm_multiboot_policy_init(
-    unsigned long *module_map, const struct boot_info *bi,
-    void **policy_buffer, size_t *policy_size)
+    const struct boot_info *bi, void **policy_buffer, size_t *policy_size)
 {
     int i;
     int rc = 0;
@@ -42,7 +41,6 @@ int __init xsm_multiboot_policy_init(
 
     /*
      * Try all modules and see whichever could be the binary policy.
-     * Adjust module_map for the module that is the binary policy.
      */
     for ( i = bi->nr_mods-1; i >= 1; i-- )
     {
@@ -60,7 +58,6 @@ int __init xsm_multiboot_policy_init(
             printk("Policy len %#lx, start at %p.\n",
                    _policy_len,_policy_start);
 
-            __clear_bit(i, module_map);
             bi->mods[i].type = BOOTMOD_XSM_POLICY;
             break;
 
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:50:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:50:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786709.1196394 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9W4-0003ry-Hp; Fri, 30 Aug 2024 21:50:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786709.1196394; Fri, 30 Aug 2024 21:50:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9W4-0003rr-Ex; Fri, 30 Aug 2024 21:50:48 +0000
Received: by outflank-mailman (input) for mailman id 786709;
 Fri, 30 Aug 2024 21:50:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9W3-0002pb-7I
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:50:47 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id e88aa22b-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:50:46 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054486005884.6684138233145;
 Fri, 30 Aug 2024 14:48:06 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: e88aa22b-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054488; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=SNkhcUTb5ljjl2N4k5YOyU3+oI1ILjCxlFunEQS+985K2oo1Yu+xBrLdrDkBJDxLmc2f8rW0DkVOn31d/xaGFBsjtN+u5FJLip4P+ik3GQIxhVbI41HHWntYWnMTBDrw35GjtavGKlfZ8nbhxngiDGjH4VbgJS1m3Yma82oQxLs=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054488; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=4r8bmG5H6VttNyjMx0aG3Heh83MSlb/U7U7R6jqNGbY=; 
	b=VMKWkebmIugSeqsy1YB478K5MVEVqELvz/mT7v+uKnvardBgLfOvaUxAZE4aN0UuqN0tXWortoPkUyoixYwwC94fYrC6CVesl0q5oj68SR9VrU0XdsprkOBSPcGsoXvaF36d0ClD849xYdLug6saTybJXLie4/lQYcSSEllzVco=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054488;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=4r8bmG5H6VttNyjMx0aG3Heh83MSlb/U7U7R6jqNGbY=;
	b=j63f/8kEFjZLnJwXnEwaZ/+r476pw2tLC0WHdxn5Qz5P9y7hHGmfP3qA+hpNyKde
	nuSZy3mzccLVOIEdnGTaKXemyOWhoJc2r20EWT3fLiceMuUvnhoE9/aZTzcNCQUiCd3
	FjUZTGwcsQWeUS2/ou7R3tUVBdmJJxdh+pvDBqlM=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 24/44] x86/boot: remove module_map usage by ramdisk loading
Date: Fri, 30 Aug 2024 17:47:09 -0400
Message-Id: <20240830214730.1621-25-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

The ramdisk loading is the last user of module_map, remove
its usage and any remaining remnants of module_map.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/setup.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 90c2ddb3728a..5f42d1049110 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1053,7 +1053,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     unsigned int initrdidx, num_parked = 0;
     multiboot_info_t *mbi;
     module_t *mod;
-    unsigned long nr_pages, raw_max_page, module_map[1];
+    unsigned long nr_pages, raw_max_page;
     int i, j, e820_warn = 0, bytes = 0;
     unsigned long eb_start, eb_end;
     bool acpi_boot_table_init_done = false, relocated = false;
@@ -1203,15 +1203,14 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
         panic("dom0 kernel not specified. Check bootloader configuration\n");
 
     /* Check that we don't have a silly number of modules. */
-    if ( boot_info->nr_mods > sizeof(module_map) * 8 )
+    if ( boot_info->nr_mods > MAX_NR_BOOTMODS + 1 )
     {
-        boot_info->nr_mods = sizeof(module_map) * 8;
+        boot_info->nr_mods = MAX_NR_BOOTMODS + 1;
         printk("Excessive multiboot modules - using the first %u only\n",
                boot_info->nr_mods);
     }
 
-    bitmap_fill(module_map, boot_info->nr_mods);
-    __clear_bit(0, module_map); /* Dom0 kernel is always first */
+    /* Dom0 kernel is always first */
     boot_info->mods[0].type = BOOTMOD_KERNEL;
     boot_info->mods[0].flags |= BOOTMOD_FLAG_X86_CONSUMED;
 
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:50:56 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:50:56 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786715.1196405 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9WC-0004QN-Ro; Fri, 30 Aug 2024 21:50:56 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786715.1196405; Fri, 30 Aug 2024 21:50:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9WC-0004Q9-MC; Fri, 30 Aug 2024 21:50:56 +0000
Received: by outflank-mailman (input) for mailman id 786715;
 Fri, 30 Aug 2024 21:50:55 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9WB-0002pb-5E
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:50:55 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ed3756ba-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:50:53 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054487065771.3540805061515;
 Fri, 30 Aug 2024 14:48:07 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ed3756ba-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054489; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=RwM36eY5ndlANJvGlJ0eLycvYhep4L+JHBT2OQ10GwM4BWVcyagKcezER0btgNhQqDCTixPnC90sk7zXQqs1Rl0gKC0vgvB8lMKGEd5M7G+sdFxHm8/7yPsjMc+Pr6uAp+TdkYCMcHFHDzUxJwZsxugaCHIdx7Dz4S09miNu/GI=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054489; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=ys18ftsSkLmnP3FGqbLMZshx9Vb7hKAbenYbX5oGr+w=; 
	b=FrdO7+lXLw8G6ysgq0pzXR020mdz7cIsmcyHkAwq7dfUfTDcMTxNu+6dtIX5W+6TgmlqE0uTmI87IgZOvs2dZv4SMDWcHvLn5Jrr/iV336Fl9KLnP10lBGtuHJkz9Lq7FID/fCW9vZrdfheqefj4QkFrTob2Nw0PBDPcOADgHns=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054489;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=ys18ftsSkLmnP3FGqbLMZshx9Vb7hKAbenYbX5oGr+w=;
	b=DHLyREtRAhlEVRDnPbdhTi+PYXcBI8/qPzw9pewwZ7lTVdEJbGuayFw7jjdPLqB7
	eBUUAEdpbCQ8gCHvfZpJnFo3XBeGJqkqfCz7Uoqt5j77z+jj5BbIjttDqb2OJqnDNYv
	vaRKqhSPaLfFYSCz2GBCMQlV2XZnh43a/i6muMbk=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 25/44] x86/boot: convert create_dom0 to use boot info
Date: Fri, 30 Aug 2024 17:47:10 -0400
Message-Id: <20240830214730.1621-26-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

This commit changes create_dom0 to no longer take the individual components and
take struct boot_info instead. Internally, it is changed to locate the kernel
and ramdisk details from struct boot_info.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/setup.c | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 5f42d1049110..6a613c4847b0 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -946,10 +946,8 @@ static unsigned int __init copy_bios_e820(struct e820entry *map, unsigned int li
     return n;
 }
 
-static struct domain *__init create_dom0(const module_t *image,
-                                         unsigned long headroom,
-                                         module_t *initrd, const char *kextra,
-                                         const char *loader)
+static struct domain *__init create_dom0(const struct boot_info *bi,
+                                         const char *kextra)
 {
     static char __initdata cmdline[MAX_GUEST_CMDLINE];
 
@@ -964,9 +962,21 @@ static struct domain *__init create_dom0(const module_t *image,
             .misc_flags = opt_dom0_msr_relaxed ? XEN_X86_MSR_RELAXED : 0,
         },
     };
+    int headroom, mod_idx = first_boot_module_index(bi, BOOTMOD_RAMDISK);
+    module_t *image, *initrd;
     struct domain *d;
     domid_t domid;
 
+    /* Map boot_module to mb1 module for dom0 */
+    image = bi->mods[0].early_mod;
+    headroom = bi->mods[0].headroom;
+
+    /* Map boot_module to mb1 module for initrd */
+    if ( mod_idx < 0 )
+        initrd = NULL;
+    else
+        initrd = bi->mods[mod_idx].early_mod;
+
     if ( opt_dom0_pvh )
     {
         dom0_cfg.flags |= (XEN_DOMCTL_CDF_hvm |
@@ -995,7 +1005,8 @@ static struct domain *__init create_dom0(const module_t *image,
     if ( image->string || kextra )
     {
         if ( image->string )
-            safe_strcpy(cmdline, cmdline_cook(__va(image->string), loader));
+            safe_strcpy(cmdline, cmdline_cook(__va(image->string),
+                        bi->boot_loader_name));
 
         if ( kextra )
             /* kextra always includes exactly one leading space. */
@@ -2121,10 +2132,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
      * We're going to setup domain0 using the module(s) that we stashed safely
      * above our heap. The second module, if present, is an initrd ramdisk.
      */
-    dom0 = create_dom0(boot_info->mods[0].early_mod, boot_info->mods[0].headroom,
-                       (initrdidx >= 0 && initrdidx < boot_info->nr_mods) ?
-                            boot_info->mods[initrdidx].early_mod : NULL,
-                       kextra, boot_info->boot_loader_name);
+    dom0 = create_dom0(boot_info, kextra);
     if ( !dom0 )
         panic("Could not set up DOM0 guest OS\n");
 
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:52:45 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:52:45 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786723.1196414 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Xw-0005ab-4P; Fri, 30 Aug 2024 21:52:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786723.1196414; Fri, 30 Aug 2024 21:52:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Xw-0005aU-1Z; Fri, 30 Aug 2024 21:52:44 +0000
Received: by outflank-mailman (input) for mailman id 786723;
 Fri, 30 Aug 2024 21:52:42 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Xu-0005aM-So
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:52:42 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 2d0ecb87-671a-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:52:41 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054502153808.9241274770283;
 Fri, 30 Aug 2024 14:48:22 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2d0ecb87-671a-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054504; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=HQc/8Mpes7nky1IqTnmc7WcSNsdXEdetXZNaGZMrV3ObGjL9HzhgtIDvnmOp0jZqs55UI4JZf4dO/NSgiLBX2P0CIWRYauWHowYmeNO6rXIBBPrwoCUivc5qBxeEYb6j9uW3nL+q9ct3+pqm8LZVA5fyB0EFIFA10NGe09Rw0as=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054504; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=feqDlwU7EGLLtvhfulZ1x0mRALgPHN///oYnW4IFKWA=; 
	b=a2pxoqUMt5aHGMs71XhzBzZq7qxLsNQYRpN8qfLkTQ4fy6OqBeJ1kItKz/3oP2fx5pz/HL8Xtmq3EspRq0t38yLYlqrDbCO1d8ICw/V0/P/uzKFbpZNXSxKzEswcoAThQJw4885YODAYop6k8RhAXQvG5hiz7dEsTkfBiu4PWEs=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054504;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=feqDlwU7EGLLtvhfulZ1x0mRALgPHN///oYnW4IFKWA=;
	b=P7jsgqlg6tmxb9gsrZXaupZa0AdgOxCLm/Cmg3KqyoABo6g2PbcZyShtGec57SSr
	ZtO5rJLvQi1ZXd4nesUHE/lhkUzJ6vELNpBoEqd1vLRugqzBZ9wRyyMTsCx4gKdz3Tw
	UfHQ2WTWo5VHV9UySk4SRuZMmnVZcoCl1Bxim+Jo=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 39/44] x86/boot: introduce domid field to struct boot_domain
Date: Fri, 30 Aug 2024 17:47:24 -0400
Message-Id: <20240830214730.1621-40-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Add a domid field to struct boot_domain to hold the assigned domain id for the
domain. During initialization, ensure all instances of struct boot_domain have
the invalid domid to ensure that the domid must be set either by convention or
configuration.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootdomain.h |  2 ++
 xen/arch/x86/setup.c                  | 12 +++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootdomain.h b/xen/arch/x86/include/asm/bootdomain.h
index 4285223ac5ab..d6264d554dba 100644
--- a/xen/arch/x86/include/asm/bootdomain.h
+++ b/xen/arch/x86/include/asm/bootdomain.h
@@ -11,6 +11,8 @@
 struct boot_module;
 
 struct boot_domain {
+    domid_t domid;
+
     struct boot_module *kernel;
     struct boot_module *ramdisk;
 };
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 77abed637ff2..43b588d4d105 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -322,6 +322,9 @@ static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
     boot_mods[info.nr_mods].type = BOOTMOD_XEN;
     boot_mods[info.nr_mods].flags |= BOOTMOD_FLAG_X86_CONSUMED;
 
+    for ( i=0; i < MAX_NR_BOOTDOMS; i++ )
+        boot_doms[i].domid = DOMID_INVALID;
+
     info.domains = boot_doms;
 
     boot_info = &info;
@@ -963,7 +966,6 @@ static struct domain *__init create_dom0(const struct boot_info *bi)
     };
     struct boot_domain *bd = &bi->domains[0];
     struct domain *d;
-    domid_t domid;
 
     if ( opt_dom0_pvh )
     {
@@ -979,15 +981,15 @@ static struct domain *__init create_dom0(const struct boot_info *bi)
         dom0_cfg.flags |= XEN_DOMCTL_CDF_iommu;
 
     /* Create initial domain.  Not d0 for pvshim. */
-    domid = get_initial_domain_id();
-    d = domain_create(domid, &dom0_cfg, pv_shim ? 0 : CDF_privileged);
+    bd->domid = get_initial_domain_id();
+    d = domain_create(bd->domid, &dom0_cfg, pv_shim ? 0 : CDF_privileged);
     if ( IS_ERR(d) )
-        panic("Error creating d%u: %ld\n", domid, PTR_ERR(d));
+        panic("Error creating d%u: %ld\n", bd->domid, PTR_ERR(d));
 
     init_dom0_cpuid_policy(d);
 
     if ( alloc_dom0_vcpu0(d) == NULL )
-        panic("Error creating d%uv0\n", domid);
+        panic("Error creating d%uv0\n", bd->domid);
 
     /* Grab the DOM0 command line. */
     if ( bd->kernel->cmdline || bi->kextra )
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:52:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:52:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786725.1196424 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Y5-0005sr-Ab; Fri, 30 Aug 2024 21:52:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786725.1196424; Fri, 30 Aug 2024 21:52:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9Y5-0005sk-7O; Fri, 30 Aug 2024 21:52:53 +0000
Received: by outflank-mailman (input) for mailman id 786725;
 Fri, 30 Aug 2024 21:52:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Y4-0005aM-45
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:52:52 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 329b11bb-671a-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:52:50 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 17250545032331016.3890116274274;
 Fri, 30 Aug 2024 14:48:23 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 329b11bb-671a-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054505; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=GA7Yp4LFWXcUTCQ+tcxx7puOdH0pa01EM+OSB1scExt/54hyvetQ5OqApsaTg5bhieRGq8CZ0TEH2EqR42b/fkKU4deFvS7a8D7/kKY0YDcnGpp5QWB1fqAwaVrGvyJPwbEbdNOYu0gx1caNmkUjh31mqbfTmMJDnmcTeuYqy5E=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054505; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=Sd7QQyOHQcpE3M4m4u6Ct3Fw13iRggCCs6j9qnmZOMk=; 
	b=f3kuXxbWhnh9K89+FrbWk50c5gQwEw+vXn0kUXi/q5VA2cOUs548oAm7or7+iH6nl+hxLwKQWmVFVWU87+uhxnvKh399OkS/oA7B7aAx0AQsfYZTGGDdXDchqyGILSWZonIb42lnDXEZvGjhpsdRkbmqiwzyw6B1sXkeIEQ4Cc8=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054505;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=Sd7QQyOHQcpE3M4m4u6Ct3Fw13iRggCCs6j9qnmZOMk=;
	b=bbvsH87qot8P5OwLFLsH9YynUee1DpqXrTjvDagCWBZuBKHREwoSy3evHF+Fehwm
	WcdP0l7LFQzr4f1EX1TA4q/YRh8tW0TQkg4voUpF/6vIBTmNrk8NMKENe8A9HXPVPCY
	p7KZgRCe+XHpDWOXzG/OfJhzNA4hWDhLl/vgqFZ8=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 40/44] x86/boot: add cmdline to struct boot_domain
Date: Fri, 30 Aug 2024 17:47:25 -0400
Message-Id: <20240830214730.1621-41-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Add a container for the "cooked" command line for a domain.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootdomain.h |  4 ++++
 xen/arch/x86/setup.c                  | 18 ++++++++----------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootdomain.h b/xen/arch/x86/include/asm/bootdomain.h
index d6264d554dba..00f7d9267965 100644
--- a/xen/arch/x86/include/asm/bootdomain.h
+++ b/xen/arch/x86/include/asm/bootdomain.h
@@ -8,9 +8,13 @@
 #ifndef __XEN_X86_BOOTDOMAIN_H__
 #define __XEN_X86_BOOTDOMAIN_H__
 
+#include <public/xen.h>
+
 struct boot_module;
 
 struct boot_domain {
+    char cmdline[MAX_GUEST_CMDLINE];
+
     domid_t domid;
 
     struct boot_module *kernel;
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 43b588d4d105..2c1aa1475c4e 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -951,8 +951,6 @@ static unsigned int __init copy_bios_e820(struct e820entry *map, unsigned int li
 
 static struct domain *__init create_dom0(const struct boot_info *bi)
 {
-    static char __initdata cmdline[MAX_GUEST_CMDLINE];
-
     struct xen_domctl_createdomain dom0_cfg = {
         .flags = IS_ENABLED(CONFIG_TBOOT) ? XEN_DOMCTL_CDF_s3_integrity : 0,
         .max_evtchn_port = -1,
@@ -995,17 +993,17 @@ static struct domain *__init create_dom0(const struct boot_info *bi)
     if ( bd->kernel->cmdline || bi->kextra )
     {
         if ( bd->kernel->cmdline )
-            safe_strcpy(cmdline, cmdline_cook(
+            safe_strcpy(bd->cmdline, cmdline_cook(
                         __va((unsigned long)bd->kernel->cmdline),
                         bi->boot_loader_name));
 
         if ( bi->kextra )
             /* kextra always includes exactly one leading space. */
-            safe_strcat(cmdline, bi->kextra);
+            safe_strcat(bd->cmdline, bi->kextra);
 
         /* Append any extra parameters. */
-        if ( skip_ioapic_setup && !strstr(cmdline, "noapic") )
-            safe_strcat(cmdline, " noapic");
+        if ( skip_ioapic_setup && !strstr(bd->cmdline, "noapic") )
+            safe_strcat(bd->cmdline, " noapic");
 
         if ( (strlen(acpi_param) == 0) && acpi_disabled )
         {
@@ -1013,10 +1011,10 @@ static struct domain *__init create_dom0(const struct boot_info *bi)
             safe_strcpy(acpi_param, "off");
         }
 
-        if ( (strlen(acpi_param) != 0) && !strstr(cmdline, "acpi=") )
+        if ( (strlen(acpi_param) != 0) && !strstr(bd->cmdline, "acpi=") )
         {
-            safe_strcat(cmdline, " acpi=");
-            safe_strcat(cmdline, acpi_param);
+            safe_strcat(bd->cmdline, " acpi=");
+            safe_strcat(bd->cmdline, acpi_param);
         }
     }
 
@@ -1031,7 +1029,7 @@ static struct domain *__init create_dom0(const struct boot_info *bi)
         write_cr4(read_cr4() & ~X86_CR4_SMAP);
     }
 
-    if ( construct_dom0(d, bd->kernel, bd->ramdisk, cmdline) != 0 )
+    if ( construct_dom0(d, bd->kernel, bd->ramdisk, bd->cmdline) != 0 )
         panic("Could not construct domain 0\n");
 
     if ( cpu_has_smap )
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:52:59 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:52:59 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786726.1196434 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9YB-0006D6-Lq; Fri, 30 Aug 2024 21:52:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786726.1196434; Fri, 30 Aug 2024 21:52:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9YB-0006Ct-IV; Fri, 30 Aug 2024 21:52:59 +0000
Received: by outflank-mailman (input) for mailman id 786726;
 Fri, 30 Aug 2024 21:52: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9YA-0005aM-PN
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:52:58 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 36efc773-671a-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:52:57 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054505001907.1045928467133;
 Fri, 30 Aug 2024 14:48:25 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 36efc773-671a-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054506; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=XomcCrLeVpW08ad/3v70oAvP5emB5KRDdrW2/JPT5js1srnSkvp5X6aWhc50ZSnK+Dgd9WlAs1rfoIQv4ZcARJCh4HbdQA1TXcmUiSifX8m1+A0u40XkCkqtoR2AaDrWX1T5DcxTor1bB+seMX5fZuVqhQEvJXv1/NXM/G5Nr+4=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054506; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=FMMyV/u+IcJlzna8xPedLWbpzcFdbye2wRnqCcAWCr4=; 
	b=dhIu1CJp6gv0Pj5rDEeAgXcnLINWMqbKLQRH/zJRnMBT+AZVgLlseL1+Xt76s8ZLO+4hq9mIzDsFpLD+B8EOD8cBMx9XlECxWJ0mM/C6aG0Oic/a5HxAS0Oj2K2iXzlTqrBlhL8fM6TmAYWjuOZPxnOKnCQCtfyPxot7mwilYJY=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054506;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=FMMyV/u+IcJlzna8xPedLWbpzcFdbye2wRnqCcAWCr4=;
	b=Q9ecpxi+qWrHVcOUKwjYqwtCFh7Q4MQWgNZ2569OoDPGnO24NUa3yN2MWX7hktiJ
	RF1atkVKx107UYLFz36EdEebw7DZdb148q24qP/aamrV1AoNJw9q61mnv56N3FBixyw
	aS8IEBLtWN/3JHJmU8D1NLRTKBbxp4+cZUbLckPQ=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 41/44] x86/boot: add struct domain to struct boot_domain
Date: Fri, 30 Aug 2024 17:47:26 -0400
Message-Id: <20240830214730.1621-42-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Store a reference to the created domain in struct boot_domain.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootdomain.h |  3 +++
 xen/arch/x86/setup.c                  | 15 +++++++--------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootdomain.h b/xen/arch/x86/include/asm/bootdomain.h
index 00f7d9267965..2322c459e36a 100644
--- a/xen/arch/x86/include/asm/bootdomain.h
+++ b/xen/arch/x86/include/asm/bootdomain.h
@@ -10,6 +10,7 @@
 
 #include <public/xen.h>
 
+struct domain;
 struct boot_module;
 
 struct boot_domain {
@@ -19,6 +20,8 @@ struct boot_domain {
 
     struct boot_module *kernel;
     struct boot_module *ramdisk;
+
+    struct domain *d;
 };
 
 #endif
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 2c1aa1475c4e..872d51310628 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -963,7 +963,6 @@ static struct domain *__init create_dom0(const struct boot_info *bi)
         },
     };
     struct boot_domain *bd = &bi->domains[0];
-    struct domain *d;
 
     if ( opt_dom0_pvh )
     {
@@ -980,13 +979,13 @@ static struct domain *__init create_dom0(const struct boot_info *bi)
 
     /* Create initial domain.  Not d0 for pvshim. */
     bd->domid = get_initial_domain_id();
-    d = domain_create(bd->domid, &dom0_cfg, pv_shim ? 0 : CDF_privileged);
-    if ( IS_ERR(d) )
-        panic("Error creating d%u: %ld\n", bd->domid, PTR_ERR(d));
+    bd->d = domain_create(bd->domid, &dom0_cfg, pv_shim ? 0 : CDF_privileged);
+    if ( IS_ERR(bd->d) )
+        panic("Error creating d%u: %ld\n", bd->domid, PTR_ERR(bd->d));
 
-    init_dom0_cpuid_policy(d);
+    init_dom0_cpuid_policy(bd->d);
 
-    if ( alloc_dom0_vcpu0(d) == NULL )
+    if ( alloc_dom0_vcpu0(bd->d) == NULL )
         panic("Error creating d%uv0\n", bd->domid);
 
     /* Grab the DOM0 command line. */
@@ -1029,7 +1028,7 @@ static struct domain *__init create_dom0(const struct boot_info *bi)
         write_cr4(read_cr4() & ~X86_CR4_SMAP);
     }
 
-    if ( construct_dom0(d, bd->kernel, bd->ramdisk, bd->cmdline) != 0 )
+    if ( construct_dom0(bd->d, bd->kernel, bd->ramdisk, bd->cmdline) != 0 )
         panic("Could not construct domain 0\n");
 
     if ( cpu_has_smap )
@@ -1038,7 +1037,7 @@ static struct domain *__init create_dom0(const struct boot_info *bi)
         cr4_pv32_mask |= X86_CR4_SMAP;
     }
 
-    return d;
+    return bd->d;
 }
 
 /* How much of the directmap is prebuilt at compile time. */
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:53:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:53:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786728.1196445 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9YJ-0006hW-V2; Fri, 30 Aug 2024 21:53:07 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786728.1196445; Fri, 30 Aug 2024 21:53:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9YJ-0006hP-PX; Fri, 30 Aug 2024 21:53:07 +0000
Received: by outflank-mailman (input) for mailman id 786728;
 Fri, 30 Aug 2024 21:53: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9YJ-0005aM-6M
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:53:07 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 3bea8550-671a-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:53:06 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054506125987.9398819733996;
 Fri, 30 Aug 2024 14:48:26 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 3bea8550-671a-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054508; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=O8TRKyhf8CV/yw/RfoC5zy4TtPHUtc8LB3MP+K0p/PkWrMwUrePhHVrH/IYTbujWy/+m9lNOYC2n4/z6q7hCrRRhGXwu+BKcqcNBhLaWde10CTgCPniDi3loDLtduY+9kQql5mWtMSJcIxlRLcy+0acfMIlTuUhMcSJ5VXdAxV8=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054508; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=CRDjJu35KX6V+P191+8yBK+MBAuPjEumeiizl3mdu7o=; 
	b=QFYXEIHnY1ez+yY/vX+3OTTkR5DKVe46LUbPe3xcjyUNthHTXSHNz2Ju3vkekhvFklCLoPF5ddBV2qjUNbH5ft3SjBqNGrkHsLgYHPQg4LL+vMkxTP4ZILXAryhlO6sVW3Pq9vEl7WXnO5EGHpf0D/CQTzUYxNAqPUG6hcRxUlg=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054508;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=CRDjJu35KX6V+P191+8yBK+MBAuPjEumeiizl3mdu7o=;
	b=ANHjI/3uMXWw5dgDKD0wrBI5ouad1BHyIwR0ocGzQEwsaFGPxDaGuD2RSj6M/1F7
	g60NIYcLWlnbJTPhI+rQY9lSEiOj5B3oVZLOsdkdCkXdpfwkco3nrhMaEyc68WKQtBg
	6herQMuzvN2pR68iFQTvhNMKqtQQ4w6Wmkzkoop8=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 42/44] x86/boot: convert construct_dom0 to struct boot_domain
Date: Fri, 30 Aug 2024 17:47:27 -0400
Message-Id: <20240830214730.1621-43-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

A struct boot_domain now encapsulates the domain reference, kernel, ramdisk,
and command line for the domain being constructed. As a result of this
encapsulation, construct_dom0 can now take a single struct boot_domain instead
of these four parameters.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/dom0_build.c        | 19 +++++++++----------
 xen/arch/x86/include/asm/setup.h |  4 +---
 xen/arch/x86/setup.c             |  2 +-
 3 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 71b2e3afc1a1..e552f2e9abef 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -597,22 +597,21 @@ int __init dom0_setup_permissions(struct domain *d)
     return rc;
 }
 
-int __init construct_dom0(struct domain *d, const struct boot_module *image,
-                          struct boot_module *initrd, const char *cmdline)
+int __init construct_dom0(struct boot_domain *bd)
 {
     int rc;
 
     /* Sanity! */
-    BUG_ON(!pv_shim && d->domain_id != 0);
-    BUG_ON(d->vcpu[0] == NULL);
-    BUG_ON(d->vcpu[0]->is_initialised);
+    BUG_ON(!pv_shim && bd->d->domain_id != 0);
+    BUG_ON(bd->d->vcpu[0] == NULL);
+    BUG_ON(bd->d->vcpu[0]->is_initialised);
 
     process_pending_softirqs();
 
-    if ( is_hvm_domain(d) )
-        rc = dom0_construct_pvh(d, image, initrd, cmdline);
-    else if ( is_pv_domain(d) )
-        rc = dom0_construct_pv(d, image, initrd, cmdline);
+    if ( is_hvm_domain(bd->d) )
+        rc = dom0_construct_pvh(bd->d, bd->kernel, bd->ramdisk, bd->cmdline);
+    else if ( is_pv_domain(bd->d) )
+        rc = dom0_construct_pv(bd->d, bd->kernel, bd->ramdisk, bd->cmdline);
     else
         panic("Cannot construct Dom0. No guest interface available\n");
 
@@ -620,7 +619,7 @@ int __init construct_dom0(struct domain *d, const struct boot_module *image,
         return rc;
 
     /* Sanity! */
-    BUG_ON(!d->vcpu[0]->is_initialised);
+    BUG_ON(!bd->d->vcpu[0]->is_initialised);
 
     return 0;
 }
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index 19e2ad95b523..8f54b429b954 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -26,9 +26,7 @@ void subarch_init_memory(void);
 
 void init_IRQ(void);
 
-int construct_dom0(
-    struct domain *d, const struct boot_module *image,
-    struct boot_module *initrd, const char *cmdline);
+int construct_dom0(struct boot_domain *d);
 void setup_io_bitmap(struct domain *d);
 
 unsigned long initial_images_nrpages(nodeid_t node);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 872d51310628..5d48ebea51d5 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1028,7 +1028,7 @@ static struct domain *__init create_dom0(const struct boot_info *bi)
         write_cr4(read_cr4() & ~X86_CR4_SMAP);
     }
 
-    if ( construct_dom0(bd->d, bd->kernel, bd->ramdisk, bd->cmdline) != 0 )
+    if ( construct_dom0(bd) != 0 )
         panic("Could not construct domain 0\n");
 
     if ( cpu_has_smap )
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:53:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:53:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786734.1196454 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9YR-0007EF-5H; Fri, 30 Aug 2024 21:53:15 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786734.1196454; Fri, 30 Aug 2024 21:53:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9YR-0007E6-1n; Fri, 30 Aug 2024 21:53:15 +0000
Received: by outflank-mailman (input) for mailman id 786734;
 Fri, 30 Aug 2024 21:53: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9YQ-0005aM-5r
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:53:14 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 402f402e-671a-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:53:13 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054507201417.3403256954641;
 Fri, 30 Aug 2024 14:48:27 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 402f402e-671a-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054509; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=nYIvBOw7bKH/+LTjSG8e20u+CSkjctNMf9HleaCaqR6l2qNThdczixIpcUgA/XfkJ3GuEIAyCqdi/KODOQZ3aIe1jS7/FbKRIADjLdNH49Nwo8ezRIaEWLjsl69pmVsLeMI1tUmLLe6TxVDYuRZip3cihISNHkQa24UAeMX5c70=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054509; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=om7y5y0WMnQkQrCTabtNb0cenhPENJfwq9EcVkz9EkM=; 
	b=koMQ8ITrLNawDlvka1CS5H4GERurOgdHGfKt0qJCmkR2uBoC7e3Z2Nz5T6K3EDgbQN9BgSQHJOhidJGM0+OyNVthBIGnBwywVUwe7dbkY968H0NIUAOMPy2aYxAOm3b4braEt//Ea2R7n/+E9qpfDbQ9Msq01o+xC+XrlkujOvA=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054509;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=om7y5y0WMnQkQrCTabtNb0cenhPENJfwq9EcVkz9EkM=;
	b=rUJdJuo9pANssvynRbE4/1h9ESWuAPhuE46FQPQzjN5tiwXjHgUalWu0LOgaWODW
	uqtZfApEHBqMIl5ceBXVbDGLCiCR5IixqUYLZEwmy3/CEyQ2XOjeMHmmGaYEpJ5DlOO
	qZ178oei70C03G1GS86eIboiIHi/YUAmtWDs5L+s=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 43/44] x86/boot: convert dom0_construct_pv to struct boot_domain
Date: Fri, 30 Aug 2024 17:47:28 -0400
Message-Id: <20240830214730.1621-44-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

With construct_dom0 consuming struct boot_domain, continue passing the
structure down to dom0_construct_pv.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/dom0_build.c             |  2 +-
 xen/arch/x86/include/asm/dom0_build.h |  5 ++--
 xen/arch/x86/pv/dom0_build.c          | 36 +++++++++++++--------------
 3 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index e552f2e9abef..8beb33032940 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -611,7 +611,7 @@ int __init construct_dom0(struct boot_domain *bd)
     if ( is_hvm_domain(bd->d) )
         rc = dom0_construct_pvh(bd->d, bd->kernel, bd->ramdisk, bd->cmdline);
     else if ( is_pv_domain(bd->d) )
-        rc = dom0_construct_pv(bd->d, bd->kernel, bd->ramdisk, bd->cmdline);
+        rc = dom0_construct_pv(bd);
     else
         panic("Cannot construct Dom0. No guest interface available\n");
 
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index 8f7b37f3d308..60e9cb21f14d 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -4,6 +4,7 @@
 #include <xen/libelf.h>
 #include <xen/sched.h>
 
+#include <asm/bootinfo.h>
 #include <asm/setup.h>
 
 extern unsigned int dom0_memflags;
@@ -13,9 +14,7 @@ unsigned long dom0_compute_nr_pages(struct domain *d,
                                     unsigned long initrd_len);
 int dom0_setup_permissions(struct domain *d);
 
-int dom0_construct_pv(
-    struct domain *d, const struct boot_module *image,
-    struct boot_module *initrd, const char *cmdline);
+int dom0_construct_pv(struct boot_domain *bd);
 
 int dom0_construct_pvh(
     struct domain *d, const struct boot_module *image,
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index a403e23b2f93..82dc0c379f27 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -354,10 +354,7 @@ static struct page_info * __init alloc_chunk(struct domain *d,
     return page;
 }
 
-int __init dom0_construct_pv(struct domain *d,
-                             const struct boot_module *image,
-                             struct boot_module *initrd,
-                             const char *cmdline)
+int __init dom0_construct_pv(struct boot_domain *bd)
 {
     int i, rc, order, machine;
     bool compatible, compat;
@@ -372,11 +369,12 @@ int __init dom0_construct_pv(struct domain *d,
     struct page_info *page = NULL;
     unsigned int flush_flags = 0;
     start_info_t *si;
-    struct vcpu *v = d->vcpu[0];
-    void *image_base = bootstrap_map_bm(image);
-    unsigned long image_len = image->size;
-    void *image_start = image_base + image->headroom;
-    unsigned long initrd_len = initrd ? initrd->size : 0;
+    struct domain *d = bd->d;
+    struct vcpu *v = bd->d->vcpu[0];
+    void *image_base = bootstrap_map_bm(bd->kernel);
+    unsigned long image_len = bd->kernel->size;
+    void *image_start = image_base + bd->kernel->headroom;
+    unsigned long initrd_len = bd->ramdisk ? bd->ramdisk->size : 0;
     l4_pgentry_t *l4tab = NULL, *l4start = NULL;
     l3_pgentry_t *l3tab = NULL, *l3start = NULL;
     l2_pgentry_t *l2tab = NULL, *l2start = NULL;
@@ -612,7 +610,7 @@ int __init dom0_construct_pv(struct domain *d,
         initrd_pfn = vinitrd_start ?
                      (vinitrd_start - v_start) >> PAGE_SHIFT :
                      domain_tot_pages(d);
-        initrd_mfn = mfn = initrd->start >> PAGE_SHIFT;
+        initrd_mfn = mfn = bd->ramdisk->start >> PAGE_SHIFT;
         count = PFN_UP(initrd_len);
         if ( d->arch.physaddr_bitsize &&
              ((mfn + count - 1) >> (d->arch.physaddr_bitsize - PAGE_SHIFT)) )
@@ -627,13 +625,13 @@ int __init dom0_construct_pv(struct domain *d,
                     free_domheap_pages(page, order);
                     page += 1UL << order;
                 }
-            memcpy(page_to_virt(page), maddr_to_virt(initrd->start),
+            memcpy(page_to_virt(page), maddr_to_virt(bd->ramdisk->start),
                    initrd_len);
-            mpt_alloc = initrd->start;
+            mpt_alloc = bd->ramdisk->start;
             init_domheap_pages(mpt_alloc,
                                mpt_alloc + PAGE_ALIGN(initrd_len));
             initrd_mfn = mfn_x(page_to_mfn(page));
-            initrd->start = initrd_mfn << PAGE_SHIFT;
+            bd->ramdisk->start = initrd_mfn << PAGE_SHIFT;
         }
         else
         {
@@ -641,7 +639,7 @@ int __init dom0_construct_pv(struct domain *d,
                 if ( assign_pages(mfn_to_page(_mfn(mfn++)), 1, d, 0) )
                     BUG();
         }
-        initrd->size = 0;
+        bd->ramdisk->size = 0;
 
         iommu_memory_setup(d, "initrd", mfn_to_page(_mfn(initrd_mfn)),
                            PFN_UP(initrd_len), &flush_flags);
@@ -653,9 +651,9 @@ int __init dom0_construct_pv(struct domain *d,
     if ( domain_tot_pages(d) < nr_pages )
         printk(" (%lu pages to be allocated)",
                nr_pages - domain_tot_pages(d));
-    if ( initrd )
+    if ( bd->ramdisk )
     {
-        mpt_alloc = initrd->start;
+        mpt_alloc = bd->ramdisk->start;
         printk("\n Init. ramdisk: %"PRIpaddr"->%"PRIpaddr,
                mpt_alloc, mpt_alloc + initrd_len);
     }
@@ -883,7 +881,7 @@ int __init dom0_construct_pv(struct domain *d,
         if ( pfn >= initrd_pfn )
         {
             if ( pfn < initrd_pfn + PFN_UP(initrd_len) )
-                mfn = (initrd->start >> PAGE_SHIFT) + (pfn - initrd_pfn);
+                mfn = (bd->ramdisk->start >> PAGE_SHIFT) + (pfn - initrd_pfn);
             else
                 mfn -= PFN_UP(initrd_len);
         }
@@ -953,8 +951,8 @@ int __init dom0_construct_pv(struct domain *d,
     }
 
     memset(si->cmd_line, 0, sizeof(si->cmd_line));
-    if ( cmdline != NULL )
-        strlcpy((char *)si->cmd_line, cmdline, sizeof(si->cmd_line));
+    if ( bd->cmdline[0] != '\0' )
+        strlcpy((char *)si->cmd_line, bd->cmdline, sizeof(si->cmd_line));
 
 #ifdef CONFIG_VIDEO
     if ( !pv_shim && fill_console_start_info((void *)(si + 1)) )
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:53:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:53:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786736.1196463 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9YY-0007gy-DA; Fri, 30 Aug 2024 21:53:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786736.1196463; Fri, 30 Aug 2024 21:53:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9YY-0007gn-AL; Fri, 30 Aug 2024 21:53:22 +0000
Received: by outflank-mailman (input) for mailman id 786736;
 Fri, 30 Aug 2024 21:53: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9YW-0005aM-N4
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:53:20 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id 43f67f7e-671a-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:53:19 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054508269777.6559146284596;
 Fri, 30 Aug 2024 14:48:28 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 43f67f7e-671a-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054510; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=F8GDSqvtfe8sJGYcYxWphnjze9dEx9bE/zadr8JX5NVSXkAQhinY0XWCWka4Ek15zQDVUuMX6EUN9/HQqtDyfomKjBeGlFQJt4oE+IYPNqDfaT+5ObFh7MRoDtvjARGEA46ihAa31MELBPSzOl3c9TD+/pIzFaD/0tCU1RInw94=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054510; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=KS82AUYRZGk7W9Pk3CIfd4vp+4qfK/g7l4LYGblZ46w=; 
	b=N0RFq2bGoZ/6Tp7lh2CY6T6WanyroSB87ZR1BvHqh5PcluVV5ZgIiGvWp9jfmAWa35mNXyVLiCLfvk8j4pjZB04YmopVUB1xheHGlcT3YSYmQCzMrvrroytJUd34EEuGbMCHpQapW1ufx22t58AiWWNLg59lHeVj+Y1QBvUm1Mk=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054510;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=KS82AUYRZGk7W9Pk3CIfd4vp+4qfK/g7l4LYGblZ46w=;
	b=ei25+HbYtoU4V9y9fHjO2Jal2Ep9aNv4ViQcn5+wcA9OrxyDi/LplUmi16AjAN+E
	TNV6bNnFASva7Ak/4eC6BxaCLNRYT8H9wRekpIn2VSSkAwknPVfgtbR1NjY77Ds9dU7
	ImpxIBcpsghkPP7WYjwIfj4VTfx9HbbAXiD4sF/Y=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 44/44] x86/boot: convert dom0_construct_pvh to struct boot_domain
Date: Fri, 30 Aug 2024 17:47:29 -0400
Message-Id: <20240830214730.1621-45-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

With construct_dom0 consuming struct boot_domain, continue passing the
structure down to dom0_construct_pvh.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/dom0_build.c             |  2 +-
 xen/arch/x86/hvm/dom0_build.c         | 31 +++++++++++++--------------
 xen/arch/x86/include/asm/dom0_build.h |  4 +---
 3 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 8beb33032940..6a21fd46d5a3 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -609,7 +609,7 @@ int __init construct_dom0(struct boot_domain *bd)
     process_pending_softirqs();
 
     if ( is_hvm_domain(bd->d) )
-        rc = dom0_construct_pvh(bd->d, bd->kernel, bd->ramdisk, bd->cmdline);
+        rc = dom0_construct_pvh(bd);
     else if ( is_pv_domain(bd->d) )
         rc = dom0_construct_pv(bd);
     else
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index b359f3d98376..13e17550efa5 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1284,25 +1284,23 @@ static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
     }
 }
 
-int __init dom0_construct_pvh(
-    struct domain *d, const struct boot_module *image,
-    struct boot_module *initrd, const char *cmdline)
+int __init dom0_construct_pvh(const struct boot_domain *bd)
 {
     paddr_t entry, start_info;
     int rc;
 
-    printk(XENLOG_INFO "*** Building a PVH Dom%d ***\n", d->domain_id);
+    printk(XENLOG_INFO "*** Building a PVH Dom%d ***\n", bd->domid);
 
-    if ( is_hardware_domain(d) )
+    if ( is_hardware_domain(bd->d) )
     {
         /*
          * Setup permissions early so that calls to add MMIO regions to the
          * p2m as part of vPCI setup don't fail due to permission checks.
          */
-        rc = dom0_setup_permissions(d);
+        rc = dom0_setup_permissions(bd->d);
         if ( rc )
         {
-            printk("%pd unable to setup permissions: %d\n", d, rc);
+            printk("%pd unable to setup permissions: %d\n", bd->d, rc);
             return rc;
         }
     }
@@ -1312,25 +1310,26 @@ int __init dom0_construct_pvh(
      * initialization so the iommu code can fetch the MMCFG regions used by the
      * domain.
      */
-    pvh_setup_mmcfg(d);
+    pvh_setup_mmcfg(bd->d);
 
     /*
      * Craft dom0 physical memory map and set the paging allocation. This must
      * be done before the iommu initializion, since iommu initialization code
      * will likely add mappings required by devices to the p2m (ie: RMRRs).
      */
-    pvh_init_p2m(d);
+    pvh_init_p2m(bd->d);
 
-    iommu_hwdom_init(d);
+    iommu_hwdom_init(bd->d);
 
-    rc = pvh_populate_p2m(d);
+    rc = pvh_populate_p2m(bd->d);
     if ( rc )
     {
         printk("Failed to setup Dom0 physical memory map\n");
         return rc;
     }
 
-    rc = pvh_load_kernel(d, image, initrd, bootstrap_map_bm(image), cmdline,
+    rc = pvh_load_kernel(bd->d, bd->kernel, bd->ramdisk,
+                         bootstrap_map_bm(bd->kernel), bd->cmdline,
                          &entry, &start_info);
     if ( rc )
     {
@@ -1338,14 +1337,14 @@ int __init dom0_construct_pvh(
         return rc;
     }
 
-    rc = pvh_setup_cpus(d, entry, start_info);
+    rc = pvh_setup_cpus(bd->d, entry, start_info);
     if ( rc )
     {
         printk("Failed to setup Dom0 CPUs: %d\n", rc);
         return rc;
     }
 
-    rc = pvh_setup_acpi(d, start_info);
+    rc = pvh_setup_acpi(bd->d, start_info);
     if ( rc )
     {
         printk("Failed to setup Dom0 ACPI tables: %d\n", rc);
@@ -1354,8 +1353,8 @@ int __init dom0_construct_pvh(
 
     if ( opt_dom0_verbose )
     {
-        printk("Dom%u memory map:\n", d->domain_id);
-        print_e820_memory_map(d->arch.e820, d->arch.nr_e820);
+        printk("Dom%u memory map:\n", bd->domid);
+        print_e820_memory_map(bd->d->arch.e820, bd->d->arch.nr_e820);
     }
 
     return 0;
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index 60e9cb21f14d..adbe90bfd034 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -16,9 +16,7 @@ int dom0_setup_permissions(struct domain *d);
 
 int dom0_construct_pv(struct boot_domain *bd);
 
-int dom0_construct_pvh(
-    struct domain *d, const struct boot_module *image,
-    struct boot_module *initrd, const char *cmdline);
+int dom0_construct_pvh(const struct boot_domain *bd);
 
 unsigned long dom0_paging_pages(const struct domain *d,
                                 unsigned long nr_pages);
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786747.1196475 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bJ-0000hs-3d; Fri, 30 Aug 2024 21:56:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786747.1196475; Fri, 30 Aug 2024 21:56:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bI-0000hE-Uj; Fri, 30 Aug 2024 21:56:12 +0000
Received: by outflank-mailman (input) for mailman id 786747;
 Fri, 30 Aug 2024 21:56: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Xm-0000Zf-Fv
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:52:34 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 2836cd3a-671a-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:52:32 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054501101460.90423645474493;
 Fri, 30 Aug 2024 14:48:21 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 2836cd3a-671a-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054503; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=lMGZs8SIDtJtI131S+0ymMPmMbm9ZrRmIfMPtzovliVyRoavvu25Qd+y+OFcQ0d2D3/m4cBHKYWobvDQ1UUqSWgDS5S/va6mEdgjq4urQuiSO3BAdXLkyHaWQy26CDvUIfcVS4+wrJ7uxFGH5NQ3VOpLQC9wJA9M+IBJUvXUygQ=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054503; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=R/MzkWoN4ISAq+3iGJhqemI2sorOj7/J8EPT75xG/08=; 
	b=JNgYY8qoj7tkrn2MgvM4Qp2r8jm/4q+yUnjOdVb6gTLYpEZ9b9nRs5455sStAqo4AkvwBvxw1yy0yyyR2yzsF6BK5ByL3CSR3lxppX29hzZIIft0JT9jqCdrVn0dcemP1u0Z7VR5+g8kUoHk9B3L7HUuAa9TgzYkJ6t4hcZYmqU=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054503;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=R/MzkWoN4ISAq+3iGJhqemI2sorOj7/J8EPT75xG/08=;
	b=TwTSDY3tQjVwTmmgBSrXGW7hpH82mM7D7QOwNJU3BO2zmz87+6jWWN/bDP0NiZxQ
	+MCTnu4tbq8KehJzvjegdmtakDUDr/oxw3ux6ugKVTegxKeaRbrdQOfLTCFtD0kGvvM
	88mHGE1ZkNxFWHxDAiEvBxDOMb3kHgICmFO1QRic=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 38/44] x86/boot: introduce boot domain
Date: Fri, 30 Aug 2024 17:47:23 -0400
Message-Id: <20240830214730.1621-39-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

To begin moving toward allowing the hypervisor to construct more than one
domain at boot, a container is needed for a domain's build information.

Introduce a new header, <xen/asm/bootdomain.h>, that contains the initial
struct boot_domain that encapsulate the build information for a domain.

No functional change intended.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootdomain.h | 28 +++++++++++++++++++++++++++
 xen/arch/x86/include/asm/bootinfo.h   |  7 +++++++
 xen/arch/x86/setup.c                  | 27 +++++++++++---------------
 3 files changed, 46 insertions(+), 16 deletions(-)
 create mode 100644 xen/arch/x86/include/asm/bootdomain.h

diff --git a/xen/arch/x86/include/asm/bootdomain.h b/xen/arch/x86/include/asm/bootdomain.h
new file mode 100644
index 000000000000..4285223ac5ab
--- /dev/null
+++ b/xen/arch/x86/include/asm/bootdomain.h
@@ -0,0 +1,28 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (c) 2024 Apertus Solutions, LLC
+ * Author: Daniel P. Smith <dpsmith@apertussolutions.com>
+ * Copyright (c) 2024 Christopher Clark <christopher.w.clark@gmail.com>
+ */
+
+#ifndef __XEN_X86_BOOTDOMAIN_H__
+#define __XEN_X86_BOOTDOMAIN_H__
+
+struct boot_module;
+
+struct boot_domain {
+    struct boot_module *kernel;
+    struct boot_module *ramdisk;
+};
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index 59755ef42e53..b135aaebd25e 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -10,6 +10,11 @@
 
 #include <xen/types.h>
 
+#include <asm/bootdomain.h>
+
+/* Max number of boot domains that Xen can construct */
+#define MAX_NR_BOOTDOMS 1
+
 /* Boot module binary type / purpose */
 enum bootmod_type {
     BOOTMOD_UNKNOWN,
@@ -45,6 +50,8 @@ struct boot_info {
 
     paddr_t mmap_addr;
     uint32_t mmap_length;
+
+    struct boot_domain *domains;
 };
 
 static inline int __init next_boot_module_index(
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index a6fbaecee9ed..77abed637ff2 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -287,6 +287,7 @@ static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
 {
     static struct boot_info __initdata info;
     static struct boot_module __initdata boot_mods[MAX_NR_BOOTMODS + 1];
+    static struct boot_domain __initdata boot_doms[MAX_NR_BOOTDOMS];
     unsigned int i;
 
     info.nr_mods = mbi->mods_count;
@@ -321,6 +322,8 @@ static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
     boot_mods[info.nr_mods].type = BOOTMOD_XEN;
     boot_mods[info.nr_mods].flags |= BOOTMOD_FLAG_X86_CONSUMED;
 
+    info.domains = boot_doms;
+
     boot_info = &info;
 }
 
@@ -958,20 +961,10 @@ static struct domain *__init create_dom0(const struct boot_info *bi)
             .misc_flags = opt_dom0_msr_relaxed ? XEN_X86_MSR_RELAXED : 0,
         },
     };
-    int mod_idx = first_boot_module_index(bi, BOOTMOD_RAMDISK);
-    struct boot_module *image, *initrd;
+    struct boot_domain *bd = &bi->domains[0];
     struct domain *d;
     domid_t domid;
 
-    /* Map boot_module to mb1 module for dom0 */
-    image = &bi->mods[0];
-
-    /* Map boot_module to mb1 module for initrd */
-    if ( mod_idx < 0 )
-        initrd = NULL;
-    else
-        initrd = &bi->mods[mod_idx];
-
     if ( opt_dom0_pvh )
     {
         dom0_cfg.flags |= (XEN_DOMCTL_CDF_hvm |
@@ -997,11 +990,11 @@ static struct domain *__init create_dom0(const struct boot_info *bi)
         panic("Error creating d%uv0\n", domid);
 
     /* Grab the DOM0 command line. */
-    if ( image->cmdline || bi->kextra )
+    if ( bd->kernel->cmdline || bi->kextra )
     {
-        if ( image->cmdline )
-            safe_strcpy(cmdline,
-                        cmdline_cook(__va((unsigned long)image->cmdline),
+        if ( bd->kernel->cmdline )
+            safe_strcpy(cmdline, cmdline_cook(
+                        __va((unsigned long)bd->kernel->cmdline),
                         bi->boot_loader_name));
 
         if ( bi->kextra )
@@ -1036,7 +1029,7 @@ static struct domain *__init create_dom0(const struct boot_info *bi)
         write_cr4(read_cr4() & ~X86_CR4_SMAP);
     }
 
-    if ( construct_dom0(d, image, initrd, cmdline) != 0 )
+    if ( construct_dom0(d, bd->kernel, bd->ramdisk, cmdline) != 0 )
         panic("Could not construct domain 0\n");
 
     if ( cpu_has_smap )
@@ -1221,6 +1214,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     /* Dom0 kernel is always first */
     boot_info->mods[0].type = BOOTMOD_KERNEL;
     boot_info->mods[0].flags |= BOOTMOD_FLAG_X86_CONSUMED;
+    boot_info->domains[0].kernel = &boot_info->mods[0];
 
     if ( pvh_boot )
     {
@@ -2112,6 +2106,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     {
         boot_info->mods[initrdidx].type = BOOTMOD_RAMDISK;
         boot_info->mods[initrdidx].flags |= BOOTMOD_FLAG_X86_CONSUMED;
+        boot_info->domains[0].ramdisk = &boot_info->mods[initrdidx];
         if ( first_boot_module_index(boot_info, BOOTMOD_UNKNOWN) >= 0 )
             printk(XENLOG_WARNING
                    "Multiple initrd candidates, picking module #%u\n",
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:14 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:14 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786749.1196494 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bK-0001Nh-Ie; Fri, 30 Aug 2024 21:56:14 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786749.1196494; Fri, 30 Aug 2024 21:56:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bK-0001Mg-Ey; Fri, 30 Aug 2024 21:56:14 +0000
Received: by outflank-mailman (input) for mailman id 786749;
 Fri, 30 Aug 2024 21:56:12 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Ux-00065G-IL
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:49:39 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c03a5813-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:49:38 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 172505447615751.84400849252813;
 Fri, 30 Aug 2024 14:47:56 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c03a5813-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054478; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=RIu98M/WjNAwh4rLsJQmTFkd35kOFhff7JsaX/iK85SOqYY06ORXt/xFUWNEvlfh6B33v14uU7wQz6RwFPxR+TsHQfMFpJzQERPfT+dHhWetGnaeZBYtDa4GupoykX4+Z/XHdvHyIE2bhywkPHXlc/eUGyXH7KxA8h5CnwqrVsM=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054478; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=GvFaYALw+a+2+o8Vrk1YWy2xkmV+m8u1BbaORy59Yw0=; 
	b=J5g2d2wowLdc3DYvH5cYpHNrxOw4dfexDFJ4GFVcWQZtEIdFwfxKhnrUKUeVvwP44Z7wcgwkdz8JCg31zLLK9Iya309wWL+KiLhsgBsmfxzt2xmkTwo+FKdHFQdcREsn/2tkBUFU9szTVCyK1dM9FX9F3RJPpx5N7VHDrIaSuCM=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054478;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=GvFaYALw+a+2+o8Vrk1YWy2xkmV+m8u1BbaORy59Yw0=;
	b=lVdd8f1HD9/Y6RqiitV5mlXw/b1xDdSLSvKtBcHfn9Mb3XIf3q1E6nW3TZ7OYd8G
	VEchoyyGW9DgTYbXTT9g4gLSzIvt+Xw3ojzCKmH635rsyuJCPj796vDkYYUxRCKVr3B
	xKcMW/AU/AYNtK5HB6JTcisTFAfDuYjONcwbzWhQ=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 15/44] x86/boot: introduce boot module interator
Date: Fri, 30 Aug 2024 17:47:00 -0400
Message-Id: <20240830214730.1621-16-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Provide an iterator to go through boot module array searching based on type.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootinfo.h | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index 37132afb4e6a..99f8c9b83b25 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -42,8 +42,24 @@ struct boot_info {
     uint32_t mmap_length;
 };
 
-#endif
+static inline int __init next_boot_module_index(
+    const struct boot_info *bi, enum bootmod_type t, int offset)
+{
+    int i;
+
+    for ( i = offset; i < bi->nr_mods; i++ )
+    {
+        if ( bi->mods[i].type == t )
+            return i;
+    }
+
+    return -1;
+}
 
+#define first_boot_module_index(bi, t)              \
+    next_boot_module_index(bi, t, 0)
+
+#endif
 /*
  * Local variables:
  * mode: C
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:15 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:15 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786748.1196479 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bJ-0000n1-Az; Fri, 30 Aug 2024 21:56:13 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786748.1196479; Fri, 30 Aug 2024 21:56:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bJ-0000ke-5g; Fri, 30 Aug 2024 21:56:13 +0000
Received: by outflank-mailman (input) for mailman id 786748;
 Fri, 30 Aug 2024 21:56: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9We-0000Zf-T1
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:51:24 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fe975f19-6719-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:51:23 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054491309423.19157704731253;
 Fri, 30 Aug 2024 14:48:11 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fe975f19-6719-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054493; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=Em5k1TM7/Bv3Y5RLflF8f0Tgx8xEUzNyQoJtPqZK8r8Xuh9OX4NnuyiVSzUd+2ZyqZuxSiLiC2iNI/mEV8ihfRua029wqL5VrzUrsd8vVSjRIuE3t0tLtqUBV+vKONvQzL6SWHyW1F+Zd6ypTvEI+RhgvPS5WBoek7faJphj+QI=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054493; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=MquSQeaVrCWxsat0mhr5L62hgcjXnVV+6k/kWhQHcXY=; 
	b=ReWpnUmzkfOtjl723Hc4Ke1Xm9ED7AJw3Q1GvRaCZBGRsIdZ1JSEkvHT5NbNI+y9aWKgaMSyTy2ABECAk003a6HLTjmMv6686E9wEnNnXm0YylMsO0IVH+bDo52/+SzabFbv3Ubvaph66VrGVvIdpY11LE3Y6ypyF/B7miH8QMk=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054493;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=MquSQeaVrCWxsat0mhr5L62hgcjXnVV+6k/kWhQHcXY=;
	b=DtYQqFa9eEHPKSuvN8LbUWAdOUrEtAFwYQFxiTFu6R1hfxHjNiwlHKyXjSJNKxPR
	T3P3KvazzeiZ3dFpJQIdlTqtM4cUXoKno8uYlx0aBFUPn3EHHFMvRckonP7+hK/eeC1
	WkjwWUteZiAWE9wteux2wb/T4aCeJr8Qjoo9QVGs=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 29/44] x86/boot: convert dom0_construct_pv image param to struct boot_module
Date: Fri, 30 Aug 2024 17:47:14 -0400
Message-Id: <20240830214730.1621-30-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

This changes the type for the image parameter of dom0_construct_pv to be struct
boot_module. Removing the usage of early_mod field for kernel module.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/dom0_build.c             | 2 +-
 xen/arch/x86/include/asm/dom0_build.h | 7 +++----
 xen/arch/x86/pv/dom0_build.c          | 9 ++++-----
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index fb1b7e5d11cf..42043230faff 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -612,7 +612,7 @@ int __init construct_dom0(struct domain *d, const struct boot_module *image,
     if ( is_hvm_domain(d) )
         rc = dom0_construct_pvh(d, image->early_mod, image->headroom, initrd->early_mod, cmdline);
     else if ( is_pv_domain(d) )
-        rc = dom0_construct_pv(d, image->early_mod, image->headroom, initrd->early_mod, cmdline);
+        rc = dom0_construct_pv(d, image, initrd->early_mod, cmdline);
     else
         panic("Cannot construct Dom0. No guest interface available\n");
 
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index 107c1ff98367..a1f36f7d360d 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -13,10 +13,9 @@ unsigned long dom0_compute_nr_pages(struct domain *d,
                                     unsigned long initrd_len);
 int dom0_setup_permissions(struct domain *d);
 
-int dom0_construct_pv(struct domain *d, const module_t *image,
-                      unsigned long image_headroom,
-                      module_t *initrd,
-                      const char *cmdline);
+int dom0_construct_pv(
+    struct domain *d, const struct boot_module *image,
+    module_t *initrd, const char *cmdline);
 
 int dom0_construct_pvh(struct domain *d, const module_t *image,
                        unsigned long image_headroom,
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index 57e58a02e707..db908ddb78b5 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -355,8 +355,7 @@ static struct page_info * __init alloc_chunk(struct domain *d,
 }
 
 int __init dom0_construct_pv(struct domain *d,
-                             const module_t *image,
-                             unsigned long image_headroom,
+                             const struct boot_module *image,
                              module_t *initrd,
                              const char *cmdline)
 {
@@ -374,9 +373,9 @@ int __init dom0_construct_pv(struct domain *d,
     unsigned int flush_flags = 0;
     start_info_t *si;
     struct vcpu *v = d->vcpu[0];
-    void *image_base = bootstrap_map(image);
-    unsigned long image_len = image->mod_end;
-    void *image_start = image_base + image_headroom;
+    void *image_base = bootstrap_map_bm(image);
+    unsigned long image_len = image->size;
+    void *image_start = image_base + image->headroom;
     unsigned long initrd_len = initrd ? initrd->mod_end : 0;
     l4_pgentry_t *l4tab = NULL, *l4start = NULL;
     l3_pgentry_t *l3tab = NULL, *l3start = NULL;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786756.1196505 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bR-0002cj-TR; Fri, 30 Aug 2024 21:56:21 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786756.1196505; Fri, 30 Aug 2024 21:56:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bR-0002cX-NJ; Fri, 30 Aug 2024 21:56:21 +0000
Received: by outflank-mailman (input) for mailman id 786756;
 Fri, 30 Aug 2024 21:56:19 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9X0-0000Zf-W1
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:51:46 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0bea60a2-671a-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:51:45 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 172505449453355.86826546005;
 Fri, 30 Aug 2024 14:48:14 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0bea60a2-671a-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054496; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=kRWghNc2F5sPVQ5+qzb7H8DQVUJNT8NJBljwX7Z9CzrlbUmFyh2Ft/QvGKXqbknxOISJ8sZJg1gJnjO7Qwnh+h1K7VA7T+/3Bp5WCjsDUatXkZsTzgpIP1GatTBH6+wP2NniEcRcOnD0Tis0INikyeG49vQL+IW04EzQjLfTRMc=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054496; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=e/jZPWMKnu3Xz391hq0lPvFpid72gh7AyHIhBUi4faY=; 
	b=OZyFK80p65oqo4Ii7KoSnlpeiyCNDLvCwT9u9C/+ylHjTtpK/oQicRPRJArPOhPIQ+BhXPQ39sw0WlV9JESlqB3k9r6odG+PSk8x84pwgxZH/EvHQ36go5l6JaLyOYkzF3O/bgTKmn5MkBTNcmv5ccRmvB+T4PNNQKqR1sIXN/A=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054496;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=e/jZPWMKnu3Xz391hq0lPvFpid72gh7AyHIhBUi4faY=;
	b=AKjnzuNyRb3yNdo7f2glmUqBQS3oQghijs1A4zbpenqkwz9M8x5GmABZOqvwt5mT
	Oo7af5neTsiQ3hK9+4kkmVcM1TYto19tNM5ixt2u5rsLgYnfbItVuC8oC+GkKyiW7h2
	8FzcAuPbbFcsYr3wD8r/N8YeGYJDM+Ikid6RsYLc=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 32/44] x86/boot: convert pvh_load_kernel to struct boot_module
Date: Fri, 30 Aug 2024 17:47:17 -0400
Message-Id: <20240830214730.1621-33-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

This changes both the kernel and ramdisk parameters over to struct boot_module.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/hvm/dom0_build.c | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 1579034ebfc0..b359f3d98376 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -642,15 +642,14 @@ static bool __init check_and_adjust_load_address(
     return true;
 }
 
-static int __init pvh_load_kernel(struct domain *d, const module_t *image,
-                                  unsigned long image_headroom,
-                                  module_t *initrd, void *image_base,
-                                  const char *cmdline, paddr_t *entry,
-                                  paddr_t *start_info_addr)
+static int __init pvh_load_kernel(
+    struct domain *d, const struct boot_module *image,
+    struct boot_module *initrd, void *image_base,
+    const char *cmdline, paddr_t *entry, paddr_t *start_info_addr)
 {
-    void *image_start = image_base + image_headroom;
-    unsigned long image_len = image->mod_end;
-    unsigned long initrd_len = initrd ? initrd->mod_end : 0;
+    void *image_start = image_base + image->headroom;
+    unsigned long image_len = image->size;
+    unsigned long initrd_len = initrd ? initrd->size : 0;
     struct elf_binary elf;
     struct elf_dom_parms parms;
     paddr_t last_addr;
@@ -725,7 +724,7 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
 
     if ( initrd != NULL )
     {
-        rc = hvm_copy_to_guest_phys(last_addr, mfn_to_virt(initrd->mod_start),
+        rc = hvm_copy_to_guest_phys(last_addr, maddr_to_virt(initrd->start),
                                     initrd_len, v);
         if ( rc )
         {
@@ -736,9 +735,9 @@ static int __init pvh_load_kernel(struct domain *d, const module_t *image,
         mod.paddr = last_addr;
         mod.size = initrd_len;
         last_addr += ROUNDUP(initrd_len, elf_64bit(&elf) ? 8 : 4);
-        if ( initrd->string )
+        if ( initrd->cmdline )
         {
-            char *str = __va(initrd->string);
+            char *str = __va((unsigned long)initrd->cmdline);
             size_t len = strlen(str) + 1;
 
             rc = hvm_copy_to_guest_phys(last_addr, str, len, v);
@@ -1331,8 +1330,8 @@ int __init dom0_construct_pvh(
         return rc;
     }
 
-    rc = pvh_load_kernel(d, image->early_mod, image->headroom, initrd->early_mod,
-                         bootstrap_map_bm(image), cmdline, &entry, &start_info);
+    rc = pvh_load_kernel(d, image, initrd, bootstrap_map_bm(image), cmdline,
+                         &entry, &start_info);
     if ( rc )
     {
         printk("Failed to load Dom0 kernel\n");
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786758.1196509 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bS-0002iF-B2; Fri, 30 Aug 2024 21:56:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786758.1196509; Fri, 30 Aug 2024 21:56:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bS-0002gq-2C; Fri, 30 Aug 2024 21:56:22 +0000
Received: by outflank-mailman (input) for mailman id 786758;
 Fri, 30 Aug 2024 21:56:21 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9WQ-0000Zf-1T
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:51:10 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id f5ba0d87-6719-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:51:08 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054489185157.27284103749457;
 Fri, 30 Aug 2024 14:48:09 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f5ba0d87-6719-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054491; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=EuGnOBmt9m/VVYVXJTTFa3ILqf+v+luBtSr/jYRWgoh8BFZkKOBZ0ap57WAC/aNKuOurd30kGqdZ9EuYnseqMH7rKzOzhUeL4idjUxaTYSk3eafIe80ACX1b8QZBIWyjzu28oVLNviDbftLcjVUe1btwkij8OWUhxRFiwYzOAuw=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054491; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=1CoQkH+lHv+L/z16JNTEDasfAHp/vM4gE3D+btk1VDg=; 
	b=ApXX6ZRn8dM9UjlWhKXCgfsNkuikD8zlP76mpYsNvozKvLthiyTMcfz0mNwV/BIhlh0rdCe2rk4WflwHK2xFQYw2gnuEPP2ELZpjxvNEJ4yi9hIvsp5hq1Vy+CWNO5eptrw6z7V+WBuvLFczIUUNUyel6zROCk2eM6ujy3xnBHA=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054491;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=1CoQkH+lHv+L/z16JNTEDasfAHp/vM4gE3D+btk1VDg=;
	b=Qe5pJZwkJOmCZy2ZS+NXw1udAcRDK9I0V59Rpd1tHSvGIgVlTExzNueQMF45/t47
	qzV9GFdiVg4+b0tzqP1/yRCL/qtu+x4fr+R4zKASf03pC0KKyk1rWEPwa88KBQyN3Q8
	vcDIrEN7oM075KBPt9/0a6/G71m6l3ThlhMTeC/0=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 27/44] x86/boot: relocate kextra into boot info
Date: Fri, 30 Aug 2024 17:47:12 -0400
Message-Id: <20240830214730.1621-28-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Move kextra into struct boot_info, thus no longer needed to be passed as a
parameter to create_dom0.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootinfo.h |  2 ++
 xen/arch/x86/setup.c                | 12 ++++++------
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index 1a325f66b3ba..06b3ecaf7bec 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -41,6 +41,8 @@ struct boot_info {
     const char *boot_loader_name;
     const char *cmdline;
 
+    const char *kextra;
+
     paddr_t mmap_addr;
     uint32_t mmap_length;
 };
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index f58eb21d00d7..76f25e9d620c 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -946,8 +946,7 @@ static unsigned int __init copy_bios_e820(struct e820entry *map, unsigned int li
     return n;
 }
 
-static struct domain *__init create_dom0(const struct boot_info *bi,
-                                         const char *kextra)
+static struct domain *__init create_dom0(const struct boot_info *bi)
 {
     static char __initdata cmdline[MAX_GUEST_CMDLINE];
 
@@ -1001,15 +1000,15 @@ static struct domain *__init create_dom0(const struct boot_info *bi,
         panic("Error creating d%uv0\n", domid);
 
     /* Grab the DOM0 command line. */
-    if ( image->early_mod->string || kextra )
+    if ( image->early_mod->string || bi->kextra )
     {
         if ( image->early_mod->string )
             safe_strcpy(cmdline, cmdline_cook(__va(image->early_mod->string),
                         bi->boot_loader_name));
 
-        if ( kextra )
+        if ( bi->kextra )
             /* kextra always includes exactly one leading space. */
-            safe_strcat(cmdline, kextra);
+            safe_strcat(cmdline, bi->kextra);
 
         /* Append any extra parameters. */
         if ( skip_ioapic_setup && !strstr(cmdline, "noapic") )
@@ -1119,6 +1118,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
         *kextra = '\0';
         kextra += 3;
         while ( kextra[1] == ' ' ) kextra++;
+        boot_info->kextra = kextra;
     }
     cmdline_parse(boot_info->cmdline);
 
@@ -2131,7 +2131,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
      * We're going to setup domain0 using the module(s) that we stashed safely
      * above our heap. The second module, if present, is an initrd ramdisk.
      */
-    dom0 = create_dom0(boot_info, kextra);
+    dom0 = create_dom0(boot_info);
     if ( !dom0 )
         panic("Could not set up DOM0 guest OS\n");
 
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:22 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:22 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786759.1196515 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bS-0002nK-M0; Fri, 30 Aug 2024 21:56:22 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786759.1196515; Fri, 30 Aug 2024 21:56:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bS-0002kK-CL; Fri, 30 Aug 2024 21:56:22 +0000
Received: by outflank-mailman (input) for mailman id 786759;
 Fri, 30 Aug 2024 21:56:21 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9UM-00065G-PO
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:49:02 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id aa3bf009-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:49:01 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 172505447081714.54061475318008;
 Fri, 30 Aug 2024 14:47:50 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: aa3bf009-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054472; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=W+sWhKs2BNLPpb3UGBqNNQ3s/h+I85dvSqj/MVRDT2a5B2IcR6G/dUXEvuH598i1uSjBYpDqoak4a8XnMdVnH33X01k6etUA+eOsvpi92Ye9NyD/uhOrS78rt52nzgJ1guNzH3SDCBUW/KXVVvP4WKpPKt11maAxQQEePsZTXqQ=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054472; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=Q0pSe2RfpDMnhePm+Qzlz8IPsCD571W7svuapogeYRE=; 
	b=Dr2m674YWJRHRI16wy+9BAmDVULJAzf01TaxRpWrAH+JuvG1KmL3xIPpogks/IgFqgCAojJ17pKTJEhPCZR/GNF9wj/JrS+Ffyoo/SIvsi28vFJPmWULj8MsIT+DpZHSHWVdtBZscxTWlJLre0cRKBTwAOWH3WVjCTIJPe18aQM=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054472;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=Q0pSe2RfpDMnhePm+Qzlz8IPsCD571W7svuapogeYRE=;
	b=eWCZwr2S5GiGAD7qVm/FCN7HABPeVPVJae/4sfYLd200e0RqIwEMjN1MDQ1mVm3g
	/K+37OG7ZRnaXJBtMaIHTgK2PhWMFZ9yDctGj4zbjOed6BcJeRcG1VYYbhq1rQJuiHf
	iQX5dj6JmgNPB4MNOwpOdcOVUvVKOdxqzRsjW6tI=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 10/44] x86/boot: introduce boot module types
Date: Fri, 30 Aug 2024 17:46:55 -0400
Message-Id: <20240830214730.1621-11-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

This commit introduces module types of xen, kernel, and ramdisk to allow boot
module detect code to tag the purpose of a boot module. This reduces the need
for hard coded order assumptions and global variables to be used by consumers
of boot modules, such as domain construction.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootinfo.h | 9 +++++++++
 xen/arch/x86/setup.c                | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index 3e0e36df096b..1b1b640f83f7 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -11,9 +11,18 @@
 #include <xen/multiboot.h>
 #include <xen/types.h>
 
+/* Boot module binary type / purpose */
+enum bootmod_type {
+    BOOTMOD_UNKNOWN,
+    BOOTMOD_XEN,
+    BOOTMOD_KERNEL,
+    BOOTMOD_RAMDISK,
+};
+
 struct boot_module {
     module_t *early_mod;
     unsigned long headroom;
+    enum bootmod_type type;
 };
 
 struct boot_info {
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index d4f557b4c50d..8d5450c981a8 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -314,6 +314,7 @@ static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
         boot_mods[i].early_mod = &mods[i];
 
     /* map the last mb module for xen entry */
+    boot_mods[info.nr_mods].type = BOOTMOD_XEN;
     boot_mods[info.nr_mods].early_mod = &mods[info.nr_mods];
 
     boot_info = &info;
@@ -1197,6 +1198,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
     bitmap_fill(module_map, boot_info->nr_mods);
     __clear_bit(0, module_map); /* Dom0 kernel is always first */
+    boot_info->mods[0].type = BOOTMOD_KERNEL;
 
     if ( pvh_boot )
     {
@@ -2085,6 +2087,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
            cpu_has_nx ? "" : "not ");
 
     initrdidx = find_first_bit(module_map, boot_info->nr_mods);
+    boot_info->mods[initrdidx].type = BOOTMOD_RAMDISK;
     if ( bitmap_weight(module_map, boot_info->nr_mods) > 1 )
         printk(XENLOG_WARNING
                "Multiple initrd candidates, picking module #%u\n",
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786760.1196534 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bW-0003h4-19; Fri, 30 Aug 2024 21:56:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786760.1196534; Fri, 30 Aug 2024 21:56:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bV-0003gn-TW; Fri, 30 Aug 2024 21:56:25 +0000
Received: by outflank-mailman (input) for mailman id 786760;
 Fri, 30 Aug 2024 21:56: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Up-00065G-Iu
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:49:31 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id bb685fb0-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:49:30 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054475097108.05435664404672;
 Fri, 30 Aug 2024 14:47:55 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: bb685fb0-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054477; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=d6e5Wiun1gTE7j1u305GpLy+PnGIYCDEeqFN7m+gLdij3t0rEtBwcb3OiCVckj8DTOWRO8qK5H3w0yPnohT1XbpZ28Nj2hA+U6Jn1lP85AtWl8JeuzgXR6vXvqwzx3L23fi75b2hWZevYeThQtaJQvfoHmygabe2rM1PsLFA8Z8=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054477; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=NPlHbwKF+a8HLFZ7J6H7myDoAP2mw8XIrCc9sG0+8Xw=; 
	b=drgHp7d0UZBIxKvtKXmu5vBs1jw/dBMIELB7R0JMq5GXeohFfAp6EVjmTZtGO5ajvoCmaGr0ngBlMMUcR9uiFMwpD3Ob/hMKrwY2XZTe2u+0ABkf6NVu0EeIdyHsbPO899lLcKcDWEFJsPfUGm+W8fF89KDXkM/Q+sFA8Qkf0xw=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054477;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=NPlHbwKF+a8HLFZ7J6H7myDoAP2mw8XIrCc9sG0+8Xw=;
	b=ZrHpK9XluX96/QQzpIf4M+PhnWfXDiEKHA0xQyvs2MQ/jR+FbgSPkKfdyw+YExhC
	U49/hNB7GSPsEhI9EdfRNwr5hQjSs9TN7gYC5kKmB357anBhPjZpF0dH40sDduEdarY
	MwRtC/UxlQPO6ASsQzl7jXJGntqeflL2/IYAM4Ek=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 14/44] x86/boot: transition relocation calculations to struct boot_module
Date: Fri, 30 Aug 2024 17:46:59 -0400
Message-Id: <20240830214730.1621-15-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Use struct boot_module fields, start and size, when calculating the relocation
address and size. It also ensures that early_mod references are kept in sync.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/setup.c | 33 +++++++++++++++------------------
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 27517d24b2ea..0b6bde9ce7e3 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1504,7 +1504,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
             struct boot_module *bm = &boot_info->mods[j];
             unsigned long size;
 
-            size = PAGE_ALIGN(bm->headroom + bm->early_mod->mod_end);
+            size = PAGE_ALIGN(bm->headroom + bm->size);
 
             if ( boot_info->mods[j].flags & BOOTMOD_FLAG_X86_RELOCATED )
                 continue;
@@ -1518,13 +1518,12 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
             if ( s < end &&
                  (bm->headroom ||
-                  ((end - size) >> PAGE_SHIFT) > bm->early_mod->mod_start) )
+                  paddr_to_pfn(end - size) > paddr_to_pfn(bm->start)) )
             {
-                move_memory(end - size + bm->headroom,
-                            (uint64_t)bm->early_mod->mod_start << PAGE_SHIFT,
-                            bm->early_mod->mod_end);
-                bm->early_mod->mod_start = (end - size) >> PAGE_SHIFT;
-                bm->early_mod->mod_end += bm->headroom;
+                move_memory(end - size + bm->headroom, bm->start, bm->size);
+                bm->start = (end - size);
+                bm->early_mod->mod_start = paddr_to_pfn(bm->start);
+                bm->size = bm->early_mod->mod_end += bm->headroom;
                 bm->flags |= BOOTMOD_FLAG_X86_RELOCATED;
             }
         }
@@ -1556,11 +1555,10 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
         panic("Not enough memory to relocate the dom0 kernel image\n");
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
-        uint64_t s = (uint64_t)boot_info->mods[i].early_mod->mod_start
-                        << PAGE_SHIFT;
+        uint64_t s = (uint64_t)boot_info->mods[i].start;
 
         reserve_e820_ram(&boot_e820, s,
-                         s + PAGE_ALIGN(boot_info->mods[i].early_mod->mod_end));
+                         s + PAGE_ALIGN(boot_info->mods[i].size));
     }
 
     if ( !xen_phys_start )
@@ -1638,9 +1636,8 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
                 map_e = boot_e820.map[j].addr + boot_e820.map[j].size;
                 for ( j = 0; j < boot_info->nr_mods; ++j )
                 {
-                    uint64_t end = pfn_to_paddr(
-                                   boot_info->mods[j].early_mod->mod_start) +
-                                   boot_info->mods[j].early_mod->mod_end;
+                    uint64_t end = boot_info->mods[j].start +
+                                   boot_info->mods[j].size;
 
                     if ( map_e < end )
                         map_e = end;
@@ -1714,13 +1711,13 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
-        set_pdx_range(boot_info->mods[i].early_mod->mod_start,
-                      boot_info->mods[i].early_mod->mod_start +
+        set_pdx_range(paddr_to_pfn(boot_info->mods[i].start),
+                      paddr_to_pfn(boot_info->mods[i].start) +
                       PFN_UP(boot_info->mods[i].early_mod->mod_end));
         map_pages_to_xen(
-            (unsigned long)mfn_to_virt(boot_info->mods[i].early_mod->mod_start),
-            _mfn(boot_info->mods[i].early_mod->mod_start),
-            PFN_UP(boot_info->mods[i].early_mod->mod_end), PAGE_HYPERVISOR);
+            (unsigned long)maddr_to_virt(boot_info->mods[i].start),
+            maddr_to_mfn(boot_info->mods[i].start),
+            PFN_UP(boot_info->mods[i].size), PAGE_HYPERVISOR);
     }
 
 #ifdef CONFIG_KEXEC
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:26 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:26 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786761.1196540 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bW-0003lO-Ha; Fri, 30 Aug 2024 21:56:26 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786761.1196540; Fri, 30 Aug 2024 21:56:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bW-0003ky-AR; Fri, 30 Aug 2024 21:56:26 +0000
Received: by outflank-mailman (input) for mailman id 786761;
 Fri, 30 Aug 2024 21:56:24 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9XN-0000Zf-48
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:52:09 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 18fa953c-671a-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:52:07 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054497909399.3572608288832;
 Fri, 30 Aug 2024 14:48:17 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 18fa953c-671a-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054499; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=m7eOzt8e/yus21ggPibpZzLMVSol6XKNBAqGEyVU1ABNF0K5G9G4lBcnEogjFP14uw0yjxqrzoIihXX0KCh6ANS/wdwQN+2myufcSVASeuwdDTYzFGRN9WsNYSGLgC25XXSKOGFbxMjSuXFkIlvvc+PNCQfu+Cg1Ig4HNWiRubc=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054499; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=ngbbLEQwLIwlBq1EHKDN2ggSsuXtMR1Wvlwl95KPSyQ=; 
	b=XKV/qK1n4YfpLRcHQzZYUkTt5NaWQZcBqEzuZuKQ6WVZOI/c1C2xDrbZRFFa+tga0jnKwSLlDcobePPXggqY0UwWFh2J6swvAeJqQORz7Eb2P87c3qpVphDOAJIf70ZhI50vtibv0N9i8OvurNTc8755ui8oVJiu6X5dr3DNkD8=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054499;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=ngbbLEQwLIwlBq1EHKDN2ggSsuXtMR1Wvlwl95KPSyQ=;
	b=NfDR64LYuwiTPYpAKJN0PClsPjMmpP07k/DIX03CUM/rZHxpk4WobGSqVAmK/dxI
	U2TruI3vHDcvGmlGo10h0lFlqe2CCb6LlpjAkEEtdPxCLyylnl8qXOiTspmMQ+ZNIrc
	wfA0C1dpD98odlW4In2Xbod84kEq+SdPk/VwdWUo=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 35/44] x86/boot: remove usage of mod_end by discard_initial_images
Date: Fri, 30 Aug 2024 17:47:20 -0400
Message-Id: <20240830214730.1621-36-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

This eliminates usage of early_mod by discard_initial_images

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/pv/dom0_build.c | 2 +-
 xen/arch/x86/setup.c         | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index dce62d76e41e..a403e23b2f93 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -641,7 +641,7 @@ int __init dom0_construct_pv(struct domain *d,
                 if ( assign_pages(mfn_to_page(_mfn(mfn++)), 1, d, 0) )
                     BUG();
         }
-        initrd->size = initrd->early_mod->mod_end = 0;
+        initrd->size = 0;
 
         iommu_memory_setup(d, "initrd", mfn_to_page(_mfn(initrd_mfn)),
                            PFN_UP(initrd_len), &flush_flags);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 977b68098694..81610405a53c 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -353,12 +353,10 @@ void __init discard_initial_images(void)
 
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
-        uint64_t start =
-            (uint64_t)boot_info->mods[i].early_mod->mod_start << PAGE_SHIFT;
+        uint64_t start = boot_info->mods[i].start;
 
         init_domheap_pages(start,
-                           start +
-                           PAGE_ALIGN(boot_info->mods[i].early_mod->mod_end));
+                           start + PAGE_ALIGN(boot_info->mods[i].size));
     }
 
     boot_info->nr_mods = 0;
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786770.1196554 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bZ-0004WM-34; Fri, 30 Aug 2024 21:56:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786770.1196554; Fri, 30 Aug 2024 21:56:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bY-0004Vz-SQ; Fri, 30 Aug 2024 21:56:28 +0000
Received: by outflank-mailman (input) for mailman id 786770;
 Fri, 30 Aug 2024 21:56:27 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9V4-00065G-Cw
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:49:46 +0000
Received: from sender3-of-o57.zoho.com (sender3-of-o57.zoho.com
 [136.143.184.57]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c4583564-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:49:45 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054477221407.77333741442715;
 Fri, 30 Aug 2024 14:47:57 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c4583564-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054479; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=Ru3p5X5v6TlDJEMWI+9LyYX324Xjv8m84ceJlv3IYp+7xQzTqB/gdRUrXVNf6MFRUQok2KtkRl0zCj0kzNQJuhfKPwvXF9dOMLPtrz0oAy+QeIbYkSPshMJoxPWxAKM9HKF1/rLZlGV2SMRDdZo+RYyEP9ECLLymkgau2zf6bAA=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054479; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=bVRjWgn0rJXMNoedI0B0emnthNEBUMt5tP4JhrqFCck=; 
	b=PoQmeXORo1oDLnmlw1vnvJyFufOxxOybxKsklwFZN730rSXEQ6rEE98TEymWkStYuD+Cl/wgsTAFFX3eP5c94pZuY+VhSS2vWYeF9KVEjsE/F2fIzVhutZ5JIdzbjkiNApzQTzgVDcrxvMyP8EmLhLHE9a44cqO+si9ILezEWi4=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054479;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=bVRjWgn0rJXMNoedI0B0emnthNEBUMt5tP4JhrqFCck=;
	b=d75Ha3abZDe4oPlyicA6qJ2en6+xikcXvyGnaiCzezvMag0Y8fSQyflJRJesYTxd
	qOLkUE2Fukh2HCjJMkHpl/XybwFizBZuF8AGBv7IrqEsDIhizSCz0i28Amfo4Zgwdn5
	7yF4NBqr5n1v+OSjEbaRc9/chi1Oy2h/7iqCZtoE=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 16/44] x86/boot: introduce consumed flag for struct boot_module
Date: Fri, 30 Aug 2024 17:47:01 -0400
Message-Id: <20240830214730.1621-17-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Allow the tracking of when a boot module has been consumed by a handler in the
hypervisor independent of when it is claimed. The instances where the
hypervisor does nothing beyond claiming, the dom0 kernel, dom0 ramdisk, and a
placeholder for itself, are updated as being consumed at the time of being
claimed.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootinfo.h | 1 +
 xen/arch/x86/setup.c                | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index 99f8c9b83b25..740308693629 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -26,6 +26,7 @@ struct boot_module {
 
     uint32_t flags;
 #define BOOTMOD_FLAG_X86_RELOCATED     (1U << 0)
+#define BOOTMOD_FLAG_X86_CONSUMED      (1U << 1)
 
     paddr_t start;
     size_t size;
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 0b6bde9ce7e3..da75dfce083d 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -320,6 +320,7 @@ static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
 
     /* map the last mb module for xen entry */
     boot_mods[info.nr_mods].type = BOOTMOD_XEN;
+    boot_mods[info.nr_mods].flags |= BOOTMOD_FLAG_X86_CONSUMED;
     boot_mods[info.nr_mods].early_mod = &mods[info.nr_mods];
 
     boot_info = &info;
@@ -1212,6 +1213,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     bitmap_fill(module_map, boot_info->nr_mods);
     __clear_bit(0, module_map); /* Dom0 kernel is always first */
     boot_info->mods[0].type = BOOTMOD_KERNEL;
+    boot_info->mods[0].flags |= BOOTMOD_FLAG_X86_CONSUMED;
 
     if ( pvh_boot )
     {
@@ -2100,6 +2102,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
     initrdidx = find_first_bit(module_map, boot_info->nr_mods);
     boot_info->mods[initrdidx].type = BOOTMOD_RAMDISK;
+    boot_info->mods[initrdidx].flags |= BOOTMOD_FLAG_X86_CONSUMED;
     if ( bitmap_weight(module_map, boot_info->nr_mods) > 1 )
         printk(XENLOG_WARNING
                "Multiple initrd candidates, picking module #%u\n",
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786771.1196559 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bZ-0004bZ-L9; Fri, 30 Aug 2024 21:56:29 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786771.1196559; Fri, 30 Aug 2024 21:56:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bZ-0004a5-CK; Fri, 30 Aug 2024 21:56:29 +0000
Received: by outflank-mailman (input) for mailman id 786771;
 Fri, 30 Aug 2024 21:56:27 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Xe-0000Zf-2K
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:52:26 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 230e677c-671a-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:52:24 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054500033634.5246086156144;
 Fri, 30 Aug 2024 14:48:20 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 230e677c-671a-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054502; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=Cn+G1qZky79yw/9hC9HKgKVZ45rI70UfgV6bSQszYWRKkXYJS+n7rUyXGKAg2S04DaXfEOBp+vhvvKhuaAp68kajkYA8KdnS9lThNTCR9JgK8q2UyREJ2JhZNeqeTy2URaIuUk34tH/M9n7lnCVB9R/8YHXPTbfqRmA7/7hDLHo=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054502; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=HBxvAb1ltpAXzL9WPBIkhD8Kd9b/CO8vDcvLfbJPxj0=; 
	b=NyK2nyr1cr4+N2IXgM9Yf24qblL/EEcV4TKqcAuRuvryjSY29ISWJsD8GAoSbZt56VUNMyvzBKtdHR8s6H4XW/+RvPbLKKeL/RFlWFfj0pnm9Z+hk6yLvadUhEsc3/sqig33WELaZq5AI9yoUTOXOoFnuoboDQy7VPzAcoUoiPM=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054502;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=HBxvAb1ltpAXzL9WPBIkhD8Kd9b/CO8vDcvLfbJPxj0=;
	b=cvoUht3bbrWsoWvlmhjW+xzwaNFHpd2V3oFWssLldYyD06/GXvJTdPTgHCRLSGhb
	Ct9SZN5YqudaQCtv31nY7Gad2C7AvK0BuFfCNzchQgqGMsHbtkfOC+dQD6/ECIgQRT5
	j5IChvDDZ2ZLRh0bPyJ9nxjzbzpstW/NHNciv9pw=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 37/44] x86/boot: remove early_mod from struct boot_module
Date: Fri, 30 Aug 2024 17:47:22 -0400
Message-Id: <20240830214730.1621-38-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

With all references to early_mod fields removed, remove the
early_mod field from struct boot_module.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootinfo.h | 2 --
 xen/arch/x86/setup.c                | 3 ---
 2 files changed, 5 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index edd5c435d032..59755ef42e53 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -8,7 +8,6 @@
 #ifndef __XEN_X86_BOOTINFO_H__
 #define __XEN_X86_BOOTINFO_H__
 
-#include <xen/multiboot.h>
 #include <xen/types.h>
 
 /* Boot module binary type / purpose */
@@ -22,7 +21,6 @@ enum bootmod_type {
 };
 
 struct boot_module {
-    module_t *early_mod;
     unsigned long headroom;
     enum bootmod_type type;
 
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 46f6bf82fe63..a6fbaecee9ed 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -311,8 +311,6 @@ static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
 
     for ( i=0; i < info.nr_mods; i++ )
     {
-        boot_mods[i].early_mod = &mods[i];
-
         boot_mods[i].cmdline = (char *)(paddr_t)mods[i].string;
 
         boot_mods[i].start = (paddr_t)mods[i].mod_start;
@@ -322,7 +320,6 @@ static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
     /* map the last mb module for xen entry */
     boot_mods[info.nr_mods].type = BOOTMOD_XEN;
     boot_mods[info.nr_mods].flags |= BOOTMOD_FLAG_X86_CONSUMED;
-    boot_mods[info.nr_mods].early_mod = &mods[info.nr_mods];
 
     boot_info = &info;
 }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:33 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:33 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786778.1196574 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bd-0005SW-09; Fri, 30 Aug 2024 21:56:33 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786778.1196574; Fri, 30 Aug 2024 21:56:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bc-0005SC-Q0; Fri, 30 Aug 2024 21:56:32 +0000
Received: by outflank-mailman (input) for mailman id 786778;
 Fri, 30 Aug 2024 21:56: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9VB-00065G-Hn
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:49:53 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id c894741f-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:49:52 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054478301324.8472500488509;
 Fri, 30 Aug 2024 14:47:58 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: c894741f-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054480; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=aHPpeIVNL0p7qiPf3/PYT+YdR6pGnPsfotpzxAxe9GUrjvMnDEtSTs4Dk7hTqj5wy3JyImccl2jqZR1xratTWf8HWFUK+p8kdn8bt6PapBN9+LUIF0dzdjZ5D8plYKrSzXWUwRnbjgOp9UvYGyUzJbjaWvoJyDiCqhCVXOb17uw=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054480; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=kpui6t02X83Vt5ycf0OvPFAWFtuSlnhdgDe57IspVC4=; 
	b=OCoZcvqymaIice8IHgu574wZY7TeKr1nbbVPrk7vxy4EqMBByu+A6/LA19hgJkc9F4KrZyOAMpSR/VYLlGNWe6X6UJnEtIMWJ122jphDwZR90nyrXwb0RB1KqeRWvO1mJueAZdT3ZKUaWNWw76O4ipQWjZobTMYNy14SXtvSS00=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054480;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=kpui6t02X83Vt5ycf0OvPFAWFtuSlnhdgDe57IspVC4=;
	b=asyp2iG7GLWIyAHoBvsqrdEJxpqLGDn8v/EQGypHao6+NgVAPgY9HEf/WtRcea/A
	La6bCLcPWupK4OAoTQKQ5isgBTlaNw5y9Mtjx8N6n6ngvm17DlAWKtw7K2W6ux5SqB7
	4HSImcYDn9PusSujYjI4tl2gg/TdPeVZ/2vacvPg=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 17/44] x86/boot: convert microcode loading to consume struct boot_info
Date: Fri, 30 Aug 2024 17:47:02 -0400
Message-Id: <20240830214730.1621-18-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Convert the microcode loading functions to take struct boot_info, and then
using struct boot_module to map and check for microcode. To keep the changes
focused, continue using the struct mod to hold the reference to the microcode
that is used by the late microcode logic.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/cpu/microcode/core.c    | 37 +++++++++++++---------------
 xen/arch/x86/include/asm/bootinfo.h  |  1 +
 xen/arch/x86/include/asm/microcode.h | 14 ++++++-----
 xen/arch/x86/setup.c                 |  4 +--
 4 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/core.c b/xen/arch/x86/cpu/microcode/core.c
index 8a9e744489b9..653a725173ba 100644
--- a/xen/arch/x86/cpu/microcode/core.c
+++ b/xen/arch/x86/cpu/microcode/core.c
@@ -35,6 +35,7 @@
 #include <xen/watchdog.h>
 
 #include <asm/apic.h>
+#include <asm/bootinfo.h>
 #include <asm/cpu-policy.h>
 #include <asm/nmi.h>
 #include <asm/processor.h>
@@ -152,10 +153,8 @@ static int __init cf_check parse_ucode(const char *s)
 custom_param("ucode", parse_ucode);
 
 static void __init microcode_scan_module(
-    unsigned long *module_map,
-    const multiboot_info_t *mbi)
+    unsigned long *module_map, const struct boot_info *bi)
 {
-    module_t *mod = (module_t *)__va(mbi->mods_addr);
     uint64_t *_blob_start;
     unsigned long _blob_size;
     struct cpio_data cd;
@@ -177,16 +176,16 @@ static void __init microcode_scan_module(
     /*
      * Try all modules and see whichever could be the microcode blob.
      */
-    for ( i = 1 /* Ignore dom0 kernel */; i < mbi->mods_count; i++ )
+    for ( i = 1 /* Ignore dom0 kernel */; i < bi->nr_mods; i++ )
     {
         if ( !test_bit(i, module_map) )
             continue;
 
-        _blob_start = bootstrap_map(&mod[i]);
-        _blob_size = mod[i].mod_end;
+        _blob_start = bootstrap_map_bm(&bi->mods[i]);
+        _blob_size = bi->mods[i].size;
         if ( !_blob_start )
         {
-            printk("Could not map multiboot module #%d (size: %ld)\n",
+            printk("Could not map boot module #%d (size: %ld)\n",
                    i, _blob_size);
             continue;
         }
@@ -204,20 +203,18 @@ static void __init microcode_scan_module(
 }
 
 static void __init microcode_grab_module(
-    unsigned long *module_map,
-    const multiboot_info_t *mbi)
+    unsigned long *module_map, const struct boot_info *bi)
 {
-    module_t *mod = (module_t *)__va(mbi->mods_addr);
-
     if ( ucode_mod_idx < 0 )
-        ucode_mod_idx += mbi->mods_count;
-    if ( ucode_mod_idx <= 0 || ucode_mod_idx >= mbi->mods_count ||
+        ucode_mod_idx += bi->nr_mods;
+    if ( ucode_mod_idx <= 0 || ucode_mod_idx >= bi->nr_mods ||
          !__test_and_clear_bit(ucode_mod_idx, module_map) )
         goto scan;
-    ucode_mod = mod[ucode_mod_idx];
+    bi->mods[ucode_mod_idx].type = BOOTMOD_MICROCODE;
+    ucode_mod = *bi->mods[ucode_mod_idx].early_mod;
 scan:
     if ( ucode_scan )
-        microcode_scan_module(module_map, mbi);
+        microcode_scan_module(module_map, bi);
 }
 
 static struct microcode_ops __ro_after_init ucode_ops;
@@ -805,8 +802,8 @@ static int __init early_update_cache(const void *data, size_t len)
     return rc;
 }
 
-int __init microcode_init_cache(unsigned long *module_map,
-                                const struct multiboot_info *mbi)
+int __init microcode_init_cache(
+    unsigned long *module_map, const struct boot_info *bi)
 {
     int rc = 0;
 
@@ -815,7 +812,7 @@ int __init microcode_init_cache(unsigned long *module_map,
 
     if ( ucode_scan )
         /* Need to rescan the modules because they might have been relocated */
-        microcode_scan_module(module_map, mbi);
+        microcode_scan_module(module_map, bi);
 
     if ( ucode_mod.mod_end )
         rc = early_update_cache(bootstrap_map(&ucode_mod),
@@ -862,7 +859,7 @@ static int __init early_microcode_update_cpu(void)
 }
 
 int __init early_microcode_init(unsigned long *module_map,
-                                const struct multiboot_info *mbi)
+                                const struct boot_info *bi)
 {
     const struct cpuinfo_x86 *c = &boot_cpu_data;
     int rc = 0;
@@ -905,7 +902,7 @@ int __init early_microcode_init(unsigned long *module_map,
         return -ENODEV;
     }
 
-    microcode_grab_module(module_map, mbi);
+    microcode_grab_module(module_map, bi);
 
     if ( ucode_mod.mod_end || ucode_blob.size )
         rc = early_microcode_update_cpu();
diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index 740308693629..1cef48457c66 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -17,6 +17,7 @@ enum bootmod_type {
     BOOTMOD_XEN,
     BOOTMOD_KERNEL,
     BOOTMOD_RAMDISK,
+    BOOTMOD_MICROCODE,
 };
 
 struct boot_module {
diff --git a/xen/arch/x86/include/asm/microcode.h b/xen/arch/x86/include/asm/microcode.h
index 57c08205d475..02fdb56bb82b 100644
--- a/xen/arch/x86/include/asm/microcode.h
+++ b/xen/arch/x86/include/asm/microcode.h
@@ -4,6 +4,8 @@
 #include <xen/types.h>
 #include <xen/percpu.h>
 
+#include <asm/bootinfo.h>
+
 #include <public/xen.h>
 
 struct multiboot_info;
@@ -22,12 +24,12 @@ struct cpu_signature {
 DECLARE_PER_CPU(struct cpu_signature, cpu_sig);
 
 void microcode_set_module(unsigned int idx);
-int microcode_update(XEN_GUEST_HANDLE(const_void) buf,
-                     unsigned long len, unsigned int flags);
-int early_microcode_init(unsigned long *module_map,
-                         const struct multiboot_info *mbi);
-int microcode_init_cache(unsigned long *module_map,
-                         const struct multiboot_info *mbi);
+int microcode_update(
+    XEN_GUEST_HANDLE(const_void) buf, unsigned long len, unsigned int flags);
+int early_microcode_init(
+    unsigned long *module_map, const struct boot_info *bi);
+int microcode_init_cache(
+    unsigned long *module_map, const struct boot_info *bi);
 int microcode_update_one(void);
 
 #endif /* ASM_X86__MICROCODE_H */
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index da75dfce083d..6495ab393576 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1398,7 +1398,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
      * TODO: load ucode earlier once multiboot modules become accessible
      * at an earlier stage.
      */
-    early_microcode_init(module_map, mbi);
+    early_microcode_init(module_map, boot_info);
 
     if ( xen_phys_start )
     {
@@ -1952,7 +1952,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
     timer_init();
 
-    microcode_init_cache(module_map, mbi); /* Needs xmalloc() */
+    microcode_init_cache(module_map, boot_info); /* Needs xmalloc() */
 
     tsx_init(); /* Needs microcode.  May change HLE/RTM feature bits. */
 
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786794.1196584 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bh-0006QF-Q3; Fri, 30 Aug 2024 21:56:37 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786794.1196584; Fri, 30 Aug 2024 21:56:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bh-0006PL-J6; Fri, 30 Aug 2024 21:56:37 +0000
Received: by outflank-mailman (input) for mailman id 786794;
 Fri, 30 Aug 2024 21:56: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9UU-00065G-P4
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:49:10 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id af0b5679-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:49:09 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054471893456.85203276225536;
 Fri, 30 Aug 2024 14:47:51 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: af0b5679-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054474; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=lasNya4BFw/XtdtSGjwfRiCwlJ2VNmaP/DFwPqwMxuNlpnFaYBJBhFgki3cfogDxU9wZYf3sUP2yDsT6xSYk7Efsvn+j0zHp59BdR6GcpVpgSjjETUkRpT0qWonoxJ/5mPk6bV0H/C25eSmuy0/Im70MrNAskpaEUf5ZHQ6PKQQ=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054474; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=5tRW/AonFx6PkMudQZ5UfviW7yOCGUwEDitNjDx5cYw=; 
	b=P2RZyBCBWzg0mXe89rpIkcQ59rMsls/HXUJftpwSGUiGPS0zBhrAevJorYsL+HSroAlas1NIBhfkBtsXAvV5LSEo9zqvPkEltsIp1t1HTaDRy/DRO7VaOwsE3LSi+VgN3NW7Z3ESgpgAE0e5L6ObQQSqIaONU0ZjLGzrEvCBtEE=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054474;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=5tRW/AonFx6PkMudQZ5UfviW7yOCGUwEDitNjDx5cYw=;
	b=BNiO0Zw2VJ1gTey+LPtH+bszYg/zKQgmqw12d7w3C7FDRgty38trREA9D0XrAzVf
	e9ushTYSMZsYQnQMMAeh8QBW4teIaKM+qgiPA9Jyp9CLFMc0RFnEVC4Zw/u5nldabKy
	SUysyMO272fQbZGub475DGGOCmYI4IeMOsVcrA28=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 11/44] x86/boot: introduce boot module flags
Date: Fri, 30 Aug 2024 17:46:56 -0400
Message-Id: <20240830214730.1621-12-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

The existing startup code employs various ad-hoc state tracking about certain
boot module types by each area of the code. A boot module flags is added to
enable tracking these different states.  The first state to be transition by
this commit is module relocation.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootinfo.h | 4 ++++
 xen/arch/x86/setup.c                | 8 ++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index 1b1b640f83f7..baf6d74db754 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -23,6 +23,10 @@ struct boot_module {
     module_t *early_mod;
     unsigned long headroom;
     enum bootmod_type type;
+
+    uint32_t flags;
+#define BOOTMOD_FLAG_X86_RELOCATED     (1U << 0)
+
 };
 
 struct boot_info {
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 8d5450c981a8..47e4fcc2a8ce 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1377,7 +1377,6 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
             panic("Bootloader didn't honor module alignment request\n");
         boot_info->mods[i].early_mod->mod_end -= boot_info->mods[i].early_mod->mod_start;
         boot_info->mods[i].early_mod->mod_start >>= PAGE_SHIFT;
-        boot_info->mods[i].early_mod->reserved = 0;
     }
 
     /*
@@ -1492,7 +1491,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
             size = PAGE_ALIGN(bm->headroom + bm->early_mod->mod_end);
 
-            if ( boot_info->mods[j].early_mod->reserved )
+            if ( boot_info->mods[j].flags & BOOTMOD_FLAG_X86_RELOCATED )
                 continue;
 
             /* Don't overlap with other modules (or Xen itself). */
@@ -1511,7 +1510,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
                             bm->early_mod->mod_end);
                 bm->early_mod->mod_start = (end - size) >> PAGE_SHIFT;
                 bm->early_mod->mod_end += bm->headroom;
-                bm->early_mod->reserved = 1;
+                bm->flags |= BOOTMOD_FLAG_X86_RELOCATED;
             }
         }
 
@@ -1537,7 +1536,8 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 #endif
     }
 
-    if ( boot_info->mods[0].headroom && !boot_info->mods[0].early_mod->reserved )
+    if ( boot_info->mods[0].headroom &&
+         !(boot_info->mods[0].flags & BOOTMOD_FLAG_X86_RELOCATED) )
         panic("Not enough memory to relocate the dom0 kernel image\n");
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:39 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:39 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786796.1196593 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bj-0006nI-4T; Fri, 30 Aug 2024 21:56:39 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786796.1196593; Fri, 30 Aug 2024 21:56:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bi-0006lv-V6; Fri, 30 Aug 2024 21:56:38 +0000
Received: by outflank-mailman (input) for mailman id 786796;
 Fri, 30 Aug 2024 21:56:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Ub-00065G-HM
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:49:17 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b30bd153-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:49:16 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054472969909.2016091326745;
 Fri, 30 Aug 2024 14:47:52 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b30bd153-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054475; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=KUfmCtxNnGmntY9ieNlaQabAEenLPhdpW++jT/YEBx4k5VZcX7A7kJ+4Up2Xell391zbwyXvHuHDIcVKKMHsocxEeo/tzJSvO7PvW6Vx6pVjCq8nFZxjppUoznhZAfzHNVIJCRmz1e6pmDGCrDBDA8JyijGA/By6udcoDG3Wgfg=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054475; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=hMDag8iJyDBnao+fi0n8bnFwJVAPf0gtfWYWCLly+Do=; 
	b=FulD+ajNsq2Sratk39+2vvEScHrSK04+ijZU34RHXjflMYw4eMszCASSZy3Aren4gYfyXQfxck3QWmKGiGQycaLf6d7cebuWbXv14WPaSoCMwhh3l7PcU1JhPmcMPX1alQO18CeJ/2g1uPDo0/rLdhUSbBlN775TSIXRN063loQ=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054475;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=hMDag8iJyDBnao+fi0n8bnFwJVAPf0gtfWYWCLly+Do=;
	b=UsCkLTR/qZ20iBtGI+FDIwx165HevcceSuvREt9dKW8qc097SFWGR8Brzw/EOc8p
	20fcveaBonum0QXiLuLdo2CM0bJqUcg2SoxLEc3/kjxyakCcQlT0mx7YPWMdovCKe4C
	TVO5hh40fPtHPOFqps2fgPL53scx3c/Ak37cn55M=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 12/44] x86/boot: add start and size fields to struct boot_module
Date: Fri, 30 Aug 2024 17:46:57 -0400
Message-Id: <20240830214730.1621-13-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

This commit introduces the start and size fields to struct boot_module and adds
a corresponding bootstrap mapping function, bootstrap_map_bm.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootinfo.h |  2 ++
 xen/arch/x86/include/asm/setup.h    |  2 ++
 xen/arch/x86/setup.c                | 13 +++++++++++++
 3 files changed, 17 insertions(+)

diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index baf6d74db754..37132afb4e6a 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -27,6 +27,8 @@ struct boot_module {
     uint32_t flags;
 #define BOOTMOD_FLAG_X86_RELOCATED     (1U << 0)
 
+    paddr_t start;
+    size_t size;
 };
 
 struct boot_info {
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index 15dcb62cb5ac..165ca744ba34 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -2,6 +2,7 @@
 #define __X86_SETUP_H_
 
 #include <xen/multiboot.h>
+#include <asm/bootinfo.h>
 #include <asm/numa.h>
 
 extern const char __2M_text_start[], __2M_text_end[];
@@ -36,6 +37,7 @@ unsigned long initial_images_nrpages(nodeid_t node);
 void discard_initial_images(void);
 void *bootstrap_map_addr(uint64_t start, uint64_t end);
 void *bootstrap_map(const module_t *mod);
+void *bootstrap_map_bm(const struct boot_module *bm);
 
 int remove_xen_ranges(struct rangeset *r);
 
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 47e4fcc2a8ce..021c5699f86c 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -311,8 +311,13 @@ static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
     info.mods = boot_mods;
 
     for ( i=0; i < info.nr_mods; i++ )
+    {
         boot_mods[i].early_mod = &mods[i];
 
+        boot_mods[i].start = (paddr_t)mods[i].mod_start;
+        boot_mods[i].size = mods[i].mod_end - mods[i].mod_start;
+    }
+
     /* map the last mb module for xen entry */
     boot_mods[info.nr_mods].type = BOOTMOD_XEN;
     boot_mods[info.nr_mods].early_mod = &mods[info.nr_mods];
@@ -477,6 +482,14 @@ void *__init bootstrap_map(const module_t *mod)
                               pfn_to_paddr(mod->mod_start) + mod->mod_end);
 }
 
+void *__init bootstrap_map_bm(const struct boot_module *bm)
+{
+    if ( !bm )
+        return bootstrap_map_addr(0, 0);
+
+    return bootstrap_map_addr(bm->start, bm->start + bm->size);
+}
+
 static void __init move_memory(
     uint64_t dst, uint64_t src, unsigned int size)
 {
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:40 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:40 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786797.1196601 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bk-0007E2-KR; Fri, 30 Aug 2024 21:56:40 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786797.1196601; Fri, 30 Aug 2024 21:56:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bk-0007DG-Ad; Fri, 30 Aug 2024 21:56:40 +0000
Received: by outflank-mailman (input) for mailman id 786797;
 Fri, 30 Aug 2024 21:56:38 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9XF-0000Zf-FX
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:52:01 +0000
Received: from sender3-of-o57.zoho.com (sender3-of-o57.zoho.com
 [136.143.184.57]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1499de74-671a-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:51:59 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054496865249.05797085453992;
 Fri, 30 Aug 2024 14:48:16 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1499de74-671a-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054498; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=aGjcaSKDQL6x6+3QXUmV2Efhk+Exo2aZVhqZKyiTLSvnpZoEV1d7orOqC+I/1CHv3YTpdq/AFhRB+xnYdPzoHTUjCLqe7t6bLZ/WGGgY6KSbSrrxUxjiySvnldRwfLvngOGKiFyQxJgj/goM6cVMlWPBjqW26UKsvLgdbHyeABg=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054498; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=p5o3cV7jLCbs9cI7Hw5PLo3huoAejKeUL5qr3Pk5iyM=; 
	b=SHVdUAjdxF3eFlZ44wPBx//nBDmPRuqv3dIURtO5dEgYYIVGTA4e0Zs6Xg5/KfwtqXyXvGWrgZTnBq1fVI44JCeFqHkFrN4T1st/7Y5YCJJ/HPCDYJx6u98d3ykVfVHTdkJZKnKkbzHZ2zVQMkj14VgbDI3VjY1vHR2INhr00Uc=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054498;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=p5o3cV7jLCbs9cI7Hw5PLo3huoAejKeUL5qr3Pk5iyM=;
	b=rT6h3CC64FDRJJ0kWqC7zOjjBZg+0sL5owrewS3VPHxPEazX5lxfySujcSw5+Zzs
	xi8P1bRN4n+QH+8Kw2Up/BZzdGSqRAoF2G6k/0D684i5BurXgnV19f/jwbaNGDuSuCR
	NbhBYLJccCfj7AaVYZVLwdqz9ieuDDLM2nHL1cXQ=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 34/44] x86/boot: drop the use of initial_images unit global
Date: Fri, 30 Aug 2024 17:47:19 -0400
Message-Id: <20240830214730.1621-35-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/setup.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 77c0833dd441..977b68098694 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -281,7 +281,6 @@ static const char *cmdline_cook(const char *p, const char *loader_name);
 /* Max number of boot modules a bootloader can provide in addition to Xen */
 #define MAX_NR_BOOTMODS 63
 
-static const struct boot_module *__initdata initial_images;
 static struct boot_info __initdata *boot_info;
 
 static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
@@ -337,9 +336,9 @@ unsigned long __init initial_images_nrpages(nodeid_t node)
 
     for ( nr = i = 0; i < boot_info->nr_mods; ++i )
     {
-        unsigned long start = initial_images[i].early_mod->mod_start;
+        unsigned long start = boot_info->mods[i].early_mod->mod_start;
         unsigned long end = start +
-                            PFN_UP(initial_images[i].early_mod->mod_end);
+                            PFN_UP(boot_info->mods[i].early_mod->mod_end);
 
         if ( end > node_start && node_end > start )
             nr += min(node_end, end) - max(node_start, start);
@@ -355,15 +354,14 @@ void __init discard_initial_images(void)
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
         uint64_t start =
-            (uint64_t)initial_images[i].early_mod->mod_start << PAGE_SHIFT;
+            (uint64_t)boot_info->mods[i].early_mod->mod_start << PAGE_SHIFT;
 
         init_domheap_pages(start,
                            start +
-                           PAGE_ALIGN(initial_images[i].early_mod->mod_end));
+                           PAGE_ALIGN(boot_info->mods[i].early_mod->mod_end));
     }
 
     boot_info->nr_mods = 0;
-    initial_images = NULL;
 }
 
 static void __init init_idle_domain(void)
@@ -1399,8 +1397,6 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     set_kexec_crash_area_size((u64)nr_pages << PAGE_SHIFT);
     kexec_reserve_area();
 
-    initial_images = boot_info->mods;
-
     for ( i = 0; !efi_enabled(EFI_LOADER) && i < boot_info->nr_mods; i++ )
     {
         if ( boot_info->mods[i].early_mod->mod_start & (PAGE_SIZE - 1) )
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786798.1196608 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bl-0007KO-KE; Fri, 30 Aug 2024 21:56:41 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786798.1196608; Fri, 30 Aug 2024 21:56:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bk-0007Gp-QY; Fri, 30 Aug 2024 21:56:40 +0000
Received: by outflank-mailman (input) for mailman id 786798;
 Fri, 30 Aug 2024 21:56:38 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9WI-0002pb-3U
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:51:02 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id f162e06d-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:51:01 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054488141373.37797061577385;
 Fri, 30 Aug 2024 14:48:08 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: f162e06d-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054490; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=S4WCJwe9XVjYfg9SYILGNDE2sLz+Fy8ozFBIUpBe/WlTznKzyhhLGYtS1b3CKgmLNjAKvugxhxjndWMhapjUB5Bb50EmtTMHaPAQwjnDRLmeI/92Cp0Y9UcE/uQkJoMveQzWlpVFAT7xXJPOq9mPOTaoTsfUfUrDzTjVLHQuApM=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054490; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=L5tz0lT7C2k6e608u4s5wJilake7jMdmn/z/xN+eCro=; 
	b=exqOAKBMLEALMZSYZhdyG09tTYe0Ugv/3VBzCdFP4j1oYhvKROwZd3KKWCk7q26nxqVCYQjV928oYzAkwZVJeQpZHNzR6QaZvvz79AEb1PGCodQdgyq3dc4fAkuelA1uX6R1SEYyKNBD1SEXtPGW6uKXcDQzpZE1OIFBW3yblWQ=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054490;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=L5tz0lT7C2k6e608u4s5wJilake7jMdmn/z/xN+eCro=;
	b=nrRFsyM5UInTlstUVsEl0V9mKlmIzQ5GB7oNPvl0tI8pA2iD0DVY1ZkM87bXUrRl
	qB92yUjPt9ufulSH/3sN+PrzkkTfbUoXzp/bYdXD5eXa5vbgEtgHX1O/DshJ82qL6Ib
	/ekXHXojlFbeIrRCyHvvDDZdgsspcCyoXrOw+Wa4=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 26/44] x86/boot: convert construct_dom0 to use struct boot_module
Date: Fri, 30 Aug 2024 17:47:11 -0400
Message-Id: <20240830214730.1621-27-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

The construct_dom0 function is converted to consume struct boot_module
instances for the kernel and ramdisk. With this change, it is no longer
necessary for the internal use of struct mod by create_dom0, so they are
changed to struct boot_module.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/dom0_build.c        | 10 +++++-----
 xen/arch/x86/include/asm/setup.h |  6 ++----
 xen/arch/x86/setup.c             | 17 ++++++++---------
 3 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 8d56705a0861..fb1b7e5d11cf 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -13,6 +13,7 @@
 #include <xen/softirq.h>
 
 #include <asm/amd.h>
+#include <asm/bootinfo.h>
 #include <asm/dom0_build.h>
 #include <asm/guest.h>
 #include <asm/hpet.h>
@@ -596,9 +597,8 @@ int __init dom0_setup_permissions(struct domain *d)
     return rc;
 }
 
-int __init construct_dom0(struct domain *d, const module_t *image,
-                          unsigned long image_headroom, module_t *initrd,
-                          const char *cmdline)
+int __init construct_dom0(struct domain *d, const struct boot_module *image,
+                          struct boot_module *initrd, const char *cmdline)
 {
     int rc;
 
@@ -610,9 +610,9 @@ int __init construct_dom0(struct domain *d, const module_t *image,
     process_pending_softirqs();
 
     if ( is_hvm_domain(d) )
-        rc = dom0_construct_pvh(d, image, image_headroom, initrd, cmdline);
+        rc = dom0_construct_pvh(d, image->early_mod, image->headroom, initrd->early_mod, cmdline);
     else if ( is_pv_domain(d) )
-        rc = dom0_construct_pv(d, image, image_headroom, initrd, cmdline);
+        rc = dom0_construct_pv(d, image->early_mod, image->headroom, initrd->early_mod, cmdline);
     else
         panic("Cannot construct Dom0. No guest interface available\n");
 
diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index 165ca744ba34..19e2ad95b523 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -27,10 +27,8 @@ void subarch_init_memory(void);
 void init_IRQ(void);
 
 int construct_dom0(
-    struct domain *d,
-    const module_t *image, unsigned long image_headroom,
-    module_t *initrd,
-    const char *cmdline);
+    struct domain *d, const struct boot_module *image,
+    struct boot_module *initrd, const char *cmdline);
 void setup_io_bitmap(struct domain *d);
 
 unsigned long initial_images_nrpages(nodeid_t node);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 6a613c4847b0..f58eb21d00d7 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -962,20 +962,19 @@ static struct domain *__init create_dom0(const struct boot_info *bi,
             .misc_flags = opt_dom0_msr_relaxed ? XEN_X86_MSR_RELAXED : 0,
         },
     };
-    int headroom, mod_idx = first_boot_module_index(bi, BOOTMOD_RAMDISK);
-    module_t *image, *initrd;
+    int mod_idx = first_boot_module_index(bi, BOOTMOD_RAMDISK);
+    struct boot_module *image, *initrd;
     struct domain *d;
     domid_t domid;
 
     /* Map boot_module to mb1 module for dom0 */
-    image = bi->mods[0].early_mod;
-    headroom = bi->mods[0].headroom;
+    image = &bi->mods[0];
 
     /* Map boot_module to mb1 module for initrd */
     if ( mod_idx < 0 )
         initrd = NULL;
     else
-        initrd = bi->mods[mod_idx].early_mod;
+        initrd = &bi->mods[mod_idx];
 
     if ( opt_dom0_pvh )
     {
@@ -1002,10 +1001,10 @@ static struct domain *__init create_dom0(const struct boot_info *bi,
         panic("Error creating d%uv0\n", domid);
 
     /* Grab the DOM0 command line. */
-    if ( image->string || kextra )
+    if ( image->early_mod->string || kextra )
     {
-        if ( image->string )
-            safe_strcpy(cmdline, cmdline_cook(__va(image->string),
+        if ( image->early_mod->string )
+            safe_strcpy(cmdline, cmdline_cook(__va(image->early_mod->string),
                         bi->boot_loader_name));
 
         if ( kextra )
@@ -1040,7 +1039,7 @@ static struct domain *__init create_dom0(const struct boot_info *bi,
         write_cr4(read_cr4() & ~X86_CR4_SMAP);
     }
 
-    if ( construct_dom0(d, image, headroom, initrd, cmdline) != 0 )
+    if ( construct_dom0(d, image, initrd, cmdline) != 0 )
         panic("Could not construct domain 0\n");
 
     if ( cpu_has_smap )
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:42 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:42 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786799.1196612 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bm-0007ZX-Cj; Fri, 30 Aug 2024 21:56:42 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786799.1196612; Fri, 30 Aug 2024 21:56:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bl-0007UK-OU; Fri, 30 Aug 2024 21:56:41 +0000
Received: by outflank-mailman (input) for mailman id 786799;
 Fri, 30 Aug 2024 21:56: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9XU-0000Zf-OQ
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:52:16 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 1dadde6a-671a-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:52:15 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054498973975.9857328919481;
 Fri, 30 Aug 2024 14:48:18 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 1dadde6a-671a-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054500; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=GDSKvUqHJ5BLAS627Did2xnWccmZLTtAIspbKcJn4SGe+PXR7jf2bbK4RBHkXgpJyXMoXgbW+AcpY8RE4NjMdMt+h7Z6mVNP8nu7ZQjSfY0883AJlZaXBARkIuxBJSo35yuf7NxczM08AhMjwtPp/bNdbAQG8pK30GuB5Sstszk=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054500; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=3IESuTbSEXt1kpS4QxXRhBwnK5tj42QFRgJSLR4gL7g=; 
	b=AWuOdAeM3rEUAZclJJdARbz6aWQFvv4+gbaGqZ6ZV6q5e3kqzSURm7l6Z175lOkRgYF9U/szQc/TPZ+oKE5jErAV5wLzfpWFF41NtY1pEBiiwZKblJim9nR/keQReqgoqt7OjcFL04XAwaRixaQvHtmW2i80o3ZW0zzbfitd0Dc=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054500;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=3IESuTbSEXt1kpS4QxXRhBwnK5tj42QFRgJSLR4gL7g=;
	b=brTGisH6Dp8rEw9sOTjel49uha73GTWa+U+PshwLRspU68ej6q2ytrr5AMqt2SNZ
	Hy4OXwg5ZRCE1oPWC9SljIAjBbZ2C1wUTjsTGR3VmwOg7KFP32Ci3swK0uHJzadS7XA
	orHHrnnbRu4jgznCPGNPv9vWNJzbmk8N3P8wOur8=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 36/44] x86/boot: remove remaining early_mod references
Date: Fri, 30 Aug 2024 17:47:21 -0400
Message-Id: <20240830214730.1621-37-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Any direct usages of struct mod have been transitioned, remove the remaining
references to early_mod fields.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/setup.c | 28 +++++++++++-----------------
 1 file changed, 11 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 81610405a53c..46f6bf82fe63 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -336,9 +336,8 @@ unsigned long __init initial_images_nrpages(nodeid_t node)
 
     for ( nr = i = 0; i < boot_info->nr_mods; ++i )
     {
-        unsigned long start = boot_info->mods[i].early_mod->mod_start;
-        unsigned long end = start +
-                            PFN_UP(boot_info->mods[i].early_mod->mod_end);
+        unsigned long start = boot_info->mods[i].start;
+        unsigned long end = start + PFN_UP(boot_info->mods[i].size);
 
         if ( end > node_start && node_end > start )
             nr += min(node_end, end) - max(node_start, start);
@@ -665,8 +664,8 @@ static uint64_t __init consider_modules(
 
     for ( i = 0; i < nr_mods ; ++i )
     {
-        uint64_t start = (uint64_t)mods[i].early_mod->mod_start << PAGE_SHIFT;
-        uint64_t end = start + PAGE_ALIGN(mods[i].early_mod->mod_end);
+        uint64_t start = (uint64_t)mods[i].start;
+        uint64_t end = start + PAGE_ALIGN(mods[i].size);
 
         if ( i == this_mod )
             continue;
@@ -1397,10 +1396,8 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
 
     for ( i = 0; !efi_enabled(EFI_LOADER) && i < boot_info->nr_mods; i++ )
     {
-        if ( boot_info->mods[i].early_mod->mod_start & (PAGE_SIZE - 1) )
+        if ( boot_info->mods[i].start & (PAGE_SIZE - 1) )
             panic("Bootloader didn't honor module alignment request\n");
-        boot_info->mods[i].early_mod->mod_end -= boot_info->mods[i].early_mod->mod_start;
-        boot_info->mods[i].early_mod->mod_start >>= PAGE_SHIFT;
     }
 
     /*
@@ -1419,15 +1416,13 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
          * respective reserve_e820_ram() invocation below. No need to
          * query efi_boot_mem_unused() here, though.
          */
-        boot_info->mods[idx].start = boot_info->mods[idx].early_mod->mod_start
-                                   = virt_to_mfn(_stext);
-        boot_info->mods[idx].size = boot_info->mods[idx].early_mod->mod_end
-                                  = __2M_rwdata_end - _stext;
+        boot_info->mods[idx].start = virt_to_maddr(_stext);
+        boot_info->mods[idx].size = __2M_rwdata_end - _stext;
     }
 
     boot_info->mods[0].headroom = bzimage_headroom(
-                        bootstrap_map(boot_info->mods[0].early_mod),
-                        boot_info->mods[0].early_mod->mod_end);
+                        bootstrap_map_bm(&boot_info->mods[0]),
+                        boot_info->mods[0].size);
     bootstrap_map(NULL);
 
 #ifndef highmem_start
@@ -1533,8 +1528,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
             {
                 move_memory(end - size + bm->headroom, bm->start, bm->size);
                 bm->start = (end - size);
-                bm->early_mod->mod_start = paddr_to_pfn(bm->start);
-                bm->size = bm->early_mod->mod_end += bm->headroom;
+                bm->size += bm->headroom;
                 bm->flags |= BOOTMOD_FLAG_X86_RELOCATED;
             }
         }
@@ -1724,7 +1718,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     {
         set_pdx_range(paddr_to_pfn(boot_info->mods[i].start),
                       paddr_to_pfn(boot_info->mods[i].start) +
-                      PFN_UP(boot_info->mods[i].early_mod->mod_end));
+                      PFN_UP(boot_info->mods[i].size));
         map_pages_to_xen(
             (unsigned long)maddr_to_virt(boot_info->mods[i].start),
             maddr_to_mfn(boot_info->mods[i].start),
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:48 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:48 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786823.1196634 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bs-0000p6-Ky; Fri, 30 Aug 2024 21:56:48 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786823.1196634; Fri, 30 Aug 2024 21:56:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bs-0000nT-Bf; Fri, 30 Aug 2024 21:56:48 +0000
Received: by outflank-mailman (input) for mailman id 786823;
 Fri, 30 Aug 2024 21:56:47 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Uh-00065G-SA
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:49:23 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id b6d802c6-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:49:22 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054474029613.6614984690195;
 Fri, 30 Aug 2024 14:47:54 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: b6d802c6-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054476; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=OqXVWMl7VaK78DNscKnrvJshV2lLeRxJIRCTAN5X0CgXklka61qAYSml/8DkGzuOxyD9BvlGER25Ai10Uol2gbB1DsirSLX9l7oCeq9X1wcuYsPJG0mRR106kwAMqpyD6k7vfcFjg0r/mqBJHYOfMEiXIR4ISuVIj/JG6Jb1qYE=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054476; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=vMlkGiuGcxaWfLc66KQ7uFjoPq32SrNVLlk/N0KOM60=; 
	b=NGq0XhVOBECsmQ6LU85OvMFXVEPB9xNZ1U9G0ZnqmUu7ncfoN53tMnfbcwekmMhp5i08d9AoQkcl3J4IVdlQnkLF5nLqEuy+VrMg8XgEyD1eSfUtfC48BUcGRqDB7Q64hZBOIoZ/wPEPrC4DYrjwso+lM0Ya7t0fOCATB3MwTBY=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054476;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=vMlkGiuGcxaWfLc66KQ7uFjoPq32SrNVLlk/N0KOM60=;
	b=Q7/nsgQyLuK3bygbmw0vF7wqJhUdup2FoXX66y36jqPe03uVNLFpT1+U6DdIADwy
	AlXAp227+zkOpIJHGZc5iqJNQlWpzYH378zrS8RA3hOFL00XsUf1443Pgwh6nyiDl47
	mobJUlJlHT9l1yKrNKpCHE7dC6msK/PvbqzkUEcM=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 13/44] x86/boot: update struct boot_module on module relocation
Date: Fri, 30 Aug 2024 17:46:58 -0400
Message-Id: <20240830214730.1621-14-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

When a boot module is relocated, ensure struct boot_module start and size
fields are updated along with early_mod.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/setup.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 021c5699f86c..27517d24b2ea 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1408,8 +1408,10 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
          * respective reserve_e820_ram() invocation below. No need to
          * query efi_boot_mem_unused() here, though.
          */
-        boot_info->mods[idx].early_mod->mod_start = virt_to_mfn(_stext);
-        boot_info->mods[idx].early_mod->mod_end = __2M_rwdata_end - _stext;
+        boot_info->mods[idx].start = boot_info->mods[idx].early_mod->mod_start
+                                   = virt_to_mfn(_stext);
+        boot_info->mods[idx].size = boot_info->mods[idx].early_mod->mod_end
+                                  = __2M_rwdata_end - _stext;
     }
 
     boot_info->mods[0].headroom = bzimage_headroom(
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:53 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:53 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786836.1196644 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bx-0001vn-TH; Fri, 30 Aug 2024 21:56:53 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786836.1196644; Fri, 30 Aug 2024 21:56:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9bx-0001v6-NO; Fri, 30 Aug 2024 21:56:53 +0000
Received: by outflank-mailman (input) for mailman id 786836;
 Fri, 30 Aug 2024 21:56:52 +0000
Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254]
 helo=se1-gles-sth1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9UE-00065G-M1
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:48:54 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id a554d6ac-6719-11ef-a0b1-8be0dac302b0;
 Fri, 30 Aug 2024 23:48:53 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 172505446971316.97653174204663;
 Fri, 30 Aug 2024 14:47:49 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: a554d6ac-6719-11ef-a0b1-8be0dac302b0
ARC-Seal: i=1; a=rsa-sha256; t=1725054471; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=hHj7CnoyPUwHL2we26yrGRBkLa+C6Tfl+J2xTIeFDxw04Gh5hyGvL8FtkCH0ii1VirKxvnOEd43qMLBka8KNihEdeVAgldD/Vp2yN6/w6EW2O6Tumu/oh7iM9TBaa9q6PqrPzJLE2YydT/ydXLdtkBgT7kkb6Xwyn2PGRzX/PeY=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054471; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=Rr9hHCtWc2lrRTZc+Cw5XDkXel6MHlg11c0GsYwyIeY=; 
	b=mJKWP48CQM2TVPXSnpmc6D6RvEmbtJbe/V8AePBbOwTgu5+yBMyl7JC6v6KUqFrTyR3/mUwgO9cZnYus0RHlIje0xZ17e5ew5YOCPybBBmmY/Z+XmnliPkkJvJ2J4OEqBLPd3P/xxzGDrcxgPx/SNVpLrlTjpMbedOmUss0+I7U=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054471;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=Rr9hHCtWc2lrRTZc+Cw5XDkXel6MHlg11c0GsYwyIeY=;
	b=DzIWdZhCLOVB5scc2EYji95CnsXAZG5GMStqp6sZ5SQqgiHzPD19Pnf8WqC2dXL6
	VTmNJqTQfYCb+eb+O0/QC3qrfVzo3r4xxpfDntVkWBTBojXyYItS3nU34BtCQxEIbRi
	Ul7nGtap4QYWs/4eM6QZ8KVicBxP8FT9R3YvO00w=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	"Daniel P . Smith" <dpsmith@apertussolutions.com>,
	Jan Beulich <jbeulich@suse.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 09/44] x86/boot: split bootstrap_map_addr() out of bootstrap_map()
Date: Fri, 30 Aug 2024 17:46:54 -0400
Message-Id: <20240830214730.1621-10-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

From: Andrew Cooper <andrew.cooper3@citrix.com>

Using an interface based on addresses directly, not modules.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/setup.h |  1 +
 xen/arch/x86/setup.c             | 19 +++++++++++++------
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/include/asm/setup.h b/xen/arch/x86/include/asm/setup.h
index d75589178b91..15dcb62cb5ac 100644
--- a/xen/arch/x86/include/asm/setup.h
+++ b/xen/arch/x86/include/asm/setup.h
@@ -34,6 +34,7 @@ void setup_io_bitmap(struct domain *d);
 
 unsigned long initial_images_nrpages(nodeid_t node);
 void discard_initial_images(void);
+void *bootstrap_map_addr(uint64_t start, uint64_t end);
 void *bootstrap_map(const module_t *mod);
 
 int remove_xen_ranges(struct rangeset *r);
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 82a4375683d2..d4f557b4c50d 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -436,24 +436,22 @@ static void __init normalise_cpu_order(void)
  * Ensure a given physical memory range is present in the bootstrap mappings.
  * Use superpage mappings to ensure that pagetable memory needn't be allocated.
  */
-void *__init bootstrap_map(const module_t *mod)
+void *__init bootstrap_map_addr(uint64_t start, uint64_t end)
 {
     static unsigned long __initdata map_cur = BOOTSTRAP_MAP_BASE;
-    uint64_t start, end, mask = (1L << L2_PAGETABLE_SHIFT) - 1;
+    uint64_t mask = (1L << L2_PAGETABLE_SHIFT) - 1;
     void *ret;
 
     if ( system_state != SYS_STATE_early_boot )
-        return mod ? mfn_to_virt(mod->mod_start) : NULL;
+        return end ? maddr_to_virt(start) : NULL;
 
-    if ( !mod )
+    if ( !end )
     {
         destroy_xen_mappings(BOOTSTRAP_MAP_BASE, BOOTSTRAP_MAP_LIMIT);
         map_cur = BOOTSTRAP_MAP_BASE;
         return NULL;
     }
 
-    start = (uint64_t)mod->mod_start << PAGE_SHIFT;
-    end = start + mod->mod_end;
     if ( start >= end )
         return NULL;
 
@@ -469,6 +467,15 @@ void *__init bootstrap_map(const module_t *mod)
     return ret;
 }
 
+void *__init bootstrap_map(const module_t *mod)
+{
+    if ( !mod )
+        return bootstrap_map_addr(0, 0);
+
+    return bootstrap_map_addr(pfn_to_paddr(mod->mod_start),
+                              pfn_to_paddr(mod->mod_start) + mod->mod_end);
+}
+
 static void __init move_memory(
     uint64_t dst, uint64_t src, unsigned int size)
 {
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786843.1196654 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9c1-0002ky-8U; Fri, 30 Aug 2024 21:56:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786843.1196654; Fri, 30 Aug 2024 21:56:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9c1-0002jz-3u; Fri, 30 Aug 2024 21:56:57 +0000
Received: by outflank-mailman (input) for mailman id 786843;
 Fri, 30 Aug 2024 21:56:55 +0000
Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50]
 helo=se1-gles-flk1.inumbo.com)
 by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from
 <SRS0=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Wt-0000Zf-HG
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:51:39 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 0776c7e4-671a-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:51:37 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054493481659.7029863364719;
 Fri, 30 Aug 2024 14:48:13 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 0776c7e4-671a-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054495; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=BUNATfUWScvd3LlCBz3oxWB4klY/a/ZFb0WrEEDkSF1GeZbYQ4cx7aKlbgUepwKpLrjCafVTI3ekJXbpJ8NMG4L8Aci498e7XlzGhrGpy4vhnpkkMOV4W1zNMwcu+9ApTU2BPuTbieZo3wytTXmmtAt5eP4ndwqAXkM77MEg1vk=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054495; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=eI2uOeGg/sx1MKwSvVvpZfm5vXW9RsarhqsgbbBK1us=; 
	b=SuKImHLz4umEcAcUr/53zbcU+rZYyhC59Ls2qWQlTDMotkWNlUjgsRg2cc43J6+Cr2OtYrl3qBPR6k/NE+7fL/mQax7RhPy7pS7Q3SsI64nioQ4XQbFEq1tkAg900G6jnlyYWlqH3jHvZX4OPrsg5OlbJacurXIZXnC0gNU5Ytw=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054495;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=eI2uOeGg/sx1MKwSvVvpZfm5vXW9RsarhqsgbbBK1us=;
	b=uqc1l1dU+Rth/KAcN0NmNpMZpz42q7mguQYej0hai0CntRWZ1sIUhkcFCLPOgKrN
	AU+xWY0U7N3P2x9d8iPIWU4WzF5UCe33b7lbt1mNuukzkq6WTsPR9gTKMRa0O9tFnND
	h5TiCNPIIFMfJgxVBoGpDJYsIVOkVyg+p+ivSwyw=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 31/44] x86/boot: convert dom0_construct_pvh to struct boot_module
Date: Fri, 30 Aug 2024 17:47:16 -0400
Message-Id: <20240830214730.1621-32-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

This changes both the kernel and ramdisk parameters over to struct
boot_module.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/dom0_build.c             |  2 +-
 xen/arch/x86/hvm/dom0_build.c         | 11 +++++------
 xen/arch/x86/include/asm/dom0_build.h |  7 +++----
 3 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index c39588b346b0..71b2e3afc1a1 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -610,7 +610,7 @@ int __init construct_dom0(struct domain *d, const struct boot_module *image,
     process_pending_softirqs();
 
     if ( is_hvm_domain(d) )
-        rc = dom0_construct_pvh(d, image->early_mod, image->headroom, initrd->early_mod, cmdline);
+        rc = dom0_construct_pvh(d, image, initrd, cmdline);
     else if ( is_pv_domain(d) )
         rc = dom0_construct_pv(d, image, initrd, cmdline);
     else
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index f3eddb684686..1579034ebfc0 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1285,10 +1285,9 @@ static void __hwdom_init pvh_setup_mmcfg(struct domain *d)
     }
 }
 
-int __init dom0_construct_pvh(struct domain *d, const module_t *image,
-                              unsigned long image_headroom,
-                              module_t *initrd,
-                              const char *cmdline)
+int __init dom0_construct_pvh(
+    struct domain *d, const struct boot_module *image,
+    struct boot_module *initrd, const char *cmdline)
 {
     paddr_t entry, start_info;
     int rc;
@@ -1332,8 +1331,8 @@ int __init dom0_construct_pvh(struct domain *d, const module_t *image,
         return rc;
     }
 
-    rc = pvh_load_kernel(d, image, image_headroom, initrd, bootstrap_map(image),
-                         cmdline, &entry, &start_info);
+    rc = pvh_load_kernel(d, image->early_mod, image->headroom, initrd->early_mod,
+                         bootstrap_map_bm(image), cmdline, &entry, &start_info);
     if ( rc )
     {
         printk("Failed to load Dom0 kernel\n");
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index 2ce5ea3851af..8f7b37f3d308 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -17,10 +17,9 @@ int dom0_construct_pv(
     struct domain *d, const struct boot_module *image,
     struct boot_module *initrd, const char *cmdline);
 
-int dom0_construct_pvh(struct domain *d, const module_t *image,
-                       unsigned long image_headroom,
-                       module_t *initrd,
-                       const char *cmdline);
+int dom0_construct_pvh(
+    struct domain *d, const struct boot_module *image,
+    struct boot_module *initrd, const char *cmdline);
 
 unsigned long dom0_paging_pages(const struct domain *d,
                                 unsigned long nr_pages);
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:56:58 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:56:58 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786847.1196658 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9c1-0002uA-Pu; Fri, 30 Aug 2024 21:56:57 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786847.1196658; Fri, 30 Aug 2024 21:56:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9c1-0002sW-JU; Fri, 30 Aug 2024 21:56:57 +0000
Received: by outflank-mailman (input) for mailman id 786847;
 Fri, 30 Aug 2024 21:56: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9Wm-0000Zf-CF
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:51:32 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 032ce5b5-671a-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:51:30 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054492373987.601800935306;
 Fri, 30 Aug 2024 14:48:12 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 032ce5b5-671a-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054494; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=JuHcrUfitLx/+Erxf4iWnnj0eub3kVaT0caTtDwSooGvJGSdrl7DdCq8KuCW+Nl8oum3LT10RfhomYGH1UD7iMEW9MO9mmYFaN5RxzgqV6OSVGLMLh3w1uX7JW4gcj1cf2XkcyEoAouyx5E7V9bKgQhYAXwB7HdIwmhJPJWFV6o=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054494; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=Uco3P2nZt+b7+Lgo/+TlzWVF3igUfsGLOahtS9BrSXY=; 
	b=C/4A7iLKTQX1xnrQLTHGlBwd4vTHtIHOSz3isZVxXR09a+sH61okdKgPQUI4AQ8oRZRThtE7KsowLlQG+T7rPvIhVN3g+avuUsbl/+TGD2KlZ28eGT3OlpjTKG/2G78eakoaGvGR72Fm9jfVtwhZCYyAlj5EoScKTSYu2vHJT/A=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054494;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=Uco3P2nZt+b7+Lgo/+TlzWVF3igUfsGLOahtS9BrSXY=;
	b=AD9sgbWVjCjLa0y/0Oa6d5wKkUO6C8X54qDNS/S4/j8bmT42MipbVvTaTgQQHSNL
	5mlFsdxRAYabaOJUhKO8XABaqmym0bRVa/y4m86HBEQC8PCNjIN8lBQO9WpRxAFG1gM
	ws+1Z5mjj2c6r57Y6RVfDad8G4WbHmAWYKE8If+s=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 30/44] x86/boot: convert dom0_construct_pv initrd param to struct boot_module
Date: Fri, 30 Aug 2024 17:47:15 -0400
Message-Id: <20240830214730.1621-31-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

This changes the type for the initrd parameter of dom0_construct_pv to be struct
boot_module. This conversion requires several adjustments throughout dom0_construct_pv
to account for the type change. Removes the usage of early_mod field for ramdisk module.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/dom0_build.c             |  2 +-
 xen/arch/x86/include/asm/dom0_build.h |  2 +-
 xen/arch/x86/pv/dom0_build.c          | 19 ++++++++++---------
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c
index 42043230faff..c39588b346b0 100644
--- a/xen/arch/x86/dom0_build.c
+++ b/xen/arch/x86/dom0_build.c
@@ -612,7 +612,7 @@ int __init construct_dom0(struct domain *d, const struct boot_module *image,
     if ( is_hvm_domain(d) )
         rc = dom0_construct_pvh(d, image->early_mod, image->headroom, initrd->early_mod, cmdline);
     else if ( is_pv_domain(d) )
-        rc = dom0_construct_pv(d, image, initrd->early_mod, cmdline);
+        rc = dom0_construct_pv(d, image, initrd, cmdline);
     else
         panic("Cannot construct Dom0. No guest interface available\n");
 
diff --git a/xen/arch/x86/include/asm/dom0_build.h b/xen/arch/x86/include/asm/dom0_build.h
index a1f36f7d360d..2ce5ea3851af 100644
--- a/xen/arch/x86/include/asm/dom0_build.h
+++ b/xen/arch/x86/include/asm/dom0_build.h
@@ -15,7 +15,7 @@ int dom0_setup_permissions(struct domain *d);
 
 int dom0_construct_pv(
     struct domain *d, const struct boot_module *image,
-    module_t *initrd, const char *cmdline);
+    struct boot_module *initrd, const char *cmdline);
 
 int dom0_construct_pvh(struct domain *d, const module_t *image,
                        unsigned long image_headroom,
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index db908ddb78b5..dce62d76e41e 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -356,7 +356,7 @@ static struct page_info * __init alloc_chunk(struct domain *d,
 
 int __init dom0_construct_pv(struct domain *d,
                              const struct boot_module *image,
-                             module_t *initrd,
+                             struct boot_module *initrd,
                              const char *cmdline)
 {
     int i, rc, order, machine;
@@ -376,7 +376,7 @@ int __init dom0_construct_pv(struct domain *d,
     void *image_base = bootstrap_map_bm(image);
     unsigned long image_len = image->size;
     void *image_start = image_base + image->headroom;
-    unsigned long initrd_len = initrd ? initrd->mod_end : 0;
+    unsigned long initrd_len = initrd ? initrd->size : 0;
     l4_pgentry_t *l4tab = NULL, *l4start = NULL;
     l3_pgentry_t *l3tab = NULL, *l3start = NULL;
     l2_pgentry_t *l2tab = NULL, *l2start = NULL;
@@ -612,7 +612,7 @@ int __init dom0_construct_pv(struct domain *d,
         initrd_pfn = vinitrd_start ?
                      (vinitrd_start - v_start) >> PAGE_SHIFT :
                      domain_tot_pages(d);
-        initrd_mfn = mfn = initrd->mod_start;
+        initrd_mfn = mfn = initrd->start >> PAGE_SHIFT;
         count = PFN_UP(initrd_len);
         if ( d->arch.physaddr_bitsize &&
              ((mfn + count - 1) >> (d->arch.physaddr_bitsize - PAGE_SHIFT)) )
@@ -627,12 +627,13 @@ int __init dom0_construct_pv(struct domain *d,
                     free_domheap_pages(page, order);
                     page += 1UL << order;
                 }
-            memcpy(page_to_virt(page), mfn_to_virt(initrd->mod_start),
+            memcpy(page_to_virt(page), maddr_to_virt(initrd->start),
                    initrd_len);
-            mpt_alloc = (paddr_t)initrd->mod_start << PAGE_SHIFT;
+            mpt_alloc = initrd->start;
             init_domheap_pages(mpt_alloc,
                                mpt_alloc + PAGE_ALIGN(initrd_len));
-            initrd->mod_start = initrd_mfn = mfn_x(page_to_mfn(page));
+            initrd_mfn = mfn_x(page_to_mfn(page));
+            initrd->start = initrd_mfn << PAGE_SHIFT;
         }
         else
         {
@@ -640,7 +641,7 @@ int __init dom0_construct_pv(struct domain *d,
                 if ( assign_pages(mfn_to_page(_mfn(mfn++)), 1, d, 0) )
                     BUG();
         }
-        initrd->mod_end = 0;
+        initrd->size = initrd->early_mod->mod_end = 0;
 
         iommu_memory_setup(d, "initrd", mfn_to_page(_mfn(initrd_mfn)),
                            PFN_UP(initrd_len), &flush_flags);
@@ -654,7 +655,7 @@ int __init dom0_construct_pv(struct domain *d,
                nr_pages - domain_tot_pages(d));
     if ( initrd )
     {
-        mpt_alloc = (paddr_t)initrd->mod_start << PAGE_SHIFT;
+        mpt_alloc = initrd->start;
         printk("\n Init. ramdisk: %"PRIpaddr"->%"PRIpaddr,
                mpt_alloc, mpt_alloc + initrd_len);
     }
@@ -882,7 +883,7 @@ int __init dom0_construct_pv(struct domain *d,
         if ( pfn >= initrd_pfn )
         {
             if ( pfn < initrd_pfn + PFN_UP(initrd_len) )
-                mfn = initrd->mod_start + (pfn - initrd_pfn);
+                mfn = (initrd->start >> PAGE_SHIFT) + (pfn - initrd_pfn);
             else
                 mfn -= PFN_UP(initrd_len);
         }
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:57:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:57:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786848.1196674 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9c4-0003iI-Ak; Fri, 30 Aug 2024 21:57:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786848.1196674; Fri, 30 Aug 2024 21:57:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9c4-0003g7-4M; Fri, 30 Aug 2024 21:57:00 +0000
Received: by outflank-mailman (input) for mailman id 786848;
 Fri, 30 Aug 2024 21:56: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9WX-0000Zf-8B
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:51:17 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id fa2e6891-6719-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:51:15 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054490245563.5309767248942;
 Fri, 30 Aug 2024 14:48:10 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: fa2e6891-6719-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054492; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=ghvdmCfKW1U3wg9sVOKivTQYdsa4a+eHSWZbKhe1gp+AXBzi0edi04NBOH3kYlmAri4dAD5BPM0ldjJ8uripVNYruJja0N/j8dff+YEZ4nPSAj5x5YxvD3Gdeu07RMiRMJkuUIOp6b/RedOvoRDGWOdXRDkwIIuW+6+cS9X6s4k=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054492; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=hWh29eRgG/vTUY/4IatoM48RmM3sftffSEOld+XbhDI=; 
	b=Tr+i9P/YXYznZyn71L/95qgtkaHyFBTrLY5OPGGgqsgCjPWE42b96OHPGF88kO3q0fejsa4/Xep2LeNDBkARAUzTee+22PZ+BawUKpYDCdERtsAP0OH0mqzkqkiQFsfIPthO5Jf1Y+/JfqU/u07zo2sCy2LWgsdoAtOr7Fn90Zo=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054492;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=hWh29eRgG/vTUY/4IatoM48RmM3sftffSEOld+XbhDI=;
	b=Yd1s04nq0GCD9bo1FakYxpkA6AFbm7mrguZ6tktaABvdGIbhO2M/s1BdhdPhy8Jl
	aFciKfh2G7AQ9SkyDMPbHCvtLxxEwst0oBOIDVSjf39ouV78sQw3BITvniN9iRJ23pL
	2Wf6q5yomLNCQlbmtzdoBWP58apA1yxQ+8LS9PIo=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 28/44] x86/boot: add cmdline to struct boot_module
Date: Fri, 30 Aug 2024 17:47:13 -0400
Message-Id: <20240830214730.1621-29-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

Add a char pointer field, cmdline, to struct boot_module to hold the address
pointed to by the string field of struct mod. This removes the need to use the
early_mod field to get to the dom0 kernel command line.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/include/asm/bootinfo.h | 2 ++
 xen/arch/x86/setup.c                | 9 ++++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/bootinfo.h b/xen/arch/x86/include/asm/bootinfo.h
index 06b3ecaf7bec..edd5c435d032 100644
--- a/xen/arch/x86/include/asm/bootinfo.h
+++ b/xen/arch/x86/include/asm/bootinfo.h
@@ -30,6 +30,8 @@ struct boot_module {
 #define BOOTMOD_FLAG_X86_RELOCATED     (1U << 0)
 #define BOOTMOD_FLAG_X86_CONSUMED      (1U << 1)
 
+    const char *cmdline;
+
     paddr_t start;
     size_t size;
 };
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 76f25e9d620c..8ba32c6b6bfa 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -314,6 +314,8 @@ static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
     {
         boot_mods[i].early_mod = &mods[i];
 
+        boot_mods[i].cmdline = (char *)(paddr_t)mods[i].string;
+
         boot_mods[i].start = (paddr_t)mods[i].mod_start;
         boot_mods[i].size = mods[i].mod_end - mods[i].mod_start;
     }
@@ -1000,10 +1002,11 @@ static struct domain *__init create_dom0(const struct boot_info *bi)
         panic("Error creating d%uv0\n", domid);
 
     /* Grab the DOM0 command line. */
-    if ( image->early_mod->string || bi->kextra )
+    if ( image->cmdline || bi->kextra )
     {
-        if ( image->early_mod->string )
-            safe_strcpy(cmdline, cmdline_cook(__va(image->early_mod->string),
+        if ( image->cmdline )
+            safe_strcpy(cmdline,
+                        cmdline_cook(__va((unsigned long)image->cmdline),
                         bi->boot_loader_name));
 
         if ( bi->kextra )
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 21:57:01 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 21:57:01 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786849.1196680 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9c4-0003n8-RM; Fri, 30 Aug 2024 21:57:00 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786849.1196680; Fri, 30 Aug 2024 21:57:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9c4-0003ml-Jz; Fri, 30 Aug 2024 21:57:00 +0000
Received: by outflank-mailman (input) for mailman id 786849;
 Fri, 30 Aug 2024 21:56: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=KiG6=P5=apertussolutions.com=dpsmith@srs-se1.protection.inumbo.net>)
 id 1sk9X8-0000Zf-E8
 for xen-devel@lists.xenproject.org; Fri, 30 Aug 2024 21:51:54 +0000
Received: from sender4-of-o51.zoho.com (sender4-of-o51.zoho.com
 [136.143.188.51]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS
 id 105c3a69-671a-11ef-99a1-01e77a169b0f;
 Fri, 30 Aug 2024 23:51:52 +0200 (CEST)
Delivered-To: dpsmith@apertussolutions.com
Received: by mx.zohomail.com with SMTPS id 1725054495605114.11610584368918;
 Fri, 30 Aug 2024 14:48:15 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: 105c3a69-671a-11ef-99a1-01e77a169b0f
ARC-Seal: i=1; a=rsa-sha256; t=1725054497; cv=none; 
	d=zohomail.com; s=zohoarc; 
	b=Gcr2dQXwBERTqwQcwuFqX+lzCerzO8XkQcP00CFR8FHA7WkZsU5OZl/tSbJ6xokX8yIQaqPwbKPnnKSFU3+FDmPYrroMmTT7EIbRSB1hCj1B2F7Dqdp6jIvuHC+d1QeaBg3Wg3PbaQgGy6VBirYlHZG+6LOLWAGblN6I4dvpv+w=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; 
	t=1725054497; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; 
	bh=mt1dRXz36GBmL3hIsTAQ0JnOmkyCwzbvQkCGLSUmMkc=; 
	b=FJ8YmX0BEzPNKHpNrYWufWrkbbnWhojfiAR5cey0btEdiFOHYip0W0ffEuvAY174ypyu2eOCRDns8f6ZAfNj3oLNotBXqL0kwk3GA5ts+k1c4PfDBkejJF2nJSZff5K5FHNqp8fEXbmnhLDygJa+DA0p+3oB4EXKiyQwHbTQzfM=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=pass  header.i=apertussolutions.com;
	spf=pass  smtp.mailfrom=dpsmith@apertussolutions.com;
	dmarc=pass header.from=<dpsmith@apertussolutions.com>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1725054497;
	s=zoho; d=apertussolutions.com; i=dpsmith@apertussolutions.com;
	h=From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:Message-Id:Message-Id:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Reply-To;
	bh=mt1dRXz36GBmL3hIsTAQ0JnOmkyCwzbvQkCGLSUmMkc=;
	b=udtZAvomEEfPM104ld7VCW2/Vcvybqvg17RTZGeXlJUmmEtv78yAg9+YoYmY5I0b
	nFjPqtKy6uhuyaFQdP8t+XcumC4aBwlLf+vkU9uSeeMaiY7Y7YAGuCN7JJODmzftQRb
	uRl3pd0TEkpUAx1nw1gvZZVORxrF6uJCXzpTx3qY=
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: xen-devel@lists.xenproject.org
Cc: "Daniel P. Smith" <dpsmith@apertussolutions.com>,
	jason.andryuk@amd.com,
	christopher.w.clark@gmail.com,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	=?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= <roger.pau@citrix.com>
Subject: [PATCH v4 33/44] x86/boot: convert initial_images to struct boot_module
Date: Fri, 30 Aug 2024 17:47:18 -0400
Message-Id: <20240830214730.1621-34-dpsmith@apertussolutions.com>
X-Mailer: git-send-email 2.30.2
In-Reply-To: <20240830214730.1621-1-dpsmith@apertussolutions.com>
References: <20240830214730.1621-1-dpsmith@apertussolutions.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-ZohoMailClient: External

The variable initial_images is used for tracking the boot modules passed in by
the boot loader. Convert to a struct boot_module and adjust the code that uses
it accordingly.

Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
---
 xen/arch/x86/setup.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 8ba32c6b6bfa..77c0833dd441 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -281,7 +281,7 @@ static const char *cmdline_cook(const char *p, const char *loader_name);
 /* Max number of boot modules a bootloader can provide in addition to Xen */
 #define MAX_NR_BOOTMODS 63
 
-static const module_t *__initdata initial_images;
+static const struct boot_module *__initdata initial_images;
 static struct boot_info __initdata *boot_info;
 
 static void __init multiboot_to_bootinfo(multiboot_info_t *mbi, module_t *mods)
@@ -337,8 +337,9 @@ unsigned long __init initial_images_nrpages(nodeid_t node)
 
     for ( nr = i = 0; i < boot_info->nr_mods; ++i )
     {
-        unsigned long start = initial_images[i].mod_start;
-        unsigned long end = start + PFN_UP(initial_images[i].mod_end);
+        unsigned long start = initial_images[i].early_mod->mod_start;
+        unsigned long end = start +
+                            PFN_UP(initial_images[i].early_mod->mod_end);
 
         if ( end > node_start && node_end > start )
             nr += min(node_end, end) - max(node_start, start);
@@ -353,10 +354,12 @@ void __init discard_initial_images(void)
 
     for ( i = 0; i < boot_info->nr_mods; ++i )
     {
-        uint64_t start = (uint64_t)initial_images[i].mod_start << PAGE_SHIFT;
+        uint64_t start =
+            (uint64_t)initial_images[i].early_mod->mod_start << PAGE_SHIFT;
 
         init_domheap_pages(start,
-                           start + PAGE_ALIGN(initial_images[i].mod_end));
+                           start +
+                           PAGE_ALIGN(initial_images[i].early_mod->mod_end));
     }
 
     boot_info->nr_mods = 0;
@@ -1396,7 +1399,7 @@ void asmlinkage __init noreturn __start_xen(unsigned long mbi_p)
     set_kexec_crash_area_size((u64)nr_pages << PAGE_SHIFT);
     kexec_reserve_area();
 
-    initial_images = boot_info->mods[0].early_mod;
+    initial_images = boot_info->mods;
 
     for ( i = 0; !efi_enabled(EFI_LOADER) && i < boot_info->nr_mods; i++ )
     {
-- 
2.30.2



From xen-devel-bounces@lists.xenproject.org Fri Aug 30 22:15:00 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 22:15:00 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786922.1196693 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9tP-000371-KJ; Fri, 30 Aug 2024 22:14:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786922.1196693; Fri, 30 Aug 2024 22:14:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1sk9tP-00036u-HP; Fri, 30 Aug 2024 22:14:55 +0000
Received: by outflank-mailman (input) for mailman id 786922;
 Fri, 30 Aug 2024 22:14:53 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk9tN-00036k-SA; Fri, 30 Aug 2024 22:14:53 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk9tN-0000FO-Eh; Fri, 30 Aug 2024 22:14:53 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1sk9tN-0000bv-03; Fri, 30 Aug 2024 22:14:53 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1sk9tM-0000qG-Vr; Fri, 30 Aug 2024 22:14:52 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=APkFYbY049iafWwHD0X150UQeOvj0IYmXXaUIo3jZME=; b=crsn6FEhOUwcc7r4Rzd9sVn1An
	i7q3JxSRLQozJDv8n5M8RDmaNsr+sZhkswcnn+jOn/aeJqrN2f7GRmO5nLjlRUQ3MjfqlBpjFKU04
	ERttFPGMG7qf3HInbRSK1qTTMCU5nQsMw5xxLecbUinSzJOD4hKRaOaKiFPf/KLlHDtU=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187414-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [libvirt test] 187414: tolerable all pass - PUSHED
X-Osstest-Failures:
    libvirt:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-qcow2:saverestore-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    libvirt:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    libvirt:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    libvirt=76f6caee3c60e171e37eaa15772b02291d65011f
X-Osstest-Versions-That:
    libvirt=21562c4df6434dba9c6bece5096a37919c9075d1
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 22:14:52 +0000

flight 187414 libvirt real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187414/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187395
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt     16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-arm64-arm64-libvirt-qcow2 15 saverestore-support-check    fail never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass

version targeted for testing:
 libvirt              76f6caee3c60e171e37eaa15772b02291d65011f
baseline version:
 libvirt              21562c4df6434dba9c6bece5096a37919c9075d1

Last test of basis   187395  2024-08-29 04:18:48 Z    1 days
Testing same since   187414  2024-08-30 04:20:40 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrea Bolognani <abologna@redhat.com>
  Kamil Szczęk <kamil@szczek.dev>
  Peter Krempa <pkrempa@redhat.com>
  Yuri Chornoivan <yurchor@ukr.net>
  김인수 <simmon@nplob.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-libvirt                                     pass    
 test-arm64-arm64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-arm64-arm64-libvirt-qcow2                               pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/libvirt.git
   21562c4df6..76f6caee3c  76f6caee3c60e171e37eaa15772b02291d65011f -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Fri Aug 30 22:48:57 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Aug 2024 22:48:57 +0000
Received: from list by lists.xenproject.org with outflank-mailman.786981.1196704 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skAQ8-0007lG-1a; Fri, 30 Aug 2024 22:48:44 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 786981.1196704; Fri, 30 Aug 2024 22:48:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skAQ7-0007l9-Uz; Fri, 30 Aug 2024 22:48:43 +0000
Received: by outflank-mailman (input) for mailman id 786981;
 Fri, 30 Aug 2024 22:48:43 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skAQ7-0007kz-5j; Fri, 30 Aug 2024 22:48:43 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skAQ6-0000xb-Vn; Fri, 30 Aug 2024 22:48:42 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skAQ6-0001pt-Gw; Fri, 30 Aug 2024 22:48:42 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1skAQ6-0003eF-GU; Fri, 30 Aug 2024 22:48:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=hRTXuUxS3GyLErSej36rCspqauvOE7HstXLxNwtmsfg=; b=2o9Qe1z7DdFiHAxfuyb7KjKG8x
	GYfCcaJ8HqKZQRPzwnmH+YFxrZmpVgoaRWIw+PSKwLRdjP72JqCIJ6x+g0kYeHy5cmc2iI47yGonL
	NRqr56v2VqzRPTxXZyQbEfUHZbsHFr+I8wCEokyfKUMEiHZmdIqRFM92DThAXqj80egg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187428-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187428: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=f6092b5e2be20139393a58bf454fb000020a3918
X-Osstest-Versions-That:
    ovmf=0b0b7041cc6cab48479caeb4013f2a77b26b9b1d
From: osstest service owner <osstest-admin@xenproject.org>
Date: Fri, 30 Aug 2024 22:48:42 +0000

flight 187428 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187428/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 f6092b5e2be20139393a58bf454fb000020a3918
baseline version:
 ovmf                 0b0b7041cc6cab48479caeb4013f2a77b26b9b1d

Last test of basis   187425  2024-08-30 18:11:27 Z    0 days
Testing same since   187428  2024-08-30 20:43:23 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Chao Li <lichao@loongson.cn>
  Wei6 Xu <wei6.xu@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   0b0b7041cc..f6092b5e2b  f6092b5e2be20139393a58bf454fb000020a3918 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sat Aug 31 00:58:25 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Aug 2024 00:58:25 +0000
Received: from list by lists.xenproject.org with outflank-mailman.787016.1196714 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skCRP-0007Wa-8u; Sat, 31 Aug 2024 00:58:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 787016.1196714; Sat, 31 Aug 2024 00:58:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skCRP-0007WT-6C; Sat, 31 Aug 2024 00:58:11 +0000
Received: by outflank-mailman (input) for mailman id 787016;
 Sat, 31 Aug 2024 00:58:09 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skCRN-0007V4-KL; Sat, 31 Aug 2024 00:58:09 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skCRN-0003x1-A7; Sat, 31 Aug 2024 00:58:09 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skCRM-0005WQ-So; Sat, 31 Aug 2024 00:58:08 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1skCRM-0000Ip-SP; Sat, 31 Aug 2024 00:58:08 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=/llUpGpgt/bXlf1ekEaduG8/QqYgAdtGxH1LrIY5bDg=; b=kA3GT8ynOU8FCotPV46Tr4TmI4
	mZWugyF9AG8fQ9JCUlVQwgqrUgb0mDp4ekbCPY0ynz454rc53odChN2QcevqNHmQekd61NKTeukIu
	0qSoyoH1fP3f/7PYuB4oJhuUaAwYQrGCpP908TTn1owg9N3I1An2+3m/WFBlvviqhub0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187429-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187429: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=662272ef41fe848a6c0515de6b43e93d3dc5c672
X-Osstest-Versions-That:
    ovmf=f6092b5e2be20139393a58bf454fb000020a3918
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 31 Aug 2024 00:58:08 +0000

flight 187429 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187429/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 662272ef41fe848a6c0515de6b43e93d3dc5c672
baseline version:
 ovmf                 f6092b5e2be20139393a58bf454fb000020a3918

Last test of basis   187428  2024-08-30 20:43:23 Z    0 days
Testing same since   187429  2024-08-30 23:15:18 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Gerd Hoffmann <kraxel@redhat.com>
  Oliver Smith-Denny <osde@linux.microsoft.com>
  Oliver Smith-Denny <osde@microsoft.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   f6092b5e2b..662272ef41  662272ef41fe848a6c0515de6b43e93d3dc5c672 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sat Aug 31 01:24:03 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Aug 2024 01:24:03 +0000
Received: from list by lists.xenproject.org with outflank-mailman.787025.1196724 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skCqM-0002Fa-7h; Sat, 31 Aug 2024 01:23:58 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 787025.1196724; Sat, 31 Aug 2024 01:23:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skCqM-0002FT-4d; Sat, 31 Aug 2024 01:23:58 +0000
Received: by outflank-mailman (input) for mailman id 787025;
 Sat, 31 Aug 2024 01:23:56 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skCqK-0002FJ-UA; Sat, 31 Aug 2024 01:23:56 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skCqK-0003MR-OM; Sat, 31 Aug 2024 01:23:56 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skCqK-00069K-Eh; Sat, 31 Aug 2024 01:23:56 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1skCqK-0007r8-EA; Sat, 31 Aug 2024 01:23:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=m4scaf6+5FPlcU+jBnD5gb0Ddb85mkIzy6XO3DOpTNU=; b=aa0z7Z6XrfLMMQURZ7kWm37OaK
	rl+QXOYBhKJT7aMbaubG1uZF3lpdzx4MlggUoM9CMi049hwJmmxMrhUkciJyBNoSMVWzjeHH8PYJQ
	AvjIrtncggqZaKSvSC8j/O85LJhfJuztXtodyKLCd0yTGuOh0KjhRq1Ajh2Zn+1VKfV0=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187415-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187415: tolerable FAIL
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-xl-credit1:xen-boot:fail:heisenbug
    xen-unstable:test-armhf-armhf-xl-raw:host-ping-check-xen:fail:heisenbug
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=99f942f3d410059dc223ee0a908827e928ef3592
X-Osstest-Versions-That:
    xen=99f942f3d410059dc223ee0a908827e928ef3592
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 31 Aug 2024 01:23:56 +0000

flight 187415 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187415/

Failures :-/ but no regressions.

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl-credit1   8 xen-boot                   fail pass in 187405
 test-armhf-armhf-xl-raw      10 host-ping-check-xen        fail pass in 187405

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-xl-credit1 15 migrate-support-check fail in 187405 never pass
 test-armhf-armhf-xl-credit1 16 saverestore-support-check fail in 187405 never pass
 test-armhf-armhf-xl-raw     14 migrate-support-check fail in 187405 never pass
 test-armhf-armhf-xl-raw 15 saverestore-support-check fail in 187405 never pass
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187405
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187405
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187405
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187405
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187405
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187405
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  99f942f3d410059dc223ee0a908827e928ef3592
baseline version:
 xen                  99f942f3d410059dc223ee0a908827e928ef3592

Last test of basis   187415  2024-08-30 05:21:05 Z    0 days
Testing same since                          (not found)         0 attempts

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  fail    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      fail    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Published tested tree is already up to date.



From xen-devel-bounces@lists.xenproject.org Sat Aug 31 03:15:32 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Aug 2024 03:15:32 +0000
Received: from list by lists.xenproject.org with outflank-mailman.787087.1196734 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skEa5-0005KZ-WF; Sat, 31 Aug 2024 03:15:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 787087.1196734; Sat, 31 Aug 2024 03:15:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skEa5-0005KS-TQ; Sat, 31 Aug 2024 03:15:17 +0000
Received: by outflank-mailman (input) for mailman id 787087;
 Sat, 31 Aug 2024 03:15:16 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skEa4-0005KI-EJ; Sat, 31 Aug 2024 03:15:16 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skEa4-0005hG-A4; Sat, 31 Aug 2024 03:15:16 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skEa4-0000hi-33; Sat, 31 Aug 2024 03:15:16 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1skEa4-00047z-2X; Sat, 31 Aug 2024 03:15:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=juPcg3HdKvv7xatuy4LYYjOL3bSUg7OAnkdS4P+ODYE=; b=qrmhAcOIxgJUzqsAUojYeiEJvW
	BH2FYzKOVa90KcAV1dEwDI90ZGY3i59QNk+zfjnimLCfpaLqAP72hRssIyOR1JRRUVWxQxCLtGqFn
	FpBSo4NN9NMbckNZnPMKRnfHlgilxCTiMwvxftaaV5QGBbHlLLbeqHqlsVfpj/Eyekb8=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187430-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187430: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=5c63e22a9fe268bdfa18d49419cbf43d4ec65b93
X-Osstest-Versions-That:
    ovmf=662272ef41fe848a6c0515de6b43e93d3dc5c672
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 31 Aug 2024 03:15:16 +0000

flight 187430 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187430/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 5c63e22a9fe268bdfa18d49419cbf43d4ec65b93
baseline version:
 ovmf                 662272ef41fe848a6c0515de6b43e93d3dc5c672

Last test of basis   187429  2024-08-30 23:15:18 Z    0 days
Testing same since   187430  2024-08-31 01:11:30 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Dionna Glaze <dionnaglaze@google.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   662272ef41..5c63e22a9f  5c63e22a9fe268bdfa18d49419cbf43d4ec65b93 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sat Aug 31 05:04:38 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Aug 2024 05:04:38 +0000
Received: from list by lists.xenproject.org with outflank-mailman.787098.1196744 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skGHY-0007AF-IO; Sat, 31 Aug 2024 05:04:16 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 787098.1196744; Sat, 31 Aug 2024 05:04:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skGHY-0007A8-Ez; Sat, 31 Aug 2024 05:04:16 +0000
Received: by outflank-mailman (input) for mailman id 787098;
 Sat, 31 Aug 2024 05:04:14 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skGHW-00079B-Hm; Sat, 31 Aug 2024 05:04:14 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skGHW-0008Ff-35; Sat, 31 Aug 2024 05:04:14 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skGHV-0006wX-Aa; Sat, 31 Aug 2024 05:04:13 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1skGHV-0004yE-A1; Sat, 31 Aug 2024 05:04:13 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=Yb5n3s4Bz8Bt+UG5np0m1r+kzbvSaYQTTkRbHX+JVVI=; b=N/ktWrJ5CnDrFUF+MgljD7KEi0
	92L82Sat859Le51aXrhVagq3q2PinxwN+5JNQ8/4JHqRzq034kdm6FmvUpKEe21zyn0104UG8eyPi
	+D7T+coefZhKM6m4plbhtkWsDi+Cs2NGdY48BvCdbvVCDMCgk1K3uAGutaOh0YnIM5xw=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187432-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187432: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=90d861f63d0fe467cec9659703f02d3d32969dc3
X-Osstest-Versions-That:
    ovmf=5c63e22a9fe268bdfa18d49419cbf43d4ec65b93
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 31 Aug 2024 05:04:13 +0000

flight 187432 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187432/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 90d861f63d0fe467cec9659703f02d3d32969dc3
baseline version:
 ovmf                 5c63e22a9fe268bdfa18d49419cbf43d4ec65b93

Last test of basis   187430  2024-08-31 01:11:30 Z    0 days
Testing same since   187432  2024-08-31 03:19:43 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Ard Biesheuvel <ardb@kernel.org>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   5c63e22a9f..90d861f63d  90d861f63d0fe467cec9659703f02d3d32969dc3 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sat Aug 31 07:16:17 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Aug 2024 07:16:17 +0000
Received: from list by lists.xenproject.org with outflank-mailman.787120.1196754 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skIKx-0006xe-Gu; Sat, 31 Aug 2024 07:15:55 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 787120.1196754; Sat, 31 Aug 2024 07:15:55 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skIKx-0006xX-EM; Sat, 31 Aug 2024 07:15:55 +0000
Received: by outflank-mailman (input) for mailman id 787120;
 Sat, 31 Aug 2024 07:15:54 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skIKw-0006xN-52; Sat, 31 Aug 2024 07:15:54 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skIKv-0002fQ-Rk; Sat, 31 Aug 2024 07:15:53 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skIKv-00022Q-Ey; Sat, 31 Aug 2024 07:15:53 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1skIKv-00010F-EY; Sat, 31 Aug 2024 07:15:53 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=qkSAKcF5hp1oBtYdeNLkWh/ilZMhO5OOTKEQheLp3pw=; b=BSP8gCI6oBy8VEoJTEcJIbGTHT
	0O8jL38I9Xl5Jo1/1VGvrSI8m3TkgOaBNSFlcJblDlKnEVx8Hd7dVrsj0LPTdrVvAKTWB7jIslZfM
	2jgHzHGep5ekddJjDWUbWDNyi0iDiJidXB6EiaqVpufXkWKLriS4+/YhS/vdvVmRgODo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187427-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187427: tolerable FAIL - PUSHED
X-Osstest-Failures:
    linux-linus:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=fb24560f31f9dff2c97707cfed6029bfebebaf1c
X-Osstest-Versions-That:
    linux=1b5fe53681d9c388f1600310fe3488091701d4d0
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 31 Aug 2024 07:15:53 +0000

flight 187427 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187427/

Failures :-/ but no regressions.

Tests which did not succeed, but are not blocking:
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187412
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187412
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187412
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187412
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187412
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187412
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                fb24560f31f9dff2c97707cfed6029bfebebaf1c
baseline version:
 linux                1b5fe53681d9c388f1600310fe3488091701d4d0

Last test of basis   187412  2024-08-30 01:43:43 Z    1 days
Testing same since   187427  2024-08-30 18:54:48 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Abel Vesa <abel.vesa@linaro.org>
  Alex Deucher <alexander.deucher@amd.com>
  Alex Williamson <alex.williamson@redhat.com>
  Andy Shevchenko <andy@kernel.org>
  Benjamin Coddington <bcodding@redhat.com>
  Candice Li <candice.li@amd.com>
  Casey Schaufler <casey@schaufler-ca.com>
  Dan Carpenter <dan.carpenter@linaro.org>
  Dave Airlie <airlied@redhat.com>
  Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com>
  Gautham R. Shenoy <gautham.shenoy@amd.com>
  Hans de Goede <hdegoede@redhat.com>
  Imre Deak <imre.deak@intel.com>
  Jani Nikula <jani.nikula@intel.com>
  Jason Gunthorpe <jgg@nvidia.com>
  Joerg Roedel <jroedel@suse.de>
  John Harrison <John.C.Harrison@Intel.com>
  Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
  Karthik Poosa <karthik.poosa@intel.com>
  Kees Cook <kees@kernel.org>
  Kenneth Feng <kenneth.feng@amd.com>
  Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
  Lijo Lazar <lijo.lazar@amd.com>
  Likun Gao <Likun.Gao@amd.com>
  Linus Torvalds <torvalds@linux-foundation.org>
  Lu Baolu <baolu.lu@linux.intel.com>
  Ma Ke <make24@iscas.ac.cn>
  Mario Limonciello <mario.limonciello@amd.com>
  Matthew Brost <matthew.brost@intel.com>
  Maxime Ripard <mripard@redhat.com>
  Maíra Canal <mcanal@igalia.com>
  Mrinmay Sarkar <quic_msarkar@quicinc.com>
  Paul Moore <paul@paul-moore.com>
  Piyush Mehta <piyush.mehta@amd.com>
  Pranjal Shrivastava <praan@google.com>
  Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
  Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  Rodrigo Vivi <rodrigo.vivi@intel.com>
  Scott Mayhew <smayhew@redhat.com>
  Serge Semin <fancer.lancer@gmail.com>
  Stephen Smalley <stephen.smalley.work@gmail.com>
  Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
  Vinod Koul <vkoul@kernel.org>
  Will Deacon <will@kernel.org>
  Xu Yang <xu.yang_2@nxp.com>
  Zack Rusin <zack.rusin@broadcom.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

hint: The 'hooks/update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-receive' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
hint: The 'hooks/post-update' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
To xenbits.xen.org:/home/xen/git/linux-pvops.git
   1b5fe53681d9..fb24560f31f9  fb24560f31f9dff2c97707cfed6029bfebebaf1c -> tested/linux-linus


From xen-devel-bounces@lists.xenproject.org Sat Aug 31 07:16:44 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Aug 2024 07:16:44 +0000
Received: from list by lists.xenproject.org with outflank-mailman.787124.1196763 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skILj-0002Nr-QN; Sat, 31 Aug 2024 07:16:43 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 787124.1196763; Sat, 31 Aug 2024 07:16:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skILj-0002Nk-Ne; Sat, 31 Aug 2024 07:16:43 +0000
Received: by outflank-mailman (input) for mailman id 787124;
 Sat, 31 Aug 2024 07:16:42 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skILi-0002NV-HX; Sat, 31 Aug 2024 07:16:42 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skILi-0002gA-F9; Sat, 31 Aug 2024 07:16:42 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skILi-00023k-1H; Sat, 31 Aug 2024 07:16:42 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1skILi-0001UM-0s; Sat, 31 Aug 2024 07:16:42 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=v2QifotP+8M1o3Zy/j1rmEcvvT4QZxQa+RPEqcBtqMM=; b=Y5qaXxWp8vnjlQMqslPp83uTXy
	0ZFoWWBpJBrVKamiidfAgYXqe65z9rulwdYd4Bfk9i+PtI6UT+36iP8qVEaC2tfY4K94ocFSvjq6A
	9NdBxc2P4Jm94ITz9yMtTwYUtdIFuJyTW/Io+mwPa0GDRO151an1z1YSrFs4uqt9dKHg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187433-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187433: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=95ee7f3ef7a34773e0528410fd0178aecfdd89b5
X-Osstest-Versions-That:
    ovmf=90d861f63d0fe467cec9659703f02d3d32969dc3
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 31 Aug 2024 07:16:42 +0000

flight 187433 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187433/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 95ee7f3ef7a34773e0528410fd0178aecfdd89b5
baseline version:
 ovmf                 90d861f63d0fe467cec9659703f02d3d32969dc3

Last test of basis   187432  2024-08-31 03:19:43 Z    0 days
Testing same since   187433  2024-08-31 05:13:31 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Joey Vagedes <joey.vagedes@gmail.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   90d861f63d..95ee7f3ef7  95ee7f3ef7a34773e0528410fd0178aecfdd89b5 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sat Aug 31 10:14:34 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Aug 2024 10:14:34 +0000
Received: from list by lists.xenproject.org with outflank-mailman.787161.1196773 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skL7a-0002em-Sj; Sat, 31 Aug 2024 10:14:18 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 787161.1196773; Sat, 31 Aug 2024 10:14:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skL7a-0002ef-Pf; Sat, 31 Aug 2024 10:14:18 +0000
Received: by outflank-mailman (input) for mailman id 787161;
 Sat, 31 Aug 2024 10:14:17 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skL7Z-0002eV-Jj; Sat, 31 Aug 2024 10:14:17 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skL7Z-0006LZ-D8; Sat, 31 Aug 2024 10:14:17 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skL7Y-0008WQ-S6; Sat, 31 Aug 2024 10:14:16 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1skL7Y-0006il-Rh; Sat, 31 Aug 2024 10:14:16 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=iSPeDIvdJzR/mo0G27NKtLFDTFcMbw+9sU6Tdj9jHJw=; b=5ts3qFcspYBiGRNgeEGTXvJHaE
	nYuTMJMNNDWkbfrqUZmZGz1sOoWNNL44b5L9XNLQSPj42HA59skIbNXwzUcjWcuyJz0n7c0PXsE/O
	bHNvhzOYkmHfqgd8a5U3jBbyN08Z7BA6cM0mwbfEViSv9f/XjOMmckjIn+t5M9J7N3oo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187435-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187435: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=baecba68a32b26778e902faed64f2e701e584531
X-Osstest-Versions-That:
    ovmf=95ee7f3ef7a34773e0528410fd0178aecfdd89b5
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 31 Aug 2024 10:14:16 +0000

flight 187435 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187435/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 baecba68a32b26778e902faed64f2e701e584531
baseline version:
 ovmf                 95ee7f3ef7a34773e0528410fd0178aecfdd89b5

Last test of basis   187433  2024-08-31 05:13:31 Z    0 days
Testing same since   187435  2024-08-31 07:41:29 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Ashraf Ali <ashraf.ali.s@intel.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   95ee7f3ef7..baecba68a3  baecba68a32b26778e902faed64f2e701e584531 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sat Aug 31 10:35:10 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Aug 2024 10:35:10 +0000
Received: from list by lists.xenproject.org with outflank-mailman.787170.1196783 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skLRh-0003Jb-Fo; Sat, 31 Aug 2024 10:35:05 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 787170.1196783; Sat, 31 Aug 2024 10:35:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skLRh-0003JU-Cx; Sat, 31 Aug 2024 10:35:05 +0000
Received: by outflank-mailman (input) for mailman id 787170;
 Sat, 31 Aug 2024 10:35: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=aJHj=P6=gmail.com=andreistan2003@srs-se1.protection.inumbo.net>)
 id 1skLRf-0003J5-PF
 for xen-devel@lists.xenproject.org; Sat, 31 Aug 2024 10:35:03 +0000
Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com
 [2a00:1450:4864:20::236])
 by se1-gles-sth1.inumbo.com (Halon) with ESMTPS
 id ade34c8c-6784-11ef-a0b2-8be0dac302b0;
 Sat, 31 Aug 2024 12:35:02 +0200 (CEST)
Received: by mail-lj1-x236.google.com with SMTP id
 38308e7fff4ca-2f43de7ad5eso34236351fa.1
 for <xen-devel@lists.xenproject.org>; Sat, 31 Aug 2024 03:35:02 -0700 (PDT)
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
X-Inumbo-ID: ade34c8c-6784-11ef-a0b2-8be0dac302b0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20230601; t=1725100502; x=1725705302; darn=lists.xenproject.org;
        h=content-transfer-encoding:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=2vp4mGUlDvX+G4B1zSiMFicm8aeYBFuP7Y0BdM/0FuA=;
        b=E/MP5SE0XzPSrXQysOxLTk8uM8E+eV6v7GK1txqvYt2lL6n/+jMPiHg83vx/lM0sOk
         wh0AMOv0JdtLmcnyKu3e2pOBbtBlAXzwsRMeTMkF+QLjGYPfc+w8q+Ej1vCgD/k93Nmu
         iV9topfQrr3qf/ht92N8Q2+KDuopNjkjnVMDlPLKtbrFULo4ATHNwvmcUCs1jCs1B7TM
         5kkFWYBPT8wK5g3eLH46OMeCW2r4usdVKM94ttQ5cZSRvn6p/XbqrIVOe73AMr+Atq73
         h7mElqzgPL4y28d1Hmw5/8580yRjXsAj9rEwtq9aoj7tmp9V0lRnVi1v0AmL/kZZdckK
         D1vw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1725100502; x=1725705302;
        h=content-transfer-encoding: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=2vp4mGUlDvX+G4B1zSiMFicm8aeYBFuP7Y0BdM/0FuA=;
        b=O/F04xw7zabpOKwNCof+BJ6DlMz1e8Nnc3BzPONQYzj9TmyT14zQi0dMePPxAdE08p
         poVPwhzNi2/UUm2tpST043Ty3SlURMooj9C6h+Ttd/cl+FJSuPxC14Oz0k8CtwwULcCm
         G56SRszwUodO/V/i8HHp2XxQOhAbmS8X6hmLUQO2O2eL2qkKTLCWCsfjXgfuNTHIDAWJ
         90s4QT0vFpXok3APwPVZbMFaNo2ccvtUY3RXUip1lxF+hisAS2mFuOeYnlgq9X1agzjo
         gUS8yvKslRREL8qP+IvrKvyGyavBUe16VKXzALCdRa9upMiSTQ8gXXfN6rZpQpnsvVCb
         hHhA==
X-Forwarded-Encrypted: i=1; AJvYcCWH0mjTTtXIIv/owwnw+JB73nk4aAkIFwHdbRjaVxlfbnKkI1gyb9WLYk+VWkNpEkYyRFXkQuTsZjU=@lists.xenproject.org
X-Gm-Message-State: AOJu0Yy6hlHHhaXZMhnWHnabL0AdT8F/Jp+yn15BGcZVzaeOUD2UzzW8
	zQO9LDucfr6Aqof7GiUQ3t7V8YS8/Xuzt1kCQyO2AaOaIf9uEkDCGgVG0NrLw2j8ir36wQnq1p7
	/fLT638PMnc07UOfEtSwv9fnped4=
X-Google-Smtp-Source: AGHT+IGMQEa5e257zADNZ8fbMUCl11zGub1Bk0+6OLjFFi3i7SDNX9UQ6AfnSvvvdHYUJvRh3b6ZX1JIJykY6UxAy8Y=
X-Received: by 2002:a2e:bc0b:0:b0:2ef:251f:785 with SMTP id
 38308e7fff4ca-2f6265503femr16031491fa.1.1725100501506; Sat, 31 Aug 2024
 03:35:01 -0700 (PDT)
MIME-Version: 1.0
References: <20240705145910.32736-3-andreistan2003@gmail.com>
 <36ad6b62-9186-41e3-bfa7-7a6d81d9efe1@suse.com> <CAH=Ecdj8PThEpMckjbciHhxK6H4K0qeympJvd5uQ=pX_G6rOFQ@mail.gmail.com>
In-Reply-To: <CAH=Ecdj8PThEpMckjbciHhxK6H4K0qeympJvd5uQ=pX_G6rOFQ@mail.gmail.com>
From: Andrei Stan <andreistan2003@gmail.com>
Date: Sat, 31 Aug 2024 13:34:50 +0300
Message-ID: <CAH=EcdidfuPaxxL-Fz29KZ4ZeDTDVwcEWgTv6G2Z3EP7mcEZ9A@mail.gmail.com>
Subject: Re: [PATCH] tools/libs/store: add missing USE_PTHREAD to target .o
To: =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= <jgross@suse.com>, 
	xen-devel@lists.xenproject.org, Julien Grall <julien@xen.org>, 
	Anthony PERARD <anthony.perard@vates.tech>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Ping

On Fri, Jul 5, 2024 at 7:05=E2=80=AFPM Andrei Stan <andreistan2003@gmail.co=
m> wrote:
>
> On Fri, Jul 5, 2024 at 6:22=E2=80=AFPM J=C3=BCrgen Gro=C3=9F <jgross@suse=
.com> wrote:
> >
> > On 05.07.24 16:59, Andrei Stan wrote:
> > > Currently only shared libraries build with USE_PTHREAD enabled.
> > >
> > > This patch adds the macro also to xs.o.
> > >
> > > Backport: 4.18+ # maybe older
> > > Signed-off-by: Andrei Stan <andreistan2003@gmail.com>
> >
> > Commit dde3e02b7068 did that explicitly, stating that phtreads are
> > not compatible with static linking.
> >
> > Was that reasoning wrong?
> >
> > Juergen
> > ---
> > > ---
> > >   tools/libs/store/Makefile | 1 +
> > >   1 file changed, 1 insertion(+)
> > >
> > > diff --git a/tools/libs/store/Makefile b/tools/libs/store/Makefile
> > > index 0649cf8307..c6f147c72f 100644
> > > --- a/tools/libs/store/Makefile
> > > +++ b/tools/libs/store/Makefile
> > > @@ -20,6 +20,7 @@ CFLAGS +=3D -include $(XEN_ROOT)/tools/config.h
> > >   CFLAGS +=3D $(CFLAGS_libxentoolcore)
> > >
> > >   xs.opic: CFLAGS +=3D -DUSE_PTHREAD
> > > +xs.o: CFLAGS +=3D -DUSE_PTHREAD
> > >   ifeq ($(CONFIG_Linux),y)
> > >   xs.opic: CFLAGS +=3D -DUSE_DLSYM
> > >   endif
>
> It was a pretty nasty situation, giving some context, this is for a Go ba=
sed CLI
> tool and some things in there are multithreaded, but i don't think
> calling in the
> bindings happens anywhere in parallel. Without this patch there would be
> some sort of race conditions (or so I assume from the debugging i've done=
)
> happening withing the xen/tools code, making it impossible to start a dom=
ain.
>
> In this case there were no issues in linking pthreads statically. I was n=
ot even
> aware of that being a possible issue. Is it really?
>
> Also I am not too sure how much that code path is actually tested, probab=
ly the
> majority of the testing is done with dynamic builds.
>
> Andrei


From xen-devel-bounces@lists.xenproject.org Sat Aug 31 12:54:29 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Aug 2024 12:54:29 +0000
Received: from list by lists.xenproject.org with outflank-mailman.787198.1196793 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skNc7-0004pO-3t; Sat, 31 Aug 2024 12:53:59 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 787198.1196793; Sat, 31 Aug 2024 12:53:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skNc7-0004pH-19; Sat, 31 Aug 2024 12:53:59 +0000
Received: by outflank-mailman (input) for mailman id 787198;
 Sat, 31 Aug 2024 12:53:57 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skNc5-0004p5-AP; Sat, 31 Aug 2024 12:53:57 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skNc5-0000pL-2T; Sat, 31 Aug 2024 12:53:57 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skNc4-0005Qq-Lo; Sat, 31 Aug 2024 12:53:56 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1skNc4-00055n-L8; Sat, 31 Aug 2024 12:53:56 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=orw5acb9a64U+yUb6hs4dmLCm+SkviQoAS7y3t03YUU=; b=a3pw1nKOdCL0aN/4QLmCJ3Qhjz
	uoD7Wp7XSl1+K8fj0Vbdf/rQCr6KnGFdLdivI1iIqOJX6PyuYzj8uxnwcxRTwoGfzlVcXmp5PltFi
	8DDaEiSBMGhpNrZY9BbhLup6BJ4rzgDDzUClFZwy3EJw3KUwStwFs9cmmr5KlrvhGheo=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187431-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187431: regressions - FAIL
X-Osstest-Failures:
    xen-unstable:test-armhf-armhf-xl:debian-install:fail:regression
    xen-unstable:test-armhf-armhf-xl:host-ping-check-xen:fail:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=1436593d5f8f7f700478e307d5198535ba69f88d
X-Osstest-Versions-That:
    xen=99f942f3d410059dc223ee0a908827e928ef3592
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 31 Aug 2024 12:53:56 +0000

flight 187431 xen-unstable real [real]
flight 187437 xen-unstable real-retest [real]
http://logs.test-lab.xenproject.org/osstest/logs/187431/
http://logs.test-lab.xenproject.org/osstest/logs/187437/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-armhf-armhf-xl          12 debian-install fail in 187437 REGR. vs. 187415

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl          10 host-ping-check-xen fail pass in 187437-retest

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187415
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187415
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187415
 test-armhf-armhf-libvirt     16 saverestore-support-check    fail  like 187415
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187415
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187415
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl          15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl          16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit2  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit2  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-credit1  15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-credit1  16 saverestore-support-check    fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-credit2  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit2  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      15 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-xsm      16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-arm64-arm64-xl-vhd      14 migrate-support-check        fail   never pass
 test-arm64-arm64-xl-vhd      15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-armhf-armhf-libvirt     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 xen                  1436593d5f8f7f700478e307d5198535ba69f88d
baseline version:
 xen                  99f942f3d410059dc223ee0a908827e928ef3592

Last test of basis   187415  2024-08-30 05:21:05 Z    1 days
Testing same since   187431  2024-08-31 01:39:54 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Anthony PERARD <anthony.perard@vates.tech>
  Christian Lindig <christian.lindig@cloud.com>
  Victor Lira <victorm.lira@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       pass    
 test-xtf-amd64-amd64-2                                       pass    
 test-xtf-amd64-amd64-3                                       pass    
 test-xtf-amd64-amd64-4                                       pass    
 test-xtf-amd64-amd64-5                                       pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          pass    
 test-armhf-armhf-xl                                          fail    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      pass    
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  pass    
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  pass    
 test-armhf-armhf-xl-credit2                                  pass    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     pass    
 test-amd64-amd64-livepatch                                   pass    
 test-amd64-amd64-migrupgrade                                 pass    
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 pass    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 pass    
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 pass    
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Not pushing.

------------------------------------------------------------
commit 1436593d5f8f7f700478e307d5198535ba69f88d
Author: Anthony PERARD <anthony.perard@vates.tech>
Date:   Fri Aug 30 09:49:40 2024 +0000

    libxl: Probe QEMU for -run-with user=user and use it
    
    "-runas" is deprecated since QEMU 9.1 and will be remove in a future
    release.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>

commit 82335a8cc54c009792d44f0be51213da48303a68
Author: Anthony PERARD <anthony.perard@vates.tech>
Date:   Fri Aug 30 09:49:40 2024 +0000

    libxl: Probe QEMU for -run-with chroot=dir and use it
    
    QEMU 9.0 have removed "-chroot" command line option, which have been
    deprecated since QEMU 8.1 in favor of "-run-with chroot=dir".
    
    Look into the result of the QMP command "query-command-line-options"
    to find out if "-run-with chroot=dir" is available. Then use it in
    place of "-chroot".
    
    Resolves: xen-project/xen#187
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>

commit 7ab0f83e604d44c92daa218423bf7644502fcefe
Author: Andrew Cooper <andrew.cooper3@citrix.com>
Date:   Wed Aug 28 20:20:34 2024 +0100

    x86/pv: Make cr4_pv32_mask be PV32-only
    
    The user of cr4_pv32_mask (the cr4_pv32_restore() function) only exists in a
    CONFIG_PV32 build, but right now the variable is unconditionally set up.
    
    To start with, move the setup into set_in_cr4() and remove it from it's
    somewhat ad-hoc position in __start_xen().  This means the variable will be
    set up in two steps for a CONFIG_PV32=y build, but it's cleaner and more
    robust logic overall.
    
    With that, there's no good reason for the variable to stay in setup.c.  Move
    it to x86/pv/domain.c (beside opt_pv32, for want of any better place to live),
    and move the declaration to beside set_in_cr4() and mmu_cr4_features which is
    a better position than setup.h.
    
    Guard the reference with CONFIG_PV32, and fix up a recent typo in an adjacent
    comment while at it.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

commit 8d336fcb6ea6b486ceccef2e36d003db032131fe
Author: Andrew Cooper <andrew.cooper3@citrix.com>
Date:   Mon Jan 30 22:14:20 2023 +0000

    tools/ocaml: Factor out compatiblity handling
    
    ... rather than having each library implement its own subset.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@cloud.com>

commit 5e99a40ea54a6bf0bdc18241992866a642d7782b
Author: Victor Lira <victorm.lira@amd.com>
Date:   Thu Aug 29 15:34:23 2024 -0700

    automation: use expect utility in xilinx tests
    
    Fixes: 95764a0817a5 (automation: update xilinx test scripts (tty))
    This patch introduced a CI failure due to a timeout in xilinx-x86_64 test.
    
    Change xilinx-x86_64 and xilinx-arm64 scripts to use "expect" utility
    to determine test result and allow early exit from tests.
    Add "expect" to xilinx container environment (dockerfile).
    Rename references to "QEMU" in "qemu-key.exp" expect script to "TEST" to be
    used by both QEMU and hardware tests.
    
    Signed-off-by: Victor Lira <victorm.lira@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

commit 740c41ca05a83a2c3629eb2ff323877c37d95c1e
Author: Victor Lira <victorm.lira@amd.com>
Date:   Thu Aug 29 15:34:22 2024 -0700

    automation: fix false success in qemu tests
    
    Fix flaw in qemu-*.sh tests that producess a false success. The following
    lines produces success despite the "expect" script producing nonzero exit
    status:
    
        set +e
    ...
        ./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
        (end of file)
    
    The default exit status for a pipeline using "|" operator is that of the
    rightmost command. Fix this by setting the "pipefail" option in the shell,
    and removing "set +e" allowing the expect script to determine the result.
    
    Signed-off-by: Victor Lira <victorm.lira@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Sat Aug 31 12:54:49 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Aug 2024 12:54:49 +0000
Received: from list by lists.xenproject.org with outflank-mailman.787205.1196804 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skNcv-0005K4-Dc; Sat, 31 Aug 2024 12:54:49 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 787205.1196804; Sat, 31 Aug 2024 12:54:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skNcv-0005Jx-Aa; Sat, 31 Aug 2024 12:54:49 +0000
Received: by outflank-mailman (input) for mailman id 787205;
 Sat, 31 Aug 2024 12:54:48 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skNcu-0005Ji-Qr; Sat, 31 Aug 2024 12:54:48 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skNcu-0000qG-PJ; Sat, 31 Aug 2024 12:54:48 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skNcu-0005Re-6d; Sat, 31 Aug 2024 12:54:48 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1skNcu-00061J-5y; Sat, 31 Aug 2024 12:54:48 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=lprG76jQLnMIbVSryTeZAKECecfg+y7zur4wcSOiRFA=; b=We1GoWaCSP2BqC42RhhnIxKrUN
	2a7kGEdXio3m0cLLPLDwUgqaJ7XIaI9pQfYRmcZzdxjKTjBkoQks5p14AA2Rpv+nV6GBC5l6bodBg
	ZbJ3TAIoZGPPSMb1ItM31CQVBG8fdFl65O5SAQIm4j4LRqXYT0kYNysO7JMAnXFkh6kI=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187436-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187436: all pass - PUSHED
X-Osstest-Versions-This:
    ovmf=96b90e150c2f107c64a827e82451b642a42df686
X-Osstest-Versions-That:
    ovmf=baecba68a32b26778e902faed64f2e701e584531
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 31 Aug 2024 12:54:48 +0000

flight 187436 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187436/

Perfect :-)
All tests in this flight passed as required
version targeted for testing:
 ovmf                 96b90e150c2f107c64a827e82451b642a42df686
baseline version:
 ovmf                 baecba68a32b26778e902faed64f2e701e584531

Last test of basis   187435  2024-08-31 07:41:29 Z    0 days
Testing same since   187436  2024-08-31 10:45:13 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Matthew Carlson <macarl@microsoft.com>
  Oliver Smith-Denny <osde@linux.microsoft.com>

jobs:
 build-amd64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary


Pushing revision :

To xenbits.xen.org:/home/xen/git/osstest/ovmf.git
   baecba68a3..96b90e150c  96b90e150c2f107c64a827e82451b642a42df686 -> xen-tested-master


From xen-devel-bounces@lists.xenproject.org Sat Aug 31 18:23:50 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Aug 2024 18:23:50 +0000
Received: from list by lists.xenproject.org with outflank-mailman.787243.1196816 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skSl5-0006y1-GP; Sat, 31 Aug 2024 18:23:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 787243.1196816; Sat, 31 Aug 2024 18:23:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skSl5-0006xu-DP; Sat, 31 Aug 2024 18:23:35 +0000
Received: by outflank-mailman (input) for mailman id 787243;
 Sat, 31 Aug 2024 18:23:34 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skSl4-0006xk-Ty; Sat, 31 Aug 2024 18:23:34 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skSl4-0007Pc-L7; Sat, 31 Aug 2024 18:23:34 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skSl4-00048p-2m; Sat, 31 Aug 2024 18:23:34 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1skSl4-0007MF-2F; Sat, 31 Aug 2024 18:23:34 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=qU/Vzcc2azq3Y2nb1Y28fxJHYXWyfxenhyJm61+jtpA=; b=qqu3E92JqSa85gIQc2yd7urMIb
	uIqr6bxca0y9hh0SC8Q+LhHwfkOw8XCoPRhLY6vml9atrBtJR4TAAthbW9gUJeCroNw4aPXHTkBUh
	QE8gUurBOhKT2cDqAnVqUgsrde5GQAb/U3ekyHTrHuqTCQbJ1qoUJU2zhQMzIwp4mJcs=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187434-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [linux-linus test] 187434: regressions - trouble: broken/fail/pass
X-Osstest-Failures:
    linux-linus:test-arm64-arm64-xl:<job status>:broken:regression
    linux-linus:test-arm64-arm64-xl-credit1:<job status>:broken:regression
    linux-linus:test-arm64-arm64-xl-credit2:<job status>:broken:regression
    linux-linus:test-arm64-arm64-xl-thunderx:<job status>:broken:regression
    linux-linus:test-arm64-arm64-xl-vhd:<job status>:broken:regression
    linux-linus:test-arm64-arm64-xl-xsm:<job status>:broken:regression
    linux-linus:test-armhf-armhf-libvirt:<job status>:broken:regression
    linux-linus:test-armhf-armhf-libvirt-vhd:<job status>:broken:regression
    linux-linus:test-armhf-armhf-libvirt-vhd:host-install(5):broken:regression
    linux-linus:test-armhf-armhf-libvirt:host-install(5):broken:regression
    linux-linus:test-arm64-arm64-xl-thunderx:host-install(5):broken:regression
    linux-linus:test-arm64-arm64-xl:host-install(5):broken:regression
    linux-linus:test-arm64-arm64-xl-vhd:host-install(5):broken:regression
    linux-linus:test-arm64-arm64-xl-credit1:host-install(5):broken:regression
    linux-linus:test-arm64-arm64-xl-credit2:host-install(5):broken:regression
    linux-linus:test-arm64-arm64-xl-xsm:host-install(5):broken:regression
    linux-linus:test-armhf-armhf-xl-credit2:xen-boot:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:debian-hvm-install:fail:regression
    linux-linus:test-arm64-arm64-libvirt-raw:debian-di-install:fail:regression
    linux-linus:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    linux-linus:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    linux-linus:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    linux=1934261d897467a924e2afd1181a74c1cbfa2c1d
X-Osstest-Versions-That:
    linux=fb24560f31f9dff2c97707cfed6029bfebebaf1c
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 31 Aug 2024 18:23:34 +0000

flight 187434 linux-linus real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187434/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-arm64-arm64-xl             <job status>                 broken
 test-arm64-arm64-xl-credit1     <job status>                 broken
 test-arm64-arm64-xl-credit2     <job status>                 broken
 test-arm64-arm64-xl-thunderx    <job status>                 broken
 test-arm64-arm64-xl-vhd         <job status>                 broken
 test-arm64-arm64-xl-xsm         <job status>                 broken
 test-armhf-armhf-libvirt        <job status>                 broken
 test-armhf-armhf-libvirt-vhd    <job status>                 broken
 test-armhf-armhf-libvirt-vhd  5 host-install(5)        broken REGR. vs. 187427
 test-armhf-armhf-libvirt      5 host-install(5)        broken REGR. vs. 187427
 test-arm64-arm64-xl-thunderx  5 host-install(5)        broken REGR. vs. 187427
 test-arm64-arm64-xl           5 host-install(5)        broken REGR. vs. 187427
 test-arm64-arm64-xl-vhd       5 host-install(5)        broken REGR. vs. 187427
 test-arm64-arm64-xl-credit1   5 host-install(5)        broken REGR. vs. 187427
 test-arm64-arm64-xl-credit2   5 host-install(5)        broken REGR. vs. 187427
 test-arm64-arm64-xl-xsm       5 host-install(5)        broken REGR. vs. 187427
 test-armhf-armhf-xl-credit2   8 xen-boot                 fail REGR. vs. 187427
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 12 debian-hvm-install fail REGR. vs. 187427
 test-arm64-arm64-libvirt-raw 12 debian-di-install        fail REGR. vs. 187427

Tests which did not succeed, but are not blocking:
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop            fail like 187427
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop            fail like 187427
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop            fail like 187427
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop            fail like 187427
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail like 187427
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt     15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check        fail   never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-arndale  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-arndale  16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail never pass
 test-armhf-armhf-xl          15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl          16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-rtds     15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-rtds     16 saverestore-support-check    fail   never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check        fail never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check        fail   never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  15 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-credit1  16 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check        fail  never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check    fail  never pass
 test-armhf-armhf-xl-qcow2    14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-qcow2    15 saverestore-support-check    fail   never pass
 test-armhf-armhf-xl-raw      14 migrate-support-check        fail   never pass
 test-armhf-armhf-xl-raw      15 saverestore-support-check    fail   never pass

version targeted for testing:
 linux                1934261d897467a924e2afd1181a74c1cbfa2c1d
baseline version:
 linux                fb24560f31f9dff2c97707cfed6029bfebebaf1c

Last test of basis   187427  2024-08-30 18:54:48 Z    0 days
Testing same since   187434  2024-08-31 07:19:23 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  Bjorn Helgaas <bhelgaas@google.com>
  Darrick J. Wong <djwong@kernel.org>
  Dmitry Torokhov <dmitry.torokhov@gmail.com>
  Frank Li <Frank.Li@nxp.com>
  Jens Axboe <axboe@kernel.dk>
  Krzysztof Wilczyński <kwilczynski@kernel.org>
  Linus Torvalds <torvalds@linux-foundation.org>
  Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
  Richard Zhu <hongxing.zhu@nxp.com>
  Woody Suwalski <terraluna977@gmail.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              pass    
 build-i386-xsm                                               pass    
 build-amd64                                                  pass    
 build-arm64                                                  pass    
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          pass    
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            pass    
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-amd64-amd64-xl                                          pass    
 test-amd64-coresched-amd64-xl                                pass    
 test-arm64-arm64-xl                                          broken  
 test-armhf-armhf-xl                                          pass    
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           pass    
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        pass    
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 fail    
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 pass    
 test-amd64-amd64-libvirt-xsm                                 pass    
 test-arm64-arm64-libvirt-xsm                                 pass    
 test-amd64-amd64-xl-xsm                                      pass    
 test-arm64-arm64-xl-xsm                                      broken  
 test-amd64-amd64-qemuu-nested-amd                            fail    
 test-amd64-amd64-xl-pvhv2-amd                                pass    
 test-amd64-amd64-dom0pvh-xl-amd                              pass    
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    pass    
 test-amd64-amd64-qemuu-freebsd11-amd64                       pass    
 test-amd64-amd64-qemuu-freebsd12-amd64                       pass    
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         pass    
 test-amd64-amd64-xl-qemut-win7-amd64                         fail    
 test-amd64-amd64-xl-qemuu-win7-amd64                         fail    
 test-amd64-amd64-xl-qemut-ws16-amd64                         fail    
 test-amd64-amd64-xl-qemuu-ws16-amd64                         fail    
 test-armhf-armhf-xl-arndale                                  pass    
 test-amd64-amd64-examine-bios                                pass    
 test-amd64-amd64-xl-credit1                                  pass    
 test-arm64-arm64-xl-credit1                                  broken  
 test-armhf-armhf-xl-credit1                                  pass    
 test-amd64-amd64-xl-credit2                                  pass    
 test-arm64-arm64-xl-credit2                                  broken  
 test-armhf-armhf-xl-credit2                                  fail    
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        pass    
 test-amd64-amd64-examine                                     pass    
 test-arm64-arm64-examine                                     pass    
 test-armhf-armhf-examine                                     pass    
 test-amd64-amd64-qemuu-nested-intel                          pass    
 test-amd64-amd64-xl-pvhv2-intel                              pass    
 test-amd64-amd64-dom0pvh-xl-intel                            pass    
 test-amd64-amd64-libvirt                                     pass    
 test-armhf-armhf-libvirt                                     broken  
 test-amd64-amd64-xl-multivcpu                                pass    
 test-armhf-armhf-xl-multivcpu                                pass    
 test-amd64-amd64-pair                                        pass    
 test-amd64-amd64-libvirt-pair                                pass    
 test-amd64-amd64-xl-pvshim                                   pass    
 test-amd64-amd64-pygrub                                      pass    
 test-amd64-amd64-libvirt-qcow2                               pass    
 test-amd64-amd64-xl-qcow2                                    pass    
 test-armhf-armhf-xl-qcow2                                    pass    
 test-amd64-amd64-libvirt-raw                                 pass    
 test-arm64-arm64-libvirt-raw                                 fail    
 test-amd64-amd64-xl-raw                                      pass    
 test-armhf-armhf-xl-raw                                      pass    
 test-amd64-amd64-xl-rtds                                     pass    
 test-armhf-armhf-xl-rtds                                     pass    
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             pass    
 test-amd64-amd64-xl-shadow                                   pass    
 test-arm64-arm64-xl-thunderx                                 broken  
 test-amd64-amd64-examine-uefi                                pass    
 test-amd64-amd64-libvirt-vhd                                 pass    
 test-armhf-armhf-libvirt-vhd                                 broken  
 test-amd64-amd64-xl-vhd                                      pass    
 test-arm64-arm64-xl-vhd                                      broken  


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-arm64-arm64-xl broken
broken-job test-arm64-arm64-xl-credit1 broken
broken-job test-arm64-arm64-xl-credit2 broken
broken-job test-arm64-arm64-xl-thunderx broken
broken-job test-arm64-arm64-xl-vhd broken
broken-job test-arm64-arm64-xl-xsm broken
broken-job test-armhf-armhf-libvirt broken
broken-job test-armhf-armhf-libvirt-vhd broken
broken-step test-armhf-armhf-libvirt-vhd host-install(5)
broken-step test-armhf-armhf-libvirt host-install(5)
broken-step test-arm64-arm64-xl-thunderx host-install(5)
broken-step test-arm64-arm64-xl host-install(5)
broken-step test-arm64-arm64-xl-vhd host-install(5)
broken-step test-arm64-arm64-xl-credit1 host-install(5)
broken-step test-arm64-arm64-xl-credit2 host-install(5)
broken-step test-arm64-arm64-xl-xsm host-install(5)

Not pushing.

------------------------------------------------------------
commit 1934261d897467a924e2afd1181a74c1cbfa2c1d
Merge: 8101b2766d5b c472d33bcbf7
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sat Aug 31 15:32:38 2024 +1200

    Merge tag 'input-for-v6.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
    
    Pull input fix from Dmitry Torokhov:
    
     - a fix for Cypress PS/2 touchpad for regression introduced in 6.11
       merge window where a timeout condition is incorrectly reported for
       all extended Cypress commands
    
    * tag 'input-for-v6.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
      Input: cypress_ps2 - fix waiting for command response

commit 8101b2766d5bfee43a4de737107b9592db251470
Merge: 216d163165a9 150b572a7c1d
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sat Aug 31 14:54:11 2024 +1200

    Merge tag 'pci-v6.11-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
    
    Pull pci fixes from Bjorn Helgaas:
    
     - Add Manivannan Sadhasivam as PCI native host bridge and endpoint
       driver reviewer (Manivannan Sadhasivam)
    
     - Disable MHI RAM data parity error interrupt for qcom SA8775P SoC to
       work around hardware erratum that causes a constant stream of
       interrupts (Manivannan Sadhasivam)
    
     - Don't try to fall back to qcom Operating Performance Points (OPP)
       support unless the platform actually supports OPP (Manivannan
       Sadhasivam)
    
     - Add imx@lists.linux.dev mailing list to MAINTAINERS for NXP
       layerscape and imx6 PCI controller drivers (Frank Li)
    
    * tag 'pci-v6.11-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci:
      MAINTAINERS: PCI: Add NXP PCI controller mailing list imx@lists.linux.dev
      PCI: qcom: Use OPP only if the platform supports it
      PCI: qcom-ep: Disable MHI RAM data parity error interrupt for SA8775P SoC
      MAINTAINERS: Add Manivannan Sadhasivam as Reviewer for PCI native host bridge and endpoint drivers

commit 216d163165a937ee9c1d0e9c26fe7a6f7d27ac4c
Merge: ad246d9f04aa e33a97a830b2
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sat Aug 31 13:54:05 2024 +1200

    Merge tag 'block-6.11-20240830' of git://git.kernel.dk/linux
    
    Pull block fix from Jens Axboe:
     "Fix for a single regression for WRITE_SAME introduced in the 6.11
      merge window"
    
    * tag 'block-6.11-20240830' of git://git.kernel.dk/linux:
      block: fix detection of unsupported WRITE SAME in blkdev_issue_write_zeroes

commit ad246d9f04aa037f8e8bbf8573c9af527114cead
Merge: fb24560f31f9 f274495aea7b
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date:   Sat Aug 31 13:51:27 2024 +1200

    Merge tag 'io_uring-6.11-20240830' of git://git.kernel.dk/linux
    
    Pull io_uring fixes from Jens Axboe:
    
     - A fix for a regression that happened in 6.11 merge window, where the
       copying of iovecs for compat mode applications got broken for certain
       cases.
    
     - Fix for a bug introduced in 6.10, where if using recv/send bundles
       with classic provided buffers, the recv/send would fail to set the
       right iovec count. This caused 0 byte send/recv results. Found via
       code coverage testing and writing a test case to exercise it.
    
    * tag 'io_uring-6.11-20240830' of git://git.kernel.dk/linux:
      io_uring/kbuf: return correct iovec count from classic buffer peek
      io_uring/rsrc: ensure compat iovecs are copied correctly

commit 150b572a7c1df30f5d32d87ad96675200cca7b80
Author: Frank Li <Frank.Li@nxp.com>
Date:   Mon Aug 26 16:27:39 2024 -0400

    MAINTAINERS: PCI: Add NXP PCI controller mailing list imx@lists.linux.dev
    
    Add imx mailing list imx@lists.linux.dev for PCI controller of NXP chips
    (Layerscape and iMX).
    
    Link: https://lore.kernel.org/r/20240826202740.970015-1-Frank.Li@nxp.com
    Signed-off-by: Frank Li <Frank.Li@nxp.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Acked-by: Richard Zhu <hongxing.zhu@nxp.com>

commit f274495aea7b15225b3d83837121b22ef96e560c
Author: Jens Axboe <axboe@kernel.dk>
Date:   Fri Aug 30 10:45:54 2024 -0600

    io_uring/kbuf: return correct iovec count from classic buffer peek
    
    io_provided_buffers_select() returns 0 to indicate success, but it should
    be returning 1 to indicate that 1 vec was mapped. This causes peeking
    to fail with classic provided buffers, and while that's not a use case
    that anyone should use, it should still work correctly.
    
    The end result is that no buffer will be selected, and hence a completion
    with '0' as the result will be posted, without a buffer attached.
    
    Fixes: 35c8711c8fc4 ("io_uring/kbuf: add helpers for getting/peeking multiple buffers")
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

commit 1c47c0d6014c832ad8e2ba04fc2c5b7070d999f7
Author: Jens Axboe <axboe@kernel.dk>
Date:   Wed Aug 28 09:42:33 2024 -0600

    io_uring/rsrc: ensure compat iovecs are copied correctly
    
    For buffer registration (or updates), a userspace iovec is copied in
    and updated. If the application is within a compat syscall, then the
    iovec type is compat_iovec rather than iovec. However, the type used
    in __io_sqe_buffers_update() and io_sqe_buffers_register() is always
    struct iovec, and hence the source is incremented by the size of a
    non-compat iovec in the loop. This misses every other iovec in the
    source, and will run into garbage half way through the copies and
    return -EFAULT to the application.
    
    Maintain the source address separately and assign to our user vec
    pointer, so that copies always happen from the right source address.
    
    While in there, correct a bad placement of __user which triggered
    the following sparse warning prior to this fix:
    
    io_uring/rsrc.c:981:33: warning: cast removes address space '__user' of expression
    io_uring/rsrc.c:981:30: warning: incorrect type in assignment (different address spaces)
    io_uring/rsrc.c:981:30:    expected struct iovec const [noderef] __user *uvec
    io_uring/rsrc.c:981:30:    got struct iovec *[noderef] __user
    
    Fixes: f4eaf8eda89e ("io_uring/rsrc: Drop io_copy_iov in favor of iovec API")
    Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

commit c472d33bcbf7a1ed3710efe93822b5e94eabe18c
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date:   Thu Aug 29 08:38:54 2024 -0700

    Input: cypress_ps2 - fix waiting for command response
    
    Commit 8bccf667f62a ("Input: cypress_ps2 - report timeouts when reading
    command status") uncovered an existing problem with cypress_ps2 driver:
    it tries waiting on a PS/2 device waitqueue without using the rest of
    libps2. Unfortunately without it nobody signals wakeup for the
    waiting process, and each "extended" command was timing out. But the
    rest of the code simply did not notice it.
    
    Fix this by switching from homegrown way of sending request to get
    command response and reading it to standard ps2_command() which does
    the right thing.
    
    Reported-by: Woody Suwalski <terraluna977@gmail.com>
    Tested-by: Woody Suwalski <terraluna977@gmail.com>
    Fixes: 8bccf667f62a ("Input: cypress_ps2 - report timeouts when reading command status")
    Link: https://lore.kernel.org/r/a8252e0f-dab4-ef5e-2aa1-407a6f4c7204@gmail.com
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

commit e33a97a830b230b79a98dbbb4121d4741a2be619
Author: Darrick J. Wong <djwong@kernel.org>
Date:   Tue Aug 27 10:53:40 2024 -0700

    block: fix detection of unsupported WRITE SAME in blkdev_issue_write_zeroes
    
    On error, blkdev_issue_write_zeroes used to recheck the block device's
    WRITE SAME queue limits after submitting WRITE SAME bios.  As stated in
    the comment, the purpose of this was to collapse all IO errors to
    EOPNOTSUPP if the effect of issuing bios was that WRITE SAME got turned
    off in the queue limits.  Therefore, it does not make sense to reuse the
    zeroes limit that was read earlier in the function because we only care
    about the queue limit *now*, not what it was at the start of the
    function.
    
    Found by running generic/351 from fstests.
    
    Fixes: 64b582ca88ca1 ("block: Read max write zeroes once for __blkdev_issue_write_zeroes()")
    Signed-off-by: Darrick J. Wong <djwong@kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: John Garry <john.g.garry@oracle.com>
    Link: https://lore.kernel.org/r/20240827175340.GB1977952@frogsfrogsfrogs
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

commit db1ec60fba4a995975dc1dc837b408db0d666801
Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Date:   Mon Jul 22 18:41:28 2024 +0530

    PCI: qcom: Use OPP only if the platform supports it
    
    With commit 5b6272e0efd5 ("PCI: qcom: Add OPP support to scale
    performance"), OPP was used to control the interconnect and power domains
    if the platform supported OPP. Also to maintain the backward compatibility
    with platforms not supporting OPP but just ICC, the above mentioned commit
    assumed that if ICC was not available on the platform, it would resort to
    OPP.
    
    Unfortunately, some old platforms don't support either ICC or OPP. On those
    platforms, resorting to OPP in the absence of ICC throws below errors from
    OPP core during suspend and resume:
    
      qcom-pcie 1c08000.pcie: dev_pm_opp_set_opp: device opp doesn't exist
      qcom-pcie 1c08000.pcie: _find_key: OPP table not found (-19)
    
    Also, it doesn't make sense to invoke the OPP APIs when OPP is not
    supported by the platform at all.
    
    Add a "use_pm_opp" flag to identify whether OPP is supported and use it to
    control invoking the OPP APIs.
    
    Fixes: 5b6272e0efd5 ("PCI: qcom: Add OPP support to scale performance")
    Link: https://lore.kernel.org/linux-pci/20240722131128.32470-1-manivannan.sadhasivam@linaro.org
    Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: Mayank Rana <quic_mrana@quicinc.com>

commit 5d6a6c7454ebaefba518e334750b05700131923b
Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Date:   Thu Aug 8 12:00:57 2024 +0530

    PCI: qcom-ep: Disable MHI RAM data parity error interrupt for SA8775P SoC
    
    SA8775P SoC has support for the hardware parity check feature on the MHI
    RAM (entity that holds MHI registers, etc.) But due to a hardware bug in
    the parity check logic, the data parity error interrupt is getting
    generated all the time when using MHI. So the hardware team has suggested
    disabling the parity check error to work around the hardware bug.
    
    Mask the parity error interrupt in PARF_INT_ALL_5_MASK register.
    
    Fixes: 58d0d3e032b3 ("PCI: qcom-ep: Add support for SA8775P SOC")
    Link: https://lore.kernel.org/linux-pci/20240808063057.7394-1-manivannan.sadhasivam@linaro.org
    Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

commit 054308ad90ae43ba2d4b9c83c6582e8fe94f6fed
Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Date:   Mon Aug 12 11:27:07 2024 +0530

    MAINTAINERS: Add Manivannan Sadhasivam as Reviewer for PCI native host bridge and endpoint drivers
    
    I've been reviewing the native host bridge drivers for some time and would
    like to be listed as a Reviewer formally.
    
    Link: https://lore.kernel.org/r/20240812055707.6778-1-manivannan.sadhasivam@linaro.org
    Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>


From xen-devel-bounces@lists.xenproject.org Sat Aug 31 21:53:52 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Aug 2024 21:53:52 +0000
Received: from list by lists.xenproject.org with outflank-mailman.787269.1196827 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skW2J-0007Nu-6t; Sat, 31 Aug 2024 21:53:35 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 787269.1196827; Sat, 31 Aug 2024 21:53:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skW2J-0007Nn-49; Sat, 31 Aug 2024 21:53:35 +0000
Received: by outflank-mailman (input) for mailman id 787269;
 Sat, 31 Aug 2024 21:53:33 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skW2H-0007Nd-GO; Sat, 31 Aug 2024 21:53:33 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skW2H-0002SD-AF; Sat, 31 Aug 2024 21:53:33 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skW2G-0000GB-N0; Sat, 31 Aug 2024 21:53:32 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1skW2G-0003gl-MV; Sat, 31 Aug 2024 21:53:32 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=hEyZM9i44jvdbf1tmNnU2y/tJf0xLvOtNWMMKw/rKlg=; b=Fnv/IS4H4sI/pYfBPfEHIHsuLO
	O130rwldCs/yHefjSgVNnbZiNEY7h5SPLEE3CiI7cYGRBuQpiOz83ZCa07NxkPzSYLUZ0Wm5q0+Kr
	xT65W5xJ9iiKbnMfQfCUTMt9zSunC+ut6930JhesWl710pyDV5fZWv3/NONeoMvkUNLg=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187439-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [xen-unstable test] 187439: regressions - trouble: blocked/broken/fail/pass
X-Osstest-Failures:
    xen-unstable:test-xtf-amd64-amd64-2:<job status>:broken:regression
    xen-unstable:test-xtf-amd64-amd64-3:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-qemuu-ovmf-amd64:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-qemuu-debianhvm-amd64:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-amd64:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-qcow2:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-pvshim:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-pvhv2-intel:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-pvhv2-amd:<job status>:broken:regression
    xen-unstable:build-arm64:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-multivcpu:<job status>:broken:regression
    xen-unstable:build-arm64-pvops:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-credit2:<job status>:broken:regression
    xen-unstable:build-arm64-xsm:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-credit1:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-qemuu-nested-intel:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-dom0pvh-xl-amd:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-dom0pvh-xl-intel:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-qemuu-freebsd12-amd64:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-qemuu-freebsd11-amd64:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-libvirt:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-pygrub:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-libvirt-pair:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-libvirt-qcow2:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-pair:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-libvirt-raw:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-migrupgrade:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-libvirt-vhd:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-libvirt-xsm:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-livepatch:<job status>:broken:regression
    xen-unstable:test-xtf-amd64-amd64-1:<job status>:broken:regression
    xen-unstable:test-armhf-armhf-xl-rtds:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-raw:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-rtds:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-shadow:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-vhd:<job status>:broken:regression
    xen-unstable:test-amd64-amd64-xl-xsm:<job status>:broken:regression
    xen-unstable:test-amd64-coresched-amd64-xl:<job status>:broken:regression
    xen-unstable:test-armhf-armhf-libvirt:<job status>:broken:regression
    xen-unstable:test-armhf-armhf-libvirt-vhd:<job status>:broken:regression
    xen-unstable:test-armhf-armhf-xl:<job status>:broken:regression
    xen-unstable:test-armhf-armhf-xl-arndale:<job status>:broken:regression
    xen-unstable:test-armhf-armhf-xl-credit1:<job status>:broken:regression
    xen-unstable:test-armhf-armhf-xl-credit2:<job status>:broken:regression
    xen-unstable:test-armhf-armhf-xl-multivcpu:<job status>:broken:regression
    xen-unstable:test-armhf-armhf-xl-qcow2:<job status>:broken:regression
    xen-unstable:test-armhf-armhf-xl-raw:<job status>:broken:regression
    xen-unstable:test-xtf-amd64-amd64-4:<job status>:broken:regression
    xen-unstable:test-xtf-amd64-amd64-5:<job status>:broken:regression
    xen-unstable:build-arm64-xsm:host-install(4):broken:regression
    xen-unstable:build-arm64:host-install(4):broken:regression
    xen-unstable:build-arm64-pvops:host-install(4):broken:regression
    xen-unstable:test-armhf-armhf-xl:host-ping-check-xen:fail:regression
    xen-unstable:test-armhf-armhf-xl:host-install(5):broken:heisenbug
    xen-unstable:test-armhf-armhf-libvirt-vhd:host-install(5):broken:heisenbug
    xen-unstable:test-armhf-armhf-xl-raw:host-install(5):broken:heisenbug
    xen-unstable:test-armhf-armhf-xl-credit1:host-install(5):broken:heisenbug
    xen-unstable:test-armhf-armhf-xl-multivcpu:host-install(5):broken:heisenbug
    xen-unstable:test-armhf-armhf-xl-qcow2:host-install(5):broken:heisenbug
    xen-unstable:test-armhf-armhf-xl-arndale:host-install(5):broken:heisenbug
    xen-unstable:test-armhf-armhf-xl-rtds:host-install(5):broken:heisenbug
    xen-unstable:test-armhf-armhf-xl-credit2:host-install(5):broken:heisenbug
    xen-unstable:test-armhf-armhf-examine:host-install:broken:heisenbug
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-libvirt-xsm:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-pair:host-install/src_host(6):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-i386-xsm:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-multivcpu:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-pair:host-install/dst_host(7):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-vhd:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-dom0pvh-xl-amd:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-livepatch:host-install(5):broken:heisenbug
    xen-unstable:test-xtf-amd64-amd64-1:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-pvshim:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-debianhvm-amd64:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemuu-ovmf-amd64:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-credit2:host-install(5):broken:heisenbug
    xen-unstable:test-xtf-amd64-amd64-2:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemuu-debianhvm-amd64:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-libvirt-vhd:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-migrupgrade:host-install/src_host(6):broken:heisenbug
    xen-unstable:test-amd64-amd64-migrupgrade:host-install/dst_host(7):broken:heisenbug
    xen-unstable:test-amd64-amd64-examine-uefi:host-install:broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-credit1:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-dom0pvh-xl-intel:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-xsm:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-qemuu-nested-intel:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-qemuu-freebsd11-amd64:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-qcow2:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-pygrub:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-qemuu-freebsd12-amd64:host-install(5):broken:heisenbug
    xen-unstable:test-xtf-amd64-amd64-4:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-pvhv2-intel:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-shadow:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-libvirt-qcow2:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-libvirt-pair:host-install/src_host(6):broken:heisenbug
    xen-unstable:test-amd64-amd64-libvirt:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-examine-bios:host-install:broken:heisenbug
    xen-unstable:test-amd64-amd64-libvirt-pair:host-install/dst_host(7):broken:heisenbug
    xen-unstable:test-amd64-amd64-libvirt-raw:host-install(5):broken:heisenbug
    xen-unstable:test-xtf-amd64-amd64-3:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-pvhv2-amd:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-rtds:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-xl-raw:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:host-install(5):broken:heisenbug
    xen-unstable:test-xtf-amd64-amd64-5:host-install(5):broken:heisenbug
    xen-unstable:test-armhf-armhf-libvirt:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-coresched-amd64-xl:host-install(5):broken:heisenbug
    xen-unstable:test-amd64-amd64-examine:host-install:broken:heisenbug
    xen-unstable:build-arm64-libvirt:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-examine:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:build-check(1):blocked:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:build-check(1):blocked:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemuu-win7-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-xl-qemut-ws16-amd64:guest-stop:fail:nonblocking
    xen-unstable:test-amd64-amd64-qemuu-nested-amd:debian-hvm-install/l1/l2:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-thunderx:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-multivcpu:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-xsm:saverestore-support-check:fail:nonblocking
    xen-unstable:test-amd64-amd64-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-libvirt-raw:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-qcow2:saverestore-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-arm64-arm64-xl-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-credit1:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt-vhd:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-arndale:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-rtds:saverestore-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-libvirt:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:migrate-support-check:fail:nonblocking
    xen-unstable:test-armhf-armhf-xl-raw:saverestore-support-check:fail:nonblocking
X-Osstest-Versions-This:
    xen=1436593d5f8f7f700478e307d5198535ba69f88d
X-Osstest-Versions-That:
    xen=99f942f3d410059dc223ee0a908827e928ef3592
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 31 Aug 2024 21:53:32 +0000

flight 187439 xen-unstable real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187439/

Regressions :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 test-xtf-amd64-amd64-2          <job status>                 broken
 test-xtf-amd64-amd64-3          <job status>                 broken
 test-amd64-amd64-xl-qemuu-win7-amd64    <job status>                 broken
 test-amd64-amd64-xl-qemuu-ovmf-amd64    <job status>                 broken
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict    <job status>   broken
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm    <job status>            broken
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow    <job status>        broken
 test-amd64-amd64-xl-qemuu-debianhvm-amd64    <job status>               broken
 test-amd64-amd64-xl-qemut-ws16-amd64    <job status>                 broken
 test-amd64-amd64-xl-qemut-win7-amd64    <job status>                 broken
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm    <job status>   broken
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm    <job status>            broken
 test-amd64-amd64-xl-qemut-debianhvm-amd64    <job status>               broken
 test-amd64-amd64-xl-qcow2       <job status>                 broken
 test-amd64-amd64-xl-pvshim      <job status>                 broken
 test-amd64-amd64-xl-pvhv2-intel    <job status>                 broken
 test-amd64-amd64-xl-pvhv2-amd    <job status>                 broken
 build-arm64                     <job status>                 broken
 test-amd64-amd64-xl-multivcpu    <job status>                 broken
 build-arm64-pvops               <job status>                 broken
 test-amd64-amd64-xl-credit2     <job status>                 broken
 build-arm64-xsm                 <job status>                 broken
 test-amd64-amd64-xl-credit1     <job status>                 broken
 test-amd64-amd64-xl             <job status>                 broken
 test-amd64-amd64-qemuu-nested-intel    <job status>                 broken
 test-amd64-amd64-qemuu-nested-amd    <job status>                 broken
 test-amd64-amd64-dom0pvh-xl-amd    <job status>                 broken
 test-amd64-amd64-dom0pvh-xl-intel    <job status>                 broken
 test-amd64-amd64-qemuu-freebsd12-amd64    <job status>                 broken
 test-amd64-amd64-qemuu-freebsd11-amd64    <job status>                 broken
 test-amd64-amd64-libvirt        <job status>                 broken
 test-amd64-amd64-pygrub         <job status>                 broken
 test-amd64-amd64-libvirt-pair    <job status>                 broken
 test-amd64-amd64-libvirt-qcow2    <job status>                 broken
 test-amd64-amd64-pair           <job status>                 broken
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm    <job status>      broken
 test-amd64-amd64-libvirt-raw    <job status>                 broken
 test-amd64-amd64-migrupgrade    <job status>                 broken
 test-amd64-amd64-libvirt-vhd    <job status>                 broken
 test-amd64-amd64-libvirt-xsm    <job status>                 broken
 test-amd64-amd64-livepatch      <job status>                 broken
 test-xtf-amd64-amd64-1          <job status>                 broken
 test-armhf-armhf-xl-rtds        <job status>                 broken
 test-amd64-amd64-xl-qemuu-ws16-amd64    <job status>                 broken
 test-amd64-amd64-xl-raw         <job status>                 broken
 test-amd64-amd64-xl-rtds        <job status>                 broken
 test-amd64-amd64-xl-shadow      <job status>                 broken
 test-amd64-amd64-xl-vhd         <job status>                 broken
 test-amd64-amd64-xl-xsm         <job status>                 broken
 test-amd64-coresched-amd64-xl    <job status>                 broken
 test-armhf-armhf-libvirt        <job status>                 broken
 test-armhf-armhf-libvirt-vhd    <job status>                 broken
 test-armhf-armhf-xl             <job status>                 broken
 test-armhf-armhf-xl-arndale     <job status>                 broken
 test-armhf-armhf-xl-credit1     <job status>                 broken
 test-armhf-armhf-xl-credit2     <job status>                 broken
 test-armhf-armhf-xl-multivcpu    <job status>                 broken
 test-armhf-armhf-xl-qcow2       <job status>                 broken
 test-armhf-armhf-xl-raw         <job status>                 broken
 test-xtf-amd64-amd64-4          <job status>                 broken
 test-xtf-amd64-amd64-5          <job status>                 broken
 build-arm64-xsm               4 host-install(4)        broken REGR. vs. 187415
 build-arm64                   4 host-install(4)        broken REGR. vs. 187415
 build-arm64-pvops             4 host-install(4)        broken REGR. vs. 187415
 test-armhf-armhf-xl     10 host-ping-check-xen fail in 187431 REGR. vs. 187415

Tests which are failing intermittently (not blocking):
 test-armhf-armhf-xl           5 host-install(5)          broken pass in 187431
 test-armhf-armhf-libvirt-vhd  5 host-install(5)          broken pass in 187431
 test-armhf-armhf-xl-raw       5 host-install(5)          broken pass in 187431
 test-armhf-armhf-xl-credit1   5 host-install(5)          broken pass in 187431
 test-armhf-armhf-xl-multivcpu  5 host-install(5)         broken pass in 187431
 test-armhf-armhf-xl-qcow2     5 host-install(5)          broken pass in 187431
 test-armhf-armhf-xl-arndale   5 host-install(5)          broken pass in 187431
 test-armhf-armhf-xl-rtds      5 host-install(5)          broken pass in 187431
 test-armhf-armhf-xl-credit2   5 host-install(5)          broken pass in 187431
 test-armhf-armhf-examine      5 host-install             broken pass in 187431
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 5 host-install(5) broken pass in 187431
 test-amd64-amd64-libvirt-xsm  5 host-install(5)          broken pass in 187431
 test-amd64-amd64-xl-qemuu-ws16-amd64  5 host-install(5)  broken pass in 187431
 test-amd64-amd64-pair         6 host-install/src_host(6) broken pass in 187431
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict 5 host-install(5) broken pass in 187431
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm 5 host-install(5) broken pass in 187431
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm 5 host-install(5) broken pass in 187431
 test-amd64-amd64-xl-multivcpu  5 host-install(5)         broken pass in 187431
 test-amd64-amd64-pair         7 host-install/dst_host(7) broken pass in 187431
 test-amd64-amd64-xl-vhd       5 host-install(5)          broken pass in 187431
 test-amd64-amd64-dom0pvh-xl-amd  5 host-install(5)       broken pass in 187431
 test-amd64-amd64-livepatch    5 host-install(5)          broken pass in 187431
 test-xtf-amd64-amd64-1        5 host-install(5)          broken pass in 187431
 test-amd64-amd64-xl-pvshim    5 host-install(5)          broken pass in 187431
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow 5 host-install(5) broken pass in 187431
 test-amd64-amd64-xl-qemut-debianhvm-amd64 5 host-install(5) broken pass in 187431
 test-amd64-amd64-xl-qemuu-ovmf-amd64  5 host-install(5)  broken pass in 187431
 test-amd64-amd64-xl-qemuu-win7-amd64  5 host-install(5)  broken pass in 187431
 test-amd64-amd64-xl-credit2   5 host-install(5)          broken pass in 187431
 test-xtf-amd64-amd64-2        5 host-install(5)          broken pass in 187431
 test-amd64-amd64-xl-qemuu-debianhvm-amd64 5 host-install(5) broken pass in 187431
 test-amd64-amd64-xl           5 host-install(5)          broken pass in 187431
 test-amd64-amd64-libvirt-vhd  5 host-install(5)          broken pass in 187431
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm 5 host-install(5) broken pass in 187431
 test-amd64-amd64-xl-qemut-ws16-amd64  5 host-install(5)  broken pass in 187431
 test-amd64-amd64-migrupgrade  6 host-install/src_host(6) broken pass in 187431
 test-amd64-amd64-migrupgrade  7 host-install/dst_host(7) broken pass in 187431
 test-amd64-amd64-examine-uefi  5 host-install            broken pass in 187431
 test-amd64-amd64-xl-credit1   5 host-install(5)          broken pass in 187431
 test-amd64-amd64-dom0pvh-xl-intel  5 host-install(5)     broken pass in 187431
 test-amd64-amd64-xl-xsm       5 host-install(5)          broken pass in 187431
 test-amd64-amd64-qemuu-nested-intel  5 host-install(5)   broken pass in 187431
 test-amd64-amd64-qemuu-freebsd11-amd64 5 host-install(5) broken pass in 187431
 test-amd64-amd64-xl-qemut-win7-amd64  5 host-install(5)  broken pass in 187431
 test-amd64-amd64-xl-qcow2     5 host-install(5)          broken pass in 187431
 test-amd64-amd64-pygrub       5 host-install(5)          broken pass in 187431
 test-amd64-amd64-qemuu-freebsd12-amd64 5 host-install(5) broken pass in 187431
 test-xtf-amd64-amd64-4        5 host-install(5)          broken pass in 187431
 test-amd64-amd64-xl-pvhv2-intel  5 host-install(5)       broken pass in 187431
 test-amd64-amd64-xl-shadow    5 host-install(5)          broken pass in 187431
 test-amd64-amd64-libvirt-qcow2  5 host-install(5)        broken pass in 187431
 test-amd64-amd64-libvirt-pair 6 host-install/src_host(6) broken pass in 187431
 test-amd64-amd64-libvirt      5 host-install(5)          broken pass in 187431
 test-amd64-amd64-examine-bios  5 host-install            broken pass in 187431
 test-amd64-amd64-libvirt-pair 7 host-install/dst_host(7) broken pass in 187431
 test-amd64-amd64-libvirt-raw  5 host-install(5)          broken pass in 187431
 test-xtf-amd64-amd64-3        5 host-install(5)          broken pass in 187431
 test-amd64-amd64-xl-pvhv2-amd  5 host-install(5)         broken pass in 187431
 test-amd64-amd64-xl-rtds      5 host-install(5)          broken pass in 187431
 test-amd64-amd64-xl-raw       5 host-install(5)          broken pass in 187431
 test-amd64-amd64-qemuu-nested-amd  5 host-install(5)     broken pass in 187431
 test-xtf-amd64-amd64-5        5 host-install(5)          broken pass in 187431
 test-armhf-armhf-libvirt      5 host-install(5)          broken pass in 187431
 test-amd64-coresched-amd64-xl  5 host-install(5)         broken pass in 187431
 test-amd64-amd64-examine      5 host-install             broken pass in 187431

Tests which did not succeed, but are not blocking:
 build-arm64-libvirt           1 build-check(1)               blocked  n/a
 test-arm64-arm64-examine      1 build-check(1)               blocked  n/a
 test-arm64-arm64-libvirt-raw  1 build-check(1)               blocked  n/a
 test-arm64-arm64-libvirt-xsm  1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl           1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-credit1   1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-credit2   1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-thunderx  1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-vhd       1 build-check(1)               blocked  n/a
 test-arm64-arm64-xl-xsm       1 build-check(1)               blocked  n/a
 test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stop  fail in 187431 like 187415
 test-amd64-amd64-xl-qemuu-ws16-amd64 19 guest-stop  fail in 187431 like 187415
 test-amd64-amd64-xl-qemuu-win7-amd64 19 guest-stop  fail in 187431 like 187415
 test-armhf-armhf-libvirt 16 saverestore-support-check fail in 187431 like 187415
 test-amd64-amd64-xl-qemut-ws16-amd64 19 guest-stop  fail in 187431 like 187415
 test-amd64-amd64-qemuu-nested-amd 20 debian-hvm-install/l1/l2 fail in 187431 like 187415
 test-amd64-amd64-libvirt-xsm 15 migrate-support-check fail in 187431 never pass
 test-amd64-amd64-libvirt    15 migrate-support-check fail in 187431 never pass
 test-arm64-arm64-xl-thunderx 15 migrate-support-check fail in 187431 never pass
 test-arm64-arm64-xl-thunderx 16 saverestore-support-check fail in 187431 never pass
 test-arm64-arm64-xl         15 migrate-support-check fail in 187431 never pass
 test-arm64-arm64-xl     16 saverestore-support-check fail in 187431 never pass
 test-arm64-arm64-xl-credit2 15 migrate-support-check fail in 187431 never pass
 test-arm64-arm64-xl-credit2 16 saverestore-support-check fail in 187431 never pass
 test-arm64-arm64-xl-credit1 15 migrate-support-check fail in 187431 never pass
 test-arm64-arm64-xl-credit1 16 saverestore-support-check fail in 187431 never pass
 test-arm64-arm64-libvirt-xsm 15 migrate-support-check fail in 187431 never pass
 test-arm64-arm64-libvirt-xsm 16 saverestore-support-check fail in 187431 never pass
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm 13 migrate-support-check fail in 187431 never pass
 test-armhf-armhf-xl-multivcpu 15 migrate-support-check fail in 187431 never pass
 test-armhf-armhf-xl-multivcpu 16 saverestore-support-check fail in 187431 never pass
 test-armhf-armhf-xl-credit2 15 migrate-support-check fail in 187431 never pass
 test-armhf-armhf-xl-credit2 16 saverestore-support-check fail in 187431 never pass
 test-amd64-amd64-libvirt-qcow2 14 migrate-support-check fail in 187431 never pass
 test-amd64-amd64-libvirt-raw 14 migrate-support-check fail in 187431 never pass
 test-arm64-arm64-xl-xsm     15 migrate-support-check fail in 187431 never pass
 test-arm64-arm64-xl-xsm 16 saverestore-support-check fail in 187431 never pass
 test-amd64-amd64-libvirt-vhd 14 migrate-support-check fail in 187431 never pass
 test-arm64-arm64-libvirt-raw 14 migrate-support-check fail in 187431 never pass
 test-arm64-arm64-libvirt-raw 15 saverestore-support-check fail in 187431 never pass
 test-armhf-armhf-xl-qcow2   14 migrate-support-check fail in 187431 never pass
 test-armhf-armhf-xl-qcow2 15 saverestore-support-check fail in 187431 never pass
 test-arm64-arm64-xl-vhd     14 migrate-support-check fail in 187431 never pass
 test-arm64-arm64-xl-vhd 15 saverestore-support-check fail in 187431 never pass
 test-armhf-armhf-xl-credit1 15 migrate-support-check fail in 187431 never pass
 test-armhf-armhf-xl-credit1 16 saverestore-support-check fail in 187431 never pass
 test-armhf-armhf-libvirt-vhd 14 migrate-support-check fail in 187431 never pass
 test-armhf-armhf-libvirt-vhd 15 saverestore-support-check fail in 187431 never pass
 test-armhf-armhf-xl-arndale 15 migrate-support-check fail in 187431 never pass
 test-armhf-armhf-xl-arndale 16 saverestore-support-check fail in 187431 never pass
 test-armhf-armhf-xl-rtds    15 migrate-support-check fail in 187431 never pass
 test-armhf-armhf-xl-rtds 16 saverestore-support-check fail in 187431 never pass
 test-armhf-armhf-libvirt    15 migrate-support-check fail in 187431 never pass
 test-armhf-armhf-xl-raw     14 migrate-support-check fail in 187431 never pass
 test-armhf-armhf-xl-raw 15 saverestore-support-check fail in 187431 never pass

version targeted for testing:
 xen                  1436593d5f8f7f700478e307d5198535ba69f88d
baseline version:
 xen                  99f942f3d410059dc223ee0a908827e928ef3592

Last test of basis   187415  2024-08-30 05:21:05 Z    1 days
Testing same since   187431  2024-08-31 01:39:54 Z    0 days    2 attempts

------------------------------------------------------------
People who touched revisions under test:
  Andrew Cooper <andrew.cooper3@citrix.com>
  Anthony PERARD <anthony.perard@vates.tech>
  Christian Lindig <christian.lindig@cloud.com>
  Victor Lira <victorm.lira@amd.com>

jobs:
 build-amd64-xsm                                              pass    
 build-arm64-xsm                                              broken  
 build-i386-xsm                                               pass    
 build-amd64-xtf                                              pass    
 build-amd64                                                  pass    
 build-arm64                                                  broken  
 build-armhf                                                  pass    
 build-i386                                                   pass    
 build-amd64-libvirt                                          pass    
 build-arm64-libvirt                                          blocked 
 build-armhf-libvirt                                          pass    
 build-i386-libvirt                                           pass    
 build-amd64-prev                                             pass    
 build-i386-prev                                              pass    
 build-amd64-pvops                                            pass    
 build-arm64-pvops                                            broken  
 build-armhf-pvops                                            pass    
 build-i386-pvops                                             pass    
 test-xtf-amd64-amd64-1                                       broken  
 test-xtf-amd64-amd64-2                                       broken  
 test-xtf-amd64-amd64-3                                       broken  
 test-xtf-amd64-amd64-4                                       broken  
 test-xtf-amd64-amd64-5                                       broken  
 test-amd64-amd64-xl                                          broken  
 test-amd64-coresched-amd64-xl                                broken  
 test-arm64-arm64-xl                                          blocked 
 test-armhf-armhf-xl                                          broken  
 test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm           broken  
 test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm        broken  
 test-amd64-amd64-xl-qemut-debianhvm-i386-xsm                 broken  
 test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm                 broken  
 test-amd64-amd64-libvirt-xsm                                 broken  
 test-arm64-arm64-libvirt-xsm                                 blocked 
 test-amd64-amd64-xl-xsm                                      broken  
 test-arm64-arm64-xl-xsm                                      blocked 
 test-amd64-amd64-qemuu-nested-amd                            broken  
 test-amd64-amd64-xl-pvhv2-amd                                broken  
 test-amd64-amd64-dom0pvh-xl-amd                              broken  
 test-amd64-amd64-xl-qemut-debianhvm-amd64                    broken  
 test-amd64-amd64-xl-qemuu-debianhvm-amd64                    broken  
 test-amd64-amd64-qemuu-freebsd11-amd64                       broken  
 test-amd64-amd64-qemuu-freebsd12-amd64                       broken  
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         broken  
 test-amd64-amd64-xl-qemut-win7-amd64                         broken  
 test-amd64-amd64-xl-qemuu-win7-amd64                         broken  
 test-amd64-amd64-xl-qemut-ws16-amd64                         broken  
 test-amd64-amd64-xl-qemuu-ws16-amd64                         broken  
 test-armhf-armhf-xl-arndale                                  broken  
 test-amd64-amd64-examine-bios                                fail    
 test-amd64-amd64-xl-credit1                                  broken  
 test-arm64-arm64-xl-credit1                                  blocked 
 test-armhf-armhf-xl-credit1                                  broken  
 test-amd64-amd64-xl-credit2                                  broken  
 test-arm64-arm64-xl-credit2                                  blocked 
 test-armhf-armhf-xl-credit2                                  broken  
 test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict        broken  
 test-amd64-amd64-examine                                     fail    
 test-arm64-arm64-examine                                     blocked 
 test-armhf-armhf-examine                                     fail    
 test-amd64-amd64-qemuu-nested-intel                          broken  
 test-amd64-amd64-xl-pvhv2-intel                              broken  
 test-amd64-amd64-dom0pvh-xl-intel                            broken  
 test-amd64-amd64-libvirt                                     broken  
 test-armhf-armhf-libvirt                                     broken  
 test-amd64-amd64-livepatch                                   broken  
 test-amd64-amd64-migrupgrade                                 broken  
 test-amd64-amd64-xl-multivcpu                                broken  
 test-armhf-armhf-xl-multivcpu                                broken  
 test-amd64-amd64-pair                                        broken  
 test-amd64-amd64-libvirt-pair                                broken  
 test-amd64-amd64-xl-pvshim                                   broken  
 test-amd64-amd64-pygrub                                      broken  
 test-amd64-amd64-libvirt-qcow2                               broken  
 test-amd64-amd64-xl-qcow2                                    broken  
 test-armhf-armhf-xl-qcow2                                    broken  
 test-amd64-amd64-libvirt-raw                                 broken  
 test-arm64-arm64-libvirt-raw                                 blocked 
 test-amd64-amd64-xl-raw                                      broken  
 test-armhf-armhf-xl-raw                                      broken  
 test-amd64-amd64-xl-rtds                                     broken  
 test-armhf-armhf-xl-rtds                                     broken  
 test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow             broken  
 test-amd64-amd64-xl-shadow                                   broken  
 test-arm64-arm64-xl-thunderx                                 blocked 
 test-amd64-amd64-examine-uefi                                fail    
 test-amd64-amd64-libvirt-vhd                                 broken  
 test-armhf-armhf-libvirt-vhd                                 broken  
 test-amd64-amd64-xl-vhd                                      broken  
 test-arm64-arm64-xl-vhd                                      blocked 


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job test-xtf-amd64-amd64-2 broken
broken-job test-xtf-amd64-amd64-3 broken
broken-job test-amd64-amd64-xl-qemuu-win7-amd64 broken
broken-job test-amd64-amd64-xl-qemuu-ovmf-amd64 broken
broken-job test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict broken
broken-job test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm broken
broken-job test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow broken
broken-job test-amd64-amd64-xl-qemuu-debianhvm-amd64 broken
broken-job test-amd64-amd64-xl-qemut-ws16-amd64 broken
broken-job test-amd64-amd64-xl-qemut-win7-amd64 broken
broken-job test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm broken
broken-job test-amd64-amd64-xl-qemut-debianhvm-i386-xsm broken
broken-job test-amd64-amd64-xl-qemut-debianhvm-amd64 broken
broken-job test-amd64-amd64-xl-qcow2 broken
broken-job test-amd64-amd64-xl-pvshim broken
broken-job test-amd64-amd64-xl-pvhv2-intel broken
broken-job test-amd64-amd64-xl-pvhv2-amd broken
broken-job build-arm64 broken
broken-job test-amd64-amd64-xl-multivcpu broken
broken-job build-arm64-pvops broken
broken-job test-amd64-amd64-xl-credit2 broken
broken-job build-arm64-xsm broken
broken-job test-amd64-amd64-xl-credit1 broken
broken-job test-amd64-amd64-xl broken
broken-job test-amd64-amd64-qemuu-nested-intel broken
broken-job test-amd64-amd64-qemuu-nested-amd broken
broken-job test-amd64-amd64-dom0pvh-xl-amd broken
broken-job test-amd64-amd64-dom0pvh-xl-intel broken
broken-job test-amd64-amd64-qemuu-freebsd12-amd64 broken
broken-job test-amd64-amd64-qemuu-freebsd11-amd64 broken
broken-job test-amd64-amd64-libvirt broken
broken-job test-amd64-amd64-pygrub broken
broken-job test-amd64-amd64-libvirt-pair broken
broken-job test-amd64-amd64-libvirt-qcow2 broken
broken-job test-amd64-amd64-pair broken
broken-job test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm broken
broken-job test-amd64-amd64-libvirt-raw broken
broken-job test-amd64-amd64-migrupgrade broken
broken-job test-amd64-amd64-libvirt-vhd broken
broken-job test-amd64-amd64-libvirt-xsm broken
broken-job test-amd64-amd64-livepatch broken
broken-job test-xtf-amd64-amd64-1 broken
broken-job test-armhf-armhf-xl-rtds broken
broken-job test-amd64-amd64-xl-qemuu-ws16-amd64 broken
broken-job test-amd64-amd64-xl-raw broken
broken-job test-amd64-amd64-xl-rtds broken
broken-job test-amd64-amd64-xl-shadow broken
broken-job test-amd64-amd64-xl-vhd broken
broken-job test-amd64-amd64-xl-xsm broken
broken-job test-amd64-coresched-amd64-xl broken
broken-job test-armhf-armhf-libvirt broken
broken-job test-armhf-armhf-libvirt-vhd broken
broken-job test-armhf-armhf-xl broken
broken-job test-armhf-armhf-xl-arndale broken
broken-job test-armhf-armhf-xl-credit1 broken
broken-job test-armhf-armhf-xl-credit2 broken
broken-job test-armhf-armhf-xl-multivcpu broken
broken-job test-armhf-armhf-xl-qcow2 broken
broken-job test-armhf-armhf-xl-raw broken
broken-job test-xtf-amd64-amd64-4 broken
broken-job test-xtf-amd64-amd64-5 broken
broken-step test-armhf-armhf-xl host-install(5)
broken-step test-armhf-armhf-libvirt-vhd host-install(5)
broken-step test-armhf-armhf-xl-raw host-install(5)
broken-step test-armhf-armhf-xl-credit1 host-install(5)
broken-step test-armhf-armhf-xl-multivcpu host-install(5)
broken-step test-armhf-armhf-xl-qcow2 host-install(5)
broken-step test-armhf-armhf-xl-arndale host-install(5)
broken-step test-armhf-armhf-xl-rtds host-install(5)
broken-step test-armhf-armhf-xl-credit2 host-install(5)
broken-step test-armhf-armhf-examine host-install
broken-step test-amd64-amd64-libvirt-qemuu-debianhvm-amd64-xsm host-install(5)
broken-step test-amd64-amd64-libvirt-xsm host-install(5)
broken-step test-amd64-amd64-xl-qemuu-ws16-amd64 host-install(5)
broken-step test-amd64-amd64-pair host-install/src_host(6)
broken-step test-amd64-amd64-xl-qemuu-dmrestrict-amd64-dmrestrict host-install(5)
broken-step test-amd64-amd64-xl-qemut-debianhvm-i386-xsm host-install(5)
broken-step test-amd64-amd64-xl-qemut-stubdom-debianhvm-amd64-xsm host-install(5)
broken-step test-amd64-amd64-xl-multivcpu host-install(5)
broken-step test-amd64-amd64-pair host-install/dst_host(7)
broken-step test-amd64-amd64-xl-vhd host-install(5)
broken-step test-amd64-amd64-dom0pvh-xl-amd host-install(5)
broken-step test-amd64-amd64-livepatch host-install(5)
broken-step test-xtf-amd64-amd64-1 host-install(5)
broken-step test-amd64-amd64-xl-pvshim host-install(5)
broken-step test-amd64-amd64-xl-qemuu-debianhvm-amd64-shadow host-install(5)
broken-step test-amd64-amd64-xl-qemut-debianhvm-amd64 host-install(5)
broken-step test-amd64-amd64-xl-qemuu-ovmf-amd64 host-install(5)
broken-step test-amd64-amd64-xl-qemuu-win7-amd64 host-install(5)
broken-step test-amd64-amd64-xl-credit2 host-install(5)
broken-step test-xtf-amd64-amd64-2 host-install(5)
broken-step test-amd64-amd64-xl-qemuu-debianhvm-amd64 host-install(5)
broken-step test-amd64-amd64-xl host-install(5)
broken-step test-amd64-amd64-libvirt-vhd host-install(5)
broken-step test-amd64-amd64-xl-qemuu-debianhvm-i386-xsm host-install(5)
broken-step test-amd64-amd64-xl-qemut-ws16-amd64 host-install(5)
broken-step test-amd64-amd64-migrupgrade host-install/src_host(6)
broken-step test-amd64-amd64-migrupgrade host-install/dst_host(7)
broken-step test-amd64-amd64-examine-uefi host-install
broken-step test-amd64-amd64-xl-credit1 host-install(5)
broken-step test-amd64-amd64-dom0pvh-xl-intel host-install(5)
broken-step test-amd64-amd64-xl-xsm host-install(5)
broken-step test-amd64-amd64-qemuu-nested-intel host-install(5)
broken-step test-amd64-amd64-qemuu-freebsd11-amd64 host-install(5)
broken-step test-amd64-amd64-xl-qemut-win7-amd64 host-install(5)
broken-step test-amd64-amd64-xl-qcow2 host-install(5)
broken-step test-amd64-amd64-pygrub host-install(5)
broken-step test-amd64-amd64-qemuu-freebsd12-amd64 host-install(5)
broken-step test-xtf-amd64-amd64-4 host-install(5)
broken-step test-amd64-amd64-xl-pvhv2-intel host-install(5)
broken-step test-amd64-amd64-xl-shadow host-install(5)
broken-step test-amd64-amd64-libvirt-qcow2 host-install(5)
broken-step test-amd64-amd64-libvirt-pair host-install/src_host(6)
broken-step test-amd64-amd64-libvirt host-install(5)
broken-step test-amd64-amd64-examine-bios host-install
broken-step test-amd64-amd64-libvirt-pair host-install/dst_host(7)
broken-step test-amd64-amd64-libvirt-raw host-install(5)
broken-step test-xtf-amd64-amd64-3 host-install(5)
broken-step test-amd64-amd64-xl-pvhv2-amd host-install(5)
broken-step test-amd64-amd64-xl-rtds host-install(5)
broken-step test-amd64-amd64-xl-raw host-install(5)
broken-step test-amd64-amd64-qemuu-nested-amd host-install(5)
broken-step test-xtf-amd64-amd64-5 host-install(5)
broken-step build-arm64-xsm host-install(4)
broken-step build-arm64 host-install(4)
broken-step build-arm64-pvops host-install(4)
broken-step test-armhf-armhf-libvirt host-install(5)
broken-step test-amd64-coresched-amd64-xl host-install(5)
broken-step test-amd64-amd64-examine host-install

Not pushing.

------------------------------------------------------------
commit 1436593d5f8f7f700478e307d5198535ba69f88d
Author: Anthony PERARD <anthony.perard@vates.tech>
Date:   Fri Aug 30 09:49:40 2024 +0000

    libxl: Probe QEMU for -run-with user=user and use it
    
    "-runas" is deprecated since QEMU 9.1 and will be remove in a future
    release.
    
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>

commit 82335a8cc54c009792d44f0be51213da48303a68
Author: Anthony PERARD <anthony.perard@vates.tech>
Date:   Fri Aug 30 09:49:40 2024 +0000

    libxl: Probe QEMU for -run-with chroot=dir and use it
    
    QEMU 9.0 have removed "-chroot" command line option, which have been
    deprecated since QEMU 8.1 in favor of "-run-with chroot=dir".
    
    Look into the result of the QMP command "query-command-line-options"
    to find out if "-run-with chroot=dir" is available. Then use it in
    place of "-chroot".
    
    Resolves: xen-project/xen#187
    Signed-off-by: Anthony PERARD <anthony.perard@vates.tech>
    Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>

commit 7ab0f83e604d44c92daa218423bf7644502fcefe
Author: Andrew Cooper <andrew.cooper3@citrix.com>
Date:   Wed Aug 28 20:20:34 2024 +0100

    x86/pv: Make cr4_pv32_mask be PV32-only
    
    The user of cr4_pv32_mask (the cr4_pv32_restore() function) only exists in a
    CONFIG_PV32 build, but right now the variable is unconditionally set up.
    
    To start with, move the setup into set_in_cr4() and remove it from it's
    somewhat ad-hoc position in __start_xen().  This means the variable will be
    set up in two steps for a CONFIG_PV32=y build, but it's cleaner and more
    robust logic overall.
    
    With that, there's no good reason for the variable to stay in setup.c.  Move
    it to x86/pv/domain.c (beside opt_pv32, for want of any better place to live),
    and move the declaration to beside set_in_cr4() and mmu_cr4_features which is
    a better position than setup.h.
    
    Guard the reference with CONFIG_PV32, and fix up a recent typo in an adjacent
    comment while at it.
    
    No functional change.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

commit 8d336fcb6ea6b486ceccef2e36d003db032131fe
Author: Andrew Cooper <andrew.cooper3@citrix.com>
Date:   Mon Jan 30 22:14:20 2023 +0000

    tools/ocaml: Factor out compatiblity handling
    
    ... rather than having each library implement its own subset.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Christian Lindig <christian.lindig@cloud.com>

commit 5e99a40ea54a6bf0bdc18241992866a642d7782b
Author: Victor Lira <victorm.lira@amd.com>
Date:   Thu Aug 29 15:34:23 2024 -0700

    automation: use expect utility in xilinx tests
    
    Fixes: 95764a0817a5 (automation: update xilinx test scripts (tty))
    This patch introduced a CI failure due to a timeout in xilinx-x86_64 test.
    
    Change xilinx-x86_64 and xilinx-arm64 scripts to use "expect" utility
    to determine test result and allow early exit from tests.
    Add "expect" to xilinx container environment (dockerfile).
    Rename references to "QEMU" in "qemu-key.exp" expect script to "TEST" to be
    used by both QEMU and hardware tests.
    
    Signed-off-by: Victor Lira <victorm.lira@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

commit 740c41ca05a83a2c3629eb2ff323877c37d95c1e
Author: Victor Lira <victorm.lira@amd.com>
Date:   Thu Aug 29 15:34:22 2024 -0700

    automation: fix false success in qemu tests
    
    Fix flaw in qemu-*.sh tests that producess a false success. The following
    lines produces success despite the "expect" script producing nonzero exit
    status:
    
        set +e
    ...
        ./automation/scripts/qemu-key.exp | sed 's/\r\+$//'
        (end of file)
    
    The default exit status for a pipeline using "|" operator is that of the
    rightmost command. Fix this by setting the "pipefail" option in the shell,
    and removing "set +e" allowing the expect script to determine the result.
    
    Signed-off-by: Victor Lira <victorm.lira@amd.com>
    Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
(qemu changes not included)


From xen-devel-bounces@lists.xenproject.org Sat Aug 31 22:32:18 2024
Return-path: <xen-devel-bounces@lists.xenproject.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Aug 2024 22:32:18 +0000
Received: from list by lists.xenproject.org with outflank-mailman.787294.1196836 (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skWdf-0001EO-6u; Sat, 31 Aug 2024 22:32:11 +0000
X-Outflank-Mailman: Message body and most headers restored to incoming version
Received: by outflank-mailman (output) from mailman id 787294.1196836; Sat, 31 Aug 2024 22:32:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xenproject.org)
	by lists.xenproject.org with esmtp (Exim 4.92)
	(envelope-from <xen-devel-bounces@lists.xenproject.org>)
	id 1skWdf-0001EH-3v; Sat, 31 Aug 2024 22:32:11 +0000
Received: by outflank-mailman (input) for mailman id 787294;
 Sat, 31 Aug 2024 22:32:10 +0000
Received: from mail.xenproject.org ([104.130.215.37])
 by lists.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skWde-0001E7-7B; Sat, 31 Aug 2024 22:32:10 +0000
Received: from host146.205.237.98.conversent.net ([205.237.98.146]
 helo=infra.test-lab.xenproject.org)
 by mail.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skWde-000405-1R; Sat, 31 Aug 2024 22:32:10 +0000
Received: from [172.16.148.1] (helo=osstest.test-lab.xenproject.org)
 by infra.test-lab.xenproject.org with esmtp (Exim 4.92)
 (envelope-from <osstest-admin@xenproject.org>)
 id 1skWdd-00017V-JF; Sat, 31 Aug 2024 22:32:09 +0000
Received: from osstest by osstest.test-lab.xenproject.org with local (Exim
 4.92) (envelope-from <osstest-admin@xenproject.org>)
 id 1skWdd-00086F-Iq; Sat, 31 Aug 2024 22:32:09 +0000
X-BeenThere: xen-devel@lists.xenproject.org
List-Id: Xen developer discussion <xen-devel.lists.xenproject.org>
List-Unsubscribe: <https://lists.xenproject.org/mailman/options/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=unsubscribe>
List-Post: <mailto:xen-devel@lists.xenproject.org>
List-Help: <mailto:xen-devel-request@lists.xenproject.org?subject=help>
List-Subscribe: <https://lists.xenproject.org/mailman/listinfo/xen-devel>,
 <mailto:xen-devel-request@lists.xenproject.org?subject=subscribe>
Errors-To: xen-devel-bounces@lists.xenproject.org
Precedence: list
Sender: "Xen-devel" <xen-devel-bounces@lists.xenproject.org>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
	d=xenproject.org; s=20200302mail; h=Date:From:Subject:MIME-Version:
	Content-Transfer-Encoding:Content-Type:Message-ID:To;
	bh=xE0T6nwZCcAyKbd4jK8aGjitJRxom+9f0/YTjJG+kMk=; b=S/7SIAt/CBvkcXjtaVGVKKHgfT
	iolH5t6OcjidZjLtluop3ddRLv3/iuc/B3+oeHpTVaaIeQvC7nlUZVnh6b7WxY/XiOpiA59rsCQUK
	o3n9pKau9JgWVIvBE4VeYzsdBmhKp+Y34gZpRts8HlN4FKp3DQbLy5DTdrlyhA4dla7U=;
To: xen-devel@lists.xenproject.org
Message-ID: <osstest-187440-mainreport@xen.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
Subject: [ovmf test] 187440: trouble: blocked/broken
X-Osstest-Failures:
    ovmf:build-amd64:<job status>:broken:regression
    ovmf:build-amd64-pvops:<job status>:broken:regression
    ovmf:build-amd64-xsm:<job status>:broken:regression
    ovmf:build-i386:<job status>:broken:regression
    ovmf:build-i386-pvops:<job status>:broken:regression
    ovmf:build-i386-xsm:<job status>:broken:regression
    ovmf:build-i386-xsm:host-install(4):broken:regression
    ovmf:build-i386-pvops:host-install(4):broken:regression
    ovmf:build-i386:host-install(4):broken:regression
    ovmf:build-amd64:host-install(4):broken:regression
    ovmf:build-amd64-pvops:host-install(4):broken:regression
    ovmf:build-amd64-xsm:host-install(4):broken:regression
    ovmf:build-amd64-libvirt:build-check(1):blocked:nonblocking
    ovmf:build-i386-libvirt:build-check(1):blocked:nonblocking
    ovmf:test-amd64-amd64-xl-qemuu-ovmf-amd64:build-check(1):blocked:nonblocking
X-Osstest-Versions-This:
    ovmf=f7abf6af2db7a823aa139fbbf8a82d209aca4998
X-Osstest-Versions-That:
    ovmf=96b90e150c2f107c64a827e82451b642a42df686
From: osstest service owner <osstest-admin@xenproject.org>
Date: Sat, 31 Aug 2024 22:32:09 +0000

flight 187440 ovmf real [real]
http://logs.test-lab.xenproject.org/osstest/logs/187440/

Failures and problems with tests :-(

Tests which did not succeed and are blocking,
including tests which could not be run:
 build-amd64                     <job status>                 broken
 build-amd64-pvops               <job status>                 broken
 build-amd64-xsm                 <job status>                 broken
 build-i386                      <job status>                 broken
 build-i386-pvops                <job status>                 broken
 build-i386-xsm                  <job status>                 broken
 build-i386-xsm                4 host-install(4)        broken REGR. vs. 187436
 build-i386-pvops              4 host-install(4)        broken REGR. vs. 187436
 build-i386                    4 host-install(4)        broken REGR. vs. 187436
 build-amd64                   4 host-install(4)        broken REGR. vs. 187436
 build-amd64-pvops             4 host-install(4)        broken REGR. vs. 187436
 build-amd64-xsm               4 host-install(4)        broken REGR. vs. 187436

Tests which did not succeed, but are not blocking:
 build-amd64-libvirt           1 build-check(1)               blocked  n/a
 build-i386-libvirt            1 build-check(1)               blocked  n/a
 test-amd64-amd64-xl-qemuu-ovmf-amd64  1 build-check(1)             blocked n/a

version targeted for testing:
 ovmf                 f7abf6af2db7a823aa139fbbf8a82d209aca4998
baseline version:
 ovmf                 96b90e150c2f107c64a827e82451b642a42df686

Last test of basis   187436  2024-08-31 10:45:13 Z    0 days
Testing same since   187440  2024-08-31 17:11:30 Z    0 days    1 attempts

------------------------------------------------------------
People who touched revisions under test:
  zodf0055980 <zodf0055980@gmail.com>

jobs:
 build-amd64-xsm                                              broken  
 build-i386-xsm                                               broken  
 build-amd64                                                  broken  
 build-i386                                                   broken  
 build-amd64-libvirt                                          blocked 
 build-i386-libvirt                                           blocked 
 build-amd64-pvops                                            broken  
 build-i386-pvops                                             broken  
 test-amd64-amd64-xl-qemuu-ovmf-amd64                         blocked 


------------------------------------------------------------
sg-report-flight on osstest.test-lab.xenproject.org
logs: /home/logs/logs
images: /home/logs/images

Logs, config files, etc. are available at
    http://logs.test-lab.xenproject.org/osstest/logs

Explanation of these reports, and of osstest in general, is at
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README.email;hb=master
    http://xenbits.xen.org/gitweb/?p=osstest.git;a=blob;f=README;hb=master

Test harness code can be found at
    http://xenbits.xen.org/gitweb?p=osstest.git;a=summary

broken-job build-amd64 broken
broken-job build-amd64-pvops broken
broken-job build-amd64-xsm broken
broken-job build-i386 broken
broken-job build-i386-pvops broken
broken-job build-i386-xsm broken
broken-step build-i386-xsm host-install(4)
broken-step build-i386-pvops host-install(4)
broken-step build-i386 host-install(4)
broken-step build-amd64 host-install(4)
broken-step build-amd64-pvops host-install(4)
broken-step build-amd64-xsm host-install(4)

Not pushing.

------------------------------------------------------------
commit f7abf6af2db7a823aa139fbbf8a82d209aca4998
Author: zodf0055980 <zodf0055980@gmail.com>
Date:   Wed Aug 21 15:18:08 2024 +0800

    SecurityPkg: Fix exponent unmarshaled as 16 bits
    
    According issue #5536, exponent is 32 bits but is unmarshaled as 16 bits.
    
    Signed-off-by: zodf0055980 <zodf0055980@gmail.com>


